From: Andrea Amorese Date: Mon, 15 Nov 2021 16:23:22 +0000 (+0100) Subject: Built motion from commit 107dfbfd.|2.5.38 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=4fdb91d37f32eb63c00cd4a6ed3b97d1ba74c650;p=motion2.git Built motion from commit 107dfbfd.|2.5.38 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 5a0d7b0..6e04bf9 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-15T15:45:23.098Z", + "time": "2021-11-15T16:07:22.101Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 6fb6742..340552d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-15T15:45:23.098Z", + "time": "2021-11-15T16:07:22.101Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 2adff88..2cf0d88 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 _0x370d=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x346220,_0x3b77a8){var _0x542ca6=function(_0x63e9d6){while(--_0x63e9d6){_0x346220['push'](_0x346220['shift']());}};_0x542ca6(++_0x3b77a8);}(_0x370d,0x194));var _0xd370=function(_0x52b539,_0x50e7b1){_0x52b539=_0x52b539-0x0;var _0x553aa7=_0x370d[_0x52b539];return _0x553aa7;};'use strict';var Sequelize=require(_0xd370('0x0'));module['exports']={'name':{'type':Sequelize[_0xd370('0x1')],'get':function(_0x508794){return this[_0xd370('0x2')](_0xd370('0x3'));}},'action':{'type':Sequelize[_0xd370('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd370('0x5'),_0xd370('0x6'),_0xd370('0x7'),_0xd370('0x8'),_0xd370('0x9'),_0xd370('0xa'),_0xd370('0xb'),_0xd370('0xc')]],'msg':_0xd370('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xd370('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xd370('0x4')](0x1000),'comment':_0xd370('0xe')},'data3':{'type':Sequelize[_0xd370('0x4')](0x1000),'comment':_0xd370('0xf')},'data4':{'type':Sequelize[_0xd370('0x4')](0x1000),'comments':_0xd370('0x10')},'data5':{'type':Sequelize[_0xd370('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xd370('0x4')],'comments':_0xd370('0x11')},'data7':{'type':Sequelize[_0xd370('0x12')],'comments':_0xd370('0x13')}}; \ No newline at end of file +var _0xcb07=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty'];(function(_0xea8eb3,_0x2c0514){var _0x1b24ba=function(_0x5e8635){while(--_0x5e8635){_0xea8eb3['push'](_0xea8eb3['shift']());}};_0x1b24ba(++_0x2c0514);}(_0xcb07,0x98));var _0x7cb0=function(_0x1b964a,_0x40fdc2){_0x1b964a=_0x1b964a-0x0;var _0x2559fa=_0xcb07[_0x1b964a];return _0x2559fa;};'use strict';var Sequelize=require(_0x7cb0('0x0'));module[_0x7cb0('0x1')]={'name':{'type':Sequelize[_0x7cb0('0x2')],'get':function(_0x195b62){return this[_0x7cb0('0x3')]('action');}},'action':{'type':Sequelize[_0x7cb0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7cb0('0x5'),_0x7cb0('0x6'),'motionbar',_0x7cb0('0x7'),'urlForward',_0x7cb0('0x8'),_0x7cb0('0x9'),'script']],'msg':_0x7cb0('0xa')}},'comment':_0x7cb0('0xa')},'data1':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comment':_0x7cb0('0xb')},'data2':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comment':_0x7cb0('0xc')},'data3':{'type':Sequelize[_0x7cb0('0x4')](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[_0x7cb0('0x4')](0x1000),'comments':_0x7cb0('0xd')},'data5':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x7cb0('0xe')},'data7':{'type':Sequelize[_0x7cb0('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 5c0aab4..141e30a 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 _0xa57c=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','update','then','destroy','end','error','stack','name','send','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x47dec4,_0x2797b4){var _0x1161a6=function(_0x5a83fd){while(--_0x5a83fd){_0x47dec4['push'](_0x47dec4['shift']());}};_0x1161a6(++_0x2797b4);}(_0xa57c,0xb8));var _0xca57=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa57c[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca57('0x0'));var zipdir=require(_0xca57('0x1'));var jsonpatch=require(_0xca57('0x2'));var rp=require(_0xca57('0x3'));var moment=require(_0xca57('0x4'));var BPromise=require(_0xca57('0x5'));var Mustache=require(_0xca57('0x6'));var util=require(_0xca57('0x7'));var path=require(_0xca57('0x8'));var sox=require('sox');var csv=require(_0xca57('0x9'));var ejs=require(_0xca57('0xa'));var fs=require('fs');var fs_extra=require(_0xca57('0xb'));var _=require(_0xca57('0xc'));var squel=require(_0xca57('0xd'));var crypto=require(_0xca57('0xe'));var jsforce=require(_0xca57('0xf'));var deskjs=require(_0xca57('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca57('0x11'));var Redis=require(_0xca57('0x12'));var authService=require(_0xca57('0x13'));var qs=require(_0xca57('0x14'));var as=require(_0xca57('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca57('0x16'))(_0xca57('0x17'));var utils=require(_0xca57('0x18'));var config=require(_0xca57('0x19'));var licenseUtil=require(_0xca57('0x1a'));var db=require(_0xca57('0x1b'))['db'];function respondWithStatusCode(_0x41c46f,_0x244ead){_0x244ead=_0x244ead||0xcc;return function(_0x32795f){if(_0x32795f){return _0x41c46f[_0xca57('0x1c')](_0x244ead);}return _0x41c46f[_0xca57('0x1d')](_0x244ead)['end']();};}function respondWithResult(_0x466233,_0x3be3b2){_0x3be3b2=_0x3be3b2||0xc8;return function(_0x16ef2a){if(_0x16ef2a){return _0x466233[_0xca57('0x1d')](_0x3be3b2)['json'](_0x16ef2a);}};}function respondWithFilteredResult(_0x509442,_0x4aa03b){return function(_0x56e9c5){if(_0x56e9c5){var _0x34dcf6=typeof _0x4aa03b[_0xca57('0x1e')]===_0xca57('0x1f')&&typeof _0x4aa03b[_0xca57('0x20')]===_0xca57('0x1f');var _0x46cf84=_0x56e9c5[_0xca57('0x21')];var _0x10257a=_0x34dcf6?0x0:_0x4aa03b['offset'];var _0x565f0e=_0x34dcf6?_0x56e9c5[_0xca57('0x21')]:_0x4aa03b[_0xca57('0x1e')]+_0x4aa03b['limit'];var _0x4b3eaf;if(_0x565f0e>=_0x46cf84){_0x565f0e=_0x46cf84;_0x4b3eaf=0xc8;}else{_0x4b3eaf=0xce;}_0x509442[_0xca57('0x1d')](_0x4b3eaf);return _0x509442['set']('Content-Range',_0x10257a+'-'+_0x565f0e+'/'+_0x46cf84)[_0xca57('0x22')](_0x56e9c5);}return null;};}function patchUpdates(_0xd608b0){return function(_0xcb04d3){try{jsonpatch[_0xca57('0x23')](_0xcb04d3,_0xd608b0,!![]);}catch(_0x3d38e7){return BPromise['reject'](_0x3d38e7);}return _0xcb04d3['save']();};}function saveUpdates(_0x3b2153,_0x4d5bef){return function(_0x3334fa){if(_0x3334fa){return _0x3334fa[_0xca57('0x24')](_0x3b2153)[_0xca57('0x25')](function(_0x11b5f8){return _0x11b5f8;});}return null;};}function removeEntity(_0xe28f89,_0x2ddd73){return function(_0x3ab972){if(_0x3ab972){return _0x3ab972[_0xca57('0x26')]()['then'](function(){_0xe28f89[_0xca57('0x1d')](0xcc)[_0xca57('0x27')]();});}};}function handleEntityNotFound(_0x361dbe,_0x33c3d7){return function(_0x433155){if(!_0x433155){_0x361dbe['sendStatus'](0x194);}return _0x433155;};}function handleError(_0x3ea14a,_0x552b17){_0x552b17=_0x552b17||0x1f4;return function(_0x56960c){logger[_0xca57('0x28')](_0x56960c[_0xca57('0x29')]);if(_0x56960c['name']){delete _0x56960c[_0xca57('0x2a')];}_0x3ea14a[_0xca57('0x1d')](_0x552b17)[_0xca57('0x2b')](_0x56960c);};}exports[_0xca57('0x24')]=function(_0x11c295,_0x411c4a){if(_0x11c295['body']['id']){delete _0x11c295['body']['id'];}return db['Action'][_0xca57('0x2c')]({'where':{'id':_0x11c295['params']['id']}})[_0xca57('0x25')](handleEntityNotFound(_0x411c4a,null))[_0xca57('0x25')](saveUpdates(_0x11c295['body'],null))[_0xca57('0x25')](respondWithResult(_0x411c4a,null))[_0xca57('0x2d')](handleError(_0x411c4a,null));};exports[_0xca57('0x26')]=function(_0x2a34b2,_0x5203a9){return db[_0xca57('0x2e')][_0xca57('0x2c')]({'where':{'id':_0x2a34b2[_0xca57('0x2f')]['id']}})[_0xca57('0x25')](handleEntityNotFound(_0x5203a9,null))['then'](removeEntity(_0x5203a9,null))[_0xca57('0x2d')](handleError(_0x5203a9,null));}; \ No newline at end of file +var _0x700e=['body','Action','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','then','destroy','end','error','stack','name','send'];(function(_0x37322d,_0x5805c6){var _0x1c09dd=function(_0xeb8b68){while(--_0xeb8b68){_0x37322d['push'](_0x37322d['shift']());}};_0x1c09dd(++_0x5805c6);}(_0x700e,0x125));var _0xe700=function(_0xa45b4c,_0x3f4980){_0xa45b4c=_0xa45b4c-0x0;var _0xc1a86c=_0x700e[_0xa45b4c];return _0xc1a86c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe700('0x0'));var zipdir=require(_0xe700('0x1'));var jsonpatch=require(_0xe700('0x2'));var rp=require(_0xe700('0x3'));var moment=require('moment');var BPromise=require(_0xe700('0x4'));var Mustache=require(_0xe700('0x5'));var util=require(_0xe700('0x6'));var path=require('path');var sox=require(_0xe700('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe700('0x8'));var _=require(_0xe700('0x9'));var squel=require(_0xe700('0xa'));var crypto=require(_0xe700('0xb'));var jsforce=require(_0xe700('0xc'));var deskjs=require(_0xe700('0xd'));var toCsv=require(_0xe700('0xe'));var querystring=require(_0xe700('0xf'));var Papa=require(_0xe700('0x10'));var Redis=require(_0xe700('0x11'));var authService=require(_0xe700('0x12'));var qs=require(_0xe700('0x13'));var as=require(_0xe700('0x14'));var hardwareService=require(_0xe700('0x15'));var logger=require('../../config/logger')(_0xe700('0x16'));var utils=require(_0xe700('0x17'));var config=require(_0xe700('0x18'));var licenseUtil=require(_0xe700('0x19'));var db=require(_0xe700('0x1a'))['db'];function respondWithStatusCode(_0x27b7b8,_0x14afea){_0x14afea=_0x14afea||0xcc;return function(_0x1f7823){if(_0x1f7823){return _0x27b7b8[_0xe700('0x1b')](_0x14afea);}return _0x27b7b8['status'](_0x14afea)['end']();};}function respondWithResult(_0x29c3b5,_0x24bccc){_0x24bccc=_0x24bccc||0xc8;return function(_0x1dfc39){if(_0x1dfc39){return _0x29c3b5[_0xe700('0x1c')](_0x24bccc)[_0xe700('0x1d')](_0x1dfc39);}};}function respondWithFilteredResult(_0x46ed46,_0x339b61){return function(_0x2d6c5f){if(_0x2d6c5f){var _0x410e39=typeof _0x339b61[_0xe700('0x1e')]===_0xe700('0x1f')&&typeof _0x339b61['limit']===_0xe700('0x1f');var _0x1c41ed=_0x2d6c5f[_0xe700('0x20')];var _0xa277f6=_0x410e39?0x0:_0x339b61[_0xe700('0x1e')];var _0x478677=_0x410e39?_0x2d6c5f[_0xe700('0x20')]:_0x339b61[_0xe700('0x1e')]+_0x339b61[_0xe700('0x21')];var _0x24147e;if(_0x478677>=_0x1c41ed){_0x478677=_0x1c41ed;_0x24147e=0xc8;}else{_0x24147e=0xce;}_0x46ed46[_0xe700('0x1c')](_0x24147e);return _0x46ed46[_0xe700('0x22')]('Content-Range',_0xa277f6+'-'+_0x478677+'/'+_0x1c41ed)['json'](_0x2d6c5f);}return null;};}function patchUpdates(_0x2e2dd9){return function(_0x36dc47){try{jsonpatch[_0xe700('0x23')](_0x36dc47,_0x2e2dd9,!![]);}catch(_0x135416){return BPromise['reject'](_0x135416);}return _0x36dc47['save']();};}function saveUpdates(_0x4179b9,_0x3a7483){return function(_0x366f94){if(_0x366f94){return _0x366f94['update'](_0x4179b9)[_0xe700('0x24')](function(_0x13ead8){return _0x13ead8;});}return null;};}function removeEntity(_0x5ece99,_0x5ed68a){return function(_0x5c4040){if(_0x5c4040){return _0x5c4040[_0xe700('0x25')]()['then'](function(){_0x5ece99[_0xe700('0x1c')](0xcc)[_0xe700('0x26')]();});}};}function handleEntityNotFound(_0x2cda7e,_0x32a15c){return function(_0x4261bc){if(!_0x4261bc){_0x2cda7e[_0xe700('0x1b')](0x194);}return _0x4261bc;};}function handleError(_0x4d8a47,_0x1fe0ef){_0x1fe0ef=_0x1fe0ef||0x1f4;return function(_0x277f29){logger[_0xe700('0x27')](_0x277f29[_0xe700('0x28')]);if(_0x277f29['name']){delete _0x277f29[_0xe700('0x29')];}_0x4d8a47['status'](_0x1fe0ef)[_0xe700('0x2a')](_0x277f29);};}exports['update']=function(_0x2c7082,_0x46eeec){if(_0x2c7082[_0xe700('0x2b')]['id']){delete _0x2c7082[_0xe700('0x2b')]['id'];}return db[_0xe700('0x2c')][_0xe700('0x2d')]({'where':{'id':_0x2c7082['params']['id']}})[_0xe700('0x24')](handleEntityNotFound(_0x46eeec,null))['then'](saveUpdates(_0x2c7082['body'],null))['then'](respondWithResult(_0x46eeec,null))[_0xe700('0x2e')](handleError(_0x46eeec,null));};exports[_0xe700('0x25')]=function(_0x30dd56,_0x27a095){return db['Action'][_0xe700('0x2d')]({'where':{'id':_0x30dd56[_0xe700('0x2f')]['id']}})[_0xe700('0x24')](handleEntityNotFound(_0x27a095,null))[_0xe700('0x24')](removeEntity(_0x27a095,null))[_0xe700('0x2e')](handleError(_0x27a095,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 85d4244..72d3c6a 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 _0x04ca=['./action.attributes','define','Action','tools_actions','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x5ce7e2,_0x8dd5de){var _0x5224d1=function(_0x3b04f1){while(--_0x3b04f1){_0x5ce7e2['push'](_0x5ce7e2['shift']());}};_0x5224d1(++_0x8dd5de);}(_0x04ca,0x1c6));var _0xa04c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x04ca[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa04c('0x0'));var util=require('util');var logger=require(_0xa04c('0x1'))(_0xa04c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa04c('0x3'));var rimraf=require(_0xa04c('0x4'));var config=require(_0xa04c('0x5'));var attributes=require(_0xa04c('0x6'));module['exports']=function(_0x465276,_0x422021){return _0x465276[_0xa04c('0x7')](_0xa04c('0x8'),attributes,{'tableName':_0xa04c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x819d=['tools_actions','util','../../config/logger','moment','path','../../config/environment','exports','define','Action'];(function(_0x1b7228,_0xb09719){var _0x52b5f9=function(_0x48b740){while(--_0x48b740){_0x1b7228['push'](_0x1b7228['shift']());}};_0x52b5f9(++_0xb09719);}(_0x819d,0x10f));var _0xd819=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x819d[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xd819('0x0'));var logger=require(_0xd819('0x1'))('api');var moment=require(_0xd819('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd819('0x3'));var rimraf=require('rimraf');var config=require(_0xd819('0x4'));var attributes=require('./action.attributes');module[_0xd819('0x5')]=function(_0x5422e0,_0x4ca395){return _0x5422e0[_0xd819('0x6')](_0xd819('0x7'),attributes,{'tableName':_0xd819('0x8'),'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 4171f36..5df1eb1 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x5b5faa,_0x3cc849){var _0x283a5d=function(_0x2674f5){while(--_0x2674f5){_0x5b5faa['push'](_0x5b5faa['shift']());}};_0x283a5d(++_0x3cc849);}(_0x1261,0x144));var _0x1126=function(_0x3490c2,_0x548c5e){_0x3490c2=_0x3490c2-0x0;var _0x891d41=_0x1261[_0x3490c2];return _0x891d41;};'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')]('Action,\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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1a4a52,_0x2e4314){var _0x2eaeab=function(_0x382bf){while(--_0x382bf){_0x1a4a52['push'](_0x1a4a52['shift']());}};_0x2eaeab(++_0x2e4314);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 532845e..71f2227 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 _0x3e7b=['put','/:id','update','isAuthenticated','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x32f41d,_0x37a235){var _0x57195b=function(_0x2341db){while(--_0x2341db){_0x32f41d['push'](_0x32f41d['shift']());}};_0x57195b(++_0x37a235);}(_0x3e7b,0x19d));var _0xb3e7=function(_0x46e47d,_0x4d0fc9){_0x46e47d=_0x46e47d-0x0;var _0x3c8abd=_0x3e7b[_0x46e47d];return _0x3c8abd;};'use strict';var multer=require(_0xb3e7('0x0'));var util=require('util');var path=require(_0xb3e7('0x1'));var timeout=require(_0xb3e7('0x2'));var express=require(_0xb3e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb3e7('0x4'));var interaction=require(_0xb3e7('0x5'));var config=require('../../config/environment');var controller=require(_0xb3e7('0x6'));router[_0xb3e7('0x7')](_0xb3e7('0x8'),auth['isAuthenticated'](),controller[_0xb3e7('0x9')]);router['delete'](_0xb3e7('0x8'),auth[_0xb3e7('0xa')](),controller[_0xb3e7('0xb')]);module['exports']=router; \ No newline at end of file +var _0x5c72=['exports','path','connect-timeout','fs-extra','../../components/auth/service','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x7a3977,_0x4f25f1){var _0x4cba4d=function(_0x355edb){while(--_0x355edb){_0x7a3977['push'](_0x7a3977['shift']());}};_0x4cba4d(++_0x4f25f1);}(_0x5c72,0xa1));var _0x25c7=function(_0xb769d,_0x21f932){_0xb769d=_0xb769d-0x0;var _0x1d8640=_0x5c72[_0xb769d];return _0x1d8640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x25c7('0x0'));var timeout=require(_0x25c7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25c7('0x2'));var auth=require(_0x25c7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25c7('0x4'));router['put'](_0x25c7('0x5'),auth[_0x25c7('0x6')](),controller[_0x25c7('0x7')]);router[_0x25c7('0x8')](_0x25c7('0x5'),auth[_0x25c7('0x6')](),controller['destroy']);module[_0x25c7('0x9')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2759c29..51e97aa 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x1c1f16,_0x4914a8){var _0x3be0ec=function(_0x302adb){while(--_0x302adb){_0x1c1f16['push'](_0x1c1f16['shift']());}};_0x3be0ec(++_0x4914a8);}(_0x98a8,0x12c));var _0x898a=function(_0x3aad1c,_0x2e6285){_0x3aad1c=_0x3aad1c-0x0;var _0x4a6d6e=_0x98a8[_0x3aad1c];return _0x4a6d6e;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x3a1256,_0x1fe2db){var _0x1bd352=function(_0x509c54){while(--_0x509c54){_0x3a1256['push'](_0x3a1256['shift']());}};_0x1bd352(++_0x1fe2db);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'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/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d432d34..7608c61 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 _0x2bae=['dbH','end','json','offset','limit','undefined','status','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','send','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','params','rawAttributes','include','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','function','format','groupBy','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','parse','clone','debug','Limited\x20Query:','sequelize','QueryTypes','GROUP_CONCAT(%s)','ROUND(%s)','ValidationErrorItem','select','from','metric','replace','output','web','fullPath','%s-%s.%s','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','toString','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','left_join','right_join','IS\x20NULL','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x36610a,_0x5954f0){var _0x56e2ad=function(_0x577d45){while(--_0x577d45){_0x36610a['push'](_0x36610a['shift']());}};_0x56e2ad(++_0x5954f0);}(_0x2bae,0x1db));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe2ba('0x0'));var rimraf=require(_0xe2ba('0x1'));var zipdir=require(_0xe2ba('0x2'));var jsonpatch=require(_0xe2ba('0x3'));var rp=require(_0xe2ba('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe2ba('0x5'));var sox=require(_0xe2ba('0x6'));var csv=require('to-csv');var ejs=require(_0xe2ba('0x7'));var fs=require('fs');var fs_extra=require(_0xe2ba('0x8'));var _=require(_0xe2ba('0x9'));var squel=require(_0xe2ba('0xa'));var crypto=require(_0xe2ba('0xb'));var jsforce=require(_0xe2ba('0xc'));var deskjs=require(_0xe2ba('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2ba('0xe'));var Redis=require(_0xe2ba('0xf'));var authService=require(_0xe2ba('0x10'));var qs=require(_0xe2ba('0x11'));var as=require(_0xe2ba('0x12'));var hardwareService=require(_0xe2ba('0x13'));var logger=require('../../config/logger')(_0xe2ba('0x14'));var utils=require(_0xe2ba('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe2ba('0x16'))['db'];var dbH=require(_0xe2ba('0x16'))[_0xe2ba('0x17')];function respondWithStatusCode(_0x4a0a02,_0x448992){_0x448992=_0x448992||0xcc;return function(_0x2241d0){if(_0x2241d0){return _0x4a0a02['sendStatus'](_0x448992);}return _0x4a0a02['status'](_0x448992)[_0xe2ba('0x18')]();};}function respondWithResult(_0x10ab90,_0x3ce1a4){_0x3ce1a4=_0x3ce1a4||0xc8;return function(_0x302dd6){if(_0x302dd6){return _0x10ab90['status'](_0x3ce1a4)[_0xe2ba('0x19')](_0x302dd6);}};}function respondWithFilteredResult(_0x4235b6,_0x413956){return function(_0x23146e){if(_0x23146e){var _0x3db77b=typeof _0x413956[_0xe2ba('0x1a')]==='undefined'&&typeof _0x413956[_0xe2ba('0x1b')]===_0xe2ba('0x1c');var _0xce9690=_0x23146e['count'];var _0x92808c=_0x3db77b?0x0:_0x413956[_0xe2ba('0x1a')];var _0x1c7b1e=_0x3db77b?_0x23146e['count']:_0x413956['offset']+_0x413956[_0xe2ba('0x1b')];var _0x9119d0;if(_0x1c7b1e>=_0xce9690){_0x1c7b1e=_0xce9690;_0x9119d0=0xc8;}else{_0x9119d0=0xce;}_0x4235b6[_0xe2ba('0x1d')](_0x9119d0);return _0x4235b6[_0xe2ba('0x1e')](_0xe2ba('0x1f'),_0x92808c+'-'+_0x1c7b1e+'/'+_0xce9690)[_0xe2ba('0x19')](_0x23146e);}return null;};}function patchUpdates(_0x51ab20){return function(_0x390ad1){try{jsonpatch[_0xe2ba('0x20')](_0x390ad1,_0x51ab20,!![]);}catch(_0x4b4036){return BPromise[_0xe2ba('0x21')](_0x4b4036);}return _0x390ad1[_0xe2ba('0x22')]();};}function saveUpdates(_0x1b1e83,_0x3add49){return function(_0x293473){if(_0x293473){return _0x293473['update'](_0x1b1e83)[_0xe2ba('0x23')](function(_0x2c843b){return _0x2c843b;});}return null;};}function removeEntity(_0x49a155,_0x43775f){return function(_0x1fc06f){if(_0x1fc06f){return _0x1fc06f[_0xe2ba('0x24')]()[_0xe2ba('0x23')](function(){var _0x1823eb=_0x1fc06f[_0xe2ba('0x25')]({'plain':!![]});var _0x2c1683=_0xe2ba('0x26');return db[_0xe2ba('0x27')][_0xe2ba('0x24')]({'where':{'type':_0x2c1683,'resourceId':_0x1823eb['id']}})[_0xe2ba('0x23')](function(){return _0x1fc06f;});})[_0xe2ba('0x23')](function(){_0x49a155['status'](0xcc)[_0xe2ba('0x18')]();});}};}function handleEntityNotFound(_0x413b18,_0x5587bc){return function(_0x19e818){if(!_0x19e818){_0x413b18[_0xe2ba('0x28')](0x194);}return _0x19e818;};}function handleError(_0x5d73c9,_0x40bce9){_0x40bce9=_0x40bce9||0x1f4;return function(_0xb09c93){logger['error'](_0xb09c93[_0xe2ba('0x29')]);if(_0xb09c93['name']){delete _0xb09c93[_0xe2ba('0x2a')];}_0x5d73c9[_0xe2ba('0x1d')](_0x40bce9)[_0xe2ba('0x2b')](_0xb09c93);};}exports['index']=function(_0x21dcea,_0x37e811){var _0x3d9969={},_0x21b5da={},_0x3feae1={'count':0x0,'rows':[]};var _0x20a059=_[_0xe2ba('0x2c')](db[_0xe2ba('0x2d')]['rawAttributes'],function(_0x592f44){return{'name':_0x592f44[_0xe2ba('0x2e')],'type':_0x592f44[_0xe2ba('0x2f')][_0xe2ba('0x30')]};});_0x21b5da[_0xe2ba('0x31')]=_[_0xe2ba('0x2c')](_0x20a059,_0xe2ba('0x2a'));_0x21b5da[_0xe2ba('0x32')]=_[_0xe2ba('0x33')](_0x21dcea['query']);_0x21b5da[_0xe2ba('0x34')]=_[_0xe2ba('0x35')](_0x21b5da[_0xe2ba('0x31')],_0x21b5da[_0xe2ba('0x32')]);_0x3d9969[_0xe2ba('0x36')]=_['intersection'](_0x21b5da['model'],qs[_0xe2ba('0x37')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x37')]));_0x3d9969[_0xe2ba('0x36')]=_0x3d9969[_0xe2ba('0x36')]['length']?_0x3d9969[_0xe2ba('0x36')]:_0x21b5da['model'];if(!_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x38')](_0xe2ba('0x39'))){_0x3d9969[_0xe2ba('0x1b')]=qs[_0xe2ba('0x1b')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x1b')]);_0x3d9969[_0xe2ba('0x1a')]=qs['offset'](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x1a')]);}_0x3d9969[_0xe2ba('0x3a')]=qs[_0xe2ba('0x3b')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3b')]);_0x3d9969[_0xe2ba('0x3c')]=qs['filters'](_[_0xe2ba('0x3d')](_0x21dcea[_0xe2ba('0x32')],_0x21b5da[_0xe2ba('0x34')]),_0x20a059);if(_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3e')]){_0x3d9969[_0xe2ba('0x3c')]=_[_0xe2ba('0x3f')](_0x3d9969[_0xe2ba('0x3c')],{'$or':_['map'](_0x20a059,function(_0x1ba4b0){if(_0x1ba4b0['type']!==_0xe2ba('0x40')){var _0x156bef={};_0x156bef[_0x1ba4b0[_0xe2ba('0x2a')]]={'$like':'%'+_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3e')]+'%'};return _0x156bef;}})});}_0x3d9969=_[_0xe2ba('0x3f')]({},_0x3d9969,_0x21dcea['options']);var _0x5079ee={'where':_0x3d9969[_0xe2ba('0x3c')]};return db[_0xe2ba('0x2d')][_0xe2ba('0x41')](_0x5079ee)[_0xe2ba('0x23')](function(_0x39b20){_0x3feae1[_0xe2ba('0x41')]=_0x39b20;if(_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x3d9969['include']=[{'all':!![]}];}return db[_0xe2ba('0x2d')][_0xe2ba('0x43')](_0x3d9969);})[_0xe2ba('0x23')](function(_0x10ff76){_0x3feae1['rows']=_0x10ff76;return _0x3feae1;})[_0xe2ba('0x23')](respondWithFilteredResult(_0x37e811,_0x3d9969))['catch'](handleError(_0x37e811,null));};exports['show']=function(_0x5f4d05,_0x2fb518){var _0x2f255b={'raw':![],'where':{'id':_0x5f4d05[_0xe2ba('0x44')]['id']}},_0x326f02={};_0x326f02[_0xe2ba('0x31')]=_['keys'](db['AnalyticCustomReport'][_0xe2ba('0x45')]);_0x326f02['query']=_[_0xe2ba('0x33')](_0x5f4d05[_0xe2ba('0x32')]);_0x326f02[_0xe2ba('0x34')]=_[_0xe2ba('0x35')](_0x326f02[_0xe2ba('0x31')],_0x326f02['query']);_0x2f255b['attributes']=_[_0xe2ba('0x35')](_0x326f02['model'],qs[_0xe2ba('0x37')](_0x5f4d05[_0xe2ba('0x32')]['fields']));_0x2f255b[_0xe2ba('0x36')]=_0x2f255b[_0xe2ba('0x36')]['length']?_0x2f255b['attributes']:_0x326f02[_0xe2ba('0x31')];if(_0x5f4d05[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x2f255b[_0xe2ba('0x46')]=[{'all':!![]}];}_0x2f255b=_[_0xe2ba('0x3f')]({},_0x2f255b,_0x5f4d05[_0xe2ba('0x47')]);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x2f255b)[_0xe2ba('0x23')](handleEntityNotFound(_0x2fb518,null))['then'](respondWithResult(_0x2fb518,null))[_0xe2ba('0x49')](handleError(_0x2fb518,null));};exports[_0xe2ba('0x4a')]=function(_0x1d9f01,_0x10e251){return db[_0xe2ba('0x2d')][_0xe2ba('0x4a')](_0x1d9f01[_0xe2ba('0x4b')],{})[_0xe2ba('0x23')](function(_0x2eefea){var _0x98ad3f=_0x1d9f01['user']['get']({'plain':!![]});if(!_0x98ad3f)throw new Error(_0xe2ba('0x4c'));if(_0x98ad3f[_0xe2ba('0x4d')]===_0xe2ba('0x4e')){var _0x58b225=_0x2eefea[_0xe2ba('0x25')]({'plain':!![]});var _0x321c27=_0xe2ba('0x4f');return db[_0xe2ba('0x50')][_0xe2ba('0x48')]({'where':{'name':_0x321c27,'userProfileId':_0x98ad3f[_0xe2ba('0x51')]},'raw':!![]})[_0xe2ba('0x23')](function(_0x137cb3){if(_0x137cb3&&_0x137cb3[_0xe2ba('0x52')]===0x0){return db['UserProfileResource'][_0xe2ba('0x4a')]({'name':_0x58b225[_0xe2ba('0x2a')],'resourceId':_0x58b225['id'],'type':_0xe2ba('0x26'),'sectionId':_0x137cb3['id']},{})[_0xe2ba('0x23')](function(){return _0x2eefea;});}else{return _0x2eefea;}})[_0xe2ba('0x49')](function(_0x385362){logger[_0xe2ba('0x53')](_0xe2ba('0x54'),_0x385362);throw _0x385362;});}return _0x2eefea;})[_0xe2ba('0x23')](respondWithResult(_0x10e251,0xc9))[_0xe2ba('0x49')](handleError(_0x10e251,null));};exports[_0xe2ba('0x55')]=function(_0x206a74,_0x10a8f4){if(_0x206a74[_0xe2ba('0x4b')]['id']){delete _0x206a74[_0xe2ba('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xe2ba('0x48')]({'where':{'id':_0x206a74[_0xe2ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x10a8f4,null))[_0xe2ba('0x23')](saveUpdates(_0x206a74['body'],null))[_0xe2ba('0x23')](respondWithResult(_0x10a8f4,null))[_0xe2ba('0x49')](handleError(_0x10a8f4,null));};exports['destroy']=function(_0x226224,_0x44110a){return db[_0xe2ba('0x2d')][_0xe2ba('0x48')]({'where':{'id':_0x226224[_0xe2ba('0x44')]['id']}})[_0xe2ba('0x23')](handleEntityNotFound(_0x44110a,null))[_0xe2ba('0x23')](removeEntity(_0x44110a,null))[_0xe2ba('0x49')](handleError(_0x44110a,null));};exports[_0xe2ba('0x56')]=function(_0xe0e471,_0x22ccd3){var _0x2413d9=0xa;var _0x33abe1=[_0xe2ba('0x57'),'left_join','right_join',_0xe2ba('0x58')];var _0x2a3bf5={'SUM':_0xe2ba('0x59'),'COUNT':_0xe2ba('0x5a'),'COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':_0xe2ba('0x5c'),'MIN':_0xe2ba('0x5d'),'AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe2ba('0x5f'),'GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x53c935={'SEC_TO_TIME':_0xe2ba('0x61'),'DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe2ba('0x64')};var _0x46fef9=function(_0x4c34f4){return!_[_0xe2ba('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe2ba('0x66'),_0xe2ba('0x67')],_0x4c34f4);};var _0x314cb7=function(_0x1523a1){if(!_0x1523a1||!_0x1523a1[_0xe2ba('0x68')][_0xe2ba('0x69')]){return'';}for(var _0x8aae7c='(',_0x4aca05=0x0;_0x4aca05<_0x1523a1['rules']['length'];_0x4aca05+=0x1){_0x4aca05>0x0&&(_0x8aae7c+='\x20'+_0x1523a1[_0xe2ba('0x6a')]+'\x20');_0x8aae7c+=_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6b')]?_0x314cb7(_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6b')]):_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6c')]+'\x20'+_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6d')]+(_0x46fef9(_0x1523a1['rules'][_0x4aca05][_0xe2ba('0x6d')])?'\x20'+_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6e')]:'');}return _0x8aae7c+')';};var _0x24114a={'where':{'id':_0xe0e471[_0xe2ba('0x44')]['id']}},_0x2774bc,_0x56cd0f,_0x3af5a9,_0x1826ae,_0x1cc110;_0x24114a=_[_0xe2ba('0x3f')]({},_0x24114a,_0xe0e471[_0xe2ba('0x47')]);return db['AnalyticCustomReport'][_0xe2ba('0x48')](_0x24114a)[_0xe2ba('0x23')](function(_0xfade14){if(_0xfade14){_0x2774bc=_0xfade14;return _0xfade14['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x304184){if(_0x304184){if(!_0x304184['length']){throw new db[(_0xe2ba('0x6f'))]['ValidationErrorItem'](_0xe2ba('0x70'),0x193);}_0x56cd0f=_0x304184;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})[_0xe2ba('0x23')](function(_0x2931e9){if(_0x2931e9){_0x3af5a9=_[_0xe2ba('0x72')](_0x2931e9,'id');var _0x42731e;var _0x4f0d84=squel['select']();_0x4f0d84['from'](_0x2774bc['table']);for(var _0x162335=0x0;_0x162335<_0x56cd0f[_0xe2ba('0x69')];_0x162335+=0x1){_0x42731e=_0x56cd0f[_0x162335][_0xe2ba('0x73')]?_0x3af5a9[_0x56cd0f[_0x162335][_0xe2ba('0x73')]]['metric']:_0x56cd0f[_0x162335][_0xe2ba('0x6c')];_0x42731e=_0x56cd0f[_0x162335]['function']?_['replace'](_0x2a3bf5[_0x56cd0f[_0x162335][_0xe2ba('0x74')]],'%s',_0x42731e):_0x42731e;_0x42731e=_0x56cd0f[_0x162335][_0xe2ba('0x75')]?_['replace'](_0x53c935[_0x56cd0f[_0x162335]['format']],'%s',_0x42731e):_0x42731e;if(_0x56cd0f[_0x162335][_0xe2ba('0x76')]){_0x4f0d84['group'](_0x42731e);}_0x56cd0f[_0x162335]['orderBy']&&_0x4f0d84[_0xe2ba('0x3a')](_0x42731e,_0x56cd0f[_0x162335][_0xe2ba('0x77')]===_0xe2ba('0x78')?![]:!![]);_0x4f0d84[_0xe2ba('0x6c')](_0x42731e,_0x56cd0f[_0x162335][_0xe2ba('0x79')]||_0x42731e);}if(_0x2774bc[_0xe2ba('0x7a')]){_0x2774bc[_0xe2ba('0x7a')]=JSON['parse'](_0x2774bc[_0xe2ba('0x7a')]);for(var _0x10cd52=0x0;_0x10cd52<_0x2774bc[_0xe2ba('0x7a')][_0xe2ba('0x69')];_0x10cd52+=0x1){if(_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x2f')]&&_[_0xe2ba('0x65')](_0x33abe1,_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x2f')])&&_0x2774bc[_0xe2ba('0x7a')][_0x10cd52]['parentKey']&&_0x2774bc['joins'][_0x10cd52]['foreignTable']&&_0x2774bc['joins'][_0x10cd52][_0xe2ba('0x7b')]){_0x4f0d84[_0x2774bc['joins'][_0x10cd52]['type']](_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7c')],null,util['format'](_0xe2ba('0x7d'),_0x2774bc[_0xe2ba('0x7e')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7f')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7c')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7b')]));}}}if(_0x2774bc['conditions']){_0x2774bc[_0xe2ba('0x80')]=JSON[_0xe2ba('0x81')](_0x2774bc['conditions']);_0x4f0d84[_0xe2ba('0x3c')](_0x314cb7(_0x2774bc[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x1cc110=_0x4f0d84[_0xe2ba('0x82')]();_0x4f0d84[_0xe2ba('0x1b')](_0x2413d9);_0x4f0d84['offset'](0x0);logger[_0xe2ba('0x83')](_0xe2ba('0x84'),_0x4f0d84['toString']());return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x4f0d84['toString'](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')]['SELECT']});}})[_0xe2ba('0x23')](respondWithResult(_0x22ccd3,null))['catch'](handleError(_0x22ccd3,null));};function runReport(_0x31e2a6,_0x56d3f4,_0x4d5066){var _0x486d3c=_0x56d3f4[_0xe2ba('0x2a')];var _0x39f4ba=0xa;var _0x5cc5e6=[_0xe2ba('0x57'),'left_join','right_join','cross_join'];var _0x593324={'SUM':_0xe2ba('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':_0xe2ba('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x411109={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':_0xe2ba('0x88'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x6ea8f8=function(_0xea18a){return!_[_0xe2ba('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe2ba('0x66'),'IS\x20NOT\x20EMPTY'],_0xea18a);};var _0x3cfd5d=function(_0x180bd8){if(!_0x180bd8||!_0x180bd8[_0xe2ba('0x68')]['length']){return'';}for(var _0x3d9681='(',_0x32b838=0x0;_0x32b838<_0x180bd8[_0xe2ba('0x68')][_0xe2ba('0x69')];_0x32b838+=0x1){_0x32b838>0x0&&(_0x3d9681+='\x20'+_0x180bd8['operator']+'\x20');_0x3d9681+=_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6b')]?_0x3cfd5d(_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6b')]):_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6c')]+'\x20'+_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6d')]+(_0x6ea8f8(_0x180bd8[_0xe2ba('0x68')][_0x32b838]['condition'])?'\x20'+_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6e')]:'');}return _0x3d9681+')';};var _0x5df79a={'where':{'id':_0x31e2a6['id']}},_0x2712e8,_0x3326a,_0x20f802,_0xba9a28,_0x3011f3;_0x5df79a=_[_0xe2ba('0x3f')]({},_0x5df79a,_0x4d5066);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x5df79a)[_0xe2ba('0x23')](function(_0xcbf2cb){if(_0xcbf2cb){_0x2712e8=_0xcbf2cb;return _0xcbf2cb['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x572726){if(_0x572726){if(!_0x572726[_0xe2ba('0x69')]){throw new db[(_0xe2ba('0x6f'))][(_0xe2ba('0x89'))](_0xe2ba('0x70'),0x193);}_0x3326a=_0x572726;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})['then'](function(_0x3190bc){if(_0x3190bc){_0x20f802=_[_0xe2ba('0x72')](_0x3190bc,'id');var _0x1e8bc2;var _0x5ae702=squel[_0xe2ba('0x8a')]();_0x5ae702[_0xe2ba('0x8b')](_0x2712e8['table']);for(var _0x398d84=0x0;_0x398d84<_0x3326a['length'];_0x398d84+=0x1){_0x1e8bc2=_0x3326a[_0x398d84][_0xe2ba('0x73')]?_0x20f802[_0x3326a[_0x398d84][_0xe2ba('0x73')]][_0xe2ba('0x8c')]:_0x3326a[_0x398d84]['field'];_0x1e8bc2=_0x3326a[_0x398d84][_0xe2ba('0x74')]?_[_0xe2ba('0x8d')](_0x593324[_0x3326a[_0x398d84]['function']],'%s',_0x1e8bc2):_0x1e8bc2;_0x1e8bc2=_0x3326a[_0x398d84]['format']?_['replace'](_0x411109[_0x3326a[_0x398d84][_0xe2ba('0x75')]],'%s',_0x1e8bc2):_0x1e8bc2;if(_0x3326a[_0x398d84][_0xe2ba('0x76')]){_0x5ae702[_0xe2ba('0x6b')](_0x1e8bc2);}_0x3326a[_0x398d84][_0xe2ba('0x77')]&&_0x5ae702['order'](_0x1e8bc2,_0x3326a[_0x398d84][_0xe2ba('0x77')]==='DESC'?![]:!![]);_0x5ae702[_0xe2ba('0x6c')](_0x1e8bc2,_0x3326a[_0x398d84][_0xe2ba('0x79')]||_0x1e8bc2);}if(_0x2712e8['joins']){_0x2712e8[_0xe2ba('0x7a')]=JSON[_0xe2ba('0x81')](_0x2712e8[_0xe2ba('0x7a')]);for(var _0x399581=0x0;_0x399581<_0x2712e8[_0xe2ba('0x7a')]['length'];_0x399581+=0x1){if(_0x2712e8['joins'][_0x399581][_0xe2ba('0x2f')]&&_['includes'](_0x5cc5e6,_0x2712e8[_0xe2ba('0x7a')][_0x399581]['type'])&&_0x2712e8[_0xe2ba('0x7a')][_0x399581]['parentKey']&&_0x2712e8['joins'][_0x399581][_0xe2ba('0x7c')]&&_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7b')]){_0x5ae702[_0x2712e8[_0xe2ba('0x7a')][_0x399581]['type']](_0x2712e8['joins'][_0x399581][_0xe2ba('0x7c')],null,util[_0xe2ba('0x75')](_0xe2ba('0x7d'),_0x2712e8[_0xe2ba('0x7e')],_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7f')],_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7c')],_0x2712e8['joins'][_0x399581][_0xe2ba('0x7b')]));}}}if(_0x2712e8[_0xe2ba('0x80')]){_0x2712e8[_0xe2ba('0x80')]=JSON['parse'](_0x2712e8[_0xe2ba('0x80')]);_0x5ae702['where'](_0x3cfd5d(_0x2712e8[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x3011f3=_0x5ae702[_0xe2ba('0x82')]();_0x5ae702[_0xe2ba('0x1b')](_0x39f4ba);_0x5ae702['offset'](0x0);return;}})[_0xe2ba('0x23')](function(){if(_0x56d3f4[_0xe2ba('0x8e')]===_0xe2ba('0x8f')){return null;}var _0x54b008=_[_0xe2ba('0x3f')](_0x56d3f4,{'name':_0x56d3f4[_0xe2ba('0x90')]||_0x56d3f4['name']||_0x2712e8[_0xe2ba('0x2a')],'basename':_0x486d3c,'savename':util['format'](_0xe2ba('0x91'),_0x56d3f4['name']||_0x2712e8[_0xe2ba('0x2a')],require('randomstring')[_0xe2ba('0x92')](0x4),_0x56d3f4[_0xe2ba('0x8e')]||_0xe2ba('0x93')),'reportId':_0x2712e8['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xe2ba('0x4a')](_0x54b008,{'raw':!![]});})['then'](function(_0x4b3e09){if(_0x2712e8[_0xe2ba('0x7e')]==='cdr'){_0x3011f3[_0xe2ba('0x3c')](_0x2712e8[_0xe2ba('0x7e')]+_0xe2ba('0x94'),_0x56d3f4[_0xe2ba('0x95')],_0x56d3f4[_0xe2ba('0x96')]);}else{_0x3011f3[_0xe2ba('0x3c')](_0x2712e8[_0xe2ba('0x7e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56d3f4['startDate'],_0x56d3f4[_0xe2ba('0x96')]);}if(_0x4b3e09){logger[_0xe2ba('0x97')](_0xe2ba('0x98'),_0x3011f3[_0xe2ba('0x99')]());require(_0xe2ba('0x9a'))['fork'](path[_0xe2ba('0x57')](__dirname,_0xe2ba('0x9b'),_0x4b3e09[_0xe2ba('0x8e')]),[_0x4b3e09['id'],_0x3011f3['toString'](),path['join'](__dirname,_0xe2ba('0x9c'),_0x4b3e09[_0xe2ba('0x9d')]),_0x486d3c]);return _0x4b3e09;}else{var _0x538e52=squel[_0xe2ba('0x8a')]();_0x538e52['from']('('+_0x3011f3['toString']()+')',_0xe2ba('0x9e'));_0x538e52['field'](_0xe2ba('0x9f'),'count');_0x3011f3[_0xe2ba('0x1b')](_0x56d3f4[_0xe2ba('0x1b')]||_0x39f4ba);_0x3011f3[_0xe2ba('0x1a')](_0x56d3f4[_0xe2ba('0x1a')]||0x0);return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x538e52[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')][_0xe2ba('0xa0')]})[_0xe2ba('0x23')](function(_0x2234f2){if(!_0x2234f2['length']){_0xba9a28=0x0;}else{_0xba9a28=_0x2234f2[0x0][_0xe2ba('0x41')]||0x0;}return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x3011f3[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')][_0xe2ba('0xa0')]});})[_0xe2ba('0x23')](function(_0x5f21d5){return{'rows':_0x5f21d5||[],'count':_0xba9a28};});}});}exports[_0xe2ba('0xa1')]=function(_0x567c4f,_0xd9f1f8){return runReport(_0x567c4f[_0xe2ba('0x44')],_0x567c4f[_0xe2ba('0x32')],_0x567c4f['options'])[_0xe2ba('0x23')](respondWithResult(_0xd9f1f8,null))[_0xe2ba('0x49')](handleError(_0xd9f1f8,null));};exports['runReport']=runReport;exports[_0xe2ba('0x32')]=function(_0x4f0910,_0x3dbf1e){var _0x1fd1e9=0xa;var _0x520149=[_0xe2ba('0x57'),_0xe2ba('0xa2'),_0xe2ba('0xa3'),_0xe2ba('0x58')];var _0x4dfdf9={'SUM':_0xe2ba('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':'MAX(%s)','MIN':_0xe2ba('0x5d'),'AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':_0xe2ba('0x87'),'GROUP_CONCAT ASC':_0xe2ba('0x5f'),'GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x528d94={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':_0xe2ba('0x88'),'UNIX_TIMESTAMP':_0xe2ba('0x64')};var _0x453735=function(_0x24e476){return!_['includes']([_0xe2ba('0xa4'),_0xe2ba('0xa5'),_0xe2ba('0x66'),_0xe2ba('0x67')],_0x24e476);};var _0x5958f3=function(_0x190084){if(!_0x190084||!_0x190084[_0xe2ba('0x68')][_0xe2ba('0x69')]){return'';}for(var _0x3485f0='(',_0x3f368e=0x0;_0x3f368e<_0x190084[_0xe2ba('0x68')][_0xe2ba('0x69')];_0x3f368e+=0x1){_0x3f368e>0x0&&(_0x3485f0+='\x20'+_0x190084[_0xe2ba('0x6a')]+'\x20');_0x3485f0+=_0x190084[_0xe2ba('0x68')][_0x3f368e][_0xe2ba('0x6b')]?_0x5958f3(_0x190084[_0xe2ba('0x68')][_0x3f368e]['group']):_0x190084[_0xe2ba('0x68')][_0x3f368e][_0xe2ba('0x6c')]+'\x20'+_0x190084['rules'][_0x3f368e][_0xe2ba('0x6d')]+(_0x453735(_0x190084['rules'][_0x3f368e][_0xe2ba('0x6d')])?'\x20'+_0x190084['rules'][_0x3f368e][_0xe2ba('0x6e')]:'');}return _0x3485f0+')';};var _0x110b05={'where':{'id':_0x4f0910['params']['id']}},_0x45ef77,_0x154eeb,_0x5b30a6,_0x542866,_0x50c58e;_0x110b05=_[_0xe2ba('0x3f')]({},_0x110b05,_0x4f0910[_0xe2ba('0x47')]);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x110b05)[_0xe2ba('0x23')](function(_0x57e076){if(_0x57e076){_0x45ef77=_0x57e076;return _0x57e076['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x52e0e7){if(_0x52e0e7){if(!_0x52e0e7['length']){throw new db[(_0xe2ba('0x6f'))][(_0xe2ba('0x89'))](_0xe2ba('0x70'),0x193);}_0x154eeb=_0x52e0e7;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})[_0xe2ba('0x23')](function(_0xaf9d86){if(_0xaf9d86){_0x5b30a6=_[_0xe2ba('0x72')](_0xaf9d86,'id');var _0x4a6abc;var _0x4dde61=squel[_0xe2ba('0x8a')]();_0x4dde61[_0xe2ba('0x8b')](_0x45ef77[_0xe2ba('0x7e')]);for(var _0x48af8c=0x0;_0x48af8c<_0x154eeb['length'];_0x48af8c+=0x1){_0x4a6abc=_0x154eeb[_0x48af8c][_0xe2ba('0x73')]?_0x5b30a6[_0x154eeb[_0x48af8c]['MetricId']][_0xe2ba('0x8c')]:_0x154eeb[_0x48af8c][_0xe2ba('0x6c')];_0x4a6abc=_0x154eeb[_0x48af8c]['function']?_[_0xe2ba('0x8d')](_0x4dfdf9[_0x154eeb[_0x48af8c]['function']],'%s',_0x4a6abc):_0x4a6abc;_0x4a6abc=_0x154eeb[_0x48af8c]['format']?_[_0xe2ba('0x8d')](_0x528d94[_0x154eeb[_0x48af8c][_0xe2ba('0x75')]],'%s',_0x4a6abc):_0x4a6abc;if(_0x154eeb[_0x48af8c][_0xe2ba('0x76')]){_0x4dde61[_0xe2ba('0x6b')](_0x4a6abc);}_0x154eeb[_0x48af8c]['orderBy']&&_0x4dde61[_0xe2ba('0x3a')](_0x4a6abc,_0x154eeb[_0x48af8c][_0xe2ba('0x77')]==='DESC'?![]:!![]);_0x4dde61[_0xe2ba('0x6c')](_0x4a6abc,_0x154eeb[_0x48af8c]['alias']||_0x4a6abc);}if(_0x45ef77[_0xe2ba('0x7a')]){_0x45ef77['joins']=JSON[_0xe2ba('0x81')](_0x45ef77['joins']);for(var _0x1aca48=0x0;_0x1aca48<_0x45ef77['joins'][_0xe2ba('0x69')];_0x1aca48+=0x1){if(_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x2f')]&&_[_0xe2ba('0x65')](_0x520149,_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x2f')])&&_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7f')]&&_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')]&&_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x7b')]){_0x4dde61[_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x2f')]](_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')],null,util[_0xe2ba('0x75')]('%s.%s\x20=\x20%s.%s',_0x45ef77[_0xe2ba('0x7e')],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48]['parentKey'],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48]['foreignKey']));}}}if(_0x45ef77[_0xe2ba('0x80')]){_0x45ef77['conditions']=JSON[_0xe2ba('0x81')](_0x45ef77[_0xe2ba('0x80')]);_0x4dde61[_0xe2ba('0x3c')](_0x5958f3(_0x45ef77[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x50c58e=_0x4dde61['clone']();_0x4dde61[_0xe2ba('0x1b')](_0x1fd1e9);_0x4dde61['offset'](0x0);logger['debug']('Limited\x20Query:',_0x4dde61['toString']());return dbH['sequelize'][_0xe2ba('0x32')](_0x4dde61[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')]['QueryTypes'][_0xe2ba('0xa0')]});}})[_0xe2ba('0x23')](function(){return{'sql':_0x50c58e['toString']()};})['then'](respondWithResult(_0x3dbf1e,null))[_0xe2ba('0x49')](handleError(_0x3dbf1e,null));}; \ No newline at end of file +var _0x7cd8=['request-promise','bluebird','mustache','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','api','../../config/environment','../../mysqldb','dbH','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','show','params','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','Sequelize','ValidationErrorItem','from','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(%s)','MAX(%s)','debug','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3de969,_0x4676c8){var _0x4faf7b=function(_0x37be19){while(--_0x37be19){_0x3de969['push'](_0x3de969['shift']());}};_0x4faf7b(++_0x4676c8);}(_0x7cd8,0x1f4));var _0x87cd=function(_0x2d3b9e,_0x2ce5ea){_0x2d3b9e=_0x2d3b9e-0x0;var _0x94a172=_0x7cd8[_0x2d3b9e];return _0x94a172;};'use strict';var emlformat=require(_0x87cd('0x0'));var rimraf=require(_0x87cd('0x1'));var zipdir=require(_0x87cd('0x2'));var jsonpatch=require(_0x87cd('0x3'));var rp=require(_0x87cd('0x4'));var moment=require('moment');var BPromise=require(_0x87cd('0x5'));var Mustache=require(_0x87cd('0x6'));var util=require('util');var path=require(_0x87cd('0x7'));var sox=require(_0x87cd('0x8'));var csv=require(_0x87cd('0x9'));var ejs=require(_0x87cd('0xa'));var fs=require('fs');var fs_extra=require(_0x87cd('0xb'));var _=require(_0x87cd('0xc'));var squel=require(_0x87cd('0xd'));var crypto=require(_0x87cd('0xe'));var jsforce=require(_0x87cd('0xf'));var deskjs=require(_0x87cd('0x10'));var toCsv=require('to-csv');var querystring=require(_0x87cd('0x11'));var Papa=require(_0x87cd('0x12'));var Redis=require(_0x87cd('0x13'));var authService=require(_0x87cd('0x14'));var qs=require(_0x87cd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87cd('0x16'));var logger=require(_0x87cd('0x17'))(_0x87cd('0x18'));var utils=require('../../config/utils');var config=require(_0x87cd('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x87cd('0x1a'))['db'];var dbH=require(_0x87cd('0x1a'))[_0x87cd('0x1b')];function respondWithStatusCode(_0x1cfd66,_0x1fd1f1){_0x1fd1f1=_0x1fd1f1||0xcc;return function(_0x2d0768){if(_0x2d0768){return _0x1cfd66['sendStatus'](_0x1fd1f1);}return _0x1cfd66[_0x87cd('0x1c')](_0x1fd1f1)[_0x87cd('0x1d')]();};}function respondWithResult(_0x5a6534,_0x4e0cd1){_0x4e0cd1=_0x4e0cd1||0xc8;return function(_0x195dcd){if(_0x195dcd){return _0x5a6534[_0x87cd('0x1c')](_0x4e0cd1)[_0x87cd('0x1e')](_0x195dcd);}};}function respondWithFilteredResult(_0xa345d9,_0x2cb3e1){return function(_0x2b8348){if(_0x2b8348){var _0x5a92f5=typeof _0x2cb3e1[_0x87cd('0x1f')]===_0x87cd('0x20')&&typeof _0x2cb3e1['limit']===_0x87cd('0x20');var _0x5cc20f=_0x2b8348['count'];var _0x13b769=_0x5a92f5?0x0:_0x2cb3e1[_0x87cd('0x1f')];var _0x2a6e48=_0x5a92f5?_0x2b8348[_0x87cd('0x21')]:_0x2cb3e1[_0x87cd('0x1f')]+_0x2cb3e1['limit'];var _0x6b0f1b;if(_0x2a6e48>=_0x5cc20f){_0x2a6e48=_0x5cc20f;_0x6b0f1b=0xc8;}else{_0x6b0f1b=0xce;}_0xa345d9[_0x87cd('0x1c')](_0x6b0f1b);return _0xa345d9[_0x87cd('0x22')](_0x87cd('0x23'),_0x13b769+'-'+_0x2a6e48+'/'+_0x5cc20f)[_0x87cd('0x1e')](_0x2b8348);}return null;};}function patchUpdates(_0x24e31e){return function(_0x1a722e){try{jsonpatch[_0x87cd('0x24')](_0x1a722e,_0x24e31e,!![]);}catch(_0x1af2f1){return BPromise[_0x87cd('0x25')](_0x1af2f1);}return _0x1a722e['save']();};}function saveUpdates(_0x118ff8,_0x73ace9){return function(_0x1efa03){if(_0x1efa03){return _0x1efa03[_0x87cd('0x26')](_0x118ff8)['then'](function(_0x2a9c51){return _0x2a9c51;});}return null;};}function removeEntity(_0x5bd585,_0x559763){return function(_0x24d6a0){if(_0x24d6a0){return _0x24d6a0[_0x87cd('0x27')]()[_0x87cd('0x28')](function(){var _0x2221cf=_0x24d6a0[_0x87cd('0x29')]({'plain':!![]});var _0x28ecfd='CustomReports';return db[_0x87cd('0x2a')]['destroy']({'where':{'type':_0x28ecfd,'resourceId':_0x2221cf['id']}})['then'](function(){return _0x24d6a0;});})[_0x87cd('0x28')](function(){_0x5bd585[_0x87cd('0x1c')](0xcc)[_0x87cd('0x1d')]();});}};}function handleEntityNotFound(_0x3216e4,_0x39ce11){return function(_0x295c3b){if(!_0x295c3b){_0x3216e4[_0x87cd('0x2b')](0x194);}return _0x295c3b;};}function handleError(_0x5832eb,_0x4c4dfe){_0x4c4dfe=_0x4c4dfe||0x1f4;return function(_0x50c71b){logger[_0x87cd('0x2c')](_0x50c71b[_0x87cd('0x2d')]);if(_0x50c71b[_0x87cd('0x2e')]){delete _0x50c71b[_0x87cd('0x2e')];}_0x5832eb[_0x87cd('0x1c')](_0x4c4dfe)['send'](_0x50c71b);};}exports['index']=function(_0x120d32,_0x3f23ae){var _0x25bb78={},_0x306a1c={},_0x272a44={'count':0x0,'rows':[]};var _0x189971=_[_0x87cd('0x2f')](db[_0x87cd('0x30')][_0x87cd('0x31')],function(_0x2c1354){return{'name':_0x2c1354[_0x87cd('0x32')],'type':_0x2c1354[_0x87cd('0x33')][_0x87cd('0x34')]};});_0x306a1c[_0x87cd('0x35')]=_['map'](_0x189971,'name');_0x306a1c[_0x87cd('0x36')]=_[_0x87cd('0x37')](_0x120d32[_0x87cd('0x36')]);_0x306a1c[_0x87cd('0x38')]=_['intersection'](_0x306a1c['model'],_0x306a1c['query']);_0x25bb78[_0x87cd('0x39')]=_[_0x87cd('0x3a')](_0x306a1c['model'],qs[_0x87cd('0x3b')](_0x120d32[_0x87cd('0x36')][_0x87cd('0x3b')]));_0x25bb78[_0x87cd('0x39')]=_0x25bb78[_0x87cd('0x39')][_0x87cd('0x3c')]?_0x25bb78['attributes']:_0x306a1c[_0x87cd('0x35')];if(!_0x120d32[_0x87cd('0x36')]['hasOwnProperty'](_0x87cd('0x3d'))){_0x25bb78[_0x87cd('0x3e')]=qs[_0x87cd('0x3e')](_0x120d32['query'][_0x87cd('0x3e')]);_0x25bb78[_0x87cd('0x1f')]=qs[_0x87cd('0x1f')](_0x120d32[_0x87cd('0x36')]['offset']);}_0x25bb78[_0x87cd('0x3f')]=qs[_0x87cd('0x40')](_0x120d32[_0x87cd('0x36')][_0x87cd('0x40')]);_0x25bb78[_0x87cd('0x41')]=qs[_0x87cd('0x38')](_[_0x87cd('0x42')](_0x120d32['query'],_0x306a1c[_0x87cd('0x38')]),_0x189971);if(_0x120d32[_0x87cd('0x36')]['filter']){_0x25bb78[_0x87cd('0x41')]=_['merge'](_0x25bb78[_0x87cd('0x41')],{'$or':_[_0x87cd('0x2f')](_0x189971,function(_0x3c3fdb){if(_0x3c3fdb[_0x87cd('0x33')]!==_0x87cd('0x43')){var _0x11a5c3={};_0x11a5c3[_0x3c3fdb['name']]={'$like':'%'+_0x120d32[_0x87cd('0x36')]['filter']+'%'};return _0x11a5c3;}})});}_0x25bb78=_[_0x87cd('0x44')]({},_0x25bb78,_0x120d32[_0x87cd('0x45')]);var _0x3ff852={'where':_0x25bb78[_0x87cd('0x41')]};return db[_0x87cd('0x30')][_0x87cd('0x21')](_0x3ff852)[_0x87cd('0x28')](function(_0x8c614d){_0x272a44[_0x87cd('0x21')]=_0x8c614d;if(_0x120d32['query'][_0x87cd('0x46')]){_0x25bb78[_0x87cd('0x47')]=[{'all':!![]}];}return db[_0x87cd('0x30')]['findAll'](_0x25bb78);})['then'](function(_0xac1a24){_0x272a44['rows']=_0xac1a24;return _0x272a44;})[_0x87cd('0x28')](respondWithFilteredResult(_0x3f23ae,_0x25bb78))['catch'](handleError(_0x3f23ae,null));};exports[_0x87cd('0x48')]=function(_0x262c90,_0x55ba79){var _0x1a00b9={'raw':![],'where':{'id':_0x262c90[_0x87cd('0x49')]['id']}},_0x136165={};_0x136165[_0x87cd('0x35')]=_[_0x87cd('0x37')](db[_0x87cd('0x30')][_0x87cd('0x31')]);_0x136165[_0x87cd('0x36')]=_[_0x87cd('0x37')](_0x262c90[_0x87cd('0x36')]);_0x136165[_0x87cd('0x38')]=_[_0x87cd('0x3a')](_0x136165[_0x87cd('0x35')],_0x136165['query']);_0x1a00b9[_0x87cd('0x39')]=_['intersection'](_0x136165[_0x87cd('0x35')],qs[_0x87cd('0x3b')](_0x262c90[_0x87cd('0x36')][_0x87cd('0x3b')]));_0x1a00b9[_0x87cd('0x39')]=_0x1a00b9[_0x87cd('0x39')][_0x87cd('0x3c')]?_0x1a00b9[_0x87cd('0x39')]:_0x136165[_0x87cd('0x35')];if(_0x262c90[_0x87cd('0x36')]['includeAll']){_0x1a00b9['include']=[{'all':!![]}];}_0x1a00b9=_[_0x87cd('0x44')]({},_0x1a00b9,_0x262c90['options']);return db[_0x87cd('0x30')][_0x87cd('0x4a')](_0x1a00b9)[_0x87cd('0x28')](handleEntityNotFound(_0x55ba79,null))[_0x87cd('0x28')](respondWithResult(_0x55ba79,null))['catch'](handleError(_0x55ba79,null));};exports['create']=function(_0x1bf957,_0x46980e){return db['AnalyticCustomReport'][_0x87cd('0x4b')](_0x1bf957[_0x87cd('0x4c')],{})[_0x87cd('0x28')](function(_0x28147a){var _0x239ea0=_0x1bf957[_0x87cd('0x4d')][_0x87cd('0x29')]({'plain':!![]});if(!_0x239ea0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x239ea0[_0x87cd('0x4e')]===_0x87cd('0x4d')){var _0xb93650=_0x28147a[_0x87cd('0x29')]({'plain':!![]});var _0x473415=_0x87cd('0x4f');return db[_0x87cd('0x50')][_0x87cd('0x4a')]({'where':{'name':_0x473415,'userProfileId':_0x239ea0[_0x87cd('0x51')]},'raw':!![]})['then'](function(_0x20561c){if(_0x20561c&&_0x20561c[_0x87cd('0x52')]===0x0){return db[_0x87cd('0x2a')][_0x87cd('0x4b')]({'name':_0xb93650[_0x87cd('0x2e')],'resourceId':_0xb93650['id'],'type':'CustomReports','sectionId':_0x20561c['id']},{})[_0x87cd('0x28')](function(){return _0x28147a;});}else{return _0x28147a;}})[_0x87cd('0x53')](function(_0x5c72c4){logger[_0x87cd('0x2c')](_0x87cd('0x54'),_0x5c72c4);throw _0x5c72c4;});}return _0x28147a;})[_0x87cd('0x28')](respondWithResult(_0x46980e,0xc9))[_0x87cd('0x53')](handleError(_0x46980e,null));};exports[_0x87cd('0x26')]=function(_0x2c6a7e,_0x20f899){if(_0x2c6a7e['body']['id']){delete _0x2c6a7e[_0x87cd('0x4c')]['id'];}return db['AnalyticCustomReport'][_0x87cd('0x4a')]({'where':{'id':_0x2c6a7e[_0x87cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x20f899,null))['then'](saveUpdates(_0x2c6a7e['body'],null))['then'](respondWithResult(_0x20f899,null))['catch'](handleError(_0x20f899,null));};exports['destroy']=function(_0x34ff38,_0x2e8bf6){return db[_0x87cd('0x30')][_0x87cd('0x4a')]({'where':{'id':_0x34ff38[_0x87cd('0x49')]['id']}})[_0x87cd('0x28')](handleEntityNotFound(_0x2e8bf6,null))[_0x87cd('0x28')](removeEntity(_0x2e8bf6,null))[_0x87cd('0x53')](handleError(_0x2e8bf6,null));};exports[_0x87cd('0x55')]=function(_0x3f1b09,_0x5233a6){var _0x3c29ae=0xa;var _0x4ffa9a=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),_0x87cd('0x59')];var _0x1dc858={'SUM':_0x87cd('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x87cd('0x5b'),'AVG':_0x87cd('0x5c'),'GROUP_CONCAT':_0x87cd('0x5d'),'GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xef1d8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x87cd('0x5f'),'HOUR':_0x87cd('0x60'),'ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x89b3c4=function(_0x152406){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),_0x87cd('0x67')],_0x152406);};var _0x4ed62a=function(_0x3e4e1a){if(!_0x3e4e1a||!_0x3e4e1a[_0x87cd('0x68')]['length']){return'';}for(var _0x4f6a9b='(',_0x2b93c8=0x0;_0x2b93c8<_0x3e4e1a[_0x87cd('0x68')]['length'];_0x2b93c8+=0x1){_0x2b93c8>0x0&&(_0x4f6a9b+='\x20'+_0x3e4e1a[_0x87cd('0x69')]+'\x20');_0x4f6a9b+=_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6a')]?_0x4ed62a(_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8]['group']):_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6b')]+'\x20'+_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6c')]+(_0x89b3c4(_0x3e4e1a['rules'][_0x2b93c8][_0x87cd('0x6c')])?'\x20'+_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6d')]:'');}return _0x4f6a9b+')';};var _0x116256={'where':{'id':_0x3f1b09[_0x87cd('0x49')]['id']}},_0x38cd5f,_0x18e74e,_0x20edc8,_0x5acb58,_0xf07173;_0x116256=_[_0x87cd('0x44')]({},_0x116256,_0x3f1b09['options']);return db['AnalyticCustomReport'][_0x87cd('0x4a')](_0x116256)[_0x87cd('0x28')](function(_0x62a115){if(_0x62a115){_0x38cd5f=_0x62a115;return _0x62a115[_0x87cd('0x6e')]();}return null;})[_0x87cd('0x28')](function(_0x5c0fdf){if(_0x5c0fdf){if(!_0x5c0fdf['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x87cd('0x6f'),0x193);}_0x18e74e=_0x5c0fdf;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})[_0x87cd('0x28')](function(_0x50e7f7){if(_0x50e7f7){_0x20edc8=_[_0x87cd('0x72')](_0x50e7f7,'id');var _0x56d11f;var _0x4a17f0=squel[_0x87cd('0x73')]();_0x4a17f0['from'](_0x38cd5f[_0x87cd('0x74')]);for(var _0x30d928=0x0;_0x30d928<_0x18e74e[_0x87cd('0x3c')];_0x30d928+=0x1){_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x75')]?_0x20edc8[_0x18e74e[_0x30d928][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x18e74e[_0x30d928][_0x87cd('0x6b')];_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x1dc858[_0x18e74e[_0x30d928][_0x87cd('0x77')]],'%s',_0x56d11f):_0x56d11f;_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x79')]?_['replace'](_0xef1d8[_0x18e74e[_0x30d928]['format']],'%s',_0x56d11f):_0x56d11f;if(_0x18e74e[_0x30d928]['groupBy']){_0x4a17f0['group'](_0x56d11f);}_0x18e74e[_0x30d928][_0x87cd('0x7a')]&&_0x4a17f0[_0x87cd('0x3f')](_0x56d11f,_0x18e74e[_0x30d928]['orderBy']===_0x87cd('0x7b')?![]:!![]);_0x4a17f0[_0x87cd('0x6b')](_0x56d11f,_0x18e74e[_0x30d928]['alias']||_0x56d11f);}if(_0x38cd5f[_0x87cd('0x7c')]){_0x38cd5f[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x38cd5f[_0x87cd('0x7c')]);for(var _0x402ef6=0x0;_0x402ef6<_0x38cd5f[_0x87cd('0x7c')][_0x87cd('0x3c')];_0x402ef6+=0x1){if(_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x4ffa9a,_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')])&&_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7e')]&&_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7f')]&&_0x38cd5f['joins'][_0x402ef6][_0x87cd('0x80')]){_0x4a17f0[_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')]](_0x38cd5f['joins'][_0x402ef6][_0x87cd('0x7f')],null,util[_0x87cd('0x79')](_0x87cd('0x81'),_0x38cd5f[_0x87cd('0x74')],_0x38cd5f['joins'][_0x402ef6]['parentKey'],_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7f')],_0x38cd5f[_0x87cd('0x7c')][_0x402ef6]['foreignKey']));}}}if(_0x38cd5f[_0x87cd('0x82')]){_0x38cd5f[_0x87cd('0x82')]=JSON[_0x87cd('0x7d')](_0x38cd5f[_0x87cd('0x82')]);_0x4a17f0[_0x87cd('0x41')](_0x4ed62a(_0x38cd5f[_0x87cd('0x82')][_0x87cd('0x6a')]));}_0xf07173=_0x4a17f0[_0x87cd('0x83')]();_0x4a17f0[_0x87cd('0x3e')](_0x3c29ae);_0x4a17f0[_0x87cd('0x1f')](0x0);logger['debug'](_0x87cd('0x84'),_0x4a17f0[_0x87cd('0x85')]());return dbH[_0x87cd('0x86')]['query'](_0x4a17f0[_0x87cd('0x85')](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]});}})['then'](respondWithResult(_0x5233a6,null))['catch'](handleError(_0x5233a6,null));};function runReport(_0x21f5c,_0x396927,_0x4f67f8){var _0x1fb9cc=_0x396927['name'];var _0x1487a1=0xa;var _0x2a3505=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),'cross_join'];var _0x40a19b={'SUM':_0x87cd('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x87cd('0x89'),'MAX':'MAX(%s)','MIN':_0x87cd('0x5b'),'AVG':_0x87cd('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':_0x87cd('0x8a')};var _0x34d63a={'SEC_TO_TIME':_0x87cd('0x8b'),'DATE':_0x87cd('0x5f'),'HOUR':_0x87cd('0x60'),'ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x1c33db=function(_0x23bba0){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),'IS\x20NOT\x20EMPTY'],_0x23bba0);};var _0x4c4d58=function(_0x59dd85){if(!_0x59dd85||!_0x59dd85['rules'][_0x87cd('0x3c')]){return'';}for(var _0xfa4a86='(',_0x4022ae=0x0;_0x4022ae<_0x59dd85['rules']['length'];_0x4022ae+=0x1){_0x4022ae>0x0&&(_0xfa4a86+='\x20'+_0x59dd85[_0x87cd('0x69')]+'\x20');_0xfa4a86+=_0x59dd85[_0x87cd('0x68')][_0x4022ae]['group']?_0x4c4d58(_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6a')]):_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6b')]+'\x20'+_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6c')]+(_0x1c33db(_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6c')])?'\x20'+_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6d')]:'');}return _0xfa4a86+')';};var _0x48aefe={'where':{'id':_0x21f5c['id']}},_0x1a5fcc,_0x25386d,_0x42d79e,_0x1a72af,_0x22cf6a;_0x48aefe=_['merge']({},_0x48aefe,_0x4f67f8);return db['AnalyticCustomReport']['find'](_0x48aefe)[_0x87cd('0x28')](function(_0x51f7b1){if(_0x51f7b1){_0x1a5fcc=_0x51f7b1;return _0x51f7b1[_0x87cd('0x6e')]();}return null;})[_0x87cd('0x28')](function(_0x344015){if(_0x344015){if(!_0x344015[_0x87cd('0x3c')]){throw new db[(_0x87cd('0x8c'))][(_0x87cd('0x8d'))](_0x87cd('0x6f'),0x193);}_0x25386d=_0x344015;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})[_0x87cd('0x28')](function(_0xdcafc1){if(_0xdcafc1){_0x42d79e=_[_0x87cd('0x72')](_0xdcafc1,'id');var _0x4703af;var _0x46fddf=squel[_0x87cd('0x73')]();_0x46fddf[_0x87cd('0x8e')](_0x1a5fcc['table']);for(var _0x43d352=0x0;_0x43d352<_0x25386d[_0x87cd('0x3c')];_0x43d352+=0x1){_0x4703af=_0x25386d[_0x43d352]['MetricId']?_0x42d79e[_0x25386d[_0x43d352][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x25386d[_0x43d352]['field'];_0x4703af=_0x25386d[_0x43d352][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x40a19b[_0x25386d[_0x43d352]['function']],'%s',_0x4703af):_0x4703af;_0x4703af=_0x25386d[_0x43d352]['format']?_[_0x87cd('0x78')](_0x34d63a[_0x25386d[_0x43d352][_0x87cd('0x79')]],'%s',_0x4703af):_0x4703af;if(_0x25386d[_0x43d352][_0x87cd('0x8f')]){_0x46fddf['group'](_0x4703af);}_0x25386d[_0x43d352][_0x87cd('0x7a')]&&_0x46fddf[_0x87cd('0x3f')](_0x4703af,_0x25386d[_0x43d352][_0x87cd('0x7a')]===_0x87cd('0x7b')?![]:!![]);_0x46fddf['field'](_0x4703af,_0x25386d[_0x43d352][_0x87cd('0x90')]||_0x4703af);}if(_0x1a5fcc[_0x87cd('0x7c')]){_0x1a5fcc[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x1a5fcc[_0x87cd('0x7c')]);for(var _0x4dc5cb=0x0;_0x4dc5cb<_0x1a5fcc[_0x87cd('0x7c')][_0x87cd('0x3c')];_0x4dc5cb+=0x1){if(_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x2a3505,_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x33')])&&_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7e')]&&_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7f')]&&_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x80')]){_0x46fddf[_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x33')]](_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7f')],null,util[_0x87cd('0x79')](_0x87cd('0x81'),_0x1a5fcc[_0x87cd('0x74')],_0x1a5fcc['joins'][_0x4dc5cb]['parentKey'],_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x7f')],_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x80')]));}}}if(_0x1a5fcc[_0x87cd('0x82')]){_0x1a5fcc[_0x87cd('0x82')]=JSON[_0x87cd('0x7d')](_0x1a5fcc[_0x87cd('0x82')]);_0x46fddf[_0x87cd('0x41')](_0x4c4d58(_0x1a5fcc['conditions'][_0x87cd('0x6a')]));}_0x22cf6a=_0x46fddf['clone']();_0x46fddf[_0x87cd('0x3e')](_0x1487a1);_0x46fddf[_0x87cd('0x1f')](0x0);return;}})[_0x87cd('0x28')](function(){if(_0x396927[_0x87cd('0x91')]===_0x87cd('0x92')){return null;}var _0x5d60de=_['merge'](_0x396927,{'name':_0x396927[_0x87cd('0x93')]||_0x396927[_0x87cd('0x2e')]||_0x1a5fcc[_0x87cd('0x2e')],'basename':_0x1fb9cc,'savename':util['format'](_0x87cd('0x94'),_0x396927['name']||_0x1a5fcc[_0x87cd('0x2e')],require('randomstring')[_0x87cd('0x95')](0x4),_0x396927[_0x87cd('0x91')]||_0x87cd('0x96')),'reportId':_0x1a5fcc['id'],'reportType':_0x87cd('0x97')});return db[_0x87cd('0x98')][_0x87cd('0x4b')](_0x5d60de,{'raw':!![]});})[_0x87cd('0x28')](function(_0x2958a6){if(_0x1a5fcc['table']==='cdr'){_0x22cf6a['where'](_0x1a5fcc['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x396927[_0x87cd('0x99')],_0x396927['endDate']);}else{_0x22cf6a[_0x87cd('0x41')](_0x1a5fcc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x396927[_0x87cd('0x99')],_0x396927[_0x87cd('0x9a')]);}if(_0x2958a6){logger['info'](_0x87cd('0x9b'),_0x22cf6a[_0x87cd('0x85')]());require(_0x87cd('0x9c'))[_0x87cd('0x9d')](path[_0x87cd('0x56')](__dirname,_0x87cd('0x9e'),_0x2958a6[_0x87cd('0x91')]),[_0x2958a6['id'],_0x22cf6a[_0x87cd('0x85')](),path[_0x87cd('0x56')](__dirname,_0x87cd('0x9f'),_0x2958a6[_0x87cd('0xa0')]),_0x1fb9cc]);return _0x2958a6;}else{var _0x4af41c=squel['select']();_0x4af41c['from']('('+_0x22cf6a[_0x87cd('0x85')]()+')',_0x87cd('0xa1'));_0x4af41c[_0x87cd('0x6b')](_0x87cd('0xa2'),_0x87cd('0x21'));_0x22cf6a[_0x87cd('0x3e')](_0x396927['limit']||_0x1487a1);_0x22cf6a[_0x87cd('0x1f')](_0x396927['offset']||0x0);return dbH['sequelize'][_0x87cd('0x36')](_0x4af41c[_0x87cd('0x85')](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]})[_0x87cd('0x28')](function(_0x4273ed){if(!_0x4273ed[_0x87cd('0x3c')]){_0x1a72af=0x0;}else{_0x1a72af=_0x4273ed[0x0][_0x87cd('0x21')]||0x0;}return dbH[_0x87cd('0x86')][_0x87cd('0x36')](_0x22cf6a['toString'](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]});})['then'](function(_0x33b9d){return{'rows':_0x33b9d||[],'count':_0x1a72af};});}});}exports[_0x87cd('0xa3')]=function(_0x4620c6,_0x3dfc33){return runReport(_0x4620c6[_0x87cd('0x49')],_0x4620c6['query'],_0x4620c6['options'])[_0x87cd('0x28')](respondWithResult(_0x3dfc33,null))[_0x87cd('0x53')](handleError(_0x3dfc33,null));};exports[_0x87cd('0xa4')]=runReport;exports[_0x87cd('0x36')]=function(_0x4f72d5,_0x57ad9e){var _0x26a2ad=0xa;var _0x52e52c=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),_0x87cd('0x59')];var _0x3e3a20={'SUM':_0x87cd('0x5a'),'COUNT':_0x87cd('0xa5'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x87cd('0xa6'),'MIN':'MIN(%s)','AVG':_0x87cd('0x5c'),'GROUP_CONCAT':_0x87cd('0x5d'),'GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':_0x87cd('0x8a')};var _0x318a11={'SEC_TO_TIME':_0x87cd('0x8b'),'DATE':_0x87cd('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x23d619=function(_0xd4580c){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),'IS\x20NOT\x20EMPTY'],_0xd4580c);};var _0x2f3be1=function(_0x4cfad1){if(!_0x4cfad1||!_0x4cfad1[_0x87cd('0x68')]['length']){return'';}for(var _0x3eeb06='(',_0x164d9b=0x0;_0x164d9b<_0x4cfad1[_0x87cd('0x68')][_0x87cd('0x3c')];_0x164d9b+=0x1){_0x164d9b>0x0&&(_0x3eeb06+='\x20'+_0x4cfad1[_0x87cd('0x69')]+'\x20');_0x3eeb06+=_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6a')]?_0x2f3be1(_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6a')]):_0x4cfad1['rules'][_0x164d9b][_0x87cd('0x6b')]+'\x20'+_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6c')]+(_0x23d619(_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6c')])?'\x20'+_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6d')]:'');}return _0x3eeb06+')';};var _0x550e20={'where':{'id':_0x4f72d5['params']['id']}},_0x2c87c4,_0x3a78e8,_0x37ccf1,_0x2829d2,_0x20541c;_0x550e20=_[_0x87cd('0x44')]({},_0x550e20,_0x4f72d5[_0x87cd('0x45')]);return db[_0x87cd('0x30')][_0x87cd('0x4a')](_0x550e20)[_0x87cd('0x28')](function(_0xaf70d5){if(_0xaf70d5){_0x2c87c4=_0xaf70d5;return _0xaf70d5['getFields']();}return null;})[_0x87cd('0x28')](function(_0x4e10ef){if(_0x4e10ef){if(!_0x4e10ef['length']){throw new db[(_0x87cd('0x8c'))][(_0x87cd('0x8d'))](_0x87cd('0x6f'),0x193);}_0x3a78e8=_0x4e10ef;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})['then'](function(_0x29be8e){if(_0x29be8e){_0x37ccf1=_[_0x87cd('0x72')](_0x29be8e,'id');var _0x2daf4f;var _0x3b2a9f=squel[_0x87cd('0x73')]();_0x3b2a9f[_0x87cd('0x8e')](_0x2c87c4[_0x87cd('0x74')]);for(var _0xa39509=0x0;_0xa39509<_0x3a78e8[_0x87cd('0x3c')];_0xa39509+=0x1){_0x2daf4f=_0x3a78e8[_0xa39509]['MetricId']?_0x37ccf1[_0x3a78e8[_0xa39509][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x3a78e8[_0xa39509][_0x87cd('0x6b')];_0x2daf4f=_0x3a78e8[_0xa39509][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x3e3a20[_0x3a78e8[_0xa39509][_0x87cd('0x77')]],'%s',_0x2daf4f):_0x2daf4f;_0x2daf4f=_0x3a78e8[_0xa39509][_0x87cd('0x79')]?_[_0x87cd('0x78')](_0x318a11[_0x3a78e8[_0xa39509][_0x87cd('0x79')]],'%s',_0x2daf4f):_0x2daf4f;if(_0x3a78e8[_0xa39509][_0x87cd('0x8f')]){_0x3b2a9f[_0x87cd('0x6a')](_0x2daf4f);}_0x3a78e8[_0xa39509][_0x87cd('0x7a')]&&_0x3b2a9f['order'](_0x2daf4f,_0x3a78e8[_0xa39509][_0x87cd('0x7a')]===_0x87cd('0x7b')?![]:!![]);_0x3b2a9f['field'](_0x2daf4f,_0x3a78e8[_0xa39509][_0x87cd('0x90')]||_0x2daf4f);}if(_0x2c87c4[_0x87cd('0x7c')]){_0x2c87c4[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x2c87c4[_0x87cd('0x7c')]);for(var _0x48c6c1=0x0;_0x48c6c1<_0x2c87c4[_0x87cd('0x7c')]['length'];_0x48c6c1+=0x1){if(_0x2c87c4['joins'][_0x48c6c1][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x52e52c,_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['type'])&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7e')]&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7f')]&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x80')]){_0x3b2a9f[_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x33')]](_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7f')],null,util[_0x87cd('0x79')]('%s.%s\x20=\x20%s.%s',_0x2c87c4[_0x87cd('0x74')],_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['parentKey'],_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['foreignTable'],_0x2c87c4['joins'][_0x48c6c1]['foreignKey']));}}}if(_0x2c87c4[_0x87cd('0x82')]){_0x2c87c4[_0x87cd('0x82')]=JSON['parse'](_0x2c87c4[_0x87cd('0x82')]);_0x3b2a9f[_0x87cd('0x41')](_0x2f3be1(_0x2c87c4[_0x87cd('0x82')]['group']));}_0x20541c=_0x3b2a9f[_0x87cd('0x83')]();_0x3b2a9f[_0x87cd('0x3e')](_0x26a2ad);_0x3b2a9f['offset'](0x0);logger[_0x87cd('0xa7')](_0x87cd('0x84'),_0x3b2a9f[_0x87cd('0x85')]());return dbH[_0x87cd('0x86')][_0x87cd('0x36')](_0x3b2a9f[_0x87cd('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x87cd('0x88')]});}})[_0x87cd('0x28')](function(){return{'sql':_0x20541c[_0x87cd('0x85')]()};})[_0x87cd('0x28')](respondWithResult(_0x57ad9e,null))['catch'](handleError(_0x57ad9e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index d3c62fb..3922097 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 _0xe4a5=['lodash','api','moment','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x2749d1,_0x2114e7){var _0x5f0d94=function(_0x24bb5b){while(--_0x24bb5b){_0x2749d1['push'](_0x2749d1['shift']());}};_0x5f0d94(++_0x2114e7);}(_0xe4a5,0x168));var _0x5e4a=function(_0x1d27a8,_0x2f5d59){_0x1d27a8=_0x1d27a8-0x0;var _0x37adc5=_0xe4a5[_0x1d27a8];return _0x37adc5;};'use strict';var _=require(_0x5e4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e4a('0x1'));var moment=require(_0x5e4a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e4a('0x3'));var rimraf=require(_0x5e4a('0x4'));var config=require('../../config/environment');var attributes=require(_0x5e4a('0x5'));module[_0x5e4a('0x6')]=function(_0xb7c287,_0xf90ca2){return _0xb7c287[_0x5e4a('0x7')](_0x5e4a('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b51=['request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d223a,_0x3c63cb){var _0x28c01a=function(_0x2a97a0){while(--_0x2a97a0){_0x2d223a['push'](_0x2d223a['shift']());}};_0x28c01a(++_0x3c63cb);}(_0x6b51,0x192));var _0x16b5=function(_0x10b328,_0x2438b5){_0x10b328=_0x10b328-0x0;var _0x364727=_0x6b51[_0x10b328];return _0x364727;};'use strict';var _=require(_0x16b5('0x0'));var util=require('util');var logger=require(_0x16b5('0x1'))(_0x16b5('0x2'));var moment=require(_0x16b5('0x3'));var BPromise=require(_0x16b5('0x4'));var rp=require(_0x16b5('0x5'));var fs=require('fs');var path=require(_0x16b5('0x6'));var rimraf=require('rimraf');var config=require(_0x16b5('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x16b5('0x8')]=function(_0x76aecd,_0x62a6cb){return _0x76aecd[_0x16b5('0x9')](_0x16b5('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 1395d89..b11238a 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 _0xc0f1=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5881b2,_0x1170b7){var _0x21c207=function(_0x1712ec){while(--_0x1712ec){_0x5881b2['push'](_0x5881b2['shift']());}};_0x21c207(++_0x1170b7);}(_0xc0f1,0x101));var _0x1c0f=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0xc0f1[_0x5875ad];return _0x32a922;};'use strict';var _=require(_0x1c0f('0x0'));var util=require('util');var moment=require(_0x1c0f('0x1'));var BPromise=require(_0x1c0f('0x2'));var rs=require(_0x1c0f('0x3'));var fs=require('fs');var Redis=require(_0x1c0f('0x4'));var db=require(_0x1c0f('0x5'))['db'];var utils=require(_0x1c0f('0x6'));var logger=require(_0x1c0f('0x7'))(_0x1c0f('0x8'));var config=require(_0x1c0f('0x9'));var jayson=require(_0x1c0f('0xa'));var client=jayson[_0x1c0f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb8988c,_0x59b79a,_0x2a9cd2){return new BPromise(function(_0xb0f56,_0x85a58e){return client[_0x1c0f('0xc')](_0xb8988c,_0x2a9cd2)[_0x1c0f('0xd')](function(_0x55c4d7){logger[_0x1c0f('0xe')](_0x1c0f('0xf'),_0x59b79a,_0x1c0f('0x10'));logger[_0x1c0f('0x11')](_0x1c0f('0x12'),_0x59b79a,_0x1c0f('0x10'),JSON[_0x1c0f('0x13')](_0x55c4d7));if(_0x55c4d7[_0x1c0f('0x14')]){if(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x15')]===0x1f4){logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);return _0x85a58e(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);}logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x55c4d7[_0x1c0f('0x14')]['message']);return _0xb0f56(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);}else{logger[_0x1c0f('0xe')](_0x1c0f('0xf'),_0x59b79a,'request\x20sent');_0xb0f56(_0x55c4d7[_0x1c0f('0x17')][_0x1c0f('0x16')]);}})[_0x1c0f('0x18')](function(_0x3154e7){logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x3154e7);_0x85a58e(_0x3154e7);});});} \ No newline at end of file +var _0x3a5a=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x16a21a,_0x4f28e6){var _0x5ed3c4=function(_0x1c5156){while(--_0x1c5156){_0x16a21a['push'](_0x16a21a['shift']());}};_0x5ed3c4(++_0x4f28e6);}(_0x3a5a,0xab));var _0xa3a5=function(_0x5be0cf,_0x4cfe44){_0x5be0cf=_0x5be0cf-0x0;var _0xecd17a=_0x3a5a[_0x5be0cf];return _0xecd17a;};'use strict';var _=require('lodash');var util=require(_0xa3a5('0x0'));var moment=require(_0xa3a5('0x1'));var BPromise=require(_0xa3a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3a5('0x3'))['db'];var utils=require(_0xa3a5('0x4'));var logger=require(_0xa3a5('0x5'))('rpc');var config=require(_0xa3a5('0x6'));var jayson=require(_0xa3a5('0x7'));var client=jayson[_0xa3a5('0x8')][_0xa3a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b50ef,_0x208615,_0x1bbed0){return new BPromise(function(_0x1a0b05,_0x1bb0b1){return client[_0xa3a5('0xa')](_0x3b50ef,_0x1bbed0)[_0xa3a5('0xb')](function(_0x4fd9b8){logger[_0xa3a5('0xc')](_0xa3a5('0xd'),_0x208615,'request\x20sent');logger[_0xa3a5('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x208615,'request\x20sent',JSON[_0xa3a5('0xf')](_0x4fd9b8));if(_0x4fd9b8[_0xa3a5('0x10')]){if(_0x4fd9b8[_0xa3a5('0x10')]['code']===0x1f4){logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x4fd9b8[_0xa3a5('0x10')][_0xa3a5('0x11')]);return _0x1bb0b1(_0x4fd9b8[_0xa3a5('0x10')][_0xa3a5('0x11')]);}logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x4fd9b8['error'][_0xa3a5('0x11')]);return _0x1a0b05(_0x4fd9b8[_0xa3a5('0x10')]['message']);}else{logger[_0xa3a5('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x208615,_0xa3a5('0x12'));_0x1a0b05(_0x4fd9b8['result'][_0xa3a5('0x11')]);}})[_0xa3a5('0x13')](function(_0x36b8d0){logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x36b8d0);_0x1bb0b1(_0x36b8d0);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b35a7e7..41a29ac 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 _0x1a0a=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x224457,_0x5a8a46){var _0x538686=function(_0x1dbf49){while(--_0x1dbf49){_0x224457['push'](_0x224457['shift']());}};_0x538686(++_0x5a8a46);}(_0x1a0a,0x12d));var _0xa1a0=function(_0x4becb8,_0x4ad3d3){_0x4becb8=_0x4becb8-0x0;var _0x5c8a37=_0x1a0a[_0x4becb8];return _0x5c8a37;};'use strict';var multer=require(_0xa1a0('0x0'));var util=require(_0xa1a0('0x1'));var path=require(_0xa1a0('0x2'));var timeout=require(_0xa1a0('0x3'));var express=require(_0xa1a0('0x4'));var router=express['Router']();var fs_extra=require(_0xa1a0('0x5'));var auth=require(_0xa1a0('0x6'));var interaction=require(_0xa1a0('0x7'));var config=require(_0xa1a0('0x8'));var controller=require(_0xa1a0('0x9'));router['get']('/',auth[_0xa1a0('0xa')](),controller[_0xa1a0('0xb')]);router[_0xa1a0('0xc')](_0xa1a0('0xd'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0xe')]);router[_0xa1a0('0xc')](_0xa1a0('0xf'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x10')]);router['get'](_0xa1a0('0x11'),auth[_0xa1a0('0xa')](),controller['run']);router[_0xa1a0('0xc')](_0xa1a0('0x12'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x13')]);router['post']('/',auth[_0xa1a0('0xa')](),controller['create']);router['put']('/:id',auth[_0xa1a0('0xa')](),controller['update']);router[_0xa1a0('0x14')](_0xa1a0('0xd'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbabf=['query','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x37276f,_0x3e9aed){var _0x31c6ed=function(_0x50df8f){while(--_0x50df8f){_0x37276f['push'](_0x37276f['shift']());}};_0x31c6ed(++_0x3e9aed);}(_0xbabf,0x1be));var _0xfbab=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbabf[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var path=require('path');var timeout=require(_0xfbab('0x2'));var express=require(_0xfbab('0x3'));var router=express[_0xfbab('0x4')]();var fs_extra=require(_0xfbab('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfbab('0x6'));var controller=require(_0xfbab('0x7'));router['get']('/',auth[_0xfbab('0x8')](),controller[_0xfbab('0x9')]);router[_0xfbab('0xa')](_0xfbab('0xb'),auth[_0xfbab('0x8')](),controller[_0xfbab('0xc')]);router[_0xfbab('0xa')](_0xfbab('0xd'),auth['isAuthenticated'](),controller[_0xfbab('0xe')]);router[_0xfbab('0xa')](_0xfbab('0xf'),auth[_0xfbab('0x8')](),controller['run']);router[_0xfbab('0xa')]('/:id/query',auth[_0xfbab('0x8')](),controller[_0xfbab('0x10')]);router[_0xfbab('0x11')]('/',auth['isAuthenticated'](),controller[_0xfbab('0x12')]);router[_0xfbab('0x13')](_0xfbab('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfbab('0x14')](_0xfbab('0xb'),auth['isAuthenticated'](),controller[_0xfbab('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c450716..0979d32 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 _0xbd51=['sequelize','STRING'];(function(_0x153810,_0x4b3117){var _0x3df31a=function(_0x239357){while(--_0x239357){_0x153810['push'](_0x153810['shift']());}};_0x3df31a(++_0x4b3117);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3f0524,_0x55c95a){_0x3f0524=_0x3f0524-0x0;var _0x164a07=_0xbd51[_0x3f0524];return _0x164a07;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x2675,0x75));var _0x5267=function(_0x100e0e,_0x2c2f2c){_0x100e0e=_0x100e0e-0x0;var _0x5ba0f8=_0x2675[_0x100e0e];return _0x5ba0f8;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 156c03c..e096734 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','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\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x432e77,_0x2e7381){var _0x585ac6=function(_0x2f72c3){while(--_0x2f72c3){_0x432e77['push'](_0x432e77['shift']());}};_0x585ac6(++_0x2e7381);}(_0xda19,0xd5));var _0x9da1=function(_0x51212f,_0x4a7ff4){_0x51212f=_0x51212f-0x0;var _0x33f6d5=_0xda19[_0x51212f];return _0x33f6d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3ebeca,_0x349ec2){var _0xd86f9e=function(_0x19fdc2){while(--_0x19fdc2){_0x3ebeca['push'](_0x3ebeca['shift']());}};_0xd86f9e(++_0x349ec2);}(_0x53ec,0x192));var _0xc53e=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0x53ec[_0x40edbb];return _0x1c34e1;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d659d3a..0f4a272 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 _0xda16=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports'];(function(_0x14977c,_0x2c6d7e){var _0xafe01a=function(_0x3e0ded){while(--_0x3e0ded){_0x14977c['push'](_0x14977c['shift']());}};_0xafe01a(++_0x2c6d7e);}(_0xda16,0x14a));var _0x6da1=function(_0x1671c9,_0x4640d3){_0x1671c9=_0x1671c9-0x0;var _0x15b4ba=_0xda16[_0x1671c9];return _0x15b4ba;};'use strict';var _=require(_0x6da1('0x0'));var util=require('util');var logger=require(_0x6da1('0x1'))(_0x6da1('0x2'));var moment=require(_0x6da1('0x3'));var BPromise=require('bluebird');var rp=require(_0x6da1('0x4'));var fs=require('fs');var path=require(_0x6da1('0x5'));var rimraf=require('rimraf');var config=require(_0x6da1('0x6'));var attributes=require(_0x6da1('0x7'));module[_0x6da1('0x8')]=function(_0x50ab5f,_0x27a492){return _0x50ab5f['define']('AnalyticDefaultReport',attributes,{'tableName':_0x6da1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x55a357,_0x3902ac){var _0x39b515=function(_0x2d9956){while(--_0x2d9956){_0x55a357['push'](_0x55a357['shift']());}};_0x39b515(++_0x3902ac);}(_0x3c6e,0xdd));var _0xe3c6=function(_0x13175f,_0x4133d6){_0x13175f=_0x13175f-0x0;var _0x1f127c=_0x3c6e[_0x13175f];return _0x1f127c;};'use strict';var _=require(_0xe3c6('0x0'));var util=require('util');var logger=require(_0xe3c6('0x1'))(_0xe3c6('0x2'));var moment=require(_0xe3c6('0x3'));var BPromise=require(_0xe3c6('0x4'));var rp=require(_0xe3c6('0x5'));var fs=require('fs');var path=require(_0xe3c6('0x6'));var rimraf=require(_0xe3c6('0x7'));var config=require(_0xe3c6('0x8'));var attributes=require(_0xe3c6('0x9'));module['exports']=function(_0x123a7e,_0x4e835c){return _0x123a7e[_0xe3c6('0xa')](_0xe3c6('0xb'),attributes,{'tableName':_0xe3c6('0xc'),'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 95f8ae2..da4c46a 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 _0xc558=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x396d8a,_0x293874){var _0x3f4cca=function(_0xfe3ae2){while(--_0xfe3ae2){_0x396d8a['push'](_0x396d8a['shift']());}};_0x3f4cca(++_0x293874);}(_0xc558,0x1d0));var _0x8c55=function(_0x335db4,_0x3006c9){_0x335db4=_0x335db4-0x0;var _0x699903=_0xc558[_0x335db4];return _0x699903;};'use strict';var _=require(_0x8c55('0x0'));var util=require(_0x8c55('0x1'));var moment=require(_0x8c55('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c55('0x3'));var fs=require('fs');var Redis=require(_0x8c55('0x4'));var db=require(_0x8c55('0x5'))['db'];var utils=require(_0x8c55('0x6'));var logger=require(_0x8c55('0x7'))('rpc');var config=require(_0x8c55('0x8'));var jayson=require(_0x8c55('0x9'));var client=jayson[_0x8c55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x467796,_0x2fc1bb,_0x39bf49){return new BPromise(function(_0x54ccf1,_0x1627b1){return client[_0x8c55('0xb')](_0x467796,_0x39bf49)[_0x8c55('0xc')](function(_0x25225d){logger['info'](_0x8c55('0xd'),_0x2fc1bb,_0x8c55('0xe'));logger[_0x8c55('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2fc1bb,'request\x20sent',JSON['stringify'](_0x25225d));if(_0x25225d[_0x8c55('0x10')]){if(_0x25225d[_0x8c55('0x10')]['code']===0x1f4){logger['error'](_0x8c55('0xd'),_0x2fc1bb,_0x25225d[_0x8c55('0x10')][_0x8c55('0x11')]);return _0x1627b1(_0x25225d['error'][_0x8c55('0x11')]);}logger[_0x8c55('0x10')](_0x8c55('0xd'),_0x2fc1bb,_0x25225d['error'][_0x8c55('0x11')]);return _0x54ccf1(_0x25225d[_0x8c55('0x10')][_0x8c55('0x11')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2fc1bb,_0x8c55('0xe'));_0x54ccf1(_0x25225d[_0x8c55('0x12')][_0x8c55('0x11')]);}})[_0x8c55('0x13')](function(_0x3a2c3d){logger[_0x8c55('0x10')](_0x8c55('0xd'),_0x2fc1bb,_0x3a2c3d);_0x1627b1(_0x3a2c3d);});});} \ No newline at end of file +var _0x0ca8=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x31a755,_0x203ce1){var _0x4aa72b=function(_0xa3568c){while(--_0xa3568c){_0x31a755['push'](_0x31a755['shift']());}};_0x4aa72b(++_0x203ce1);}(_0x0ca8,0x6e));var _0x80ca=function(_0x4bbf71,_0xf724a2){_0x4bbf71=_0x4bbf71-0x0;var _0x21f28f=_0x0ca8[_0x4bbf71];return _0x21f28f;};'use strict';var _=require(_0x80ca('0x0'));var util=require(_0x80ca('0x1'));var moment=require(_0x80ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x80ca('0x3'));var fs=require('fs');var Redis=require(_0x80ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x80ca('0x5'));var logger=require('../../config/logger')(_0x80ca('0x6'));var config=require(_0x80ca('0x7'));var jayson=require(_0x80ca('0x8'));var client=jayson[_0x80ca('0x9')][_0x80ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3435b9,_0x416f41,_0xf827fa){return new BPromise(function(_0x399016,_0x39f678){return client['request'](_0x3435b9,_0xf827fa)[_0x80ca('0xb')](function(_0x96c26b){logger[_0x80ca('0xc')](_0x80ca('0xd'),_0x416f41,'request\x20sent');logger['debug'](_0x80ca('0xe'),_0x416f41,_0x80ca('0xf'),JSON[_0x80ca('0x10')](_0x96c26b));if(_0x96c26b['error']){if(_0x96c26b['error']['code']===0x1f4){logger['error'](_0x80ca('0xd'),_0x416f41,_0x96c26b['error']['message']);return _0x39f678(_0x96c26b[_0x80ca('0x11')]['message']);}logger['error'](_0x80ca('0xd'),_0x416f41,_0x96c26b[_0x80ca('0x11')][_0x80ca('0x12')]);return _0x399016(_0x96c26b[_0x80ca('0x11')][_0x80ca('0x12')]);}else{logger[_0x80ca('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x416f41,_0x80ca('0xf'));_0x399016(_0x96c26b[_0x80ca('0x13')][_0x80ca('0x12')]);}})[_0x80ca('0x14')](function(_0x5e057e){logger[_0x80ca('0x11')](_0x80ca('0xd'),_0x416f41,_0x5e057e);_0x39f678(_0x5e057e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a7d63e6..06b34bd 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 _0x03c6=['isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x03c6,0x84));var _0x603c=function(_0x20a6c8,_0x3d7c7c){_0x20a6c8=_0x20a6c8-0x0;var _0xdcff8c=_0x03c6[_0x20a6c8];return _0xdcff8c;};'use strict';var multer=require('multer');var util=require(_0x603c('0x0'));var path=require(_0x603c('0x1'));var timeout=require(_0x603c('0x2'));var express=require('express');var router=express[_0x603c('0x3')]();var fs_extra=require(_0x603c('0x4'));var auth=require(_0x603c('0x5'));var interaction=require(_0x603c('0x6'));var config=require(_0x603c('0x7'));var controller=require(_0x603c('0x8'));router[_0x603c('0x9')]('/',auth['isAuthenticated'](),controller[_0x603c('0xa')]);router[_0x603c('0x9')](_0x603c('0xb'),auth[_0x603c('0xc')](),controller[_0x603c('0xd')]);router[_0x603c('0x9')](_0x603c('0xe'),auth[_0x603c('0xc')](),controller[_0x603c('0xf')]);router[_0x603c('0x9')](_0x603c('0x10'),auth['isAuthenticated'](),controller[_0x603c('0x11')]);router['get'](_0x603c('0x12'),auth[_0x603c('0xc')](),controller[_0x603c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x603c('0x14')]);router['put'](_0x603c('0xb'),auth[_0x603c('0xc')](),controller['update']);router[_0x603c('0x15')](_0x603c('0xb'),auth['isAuthenticated'](),controller[_0x603c('0x16')]);module[_0x603c('0x17')]=router; \ No newline at end of file +var _0xf567=['/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0xf567,0x118));var _0x7f56=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf567[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var path=require(_0x7f56('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f56('0x3'));var router=express[_0x7f56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f56('0x5'));var interaction=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var controller=require(_0x7f56('0x8'));router['get']('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0xa')]);router[_0x7f56('0xb')]('/:id',auth[_0x7f56('0x9')](),controller[_0x7f56('0xc')]);router[_0x7f56('0xb')](_0x7f56('0xd'),auth[_0x7f56('0x9')](),controller[_0x7f56('0xe')]);router[_0x7f56('0xb')](_0x7f56('0xf'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x10')]);router[_0x7f56('0xb')](_0x7f56('0x11'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x12')]);router[_0x7f56('0x13')]('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0x14')]);router[_0x7f56('0x15')](_0x7f56('0x16'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x17')]);router[_0x7f56('0x18')]('/:id',auth[_0x7f56('0x9')](),controller[_0x7f56('0x19')]);module[_0x7f56('0x1a')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 66c213c..84a652c 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 _0x171e=['manual','scheduled','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv','Loading'];(function(_0xaecc27,_0x3b15ab){var _0x2203ec=function(_0x47efdf){while(--_0x47efdf){_0xaecc27['push'](_0xaecc27['shift']());}};_0x2203ec(++_0x3b15ab);}(_0x171e,0x141));var _0xe171=function(_0x3094c5,_0x69d9d){_0x3094c5=_0x3094c5-0x0;var _0x16665c=_0x171e[_0x3094c5];return _0x16665c;};'use strict';var Sequelize=require(_0xe171('0x0'));var moment=require(_0xe171('0x1'));module[_0xe171('0x2')]={'name':{'type':Sequelize[_0xe171('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xe171('0x4')]('csv',_0xe171('0x5'),_0xe171('0x6')),'allowNull':![],'defaultValue':_0xe171('0x7')},'savename':{'type':Sequelize[_0xe171('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe171('0x3')],'defaultValue':_0xe171('0x8')},'type':{'type':Sequelize[_0xe171('0x4')](_0xe171('0x9'),_0xe171('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe171('0x3')]}}; \ No newline at end of file +var _0x0d2a=['INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0d2a,0xd2));var _0xa0d2=function(_0x10059e,_0x136375){_0x10059e=_0x10059e-0x0;var _0x1e558f=_0x0d2a[_0x10059e];return _0x1e558f;};'use strict';var Sequelize=require(_0xa0d2('0x0'));var moment=require(_0xa0d2('0x1'));module[_0xa0d2('0x2')]={'name':{'type':Sequelize[_0xa0d2('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa0d2('0x4'),_0xa0d2('0x5'),_0xa0d2('0x6')),'allowNull':![],'defaultValue':_0xa0d2('0x4')},'savename':{'type':Sequelize[_0xa0d2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa0d2('0x7')]},'endDate':{'type':Sequelize[_0xa0d2('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa0d2('0x8')](_0xa0d2('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa0d2('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xa0d2('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 00a52ee..d8e32f5 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 _0x6ef3=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','catch','download','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','eml-format','rimraf','request-promise','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x27874d,_0x54b50a){var _0x5074db=function(_0x445ea9){while(--_0x445ea9){_0x27874d['push'](_0x27874d['shift']());}};_0x5074db(++_0x54b50a);}(_0x6ef3,0x15d));var _0x36ef=function(_0x33c023,_0x6aec4){_0x33c023=_0x33c023-0x0;var _0x47f08b=_0x6ef3[_0x33c023];return _0x47f08b;};'use strict';var emlformat=require(_0x36ef('0x0'));var rimraf=require(_0x36ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x36ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x36ef('0x3'));var path=require(_0x36ef('0x4'));var sox=require(_0x36ef('0x5'));var csv=require(_0x36ef('0x6'));var ejs=require(_0x36ef('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x36ef('0x8'));var crypto=require(_0x36ef('0x9'));var jsforce=require(_0x36ef('0xa'));var deskjs=require(_0x36ef('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x36ef('0xc'));var Redis=require(_0x36ef('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36ef('0xe'));var hardwareService=require(_0x36ef('0xf'));var logger=require(_0x36ef('0x10'))(_0x36ef('0x11'));var utils=require(_0x36ef('0x12'));var config=require(_0x36ef('0x13'));var licenseUtil=require(_0x36ef('0x14'));var db=require(_0x36ef('0x15'))['db'];function respondWithStatusCode(_0x200a12,_0x33586c){_0x33586c=_0x33586c||0xcc;return function(_0x4d6c1b){if(_0x4d6c1b){return _0x200a12[_0x36ef('0x16')](_0x33586c);}return _0x200a12[_0x36ef('0x17')](_0x33586c)[_0x36ef('0x18')]();};}function respondWithResult(_0x1e7d6e,_0x487c64){_0x487c64=_0x487c64||0xc8;return function(_0x45d990){if(_0x45d990){return _0x1e7d6e[_0x36ef('0x17')](_0x487c64)[_0x36ef('0x19')](_0x45d990);}};}function respondWithFilteredResult(_0x46fe6b,_0x2021e4){return function(_0x1a581f){if(_0x1a581f){var _0x5e2b0a=typeof _0x2021e4[_0x36ef('0x1a')]==='undefined'&&typeof _0x2021e4[_0x36ef('0x1b')]===_0x36ef('0x1c');var _0xe88b16=_0x1a581f[_0x36ef('0x1d')];var _0x119908=_0x5e2b0a?0x0:_0x2021e4['offset'];var _0x586b2b=_0x5e2b0a?_0x1a581f[_0x36ef('0x1d')]:_0x2021e4[_0x36ef('0x1a')]+_0x2021e4['limit'];var _0x46273b;if(_0x586b2b>=_0xe88b16){_0x586b2b=_0xe88b16;_0x46273b=0xc8;}else{_0x46273b=0xce;}_0x46fe6b[_0x36ef('0x17')](_0x46273b);return _0x46fe6b[_0x36ef('0x1e')](_0x36ef('0x1f'),_0x119908+'-'+_0x586b2b+'/'+_0xe88b16)[_0x36ef('0x19')](_0x1a581f);}return null;};}function patchUpdates(_0x28ff3b){return function(_0x54aed3){try{jsonpatch['apply'](_0x54aed3,_0x28ff3b,!![]);}catch(_0x5cc91f){return BPromise['reject'](_0x5cc91f);}return _0x54aed3[_0x36ef('0x20')]();};}function saveUpdates(_0x638dc4,_0x1f283b){return function(_0x222130){if(_0x222130){return _0x222130[_0x36ef('0x21')](_0x638dc4)[_0x36ef('0x22')](function(_0x51ae94){return _0x51ae94;});}return null;};}function removeEntity(_0x42bfb3,_0x322941){return function(_0x4ec71d){if(_0x4ec71d){return _0x4ec71d[_0x36ef('0x23')]()[_0x36ef('0x22')](function(){var _0x1000f7=_0x4ec71d['get']({'plain':!![]});var _0x56bbb0='ExtractedReports';return db[_0x36ef('0x24')][_0x36ef('0x23')]({'where':{'type':_0x56bbb0,'resourceId':_0x1000f7['id']}})[_0x36ef('0x22')](function(){return _0x4ec71d;});})[_0x36ef('0x22')](function(){_0x42bfb3['status'](0xcc)[_0x36ef('0x18')]();});}};}function handleEntityNotFound(_0x1cf7fd,_0x61f0f2){return function(_0x2af17a){if(!_0x2af17a){_0x1cf7fd['sendStatus'](0x194);}return _0x2af17a;};}function handleError(_0x247dd3,_0x4d828c){_0x4d828c=_0x4d828c||0x1f4;return function(_0x71218c){logger[_0x36ef('0x25')](_0x71218c[_0x36ef('0x26')]);if(_0x71218c[_0x36ef('0x27')]){delete _0x71218c['name'];}_0x247dd3[_0x36ef('0x17')](_0x4d828c)[_0x36ef('0x28')](_0x71218c);};}exports[_0x36ef('0x29')]=function(_0x290365,_0x26b972){var _0x20150f={},_0x13783b={},_0xeacb81={'count':0x0,'rows':[]};var _0x5e5d0c=_[_0x36ef('0x2a')](db[_0x36ef('0x2b')]['rawAttributes'],function(_0x317b22){return{'name':_0x317b22[_0x36ef('0x2c')],'type':_0x317b22[_0x36ef('0x2d')][_0x36ef('0x2e')]};});_0x13783b[_0x36ef('0x2f')]=_[_0x36ef('0x2a')](_0x5e5d0c,_0x36ef('0x27'));_0x13783b[_0x36ef('0x30')]=_[_0x36ef('0x31')](_0x290365['query']);_0x13783b[_0x36ef('0x32')]=_[_0x36ef('0x33')](_0x13783b['model'],_0x13783b[_0x36ef('0x30')]);_0x20150f[_0x36ef('0x34')]=_[_0x36ef('0x33')](_0x13783b['model'],qs[_0x36ef('0x35')](_0x290365[_0x36ef('0x30')][_0x36ef('0x35')]));_0x20150f[_0x36ef('0x34')]=_0x20150f[_0x36ef('0x34')][_0x36ef('0x36')]?_0x20150f['attributes']:_0x13783b['model'];if(!_0x290365[_0x36ef('0x30')]['hasOwnProperty'](_0x36ef('0x37'))){_0x20150f[_0x36ef('0x1b')]=qs[_0x36ef('0x1b')](_0x290365['query'][_0x36ef('0x1b')]);_0x20150f[_0x36ef('0x1a')]=qs[_0x36ef('0x1a')](_0x290365[_0x36ef('0x30')]['offset']);}_0x20150f[_0x36ef('0x38')]=qs[_0x36ef('0x39')](_0x290365[_0x36ef('0x30')]['sort']);_0x20150f[_0x36ef('0x3a')]=qs[_0x36ef('0x32')](_['pick'](_0x290365[_0x36ef('0x30')],_0x13783b[_0x36ef('0x32')]),_0x5e5d0c);if(_0x290365['query']['filter']){_0x20150f[_0x36ef('0x3a')]=_[_0x36ef('0x3b')](_0x20150f['where'],{'$or':_['map'](_0x5e5d0c,function(_0x35d3b6){if(_0x35d3b6[_0x36ef('0x2d')]!=='VIRTUAL'){var _0x4dcc36={};_0x4dcc36[_0x35d3b6[_0x36ef('0x27')]]={'$like':'%'+_0x290365[_0x36ef('0x30')][_0x36ef('0x3c')]+'%'};return _0x4dcc36;}})});}_0x20150f=_['merge']({},_0x20150f,_0x290365['options']);var _0x20f7d8={'where':_0x20150f[_0x36ef('0x3a')]};return db[_0x36ef('0x2b')][_0x36ef('0x1d')](_0x20f7d8)[_0x36ef('0x22')](function(_0x584f95){_0xeacb81[_0x36ef('0x1d')]=_0x584f95;if(_0x290365[_0x36ef('0x30')][_0x36ef('0x3d')]){_0x20150f[_0x36ef('0x3e')]=[{'all':!![]}];}return db[_0x36ef('0x2b')]['findAll'](_0x20150f);})[_0x36ef('0x22')](function(_0x195311){_0xeacb81[_0x36ef('0x3f')]=_0x195311;return _0xeacb81;})[_0x36ef('0x22')](respondWithFilteredResult(_0x26b972,_0x20150f))['catch'](handleError(_0x26b972,null));};exports[_0x36ef('0x40')]=function(_0x29c212,_0x499273){var _0x216fd4={'raw':!![],'where':{'id':_0x29c212[_0x36ef('0x41')]['id']}},_0x16e242={};_0x16e242['model']=_[_0x36ef('0x31')](db[_0x36ef('0x2b')][_0x36ef('0x42')]);_0x16e242[_0x36ef('0x30')]=_[_0x36ef('0x31')](_0x29c212[_0x36ef('0x30')]);_0x16e242[_0x36ef('0x32')]=_['intersection'](_0x16e242[_0x36ef('0x2f')],_0x16e242['query']);_0x216fd4[_0x36ef('0x34')]=_[_0x36ef('0x33')](_0x16e242['model'],qs[_0x36ef('0x35')](_0x29c212[_0x36ef('0x30')][_0x36ef('0x35')]));_0x216fd4['attributes']=_0x216fd4[_0x36ef('0x34')][_0x36ef('0x36')]?_0x216fd4[_0x36ef('0x34')]:_0x16e242[_0x36ef('0x2f')];if(_0x29c212[_0x36ef('0x30')][_0x36ef('0x3d')]){_0x216fd4['include']=[{'all':!![]}];}_0x216fd4=_[_0x36ef('0x3b')]({},_0x216fd4,_0x29c212[_0x36ef('0x43')]);return db['AnalyticExtractedReport'][_0x36ef('0x44')](_0x216fd4)[_0x36ef('0x22')](handleEntityNotFound(_0x499273,null))[_0x36ef('0x22')](respondWithResult(_0x499273,null))['catch'](handleError(_0x499273,null));};exports[_0x36ef('0x45')]=function(_0x3367d3,_0x47106e){return db[_0x36ef('0x2b')]['create'](_0x3367d3[_0x36ef('0x46')],{})[_0x36ef('0x22')](function(_0x2fefbb){var _0x23be31=_0x3367d3[_0x36ef('0x47')][_0x36ef('0x48')]({'plain':!![]});if(!_0x23be31)throw new Error(_0x36ef('0x49'));if(_0x23be31[_0x36ef('0x4a')]===_0x36ef('0x47')){var _0xfee25=_0x2fefbb[_0x36ef('0x48')]({'plain':!![]});var _0x72b22c=_0x36ef('0x4b');return db['UserProfileSection'][_0x36ef('0x44')]({'where':{'name':_0x72b22c,'userProfileId':_0x23be31[_0x36ef('0x4c')]},'raw':!![]})[_0x36ef('0x22')](function(_0x1ebed6){if(_0x1ebed6&&_0x1ebed6[_0x36ef('0x4d')]===0x0){return db[_0x36ef('0x24')][_0x36ef('0x45')]({'name':_0xfee25[_0x36ef('0x27')],'resourceId':_0xfee25['id'],'type':_0x1ebed6[_0x36ef('0x27')],'sectionId':_0x1ebed6['id']},{})['then'](function(){return _0x2fefbb;});}else{return _0x2fefbb;}})[_0x36ef('0x4e')](function(_0x583c4d){logger[_0x36ef('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583c4d);throw _0x583c4d;});}return _0x2fefbb;})[_0x36ef('0x22')](respondWithResult(_0x47106e,0xc9))['catch'](handleError(_0x47106e,null));};exports[_0x36ef('0x21')]=function(_0x19b349,_0xf339b1){if(_0x19b349['body']['id']){delete _0x19b349[_0x36ef('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x36ef('0x44')]({'where':{'id':_0x19b349[_0x36ef('0x41')]['id']}})[_0x36ef('0x22')](handleEntityNotFound(_0xf339b1,null))[_0x36ef('0x22')](saveUpdates(_0x19b349[_0x36ef('0x46')],null))[_0x36ef('0x22')](respondWithResult(_0xf339b1,null))[_0x36ef('0x4e')](handleError(_0xf339b1,null));};exports[_0x36ef('0x23')]=function(_0x11de40,_0x7b4c7){return db[_0x36ef('0x2b')][_0x36ef('0x44')]({'where':{'id':_0x11de40[_0x36ef('0x41')]['id']}})['then'](handleEntityNotFound(_0x7b4c7,null))[_0x36ef('0x22')](removeEntity(_0x7b4c7,null))[_0x36ef('0x4e')](handleError(_0x7b4c7,null));};exports[_0x36ef('0x4f')]=function(_0x38024e,_0xb206a,_0x33a802){return db['AnalyticExtractedReport'][_0x36ef('0x44')]({'where':{'id':_0x38024e['params']['id']},'attributes':['name','basename',_0x36ef('0x50'),_0x36ef('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0xb206a,null))['then'](function(_0x43945d){if(_0x43945d){if(!fs['existsSync'](path[_0x36ef('0x52')](config[_0x36ef('0x53')],_0x36ef('0x54'),_0x43945d['savename']))){throw new db[(_0x36ef('0x55'))][(_0x36ef('0x56'))](_0x36ef('0x57'));}if(_0x38024e['query'][_0x36ef('0x58')]){return _0xb206a[_0x36ef('0x16')](0xc8);}return _0xb206a[_0x36ef('0x4f')](path[_0x36ef('0x52')](config[_0x36ef('0x53')],'server/files/reports',_0x43945d[_0x36ef('0x50')]),util[_0x36ef('0x59')]('%s.%s',_0x43945d['basename']||_0x43945d[_0x36ef('0x27')],_0x43945d[_0x36ef('0x51')]['toLowerCase']()));}})[_0x36ef('0x4e')](handleError(_0xb206a,null));}; \ No newline at end of file +var _0xfd1c=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','ExtractedReports','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','get','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','existsSync','join','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','server/files/reports','format','%s.%s','basename','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x571bc2,_0x4f6080){var _0x1ca9cf=function(_0x57aad5){while(--_0x57aad5){_0x571bc2['push'](_0x571bc2['shift']());}};_0x1ca9cf(++_0x4f6080);}(_0xfd1c,0x1ee));var _0xcfd1=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0xfd1c[_0x209bbf];return _0x592d4b;};'use strict';var emlformat=require(_0xcfd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfd1('0x1'));var jsonpatch=require(_0xcfd1('0x2'));var rp=require(_0xcfd1('0x3'));var moment=require(_0xcfd1('0x4'));var BPromise=require(_0xcfd1('0x5'));var Mustache=require(_0xcfd1('0x6'));var util=require(_0xcfd1('0x7'));var path=require(_0xcfd1('0x8'));var sox=require(_0xcfd1('0x9'));var csv=require(_0xcfd1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfd1('0xb'));var _=require(_0xcfd1('0xc'));var squel=require(_0xcfd1('0xd'));var crypto=require(_0xcfd1('0xe'));var jsforce=require(_0xcfd1('0xf'));var deskjs=require(_0xcfd1('0x10'));var toCsv=require(_0xcfd1('0xa'));var querystring=require(_0xcfd1('0x11'));var Papa=require(_0xcfd1('0x12'));var Redis=require(_0xcfd1('0x13'));var authService=require(_0xcfd1('0x14'));var qs=require(_0xcfd1('0x15'));var as=require(_0xcfd1('0x16'));var hardwareService=require(_0xcfd1('0x17'));var logger=require(_0xcfd1('0x18'))(_0xcfd1('0x19'));var utils=require(_0xcfd1('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xcfd1('0x1b'));var db=require(_0xcfd1('0x1c'))['db'];function respondWithStatusCode(_0x2337d9,_0x1f25d8){_0x1f25d8=_0x1f25d8||0xcc;return function(_0x5082a2){if(_0x5082a2){return _0x2337d9[_0xcfd1('0x1d')](_0x1f25d8);}return _0x2337d9['status'](_0x1f25d8)['end']();};}function respondWithResult(_0x906055,_0x33dd22){_0x33dd22=_0x33dd22||0xc8;return function(_0x632788){if(_0x632788){return _0x906055[_0xcfd1('0x1e')](_0x33dd22)['json'](_0x632788);}};}function respondWithFilteredResult(_0x237d47,_0x26da8a){return function(_0x3ac44a){if(_0x3ac44a){var _0x3b6841=typeof _0x26da8a[_0xcfd1('0x1f')]==='undefined'&&typeof _0x26da8a[_0xcfd1('0x20')]===_0xcfd1('0x21');var _0x4d675f=_0x3ac44a[_0xcfd1('0x22')];var _0x55c211=_0x3b6841?0x0:_0x26da8a[_0xcfd1('0x1f')];var _0x3dc121=_0x3b6841?_0x3ac44a['count']:_0x26da8a['offset']+_0x26da8a[_0xcfd1('0x20')];var _0x414b1b;if(_0x3dc121>=_0x4d675f){_0x3dc121=_0x4d675f;_0x414b1b=0xc8;}else{_0x414b1b=0xce;}_0x237d47['status'](_0x414b1b);return _0x237d47[_0xcfd1('0x23')](_0xcfd1('0x24'),_0x55c211+'-'+_0x3dc121+'/'+_0x4d675f)[_0xcfd1('0x25')](_0x3ac44a);}return null;};}function patchUpdates(_0x5f25ec){return function(_0x1884cd){try{jsonpatch[_0xcfd1('0x26')](_0x1884cd,_0x5f25ec,!![]);}catch(_0x409d25){return BPromise[_0xcfd1('0x27')](_0x409d25);}return _0x1884cd[_0xcfd1('0x28')]();};}function saveUpdates(_0x1259e7,_0x1c35e1){return function(_0xa64b64){if(_0xa64b64){return _0xa64b64['update'](_0x1259e7)['then'](function(_0x2cef4f){return _0x2cef4f;});}return null;};}function removeEntity(_0x56cc5c,_0x55422e){return function(_0x19e12a){if(_0x19e12a){return _0x19e12a['destroy']()[_0xcfd1('0x29')](function(){var _0x50104a=_0x19e12a['get']({'plain':!![]});var _0x36f1ba=_0xcfd1('0x2a');return db[_0xcfd1('0x2b')][_0xcfd1('0x2c')]({'where':{'type':_0x36f1ba,'resourceId':_0x50104a['id']}})[_0xcfd1('0x29')](function(){return _0x19e12a;});})[_0xcfd1('0x29')](function(){_0x56cc5c[_0xcfd1('0x1e')](0xcc)[_0xcfd1('0x2d')]();});}};}function handleEntityNotFound(_0x3eb130,_0x39fe65){return function(_0x3b5f8b){if(!_0x3b5f8b){_0x3eb130[_0xcfd1('0x1d')](0x194);}return _0x3b5f8b;};}function handleError(_0x5d9d3f,_0x15c8a7){_0x15c8a7=_0x15c8a7||0x1f4;return function(_0xe426ec){logger[_0xcfd1('0x2e')](_0xe426ec[_0xcfd1('0x2f')]);if(_0xe426ec[_0xcfd1('0x30')]){delete _0xe426ec[_0xcfd1('0x30')];}_0x5d9d3f[_0xcfd1('0x1e')](_0x15c8a7)[_0xcfd1('0x31')](_0xe426ec);};}exports[_0xcfd1('0x32')]=function(_0x2e7c25,_0x3b7ffd){var _0x14d0c8={},_0x3d816e={},_0x16e5db={'count':0x0,'rows':[]};var _0x24d957=_[_0xcfd1('0x33')](db[_0xcfd1('0x34')][_0xcfd1('0x35')],function(_0x9bba30){return{'name':_0x9bba30[_0xcfd1('0x36')],'type':_0x9bba30[_0xcfd1('0x37')][_0xcfd1('0x38')]};});_0x3d816e[_0xcfd1('0x39')]=_[_0xcfd1('0x33')](_0x24d957,'name');_0x3d816e[_0xcfd1('0x3a')]=_[_0xcfd1('0x3b')](_0x2e7c25['query']);_0x3d816e[_0xcfd1('0x3c')]=_[_0xcfd1('0x3d')](_0x3d816e[_0xcfd1('0x39')],_0x3d816e[_0xcfd1('0x3a')]);_0x14d0c8['attributes']=_[_0xcfd1('0x3d')](_0x3d816e['model'],qs['fields'](_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x3e')]));_0x14d0c8[_0xcfd1('0x3f')]=_0x14d0c8[_0xcfd1('0x3f')][_0xcfd1('0x40')]?_0x14d0c8[_0xcfd1('0x3f')]:_0x3d816e[_0xcfd1('0x39')];if(!_0x2e7c25[_0xcfd1('0x3a')]['hasOwnProperty'](_0xcfd1('0x41'))){_0x14d0c8[_0xcfd1('0x20')]=qs[_0xcfd1('0x20')](_0x2e7c25[_0xcfd1('0x3a')]['limit']);_0x14d0c8['offset']=qs[_0xcfd1('0x1f')](_0x2e7c25['query'][_0xcfd1('0x1f')]);}_0x14d0c8[_0xcfd1('0x42')]=qs[_0xcfd1('0x43')](_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x43')]);_0x14d0c8[_0xcfd1('0x44')]=qs[_0xcfd1('0x3c')](_['pick'](_0x2e7c25[_0xcfd1('0x3a')],_0x3d816e[_0xcfd1('0x3c')]),_0x24d957);if(_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x45')]){_0x14d0c8['where']=_['merge'](_0x14d0c8[_0xcfd1('0x44')],{'$or':_[_0xcfd1('0x33')](_0x24d957,function(_0x53e15d){if(_0x53e15d[_0xcfd1('0x37')]!=='VIRTUAL'){var _0x4ad489={};_0x4ad489[_0x53e15d['name']]={'$like':'%'+_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x45')]+'%'};return _0x4ad489;}})});}_0x14d0c8=_['merge']({},_0x14d0c8,_0x2e7c25[_0xcfd1('0x46')]);var _0x9abd40={'where':_0x14d0c8[_0xcfd1('0x44')]};return db[_0xcfd1('0x34')]['count'](_0x9abd40)[_0xcfd1('0x29')](function(_0x65dd7d){_0x16e5db[_0xcfd1('0x22')]=_0x65dd7d;if(_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x47')]){_0x14d0c8['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xcfd1('0x48')](_0x14d0c8);})[_0xcfd1('0x29')](function(_0x44fec1){_0x16e5db[_0xcfd1('0x49')]=_0x44fec1;return _0x16e5db;})[_0xcfd1('0x29')](respondWithFilteredResult(_0x3b7ffd,_0x14d0c8))['catch'](handleError(_0x3b7ffd,null));};exports[_0xcfd1('0x4a')]=function(_0x4615d9,_0x3b4cb0){var _0x2d9903={'raw':!![],'where':{'id':_0x4615d9[_0xcfd1('0x4b')]['id']}},_0x21d31f={};_0x21d31f[_0xcfd1('0x39')]=_[_0xcfd1('0x3b')](db[_0xcfd1('0x34')][_0xcfd1('0x35')]);_0x21d31f['query']=_[_0xcfd1('0x3b')](_0x4615d9[_0xcfd1('0x3a')]);_0x21d31f[_0xcfd1('0x3c')]=_[_0xcfd1('0x3d')](_0x21d31f[_0xcfd1('0x39')],_0x21d31f['query']);_0x2d9903['attributes']=_['intersection'](_0x21d31f[_0xcfd1('0x39')],qs[_0xcfd1('0x3e')](_0x4615d9[_0xcfd1('0x3a')][_0xcfd1('0x3e')]));_0x2d9903['attributes']=_0x2d9903[_0xcfd1('0x3f')]['length']?_0x2d9903[_0xcfd1('0x3f')]:_0x21d31f[_0xcfd1('0x39')];if(_0x4615d9[_0xcfd1('0x3a')][_0xcfd1('0x47')]){_0x2d9903[_0xcfd1('0x4c')]=[{'all':!![]}];}_0x2d9903=_[_0xcfd1('0x4d')]({},_0x2d9903,_0x4615d9[_0xcfd1('0x46')]);return db[_0xcfd1('0x34')][_0xcfd1('0x4e')](_0x2d9903)[_0xcfd1('0x29')](handleEntityNotFound(_0x3b4cb0,null))[_0xcfd1('0x29')](respondWithResult(_0x3b4cb0,null))[_0xcfd1('0x4f')](handleError(_0x3b4cb0,null));};exports[_0xcfd1('0x50')]=function(_0x1b560d,_0x8f86e1){return db[_0xcfd1('0x34')][_0xcfd1('0x50')](_0x1b560d['body'],{})[_0xcfd1('0x29')](function(_0x49f31c){var _0xb430cc=_0x1b560d['user'][_0xcfd1('0x51')]({'plain':!![]});if(!_0xb430cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb430cc[_0xcfd1('0x52')]===_0xcfd1('0x53')){var _0x30e91f=_0x49f31c[_0xcfd1('0x51')]({'plain':!![]});var _0x87f027=_0xcfd1('0x2a');return db['UserProfileSection'][_0xcfd1('0x4e')]({'where':{'name':_0x87f027,'userProfileId':_0xb430cc[_0xcfd1('0x54')]},'raw':!![]})[_0xcfd1('0x29')](function(_0x315915){if(_0x315915&&_0x315915['autoAssociation']===0x0){return db[_0xcfd1('0x2b')][_0xcfd1('0x50')]({'name':_0x30e91f[_0xcfd1('0x30')],'resourceId':_0x30e91f['id'],'type':_0x315915[_0xcfd1('0x30')],'sectionId':_0x315915['id']},{})[_0xcfd1('0x29')](function(){return _0x49f31c;});}else{return _0x49f31c;}})[_0xcfd1('0x4f')](function(_0x40fe96){logger[_0xcfd1('0x2e')](_0xcfd1('0x55'),_0x40fe96);throw _0x40fe96;});}return _0x49f31c;})[_0xcfd1('0x29')](respondWithResult(_0x8f86e1,0xc9))[_0xcfd1('0x4f')](handleError(_0x8f86e1,null));};exports[_0xcfd1('0x56')]=function(_0x284bfb,_0x3c22af){if(_0x284bfb[_0xcfd1('0x57')]['id']){delete _0x284bfb[_0xcfd1('0x57')]['id'];}return db[_0xcfd1('0x34')][_0xcfd1('0x4e')]({'where':{'id':_0x284bfb[_0xcfd1('0x4b')]['id']}})[_0xcfd1('0x29')](handleEntityNotFound(_0x3c22af,null))[_0xcfd1('0x29')](saveUpdates(_0x284bfb[_0xcfd1('0x57')],null))['then'](respondWithResult(_0x3c22af,null))[_0xcfd1('0x4f')](handleError(_0x3c22af,null));};exports[_0xcfd1('0x2c')]=function(_0x188c76,_0xd71a46){return db[_0xcfd1('0x34')]['find']({'where':{'id':_0x188c76[_0xcfd1('0x4b')]['id']}})[_0xcfd1('0x29')](handleEntityNotFound(_0xd71a46,null))[_0xcfd1('0x29')](removeEntity(_0xd71a46,null))[_0xcfd1('0x4f')](handleError(_0xd71a46,null));};exports[_0xcfd1('0x58')]=function(_0xc12981,_0x23f22d,_0x247bba){return db[_0xcfd1('0x34')][_0xcfd1('0x4e')]({'where':{'id':_0xc12981[_0xcfd1('0x4b')]['id']},'attributes':[_0xcfd1('0x30'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x23f22d,null))[_0xcfd1('0x29')](function(_0xe59b9b){if(_0xe59b9b){if(!fs[_0xcfd1('0x59')](path[_0xcfd1('0x5a')](config['root'],'server/files/reports',_0xe59b9b[_0xcfd1('0x5b')]))){throw new db[(_0xcfd1('0x5c'))][(_0xcfd1('0x5d'))](_0xcfd1('0x5e'));}if(_0xc12981[_0xcfd1('0x3a')]['exists']){return _0x23f22d['sendStatus'](0xc8);}return _0x23f22d[_0xcfd1('0x58')](path[_0xcfd1('0x5a')](config[_0xcfd1('0x5f')],_0xcfd1('0x60'),_0xe59b9b[_0xcfd1('0x5b')]),util[_0xcfd1('0x61')](_0xcfd1('0x62'),_0xe59b9b[_0xcfd1('0x63')]||_0xe59b9b[_0xcfd1('0x30')],_0xe59b9b[_0xcfd1('0x64')]['toLowerCase']()));}})['catch'](handleError(_0x23f22d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 04ef13b..b16827e 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 _0x18ea=['AnalyticExtractedReport','lodash','api','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x145016,_0x40ba0b){var _0x4a57e8=function(_0x11ea2a){while(--_0x11ea2a){_0x145016['push'](_0x145016['shift']());}};_0x4a57e8(++_0x40ba0b);}(_0x18ea,0xa3));var _0xa18e=function(_0x5cb9b,_0x3b98e5){_0x5cb9b=_0x5cb9b-0x0;var _0x35caae=_0x18ea[_0x5cb9b];return _0x35caae;};'use strict';var _=require(_0xa18e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa18e('0x1'));var moment=require('moment');var BPromise=require(_0xa18e('0x2'));var rp=require(_0xa18e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa18e('0x4'));var attributes=require(_0xa18e('0x5'));module[_0xa18e('0x6')]=function(_0x3c5e47,_0x939ed5){return _0x3c5e47[_0xa18e('0x7')](_0xa18e('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde91=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x2ff0e4,_0x480398){var _0x3c15b7=function(_0x242b21){while(--_0x242b21){_0x2ff0e4['push'](_0x2ff0e4['shift']());}};_0x3c15b7(++_0x480398);}(_0xde91,0x192));var _0x1de9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xde91[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x1de9('0x0'));var util=require('util');var logger=require(_0x1de9('0x1'))(_0x1de9('0x2'));var moment=require(_0x1de9('0x3'));var BPromise=require(_0x1de9('0x4'));var rp=require(_0x1de9('0x5'));var fs=require('fs');var path=require(_0x1de9('0x6'));var rimraf=require(_0x1de9('0x7'));var config=require(_0x1de9('0x8'));var attributes=require(_0x1de9('0x9'));module['exports']=function(_0x1bfda3,_0x546baa){return _0x1bfda3[_0x1de9('0xa')](_0x1de9('0xb'),attributes,{'tableName':_0x1de9('0xc'),'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 d99ac57..f394d51 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 _0x2a5d=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c58b6,_0x15b786){var _0x1f658f=function(_0x4b1fdd){while(--_0x4b1fdd){_0x1c58b6['push'](_0x1c58b6['shift']());}};_0x1f658f(++_0x15b786);}(_0x2a5d,0x182));var _0xd2a5=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0x2a5d[_0x8a7e38];return _0x228609;};'use strict';var _=require(_0xd2a5('0x0'));var util=require(_0xd2a5('0x1'));var moment=require(_0xd2a5('0x2'));var BPromise=require(_0xd2a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2a5('0x4'));var db=require(_0xd2a5('0x5'))['db'];var utils=require(_0xd2a5('0x6'));var logger=require('../../config/logger')(_0xd2a5('0x7'));var config=require(_0xd2a5('0x8'));var jayson=require(_0xd2a5('0x9'));var client=jayson[_0xd2a5('0xa')][_0xd2a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f34c5,_0x5b5e05,_0x15e3b6){return new BPromise(function(_0x25172c,_0x7de88e){return client[_0xd2a5('0xc')](_0x2f34c5,_0x15e3b6)[_0xd2a5('0xd')](function(_0x55a618){logger[_0xd2a5('0xe')](_0xd2a5('0xf'),_0x5b5e05,_0xd2a5('0x10'));logger['debug'](_0xd2a5('0x11'),_0x5b5e05,'request\x20sent',JSON[_0xd2a5('0x12')](_0x55a618));if(_0x55a618[_0xd2a5('0x13')]){if(_0x55a618['error'][_0xd2a5('0x14')]===0x1f4){logger['error'](_0xd2a5('0xf'),_0x5b5e05,_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);return _0x7de88e(_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);}logger['error'](_0xd2a5('0xf'),_0x5b5e05,_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);return _0x25172c(_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);}else{logger['info'](_0xd2a5('0xf'),_0x5b5e05,_0xd2a5('0x10'));_0x25172c(_0x55a618[_0xd2a5('0x16')][_0xd2a5('0x15')]);}})[_0xd2a5('0x17')](function(_0x5c2dbf){logger[_0xd2a5('0x13')](_0xd2a5('0xf'),_0x5b5e05,_0x5c2dbf);_0x7de88e(_0x5c2dbf);});});} \ No newline at end of file +var _0xeeeb=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeeeb,0x16a));var _0xbeee=function(_0x2905d6,_0x1fde4a){_0x2905d6=_0x2905d6-0x0;var _0x2b9333=_0xeeeb[_0x2905d6];return _0x2b9333;};'use strict';var _=require(_0xbeee('0x0'));var util=require(_0xbeee('0x1'));var moment=require(_0xbeee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbeee('0x3'));var db=require(_0xbeee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbeee('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbeee('0x6'));var client=jayson[_0xbeee('0x7')][_0xbeee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f5db5,_0x47a8d8,_0x343c8c){return new BPromise(function(_0x139458,_0x9b3f99){return client['request'](_0x1f5db5,_0x343c8c)[_0xbeee('0x9')](function(_0xb75546){logger['info'](_0xbeee('0xa'),_0x47a8d8,_0xbeee('0xb'));logger[_0xbeee('0xc')](_0xbeee('0xd'),_0x47a8d8,_0xbeee('0xb'),JSON[_0xbeee('0xe')](_0xb75546));if(_0xb75546[_0xbeee('0xf')]){if(_0xb75546['error']['code']===0x1f4){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);return _0x9b3f99(_0xb75546['error'][_0xbeee('0x10')]);}logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);return _0x139458(_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);}else{logger[_0xbeee('0x11')](_0xbeee('0xa'),_0x47a8d8,_0xbeee('0xb'));_0x139458(_0xb75546[_0xbeee('0x12')][_0xbeee('0x10')]);}})[_0xbeee('0x13')](function(_0x123ee0){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0x123ee0);_0x9b3f99(_0x123ee0);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index bcb1c4f..ec44201 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 _0x20ab=['get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x453a78,_0x196cae){var _0x43fd7e=function(_0x5aa2f1){while(--_0x5aa2f1){_0x453a78['push'](_0x453a78['shift']());}};_0x43fd7e(++_0x196cae);}(_0x20ab,0x197));var _0xb20a=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x20ab[_0xb6e43];return _0x47c40f;};'use strict';var multer=require(_0xb20a('0x0'));var util=require('util');var path=require(_0xb20a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb20a('0x2'));var router=express['Router']();var fs_extra=require(_0xb20a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb20a('0x4'));var config=require(_0xb20a('0x5'));var controller=require(_0xb20a('0x6'));router[_0xb20a('0x7')]('/',auth[_0xb20a('0x8')](),controller[_0xb20a('0x9')]);router['get']('/:id',auth[_0xb20a('0x8')](),controller[_0xb20a('0xa')]);router[_0xb20a('0x7')](_0xb20a('0xb'),auth[_0xb20a('0x8')](),controller[_0xb20a('0xc')]);router[_0xb20a('0xd')]('/',auth[_0xb20a('0x8')](),controller['create']);router[_0xb20a('0xe')](_0xb20a('0xf'),auth[_0xb20a('0x8')](),controller[_0xb20a('0x10')]);router['delete'](_0xb20a('0xf'),auth[_0xb20a('0x8')](),controller['destroy']);module[_0xb20a('0x11')]=router; \ No newline at end of file +var _0x4fda=['/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x4fda,0x1e7));var _0xa4fd=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x4fda[_0x1ebce2];return _0x4a330c;};'use strict';var multer=require(_0xa4fd('0x0'));var util=require(_0xa4fd('0x1'));var path=require(_0xa4fd('0x2'));var timeout=require(_0xa4fd('0x3'));var express=require('express');var router=express[_0xa4fd('0x4')]();var fs_extra=require(_0xa4fd('0x5'));var auth=require(_0xa4fd('0x6'));var interaction=require(_0xa4fd('0x7'));var config=require(_0xa4fd('0x8'));var controller=require(_0xa4fd('0x9'));router[_0xa4fd('0xa')]('/',auth[_0xa4fd('0xb')](),controller[_0xa4fd('0xc')]);router[_0xa4fd('0xa')](_0xa4fd('0xd'),auth[_0xa4fd('0xb')](),controller[_0xa4fd('0xe')]);router[_0xa4fd('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xa4fd('0xb')](),controller['create']);router[_0xa4fd('0xf')]('/:id',auth[_0xa4fd('0xb')](),controller[_0xa4fd('0x10')]);router[_0xa4fd('0x11')](_0xa4fd('0xd'),auth[_0xa4fd('0xb')](),controller[_0xa4fd('0x12')]);module[_0xa4fd('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c279b8f..d716f68 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 _0x3d67=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0xffbd19,_0x18fb82){var _0x619464=function(_0x123e2a){while(--_0x123e2a){_0xffbd19['push'](_0xffbd19['shift']());}};_0x619464(++_0x18fb82);}(_0x3d67,0x144));var _0x73d6=function(_0x552291,_0x37ae2f){_0x552291=_0x552291-0x0;var _0x4985c2=_0x3d67[_0x552291];return _0x4985c2;};'use strict';var Sequelize=require(_0x73d6('0x0'));module[_0x73d6('0x1')]={'field':{'type':Sequelize[_0x73d6('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x73d6('0x3')]},'format':{'type':Sequelize[_0x73d6('0x3')]},'groupBy':{'type':Sequelize[_0x73d6('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x73d6('0x3')]},'custom':{'type':Sequelize[_0x73d6('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb77d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb77d,0xf5));var _0xdb77=function(_0x3c235f,_0x29a577){_0x3c235f=_0x3c235f-0x0;var _0x4447d8=_0xb77d[_0x3c235f];return _0x4447d8;};'use strict';var Sequelize=require(_0xdb77('0x0'));module[_0xdb77('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdb77('0x2')]},'function':{'type':Sequelize[_0xdb77('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdb77('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdb77('0x2')]},'custom':{'type':Sequelize[_0xdb77('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 9ec5314..6b6a069 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 _0xcbba=['addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','rows','show','find','create','body','catch','bulkCreate','params','destroy','bulkDestroy','ids'];(function(_0x3b6fef,_0x5ae452){var _0x227b3f=function(_0x1c7883){while(--_0x1c7883){_0x3b6fef['push'](_0x3b6fef['shift']());}};_0x227b3f(++_0x5ae452);}(_0xcbba,0x16a));var _0xacbb=function(_0x145bd7,_0x2699f3){_0x145bd7=_0x145bd7-0x0;var _0x498b85=_0xcbba[_0x145bd7];return _0x498b85;};'use strict';var emlformat=require(_0xacbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacbb('0x1'));var jsonpatch=require(_0xacbb('0x2'));var rp=require(_0xacbb('0x3'));var moment=require(_0xacbb('0x4'));var BPromise=require(_0xacbb('0x5'));var Mustache=require(_0xacbb('0x6'));var util=require('util');var path=require(_0xacbb('0x7'));var sox=require(_0xacbb('0x8'));var csv=require(_0xacbb('0x9'));var ejs=require(_0xacbb('0xa'));var fs=require('fs');var fs_extra=require(_0xacbb('0xb'));var _=require(_0xacbb('0xc'));var squel=require(_0xacbb('0xd'));var crypto=require(_0xacbb('0xe'));var jsforce=require(_0xacbb('0xf'));var deskjs=require(_0xacbb('0x10'));var toCsv=require(_0xacbb('0x9'));var querystring=require(_0xacbb('0x11'));var Papa=require(_0xacbb('0x12'));var Redis=require(_0xacbb('0x13'));var authService=require(_0xacbb('0x14'));var qs=require(_0xacbb('0x15'));var as=require(_0xacbb('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacbb('0x17'))(_0xacbb('0x18'));var utils=require(_0xacbb('0x19'));var config=require(_0xacbb('0x1a'));var licenseUtil=require(_0xacbb('0x1b'));var db=require(_0xacbb('0x1c'))['db'];function respondWithStatusCode(_0xc639c6,_0xeadcd8){_0xeadcd8=_0xeadcd8||0xcc;return function(_0x254017){if(_0x254017){return _0xc639c6[_0xacbb('0x1d')](_0xeadcd8);}return _0xc639c6[_0xacbb('0x1e')](_0xeadcd8)[_0xacbb('0x1f')]();};}function respondWithResult(_0x55ada0,_0x34b2ba){_0x34b2ba=_0x34b2ba||0xc8;return function(_0x22ef55){if(_0x22ef55){return _0x55ada0[_0xacbb('0x1e')](_0x34b2ba)[_0xacbb('0x20')](_0x22ef55);}};}function respondWithFilteredResult(_0x5c438b,_0x2d9dd2){return function(_0x1b18da){if(_0x1b18da){var _0x121095=typeof _0x2d9dd2[_0xacbb('0x21')]==='undefined'&&typeof _0x2d9dd2[_0xacbb('0x22')]===_0xacbb('0x23');var _0x5bb654=_0x1b18da['count'];var _0x5c4c58=_0x121095?0x0:_0x2d9dd2[_0xacbb('0x21')];var _0x411049=_0x121095?_0x1b18da[_0xacbb('0x24')]:_0x2d9dd2['offset']+_0x2d9dd2['limit'];var _0x38255e;if(_0x411049>=_0x5bb654){_0x411049=_0x5bb654;_0x38255e=0xc8;}else{_0x38255e=0xce;}_0x5c438b['status'](_0x38255e);return _0x5c438b[_0xacbb('0x25')](_0xacbb('0x26'),_0x5c4c58+'-'+_0x411049+'/'+_0x5bb654)[_0xacbb('0x20')](_0x1b18da);}return null;};}function patchUpdates(_0xfba26c){return function(_0x131e7a){try{jsonpatch[_0xacbb('0x27')](_0x131e7a,_0xfba26c,!![]);}catch(_0x76c954){return BPromise[_0xacbb('0x28')](_0x76c954);}return _0x131e7a[_0xacbb('0x29')]();};}function saveUpdates(_0x15ce6c,_0x28cba4){return function(_0x4c4050){if(_0x4c4050){return _0x4c4050[_0xacbb('0x2a')](_0x15ce6c)[_0xacbb('0x2b')](function(_0x276b0f){return _0x276b0f;});}return null;};}function removeEntity(_0x28f664,_0xa8b587){return function(_0x2485e2){if(_0x2485e2){return _0x2485e2['destroy']()[_0xacbb('0x2b')](function(){_0x28f664[_0xacbb('0x1e')](0xcc)[_0xacbb('0x1f')]();});}};}function handleEntityNotFound(_0x2edae3,_0x3d5af4){return function(_0x26d971){if(!_0x26d971){_0x2edae3[_0xacbb('0x1d')](0x194);}return _0x26d971;};}function handleError(_0x392543,_0x3a833c){_0x3a833c=_0x3a833c||0x1f4;return function(_0x17b91f){logger[_0xacbb('0x2c')](_0x17b91f[_0xacbb('0x2d')]);if(_0x17b91f[_0xacbb('0x2e')]){delete _0x17b91f[_0xacbb('0x2e')];}_0x392543[_0xacbb('0x1e')](_0x3a833c)[_0xacbb('0x2f')](_0x17b91f);};}exports[_0xacbb('0x30')]=function(_0x3b4480,_0x578143){var _0x1fe214={},_0x321110={},_0x351502={'count':0x0,'rows':[]};var _0x2c7de9=_[_0xacbb('0x31')](db[_0xacbb('0x32')][_0xacbb('0x33')],function(_0x2ab96f){return{'name':_0x2ab96f[_0xacbb('0x34')],'type':_0x2ab96f[_0xacbb('0x35')][_0xacbb('0x36')]};});_0x321110[_0xacbb('0x37')]=_[_0xacbb('0x31')](_0x2c7de9,_0xacbb('0x2e'));_0x321110[_0xacbb('0x38')]=_[_0xacbb('0x39')](_0x3b4480[_0xacbb('0x38')]);_0x321110[_0xacbb('0x3a')]=_[_0xacbb('0x3b')](_0x321110[_0xacbb('0x37')],_0x321110[_0xacbb('0x38')]);_0x1fe214[_0xacbb('0x3c')]=_['intersection'](_0x321110[_0xacbb('0x37')],qs[_0xacbb('0x3d')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x3d')]));_0x1fe214['attributes']=_0x1fe214[_0xacbb('0x3c')][_0xacbb('0x3e')]?_0x1fe214[_0xacbb('0x3c')]:_0x321110['model'];if(!_0x3b4480[_0xacbb('0x38')][_0xacbb('0x3f')](_0xacbb('0x40'))){_0x1fe214[_0xacbb('0x22')]=qs[_0xacbb('0x22')](_0x3b4480[_0xacbb('0x38')]['limit']);_0x1fe214[_0xacbb('0x21')]=qs[_0xacbb('0x21')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x21')]);}_0x1fe214['order']=qs[_0xacbb('0x41')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x41')]);_0x1fe214['where']=qs[_0xacbb('0x3a')](_['pick'](_0x3b4480[_0xacbb('0x38')],_0x321110[_0xacbb('0x3a')]),_0x2c7de9);if(_0x3b4480[_0xacbb('0x38')][_0xacbb('0x42')]){_0x1fe214['where']=_[_0xacbb('0x43')](_0x1fe214[_0xacbb('0x44')],{'$or':_[_0xacbb('0x31')](_0x2c7de9,function(_0x499d10){if(_0x499d10[_0xacbb('0x35')]!=='VIRTUAL'){var _0x1f4cb={};_0x1f4cb[_0x499d10[_0xacbb('0x2e')]]={'$like':'%'+_0x3b4480[_0xacbb('0x38')]['filter']+'%'};return _0x1f4cb;}})});}_0x1fe214=_['merge']({},_0x1fe214,_0x3b4480[_0xacbb('0x45')]);var _0x538c71={'where':_0x1fe214[_0xacbb('0x44')]};return db[_0xacbb('0x32')][_0xacbb('0x24')](_0x538c71)[_0xacbb('0x2b')](function(_0x2254f1){_0x351502['count']=_0x2254f1;if(_0x3b4480['query'][_0xacbb('0x46')]){_0x1fe214[_0xacbb('0x47')]=[{'all':!![]}];}return db[_0xacbb('0x32')]['findAll'](_0x1fe214);})['then'](function(_0x132d93){_0x351502[_0xacbb('0x48')]=_0x132d93;return _0x351502;})[_0xacbb('0x2b')](respondWithFilteredResult(_0x578143,_0x1fe214))['catch'](handleError(_0x578143,null));};exports[_0xacbb('0x49')]=function(_0x58e367,_0x5cb38f){var _0x38df9e={'raw':![],'where':{'id':_0x58e367['params']['id']}},_0x45ce70={};_0x45ce70[_0xacbb('0x37')]=_['keys'](db[_0xacbb('0x32')][_0xacbb('0x33')]);_0x45ce70[_0xacbb('0x38')]=_[_0xacbb('0x39')](_0x58e367['query']);_0x45ce70[_0xacbb('0x3a')]=_[_0xacbb('0x3b')](_0x45ce70[_0xacbb('0x37')],_0x45ce70[_0xacbb('0x38')]);_0x38df9e[_0xacbb('0x3c')]=_[_0xacbb('0x3b')](_0x45ce70[_0xacbb('0x37')],qs[_0xacbb('0x3d')](_0x58e367[_0xacbb('0x38')][_0xacbb('0x3d')]));_0x38df9e[_0xacbb('0x3c')]=_0x38df9e[_0xacbb('0x3c')]['length']?_0x38df9e[_0xacbb('0x3c')]:_0x45ce70[_0xacbb('0x37')];if(_0x58e367[_0xacbb('0x38')]['includeAll']){_0x38df9e[_0xacbb('0x47')]=[{'all':!![]}];}_0x38df9e=_['merge']({},_0x38df9e,_0x58e367['options']);return db[_0xacbb('0x32')][_0xacbb('0x4a')](_0x38df9e)[_0xacbb('0x2b')](handleEntityNotFound(_0x5cb38f,null))['then'](respondWithResult(_0x5cb38f,null))['catch'](handleError(_0x5cb38f,null));};exports[_0xacbb('0x4b')]=function(_0x7e9af2,_0x5ac7ad){return db[_0xacbb('0x32')][_0xacbb('0x4b')](_0x7e9af2[_0xacbb('0x4c')],{})['then'](respondWithResult(_0x5ac7ad,0xc9))[_0xacbb('0x4d')](handleError(_0x5ac7ad,null));};exports[_0xacbb('0x4e')]=function(_0x1992e9,_0x3e7409){return db[_0xacbb('0x32')][_0xacbb('0x4e')](_0x1992e9[_0xacbb('0x4c')],{'raw':![],'individualHooks':!![]})[_0xacbb('0x2b')](respondWithResult(_0x3e7409,0xc9))[_0xacbb('0x4d')](handleError(_0x3e7409,null));};exports['update']=function(_0x31949a,_0x545958){if(_0x31949a['body']['id']){delete _0x31949a[_0xacbb('0x4c')]['id'];}return db[_0xacbb('0x32')][_0xacbb('0x4a')]({'where':{'id':_0x31949a[_0xacbb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x545958,null))[_0xacbb('0x2b')](saveUpdates(_0x31949a[_0xacbb('0x4c')],null))[_0xacbb('0x2b')](respondWithResult(_0x545958,null))[_0xacbb('0x4d')](handleError(_0x545958,null));};exports[_0xacbb('0x50')]=function(_0x9dbfff,_0xdabe33){return db[_0xacbb('0x32')][_0xacbb('0x4a')]({'where':{'id':_0x9dbfff['params']['id']}})['then'](handleEntityNotFound(_0xdabe33,null))[_0xacbb('0x2b')](removeEntity(_0xdabe33,null))[_0xacbb('0x4d')](handleError(_0xdabe33,null));};exports[_0xacbb('0x51')]=function(_0x4140ab,_0x2401a9){return db['AnalyticFieldReport'][_0xacbb('0x50')]({'where':{'id':_0x4140ab[_0xacbb('0x38')][_0xacbb('0x52')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2401a9,0xcc))[_0xacbb('0x4d')](handleError(_0x2401a9,null));};exports[_0xacbb('0x53')]=function(_0x13bdc2,_0x481a49,_0x4b6bd3){return db[_0xacbb('0x54')][_0xacbb('0x55')]({'where':{'id':_0x13bdc2[_0xacbb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x481a49,null))[_0xacbb('0x2b')](function(_0x57016b){if(_0x57016b){return db[_0xacbb('0x56')]['transaction'](function(_0x4458c3){return db[_0xacbb('0x32')][_0xacbb('0x50')]({'where':{'CustomReportId':_0x13bdc2['params']['id']},'transaction':_0x4458c3})['then'](function(_0x11efc6){var _0x15a2aa=_[_0xacbb('0x31')](_0x13bdc2[_0xacbb('0x4c')],function(_0x107e04){delete _0x107e04['id'];_0x107e04[_0xacbb('0x57')]=_0x13bdc2['params']['id'];return _0x107e04;});return db[_0xacbb('0x32')][_0xacbb('0x4e')](_0x15a2aa,{'transaction':_0x4458c3});});})[_0xacbb('0x2b')](function(){return db[_0xacbb('0x32')][_0xacbb('0x58')]({'where':{'CustomReportId':_0x13bdc2[_0xacbb('0x4f')]['id']}});});}})[_0xacbb('0x2b')](respondWithResult(_0x481a49,null))[_0xacbb('0x4d')](handleError(_0x481a49,null));}; \ No newline at end of file +var _0xb43b=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query'];(function(_0x34176d,_0x13188d){var _0x492df5=function(_0x4f1346){while(--_0x4f1346){_0x34176d['push'](_0x34176d['shift']());}};_0x492df5(++_0x13188d);}(_0xb43b,0x10b));var _0xbb43=function(_0x3812b5,_0x16e889){_0x3812b5=_0x3812b5-0x0;var _0x337af7=_0xb43b[_0x3812b5];return _0x337af7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb43('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x1'));var rp=require('request-promise');var moment=require(_0xbb43('0x2'));var BPromise=require(_0xbb43('0x3'));var Mustache=require(_0xbb43('0x4'));var util=require('util');var path=require(_0xbb43('0x5'));var sox=require(_0xbb43('0x6'));var csv=require(_0xbb43('0x7'));var ejs=require(_0xbb43('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb43('0x9'));var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbb43('0xc'));var toCsv=require(_0xbb43('0x7'));var querystring=require(_0xbb43('0xd'));var Papa=require(_0xbb43('0xe'));var Redis=require(_0xbb43('0xf'));var authService=require(_0xbb43('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb43('0x11'));var logger=require(_0xbb43('0x12'))(_0xbb43('0x13'));var utils=require('../../config/utils');var config=require(_0xbb43('0x14'));var licenseUtil=require(_0xbb43('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496b03,_0x42bf6d){_0x42bf6d=_0x42bf6d||0xcc;return function(_0x61525b){if(_0x61525b){return _0x496b03[_0xbb43('0x16')](_0x42bf6d);}return _0x496b03[_0xbb43('0x17')](_0x42bf6d)[_0xbb43('0x18')]();};}function respondWithResult(_0x6cabe3,_0x3897d6){_0x3897d6=_0x3897d6||0xc8;return function(_0x3a77f3){if(_0x3a77f3){return _0x6cabe3[_0xbb43('0x17')](_0x3897d6)[_0xbb43('0x19')](_0x3a77f3);}};}function respondWithFilteredResult(_0x458b0a,_0x3d1732){return function(_0x15854b){if(_0x15854b){var _0x2985fc=typeof _0x3d1732[_0xbb43('0x1a')]==='undefined'&&typeof _0x3d1732[_0xbb43('0x1b')]===_0xbb43('0x1c');var _0x2d22c8=_0x15854b[_0xbb43('0x1d')];var _0x2afd77=_0x2985fc?0x0:_0x3d1732['offset'];var _0x3f37b7=_0x2985fc?_0x15854b[_0xbb43('0x1d')]:_0x3d1732[_0xbb43('0x1a')]+_0x3d1732[_0xbb43('0x1b')];var _0x260af8;if(_0x3f37b7>=_0x2d22c8){_0x3f37b7=_0x2d22c8;_0x260af8=0xc8;}else{_0x260af8=0xce;}_0x458b0a['status'](_0x260af8);return _0x458b0a[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2afd77+'-'+_0x3f37b7+'/'+_0x2d22c8)[_0xbb43('0x19')](_0x15854b);}return null;};}function patchUpdates(_0x230f33){return function(_0x33c5d9){try{jsonpatch[_0xbb43('0x20')](_0x33c5d9,_0x230f33,!![]);}catch(_0x987a58){return BPromise[_0xbb43('0x21')](_0x987a58);}return _0x33c5d9[_0xbb43('0x22')]();};}function saveUpdates(_0x41e1f1,_0x9e6286){return function(_0x545789){if(_0x545789){return _0x545789[_0xbb43('0x23')](_0x41e1f1)['then'](function(_0x16e599){return _0x16e599;});}return null;};}function removeEntity(_0x4a790d,_0x586c82){return function(_0x464534){if(_0x464534){return _0x464534[_0xbb43('0x24')]()[_0xbb43('0x25')](function(){_0x4a790d[_0xbb43('0x17')](0xcc)[_0xbb43('0x18')]();});}};}function handleEntityNotFound(_0x297778,_0x4a9f81){return function(_0x27b6dc){if(!_0x27b6dc){_0x297778[_0xbb43('0x16')](0x194);}return _0x27b6dc;};}function handleError(_0x4173a6,_0x3f114d){_0x3f114d=_0x3f114d||0x1f4;return function(_0x308be4){logger['error'](_0x308be4['stack']);if(_0x308be4[_0xbb43('0x26')]){delete _0x308be4[_0xbb43('0x26')];}_0x4173a6['status'](_0x3f114d)[_0xbb43('0x27')](_0x308be4);};}exports[_0xbb43('0x28')]=function(_0x5e668a,_0xaeb1e4){var _0x554771={},_0x2b5e07={},_0x24f4fa={'count':0x0,'rows':[]};var _0x2c5799=_[_0xbb43('0x29')](db[_0xbb43('0x2a')]['rawAttributes'],function(_0x37792d){return{'name':_0x37792d[_0xbb43('0x2b')],'type':_0x37792d[_0xbb43('0x2c')][_0xbb43('0x2d')]};});_0x2b5e07[_0xbb43('0x2e')]=_[_0xbb43('0x29')](_0x2c5799,_0xbb43('0x26'));_0x2b5e07['query']=_[_0xbb43('0x2f')](_0x5e668a[_0xbb43('0x30')]);_0x2b5e07[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x2b5e07[_0xbb43('0x2e')],_0x2b5e07[_0xbb43('0x30')]);_0x554771[_0xbb43('0x33')]=_[_0xbb43('0x32')](_0x2b5e07[_0xbb43('0x2e')],qs[_0xbb43('0x34')](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x34')]));_0x554771[_0xbb43('0x33')]=_0x554771[_0xbb43('0x33')][_0xbb43('0x35')]?_0x554771[_0xbb43('0x33')]:_0x2b5e07[_0xbb43('0x2e')];if(!_0x5e668a[_0xbb43('0x30')][_0xbb43('0x36')](_0xbb43('0x37'))){_0x554771[_0xbb43('0x1b')]=qs[_0xbb43('0x1b')](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x1b')]);_0x554771[_0xbb43('0x1a')]=qs['offset'](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x1a')]);}_0x554771[_0xbb43('0x38')]=qs[_0xbb43('0x39')](_0x5e668a['query']['sort']);_0x554771[_0xbb43('0x3a')]=qs[_0xbb43('0x31')](_[_0xbb43('0x3b')](_0x5e668a['query'],_0x2b5e07[_0xbb43('0x31')]),_0x2c5799);if(_0x5e668a[_0xbb43('0x30')]['filter']){_0x554771['where']=_[_0xbb43('0x3c')](_0x554771[_0xbb43('0x3a')],{'$or':_[_0xbb43('0x29')](_0x2c5799,function(_0x442940){if(_0x442940[_0xbb43('0x2c')]!=='VIRTUAL'){var _0x46de11={};_0x46de11[_0x442940[_0xbb43('0x26')]]={'$like':'%'+_0x5e668a['query'][_0xbb43('0x3d')]+'%'};return _0x46de11;}})});}_0x554771=_[_0xbb43('0x3c')]({},_0x554771,_0x5e668a[_0xbb43('0x3e')]);var _0x43eb8a={'where':_0x554771['where']};return db[_0xbb43('0x2a')][_0xbb43('0x1d')](_0x43eb8a)[_0xbb43('0x25')](function(_0x252e43){_0x24f4fa['count']=_0x252e43;if(_0x5e668a[_0xbb43('0x30')]['includeAll']){_0x554771[_0xbb43('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x554771);})['then'](function(_0x3abdf6){_0x24f4fa[_0xbb43('0x40')]=_0x3abdf6;return _0x24f4fa;})['then'](respondWithFilteredResult(_0xaeb1e4,_0x554771))[_0xbb43('0x41')](handleError(_0xaeb1e4,null));};exports[_0xbb43('0x42')]=function(_0x5a0376,_0x3671f4){var _0x228bbe={'raw':![],'where':{'id':_0x5a0376[_0xbb43('0x43')]['id']}},_0x55fa09={};_0x55fa09['model']=_[_0xbb43('0x2f')](db[_0xbb43('0x2a')]['rawAttributes']);_0x55fa09[_0xbb43('0x30')]=_[_0xbb43('0x2f')](_0x5a0376[_0xbb43('0x30')]);_0x55fa09[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x55fa09[_0xbb43('0x2e')],_0x55fa09['query']);_0x228bbe['attributes']=_['intersection'](_0x55fa09[_0xbb43('0x2e')],qs[_0xbb43('0x34')](_0x5a0376[_0xbb43('0x30')]['fields']));_0x228bbe[_0xbb43('0x33')]=_0x228bbe[_0xbb43('0x33')][_0xbb43('0x35')]?_0x228bbe[_0xbb43('0x33')]:_0x55fa09['model'];if(_0x5a0376[_0xbb43('0x30')][_0xbb43('0x44')]){_0x228bbe[_0xbb43('0x3f')]=[{'all':!![]}];}_0x228bbe=_['merge']({},_0x228bbe,_0x5a0376[_0xbb43('0x3e')]);return db[_0xbb43('0x2a')][_0xbb43('0x45')](_0x228bbe)['then'](handleEntityNotFound(_0x3671f4,null))[_0xbb43('0x25')](respondWithResult(_0x3671f4,null))[_0xbb43('0x41')](handleError(_0x3671f4,null));};exports[_0xbb43('0x46')]=function(_0x2cd365,_0xb34bbd){return db[_0xbb43('0x2a')][_0xbb43('0x46')](_0x2cd365['body'],{})[_0xbb43('0x25')](respondWithResult(_0xb34bbd,0xc9))[_0xbb43('0x41')](handleError(_0xb34bbd,null));};exports[_0xbb43('0x47')]=function(_0x5cb5e0,_0x40b926){return db[_0xbb43('0x2a')][_0xbb43('0x47')](_0x5cb5e0[_0xbb43('0x48')],{'raw':![],'individualHooks':!![]})[_0xbb43('0x25')](respondWithResult(_0x40b926,0xc9))['catch'](handleError(_0x40b926,null));};exports[_0xbb43('0x23')]=function(_0x8011cb,_0xff9d13){if(_0x8011cb['body']['id']){delete _0x8011cb[_0xbb43('0x48')]['id'];}return db['AnalyticFieldReport'][_0xbb43('0x45')]({'where':{'id':_0x8011cb['params']['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0xff9d13,null))[_0xbb43('0x25')](saveUpdates(_0x8011cb['body'],null))['then'](respondWithResult(_0xff9d13,null))[_0xbb43('0x41')](handleError(_0xff9d13,null));};exports['destroy']=function(_0x4991db,_0x2e266b){return db[_0xbb43('0x2a')][_0xbb43('0x45')]({'where':{'id':_0x4991db[_0xbb43('0x43')]['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0x2e266b,null))[_0xbb43('0x25')](removeEntity(_0x2e266b,null))['catch'](handleError(_0x2e266b,null));};exports[_0xbb43('0x49')]=function(_0x2dcf90,_0x2cc449){return db[_0xbb43('0x2a')]['destroy']({'where':{'id':_0x2dcf90['query'][_0xbb43('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xbb43('0x25')](respondWithResult(_0x2cc449,0xcc))[_0xbb43('0x41')](handleError(_0x2cc449,null));};exports[_0xbb43('0x4b')]=function(_0x1eb364,_0x320e15,_0xcdbe61){return db[_0xbb43('0x4c')]['findOne']({'where':{'id':_0x1eb364[_0xbb43('0x43')]['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0x320e15,null))[_0xbb43('0x25')](function(_0x13a19b){if(_0x13a19b){return db['sequelize']['transaction'](function(_0x529bac){return db['AnalyticFieldReport'][_0xbb43('0x24')]({'where':{'CustomReportId':_0x1eb364[_0xbb43('0x43')]['id']},'transaction':_0x529bac})['then'](function(_0x5e1ecf){var _0x5bec6d=_[_0xbb43('0x29')](_0x1eb364[_0xbb43('0x48')],function(_0xf2b12a){delete _0xf2b12a['id'];_0xf2b12a[_0xbb43('0x4d')]=_0x1eb364[_0xbb43('0x43')]['id'];return _0xf2b12a;});return db[_0xbb43('0x2a')][_0xbb43('0x47')](_0x5bec6d,{'transaction':_0x529bac});});})['then'](function(){return db[_0xbb43('0x2a')][_0xbb43('0x4e')]({'where':{'CustomReportId':_0x1eb364[_0xbb43('0x43')]['id']}});});}})[_0xbb43('0x25')](respondWithResult(_0x320e15,null))[_0xbb43('0x41')](handleError(_0x320e15,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 67b2f87..3de363d 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 _0xb738=['moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb738,0xa8));var _0x8b73=function(_0x7b6ffe,_0x2bc84a){_0x7b6ffe=_0x7b6ffe-0x0;var _0x3822d0=_0xb738[_0x7b6ffe];return _0x3822d0;};'use strict';var _=require(_0x8b73('0x0'));var util=require('util');var logger=require(_0x8b73('0x1'))('api');var moment=require(_0x8b73('0x2'));var BPromise=require(_0x8b73('0x3'));var rp=require(_0x8b73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b73('0x5'));var config=require(_0x8b73('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2ef00e,_0x32bbf9){return _0x2ef00e[_0x8b73('0x7')](_0x8b73('0x8'),attributes,{'tableName':_0x8b73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc062=['request-promise','exports','define','AnalyticFieldReport','bluebird'];(function(_0x52755a,_0x1196ce){var _0xe47ee6=function(_0x5a81a1){while(--_0x5a81a1){_0x52755a['push'](_0x52755a['shift']());}};_0xe47ee6(++_0x1196ce);}(_0xc062,0x162));var _0x2c06=function(_0x4406d1,_0x1a8ab9){_0x4406d1=_0x4406d1-0x0;var _0x476373=_0xc062[_0x4406d1];return _0x476373;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2c06('0x0'));var rp=require(_0x2c06('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2c06('0x2')]=function(_0xdaac71,_0x1ec7d5){return _0xdaac71[_0x2c06('0x3')](_0x2c06('0x4'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 2ff4691..b83f046 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 _0x2fd6=['rpc','../../config/environment','jayson/promise','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5047e9,_0x226f03){var _0x41796b=function(_0x3ff2ff){while(--_0x3ff2ff){_0x5047e9['push'](_0x5047e9['shift']());}};_0x41796b(++_0x226f03);}(_0x2fd6,0x1d4));var _0x62fd=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0x2fd6[_0x3e478c];return _0x29ef89;};'use strict';var _=require('lodash');var util=require(_0x62fd('0x0'));var moment=require('moment');var BPromise=require(_0x62fd('0x1'));var rs=require(_0x62fd('0x2'));var fs=require('fs');var Redis=require(_0x62fd('0x3'));var db=require(_0x62fd('0x4'))['db'];var utils=require(_0x62fd('0x5'));var logger=require(_0x62fd('0x6'))(_0x62fd('0x7'));var config=require(_0x62fd('0x8'));var jayson=require(_0x62fd('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc96b,_0x1ed970,_0xc32be4){return new BPromise(function(_0x4feb8b,_0x6411b){return client[_0x62fd('0xa')](_0x4dc96b,_0xc32be4)[_0x62fd('0xb')](function(_0x16be4f){logger['info'](_0x62fd('0xc'),_0x1ed970,_0x62fd('0xd'));logger['debug'](_0x62fd('0xe'),_0x1ed970,_0x62fd('0xd'),JSON['stringify'](_0x16be4f));if(_0x16be4f[_0x62fd('0xf')]){if(_0x16be4f['error']['code']===0x1f4){logger[_0x62fd('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1ed970,_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);return _0x6411b(_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);}logger[_0x62fd('0xf')](_0x62fd('0xc'),_0x1ed970,_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);return _0x4feb8b(_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);}else{logger[_0x62fd('0x11')](_0x62fd('0xc'),_0x1ed970,_0x62fd('0xd'));_0x4feb8b(_0x16be4f[_0x62fd('0x12')]['message']);}})['catch'](function(_0x49e593){logger['error'](_0x62fd('0xc'),_0x1ed970,_0x49e593);_0x6411b(_0x49e593);});});} \ No newline at end of file +var _0x5f27=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x729918,_0x123cc5){var _0x29cc31=function(_0xc05a35){while(--_0xc05a35){_0x729918['push'](_0x729918['shift']());}};_0x29cc31(++_0x123cc5);}(_0x5f27,0x12c));var _0x75f2=function(_0x1a8925,_0x4d676a){_0x1a8925=_0x1a8925-0x0;var _0xe9f6d9=_0x5f27[_0x1a8925];return _0xe9f6d9;};'use strict';var _=require(_0x75f2('0x0'));var util=require(_0x75f2('0x1'));var moment=require(_0x75f2('0x2'));var BPromise=require(_0x75f2('0x3'));var rs=require(_0x75f2('0x4'));var fs=require('fs');var Redis=require(_0x75f2('0x5'));var db=require(_0x75f2('0x6'))['db'];var utils=require(_0x75f2('0x7'));var logger=require(_0x75f2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75f2('0x9'));var client=jayson[_0x75f2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x285616,_0x41dd7b,_0x3efd1a){return new BPromise(function(_0x45cf67,_0x1a8f08){return client[_0x75f2('0xb')](_0x285616,_0x3efd1a)[_0x75f2('0xc')](function(_0x320cba){logger[_0x75f2('0xd')](_0x75f2('0xe'),_0x41dd7b,_0x75f2('0xf'));logger[_0x75f2('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x41dd7b,'request\x20sent',JSON[_0x75f2('0x11')](_0x320cba));if(_0x320cba['error']){if(_0x320cba[_0x75f2('0x12')][_0x75f2('0x13')]===0x1f4){logger[_0x75f2('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41dd7b,_0x320cba[_0x75f2('0x12')]['message']);return _0x1a8f08(_0x320cba['error'][_0x75f2('0x14')]);}logger[_0x75f2('0x12')](_0x75f2('0xe'),_0x41dd7b,_0x320cba[_0x75f2('0x12')][_0x75f2('0x14')]);return _0x45cf67(_0x320cba[_0x75f2('0x12')][_0x75f2('0x14')]);}else{logger['info'](_0x75f2('0xe'),_0x41dd7b,'request\x20sent');_0x45cf67(_0x320cba[_0x75f2('0x15')]['message']);}})[_0x75f2('0x16')](function(_0x296ad7){logger[_0x75f2('0x12')](_0x75f2('0xe'),_0x41dd7b,_0x296ad7);_0x1a8f08(_0x296ad7);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ff3c735..e0cd8b1 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(_0x4a65be,_0x25e73b){var _0x4bfdc8=function(_0x1a42be){while(--_0x1a42be){_0x4a65be['push'](_0x4a65be['shift']());}};_0x4bfdc8(++_0x25e73b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x18d5bc,_0x3020a5){var _0x37f9a6=function(_0x465dd8){while(--_0x465dd8){_0x18d5bc['push'](_0x18d5bc['shift']());}};_0x37f9a6(++_0x3020a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 00d2f7c..8da72b9 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 _0xa4db=['TEXT','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4db,0x139));var _0xba4d=function(_0x37d672,_0x58e9cd){_0x37d672=_0x37d672-0x0;var _0x4804e8=_0xa4db[_0x37d672];return _0x4804e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba4d('0x0')},'table':{'type':Sequelize[_0xba4d('0x1')]},'metric':{'type':Sequelize[_0xba4d('0x2')]},'description':{'type':Sequelize[_0xba4d('0x1')]}}; \ No newline at end of file +var _0xaa1b=['sequelize','exports','STRING'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'name':{'type':Sequelize[_0xbaa1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xbaa1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xbaa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 726112a..e899d0d 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x3401ab,_0x5e1301){var _0x438391=function(_0x3b886d){while(--_0x3b886d){_0x3401ab['push'](_0x3401ab['shift']());}};_0x438391(++_0x5e1301);}(_0x81bd,0x7c));var _0xd81b=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x81bd[_0x42f270];return _0x57bc5b;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file +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(_0x48ac6f,_0x3afacb){var _0x4d01b8=function(_0x4fc24a){while(--_0x4fc24a){_0x48ac6f['push'](_0x48ac6f['shift']());}};_0x4d01b8(++_0x3afacb);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xf2ca[_0x2431d6];return _0x4d0f9b;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0d82b1e..7045aae 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 _0xf006=['bluebird','path','./analyticMetric.attributes','exports','define','analytics_metrics','../../config/logger','api'];(function(_0x1c8c4b,_0x3763cb){var _0x24d7b4=function(_0x534597){while(--_0x534597){_0x1c8c4b['push'](_0x1c8c4b['shift']());}};_0x24d7b4(++_0x3763cb);}(_0xf006,0x146));var _0x6f00=function(_0x5f35e9,_0x22a510){_0x5f35e9=_0x5f35e9-0x0;var _0x593ea1=_0xf006[_0x5f35e9];return _0x593ea1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('AnalyticMetric',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6bb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x43e7f6,_0xf7329e){var _0xfebcb1=function(_0x1f3632){while(--_0x1f3632){_0x43e7f6['push'](_0x43e7f6['shift']());}};_0xfebcb1(++_0xf7329e);}(_0xa6bb,0x12c));var _0xba6b=function(_0x85072a,_0xc297e7){_0x85072a=_0x85072a-0x0;var _0x397bb7=_0xa6bb[_0x85072a];return _0x397bb7;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var logger=require(_0xba6b('0x1'))(_0xba6b('0x2'));var moment=require(_0xba6b('0x3'));var BPromise=require(_0xba6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba6b('0x5'));var config=require(_0xba6b('0x6'));var attributes=require(_0xba6b('0x7'));module[_0xba6b('0x8')]=function(_0x517d10,_0x4cc381){return _0x517d10[_0xba6b('0x9')](_0xba6b('0xa'),attributes,{'tableName':_0xba6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 20c930f..9a0fd88 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 _0x3748=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x3748,0x1e3));var _0x8374=function(_0x218f86,_0x2c6878){_0x218f86=_0x218f86-0x0;var _0x1c1f7c=_0x3748[_0x218f86];return _0x1c1f7c;};'use strict';var _=require(_0x8374('0x0'));var util=require(_0x8374('0x1'));var moment=require(_0x8374('0x2'));var BPromise=require(_0x8374('0x3'));var rs=require(_0x8374('0x4'));var fs=require('fs');var Redis=require(_0x8374('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8374('0x6'));var logger=require(_0x8374('0x7'))('rpc');var config=require(_0x8374('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8374('0x9')][_0x8374('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b8748,_0x4c6aab,_0x449112){return new BPromise(function(_0x32ffb0,_0x5daf65){return client[_0x8374('0xb')](_0x1b8748,_0x449112)[_0x8374('0xc')](function(_0x17b4a8){logger['info'](_0x8374('0xd'),_0x4c6aab,_0x8374('0xe'));logger[_0x8374('0xf')](_0x8374('0x10'),_0x4c6aab,'request\x20sent',JSON['stringify'](_0x17b4a8));if(_0x17b4a8['error']){if(_0x17b4a8[_0x8374('0x11')]['code']===0x1f4){logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x17b4a8[_0x8374('0x11')][_0x8374('0x12')]);return _0x5daf65(_0x17b4a8[_0x8374('0x11')]['message']);}logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x17b4a8[_0x8374('0x11')]['message']);return _0x32ffb0(_0x17b4a8[_0x8374('0x11')]['message']);}else{logger['info'](_0x8374('0xd'),_0x4c6aab,_0x8374('0xe'));_0x32ffb0(_0x17b4a8[_0x8374('0x13')]['message']);}})[_0x8374('0x14')](function(_0x4616c5){logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x4616c5);_0x5daf65(_0x4616c5);});});} \ No newline at end of file +var _0xeba2=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x159095,_0x203b3b){var _0x15f816=function(_0x55930e){while(--_0x55930e){_0x159095['push'](_0x159095['shift']());}};_0x15f816(++_0x203b3b);}(_0xeba2,0x18a));var _0x2eba=function(_0x2f7023,_0x1aa399){_0x2f7023=_0x2f7023-0x0;var _0x2f5e4e=_0xeba2[_0x2f7023];return _0x2f5e4e;};'use strict';var _=require(_0x2eba('0x0'));var util=require(_0x2eba('0x1'));var moment=require(_0x2eba('0x2'));var BPromise=require(_0x2eba('0x3'));var rs=require(_0x2eba('0x4'));var fs=require('fs');var Redis=require(_0x2eba('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require(_0x2eba('0x8'));var client=jayson['client'][_0x2eba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555cd6,_0x5a9048,_0x359825){return new BPromise(function(_0x3b6313,_0x576dd7){return client[_0x2eba('0xa')](_0x555cd6,_0x359825)[_0x2eba('0xb')](function(_0x565efb){logger['info'](_0x2eba('0xc'),_0x5a9048,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x5a9048,_0x2eba('0xd'),JSON[_0x2eba('0x10')](_0x565efb));if(_0x565efb[_0x2eba('0x11')]){if(_0x565efb[_0x2eba('0x11')][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x5a9048,_0x565efb[_0x2eba('0x11')]['message']);return _0x576dd7(_0x565efb[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error'](_0x2eba('0xc'),_0x5a9048,_0x565efb[_0x2eba('0x11')]['message']);return _0x3b6313(_0x565efb['error'][_0x2eba('0x13')]);}else{logger[_0x2eba('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x5a9048,'request\x20sent');_0x3b6313(_0x565efb[_0x2eba('0x15')]['message']);}})[_0x2eba('0x16')](function(_0x413238){logger['error'](_0x2eba('0xc'),_0x5a9048,_0x413238);_0x576dd7(_0x413238);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 70b3c0c..26208ef 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 _0xd8a7=['express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x24c5dc,_0x19cf4f){var _0x248618=function(_0x31edc9){while(--_0x31edc9){_0x24c5dc['push'](_0x24c5dc['shift']());}};_0x248618(++_0x19cf4f);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x291554,_0x13ae4d){_0x291554=_0x291554-0x0;var _0x1a6980=_0xd8a7[_0x291554];return _0x1a6980;};'use strict';var multer=require(_0x7d8a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d8a('0x1'));var router=express[_0x7d8a('0x2')]();var fs_extra=require(_0x7d8a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d8a('0x4'));var config=require('../../config/environment');var controller=require(_0x7d8a('0x5'));router['get']('/',auth[_0x7d8a('0x6')](),controller['index']);router[_0x7d8a('0x7')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller['show']);router[_0x7d8a('0x9')]('/',auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xa')]);router[_0x7d8a('0xb')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xc')]);router[_0x7d8a('0xd')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xe')]);module[_0x7d8a('0xf')]=router; \ No newline at end of file +var _0x2f2e=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','create','update','delete','destroy','util','path','express','fs-extra'];(function(_0x20d3b5,_0x27a07e){var _0x4a8a53=function(_0x38d9d9){while(--_0x38d9d9){_0x20d3b5['push'](_0x20d3b5['shift']());}};_0x4a8a53(++_0x27a07e);}(_0x2f2e,0x146));var _0xe2f2=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x2f2e[_0x50aea5];return _0x4657f1;};'use strict';var multer=require('multer');var util=require(_0xe2f2('0x0'));var path=require(_0xe2f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2f2('0x2'));var router=express['Router']();var fs_extra=require(_0xe2f2('0x3'));var auth=require(_0xe2f2('0x4'));var interaction=require(_0xe2f2('0x5'));var config=require(_0xe2f2('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe2f2('0x7')]);router[_0xe2f2('0x8')](_0xe2f2('0x9'),auth[_0xe2f2('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe2f2('0xb')]);router['put'](_0xe2f2('0x9'),auth[_0xe2f2('0xa')](),controller[_0xe2f2('0xc')]);router[_0xe2f2('0xd')]('/:id',auth[_0xe2f2('0xa')](),controller[_0xe2f2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 734e61d..a8a406d 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 _0x90fe=['TEXT','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x90fe,0x173));var _0xe90f=function(_0x50753e,_0x155b95){_0x50753e=_0x50753e-0x0;var _0x510b61=_0x90fe[_0x50753e];return _0x510b61;};'use strict';var Sequelize=require(_0xe90f('0x0'));module['exports']={'tree':{'type':Sequelize[_0xe90f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2b06=['exports','TEXT','sequelize'];(function(_0x5f1213,_0x47c092){var _0x1c2ff2=function(_0x3baccb){while(--_0x3baccb){_0x5f1213['push'](_0x5f1213['shift']());}};_0x1c2ff2(++_0x47c092);}(_0x2b06,0xf8));var _0x62b0=function(_0xf4129c,_0x44fcf1){_0xf4129c=_0xf4129c-0x0;var _0x426611=_0x2b06[_0xf4129c];return _0x426611;};'use strict';var Sequelize=require(_0x62b0('0x0'));module[_0x62b0('0x1')]={'tree':{'type':Sequelize[_0x62b0('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 00d9eae..b43b813 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 _0x1744=['../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xcec5ef,_0x1cca96){var _0x2ce2a7=function(_0x5b765b){while(--_0x5b765b){_0xcec5ef['push'](_0xcec5ef['shift']());}};_0x2ce2a7(++_0x1cca96);}(_0x1744,0xd3));var _0x4174=function(_0x4ac2f2,_0x43a291){_0x4ac2f2=_0x4ac2f2-0x0;var _0x4bf328=_0x1744[_0x4ac2f2];return _0x4bf328;};'use strict';var emlformat=require(_0x4174('0x0'));var rimraf=require(_0x4174('0x1'));var zipdir=require(_0x4174('0x2'));var jsonpatch=require(_0x4174('0x3'));var rp=require('request-promise');var moment=require(_0x4174('0x4'));var BPromise=require(_0x4174('0x5'));var Mustache=require(_0x4174('0x6'));var util=require(_0x4174('0x7'));var path=require(_0x4174('0x8'));var sox=require(_0x4174('0x9'));var csv=require(_0x4174('0xa'));var ejs=require(_0x4174('0xb'));var fs=require('fs');var fs_extra=require(_0x4174('0xc'));var _=require('lodash');var squel=require(_0x4174('0xd'));var crypto=require(_0x4174('0xe'));var jsforce=require(_0x4174('0xf'));var deskjs=require(_0x4174('0x10'));var toCsv=require(_0x4174('0xa'));var querystring=require('querystring');var Papa=require(_0x4174('0x11'));var Redis=require(_0x4174('0x12'));var authService=require(_0x4174('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4174('0x14'));var logger=require(_0x4174('0x15'))(_0x4174('0x16'));var utils=require(_0x4174('0x17'));var config=require(_0x4174('0x18'));var licenseUtil=require(_0x4174('0x19'));var db=require(_0x4174('0x1a'))['db'];function respondWithStatusCode(_0xcec7d4,_0x503488){_0x503488=_0x503488||0xcc;return function(_0x4da4d2){if(_0x4da4d2){return _0xcec7d4[_0x4174('0x1b')](_0x503488);}return _0xcec7d4[_0x4174('0x1c')](_0x503488)[_0x4174('0x1d')]();};}function respondWithResult(_0x4ffaf5,_0x5f1f6c){_0x5f1f6c=_0x5f1f6c||0xc8;return function(_0x52b951){if(_0x52b951){return _0x4ffaf5[_0x4174('0x1c')](_0x5f1f6c)[_0x4174('0x1e')](_0x52b951);}};}function respondWithFilteredResult(_0x1253ed,_0x464a52){return function(_0x55e503){if(_0x55e503){var _0x30ad32=typeof _0x464a52['offset']===_0x4174('0x1f')&&typeof _0x464a52[_0x4174('0x20')]===_0x4174('0x1f');var _0x5e68c8=_0x55e503['count'];var _0x19a33a=_0x30ad32?0x0:_0x464a52[_0x4174('0x21')];var _0xdff745=_0x30ad32?_0x55e503[_0x4174('0x22')]:_0x464a52[_0x4174('0x21')]+_0x464a52['limit'];var _0x383222;if(_0xdff745>=_0x5e68c8){_0xdff745=_0x5e68c8;_0x383222=0xc8;}else{_0x383222=0xce;}_0x1253ed['status'](_0x383222);return _0x1253ed[_0x4174('0x23')](_0x4174('0x24'),_0x19a33a+'-'+_0xdff745+'/'+_0x5e68c8)['json'](_0x55e503);}return null;};}function patchUpdates(_0x1be702){return function(_0x30c517){try{jsonpatch[_0x4174('0x25')](_0x30c517,_0x1be702,!![]);}catch(_0x40e717){return BPromise[_0x4174('0x26')](_0x40e717);}return _0x30c517[_0x4174('0x27')]();};}function saveUpdates(_0x19759a,_0x1c3f94){return function(_0x4c7d28){if(_0x4c7d28){return _0x4c7d28[_0x4174('0x28')](_0x19759a)[_0x4174('0x29')](function(_0x56d68f){return _0x56d68f;});}return null;};}function removeEntity(_0x34ef03,_0x34318b){return function(_0x2fad77){if(_0x2fad77){return _0x2fad77['destroy']()[_0x4174('0x29')](function(){_0x34ef03[_0x4174('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7a23,_0x5f507f){return function(_0x4132d8){if(!_0x4132d8){_0x5b7a23[_0x4174('0x1b')](0x194);}return _0x4132d8;};}function handleError(_0x264ef1,_0x584e4b){_0x584e4b=_0x584e4b||0x1f4;return function(_0xa19b7c){logger[_0x4174('0x2a')](_0xa19b7c[_0x4174('0x2b')]);if(_0xa19b7c[_0x4174('0x2c')]){delete _0xa19b7c[_0x4174('0x2c')];}_0x264ef1[_0x4174('0x1c')](_0x584e4b)[_0x4174('0x2d')](_0xa19b7c);};}exports[_0x4174('0x2e')]=function(_0x18c7a4,_0x360f13){var _0x526964={},_0x5e4241={},_0x3d511e={'count':0x0,'rows':[]};var _0x4b84ef=_[_0x4174('0x2f')](db[_0x4174('0x30')][_0x4174('0x31')],function(_0x5aefca){return{'name':_0x5aefca['fieldName'],'type':_0x5aefca[_0x4174('0x32')][_0x4174('0x33')]};});_0x5e4241[_0x4174('0x34')]=_['map'](_0x4b84ef,_0x4174('0x2c'));_0x5e4241[_0x4174('0x35')]=_['keys'](_0x18c7a4[_0x4174('0x35')]);_0x5e4241[_0x4174('0x36')]=_[_0x4174('0x37')](_0x5e4241[_0x4174('0x34')],_0x5e4241[_0x4174('0x35')]);_0x526964[_0x4174('0x38')]=_[_0x4174('0x37')](_0x5e4241[_0x4174('0x34')],qs[_0x4174('0x39')](_0x18c7a4['query']['fields']));_0x526964['attributes']=_0x526964[_0x4174('0x38')]['length']?_0x526964['attributes']:_0x5e4241[_0x4174('0x34')];if(!_0x18c7a4[_0x4174('0x35')]['hasOwnProperty'](_0x4174('0x3a'))){_0x526964['limit']=qs['limit'](_0x18c7a4['query'][_0x4174('0x20')]);_0x526964[_0x4174('0x21')]=qs['offset'](_0x18c7a4['query']['offset']);}_0x526964[_0x4174('0x3b')]=qs[_0x4174('0x3c')](_0x18c7a4[_0x4174('0x35')]['sort']);_0x526964[_0x4174('0x3d')]=qs[_0x4174('0x36')](_[_0x4174('0x3e')](_0x18c7a4[_0x4174('0x35')],_0x5e4241[_0x4174('0x36')]),_0x4b84ef);if(_0x18c7a4[_0x4174('0x35')][_0x4174('0x3f')]){_0x526964[_0x4174('0x3d')]=_[_0x4174('0x40')](_0x526964['where'],{'$or':_[_0x4174('0x2f')](_0x4b84ef,function(_0x4459dc){if(_0x4459dc[_0x4174('0x32')]!==_0x4174('0x41')){var _0x5ed32f={};_0x5ed32f[_0x4459dc[_0x4174('0x2c')]]={'$like':'%'+_0x18c7a4[_0x4174('0x35')][_0x4174('0x3f')]+'%'};return _0x5ed32f;}})});}_0x526964=_[_0x4174('0x40')]({},_0x526964,_0x18c7a4[_0x4174('0x42')]);var _0x3a39e2={'where':_0x526964[_0x4174('0x3d')]};return db['AnalyticTreeReport']['count'](_0x3a39e2)[_0x4174('0x29')](function(_0x5d82ec){_0x3d511e[_0x4174('0x22')]=_0x5d82ec;if(_0x18c7a4[_0x4174('0x35')][_0x4174('0x43')]){_0x526964[_0x4174('0x44')]=[{'all':!![]}];}return db[_0x4174('0x30')][_0x4174('0x45')](_0x526964);})[_0x4174('0x29')](function(_0x130978){_0x3d511e[_0x4174('0x46')]=_0x130978;return _0x3d511e;})['then'](respondWithFilteredResult(_0x360f13,_0x526964))[_0x4174('0x47')](handleError(_0x360f13,null));};exports[_0x4174('0x48')]=function(_0xc3213f,_0xd4d02d){var _0x1adeb9={'raw':!![],'where':{'id':_0xc3213f['params']['id']}},_0x309d9c={};_0x309d9c[_0x4174('0x34')]=_[_0x4174('0x49')](db[_0x4174('0x30')][_0x4174('0x31')]);_0x309d9c[_0x4174('0x35')]=_[_0x4174('0x49')](_0xc3213f[_0x4174('0x35')]);_0x309d9c[_0x4174('0x36')]=_[_0x4174('0x37')](_0x309d9c[_0x4174('0x34')],_0x309d9c[_0x4174('0x35')]);_0x1adeb9['attributes']=_[_0x4174('0x37')](_0x309d9c[_0x4174('0x34')],qs[_0x4174('0x39')](_0xc3213f['query'][_0x4174('0x39')]));_0x1adeb9[_0x4174('0x38')]=_0x1adeb9[_0x4174('0x38')][_0x4174('0x4a')]?_0x1adeb9['attributes']:_0x309d9c[_0x4174('0x34')];if(_0xc3213f[_0x4174('0x35')][_0x4174('0x43')]){_0x1adeb9[_0x4174('0x44')]=[{'all':!![]}];}_0x1adeb9=_[_0x4174('0x40')]({},_0x1adeb9,_0xc3213f[_0x4174('0x42')]);return db['AnalyticTreeReport'][_0x4174('0x4b')](_0x1adeb9)[_0x4174('0x29')](handleEntityNotFound(_0xd4d02d,null))[_0x4174('0x29')](respondWithResult(_0xd4d02d,null))['catch'](handleError(_0xd4d02d,null));};exports[_0x4174('0x4c')]=function(_0x584953,_0x1f2548){return db[_0x4174('0x30')][_0x4174('0x4c')](_0x584953[_0x4174('0x4d')],{})[_0x4174('0x29')](respondWithResult(_0x1f2548,0xc9))[_0x4174('0x47')](handleError(_0x1f2548,null));};exports[_0x4174('0x28')]=function(_0x165e5d,_0x4eee28){if(_0x165e5d[_0x4174('0x4d')]['id']){delete _0x165e5d['body']['id'];}return db[_0x4174('0x30')][_0x4174('0x4b')]({'where':{'id':_0x165e5d[_0x4174('0x4e')]['id']}})[_0x4174('0x29')](handleEntityNotFound(_0x4eee28,null))['then'](saveUpdates(_0x165e5d[_0x4174('0x4d')],null))['then'](respondWithResult(_0x4eee28,null))[_0x4174('0x47')](handleError(_0x4eee28,null));};exports['destroy']=function(_0x7ffb02,_0x3d684c){return db[_0x4174('0x30')][_0x4174('0x4b')]({'where':{'id':_0x7ffb02['params']['id']}})['then'](handleEntityNotFound(_0x3d684c,null))['then'](removeEntity(_0x3d684c,null))[_0x4174('0x47')](handleError(_0x3d684c,null));}; \ No newline at end of file +var _0x9501=['moment','bluebird','mustache','util','path','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','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','intersection','attributes','fields','sort','where','pick','filters','merge','options','includeAll','findAll','catch','show','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x9501,0x1b1));var _0x1950=function(_0xeaff44,_0x4901cf){_0xeaff44=_0xeaff44-0x0;var _0x3512a5=_0x9501[_0xeaff44];return _0x3512a5;};'use strict';var emlformat=require(_0x1950('0x0'));var rimraf=require(_0x1950('0x1'));var zipdir=require(_0x1950('0x2'));var jsonpatch=require(_0x1950('0x3'));var rp=require(_0x1950('0x4'));var moment=require(_0x1950('0x5'));var BPromise=require(_0x1950('0x6'));var Mustache=require(_0x1950('0x7'));var util=require(_0x1950('0x8'));var path=require(_0x1950('0x9'));var sox=require('sox');var csv=require(_0x1950('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1950('0xb'));var _=require('lodash');var squel=require(_0x1950('0xc'));var crypto=require(_0x1950('0xd'));var jsforce=require(_0x1950('0xe'));var deskjs=require(_0x1950('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1950('0x10'));var Papa=require(_0x1950('0x11'));var Redis=require(_0x1950('0x12'));var authService=require(_0x1950('0x13'));var qs=require(_0x1950('0x14'));var as=require(_0x1950('0x15'));var hardwareService=require(_0x1950('0x16'));var logger=require(_0x1950('0x17'))(_0x1950('0x18'));var utils=require(_0x1950('0x19'));var config=require(_0x1950('0x1a'));var licenseUtil=require(_0x1950('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37ca9e,_0x44b5db){_0x44b5db=_0x44b5db||0xcc;return function(_0x5a4632){if(_0x5a4632){return _0x37ca9e[_0x1950('0x1c')](_0x44b5db);}return _0x37ca9e[_0x1950('0x1d')](_0x44b5db)[_0x1950('0x1e')]();};}function respondWithResult(_0x5f3391,_0x1c467d){_0x1c467d=_0x1c467d||0xc8;return function(_0x17b64f){if(_0x17b64f){return _0x5f3391['status'](_0x1c467d)[_0x1950('0x1f')](_0x17b64f);}};}function respondWithFilteredResult(_0x396a57,_0x38d653){return function(_0x40f63d){if(_0x40f63d){var _0x54e61b=typeof _0x38d653[_0x1950('0x20')]==='undefined'&&typeof _0x38d653[_0x1950('0x21')]===_0x1950('0x22');var _0x26c71=_0x40f63d[_0x1950('0x23')];var _0xd1171=_0x54e61b?0x0:_0x38d653[_0x1950('0x20')];var _0x269975=_0x54e61b?_0x40f63d[_0x1950('0x23')]:_0x38d653[_0x1950('0x20')]+_0x38d653['limit'];var _0x2091c3;if(_0x269975>=_0x26c71){_0x269975=_0x26c71;_0x2091c3=0xc8;}else{_0x2091c3=0xce;}_0x396a57['status'](_0x2091c3);return _0x396a57[_0x1950('0x24')](_0x1950('0x25'),_0xd1171+'-'+_0x269975+'/'+_0x26c71)[_0x1950('0x1f')](_0x40f63d);}return null;};}function patchUpdates(_0x3fef68){return function(_0xe58227){try{jsonpatch[_0x1950('0x26')](_0xe58227,_0x3fef68,!![]);}catch(_0x17031f){return BPromise['reject'](_0x17031f);}return _0xe58227['save']();};}function saveUpdates(_0x2c0af1,_0x274e84){return function(_0x3de5f){if(_0x3de5f){return _0x3de5f[_0x1950('0x27')](_0x2c0af1)[_0x1950('0x28')](function(_0x31e75b){return _0x31e75b;});}return null;};}function removeEntity(_0x32fa23,_0x34efc7){return function(_0x5d8dd7){if(_0x5d8dd7){return _0x5d8dd7[_0x1950('0x29')]()[_0x1950('0x28')](function(){_0x32fa23[_0x1950('0x1d')](0xcc)[_0x1950('0x1e')]();});}};}function handleEntityNotFound(_0xa75682,_0x574c7c){return function(_0x1ece54){if(!_0x1ece54){_0xa75682[_0x1950('0x1c')](0x194);}return _0x1ece54;};}function handleError(_0x30d5f5,_0x445cfd){_0x445cfd=_0x445cfd||0x1f4;return function(_0x359377){logger[_0x1950('0x2a')](_0x359377[_0x1950('0x2b')]);if(_0x359377[_0x1950('0x2c')]){delete _0x359377[_0x1950('0x2c')];}_0x30d5f5[_0x1950('0x1d')](_0x445cfd)[_0x1950('0x2d')](_0x359377);};}exports[_0x1950('0x2e')]=function(_0x44501b,_0x1afb57){var _0x4c19bb={},_0x412f90={},_0x29a593={'count':0x0,'rows':[]};var _0xde2a60=_[_0x1950('0x2f')](db[_0x1950('0x30')][_0x1950('0x31')],function(_0x178de4){return{'name':_0x178de4['fieldName'],'type':_0x178de4[_0x1950('0x32')][_0x1950('0x33')]};});_0x412f90[_0x1950('0x34')]=_[_0x1950('0x2f')](_0xde2a60,_0x1950('0x2c'));_0x412f90[_0x1950('0x35')]=_['keys'](_0x44501b[_0x1950('0x35')]);_0x412f90['filters']=_[_0x1950('0x36')](_0x412f90['model'],_0x412f90['query']);_0x4c19bb[_0x1950('0x37')]=_[_0x1950('0x36')](_0x412f90[_0x1950('0x34')],qs[_0x1950('0x38')](_0x44501b[_0x1950('0x35')][_0x1950('0x38')]));_0x4c19bb[_0x1950('0x37')]=_0x4c19bb[_0x1950('0x37')]['length']?_0x4c19bb['attributes']:_0x412f90['model'];if(!_0x44501b[_0x1950('0x35')]['hasOwnProperty']('nolimit')){_0x4c19bb[_0x1950('0x21')]=qs[_0x1950('0x21')](_0x44501b['query']['limit']);_0x4c19bb[_0x1950('0x20')]=qs[_0x1950('0x20')](_0x44501b[_0x1950('0x35')]['offset']);}_0x4c19bb['order']=qs[_0x1950('0x39')](_0x44501b['query']['sort']);_0x4c19bb[_0x1950('0x3a')]=qs['filters'](_[_0x1950('0x3b')](_0x44501b[_0x1950('0x35')],_0x412f90[_0x1950('0x3c')]),_0xde2a60);if(_0x44501b['query']['filter']){_0x4c19bb[_0x1950('0x3a')]=_[_0x1950('0x3d')](_0x4c19bb[_0x1950('0x3a')],{'$or':_[_0x1950('0x2f')](_0xde2a60,function(_0x5b7083){if(_0x5b7083['type']!=='VIRTUAL'){var _0x1ae67f={};_0x1ae67f[_0x5b7083[_0x1950('0x2c')]]={'$like':'%'+_0x44501b[_0x1950('0x35')]['filter']+'%'};return _0x1ae67f;}})});}_0x4c19bb=_[_0x1950('0x3d')]({},_0x4c19bb,_0x44501b[_0x1950('0x3e')]);var _0x1a4d53={'where':_0x4c19bb['where']};return db[_0x1950('0x30')][_0x1950('0x23')](_0x1a4d53)[_0x1950('0x28')](function(_0x4efe72){_0x29a593[_0x1950('0x23')]=_0x4efe72;if(_0x44501b[_0x1950('0x35')][_0x1950('0x3f')]){_0x4c19bb['include']=[{'all':!![]}];}return db[_0x1950('0x30')][_0x1950('0x40')](_0x4c19bb);})[_0x1950('0x28')](function(_0x3f2be9){_0x29a593['rows']=_0x3f2be9;return _0x29a593;})[_0x1950('0x28')](respondWithFilteredResult(_0x1afb57,_0x4c19bb))[_0x1950('0x41')](handleError(_0x1afb57,null));};exports[_0x1950('0x42')]=function(_0x2d1903,_0x147c57){var _0x526f83={'raw':!![],'where':{'id':_0x2d1903[_0x1950('0x43')]['id']}},_0xbd187={};_0xbd187[_0x1950('0x34')]=_['keys'](db[_0x1950('0x30')][_0x1950('0x31')]);_0xbd187['query']=_[_0x1950('0x44')](_0x2d1903[_0x1950('0x35')]);_0xbd187['filters']=_[_0x1950('0x36')](_0xbd187['model'],_0xbd187[_0x1950('0x35')]);_0x526f83[_0x1950('0x37')]=_[_0x1950('0x36')](_0xbd187['model'],qs[_0x1950('0x38')](_0x2d1903['query'][_0x1950('0x38')]));_0x526f83[_0x1950('0x37')]=_0x526f83[_0x1950('0x37')]['length']?_0x526f83['attributes']:_0xbd187[_0x1950('0x34')];if(_0x2d1903[_0x1950('0x35')][_0x1950('0x3f')]){_0x526f83[_0x1950('0x45')]=[{'all':!![]}];}_0x526f83=_['merge']({},_0x526f83,_0x2d1903[_0x1950('0x3e')]);return db['AnalyticTreeReport']['find'](_0x526f83)[_0x1950('0x28')](handleEntityNotFound(_0x147c57,null))[_0x1950('0x28')](respondWithResult(_0x147c57,null))[_0x1950('0x41')](handleError(_0x147c57,null));};exports[_0x1950('0x46')]=function(_0x1528fb,_0x2de458){return db['AnalyticTreeReport']['create'](_0x1528fb[_0x1950('0x47')],{})[_0x1950('0x28')](respondWithResult(_0x2de458,0xc9))['catch'](handleError(_0x2de458,null));};exports[_0x1950('0x27')]=function(_0x7cb1a5,_0x5816ee){if(_0x7cb1a5[_0x1950('0x47')]['id']){delete _0x7cb1a5[_0x1950('0x47')]['id'];}return db[_0x1950('0x30')]['find']({'where':{'id':_0x7cb1a5[_0x1950('0x43')]['id']}})[_0x1950('0x28')](handleEntityNotFound(_0x5816ee,null))['then'](saveUpdates(_0x7cb1a5[_0x1950('0x47')],null))['then'](respondWithResult(_0x5816ee,null))[_0x1950('0x41')](handleError(_0x5816ee,null));};exports['destroy']=function(_0x303b4e,_0x3ef8ac){return db[_0x1950('0x30')][_0x1950('0x48')]({'where':{'id':_0x303b4e['params']['id']}})[_0x1950('0x28')](handleEntityNotFound(_0x3ef8ac,null))[_0x1950('0x28')](removeEntity(_0x3ef8ac,null))['catch'](handleError(_0x3ef8ac,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 34d36a9..af78e62 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 _0xaf68=['../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','request-promise','path'];(function(_0x60bdc0,_0x350d76){var _0x39ece1=function(_0x3ada47){while(--_0x3ada47){_0x60bdc0['push'](_0x60bdc0['shift']());}};_0x39ece1(++_0x350d76);}(_0xaf68,0x1cf));var _0x8af6=function(_0x43fdd3,_0x275f0c){_0x43fdd3=_0x43fdd3-0x0;var _0x4e7c03=_0xaf68[_0x43fdd3];return _0x4e7c03;};'use strict';var _=require(_0x8af6('0x0'));var util=require('util');var logger=require(_0x8af6('0x1'))(_0x8af6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8af6('0x3'));var fs=require('fs');var path=require(_0x8af6('0x4'));var rimraf=require('rimraf');var config=require(_0x8af6('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x8af6('0x6')]=function(_0x520698,_0x2569bc){return _0x520698['define'](_0x8af6('0x7'),attributes,{'tableName':_0x8af6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7941=['path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7941,0x1ce));var _0x1794=function(_0x17f5df,_0x27b10c){_0x17f5df=_0x17f5df-0x0;var _0x273bc7=_0x7941[_0x17f5df];return _0x273bc7;};'use strict';var _=require(_0x1794('0x0'));var util=require(_0x1794('0x1'));var logger=require(_0x1794('0x2'))(_0x1794('0x3'));var moment=require('moment');var BPromise=require(_0x1794('0x4'));var rp=require(_0x1794('0x5'));var fs=require('fs');var path=require(_0x1794('0x6'));var rimraf=require(_0x1794('0x7'));var config=require('../../config/environment');var attributes=require(_0x1794('0x8'));module[_0x1794('0x9')]=function(_0x369b27,_0x40a834){return _0x369b27[_0x1794('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x1794('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 38b2a20..5914c54 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x89cf24,_0x217ee8){var _0x42a9fd=function(_0x426489){while(--_0x426489){_0x89cf24['push'](_0x89cf24['shift']());}};_0x42a9fd(++_0x217ee8);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d8e1a,_0x52c766){_0x4d8e1a=_0x4d8e1a-0x0;var _0x183f73=_0x2ef3[_0x4d8e1a];return _0x183f73;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3a94c9,_0x375448){var _0x1622e7=function(_0x3d2ad2){while(--_0x3d2ad2){_0x3a94c9['push'](_0x3a94c9['shift']());}};_0x1622e7(++_0x375448);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3afb31,_0x324f2a){_0x3afb31=_0x3afb31-0x0;var _0x4a0a8b=_0x5f2f[_0x3afb31];return _0x4a0a8b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d93b5a8..d578ea4 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 _0xe225=['show','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2fb348,_0x1c536d){var _0x58b929=function(_0x58fc89){while(--_0x58fc89){_0x2fb348['push'](_0x2fb348['shift']());}};_0x58b929(++_0x1c536d);}(_0xe225,0x181));var _0x5e22=function(_0x295771,_0x11e035){_0x295771=_0x295771-0x0;var _0x5130ee=_0xe225[_0x295771];return _0x5130ee;};'use strict';var multer=require(_0x5e22('0x0'));var util=require(_0x5e22('0x1'));var path=require(_0x5e22('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e22('0x3')]();var fs_extra=require(_0x5e22('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e22('0x5'));var config=require('../../config/environment');var controller=require(_0x5e22('0x6'));router[_0x5e22('0x7')]('/',auth[_0x5e22('0x8')](),controller[_0x5e22('0x9')]);router['get'](_0x5e22('0xa'),auth[_0x5e22('0x8')](),controller[_0x5e22('0xb')]);router[_0x5e22('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e22('0xd')]);router[_0x5e22('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5e22('0xf')]);router[_0x5e22('0x10')](_0x5e22('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e22('0x11')]=router; \ No newline at end of file +var _0x8874=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','/:id','show','post','create','put','delete','destroy','util','path'];(function(_0x133fa0,_0x753f0c){var _0x169817=function(_0x3e5edc){while(--_0x3e5edc){_0x133fa0['push'](_0x133fa0['shift']());}};_0x169817(++_0x753f0c);}(_0x8874,0xee));var _0x4887=function(_0xde00f5,_0x2635aa){_0xde00f5=_0xde00f5-0x0;var _0x93f684=_0x8874[_0xde00f5];return _0x93f684;};'use strict';var multer=require('multer');var util=require(_0x4887('0x0'));var path=require(_0x4887('0x1'));var timeout=require('connect-timeout');var express=require(_0x4887('0x2'));var router=express[_0x4887('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4887('0x4'));var interaction=require(_0x4887('0x5'));var config=require('../../config/environment');var controller=require(_0x4887('0x6'));router['get']('/',auth[_0x4887('0x7')](),controller['index']);router['get'](_0x4887('0x8'),auth[_0x4887('0x7')](),controller[_0x4887('0x9')]);router[_0x4887('0xa')]('/',auth[_0x4887('0x7')](),controller[_0x4887('0xb')]);router[_0x4887('0xc')](_0x4887('0x8'),auth[_0x4887('0x7')](),controller['update']);router[_0x4887('0xd')](_0x4887('0x8'),auth[_0x4887('0x7')](),controller[_0x4887('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 8566fc2..bf0bd60 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 _0xffe1=['STRING','sequelize','exports'];(function(_0x5dff0c,_0x2bdeb4){var _0x15615f=function(_0x22956e){while(--_0x22956e){_0x5dff0c['push'](_0x5dff0c['shift']());}};_0x15615f(++_0x2bdeb4);}(_0xffe1,0x175));var _0x1ffe=function(_0x3ac442,_0x252283){_0x3ac442=_0x3ac442-0x0;var _0x199070=_0xffe1[_0x3ac442];return _0x199070;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1ffe('0x2')]}}; \ No newline at end of file +var _0xb4e6=['sequelize','exports','STRING'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0xb4e6[_0x456032];return _0x1a53cd;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'name':{'type':Sequelize[_0x6b4e('0x2')]},'basename':{'type':Sequelize[_0x6b4e('0x2')]},'type':{'type':Sequelize[_0x6b4e('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f59e96b..20dd86c 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 _0x775b=['create','update','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','merge','options','Attachment','includeAll','include','findAll','catch','params','find','clone','get','omit','createdAt','body','updatedAt'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x775b,0xb4));var _0xb775=function(_0x53f1c1,_0x6f6512){_0x53f1c1=_0x53f1c1-0x0;var _0x464d14=_0x775b[_0x53f1c1];return _0x464d14;};'use strict';var emlformat=require(_0xb775('0x0'));var rimraf=require(_0xb775('0x1'));var zipdir=require(_0xb775('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb775('0x3'));var moment=require(_0xb775('0x4'));var BPromise=require(_0xb775('0x5'));var Mustache=require(_0xb775('0x6'));var util=require('util');var path=require(_0xb775('0x7'));var sox=require(_0xb775('0x8'));var csv=require(_0xb775('0x9'));var ejs=require(_0xb775('0xa'));var fs=require('fs');var fs_extra=require(_0xb775('0xb'));var _=require('lodash');var squel=require(_0xb775('0xc'));var crypto=require(_0xb775('0xd'));var jsforce=require(_0xb775('0xe'));var deskjs=require(_0xb775('0xf'));var toCsv=require(_0xb775('0x9'));var querystring=require('querystring');var Papa=require(_0xb775('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb775('0x11'));var logger=require(_0xb775('0x12'))(_0xb775('0x13'));var utils=require(_0xb775('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb775('0x15'))['db'];function respondWithStatusCode(_0xe890d,_0x1a690c){_0x1a690c=_0x1a690c||0xcc;return function(_0x931114){if(_0x931114){return _0xe890d[_0xb775('0x16')](_0x1a690c);}return _0xe890d[_0xb775('0x17')](_0x1a690c)['end']();};}function respondWithResult(_0x4b0a22,_0x2c3df5){_0x2c3df5=_0x2c3df5||0xc8;return function(_0x465832){if(_0x465832){return _0x4b0a22[_0xb775('0x17')](_0x2c3df5)['json'](_0x465832);}};}function respondWithFilteredResult(_0x493239,_0x2bf6db){return function(_0x15382f){if(_0x15382f){var _0x523715=typeof _0x2bf6db[_0xb775('0x18')]===_0xb775('0x19')&&typeof _0x2bf6db[_0xb775('0x1a')]===_0xb775('0x19');var _0x4ccbd1=_0x15382f['count'];var _0xba454a=_0x523715?0x0:_0x2bf6db['offset'];var _0x121ad7=_0x523715?_0x15382f[_0xb775('0x1b')]:_0x2bf6db[_0xb775('0x18')]+_0x2bf6db[_0xb775('0x1a')];var _0x388c0d;if(_0x121ad7>=_0x4ccbd1){_0x121ad7=_0x4ccbd1;_0x388c0d=0xc8;}else{_0x388c0d=0xce;}_0x493239[_0xb775('0x17')](_0x388c0d);return _0x493239[_0xb775('0x1c')](_0xb775('0x1d'),_0xba454a+'-'+_0x121ad7+'/'+_0x4ccbd1)[_0xb775('0x1e')](_0x15382f);}return null;};}function patchUpdates(_0x448197){return function(_0x218e22){try{jsonpatch[_0xb775('0x1f')](_0x218e22,_0x448197,!![]);}catch(_0x1a3de2){return BPromise[_0xb775('0x20')](_0x1a3de2);}return _0x218e22[_0xb775('0x21')]();};}function saveUpdates(_0x13f2c2,_0x323af3){return function(_0x1df0bc){if(_0x1df0bc){return _0x1df0bc['update'](_0x13f2c2)[_0xb775('0x22')](function(_0x723d82){return _0x723d82;});}return null;};}function removeEntity(_0x11fcc0,_0x5ddd6e){return function(_0x583c74){if(_0x583c74){return _0x583c74[_0xb775('0x23')]()[_0xb775('0x22')](function(){_0x11fcc0['status'](0xcc)[_0xb775('0x24')]();});}};}function handleEntityNotFound(_0x311265,_0xdffb39){return function(_0x5a0388){if(!_0x5a0388){_0x311265[_0xb775('0x16')](0x194);}return _0x5a0388;};}function handleError(_0x37c4be,_0x46c350){_0x46c350=_0x46c350||0x1f4;return function(_0x34ec90){logger[_0xb775('0x25')](_0x34ec90[_0xb775('0x26')]);if(_0x34ec90[_0xb775('0x27')]){delete _0x34ec90[_0xb775('0x27')];}_0x37c4be[_0xb775('0x17')](_0x46c350)['send'](_0x34ec90);};}exports[_0xb775('0x28')]=function(_0x3d07f2,_0x2caae8){var _0x5e63ea={},_0x346fe6={},_0x5d9bfa={'count':0x0,'rows':[]};var _0x21154f=_['map'](db['Attachment'][_0xb775('0x29')],function(_0x5440aa){return{'name':_0x5440aa['fieldName'],'type':_0x5440aa[_0xb775('0x2a')][_0xb775('0x2b')]};});_0x346fe6[_0xb775('0x2c')]=_['map'](_0x21154f,_0xb775('0x27'));_0x346fe6[_0xb775('0x2d')]=_[_0xb775('0x2e')](_0x3d07f2[_0xb775('0x2d')]);_0x346fe6[_0xb775('0x2f')]=_[_0xb775('0x30')](_0x346fe6[_0xb775('0x2c')],_0x346fe6['query']);_0x5e63ea[_0xb775('0x31')]=_[_0xb775('0x30')](_0x346fe6[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x3d07f2[_0xb775('0x2d')][_0xb775('0x32')]));_0x5e63ea['attributes']=_0x5e63ea['attributes'][_0xb775('0x33')]?_0x5e63ea[_0xb775('0x31')]:_0x346fe6[_0xb775('0x2c')];if(!_0x3d07f2[_0xb775('0x2d')][_0xb775('0x34')]('nolimit')){_0x5e63ea[_0xb775('0x1a')]=qs[_0xb775('0x1a')](_0x3d07f2['query'][_0xb775('0x1a')]);_0x5e63ea[_0xb775('0x18')]=qs['offset'](_0x3d07f2[_0xb775('0x2d')]['offset']);}_0x5e63ea[_0xb775('0x35')]=qs['sort'](_0x3d07f2[_0xb775('0x2d')][_0xb775('0x36')]);_0x5e63ea[_0xb775('0x37')]=qs[_0xb775('0x2f')](_[_0xb775('0x38')](_0x3d07f2[_0xb775('0x2d')],_0x346fe6[_0xb775('0x2f')]),_0x21154f);if(_0x3d07f2[_0xb775('0x2d')]['filter']){_0x5e63ea['where']=_['merge'](_0x5e63ea[_0xb775('0x37')],{'$or':_[_0xb775('0x39')](_0x21154f,function(_0x48888e){if(_0x48888e['type']!==_0xb775('0x3a')){var _0xe7ea21={};_0xe7ea21[_0x48888e[_0xb775('0x27')]]={'$like':'%'+_0x3d07f2[_0xb775('0x2d')][_0xb775('0x3b')]+'%'};return _0xe7ea21;}})});}_0x5e63ea=_[_0xb775('0x3c')]({},_0x5e63ea,_0x3d07f2[_0xb775('0x3d')]);var _0x17dafe={'where':_0x5e63ea[_0xb775('0x37')]};return db[_0xb775('0x3e')][_0xb775('0x1b')](_0x17dafe)[_0xb775('0x22')](function(_0x4defc5){_0x5d9bfa[_0xb775('0x1b')]=_0x4defc5;if(_0x3d07f2[_0xb775('0x2d')][_0xb775('0x3f')]){_0x5e63ea[_0xb775('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xb775('0x41')](_0x5e63ea);})[_0xb775('0x22')](function(_0x267d7b){_0x5d9bfa['rows']=_0x267d7b;return _0x5d9bfa;})[_0xb775('0x22')](respondWithFilteredResult(_0x2caae8,_0x5e63ea))[_0xb775('0x42')](handleError(_0x2caae8,null));};exports['show']=function(_0x3f6911,_0x368a6b){var _0x3f5fb0={'raw':!![],'where':{'id':_0x3f6911[_0xb775('0x43')]['id']}},_0x37f9b2={};_0x37f9b2[_0xb775('0x2c')]=_[_0xb775('0x2e')](db[_0xb775('0x3e')][_0xb775('0x29')]);_0x37f9b2[_0xb775('0x2d')]=_['keys'](_0x3f6911[_0xb775('0x2d')]);_0x37f9b2[_0xb775('0x2f')]=_[_0xb775('0x30')](_0x37f9b2[_0xb775('0x2c')],_0x37f9b2[_0xb775('0x2d')]);_0x3f5fb0['attributes']=_[_0xb775('0x30')](_0x37f9b2[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x3f6911[_0xb775('0x2d')]['fields']));_0x3f5fb0['attributes']=_0x3f5fb0[_0xb775('0x31')][_0xb775('0x33')]?_0x3f5fb0[_0xb775('0x31')]:_0x37f9b2[_0xb775('0x2c')];if(_0x3f6911['query']['includeAll']){_0x3f5fb0[_0xb775('0x40')]=[{'all':!![]}];}_0x3f5fb0=_['merge']({},_0x3f5fb0,_0x3f6911[_0xb775('0x3d')]);return db['Attachment'][_0xb775('0x44')](_0x3f5fb0)[_0xb775('0x22')](handleEntityNotFound(_0x368a6b,null))['then'](respondWithResult(_0x368a6b,null))[_0xb775('0x42')](handleError(_0x368a6b,null));};exports[_0xb775('0x45')]=function(_0x5c0292,_0x1734ea){var _0x300b5e={'where':{'id':_0x5c0292['params']['id']}},_0x2755eb={};_0x2755eb[_0xb775('0x2c')]=_[_0xb775('0x2e')](db[_0xb775('0x3e')][_0xb775('0x29')]);_0x300b5e[_0xb775('0x31')]=_['intersection'](_0x2755eb[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x5c0292['query']['fields']));_0x300b5e[_0xb775('0x31')]=_0x300b5e[_0xb775('0x31')]['length']?_0x300b5e['attributes']:_0x2755eb[_0xb775('0x2c')];if(_0x5c0292[_0xb775('0x2d')][_0xb775('0x3f')]){_0x300b5e[_0xb775('0x40')]=[{'all':!![]}];}_0x300b5e=_[_0xb775('0x3c')]({},_0x300b5e,_0x5c0292[_0xb775('0x3d')]);return db[_0xb775('0x3e')][_0xb775('0x44')](_0x300b5e)[_0xb775('0x22')](handleEntityNotFound(_0x1734ea,null))['then'](function(_0x2db19e){if(_0x2db19e){var _0x7637e1=_0x2db19e[_0xb775('0x46')]({'plain':!![]});_0x7637e1=qs[_0xb775('0x47')](_0x7637e1,['id',_0xb775('0x48'),'updatedAt']);_0x5c0292['body']=_[_0xb775('0x47')](_0x5c0292[_0xb775('0x49')],['id',_0xb775('0x48'),_0xb775('0x4a')]);return db[_0xb775('0x3e')][_0xb775('0x4b')](_[_0xb775('0x3c')](_0x7637e1,_0x5c0292[_0xb775('0x49')]),{'include':_0x5c0292[_0xb775('0x2d')][_0xb775('0x3f')]?[{'all':!![]}]:undefined});}})[_0xb775('0x22')](respondWithResult(_0x1734ea,0xc9))[_0xb775('0x42')](handleError(_0x1734ea,null));};exports[_0xb775('0x4c')]=function(_0xf4ee97,_0x300534){if(_0xf4ee97[_0xb775('0x49')]['id']){delete _0xf4ee97[_0xb775('0x49')]['id'];}return db[_0xb775('0x3e')][_0xb775('0x44')]({'where':{'id':_0xf4ee97[_0xb775('0x43')]['id']}})[_0xb775('0x22')](handleEntityNotFound(_0x300534,null))['then'](saveUpdates(_0xf4ee97['body'],null))[_0xb775('0x22')](respondWithResult(_0x300534,null))[_0xb775('0x42')](handleError(_0x300534,null));};exports['destroy']=function(_0x545147,_0x192826){return db[_0xb775('0x3e')][_0xb775('0x44')]({'where':{'id':_0x545147[_0xb775('0x43')]['id']}})['then'](handleEntityNotFound(_0x192826,null))[_0xb775('0x22')](removeEntity(_0x192826,null))[_0xb775('0x42')](handleError(_0x192826,null));};exports[_0xb775('0x4b')]=function(_0x296d86,_0x48354b,_0x28a2ba){_0x296d86[_0xb775('0x49')][_0xb775('0x27')]=_0x296d86['file'][_0xb775('0x4d')];_0x296d86['body'][_0xb775('0x4e')]=_0x296d86[_0xb775('0x4f')][_0xb775('0x50')];_0x296d86['body'][_0xb775('0x2a')]=_0x296d86['file']['mimetype'];return db[_0xb775('0x3e')][_0xb775('0x4b')](_0x296d86['body'])[_0xb775('0x22')](respondWithResult(_0x48354b,0xc9))[_0xb775('0x42')](handleError(_0x48354b,null));};exports['download']=function(_0xc09cdc,_0xc2cbf3,_0x3f532a){return db[_0xb775('0x3e')][_0xb775('0x51')]({'where':{'id':_0xc09cdc[_0xb775('0x43')]['id']},'raw':!![]})[_0xb775('0x22')](handleEntityNotFound(_0xc2cbf3,null))[_0xb775('0x22')](function(_0x51d193){if(_0x51d193){var _0x1a22a2=_0x51d193[_0xb775('0x52')]!==null;var _0x424ede=path['join'](config['root'],'server/files/attachments/');if(_0x1a22a2){_0x424ede=path[_0xb775('0x53')](_0x424ede,_0xb775('0x54'));}var _0x37742b=path[_0xb775('0x53')](_0x424ede,_0x51d193[_0xb775('0x4e')]);return _0xc2cbf3['download'](_0x37742b);}})['catch'](handleError(_0xc2cbf3,null));}; \ No newline at end of file +var _0xc2da=['filters','pick','filter','merge','options','include','findAll','rows','includeAll','find','catch','clone','params','rawAttributes','omit','createdAt','updatedAt','create','body','update','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x553851,_0x4b5f21){var _0x13672e=function(_0x2d6b41){while(--_0x2d6b41){_0x553851['push'](_0x553851['shift']());}};_0x13672e(++_0x4b5f21);}(_0xc2da,0xcb));var _0xac2d=function(_0x250c78,_0x25b838){_0x250c78=_0x250c78-0x0;var _0x44f07a=_0xc2da[_0x250c78];return _0x44f07a;};'use strict';var emlformat=require(_0xac2d('0x0'));var rimraf=require(_0xac2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac2d('0x2'));var rp=require('request-promise');var moment=require(_0xac2d('0x3'));var BPromise=require(_0xac2d('0x4'));var Mustache=require(_0xac2d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xac2d('0x6'));var csv=require(_0xac2d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac2d('0x8'));var _=require(_0xac2d('0x9'));var squel=require(_0xac2d('0xa'));var crypto=require(_0xac2d('0xb'));var jsforce=require(_0xac2d('0xc'));var deskjs=require(_0xac2d('0xd'));var toCsv=require(_0xac2d('0x7'));var querystring=require(_0xac2d('0xe'));var Papa=require(_0xac2d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac2d('0x10'));var as=require(_0xac2d('0x11'));var hardwareService=require(_0xac2d('0x12'));var logger=require(_0xac2d('0x13'))('api');var utils=require(_0xac2d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac2d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21cb40,_0x7d21fd){_0x7d21fd=_0x7d21fd||0xcc;return function(_0x1ee408){if(_0x1ee408){return _0x21cb40[_0xac2d('0x16')](_0x7d21fd);}return _0x21cb40[_0xac2d('0x17')](_0x7d21fd)[_0xac2d('0x18')]();};}function respondWithResult(_0x296c77,_0x5c3dd5){_0x5c3dd5=_0x5c3dd5||0xc8;return function(_0x4f9d6c){if(_0x4f9d6c){return _0x296c77['status'](_0x5c3dd5)['json'](_0x4f9d6c);}};}function respondWithFilteredResult(_0x539b47,_0x28007){return function(_0x4b20ad){if(_0x4b20ad){var _0x47fd13=typeof _0x28007['offset']===_0xac2d('0x19')&&typeof _0x28007[_0xac2d('0x1a')]===_0xac2d('0x19');var _0x1de7bd=_0x4b20ad[_0xac2d('0x1b')];var _0xd73b4=_0x47fd13?0x0:_0x28007[_0xac2d('0x1c')];var _0x1ff689=_0x47fd13?_0x4b20ad[_0xac2d('0x1b')]:_0x28007[_0xac2d('0x1c')]+_0x28007[_0xac2d('0x1a')];var _0x2976eb;if(_0x1ff689>=_0x1de7bd){_0x1ff689=_0x1de7bd;_0x2976eb=0xc8;}else{_0x2976eb=0xce;}_0x539b47[_0xac2d('0x17')](_0x2976eb);return _0x539b47[_0xac2d('0x1d')](_0xac2d('0x1e'),_0xd73b4+'-'+_0x1ff689+'/'+_0x1de7bd)[_0xac2d('0x1f')](_0x4b20ad);}return null;};}function patchUpdates(_0x1525c5){return function(_0x11646d){try{jsonpatch['apply'](_0x11646d,_0x1525c5,!![]);}catch(_0x33fc13){return BPromise[_0xac2d('0x20')](_0x33fc13);}return _0x11646d['save']();};}function saveUpdates(_0x4c2348,_0x584e03){return function(_0x3a5f1a){if(_0x3a5f1a){return _0x3a5f1a['update'](_0x4c2348)[_0xac2d('0x21')](function(_0x5bde51){return _0x5bde51;});}return null;};}function removeEntity(_0x5c6630,_0x19c26c){return function(_0x1e307e){if(_0x1e307e){return _0x1e307e[_0xac2d('0x22')]()['then'](function(){_0x5c6630[_0xac2d('0x17')](0xcc)[_0xac2d('0x18')]();});}};}function handleEntityNotFound(_0x25bdff,_0xd6d881){return function(_0x1dfada){if(!_0x1dfada){_0x25bdff[_0xac2d('0x16')](0x194);}return _0x1dfada;};}function handleError(_0x28267b,_0x35834f){_0x35834f=_0x35834f||0x1f4;return function(_0x12a66e){logger[_0xac2d('0x23')](_0x12a66e[_0xac2d('0x24')]);if(_0x12a66e[_0xac2d('0x25')]){delete _0x12a66e[_0xac2d('0x25')];}_0x28267b['status'](_0x35834f)['send'](_0x12a66e);};}exports[_0xac2d('0x26')]=function(_0x30f8d2,_0x4a466a){var _0x4eb6e5={},_0x5b1721={},_0x16ab6b={'count':0x0,'rows':[]};var _0x27daa7=_[_0xac2d('0x27')](db[_0xac2d('0x28')]['rawAttributes'],function(_0x2c8d31){return{'name':_0x2c8d31[_0xac2d('0x29')],'type':_0x2c8d31[_0xac2d('0x2a')]['key']};});_0x5b1721[_0xac2d('0x2b')]=_[_0xac2d('0x27')](_0x27daa7,_0xac2d('0x25'));_0x5b1721[_0xac2d('0x2c')]=_[_0xac2d('0x2d')](_0x30f8d2[_0xac2d('0x2c')]);_0x5b1721['filters']=_[_0xac2d('0x2e')](_0x5b1721[_0xac2d('0x2b')],_0x5b1721[_0xac2d('0x2c')]);_0x4eb6e5['attributes']=_[_0xac2d('0x2e')](_0x5b1721[_0xac2d('0x2b')],qs[_0xac2d('0x2f')](_0x30f8d2[_0xac2d('0x2c')]['fields']));_0x4eb6e5[_0xac2d('0x30')]=_0x4eb6e5[_0xac2d('0x30')][_0xac2d('0x31')]?_0x4eb6e5['attributes']:_0x5b1721[_0xac2d('0x2b')];if(!_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x32')](_0xac2d('0x33'))){_0x4eb6e5[_0xac2d('0x1a')]=qs[_0xac2d('0x1a')](_0x30f8d2['query'][_0xac2d('0x1a')]);_0x4eb6e5[_0xac2d('0x1c')]=qs[_0xac2d('0x1c')](_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x1c')]);}_0x4eb6e5[_0xac2d('0x34')]=qs[_0xac2d('0x35')](_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x35')]);_0x4eb6e5[_0xac2d('0x36')]=qs[_0xac2d('0x37')](_[_0xac2d('0x38')](_0x30f8d2[_0xac2d('0x2c')],_0x5b1721[_0xac2d('0x37')]),_0x27daa7);if(_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x39')]){_0x4eb6e5[_0xac2d('0x36')]=_[_0xac2d('0x3a')](_0x4eb6e5[_0xac2d('0x36')],{'$or':_[_0xac2d('0x27')](_0x27daa7,function(_0x33ee79){if(_0x33ee79[_0xac2d('0x2a')]!=='VIRTUAL'){var _0x9204c9={};_0x9204c9[_0x33ee79[_0xac2d('0x25')]]={'$like':'%'+_0x30f8d2['query'][_0xac2d('0x39')]+'%'};return _0x9204c9;}})});}_0x4eb6e5=_[_0xac2d('0x3a')]({},_0x4eb6e5,_0x30f8d2[_0xac2d('0x3b')]);var _0x5a1c32={'where':_0x4eb6e5['where']};return db[_0xac2d('0x28')]['count'](_0x5a1c32)[_0xac2d('0x21')](function(_0xd2e8f3){_0x16ab6b['count']=_0xd2e8f3;if(_0x30f8d2[_0xac2d('0x2c')]['includeAll']){_0x4eb6e5[_0xac2d('0x3c')]=[{'all':!![]}];}return db[_0xac2d('0x28')][_0xac2d('0x3d')](_0x4eb6e5);})['then'](function(_0x312b01){_0x16ab6b[_0xac2d('0x3e')]=_0x312b01;return _0x16ab6b;})[_0xac2d('0x21')](respondWithFilteredResult(_0x4a466a,_0x4eb6e5))['catch'](handleError(_0x4a466a,null));};exports['show']=function(_0x40eea0,_0x412ea1){var _0x340087={'raw':!![],'where':{'id':_0x40eea0['params']['id']}},_0x3f24b8={};_0x3f24b8[_0xac2d('0x2b')]=_[_0xac2d('0x2d')](db[_0xac2d('0x28')]['rawAttributes']);_0x3f24b8['query']=_[_0xac2d('0x2d')](_0x40eea0[_0xac2d('0x2c')]);_0x3f24b8[_0xac2d('0x37')]=_[_0xac2d('0x2e')](_0x3f24b8[_0xac2d('0x2b')],_0x3f24b8[_0xac2d('0x2c')]);_0x340087['attributes']=_['intersection'](_0x3f24b8[_0xac2d('0x2b')],qs['fields'](_0x40eea0[_0xac2d('0x2c')][_0xac2d('0x2f')]));_0x340087[_0xac2d('0x30')]=_0x340087[_0xac2d('0x30')]['length']?_0x340087[_0xac2d('0x30')]:_0x3f24b8[_0xac2d('0x2b')];if(_0x40eea0[_0xac2d('0x2c')][_0xac2d('0x3f')]){_0x340087['include']=[{'all':!![]}];}_0x340087=_[_0xac2d('0x3a')]({},_0x340087,_0x40eea0[_0xac2d('0x3b')]);return db[_0xac2d('0x28')][_0xac2d('0x40')](_0x340087)[_0xac2d('0x21')](handleEntityNotFound(_0x412ea1,null))[_0xac2d('0x21')](respondWithResult(_0x412ea1,null))[_0xac2d('0x41')](handleError(_0x412ea1,null));};exports[_0xac2d('0x42')]=function(_0x1e5fb8,_0x3a7d28){var _0x5d73d2={'where':{'id':_0x1e5fb8[_0xac2d('0x43')]['id']}},_0x58b95b={};_0x58b95b[_0xac2d('0x2b')]=_['keys'](db[_0xac2d('0x28')][_0xac2d('0x44')]);_0x5d73d2[_0xac2d('0x30')]=_['intersection'](_0x58b95b['model'],qs[_0xac2d('0x2f')](_0x1e5fb8[_0xac2d('0x2c')][_0xac2d('0x2f')]));_0x5d73d2[_0xac2d('0x30')]=_0x5d73d2[_0xac2d('0x30')][_0xac2d('0x31')]?_0x5d73d2[_0xac2d('0x30')]:_0x58b95b[_0xac2d('0x2b')];if(_0x1e5fb8[_0xac2d('0x2c')][_0xac2d('0x3f')]){_0x5d73d2[_0xac2d('0x3c')]=[{'all':!![]}];}_0x5d73d2=_['merge']({},_0x5d73d2,_0x1e5fb8[_0xac2d('0x3b')]);return db['Attachment']['find'](_0x5d73d2)[_0xac2d('0x21')](handleEntityNotFound(_0x3a7d28,null))[_0xac2d('0x21')](function(_0x2cb902){if(_0x2cb902){var _0x101313=_0x2cb902['get']({'plain':!![]});_0x101313=qs[_0xac2d('0x45')](_0x101313,['id',_0xac2d('0x46'),_0xac2d('0x47')]);_0x1e5fb8['body']=_[_0xac2d('0x45')](_0x1e5fb8['body'],['id','createdAt',_0xac2d('0x47')]);return db[_0xac2d('0x28')][_0xac2d('0x48')](_[_0xac2d('0x3a')](_0x101313,_0x1e5fb8[_0xac2d('0x49')]),{'include':_0x1e5fb8['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xac2d('0x21')](respondWithResult(_0x3a7d28,0xc9))[_0xac2d('0x41')](handleError(_0x3a7d28,null));};exports[_0xac2d('0x4a')]=function(_0x250a15,_0x3ae25a){if(_0x250a15[_0xac2d('0x49')]['id']){delete _0x250a15[_0xac2d('0x49')]['id'];}return db['Attachment'][_0xac2d('0x40')]({'where':{'id':_0x250a15[_0xac2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ae25a,null))[_0xac2d('0x21')](saveUpdates(_0x250a15[_0xac2d('0x49')],null))['then'](respondWithResult(_0x3ae25a,null))[_0xac2d('0x41')](handleError(_0x3ae25a,null));};exports[_0xac2d('0x22')]=function(_0x48d420,_0x204bca){return db[_0xac2d('0x28')][_0xac2d('0x40')]({'where':{'id':_0x48d420[_0xac2d('0x43')]['id']}})[_0xac2d('0x21')](handleEntityNotFound(_0x204bca,null))['then'](removeEntity(_0x204bca,null))[_0xac2d('0x41')](handleError(_0x204bca,null));};exports['create']=function(_0x57cf52,_0x44680a,_0x3142db){_0x57cf52[_0xac2d('0x49')][_0xac2d('0x25')]=_0x57cf52[_0xac2d('0x4b')]['originalname'];_0x57cf52[_0xac2d('0x49')][_0xac2d('0x4c')]=_0x57cf52['file'][_0xac2d('0x4d')];_0x57cf52[_0xac2d('0x49')][_0xac2d('0x2a')]=_0x57cf52[_0xac2d('0x4b')][_0xac2d('0x4e')];return db[_0xac2d('0x28')][_0xac2d('0x48')](_0x57cf52[_0xac2d('0x49')])[_0xac2d('0x21')](respondWithResult(_0x44680a,0xc9))['catch'](handleError(_0x44680a,null));};exports[_0xac2d('0x4f')]=function(_0x59cb9a,_0x33c9bc,_0x1006fc){return db['Attachment'][_0xac2d('0x50')]({'where':{'id':_0x59cb9a[_0xac2d('0x43')]['id']},'raw':!![]})[_0xac2d('0x21')](handleEntityNotFound(_0x33c9bc,null))[_0xac2d('0x21')](function(_0x47cfc5){if(_0x47cfc5){var _0x3fa10c=_0x47cfc5[_0xac2d('0x51')]!==null;var _0x270d20=path[_0xac2d('0x52')](config[_0xac2d('0x53')],_0xac2d('0x54'));if(_0x3fa10c){_0x270d20=path[_0xac2d('0x52')](_0x270d20,_0xac2d('0x55'));}var _0x2408e8=path['join'](_0x270d20,_0x47cfc5[_0xac2d('0x4c')]);return _0x33c9bc['download'](_0x2408e8);}})['catch'](handleError(_0x33c9bc,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 712f23b..7603f27 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 _0xf2c1=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c1,0x122));var _0x1f2c=function(_0x14a205,_0x122dbc){_0x14a205=_0x14a205-0x0;var _0x5e8e21=_0xf2c1[_0x14a205];return _0x5e8e21;};'use strict';var _=require(_0x1f2c('0x0'));var util=require(_0x1f2c('0x1'));var logger=require(_0x1f2c('0x2'))(_0x1f2c('0x3'));var moment=require(_0x1f2c('0x4'));var BPromise=require(_0x1f2c('0x5'));var rp=require(_0x1f2c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f2c('0x7'));var attributes=require(_0x1f2c('0x8'));module[_0x1f2c('0x9')]=function(_0x12a1a7,_0x49a6b9){return _0x12a1a7[_0x1f2c('0xa')](_0x1f2c('0xb'),attributes,{'tableName':_0x1f2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f3=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','attachments'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x68f3,0xa0));var _0x368f=function(_0x8c6e15,_0x511675){_0x8c6e15=_0x8c6e15-0x0;var _0x27c04c=_0x68f3[_0x8c6e15];return _0x27c04c;};'use strict';var _=require(_0x368f('0x0'));var util=require('util');var logger=require(_0x368f('0x1'))('api');var moment=require(_0x368f('0x2'));var BPromise=require(_0x368f('0x3'));var rp=require(_0x368f('0x4'));var fs=require('fs');var path=require(_0x368f('0x5'));var rimraf=require(_0x368f('0x6'));var config=require(_0x368f('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x4b6236,_0x1c90ab){return _0x4b6236[_0x368f('0x8')]('Attachment',attributes,{'tableName':_0x368f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 86bcdce..1523e32 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 _0x7980=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateAttachment','lodash','util','moment'];(function(_0x4c183f,_0x17495c){var _0x243302=function(_0x4793c9){while(--_0x4793c9){_0x4c183f['push'](_0x4c183f['shift']());}};_0x243302(++_0x17495c);}(_0x7980,0xab));var _0x0798=function(_0xab68d7,_0x2c55c0){_0xab68d7=_0xab68d7-0x0;var _0x3f7154=_0x7980[_0xab68d7];return _0x3f7154;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('Attachment,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});}exports['CreateAttachment']=function(_0x41e217){var _0x46e74c=this;return new Promise(function(_0x288f41,_0x145197){return db['Attachment'][_0x0798('0x18')](_0x41e217[_0x0798('0x19')],{'raw':_0x41e217['options']?_0x41e217[_0x0798('0x1a')][_0x0798('0x1b')]===undefined?!![]:![]:!![]})[_0x0798('0xc')](function(_0x44ac33){logger[_0x0798('0xd')](_0x0798('0x1c'),_0x41e217);logger[_0x0798('0x10')](_0x0798('0x1c'),_0x41e217,JSON[_0x0798('0x12')](_0x44ac33));_0x288f41(_0x44ac33);})['catch'](function(_0x2aaabf){logger[_0x0798('0x13')](_0x0798('0x1c'),_0x2aaabf[_0x0798('0x15')],_0x41e217);_0x145197(_0x46e74c[_0x0798('0x13')](0x1f4,_0x2aaabf[_0x0798('0x15')]));});});}; \ No newline at end of file +var _0x5c12=['CreateAttachment','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','info','options','raw'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5c12,0x188));var _0x25c1=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x5c12[_0x37d3f3];return _0x185c9c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('Attachment,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('Attachment,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});}exports['CreateAttachment']=function(_0x61a29f){var _0x4c0d49=this;return new Promise(function(_0x7175d4,_0x23a418){return db['Attachment']['create'](_0x61a29f['body'],{'raw':_0x61a29f[_0x25c1('0x14')]?_0x61a29f[_0x25c1('0x14')][_0x25c1('0x15')]===undefined?!![]:![]:!![]})[_0x25c1('0xc')](function(_0x481c12){logger[_0x25c1('0x13')](_0x25c1('0x16'),_0x61a29f);logger[_0x25c1('0xf')](_0x25c1('0x16'),_0x61a29f,JSON['stringify'](_0x481c12));_0x7175d4(_0x481c12);})['catch'](function(_0x2a8a84){logger[_0x25c1('0x11')](_0x25c1('0x16'),_0x2a8a84[_0x25c1('0x12')],_0x61a29f);_0x23a418(_0x4c0d49[_0x25c1('0x11')](0x1f4,_0x2a8a84[_0x25c1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 900067f..20026c0 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x6ac818,_0x1d54cf){var _0x53e672=function(_0x3520ed){while(--_0x3520ed){_0x6ac818['push'](_0x6ac818['shift']());}};_0x53e672(++_0x1d54cf);}(_0x2032,0xd9));var _0x2203=function(_0x3201fe,_0x3de53c){_0x3201fe=_0x3201fe-0x0;var _0x2078f6=_0x2032[_0x3201fe];return _0x2078f6;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x31b307,_0x3ae2cc){_0x31b307=_0x31b307-0x0;var _0x337cd0=_0xdb28[_0x31b307];return _0x337cd0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index da4bd18..ea77a5b 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 99adfef..33c21b9 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 _0x78a1=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x78a1,0xec));var _0x178a=function(_0x6dc2ea,_0x1f47b6){_0x6dc2ea=_0x6dc2ea-0x0;var _0x292f75=_0x78a1[_0x6dc2ea];return _0x292f75;};'use strict';var express=require('express');var router=express[_0x178a('0x0')]();var controller=require(_0x178a('0x1'));router[_0x178a('0x2')]('/',controller[_0x178a('0x3')]);module[_0x178a('0x4')]=router; \ No newline at end of file +var _0xa2a0=['post','login','Router','./authActiveDirectory.controller'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xa2a0,0x182));var _0x0a2a=function(_0xb638a8,_0x12a581){_0xb638a8=_0xb638a8-0x0;var _0x42f193=_0xa2a0[_0xb638a8];return _0x42f193;};'use strict';var express=require('express');var router=express[_0x0a2a('0x0')]();var controller=require(_0x0a2a('0x1'));router[_0x0a2a('0x2')]('/',controller[_0x0a2a('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c75c658..b9125bf 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(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x7a54,0x106));var _0x47a5=function(_0x317ed1,_0xf30c53){_0x317ed1=_0x317ed1-0x0;var _0x3579a7=_0x7a54[_0x317ed1];return _0x3579a7;};'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(_0x4a668a,_0x204bba){var _0x43d0b6=function(_0x532416){while(--_0x532416){_0x4a668a['push'](_0x4a668a['shift']());}};_0x43d0b6(++_0x204bba);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 b026b4f..a1b98b3 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 _0x8a06=['login','/callback','callback','exports','express','passport','Router','../../components/auth/service','get'];(function(_0x5843c1,_0x372d51){var _0x56fbcd=function(_0x4dfc2a){while(--_0x4dfc2a){_0x5843c1['push'](_0x5843c1['shift']());}};_0x56fbcd(++_0x372d51);}(_0x8a06,0x1c6));var _0x68a0=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x8a06[_0x16de68];return _0x1c277e;};'use strict';var express=require(_0x68a0('0x0'));var passport=require(_0x68a0('0x1'));var router=express[_0x68a0('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x68a0('0x3'));router[_0x68a0('0x4')]('/',controller[_0x68a0('0x5')]);router[_0x68a0('0x4')](_0x68a0('0x6'),controller[_0x68a0('0x7')],authService['isMiddleware'],userController[_0x68a0('0x5')],authService['setTokenCookie']);module[_0x68a0('0x8')]=router; \ No newline at end of file +var _0xa6fa=['passport','Router','./authGoogle.controller','get','/callback','callback','login','exports'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xa6fa,0x130));var _0xaa6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa6fa[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var passport=require(_0xaa6f('0x0'));var router=express[_0xaa6f('0x1')]();var controller=require(_0xaa6f('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xaa6f('0x3')]('/',controller['login']);router[_0xaa6f('0x3')](_0xaa6f('0x4'),controller[_0xaa6f('0x5')],authService['isMiddleware'],userController[_0xaa6f('0x6')],authService['setTokenCookie']);module[_0xaa6f('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 806a1b3..2d37129 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 _0x1260=['host','port','secure','auth','pass','merge','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','email','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','find','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordExpires','Password\x20reset!','use','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','then','name','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','service'];(function(_0x2c48df,_0x46e91c){var _0x5f223a=function(_0x11f763){while(--_0x11f763){_0x2c48df['push'](_0x2c48df['shift']());}};_0x5f223a(++_0x46e91c);}(_0x1260,0x184));var _0x0126=function(_0x2a64e5,_0x138274){_0x2a64e5=_0x2a64e5-0x0;var _0x2a2e0c=_0x1260[_0x2a64e5];return _0x2a2e0c;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0x0126('0x0')];var jayson=require('jayson/promise');var _=require(_0x0126('0x1'));var rs=require('randomstring');var moment=require(_0x0126('0x2'));var db=require(_0x0126('0x3'))['db'];var authService=require(_0x0126('0x4'));var utils=require(_0x0126('0x5'));var client=jayson[_0x0126('0x6')][_0x0126('0x7')]({'port':0x232b});function localAuthenticate(_0x143372,_0x1c53bd,_0x12b584,_0x5b9749){var _0x1c438f,_0x1ba604;return db[_0x0126('0x8')][_0x0126('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x0126('0xa')](function(_0x1cc7ba){_0x1c438f=_0x1cc7ba;return _0x143372[_0x0126('0x9')]({'attributes':['id',_0x0126('0xb'),'password',_0x0126('0xc'),'role','disabled',_0x0126('0xd'),_0x0126('0xe'),_0x0126('0xf')],'where':{'name':_0x1c53bd,'role':{'$or':[_0x0126('0x10'),_0x0126('0x11'),_0x0126('0x12')]}}});})[_0x0126('0xa')](function(_0x28e26d){if(!_0x28e26d||_0x28e26d&&_0x28e26d[_0x0126('0xb')]!==_0x1c53bd){throw new Error(_0x0126('0x13'));}else{_0x1ba604=_0x28e26d;return _0x1ba604;}})[_0x0126('0xa')](function(){_0x1ba604['authenticate'](_0x12b584,function(_0x47945a,_0x117136){var _0x29e7e7=_0x1ba604['loginAttempts']+0x1;if(_0x47945a){return _0x5b9749(_0x47945a);}else if(!_0x117136){if(_0x1ba604[_0x0126('0x14')]){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else if(_0x1c438f[_0x0126('0x15')]>0x0){if(_0x1ba604['blocked']){if(_0x1c438f[_0x0126('0x16')]>0x0){if(moment(_0x1ba604[_0x0126('0xe')])[_0x0126('0x17')](_0x1c438f[_0x0126('0x16')],_0x0126('0x18'))>moment()){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else{return utils[_0x0126('0x19')](_0x1ba604,_0x29e7e7,![],null)[_0x0126('0xa')](function(){return _0x5b9749(null,![],{'message':_0x0126('0x13')});});}}else{return _0x5b9749(null,![],{'message':_0x0126('0x13')});}}else{if(_0x29e7e7>=_0x1c438f[_0x0126('0x15')]){return utils[_0x0126('0x19')](_0x1ba604,0x0,!![],moment())['then'](function(){return _0x5b9749(null,![],{'message':_0x0126('0x13')});});}else{return utils['clearBlockUser'](_0x1ba604,_0x29e7e7,![],null)[_0x0126('0xa')](function(){return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5b9749(null,![],{'message':_0x0126('0x13')});}}else{if(_0x1ba604[_0x0126('0x14')]){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else if(_0x1c438f[_0x0126('0x15')]>0x0){if(_0x1ba604[_0x0126('0xd')]){if(_0x1c438f['blockDuration']>0x0){if(moment(_0x1ba604['blockedAt'])[_0x0126('0x17')](_0x1c438f['blockDuration'],'minutes')>moment()){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else{return utils['clearBlockUser'](_0x1ba604,0x0,![],null)[_0x0126('0xa')](function(){return utils[_0x0126('0x1a')](_0x1ba604);})[_0x0126('0xa')](function(){return _0x5b9749(null,_0x1ba604);});}}else{return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0126('0x19')](_0x1ba604,0x0,![],null)['then'](function(){return utils[_0x0126('0x1a')](_0x1ba604);})['then'](function(){return _0x5b9749(null,_0x1ba604);})['catch'](function(_0x4c6608){return _0x5b9749(null,![],_0x4c6608);});}}else{if(_0x1ba604[_0x0126('0xd')]){return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0126('0x1a')](_0x1ba604)[_0x0126('0xa')](function(){return _0x5b9749(null,_0x1ba604);});}}}});})[_0x0126('0x1b')](function(_0x412c23){return _0x5b9749(null,![],_0x412c23);});}function sendServiceMail(_0x51e50f){return db[_0x0126('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0x0126('0xb'),'email'],'include':[{'model':db[_0x0126('0x1d')],'as':_0x0126('0x1e')}]})[_0x0126('0xa')](function(_0x5e2d55){if(!_0x5e2d55){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x455585={'tls':{'rejectUnauthorized':![]}};if(_0x5e2d55[_0x0126('0x1e')]['service']){_0x455585['service']=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x1f')];}else{_0x455585[_0x0126('0x20')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x20')];_0x455585[_0x0126('0x21')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x21')];_0x455585[_0x0126('0x22')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x22')];}if(_0x5e2d55['Smtp']['authentication']){_0x455585[_0x0126('0x23')]={'user':_0x5e2d55[_0x0126('0x1e')][_0x0126('0x11')],'pass':_0x5e2d55['Smtp'][_0x0126('0x24')]};}var _0x55a7d8={'account':_0x455585,'message':_[_0x0126('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x5e2d55['name'],_0x5e2d55['email']||_0x5e2d55['Smtp'][_0x0126('0x11')])},_0x51e50f)};return client[_0x0126('0x26')](_0x0126('0x27'),_0x55a7d8);})[_0x0126('0xa')](function(_0x3f0c43){if(_0x3f0c43[_0x0126('0x28')]){throw new Error(util['format'](_0x0126('0x29'),_0x3f0c43['error'][_0x0126('0x2a')]||JSON[_0x0126('0x2b')](_0x3f0c43[_0x0126('0x28')])));}return!![];});}function handleError(_0x3a2f13,_0x14a84d,_0x547ea0){return _0x3a2f13['status'](_0x14a84d||0x1f4)[_0x0126('0x2c')]({'message':_0x547ea0?_0x547ea0[_0x0126('0x2a')]||_0x547ea0:''});}exports[_0x0126('0x2d')]=function(_0x30312c,_0x3341a4,_0x58ac41){passport[_0x0126('0x2e')](_0x0126('0x2f'),function(_0x35a948,_0x428dd9,_0x56b0d6){var _0x4a07c2=_0x35a948||_0x56b0d6;if(_0x4a07c2){return handleError(_0x3341a4,0x191,_0x4a07c2);}if(!_0x428dd9){return handleError(_0x3341a4,0x194,{'message':_0x0126('0x30')});}else{var _0x378d53={'payload':{'id':_0x428dd9['id'],'role':_0x428dd9[_0x0126('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x0126('0x32')](_0x378d53)[_0x0126('0xa')](function(_0x57cf7b){_0x3341a4[_0x0126('0x33')]({'id':_0x428dd9['id'],'token':_0x57cf7b,'statusCall':'','isAlreadyLogged':_0x428dd9['online']});});}})(_0x30312c,_0x3341a4,_0x58ac41);};exports[_0x0126('0x34')]=function(_0x290073,_0x50022f,_0x3bab73){if(!_0x290073[_0x0126('0x35')]['email']){return handleError(_0x50022f,0x1f4,{'message':_0x0126('0x36')});}var _0xefd9f7=rs[_0x0126('0x37')]();_0x290073[_0x0126('0x35')][_0x0126('0x38')]=_0x290073[_0x0126('0x35')][_0x0126('0x38')]['trim']()['toLowerCase']();var _0xb0f3a4;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0126('0x16')],'raw':!![]})[_0x0126('0xa')](function(_0x4cfe4a){_0xb0f3a4=_0x4cfe4a;return db[_0x0126('0x39')]['find']({'where':{'email':_0x290073[_0x0126('0x35')][_0x0126('0x38')]}});})['then'](function(_0x3132bc){if(!_0x3132bc){throw new Error(_0x0126('0x3a'));}if(_0x3132bc['disabled']){throw new Error(_0x0126('0x3b'));}if(_0x3132bc[_0x0126('0xd')]){if(moment(_0x3132bc[_0x0126('0xe')])[_0x0126('0x17')](_0xb0f3a4[_0x0126('0x16')],_0x0126('0x18'))>moment()){throw new Error(_0x0126('0x3c'));}else{_0x3132bc[_0x0126('0xd')]=![];_0x3132bc[_0x0126('0xe')]=null;}}_0x3132bc[_0x0126('0x3d')]=_0xefd9f7;_0x3132bc['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3132bc[_0x0126('0x3e')]();})[_0x0126('0xa')](function(){return sendServiceMail({'to':_0x290073[_0x0126('0x35')]['email'],'subject':_0x0126('0x3f'),'text':_0x0126('0x40')+_0x0126('0x41')+_0x0126('0x42')+_0x290073[_0x0126('0x43')][_0x0126('0x20')]+_0x0126('0x44')+_0xefd9f7+'\x0a\x0a'+_0x0126('0x45')});})['then'](function(){_0x50022f['status'](0xc8)[_0x0126('0x2c')]({'message':_0x0126('0x46')});})[_0x0126('0x1b')](function(_0xb0a2e0){return handleError(_0x50022f,0x1f4,_0xb0a2e0);});};exports['reset']=function(_0x171caf,_0x497d07,_0x33681a){return db[_0x0126('0x39')][_0x0126('0x47')]({'where':{'resetPasswordToken':_0x171caf[_0x0126('0x48')]['token'],'resetPasswordExpires':{'$gt':Date[_0x0126('0x49')]()}}})[_0x0126('0xa')](function(_0x3ad688){if(!_0x3ad688){throw new Error(_0x0126('0x4a'));}return db[_0x0126('0x8')][_0x0126('0x9')]({'attributes':['id',_0x0126('0x4b'),_0x0126('0x4c'),_0x0126('0x4d')]})[_0x0126('0xa')](function(_0x21d027){if(_0x21d027[_0x0126('0x4b')])authService[_0x0126('0x4e')](_0x171caf['body'][_0x0126('0x4f')]);if(!_0x21d027[_0x0126('0x4c')]||!_0x3ad688['previousPasswords'])return _0x3ad688;authService['validatePasswordHistory'](_0x171caf[_0x0126('0x35')][_0x0126('0x4f')],_0x3ad688[_0x0126('0x50')],_0x21d027[_0x0126('0x4d')]);return _0x3ad688;})[_0x0126('0xa')](function(){_0x3ad688[_0x0126('0x4f')]=_0x171caf[_0x0126('0x35')][_0x0126('0x4f')];_0x3ad688[_0x0126('0x3d')]=null;_0x3ad688[_0x0126('0x51')]=null;return _0x3ad688[_0x0126('0x3e')]();});})[_0x0126('0xa')](function(){_0x497d07['status'](0xc8)['send']({'message':_0x0126('0x52')});})[_0x0126('0x1b')](function(_0x1831ea){return handleError(_0x497d07,0x1f4,_0x1831ea);});};passport[_0x0126('0x53')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x0126('0x4f')},function(_0x383fdd,_0x568d97,_0x324557){return localAuthenticate(db['User'],_0x383fdd,_0x568d97,_0x324557);})); \ No newline at end of file +var _0x543b=['name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then'];(function(_0x4bea2f,_0x20f5b8){var _0x619486=function(_0x120d83){while(--_0x120d83){_0x4bea2f['push'](_0x4bea2f['shift']());}};_0x619486(++_0x20f5b8);}(_0x543b,0x14c));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xb543('0x0'));var passport=require(_0xb543('0x1'));var LocalStrategy=require(_0xb543('0x2'))['Strategy'];var jayson=require(_0xb543('0x3'));var _=require(_0xb543('0x4'));var rs=require(_0xb543('0x5'));var moment=require(_0xb543('0x6'));var db=require(_0xb543('0x7'))['db'];var authService=require(_0xb543('0x8'));var utils=require(_0xb543('0x9'));var client=jayson[_0xb543('0xa')][_0xb543('0xb')]({'port':0x232b});function localAuthenticate(_0x4fb7e9,_0x35b33e,_0x928483,_0x26ba16){var _0x189892,_0x311a44;return db[_0xb543('0xc')][_0xb543('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb543('0xe')],'raw':!![]})[_0xb543('0xf')](function(_0x1b8af7){_0x189892=_0x1b8af7;return _0x4fb7e9[_0xb543('0xd')]({'attributes':['id',_0xb543('0x10'),_0xb543('0x11'),'salt',_0xb543('0x12'),_0xb543('0x13'),_0xb543('0x14'),_0xb543('0x15'),_0xb543('0x16')],'where':{'name':_0x35b33e,'role':{'$or':[_0xb543('0x17'),_0xb543('0x18'),'agent']}}});})[_0xb543('0xf')](function(_0x1ad62d){if(!_0x1ad62d||_0x1ad62d&&_0x1ad62d['name']!==_0x35b33e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x311a44=_0x1ad62d;return _0x311a44;}})['then'](function(){_0x311a44[_0xb543('0x19')](_0x928483,function(_0x19d879,_0x25b9c0){var _0x225ae9=_0x311a44[_0xb543('0x16')]+0x1;if(_0x19d879){return _0x26ba16(_0x19d879);}else if(!_0x25b9c0){if(_0x311a44[_0xb543('0x13')]){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else if(_0x189892[_0xb543('0x1b')]>0x0){if(_0x311a44[_0xb543('0x14')]){if(_0x189892[_0xb543('0xe')]>0x0){if(moment(_0x311a44[_0xb543('0x15')])[_0xb543('0x1c')](_0x189892[_0xb543('0xe')],'minutes')>moment()){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1d')](_0x311a44,_0x225ae9,![],null)[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{if(_0x225ae9>=_0x189892[_0xb543('0x1b')]){return utils['clearBlockUser'](_0x311a44,0x0,!![],moment())[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}else{return utils['clearBlockUser'](_0x311a44,_0x225ae9,![],null)[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{if(_0x311a44['disabled']){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else if(_0x189892[_0xb543('0x1b')]>0x0){if(_0x311a44[_0xb543('0x14')]){if(_0x189892[_0xb543('0xe')]>0x0){if(moment(_0x311a44[_0xb543('0x15')])[_0xb543('0x1c')](_0x189892[_0xb543('0xe')],_0xb543('0x1e'))>moment()){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1d')](_0x311a44,0x0,![],null)[_0xb543('0xf')](function(){return utils[_0xb543('0x1f')](_0x311a44);})[_0xb543('0xf')](function(){return _0x26ba16(null,_0x311a44);});}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{return utils[_0xb543('0x1d')](_0x311a44,0x0,![],null)['then'](function(){return utils[_0xb543('0x1f')](_0x311a44);})['then'](function(){return _0x26ba16(null,_0x311a44);})[_0xb543('0x20')](function(_0x36caa3){return _0x26ba16(null,![],_0x36caa3);});}}else{if(_0x311a44['blocked']){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1f')](_0x311a44)[_0xb543('0xf')](function(){return _0x26ba16(null,_0x311a44);});}}}});})[_0xb543('0x20')](function(_0x5030a0){return _0x26ba16(null,![],_0x5030a0);});}function sendServiceMail(_0x2713d7){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xb543('0x10'),_0xb543('0x21')],'include':[{'model':db[_0xb543('0x22')],'as':'Smtp'}]})['then'](function(_0x36bf35){if(!_0x36bf35){throw new Error(_0xb543('0x23'));}var _0x3c7ab2={'tls':{'rejectUnauthorized':![]}};if(_0x36bf35[_0xb543('0x24')][_0xb543('0x25')]){_0x3c7ab2[_0xb543('0x25')]=_0x36bf35['Smtp'][_0xb543('0x25')];}else{_0x3c7ab2[_0xb543('0x26')]=_0x36bf35[_0xb543('0x24')][_0xb543('0x26')];_0x3c7ab2[_0xb543('0x27')]=_0x36bf35['Smtp'][_0xb543('0x27')];_0x3c7ab2[_0xb543('0x28')]=_0x36bf35['Smtp'][_0xb543('0x28')];}if(_0x36bf35[_0xb543('0x24')][_0xb543('0x29')]){_0x3c7ab2[_0xb543('0x2a')]={'user':_0x36bf35['Smtp'][_0xb543('0x18')],'pass':_0x36bf35['Smtp'][_0xb543('0x2b')]};}var _0xb508ff={'account':_0x3c7ab2,'message':_[_0xb543('0x2c')]({'from':util['format'](_0xb543('0x2d'),_0x36bf35[_0xb543('0x10')],_0x36bf35[_0xb543('0x21')]||_0x36bf35[_0xb543('0x24')]['user'])},_0x2713d7)};return client['request'](_0xb543('0x2e'),_0xb508ff);})[_0xb543('0xf')](function(_0x312bde){if(_0x312bde[_0xb543('0x2f')]){throw new Error(util[_0xb543('0x30')](_0xb543('0x31'),_0x312bde[_0xb543('0x2f')][_0xb543('0x32')]||JSON[_0xb543('0x33')](_0x312bde[_0xb543('0x2f')])));}return!![];});}function handleError(_0x415243,_0x130a46,_0x150ae5){return _0x415243[_0xb543('0x34')](_0x130a46||0x1f4)[_0xb543('0x35')]({'message':_0x150ae5?_0x150ae5[_0xb543('0x32')]||_0x150ae5:''});}exports[_0xb543('0x36')]=function(_0x51a099,_0xb1db9b,_0x2aadcc){passport[_0xb543('0x19')](_0xb543('0x37'),function(_0x1ac7c7,_0x2c7b0e,_0x50c84c){var _0x3a695a=_0x1ac7c7||_0x50c84c;if(_0x3a695a){return handleError(_0xb1db9b,0x191,_0x3a695a);}if(!_0x2c7b0e){return handleError(_0xb1db9b,0x194,{'message':_0xb543('0x38')});}else{var _0x3e1540={'payload':{'id':_0x2c7b0e['id'],'role':_0x2c7b0e['role']},'options':{'expiresIn':0x15180}};return authService[_0xb543('0x39')](_0x3e1540)[_0xb543('0xf')](function(_0x47af3a){_0xb1db9b['json']({'id':_0x2c7b0e['id'],'token':_0x47af3a,'statusCall':'','isAlreadyLogged':_0x2c7b0e[_0xb543('0x3a')]});});}})(_0x51a099,_0xb1db9b,_0x2aadcc);};exports[_0xb543('0x3b')]=function(_0x5c7e81,_0x50a77f,_0x229541){if(!_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')]){return handleError(_0x50a77f,0x1f4,{'message':_0xb543('0x3d')});}var _0x2b6614=rs[_0xb543('0x3e')]();_0x5c7e81['body'][_0xb543('0x21')]=_0x5c7e81['body'][_0xb543('0x21')][_0xb543('0x3f')]()[_0xb543('0x40')]();var _0x3abdaf;return db[_0xb543('0xc')][_0xb543('0xd')]({'where':{'id':0x1},'attributes':[_0xb543('0x1b'),_0xb543('0xe')],'raw':!![]})[_0xb543('0xf')](function(_0xc8920b){_0x3abdaf=_0xc8920b;return db[_0xb543('0x41')][_0xb543('0x42')]({'where':{'email':_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')]}});})[_0xb543('0xf')](function(_0x43bb79){if(!_0x43bb79){throw new Error(_0xb543('0x43'));}if(_0x43bb79[_0xb543('0x13')]){throw new Error(_0xb543('0x44'));}if(_0x43bb79[_0xb543('0x14')]){if(moment(_0x43bb79['blockedAt'])[_0xb543('0x1c')](_0x3abdaf['blockDuration'],_0xb543('0x1e'))>moment()){throw new Error(_0xb543('0x45'));}else{_0x43bb79[_0xb543('0x14')]=![];_0x43bb79['blockedAt']=null;}}_0x43bb79['resetPasswordToken']=_0x2b6614;_0x43bb79['resetPasswordExpires']=Date[_0xb543('0x46')]()+0x36ee80;return _0x43bb79[_0xb543('0x47')]();})['then'](function(){return sendServiceMail({'to':_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xb543('0x48')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xb543('0x49')+_0x5c7e81[_0xb543('0x4a')]['host']+_0xb543('0x4b')+_0x2b6614+'\x0a\x0a'+_0xb543('0x4c')});})[_0xb543('0xf')](function(){_0x50a77f[_0xb543('0x34')](0xc8)[_0xb543('0x35')]({'message':_0xb543('0x4d')});})[_0xb543('0x20')](function(_0xbe514a){return handleError(_0x50a77f,0x1f4,_0xbe514a);});};exports['reset']=function(_0x4d7087,_0x1bdbd4,_0x19fa7c){return db[_0xb543('0x41')][_0xb543('0x42')]({'where':{'resetPasswordToken':_0x4d7087['params'][_0xb543('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xb543('0x46')]()}}})[_0xb543('0xf')](function(_0x497e15){if(!_0x497e15){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xb543('0xc')][_0xb543('0xd')]({'attributes':['id','securePassword',_0xb543('0x4f'),_0xb543('0x50')]})[_0xb543('0xf')](function(_0x52b8d3){if(_0x52b8d3[_0xb543('0x51')])authService['validatePasswordPattern'](_0x4d7087['body']['password']);if(!_0x52b8d3[_0xb543('0x4f')]||!_0x497e15[_0xb543('0x52')])return _0x497e15;authService[_0xb543('0x53')](_0x4d7087[_0xb543('0x3c')][_0xb543('0x11')],_0x497e15[_0xb543('0x52')],_0x52b8d3[_0xb543('0x50')]);return _0x497e15;})[_0xb543('0xf')](function(){_0x497e15[_0xb543('0x11')]=_0x4d7087[_0xb543('0x3c')][_0xb543('0x11')];_0x497e15[_0xb543('0x54')]=null;_0x497e15['resetPasswordExpires']=null;return _0x497e15[_0xb543('0x47')]();});})[_0xb543('0xf')](function(){_0x1bdbd4['status'](0xc8)[_0xb543('0x35')]({'message':_0xb543('0x55')});})[_0xb543('0x20')](function(_0x226923){return handleError(_0x1bdbd4,0x1f4,_0x226923);});};passport[_0xb543('0x56')](_0xb543('0x37'),new LocalStrategy({'usernameField':'name','passwordField':_0xb543('0x11')},function(_0x5deb25,_0x59a403,_0x3b9cec){return localAuthenticate(db[_0xb543('0x41')],_0x5deb25,_0x59a403,_0x3b9cec);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c1aae88..12ab1fa 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 _0xb0f5=['Router','./authLocal.controller','post','/reset/:token','reset','exports','express'];(function(_0x28d7a8,_0x3e52a1){var _0x5d5a5c=function(_0x556bd3){while(--_0x556bd3){_0x28d7a8['push'](_0x28d7a8['shift']());}};_0x5d5a5c(++_0x3e52a1);}(_0xb0f5,0x1cd));var _0x5b0f=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb0f5[_0x36884e];return _0x1cc367;};'use strict';var express=require(_0x5b0f('0x0'));var router=express[_0x5b0f('0x1')]();var controller=require(_0x5b0f('0x2'));router[_0x5b0f('0x3')]('/',controller['login']);router['post']('/forgot',controller['forgot']);router[_0x5b0f('0x3')](_0x5b0f('0x4'),controller[_0x5b0f('0x5')]);module[_0x5b0f('0x6')]=router; \ No newline at end of file +var _0xa91c=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x3aa399,_0xb110bc){var _0x5a4dc9=function(_0x4e1b8f){while(--_0x4e1b8f){_0x3aa399['push'](_0x3aa399['shift']());}};_0x5a4dc9(++_0xb110bc);}(_0xa91c,0xda));var _0xca91=function(_0x2caae5,_0x23acda){_0x2caae5=_0x2caae5-0x0;var _0x5e1f96=_0xa91c[_0x2caae5];return _0x5e1f96;};'use strict';var express=require(_0xca91('0x0'));var router=express[_0xca91('0x1')]();var controller=require(_0xca91('0x2'));router[_0xca91('0x3')]('/',controller[_0xca91('0x4')]);router['post']('/forgot',controller[_0xca91('0x5')]);router[_0xca91('0x3')]('/reset/:token',controller[_0xca91('0x6')]);module[_0xca91('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 0f0c123..28b1900 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 _0x128f=['INTEGER','STRING','BOOLEAN'];(function(_0xca58b5,_0x21cc00){var _0x6c254b=function(_0x39c480){while(--_0x39c480){_0xca58b5['push'](_0xca58b5['shift']());}};_0x6c254b(++_0x21cc00);}(_0x128f,0xa0));var _0xf128=function(_0x4e9178,_0x5d09b7){_0x4e9178=_0x4e9178-0x0;var _0x278dbe=_0x128f[_0x4e9178];return _0x278dbe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf128('0x0')]},'status':{'type':Sequelize[_0xf128('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf128('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xbb53=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0xea8207,_0xa7aa07){var _0x54a40a=function(_0xec4503){while(--_0xec4503){_0xea8207['push'](_0xea8207['shift']());}};_0x54a40a(++_0xa7aa07);}(_0xbb53,0x124));var _0x3bb5=function(_0x552041,_0xc34ee7){_0x552041=_0x552041-0x0;var _0x198a1a=_0xbb53[_0x552041];return _0x198a1a;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3bb5('0x2')]},'description':{'type':Sequelize[_0x3bb5('0x2')]},'status':{'type':Sequelize[_0x3bb5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3bb5('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 979f826..97536c5 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 _0x60ce=['VIRTUAL','options','then','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','update','addConditions','Condition','ids','omit','getConditions','addActions','getActions','findOne','Action','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','index','map','Automation','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge'];(function(_0x535ee3,_0x439dfa){var _0x1cc2d0=function(_0x540422){while(--_0x540422){_0x535ee3['push'](_0x535ee3['shift']());}};_0x1cc2d0(++_0x439dfa);}(_0x60ce,0x70));var _0xe60c=function(_0x43cae5,_0x6ffe11){_0x43cae5=_0x43cae5-0x0;var _0x5e7250=_0x60ce[_0x43cae5];return _0x5e7250;};'use strict';var emlformat=require(_0xe60c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe60c('0x1'));var jsonpatch=require(_0xe60c('0x2'));var rp=require('request-promise');var moment=require(_0xe60c('0x3'));var BPromise=require(_0xe60c('0x4'));var Mustache=require(_0xe60c('0x5'));var util=require('util');var path=require(_0xe60c('0x6'));var sox=require(_0xe60c('0x7'));var csv=require(_0xe60c('0x8'));var ejs=require(_0xe60c('0x9'));var fs=require('fs');var fs_extra=require(_0xe60c('0xa'));var _=require(_0xe60c('0xb'));var squel=require(_0xe60c('0xc'));var crypto=require(_0xe60c('0xd'));var jsforce=require(_0xe60c('0xe'));var deskjs=require(_0xe60c('0xf'));var toCsv=require(_0xe60c('0x8'));var querystring=require(_0xe60c('0x10'));var Papa=require(_0xe60c('0x11'));var Redis=require(_0xe60c('0x12'));var authService=require(_0xe60c('0x13'));var qs=require(_0xe60c('0x14'));var as=require(_0xe60c('0x15'));var hardwareService=require(_0xe60c('0x16'));var logger=require(_0xe60c('0x17'))(_0xe60c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe60c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x576c89,_0x21624b){_0x21624b=_0x21624b||0xcc;return function(_0x52889c){if(_0x52889c){return _0x576c89[_0xe60c('0x1a')](_0x21624b);}return _0x576c89[_0xe60c('0x1b')](_0x21624b)[_0xe60c('0x1c')]();};}function respondWithResult(_0x4bcf2d,_0x18ef4a){_0x18ef4a=_0x18ef4a||0xc8;return function(_0x356017){if(_0x356017){return _0x4bcf2d[_0xe60c('0x1b')](_0x18ef4a)[_0xe60c('0x1d')](_0x356017);}};}function respondWithFilteredResult(_0x129ab9,_0x997be4){return function(_0x8c22c){if(_0x8c22c){var _0x1427b7=typeof _0x997be4[_0xe60c('0x1e')]===_0xe60c('0x1f')&&typeof _0x997be4[_0xe60c('0x20')]===_0xe60c('0x1f');var _0x2c8f68=_0x8c22c[_0xe60c('0x21')];var _0x215e22=_0x1427b7?0x0:_0x997be4[_0xe60c('0x1e')];var _0x2fbe7b=_0x1427b7?_0x8c22c[_0xe60c('0x21')]:_0x997be4['offset']+_0x997be4[_0xe60c('0x20')];var _0x2d96e7;if(_0x2fbe7b>=_0x2c8f68){_0x2fbe7b=_0x2c8f68;_0x2d96e7=0xc8;}else{_0x2d96e7=0xce;}_0x129ab9['status'](_0x2d96e7);return _0x129ab9[_0xe60c('0x22')](_0xe60c('0x23'),_0x215e22+'-'+_0x2fbe7b+'/'+_0x2c8f68)[_0xe60c('0x1d')](_0x8c22c);}return null;};}function patchUpdates(_0x53a29c){return function(_0x31c4b9){try{jsonpatch[_0xe60c('0x24')](_0x31c4b9,_0x53a29c,!![]);}catch(_0x55d374){return BPromise['reject'](_0x55d374);}return _0x31c4b9[_0xe60c('0x25')]();};}function saveUpdates(_0x426e18,_0x124c1e){return function(_0x1a19a9){if(_0x1a19a9){return _0x1a19a9['update'](_0x426e18)['then'](function(_0x1b1094){return _0x1b1094;});}return null;};}function removeEntity(_0x43cb53,_0x295357){return function(_0x19db72){if(_0x19db72){return _0x19db72[_0xe60c('0x26')]()['then'](function(){_0x43cb53[_0xe60c('0x1b')](0xcc)[_0xe60c('0x1c')]();});}};}function handleEntityNotFound(_0x3001e7,_0x35e314){return function(_0x2eaa73){if(!_0x2eaa73){_0x3001e7['sendStatus'](0x194);}return _0x2eaa73;};}function handleError(_0x1c4792,_0x61c2c){_0x61c2c=_0x61c2c||0x1f4;return function(_0x43c695){logger['error'](_0x43c695[_0xe60c('0x27')]);if(_0x43c695['name']){delete _0x43c695[_0xe60c('0x28')];}_0x1c4792[_0xe60c('0x1b')](_0x61c2c)[_0xe60c('0x29')](_0x43c695);};}exports[_0xe60c('0x2a')]=function(_0x203333,_0x4d4577){var _0x2b576a={},_0x461fa0={},_0x13e685={'count':0x0,'rows':[]};var _0xd47e53=_[_0xe60c('0x2b')](db[_0xe60c('0x2c')]['rawAttributes'],function(_0x59ad88){return{'name':_0x59ad88['fieldName'],'type':_0x59ad88[_0xe60c('0x2d')][_0xe60c('0x2e')]};});_0x461fa0[_0xe60c('0x2f')]=_[_0xe60c('0x2b')](_0xd47e53,_0xe60c('0x28'));_0x461fa0[_0xe60c('0x30')]=_['keys'](_0x203333[_0xe60c('0x30')]);_0x461fa0['filters']=_[_0xe60c('0x31')](_0x461fa0[_0xe60c('0x2f')],_0x461fa0['query']);_0x2b576a[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x461fa0[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x203333[_0xe60c('0x30')][_0xe60c('0x33')]));_0x2b576a['attributes']=_0x2b576a['attributes'][_0xe60c('0x34')]?_0x2b576a[_0xe60c('0x32')]:_0x461fa0[_0xe60c('0x2f')];if(!_0x203333[_0xe60c('0x30')][_0xe60c('0x35')](_0xe60c('0x36'))){_0x2b576a[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x203333[_0xe60c('0x30')][_0xe60c('0x20')]);_0x2b576a[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x203333['query']['offset']);}_0x2b576a[_0xe60c('0x37')]=qs['sort'](_0x203333[_0xe60c('0x30')][_0xe60c('0x38')]);_0x2b576a[_0xe60c('0x39')]=qs['filters'](_[_0xe60c('0x3a')](_0x203333[_0xe60c('0x30')],_0x461fa0[_0xe60c('0x3b')]),_0xd47e53);if(_0x203333[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x2b576a[_0xe60c('0x39')]=_[_0xe60c('0x3d')](_0x2b576a['where'],{'$or':_[_0xe60c('0x2b')](_0xd47e53,function(_0x560cc8){if(_0x560cc8[_0xe60c('0x2d')]!==_0xe60c('0x3e')){var _0x28a033={};_0x28a033[_0x560cc8[_0xe60c('0x28')]]={'$like':'%'+_0x203333[_0xe60c('0x30')][_0xe60c('0x3c')]+'%'};return _0x28a033;}})});}_0x2b576a=_['merge']({},_0x2b576a,_0x203333[_0xe60c('0x3f')]);var _0x1abfd3={'where':_0x2b576a[_0xe60c('0x39')]};return db[_0xe60c('0x2c')][_0xe60c('0x21')](_0x1abfd3)[_0xe60c('0x40')](function(_0x4dcb58){_0x13e685['count']=_0x4dcb58;if(_0x203333[_0xe60c('0x30')]['includeAll']){_0x2b576a[_0xe60c('0x41')]=[{'all':!![]}];}return db['Automation'][_0xe60c('0x42')](_0x2b576a);})[_0xe60c('0x40')](function(_0x267f4c){_0x13e685[_0xe60c('0x43')]=_0x267f4c;return _0x13e685;})[_0xe60c('0x40')](respondWithFilteredResult(_0x4d4577,_0x2b576a))[_0xe60c('0x44')](handleError(_0x4d4577,null));};exports[_0xe60c('0x45')]=function(_0x8f5f30,_0x4fb0e9){var _0x154e71={'raw':![],'where':{'id':_0x8f5f30[_0xe60c('0x46')]['id']}},_0x29081a={};_0x29081a['model']=_[_0xe60c('0x47')](db[_0xe60c('0x2c')][_0xe60c('0x48')]);_0x29081a[_0xe60c('0x30')]=_[_0xe60c('0x47')](_0x8f5f30[_0xe60c('0x30')]);_0x29081a[_0xe60c('0x3b')]=_[_0xe60c('0x31')](_0x29081a[_0xe60c('0x2f')],_0x29081a[_0xe60c('0x30')]);_0x154e71[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x29081a[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x8f5f30[_0xe60c('0x30')]['fields']));_0x154e71[_0xe60c('0x32')]=_0x154e71[_0xe60c('0x32')]['length']?_0x154e71[_0xe60c('0x32')]:_0x29081a[_0xe60c('0x2f')];if(_0x8f5f30[_0xe60c('0x30')][_0xe60c('0x49')]){_0x154e71[_0xe60c('0x41')]=[{'all':!![]}];}_0x154e71=_[_0xe60c('0x3d')]({},_0x154e71,_0x8f5f30['options']);return db[_0xe60c('0x2c')][_0xe60c('0x4a')](_0x154e71)['then'](handleEntityNotFound(_0x4fb0e9,null))[_0xe60c('0x40')](respondWithResult(_0x4fb0e9,null))[_0xe60c('0x44')](handleError(_0x4fb0e9,null));};exports[_0xe60c('0x4b')]=function(_0x282bf2,_0x2d4bd8){return db[_0xe60c('0x2c')][_0xe60c('0x4b')](_0x282bf2[_0xe60c('0x4c')],{})[_0xe60c('0x40')](respondWithResult(_0x2d4bd8,0xc9))[_0xe60c('0x44')](handleError(_0x2d4bd8,null));};exports[_0xe60c('0x4d')]=function(_0x4a5c2a,_0x53ce82){if(_0x4a5c2a[_0xe60c('0x4c')]['id']){delete _0x4a5c2a[_0xe60c('0x4c')]['id'];}return db['Automation']['find']({'where':{'id':_0x4a5c2a['params']['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x53ce82,null))[_0xe60c('0x40')](saveUpdates(_0x4a5c2a['body'],null))['then'](respondWithResult(_0x53ce82,null))[_0xe60c('0x44')](handleError(_0x53ce82,null));};exports['destroy']=function(_0x2aed85,_0x1dae5e){return db[_0xe60c('0x2c')]['find']({'where':{'id':_0x2aed85[_0xe60c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dae5e,null))['then'](removeEntity(_0x1dae5e,null))['catch'](handleError(_0x1dae5e,null));};exports[_0xe60c('0x4e')]=function(_0x205a44,_0x575a8f,_0x36942e){return db[_0xe60c('0x4f')]['find']({'where':{'id':_0x205a44[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x575a8f,null))['then'](function(_0x26d221){if(_0x26d221){return _0x26d221[_0xe60c('0x4e')](_0x205a44[_0xe60c('0x4c')][_0xe60c('0x50')],_[_0xe60c('0x51')](_0x205a44[_0xe60c('0x4c')],['ids','id'])||{});}})[_0xe60c('0x40')](respondWithResult(_0x575a8f,null))[_0xe60c('0x44')](handleError(_0x575a8f,null));};exports[_0xe60c('0x52')]=function(_0x1c8bfd,_0x4a6be8,_0x48c6f3){var _0x1e25bc={};var _0x864d6b={};var _0x1ac8f5;var _0xf43f75;return db['Automation']['findOne']({'where':{'id':_0x1c8bfd[_0xe60c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a6be8,null))[_0xe60c('0x40')](function(_0x4239ea){if(_0x4239ea){_0x1ac8f5=_0x4239ea;_0x864d6b[_0xe60c('0x2f')]=_[_0xe60c('0x47')](db[_0xe60c('0x4f')][_0xe60c('0x48')]);_0x864d6b['query']=_[_0xe60c('0x47')](_0x1c8bfd[_0xe60c('0x30')]);_0x864d6b[_0xe60c('0x3b')]=_['intersection'](_0x864d6b['model'],_0x864d6b[_0xe60c('0x30')]);_0x1e25bc[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x864d6b['model'],qs[_0xe60c('0x33')](_0x1c8bfd['query'][_0xe60c('0x33')]));_0x1e25bc[_0xe60c('0x32')]=_0x1e25bc[_0xe60c('0x32')]['length']?_0x1e25bc[_0xe60c('0x32')]:_0x864d6b[_0xe60c('0x2f')];_0x1e25bc['order']=qs[_0xe60c('0x38')](_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x38')]);_0x1e25bc[_0xe60c('0x39')]=qs[_0xe60c('0x3b')](_['pick'](_0x1c8bfd[_0xe60c('0x30')],_0x864d6b['filters']));if(_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x1e25bc[_0xe60c('0x39')]=_[_0xe60c('0x3d')](_0x1e25bc['where'],{'$or':_[_0xe60c('0x2b')](_0x1e25bc[_0xe60c('0x32')],function(_0x16c20f){var _0x1b6e9e={};_0x1b6e9e[_0x16c20f]={'$like':'%'+_0x1c8bfd[_0xe60c('0x30')]['filter']+'%'};return _0x1b6e9e;})});}_0x1e25bc=_[_0xe60c('0x3d')]({},_0x1e25bc,_0x1c8bfd[_0xe60c('0x3f')]);return _0x1ac8f5['getConditions'](_0x1e25bc);}})['then'](function(_0x1bbccf){if(_0x1bbccf){_0xf43f75=_0x1bbccf[_0xe60c('0x34')];if(!_0x1c8bfd[_0xe60c('0x30')]['hasOwnProperty'](_0xe60c('0x36'))){_0x1e25bc[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x1c8bfd['query'][_0xe60c('0x20')]);_0x1e25bc[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x1e')]);}return _0x1ac8f5[_0xe60c('0x52')](_0x1e25bc);}})[_0xe60c('0x40')](function(_0x413038){if(_0x413038){return _0x413038?{'count':_0xf43f75,'rows':_0x413038}:null;}})[_0xe60c('0x40')](respondWithResult(_0x4a6be8,null))[_0xe60c('0x44')](handleError(_0x4a6be8,null));};exports[_0xe60c('0x53')]=function(_0x109114,_0x2b3248,_0x139086){return db['Action']['find']({'where':{'id':_0x109114[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x2b3248,null))[_0xe60c('0x40')](function(_0x4c0294){if(_0x4c0294){return _0x4c0294[_0xe60c('0x53')](_0x109114['body'][_0xe60c('0x50')],_[_0xe60c('0x51')](_0x109114[_0xe60c('0x4c')],[_0xe60c('0x50'),'id'])||{});}})[_0xe60c('0x40')](respondWithResult(_0x2b3248,null))[_0xe60c('0x44')](handleError(_0x2b3248,null));};exports[_0xe60c('0x54')]=function(_0x1d2351,_0x12d484,_0x76fe7a){var _0x31a70c={};var _0x5516f4={};var _0x3792c0;var _0x333318;return db['Automation'][_0xe60c('0x55')]({'where':{'id':_0x1d2351[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x12d484,null))[_0xe60c('0x40')](function(_0x33b04c){if(_0x33b04c){_0x3792c0=_0x33b04c;_0x5516f4[_0xe60c('0x2f')]=_[_0xe60c('0x47')](db[_0xe60c('0x56')][_0xe60c('0x48')]);_0x5516f4['query']=_[_0xe60c('0x47')](_0x1d2351['query']);_0x5516f4[_0xe60c('0x3b')]=_[_0xe60c('0x31')](_0x5516f4[_0xe60c('0x2f')],_0x5516f4[_0xe60c('0x30')]);_0x31a70c[_0xe60c('0x32')]=_['intersection'](_0x5516f4[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x1d2351['query']['fields']));_0x31a70c[_0xe60c('0x32')]=_0x31a70c['attributes']['length']?_0x31a70c[_0xe60c('0x32')]:_0x5516f4[_0xe60c('0x2f')];_0x31a70c[_0xe60c('0x37')]=qs['sort'](_0x1d2351[_0xe60c('0x30')][_0xe60c('0x38')]);_0x31a70c[_0xe60c('0x39')]=qs[_0xe60c('0x3b')](_[_0xe60c('0x3a')](_0x1d2351[_0xe60c('0x30')],_0x5516f4['filters']));if(_0x1d2351[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x31a70c[_0xe60c('0x39')]=_['merge'](_0x31a70c[_0xe60c('0x39')],{'$or':_[_0xe60c('0x2b')](_0x31a70c[_0xe60c('0x32')],function(_0x13d4fd){var _0x387166={};_0x387166[_0x13d4fd]={'$like':'%'+_0x1d2351[_0xe60c('0x30')][_0xe60c('0x3c')]+'%'};return _0x387166;})});}_0x31a70c=_['merge']({},_0x31a70c,_0x1d2351[_0xe60c('0x3f')]);return _0x3792c0['getActions'](_0x31a70c);}})[_0xe60c('0x40')](function(_0x27b28f){if(_0x27b28f){_0x333318=_0x27b28f['length'];if(!_0x1d2351[_0xe60c('0x30')][_0xe60c('0x35')](_0xe60c('0x36'))){_0x31a70c[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x1d2351[_0xe60c('0x30')][_0xe60c('0x20')]);_0x31a70c[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x1d2351['query'][_0xe60c('0x1e')]);}return _0x3792c0['getActions'](_0x31a70c);}})[_0xe60c('0x40')](function(_0x5c8d03){if(_0x5c8d03){return _0x5c8d03?{'count':_0x333318,'rows':_0x5c8d03}:null;}})[_0xe60c('0x40')](respondWithResult(_0x12d484,null))[_0xe60c('0x44')](handleError(_0x12d484,null));}; \ No newline at end of file +var _0x8366=['index','map','rawAttributes','fieldName','type','key','query','attributes','intersection','fields','length','model','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','merge','options','Automation','includeAll','include','rows','params','keys','find','catch','body','addConditions','Condition','ids','getConditions','pick','Action','addActions','omit','getActions','findOne','eml-format','rimraf','zip-dir','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','end','error','name','send'];(function(_0x484e64,_0x459f04){var _0x218ce8=function(_0x1d8c5f){while(--_0x1d8c5f){_0x484e64['push'](_0x484e64['shift']());}};_0x218ce8(++_0x459f04);}(_0x8366,0x11b));var _0x6836=function(_0x42fa9d,_0x51add9){_0x42fa9d=_0x42fa9d-0x0;var _0x148963=_0x8366[_0x42fa9d];return _0x148963;};'use strict';var emlformat=require(_0x6836('0x0'));var rimraf=require(_0x6836('0x1'));var zipdir=require(_0x6836('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6836('0x3'));var Mustache=require('mustache');var util=require(_0x6836('0x4'));var path=require(_0x6836('0x5'));var sox=require(_0x6836('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6836('0x7'));var _=require(_0x6836('0x8'));var squel=require('squel');var crypto=require(_0x6836('0x9'));var jsforce=require(_0x6836('0xa'));var deskjs=require(_0x6836('0xb'));var toCsv=require(_0x6836('0xc'));var querystring=require(_0x6836('0xd'));var Papa=require(_0x6836('0xe'));var Redis=require(_0x6836('0xf'));var authService=require(_0x6836('0x10'));var qs=require(_0x6836('0x11'));var as=require(_0x6836('0x12'));var hardwareService=require(_0x6836('0x13'));var logger=require(_0x6836('0x14'))('api');var utils=require(_0x6836('0x15'));var config=require(_0x6836('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6836('0x17'))['db'];function respondWithStatusCode(_0x59f213,_0xb49b3d){_0xb49b3d=_0xb49b3d||0xcc;return function(_0x388568){if(_0x388568){return _0x59f213[_0x6836('0x18')](_0xb49b3d);}return _0x59f213[_0x6836('0x19')](_0xb49b3d)['end']();};}function respondWithResult(_0x3f929c,_0x1c761b){_0x1c761b=_0x1c761b||0xc8;return function(_0x4cb7f2){if(_0x4cb7f2){return _0x3f929c['status'](_0x1c761b)[_0x6836('0x1a')](_0x4cb7f2);}};}function respondWithFilteredResult(_0x24d525,_0xdc1f66){return function(_0x46af2d){if(_0x46af2d){var _0x37e257=typeof _0xdc1f66['offset']===_0x6836('0x1b')&&typeof _0xdc1f66[_0x6836('0x1c')]===_0x6836('0x1b');var _0x3c0f45=_0x46af2d[_0x6836('0x1d')];var _0x1d5de9=_0x37e257?0x0:_0xdc1f66[_0x6836('0x1e')];var _0x4e1b03=_0x37e257?_0x46af2d[_0x6836('0x1d')]:_0xdc1f66[_0x6836('0x1e')]+_0xdc1f66['limit'];var _0x227b61;if(_0x4e1b03>=_0x3c0f45){_0x4e1b03=_0x3c0f45;_0x227b61=0xc8;}else{_0x227b61=0xce;}_0x24d525[_0x6836('0x19')](_0x227b61);return _0x24d525[_0x6836('0x1f')](_0x6836('0x20'),_0x1d5de9+'-'+_0x4e1b03+'/'+_0x3c0f45)[_0x6836('0x1a')](_0x46af2d);}return null;};}function patchUpdates(_0x3b1cb1){return function(_0x1fe869){try{jsonpatch['apply'](_0x1fe869,_0x3b1cb1,!![]);}catch(_0x21773f){return BPromise[_0x6836('0x21')](_0x21773f);}return _0x1fe869['save']();};}function saveUpdates(_0x3f848d,_0x38ac87){return function(_0x40de5f){if(_0x40de5f){return _0x40de5f[_0x6836('0x22')](_0x3f848d)[_0x6836('0x23')](function(_0x2ff596){return _0x2ff596;});}return null;};}function removeEntity(_0x1d2d21,_0x3ace74){return function(_0x7d2353){if(_0x7d2353){return _0x7d2353[_0x6836('0x24')]()['then'](function(){_0x1d2d21[_0x6836('0x19')](0xcc)[_0x6836('0x25')]();});}};}function handleEntityNotFound(_0x56f20f,_0x47e1ea){return function(_0x3d9269){if(!_0x3d9269){_0x56f20f[_0x6836('0x18')](0x194);}return _0x3d9269;};}function handleError(_0x5df4fc,_0x2718a6){_0x2718a6=_0x2718a6||0x1f4;return function(_0x540989){logger[_0x6836('0x26')](_0x540989['stack']);if(_0x540989[_0x6836('0x27')]){delete _0x540989[_0x6836('0x27')];}_0x5df4fc[_0x6836('0x19')](_0x2718a6)[_0x6836('0x28')](_0x540989);};}exports[_0x6836('0x29')]=function(_0x5addda,_0x5a27ff){var _0x15c6e6={},_0x2e702b={},_0x30f2b7={'count':0x0,'rows':[]};var _0x246261=_[_0x6836('0x2a')](db['Automation'][_0x6836('0x2b')],function(_0x4ce0e5){return{'name':_0x4ce0e5[_0x6836('0x2c')],'type':_0x4ce0e5[_0x6836('0x2d')][_0x6836('0x2e')]};});_0x2e702b['model']=_[_0x6836('0x2a')](_0x246261,_0x6836('0x27'));_0x2e702b[_0x6836('0x2f')]=_['keys'](_0x5addda[_0x6836('0x2f')]);_0x2e702b['filters']=_['intersection'](_0x2e702b['model'],_0x2e702b['query']);_0x15c6e6[_0x6836('0x30')]=_[_0x6836('0x31')](_0x2e702b['model'],qs['fields'](_0x5addda[_0x6836('0x2f')][_0x6836('0x32')]));_0x15c6e6[_0x6836('0x30')]=_0x15c6e6[_0x6836('0x30')][_0x6836('0x33')]?_0x15c6e6['attributes']:_0x2e702b[_0x6836('0x34')];if(!_0x5addda[_0x6836('0x2f')][_0x6836('0x35')]('nolimit')){_0x15c6e6['limit']=qs[_0x6836('0x1c')](_0x5addda['query']['limit']);_0x15c6e6['offset']=qs['offset'](_0x5addda[_0x6836('0x2f')][_0x6836('0x1e')]);}_0x15c6e6[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x5addda[_0x6836('0x2f')]['sort']);_0x15c6e6['where']=qs[_0x6836('0x38')](_['pick'](_0x5addda[_0x6836('0x2f')],_0x2e702b['filters']),_0x246261);if(_0x5addda[_0x6836('0x2f')][_0x6836('0x39')]){_0x15c6e6[_0x6836('0x3a')]=_['merge'](_0x15c6e6['where'],{'$or':_[_0x6836('0x2a')](_0x246261,function(_0x45fbf3){if(_0x45fbf3[_0x6836('0x2d')]!==_0x6836('0x3b')){var _0x40270f={};_0x40270f[_0x45fbf3[_0x6836('0x27')]]={'$like':'%'+_0x5addda['query']['filter']+'%'};return _0x40270f;}})});}_0x15c6e6=_[_0x6836('0x3c')]({},_0x15c6e6,_0x5addda[_0x6836('0x3d')]);var _0x545151={'where':_0x15c6e6['where']};return db[_0x6836('0x3e')][_0x6836('0x1d')](_0x545151)[_0x6836('0x23')](function(_0x285648){_0x30f2b7['count']=_0x285648;if(_0x5addda[_0x6836('0x2f')][_0x6836('0x3f')]){_0x15c6e6[_0x6836('0x40')]=[{'all':!![]}];}return db[_0x6836('0x3e')]['findAll'](_0x15c6e6);})[_0x6836('0x23')](function(_0x3d8410){_0x30f2b7[_0x6836('0x41')]=_0x3d8410;return _0x30f2b7;})['then'](respondWithFilteredResult(_0x5a27ff,_0x15c6e6))['catch'](handleError(_0x5a27ff,null));};exports['show']=function(_0x557dbc,_0x551f85){var _0x5aa8f8={'raw':![],'where':{'id':_0x557dbc[_0x6836('0x42')]['id']}},_0x47d88c={};_0x47d88c[_0x6836('0x34')]=_['keys'](db[_0x6836('0x3e')][_0x6836('0x2b')]);_0x47d88c[_0x6836('0x2f')]=_[_0x6836('0x43')](_0x557dbc['query']);_0x47d88c['filters']=_['intersection'](_0x47d88c[_0x6836('0x34')],_0x47d88c[_0x6836('0x2f')]);_0x5aa8f8[_0x6836('0x30')]=_[_0x6836('0x31')](_0x47d88c[_0x6836('0x34')],qs[_0x6836('0x32')](_0x557dbc[_0x6836('0x2f')][_0x6836('0x32')]));_0x5aa8f8['attributes']=_0x5aa8f8[_0x6836('0x30')][_0x6836('0x33')]?_0x5aa8f8[_0x6836('0x30')]:_0x47d88c['model'];if(_0x557dbc[_0x6836('0x2f')][_0x6836('0x3f')]){_0x5aa8f8[_0x6836('0x40')]=[{'all':!![]}];}_0x5aa8f8=_['merge']({},_0x5aa8f8,_0x557dbc['options']);return db[_0x6836('0x3e')][_0x6836('0x44')](_0x5aa8f8)['then'](handleEntityNotFound(_0x551f85,null))[_0x6836('0x23')](respondWithResult(_0x551f85,null))[_0x6836('0x45')](handleError(_0x551f85,null));};exports['create']=function(_0x3b5285,_0x55ba1d){return db[_0x6836('0x3e')]['create'](_0x3b5285[_0x6836('0x46')],{})['then'](respondWithResult(_0x55ba1d,0xc9))[_0x6836('0x45')](handleError(_0x55ba1d,null));};exports['update']=function(_0x3306bd,_0x5336d3){if(_0x3306bd[_0x6836('0x46')]['id']){delete _0x3306bd['body']['id'];}return db[_0x6836('0x3e')][_0x6836('0x44')]({'where':{'id':_0x3306bd[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5336d3,null))['then'](saveUpdates(_0x3306bd[_0x6836('0x46')],null))[_0x6836('0x23')](respondWithResult(_0x5336d3,null))[_0x6836('0x45')](handleError(_0x5336d3,null));};exports[_0x6836('0x24')]=function(_0xadde5a,_0x52403d){return db['Automation'][_0x6836('0x44')]({'where':{'id':_0xadde5a[_0x6836('0x42')]['id']}})['then'](handleEntityNotFound(_0x52403d,null))['then'](removeEntity(_0x52403d,null))[_0x6836('0x45')](handleError(_0x52403d,null));};exports[_0x6836('0x47')]=function(_0x4a9c33,_0x5162e0,_0x554e85){return db[_0x6836('0x48')][_0x6836('0x44')]({'where':{'id':_0x4a9c33['params']['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5162e0,null))[_0x6836('0x23')](function(_0xdbf0){if(_0xdbf0){return _0xdbf0[_0x6836('0x47')](_0x4a9c33[_0x6836('0x46')][_0x6836('0x49')],_['omit'](_0x4a9c33[_0x6836('0x46')],[_0x6836('0x49'),'id'])||{});}})[_0x6836('0x23')](respondWithResult(_0x5162e0,null))['catch'](handleError(_0x5162e0,null));};exports[_0x6836('0x4a')]=function(_0x1c6ce7,_0x5e596a,_0x32f6ec){var _0x36e0f9={};var _0x5b5658={};var _0x210c2b;var _0x4636bd;return db['Automation']['findOne']({'where':{'id':_0x1c6ce7[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5e596a,null))[_0x6836('0x23')](function(_0x915396){if(_0x915396){_0x210c2b=_0x915396;_0x5b5658[_0x6836('0x34')]=_[_0x6836('0x43')](db['Condition'][_0x6836('0x2b')]);_0x5b5658['query']=_[_0x6836('0x43')](_0x1c6ce7['query']);_0x5b5658[_0x6836('0x38')]=_[_0x6836('0x31')](_0x5b5658[_0x6836('0x34')],_0x5b5658[_0x6836('0x2f')]);_0x36e0f9[_0x6836('0x30')]=_[_0x6836('0x31')](_0x5b5658[_0x6836('0x34')],qs['fields'](_0x1c6ce7['query'][_0x6836('0x32')]));_0x36e0f9[_0x6836('0x30')]=_0x36e0f9[_0x6836('0x30')][_0x6836('0x33')]?_0x36e0f9[_0x6836('0x30')]:_0x5b5658['model'];_0x36e0f9[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x1c6ce7[_0x6836('0x2f')]['sort']);_0x36e0f9[_0x6836('0x3a')]=qs[_0x6836('0x38')](_[_0x6836('0x4b')](_0x1c6ce7[_0x6836('0x2f')],_0x5b5658[_0x6836('0x38')]));if(_0x1c6ce7[_0x6836('0x2f')]['filter']){_0x36e0f9[_0x6836('0x3a')]=_[_0x6836('0x3c')](_0x36e0f9[_0x6836('0x3a')],{'$or':_[_0x6836('0x2a')](_0x36e0f9[_0x6836('0x30')],function(_0x57f37c){var _0xa5e5e9={};_0xa5e5e9[_0x57f37c]={'$like':'%'+_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x39')]+'%'};return _0xa5e5e9;})});}_0x36e0f9=_[_0x6836('0x3c')]({},_0x36e0f9,_0x1c6ce7[_0x6836('0x3d')]);return _0x210c2b[_0x6836('0x4a')](_0x36e0f9);}})['then'](function(_0x23da0a){if(_0x23da0a){_0x4636bd=_0x23da0a[_0x6836('0x33')];if(!_0x1c6ce7['query'][_0x6836('0x35')]('nolimit')){_0x36e0f9[_0x6836('0x1c')]=qs[_0x6836('0x1c')](_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x1c')]);_0x36e0f9[_0x6836('0x1e')]=qs[_0x6836('0x1e')](_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x1e')]);}return _0x210c2b[_0x6836('0x4a')](_0x36e0f9);}})['then'](function(_0x775eff){if(_0x775eff){return _0x775eff?{'count':_0x4636bd,'rows':_0x775eff}:null;}})[_0x6836('0x23')](respondWithResult(_0x5e596a,null))[_0x6836('0x45')](handleError(_0x5e596a,null));};exports['addActions']=function(_0x2e1aba,_0x306c90,_0x2a5a95){return db[_0x6836('0x4c')][_0x6836('0x44')]({'where':{'id':_0x2e1aba[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x306c90,null))[_0x6836('0x23')](function(_0x4a8acb){if(_0x4a8acb){return _0x4a8acb[_0x6836('0x4d')](_0x2e1aba[_0x6836('0x46')]['ids'],_[_0x6836('0x4e')](_0x2e1aba['body'],['ids','id'])||{});}})[_0x6836('0x23')](respondWithResult(_0x306c90,null))[_0x6836('0x45')](handleError(_0x306c90,null));};exports[_0x6836('0x4f')]=function(_0x477efe,_0x252085,_0x37b088){var _0x419700={};var _0x4a30fe={};var _0x123853;var _0x54191d;return db[_0x6836('0x3e')][_0x6836('0x50')]({'where':{'id':_0x477efe[_0x6836('0x42')]['id']}})['then'](handleEntityNotFound(_0x252085,null))[_0x6836('0x23')](function(_0x1f8272){if(_0x1f8272){_0x123853=_0x1f8272;_0x4a30fe[_0x6836('0x34')]=_['keys'](db[_0x6836('0x4c')][_0x6836('0x2b')]);_0x4a30fe[_0x6836('0x2f')]=_['keys'](_0x477efe[_0x6836('0x2f')]);_0x4a30fe[_0x6836('0x38')]=_[_0x6836('0x31')](_0x4a30fe['model'],_0x4a30fe[_0x6836('0x2f')]);_0x419700[_0x6836('0x30')]=_['intersection'](_0x4a30fe[_0x6836('0x34')],qs[_0x6836('0x32')](_0x477efe[_0x6836('0x2f')][_0x6836('0x32')]));_0x419700[_0x6836('0x30')]=_0x419700[_0x6836('0x30')][_0x6836('0x33')]?_0x419700[_0x6836('0x30')]:_0x4a30fe[_0x6836('0x34')];_0x419700[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x477efe[_0x6836('0x2f')][_0x6836('0x37')]);_0x419700[_0x6836('0x3a')]=qs[_0x6836('0x38')](_[_0x6836('0x4b')](_0x477efe[_0x6836('0x2f')],_0x4a30fe[_0x6836('0x38')]));if(_0x477efe[_0x6836('0x2f')][_0x6836('0x39')]){_0x419700[_0x6836('0x3a')]=_['merge'](_0x419700[_0x6836('0x3a')],{'$or':_['map'](_0x419700[_0x6836('0x30')],function(_0x1393a8){var _0x17322f={};_0x17322f[_0x1393a8]={'$like':'%'+_0x477efe[_0x6836('0x2f')]['filter']+'%'};return _0x17322f;})});}_0x419700=_[_0x6836('0x3c')]({},_0x419700,_0x477efe[_0x6836('0x3d')]);return _0x123853[_0x6836('0x4f')](_0x419700);}})[_0x6836('0x23')](function(_0x2a79a8){if(_0x2a79a8){_0x54191d=_0x2a79a8[_0x6836('0x33')];if(!_0x477efe[_0x6836('0x2f')][_0x6836('0x35')]('nolimit')){_0x419700[_0x6836('0x1c')]=qs['limit'](_0x477efe[_0x6836('0x2f')][_0x6836('0x1c')]);_0x419700['offset']=qs[_0x6836('0x1e')](_0x477efe[_0x6836('0x2f')][_0x6836('0x1e')]);}return _0x123853[_0x6836('0x4f')](_0x419700);}})['then'](function(_0x114c39){if(_0x114c39){return _0x114c39?{'count':_0x54191d,'rows':_0x114c39}:null;}})[_0x6836('0x23')](respondWithResult(_0x252085,null))[_0x6836('0x45')](handleError(_0x252085,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 128a7eb..eb22eda 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 _0x2cb0=['define','Automation','tools_automations','lodash','util','../../config/logger','api','request-promise','rimraf','./automation.attributes','exports'];(function(_0x48fc57,_0x179633){var _0x2afb6a=function(_0x229e94){while(--_0x229e94){_0x48fc57['push'](_0x48fc57['shift']());}};_0x2afb6a(++_0x179633);}(_0x2cb0,0x137));var _0x02cb=function(_0x32d3cd,_0x353cb1){_0x32d3cd=_0x32d3cd-0x0;var _0x100006=_0x2cb0[_0x32d3cd];return _0x100006;};'use strict';var _=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var logger=require(_0x02cb('0x2'))(_0x02cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x02cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02cb('0x5'));var config=require('../../config/environment');var attributes=require(_0x02cb('0x6'));module[_0x02cb('0x7')]=function(_0x218024,_0x3e3e5b){return _0x218024[_0x02cb('0x8')](_0x02cb('0x9'),attributes,{'tableName':_0x02cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdaca=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x2e0546,_0xb7003f){var _0x3e45e0=function(_0x409b87){while(--_0x409b87){_0x2e0546['push'](_0x2e0546['shift']());}};_0x3e45e0(++_0xb7003f);}(_0xdaca,0x1ca));var _0xadac=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0xdaca[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require(_0xadac('0x0'));var util=require(_0xadac('0x1'));var logger=require(_0xadac('0x2'))('api');var moment=require(_0xadac('0x3'));var BPromise=require(_0xadac('0x4'));var rp=require(_0xadac('0x5'));var fs=require('fs');var path=require(_0xadac('0x6'));var rimraf=require(_0xadac('0x7'));var config=require('../../config/environment');var attributes=require(_0xadac('0x8'));module[_0xadac('0x9')]=function(_0x1e5c81,_0x38dff4){return _0x1e5c81[_0xadac('0xa')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 0ded98d..542d159 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 _0x110e=['ioredis','../../mysqldb','../../config/utils','client','request','then','info','request\x20sent','debug','stringify','error','message','Automation,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x110e,0x68));var _0xe110=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x110e[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var moment=require('moment');var BPromise=require(_0xe110('0x2'));var rs=require(_0xe110('0x3'));var fs=require('fs');var Redis=require(_0xe110('0x4'));var db=require(_0xe110('0x5'))['db'];var utils=require(_0xe110('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe110('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd83c,_0x1ebbac,_0x2b69c5){return new BPromise(function(_0x23c5ae,_0x44050a){return client[_0xe110('0x8')](_0x3dd83c,_0x2b69c5)[_0xe110('0x9')](function(_0x3c194a){logger[_0xe110('0xa')]('Automation,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'));logger[_0xe110('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'),JSON[_0xe110('0xd')](_0x3c194a));if(_0x3c194a[_0xe110('0xe')]){if(_0x3c194a[_0xe110('0xe')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1ebbac,_0x3c194a[_0xe110('0xe')][_0xe110('0xf')]);return _0x44050a(_0x3c194a['error']['message']);}logger['error'](_0xe110('0x10'),_0x1ebbac,_0x3c194a[_0xe110('0xe')]['message']);return _0x23c5ae(_0x3c194a['error'][_0xe110('0xf')]);}else{logger['info'](_0xe110('0x10'),_0x1ebbac,_0xe110('0xb'));_0x23c5ae(_0x3c194a[_0xe110('0x11')][_0xe110('0xf')]);}})['catch'](function(_0xa23c0c){logger[_0xe110('0xe')]('Automation,\x20%s,\x20%s',_0x1ebbac,_0xa23c0c);_0x44050a(_0xa23c0c);});});} \ No newline at end of file +var _0x3fce=['info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then'];(function(_0x4579fd,_0x436cbc){var _0x4d86f3=function(_0xa1ed87){while(--_0xa1ed87){_0x4579fd['push'](_0x4579fd['shift']());}};_0x4d86f3(++_0x436cbc);}(_0x3fce,0x121));var _0xe3fc=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x3fce[_0x59f0dc];return _0x5b5445;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var moment=require(_0xe3fc('0x1'));var BPromise=require(_0xe3fc('0x2'));var rs=require(_0xe3fc('0x3'));var fs=require('fs');var Redis=require(_0xe3fc('0x4'));var db=require(_0xe3fc('0x5'))['db'];var utils=require(_0xe3fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe3fc('0x7')][_0xe3fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x523982,_0x200715,_0x49c611){return new BPromise(function(_0x40660f,_0x4a192d){return client[_0xe3fc('0x9')](_0x523982,_0x49c611)[_0xe3fc('0xa')](function(_0x1bb7be){logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');logger['debug'](_0xe3fc('0xd'),_0x200715,_0xe3fc('0xe'),JSON[_0xe3fc('0xf')](_0x1bb7be));if(_0x1bb7be['error']){if(_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x11')]===0x1f4){logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x12')]);return _0x4a192d(_0x1bb7be[_0xe3fc('0x10')]['message']);}logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be['error'][_0xe3fc('0x12')]);return _0x40660f(_0x1bb7be[_0xe3fc('0x10')]['message']);}else{logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');_0x40660f(_0x1bb7be['result']['message']);}})[_0xe3fc('0x13')](function(_0x4283be){logger[_0xe3fc('0x10')]('Automation,\x20%s,\x20%s',_0x200715,_0x4283be);_0x4a192d(_0x4283be);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6271882..a772969 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 _0x2a8d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','destroy'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x406ba5,_0x39fa4b){_0x406ba5=_0x406ba5-0x0;var _0x557db7=_0x2a8d[_0x406ba5];return _0x557db7;};'use strict';var multer=require(_0xd2a8('0x0'));var util=require(_0xd2a8('0x1'));var path=require(_0xd2a8('0x2'));var timeout=require(_0xd2a8('0x3'));var express=require(_0xd2a8('0x4'));var router=express[_0xd2a8('0x5')]();var fs_extra=require(_0xd2a8('0x6'));var auth=require(_0xd2a8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2a8('0x8'));router[_0xd2a8('0x9')]('/',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xb')]);router[_0xd2a8('0x9')](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xd')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xd2a8('0x9')](_0xd2a8('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xd2a8('0xf')]('/',auth[_0xd2a8('0xa')](),controller['create']);router[_0xd2a8('0xf')](_0xd2a8('0x10'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x11')]);router[_0xd2a8('0xf')](_0xd2a8('0xe'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x12')]);router[_0xd2a8('0x13')]('/:id',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x14')]);router['delete'](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x077a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x077a,0x1f2));var _0xa077=function(_0x236380,_0x25476c){_0x236380=_0x236380-0x0;var _0x2e4104=_0x077a[_0x236380];return _0x2e4104;};'use strict';var multer=require(_0xa077('0x0'));var util=require('util');var path=require(_0xa077('0x1'));var timeout=require(_0xa077('0x2'));var express=require(_0xa077('0x3'));var router=express[_0xa077('0x4')]();var fs_extra=require(_0xa077('0x5'));var auth=require(_0xa077('0x6'));var interaction=require(_0xa077('0x7'));var config=require(_0xa077('0x8'));var controller=require('./automation.controller');router[_0xa077('0x9')]('/',auth[_0xa077('0xa')](),controller['index']);router['get']('/:id',auth[_0xa077('0xa')](),controller[_0xa077('0xb')]);router['get']('/:id/conditions',auth[_0xa077('0xa')](),controller[_0xa077('0xc')]);router[_0xa077('0x9')](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0xe')]);router[_0xa077('0xf')]('/',auth['isAuthenticated'](),controller[_0xa077('0x10')]);router[_0xa077('0xf')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller['addConditions']);router['post'](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0x12')]);router[_0xa077('0x13')](_0xa077('0x14'),auth[_0xa077('0xa')](),controller[_0xa077('0x15')]);router[_0xa077('0x16')](_0xa077('0x14'),auth[_0xa077('0xa')](),controller[_0xa077('0x17')]);module[_0xa077('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 40c22f2..7c24c14 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 _0x88de=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x88de,0x19c));var _0xe88d=function(_0x301f56,_0x4a41b6){_0x301f56=_0x301f56-0x0;var _0x2e45ad=_0x88de[_0x301f56];return _0x2e45ad;};'use strict';var Sequelize=require(_0xe88d('0x0'));module[_0xe88d('0x1')]={'name':{'type':Sequelize[_0xe88d('0x2')],'unique':_0xe88d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe88d('0x2')]},'active':{'type':Sequelize[_0xe88d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xe88d('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe88d('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe88d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe88d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe88d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xe88d('0xd')](_0xe88d('0xe'),_0xe88d('0xf'),'onlyIfOpen'),'defaultValue':_0xe88d('0xe')},'dialAMDActive':{'type':Sequelize[_0xe88d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe88d('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe88d('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe88d('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe88d('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe88d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe88d('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe88d('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe88d('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe88d('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe88d('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe88d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe88d('0xd')](_0xe88d('0x19'),_0xe88d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe88d('0x1b')},'dialCutDigit':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe88d('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x23')}}; \ No newline at end of file +var _0xbd38=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2ba979,_0x1ba808){var _0x35e643=function(_0x1ee295){while(--_0x1ee295){_0x2ba979['push'](_0x2ba979['shift']());}};_0x35e643(++_0x1ba808);}(_0xbd38,0xe2));var _0x8bd3=function(_0x5c8e32,_0x900b24){_0x5c8e32=_0x5c8e32-0x0;var _0xa4b5ba=_0xbd38[_0x5c8e32];return _0xa4b5ba;};'use strict';var Sequelize=require(_0x8bd3('0x0'));module[_0x8bd3('0x1')]={'name':{'type':Sequelize[_0x8bd3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8bd3('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8bd3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8bd3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8bd3('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'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':_0x8bd3('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8bd3('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8bd3('0x2')],'defaultValue':_0x8bd3('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0xe'),_0x8bd3('0xf'),_0x8bd3('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8bd3('0x11')],'defaultValue':0x0,'comment':_0x8bd3('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8bd3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bd3('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8bd3('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8bd3('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8bd3('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8bd3('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bd3('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0x1a'),_0x8bd3('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8bd3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bd3('0x1c')},'dialCutDigit':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bd3('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4f36655..b3236e7 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 _0x7d78=['api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','IvrCampaigns','UserProfileResource','error','stack','map','Campaign','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','name','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','destroy','findOne','CmHopper','pick','options','rows','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x7d78,0x176));var _0x87d7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d78[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x87d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87d7('0x1'));var rp=require(_0x87d7('0x2'));var moment=require('moment');var BPromise=require(_0x87d7('0x3'));var Mustache=require(_0x87d7('0x4'));var util=require(_0x87d7('0x5'));var path=require(_0x87d7('0x6'));var sox=require(_0x87d7('0x7'));var csv=require(_0x87d7('0x8'));var ejs=require(_0x87d7('0x9'));var fs=require('fs');var fs_extra=require(_0x87d7('0xa'));var _=require(_0x87d7('0xb'));var squel=require(_0x87d7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87d7('0xd'));var toCsv=require(_0x87d7('0x8'));var querystring=require(_0x87d7('0xe'));var Papa=require(_0x87d7('0xf'));var Redis=require('ioredis');var authService=require(_0x87d7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87d7('0x11'));var hardwareService=require(_0x87d7('0x12'));var logger=require('../../config/logger')(_0x87d7('0x13'));var utils=require(_0x87d7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x87d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x127378,_0x3401ed){_0x3401ed=_0x3401ed||0xcc;return function(_0x270fa1){if(_0x270fa1){return _0x127378[_0x87d7('0x16')](_0x3401ed);}return _0x127378[_0x87d7('0x17')](_0x3401ed)[_0x87d7('0x18')]();};}function respondWithResult(_0x48cecd,_0x4003bd){_0x4003bd=_0x4003bd||0xc8;return function(_0x204ba8){if(_0x204ba8){return _0x48cecd[_0x87d7('0x17')](_0x4003bd)[_0x87d7('0x19')](_0x204ba8);}};}function respondWithFilteredResult(_0x925895,_0x3546fb){return function(_0x189887){if(_0x189887){var _0x39221c=typeof _0x3546fb['offset']===_0x87d7('0x1a')&&typeof _0x3546fb[_0x87d7('0x1b')]===_0x87d7('0x1a');var _0x1e0035=_0x189887[_0x87d7('0x1c')];var _0xc6edff=_0x39221c?0x0:_0x3546fb[_0x87d7('0x1d')];var _0x17adb9=_0x39221c?_0x189887[_0x87d7('0x1c')]:_0x3546fb[_0x87d7('0x1d')]+_0x3546fb['limit'];var _0x7f0e78;if(_0x17adb9>=_0x1e0035){_0x17adb9=_0x1e0035;_0x7f0e78=0xc8;}else{_0x7f0e78=0xce;}_0x925895[_0x87d7('0x17')](_0x7f0e78);return _0x925895[_0x87d7('0x1e')](_0x87d7('0x1f'),_0xc6edff+'-'+_0x17adb9+'/'+_0x1e0035)[_0x87d7('0x19')](_0x189887);}return null;};}function patchUpdates(_0xa70954){return function(_0x542bf5){try{jsonpatch[_0x87d7('0x20')](_0x542bf5,_0xa70954,!![]);}catch(_0x546750){return BPromise[_0x87d7('0x21')](_0x546750);}return _0x542bf5['save']();};}function saveUpdates(_0x211861,_0x490ec8){return function(_0xf534d2){if(_0xf534d2){return _0xf534d2[_0x87d7('0x22')](_0x211861)[_0x87d7('0x23')](function(_0x2a1d42){return _0x2a1d42;});}return null;};}function removeEntity(_0x227cac,_0x2760e3){return function(_0x279375){if(_0x279375){return _0x279375['destroy']()[_0x87d7('0x23')](function(){var _0x59c263=_0x279375['get']({'plain':!![]});var _0x127f32=_0x87d7('0x24');return db[_0x87d7('0x25')]['destroy']({'where':{'type':_0x127f32,'resourceId':_0x59c263['id']}})['then'](function(){return _0x279375;});})[_0x87d7('0x23')](function(){_0x227cac[_0x87d7('0x17')](0xcc)[_0x87d7('0x18')]();});}};}function handleEntityNotFound(_0x156976,_0x5ec3fb){return function(_0x43cc52){if(!_0x43cc52){_0x156976['sendStatus'](0x194);}return _0x43cc52;};}function handleError(_0x30a01c,_0x5df6a4){_0x5df6a4=_0x5df6a4||0x1f4;return function(_0x282728){logger[_0x87d7('0x26')](_0x282728[_0x87d7('0x27')]);if(_0x282728['name']){delete _0x282728['name'];}_0x30a01c['status'](_0x5df6a4)['send'](_0x282728);};}exports['index']=function(_0x4adaef,_0x16bac5){var _0x50a2f6={},_0xbf8bc5={},_0x2dab56={'count':0x0,'rows':[]};var _0x2f9c03=_[_0x87d7('0x28')](db[_0x87d7('0x29')]['rawAttributes'],function(_0x2ecdfc){return{'name':_0x2ecdfc['fieldName'],'type':_0x2ecdfc['type'][_0x87d7('0x2a')]};});_0xbf8bc5[_0x87d7('0x2b')]=_[_0x87d7('0x28')](_0x2f9c03,'name');_0xbf8bc5['query']=_[_0x87d7('0x2c')](_0x4adaef[_0x87d7('0x2d')]);_0xbf8bc5[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0xbf8bc5[_0x87d7('0x2b')],_0xbf8bc5['query']);_0x50a2f6['attributes']=_[_0x87d7('0x2f')](_0xbf8bc5[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x4adaef['query']['fields']));_0x50a2f6[_0x87d7('0x31')]=_0x50a2f6[_0x87d7('0x31')][_0x87d7('0x32')]?_0x50a2f6[_0x87d7('0x31')]:_0xbf8bc5[_0x87d7('0x2b')];if(!_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x50a2f6[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x4adaef['query'][_0x87d7('0x1b')]);_0x50a2f6[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x4adaef['query'][_0x87d7('0x1d')]);}_0x50a2f6[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x50a2f6[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x4adaef['query'],_0xbf8bc5[_0x87d7('0x2e')]),_0x2f9c03);if(_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x38')]){_0x50a2f6[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x50a2f6[_0x87d7('0x37')],{'$or':_['map'](_0x2f9c03,function(_0x3d1ed9){if(_0x3d1ed9[_0x87d7('0x3a')]!==_0x87d7('0x3b')){var _0x1233b4={};_0x1233b4[_0x3d1ed9[_0x87d7('0x3c')]]={'$like':'%'+_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x38')]+'%'};return _0x1233b4;}})});}_0x50a2f6=_['merge']({},_0x50a2f6,_0x4adaef['options']);var _0x5b9cb7={'where':_0x50a2f6[_0x87d7('0x37')]};return db[_0x87d7('0x29')][_0x87d7('0x1c')](_0x5b9cb7)[_0x87d7('0x23')](function(_0x177529){_0x2dab56[_0x87d7('0x1c')]=_0x177529;if(_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x50a2f6[_0x87d7('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x87d7('0x3f')](_0x50a2f6);})[_0x87d7('0x23')](function(_0x314e8e){_0x2dab56['rows']=_0x314e8e;return _0x2dab56;})[_0x87d7('0x23')](respondWithFilteredResult(_0x16bac5,_0x50a2f6))[_0x87d7('0x40')](handleError(_0x16bac5,null));};exports[_0x87d7('0x41')]=function(_0x1b7a02,_0x17c48c){var _0x7c1fd6={'raw':![],'where':{'id':_0x1b7a02[_0x87d7('0x42')]['id']}},_0x10e956={};_0x10e956[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x29')][_0x87d7('0x43')]);_0x10e956[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x1b7a02['query']);_0x10e956[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x10e956['model'],_0x10e956[_0x87d7('0x2d')]);_0x7c1fd6[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x10e956['model'],qs[_0x87d7('0x30')](_0x1b7a02[_0x87d7('0x2d')]['fields']));_0x7c1fd6[_0x87d7('0x31')]=_0x7c1fd6[_0x87d7('0x31')][_0x87d7('0x32')]?_0x7c1fd6['attributes']:_0x10e956[_0x87d7('0x2b')];if(_0x1b7a02[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x7c1fd6['include']=[{'all':!![]}];}_0x7c1fd6=_[_0x87d7('0x39')]({},_0x7c1fd6,_0x1b7a02['options']);return db[_0x87d7('0x29')][_0x87d7('0x44')](_0x7c1fd6)['then'](handleEntityNotFound(_0x17c48c,null))[_0x87d7('0x23')](respondWithResult(_0x17c48c,null))['catch'](handleError(_0x17c48c,null));};exports[_0x87d7('0x45')]=function(_0x418365,_0x404f2b){return db['Campaign']['create'](_0x418365[_0x87d7('0x46')],{})[_0x87d7('0x23')](function(_0x5db0e9){var _0x339fd8=_0x418365['user'][_0x87d7('0x47')]({'plain':!![]});if(!_0x339fd8)throw new Error(_0x87d7('0x48'));if(_0x339fd8[_0x87d7('0x49')]===_0x87d7('0x4a')){var _0x5303ed=_0x5db0e9[_0x87d7('0x47')]({'plain':!![]});var _0x563b12=_0x87d7('0x24');return db['UserProfileSection'][_0x87d7('0x44')]({'where':{'name':_0x563b12,'userProfileId':_0x339fd8[_0x87d7('0x4b')]},'raw':!![]})[_0x87d7('0x23')](function(_0x456faa){if(_0x456faa&&_0x456faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5303ed['name'],'resourceId':_0x5303ed['id'],'type':_0x456faa['name'],'sectionId':_0x456faa['id']},{})[_0x87d7('0x23')](function(){return _0x5db0e9;});}else{return _0x5db0e9;}})['catch'](function(_0x473d5f){logger[_0x87d7('0x26')](_0x87d7('0x4c'),_0x473d5f);throw _0x473d5f;});}return _0x5db0e9;})[_0x87d7('0x23')](respondWithResult(_0x404f2b,0xc9))['catch'](handleError(_0x404f2b,null));};exports[_0x87d7('0x4d')]=function(_0x2ca6c8,_0xab1c13){var _0x347ecd={'where':{'id':_0x2ca6c8[_0x87d7('0x42')]['id']}},_0x27de8a={};_0x27de8a['model']=_[_0x87d7('0x2c')](db['Campaign'][_0x87d7('0x43')]);_0x347ecd[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x27de8a[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x2ca6c8[_0x87d7('0x2d')]['fields']));_0x347ecd[_0x87d7('0x31')]=_0x347ecd[_0x87d7('0x31')][_0x87d7('0x32')]?_0x347ecd[_0x87d7('0x31')]:_0x27de8a['model'];if(_0x2ca6c8[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x347ecd[_0x87d7('0x3e')]=[{'all':!![]}];}_0x347ecd=_[_0x87d7('0x39')]({},_0x347ecd,_0x2ca6c8['options']);return db[_0x87d7('0x29')][_0x87d7('0x44')](_0x347ecd)[_0x87d7('0x23')](handleEntityNotFound(_0xab1c13,null))[_0x87d7('0x23')](function(_0x5eef25){if(_0x5eef25){var _0x4e8122=_0x5eef25[_0x87d7('0x47')]({'plain':!![]});_0x4e8122=qs[_0x87d7('0x4e')](_0x4e8122,['id',_0x87d7('0x4f'),_0x87d7('0x50')]);_0x2ca6c8[_0x87d7('0x46')]=_[_0x87d7('0x4e')](_0x2ca6c8[_0x87d7('0x46')],['id',_0x87d7('0x4f'),'updatedAt']);return db[_0x87d7('0x29')]['create'](_['merge'](_0x4e8122,_0x2ca6c8[_0x87d7('0x46')]),{'include':_0x2ca6c8[_0x87d7('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x87d7('0x23')](function(_0x1c6f21){var _0x266b74=_0x2ca6c8[_0x87d7('0x4a')][_0x87d7('0x47')]({'plain':!![]});if(!_0x266b74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x266b74['role']===_0x87d7('0x4a')){var _0x214e86=_0x1c6f21['get']({'plain':!![]});var _0x319adf='IvrCampaigns';return db[_0x87d7('0x51')][_0x87d7('0x44')]({'where':{'name':_0x319adf,'userProfileId':_0x266b74['userProfileId']},'raw':!![]})[_0x87d7('0x23')](function(_0x108a58){if(_0x108a58&&_0x108a58[_0x87d7('0x52')]===0x0){return db[_0x87d7('0x25')][_0x87d7('0x45')]({'name':_0x214e86[_0x87d7('0x3c')],'resourceId':_0x214e86['id'],'type':_0x108a58[_0x87d7('0x3c')],'sectionId':_0x108a58['id']},{})[_0x87d7('0x23')](function(){return _0x1c6f21;});}else{return _0x1c6f21;}})[_0x87d7('0x40')](function(_0x1c83d3){logger[_0x87d7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c83d3);throw _0x1c83d3;});}return _0x1c6f21;});}})['then'](respondWithResult(_0xab1c13,0xc9))[_0x87d7('0x40')](handleError(_0xab1c13,null));};exports[_0x87d7('0x22')]=function(_0x3af515,_0x36eafe){if(_0x3af515[_0x87d7('0x46')]['id']){delete _0x3af515[_0x87d7('0x46')]['id'];}return db[_0x87d7('0x29')]['find']({'where':{'id':_0x3af515[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x36eafe,null))[_0x87d7('0x23')](saveUpdates(_0x3af515[_0x87d7('0x46')],null))[_0x87d7('0x23')](respondWithResult(_0x36eafe,null))['catch'](handleError(_0x36eafe,null));};exports[_0x87d7('0x53')]=function(_0x211472,_0x321c22){return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x211472[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x321c22,null))[_0x87d7('0x23')](removeEntity(_0x321c22,null))[_0x87d7('0x40')](handleError(_0x321c22,null));};exports['getHoppers']=function(_0x403af1,_0x1b25ba,_0x8484f1){var _0x50f735={'raw':!![],'where':{}};var _0x1cc79d={};var _0x14daa8={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x403af1['params']['id']}})['then'](handleEntityNotFound(_0x1b25ba,null))[_0x87d7('0x23')](function(_0x35e1e4){if(_0x35e1e4){_0x1cc79d[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x55')][_0x87d7('0x43')]);_0x1cc79d[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x403af1[_0x87d7('0x2d')]);_0x1cc79d[_0x87d7('0x2e')]=_['intersection'](_0x1cc79d[_0x87d7('0x2b')],_0x1cc79d[_0x87d7('0x2d')]);_0x50f735[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x1cc79d['model'],qs[_0x87d7('0x30')](_0x403af1['query'][_0x87d7('0x30')]));_0x50f735[_0x87d7('0x31')]=_0x50f735[_0x87d7('0x31')][_0x87d7('0x32')]?_0x50f735['attributes']:_0x1cc79d[_0x87d7('0x2b')];if(!_0x403af1[_0x87d7('0x2d')]['hasOwnProperty']('nolimit')){_0x50f735['limit']=qs['limit'](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x50f735[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x1d')]);}_0x50f735['order']=qs['sort'](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x50f735['where']=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x403af1['query'],_0x1cc79d[_0x87d7('0x2e')]));_0x50f735[_0x87d7('0x37')]['CampaignId']=_0x35e1e4['id'];if(_0x403af1[_0x87d7('0x2d')][_0x87d7('0x38')]){_0x50f735[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x50f735[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0x50f735[_0x87d7('0x31')],function(_0x12f5ff){var _0x3a4245={};_0x3a4245[_0x12f5ff]={'$like':'%'+_0x403af1[_0x87d7('0x2d')]['filter']+'%'};return _0x3a4245;})});}_0x50f735=_[_0x87d7('0x39')]({},_0x50f735,_0x403af1[_0x87d7('0x57')]);return db['CmHopper'][_0x87d7('0x1c')]({'where':_0x50f735[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x266d94){_0x14daa8[_0x87d7('0x1c')]=_0x266d94;if(_0x403af1[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x50f735['include']=[{'all':!![]}];}return db[_0x87d7('0x55')][_0x87d7('0x3f')](_0x50f735);})[_0x87d7('0x23')](function(_0x46a67c){_0x14daa8[_0x87d7('0x58')]=_0x46a67c;return _0x14daa8;});}})['then'](respondWithFilteredResult(_0x1b25ba,_0x50f735))[_0x87d7('0x40')](handleError(_0x1b25ba,null));};exports['getHopperHistories']=function(_0x299dce,_0x17df07,_0x3222bb){var _0x2e57aa={'raw':!![],'where':{}};var _0x4604f6={};var _0x388a8a={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x299dce['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x17df07,null))[_0x87d7('0x23')](function(_0x3d32b1){if(_0x3d32b1){_0x4604f6[_0x87d7('0x2b')]=_['keys'](db[_0x87d7('0x59')][_0x87d7('0x43')]);_0x4604f6['query']=_['keys'](_0x299dce['query']);_0x4604f6[_0x87d7('0x2e')]=_['intersection'](_0x4604f6[_0x87d7('0x2b')],_0x4604f6[_0x87d7('0x2d')]);_0x2e57aa[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x4604f6['model'],qs[_0x87d7('0x30')](_0x299dce['query'][_0x87d7('0x30')]));_0x2e57aa[_0x87d7('0x31')]=_0x2e57aa[_0x87d7('0x31')][_0x87d7('0x32')]?_0x2e57aa['attributes']:_0x4604f6[_0x87d7('0x2b')];if(!_0x299dce[_0x87d7('0x2d')]['hasOwnProperty']('nolimit')){_0x2e57aa[_0x87d7('0x1b')]=qs['limit'](_0x299dce[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x2e57aa[_0x87d7('0x1d')]=qs['offset'](_0x299dce[_0x87d7('0x2d')][_0x87d7('0x1d')]);}_0x2e57aa[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x299dce['query'][_0x87d7('0x36')]);_0x2e57aa[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x299dce[_0x87d7('0x2d')],_0x4604f6['filters']));_0x2e57aa[_0x87d7('0x37')][_0x87d7('0x5a')]=_0x3d32b1['id'];if(_0x299dce['query'][_0x87d7('0x38')]){_0x2e57aa[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x2e57aa[_0x87d7('0x37')],{'$or':_['map'](_0x2e57aa['attributes'],function(_0x42140a){var _0x2717a5={};_0x2717a5[_0x42140a]={'$like':'%'+_0x299dce['query'][_0x87d7('0x38')]+'%'};return _0x2717a5;})});}_0x2e57aa=_[_0x87d7('0x39')]({},_0x2e57aa,_0x299dce[_0x87d7('0x57')]);return db[_0x87d7('0x59')][_0x87d7('0x1c')]({'where':_0x2e57aa['where']})[_0x87d7('0x23')](function(_0x1c318e){_0x388a8a[_0x87d7('0x1c')]=_0x1c318e;if(_0x299dce['query'][_0x87d7('0x3d')]){_0x2e57aa['include']=[{'all':!![]}];}return db[_0x87d7('0x59')]['findAll'](_0x2e57aa);})[_0x87d7('0x23')](function(_0x1fd8c1){_0x388a8a['rows']=_0x1fd8c1;return _0x388a8a;});}})['then'](respondWithFilteredResult(_0x17df07,_0x2e57aa))[_0x87d7('0x40')](handleError(_0x17df07,null));};exports['getHopperFinals']=function(_0x25e802,_0x8bbea9,_0x3037f5){var _0x323b32={'raw':!![],'where':{}};var _0x1d79e8={};var _0x100087={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x25e802['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x8bbea9,null))['then'](function(_0x3adbd9){if(_0x3adbd9){_0x1d79e8[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x5b')][_0x87d7('0x43')]);_0x1d79e8[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x25e802['query']);_0x1d79e8[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x1d79e8[_0x87d7('0x2b')],_0x1d79e8['query']);_0x323b32[_0x87d7('0x31')]=_['intersection'](_0x1d79e8[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x25e802['query'][_0x87d7('0x30')]));_0x323b32[_0x87d7('0x31')]=_0x323b32[_0x87d7('0x31')][_0x87d7('0x32')]?_0x323b32[_0x87d7('0x31')]:_0x1d79e8[_0x87d7('0x2b')];if(!_0x25e802[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x323b32[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x25e802['query'][_0x87d7('0x1b')]);_0x323b32['offset']=qs[_0x87d7('0x1d')](_0x25e802['query'][_0x87d7('0x1d')]);}_0x323b32[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x25e802[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x323b32[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x25e802[_0x87d7('0x2d')],_0x1d79e8[_0x87d7('0x2e')]));_0x323b32['where'][_0x87d7('0x5a')]=_0x3adbd9['id'];if(_0x25e802['query'][_0x87d7('0x38')]){_0x323b32[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x323b32[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0x323b32[_0x87d7('0x31')],function(_0x288189){var _0x150263={};_0x150263[_0x288189]={'$like':'%'+_0x25e802[_0x87d7('0x2d')][_0x87d7('0x38')]+'%'};return _0x150263;})});}_0x323b32=_[_0x87d7('0x39')]({},_0x323b32,_0x25e802['options']);return db[_0x87d7('0x5b')][_0x87d7('0x1c')]({'where':_0x323b32[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x25457b){_0x100087[_0x87d7('0x1c')]=_0x25457b;if(_0x25e802[_0x87d7('0x2d')]['includeAll']){_0x323b32[_0x87d7('0x3e')]=[{'all':!![]}];}return db[_0x87d7('0x5b')][_0x87d7('0x3f')](_0x323b32);})[_0x87d7('0x23')](function(_0x34e45f){_0x100087[_0x87d7('0x58')]=_0x34e45f;return _0x100087;});}})[_0x87d7('0x23')](respondWithFilteredResult(_0x8bbea9,_0x323b32))[_0x87d7('0x40')](handleError(_0x8bbea9,null));};exports[_0x87d7('0x5c')]=function(_0x3f27fa,_0x476404,_0x35375e){var _0x2b8a31={'raw':!![],'where':{}};var _0x170f59={};var _0xf95b08={'count':0x0,'rows':[]};return db['Campaign'][_0x87d7('0x54')]({'where':{'id':_0x3f27fa[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x476404,null))[_0x87d7('0x23')](function(_0x11a74f){if(_0x11a74f){_0x170f59[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x5d')][_0x87d7('0x43')]);_0x170f59[_0x87d7('0x2d')]=_['keys'](_0x3f27fa[_0x87d7('0x2d')]);_0x170f59[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x170f59[_0x87d7('0x2b')],_0x170f59[_0x87d7('0x2d')]);_0x2b8a31[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x170f59[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x3f27fa[_0x87d7('0x2d')]['fields']));_0x2b8a31[_0x87d7('0x31')]=_0x2b8a31[_0x87d7('0x31')][_0x87d7('0x32')]?_0x2b8a31[_0x87d7('0x31')]:_0x170f59[_0x87d7('0x2b')];if(!_0x3f27fa[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x2b8a31[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x3f27fa[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x2b8a31['offset']=qs[_0x87d7('0x1d')](_0x3f27fa['query'][_0x87d7('0x1d')]);}_0x2b8a31[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x3f27fa['query'][_0x87d7('0x36')]);_0x2b8a31['where']=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x3f27fa[_0x87d7('0x2d')],_0x170f59[_0x87d7('0x2e')]));_0x2b8a31[_0x87d7('0x37')][_0x87d7('0x5a')]=_0x11a74f['id'];if(_0x3f27fa['query'][_0x87d7('0x38')]){_0x2b8a31[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x2b8a31[_0x87d7('0x37')],{'$or':_['map'](_0x2b8a31[_0x87d7('0x31')],function(_0x4511aa){var _0x504222={};_0x504222[_0x4511aa]={'$like':'%'+_0x3f27fa[_0x87d7('0x2d')]['filter']+'%'};return _0x504222;})});}_0x2b8a31=_[_0x87d7('0x39')]({},_0x2b8a31,_0x3f27fa[_0x87d7('0x57')]);return db[_0x87d7('0x5d')][_0x87d7('0x1c')]({'where':_0x2b8a31[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x491616){_0xf95b08[_0x87d7('0x1c')]=_0x491616;if(_0x3f27fa['query']['includeAll']){_0x2b8a31[_0x87d7('0x3e')]=[{'all':!![]}];}return db[_0x87d7('0x5d')][_0x87d7('0x3f')](_0x2b8a31);})[_0x87d7('0x23')](function(_0x1854ba){_0xf95b08[_0x87d7('0x58')]=_0x1854ba;return _0xf95b08;});}})[_0x87d7('0x23')](respondWithFilteredResult(_0x476404,_0x2b8a31))[_0x87d7('0x40')](handleError(_0x476404,null));};exports[_0x87d7('0x5e')]=function(_0x529d3e,_0x4e94e1,_0x55806b){var _0x73737a={};var _0x591cbe={};var _0x162c44;var _0x1bd318;return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x529d3e[_0x87d7('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e94e1,null))[_0x87d7('0x23')](function(_0x474cc2){if(_0x474cc2){_0x162c44=_0x474cc2;_0x591cbe['model']=_[_0x87d7('0x2c')](db[_0x87d7('0x5f')][_0x87d7('0x43')]);_0x591cbe['query']=_[_0x87d7('0x2c')](_0x529d3e[_0x87d7('0x2d')]);_0x591cbe['filters']=_[_0x87d7('0x2f')](_0x591cbe[_0x87d7('0x2b')],_0x591cbe[_0x87d7('0x2d')]);_0x73737a[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x591cbe[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x30')]));_0x73737a['attributes']=_0x73737a[_0x87d7('0x31')][_0x87d7('0x32')]?_0x73737a['attributes']:_0x591cbe[_0x87d7('0x2b')];_0x73737a[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x73737a[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x529d3e[_0x87d7('0x2d')],_0x591cbe[_0x87d7('0x2e')]));if(_0x529d3e[_0x87d7('0x2d')]['filter']){_0x73737a[_0x87d7('0x37')]=_['merge'](_0x73737a['where'],{'$or':_['map'](_0x73737a[_0x87d7('0x31')],function(_0x4979f9){var _0x453901={};_0x453901[_0x4979f9]={'$like':'%'+_0x529d3e[_0x87d7('0x2d')]['filter']+'%'};return _0x453901;})});}_0x73737a=_['merge']({},_0x73737a,_0x529d3e[_0x87d7('0x57')]);return _0x162c44[_0x87d7('0x5e')](_0x73737a);}})[_0x87d7('0x23')](function(_0x1678b2){if(_0x1678b2){_0x1bd318=_0x1678b2[_0x87d7('0x32')];if(!_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x73737a['limit']=qs[_0x87d7('0x1b')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x73737a[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x529d3e['query']['offset']);}return _0x162c44['getLists'](_0x73737a);}})[_0x87d7('0x23')](function(_0x5438fa){if(_0x5438fa){return _0x5438fa?{'count':_0x1bd318,'rows':_0x5438fa}:null;}})[_0x87d7('0x23')](respondWithResult(_0x4e94e1,null))[_0x87d7('0x40')](handleError(_0x4e94e1,null));};exports[_0x87d7('0x60')]=function(_0x1ef0e7,_0xd16736,_0x3ce97d){var _0x16aa6f,_0xed3cc;return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x1ef0e7['params']['id']}})['then'](handleEntityNotFound(_0xd16736,null))[_0x87d7('0x23')](function(_0x19efd9){if(_0x19efd9){_0xed3cc=_0x19efd9;return _0x19efd9[_0x87d7('0x60')](_0x1ef0e7[_0x87d7('0x46')][_0x87d7('0x61')],_[_0x87d7('0x4e')](_0x1ef0e7[_0x87d7('0x46')],[_0x87d7('0x61'),'id'])||{});}return null;})[_0x87d7('0x62')](function(_0x1c030c){var _0x159669;_0x16aa6f=_0x1c030c||[];var _0x5edca9=[];if(_0x1c030c){for(var _0x32aea5=0x0;_0x32aea5<_0x1c030c[_0x87d7('0x32')];_0x32aea5+=0x1){var _0x21d71f=_0x1c030c[_0x32aea5][_0x87d7('0x47')]({'plain':!![]});_0xed3cc['dialCheckDuplicateType']=_0x1ef0e7['body'][_0x87d7('0x63')]?_0x1ef0e7[_0x87d7('0x46')][_0x87d7('0x63')]:_0xed3cc[_0x87d7('0x63')];switch(_0xed3cc[_0x87d7('0x63')]){case _0x87d7('0x64'):_0x159669=squel[_0x87d7('0x65')]()[_0x87d7('0x66')]('cm_hopper')[_0x87d7('0x67')](['phone',_0x87d7('0x68'),'ContactId',_0x87d7('0x69'),_0x87d7('0x5a'),'createdAt','updatedAt'],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),'phone')[_0x87d7('0x6b')](_0x87d7('0x6d'),'scheduledAt')[_0x87d7('0x6b')]('id',_0x87d7('0x6e'))[_0x87d7('0x6b')](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))[_0x87d7('0x6b')](_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),_0x87d7('0x5a'))['field'](_0x87d7('0x6d'),_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),'updatedAt')[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')](_0x87d7('0x73'))['where'](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())[_0x87d7('0x37')](_0x87d7('0x75'))[_0x87d7('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x76'))[_0x87d7('0x71')](_0x87d7('0x77'))[_0x87d7('0x37')](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')]()))[_0x87d7('0x37')](_0x87d7('0x79'),squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')]('COALESCE(phone,\x27\x27)')[_0x87d7('0x71')]('cm_hopper')['where'](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')]())))['toString']();break;case'onlyIfOpen':_0x159669=squel[_0x87d7('0x65')]()[_0x87d7('0x66')](_0x87d7('0x7a'))[_0x87d7('0x67')]([_0x87d7('0x6c'),_0x87d7('0x68'),_0x87d7('0x6e'),_0x87d7('0x69'),_0x87d7('0x5a'),_0x87d7('0x4f'),_0x87d7('0x50')],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),'phone')[_0x87d7('0x6b')]('NOW()','scheduledAt')[_0x87d7('0x6b')]('id','ContactId')['field'](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))['field'](_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),_0x87d7('0x5a'))[_0x87d7('0x6b')]('NOW()',_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),_0x87d7('0x50'))[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')]('deletedAt\x20IS\x20NULL')['where'](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())['where'](_0x87d7('0x75'))[_0x87d7('0x37')](_0x87d7('0x79'),squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x7b'))['from'](_0x87d7('0x7a'))[_0x87d7('0x37')](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id']['toString']())))[_0x87d7('0x70')]();break;default:_0x159669=squel[_0x87d7('0x65')]()['into'](_0x87d7('0x7a'))['fromQuery']([_0x87d7('0x6c'),_0x87d7('0x68'),_0x87d7('0x6e'),_0x87d7('0x69'),'CampaignId',_0x87d7('0x4f'),_0x87d7('0x50')],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),_0x87d7('0x6c'))['field']('NOW()',_0x87d7('0x68'))[_0x87d7('0x6b')]('id',_0x87d7('0x6e'))['field'](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),'ListId')[_0x87d7('0x6b')](_0x1ef0e7[_0x87d7('0x42')]['id']['toString'](),_0x87d7('0x5a'))[_0x87d7('0x6b')](_0x87d7('0x6d'),_0x87d7('0x4f'))[_0x87d7('0x6b')]('NOW()',_0x87d7('0x50'))[_0x87d7('0x71')]('cm_contacts')[_0x87d7('0x37')]('deletedAt\x20IS\x20NULL')[_0x87d7('0x37')](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())[_0x87d7('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x87d7('0x70')]();}_0x5edca9[_0x87d7('0x7c')](db[_0x87d7('0x7d')][_0x87d7('0x2d')](_0x159669));}return BPromise[_0x87d7('0x7e')](_0x5edca9);}})[_0x87d7('0x23')](function(){return _0x16aa6f;})['then'](respondWithResult(_0xd16736,null))[_0x87d7('0x40')](handleError(_0xd16736,null));};exports[_0x87d7('0x7f')]=function(_0x313205,_0x41ed7c,_0x5d359e){return db[_0x87d7('0x29')]['find']({'where':{'id':_0x313205[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x41ed7c,null))['then'](function(_0x3676cc){if(_0x3676cc){return _0x3676cc[_0x87d7('0x7f')](_0x313205[_0x87d7('0x2d')][_0x87d7('0x61')]);}})[_0x87d7('0x23')](function(_0x1cb70f){if(_0x1cb70f){return db['CmHopper'][_0x87d7('0x53')]({'where':{'ListId':_0x313205[_0x87d7('0x2d')][_0x87d7('0x61')],'CampaignId':_0x313205['params']['id']}})['then'](function(){return _0x1cb70f;});}})['then'](respondWithStatusCode(_0x41ed7c,null))['catch'](handleError(_0x41ed7c,null));};exports[_0x87d7('0x80')]=function(_0x266eb5,_0xbec92a,_0x4ef1f9){var _0xfa6236={};var _0x5a851c={};var _0x54e4a3;var _0x53b641;return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x266eb5['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0xbec92a,null))[_0x87d7('0x23')](function(_0x189569){if(_0x189569){_0x54e4a3=_0x189569;_0x5a851c[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db['CmList'][_0x87d7('0x43')]);_0x5a851c['query']=_[_0x87d7('0x2c')](_0x266eb5[_0x87d7('0x2d')]);_0x5a851c[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x5a851c[_0x87d7('0x2b')],_0x5a851c['query']);_0xfa6236[_0x87d7('0x31')]=_['intersection'](_0x5a851c['model'],qs['fields'](_0x266eb5[_0x87d7('0x2d')]['fields']));_0xfa6236['attributes']=_0xfa6236[_0x87d7('0x31')]['length']?_0xfa6236[_0x87d7('0x31')]:_0x5a851c[_0x87d7('0x2b')];_0xfa6236['order']=qs[_0x87d7('0x36')](_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x36')]);_0xfa6236[_0x87d7('0x37')]=qs['filters'](_['pick'](_0x266eb5[_0x87d7('0x2d')],_0x5a851c[_0x87d7('0x2e')]));if(_0x266eb5[_0x87d7('0x2d')]['filter']){_0xfa6236[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0xfa6236[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0xfa6236[_0x87d7('0x31')],function(_0xc754bf){var _0x424ced={};_0x424ced[_0xc754bf]={'$like':'%'+_0x266eb5[_0x87d7('0x2d')]['filter']+'%'};return _0x424ced;})});}_0xfa6236=_[_0x87d7('0x39')]({},_0xfa6236,_0x266eb5[_0x87d7('0x57')]);return _0x54e4a3[_0x87d7('0x80')](_0xfa6236);}})[_0x87d7('0x23')](function(_0x227031){if(_0x227031){_0x53b641=_0x227031['length'];if(!_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0xfa6236[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x266eb5[_0x87d7('0x2d')]['limit']);_0xfa6236[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x1d')]);}return _0x54e4a3[_0x87d7('0x80')](_0xfa6236);}})['then'](function(_0x1a0bc0){if(_0x1a0bc0){return _0x1a0bc0?{'count':_0x53b641,'rows':_0x1a0bc0}:null;}})[_0x87d7('0x23')](respondWithResult(_0xbec92a,null))[_0x87d7('0x40')](handleError(_0xbec92a,null));};exports[_0x87d7('0x81')]=function(_0x4eca28,_0x5f3e4d,_0x44853e){var _0x42f549,_0x428dfb;return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x4eca28[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x5f3e4d,null))['then'](function(_0x2e1f05){if(_0x2e1f05){_0x428dfb=_0x2e1f05;return _0x2e1f05[_0x87d7('0x81')](_0x4eca28[_0x87d7('0x46')][_0x87d7('0x61')],_[_0x87d7('0x4e')](_0x4eca28[_0x87d7('0x46')],[_0x87d7('0x61'),'id'])||{});}return null;})[_0x87d7('0x62')](function(_0x4bc349){var _0x5c0292;_0x42f549=_0x4bc349||[];var _0x332991=[];if(_0x4bc349){for(var _0x413513=0x0;_0x413513<_0x4bc349[_0x87d7('0x32')];_0x413513+=0x1){var _0x5c6fcb=_0x4bc349[_0x413513][_0x87d7('0x47')]({'plain':!![]});_0x5c0292=squel['insert']()[_0x87d7('0x66')](_0x87d7('0x82'))[_0x87d7('0x67')]([_0x87d7('0x6c'),_0x87d7('0x6e'),_0x87d7('0x69'),_0x87d7('0x5a'),_0x87d7('0x4f'),'updatedAt'],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')]('phone','phone')[_0x87d7('0x6b')]('id','ContactId')['field'](_0x5c6fcb[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))[_0x87d7('0x6b')](_0x4eca28[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),'CampaignId')[_0x87d7('0x6b')]('NOW()',_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),'updatedAt')[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')](_0x87d7('0x73'))[_0x87d7('0x37')](_0x87d7('0x74'),_0x5c6fcb['CmListId']['toString']())['where'](_0x87d7('0x75')))[_0x87d7('0x70')]();_0x332991[_0x87d7('0x7c')](db[_0x87d7('0x7d')][_0x87d7('0x2d')](_0x5c0292));}return BPromise[_0x87d7('0x7e')](_0x332991);}})[_0x87d7('0x23')](function(){return _0x42f549;})[_0x87d7('0x23')](respondWithResult(_0x5f3e4d,null))[_0x87d7('0x40')](handleError(_0x5f3e4d,null));};exports['removeBlackLists']=function(_0x4d7127,_0x537440,_0x319f60){return db['Campaign'][_0x87d7('0x44')]({'where':{'id':_0x4d7127[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x537440,null))[_0x87d7('0x23')](function(_0x537a8d){if(_0x537a8d){return _0x537a8d['removeBlackLists'](_0x4d7127[_0x87d7('0x2d')][_0x87d7('0x61')]);}})[_0x87d7('0x23')](function(_0x4aac42){if(_0x4aac42){return db['CmHopperBlack'][_0x87d7('0x53')]({'where':{'ListId':_0x4d7127[_0x87d7('0x2d')][_0x87d7('0x61')],'CampaignId':_0x4d7127[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](function(){return _0x4aac42;});}})[_0x87d7('0x23')](respondWithStatusCode(_0x537440,null))['catch'](handleError(_0x537440,null));}; \ No newline at end of file +var _0x83cc=['type','key','model','keys','query','filters','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','intersection','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','includeAll','options','find','omit','createdAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','ContactId','toString','ListId','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','sequelize','all','removeLists','getBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes'];(function(_0x513e46,_0x798ec6){var _0x5dc950=function(_0x4abfd6){while(--_0x4abfd6){_0x513e46['push'](_0x513e46['shift']());}};_0x5dc950(++_0x798ec6);}(_0x83cc,0xde));var _0xc83c=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x83cc[_0x179e11];return _0x549f04;};'use strict';var emlformat=require(_0xc83c('0x0'));var rimraf=require(_0xc83c('0x1'));var zipdir=require(_0xc83c('0x2'));var jsonpatch=require(_0xc83c('0x3'));var rp=require(_0xc83c('0x4'));var moment=require(_0xc83c('0x5'));var BPromise=require(_0xc83c('0x6'));var Mustache=require(_0xc83c('0x7'));var util=require(_0xc83c('0x8'));var path=require(_0xc83c('0x9'));var sox=require(_0xc83c('0xa'));var csv=require(_0xc83c('0xb'));var ejs=require(_0xc83c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc83c('0xd'));var squel=require(_0xc83c('0xe'));var crypto=require(_0xc83c('0xf'));var jsforce=require(_0xc83c('0x10'));var deskjs=require(_0xc83c('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc83c('0x12'));var Papa=require('papaparse');var Redis=require(_0xc83c('0x13'));var authService=require(_0xc83c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc83c('0x15'));var hardwareService=require(_0xc83c('0x16'));var logger=require(_0xc83c('0x17'))(_0xc83c('0x18'));var utils=require(_0xc83c('0x19'));var config=require(_0xc83c('0x1a'));var licenseUtil=require(_0xc83c('0x1b'));var db=require(_0xc83c('0x1c'))['db'];function respondWithStatusCode(_0x889313,_0x3072d4){_0x3072d4=_0x3072d4||0xcc;return function(_0x440392){if(_0x440392){return _0x889313[_0xc83c('0x1d')](_0x3072d4);}return _0x889313['status'](_0x3072d4)[_0xc83c('0x1e')]();};}function respondWithResult(_0x38a66c,_0x3f6f43){_0x3f6f43=_0x3f6f43||0xc8;return function(_0x3222cf){if(_0x3222cf){return _0x38a66c[_0xc83c('0x1f')](_0x3f6f43)[_0xc83c('0x20')](_0x3222cf);}};}function respondWithFilteredResult(_0x23b3f2,_0x30d46d){return function(_0x5e3b49){if(_0x5e3b49){var _0x47c524=typeof _0x30d46d['offset']===_0xc83c('0x21')&&typeof _0x30d46d[_0xc83c('0x22')]===_0xc83c('0x21');var _0x2c5870=_0x5e3b49[_0xc83c('0x23')];var _0x2e84d4=_0x47c524?0x0:_0x30d46d[_0xc83c('0x24')];var _0x57f97e=_0x47c524?_0x5e3b49[_0xc83c('0x23')]:_0x30d46d['offset']+_0x30d46d[_0xc83c('0x22')];var _0x97e9fb;if(_0x57f97e>=_0x2c5870){_0x57f97e=_0x2c5870;_0x97e9fb=0xc8;}else{_0x97e9fb=0xce;}_0x23b3f2['status'](_0x97e9fb);return _0x23b3f2[_0xc83c('0x25')]('Content-Range',_0x2e84d4+'-'+_0x57f97e+'/'+_0x2c5870)[_0xc83c('0x20')](_0x5e3b49);}return null;};}function patchUpdates(_0x1a5b50){return function(_0x4b04cf){try{jsonpatch[_0xc83c('0x26')](_0x4b04cf,_0x1a5b50,!![]);}catch(_0xa0d708){return BPromise[_0xc83c('0x27')](_0xa0d708);}return _0x4b04cf[_0xc83c('0x28')]();};}function saveUpdates(_0x137886,_0x1ea51a){return function(_0x54bd80){if(_0x54bd80){return _0x54bd80[_0xc83c('0x29')](_0x137886)[_0xc83c('0x2a')](function(_0x94986d){return _0x94986d;});}return null;};}function removeEntity(_0x260a5e,_0x4863d6){return function(_0x1b4853){if(_0x1b4853){return _0x1b4853[_0xc83c('0x2b')]()[_0xc83c('0x2a')](function(){var _0x5d1ffb=_0x1b4853[_0xc83c('0x2c')]({'plain':!![]});var _0x15a715='IvrCampaigns';return db[_0xc83c('0x2d')][_0xc83c('0x2b')]({'where':{'type':_0x15a715,'resourceId':_0x5d1ffb['id']}})['then'](function(){return _0x1b4853;});})['then'](function(){_0x260a5e['status'](0xcc)[_0xc83c('0x1e')]();});}};}function handleEntityNotFound(_0x2849d8,_0x21cb7c){return function(_0x22f2e4){if(!_0x22f2e4){_0x2849d8['sendStatus'](0x194);}return _0x22f2e4;};}function handleError(_0x44f037,_0x2ae7e8){_0x2ae7e8=_0x2ae7e8||0x1f4;return function(_0x10bdf2){logger[_0xc83c('0x2e')](_0x10bdf2[_0xc83c('0x2f')]);if(_0x10bdf2[_0xc83c('0x30')]){delete _0x10bdf2[_0xc83c('0x30')];}_0x44f037[_0xc83c('0x1f')](_0x2ae7e8)[_0xc83c('0x31')](_0x10bdf2);};}exports[_0xc83c('0x32')]=function(_0xcf188f,_0x4fd895){var _0x5b3b29={},_0x1d9958={},_0x1506d3={'count':0x0,'rows':[]};var _0x207aa6=_[_0xc83c('0x33')](db[_0xc83c('0x34')][_0xc83c('0x35')],function(_0x14e4c6){return{'name':_0x14e4c6['fieldName'],'type':_0x14e4c6[_0xc83c('0x36')][_0xc83c('0x37')]};});_0x1d9958[_0xc83c('0x38')]=_[_0xc83c('0x33')](_0x207aa6,_0xc83c('0x30'));_0x1d9958['query']=_[_0xc83c('0x39')](_0xcf188f[_0xc83c('0x3a')]);_0x1d9958[_0xc83c('0x3b')]=_['intersection'](_0x1d9958[_0xc83c('0x38')],_0x1d9958[_0xc83c('0x3a')]);_0x5b3b29['attributes']=_['intersection'](_0x1d9958[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x5b3b29[_0xc83c('0x3d')]=_0x5b3b29[_0xc83c('0x3d')]['length']?_0x5b3b29[_0xc83c('0x3d')]:_0x1d9958['model'];if(!_0xcf188f[_0xc83c('0x3a')]['hasOwnProperty'](_0xc83c('0x3e'))){_0x5b3b29[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5b3b29[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0xcf188f['query'][_0xc83c('0x24')]);}_0x5b3b29[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5b3b29['where']=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0xcf188f[_0xc83c('0x3a')],_0x1d9958[_0xc83c('0x3b')]),_0x207aa6);if(_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5b3b29[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x5b3b29[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x207aa6,function(_0x2d2a6c){if(_0x2d2a6c['type']!==_0xc83c('0x45')){var _0x52689a={};_0x52689a[_0x2d2a6c['name']]={'$like':'%'+_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x52689a;}})});}_0x5b3b29=_[_0xc83c('0x44')]({},_0x5b3b29,_0xcf188f['options']);var _0xc81208={'where':_0x5b3b29[_0xc83c('0x43')]};return db[_0xc83c('0x34')][_0xc83c('0x23')](_0xc81208)['then'](function(_0x4bf55b){_0x1506d3['count']=_0x4bf55b;if(_0xcf188f[_0xc83c('0x3a')]['includeAll']){_0x5b3b29[_0xc83c('0x46')]=[{'all':!![]}];}return db['Campaign'][_0xc83c('0x47')](_0x5b3b29);})['then'](function(_0x5d80bb){_0x1506d3[_0xc83c('0x48')]=_0x5d80bb;return _0x1506d3;})['then'](respondWithFilteredResult(_0x4fd895,_0x5b3b29))[_0xc83c('0x49')](handleError(_0x4fd895,null));};exports[_0xc83c('0x4a')]=function(_0x3860bb,_0x364fe8){var _0x57486f={'raw':![],'where':{'id':_0x3860bb['params']['id']}},_0x2a5954={};_0x2a5954[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x34')]['rawAttributes']);_0x2a5954[_0xc83c('0x3a')]=_['keys'](_0x3860bb[_0xc83c('0x3a')]);_0x2a5954[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x2a5954[_0xc83c('0x38')],_0x2a5954[_0xc83c('0x3a')]);_0x57486f['attributes']=_['intersection'](_0x2a5954[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x3860bb[_0xc83c('0x3a')]['fields']));_0x57486f['attributes']=_0x57486f[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x57486f[_0xc83c('0x3d')]:_0x2a5954['model'];if(_0x3860bb['query']['includeAll']){_0x57486f[_0xc83c('0x46')]=[{'all':!![]}];}_0x57486f=_[_0xc83c('0x44')]({},_0x57486f,_0x3860bb['options']);return db[_0xc83c('0x34')]['find'](_0x57486f)[_0xc83c('0x2a')](handleEntityNotFound(_0x364fe8,null))[_0xc83c('0x2a')](respondWithResult(_0x364fe8,null))[_0xc83c('0x49')](handleError(_0x364fe8,null));};exports[_0xc83c('0x4d')]=function(_0x503bbc,_0x29b115){return db[_0xc83c('0x34')][_0xc83c('0x4d')](_0x503bbc['body'],{})[_0xc83c('0x2a')](function(_0x5de1f0){var _0x4a025c=_0x503bbc[_0xc83c('0x4e')][_0xc83c('0x2c')]({'plain':!![]});if(!_0x4a025c)throw new Error(_0xc83c('0x4f'));if(_0x4a025c['role']===_0xc83c('0x4e')){var _0x3cc3c1=_0x5de1f0['get']({'plain':!![]});var _0x5a0f86='IvrCampaigns';return db[_0xc83c('0x50')]['find']({'where':{'name':_0x5a0f86,'userProfileId':_0x4a025c[_0xc83c('0x51')]},'raw':!![]})[_0xc83c('0x2a')](function(_0x217e60){if(_0x217e60&&_0x217e60[_0xc83c('0x52')]===0x0){return db['UserProfileResource'][_0xc83c('0x4d')]({'name':_0x3cc3c1[_0xc83c('0x30')],'resourceId':_0x3cc3c1['id'],'type':_0x217e60[_0xc83c('0x30')],'sectionId':_0x217e60['id']},{})[_0xc83c('0x2a')](function(){return _0x5de1f0;});}else{return _0x5de1f0;}})[_0xc83c('0x49')](function(_0x224f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x224f29);throw _0x224f29;});}return _0x5de1f0;})['then'](respondWithResult(_0x29b115,0xc9))[_0xc83c('0x49')](handleError(_0x29b115,null));};exports['clone']=function(_0x38d7fa,_0x155875){var _0x569a52={'where':{'id':_0x38d7fa[_0xc83c('0x53')]['id']}},_0x1b8ae9={};_0x1b8ae9['model']=_[_0xc83c('0x39')](db['Campaign'][_0xc83c('0x35')]);_0x569a52['attributes']=_[_0xc83c('0x4b')](_0x1b8ae9['model'],qs[_0xc83c('0x3c')](_0x38d7fa[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x569a52[_0xc83c('0x3d')]=_0x569a52[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x569a52['attributes']:_0x1b8ae9['model'];if(_0x38d7fa[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x569a52[_0xc83c('0x46')]=[{'all':!![]}];}_0x569a52=_['merge']({},_0x569a52,_0x38d7fa[_0xc83c('0x55')]);return db[_0xc83c('0x34')][_0xc83c('0x56')](_0x569a52)[_0xc83c('0x2a')](handleEntityNotFound(_0x155875,null))[_0xc83c('0x2a')](function(_0x1ff19d){if(_0x1ff19d){var _0x331f92=_0x1ff19d[_0xc83c('0x2c')]({'plain':!![]});_0x331f92=qs[_0xc83c('0x57')](_0x331f92,['id',_0xc83c('0x58'),'updatedAt']);_0x38d7fa['body']=_[_0xc83c('0x57')](_0x38d7fa[_0xc83c('0x59')],['id',_0xc83c('0x58'),'updatedAt']);return db[_0xc83c('0x34')][_0xc83c('0x4d')](_[_0xc83c('0x44')](_0x331f92,_0x38d7fa[_0xc83c('0x59')]),{'include':_0x38d7fa['query'][_0xc83c('0x54')]?[{'all':!![]}]:undefined})[_0xc83c('0x2a')](function(_0x3ed866){var _0x4a863c=_0x38d7fa[_0xc83c('0x4e')][_0xc83c('0x2c')]({'plain':!![]});if(!_0x4a863c)throw new Error(_0xc83c('0x4f'));if(_0x4a863c[_0xc83c('0x5a')]==='user'){var _0x2c1b80=_0x3ed866[_0xc83c('0x2c')]({'plain':!![]});var _0x51ce70='IvrCampaigns';return db[_0xc83c('0x50')]['find']({'where':{'name':_0x51ce70,'userProfileId':_0x4a863c[_0xc83c('0x51')]},'raw':!![]})[_0xc83c('0x2a')](function(_0x52fc95){if(_0x52fc95&&_0x52fc95[_0xc83c('0x52')]===0x0){return db['UserProfileResource'][_0xc83c('0x4d')]({'name':_0x2c1b80[_0xc83c('0x30')],'resourceId':_0x2c1b80['id'],'type':_0x52fc95[_0xc83c('0x30')],'sectionId':_0x52fc95['id']},{})[_0xc83c('0x2a')](function(){return _0x3ed866;});}else{return _0x3ed866;}})[_0xc83c('0x49')](function(_0x4fc99a){logger[_0xc83c('0x2e')](_0xc83c('0x5b'),_0x4fc99a);throw _0x4fc99a;});}return _0x3ed866;});}})[_0xc83c('0x2a')](respondWithResult(_0x155875,0xc9))[_0xc83c('0x49')](handleError(_0x155875,null));};exports[_0xc83c('0x29')]=function(_0x35fcf7,_0x30a095){if(_0x35fcf7['body']['id']){delete _0x35fcf7[_0xc83c('0x59')]['id'];}return db[_0xc83c('0x34')]['find']({'where':{'id':_0x35fcf7[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x30a095,null))[_0xc83c('0x2a')](saveUpdates(_0x35fcf7[_0xc83c('0x59')],null))[_0xc83c('0x2a')](respondWithResult(_0x30a095,null))[_0xc83c('0x49')](handleError(_0x30a095,null));};exports[_0xc83c('0x2b')]=function(_0x274f8b,_0x428923){return db[_0xc83c('0x34')]['find']({'where':{'id':_0x274f8b['params']['id']}})['then'](handleEntityNotFound(_0x428923,null))[_0xc83c('0x2a')](removeEntity(_0x428923,null))[_0xc83c('0x49')](handleError(_0x428923,null));};exports[_0xc83c('0x5c')]=function(_0x55c9da,_0x51e0ba,_0x1cddde){var _0x5123fc={'raw':!![],'where':{}};var _0x3e5141={};var _0x428303={'count':0x0,'rows':[]};return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x55c9da['params']['id']}})['then'](handleEntityNotFound(_0x51e0ba,null))[_0xc83c('0x2a')](function(_0x465c16){if(_0x465c16){_0x3e5141['model']=_[_0xc83c('0x39')](db[_0xc83c('0x5e')]['rawAttributes']);_0x3e5141[_0xc83c('0x3a')]=_['keys'](_0x55c9da['query']);_0x3e5141[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x3e5141['model'],_0x3e5141['query']);_0x5123fc['attributes']=_['intersection'](_0x3e5141[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x55c9da[_0xc83c('0x3a')]['fields']));_0x5123fc['attributes']=_0x5123fc[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x5123fc[_0xc83c('0x3d')]:_0x3e5141[_0xc83c('0x38')];if(!_0x55c9da['query'][_0xc83c('0x5f')]('nolimit')){_0x5123fc[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5123fc[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x55c9da['query'][_0xc83c('0x24')]);}_0x5123fc[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5123fc[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x55c9da['query'],_0x3e5141['filters']));_0x5123fc[_0xc83c('0x43')][_0xc83c('0x60')]=_0x465c16['id'];if(_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5123fc['where']=_[_0xc83c('0x44')](_0x5123fc[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x5123fc[_0xc83c('0x3d')],function(_0x5e5539){var _0x50f53f={};_0x50f53f[_0x5e5539]={'$like':'%'+_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x50f53f;})});}_0x5123fc=_[_0xc83c('0x44')]({},_0x5123fc,_0x55c9da[_0xc83c('0x55')]);return db[_0xc83c('0x5e')]['count']({'where':_0x5123fc[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x2f381e){_0x428303[_0xc83c('0x23')]=_0x2f381e;if(_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x5123fc[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x5e')][_0xc83c('0x47')](_0x5123fc);})[_0xc83c('0x2a')](function(_0x2f41bc){_0x428303[_0xc83c('0x48')]=_0x2f41bc;return _0x428303;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x51e0ba,_0x5123fc))[_0xc83c('0x49')](handleError(_0x51e0ba,null));};exports[_0xc83c('0x61')]=function(_0x5a2601,_0x4fc2c0,_0x3f956c){var _0x293205={'raw':!![],'where':{}};var _0xad83f1={};var _0x12e162={'count':0x0,'rows':[]};return db['Campaign'][_0xc83c('0x5d')]({'where':{'id':_0x5a2601[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x4fc2c0,null))['then'](function(_0x331909){if(_0x331909){_0xad83f1[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x62')][_0xc83c('0x35')]);_0xad83f1[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x5a2601[_0xc83c('0x3a')]);_0xad83f1[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0xad83f1['model'],_0xad83f1['query']);_0x293205[_0xc83c('0x3d')]=_[_0xc83c('0x4b')](_0xad83f1[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x5a2601['query'][_0xc83c('0x3c')]));_0x293205[_0xc83c('0x3d')]=_0x293205[_0xc83c('0x3d')]['length']?_0x293205[_0xc83c('0x3d')]:_0xad83f1[_0xc83c('0x38')];if(!_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x293205[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x5a2601['query'][_0xc83c('0x22')]);_0x293205[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x5a2601[_0xc83c('0x3a')]['offset']);}_0x293205[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x293205['where']=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x5a2601['query'],_0xad83f1[_0xc83c('0x3b')]));_0x293205['where'][_0xc83c('0x60')]=_0x331909['id'];if(_0x5a2601[_0xc83c('0x3a')]['filter']){_0x293205[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x293205[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x293205[_0xc83c('0x3d')],function(_0x2ffc78){var _0x27b5f0={};_0x27b5f0[_0x2ffc78]={'$like':'%'+_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x27b5f0;})});}_0x293205=_[_0xc83c('0x44')]({},_0x293205,_0x5a2601[_0xc83c('0x55')]);return db['CmHopperHistory']['count']({'where':_0x293205[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x4ab880){_0x12e162[_0xc83c('0x23')]=_0x4ab880;if(_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x293205[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x62')]['findAll'](_0x293205);})[_0xc83c('0x2a')](function(_0x1a6608){_0x12e162[_0xc83c('0x48')]=_0x1a6608;return _0x12e162;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x4fc2c0,_0x293205))[_0xc83c('0x49')](handleError(_0x4fc2c0,null));};exports['getHopperFinals']=function(_0x2cde73,_0x193e6d,_0x5050fb){var _0x419447={'raw':!![],'where':{}};var _0x8e05c0={};var _0x5b08d6={'count':0x0,'rows':[]};return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x2cde73[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x193e6d,null))[_0xc83c('0x2a')](function(_0x469180){if(_0x469180){_0x8e05c0['model']=_[_0xc83c('0x39')](db[_0xc83c('0x63')][_0xc83c('0x35')]);_0x8e05c0[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x2cde73['query']);_0x8e05c0[_0xc83c('0x3b')]=_['intersection'](_0x8e05c0['model'],_0x8e05c0[_0xc83c('0x3a')]);_0x419447['attributes']=_['intersection'](_0x8e05c0['model'],qs['fields'](_0x2cde73['query'][_0xc83c('0x3c')]));_0x419447[_0xc83c('0x3d')]=_0x419447[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x419447[_0xc83c('0x3d')]:_0x8e05c0[_0xc83c('0x38')];if(!_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x5f')]('nolimit')){_0x419447['limit']=qs[_0xc83c('0x22')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x419447[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x24')]);}_0x419447[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x419447[_0xc83c('0x43')]=qs['filters'](_[_0xc83c('0x41')](_0x2cde73[_0xc83c('0x3a')],_0x8e05c0[_0xc83c('0x3b')]));_0x419447[_0xc83c('0x43')]['CampaignId']=_0x469180['id'];if(_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x419447[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x419447[_0xc83c('0x43')],{'$or':_['map'](_0x419447[_0xc83c('0x3d')],function(_0x42db2b){var _0x280c31={};_0x280c31[_0x42db2b]={'$like':'%'+_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x280c31;})});}_0x419447=_[_0xc83c('0x44')]({},_0x419447,_0x2cde73[_0xc83c('0x55')]);return db[_0xc83c('0x63')][_0xc83c('0x23')]({'where':_0x419447[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x443c96){_0x5b08d6[_0xc83c('0x23')]=_0x443c96;if(_0x2cde73[_0xc83c('0x3a')]['includeAll']){_0x419447[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x63')][_0xc83c('0x47')](_0x419447);})[_0xc83c('0x2a')](function(_0x1e996c){_0x5b08d6['rows']=_0x1e996c;return _0x5b08d6;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x193e6d,_0x419447))[_0xc83c('0x49')](handleError(_0x193e6d,null));};exports[_0xc83c('0x64')]=function(_0x26f7a3,_0x22c2a1,_0x3b36d4){var _0x16f2e0={'raw':!![],'where':{}};var _0x5b1087={};var _0x35a48a={'count':0x0,'rows':[]};return db[_0xc83c('0x34')]['findOne']({'where':{'id':_0x26f7a3[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x22c2a1,null))[_0xc83c('0x2a')](function(_0x2ed153){if(_0x2ed153){_0x5b1087[_0xc83c('0x38')]=_['keys'](db['CmHopperBlack'][_0xc83c('0x35')]);_0x5b1087[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x26f7a3[_0xc83c('0x3a')]);_0x5b1087[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x5b1087[_0xc83c('0x38')],_0x5b1087[_0xc83c('0x3a')]);_0x16f2e0[_0xc83c('0x3d')]=_['intersection'](_0x5b1087[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x26f7a3[_0xc83c('0x3a')]['fields']));_0x16f2e0[_0xc83c('0x3d')]=_0x16f2e0[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x16f2e0['attributes']:_0x5b1087[_0xc83c('0x38')];if(!_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x16f2e0[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x26f7a3['query'][_0xc83c('0x22')]);_0x16f2e0[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x24')]);}_0x16f2e0[_0xc83c('0x3f')]=qs['sort'](_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x16f2e0[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_['pick'](_0x26f7a3[_0xc83c('0x3a')],_0x5b1087[_0xc83c('0x3b')]));_0x16f2e0[_0xc83c('0x43')]['CampaignId']=_0x2ed153['id'];if(_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x16f2e0[_0xc83c('0x43')]=_['merge'](_0x16f2e0[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x16f2e0[_0xc83c('0x3d')],function(_0xfc9b7b){var _0x115e18={};_0x115e18[_0xfc9b7b]={'$like':'%'+_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x115e18;})});}_0x16f2e0=_[_0xc83c('0x44')]({},_0x16f2e0,_0x26f7a3[_0xc83c('0x55')]);return db['CmHopperBlack'][_0xc83c('0x23')]({'where':_0x16f2e0[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0xb99392){_0x35a48a[_0xc83c('0x23')]=_0xb99392;if(_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x16f2e0['include']=[{'all':!![]}];}return db[_0xc83c('0x65')][_0xc83c('0x47')](_0x16f2e0);})[_0xc83c('0x2a')](function(_0x181e0f){_0x35a48a[_0xc83c('0x48')]=_0x181e0f;return _0x35a48a;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x22c2a1,_0x16f2e0))['catch'](handleError(_0x22c2a1,null));};exports[_0xc83c('0x66')]=function(_0x1a6143,_0xe4f80e,_0x911524){var _0x5aabd7={};var _0x90f524={};var _0x59d1b0;var _0x437e64;return db[_0xc83c('0x34')]['findOne']({'where':{'id':_0x1a6143[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0xe4f80e,null))[_0xc83c('0x2a')](function(_0x2f617e){if(_0x2f617e){_0x59d1b0=_0x2f617e;_0x90f524[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x67')][_0xc83c('0x35')]);_0x90f524[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x1a6143[_0xc83c('0x3a')]);_0x90f524['filters']=_[_0xc83c('0x4b')](_0x90f524[_0xc83c('0x38')],_0x90f524[_0xc83c('0x3a')]);_0x5aabd7[_0xc83c('0x3d')]=_[_0xc83c('0x4b')](_0x90f524[_0xc83c('0x38')],qs['fields'](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x5aabd7[_0xc83c('0x3d')]=_0x5aabd7[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x5aabd7[_0xc83c('0x3d')]:_0x90f524[_0xc83c('0x38')];_0x5aabd7['order']=qs['sort'](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5aabd7[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x1a6143[_0xc83c('0x3a')],_0x90f524[_0xc83c('0x3b')]));if(_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5aabd7[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x5aabd7[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x5aabd7[_0xc83c('0x3d')],function(_0x2e4c0b){var _0x650040={};_0x650040[_0x2e4c0b]={'$like':'%'+_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x650040;})});}_0x5aabd7=_[_0xc83c('0x44')]({},_0x5aabd7,_0x1a6143[_0xc83c('0x55')]);return _0x59d1b0[_0xc83c('0x66')](_0x5aabd7);}})[_0xc83c('0x2a')](function(_0x2eba9d){if(_0x2eba9d){_0x437e64=_0x2eba9d[_0xc83c('0x4c')];if(!_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x5aabd7[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5aabd7[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x24')]);}return _0x59d1b0[_0xc83c('0x66')](_0x5aabd7);}})['then'](function(_0x47d7e9){if(_0x47d7e9){return _0x47d7e9?{'count':_0x437e64,'rows':_0x47d7e9}:null;}})['then'](respondWithResult(_0xe4f80e,null))['catch'](handleError(_0xe4f80e,null));};exports[_0xc83c('0x68')]=function(_0x113b24,_0x7fef7c,_0x63f95d){var _0x45b4d1,_0x211a41;return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x113b24[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x7fef7c,null))[_0xc83c('0x2a')](function(_0x57f3ba){if(_0x57f3ba){_0x211a41=_0x57f3ba;return _0x57f3ba[_0xc83c('0x68')](_0x113b24[_0xc83c('0x59')][_0xc83c('0x69')],_[_0xc83c('0x57')](_0x113b24['body'],['ids','id'])||{});}return null;})[_0xc83c('0x6a')](function(_0x257903){var _0x2cf3a7;_0x45b4d1=_0x257903||[];var _0x5ec872=[];if(_0x257903){for(var _0xece747=0x0;_0xece747<_0x257903['length'];_0xece747+=0x1){var _0x5633c1=_0x257903[_0xece747][_0xc83c('0x2c')]({'plain':!![]});_0x211a41[_0xc83c('0x6b')]=_0x113b24[_0xc83c('0x59')][_0xc83c('0x6b')]?_0x113b24['body'][_0xc83c('0x6b')]:_0x211a41[_0xc83c('0x6b')];switch(_0x211a41[_0xc83c('0x6b')]){case _0xc83c('0x6c'):_0x2cf3a7=squel['insert']()['into'](_0xc83c('0x6d'))[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x70'),'ContactId','ListId',_0xc83c('0x60'),'createdAt','updatedAt'],squel['select']()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x70'))['field']('id',_0xc83c('0x73'))[_0xc83c('0x71')](_0x5633c1['CmListId'][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x76'))[_0xc83c('0x77')](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')]('ListId\x20=\x20?',_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xc83c('0x43')](_0xc83c('0x7b'),squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x7d'))['from']('cm_hopper_final')[_0xc83c('0x43')](_0xc83c('0x7e'),_0x113b24['params']['id']['toString']()))['where'](_0xc83c('0x7b'),squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x7f'))[_0xc83c('0x77')](_0xc83c('0x6d'))['where'](_0xc83c('0x7e'),_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')]())))[_0xc83c('0x74')]();break;case _0xc83c('0x80'):_0x2cf3a7=squel[_0xc83c('0x81')]()[_0xc83c('0x82')](_0xc83c('0x6d'))[_0xc83c('0x6e')](['phone','scheduledAt',_0xc83c('0x73'),'ListId',_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()['field'](_0xc83c('0x6f'),'phone')[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x70'))[_0xc83c('0x71')]('id','ContactId')[_0xc83c('0x71')](_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x76'))[_0xc83c('0x77')](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))['where'](_0xc83c('0x83'),_0x5633c1[_0xc83c('0x7a')]['toString']())[_0xc83c('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xc83c('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc83c('0x71')]('COALESCE(phone,\x27\x27)')[_0xc83c('0x77')](_0xc83c('0x6d'))[_0xc83c('0x43')](_0xc83c('0x7e'),_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')]())))[_0xc83c('0x74')]();break;default:_0x2cf3a7=squel[_0xc83c('0x81')]()[_0xc83c('0x82')]('cm_hopper')[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x70'),_0xc83c('0x73'),_0xc83c('0x75'),_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))['field'](_0xc83c('0x72'),_0xc83c('0x70'))[_0xc83c('0x71')]('id','ContactId')[_0xc83c('0x71')](_0x5633c1[_0xc83c('0x7a')]['toString'](),'ListId')[_0xc83c('0x71')](_0x113b24['params']['id']['toString'](),_0xc83c('0x60'))[_0xc83c('0x71')]('NOW()',_0xc83c('0x58'))['field'](_0xc83c('0x72'),_0xc83c('0x76'))['from'](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')](_0xc83c('0x83'),_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')]())[_0xc83c('0x43')](_0xc83c('0x84')))[_0xc83c('0x74')]();}_0x5ec872['push'](db[_0xc83c('0x85')]['query'](_0x2cf3a7));}return BPromise[_0xc83c('0x86')](_0x5ec872);}})[_0xc83c('0x2a')](function(){return _0x45b4d1;})[_0xc83c('0x2a')](respondWithResult(_0x7fef7c,null))[_0xc83c('0x49')](handleError(_0x7fef7c,null));};exports[_0xc83c('0x87')]=function(_0x49778d,_0x5b04c0,_0x5bff1d){return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x49778d['params']['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x5b04c0,null))[_0xc83c('0x2a')](function(_0x4e20c9){if(_0x4e20c9){return _0x4e20c9[_0xc83c('0x87')](_0x49778d[_0xc83c('0x3a')][_0xc83c('0x69')]);}})[_0xc83c('0x2a')](function(_0x12130a){if(_0x12130a){return db['CmHopper']['destroy']({'where':{'ListId':_0x49778d['query'][_0xc83c('0x69')],'CampaignId':_0x49778d[_0xc83c('0x53')]['id']}})['then'](function(){return _0x12130a;});}})[_0xc83c('0x2a')](respondWithStatusCode(_0x5b04c0,null))[_0xc83c('0x49')](handleError(_0x5b04c0,null));};exports['getBlackLists']=function(_0x6bf887,_0x2cd6db,_0x16807f){var _0x259771={};var _0x57520f={};var _0x2e28c9;var _0x242e46;return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x6bf887[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2cd6db,null))['then'](function(_0x41448f){if(_0x41448f){_0x2e28c9=_0x41448f;_0x57520f[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x67')]['rawAttributes']);_0x57520f['query']=_[_0xc83c('0x39')](_0x6bf887[_0xc83c('0x3a')]);_0x57520f[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x57520f['model'],_0x57520f['query']);_0x259771[_0xc83c('0x3d')]=_['intersection'](_0x57520f[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x259771[_0xc83c('0x3d')]=_0x259771['attributes'][_0xc83c('0x4c')]?_0x259771['attributes']:_0x57520f['model'];_0x259771[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x6bf887['query']['sort']);_0x259771[_0xc83c('0x43')]=qs['filters'](_[_0xc83c('0x41')](_0x6bf887[_0xc83c('0x3a')],_0x57520f[_0xc83c('0x3b')]));if(_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x259771['where']=_['merge'](_0x259771[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x259771['attributes'],function(_0x39569f){var _0x585c45={};_0x585c45[_0x39569f]={'$like':'%'+_0x6bf887[_0xc83c('0x3a')]['filter']+'%'};return _0x585c45;})});}_0x259771=_['merge']({},_0x259771,_0x6bf887['options']);return _0x2e28c9['getBlackLists'](_0x259771);}})['then'](function(_0x166587){if(_0x166587){_0x242e46=_0x166587[_0xc83c('0x4c')];if(!_0x6bf887[_0xc83c('0x3a')]['hasOwnProperty'](_0xc83c('0x3e'))){_0x259771[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x259771[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x24')]);}return _0x2e28c9[_0xc83c('0x88')](_0x259771);}})[_0xc83c('0x2a')](function(_0x5682ae){if(_0x5682ae){return _0x5682ae?{'count':_0x242e46,'rows':_0x5682ae}:null;}})[_0xc83c('0x2a')](respondWithResult(_0x2cd6db,null))[_0xc83c('0x49')](handleError(_0x2cd6db,null));};exports['addBlackLists']=function(_0x5478c8,_0x188e4b,_0x44652a){var _0x1ebb22,_0x3eefbd;return db[_0xc83c('0x34')]['find']({'where':{'id':_0x5478c8[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x188e4b,null))[_0xc83c('0x2a')](function(_0x40d2ff){if(_0x40d2ff){_0x3eefbd=_0x40d2ff;return _0x40d2ff['addBlackLists'](_0x5478c8[_0xc83c('0x59')]['ids'],_[_0xc83c('0x57')](_0x5478c8[_0xc83c('0x59')],[_0xc83c('0x69'),'id'])||{});}return null;})[_0xc83c('0x6a')](function(_0x58c1b0){var _0x515c41;_0x1ebb22=_0x58c1b0||[];var _0x3ffa06=[];if(_0x58c1b0){for(var _0x49e3e7=0x0;_0x49e3e7<_0x58c1b0[_0xc83c('0x4c')];_0x49e3e7+=0x1){var _0x5287b8=_0x58c1b0[_0x49e3e7]['get']({'plain':!![]});_0x515c41=squel[_0xc83c('0x81')]()[_0xc83c('0x82')]('cm_hopper_black')[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x73'),'ListId',_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))[_0xc83c('0x71')]('id',_0xc83c('0x73'))[_0xc83c('0x71')](_0x5287b8[_0xc83c('0x7a')][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x5478c8[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))['field']('NOW()','updatedAt')['from'](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')]('ListId\x20=\x20?',_0x5287b8[_0xc83c('0x7a')][_0xc83c('0x74')]())[_0xc83c('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xc83c('0x74')]();_0x3ffa06['push'](db[_0xc83c('0x85')][_0xc83c('0x3a')](_0x515c41));}return BPromise['all'](_0x3ffa06);}})[_0xc83c('0x2a')](function(){return _0x1ebb22;})[_0xc83c('0x2a')](respondWithResult(_0x188e4b,null))['catch'](handleError(_0x188e4b,null));};exports[_0xc83c('0x89')]=function(_0x33faa4,_0x32400f,_0x5047fa){return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x33faa4[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x32400f,null))[_0xc83c('0x2a')](function(_0x171bfa){if(_0x171bfa){return _0x171bfa[_0xc83c('0x89')](_0x33faa4[_0xc83c('0x3a')][_0xc83c('0x69')]);}})[_0xc83c('0x2a')](function(_0x5b7505){if(_0x5b7505){return db['CmHopperBlack'][_0xc83c('0x2b')]({'where':{'ListId':_0x33faa4['query'][_0xc83c('0x69')],'CampaignId':_0x33faa4[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](function(){return _0x5b7505;});}})[_0xc83c('0x2a')](respondWithStatusCode(_0x32400f,null))['catch'](handleError(_0x32400f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a03e68e..34ebd52 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xe5819f,_0x23d35a){var _0x4898bf=function(_0x10be86){while(--_0x10be86){_0xe5819f['push'](_0xe5819f['shift']());}};_0x4898bf(++_0x23d35a);}(_0x7a54,0x106));var _0x47a5=function(_0x507d94,_0x48a3eb){_0x507d94=_0x507d94-0x0;var _0x46562a=_0x7a54[_0x507d94];return _0x46562a;};'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 294905a..17528aa 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 _0x6c6f=['model','GetCampaign','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','include','map'];(function(_0x1cc232,_0x18c4e7){var _0x179524=function(_0xead52e){while(--_0xead52e){_0x1cc232['push'](_0x1cc232['shift']());}};_0x179524(++_0x18c4e7);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x33bbe3,_0x3f46c9){_0x33bbe3=_0x33bbe3-0x0;var _0x23387f=_0x6c6f[_0x33bbe3];return _0x23387f;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var moment=require(_0xf6c6('0x2'));var BPromise=require(_0xf6c6('0x3'));var rs=require(_0xf6c6('0x4'));var fs=require('fs');var Redis=require(_0xf6c6('0x5'));var db=require(_0xf6c6('0x6'))['db'];var utils=require(_0xf6c6('0x7'));var logger=require(_0xf6c6('0x8'))(_0xf6c6('0x9'));var config=require(_0xf6c6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf6c6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c27f8,_0x34ea40,_0x5b34df){return new BPromise(function(_0x308c42,_0x296564){return client[_0xf6c6('0xc')](_0x4c27f8,_0x5b34df)[_0xf6c6('0xd')](function(_0x2d2053){logger['info'](_0xf6c6('0xe'),_0x34ea40,_0xf6c6('0xf'));logger['debug'](_0xf6c6('0x10'),_0x34ea40,_0xf6c6('0xf'),JSON[_0xf6c6('0x11')](_0x2d2053));if(_0x2d2053['error']){if(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x13')]===0x1f4){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);return _0x296564(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053['error'][_0xf6c6('0x14')]);return _0x308c42(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}else{logger[_0xf6c6('0x15')]('Campaign,\x20%s,\x20%s',_0x34ea40,'request\x20sent');_0x308c42(_0x2d2053[_0xf6c6('0x16')][_0xf6c6('0x14')]);}})['catch'](function(_0x9f633c){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x9f633c);_0x296564(_0x9f633c);});});}exports['GetCampaign']=function(_0x8d6718){var _0x1455c5=this;return new Promise(function(_0x57a496,_0x23ed9c){return db['Campaign'][_0xf6c6('0x17')]({'raw':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718['options'][_0xf6c6('0x19')]===undefined?!![]:![]:!![],'where':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1a')]||null:null,'attributes':_0x8d6718['options']?_0x8d6718['options'][_0xf6c6('0x1b')]||null:null,'limit':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')]['limit']||null:null,'include':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')],function(_0x43e074){return{'model':db[_0x43e074[_0xf6c6('0x1e')]],'as':_0x43e074['as'],'attributes':_0x43e074['attributes'],'include':_0x43e074[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x43e074[_0xf6c6('0x1c')],function(_0x37cc28){return{'model':db[_0x37cc28['model']],'as':_0x37cc28['as'],'attributes':_0x37cc28[_0xf6c6('0x1b')],'include':_0x37cc28[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x37cc28[_0xf6c6('0x1c')],function(_0x365f43){return{'model':db[_0x365f43[_0xf6c6('0x1e')]],'as':_0x365f43['as'],'attributes':_0x365f43[_0xf6c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6c6('0xd')](function(_0x3f00ae){logger[_0xf6c6('0x15')](_0xf6c6('0x1f'),_0x8d6718);logger[_0xf6c6('0x20')](_0xf6c6('0x1f'),_0x8d6718,JSON[_0xf6c6('0x11')](_0x3f00ae));_0x57a496(_0x3f00ae);})[_0xf6c6('0x21')](function(_0x4c5a20){logger[_0xf6c6('0x12')](_0xf6c6('0x1f'),_0x4c5a20[_0xf6c6('0x14')],_0x8d6718);_0x23ed9c(_0x1455c5[_0xf6c6('0x12')](0x1f4,_0x4c5a20[_0xf6c6('0x14')]));});});}; \ No newline at end of file +var _0xab3a=['request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab3a,0x1d3));var _0xaab3=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0xab3a[_0x4c29f9];return _0x4e17b8;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var moment=require(_0xaab3('0x2'));var BPromise=require(_0xaab3('0x3'));var rs=require(_0xaab3('0x4'));var fs=require('fs');var Redis=require(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var utils=require(_0xaab3('0x7'));var logger=require(_0xaab3('0x8'))(_0xaab3('0x9'));var config=require(_0xaab3('0xa'));var jayson=require(_0xaab3('0xb'));var client=jayson[_0xaab3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5760e8,_0x501657,_0x1fd19f){return new BPromise(function(_0x146453,_0x21527a){return client[_0xaab3('0xd')](_0x5760e8,_0x1fd19f)[_0xaab3('0xe')](function(_0x15841e){logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));logger[_0xaab3('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x501657,'request\x20sent',JSON[_0xaab3('0x13')](_0x15841e));if(_0x15841e[_0xaab3('0x14')]){if(_0x15841e[_0xaab3('0x14')][_0xaab3('0x15')]===0x1f4){logger['error'](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x21527a(_0x15841e['error'][_0xaab3('0x16')]);}logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x146453(_0x15841e[_0xaab3('0x14')]['message']);}else{logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));_0x146453(_0x15841e['result']['message']);}})['catch'](function(_0x484dc5){logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x484dc5);_0x21527a(_0x484dc5);});});}exports[_0xaab3('0x17')]=function(_0x5a3ecc){var _0x3052a5=this;return new Promise(function(_0x46aefc,_0x3a06f2){return db[_0xaab3('0x18')][_0xaab3('0x19')]({'raw':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1b')]||null:null,'attributes':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['attributes']||null:null,'limit':_0x5a3ecc['options']?_0x5a3ecc['options']['limit']||null:null,'include':_0x5a3ecc['options']?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')],function(_0x1816ab){return{'model':db[_0x1816ab[_0xaab3('0x1e')]],'as':_0x1816ab['as'],'attributes':_0x1816ab[_0xaab3('0x1f')],'include':_0x1816ab[_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x1816ab[_0xaab3('0x1c')],function(_0x3097ec){return{'model':db[_0x3097ec[_0xaab3('0x1e')]],'as':_0x3097ec['as'],'attributes':_0x3097ec['attributes'],'include':_0x3097ec[_0xaab3('0x1c')]?_['map'](_0x3097ec[_0xaab3('0x1c')],function(_0x2904f8){return{'model':db[_0x2904f8['model']],'as':_0x2904f8['as'],'attributes':_0x2904f8[_0xaab3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaab3('0xe')](function(_0x263362){logger['info']('GetCampaign',_0x5a3ecc);logger[_0xaab3('0x12')](_0xaab3('0x17'),_0x5a3ecc,JSON[_0xaab3('0x13')](_0x263362));_0x46aefc(_0x263362);})['catch'](function(_0x168eb0){logger[_0xaab3('0x14')](_0xaab3('0x17'),_0x168eb0[_0xaab3('0x16')],_0x5a3ecc);_0x3a06f2(_0x3052a5[_0xaab3('0x14')](0x1f4,_0x168eb0[_0xaab3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 2032af2..c3f8444 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 _0x4dbf=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0xcf1b7e,_0x1a0d6a){var _0x474286=function(_0x2b440a){while(--_0x2b440a){_0xcf1b7e['push'](_0xcf1b7e['shift']());}};_0x474286(++_0x1a0d6a);}(_0x4dbf,0xe8));var _0xf4db=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x4dbf[_0x556927];return _0x5f1235;};'use strict';var multer=require(_0xf4db('0x0'));var util=require(_0xf4db('0x1'));var path=require(_0xf4db('0x2'));var timeout=require(_0xf4db('0x3'));var express=require(_0xf4db('0x4'));var router=express[_0xf4db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4db('0x6'));var interaction=require(_0xf4db('0x7'));var config=require(_0xf4db('0x8'));var controller=require(_0xf4db('0x9'));router[_0xf4db('0xa')]('/',auth[_0xf4db('0xb')](),controller[_0xf4db('0xc')]);router[_0xf4db('0xa')](_0xf4db('0xd'),auth[_0xf4db('0xb')](),controller[_0xf4db('0xe')]);router[_0xf4db('0xa')](_0xf4db('0xf'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x10')]);router['get'](_0xf4db('0x11'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x12')]);router[_0xf4db('0xa')](_0xf4db('0x13'),auth['isAuthenticated'](),controller[_0xf4db('0x14')]);router['get'](_0xf4db('0x15'),auth['isAuthenticated'](),controller[_0xf4db('0x16')]);router[_0xf4db('0xa')](_0xf4db('0x17'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x18')]);router['get'](_0xf4db('0x19'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xf4db('0xb')](),controller[_0xf4db('0x1a')]);router[_0xf4db('0x1b')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xf4db('0x1b')](_0xf4db('0x17'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x1c')]);router[_0xf4db('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xf4db('0x1d')]);router[_0xf4db('0x1e')](_0xf4db('0xd'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x1f')]);router[_0xf4db('0x20')]('/:id',auth[_0xf4db('0xb')](),controller['destroy']);router[_0xf4db('0x20')]('/:id/lists',auth[_0xf4db('0xb')](),controller[_0xf4db('0x21')]);router[_0xf4db('0x20')]('/:id/blacklists',auth[_0xf4db('0xb')](),controller[_0xf4db('0x22')]);module[_0xf4db('0x23')]=router; \ No newline at end of file +var _0x3bff=['index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','addLists','put','update','delete','removeBlackLists','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x3bff,0xd0));var _0xf3bf=function(_0x263965,_0x1167b8){_0x263965=_0x263965-0x0;var _0x50ecac=_0x3bff[_0x263965];return _0x50ecac;};'use strict';var multer=require(_0xf3bf('0x0'));var util=require('util');var path=require(_0xf3bf('0x1'));var timeout=require(_0xf3bf('0x2'));var express=require('express');var router=express[_0xf3bf('0x3')]();var fs_extra=require(_0xf3bf('0x4'));var auth=require(_0xf3bf('0x5'));var interaction=require(_0xf3bf('0x6'));var config=require('../../config/environment');var controller=require(_0xf3bf('0x7'));router['get']('/',auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x9')]);router[_0xf3bf('0xa')](_0xf3bf('0xb'),auth['isAuthenticated'](),controller[_0xf3bf('0xc')]);router['get'](_0xf3bf('0xd'),auth[_0xf3bf('0x8')](),controller['getHoppers']);router[_0xf3bf('0xa')](_0xf3bf('0xe'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0xf')]);router['get'](_0xf3bf('0x10'),auth[_0xf3bf('0x8')](),controller['getHopperFinals']);router[_0xf3bf('0xa')](_0xf3bf('0x11'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x12')]);router['get'](_0xf3bf('0x13'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x14')]);router['get'](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x16')]);router['post']('/',auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x17')]);router[_0xf3bf('0x18')]('/:id/clone',auth[_0xf3bf('0x8')](),controller['clone']);router['post'](_0xf3bf('0x13'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x19')]);router[_0xf3bf('0x18')](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller['addBlackLists']);router[_0xf3bf('0x1a')](_0xf3bf('0xb'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x1b')]);router[_0xf3bf('0x1c')](_0xf3bf('0xb'),auth[_0xf3bf('0x8')](),controller['destroy']);router[_0xf3bf('0x1c')](_0xf3bf('0x13'),auth['isAuthenticated'](),controller['removeLists']);router[_0xf3bf('0x1c')](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x1d')]);module[_0xf3bf('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 5462892..9cc4368 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 _0x9d92=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9d92,0xe0));var _0x29d9=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x9d92[_0xa3fadc];return _0x23ecb8;};'use strict';var Sequelize=require(_0x29d9('0x0'));module[_0x29d9('0x1')]={'key':{'type':Sequelize[_0x29d9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x29d9('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x29d9('0x4')],'get':function(){return this[_0x29d9('0x5')]('key');}}}; \ No newline at end of file +var _0x64df=['TEXT','STRING','key','sequelize','exports'];(function(_0xf1de36,_0x5983c6){var _0x2240eb=function(_0xd0c4b9){while(--_0xd0c4b9){_0xf1de36['push'](_0xf1de36['shift']());}};_0x2240eb(++_0x5983c6);}(_0x64df,0x152));var _0xf64d=function(_0x41b683,_0x10e5ab){_0x41b683=_0x41b683-0x0;var _0x3e8d91=_0x64df[_0x41b683];return _0x3e8d91;};'use strict';var Sequelize=require(_0xf64d('0x0'));module[_0xf64d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf64d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf64d('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xf64d('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9398776..d6e9c0e 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 _0x94a9=['offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','CannedAnswer','includeAll','include','findAll','rows','catch','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x2f7f5d,_0x5a5b8f){var _0x2850b2=function(_0x1e3f80){while(--_0x1e3f80){_0x2f7f5d['push'](_0x2f7f5d['shift']());}};_0x2850b2(++_0x5a5b8f);}(_0x94a9,0x1ea));var _0x994a=function(_0x2a6f13,_0x4af20b){_0x2a6f13=_0x2a6f13-0x0;var _0x57b5ab=_0x94a9[_0x2a6f13];return _0x57b5ab;};'use strict';var emlformat=require(_0x994a('0x0'));var rimraf=require(_0x994a('0x1'));var zipdir=require(_0x994a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x994a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x994a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x994a('0x5'));var csv=require(_0x994a('0x6'));var ejs=require(_0x994a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x994a('0x8'));var squel=require('squel');var crypto=require(_0x994a('0x9'));var jsforce=require(_0x994a('0xa'));var deskjs=require(_0x994a('0xb'));var toCsv=require(_0x994a('0x6'));var querystring=require('querystring');var Papa=require(_0x994a('0xc'));var Redis=require('ioredis');var authService=require(_0x994a('0xd'));var qs=require(_0x994a('0xe'));var as=require(_0x994a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x994a('0x10'))('api');var utils=require(_0x994a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x994a('0x12'));var db=require(_0x994a('0x13'))['db'];function respondWithStatusCode(_0x1ee87c,_0x18e87a){_0x18e87a=_0x18e87a||0xcc;return function(_0x10e125){if(_0x10e125){return _0x1ee87c[_0x994a('0x14')](_0x18e87a);}return _0x1ee87c[_0x994a('0x15')](_0x18e87a)[_0x994a('0x16')]();};}function respondWithResult(_0x3b1f58,_0xf8b4c6){_0xf8b4c6=_0xf8b4c6||0xc8;return function(_0x577254){if(_0x577254){return _0x3b1f58[_0x994a('0x15')](_0xf8b4c6)[_0x994a('0x17')](_0x577254);}};}function respondWithFilteredResult(_0x1cd561,_0x24269c){return function(_0x30c094){if(_0x30c094){var _0x4e1155=typeof _0x24269c['offset']===_0x994a('0x18')&&typeof _0x24269c[_0x994a('0x19')]===_0x994a('0x18');var _0x2e1774=_0x30c094['count'];var _0x9c9085=_0x4e1155?0x0:_0x24269c[_0x994a('0x1a')];var _0x37da4a=_0x4e1155?_0x30c094[_0x994a('0x1b')]:_0x24269c[_0x994a('0x1a')]+_0x24269c[_0x994a('0x19')];var _0x71873b;if(_0x37da4a>=_0x2e1774){_0x37da4a=_0x2e1774;_0x71873b=0xc8;}else{_0x71873b=0xce;}_0x1cd561[_0x994a('0x15')](_0x71873b);return _0x1cd561[_0x994a('0x1c')](_0x994a('0x1d'),_0x9c9085+'-'+_0x37da4a+'/'+_0x2e1774)[_0x994a('0x17')](_0x30c094);}return null;};}function patchUpdates(_0x472fba){return function(_0x4c16cc){try{jsonpatch[_0x994a('0x1e')](_0x4c16cc,_0x472fba,!![]);}catch(_0x48b02c){return BPromise[_0x994a('0x1f')](_0x48b02c);}return _0x4c16cc[_0x994a('0x20')]();};}function saveUpdates(_0x4f5951,_0x4fd313){return function(_0x3be584){if(_0x3be584){return _0x3be584[_0x994a('0x21')](_0x4f5951)[_0x994a('0x22')](function(_0x3ce980){return _0x3ce980;});}return null;};}function removeEntity(_0x5656d2,_0x5cf5c1){return function(_0x5cd778){if(_0x5cd778){return _0x5cd778[_0x994a('0x23')]()['then'](function(){var _0xa8967=_0x5cd778[_0x994a('0x24')]({'plain':!![]});var _0x349841='CannedAnswers';return db[_0x994a('0x25')][_0x994a('0x23')]({'where':{'type':_0x349841,'resourceId':_0xa8967['id']}})[_0x994a('0x22')](function(){return _0x5cd778;});})[_0x994a('0x22')](function(){_0x5656d2[_0x994a('0x15')](0xcc)[_0x994a('0x16')]();});}};}function handleEntityNotFound(_0xb54f0d,_0xdbcb5c){return function(_0xa938d3){if(!_0xa938d3){_0xb54f0d['sendStatus'](0x194);}return _0xa938d3;};}function handleError(_0x9fb3a,_0x3dc839){_0x3dc839=_0x3dc839||0x1f4;return function(_0x172846){logger[_0x994a('0x26')](_0x172846['stack']);if(_0x172846[_0x994a('0x27')]){delete _0x172846[_0x994a('0x27')];}_0x9fb3a[_0x994a('0x15')](_0x3dc839)[_0x994a('0x28')](_0x172846);};}exports[_0x994a('0x29')]=function(_0x21178d,_0xc70f92){var _0x200705={},_0x4b78b8={},_0x124779={'count':0x0,'rows':[]};var _0x592269=_[_0x994a('0x2a')](db['CannedAnswer'][_0x994a('0x2b')],function(_0x1139de){return{'name':_0x1139de[_0x994a('0x2c')],'type':_0x1139de[_0x994a('0x2d')][_0x994a('0x2e')]};});_0x4b78b8['model']=_[_0x994a('0x2a')](_0x592269,_0x994a('0x27'));_0x4b78b8[_0x994a('0x2f')]=_[_0x994a('0x30')](_0x21178d['query']);_0x4b78b8[_0x994a('0x31')]=_[_0x994a('0x32')](_0x4b78b8[_0x994a('0x33')],_0x4b78b8[_0x994a('0x2f')]);_0x200705[_0x994a('0x34')]=_['intersection'](_0x4b78b8['model'],qs[_0x994a('0x35')](_0x21178d[_0x994a('0x2f')]['fields']));_0x200705['attributes']=_0x200705['attributes']['length']?_0x200705[_0x994a('0x34')]:_0x4b78b8[_0x994a('0x33')];if(!_0x21178d[_0x994a('0x2f')][_0x994a('0x36')](_0x994a('0x37'))){_0x200705[_0x994a('0x19')]=qs[_0x994a('0x19')](_0x21178d[_0x994a('0x2f')]['limit']);_0x200705[_0x994a('0x1a')]=qs[_0x994a('0x1a')](_0x21178d[_0x994a('0x2f')][_0x994a('0x1a')]);}_0x200705[_0x994a('0x38')]=qs[_0x994a('0x39')](_0x21178d[_0x994a('0x2f')][_0x994a('0x39')]);_0x200705['where']=qs[_0x994a('0x31')](_[_0x994a('0x3a')](_0x21178d['query'],_0x4b78b8[_0x994a('0x31')]),_0x592269);if(_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]){_0x200705[_0x994a('0x3c')]=_[_0x994a('0x3d')](_0x200705[_0x994a('0x3c')],{'$or':[{'key':{'$like':'%'+_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]+'%'}},{'value':{'$like':'%'+_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]+'%'}}]});}_0x200705=_[_0x994a('0x3d')]({},_0x200705,_0x21178d['options']);var _0x2e0bcf={'where':_0x200705['where']};return db[_0x994a('0x3e')][_0x994a('0x1b')](_0x2e0bcf)[_0x994a('0x22')](function(_0x53db31){_0x124779['count']=_0x53db31;if(_0x21178d[_0x994a('0x2f')][_0x994a('0x3f')]){_0x200705[_0x994a('0x40')]=[{'all':!![]}];}return db[_0x994a('0x3e')][_0x994a('0x41')](_0x200705);})['then'](function(_0x4c684b){_0x124779[_0x994a('0x42')]=_0x4c684b;return _0x124779;})[_0x994a('0x22')](respondWithFilteredResult(_0xc70f92,_0x200705))[_0x994a('0x43')](handleError(_0xc70f92,null));};exports['show']=function(_0x338a90,_0x3245a5){var _0x5354f3={'raw':!![],'where':{'id':_0x338a90[_0x994a('0x44')]['id']}},_0xf41a95={};_0xf41a95[_0x994a('0x33')]=_[_0x994a('0x30')](db[_0x994a('0x3e')]['rawAttributes']);_0xf41a95[_0x994a('0x2f')]=_[_0x994a('0x30')](_0x338a90[_0x994a('0x2f')]);_0xf41a95[_0x994a('0x31')]=_[_0x994a('0x32')](_0xf41a95['model'],_0xf41a95['query']);_0x5354f3[_0x994a('0x34')]=_[_0x994a('0x32')](_0xf41a95['model'],qs[_0x994a('0x35')](_0x338a90[_0x994a('0x2f')][_0x994a('0x35')]));_0x5354f3[_0x994a('0x34')]=_0x5354f3[_0x994a('0x34')]['length']?_0x5354f3[_0x994a('0x34')]:_0xf41a95[_0x994a('0x33')];if(_0x338a90[_0x994a('0x2f')]['includeAll']){_0x5354f3[_0x994a('0x40')]=[{'all':!![]}];}_0x5354f3=_[_0x994a('0x3d')]({},_0x5354f3,_0x338a90[_0x994a('0x45')]);return db['CannedAnswer'][_0x994a('0x46')](_0x5354f3)['then'](handleEntityNotFound(_0x3245a5,null))[_0x994a('0x22')](respondWithResult(_0x3245a5,null))[_0x994a('0x43')](handleError(_0x3245a5,null));};exports[_0x994a('0x21')]=function(_0x584a21,_0x38a085){if(_0x584a21[_0x994a('0x47')]['id']){delete _0x584a21[_0x994a('0x47')]['id'];}return db[_0x994a('0x3e')][_0x994a('0x46')]({'where':{'id':_0x584a21[_0x994a('0x44')]['id']}})['then'](handleEntityNotFound(_0x38a085,null))[_0x994a('0x22')](saveUpdates(_0x584a21[_0x994a('0x47')],null))[_0x994a('0x22')](respondWithResult(_0x38a085,null))['catch'](handleError(_0x38a085,null));};exports[_0x994a('0x23')]=function(_0x4e6b56,_0x20c623){return db[_0x994a('0x3e')]['find']({'where':{'id':_0x4e6b56[_0x994a('0x44')]['id']}})[_0x994a('0x22')](handleEntityNotFound(_0x20c623,null))[_0x994a('0x22')](removeEntity(_0x20c623,null))[_0x994a('0x43')](handleError(_0x20c623,null));};exports[_0x994a('0x48')]=function(_0x5068a0,_0x265224){var _0x420efe={'key':_0x5068a0[_0x994a('0x47')][_0x994a('0x2e')]};if(_0x5068a0[_0x994a('0x47')][_0x994a('0x49')]){_0x420efe[_0x994a('0x49')]=_0x5068a0[_0x994a('0x47')]['MailAccountId'];}else if(_0x5068a0[_0x994a('0x47')][_0x994a('0x4a')]){_0x420efe['SmsAccountId']=_0x5068a0[_0x994a('0x47')][_0x994a('0x4a')];}else if(_0x5068a0['body'][_0x994a('0x4b')]){_0x420efe['OpenchannelAccountId']=_0x5068a0[_0x994a('0x47')][_0x994a('0x4b')];}else if(_0x5068a0[_0x994a('0x47')][_0x994a('0x4c')]){_0x420efe[_0x994a('0x4c')]=_0x5068a0[_0x994a('0x47')][_0x994a('0x4c')];}return db[_0x994a('0x3e')]['find']({'where':_0x420efe})[_0x994a('0x22')](function(_0x13e098){if(_0x13e098){throw new db[(_0x994a('0x4d'))]['ValidationError'](_0x994a('0x4e'));}return db[_0x994a('0x3e')][_0x994a('0x48')](_0x5068a0['body']);})[_0x994a('0x22')](function(_0x38d036){var _0x2d1c20=_0x5068a0[_0x994a('0x4f')]['get']({'plain':!![]});if(!_0x2d1c20)throw new Error(_0x994a('0x50'));if(_0x2d1c20[_0x994a('0x51')]===_0x994a('0x4f')){var _0x47d3ee=_0x38d036['get']({'plain':!![]});return db[_0x994a('0x52')]['find']({'where':{'name':_0x994a('0x53'),'userProfileId':_0x2d1c20['userProfileId']},'raw':!![]})[_0x994a('0x22')](function(_0x1f6aba){if(_0x1f6aba&&_0x1f6aba[_0x994a('0x54')]===0x0){return db[_0x994a('0x25')][_0x994a('0x48')]({'name':_0x47d3ee['name'],'resourceId':_0x47d3ee['id'],'type':_0x1f6aba['name'],'sectionId':_0x1f6aba['id']},{})['then'](function(){return _0x38d036;});}else{return _0x38d036;}})['catch'](function(_0x579afd){logger['error'](_0x994a('0x55'),_0x579afd);throw _0x579afd;});}return _0x38d036;})[_0x994a('0x22')](respondWithResult(_0x265224,0xc9))[_0x994a('0x43')](handleError(_0x265224,null));}; \ No newline at end of file +var _0x4735=['ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','index','CannedAnswer','rawAttributes','fieldName','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','findAll','rows','params','options','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x305528,_0x263ca6){var _0x2531f0=function(_0x4b379a){while(--_0x4b379a){_0x305528['push'](_0x305528['shift']());}};_0x2531f0(++_0x263ca6);}(_0x4735,0x1b2));var _0x5473=function(_0x158b34,_0x2a8fb1){_0x158b34=_0x158b34-0x0;var _0x2f5449=_0x4735[_0x158b34];return _0x2f5449;};'use strict';var emlformat=require(_0x5473('0x0'));var rimraf=require(_0x5473('0x1'));var zipdir=require(_0x5473('0x2'));var jsonpatch=require(_0x5473('0x3'));var rp=require('request-promise');var moment=require(_0x5473('0x4'));var BPromise=require(_0x5473('0x5'));var Mustache=require(_0x5473('0x6'));var util=require(_0x5473('0x7'));var path=require(_0x5473('0x8'));var sox=require('sox');var csv=require(_0x5473('0x9'));var ejs=require(_0x5473('0xa'));var fs=require('fs');var fs_extra=require(_0x5473('0xb'));var _=require('lodash');var squel=require(_0x5473('0xc'));var crypto=require(_0x5473('0xd'));var jsforce=require(_0x5473('0xe'));var deskjs=require(_0x5473('0xf'));var toCsv=require(_0x5473('0x9'));var querystring=require('querystring');var Papa=require(_0x5473('0x10'));var Redis=require(_0x5473('0x11'));var authService=require(_0x5473('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5473('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5473('0x14'))(_0x5473('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5473('0x16'));var db=require(_0x5473('0x17'))['db'];function respondWithStatusCode(_0x5ab499,_0x28d978){_0x28d978=_0x28d978||0xcc;return function(_0xdaef94){if(_0xdaef94){return _0x5ab499[_0x5473('0x18')](_0x28d978);}return _0x5ab499[_0x5473('0x19')](_0x28d978)[_0x5473('0x1a')]();};}function respondWithResult(_0x340981,_0x5700b3){_0x5700b3=_0x5700b3||0xc8;return function(_0x202390){if(_0x202390){return _0x340981[_0x5473('0x19')](_0x5700b3)[_0x5473('0x1b')](_0x202390);}};}function respondWithFilteredResult(_0x5b7b66,_0x429b71){return function(_0xfdb37c){if(_0xfdb37c){var _0x5b1ab7=typeof _0x429b71[_0x5473('0x1c')]===_0x5473('0x1d')&&typeof _0x429b71['limit']===_0x5473('0x1d');var _0x20254a=_0xfdb37c['count'];var _0x35b680=_0x5b1ab7?0x0:_0x429b71[_0x5473('0x1c')];var _0xae89c0=_0x5b1ab7?_0xfdb37c[_0x5473('0x1e')]:_0x429b71[_0x5473('0x1c')]+_0x429b71['limit'];var _0xd06364;if(_0xae89c0>=_0x20254a){_0xae89c0=_0x20254a;_0xd06364=0xc8;}else{_0xd06364=0xce;}_0x5b7b66[_0x5473('0x19')](_0xd06364);return _0x5b7b66['set'](_0x5473('0x1f'),_0x35b680+'-'+_0xae89c0+'/'+_0x20254a)[_0x5473('0x1b')](_0xfdb37c);}return null;};}function patchUpdates(_0x19275a){return function(_0x110a51){try{jsonpatch[_0x5473('0x20')](_0x110a51,_0x19275a,!![]);}catch(_0x1784cf){return BPromise[_0x5473('0x21')](_0x1784cf);}return _0x110a51[_0x5473('0x22')]();};}function saveUpdates(_0x50e429,_0x1b912b){return function(_0x16e37a){if(_0x16e37a){return _0x16e37a[_0x5473('0x23')](_0x50e429)[_0x5473('0x24')](function(_0xc2754a){return _0xc2754a;});}return null;};}function removeEntity(_0x173947,_0x3de156){return function(_0x27194e){if(_0x27194e){return _0x27194e[_0x5473('0x25')]()[_0x5473('0x24')](function(){var _0x5cd616=_0x27194e[_0x5473('0x26')]({'plain':!![]});var _0x15fd84='CannedAnswers';return db[_0x5473('0x27')][_0x5473('0x25')]({'where':{'type':_0x15fd84,'resourceId':_0x5cd616['id']}})[_0x5473('0x24')](function(){return _0x27194e;});})[_0x5473('0x24')](function(){_0x173947[_0x5473('0x19')](0xcc)[_0x5473('0x1a')]();});}};}function handleEntityNotFound(_0x32a956,_0x357cc8){return function(_0x434018){if(!_0x434018){_0x32a956[_0x5473('0x18')](0x194);}return _0x434018;};}function handleError(_0x5b59f4,_0x1741ee){_0x1741ee=_0x1741ee||0x1f4;return function(_0x3e9ceb){logger['error'](_0x3e9ceb['stack']);if(_0x3e9ceb['name']){delete _0x3e9ceb['name'];}_0x5b59f4['status'](_0x1741ee)['send'](_0x3e9ceb);};}exports[_0x5473('0x28')]=function(_0x1f98d8,_0x5441cb){var _0x1be2c0={},_0x5076d7={},_0x5b2d51={'count':0x0,'rows':[]};var _0x190c57=_['map'](db[_0x5473('0x29')][_0x5473('0x2a')],function(_0x576d84){return{'name':_0x576d84[_0x5473('0x2b')],'type':_0x576d84['type'][_0x5473('0x2c')]};});_0x5076d7[_0x5473('0x2d')]=_[_0x5473('0x2e')](_0x190c57,_0x5473('0x2f'));_0x5076d7[_0x5473('0x30')]=_[_0x5473('0x31')](_0x1f98d8[_0x5473('0x30')]);_0x5076d7['filters']=_[_0x5473('0x32')](_0x5076d7[_0x5473('0x2d')],_0x5076d7['query']);_0x1be2c0[_0x5473('0x33')]=_[_0x5473('0x32')](_0x5076d7[_0x5473('0x2d')],qs[_0x5473('0x34')](_0x1f98d8[_0x5473('0x30')][_0x5473('0x34')]));_0x1be2c0[_0x5473('0x33')]=_0x1be2c0[_0x5473('0x33')][_0x5473('0x35')]?_0x1be2c0[_0x5473('0x33')]:_0x5076d7[_0x5473('0x2d')];if(!_0x1f98d8['query'][_0x5473('0x36')](_0x5473('0x37'))){_0x1be2c0[_0x5473('0x38')]=qs[_0x5473('0x38')](_0x1f98d8[_0x5473('0x30')][_0x5473('0x38')]);_0x1be2c0[_0x5473('0x1c')]=qs[_0x5473('0x1c')](_0x1f98d8[_0x5473('0x30')]['offset']);}_0x1be2c0['order']=qs['sort'](_0x1f98d8[_0x5473('0x30')][_0x5473('0x39')]);_0x1be2c0[_0x5473('0x3a')]=qs[_0x5473('0x3b')](_[_0x5473('0x3c')](_0x1f98d8['query'],_0x5076d7[_0x5473('0x3b')]),_0x190c57);if(_0x1f98d8['query'][_0x5473('0x3d')]){_0x1be2c0[_0x5473('0x3a')]=_['merge'](_0x1be2c0['where'],{'$or':[{'key':{'$like':'%'+_0x1f98d8[_0x5473('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x1f98d8[_0x5473('0x30')][_0x5473('0x3d')]+'%'}}]});}_0x1be2c0=_[_0x5473('0x3e')]({},_0x1be2c0,_0x1f98d8['options']);var _0x58bca0={'where':_0x1be2c0['where']};return db['CannedAnswer'][_0x5473('0x1e')](_0x58bca0)['then'](function(_0x582aef){_0x5b2d51[_0x5473('0x1e')]=_0x582aef;if(_0x1f98d8[_0x5473('0x30')]['includeAll']){_0x1be2c0['include']=[{'all':!![]}];}return db[_0x5473('0x29')][_0x5473('0x3f')](_0x1be2c0);})[_0x5473('0x24')](function(_0x8b8c2a){_0x5b2d51[_0x5473('0x40')]=_0x8b8c2a;return _0x5b2d51;})['then'](respondWithFilteredResult(_0x5441cb,_0x1be2c0))['catch'](handleError(_0x5441cb,null));};exports['show']=function(_0x351b59,_0x1cfbc4){var _0x129edc={'raw':!![],'where':{'id':_0x351b59[_0x5473('0x41')]['id']}},_0x39cc90={};_0x39cc90[_0x5473('0x2d')]=_['keys'](db['CannedAnswer'][_0x5473('0x2a')]);_0x39cc90[_0x5473('0x30')]=_[_0x5473('0x31')](_0x351b59[_0x5473('0x30')]);_0x39cc90[_0x5473('0x3b')]=_[_0x5473('0x32')](_0x39cc90['model'],_0x39cc90['query']);_0x129edc[_0x5473('0x33')]=_[_0x5473('0x32')](_0x39cc90[_0x5473('0x2d')],qs[_0x5473('0x34')](_0x351b59['query'][_0x5473('0x34')]));_0x129edc['attributes']=_0x129edc[_0x5473('0x33')][_0x5473('0x35')]?_0x129edc[_0x5473('0x33')]:_0x39cc90[_0x5473('0x2d')];if(_0x351b59[_0x5473('0x30')]['includeAll']){_0x129edc['include']=[{'all':!![]}];}_0x129edc=_[_0x5473('0x3e')]({},_0x129edc,_0x351b59[_0x5473('0x42')]);return db[_0x5473('0x29')][_0x5473('0x43')](_0x129edc)[_0x5473('0x24')](handleEntityNotFound(_0x1cfbc4,null))[_0x5473('0x24')](respondWithResult(_0x1cfbc4,null))['catch'](handleError(_0x1cfbc4,null));};exports[_0x5473('0x23')]=function(_0x482657,_0x350a9e){if(_0x482657['body']['id']){delete _0x482657[_0x5473('0x44')]['id'];}return db[_0x5473('0x29')][_0x5473('0x43')]({'where':{'id':_0x482657[_0x5473('0x41')]['id']}})[_0x5473('0x24')](handleEntityNotFound(_0x350a9e,null))[_0x5473('0x24')](saveUpdates(_0x482657[_0x5473('0x44')],null))['then'](respondWithResult(_0x350a9e,null))[_0x5473('0x45')](handleError(_0x350a9e,null));};exports[_0x5473('0x25')]=function(_0x1c84ca,_0x54cfbb){return db[_0x5473('0x29')][_0x5473('0x43')]({'where':{'id':_0x1c84ca['params']['id']}})[_0x5473('0x24')](handleEntityNotFound(_0x54cfbb,null))[_0x5473('0x24')](removeEntity(_0x54cfbb,null))[_0x5473('0x45')](handleError(_0x54cfbb,null));};exports[_0x5473('0x46')]=function(_0x5e74a8,_0x3a63c6){var _0x3fdf0d={'key':_0x5e74a8[_0x5473('0x44')]['key']};if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x47')]){_0x3fdf0d['MailAccountId']=_0x5e74a8['body'][_0x5473('0x47')];}else if(_0x5e74a8['body'][_0x5473('0x48')]){_0x3fdf0d['SmsAccountId']=_0x5e74a8[_0x5473('0x44')][_0x5473('0x48')];}else if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x49')]){_0x3fdf0d[_0x5473('0x49')]=_0x5e74a8[_0x5473('0x44')][_0x5473('0x49')];}else if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x4a')]){_0x3fdf0d[_0x5473('0x4a')]=_0x5e74a8[_0x5473('0x44')][_0x5473('0x4a')];}return db[_0x5473('0x29')]['find']({'where':_0x3fdf0d})[_0x5473('0x24')](function(_0x2bbc2a){if(_0x2bbc2a){throw new db[(_0x5473('0x4b'))][(_0x5473('0x4c'))](_0x5473('0x4d'));}return db['CannedAnswer'][_0x5473('0x46')](_0x5e74a8[_0x5473('0x44')]);})['then'](function(_0x3debd7){var _0x3abed2=_0x5e74a8[_0x5473('0x4e')][_0x5473('0x26')]({'plain':!![]});if(!_0x3abed2)throw new Error(_0x5473('0x4f'));if(_0x3abed2[_0x5473('0x50')]===_0x5473('0x4e')){var _0x260063=_0x3debd7[_0x5473('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5473('0x51'),'userProfileId':_0x3abed2['userProfileId']},'raw':!![]})['then'](function(_0x5e7a7a){if(_0x5e7a7a&&_0x5e7a7a[_0x5473('0x52')]===0x0){return db[_0x5473('0x27')][_0x5473('0x46')]({'name':_0x260063[_0x5473('0x2f')],'resourceId':_0x260063['id'],'type':_0x5e7a7a[_0x5473('0x2f')],'sectionId':_0x5e7a7a['id']},{})[_0x5473('0x24')](function(){return _0x3debd7;});}else{return _0x3debd7;}})[_0x5473('0x45')](function(_0x85543a){logger[_0x5473('0x53')](_0x5473('0x54'),_0x85543a);throw _0x85543a;});}return _0x3debd7;})[_0x5473('0x24')](respondWithResult(_0x3a63c6,0xc9))[_0x5473('0x45')](handleError(_0x3a63c6,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 616d464..f117ea6 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 _0x96dd=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x355eb4,_0x374bbc){var _0x4f623f=function(_0x177fef){while(--_0x177fef){_0x355eb4['push'](_0x355eb4['shift']());}};_0x4f623f(++_0x374bbc);}(_0x96dd,0x162));var _0xd96d=function(_0x41c149,_0x347948){_0x41c149=_0x41c149-0x0;var _0x4aca6b=_0x96dd[_0x41c149];return _0x4aca6b;};'use strict';var _=require('lodash');var util=require(_0xd96d('0x0'));var logger=require(_0xd96d('0x1'))(_0xd96d('0x2'));var moment=require(_0xd96d('0x3'));var BPromise=require(_0xd96d('0x4'));var rp=require(_0xd96d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd96d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd96d('0x7'));module['exports']=function(_0x5956ea,_0x3192be){return _0x5956ea[_0xd96d('0x8')](_0xd96d('0x9'),attributes,{'tableName':_0xd96d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd96d('0xb'),'collate':_0xd96d('0xc')});}; \ No newline at end of file +var _0x75a2=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x10d29b,_0x57a0a1){var _0x3d297e=function(_0x2062fa){while(--_0x2062fa){_0x10d29b['push'](_0x10d29b['shift']());}};_0x3d297e(++_0x57a0a1);}(_0x75a2,0x85));var _0x275a=function(_0x332957,_0x1dae22){_0x332957=_0x332957-0x0;var _0x226105=_0x75a2[_0x332957];return _0x226105;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var logger=require(_0x275a('0x2'))(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require('bluebird');var rp=require(_0x275a('0x5'));var fs=require('fs');var path=require(_0x275a('0x6'));var rimraf=require(_0x275a('0x7'));var config=require(_0x275a('0x8'));var attributes=require(_0x275a('0x9'));module[_0x275a('0xa')]=function(_0x4548ca,_0x5dd171){return _0x4548ca[_0x275a('0xb')](_0x275a('0xc'),attributes,{'tableName':_0x275a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x275a('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index dddba79..ecb273a 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(_0x49b979,_0x8f819d){var _0x52b435=function(_0xfb55d9){while(--_0xfb55d9){_0x49b979['push'](_0x49b979['shift']());}};_0x52b435(++_0x8f819d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x49c258,_0x3dca5e){var _0xdaac28=function(_0x419209){while(--_0x419209){_0x49c258['push'](_0x49c258['shift']());}};_0xdaac28(++_0x3dca5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 ef01cb3..68e97d3 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 _0xe01b=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe01b,0x109));var _0xbe01=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xe01b[_0x2d2ca2];return _0x48489d;};'use strict';var multer=require(_0xbe01('0x0'));var util=require(_0xbe01('0x1'));var path=require(_0xbe01('0x2'));var timeout=require(_0xbe01('0x3'));var express=require(_0xbe01('0x4'));var router=express[_0xbe01('0x5')]();var fs_extra=require(_0xbe01('0x6'));var auth=require(_0xbe01('0x7'));var interaction=require(_0xbe01('0x8'));var config=require(_0xbe01('0x9'));var controller=require(_0xbe01('0xa'));router[_0xbe01('0xb')]('/',auth[_0xbe01('0xc')](),controller['index']);router[_0xbe01('0xb')](_0xbe01('0xd'),auth['isAuthenticated'](),controller[_0xbe01('0xe')]);router[_0xbe01('0xf')]('/',auth['isAuthenticated'](),controller[_0xbe01('0x10')]);router[_0xbe01('0x11')](_0xbe01('0xd'),auth[_0xbe01('0xc')](),controller[_0xbe01('0x12')]);router[_0xbe01('0x13')]('/:id',auth[_0xbe01('0xc')](),controller['destroy']);module[_0xbe01('0x14')]=router; \ No newline at end of file +var _0x9fcb=['destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x19132a,_0x4388b3){var _0x279eaa=function(_0x9cdf38){while(--_0x9cdf38){_0x19132a['push'](_0x19132a['shift']());}};_0x279eaa(++_0x4388b3);}(_0x9fcb,0x10c));var _0xb9fc=function(_0xb34b31,_0x4cdb01){_0xb34b31=_0xb34b31-0x0;var _0x4d6e7c=_0x9fcb[_0xb34b31];return _0x4d6e7c;};'use strict';var multer=require('multer');var util=require(_0xb9fc('0x0'));var path=require(_0xb9fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb9fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb9fc('0x3'));var interaction=require(_0xb9fc('0x4'));var config=require(_0xb9fc('0x5'));var controller=require(_0xb9fc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb9fc('0x7')]);router[_0xb9fc('0x8')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0xb')]);router[_0xb9fc('0xc')]('/',auth['isAuthenticated'](),controller[_0xb9fc('0xd')]);router[_0xb9fc('0xe')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0xf')]);router[_0xb9fc('0x10')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0x11')]);module[_0xb9fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9cd18f8..04655a9 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 _0x3f19=['sequelize','STRING','INTEGER'];(function(_0x59cbab,_0x18cdc0){var _0x2a7cec=function(_0x17ce90){while(--_0x17ce90){_0x59cbab['push'](_0x59cbab['shift']());}};_0x2a7cec(++_0x18cdc0);}(_0x3f19,0xc0));var _0x93f1=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x3f19[_0x5192de];return _0x4e287e;};'use strict';var Sequelize=require(_0x93f1('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x93f1('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x93f1('0x1')]},'dcontext':{'type':Sequelize[_0x93f1('0x1')]},'channel':{'type':Sequelize[_0x93f1('0x1')]},'dstchannel':{'type':Sequelize[_0x93f1('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x93f1('0x1')]},'duration':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x93f1('0x1')]},'amaflags':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x93f1('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x93f1('0x1')]},'linkedid':{'type':Sequelize[_0x93f1('0x1')]},'sequence':{'type':Sequelize[_0x93f1('0x1')]},'peeraccount':{'type':Sequelize[_0x93f1('0x1')]},'type':{'type':Sequelize[_0x93f1('0x1')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x47fd=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4e8a59,_0x32bc84){var _0x22ba3e=function(_0x187e2f){while(--_0x187e2f){_0x4e8a59['push'](_0x4e8a59['shift']());}};_0x22ba3e(++_0x32bc84);}(_0x47fd,0x13c));var _0xd47f=function(_0xac2edb,_0x7ee06d){_0xac2edb=_0xac2edb-0x0;var _0x5eb36e=_0x47fd[_0xac2edb];return _0x5eb36e;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'calldate':{'type':Sequelize[_0xd47f('0x2')],'allowNull':![],'defaultValue':_0xd47f('0x3')},'clid':{'type':Sequelize[_0xd47f('0x4')]},'src':{'type':Sequelize[_0xd47f('0x4')]},'dst':{'type':Sequelize[_0xd47f('0x4')]},'dcontext':{'type':Sequelize[_0xd47f('0x4')]},'channel':{'type':Sequelize[_0xd47f('0x4')]},'dstchannel':{'type':Sequelize[_0xd47f('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd47f('0x4')]},'duration':{'type':Sequelize[_0xd47f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd47f('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd47f('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd47f('0x4')]},'peeraccount':{'type':Sequelize[_0xd47f('0x4')]},'type':{'type':Sequelize[_0xd47f('0x4')]},'tag':{'type':Sequelize[_0xd47f('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ec55c22..b2b2424 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 _0x032e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x55670d,_0x1f84da){var _0x1c46ae=function(_0x3059aa){while(--_0x3059aa){_0x55670d['push'](_0x55670d['shift']());}};_0x1c46ae(++_0x1f84da);}(_0x032e,0x124));var _0xe032=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x032e[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['Cdr'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_0x4e8b72,_0xe032('0x29'));_0x469290[_0xe032('0x30')]=_[_0xe032('0x31')](_0x5573e4['query']);_0x469290[_0xe032('0x32')]=_[_0xe032('0x33')](_0x469290[_0xe032('0x2e')],_0x469290[_0xe032('0x30')]);_0x38e7ea['attributes']=_[_0xe032('0x33')](_0x469290['model'],qs[_0xe032('0x34')](_0x5573e4['query'][_0xe032('0x34')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x35')]['length']?_0x38e7ea[_0xe032('0x35')]:_0x469290[_0xe032('0x2e')];if(!_0x5573e4['query'][_0xe032('0x36')](_0xe032('0x37'))){_0x38e7ea[_0xe032('0x21')]=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea['offset']=qs[_0xe032('0x1f')](_0x5573e4[_0xe032('0x30')]['offset']);}_0x38e7ea[_0xe032('0x38')]=qs[_0xe032('0x39')](_0x5573e4['query'][_0xe032('0x39')]);_0x38e7ea[_0xe032('0x3a')]=qs[_0xe032('0x32')](_[_0xe032('0x3b')](_0x5573e4[_0xe032('0x30')],_0x469290[_0xe032('0x32')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x30')][_0xe032('0x3c')]){_0x38e7ea[_0xe032('0x3a')]=_[_0xe032('0x3d')](_0x38e7ea[_0xe032('0x3a')],{'$or':_[_0xe032('0x2f')](_0x4e8b72,function(_0x30571c){if(_0x30571c[_0xe032('0x2d')]!==_0xe032('0x3e')){var _0x14ea1a={};_0x14ea1a[_0x30571c[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3c')]+'%'};return _0x14ea1a;}})});}_0x38e7ea=_['merge']({},_0x38e7ea,_0x5573e4[_0xe032('0x3f')]);var _0x2bcfb4={'where':_0x38e7ea[_0xe032('0x3a')]};return db[_0xe032('0x40')][_0xe032('0x22')](_0x2bcfb4)['then'](function(_0x132d25){_0xae116e['count']=_0x132d25;if(_0x5573e4[_0xe032('0x30')]['includeAll']){_0x38e7ea[_0xe032('0x41')]=[{'all':!![]}];}return db[_0xe032('0x40')][_0xe032('0x42')](_0x38e7ea);})[_0xe032('0x27')](function(_0x4dc836){_0xae116e[_0xe032('0x43')]=_0x4dc836;return _0xae116e;})['then'](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x44')](handleError(_0x3e2575,null));};exports[_0xe032('0x45')]=function(_0x3c43f1,_0xe572b6){var _0x4b58eb={'raw':!![],'where':{'id':_0x3c43f1[_0xe032('0x46')]['id']}},_0x513b0c={};_0x513b0c[_0xe032('0x2e')]=_['keys'](db[_0xe032('0x40')][_0xe032('0x2b')]);_0x513b0c[_0xe032('0x30')]=_[_0xe032('0x31')](_0x3c43f1[_0xe032('0x30')]);_0x513b0c['filters']=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],_0x513b0c[_0xe032('0x30')]);_0x4b58eb[_0xe032('0x35')]=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],qs[_0xe032('0x34')](_0x3c43f1[_0xe032('0x30')]['fields']));_0x4b58eb['attributes']=_0x4b58eb[_0xe032('0x35')]['length']?_0x4b58eb[_0xe032('0x35')]:_0x513b0c[_0xe032('0x2e')];if(_0x3c43f1[_0xe032('0x30')][_0xe032('0x47')]){_0x4b58eb[_0xe032('0x41')]=[{'all':!![]}];}_0x4b58eb=_[_0xe032('0x3d')]({},_0x4b58eb,_0x3c43f1[_0xe032('0x3f')]);return db[_0xe032('0x40')][_0xe032('0x48')](_0x4b58eb)['then'](handleEntityNotFound(_0xe572b6,null))[_0xe032('0x27')](respondWithResult(_0xe572b6,null))['catch'](handleError(_0xe572b6,null));};exports['create']=function(_0x28f973,_0x2583e9){return db[_0xe032('0x40')][_0xe032('0x49')](_0x28f973['body'],{})[_0xe032('0x27')](respondWithResult(_0x2583e9,0xc9))[_0xe032('0x44')](handleError(_0x2583e9,null));};exports[_0xe032('0x26')]=function(_0x39ffb7,_0x1b3172){if(_0x39ffb7[_0xe032('0x4a')]['id']){delete _0x39ffb7[_0xe032('0x4a')]['id'];}return db['Cdr'][_0xe032('0x48')]({'where':{'id':_0x39ffb7[_0xe032('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b3172,null))[_0xe032('0x27')](saveUpdates(_0x39ffb7[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x1b3172,null))[_0xe032('0x44')](handleError(_0x1b3172,null));};exports[_0xe032('0x4b')]=function(_0x434f1a,_0x24b013){return db[_0xe032('0x40')][_0xe032('0x48')]({'where':{'id':_0x434f1a[_0xe032('0x46')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x24b013,null))[_0xe032('0x27')](removeEntity(_0x24b013,null))[_0xe032('0x44')](handleError(_0x24b013,null));};exports[_0xe032('0x4c')]=function(_0x4eabfc,_0x1c8b32){return db['Cdr'][_0xe032('0x4c')]()[_0xe032('0x27')](respondWithResult(_0x1c8b32,null))[_0xe032('0x44')](handleError(_0x1c8b32,null));}; \ No newline at end of file +var _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x5b47fb,_0x315692){_0x5b47fb=_0x5b47fb-0x0;var _0x3baae3=_0xf987[_0x5b47fb];return _0x3baae3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['Cdr']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['Cdr'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['Cdr'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['Cdr'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['Cdr'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 728c71e..0adb725 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(_0x718183,_0x396d32){var _0x1cf449=function(_0x3dc19f){while(--_0x3dc19f){_0x718183['push'](_0x718183['shift']());}};_0x1cf449(++_0x396d32);}(_0x7a54,0x106));var _0x47a5=function(_0x1d3462,_0xeabcf4){_0x1d3462=_0x1d3462-0x0;var _0x263001=_0x7a54[_0x1d3462];return _0x263001;};'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(_0x379e34,_0x199e44){var _0x36a674=function(_0x25a880){while(--_0x25a880){_0x379e34['push'](_0x379e34['shift']());}};_0x36a674(++_0x199e44);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 e8aa0e0..806e6fe 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 _0x31cd=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x31cd,0x19e));var _0xd31c=function(_0x53f7d0,_0x1f6111){_0x53f7d0=_0x53f7d0-0x0;var _0x5179aa=_0x31cd[_0x53f7d0];return _0x5179aa;};'use strict';var _=require(_0xd31c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd31c('0x1'));var rs=require(_0xd31c('0x2'));var fs=require('fs');var Redis=require(_0xd31c('0x3'));var db=require(_0xd31c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd31c('0x5'))(_0xd31c('0x6'));var config=require(_0xd31c('0x7'));var jayson=require(_0xd31c('0x8'));var client=jayson[_0xd31c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf974,_0x959f4e,_0x33f381){return new BPromise(function(_0x1b95f8,_0x20f162){return client[_0xd31c('0xa')](_0x2cf974,_0x33f381)[_0xd31c('0xb')](function(_0xc5c12f){logger[_0xd31c('0xc')](_0xd31c('0xd'),_0x959f4e,_0xd31c('0xe'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x959f4e,_0xd31c('0xe'),JSON[_0xd31c('0xf')](_0xc5c12f));if(_0xc5c12f[_0xd31c('0x10')]){if(_0xc5c12f[_0xd31c('0x10')]['code']===0x1f4){logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);return _0x20f162(_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);}logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);return _0x1b95f8(_0xc5c12f['error'][_0xd31c('0x11')]);}else{logger[_0xd31c('0xc')](_0xd31c('0xd'),_0x959f4e,'request\x20sent');_0x1b95f8(_0xc5c12f[_0xd31c('0x12')][_0xd31c('0x11')]);}})['catch'](function(_0x4fae15){logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0x4fae15);_0x20f162(_0x4fae15);});});} \ No newline at end of file +var _0x9f8a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','randomstring'];(function(_0x4f0726,_0x4f85bb){var _0xcd2134=function(_0x219af6){while(--_0x219af6){_0x4f0726['push'](_0x4f0726['shift']());}};_0xcd2134(++_0x4f85bb);}(_0x9f8a,0x17a));var _0xa9f8=function(_0xf64c27,_0x1ac538){_0xf64c27=_0xf64c27-0x0;var _0x5d778d=_0x9f8a[_0xf64c27];return _0x5d778d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa9f8('0x0'));var BPromise=require('bluebird');var rs=require(_0xa9f8('0x1'));var fs=require('fs');var Redis=require(_0xa9f8('0x2'));var db=require(_0xa9f8('0x3'))['db'];var utils=require(_0xa9f8('0x4'));var logger=require(_0xa9f8('0x5'))(_0xa9f8('0x6'));var config=require(_0xa9f8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41ffd4,_0xc90efe,_0xea2134){return new BPromise(function(_0x343f38,_0x182545){return client[_0xa9f8('0x9')](_0x41ffd4,_0xea2134)['then'](function(_0x2dbed8){logger[_0xa9f8('0xa')](_0xa9f8('0xb'),_0xc90efe,_0xa9f8('0xc'));logger[_0xa9f8('0xd')](_0xa9f8('0xe'),_0xc90efe,_0xa9f8('0xc'),JSON['stringify'](_0x2dbed8));if(_0x2dbed8[_0xa9f8('0xf')]){if(_0x2dbed8[_0xa9f8('0xf')][_0xa9f8('0x10')]===0x1f4){logger[_0xa9f8('0xf')]('Cdr,\x20%s,\x20%s',_0xc90efe,_0x2dbed8['error'][_0xa9f8('0x11')]);return _0x182545(_0x2dbed8['error'][_0xa9f8('0x11')]);}logger['error'](_0xa9f8('0xb'),_0xc90efe,_0x2dbed8[_0xa9f8('0xf')][_0xa9f8('0x11')]);return _0x343f38(_0x2dbed8[_0xa9f8('0xf')]['message']);}else{logger[_0xa9f8('0xa')](_0xa9f8('0xb'),_0xc90efe,'request\x20sent');_0x343f38(_0x2dbed8[_0xa9f8('0x12')]['message']);}})['catch'](function(_0x19a2d2){logger[_0xa9f8('0xf')](_0xa9f8('0xb'),_0xc90efe,_0x19a2d2);_0x182545(_0x19a2d2);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 98bd9e1..b1d2e69 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x4baac3,_0x481c9a){var _0x4fb4bc=function(_0x27d865){while(--_0x27d865){_0x4baac3['push'](_0x4baac3['shift']());}};_0x4fb4bc(++_0x481c9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 87804c1..50b2962 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 _0xf0ca=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x3b2f12,_0x30c73f){var _0x828b14=function(_0x50a2ed){while(--_0x50a2ed){_0x3b2f12['push'](_0x3b2f12['shift']());}};_0x828b14(++_0x30c73f);}(_0xf0ca,0xf4));var _0xaf0c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf0ca[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xaf0c('0x0'));module[_0xaf0c('0x1')]={'priority':{'type':Sequelize[_0xaf0c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaf0c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xaf0c('0x4')]()},'description':{'type':Sequelize[_0xaf0c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x432c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x44ca45,_0x205db4){var _0x47839f=function(_0x2cc87e){while(--_0x2cc87e){_0x44ca45['push'](_0x44ca45['shift']());}};_0x47839f(++_0x205db4);}(_0x432c,0x18b));var _0xc432=function(_0x1f4c1f,_0x19ff7f){_0x1f4c1f=_0x1f4c1f-0x0;var _0x56ef12=_0x432c[_0x1f4c1f];return _0x56ef12;};'use strict';var Sequelize=require(_0xc432('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc432('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc432('0x2')],'allowNull':![],'defaultValue':_0xc432('0x3')},'appdata':{'type':Sequelize[_0xc432('0x4')]()},'description':{'type':Sequelize[_0xc432('0x2')]},'interval':{'type':Sequelize[_0xc432('0x2')],'defaultValue':_0xc432('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index acc091e..f960289 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 _0xc817=['bluebird','mustache','util','path','sox','ejs','fs-extra','squel','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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','keys','intersection','query','attributes','fields','include','merge','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0xc9b747,_0x2c973a){var _0x9d53d8=function(_0x4d8eb7){while(--_0x4d8eb7){_0xc9b747['push'](_0xc9b747['shift']());}};_0x9d53d8(++_0x2c973a);}(_0xc817,0x75));var _0x7c81=function(_0x3c08af,_0x4cb004){_0x3c08af=_0x3c08af-0x0;var _0x27e893=_0xc817[_0x3c08af];return _0x27e893;};'use strict';var emlformat=require(_0x7c81('0x0'));var rimraf=require(_0x7c81('0x1'));var zipdir=require(_0x7c81('0x2'));var jsonpatch=require(_0x7c81('0x3'));var rp=require('request-promise');var moment=require(_0x7c81('0x4'));var BPromise=require(_0x7c81('0x5'));var Mustache=require(_0x7c81('0x6'));var util=require(_0x7c81('0x7'));var path=require(_0x7c81('0x8'));var sox=require(_0x7c81('0x9'));var csv=require('to-csv');var ejs=require(_0x7c81('0xa'));var fs=require('fs');var fs_extra=require(_0x7c81('0xb'));var _=require('lodash');var squel=require(_0x7c81('0xc'));var crypto=require(_0x7c81('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c81('0xe'));var toCsv=require(_0x7c81('0xf'));var querystring=require(_0x7c81('0x10'));var Papa=require(_0x7c81('0x11'));var Redis=require(_0x7c81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7c81('0x13'));var as=require(_0x7c81('0x14'));var hardwareService=require(_0x7c81('0x15'));var logger=require(_0x7c81('0x16'))(_0x7c81('0x17'));var utils=require(_0x7c81('0x18'));var config=require(_0x7c81('0x19'));var licenseUtil=require(_0x7c81('0x1a'));var db=require(_0x7c81('0x1b'))['db'];function respondWithStatusCode(_0x1f7771,_0xe463e){_0xe463e=_0xe463e||0xcc;return function(_0x1f7b5c){if(_0x1f7b5c){return _0x1f7771[_0x7c81('0x1c')](_0xe463e);}return _0x1f7771[_0x7c81('0x1d')](_0xe463e)[_0x7c81('0x1e')]();};}function respondWithResult(_0xebb73,_0x9362c4){_0x9362c4=_0x9362c4||0xc8;return function(_0x1abf26){if(_0x1abf26){return _0xebb73[_0x7c81('0x1d')](_0x9362c4)['json'](_0x1abf26);}};}function respondWithFilteredResult(_0x439b1c,_0x18aefa){return function(_0x2f3de2){if(_0x2f3de2){var _0x1021f8=typeof _0x18aefa[_0x7c81('0x1f')]===_0x7c81('0x20')&&typeof _0x18aefa[_0x7c81('0x21')]===_0x7c81('0x20');var _0x266bb0=_0x2f3de2['count'];var _0x14cce5=_0x1021f8?0x0:_0x18aefa[_0x7c81('0x1f')];var _0xfd62e=_0x1021f8?_0x2f3de2[_0x7c81('0x22')]:_0x18aefa['offset']+_0x18aefa[_0x7c81('0x21')];var _0x2e2b44;if(_0xfd62e>=_0x266bb0){_0xfd62e=_0x266bb0;_0x2e2b44=0xc8;}else{_0x2e2b44=0xce;}_0x439b1c[_0x7c81('0x1d')](_0x2e2b44);return _0x439b1c[_0x7c81('0x23')](_0x7c81('0x24'),_0x14cce5+'-'+_0xfd62e+'/'+_0x266bb0)['json'](_0x2f3de2);}return null;};}function patchUpdates(_0x679b81){return function(_0x1a9cee){try{jsonpatch[_0x7c81('0x25')](_0x1a9cee,_0x679b81,!![]);}catch(_0x35761d){return BPromise[_0x7c81('0x26')](_0x35761d);}return _0x1a9cee['save']();};}function saveUpdates(_0x887753,_0x198390){return function(_0x4704e9){if(_0x4704e9){return _0x4704e9[_0x7c81('0x27')](_0x887753)['then'](function(_0x3bdca5){return _0x3bdca5;});}return null;};}function removeEntity(_0x53bdb2,_0x4ecf3b){return function(_0x53f49c){if(_0x53f49c){return _0x53f49c[_0x7c81('0x28')]()['then'](function(){_0x53bdb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x349b5c,_0x5e707e){return function(_0x23de92){if(!_0x23de92){_0x349b5c[_0x7c81('0x1c')](0x194);}return _0x23de92;};}function handleError(_0x2e166f,_0x596d69){_0x596d69=_0x596d69||0x1f4;return function(_0xaedec){logger[_0x7c81('0x29')](_0xaedec[_0x7c81('0x2a')]);if(_0xaedec[_0x7c81('0x2b')]){delete _0xaedec[_0x7c81('0x2b')];}_0x2e166f[_0x7c81('0x1d')](_0x596d69)['send'](_0xaedec);};}exports[_0x7c81('0x2c')]=function(_0x5c8206,_0x2089c4){var _0x4f00be={'raw':!![],'where':{'id':_0x5c8206[_0x7c81('0x2d')]['id']}},_0x32c30f={};_0x32c30f[_0x7c81('0x2e')]=_['keys'](db[_0x7c81('0x2f')][_0x7c81('0x30')]);_0x32c30f['query']=_[_0x7c81('0x31')](_0x5c8206['query']);_0x32c30f['filters']=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],_0x32c30f[_0x7c81('0x33')]);_0x4f00be[_0x7c81('0x34')]=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],qs[_0x7c81('0x35')](_0x5c8206[_0x7c81('0x33')]['fields']));_0x4f00be[_0x7c81('0x34')]=_0x4f00be[_0x7c81('0x34')]['length']?_0x4f00be[_0x7c81('0x34')]:_0x32c30f[_0x7c81('0x2e')];if(_0x5c8206[_0x7c81('0x33')]['includeAll']){_0x4f00be[_0x7c81('0x36')]=[{'all':!![]}];}_0x4f00be=_[_0x7c81('0x37')]({},_0x4f00be,_0x5c8206[_0x7c81('0x38')]);return db[_0x7c81('0x2f')][_0x7c81('0x39')](_0x4f00be)[_0x7c81('0x3a')](handleEntityNotFound(_0x2089c4,null))[_0x7c81('0x3a')](respondWithResult(_0x2089c4,null))[_0x7c81('0x3b')](handleError(_0x2089c4,null));};exports[_0x7c81('0x27')]=function(_0x2dcef6,_0x3a5351){if(_0x2dcef6[_0x7c81('0x3c')]['id']){delete _0x2dcef6[_0x7c81('0x3c')]['id'];}return db['ChatApplication'][_0x7c81('0x39')]({'where':{'id':_0x2dcef6[_0x7c81('0x2d')]['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x3a5351,null))[_0x7c81('0x3a')](saveUpdates(_0x2dcef6[_0x7c81('0x3c')],null))['then'](respondWithResult(_0x3a5351,null))['catch'](handleError(_0x3a5351,null));};exports[_0x7c81('0x28')]=function(_0x3bcd76,_0x397a61){return db[_0x7c81('0x2f')][_0x7c81('0x39')]({'where':{'id':_0x3bcd76['params']['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x397a61,null))[_0x7c81('0x3a')](removeEntity(_0x397a61,null))[_0x7c81('0x3b')](handleError(_0x397a61,null));}; \ No newline at end of file +var _0x780f=['crypto','jsforce','desk.js','to-csv','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','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','attributes','intersection','fields','length','include','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel'];(function(_0xa99db9,_0x21c347){var _0x4c69a7=function(_0x1f2bce){while(--_0x1f2bce){_0xa99db9['push'](_0xa99db9['shift']());}};_0x4c69a7(++_0x21c347);}(_0x780f,0x6c));var _0xf780=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x780f[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require(_0xf780('0x1'));var zipdir=require(_0xf780('0x2'));var jsonpatch=require(_0xf780('0x3'));var rp=require(_0xf780('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf780('0x5'));var util=require(_0xf780('0x6'));var path=require(_0xf780('0x7'));var sox=require(_0xf780('0x8'));var csv=require('to-csv');var ejs=require(_0xf780('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf780('0xa'));var squel=require(_0xf780('0xb'));var crypto=require(_0xf780('0xc'));var jsforce=require(_0xf780('0xd'));var deskjs=require(_0xf780('0xe'));var toCsv=require(_0xf780('0xf'));var querystring=require('querystring');var Papa=require(_0xf780('0x10'));var Redis=require(_0xf780('0x11'));var authService=require(_0xf780('0x12'));var qs=require(_0xf780('0x13'));var as=require(_0xf780('0x14'));var hardwareService=require(_0xf780('0x15'));var logger=require(_0xf780('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf780('0x17'));var licenseUtil=require(_0xf780('0x18'));var db=require(_0xf780('0x19'))['db'];function respondWithStatusCode(_0x1a8520,_0x5f04e1){_0x5f04e1=_0x5f04e1||0xcc;return function(_0x24aa4f){if(_0x24aa4f){return _0x1a8520[_0xf780('0x1a')](_0x5f04e1);}return _0x1a8520[_0xf780('0x1b')](_0x5f04e1)[_0xf780('0x1c')]();};}function respondWithResult(_0x5c353b,_0x5a64bc){_0x5a64bc=_0x5a64bc||0xc8;return function(_0x4be599){if(_0x4be599){return _0x5c353b[_0xf780('0x1b')](_0x5a64bc)[_0xf780('0x1d')](_0x4be599);}};}function respondWithFilteredResult(_0xc1e872,_0x187b6d){return function(_0x206d34){if(_0x206d34){var _0x335ba6=typeof _0x187b6d[_0xf780('0x1e')]==='undefined'&&typeof _0x187b6d[_0xf780('0x1f')]===_0xf780('0x20');var _0xa78b1b=_0x206d34[_0xf780('0x21')];var _0x5d5a81=_0x335ba6?0x0:_0x187b6d[_0xf780('0x1e')];var _0x53dfee=_0x335ba6?_0x206d34[_0xf780('0x21')]:_0x187b6d[_0xf780('0x1e')]+_0x187b6d['limit'];var _0x29dae1;if(_0x53dfee>=_0xa78b1b){_0x53dfee=_0xa78b1b;_0x29dae1=0xc8;}else{_0x29dae1=0xce;}_0xc1e872[_0xf780('0x1b')](_0x29dae1);return _0xc1e872['set'](_0xf780('0x22'),_0x5d5a81+'-'+_0x53dfee+'/'+_0xa78b1b)[_0xf780('0x1d')](_0x206d34);}return null;};}function patchUpdates(_0x3c7054){return function(_0x4065bb){try{jsonpatch[_0xf780('0x23')](_0x4065bb,_0x3c7054,!![]);}catch(_0x147de9){return BPromise['reject'](_0x147de9);}return _0x4065bb[_0xf780('0x24')]();};}function saveUpdates(_0x4de546,_0x5853ea){return function(_0x45d80e){if(_0x45d80e){return _0x45d80e[_0xf780('0x25')](_0x4de546)[_0xf780('0x26')](function(_0x58bb66){return _0x58bb66;});}return null;};}function removeEntity(_0x2fcb2d,_0x373dce){return function(_0x4f59b1){if(_0x4f59b1){return _0x4f59b1[_0xf780('0x27')]()['then'](function(){_0x2fcb2d[_0xf780('0x1b')](0xcc)[_0xf780('0x1c')]();});}};}function handleEntityNotFound(_0x5d4053,_0x589208){return function(_0x3710bb){if(!_0x3710bb){_0x5d4053[_0xf780('0x1a')](0x194);}return _0x3710bb;};}function handleError(_0x462435,_0x40d9c9){_0x40d9c9=_0x40d9c9||0x1f4;return function(_0x458c76){logger[_0xf780('0x28')](_0x458c76[_0xf780('0x29')]);if(_0x458c76['name']){delete _0x458c76['name'];}_0x462435['status'](_0x40d9c9)[_0xf780('0x2a')](_0x458c76);};}exports[_0xf780('0x2b')]=function(_0x26452f,_0x4ef8c3){var _0x4ed256={'raw':!![],'where':{'id':_0x26452f[_0xf780('0x2c')]['id']}},_0x36bc63={};_0x36bc63[_0xf780('0x2d')]=_['keys'](db[_0xf780('0x2e')][_0xf780('0x2f')]);_0x36bc63[_0xf780('0x30')]=_[_0xf780('0x31')](_0x26452f['query']);_0x36bc63[_0xf780('0x32')]=_['intersection'](_0x36bc63[_0xf780('0x2d')],_0x36bc63[_0xf780('0x30')]);_0x4ed256[_0xf780('0x33')]=_[_0xf780('0x34')](_0x36bc63[_0xf780('0x2d')],qs[_0xf780('0x35')](_0x26452f[_0xf780('0x30')][_0xf780('0x35')]));_0x4ed256['attributes']=_0x4ed256[_0xf780('0x33')][_0xf780('0x36')]?_0x4ed256[_0xf780('0x33')]:_0x36bc63[_0xf780('0x2d')];if(_0x26452f[_0xf780('0x30')]['includeAll']){_0x4ed256[_0xf780('0x37')]=[{'all':!![]}];}_0x4ed256=_['merge']({},_0x4ed256,_0x26452f[_0xf780('0x38')]);return db[_0xf780('0x2e')][_0xf780('0x39')](_0x4ed256)['then'](handleEntityNotFound(_0x4ef8c3,null))[_0xf780('0x26')](respondWithResult(_0x4ef8c3,null))[_0xf780('0x3a')](handleError(_0x4ef8c3,null));};exports[_0xf780('0x25')]=function(_0x9fb1b5,_0x523b7a){if(_0x9fb1b5[_0xf780('0x3b')]['id']){delete _0x9fb1b5['body']['id'];}return db[_0xf780('0x2e')]['find']({'where':{'id':_0x9fb1b5['params']['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x523b7a,null))['then'](saveUpdates(_0x9fb1b5[_0xf780('0x3b')],null))[_0xf780('0x26')](respondWithResult(_0x523b7a,null))[_0xf780('0x3a')](handleError(_0x523b7a,null));};exports[_0xf780('0x27')]=function(_0x50e90c,_0x22121c){return db[_0xf780('0x2e')][_0xf780('0x39')]({'where':{'id':_0x50e90c[_0xf780('0x2c')]['id']}})['then'](handleEntityNotFound(_0x22121c,null))[_0xf780('0x26')](removeEntity(_0x22121c,null))[_0xf780('0x3a')](handleError(_0x22121c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 5e4df69..adcedcf 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 _0x92a4=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','chat_applications','utf8mb4_unicode_ci'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x92a4,0xb4));var _0x492a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x92a4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x492a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x492a('0x1'));var moment=require('moment');var BPromise=require(_0x492a('0x2'));var rp=require(_0x492a('0x3'));var fs=require('fs');var path=require(_0x492a('0x4'));var rimraf=require(_0x492a('0x5'));var config=require(_0x492a('0x6'));var attributes=require(_0x492a('0x7'));module['exports']=function(_0x239caf,_0x3e47a2){return _0x239caf['define']('ChatApplication',attributes,{'tableName':_0x492a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x492a('0x9')});}; \ No newline at end of file +var _0x9bde=['utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x9bde,0xe1));var _0xe9bd=function(_0x342bda,_0x4b4972){_0x342bda=_0x342bda-0x0;var _0x1ad7cb=_0x9bde[_0x342bda];return _0x1ad7cb;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9bd('0xc'),'collate':_0xe9bd('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index aaf3970..c078456 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 _0xad36=['http','request','info','ChatApplication,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x54d0b1,_0x1abf62){var _0x26a67c=function(_0x120064){while(--_0x120064){_0x54d0b1['push'](_0x54d0b1['shift']());}};_0x26a67c(++_0x1abf62);}(_0xad36,0x7f));var _0x6ad3=function(_0x26d7dc,_0x38a8da){_0x26d7dc=_0x26d7dc-0x0;var _0x344d75=_0xad36[_0x26d7dc];return _0x344d75;};'use strict';var _=require(_0x6ad3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ad3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ad3('0x2'));var db=require(_0x6ad3('0x3'))['db'];var utils=require(_0x6ad3('0x4'));var logger=require('../../config/logger')(_0x6ad3('0x5'));var config=require(_0x6ad3('0x6'));var jayson=require(_0x6ad3('0x7'));var client=jayson[_0x6ad3('0x8')][_0x6ad3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53ab57,_0x591ebd,_0x5eb561){return new BPromise(function(_0x33d67a,_0x4ec2b7){return client[_0x6ad3('0xa')](_0x53ab57,_0x5eb561)['then'](function(_0x10477e){logger[_0x6ad3('0xb')](_0x6ad3('0xc'),_0x591ebd,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x591ebd,'request\x20sent',JSON['stringify'](_0x10477e));if(_0x10477e[_0x6ad3('0xd')]){if(_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xe')]===0x1f4){logger['error'](_0x6ad3('0xc'),_0x591ebd,_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xf')]);return _0x4ec2b7(_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xf')]);}logger['error'](_0x6ad3('0xc'),_0x591ebd,_0x10477e['error'][_0x6ad3('0xf')]);return _0x33d67a(_0x10477e[_0x6ad3('0xd')]['message']);}else{logger[_0x6ad3('0xb')](_0x6ad3('0xc'),_0x591ebd,'request\x20sent');_0x33d67a(_0x10477e[_0x6ad3('0x10')]['message']);}})['catch'](function(_0x217e92){logger[_0x6ad3('0xd')](_0x6ad3('0xc'),_0x591ebd,_0x217e92);_0x4ec2b7(_0x217e92);});});} \ No newline at end of file +var _0x47cc=['info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x11a287,_0x57df55){var _0x111e64=function(_0x34be85){while(--_0x34be85){_0x11a287['push'](_0x11a287['shift']());}};_0x111e64(++_0x57df55);}(_0x47cc,0x1ab));var _0xc47c=function(_0x23a64a,_0x425c5e){_0x23a64a=_0x23a64a-0x0;var _0x343a23=_0x47cc[_0x23a64a];return _0x343a23;};'use strict';var _=require(_0xc47c('0x0'));var util=require('util');var moment=require(_0xc47c('0x1'));var BPromise=require(_0xc47c('0x2'));var rs=require(_0xc47c('0x3'));var fs=require('fs');var Redis=require(_0xc47c('0x4'));var db=require(_0xc47c('0x5'))['db'];var utils=require(_0xc47c('0x6'));var logger=require('../../config/logger')(_0xc47c('0x7'));var config=require('../../config/environment');var jayson=require(_0xc47c('0x8'));var client=jayson[_0xc47c('0x9')][_0xc47c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ec245,_0x4321c0,_0x519c9e){return new BPromise(function(_0x57e040,_0x5dbe59){return client[_0xc47c('0xb')](_0x3ec245,_0x519c9e)[_0xc47c('0xc')](function(_0x4a0907){logger[_0xc47c('0xd')](_0xc47c('0xe'),_0x4321c0,'request\x20sent');logger[_0xc47c('0xf')](_0xc47c('0x10'),_0x4321c0,_0xc47c('0x11'),JSON[_0xc47c('0x12')](_0x4a0907));if(_0x4a0907[_0xc47c('0x13')]){if(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x14')]===0x1f4){logger['error'](_0xc47c('0xe'),_0x4321c0,_0x4a0907['error'][_0xc47c('0x15')]);return _0x5dbe59(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);}logger['error'](_0xc47c('0xe'),_0x4321c0,_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);return _0x57e040(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);}else{logger[_0xc47c('0xd')](_0xc47c('0xe'),_0x4321c0,_0xc47c('0x11'));_0x57e040(_0x4a0907['result'][_0xc47c('0x15')]);}})['catch'](function(_0x2a8f0a){logger[_0xc47c('0x13')](_0xc47c('0xe'),_0x4321c0,_0x2a8f0a);_0x5dbe59(_0x2a8f0a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index eb0bacd..14664b3 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 _0xacc1=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','/:id','delete','destroy','exports','multer','util'];(function(_0xe68a4c,_0x1cfead){var _0x492b36=function(_0x501185){while(--_0x501185){_0xe68a4c['push'](_0xe68a4c['shift']());}};_0x492b36(++_0x1cfead);}(_0xacc1,0x7e));var _0x1acc=function(_0x4388cc,_0x51fba1){_0x4388cc=_0x4388cc-0x0;var _0x3e3f42=_0xacc1[_0x4388cc];return _0x3e3f42;};'use strict';var multer=require(_0x1acc('0x0'));var util=require(_0x1acc('0x1'));var path=require(_0x1acc('0x2'));var timeout=require(_0x1acc('0x3'));var express=require(_0x1acc('0x4'));var router=express['Router']();var fs_extra=require(_0x1acc('0x5'));var auth=require(_0x1acc('0x6'));var interaction=require(_0x1acc('0x7'));var config=require(_0x1acc('0x8'));var controller=require(_0x1acc('0x9'));router['get']('/:id',auth[_0x1acc('0xa')](),controller[_0x1acc('0xb')]);router['put'](_0x1acc('0xc'),auth[_0x1acc('0xa')](),controller['update']);router[_0x1acc('0xd')](_0x1acc('0xc'),auth[_0x1acc('0xa')](),controller[_0x1acc('0xe')]);module[_0x1acc('0xf')]=router; \ No newline at end of file +var _0x821f=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x821f,0x1d3));var _0xf821=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x821f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf821('0x0'));var util=require(_0xf821('0x1'));var path=require('path');var timeout=require(_0xf821('0x2'));var express=require(_0xf821('0x3'));var router=express[_0xf821('0x4')]();var fs_extra=require(_0xf821('0x5'));var auth=require(_0xf821('0x6'));var interaction=require(_0xf821('0x7'));var config=require(_0xf821('0x8'));var controller=require(_0xf821('0x9'));router[_0xf821('0xa')](_0xf821('0xb'),auth[_0xf821('0xc')](),controller[_0xf821('0xd')]);router[_0xf821('0xe')]('/:id',auth[_0xf821('0xc')](),controller['update']);router[_0xf821('0xf')](_0xf821('0xb'),auth[_0xf821('0xc')](),controller['destroy']);module[_0xf821('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a435e32..ed3c53b 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 _0xf424=['BOOLEAN','exports','STRING'];(function(_0x2e1ddf,_0x3cae85){var _0x41c080=function(_0x409eb4){while(--_0x409eb4){_0x2e1ddf['push'](_0x2e1ddf['shift']());}};_0x41c080(++_0x3cae85);}(_0xf424,0x15d));var _0x4f42=function(_0x50fb34,_0x56b847){_0x50fb34=_0x50fb34-0x0;var _0x478797=_0xf424[_0x50fb34];return _0x478797;};'use strict';var Sequelize=require('sequelize');module[_0x4f42('0x0')]={'name':{'type':Sequelize[_0x4f42('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f42('0x1')]},'write':{'type':Sequelize[_0x4f42('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0af5=['STRING','BOOLEAN','exports'];(function(_0x2ea9fd,_0x45d80b){var _0x27d18e=function(_0x20a0c9){while(--_0x20a0c9){_0x2ea9fd['push'](_0x2ea9fd['shift']());}};_0x27d18e(++_0x45d80b);}(_0x0af5,0x158));var _0x50af=function(_0x2bc91f,_0x47502d){_0x2bc91f=_0x2bc91f-0x0;var _0x6b010d=_0x0af5[_0x2bc91f];return _0x6b010d;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x50af('0x1')]},'write':{'type':Sequelize[_0x50af('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 639dc2e..c7200e0 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 _0xe3a7=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','ChatGroup','count','include','findAll','rows','catch','params','intersection','length','includeAll','find','create','body','describe','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse'];(function(_0x44b9f9,_0x3e1ade){var _0x17512a=function(_0xb8ffd4){while(--_0xb8ffd4){_0x44b9f9['push'](_0x44b9f9['shift']());}};_0x17512a(++_0x3e1ade);}(_0xe3a7,0x1c5));var _0x7e3a=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xe3a7[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x7e3a('0x0'));var rimraf=require(_0x7e3a('0x1'));var zipdir=require(_0x7e3a('0x2'));var jsonpatch=require(_0x7e3a('0x3'));var rp=require(_0x7e3a('0x4'));var moment=require(_0x7e3a('0x5'));var BPromise=require(_0x7e3a('0x6'));var Mustache=require(_0x7e3a('0x7'));var util=require(_0x7e3a('0x8'));var path=require(_0x7e3a('0x9'));var sox=require(_0x7e3a('0xa'));var csv=require(_0x7e3a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e3a('0xc'));var _=require(_0x7e3a('0xd'));var squel=require(_0x7e3a('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e3a('0xf'));var toCsv=require(_0x7e3a('0xb'));var querystring=require('querystring');var Papa=require(_0x7e3a('0x10'));var Redis=require(_0x7e3a('0x11'));var authService=require(_0x7e3a('0x12'));var qs=require(_0x7e3a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e3a('0x14'));var logger=require('../../config/logger')(_0x7e3a('0x15'));var utils=require(_0x7e3a('0x16'));var config=require(_0x7e3a('0x17'));var licenseUtil=require(_0x7e3a('0x18'));var db=require(_0x7e3a('0x19'))['db'];config[_0x7e3a('0x1a')]=_[_0x7e3a('0x1b')](config[_0x7e3a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e3a('0x1c'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x7e3a('0x1d')](socket);function respondWithStatusCode(_0x537f69,_0x212d91){_0x212d91=_0x212d91||0xcc;return function(_0x47fe41){if(_0x47fe41){return _0x537f69[_0x7e3a('0x1e')](_0x212d91);}return _0x537f69[_0x7e3a('0x1f')](_0x212d91)['end']();};}function respondWithResult(_0x460310,_0x10ee32){_0x10ee32=_0x10ee32||0xc8;return function(_0x4d8fd0){if(_0x4d8fd0){return _0x460310[_0x7e3a('0x1f')](_0x10ee32)[_0x7e3a('0x20')](_0x4d8fd0);}};}function respondWithFilteredResult(_0xdaed9c,_0x3e21b5){return function(_0x170267){if(_0x170267){var _0x11a50c=typeof _0x3e21b5['offset']===_0x7e3a('0x21')&&typeof _0x3e21b5['limit']===_0x7e3a('0x21');var _0x14627e=_0x170267['count'];var _0x50690e=_0x11a50c?0x0:_0x3e21b5[_0x7e3a('0x22')];var _0x2d4cc3=_0x11a50c?_0x170267['count']:_0x3e21b5['offset']+_0x3e21b5[_0x7e3a('0x23')];var _0xc64a6a;if(_0x2d4cc3>=_0x14627e){_0x2d4cc3=_0x14627e;_0xc64a6a=0xc8;}else{_0xc64a6a=0xce;}_0xdaed9c[_0x7e3a('0x1f')](_0xc64a6a);return _0xdaed9c[_0x7e3a('0x24')](_0x7e3a('0x25'),_0x50690e+'-'+_0x2d4cc3+'/'+_0x14627e)[_0x7e3a('0x20')](_0x170267);}return null;};}function patchUpdates(_0x4bd047){return function(_0x35a6a6){try{jsonpatch[_0x7e3a('0x26')](_0x35a6a6,_0x4bd047,!![]);}catch(_0x5785b0){return BPromise[_0x7e3a('0x27')](_0x5785b0);}return _0x35a6a6[_0x7e3a('0x28')]();};}function saveUpdates(_0x476a26,_0x3df743){return function(_0x300539){if(_0x300539){return _0x300539[_0x7e3a('0x29')](_0x476a26)['then'](function(_0x4d8062){return _0x4d8062;});}return null;};}function removeEntity(_0x26981b,_0x5b6bdb){return function(_0x583bb0){if(_0x583bb0){return _0x583bb0[_0x7e3a('0x2a')]()[_0x7e3a('0x2b')](function(){_0x26981b[_0x7e3a('0x1f')](0xcc)[_0x7e3a('0x2c')]();});}};}function handleEntityNotFound(_0x43db10,_0x2b4cd9){return function(_0x5a8e6f){if(!_0x5a8e6f){_0x43db10[_0x7e3a('0x1e')](0x194);}return _0x5a8e6f;};}function handleError(_0x228a9b,_0x1dcc33){_0x1dcc33=_0x1dcc33||0x1f4;return function(_0x5a635b){logger[_0x7e3a('0x2d')](_0x5a635b[_0x7e3a('0x2e')]);if(_0x5a635b[_0x7e3a('0x2f')]){delete _0x5a635b[_0x7e3a('0x2f')];}_0x228a9b[_0x7e3a('0x1f')](_0x1dcc33)['send'](_0x5a635b);};}exports[_0x7e3a('0x30')]=function(_0x136599,_0x45a47f){var _0x121cce={},_0x331710={},_0x328a59={'count':0x0,'rows':[]};var _0x314345=_[_0x7e3a('0x31')](db['ChatGroup'][_0x7e3a('0x32')],function(_0x92519){return{'name':_0x92519['fieldName'],'type':_0x92519['type']['key']};});_0x331710['model']=_[_0x7e3a('0x31')](_0x314345,_0x7e3a('0x2f'));_0x331710[_0x7e3a('0x33')]=_[_0x7e3a('0x34')](_0x136599[_0x7e3a('0x33')]);_0x331710[_0x7e3a('0x35')]=_['intersection'](_0x331710[_0x7e3a('0x36')],_0x331710[_0x7e3a('0x33')]);_0x121cce[_0x7e3a('0x37')]=_['intersection'](_0x331710[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x136599['query'][_0x7e3a('0x38')]));_0x121cce[_0x7e3a('0x37')]=_0x121cce[_0x7e3a('0x37')]['length']?_0x121cce[_0x7e3a('0x37')]:_0x331710[_0x7e3a('0x36')];if(!_0x136599['query'][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x121cce[_0x7e3a('0x23')]=qs[_0x7e3a('0x23')](_0x136599[_0x7e3a('0x33')][_0x7e3a('0x23')]);_0x121cce[_0x7e3a('0x22')]=qs[_0x7e3a('0x22')](_0x136599[_0x7e3a('0x33')]['offset']);}_0x121cce[_0x7e3a('0x3b')]=qs[_0x7e3a('0x3c')](_0x136599['query'][_0x7e3a('0x3c')]);_0x121cce[_0x7e3a('0x3d')]=qs['filters'](_[_0x7e3a('0x3e')](_0x136599[_0x7e3a('0x33')],_0x331710['filters']),_0x314345);if(_0x136599[_0x7e3a('0x33')][_0x7e3a('0x3f')]){_0x121cce['where']=_['merge'](_0x121cce[_0x7e3a('0x3d')],{'$or':_['map'](_0x314345,function(_0x2a61f4){if(_0x2a61f4[_0x7e3a('0x40')]!=='VIRTUAL'){var _0x70e50c={};_0x70e50c[_0x2a61f4['name']]={'$like':'%'+_0x136599[_0x7e3a('0x33')]['filter']+'%'};return _0x70e50c;}})});}_0x121cce=_[_0x7e3a('0x41')]({},_0x121cce,_0x136599[_0x7e3a('0x42')]);var _0xc7cb8={'where':_0x121cce[_0x7e3a('0x3d')]};return db[_0x7e3a('0x43')]['count'](_0xc7cb8)[_0x7e3a('0x2b')](function(_0x5d539b){_0x328a59[_0x7e3a('0x44')]=_0x5d539b;if(_0x136599[_0x7e3a('0x33')]['includeAll']){_0x121cce[_0x7e3a('0x45')]=[{'all':!![]}];}return db[_0x7e3a('0x43')][_0x7e3a('0x46')](_0x121cce);})[_0x7e3a('0x2b')](function(_0x56aa2b){_0x328a59[_0x7e3a('0x47')]=_0x56aa2b;return _0x328a59;})[_0x7e3a('0x2b')](respondWithFilteredResult(_0x45a47f,_0x121cce))[_0x7e3a('0x48')](handleError(_0x45a47f,null));};exports['show']=function(_0x3383e9,_0x2a3d47){var _0x3aa57b={'raw':!![],'where':{'id':_0x3383e9[_0x7e3a('0x49')]['id']}},_0x19936c={};_0x19936c[_0x7e3a('0x36')]=_[_0x7e3a('0x34')](db[_0x7e3a('0x43')][_0x7e3a('0x32')]);_0x19936c['query']=_[_0x7e3a('0x34')](_0x3383e9['query']);_0x19936c[_0x7e3a('0x35')]=_[_0x7e3a('0x4a')](_0x19936c['model'],_0x19936c[_0x7e3a('0x33')]);_0x3aa57b[_0x7e3a('0x37')]=_[_0x7e3a('0x4a')](_0x19936c[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x3383e9[_0x7e3a('0x33')]['fields']));_0x3aa57b['attributes']=_0x3aa57b[_0x7e3a('0x37')][_0x7e3a('0x4b')]?_0x3aa57b[_0x7e3a('0x37')]:_0x19936c[_0x7e3a('0x36')];if(_0x3383e9['query'][_0x7e3a('0x4c')]){_0x3aa57b[_0x7e3a('0x45')]=[{'all':!![]}];}_0x3aa57b=_[_0x7e3a('0x41')]({},_0x3aa57b,_0x3383e9['options']);return db[_0x7e3a('0x43')][_0x7e3a('0x4d')](_0x3aa57b)[_0x7e3a('0x2b')](handleEntityNotFound(_0x2a3d47,null))[_0x7e3a('0x2b')](respondWithResult(_0x2a3d47,null))[_0x7e3a('0x48')](handleError(_0x2a3d47,null));};exports[_0x7e3a('0x4e')]=function(_0x30e314,_0x29ce5b){return db['ChatGroup'][_0x7e3a('0x4e')](_0x30e314['body'],{})[_0x7e3a('0x2b')](respondWithResult(_0x29ce5b,0xc9))[_0x7e3a('0x48')](handleError(_0x29ce5b,null));};exports[_0x7e3a('0x29')]=function(_0x161432,_0x4b912a){if(_0x161432[_0x7e3a('0x4f')]['id']){delete _0x161432[_0x7e3a('0x4f')]['id'];}return db['ChatGroup'][_0x7e3a('0x4d')]({'where':{'id':_0x161432[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x4b912a,null))[_0x7e3a('0x2b')](saveUpdates(_0x161432['body'],null))[_0x7e3a('0x2b')](respondWithResult(_0x4b912a,null))['catch'](handleError(_0x4b912a,null));};exports['destroy']=function(_0x578e0f,_0x44f17e){return db[_0x7e3a('0x43')]['find']({'where':{'id':_0x578e0f[_0x7e3a('0x49')]['id']}})['then'](handleEntityNotFound(_0x44f17e,null))[_0x7e3a('0x2b')](removeEntity(_0x44f17e,null))[_0x7e3a('0x48')](handleError(_0x44f17e,null));};exports['describe']=function(_0x104194,_0x1edabf){return db[_0x7e3a('0x43')][_0x7e3a('0x50')]()[_0x7e3a('0x2b')](respondWithResult(_0x1edabf,null))[_0x7e3a('0x48')](handleError(_0x1edabf,null));};exports['getUnread']=function(_0x3cc5a7,_0x392578,_0x5f2538){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x3cc5a7[_0x7e3a('0x49')]['id'],'ToId':_0x3cc5a7['user']['id'],'read':![]}})[_0x7e3a('0x2b')](function(_0x14b1c4){return{'id':_[_0x7e3a('0x51')](_0x3cc5a7[_0x7e3a('0x49')]['id']),'count':_0x14b1c4};})['then'](respondWithResult(_0x392578,null))[_0x7e3a('0x48')](handleError(_0x392578,null));};exports[_0x7e3a('0x52')]=function(_0x3ec313,_0x360607,_0x4cf0c6){return db[_0x7e3a('0x43')][_0x7e3a('0x4d')]({'where':{'id':_0x3ec313['params']['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x360607,null))[_0x7e3a('0x2b')](function(_0x2f0b6d){if(_0x2f0b6d){return _0x2f0b6d[_0x7e3a('0x52')](_0x3ec313['body'][_0x7e3a('0x53')],_['omit'](_0x3ec313['body'],[_0x7e3a('0x53'),'id'])||{});}})[_0x7e3a('0x2b')](respondWithResult(_0x360607,null))['catch'](handleError(_0x360607,null));};exports[_0x7e3a('0x54')]=function(_0x57225d,_0x263e05,_0x252b55){var _0x3ab66e={};var _0x5a5982={};var _0x392adb;var _0x2dcb5d;return db[_0x7e3a('0x43')][_0x7e3a('0x55')]({'where':{'id':_0x57225d[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x263e05,null))[_0x7e3a('0x2b')](function(_0x2e4563){if(_0x2e4563){_0x392adb=_0x2e4563;_0x5a5982[_0x7e3a('0x36')]=_[_0x7e3a('0x34')](db[_0x7e3a('0x56')][_0x7e3a('0x32')]);_0x5a5982[_0x7e3a('0x33')]=_[_0x7e3a('0x34')](_0x57225d[_0x7e3a('0x33')]);_0x5a5982[_0x7e3a('0x35')]=_['intersection'](_0x5a5982[_0x7e3a('0x36')],_0x5a5982['query']);_0x3ab66e[_0x7e3a('0x37')]=_['intersection'](_0x5a5982[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x57225d[_0x7e3a('0x33')]['fields']));_0x3ab66e['attributes']=_0x3ab66e[_0x7e3a('0x37')][_0x7e3a('0x4b')]?_0x3ab66e[_0x7e3a('0x37')]:_0x5a5982[_0x7e3a('0x36')];_0x3ab66e[_0x7e3a('0x3b')]=qs['sort'](_0x57225d['query'][_0x7e3a('0x3c')]);_0x3ab66e[_0x7e3a('0x3d')]=qs[_0x7e3a('0x35')](_[_0x7e3a('0x3e')](_0x57225d[_0x7e3a('0x33')],_0x5a5982[_0x7e3a('0x35')]));if(_0x57225d[_0x7e3a('0x33')]['filter']){_0x3ab66e['where']=_[_0x7e3a('0x41')](_0x3ab66e['where'],{'$or':_[_0x7e3a('0x31')](_0x3ab66e[_0x7e3a('0x37')],function(_0x3ab4c0){var _0x3179d5={};_0x3179d5[_0x3ab4c0]={'$like':'%'+_0x57225d[_0x7e3a('0x33')][_0x7e3a('0x3f')]+'%'};return _0x3179d5;})});}_0x3ab66e=_[_0x7e3a('0x41')]({},_0x3ab66e,_0x57225d[_0x7e3a('0x42')]);return _0x392adb['getMembers'](_0x3ab66e);}})[_0x7e3a('0x2b')](function(_0x1a7018){if(_0x1a7018){_0x2dcb5d=_0x1a7018[_0x7e3a('0x4b')];if(!_0x57225d[_0x7e3a('0x33')][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x3ab66e['limit']=qs[_0x7e3a('0x23')](_0x57225d[_0x7e3a('0x33')]['limit']);_0x3ab66e['offset']=qs[_0x7e3a('0x22')](_0x57225d[_0x7e3a('0x33')]['offset']);}return _0x392adb[_0x7e3a('0x54')](_0x3ab66e);}})[_0x7e3a('0x2b')](function(_0x13bb58){if(_0x13bb58){return _0x13bb58?{'count':_0x2dcb5d,'rows':_0x13bb58}:null;}})[_0x7e3a('0x2b')](respondWithResult(_0x263e05,null))[_0x7e3a('0x48')](handleError(_0x263e05,null));};exports[_0x7e3a('0x57')]=function(_0x10ae19,_0x5c3aa8,_0x3fbb8c){return db[_0x7e3a('0x43')][_0x7e3a('0x4d')]({'where':{'id':_0x10ae19[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x5c3aa8,null))[_0x7e3a('0x2b')](function(_0x4c7efc){if(_0x4c7efc){return _0x4c7efc['removeMembers'](_0x10ae19[_0x7e3a('0x33')][_0x7e3a('0x53')]);}})[_0x7e3a('0x2b')](respondWithStatusCode(_0x5c3aa8,null))[_0x7e3a('0x48')](handleError(_0x5c3aa8,null));};exports['addMessage']=function(_0x39cc63,_0xa8b0a9,_0x592c65){if(_0x39cc63['body']['id']){delete _0x39cc63[_0x7e3a('0x4f')]['id'];}return db[_0x7e3a('0x43')]['find']({'where':{'id':_0x39cc63[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0xa8b0a9,null))[_0x7e3a('0x2b')](function(_0x4dbebc){if(_0x4dbebc){_0x39cc63[_0x7e3a('0x4f')][_0x7e3a('0x58')]=_0x4dbebc['id'];return db[_0x7e3a('0x59')]['create'](_0x39cc63[_0x7e3a('0x4f')]);}})[_0x7e3a('0x2b')](respondWithResult(_0xa8b0a9,null))['catch'](handleError(_0xa8b0a9,null));};exports[_0x7e3a('0x5a')]=function(_0x14b545,_0x4d8a6b,_0x50f645){var _0x532448={};var _0x122289={};var _0x5bf4de;var _0x21457a;return db[_0x7e3a('0x43')][_0x7e3a('0x55')]({'where':{'id':_0x14b545[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x4d8a6b,null))[_0x7e3a('0x2b')](function(_0x4bb80){if(_0x4bb80){_0x5bf4de=_0x4bb80;_0x122289['model']=_['keys'](db['ChatInternalMessage'][_0x7e3a('0x32')]);_0x122289[_0x7e3a('0x33')]=_['keys'](_0x14b545[_0x7e3a('0x33')]);_0x122289[_0x7e3a('0x35')]=_[_0x7e3a('0x4a')](_0x122289[_0x7e3a('0x36')],_0x122289[_0x7e3a('0x33')]);_0x532448['attributes']=_[_0x7e3a('0x4a')](_0x122289[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x14b545['query'][_0x7e3a('0x38')]));_0x532448[_0x7e3a('0x37')]=_0x532448['attributes'][_0x7e3a('0x4b')]?_0x532448['attributes']:_0x122289[_0x7e3a('0x36')];_0x532448[_0x7e3a('0x3b')]=qs[_0x7e3a('0x3c')](_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3c')]);_0x532448[_0x7e3a('0x3d')]=qs[_0x7e3a('0x35')](_['pick'](_0x14b545[_0x7e3a('0x33')],_0x122289['filters']));if(_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3f')]){_0x532448['where']=_[_0x7e3a('0x41')](_0x532448['where'],{'$or':_[_0x7e3a('0x31')](_0x532448[_0x7e3a('0x37')],function(_0x5175c1){var _0x139f43={};_0x139f43[_0x5175c1]={'$like':'%'+_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3f')]+'%'};return _0x139f43;})});}if(_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x5b')]){var _0x4c90ad=_0x14b545['query'][_0x7e3a('0x5b')][_0x7e3a('0x5c')](',');var _0x3e8b65={};_0x3e8b65[_0x4c90ad[0x0]]={'$gte':moment(_0x4c90ad[0x1])[_0x7e3a('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x532448[_0x7e3a('0x3d')]=_[_0x7e3a('0x41')](_0x532448[_0x7e3a('0x3d')],_0x3e8b65);}_0x532448=_['merge']({},_0x532448,_0x14b545[_0x7e3a('0x42')]);return _0x5bf4de[_0x7e3a('0x5a')](_0x532448);}})[_0x7e3a('0x2b')](function(_0x3c7cf9){if(_0x3c7cf9){_0x21457a=_0x3c7cf9[_0x7e3a('0x4b')];if(!_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x532448['limit']=qs[_0x7e3a('0x23')](_0x14b545['query']['limit']);_0x532448[_0x7e3a('0x22')]=qs[_0x7e3a('0x22')](_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x22')]);}return _0x5bf4de[_0x7e3a('0x5a')](_0x532448);}})['then'](function(_0x5d9b6f){if(_0x5d9b6f){return _0x5d9b6f?{'count':_0x21457a,'rows':_0x5d9b6f}:null;}})[_0x7e3a('0x2b')](respondWithResult(_0x4d8a6b,null))[_0x7e3a('0x48')](handleError(_0x4d8a6b,null));}; \ No newline at end of file +var _0xa67f=['end','json','offset','limit','undefined','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','where','VIRTUAL','options','count','include','findAll','rows','catch','params','find','create','body','getUnread','ChatInternalMessage','user','addMembers','findOne','User','order','filter','getMembers','nolimit','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatGroup.socket','register','sendStatus','status'];(function(_0x188add,_0x758c25){var _0x15d8af=function(_0x55e7c6){while(--_0x55e7c6){_0x188add['push'](_0x188add['shift']());}};_0x15d8af(++_0x758c25);}(_0xa67f,0x1bc));var _0xfa67=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xa67f[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0xfa67('0x0'));var rimraf=require(_0xfa67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa67('0x2'));var rp=require('request-promise');var moment=require(_0xfa67('0x3'));var BPromise=require(_0xfa67('0x4'));var Mustache=require(_0xfa67('0x5'));var util=require(_0xfa67('0x6'));var path=require(_0xfa67('0x7'));var sox=require('sox');var csv=require(_0xfa67('0x8'));var ejs=require(_0xfa67('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa67('0xa'));var squel=require(_0xfa67('0xb'));var crypto=require(_0xfa67('0xc'));var jsforce=require(_0xfa67('0xd'));var deskjs=require(_0xfa67('0xe'));var toCsv=require(_0xfa67('0x8'));var querystring=require(_0xfa67('0xf'));var Papa=require(_0xfa67('0x10'));var Redis=require('ioredis');var authService=require(_0xfa67('0x11'));var qs=require(_0xfa67('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa67('0x13'));var logger=require(_0xfa67('0x14'))('api');var utils=require(_0xfa67('0x15'));var config=require(_0xfa67('0x16'));var licenseUtil=require(_0xfa67('0x17'));var db=require(_0xfa67('0x18'))['db'];config['redis']=_['defaults'](config[_0xfa67('0x19')],{'host':_0xfa67('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfa67('0x1b'))[_0xfa67('0x1c')](socket);function respondWithStatusCode(_0x533e5a,_0x55658a){_0x55658a=_0x55658a||0xcc;return function(_0x762b2d){if(_0x762b2d){return _0x533e5a[_0xfa67('0x1d')](_0x55658a);}return _0x533e5a[_0xfa67('0x1e')](_0x55658a)[_0xfa67('0x1f')]();};}function respondWithResult(_0x167149,_0x4aa352){_0x4aa352=_0x4aa352||0xc8;return function(_0x5eedbb){if(_0x5eedbb){return _0x167149['status'](_0x4aa352)[_0xfa67('0x20')](_0x5eedbb);}};}function respondWithFilteredResult(_0x3d686b,_0x13c5ef){return function(_0x53e389){if(_0x53e389){var _0x53b077=typeof _0x13c5ef[_0xfa67('0x21')]==='undefined'&&typeof _0x13c5ef[_0xfa67('0x22')]===_0xfa67('0x23');var _0xeed2aa=_0x53e389['count'];var _0xabbb3=_0x53b077?0x0:_0x13c5ef[_0xfa67('0x21')];var _0x3ec28d=_0x53b077?_0x53e389['count']:_0x13c5ef[_0xfa67('0x21')]+_0x13c5ef['limit'];var _0x7ed2ef;if(_0x3ec28d>=_0xeed2aa){_0x3ec28d=_0xeed2aa;_0x7ed2ef=0xc8;}else{_0x7ed2ef=0xce;}_0x3d686b['status'](_0x7ed2ef);return _0x3d686b[_0xfa67('0x24')](_0xfa67('0x25'),_0xabbb3+'-'+_0x3ec28d+'/'+_0xeed2aa)[_0xfa67('0x20')](_0x53e389);}return null;};}function patchUpdates(_0x24286b){return function(_0x4aaf3f){try{jsonpatch[_0xfa67('0x26')](_0x4aaf3f,_0x24286b,!![]);}catch(_0x53eb2e){return BPromise['reject'](_0x53eb2e);}return _0x4aaf3f[_0xfa67('0x27')]();};}function saveUpdates(_0x2334b6,_0x2cf637){return function(_0x19827b){if(_0x19827b){return _0x19827b[_0xfa67('0x28')](_0x2334b6)['then'](function(_0x3c6e64){return _0x3c6e64;});}return null;};}function removeEntity(_0x13559e,_0xf3db64){return function(_0xde484d){if(_0xde484d){return _0xde484d[_0xfa67('0x29')]()[_0xfa67('0x2a')](function(){_0x13559e[_0xfa67('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12aa99,_0x117ff6){return function(_0x1318c2){if(!_0x1318c2){_0x12aa99[_0xfa67('0x1d')](0x194);}return _0x1318c2;};}function handleError(_0x3d1f81,_0x377047){_0x377047=_0x377047||0x1f4;return function(_0x31bc49){logger[_0xfa67('0x2b')](_0x31bc49[_0xfa67('0x2c')]);if(_0x31bc49[_0xfa67('0x2d')]){delete _0x31bc49[_0xfa67('0x2d')];}_0x3d1f81[_0xfa67('0x1e')](_0x377047)[_0xfa67('0x2e')](_0x31bc49);};}exports[_0xfa67('0x2f')]=function(_0x2f5654,_0x35f4fa){var _0x1f61c2={},_0x5c4db6={},_0x4c4082={'count':0x0,'rows':[]};var _0x9492c6=_[_0xfa67('0x30')](db[_0xfa67('0x31')][_0xfa67('0x32')],function(_0x1274f0){return{'name':_0x1274f0[_0xfa67('0x33')],'type':_0x1274f0[_0xfa67('0x34')][_0xfa67('0x35')]};});_0x5c4db6[_0xfa67('0x36')]=_[_0xfa67('0x30')](_0x9492c6,_0xfa67('0x2d'));_0x5c4db6['query']=_[_0xfa67('0x37')](_0x2f5654[_0xfa67('0x38')]);_0x5c4db6['filters']=_[_0xfa67('0x39')](_0x5c4db6[_0xfa67('0x36')],_0x5c4db6[_0xfa67('0x38')]);_0x1f61c2[_0xfa67('0x3a')]=_[_0xfa67('0x39')](_0x5c4db6[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x1f61c2[_0xfa67('0x3a')]=_0x1f61c2[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x1f61c2[_0xfa67('0x3a')]:_0x5c4db6[_0xfa67('0x36')];if(!_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3d')]('nolimit')){_0x1f61c2['limit']=qs[_0xfa67('0x22')](_0x2f5654[_0xfa67('0x38')]['limit']);_0x1f61c2['offset']=qs[_0xfa67('0x21')](_0x2f5654[_0xfa67('0x38')]['offset']);}_0x1f61c2['order']=qs[_0xfa67('0x3e')](_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x1f61c2['where']=qs[_0xfa67('0x3f')](_[_0xfa67('0x40')](_0x2f5654[_0xfa67('0x38')],_0x5c4db6[_0xfa67('0x3f')]),_0x9492c6);if(_0x2f5654[_0xfa67('0x38')]['filter']){_0x1f61c2['where']=_[_0xfa67('0x41')](_0x1f61c2[_0xfa67('0x42')],{'$or':_[_0xfa67('0x30')](_0x9492c6,function(_0xf18f5){if(_0xf18f5[_0xfa67('0x34')]!==_0xfa67('0x43')){var _0x2c2122={};_0x2c2122[_0xf18f5[_0xfa67('0x2d')]]={'$like':'%'+_0x2f5654[_0xfa67('0x38')]['filter']+'%'};return _0x2c2122;}})});}_0x1f61c2=_[_0xfa67('0x41')]({},_0x1f61c2,_0x2f5654[_0xfa67('0x44')]);var _0x4d34ea={'where':_0x1f61c2[_0xfa67('0x42')]};return db[_0xfa67('0x31')]['count'](_0x4d34ea)[_0xfa67('0x2a')](function(_0xa14f54){_0x4c4082[_0xfa67('0x45')]=_0xa14f54;if(_0x2f5654['query']['includeAll']){_0x1f61c2[_0xfa67('0x46')]=[{'all':!![]}];}return db[_0xfa67('0x31')][_0xfa67('0x47')](_0x1f61c2);})[_0xfa67('0x2a')](function(_0x4196a0){_0x4c4082[_0xfa67('0x48')]=_0x4196a0;return _0x4c4082;})[_0xfa67('0x2a')](respondWithFilteredResult(_0x35f4fa,_0x1f61c2))[_0xfa67('0x49')](handleError(_0x35f4fa,null));};exports['show']=function(_0x31a41e,_0x11dd30){var _0x5670f2={'raw':!![],'where':{'id':_0x31a41e[_0xfa67('0x4a')]['id']}},_0x3aa704={};_0x3aa704['model']=_[_0xfa67('0x37')](db[_0xfa67('0x31')][_0xfa67('0x32')]);_0x3aa704['query']=_[_0xfa67('0x37')](_0x31a41e[_0xfa67('0x38')]);_0x3aa704[_0xfa67('0x3f')]=_[_0xfa67('0x39')](_0x3aa704[_0xfa67('0x36')],_0x3aa704['query']);_0x5670f2[_0xfa67('0x3a')]=_['intersection'](_0x3aa704[_0xfa67('0x36')],qs['fields'](_0x31a41e['query']['fields']));_0x5670f2[_0xfa67('0x3a')]=_0x5670f2[_0xfa67('0x3a')]['length']?_0x5670f2['attributes']:_0x3aa704['model'];if(_0x31a41e[_0xfa67('0x38')]['includeAll']){_0x5670f2[_0xfa67('0x46')]=[{'all':!![]}];}_0x5670f2=_[_0xfa67('0x41')]({},_0x5670f2,_0x31a41e[_0xfa67('0x44')]);return db[_0xfa67('0x31')][_0xfa67('0x4b')](_0x5670f2)['then'](handleEntityNotFound(_0x11dd30,null))[_0xfa67('0x2a')](respondWithResult(_0x11dd30,null))[_0xfa67('0x49')](handleError(_0x11dd30,null));};exports[_0xfa67('0x4c')]=function(_0x4b11b0,_0xd7ed6b){return db[_0xfa67('0x31')]['create'](_0x4b11b0['body'],{})['then'](respondWithResult(_0xd7ed6b,0xc9))[_0xfa67('0x49')](handleError(_0xd7ed6b,null));};exports['update']=function(_0x2230b2,_0x1a7a53){if(_0x2230b2[_0xfa67('0x4d')]['id']){delete _0x2230b2[_0xfa67('0x4d')]['id'];}return db[_0xfa67('0x31')]['find']({'where':{'id':_0x2230b2[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x1a7a53,null))[_0xfa67('0x2a')](saveUpdates(_0x2230b2[_0xfa67('0x4d')],null))[_0xfa67('0x2a')](respondWithResult(_0x1a7a53,null))['catch'](handleError(_0x1a7a53,null));};exports[_0xfa67('0x29')]=function(_0x1b49cc,_0xa8243f){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x1b49cc['params']['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0xa8243f,null))[_0xfa67('0x2a')](removeEntity(_0xa8243f,null))[_0xfa67('0x49')](handleError(_0xa8243f,null));};exports['describe']=function(_0x40e8c7,_0x3cbf35){return db[_0xfa67('0x31')]['describe']()[_0xfa67('0x2a')](respondWithResult(_0x3cbf35,null))[_0xfa67('0x49')](handleError(_0x3cbf35,null));};exports[_0xfa67('0x4e')]=function(_0x337081,_0x22c52c,_0x39d464){return db[_0xfa67('0x4f')]['count']({'where':{'ChatGroupId':_0x337081[_0xfa67('0x4a')]['id'],'ToId':_0x337081[_0xfa67('0x50')]['id'],'read':![]}})['then'](function(_0x4ce753){return{'id':_['toInteger'](_0x337081[_0xfa67('0x4a')]['id']),'count':_0x4ce753};})[_0xfa67('0x2a')](respondWithResult(_0x22c52c,null))[_0xfa67('0x49')](handleError(_0x22c52c,null));};exports[_0xfa67('0x51')]=function(_0x4eee51,_0x58b409,_0x4bd0a0){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x4eee51[_0xfa67('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58b409,null))[_0xfa67('0x2a')](function(_0x3f8d02){if(_0x3f8d02){return _0x3f8d02[_0xfa67('0x51')](_0x4eee51['body']['ids'],_['omit'](_0x4eee51['body'],['ids','id'])||{});}})[_0xfa67('0x2a')](respondWithResult(_0x58b409,null))[_0xfa67('0x49')](handleError(_0x58b409,null));};exports['getMembers']=function(_0x48117b,_0x39879f,_0x400033){var _0x425088={};var _0xb80914={};var _0x4e3473;var _0x1d45d3;return db[_0xfa67('0x31')][_0xfa67('0x52')]({'where':{'id':_0x48117b[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x39879f,null))['then'](function(_0xbd4c4b){if(_0xbd4c4b){_0x4e3473=_0xbd4c4b;_0xb80914[_0xfa67('0x36')]=_[_0xfa67('0x37')](db[_0xfa67('0x53')][_0xfa67('0x32')]);_0xb80914[_0xfa67('0x38')]=_[_0xfa67('0x37')](_0x48117b[_0xfa67('0x38')]);_0xb80914['filters']=_[_0xfa67('0x39')](_0xb80914[_0xfa67('0x36')],_0xb80914['query']);_0x425088[_0xfa67('0x3a')]=_[_0xfa67('0x39')](_0xb80914[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x48117b[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x425088['attributes']=_0x425088[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x425088['attributes']:_0xb80914[_0xfa67('0x36')];_0x425088[_0xfa67('0x54')]=qs[_0xfa67('0x3e')](_0x48117b[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x425088['where']=qs['filters'](_[_0xfa67('0x40')](_0x48117b[_0xfa67('0x38')],_0xb80914[_0xfa67('0x3f')]));if(_0x48117b[_0xfa67('0x38')][_0xfa67('0x55')]){_0x425088[_0xfa67('0x42')]=_[_0xfa67('0x41')](_0x425088[_0xfa67('0x42')],{'$or':_[_0xfa67('0x30')](_0x425088[_0xfa67('0x3a')],function(_0xff4ab3){var _0x192074={};_0x192074[_0xff4ab3]={'$like':'%'+_0x48117b['query'][_0xfa67('0x55')]+'%'};return _0x192074;})});}_0x425088=_['merge']({},_0x425088,_0x48117b[_0xfa67('0x44')]);return _0x4e3473[_0xfa67('0x56')](_0x425088);}})['then'](function(_0x37e0c6){if(_0x37e0c6){_0x1d45d3=_0x37e0c6[_0xfa67('0x3c')];if(!_0x48117b[_0xfa67('0x38')]['hasOwnProperty'](_0xfa67('0x57'))){_0x425088['limit']=qs['limit'](_0x48117b[_0xfa67('0x38')][_0xfa67('0x22')]);_0x425088[_0xfa67('0x21')]=qs[_0xfa67('0x21')](_0x48117b[_0xfa67('0x38')]['offset']);}return _0x4e3473['getMembers'](_0x425088);}})['then'](function(_0x54ecc2){if(_0x54ecc2){return _0x54ecc2?{'count':_0x1d45d3,'rows':_0x54ecc2}:null;}})['then'](respondWithResult(_0x39879f,null))[_0xfa67('0x49')](handleError(_0x39879f,null));};exports[_0xfa67('0x58')]=function(_0x588a6d,_0x19039f,_0x408bee){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x588a6d[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x19039f,null))[_0xfa67('0x2a')](function(_0x6caae9){if(_0x6caae9){return _0x6caae9[_0xfa67('0x58')](_0x588a6d['query'][_0xfa67('0x59')]);}})[_0xfa67('0x2a')](respondWithStatusCode(_0x19039f,null))['catch'](handleError(_0x19039f,null));};exports['addMessage']=function(_0x360092,_0x9afcd7,_0x355b34){if(_0x360092[_0xfa67('0x4d')]['id']){delete _0x360092[_0xfa67('0x4d')]['id'];}return db['ChatGroup'][_0xfa67('0x4b')]({'where':{'id':_0x360092[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x9afcd7,null))[_0xfa67('0x2a')](function(_0x4f99e5){if(_0x4f99e5){_0x360092[_0xfa67('0x4d')][_0xfa67('0x5a')]=_0x4f99e5['id'];return db[_0xfa67('0x4f')]['create'](_0x360092[_0xfa67('0x4d')]);}})[_0xfa67('0x2a')](respondWithResult(_0x9afcd7,null))[_0xfa67('0x49')](handleError(_0x9afcd7,null));};exports[_0xfa67('0x5b')]=function(_0x1801b5,_0x342fbb,_0x23917a){var _0x530dee={};var _0x3f2b01={};var _0x225e1b;var _0x3451fc;return db['ChatGroup'][_0xfa67('0x52')]({'where':{'id':_0x1801b5[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x342fbb,null))[_0xfa67('0x2a')](function(_0x44f067){if(_0x44f067){_0x225e1b=_0x44f067;_0x3f2b01[_0xfa67('0x36')]=_['keys'](db['ChatInternalMessage'][_0xfa67('0x32')]);_0x3f2b01[_0xfa67('0x38')]=_[_0xfa67('0x37')](_0x1801b5[_0xfa67('0x38')]);_0x3f2b01[_0xfa67('0x3f')]=_[_0xfa67('0x39')](_0x3f2b01[_0xfa67('0x36')],_0x3f2b01[_0xfa67('0x38')]);_0x530dee[_0xfa67('0x3a')]=_['intersection'](_0x3f2b01[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x530dee[_0xfa67('0x3a')]=_0x530dee[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x530dee['attributes']:_0x3f2b01['model'];_0x530dee[_0xfa67('0x54')]=qs['sort'](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x530dee[_0xfa67('0x42')]=qs[_0xfa67('0x3f')](_[_0xfa67('0x40')](_0x1801b5['query'],_0x3f2b01[_0xfa67('0x3f')]));if(_0x1801b5[_0xfa67('0x38')][_0xfa67('0x55')]){_0x530dee['where']=_['merge'](_0x530dee[_0xfa67('0x42')],{'$or':_['map'](_0x530dee[_0xfa67('0x3a')],function(_0x15150b){var _0x165c78={};_0x165c78[_0x15150b]={'$like':'%'+_0x1801b5[_0xfa67('0x38')][_0xfa67('0x55')]+'%'};return _0x165c78;})});}if(_0x1801b5[_0xfa67('0x38')]['$gte']){var _0x172ef0=_0x1801b5[_0xfa67('0x38')][_0xfa67('0x5c')][_0xfa67('0x5d')](',');var _0x1a5c3c={};_0x1a5c3c[_0x172ef0[0x0]]={'$gte':moment(_0x172ef0[0x1])[_0xfa67('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x530dee[_0xfa67('0x42')]=_[_0xfa67('0x41')](_0x530dee['where'],_0x1a5c3c);}_0x530dee=_[_0xfa67('0x41')]({},_0x530dee,_0x1801b5[_0xfa67('0x44')]);return _0x225e1b[_0xfa67('0x5b')](_0x530dee);}})[_0xfa67('0x2a')](function(_0x403ba1){if(_0x403ba1){_0x3451fc=_0x403ba1[_0xfa67('0x3c')];if(!_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3d')](_0xfa67('0x57'))){_0x530dee[_0xfa67('0x22')]=qs[_0xfa67('0x22')](_0x1801b5['query'][_0xfa67('0x22')]);_0x530dee[_0xfa67('0x21')]=qs[_0xfa67('0x21')](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x21')]);}return _0x225e1b[_0xfa67('0x5b')](_0x530dee);}})[_0xfa67('0x2a')](function(_0x342df7){if(_0x342df7){return _0x342df7?{'count':_0x3451fc,'rows':_0x342df7}:null;}})[_0xfa67('0x2a')](respondWithResult(_0x342fbb,null))[_0xfa67('0x49')](handleError(_0x342fbb,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index cf61ee8..103cd5a 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 _0x078f=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save','update','remove'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x078f,0x1b4));var _0xf078=function(_0x311c4d,_0xd99948){_0x311c4d=_0x311c4d-0x0;var _0x2677ce=_0x078f[_0x311c4d];return _0x2677ce;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xf078('0x0'))['db'][_0xf078('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf078('0x2'),'afterUpdate':_0xf078('0x3'),'afterDestroy':_0xf078('0x4')};function emitEvent(_0x1b4e81){return function(_0x5da705,_0x288c1a,_0x203e73){ChatGroupEvents[_0xf078('0x5')](_0x1b4e81+':'+_0x5da705['id'],_0x5da705);ChatGroupEvents[_0xf078('0x5')](_0x1b4e81,_0x5da705);_0x203e73(null);};}for(var e in events){if(events[_0xf078('0x6')](e)){var event=events[e];ChatGroup[_0xf078('0x7')](e,emitEvent(event));}}module[_0xf078('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x3588=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x294fe1,_0x9e5abf){var _0x79432d=function(_0x38d6ee){while(--_0x38d6ee){_0x294fe1['push'](_0x294fe1['shift']());}};_0x79432d(++_0x9e5abf);}(_0x3588,0x82));var _0x8358=function(_0x95b585,_0x282d1b){_0x95b585=_0x95b585-0x0;var _0x4c3d88=_0x3588[_0x95b585];return _0x4c3d88;};'use strict';var EventEmitter=require(_0x8358('0x0'));var ChatGroup=require(_0x8358('0x1'))['db'][_0x8358('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8358('0x3')](0x0);var events={'afterCreate':_0x8358('0x4'),'afterUpdate':_0x8358('0x5'),'afterDestroy':_0x8358('0x6')};function emitEvent(_0x586dd2){return function(_0x3fd803,_0xa7a3d4,_0x146ed6){ChatGroupEvents[_0x8358('0x7')](_0x586dd2+':'+_0x3fd803['id'],_0x3fd803);ChatGroupEvents['emit'](_0x586dd2,_0x3fd803);_0x146ed6(null);};}for(var e in events){if(events[_0x8358('0x8')](e)){var event=events[e];ChatGroup[_0x8358('0x9')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 06689f3..cf81c49 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 _0x70da=['request-promise','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','api','bluebird'];(function(_0x319e63,_0x14449b){var _0x3d1626=function(_0x5dce6a){while(--_0x5dce6a){_0x319e63['push'](_0x319e63['shift']());}};_0x3d1626(++_0x14449b);}(_0x70da,0x16e));var _0xa70d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70da[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xa70d('0x0'));var util=require(_0xa70d('0x1'));var logger=require('../../config/logger')(_0xa70d('0x2'));var moment=require('moment');var BPromise=require(_0xa70d('0x3'));var rp=require(_0xa70d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa70d('0x5'));var config=require('../../config/environment');var attributes=require(_0xa70d('0x6'));module[_0xa70d('0x7')]=function(_0x37d7a4,_0x577d8b){return _0x37d7a4[_0xa70d('0x8')](_0xa70d('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bf4=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0x3bf4,0x155));var _0x43bf=function(_0x95d377,_0x3b6143){_0x95d377=_0x95d377-0x0;var _0x4d7405=_0x3bf4[_0x95d377];return _0x4d7405;};'use strict';var _=require(_0x43bf('0x0'));var util=require(_0x43bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x43bf('0x2'));var BPromise=require('bluebird');var rp=require(_0x43bf('0x3'));var fs=require('fs');var path=require(_0x43bf('0x4'));var rimraf=require(_0x43bf('0x5'));var config=require(_0x43bf('0x6'));var attributes=require(_0x43bf('0x7'));module[_0x43bf('0x8')]=function(_0x5ace7c,_0x35d83e){return _0x5ace7c[_0x43bf('0x9')](_0x43bf('0xa'),attributes,{'tableName':_0x43bf('0xb'),'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 6ae2561..0b8563a 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 _0xbe2a=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x205426,_0x1d4d5c){var _0x596b9c=function(_0xcf2c4d){while(--_0xcf2c4d){_0x205426['push'](_0x205426['shift']());}};_0x596b9c(++_0x1d4d5c);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x112ce9,_0x47b7fd){_0x112ce9=_0x112ce9-0x0;var _0x5af3ee=_0xbe2a[_0x112ce9];return _0x5af3ee;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var moment=require(_0xabe2('0x2'));var BPromise=require(_0xabe2('0x3'));var rs=require(_0xabe2('0x4'));var fs=require('fs');var Redis=require(_0xabe2('0x5'));var db=require(_0xabe2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xabe2('0x7'))('rpc');var config=require(_0xabe2('0x8'));var jayson=require(_0xabe2('0x9'));var client=jayson[_0xabe2('0xa')][_0xabe2('0xb')]({'port':0x232a});config[_0xabe2('0xc')]=_[_0xabe2('0xd')](config['redis'],{'host':_0xabe2('0xe'),'port':0x18eb});var socket=require(_0xabe2('0xf'))(new Redis(config[_0xabe2('0xc')]));require(_0xabe2('0x10'))[_0xabe2('0x11')](socket);function respondWithRpcPromise(_0x1b6319,_0x53a91f,_0x27fbaa){return new BPromise(function(_0x307e01,_0x35ddd1){return client['request'](_0x1b6319,_0x27fbaa)['then'](function(_0x5742c5){logger[_0xabe2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x53a91f,_0xabe2('0x13'));logger[_0xabe2('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x53a91f,'request\x20sent',JSON[_0xabe2('0x15')](_0x5742c5));if(_0x5742c5[_0xabe2('0x16')]){if(_0x5742c5[_0xabe2('0x16')][_0xabe2('0x17')]===0x1f4){logger[_0xabe2('0x16')](_0xabe2('0x18'),_0x53a91f,_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);return _0x35ddd1(_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);}logger['error'](_0xabe2('0x18'),_0x53a91f,_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);return _0x307e01(_0x5742c5['error'][_0xabe2('0x19')]);}else{logger[_0xabe2('0x12')](_0xabe2('0x18'),_0x53a91f,_0xabe2('0x13'));_0x307e01(_0x5742c5['result'][_0xabe2('0x19')]);}})[_0xabe2('0x1a')](function(_0x50a49a){logger[_0xabe2('0x16')](_0xabe2('0x18'),_0x53a91f,_0x50a49a);_0x35ddd1(_0x50a49a);});});} \ No newline at end of file +var _0xeb0d=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x40bf14,_0x4cdad8){_0x40bf14=_0x40bf14-0x0;var _0x312c6d=_0xeb0d[_0x40bf14];return _0x312c6d;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});config[_0xdeb0('0xa')]=_['defaults'](config[_0xdeb0('0xa')],{'host':_0xdeb0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdeb0('0xa')]));require(_0xdeb0('0xc'))[_0xdeb0('0xd')](socket);function respondWithRpcPromise(_0x307271,_0x13e2c4,_0x43c43e){return new BPromise(function(_0x2eac19,_0x1ac0cf){return client['request'](_0x307271,_0x43c43e)['then'](function(_0x4169b0){logger['info'](_0xdeb0('0xe'),_0x13e2c4,_0xdeb0('0xf'));logger[_0xdeb0('0x10')](_0xdeb0('0x11'),_0x13e2c4,_0xdeb0('0xf'),JSON[_0xdeb0('0x12')](_0x4169b0));if(_0x4169b0[_0xdeb0('0x13')]){if(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x14')]===0x1f4){logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);return _0x1ac0cf(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0['error'][_0xdeb0('0x15')]);return _0x2eac19(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}else{logger['info'](_0xdeb0('0xe'),_0x13e2c4,'request\x20sent');_0x2eac19(_0x4169b0[_0xdeb0('0x16')][_0xdeb0('0x15')]);}})[_0xdeb0('0x17')](function(_0x52b34d){logger[_0xdeb0('0x13')]('ChatGroup,\x20%s,\x20%s',_0x13e2c4,_0x52b34d);_0x1ac0cf(_0x52b34d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index bd56dd4..7a36ad0 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 _0x45c2=['register','length','chatGroup:','remove','update','emit'];(function(_0x17fc05,_0x303972){var _0x58c557=function(_0x1b3816){while(--_0x1b3816){_0x17fc05['push'](_0x17fc05['shift']());}};_0x58c557(++_0x303972);}(_0x45c2,0x111));var _0x245c=function(_0x43c8de,_0x4ac946){_0x43c8de=_0x43c8de-0x0;var _0x17430a=_0x45c2[_0x43c8de];return _0x17430a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x245c('0x0'),_0x245c('0x1')];function createListener(_0x47384a,_0x5d4ae6){return function(_0x9adba8){_0x5d4ae6[_0x245c('0x2')](_0x47384a,_0x9adba8);};}function removeListener(_0x9cff52,_0x110ba2){return function(){ChatGroupEvents['removeListener'](_0x9cff52,_0x110ba2);};}exports[_0x245c('0x3')]=function(_0x5be884){for(var _0x425bb5=0x0,_0x55bbeb=events[_0x245c('0x4')];_0x425bb5<_0x55bbeb;_0x425bb5++){var _0x5f09db=events[_0x425bb5];var _0x24657c=createListener(_0x245c('0x5')+_0x5f09db,_0x5be884);ChatGroupEvents['on'](_0x5f09db,_0x24657c);}}; \ No newline at end of file +var _0x3304=['save','remove','register','length','chatGroup:','./chatGroup.events'];(function(_0x239e73,_0x236bd4){var _0x22e419=function(_0x50ec42){while(--_0x50ec42){_0x239e73['push'](_0x239e73['shift']());}};_0x22e419(++_0x236bd4);}(_0x3304,0x1d3));var _0x4330=function(_0x4a4f3e,_0x49950f){_0x4a4f3e=_0x4a4f3e-0x0;var _0x5e38f3=_0x3304[_0x4a4f3e];return _0x5e38f3;};'use strict';var ChatGroupEvents=require(_0x4330('0x0'));var events=[_0x4330('0x1'),_0x4330('0x2'),'update'];function createListener(_0x4b39b8,_0x469cd3){return function(_0x4759ca){_0x469cd3['emit'](_0x4b39b8,_0x4759ca);};}function removeListener(_0x45e4eb,_0x4269bd){return function(){ChatGroupEvents['removeListener'](_0x45e4eb,_0x4269bd);};}exports[_0x4330('0x3')]=function(_0x687853){for(var _0x70ce27=0x0,_0x41173a=events[_0x4330('0x4')];_0x70ce27<_0x41173a;_0x70ce27++){var _0x213702=events[_0x70ce27];var _0x1ac93a=createListener(_0x4330('0x5')+_0x213702,_0x687853);ChatGroupEvents['on'](_0x213702,_0x1ac93a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4243eab..385ec1a 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 _0x2f3d=['describe','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x2f3d,0x1ef));var _0xd2f3=function(_0x548585,_0xb3c573){_0x548585=_0x548585-0x0;var _0x7c573d=_0x2f3d[_0x548585];return _0x7c573d;};'use strict';var multer=require(_0xd2f3('0x0'));var util=require(_0xd2f3('0x1'));var path=require(_0xd2f3('0x2'));var timeout=require(_0xd2f3('0x3'));var express=require(_0xd2f3('0x4'));var router=express[_0xd2f3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd2f3('0x7'));var controller=require(_0xd2f3('0x8'));router[_0xd2f3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2f3('0x9')]('/describe',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xb')]);router[_0xd2f3('0x9')]('/:id',auth[_0xd2f3('0xa')](),controller['show']);router[_0xd2f3('0x9')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xd')]);router[_0xd2f3('0x9')](_0xd2f3('0xe'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xf')]);router[_0xd2f3('0x9')](_0xd2f3('0x10'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x11')]);router[_0xd2f3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2f3('0x12')](_0xd2f3('0xe'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x13')]);router[_0xd2f3('0x12')](_0xd2f3('0x10'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x14')]);router['put']('/:id',auth[_0xd2f3('0xa')](),controller['update']);router[_0xd2f3('0x15')](_0xd2f3('0x16'),auth['isAuthenticated'](),controller['destroy']);router[_0xd2f3('0x15')]('/:id/members',auth[_0xd2f3('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x62a9=['isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x358718,_0x17ffd9){var _0x23d079=function(_0x587e08){while(--_0x587e08){_0x358718['push'](_0x358718['shift']());}};_0x23d079(++_0x17ffd9);}(_0x62a9,0x138));var _0x962a=function(_0x5e3f0f,_0x16c6c7){_0x5e3f0f=_0x5e3f0f-0x0;var _0xbd8d66=_0x62a9[_0x5e3f0f];return _0xbd8d66;};'use strict';var multer=require(_0x962a('0x0'));var util=require(_0x962a('0x1'));var path=require(_0x962a('0x2'));var timeout=require(_0x962a('0x3'));var express=require(_0x962a('0x4'));var router=express[_0x962a('0x5')]();var fs_extra=require(_0x962a('0x6'));var auth=require(_0x962a('0x7'));var interaction=require(_0x962a('0x8'));var config=require(_0x962a('0x9'));var controller=require(_0x962a('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x962a('0xb')]('/describe',auth[_0x962a('0xc')](),controller['describe']);router[_0x962a('0xb')](_0x962a('0xd'),auth[_0x962a('0xc')](),controller[_0x962a('0xe')]);router[_0x962a('0xb')](_0x962a('0xf'),auth[_0x962a('0xc')](),controller[_0x962a('0x10')]);router['get'](_0x962a('0x11'),auth[_0x962a('0xc')](),controller[_0x962a('0x12')]);router[_0x962a('0xb')]('/:id/messages',auth[_0x962a('0xc')](),controller[_0x962a('0x13')]);router['post']('/',auth[_0x962a('0xc')](),controller[_0x962a('0x14')]);router[_0x962a('0x15')](_0x962a('0x11'),auth[_0x962a('0xc')](),controller[_0x962a('0x16')]);router[_0x962a('0x15')](_0x962a('0x17'),auth[_0x962a('0xc')](),controller['addMessage']);router[_0x962a('0x18')]('/:id',auth[_0x962a('0xc')](),controller['update']);router[_0x962a('0x19')](_0x962a('0xd'),auth[_0x962a('0xc')](),controller['destroy']);router[_0x962a('0x19')](_0x962a('0x11'),auth[_0x962a('0xc')](),controller['removeMembers']);module[_0x962a('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 1aa5c86..bc85655 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 _0x1ba2=['sequelize','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x49b7d9,_0x300676){var _0x42835e=function(_0x399247){while(--_0x399247){_0x49b7d9['push'](_0x49b7d9['shift']());}};_0x42835e(++_0x300676);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x21ba('0x2')](_0x21ba('0x3'),_0x21ba('0x4')),'defaultValue':_0x21ba('0x3')},'ratingMessage':{'type':Sequelize[_0x21ba('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x21ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x21ba('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x21ba('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x21ba('0x6')]},'browserName':{'type':Sequelize[_0x21ba('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x21ba('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x21ba('0x6')]},'deviceVendor':{'type':Sequelize[_0x21ba('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x21ba('0x5')]},'customerIp':{'type':Sequelize[_0x21ba('0x6')]},'formData':{'type':Sequelize[_0x21ba('0x5')](_0x21ba('0x8'))},'read1stAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x21ba('0x2')]('in',_0x21ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x21ba('0x6')]},'customerPort':{'type':Sequelize[_0x21ba('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x21ba('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xf2a6=['star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','ENUM','thumb'];(function(_0x2d35a3,_0xdc27d0){var _0x327d35=function(_0x593038){while(--_0x593038){_0x2d35a3['push'](_0x2d35a3['shift']());}};_0x327d35(++_0xdc27d0);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x47665e,_0x4009db){_0x47665e=_0x47665e-0x0;var _0x36318c=_0xf2a6[_0x47665e];return _0x36318c;};'use strict';var Sequelize=require(_0x6f2a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6f2a('0x1')]('star',_0x6f2a('0x2')),'defaultValue':_0x6f2a('0x3')},'ratingMessage':{'type':Sequelize[_0x6f2a('0x4')]},'pathTranscript':{'type':Sequelize[_0x6f2a('0x4')]},'mailTranscript':{'type':Sequelize[_0x6f2a('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6f2a('0x6')]},'disposition':{'type':Sequelize[_0x6f2a('0x5')]},'secondDisposition':{'type':Sequelize[_0x6f2a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6f2a('0x5')]},'note':{'type':Sequelize[_0x6f2a('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6f2a('0x5')]},'osName':{'type':Sequelize[_0x6f2a('0x5')]},'osVersion':{'type':Sequelize[_0x6f2a('0x5')]},'deviceModel':{'type':Sequelize[_0x6f2a('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x6f2a('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6f2a('0x5')]},'formData':{'type':Sequelize[_0x6f2a('0x4')](_0x6f2a('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6f2a('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f2a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6f2a('0x5')]},'customerPort':{'type':Sequelize[_0x6f2a('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x6f2a('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4cb71f4..9e88951 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 _0x3f27=['AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','Unauthorized','attachId','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','CmContact','Messages','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','ChatMessage','sort','options','findAll','getMyMessages','addTags','setTags','spread','emit','chatInteractionTags:save','server','files','tmp','attachments','firstName','lastName','direction','Owner','get','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createWriteStream','views','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','render','merge','body','agent','interaction','Users','map','fullname','Tags','TagIds','split','talking','unmanaged','abandoned','closed','UserId','waiting','disposition','answered','total','index','ChatInteraction','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_chat_interactions','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','conditions','find','value','having','`\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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','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)','unreadMessages','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','fields','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.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','groupBy','ChatInteractionId','push','rows','params','rawAttributes','includeAll','include','create','update','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x417854,_0x4d921d){var _0x1d73ef=function(_0x44b1a6){while(--_0x44b1a6){_0x417854['push'](_0x417854['shift']());}};_0x1d73ef(++_0x4d921d);}(_0x3f27,0x18b));var _0x73f2=function(_0x5f4523,_0x249874){_0x5f4523=_0x5f4523-0x0;var _0x2e6cee=_0x3f27[_0x5f4523];return _0x2e6cee;};'use strict';var emlformat=require(_0x73f2('0x0'));var rimraf=require(_0x73f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73f2('0x2'));var rp=require(_0x73f2('0x3'));var moment=require(_0x73f2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73f2('0x5'));var util=require('util');var path=require(_0x73f2('0x6'));var sox=require(_0x73f2('0x7'));var csv=require(_0x73f2('0x8'));var ejs=require(_0x73f2('0x9'));var fs=require('fs');var fs_extra=require(_0x73f2('0xa'));var _=require(_0x73f2('0xb'));var squel=require('squel');var crypto=require(_0x73f2('0xc'));var jsforce=require(_0x73f2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x73f2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73f2('0x10'));var pdf=require(_0x73f2('0x11'));var hardwareService=require(_0x73f2('0x12'));var logger=require('../../config/logger')(_0x73f2('0x13'));var utils=require(_0x73f2('0x14'));var config=require(_0x73f2('0x15'));var licenseUtil=require(_0x73f2('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x73f2('0x17')],{'host':_0x73f2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73f2('0x17')]));require(_0x73f2('0x19'))[_0x73f2('0x1a')](socket);var jayson=require(_0x73f2('0x1b'));var client=jayson['client'][_0x73f2('0x1c')]({'port':0x232b});var client9004=jayson[_0x73f2('0x1d')][_0x73f2('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x471f7b,_0x569e5a,_0x43bd18,_0x2c3805){return new BPromise(function(_0x57d1b8,_0x1b1bca){var _0xa75624=_0x2c3805||client;return _0xa75624[_0x73f2('0x1e')](_0x471f7b,_0x43bd18)[_0x73f2('0x1f')](function(_0x5132cf){logger[_0x73f2('0x20')](_0x73f2('0x21'),_0x569e5a,_0x73f2('0x22'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x569e5a,_0x73f2('0x22'),JSON[_0x73f2('0x23')](_0x5132cf));if(_0x5132cf[_0x73f2('0x24')]){if(_0x5132cf[_0x73f2('0x24')][_0x73f2('0x25')]===0x1f4){logger[_0x73f2('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x569e5a,_0x5132cf[_0x73f2('0x24')]['message']);return _0x1b1bca(_0x5132cf['error'][_0x73f2('0x26')]);}logger['error'](_0x73f2('0x21'),_0x569e5a,_0x5132cf[_0x73f2('0x24')]['message']);return _0x57d1b8(_0x5132cf[_0x73f2('0x24')]['message']);}else{logger[_0x73f2('0x20')](_0x73f2('0x21'),_0x569e5a,_0x73f2('0x22'));_0x57d1b8(_0x5132cf['result'][_0x73f2('0x26')]);}})[_0x73f2('0x27')](function(_0x3422a1){logger[_0x73f2('0x24')](_0x73f2('0x21'),_0x569e5a,_0x3422a1);_0x1b1bca(_0x3422a1);});});}function respondWithStatusCode(_0x2e438a,_0x3a355a){_0x3a355a=_0x3a355a||0xcc;return function(_0x444ec6){if(_0x444ec6){return _0x2e438a[_0x73f2('0x28')](_0x3a355a);}return _0x2e438a['status'](_0x3a355a)[_0x73f2('0x29')]();};}function respondWithResult(_0x4aee32,_0x355149){_0x355149=_0x355149||0xc8;return function(_0x13ea88){if(_0x13ea88){return _0x4aee32[_0x73f2('0x2a')](_0x355149)[_0x73f2('0x2b')](_0x13ea88);}};}function respondWithFilteredResult(_0x270ccd,_0x4ca88d){return function(_0x66a821){if(_0x66a821){var _0x206fb1=typeof _0x4ca88d['offset']===_0x73f2('0x2c')&&typeof _0x4ca88d[_0x73f2('0x2d')]===_0x73f2('0x2c');var _0x13891a=_0x66a821[_0x73f2('0x2e')];var _0x43a5d0=_0x206fb1?0x0:_0x4ca88d[_0x73f2('0x2f')];var _0x3353aa=_0x206fb1?_0x66a821[_0x73f2('0x2e')]:_0x4ca88d['offset']+_0x4ca88d[_0x73f2('0x2d')];var _0x5799ec;if(_0x3353aa>=_0x13891a){_0x3353aa=_0x13891a;_0x5799ec=0xc8;}else{_0x5799ec=0xce;}_0x270ccd[_0x73f2('0x2a')](_0x5799ec);return _0x270ccd[_0x73f2('0x30')](_0x73f2('0x31'),_0x43a5d0+'-'+_0x3353aa+'/'+_0x13891a)[_0x73f2('0x2b')](_0x66a821);}return null;};}function patchUpdates(_0x2df9e6){return function(_0x3f486a){try{jsonpatch[_0x73f2('0x32')](_0x3f486a,_0x2df9e6,!![]);}catch(_0x3d7a8a){return BPromise[_0x73f2('0x33')](_0x3d7a8a);}return _0x3f486a[_0x73f2('0x34')]();};}function saveUpdates(_0x20b634,_0x66cfa9){return function(_0x462ce3){if(_0x462ce3){return _0x462ce3['update'](_0x20b634)[_0x73f2('0x1f')](function(_0xc4a30){return _0xc4a30;});}return null;};}function removeEntity(_0x103aae,_0x2fd269){return function(_0xb0a8ec){if(_0xb0a8ec){return _0xb0a8ec[_0x73f2('0x35')]()[_0x73f2('0x1f')](function(){_0x103aae[_0x73f2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510aff,_0x277af3){return function(_0x128b4a){if(!_0x128b4a){_0x510aff[_0x73f2('0x28')](0x194);}return _0x128b4a;};}function handleError(_0x100559,_0x2e162e){_0x2e162e=_0x2e162e||0x1f4;return function(_0x297ed7){logger[_0x73f2('0x24')](_0x297ed7[_0x73f2('0x36')]);if(_0x297ed7['name']){delete _0x297ed7[_0x73f2('0x37')];}_0x100559['status'](_0x2e162e)[_0x73f2('0x38')](_0x297ed7);};}function getMustacheRender(_0x3a876e,_0x7999b2){return Mustache[_0x73f2('0x39')](_0x3a876e,_[_0x73f2('0x3a')](_0x7999b2[_0x73f2('0x3b')],{'contact':_0x7999b2['contact'],'message':_0x7999b2[_0x73f2('0x26')],'agent':_0x7999b2[_0x73f2('0x3c')],'interaction':_0x7999b2[_0x73f2('0x3d')],'account':_0x7999b2['account']}))||'';}function getInteractionUsers(_0x1a3380,_0x45c2cb){return new BPromise(function(_0x2ab080,_0x453e47){try{if(_0x45c2cb[_0x1a3380['id']]){_0x1a3380[_0x73f2('0x3e')]=_[_0x73f2('0x3f')](_0x45c2cb[_0x1a3380['id']],function(_0x484912){return{'id':_0x484912['id'],'fullname':_0x484912[_0x73f2('0x40')]};});}}catch(_0x5c72d1){_0x453e47(_0x5c72d1);}_0x2ab080(_0x1a3380);});}function getInteractionTags(_0x15fc40,_0x4e93a9){return new BPromise(function(_0x465720,_0x4136bd){try{if(_0x15fc40['TagIds']){_0x15fc40[_0x73f2('0x41')]=[];_0x15fc40[_0x73f2('0x42')][_0x73f2('0x43')](',')['forEach'](function(_0x5e75e2){_0x15fc40[_0x73f2('0x41')]['push'](_0x4e93a9[_0x5e75e2]);});}delete _0x15fc40[_0x73f2('0x42')];}catch(_0x541223){_0x4136bd(_0x541223);}_0x465720(_0x15fc40);});}function updateChatInteraction(_0x2fed76,_0x541977,_0xf80c8a){return new BPromise(function(_0x335409,_0x41667f){return getInteractionUsers(_0x2fed76,_0xf80c8a)[_0x73f2('0x1f')](function(_0x4eb89f){return getInteractionTags(_0x4eb89f,_0x541977);})[_0x73f2('0x1f')](function(_0x346554){return getStateInteraction(_0x346554);})[_0x73f2('0x1f')](function(_0x501ca2){_0x335409(_0x501ca2);})[_0x73f2('0x27')](function(_0x47cd3a){_0x41667f(_0x47cd3a);});});}function getStateInteraction(_0x18cebe){return new BPromise(function(_0x5dcc3f){_0x18cebe['waiting']=0x0;_0x18cebe[_0x73f2('0x44')]=0x0;_0x18cebe['answered']=0x0;_0x18cebe[_0x73f2('0x45')]=0x0;_0x18cebe[_0x73f2('0x46')]=0x0;_0x18cebe['total']=0x0;if(!_0x18cebe[_0x73f2('0x47')]&&!_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x49')]+=0x1;}if(!_0x18cebe['closed']&&_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x44')]+=0x1;if(_0x18cebe[_0x73f2('0x49')]){_0x18cebe[_0x73f2('0x49')]-=0x1;}}if(_0x18cebe[_0x73f2('0x47')]&&_0x18cebe['disposition']===_0x73f2('0x46')){_0x18cebe[_0x73f2('0x46')]+=0x1;if(_0x18cebe[_0x73f2('0x49')]){_0x18cebe['waiting']-=0x1;}}else if(_0x18cebe[_0x73f2('0x47')]&&!_0x18cebe[_0x73f2('0x48')]&&_0x18cebe[_0x73f2('0x4a')]){_0x18cebe[_0x73f2('0x45')]+=0x1;if(_0x18cebe['waiting']){_0x18cebe[_0x73f2('0x49')]-=0x1;}}else if(_0x18cebe[_0x73f2('0x47')]&&_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x4b')]+=0x1;if(_0x18cebe['talking']){_0x18cebe[_0x73f2('0x44')]-=0x1;}}_0x18cebe[_0x73f2('0x4c')]+=0x1;_0x5dcc3f(_0x18cebe);});}exports[_0x73f2('0x4d')]=function(_0x15a5a8,_0x2b2dcc){var _0x551be1={},_0x48873d={},_0x5c8127={'count':0x0,'rows':[]};var _0x4d1b31=_['map'](db[_0x73f2('0x4e')]['rawAttributes'],function(_0x2e40e7){return{'name':_0x2e40e7['fieldName'],'type':_0x2e40e7[_0x73f2('0x4f')][_0x73f2('0x50')]};});_0x48873d['model']=_[_0x73f2('0x3f')](_0x4d1b31,_0x73f2('0x37'));_0x48873d['query']=_[_0x73f2('0x51')](_0x15a5a8[_0x73f2('0x52')]);_0x48873d[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x48873d[_0x73f2('0x55')],_0x48873d[_0x73f2('0x52')]);_0x551be1[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0x48873d[_0x73f2('0x55')],qs['fields'](_0x15a5a8[_0x73f2('0x52')]['fields']));_0x551be1[_0x73f2('0x56')]=_0x551be1[_0x73f2('0x56')][_0x73f2('0x57')]?_0x551be1['attributes']:_0x48873d['model'];if(!_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x551be1['limit']=qs['limit'](_0x15a5a8['query']['limit']);_0x551be1[_0x73f2('0x2f')]=qs[_0x73f2('0x2f')](_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x551be1[_0x73f2('0x5a')]=qs['sort'](_0x15a5a8[_0x73f2('0x52')]['sort']);_0x551be1[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0x15a5a8[_0x73f2('0x52')],_0x48873d[_0x73f2('0x53')]),_0x4d1b31);var _0x45c18f=[];var _0xa17cc3=squel[_0x73f2('0x5d')]()[_0x73f2('0x5e')]('id')[_0x73f2('0x5e')](_0x73f2('0x37'))[_0x73f2('0x5e')](_0x73f2('0x5f'))[_0x73f2('0x60')](_0x73f2('0x61'));var _0x15bd4e=squel[_0x73f2('0x5d')]()['field'](_0x73f2('0x62'))[_0x73f2('0x5e')](_0x73f2('0x63'))['field']('ui.ChatInteractionId')[_0x73f2('0x60')](_0x73f2('0x64'),'ui')['left_join'](_0x73f2('0x65'),'u','u.id\x20=\x20ui.UserId');var _0x5903da=squel[_0x73f2('0x5d')]()[_0x73f2('0x60')](_0x73f2('0x66'),'i')[_0x73f2('0x67')](_0x73f2('0x68'),'c',_0x73f2('0x69'))['left_join'](_0x73f2('0x65'),'o',_0x73f2('0x6a'))['left_join'](_0x73f2('0x6b'),'a',_0x73f2('0x6c'))[_0x73f2('0x67')](_0x73f2('0x6d'),'me',_0x73f2('0x6e'))[_0x73f2('0x67')]('chat_interaction_has_tags','it',_0x73f2('0x6f'))[_0x73f2('0x67')](_0x73f2('0x61'),'t','t.id\x20=\x20it.TagId');var _0x418481=squel['expr']();var _0x191d72=[];var _0x1e21c5=squel[_0x73f2('0x70')]();var _0x39f6fe;if(_0x15a5a8['query'][_0x73f2('0x71')]){_0x39f6fe=as['parseSearch'](_0x15a5a8[_0x73f2('0x52')]['search']);var _0x5266b2=_0x39f6fe['sqlOperator'];for(var _0x5aa3ef=0x0;_0x5aa3ef<_0x39f6fe[_0x73f2('0x72')][_0x73f2('0x57')];_0x5aa3ef++){var _0x7a0791=_0x39f6fe[_0x73f2('0x72')][_0x5aa3ef];var _0x1f17e7='i';var _0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x7a0791[_0x73f2('0x5e')]]);if(!_0x2bbbb6){switch(_0x7a0791[_0x73f2('0x5e')]){case'unreadMessages':if(_0x7a0791[_0x73f2('0x74')]==0x1){_0x5903da[_0x73f2('0x75')]('`'+_0x7a0791[_0x73f2('0x5e')]+_0x73f2('0x76'));}else{_0x5903da[_0x73f2('0x75')]('`'+_0x7a0791['field']+_0x73f2('0x77'));}break;case _0x73f2('0x78'):if(_0x7a0791[_0x73f2('0x79')]===_0x73f2('0x7a')){if(_0x7a0791[_0x73f2('0x74')]['split']('\x20')[_0x73f2('0x57')]>0x1){_0x418481[_0x5266b2](_0x73f2('0x7b'),qs['getFullTextValue'](_0x7a0791[_0x73f2('0x74')]),null);}else{var _0x1c2ae9='%'+_0x7a0791[_0x73f2('0x74')]+'%';_0x418481[_0x5266b2](_0x73f2('0x7c'),_0x1c2ae9,_0x1c2ae9,_0x1c2ae9);}}else{_0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x73f2('0x7d')]);_0x7a0791[_0x73f2('0x5e')]=_0x73f2('0x7d');_0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6['value'][_0x73f2('0x29')]);}break;case _0x73f2('0x81'):var _0x5a97d8=_0x7a0791[_0x73f2('0x74')]['split'](',')[_0x73f2('0x3f')](function(_0x1a07ce){return Number(_0x1a07ce);});_0x5a97d8[_0x73f2('0x82')](function(_0x40e4e5){_0x1e21c5['or'](_0x73f2('0x83'),'%,'+_0x40e4e5+',%');});_0x191d72=_['union'](_0x191d72,_0x5a97d8);break;case _0x73f2('0x84'):if(_0x7a0791[_0x73f2('0x79')]==='$substring'){_0x418481[_0x5266b2](_0x73f2('0x85'),'%'+_0x7a0791[_0x73f2('0x74')]+'%',null);}else{_0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x73f2('0x48')]);_0x7a0791[_0x73f2('0x5e')]='UserId';_0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6['value'][_0x73f2('0x29')]);}break;case _0x73f2('0x3b'):_0xf5d9c6=as['buildExpression']('me',null,_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x29')]);break;}}else{var _0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6[_0x73f2('0x74')]['end']);}}}else{var _0x57da5b=_(_0x15a5a8[_0x73f2('0x52')])[_0x73f2('0x51')]()[_0x73f2('0x3f')](function(_0x2d9273){return _[_0x73f2('0x86')](_0x4d1b31,[_0x73f2('0x37'),_0x2d9273])?_0x2d9273:undefined;})[_0x73f2('0x87')]()['value']();if(!_[_0x73f2('0x88')](_0x57da5b)){_0x57da5b[_0x73f2('0x82')](function(_0x2258fe){if(_0x2258fe===_0x73f2('0x89')){_0x5903da[_0x73f2('0x5b')](_0x73f2('0x8a'),[][_0x73f2('0x8b')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe]));}else if(_0x2258fe===_0x73f2('0x8c')){var _0x130579=JSON[_0x73f2('0x8d')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe])[_0x73f2('0x8e')];var _0x393aad=JSON[_0x73f2('0x8d')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe])['$lte'];_0x5903da[_0x73f2('0x5b')](_0x73f2('0x8f'),_0x130579,_0x393aad);}else{if(_0x15a5a8[_0x73f2('0x52')][_0x2258fe]==='null'){_0x5903da['where']('i.'+_0x2258fe+'\x20IS\x20NULL');}else{_0x5903da[_0x73f2('0x5b')]('i.'+_0x2258fe+_0x73f2('0x90'),_0x15a5a8[_0x73f2('0x52')][_0x2258fe]);}}});}if(_0x15a5a8[_0x73f2('0x52')]['read']){if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x91')]==0x1){_0x5903da[_0x73f2('0x75')](_0x73f2('0x92'));}else{_0x5903da[_0x73f2('0x75')](_0x73f2('0x93'));}}if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]){_0x191d72=_[_0x73f2('0x95')](_0x15a5a8['query']['tag'])?_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]:new Array(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]);_0x191d72[_0x73f2('0x82')](function(_0xb3ad22){_0x1e21c5['or'](_0x73f2('0x83'),'%,'+_0xb3ad22+',%');});}if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x96')]){var _0x46a2ad=_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x96')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x46a2ad)){_0x418481['or'](_0x73f2('0x97'),_0x46a2ad+'%');}else{_0x418481['or'](_0x73f2('0x98'),qs['getFullTextValue'](_0x46a2ad))['or'](_0x73f2('0x99'),_0x46a2ad+'%');}}}_0x5903da[_0x73f2('0x5b')](_0x418481);_0x5903da['group'](_0x73f2('0x9a'));var _0x12d4db={'type':db['Sequelize'][_0x73f2('0x9b')][_0x73f2('0x9c')],'raw':!![]};var _0x5e7254=_0x5903da[_0x73f2('0x9d')]();_0x5e7254[_0x73f2('0x5e')](_0x73f2('0x9a'));_0x5e7254[_0x73f2('0x5e')](_0x73f2('0x9e'),_0x73f2('0x9f'));if(_0x551be1[_0x73f2('0x5a')]){_0x551be1[_0x73f2('0x5a')][_0x73f2('0x82')](function(_0xbec1d2){var _0x3c34fa=_0xbec1d2[0x0]===_0x73f2('0xa0')?_0xbec1d2[0x0]:'i.'+_0xbec1d2[0x0];_0x5903da[_0x73f2('0x5a')](_0x3c34fa,_0xbec1d2[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x191d72)){_0x5903da['having'](_0x1e21c5);_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa1'),_0x191d72);}BPromise['resolve']()[_0x73f2('0x1f')](function(){if(!_0x39f6fe){if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x89')])return;_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa2'));_0x5903da[_0x73f2('0x5b')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x15a5a8[_0x73f2('0xa3')][_0x73f2('0xa4')]!==_0x73f2('0x3c'))return;return _0x15a5a8['user'][_0x73f2('0xa5')]({'attributes':['id'],'raw':!![]})[_0x73f2('0x1f')](function(_0x31a9c8){if(_[_0x73f2('0x88')](_0x31a9c8)){_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa6'));_0x5903da['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5e7254[_0x73f2('0x5b')](_0x73f2('0x8a'),_[_0x73f2('0x3f')](_0x31a9c8,'id'));_0x5903da[_0x73f2('0x5b')]('i.ChatWebsiteId\x20IN\x20?',_[_0x73f2('0x3f')](_0x31a9c8,'id'));}});})[_0x73f2('0x1f')](function(){if(_0x15a5a8[_0x73f2('0xa3')][_0x73f2('0xa4')]===_0x73f2('0x3c')&&!_0x39f6fe&&!_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x89')])return[];return db['sequelize'][_0x73f2('0x52')](_0x5e7254[_0x73f2('0xa7')](),_0x12d4db);})[_0x73f2('0x1f')](function(_0x4520e8){_0x5c8127[_0x73f2('0x2e')]=_0x4520e8[_0x73f2('0x57')];if(_0x5c8127['count']===0x0)return[];return db[_0x73f2('0xa8')]['query'](_0xa17cc3[_0x73f2('0xa7')](),_0x12d4db)[_0x73f2('0x1f')](function(_0xf24cac){_0x45c18f=_[_0x73f2('0xa9')](_0xf24cac,'id');_0x12d4db=_[_0x73f2('0x3a')](_0x12d4db,{'model':db[_0x73f2('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0xaa')]){_0x551be1['attributes'][_0x73f2('0x82')](function(_0x17461f){_0x5903da[_0x73f2('0x5e')]('i.'+_0x17461f);});}else{_0x5903da[_0x73f2('0x5e')](_0x73f2('0x9e'),_0x73f2('0x9f'));_0x5903da[_0x73f2('0x5e')]('a.key',_0x73f2('0xab'));_0x5903da['field'](_0x73f2('0xac'),_0x73f2('0xad'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xae'),_0x73f2('0xa0'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xaf'));_0x5903da['field']('c.firstName',_0x73f2('0xb0'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb1'),_0x73f2('0xb2'));_0x5903da[_0x73f2('0x5e')]('c.email',_0x73f2('0xb3'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb4'),_0x73f2('0xb5'));_0x5903da[_0x73f2('0x5e')]('c.mobile',_0x73f2('0xb6'));_0x5903da['field'](_0x73f2('0xb7'),_0x73f2('0xb8'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb9'),_0x73f2('0xba'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xbb'),'Owner.internal');_0x5903da[_0x73f2('0x5e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x73f2('0x42'));}if(_0x551be1[_0x73f2('0x2d')])_0x5903da['limit'](_0x551be1[_0x73f2('0x2d')]);if(_0x551be1[_0x73f2('0x2f')])_0x5903da[_0x73f2('0x2f')](_0x551be1['offset']);return db[_0x73f2('0xa8')][_0x73f2('0x52')](_0x5903da[_0x73f2('0xa7')](),_0x12d4db);})[_0x73f2('0x1f')](function(_0x133bd9){if(_0x133bd9[_0x73f2('0x57')]>0x0)_0x15bd4e[_0x73f2('0x5b')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x133bd9,'id'));return db[_0x73f2('0xa8')][_0x73f2('0x52')](_0x15bd4e['toString'](),_0x12d4db)[_0x73f2('0x1f')](function(_0x551e92){var _0x36ac29=_[_0x73f2('0xbc')](_0x551e92,_0x73f2('0xbd'));var _0x48dfc5=[];_0x133bd9[_0x73f2('0x82')](function(_0x3da6bc){_0x48dfc5[_0x73f2('0xbe')](updateChatInteraction(_0x3da6bc,_0x45c18f,_0x36ac29));});return BPromise['all'](_0x48dfc5);});});})['then'](function(_0x5ac7ae){_0x5c8127[_0x73f2('0xbf')]=_0x5ac7ae;return _0x5c8127;})[_0x73f2('0x1f')](respondWithFilteredResult(_0x2b2dcc,_0x551be1))[_0x73f2('0x27')](handleError(_0x2b2dcc,null));};exports['show']=function(_0x881caa,_0x442935){var _0x21f000={'raw':![],'where':{'id':_0x881caa[_0x73f2('0xc0')]['id']}},_0x33f85b={};_0x33f85b['model']=_['keys'](db['ChatInteraction'][_0x73f2('0xc1')]);_0x33f85b[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0x881caa[_0x73f2('0x52')]);_0x33f85b[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x33f85b[_0x73f2('0x55')],_0x33f85b[_0x73f2('0x52')]);_0x21f000[_0x73f2('0x56')]=_['intersection'](_0x33f85b['model'],qs[_0x73f2('0xaa')](_0x881caa['query'][_0x73f2('0xaa')]));_0x21f000['attributes']=_0x21f000['attributes'][_0x73f2('0x57')]?_0x21f000['attributes']:_0x33f85b['model'];if(_0x881caa[_0x73f2('0x52')][_0x73f2('0xc2')]){_0x21f000[_0x73f2('0xc3')]=[{'all':!![]}];}_0x21f000=_[_0x73f2('0x3a')]({},_0x21f000,_0x881caa['options']);return db[_0x73f2('0x4e')][_0x73f2('0x73')](_0x21f000)['then'](handleEntityNotFound(_0x442935,null))[_0x73f2('0x1f')](respondWithResult(_0x442935,null))[_0x73f2('0x27')](handleError(_0x442935,null));};exports[_0x73f2('0xc4')]=function(_0xbf0ddb,_0x5f25aa){return db['ChatInteraction'][_0x73f2('0xc4')](_0xbf0ddb[_0x73f2('0x3b')],{})[_0x73f2('0x1f')](respondWithResult(_0x5f25aa,0xc9))[_0x73f2('0x27')](handleError(_0x5f25aa,null));};exports[_0x73f2('0xc5')]=function(_0x58abb4,_0x32716f){if(_0x58abb4[_0x73f2('0x3b')]['id']){delete _0x58abb4[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x58abb4[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x32716f,null))[_0x73f2('0x1f')](saveUpdates(_0x58abb4['body'],null))[_0x73f2('0x1f')](respondWithResult(_0x32716f,null))[_0x73f2('0x27')](handleError(_0x32716f,null));};exports['destroy']=function(_0x5850eb,_0x40d405){return db['ChatInteraction'][_0x73f2('0x73')]({'where':{'id':_0x5850eb[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x40d405,null))['then'](removeEntity(_0x40d405,null))[_0x73f2('0x27')](handleError(_0x40d405,null));};exports[_0x73f2('0xc6')]=function(_0x5367dd,_0x484fd3){return db[_0x73f2('0x4e')][_0x73f2('0xc6')]()[_0x73f2('0x1f')](respondWithResult(_0x484fd3,null))[_0x73f2('0x27')](handleError(_0x484fd3,null));};exports[_0x73f2('0xc7')]=function(_0x11fe65,_0x55d7ce){var _0x108ea1=_0x11fe65[_0x73f2('0xc0')]['id'];var _0x4c50ec;var _0x38e07f;var _0x4df069;return db['ChatInteraction']['findOne']({'where':{'id':_0x108ea1}})[_0x73f2('0x1f')](function(_0x28446d){_0x4c50ec=_0x28446d;return db[_0x73f2('0xc8')][_0x73f2('0xc9')]({'where':{'id':_0x28446d[_0x73f2('0x89')]},'attributes':['id',_0x73f2('0xca'),_0x73f2('0xcb'),_0x73f2('0xcc'),_0x73f2('0xcd'),'vidaooMetadata'],'raw':!![]});})[_0x73f2('0x1f')](function(_0x18dd08){if(_0x18dd08&&_0x18dd08[_0x73f2('0xca')]&&_0x18dd08[_0x73f2('0xcb')]){_0x38e07f=_0x18dd08;var _0x4f1b3d={'interaction':{'id':_0x108ea1},'agent':{'id':_0x11fe65[_0x73f2('0xa3')]['id'],'name':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0x37')],'fullname':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0x40')],'email':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0xce')]},'contact':_0x11fe65[_0x73f2('0x3b')]['contact'],'account':_0x11fe65[_0x73f2('0x3b')][_0x73f2('0xcf')]};var _0x18d222={'rejectUnauthorized':![],'method':_0x73f2('0xd0'),'url':_0x73f2('0xd1'),'headers':{'X-APIKEY':_0x18dd08[_0x73f2('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11fe65[_0x73f2('0xa3')][_0x73f2('0xce')]],'buttons':null,'topic':_0x38e07f[_0x73f2('0xcc')],'note':_[_0x73f2('0xd2')](_0x38e07f['vidaooNote'])?null:getMustacheRender(_0x38e07f[_0x73f2('0xcd')],_0x4f1b3d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x73f2('0xd2')](_0x38e07f[_0x73f2('0xd3')])){var _0x3a3bbb=getMustacheRender(_0x38e07f[_0x73f2('0xd3')],_0x4f1b3d);var _0x29e3dc=JSON['parse'](_0x3a3bbb);_0x18d222[_0x73f2('0x3b')][_0x73f2('0xd4')]=_0x29e3dc;}}catch(_0x4b06c2){throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x18d222);}else{throw new db[(_0x73f2('0xd5'))]['ValidationError'](_0x73f2('0xd7'));}})['then'](function(_0x1562d9){_0x4df069=_0x1562d9;if(_0x4df069['id']){var _0x252150={'body':_0x4df069[_0x73f2('0xd8')],'ChatWebsiteId':_0x38e07f['id'],'ChatInteractionId':_0x4c50ec['id'],'direction':_0x73f2('0xd9'),'UserId':_0x11fe65[_0x73f2('0xa3')]['id']};return db['ChatMessage']['create'](_0x252150,{});}else{throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))](_0x73f2('0xda'));}})['then'](function(){return _0x4c50ec[_0x73f2('0xdb')]({'vidaooSessionId':_0x4df069['id']});})['then'](respondWithResult(_0x55d7ce,null))['catch'](handleError(_0x55d7ce,null));};exports[_0x73f2('0xdc')]=function(_0x443362,_0x340ba5){if(_0x443362[_0x73f2('0x3b')]['id']){delete _0x443362[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x443362[_0x73f2('0xc0')]['id']},'include':[{'model':db['CmContact'],'as':_0x73f2('0x78')}]})[_0x73f2('0x1f')](handleEntityNotFound(_0x340ba5,null))['then'](saveUpdates(_0x443362[_0x73f2('0x3b')],null))['then'](respondWithResult(_0x340ba5,null))[_0x73f2('0x27')](handleError(_0x340ba5,null));};exports[_0x73f2('0xdd')]=function(_0x248823,_0x107259,_0x46b458){if(_0x248823[_0x73f2('0x3b')]['id']){delete _0x248823[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x248823[_0x73f2('0xc0')]['id']}})['then'](function(_0x7e3581){if(!_0x7e3581){logger[_0x73f2('0x24')](_0x73f2('0xde'),_0x73f2('0xdd'),0x194,_0x73f2('0xdf'));_0x107259[_0x73f2('0x28')](0x194);}else{if(_0x7e3581[_0x73f2('0x48')]){throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))](_0x73f2('0xe0'));}}return _0x7e3581;})[_0x73f2('0x1f')](function(_0x32726f){if(_0x32726f){return _0x32726f['update']({'closed':_0x248823[_0x73f2('0x3b')][_0x73f2('0x47')],'disposition':_0x248823[_0x73f2('0x3b')][_0x73f2('0x4a')]})[_0x73f2('0x1f')](function(_0x44c5cd){return _0x44c5cd;});}})[_0x73f2('0x1f')](function(_0x41b33e){return respondWithRpcPromise(_0x73f2('0xe1'),_0x73f2('0xdd'),_0x248823[_0x73f2('0x3b')],client9004);})[_0x73f2('0x1f')](respondWithResult(_0x107259,null))['catch'](handleError(_0x107259,null));};exports[_0x73f2('0xe2')]=function(_0x736034,_0x33e307,_0x42cd87){_0x736034[_0x73f2('0x3b')]['name']=_0x736034[_0x73f2('0xe3')][_0x73f2('0xe4')];_0x736034[_0x73f2('0x3b')][_0x73f2('0xe5')]=_0x736034[_0x73f2('0xe3')]['filename'];_0x736034[_0x73f2('0x3b')][_0x73f2('0x4f')]=_0x736034[_0x73f2('0xe3')]['mimetype'];return db[_0x73f2('0xe6')][_0x73f2('0xc4')](_0x736034[_0x73f2('0x3b')])[_0x73f2('0x1f')](respondWithResult(_0x33e307,0xc9))['catch'](handleError(_0x33e307,null));};exports[_0x73f2('0xe7')]=function(_0x26cdf3,_0x4cbc74,_0x11f29e){return db[_0x73f2('0x4e')]['findOne']({'where':{'id':_0x26cdf3[_0x73f2('0xc0')]['id']},'raw':!![]})[_0x73f2('0x1f')](handleEntityNotFound(_0x4cbc74,null))[_0x73f2('0x1f')](function(_0x123353){if(_0x123353){if(_0x123353[_0x73f2('0x47')]){return _0x4cbc74[_0x73f2('0x2a')](0x193)[_0x73f2('0x2b')]({'status':0x193,'message':_0x73f2('0xe8')});}return db[_0x73f2('0xe6')]['findOne']({'where':{'id':_0x26cdf3[_0x73f2('0x52')][_0x73f2('0xe9')]},'raw':!![]})[_0x73f2('0x1f')](handleEntityNotFound(_0x4cbc74,null));}})['then'](function(_0x2b679e){if(_0x2b679e){var _0x193f19=_0x2b679e['ChatOfflineMessageId']!==null;var _0x15e34d=path['join'](config['root'],'server/files/attachments/');if(_0x193f19){_0x15e34d=path[_0x73f2('0xea')](_0x15e34d,'offline-chat/');}var _0x3abdc0=path[_0x73f2('0xea')](_0x15e34d,_0x2b679e[_0x73f2('0xe5')]);return _0x4cbc74[_0x73f2('0xeb')](_0x3abdc0);}})['catch'](handleError(_0x4cbc74,null));};exports[_0x73f2('0xec')]=function(_0x239a9f,_0x5a5384){var _0x48288c=null;var _0xf89dad=null;var _0x42d1a0=null;var _0x55b111=null;if(_0x239a9f['body']['id']){delete _0x239a9f[_0x73f2('0x3b')]['id'];}if(_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')]){_0x55b111=path[_0x73f2('0xea')](config[_0x73f2('0xee')],_0x73f2('0xef'),util[_0x73f2('0xf0')](_0x73f2('0xf1'),Date['now']()));_0x239a9f['body']['pathTranscript']=_0x55b111;}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x239a9f['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x73f2('0x84')],'as':_0x73f2('0x84')}]}]})[_0x73f2('0x1f')](handleEntityNotFound(_0x5a5384,null))['then'](saveUpdates(_0x239a9f[_0x73f2('0x3b')],null))[_0x73f2('0x1f')](function(_0xfd0442){if(_0xfd0442){_0x48288c=_0xfd0442;return db[_0x73f2('0xc8')][_0x73f2('0x73')]({'where':{'id':_0x48288c[_0x73f2('0x89')]}});}})[_0x73f2('0x1f')](function(_0xb84dc4){if(_0xb84dc4){_0x42d1a0=_0xb84dc4;return db[_0x73f2('0xf2')][_0x73f2('0x73')]({'where':{'id':_0x48288c['ContactId']}});}})[_0x73f2('0x1f')](function(_0x3f0a04){if(_0x3f0a04){_0xf89dad=_0x3f0a04;if(_0x55b111){var _0x5f1b36=null;for(var _0x54eb41=0x1;_0x54eb41<_0x48288c[_0x73f2('0xf3')][_0x73f2('0x57')];++_0x54eb41){_0x5f1b36=_0x48288c[_0x73f2('0xf3')][_0x54eb41];var _0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util[_0x73f2('0xf0')](_0x73f2('0xf4'),_0x42d1a0[_0x73f2('0xf5')],_0x5f1b36[_0x73f2('0x48')]):'System';var _0xf16069=_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xf6')]||util[_0x73f2('0xf0')](_0x73f2('0xf4'),'Visitor',_0x5f1b36['ContactId']);switch(_0x42d1a0[_0x73f2('0xf7')]){case _0x73f2('0xf8'):_0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util[_0x73f2('0xf0')]('%s%d',_0x42d1a0[_0x73f2('0xf5')],_0x5f1b36[_0x73f2('0x48')]):_0x73f2('0xf9');break;case _0x73f2('0xfa'):_0x1c5764=_0x5f1b36['UserId']?_0x5f1b36[_0x73f2('0x84')][_0x73f2('0xfb')]||_0x5f1b36[_0x73f2('0x84')][_0x73f2('0x40')]:_0x73f2('0xf9');break;case _0x73f2('0xfc'):_0x1c5764=_0x5f1b36['UserId']?_0x5f1b36[_0x73f2('0x84')][_0x73f2('0x40')]:'System';break;default:_0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util['format'](_0x73f2('0xf4'),_0x42d1a0['agentAlias'],_0x5f1b36[_0x73f2('0x48')]):'System';}var _0xecc8ab=util[_0x73f2('0xf0')](_0x73f2('0xfd'),moment(_0x5f1b36[_0x73f2('0x8c')])[_0x73f2('0xf0')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5f1b36['direction']==='in'?_0xf16069:_0x1c5764,_0x5f1b36[_0x73f2('0x3b')]);if(!_0x5f1b36[_0x73f2('0xfe')]){fs[_0x73f2('0xff')](_0x55b111,_0xecc8ab);}}return db['MailAccount'][_0x73f2('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x73f2('0x100')],'as':_0x73f2('0x101'),'raw':!![]}]});}}})[_0x73f2('0x1f')](function(_0x3a0ec2){if(_0x3a0ec2&&_0x3a0ec2[_0x73f2('0x101')]&&_0x239a9f[_0x73f2('0x3b')]){var _0x28e876={'tls':{'rejectUnauthorized':![]}};if(_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x102')]){_0x28e876[_0x73f2('0x102')]=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x102')];}else{_0x28e876[_0x73f2('0x103')]=_0x3a0ec2[_0x73f2('0x101')]['host'];_0x28e876['port']=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x104')];_0x28e876[_0x73f2('0x105')]=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x105')];}if(_0x3a0ec2['Smtp'][_0x73f2('0x106')]){_0x28e876[_0x73f2('0x107')]={'user':_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0xa3')],'pass':_0x3a0ec2['Smtp'][_0x73f2('0x108')]};}return respondWithRpcPromise(_0x73f2('0x109'),_0x73f2('0x10a'),{'account':_0x28e876,'message':{'from':util[_0x73f2('0xf0')](_0x73f2('0x10b'),_0x3a0ec2[_0x73f2('0x37')],_0x3a0ec2[_0x73f2('0xce')]||_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0xa3')]),'to':_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')],'subject':_0x73f2('0x10c'),'text':util['format'](_0x73f2('0x10d'),_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')]),'attachments':[{'path':_0x55b111}]}})[_0x73f2('0x1f')](function(){return _0x48288c;})[_0x73f2('0x27')](function(_0x46a69c){console[_0x73f2('0x24')](_0x46a69c);});}else{return _0x48288c;}})['then'](respondWithStatusCode(_0x5a5384,0xc8))['catch'](handleError(_0x5a5384,null));};exports[_0x73f2('0x10e')]=function(_0x1b87bb,_0x5e30ea,_0x29ae80){return db['ChatMessage'][_0x73f2('0x73')]({'where':{'id':_0x1b87bb['params']['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x5e30ea,null))[_0x73f2('0x1f')](function(_0xb94183){if(_0xb94183){return _0xb94183[_0x73f2('0x10e')](_0x1b87bb[_0x73f2('0x3b')]['ids'],_[_0x73f2('0x10f')](_0x1b87bb[_0x73f2('0x3b')],[_0x73f2('0x110'),'id'])||{});}})['then'](respondWithResult(_0x5e30ea,null))[_0x73f2('0x27')](handleError(_0x5e30ea,null));};exports['getMessages']=function(_0xa022bc,_0x2660d2,_0x47cbca){var _0x1e72d7={'raw':![],'where':{}};var _0x92cfb0={};var _0x40cf7e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x73f2('0xc9')]({'where':{'id':_0xa022bc[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x2660d2,null))[_0x73f2('0x1f')](function(_0x383f49){if(_0x383f49){_0x92cfb0[_0x73f2('0x55')]=_['keys'](db[_0x73f2('0x111')][_0x73f2('0xc1')]);_0x92cfb0[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0xa022bc['query']);_0x92cfb0[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x92cfb0[_0x73f2('0x55')],_0x92cfb0[_0x73f2('0x52')]);_0x1e72d7[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0x92cfb0[_0x73f2('0x55')],qs['fields'](_0xa022bc['query'][_0x73f2('0xaa')]));_0x1e72d7[_0x73f2('0x56')]=_0x1e72d7[_0x73f2('0x56')][_0x73f2('0x57')]?_0x1e72d7['attributes']:_0x92cfb0[_0x73f2('0x55')];if(!_0xa022bc[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x1e72d7[_0x73f2('0x2d')]=qs[_0x73f2('0x2d')](_0xa022bc[_0x73f2('0x52')]['limit']);_0x1e72d7[_0x73f2('0x2f')]=qs[_0x73f2('0x2f')](_0xa022bc[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x1e72d7[_0x73f2('0x5a')]=qs[_0x73f2('0x112')](_0xa022bc[_0x73f2('0x52')]['sort']);_0x1e72d7[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0xa022bc[_0x73f2('0x52')],_0x92cfb0[_0x73f2('0x53')]));_0x1e72d7['where'][_0x73f2('0xbd')]=_0x383f49['id'];if(_0xa022bc[_0x73f2('0x52')][_0x73f2('0x96')]){_0x1e72d7['where']=_[_0x73f2('0x3a')](_0x1e72d7['where'],{'$or':_[_0x73f2('0x3f')](_0x1e72d7['attributes'],function(_0x51c5e3){var _0x2bd280={};_0x2bd280[_0x51c5e3]={'$like':'%'+_0xa022bc[_0x73f2('0x52')][_0x73f2('0x96')]+'%'};return _0x2bd280;})});}if(_0xa022bc[_0x73f2('0x52')][_0x73f2('0x8e')]){var _0x3abcab=_0xa022bc[_0x73f2('0x52')][_0x73f2('0x8e')][_0x73f2('0x43')](',');var _0x5a31a2={};_0x5a31a2[_0x3abcab[0x0]]={'$gte':moment(_0x3abcab[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1e72d7[_0x73f2('0x5b')]=_[_0x73f2('0x3a')](_0x1e72d7[_0x73f2('0x5b')],_0x5a31a2);}_0x1e72d7=_[_0x73f2('0x3a')]({},_0x1e72d7,_0xa022bc[_0x73f2('0x113')]);return db[_0x73f2('0x111')][_0x73f2('0x2e')]({'where':_0x1e72d7['where']})[_0x73f2('0x1f')](function(_0x3060ea){_0x40cf7e[_0x73f2('0x2e')]=_0x3060ea;if(_0xa022bc['query'][_0x73f2('0xc2')]){_0x1e72d7[_0x73f2('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x73f2('0x114')](_0x1e72d7);})[_0x73f2('0x1f')](function(_0x2e0c48){_0x40cf7e['rows']=_0x2e0c48;return _0x40cf7e;});}})['then'](respondWithFilteredResult(_0x2660d2,_0x1e72d7))[_0x73f2('0x27')](handleError(_0x2660d2,null));};exports[_0x73f2('0x115')]=function(_0x332969,_0x26e109,_0x258b2a){var _0x1576fc={'where':{}},_0xe74e30={},_0x163add={'count':0x0,'rows':[]};return db[_0x73f2('0x4e')][_0x73f2('0xc9')]({'where':{'id':_0x332969[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x26e109,null))[_0x73f2('0x1f')](function(_0x8b4e17){if(_0x8b4e17){_0xe74e30[_0x73f2('0x55')]=_['keys'](db[_0x73f2('0x111')][_0x73f2('0xc1')]);_0xe74e30[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0x332969[_0x73f2('0x52')]);_0xe74e30['filters']=_[_0x73f2('0x54')](_0xe74e30[_0x73f2('0x55')],_0xe74e30[_0x73f2('0x52')]);_0x1576fc[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0xe74e30[_0x73f2('0x55')],qs['fields'](_0x332969[_0x73f2('0x52')]['fields']));_0x1576fc['attributes']=_0x1576fc['attributes'][_0x73f2('0x57')]?_0x1576fc[_0x73f2('0x56')]:_0xe74e30[_0x73f2('0x55')];if(!_0x332969[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x1576fc[_0x73f2('0x2d')]=qs['limit'](_0x332969['query'][_0x73f2('0x2d')]);_0x1576fc['offset']=qs[_0x73f2('0x2f')](_0x332969[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x1576fc[_0x73f2('0x5a')]=qs[_0x73f2('0x112')](_0x332969[_0x73f2('0x52')][_0x73f2('0x112')]);_0x1576fc[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0x332969[_0x73f2('0x52')],_0xe74e30[_0x73f2('0x53')]));_0x1576fc['where']['ChatInteractionId']=_0x8b4e17['id'];if(_0x332969[_0x73f2('0x52')]['filter']){_0x1576fc['where']=_[_0x73f2('0x3a')](_0x1576fc['where'],{'$or':_[_0x73f2('0x3f')](_0x1576fc[_0x73f2('0x56')],function(_0x33bb53){var _0x1afcce={};_0x1afcce[_0x33bb53]={'$like':'%'+_0x332969[_0x73f2('0x52')]['filter']+'%'};return _0x1afcce;})});}_0x1576fc[_0x73f2('0x5b')][_0x73f2('0xfe')]=![];if(_0x332969[_0x73f2('0x52')]['id']){_0x1576fc[_0x73f2('0x5b')]['id']={'$gt':_0x332969[_0x73f2('0x52')]['id']};}_0x1576fc=_[_0x73f2('0x3a')]({},_0x1576fc,_0x332969['options']);return db[_0x73f2('0x111')][_0x73f2('0x2e')]({'where':_0x1576fc[_0x73f2('0x5b')]})[_0x73f2('0x1f')](function(_0x59bdac){_0x163add['count']=_0x59bdac;_0x1576fc[_0x73f2('0xc3')]=[];if(_0x332969['query']['includeAgent']){_0x1576fc[_0x73f2('0xc3')][_0x73f2('0xbe')]({'model':db[_0x73f2('0x84')],'as':_0x73f2('0x84'),'attributes':['id',_0x73f2('0x40'),_0x73f2('0xfb')]});}if(_0x332969[_0x73f2('0x52')]['includeAll']){_0x1576fc[_0x73f2('0xc3')]=[{'all':!![]}];}return db[_0x73f2('0x111')][_0x73f2('0x114')](_0x1576fc);})['then'](function(_0x151baf){_0x163add[_0x73f2('0xbf')]=_0x151baf;return _0x163add;});}})[_0x73f2('0x1f')](respondWithFilteredResult(_0x26e109,_0x1576fc))[_0x73f2('0x27')](handleError(_0x26e109,null));};exports[_0x73f2('0x116')]=function(_0x27c960,_0x41b143,_0x12f555){return db[_0x73f2('0x4e')]['find']({'where':{'id':_0x27c960[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x41b143,null))['then'](function(_0x29bd0d){if(_0x29bd0d){return _0x29bd0d[_0x73f2('0x117')](_0x27c960[_0x73f2('0x3b')][_0x73f2('0x110')],_[_0x73f2('0x10f')](_0x27c960[_0x73f2('0x3b')],[_0x73f2('0x110'),'id'])||{})[_0x73f2('0x118')](function(){return db[_0x73f2('0x81')][_0x73f2('0x114')]({'attributes':['id',_0x73f2('0x37'),_0x73f2('0x5f')],'where':{'id':_0x27c960[_0x73f2('0x3b')][_0x73f2('0x110')]}});})[_0x73f2('0x1f')](function(_0x1415bf){socket[_0x73f2('0x119')](_0x73f2('0x11a'),{'id':Number(_0x27c960[_0x73f2('0xc0')]['id']),'tags':_0x1415bf||[]});return{'id':Number(_0x27c960[_0x73f2('0xc0')]['id']),'tags':_0x1415bf||[]};});}})[_0x73f2('0x1f')](respondWithResult(_0x41b143,null))[_0x73f2('0x27')](handleError(_0x41b143,null));};exports['removeTags']=function(_0x49ee11,_0x3472c5,_0x205fcf){return db['ChatInteraction'][_0x73f2('0x73')]({'where':{'id':_0x49ee11['params']['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x3472c5,null))[_0x73f2('0x1f')](function(_0x3d55be){if(_0x3d55be){return _0x3d55be['removeTags'](_0x49ee11['query']['ids']);}})[_0x73f2('0x1f')](respondWithStatusCode(_0x3472c5,null))['catch'](handleError(_0x3472c5,null));};exports[_0x73f2('0xeb')]=function(_0x4cc062,_0x48678b){var _0x235710=moment()['unix']()['toString']();var _0x5357ac=path['join'](config[_0x73f2('0xee')],_0x73f2('0x11b'),_0x73f2('0x11c'),_0x73f2('0x11d'));var _0x202617=path['join'](config[_0x73f2('0xee')],_0x73f2('0x11b'),_0x73f2('0x11c'),_0x73f2('0x11e'));var _0x4b05fe=path['join'](_0x5357ac,_0x235710);var _0x52078c=util[_0x73f2('0xf0')]('transcript-%d-%s.zip',_0x4cc062[_0x73f2('0xc0')]['id'],_0x235710);var _0x24b3d5=path[_0x73f2('0xea')](_0x5357ac,_0x52078c);var _0x3abfdd=[];_0x3abfdd[_0x73f2('0xbe')]({'model':db['User'],'as':_0x73f2('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x3abfdd['push']({'model':db[_0x73f2('0xf2')],'as':_0x73f2('0x78'),'attributes':['id',_0x73f2('0x11f'),_0x73f2('0x120')],'raw':!![]});if(_0x4cc062['query'][_0x73f2('0x11e')]){_0x3abfdd['push']({'model':db[_0x73f2('0xe6')],'as':'Attachment','raw':!![]});}var _0x2b857a=[{'model':db[_0x73f2('0x111')],'as':_0x73f2('0xf3'),'attributes':['id','body','createdAt',_0x73f2('0x121'),_0x73f2('0xfe'),_0x73f2('0x91')],'include':_0x3abfdd}];_0x2b857a[_0x73f2('0xbe')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x73f2('0x37')]});_0x2b857a[_0x73f2('0xbe')]({'model':db[_0x73f2('0x84')],'as':_0x73f2('0x122'),'attributes':['id',_0x73f2('0x40')]});return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x4cc062[_0x73f2('0xc0')]['id']},'include':_0x2b857a})[_0x73f2('0x1f')](handleEntityNotFound(_0x48678b,null))[_0x73f2('0x1f')](function(_0x484a6c){if(_0x484a6c){var _0x1d8905=_0x484a6c[_0x73f2('0x123')]({'plain':!![]});fs['mkdirSync'](_0x4b05fe);var _0x38cc72={'channel':_0x73f2('0x124'),'account':_0x1d8905[_0x73f2('0x125')][_0x73f2('0x37')],'agent':_0x1d8905[_0x73f2('0x122')]?_0x1d8905['Owner'][_0x73f2('0x40')]:_0x73f2('0x126'),'createdAt':moment(_0x1d8905[_0x73f2('0x8c')])['format'](_0x73f2('0x127'))[_0x73f2('0xa7')](),'closedAt':_0x1d8905['closed']?moment(_0x1d8905[_0x73f2('0x128')])[_0x73f2('0xf0')](_0x73f2('0x127'))[_0x73f2('0xa7')]():'','disposition':_0x1d8905[_0x73f2('0x4a')],'chatInfo':{'browser':_0x1d8905[_0x73f2('0x129')],'os':_0x1d8905[_0x73f2('0x12a')],'referer':_0x1d8905[_0x73f2('0x12b')],'customerIp':_0x1d8905[_0x73f2('0x12c')],'customerPort':_0x1d8905[_0x73f2('0x12d')]?_0x1d8905[_0x73f2('0x12d')]:_0x73f2('0x126')},'messages':_(_0x1d8905['Messages'])[_0x73f2('0x12e')]()[_0x73f2('0x96')]({'secret':![]})['map'](function(_0x2901a7){if(_0x2901a7['Attachment']){var _0x3a79df=path[_0x73f2('0xea')](_0x202617,_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')]);if(fs['existsSync'](_0x3a79df)){fs['createReadStream'](_0x3a79df)['pipe'](fs[_0x73f2('0x12f')](path[_0x73f2('0xea')](_0x4b05fe,_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')])));}}return{'date':moment(_0x2901a7[_0x73f2('0x8c')])[_0x73f2('0xf0')](_0x73f2('0x127'))[_0x73f2('0xa7')](),'sender':_0x2901a7[_0x73f2('0x121')]===_0x73f2('0xd9')?_0x2901a7[_0x73f2('0x84')]?_0x2901a7[_0x73f2('0x84')]['fullname']:'System':_0x2901a7[_0x73f2('0x78')][_0x73f2('0x11f')]+(_0x2901a7[_0x73f2('0x78')]['lastName']?'\x20'+_0x2901a7['Contact'][_0x73f2('0x120')]:''),'body':_0x2901a7[_0x73f2('0xe6')]?_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')]:_0x2901a7[_0x73f2('0x3b')],'direction':_0x2901a7[_0x73f2('0x121')]==='out'?'A':'C','secret':_0x2901a7['secret'],'read':_0x2901a7[_0x73f2('0x91')],'attachment':_0x2901a7['Attachment']};})[_0x73f2('0x74')]()};return ejs['renderFile'](path['join'](config[_0x73f2('0xee')],'server',_0x73f2('0x130'),'downloadInteraction.ejs'),{'interaction':_0x38cc72})[_0x73f2('0x1f')](function(_0x3f6d64){var _0x357620=path[_0x73f2('0xea')](_0x4b05fe,_0x73f2('0x131')+_0x1d8905['id']+'-'+_0x235710+_0x73f2('0x132'));var _0x5da581={'path':_0x357620,'channel':_0x73f2('0x124'),'interactionId':_0x1d8905['id']};return pdf[_0x73f2('0x133')](_0x3f6d64,_0x5da581);})[_0x73f2('0x1f')](function(){return new BPromise(function(_0x4497b2,_0x230dd3){zipdir(_0x4b05fe,{'saveTo':_0x24b3d5},function(_0x5756ca,_0x3e1867){if(_0x5756ca)return _0x230dd3(_0x5756ca);return _0x4497b2(_0x3e1867);});})[_0x73f2('0x1f')](function(){return new BPromise(function(_0x1711f3,_0x50cd7d){rimraf(_0x4b05fe,function(_0x1b72c7){if(_0x1b72c7)_0x50cd7d(_0x1b72c7);return _0x1711f3();});});})[_0x73f2('0x1f')](function(){return _0x48678b[_0x73f2('0xeb')](_0x24b3d5,_0x52078c,function(_0x29fe63){if(_0x29fe63){console[_0x73f2('0x134')](_0x73f2('0x135'),_0x29fe63);}else{fs['unlinkSync'](_0x24b3d5);}});});});}else{return _0x48678b[_0x73f2('0x28')](0xc8);}})[_0x73f2('0x27')](handleError(_0x48678b,null));}; \ No newline at end of file +var _0xcbeb=['json','update','destroy','end','name','send','render','merge','body','contact','agent','account','Users','map','TagIds','Tags','split','forEach','waiting','talking','unmanaged','abandoned','total','UserId','closed','disposition','answered','index','ChatInteraction','rawAttributes','fieldName','key','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','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','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','text','keys','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','tag','isArray','filter','i.id\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','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','mailTranscript','root','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','omit','YYYY-MM-DD\x20HH:mm:ss','findAll','pick','includeAgent','push','addTags','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x3cf78d,_0x3a467a){var _0x35e8d6=function(_0x24dfe1){while(--_0x24dfe1){_0x3cf78d['push'](_0x3cf78d['shift']());}};_0x35e8d6(++_0x3a467a);}(_0xcbeb,0x107));var _0xbcbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbeb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbcbe('0x0'));var rimraf=require(_0xbcbe('0x1'));var zipdir=require(_0xbcbe('0x2'));var jsonpatch=require(_0xbcbe('0x3'));var rp=require('request-promise');var moment=require(_0xbcbe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbcbe('0x5'));var util=require('util');var path=require(_0xbcbe('0x6'));var sox=require('sox');var csv=require(_0xbcbe('0x7'));var ejs=require(_0xbcbe('0x8'));var fs=require('fs');var fs_extra=require(_0xbcbe('0x9'));var _=require(_0xbcbe('0xa'));var squel=require(_0xbcbe('0xb'));var crypto=require(_0xbcbe('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcbe('0x7'));var querystring=require(_0xbcbe('0xd'));var Papa=require(_0xbcbe('0xe'));var Redis=require(_0xbcbe('0xf'));var authService=require(_0xbcbe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbe('0x11'));var pdf=require(_0xbcbe('0x12'));var hardwareService=require(_0xbcbe('0x13'));var logger=require(_0xbcbe('0x14'))(_0xbcbe('0x15'));var utils=require(_0xbcbe('0x16'));var config=require(_0xbcbe('0x17'));var licenseUtil=require(_0xbcbe('0x18'));var db=require(_0xbcbe('0x19'))['db'];config[_0xbcbe('0x1a')]=_[_0xbcbe('0x1b')](config[_0xbcbe('0x1a')],{'host':_0xbcbe('0x1c'),'port':0x18eb});var socket=require(_0xbcbe('0x1d'))(new Redis(config[_0xbcbe('0x1a')]));require(_0xbcbe('0x1e'))[_0xbcbe('0x1f')](socket);var jayson=require(_0xbcbe('0x20'));var client=jayson[_0xbcbe('0x21')][_0xbcbe('0x22')]({'port':0x232b});var client9004=jayson[_0xbcbe('0x21')][_0xbcbe('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x26aebb,_0x281197,_0x3e2f24,_0x2c15e3){return new BPromise(function(_0x57b8d5,_0x21321b){var _0x2055fd=_0x2c15e3||client;return _0x2055fd[_0xbcbe('0x23')](_0x26aebb,_0x3e2f24)[_0xbcbe('0x24')](function(_0x2e65b4){logger[_0xbcbe('0x25')](_0xbcbe('0x26'),_0x281197,_0xbcbe('0x27'));logger['debug'](_0xbcbe('0x28'),_0x281197,_0xbcbe('0x27'),JSON[_0xbcbe('0x29')](_0x2e65b4));if(_0x2e65b4[_0xbcbe('0x2a')]){if(_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2b')]===0x1f4){logger['error'](_0xbcbe('0x26'),_0x281197,_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);return _0x21321b(_0x2e65b4['error'][_0xbcbe('0x2c')]);}logger['error'](_0xbcbe('0x26'),_0x281197,_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);return _0x57b8d5(_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);}else{logger[_0xbcbe('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x281197,_0xbcbe('0x27'));_0x57b8d5(_0x2e65b4[_0xbcbe('0x2d')][_0xbcbe('0x2c')]);}})[_0xbcbe('0x2e')](function(_0x2d1f77){logger[_0xbcbe('0x2a')](_0xbcbe('0x26'),_0x281197,_0x2d1f77);_0x21321b(_0x2d1f77);});});}function respondWithStatusCode(_0x561a8a,_0xa15fe5){_0xa15fe5=_0xa15fe5||0xcc;return function(_0x4a9495){if(_0x4a9495){return _0x561a8a[_0xbcbe('0x2f')](_0xa15fe5);}return _0x561a8a[_0xbcbe('0x30')](_0xa15fe5)['end']();};}function respondWithResult(_0x55a5ec,_0x26a206){_0x26a206=_0x26a206||0xc8;return function(_0x1b5bad){if(_0x1b5bad){return _0x55a5ec[_0xbcbe('0x30')](_0x26a206)['json'](_0x1b5bad);}};}function respondWithFilteredResult(_0xddf77,_0x898b5c){return function(_0x5bf775){if(_0x5bf775){var _0xa5acc9=typeof _0x898b5c[_0xbcbe('0x31')]===_0xbcbe('0x32')&&typeof _0x898b5c[_0xbcbe('0x33')]===_0xbcbe('0x32');var _0x2075c6=_0x5bf775[_0xbcbe('0x34')];var _0x5ed83f=_0xa5acc9?0x0:_0x898b5c['offset'];var _0x28a66c=_0xa5acc9?_0x5bf775[_0xbcbe('0x34')]:_0x898b5c[_0xbcbe('0x31')]+_0x898b5c[_0xbcbe('0x33')];var _0x4fddae;if(_0x28a66c>=_0x2075c6){_0x28a66c=_0x2075c6;_0x4fddae=0xc8;}else{_0x4fddae=0xce;}_0xddf77[_0xbcbe('0x30')](_0x4fddae);return _0xddf77[_0xbcbe('0x35')]('Content-Range',_0x5ed83f+'-'+_0x28a66c+'/'+_0x2075c6)[_0xbcbe('0x36')](_0x5bf775);}return null;};}function patchUpdates(_0x3e388b){return function(_0x54f7fb){try{jsonpatch['apply'](_0x54f7fb,_0x3e388b,!![]);}catch(_0x371363){return BPromise['reject'](_0x371363);}return _0x54f7fb['save']();};}function saveUpdates(_0x491bdc,_0x43beb0){return function(_0x56c513){if(_0x56c513){return _0x56c513[_0xbcbe('0x37')](_0x491bdc)[_0xbcbe('0x24')](function(_0x4bb01a){return _0x4bb01a;});}return null;};}function removeEntity(_0x3f6cff,_0x31fbd5){return function(_0x393182){if(_0x393182){return _0x393182[_0xbcbe('0x38')]()[_0xbcbe('0x24')](function(){_0x3f6cff['status'](0xcc)[_0xbcbe('0x39')]();});}};}function handleEntityNotFound(_0x25793a,_0x4d6b77){return function(_0x4f74fe){if(!_0x4f74fe){_0x25793a['sendStatus'](0x194);}return _0x4f74fe;};}function handleError(_0x33b5b7,_0x59f06b){_0x59f06b=_0x59f06b||0x1f4;return function(_0x35e79d){logger[_0xbcbe('0x2a')](_0x35e79d['stack']);if(_0x35e79d[_0xbcbe('0x3a')]){delete _0x35e79d['name'];}_0x33b5b7[_0xbcbe('0x30')](_0x59f06b)[_0xbcbe('0x3b')](_0x35e79d);};}function getMustacheRender(_0x1661b7,_0xb6d76e){return Mustache[_0xbcbe('0x3c')](_0x1661b7,_[_0xbcbe('0x3d')](_0xb6d76e[_0xbcbe('0x3e')],{'contact':_0xb6d76e[_0xbcbe('0x3f')],'message':_0xb6d76e[_0xbcbe('0x2c')],'agent':_0xb6d76e[_0xbcbe('0x40')],'interaction':_0xb6d76e['interaction'],'account':_0xb6d76e[_0xbcbe('0x41')]}))||'';}function getInteractionUsers(_0x1e7171,_0x4e194c){return new BPromise(function(_0x57ea30,_0x2c9a5c){try{if(_0x4e194c[_0x1e7171['id']]){_0x1e7171[_0xbcbe('0x42')]=_[_0xbcbe('0x43')](_0x4e194c[_0x1e7171['id']],function(_0x397c91){return{'id':_0x397c91['id'],'fullname':_0x397c91['fullname']};});}}catch(_0x3983c8){_0x2c9a5c(_0x3983c8);}_0x57ea30(_0x1e7171);});}function getInteractionTags(_0x212065,_0xb67053){return new BPromise(function(_0x2889ce,_0x24f038){try{if(_0x212065[_0xbcbe('0x44')]){_0x212065[_0xbcbe('0x45')]=[];_0x212065[_0xbcbe('0x44')][_0xbcbe('0x46')](',')[_0xbcbe('0x47')](function(_0x542e3f){_0x212065[_0xbcbe('0x45')]['push'](_0xb67053[_0x542e3f]);});}delete _0x212065[_0xbcbe('0x44')];}catch(_0x1a21da){_0x24f038(_0x1a21da);}_0x2889ce(_0x212065);});}function updateChatInteraction(_0x51601d,_0x44013a,_0x30dbb6){return new BPromise(function(_0x3afc89,_0x1c9d2c){return getInteractionUsers(_0x51601d,_0x30dbb6)[_0xbcbe('0x24')](function(_0x5ae401){return getInteractionTags(_0x5ae401,_0x44013a);})[_0xbcbe('0x24')](function(_0x2c715a){return getStateInteraction(_0x2c715a);})['then'](function(_0x41df68){_0x3afc89(_0x41df68);})['catch'](function(_0x41244e){_0x1c9d2c(_0x41244e);});});}function getStateInteraction(_0x64b7c7){return new BPromise(function(_0x58e33c){_0x64b7c7[_0xbcbe('0x48')]=0x0;_0x64b7c7[_0xbcbe('0x49')]=0x0;_0x64b7c7['answered']=0x0;_0x64b7c7[_0xbcbe('0x4a')]=0x0;_0x64b7c7[_0xbcbe('0x4b')]=0x0;_0x64b7c7[_0xbcbe('0x4c')]=0x0;if(!_0x64b7c7['closed']&&!_0x64b7c7[_0xbcbe('0x4d')]){_0x64b7c7['waiting']+=0x1;}if(!_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7[_0xbcbe('0x4d')]){_0x64b7c7[_0xbcbe('0x49')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7['waiting']-=0x1;}}if(_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7[_0xbcbe('0x4f')]===_0xbcbe('0x4b')){_0x64b7c7[_0xbcbe('0x4b')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7['waiting']-=0x1;}}else if(_0x64b7c7['closed']&&!_0x64b7c7[_0xbcbe('0x4d')]&&_0x64b7c7[_0xbcbe('0x4f')]){_0x64b7c7[_0xbcbe('0x4a')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7[_0xbcbe('0x48')]-=0x1;}}else if(_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7['UserId']){_0x64b7c7[_0xbcbe('0x50')]+=0x1;if(_0x64b7c7[_0xbcbe('0x49')]){_0x64b7c7[_0xbcbe('0x49')]-=0x1;}}_0x64b7c7['total']+=0x1;_0x58e33c(_0x64b7c7);});}exports[_0xbcbe('0x51')]=function(_0x3ecac2,_0x202fd1){var _0x1587b2={},_0x569238={},_0x8f3fe6={'count':0x0,'rows':[]};var _0x2e3250=_[_0xbcbe('0x43')](db[_0xbcbe('0x52')][_0xbcbe('0x53')],function(_0x407293){return{'name':_0x407293[_0xbcbe('0x54')],'type':_0x407293['type'][_0xbcbe('0x55')]};});_0x569238['model']=_['map'](_0x2e3250,_0xbcbe('0x3a'));_0x569238[_0xbcbe('0x56')]=_['keys'](_0x3ecac2[_0xbcbe('0x56')]);_0x569238['filters']=_['intersection'](_0x569238['model'],_0x569238[_0xbcbe('0x56')]);_0x1587b2[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x569238['model'],qs[_0xbcbe('0x59')](_0x3ecac2['query'][_0xbcbe('0x59')]));_0x1587b2[_0xbcbe('0x57')]=_0x1587b2['attributes'][_0xbcbe('0x5a')]?_0x1587b2['attributes']:_0x569238[_0xbcbe('0x5b')];if(!_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1587b2['limit']=qs[_0xbcbe('0x33')](_0x3ecac2['query']['limit']);_0x1587b2[_0xbcbe('0x31')]=qs['offset'](_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1587b2[_0xbcbe('0x5e')]=qs['sort'](_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x5f')]);_0x1587b2[_0xbcbe('0x60')]=qs[_0xbcbe('0x61')](_['pick'](_0x3ecac2[_0xbcbe('0x56')],_0x569238[_0xbcbe('0x61')]),_0x2e3250);var _0x3c3bf4=[];var _0x2c65fd=squel[_0xbcbe('0x62')]()['field']('id')[_0xbcbe('0x63')](_0xbcbe('0x3a'))['field'](_0xbcbe('0x64'))[_0xbcbe('0x65')](_0xbcbe('0x66'));var _0x5e1058=squel[_0xbcbe('0x62')]()[_0xbcbe('0x63')](_0xbcbe('0x67'))[_0xbcbe('0x63')](_0xbcbe('0x68'))[_0xbcbe('0x63')](_0xbcbe('0x69'))['from']('user_has_chat_interactions','ui')[_0xbcbe('0x6a')](_0xbcbe('0x6b'),'u',_0xbcbe('0x6c'));var _0x41252f=squel['select']()['from']('chat_interactions','i')[_0xbcbe('0x6a')](_0xbcbe('0x6d'),'c',_0xbcbe('0x6e'))['left_join']('users','o',_0xbcbe('0x6f'))[_0xbcbe('0x6a')]('chat_websites','a',_0xbcbe('0x70'))['left_join'](_0xbcbe('0x71'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xbcbe('0x6a')](_0xbcbe('0x72'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xbcbe('0x6a')](_0xbcbe('0x66'),'t',_0xbcbe('0x73'));var _0x43f428=squel[_0xbcbe('0x74')]();var _0x3e77cf=[];var _0xca5b17=squel[_0xbcbe('0x74')]();var _0x5f3edb;if(_0x3ecac2['query'][_0xbcbe('0x75')]){_0x5f3edb=as[_0xbcbe('0x76')](_0x3ecac2['query']['search']);var _0x1c4e4e=_0x5f3edb[_0xbcbe('0x77')];for(var _0x1fec02=0x0;_0x1fec02<_0x5f3edb[_0xbcbe('0x78')][_0xbcbe('0x5a')];_0x1fec02++){var _0x31e8d5=_0x5f3edb[_0xbcbe('0x78')][_0x1fec02];var _0x27d564='i';var _0x48cb64=_['find'](_0x2e3250,[_0xbcbe('0x3a'),_0x31e8d5['field']]);if(!_0x48cb64){switch(_0x31e8d5[_0xbcbe('0x63')]){case _0xbcbe('0x79'):if(_0x31e8d5['value']==0x1){_0x41252f[_0xbcbe('0x7a')]('`'+_0x31e8d5[_0xbcbe('0x63')]+'`\x20=\x200');}else{_0x41252f[_0xbcbe('0x7a')]('`'+_0x31e8d5['field']+'`\x20>\x200');}break;case _0xbcbe('0x7b'):if(_0x31e8d5[_0xbcbe('0x7c')]==='$substring'){if(_0x31e8d5['value']['split']('\x20')['length']>0x1){_0x43f428[_0x1c4e4e](_0xbcbe('0x7d'),qs[_0xbcbe('0x7e')](_0x31e8d5[_0xbcbe('0x7f')]),null);}else{var _0x42aaae='%'+_0x31e8d5['value']+'%';_0x43f428[_0x1c4e4e](_0xbcbe('0x80'),_0x42aaae,_0x42aaae,_0x42aaae);}}else{_0x48cb64=_[_0xbcbe('0x81')](_0x2e3250,[_0xbcbe('0x3a'),'ContactId']);_0x31e8d5[_0xbcbe('0x63')]=_0xbcbe('0x82');_0x49045b=as[_0xbcbe('0x83')](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b['text'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x85')],_0x49045b['value'][_0xbcbe('0x39')]);}break;case _0xbcbe('0x86'):var _0x566eb8=_0x31e8d5[_0xbcbe('0x7f')][_0xbcbe('0x46')](',')[_0xbcbe('0x43')](function(_0x3b790f){return Number(_0x3b790f);});_0x566eb8[_0xbcbe('0x47')](function(_0x5b7e9b){_0xca5b17['or'](_0xbcbe('0x87'),'%,'+_0x5b7e9b+',%');});_0x3e77cf=_[_0xbcbe('0x88')](_0x3e77cf,_0x566eb8);break;case _0xbcbe('0x89'):if(_0x31e8d5[_0xbcbe('0x7c')]===_0xbcbe('0x8a')){_0x43f428[_0x1c4e4e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x31e8d5['value']+'%',null);}else{_0x48cb64=_[_0xbcbe('0x81')](_0x2e3250,['name',_0xbcbe('0x4d')]);_0x31e8d5[_0xbcbe('0x63')]='UserId';_0x49045b=as[_0xbcbe('0x83')](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')]['start'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x39')]);}break;case _0xbcbe('0x3e'):_0x49045b=as['buildExpression']('me',null,_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')]['start'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x39')]);break;}}else{var _0x49045b=as['buildExpression'](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x85')],_0x49045b[_0xbcbe('0x7f')]['end']);}}}else{var _0x5c4a18=_(_0x3ecac2['query'])[_0xbcbe('0x8c')]()[_0xbcbe('0x43')](function(_0x49d3bb){return _[_0xbcbe('0x8d')](_0x2e3250,[_0xbcbe('0x3a'),_0x49d3bb])?_0x49d3bb:undefined;})[_0xbcbe('0x8e')]()['value']();if(!_[_0xbcbe('0x8f')](_0x5c4a18)){_0x5c4a18['forEach'](function(_0x5b86a0){if(_0x5b86a0===_0xbcbe('0x90')){_0x41252f['where'](_0xbcbe('0x91'),[][_0xbcbe('0x92')](_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]));}else if(_0x5b86a0===_0xbcbe('0x93')){var _0x467601=JSON[_0xbcbe('0x94')](_0x3ecac2['query'][_0x5b86a0])[_0xbcbe('0x95')];var _0x491a18=JSON[_0xbcbe('0x94')](_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0])[_0xbcbe('0x96')];_0x41252f[_0xbcbe('0x60')](_0xbcbe('0x97'),_0x467601,_0x491a18);}else{if(_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]===_0xbcbe('0x98')){_0x41252f[_0xbcbe('0x60')]('i.'+_0x5b86a0+_0xbcbe('0x99'));}else{_0x41252f[_0xbcbe('0x60')]('i.'+_0x5b86a0+_0xbcbe('0x9a'),_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]);}}});}if(_0x3ecac2[_0xbcbe('0x56')]['read']){if(_0x3ecac2[_0xbcbe('0x56')]['read']==0x1){_0x41252f['having'](_0xbcbe('0x9b'));}else{_0x41252f[_0xbcbe('0x7a')]('`unreadMessages`\x20>\x200');}}if(_0x3ecac2['query'][_0xbcbe('0x9c')]){_0x3e77cf=_[_0xbcbe('0x9d')](_0x3ecac2[_0xbcbe('0x56')]['tag'])?_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9c')]:new Array(_0x3ecac2[_0xbcbe('0x56')]['tag']);_0x3e77cf['forEach'](function(_0x204841){_0xca5b17['or'](_0xbcbe('0x87'),'%,'+_0x204841+',%');});}if(_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9e')]){var _0x1e8e79=_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9e')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1e8e79)){_0x43f428['or'](_0xbcbe('0x9f'),_0x1e8e79+'%');}else{_0x43f428['or'](_0xbcbe('0xa0'),qs[_0xbcbe('0x7e')](_0x1e8e79))['or'](_0xbcbe('0xa1'),_0x1e8e79+'%');}}}_0x41252f[_0xbcbe('0x60')](_0x43f428);_0x41252f[_0xbcbe('0xa2')](_0xbcbe('0xa3'));var _0x492790={'type':db['Sequelize']['QueryTypes'][_0xbcbe('0xa4')],'raw':!![]};var _0x3ed201=_0x41252f['clone']();_0x3ed201['field']('i.id');_0x3ed201['field'](_0xbcbe('0xa5'),_0xbcbe('0x79'));if(_0x1587b2[_0xbcbe('0x5e')]){_0x1587b2[_0xbcbe('0x5e')]['forEach'](function(_0x3cfc23){var _0x1bc2a1=_0x3cfc23[0x0]===_0xbcbe('0xa6')?_0x3cfc23[0x0]:'i.'+_0x3cfc23[0x0];_0x41252f[_0xbcbe('0x5e')](_0x1bc2a1,_0x3cfc23[0x1]===_0xbcbe('0xa7')?![]:!![]);});}if(!_[_0xbcbe('0x8f')](_0x3e77cf)){_0x41252f['having'](_0xca5b17);_0x3ed201['where'](_0xbcbe('0xa8'),_0x3e77cf);}BPromise[_0xbcbe('0xa9')]()[_0xbcbe('0x24')](function(){if(!_0x5f3edb){if(_0x3ecac2['query']['ChatWebsiteId'])return;_0x3ed201['where'](_0xbcbe('0xaa'));_0x41252f[_0xbcbe('0x60')](_0xbcbe('0xaa'));return;}if(_0x3ecac2[_0xbcbe('0xab')][_0xbcbe('0xac')]!==_0xbcbe('0x40'))return;return _0x3ecac2[_0xbcbe('0xab')][_0xbcbe('0xad')]({'attributes':['id'],'raw':!![]})[_0xbcbe('0x24')](function(_0x146316){if(_[_0xbcbe('0x8f')](_0x146316)){_0x3ed201['where'](_0xbcbe('0xae'));_0x41252f['where'](_0xbcbe('0xae'));}else{_0x3ed201[_0xbcbe('0x60')](_0xbcbe('0x91'),_[_0xbcbe('0x43')](_0x146316,'id'));_0x41252f[_0xbcbe('0x60')](_0xbcbe('0x91'),_[_0xbcbe('0x43')](_0x146316,'id'));}});})[_0xbcbe('0x24')](function(){if(_0x3ecac2[_0xbcbe('0xab')]['role']===_0xbcbe('0x40')&&!_0x5f3edb&&!_0x3ecac2[_0xbcbe('0x56')]['ChatWebsiteId'])return[];return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x3ed201[_0xbcbe('0xb0')](),_0x492790);})['then'](function(_0x46a25a){_0x8f3fe6[_0xbcbe('0x34')]=_0x46a25a[_0xbcbe('0x5a')];if(_0x8f3fe6[_0xbcbe('0x34')]===0x0)return[];return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x2c65fd[_0xbcbe('0xb0')](),_0x492790)['then'](function(_0x435edf){_0x3c3bf4=_[_0xbcbe('0xb1')](_0x435edf,'id');_0x492790=_[_0xbcbe('0x3d')](_0x492790,{'model':db[_0xbcbe('0x52')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ecac2['query'][_0xbcbe('0x59')]){_0x1587b2[_0xbcbe('0x57')][_0xbcbe('0x47')](function(_0x1fbd44){_0x41252f[_0xbcbe('0x63')]('i.'+_0x1fbd44);});}else{_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xa5'),_0xbcbe('0x79'));_0x41252f['field'](_0xbcbe('0xb2'),'Account.key');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb3'),_0xbcbe('0xb4'));_0x41252f['field'](_0xbcbe('0xb5'),'contactName');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb6'));_0x41252f['field']('c.firstName',_0xbcbe('0xb7'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb8'),_0xbcbe('0xb9'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xba'),'Contact.email');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbb'),_0xbcbe('0xbc'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbd'),_0xbcbe('0xbe'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbf'),_0xbcbe('0xc0'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc1'),_0xbcbe('0xc2'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc3'),'Owner.internal');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc4'),_0xbcbe('0x44'));}if(_0x1587b2[_0xbcbe('0x33')])_0x41252f[_0xbcbe('0x33')](_0x1587b2['limit']);if(_0x1587b2[_0xbcbe('0x31')])_0x41252f[_0xbcbe('0x31')](_0x1587b2[_0xbcbe('0x31')]);return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x41252f['toString'](),_0x492790);})[_0xbcbe('0x24')](function(_0x36a77c){if(_0x36a77c[_0xbcbe('0x5a')]>0x0)_0x5e1058[_0xbcbe('0x60')](_0xbcbe('0xc5'),_[_0xbcbe('0x43')](_0x36a77c,'id'));return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x5e1058[_0xbcbe('0xb0')](),_0x492790)['then'](function(_0xad4627){var _0x5ef2ee=_['groupBy'](_0xad4627,_0xbcbe('0xc6'));var _0x3ccded=[];_0x36a77c[_0xbcbe('0x47')](function(_0x502451){_0x3ccded['push'](updateChatInteraction(_0x502451,_0x3c3bf4,_0x5ef2ee));});return BPromise[_0xbcbe('0xc7')](_0x3ccded);});});})['then'](function(_0x360973){_0x8f3fe6[_0xbcbe('0xc8')]=_0x360973;return _0x8f3fe6;})[_0xbcbe('0x24')](respondWithFilteredResult(_0x202fd1,_0x1587b2))['catch'](handleError(_0x202fd1,null));};exports[_0xbcbe('0xc9')]=function(_0x3cecfe,_0x2c1cbc){var _0x1a8fda={'raw':![],'where':{'id':_0x3cecfe['params']['id']}},_0x25540e={};_0x25540e[_0xbcbe('0x5b')]=_[_0xbcbe('0x8c')](db['ChatInteraction'][_0xbcbe('0x53')]);_0x25540e[_0xbcbe('0x56')]=_['keys'](_0x3cecfe[_0xbcbe('0x56')]);_0x25540e[_0xbcbe('0x61')]=_[_0xbcbe('0x58')](_0x25540e[_0xbcbe('0x5b')],_0x25540e['query']);_0x1a8fda[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x25540e['model'],qs[_0xbcbe('0x59')](_0x3cecfe[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1a8fda[_0xbcbe('0x57')]=_0x1a8fda[_0xbcbe('0x57')]['length']?_0x1a8fda[_0xbcbe('0x57')]:_0x25540e[_0xbcbe('0x5b')];if(_0x3cecfe['query'][_0xbcbe('0xca')]){_0x1a8fda[_0xbcbe('0xcb')]=[{'all':!![]}];}_0x1a8fda=_[_0xbcbe('0x3d')]({},_0x1a8fda,_0x3cecfe[_0xbcbe('0xcc')]);return db[_0xbcbe('0x52')][_0xbcbe('0x81')](_0x1a8fda)['then'](handleEntityNotFound(_0x2c1cbc,null))[_0xbcbe('0x24')](respondWithResult(_0x2c1cbc,null))[_0xbcbe('0x2e')](handleError(_0x2c1cbc,null));};exports[_0xbcbe('0xcd')]=function(_0x3cf2ed,_0x32cfa7){return db[_0xbcbe('0x52')][_0xbcbe('0xcd')](_0x3cf2ed[_0xbcbe('0x3e')],{})[_0xbcbe('0x24')](respondWithResult(_0x32cfa7,0xc9))[_0xbcbe('0x2e')](handleError(_0x32cfa7,null));};exports['update']=function(_0x132f8b,_0x1b2be4){if(_0x132f8b[_0xbcbe('0x3e')]['id']){delete _0x132f8b['body']['id'];}return db['ChatInteraction'][_0xbcbe('0x81')]({'where':{'id':_0x132f8b[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x1b2be4,null))[_0xbcbe('0x24')](saveUpdates(_0x132f8b[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](respondWithResult(_0x1b2be4,null))[_0xbcbe('0x2e')](handleError(_0x1b2be4,null));};exports[_0xbcbe('0x38')]=function(_0x35cc0e,_0x24ebad){return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x35cc0e['params']['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x24ebad,null))['then'](removeEntity(_0x24ebad,null))[_0xbcbe('0x2e')](handleError(_0x24ebad,null));};exports['describe']=function(_0x159d9a,_0x5e7b51){return db[_0xbcbe('0x52')][_0xbcbe('0xcf')]()[_0xbcbe('0x24')](respondWithResult(_0x5e7b51,null))['catch'](handleError(_0x5e7b51,null));};exports[_0xbcbe('0xd0')]=function(_0x42bc6a,_0x29e792){var _0x360db2=_0x42bc6a[_0xbcbe('0xce')]['id'];var _0x420e74;var _0x589177;var _0x7d3f53;return db['ChatInteraction'][_0xbcbe('0xd1')]({'where':{'id':_0x360db2}})[_0xbcbe('0x24')](function(_0x2a40ee){_0x420e74=_0x2a40ee;return db[_0xbcbe('0xd2')][_0xbcbe('0xd1')]({'where':{'id':_0x2a40ee[_0xbcbe('0x90')]},'attributes':['id',_0xbcbe('0xd3'),'vidaooEscalation',_0xbcbe('0xd4'),_0xbcbe('0xd5'),_0xbcbe('0xd6')],'raw':!![]});})['then'](function(_0xf7531c){if(_0xf7531c&&_0xf7531c[_0xbcbe('0xd3')]&&_0xf7531c[_0xbcbe('0xd7')]){_0x589177=_0xf7531c;var _0x1a0106={'interaction':{'id':_0x360db2},'agent':{'id':_0x42bc6a[_0xbcbe('0xab')]['id'],'name':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0x3a')],'fullname':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0xd8')],'email':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0xd9')]},'contact':_0x42bc6a[_0xbcbe('0x3e')]['contact'],'account':_0x42bc6a[_0xbcbe('0x3e')][_0xbcbe('0x41')]};var _0x301e38={'rejectUnauthorized':![],'method':'POST','url':_0xbcbe('0xda'),'headers':{'X-APIKEY':_0xf7531c[_0xbcbe('0xd3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x42bc6a['user'][_0xbcbe('0xd9')]],'buttons':null,'topic':_0x589177[_0xbcbe('0xd4')],'note':_['isNull'](_0x589177['vidaooNote'])?null:getMustacheRender(_0x589177[_0xbcbe('0xd5')],_0x1a0106),'metadata':null},'redirect':_0xbcbe('0xdb'),'json':!![]};try{if(!_[_0xbcbe('0xdc')](_0x589177[_0xbcbe('0xd6')])){var _0x383254=getMustacheRender(_0x589177[_0xbcbe('0xd6')],_0x1a0106);var _0x15e1e9=JSON['parse'](_0x383254);_0x301e38['body']['metadata']=_0x15e1e9;}}catch(_0x4e4d0b){throw new db[(_0xbcbe('0xdd'))][(_0xbcbe('0xde'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x301e38);}else{throw new db['Sequelize'][(_0xbcbe('0xde'))](_0xbcbe('0xdf'));}})[_0xbcbe('0x24')](function(_0x506ff4){_0x7d3f53=_0x506ff4;if(_0x7d3f53['id']){var _0x487fdd={'body':_0x7d3f53['join_url'],'ChatWebsiteId':_0x589177['id'],'ChatInteractionId':_0x420e74['id'],'direction':'out','UserId':_0x42bc6a[_0xbcbe('0xab')]['id']};return db['ChatMessage'][_0xbcbe('0xcd')](_0x487fdd,{});}else{throw new db[(_0xbcbe('0xdd'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbcbe('0x24')](function(){return _0x420e74[_0xbcbe('0xe0')]({'vidaooSessionId':_0x7d3f53['id']});})[_0xbcbe('0x24')](respondWithResult(_0x29e792,null))[_0xbcbe('0x2e')](handleError(_0x29e792,null));};exports[_0xbcbe('0xe1')]=function(_0xd44569,_0x5b6bba){if(_0xd44569['body']['id']){delete _0xd44569[_0xbcbe('0x3e')]['id'];}return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0xd44569['params']['id']},'include':[{'model':db[_0xbcbe('0xe2')],'as':_0xbcbe('0x7b')}]})['then'](handleEntityNotFound(_0x5b6bba,null))[_0xbcbe('0x24')](saveUpdates(_0xd44569[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](respondWithResult(_0x5b6bba,null))[_0xbcbe('0x2e')](handleError(_0x5b6bba,null));};exports[_0xbcbe('0xe3')]=function(_0x13fd3b,_0x3b9854,_0x5e4185){if(_0x13fd3b['body']['id']){delete _0x13fd3b['body']['id'];}return db[_0xbcbe('0x52')]['find']({'where':{'id':_0x13fd3b['params']['id']}})['then'](function(_0x1f903d){if(!_0x1f903d){logger[_0xbcbe('0x2a')](_0xbcbe('0xe4'),_0xbcbe('0xe3'),0x194,_0xbcbe('0xe5'));_0x3b9854['sendStatus'](0x194);}else{if(_0x1f903d['UserId']){throw new db['Sequelize'][(_0xbcbe('0xde'))](_0xbcbe('0xe6'));}}return _0x1f903d;})[_0xbcbe('0x24')](function(_0x5e38cc){if(_0x5e38cc){return _0x5e38cc[_0xbcbe('0x37')]({'closed':_0x13fd3b['body']['closed'],'disposition':_0x13fd3b[_0xbcbe('0x3e')][_0xbcbe('0x4f')]})[_0xbcbe('0x24')](function(_0x4c793c){return _0x4c793c;});}})[_0xbcbe('0x24')](function(_0x212539){return respondWithRpcPromise(_0xbcbe('0xe7'),_0xbcbe('0xe3'),_0x13fd3b[_0xbcbe('0x3e')],client9004);})['then'](respondWithResult(_0x3b9854,null))[_0xbcbe('0x2e')](handleError(_0x3b9854,null));};exports[_0xbcbe('0xe8')]=function(_0x4c3174,_0x46ee01,_0x461642){_0x4c3174['body'][_0xbcbe('0x3a')]=_0x4c3174[_0xbcbe('0xe9')]['originalname'];_0x4c3174[_0xbcbe('0x3e')][_0xbcbe('0xea')]=_0x4c3174[_0xbcbe('0xe9')]['filename'];_0x4c3174[_0xbcbe('0x3e')]['type']=_0x4c3174[_0xbcbe('0xe9')][_0xbcbe('0xeb')];return db[_0xbcbe('0xec')]['create'](_0x4c3174['body'])[_0xbcbe('0x24')](respondWithResult(_0x46ee01,0xc9))[_0xbcbe('0x2e')](handleError(_0x46ee01,null));};exports[_0xbcbe('0xed')]=function(_0x5e8923,_0x145662,_0x17d6c6){return db['ChatInteraction']['findOne']({'where':{'id':_0x5e8923[_0xbcbe('0xce')]['id']},'raw':!![]})[_0xbcbe('0x24')](handleEntityNotFound(_0x145662,null))['then'](function(_0x41e48c){if(_0x41e48c){if(_0x41e48c[_0xbcbe('0x4e')]){return _0x145662['status'](0x193)[_0xbcbe('0x36')]({'status':0x193,'message':_0xbcbe('0xee')});}return db[_0xbcbe('0xec')]['findOne']({'where':{'id':_0x5e8923[_0xbcbe('0x56')][_0xbcbe('0xef')]},'raw':!![]})[_0xbcbe('0x24')](handleEntityNotFound(_0x145662,null));}})[_0xbcbe('0x24')](function(_0x449583){if(_0x449583){var _0xf08456=_0x449583[_0xbcbe('0xf0')]!==null;var _0x12cf8c=path[_0xbcbe('0xf1')](config['root'],'server/files/attachments/');if(_0xf08456){_0x12cf8c=path[_0xbcbe('0xf1')](_0x12cf8c,_0xbcbe('0xf2'));}var _0xf385a6=path[_0xbcbe('0xf1')](_0x12cf8c,_0x449583[_0xbcbe('0xea')]);return _0x145662[_0xbcbe('0xf3')](_0xf385a6);}})[_0xbcbe('0x2e')](handleError(_0x145662,null));};exports['close']=function(_0x5ac2e4,_0x3d77a4){var _0x46c80d=null;var _0x1aafb8=null;var _0x4f6321=null;var _0x5dad91=null;if(_0x5ac2e4[_0xbcbe('0x3e')]['id']){delete _0x5ac2e4[_0xbcbe('0x3e')]['id'];}if(_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xf4')]){_0x5dad91=path['join'](config[_0xbcbe('0xf5')],'server/files/chat/upload/',util[_0xbcbe('0xf6')](_0xbcbe('0xf7'),Date[_0xbcbe('0xf8')]()));_0x5ac2e4['body']['pathTranscript']=_0x5dad91;}return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x5ac2e4[_0xbcbe('0xce')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xbcbe('0xf9'),'include':[{'model':db['User'],'as':_0xbcbe('0x89')}]}]})[_0xbcbe('0x24')](handleEntityNotFound(_0x3d77a4,null))[_0xbcbe('0x24')](saveUpdates(_0x5ac2e4[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](function(_0x5a2d9d){if(_0x5a2d9d){_0x46c80d=_0x5a2d9d;return db[_0xbcbe('0xd2')][_0xbcbe('0x81')]({'where':{'id':_0x46c80d['ChatWebsiteId']}});}})[_0xbcbe('0x24')](function(_0x33da14){if(_0x33da14){_0x4f6321=_0x33da14;return db[_0xbcbe('0xe2')][_0xbcbe('0x81')]({'where':{'id':_0x46c80d[_0xbcbe('0x82')]}});}})[_0xbcbe('0x24')](function(_0x5b9c0d){if(_0x5b9c0d){_0x1aafb8=_0x5b9c0d;if(_0x5dad91){var _0x1d27f8=null;for(var _0xee0416=0x1;_0xee0416<_0x46c80d[_0xbcbe('0xf9')][_0xbcbe('0x5a')];++_0xee0416){_0x1d27f8=_0x46c80d['Messages'][_0xee0416];var _0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?util['format'](_0xbcbe('0xfa'),_0x4f6321[_0xbcbe('0xfb')],_0x1d27f8['UserId']):'System';var _0x1430ef=_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xfc')]||util[_0xbcbe('0xf6')](_0xbcbe('0xfa'),'Visitor',_0x1d27f8[_0xbcbe('0x82')]);switch(_0x4f6321[_0xbcbe('0xfd')]){case _0xbcbe('0xfe'):_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?util['format'](_0xbcbe('0xfa'),_0x4f6321[_0xbcbe('0xfb')],_0x1d27f8[_0xbcbe('0x4d')]):_0xbcbe('0xff');break;case'agent_alias':_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?_0x1d27f8[_0xbcbe('0x89')][_0xbcbe('0x100')]||_0x1d27f8[_0xbcbe('0x89')]['fullname']:'System';break;case'agent_fullname':_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?_0x1d27f8[_0xbcbe('0x89')][_0xbcbe('0xd8')]:_0xbcbe('0xff');break;default:_0x20408a=_0x1d27f8['UserId']?util[_0xbcbe('0xf6')](_0xbcbe('0xfa'),_0x4f6321['agentAlias'],_0x1d27f8[_0xbcbe('0x4d')]):_0xbcbe('0xff');}var _0x3eeaa3=util['format'](_0xbcbe('0x101'),moment(_0x1d27f8[_0xbcbe('0x93')])[_0xbcbe('0xf6')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1d27f8[_0xbcbe('0x102')]==='in'?_0x1430ef:_0x20408a,_0x1d27f8[_0xbcbe('0x3e')]);if(!_0x1d27f8[_0xbcbe('0x103')]){fs[_0xbcbe('0x104')](_0x5dad91,_0x3eeaa3);}}return db[_0xbcbe('0x105')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbcbe('0x106')],'as':_0xbcbe('0x107'),'raw':!![]}]});}}})[_0xbcbe('0x24')](function(_0x10f99a){if(_0x10f99a&&_0x10f99a[_0xbcbe('0x107')]&&_0x5ac2e4[_0xbcbe('0x3e')]){var _0x4396d1={'tls':{'rejectUnauthorized':![]}};if(_0x10f99a[_0xbcbe('0x107')]['service']){_0x4396d1[_0xbcbe('0x108')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x108')];}else{_0x4396d1[_0xbcbe('0x109')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x109')];_0x4396d1[_0xbcbe('0x10a')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10a')];_0x4396d1['secure']=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10b')];}if(_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10c')]){_0x4396d1[_0xbcbe('0x10d')]={'user':_0x10f99a['Smtp']['user'],'pass':_0x10f99a['Smtp'][_0xbcbe('0x10e')]};}return respondWithRpcPromise(_0xbcbe('0x10f'),_0xbcbe('0x110'),{'account':_0x4396d1,'message':{'from':util[_0xbcbe('0xf6')](_0xbcbe('0x111'),_0x10f99a['name'],_0x10f99a[_0xbcbe('0xd9')]||_0x10f99a[_0xbcbe('0x107')]['user']),'to':_0x5ac2e4[_0xbcbe('0x3e')]['mailTranscript'],'subject':_0xbcbe('0x112'),'text':util['format'](_0xbcbe('0x113'),_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xf4')]),'attachments':[{'path':_0x5dad91}]}})[_0xbcbe('0x24')](function(){return _0x46c80d;})[_0xbcbe('0x2e')](function(_0x19d16c){console['error'](_0x19d16c);});}else{return _0x46c80d;}})[_0xbcbe('0x24')](respondWithStatusCode(_0x3d77a4,0xc8))[_0xbcbe('0x2e')](handleError(_0x3d77a4,null));};exports[_0xbcbe('0x114')]=function(_0x1934bc,_0x5c28a5,_0x54266f){return db[_0xbcbe('0x115')][_0xbcbe('0x81')]({'where':{'id':_0x1934bc['params']['id']}})['then'](handleEntityNotFound(_0x5c28a5,null))[_0xbcbe('0x24')](function(_0x5a177c){if(_0x5a177c){return _0x5a177c[_0xbcbe('0x114')](_0x1934bc[_0xbcbe('0x3e')]['ids'],_[_0xbcbe('0x116')](_0x1934bc[_0xbcbe('0x3e')],['ids','id'])||{});}})[_0xbcbe('0x24')](respondWithResult(_0x5c28a5,null))['catch'](handleError(_0x5c28a5,null));};exports['getMessages']=function(_0x1da477,_0x13868d,_0x1f559c){var _0x1ef58e={'raw':![],'where':{}};var _0x2e998f={};var _0x4344b8={'count':0x0,'rows':[]};return db[_0xbcbe('0x52')][_0xbcbe('0xd1')]({'where':{'id':_0x1da477[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x13868d,null))['then'](function(_0x3e04a5){if(_0x3e04a5){_0x2e998f['model']=_[_0xbcbe('0x8c')](db[_0xbcbe('0x115')][_0xbcbe('0x53')]);_0x2e998f[_0xbcbe('0x56')]=_[_0xbcbe('0x8c')](_0x1da477[_0xbcbe('0x56')]);_0x2e998f['filters']=_[_0xbcbe('0x58')](_0x2e998f[_0xbcbe('0x5b')],_0x2e998f[_0xbcbe('0x56')]);_0x1ef58e['attributes']=_[_0xbcbe('0x58')](_0x2e998f[_0xbcbe('0x5b')],qs['fields'](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1ef58e[_0xbcbe('0x57')]=_0x1ef58e['attributes']['length']?_0x1ef58e[_0xbcbe('0x57')]:_0x2e998f[_0xbcbe('0x5b')];if(!_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1ef58e['limit']=qs[_0xbcbe('0x33')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x33')]);_0x1ef58e[_0xbcbe('0x31')]=qs[_0xbcbe('0x31')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1ef58e[_0xbcbe('0x5e')]=qs[_0xbcbe('0x5f')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x5f')]);_0x1ef58e['where']=qs[_0xbcbe('0x61')](_['pick'](_0x1da477['query'],_0x2e998f[_0xbcbe('0x61')]));_0x1ef58e[_0xbcbe('0x60')]['ChatInteractionId']=_0x3e04a5['id'];if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x9e')]){_0x1ef58e['where']=_['merge'](_0x1ef58e[_0xbcbe('0x60')],{'$or':_[_0xbcbe('0x43')](_0x1ef58e['attributes'],function(_0x31dc6c){var _0x22e045={};_0x22e045[_0x31dc6c]={'$like':'%'+_0x1da477['query']['filter']+'%'};return _0x22e045;})});}if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x95')]){var _0x481b82=_0x1da477[_0xbcbe('0x56')]['$gte'][_0xbcbe('0x46')](',');var _0x3d0005={};_0x3d0005[_0x481b82[0x0]]={'$gte':moment(_0x481b82[0x1])[_0xbcbe('0xf6')](_0xbcbe('0x117'))};_0x1ef58e[_0xbcbe('0x60')]=_[_0xbcbe('0x3d')](_0x1ef58e['where'],_0x3d0005);}_0x1ef58e=_[_0xbcbe('0x3d')]({},_0x1ef58e,_0x1da477[_0xbcbe('0xcc')]);return db[_0xbcbe('0x115')]['count']({'where':_0x1ef58e['where']})[_0xbcbe('0x24')](function(_0x3ccb5b){_0x4344b8[_0xbcbe('0x34')]=_0x3ccb5b;if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0xca')]){_0x1ef58e[_0xbcbe('0xcb')]=[{'all':!![]}];}return db[_0xbcbe('0x115')][_0xbcbe('0x118')](_0x1ef58e);})[_0xbcbe('0x24')](function(_0xb2314){_0x4344b8[_0xbcbe('0xc8')]=_0xb2314;return _0x4344b8;});}})[_0xbcbe('0x24')](respondWithFilteredResult(_0x13868d,_0x1ef58e))[_0xbcbe('0x2e')](handleError(_0x13868d,null));};exports['getMyMessages']=function(_0x32e41a,_0x3bc0cf,_0x3c0dfd){var _0x1d97d5={'where':{}},_0x5a9e0c={},_0x413403={'count':0x0,'rows':[]};return db[_0xbcbe('0x52')]['findOne']({'where':{'id':_0x32e41a[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x3bc0cf,null))['then'](function(_0x270b81){if(_0x270b81){_0x5a9e0c['model']=_[_0xbcbe('0x8c')](db[_0xbcbe('0x115')]['rawAttributes']);_0x5a9e0c[_0xbcbe('0x56')]=_['keys'](_0x32e41a['query']);_0x5a9e0c[_0xbcbe('0x61')]=_[_0xbcbe('0x58')](_0x5a9e0c[_0xbcbe('0x5b')],_0x5a9e0c[_0xbcbe('0x56')]);_0x1d97d5[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x5a9e0c[_0xbcbe('0x5b')],qs[_0xbcbe('0x59')](_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1d97d5[_0xbcbe('0x57')]=_0x1d97d5['attributes'][_0xbcbe('0x5a')]?_0x1d97d5['attributes']:_0x5a9e0c[_0xbcbe('0x5b')];if(!_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1d97d5[_0xbcbe('0x33')]=qs['limit'](_0x32e41a['query']['limit']);_0x1d97d5[_0xbcbe('0x31')]=qs[_0xbcbe('0x31')](_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1d97d5[_0xbcbe('0x5e')]=qs[_0xbcbe('0x5f')](_0x32e41a['query']['sort']);_0x1d97d5[_0xbcbe('0x60')]=qs[_0xbcbe('0x61')](_[_0xbcbe('0x119')](_0x32e41a[_0xbcbe('0x56')],_0x5a9e0c[_0xbcbe('0x61')]));_0x1d97d5[_0xbcbe('0x60')][_0xbcbe('0xc6')]=_0x270b81['id'];if(_0x32e41a[_0xbcbe('0x56')]['filter']){_0x1d97d5[_0xbcbe('0x60')]=_['merge'](_0x1d97d5[_0xbcbe('0x60')],{'$or':_['map'](_0x1d97d5[_0xbcbe('0x57')],function(_0x30d3bf){var _0x374280={};_0x374280[_0x30d3bf]={'$like':'%'+_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x9e')]+'%'};return _0x374280;})});}_0x1d97d5[_0xbcbe('0x60')][_0xbcbe('0x103')]=![];if(_0x32e41a[_0xbcbe('0x56')]['id']){_0x1d97d5[_0xbcbe('0x60')]['id']={'$gt':_0x32e41a[_0xbcbe('0x56')]['id']};}_0x1d97d5=_[_0xbcbe('0x3d')]({},_0x1d97d5,_0x32e41a[_0xbcbe('0xcc')]);return db['ChatMessage'][_0xbcbe('0x34')]({'where':_0x1d97d5[_0xbcbe('0x60')]})[_0xbcbe('0x24')](function(_0x98a0c){_0x413403[_0xbcbe('0x34')]=_0x98a0c;_0x1d97d5[_0xbcbe('0xcb')]=[];if(_0x32e41a['query'][_0xbcbe('0x11a')]){_0x1d97d5['include'][_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x89'),'attributes':['id',_0xbcbe('0xd8'),_0xbcbe('0x100')]});}if(_0x32e41a[_0xbcbe('0x56')]['includeAll']){_0x1d97d5['include']=[{'all':!![]}];}return db[_0xbcbe('0x115')][_0xbcbe('0x118')](_0x1d97d5);})['then'](function(_0x585582){_0x413403[_0xbcbe('0xc8')]=_0x585582;return _0x413403;});}})[_0xbcbe('0x24')](respondWithFilteredResult(_0x3bc0cf,_0x1d97d5))[_0xbcbe('0x2e')](handleError(_0x3bc0cf,null));};exports[_0xbcbe('0x11c')]=function(_0x4022a3,_0x461af4,_0x5e4909){return db[_0xbcbe('0x52')]['find']({'where':{'id':_0x4022a3['params']['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x461af4,null))[_0xbcbe('0x24')](function(_0x4e57ac){if(_0x4e57ac){return _0x4e57ac[_0xbcbe('0x11d')](_0x4022a3[_0xbcbe('0x3e')][_0xbcbe('0x11e')],_[_0xbcbe('0x116')](_0x4022a3[_0xbcbe('0x3e')],[_0xbcbe('0x11e'),'id'])||{})[_0xbcbe('0x11f')](function(){return db[_0xbcbe('0x86')]['findAll']({'attributes':['id',_0xbcbe('0x3a'),_0xbcbe('0x64')],'where':{'id':_0x4022a3[_0xbcbe('0x3e')][_0xbcbe('0x11e')]}});})['then'](function(_0x5f2da5){socket[_0xbcbe('0x120')](_0xbcbe('0x121'),{'id':Number(_0x4022a3['params']['id']),'tags':_0x5f2da5||[]});return{'id':Number(_0x4022a3[_0xbcbe('0xce')]['id']),'tags':_0x5f2da5||[]};});}})['then'](respondWithResult(_0x461af4,null))['catch'](handleError(_0x461af4,null));};exports[_0xbcbe('0x122')]=function(_0x2b96b8,_0x37bf30,_0x4975b9){return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x2b96b8['params']['id']}})['then'](handleEntityNotFound(_0x37bf30,null))[_0xbcbe('0x24')](function(_0x31d39f){if(_0x31d39f){return _0x31d39f[_0xbcbe('0x122')](_0x2b96b8['query'][_0xbcbe('0x11e')]);}})[_0xbcbe('0x24')](respondWithStatusCode(_0x37bf30,null))[_0xbcbe('0x2e')](handleError(_0x37bf30,null));};exports[_0xbcbe('0xf3')]=function(_0x5c9a2d,_0x3f9e50){var _0x28523c=moment()['unix']()[_0xbcbe('0xb0')]();var _0x478f65=path[_0xbcbe('0xf1')](config['root'],_0xbcbe('0x123'),_0xbcbe('0x124'),_0xbcbe('0x125'));var _0x313643=path[_0xbcbe('0xf1')](config[_0xbcbe('0xf5')],'server',_0xbcbe('0x124'),_0xbcbe('0x126'));var _0x1fd19d=path[_0xbcbe('0xf1')](_0x478f65,_0x28523c);var _0x106624=util[_0xbcbe('0xf6')](_0xbcbe('0x127'),_0x5c9a2d[_0xbcbe('0xce')]['id'],_0x28523c);var _0x52141d=path[_0xbcbe('0xf1')](_0x478f65,_0x106624);var _0x32d2d0=[];_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x89'),'attributes':['id',_0xbcbe('0xd8')],'raw':!![]});_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0xe2')],'as':_0xbcbe('0x7b'),'attributes':['id','firstName',_0xbcbe('0x128')],'raw':!![]});if(_0x5c9a2d[_0xbcbe('0x56')][_0xbcbe('0x126')]){_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0xec')],'as':'Attachment','raw':!![]});}var _0x206ce7=[{'model':db[_0xbcbe('0x115')],'as':_0xbcbe('0xf9'),'attributes':['id',_0xbcbe('0x3e'),_0xbcbe('0x93'),'direction',_0xbcbe('0x103'),'read'],'include':_0x32d2d0}];_0x206ce7['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xbcbe('0x3a')]});_0x206ce7[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x129'),'attributes':['id',_0xbcbe('0xd8')]});return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x5c9a2d[_0xbcbe('0xce')]['id']},'include':_0x206ce7})[_0xbcbe('0x24')](handleEntityNotFound(_0x3f9e50,null))[_0xbcbe('0x24')](function(_0x326fb5){if(_0x326fb5){var _0x30ac13=_0x326fb5[_0xbcbe('0x12a')]({'plain':!![]});fs[_0xbcbe('0x12b')](_0x1fd19d);var _0x54e214={'channel':_0xbcbe('0x12c'),'account':_0x30ac13['Account']['name'],'agent':_0x30ac13[_0xbcbe('0x129')]?_0x30ac13['Owner']['fullname']:'N.A.','createdAt':moment(_0x30ac13['createdAt'])[_0xbcbe('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x30ac13[_0xbcbe('0x4e')]?moment(_0x30ac13[_0xbcbe('0x12d')])[_0xbcbe('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbcbe('0xb0')]():'','disposition':_0x30ac13[_0xbcbe('0x4f')],'chatInfo':{'browser':_0x30ac13[_0xbcbe('0x12e')],'os':_0x30ac13[_0xbcbe('0x12f')],'referer':_0x30ac13[_0xbcbe('0x130')],'customerIp':_0x30ac13[_0xbcbe('0x131')],'customerPort':_0x30ac13[_0xbcbe('0x132')]?_0x30ac13[_0xbcbe('0x132')]:'N.A.'},'messages':_(_0x30ac13[_0xbcbe('0xf9')])[_0xbcbe('0x133')]()[_0xbcbe('0x9e')]({'secret':![]})[_0xbcbe('0x43')](function(_0x195a4b){if(_0x195a4b[_0xbcbe('0xec')]){var _0x3c9666=path[_0xbcbe('0xf1')](_0x313643,_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')]);if(fs['existsSync'](_0x3c9666)){fs[_0xbcbe('0x134')](_0x3c9666)[_0xbcbe('0x135')](fs['createWriteStream'](path['join'](_0x1fd19d,_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')])));}}return{'date':moment(_0x195a4b[_0xbcbe('0x93')])[_0xbcbe('0xf6')](_0xbcbe('0x117'))[_0xbcbe('0xb0')](),'sender':_0x195a4b[_0xbcbe('0x102')]===_0xbcbe('0x136')?_0x195a4b[_0xbcbe('0x89')]?_0x195a4b[_0xbcbe('0x89')][_0xbcbe('0xd8')]:_0xbcbe('0xff'):_0x195a4b['Contact'][_0xbcbe('0x137')]+(_0x195a4b[_0xbcbe('0x7b')][_0xbcbe('0x128')]?'\x20'+_0x195a4b[_0xbcbe('0x7b')][_0xbcbe('0x128')]:''),'body':_0x195a4b[_0xbcbe('0xec')]?_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')]:_0x195a4b[_0xbcbe('0x3e')],'direction':_0x195a4b[_0xbcbe('0x102')]===_0xbcbe('0x136')?'A':'C','secret':_0x195a4b[_0xbcbe('0x103')],'read':_0x195a4b['read'],'attachment':_0x195a4b[_0xbcbe('0xec')]};})[_0xbcbe('0x7f')]()};return ejs['renderFile'](path[_0xbcbe('0xf1')](config[_0xbcbe('0xf5')],_0xbcbe('0x123'),'views','downloadInteraction.ejs'),{'interaction':_0x54e214})[_0xbcbe('0x24')](function(_0x513354){var _0x5de455=path[_0xbcbe('0xf1')](_0x1fd19d,_0xbcbe('0x138')+_0x30ac13['id']+'-'+_0x28523c+_0xbcbe('0x139'));var _0x5759aa={'path':_0x5de455,'channel':_0xbcbe('0x12c'),'interactionId':_0x30ac13['id']};return pdf['createPdfFromHTML'](_0x513354,_0x5759aa);})[_0xbcbe('0x24')](function(){return new BPromise(function(_0x2f7b00,_0x5e9255){zipdir(_0x1fd19d,{'saveTo':_0x52141d},function(_0x2ddf3,_0x22f9e6){if(_0x2ddf3)return _0x5e9255(_0x2ddf3);return _0x2f7b00(_0x22f9e6);});})[_0xbcbe('0x24')](function(){return new BPromise(function(_0x13a02b,_0x37d3cd){rimraf(_0x1fd19d,function(_0x3f992b){if(_0x3f992b)_0x37d3cd(_0x3f992b);return _0x13a02b();});});})[_0xbcbe('0x24')](function(){return _0x3f9e50[_0xbcbe('0xf3')](_0x52141d,_0x106624,function(_0x146a8a){if(_0x146a8a){console[_0xbcbe('0x13a')](_0xbcbe('0x13b'),_0x146a8a);}else{fs[_0xbcbe('0x13c')](_0x52141d);}});});});}else{return _0x3f9e50[_0xbcbe('0x2f')](0xc8);}})[_0xbcbe('0x2e')](handleError(_0x3f9e50,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 75612f4..4dc7029 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 _0xd57d=['findAll','length','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1d03f1,_0x7f2edf){var _0x40c77e=function(_0x2f1025){while(--_0x2f1025){_0x1d03f1['push'](_0x1d03f1['shift']());}};_0x40c77e(++_0x7f2edf);}(_0xd57d,0x15e));var _0xdd57=function(_0x25b514,_0x5adb8b){_0x25b514=_0x25b514-0x0;var _0x2218aa=_0xd57d[_0x25b514];return _0x2218aa;};'use strict';var EventEmitter=require(_0xdd57('0x0'));var ChatInteraction=require(_0xdd57('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdd57('0x1'))['db'][_0xdd57('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdd57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd57('0x4')};function emitEvent(_0x37aeb2){return function(_0x28b2aa,_0x4298e9,_0x5ec543){_0x28b2aa[_0xdd57('0x5')]({'attributes':['id'],'raw':!![]})[_0xdd57('0x6')](function(_0x427c0e){_0x28b2aa[_0xdd57('0x7')](_0xdd57('0x8'),_0x427c0e[_0xdd57('0x9')](function(_0x5267b2){return{'id':_0x5267b2['id']};}));return ChatMessage[_0xdd57('0xa')]({'where':{'ChatInteractionId':_0x28b2aa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3626b9){_0x28b2aa['setDataValue']('unreadMessages',_0x3626b9[_0xdd57('0xb')]);ChatInteractionEvents[_0xdd57('0xc')](_0x37aeb2+':'+_0x28b2aa['id'],_0x28b2aa);ChatInteractionEvents['emit'](_0x37aeb2,_0x28b2aa);_0x5ec543(null);})['catch'](_0x5ec543(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdd57('0xd')](e,emitEvent(event));}}module[_0xdd57('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0xdcf3=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x50bff6,_0x5f1b2b){var _0x10c8bf=function(_0xdb4bc4){while(--_0xdb4bc4){_0x50bff6['push'](_0x50bff6['shift']());}};_0x10c8bf(++_0x5f1b2b);}(_0xdcf3,0x7a));var _0x3dcf=function(_0x3b21ed,_0x516768){_0x3b21ed=_0x3b21ed-0x0;var _0x3c275f=_0xdcf3[_0x3b21ed];return _0x3c275f;};'use strict';var EventEmitter=require(_0x3dcf('0x0'));var ChatInteraction=require(_0x3dcf('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x3dcf('0x1'))['db'][_0x3dcf('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3dcf('0x3')](0x0);var events={'afterCreate':_0x3dcf('0x4'),'afterUpdate':_0x3dcf('0x5'),'afterDestroy':_0x3dcf('0x6')};function emitEvent(_0x5de87d){return function(_0x3efbfb,_0x449b46,_0xe29e0a){_0x3efbfb[_0x3dcf('0x7')]({'attributes':['id'],'raw':!![]})[_0x3dcf('0x8')](function(_0x3847eb){_0x3efbfb[_0x3dcf('0x9')](_0x3dcf('0xa'),_0x3847eb[_0x3dcf('0xb')](function(_0x232959){return{'id':_0x232959['id']};}));return ChatMessage[_0x3dcf('0xc')]({'where':{'ChatInteractionId':_0x3efbfb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3dcf('0x8')](function(_0x5751c7){_0x3efbfb[_0x3dcf('0x9')](_0x3dcf('0xd'),_0x5751c7[_0x3dcf('0xe')]);ChatInteractionEvents[_0x3dcf('0xf')](_0x5de87d+':'+_0x3efbfb['id'],_0x3efbfb);ChatInteractionEvents[_0x3dcf('0xf')](_0x5de87d,_0x3efbfb);_0xe29e0a(null);})[_0x3dcf('0x10')](_0xe29e0a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x3dcf('0x11')](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 5b29339..2097eb3 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 _0x4940=['api','bluebird','request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1c4f71,_0x94a635){var _0x43a28b=function(_0x479f6b){while(--_0x479f6b){_0x1c4f71['push'](_0x1c4f71['shift']());}};_0x43a28b(++_0x94a635);}(_0x4940,0x1b7));var _0x0494=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4940[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var logger=require(_0x0494('0x2'))(_0x0494('0x3'));var moment=require('moment');var BPromise=require(_0x0494('0x4'));var rp=require(_0x0494('0x5'));var fs=require('fs');var path=require(_0x0494('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0494('0x7'));module[_0x0494('0x8')]=function(_0x350f45,_0x55c2f7){return _0x350f45[_0x0494('0x9')](_0x0494('0xa'),attributes,{'tableName':_0x0494('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c5480,_0x31ea9a,_0x585a21){if(_0x4c5480['changed']('closed')){_0x4c5480[_0x0494('0xc')]=moment()[_0x0494('0xd')](_0x0494('0xe'));}_0x585a21(null,_0x4c5480);}},'charset':_0x0494('0xf'),'collate':_0x0494('0x10')});}; \ No newline at end of file +var _0xe288=['./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3d85ee,_0x372cbd){var _0x276478=function(_0x56b2d8){while(--_0x56b2d8){_0x3d85ee['push'](_0x3d85ee['shift']());}};_0x276478(++_0x372cbd);}(_0xe288,0xb8));var _0x8e28=function(_0x3f8d95,_0xf30c58){_0x3f8d95=_0x3f8d95-0x0;var _0x50d325=_0xe288[_0x3f8d95];return _0x50d325;};'use strict';var _=require(_0x8e28('0x0'));var util=require(_0x8e28('0x1'));var logger=require(_0x8e28('0x2'))(_0x8e28('0x3'));var moment=require('moment');var BPromise=require(_0x8e28('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e28('0x5'));var rimraf=require(_0x8e28('0x6'));var config=require(_0x8e28('0x7'));var attributes=require(_0x8e28('0x8'));module[_0x8e28('0x9')]=function(_0x295c28,_0x4c9cd9){return _0x295c28[_0x8e28('0xa')](_0x8e28('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46cd0b,_0x43a75e,_0x1aeb9a){if(_0x46cd0b['changed'](_0x8e28('0xc'))){_0x46cd0b[_0x8e28('0xd')]=moment()[_0x8e28('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1aeb9a(null,_0x46cd0b);}},'charset':_0x8e28('0xf'),'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 6657c2f..2f6b728 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 _0x7917=['socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','options','raw','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','body','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x27d66e,_0x114031){var _0x4211f0=function(_0x3008ec){while(--_0x3008ec){_0x27d66e['push'](_0x27d66e['shift']());}};_0x4211f0(++_0x114031);}(_0x7917,0x6d));var _0x7791=function(_0x4090f8,_0x3df966){_0x4090f8=_0x4090f8-0x0;var _0x2a7827=_0x7917[_0x4090f8];return _0x2a7827;};'use strict';var _=require(_0x7791('0x0'));var util=require(_0x7791('0x1'));var moment=require('moment');var BPromise=require(_0x7791('0x2'));var rs=require(_0x7791('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7791('0x4'))['db'];var utils=require(_0x7791('0x5'));var logger=require('../../config/logger')(_0x7791('0x6'));var config=require(_0x7791('0x7'));var jayson=require(_0x7791('0x8'));var client=jayson[_0x7791('0x9')][_0x7791('0xa')]({'port':0x232a});config[_0x7791('0xb')]=_[_0x7791('0xc')](config[_0x7791('0xb')],{'host':_0x7791('0xd'),'port':0x18eb});var socket=require(_0x7791('0xe'))(new Redis(config['redis']));require(_0x7791('0xf'))[_0x7791('0x10')](socket);function respondWithRpcPromise(_0x2b8465,_0x48b500,_0x3766cc){return new BPromise(function(_0x96db3e,_0x547df1){return client[_0x7791('0x11')](_0x2b8465,_0x3766cc)[_0x7791('0x12')](function(_0x231e2a){logger[_0x7791('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x48b500,_0x7791('0x14'));logger[_0x7791('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x48b500,_0x7791('0x14'),JSON[_0x7791('0x16')](_0x231e2a));if(_0x231e2a[_0x7791('0x17')]){if(_0x231e2a[_0x7791('0x17')]['code']===0x1f4){logger['error'](_0x7791('0x18'),_0x48b500,_0x231e2a[_0x7791('0x17')][_0x7791('0x19')]);return _0x547df1(_0x231e2a['error'][_0x7791('0x19')]);}logger[_0x7791('0x17')](_0x7791('0x18'),_0x48b500,_0x231e2a[_0x7791('0x17')][_0x7791('0x19')]);return _0x96db3e(_0x231e2a[_0x7791('0x17')]['message']);}else{logger[_0x7791('0x13')](_0x7791('0x18'),_0x48b500,'request\x20sent');_0x96db3e(_0x231e2a[_0x7791('0x1a')][_0x7791('0x19')]);}})[_0x7791('0x1b')](function(_0x1e0736){logger[_0x7791('0x17')](_0x7791('0x18'),_0x48b500,_0x1e0736);_0x547df1(_0x1e0736);});});}exports['UpdateChatInteraction']=function(_0x14551b){var _0x1e21e4=this;return new Promise(function(_0x53df93,_0x4c182b){return db[_0x7791('0x1c')][_0x7791('0x1d')](_0x14551b['body'],{'raw':_0x14551b[_0x7791('0x1e')]?_0x14551b[_0x7791('0x1e')][_0x7791('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14551b[_0x7791('0x1e')]?_0x14551b[_0x7791('0x1e')]['where']||null:null,'attributes':_0x14551b['options']?_0x14551b[_0x7791('0x1e')]['attributes']||null:null,'limit':_0x14551b[_0x7791('0x1e')]?_0x14551b['options'][_0x7791('0x20')]||null:null})[_0x7791('0x12')](function(_0x29cf9e){logger['info']('UpdateChatInteraction',_0x14551b);logger['debug'](_0x7791('0x21'),_0x14551b,JSON[_0x7791('0x16')](_0x29cf9e));_0x53df93(_0x29cf9e);})[_0x7791('0x1b')](function(_0x51d2f9){logger[_0x7791('0x17')](_0x7791('0x21'),_0x51d2f9[_0x7791('0x19')],_0x14551b);_0x4c182b(_0x1e21e4[_0x7791('0x17')](0x1f4,_0x51d2f9[_0x7791('0x19')]));});});};exports[_0x7791('0x22')]=function(_0x14419b){return new Promise(function(_0x3a5e5f,_0x4f9ff9){return db[_0x7791('0x1c')][_0x7791('0x23')]({'where':_0x14419b[_0x7791('0x1e')]?_0x14419b[_0x7791('0x1e')]['where']||null:null})[_0x7791('0x12')](function(_0x530b70){if(_0x530b70){return _0x530b70['addTags'](_0x14419b[_0x7791('0x24')]['ids'],_[_0x7791('0x25')](_0x14419b['body'],[_0x7791('0x26'),'id'])||{});}})[_0x7791('0x27')](function(_0x57e3b6){logger[_0x7791('0x13')](_0x7791('0x28'),_0x14419b);logger[_0x7791('0x15')](_0x7791('0x28'),_0x14419b,JSON[_0x7791('0x16')](_0x57e3b6));_0x3a5e5f(_0x57e3b6);})[_0x7791('0x1b')](function(_0x47401){logger[_0x7791('0x17')](_0x7791('0x28'),_0x47401[_0x7791('0x19')],_0x14419b);_0x4f9ff9(_this[_0x7791('0x17')](0x1f4,_0x47401['message']));});});}; \ No newline at end of file +var _0x441f=['then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','catch','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0xee9a4d,_0x434e9d){var _0x3ba5c3=function(_0x3aff70){while(--_0x3aff70){_0xee9a4d['push'](_0xee9a4d['shift']());}};_0x3ba5c3(++_0x434e9d);}(_0x441f,0x12f));var _0xf441=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x441f[_0x5a99db];return _0x3aad62;};'use strict';var _=require('lodash');var util=require(_0xf441('0x0'));var moment=require('moment');var BPromise=require(_0xf441('0x1'));var rs=require(_0xf441('0x2'));var fs=require('fs');var Redis=require(_0xf441('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf441('0x4'))(_0xf441('0x5'));var config=require(_0xf441('0x6'));var jayson=require(_0xf441('0x7'));var client=jayson[_0xf441('0x8')][_0xf441('0x9')]({'port':0x232a});config[_0xf441('0xa')]=_[_0xf441('0xb')](config[_0xf441('0xa')],{'host':_0xf441('0xc'),'port':0x18eb});var socket=require(_0xf441('0xd'))(new Redis(config[_0xf441('0xa')]));require(_0xf441('0xe'))[_0xf441('0xf')](socket);function respondWithRpcPromise(_0x405458,_0x37a068,_0x453d93){return new BPromise(function(_0x29d618,_0x49ab6d){return client[_0xf441('0x10')](_0x405458,_0x453d93)[_0xf441('0x11')](function(_0x462bcb){logger['info'](_0xf441('0x12'),_0x37a068,_0xf441('0x13'));logger[_0xf441('0x14')](_0xf441('0x15'),_0x37a068,_0xf441('0x13'),JSON[_0xf441('0x16')](_0x462bcb));if(_0x462bcb[_0xf441('0x17')]){if(_0x462bcb['error']['code']===0x1f4){logger[_0xf441('0x17')](_0xf441('0x12'),_0x37a068,_0x462bcb[_0xf441('0x17')][_0xf441('0x18')]);return _0x49ab6d(_0x462bcb[_0xf441('0x17')][_0xf441('0x18')]);}logger['error'](_0xf441('0x12'),_0x37a068,_0x462bcb[_0xf441('0x17')]['message']);return _0x29d618(_0x462bcb[_0xf441('0x17')]['message']);}else{logger[_0xf441('0x19')](_0xf441('0x12'),_0x37a068,_0xf441('0x13'));_0x29d618(_0x462bcb[_0xf441('0x1a')][_0xf441('0x18')]);}})['catch'](function(_0x37bc26){logger[_0xf441('0x17')](_0xf441('0x12'),_0x37a068,_0x37bc26);_0x49ab6d(_0x37bc26);});});}exports[_0xf441('0x1b')]=function(_0x53004c){var _0xf415c9=this;return new Promise(function(_0x18f36c,_0x1fac5c){return db[_0xf441('0x1c')][_0xf441('0x1d')](_0x53004c[_0xf441('0x1e')],{'raw':_0x53004c[_0xf441('0x1f')]?_0x53004c[_0xf441('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53004c['options']?_0x53004c[_0xf441('0x1f')][_0xf441('0x20')]||null:null,'attributes':_0x53004c['options']?_0x53004c[_0xf441('0x1f')][_0xf441('0x21')]||null:null,'limit':_0x53004c[_0xf441('0x1f')]?_0x53004c[_0xf441('0x1f')]['limit']||null:null})[_0xf441('0x11')](function(_0x45cab3){logger['info'](_0xf441('0x1b'),_0x53004c);logger[_0xf441('0x14')](_0xf441('0x1b'),_0x53004c,JSON[_0xf441('0x16')](_0x45cab3));_0x18f36c(_0x45cab3);})[_0xf441('0x22')](function(_0x5b96b5){logger[_0xf441('0x17')](_0xf441('0x1b'),_0x5b96b5['message'],_0x53004c);_0x1fac5c(_0xf415c9[_0xf441('0x17')](0x1f4,_0x5b96b5[_0xf441('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x573709){return new Promise(function(_0x350f11,_0x24a6e0){return db['ChatInteraction']['find']({'where':_0x573709[_0xf441('0x1f')]?_0x573709[_0xf441('0x1f')][_0xf441('0x20')]||null:null})[_0xf441('0x11')](function(_0x210f0c){if(_0x210f0c){return _0x210f0c[_0xf441('0x23')](_0x573709[_0xf441('0x1e')][_0xf441('0x24')],_[_0xf441('0x25')](_0x573709[_0xf441('0x1e')],[_0xf441('0x24'),'id'])||{});}})[_0xf441('0x26')](function(_0xc319b6){logger[_0xf441('0x19')](_0xf441('0x27'),_0x573709);logger[_0xf441('0x14')](_0xf441('0x27'),_0x573709,JSON[_0xf441('0x16')](_0xc319b6));_0x350f11(_0xc319b6);})[_0xf441('0x22')](function(_0x53928f){logger[_0xf441('0x17')](_0xf441('0x27'),_0x53928f[_0xf441('0x18')],_0x573709);_0x24a6e0(_this[_0xf441('0x17')](0x1f4,_0x53928f[_0xf441('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d0027b1..c60d6b3 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 _0xcb97=['save','remove','emit','removeListener','register','length','./chatInteraction.events'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xcb97,0x14f));var _0x7cb9=function(_0x48dba4,_0x1619e8){_0x48dba4=_0x48dba4-0x0;var _0x3ff0a0=_0xcb97[_0x48dba4];return _0x3ff0a0;};'use strict';var ChatInteractionEvents=require(_0x7cb9('0x0'));var events=[_0x7cb9('0x1'),_0x7cb9('0x2'),'update'];function createListener(_0x4bec05,_0x4b901a){return function(_0x311317){_0x4b901a[_0x7cb9('0x3')](_0x4bec05,_0x311317);};}function removeListener(_0x28e79f,_0x7e831a){return function(){ChatInteractionEvents[_0x7cb9('0x4')](_0x28e79f,_0x7e831a);};}exports[_0x7cb9('0x5')]=function(_0x1994aa){for(var _0x209a67=0x0,_0x9be7a0=events[_0x7cb9('0x6')];_0x209a67<_0x9be7a0;_0x209a67++){var _0x3ac7a6=events[_0x209a67];var _0x1402ed=createListener('chatInteraction:'+_0x3ac7a6,_0x1994aa);ChatInteractionEvents['on'](_0x3ac7a6,_0x1402ed);}}; \ No newline at end of file +var _0xbdb0=['chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener','length'];(function(_0xf6e5c5,_0x51424e){var _0x541517=function(_0x37b788){while(--_0x37b788){_0xf6e5c5['push'](_0xf6e5c5['shift']());}};_0x541517(++_0x51424e);}(_0xbdb0,0x189));var _0x0bdb=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0xbdb0[_0x147497];return _0x35f45;};'use strict';var ChatInteractionEvents=require(_0x0bdb('0x0'));var events=[_0x0bdb('0x1'),_0x0bdb('0x2'),'update'];function createListener(_0x3867c6,_0x3c39ef){return function(_0xede3c3){_0x3c39ef[_0x0bdb('0x3')](_0x3867c6,_0xede3c3);};}function removeListener(_0x361014,_0x4af929){return function(){ChatInteractionEvents[_0x0bdb('0x4')](_0x361014,_0x4af929);};}exports['register']=function(_0x168689){for(var _0x5254ca=0x0,_0x1458e4=events[_0x0bdb('0x5')];_0x5254ca<_0x1458e4;_0x5254ca++){var _0x9a24fd=events[_0x5254ca];var _0x3afa5e=createListener(_0x0bdb('0x6')+_0x9a24fd,_0x168689);ChatInteractionEvents['on'](_0x9a24fd,_0x3afa5e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3b4ab84..0ad0265 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 _0xd709=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3fdae4,_0x16182d){var _0x5c4538=function(_0x26c46d){while(--_0x26c46d){_0x3fdae4['push'](_0x3fdae4['shift']());}};_0x5c4538(++_0x16182d);}(_0xd709,0xd6));var _0x9d70=function(_0x39e943,_0x1926ba){_0x39e943=_0x39e943-0x0;var _0x587ad7=_0xd709[_0x39e943];return _0x587ad7;};'use strict';var multer=require(_0x9d70('0x0'));var util=require(_0x9d70('0x1'));var path=require(_0x9d70('0x2'));var timeout=require(_0x9d70('0x3'));var express=require('express');var router=express[_0x9d70('0x4')]();var fs_extra=require(_0x9d70('0x5'));var auth=require(_0x9d70('0x6'));var interaction=require(_0x9d70('0x7'));var config=require(_0x9d70('0x8'));var controller=require(_0x9d70('0x9'));router['get']('/',auth[_0x9d70('0xa')](),controller[_0x9d70('0xb')]);router[_0x9d70('0xc')](_0x9d70('0xd'),auth['isAuthenticated'](),controller[_0x9d70('0xe')]);router['get'](_0x9d70('0xf'),auth[_0x9d70('0x10')](),controller[_0x9d70('0x11')]);router[_0x9d70('0xc')](_0x9d70('0x12'),auth[_0x9d70('0x10')](),controller[_0x9d70('0x13')]);router[_0x9d70('0xc')](_0x9d70('0x14'),auth['isAuthenticated'](),controller[_0x9d70('0x15')]);router[_0x9d70('0xc')](_0x9d70('0x16'),auth[_0x9d70('0x10')](),controller['getMyMessages']);router[_0x9d70('0xc')](_0x9d70('0x17'),auth[_0x9d70('0xa')](),controller[_0x9d70('0x18')]);router['post']('/',auth[_0x9d70('0xa')](),controller[_0x9d70('0x19')]);router[_0x9d70('0x1a')](_0x9d70('0x1b'),auth[_0x9d70('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9d70('0x1c')]({'destination':function(_0x40818a,_0x19a8e4,_0x372998){_0x372998(null,path[_0x9d70('0x1d')](config[_0x9d70('0x1e')],_0x9d70('0x1f')));},'filename':function(_0x235feb,_0x52f4f9,_0x2b850e){_0x2b850e(null,util[_0x9d70('0x20')]('%s-%s',Date['now'](),_0x52f4f9['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9d70('0x1a')](_0x9d70('0x21'),upload[_0x9d70('0x22')](_0x9d70('0x23')),controller[_0x9d70('0x24')]);router[_0x9d70('0x1a')](_0x9d70('0x14'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x9d70('0x1a')](_0x9d70('0x25'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x28')),controller[_0x9d70('0x29')]);router[_0x9d70('0x2a')](_0x9d70('0xf'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x2b')),controller[_0x9d70('0x2c')]);router[_0x9d70('0x2a')]('/:id/custom_update',controller[_0x9d70('0x2d')]);router['put'](_0x9d70('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0x9d70('0x2f')]);router[_0x9d70('0x2a')](_0x9d70('0x30'),controller[_0x9d70('0x31')]);router[_0x9d70('0x32')](_0x9d70('0xf'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x33')),controller[_0x9d70('0x34')]);router[_0x9d70('0x32')](_0x9d70('0x25'),auth[_0x9d70('0xa')](),controller[_0x9d70('0x35')]);module[_0x9d70('0x36')]=router; \ No newline at end of file +var _0x0e0f=['post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','single','attachmentUpload','addMessage','chat','addTags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','delete','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0e0f,0x1cc));var _0xf0e0=function(_0xbfd048,_0x382dbf){_0xbfd048=_0xbfd048-0x0;var _0x36bf45=_0x0e0f[_0xbfd048];return _0x36bf45;};'use strict';var multer=require(_0xf0e0('0x0'));var util=require('util');var path=require(_0xf0e0('0x1'));var timeout=require(_0xf0e0('0x2'));var express=require('express');var router=express[_0xf0e0('0x3')]();var fs_extra=require(_0xf0e0('0x4'));var auth=require(_0xf0e0('0x5'));var interaction=require(_0xf0e0('0x6'));var config=require(_0xf0e0('0x7'));var controller=require(_0xf0e0('0x8'));router[_0xf0e0('0x9')]('/',auth[_0xf0e0('0xa')](),controller[_0xf0e0('0xb')]);router[_0xf0e0('0x9')](_0xf0e0('0xc'),auth[_0xf0e0('0xa')](),controller['describe']);router['get'](_0xf0e0('0xd'),auth[_0xf0e0('0xe')](),controller['show']);router[_0xf0e0('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xf0e0('0xf')]);router[_0xf0e0('0x9')](_0xf0e0('0x10'),auth[_0xf0e0('0xa')](),controller[_0xf0e0('0x11')]);router[_0xf0e0('0x9')]('/:id/my_messages',auth[_0xf0e0('0xe')](),controller[_0xf0e0('0x12')]);router['get'](_0xf0e0('0x13'),auth[_0xf0e0('0xa')](),controller['download']);router['post']('/',auth[_0xf0e0('0xa')](),controller['create']);router[_0xf0e0('0x14')](_0xf0e0('0x15'),auth['isAuthenticated'](),controller[_0xf0e0('0x16')]);var upload=multer({'storage':multer[_0xf0e0('0x17')]({'destination':function(_0xe50f39,_0x3aff64,_0x595348){_0x595348(null,path[_0xf0e0('0x18')](config[_0xf0e0('0x19')],_0xf0e0('0x1a')));},'filename':function(_0x477912,_0x19cbbf,_0xee0cd2){_0xee0cd2(null,util[_0xf0e0('0x1b')](_0xf0e0('0x1c'),Date[_0xf0e0('0x1d')](),_0x19cbbf['originalname'][_0xf0e0('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0xf0e0('0x1f')]('file'),controller[_0xf0e0('0x20')]);router[_0xf0e0('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xf0e0('0x21')]);router[_0xf0e0('0x14')]('/:id/tags',auth[_0xf0e0('0xa')](),interaction['tracked'](_0xf0e0('0x22'),'chatinteraction:addtags'),controller[_0xf0e0('0x23')]);router[_0xf0e0('0x24')](_0xf0e0('0xd'),auth[_0xf0e0('0xa')](),interaction[_0xf0e0('0x25')](_0xf0e0('0x22'),_0xf0e0('0x26')),controller[_0xf0e0('0x27')]);router[_0xf0e0('0x24')]('/:id/custom_update',controller[_0xf0e0('0x28')]);router[_0xf0e0('0x24')](_0xf0e0('0x29'),auth[_0xf0e0('0xe')](),controller[_0xf0e0('0x2a')]);router[_0xf0e0('0x24')]('/:id/close',controller['close']);router[_0xf0e0('0x2b')]('/:id',auth['isAuthenticated'](),interaction[_0xf0e0('0x25')]('chat','chatinteraction:destroy'),controller[_0xf0e0('0x2c')]);router[_0xf0e0('0x2b')](_0xf0e0('0x2d'),auth[_0xf0e0('0xa')](),controller[_0xf0e0('0x2e')]);module[_0xf0e0('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index e9afbe7..229ee8d 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 _0xa2bc=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x540fca,_0x54263f){var _0x15e0cc=function(_0x4ab3b5){while(--_0x4ab3b5){_0x540fca['push'](_0x540fca['shift']());}};_0x15e0cc(++_0x54263f);}(_0xa2bc,0xac));var _0xca2b=function(_0xa978e7,_0x38a984){_0xa978e7=_0xa978e7-0x0;var _0x557f98=_0xa2bc[_0xa978e7];return _0x557f98;};'use strict';var Sequelize=require(_0xca2b('0x0'));module[_0xca2b('0x1')]={'body':{'type':Sequelize[_0xca2b('0x2')](_0xca2b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xca2b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xca2b('0x5')]}}; \ No newline at end of file +var _0xa2df=['exports','TEXT','medium','sequelize'];(function(_0x509eeb,_0x35e432){var _0x275d4b=function(_0x4c73f6){while(--_0x4c73f6){_0x509eeb['push'](_0x509eeb['shift']());}};_0x275d4b(++_0x35e432);}(_0xa2df,0x157));var _0xfa2d=function(_0x2f5e6a,_0x555bce){_0x2f5e6a=_0x2f5e6a-0x0;var _0x1eaefc=_0xa2df[_0x2f5e6a];return _0x1eaefc;};'use strict';var Sequelize=require(_0xfa2d('0x0'));module[_0xfa2d('0x1')]={'body':{'type':Sequelize[_0xfa2d('0x2')](_0xfa2d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 59e9c8d..ff15ab0 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 _0xca9d=['sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit'];(function(_0x37e0a8,_0x184bc8){var _0x5ca63c=function(_0x1af002){while(--_0x1af002){_0x37e0a8['push'](_0x37e0a8['shift']());}};_0x5ca63c(++_0x184bc8);}(_0xca9d,0x184));var _0xdca9=function(_0x5088a2,_0x77cce5){_0x5088a2=_0x5088a2-0x0;var _0x2e6ac8=_0xca9d[_0x5088a2];return _0x2e6ac8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdca9('0x0'));var zipdir=require(_0xdca9('0x1'));var jsonpatch=require(_0xdca9('0x2'));var rp=require('request-promise');var moment=require(_0xdca9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdca9('0x4'));var path=require('path');var sox=require(_0xdca9('0x5'));var csv=require(_0xdca9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdca9('0x7'));var _=require(_0xdca9('0x8'));var squel=require(_0xdca9('0x9'));var crypto=require(_0xdca9('0xa'));var jsforce=require(_0xdca9('0xb'));var deskjs=require(_0xdca9('0xc'));var toCsv=require(_0xdca9('0x6'));var querystring=require('querystring');var Papa=require(_0xdca9('0xd'));var Redis=require(_0xdca9('0xe'));var authService=require(_0xdca9('0xf'));var qs=require(_0xdca9('0x10'));var as=require(_0xdca9('0x11'));var hardwareService=require(_0xdca9('0x12'));var logger=require(_0xdca9('0x13'))(_0xdca9('0x14'));var utils=require(_0xdca9('0x15'));var config=require(_0xdca9('0x16'));var licenseUtil=require(_0xdca9('0x17'));var db=require(_0xdca9('0x18'))['db'];config[_0xdca9('0x19')]=_[_0xdca9('0x1a')](config['redis'],{'host':_0xdca9('0x1b'),'port':0x18eb});var socket=require(_0xdca9('0x1c'))(new Redis(config[_0xdca9('0x19')]));require(_0xdca9('0x1d'))[_0xdca9('0x1e')](socket);function respondWithStatusCode(_0x2d899b,_0x182f6c){_0x182f6c=_0x182f6c||0xcc;return function(_0xa58ebf){if(_0xa58ebf){return _0x2d899b['sendStatus'](_0x182f6c);}return _0x2d899b[_0xdca9('0x1f')](_0x182f6c)[_0xdca9('0x20')]();};}function respondWithResult(_0x316d67,_0x5ad61e){_0x5ad61e=_0x5ad61e||0xc8;return function(_0x2d0850){if(_0x2d0850){return _0x316d67[_0xdca9('0x1f')](_0x5ad61e)[_0xdca9('0x21')](_0x2d0850);}};}function respondWithFilteredResult(_0x2bd4b3,_0x286795){return function(_0x44ef9c){if(_0x44ef9c){var _0x2ce4ba=typeof _0x286795[_0xdca9('0x22')]===_0xdca9('0x23')&&typeof _0x286795['limit']===_0xdca9('0x23');var _0x1da794=_0x44ef9c[_0xdca9('0x24')];var _0x326af8=_0x2ce4ba?0x0:_0x286795[_0xdca9('0x22')];var _0x3e8296=_0x2ce4ba?_0x44ef9c[_0xdca9('0x24')]:_0x286795['offset']+_0x286795[_0xdca9('0x25')];var _0x21094c;if(_0x3e8296>=_0x1da794){_0x3e8296=_0x1da794;_0x21094c=0xc8;}else{_0x21094c=0xce;}_0x2bd4b3[_0xdca9('0x1f')](_0x21094c);return _0x2bd4b3['set']('Content-Range',_0x326af8+'-'+_0x3e8296+'/'+_0x1da794)[_0xdca9('0x21')](_0x44ef9c);}return null;};}function patchUpdates(_0xc75ef2){return function(_0x2750b2){try{jsonpatch[_0xdca9('0x26')](_0x2750b2,_0xc75ef2,!![]);}catch(_0x525dda){return BPromise[_0xdca9('0x27')](_0x525dda);}return _0x2750b2[_0xdca9('0x28')]();};}function saveUpdates(_0x36911a,_0x4295ea){return function(_0x1ef49d){if(_0x1ef49d){return _0x1ef49d[_0xdca9('0x29')](_0x36911a)[_0xdca9('0x2a')](function(_0xbc9dc8){return _0xbc9dc8;});}return null;};}function removeEntity(_0x1b6174,_0x29a762){return function(_0x6b4b0a){if(_0x6b4b0a){return _0x6b4b0a['destroy']()[_0xdca9('0x2a')](function(){_0x1b6174[_0xdca9('0x1f')](0xcc)[_0xdca9('0x20')]();});}};}function handleEntityNotFound(_0x4d65a0,_0x1db505){return function(_0x221418){if(!_0x221418){_0x4d65a0[_0xdca9('0x2b')](0x194);}return _0x221418;};}function handleError(_0x37dd68,_0x2405cd){_0x2405cd=_0x2405cd||0x1f4;return function(_0x42f73d){logger[_0xdca9('0x2c')](_0x42f73d[_0xdca9('0x2d')]);if(_0x42f73d['name']){delete _0x42f73d[_0xdca9('0x2e')];}_0x37dd68[_0xdca9('0x1f')](_0x2405cd)[_0xdca9('0x2f')](_0x42f73d);};}exports[_0xdca9('0x30')]=function(_0x5489f6,_0xe1fe5f){var _0xdea677={},_0x2769f7={},_0x2d43ad={'count':0x0,'rows':[]};var _0x18e340=_[_0xdca9('0x31')](db[_0xdca9('0x32')][_0xdca9('0x33')],function(_0x533c31){return{'name':_0x533c31[_0xdca9('0x34')],'type':_0x533c31[_0xdca9('0x35')][_0xdca9('0x36')]};});_0x2769f7['model']=_[_0xdca9('0x31')](_0x18e340,_0xdca9('0x2e'));_0x2769f7[_0xdca9('0x37')]=_['keys'](_0x5489f6[_0xdca9('0x37')]);_0x2769f7[_0xdca9('0x38')]=_['intersection'](_0x2769f7['model'],_0x2769f7[_0xdca9('0x37')]);_0xdea677[_0xdca9('0x39')]=_[_0xdca9('0x3a')](_0x2769f7[_0xdca9('0x3b')],qs['fields'](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x3c')]));_0xdea677[_0xdca9('0x39')]=_0xdea677[_0xdca9('0x39')][_0xdca9('0x3d')]?_0xdea677[_0xdca9('0x39')]:_0x2769f7[_0xdca9('0x3b')];if(!_0x5489f6['query'][_0xdca9('0x3e')](_0xdca9('0x3f'))){_0xdea677[_0xdca9('0x25')]=qs[_0xdca9('0x25')](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x25')]);_0xdea677[_0xdca9('0x22')]=qs[_0xdca9('0x22')](_0x5489f6[_0xdca9('0x37')]['offset']);}_0xdea677['order']=qs[_0xdca9('0x40')](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x40')]);_0xdea677[_0xdca9('0x41')]=qs['filters'](_[_0xdca9('0x42')](_0x5489f6[_0xdca9('0x37')],_0x2769f7[_0xdca9('0x38')]),_0x18e340);if(_0x5489f6[_0xdca9('0x37')][_0xdca9('0x43')]){_0xdea677[_0xdca9('0x41')]=_[_0xdca9('0x44')](_0xdea677[_0xdca9('0x41')],{'$or':_['map'](_0x18e340,function(_0x579e09){if(_0x579e09[_0xdca9('0x35')]!=='VIRTUAL'){var _0x22b72b={};_0x22b72b[_0x579e09[_0xdca9('0x2e')]]={'$like':'%'+_0x5489f6[_0xdca9('0x37')][_0xdca9('0x43')]+'%'};return _0x22b72b;}})});}_0xdea677=_[_0xdca9('0x44')]({},_0xdea677,_0x5489f6[_0xdca9('0x45')]);var _0x23b8bd={'where':_0xdea677['where']};return db[_0xdca9('0x32')][_0xdca9('0x24')](_0x23b8bd)[_0xdca9('0x2a')](function(_0x73668e){_0x2d43ad[_0xdca9('0x24')]=_0x73668e;if(_0x5489f6[_0xdca9('0x37')][_0xdca9('0x46')]){_0xdea677[_0xdca9('0x47')]=[{'all':!![]}];}return db[_0xdca9('0x32')]['findAll'](_0xdea677);})[_0xdca9('0x2a')](function(_0x33f50c){_0x2d43ad['rows']=_0x33f50c;return _0x2d43ad;})[_0xdca9('0x2a')](respondWithFilteredResult(_0xe1fe5f,_0xdea677))[_0xdca9('0x48')](handleError(_0xe1fe5f,null));};exports[_0xdca9('0x49')]=function(_0x2cb4c4,_0x308b7e){var _0x127dbc={'raw':!![],'where':{'id':_0x2cb4c4[_0xdca9('0x4a')]['id']}},_0xca5bbb={};_0xca5bbb[_0xdca9('0x3b')]=_[_0xdca9('0x4b')](db[_0xdca9('0x32')][_0xdca9('0x33')]);_0xca5bbb[_0xdca9('0x37')]=_['keys'](_0x2cb4c4[_0xdca9('0x37')]);_0xca5bbb[_0xdca9('0x38')]=_[_0xdca9('0x3a')](_0xca5bbb[_0xdca9('0x3b')],_0xca5bbb[_0xdca9('0x37')]);_0x127dbc[_0xdca9('0x39')]=_[_0xdca9('0x3a')](_0xca5bbb['model'],qs[_0xdca9('0x3c')](_0x2cb4c4['query'][_0xdca9('0x3c')]));_0x127dbc[_0xdca9('0x39')]=_0x127dbc[_0xdca9('0x39')]['length']?_0x127dbc['attributes']:_0xca5bbb[_0xdca9('0x3b')];if(_0x2cb4c4[_0xdca9('0x37')][_0xdca9('0x46')]){_0x127dbc[_0xdca9('0x47')]=[{'all':!![]}];}_0x127dbc=_[_0xdca9('0x44')]({},_0x127dbc,_0x2cb4c4[_0xdca9('0x45')]);return db['ChatInternalMessage'][_0xdca9('0x4c')](_0x127dbc)[_0xdca9('0x2a')](handleEntityNotFound(_0x308b7e,null))[_0xdca9('0x2a')](respondWithResult(_0x308b7e,null))[_0xdca9('0x48')](handleError(_0x308b7e,null));};exports[_0xdca9('0x4d')]=function(_0x2257d3,_0x5d102b){return db[_0xdca9('0x32')][_0xdca9('0x4d')](_0x2257d3[_0xdca9('0x4e')],{})[_0xdca9('0x2a')](respondWithResult(_0x5d102b,0xc9))[_0xdca9('0x48')](handleError(_0x5d102b,null));};exports[_0xdca9('0x29')]=function(_0x14c1d5,_0x1d9fc7){if(_0x14c1d5['body']['id']){delete _0x14c1d5[_0xdca9('0x4e')]['id'];}return db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'id':_0x14c1d5[_0xdca9('0x4a')]['id']}})[_0xdca9('0x2a')](handleEntityNotFound(_0x1d9fc7,null))[_0xdca9('0x2a')](saveUpdates(_0x14c1d5[_0xdca9('0x4e')],null))['then'](respondWithResult(_0x1d9fc7,null))['catch'](handleError(_0x1d9fc7,null));};exports[_0xdca9('0x4f')]=function(_0x44806c,_0x30d17e){return db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'id':_0x44806c[_0xdca9('0x4a')]['id']}})[_0xdca9('0x2a')](handleEntityNotFound(_0x30d17e,null))['then'](removeEntity(_0x30d17e,null))['catch'](handleError(_0x30d17e,null));};exports[_0xdca9('0x50')]=function(_0x299722,_0x5cd6d2){return db[_0xdca9('0x32')][_0xdca9('0x50')]()[_0xdca9('0x2a')](respondWithResult(_0x5cd6d2,null))[_0xdca9('0x48')](handleError(_0x5cd6d2,null));};function wrapUser(_0x33b762){return function(_0x41f3ae){var _0x527b96=_0x33b762[_0xdca9('0x51')]({'plain':!![]});_0x527b96[_0xdca9('0x52')]=[];if(_0x41f3ae){_0x527b96[_0xdca9('0x53')]=_0x41f3ae[_0xdca9('0x54')];_0x527b96[_0xdca9('0x55')]=_0x41f3ae;}else{_0x527b96['lastMessageAt']=moment(0x0)[_0xdca9('0x56')](_0xdca9('0x57'));_0x527b96[_0xdca9('0x55')]={};}return _0x527b96;};}exports['getUsers']=function(_0x463ae7,_0x43329a,_0xc52268){var _0x23dfd0=[];return db[_0xdca9('0x58')][_0xdca9('0x59')]({'where':{'role':['agent',_0xdca9('0x5a'),_0xdca9('0x5b')]},'attributes':['id',_0xdca9('0x5c'),_0xdca9('0x2e'),_0xdca9('0x5d'),_0xdca9('0x5e'),'internal','online',_0xdca9('0x5f'),_0xdca9('0x60'),_0xdca9('0x61')],'order':qs[_0xdca9('0x40')](_0xdca9('0x62')),'include':[{'model':db[_0xdca9('0x63')],'as':_0xdca9('0x64'),'attributes':['id',_0xdca9('0x2e'),'type'],'through':{'attributes':[]}}]})[_0xdca9('0x2a')](function(_0x39b540){if(_0x39b540){var _0xc697d=_0x463ae7[_0xdca9('0x5b')]['get']({'plain':!![]});if(!_0xc697d)throw new Error(_0xdca9('0x65'));if(_0xc697d['role']===_0xdca9('0x5b')){return db[_0xdca9('0x66')][_0xdca9('0x4c')]({'where':{'name':_0xdca9('0x67'),'userProfileId':_0xc697d[_0xdca9('0x68')]},'raw':!![]})[_0xdca9('0x2a')](function(_0x372903){if(_0x372903){if(_0x372903[_0xdca9('0x69')]===0x0){return db[_0xdca9('0x6a')]['findAll']({'where':{'sectionId':_0x372903['id']},'raw':!![]})['then'](function(_0x7160f5){var _0x4ab539=[];if(_[_0xdca9('0x6b')](_0x7160f5)){_0x4ab539=_['filter'](_0x39b540,function(_0x57c461){if(_0x57c461['role']!=='agent'){return _0x57c461;}});return _0x4ab539;}else{for(var _0x53f0c3=0x0;_0x53f0c3<_0x39b540[_0xdca9('0x3d')];_0x53f0c3++){var _0x13e681=_0x39b540[_0x53f0c3];if(_0x13e681[_0xdca9('0x5d')]===_0xdca9('0x6c')){var _0x3d195f=_[_0xdca9('0x4c')](_0x7160f5,function(_0x4f3421){return _0x4f3421[_0xdca9('0x6d')]===_0x13e681['id'];});if(_0x3d195f)_0x4ab539['push'](_0x13e681);}else{_0x4ab539[_0xdca9('0x6e')](_0x13e681);}}return _0x4ab539;}});}else{return _0x39b540;}}else{var _0x4fce88=_[_0xdca9('0x43')](_0x39b540,function(_0x1c7caf){if(_0x1c7caf[_0xdca9('0x5d')]!==_0xdca9('0x6c')){return _0x1c7caf;}});return _0x4fce88;}});}else{return _0x39b540;}}})[_0xdca9('0x2a')](function(_0x32fa0a){var _0x143b5c=[];if(_0x32fa0a){_0x23dfd0=_0x32fa0a;for(var _0x4caec3=0x0;_0x4caec3<_0x32fa0a[_0xdca9('0x3d')];_0x4caec3+=0x1){_0x23dfd0[_0x4caec3][_0xdca9('0x52')]=[];_0x143b5c['push'](db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'FromId':[_0x463ae7[_0xdca9('0x5b')]['id'],_0x32fa0a[_0x4caec3]['id']],'ToId':[_0x463ae7[_0xdca9('0x5b')]['id'],_0x32fa0a[_0x4caec3]['id']],'ChatGroupId':null},'attributes':['id',_0xdca9('0x54'),_0xdca9('0x6f'),_0xdca9('0x70'),'read',_0xdca9('0x4e')],'order':qs[_0xdca9('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdca9('0x2a')](wrapUser(_0x32fa0a[_0x4caec3])));}return BPromise['all'](_0x143b5c);}return[];})[_0xdca9('0x2a')](function(_0x29b6a5){return{'rows':_0x29b6a5,'count':_0x29b6a5[_0xdca9('0x3d')]};})[_0xdca9('0x2a')](respondWithResult(_0x43329a,null))[_0xdca9('0x48')](handleError(_0x43329a,null));}; \ No newline at end of file +var _0xbdab=['type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','update','then','error','stack','name','send','index','map','fieldName','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','params','describe','get','messages','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xbdab,0x79));var _0xbbda=function(_0x4e21ac,_0x9a1cc2){_0x4e21ac=_0x4e21ac-0x0;var _0x52cfe3=_0xbdab[_0x4e21ac];return _0x52cfe3;};'use strict';var emlformat=require(_0xbbda('0x0'));var rimraf=require(_0xbbda('0x1'));var zipdir=require(_0xbbda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbda('0x3'));var moment=require(_0xbbda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbbda('0x5'));var util=require('util');var path=require(_0xbbda('0x6'));var sox=require('sox');var csv=require(_0xbbda('0x7'));var ejs=require(_0xbbda('0x8'));var fs=require('fs');var fs_extra=require(_0xbbda('0x9'));var _=require(_0xbbda('0xa'));var squel=require(_0xbbda('0xb'));var crypto=require(_0xbbda('0xc'));var jsforce=require(_0xbbda('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbbda('0x7'));var querystring=require(_0xbbda('0xe'));var Papa=require(_0xbbda('0xf'));var Redis=require(_0xbbda('0x10'));var authService=require(_0xbbda('0x11'));var qs=require(_0xbbda('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbda('0x13'));var logger=require('../../config/logger')(_0xbbda('0x14'));var utils=require(_0xbbda('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbbda('0x16'));var db=require('../../mysqldb')['db'];config[_0xbbda('0x17')]=_[_0xbbda('0x18')](config[_0xbbda('0x17')],{'host':_0xbbda('0x19'),'port':0x18eb});var socket=require(_0xbbda('0x1a'))(new Redis(config[_0xbbda('0x17')]));require(_0xbbda('0x1b'))[_0xbbda('0x1c')](socket);function respondWithStatusCode(_0x3d02ff,_0x4a944a){_0x4a944a=_0x4a944a||0xcc;return function(_0x4aa8cb){if(_0x4aa8cb){return _0x3d02ff[_0xbbda('0x1d')](_0x4a944a);}return _0x3d02ff[_0xbbda('0x1e')](_0x4a944a)[_0xbbda('0x1f')]();};}function respondWithResult(_0x2add39,_0x4b64e2){_0x4b64e2=_0x4b64e2||0xc8;return function(_0x70ecb0){if(_0x70ecb0){return _0x2add39[_0xbbda('0x1e')](_0x4b64e2)['json'](_0x70ecb0);}};}function respondWithFilteredResult(_0x5a0a8e,_0x1bd0e2){return function(_0x226770){if(_0x226770){var _0x3ce4ab=typeof _0x1bd0e2['offset']===_0xbbda('0x20')&&typeof _0x1bd0e2[_0xbbda('0x21')]===_0xbbda('0x20');var _0x39d7e2=_0x226770[_0xbbda('0x22')];var _0x240e60=_0x3ce4ab?0x0:_0x1bd0e2[_0xbbda('0x23')];var _0x593202=_0x3ce4ab?_0x226770[_0xbbda('0x22')]:_0x1bd0e2[_0xbbda('0x23')]+_0x1bd0e2['limit'];var _0x4f07c4;if(_0x593202>=_0x39d7e2){_0x593202=_0x39d7e2;_0x4f07c4=0xc8;}else{_0x4f07c4=0xce;}_0x5a0a8e[_0xbbda('0x1e')](_0x4f07c4);return _0x5a0a8e[_0xbbda('0x24')]('Content-Range',_0x240e60+'-'+_0x593202+'/'+_0x39d7e2)[_0xbbda('0x25')](_0x226770);}return null;};}function patchUpdates(_0x1a899c){return function(_0xc60791){try{jsonpatch['apply'](_0xc60791,_0x1a899c,!![]);}catch(_0x2d1f03){return BPromise[_0xbbda('0x26')](_0x2d1f03);}return _0xc60791['save']();};}function saveUpdates(_0x13ac11,_0x23f45e){return function(_0x1fa799){if(_0x1fa799){return _0x1fa799[_0xbbda('0x27')](_0x13ac11)['then'](function(_0x2f9ea4){return _0x2f9ea4;});}return null;};}function removeEntity(_0x4cad15,_0x561499){return function(_0x551516){if(_0x551516){return _0x551516['destroy']()[_0xbbda('0x28')](function(){_0x4cad15[_0xbbda('0x1e')](0xcc)[_0xbbda('0x1f')]();});}};}function handleEntityNotFound(_0x1fabfe,_0x1b5e13){return function(_0x12eca9){if(!_0x12eca9){_0x1fabfe[_0xbbda('0x1d')](0x194);}return _0x12eca9;};}function handleError(_0x1d10a0,_0x4136f9){_0x4136f9=_0x4136f9||0x1f4;return function(_0x2d1bb4){logger[_0xbbda('0x29')](_0x2d1bb4[_0xbbda('0x2a')]);if(_0x2d1bb4[_0xbbda('0x2b')]){delete _0x2d1bb4['name'];}_0x1d10a0[_0xbbda('0x1e')](_0x4136f9)[_0xbbda('0x2c')](_0x2d1bb4);};}exports[_0xbbda('0x2d')]=function(_0x3a6405,_0x526b29){var _0x10c1b1={},_0x21e953={},_0x364c88={'count':0x0,'rows':[]};var _0xd8c985=_[_0xbbda('0x2e')](db['ChatInternalMessage']['rawAttributes'],function(_0x41895e){return{'name':_0x41895e[_0xbbda('0x2f')],'type':_0x41895e['type']['key']};});_0x21e953[_0xbbda('0x30')]=_[_0xbbda('0x2e')](_0xd8c985,'name');_0x21e953[_0xbbda('0x31')]=_['keys'](_0x3a6405[_0xbbda('0x31')]);_0x21e953['filters']=_['intersection'](_0x21e953[_0xbbda('0x30')],_0x21e953[_0xbbda('0x31')]);_0x10c1b1[_0xbbda('0x32')]=_[_0xbbda('0x33')](_0x21e953[_0xbbda('0x30')],qs['fields'](_0x3a6405[_0xbbda('0x31')][_0xbbda('0x34')]));_0x10c1b1[_0xbbda('0x32')]=_0x10c1b1[_0xbbda('0x32')]['length']?_0x10c1b1[_0xbbda('0x32')]:_0x21e953[_0xbbda('0x30')];if(!_0x3a6405[_0xbbda('0x31')][_0xbbda('0x35')](_0xbbda('0x36'))){_0x10c1b1['limit']=qs['limit'](_0x3a6405['query'][_0xbbda('0x21')]);_0x10c1b1[_0xbbda('0x23')]=qs['offset'](_0x3a6405[_0xbbda('0x31')][_0xbbda('0x23')]);}_0x10c1b1[_0xbbda('0x37')]=qs['sort'](_0x3a6405['query'][_0xbbda('0x38')]);_0x10c1b1[_0xbbda('0x39')]=qs[_0xbbda('0x3a')](_[_0xbbda('0x3b')](_0x3a6405[_0xbbda('0x31')],_0x21e953['filters']),_0xd8c985);if(_0x3a6405['query'][_0xbbda('0x3c')]){_0x10c1b1['where']=_[_0xbbda('0x3d')](_0x10c1b1[_0xbbda('0x39')],{'$or':_[_0xbbda('0x2e')](_0xd8c985,function(_0x538680){if(_0x538680['type']!==_0xbbda('0x3e')){var _0x126158={};_0x126158[_0x538680['name']]={'$like':'%'+_0x3a6405['query'][_0xbbda('0x3c')]+'%'};return _0x126158;}})});}_0x10c1b1=_[_0xbbda('0x3d')]({},_0x10c1b1,_0x3a6405[_0xbbda('0x3f')]);var _0x290bdb={'where':_0x10c1b1[_0xbbda('0x39')]};return db[_0xbbda('0x40')]['count'](_0x290bdb)[_0xbbda('0x28')](function(_0x50633b){_0x364c88['count']=_0x50633b;if(_0x3a6405['query'][_0xbbda('0x41')]){_0x10c1b1[_0xbbda('0x42')]=[{'all':!![]}];}return db[_0xbbda('0x40')][_0xbbda('0x43')](_0x10c1b1);})[_0xbbda('0x28')](function(_0x418e29){_0x364c88[_0xbbda('0x44')]=_0x418e29;return _0x364c88;})[_0xbbda('0x28')](respondWithFilteredResult(_0x526b29,_0x10c1b1))[_0xbbda('0x45')](handleError(_0x526b29,null));};exports[_0xbbda('0x46')]=function(_0x12077f,_0x51e060){var _0x431b7b={'raw':!![],'where':{'id':_0x12077f['params']['id']}},_0x35bad4={};_0x35bad4[_0xbbda('0x30')]=_['keys'](db[_0xbbda('0x40')][_0xbbda('0x47')]);_0x35bad4['query']=_['keys'](_0x12077f[_0xbbda('0x31')]);_0x35bad4[_0xbbda('0x3a')]=_[_0xbbda('0x33')](_0x35bad4['model'],_0x35bad4[_0xbbda('0x31')]);_0x431b7b[_0xbbda('0x32')]=_['intersection'](_0x35bad4[_0xbbda('0x30')],qs[_0xbbda('0x34')](_0x12077f[_0xbbda('0x31')][_0xbbda('0x34')]));_0x431b7b[_0xbbda('0x32')]=_0x431b7b[_0xbbda('0x32')][_0xbbda('0x48')]?_0x431b7b[_0xbbda('0x32')]:_0x35bad4['model'];if(_0x12077f[_0xbbda('0x31')][_0xbbda('0x41')]){_0x431b7b['include']=[{'all':!![]}];}_0x431b7b=_[_0xbbda('0x3d')]({},_0x431b7b,_0x12077f['options']);return db['ChatInternalMessage']['find'](_0x431b7b)[_0xbbda('0x28')](handleEntityNotFound(_0x51e060,null))['then'](respondWithResult(_0x51e060,null))[_0xbbda('0x45')](handleError(_0x51e060,null));};exports['create']=function(_0x3d5e02,_0x55c467){return db['ChatInternalMessage'][_0xbbda('0x49')](_0x3d5e02['body'],{})['then'](respondWithResult(_0x55c467,0xc9))['catch'](handleError(_0x55c467,null));};exports[_0xbbda('0x27')]=function(_0x155a65,_0x2d3155){if(_0x155a65[_0xbbda('0x4a')]['id']){delete _0x155a65['body']['id'];}return db['ChatInternalMessage'][_0xbbda('0x4b')]({'where':{'id':_0x155a65['params']['id']}})[_0xbbda('0x28')](handleEntityNotFound(_0x2d3155,null))['then'](saveUpdates(_0x155a65[_0xbbda('0x4a')],null))[_0xbbda('0x28')](respondWithResult(_0x2d3155,null))[_0xbbda('0x45')](handleError(_0x2d3155,null));};exports['destroy']=function(_0x8c19be,_0x5a7d32){return db[_0xbbda('0x40')][_0xbbda('0x4b')]({'where':{'id':_0x8c19be[_0xbbda('0x4c')]['id']}})[_0xbbda('0x28')](handleEntityNotFound(_0x5a7d32,null))[_0xbbda('0x28')](removeEntity(_0x5a7d32,null))['catch'](handleError(_0x5a7d32,null));};exports[_0xbbda('0x4d')]=function(_0x596405,_0x3899ef){return db[_0xbbda('0x40')][_0xbbda('0x4d')]()[_0xbbda('0x28')](respondWithResult(_0x3899ef,null))[_0xbbda('0x45')](handleError(_0x3899ef,null));};function wrapUser(_0x458a17){return function(_0x1296a1){var _0x15be53=_0x458a17[_0xbbda('0x4e')]({'plain':!![]});_0x15be53[_0xbbda('0x4f')]=[];if(_0x1296a1){_0x15be53['lastMessageAt']=_0x1296a1['createdAt'];_0x15be53['lastMessage']=_0x1296a1;}else{_0x15be53['lastMessageAt']=moment(0x0)[_0xbbda('0x50')](_0xbbda('0x51'));_0x15be53[_0xbbda('0x52')]={};}return _0x15be53;};}exports['getUsers']=function(_0x367158,_0x321bed,_0x1008ae){var _0x92877a=[];return db[_0xbbda('0x53')][_0xbbda('0x43')]({'where':{'role':[_0xbbda('0x54'),_0xbbda('0x55'),'user']},'attributes':['id',_0xbbda('0x56'),_0xbbda('0x2b'),_0xbbda('0x57'),_0xbbda('0x58'),_0xbbda('0x59'),_0xbbda('0x5a'),'lastLoginAt',_0xbbda('0x5b'),_0xbbda('0x5c')],'order':qs[_0xbbda('0x38')](_0xbbda('0x5d')),'include':[{'model':db[_0xbbda('0x5e')],'as':'VoiceQueues','attributes':['id',_0xbbda('0x2b'),_0xbbda('0x5f')],'through':{'attributes':[]}}]})[_0xbbda('0x28')](function(_0x26488a){if(_0x26488a){var _0x42d430=_0x367158[_0xbbda('0x60')][_0xbbda('0x4e')]({'plain':!![]});if(!_0x42d430)throw new Error(_0xbbda('0x61'));if(_0x42d430['role']===_0xbbda('0x60')){return db['UserProfileSection'][_0xbbda('0x4b')]({'where':{'name':_0xbbda('0x62'),'userProfileId':_0x42d430[_0xbbda('0x63')]},'raw':!![]})['then'](function(_0x364bdc){if(_0x364bdc){if(_0x364bdc[_0xbbda('0x64')]===0x0){return db['UserProfileResource'][_0xbbda('0x43')]({'where':{'sectionId':_0x364bdc['id']},'raw':!![]})[_0xbbda('0x28')](function(_0x11da10){var _0x3b49a0=[];if(_[_0xbbda('0x65')](_0x11da10)){_0x3b49a0=_[_0xbbda('0x3c')](_0x26488a,function(_0x137ed1){if(_0x137ed1[_0xbbda('0x57')]!=='agent'){return _0x137ed1;}});return _0x3b49a0;}else{for(var _0x17ee37=0x0;_0x17ee37<_0x26488a['length'];_0x17ee37++){var _0x4aba20=_0x26488a[_0x17ee37];if(_0x4aba20[_0xbbda('0x57')]===_0xbbda('0x54')){var _0x5b8213=_[_0xbbda('0x4b')](_0x11da10,function(_0x451fb4){return _0x451fb4[_0xbbda('0x66')]===_0x4aba20['id'];});if(_0x5b8213)_0x3b49a0[_0xbbda('0x67')](_0x4aba20);}else{_0x3b49a0[_0xbbda('0x67')](_0x4aba20);}}return _0x3b49a0;}});}else{return _0x26488a;}}else{var _0x2fd64c=_['filter'](_0x26488a,function(_0x1cdc63){if(_0x1cdc63[_0xbbda('0x57')]!==_0xbbda('0x54')){return _0x1cdc63;}});return _0x2fd64c;}});}else{return _0x26488a;}}})[_0xbbda('0x28')](function(_0x59a8f1){var _0xff6d3c=[];if(_0x59a8f1){_0x92877a=_0x59a8f1;for(var _0x1dcff9=0x0;_0x1dcff9<_0x59a8f1[_0xbbda('0x48')];_0x1dcff9+=0x1){_0x92877a[_0x1dcff9][_0xbbda('0x4f')]=[];_0xff6d3c['push'](db[_0xbbda('0x40')][_0xbbda('0x4b')]({'where':{'FromId':[_0x367158[_0xbbda('0x60')]['id'],_0x59a8f1[_0x1dcff9]['id']],'ToId':[_0x367158[_0xbbda('0x60')]['id'],_0x59a8f1[_0x1dcff9]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xbbda('0x68'),_0xbbda('0x69'),_0xbbda('0x6a'),_0xbbda('0x4a')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbbda('0x28')](wrapUser(_0x59a8f1[_0x1dcff9])));}return BPromise[_0xbbda('0x6b')](_0xff6d3c);}return[];})[_0xbbda('0x28')](function(_0x30da31){return{'rows':_0x30da31,'count':_0x30da31[_0xbbda('0x48')]};})[_0xbbda('0x28')](respondWithResult(_0x321bed,null))[_0xbbda('0x45')](handleError(_0x321bed,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 701320b..617d19b 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 _0xe137=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x2b9557,_0x8143ac){var _0x5939c4=function(_0x227087){while(--_0x227087){_0x2b9557['push'](_0x2b9557['shift']());}};_0x5939c4(++_0x8143ac);}(_0xe137,0xb3));var _0x7e13=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0xe137[_0x5192de];return _0x4e287e;};'use strict';var EventEmitter=require(_0x7e13('0x0'));var ChatInternalMessage=require(_0x7e13('0x1'))['db'][_0x7e13('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7e13('0x3')](0x0);var events={'afterCreate':_0x7e13('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xbadfac){return function(_0x4bbfd9,_0x3e4871,_0x515228){ChatInternalMessageEvents['emit'](_0xbadfac+':'+_0x4bbfd9['id'],_0x4bbfd9);ChatInternalMessageEvents['emit'](_0xbadfac,_0x4bbfd9);_0x515228(null);};}for(var e in events){if(events[_0x7e13('0x5')](e)){var event=events[e];ChatInternalMessage[_0x7e13('0x6')](e,emitEvent(event));}}module[_0x7e13('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3d27=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x170cea,_0xb78475){var _0x6436d0=function(_0x56ce69){while(--_0x56ce69){_0x170cea['push'](_0x170cea['shift']());}};_0x6436d0(++_0xb78475);}(_0x3d27,0x7c));var _0x73d2=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x3d27[_0x3cbe1c];return _0x5ee08b;};'use strict';var EventEmitter=require(_0x73d2('0x0'));var ChatInternalMessage=require(_0x73d2('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x73d2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73d2('0x3'),'afterDestroy':_0x73d2('0x4')};function emitEvent(_0x1a3dce){return function(_0x27f43d,_0x2549cc,_0x591082){ChatInternalMessageEvents[_0x73d2('0x5')](_0x1a3dce+':'+_0x27f43d['id'],_0x27f43d);ChatInternalMessageEvents['emit'](_0x1a3dce,_0x27f43d);_0x591082(null);};}for(var e in events){if(events[_0x73d2('0x6')](e)){var event=events[e];ChatInternalMessage[_0x73d2('0x7')](e,emitEvent(event));}}module[_0x73d2('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 013aec4..6fabb4e 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 _0x6f96=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x6f96,0x172));var _0x66f9=function(_0x4c16ec,_0x3a43bd){_0x4c16ec=_0x4c16ec-0x0;var _0x219a9a=_0x6f96[_0x4c16ec];return _0x219a9a;};'use strict';var _=require(_0x66f9('0x0'));var util=require(_0x66f9('0x1'));var logger=require(_0x66f9('0x2'))(_0x66f9('0x3'));var moment=require(_0x66f9('0x4'));var BPromise=require(_0x66f9('0x5'));var rp=require(_0x66f9('0x6'));var fs=require('fs');var path=require(_0x66f9('0x7'));var rimraf=require('rimraf');var config=require(_0x66f9('0x8'));var attributes=require(_0x66f9('0x9'));module['exports']=function(_0x2f4c99,_0x26d599){return _0x2f4c99[_0x66f9('0xa')](_0x66f9('0xb'),attributes,{'tableName':_0x66f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66f9('0xd'),'collate':_0x66f9('0xe')});}; \ No newline at end of file +var _0xf04d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5627eb,_0x3dd952){var _0x458797=function(_0x9fbdf4){while(--_0x9fbdf4){_0x5627eb['push'](_0x5627eb['shift']());}};_0x458797(++_0x3dd952);}(_0xf04d,0x16a));var _0xdf04=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0xf04d[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0xdf04('0x0'));var util=require(_0xdf04('0x1'));var logger=require(_0xdf04('0x2'))(_0xdf04('0x3'));var moment=require(_0xdf04('0x4'));var BPromise=require(_0xdf04('0x5'));var rp=require(_0xdf04('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf04('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xdf04('0x8')]=function(_0x594ada,_0x3ae8d8){return _0x594ada[_0xdf04('0x9')](_0xdf04('0xa'),attributes,{'tableName':_0xdf04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf04('0xc'),'collate':_0xdf04('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9cb9f53..27d4cf6 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 _0x530a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','result','util'];(function(_0x19f670,_0x36d23f){var _0x3ffd49=function(_0x5d9e05){while(--_0x5d9e05){_0x19f670['push'](_0x19f670['shift']());}};_0x3ffd49(++_0x36d23f);}(_0x530a,0x81));var _0xa530=function(_0x2758c0,_0x54e50d){_0x2758c0=_0x2758c0-0x0;var _0x258d9e=_0x530a[_0x2758c0];return _0x258d9e;};'use strict';var _=require('lodash');var util=require(_0xa530('0x0'));var moment=require(_0xa530('0x1'));var BPromise=require(_0xa530('0x2'));var rs=require(_0xa530('0x3'));var fs=require('fs');var Redis=require(_0xa530('0x4'));var db=require(_0xa530('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa530('0x6'))(_0xa530('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa530('0x8')][_0xa530('0x9')]({'port':0x232a});config['redis']=_[_0xa530('0xa')](config[_0xa530('0xb')],{'host':_0xa530('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa530('0xb')]));require(_0xa530('0xd'))[_0xa530('0xe')](socket);function respondWithRpcPromise(_0x18887a,_0x55606e,_0x6a7687){return new BPromise(function(_0x5e6107,_0x247c1d){return client[_0xa530('0xf')](_0x18887a,_0x6a7687)[_0xa530('0x10')](function(_0x153a1c){logger['info'](_0xa530('0x11'),_0x55606e,'request\x20sent');logger[_0xa530('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x55606e,_0xa530('0x13'),JSON[_0xa530('0x14')](_0x153a1c));if(_0x153a1c['error']){if(_0x153a1c['error'][_0xa530('0x15')]===0x1f4){logger[_0xa530('0x16')](_0xa530('0x11'),_0x55606e,_0x153a1c[_0xa530('0x16')][_0xa530('0x17')]);return _0x247c1d(_0x153a1c['error']['message']);}logger['error'](_0xa530('0x11'),_0x55606e,_0x153a1c['error'][_0xa530('0x17')]);return _0x5e6107(_0x153a1c[_0xa530('0x16')][_0xa530('0x17')]);}else{logger[_0xa530('0x18')](_0xa530('0x11'),_0x55606e,_0xa530('0x13'));_0x5e6107(_0x153a1c[_0xa530('0x19')][_0xa530('0x17')]);}})['catch'](function(_0xfbcba0){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x55606e,_0xfbcba0);_0x247c1d(_0xfbcba0);});});} \ No newline at end of file +var _0x0ba7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x38370a,_0x226474){var _0x24fd54=function(_0x5e43b0){while(--_0x5e43b0){_0x38370a['push'](_0x38370a['shift']());}};_0x24fd54(++_0x226474);}(_0x0ba7,0x16d));var _0x70ba=function(_0x538af2,_0x333205){_0x538af2=_0x538af2-0x0;var _0x308960=_0x0ba7[_0x538af2];return _0x308960;};'use strict';var _=require(_0x70ba('0x0'));var util=require('util');var moment=require(_0x70ba('0x1'));var BPromise=require(_0x70ba('0x2'));var rs=require(_0x70ba('0x3'));var fs=require('fs');var Redis=require(_0x70ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ba('0x5'));var logger=require(_0x70ba('0x6'))(_0x70ba('0x7'));var config=require(_0x70ba('0x8'));var jayson=require(_0x70ba('0x9'));var client=jayson[_0x70ba('0xa')][_0x70ba('0xb')]({'port':0x232a});config[_0x70ba('0xc')]=_[_0x70ba('0xd')](config[_0x70ba('0xc')],{'host':_0x70ba('0xe'),'port':0x18eb});var socket=require(_0x70ba('0xf'))(new Redis(config[_0x70ba('0xc')]));require(_0x70ba('0x10'))[_0x70ba('0x11')](socket);function respondWithRpcPromise(_0x5dd8cb,_0x38f104,_0x4de64d){return new BPromise(function(_0x3fe801,_0x258604){return client[_0x70ba('0x12')](_0x5dd8cb,_0x4de64d)[_0x70ba('0x13')](function(_0x593fe9){logger['info'](_0x70ba('0x14'),_0x38f104,'request\x20sent');logger[_0x70ba('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x38f104,_0x70ba('0x16'),JSON[_0x70ba('0x17')](_0x593fe9));if(_0x593fe9['error']){if(_0x593fe9[_0x70ba('0x18')]['code']===0x1f4){logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);return _0x258604(_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);}logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);return _0x3fe801(_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);}else{logger[_0x70ba('0x1a')](_0x70ba('0x14'),_0x38f104,'request\x20sent');_0x3fe801(_0x593fe9['result']['message']);}})[_0x70ba('0x1b')](function(_0x2dd33a){logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x2dd33a);_0x258604(_0x2dd33a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index dc68feb..bcc5936 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 _0xb187=['length','./chatInternalMessage.events','remove','update','removeListener'];(function(_0x212cc8,_0x593d9d){var _0x4cc4d9=function(_0x5626b5){while(--_0x5626b5){_0x212cc8['push'](_0x212cc8['shift']());}};_0x4cc4d9(++_0x593d9d);}(_0xb187,0x128));var _0x7b18=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0xb187[_0x50b66d];return _0x41aa8e;};'use strict';var ChatInternalMessageEvents=require(_0x7b18('0x0'));var events=['save',_0x7b18('0x1'),_0x7b18('0x2')];function createListener(_0xdae1e,_0x34c247){return function(_0x5c1dbd){_0x34c247['emit'](_0xdae1e,_0x5c1dbd);};}function removeListener(_0x5d8b68,_0x52c756){return function(){ChatInternalMessageEvents[_0x7b18('0x3')](_0x5d8b68,_0x52c756);};}exports['register']=function(_0x4ed057){for(var _0x1455ee=0x0,_0x2ade1b=events[_0x7b18('0x4')];_0x1455ee<_0x2ade1b;_0x1455ee++){var _0xebf1af=events[_0x1455ee];var _0x5a7d1b=createListener('chatInternalMessage:'+_0xebf1af,_0x4ed057);ChatInternalMessageEvents['on'](_0xebf1af,_0x5a7d1b);}}; \ No newline at end of file +var _0xdceb=['length','chatInternalMessage:','remove','update','emit','register'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0xdceb,0xb6));var _0xbdce=function(_0x158785,_0x1cd5a8){_0x158785=_0x158785-0x0;var _0x202bb3=_0xdceb[_0x158785];return _0x202bb3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xbdce('0x0'),_0xbdce('0x1')];function createListener(_0x5f4b0c,_0x1520db){return function(_0xe1ec07){_0x1520db[_0xbdce('0x2')](_0x5f4b0c,_0xe1ec07);};}function removeListener(_0x1485cc,_0x198c01){return function(){ChatInternalMessageEvents['removeListener'](_0x1485cc,_0x198c01);};}exports[_0xbdce('0x3')]=function(_0x24f477){for(var _0x9525cd=0x0,_0xec8394=events[_0xbdce('0x4')];_0x9525cd<_0xec8394;_0x9525cd++){var _0x165029=events[_0x9525cd];var _0x1c1067=createListener(_0xbdce('0x5')+_0x165029,_0x24f477);ChatInternalMessageEvents['on'](_0x165029,_0x1c1067);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b074f15..b0c717c 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 _0x5591=['post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','/:id'];(function(_0x30e403,_0x200281){var _0x38ec4b=function(_0x4f62ab){while(--_0x4f62ab){_0x30e403['push'](_0x30e403['shift']());}};_0x38ec4b(++_0x200281);}(_0x5591,0x196));var _0x1559=function(_0xaaf6a3,_0x46bf1c){_0xaaf6a3=_0xaaf6a3-0x0;var _0x255dbe=_0x5591[_0xaaf6a3];return _0x255dbe;};'use strict';var multer=require(_0x1559('0x0'));var util=require(_0x1559('0x1'));var path=require(_0x1559('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1559('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1559('0x4'));var config=require(_0x1559('0x5'));var controller=require(_0x1559('0x6'));router[_0x1559('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1559('0x7')](_0x1559('0x8'),auth[_0x1559('0x9')](),controller['describe']);router['get'](_0x1559('0xa'),auth[_0x1559('0x9')](),controller['getUsers']);router['get'](_0x1559('0xb'),auth[_0x1559('0x9')](),controller['show']);router[_0x1559('0xc')]('/',auth[_0x1559('0x9')](),controller[_0x1559('0xd')]);router[_0x1559('0xe')]('/:id',controller[_0x1559('0xf')]);router[_0x1559('0x10')](_0x1559('0xb'),auth[_0x1559('0x9')](),controller[_0x1559('0x11')]);module[_0x1559('0x12')]=router; \ No newline at end of file +var _0x7da1=['update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','describe','/users','getUsers','/:id','show','post','create','put'];(function(_0x55864a,_0xf552bf){var _0x22a9b0=function(_0x17890a){while(--_0x17890a){_0x55864a['push'](_0x55864a['shift']());}};_0x22a9b0(++_0xf552bf);}(_0x7da1,0x1bb));var _0x17da=function(_0x2b1c60,_0x505cd2){_0x2b1c60=_0x2b1c60-0x0;var _0x3caefa=_0x7da1[_0x2b1c60];return _0x3caefa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x17da('0x0'));var timeout=require(_0x17da('0x1'));var express=require(_0x17da('0x2'));var router=express[_0x17da('0x3')]();var fs_extra=require(_0x17da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17da('0x5'));var config=require(_0x17da('0x6'));var controller=require(_0x17da('0x7'));router['get']('/',auth[_0x17da('0x8')](),controller[_0x17da('0x9')]);router[_0x17da('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x17da('0xb')]);router[_0x17da('0xa')](_0x17da('0xc'),auth[_0x17da('0x8')](),controller[_0x17da('0xd')]);router['get'](_0x17da('0xe'),auth[_0x17da('0x8')](),controller[_0x17da('0xf')]);router[_0x17da('0x10')]('/',auth[_0x17da('0x8')](),controller[_0x17da('0x11')]);router[_0x17da('0x12')](_0x17da('0xe'),controller[_0x17da('0x13')]);router[_0x17da('0x14')](_0x17da('0xe'),auth['isAuthenticated'](),controller[_0x17da('0x15')]);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 846b422..d5bff34 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 _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0xa46e5a,_0x5786d6){var _0x57c35c=function(_0x3fbf2d){while(--_0x3fbf2d){_0xa46e5a['push'](_0xa46e5a['shift']());}};_0x57c35c(++_0x5786d6);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x5ae2c9,_0x197fe8){_0x5ae2c9=_0x5ae2c9-0x0;var _0x55e4f3=_0x9d5b[_0x5ae2c9];return _0x55e4f3;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file +var _0xe2cf=['ENUM','out','STRING','TEXT','exports','medium','BOOLEAN'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4deff,_0x42c328){_0x4deff=_0x4deff-0x0;var _0x440123=_0xe2cf[_0x4deff];return _0x440123;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'body':{'type':Sequelize['TEXT'](_0xfe2c('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfe2c('0x3')]('in',_0xfe2c('0x4')),'defaultValue':_0xfe2c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xfe2c('0x5')]},'providerResponse':{'type':Sequelize[_0xfe2c('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 328ba1a..c7fb946 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 _0x14e4=['chat','read','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','interaction','formData','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','internal','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','reject','update','name','index','map','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatMessage','findAll','rows','params','keys','rawAttributes','includeAll','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x14e4,0xa2));var _0x414e=function(_0x55095d,_0x33366d){_0x55095d=_0x55095d-0x0;var _0x50adb2=_0x14e4[_0x55095d];return _0x50adb2;};'use strict';var emlformat=require(_0x414e('0x0'));var rimraf=require(_0x414e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x414e('0x2'));var rp=require(_0x414e('0x3'));var moment=require(_0x414e('0x4'));var BPromise=require(_0x414e('0x5'));var Mustache=require(_0x414e('0x6'));var util=require(_0x414e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x414e('0x8'));var ejs=require(_0x414e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x414e('0xa'));var squel=require('squel');var crypto=require(_0x414e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x414e('0x8'));var querystring=require(_0x414e('0xc'));var Papa=require(_0x414e('0xd'));var Redis=require(_0x414e('0xe'));var authService=require(_0x414e('0xf'));var qs=require(_0x414e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x414e('0x11'));var logger=require('../../config/logger')(_0x414e('0x12'));var utils=require(_0x414e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x414e('0x14'));var db=require(_0x414e('0x15'))['db'];config[_0x414e('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x414e('0x17'))(new Redis(config[_0x414e('0x16')]));require(_0x414e('0x18'))[_0x414e('0x19')](socket);var jayson=require(_0x414e('0x1a'));var client=jayson[_0x414e('0x1b')][_0x414e('0x1c')]({'port':0x232c});var client9002=jayson[_0x414e('0x1b')][_0x414e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x35130a,_0x281ed5,_0x59a1d9,_0x38d2cb){return new BPromise(function(_0x3ff732,_0x204525){var _0x3d4b01=_0x38d2cb||client;return _0x3d4b01[_0x414e('0x1d')](_0x35130a,_0x59a1d9)[_0x414e('0x1e')](function(_0x523012){logger[_0x414e('0x1f')](_0x414e('0x20'),_0x281ed5,_0x414e('0x21'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x281ed5,_0x414e('0x21'),JSON[_0x414e('0x22')](_0x523012));if(_0x523012[_0x414e('0x23')]){if(_0x523012[_0x414e('0x23')][_0x414e('0x24')]===0x1f4){logger[_0x414e('0x23')]('ChatMessage,\x20%s,\x20%s',_0x281ed5,_0x523012['error']['message']);return _0x204525(_0x523012[_0x414e('0x23')][_0x414e('0x25')]);}logger[_0x414e('0x23')](_0x414e('0x20'),_0x281ed5,_0x523012[_0x414e('0x23')][_0x414e('0x25')]);return _0x3ff732(_0x523012[_0x414e('0x23')][_0x414e('0x25')]);}else{logger[_0x414e('0x1f')](_0x414e('0x20'),_0x281ed5,_0x414e('0x21'));_0x3ff732(_0x523012[_0x414e('0x26')][_0x414e('0x25')]);}})[_0x414e('0x27')](function(_0x567faa){logger[_0x414e('0x23')](_0x414e('0x20'),_0x281ed5,_0x567faa);_0x204525(_0x567faa);});});}function respondWithStatusCode(_0x137966,_0x1616ac){_0x1616ac=_0x1616ac||0xcc;return function(_0x465655){if(_0x465655){return _0x137966[_0x414e('0x28')](_0x1616ac);}return _0x137966['status'](_0x1616ac)[_0x414e('0x29')]();};}function respondWithResult(_0x2cd5e3,_0x2db290){_0x2db290=_0x2db290||0xc8;return function(_0x10f8d6){if(_0x10f8d6){return _0x2cd5e3[_0x414e('0x2a')](_0x2db290)['json'](_0x10f8d6);}};}function respondWithFilteredResult(_0x3724cd,_0x290922){return function(_0x4f9f8a){if(_0x4f9f8a){var _0xa01f4=typeof _0x290922[_0x414e('0x2b')]===_0x414e('0x2c')&&typeof _0x290922['limit']===_0x414e('0x2c');var _0x594f12=_0x4f9f8a[_0x414e('0x2d')];var _0x3662ea=_0xa01f4?0x0:_0x290922[_0x414e('0x2b')];var _0x6314c0=_0xa01f4?_0x4f9f8a[_0x414e('0x2d')]:_0x290922[_0x414e('0x2b')]+_0x290922[_0x414e('0x2e')];var _0xc88a30;if(_0x6314c0>=_0x594f12){_0x6314c0=_0x594f12;_0xc88a30=0xc8;}else{_0xc88a30=0xce;}_0x3724cd[_0x414e('0x2a')](_0xc88a30);return _0x3724cd[_0x414e('0x2f')](_0x414e('0x30'),_0x3662ea+'-'+_0x6314c0+'/'+_0x594f12)['json'](_0x4f9f8a);}return null;};}function patchUpdates(_0x465e2b){return function(_0x43f9c9){try{jsonpatch['apply'](_0x43f9c9,_0x465e2b,!![]);}catch(_0x2cbb85){return BPromise[_0x414e('0x31')](_0x2cbb85);}return _0x43f9c9['save']();};}function saveUpdates(_0x2febdb,_0x3e0b3d){return function(_0x3436b9){if(_0x3436b9){return _0x3436b9[_0x414e('0x32')](_0x2febdb)[_0x414e('0x1e')](function(_0x367b00){return _0x367b00;});}return null;};}function removeEntity(_0x41de63,_0x2eb647){return function(_0x4229f3){if(_0x4229f3){return _0x4229f3['destroy']()[_0x414e('0x1e')](function(){_0x41de63[_0x414e('0x2a')](0xcc)[_0x414e('0x29')]();});}};}function handleEntityNotFound(_0x31bf1a,_0x12beba){return function(_0x110c77){if(!_0x110c77){_0x31bf1a[_0x414e('0x28')](0x194);}return _0x110c77;};}function handleError(_0x2d68eb,_0x1202f7){_0x1202f7=_0x1202f7||0x1f4;return function(_0x10bf04){logger[_0x414e('0x23')](_0x10bf04['stack']);if(_0x10bf04[_0x414e('0x33')]){delete _0x10bf04[_0x414e('0x33')];}_0x2d68eb['status'](_0x1202f7)['send'](_0x10bf04);};}exports[_0x414e('0x34')]=function(_0x950f9f,_0x328349){var _0x455b87={},_0x341606={},_0xb8a07b={'count':0x0,'rows':[]};var _0x70f3b4=_[_0x414e('0x35')](db['ChatMessage']['rawAttributes'],function(_0x229a58){return{'name':_0x229a58['fieldName'],'type':_0x229a58[_0x414e('0x36')][_0x414e('0x37')]};});_0x341606[_0x414e('0x38')]=_['map'](_0x70f3b4,_0x414e('0x33'));_0x341606['query']=_['keys'](_0x950f9f['query']);_0x341606[_0x414e('0x39')]=_[_0x414e('0x3a')](_0x341606[_0x414e('0x38')],_0x341606[_0x414e('0x3b')]);_0x455b87[_0x414e('0x3c')]=_[_0x414e('0x3a')](_0x341606['model'],qs[_0x414e('0x3d')](_0x950f9f['query'][_0x414e('0x3d')]));_0x455b87[_0x414e('0x3c')]=_0x455b87[_0x414e('0x3c')][_0x414e('0x3e')]?_0x455b87['attributes']:_0x341606[_0x414e('0x38')];if(!_0x950f9f[_0x414e('0x3b')][_0x414e('0x3f')](_0x414e('0x40'))){_0x455b87[_0x414e('0x2e')]=qs[_0x414e('0x2e')](_0x950f9f[_0x414e('0x3b')][_0x414e('0x2e')]);_0x455b87[_0x414e('0x2b')]=qs[_0x414e('0x2b')](_0x950f9f[_0x414e('0x3b')][_0x414e('0x2b')]);}_0x455b87['order']=qs[_0x414e('0x41')](_0x950f9f[_0x414e('0x3b')]['sort']);_0x455b87[_0x414e('0x42')]=qs[_0x414e('0x39')](_[_0x414e('0x43')](_0x950f9f[_0x414e('0x3b')],_0x341606[_0x414e('0x39')]),_0x70f3b4);if(_0x950f9f[_0x414e('0x3b')][_0x414e('0x44')]){_0x455b87['where']=_[_0x414e('0x45')](_0x455b87[_0x414e('0x42')],{'$or':_[_0x414e('0x35')](_0x70f3b4,function(_0x2e238b){if(_0x2e238b[_0x414e('0x36')]!==_0x414e('0x46')){var _0x26eb9b={};_0x26eb9b[_0x2e238b['name']]={'$like':'%'+_0x950f9f[_0x414e('0x3b')][_0x414e('0x44')]+'%'};return _0x26eb9b;}})});}_0x455b87=_[_0x414e('0x45')]({},_0x455b87,_0x950f9f[_0x414e('0x47')]);var _0x3a0e55={'where':_0x455b87['where']};return db['ChatMessage'][_0x414e('0x2d')](_0x3a0e55)[_0x414e('0x1e')](function(_0x225dc5){_0xb8a07b[_0x414e('0x2d')]=_0x225dc5;if(_0x950f9f[_0x414e('0x3b')]['includeAll']){_0x455b87[_0x414e('0x48')]=[{'all':!![]}];}return db[_0x414e('0x49')][_0x414e('0x4a')](_0x455b87);})[_0x414e('0x1e')](function(_0x62057f){_0xb8a07b[_0x414e('0x4b')]=_0x62057f;return _0xb8a07b;})[_0x414e('0x1e')](respondWithFilteredResult(_0x328349,_0x455b87))[_0x414e('0x27')](handleError(_0x328349,null));};exports['show']=function(_0x36bdf6,_0x285b9a){var _0x55bbdc={'raw':!![],'where':{'id':_0x36bdf6[_0x414e('0x4c')]['id']}},_0x255f02={};_0x255f02[_0x414e('0x38')]=_[_0x414e('0x4d')](db[_0x414e('0x49')][_0x414e('0x4e')]);_0x255f02['query']=_['keys'](_0x36bdf6['query']);_0x255f02[_0x414e('0x39')]=_[_0x414e('0x3a')](_0x255f02[_0x414e('0x38')],_0x255f02[_0x414e('0x3b')]);_0x55bbdc[_0x414e('0x3c')]=_[_0x414e('0x3a')](_0x255f02[_0x414e('0x38')],qs[_0x414e('0x3d')](_0x36bdf6[_0x414e('0x3b')]['fields']));_0x55bbdc[_0x414e('0x3c')]=_0x55bbdc['attributes'][_0x414e('0x3e')]?_0x55bbdc[_0x414e('0x3c')]:_0x255f02['model'];if(_0x36bdf6[_0x414e('0x3b')][_0x414e('0x4f')]){_0x55bbdc[_0x414e('0x48')]=[{'all':!![]}];}_0x55bbdc=_[_0x414e('0x45')]({},_0x55bbdc,_0x36bdf6[_0x414e('0x47')]);return db[_0x414e('0x49')][_0x414e('0x50')](_0x55bbdc)[_0x414e('0x1e')](handleEntityNotFound(_0x285b9a,null))['then'](respondWithResult(_0x285b9a,null))['catch'](handleError(_0x285b9a,null));};exports[_0x414e('0x51')]=function(_0x24a468,_0x5db87a){return db[_0x414e('0x49')]['create'](_0x24a468[_0x414e('0x52')],{})[_0x414e('0x1e')](respondWithResult(_0x5db87a,0xc9))[_0x414e('0x27')](handleError(_0x5db87a,null));};exports[_0x414e('0x32')]=function(_0x2dd996,_0x4717e6){if(_0x2dd996['body']['id']){delete _0x2dd996[_0x414e('0x52')]['id'];}return db[_0x414e('0x49')][_0x414e('0x50')]({'where':{'id':_0x2dd996['params']['id']}})['then'](handleEntityNotFound(_0x4717e6,null))[_0x414e('0x1e')](saveUpdates(_0x2dd996[_0x414e('0x52')],null))[_0x414e('0x1e')](respondWithResult(_0x4717e6,null))[_0x414e('0x27')](handleError(_0x4717e6,null));};exports[_0x414e('0x53')]=function(_0x107e8e,_0xcac6cc){return db[_0x414e('0x49')]['find']({'where':{'id':_0x107e8e[_0x414e('0x4c')]['id']}})['then'](handleEntityNotFound(_0xcac6cc,null))[_0x414e('0x1e')](removeEntity(_0xcac6cc,null))['catch'](handleError(_0xcac6cc,null));};exports[_0x414e('0x54')]=function(_0x1ed6a7,_0x270df4){return db[_0x414e('0x49')][_0x414e('0x54')]()[_0x414e('0x1e')](respondWithResult(_0x270df4,null))['catch'](handleError(_0x270df4,null));};var interaction_log=require(_0x414e('0x55'))(_0x414e('0x56'));exports[_0x414e('0x57')]=function(_0x283211,_0x56c853,_0x503898){var _0x4728e1={'agent':{},'channel':_0x414e('0x58')};if(_0x283211[_0x414e('0x52')]['id']){delete _0x283211[_0x414e('0x52')]['id'];}_0x283211['body'][_0x414e('0x59')]=!![];_0x283211[_0x414e('0x52')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x283211[_0x414e('0x52')]['UserId']=_0x283211[_0x414e('0x52')][_0x414e('0x5a')]||_0x283211[_0x414e('0x5b')]['id'];_0x4728e1[_0x414e('0x5c')]['id']=_0x283211[_0x414e('0x52')][_0x414e('0x5a')];return db[_0x414e('0x49')][_0x414e('0x50')]({'where':{'id':_0x283211[_0x414e('0x4c')]['id'],'UserId':null}})[_0x414e('0x1e')](handleEntityNotFound(_0x56c853,null))[_0x414e('0x1e')](saveUpdates(_0x283211[_0x414e('0x52')],null))[_0x414e('0x1e')](function(_0x19430a){if(_0x19430a){_0x4728e1[_0x414e('0x25')]=_0x19430a[_0x414e('0x5d')]({'plain':!![]});return db[_0x414e('0x5e')][_0x414e('0x50')]({'where':{'id':_0x19430a[_0x414e('0x5f')]}});}return null;})[_0x414e('0x1e')](handleEntityNotFound(_0x56c853,null))[_0x414e('0x1e')](function(_0x194abd){if(_0x194abd){return _0x194abd[_0x414e('0x32')]({'UserId':_0x283211[_0x414e('0x52')][_0x414e('0x5a')],'read1stAt':_['isNil'](_0x194abd[_0x414e('0x60')])?moment()[_0x414e('0x61')](_0x414e('0x62')):undefined});}return null;})[_0x414e('0x1e')](function(_0x592a8d){if(_0x592a8d){_0x4728e1['interaction']=_0x592a8d[_0x414e('0x5d')]({'plain':!![]});interaction_log[_0x414e('0x1f')](_0x414e('0x63'),_0x283211[_0x414e('0x5b')]['id'],_0x283211[_0x414e('0x5b')]['name'],_0x283211['user'][_0x414e('0x64')],_0x4728e1['interaction']['id'],_0x283211[_0x414e('0x52')]?JSON[_0x414e('0x22')](_0x283211[_0x414e('0x52')]):_0x414e('0x65'));return respondWithRpcPromise(_0x414e('0x66'),_0x414e('0x67'),_0x4728e1);}return null;})[_0x414e('0x1e')](function(_0x20c5ea){var _0x5d1a71='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20c5ea['message'][_0x414e('0x68')];return db['sequelize'][_0x414e('0x3b')](_0x5d1a71,{'type':db[_0x414e('0x69')][_0x414e('0x6a')][_0x414e('0x6b')],'raw':!![]})['then'](function(_0x115028){return _0x115028;});})['then'](function(_0x2f3c86){if(_0x2f3c86){_0x4728e1['message']['contact']=_0x2f3c86[0x0];if(!_0x283211[_0x414e('0x52')]['UserId'])return;return db[_0x414e('0x6c')]['find']({'where':{'id':_0x283211[_0x414e('0x52')][_0x414e('0x5a')],'role':_0x414e('0x5c')},'attributes':['id','name',_0x414e('0x6d'),_0x414e('0x6e'),'internal'],'raw':!![]});}return null;})[_0x414e('0x1e')](function(_0xbcc910){if(!_0xbcc910)return null;_0x4728e1[_0x414e('0x25')][_0x414e('0x5c')]=_0xbcc910;return _0x4728e1;})[_0x414e('0x1e')](function(_0x1bddc4){if(_0x1bddc4){if(_0x283211[_0x414e('0x52')]['manual']){_0x4728e1['message'][_0x414e('0x6f')]=util[_0x414e('0x61')]('SIP/%s',_0x283211[_0x414e('0x5b')][_0x414e('0x33')]);_0x4728e1[_0x414e('0x25')]['channel']=_0x4728e1[_0x414e('0x70')];_0x4728e1[_0x414e('0x25')][_0x414e('0x71')]=_0x4728e1[_0x414e('0x70')];_0x4728e1[_0x414e('0x25')][_0x414e('0x72')]='accept';return respondWithRpcPromise(_0x414e('0x73'),'EventManager',{'event':_0x414e('0x74'),'message':_[_0x414e('0x45')](_0x4728e1['message'],JSON[_0x414e('0x75')](_0x4728e1[_0x414e('0x76')][_0x414e('0x77')]))},client9002)[_0x414e('0x1e')](function(){return _0x4728e1;});}return _0x4728e1;}return null;})[_0x414e('0x1e')](respondWithResult(_0x56c853,null))['catch'](handleError(_0x56c853,null));};var interaction_log=require(_0x414e('0x55'))('chat-interactions');exports[_0x414e('0x31')]=function(_0x3a5a59,_0x5d9f51,_0x493c61){var _0x3f8968={'agent':{},'channel':'chat'};if(_0x3a5a59['body']['id']){delete _0x3a5a59['body']['id'];}_0x3a5a59['body'][_0x414e('0x5a')]=_0x3a5a59['body'][_0x414e('0x5a')]||_0x3a5a59[_0x414e('0x5b')]['id'];_0x3f8968[_0x414e('0x5c')]['id']=_0x3a5a59[_0x414e('0x52')][_0x414e('0x5a')];return db['ChatMessage']['find']({'where':{'id':_0x3a5a59[_0x414e('0x4c')]['id'],'UserId':null}})[_0x414e('0x1e')](handleEntityNotFound(_0x5d9f51,null))[_0x414e('0x1e')](function(_0x1a9dbe){if(_0x1a9dbe){_0x3f8968['message']=_0x1a9dbe[_0x414e('0x5d')]({'plain':!![]});return db[_0x414e('0x5e')]['find']({'where':{'id':_0x1a9dbe[_0x414e('0x5f')]}});}return null;})[_0x414e('0x1e')](handleEntityNotFound(_0x5d9f51,null))[_0x414e('0x1e')](function(_0x20f8c8){if(_0x20f8c8){_0x3f8968['interaction']=_0x20f8c8[_0x414e('0x5d')]({'plain':!![]});interaction_log[_0x414e('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a5a59[_0x414e('0x5b')]['id'],_0x3a5a59[_0x414e('0x5b')]['name'],_0x3a5a59[_0x414e('0x5b')][_0x414e('0x64')],_0x3f8968[_0x414e('0x76')]['id'],_0x3a5a59['body']?JSON['stringify'](_0x3a5a59[_0x414e('0x52')]):_0x414e('0x65'));return respondWithRpcPromise('RejectMessage',_0x414e('0x78'),_0x3f8968);}return null;})['then'](function(_0x23b756){var _0x12882d=_0x414e('0x79')+_0x23b756[_0x414e('0x25')][_0x414e('0x68')];return db[_0x414e('0x7a')][_0x414e('0x3b')](_0x12882d,{'type':db['Sequelize'][_0x414e('0x6a')][_0x414e('0x6b')],'raw':!![]})[_0x414e('0x1e')](function(_0x1db1ed){return _0x1db1ed;});})['then'](function(_0x34db37){if(_0x34db37){_0x3f8968[_0x414e('0x25')][_0x414e('0x7b')]=_0x34db37[0x0];if(!_0x3a5a59[_0x414e('0x52')][_0x414e('0x5a')])return;return db[_0x414e('0x6c')][_0x414e('0x50')]({'where':{'id':_0x3a5a59['body'][_0x414e('0x5a')],'role':_0x414e('0x5c')},'attributes':['id',_0x414e('0x33'),_0x414e('0x6d'),_0x414e('0x6e'),_0x414e('0x7c')],'raw':!![]});}return null;})[_0x414e('0x1e')](function(_0x251862){if(!_0x251862)return null;_0x3f8968[_0x414e('0x25')][_0x414e('0x5c')]=_0x251862;return _0x3f8968;})[_0x414e('0x1e')](function(_0x2fe2f4){if(_0x2fe2f4){_0x2fe2f4[_0x414e('0x25')][_0x414e('0x6f')]=util[_0x414e('0x61')]('SIP/%s',_0x3a5a59[_0x414e('0x5b')]['name']);_0x2fe2f4[_0x414e('0x25')][_0x414e('0x70')]=_0x3f8968[_0x414e('0x70')];_0x2fe2f4['message']['motionChannel']=_0x3f8968['channel'];_0x2fe2f4[_0x414e('0x25')][_0x414e('0x72')]=_0x414e('0x31');respondWithRpcPromise(_0x414e('0x73'),_0x414e('0x73'),{'event':'rejectmessage','message':_[_0x414e('0x45')](_0x3f8968['message'],JSON['parse'](_0x3f8968['interaction'][_0x414e('0x77')]))},client9002);return _0x3f8968;}return null;})['then'](respondWithResult(_0x5d9f51,null))[_0x414e('0x27')](handleError(_0x5d9f51,null));}; \ No newline at end of file +var _0x7599=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','end','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','params','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','RejectMessage','rejectMessage','ContactId','contact','fullname','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x7843c8,_0x2e73cf){var _0x238f6d=function(_0x5624e9){while(--_0x5624e9){_0x7843c8['push'](_0x7843c8['shift']());}};_0x238f6d(++_0x2e73cf);}(_0x7599,0xfb));var _0x9759=function(_0x56435d,_0x34da28){_0x56435d=_0x56435d-0x0;var _0x5b9a61=_0x7599[_0x56435d];return _0x5b9a61;};'use strict';var emlformat=require(_0x9759('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9759('0x1'));var jsonpatch=require(_0x9759('0x2'));var rp=require(_0x9759('0x3'));var moment=require(_0x9759('0x4'));var BPromise=require(_0x9759('0x5'));var Mustache=require(_0x9759('0x6'));var util=require(_0x9759('0x7'));var path=require(_0x9759('0x8'));var sox=require(_0x9759('0x9'));var csv=require(_0x9759('0xa'));var ejs=require(_0x9759('0xb'));var fs=require('fs');var fs_extra=require(_0x9759('0xc'));var _=require(_0x9759('0xd'));var squel=require(_0x9759('0xe'));var crypto=require(_0x9759('0xf'));var jsforce=require(_0x9759('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9759('0xa'));var querystring=require(_0x9759('0x11'));var Papa=require(_0x9759('0x12'));var Redis=require(_0x9759('0x13'));var authService=require(_0x9759('0x14'));var qs=require(_0x9759('0x15'));var as=require(_0x9759('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9759('0x17'))(_0x9759('0x18'));var utils=require('../../config/utils');var config=require(_0x9759('0x19'));var licenseUtil=require(_0x9759('0x1a'));var db=require(_0x9759('0x1b'))['db'];config[_0x9759('0x1c')]=_['defaults'](config[_0x9759('0x1c')],{'host':_0x9759('0x1d'),'port':0x18eb});var socket=require(_0x9759('0x1e'))(new Redis(config[_0x9759('0x1c')]));require(_0x9759('0x1f'))['register'](socket);var jayson=require(_0x9759('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x9759('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4f6eea,_0x4b4e93,_0x38c2c8,_0x2c72b6){return new BPromise(function(_0x484670,_0x21672b){var _0x23063d=_0x2c72b6||client;return _0x23063d['request'](_0x4f6eea,_0x38c2c8)[_0x9759('0x22')](function(_0x1d979f){logger['info'](_0x9759('0x23'),_0x4b4e93,'request\x20sent');logger['debug'](_0x9759('0x24'),_0x4b4e93,_0x9759('0x25'),JSON['stringify'](_0x1d979f));if(_0x1d979f[_0x9759('0x26')]){if(_0x1d979f['error'][_0x9759('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4b4e93,_0x1d979f['error'][_0x9759('0x28')]);return _0x21672b(_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);}logger['error'](_0x9759('0x23'),_0x4b4e93,_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);return _0x484670(_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);}else{logger[_0x9759('0x29')]('ChatMessage,\x20%s,\x20%s',_0x4b4e93,_0x9759('0x25'));_0x484670(_0x1d979f['result']['message']);}})[_0x9759('0x2a')](function(_0x442449){logger[_0x9759('0x26')](_0x9759('0x23'),_0x4b4e93,_0x442449);_0x21672b(_0x442449);});});}function respondWithStatusCode(_0xcafab1,_0x19de1f){_0x19de1f=_0x19de1f||0xcc;return function(_0x52bea5){if(_0x52bea5){return _0xcafab1[_0x9759('0x2b')](_0x19de1f);}return _0xcafab1[_0x9759('0x2c')](_0x19de1f)['end']();};}function respondWithResult(_0x22c49e,_0x4c66d4){_0x4c66d4=_0x4c66d4||0xc8;return function(_0x7e1bf8){if(_0x7e1bf8){return _0x22c49e['status'](_0x4c66d4)[_0x9759('0x2d')](_0x7e1bf8);}};}function respondWithFilteredResult(_0x59f84c,_0x3042af){return function(_0x3e24a2){if(_0x3e24a2){var _0x3f8153=typeof _0x3042af[_0x9759('0x2e')]===_0x9759('0x2f')&&typeof _0x3042af[_0x9759('0x30')]===_0x9759('0x2f');var _0xbb0507=_0x3e24a2['count'];var _0x47a5ee=_0x3f8153?0x0:_0x3042af[_0x9759('0x2e')];var _0x2cef99=_0x3f8153?_0x3e24a2['count']:_0x3042af[_0x9759('0x2e')]+_0x3042af['limit'];var _0x5e9bf0;if(_0x2cef99>=_0xbb0507){_0x2cef99=_0xbb0507;_0x5e9bf0=0xc8;}else{_0x5e9bf0=0xce;}_0x59f84c['status'](_0x5e9bf0);return _0x59f84c[_0x9759('0x31')](_0x9759('0x32'),_0x47a5ee+'-'+_0x2cef99+'/'+_0xbb0507)[_0x9759('0x2d')](_0x3e24a2);}return null;};}function patchUpdates(_0x3a0660){return function(_0x55bb89){try{jsonpatch[_0x9759('0x33')](_0x55bb89,_0x3a0660,!![]);}catch(_0x476677){return BPromise['reject'](_0x476677);}return _0x55bb89[_0x9759('0x34')]();};}function saveUpdates(_0x8da52c,_0x4c0b11){return function(_0x166672){if(_0x166672){return _0x166672[_0x9759('0x35')](_0x8da52c)[_0x9759('0x22')](function(_0x30ac73){return _0x30ac73;});}return null;};}function removeEntity(_0x378549,_0xb327bb){return function(_0x325332){if(_0x325332){return _0x325332[_0x9759('0x36')]()[_0x9759('0x22')](function(){_0x378549['status'](0xcc)[_0x9759('0x37')]();});}};}function handleEntityNotFound(_0x34f6f1,_0x1efcf7){return function(_0x16ff2b){if(!_0x16ff2b){_0x34f6f1[_0x9759('0x2b')](0x194);}return _0x16ff2b;};}function handleError(_0x3a476a,_0xae15e8){_0xae15e8=_0xae15e8||0x1f4;return function(_0x498c1a){logger[_0x9759('0x26')](_0x498c1a['stack']);if(_0x498c1a[_0x9759('0x38')]){delete _0x498c1a['name'];}_0x3a476a[_0x9759('0x2c')](_0xae15e8)[_0x9759('0x39')](_0x498c1a);};}exports[_0x9759('0x3a')]=function(_0x105981,_0x4cfb1a){var _0x1069bc={},_0x3bc37d={},_0x231cd9={'count':0x0,'rows':[]};var _0x1202fe=_['map'](db[_0x9759('0x3b')][_0x9759('0x3c')],function(_0x5ade40){return{'name':_0x5ade40[_0x9759('0x3d')],'type':_0x5ade40[_0x9759('0x3e')][_0x9759('0x3f')]};});_0x3bc37d[_0x9759('0x40')]=_[_0x9759('0x41')](_0x1202fe,_0x9759('0x38'));_0x3bc37d[_0x9759('0x42')]=_[_0x9759('0x43')](_0x105981[_0x9759('0x42')]);_0x3bc37d[_0x9759('0x44')]=_[_0x9759('0x45')](_0x3bc37d[_0x9759('0x40')],_0x3bc37d[_0x9759('0x42')]);_0x1069bc[_0x9759('0x46')]=_[_0x9759('0x45')](_0x3bc37d[_0x9759('0x40')],qs[_0x9759('0x47')](_0x105981['query'][_0x9759('0x47')]));_0x1069bc[_0x9759('0x46')]=_0x1069bc['attributes'][_0x9759('0x48')]?_0x1069bc[_0x9759('0x46')]:_0x3bc37d['model'];if(!_0x105981[_0x9759('0x42')][_0x9759('0x49')](_0x9759('0x4a'))){_0x1069bc[_0x9759('0x30')]=qs['limit'](_0x105981[_0x9759('0x42')]['limit']);_0x1069bc[_0x9759('0x2e')]=qs[_0x9759('0x2e')](_0x105981[_0x9759('0x42')][_0x9759('0x2e')]);}_0x1069bc['order']=qs[_0x9759('0x4b')](_0x105981['query'][_0x9759('0x4b')]);_0x1069bc[_0x9759('0x4c')]=qs[_0x9759('0x44')](_[_0x9759('0x4d')](_0x105981[_0x9759('0x42')],_0x3bc37d[_0x9759('0x44')]),_0x1202fe);if(_0x105981[_0x9759('0x42')][_0x9759('0x4e')]){_0x1069bc[_0x9759('0x4c')]=_[_0x9759('0x4f')](_0x1069bc[_0x9759('0x4c')],{'$or':_['map'](_0x1202fe,function(_0x3c279e){if(_0x3c279e[_0x9759('0x3e')]!==_0x9759('0x50')){var _0x45e7a4={};_0x45e7a4[_0x3c279e[_0x9759('0x38')]]={'$like':'%'+_0x105981['query'][_0x9759('0x4e')]+'%'};return _0x45e7a4;}})});}_0x1069bc=_[_0x9759('0x4f')]({},_0x1069bc,_0x105981[_0x9759('0x51')]);var _0x595285={'where':_0x1069bc['where']};return db[_0x9759('0x3b')][_0x9759('0x52')](_0x595285)[_0x9759('0x22')](function(_0x584173){_0x231cd9[_0x9759('0x52')]=_0x584173;if(_0x105981[_0x9759('0x42')][_0x9759('0x53')]){_0x1069bc['include']=[{'all':!![]}];}return db[_0x9759('0x3b')][_0x9759('0x54')](_0x1069bc);})[_0x9759('0x22')](function(_0x5321f2){_0x231cd9['rows']=_0x5321f2;return _0x231cd9;})[_0x9759('0x22')](respondWithFilteredResult(_0x4cfb1a,_0x1069bc))[_0x9759('0x2a')](handleError(_0x4cfb1a,null));};exports['show']=function(_0x433462,_0x2ce36c){var _0x164851={'raw':!![],'where':{'id':_0x433462[_0x9759('0x55')]['id']}},_0x441020={};_0x441020[_0x9759('0x40')]=_[_0x9759('0x43')](db[_0x9759('0x3b')][_0x9759('0x3c')]);_0x441020[_0x9759('0x42')]=_[_0x9759('0x43')](_0x433462[_0x9759('0x42')]);_0x441020[_0x9759('0x44')]=_['intersection'](_0x441020[_0x9759('0x40')],_0x441020[_0x9759('0x42')]);_0x164851['attributes']=_[_0x9759('0x45')](_0x441020[_0x9759('0x40')],qs['fields'](_0x433462['query'][_0x9759('0x47')]));_0x164851['attributes']=_0x164851[_0x9759('0x46')][_0x9759('0x48')]?_0x164851[_0x9759('0x46')]:_0x441020[_0x9759('0x40')];if(_0x433462[_0x9759('0x42')][_0x9759('0x53')]){_0x164851[_0x9759('0x56')]=[{'all':!![]}];}_0x164851=_[_0x9759('0x4f')]({},_0x164851,_0x433462['options']);return db[_0x9759('0x3b')][_0x9759('0x57')](_0x164851)[_0x9759('0x22')](handleEntityNotFound(_0x2ce36c,null))[_0x9759('0x22')](respondWithResult(_0x2ce36c,null))[_0x9759('0x2a')](handleError(_0x2ce36c,null));};exports['create']=function(_0x13c16e,_0x4cc1fc){return db[_0x9759('0x3b')][_0x9759('0x58')](_0x13c16e[_0x9759('0x59')],{})[_0x9759('0x22')](respondWithResult(_0x4cc1fc,0xc9))[_0x9759('0x2a')](handleError(_0x4cc1fc,null));};exports[_0x9759('0x35')]=function(_0x25d50e,_0x6e4d05){if(_0x25d50e['body']['id']){delete _0x25d50e[_0x9759('0x59')]['id'];}return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0x25d50e[_0x9759('0x55')]['id']}})[_0x9759('0x22')](handleEntityNotFound(_0x6e4d05,null))[_0x9759('0x22')](saveUpdates(_0x25d50e['body'],null))[_0x9759('0x22')](respondWithResult(_0x6e4d05,null))['catch'](handleError(_0x6e4d05,null));};exports[_0x9759('0x36')]=function(_0x318383,_0x4c9730){return db[_0x9759('0x3b')]['find']({'where':{'id':_0x318383[_0x9759('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c9730,null))[_0x9759('0x22')](removeEntity(_0x4c9730,null))['catch'](handleError(_0x4c9730,null));};exports[_0x9759('0x5a')]=function(_0x32eb46,_0x3d85ed){return db[_0x9759('0x3b')][_0x9759('0x5a')]()[_0x9759('0x22')](respondWithResult(_0x3d85ed,null))[_0x9759('0x2a')](handleError(_0x3d85ed,null));};var interaction_log=require(_0x9759('0x17'))(_0x9759('0x5b'));exports[_0x9759('0x5c')]=function(_0x5e6d56,_0x12b7d0,_0x3db839){var _0xef069d={'agent':{},'channel':_0x9759('0x5d')};if(_0x5e6d56[_0x9759('0x59')]['id']){delete _0x5e6d56[_0x9759('0x59')]['id'];}_0x5e6d56[_0x9759('0x59')][_0x9759('0x5e')]=!![];_0x5e6d56['body'][_0x9759('0x5f')]=moment()['format'](_0x9759('0x60'));_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')]=_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')]||_0x5e6d56[_0x9759('0x62')]['id'];_0xef069d[_0x9759('0x63')]['id']=_0x5e6d56['body'][_0x9759('0x61')];return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0x5e6d56[_0x9759('0x55')]['id'],'UserId':null}})[_0x9759('0x22')](handleEntityNotFound(_0x12b7d0,null))[_0x9759('0x22')](saveUpdates(_0x5e6d56['body'],null))[_0x9759('0x22')](function(_0x561bec){if(_0x561bec){_0xef069d[_0x9759('0x28')]=_0x561bec[_0x9759('0x64')]({'plain':!![]});return db[_0x9759('0x65')][_0x9759('0x57')]({'where':{'id':_0x561bec[_0x9759('0x66')]}});}return null;})[_0x9759('0x22')](handleEntityNotFound(_0x12b7d0,null))[_0x9759('0x22')](function(_0x42dca6){if(_0x42dca6){return _0x42dca6[_0x9759('0x35')]({'UserId':_0x5e6d56['body'][_0x9759('0x61')],'read1stAt':_[_0x9759('0x67')](_0x42dca6['read1stAt'])?moment()['format'](_0x9759('0x60')):undefined});}return null;})[_0x9759('0x22')](function(_0x20a587){if(_0x20a587){_0xef069d[_0x9759('0x68')]=_0x20a587[_0x9759('0x64')]({'plain':!![]});interaction_log[_0x9759('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e6d56[_0x9759('0x62')]['id'],_0x5e6d56[_0x9759('0x62')][_0x9759('0x38')],_0x5e6d56[_0x9759('0x62')][_0x9759('0x69')],_0xef069d[_0x9759('0x68')]['id'],_0x5e6d56[_0x9759('0x59')]?JSON[_0x9759('0x6a')](_0x5e6d56['body']):_0x9759('0x6b'));return respondWithRpcPromise(_0x9759('0x6c'),_0x9759('0x6d'),_0xef069d);}return null;})[_0x9759('0x22')](function(_0x2711bb){var _0x582e7b=_0x9759('0x6e')+_0x2711bb[_0x9759('0x28')]['ContactId'];return db[_0x9759('0x6f')]['query'](_0x582e7b,{'type':db[_0x9759('0x70')][_0x9759('0x71')][_0x9759('0x72')],'raw':!![]})['then'](function(_0x5427da){return _0x5427da;});})[_0x9759('0x22')](function(_0x33f0ee){if(_0x33f0ee){_0xef069d['message']['contact']=_0x33f0ee[0x0];if(!_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')])return;return db[_0x9759('0x73')][_0x9759('0x57')]({'where':{'id':_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')],'role':'agent'},'attributes':['id',_0x9759('0x38'),'fullname',_0x9759('0x74'),_0x9759('0x75')],'raw':!![]});}return null;})[_0x9759('0x22')](function(_0x137d41){if(!_0x137d41)return null;_0xef069d['message'][_0x9759('0x63')]=_0x137d41;return _0xef069d;})['then'](function(_0x1b2815){if(_0x1b2815){if(_0x5e6d56[_0x9759('0x59')][_0x9759('0x76')]){_0xef069d[_0x9759('0x28')][_0x9759('0x77')]=util[_0x9759('0x78')](_0x9759('0x79'),_0x5e6d56[_0x9759('0x62')][_0x9759('0x38')]);_0xef069d[_0x9759('0x28')][_0x9759('0x7a')]=_0xef069d['channel'];_0xef069d[_0x9759('0x28')][_0x9759('0x7b')]=_0xef069d['channel'];_0xef069d[_0x9759('0x28')][_0x9759('0x7c')]=_0x9759('0x5c');return respondWithRpcPromise(_0x9759('0x7d'),_0x9759('0x7d'),{'event':_0x9759('0x7e'),'message':_[_0x9759('0x4f')](_0xef069d[_0x9759('0x28')],JSON[_0x9759('0x7f')](_0xef069d[_0x9759('0x68')][_0x9759('0x80')]))},client9002)[_0x9759('0x22')](function(){return _0xef069d;});}return _0xef069d;}return null;})['then'](respondWithResult(_0x12b7d0,null))['catch'](handleError(_0x12b7d0,null));};var interaction_log=require(_0x9759('0x17'))(_0x9759('0x5b'));exports[_0x9759('0x81')]=function(_0xa08caa,_0xb36bb9,_0x235bcd){var _0x1ff4e4={'agent':{},'channel':_0x9759('0x5d')};if(_0xa08caa['body']['id']){delete _0xa08caa[_0x9759('0x59')]['id'];}_0xa08caa['body']['UserId']=_0xa08caa[_0x9759('0x59')]['UserId']||_0xa08caa[_0x9759('0x62')]['id'];_0x1ff4e4[_0x9759('0x63')]['id']=_0xa08caa['body'][_0x9759('0x61')];return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0xa08caa[_0x9759('0x55')]['id'],'UserId':null}})[_0x9759('0x22')](handleEntityNotFound(_0xb36bb9,null))[_0x9759('0x22')](function(_0x4a5f8c){if(_0x4a5f8c){_0x1ff4e4[_0x9759('0x28')]=_0x4a5f8c['get']({'plain':!![]});return db[_0x9759('0x65')][_0x9759('0x57')]({'where':{'id':_0x4a5f8c[_0x9759('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xb36bb9,null))[_0x9759('0x22')](function(_0x175401){if(_0x175401){_0x1ff4e4[_0x9759('0x68')]=_0x175401['get']({'plain':!![]});interaction_log[_0x9759('0x29')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa08caa[_0x9759('0x62')]['id'],_0xa08caa[_0x9759('0x62')][_0x9759('0x38')],_0xa08caa[_0x9759('0x62')][_0x9759('0x69')],_0x1ff4e4[_0x9759('0x68')]['id'],_0xa08caa[_0x9759('0x59')]?JSON[_0x9759('0x6a')](_0xa08caa[_0x9759('0x59')]):_0x9759('0x6b'));return respondWithRpcPromise(_0x9759('0x82'),_0x9759('0x83'),_0x1ff4e4);}return null;})[_0x9759('0x22')](function(_0x5d0f3f){var _0x152e91=_0x9759('0x6e')+_0x5d0f3f['message'][_0x9759('0x84')];return db[_0x9759('0x6f')][_0x9759('0x42')](_0x152e91,{'type':db[_0x9759('0x70')][_0x9759('0x71')][_0x9759('0x72')],'raw':!![]})['then'](function(_0x302afa){return _0x302afa;});})['then'](function(_0x5148c3){if(_0x5148c3){_0x1ff4e4[_0x9759('0x28')][_0x9759('0x85')]=_0x5148c3[0x0];if(!_0xa08caa[_0x9759('0x59')][_0x9759('0x61')])return;return db['User'][_0x9759('0x57')]({'where':{'id':_0xa08caa[_0x9759('0x59')][_0x9759('0x61')],'role':_0x9759('0x63')},'attributes':['id','name',_0x9759('0x86'),_0x9759('0x74'),_0x9759('0x75')],'raw':!![]});}return null;})[_0x9759('0x22')](function(_0x45eea4){if(!_0x45eea4)return null;_0x1ff4e4[_0x9759('0x28')][_0x9759('0x63')]=_0x45eea4;return _0x1ff4e4;})['then'](function(_0x369481){if(_0x369481){_0x369481[_0x9759('0x28')][_0x9759('0x77')]=util['format'](_0x9759('0x79'),_0xa08caa[_0x9759('0x62')]['name']);_0x369481[_0x9759('0x28')][_0x9759('0x7a')]=_0x1ff4e4[_0x9759('0x7a')];_0x369481['message'][_0x9759('0x7b')]=_0x1ff4e4['channel'];_0x369481[_0x9759('0x28')][_0x9759('0x7c')]='reject';respondWithRpcPromise('EventManager',_0x9759('0x7d'),{'event':'rejectmessage','message':_[_0x9759('0x4f')](_0x1ff4e4[_0x9759('0x28')],JSON[_0x9759('0x7f')](_0x1ff4e4[_0x9759('0x68')][_0x9759('0x80')]))},client9002);return _0x1ff4e4;}return null;})[_0x9759('0x22')](respondWithResult(_0xb36bb9,null))[_0x9759('0x2a')](handleError(_0xb36bb9,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index bb623e0..da56e1f 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 _0x1930=['hook','exports','events','../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty'];(function(_0x26b2d8,_0xb2448c){var _0x24d7ad=function(_0x2674a9){while(--_0x2674a9){_0x26b2d8['push'](_0x26b2d8['shift']());}};_0x24d7ad(++_0xb2448c);}(_0x1930,0x134));var _0x0193=function(_0x1f5935,_0x7c6aa6){_0x1f5935=_0x1f5935-0x0;var _0x4e5764=_0x1930[_0x1f5935];return _0x4e5764;};'use strict';var EventEmitter=require(_0x0193('0x0'));var ChatMessage=require(_0x0193('0x1'))['db'][_0x0193('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0193('0x3'),'afterDestroy':_0x0193('0x4')};function emitEvent(_0x40a2e3){return function(_0x40569e,_0x8a823,_0x5206a9){ChatMessageEvents[_0x0193('0x5')](_0x40a2e3+':'+_0x40569e['id'],_0x40569e);ChatMessageEvents['emit'](_0x40a2e3,_0x40569e);_0x5206a9(null);};}for(var e in events){if(events[_0x0193('0x6')](e)){var event=events[e];ChatMessage[_0x0193('0x7')](e,emitEvent(event));}}module[_0x0193('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xe5f5=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x220ff3,_0x4d7661){var _0x1c10a7=function(_0x106268){while(--_0x106268){_0x220ff3['push'](_0x220ff3['shift']());}};_0x1c10a7(++_0x4d7661);}(_0xe5f5,0xb3));var _0x5e5f=function(_0x5a08f5,_0x2e99f1){_0x5a08f5=_0x5a08f5-0x0;var _0x573b18=_0xe5f5[_0x5a08f5];return _0x573b18;};'use strict';var EventEmitter=require(_0x5e5f('0x0'));var ChatMessage=require(_0x5e5f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5e5f('0x2')](0x0);var events={'afterCreate':_0x5e5f('0x3'),'afterUpdate':_0x5e5f('0x4'),'afterDestroy':_0x5e5f('0x5')};function emitEvent(_0x4ae9a0){return function(_0x1c081b,_0xd8775,_0x3cd3f8){ChatMessageEvents[_0x5e5f('0x6')](_0x4ae9a0+':'+_0x1c081b['id'],_0x1c081b);ChatMessageEvents['emit'](_0x4ae9a0,_0x1c081b);_0x3cd3f8(null);};}for(var e in events){if(events[_0x5e5f('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5e5f('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b210c54..e59827a 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 _0xbc25=['../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0xe61569,_0x38c173){var _0x459e38=function(_0x7cbee3){while(--_0x7cbee3){_0xe61569['push'](_0xe61569['shift']());}};_0x459e38(++_0x38c173);}(_0xbc25,0x81));var _0x5bc2=function(_0x12b7cb,_0x3d428e){_0x12b7cb=_0x12b7cb-0x0;var _0x7acbd4=_0xbc25[_0x12b7cb];return _0x7acbd4;};'use strict';var _=require('lodash');var util=require(_0x5bc2('0x0'));var logger=require(_0x5bc2('0x1'))(_0x5bc2('0x2'));var moment=require(_0x5bc2('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5bc2('0x5'));var attributes=require(_0x5bc2('0x6'));module[_0x5bc2('0x7')]=function(_0x51aeb6,_0x5aa0cd){return _0x51aeb6[_0x5bc2('0x8')](_0x5bc2('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x5bc2('0xa'),'fields':[_0x5bc2('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b88f7,_0x31e56b,_0x37059a){var _0x181f1f=_0x51aeb6[_0x5bc2('0xc')];var _0xa74e80=_0x4b88f7[_0x5bc2('0xd')]({'plain':!![]});if(_0xa74e80[_0x5bc2('0xe')][_0x5bc2('0xf')]()==='in'||_0xa74e80[_0x5bc2('0xe')][_0x5bc2('0xf')]()==='out'&&!_0xa74e80[_0x5bc2('0x10')]&&!_[_0x5bc2('0x11')](_0xa74e80[_0x5bc2('0x12')])){_0x181f1f[_0x5bc2('0x13')]['findOne']({'where':{'id':_0xa74e80['ChatInteractionId']}})['then'](function(_0x2bf4a2){if(_0x2bf4a2){_0x2bf4a2[_0x5bc2('0x14')]({'lastMsgAt':_0xa74e80[_0x5bc2('0x15')],'lastMsgDirection':_0xa74e80[_0x5bc2('0xe')]['toLowerCase']()});}})[_0x5bc2('0x16')](function(_0x526e63){console[_0x5bc2('0x17')](_0x526e63);});}_0x37059a();}},'charset':_0x5bc2('0x18'),'collate':_0x5bc2('0x19')});}; \ No newline at end of file +var _0xb3a1=['error','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch'];(function(_0x289799,_0x34b7b3){var _0x4faecc=function(_0x5b11a2){while(--_0x5b11a2){_0x289799['push'](_0x289799['shift']());}};_0x4faecc(++_0x34b7b3);}(_0xb3a1,0x1bc));var _0x1b3a=function(_0x5642a4,_0x3b3752){_0x5642a4=_0x5642a4-0x0;var _0x20b040=_0xb3a1[_0x5642a4];return _0x20b040;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b3a('0x0'))('api');var moment=require(_0x1b3a('0x1'));var BPromise=require(_0x1b3a('0x2'));var rp=require(_0x1b3a('0x3'));var fs=require('fs');var path=require(_0x1b3a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x1b3a('0x5')]=function(_0x368430,_0x196f3c){return _0x368430[_0x1b3a('0x6')](_0x1b3a('0x7'),attributes,{'tableName':_0x1b3a('0x8'),'paranoid':![],'indexes':[{'name':_0x1b3a('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21a30b,_0x478e01,_0x2e0a3e){var _0x3da1a8=_0x368430[_0x1b3a('0xa')];var _0x2c70a=_0x21a30b[_0x1b3a('0xb')]({'plain':!![]});if(_0x2c70a[_0x1b3a('0xc')][_0x1b3a('0xd')]()==='in'||_0x2c70a[_0x1b3a('0xc')][_0x1b3a('0xd')]()===_0x1b3a('0xe')&&!_0x2c70a[_0x1b3a('0xf')]&&!_[_0x1b3a('0x10')](_0x2c70a['UserId'])){_0x3da1a8[_0x1b3a('0x11')][_0x1b3a('0x12')]({'where':{'id':_0x2c70a[_0x1b3a('0x13')]}})[_0x1b3a('0x14')](function(_0x166d45){if(_0x166d45){_0x166d45[_0x1b3a('0x15')]({'lastMsgAt':_0x2c70a[_0x1b3a('0x16')],'lastMsgDirection':_0x2c70a['direction']['toLowerCase']()});}})[_0x1b3a('0x17')](function(_0x1d4be2){console[_0x1b3a('0x18')](_0x1d4be2);});}_0x2e0a3e();}},'charset':'utf8mb4','collate':_0x1b3a('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 7f65bc4..11956b0 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 _0x5776=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird'];(function(_0x151b7b,_0x5bcc53){var _0x1f61a4=function(_0x1be453){while(--_0x1be453){_0x151b7b['push'](_0x151b7b['shift']());}};_0x1f61a4(++_0x5bcc53);}(_0x5776,0x17d));var _0x6577=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5776[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6577('0x0'));var util=require(_0x6577('0x1'));var moment=require(_0x6577('0x2'));var BPromise=require(_0x6577('0x3'));var rs=require(_0x6577('0x4'));var fs=require('fs');var Redis=require(_0x6577('0x5'));var db=require(_0x6577('0x6'))['db'];var utils=require(_0x6577('0x7'));var logger=require(_0x6577('0x8'))(_0x6577('0x9'));var config=require(_0x6577('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6577('0xb')][_0x6577('0xc')]({'port':0x232a});config['redis']=_[_0x6577('0xd')](config[_0x6577('0xe')],{'host':_0x6577('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6577('0xe')]));require(_0x6577('0x10'))[_0x6577('0x11')](socket);function respondWithRpcPromise(_0x219f81,_0x57608d,_0x444aaf){return new BPromise(function(_0x38a6d2,_0x2e0589){return client[_0x6577('0x12')](_0x219f81,_0x444aaf)[_0x6577('0x13')](function(_0x287aee){logger[_0x6577('0x14')]('ChatMessage,\x20%s,\x20%s',_0x57608d,_0x6577('0x15'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57608d,_0x6577('0x15'),JSON[_0x6577('0x16')](_0x287aee));if(_0x287aee[_0x6577('0x17')]){if(_0x287aee['error'][_0x6577('0x18')]===0x1f4){logger['error'](_0x6577('0x19'),_0x57608d,_0x287aee[_0x6577('0x17')][_0x6577('0x1a')]);return _0x2e0589(_0x287aee[_0x6577('0x17')]['message']);}logger[_0x6577('0x17')](_0x6577('0x19'),_0x57608d,_0x287aee[_0x6577('0x17')]['message']);return _0x38a6d2(_0x287aee[_0x6577('0x17')]['message']);}else{logger[_0x6577('0x14')](_0x6577('0x19'),_0x57608d,_0x6577('0x15'));_0x38a6d2(_0x287aee['result'][_0x6577('0x1a')]);}})[_0x6577('0x1b')](function(_0x4d4065){logger[_0x6577('0x17')]('ChatMessage,\x20%s,\x20%s',_0x57608d,_0x4d4065);_0x2e0589(_0x4d4065);});});}exports[_0x6577('0x1c')]=function(_0x3c0f4c){var _0x26cd8c=this;return new Promise(function(_0x34f43a,_0x44905a){return db[_0x6577('0x1d')][_0x6577('0x1e')](_0x3c0f4c[_0x6577('0x1f')],{'raw':_0x3c0f4c[_0x6577('0x20')]?_0x3c0f4c[_0x6577('0x20')][_0x6577('0x21')]===undefined?!![]:![]:!![]})[_0x6577('0x13')](function(_0x1c6e2b){logger[_0x6577('0x14')](_0x6577('0x1c'),_0x3c0f4c);logger[_0x6577('0x22')](_0x6577('0x1c'),_0x3c0f4c,JSON[_0x6577('0x16')](_0x1c6e2b));_0x34f43a(_0x1c6e2b);})[_0x6577('0x1b')](function(_0xc463ca){logger['error'](_0x6577('0x1c'),_0xc463ca[_0x6577('0x1a')],_0x3c0f4c);_0x44905a(_0x26cd8c[_0x6577('0x17')](0x1f4,_0xc463ca['message']));});});}; \ No newline at end of file +var _0xe558=['code','message','result','CreateChatMessage','ChatMessage','create','body','raw','catch','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x529401,_0x68cf8e){var _0xdcaaa2=function(_0x1ab7f2){while(--_0x1ab7f2){_0x529401['push'](_0x529401['shift']());}};_0xdcaaa2(++_0x68cf8e);}(_0xe558,0x69));var _0x8e55=function(_0x58ba1d,_0x3b345d){_0x58ba1d=_0x58ba1d-0x0;var _0x1d5647=_0xe558[_0x58ba1d];return _0x1d5647;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e55('0x0'));var fs=require('fs');var Redis=require(_0x8e55('0x1'));var db=require(_0x8e55('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e55('0x3'))(_0x8e55('0x4'));var config=require(_0x8e55('0x5'));var jayson=require(_0x8e55('0x6'));var client=jayson[_0x8e55('0x7')][_0x8e55('0x8')]({'port':0x232a});config[_0x8e55('0x9')]=_[_0x8e55('0xa')](config[_0x8e55('0x9')],{'host':_0x8e55('0xb'),'port':0x18eb});var socket=require(_0x8e55('0xc'))(new Redis(config[_0x8e55('0x9')]));require(_0x8e55('0xd'))[_0x8e55('0xe')](socket);function respondWithRpcPromise(_0x330c27,_0xdb8a8,_0x707751){return new BPromise(function(_0x49befa,_0x3be648){return client['request'](_0x330c27,_0x707751)[_0x8e55('0xf')](function(_0x3ef0b1){logger[_0x8e55('0x10')](_0x8e55('0x11'),_0xdb8a8,_0x8e55('0x12'));logger[_0x8e55('0x13')](_0x8e55('0x14'),_0xdb8a8,'request\x20sent',JSON[_0x8e55('0x15')](_0x3ef0b1));if(_0x3ef0b1[_0x8e55('0x16')]){if(_0x3ef0b1['error'][_0x8e55('0x17')]===0x1f4){logger[_0x8e55('0x16')](_0x8e55('0x11'),_0xdb8a8,_0x3ef0b1[_0x8e55('0x16')]['message']);return _0x3be648(_0x3ef0b1[_0x8e55('0x16')][_0x8e55('0x18')]);}logger[_0x8e55('0x16')]('ChatMessage,\x20%s,\x20%s',_0xdb8a8,_0x3ef0b1['error'][_0x8e55('0x18')]);return _0x49befa(_0x3ef0b1[_0x8e55('0x16')][_0x8e55('0x18')]);}else{logger['info'](_0x8e55('0x11'),_0xdb8a8,_0x8e55('0x12'));_0x49befa(_0x3ef0b1[_0x8e55('0x19')][_0x8e55('0x18')]);}})['catch'](function(_0x380035){logger[_0x8e55('0x16')](_0x8e55('0x11'),_0xdb8a8,_0x380035);_0x3be648(_0x380035);});});}exports[_0x8e55('0x1a')]=function(_0x14e47b){var _0x53c2a4=this;return new Promise(function(_0x2ddf53,_0x2b10f6){return db[_0x8e55('0x1b')][_0x8e55('0x1c')](_0x14e47b[_0x8e55('0x1d')],{'raw':_0x14e47b['options']?_0x14e47b['options'][_0x8e55('0x1e')]===undefined?!![]:![]:!![]})[_0x8e55('0xf')](function(_0x18a86e){logger[_0x8e55('0x10')](_0x8e55('0x1a'),_0x14e47b);logger[_0x8e55('0x13')](_0x8e55('0x1a'),_0x14e47b,JSON[_0x8e55('0x15')](_0x18a86e));_0x2ddf53(_0x18a86e);})[_0x8e55('0x1f')](function(_0x1d9358){logger[_0x8e55('0x16')]('CreateChatMessage',_0x1d9358[_0x8e55('0x18')],_0x14e47b);_0x2b10f6(_0x53c2a4['error'](0x1f4,_0x1d9358[_0x8e55('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 85b5a87..c72a517 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 _0xf006=['register','chatMessage:','remove','update','emit','removeListener'];(function(_0x5b17e5,_0x21e3c2){var _0x4b56bb=function(_0x2441ce){while(--_0x2441ce){_0x5b17e5['push'](_0x5b17e5['shift']());}};_0x4b56bb(++_0x21e3c2);}(_0xf006,0x146));var _0x6f00=function(_0x2de8fe,_0x4e6786){_0x2de8fe=_0x2de8fe-0x0;var _0x4e4089=_0xf006[_0x2de8fe];return _0x4e4089;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x6f00('0x0'),_0x6f00('0x1')];function createListener(_0x5914f3,_0xbab575){return function(_0x4e9dbc){_0xbab575[_0x6f00('0x2')](_0x5914f3,_0x4e9dbc);};}function removeListener(_0x4f4466,_0x5039fb){return function(){ChatMessageEvents[_0x6f00('0x3')](_0x4f4466,_0x5039fb);};}exports[_0x6f00('0x4')]=function(_0x141e71){for(var _0x52c9a2=0x0,_0x3c29ff=events['length'];_0x52c9a2<_0x3c29ff;_0x52c9a2++){var _0x3875fb=events[_0x52c9a2];var _0x3001b1=createListener(_0x6f00('0x5')+_0x3875fb,_0x141e71);ChatMessageEvents['on'](_0x3875fb,_0x3001b1);}}; \ No newline at end of file +var _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x17c241,_0x1bf660){var _0x472397=function(_0x5cf779){while(--_0x5cf779){_0x17c241['push'](_0x17c241['shift']());}};_0x472397(++_0x1bf660);}(_0x84e7,0x122));var _0x784e=function(_0x2ae37b,_0x180ac3){_0x2ae37b=_0x2ae37b-0x0;var _0x591143=_0x84e7[_0x2ae37b];return _0x591143;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){ChatMessageEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('chatMessage:'+_0xfaa170,_0x133296);ChatMessageEvents['on'](_0xfaa170,_0x24654d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 01bb034..fd22fd2 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 _0xe465=['express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout'];(function(_0x41e529,_0xe38ab6){var _0x18681f=function(_0x15a8a8){while(--_0x15a8a8){_0x41e529['push'](_0x41e529['shift']());}};_0x18681f(++_0xe38ab6);}(_0xe465,0x10c));var _0x5e46=function(_0x5d40b1,_0x5f7f65){_0x5d40b1=_0x5d40b1-0x0;var _0xa98d8b=_0xe465[_0x5d40b1];return _0xa98d8b;};'use strict';var multer=require('multer');var util=require(_0x5e46('0x0'));var path=require('path');var timeout=require(_0x5e46('0x1'));var express=require(_0x5e46('0x2'));var router=express[_0x5e46('0x3')]();var fs_extra=require(_0x5e46('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e46('0x5'));var config=require('../../config/environment');var controller=require(_0x5e46('0x6'));router[_0x5e46('0x7')]('/',auth[_0x5e46('0x8')](),controller[_0x5e46('0x9')]);router[_0x5e46('0x7')](_0x5e46('0xa'),auth[_0x5e46('0x8')](),controller[_0x5e46('0xb')]);router[_0x5e46('0x7')](_0x5e46('0xc'),auth[_0x5e46('0x8')](),controller[_0x5e46('0xd')]);router[_0x5e46('0xe')]('/',auth[_0x5e46('0x8')](),interaction[_0x5e46('0xf')](_0x5e46('0x10'),_0x5e46('0x11')),controller[_0x5e46('0x12')]);router[_0x5e46('0x13')](_0x5e46('0xc'),controller['update']);router[_0x5e46('0x13')](_0x5e46('0x14'),auth[_0x5e46('0x8')](),controller[_0x5e46('0x15')]);router[_0x5e46('0x13')](_0x5e46('0x16'),auth['isAuthenticated'](),controller[_0x5e46('0x17')]);router[_0x5e46('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5e46('0x19')]);module[_0x5e46('0x1a')]=router; \ No newline at end of file +var _0xf609=['connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xf609,0xf0));var _0x9f60=function(_0x5b14ec,_0x3cee49){_0x5b14ec=_0x5b14ec-0x0;var _0x13673a=_0xf609[_0x5b14ec];return _0x13673a;};'use strict';var multer=require(_0x9f60('0x0'));var util=require(_0x9f60('0x1'));var path=require(_0x9f60('0x2'));var timeout=require(_0x9f60('0x3'));var express=require(_0x9f60('0x4'));var router=express[_0x9f60('0x5')]();var fs_extra=require(_0x9f60('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9f60('0x7'));var controller=require(_0x9f60('0x8'));router[_0x9f60('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f60('0xa')]);router['get'](_0x9f60('0xb'),auth['isAuthenticated'](),controller[_0x9f60('0xc')]);router[_0x9f60('0x9')](_0x9f60('0xd'),auth[_0x9f60('0xe')](),controller[_0x9f60('0xf')]);router[_0x9f60('0x10')]('/',auth[_0x9f60('0xe')](),interaction[_0x9f60('0x11')](_0x9f60('0x12'),_0x9f60('0x13')),controller['create']);router[_0x9f60('0x14')](_0x9f60('0xd'),controller[_0x9f60('0x15')]);router[_0x9f60('0x14')](_0x9f60('0x16'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x9f60('0x17'),auth[_0x9f60('0xe')](),controller[_0x9f60('0x18')]);router['delete']('/:id',auth[_0x9f60('0xe')](),controller[_0x9f60('0x19')]);module[_0x9f60('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 685d03b..83c8104 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 _0x63e5=['sequelize','exports','TEXT','medium'];(function(_0x55ba13,_0x55b31b){var _0x3d04eb=function(_0x5c01b6){while(--_0x5c01b6){_0x55ba13['push'](_0x55ba13['shift']());}};_0x3d04eb(++_0x55b31b);}(_0x63e5,0x144));var _0x563e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x63e5[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0x563e('0x0'));module[_0x563e('0x1')]={'body':{'type':Sequelize[_0x563e('0x2')](_0x563e('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x8c84=['exports','TEXT','sequelize'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x8c84,0x83));var _0x48c8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8c84[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x48c8('0x0'));module[_0x48c8('0x1')]={'body':{'type':Sequelize[_0x48c8('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3f714d9..4b7568c 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(_0x5728d1,_0x6c0913){var _0x310f61=function(_0x455909){while(--_0x455909){_0x5728d1['push'](_0x5728d1['shift']());}};_0x310f61(++_0x6c0913);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x7a54,0x106));var _0x47a5=function(_0xfe1dfc,_0x1826f4){_0xfe1dfc=_0xfe1dfc-0x0;var _0x2f568b=_0x7a54[_0xfe1dfc];return _0x2f568b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 371e9eb..268952c 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 _0x2611=['chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x2611,0x1b5));var _0x1261=function(_0x8e1e8,_0x27e413){_0x8e1e8=_0x8e1e8-0x0;var _0x5b78bb=_0x2611[_0x8e1e8];return _0x5b78bb;};'use strict';var _=require(_0x1261('0x0'));var util=require(_0x1261('0x1'));var logger=require(_0x1261('0x2'))(_0x1261('0x3'));var moment=require(_0x1261('0x4'));var BPromise=require(_0x1261('0x5'));var rp=require(_0x1261('0x6'));var fs=require('fs');var path=require(_0x1261('0x7'));var rimraf=require(_0x1261('0x8'));var config=require(_0x1261('0x9'));var attributes=require(_0x1261('0xa'));module[_0x1261('0xb')]=function(_0x5596a1,_0x1172df){return _0x5596a1['define'](_0x1261('0xc'),attributes,{'tableName':_0x1261('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1261('0xe')});}; \ No newline at end of file +var _0xf2fa=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0xac72f7,_0x237a87){var _0x5b1c13=function(_0x465d93){while(--_0x465d93){_0xac72f7['push'](_0xac72f7['shift']());}};_0x5b1c13(++_0x237a87);}(_0xf2fa,0xd7));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf2f('0x0'));var util=require('util');var logger=require(_0xaf2f('0x1'))(_0xaf2f('0x2'));var moment=require(_0xaf2f('0x3'));var BPromise=require(_0xaf2f('0x4'));var rp=require(_0xaf2f('0x5'));var fs=require('fs');var path=require(_0xaf2f('0x6'));var rimraf=require(_0xaf2f('0x7'));var config=require(_0xaf2f('0x8'));var attributes=require(_0xaf2f('0x9'));module['exports']=function(_0x2e0de4,_0x389f76){return _0x2e0de4[_0xaf2f('0xa')](_0xaf2f('0xb'),attributes,{'tableName':_0xaf2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf2f('0xd'),'collate':_0xaf2f('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ee68102..45ed349 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 _0x66c7=['../../config/logger','rpc','jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x66c7,0x19d));var _0x766c=function(_0x5b8cd2,_0xd73d07){_0x5b8cd2=_0x5b8cd2-0x0;var _0x34754a=_0x66c7[_0x5b8cd2];return _0x34754a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x766c('0x0'));var BPromise=require(_0x766c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x766c('0x2'));var db=require(_0x766c('0x3'))['db'];var utils=require(_0x766c('0x4'));var logger=require(_0x766c('0x5'))(_0x766c('0x6'));var config=require('../../config/environment');var jayson=require(_0x766c('0x7'));var client=jayson['client'][_0x766c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46e166,_0x24aed7,_0x3a1a72){return new BPromise(function(_0x41156e,_0x452352){return client[_0x766c('0x9')](_0x46e166,_0x3a1a72)['then'](function(_0x564d00){logger['info'](_0x766c('0xa'),_0x24aed7,_0x766c('0xb'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x24aed7,_0x766c('0xb'),JSON[_0x766c('0xc')](_0x564d00));if(_0x564d00['error']){if(_0x564d00['error'][_0x766c('0xd')]===0x1f4){logger[_0x766c('0xe')](_0x766c('0xa'),_0x24aed7,_0x564d00[_0x766c('0xe')][_0x766c('0xf')]);return _0x452352(_0x564d00[_0x766c('0xe')]['message']);}logger['error'](_0x766c('0xa'),_0x24aed7,_0x564d00['error']['message']);return _0x41156e(_0x564d00[_0x766c('0xe')][_0x766c('0xf')]);}else{logger[_0x766c('0x10')](_0x766c('0xa'),_0x24aed7,'request\x20sent');_0x41156e(_0x564d00[_0x766c('0x11')][_0x766c('0xf')]);}})[_0x766c('0x12')](function(_0x1978b9){logger[_0x766c('0xe')](_0x766c('0xa'),_0x24aed7,_0x1978b9);_0x452352(_0x1978b9);});});} \ No newline at end of file +var _0x2061=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x406436,_0x47a2b4){var _0x251b20=function(_0x5d6dae){while(--_0x5d6dae){_0x406436['push'](_0x406436['shift']());}};_0x251b20(++_0x47a2b4);}(_0x2061,0x80));var _0x1206=function(_0x6b2e00,_0x4734cb){_0x6b2e00=_0x6b2e00-0x0;var _0x5527fe=_0x2061[_0x6b2e00];return _0x5527fe;};'use strict';var _=require(_0x1206('0x0'));var util=require(_0x1206('0x1'));var moment=require('moment');var BPromise=require(_0x1206('0x2'));var rs=require(_0x1206('0x3'));var fs=require('fs');var Redis=require(_0x1206('0x4'));var db=require(_0x1206('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1206('0x6'));var config=require(_0x1206('0x7'));var jayson=require(_0x1206('0x8'));var client=jayson[_0x1206('0x9')][_0x1206('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed569,_0x10581f,_0x2152d9){return new BPromise(function(_0x117653,_0x1647b5){return client['request'](_0x5ed569,_0x2152d9)[_0x1206('0xb')](function(_0xab3513){logger[_0x1206('0xc')](_0x1206('0xd'),_0x10581f,_0x1206('0xe'));logger[_0x1206('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x10581f,'request\x20sent',JSON[_0x1206('0x10')](_0xab3513));if(_0xab3513[_0x1206('0x11')]){if(_0xab3513[_0x1206('0x11')][_0x1206('0x12')]===0x1f4){logger[_0x1206('0x11')](_0x1206('0xd'),_0x10581f,_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);return _0x1647b5(_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);}logger[_0x1206('0x11')](_0x1206('0xd'),_0x10581f,_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);return _0x117653(_0xab3513['error'][_0x1206('0x13')]);}else{logger[_0x1206('0xc')](_0x1206('0xd'),_0x10581f,_0x1206('0xe'));_0x117653(_0xab3513[_0x1206('0x14')][_0x1206('0x13')]);}})[_0x1206('0x15')](function(_0x573c95){logger[_0x1206('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x10581f,_0x573c95);_0x1647b5(_0x573c95);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ebc3cd9..ed90972 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 _0xc7b1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c61d3,_0x4fe494){var _0x1a73fe=function(_0x1c1e51){while(--_0x1c1e51){_0x4c61d3['push'](_0x4c61d3['shift']());}};_0x1a73fe(++_0x4fe494);}(_0xc7b1,0x105));var _0x1c7b=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0xc7b1[_0x6c59fc];return _0x17c96f;};'use strict';var multer=require(_0x1c7b('0x0'));var util=require(_0x1c7b('0x1'));var path=require(_0x1c7b('0x2'));var timeout=require(_0x1c7b('0x3'));var express=require(_0x1c7b('0x4'));var router=express[_0x1c7b('0x5')]();var fs_extra=require(_0x1c7b('0x6'));var auth=require(_0x1c7b('0x7'));var interaction=require(_0x1c7b('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x1c7b('0x9')]('/',auth[_0x1c7b('0xa')](),controller['index']);router[_0x1c7b('0x9')](_0x1c7b('0xb'),auth[_0x1c7b('0xa')](),controller['describe']);router[_0x1c7b('0x9')](_0x1c7b('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1c7b('0xd')]);router[_0x1c7b('0xe')](_0x1c7b('0xc'),auth[_0x1c7b('0xa')](),controller[_0x1c7b('0xf')]);router[_0x1c7b('0x10')](_0x1c7b('0xc'),auth['isAuthenticated'](),controller[_0x1c7b('0x11')]);module[_0x1c7b('0x12')]=router; \ No newline at end of file +var _0xf878=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x176606,_0x2cb8d9){var _0x4a2abc=function(_0x3d8fb2){while(--_0x3d8fb2){_0x176606['push'](_0x176606['shift']());}};_0x4a2abc(++_0x2cb8d9);}(_0xf878,0x100));var _0x8f87=function(_0x2f0e61,_0x24f38d){_0x2f0e61=_0x2f0e61-0x0;var _0x344a68=_0xf878[_0x2f0e61];return _0x344a68;};'use strict';var multer=require(_0x8f87('0x0'));var util=require(_0x8f87('0x1'));var path=require(_0x8f87('0x2'));var timeout=require(_0x8f87('0x3'));var express=require(_0x8f87('0x4'));var router=express[_0x8f87('0x5')]();var fs_extra=require(_0x8f87('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8f87('0x7'));var config=require(_0x8f87('0x8'));var controller=require(_0x8f87('0x9'));router[_0x8f87('0xa')]('/',auth[_0x8f87('0xb')](),controller[_0x8f87('0xc')]);router[_0x8f87('0xa')](_0x8f87('0xd'),auth[_0x8f87('0xb')](),controller[_0x8f87('0xe')]);router['get'](_0x8f87('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8f87('0x10')]('/',auth[_0x8f87('0xb')](),controller[_0x8f87('0x11')]);router[_0x8f87('0x12')](_0x8f87('0xf'),auth[_0x8f87('0xb')](),controller[_0x8f87('0x13')]);router[_0x8f87('0x14')](_0x8f87('0xf'),auth[_0x8f87('0xb')](),controller['destroy']);module[_0x8f87('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a092753..bbfde69 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 _0x724b=['sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x724b,0x78));var _0xb724=function(_0x5909a3,_0x4e4609){_0x5909a3=_0x5909a3-0x0;var _0x7c4c65=_0x724b[_0x5909a3];return _0x7c4c65;};'use strict';var Sequelize=require(_0xb724('0x0'));module[_0xb724('0x1')]={'name':{'type':Sequelize[_0xb724('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb724('0x3')](_0xb724('0x4'),_0xb724('0x5')),'defaultValue':_0xb724('0x4')},'selector':{'type':Sequelize[_0xb724('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7a95=['ENUM','mouseOver','INTEGER','exports','STRING'];(function(_0x52a2be,_0x4bd252){var _0x246f1d=function(_0x410395){while(--_0x410395){_0x52a2be['push'](_0x52a2be['shift']());}};_0x246f1d(++_0x4bd252);}(_0x7a95,0xe4));var _0x57a9=function(_0x2ac1c8,_0x5b8ae4){_0x2ac1c8=_0x2ac1c8-0x0;var _0x2447bd=_0x7a95[_0x2ac1c8];return _0x2447bd;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x57a9('0x2')](_0x57a9('0x3'),'timeout'),'defaultValue':_0x57a9('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x57a9('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 599c0f3..85b4f8a 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 _0x5ad3=['show','keys','rawAttributes','intersection','attributes','model','query','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x1627cd,_0x2a9058){var _0x3d7971=function(_0x15d6a8){while(--_0x15d6a8){_0x1627cd['push'](_0x1627cd['shift']());}};_0x3d7971(++_0x2a9058);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x5ad3[_0x421e36];return _0x20b3e3;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={'raw':!![],'where':{'id':_0x11da54['params']['id']}},_0x2c82f1={};_0x2c82f1['model']=_[_0x35ad('0x29')](db['ChatProactiveAction'][_0x35ad('0x2a')]);_0x2c82f1['query']=_['keys'](_0x11da54['query']);_0x2c82f1['filters']=_[_0x35ad('0x2b')](_0x2c82f1['model'],_0x2c82f1['query']);_0x34b8b9[_0x35ad('0x2c')]=_['intersection'](_0x2c82f1[_0x35ad('0x2d')],qs['fields'](_0x11da54[_0x35ad('0x2e')]['fields']));_0x34b8b9[_0x35ad('0x2c')]=_0x34b8b9['attributes'][_0x35ad('0x2f')]?_0x34b8b9[_0x35ad('0x2c')]:_0x2c82f1[_0x35ad('0x2d')];if(_0x11da54['query'][_0x35ad('0x30')]){_0x34b8b9[_0x35ad('0x31')]=[{'all':!![]}];}_0x34b8b9=_[_0x35ad('0x32')]({},_0x34b8b9,_0x11da54[_0x35ad('0x33')]);return db[_0x35ad('0x34')]['find'](_0x34b8b9)['then'](handleEntityNotFound(_0x2f8b3,null))[_0x35ad('0x23')](respondWithResult(_0x2f8b3,null))[_0x35ad('0x35')](handleError(_0x2f8b3,null));};exports[_0x35ad('0x36')]=function(_0x1c8a3d,_0x55e676){return db[_0x35ad('0x34')][_0x35ad('0x36')](_0x1c8a3d[_0x35ad('0x37')],{})[_0x35ad('0x23')](respondWithResult(_0x55e676,0xc9))[_0x35ad('0x35')](handleError(_0x55e676,null));};exports[_0x35ad('0x22')]=function(_0x49c33d,_0x58250d){if(_0x49c33d[_0x35ad('0x37')]['id']){delete _0x49c33d[_0x35ad('0x37')]['id'];}return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x49c33d[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x58250d,null))[_0x35ad('0x23')](saveUpdates(_0x49c33d[_0x35ad('0x37')],null))[_0x35ad('0x23')](respondWithResult(_0x58250d,null))['catch'](handleError(_0x58250d,null));};exports[_0x35ad('0x24')]=function(_0x4f975b,_0x25e63e){return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x4f975b[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x25e63e,null))[_0x35ad('0x23')](removeEntity(_0x25e63e,null))[_0x35ad('0x35')](handleError(_0x25e63e,null));}; \ No newline at end of file +var _0xcb66=['include','merge','options','find','catch','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','end','name','send','show','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xcb66,0x19f));var _0x6cb6=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xcb66[_0x19dd7a];return _0x3feb6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cb6('0x0'));var zipdir=require(_0x6cb6('0x1'));var jsonpatch=require(_0x6cb6('0x2'));var rp=require(_0x6cb6('0x3'));var moment=require(_0x6cb6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6cb6('0x5'));var util=require(_0x6cb6('0x6'));var path=require(_0x6cb6('0x7'));var sox=require(_0x6cb6('0x8'));var csv=require(_0x6cb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0x9'));var querystring=require(_0x6cb6('0xf'));var Papa=require(_0x6cb6('0x10'));var Redis=require(_0x6cb6('0x11'));var authService=require(_0x6cb6('0x12'));var qs=require(_0x6cb6('0x13'));var as=require(_0x6cb6('0x14'));var hardwareService=require(_0x6cb6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cb6('0x16'));var db=require(_0x6cb6('0x17'))['db'];function respondWithStatusCode(_0xad49d9,_0x2604e7){_0x2604e7=_0x2604e7||0xcc;return function(_0x585233){if(_0x585233){return _0xad49d9[_0x6cb6('0x18')](_0x2604e7);}return _0xad49d9[_0x6cb6('0x19')](_0x2604e7)['end']();};}function respondWithResult(_0x1e5468,_0x14a581){_0x14a581=_0x14a581||0xc8;return function(_0x5af476){if(_0x5af476){return _0x1e5468[_0x6cb6('0x19')](_0x14a581)[_0x6cb6('0x1a')](_0x5af476);}};}function respondWithFilteredResult(_0x492629,_0x5ab865){return function(_0x505b4d){if(_0x505b4d){var _0x5dd4cd=typeof _0x5ab865[_0x6cb6('0x1b')]===_0x6cb6('0x1c')&&typeof _0x5ab865[_0x6cb6('0x1d')]===_0x6cb6('0x1c');var _0x432e48=_0x505b4d[_0x6cb6('0x1e')];var _0x5b8a17=_0x5dd4cd?0x0:_0x5ab865[_0x6cb6('0x1b')];var _0xc0bdea=_0x5dd4cd?_0x505b4d['count']:_0x5ab865['offset']+_0x5ab865['limit'];var _0x5b5dab;if(_0xc0bdea>=_0x432e48){_0xc0bdea=_0x432e48;_0x5b5dab=0xc8;}else{_0x5b5dab=0xce;}_0x492629['status'](_0x5b5dab);return _0x492629['set'](_0x6cb6('0x1f'),_0x5b8a17+'-'+_0xc0bdea+'/'+_0x432e48)[_0x6cb6('0x1a')](_0x505b4d);}return null;};}function patchUpdates(_0x407455){return function(_0x2d41c4){try{jsonpatch[_0x6cb6('0x20')](_0x2d41c4,_0x407455,!![]);}catch(_0x5e14c8){return BPromise['reject'](_0x5e14c8);}return _0x2d41c4[_0x6cb6('0x21')]();};}function saveUpdates(_0x1d35d1,_0x1c4bcd){return function(_0x153915){if(_0x153915){return _0x153915['update'](_0x1d35d1)[_0x6cb6('0x22')](function(_0x19837e){return _0x19837e;});}return null;};}function removeEntity(_0x58a6ed,_0x5ad4f2){return function(_0xea5ee5){if(_0xea5ee5){return _0xea5ee5['destroy']()[_0x6cb6('0x22')](function(){_0x58a6ed[_0x6cb6('0x19')](0xcc)[_0x6cb6('0x23')]();});}};}function handleEntityNotFound(_0x18ecb9,_0x299830){return function(_0x16db1d){if(!_0x16db1d){_0x18ecb9[_0x6cb6('0x18')](0x194);}return _0x16db1d;};}function handleError(_0xcae6af,_0x1cc1ed){_0x1cc1ed=_0x1cc1ed||0x1f4;return function(_0x112e47){logger['error'](_0x112e47['stack']);if(_0x112e47['name']){delete _0x112e47[_0x6cb6('0x24')];}_0xcae6af[_0x6cb6('0x19')](_0x1cc1ed)[_0x6cb6('0x25')](_0x112e47);};}exports[_0x6cb6('0x26')]=function(_0x1f8c9d,_0x3b62e6){var _0x57cd74={'raw':!![],'where':{'id':_0x1f8c9d['params']['id']}},_0x124291={};_0x124291[_0x6cb6('0x27')]=_['keys'](db[_0x6cb6('0x28')][_0x6cb6('0x29')]);_0x124291[_0x6cb6('0x2a')]=_['keys'](_0x1f8c9d[_0x6cb6('0x2a')]);_0x124291[_0x6cb6('0x2b')]=_[_0x6cb6('0x2c')](_0x124291['model'],_0x124291[_0x6cb6('0x2a')]);_0x57cd74[_0x6cb6('0x2d')]=_[_0x6cb6('0x2c')](_0x124291['model'],qs[_0x6cb6('0x2e')](_0x1f8c9d[_0x6cb6('0x2a')]['fields']));_0x57cd74[_0x6cb6('0x2d')]=_0x57cd74[_0x6cb6('0x2d')][_0x6cb6('0x2f')]?_0x57cd74[_0x6cb6('0x2d')]:_0x124291[_0x6cb6('0x27')];if(_0x1f8c9d[_0x6cb6('0x2a')][_0x6cb6('0x30')]){_0x57cd74[_0x6cb6('0x31')]=[{'all':!![]}];}_0x57cd74=_[_0x6cb6('0x32')]({},_0x57cd74,_0x1f8c9d[_0x6cb6('0x33')]);return db['ChatProactiveAction'][_0x6cb6('0x34')](_0x57cd74)[_0x6cb6('0x22')](handleEntityNotFound(_0x3b62e6,null))[_0x6cb6('0x22')](respondWithResult(_0x3b62e6,null))[_0x6cb6('0x35')](handleError(_0x3b62e6,null));};exports['create']=function(_0x558494,_0x59dd76){return db[_0x6cb6('0x28')][_0x6cb6('0x36')](_0x558494[_0x6cb6('0x37')],{})[_0x6cb6('0x22')](respondWithResult(_0x59dd76,0xc9))[_0x6cb6('0x35')](handleError(_0x59dd76,null));};exports[_0x6cb6('0x38')]=function(_0x317c84,_0x950248){if(_0x317c84['body']['id']){delete _0x317c84[_0x6cb6('0x37')]['id'];}return db['ChatProactiveAction'][_0x6cb6('0x34')]({'where':{'id':_0x317c84[_0x6cb6('0x39')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x950248,null))[_0x6cb6('0x22')](saveUpdates(_0x317c84[_0x6cb6('0x37')],null))[_0x6cb6('0x22')](respondWithResult(_0x950248,null))[_0x6cb6('0x35')](handleError(_0x950248,null));};exports['destroy']=function(_0x45a2d5,_0x58a304){return db[_0x6cb6('0x28')][_0x6cb6('0x34')]({'where':{'id':_0x45a2d5[_0x6cb6('0x39')]['id']}})['then'](handleEntityNotFound(_0x58a304,null))['then'](removeEntity(_0x58a304,null))[_0x6cb6('0x35')](handleError(_0x58a304,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c074c2f..d458037 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 _0x14c6=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14c6,0x149));var _0x614c=function(_0x4212c9,_0x4d5e11){_0x4212c9=_0x4212c9-0x0;var _0x3ba13f=_0x14c6[_0x4212c9];return _0x3ba13f;};'use strict';var _=require('lodash');var util=require(_0x614c('0x0'));var logger=require(_0x614c('0x1'))('api');var moment=require(_0x614c('0x2'));var BPromise=require(_0x614c('0x3'));var rp=require(_0x614c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x614c('0x5'));var config=require(_0x614c('0x6'));var attributes=require(_0x614c('0x7'));module[_0x614c('0x8')]=function(_0x4a8a4e,_0x45aa47){return _0x4a8a4e['define'](_0x614c('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24a2=['moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','lodash','util','api'];(function(_0xdede30,_0x2df45b){var _0x32edc0=function(_0x54e624){while(--_0x54e624){_0xdede30['push'](_0xdede30['shift']());}};_0x32edc0(++_0x2df45b);}(_0x24a2,0x1dd));var _0x224a=function(_0x5c783d,_0x30cb4f){_0x5c783d=_0x5c783d-0x0;var _0x3e58ba=_0x24a2[_0x5c783d];return _0x3e58ba;};'use strict';var _=require(_0x224a('0x0'));var util=require(_0x224a('0x1'));var logger=require('../../config/logger')(_0x224a('0x2'));var moment=require(_0x224a('0x3'));var BPromise=require(_0x224a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x224a('0x5'));var rimraf=require(_0x224a('0x6'));var config=require(_0x224a('0x7'));var attributes=require(_0x224a('0x8'));module[_0x224a('0x9')]=function(_0x24b9a1,_0xcbebc3){return _0x24b9a1['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 bf8225f..cef0812 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 _0x0698=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring'];(function(_0x2c18f5,_0x6ca4d9){var _0x347ae4=function(_0x16fde2){while(--_0x16fde2){_0x2c18f5['push'](_0x2c18f5['shift']());}};_0x347ae4(++_0x6ca4d9);}(_0x0698,0xc4));var _0x8069=function(_0x1408b4,_0x22e866){_0x1408b4=_0x1408b4-0x0;var _0x39276b=_0x0698[_0x1408b4];return _0x39276b;};'use strict';var _=require('lodash');var util=require(_0x8069('0x0'));var moment=require(_0x8069('0x1'));var BPromise=require(_0x8069('0x2'));var rs=require(_0x8069('0x3'));var fs=require('fs');var Redis=require(_0x8069('0x4'));var db=require(_0x8069('0x5'))['db'];var utils=require(_0x8069('0x6'));var logger=require(_0x8069('0x7'))(_0x8069('0x8'));var config=require(_0x8069('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8069('0xa')][_0x8069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x653c3a,_0x1780d6,_0x33e6d2){return new BPromise(function(_0x3a0ae1,_0xd5e58a){return client[_0x8069('0xc')](_0x653c3a,_0x33e6d2)[_0x8069('0xd')](function(_0x3074e9){logger[_0x8069('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,_0x8069('0xf'));logger[_0x8069('0x10')](_0x8069('0x11'),_0x1780d6,_0x8069('0xf'),JSON[_0x8069('0x12')](_0x3074e9));if(_0x3074e9[_0x8069('0x13')]){if(_0x3074e9[_0x8069('0x13')][_0x8069('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,_0x3074e9['error'][_0x8069('0x15')]);return _0xd5e58a(_0x3074e9[_0x8069('0x13')]['message']);}logger[_0x8069('0x13')](_0x8069('0x16'),_0x1780d6,_0x3074e9[_0x8069('0x13')][_0x8069('0x15')]);return _0x3a0ae1(_0x3074e9[_0x8069('0x13')]['message']);}else{logger[_0x8069('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,'request\x20sent');_0x3a0ae1(_0x3074e9[_0x8069('0x17')][_0x8069('0x15')]);}})[_0x8069('0x18')](function(_0x4090d6){logger[_0x8069('0x13')](_0x8069('0x16'),_0x1780d6,_0x4090d6);_0xd5e58a(_0x4090d6);});});} \ No newline at end of file +var _0x05ee=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x05ee,0x1c4));var _0xe05e=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x05ee[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var moment=require(_0xe05e('0x2'));var BPromise=require(_0xe05e('0x3'));var rs=require(_0xe05e('0x4'));var fs=require('fs');var Redis=require(_0xe05e('0x5'));var db=require(_0xe05e('0x6'))['db'];var utils=require(_0xe05e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe05e('0x8'));var jayson=require(_0xe05e('0x9'));var client=jayson[_0xe05e('0xa')][_0xe05e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f1e2,_0x390123,_0x526c53){return new BPromise(function(_0x4afb7f,_0x27fa27){return client[_0xe05e('0xc')](_0x31f1e2,_0x526c53)[_0xe05e('0xd')](function(_0x2a5b58){logger[_0xe05e('0xe')](_0xe05e('0xf'),_0x390123,'request\x20sent');logger[_0xe05e('0x10')](_0xe05e('0x11'),_0x390123,_0xe05e('0x12'),JSON[_0xe05e('0x13')](_0x2a5b58));if(_0x2a5b58[_0xe05e('0x14')]){if(_0x2a5b58[_0xe05e('0x14')][_0xe05e('0x15')]===0x1f4){logger[_0xe05e('0x14')](_0xe05e('0xf'),_0x390123,_0x2a5b58[_0xe05e('0x14')]['message']);return _0x27fa27(_0x2a5b58['error'][_0xe05e('0x16')]);}logger['error'](_0xe05e('0xf'),_0x390123,_0x2a5b58['error'][_0xe05e('0x16')]);return _0x4afb7f(_0x2a5b58['error']['message']);}else{logger[_0xe05e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x390123,_0xe05e('0x12'));_0x4afb7f(_0x2a5b58[_0xe05e('0x17')][_0xe05e('0x16')]);}})[_0xe05e('0x18')](function(_0x5a6ac5){logger[_0xe05e('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x390123,_0x5a6ac5);_0x27fa27(_0x5a6ac5);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 500dc41..bd9e811 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2260a0,_0x2cb170){var _0x3978d7=function(_0x30844d){while(--_0x30844d){_0x2260a0['push'](_0x2260a0['shift']());}};_0x3978d7(++_0x2cb170);}(_0x6aa7,0x178));var _0x76aa=function(_0x2512ed,_0x283e80){_0x2512ed=_0x2512ed-0x0;var _0x1debf0=_0x6aa7[_0x2512ed];return _0x1debf0;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router; \ No newline at end of file +var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x367dbd,_0x106eba){var _0x3ddb21=function(_0x1107f5){while(--_0x1107f5){_0x367dbd['push'](_0x367dbd['shift']());}};_0x3ddb21(++_0x106eba);}(_0x1cb9,0x14e));var _0x91cb=function(_0x33a2e3,_0x12e5a3){_0x33a2e3=_0x33a2e3-0x0;var _0xce0f1f=_0x1cb9[_0x33a2e3];return _0xce0f1f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('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 e6aad3b..b465cf3 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 _0x7101=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7101,0x78));var _0x1710=function(_0x46b0ba,_0x5a767c){_0x46b0ba=_0x46b0ba-0x0;var _0x2e53e0=_0x7101[_0x46b0ba];return _0x2e53e0;};'use strict';var Sequelize=require(_0x1710('0x0'));module[_0x1710('0x1')]={'name':{'type':Sequelize[_0x1710('0x2')],'unique':_0x1710('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1710('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1710('0x5')](_0x1710('0x6'),_0x1710('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xc299=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x177cc9,_0x3f6fdd){var _0x2fe577=function(_0xa98e83){while(--_0xa98e83){_0x177cc9['push'](_0x177cc9['shift']());}};_0x2fe577(++_0x3f6fdd);}(_0xc299,0xe0));var _0x9c29=function(_0x584d37,_0x13fb20){_0x584d37=_0x584d37-0x0;var _0x1a1dbf=_0xc299[_0x584d37];return _0x1a1dbf;};'use strict';var Sequelize=require(_0x9c29('0x0'));module[_0x9c29('0x1')]={'name':{'type':Sequelize[_0x9c29('0x2')],'unique':_0x9c29('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9c29('0x2')]},'timeout':{'type':Sequelize[_0x9c29('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9c29('0x5')](_0x9c29('0x6'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 48914cc..098e045 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 _0x4990=['updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','findAll','User','findAndCountAll','UserId','agent','chatPause'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x4990,0xc8));var _0x0499=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0x4990[_0x3074f1];return _0x149af8;};'use strict';var emlformat=require(_0x0499('0x0'));var rimraf=require(_0x0499('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0499('0x2'));var rp=require(_0x0499('0x3'));var moment=require(_0x0499('0x4'));var BPromise=require(_0x0499('0x5'));var Mustache=require(_0x0499('0x6'));var util=require('util');var path=require(_0x0499('0x7'));var sox=require(_0x0499('0x8'));var csv=require(_0x0499('0x9'));var ejs=require(_0x0499('0xa'));var fs=require('fs');var fs_extra=require(_0x0499('0xb'));var _=require('lodash');var squel=require(_0x0499('0xc'));var crypto=require(_0x0499('0xd'));var jsforce=require(_0x0499('0xe'));var deskjs=require(_0x0499('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0499('0x10'));var Papa=require('papaparse');var Redis=require(_0x0499('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0499('0x12'));var as=require(_0x0499('0x13'));var hardwareService=require(_0x0499('0x14'));var logger=require(_0x0499('0x15'))(_0x0499('0x16'));var utils=require(_0x0499('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0499('0x18'));var db=require(_0x0499('0x19'))['db'];config[_0x0499('0x1a')]=_[_0x0499('0x1b')](config[_0x0499('0x1a')],{'host':_0x0499('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0499('0x1a')]));require(_0x0499('0x1d'))['register'](socket);var jayson=require(_0x0499('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dde1c,_0x376b70,_0x34fe20,_0x247e9a){return new BPromise(function(_0x4ad0d6,_0x40af46){var _0x5e82cb=_0x247e9a||client;return _0x5e82cb[_0x0499('0x1f')](_0x4dde1c,_0x34fe20)[_0x0499('0x20')](function(_0x4fc9a5){logger[_0x0499('0x21')](_0x0499('0x22'),_0x376b70,_0x0499('0x23'));logger[_0x0499('0x24')](_0x0499('0x25'),_0x376b70,_0x0499('0x23'),JSON[_0x0499('0x26')](_0x4fc9a5));if(_0x4fc9a5[_0x0499('0x27')]){if(_0x4fc9a5[_0x0499('0x27')][_0x0499('0x28')]===0x1f4){logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);return _0x40af46(_0x4fc9a5['error']['message']);}logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);return _0x4ad0d6(_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);}else{logger[_0x0499('0x21')](_0x0499('0x22'),_0x376b70,_0x0499('0x23'));_0x4ad0d6(_0x4fc9a5['result'][_0x0499('0x29')]);}})[_0x0499('0x2a')](function(_0x1c9d32){logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x1c9d32);_0x40af46(_0x1c9d32);});});}function respondWithStatusCode(_0x57f193,_0x1dacfc){_0x1dacfc=_0x1dacfc||0xcc;return function(_0x4d97cb){if(_0x4d97cb){return _0x57f193['sendStatus'](_0x1dacfc);}return _0x57f193['status'](_0x1dacfc)['end']();};}function respondWithResult(_0xbd27d4,_0x2b58c5){_0x2b58c5=_0x2b58c5||0xc8;return function(_0x3f3d2b){if(_0x3f3d2b){return _0xbd27d4[_0x0499('0x2b')](_0x2b58c5)[_0x0499('0x2c')](_0x3f3d2b);}};}function respondWithFilteredResult(_0x9819d,_0x69acad){return function(_0xfd548f){if(_0xfd548f){var _0x330c91=typeof _0x69acad[_0x0499('0x2d')]===_0x0499('0x2e')&&typeof _0x69acad[_0x0499('0x2f')]===_0x0499('0x2e');var _0x3ebc1c=_0xfd548f[_0x0499('0x30')];var _0x3457da=_0x330c91?0x0:_0x69acad[_0x0499('0x2d')];var _0x54f9be=_0x330c91?_0xfd548f[_0x0499('0x30')]:_0x69acad[_0x0499('0x2d')]+_0x69acad[_0x0499('0x2f')];var _0x111ce;if(_0x54f9be>=_0x3ebc1c){_0x54f9be=_0x3ebc1c;_0x111ce=0xc8;}else{_0x111ce=0xce;}_0x9819d[_0x0499('0x2b')](_0x111ce);return _0x9819d[_0x0499('0x31')](_0x0499('0x32'),_0x3457da+'-'+_0x54f9be+'/'+_0x3ebc1c)[_0x0499('0x2c')](_0xfd548f);}return null;};}function patchUpdates(_0x10f389){return function(_0x54989d){try{jsonpatch['apply'](_0x54989d,_0x10f389,!![]);}catch(_0x2630ad){return BPromise['reject'](_0x2630ad);}return _0x54989d['save']();};}function saveUpdates(_0x35a2f0,_0x403dd8){return function(_0x5ef86b){if(_0x5ef86b){return _0x5ef86b[_0x0499('0x33')](_0x35a2f0)[_0x0499('0x20')](function(_0x2dd210){return _0x2dd210;});}return null;};}function removeEntity(_0x3bbc8f,_0x3b9cbb){return function(_0x33e01c){if(_0x33e01c){return _0x33e01c['destroy']()['then'](function(){var _0x232e4d=_0x33e01c[_0x0499('0x34')]({'plain':!![]});var _0x328cfe=_0x0499('0x35');return db[_0x0499('0x36')][_0x0499('0x37')]({'where':{'type':_0x328cfe,'resourceId':_0x232e4d['id']}})[_0x0499('0x20')](function(){return _0x33e01c;});})[_0x0499('0x20')](function(){_0x3bbc8f[_0x0499('0x2b')](0xcc)[_0x0499('0x38')]();});}};}function handleEntityNotFound(_0x388db9,_0x1f2008){return function(_0x47dd58){if(!_0x47dd58){_0x388db9[_0x0499('0x39')](0x194);}return _0x47dd58;};}function handleError(_0x1bf257,_0x232d37){_0x232d37=_0x232d37||0x1f4;return function(_0x32e764){logger['error'](_0x32e764[_0x0499('0x3a')]);if(_0x32e764[_0x0499('0x3b')]){delete _0x32e764[_0x0499('0x3b')];}_0x1bf257[_0x0499('0x2b')](_0x232d37)[_0x0499('0x3c')](_0x32e764);};}exports[_0x0499('0x3d')]=function(_0x1d2037,_0x5b858a){var _0x45c6e2={},_0x5ab8bf={},_0x594d59={'count':0x0,'rows':[]};var _0x1f7a71=_[_0x0499('0x3e')](db[_0x0499('0x3f')][_0x0499('0x40')],function(_0x3cd2ba){return{'name':_0x3cd2ba[_0x0499('0x41')],'type':_0x3cd2ba[_0x0499('0x42')][_0x0499('0x43')]};});_0x5ab8bf[_0x0499('0x44')]=_[_0x0499('0x3e')](_0x1f7a71,_0x0499('0x3b'));_0x5ab8bf[_0x0499('0x45')]=_[_0x0499('0x46')](_0x1d2037[_0x0499('0x45')]);_0x5ab8bf['filters']=_[_0x0499('0x47')](_0x5ab8bf['model'],_0x5ab8bf[_0x0499('0x45')]);_0x45c6e2[_0x0499('0x48')]=_[_0x0499('0x47')](_0x5ab8bf['model'],qs[_0x0499('0x49')](_0x1d2037[_0x0499('0x45')]['fields']));_0x45c6e2[_0x0499('0x48')]=_0x45c6e2[_0x0499('0x48')]['length']?_0x45c6e2[_0x0499('0x48')]:_0x5ab8bf[_0x0499('0x44')];if(!_0x1d2037[_0x0499('0x45')][_0x0499('0x4a')](_0x0499('0x4b'))){_0x45c6e2[_0x0499('0x2f')]=qs['limit'](_0x1d2037['query'][_0x0499('0x2f')]);_0x45c6e2['offset']=qs['offset'](_0x1d2037['query'][_0x0499('0x2d')]);}_0x45c6e2[_0x0499('0x4c')]=qs[_0x0499('0x4d')](_0x1d2037['query'][_0x0499('0x4d')]);_0x45c6e2[_0x0499('0x4e')]=qs['filters'](_[_0x0499('0x4f')](_0x1d2037[_0x0499('0x45')],_0x5ab8bf['filters']),_0x1f7a71);if(_0x1d2037[_0x0499('0x45')][_0x0499('0x50')]){_0x45c6e2[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x45c6e2[_0x0499('0x4e')],{'$or':_['map'](_0x1f7a71,function(_0x163ea6){if(_0x163ea6['type']!==_0x0499('0x52')){var _0x557600={};_0x557600[_0x163ea6['name']]={'$like':'%'+_0x1d2037[_0x0499('0x45')][_0x0499('0x50')]+'%'};return _0x557600;}})});}_0x45c6e2=_[_0x0499('0x51')]({},_0x45c6e2,_0x1d2037['options']);var _0x54a6f0={'where':_0x45c6e2[_0x0499('0x4e')]};return db[_0x0499('0x3f')][_0x0499('0x30')](_0x54a6f0)[_0x0499('0x20')](function(_0x492c21){_0x594d59[_0x0499('0x30')]=_0x492c21;if(_0x1d2037[_0x0499('0x45')][_0x0499('0x53')]){_0x45c6e2['include']=[{'all':!![]}];}return db[_0x0499('0x3f')]['findAll'](_0x45c6e2);})[_0x0499('0x20')](function(_0x106237){_0x594d59[_0x0499('0x54')]=_0x106237;return _0x594d59;})[_0x0499('0x20')](respondWithFilteredResult(_0x5b858a,_0x45c6e2))[_0x0499('0x2a')](handleError(_0x5b858a,null));};exports[_0x0499('0x55')]=function(_0x2a8e93,_0x1c2943){var _0x146909={'raw':!![],'where':{'id':_0x2a8e93[_0x0499('0x56')]['id']}},_0x55c976={};_0x55c976[_0x0499('0x44')]=_['keys'](db[_0x0499('0x3f')][_0x0499('0x40')]);_0x55c976[_0x0499('0x45')]=_[_0x0499('0x46')](_0x2a8e93[_0x0499('0x45')]);_0x55c976['filters']=_[_0x0499('0x47')](_0x55c976['model'],_0x55c976[_0x0499('0x45')]);_0x146909[_0x0499('0x48')]=_[_0x0499('0x47')](_0x55c976[_0x0499('0x44')],qs[_0x0499('0x49')](_0x2a8e93[_0x0499('0x45')][_0x0499('0x49')]));_0x146909['attributes']=_0x146909['attributes'][_0x0499('0x57')]?_0x146909[_0x0499('0x48')]:_0x55c976[_0x0499('0x44')];if(_0x2a8e93[_0x0499('0x45')][_0x0499('0x53')]){_0x146909['include']=[{'all':!![]}];}_0x146909=_[_0x0499('0x51')]({},_0x146909,_0x2a8e93[_0x0499('0x58')]);return db[_0x0499('0x3f')][_0x0499('0x59')](_0x146909)[_0x0499('0x20')](handleEntityNotFound(_0x1c2943,null))[_0x0499('0x20')](respondWithResult(_0x1c2943,null))[_0x0499('0x2a')](handleError(_0x1c2943,null));};exports[_0x0499('0x5a')]=function(_0x2befbd,_0x288b0f){return db[_0x0499('0x3f')]['create'](_0x2befbd[_0x0499('0x5b')],{})[_0x0499('0x20')](function(_0x4cba88){var _0x5ec53d=_0x2befbd['user'][_0x0499('0x34')]({'plain':!![]});if(!_0x5ec53d)throw new Error(_0x0499('0x5c'));if(_0x5ec53d[_0x0499('0x5d')]==='user'){var _0x30c44c=_0x4cba88[_0x0499('0x34')]({'plain':!![]});var _0x2b5ce9=_0x0499('0x35');return db[_0x0499('0x5e')]['find']({'where':{'name':_0x2b5ce9,'userProfileId':_0x5ec53d['userProfileId']},'raw':!![]})[_0x0499('0x20')](function(_0x4a7706){if(_0x4a7706&&_0x4a7706[_0x0499('0x5f')]===0x0){return db[_0x0499('0x36')]['create']({'name':_0x30c44c[_0x0499('0x3b')],'resourceId':_0x30c44c['id'],'type':_0x4a7706['name'],'sectionId':_0x4a7706['id']},{})[_0x0499('0x20')](function(){return _0x4cba88;});}else{return _0x4cba88;}})['catch'](function(_0x2d9078){logger[_0x0499('0x27')](_0x0499('0x60'),_0x2d9078);throw _0x2d9078;});}return _0x4cba88;})[_0x0499('0x20')](respondWithResult(_0x288b0f,0xc9))[_0x0499('0x2a')](handleError(_0x288b0f,null));};exports[_0x0499('0x33')]=function(_0x40a438,_0x43f1f7){if(_0x40a438[_0x0499('0x5b')]['id']){delete _0x40a438['body']['id'];}return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x40a438[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x43f1f7,null))['then'](saveUpdates(_0x40a438[_0x0499('0x5b')],null))[_0x0499('0x20')](respondWithResult(_0x43f1f7,null))[_0x0499('0x2a')](handleError(_0x43f1f7,null));};exports['destroy']=function(_0x5ee89d,_0x52ab71){return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x5ee89d[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x52ab71,null))['then'](removeEntity(_0x52ab71,null))['catch'](handleError(_0x52ab71,null));};exports[_0x0499('0x61')]=function(_0x200b83,_0x1f5989){return db[_0x0499('0x3f')][_0x0499('0x61')]()[_0x0499('0x20')](respondWithResult(_0x1f5989,null))[_0x0499('0x2a')](handleError(_0x1f5989,null));};exports[_0x0499('0x62')]=function(_0x2ac0ca,_0x1bcbb3,_0x11cabc){var _0x524aed={'raw':!![],'where':{}},_0x1d3680={},_0x3148ba;return db['ChatQueue'][_0x0499('0x63')]({'where':{'id':_0x2ac0ca[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x1bcbb3,null))['then'](function(_0x1e0050){if(_0x1e0050){_0x3148ba=_0x1e0050[_0x0499('0x34')]({'plain':!![]});_0x1d3680['model']=_['keys'](db[_0x0499('0x64')][_0x0499('0x40')]);_0x1d3680['query']=_[_0x0499('0x46')](_0x2ac0ca[_0x0499('0x45')]);_0x1d3680[_0x0499('0x65')]=_[_0x0499('0x47')](_0x1d3680[_0x0499('0x44')],_0x1d3680[_0x0499('0x45')]);_0x524aed['attributes']=_[_0x0499('0x47')](_0x1d3680[_0x0499('0x44')],qs[_0x0499('0x49')](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x49')]));_0x524aed[_0x0499('0x48')]=_0x524aed[_0x0499('0x48')][_0x0499('0x57')]?_0x524aed[_0x0499('0x48')]:_0x1d3680['model'];if(!_0x2ac0ca[_0x0499('0x45')][_0x0499('0x4a')](_0x0499('0x4b'))){_0x524aed['limit']=qs['limit'](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x2f')]);_0x524aed['offset']=qs[_0x0499('0x2d')](_0x2ac0ca['query'][_0x0499('0x2d')]);}_0x524aed['order']=qs[_0x0499('0x4d')](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x4d')]);_0x524aed[_0x0499('0x4e')]=qs[_0x0499('0x65')](_[_0x0499('0x4f')](_0x2ac0ca[_0x0499('0x45')],_0x1d3680['filters']));_0x524aed[_0x0499('0x4e')]['ChatQueueId']=_0x1e0050['id'];if(_0x2ac0ca[_0x0499('0x45')][_0x0499('0x50')]){_0x524aed[_0x0499('0x4e')]=_['merge'](_0x524aed['where'],{'$or':_[_0x0499('0x3e')](_0x524aed[_0x0499('0x48')],function(_0x6e5528){var _0x355da0={};_0x355da0[_0x6e5528]={'$like':'%'+_0x2ac0ca['query'][_0x0499('0x50')]+'%'};return _0x355da0;})});}_0x524aed=_[_0x0499('0x51')]({},_0x524aed,_0x2ac0ca[_0x0499('0x58')]);return db[_0x0499('0x64')][_0x0499('0x66')](_0x524aed);}})[_0x0499('0x20')](function(_0x1f50f8){if(_0x1f50f8){return db[_0x0499('0x67')][_0x0499('0x68')]({'where':{'id':_[_0x0499('0x3e')](_0x1f50f8,_0x0499('0x69')),'role':_0x0499('0x6a')},'attributes':['id','name',_0x0499('0x6b'),_0x0499('0x6c'),_0x0499('0x6d')]});}})[_0x0499('0x20')](function(_0x2c8743){if(_0x2c8743){return{'count':_0x2c8743[_0x0499('0x30')],'rows':_[_0x0499('0x3e')](_0x2c8743['rows'],function(_0x2d2b13){return{'membername':_0x2d2b13[_0x0499('0x3b')],'UserId':_0x2d2b13['id'],'queue_name':_0x3148ba[_0x0499('0x3b')],'ChatQueueId':_0x3148ba['id'],'interface':util['format']('%s/%s',_0x0499('0x6e'),_0x2d2b13['name']),'penalty':0x0,'paused':_0x2d2b13[_0x0499('0x6b')],'createdAt':_0x2d2b13[_0x0499('0x6d')],'updatedAt':_0x2d2b13[_0x0499('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0499('0x20')](respondWithFilteredResult(_0x1bcbb3,_0x524aed))[_0x0499('0x2a')](handleError(_0x1bcbb3,null));};exports[_0x0499('0x6f')]=function(_0x27b607,_0x43905e,_0x47826b){var _0x30e822={};var _0xc69f27={};var _0x4851a7;var _0x5711da;return db['ChatQueue'][_0x0499('0x63')]({'where':{'id':_0x27b607[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x43905e,null))[_0x0499('0x20')](function(_0x26a6e0){if(_0x26a6e0){_0x4851a7=_0x26a6e0;_0xc69f27[_0x0499('0x44')]=_[_0x0499('0x46')](db[_0x0499('0x70')][_0x0499('0x40')]);_0xc69f27[_0x0499('0x45')]=_['keys'](_0x27b607[_0x0499('0x45')]);_0xc69f27[_0x0499('0x65')]=_[_0x0499('0x47')](_0xc69f27[_0x0499('0x44')],_0xc69f27[_0x0499('0x45')]);_0x30e822[_0x0499('0x48')]=_[_0x0499('0x47')](_0xc69f27[_0x0499('0x44')],qs['fields'](_0x27b607[_0x0499('0x45')][_0x0499('0x49')]));_0x30e822[_0x0499('0x48')]=_0x30e822[_0x0499('0x48')][_0x0499('0x57')]?_0x30e822[_0x0499('0x48')]:_0xc69f27[_0x0499('0x44')];_0x30e822[_0x0499('0x4c')]=qs['sort'](_0x27b607[_0x0499('0x45')]['sort']);_0x30e822[_0x0499('0x4e')]=qs[_0x0499('0x65')](_[_0x0499('0x4f')](_0x27b607[_0x0499('0x45')],_0xc69f27[_0x0499('0x65')]));if(_0x27b607[_0x0499('0x45')][_0x0499('0x50')]){_0x30e822[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x30e822['where'],{'$or':_['map'](_0x30e822[_0x0499('0x48')],function(_0x606270){var _0x1678db={};_0x1678db[_0x606270]={'$like':'%'+_0x27b607[_0x0499('0x45')]['filter']+'%'};return _0x1678db;})});}_0x30e822=_[_0x0499('0x51')]({},_0x30e822,_0x27b607[_0x0499('0x58')]);return _0x4851a7[_0x0499('0x6f')](_0x30e822);}})[_0x0499('0x20')](function(_0x2d1c65){if(_0x2d1c65){_0x5711da=_0x2d1c65[_0x0499('0x57')];if(!_0x27b607[_0x0499('0x45')]['hasOwnProperty'](_0x0499('0x4b'))){_0x30e822[_0x0499('0x2f')]=qs[_0x0499('0x2f')](_0x27b607[_0x0499('0x45')][_0x0499('0x2f')]);_0x30e822[_0x0499('0x2d')]=qs[_0x0499('0x2d')](_0x27b607['query']['offset']);}return _0x4851a7['getTeams'](_0x30e822);}})['then'](function(_0x39d9e2){if(_0x39d9e2){return _0x39d9e2?{'count':_0x5711da,'rows':_0x39d9e2}:null;}})['then'](respondWithResult(_0x43905e,null))['catch'](handleError(_0x43905e,null));};exports[_0x0499('0x71')]=function(_0xa3ee62,_0x1193bb,_0x27b0a1){var _0x4b0e84=_0xa3ee62[_0x0499('0x5b')][_0x0499('0x72')];return db[_0x0499('0x70')][_0x0499('0x66')]({'where':{'id':_0x4b0e84},'attributes':['id'],'include':[{'model':db[_0x0499('0x67')],'as':_0x0499('0x73'),'attributes':['id',_0x0499('0x3b'),_0x0499('0x74'),'voicePause',_0x0499('0x75')],'raw':!![]}]})[_0x0499('0x20')](function(_0x4e27d4){if(_0x4e27d4){var _0x329779=_[_0x0499('0x76')](_0x4e27d4,function(_0x575a47){var _0xb73530=_0x575a47[_0x0499('0x34')]({'plain':!![]});return _0xb73530[_0x0499('0x73')];});return db[_0x0499('0x3f')]['find']({'where':{'id':_0xa3ee62[_0x0499('0x56')]['id']}})[_0x0499('0x20')](function(_0x16b231){return db[_0x0499('0x77')][_0x0499('0x78')](function(_0x3abe2b){return _0x16b231[_0x0499('0x71')](_0x4b0e84,{'transaction':_0x3abe2b})[_0x0499('0x20')](function(){return BPromise[_0x0499('0x79')](_0x329779,function(_0x5e8def){return db[_0x0499('0x64')][_0x0499('0x7a')]({'where':{'UserId':_0x5e8def['id'],'ChatQueueId':_0xa3ee62[_0x0499('0x56')]['id']},'transaction':_0x3abe2b});});})[_0x0499('0x20')](function(){_0x329779[_0x0499('0x7b')](function(_0x59d462){socket[_0x0499('0x7c')](_0x0499('0x7d'),{'UserId':_0x59d462['id'],'ChatQueueId':_0x16b231['id']});});});});});}})[_0x0499('0x20')](respondWithStatusCode(_0x1193bb,null))[_0x0499('0x2a')](handleError(_0x1193bb,null));};exports[_0x0499('0x7e')]=function(_0x524b07,_0x45cc1b,_0x53817b){return db[_0x0499('0x70')]['findAll']({'where':{'id':_0x524b07[_0x0499('0x45')][_0x0499('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0499('0x67')],'as':_0x0499('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x45cc1b,null))[_0x0499('0x20')](function(_0x967c49){var _0x52de6a=_[_0x0499('0x3e')](_0x967c49,'id');var _0x49ac44=[];var _0x7ff5c=[];var _0x317de2=squel[_0x0499('0x7f')]();_0x317de2[_0x0499('0x80')](_0x0499('0x81'))[_0x0499('0x82')](_0x0499('0x83'),'tq')[_0x0499('0x84')](_0x0499('0x85'),'ut',_0x0499('0x86'))[_0x0499('0x4e')](_0x0499('0x87'),_0x524b07[_0x0499('0x56')]['id']);for(var _0x4f08b8=0x0;_0x4f08b8<_0x967c49[_0x0499('0x57')];_0x4f08b8+=0x1){let _0x1a839f=_0x967c49[_0x4f08b8];for(var _0x4131bb=0x0;_0x4131bb<_0x1a839f['Agents'][_0x0499('0x57')];_0x4131bb+=0x1){let _0x49dda4=_0x1a839f['Agents'][_0x4131bb];var _0x52b9e8=_0x317de2['clone']();_0x52b9e8[_0x0499('0x4e')](_0x0499('0x88'),_0x49dda4['id']);_0x7ff5c[_0x0499('0x89')](db['sequelize'][_0x0499('0x45')](_0x52b9e8['toString'](),{'type':db[_0x0499('0x77')][_0x0499('0x8a')][_0x0499('0x8b')]})['then'](function(_0x519479){if(_0x519479[_0x0499('0x57')]===0x1){return _0x49dda4['id'];}else{var _0x125683=_[_0x0499('0x8c')](_['map'](_0x519479,'TeamId'),function(_0x28d7ad){return _[_0x0499('0x8d')](_0x52de6a,_0x28d7ad);});if(_0x125683){return _0x49dda4['id'];}}}));}}return BPromise[_0x0499('0x8e')](_0x7ff5c)[_0x0499('0x20')](function(_0x50dd95){_0x49ac44=_(_0x49ac44)[_0x0499('0x8f')](_0x50dd95)[_0x0499('0x90')]()[_0x0499('0x91')]();return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x524b07['params']['id']}})[_0x0499('0x20')](function(_0x411452){return db[_0x0499('0x77')][_0x0499('0x78')](function(_0x40dab9){return _0x411452[_0x0499('0x7e')](_0x524b07[_0x0499('0x45')][_0x0499('0x72')],{'transaction':_0x40dab9})['then'](function(){if(!_[_0x0499('0x92')](_0x49ac44)){return _0x411452[_0x0499('0x93')](_0x49ac44,{'transaction':_0x40dab9});}})[_0x0499('0x20')](function(){_0x49ac44[_0x0499('0x7b')](function(_0x1b8954){socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':_0x1b8954,'ChatQueueId':_0x411452['id']});});});});});});})['then'](respondWithStatusCode(_0x45cc1b,null))[_0x0499('0x2a')](handleError(_0x45cc1b,null));};exports[_0x0499('0x95')]=function(_0x4a9889,_0x4730ac,_0x172151){return db['ChatQueue'][_0x0499('0x59')]({'where':{'id':_0x4a9889[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x4730ac,null))[_0x0499('0x20')](function(_0x46c4b5){if(_0x46c4b5){return _0x46c4b5[_0x0499('0x95')](_0x4a9889['body'][_0x0499('0x72')],_[_0x0499('0x96')](_0x4a9889[_0x0499('0x5b')],['ids','id'])||{})[_0x0499('0x97')](function(_0x3691ed){for(var _0x4d674a=0x0;_0x4d674a<_0x4a9889[_0x0499('0x5b')][_0x0499('0x72')][_0x0499('0x57')];_0x4d674a+=0x1){socket[_0x0499('0x7c')](_0x0499('0x7d'),{'UserId':Number(_0x4a9889['body'][_0x0499('0x72')][_0x4d674a]),'ChatQueueId':Number(_0x4a9889['params']['id'])});}return _0x3691ed;});}})[_0x0499('0x20')](respondWithResult(_0x4730ac,null))[_0x0499('0x2a')](handleError(_0x4730ac,null));};exports[_0x0499('0x93')]=function(_0x1b7928,_0x1ca036,_0x38a213){return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x1b7928[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ca036,null))['then'](function(_0xa888a3){if(_0xa888a3){return _0xa888a3[_0x0499('0x93')](_0x1b7928[_0x0499('0x45')][_0x0499('0x72')])[_0x0499('0x20')](function(){if(_[_0x0499('0x98')](_0x1b7928[_0x0499('0x45')][_0x0499('0x72')])){for(var _0x48d218=0x0;_0x48d218<_0x1b7928[_0x0499('0x45')]['ids']['length'];_0x48d218+=0x1){socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':Number(_0x1b7928[_0x0499('0x45')][_0x0499('0x72')][_0x48d218]),'ChatQueueId':Number(_0x1b7928[_0x0499('0x56')]['id'])});}}else{socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':Number(_0x1b7928[_0x0499('0x45')][_0x0499('0x72')]),'ChatQueueId':Number(_0x1b7928[_0x0499('0x56')]['id'])});}});}})[_0x0499('0x20')](respondWithStatusCode(_0x1ca036,null))[_0x0499('0x2a')](handleError(_0x1ca036,null));};exports[_0x0499('0x99')]=function(_0x7b912b,_0x32b757,_0x36b422){var _0x2d6d56={};var _0x2ef60b={};var _0x2db2fa;var _0x1d9c48;return db[_0x0499('0x3f')][_0x0499('0x63')]({'where':{'id':_0x7b912b[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x32b757,null))[_0x0499('0x20')](function(_0x588299){if(_0x588299){_0x2db2fa=_0x588299;_0x2ef60b[_0x0499('0x44')]=_['keys'](db[_0x0499('0x67')][_0x0499('0x40')]);_0x2ef60b[_0x0499('0x45')]=_['keys'](_0x7b912b[_0x0499('0x45')]);_0x2ef60b[_0x0499('0x65')]=_[_0x0499('0x47')](_0x2ef60b[_0x0499('0x44')],_0x2ef60b[_0x0499('0x45')]);_0x2d6d56[_0x0499('0x48')]=_['intersection'](_0x2ef60b['model'],qs[_0x0499('0x49')](_0x7b912b[_0x0499('0x45')][_0x0499('0x49')]));_0x2d6d56[_0x0499('0x48')]=_0x2d6d56[_0x0499('0x48')][_0x0499('0x57')]?_0x2d6d56[_0x0499('0x48')]:_0x2ef60b[_0x0499('0x44')];_0x2d6d56[_0x0499('0x4c')]=qs[_0x0499('0x4d')](_0x7b912b['query']['sort']);_0x2d6d56[_0x0499('0x4e')]=qs[_0x0499('0x65')](_['pick'](_0x7b912b[_0x0499('0x45')],_0x2ef60b[_0x0499('0x65')]));if(_0x7b912b[_0x0499('0x45')][_0x0499('0x50')]){_0x2d6d56[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x2d6d56['where'],{'$or':_[_0x0499('0x3e')](_0x2d6d56[_0x0499('0x48')],function(_0x1b75fb){var _0x1a8b78={};_0x1a8b78[_0x1b75fb]={'$like':'%'+_0x7b912b[_0x0499('0x45')][_0x0499('0x50')]+'%'};return _0x1a8b78;})});}_0x2d6d56=_['merge']({},_0x2d6d56,_0x7b912b['options']);return _0x2db2fa[_0x0499('0x99')](_0x2d6d56);}})[_0x0499('0x20')](function(_0x598942){if(_0x598942){_0x1d9c48=_0x598942[_0x0499('0x57')];if(!_0x7b912b[_0x0499('0x45')][_0x0499('0x4a')]('nolimit')){_0x2d6d56[_0x0499('0x2f')]=qs[_0x0499('0x2f')](_0x7b912b[_0x0499('0x45')][_0x0499('0x2f')]);_0x2d6d56[_0x0499('0x2d')]=qs['offset'](_0x7b912b['query']['offset']);}return _0x2db2fa[_0x0499('0x99')](_0x2d6d56);}})['then'](function(_0x407364){if(_0x407364){return _0x407364?{'count':_0x1d9c48,'rows':_0x407364}:null;}})[_0x0499('0x20')](respondWithResult(_0x32b757,null))[_0x0499('0x2a')](handleError(_0x32b757,null));}; \ No newline at end of file +var _0xeeec=['register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','ChatQueue','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','findAll','ids','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','addAgents','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket'];(function(_0x3f4a8e,_0x507c39){var _0x7f68fd=function(_0x29890f){while(--_0x29890f){_0x3f4a8e['push'](_0x3f4a8e['shift']());}};_0x7f68fd(++_0x507c39);}(_0xeeec,0x116));var _0xceee=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xeeec[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0xceee('0x0'));var rimraf=require(_0xceee('0x1'));var zipdir=require(_0xceee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xceee('0x4'));var util=require(_0xceee('0x5'));var path=require(_0xceee('0x6'));var sox=require('sox');var csv=require(_0xceee('0x7'));var ejs=require(_0xceee('0x8'));var fs=require('fs');var fs_extra=require(_0xceee('0x9'));var _=require(_0xceee('0xa'));var squel=require(_0xceee('0xb'));var crypto=require(_0xceee('0xc'));var jsforce=require(_0xceee('0xd'));var deskjs=require(_0xceee('0xe'));var toCsv=require('to-csv');var querystring=require(_0xceee('0xf'));var Papa=require('papaparse');var Redis=require(_0xceee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xceee('0x11'));var as=require(_0xceee('0x12'));var hardwareService=require(_0xceee('0x13'));var logger=require(_0xceee('0x14'))(_0xceee('0x15'));var utils=require(_0xceee('0x16'));var config=require(_0xceee('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xceee('0x18')]=_[_0xceee('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xceee('0x1a'))(new Redis(config[_0xceee('0x18')]));require(_0xceee('0x1b'))[_0xceee('0x1c')](socket);var jayson=require(_0xceee('0x1d'));var client=jayson['client'][_0xceee('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c9c53,_0x3cafb9,_0x4ec92a,_0x18561f){return new BPromise(function(_0x346e27,_0x4a80fd){var _0x3ad780=_0x18561f||client;return _0x3ad780[_0xceee('0x1f')](_0x5c9c53,_0x4ec92a)[_0xceee('0x20')](function(_0x23a16f){logger[_0xceee('0x21')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0xceee('0x22'));logger[_0xceee('0x23')](_0xceee('0x24'),_0x3cafb9,'request\x20sent',JSON[_0xceee('0x25')](_0x23a16f));if(_0x23a16f[_0xceee('0x26')]){if(_0x23a16f[_0xceee('0x26')]['code']===0x1f4){logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);return _0x4a80fd(_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);}logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);return _0x346e27(_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);}else{logger['info'](_0xceee('0x28'),_0x3cafb9,_0xceee('0x22'));_0x346e27(_0x23a16f[_0xceee('0x29')]['message']);}})['catch'](function(_0x5a354a){logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x5a354a);_0x4a80fd(_0x5a354a);});});}function respondWithStatusCode(_0x5c7f8c,_0x34eb31){_0x34eb31=_0x34eb31||0xcc;return function(_0x378117){if(_0x378117){return _0x5c7f8c['sendStatus'](_0x34eb31);}return _0x5c7f8c['status'](_0x34eb31)['end']();};}function respondWithResult(_0x38a6d8,_0x430b21){_0x430b21=_0x430b21||0xc8;return function(_0xa1c4d1){if(_0xa1c4d1){return _0x38a6d8[_0xceee('0x2a')](_0x430b21)[_0xceee('0x2b')](_0xa1c4d1);}};}function respondWithFilteredResult(_0x17e66e,_0x44f475){return function(_0x393931){if(_0x393931){var _0x407ea8=typeof _0x44f475[_0xceee('0x2c')]===_0xceee('0x2d')&&typeof _0x44f475[_0xceee('0x2e')]==='undefined';var _0x1ba401=_0x393931[_0xceee('0x2f')];var _0x1448c7=_0x407ea8?0x0:_0x44f475[_0xceee('0x2c')];var _0x350ba2=_0x407ea8?_0x393931['count']:_0x44f475[_0xceee('0x2c')]+_0x44f475['limit'];var _0x2982ff;if(_0x350ba2>=_0x1ba401){_0x350ba2=_0x1ba401;_0x2982ff=0xc8;}else{_0x2982ff=0xce;}_0x17e66e[_0xceee('0x2a')](_0x2982ff);return _0x17e66e[_0xceee('0x30')](_0xceee('0x31'),_0x1448c7+'-'+_0x350ba2+'/'+_0x1ba401)[_0xceee('0x2b')](_0x393931);}return null;};}function patchUpdates(_0x10101c){return function(_0x422e85){try{jsonpatch[_0xceee('0x32')](_0x422e85,_0x10101c,!![]);}catch(_0x20bd82){return BPromise[_0xceee('0x33')](_0x20bd82);}return _0x422e85[_0xceee('0x34')]();};}function saveUpdates(_0x11490d,_0x5152b1){return function(_0x4ce0ff){if(_0x4ce0ff){return _0x4ce0ff[_0xceee('0x35')](_0x11490d)[_0xceee('0x20')](function(_0x137abd){return _0x137abd;});}return null;};}function removeEntity(_0x2c1430,_0x45152d){return function(_0x4ee9ab){if(_0x4ee9ab){return _0x4ee9ab['destroy']()[_0xceee('0x20')](function(){var _0x4e5226=_0x4ee9ab[_0xceee('0x36')]({'plain':!![]});var _0x4bfdcf=_0xceee('0x37');return db[_0xceee('0x38')][_0xceee('0x39')]({'where':{'type':_0x4bfdcf,'resourceId':_0x4e5226['id']}})[_0xceee('0x20')](function(){return _0x4ee9ab;});})[_0xceee('0x20')](function(){_0x2c1430['status'](0xcc)[_0xceee('0x3a')]();});}};}function handleEntityNotFound(_0x2807ff,_0x19699d){return function(_0x5599c6){if(!_0x5599c6){_0x2807ff[_0xceee('0x3b')](0x194);}return _0x5599c6;};}function handleError(_0x185136,_0x2ba10f){_0x2ba10f=_0x2ba10f||0x1f4;return function(_0x1e006a){logger[_0xceee('0x26')](_0x1e006a[_0xceee('0x3c')]);if(_0x1e006a['name']){delete _0x1e006a[_0xceee('0x3d')];}_0x185136['status'](_0x2ba10f)[_0xceee('0x3e')](_0x1e006a);};}exports[_0xceee('0x3f')]=function(_0x5eef18,_0xeb1657){var _0xd87357={},_0x2ccd77={},_0x41e6c5={'count':0x0,'rows':[]};var _0x15526b=_[_0xceee('0x40')](db[_0xceee('0x41')]['rawAttributes'],function(_0x2b4323){return{'name':_0x2b4323['fieldName'],'type':_0x2b4323[_0xceee('0x42')][_0xceee('0x43')]};});_0x2ccd77[_0xceee('0x44')]=_[_0xceee('0x40')](_0x15526b,_0xceee('0x3d'));_0x2ccd77[_0xceee('0x45')]=_[_0xceee('0x46')](_0x5eef18[_0xceee('0x45')]);_0x2ccd77[_0xceee('0x47')]=_[_0xceee('0x48')](_0x2ccd77[_0xceee('0x44')],_0x2ccd77['query']);_0xd87357[_0xceee('0x49')]=_[_0xceee('0x48')](_0x2ccd77[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x5eef18[_0xceee('0x45')]['fields']));_0xd87357['attributes']=_0xd87357[_0xceee('0x49')][_0xceee('0x4b')]?_0xd87357[_0xceee('0x49')]:_0x2ccd77[_0xceee('0x44')];if(!_0x5eef18['query'][_0xceee('0x4c')](_0xceee('0x4d'))){_0xd87357[_0xceee('0x2e')]=qs[_0xceee('0x2e')](_0x5eef18[_0xceee('0x45')][_0xceee('0x2e')]);_0xd87357[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x5eef18['query']['offset']);}_0xd87357[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x5eef18['query']['sort']);_0xd87357[_0xceee('0x50')]=qs['filters'](_[_0xceee('0x51')](_0x5eef18[_0xceee('0x45')],_0x2ccd77['filters']),_0x15526b);if(_0x5eef18[_0xceee('0x45')][_0xceee('0x52')]){_0xd87357['where']=_[_0xceee('0x53')](_0xd87357[_0xceee('0x50')],{'$or':_['map'](_0x15526b,function(_0x1b625f){if(_0x1b625f[_0xceee('0x42')]!==_0xceee('0x54')){var _0x45d75f={};_0x45d75f[_0x1b625f[_0xceee('0x3d')]]={'$like':'%'+_0x5eef18[_0xceee('0x45')]['filter']+'%'};return _0x45d75f;}})});}_0xd87357=_[_0xceee('0x53')]({},_0xd87357,_0x5eef18[_0xceee('0x55')]);var _0x5f3d54={'where':_0xd87357[_0xceee('0x50')]};return db[_0xceee('0x41')]['count'](_0x5f3d54)['then'](function(_0x4fb676){_0x41e6c5[_0xceee('0x2f')]=_0x4fb676;if(_0x5eef18[_0xceee('0x45')][_0xceee('0x56')]){_0xd87357[_0xceee('0x57')]=[{'all':!![]}];}return db[_0xceee('0x41')]['findAll'](_0xd87357);})[_0xceee('0x20')](function(_0x184a68){_0x41e6c5[_0xceee('0x58')]=_0x184a68;return _0x41e6c5;})[_0xceee('0x20')](respondWithFilteredResult(_0xeb1657,_0xd87357))['catch'](handleError(_0xeb1657,null));};exports[_0xceee('0x59')]=function(_0x35936a,_0x1f0f11){var _0x38841c={'raw':!![],'where':{'id':_0x35936a['params']['id']}},_0x17b2ef={};_0x17b2ef[_0xceee('0x44')]=_[_0xceee('0x46')](db['ChatQueue'][_0xceee('0x5a')]);_0x17b2ef[_0xceee('0x45')]=_[_0xceee('0x46')](_0x35936a[_0xceee('0x45')]);_0x17b2ef[_0xceee('0x47')]=_[_0xceee('0x48')](_0x17b2ef[_0xceee('0x44')],_0x17b2ef[_0xceee('0x45')]);_0x38841c['attributes']=_[_0xceee('0x48')](_0x17b2ef[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x35936a[_0xceee('0x45')][_0xceee('0x4a')]));_0x38841c[_0xceee('0x49')]=_0x38841c['attributes'][_0xceee('0x4b')]?_0x38841c[_0xceee('0x49')]:_0x17b2ef[_0xceee('0x44')];if(_0x35936a[_0xceee('0x45')]['includeAll']){_0x38841c[_0xceee('0x57')]=[{'all':!![]}];}_0x38841c=_[_0xceee('0x53')]({},_0x38841c,_0x35936a[_0xceee('0x55')]);return db[_0xceee('0x41')][_0xceee('0x5b')](_0x38841c)['then'](handleEntityNotFound(_0x1f0f11,null))[_0xceee('0x20')](respondWithResult(_0x1f0f11,null))[_0xceee('0x5c')](handleError(_0x1f0f11,null));};exports[_0xceee('0x5d')]=function(_0x552dc7,_0x3270f6){return db[_0xceee('0x41')][_0xceee('0x5d')](_0x552dc7[_0xceee('0x5e')],{})[_0xceee('0x20')](function(_0x15a265){var _0x4c37cb=_0x552dc7[_0xceee('0x5f')][_0xceee('0x36')]({'plain':!![]});if(!_0x4c37cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c37cb[_0xceee('0x60')]==='user'){var _0x489a42=_0x15a265[_0xceee('0x36')]({'plain':!![]});var _0x15ab5b=_0xceee('0x37');return db[_0xceee('0x61')][_0xceee('0x5b')]({'where':{'name':_0x15ab5b,'userProfileId':_0x4c37cb[_0xceee('0x62')]},'raw':!![]})['then'](function(_0x5953b8){if(_0x5953b8&&_0x5953b8[_0xceee('0x63')]===0x0){return db[_0xceee('0x38')][_0xceee('0x5d')]({'name':_0x489a42[_0xceee('0x3d')],'resourceId':_0x489a42['id'],'type':_0x5953b8[_0xceee('0x3d')],'sectionId':_0x5953b8['id']},{})[_0xceee('0x20')](function(){return _0x15a265;});}else{return _0x15a265;}})[_0xceee('0x5c')](function(_0x58aee2){logger[_0xceee('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58aee2);throw _0x58aee2;});}return _0x15a265;})[_0xceee('0x20')](respondWithResult(_0x3270f6,0xc9))[_0xceee('0x5c')](handleError(_0x3270f6,null));};exports['update']=function(_0x42d744,_0x297902){if(_0x42d744[_0xceee('0x5e')]['id']){delete _0x42d744[_0xceee('0x5e')]['id'];}return db['ChatQueue'][_0xceee('0x5b')]({'where':{'id':_0x42d744['params']['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x297902,null))[_0xceee('0x20')](saveUpdates(_0x42d744[_0xceee('0x5e')],null))[_0xceee('0x20')](respondWithResult(_0x297902,null))['catch'](handleError(_0x297902,null));};exports[_0xceee('0x39')]=function(_0x9add0c,_0x4134f8){return db[_0xceee('0x41')][_0xceee('0x5b')]({'where':{'id':_0x9add0c[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x4134f8,null))[_0xceee('0x20')](removeEntity(_0x4134f8,null))[_0xceee('0x5c')](handleError(_0x4134f8,null));};exports[_0xceee('0x65')]=function(_0xddc3b8,_0x424ad2){return db[_0xceee('0x41')][_0xceee('0x65')]()['then'](respondWithResult(_0x424ad2,null))[_0xceee('0x5c')](handleError(_0x424ad2,null));};exports[_0xceee('0x66')]=function(_0x4de96f,_0x54eb76,_0x1bc38d){var _0x47311c={'raw':!![],'where':{}},_0x55c4fd={},_0x1e16b1;return db[_0xceee('0x41')][_0xceee('0x67')]({'where':{'id':_0x4de96f[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x54eb76,null))[_0xceee('0x20')](function(_0x6ee7ee){if(_0x6ee7ee){_0x1e16b1=_0x6ee7ee['get']({'plain':!![]});_0x55c4fd['model']=_[_0xceee('0x46')](db[_0xceee('0x68')][_0xceee('0x5a')]);_0x55c4fd[_0xceee('0x45')]=_[_0xceee('0x46')](_0x4de96f['query']);_0x55c4fd[_0xceee('0x47')]=_[_0xceee('0x48')](_0x55c4fd[_0xceee('0x44')],_0x55c4fd['query']);_0x47311c[_0xceee('0x49')]=_[_0xceee('0x48')](_0x55c4fd['model'],qs['fields'](_0x4de96f[_0xceee('0x45')][_0xceee('0x4a')]));_0x47311c[_0xceee('0x49')]=_0x47311c[_0xceee('0x49')][_0xceee('0x4b')]?_0x47311c['attributes']:_0x55c4fd[_0xceee('0x44')];if(!_0x4de96f[_0xceee('0x45')]['hasOwnProperty']('nolimit')){_0x47311c['limit']=qs[_0xceee('0x2e')](_0x4de96f[_0xceee('0x45')]['limit']);_0x47311c['offset']=qs['offset'](_0x4de96f[_0xceee('0x45')][_0xceee('0x2c')]);}_0x47311c['order']=qs['sort'](_0x4de96f[_0xceee('0x45')][_0xceee('0x4f')]);_0x47311c[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x4de96f[_0xceee('0x45')],_0x55c4fd['filters']));_0x47311c[_0xceee('0x50')][_0xceee('0x69')]=_0x6ee7ee['id'];if(_0x4de96f[_0xceee('0x45')]['filter']){_0x47311c['where']=_[_0xceee('0x53')](_0x47311c[_0xceee('0x50')],{'$or':_[_0xceee('0x40')](_0x47311c[_0xceee('0x49')],function(_0x1d6c1d){var _0x39c9a6={};_0x39c9a6[_0x1d6c1d]={'$like':'%'+_0x4de96f[_0xceee('0x45')]['filter']+'%'};return _0x39c9a6;})});}_0x47311c=_[_0xceee('0x53')]({},_0x47311c,_0x4de96f['options']);return db[_0xceee('0x68')]['findAll'](_0x47311c);}})[_0xceee('0x20')](function(_0x396f95){if(_0x396f95){return db[_0xceee('0x6a')][_0xceee('0x6b')]({'where':{'id':_[_0xceee('0x40')](_0x396f95,_0xceee('0x6c')),'role':_0xceee('0x6d')},'attributes':['id','name',_0xceee('0x6e'),_0xceee('0x6f'),_0xceee('0x70')]});}})[_0xceee('0x20')](function(_0xa81e24){if(_0xa81e24){return{'count':_0xa81e24['count'],'rows':_[_0xceee('0x40')](_0xa81e24['rows'],function(_0x34a643){return{'membername':_0x34a643[_0xceee('0x3d')],'UserId':_0x34a643['id'],'queue_name':_0x1e16b1[_0xceee('0x3d')],'ChatQueueId':_0x1e16b1['id'],'interface':util['format']('%s/%s',_0xceee('0x71'),_0x34a643[_0xceee('0x3d')]),'penalty':0x0,'paused':_0x34a643['chatPause'],'createdAt':_0x34a643[_0xceee('0x70')],'updatedAt':_0x34a643['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x54eb76,_0x47311c))[_0xceee('0x5c')](handleError(_0x54eb76,null));};exports[_0xceee('0x72')]=function(_0x1ae8d5,_0x184cd9,_0x494347){var _0x55b29d={};var _0x397d1d={};var _0x183f9d;var _0x404cfc;return db[_0xceee('0x41')][_0xceee('0x67')]({'where':{'id':_0x1ae8d5[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x184cd9,null))[_0xceee('0x20')](function(_0x15fa4d){if(_0x15fa4d){_0x183f9d=_0x15fa4d;_0x397d1d[_0xceee('0x44')]=_[_0xceee('0x46')](db[_0xceee('0x73')]['rawAttributes']);_0x397d1d[_0xceee('0x45')]=_['keys'](_0x1ae8d5[_0xceee('0x45')]);_0x397d1d[_0xceee('0x47')]=_[_0xceee('0x48')](_0x397d1d[_0xceee('0x44')],_0x397d1d[_0xceee('0x45')]);_0x55b29d[_0xceee('0x49')]=_[_0xceee('0x48')](_0x397d1d[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x1ae8d5[_0xceee('0x45')]['fields']));_0x55b29d['attributes']=_0x55b29d[_0xceee('0x49')]['length']?_0x55b29d[_0xceee('0x49')]:_0x397d1d[_0xceee('0x44')];_0x55b29d[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x4f')]);_0x55b29d[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x1ae8d5[_0xceee('0x45')],_0x397d1d[_0xceee('0x47')]));if(_0x1ae8d5['query'][_0xceee('0x52')]){_0x55b29d[_0xceee('0x50')]=_[_0xceee('0x53')](_0x55b29d['where'],{'$or':_[_0xceee('0x40')](_0x55b29d['attributes'],function(_0x29327b){var _0x206ead={};_0x206ead[_0x29327b]={'$like':'%'+_0x1ae8d5[_0xceee('0x45')][_0xceee('0x52')]+'%'};return _0x206ead;})});}_0x55b29d=_[_0xceee('0x53')]({},_0x55b29d,_0x1ae8d5[_0xceee('0x55')]);return _0x183f9d['getTeams'](_0x55b29d);}})['then'](function(_0x4a5645){if(_0x4a5645){_0x404cfc=_0x4a5645[_0xceee('0x4b')];if(!_0x1ae8d5['query']['hasOwnProperty']('nolimit')){_0x55b29d[_0xceee('0x2e')]=qs[_0xceee('0x2e')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x2e')]);_0x55b29d[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x2c')]);}return _0x183f9d['getTeams'](_0x55b29d);}})[_0xceee('0x20')](function(_0x55e088){if(_0x55e088){return _0x55e088?{'count':_0x404cfc,'rows':_0x55e088}:null;}})[_0xceee('0x20')](respondWithResult(_0x184cd9,null))[_0xceee('0x5c')](handleError(_0x184cd9,null));};exports['addTeams']=function(_0x3be869,_0x2d2455,_0x3c3829){var _0x5c0373=_0x3be869[_0xceee('0x5e')]['ids'];return db[_0xceee('0x73')]['findAll']({'where':{'id':_0x5c0373},'attributes':['id'],'include':[{'model':db[_0xceee('0x6a')],'as':_0xceee('0x74'),'attributes':['id',_0xceee('0x3d'),'online',_0xceee('0x75'),_0xceee('0x76')],'raw':!![]}]})[_0xceee('0x20')](function(_0x3b2d3d){if(_0x3b2d3d){var _0x46ac2d=_[_0xceee('0x77')](_0x3b2d3d,function(_0x25e5ac){var _0x486619=_0x25e5ac['get']({'plain':!![]});return _0x486619[_0xceee('0x74')];});return db['ChatQueue'][_0xceee('0x5b')]({'where':{'id':_0x3be869['params']['id']}})[_0xceee('0x20')](function(_0x4c0cae){return db[_0xceee('0x78')][_0xceee('0x79')](function(_0x1b675a){return _0x4c0cae[_0xceee('0x7a')](_0x5c0373,{'transaction':_0x1b675a})[_0xceee('0x20')](function(){return BPromise[_0xceee('0x7b')](_0x46ac2d,function(_0x47c20c){return db[_0xceee('0x68')][_0xceee('0x7c')]({'where':{'UserId':_0x47c20c['id'],'ChatQueueId':_0x3be869[_0xceee('0x64')]['id']},'transaction':_0x1b675a});});})['then'](function(){_0x46ac2d[_0xceee('0x7d')](function(_0x448cf1){socket[_0xceee('0x7e')]('userChatQueue:save',{'UserId':_0x448cf1['id'],'ChatQueueId':_0x4c0cae['id']});});});});});}})[_0xceee('0x20')](respondWithStatusCode(_0x2d2455,null))[_0xceee('0x5c')](handleError(_0x2d2455,null));};exports[_0xceee('0x7f')]=function(_0x1d55e2,_0x1b8541,_0x15a2af){return db['Team'][_0xceee('0x80')]({'where':{'id':_0x1d55e2[_0xceee('0x45')][_0xceee('0x81')]},'attributes':['id'],'include':[{'model':db[_0xceee('0x6a')],'as':_0xceee('0x74'),'attributes':['id'],'raw':!![]}]})[_0xceee('0x20')](handleEntityNotFound(_0x1b8541,null))[_0xceee('0x20')](function(_0x3184f5){var _0x324a57=_[_0xceee('0x40')](_0x3184f5,'id');var _0x3cbf36=[];var _0x5d5cf8=[];var _0x40d0ee=squel['select']();_0x40d0ee[_0xceee('0x82')](_0xceee('0x83'))[_0xceee('0x84')](_0xceee('0x85'),'tq')[_0xceee('0x86')](_0xceee('0x87'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xceee('0x50')](_0xceee('0x88'),_0x1d55e2[_0xceee('0x64')]['id']);for(var _0x51e76c=0x0;_0x51e76c<_0x3184f5[_0xceee('0x4b')];_0x51e76c+=0x1){let _0x254620=_0x3184f5[_0x51e76c];for(var _0x433275=0x0;_0x433275<_0x254620[_0xceee('0x74')][_0xceee('0x4b')];_0x433275+=0x1){let _0x3db59b=_0x254620['Agents'][_0x433275];var _0x31881c=_0x40d0ee['clone']();_0x31881c[_0xceee('0x50')](_0xceee('0x89'),_0x3db59b['id']);_0x5d5cf8[_0xceee('0x8a')](db[_0xceee('0x78')][_0xceee('0x45')](_0x31881c[_0xceee('0x8b')](),{'type':db[_0xceee('0x78')][_0xceee('0x8c')][_0xceee('0x8d')]})[_0xceee('0x20')](function(_0x26e08b){if(_0x26e08b[_0xceee('0x4b')]===0x1){return _0x3db59b['id'];}else{var _0x1f4749=_['every'](_[_0xceee('0x40')](_0x26e08b,'TeamId'),function(_0x3bb94d){return _[_0xceee('0x8e')](_0x324a57,_0x3bb94d);});if(_0x1f4749){return _0x3db59b['id'];}}}));}}return BPromise[_0xceee('0x8f')](_0x5d5cf8)[_0xceee('0x20')](function(_0x20b6cc){_0x3cbf36=_(_0x3cbf36)[_0xceee('0x90')](_0x20b6cc)[_0xceee('0x91')]()[_0xceee('0x92')]();return db['ChatQueue']['find']({'where':{'id':_0x1d55e2[_0xceee('0x64')]['id']}})[_0xceee('0x20')](function(_0x393edf){return db['sequelize']['transaction'](function(_0x752edc){return _0x393edf[_0xceee('0x7f')](_0x1d55e2['query']['ids'],{'transaction':_0x752edc})[_0xceee('0x20')](function(){if(!_['isEmpty'](_0x3cbf36)){return _0x393edf[_0xceee('0x93')](_0x3cbf36,{'transaction':_0x752edc});}})[_0xceee('0x20')](function(){_0x3cbf36[_0xceee('0x7d')](function(_0x27f9a9){socket['emit']('userChatQueue:remove',{'UserId':_0x27f9a9,'ChatQueueId':_0x393edf['id']});});});});});});})['then'](respondWithStatusCode(_0x1b8541,null))[_0xceee('0x5c')](handleError(_0x1b8541,null));};exports['addAgents']=function(_0x36837f,_0x306579,_0x18c801){return db[_0xceee('0x41')][_0xceee('0x5b')]({'where':{'id':_0x36837f[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x306579,null))[_0xceee('0x20')](function(_0x572f31){if(_0x572f31){return _0x572f31[_0xceee('0x94')](_0x36837f[_0xceee('0x5e')][_0xceee('0x81')],_['omit'](_0x36837f[_0xceee('0x5e')],['ids','id'])||{})[_0xceee('0x95')](function(_0x580cba){for(var _0x3f833e=0x0;_0x3f833e<_0x36837f[_0xceee('0x5e')][_0xceee('0x81')]['length'];_0x3f833e+=0x1){socket[_0xceee('0x7e')](_0xceee('0x96'),{'UserId':Number(_0x36837f[_0xceee('0x5e')][_0xceee('0x81')][_0x3f833e]),'ChatQueueId':Number(_0x36837f['params']['id'])});}return _0x580cba;});}})[_0xceee('0x20')](respondWithResult(_0x306579,null))[_0xceee('0x5c')](handleError(_0x306579,null));};exports[_0xceee('0x93')]=function(_0x3ce8d5,_0x136e43,_0x1fa00b){return db['ChatQueue']['find']({'where':{'id':_0x3ce8d5[_0xceee('0x64')]['id']}})['then'](handleEntityNotFound(_0x136e43,null))[_0xceee('0x20')](function(_0x3be75a){if(_0x3be75a){return _0x3be75a[_0xceee('0x93')](_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')])['then'](function(){if(_[_0xceee('0x97')](_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')])){for(var _0x7a6c9f=0x0;_0x7a6c9f<_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')][_0xceee('0x4b')];_0x7a6c9f+=0x1){socket[_0xceee('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')][_0x7a6c9f]),'ChatQueueId':Number(_0x3ce8d5[_0xceee('0x64')]['id'])});}}else{socket[_0xceee('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x3ce8d5['query']['ids']),'ChatQueueId':Number(_0x3ce8d5[_0xceee('0x64')]['id'])});}});}})[_0xceee('0x20')](respondWithStatusCode(_0x136e43,null))[_0xceee('0x5c')](handleError(_0x136e43,null));};exports[_0xceee('0x98')]=function(_0x479029,_0x364b08,_0x30ff61){var _0x3018af={};var _0xc0f769={};var _0xc1447f;var _0x18bf45;return db[_0xceee('0x41')]['findOne']({'where':{'id':_0x479029[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x364b08,null))[_0xceee('0x20')](function(_0x89076a){if(_0x89076a){_0xc1447f=_0x89076a;_0xc0f769['model']=_[_0xceee('0x46')](db[_0xceee('0x6a')][_0xceee('0x5a')]);_0xc0f769[_0xceee('0x45')]=_[_0xceee('0x46')](_0x479029['query']);_0xc0f769[_0xceee('0x47')]=_[_0xceee('0x48')](_0xc0f769[_0xceee('0x44')],_0xc0f769[_0xceee('0x45')]);_0x3018af[_0xceee('0x49')]=_[_0xceee('0x48')](_0xc0f769[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x479029[_0xceee('0x45')][_0xceee('0x4a')]));_0x3018af[_0xceee('0x49')]=_0x3018af['attributes'][_0xceee('0x4b')]?_0x3018af[_0xceee('0x49')]:_0xc0f769[_0xceee('0x44')];_0x3018af[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x479029['query'][_0xceee('0x4f')]);_0x3018af[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x479029[_0xceee('0x45')],_0xc0f769[_0xceee('0x47')]));if(_0x479029[_0xceee('0x45')][_0xceee('0x52')]){_0x3018af[_0xceee('0x50')]=_[_0xceee('0x53')](_0x3018af[_0xceee('0x50')],{'$or':_[_0xceee('0x40')](_0x3018af[_0xceee('0x49')],function(_0x1fd080){var _0x1e1094={};_0x1e1094[_0x1fd080]={'$like':'%'+_0x479029['query'][_0xceee('0x52')]+'%'};return _0x1e1094;})});}_0x3018af=_[_0xceee('0x53')]({},_0x3018af,_0x479029[_0xceee('0x55')]);return _0xc1447f[_0xceee('0x98')](_0x3018af);}})[_0xceee('0x20')](function(_0x10823e){if(_0x10823e){_0x18bf45=_0x10823e[_0xceee('0x4b')];if(!_0x479029[_0xceee('0x45')][_0xceee('0x4c')]('nolimit')){_0x3018af[_0xceee('0x2e')]=qs['limit'](_0x479029[_0xceee('0x45')][_0xceee('0x2e')]);_0x3018af[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x479029[_0xceee('0x45')]['offset']);}return _0xc1447f[_0xceee('0x98')](_0x3018af);}})[_0xceee('0x20')](function(_0x59fb4e){if(_0x59fb4e){return _0x59fb4e?{'count':_0x18bf45,'rows':_0x59fb4e}:null;}})[_0xceee('0x20')](respondWithResult(_0x364b08,null))['catch'](handleError(_0x364b08,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index bcb3cac..7392b4b 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 _0xf73a=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d066a,_0x424cb0){var _0x262376=function(_0x3a8e27){while(--_0x3a8e27){_0x3d066a['push'](_0x3d066a['shift']());}};_0x262376(++_0x424cb0);}(_0xf73a,0xd8));var _0xaf73=function(_0x9c1eca,_0x5a0ab3){_0x9c1eca=_0x9c1eca-0x0;var _0x400385=_0xf73a[_0x9c1eca];return _0x400385;};'use strict';var EventEmitter=require(_0xaf73('0x0'));var ChatQueue=require(_0xaf73('0x1'))['db'][_0xaf73('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf73('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaf73('0x4'),'afterDestroy':_0xaf73('0x5')};function emitEvent(_0x401aef){return function(_0x294407,_0x498db0,_0x31df1d){ChatQueueEvents[_0xaf73('0x6')](_0x401aef+':'+_0x294407['id'],_0x294407);ChatQueueEvents[_0xaf73('0x6')](_0x401aef,_0x294407);_0x31df1d(null);};}for(var e in events){if(events[_0xaf73('0x7')](e)){var event=events[e];ChatQueue[_0xaf73('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x193a=['emit','hook','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x35ed44,_0x265d05){var _0x479406=function(_0x95239a){while(--_0x95239a){_0x35ed44['push'](_0x35ed44['shift']());}};_0x479406(++_0x265d05);}(_0x193a,0x95));var _0xa193=function(_0x13845a,_0x3ae746){_0x13845a=_0x13845a-0x0;var _0xa7dce0=_0x193a[_0x13845a];return _0xa7dce0;};'use strict';var EventEmitter=require(_0xa193('0x0'));var ChatQueue=require(_0xa193('0x1'))['db'][_0xa193('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa193('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa193('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fe750){return function(_0xdd4e5,_0x42f1e0,_0x7e7613){ChatQueueEvents[_0xa193('0x5')](_0x4fe750+':'+_0xdd4e5['id'],_0xdd4e5);ChatQueueEvents[_0xa193('0x5')](_0x4fe750,_0xdd4e5);_0x7e7613(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa193('0x6')](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 4a0547c..7c7e312 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 _0x5f37=['path','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x50c409,_0x2c78cc){var _0x52bf09=function(_0x1ad704){while(--_0x1ad704){_0x50c409['push'](_0x50c409['shift']());}};_0x52bf09(++_0x2c78cc);}(_0x5f37,0x1c7));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x75f3('0x0'));var util=require(_0x75f3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75f3('0x2'));var BPromise=require(_0x75f3('0x3'));var rp=require(_0x75f3('0x4'));var fs=require('fs');var path=require(_0x75f3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x75f3('0x6'));module[_0x75f3('0x7')]=function(_0x42fc78,_0x4cd887){return _0x42fc78['define'](_0x75f3('0x8'),attributes,{'tableName':_0x75f3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc70e=['../../config/environment','./chatQueue.attributes','exports','chat_queues','util','moment','request-promise','path','rimraf'];(function(_0x2a9658,_0x22f838){var _0x375348=function(_0x20016f){while(--_0x20016f){_0x2a9658['push'](_0x2a9658['shift']());}};_0x375348(++_0x22f838);}(_0xc70e,0x11b));var _0xec70=function(_0xc43657,_0x17b2d8){_0xc43657=_0xc43657-0x0;var _0x6eca29=_0xc70e[_0xc43657];return _0x6eca29;};'use strict';var _=require('lodash');var util=require(_0xec70('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xec70('0x1'));var BPromise=require('bluebird');var rp=require(_0xec70('0x2'));var fs=require('fs');var path=require(_0xec70('0x3'));var rimraf=require(_0xec70('0x4'));var config=require(_0xec70('0x5'));var attributes=require(_0xec70('0x6'));module[_0xec70('0x7')]=function(_0x4d7e16,_0x65e518){return _0x4d7e16['define']('ChatQueue',attributes,{'tableName':_0xec70('0x8'),'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 e56e5e9..82be3d8 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 _0x4965=['request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatQueue.socket','register'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x4965,0x16e));var _0x5496=function(_0x18deef,_0x5b8774){_0x18deef=_0x18deef-0x0;var _0x3f4361=_0x4965[_0x18deef];return _0x3f4361;};'use strict';var _=require(_0x5496('0x0'));var util=require(_0x5496('0x1'));var moment=require(_0x5496('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5496('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5496('0x4'))(_0x5496('0x5'));var config=require(_0x5496('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5496('0x7')][_0x5496('0x8')]({'port':0x232a});config[_0x5496('0x9')]=_[_0x5496('0xa')](config['redis'],{'host':_0x5496('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5496('0x9')]));require(_0x5496('0xc'))[_0x5496('0xd')](socket);function respondWithRpcPromise(_0x5dc64a,_0x443752,_0xd18801){return new BPromise(function(_0x42f073,_0x13f202){return client[_0x5496('0xe')](_0x5dc64a,_0xd18801)[_0x5496('0xf')](function(_0x25d676){logger[_0x5496('0x10')](_0x5496('0x11'),_0x443752,_0x5496('0x12'));logger[_0x5496('0x13')](_0x5496('0x14'),_0x443752,_0x5496('0x12'),JSON[_0x5496('0x15')](_0x25d676));if(_0x25d676[_0x5496('0x16')]){if(_0x25d676['error'][_0x5496('0x17')]===0x1f4){logger[_0x5496('0x16')](_0x5496('0x11'),_0x443752,_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);return _0x13f202(_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);}logger[_0x5496('0x16')]('ChatQueue,\x20%s,\x20%s',_0x443752,_0x25d676['error'][_0x5496('0x18')]);return _0x42f073(_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);}else{logger[_0x5496('0x10')](_0x5496('0x11'),_0x443752,_0x5496('0x12'));_0x42f073(_0x25d676[_0x5496('0x19')][_0x5496('0x18')]);}})[_0x5496('0x1a')](function(_0x512872){logger['error'](_0x5496('0x11'),_0x443752,_0x512872);_0x13f202(_0x512872);});});}exports[_0x5496('0x1b')]=function(_0x10599a){var _0x2cd842=this;return new Promise(function(_0x4d2a9d,_0x701eca){return db[_0x5496('0x1c')]['findAll']({'raw':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x1e')]===undefined?!![]:![]:!![],'where':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x1f')]||null:null,'attributes':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x20')]||null:null,'limit':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x21')]||null:null,'include':_0x10599a[_0x5496('0x1d')]?_0x10599a['options'][_0x5496('0x22')]?_['map'](_0x10599a['options']['include'],function(_0xc6e98b){return{'model':db[_0xc6e98b[_0x5496('0x23')]],'as':_0xc6e98b['as'],'attributes':_0xc6e98b[_0x5496('0x20')],'include':_0xc6e98b[_0x5496('0x22')]?_[_0x5496('0x24')](_0xc6e98b[_0x5496('0x22')],function(_0x38ff07){return{'model':db[_0x38ff07[_0x5496('0x23')]],'as':_0x38ff07['as'],'attributes':_0x38ff07[_0x5496('0x20')],'include':_0x38ff07[_0x5496('0x22')]?_['map'](_0x38ff07[_0x5496('0x22')],function(_0x28d7d5){return{'model':db[_0x28d7d5['model']],'as':_0x28d7d5['as'],'attributes':_0x28d7d5[_0x5496('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5496('0xf')](function(_0x119a56){logger['info']('GetChatQueue',_0x10599a);logger['debug']('GetChatQueue',_0x10599a,JSON[_0x5496('0x15')](_0x119a56));_0x4d2a9d(_0x119a56);})[_0x5496('0x1a')](function(_0x33ae26){logger[_0x5496('0x16')](_0x5496('0x1b'),_0x33ae26[_0x5496('0x18')],_0x10599a);_0x701eca(_0x2cd842['error'](0x1f4,_0x33ae26[_0x5496('0x18')]));});});};exports[_0x5496('0x25')]=function(_0x539489){var _0x2c6514=this;return new Promise(function(_0x903d94,_0xf1b3cf){return db[_0x5496('0x1c')]['find']({'raw':_0x539489['options']?_0x539489[_0x5496('0x1d')][_0x5496('0x1e')]===undefined?!![]:![]:!![],'where':_0x539489[_0x5496('0x1d')]?_0x539489[_0x5496('0x1d')][_0x5496('0x1f')]||null:null,'attributes':_0x539489[_0x5496('0x1d')]?_0x539489[_0x5496('0x1d')]['attributes']||null:null,'include':_0x539489['options']?_0x539489[_0x5496('0x1d')]['include']?_[_0x5496('0x24')](_0x539489[_0x5496('0x1d')][_0x5496('0x22')],function(_0x16bd72){return{'model':db[_0x16bd72[_0x5496('0x23')]],'as':_0x16bd72['as'],'attributes':_0x16bd72['attributes'],'include':_0x16bd72[_0x5496('0x22')]?_['map'](_0x16bd72[_0x5496('0x22')],function(_0xfac994){return{'model':db[_0xfac994['model']],'as':_0xfac994['as'],'attributes':_0xfac994[_0x5496('0x20')],'include':_0xfac994[_0x5496('0x22')]?_['map'](_0xfac994[_0x5496('0x22')],function(_0x3dae10){return{'model':db[_0x3dae10[_0x5496('0x23')]],'as':_0x3dae10['as'],'attributes':_0x3dae10[_0x5496('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x505d9b){logger['info'](_0x5496('0x25'),_0x539489);logger['debug']('ShowChatQueue',_0x539489,JSON[_0x5496('0x15')](_0x505d9b));_0x903d94(_0x505d9b);})[_0x5496('0x1a')](function(_0x53227c){logger[_0x5496('0x16')](_0x5496('0x25'),_0x53227c['message'],_0x539489);_0xf1b3cf(_0x2c6514[_0x5496('0x16')](0x1f4,_0x53227c[_0x5496('0x18')]));});});}; \ No newline at end of file +var _0x46aa=['error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','catch','find','raw','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39ff4b,_0x111bdc){var _0xc8e827=function(_0x4e26c1){while(--_0x4e26c1){_0x39ff4b['push'](_0x39ff4b['shift']());}};_0xc8e827(++_0x111bdc);}(_0x46aa,0x90));var _0xa46a=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x46aa[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xa46a('0x0'));var util=require(_0xa46a('0x1'));var moment=require(_0xa46a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa46a('0x3'));var db=require(_0xa46a('0x4'))['db'];var utils=require(_0xa46a('0x5'));var logger=require(_0xa46a('0x6'))(_0xa46a('0x7'));var config=require(_0xa46a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa46a('0x9')]['http']({'port':0x232a});config[_0xa46a('0xa')]=_[_0xa46a('0xb')](config[_0xa46a('0xa')],{'host':_0xa46a('0xc'),'port':0x18eb});var socket=require(_0xa46a('0xd'))(new Redis(config[_0xa46a('0xa')]));require(_0xa46a('0xe'))[_0xa46a('0xf')](socket);function respondWithRpcPromise(_0x3fd2f5,_0x4df886,_0x597f42){return new BPromise(function(_0x33053a,_0x293bb1){return client[_0xa46a('0x10')](_0x3fd2f5,_0x597f42)[_0xa46a('0x11')](function(_0x2dce6d){logger[_0xa46a('0x12')](_0xa46a('0x13'),_0x4df886,'request\x20sent');logger[_0xa46a('0x14')](_0xa46a('0x15'),_0x4df886,_0xa46a('0x16'),JSON[_0xa46a('0x17')](_0x2dce6d));if(_0x2dce6d[_0xa46a('0x18')]){if(_0x2dce6d[_0xa46a('0x18')][_0xa46a('0x19')]===0x1f4){logger[_0xa46a('0x18')](_0xa46a('0x13'),_0x4df886,_0x2dce6d['error'][_0xa46a('0x1a')]);return _0x293bb1(_0x2dce6d[_0xa46a('0x18')][_0xa46a('0x1a')]);}logger[_0xa46a('0x18')]('ChatQueue,\x20%s,\x20%s',_0x4df886,_0x2dce6d[_0xa46a('0x18')]['message']);return _0x33053a(_0x2dce6d[_0xa46a('0x18')]['message']);}else{logger[_0xa46a('0x12')](_0xa46a('0x13'),_0x4df886,_0xa46a('0x16'));_0x33053a(_0x2dce6d[_0xa46a('0x1b')][_0xa46a('0x1a')]);}})['catch'](function(_0x26412c){logger['error'](_0xa46a('0x13'),_0x4df886,_0x26412c);_0x293bb1(_0x26412c);});});}exports[_0xa46a('0x1c')]=function(_0x15d126){var _0x4b32e5=this;return new Promise(function(_0x216909,_0x5f0daf){return db[_0xa46a('0x1d')][_0xa46a('0x1e')]({'raw':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x15d126['options']?_0x15d126['options'][_0xa46a('0x20')]||null:null,'attributes':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x21')]||null:null,'limit':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x22')]||null:null,'include':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x23')]?_[_0xa46a('0x24')](_0x15d126[_0xa46a('0x1f')][_0xa46a('0x23')],function(_0xe668f0){return{'model':db[_0xe668f0[_0xa46a('0x25')]],'as':_0xe668f0['as'],'attributes':_0xe668f0[_0xa46a('0x21')],'include':_0xe668f0[_0xa46a('0x23')]?_[_0xa46a('0x24')](_0xe668f0['include'],function(_0x170ac9){return{'model':db[_0x170ac9[_0xa46a('0x25')]],'as':_0x170ac9['as'],'attributes':_0x170ac9[_0xa46a('0x21')],'include':_0x170ac9['include']?_[_0xa46a('0x24')](_0x170ac9[_0xa46a('0x23')],function(_0x100770){return{'model':db[_0x100770[_0xa46a('0x25')]],'as':_0x100770['as'],'attributes':_0x100770[_0xa46a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa46a('0x11')](function(_0x2df63d){logger[_0xa46a('0x12')](_0xa46a('0x1c'),_0x15d126);logger[_0xa46a('0x14')]('GetChatQueue',_0x15d126,JSON['stringify'](_0x2df63d));_0x216909(_0x2df63d);})[_0xa46a('0x26')](function(_0x19dbf4){logger['error'](_0xa46a('0x1c'),_0x19dbf4[_0xa46a('0x1a')],_0x15d126);_0x5f0daf(_0x4b32e5[_0xa46a('0x18')](0x1f4,_0x19dbf4[_0xa46a('0x1a')]));});});};exports['ShowChatQueue']=function(_0x593f40){var _0x200686=this;return new Promise(function(_0x316161,_0x4702aa){return db[_0xa46a('0x1d')][_0xa46a('0x27')]({'raw':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')][_0xa46a('0x28')]===undefined?!![]:![]:!![],'where':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')]['where']||null:null,'attributes':_0x593f40[_0xa46a('0x1f')]?_0x593f40[_0xa46a('0x1f')][_0xa46a('0x21')]||null:null,'include':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')]['include']?_[_0xa46a('0x24')](_0x593f40[_0xa46a('0x1f')][_0xa46a('0x23')],function(_0x4e218c){return{'model':db[_0x4e218c[_0xa46a('0x25')]],'as':_0x4e218c['as'],'attributes':_0x4e218c['attributes'],'include':_0x4e218c[_0xa46a('0x23')]?_['map'](_0x4e218c['include'],function(_0x5dce40){return{'model':db[_0x5dce40['model']],'as':_0x5dce40['as'],'attributes':_0x5dce40[_0xa46a('0x21')],'include':_0x5dce40[_0xa46a('0x23')]?_[_0xa46a('0x24')](_0x5dce40[_0xa46a('0x23')],function(_0x4860b4){return{'model':db[_0x4860b4['model']],'as':_0x4860b4['as'],'attributes':_0x4860b4[_0xa46a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a860e){logger[_0xa46a('0x12')](_0xa46a('0x29'),_0x593f40);logger[_0xa46a('0x14')]('ShowChatQueue',_0x593f40,JSON[_0xa46a('0x17')](_0x4a860e));_0x316161(_0x4a860e);})[_0xa46a('0x26')](function(_0x56b791){logger[_0xa46a('0x18')](_0xa46a('0x29'),_0x56b791[_0xa46a('0x1a')],_0x593f40);_0x4702aa(_0x200686[_0xa46a('0x18')](0x1f4,_0x56b791[_0xa46a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 82c913e..53f549c 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 _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x50e703,_0x127370){var _0xf1840c=function(_0x1418df){while(--_0x1418df){_0x50e703['push'](_0x50e703['shift']());}};_0xf1840c(++_0x127370);}(_0x0faf,0x132));var _0xf0fa=function(_0x491082,_0x28f78b){_0x491082=_0x491082-0x0;var _0x5797d9=_0x0faf[_0x491082];return _0x5797d9;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file +var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x17c4d1,_0x132786){var _0x5364fc=function(_0x4b0ef8){while(--_0x4b0ef8){_0x17c4d1['push'](_0x17c4d1['shift']());}};_0x5364fc(++_0x132786);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x59625f,_0x3b2c76){_0x59625f=_0x59625f-0x0;var _0x498e1e=_0xd0bb[_0x59625f];return _0x498e1e;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 622736f..00d050b 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(_0x5323fe,_0x1836ad){var _0x406cd8=function(_0x1d9724){while(--_0x1d9724){_0x5323fe['push'](_0x5323fe['shift']());}};_0x406cd8(++_0x1836ad);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xd8a3b0,_0x296d12){var _0xf9276=function(_0x582a30){while(--_0x582a30){_0xd8a3b0['push'](_0xd8a3b0['shift']());}};_0xf9276(++_0x296d12);}(_0x814b,0x1a2));var _0xb814=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x814b[_0x3cbe3a];return _0x24ffc1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);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 c0662c3..98e06d2 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 _0x3bd0=['STRING','DATE','moment','sequelize','exports'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x3bd0,0x93));var _0x03bd=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x3bd0[_0x4812e0];return _0x252e0f;};'use strict';var moment=require(_0x03bd('0x0'));var Sequelize=require(_0x03bd('0x1'));module[_0x03bd('0x2')]={'uniqueid':{'type':Sequelize[_0x03bd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x03bd('0x3')]},'joinAt':{'type':Sequelize[_0x03bd('0x4')]},'leaveAt':{'type':Sequelize[_0x03bd('0x4')]},'acceptAt':{'type':Sequelize[_0x03bd('0x4')]},'exitAt':{'type':Sequelize[_0x03bd('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xabf1=['moment','sequelize','exports','STRING','DATE'];(function(_0x3e079f,_0x189e15){var _0x296a34=function(_0xa31a0a){while(--_0xa31a0a){_0x3e079f['push'](_0x3e079f['shift']());}};_0x296a34(++_0x189e15);}(_0xabf1,0xa0));var _0x1abf=function(_0x54749f,_0x58a224){_0x54749f=_0x54749f-0x0;var _0x2dc80b=_0xabf1[_0x54749f];return _0x2dc80b;};'use strict';var moment=require(_0x1abf('0x0'));var Sequelize=require(_0x1abf('0x1'));module[_0x1abf('0x2')]={'uniqueid':{'type':Sequelize[_0x1abf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1abf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1abf('0x4')]},'reason':{'type':Sequelize[_0x1abf('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 4a380da..ee915b1 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 _0x5430=['update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','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','end','offset','limit','undefined','count','set','Content-Range','apply','save'];(function(_0x151a73,_0x299e95){var _0x2b581c=function(_0x2f052b){while(--_0x2f052b){_0x151a73['push'](_0x151a73['shift']());}};_0x2b581c(++_0x299e95);}(_0x5430,0x10c));var _0x0543=function(_0x1bd5ae,_0x2a6921){_0x1bd5ae=_0x1bd5ae-0x0;var _0xb817cf=_0x5430[_0x1bd5ae];return _0xb817cf;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require(_0x0543('0x3'));var rp=require(_0x0543('0x4'));var moment=require(_0x0543('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0543('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0543('0x7'));var ejs=require(_0x0543('0x8'));var fs=require('fs');var fs_extra=require(_0x0543('0x9'));var _=require(_0x0543('0xa'));var squel=require(_0x0543('0xb'));var crypto=require('crypto');var jsforce=require(_0x0543('0xc'));var deskjs=require(_0x0543('0xd'));var toCsv=require(_0x0543('0x7'));var querystring=require(_0x0543('0xe'));var Papa=require(_0x0543('0xf'));var Redis=require(_0x0543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x11'));var as=require(_0x0543('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x13'))(_0x0543('0x14'));var utils=require(_0x0543('0x15'));var config=require(_0x0543('0x16'));var licenseUtil=require(_0x0543('0x17'));var db=require(_0x0543('0x18'))['db'];function respondWithStatusCode(_0x30c54e,_0x27290d){_0x27290d=_0x27290d||0xcc;return function(_0x46d176){if(_0x46d176){return _0x30c54e[_0x0543('0x19')](_0x27290d);}return _0x30c54e[_0x0543('0x1a')](_0x27290d)[_0x0543('0x1b')]();};}function respondWithResult(_0x552980,_0x4f1f2a){_0x4f1f2a=_0x4f1f2a||0xc8;return function(_0x21e9ac){if(_0x21e9ac){return _0x552980['status'](_0x4f1f2a)['json'](_0x21e9ac);}};}function respondWithFilteredResult(_0xcb09df,_0x40fb03){return function(_0x1dff7d){if(_0x1dff7d){var _0x1cfadf=typeof _0x40fb03[_0x0543('0x1c')]==='undefined'&&typeof _0x40fb03[_0x0543('0x1d')]===_0x0543('0x1e');var _0x2dd5cb=_0x1dff7d[_0x0543('0x1f')];var _0x20b396=_0x1cfadf?0x0:_0x40fb03[_0x0543('0x1c')];var _0x577cf0=_0x1cfadf?_0x1dff7d['count']:_0x40fb03[_0x0543('0x1c')]+_0x40fb03['limit'];var _0x50ea84;if(_0x577cf0>=_0x2dd5cb){_0x577cf0=_0x2dd5cb;_0x50ea84=0xc8;}else{_0x50ea84=0xce;}_0xcb09df[_0x0543('0x1a')](_0x50ea84);return _0xcb09df[_0x0543('0x20')](_0x0543('0x21'),_0x20b396+'-'+_0x577cf0+'/'+_0x2dd5cb)['json'](_0x1dff7d);}return null;};}function patchUpdates(_0x3f0452){return function(_0x51c271){try{jsonpatch[_0x0543('0x22')](_0x51c271,_0x3f0452,!![]);}catch(_0x411ec2){return BPromise['reject'](_0x411ec2);}return _0x51c271[_0x0543('0x23')]();};}function saveUpdates(_0x333c72,_0x427919){return function(_0x110060){if(_0x110060){return _0x110060[_0x0543('0x24')](_0x333c72)[_0x0543('0x25')](function(_0x4adba7){return _0x4adba7;});}return null;};}function removeEntity(_0x5979d2,_0x59f1b2){return function(_0xbfe5dc){if(_0xbfe5dc){return _0xbfe5dc[_0x0543('0x26')]()[_0x0543('0x25')](function(){_0x5979d2[_0x0543('0x1a')](0xcc)[_0x0543('0x1b')]();});}};}function handleEntityNotFound(_0x26e500,_0x36d824){return function(_0x17a3de){if(!_0x17a3de){_0x26e500[_0x0543('0x19')](0x194);}return _0x17a3de;};}function handleError(_0xf1eccf,_0x40a261){_0x40a261=_0x40a261||0x1f4;return function(_0x21fc63){logger['error'](_0x21fc63[_0x0543('0x27')]);if(_0x21fc63[_0x0543('0x28')]){delete _0x21fc63[_0x0543('0x28')];}_0xf1eccf['status'](_0x40a261)[_0x0543('0x29')](_0x21fc63);};}exports[_0x0543('0x2a')]=function(_0x41c4a7,_0x10b881){var _0x5dd789={},_0x1732be={},_0x10b9f3={'count':0x0,'rows':[]};var _0x492f60=_['map'](db[_0x0543('0x2b')][_0x0543('0x2c')],function(_0x51d49d){return{'name':_0x51d49d[_0x0543('0x2d')],'type':_0x51d49d[_0x0543('0x2e')][_0x0543('0x2f')]};});_0x1732be[_0x0543('0x30')]=_[_0x0543('0x31')](_0x492f60,_0x0543('0x28'));_0x1732be[_0x0543('0x32')]=_['keys'](_0x41c4a7[_0x0543('0x32')]);_0x1732be['filters']=_[_0x0543('0x33')](_0x1732be[_0x0543('0x30')],_0x1732be[_0x0543('0x32')]);_0x5dd789[_0x0543('0x34')]=_[_0x0543('0x33')](_0x1732be['model'],qs[_0x0543('0x35')](_0x41c4a7['query'][_0x0543('0x35')]));_0x5dd789[_0x0543('0x34')]=_0x5dd789[_0x0543('0x34')][_0x0543('0x36')]?_0x5dd789['attributes']:_0x1732be[_0x0543('0x30')];if(!_0x41c4a7['query'][_0x0543('0x37')](_0x0543('0x38'))){_0x5dd789[_0x0543('0x1d')]=qs[_0x0543('0x1d')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1d')]);_0x5dd789[_0x0543('0x1c')]=qs[_0x0543('0x1c')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1c')]);}_0x5dd789['order']=qs[_0x0543('0x39')](_0x41c4a7[_0x0543('0x32')]['sort']);_0x5dd789[_0x0543('0x3a')]=qs['filters'](_[_0x0543('0x3b')](_0x41c4a7[_0x0543('0x32')],_0x1732be['filters']),_0x492f60);if(_0x41c4a7['query'][_0x0543('0x3c')]){_0x5dd789[_0x0543('0x3a')]=_['merge'](_0x5dd789[_0x0543('0x3a')],{'$or':_[_0x0543('0x31')](_0x492f60,function(_0x54543f){if(_0x54543f[_0x0543('0x2e')]!==_0x0543('0x3d')){var _0x3ecd70={};_0x3ecd70[_0x54543f[_0x0543('0x28')]]={'$like':'%'+_0x41c4a7[_0x0543('0x32')]['filter']+'%'};return _0x3ecd70;}})});}_0x5dd789=_['merge']({},_0x5dd789,_0x41c4a7['options']);var _0x486d9c={'where':_0x5dd789[_0x0543('0x3a')]};return db[_0x0543('0x2b')][_0x0543('0x1f')](_0x486d9c)['then'](function(_0xc66396){_0x10b9f3[_0x0543('0x1f')]=_0xc66396;if(_0x41c4a7[_0x0543('0x32')][_0x0543('0x3e')]){_0x5dd789[_0x0543('0x3f')]=[{'all':!![]}];}return db[_0x0543('0x2b')][_0x0543('0x40')](_0x5dd789);})['then'](function(_0x24a891){_0x10b9f3[_0x0543('0x41')]=_0x24a891;return _0x10b9f3;})[_0x0543('0x25')](respondWithFilteredResult(_0x10b881,_0x5dd789))[_0x0543('0x42')](handleError(_0x10b881,null));};exports[_0x0543('0x43')]=function(_0x43b7e8,_0x5bf53d){var _0x53dfb8={'raw':!![],'where':{'id':_0x43b7e8[_0x0543('0x44')]['id']}},_0x44116a={};_0x44116a[_0x0543('0x30')]=_[_0x0543('0x45')](db[_0x0543('0x2b')][_0x0543('0x2c')]);_0x44116a[_0x0543('0x32')]=_[_0x0543('0x45')](_0x43b7e8[_0x0543('0x32')]);_0x44116a['filters']=_['intersection'](_0x44116a[_0x0543('0x30')],_0x44116a[_0x0543('0x32')]);_0x53dfb8['attributes']=_['intersection'](_0x44116a[_0x0543('0x30')],qs[_0x0543('0x35')](_0x43b7e8['query'][_0x0543('0x35')]));_0x53dfb8['attributes']=_0x53dfb8[_0x0543('0x34')][_0x0543('0x36')]?_0x53dfb8['attributes']:_0x44116a['model'];if(_0x43b7e8[_0x0543('0x32')]['includeAll']){_0x53dfb8[_0x0543('0x3f')]=[{'all':!![]}];}_0x53dfb8=_[_0x0543('0x46')]({},_0x53dfb8,_0x43b7e8[_0x0543('0x47')]);return db[_0x0543('0x2b')][_0x0543('0x48')](_0x53dfb8)[_0x0543('0x25')](handleEntityNotFound(_0x5bf53d,null))['then'](respondWithResult(_0x5bf53d,null))[_0x0543('0x42')](handleError(_0x5bf53d,null));};exports[_0x0543('0x49')]=function(_0xb8076c,_0xf0a28f){return db[_0x0543('0x2b')]['create'](_0xb8076c[_0x0543('0x4a')],{})['then'](respondWithResult(_0xf0a28f,0xc9))[_0x0543('0x42')](handleError(_0xf0a28f,null));};exports[_0x0543('0x24')]=function(_0x3f4c40,_0x46d398){if(_0x3f4c40[_0x0543('0x4a')]['id']){delete _0x3f4c40[_0x0543('0x4a')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3f4c40['params']['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x46d398,null))[_0x0543('0x25')](saveUpdates(_0x3f4c40['body'],null))[_0x0543('0x25')](respondWithResult(_0x46d398,null))[_0x0543('0x42')](handleError(_0x46d398,null));};exports[_0x0543('0x26')]=function(_0x3d3bfc,_0x90dd22){return db[_0x0543('0x2b')]['find']({'where':{'id':_0x3d3bfc[_0x0543('0x44')]['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x90dd22,null))[_0x0543('0x25')](removeEntity(_0x90dd22,null))[_0x0543('0x42')](handleError(_0x90dd22,null));};exports[_0x0543('0x4b')]=function(_0x449150,_0x265bc1){return db[_0x0543('0x2b')][_0x0543('0x4b')]()[_0x0543('0x25')](respondWithResult(_0x265bc1,null))[_0x0543('0x42')](handleError(_0x265bc1,null));}; \ No newline at end of file +var _0x19fb=['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','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ChatQueueReport','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1fb4d7,_0x5c252d){var _0x37b2bd=function(_0x29a9eb){while(--_0x29a9eb){_0x1fb4d7['push'](_0x1fb4d7['shift']());}};_0x37b2bd(++_0x5c252d);}(_0x19fb,0xdd));var _0xb19f=function(_0x3b18f4,_0x569bee){_0x3b18f4=_0x3b18f4-0x0;var _0x5d748b=_0x19fb[_0x3b18f4];return _0x5d748b;};'use strict';var emlformat=require(_0xb19f('0x0'));var rimraf=require(_0xb19f('0x1'));var zipdir=require(_0xb19f('0x2'));var jsonpatch=require(_0xb19f('0x3'));var rp=require(_0xb19f('0x4'));var moment=require(_0xb19f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb19f('0x6'));var path=require(_0xb19f('0x7'));var sox=require(_0xb19f('0x8'));var csv=require(_0xb19f('0x9'));var ejs=require(_0xb19f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19f('0xb'));var squel=require(_0xb19f('0xc'));var crypto=require(_0xb19f('0xd'));var jsforce=require(_0xb19f('0xe'));var deskjs=require(_0xb19f('0xf'));var toCsv=require(_0xb19f('0x9'));var querystring=require(_0xb19f('0x10'));var Papa=require(_0xb19f('0x11'));var Redis=require('ioredis');var authService=require(_0xb19f('0x12'));var qs=require(_0xb19f('0x13'));var as=require(_0xb19f('0x14'));var hardwareService=require(_0xb19f('0x15'));var logger=require(_0xb19f('0x16'))(_0xb19f('0x17'));var utils=require(_0xb19f('0x18'));var config=require(_0xb19f('0x19'));var licenseUtil=require(_0xb19f('0x1a'));var db=require(_0xb19f('0x1b'))['db'];function respondWithStatusCode(_0x22272f,_0x26a1d1){_0x26a1d1=_0x26a1d1||0xcc;return function(_0xc4a0b5){if(_0xc4a0b5){return _0x22272f[_0xb19f('0x1c')](_0x26a1d1);}return _0x22272f[_0xb19f('0x1d')](_0x26a1d1)['end']();};}function respondWithResult(_0x214290,_0x3482f9){_0x3482f9=_0x3482f9||0xc8;return function(_0x34518a){if(_0x34518a){return _0x214290['status'](_0x3482f9)[_0xb19f('0x1e')](_0x34518a);}};}function respondWithFilteredResult(_0x13ebd4,_0x46b688){return function(_0x5640ea){if(_0x5640ea){var _0x11318c=typeof _0x46b688[_0xb19f('0x1f')]===_0xb19f('0x20')&&typeof _0x46b688['limit']===_0xb19f('0x20');var _0x49d304=_0x5640ea['count'];var _0x5b52d9=_0x11318c?0x0:_0x46b688[_0xb19f('0x1f')];var _0x3b4367=_0x11318c?_0x5640ea[_0xb19f('0x21')]:_0x46b688[_0xb19f('0x1f')]+_0x46b688['limit'];var _0x2aedec;if(_0x3b4367>=_0x49d304){_0x3b4367=_0x49d304;_0x2aedec=0xc8;}else{_0x2aedec=0xce;}_0x13ebd4[_0xb19f('0x1d')](_0x2aedec);return _0x13ebd4['set'](_0xb19f('0x22'),_0x5b52d9+'-'+_0x3b4367+'/'+_0x49d304)['json'](_0x5640ea);}return null;};}function patchUpdates(_0x3950c9){return function(_0x2acb39){try{jsonpatch[_0xb19f('0x23')](_0x2acb39,_0x3950c9,!![]);}catch(_0xb449b4){return BPromise[_0xb19f('0x24')](_0xb449b4);}return _0x2acb39[_0xb19f('0x25')]();};}function saveUpdates(_0x333198,_0x4eb288){return function(_0x9ab8fc){if(_0x9ab8fc){return _0x9ab8fc[_0xb19f('0x26')](_0x333198)[_0xb19f('0x27')](function(_0x34c638){return _0x34c638;});}return null;};}function removeEntity(_0x47e313,_0x25fbdc){return function(_0x33b4ad){if(_0x33b4ad){return _0x33b4ad[_0xb19f('0x28')]()[_0xb19f('0x27')](function(){_0x47e313[_0xb19f('0x1d')](0xcc)[_0xb19f('0x29')]();});}};}function handleEntityNotFound(_0x28e0ad,_0x388b28){return function(_0xf528d){if(!_0xf528d){_0x28e0ad[_0xb19f('0x1c')](0x194);}return _0xf528d;};}function handleError(_0x2e0544,_0x59ccde){_0x59ccde=_0x59ccde||0x1f4;return function(_0x3e1365){logger[_0xb19f('0x2a')](_0x3e1365['stack']);if(_0x3e1365[_0xb19f('0x2b')]){delete _0x3e1365[_0xb19f('0x2b')];}_0x2e0544['status'](_0x59ccde)['send'](_0x3e1365);};}exports[_0xb19f('0x2c')]=function(_0x17c22d,_0x3d2f84){var _0x46abbe={},_0x5e479a={},_0x5043b2={'count':0x0,'rows':[]};var _0x5e4a74=_[_0xb19f('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x4b06eb){return{'name':_0x4b06eb[_0xb19f('0x2e')],'type':_0x4b06eb[_0xb19f('0x2f')][_0xb19f('0x30')]};});_0x5e479a[_0xb19f('0x31')]=_[_0xb19f('0x2d')](_0x5e4a74,_0xb19f('0x2b'));_0x5e479a['query']=_[_0xb19f('0x32')](_0x17c22d[_0xb19f('0x33')]);_0x5e479a['filters']=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],_0x5e479a[_0xb19f('0x33')]);_0x46abbe[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],qs['fields'](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x36')]));_0x46abbe[_0xb19f('0x35')]=_0x46abbe[_0xb19f('0x35')][_0xb19f('0x37')]?_0x46abbe[_0xb19f('0x35')]:_0x5e479a['model'];if(!_0x17c22d[_0xb19f('0x33')][_0xb19f('0x38')](_0xb19f('0x39'))){_0x46abbe[_0xb19f('0x3a')]=qs[_0xb19f('0x3a')](_0x17c22d[_0xb19f('0x33')]['limit']);_0x46abbe[_0xb19f('0x1f')]=qs[_0xb19f('0x1f')](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x1f')]);}_0x46abbe[_0xb19f('0x3b')]=qs[_0xb19f('0x3c')](_0x17c22d[_0xb19f('0x33')]['sort']);_0x46abbe[_0xb19f('0x3d')]=qs['filters'](_[_0xb19f('0x3e')](_0x17c22d[_0xb19f('0x33')],_0x5e479a[_0xb19f('0x3f')]),_0x5e4a74);if(_0x17c22d['query'][_0xb19f('0x40')]){_0x46abbe['where']=_[_0xb19f('0x41')](_0x46abbe[_0xb19f('0x3d')],{'$or':_['map'](_0x5e4a74,function(_0x1e0a79){if(_0x1e0a79[_0xb19f('0x2f')]!==_0xb19f('0x42')){var _0x13afe8={};_0x13afe8[_0x1e0a79['name']]={'$like':'%'+_0x17c22d[_0xb19f('0x33')][_0xb19f('0x40')]+'%'};return _0x13afe8;}})});}_0x46abbe=_[_0xb19f('0x41')]({},_0x46abbe,_0x17c22d[_0xb19f('0x43')]);var _0x2b4b5d={'where':_0x46abbe[_0xb19f('0x3d')]};return db['ChatQueueReport'][_0xb19f('0x21')](_0x2b4b5d)['then'](function(_0x1b85f6){_0x5043b2['count']=_0x1b85f6;if(_0x17c22d[_0xb19f('0x33')][_0xb19f('0x44')]){_0x46abbe['include']=[{'all':!![]}];}return db[_0xb19f('0x45')][_0xb19f('0x46')](_0x46abbe);})[_0xb19f('0x27')](function(_0x13cae8){_0x5043b2['rows']=_0x13cae8;return _0x5043b2;})[_0xb19f('0x27')](respondWithFilteredResult(_0x3d2f84,_0x46abbe))[_0xb19f('0x47')](handleError(_0x3d2f84,null));};exports[_0xb19f('0x48')]=function(_0x52c368,_0x2c68de){var _0x5772ac={'raw':!![],'where':{'id':_0x52c368[_0xb19f('0x49')]['id']}},_0x16bf0d={};_0x16bf0d[_0xb19f('0x31')]=_[_0xb19f('0x32')](db[_0xb19f('0x45')][_0xb19f('0x4a')]);_0x16bf0d[_0xb19f('0x33')]=_[_0xb19f('0x32')](_0x52c368['query']);_0x16bf0d[_0xb19f('0x3f')]=_[_0xb19f('0x34')](_0x16bf0d['model'],_0x16bf0d[_0xb19f('0x33')]);_0x5772ac[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x16bf0d['model'],qs[_0xb19f('0x36')](_0x52c368['query'][_0xb19f('0x36')]));_0x5772ac['attributes']=_0x5772ac[_0xb19f('0x35')]['length']?_0x5772ac[_0xb19f('0x35')]:_0x16bf0d[_0xb19f('0x31')];if(_0x52c368[_0xb19f('0x33')]['includeAll']){_0x5772ac['include']=[{'all':!![]}];}_0x5772ac=_[_0xb19f('0x41')]({},_0x5772ac,_0x52c368[_0xb19f('0x43')]);return db[_0xb19f('0x45')]['find'](_0x5772ac)['then'](handleEntityNotFound(_0x2c68de,null))['then'](respondWithResult(_0x2c68de,null))[_0xb19f('0x47')](handleError(_0x2c68de,null));};exports[_0xb19f('0x4b')]=function(_0x5dbfdc,_0x194910){return db['ChatQueueReport'][_0xb19f('0x4b')](_0x5dbfdc[_0xb19f('0x4c')],{})[_0xb19f('0x27')](respondWithResult(_0x194910,0xc9))[_0xb19f('0x47')](handleError(_0x194910,null));};exports[_0xb19f('0x26')]=function(_0x401787,_0x20da72){if(_0x401787[_0xb19f('0x4c')]['id']){delete _0x401787[_0xb19f('0x4c')]['id'];}return db[_0xb19f('0x45')][_0xb19f('0x4d')]({'where':{'id':_0x401787['params']['id']}})['then'](handleEntityNotFound(_0x20da72,null))[_0xb19f('0x27')](saveUpdates(_0x401787[_0xb19f('0x4c')],null))[_0xb19f('0x27')](respondWithResult(_0x20da72,null))[_0xb19f('0x47')](handleError(_0x20da72,null));};exports[_0xb19f('0x28')]=function(_0x57812a,_0x58b3c5){return db[_0xb19f('0x45')]['find']({'where':{'id':_0x57812a[_0xb19f('0x49')]['id']}})[_0xb19f('0x27')](handleEntityNotFound(_0x58b3c5,null))[_0xb19f('0x27')](removeEntity(_0x58b3c5,null))['catch'](handleError(_0x58b3c5,null));};exports[_0xb19f('0x4e')]=function(_0x12b227,_0x1b7e57){return db[_0xb19f('0x45')][_0xb19f('0x4e')]()[_0xb19f('0x27')](respondWithResult(_0x1b7e57,null))[_0xb19f('0x47')](handleError(_0x1b7e57,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 611e5f7..39281e0 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x430524,_0x23b611){var _0x3a726d=function(_0x5cc39d){while(--_0x5cc39d){_0x430524['push'](_0x430524['shift']());}};_0x3a726d(++_0x23b611);}(_0xe706,0xa3));var _0x6e70=function(_0x567703,_0x4b1cfa){_0x567703=_0x567703-0x0;var _0x1cd94a=_0xe706[_0x567703];return _0x1cd94a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2d583f1..e0b7a31 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 _0x0145=['then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0145,0xc5));var _0x5014=function(_0x58d40c,_0x28e394){_0x58d40c=_0x58d40c-0x0;var _0x70ea9e=_0x0145[_0x58d40c];return _0x70ea9e;};'use strict';var _=require(_0x5014('0x0'));var util=require(_0x5014('0x1'));var moment=require(_0x5014('0x2'));var BPromise=require('bluebird');var rs=require(_0x5014('0x3'));var fs=require('fs');var Redis=require(_0x5014('0x4'));var db=require(_0x5014('0x5'))['db'];var utils=require(_0x5014('0x6'));var logger=require(_0x5014('0x7'))(_0x5014('0x8'));var config=require(_0x5014('0x9'));var jayson=require(_0x5014('0xa'));var client=jayson[_0x5014('0xb')][_0x5014('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2baf7f,_0x5cfcfd,_0x1decac){return new BPromise(function(_0x2dad9f,_0x343899){return client['request'](_0x2baf7f,_0x1decac)[_0x5014('0xd')](function(_0x44d221){logger[_0x5014('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x5cfcfd,_0x5014('0xf'));logger['debug'](_0x5014('0x10'),_0x5cfcfd,_0x5014('0xf'),JSON[_0x5014('0x11')](_0x44d221));if(_0x44d221[_0x5014('0x12')]){if(_0x44d221[_0x5014('0x12')][_0x5014('0x13')]===0x1f4){logger[_0x5014('0x12')](_0x5014('0x14'),_0x5cfcfd,_0x44d221['error'][_0x5014('0x15')]);return _0x343899(_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);}logger[_0x5014('0x12')](_0x5014('0x14'),_0x5cfcfd,_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);return _0x2dad9f(_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);}else{logger[_0x5014('0xe')](_0x5014('0x14'),_0x5cfcfd,'request\x20sent');_0x2dad9f(_0x44d221[_0x5014('0x16')][_0x5014('0x15')]);}})[_0x5014('0x17')](function(_0x296471){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5cfcfd,_0x296471);_0x343899(_0x296471);});});}exports[_0x5014('0x18')]=function(_0x4f1a36){var _0x273018=this;return new Promise(function(_0x1c9451,_0x4a8f04){return db[_0x5014('0x19')][_0x5014('0x1a')](_0x4f1a36[_0x5014('0x1b')],{'raw':_0x4f1a36[_0x5014('0x1c')]?_0x4f1a36[_0x5014('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5014('0xd')](function(_0x59ea2a){logger[_0x5014('0xe')]('CreateChatQueueReport',_0x4f1a36);logger[_0x5014('0x1d')](_0x5014('0x18'),_0x4f1a36,JSON[_0x5014('0x11')](_0x59ea2a));_0x1c9451(_0x59ea2a);})[_0x5014('0x17')](function(_0x44cfb1){logger['error'](_0x5014('0x18'),_0x44cfb1[_0x5014('0x15')],_0x4f1a36);_0x4a8f04(_0x273018[_0x5014('0x12')](0x1f4,_0x44cfb1[_0x5014('0x15')]));});});};exports[_0x5014('0x1e')]=function(_0x2ba853){var _0x569ef9=this;return new Promise(function(_0x241314,_0x378e46){return db[_0x5014('0x19')][_0x5014('0x1f')](_0x2ba853[_0x5014('0x1b')],{'raw':_0x2ba853[_0x5014('0x1c')]?_0x2ba853['options'][_0x5014('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba853['options']?_0x2ba853['options'][_0x5014('0x21')]||null:null,'attributes':_0x2ba853[_0x5014('0x1c')]?_0x2ba853[_0x5014('0x1c')]['attributes']||null:null,'limit':_0x2ba853['options']?_0x2ba853[_0x5014('0x1c')][_0x5014('0x22')]||null:null})[_0x5014('0xd')](function(_0x5beaec){logger[_0x5014('0xe')](_0x5014('0x1e'),_0x2ba853);logger[_0x5014('0x1d')]('UpdateChatQueueReport',_0x2ba853,JSON['stringify'](_0x5beaec));_0x241314(_0x5beaec);})[_0x5014('0x17')](function(_0x55f98c){logger[_0x5014('0x12')](_0x5014('0x1e'),_0x55f98c[_0x5014('0x15')],_0x2ba853);_0x378e46(_0x569ef9[_0x5014('0x12')](0x1f4,_0x55f98c[_0x5014('0x15')]));});});}; \ No newline at end of file +var _0x2c5e=['catch','UpdateChatQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x431c04,_0xf7760c){var _0x3bd133=function(_0x39141c){while(--_0x39141c){_0x431c04['push'](_0x431c04['shift']());}};_0x3bd133(++_0xf7760c);}(_0x2c5e,0x19d));var _0xe2c5=function(_0x11c77a,_0x51c1f7){_0x11c77a=_0x11c77a-0x0;var _0x3778da=_0x2c5e[_0x11c77a];return _0x3778da;};'use strict';var _=require(_0xe2c5('0x0'));var util=require('util');var moment=require(_0xe2c5('0x1'));var BPromise=require(_0xe2c5('0x2'));var rs=require(_0xe2c5('0x3'));var fs=require('fs');var Redis=require(_0xe2c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2c5('0x5'));var logger=require(_0xe2c5('0x6'))(_0xe2c5('0x7'));var config=require(_0xe2c5('0x8'));var jayson=require(_0xe2c5('0x9'));var client=jayson[_0xe2c5('0xa')][_0xe2c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52249b,_0x2f1077,_0x5f0ce3){return new BPromise(function(_0x454a8e,_0x9aa7e0){return client['request'](_0x52249b,_0x5f0ce3)[_0xe2c5('0xc')](function(_0x3a7854){logger[_0xe2c5('0xd')](_0xe2c5('0xe'),_0x2f1077,_0xe2c5('0xf'));logger[_0xe2c5('0x10')](_0xe2c5('0x11'),_0x2f1077,_0xe2c5('0xf'),JSON[_0xe2c5('0x12')](_0x3a7854));if(_0x3a7854[_0xe2c5('0x13')]){if(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x14')]===0x1f4){logger[_0xe2c5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0x3a7854['error'][_0xe2c5('0x15')]);return _0x9aa7e0(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);}logger[_0xe2c5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);return _0x454a8e(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);}else{logger[_0xe2c5('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0xe2c5('0xf'));_0x454a8e(_0x3a7854[_0xe2c5('0x16')][_0xe2c5('0x15')]);}})['catch'](function(_0x56bae2){logger[_0xe2c5('0x13')](_0xe2c5('0xe'),_0x2f1077,_0x56bae2);_0x9aa7e0(_0x56bae2);});});}exports[_0xe2c5('0x17')]=function(_0x2df4c3){var _0x13a197=this;return new Promise(function(_0x56f52c,_0x42dc74){return db[_0xe2c5('0x18')][_0xe2c5('0x19')](_0x2df4c3[_0xe2c5('0x1a')],{'raw':_0x2df4c3[_0xe2c5('0x1b')]?_0x2df4c3[_0xe2c5('0x1b')][_0xe2c5('0x1c')]===undefined?!![]:![]:!![]})[_0xe2c5('0xc')](function(_0x2ac22d){logger[_0xe2c5('0xd')](_0xe2c5('0x17'),_0x2df4c3);logger['debug'](_0xe2c5('0x17'),_0x2df4c3,JSON[_0xe2c5('0x12')](_0x2ac22d));_0x56f52c(_0x2ac22d);})[_0xe2c5('0x1d')](function(_0x427a79){logger['error'](_0xe2c5('0x17'),_0x427a79['message'],_0x2df4c3);_0x42dc74(_0x13a197[_0xe2c5('0x13')](0x1f4,_0x427a79['message']));});});};exports[_0xe2c5('0x1e')]=function(_0xa284d1){var _0x3d3bd0=this;return new Promise(function(_0x27b670,_0x50c684){return db[_0xe2c5('0x18')][_0xe2c5('0x1f')](_0xa284d1[_0xe2c5('0x1a')],{'raw':_0xa284d1['options']?_0xa284d1[_0xe2c5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')]['where']||null:null,'attributes':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')][_0xe2c5('0x20')]||null:null,'limit':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')][_0xe2c5('0x21')]||null:null})[_0xe2c5('0xc')](function(_0x201b78){logger['info'](_0xe2c5('0x1e'),_0xa284d1);logger[_0xe2c5('0x10')](_0xe2c5('0x1e'),_0xa284d1,JSON[_0xe2c5('0x12')](_0x201b78));_0x27b670(_0x201b78);})['catch'](function(_0x3992dd){logger[_0xe2c5('0x13')](_0xe2c5('0x1e'),_0x3992dd['message'],_0xa284d1);_0x50c684(_0x3d3bd0[_0xe2c5('0x13')](0x1f4,_0x3992dd[_0xe2c5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 505d167..9a114d0 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 _0xe125=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xe125,0x1b1));var _0x5e12=function(_0x2c321f,_0x183faf){_0x2c321f=_0x2c321f-0x0;var _0x5300a0=_0xe125[_0x2c321f];return _0x5300a0;};'use strict';var multer=require(_0x5e12('0x0'));var util=require(_0x5e12('0x1'));var path=require(_0x5e12('0x2'));var timeout=require(_0x5e12('0x3'));var express=require(_0x5e12('0x4'));var router=express[_0x5e12('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e12('0x6'));var interaction=require(_0x5e12('0x7'));var config=require(_0x5e12('0x8'));var controller=require('./chatQueueReport.controller');router[_0x5e12('0x9')]('/',auth[_0x5e12('0xa')](),controller['index']);router[_0x5e12('0x9')](_0x5e12('0xb'),auth[_0x5e12('0xa')](),controller['describe']);router[_0x5e12('0x9')]('/:id',auth[_0x5e12('0xa')](),controller[_0x5e12('0xc')]);router[_0x5e12('0xd')]('/',auth[_0x5e12('0xa')](),controller['create']);router[_0x5e12('0xe')](_0x5e12('0xf'),auth['isAuthenticated'](),controller[_0x5e12('0x10')]);router[_0x5e12('0x11')](_0x5e12('0xf'),auth[_0x5e12('0xa')](),controller[_0x5e12('0x12')]);module[_0x5e12('0x13')]=router; \ No newline at end of file +var _0xa9ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router'];(function(_0x10bb9c,_0x311990){var _0x379d24=function(_0x2565b6){while(--_0x2565b6){_0x10bb9c['push'](_0x10bb9c['shift']());}};_0x379d24(++_0x311990);}(_0xa9ed,0x11b));var _0xda9e=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0xa9ed[_0x43026b];return _0x4a96cd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda9e('0x0'));var timeout=require('connect-timeout');var express=require(_0xda9e('0x1'));var router=express[_0xda9e('0x2')]();var fs_extra=require(_0xda9e('0x3'));var auth=require(_0xda9e('0x4'));var interaction=require(_0xda9e('0x5'));var config=require(_0xda9e('0x6'));var controller=require(_0xda9e('0x7'));router[_0xda9e('0x8')]('/',auth[_0xda9e('0x9')](),controller[_0xda9e('0xa')]);router[_0xda9e('0x8')](_0xda9e('0xb'),auth[_0xda9e('0x9')](),controller[_0xda9e('0xc')]);router[_0xda9e('0x8')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0xe')]);router[_0xda9e('0xf')]('/',auth['isAuthenticated'](),controller[_0xda9e('0x10')]);router[_0xda9e('0x11')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0x12')]);router[_0xda9e('0x13')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0x14')]);module[_0xda9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 0b509b4..ef6c23b 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xfec81c,_0x3f7f63){var _0x5d21f6=function(_0x2a0813){while(--_0x2a0813){_0xfec81c['push'](_0xfec81c['shift']());}};_0x5d21f6(++_0x3f7f63);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5cc9ae,_0x116739){var _0xef9aa1=function(_0x403b0c){while(--_0x403b0c){_0x5cc9ae['push'](_0x5cc9ae['shift']());}};_0xef9aa1(++_0x116739);}(_0x54ef,0x112));var _0xf54e=function(_0x2cd04e,_0x56b3cd){_0x2cd04e=_0x2cd04e-0x0;var _0x28beda=_0x54ef[_0x2cd04e];return _0x28beda;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5ae14db..d5803f4 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 _0xf87b=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','update','destroy','then','end','stack','name','send','index','map','ChatTransferReport','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel'];(function(_0x3b086e,_0x38d0ce){var _0x14dbd3=function(_0x264610){while(--_0x264610){_0x3b086e['push'](_0x3b086e['shift']());}};_0x14dbd3(++_0x38d0ce);}(_0xf87b,0x156));var _0xbf87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf87b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbf87('0x0'));var rimraf=require(_0xbf87('0x1'));var zipdir=require(_0xbf87('0x2'));var jsonpatch=require(_0xbf87('0x3'));var rp=require(_0xbf87('0x4'));var moment=require(_0xbf87('0x5'));var BPromise=require(_0xbf87('0x6'));var Mustache=require(_0xbf87('0x7'));var util=require(_0xbf87('0x8'));var path=require(_0xbf87('0x9'));var sox=require('sox');var csv=require(_0xbf87('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf87('0xb'));var _=require('lodash');var squel=require(_0xbf87('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf87('0xd'));var deskjs=require(_0xbf87('0xe'));var toCsv=require(_0xbf87('0xa'));var querystring=require(_0xbf87('0xf'));var Papa=require('papaparse');var Redis=require(_0xbf87('0x10'));var authService=require(_0xbf87('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf87('0x12'));var logger=require(_0xbf87('0x13'))(_0xbf87('0x14'));var utils=require('../../config/utils');var config=require(_0xbf87('0x15'));var licenseUtil=require(_0xbf87('0x16'));var db=require(_0xbf87('0x17'))['db'];function respondWithStatusCode(_0x2ad1e2,_0x302ac0){_0x302ac0=_0x302ac0||0xcc;return function(_0x4035c2){if(_0x4035c2){return _0x2ad1e2[_0xbf87('0x18')](_0x302ac0);}return _0x2ad1e2[_0xbf87('0x19')](_0x302ac0)['end']();};}function respondWithResult(_0x584d3c,_0x52277a){_0x52277a=_0x52277a||0xc8;return function(_0x81f4d6){if(_0x81f4d6){return _0x584d3c[_0xbf87('0x19')](_0x52277a)['json'](_0x81f4d6);}};}function respondWithFilteredResult(_0x1e8dd5,_0x4d0527){return function(_0x449cb1){if(_0x449cb1){var _0x5bc1a7=typeof _0x4d0527[_0xbf87('0x1a')]==='undefined'&&typeof _0x4d0527[_0xbf87('0x1b')]==='undefined';var _0x52a0a8=_0x449cb1[_0xbf87('0x1c')];var _0x4d70ca=_0x5bc1a7?0x0:_0x4d0527[_0xbf87('0x1a')];var _0x33cfc1=_0x5bc1a7?_0x449cb1[_0xbf87('0x1c')]:_0x4d0527[_0xbf87('0x1a')]+_0x4d0527[_0xbf87('0x1b')];var _0xf3e2c4;if(_0x33cfc1>=_0x52a0a8){_0x33cfc1=_0x52a0a8;_0xf3e2c4=0xc8;}else{_0xf3e2c4=0xce;}_0x1e8dd5['status'](_0xf3e2c4);return _0x1e8dd5[_0xbf87('0x1d')](_0xbf87('0x1e'),_0x4d70ca+'-'+_0x33cfc1+'/'+_0x52a0a8)['json'](_0x449cb1);}return null;};}function patchUpdates(_0x28fe91){return function(_0x431943){try{jsonpatch['apply'](_0x431943,_0x28fe91,!![]);}catch(_0x2ebd3a){return BPromise['reject'](_0x2ebd3a);}return _0x431943['save']();};}function saveUpdates(_0x29e964,_0x9c71af){return function(_0x5681fe){if(_0x5681fe){return _0x5681fe[_0xbf87('0x1f')](_0x29e964)['then'](function(_0x315424){return _0x315424;});}return null;};}function removeEntity(_0x4eb504,_0x1b80cf){return function(_0x511df2){if(_0x511df2){return _0x511df2[_0xbf87('0x20')]()[_0xbf87('0x21')](function(){_0x4eb504[_0xbf87('0x19')](0xcc)[_0xbf87('0x22')]();});}};}function handleEntityNotFound(_0x24c3ad,_0x335960){return function(_0x26d299){if(!_0x26d299){_0x24c3ad[_0xbf87('0x18')](0x194);}return _0x26d299;};}function handleError(_0x31fcbf,_0x2212ce){_0x2212ce=_0x2212ce||0x1f4;return function(_0x976d48){logger['error'](_0x976d48[_0xbf87('0x23')]);if(_0x976d48['name']){delete _0x976d48[_0xbf87('0x24')];}_0x31fcbf['status'](_0x2212ce)[_0xbf87('0x25')](_0x976d48);};}exports[_0xbf87('0x26')]=function(_0x3acf58,_0x5d976d){var _0x15bc12={},_0x66bce={},_0x245961={'count':0x0,'rows':[]};var _0x1092a7=_[_0xbf87('0x27')](db[_0xbf87('0x28')]['rawAttributes'],function(_0x5b3c02){return{'name':_0x5b3c02[_0xbf87('0x29')],'type':_0x5b3c02['type'][_0xbf87('0x2a')]};});_0x66bce['model']=_[_0xbf87('0x27')](_0x1092a7,_0xbf87('0x24'));_0x66bce[_0xbf87('0x2b')]=_[_0xbf87('0x2c')](_0x3acf58['query']);_0x66bce['filters']=_['intersection'](_0x66bce[_0xbf87('0x2d')],_0x66bce[_0xbf87('0x2b')]);_0x15bc12[_0xbf87('0x2e')]=_['intersection'](_0x66bce['model'],qs[_0xbf87('0x2f')](_0x3acf58[_0xbf87('0x2b')]['fields']));_0x15bc12[_0xbf87('0x2e')]=_0x15bc12[_0xbf87('0x2e')][_0xbf87('0x30')]?_0x15bc12[_0xbf87('0x2e')]:_0x66bce[_0xbf87('0x2d')];if(!_0x3acf58['query'][_0xbf87('0x31')](_0xbf87('0x32'))){_0x15bc12[_0xbf87('0x1b')]=qs[_0xbf87('0x1b')](_0x3acf58['query'][_0xbf87('0x1b')]);_0x15bc12[_0xbf87('0x1a')]=qs['offset'](_0x3acf58[_0xbf87('0x2b')][_0xbf87('0x1a')]);}_0x15bc12['order']=qs[_0xbf87('0x33')](_0x3acf58['query'][_0xbf87('0x33')]);_0x15bc12[_0xbf87('0x34')]=qs[_0xbf87('0x35')](_[_0xbf87('0x36')](_0x3acf58['query'],_0x66bce[_0xbf87('0x35')]),_0x1092a7);if(_0x3acf58['query'][_0xbf87('0x37')]){_0x15bc12[_0xbf87('0x34')]=_[_0xbf87('0x38')](_0x15bc12['where'],{'$or':_['map'](_0x1092a7,function(_0x26e36a){if(_0x26e36a[_0xbf87('0x39')]!=='VIRTUAL'){var _0x1ff46e={};_0x1ff46e[_0x26e36a[_0xbf87('0x24')]]={'$like':'%'+_0x3acf58[_0xbf87('0x2b')]['filter']+'%'};return _0x1ff46e;}})});}_0x15bc12=_[_0xbf87('0x38')]({},_0x15bc12,_0x3acf58[_0xbf87('0x3a')]);var _0x3ad355={'where':_0x15bc12['where']};return db[_0xbf87('0x28')]['count'](_0x3ad355)['then'](function(_0x1d0d1f){_0x245961['count']=_0x1d0d1f;if(_0x3acf58[_0xbf87('0x2b')][_0xbf87('0x3b')]){_0x15bc12[_0xbf87('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xbf87('0x3d')](_0x15bc12);})['then'](function(_0x2a680a){_0x245961['rows']=_0x2a680a;return _0x245961;})[_0xbf87('0x21')](respondWithFilteredResult(_0x5d976d,_0x15bc12))[_0xbf87('0x3e')](handleError(_0x5d976d,null));};exports[_0xbf87('0x3f')]=function(_0x2b3c1a,_0x3436a8){var _0x5f240d={'raw':!![],'where':{'id':_0x2b3c1a[_0xbf87('0x40')]['id']}},_0x578a2f={};_0x578a2f[_0xbf87('0x2d')]=_[_0xbf87('0x2c')](db[_0xbf87('0x28')][_0xbf87('0x41')]);_0x578a2f['query']=_[_0xbf87('0x2c')](_0x2b3c1a[_0xbf87('0x2b')]);_0x578a2f[_0xbf87('0x35')]=_['intersection'](_0x578a2f['model'],_0x578a2f[_0xbf87('0x2b')]);_0x5f240d[_0xbf87('0x2e')]=_[_0xbf87('0x42')](_0x578a2f[_0xbf87('0x2d')],qs[_0xbf87('0x2f')](_0x2b3c1a[_0xbf87('0x2b')][_0xbf87('0x2f')]));_0x5f240d[_0xbf87('0x2e')]=_0x5f240d[_0xbf87('0x2e')][_0xbf87('0x30')]?_0x5f240d[_0xbf87('0x2e')]:_0x578a2f[_0xbf87('0x2d')];if(_0x2b3c1a[_0xbf87('0x2b')][_0xbf87('0x3b')]){_0x5f240d['include']=[{'all':!![]}];}_0x5f240d=_['merge']({},_0x5f240d,_0x2b3c1a[_0xbf87('0x3a')]);return db[_0xbf87('0x28')][_0xbf87('0x43')](_0x5f240d)[_0xbf87('0x21')](handleEntityNotFound(_0x3436a8,null))[_0xbf87('0x21')](respondWithResult(_0x3436a8,null))[_0xbf87('0x3e')](handleError(_0x3436a8,null));};exports[_0xbf87('0x44')]=function(_0x440155,_0x16566c){return db[_0xbf87('0x28')][_0xbf87('0x44')](_0x440155['body'],{})[_0xbf87('0x21')](respondWithResult(_0x16566c,0xc9))[_0xbf87('0x3e')](handleError(_0x16566c,null));};exports['update']=function(_0x4296b0,_0x4d5f15){if(_0x4296b0[_0xbf87('0x45')]['id']){delete _0x4296b0[_0xbf87('0x45')]['id'];}return db[_0xbf87('0x28')]['find']({'where':{'id':_0x4296b0[_0xbf87('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d5f15,null))[_0xbf87('0x21')](saveUpdates(_0x4296b0['body'],null))[_0xbf87('0x21')](respondWithResult(_0x4d5f15,null))[_0xbf87('0x3e')](handleError(_0x4d5f15,null));};exports['destroy']=function(_0x32bf66,_0x2e1105){return db[_0xbf87('0x28')][_0xbf87('0x43')]({'where':{'id':_0x32bf66['params']['id']}})[_0xbf87('0x21')](handleEntityNotFound(_0x2e1105,null))[_0xbf87('0x21')](removeEntity(_0x2e1105,null))[_0xbf87('0x3e')](handleError(_0x2e1105,null));};exports[_0xbf87('0x46')]=function(_0xa683f3,_0x45da2b){return db[_0xbf87('0x28')][_0xbf87('0x46')]()[_0xbf87('0x21')](respondWithResult(_0x45da2b,null))[_0xbf87('0x3e')](handleError(_0x45da2b,null));}; \ No newline at end of file +var _0x3887=['papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','then','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2631ea,_0x5ce0b0){var _0x4c3808=function(_0x8e021d){while(--_0x8e021d){_0x2631ea['push'](_0x2631ea['shift']());}};_0x4c3808(++_0x5ce0b0);}(_0x3887,0x82));var _0x7388=function(_0x2f49df,_0x518919){_0x2f49df=_0x2f49df-0x0;var _0x1ec090=_0x3887[_0x2f49df];return _0x1ec090;};'use strict';var emlformat=require(_0x7388('0x0'));var rimraf=require(_0x7388('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7388('0x2'));var BPromise=require(_0x7388('0x3'));var Mustache=require(_0x7388('0x4'));var util=require(_0x7388('0x5'));var path=require(_0x7388('0x6'));var sox=require('sox');var csv=require(_0x7388('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7388('0x8'));var squel=require(_0x7388('0x9'));var crypto=require(_0x7388('0xa'));var jsforce=require(_0x7388('0xb'));var deskjs=require(_0x7388('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7388('0xd'));var Papa=require(_0x7388('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7388('0xf'));var hardwareService=require(_0x7388('0x10'));var logger=require(_0x7388('0x11'))(_0x7388('0x12'));var utils=require(_0x7388('0x13'));var config=require(_0x7388('0x14'));var licenseUtil=require(_0x7388('0x15'));var db=require(_0x7388('0x16'))['db'];function respondWithStatusCode(_0x1009ba,_0xbd4f0d){_0xbd4f0d=_0xbd4f0d||0xcc;return function(_0x32a1b1){if(_0x32a1b1){return _0x1009ba[_0x7388('0x17')](_0xbd4f0d);}return _0x1009ba[_0x7388('0x18')](_0xbd4f0d)[_0x7388('0x19')]();};}function respondWithResult(_0x4b4a79,_0x16cc8d){_0x16cc8d=_0x16cc8d||0xc8;return function(_0xc13899){if(_0xc13899){return _0x4b4a79['status'](_0x16cc8d)[_0x7388('0x1a')](_0xc13899);}};}function respondWithFilteredResult(_0x8df6f7,_0x12effe){return function(_0x352c63){if(_0x352c63){var _0x2d252c=typeof _0x12effe[_0x7388('0x1b')]==='undefined'&&typeof _0x12effe[_0x7388('0x1c')]===_0x7388('0x1d');var _0x305751=_0x352c63[_0x7388('0x1e')];var _0x4ac3ca=_0x2d252c?0x0:_0x12effe[_0x7388('0x1b')];var _0x4b4f92=_0x2d252c?_0x352c63['count']:_0x12effe[_0x7388('0x1b')]+_0x12effe[_0x7388('0x1c')];var _0x49eb55;if(_0x4b4f92>=_0x305751){_0x4b4f92=_0x305751;_0x49eb55=0xc8;}else{_0x49eb55=0xce;}_0x8df6f7[_0x7388('0x18')](_0x49eb55);return _0x8df6f7[_0x7388('0x1f')](_0x7388('0x20'),_0x4ac3ca+'-'+_0x4b4f92+'/'+_0x305751)[_0x7388('0x1a')](_0x352c63);}return null;};}function patchUpdates(_0x28f1da){return function(_0xc69ded){try{jsonpatch[_0x7388('0x21')](_0xc69ded,_0x28f1da,!![]);}catch(_0x50cf8a){return BPromise[_0x7388('0x22')](_0x50cf8a);}return _0xc69ded['save']();};}function saveUpdates(_0x10c0d8,_0xde4f98){return function(_0x44e25a){if(_0x44e25a){return _0x44e25a['update'](_0x10c0d8)['then'](function(_0x480b26){return _0x480b26;});}return null;};}function removeEntity(_0x214896,_0xf312ee){return function(_0x128caa){if(_0x128caa){return _0x128caa['destroy']()['then'](function(){_0x214896[_0x7388('0x18')](0xcc)[_0x7388('0x19')]();});}};}function handleEntityNotFound(_0x6ef790,_0x5e30b0){return function(_0x187710){if(!_0x187710){_0x6ef790[_0x7388('0x17')](0x194);}return _0x187710;};}function handleError(_0x1774f2,_0x178ee0){_0x178ee0=_0x178ee0||0x1f4;return function(_0x228b64){logger[_0x7388('0x23')](_0x228b64[_0x7388('0x24')]);if(_0x228b64[_0x7388('0x25')]){delete _0x228b64['name'];}_0x1774f2[_0x7388('0x18')](_0x178ee0)['send'](_0x228b64);};}exports[_0x7388('0x26')]=function(_0x16cceb,_0x57ed12){var _0x4f8988={},_0xcc36b5={},_0x29d093={'count':0x0,'rows':[]};var _0x4d2ffc=_['map'](db[_0x7388('0x27')][_0x7388('0x28')],function(_0x4c50e7){return{'name':_0x4c50e7[_0x7388('0x29')],'type':_0x4c50e7['type']['key']};});_0xcc36b5[_0x7388('0x2a')]=_['map'](_0x4d2ffc,'name');_0xcc36b5[_0x7388('0x2b')]=_[_0x7388('0x2c')](_0x16cceb['query']);_0xcc36b5[_0x7388('0x2d')]=_[_0x7388('0x2e')](_0xcc36b5[_0x7388('0x2a')],_0xcc36b5['query']);_0x4f8988[_0x7388('0x2f')]=_[_0x7388('0x2e')](_0xcc36b5[_0x7388('0x2a')],qs[_0x7388('0x30')](_0x16cceb[_0x7388('0x2b')][_0x7388('0x30')]));_0x4f8988[_0x7388('0x2f')]=_0x4f8988[_0x7388('0x2f')][_0x7388('0x31')]?_0x4f8988['attributes']:_0xcc36b5[_0x7388('0x2a')];if(!_0x16cceb['query']['hasOwnProperty'](_0x7388('0x32'))){_0x4f8988[_0x7388('0x1c')]=qs['limit'](_0x16cceb['query'][_0x7388('0x1c')]);_0x4f8988[_0x7388('0x1b')]=qs['offset'](_0x16cceb[_0x7388('0x2b')][_0x7388('0x1b')]);}_0x4f8988[_0x7388('0x33')]=qs[_0x7388('0x34')](_0x16cceb[_0x7388('0x2b')][_0x7388('0x34')]);_0x4f8988['where']=qs[_0x7388('0x2d')](_[_0x7388('0x35')](_0x16cceb[_0x7388('0x2b')],_0xcc36b5[_0x7388('0x2d')]),_0x4d2ffc);if(_0x16cceb[_0x7388('0x2b')][_0x7388('0x36')]){_0x4f8988[_0x7388('0x37')]=_[_0x7388('0x38')](_0x4f8988[_0x7388('0x37')],{'$or':_[_0x7388('0x39')](_0x4d2ffc,function(_0xc3b574){if(_0xc3b574['type']!==_0x7388('0x3a')){var _0x282c66={};_0x282c66[_0xc3b574[_0x7388('0x25')]]={'$like':'%'+_0x16cceb[_0x7388('0x2b')][_0x7388('0x36')]+'%'};return _0x282c66;}})});}_0x4f8988=_['merge']({},_0x4f8988,_0x16cceb[_0x7388('0x3b')]);var _0xf92b70={'where':_0x4f8988[_0x7388('0x37')]};return db[_0x7388('0x27')][_0x7388('0x1e')](_0xf92b70)['then'](function(_0x15225b){_0x29d093['count']=_0x15225b;if(_0x16cceb['query'][_0x7388('0x3c')]){_0x4f8988[_0x7388('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x4f8988);})[_0x7388('0x3e')](function(_0x3d1118){_0x29d093[_0x7388('0x3f')]=_0x3d1118;return _0x29d093;})[_0x7388('0x3e')](respondWithFilteredResult(_0x57ed12,_0x4f8988))[_0x7388('0x40')](handleError(_0x57ed12,null));};exports[_0x7388('0x41')]=function(_0x1087f0,_0x2a1148){var _0x11e003={'raw':!![],'where':{'id':_0x1087f0[_0x7388('0x42')]['id']}},_0x24fa29={};_0x24fa29['model']=_[_0x7388('0x2c')](db[_0x7388('0x27')][_0x7388('0x28')]);_0x24fa29[_0x7388('0x2b')]=_[_0x7388('0x2c')](_0x1087f0[_0x7388('0x2b')]);_0x24fa29['filters']=_['intersection'](_0x24fa29[_0x7388('0x2a')],_0x24fa29[_0x7388('0x2b')]);_0x11e003[_0x7388('0x2f')]=_['intersection'](_0x24fa29['model'],qs[_0x7388('0x30')](_0x1087f0[_0x7388('0x2b')]['fields']));_0x11e003[_0x7388('0x2f')]=_0x11e003['attributes'][_0x7388('0x31')]?_0x11e003[_0x7388('0x2f')]:_0x24fa29[_0x7388('0x2a')];if(_0x1087f0[_0x7388('0x2b')][_0x7388('0x3c')]){_0x11e003['include']=[{'all':!![]}];}_0x11e003=_['merge']({},_0x11e003,_0x1087f0['options']);return db[_0x7388('0x27')][_0x7388('0x43')](_0x11e003)[_0x7388('0x3e')](handleEntityNotFound(_0x2a1148,null))[_0x7388('0x3e')](respondWithResult(_0x2a1148,null))[_0x7388('0x40')](handleError(_0x2a1148,null));};exports['create']=function(_0x48d694,_0x1b41ef){return db[_0x7388('0x27')][_0x7388('0x44')](_0x48d694['body'],{})[_0x7388('0x3e')](respondWithResult(_0x1b41ef,0xc9))[_0x7388('0x40')](handleError(_0x1b41ef,null));};exports['update']=function(_0x537f3a,_0x12ce0f){if(_0x537f3a[_0x7388('0x45')]['id']){delete _0x537f3a['body']['id'];}return db[_0x7388('0x27')][_0x7388('0x43')]({'where':{'id':_0x537f3a[_0x7388('0x42')]['id']}})[_0x7388('0x3e')](handleEntityNotFound(_0x12ce0f,null))[_0x7388('0x3e')](saveUpdates(_0x537f3a[_0x7388('0x45')],null))[_0x7388('0x3e')](respondWithResult(_0x12ce0f,null))[_0x7388('0x40')](handleError(_0x12ce0f,null));};exports[_0x7388('0x46')]=function(_0x3b86c0,_0x2eab90){return db[_0x7388('0x27')][_0x7388('0x43')]({'where':{'id':_0x3b86c0[_0x7388('0x42')]['id']}})[_0x7388('0x3e')](handleEntityNotFound(_0x2eab90,null))[_0x7388('0x3e')](removeEntity(_0x2eab90,null))[_0x7388('0x40')](handleError(_0x2eab90,null));};exports[_0x7388('0x47')]=function(_0x29c307,_0x3f7171){return db[_0x7388('0x27')][_0x7388('0x47')]()[_0x7388('0x3e')](respondWithResult(_0x3f7171,null))[_0x7388('0x40')](handleError(_0x3f7171,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3eca36b..3250b0b 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 _0xcf0b=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xcf0b,0x6f));var _0xbcf0=function(_0x4a7b46,_0x5e916c){_0x4a7b46=_0x4a7b46-0x0;var _0x436bee=_0xcf0b[_0x4a7b46];return _0x436bee;};'use strict';var _=require('lodash');var util=require(_0xbcf0('0x0'));var logger=require(_0xbcf0('0x1'))(_0xbcf0('0x2'));var moment=require(_0xbcf0('0x3'));var BPromise=require(_0xbcf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcf0('0x5'));var rimraf=require('rimraf');var config=require(_0xbcf0('0x6'));var attributes=require(_0xbcf0('0x7'));module['exports']=function(_0x1da870,_0x52bbe8){return _0x1da870[_0xbcf0('0x8')](_0xbcf0('0x9'),attributes,{'tableName':_0xbcf0('0xa'),'paranoid':![],'indexes':[{'name':_0xbcf0('0xb'),'fields':[_0xbcf0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8833=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2accb3,_0x11f159){var _0x1380f2=function(_0x1abdbe){while(--_0x1abdbe){_0x2accb3['push'](_0x2accb3['shift']());}};_0x1380f2(++_0x11f159);}(_0x8833,0x15a));var _0x3883=function(_0x3ad3b3,_0x3592ff){_0x3ad3b3=_0x3ad3b3-0x0;var _0x58817b=_0x8833[_0x3ad3b3];return _0x58817b;};'use strict';var _=require(_0x3883('0x0'));var util=require(_0x3883('0x1'));var logger=require(_0x3883('0x2'))('api');var moment=require(_0x3883('0x3'));var BPromise=require(_0x3883('0x4'));var rp=require(_0x3883('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3883('0x6'));var config=require(_0x3883('0x7'));var attributes=require(_0x3883('0x8'));module[_0x3883('0x9')]=function(_0x1d3c6d,_0xd4d615){return _0x1d3c6d['define'](_0x3883('0xa'),attributes,{'tableName':_0x3883('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3883('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 25500e6..89b1f76 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 _0x77bf=['then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3a85ab,_0x1f3525){var _0x32d91a=function(_0x216ab1){while(--_0x216ab1){_0x3a85ab['push'](_0x3a85ab['shift']());}};_0x32d91a(++_0x1f3525);}(_0x77bf,0x19b));var _0xf77b=function(_0x2dbc6e,_0x29fd87){_0x2dbc6e=_0x2dbc6e-0x0;var _0x331650=_0x77bf[_0x2dbc6e];return _0x331650;};'use strict';var _=require(_0xf77b('0x0'));var util=require(_0xf77b('0x1'));var moment=require(_0xf77b('0x2'));var BPromise=require(_0xf77b('0x3'));var rs=require(_0xf77b('0x4'));var fs=require('fs');var Redis=require(_0xf77b('0x5'));var db=require(_0xf77b('0x6'))['db'];var utils=require(_0xf77b('0x7'));var logger=require('../../config/logger')(_0xf77b('0x8'));var config=require(_0xf77b('0x9'));var jayson=require(_0xf77b('0xa'));var client=jayson[_0xf77b('0xb')][_0xf77b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a77d9,_0x573516,_0x67976d){return new BPromise(function(_0x4b833d,_0x19fb60){return client[_0xf77b('0xd')](_0x5a77d9,_0x67976d)[_0xf77b('0xe')](function(_0x46fcb9){logger[_0xf77b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x573516,_0xf77b('0x10'));logger[_0xf77b('0x11')](_0xf77b('0x12'),_0x573516,'request\x20sent',JSON[_0xf77b('0x13')](_0x46fcb9));if(_0x46fcb9[_0xf77b('0x14')]){if(_0x46fcb9['error'][_0xf77b('0x15')]===0x1f4){logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);return _0x19fb60(_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);}logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x46fcb9[_0xf77b('0x14')]['message']);return _0x4b833d(_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);}else{logger[_0xf77b('0xf')](_0xf77b('0x16'),_0x573516,_0xf77b('0x10'));_0x4b833d(_0x46fcb9['result']['message']);}})[_0xf77b('0x18')](function(_0x4c0900){logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x4c0900);_0x19fb60(_0x4c0900);});});} \ No newline at end of file +var _0x0243=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5f3ba6,_0x2be137){var _0x3cef72=function(_0x31aad6){while(--_0x31aad6){_0x5f3ba6['push'](_0x5f3ba6['shift']());}};_0x3cef72(++_0x2be137);}(_0x0243,0x144));var _0x3024=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x0243[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0x3024('0x0'));var util=require(_0x3024('0x1'));var moment=require(_0x3024('0x2'));var BPromise=require(_0x3024('0x3'));var rs=require(_0x3024('0x4'));var fs=require('fs');var Redis=require(_0x3024('0x5'));var db=require(_0x3024('0x6'))['db'];var utils=require(_0x3024('0x7'));var logger=require(_0x3024('0x8'))(_0x3024('0x9'));var config=require(_0x3024('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3024('0xb')][_0x3024('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22c905,_0x24b8c2,_0x2f2952){return new BPromise(function(_0x563dbe,_0x11672d){return client[_0x3024('0xd')](_0x22c905,_0x2f2952)[_0x3024('0xe')](function(_0x355988){logger[_0x3024('0xf')](_0x3024('0x10'),_0x24b8c2,_0x3024('0x11'));logger['debug'](_0x3024('0x12'),_0x24b8c2,_0x3024('0x11'),JSON[_0x3024('0x13')](_0x355988));if(_0x355988[_0x3024('0x14')]){if(_0x355988['error'][_0x3024('0x15')]===0x1f4){logger[_0x3024('0x14')](_0x3024('0x10'),_0x24b8c2,_0x355988[_0x3024('0x14')][_0x3024('0x16')]);return _0x11672d(_0x355988[_0x3024('0x14')]['message']);}logger[_0x3024('0x14')](_0x3024('0x10'),_0x24b8c2,_0x355988['error']['message']);return _0x563dbe(_0x355988[_0x3024('0x14')][_0x3024('0x16')]);}else{logger[_0x3024('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x24b8c2,_0x3024('0x11'));_0x563dbe(_0x355988[_0x3024('0x17')][_0x3024('0x16')]);}})[_0x3024('0x18')](function(_0x174226){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x24b8c2,_0x174226);_0x11672d(_0x174226);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index de624c9..68dec13 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 _0x3ef2=['get','show','post','create','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','./chatTransferReport.controller','isAuthenticated','index','/describe','describe'];(function(_0x20f1d7,_0x1dec28){var _0x205df5=function(_0x31ebda){while(--_0x31ebda){_0x20f1d7['push'](_0x20f1d7['shift']());}};_0x205df5(++_0x1dec28);}(_0x3ef2,0x170));var _0x23ef=function(_0x267a94,_0xed628d){_0x267a94=_0x267a94-0x0;var _0x2d4af1=_0x3ef2[_0x267a94];return _0x2d4af1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23ef('0x0'));var timeout=require(_0x23ef('0x1'));var express=require(_0x23ef('0x2'));var router=express[_0x23ef('0x3')]();var fs_extra=require(_0x23ef('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x23ef('0x5'));router['get']('/',auth[_0x23ef('0x6')](),controller[_0x23ef('0x7')]);router['get'](_0x23ef('0x8'),auth[_0x23ef('0x6')](),controller[_0x23ef('0x9')]);router[_0x23ef('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x23ef('0xb')]);router[_0x23ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x23ef('0xd')]);router['put'](_0x23ef('0xe'),auth[_0x23ef('0x6')](),controller[_0x23ef('0xf')]);router[_0x23ef('0x10')](_0x23ef('0xe'),auth[_0x23ef('0x6')](),controller['destroy']);module[_0x23ef('0x11')]=router; \ No newline at end of file +var _0x7a35=['index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0xb0726e,_0x349901){var _0x376fc5=function(_0x472ac1){while(--_0x472ac1){_0xb0726e['push'](_0xb0726e['shift']());}};_0x376fc5(++_0x349901);}(_0x7a35,0x1ea));var _0x57a3=function(_0x829616,_0x5d9318){_0x829616=_0x829616-0x0;var _0x35857a=_0x7a35[_0x829616];return _0x35857a;};'use strict';var multer=require(_0x57a3('0x0'));var util=require('util');var path=require(_0x57a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x57a3('0x2'));var router=express[_0x57a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x57a3('0x4'));var interaction=require(_0x57a3('0x5'));var config=require(_0x57a3('0x6'));var controller=require(_0x57a3('0x7'));router[_0x57a3('0x8')]('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xa')]);router[_0x57a3('0x8')](_0x57a3('0xb'),auth['isAuthenticated'](),controller[_0x57a3('0xc')]);router['get'](_0x57a3('0xd'),auth['isAuthenticated'](),controller[_0x57a3('0xe')]);router['post']('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xf')]);router[_0x57a3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x57a3('0x11')]);router[_0x57a3('0x12')](_0x57a3('0xd'),auth[_0x57a3('0x9')](),controller[_0x57a3('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 f14d3a0..7a110e2 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 _0x0e07=['INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','TEXT','stringify','input','name','text','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','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','randomstring','exports','STRING','email','Agent','#011F6A'];(function(_0x3b4eb0,_0x221801){var _0x21232e=function(_0x438ec9){while(--_0x438ec9){_0x3b4eb0['push'](_0x3b4eb0['shift']());}};_0x21232e(++_0x221801);}(_0x0e07,0x9b));var _0x70e0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e07[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x70e0('0x0'));var rs=require(_0x70e0('0x1'));module[_0x70e0('0x2')]={'name':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x70e0('0x3')]},'mapKey':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x4')},'mapKeyOffline':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x4')},'key':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x5')},'customerAlias':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x70e0('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':_0x70e0('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x70e0('0x3')]},'animation':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x70e0('0x9')](_0x70e0('0xa'),_0x70e0('0xb')),'defaultValue':_0x70e0('0xa')},'header_online':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0xd')},'offline_chat_button':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xe')},'header_offline':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x13')},'noteTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0x16')},'closingMessageButton':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x17')},'ratingType':{'type':Sequelize['ENUM']('star',_0x70e0('0x18')),'defaultValue':_0x70e0('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':function(){return JSON[_0x70e0('0x1b')]({'items':[{'type':_0x70e0('0x1c'),'variable':null,'config':{'placeholder':_0x70e0('0x1d'),'type':_0x70e0('0x1e'),'required':!![]},'props':{'title':_0x70e0('0x1d'),'helpText':''}},{'type':_0x70e0('0x1c'),'props':{'title':_0x70e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x70e0('0x4'),'type':_0x70e0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x70e0('0x1f')](_0x70e0('0x20'))?JSON[_0x70e0('0x21')](this[_0x70e0('0x1f')](_0x70e0('0x20'))):{};},'set':function(_0x429ae9){return this[_0x70e0('0x22')](_0x70e0('0x20'),JSON[_0x70e0('0x1b')](_0x429ae9));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x70e0('0x1b')]({'items':[{'type':_0x70e0('0x1c'),'props':{'title':_0x70e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x70e0('0x4'),'type':'email'},'variable':null},{'type':_0x70e0('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0x70e0('0x24'),'helpText':_0x70e0('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x70e0('0x1f')](_0x70e0('0x26'))?JSON['parse'](this[_0x70e0('0x1f')](_0x70e0('0x26'))):{};},'set':function(_0x32151d){return this['setDataValue'](_0x70e0('0x26'),JSON['stringify'](_0x32151d));}},'token':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':function(){return rs[_0x70e0('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x70e0('0x3')]},'waitingTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2b')},'sendUnmanaged':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x70e0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':function(){return _0x70e0('0x2c');}},'notificationSound':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x70e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2e')},'verticalAlignment':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2f')},'messagesAlignment':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x30')},'defaultTitle':{'type':Sequelize[_0x70e0('0x3')]},'customerAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x70e0('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![],'comment':_0x70e0('0x32'),'set':function(_0x36e91d){if(!_0x36e91d)this['setDataValue'](_0x70e0('0x33'),null);this[_0x70e0('0x22')]('mandatoryDisposition',_0x36e91d);}},'vidaooEscalation':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x70e0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':_0x70e0('0x34')},'vidaooNote':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':function(){return _0x70e0('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x70e0('0x1a')]}}; \ No newline at end of file +var _0xb37d=['squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','stringify','name','text','parse','getDataValue','onlineForm','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded'];(function(_0x29a4ad,_0x33c4bf){var _0x2ac926=function(_0x4c199b){while(--_0x4c199b){_0x29a4ad['push'](_0x29a4ad['shift']());}};_0x2ac926(++_0x33c4bf);}(_0xb37d,0x1b7));var _0xdb37=function(_0x4e06e7,_0x54bcbf){_0x4e06e7=_0x4e06e7-0x0;var _0x28d1dd=_0xb37d[_0x4e06e7];return _0x28d1dd;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdb37('0x0'));module[_0xdb37('0x1')]={'name':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'unique':_0xdb37('0x3')},'description':{'type':Sequelize[_0xdb37('0x2')]},'mapKey':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x4')},'mapKeyOffline':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x4')},'key':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x5')},'customerAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdb37('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdb37('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdb37('0x9')](_0xdb37('0xa'),_0xdb37('0xb')),'defaultValue':_0xdb37('0xa')},'header_online':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0xd')},'header_offline':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xe')},'download_transcript':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x13')},'noteTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x14')},'placeholderMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x15')},'closingMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x17')},'conditionAgreement':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x18')},'ratingType':{'type':Sequelize[_0xdb37('0x9')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdb37('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xdb37('0x1a'),'type':_0xdb37('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdb37('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xdb37('0x1c')](this[_0xdb37('0x1d')](_0xdb37('0x1e'))):{};},'set':function(_0x2b54bd){return this[_0xdb37('0x1f')](_0xdb37('0x1e'),JSON[_0xdb37('0x19')](_0x2b54bd));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdb37('0x19')]({'items':[{'type':_0xdb37('0x20'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdb37('0x4')},'variable':null},{'type':_0xdb37('0x21'),'config':{'placeholder':_0xdb37('0x22')},'props':{'title':_0xdb37('0x22'),'helpText':_0xdb37('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xdb37('0x1d')](_0xdb37('0x24'))?JSON[_0xdb37('0x1c')](this['getDataValue'](_0xdb37('0x24'))):{};},'set':function(_0x97c559){return this[_0xdb37('0x1f')](_0xdb37('0x24'),JSON[_0xdb37('0x19')](_0x97c559));}},'token':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':function(){return rs[_0xdb37('0x25')]();}},'autoclose':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdb37('0x2')]},'forwardOffline':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdb37('0x2')]},'waitingTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x26')},'waitingMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x27')},'offlineMessageBody':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x28')},'skipUnmanaged':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x17')},'sendUnmanaged':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdb37('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xdb37('0x29')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2e')},'systemAvatar':{'type':Sequelize[_0xdb37('0x29')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdb37('0x8')],'comment':_0xdb37('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![],'comment':_0xdb37('0x30'),'set':function(_0x5c1ad7){if(!_0x5c1ad7)this[_0xdb37('0x1f')]('mandatoryDispositionPauseId',null);this[_0xdb37('0x1f')]('mandatoryDisposition',_0x5c1ad7);}},'vidaooEscalation':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdb37('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdb37('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xdb37('0x29')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xdb37('0x29')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b8ac3c9..a4fab49 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 _0xf244=['iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','get','ChatWebsites','destroy','end','sendStatus','stack','name','send','index','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','rows','show','params','mandatoryDispositionPause','include','options','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','ChatWebsiteId','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','filename','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','customerAvatar','showCustomerAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','%s\x20%s','device','vendor','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xf244,0x160));var _0x4f24=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf244[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x4f24('0x0'));var Mustache=require('mustache');var util=require(_0x4f24('0x1'));var path=require(_0x4f24('0x2'));var ejs=require(_0x4f24('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f24('0x4'));var querystring=require(_0x4f24('0x5'));var Redis=require(_0x4f24('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x4f24('0x7'))(_0x4f24('0x8'));var config=require(_0x4f24('0x9'));var db=require(_0x4f24('0xa'))['db'];config[_0x4f24('0xb')]=_[_0x4f24('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f24('0xb')]));require('./chatWebsite.socket')[_0x4f24('0xd')](socket);var jayson=require(_0x4f24('0xe'));var client=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x232c});var client9002=jayson[_0x4f24('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x232b});var client9001=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x353e91,_0x228105,_0x3f7634,_0x7db0fa){return new BPromise(function(_0x38174f,_0x3d566a){var _0x1e14d2=_0x7db0fa||client;return _0x1e14d2[_0x4f24('0x11')](_0x353e91,_0x3f7634)[_0x4f24('0x12')](function(_0x316b85){logger[_0x4f24('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x228105,_0x4f24('0x14'));logger[_0x4f24('0x15')](_0x4f24('0x16'),_0x228105,_0x4f24('0x14'),JSON['stringify'](_0x316b85));if(_0x316b85[_0x4f24('0x17')]){if(_0x316b85[_0x4f24('0x17')][_0x4f24('0x18')]===0x1f4){logger[_0x4f24('0x17')](_0x4f24('0x19'),_0x228105,_0x316b85[_0x4f24('0x17')][_0x4f24('0x1a')]);return _0x3d566a(_0x316b85['error'][_0x4f24('0x1a')]);}logger['error'](_0x4f24('0x19'),_0x228105,_0x316b85[_0x4f24('0x17')][_0x4f24('0x1a')]);return _0x38174f(_0x316b85[_0x4f24('0x17')]['message']);}else{logger[_0x4f24('0x13')](_0x4f24('0x19'),_0x228105,_0x4f24('0x14'));_0x38174f(_0x316b85[_0x4f24('0x1b')][_0x4f24('0x1a')]);}})[_0x4f24('0x1c')](function(_0x5f02be){logger[_0x4f24('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x228105,_0x5f02be);_0x3d566a(_0x5f02be);});});}function respondWithStatusCode(_0x512e2a,_0x4817a8){_0x4817a8=_0x4817a8||0xcc;return function(_0x490b9c){if(_0x490b9c){return _0x512e2a['sendStatus'](_0x4817a8);}return _0x512e2a[_0x4f24('0x1d')](_0x4817a8)['end']();};}function respondWithResult(_0x5bd42c,_0x2d99cb){_0x2d99cb=_0x2d99cb||0xc8;return function(_0x4f8236){if(_0x4f8236){return _0x5bd42c[_0x4f24('0x1d')](_0x2d99cb)[_0x4f24('0x1e')](_0x4f8236);}};}function respondWithFilteredResult(_0x5a2be9,_0xd1cf6a){return function(_0xa28ae5){if(_0xa28ae5){var _0x849518=typeof _0xd1cf6a[_0x4f24('0x1f')]===_0x4f24('0x20')&&typeof _0xd1cf6a['limit']===_0x4f24('0x20');var _0x2a3d76=_0xa28ae5['count'];var _0x138c85=_0x849518?0x0:_0xd1cf6a[_0x4f24('0x1f')];var _0x3d761a=_0x849518?_0xa28ae5[_0x4f24('0x21')]:_0xd1cf6a[_0x4f24('0x1f')]+_0xd1cf6a[_0x4f24('0x22')];var _0x4fc7bf;if(_0x3d761a>=_0x2a3d76){_0x3d761a=_0x2a3d76;_0x4fc7bf=0xc8;}else{_0x4fc7bf=0xce;}_0x5a2be9['status'](_0x4fc7bf);return _0x5a2be9[_0x4f24('0x23')](_0x4f24('0x24'),_0x138c85+'-'+_0x3d761a+'/'+_0x2a3d76)[_0x4f24('0x1e')](_0xa28ae5);}return null;};}function saveUpdates(_0xe4cd25){return function(_0x3a052f){if(_0x3a052f){return _0x3a052f[_0x4f24('0x25')](_0xe4cd25)[_0x4f24('0x12')](function(_0x4113df){return _0x4113df;});}return null;};}function removeEntity(_0x53d2ca){return function(_0x25867b){if(_0x25867b){return _0x25867b['destroy']()[_0x4f24('0x12')](function(){var _0x490409=_0x25867b[_0x4f24('0x26')]({'plain':!![]});var _0x41b8e2=_0x4f24('0x27');return db['UserProfileResource'][_0x4f24('0x28')]({'where':{'type':_0x41b8e2,'resourceId':_0x490409['id']}})[_0x4f24('0x12')](function(){return _0x25867b;});})['then'](function(){_0x53d2ca['status'](0xcc)[_0x4f24('0x29')]();});}};}function handleEntityNotFound(_0x4da862){return function(_0x585ee0){if(!_0x585ee0){_0x4da862[_0x4f24('0x2a')](0x194);}return _0x585ee0;};}function handleError(_0x21f14b,_0x4a7353){_0x4a7353=_0x4a7353||0x1f4;return function(_0x863b04){logger[_0x4f24('0x17')](_0x863b04[_0x4f24('0x2b')]);if(_0x863b04[_0x4f24('0x2c')]){delete _0x863b04['name'];}_0x21f14b[_0x4f24('0x1d')](_0x4a7353)[_0x4f24('0x2d')](_0x863b04);};}exports[_0x4f24('0x2e')]=function(_0x3dd529,_0xe93c54){var _0x2af53e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x569745={},_0x3b1e61={'count':0x0,'rows':[]};var _0x5ca672=_[_0x4f24('0x2f')](db[_0x4f24('0x30')][_0x4f24('0x31')],function(_0x977100){return{'name':_0x977100['fieldName'],'type':_0x977100[_0x4f24('0x32')][_0x4f24('0x33')]};});_0x569745[_0x4f24('0x34')]=_[_0x4f24('0x2f')](_0x5ca672,_0x4f24('0x2c'));_0x569745[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x3dd529[_0x4f24('0x35')]);_0x569745[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x569745[_0x4f24('0x34')],_0x569745[_0x4f24('0x35')]);_0x2af53e[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x569745[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x3dd529[_0x4f24('0x35')]['fields']));_0x2af53e['attributes']=_0x2af53e[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x2af53e['attributes']:_0x569745[_0x4f24('0x34')];if(!_0x3dd529[_0x4f24('0x35')][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x2af53e[_0x4f24('0x22')]=qs['limit'](_0x3dd529['query'][_0x4f24('0x22')]);_0x2af53e['offset']=qs['offset'](_0x3dd529[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x2af53e[_0x4f24('0x3e')]=qs['sort'](_0x3dd529[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x2af53e['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x3dd529[_0x4f24('0x35')],_0x569745[_0x4f24('0x37')]),_0x5ca672);if(_0x3dd529[_0x4f24('0x35')][_0x4f24('0x41')]){_0x2af53e['where']=_[_0x4f24('0x42')](_0x2af53e['where'],{'$or':_[_0x4f24('0x2f')](_0x5ca672,function(_0x1a74a5){if(_0x1a74a5[_0x4f24('0x32')]!==_0x4f24('0x43')){var _0x4838dd={};_0x4838dd[_0x1a74a5[_0x4f24('0x2c')]]={'$like':'%'+_0x3dd529[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x4838dd;}})});}_0x2af53e=_[_0x4f24('0x42')]({},_0x2af53e,_0x3dd529['options']);var _0x1d0bea={'where':_0x2af53e[_0x4f24('0x44')]};return db[_0x4f24('0x30')]['count'](_0x1d0bea)[_0x4f24('0x12')](function(_0x36ecae){_0x3b1e61['count']=_0x36ecae;if(_0x3dd529[_0x4f24('0x35')][_0x4f24('0x45')]){_0x2af53e['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x2af53e);})['then'](function(_0x3086de){_0x3b1e61[_0x4f24('0x46')]=_0x3086de;return _0x3b1e61;})[_0x4f24('0x12')](respondWithFilteredResult(_0xe93c54,_0x2af53e))[_0x4f24('0x1c')](handleError(_0xe93c54,null));};exports[_0x4f24('0x47')]=function(_0x268821,_0x573d48){var _0x1cb788={'raw':![],'where':{'id':_0x268821[_0x4f24('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x4f24('0x49')}]},_0x49a9a8={};_0x49a9a8[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x30')][_0x4f24('0x31')]);_0x49a9a8[_0x4f24('0x35')]=_['keys'](_0x268821[_0x4f24('0x35')]);_0x49a9a8[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x49a9a8[_0x4f24('0x34')],_0x49a9a8[_0x4f24('0x35')]);_0x1cb788['attributes']=_[_0x4f24('0x38')](_0x49a9a8[_0x4f24('0x34')],qs['fields'](_0x268821[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x1cb788[_0x4f24('0x39')]=_0x1cb788[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x1cb788[_0x4f24('0x39')]:_0x49a9a8[_0x4f24('0x34')];if(_0x268821[_0x4f24('0x35')][_0x4f24('0x45')]){_0x1cb788[_0x4f24('0x4a')]=[{'all':!![]}];}_0x1cb788=_[_0x4f24('0x42')]({},_0x1cb788,_0x268821[_0x4f24('0x4b')]);return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x1cb788)[_0x4f24('0x12')](handleEntityNotFound(_0x573d48,null))[_0x4f24('0x12')](respondWithResult(_0x573d48,null))[_0x4f24('0x1c')](handleError(_0x573d48,null));};exports['create']=function(_0x175326,_0x19e835){return db[_0x4f24('0x30')]['create'](_0x175326[_0x4f24('0x4d')],{})[_0x4f24('0x12')](function(_0x70bf39){var _0x23c02a=_0x175326[_0x4f24('0x4e')][_0x4f24('0x26')]({'plain':!![]});if(!_0x23c02a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23c02a[_0x4f24('0x4f')]===_0x4f24('0x4e')){var _0x500b0a=_0x70bf39['get']({'plain':!![]});var _0x3f5a99=_0x4f24('0x27');return db[_0x4f24('0x50')]['find']({'where':{'name':_0x3f5a99,'userProfileId':_0x23c02a[_0x4f24('0x51')]},'raw':!![]})[_0x4f24('0x12')](function(_0x12abac){if(_0x12abac&&_0x12abac[_0x4f24('0x52')]===0x0){return db[_0x4f24('0x53')][_0x4f24('0x54')]({'name':_0x500b0a[_0x4f24('0x2c')],'resourceId':_0x500b0a['id'],'type':_0x12abac['name'],'sectionId':_0x12abac['id']},{})[_0x4f24('0x12')](function(){return _0x70bf39;});}else{return _0x70bf39;}})[_0x4f24('0x1c')](function(_0x4b27a4){logger[_0x4f24('0x17')](_0x4f24('0x55'),_0x4b27a4);throw _0x4b27a4;});}return _0x70bf39;})[_0x4f24('0x12')](respondWithResult(_0x19e835,0xc9))[_0x4f24('0x1c')](handleError(_0x19e835,null));};exports[_0x4f24('0x25')]=function(_0x621776,_0x158266){if(_0x621776['body']['id']){delete _0x621776['body']['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x621776['params']['id']},'include':[{'model':db[_0x4f24('0x56')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x158266,null))['then'](saveUpdates(_0x621776[_0x4f24('0x4d')],null))[_0x4f24('0x12')](respondWithResult(_0x158266,null))[_0x4f24('0x1c')](handleError(_0x158266,null));};exports['destroy']=function(_0x580d0c,_0x3d1638){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x580d0c[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x3d1638,null))[_0x4f24('0x12')](removeEntity(_0x3d1638,null))[_0x4f24('0x1c')](handleError(_0x3d1638,null));};exports['describe']=function(_0x5cd8c3,_0x5a155d){return db[_0x4f24('0x30')][_0x4f24('0x57')]()[_0x4f24('0x12')](respondWithResult(_0x5a155d,null))[_0x4f24('0x1c')](handleError(_0x5a155d,null));};exports[_0x4f24('0x58')]=function(_0x2b7c7d,_0x2cb300){if(_0x2b7c7d[_0x4f24('0x4d')]['id']){delete _0x2b7c7d[_0x4f24('0x4d')]['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x2b7c7d['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2cb300,null))[_0x4f24('0x12')](function(_0x9ab93c){if(_0x9ab93c){_0x2b7c7d[_0x4f24('0x4d')]['ChatWebsiteId']=_0x9ab93c['id'];return db[_0x4f24('0x59')][_0x4f24('0x54')](_0x2b7c7d[_0x4f24('0x4d')]);}})[_0x4f24('0x12')](respondWithResult(_0x2cb300,null))['catch'](handleError(_0x2cb300,null));};exports[_0x4f24('0x5a')]=function(_0x10f91c,_0x3894a4){var _0x393101={'raw':![],'where':{}};var _0xef4a23={};var _0x45d274={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x10f91c[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x3894a4,null))[_0x4f24('0x12')](function(_0x2ab115){if(_0x2ab115){_0xef4a23[_0x4f24('0x34')]=_['keys'](db['Disposition'][_0x4f24('0x31')]);_0xef4a23[_0x4f24('0x35')]=_['keys'](_0x10f91c['query']);_0xef4a23[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0xef4a23[_0x4f24('0x34')],_0xef4a23[_0x4f24('0x35')]);_0x393101[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0xef4a23[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x393101[_0x4f24('0x39')]=_0x393101[_0x4f24('0x39')]['length']?_0x393101['attributes']:_0xef4a23[_0x4f24('0x34')];if(!_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x393101['limit']=qs[_0x4f24('0x22')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x22')]);_0x393101[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x10f91c['query']['offset']);}_0x393101['order']=qs[_0x4f24('0x3f')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x393101[_0x4f24('0x44')]=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x10f91c['query'],_0xef4a23[_0x4f24('0x37')]));_0x393101[_0x4f24('0x44')]['ChatWebsiteId']=_0x2ab115['id'];if(_0x10f91c['query'][_0x4f24('0x41')]){_0x393101[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x393101[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x393101[_0x4f24('0x39')],function(_0x1a2c47){var _0x4a2033={};_0x4a2033[_0x1a2c47]={'$like':'%'+_0x10f91c[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x4a2033;})});}_0x393101=_['merge']({},_0x393101,_0x10f91c['options']);return db[_0x4f24('0x59')]['count']({'where':_0x393101[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0x41b9c4){_0x45d274['count']=_0x41b9c4;if(_0x10f91c[_0x4f24('0x35')][_0x4f24('0x45')]){_0x393101[_0x4f24('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0x4f24('0x5c')](_0x393101);})['then'](function(_0x6c4672){_0x45d274[_0x4f24('0x46')]=_0x6c4672;return _0x45d274;});}})[_0x4f24('0x12')](respondWithFilteredResult(_0x3894a4,_0x393101))[_0x4f24('0x1c')](handleError(_0x3894a4,null));};exports[_0x4f24('0x5d')]=function(_0x1fe626,_0x394194){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x1fe626[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x394194,null))[_0x4f24('0x12')](function(_0x1ea8f1){if(_0x1ea8f1){return _0x1ea8f1['removeDispositions'](_0x1fe626[_0x4f24('0x35')][_0x4f24('0x5e')]);}})[_0x4f24('0x12')](respondWithStatusCode(_0x394194,null))['catch'](handleError(_0x394194,null));};exports[_0x4f24('0x5f')]=function(_0x5655b7,_0x5dac84){if(_0x5655b7[_0x4f24('0x4d')]['id']){delete _0x5655b7['body']['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x5655b7[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x5dac84,null))[_0x4f24('0x12')](function(_0x40ba5e){if(_0x40ba5e){_0x5655b7[_0x4f24('0x4d')]['ChatWebsiteId']=_0x40ba5e['id'];return db[_0x4f24('0x60')]['create'](_0x5655b7[_0x4f24('0x4d')]);}})['then'](respondWithResult(_0x5dac84,null))[_0x4f24('0x1c')](handleError(_0x5dac84,null));};exports['getAnswers']=function(_0x53f299,_0x2d592e){var _0x3ff640={'raw':![],'where':{}};var _0x8b48c8={};var _0x320a00={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x53f299[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2d592e,null))[_0x4f24('0x12')](function(_0x19b04c){if(_0x19b04c){_0x8b48c8[_0x4f24('0x34')]=_['keys'](db['CannedAnswer'][_0x4f24('0x31')]);_0x8b48c8[_0x4f24('0x35')]=_['keys'](_0x53f299[_0x4f24('0x35')]);_0x8b48c8['filters']=_[_0x4f24('0x38')](_0x8b48c8[_0x4f24('0x34')],_0x8b48c8[_0x4f24('0x35')]);_0x3ff640[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x8b48c8[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x53f299['query'][_0x4f24('0x3a')]));_0x3ff640['attributes']=_0x3ff640[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x3ff640['attributes']:_0x8b48c8['model'];if(!_0x53f299[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0x3ff640[_0x4f24('0x22')]=qs['limit'](_0x53f299[_0x4f24('0x35')][_0x4f24('0x22')]);_0x3ff640[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x53f299[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x3ff640['order']=qs['sort'](_0x53f299[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x3ff640['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x53f299[_0x4f24('0x35')],_0x8b48c8[_0x4f24('0x37')]));_0x3ff640['where'][_0x4f24('0x61')]=_0x19b04c['id'];if(_0x53f299[_0x4f24('0x35')][_0x4f24('0x41')]){_0x3ff640[_0x4f24('0x44')]=_['merge'](_0x3ff640['where'],{'$or':_[_0x4f24('0x2f')](_0x3ff640[_0x4f24('0x39')],function(_0x39511c){var _0x4e7df7={};_0x4e7df7[_0x39511c]={'$like':'%'+_0x53f299['query'][_0x4f24('0x41')]+'%'};return _0x4e7df7;})});}_0x3ff640=_['merge']({},_0x3ff640,_0x53f299[_0x4f24('0x4b')]);return db[_0x4f24('0x60')][_0x4f24('0x21')]({'where':_0x3ff640[_0x4f24('0x44')]})['then'](function(_0x33723c){_0x320a00[_0x4f24('0x21')]=_0x33723c;if(_0x53f299[_0x4f24('0x35')]['includeAll']){_0x3ff640[_0x4f24('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4f24('0x5c')](_0x3ff640);})[_0x4f24('0x12')](function(_0x299ee3){_0x320a00[_0x4f24('0x46')]=_0x299ee3;return _0x320a00;});}})[_0x4f24('0x12')](respondWithFilteredResult(_0x2d592e,_0x3ff640))[_0x4f24('0x1c')](handleError(_0x2d592e,null));};exports[_0x4f24('0x62')]=function(_0x36a103,_0x29651b){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x36a103[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x29651b,null))[_0x4f24('0x12')](function(_0x484d88){if(_0x484d88){return _0x484d88[_0x4f24('0x62')](_0x36a103[_0x4f24('0x35')][_0x4f24('0x5e')]);}})['then'](respondWithStatusCode(_0x29651b,null))[_0x4f24('0x1c')](handleError(_0x29651b,null));};exports[_0x4f24('0x63')]=function(_0x464ddd,_0x2d69d0){_0x464ddd[_0x4f24('0x4d')][_0x4f24('0x64')]=_0x464ddd[_0x4f24('0x65')]['filename'];return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x464ddd[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2d69d0,null))['then'](saveUpdates(_0x464ddd[_0x4f24('0x4d')],null))[_0x4f24('0x12')](respondWithResult(_0x2d69d0,null))[_0x4f24('0x1c')](handleError(_0x2d69d0,null));};exports[_0x4f24('0x66')]=function(_0x2da11e,_0x26aecc){_0x2da11e['body'][_0x4f24('0x67')]=_0x2da11e[_0x4f24('0x65')]['filename'];return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x2da11e[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x26aecc,null))['then'](saveUpdates(_0x2da11e[_0x4f24('0x4d')],null))['then'](respondWithResult(_0x26aecc,null))['catch'](handleError(_0x26aecc,null));};exports[_0x4f24('0x68')]=function(_0x1c4218,_0xaf485a){_0x1c4218[_0x4f24('0x4d')]['customerAvatar']=_0x1c4218[_0x4f24('0x65')][_0x4f24('0x69')];return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0x1c4218[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0xaf485a,null))['then'](saveUpdates(_0x1c4218[_0x4f24('0x4d')],null))['then'](respondWithResult(_0xaf485a,null))[_0x4f24('0x1c')](handleError(_0xaf485a,null));};exports['addSystemAvatar']=function(_0xf0df00,_0x4a6dad){_0xf0df00[_0x4f24('0x4d')]['systemAvatar']=_0xf0df00[_0x4f24('0x65')][_0x4f24('0x69')];return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0xf0df00[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x4a6dad,null))[_0x4f24('0x12')](saveUpdates(_0xf0df00['body'],null))[_0x4f24('0x12')](respondWithResult(_0x4a6dad,null))[_0x4f24('0x1c')](handleError(_0x4a6dad,null));};exports[_0x4f24('0x6a')]=function(_0x3e4b6f,_0x4ab395){var _0x14cbec=path[_0x4f24('0x6b')](config['root'],'server/files/images/logos/default_logo.svg');var _0xd98f6a={'where':{'id':_0x3e4b6f[_0x4f24('0x48')]['id']},'attributes':['id',_0x4f24('0x64')],'raw':!![]};var _0x5d3810=![];return require('../../config/license/util')[_0x4f24('0x6c')]()[_0x4f24('0x12')](function(_0x5d49d0){if(_0x5d49d0){_0x5d3810=_0x5d49d0[_0x4f24('0x6d')];}})[_0x4f24('0x12')](function(){return db['ChatWebsite'][_0x4f24('0x4c')](_0xd98f6a);})['then'](handleEntityNotFound(_0x4ab395,null))[_0x4f24('0x12')](function(_0x148171){if(_0x148171){if(!_[_0x4f24('0x6e')](_0x148171[_0x4f24('0x64')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x71'),_0x148171['sitepic']))&&_0x5d3810){_0x14cbec=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x71'),_0x148171[_0x4f24('0x64')]);}}return _0x4ab395['download'](_0x14cbec);}})[_0x4f24('0x1c')](handleError(_0x4ab395,null));};exports[_0x4f24('0x72')]=function(_0x32c537,_0x19d0d1){var _0x48fa76=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x73'));var _0x5253fe={'where':{'id':_0x32c537['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x5253fe)['then'](handleEntityNotFound(_0x19d0d1,null))['then'](function(_0x1cc835){if(_0x1cc835){if(!_[_0x4f24('0x6e')](_0x1cc835[_0x4f24('0x67')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x1cc835[_0x4f24('0x67')]))){_0x48fa76=path['join'](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x1cc835[_0x4f24('0x67')]);}}return _0x19d0d1[_0x4f24('0x75')](_0x48fa76);}})['catch'](handleError(_0x19d0d1,null));};exports[_0x4f24('0x76')]=function(_0x42c21a,_0x49f9db){var _0x53e591=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/customer_avatar.png');var _0x330b5b={'where':{'id':_0x42c21a[_0x4f24('0x48')]['id']},'attributes':['id',_0x4f24('0x77'),_0x4f24('0x78')],'raw':!![]};return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x330b5b)[_0x4f24('0x12')](handleEntityNotFound(_0x49f9db,null))[_0x4f24('0x12')](function(_0x5688e3){if(_0x5688e3){if(!_[_0x4f24('0x6e')](_0x5688e3['customerAvatar'])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/',_0x5688e3['customerAvatar']))&&_0x5688e3[_0x4f24('0x78')]){_0x53e591=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x5688e3[_0x4f24('0x77')]);}}return _0x49f9db['download'](_0x53e591);}})['catch'](handleError(_0x49f9db,null));};exports['getSystemAvatar']=function(_0x519edd,_0x59305c){var _0x23e957=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/system_avatar.png');var _0x456484={'where':{'id':_0x519edd[_0x4f24('0x48')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4f24('0x30')]['find'](_0x456484)[_0x4f24('0x12')](handleEntityNotFound(_0x59305c,null))[_0x4f24('0x12')](function(_0x5b47b5){if(_0x5b47b5){if(!_['isNil'](_0x5b47b5[_0x4f24('0x79')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x5b47b5['systemAvatar']))){_0x23e957=path[_0x4f24('0x6b')](config['root'],_0x4f24('0x74'),_0x5b47b5[_0x4f24('0x79')]);}}return _0x59305c[_0x4f24('0x75')](_0x23e957);}})['catch'](handleError(_0x59305c,null));};exports[_0x4f24('0x7a')]=function(_0x4d308f,_0x28573d){var _0x3bce6c=require(_0x4f24('0x7b'));var _0x24de6a=new _0x3bce6c();var _0x549f46=_0x24de6a[_0x4f24('0x7c')](_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x7e')])['getResult']();var _0x4ece0e={'body':_0x4d308f[_0x4f24('0x4d')],'channel':_0x4f24('0x7f')};var _0x13b251=[];var _0x4f487a=[];var _0x1e5bb4={};var _0x5ef174=![];return db[_0x4f24('0x80')]['describe']()[_0x4f24('0x12')](function(_0x350536){if(!_0x350536){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x83'));}_0x13b251=_['difference'](_[_0x4f24('0x36')](_0x350536),[_0x4f24('0x84'),_0x4f24('0x85')]);_0x4f487a=_[_0x4f24('0x86')](_[_0x4f24('0x36')](_0x350536),[_0x4f24('0x84'),_0x4f24('0x85'),_0x4f24('0x87'),_0x4f24('0x88')]);if(_0x4d308f[_0x4f24('0x4d')]['id']){delete _0x4d308f['body']['id'];}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')]['from'])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x89'));}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x4d')])||_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x4d')]===''){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x8b')+_0x4f487a);}if(!_[_0x4f24('0x8c')](_0x4f487a,_0x4d308f['body'][_0x4f24('0x8a')])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x8d')+_0x4f487a);}_0x1e5bb4[_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')]]=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8e')];})[_0x4f24('0x12')](function(){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x4d308f[_0x4f24('0x48')]['id']},'include':[{'model':db[_0x4f24('0x8f')],'as':_0x4f24('0x90'),'include':[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0x91'),'where':_0x1e5bb4,'limit':0x1,'order':[['updatedAt',_0x4f24('0x92')]]}]},{'model':db[_0x4f24('0x93')],'as':_0x4f24('0x94')}]});})[_0x4f24('0x12')](handleEntityNotFound(_0x28573d,null))[_0x4f24('0x12')](function(_0x25dbe8){if(_0x25dbe8&&_0x25dbe8[_0x4f24('0x90')]){_0x4ece0e[_0x4f24('0x95')]=_0x25dbe8;_0x4ece0e[_0x4f24('0x96')]=_0x25dbe8[_0x4f24('0x94')];_0x4ece0e[_0x4f24('0x97')]=_0x25dbe8['List'];_0x4ece0e[_0x4f24('0x96')]=_['orderBy'](_0x4ece0e[_0x4f24('0x96')],[_0x4f24('0x98')],[_0x4f24('0x99')]);if(_0x4ece0e[_0x4f24('0x95')][_0x4f24('0x94')]){delete _0x4ece0e['account'][_0x4f24('0x94')];}if(_0x4ece0e['account'][_0x4f24('0x90')]&&_0x4ece0e[_0x4f24('0x95')]['List'][_0x4f24('0x91')]['length']){return _0x4ece0e[_0x4f24('0x95')][_0x4f24('0x90')][_0x4f24('0x91')][0x0];}var _0x4c5802=_[_0x4f24('0xc')](_0x4d308f[_0x4f24('0x4d')],{'firstName':_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8e')],'ListId':_0x25dbe8[_0x4f24('0x88')]});_0x4c5802[_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')]]=_0x4d308f['body']['from'];return db[_0x4f24('0x80')][_0x4f24('0x54')](_0x4c5802,{'fields':_0x13b251,'raw':!![]});}})[_0x4f24('0x12')](handleEntityNotFound(_0x28573d,null))[_0x4f24('0x12')](function(_0x710b03){_0x4ece0e['contact']=_0x710b03;var _0x29ea86=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x9a')];if(_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9b')]){_0x29ea86=_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9b')];}else if(_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9c')]){_0x29ea86=_[_0x4f24('0x9d')](_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9c')][_0x4f24('0x9e')](','));}if(_0x710b03){var _0x20dac3={'ContactId':_0x710b03['id'],'ChatWebsiteId':_0x4d308f['params']['id'],'from':(_0x710b03[_0x4f24('0x9f')]||'')+'\x20'+(_0x710b03['lastName']||''),'customerIp':_0x29ea86,'customerPort':_0x4d308f[_0x4f24('0x7d')][_0x4f24('0xa0')]?_0x4d308f[_0x4f24('0x7d')][_0x4f24('0xa0')]:null,'referer':_0x4d308f['body']['referer'],'browserName':_0x549f46[_0x4f24('0xa1')]['name']&&_0x549f46['browser'][_0x4f24('0xa2')]?util[_0x4f24('0xa3')](_0x4f24('0xa4'),_0x549f46[_0x4f24('0xa1')]['name'],_0x549f46['browser']['version']):'unknown','browserVersion':_0x549f46[_0x4f24('0xa1')][_0x4f24('0xa2')]||'unknown','osName':util[_0x4f24('0xa3')](_0x4f24('0xa4'),_0x549f46['os'][_0x4f24('0x2c')],_0x549f46['os']['version']),'osVersion':_0x549f46['os']['version'],'deviceModel':_0x549f46['device'][_0x4f24('0x34')]&&_0x549f46[_0x4f24('0xa5')]['vendor']?util['format']('%s\x20%s\x20%s',_0x549f46['device']['model'],_0x549f46[_0x4f24('0xa5')][_0x4f24('0xa6')],_0x549f46[_0x4f24('0xa5')][_0x4f24('0x32')]):null,'deviceVendor':_0x549f46[_0x4f24('0xa5')][_0x4f24('0xa6')],'deviceType':_0x549f46[_0x4f24('0xa5')][_0x4f24('0x32')],'formData':JSON[_0x4f24('0xa7')](_0x4d308f[_0x4f24('0x4d')])};var _0x19fdb2={'ChatWebsiteId':_0x4d308f[_0x4f24('0x48')]['id'],'closed':![]};if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]){_0x19fdb2[_0x4f24('0xa8')]=_0x4d308f['body'][_0x4f24('0xa8')];return db[_0x4f24('0xa9')][_0x4f24('0x4c')]({'where':_0x19fdb2})[_0x4f24('0x12')](function(_0x54bc51){if(_0x54bc51){return[_0x54bc51,![]];}_0x20dac3['threadId']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')];_0x20dac3['externalUrl']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xaa')];return db[_0x4f24('0xa9')]['create'](_0x20dac3)[_0x4f24('0x12')](function(_0x466bd3){return[_0x466bd3,!![]];});});}_0x19fdb2['ContactId']=_0x710b03['id'];if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]['id']){_0x19fdb2['id']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]['id'];return db['ChatInteraction'][_0x4f24('0x4c')]({'where':_0x19fdb2})[_0x4f24('0x12')](function(_0x56be77){if(_0x56be77){return[_0x56be77,![]];}return db[_0x4f24('0xa9')]['create'](_0x20dac3)[_0x4f24('0x12')](function(_0x5c0efd){return[_0x5c0efd,!![]];});});}return db[_0x4f24('0xa9')][_0x4f24('0x54')](_0x20dac3)[_0x4f24('0x12')](function(_0x13cb29){return[_0x13cb29,!![]];});}})[_0x4f24('0xac')](function(_0x1c3e2f,_0x2adc38){if(_0x1c3e2f){_0x5ef174=_0x2adc38;if(!_0x2adc38){var _0x372ee7={'from':(_0x4ece0e['contact']['firstName']||'')+'\x20'+(_0x4ece0e[_0x4f24('0xad')][_0x4f24('0xae')]||'')};if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xaf')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]!=_0x4d308f[_0x4f24('0x4d')]['messageId']){_0x372ee7[_0x4f24('0xa8')]=_0x4d308f['body'][_0x4f24('0xaf')];}return _0x1c3e2f[_0x4f24('0x25')](_0x372ee7);}else{return _0x1c3e2f;}}})[_0x4f24('0x12')](function(_0x3582fb){_0x4ece0e[_0x4f24('0xab')]=_0x3582fb[_0x4f24('0x26')]({'plain':!![]});_0x4ece0e[_0x4f24('0xab')][_0x4f24('0xb0')]=_0x5ef174;if(_0x4ece0e['interaction'][_0x4f24('0xb0')]){if(_0x4ece0e[_0x4f24('0x95')][_0x4f24('0xb1')]){_0x4ece0e['applications']['push']({'id':0x0,'priority':_0x4ece0e[_0x4f24('0x96')][_0x4f24('0x3b')]+0x1,'app':'close','appdata':_0x4f24('0xb2'),'interval':_0x4f24('0xb3')});}}return db[_0x4f24('0xb4')][_0x4f24('0x54')]({'body':_0x4d308f['body']['body'],'ChatWebsiteId':_0x4d308f[_0x4f24('0x48')]['id'],'ChatInteractionId':_0x3582fb['id'],'direction':'in','ContactId':_0x4ece0e[_0x4f24('0xad')]['id'],'AttachmentId':_0x4d308f[_0x4f24('0x4d')]['AttachmentId']});})['then'](function(_0x4024d6){_0x4ece0e['message']=_0x4024d6;if(_0x4ece0e[_0x4f24('0xab')][_0x4f24('0xb5')]){return db['User']['find']({'attributes':['id',_0x4f24('0x2c')],'where':{'id':_0x4ece0e[_0x4f24('0xab')]['UserId']}})[_0x4f24('0x12')](function(_0x40f489){if(_0x40f489){_0x4ece0e[_0x4f24('0x96')][_0x4f24('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40f489[_0x4f24('0x2c')]+','+(_0x4ece0e[_0x4f24('0x95')]['waitForTheAssignedAgent']||0xa),'interval':_0x4f24('0xb3')});_0x4ece0e[_0x4f24('0xb7')]=!![];}return respondWithRpcPromise(_0x4f24('0xb8'),'startRouting',_0x4ece0e);});}return respondWithRpcPromise('Start',_0x4f24('0xb9'),_0x4ece0e);})[_0x4f24('0x12')](function(_0x3cae4a){respondWithRpcPromise(_0x4f24('0xba'),_0x4f24('0xba'),{'event':_0x4f24('0x7a'),'message':_0x3cae4a},client9002);return _0x3cae4a;})[_0x4f24('0x12')](respondWithResult(_0x28573d,null))['catch'](handleError(_0x28573d,null));};exports[_0x4f24('0xbb')]=function(_0x7c9994,_0x21310b){var _0x400d11,_0xc1ca1,_0x32efd9;var _0x53ee62=[];var _0x5a1ff7={};var _0x1c4751=_0x7c9994[_0x4f24('0xbc')]||[];var _0xef889f=[];var _0x944846;return db[_0x4f24('0x80')][_0x4f24('0x57')]()[_0x4f24('0x12')](function(_0x36da26){if(!_0x36da26){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x83'));}_0x53ee62=_['difference'](_['keys'](_0x36da26),[_0x4f24('0x84'),_0x4f24('0x85'),_0x4f24('0x87'),'ListId']);if(_0x7c9994[_0x4f24('0x4d')]['id']){delete _0x7c9994['body']['id'];}if(_['isNil'](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x8e')])){throw _0x21310b[_0x4f24('0x1d')](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))]['ValidationError'](_0x4f24('0x89')));}if(_[_0x4f24('0x6e')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x4d')])||_0x7c9994['body'][_0x4f24('0x4d')]===''){throw _0x21310b[_0x4f24('0x1d')](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0xbd')));}if(_[_0x4f24('0x6e')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0xbe')])){throw _0x21310b[_0x4f24('0x1d')](0x1f4)['send'](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0xbf')+_0x53ee62));}if(!_['includes'](_0x53ee62,_0x7c9994[_0x4f24('0x4d')]['mapKeyOffline'])){throw _0x21310b['status'](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x53ee62));}_0x5a1ff7[_0x7c9994[_0x4f24('0x4d')][_0x4f24('0xbe')]]=_0x7c9994[_0x4f24('0x4d')]['from'];})[_0x4f24('0x12')](function(){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x7c9994[_0x4f24('0x48')]['id']},'include':[{'model':db[_0x4f24('0x8f')],'as':_0x4f24('0x90')},{'model':db[_0x4f24('0xc0')],'as':_0x4f24('0xc0')}]});})[_0x4f24('0x12')](handleEntityNotFound(_0x21310b,null))[_0x4f24('0x12')](function(_0x48f7e1){if(_0x48f7e1&&_0x48f7e1[_0x4f24('0x90')]){_0xc1ca1=_0x48f7e1;var _0x3e2336=_[_0x4f24('0xc')](_0x7c9994[_0x4f24('0x4d')],{'firstName':_0x7c9994['body']['from'],'phone':_0x7c9994['body'][_0x4f24('0x8e')],'ListId':_0x48f7e1[_0x4f24('0x88')]});_0x3e2336[_0x7c9994['body'][_0x4f24('0xbe')]]=_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x8e')];return db['CmContact'][_0x4f24('0xc1')]({'where':_0x5a1ff7,'defaults':_0x3e2336});}})['spread'](function(_0x802c6d){if(_0x802c6d){_0x32efd9=_0x802c6d;var _0x1702bf=fs[_0x4f24('0xc2')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0xc3')),_0x4f24('0xc4'));var _0x157b1e=ejs[_0x4f24('0xc5')](_0x1702bf,{'body':_[_0x4f24('0xc6')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x4d')]),'bodyTitle':_0xc1ca1[_0x4f24('0xc7')]});return db[_0x4f24('0xc8')][_0x4f24('0x54')]({'body':_0x157b1e,'ContactId':_0x802c6d['id'],'ChatWebsiteId':_0xc1ca1['id']});}})['then'](function(_0x946400){_0x944846=_0x946400;if(_0x1c4751[_0x4f24('0x3b')]){var _0x57a220=_0x1c4751[_0x4f24('0x2f')](function(_0xdd0829){return{'name':_0xdd0829[_0x4f24('0xc9')],'basename':_0xdd0829[_0x4f24('0x69')],'type':_0xdd0829['mimetype'],'ChatOfflineMessageId':_0x946400['id']};});_0xef889f=_0x57a220[_0x4f24('0x2f')](_0x35002c=>{var _0x2cb72c={'filename':_0x35002c[_0x4f24('0x2c')],'path':path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0xca'),_0x4f24('0xbc'),_0x4f24('0xcb'),_0x4f24('0xcc'),_0x35002c[_0x4f24('0xcd')])};return _0x2cb72c;});if(!_0xc1ca1[_0x4f24('0xce')]){return db[_0x4f24('0xcf')]['transaction'](function(_0x5db914){return db['Attachment'][_0x4f24('0xd0')](_0x57a220,{'transaction':_0x5db914});});}}})[_0x4f24('0x12')](function(){if(_0x944846){_0x400d11=_0x944846;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4f24('0xd1'),'raw':!![]}]});}})['then'](function(_0x1e6876){if(_0x1e6876&&_0x1e6876[_0x4f24('0xd1')]&&_0xc1ca1[_0x4f24('0xd2')]&&_0xc1ca1[_0x4f24('0xd3')]){var _0x432c60={'tls':{'rejectUnauthorized':![]}};if(_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd4')]){_0x432c60[_0x4f24('0xd4')]=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd4')];}else{_0x432c60[_0x4f24('0xd5')]=_0x1e6876[_0x4f24('0xd1')]['host'];_0x432c60['port']=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd6')];_0x432c60[_0x4f24('0xd7')]=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd7')];}if(_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd8')]){_0x432c60[_0x4f24('0xd9')]={'user':_0x1e6876[_0x4f24('0xd1')][_0x4f24('0x4e')],'pass':_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xda')]};}return respondWithRpcPromise(_0x4f24('0xdb'),_0x4f24('0xdc'),{'account':_0x432c60,'message':{'from':util[_0x4f24('0xa3')](_0x4f24('0xdd'),_0x1e6876[_0x4f24('0x2c')],_0x1e6876[_0x4f24('0xde')]||_0x1e6876[_0x4f24('0xd1')][_0x4f24('0x4e')]),'to':_0xc1ca1['forwardOfflineAddress'],'subject':_0xc1ca1[_0x4f24('0xdf')],'html':_0x400d11['body'],'attachments':_0xef889f}},client9003)['then'](function(){return _0x400d11;})['catch'](function(_0x10085a){console[_0x4f24('0x17')](_0x10085a);});}})[_0x4f24('0x12')](function(){if(_0xc1ca1&&_0xc1ca1[_0x4f24('0xce')]&&_0xc1ca1['MailAccountId']){var _0x5d8f95=[];if(_0x1c4751[_0x4f24('0x3b')]){_0x5d8f95=_0x1c4751[_0x4f24('0x2f')](function(_0x4a8b78){return{'name':_0x4a8b78['originalname'],'basename':_0x4a8b78['filename'],'type':_0x4a8b78[_0x4f24('0xe0')],'ChatOfflineMessageId':_0x944846['id']};});}var _0x3d119c;if(!_[_0x4f24('0x6e')](_0xc1ca1[_0x4f24('0xe1')])){var _0x503e50=_[_0x4f24('0x2f')](_0x7c9994[_0x4f24('0x4d')],function(_0x2b0ad8){return _0x2b0ad8;});var _0x415d49=_[_0x4f24('0xe2')](_0x503e50)[0x0];var _0x536331=_['mapValues'](_0x415d49,function(_0x3aa4e2){return _0x3aa4e2;});_0x3d119c=_0x536331[0x1][_0xc1ca1[_0x4f24('0xe1')]];}var _0x2a1c71={'from':_0x32efd9[_0x4f24('0xde')],'firstName':_0x32efd9[_0x4f24('0x9f')],'lastName':_0x32efd9[_0x4f24('0xae')],'mapKey':'email','message':{'from':_0x32efd9[_0x4f24('0xde')],'to':_0xc1ca1[_0x4f24('0xc0')][_0x4f24('0xde')],'cc':'','subject':_[_0x4f24('0x6e')](_0x3d119c)?_0xc1ca1[_0x4f24('0xdf')]:_0x3d119c,'messageId':'','sentAt':new Date(),'attach':_0x5d8f95[_0x4f24('0x3b')],'attachments':_0x5d8f95,'originChannel':_0x4f24('0xe3'),'ChatWebsiteId':_0xc1ca1['id'],'ChatOfflineMessageId':_0x400d11['id'],'originTo':_0xc1ca1[_0x4f24('0xc0')][_0x4f24('0xde')]},'body':_0x400d11[_0x4f24('0x4d')]};var _0x51d9c4={'account':{'id':_0xc1ca1[_0x4f24('0xe4')]},'body':_0x2a1c71,'log':_0x4f24('0xe5')};return respondWithRpcPromise(_0x4f24('0xe5'),'notifyMail',_0x51d9c4,client9001)[_0x4f24('0x12')](function(){return _0x400d11;})[_0x4f24('0x1c')](function(_0x2c3451){console[_0x4f24('0x17')](_0x2c3451);});}return;})[_0x4f24('0x12')](function(){if(_0x400d11){return _0x400d11;}})[_0x4f24('0x12')](respondWithResult(_0x21310b,null))['catch'](function(_0x40e193){console[_0x4f24('0x17')](_0x4f24('0x1c'),_0x40e193);for(var _0x4a17d4 of _0x1c4751){var _0x3d1dbe=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server','files',_0x4f24('0xcb'),_0x4f24('0xcc'),_0x4a17d4[_0x4f24('0x69')]);fs_extra[_0x4f24('0xe6')](_0x3d1dbe)[_0x4f24('0x1c')](function(_0x36a498){console['error'](_0x4f24('0xe7'),_0x3d1dbe,_0x36a498);});}});};exports[_0x4f24('0xe8')]=function(_0x5c2b4f,_0x16016a){return db[_0x4f24('0xa9')]['find']({'where':{'id':_0x5c2b4f[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x16016a,null))[_0x4f24('0x12')](function(_0x23c46b){if(_0x23c46b){return _0x23c46b[_0x4f24('0xe8')](_0x5c2b4f[_0x4f24('0x4d')][_0x4f24('0x5e')],_[_0x4f24('0xe9')](_0x5c2b4f[_0x4f24('0x4d')],[_0x4f24('0x5e'),'id'])||{});}})[_0x4f24('0x12')](respondWithResult(_0x16016a,null))['catch'](handleError(_0x16016a,null));};exports['getInteractions']=function(_0x59b390,_0x104333){var _0xf92d65={'raw':![],'where':{}};var _0x39ffd7={};var _0x52af4b={'count':0x0,'rows':[]};return db[_0x4f24('0x30')]['findOne']({'where':{'id':_0x59b390['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x104333,null))[_0x4f24('0x12')](function(_0x2dadff){if(_0x2dadff){_0x39ffd7[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0xa9')][_0x4f24('0x31')]);_0x39ffd7[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x59b390[_0x4f24('0x35')]);_0x39ffd7['filters']=_['intersection'](_0x39ffd7['model'],_0x39ffd7[_0x4f24('0x35')]);_0xf92d65['attributes']=_[_0x4f24('0x38')](_0x39ffd7[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x59b390[_0x4f24('0x35')]['fields']));_0xf92d65[_0x4f24('0x39')]=_0xf92d65[_0x4f24('0x39')][_0x4f24('0x3b')]?_0xf92d65[_0x4f24('0x39')]:_0x39ffd7[_0x4f24('0x34')];if(!_0x59b390[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0xf92d65[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x22')]);_0xf92d65[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0xf92d65[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x3f')]);_0xf92d65['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x59b390[_0x4f24('0x35')],_0x39ffd7[_0x4f24('0x37')]));_0xf92d65[_0x4f24('0x44')][_0x4f24('0x61')]=_0x2dadff['id'];if(_0x59b390[_0x4f24('0x35')]['filter']){_0xf92d65[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0xf92d65[_0x4f24('0x44')],{'$or':_['map'](_0xf92d65['attributes'],function(_0x152c66){var _0x3babb0={};_0x3babb0[_0x152c66]={'$like':'%'+_0x59b390['query'][_0x4f24('0x41')]+'%'};return _0x3babb0;})});}_0xf92d65=_[_0x4f24('0x42')]({},_0xf92d65,_0x59b390[_0x4f24('0x4b')]);return db['ChatInteraction'][_0x4f24('0x21')]({'where':_0xf92d65[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0xd0e129){_0x52af4b[_0x4f24('0x21')]=_0xd0e129;if(_0x59b390[_0x4f24('0x35')][_0x4f24('0x45')]){_0xf92d65[_0x4f24('0x4a')]=[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0xea'),'required':![]},{'model':db[_0x4f24('0xeb')],'as':_0x4f24('0xec'),'attributes':[_0x4f24('0x2c'),_0x4f24('0xed'),_0x4f24('0xee')],'required':![]},{'model':db[_0x4f24('0xef')],'as':_0x4f24('0xf0'),'attributes':['id','name',_0x4f24('0xf1')],'where':_0x59b390['query'][_0x4f24('0xf2')]?{'id':_0x59b390[_0x4f24('0x35')][_0x4f24('0xf2')]}:undefined,'required':_0x59b390[_0x4f24('0x35')][_0x4f24('0xf2')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0xf92d65);})[_0x4f24('0x12')](function(_0x4f0606){_0x52af4b['rows']=_0x4f0606;return _0x52af4b;});}})['then'](respondWithFilteredResult(_0x104333,_0xf92d65))[_0x4f24('0x1c')](handleError(_0x104333,null));};function iftimePromise(_0xa3235e,_0x122007){return respondWithRpcPromise(_0x4f24('0xf3'),_0x4f24('0xf4'),{'command':_0x122007['timezone']?util[_0x4f24('0xa3')](_0x4f24('0xf5'),_0xa3235e[_0x4f24('0xf6')],_0x122007[_0x4f24('0xf7')]):util[_0x4f24('0xa3')](_0x4f24('0xf8'),_0xa3235e[_0x4f24('0xf6')])},client9002)[_0x4f24('0x12')](function(_0x45d367){var _0x2d1fae=_0x45d367&&_0x45d367[_0x4f24('0xf9')](_0x4f24('0xfa'))>=0x0?!![]:![];logger['info'](_0x4f24('0xfb'),_0x122007['id'],_0xa3235e['id'],_0xa3235e[_0x4f24('0xf6')],_0x2d1fae?'ONLINE':_0x4f24('0xfc'),_0x122007[_0x4f24('0xf7')]?_0x122007['timezone']:_0x4f24('0xfd'));return _0x2d1fae;})['catch'](function(_0x3dc535){logger[_0x4f24('0x17')](_0x4f24('0xfb'),_0x122007['id'],_0xa3235e['id'],_0xa3235e[_0x4f24('0xf6')],util[_0x4f24('0xfe')](_0x3dc535,{'showHidden':![],'depth':null}),_0x122007[_0x4f24('0xf7')]?_0x122007[_0x4f24('0xf7')]:_0x4f24('0xfd'));return![];});}exports[_0x4f24('0xf4')]=function(_0x293d01,_0x106024){var _0x3ec9cc=0x0;var _0x48e403=0x0;var _0x571842=![];var _0x34fdfd;var _0x12550f;return db['ChatWebsite']['find']({'where':{'id':_0x293d01['params']['id']},'include':[{'model':db[_0x4f24('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x4f24('0x100'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x4f24('0x12')](handleEntityNotFound(_0x106024,null))['then'](function(_0x237d8b){if(_0x237d8b){_0x34fdfd=_0x237d8b;return _0x237d8b[_0x4f24('0x101')]({'raw':!![]});}})[_0x4f24('0x12')](function(_0x58ff18){if(_0x34fdfd){if(_0x58ff18){_0x12550f=_0x58ff18;}}return require('../../config/license/util')[_0x4f24('0x6c')]();})[_0x4f24('0x12')](function(_0x46561b){if(_0x46561b){_0x48e403=_0x46561b[_0x4f24('0x102')];_0x571842=_0x46561b[_0x4f24('0x6d')];}})[_0x4f24('0x12')](function(){return db[_0x4f24('0xa9')][_0x4f24('0x21')]({'where':{'closed':![]}});})[_0x4f24('0x12')](function(_0x2d3074){_0x3ec9cc=_0x2d3074;if(_0x48e403&&_0x2d3074>_0x48e403){return db[_0x4f24('0x103')]['findOne']({'where':{'id':0x1}})['then'](function(_0x3eb63c){if(_0x3eb63c){_0x3eb63c[_0x4f24('0x104')](_0x4f24('0x105'));}});}})[_0x4f24('0x12')](function(){if(_0x34fdfd[_0x4f24('0xff')]&&_0x34fdfd[_0x4f24('0xff')][_0x4f24('0x100')]){var _0x53ec78=[];for(var _0x40724a=0x0;_0x40724a<_0x34fdfd['Interval'][_0x4f24('0x100')][_0x4f24('0x3b')];_0x40724a++){var _0x25b90e=_0x34fdfd[_0x4f24('0xff')][_0x4f24('0x100')][_0x40724a][_0x4f24('0x26')]({'plain':!![]});_0x53ec78[_0x4f24('0x106')](iftimePromise(_0x25b90e,_0x34fdfd));}return BPromise[_0x4f24('0x107')](_0x53ec78)[_0x4f24('0x12')](function(_0x38d11f){return _['some'](_0x38d11f);});}else{return!![];}})[_0x4f24('0x12')](function(_0x44ae30){var _0x523ee8=fs[_0x4f24('0xc2')](path[_0x4f24('0x6b')](config['root'],_0x4f24('0x108')),_0x4f24('0xc4'));var _0xa8e0e={'remote':_0x34fdfd[_0x4f24('0x109')],'query':querystring[_0x4f24('0xa7')](_[_0x4f24('0x42')](_0x34fdfd[_0x4f24('0x26')]({'plain':!![]}),{'customerIp':_0x293d01[_0x4f24('0x7d')][_0x4f24('0x9c')]||_0x293d01['headers'][_0x4f24('0x10a')]||_0x293d01[_0x4f24('0x10b')][_0x4f24('0x10c')]||_0x293d01['ip'],'referer':_0x293d01[_0x4f24('0x7d')][_0x4f24('0x10d')],'openedInteractions':_0x3ec9cc,'maxInteractions':_0x48e403,'virtual':_0x571842[_0x4f24('0x102')],'online':_0x44ae30,'custom':_0x571842}))['replace'](/'/g,'\x5c\x27')};_0x106024[_0x4f24('0x2d')](ejs['render'](Mustache[_0x4f24('0xc5')](_0x523ee8,_0xa8e0e),{'proactiveActions':_0x12550f,'alignment':_0x34fdfd[_0x4f24('0x10e')],'verticalAlignment':_0x34fdfd[_0x4f24('0x10f')],'div_color':_0x34fdfd[_0x4f24('0xf1')],'labelText':_0x34fdfd['labelText'],'text_color':_0x34fdfd[_0x4f24('0x110')],'button_color':_0x34fdfd[_0x4f24('0x111')],'background_color':_0x34fdfd[_0x4f24('0x112')]}));})[_0x4f24('0x1c')](handleError(_0x106024,null));};exports[_0x4f24('0x113')]=function(_0xf88892,_0x5ab35b){var _0x554f4b=_0xf88892[_0x4f24('0x48')]['id'];var _0x495b7b=_0xf88892[_0x4f24('0x4d')];var _0x2b83e5=0xc8;var _0x1028f9=null;return db[_0x4f24('0xcf')][_0x4f24('0x114')]({'isolationLevel':db[_0x4f24('0xcf')][_0x4f24('0x115')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x57a05b){return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x554f4b},'transaction':_0x57a05b})[_0x4f24('0x12')](function(_0x5ae965){if(_0x5ae965){return db['ChatApplication'][_0x4f24('0x28')]({'where':{'ChatWebsiteId':_0x554f4b},'transaction':_0x57a05b})[_0x4f24('0x12')](function(){var _0x50ff29=_[_0x4f24('0x2f')](_0x495b7b,function(_0x5cdaa9){_0x5cdaa9[_0x4f24('0x61')]=_0x554f4b;return _0x5cdaa9;});return db[_0x4f24('0x93')]['bulkCreate'](_0x50ff29,{'transaction':_0x57a05b});});}else{_0x2b83e5=0x194;_0x1028f9=[];}});})[_0x4f24('0x12')](function(){if(_0x2b83e5!==0x194){return db[_0x4f24('0x93')][_0x4f24('0x116')]({'where':{'ChatWebsiteId':_0x554f4b},'order':_0x4f24('0x98')})['then'](function(_0x385e39){_0x1028f9=_0x385e39;});}})[_0x4f24('0x1c')](function(_0x42cfd6){_0x2b83e5=0x1f4;logger['error'](_0x42cfd6[_0x4f24('0x2b')]);if(_0x42cfd6[_0x4f24('0x2c')]){delete _0x42cfd6[_0x4f24('0x2c')];}_0x1028f9=_0x42cfd6;})[_0x4f24('0x117')](function(){if(_0x1028f9===null){_0x5ab35b[_0x4f24('0x2a')](_0x2b83e5);}else{if(_0x2b83e5===0x1f4){_0x5ab35b[_0x4f24('0x1d')](_0x2b83e5)[_0x4f24('0x2d')](_0x1028f9);}else{_0x5ab35b[_0x4f24('0x1d')](_0x2b83e5)['json'](_0x1028f9);}}});};exports[_0x4f24('0x118')]=function(_0x50284f,_0x55f3eb){var _0x47a42a={};var _0x18fe14={};var _0x4bd32f;var _0x187ad2;return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x50284f[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x55f3eb,null))[_0x4f24('0x12')](function(_0x2ce8f6){if(_0x2ce8f6){_0x4bd32f=_0x2ce8f6;_0x18fe14[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x93')][_0x4f24('0x31')]);_0x18fe14[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x50284f[_0x4f24('0x35')]);_0x18fe14['filters']=_[_0x4f24('0x38')](_0x18fe14[_0x4f24('0x34')],_0x18fe14[_0x4f24('0x35')]);_0x47a42a[_0x4f24('0x39')]=_['intersection'](_0x18fe14['model'],qs[_0x4f24('0x3a')](_0x50284f[_0x4f24('0x35')]['fields']));_0x47a42a[_0x4f24('0x39')]=_0x47a42a[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x47a42a['attributes']:_0x18fe14[_0x4f24('0x34')];_0x47a42a[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x50284f[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x47a42a[_0x4f24('0x44')]=qs['filters'](_['pick'](_0x50284f[_0x4f24('0x35')],_0x18fe14[_0x4f24('0x37')]));if(_0x50284f[_0x4f24('0x35')][_0x4f24('0x41')]){_0x47a42a[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x47a42a[_0x4f24('0x44')],{'$or':_['map'](_0x47a42a[_0x4f24('0x39')],function(_0x13ffec){var _0x21ecda={};_0x21ecda[_0x13ffec]={'$like':'%'+_0x50284f[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x21ecda;})});}_0x47a42a=_[_0x4f24('0x42')]({},_0x47a42a,_0x50284f[_0x4f24('0x4b')]);return _0x4bd32f[_0x4f24('0x118')](_0x47a42a);}})[_0x4f24('0x12')](function(_0x28f310){if(_0x28f310){_0x187ad2=_0x28f310['length'];if(!_0x50284f['query'][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x47a42a[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x50284f['query'][_0x4f24('0x22')]);_0x47a42a['offset']=qs[_0x4f24('0x1f')](_0x50284f['query']['offset']);}return _0x4bd32f['getApplications'](_0x47a42a);}})[_0x4f24('0x12')](function(_0x41d2cd){if(_0x41d2cd){return _0x41d2cd?{'count':_0x187ad2,'rows':_0x41d2cd}:null;}})['then'](respondWithResult(_0x55f3eb,null))[_0x4f24('0x1c')](handleError(_0x55f3eb,null));};exports[_0x4f24('0x119')]=function(_0x2c67df,_0x241854){return db[_0x4f24('0x11a')][_0x4f24('0x4c')]({'where':{'id':_0x2c67df['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x241854,null))[_0x4f24('0x12')](function(_0x46c083){if(_0x46c083){return _0x46c083[_0x4f24('0x119')](_0x2c67df['body'][_0x4f24('0x5e')],_[_0x4f24('0xe9')](_0x2c67df[_0x4f24('0x4d')],[_0x4f24('0x5e'),'id'])||{});}})[_0x4f24('0x12')](respondWithResult(_0x241854,null))['catch'](handleError(_0x241854,null));};exports[_0x4f24('0x101')]=function(_0x45fd8a,_0x28d5c3){var _0x42c593={};var _0x4c3196={};var _0x4a807a;var _0x3f14b3;return db[_0x4f24('0x30')]['findOne']({'where':{'id':_0x45fd8a[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x28d5c3,null))['then'](function(_0x525338){if(_0x525338){_0x4a807a=_0x525338;_0x4c3196[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x11b')]['rawAttributes']);_0x4c3196['query']=_['keys'](_0x45fd8a[_0x4f24('0x35')]);_0x4c3196['filters']=_[_0x4f24('0x38')](_0x4c3196[_0x4f24('0x34')],_0x4c3196[_0x4f24('0x35')]);_0x42c593[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x4c3196[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x45fd8a['query'][_0x4f24('0x3a')]));_0x42c593['attributes']=_0x42c593[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x42c593[_0x4f24('0x39')]:_0x4c3196[_0x4f24('0x34')];_0x42c593[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x42c593[_0x4f24('0x44')]=qs['filters'](_['pick'](_0x45fd8a[_0x4f24('0x35')],_0x4c3196[_0x4f24('0x37')]));if(_0x45fd8a['query'][_0x4f24('0x41')]){_0x42c593[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x42c593[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x42c593['attributes'],function(_0x26b4e4){var _0x69c9fb={};_0x69c9fb[_0x26b4e4]={'$like':'%'+_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x69c9fb;})});}_0x42c593=_['merge']({},_0x42c593,_0x45fd8a[_0x4f24('0x4b')]);return _0x4a807a['getProactiveActions'](_0x42c593);}})[_0x4f24('0x12')](function(_0xd15b90){if(_0xd15b90){_0x3f14b3=_0xd15b90[_0x4f24('0x3b')];if(!_0x45fd8a['query']['hasOwnProperty']('nolimit')){_0x42c593['limit']=qs[_0x4f24('0x22')](_0x45fd8a[_0x4f24('0x35')]['limit']);_0x42c593['offset']=qs[_0x4f24('0x1f')](_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x1f')]);}return _0x4a807a[_0x4f24('0x101')](_0x42c593);}})[_0x4f24('0x12')](function(_0x2a46aa){if(_0x2a46aa){return _0x2a46aa?{'count':_0x3f14b3,'rows':_0x2a46aa}:null;}})[_0x4f24('0x12')](respondWithResult(_0x28d5c3,null))['catch'](handleError(_0x28d5c3,null));};exports[_0x4f24('0x11c')]=function(_0x3fede3,_0x567b7f){var _0x53298c=_0x3fede3['query'][_0x4f24('0x11d')]===_0x4f24('0x11e')?_0x4f24('0x11f'):_0x4f24('0x120');return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'attributes':['id',_0x53298c],'where':{'id':_0x3fede3['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x567b7f,null))[_0x4f24('0x12')](function(_0x25ff10){if(_0x25ff10){var _0xacc145=_0x25ff10[_0x53298c];var _0x317baf=_0xacc145&&_0xacc145['items']?_0xacc145[_0x4f24('0x121')]:[];_0x567b7f['send']({'fromKey':_[_0x4f24('0x6e')](_0xacc145[_0x4f24('0x122')])?undefined:_0xacc145[_0x4f24('0x122')],'count':_0x317baf['length'],'rows':_0x317baf});}})[_0x4f24('0x1c')](handleError(_0x567b7f,null));};exports[_0x4f24('0x123')]=function(_0x60ceb9,_0x313773){var _0x520dde={'raw':![],'where':{}};var _0x112ca3={};var _0x22dc63={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x60ceb9['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x313773,null))[_0x4f24('0x12')](function(_0x1f9330){if(_0x1f9330){_0x112ca3[_0x4f24('0x34')]=_['keys'](db[_0x4f24('0xc8')][_0x4f24('0x31')]);_0x112ca3['query']=_[_0x4f24('0x36')](_0x60ceb9[_0x4f24('0x35')]);_0x112ca3[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x112ca3[_0x4f24('0x34')],_0x112ca3[_0x4f24('0x35')]);_0x520dde[_0x4f24('0x39')]=_['intersection'](_0x112ca3[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x520dde[_0x4f24('0x39')]=_0x520dde['attributes']['length']?_0x520dde[_0x4f24('0x39')]:_0x112ca3['model'];if(!_0x60ceb9[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0x520dde[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x22')]);_0x520dde[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x520dde[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x520dde['where']=qs[_0x4f24('0x37')](_['pick'](_0x60ceb9[_0x4f24('0x35')],_0x112ca3[_0x4f24('0x37')]));_0x520dde[_0x4f24('0x44')]['ChatWebsiteId']=_0x1f9330['id'];if(_0x60ceb9['query'][_0x4f24('0x41')]){_0x520dde[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x520dde[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x520dde[_0x4f24('0x39')],function(_0xe04fb){var _0x293ffb={};_0x293ffb[_0xe04fb]={'$like':'%'+_0x60ceb9['query']['filter']+'%'};return _0x293ffb;})});}_0x520dde=_['merge']({},_0x520dde,_0x60ceb9[_0x4f24('0x4b')]);return db[_0x4f24('0xc8')][_0x4f24('0x21')]({'where':_0x520dde[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0x98822e){_0x22dc63[_0x4f24('0x21')]=_0x98822e;if(_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x45')]){_0x520dde[_0x4f24('0x4a')]=[{'all':!![]}];}else{_0x520dde[_0x4f24('0x4a')]=[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0xea'),'required':![]},{'model':db['Attachment'],'as':_0x4f24('0x124'),'required':![]}];}return db[_0x4f24('0xc8')][_0x4f24('0x5c')](_0x520dde);})[_0x4f24('0x12')](function(_0x560f19){_0x22dc63[_0x4f24('0x46')]=_0x560f19;return _0x22dc63;});}})['then'](respondWithFilteredResult(_0x313773,_0x520dde))[_0x4f24('0x1c')](handleError(_0x313773,null));};exports[_0x4f24('0x125')]=function(_0x36e5a5,_0x42d171){return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0x36e5a5[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x42d171,null))['then'](function(_0xd63a76){if(_0xd63a76){return _0xd63a76[_0x4f24('0x125')](_0x36e5a5[_0x4f24('0x4d')]['ids'],_[_0x4f24('0xe9')](_0x36e5a5[_0x4f24('0x4d')],['ids','id'])||{})['spread'](function(_0x41e7a2){for(var _0xc5f660=0x0;_0xc5f660<_0x36e5a5['body'][_0x4f24('0x5e')][_0x4f24('0x3b')];_0xc5f660+=0x1){socket[_0x4f24('0x126')](_0x4f24('0x127'),{'UserId':Number(_0x36e5a5[_0x4f24('0x4d')][_0x4f24('0x5e')][_0xc5f660]),'ChatWebsiteId':Number(_0x36e5a5[_0x4f24('0x48')]['id'])});}return _0x41e7a2;});}})[_0x4f24('0x12')](respondWithResult(_0x42d171,null))[_0x4f24('0x1c')](handleError(_0x42d171,null));};exports[_0x4f24('0x128')]=function(_0x1e4ff1,_0x1cac05){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x1e4ff1[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x1cac05,null))[_0x4f24('0x12')](function(_0x52125b){if(_0x52125b){return _0x52125b['removeAgents'](_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')])['then'](function(){if(_[_0x4f24('0x129')](_0x1e4ff1['query']['ids'])){for(var _0x1b89bf=0x0;_0x1b89bf<_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')][_0x4f24('0x3b')];_0x1b89bf+=0x1){socket[_0x4f24('0x126')](_0x4f24('0x12a'),{'UserId':Number(_0x1e4ff1[_0x4f24('0x35')]['ids'][_0x1b89bf]),'ChatWebsiteId':Number(_0x1e4ff1['params']['id'])});}}else{socket[_0x4f24('0x126')](_0x4f24('0x12a'),{'UserId':Number(_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')]),'ChatWebsiteId':Number(_0x1e4ff1[_0x4f24('0x48')]['id'])});}});}})[_0x4f24('0x12')](respondWithStatusCode(_0x1cac05,null))['catch'](handleError(_0x1cac05,null));};exports[_0x4f24('0x12b')]=function(_0x4e3c50,_0x2fe8d7){var _0x102b43={};var _0xd3aadf={};var _0x4ff820;var _0x68f89f;return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x4e3c50[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2fe8d7,null))[_0x4f24('0x12')](function(_0x4abad2){if(_0x4abad2){_0x4ff820=_0x4abad2;_0xd3aadf[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0xeb')][_0x4f24('0x31')]);_0xd3aadf[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x4e3c50[_0x4f24('0x35')]);_0xd3aadf[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0xd3aadf['model'],_0xd3aadf['query']);_0x102b43['attributes']=_['intersection'](_0xd3aadf['model'],qs[_0x4f24('0x3a')](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x102b43[_0x4f24('0x39')]=_0x102b43[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x102b43[_0x4f24('0x39')]:_0xd3aadf[_0x4f24('0x34')];_0x102b43['order']=qs['sort'](_0x4e3c50['query'][_0x4f24('0x3f')]);_0x102b43[_0x4f24('0x44')]=qs[_0x4f24('0x37')](_['pick'](_0x4e3c50[_0x4f24('0x35')],_0xd3aadf[_0x4f24('0x37')]));if(_0x4e3c50['query']['filter']){_0x102b43[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x102b43['where'],{'$or':_[_0x4f24('0x2f')](_0x102b43['attributes'],function(_0x4a16cd){var _0x22ac7c={};_0x22ac7c[_0x4a16cd]={'$like':'%'+_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x22ac7c;})});}_0x102b43=_[_0x4f24('0x42')]({},_0x102b43,_0x4e3c50[_0x4f24('0x4b')]);return _0x4ff820[_0x4f24('0x12b')](_0x102b43);}})['then'](function(_0x1f8a55){if(_0x1f8a55){_0x68f89f=_0x1f8a55[_0x4f24('0x3b')];if(!_0x4e3c50['query'][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x102b43[_0x4f24('0x22')]=qs['limit'](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x22')]);_0x102b43[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x1f')]);}return _0x4ff820['getAgents'](_0x102b43);}})[_0x4f24('0x12')](function(_0x2b8c73){if(_0x2b8c73){return _0x2b8c73?{'count':_0x68f89f,'rows':_0x2b8c73}:null;}})[_0x4f24('0x12')](respondWithResult(_0x2fe8d7,null))[_0x4f24('0x1c')](handleError(_0x2fe8d7,null));}; \ No newline at end of file +var _0xce58=['unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','difference','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','License','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','options','find','create','body','user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','rows','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','file','agentAvatar','filename','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','getAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','user-agent','getResult','CmContact','Sequelize','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','applications','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','version'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xce58,0x1b4));var _0x8ce5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce58[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8ce5('0x0'));var Mustache=require(_0x8ce5('0x1'));var util=require(_0x8ce5('0x2'));var path=require(_0x8ce5('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x8ce5('0x4'));var Redis=require(_0x8ce5('0x5'));var qs=require(_0x8ce5('0x6'));var logger=require(_0x8ce5('0x7'))(_0x8ce5('0x8'));var config=require(_0x8ce5('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x8ce5('0xa')],{'host':_0x8ce5('0xb'),'port':0x18eb});var socket=require(_0x8ce5('0xc'))(new Redis(config[_0x8ce5('0xa')]));require(_0x8ce5('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x232b});var client9001=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x2c958c,_0x3dd0ea,_0x4a47e7,_0x5acf6f){return new BPromise(function(_0xea380c,_0x62d4b0){var _0x18847b=_0x5acf6f||client;return _0x18847b[_0x8ce5('0x10')](_0x2c958c,_0x4a47e7)[_0x8ce5('0x11')](function(_0x3db1a7){logger[_0x8ce5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x3dd0ea,_0x8ce5('0x13'));logger[_0x8ce5('0x14')](_0x8ce5('0x15'),_0x3dd0ea,_0x8ce5('0x13'),JSON[_0x8ce5('0x16')](_0x3db1a7));if(_0x3db1a7[_0x8ce5('0x17')]){if(_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x18')]===0x1f4){logger[_0x8ce5('0x17')](_0x8ce5('0x19'),_0x3dd0ea,_0x3db1a7[_0x8ce5('0x17')]['message']);return _0x62d4b0(_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x1a')]);}logger[_0x8ce5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x3dd0ea,_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x1a')]);return _0xea380c(_0x3db1a7[_0x8ce5('0x17')]['message']);}else{logger[_0x8ce5('0x12')](_0x8ce5('0x19'),_0x3dd0ea,_0x8ce5('0x13'));_0xea380c(_0x3db1a7[_0x8ce5('0x1b')]['message']);}})[_0x8ce5('0x1c')](function(_0x23a993){logger[_0x8ce5('0x17')](_0x8ce5('0x19'),_0x3dd0ea,_0x23a993);_0x62d4b0(_0x23a993);});});}function respondWithStatusCode(_0xb18987,_0x14dd60){_0x14dd60=_0x14dd60||0xcc;return function(_0x322e45){if(_0x322e45){return _0xb18987[_0x8ce5('0x1d')](_0x14dd60);}return _0xb18987['status'](_0x14dd60)[_0x8ce5('0x1e')]();};}function respondWithResult(_0x15e20e,_0x19f426){_0x19f426=_0x19f426||0xc8;return function(_0x331e76){if(_0x331e76){return _0x15e20e[_0x8ce5('0x1f')](_0x19f426)[_0x8ce5('0x20')](_0x331e76);}};}function respondWithFilteredResult(_0x853770,_0x380c4e){return function(_0x4b7873){if(_0x4b7873){var _0x22881c=typeof _0x380c4e[_0x8ce5('0x21')]===_0x8ce5('0x22')&&typeof _0x380c4e[_0x8ce5('0x23')]==='undefined';var _0x4a9d30=_0x4b7873[_0x8ce5('0x24')];var _0x49d65c=_0x22881c?0x0:_0x380c4e[_0x8ce5('0x21')];var _0x513aee=_0x22881c?_0x4b7873[_0x8ce5('0x24')]:_0x380c4e['offset']+_0x380c4e[_0x8ce5('0x23')];var _0x4b0bd0;if(_0x513aee>=_0x4a9d30){_0x513aee=_0x4a9d30;_0x4b0bd0=0xc8;}else{_0x4b0bd0=0xce;}_0x853770['status'](_0x4b0bd0);return _0x853770[_0x8ce5('0x25')](_0x8ce5('0x26'),_0x49d65c+'-'+_0x513aee+'/'+_0x4a9d30)[_0x8ce5('0x20')](_0x4b7873);}return null;};}function saveUpdates(_0x16743d){return function(_0x436ab3){if(_0x436ab3){return _0x436ab3[_0x8ce5('0x27')](_0x16743d)[_0x8ce5('0x11')](function(_0x553256){return _0x553256;});}return null;};}function removeEntity(_0x36a704){return function(_0xfbd1a6){if(_0xfbd1a6){return _0xfbd1a6[_0x8ce5('0x28')]()['then'](function(){var _0x65ed6e=_0xfbd1a6[_0x8ce5('0x29')]({'plain':!![]});var _0xaeb2a2='ChatWebsites';return db[_0x8ce5('0x2a')][_0x8ce5('0x28')]({'where':{'type':_0xaeb2a2,'resourceId':_0x65ed6e['id']}})[_0x8ce5('0x11')](function(){return _0xfbd1a6;});})['then'](function(){_0x36a704[_0x8ce5('0x1f')](0xcc)[_0x8ce5('0x1e')]();});}};}function handleEntityNotFound(_0x190183){return function(_0x5a6b39){if(!_0x5a6b39){_0x190183[_0x8ce5('0x1d')](0x194);}return _0x5a6b39;};}function handleError(_0x4f4020,_0x39c784){_0x39c784=_0x39c784||0x1f4;return function(_0x5c2f81){logger[_0x8ce5('0x17')](_0x5c2f81[_0x8ce5('0x2b')]);if(_0x5c2f81[_0x8ce5('0x2c')]){delete _0x5c2f81[_0x8ce5('0x2c')];}_0x4f4020[_0x8ce5('0x1f')](_0x39c784)[_0x8ce5('0x2d')](_0x5c2f81);};}exports['index']=function(_0x109c71,_0x2c4aeb){var _0x478a2c={'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]},_0x2adc21={},_0x39447d={'count':0x0,'rows':[]};var _0x5ac99b=_['map'](db[_0x8ce5('0x30')][_0x8ce5('0x31')],function(_0x11ea0f){return{'name':_0x11ea0f[_0x8ce5('0x32')],'type':_0x11ea0f[_0x8ce5('0x33')][_0x8ce5('0x34')]};});_0x2adc21['model']=_[_0x8ce5('0x35')](_0x5ac99b,_0x8ce5('0x2c'));_0x2adc21[_0x8ce5('0x36')]=_['keys'](_0x109c71[_0x8ce5('0x36')]);_0x2adc21[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x2adc21['model'],_0x2adc21[_0x8ce5('0x36')]);_0x478a2c[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x2adc21[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x109c71[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x478a2c['attributes']=_0x478a2c[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x478a2c[_0x8ce5('0x39')]:_0x2adc21[_0x8ce5('0x3a')];if(!_0x109c71['query'][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x478a2c['limit']=qs[_0x8ce5('0x23')](_0x109c71['query'][_0x8ce5('0x23')]);_0x478a2c[_0x8ce5('0x21')]=qs['offset'](_0x109c71['query'][_0x8ce5('0x21')]);}_0x478a2c['order']=qs[_0x8ce5('0x3f')](_0x109c71[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x478a2c[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_['pick'](_0x109c71[_0x8ce5('0x36')],_0x2adc21['filters']),_0x5ac99b);if(_0x109c71['query'][_0x8ce5('0x41')]){_0x478a2c[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x478a2c[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x5ac99b,function(_0x1c5a78){if(_0x1c5a78[_0x8ce5('0x33')]!==_0x8ce5('0x43')){var _0xd9329f={};_0xd9329f[_0x1c5a78[_0x8ce5('0x2c')]]={'$like':'%'+_0x109c71[_0x8ce5('0x36')]['filter']+'%'};return _0xd9329f;}})});}_0x478a2c=_[_0x8ce5('0x42')]({},_0x478a2c,_0x109c71['options']);var _0x696e19={'where':_0x478a2c['where']};return db[_0x8ce5('0x30')][_0x8ce5('0x24')](_0x696e19)[_0x8ce5('0x11')](function(_0x25dfa2){_0x39447d[_0x8ce5('0x24')]=_0x25dfa2;if(_0x109c71['query'][_0x8ce5('0x44')]){_0x478a2c[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x30')][_0x8ce5('0x46')](_0x478a2c);})['then'](function(_0x429098){_0x39447d['rows']=_0x429098;return _0x39447d;})[_0x8ce5('0x11')](respondWithFilteredResult(_0x2c4aeb,_0x478a2c))[_0x8ce5('0x1c')](handleError(_0x2c4aeb,null));};exports[_0x8ce5('0x47')]=function(_0x58289f,_0x532e33){var _0x11c839={'raw':![],'where':{'id':_0x58289f[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]},_0x216363={};_0x216363[_0x8ce5('0x3a')]=_['keys'](db['ChatWebsite'][_0x8ce5('0x31')]);_0x216363['query']=_[_0x8ce5('0x49')](_0x58289f[_0x8ce5('0x36')]);_0x216363[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x216363[_0x8ce5('0x3a')],_0x216363[_0x8ce5('0x36')]);_0x11c839['attributes']=_[_0x8ce5('0x38')](_0x216363[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x58289f[_0x8ce5('0x36')]['fields']));_0x11c839[_0x8ce5('0x39')]=_0x11c839['attributes'][_0x8ce5('0x3c')]?_0x11c839['attributes']:_0x216363[_0x8ce5('0x3a')];if(_0x58289f[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x11c839[_0x8ce5('0x45')]=[{'all':!![]}];}_0x11c839=_['merge']({},_0x11c839,_0x58289f[_0x8ce5('0x4a')]);return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x11c839)[_0x8ce5('0x11')](handleEntityNotFound(_0x532e33,null))[_0x8ce5('0x11')](respondWithResult(_0x532e33,null))['catch'](handleError(_0x532e33,null));};exports['create']=function(_0x3824bb,_0x2595f4){return db['ChatWebsite'][_0x8ce5('0x4c')](_0x3824bb[_0x8ce5('0x4d')],{})['then'](function(_0xd9e4f5){var _0x77ae6b=_0x3824bb[_0x8ce5('0x4e')][_0x8ce5('0x29')]({'plain':!![]});if(!_0x77ae6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x77ae6b[_0x8ce5('0x4f')]===_0x8ce5('0x4e')){var _0x542ddd=_0xd9e4f5[_0x8ce5('0x29')]({'plain':!![]});var _0x44dabf=_0x8ce5('0x50');return db[_0x8ce5('0x51')][_0x8ce5('0x4b')]({'where':{'name':_0x44dabf,'userProfileId':_0x77ae6b['userProfileId']},'raw':!![]})[_0x8ce5('0x11')](function(_0x3dc0c1){if(_0x3dc0c1&&_0x3dc0c1[_0x8ce5('0x52')]===0x0){return db[_0x8ce5('0x2a')][_0x8ce5('0x4c')]({'name':_0x542ddd[_0x8ce5('0x2c')],'resourceId':_0x542ddd['id'],'type':_0x3dc0c1[_0x8ce5('0x2c')],'sectionId':_0x3dc0c1['id']},{})[_0x8ce5('0x11')](function(){return _0xd9e4f5;});}else{return _0xd9e4f5;}})[_0x8ce5('0x1c')](function(_0x4c914c){logger[_0x8ce5('0x17')](_0x8ce5('0x53'),_0x4c914c);throw _0x4c914c;});}return _0xd9e4f5;})[_0x8ce5('0x11')](respondWithResult(_0x2595f4,0xc9))[_0x8ce5('0x1c')](handleError(_0x2595f4,null));};exports[_0x8ce5('0x27')]=function(_0x2247c9,_0x35c780){if(_0x2247c9['body']['id']){delete _0x2247c9['body']['id'];}return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x2247c9[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]})[_0x8ce5('0x11')](handleEntityNotFound(_0x35c780,null))[_0x8ce5('0x11')](saveUpdates(_0x2247c9['body'],null))[_0x8ce5('0x11')](respondWithResult(_0x35c780,null))[_0x8ce5('0x1c')](handleError(_0x35c780,null));};exports['destroy']=function(_0x50d3e7,_0x3690f2){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x50d3e7[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x3690f2,null))['then'](removeEntity(_0x3690f2,null))[_0x8ce5('0x1c')](handleError(_0x3690f2,null));};exports[_0x8ce5('0x54')]=function(_0x484fa7,_0x42b4bd){return db[_0x8ce5('0x30')][_0x8ce5('0x54')]()['then'](respondWithResult(_0x42b4bd,null))['catch'](handleError(_0x42b4bd,null));};exports[_0x8ce5('0x55')]=function(_0x43ec3f,_0x57e226){if(_0x43ec3f['body']['id']){delete _0x43ec3f['body']['id'];}return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x43ec3f[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x57e226,null))[_0x8ce5('0x11')](function(_0x265dc5){if(_0x265dc5){_0x43ec3f[_0x8ce5('0x4d')]['ChatWebsiteId']=_0x265dc5['id'];return db[_0x8ce5('0x56')][_0x8ce5('0x4c')](_0x43ec3f[_0x8ce5('0x4d')]);}})[_0x8ce5('0x11')](respondWithResult(_0x57e226,null))[_0x8ce5('0x1c')](handleError(_0x57e226,null));};exports[_0x8ce5('0x57')]=function(_0x15fbbf,_0x26875c){var _0x418509={'raw':![],'where':{}};var _0x6b0713={};var _0x39873e={'count':0x0,'rows':[]};return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x15fbbf['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x26875c,null))[_0x8ce5('0x11')](function(_0x23d2e7){if(_0x23d2e7){_0x6b0713[_0x8ce5('0x3a')]=_['keys'](db[_0x8ce5('0x56')][_0x8ce5('0x31')]);_0x6b0713['query']=_[_0x8ce5('0x49')](_0x15fbbf[_0x8ce5('0x36')]);_0x6b0713[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x6b0713[_0x8ce5('0x3a')],_0x6b0713[_0x8ce5('0x36')]);_0x418509[_0x8ce5('0x39')]=_['intersection'](_0x6b0713['model'],qs[_0x8ce5('0x3b')](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x418509[_0x8ce5('0x39')]=_0x418509[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x418509[_0x8ce5('0x39')]:_0x6b0713[_0x8ce5('0x3a')];if(!_0x15fbbf[_0x8ce5('0x36')]['hasOwnProperty'](_0x8ce5('0x3e'))){_0x418509['limit']=qs[_0x8ce5('0x23')](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x418509[_0x8ce5('0x21')]=qs['offset'](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x21')]);}_0x418509[_0x8ce5('0x59')]=qs['sort'](_0x15fbbf['query'][_0x8ce5('0x3f')]);_0x418509[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x15fbbf[_0x8ce5('0x36')],_0x6b0713[_0x8ce5('0x37')]));_0x418509[_0x8ce5('0x40')]['ChatWebsiteId']=_0x23d2e7['id'];if(_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x418509[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x418509[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x418509[_0x8ce5('0x39')],function(_0x10ba3e){var _0x2c7179={};_0x2c7179[_0x10ba3e]={'$like':'%'+_0x15fbbf[_0x8ce5('0x36')]['filter']+'%'};return _0x2c7179;})});}_0x418509=_[_0x8ce5('0x42')]({},_0x418509,_0x15fbbf['options']);return db['Disposition'][_0x8ce5('0x24')]({'where':_0x418509[_0x8ce5('0x40')]})[_0x8ce5('0x11')](function(_0x22cc8d){_0x39873e[_0x8ce5('0x24')]=_0x22cc8d;if(_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x418509[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x56')][_0x8ce5('0x46')](_0x418509);})[_0x8ce5('0x11')](function(_0xe07d40){_0x39873e[_0x8ce5('0x5b')]=_0xe07d40;return _0x39873e;});}})[_0x8ce5('0x11')](respondWithFilteredResult(_0x26875c,_0x418509))[_0x8ce5('0x1c')](handleError(_0x26875c,null));};exports['removeDispositions']=function(_0x5eea95,_0x28f437){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x5eea95['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x28f437,null))[_0x8ce5('0x11')](function(_0x52f721){if(_0x52f721){return _0x52f721[_0x8ce5('0x5c')](_0x5eea95[_0x8ce5('0x36')][_0x8ce5('0x5d')]);}})[_0x8ce5('0x11')](respondWithStatusCode(_0x28f437,null))['catch'](handleError(_0x28f437,null));};exports[_0x8ce5('0x5e')]=function(_0x4dad8e,_0xd7b9d4){if(_0x4dad8e['body']['id']){delete _0x4dad8e[_0x8ce5('0x4d')]['id'];}return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x4dad8e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xd7b9d4,null))['then'](function(_0x6c98ae){if(_0x6c98ae){_0x4dad8e[_0x8ce5('0x4d')][_0x8ce5('0x5f')]=_0x6c98ae['id'];return db[_0x8ce5('0x60')][_0x8ce5('0x4c')](_0x4dad8e[_0x8ce5('0x4d')]);}})[_0x8ce5('0x11')](respondWithResult(_0xd7b9d4,null))['catch'](handleError(_0xd7b9d4,null));};exports[_0x8ce5('0x61')]=function(_0x25c83b,_0x315afc){var _0x3f234a={'raw':![],'where':{}};var _0x3cb63e={};var _0x11a148={'count':0x0,'rows':[]};return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x25c83b[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x315afc,null))[_0x8ce5('0x11')](function(_0x1cbfaa){if(_0x1cbfaa){_0x3cb63e[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db['CannedAnswer'][_0x8ce5('0x31')]);_0x3cb63e[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x25c83b[_0x8ce5('0x36')]);_0x3cb63e[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x3cb63e[_0x8ce5('0x3a')],_0x3cb63e['query']);_0x3f234a['attributes']=_[_0x8ce5('0x38')](_0x3cb63e[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x25c83b['query']['fields']));_0x3f234a[_0x8ce5('0x39')]=_0x3f234a['attributes'][_0x8ce5('0x3c')]?_0x3f234a[_0x8ce5('0x39')]:_0x3cb63e[_0x8ce5('0x3a')];if(!_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x3f234a[_0x8ce5('0x23')]=qs['limit'](_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x3f234a[_0x8ce5('0x21')]=qs['offset'](_0x25c83b[_0x8ce5('0x36')]['offset']);}_0x3f234a['order']=qs[_0x8ce5('0x3f')](_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x3f234a[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x25c83b[_0x8ce5('0x36')],_0x3cb63e['filters']));_0x3f234a[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x1cbfaa['id'];if(_0x25c83b['query']['filter']){_0x3f234a[_0x8ce5('0x40')]=_['merge'](_0x3f234a[_0x8ce5('0x40')],{'$or':_['map'](_0x3f234a['attributes'],function(_0x4ef60e){var _0xeb7e80={};_0xeb7e80[_0x4ef60e]={'$like':'%'+_0x25c83b[_0x8ce5('0x36')]['filter']+'%'};return _0xeb7e80;})});}_0x3f234a=_[_0x8ce5('0x42')]({},_0x3f234a,_0x25c83b[_0x8ce5('0x4a')]);return db[_0x8ce5('0x60')][_0x8ce5('0x24')]({'where':_0x3f234a['where']})[_0x8ce5('0x11')](function(_0x590191){_0x11a148[_0x8ce5('0x24')]=_0x590191;if(_0x25c83b['query'][_0x8ce5('0x44')]){_0x3f234a[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x60')]['findAll'](_0x3f234a);})['then'](function(_0x2ab6a0){_0x11a148[_0x8ce5('0x5b')]=_0x2ab6a0;return _0x11a148;});}})[_0x8ce5('0x11')](respondWithFilteredResult(_0x315afc,_0x3f234a))[_0x8ce5('0x1c')](handleError(_0x315afc,null));};exports[_0x8ce5('0x62')]=function(_0x58fd6e,_0x16536b){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x58fd6e[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x16536b,null))[_0x8ce5('0x11')](function(_0x54d27e){if(_0x54d27e){return _0x54d27e[_0x8ce5('0x62')](_0x58fd6e['query']['ids']);}})[_0x8ce5('0x11')](respondWithStatusCode(_0x16536b,null))[_0x8ce5('0x1c')](handleError(_0x16536b,null));};exports[_0x8ce5('0x63')]=function(_0x427cf9,_0x2a04ef){_0x427cf9['body']['sitepic']=_0x427cf9[_0x8ce5('0x64')]['filename'];return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x427cf9[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a04ef,null))[_0x8ce5('0x11')](saveUpdates(_0x427cf9[_0x8ce5('0x4d')],null))[_0x8ce5('0x11')](respondWithResult(_0x2a04ef,null))[_0x8ce5('0x1c')](handleError(_0x2a04ef,null));};exports['addAvatar']=function(_0x30a858,_0x438a49){_0x30a858[_0x8ce5('0x4d')][_0x8ce5('0x65')]=_0x30a858[_0x8ce5('0x64')][_0x8ce5('0x66')];return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x30a858[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x438a49,null))[_0x8ce5('0x11')](saveUpdates(_0x30a858[_0x8ce5('0x4d')],null))['then'](respondWithResult(_0x438a49,null))[_0x8ce5('0x1c')](handleError(_0x438a49,null));};exports[_0x8ce5('0x67')]=function(_0x1fb2ff,_0x10918a){_0x1fb2ff[_0x8ce5('0x4d')]['customerAvatar']=_0x1fb2ff[_0x8ce5('0x64')][_0x8ce5('0x66')];return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x1fb2ff[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x10918a,null))[_0x8ce5('0x11')](saveUpdates(_0x1fb2ff['body'],null))['then'](respondWithResult(_0x10918a,null))['catch'](handleError(_0x10918a,null));};exports['addSystemAvatar']=function(_0x4f5ec3,_0x21b225){_0x4f5ec3['body']['systemAvatar']=_0x4f5ec3[_0x8ce5('0x64')]['filename'];return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x4f5ec3[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x21b225,null))[_0x8ce5('0x11')](saveUpdates(_0x4f5ec3['body'],null))[_0x8ce5('0x11')](respondWithResult(_0x21b225,null))[_0x8ce5('0x1c')](handleError(_0x21b225,null));};exports[_0x8ce5('0x68')]=function(_0x17e796,_0xe88aab){var _0x1d34c7=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x6b'));var _0xd63bd3={'where':{'id':_0x17e796[_0x8ce5('0x48')]['id']},'attributes':['id',_0x8ce5('0x6c')],'raw':!![]};var _0x407867=![];return require('../../config/license/util')['getLicense']()[_0x8ce5('0x11')](function(_0x4f4621){if(_0x4f4621){_0x407867=_0x4f4621[_0x8ce5('0x6d')];}})[_0x8ce5('0x11')](function(){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0xd63bd3);})['then'](handleEntityNotFound(_0xe88aab,null))[_0x8ce5('0x11')](function(_0x7a6a81){if(_0x7a6a81){if(!_[_0x8ce5('0x6e')](_0x7a6a81[_0x8ce5('0x6c')])){if(fs['existsSync'](path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/logos/',_0x7a6a81[_0x8ce5('0x6c')]))&&_0x407867){_0x1d34c7=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/logos/',_0x7a6a81[_0x8ce5('0x6c')]);}}return _0xe88aab['download'](_0x1d34c7);}})['catch'](handleError(_0xe88aab,null));};exports[_0x8ce5('0x6f')]=function(_0x3128d5,_0x206c46){var _0x46370d=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x2e4a0a={'where':{'id':_0x3128d5[_0x8ce5('0x48')]['id']},'attributes':['id',_0x8ce5('0x65')],'raw':!![]};return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x2e4a0a)[_0x8ce5('0x11')](handleEntityNotFound(_0x206c46,null))[_0x8ce5('0x11')](function(_0x426fd2){if(_0x426fd2){if(!_[_0x8ce5('0x6e')](_0x426fd2[_0x8ce5('0x65')])){if(fs[_0x8ce5('0x70')](path[_0x8ce5('0x69')](config['root'],_0x8ce5('0x71'),_0x426fd2[_0x8ce5('0x65')]))){_0x46370d=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x426fd2['agentAvatar']);}}return _0x206c46[_0x8ce5('0x72')](_0x46370d);}})['catch'](handleError(_0x206c46,null));};exports[_0x8ce5('0x73')]=function(_0x457b77,_0x1c1fbc){var _0x558d1=path['join'](config['root'],_0x8ce5('0x74'));var _0x23f84b={'where':{'id':_0x457b77['params']['id']},'attributes':['id',_0x8ce5('0x75'),_0x8ce5('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0x23f84b)[_0x8ce5('0x11')](handleEntityNotFound(_0x1c1fbc,null))[_0x8ce5('0x11')](function(_0x3003ce){if(_0x3003ce){if(!_[_0x8ce5('0x6e')](_0x3003ce['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3003ce[_0x8ce5('0x75')]))&&_0x3003ce[_0x8ce5('0x76')]){_0x558d1=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3003ce[_0x8ce5('0x75')]);}}return _0x1c1fbc['download'](_0x558d1);}})[_0x8ce5('0x1c')](handleError(_0x1c1fbc,null));};exports[_0x8ce5('0x77')]=function(_0x2baec1,_0x161008){var _0x4afd64=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x78'));var _0x947248={'where':{'id':_0x2baec1['params']['id']},'attributes':['id',_0x8ce5('0x79')],'raw':!![]};return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x947248)['then'](handleEntityNotFound(_0x161008,null))['then'](function(_0x3d9399){if(_0x3d9399){if(!_['isNil'](_0x3d9399[_0x8ce5('0x79')])){if(fs[_0x8ce5('0x70')](path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3d9399['systemAvatar']))){_0x4afd64=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3d9399[_0x8ce5('0x79')]);}}return _0x161008['download'](_0x4afd64);}})[_0x8ce5('0x1c')](handleError(_0x161008,null));};exports[_0x8ce5('0x7a')]=function(_0x86bb70,_0x4b3354){var _0x78c4af=require(_0x8ce5('0x7b'));var _0x319d89=new _0x78c4af();var _0x2d6986=_0x319d89['setUA'](_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x7d')])[_0x8ce5('0x7e')]();var _0xac2738={'body':_0x86bb70[_0x8ce5('0x4d')],'channel':'chat'};var _0xf08172=[];var _0x4bf4b4=[];var _0x2e1fe7={};var _0x2f7bec=![];return db[_0x8ce5('0x7f')]['describe']()['then'](function(_0x1b90b6){if(!_0x1b90b6){throw new db[(_0x8ce5('0x80'))]['ValidationError']('no\x20available\x20attributes');}_0xf08172=_['difference'](_['keys'](_0x1b90b6),[_0x8ce5('0x81'),_0x8ce5('0x82')]);_0x4bf4b4=_['difference'](_[_0x8ce5('0x49')](_0x1b90b6),[_0x8ce5('0x81'),_0x8ce5('0x82'),_0x8ce5('0x83'),_0x8ce5('0x84')]);if(_0x86bb70[_0x8ce5('0x4d')]['id']){delete _0x86bb70[_0x8ce5('0x4d')]['id'];}if(_[_0x8ce5('0x6e')](_0x86bb70['body'][_0x8ce5('0x85')])){throw new db[(_0x8ce5('0x80'))]['ValidationError'](_0x8ce5('0x86'));}if(_[_0x8ce5('0x6e')](_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x4d')])||_0x86bb70['body']['body']===''){throw new db['Sequelize'][(_0x8ce5('0x87'))](_0x8ce5('0x88'));}if(_[_0x8ce5('0x6e')](_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x89')])){throw new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0x8a')+_0x4bf4b4);}if(!_[_0x8ce5('0x8b')](_0x4bf4b4,_0x86bb70['body'][_0x8ce5('0x89')])){throw new db[(_0x8ce5('0x80'))]['ValidationError'](_0x8ce5('0x8c')+_0x4bf4b4);}_0x2e1fe7[_0x86bb70[_0x8ce5('0x4d')]['mapKey']]=_0x86bb70['body']['from'];})['then'](function(){return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x86bb70['params']['id']},'include':[{'model':db[_0x8ce5('0x8d')],'as':'List','include':[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0x8e'),'where':_0x2e1fe7,'limit':0x1,'order':[[_0x8ce5('0x82'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x8ce5('0x8f')}]});})['then'](handleEntityNotFound(_0x4b3354,null))[_0x8ce5('0x11')](function(_0x27f4ca){if(_0x27f4ca&&_0x27f4ca[_0x8ce5('0x90')]){_0xac2738['account']=_0x27f4ca;_0xac2738['applications']=_0x27f4ca[_0x8ce5('0x8f')];_0xac2738['list']=_0x27f4ca[_0x8ce5('0x90')];_0xac2738[_0x8ce5('0x91')]=_['orderBy'](_0xac2738['applications'],[_0x8ce5('0x92')],[_0x8ce5('0x93')]);if(_0xac2738[_0x8ce5('0x94')]['Applications']){delete _0xac2738[_0x8ce5('0x94')]['Applications'];}if(_0xac2738[_0x8ce5('0x94')]['List']&&_0xac2738['account']['List'][_0x8ce5('0x8e')][_0x8ce5('0x3c')]){return _0xac2738[_0x8ce5('0x94')][_0x8ce5('0x90')]['Contacts'][0x0];}var _0x5327b1=_[_0x8ce5('0x95')](_0x86bb70[_0x8ce5('0x4d')],{'firstName':_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x85')],'ListId':_0x27f4ca[_0x8ce5('0x84')]});_0x5327b1[_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x89')]]=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x85')];return db[_0x8ce5('0x7f')]['create'](_0x5327b1,{'fields':_0xf08172,'raw':!![]});}})[_0x8ce5('0x11')](handleEntityNotFound(_0x4b3354,null))[_0x8ce5('0x11')](function(_0x4b732d){_0xac2738[_0x8ce5('0x96')]=_0x4b732d;var _0x52d3ae=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x97')];if(_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x98')]){_0x52d3ae=_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x98')];}else if(_0x86bb70[_0x8ce5('0x7c')]['x-forwarded-for']){_0x52d3ae=_[_0x8ce5('0x99')](_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9a')][_0x8ce5('0x9b')](','));}if(_0x4b732d){var _0x1eb502={'ContactId':_0x4b732d['id'],'ChatWebsiteId':_0x86bb70['params']['id'],'from':(_0x4b732d[_0x8ce5('0x9c')]||'')+'\x20'+(_0x4b732d[_0x8ce5('0x9d')]||''),'customerIp':_0x52d3ae,'customerPort':_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9e')]?_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9e')]:null,'referer':_0x86bb70['body']['referer'],'browserName':_0x2d6986['browser'][_0x8ce5('0x2c')]&&_0x2d6986[_0x8ce5('0x9f')]['version']?util[_0x8ce5('0xa0')]('%s\x20%s',_0x2d6986[_0x8ce5('0x9f')][_0x8ce5('0x2c')],_0x2d6986[_0x8ce5('0x9f')][_0x8ce5('0xa1')]):_0x8ce5('0xa2'),'browserVersion':_0x2d6986[_0x8ce5('0x9f')]['version']||'unknown','osName':util[_0x8ce5('0xa0')](_0x8ce5('0xa3'),_0x2d6986['os']['name'],_0x2d6986['os'][_0x8ce5('0xa1')]),'osVersion':_0x2d6986['os']['version'],'deviceModel':_0x2d6986[_0x8ce5('0xa4')]['model']&&_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0xa5')]?util[_0x8ce5('0xa0')](_0x8ce5('0xa6'),_0x2d6986[_0x8ce5('0xa4')]['model'],_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0xa5')],_0x2d6986['device'][_0x8ce5('0x33')]):null,'deviceVendor':_0x2d6986[_0x8ce5('0xa4')]['vendor'],'deviceType':_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0x33')],'formData':JSON[_0x8ce5('0x16')](_0x86bb70[_0x8ce5('0x4d')])};var _0x5ec746={'ChatWebsiteId':_0x86bb70[_0x8ce5('0x48')]['id'],'closed':![]};if(_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xa7')]){_0x5ec746[_0x8ce5('0xa7')]=_0x86bb70[_0x8ce5('0x4d')]['threadId'];return db[_0x8ce5('0xa8')][_0x8ce5('0x4b')]({'where':_0x5ec746})['then'](function(_0xfa51d4){if(_0xfa51d4){return[_0xfa51d4,![]];}_0x1eb502[_0x8ce5('0xa7')]=_0x86bb70['body']['threadId'];_0x1eb502[_0x8ce5('0xa9')]=_0x86bb70[_0x8ce5('0x4d')]['externalUrl'];return db[_0x8ce5('0xa8')][_0x8ce5('0x4c')](_0x1eb502)['then'](function(_0xdc768a){return[_0xdc768a,!![]];});});}_0x5ec746[_0x8ce5('0xaa')]=_0x4b732d['id'];if(_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]&&_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]['id']){_0x5ec746['id']=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]['id'];return db['ChatInteraction'][_0x8ce5('0x4b')]({'where':_0x5ec746})[_0x8ce5('0x11')](function(_0x37f96b){if(_0x37f96b){return[_0x37f96b,![]];}return db['ChatInteraction'][_0x8ce5('0x4c')](_0x1eb502)['then'](function(_0x355d15){return[_0x355d15,!![]];});});}return db[_0x8ce5('0xa8')][_0x8ce5('0x4c')](_0x1eb502)[_0x8ce5('0x11')](function(_0xcca985){return[_0xcca985,!![]];});}})[_0x8ce5('0xac')](function(_0x5e7340,_0xb4b30){if(_0x5e7340){_0x2f7bec=_0xb4b30;if(!_0xb4b30){var _0x194841={'from':(_0xac2738[_0x8ce5('0x96')][_0x8ce5('0x9c')]||'')+'\x20'+(_0xac2738[_0x8ce5('0x96')][_0x8ce5('0x9d')]||'')};if(_0x86bb70[_0x8ce5('0x4d')]['threadId']&&_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xad')]&&_0x86bb70[_0x8ce5('0x4d')]['threadId']!=_0x86bb70['body']['messageId']){_0x194841[_0x8ce5('0xa7')]=_0x86bb70['body'][_0x8ce5('0xad')];}return _0x5e7340[_0x8ce5('0x27')](_0x194841);}else{return _0x5e7340;}}})['then'](function(_0x3d819a){_0xac2738['interaction']=_0x3d819a[_0x8ce5('0x29')]({'plain':!![]});_0xac2738[_0x8ce5('0xab')][_0x8ce5('0xae')]=_0x2f7bec;if(_0xac2738[_0x8ce5('0xab')]['created']){if(_0xac2738['account'][_0x8ce5('0xaf')]){_0xac2738[_0x8ce5('0x91')][_0x8ce5('0xb0')]({'id':0x0,'priority':_0xac2738['applications'][_0x8ce5('0x3c')]+0x1,'app':_0x8ce5('0xb1'),'appdata':_0x8ce5('0xb2'),'interval':_0x8ce5('0xb3')});}}return db[_0x8ce5('0xb4')][_0x8ce5('0x4c')]({'body':_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x4d')],'ChatWebsiteId':_0x86bb70[_0x8ce5('0x48')]['id'],'ChatInteractionId':_0x3d819a['id'],'direction':'in','ContactId':_0xac2738[_0x8ce5('0x96')]['id'],'AttachmentId':_0x86bb70[_0x8ce5('0x4d')]['AttachmentId']});})['then'](function(_0x1488ac){_0xac2738['message']=_0x1488ac;if(_0xac2738['interaction'][_0x8ce5('0xb5')]){return db['User'][_0x8ce5('0x4b')]({'attributes':['id',_0x8ce5('0x2c')],'where':{'id':_0xac2738[_0x8ce5('0xab')][_0x8ce5('0xb5')]}})['then'](function(_0x547f41){if(_0x547f41){_0xac2738['applications'][_0x8ce5('0xb6')]({'id':0x0,'priority':0x0,'app':_0x8ce5('0xb7'),'appdata':_0x547f41[_0x8ce5('0x2c')]+','+(_0xac2738[_0x8ce5('0x94')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xac2738[_0x8ce5('0xb8')]=!![];}return respondWithRpcPromise(_0x8ce5('0xb9'),_0x8ce5('0xba'),_0xac2738);});}return respondWithRpcPromise(_0x8ce5('0xb9'),'startRouting',_0xac2738);})[_0x8ce5('0x11')](function(_0x24375e){respondWithRpcPromise(_0x8ce5('0xbb'),'EventManager',{'event':'notify','message':_0x24375e},client9002);return _0x24375e;})[_0x8ce5('0x11')](respondWithResult(_0x4b3354,null))[_0x8ce5('0x1c')](handleError(_0x4b3354,null));};exports[_0x8ce5('0xbc')]=function(_0xb13982,_0x483c05){var _0x176695,_0x1a8baa,_0x40071e;var _0x3a925e=[];var _0x253594={};var _0x176f95=_0xb13982[_0x8ce5('0xbd')]||[];var _0x4657e7=[];var _0x74ad30;return db[_0x8ce5('0x7f')]['describe']()['then'](function(_0x5ba893){if(!_0x5ba893){throw new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0xbe'));}_0x3a925e=_[_0x8ce5('0xbf')](_[_0x8ce5('0x49')](_0x5ba893),['createdAt','updatedAt',_0x8ce5('0x83'),_0x8ce5('0x84')]);if(_0xb13982[_0x8ce5('0x4d')]['id']){delete _0xb13982['body']['id'];}if(_['isNil'](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0x86')));}if(_['isNil'](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x4d')])||_0xb13982[_0x8ce5('0x4d')]['body']===''){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db['Sequelize'][(_0x8ce5('0x87'))](_0x8ce5('0x88')));}if(_[_0x8ce5('0x6e')](_0xb13982[_0x8ce5('0x4d')]['mapKeyOffline'])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db['Sequelize']['ValidationError'](_0x8ce5('0xc0')+_0x3a925e));}if(!_[_0x8ce5('0x8b')](_0x3a925e,_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0xc1')])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)['send'](new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a925e));}_0x253594[_0xb13982[_0x8ce5('0x4d')]['mapKeyOffline']]=_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')];})[_0x8ce5('0x11')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xb13982[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x8d')],'as':_0x8ce5('0x90')},{'model':db[_0x8ce5('0xc2')],'as':_0x8ce5('0xc2')}]});})[_0x8ce5('0x11')](handleEntityNotFound(_0x483c05,null))[_0x8ce5('0x11')](function(_0x236519){if(_0x236519&&_0x236519[_0x8ce5('0x90')]){_0x1a8baa=_0x236519;var _0x499fd6=_[_0x8ce5('0x95')](_0xb13982[_0x8ce5('0x4d')],{'firstName':_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')],'phone':_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')],'ListId':_0x236519[_0x8ce5('0x84')]});_0x499fd6[_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0xc1')]]=_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')];return db[_0x8ce5('0x7f')][_0x8ce5('0xc3')]({'where':_0x253594,'defaults':_0x499fd6});}})[_0x8ce5('0xac')](function(_0x2a142c){if(_0x2a142c){_0x40071e=_0x2a142c;var _0x5799bb=fs[_0x8ce5('0xc4')](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0xc5')),_0x8ce5('0xc6'));var _0x33de36=ejs[_0x8ce5('0xc7')](_0x5799bb,{'body':_[_0x8ce5('0xc8')](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x4d')]),'bodyTitle':_0x1a8baa[_0x8ce5('0xc9')]});return db[_0x8ce5('0xca')]['create']({'body':_0x33de36,'ContactId':_0x2a142c['id'],'ChatWebsiteId':_0x1a8baa['id']});}})[_0x8ce5('0x11')](function(_0x155ac6){_0x74ad30=_0x155ac6;if(_0x176f95[_0x8ce5('0x3c')]){var _0x32bc2c=_0x176f95[_0x8ce5('0x35')](function(_0x544291){return{'name':_0x544291[_0x8ce5('0xcb')],'basename':_0x544291['filename'],'type':_0x544291[_0x8ce5('0xcc')],'ChatOfflineMessageId':_0x155ac6['id']};});_0x4657e7=_0x32bc2c[_0x8ce5('0x35')](_0x512e48=>{var _0x319ab3={'filename':_0x512e48[_0x8ce5('0x2c')],'path':path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0xcd'),_0x8ce5('0xbd'),_0x8ce5('0xce'),_0x8ce5('0xcf'),_0x512e48[_0x8ce5('0xd0')])};return _0x319ab3;});if(!_0x1a8baa[_0x8ce5('0xd1')]){return db[_0x8ce5('0xd2')][_0x8ce5('0xd3')](function(_0x586254){return db[_0x8ce5('0xd4')][_0x8ce5('0xd5')](_0x32bc2c,{'transaction':_0x586254});});}}})['then'](function(){if(_0x74ad30){_0x176695=_0x74ad30;return db[_0x8ce5('0xc2')][_0x8ce5('0x58')]({'where':{'active':!![]},'include':[{'model':db[_0x8ce5('0xd6')],'as':_0x8ce5('0xd7'),'raw':!![]}]});}})[_0x8ce5('0x11')](function(_0xc1eeb2){if(_0xc1eeb2&&_0xc1eeb2[_0x8ce5('0xd7')]&&_0x1a8baa[_0x8ce5('0xd8')]&&_0x1a8baa[_0x8ce5('0xd9')]){var _0x296e8f={'tls':{'rejectUnauthorized':![]}};if(_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xda')]){_0x296e8f[_0x8ce5('0xda')]=_0xc1eeb2[_0x8ce5('0xd7')]['service'];}else{_0x296e8f['host']=_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdb')];_0x296e8f[_0x8ce5('0xdc')]=_0xc1eeb2[_0x8ce5('0xd7')]['port'];_0x296e8f['secure']=_0xc1eeb2[_0x8ce5('0xd7')]['secure'];}if(_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdd')]){_0x296e8f[_0x8ce5('0xde')]={'user':_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0x4e')],'pass':_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdf')]};}return respondWithRpcPromise(_0x8ce5('0xe0'),_0x8ce5('0xe1'),{'account':_0x296e8f,'message':{'from':util[_0x8ce5('0xa0')](_0x8ce5('0xe2'),_0xc1eeb2[_0x8ce5('0x2c')],_0xc1eeb2[_0x8ce5('0xe3')]||_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0x4e')]),'to':_0x1a8baa[_0x8ce5('0xd9')],'subject':_0x1a8baa['offlineMessageSubject'],'html':_0x176695[_0x8ce5('0x4d')],'attachments':_0x4657e7}},client9003)[_0x8ce5('0x11')](function(){return _0x176695;})[_0x8ce5('0x1c')](function(_0x16bf44){console[_0x8ce5('0x17')](_0x16bf44);});}})[_0x8ce5('0x11')](function(){if(_0x1a8baa&&_0x1a8baa['openNewInteraction']&&_0x1a8baa['MailAccountId']){var _0x26ae16=[];if(_0x176f95[_0x8ce5('0x3c')]){_0x26ae16=_0x176f95['map'](function(_0x6c263c){return{'name':_0x6c263c[_0x8ce5('0xcb')],'basename':_0x6c263c['filename'],'type':_0x6c263c[_0x8ce5('0xcc')],'ChatOfflineMessageId':_0x74ad30['id']};});}var _0xb4a65d;if(!_[_0x8ce5('0x6e')](_0x1a8baa['subjectOffline'])){var _0x9f7d84=_[_0x8ce5('0x35')](_0xb13982['body'],function(_0x446e2e){return _0x446e2e;});var _0x2e536c=_['toPairsIn'](_0x9f7d84)[0x0];var _0x17b7e6=_['mapValues'](_0x2e536c,function(_0x436e25){return _0x436e25;});_0xb4a65d=_0x17b7e6[0x1][_0x1a8baa[_0x8ce5('0xe4')]];}var _0x5bf15b={'from':_0x40071e[_0x8ce5('0xe3')],'firstName':_0x40071e[_0x8ce5('0x9c')],'lastName':_0x40071e['lastName'],'mapKey':_0x8ce5('0xe3'),'message':{'from':_0x40071e['email'],'to':_0x1a8baa[_0x8ce5('0xc2')][_0x8ce5('0xe3')],'cc':'','subject':_[_0x8ce5('0x6e')](_0xb4a65d)?_0x1a8baa['offlineMessageSubject']:_0xb4a65d,'messageId':'','sentAt':new Date(),'attach':_0x26ae16['length'],'attachments':_0x26ae16,'originChannel':_0x8ce5('0xe5'),'ChatWebsiteId':_0x1a8baa['id'],'ChatOfflineMessageId':_0x176695['id'],'originTo':_0x1a8baa[_0x8ce5('0xc2')][_0x8ce5('0xe3')]},'body':_0x176695[_0x8ce5('0x4d')]};var _0x20a41d={'account':{'id':_0x1a8baa['MailAccountId']},'body':_0x5bf15b,'log':_0x8ce5('0xe6')};return respondWithRpcPromise(_0x8ce5('0xe6'),_0x8ce5('0xe7'),_0x20a41d,client9001)['then'](function(){return _0x176695;})['catch'](function(_0x350501){console[_0x8ce5('0x17')](_0x350501);});}return;})['then'](function(){if(_0x176695){return _0x176695;}})[_0x8ce5('0x11')](respondWithResult(_0x483c05,null))[_0x8ce5('0x1c')](function(_0x1a52c0){console[_0x8ce5('0x17')](_0x8ce5('0x1c'),_0x1a52c0);for(var _0x2841a1 of _0x176f95){var _0x146a52=path[_0x8ce5('0x69')](config['root'],'server',_0x8ce5('0xbd'),_0x8ce5('0xce'),_0x8ce5('0xcf'),_0x2841a1[_0x8ce5('0x66')]);fs_extra[_0x8ce5('0xe8')](_0x146a52)[_0x8ce5('0x1c')](function(_0x70d81d){console[_0x8ce5('0x17')](_0x8ce5('0xe9'),_0x146a52,_0x70d81d);});}});};exports[_0x8ce5('0xea')]=function(_0x517ea0,_0x209565){return db[_0x8ce5('0xa8')][_0x8ce5('0x4b')]({'where':{'id':_0x517ea0[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x209565,null))[_0x8ce5('0x11')](function(_0x4d8831){if(_0x4d8831){return _0x4d8831[_0x8ce5('0xea')](_0x517ea0[_0x8ce5('0x4d')]['ids'],_[_0x8ce5('0xeb')](_0x517ea0[_0x8ce5('0x4d')],[_0x8ce5('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x209565,null))['catch'](handleError(_0x209565,null));};exports[_0x8ce5('0xec')]=function(_0x1776c9,_0x54dfb2){var _0x5adf25={'raw':![],'where':{}};var _0x25489f={};var _0x2e3be4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x1776c9[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x54dfb2,null))['then'](function(_0x10748a){if(_0x10748a){_0x25489f[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db[_0x8ce5('0xa8')][_0x8ce5('0x31')]);_0x25489f[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x1776c9['query']);_0x25489f[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x25489f['model'],_0x25489f[_0x8ce5('0x36')]);_0x5adf25[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x25489f['model'],qs[_0x8ce5('0x3b')](_0x1776c9['query'][_0x8ce5('0x3b')]));_0x5adf25['attributes']=_0x5adf25['attributes'][_0x8ce5('0x3c')]?_0x5adf25[_0x8ce5('0x39')]:_0x25489f['model'];if(!_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x5adf25[_0x8ce5('0x23')]=qs[_0x8ce5('0x23')](_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x5adf25[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x1776c9[_0x8ce5('0x36')]['offset']);}_0x5adf25[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x1776c9[_0x8ce5('0x36')]['sort']);_0x5adf25['where']=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x1776c9[_0x8ce5('0x36')],_0x25489f['filters']));_0x5adf25[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x10748a['id'];if(_0x1776c9[_0x8ce5('0x36')]['filter']){_0x5adf25[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x5adf25[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x5adf25[_0x8ce5('0x39')],function(_0x3e286a){var _0x118d81={};_0x118d81[_0x3e286a]={'$like':'%'+_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x118d81;})});}_0x5adf25=_[_0x8ce5('0x42')]({},_0x5adf25,_0x1776c9['options']);return db['ChatInteraction'][_0x8ce5('0x24')]({'where':_0x5adf25[_0x8ce5('0x40')]})['then'](function(_0x56cb08){_0x2e3be4[_0x8ce5('0x24')]=_0x56cb08;if(_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x5adf25['include']=[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0xed'),'required':![]},{'model':db[_0x8ce5('0xee')],'as':'Owner','attributes':['name',_0x8ce5('0xef'),_0x8ce5('0xf0')],'required':![]},{'model':db[_0x8ce5('0xf1')],'as':_0x8ce5('0xf2'),'attributes':['id',_0x8ce5('0x2c'),_0x8ce5('0xf3')],'where':_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0xf4')]?{'id':_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0xf4')]}:undefined,'required':_0x1776c9['query'][_0x8ce5('0xf4')]?!![]:![]}];}return db[_0x8ce5('0xa8')][_0x8ce5('0x46')](_0x5adf25);})['then'](function(_0x3447bd){_0x2e3be4[_0x8ce5('0x5b')]=_0x3447bd;return _0x2e3be4;});}})['then'](respondWithFilteredResult(_0x54dfb2,_0x5adf25))[_0x8ce5('0x1c')](handleError(_0x54dfb2,null));};function iftimePromise(_0x2e9492,_0x4f01a8){return respondWithRpcPromise(_0x8ce5('0xf5'),'getSnippet',{'command':_0x4f01a8['timezone']?util[_0x8ce5('0xa0')](_0x8ce5('0xf6'),_0x2e9492[_0x8ce5('0xf7')],_0x4f01a8[_0x8ce5('0xf8')]):util[_0x8ce5('0xa0')](_0x8ce5('0xf9'),_0x2e9492[_0x8ce5('0xf7')])},client9002)[_0x8ce5('0x11')](function(_0x10b562){var _0x5b7d45=_0x10b562&&_0x10b562[_0x8ce5('0xfa')]('true')>=0x0?!![]:![];logger[_0x8ce5('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4f01a8['id'],_0x2e9492['id'],_0x2e9492['interval'],_0x5b7d45?_0x8ce5('0xfb'):_0x8ce5('0xfc'),_0x4f01a8[_0x8ce5('0xf8')]?_0x4f01a8['timezone']:_0x8ce5('0xfd'));return _0x5b7d45;})[_0x8ce5('0x1c')](function(_0x340a8a){logger[_0x8ce5('0x17')](_0x8ce5('0xfe'),_0x4f01a8['id'],_0x2e9492['id'],_0x2e9492['interval'],util[_0x8ce5('0xff')](_0x340a8a,{'showHidden':![],'depth':null}),_0x4f01a8[_0x8ce5('0xf8')]?_0x4f01a8[_0x8ce5('0xf8')]:_0x8ce5('0xfd'));return![];});}exports[_0x8ce5('0x100')]=function(_0x146737,_0x2f0aaf){var _0x1b8afa=0x0;var _0x428735=0x0;var _0x33f780=![];var _0x4b439a;var _0x3f54a3;return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x146737[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x101')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x8ce5('0x102'),'attributes':['id',_0x8ce5('0xf7')],'raw':!![]}]}]})[_0x8ce5('0x11')](handleEntityNotFound(_0x2f0aaf,null))['then'](function(_0x35218d){if(_0x35218d){_0x4b439a=_0x35218d;return _0x35218d[_0x8ce5('0x103')]({'raw':!![]});}})['then'](function(_0x412289){if(_0x4b439a){if(_0x412289){_0x3f54a3=_0x412289;}}return require(_0x8ce5('0x104'))[_0x8ce5('0x105')]();})['then'](function(_0x2b166d){if(_0x2b166d){_0x428735=_0x2b166d['virtual'];_0x33f780=_0x2b166d[_0x8ce5('0x6d')];}})[_0x8ce5('0x11')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x509967){_0x1b8afa=_0x509967;if(_0x428735&&_0x509967>_0x428735){return db[_0x8ce5('0x106')]['findOne']({'where':{'id':0x1}})[_0x8ce5('0x11')](function(_0x4739d9){if(_0x4739d9){_0x4739d9['increment']('chatLicenseExceeded');}});}})[_0x8ce5('0x11')](function(){if(_0x4b439a['Interval']&&_0x4b439a['Interval'][_0x8ce5('0x102')]){var _0x22f4be=[];for(var _0x53b785=0x0;_0x53b785<_0x4b439a['Interval'][_0x8ce5('0x102')][_0x8ce5('0x3c')];_0x53b785++){var _0x20427c=_0x4b439a[_0x8ce5('0x101')][_0x8ce5('0x102')][_0x53b785]['get']({'plain':!![]});_0x22f4be[_0x8ce5('0xb0')](iftimePromise(_0x20427c,_0x4b439a));}return BPromise[_0x8ce5('0x107')](_0x22f4be)['then'](function(_0xf0d2ad){return _[_0x8ce5('0x108')](_0xf0d2ad);});}else{return!![];}})[_0x8ce5('0x11')](function(_0x309520){var _0x37511a=fs['readFileSync'](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0x109')),_0x8ce5('0xc6'));var _0x2a33d3={'remote':_0x4b439a[_0x8ce5('0x10a')],'query':querystring['stringify'](_[_0x8ce5('0x42')](_0x4b439a[_0x8ce5('0x29')]({'plain':!![]}),{'customerIp':_0x146737[_0x8ce5('0x7c')]['x-forwarded-for']||_0x146737[_0x8ce5('0x7c')][_0x8ce5('0x10b')]||_0x146737[_0x8ce5('0x10c')]['remoteAddress']||_0x146737['ip'],'referer':_0x146737[_0x8ce5('0x7c')][_0x8ce5('0x10d')],'openedInteractions':_0x1b8afa,'maxInteractions':_0x428735,'virtual':_0x33f780['virtual'],'online':_0x309520,'custom':_0x33f780}))[_0x8ce5('0x10e')](/'/g,'\x5c\x27')};_0x2f0aaf[_0x8ce5('0x2d')](ejs['render'](Mustache[_0x8ce5('0xc7')](_0x37511a,_0x2a33d3),{'proactiveActions':_0x3f54a3,'alignment':_0x4b439a[_0x8ce5('0x10f')],'verticalAlignment':_0x4b439a[_0x8ce5('0x110')],'div_color':_0x4b439a[_0x8ce5('0xf3')],'labelText':_0x4b439a[_0x8ce5('0x111')],'text_color':_0x4b439a[_0x8ce5('0x112')],'button_color':_0x4b439a[_0x8ce5('0x113')],'background_color':_0x4b439a[_0x8ce5('0x114')]}));})['catch'](handleError(_0x2f0aaf,null));};exports[_0x8ce5('0x115')]=function(_0x2424eb,_0x281850){var _0xfbb735=_0x2424eb[_0x8ce5('0x48')]['id'];var _0x9c7a5e=_0x2424eb[_0x8ce5('0x4d')];var _0x337eef=0xc8;var _0x29d589=null;return db[_0x8ce5('0xd2')][_0x8ce5('0xd3')]({'isolationLevel':db[_0x8ce5('0xd2')][_0x8ce5('0x116')][_0x8ce5('0x117')][_0x8ce5('0x118')]},function(_0x1174e7){return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0xfbb735},'transaction':_0x1174e7})[_0x8ce5('0x11')](function(_0xe43a07){if(_0xe43a07){return db[_0x8ce5('0x119')][_0x8ce5('0x28')]({'where':{'ChatWebsiteId':_0xfbb735},'transaction':_0x1174e7})[_0x8ce5('0x11')](function(){var _0x6fcde6=_[_0x8ce5('0x35')](_0x9c7a5e,function(_0x4ab365){_0x4ab365['ChatWebsiteId']=_0xfbb735;return _0x4ab365;});return db[_0x8ce5('0x119')]['bulkCreate'](_0x6fcde6,{'transaction':_0x1174e7});});}else{_0x337eef=0x194;_0x29d589=[];}});})['then'](function(){if(_0x337eef!==0x194){return db[_0x8ce5('0x119')][_0x8ce5('0x11a')]({'where':{'ChatWebsiteId':_0xfbb735},'order':_0x8ce5('0x92')})['then'](function(_0x2bb26c){_0x29d589=_0x2bb26c;});}})[_0x8ce5('0x1c')](function(_0x4b3ddf){_0x337eef=0x1f4;logger[_0x8ce5('0x17')](_0x4b3ddf[_0x8ce5('0x2b')]);if(_0x4b3ddf[_0x8ce5('0x2c')]){delete _0x4b3ddf[_0x8ce5('0x2c')];}_0x29d589=_0x4b3ddf;})[_0x8ce5('0x11b')](function(){if(_0x29d589===null){_0x281850[_0x8ce5('0x1d')](_0x337eef);}else{if(_0x337eef===0x1f4){_0x281850[_0x8ce5('0x1f')](_0x337eef)[_0x8ce5('0x2d')](_0x29d589);}else{_0x281850[_0x8ce5('0x1f')](_0x337eef)[_0x8ce5('0x20')](_0x29d589);}}});};exports['getApplications']=function(_0x3fe09e,_0xae4332){var _0x188a7f={};var _0x1c9841={};var _0x47ceef;var _0x4f04a3;return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x3fe09e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xae4332,null))['then'](function(_0x237abd){if(_0x237abd){_0x47ceef=_0x237abd;_0x1c9841['model']=_[_0x8ce5('0x49')](db[_0x8ce5('0x119')][_0x8ce5('0x31')]);_0x1c9841['query']=_['keys'](_0x3fe09e['query']);_0x1c9841['filters']=_[_0x8ce5('0x38')](_0x1c9841[_0x8ce5('0x3a')],_0x1c9841[_0x8ce5('0x36')]);_0x188a7f[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x1c9841[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x188a7f[_0x8ce5('0x39')]=_0x188a7f[_0x8ce5('0x39')]['length']?_0x188a7f['attributes']:_0x1c9841['model'];_0x188a7f[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x3fe09e['query'][_0x8ce5('0x3f')]);_0x188a7f[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x3fe09e[_0x8ce5('0x36')],_0x1c9841[_0x8ce5('0x37')]));if(_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x188a7f[_0x8ce5('0x40')]=_['merge'](_0x188a7f[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x188a7f[_0x8ce5('0x39')],function(_0x2a3f17){var _0x1b118d={};_0x1b118d[_0x2a3f17]={'$like':'%'+_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x1b118d;})});}_0x188a7f=_[_0x8ce5('0x42')]({},_0x188a7f,_0x3fe09e['options']);return _0x47ceef['getApplications'](_0x188a7f);}})[_0x8ce5('0x11')](function(_0x5398c){if(_0x5398c){_0x4f04a3=_0x5398c['length'];if(!_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x3d')]('nolimit')){_0x188a7f[_0x8ce5('0x23')]=qs[_0x8ce5('0x23')](_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x188a7f['offset']=qs[_0x8ce5('0x21')](_0x3fe09e['query']['offset']);}return _0x47ceef[_0x8ce5('0x11c')](_0x188a7f);}})['then'](function(_0x585a09){if(_0x585a09){return _0x585a09?{'count':_0x4f04a3,'rows':_0x585a09}:null;}})['then'](respondWithResult(_0xae4332,null))[_0x8ce5('0x1c')](handleError(_0xae4332,null));};exports[_0x8ce5('0x11d')]=function(_0x304b41,_0x147357){return db[_0x8ce5('0x11e')]['find']({'where':{'id':_0x304b41[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x147357,null))[_0x8ce5('0x11')](function(_0x3a0700){if(_0x3a0700){return _0x3a0700['addProactiveActions'](_0x304b41[_0x8ce5('0x4d')]['ids'],_['omit'](_0x304b41[_0x8ce5('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x147357,null))[_0x8ce5('0x1c')](handleError(_0x147357,null));};exports[_0x8ce5('0x103')]=function(_0x16a04e,_0x2d285d){var _0x36b574={};var _0x55c7ee={};var _0x689ff5;var _0x4b14a0;return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x16a04e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x2d285d,null))['then'](function(_0x26e4e2){if(_0x26e4e2){_0x689ff5=_0x26e4e2;_0x55c7ee['model']=_['keys'](db['ChatProactiveAction'][_0x8ce5('0x31')]);_0x55c7ee['query']=_['keys'](_0x16a04e[_0x8ce5('0x36')]);_0x55c7ee['filters']=_[_0x8ce5('0x38')](_0x55c7ee[_0x8ce5('0x3a')],_0x55c7ee[_0x8ce5('0x36')]);_0x36b574[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x55c7ee[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x36b574[_0x8ce5('0x39')]=_0x36b574[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x36b574['attributes']:_0x55c7ee[_0x8ce5('0x3a')];_0x36b574[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x16a04e[_0x8ce5('0x36')]['sort']);_0x36b574[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x16a04e[_0x8ce5('0x36')],_0x55c7ee['filters']));if(_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x36b574[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x36b574['where'],{'$or':_['map'](_0x36b574[_0x8ce5('0x39')],function(_0x31725f){var _0x1fb829={};_0x1fb829[_0x31725f]={'$like':'%'+_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x1fb829;})});}_0x36b574=_['merge']({},_0x36b574,_0x16a04e[_0x8ce5('0x4a')]);return _0x689ff5[_0x8ce5('0x103')](_0x36b574);}})[_0x8ce5('0x11')](function(_0x22699c){if(_0x22699c){_0x4b14a0=_0x22699c[_0x8ce5('0x3c')];if(!_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x36b574[_0x8ce5('0x23')]=qs['limit'](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x36b574[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x21')]);}return _0x689ff5[_0x8ce5('0x103')](_0x36b574);}})[_0x8ce5('0x11')](function(_0x21c55f){if(_0x21c55f){return _0x21c55f?{'count':_0x4b14a0,'rows':_0x21c55f}:null;}})[_0x8ce5('0x11')](respondWithResult(_0x2d285d,null))[_0x8ce5('0x1c')](handleError(_0x2d285d,null));};exports['getFields']=function(_0x22980a,_0x2b157f){var _0x163889=_0x22980a[_0x8ce5('0x36')]['online']===_0x8ce5('0x11f')?_0x8ce5('0x120'):'onlineForm';return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'attributes':['id',_0x163889],'where':{'id':_0x22980a['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x2b157f,null))['then'](function(_0x5883c3){if(_0x5883c3){var _0x1d0ead=_0x5883c3[_0x163889];var _0x492782=_0x1d0ead&&_0x1d0ead[_0x8ce5('0x121')]?_0x1d0ead[_0x8ce5('0x121')]:[];_0x2b157f[_0x8ce5('0x2d')]({'fromKey':_[_0x8ce5('0x6e')](_0x1d0ead[_0x8ce5('0x122')])?undefined:_0x1d0ead['fromKey'],'count':_0x492782[_0x8ce5('0x3c')],'rows':_0x492782});}})[_0x8ce5('0x1c')](handleError(_0x2b157f,null));};exports[_0x8ce5('0x123')]=function(_0x5256de,_0xd9c926){var _0x270f00={'raw':![],'where':{}};var _0x146289={};var _0x423df8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x5256de[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xd9c926,null))[_0x8ce5('0x11')](function(_0x372a34){if(_0x372a34){_0x146289[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db[_0x8ce5('0xca')][_0x8ce5('0x31')]);_0x146289[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x5256de[_0x8ce5('0x36')]);_0x146289['filters']=_[_0x8ce5('0x38')](_0x146289['model'],_0x146289['query']);_0x270f00[_0x8ce5('0x39')]=_['intersection'](_0x146289[_0x8ce5('0x3a')],qs['fields'](_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x270f00[_0x8ce5('0x39')]=_0x270f00[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x270f00['attributes']:_0x146289[_0x8ce5('0x3a')];if(!_0x5256de[_0x8ce5('0x36')]['hasOwnProperty'](_0x8ce5('0x3e'))){_0x270f00[_0x8ce5('0x23')]=qs['limit'](_0x5256de['query']['limit']);_0x270f00[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x5256de['query'][_0x8ce5('0x21')]);}_0x270f00[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x270f00[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x5256de['query'],_0x146289[_0x8ce5('0x37')]));_0x270f00[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x372a34['id'];if(_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x270f00[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x270f00['where'],{'$or':_[_0x8ce5('0x35')](_0x270f00[_0x8ce5('0x39')],function(_0x3a3ace){var _0x3b7eb7={};_0x3b7eb7[_0x3a3ace]={'$like':'%'+_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x3b7eb7;})});}_0x270f00=_['merge']({},_0x270f00,_0x5256de[_0x8ce5('0x4a')]);return db[_0x8ce5('0xca')][_0x8ce5('0x24')]({'where':_0x270f00['where']})[_0x8ce5('0x11')](function(_0x195ed8){_0x423df8[_0x8ce5('0x24')]=_0x195ed8;if(_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x270f00[_0x8ce5('0x45')]=[{'all':!![]}];}else{_0x270f00[_0x8ce5('0x45')]=[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0xed'),'required':![]},{'model':db[_0x8ce5('0xd4')],'as':_0x8ce5('0x124'),'required':![]}];}return db[_0x8ce5('0xca')][_0x8ce5('0x46')](_0x270f00);})['then'](function(_0x558958){_0x423df8[_0x8ce5('0x5b')]=_0x558958;return _0x423df8;});}})['then'](respondWithFilteredResult(_0xd9c926,_0x270f00))[_0x8ce5('0x1c')](handleError(_0xd9c926,null));};exports[_0x8ce5('0x125')]=function(_0x4a0393,_0x9cb84){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x4a0393[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x9cb84,null))[_0x8ce5('0x11')](function(_0x41e921){if(_0x41e921){return _0x41e921['addAgents'](_0x4a0393[_0x8ce5('0x4d')][_0x8ce5('0x5d')],_['omit'](_0x4a0393[_0x8ce5('0x4d')],[_0x8ce5('0x5d'),'id'])||{})[_0x8ce5('0xac')](function(_0x25b9d9){for(var _0x514079=0x0;_0x514079<_0x4a0393[_0x8ce5('0x4d')]['ids'][_0x8ce5('0x3c')];_0x514079+=0x1){socket[_0x8ce5('0x126')](_0x8ce5('0x127'),{'UserId':Number(_0x4a0393[_0x8ce5('0x4d')][_0x8ce5('0x5d')][_0x514079]),'ChatWebsiteId':Number(_0x4a0393[_0x8ce5('0x48')]['id'])});}return _0x25b9d9;});}})[_0x8ce5('0x11')](respondWithResult(_0x9cb84,null))['catch'](handleError(_0x9cb84,null));};exports[_0x8ce5('0x128')]=function(_0x2dd111,_0x5bfac0){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x2dd111[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x5bfac0,null))[_0x8ce5('0x11')](function(_0xd96ac7){if(_0xd96ac7){return _0xd96ac7[_0x8ce5('0x128')](_0x2dd111[_0x8ce5('0x36')][_0x8ce5('0x5d')])['then'](function(){if(_['isArray'](_0x2dd111['query'][_0x8ce5('0x5d')])){for(var _0xf1e9d=0x0;_0xf1e9d<_0x2dd111[_0x8ce5('0x36')]['ids'][_0x8ce5('0x3c')];_0xf1e9d+=0x1){socket[_0x8ce5('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x2dd111[_0x8ce5('0x36')]['ids'][_0xf1e9d]),'ChatWebsiteId':Number(_0x2dd111[_0x8ce5('0x48')]['id'])});}}else{socket['emit'](_0x8ce5('0x129'),{'UserId':Number(_0x2dd111[_0x8ce5('0x36')]['ids']),'ChatWebsiteId':Number(_0x2dd111[_0x8ce5('0x48')]['id'])});}});}})[_0x8ce5('0x11')](respondWithStatusCode(_0x5bfac0,null))[_0x8ce5('0x1c')](handleError(_0x5bfac0,null));};exports['getAgents']=function(_0x2d63e7,_0x1ce5e3){var _0x3e6d04={};var _0x50a06f={};var _0x55eaf4;var _0xe6753;return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x2d63e7[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x1ce5e3,null))[_0x8ce5('0x11')](function(_0x54bda2){if(_0x54bda2){_0x55eaf4=_0x54bda2;_0x50a06f[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db['User'][_0x8ce5('0x31')]);_0x50a06f[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x2d63e7[_0x8ce5('0x36')]);_0x50a06f['filters']=_[_0x8ce5('0x38')](_0x50a06f[_0x8ce5('0x3a')],_0x50a06f['query']);_0x3e6d04[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x50a06f[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x2d63e7['query']['fields']));_0x3e6d04['attributes']=_0x3e6d04['attributes'][_0x8ce5('0x3c')]?_0x3e6d04[_0x8ce5('0x39')]:_0x50a06f[_0x8ce5('0x3a')];_0x3e6d04[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x2d63e7[_0x8ce5('0x36')]['sort']);_0x3e6d04[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_['pick'](_0x2d63e7['query'],_0x50a06f[_0x8ce5('0x37')]));if(_0x2d63e7['query'][_0x8ce5('0x41')]){_0x3e6d04[_0x8ce5('0x40')]=_['merge'](_0x3e6d04[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x3e6d04['attributes'],function(_0x59a77f){var _0x4cf9c1={};_0x4cf9c1[_0x59a77f]={'$like':'%'+_0x2d63e7[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x4cf9c1;})});}_0x3e6d04=_['merge']({},_0x3e6d04,_0x2d63e7[_0x8ce5('0x4a')]);return _0x55eaf4[_0x8ce5('0x12a')](_0x3e6d04);}})[_0x8ce5('0x11')](function(_0x573520){if(_0x573520){_0xe6753=_0x573520[_0x8ce5('0x3c')];if(!_0x2d63e7['query'][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x3e6d04['limit']=qs[_0x8ce5('0x23')](_0x2d63e7[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x3e6d04[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x2d63e7[_0x8ce5('0x36')]['offset']);}return _0x55eaf4[_0x8ce5('0x12a')](_0x3e6d04);}})['then'](function(_0x84b31f){if(_0x84b31f){return _0x84b31f?{'count':_0xe6753,'rows':_0x84b31f}:null;}})[_0x8ce5('0x11')](respondWithResult(_0x1ce5e3,null))['catch'](handleError(_0x1ce5e3,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b8a68d9..a7ea573 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 _0xea81=['remove','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x13b9d0,_0x29ba8d){var _0x42c59c=function(_0x4b79b5){while(--_0x4b79b5){_0x13b9d0['push'](_0x13b9d0['shift']());}};_0x42c59c(++_0x29ba8d);}(_0xea81,0x1ed));var _0x1ea8=function(_0x47b3ff,_0x44b244){_0x47b3ff=_0x47b3ff-0x0;var _0x37289d=_0xea81[_0x47b3ff];return _0x37289d;};'use strict';var EventEmitter=require(_0x1ea8('0x0'));var ChatWebsite=require(_0x1ea8('0x1'))['db'][_0x1ea8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1ea8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1ea8('0x4')};function emitEvent(_0x8f20e2){return function(_0x2e6a47,_0x298375,_0x292a48){ChatWebsiteEvents['emit'](_0x8f20e2+':'+_0x2e6a47['id'],_0x2e6a47);ChatWebsiteEvents['emit'](_0x8f20e2,_0x2e6a47);_0x292a48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1ea8('0x5')](e,emitEvent(event));}}module[_0x1ea8('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x56a4=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x1c5275,_0x4bbabd){var _0x3c4297=function(_0x3c3786){while(--_0x3c3786){_0x1c5275['push'](_0x1c5275['shift']());}};_0x3c4297(++_0x4bbabd);}(_0x56a4,0x11b));var _0x456a=function(_0x1f0213,_0x3c3c9e){_0x1f0213=_0x1f0213-0x0;var _0x2048c4=_0x56a4[_0x1f0213];return _0x2048c4;};'use strict';var EventEmitter=require(_0x456a('0x0'));var ChatWebsite=require(_0x456a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x456a('0x2')](0x0);var events={'afterCreate':_0x456a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26a7c6){return function(_0x3a11ee,_0x143999,_0x1c904){ChatWebsiteEvents[_0x456a('0x4')](_0x26a7c6+':'+_0x3a11ee['id'],_0x3a11ee);ChatWebsiteEvents['emit'](_0x26a7c6,_0x3a11ee);_0x1c904(null);};}for(var e in events){if(events[_0x456a('0x5')](e)){var event=events[e];ChatWebsite['hook'](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 5d53c15..da2fa9d 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 _0x4d84=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4d84,0x104));var _0x44d8=function(_0x18849b,_0x530b07){_0x18849b=_0x18849b-0x0;var _0x23b2df=_0x4d84[_0x18849b];return _0x23b2df;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var logger=require(_0x44d8('0x2'))(_0x44d8('0x3'));var moment=require(_0x44d8('0x4'));var BPromise=require(_0x44d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44d8('0x6'));var rimraf=require(_0x44d8('0x7'));var config=require(_0x44d8('0x8'));var attributes=require(_0x44d8('0x9'));module['exports']=function(_0x15fe59,_0x1c67e3){return _0x15fe59[_0x44d8('0xa')]('ChatWebsite',attributes,{'tableName':_0x44d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0781=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','api','moment'];(function(_0x3fa13c,_0x3f108f){var _0x18fae2=function(_0x2ab137){while(--_0x2ab137){_0x3fa13c['push'](_0x3fa13c['shift']());}};_0x18fae2(++_0x3f108f);}(_0x0781,0xa3));var _0x1078=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0781[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1078('0x0'));var moment=require(_0x1078('0x1'));var BPromise=require(_0x1078('0x2'));var rp=require(_0x1078('0x3'));var fs=require('fs');var path=require(_0x1078('0x4'));var rimraf=require(_0x1078('0x5'));var config=require('../../config/environment');var attributes=require(_0x1078('0x6'));module[_0x1078('0x7')]=function(_0x4345f8,_0x1db0e5){return _0x4345f8[_0x1078('0x8')](_0x1078('0x9'),attributes,{'tableName':_0x1078('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 9b995fa..e9037fa 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 _0xd77a=['localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xd77a,0x131));var _0xad77=function(_0xe94020,_0x409805){_0xe94020=_0xe94020-0x0;var _0x4191b5=_0xd77a[_0xe94020];return _0x4191b5;};'use strict';var _=require('lodash');var util=require(_0xad77('0x0'));var moment=require(_0xad77('0x1'));var BPromise=require(_0xad77('0x2'));var rs=require(_0xad77('0x3'));var fs=require('fs');var Redis=require(_0xad77('0x4'));var db=require(_0xad77('0x5'))['db'];var utils=require(_0xad77('0x6'));var logger=require(_0xad77('0x7'))('rpc');var config=require(_0xad77('0x8'));var jayson=require(_0xad77('0x9'));var client=jayson[_0xad77('0xa')][_0xad77('0xb')]({'port':0x232a});config[_0xad77('0xc')]=_[_0xad77('0xd')](config[_0xad77('0xc')],{'host':_0xad77('0xe'),'port':0x18eb});var socket=require(_0xad77('0xf'))(new Redis(config[_0xad77('0xc')]));require(_0xad77('0x10'))[_0xad77('0x11')](socket);function respondWithRpcPromise(_0x997970,_0x41bfc5,_0x42325b){return new BPromise(function(_0x413533,_0x515c50){return client[_0xad77('0x12')](_0x997970,_0x42325b)['then'](function(_0xefaf9b){logger[_0xad77('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x41bfc5,_0xad77('0x14'));logger['debug'](_0xad77('0x15'),_0x41bfc5,_0xad77('0x14'),JSON[_0xad77('0x16')](_0xefaf9b));if(_0xefaf9b[_0xad77('0x17')]){if(_0xefaf9b[_0xad77('0x17')][_0xad77('0x18')]===0x1f4){logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0xefaf9b[_0xad77('0x17')]['message']);return _0x515c50(_0xefaf9b[_0xad77('0x17')][_0xad77('0x1a')]);}logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0xefaf9b['error'][_0xad77('0x1a')]);return _0x413533(_0xefaf9b[_0xad77('0x17')][_0xad77('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x41bfc5,_0xad77('0x14'));_0x413533(_0xefaf9b[_0xad77('0x1b')][_0xad77('0x1a')]);}})[_0xad77('0x1c')](function(_0x561981){logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0x561981);_0x515c50(_0x561981);});});} \ No newline at end of file +var _0x4503=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatWebsite.socket','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','util'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4503,0x67));var _0x3450=function(_0x55b362,_0x1966c1){_0x55b362=_0x55b362-0x0;var _0x2467a1=_0x4503[_0x55b362];return _0x2467a1;};'use strict';var _=require('lodash');var util=require(_0x3450('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3450('0x1'));var fs=require('fs');var Redis=require(_0x3450('0x2'));var db=require(_0x3450('0x3'))['db'];var utils=require(_0x3450('0x4'));var logger=require(_0x3450('0x5'))(_0x3450('0x6'));var config=require(_0x3450('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3450('0x8')][_0x3450('0x9')]({'port':0x232a});config['redis']=_[_0x3450('0xa')](config[_0x3450('0xb')],{'host':_0x3450('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3450('0xb')]));require(_0x3450('0xd'))[_0x3450('0xe')](socket);function respondWithRpcPromise(_0x974cd7,_0x171b36,_0x153928){return new BPromise(function(_0x1610c5,_0xc30a95){return client[_0x3450('0xf')](_0x974cd7,_0x153928)[_0x3450('0x10')](function(_0xd2307d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x171b36,_0x3450('0x11'));logger[_0x3450('0x12')](_0x3450('0x13'),_0x171b36,_0x3450('0x11'),JSON[_0x3450('0x14')](_0xd2307d));if(_0xd2307d[_0x3450('0x15')]){if(_0xd2307d['error']['code']===0x1f4){logger[_0x3450('0x15')](_0x3450('0x16'),_0x171b36,_0xd2307d['error'][_0x3450('0x17')]);return _0xc30a95(_0xd2307d[_0x3450('0x15')][_0x3450('0x17')]);}logger[_0x3450('0x15')](_0x3450('0x16'),_0x171b36,_0xd2307d[_0x3450('0x15')][_0x3450('0x17')]);return _0x1610c5(_0xd2307d['error'][_0x3450('0x17')]);}else{logger[_0x3450('0x18')](_0x3450('0x16'),_0x171b36,_0x3450('0x11'));_0x1610c5(_0xd2307d['result']['message']);}})[_0x3450('0x19')](function(_0x273c48){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x171b36,_0x273c48);_0xc30a95(_0x273c48);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index b0658a9..74cf458 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 _0xcdf5=['chatWebsite:','./chatWebsite.events','save','remove','emit','register','length'];(function(_0x3bab62,_0xb3b36d){var _0x1d8987=function(_0x172ff6){while(--_0x172ff6){_0x3bab62['push'](_0x3bab62['shift']());}};_0x1d8987(++_0xb3b36d);}(_0xcdf5,0x1c8));var _0x5cdf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcdf5[_0x5b644e];return _0x49c6bf;};'use strict';var ChatWebsiteEvents=require(_0x5cdf('0x0'));var events=[_0x5cdf('0x1'),_0x5cdf('0x2'),'update'];function createListener(_0x5e5f1b,_0x1666b7){return function(_0x5ac7ce){_0x1666b7[_0x5cdf('0x3')](_0x5e5f1b,_0x5ac7ce);};}function removeListener(_0x5b53bb,_0x228182){return function(){ChatWebsiteEvents['removeListener'](_0x5b53bb,_0x228182);};}exports[_0x5cdf('0x4')]=function(_0x494f0d){for(var _0x12191f=0x0,_0xb2145a=events[_0x5cdf('0x5')];_0x12191f<_0xb2145a;_0x12191f++){var _0x19997a=events[_0x12191f];var _0x4c5861=createListener(_0x5cdf('0x6')+_0x19997a,_0x494f0d);ChatWebsiteEvents['on'](_0x19997a,_0x4c5861);}}; \ No newline at end of file +var _0x5e3c=['emit','removeListener','register','./chatWebsite.events','save','remove','update'];(function(_0x1b120e,_0x42bcd4){var _0x18d6b4=function(_0x5ccfa8){while(--_0x5ccfa8){_0x1b120e['push'](_0x1b120e['shift']());}};_0x18d6b4(++_0x42bcd4);}(_0x5e3c,0x106));var _0xc5e3=function(_0x28d9e1,_0x4fac68){_0x28d9e1=_0x28d9e1-0x0;var _0x3e6c20=_0x5e3c[_0x28d9e1];return _0x3e6c20;};'use strict';var ChatWebsiteEvents=require(_0xc5e3('0x0'));var events=[_0xc5e3('0x1'),_0xc5e3('0x2'),_0xc5e3('0x3')];function createListener(_0xbfe53,_0x37069a){return function(_0x4febec){_0x37069a[_0xc5e3('0x4')](_0xbfe53,_0x4febec);};}function removeListener(_0x57e298,_0x492144){return function(){ChatWebsiteEvents[_0xc5e3('0x5')](_0x57e298,_0x492144);};}exports[_0xc5e3('0x6')]=function(_0x1aecd4){for(var _0x3a0491=0x0,_0x312626=events['length'];_0x3a0491<_0x312626;_0x3a0491++){var _0x40504c=events[_0x3a0491];var _0x27cf37=createListener('chatWebsite:'+_0x40504c,_0x1aecd4);ChatWebsiteEvents['on'](_0x40504c,_0x27cf37);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index cc72a64..4c37fa4 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 _0x4258=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x4258,0x118));var _0x8425=function(_0x2f2376,_0x20f9f5){_0x2f2376=_0x2f2376-0x0;var _0x174600=_0x4258[_0x2f2376];return _0x174600;};'use strict';var multer=require(_0x8425('0x0'));var util=require('util');var path=require(_0x8425('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8425('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8425('0x3'));var interaction=require(_0x8425('0x4'));var config=require(_0x8425('0x5'));var controller=require(_0x8425('0x6'));router[_0x8425('0x7')]('/',auth[_0x8425('0x8')](),controller[_0x8425('0x9')]);router[_0x8425('0x7')](_0x8425('0xa'),auth['isAuthenticated'](),controller[_0x8425('0xb')]);router[_0x8425('0x7')](_0x8425('0xc'),auth[_0x8425('0x8')](),controller[_0x8425('0xd')]);router[_0x8425('0x7')](_0x8425('0xe'),auth['isAuthenticated'](),controller[_0x8425('0xf')]);router['get']('/:id/canned_answers',auth[_0x8425('0x8')](),controller[_0x8425('0x10')]);router[_0x8425('0x7')](_0x8425('0x11'),controller['getLogo']);router[_0x8425('0x7')]('/:id/avatar',controller[_0x8425('0x12')]);router[_0x8425('0x7')](_0x8425('0x13'),controller[_0x8425('0x14')]);router[_0x8425('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x8425('0x8')](),controller[_0x8425('0x15')]);router[_0x8425('0x7')](_0x8425('0x16'),controller[_0x8425('0x17')]);router[_0x8425('0x7')](_0x8425('0x18'),auth[_0x8425('0x8')](),controller[_0x8425('0x19')]);router[_0x8425('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x8425('0x7')](_0x8425('0x1a'),controller[_0x8425('0x1b')]);router[_0x8425('0x7')](_0x8425('0x1c'),auth[_0x8425('0x8')](),controller['getOfflineMessages']);router[_0x8425('0x7')](_0x8425('0x1d'),auth['isAuthenticated'](),controller[_0x8425('0x1e')]);router[_0x8425('0x1f')]('/',auth[_0x8425('0x8')](),controller[_0x8425('0x20')]);router[_0x8425('0x1f')]('/:id/dispositions',auth[_0x8425('0x8')](),controller[_0x8425('0x21')]);router[_0x8425('0x1f')](_0x8425('0x22'),auth[_0x8425('0x8')](),controller[_0x8425('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x317713,_0x255de2,_0x24b8aa){_0x24b8aa(null,path[_0x8425('0x24')](config['root'],_0x8425('0x25')));},'filename':function(_0x2b0065,_0x590c08,_0x543c1e){_0x543c1e(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x590c08[_0x8425('0x29')]));}})});router[_0x8425('0x1f')](_0x8425('0x11'),upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x2c')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x52a7e3,_0x5e44e8,_0x418001){_0x418001(null,path[_0x8425('0x24')](config[_0x8425('0x2e')],_0x8425('0x2f')));},'filename':function(_0x5deb7a,_0x42bc34,_0x213621){_0x213621(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x42bc34[_0x8425('0x29')]));}})});router['post']('/:id/avatar',upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x30')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x1ae6b0,_0x2283ec,_0x42f3bb){_0x42f3bb(null,path['join'](config[_0x8425('0x2e')],_0x8425('0x2f')));},'filename':function(_0x1fae26,_0x32b710,_0x4e5901){_0x4e5901(null,util['format'](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x32b710[_0x8425('0x29')]));}})});router[_0x8425('0x1f')](_0x8425('0x13'),upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x31')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x23f7e5,_0x346e75,_0xc153b6){_0xc153b6(null,path[_0x8425('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2ff0df,_0x4aa811,_0x347e85){_0x347e85(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x4aa811[_0x8425('0x29')]));}})});router[_0x8425('0x1f')]('/:id/system_avatar',upload[_0x8425('0x2a')]('file'),controller['addSystemAvatar']);router[_0x8425('0x1f')](_0x8425('0x32'),controller[_0x8425('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x59c998,_0x38839a,_0x575d62){const _0x4b17fd=path['join'](config[_0x8425('0x2e')],_0x8425('0x34'),'attachments',_0x8425('0x35'));fs_extra[_0x8425('0x36')](_0x4b17fd,function(){_0x575d62(null,_0x4b17fd);});},'filename':function(_0x446c62,_0x150dc8,_0x272a93){const _0x477e9d=_0x150dc8[_0x8425('0x29')][_0x8425('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1bf27c=path['extname'](_0x477e9d);const _0x2552c4=Date[_0x8425('0x28')]()+'-'+_0x477e9d[_0x8425('0x37')](_0x1bf27c,'')+_0x1bf27c;_0x272a93(null,_0x2552c4);}})});router[_0x8425('0x1f')](_0x8425('0x38'),offlineUploadMulter[_0x8425('0x39')](),controller[_0x8425('0x3a')]);router[_0x8425('0x1f')](_0x8425('0x3b'),auth[_0x8425('0x8')](),controller[_0x8425('0x3c')]);router[_0x8425('0x1f')](_0x8425('0x18'),auth[_0x8425('0x8')](),controller[_0x8425('0x3d')]);router[_0x8425('0x1f')](_0x8425('0x3e'),auth[_0x8425('0x8')](),controller[_0x8425('0x3f')]);router[_0x8425('0x1f')](_0x8425('0x1d'),auth['isAuthenticated'](),controller[_0x8425('0x40')]);router[_0x8425('0x41')]('/:id',auth[_0x8425('0x8')](),controller[_0x8425('0x42')]);router[_0x8425('0x43')](_0x8425('0xc'),auth['isAuthenticated'](),controller[_0x8425('0x44')]);router[_0x8425('0x43')](_0x8425('0xe'),auth[_0x8425('0x8')](),controller[_0x8425('0x45')]);router['delete'](_0x8425('0x22'),auth[_0x8425('0x8')](),controller[_0x8425('0x46')]);router[_0x8425('0x43')](_0x8425('0x1d'),auth[_0x8425('0x8')](),controller['removeAgents']);module[_0x8425('0x47')]=router; \ No newline at end of file +var _0x0c87=['ensureDir','replace','offline','addInteraction','addProactiveActions','put','update','delete','removeAnswers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','/:id/notify','notify','server/files'];(function(_0x409cc2,_0x3d45e7){var _0x4e8b68=function(_0x420dbe){while(--_0x420dbe){_0x409cc2['push'](_0x409cc2['shift']());}};_0x4e8b68(++_0x3d45e7);}(_0x0c87,0x8a));var _0x70c8=function(_0x5a81e0,_0xc3b682){_0x5a81e0=_0x5a81e0-0x0;var _0x337051=_0x0c87[_0x5a81e0];return _0x337051;};'use strict';var multer=require('multer');var util=require(_0x70c8('0x0'));var path=require(_0x70c8('0x1'));var timeout=require(_0x70c8('0x2'));var express=require(_0x70c8('0x3'));var router=express['Router']();var fs_extra=require(_0x70c8('0x4'));var auth=require(_0x70c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x70c8('0x6'));var controller=require(_0x70c8('0x7'));router[_0x70c8('0x8')]('/',auth[_0x70c8('0x9')](),controller[_0x70c8('0xa')]);router[_0x70c8('0x8')](_0x70c8('0xb'),auth[_0x70c8('0x9')](),controller[_0x70c8('0xc')]);router[_0x70c8('0x8')](_0x70c8('0xd'),auth[_0x70c8('0x9')](),controller['show']);router[_0x70c8('0x8')](_0x70c8('0xe'),auth['isAuthenticated'](),controller[_0x70c8('0xf')]);router[_0x70c8('0x8')](_0x70c8('0x10'),auth[_0x70c8('0x9')](),controller['getAnswers']);router[_0x70c8('0x8')](_0x70c8('0x11'),controller[_0x70c8('0x12')]);router['get'](_0x70c8('0x13'),controller[_0x70c8('0x14')]);router[_0x70c8('0x8')](_0x70c8('0x15'),controller[_0x70c8('0x16')]);router['get'](_0x70c8('0x17'),controller['getSystemAvatar']);router[_0x70c8('0x8')](_0x70c8('0x18'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x19')]);router['get'](_0x70c8('0x1a'),controller[_0x70c8('0x1b')]);router['get'](_0x70c8('0x1c'),auth['isAuthenticated'](),controller[_0x70c8('0x1d')]);router[_0x70c8('0x8')](_0x70c8('0x1e'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x1f')]);router[_0x70c8('0x8')]('/:id/fields',controller[_0x70c8('0x20')]);router[_0x70c8('0x8')]('/:id/offline_messages',auth[_0x70c8('0x9')](),controller[_0x70c8('0x21')]);router[_0x70c8('0x8')](_0x70c8('0x22'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70c8('0x24')]);router[_0x70c8('0x25')](_0x70c8('0xe'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x26')]);router[_0x70c8('0x25')](_0x70c8('0x10'),auth[_0x70c8('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12c650,_0x55f236,_0xde99c0){_0xde99c0(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x29')));},'filename':function(_0x95fcfc,_0x52e20a,_0x588dfb){_0x588dfb(null,util[_0x70c8('0x2a')]('%s-%s',Date[_0x70c8('0x2b')](),_0x52e20a[_0x70c8('0x2c')]));}})});router[_0x70c8('0x25')](_0x70c8('0x11'),upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller[_0x70c8('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5eada5,_0x59ceac,_0xd2c054){_0xd2c054(null,path[_0x70c8('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x40935f,_0x3780ee,_0x1225aa){_0x1225aa(null,util['format']('%s-%s',Date[_0x70c8('0x2b')](),_0x3780ee['originalname']));}})});router['post']('/:id/avatar',upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x70c8('0x30')]({'destination':function(_0x1593ae,_0x38aabb,_0x4b1a04){_0x4b1a04(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x31')));},'filename':function(_0x379a62,_0x4c248f,_0x55d9c1){_0x55d9c1(null,util[_0x70c8('0x2a')]('%s-%s',Date['now'](),_0x4c248f['originalname']));}})});router[_0x70c8('0x25')](_0x70c8('0x15'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x20e574,_0x2a64ad,_0xd7cad2){_0xd7cad2(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x31')));},'filename':function(_0x320b35,_0x1caa9c,_0x30ba86){_0x30ba86(null,util[_0x70c8('0x2a')](_0x70c8('0x32'),Date[_0x70c8('0x2b')](),_0x1caa9c[_0x70c8('0x2c')]));}})});router[_0x70c8('0x25')](_0x70c8('0x17'),upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller['addSystemAvatar']);router['post'](_0x70c8('0x33'),controller[_0x70c8('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x70c8('0x30')]({'destination':function(_0x2f15a5,_0x2e4eee,_0x2d94dc){const _0x580c0e=path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x35'),'attachments','offline-chat');fs_extra[_0x70c8('0x36')](_0x580c0e,function(){_0x2d94dc(null,_0x580c0e);});},'filename':function(_0x157270,_0x1e2d3e,_0x17df67){const _0x5e2d30=_0x1e2d3e['originalname'][_0x70c8('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5af5f0=path['extname'](_0x5e2d30);const _0x47e233=Date[_0x70c8('0x2b')]()+'-'+_0x5e2d30[_0x70c8('0x37')](_0x5af5f0,'')+_0x5af5f0;_0x17df67(null,_0x47e233);}})});router[_0x70c8('0x25')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x70c8('0x38')]);router['post'](_0x70c8('0x18'),auth['isAuthenticated'](),controller[_0x70c8('0x39')]);router[_0x70c8('0x25')](_0x70c8('0x1c'),auth[_0x70c8('0x9')](),controller['addApplications']);router['post'](_0x70c8('0x1e'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x3a')]);router[_0x70c8('0x25')]('/:id/users',auth[_0x70c8('0x9')](),controller['addAgents']);router[_0x70c8('0x3b')](_0x70c8('0xd'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x3c')]);router[_0x70c8('0x3d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x70c8('0x3d')](_0x70c8('0xe'),auth[_0x70c8('0x9')](),controller['removeDispositions']);router[_0x70c8('0x3d')](_0x70c8('0x10'),auth['isAuthenticated'](),controller[_0x70c8('0x3e')]);router['delete'](_0x70c8('0x22'),auth[_0x70c8('0x9')](),controller['removeAgents']);module[_0x70c8('0x3f')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 6413224..94ffce8 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 _0x7722=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x2f421b,_0x170048){var _0x5ebb64=function(_0x2b9b65){while(--_0x2b9b65){_0x2f421b['push'](_0x2f421b['shift']());}};_0x5ebb64(++_0x170048);}(_0x7722,0x14e));var _0x2772=function(_0x5cb03d,_0x337c8e){_0x5cb03d=_0x5cb03d-0x0;var _0x11e7d=_0x7722[_0x5cb03d];return _0x11e7d;};'use strict';var Sequelize=require(_0x2772('0x0'));module[_0x2772('0x1')]={'name':{'type':Sequelize[_0x2772('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2772('0x3')](_0x2772('0x4'),_0x2772('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2772('0x2')]},'data2':{'type':Sequelize[_0x2772('0x2')]}}; \ No newline at end of file +var _0x631c=['ENUM','AmazonAWS','STRING','sequelize','exports'];(function(_0x512588,_0x352902){var _0x3d0d1e=function(_0x5e32ce){while(--_0x5e32ce){_0x512588['push'](_0x512588['shift']());}};_0x3d0d1e(++_0x352902);}(_0x631c,0x1b6));var _0xc631=function(_0x597cb2,_0x2b78a7){_0x597cb2=_0x597cb2-0x0;var _0x4bc732=_0x631c[_0x597cb2];return _0x4bc732;};'use strict';var Sequelize=require(_0xc631('0x0'));module[_0xc631('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc631('0x2')](_0xc631('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xc631('0x4')]},'data2':{'type':Sequelize[_0xc631('0x4')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ed2d0f4..82bea4d 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xadb5,0xad));var _0x5adb=function(_0x52e035,_0x592898){_0x52e035=_0x52e035-0x0;var _0x8c07ee=_0xadb5[_0x52e035];return _0x8c07ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x46a137,_0x3be24d){var _0xbcba75=function(_0x44cac3){while(--_0x44cac3){_0x46a137['push'](_0x46a137['shift']());}};_0xbcba75(++_0x3be24d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x0b0e[_0x27c068];return _0xe5a67f;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 28ebcf1..67aaa49 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 _0xdfaa=['rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1ee161,_0x324229){var _0x288cf6=function(_0x555d2f){while(--_0x555d2f){_0x1ee161['push'](_0x1ee161['shift']());}};_0x288cf6(++_0x324229);}(_0xdfaa,0x1e9));var _0xadfa=function(_0x22927d,_0x5214d4){_0x22927d=_0x22927d-0x0;var _0x517939=_0xdfaa[_0x22927d];return _0x517939;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var logger=require(_0xadfa('0x2'))(_0xadfa('0x3'));var moment=require('moment');var BPromise=require(_0xadfa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadfa('0x5'));var rimraf=require(_0xadfa('0x6'));var config=require('../../config/environment');var attributes=require(_0xadfa('0x7'));module[_0xadfa('0x8')]=function(_0x14d709,_0x364a06){return _0x14d709[_0xadfa('0x9')](_0xadfa('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60bf=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','CloudProvider'];(function(_0x524b59,_0x2584f4){var _0x41cc8f=function(_0x3b8ee9){while(--_0x3b8ee9){_0x524b59['push'](_0x524b59['shift']());}};_0x41cc8f(++_0x2584f4);}(_0x60bf,0x1a5));var _0xf60b=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x60bf[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xf60b('0x0'));var util=require(_0xf60b('0x1'));var logger=require(_0xf60b('0x2'))(_0xf60b('0x3'));var moment=require(_0xf60b('0x4'));var BPromise=require(_0xf60b('0x5'));var rp=require(_0xf60b('0x6'));var fs=require('fs');var path=require(_0xf60b('0x7'));var rimraf=require(_0xf60b('0x8'));var config=require('../../config/environment');var attributes=require(_0xf60b('0x9'));module['exports']=function(_0xeff023,_0x5a8b36){return _0xeff023['define'](_0xf60b('0xa'),attributes,{'tableName':_0xf60b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2b4ebd2..c3d37c4 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 _0xa064=['stringify','error','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x58bdae,_0xd4a4f){var _0x226c2a=function(_0x59234b){while(--_0x59234b){_0x58bdae['push'](_0x58bdae['shift']());}};_0x226c2a(++_0xd4a4f);}(_0xa064,0x192));var _0x4a06=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xa064[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});} \ No newline at end of file +var _0xcefd=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xcefd,0x126));var _0xdcef=function(_0x29969b,_0x2982c4){_0x29969b=_0x29969b-0x0;var _0x16bdad=_0xcefd[_0x29969b];return _0x16bdad;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var moment=require(_0xdcef('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcef('0x6'))(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcef('0x9')][_0xdcef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb1b7,_0x3260fe,_0x53e707){return new BPromise(function(_0x56ee48,_0x8b30d4){return client[_0xdcef('0xb')](_0x3fb1b7,_0x53e707)[_0xdcef('0xc')](function(_0x5d601b){logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));logger[_0xdcef('0x10')](_0xdcef('0x11'),_0x3260fe,_0xdcef('0xf'),JSON['stringify'](_0x5d601b));if(_0x5d601b['error']){if(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x13')]===0x1f4){logger['error'](_0xdcef('0xe'),_0x3260fe,_0x5d601b['error']['message']);return _0x8b30d4(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);return _0x56ee48(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}else{logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));_0x56ee48(_0x5d601b[_0xdcef('0x15')]['message']);}})[_0xdcef('0x16')](function(_0x4dd058){logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x4dd058);_0x8b30d4(_0x4dd058);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 60e18f4..4eb3f7d 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 _0x594e=['show','isAuthenticated','put','update','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x54b73a,_0x2afab9){var _0x3b87ff=function(_0x297046){while(--_0x297046){_0x54b73a['push'](_0x54b73a['shift']());}};_0x3b87ff(++_0x2afab9);}(_0x594e,0x11e));var _0xe594=function(_0x50cc18,_0x1b2df4){_0x50cc18=_0x50cc18-0x0;var _0x59f3c7=_0x594e[_0x50cc18];return _0x59f3c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe594('0x0'));var timeout=require('connect-timeout');var express=require(_0xe594('0x1'));var router=express['Router']();var fs_extra=require(_0xe594('0x2'));var auth=require(_0xe594('0x3'));var interaction=require(_0xe594('0x4'));var config=require(_0xe594('0x5'));var controller=require('./cloudProvider.controller');router[_0xe594('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe594('0x6')](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0x8')]);router['post']('/',auth[_0xe594('0x9')](),controller['create']);router[_0xe594('0xa')](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0xb')]);router['delete'](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0xc')]);module[_0xe594('0xd')]=router; \ No newline at end of file +var _0x10ad=['update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x12256d,_0x455511){var _0x440df1=function(_0x55af65){while(--_0x55af65){_0x12256d['push'](_0x12256d['shift']());}};_0x440df1(++_0x455511);}(_0x10ad,0xf4));var _0xd10a=function(_0x5ce2e7,_0x2611f0){_0x5ce2e7=_0x5ce2e7-0x0;var _0x35d0d6=_0x10ad[_0x5ce2e7];return _0x35d0d6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd10a('0x0'));var express=require('express');var router=express[_0xd10a('0x1')]();var fs_extra=require(_0xd10a('0x2'));var auth=require(_0xd10a('0x3'));var interaction=require(_0xd10a('0x4'));var config=require('../../config/environment');var controller=require(_0xd10a('0x5'));router[_0xd10a('0x6')]('/',auth[_0xd10a('0x7')](),controller[_0xd10a('0x8')]);router[_0xd10a('0x6')](_0xd10a('0x9'),auth[_0xd10a('0x7')](),controller[_0xd10a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd10a('0xb')]);router['put'](_0xd10a('0x9'),auth[_0xd10a('0x7')](),controller[_0xd10a('0xc')]);router[_0xd10a('0xd')]('/:id',auth[_0xd10a('0x7')](),controller[_0xd10a('0xe')]);module[_0xd10a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 5a478cc..3d73717 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 _0x8530=['name','exports','STRING'];(function(_0x31d721,_0x463ef8){var _0x2608d6=function(_0x2d6ebc){while(--_0x2d6ebc){_0x31d721['push'](_0x31d721['shift']());}};_0x2608d6(++_0x463ef8);}(_0x8530,0xf7));var _0x0853=function(_0x297e62,_0x3b2cd6){_0x297e62=_0x297e62-0x0;var _0x4da028=_0x8530[_0x297e62];return _0x4da028;};'use strict';var Sequelize=require('sequelize');module[_0x0853('0x0')]={'name':{'type':Sequelize[_0x0853('0x1')],'unique':_0x0853('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x0853('0x1')]},'website':{'type':Sequelize[_0x0853('0x1')]},'phone':{'type':Sequelize[_0x0853('0x1')]},'fax':{'type':Sequelize[_0x0853('0x1')]},'type':{'type':Sequelize[_0x0853('0x1')]},'street':{'type':Sequelize[_0x0853('0x1')]},'postalCode':{'type':Sequelize[_0x0853('0x1')]},'city':{'type':Sequelize[_0x0853('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0853('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0853('0x1')]},'sStreet':{'type':Sequelize[_0x0853('0x1')]},'sPostalCode':{'type':Sequelize[_0x0853('0x1')]},'sCity':{'type':Sequelize[_0x0853('0x1')]},'sCountry':{'type':Sequelize[_0x0853('0x1')]},'description':{'type':Sequelize[_0x0853('0x1')]}}; \ No newline at end of file +var _0x15b3=['STRING','sequelize','exports','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x15b3,0x17d));var _0x315b=function(_0x42d683,_0x398322){_0x42d683=_0x42d683-0x0;var _0x41a563=_0x15b3[_0x42d683];return _0x41a563;};'use strict';var Sequelize=require(_0x315b('0x0'));module[_0x315b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x315b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x315b('0x3')]},'website':{'type':Sequelize[_0x315b('0x3')]},'phone':{'type':Sequelize[_0x315b('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x315b('0x3')]},'street':{'type':Sequelize[_0x315b('0x3')]},'postalCode':{'type':Sequelize[_0x315b('0x3')]},'city':{'type':Sequelize[_0x315b('0x3')]},'country':{'type':Sequelize[_0x315b('0x3')]},'email':{'type':Sequelize[_0x315b('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x315b('0x3')]},'sStreet':{'type':Sequelize[_0x315b('0x3')]},'sPostalCode':{'type':Sequelize[_0x315b('0x3')]},'sCity':{'type':Sequelize[_0x315b('0x3')]},'sCountry':{'type':Sequelize[_0x315b('0x3')]},'description':{'type':Sequelize[_0x315b('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 14ec369..88df92b 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 _0x7faa=['options','includeAll','include','rows','catch','show','rawAttributes','create','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map'];(function(_0x81f738,_0x576329){var _0xe6b18c=function(_0x30c5e4){while(--_0x30c5e4){_0x81f738['push'](_0x81f738['shift']());}};_0xe6b18c(++_0x576329);}(_0x7faa,0x167));var _0xa7fa=function(_0x4eea11,_0x21db54){_0x4eea11=_0x4eea11-0x0;var _0x1c1d03=_0x7faa[_0x4eea11];return _0x1c1d03;};'use strict';var emlformat=require(_0xa7fa('0x0'));var rimraf=require(_0xa7fa('0x1'));var zipdir=require(_0xa7fa('0x2'));var jsonpatch=require(_0xa7fa('0x3'));var rp=require(_0xa7fa('0x4'));var moment=require('moment');var BPromise=require(_0xa7fa('0x5'));var Mustache=require(_0xa7fa('0x6'));var util=require(_0xa7fa('0x7'));var path=require(_0xa7fa('0x8'));var sox=require(_0xa7fa('0x9'));var csv=require(_0xa7fa('0xa'));var ejs=require(_0xa7fa('0xb'));var fs=require('fs');var fs_extra=require(_0xa7fa('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7fa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7fa('0xa'));var querystring=require(_0xa7fa('0xe'));var Papa=require(_0xa7fa('0xf'));var Redis=require('ioredis');var authService=require(_0xa7fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa7fa('0x11'));var hardwareService=require(_0xa7fa('0x12'));var logger=require('../../config/logger')(_0xa7fa('0x13'));var utils=require(_0xa7fa('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7fa('0x15'))['db'];function respondWithStatusCode(_0x56eae3,_0x5a68e8){_0x5a68e8=_0x5a68e8||0xcc;return function(_0x195584){if(_0x195584){return _0x56eae3[_0xa7fa('0x16')](_0x5a68e8);}return _0x56eae3[_0xa7fa('0x17')](_0x5a68e8)[_0xa7fa('0x18')]();};}function respondWithResult(_0x20ee3a,_0x35be21){_0x35be21=_0x35be21||0xc8;return function(_0x1e9cb6){if(_0x1e9cb6){return _0x20ee3a[_0xa7fa('0x17')](_0x35be21)[_0xa7fa('0x19')](_0x1e9cb6);}};}function respondWithFilteredResult(_0x315b7f,_0x3bdb88){return function(_0x11976){if(_0x11976){var _0x11b60e=typeof _0x3bdb88[_0xa7fa('0x1a')]===_0xa7fa('0x1b')&&typeof _0x3bdb88[_0xa7fa('0x1c')]===_0xa7fa('0x1b');var _0xd7bb7e=_0x11976[_0xa7fa('0x1d')];var _0x5c1c2c=_0x11b60e?0x0:_0x3bdb88[_0xa7fa('0x1a')];var _0x49a0bf=_0x11b60e?_0x11976[_0xa7fa('0x1d')]:_0x3bdb88[_0xa7fa('0x1a')]+_0x3bdb88[_0xa7fa('0x1c')];var _0xa1042b;if(_0x49a0bf>=_0xd7bb7e){_0x49a0bf=_0xd7bb7e;_0xa1042b=0xc8;}else{_0xa1042b=0xce;}_0x315b7f['status'](_0xa1042b);return _0x315b7f[_0xa7fa('0x1e')]('Content-Range',_0x5c1c2c+'-'+_0x49a0bf+'/'+_0xd7bb7e)[_0xa7fa('0x19')](_0x11976);}return null;};}function patchUpdates(_0x4775fc){return function(_0x40557c){try{jsonpatch[_0xa7fa('0x1f')](_0x40557c,_0x4775fc,!![]);}catch(_0x3c5fd2){return BPromise[_0xa7fa('0x20')](_0x3c5fd2);}return _0x40557c[_0xa7fa('0x21')]();};}function saveUpdates(_0x1d3969,_0x4fe609){return function(_0x21a30e){if(_0x21a30e){return _0x21a30e[_0xa7fa('0x22')](_0x1d3969)[_0xa7fa('0x23')](function(_0x19e3e0){return _0x19e3e0;});}return null;};}function removeEntity(_0xcaf801,_0x1d03a5){return function(_0x21f8f2){if(_0x21f8f2){return _0x21f8f2[_0xa7fa('0x24')]()[_0xa7fa('0x23')](function(){var _0xf2f0df=_0x21f8f2['get']({'plain':!![]});var _0xb0f8eb=_0xa7fa('0x25');return db[_0xa7fa('0x26')][_0xa7fa('0x24')]({'where':{'type':_0xb0f8eb,'resourceId':_0xf2f0df['id']}})[_0xa7fa('0x23')](function(){return _0x21f8f2;});})[_0xa7fa('0x23')](function(){_0xcaf801[_0xa7fa('0x17')](0xcc)[_0xa7fa('0x18')]();});}};}function handleEntityNotFound(_0x5f3686,_0x1d921b){return function(_0x2cc914){if(!_0x2cc914){_0x5f3686[_0xa7fa('0x16')](0x194);}return _0x2cc914;};}function handleError(_0x220130,_0x2c88dd){_0x2c88dd=_0x2c88dd||0x1f4;return function(_0x3fc953){logger[_0xa7fa('0x27')](_0x3fc953[_0xa7fa('0x28')]);if(_0x3fc953['name']){delete _0x3fc953[_0xa7fa('0x29')];}_0x220130['status'](_0x2c88dd)['send'](_0x3fc953);};}exports['index']=function(_0x5e8628,_0x11bdfc){var _0x259a44={},_0x3bcaf9={},_0x4b338d={'count':0x0,'rows':[]};return db[_0xa7fa('0x2a')][_0xa7fa('0x2b')]()[_0xa7fa('0x23')](function(_0x2ece68){_0x3bcaf9[_0xa7fa('0x2c')]=_[_0xa7fa('0x2d')](_0x2ece68);_0x3bcaf9[_0xa7fa('0x2e')]=_[_0xa7fa('0x2d')](_0x5e8628[_0xa7fa('0x2e')]);_0x3bcaf9[_0xa7fa('0x2f')]=_[_0xa7fa('0x30')](_0x3bcaf9[_0xa7fa('0x2c')],_0x3bcaf9[_0xa7fa('0x2e')]);_0x259a44[_0xa7fa('0x31')]=_['intersection'](_0x3bcaf9[_0xa7fa('0x2c')],qs[_0xa7fa('0x32')](_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x32')]));_0x259a44['attributes']=_0x259a44['attributes'][_0xa7fa('0x33')]?_0x259a44['attributes']:_0x3bcaf9[_0xa7fa('0x2c')];if(!_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x34')](_0xa7fa('0x35'))){_0x259a44[_0xa7fa('0x1c')]=qs[_0xa7fa('0x1c')](_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x1c')]);_0x259a44[_0xa7fa('0x1a')]=qs[_0xa7fa('0x1a')](_0x5e8628['query']['offset']);}_0x259a44[_0xa7fa('0x36')]=qs['sort'](_0x5e8628['query'][_0xa7fa('0x37')]);_0x259a44['where']=qs[_0xa7fa('0x2f')](_[_0xa7fa('0x38')](_0x5e8628[_0xa7fa('0x2e')],_0x3bcaf9[_0xa7fa('0x2f')]),_0x2ece68);if(_0x5e8628['query'][_0xa7fa('0x39')]){_0x259a44[_0xa7fa('0x3a')]=_[_0xa7fa('0x3b')](_0x259a44['where'],{'$or':_[_0xa7fa('0x3c')](_0x259a44['attributes'],function(_0x33bfc1){var _0x2325e9={};_0x2325e9[_0x33bfc1]={'$like':'%'+_0x5e8628['query'][_0xa7fa('0x39')]+'%'};return _0x2325e9;})});}_0x259a44=_['merge']({},_0x259a44,_0x5e8628[_0xa7fa('0x3d')]);var _0x17e2cf={'where':_0x259a44[_0xa7fa('0x3a')]};return db['CmCompany'][_0xa7fa('0x1d')](_0x17e2cf)[_0xa7fa('0x23')](function(_0x1f0994){_0x4b338d[_0xa7fa('0x1d')]=_0x1f0994;if(_0x5e8628['query'][_0xa7fa('0x3e')]){_0x259a44[_0xa7fa('0x3f')]=[{'all':!![]}];}return db[_0xa7fa('0x2a')]['findAll'](_0x259a44);})[_0xa7fa('0x23')](function(_0x28df25){_0x4b338d[_0xa7fa('0x40')]=_0x28df25;return _0x4b338d;})['then'](respondWithFilteredResult(_0x11bdfc,_0x259a44))[_0xa7fa('0x41')](handleError(_0x11bdfc,null));})['catch'](handleError(_0x11bdfc,null));};exports[_0xa7fa('0x42')]=function(_0x4ba578,_0x1243ae){var _0x15bd14={'raw':![],'where':{'id':_0x4ba578['params']['id']}},_0x1baed8={};_0x1baed8[_0xa7fa('0x2c')]=_[_0xa7fa('0x2d')](db[_0xa7fa('0x2a')][_0xa7fa('0x43')]);_0x1baed8[_0xa7fa('0x2e')]=_[_0xa7fa('0x2d')](_0x4ba578[_0xa7fa('0x2e')]);_0x1baed8[_0xa7fa('0x2f')]=_[_0xa7fa('0x30')](_0x1baed8[_0xa7fa('0x2c')],_0x1baed8['query']);_0x15bd14[_0xa7fa('0x31')]=_[_0xa7fa('0x30')](_0x1baed8['model'],qs['fields'](_0x4ba578['query'][_0xa7fa('0x32')]));_0x15bd14['attributes']=_0x15bd14[_0xa7fa('0x31')][_0xa7fa('0x33')]?_0x15bd14[_0xa7fa('0x31')]:_0x1baed8[_0xa7fa('0x2c')];if(_0x4ba578['query'][_0xa7fa('0x3e')]){_0x15bd14[_0xa7fa('0x3f')]=[{'all':!![]}];}_0x15bd14=_[_0xa7fa('0x3b')]({},_0x15bd14,_0x4ba578['options']);return db['CmCompany']['find'](_0x15bd14)[_0xa7fa('0x23')](handleEntityNotFound(_0x1243ae,null))[_0xa7fa('0x23')](respondWithResult(_0x1243ae,null))[_0xa7fa('0x41')](handleError(_0x1243ae,null));};exports[_0xa7fa('0x44')]=function(_0x491844,_0x27657e){return db['CmCompany']['create'](_0x491844['body'],{})['then'](function(_0x4cdc1d){var _0x512b00=_0x491844['user'][_0xa7fa('0x45')]({'plain':!![]});if(!_0x512b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x512b00[_0xa7fa('0x46')]===_0xa7fa('0x47')){var _0x6cec7=_0x4cdc1d['get']({'plain':!![]});var _0x478bdd='Companies';return db[_0xa7fa('0x48')][_0xa7fa('0x49')]({'where':{'name':_0x478bdd,'userProfileId':_0x512b00[_0xa7fa('0x4a')]},'raw':!![]})[_0xa7fa('0x23')](function(_0x449e68){if(_0x449e68&&_0x449e68[_0xa7fa('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x6cec7[_0xa7fa('0x29')],'resourceId':_0x6cec7['id'],'type':_0x449e68['name'],'sectionId':_0x449e68['id']},{})[_0xa7fa('0x23')](function(){return _0x4cdc1d;});}else{return _0x4cdc1d;}})['catch'](function(_0x562159){logger['error'](_0xa7fa('0x4c'),_0x562159);throw _0x562159;});}return _0x4cdc1d;})[_0xa7fa('0x23')](respondWithResult(_0x27657e,0xc9))[_0xa7fa('0x41')](handleError(_0x27657e,null));};exports['update']=function(_0x3a03fa,_0x245ac3){if(_0x3a03fa[_0xa7fa('0x4d')]['id']){delete _0x3a03fa[_0xa7fa('0x4d')]['id'];}return db[_0xa7fa('0x2a')][_0xa7fa('0x49')]({'where':{'id':_0x3a03fa['params']['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x245ac3,null))['then'](saveUpdates(_0x3a03fa['body'],null))[_0xa7fa('0x23')](respondWithResult(_0x245ac3,null))[_0xa7fa('0x41')](handleError(_0x245ac3,null));};exports['destroy']=function(_0x3deb0f,_0x3d6c8c){return db['CmCompany'][_0xa7fa('0x49')]({'where':{'id':_0x3deb0f[_0xa7fa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d6c8c,null))[_0xa7fa('0x23')](removeEntity(_0x3d6c8c,null))[_0xa7fa('0x41')](handleError(_0x3d6c8c,null));};exports['describe']=function(_0x22cb60,_0x2efb49){return db[_0xa7fa('0x2a')][_0xa7fa('0x2b')]()[_0xa7fa('0x23')](respondWithResult(_0x2efb49,null))['catch'](handleError(_0x2efb49,null));};exports[_0xa7fa('0x4f')]=function(_0x48e5f1,_0x5cb05e,_0x5baa2b){return db[_0xa7fa('0x50')][_0xa7fa('0x49')]({'where':{'id':_0x48e5f1[_0xa7fa('0x4e')]['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x5cb05e,null))[_0xa7fa('0x23')](function(_0x12fbe3){if(_0x12fbe3){return _0x12fbe3[_0xa7fa('0x4f')](_0x48e5f1['body']['ids'],_['omit'](_0x48e5f1[_0xa7fa('0x4d')],[_0xa7fa('0x51'),'id'])||{});}})[_0xa7fa('0x23')](respondWithResult(_0x5cb05e,null))[_0xa7fa('0x41')](handleError(_0x5cb05e,null));};exports[_0xa7fa('0x52')]=function(_0x46ccd1,_0x385fb9,_0x47a355){var _0x4fd6d1={};var _0x50012={};var _0x398810;var _0x9278dc;return db['CmCompany'][_0xa7fa('0x53')]({'where':{'id':_0x46ccd1['params']['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x385fb9,null))[_0xa7fa('0x23')](function(_0x33f2d0){if(_0x33f2d0){_0x398810=_0x33f2d0;_0x50012['model']=_[_0xa7fa('0x2d')](db[_0xa7fa('0x50')][_0xa7fa('0x43')]);_0x50012['query']=_[_0xa7fa('0x2d')](_0x46ccd1['query']);_0x50012['filters']=_[_0xa7fa('0x30')](_0x50012[_0xa7fa('0x2c')],_0x50012[_0xa7fa('0x2e')]);_0x4fd6d1[_0xa7fa('0x31')]=_['intersection'](_0x50012[_0xa7fa('0x2c')],qs[_0xa7fa('0x32')](_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x32')]));_0x4fd6d1[_0xa7fa('0x31')]=_0x4fd6d1[_0xa7fa('0x31')][_0xa7fa('0x33')]?_0x4fd6d1['attributes']:_0x50012['model'];_0x4fd6d1[_0xa7fa('0x36')]=qs[_0xa7fa('0x37')](_0x46ccd1['query'][_0xa7fa('0x37')]);_0x4fd6d1['where']=qs[_0xa7fa('0x2f')](_[_0xa7fa('0x38')](_0x46ccd1[_0xa7fa('0x2e')],_0x50012[_0xa7fa('0x2f')]));if(_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x39')]){_0x4fd6d1[_0xa7fa('0x3a')]=_[_0xa7fa('0x3b')](_0x4fd6d1[_0xa7fa('0x3a')],{'$or':_[_0xa7fa('0x3c')](_0x4fd6d1[_0xa7fa('0x31')],function(_0x5cb77b){var _0x45c2ad={};_0x45c2ad[_0x5cb77b]={'$like':'%'+_0x46ccd1['query'][_0xa7fa('0x39')]+'%'};return _0x45c2ad;})});}_0x4fd6d1=_[_0xa7fa('0x3b')]({},_0x4fd6d1,_0x46ccd1['options']);return _0x398810[_0xa7fa('0x52')](_0x4fd6d1);}})[_0xa7fa('0x23')](function(_0x3af3e5){if(_0x3af3e5){_0x9278dc=_0x3af3e5[_0xa7fa('0x33')];if(!_0x46ccd1[_0xa7fa('0x2e')]['hasOwnProperty'](_0xa7fa('0x35'))){_0x4fd6d1['limit']=qs[_0xa7fa('0x1c')](_0x46ccd1['query']['limit']);_0x4fd6d1[_0xa7fa('0x1a')]=qs[_0xa7fa('0x1a')](_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x1a')]);}return _0x398810[_0xa7fa('0x52')](_0x4fd6d1);}})[_0xa7fa('0x23')](function(_0x125f68){if(_0x125f68){return _0x125f68?{'count':_0x9278dc,'rows':_0x125f68}:null;}})['then'](respondWithResult(_0x385fb9,null))[_0xa7fa('0x41')](handleError(_0x385fb9,null));}; \ No newline at end of file +var _0x9146=['undefined','limit','count','Content-Range','apply','reject','then','UserProfileResource','destroy','sendStatus','name','send','index','CmCompany','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x9146,0x179));var _0x6914=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x9146[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0x6914('0x0'));var rimraf=require(_0x6914('0x1'));var zipdir=require(_0x6914('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6914('0x3'));var moment=require(_0x6914('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6914('0x5'));var util=require(_0x6914('0x6'));var path=require(_0x6914('0x7'));var sox=require(_0x6914('0x8'));var csv=require(_0x6914('0x9'));var ejs=require(_0x6914('0xa'));var fs=require('fs');var fs_extra=require(_0x6914('0xb'));var _=require('lodash');var squel=require(_0x6914('0xc'));var crypto=require('crypto');var jsforce=require(_0x6914('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6914('0x9'));var querystring=require(_0x6914('0xe'));var Papa=require(_0x6914('0xf'));var Redis=require('ioredis');var authService=require(_0x6914('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6914('0x11'));var hardwareService=require(_0x6914('0x12'));var logger=require(_0x6914('0x13'))(_0x6914('0x14'));var utils=require(_0x6914('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6914('0x16'));var db=require(_0x6914('0x17'))['db'];function respondWithStatusCode(_0x4969ba,_0x61e47c){_0x61e47c=_0x61e47c||0xcc;return function(_0x4cc123){if(_0x4cc123){return _0x4969ba['sendStatus'](_0x61e47c);}return _0x4969ba[_0x6914('0x18')](_0x61e47c)[_0x6914('0x19')]();};}function respondWithResult(_0x563758,_0x7496d0){_0x7496d0=_0x7496d0||0xc8;return function(_0x2dcf53){if(_0x2dcf53){return _0x563758[_0x6914('0x18')](_0x7496d0)[_0x6914('0x1a')](_0x2dcf53);}};}function respondWithFilteredResult(_0xc15581,_0x3e6168){return function(_0x39ba4c){if(_0x39ba4c){var _0xeb4e00=typeof _0x3e6168[_0x6914('0x1b')]===_0x6914('0x1c')&&typeof _0x3e6168[_0x6914('0x1d')]==='undefined';var _0x5be42e=_0x39ba4c['count'];var _0x47d62b=_0xeb4e00?0x0:_0x3e6168[_0x6914('0x1b')];var _0x4da9f1=_0xeb4e00?_0x39ba4c[_0x6914('0x1e')]:_0x3e6168['offset']+_0x3e6168[_0x6914('0x1d')];var _0x3373bf;if(_0x4da9f1>=_0x5be42e){_0x4da9f1=_0x5be42e;_0x3373bf=0xc8;}else{_0x3373bf=0xce;}_0xc15581[_0x6914('0x18')](_0x3373bf);return _0xc15581['set'](_0x6914('0x1f'),_0x47d62b+'-'+_0x4da9f1+'/'+_0x5be42e)[_0x6914('0x1a')](_0x39ba4c);}return null;};}function patchUpdates(_0x579654){return function(_0x46af94){try{jsonpatch[_0x6914('0x20')](_0x46af94,_0x579654,!![]);}catch(_0x59b6d5){return BPromise[_0x6914('0x21')](_0x59b6d5);}return _0x46af94['save']();};}function saveUpdates(_0x1b9209,_0x305815){return function(_0x32ecb4){if(_0x32ecb4){return _0x32ecb4['update'](_0x1b9209)[_0x6914('0x22')](function(_0x300540){return _0x300540;});}return null;};}function removeEntity(_0x4c942f,_0x1396e3){return function(_0x11bf02){if(_0x11bf02){return _0x11bf02['destroy']()['then'](function(){var _0x41abb1=_0x11bf02['get']({'plain':!![]});var _0x4f3fcb='Companies';return db[_0x6914('0x23')][_0x6914('0x24')]({'where':{'type':_0x4f3fcb,'resourceId':_0x41abb1['id']}})[_0x6914('0x22')](function(){return _0x11bf02;});})['then'](function(){_0x4c942f['status'](0xcc)[_0x6914('0x19')]();});}};}function handleEntityNotFound(_0x19d36c,_0x4435ff){return function(_0x53c57f){if(!_0x53c57f){_0x19d36c[_0x6914('0x25')](0x194);}return _0x53c57f;};}function handleError(_0x38e7cd,_0x502309){_0x502309=_0x502309||0x1f4;return function(_0x4f2a37){logger['error'](_0x4f2a37['stack']);if(_0x4f2a37[_0x6914('0x26')]){delete _0x4f2a37['name'];}_0x38e7cd['status'](_0x502309)[_0x6914('0x27')](_0x4f2a37);};}exports[_0x6914('0x28')]=function(_0x432d78,_0x262b87){var _0x475d5b={},_0x50dd6e={},_0x4ff9ad={'count':0x0,'rows':[]};return db[_0x6914('0x29')]['describe']()[_0x6914('0x22')](function(_0x25cd6f){_0x50dd6e[_0x6914('0x2a')]=_['keys'](_0x25cd6f);_0x50dd6e[_0x6914('0x2b')]=_[_0x6914('0x2c')](_0x432d78[_0x6914('0x2b')]);_0x50dd6e[_0x6914('0x2d')]=_[_0x6914('0x2e')](_0x50dd6e['model'],_0x50dd6e[_0x6914('0x2b')]);_0x475d5b[_0x6914('0x2f')]=_['intersection'](_0x50dd6e[_0x6914('0x2a')],qs['fields'](_0x432d78[_0x6914('0x2b')][_0x6914('0x30')]));_0x475d5b[_0x6914('0x2f')]=_0x475d5b[_0x6914('0x2f')][_0x6914('0x31')]?_0x475d5b[_0x6914('0x2f')]:_0x50dd6e['model'];if(!_0x432d78['query'][_0x6914('0x32')]('nolimit')){_0x475d5b[_0x6914('0x1d')]=qs[_0x6914('0x1d')](_0x432d78[_0x6914('0x2b')][_0x6914('0x1d')]);_0x475d5b[_0x6914('0x1b')]=qs['offset'](_0x432d78[_0x6914('0x2b')]['offset']);}_0x475d5b[_0x6914('0x33')]=qs['sort'](_0x432d78[_0x6914('0x2b')][_0x6914('0x34')]);_0x475d5b[_0x6914('0x35')]=qs[_0x6914('0x2d')](_[_0x6914('0x36')](_0x432d78[_0x6914('0x2b')],_0x50dd6e[_0x6914('0x2d')]),_0x25cd6f);if(_0x432d78[_0x6914('0x2b')]['filter']){_0x475d5b[_0x6914('0x35')]=_['merge'](_0x475d5b[_0x6914('0x35')],{'$or':_[_0x6914('0x37')](_0x475d5b['attributes'],function(_0x2956e1){var _0x2f319d={};_0x2f319d[_0x2956e1]={'$like':'%'+_0x432d78['query'][_0x6914('0x38')]+'%'};return _0x2f319d;})});}_0x475d5b=_[_0x6914('0x39')]({},_0x475d5b,_0x432d78[_0x6914('0x3a')]);var _0x1cdecd={'where':_0x475d5b[_0x6914('0x35')]};return db[_0x6914('0x29')][_0x6914('0x1e')](_0x1cdecd)[_0x6914('0x22')](function(_0x2dcacc){_0x4ff9ad[_0x6914('0x1e')]=_0x2dcacc;if(_0x432d78[_0x6914('0x2b')][_0x6914('0x3b')]){_0x475d5b[_0x6914('0x3c')]=[{'all':!![]}];}return db[_0x6914('0x29')][_0x6914('0x3d')](_0x475d5b);})['then'](function(_0x3dc17d){_0x4ff9ad[_0x6914('0x3e')]=_0x3dc17d;return _0x4ff9ad;})['then'](respondWithFilteredResult(_0x262b87,_0x475d5b))['catch'](handleError(_0x262b87,null));})[_0x6914('0x3f')](handleError(_0x262b87,null));};exports[_0x6914('0x40')]=function(_0x1e60f4,_0x4abf3e){var _0x28e1a6={'raw':![],'where':{'id':_0x1e60f4[_0x6914('0x41')]['id']}},_0x5005a3={};_0x5005a3[_0x6914('0x2a')]=_[_0x6914('0x2c')](db[_0x6914('0x29')][_0x6914('0x42')]);_0x5005a3['query']=_[_0x6914('0x2c')](_0x1e60f4[_0x6914('0x2b')]);_0x5005a3[_0x6914('0x2d')]=_[_0x6914('0x2e')](_0x5005a3[_0x6914('0x2a')],_0x5005a3[_0x6914('0x2b')]);_0x28e1a6[_0x6914('0x2f')]=_[_0x6914('0x2e')](_0x5005a3[_0x6914('0x2a')],qs[_0x6914('0x30')](_0x1e60f4[_0x6914('0x2b')][_0x6914('0x30')]));_0x28e1a6[_0x6914('0x2f')]=_0x28e1a6[_0x6914('0x2f')][_0x6914('0x31')]?_0x28e1a6[_0x6914('0x2f')]:_0x5005a3[_0x6914('0x2a')];if(_0x1e60f4[_0x6914('0x2b')]['includeAll']){_0x28e1a6[_0x6914('0x3c')]=[{'all':!![]}];}_0x28e1a6=_['merge']({},_0x28e1a6,_0x1e60f4[_0x6914('0x3a')]);return db[_0x6914('0x29')][_0x6914('0x43')](_0x28e1a6)[_0x6914('0x22')](handleEntityNotFound(_0x4abf3e,null))['then'](respondWithResult(_0x4abf3e,null))[_0x6914('0x3f')](handleError(_0x4abf3e,null));};exports[_0x6914('0x44')]=function(_0x3e721f,_0x1501ab){return db[_0x6914('0x29')]['create'](_0x3e721f['body'],{})[_0x6914('0x22')](function(_0x4ad95b){var _0x5dca70=_0x3e721f[_0x6914('0x45')][_0x6914('0x46')]({'plain':!![]});if(!_0x5dca70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dca70[_0x6914('0x47')]===_0x6914('0x45')){var _0x2eafd2=_0x4ad95b[_0x6914('0x46')]({'plain':!![]});var _0x19482a='Companies';return db['UserProfileSection'][_0x6914('0x43')]({'where':{'name':_0x19482a,'userProfileId':_0x5dca70['userProfileId']},'raw':!![]})[_0x6914('0x22')](function(_0xe4202a){if(_0xe4202a&&_0xe4202a['autoAssociation']===0x0){return db['UserProfileResource'][_0x6914('0x44')]({'name':_0x2eafd2[_0x6914('0x26')],'resourceId':_0x2eafd2['id'],'type':_0xe4202a[_0x6914('0x26')],'sectionId':_0xe4202a['id']},{})[_0x6914('0x22')](function(){return _0x4ad95b;});}else{return _0x4ad95b;}})[_0x6914('0x3f')](function(_0x475768){logger['error'](_0x6914('0x48'),_0x475768);throw _0x475768;});}return _0x4ad95b;})[_0x6914('0x22')](respondWithResult(_0x1501ab,0xc9))[_0x6914('0x3f')](handleError(_0x1501ab,null));};exports['update']=function(_0x2edf2d,_0x399ca4){if(_0x2edf2d[_0x6914('0x49')]['id']){delete _0x2edf2d[_0x6914('0x49')]['id'];}return db[_0x6914('0x29')][_0x6914('0x43')]({'where':{'id':_0x2edf2d[_0x6914('0x41')]['id']}})['then'](handleEntityNotFound(_0x399ca4,null))[_0x6914('0x22')](saveUpdates(_0x2edf2d[_0x6914('0x49')],null))['then'](respondWithResult(_0x399ca4,null))[_0x6914('0x3f')](handleError(_0x399ca4,null));};exports[_0x6914('0x24')]=function(_0x2ee0d2,_0x3a6b32){return db['CmCompany'][_0x6914('0x43')]({'where':{'id':_0x2ee0d2[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0x3a6b32,null))['then'](removeEntity(_0x3a6b32,null))[_0x6914('0x3f')](handleError(_0x3a6b32,null));};exports['describe']=function(_0x1a67c5,_0x29045f){return db[_0x6914('0x29')][_0x6914('0x4a')]()[_0x6914('0x22')](respondWithResult(_0x29045f,null))[_0x6914('0x3f')](handleError(_0x29045f,null));};exports[_0x6914('0x4b')]=function(_0x5020df,_0xceedf3,_0x32a286){return db['CmContact'][_0x6914('0x43')]({'where':{'id':_0x5020df[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0xceedf3,null))[_0x6914('0x22')](function(_0x2006c4){if(_0x2006c4){return _0x2006c4[_0x6914('0x4b')](_0x5020df[_0x6914('0x49')][_0x6914('0x4c')],_['omit'](_0x5020df[_0x6914('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0xceedf3,null))[_0x6914('0x3f')](handleError(_0xceedf3,null));};exports[_0x6914('0x4d')]=function(_0x337ee4,_0x5edd00,_0x2b090f){var _0x654db9={};var _0x4c43f7={};var _0x6af79c;var _0x1a239a;return db[_0x6914('0x29')][_0x6914('0x4e')]({'where':{'id':_0x337ee4[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0x5edd00,null))['then'](function(_0x169014){if(_0x169014){_0x6af79c=_0x169014;_0x4c43f7['model']=_['keys'](db[_0x6914('0x4f')][_0x6914('0x42')]);_0x4c43f7[_0x6914('0x2b')]=_[_0x6914('0x2c')](_0x337ee4['query']);_0x4c43f7[_0x6914('0x2d')]=_['intersection'](_0x4c43f7[_0x6914('0x2a')],_0x4c43f7[_0x6914('0x2b')]);_0x654db9[_0x6914('0x2f')]=_[_0x6914('0x2e')](_0x4c43f7[_0x6914('0x2a')],qs[_0x6914('0x30')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x30')]));_0x654db9[_0x6914('0x2f')]=_0x654db9['attributes'][_0x6914('0x31')]?_0x654db9['attributes']:_0x4c43f7['model'];_0x654db9['order']=qs['sort'](_0x337ee4['query'][_0x6914('0x34')]);_0x654db9[_0x6914('0x35')]=qs[_0x6914('0x2d')](_[_0x6914('0x36')](_0x337ee4[_0x6914('0x2b')],_0x4c43f7[_0x6914('0x2d')]));if(_0x337ee4[_0x6914('0x2b')][_0x6914('0x38')]){_0x654db9[_0x6914('0x35')]=_[_0x6914('0x39')](_0x654db9[_0x6914('0x35')],{'$or':_[_0x6914('0x37')](_0x654db9[_0x6914('0x2f')],function(_0x2f8e66){var _0x8dddfb={};_0x8dddfb[_0x2f8e66]={'$like':'%'+_0x337ee4[_0x6914('0x2b')][_0x6914('0x38')]+'%'};return _0x8dddfb;})});}_0x654db9=_[_0x6914('0x39')]({},_0x654db9,_0x337ee4['options']);return _0x6af79c['getContacts'](_0x654db9);}})[_0x6914('0x22')](function(_0x43b399){if(_0x43b399){_0x1a239a=_0x43b399[_0x6914('0x31')];if(!_0x337ee4[_0x6914('0x2b')][_0x6914('0x32')](_0x6914('0x50'))){_0x654db9[_0x6914('0x1d')]=qs[_0x6914('0x1d')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x1d')]);_0x654db9['offset']=qs[_0x6914('0x1b')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x1b')]);}return _0x6af79c[_0x6914('0x4d')](_0x654db9);}})['then'](function(_0x11a134){if(_0x11a134){return _0x11a134?{'count':_0x1a239a,'rows':_0x11a134}:null;}})[_0x6914('0x22')](respondWithResult(_0x5edd00,null))[_0x6914('0x3f')](handleError(_0x5edd00,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index cb93106..de0badd 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 _0xdf66=['./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x1fe140,_0x19263c){var _0x59877c=function(_0x89f57e){while(--_0x89f57e){_0x1fe140['push'](_0x1fe140['shift']());}};_0x59877c(++_0x19263c);}(_0xdf66,0xa0));var _0x6df6=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0xdf66[_0x27125a];return _0x391f7a;};'use strict';var _=require(_0x6df6('0x0'));var util=require(_0x6df6('0x1'));var logger=require(_0x6df6('0x2'))(_0x6df6('0x3'));var moment=require(_0x6df6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6df6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6df6('0x6'));var config=require(_0x6df6('0x7'));var attributes=require(_0x6df6('0x8'));module[_0x6df6('0x9')]=function(_0x3b121f,_0x5424b6){return _0x3b121f[_0x6df6('0xa')]('CmCompany',attributes,{'tableName':_0x6df6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01cd=['cm_companies','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x34b87e,_0x565dbc){var _0x19b1f8=function(_0x371c47){while(--_0x371c47){_0x34b87e['push'](_0x34b87e['shift']());}};_0x19b1f8(++_0x565dbc);}(_0x01cd,0x109));var _0xd01c=function(_0x54a709,_0x58f79b){_0x54a709=_0x54a709-0x0;var _0x100251=_0x01cd[_0x54a709];return _0x100251;};'use strict';var _=require(_0xd01c('0x0'));var util=require(_0xd01c('0x1'));var logger=require(_0xd01c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd01c('0x3'));var rp=require(_0xd01c('0x4'));var fs=require('fs');var path=require(_0xd01c('0x5'));var rimraf=require(_0xd01c('0x6'));var config=require(_0xd01c('0x7'));var attributes=require(_0xd01c('0x8'));module['exports']=function(_0x2d4d31,_0x213b75){return _0x2d4d31[_0xd01c('0x9')](_0xd01c('0xa'),attributes,{'tableName':_0xd01c('0xb'),'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 84025a8..4758c69 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 _0xed3a=['client','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b1605,_0xbcbab){var _0x4861c0=function(_0x3e0445){while(--_0x3e0445){_0x2b1605['push'](_0x2b1605['shift']());}};_0x4861c0(++_0xbcbab);}(_0xed3a,0xb6));var _0xaed3=function(_0x831910,_0x1c5de3){_0x831910=_0x831910-0x0;var _0x35e93c=_0xed3a[_0x831910];return _0x35e93c;};'use strict';var _=require(_0xaed3('0x0'));var util=require(_0xaed3('0x1'));var moment=require(_0xaed3('0x2'));var BPromise=require(_0xaed3('0x3'));var rs=require(_0xaed3('0x4'));var fs=require('fs');var Redis=require(_0xaed3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaed3('0x6'));var logger=require(_0xaed3('0x7'))(_0xaed3('0x8'));var config=require(_0xaed3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaed3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf3c10,_0x40479b,_0x2d3685){return new BPromise(function(_0x5428f1,_0x28c7a9){return client[_0xaed3('0xb')](_0xaf3c10,_0x2d3685)[_0xaed3('0xc')](function(_0x1c6de2){logger[_0xaed3('0xd')](_0xaed3('0xe'),_0x40479b,'request\x20sent');logger[_0xaed3('0xf')](_0xaed3('0x10'),_0x40479b,_0xaed3('0x11'),JSON[_0xaed3('0x12')](_0x1c6de2));if(_0x1c6de2[_0xaed3('0x13')]){if(_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x14')]===0x1f4){logger[_0xaed3('0x13')]('CmCompany,\x20%s,\x20%s',_0x40479b,_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);return _0x28c7a9(_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);}logger[_0xaed3('0x13')](_0xaed3('0xe'),_0x40479b,_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);return _0x5428f1(_0x1c6de2['error']['message']);}else{logger[_0xaed3('0xd')]('CmCompany,\x20%s,\x20%s',_0x40479b,'request\x20sent');_0x5428f1(_0x1c6de2[_0xaed3('0x16')][_0xaed3('0x15')]);}})[_0xaed3('0x17')](function(_0x54651c){logger['error'](_0xaed3('0xe'),_0x40479b,_0x54651c);_0x28c7a9(_0x54651c);});});} \ No newline at end of file +var _0xedc3=['code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x282780,_0x49c2d3){var _0x3f8c44=function(_0x534f3d){while(--_0x534f3d){_0x282780['push'](_0x282780['shift']());}};_0x3f8c44(++_0x49c2d3);}(_0xedc3,0x1bd));var _0x3edc=function(_0x2a2670,_0x73baa3){_0x2a2670=_0x2a2670-0x0;var _0x304d6f=_0xedc3[_0x2a2670];return _0x304d6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3edc('0x0'));var rs=require(_0x3edc('0x1'));var fs=require('fs');var Redis=require(_0x3edc('0x2'));var db=require(_0x3edc('0x3'))['db'];var utils=require(_0x3edc('0x4'));var logger=require(_0x3edc('0x5'))('rpc');var config=require(_0x3edc('0x6'));var jayson=require(_0x3edc('0x7'));var client=jayson['client'][_0x3edc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40dcee,_0xf3e4b6,_0x531dd2){return new BPromise(function(_0x4bb2b5,_0x402e3b){return client[_0x3edc('0x9')](_0x40dcee,_0x531dd2)['then'](function(_0x196687){logger[_0x3edc('0xa')](_0x3edc('0xb'),_0xf3e4b6,_0x3edc('0xc'));logger[_0x3edc('0xd')](_0x3edc('0xe'),_0xf3e4b6,_0x3edc('0xc'),JSON[_0x3edc('0xf')](_0x196687));if(_0x196687['error']){if(_0x196687[_0x3edc('0x10')][_0x3edc('0x11')]===0x1f4){logger['error'](_0x3edc('0xb'),_0xf3e4b6,_0x196687[_0x3edc('0x10')]['message']);return _0x402e3b(_0x196687['error'][_0x3edc('0x12')]);}logger[_0x3edc('0x10')](_0x3edc('0xb'),_0xf3e4b6,_0x196687[_0x3edc('0x10')][_0x3edc('0x12')]);return _0x4bb2b5(_0x196687[_0x3edc('0x10')]['message']);}else{logger[_0x3edc('0xa')](_0x3edc('0xb'),_0xf3e4b6,_0x3edc('0xc'));_0x4bb2b5(_0x196687[_0x3edc('0x13')][_0x3edc('0x12')]);}})[_0x3edc('0x14')](function(_0x2b138d){logger['error'](_0x3edc('0xb'),_0xf3e4b6,_0x2b138d);_0x402e3b(_0x2b138d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d2fc800..32bb453 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 _0xaa71=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/:id','/:id/contacts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa71,0x1e6));var _0x1aa7=function(_0xe717cd,_0x3f2654){_0xe717cd=_0xe717cd-0x0;var _0x5a3776=_0xaa71[_0xe717cd];return _0x5a3776;};'use strict';var multer=require(_0x1aa7('0x0'));var util=require(_0x1aa7('0x1'));var path=require(_0x1aa7('0x2'));var timeout=require(_0x1aa7('0x3'));var express=require(_0x1aa7('0x4'));var router=express['Router']();var fs_extra=require(_0x1aa7('0x5'));var auth=require(_0x1aa7('0x6'));var interaction=require(_0x1aa7('0x7'));var config=require('../../config/environment');var controller=require(_0x1aa7('0x8'));router[_0x1aa7('0x9')]('/',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0xb')]);router[_0x1aa7('0x9')]('/describe',auth[_0x1aa7('0xa')](),controller['describe']);router['get'](_0x1aa7('0xc'),auth[_0x1aa7('0xa')](),controller['show']);router[_0x1aa7('0x9')](_0x1aa7('0xd'),auth[_0x1aa7('0xa')](),controller['getContacts']);router[_0x1aa7('0xe')]('/',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0xf')]);router[_0x1aa7('0xe')](_0x1aa7('0xd'),auth[_0x1aa7('0xa')](),controller['addContacts']);router[_0x1aa7('0x10')](_0x1aa7('0xc'),auth['isAuthenticated'](),controller[_0x1aa7('0x11')]);router['delete']('/:id',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0x12')]);module[_0x1aa7('0x13')]=router; \ No newline at end of file +var _0x0243=['/describe','isAuthenticated','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3e1b10,_0xf07e4f){var _0x20247a=function(_0x4b4d16){while(--_0x4b4d16){_0x3e1b10['push'](_0x3e1b10['shift']());}};_0x20247a(++_0xf07e4f);}(_0x0243,0x17c));var _0x3024=function(_0x30b4cb,_0x100ec7){_0x30b4cb=_0x30b4cb-0x0;var _0x57e060=_0x0243[_0x30b4cb];return _0x57e060;};'use strict';var multer=require(_0x3024('0x0'));var util=require(_0x3024('0x1'));var path=require(_0x3024('0x2'));var timeout=require(_0x3024('0x3'));var express=require(_0x3024('0x4'));var router=express[_0x3024('0x5')]();var fs_extra=require(_0x3024('0x6'));var auth=require(_0x3024('0x7'));var interaction=require(_0x3024('0x8'));var config=require(_0x3024('0x9'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3024('0xa')](_0x3024('0xb'),auth[_0x3024('0xc')](),controller['describe']);router['get'](_0x3024('0xd'),auth[_0x3024('0xc')](),controller[_0x3024('0xe')]);router['get']('/:id/contacts',auth[_0x3024('0xc')](),controller[_0x3024('0xf')]);router[_0x3024('0x10')]('/',auth[_0x3024('0xc')](),controller[_0x3024('0x11')]);router['post'](_0x3024('0x12'),auth[_0x3024('0xc')](),controller[_0x3024('0x13')]);router[_0x3024('0x14')](_0x3024('0xd'),auth[_0x3024('0xc')](),controller['update']);router['delete'](_0x3024('0xd'),auth[_0x3024('0xc')](),controller[_0x3024('0x15')]);module[_0x3024('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 40079d9..6bfcfb3 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 _0x2191=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x3345b7,_0x37e5fe){var _0x21340f=function(_0xd2c2f1){while(--_0xd2c2f1){_0x3345b7['push'](_0x3345b7['shift']());}};_0x21340f(++_0x37e5fe);}(_0x2191,0x1c0));var _0x1219=function(_0x478d41,_0x4ba80b){_0x478d41=_0x478d41-0x0;var _0x3a4522=_0x2191[_0x478d41];return _0x3a4522;};'use strict';var _=require(_0x1219('0x0'));var Sequelize=require(_0x1219('0x1'));module[_0x1219('0x2')]={'firstName':{'type':Sequelize[_0x1219('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1219('0x3')]},'street':{'type':Sequelize[_0x1219('0x3')]},'postalCode':{'type':Sequelize[_0x1219('0x3')]},'city':{'type':Sequelize[_0x1219('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1219('0x3')]},'description':{'type':Sequelize[_0x1219('0x4')]},'phone':{'type':Sequelize[_0x1219('0x3')]},'mobile':{'type':Sequelize[_0x1219('0x3')]},'fax':{'type':Sequelize[_0x1219('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1219('0x3')]},'facebook':{'type':Sequelize[_0x1219('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1219('0x3')]},'skype':{'type':Sequelize[_0x1219('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1219('0x3')]},'line':{'type':Sequelize[_0x1219('0x3')]},'wechat':{'type':Sequelize[_0x1219('0x3')]},'telegram':{'type':Sequelize[_0x1219('0x3')]},'UserId':{'type':Sequelize[_0x1219('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x1219('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1219('0x7')],'defaultValue':Sequelize[_0x1219('0x8')]}}; \ No newline at end of file +var _0x8ef5=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x8ef5,0x6a));var _0x58ef=function(_0x212c72,_0x3eaf34){_0x212c72=_0x212c72-0x0;var _0x40b902=_0x8ef5[_0x212c72];return _0x40b902;};'use strict';var _=require(_0x58ef('0x0'));var Sequelize=require(_0x58ef('0x1'));module[_0x58ef('0x2')]={'firstName':{'type':Sequelize[_0x58ef('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x58ef('0x3')]},'postalCode':{'type':Sequelize[_0x58ef('0x3')]},'city':{'type':Sequelize[_0x58ef('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x58ef('0x4')]},'phone':{'type':Sequelize[_0x58ef('0x3')]},'mobile':{'type':Sequelize[_0x58ef('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x58ef('0x3')]},'url':{'type':Sequelize[_0x58ef('0x3')]},'facebook':{'type':Sequelize[_0x58ef('0x3')]},'fb_data':{'type':Sequelize[_0x58ef('0x3')]},'twitter':{'type':Sequelize[_0x58ef('0x3')]},'skype':{'type':Sequelize[_0x58ef('0x3')]},'teams':{'type':Sequelize[_0x58ef('0x3')]},'viber':{'type':Sequelize[_0x58ef('0x3')]},'line':{'type':Sequelize[_0x58ef('0x3')]},'wechat':{'type':Sequelize[_0x58ef('0x3')]},'telegram':{'type':Sequelize[_0x58ef('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x58ef('0x5')](0x2)[_0x58ef('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x58ef('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 9ffac30..21109f7 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 _0x9f75=['WhatsappInteraction','WhatsappQueueReport','join','create','bulkCreate','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','CmHopper','getTags','intersection','pick','options','setTags','ids','getHoppers','rawAttributes','ContactId','include','includeAll','getHopperFinals','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','meta','binding','phone','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','destination','callerid','starttime','duration','createdAt','userDisposition','userThirdDisposition','UserId','alias','findAndCountAll','startCase','Website','Account','closedAt','note','thirdDisposition','key','fullname','browserName','customerIp','customerPort','osName','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','threadId','Interaction','Owner','flatten','sortBy','reverse','slice','moment','util','path','lodash','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','register','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','sendStatus','error','stack','name','send','index','CmContact','describe','then','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','model','query','filters','attributes','fields','nolimit','order','sort','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','start','end','hasOwnProperty','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','c.id','DESC','having','t.id\x20IN\x20?','resolve','user','role','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','c.lastName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','findAll','values','merge','body','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport'];(function(_0x10fd32,_0x24b1e0){var _0x52a409=function(_0x41691b){while(--_0x41691b){_0x10fd32['push'](_0x10fd32['shift']());}};_0x52a409(++_0x24b1e0);}(_0x9f75,0x18a));var _0x59f7=function(_0x267771,_0x5a0f06){_0x267771=_0x267771-0x0;var _0x572b63=_0x9f75[_0x267771];return _0x572b63;};'use strict';var moment=require(_0x59f7('0x0'));var BPromise=require('bluebird');var util=require(_0x59f7('0x1'));var path=require(_0x59f7('0x2'));var fs=require('fs');var _=require(_0x59f7('0x3'));var squel=require('squel');var Papa=require(_0x59f7('0x4'));var Redis=require('ioredis');var qs=require(_0x59f7('0x5'));var as=require(_0x59f7('0x6'));var logger=require(_0x59f7('0x7'))(_0x59f7('0x8'));var config=require(_0x59f7('0x9'));var db=require('../../mysqldb')['db'];config[_0x59f7('0xa')]=_['defaults'](config[_0x59f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x59f7('0xa')]));require('./cmContact.socket')[_0x59f7('0xb')](socket);function respondWithResult(_0x1d70dd,_0x2a7bff){_0x2a7bff=_0x2a7bff||0xc8;return function(_0x354216){if(_0x354216){return _0x1d70dd['status'](_0x2a7bff)[_0x59f7('0xc')](_0x354216);}};}function respondWithFilteredResult(_0x38fe16,_0x24c15c){return function(_0x1176dd){if(_0x1176dd){var _0x2fd278=typeof _0x24c15c[_0x59f7('0xd')]==='undefined'&&typeof _0x24c15c[_0x59f7('0xe')]===_0x59f7('0xf');var _0x5a3452=_0x1176dd[_0x59f7('0x10')];var _0x331a42=_0x2fd278?0x0:_0x24c15c[_0x59f7('0xd')];var _0x4006d2=_0x2fd278?_0x1176dd['count']:_0x24c15c[_0x59f7('0xd')]+_0x24c15c[_0x59f7('0xe')];var _0x36d63c;if(_0x4006d2>=_0x5a3452){_0x4006d2=_0x5a3452;_0x36d63c=0xc8;}else{_0x36d63c=0xce;}_0x38fe16[_0x59f7('0x11')](_0x36d63c);return _0x38fe16[_0x59f7('0x12')](_0x59f7('0x13'),_0x331a42+'-'+_0x4006d2+'/'+_0x5a3452)[_0x59f7('0xc')](_0x1176dd);}return null;};}function saveUpdates(_0x2f9108){return function(_0x44eca7){if(_0x44eca7){return _0x44eca7[_0x59f7('0x14')](_0x2f9108)['then'](function(_0x36719d){return _0x36719d;});}return null;};}function removeEntity(_0x2bb8f9){return function(_0x13b04b){if(_0x13b04b){return _0x13b04b[_0x59f7('0x15')]()['then'](function(){_0x2bb8f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8dfa){return function(_0x5e1110){if(!_0x5e1110){_0x1e8dfa[_0x59f7('0x16')](0x194);}return _0x5e1110;};}function handleError(_0x5b9edd,_0x516e80){_0x516e80=_0x516e80||0x1f4;return function(_0x2eb958){logger[_0x59f7('0x17')](_0x2eb958[_0x59f7('0x18')]);if(_0x2eb958[_0x59f7('0x19')]){delete _0x2eb958[_0x59f7('0x19')];}_0x5b9edd[_0x59f7('0x11')](_0x516e80)[_0x59f7('0x1a')](_0x2eb958);};}exports[_0x59f7('0x1b')]=function(_0x14fb80,_0x4a81d1){var _0x350efc={},_0x32b3a9={},_0x31e010={'count':0x0,'rows':[]};return db[_0x59f7('0x1c')][_0x59f7('0x1d')]()[_0x59f7('0x1e')](function(_0x5176b8){var _0x57c609=[];for(var _0x12de7f=0x0;_0x12de7f0x1){_0x2bcfc8['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x59f7('0x5d')](_0x3cfa53),null);}else{if(qs[_0x59f7('0x5e')](_0x3cfa53)){_0x2bcfc8['or']('c.id\x20LIKE\x20?',_0x3cfa53+'%');_0x2bcfc8['or'](_0x59f7('0x5f'),_0x3cfa53+'%');_0x2bcfc8['or'](_0x59f7('0x60'),_0x3cfa53+'%');_0x2bcfc8['or']('c.fax\x20LIKE\x20?',_0x3cfa53+'%');}else if(qs[_0x59f7('0x61')](_0x3cfa53)){_0x2bcfc8['or'](_0x59f7('0x62'),_0x3cfa53+'%');}else{_0x2bcfc8['or'](_0x59f7('0x63'),'%'+_0x3cfa53+'%');_0x2bcfc8['or'](_0x59f7('0x64'),'%'+_0x3cfa53+'%');_0x2bcfc8['or']('c.email\x20LIKE\x20?','%'+_0x3cfa53+'%');}}}}_0x3d09e2[_0x59f7('0x38')](_0x2bcfc8);_0x3d09e2[_0x59f7('0x65')]('c.id');var _0x45d8d6={'type':db[_0x59f7('0x66')][_0x59f7('0x67')][_0x59f7('0x68')],'raw':!![]};var _0xbade4f=_0x3d09e2[_0x59f7('0x69')]()[_0x59f7('0x31')](_0x59f7('0x6a'));if(_0x350efc[_0x59f7('0x2e')]){_0x350efc[_0x59f7('0x2e')]['forEach'](function(_0x338e72){_0x3d09e2['order']('c.'+_0x338e72[0x0],_0x338e72[0x1]===_0x59f7('0x6b')?![]:!![]);});}if(!_[_0x59f7('0x54')](_0x390061)){_0x3d09e2[_0x59f7('0x6c')](_0x2e5b3b);_0xbade4f[_0x59f7('0x38')](_0x59f7('0x6d'),_0x390061);}BPromise[_0x59f7('0x6e')]()[_0x59f7('0x1e')](function(){if(!_0x3b09f7)return;if(_0x14fb80[_0x59f7('0x6f')][_0x59f7('0x70')]!=='agent')return;if(!_['some'](_0x3b09f7[_0x59f7('0x3e')],[_0x59f7('0x31'),'User'])){return _0x14fb80[_0x59f7('0x6f')][_0x59f7('0x71')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4da887){if(_['isEmpty'](_0x4da887)){_0xbade4f['where'](_0x59f7('0x72'));_0x3d09e2[_0x59f7('0x38')](_0x59f7('0x72'));}else{_0xbade4f[_0x59f7('0x38')]('c.ListId\x20IN\x20?',_[_0x59f7('0x43')](_0x4da887,'id'));_0x3d09e2['where'](_0x59f7('0x56'),_[_0x59f7('0x43')](_0x4da887,'id'));}});}})['then'](function(){if(_0x14fb80[_0x59f7('0x6f')][_0x59f7('0x70')]===_0x59f7('0x73')&&!_0x3b09f7&&!_0x14fb80['query'][_0x59f7('0x55')])return[];return db[_0x59f7('0x74')][_0x59f7('0x29')](_0xbade4f['toString'](),_0x45d8d6);})[_0x59f7('0x1e')](function(_0x554619){_0x31e010[_0x59f7('0x10')]=_0x554619['length'];if(_0x31e010[_0x59f7('0x10')]===0x0)return[];return db['sequelize']['query'](_0x34f350[_0x59f7('0x75')](),_0x45d8d6)[_0x59f7('0x1e')](function(_0x53a774){_0x40b23a=_[_0x59f7('0x76')](_0x53a774,'id');_0x45d8d6=_['merge'](_0x45d8d6,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14fb80[_0x59f7('0x29')][_0x59f7('0x2c')]){_0x350efc[_0x59f7('0x2b')]['forEach'](function(_0x41fc12){_0x3d09e2[_0x59f7('0x31')]('c.'+_0x41fc12);});}else{_0x3d09e2['field'](_0x59f7('0x6a'));_0x3d09e2[_0x59f7('0x31')]('c.firstName');_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x77'));_0x3d09e2[_0x59f7('0x31')]('c.phone');_0x3d09e2[_0x59f7('0x31')]('c.mobile');_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x78'));_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x79'));_0x3d09e2['field'](_0x59f7('0x7a'));_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x7b'));_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x7c'));_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x7d'));_0x3d09e2[_0x59f7('0x31')](_0x59f7('0x7e'),'TagIds');}if(_0x350efc['limit'])_0x3d09e2[_0x59f7('0xe')](_0x350efc[_0x59f7('0xe')]);if(_0x350efc['offset'])_0x3d09e2['offset'](_0x350efc[_0x59f7('0xd')]);return db[_0x59f7('0x74')][_0x59f7('0x29')](_0x3d09e2['toString'](),_0x45d8d6);});})['then'](function(_0x492754){_0x492754[_0x59f7('0x44')](function(_0x5d0644){if(_0x5d0644[_0x59f7('0x7f')]){_0x5d0644[_0x59f7('0x80')]=[];_0x5d0644['TagIds'][_0x59f7('0x42')](',')['forEach'](function(_0x1cb1bb){_0x5d0644[_0x59f7('0x80')][_0x59f7('0x23')](_0x40b23a[_0x1cb1bb]);});}delete _0x5d0644[_0x59f7('0x7f')];});_0x31e010[_0x59f7('0x81')]=_0x492754;return _0x31e010;})[_0x59f7('0x1e')](respondWithFilteredResult(_0x4a81d1,_0x350efc));})[_0x59f7('0x82')](handleError(_0x4a81d1,null));};exports[_0x59f7('0x15')]=function(_0x188057,_0x24a589){return db['CmContact'][_0x59f7('0x3f')]({'where':{'id':_0x188057[_0x59f7('0x83')]['id']}})['then'](handleEntityNotFound(_0x24a589,null))['then'](removeEntity(_0x24a589,null))[_0x59f7('0x82')](handleError(_0x24a589,null));};exports[_0x59f7('0x1d')]=function(_0x3dee81,_0x7e896d){return db['CmContact'][_0x59f7('0x1d')]()['then'](function(_0x49e016){delete _0x49e016['tags'];for(var _0x573874=0x0;_0x573874=_0xcd9b8c){_0x129475=_0xcd9b8c;_0x1a9df9=0xc8;}else{_0x1a9df9=0xce;}_0x5b9f9b[_0xd373('0xe')](_0x1a9df9);return _0x5b9f9b[_0xd373('0x12')](_0xd373('0x13'),_0x47d6e6+'-'+_0x129475+'/'+_0xcd9b8c)[_0xd373('0x14')](_0x4579c4);}return null;};}function saveUpdates(_0x3a5316){return function(_0x263ae3){if(_0x263ae3){return _0x263ae3[_0xd373('0x15')](_0x3a5316)['then'](function(_0x1e26cf){return _0x1e26cf;});}return null;};}function removeEntity(_0x5eab00){return function(_0x460259){if(_0x460259){return _0x460259[_0xd373('0x16')]()['then'](function(){_0x5eab00[_0xd373('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d7d72){return function(_0x23fada){if(!_0x23fada){_0x4d7d72[_0xd373('0x17')](0x194);}return _0x23fada;};}function handleError(_0x167597,_0x2b47f2){_0x2b47f2=_0x2b47f2||0x1f4;return function(_0x16b147){logger[_0xd373('0x18')](_0x16b147['stack']);if(_0x16b147[_0xd373('0x19')]){delete _0x16b147[_0xd373('0x19')];}_0x167597[_0xd373('0xe')](_0x2b47f2)[_0xd373('0x1a')](_0x16b147);};}exports[_0xd373('0x1b')]=function(_0x3aa1c5,_0x4f64bd){var _0x355fca={},_0x43937d={},_0x157f81={'count':0x0,'rows':[]};return db[_0xd373('0x1c')][_0xd373('0x1d')]()[_0xd373('0x1e')](function(_0x466a03){var _0x109e4c=[];for(var _0x1ab540=0x0;_0x1ab5400x1){_0x3a6c96['or'](_0xd373('0x59'),qs['getFullTextValue'](_0x5bbe1e),null);}else{if(qs['isNumeric'](_0x5bbe1e)){_0x3a6c96['or'](_0xd373('0x5a'),_0x5bbe1e+'%');_0x3a6c96['or'](_0xd373('0x5b'),_0x5bbe1e+'%');_0x3a6c96['or'](_0xd373('0x5c'),_0x5bbe1e+'%');_0x3a6c96['or'](_0xd373('0x5d'),_0x5bbe1e+'%');}else if(qs[_0xd373('0x5e')](_0x5bbe1e)){_0x3a6c96['or']('c.email\x20LIKE\x20?',_0x5bbe1e+'%');}else{_0x3a6c96['or'](_0xd373('0x5f'),'%'+_0x5bbe1e+'%');_0x3a6c96['or'](_0xd373('0x60'),'%'+_0x5bbe1e+'%');_0x3a6c96['or'](_0xd373('0x61'),'%'+_0x5bbe1e+'%');}}}}_0x10368d[_0xd373('0x34')](_0x3a6c96);_0x10368d[_0xd373('0x62')](_0xd373('0x63'));var _0x232e87={'type':db[_0xd373('0x64')][_0xd373('0x65')][_0xd373('0x66')],'raw':!![]};var _0x1c21d2=_0x10368d[_0xd373('0x67')]()[_0xd373('0x37')](_0xd373('0x63'));if(_0x355fca[_0xd373('0x32')]){_0x355fca['order'][_0xd373('0x51')](function(_0x1f775c){_0x10368d[_0xd373('0x32')]('c.'+_0x1f775c[0x0],_0x1f775c[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd373('0x50')](_0x4e5e80)){_0x10368d['having'](_0x4e8734);_0x1c21d2[_0xd373('0x34')]('t.id\x20IN\x20?',_0x4e5e80);}BPromise[_0xd373('0x68')]()[_0xd373('0x1e')](function(){if(!_0x1146c2)return;if(_0x3aa1c5[_0xd373('0x69')][_0xd373('0x6a')]!==_0xd373('0x6b'))return;if(!_[_0xd373('0x6c')](_0x1146c2[_0xd373('0x41')],[_0xd373('0x37'),_0xd373('0x47')])){return _0x3aa1c5[_0xd373('0x69')][_0xd373('0x6d')]({'attributes':['id'],'raw':!![]})[_0xd373('0x1e')](function(_0x32871e){if(_[_0xd373('0x50')](_0x32871e)){_0x1c21d2[_0xd373('0x34')](_0xd373('0x6e'));_0x10368d[_0xd373('0x34')](_0xd373('0x6e'));}else{_0x1c21d2[_0xd373('0x34')](_0xd373('0x6f'),_[_0xd373('0x45')](_0x32871e,'id'));_0x10368d[_0xd373('0x34')](_0xd373('0x6f'),_[_0xd373('0x45')](_0x32871e,'id'));}});}})[_0xd373('0x1e')](function(){if(_0x3aa1c5[_0xd373('0x69')]['role']===_0xd373('0x6b')&&!_0x1146c2&&!_0x3aa1c5[_0xd373('0x2a')][_0xd373('0x52')])return[];return db['sequelize'][_0xd373('0x2a')](_0x1c21d2[_0xd373('0x70')](),_0x232e87);})[_0xd373('0x1e')](function(_0x1f17e5){_0x157f81[_0xd373('0x10')]=_0x1f17e5[_0xd373('0x20')];if(_0x157f81[_0xd373('0x10')]===0x0)return[];return db['sequelize'][_0xd373('0x2a')](_0x4b1080[_0xd373('0x70')](),_0x232e87)[_0xd373('0x1e')](function(_0x2213b9){_0x3b4382=_[_0xd373('0x71')](_0x2213b9,'id');_0x232e87=_[_0xd373('0x72')](_0x232e87,{'model':db[_0xd373('0x1c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3aa1c5[_0xd373('0x2a')]['fields']){_0x355fca[_0xd373('0x2d')]['forEach'](function(_0xe7679e){_0x10368d[_0xd373('0x37')]('c.'+_0xe7679e);});}else{_0x10368d[_0xd373('0x37')](_0xd373('0x63'));_0x10368d[_0xd373('0x37')](_0xd373('0x73'));_0x10368d[_0xd373('0x37')](_0xd373('0x74'));_0x10368d['field'](_0xd373('0x75'));_0x10368d['field'](_0xd373('0x76'));_0x10368d[_0xd373('0x37')](_0xd373('0x77'));_0x10368d[_0xd373('0x37')](_0xd373('0x78'));_0x10368d[_0xd373('0x37')](_0xd373('0x79'));_0x10368d['field'](_0xd373('0x7a'));_0x10368d[_0xd373('0x37')](_0xd373('0x7b'));_0x10368d['field'](_0xd373('0x7c'));_0x10368d[_0xd373('0x37')](_0xd373('0x7d'),_0xd373('0x7e'));}if(_0x355fca[_0xd373('0x11')])_0x10368d[_0xd373('0x11')](_0x355fca[_0xd373('0x11')]);if(_0x355fca[_0xd373('0xf')])_0x10368d[_0xd373('0xf')](_0x355fca[_0xd373('0xf')]);return db[_0xd373('0x7f')][_0xd373('0x2a')](_0x10368d['toString'](),_0x232e87);});})[_0xd373('0x1e')](function(_0x1002dc){_0x1002dc[_0xd373('0x51')](function(_0x506f49){if(_0x506f49[_0xd373('0x7e')]){_0x506f49[_0xd373('0x80')]=[];_0x506f49[_0xd373('0x7e')]['split'](',')[_0xd373('0x51')](function(_0x50bf70){_0x506f49[_0xd373('0x80')][_0xd373('0x23')](_0x3b4382[_0x50bf70]);});}delete _0x506f49[_0xd373('0x7e')];});_0x157f81[_0xd373('0x81')]=_0x1002dc;return _0x157f81;})['then'](respondWithFilteredResult(_0x4f64bd,_0x355fca));})[_0xd373('0x82')](handleError(_0x4f64bd,null));};exports['destroy']=function(_0x2047ca,_0x119440){return db[_0xd373('0x1c')][_0xd373('0x42')]({'where':{'id':_0x2047ca[_0xd373('0x83')]['id']}})[_0xd373('0x1e')](handleEntityNotFound(_0x119440,null))['then'](removeEntity(_0x119440,null))[_0xd373('0x82')](handleError(_0x119440,null));};exports['describe']=function(_0xd456f8,_0x59f2dd){return db['CmContact'][_0xd373('0x1d')]()[_0xd373('0x1e')](function(_0x1cff58){delete _0x1cff58[_0xd373('0x84')];for(var _0x5a5651=0x0;_0x5a5651{}\s\\|]/g,'-');_0x30f1c0(null,util[_0x3b0b('0x23')]('%s-%s%s',path[_0x3b0b('0x24')](_0x5e30b4[_0x3b0b('0x21')],path[_0x3b0b('0x25')](_0x5e30b4[_0x3b0b('0x21')])),Date[_0x3b0b('0x26')](),path[_0x3b0b('0x25')](_0x5e30b4[_0x3b0b('0x21')])));}})});router[_0x3b0b('0x18')](_0x3b0b('0x27'),upload[_0x3b0b('0x28')](_0x3b0b('0x29')),controller[_0x3b0b('0x2a')]);var upload=multer({'storage':multer[_0x3b0b('0x1e')]({'destination':function(_0x379ee2,_0xc71f49,_0x37aae8){_0x37aae8(null,path[_0x3b0b('0x2b')](config[_0x3b0b('0x1f')],'server/files/tmp'));},'filename':function(_0x5a39f8,_0xba9a26,_0x2dcee1){_0xba9a26['originalname']=_0xba9a26[_0x3b0b('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2dcee1(null,util[_0x3b0b('0x23')]('%s-%s%s',path[_0x3b0b('0x24')](_0xba9a26[_0x3b0b('0x21')],path[_0x3b0b('0x25')](_0xba9a26[_0x3b0b('0x21')])),Date[_0x3b0b('0x26')](),path[_0x3b0b('0x25')](_0xba9a26[_0x3b0b('0x21')])));}})});router[_0x3b0b('0x18')]('/upload',upload[_0x3b0b('0x28')]('file'),controller['upload']);router[_0x3b0b('0x18')]('/upload/:id',auth['isAuthenticated'](),controller[_0x3b0b('0x2c')]);router[_0x3b0b('0x2d')]('/:id',auth[_0x3b0b('0x9')](),controller[_0x3b0b('0x2e')]);router[_0x3b0b('0x2f')](_0x3b0b('0xc'),auth[_0x3b0b('0x9')](),controller[_0x3b0b('0x30')]);module[_0x3b0b('0x31')]=router; \ No newline at end of file +var _0xb734=['getHopperFinals','getJscriptySessions','post','/merge','merge','create','bulkCreate','/:id/tags','setTags','diskStorage','join','server/files/tmp','originalname','basename','now','extname','/csv','single','file','uploadCsv','root','format','%s-%s%s','/upload','upload','/upload/:id','import','put','update','destroy','exports','util','connect-timeout','Router','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x504ff3,_0x4405f8){var _0x327e1b=function(_0x2d6c9e){while(--_0x2d6c9e){_0x504ff3['push'](_0x504ff3['shift']());}};_0x327e1b(++_0x4405f8);}(_0xb734,0x1cf));var _0x4b73=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xb734[_0x4e9d3c];return _0x2d0825;};'use strict';var multer=require('multer');var util=require(_0x4b73('0x0'));var path=require('path');var timeout=require(_0x4b73('0x1'));var express=require('express');var router=express[_0x4b73('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b73('0x3'));var controller=require(_0x4b73('0x4'));router[_0x4b73('0x5')]('/',auth[_0x4b73('0x6')](),controller['index']);router[_0x4b73('0x5')](_0x4b73('0x7'),auth[_0x4b73('0x6')](),controller[_0x4b73('0x8')]);router[_0x4b73('0x5')](_0x4b73('0x9'),auth[_0x4b73('0x6')](),controller[_0x4b73('0xa')]);router['get']('/:id/tags',auth[_0x4b73('0x6')](),controller[_0x4b73('0xb')]);router[_0x4b73('0x5')](_0x4b73('0xc'),auth['isAuthenticated'](),controller[_0x4b73('0xd')]);router[_0x4b73('0x5')](_0x4b73('0xe'),auth[_0x4b73('0x6')](),controller[_0x4b73('0xf')]);router[_0x4b73('0x5')](_0x4b73('0x10'),auth[_0x4b73('0x6')](),controller[_0x4b73('0x11')]);router[_0x4b73('0x5')]('/:id/jscripty_sessions',auth[_0x4b73('0x6')](),controller[_0x4b73('0x12')]);router[_0x4b73('0x5')]('/:id/journey',auth['isAuthenticated'](),controller['getJourney']);router[_0x4b73('0x13')](_0x4b73('0x14'),auth['isAuthenticated'](),controller[_0x4b73('0x15')]);router[_0x4b73('0x13')]('/',auth[_0x4b73('0x6')](),controller[_0x4b73('0x16')]);router[_0x4b73('0x13')]('/create_many',auth[_0x4b73('0x6')](),controller[_0x4b73('0x17')]);router[_0x4b73('0x13')](_0x4b73('0x18'),auth[_0x4b73('0x6')](),controller[_0x4b73('0x19')]);var upload=multer({'storage':multer[_0x4b73('0x1a')]({'destination':function(_0x44d111,_0x52d201,_0x10a32b){_0x10a32b(null,path[_0x4b73('0x1b')](config['root'],_0x4b73('0x1c')));},'filename':function(_0x15be2c,_0x2e654b,_0x26d3ba){_0x2e654b['originalname']=_0x2e654b[_0x4b73('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x26d3ba(null,util['format']('%s-%s%s',path[_0x4b73('0x1e')](_0x2e654b[_0x4b73('0x1d')],path['extname'](_0x2e654b['originalname'])),Date[_0x4b73('0x1f')](),path[_0x4b73('0x20')](_0x2e654b[_0x4b73('0x1d')])));}})});router['post'](_0x4b73('0x21'),upload[_0x4b73('0x22')](_0x4b73('0x23')),controller[_0x4b73('0x24')]);var upload=multer({'storage':multer[_0x4b73('0x1a')]({'destination':function(_0x1995db,_0x1c4403,_0x2b3c0b){_0x2b3c0b(null,path[_0x4b73('0x1b')](config[_0x4b73('0x25')],_0x4b73('0x1c')));},'filename':function(_0xd70fb1,_0x334bcd,_0x1a60d9){_0x334bcd[_0x4b73('0x1d')]=_0x334bcd[_0x4b73('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a60d9(null,util[_0x4b73('0x26')](_0x4b73('0x27'),path['basename'](_0x334bcd[_0x4b73('0x1d')],path[_0x4b73('0x20')](_0x334bcd[_0x4b73('0x1d')])),Date[_0x4b73('0x1f')](),path[_0x4b73('0x20')](_0x334bcd['originalname'])));}})});router['post'](_0x4b73('0x28'),upload['single'](_0x4b73('0x23')),controller[_0x4b73('0x29')]);router[_0x4b73('0x13')](_0x4b73('0x2a'),auth[_0x4b73('0x6')](),controller[_0x4b73('0x2b')]);router[_0x4b73('0x2c')]('/:id',auth[_0x4b73('0x6')](),controller[_0x4b73('0x2d')]);router['delete'](_0x4b73('0x9'),auth['isAuthenticated'](),controller[_0x4b73('0x2e')]);module[_0x4b73('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c43c799..77fd5aa 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 _0x37e3=['voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','values','stringify','ENUM'];(function(_0x36c285,_0x21ed4f){var _0x3e52b3=function(_0x508670){while(--_0x508670){_0x36c285['push'](_0x36c285['shift']());}};_0x3e52b3(++_0x21ed4f);}(_0x37e3,0x100));var _0x337e=function(_0x3df168,_0x550cc3){_0x3df168=_0x3df168-0x0;var _0x5252aa=_0x37e3[_0x3df168];return _0x5252aa;};'use strict';var Sequelize=require(_0x337e('0x0'));var _=require(_0x337e('0x1'));module[_0x337e('0x2')]={'name':{'type':Sequelize[_0x337e('0x3')],'get':function(_0x41a8cb){return this[_0x337e('0x4')](_0x337e('0x5'));}},'alias':{'type':Sequelize[_0x337e('0x6')],'allowNull':![],'set':function(_0x5939c4){this[_0x337e('0x7')](_0x337e('0x5'),_0x5939c4?_0x5939c4:this['getDataValue'](_0x337e('0x8')));}},'type':{'type':Sequelize[_0x337e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x337e('0x9')](_0x337e('0xa')),'get':function(){if(this[_0x337e('0x4')](_0x337e('0xb'))===_0x337e('0xc')){return JSON['parse'](this['getDataValue'](_0x337e('0xd')));}else{return this['getDataValue'](_0x337e('0xd'));}},'set':function(_0x187ab6){if(Array['isArray'](_0x187ab6)){this['setDataValue'](_0x337e('0xd'),JSON[_0x337e('0xe')](_0x187ab6));}else{this['setDataValue'](_0x337e('0xd'),_0x187ab6);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x337e('0xf')](_0x337e('0x10'))}}; \ No newline at end of file +var _0x6f92=['select','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','getDataValue','setDataValue','alias','name','STRING','TEXT'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6f92,0x18d));var _0x26f9=function(_0x3adfc2,_0x5b4f62){_0x3adfc2=_0x3adfc2-0x0;var _0x30d26e=_0x6f92[_0x3adfc2];return _0x30d26e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x26f9('0x0'));module[_0x26f9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a0191){return this[_0x26f9('0x2')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x260a07){this[_0x26f9('0x3')](_0x26f9('0x4'),_0x260a07?_0x260a07:this[_0x26f9('0x2')](_0x26f9('0x5')));}},'type':{'type':Sequelize[_0x26f9('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x26f9('0x7')]('long'),'get':function(){if(this[_0x26f9('0x2')]('type')===_0x26f9('0x8')){return JSON['parse'](this[_0x26f9('0x2')]('values'));}else{return this['getDataValue'](_0x26f9('0x9'));}},'set':function(_0xd551db){if(Array[_0x26f9('0xa')](_0xd551db)){this[_0x26f9('0x3')](_0x26f9('0x9'),JSON[_0x26f9('0xb')](_0xd551db));}else{this['setDataValue'](_0x26f9('0x9'),_0xd551db);}}},'required':{'type':Sequelize[_0x26f9('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x26f9('0xd')](_0x26f9('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 7b073b9..5123c8f 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 _0x94ee=['type','key','model','name','query','keys','filters','intersection','fields','attributes','order','sort','where','merge','filter','options','includeAll','rows','catch','show','params','length','include','find','create','sequelize','body','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','send','index','map','CmCustomField','rawAttributes','fieldName'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x94ee,0x11d));var _0xe94e=function(_0x1b5aeb,_0x44ac4f){_0x1b5aeb=_0x1b5aeb-0x0;var _0x1c3542=_0x94ee[_0x1b5aeb];return _0x1c3542;};'use strict';var emlformat=require(_0xe94e('0x0'));var rimraf=require(_0xe94e('0x1'));var zipdir=require(_0xe94e('0x2'));var jsonpatch=require(_0xe94e('0x3'));var rp=require(_0xe94e('0x4'));var moment=require('moment');var BPromise=require(_0xe94e('0x5'));var Mustache=require('mustache');var util=require(_0xe94e('0x6'));var path=require(_0xe94e('0x7'));var sox=require(_0xe94e('0x8'));var csv=require(_0xe94e('0x9'));var ejs=require(_0xe94e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe94e('0xb'));var crypto=require(_0xe94e('0xc'));var jsforce=require(_0xe94e('0xd'));var deskjs=require(_0xe94e('0xe'));var toCsv=require(_0xe94e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe94e('0xf'));var authService=require(_0xe94e('0x10'));var qs=require(_0xe94e('0x11'));var as=require(_0xe94e('0x12'));var hardwareService=require(_0xe94e('0x13'));var logger=require('../../config/logger')(_0xe94e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe94e('0x15'));var db=require(_0xe94e('0x16'))['db'];function respondWithStatusCode(_0x142025,_0x4808b9){_0x4808b9=_0x4808b9||0xcc;return function(_0x17c122){if(_0x17c122){return _0x142025[_0xe94e('0x17')](_0x4808b9);}return _0x142025[_0xe94e('0x18')](_0x4808b9)['end']();};}function respondWithResult(_0x1b0fd0,_0x469e70){_0x469e70=_0x469e70||0xc8;return function(_0x1563fd){if(_0x1563fd){return _0x1b0fd0[_0xe94e('0x18')](_0x469e70)[_0xe94e('0x19')](_0x1563fd);}};}function respondWithFilteredResult(_0x18bd91,_0x2bab00){return function(_0x1be477){if(_0x1be477){var _0x264e38=typeof _0x2bab00[_0xe94e('0x1a')]===_0xe94e('0x1b')&&typeof _0x2bab00[_0xe94e('0x1c')]===_0xe94e('0x1b');var _0x28a54e=_0x1be477[_0xe94e('0x1d')];var _0x2bfc4a=_0x264e38?0x0:_0x2bab00[_0xe94e('0x1a')];var _0x2cf923=_0x264e38?_0x1be477[_0xe94e('0x1d')]:_0x2bab00['offset']+_0x2bab00[_0xe94e('0x1c')];var _0x22e7a3;if(_0x2cf923>=_0x28a54e){_0x2cf923=_0x28a54e;_0x22e7a3=0xc8;}else{_0x22e7a3=0xce;}_0x18bd91[_0xe94e('0x18')](_0x22e7a3);return _0x18bd91['set'](_0xe94e('0x1e'),_0x2bfc4a+'-'+_0x2cf923+'/'+_0x28a54e)[_0xe94e('0x19')](_0x1be477);}return null;};}function patchUpdates(_0xcf1c61){return function(_0x5d15d6){try{jsonpatch[_0xe94e('0x1f')](_0x5d15d6,_0xcf1c61,!![]);}catch(_0x178846){return BPromise[_0xe94e('0x20')](_0x178846);}return _0x5d15d6[_0xe94e('0x21')]();};}function saveUpdates(_0x3b371b,_0xb8ca2a){return function(_0x3b01c4){if(_0x3b01c4){return _0x3b01c4[_0xe94e('0x22')](_0x3b371b)['then'](function(_0x2853ae){return _0x2853ae;});}return null;};}function removeEntity(_0x4a5162,_0x174b9d){return function(_0x346359){if(_0x346359){return _0x346359[_0xe94e('0x23')]()[_0xe94e('0x24')](function(){_0x4a5162[_0xe94e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af57b,_0x7bd2b){return function(_0x543d14){if(!_0x543d14){_0x4af57b[_0xe94e('0x17')](0x194);}return _0x543d14;};}function handleError(_0x1cb139,_0x205105){_0x205105=_0x205105||0x1f4;return function(_0x495a8b){logger['error'](_0x495a8b['stack']);if(_0x495a8b['name']){delete _0x495a8b['name'];}_0x1cb139[_0xe94e('0x18')](_0x205105)[_0xe94e('0x25')](_0x495a8b);};}exports[_0xe94e('0x26')]=function(_0x5b3f68,_0x45c512){var _0x5c4b7e={},_0x5701dd={},_0x3b3da0={'count':0x0,'rows':[]};var _0x3527ab=_[_0xe94e('0x27')](db[_0xe94e('0x28')][_0xe94e('0x29')],function(_0x592f64){return{'name':_0x592f64[_0xe94e('0x2a')],'type':_0x592f64[_0xe94e('0x2b')][_0xe94e('0x2c')]};});_0x5701dd[_0xe94e('0x2d')]=_['differenceBy'](_['map'](_0x3527ab,'name'),[_0xe94e('0x2e')]);_0x5701dd[_0xe94e('0x2f')]=_[_0xe94e('0x30')](_0x5b3f68[_0xe94e('0x2f')]);_0x5701dd[_0xe94e('0x31')]=_[_0xe94e('0x32')](_0x5701dd[_0xe94e('0x2d')],_0x5701dd['query']);_0x5c4b7e['attributes']=_[_0xe94e('0x32')](_0x5701dd['model'],qs[_0xe94e('0x33')](_0x5b3f68['query'][_0xe94e('0x33')]));_0x5c4b7e[_0xe94e('0x34')]=_0x5c4b7e[_0xe94e('0x34')]['length']?_0x5c4b7e['attributes']:_0x5701dd['model'];if(!_0x5b3f68['query']['hasOwnProperty']('nolimit')){_0x5c4b7e[_0xe94e('0x1c')]=qs['limit'](_0x5b3f68['query'][_0xe94e('0x1c')]);_0x5c4b7e[_0xe94e('0x1a')]=qs[_0xe94e('0x1a')](_0x5b3f68['query'][_0xe94e('0x1a')]);}_0x5c4b7e[_0xe94e('0x35')]=qs['sort'](_0x5b3f68[_0xe94e('0x2f')][_0xe94e('0x36')]);_0x5c4b7e[_0xe94e('0x37')]=qs[_0xe94e('0x31')](_['pick'](_0x5b3f68[_0xe94e('0x2f')],_0x5701dd[_0xe94e('0x31')]),_0x3527ab);if(_0x5b3f68[_0xe94e('0x2f')]['filter']){_0x5c4b7e[_0xe94e('0x37')]=_[_0xe94e('0x38')](_0x5c4b7e['where'],{'$or':_[_0xe94e('0x27')](_0x3527ab,function(_0xc83c95){if(_0xc83c95['type']!=='VIRTUAL'){var _0xf65c89={};_0xf65c89[_0xc83c95['name']]={'$like':'%'+_0x5b3f68[_0xe94e('0x2f')][_0xe94e('0x39')]+'%'};return _0xf65c89;}})});}_0x5c4b7e=_['merge']({},_0x5c4b7e,_0x5b3f68[_0xe94e('0x3a')]);var _0x4488ea={'where':_0x5c4b7e[_0xe94e('0x37')]};return db['CmCustomField'][_0xe94e('0x1d')](_0x4488ea)[_0xe94e('0x24')](function(_0x262da7){_0x3b3da0[_0xe94e('0x1d')]=_0x262da7;if(_0x5b3f68[_0xe94e('0x2f')][_0xe94e('0x3b')]){_0x5c4b7e['include']=[{'all':!![]}];}return db[_0xe94e('0x28')]['findAll'](_0x5c4b7e);})[_0xe94e('0x24')](function(_0x36146b){_0x3b3da0[_0xe94e('0x3c')]=_0x36146b;return _0x3b3da0;})[_0xe94e('0x24')](respondWithFilteredResult(_0x45c512,_0x5c4b7e))[_0xe94e('0x3d')](handleError(_0x45c512,null));};exports[_0xe94e('0x3e')]=function(_0x4064d7,_0x3ec16b){var _0x32f601={'raw':!![],'where':{'id':_0x4064d7[_0xe94e('0x3f')]['id']}},_0x2191db={};_0x2191db[_0xe94e('0x2d')]=_[_0xe94e('0x30')](db[_0xe94e('0x28')]['rawAttributes']);_0x2191db[_0xe94e('0x2f')]=_[_0xe94e('0x30')](_0x4064d7[_0xe94e('0x2f')]);_0x2191db[_0xe94e('0x31')]=_[_0xe94e('0x32')](_0x2191db[_0xe94e('0x2d')],_0x2191db[_0xe94e('0x2f')]);_0x32f601[_0xe94e('0x34')]=_[_0xe94e('0x32')](_0x2191db[_0xe94e('0x2d')],qs[_0xe94e('0x33')](_0x4064d7['query']['fields']));_0x32f601[_0xe94e('0x34')]=_0x32f601[_0xe94e('0x34')][_0xe94e('0x40')]?_0x32f601[_0xe94e('0x34')]:_0x2191db[_0xe94e('0x2d')];if(_0x4064d7['query'][_0xe94e('0x3b')]){_0x32f601[_0xe94e('0x41')]=[{'all':!![]}];}_0x32f601=_[_0xe94e('0x38')]({},_0x32f601,_0x4064d7[_0xe94e('0x3a')]);return db['CmCustomField']['find'](_0x32f601)['then'](handleEntityNotFound(_0x3ec16b,null))[_0xe94e('0x24')](respondWithResult(_0x3ec16b,null))['catch'](handleError(_0x3ec16b,null));};exports['update']=function(_0x8c03b2,_0xaa1a05){if(_0x8c03b2['body']['id']){delete _0x8c03b2['body']['id'];}return db[_0xe94e('0x28')][_0xe94e('0x42')]({'where':{'id':_0x8c03b2[_0xe94e('0x3f')]['id']}})[_0xe94e('0x24')](handleEntityNotFound(_0xaa1a05,null))[_0xe94e('0x24')](saveUpdates(_0x8c03b2['body'],null))[_0xe94e('0x24')](respondWithResult(_0xaa1a05,null))[_0xe94e('0x3d')](handleError(_0xaa1a05,null));};exports['destroy']=function(_0xa2a741,_0x4f589b){return db[_0xe94e('0x28')][_0xe94e('0x42')]({'where':{'id':_0xa2a741[_0xe94e('0x3f')]['id']}})[_0xe94e('0x24')](handleEntityNotFound(_0x4f589b,null))[_0xe94e('0x24')](removeEntity(_0x4f589b,null))[_0xe94e('0x3d')](handleError(_0x4f589b,null));};exports[_0xe94e('0x43')]=function(_0x326143,_0x150452){var _0xe5b5ce;return db[_0xe94e('0x44')]['transaction'](function(_0x579389){return db['CmCustomField'][_0xe94e('0x43')](_0x326143[_0xe94e('0x45')],{'transaction':_0x579389})[_0xe94e('0x24')](function(_0x5ad00a){_0xe5b5ce=_0x5ad00a;var _0x1a0ab8={'type':db[_0xe94e('0x46')][_0xe94e('0x47')],'transaction':_0x579389};switch(_0x326143[_0xe94e('0x45')][_0xe94e('0x2b')]){case'text':_0x1a0ab8[_0xe94e('0x2b')]=db[_0xe94e('0x46')][_0xe94e('0x47')];break;case _0xe94e('0x48'):_0x1a0ab8[_0xe94e('0x2b')]=db[_0xe94e('0x46')][_0xe94e('0x49')];break;case _0xe94e('0x4a'):_0x1a0ab8['type']=db[_0xe94e('0x46')][_0xe94e('0x4b')];_0x1a0ab8[_0xe94e('0x4c')]=![];break;default:}return db[_0xe94e('0x44')][_0xe94e('0x4d')][_0xe94e('0x4e')](_0xe94e('0x4f'),util[_0xe94e('0x50')](_0xe94e('0x51'),_0xe5b5ce['id']),_0x1a0ab8);})[_0xe94e('0x24')](function(){return _0xe5b5ce;});})['then'](respondWithResult(_0x150452,0xc9))[_0xe94e('0x3d')](handleError(_0x150452,null));}; \ No newline at end of file +var _0x7ef6=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmCustomField','fieldName','type','differenceBy','query','keys','filters','model','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','include','findAll','catch','params','rawAttributes','intersection','includeAll','find','body','create','sequelize','transaction','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x168e88,_0x363e45){var _0x16ea9d=function(_0x468c8c){while(--_0x468c8c){_0x168e88['push'](_0x168e88['shift']());}};_0x16ea9d(++_0x363e45);}(_0x7ef6,0x158));var _0x67ef=function(_0x5cc64b,_0x35b218){_0x5cc64b=_0x5cc64b-0x0;var _0x4b4c49=_0x7ef6[_0x5cc64b];return _0x4b4c49;};'use strict';var emlformat=require(_0x67ef('0x0'));var rimraf=require(_0x67ef('0x1'));var zipdir=require(_0x67ef('0x2'));var jsonpatch=require(_0x67ef('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67ef('0x4'));var Mustache=require(_0x67ef('0x5'));var util=require('util');var path=require(_0x67ef('0x6'));var sox=require(_0x67ef('0x7'));var csv=require(_0x67ef('0x8'));var ejs=require(_0x67ef('0x9'));var fs=require('fs');var fs_extra=require(_0x67ef('0xa'));var _=require(_0x67ef('0xb'));var squel=require(_0x67ef('0xc'));var crypto=require('crypto');var jsforce=require(_0x67ef('0xd'));var deskjs=require(_0x67ef('0xe'));var toCsv=require(_0x67ef('0x8'));var querystring=require('querystring');var Papa=require(_0x67ef('0xf'));var Redis=require(_0x67ef('0x10'));var authService=require(_0x67ef('0x11'));var qs=require(_0x67ef('0x12'));var as=require(_0x67ef('0x13'));var hardwareService=require(_0x67ef('0x14'));var logger=require('../../config/logger')(_0x67ef('0x15'));var utils=require(_0x67ef('0x16'));var config=require(_0x67ef('0x17'));var licenseUtil=require(_0x67ef('0x18'));var db=require(_0x67ef('0x19'))['db'];function respondWithStatusCode(_0x467cf9,_0x2ae9b6){_0x2ae9b6=_0x2ae9b6||0xcc;return function(_0x29f7eb){if(_0x29f7eb){return _0x467cf9[_0x67ef('0x1a')](_0x2ae9b6);}return _0x467cf9[_0x67ef('0x1b')](_0x2ae9b6)[_0x67ef('0x1c')]();};}function respondWithResult(_0x580c31,_0x59f347){_0x59f347=_0x59f347||0xc8;return function(_0xef1d15){if(_0xef1d15){return _0x580c31[_0x67ef('0x1b')](_0x59f347)[_0x67ef('0x1d')](_0xef1d15);}};}function respondWithFilteredResult(_0x3ec938,_0x53efd8){return function(_0x2c0df6){if(_0x2c0df6){var _0x3aa9cf=typeof _0x53efd8[_0x67ef('0x1e')]===_0x67ef('0x1f')&&typeof _0x53efd8[_0x67ef('0x20')]==='undefined';var _0x22eb8f=_0x2c0df6[_0x67ef('0x21')];var _0x34f843=_0x3aa9cf?0x0:_0x53efd8['offset'];var _0x1ceabc=_0x3aa9cf?_0x2c0df6[_0x67ef('0x21')]:_0x53efd8['offset']+_0x53efd8['limit'];var _0x4ac886;if(_0x1ceabc>=_0x22eb8f){_0x1ceabc=_0x22eb8f;_0x4ac886=0xc8;}else{_0x4ac886=0xce;}_0x3ec938['status'](_0x4ac886);return _0x3ec938[_0x67ef('0x22')](_0x67ef('0x23'),_0x34f843+'-'+_0x1ceabc+'/'+_0x22eb8f)[_0x67ef('0x1d')](_0x2c0df6);}return null;};}function patchUpdates(_0x4c5673){return function(_0x1b12d3){try{jsonpatch[_0x67ef('0x24')](_0x1b12d3,_0x4c5673,!![]);}catch(_0x139d4d){return BPromise[_0x67ef('0x25')](_0x139d4d);}return _0x1b12d3['save']();};}function saveUpdates(_0x309195,_0x194aa5){return function(_0x33f349){if(_0x33f349){return _0x33f349[_0x67ef('0x26')](_0x309195)[_0x67ef('0x27')](function(_0x4e5ec3){return _0x4e5ec3;});}return null;};}function removeEntity(_0x18b030,_0x3e75be){return function(_0x5ed919){if(_0x5ed919){return _0x5ed919[_0x67ef('0x28')]()[_0x67ef('0x27')](function(){_0x18b030[_0x67ef('0x1b')](0xcc)[_0x67ef('0x1c')]();});}};}function handleEntityNotFound(_0x21aa6f,_0x47c6c1){return function(_0x241392){if(!_0x241392){_0x21aa6f['sendStatus'](0x194);}return _0x241392;};}function handleError(_0x4bf527,_0x2e41c6){_0x2e41c6=_0x2e41c6||0x1f4;return function(_0x132487){logger[_0x67ef('0x29')](_0x132487[_0x67ef('0x2a')]);if(_0x132487['name']){delete _0x132487[_0x67ef('0x2b')];}_0x4bf527[_0x67ef('0x1b')](_0x2e41c6)[_0x67ef('0x2c')](_0x132487);};}exports[_0x67ef('0x2d')]=function(_0x205631,_0x5a226b){var _0x1ab014={},_0x3d39f0={},_0x16d3f6={'count':0x0,'rows':[]};var _0x77c03b=_[_0x67ef('0x2e')](db[_0x67ef('0x2f')]['rawAttributes'],function(_0x56126f){return{'name':_0x56126f[_0x67ef('0x30')],'type':_0x56126f[_0x67ef('0x31')]['key']};});_0x3d39f0['model']=_[_0x67ef('0x32')](_[_0x67ef('0x2e')](_0x77c03b,'name'),[_0x67ef('0x2b')]);_0x3d39f0[_0x67ef('0x33')]=_[_0x67ef('0x34')](_0x205631[_0x67ef('0x33')]);_0x3d39f0[_0x67ef('0x35')]=_['intersection'](_0x3d39f0[_0x67ef('0x36')],_0x3d39f0[_0x67ef('0x33')]);_0x1ab014[_0x67ef('0x37')]=_['intersection'](_0x3d39f0[_0x67ef('0x36')],qs['fields'](_0x205631['query'][_0x67ef('0x38')]));_0x1ab014[_0x67ef('0x37')]=_0x1ab014['attributes'][_0x67ef('0x39')]?_0x1ab014[_0x67ef('0x37')]:_0x3d39f0['model'];if(!_0x205631['query']['hasOwnProperty'](_0x67ef('0x3a'))){_0x1ab014['limit']=qs[_0x67ef('0x20')](_0x205631[_0x67ef('0x33')][_0x67ef('0x20')]);_0x1ab014[_0x67ef('0x1e')]=qs[_0x67ef('0x1e')](_0x205631[_0x67ef('0x33')][_0x67ef('0x1e')]);}_0x1ab014[_0x67ef('0x3b')]=qs['sort'](_0x205631['query']['sort']);_0x1ab014[_0x67ef('0x3c')]=qs[_0x67ef('0x35')](_[_0x67ef('0x3d')](_0x205631[_0x67ef('0x33')],_0x3d39f0['filters']),_0x77c03b);if(_0x205631['query'][_0x67ef('0x3e')]){_0x1ab014['where']=_[_0x67ef('0x3f')](_0x1ab014['where'],{'$or':_[_0x67ef('0x2e')](_0x77c03b,function(_0x4db7a8){if(_0x4db7a8[_0x67ef('0x31')]!=='VIRTUAL'){var _0x3fb408={};_0x3fb408[_0x4db7a8[_0x67ef('0x2b')]]={'$like':'%'+_0x205631['query'][_0x67ef('0x3e')]+'%'};return _0x3fb408;}})});}_0x1ab014=_[_0x67ef('0x3f')]({},_0x1ab014,_0x205631[_0x67ef('0x40')]);var _0xbf582d={'where':_0x1ab014[_0x67ef('0x3c')]};return db[_0x67ef('0x2f')]['count'](_0xbf582d)['then'](function(_0x2a2b87){_0x16d3f6[_0x67ef('0x21')]=_0x2a2b87;if(_0x205631[_0x67ef('0x33')]['includeAll']){_0x1ab014[_0x67ef('0x41')]=[{'all':!![]}];}return db[_0x67ef('0x2f')][_0x67ef('0x42')](_0x1ab014);})['then'](function(_0x2c1081){_0x16d3f6['rows']=_0x2c1081;return _0x16d3f6;})[_0x67ef('0x27')](respondWithFilteredResult(_0x5a226b,_0x1ab014))[_0x67ef('0x43')](handleError(_0x5a226b,null));};exports['show']=function(_0x1f5094,_0x308911){var _0x365cfa={'raw':!![],'where':{'id':_0x1f5094[_0x67ef('0x44')]['id']}},_0xc697cd={};_0xc697cd[_0x67ef('0x36')]=_[_0x67ef('0x34')](db[_0x67ef('0x2f')][_0x67ef('0x45')]);_0xc697cd['query']=_[_0x67ef('0x34')](_0x1f5094[_0x67ef('0x33')]);_0xc697cd['filters']=_['intersection'](_0xc697cd[_0x67ef('0x36')],_0xc697cd['query']);_0x365cfa[_0x67ef('0x37')]=_[_0x67ef('0x46')](_0xc697cd[_0x67ef('0x36')],qs['fields'](_0x1f5094[_0x67ef('0x33')][_0x67ef('0x38')]));_0x365cfa['attributes']=_0x365cfa['attributes'][_0x67ef('0x39')]?_0x365cfa[_0x67ef('0x37')]:_0xc697cd[_0x67ef('0x36')];if(_0x1f5094[_0x67ef('0x33')][_0x67ef('0x47')]){_0x365cfa[_0x67ef('0x41')]=[{'all':!![]}];}_0x365cfa=_[_0x67ef('0x3f')]({},_0x365cfa,_0x1f5094[_0x67ef('0x40')]);return db[_0x67ef('0x2f')][_0x67ef('0x48')](_0x365cfa)[_0x67ef('0x27')](handleEntityNotFound(_0x308911,null))[_0x67ef('0x27')](respondWithResult(_0x308911,null))[_0x67ef('0x43')](handleError(_0x308911,null));};exports[_0x67ef('0x26')]=function(_0x188a99,_0x40d5bc){if(_0x188a99[_0x67ef('0x49')]['id']){delete _0x188a99[_0x67ef('0x49')]['id'];}return db[_0x67ef('0x2f')][_0x67ef('0x48')]({'where':{'id':_0x188a99[_0x67ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x40d5bc,null))['then'](saveUpdates(_0x188a99[_0x67ef('0x49')],null))[_0x67ef('0x27')](respondWithResult(_0x40d5bc,null))[_0x67ef('0x43')](handleError(_0x40d5bc,null));};exports[_0x67ef('0x28')]=function(_0x50dc4f,_0x5d6e46){return db['CmCustomField'][_0x67ef('0x48')]({'where':{'id':_0x50dc4f[_0x67ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d6e46,null))[_0x67ef('0x27')](removeEntity(_0x5d6e46,null))[_0x67ef('0x43')](handleError(_0x5d6e46,null));};exports[_0x67ef('0x4a')]=function(_0x2a7ac8,_0x3aa3ed){var _0x3671d5;return db[_0x67ef('0x4b')][_0x67ef('0x4c')](function(_0x364794){return db['CmCustomField'][_0x67ef('0x4a')](_0x2a7ac8[_0x67ef('0x49')],{'transaction':_0x364794})['then'](function(_0x14d52e){_0x3671d5=_0x14d52e;var _0x313bd6={'type':db[_0x67ef('0x4d')]['TEXT'],'transaction':_0x364794};switch(_0x2a7ac8[_0x67ef('0x49')]['type']){case _0x67ef('0x4e'):_0x313bd6['type']=db[_0x67ef('0x4d')]['TEXT'];break;case _0x67ef('0x4f'):_0x313bd6[_0x67ef('0x31')]=db['Sequelize'][_0x67ef('0x50')];break;case _0x67ef('0x51'):_0x313bd6[_0x67ef('0x31')]=db[_0x67ef('0x4d')][_0x67ef('0x52')];_0x313bd6[_0x67ef('0x53')]=![];break;default:}return db['sequelize'][_0x67ef('0x54')][_0x67ef('0x55')](_0x67ef('0x56'),util['format']('cf_%d',_0x3671d5['id']),_0x313bd6);})['then'](function(){return _0x3671d5;});})[_0x67ef('0x27')](respondWithResult(_0x3aa3ed,0xc9))['catch'](handleError(_0x3aa3ed,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 5d81c55..bffc0bf 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 _0xd0ea=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x52f256,_0x21a10a){var _0x230f3d=function(_0x5db5da){while(--_0x5db5da){_0x52f256['push'](_0x52f256['shift']());}};_0x230f3d(++_0x21a10a);}(_0xd0ea,0x1b8));var _0xad0e=function(_0x25280c,_0x2edec1){_0x25280c=_0x25280c-0x0;var _0x3a58c3=_0xd0ea[_0x25280c];return _0x3a58c3;};'use strict';var _=require(_0xad0e('0x0'));var util=require(_0xad0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xad0e('0x2'));var BPromise=require('bluebird');var rp=require(_0xad0e('0x3'));var fs=require('fs');var path=require(_0xad0e('0x4'));var rimraf=require(_0xad0e('0x5'));var config=require(_0xad0e('0x6'));var attributes=require('./cmCustomField.attributes');module[_0xad0e('0x7')]=function(_0x335570,_0x2a09d0){return _0x335570['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3abe=['./cmCustomField.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4a3b99,_0x1c33e7){var _0x42db20=function(_0x30e72b){while(--_0x30e72b){_0x4a3b99['push'](_0x4a3b99['shift']());}};_0x42db20(++_0x1c33e7);}(_0x3abe,0x19a));var _0xe3ab=function(_0x19b8b6,_0x27079c){_0x19b8b6=_0x19b8b6-0x0;var _0x2c225=_0x3abe[_0x19b8b6];return _0x2c225;};'use strict';var _=require(_0xe3ab('0x0'));var util=require(_0xe3ab('0x1'));var logger=require(_0xe3ab('0x2'))(_0xe3ab('0x3'));var moment=require('moment');var BPromise=require(_0xe3ab('0x4'));var rp=require(_0xe3ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3ab('0x6'));var config=require(_0xe3ab('0x7'));var attributes=require(_0xe3ab('0x8'));module[_0xe3ab('0x9')]=function(_0x13d7c7,_0x1d40bc){return _0x13d7c7[_0xe3ab('0xa')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index a5c5d85..68a09ff 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 _0x9d03=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xb0ca6a,_0x3604ad){var _0x5e0ead=function(_0x4e0b95){while(--_0x4e0b95){_0xb0ca6a['push'](_0xb0ca6a['shift']());}};_0x5e0ead(++_0x3604ad);}(_0x9d03,0x1d3));var _0x39d0=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9d03[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x39d0('0x0'));var util=require(_0x39d0('0x1'));var moment=require('moment');var BPromise=require(_0x39d0('0x2'));var rs=require(_0x39d0('0x3'));var fs=require('fs');var Redis=require(_0x39d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39d0('0x5'));var logger=require(_0x39d0('0x6'))('rpc');var config=require(_0x39d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x39d0('0x8')][_0x39d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bd4bb,_0x1c36b9,_0x94fe04){return new BPromise(function(_0x257112,_0x4f9d4d){return client[_0x39d0('0xa')](_0x3bd4bb,_0x94fe04)[_0x39d0('0xb')](function(_0x3166ed){logger[_0x39d0('0xc')](_0x39d0('0xd'),_0x1c36b9,_0x39d0('0xe'));logger[_0x39d0('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1c36b9,_0x39d0('0xe'),JSON[_0x39d0('0x10')](_0x3166ed));if(_0x3166ed[_0x39d0('0x11')]){if(_0x3166ed[_0x39d0('0x11')][_0x39d0('0x12')]===0x1f4){logger[_0x39d0('0x11')](_0x39d0('0xd'),_0x1c36b9,_0x3166ed[_0x39d0('0x11')]['message']);return _0x4f9d4d(_0x3166ed[_0x39d0('0x11')]['message']);}logger[_0x39d0('0x11')](_0x39d0('0xd'),_0x1c36b9,_0x3166ed[_0x39d0('0x11')]['message']);return _0x257112(_0x3166ed['error'][_0x39d0('0x13')]);}else{logger[_0x39d0('0xc')](_0x39d0('0xd'),_0x1c36b9,_0x39d0('0xe'));_0x257112(_0x3166ed[_0x39d0('0x14')][_0x39d0('0x13')]);}})[_0x39d0('0x15')](function(_0x14be60){logger[_0x39d0('0x11')](_0x39d0('0xd'),_0x1c36b9,_0x14be60);_0x4f9d4d(_0x14be60);});});} \ No newline at end of file +var _0xe338=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s'];(function(_0x237f91,_0x23cd45){var _0x4c857d=function(_0x326307){while(--_0x326307){_0x237f91['push'](_0x237f91['shift']());}};_0x4c857d(++_0x23cd45);}(_0xe338,0x1d5));var _0x8e33=function(_0x13f330,_0x4eabd5){_0x13f330=_0x13f330-0x0;var _0x35a484=_0xe338[_0x13f330];return _0x35a484;};'use strict';var _=require(_0x8e33('0x0'));var util=require(_0x8e33('0x1'));var moment=require(_0x8e33('0x2'));var BPromise=require(_0x8e33('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e33('0x4'))['db'];var utils=require(_0x8e33('0x5'));var logger=require(_0x8e33('0x6'))(_0x8e33('0x7'));var config=require(_0x8e33('0x8'));var jayson=require(_0x8e33('0x9'));var client=jayson[_0x8e33('0xa')][_0x8e33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36028d,_0x15458f,_0x4a9bf4){return new BPromise(function(_0x228523,_0x59e5fe){return client[_0x8e33('0xc')](_0x36028d,_0x4a9bf4)['then'](function(_0x2310b6){logger['info'](_0x8e33('0xd'),_0x15458f,_0x8e33('0xe'));logger[_0x8e33('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x15458f,'request\x20sent',JSON[_0x8e33('0x10')](_0x2310b6));if(_0x2310b6[_0x8e33('0x11')]){if(_0x2310b6[_0x8e33('0x11')]['code']===0x1f4){logger[_0x8e33('0x11')](_0x8e33('0xd'),_0x15458f,_0x2310b6[_0x8e33('0x11')]['message']);return _0x59e5fe(_0x2310b6[_0x8e33('0x11')][_0x8e33('0x12')]);}logger['error'](_0x8e33('0xd'),_0x15458f,_0x2310b6[_0x8e33('0x11')][_0x8e33('0x12')]);return _0x228523(_0x2310b6['error']['message']);}else{logger['info'](_0x8e33('0xd'),_0x15458f,_0x8e33('0xe'));_0x228523(_0x2310b6[_0x8e33('0x13')][_0x8e33('0x12')]);}})[_0x8e33('0x14')](function(_0xc3c8ef){logger[_0x8e33('0x11')]('CmCustomField,\x20%s,\x20%s',_0x15458f,_0xc3c8ef);_0x59e5fe(_0xc3c8ef);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0953f0c..a86bc02 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 _0x5004=['create','put','/:id','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','show','post','isAuthenticated'];(function(_0x4a350c,_0x2760a1){var _0x51bb79=function(_0x1789a8){while(--_0x1789a8){_0x4a350c['push'](_0x4a350c['shift']());}};_0x51bb79(++_0x2760a1);}(_0x5004,0x84));var _0x4500=function(_0x2c182d,_0x55f3fa){_0x2c182d=_0x2c182d-0x0;var _0x5d359e=_0x5004[_0x2c182d];return _0x5d359e;};'use strict';var multer=require('multer');var util=require(_0x4500('0x0'));var path=require(_0x4500('0x1'));var timeout=require('connect-timeout');var express=require(_0x4500('0x2'));var router=express[_0x4500('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4500('0x4'));var interaction=require(_0x4500('0x5'));var config=require(_0x4500('0x6'));var controller=require(_0x4500('0x7'));router[_0x4500('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4500('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4500('0x9')]);router[_0x4500('0xa')]('/',auth[_0x4500('0xb')](),controller[_0x4500('0xc')]);router[_0x4500('0xd')](_0x4500('0xe'),auth[_0x4500('0xb')](),controller[_0x4500('0xf')]);router[_0x4500('0x10')](_0x4500('0xe'),auth[_0x4500('0xb')](),controller['destroy']);module[_0x4500('0x11')]=router; \ No newline at end of file +var _0x33ac=['create','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','post'];(function(_0x214624,_0x4dcf4a){var _0x4b52ff=function(_0x11a688){while(--_0x11a688){_0x214624['push'](_0x214624['shift']());}};_0x4b52ff(++_0x4dcf4a);}(_0x33ac,0x1f2));var _0xc33a=function(_0x30da26,_0x38bdaa){_0x30da26=_0x30da26-0x0;var _0x325d81=_0x33ac[_0x30da26];return _0x325d81;};'use strict';var multer=require('multer');var util=require(_0xc33a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc33a('0x1'));var router=express[_0xc33a('0x2')]();var fs_extra=require(_0xc33a('0x3'));var auth=require(_0xc33a('0x4'));var interaction=require(_0xc33a('0x5'));var config=require(_0xc33a('0x6'));var controller=require(_0xc33a('0x7'));router[_0xc33a('0x8')]('/',auth[_0xc33a('0x9')](),controller['index']);router['get'](_0xc33a('0xa'),auth[_0xc33a('0x9')](),controller['show']);router[_0xc33a('0xb')]('/',auth['isAuthenticated'](),controller[_0xc33a('0xc')]);router[_0xc33a('0xd')](_0xc33a('0xa'),auth[_0xc33a('0x9')](),controller[_0xc33a('0xe')]);router[_0xc33a('0xf')](_0xc33a('0xa'),auth[_0xc33a('0x9')](),controller[_0xc33a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 856f540..0af2f89 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 _0x6305=['STRING','UNSIGNED','contactListQueue','exports','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x62db9b,_0x5cd678){var _0x2364a9=function(_0x5c9e6d){while(--_0x5c9e6d){_0x62db9b['push'](_0x62db9b['shift']());}};_0x2364a9(++_0x5cd678);}(_0x6305,0x1f3));var _0x5630=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6305[_0x126558];return _0x1f6d14;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5630('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5630('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5630('0x2')],'defaultValue':moment()['format'](_0x5630('0x3'))},'countbusyretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5630('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5630('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5630('0x2')]},'priority':{'type':Sequelize[_0x5630('0x4')](0x2)[_0x5630('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5630('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5630('0x4')],'unique':_0x5630('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x5630('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5630('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xad2e=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','exports','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad2e,0x13d));var _0xead2=function(_0x22236b,_0x1ab13c){_0x22236b=_0x22236b-0x0;var _0x45d668=_0xad2e[_0x22236b];return _0x45d668;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xead2('0x0')]={'phone':{'type':Sequelize[_0xead2('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xead2('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xead2('0x3')],'defaultValue':moment()['format'](_0xead2('0x4'))},'countbusyretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xead2('0x3')]},'priority':{'type':Sequelize[_0xead2('0x5')](0x2)[_0xead2('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xead2('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xead2('0x5')],'unique':_0xead2('0x7')},'ListId':{'type':Sequelize[_0xead2('0x5')],'unique':_0xead2('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xead2('0x5')],'unique':_0xead2('0x7')},'CampaignId':{'type':Sequelize[_0xead2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xead2('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index aa59e9a..ac10def 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 _0x90b4=['$contained','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','deleted','campaign','membername','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','CmContact','user','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','format','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','concat','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contains'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x90b4,0x192));var _0x490b=function(_0x5c3fd0,_0x99cb76){_0x5c3fd0=_0x5c3fd0-0x0;var _0x58f16d=_0x90b4[_0x5c3fd0];return _0x58f16d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x490b('0x0'));var zipdir=require(_0x490b('0x1'));var jsonpatch=require(_0x490b('0x2'));var rp=require(_0x490b('0x3'));var moment=require(_0x490b('0x4'));var BPromise=require(_0x490b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x490b('0x6'));var sox=require(_0x490b('0x7'));var csv=require(_0x490b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x490b('0x9'));var _=require(_0x490b('0xa'));var squel=require(_0x490b('0xb'));var crypto=require(_0x490b('0xc'));var jsforce=require(_0x490b('0xd'));var deskjs=require(_0x490b('0xe'));var toCsv=require(_0x490b('0x8'));var querystring=require('querystring');var Papa=require(_0x490b('0xf'));var Redis=require(_0x490b('0x10'));var authService=require(_0x490b('0x11'));var qs=require(_0x490b('0x12'));var as=require(_0x490b('0x13'));var hardwareService=require(_0x490b('0x14'));var logger=require(_0x490b('0x15'))(_0x490b('0x16'));var utils=require(_0x490b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x490b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d27df,_0x1c007f){_0x1c007f=_0x1c007f||0xcc;return function(_0x5025b5){if(_0x5025b5){return _0x2d27df['sendStatus'](_0x1c007f);}return _0x2d27df[_0x490b('0x19')](_0x1c007f)[_0x490b('0x1a')]();};}function respondWithResult(_0x3e0dcd,_0x5bbeed){_0x5bbeed=_0x5bbeed||0xc8;return function(_0x5b83d4){if(_0x5b83d4){return _0x3e0dcd['status'](_0x5bbeed)[_0x490b('0x1b')](_0x5b83d4);}};}function respondWithFilteredResult(_0x24c9ba,_0x2a84dd){return function(_0x19c00e){if(_0x19c00e){var _0x2d3b19=typeof _0x2a84dd[_0x490b('0x1c')]===_0x490b('0x1d')&&typeof _0x2a84dd[_0x490b('0x1e')]===_0x490b('0x1d');var _0x37d18f=_0x19c00e['count'];var _0x49709a=_0x2d3b19?0x0:_0x2a84dd[_0x490b('0x1c')];var _0xebf89=_0x2d3b19?_0x19c00e[_0x490b('0x1f')]:_0x2a84dd[_0x490b('0x1c')]+_0x2a84dd['limit'];var _0x43c57d;if(_0xebf89>=_0x37d18f){_0xebf89=_0x37d18f;_0x43c57d=0xc8;}else{_0x43c57d=0xce;}_0x24c9ba['status'](_0x43c57d);return _0x24c9ba[_0x490b('0x20')](_0x490b('0x21'),_0x49709a+'-'+_0xebf89+'/'+_0x37d18f)['json'](_0x19c00e);}return null;};}function patchUpdates(_0x1d15e0){return function(_0x2aab68){try{jsonpatch[_0x490b('0x22')](_0x2aab68,_0x1d15e0,!![]);}catch(_0x10b7e3){return BPromise[_0x490b('0x23')](_0x10b7e3);}return _0x2aab68['save']();};}function saveUpdates(_0x1ce4fb,_0x584574){return function(_0x200dde){if(_0x200dde){return _0x200dde[_0x490b('0x24')](_0x1ce4fb)[_0x490b('0x25')](function(_0x2532d1){return _0x2532d1;});}return null;};}function removeEntity(_0x3b3911,_0x321b7c){return function(_0xec08c6){if(_0xec08c6){return _0xec08c6[_0x490b('0x26')]()[_0x490b('0x25')](function(){_0x3b3911[_0x490b('0x19')](0xcc)[_0x490b('0x1a')]();});}};}function handleEntityNotFound(_0x2a2371,_0x36b8bd){return function(_0x1d4b0e){if(!_0x1d4b0e){_0x2a2371[_0x490b('0x27')](0x194);}return _0x1d4b0e;};}function handleError(_0x49694e,_0x1e3c3e){_0x1e3c3e=_0x1e3c3e||0x1f4;return function(_0x828678){logger[_0x490b('0x28')](_0x828678[_0x490b('0x29')]);if(_0x828678[_0x490b('0x2a')]){delete _0x828678[_0x490b('0x2a')];}_0x49694e[_0x490b('0x19')](_0x1e3c3e)['send'](_0x828678);};}exports[_0x490b('0x2b')]=function(_0x332306,_0x54f92f){var _0xacd857={},_0x3f21cf={},_0x31906e={'count':0x0,'rows':[]};var _0x5925c1=_[_0x490b('0x2c')](db[_0x490b('0x2d')][_0x490b('0x2e')],function(_0x2aada2){return{'name':_0x2aada2['fieldName'],'type':_0x2aada2[_0x490b('0x2f')][_0x490b('0x30')]};});_0x3f21cf[_0x490b('0x31')]=_[_0x490b('0x2c')](_0x5925c1,'name');_0x3f21cf[_0x490b('0x32')]=_[_0x490b('0x33')](_0x332306[_0x490b('0x32')]);_0x3f21cf['filters']=_['intersection'](_0x3f21cf['model'],_0x3f21cf['query']);_0x3f21cf[_0x490b('0x34')]=_[_0x490b('0x35')](_0x3f21cf[_0x490b('0x34')],['$and','$or',_0x490b('0x36'),_0x490b('0x37'),_0x490b('0x38'),_0x490b('0x39'),_0x490b('0x3a'),_0x490b('0x3b'),_0x490b('0x3c'),_0x490b('0x3d'),_0x490b('0x3e'),_0x490b('0x3f'),_0x490b('0x40'),_0x490b('0x41'),_0x490b('0x42'),'$iLike',_0x490b('0x43'),_0x490b('0x41'),'$overlap',_0x490b('0x44'),_0x490b('0x45'),'$any']);_0xacd857[_0x490b('0x46')]=_['intersection'](_0x3f21cf[_0x490b('0x31')],qs[_0x490b('0x47')](_0x332306[_0x490b('0x32')][_0x490b('0x47')]));_0xacd857[_0x490b('0x46')]=_0xacd857[_0x490b('0x46')][_0x490b('0x48')]?_0xacd857[_0x490b('0x46')]:_0x3f21cf[_0x490b('0x31')];if(!_0x332306[_0x490b('0x32')][_0x490b('0x49')](_0x490b('0x4a'))){_0xacd857['limit']=qs['limit'](_0x332306[_0x490b('0x32')][_0x490b('0x1e')]);_0xacd857[_0x490b('0x1c')]=qs[_0x490b('0x1c')](_0x332306[_0x490b('0x32')][_0x490b('0x1c')]);}_0xacd857['order']=qs['sort'](_0x332306['query'][_0x490b('0x4b')]);_0xacd857[_0x490b('0x4c')]=qs[_0x490b('0x34')](_[_0x490b('0x4d')](_0x332306[_0x490b('0x32')],_0x3f21cf[_0x490b('0x34')]),_0x5925c1);if(_0x332306[_0x490b('0x32')][_0x490b('0x4e')]){_0xacd857[_0x490b('0x4c')]=_[_0x490b('0x4f')](_0xacd857[_0x490b('0x4c')],{'$or':_[_0x490b('0x2c')](_0x5925c1,function(_0x4e5716){if(_0x4e5716[_0x490b('0x2f')]!==_0x490b('0x50')){var _0x53e779={};_0x53e779[_0x4e5716[_0x490b('0x2a')]]={'$like':'%'+_0x332306['query'][_0x490b('0x4e')]+'%'};return _0x53e779;}})});}_0xacd857=_[_0x490b('0x4f')]({},_0xacd857,_0x332306[_0x490b('0x51')]);var _0x389fdd={'where':_0xacd857[_0x490b('0x4c')]};return db[_0x490b('0x2d')][_0x490b('0x1f')](_0x389fdd)[_0x490b('0x25')](function(_0x365c38){_0x31906e[_0x490b('0x1f')]=_0x365c38;if(_0x332306[_0x490b('0x32')][_0x490b('0x52')]){_0xacd857[_0x490b('0x53')]=[{'all':!![]}];}return db[_0x490b('0x2d')][_0x490b('0x54')](_0xacd857);})['then'](function(_0x4710c4){_0x31906e[_0x490b('0x55')]=_0x4710c4;return _0x31906e;})[_0x490b('0x25')](respondWithFilteredResult(_0x54f92f,_0xacd857))['catch'](handleError(_0x54f92f,null));};exports[_0x490b('0x56')]=function(_0x36e251,_0x2cda46){var _0x4138a2={'raw':!![],'where':{'id':_0x36e251['params']['id']}},_0x502ccd={};_0x502ccd[_0x490b('0x31')]=_['keys'](db['CmHopper']['rawAttributes']);_0x502ccd[_0x490b('0x32')]=_[_0x490b('0x33')](_0x36e251[_0x490b('0x32')]);_0x502ccd[_0x490b('0x34')]=_[_0x490b('0x57')](_0x502ccd[_0x490b('0x31')],_0x502ccd[_0x490b('0x32')]);_0x4138a2[_0x490b('0x46')]=_[_0x490b('0x57')](_0x502ccd['model'],qs[_0x490b('0x47')](_0x36e251['query'][_0x490b('0x47')]));_0x4138a2['attributes']=_0x4138a2[_0x490b('0x46')][_0x490b('0x48')]?_0x4138a2['attributes']:_0x502ccd[_0x490b('0x31')];if(_0x36e251[_0x490b('0x32')][_0x490b('0x52')]){_0x4138a2[_0x490b('0x53')]=[{'all':!![]}];}_0x4138a2=_[_0x490b('0x4f')]({},_0x4138a2,_0x36e251[_0x490b('0x51')]);return db[_0x490b('0x2d')][_0x490b('0x58')](_0x4138a2)[_0x490b('0x25')](handleEntityNotFound(_0x2cda46,null))[_0x490b('0x25')](respondWithResult(_0x2cda46,null))[_0x490b('0x59')](handleError(_0x2cda46,null));};exports[_0x490b('0x5a')]=function(_0x5c9a07,_0x5da65f){return db[_0x490b('0x2d')]['create'](_0x5c9a07[_0x490b('0x5b')],{})['then'](respondWithResult(_0x5da65f,0xc9))[_0x490b('0x59')](handleError(_0x5da65f,null));};exports[_0x490b('0x24')]=function(_0x345fb2,_0x4a6f1f){if(_0x345fb2[_0x490b('0x5b')]['id']){delete _0x345fb2[_0x490b('0x5b')]['id'];}return db[_0x490b('0x2d')]['find']({'where':{'id':_0x345fb2[_0x490b('0x5c')]['id']}})[_0x490b('0x25')](handleEntityNotFound(_0x4a6f1f,null))[_0x490b('0x25')](saveUpdates(_0x345fb2['body'],null))[_0x490b('0x25')](respondWithResult(_0x4a6f1f,null))[_0x490b('0x59')](handleError(_0x4a6f1f,null));};exports['describe']=function(_0x3e2ac5,_0x513f8c){return db['CmHopper'][_0x490b('0x5d')]()[_0x490b('0x25')](respondWithResult(_0x513f8c,null))[_0x490b('0x59')](handleError(_0x513f8c,null));};exports[_0x490b('0x26')]=function(_0x1adc98,_0x4187a9){var _0x3ecda2;return db[_0x490b('0x2d')]['find']({'where':{'id':_0x1adc98[_0x490b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4187a9,null))[_0x490b('0x25')](function(_0x5c8df9){if(_0x5c8df9){return _0x5c8df9[_0x490b('0x26')]()['then'](function(_0x4d0a9a){return _0x4d0a9a;});}})[_0x490b('0x25')](function(_0x258468){_0x3ecda2=_0x258468;if(_0x258468){if(_0x258468['VoiceQueueId']||_0x258468[_0x490b('0x5e')]){return db[_0x258468[_0x490b('0x5f')]?_0x490b('0x60'):_0x490b('0x61')][_0x490b('0x58')]({'where':{'id':_0x258468[_0x490b('0x5f')]?_0x258468[_0x490b('0x5f')]:_0x258468[_0x490b('0x5e')]},'attributes':['id',_0x490b('0x2a')],'raw':!![]});}}})[_0x490b('0x25')](function(_0x44d4f0){var _0x1e8400={};if(_0x44d4f0){_[_0x490b('0x4f')](_0x1e8400,_[_0x490b('0x62')](_0x3ecda2[_0x490b('0x63')],[_0x490b('0x64'),_0x490b('0x65'),'id']));_0x1e8400['state']=0x15;_0x1e8400['statedesc']=_0x490b('0x66');_0x1e8400[_0x490b('0x67')]=_0x44d4f0[_0x490b('0x2a')];_0x1e8400[_0x490b('0x68')]=_0x1adc98['user'][_0x490b('0x2a')];_0x1e8400[_0x490b('0x69')]=_0x1adc98['user']['id'];_0x1e8400[_0x490b('0x66')]=!![];_0x1e8400[_0x490b('0x6a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1e8400[_0x490b('0x6b')]=_0x3ecda2[_0x490b('0x6c')];_0x1e8400[_0x490b('0x6d')]=_0x3ecda2[_0x490b('0x5f')]?_0x490b('0x6e'):_0x490b('0x6f');return db['CmContact'][_0x490b('0x58')]({'where':{'id':_0x1e8400[_0x490b('0x70')]},'attributes':[_0x490b('0x71'),'lastName']})[_0x490b('0x25')](function(_0x1894f0){if(!_[_0x490b('0x72')](_0x4187a9)&&!_[_0x490b('0x72')](_0x1894f0[_0x490b('0x71')])){_0x1e8400[_0x490b('0x73')]=_0x1894f0['firstName'];if(!_[_0x490b('0x72')](_0x1894f0['lastName'])){_0x1e8400['calleridname']+='\x20'+_0x1894f0[_0x490b('0x74')];}}})[_0x490b('0x75')](function(){return db[_0x490b('0x76')][_0x490b('0x5a')](_0x1e8400);});}})['then'](function(){return _0x4187a9[_0x490b('0x19')](0xcc)[_0x490b('0x1a')]();})['catch'](handleError(_0x4187a9,null));};exports[_0x490b('0x77')]=function(_0x55b9e9,_0x4be1da,_0x7d67f8){var _0x4a735e=[];return db[_0x490b('0x78')][_0x490b('0x5d')]()[_0x490b('0x25')](function(_0x5c00f5){_0x4a735e=_[_0x490b('0x33')](_0x5c00f5);return _0x55b9e9[_0x490b('0x79')][_0x490b('0x7a')]({'where':{'type':_0x490b('0x7b'),'dialActive':!![],'dialMethod':_0x490b('0x7c')},'attributes':['id',_0x490b('0x7d'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x490b('0x25')](function(_0x4cdadd){if(_0x4cdadd&&_0x4cdadd[_0x490b('0x48')]){return db['sequelize'][_0x490b('0x7e')](function(_0x6d80c7){var _0x4682cc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x490b('0x7f'))},'VoiceQueueId':{'$in':_['map'](_0x4cdadd,'id')},'$or':[{'UserId':null},{'UserId':_0x55b9e9[_0x490b('0x79')]['id']}]};var _0x23b877={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4cdadd)['filter']([_0x490b('0x80'),0x0])[_0x490b('0x2c')]('id')[_0x490b('0x81')]()},'$or':[{'UserId':null},{'UserId':_0x55b9e9[_0x490b('0x79')]['id']}]};var _0x6c1f29={'$or':[_0x4682cc,_0x23b877]};var _0x21e4c0=[];if(_0x55b9e9[_0x490b('0x5b')][_0x490b('0x82')]&&_0x55b9e9[_0x490b('0x5b')][_0x490b('0x82')]===_0x490b('0x83')){if(!_['isEmpty'](_0x55b9e9[_0x490b('0x5b')][_0x490b('0x84')])){_0x6c1f29['id']={'$in':_0x55b9e9[_0x490b('0x5b')][_0x490b('0x84')]};}_0x21e4c0=[[_0x490b('0x85'),_0x490b('0x86')],[_0x490b('0x87'),_0x4cdadd[0x0][_0x490b('0x7d')]===_0x490b('0x86')?_0x490b('0x88'):_0x490b('0x86')],db['sequelize']['literal'](_0x490b('0x89')),['id',_0x490b('0x88')]];}else{if(!_[_0x490b('0x8a')](_0x55b9e9[_0x490b('0x5b')]['hopperIds'])){_0x6c1f29['id']={'$notIn':_0x55b9e9[_0x490b('0x5b')]['hopperIds']};}_0x21e4c0=[['priority',_0x490b('0x88')],['scheduledAt',_0x4cdadd[0x0]['dialOrderByScheduledAt']],db[_0x490b('0x8b')][_0x490b('0x8c')](_0x490b('0x8d')),['id',_0x490b('0x86')]];}return db['CmHopper'][_0x490b('0x8e')]({'attributes':['id',_0x490b('0x8f'),_0x490b('0x90')],'where':_0x6c1f29,'order':_0x21e4c0,'transaction':_0x6d80c7,'lock':_0x6d80c7[_0x490b('0x91')][_0x490b('0x92')],'include':[{'model':db['CmContact'],'as':_0x490b('0x93'),'attributes':_0x4a735e,'include':[{'model':db[_0x490b('0x94')],'as':_0x490b('0x95'),'attributes':['id',_0x490b('0x2a')]}]},{'model':db['CmList'],'as':_0x490b('0x96'),'attributes':['id',_0x490b('0x2a')]},{'model':db[_0x490b('0x60')],'as':_0x490b('0x97'),'attributes':['id',_0x490b('0x2a'),_0x490b('0x98')]}]})[_0x490b('0x25')](function(_0x27e2ef){if(_0x27e2ef){return _0x27e2ef['update']({'UserId':_0x55b9e9[_0x490b('0x79')]['id']},{'transaction':_0x6d80c7});}});});}})[_0x490b('0x25')](handleEntityNotFound(_0x4be1da,null))[_0x490b('0x25')](respondWithResult(_0x4be1da,null))[_0x490b('0x59')](handleError(_0x4be1da,null));};exports[_0x490b('0x99')]=function(_0xdcbf93,_0x5e1195,_0xf5fcad){return _0xdcbf93[_0x490b('0x79')][_0x490b('0x7a')]({'where':{'type':_0x490b('0x7b'),'dialActive':!![],'dialMethod':_0x490b('0x7c')},'attributes':['id'],'raw':!![]})[_0x490b('0x25')](function(_0x12f1ce){if(_0x12f1ce&&_0x12f1ce[_0x490b('0x48')]){return db['CmHopper'][_0x490b('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x490b('0x9a')](_0x490b('0x7f'))},'VoiceQueueId':{'$in':_['map'](_0x12f1ce,'id')},'$or':[{'UserId':null},{'UserId':_0xdcbf93[_0x490b('0x79')]['id']}]}});}return 0x0;})['then'](function(_0x38522d){if(!_['isNil'](_0x38522d)&&_['isNumber'](_0x38522d)){return _0x5e1195['status'](0xc8)['json']({'contacts':_0x38522d});}else{logger[_0x490b('0x28')](_0x490b('0x9b'),'getOpenContacts',0x194,_0x490b('0x9c'));_0x5e1195[_0x490b('0x27')](0x194);}})['catch'](handleError(_0x5e1195,null));}; \ No newline at end of file +var _0x0d3b=['model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','CmHopper','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','user','dialOrderByScheduledAt','sequelize','transaction','format','filter','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getVoiceQueues','outbound','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','keys','intersection','query','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any'];(function(_0x5800db,_0x304b93){var _0x53f370=function(_0x5067cf){while(--_0x5067cf){_0x5800db['push'](_0x5800db['shift']());}};_0x53f370(++_0x304b93);}(_0x0d3b,0xf4));var _0xb0d3=function(_0x4194e2,_0x44665a){_0x4194e2=_0x4194e2-0x0;var _0x3c8a2f=_0x0d3b[_0x4194e2];return _0x3c8a2f;};'use strict';var emlformat=require(_0xb0d3('0x0'));var rimraf=require(_0xb0d3('0x1'));var zipdir=require(_0xb0d3('0x2'));var jsonpatch=require(_0xb0d3('0x3'));var rp=require(_0xb0d3('0x4'));var moment=require('moment');var BPromise=require(_0xb0d3('0x5'));var Mustache=require(_0xb0d3('0x6'));var util=require('util');var path=require(_0xb0d3('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(_0xb0d3('0x8'));var squel=require(_0xb0d3('0x9'));var crypto=require(_0xb0d3('0xa'));var jsforce=require(_0xb0d3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb0d3('0xc'));var querystring=require(_0xb0d3('0xd'));var Papa=require(_0xb0d3('0xe'));var Redis=require(_0xb0d3('0xf'));var authService=require(_0xb0d3('0x10'));var qs=require(_0xb0d3('0x11'));var as=require(_0xb0d3('0x12'));var hardwareService=require(_0xb0d3('0x13'));var logger=require(_0xb0d3('0x14'))('api');var utils=require(_0xb0d3('0x15'));var config=require(_0xb0d3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0d3('0x17'))['db'];function respondWithStatusCode(_0x182d65,_0x383475){_0x383475=_0x383475||0xcc;return function(_0x36dc37){if(_0x36dc37){return _0x182d65['sendStatus'](_0x383475);}return _0x182d65[_0xb0d3('0x18')](_0x383475)[_0xb0d3('0x19')]();};}function respondWithResult(_0x577c67,_0x16bf81){_0x16bf81=_0x16bf81||0xc8;return function(_0x5af176){if(_0x5af176){return _0x577c67[_0xb0d3('0x18')](_0x16bf81)[_0xb0d3('0x1a')](_0x5af176);}};}function respondWithFilteredResult(_0x5487ec,_0x4e9ee4){return function(_0x400307){if(_0x400307){var _0x29b5d4=typeof _0x4e9ee4[_0xb0d3('0x1b')]===_0xb0d3('0x1c')&&typeof _0x4e9ee4[_0xb0d3('0x1d')]==='undefined';var _0x3eeeb2=_0x400307['count'];var _0x9d5420=_0x29b5d4?0x0:_0x4e9ee4['offset'];var _0x3a5f76=_0x29b5d4?_0x400307[_0xb0d3('0x1e')]:_0x4e9ee4[_0xb0d3('0x1b')]+_0x4e9ee4[_0xb0d3('0x1d')];var _0x57b664;if(_0x3a5f76>=_0x3eeeb2){_0x3a5f76=_0x3eeeb2;_0x57b664=0xc8;}else{_0x57b664=0xce;}_0x5487ec['status'](_0x57b664);return _0x5487ec['set'](_0xb0d3('0x1f'),_0x9d5420+'-'+_0x3a5f76+'/'+_0x3eeeb2)[_0xb0d3('0x1a')](_0x400307);}return null;};}function patchUpdates(_0x349be6){return function(_0x1a5ec1){try{jsonpatch[_0xb0d3('0x20')](_0x1a5ec1,_0x349be6,!![]);}catch(_0x17451c){return BPromise[_0xb0d3('0x21')](_0x17451c);}return _0x1a5ec1['save']();};}function saveUpdates(_0x187eae,_0x4e8307){return function(_0x4c0e39){if(_0x4c0e39){return _0x4c0e39[_0xb0d3('0x22')](_0x187eae)[_0xb0d3('0x23')](function(_0x3fc7e6){return _0x3fc7e6;});}return null;};}function removeEntity(_0x45c2cc,_0x4febe3){return function(_0x50ae58){if(_0x50ae58){return _0x50ae58['destroy']()[_0xb0d3('0x23')](function(){_0x45c2cc[_0xb0d3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dab49,_0x1da289){return function(_0x42a7b1){if(!_0x42a7b1){_0x4dab49[_0xb0d3('0x24')](0x194);}return _0x42a7b1;};}function handleError(_0x491dd3,_0xfc0ce2){_0xfc0ce2=_0xfc0ce2||0x1f4;return function(_0x1d9ad1){logger[_0xb0d3('0x25')](_0x1d9ad1[_0xb0d3('0x26')]);if(_0x1d9ad1['name']){delete _0x1d9ad1[_0xb0d3('0x27')];}_0x491dd3[_0xb0d3('0x18')](_0xfc0ce2)[_0xb0d3('0x28')](_0x1d9ad1);};}exports[_0xb0d3('0x29')]=function(_0x11f339,_0x34f52b){var _0x52904c={},_0x333c2b={},_0x190513={'count':0x0,'rows':[]};var _0x3d482e=_[_0xb0d3('0x2a')](db['CmHopper']['rawAttributes'],function(_0x3aa4f6){return{'name':_0x3aa4f6[_0xb0d3('0x2b')],'type':_0x3aa4f6[_0xb0d3('0x2c')][_0xb0d3('0x2d')]};});_0x333c2b['model']=_['map'](_0x3d482e,_0xb0d3('0x27'));_0x333c2b['query']=_[_0xb0d3('0x2e')](_0x11f339['query']);_0x333c2b['filters']=_[_0xb0d3('0x2f')](_0x333c2b['model'],_0x333c2b[_0xb0d3('0x30')]);_0x333c2b['filters']=_[_0xb0d3('0x31')](_0x333c2b['filters'],[_0xb0d3('0x32'),_0xb0d3('0x33'),_0xb0d3('0x34'),_0xb0d3('0x35'),_0xb0d3('0x36'),_0xb0d3('0x37'),_0xb0d3('0x38'),_0xb0d3('0x39'),'$not','$between','$notBetween',_0xb0d3('0x3a'),'$notIn',_0xb0d3('0x3b'),_0xb0d3('0x3c'),_0xb0d3('0x3d'),_0xb0d3('0x3e'),_0xb0d3('0x3b'),_0xb0d3('0x3f'),_0xb0d3('0x40'),'$contained',_0xb0d3('0x41')]);_0x52904c['attributes']=_[_0xb0d3('0x2f')](_0x333c2b[_0xb0d3('0x42')],qs[_0xb0d3('0x43')](_0x11f339[_0xb0d3('0x30')][_0xb0d3('0x43')]));_0x52904c['attributes']=_0x52904c['attributes'][_0xb0d3('0x44')]?_0x52904c[_0xb0d3('0x45')]:_0x333c2b['model'];if(!_0x11f339[_0xb0d3('0x30')][_0xb0d3('0x46')](_0xb0d3('0x47'))){_0x52904c[_0xb0d3('0x1d')]=qs[_0xb0d3('0x1d')](_0x11f339[_0xb0d3('0x30')][_0xb0d3('0x1d')]);_0x52904c['offset']=qs[_0xb0d3('0x1b')](_0x11f339[_0xb0d3('0x30')][_0xb0d3('0x1b')]);}_0x52904c[_0xb0d3('0x48')]=qs[_0xb0d3('0x49')](_0x11f339[_0xb0d3('0x30')]['sort']);_0x52904c['where']=qs[_0xb0d3('0x4a')](_[_0xb0d3('0x4b')](_0x11f339[_0xb0d3('0x30')],_0x333c2b[_0xb0d3('0x4a')]),_0x3d482e);if(_0x11f339[_0xb0d3('0x30')]['filter']){_0x52904c[_0xb0d3('0x4c')]=_[_0xb0d3('0x4d')](_0x52904c[_0xb0d3('0x4c')],{'$or':_[_0xb0d3('0x2a')](_0x3d482e,function(_0x14bb58){if(_0x14bb58['type']!==_0xb0d3('0x4e')){var _0x1057a9={};_0x1057a9[_0x14bb58[_0xb0d3('0x27')]]={'$like':'%'+_0x11f339['query']['filter']+'%'};return _0x1057a9;}})});}_0x52904c=_[_0xb0d3('0x4d')]({},_0x52904c,_0x11f339[_0xb0d3('0x4f')]);var _0x476fe4={'where':_0x52904c[_0xb0d3('0x4c')]};return db[_0xb0d3('0x50')][_0xb0d3('0x1e')](_0x476fe4)['then'](function(_0x1a1791){_0x190513[_0xb0d3('0x1e')]=_0x1a1791;if(_0x11f339[_0xb0d3('0x30')][_0xb0d3('0x51')]){_0x52904c[_0xb0d3('0x52')]=[{'all':!![]}];}return db[_0xb0d3('0x50')][_0xb0d3('0x53')](_0x52904c);})['then'](function(_0x279674){_0x190513[_0xb0d3('0x54')]=_0x279674;return _0x190513;})[_0xb0d3('0x23')](respondWithFilteredResult(_0x34f52b,_0x52904c))['catch'](handleError(_0x34f52b,null));};exports[_0xb0d3('0x55')]=function(_0x4dc370,_0x1917ea){var _0x3e434c={'raw':!![],'where':{'id':_0x4dc370[_0xb0d3('0x56')]['id']}},_0x398718={};_0x398718[_0xb0d3('0x42')]=_[_0xb0d3('0x2e')](db[_0xb0d3('0x50')][_0xb0d3('0x57')]);_0x398718['query']=_[_0xb0d3('0x2e')](_0x4dc370['query']);_0x398718['filters']=_[_0xb0d3('0x2f')](_0x398718[_0xb0d3('0x42')],_0x398718['query']);_0x3e434c[_0xb0d3('0x45')]=_[_0xb0d3('0x2f')](_0x398718[_0xb0d3('0x42')],qs[_0xb0d3('0x43')](_0x4dc370[_0xb0d3('0x30')]['fields']));_0x3e434c[_0xb0d3('0x45')]=_0x3e434c[_0xb0d3('0x45')]['length']?_0x3e434c['attributes']:_0x398718[_0xb0d3('0x42')];if(_0x4dc370[_0xb0d3('0x30')][_0xb0d3('0x51')]){_0x3e434c['include']=[{'all':!![]}];}_0x3e434c=_[_0xb0d3('0x4d')]({},_0x3e434c,_0x4dc370['options']);return db['CmHopper']['find'](_0x3e434c)['then'](handleEntityNotFound(_0x1917ea,null))[_0xb0d3('0x23')](respondWithResult(_0x1917ea,null))[_0xb0d3('0x58')](handleError(_0x1917ea,null));};exports['create']=function(_0xfa3e5f,_0xd1a82f){return db[_0xb0d3('0x50')][_0xb0d3('0x59')](_0xfa3e5f[_0xb0d3('0x5a')],{})['then'](respondWithResult(_0xd1a82f,0xc9))[_0xb0d3('0x58')](handleError(_0xd1a82f,null));};exports[_0xb0d3('0x22')]=function(_0x391878,_0x35e53f){if(_0x391878[_0xb0d3('0x5a')]['id']){delete _0x391878[_0xb0d3('0x5a')]['id'];}return db[_0xb0d3('0x50')][_0xb0d3('0x5b')]({'where':{'id':_0x391878[_0xb0d3('0x56')]['id']}})['then'](handleEntityNotFound(_0x35e53f,null))['then'](saveUpdates(_0x391878['body'],null))[_0xb0d3('0x23')](respondWithResult(_0x35e53f,null))[_0xb0d3('0x58')](handleError(_0x35e53f,null));};exports[_0xb0d3('0x5c')]=function(_0x515f0d,_0xe7176c){return db[_0xb0d3('0x50')][_0xb0d3('0x5c')]()[_0xb0d3('0x23')](respondWithResult(_0xe7176c,null))['catch'](handleError(_0xe7176c,null));};exports[_0xb0d3('0x5d')]=function(_0x4e1151,_0x5550cd){var _0x3e3856;return db['CmHopper'][_0xb0d3('0x5b')]({'where':{'id':_0x4e1151[_0xb0d3('0x56')]['id']}})[_0xb0d3('0x23')](handleEntityNotFound(_0x5550cd,null))[_0xb0d3('0x23')](function(_0x24fce3){if(_0x24fce3){return _0x24fce3[_0xb0d3('0x5d')]()[_0xb0d3('0x23')](function(_0x5c0144){return _0x5c0144;});}})[_0xb0d3('0x23')](function(_0x5b66c2){_0x3e3856=_0x5b66c2;if(_0x5b66c2){if(_0x5b66c2['VoiceQueueId']||_0x5b66c2[_0xb0d3('0x5e')]){return db[_0x5b66c2[_0xb0d3('0x5f')]?'VoiceQueue':_0xb0d3('0x60')][_0xb0d3('0x5b')]({'where':{'id':_0x5b66c2['VoiceQueueId']?_0x5b66c2[_0xb0d3('0x5f')]:_0x5b66c2[_0xb0d3('0x5e')]},'attributes':['id','name'],'raw':!![]});}}})[_0xb0d3('0x23')](function(_0x210e91){var _0x187999={};if(_0x210e91){_[_0xb0d3('0x4d')](_0x187999,_[_0xb0d3('0x61')](_0x3e3856[_0xb0d3('0x62')],[_0xb0d3('0x63'),_0xb0d3('0x64'),'id']));_0x187999[_0xb0d3('0x65')]=0x15;_0x187999[_0xb0d3('0x66')]=_0xb0d3('0x67');_0x187999[_0xb0d3('0x68')]=_0x210e91[_0xb0d3('0x27')];_0x187999[_0xb0d3('0x69')]=_0x4e1151['user'][_0xb0d3('0x27')];_0x187999[_0xb0d3('0x6a')]=_0x4e1151['user']['id'];_0x187999[_0xb0d3('0x67')]=!![];_0x187999[_0xb0d3('0x6b')]=moment()['format'](_0xb0d3('0x6c'));_0x187999[_0xb0d3('0x6d')]=_0x3e3856[_0xb0d3('0x6e')];_0x187999['campaigntype']=_0x3e3856[_0xb0d3('0x5f')]?'queue':_0xb0d3('0x6f');return db[_0xb0d3('0x70')]['find']({'where':{'id':_0x187999['ContactId']},'attributes':[_0xb0d3('0x71'),_0xb0d3('0x72')]})[_0xb0d3('0x23')](function(_0x231625){if(!_[_0xb0d3('0x73')](_0x5550cd)&&!_['isNil'](_0x231625[_0xb0d3('0x71')])){_0x187999[_0xb0d3('0x74')]=_0x231625[_0xb0d3('0x71')];if(!_[_0xb0d3('0x73')](_0x231625[_0xb0d3('0x72')])){_0x187999[_0xb0d3('0x74')]+='\x20'+_0x231625['lastName'];}}})[_0xb0d3('0x75')](function(){return db[_0xb0d3('0x76')][_0xb0d3('0x59')](_0x187999);});}})[_0xb0d3('0x23')](function(){return _0x5550cd[_0xb0d3('0x18')](0xcc)[_0xb0d3('0x19')]();})[_0xb0d3('0x58')](handleError(_0x5550cd,null));};exports[_0xb0d3('0x77')]=function(_0x507343,_0x29edff,_0x24de1a){var _0x1f20be=[];return db[_0xb0d3('0x70')][_0xb0d3('0x5c')]()[_0xb0d3('0x23')](function(_0x47932a){_0x1f20be=_[_0xb0d3('0x2e')](_0x47932a);return _0x507343[_0xb0d3('0x78')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xb0d3('0x79'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x378c51){if(_0x378c51&&_0x378c51[_0xb0d3('0x44')]){return db[_0xb0d3('0x7a')][_0xb0d3('0x7b')](function(_0x1336e1){var _0x43575a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb0d3('0x7c')](_0xb0d3('0x6c'))},'VoiceQueueId':{'$in':_[_0xb0d3('0x2a')](_0x378c51,'id')},'$or':[{'UserId':null},{'UserId':_0x507343['user']['id']}]};var _0x12d43c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x378c51)[_0xb0d3('0x7d')]([_0xb0d3('0x7e'),0x0])[_0xb0d3('0x2a')]('id')[_0xb0d3('0x7f')]()},'$or':[{'UserId':null},{'UserId':_0x507343[_0xb0d3('0x78')]['id']}]};var _0x2fc275={'$or':[_0x43575a,_0x12d43c]};var _0x4850a5=[];if(_0x507343[_0xb0d3('0x5a')][_0xb0d3('0x80')]&&_0x507343[_0xb0d3('0x5a')][_0xb0d3('0x80')]===_0xb0d3('0x81')){if(!_[_0xb0d3('0x82')](_0x507343[_0xb0d3('0x5a')][_0xb0d3('0x83')])){_0x2fc275['id']={'$in':_0x507343[_0xb0d3('0x5a')][_0xb0d3('0x83')]};}_0x4850a5=[[_0xb0d3('0x84'),'ASC'],[_0xb0d3('0x85'),_0x378c51[0x0][_0xb0d3('0x79')]==='ASC'?'DESC':_0xb0d3('0x86')],db['sequelize'][_0xb0d3('0x87')](_0xb0d3('0x88')),['id','DESC']];}else{if(!_[_0xb0d3('0x82')](_0x507343[_0xb0d3('0x5a')]['hopperIds'])){_0x2fc275['id']={'$notIn':_0x507343['body'][_0xb0d3('0x83')]};}_0x4850a5=[['priority',_0xb0d3('0x89')],[_0xb0d3('0x85'),_0x378c51[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xb0d3('0x87')](_0xb0d3('0x8a')),['id','ASC']];}return db[_0xb0d3('0x50')]['findOne']({'attributes':['id',_0xb0d3('0x8b'),'recallme'],'where':_0x2fc275,'order':_0x4850a5,'transaction':_0x1336e1,'lock':_0x1336e1['LOCK'][_0xb0d3('0x8c')],'include':[{'model':db[_0xb0d3('0x70')],'as':_0xb0d3('0x8d'),'attributes':_0x1f20be,'include':[{'model':db[_0xb0d3('0x8e')],'as':_0xb0d3('0x8f'),'attributes':['id',_0xb0d3('0x27')]}]},{'model':db[_0xb0d3('0x90')],'as':_0xb0d3('0x91'),'attributes':['id',_0xb0d3('0x27')]},{'model':db['VoiceQueue'],'as':_0xb0d3('0x92'),'attributes':['id',_0xb0d3('0x27'),_0xb0d3('0x93')]}]})[_0xb0d3('0x23')](function(_0xecb45b){if(_0xecb45b){return _0xecb45b[_0xb0d3('0x22')]({'UserId':_0x507343[_0xb0d3('0x78')]['id']},{'transaction':_0x1336e1});}});});}})[_0xb0d3('0x23')](handleEntityNotFound(_0x29edff,null))[_0xb0d3('0x23')](respondWithResult(_0x29edff,null))[_0xb0d3('0x58')](handleError(_0x29edff,null));};exports['getOpenContacts']=function(_0x38e164,_0x41297a,_0x1ddef7){return _0x38e164['user'][_0xb0d3('0x94')]({'where':{'type':_0xb0d3('0x95'),'dialActive':!![],'dialMethod':_0xb0d3('0x96')},'attributes':['id'],'raw':!![]})['then'](function(_0x1a471e){if(_0x1a471e&&_0x1a471e['length']){return db[_0xb0d3('0x50')][_0xb0d3('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xb0d3('0x6c'))},'VoiceQueueId':{'$in':_[_0xb0d3('0x2a')](_0x1a471e,'id')},'$or':[{'UserId':null},{'UserId':_0x38e164['user']['id']}]}});}return 0x0;})[_0xb0d3('0x23')](function(_0x1dbc00){if(!_[_0xb0d3('0x73')](_0x1dbc00)&&_[_0xb0d3('0x97')](_0x1dbc00)){return _0x41297a[_0xb0d3('0x18')](0xc8)['json']({'contacts':_0x1dbc00});}else{logger['error'](_0xb0d3('0x98'),_0xb0d3('0x99'),0x194,_0xb0d3('0x9a'));_0x41297a[_0xb0d3('0x24')](0x194);}})['catch'](handleError(_0x41297a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fc278a4..e27c48b 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 _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x326311,_0x1342cc){var _0x1cb4be=function(_0x183231){while(--_0x183231){_0x326311['push'](_0x326311['shift']());}};_0x1cb4be(++_0x1342cc);}(_0x5fab,0x177));var _0xb5fa=function(_0x194adf,_0x220258){_0x194adf=_0x194adf-0x0;var _0x2242e3=_0x5fab[_0x194adf];return _0x2242e3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird'];(function(_0x5362c8,_0x578457){var _0x2eabce=function(_0x4c45ed){while(--_0x4c45ed){_0x5362c8['push'](_0x5362c8['shift']());}};_0x2eabce(++_0x578457);}(_0x33af,0xec));var _0xf33a=function(_0x2b6c01,_0x4a1d39){_0x2b6c01=_0x2b6c01-0x0;var _0x4c051e=_0x33af[_0x2b6c01];return _0x4c051e;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xc')]},{'name':'phone','fields':[_0xf33a('0xd')]},{'name':_0xf33a('0xe'),'fields':[_0xf33a('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 099f63a..0769ece 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 _0xb880=['transaction','ResetActiveCalls','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','options','raw','where','include','model','map','attributes','then','debug','find','ShowCmHopper','CreateCmHopper','update','body','limit','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','CmHopper','destroy','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','keys','User','Agent','push','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','UserId','GetContactRecallMe','GetCmHopperPreview','Contact'];(function(_0x2423d7,_0xe6ec57){var _0x151d17=function(_0x559e15){while(--_0x559e15){_0x2423d7['push'](_0x2423d7['shift']());}};_0x151d17(++_0xe6ec57);}(_0xb880,0x1d6));var _0x0b88=function(_0x558986,_0x2b7797){_0x558986=_0x558986-0x0;var _0x3be50d=_0xb880[_0x558986];return _0x3be50d;};'use strict';var _=require(_0x0b88('0x0'));var util=require(_0x0b88('0x1'));var moment=require(_0x0b88('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b88('0x3'));var fs=require('fs');var Redis=require(_0x0b88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b88('0x5'));var logger=require(_0x0b88('0x6'))(_0x0b88('0x7'));var config=require(_0x0b88('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0b88('0x9')][_0x0b88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3072de,_0x31812e,_0x1cdd7a){return new BPromise(function(_0x183ea9,_0x439c78){return client[_0x0b88('0xb')](_0x3072de,_0x1cdd7a)['then'](function(_0x372941){logger[_0x0b88('0xc')]('CmHopper,\x20%s,\x20%s',_0x31812e,_0x0b88('0xd'));logger['debug'](_0x0b88('0xe'),_0x31812e,_0x0b88('0xd'),JSON[_0x0b88('0xf')](_0x372941));if(_0x372941['error']){if(_0x372941[_0x0b88('0x10')][_0x0b88('0x11')]===0x1f4){logger[_0x0b88('0x10')](_0x0b88('0x12'),_0x31812e,_0x372941[_0x0b88('0x10')]['message']);return _0x439c78(_0x372941[_0x0b88('0x10')][_0x0b88('0x13')]);}logger[_0x0b88('0x10')](_0x0b88('0x12'),_0x31812e,_0x372941['error'][_0x0b88('0x13')]);return _0x183ea9(_0x372941[_0x0b88('0x10')]['message']);}else{logger['info'](_0x0b88('0x12'),_0x31812e,_0x0b88('0xd'));_0x183ea9(_0x372941[_0x0b88('0x14')]['message']);}})[_0x0b88('0x15')](function(_0x262e12){logger[_0x0b88('0x10')](_0x0b88('0x12'),_0x31812e,_0x262e12);_0x439c78(_0x262e12);});});}exports[_0x0b88('0x16')]=function(_0x5b4082){var _0x44bd7b=this;return new Promise(function(_0x30e13c,_0x35860f){return db['CmHopper']['findAll']({'raw':_0x5b4082[_0x0b88('0x17')]?_0x5b4082[_0x0b88('0x17')][_0x0b88('0x18')]===undefined?!![]:![]:!![],'where':_0x5b4082[_0x0b88('0x17')]?_0x5b4082[_0x0b88('0x17')][_0x0b88('0x19')]||null:null,'attributes':_0x5b4082[_0x0b88('0x17')]?_0x5b4082[_0x0b88('0x17')]['attributes']||null:null,'limit':_0x5b4082['options']?_0x5b4082[_0x0b88('0x17')]['limit']||null:null,'include':_0x5b4082[_0x0b88('0x17')]?_0x5b4082[_0x0b88('0x17')][_0x0b88('0x1a')]?_['map'](_0x5b4082[_0x0b88('0x17')][_0x0b88('0x1a')],function(_0x2999be){return{'model':db[_0x2999be[_0x0b88('0x1b')]],'as':_0x2999be['as'],'attributes':_0x2999be['attributes'],'include':_0x2999be[_0x0b88('0x1a')]?_[_0x0b88('0x1c')](_0x2999be[_0x0b88('0x1a')],function(_0x342667){return{'model':db[_0x342667[_0x0b88('0x1b')]],'as':_0x342667['as'],'attributes':_0x342667['attributes'],'include':_0x342667[_0x0b88('0x1a')]?_['map'](_0x342667[_0x0b88('0x1a')],function(_0x12633a){return{'model':db[_0x12633a[_0x0b88('0x1b')]],'as':_0x12633a['as'],'attributes':_0x12633a[_0x0b88('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b88('0x1e')](function(_0x544127){logger['info'](_0x0b88('0x16'),_0x5b4082);logger[_0x0b88('0x1f')]('GetCmHopper',_0x5b4082,JSON['stringify'](_0x544127));_0x30e13c(_0x544127);})[_0x0b88('0x15')](function(_0x7fddde){logger[_0x0b88('0x10')](_0x0b88('0x16'),_0x7fddde[_0x0b88('0x13')],_0x5b4082);_0x35860f(_0x44bd7b[_0x0b88('0x10')](0x1f4,_0x7fddde['message']));});});};exports['ShowCmHopper']=function(_0x12a1d1){var _0x46ebc0=this;return new Promise(function(_0x1c19d5,_0x1153c4){return db['CmHopper'][_0x0b88('0x20')]({'raw':_0x12a1d1[_0x0b88('0x17')]?_0x12a1d1[_0x0b88('0x17')][_0x0b88('0x18')]===undefined?!![]:![]:!![],'where':_0x12a1d1[_0x0b88('0x17')]?_0x12a1d1[_0x0b88('0x17')][_0x0b88('0x19')]||null:null,'attributes':_0x12a1d1['options']?_0x12a1d1[_0x0b88('0x17')][_0x0b88('0x1d')]||null:null,'include':_0x12a1d1['options']?_0x12a1d1[_0x0b88('0x17')][_0x0b88('0x1a')]?_[_0x0b88('0x1c')](_0x12a1d1['options'][_0x0b88('0x1a')],function(_0x53f81){return{'model':db[_0x53f81['model']],'as':_0x53f81['as'],'attributes':_0x53f81['attributes'],'include':_0x53f81['include']?_[_0x0b88('0x1c')](_0x53f81[_0x0b88('0x1a')],function(_0x48dfa7){return{'model':db[_0x48dfa7[_0x0b88('0x1b')]],'as':_0x48dfa7['as'],'attributes':_0x48dfa7[_0x0b88('0x1d')],'include':_0x48dfa7[_0x0b88('0x1a')]?_[_0x0b88('0x1c')](_0x48dfa7[_0x0b88('0x1a')],function(_0xffedc8){return{'model':db[_0xffedc8[_0x0b88('0x1b')]],'as':_0xffedc8['as'],'attributes':_0xffedc8['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b88('0x1e')](function(_0x80627e){logger[_0x0b88('0xc')]('ShowCmHopper',_0x12a1d1);logger[_0x0b88('0x1f')](_0x0b88('0x21'),_0x12a1d1,JSON['stringify'](_0x80627e));_0x1c19d5(_0x80627e);})['catch'](function(_0x571079){logger['error'](_0x0b88('0x21'),_0x571079['message'],_0x12a1d1);_0x1153c4(_0x46ebc0[_0x0b88('0x10')](0x1f4,_0x571079[_0x0b88('0x13')]));});});};exports[_0x0b88('0x22')]=function(_0x399a7a){var _0x9e20f7=this;return new Promise(function(_0x27a987,_0x57d33f){return db['CmHopper']['create'](_0x399a7a['body'],{'raw':_0x399a7a[_0x0b88('0x17')]?_0x399a7a[_0x0b88('0x17')][_0x0b88('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x130b4a){logger[_0x0b88('0xc')](_0x0b88('0x22'),_0x399a7a);logger[_0x0b88('0x1f')](_0x0b88('0x22'),_0x399a7a,JSON[_0x0b88('0xf')](_0x130b4a));_0x27a987(_0x130b4a);})['catch'](function(_0x4b538a){logger[_0x0b88('0x10')](_0x0b88('0x22'),_0x4b538a['message'],_0x399a7a);_0x57d33f(_0x9e20f7[_0x0b88('0x10')](0x1f4,_0x4b538a[_0x0b88('0x13')]));});});};exports['UpdateCmHopper']=function(_0x423e4a){var _0x549849=this;return new Promise(function(_0x519413,_0x4bdd05){return db['CmHopper'][_0x0b88('0x23')](_0x423e4a[_0x0b88('0x24')],{'raw':_0x423e4a[_0x0b88('0x17')]?_0x423e4a['options'][_0x0b88('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x423e4a[_0x0b88('0x17')]?_0x423e4a[_0x0b88('0x17')][_0x0b88('0x19')]||null:null,'attributes':_0x423e4a[_0x0b88('0x17')]?_0x423e4a[_0x0b88('0x17')][_0x0b88('0x1d')]||null:null,'limit':_0x423e4a[_0x0b88('0x17')]?_0x423e4a['options'][_0x0b88('0x25')]||null:null})[_0x0b88('0x1e')](function(_0x13f69a){logger[_0x0b88('0xc')](_0x0b88('0x26'),_0x423e4a);logger['info'](_0x0b88('0x27'),JSON[_0x0b88('0xf')](_0x423e4a[_0x0b88('0x17')][_0x0b88('0x19')]),_0x423e4a[_0x0b88('0x24')][_0x0b88('0x28')]);logger[_0x0b88('0x1f')](_0x0b88('0x26'),_0x423e4a,JSON[_0x0b88('0xf')](_0x13f69a));_0x519413(_0x13f69a);})[_0x0b88('0x15')](function(_0x53545d){logger[_0x0b88('0x10')](_0x0b88('0x26'),_0x53545d[_0x0b88('0x13')],_0x423e4a);_0x4bdd05(_0x549849[_0x0b88('0x10')](0x1f4,_0x53545d['message']));});});};exports[_0x0b88('0x29')]=function(_0x364f81){var _0x2a5743=this;return new Promise(function(_0xdfbbb5,_0x26a97d){return db[_0x0b88('0x2a')][_0x0b88('0x2b')]({'where':_0x364f81[_0x0b88('0x17')]?_0x364f81[_0x0b88('0x17')]['where']||null:null})[_0x0b88('0x1e')](function(_0x3b33e5){logger[_0x0b88('0xc')]('DestroyCmHopper',_0x364f81);logger[_0x0b88('0x1f')](_0x0b88('0x29'),_0x364f81,JSON[_0x0b88('0xf')](_0x3b33e5));_0xdfbbb5(_0x3b33e5);})[_0x0b88('0x15')](function(_0x3c7851){logger['error'](_0x0b88('0x29'),_0x3c7851[_0x0b88('0x13')],_0x364f81);_0x26a97d(_0x2a5743[_0x0b88('0x10')](0x1f4,_0x3c7851[_0x0b88('0x13')]));});});};exports['GetContactDialer']=function(_0x3dace0){var _0xac8a1e=this;return new Promise(function(_0x44017a,_0x334ef3){return db[_0x0b88('0x2c')][_0x0b88('0x2d')]()[_0x0b88('0x1e')](function(_0x3f6746){return db[_0x0b88('0x2e')]['transaction'](function(_0x44b184){return db[_0x0b88('0x2a')][_0x0b88('0x2f')]({'where':_0x3dace0[_0x0b88('0x17')]?_0x3dace0[_0x0b88('0x17')]['where']||null:null,'attributes':_0x3dace0[_0x0b88('0x17')]?_0x3dace0[_0x0b88('0x17')][_0x0b88('0x1d')]||null:null,'limit':_0x3dace0[_0x0b88('0x17')]?_0x3dace0[_0x0b88('0x17')][_0x0b88('0x25')]||null:null,'order':_0x3dace0[_0x0b88('0x17')]?_0x3dace0[_0x0b88('0x17')][_0x0b88('0x30')]||null:null,'transaction':_0x44b184,'lock':_0x44b184[_0x0b88('0x31')][_0x0b88('0x32')],'include':[{'model':db[_0x0b88('0x2c')],'as':'Contact','attributes':_[_0x0b88('0x33')](_0x3f6746)},{'model':db[_0x0b88('0x34')],'as':_0x0b88('0x35'),'attributes':['id','name','voicePause']}]})[_0x0b88('0x1e')](function(_0x219f11){var _0x330395=[];var _0x45e28d=[];for(var _0x5bd419=0x0;_0x5bd419<_0x219f11['length'];_0x5bd419+=0x1){var _0x16d51c=_0x219f11[_0x5bd419]['UserId'];if(_0x16d51c===null){_0x330395[_0x0b88('0x36')](_0x219f11[_0x5bd419][_0x0b88('0x23')](_0x3dace0[_0x0b88('0x24')],{'transaction':_0x44b184}));}else if(!_0x45e28d[_0x0b88('0x37')](_0x16d51c)){_0x45e28d[_0x0b88('0x36')](_0x16d51c);_0x330395['push'](_0x219f11[_0x5bd419][_0x0b88('0x23')](_0x3dace0[_0x0b88('0x24')],{'transaction':_0x44b184}));}}return BPromise[_0x0b88('0x38')](_0x330395);});})['then'](function(_0x34b4ed){logger[_0x0b88('0xc')](_0x0b88('0x39'),_0x3dace0);if(_0x34b4ed[_0x0b88('0x3a')]>0x0){logger[_0x0b88('0xc')](_0x0b88('0x3b'),_0x34b4ed[0x0]['dataValues']['id'],_0x34b4ed[0x0]['dataValues'][_0x0b88('0x3c')],_0x34b4ed[0x0]['dataValues'][_0x0b88('0x28')]);}logger[_0x0b88('0x1f')](_0x0b88('0x39'),_0x3dace0,JSON[_0x0b88('0xf')](_0x34b4ed));_0x44017a(_0x34b4ed);})['catch'](function(_0x38bdaf){logger[_0x0b88('0x10')]('GetContactDialer',_0x38bdaf[_0x0b88('0x13')],_0x3dace0);_0x334ef3(_0xac8a1e['error'](0x1f4,_0x38bdaf[_0x0b88('0x13')]));});});});};exports[_0x0b88('0x3d')]=function(_0x5b5efe){var _0x34bded=this;return new Promise(function(_0x16a7f0,_0x5a98fd){return db[_0x0b88('0x2e')]['transaction'](function(_0x4103a7){return db[_0x0b88('0x3e')][_0x0b88('0x3f')](_0x5b5efe[_0x0b88('0x24')],{'raw':_0x5b5efe[_0x0b88('0x17')]?_0x5b5efe[_0x0b88('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4103a7})['then'](function(){logger[_0x0b88('0xc')](_0x0b88('0x40'),JSON[_0x0b88('0xf')](_0x5b5efe[_0x0b88('0x17')]['where']),_0x5b5efe['options'][_0x0b88('0x19')][_0x0b88('0x28')]);return db['CmHopper']['destroy']({'where':_0x5b5efe[_0x0b88('0x17')]?_0x5b5efe[_0x0b88('0x17')][_0x0b88('0x19')]||null:null,'transaction':_0x4103a7});});})[_0x0b88('0x1e')](function(_0xd0ca64){logger['info'](_0x0b88('0x3d'),_0x5b5efe);logger[_0x0b88('0x1f')]('MoveContactManagedDialer',_0x5b5efe,JSON[_0x0b88('0xf')](_0xd0ca64));_0x16a7f0(_0xd0ca64);})['catch'](function(_0x18f1e2){logger[_0x0b88('0x10')](_0x0b88('0x3d'),_0x18f1e2[_0x0b88('0x13')],_0x5b5efe);_0x5a98fd(_0x34bded[_0x0b88('0x10')](0x1f4,_0x18f1e2[_0x0b88('0x13')]));});});};exports['CountReScheduled']=function(_0xaac41){var _0x1b975a=this;return new Promise(function(_0xdf5ed1,_0x365824){return db['CmHopper'][_0x0b88('0x2f')]({'raw':_0xaac41[_0x0b88('0x17')]?_0xaac41['options'][_0x0b88('0x18')]===undefined?!![]:![]:!![],'where':_0xaac41[_0x0b88('0x17')]?_0xaac41[_0x0b88('0x17')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x0b88('0x41'),db['sequelize']['fn']('IF',db[_0x0b88('0x2e')][_0x0b88('0x42')]('`scheduledat`\x20>=\x20'+util[_0x0b88('0x43')](_0x0b88('0x44'),moment()[_0x0b88('0x43')](_0x0b88('0x45')))+_0x0b88('0x46')))),'contactsRescheduled']]})[_0x0b88('0x1e')](function(_0xce2d04){logger[_0x0b88('0xc')](_0x0b88('0x47'),_0xaac41);logger[_0x0b88('0x1f')]('CountReScheduled',_0xaac41,JSON[_0x0b88('0xf')](_0xce2d04));_0xdf5ed1(_0xce2d04);})['catch'](function(_0x4921a7){logger[_0x0b88('0x10')](_0x0b88('0x47'),_0x4921a7['message'],_0xaac41);_0x365824(_0x1b975a['error'](0x1f4,_0x4921a7['message']));});});};exports['GetContactRecallMe']=function(_0xdd93d1){var _0x3aaeee=this;return new Promise(function(_0x529d56,_0x38b4e1){return db[_0x0b88('0x2c')][_0x0b88('0x2d')]()['then'](function(_0x382fc0){return db[_0x0b88('0x2e')]['transaction'](function(_0x2e7b1c){return db[_0x0b88('0x2a')]['findAll']({'where':_0xdd93d1[_0x0b88('0x17')]?_0xdd93d1[_0x0b88('0x17')][_0x0b88('0x19')]||null:null,'attributes':_0xdd93d1[_0x0b88('0x17')]?_0xdd93d1[_0x0b88('0x17')][_0x0b88('0x1d')]||null:null,'limit':0x1,'order':_0xdd93d1[_0x0b88('0x17')]?_0xdd93d1['options']['order']||null:null,'group':db[_0x0b88('0x2a')][_0x0b88('0x48')],'transaction':_0x2e7b1c,'lock':_0x2e7b1c[_0x0b88('0x31')][_0x0b88('0x32')],'include':_0xdd93d1[_0x0b88('0x17')]?_0xdd93d1[_0x0b88('0x17')][_0x0b88('0x1a')]?_[_0x0b88('0x1c')](_0xdd93d1[_0x0b88('0x17')][_0x0b88('0x1a')],function(_0x5dc8f8){return{'model':db[_0x5dc8f8[_0x0b88('0x1b')]],'as':_0x5dc8f8['as'],'attributes':_0x5dc8f8['attributes'],'include':_0x5dc8f8[_0x0b88('0x1a')]?_[_0x0b88('0x1c')](_0x5dc8f8[_0x0b88('0x1a')],function(_0x1da006){return{'model':db[_0x1da006['model']],'as':_0x1da006['as'],'attributes':_0x1da006[_0x0b88('0x1d')],'include':_0x1da006[_0x0b88('0x1a')]?_['map'](_0x1da006[_0x0b88('0x1a')],function(_0x593be4){return{'model':db[_0x593be4[_0x0b88('0x1b')]],'as':_0x593be4['as'],'attributes':_0x593be4[_0x0b88('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b88('0x1e')](function(_0x4e99fa){var _0x4b1b80=[];for(var _0x3189c0=0x0;_0x3189c0<_0x4e99fa[_0x0b88('0x3a')];_0x3189c0+=0x1){_0x4b1b80[_0x0b88('0x36')](_0x4e99fa[_0x3189c0][_0x0b88('0x23')](_0xdd93d1[_0x0b88('0x24')],{'transaction':_0x2e7b1c}));}return BPromise[_0x0b88('0x38')](_0x4b1b80);});})[_0x0b88('0x1e')](function(_0x4c25d5){logger[_0x0b88('0xc')]('GetContactRecallMe',_0xdd93d1);logger[_0x0b88('0x1f')](_0x0b88('0x49'),_0xdd93d1,JSON[_0x0b88('0xf')](_0x4c25d5));_0x529d56(_0x4c25d5);})[_0x0b88('0x15')](function(_0x25a633){logger[_0x0b88('0x10')](_0x0b88('0x49'),_0x25a633['message'],_0xdd93d1);_0x38b4e1(_0x3aaeee['error'](0x1f4,_0x25a633[_0x0b88('0x13')]));});});});};exports[_0x0b88('0x4a')]=function(_0x10e234){var _0x3cc61e=this;return new Promise(function(_0x3cd1b0,_0x2f536e){db['CmContact'][_0x0b88('0x2d')]()[_0x0b88('0x1e')](function(_0x5b2efd){return db['CmHopper'][_0x0b88('0x2f')]({'raw':_0x10e234[_0x0b88('0x17')]?_0x10e234[_0x0b88('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x10e234[_0x0b88('0x17')]?_0x10e234['options'][_0x0b88('0x19')]||null:null,'attributes':_0x10e234[_0x0b88('0x17')]?_0x10e234[_0x0b88('0x17')][_0x0b88('0x1d')]||null:null,'limit':_0x10e234[_0x0b88('0x17')]?_0x10e234[_0x0b88('0x17')][_0x0b88('0x25')]||null:null,'include':_0x10e234['options']?_0x10e234['options'][_0x0b88('0x1a')]?_['map'](_0x10e234['options']['include'],function(_0x27c1b0){return{'model':db[_0x27c1b0['model']],'as':_0x27c1b0['as'],'attributes':_0x27c1b0['as']===_0x0b88('0x4b')?_[_0x0b88('0x33')](_0x5b2efd):_0x27c1b0[_0x0b88('0x1d')],'include':_0x27c1b0['include']?_['map'](_0x27c1b0[_0x0b88('0x1a')],function(_0x860d62){return{'model':db[_0x860d62['model']],'as':_0x860d62['as'],'attributes':_0x860d62['attributes'],'include':_0x860d62['include']?_['map'](_0x860d62['include'],function(_0x227808){return{'model':db[_0x227808[_0x0b88('0x1b')]],'as':_0x227808['as'],'attributes':_0x227808[_0x0b88('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b88('0x1e')](function(_0x1a5ab5){logger[_0x0b88('0xc')](_0x0b88('0x16'),_0x10e234);logger['debug'](_0x0b88('0x16'),_0x10e234,JSON[_0x0b88('0xf')](_0x1a5ab5));_0x3cd1b0(_0x1a5ab5);})['catch'](function(_0x2f0a6c){logger[_0x0b88('0x10')](_0x0b88('0x16'),_0x2f0a6c[_0x0b88('0x13')],_0x10e234);_0x2f536e(_0x3cc61e[_0x0b88('0x10')](0x1f4,_0x2f0a6c[_0x0b88('0x13')]));});});});};exports['ResetActiveCalls']=function(_0x405451){var _0x4706b2=this;return new Promise(function(_0x4ff286,_0x159c84){return db[_0x0b88('0x2e')][_0x0b88('0x4c')](function(_0x589da1){return db[_0x0b88('0x2a')][_0x0b88('0x23')]({'active':![]},{'where':{},'transaction':_0x589da1})[_0x0b88('0x1e')](function(_0xf80282){logger['info'](_0x0b88('0x4d'),_0x405451);logger[_0x0b88('0x1f')](_0x0b88('0x4d'),_0x405451,JSON['stringify'](_0xf80282));_0x4ff286(_0xf80282);})[_0x0b88('0x15')](function(_0x22202f){logger[_0x0b88('0x10')](_0x0b88('0x4d'),_0x22202f[_0x0b88('0x13')],_0x405451);_0x159c84(_0x4706b2[_0x0b88('0x10')](0x1f4,_0x22202f[_0x0b88('0x13')]));});});});}; \ No newline at end of file +var _0xad13=['debug','ShowCmHopper','find','CreateCmHopper','body','catch','UpdateCmHopper','active','DestroyCmHopper','destroy','CmContact','describe','transaction','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','update','includes','all','GetContactDialer','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','findAll','sequelize','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','order','GetContactRecallMe','ResetActiveCalls','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopper','CmHopper','options','raw','where','limit','include','map','model','attributes'];(function(_0x3249e5,_0x449631){var _0x1618ce=function(_0x3a1451){while(--_0x3a1451){_0x3249e5['push'](_0x3249e5['shift']());}};_0x1618ce(++_0x449631);}(_0xad13,0x10b));var _0x3ad1=function(_0x18304a,_0x5d4c95){_0x18304a=_0x18304a-0x0;var _0x4750f=_0xad13[_0x18304a];return _0x4750f;};'use strict';var _=require(_0x3ad1('0x0'));var util=require(_0x3ad1('0x1'));var moment=require(_0x3ad1('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ad1('0x3'));var fs=require('fs');var Redis=require(_0x3ad1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3ad1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41e392,_0x6310fc,_0x40a4b6){return new BPromise(function(_0x4b8b2f,_0x1829de){return client[_0x3ad1('0x9')](_0x41e392,_0x40a4b6)[_0x3ad1('0xa')](function(_0x60d270){logger[_0x3ad1('0xb')](_0x3ad1('0xc'),_0x6310fc,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x6310fc,_0x3ad1('0xd'),JSON[_0x3ad1('0xe')](_0x60d270));if(_0x60d270[_0x3ad1('0xf')]){if(_0x60d270[_0x3ad1('0xf')][_0x3ad1('0x10')]===0x1f4){logger[_0x3ad1('0xf')](_0x3ad1('0xc'),_0x6310fc,_0x60d270[_0x3ad1('0xf')]['message']);return _0x1829de(_0x60d270[_0x3ad1('0xf')][_0x3ad1('0x11')]);}logger[_0x3ad1('0xf')]('CmHopper,\x20%s,\x20%s',_0x6310fc,_0x60d270['error'][_0x3ad1('0x11')]);return _0x4b8b2f(_0x60d270[_0x3ad1('0xf')][_0x3ad1('0x11')]);}else{logger[_0x3ad1('0xb')](_0x3ad1('0xc'),_0x6310fc,_0x3ad1('0xd'));_0x4b8b2f(_0x60d270[_0x3ad1('0x12')][_0x3ad1('0x11')]);}})['catch'](function(_0x25ae43){logger[_0x3ad1('0xf')](_0x3ad1('0xc'),_0x6310fc,_0x25ae43);_0x1829de(_0x25ae43);});});}exports[_0x3ad1('0x13')]=function(_0x12aa97){var _0x267253=this;return new Promise(function(_0x4403e5,_0x5d8c65){return db[_0x3ad1('0x14')]['findAll']({'raw':_0x12aa97[_0x3ad1('0x15')]?_0x12aa97[_0x3ad1('0x15')][_0x3ad1('0x16')]===undefined?!![]:![]:!![],'where':_0x12aa97[_0x3ad1('0x15')]?_0x12aa97[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null,'attributes':_0x12aa97[_0x3ad1('0x15')]?_0x12aa97[_0x3ad1('0x15')]['attributes']||null:null,'limit':_0x12aa97[_0x3ad1('0x15')]?_0x12aa97['options'][_0x3ad1('0x18')]||null:null,'include':_0x12aa97[_0x3ad1('0x15')]?_0x12aa97[_0x3ad1('0x15')][_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x12aa97[_0x3ad1('0x15')]['include'],function(_0x504275){return{'model':db[_0x504275['model']],'as':_0x504275['as'],'attributes':_0x504275['attributes'],'include':_0x504275[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x504275['include'],function(_0x579195){return{'model':db[_0x579195[_0x3ad1('0x1b')]],'as':_0x579195['as'],'attributes':_0x579195['attributes'],'include':_0x579195[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x579195[_0x3ad1('0x19')],function(_0x416e49){return{'model':db[_0x416e49[_0x3ad1('0x1b')]],'as':_0x416e49['as'],'attributes':_0x416e49[_0x3ad1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c9892){logger[_0x3ad1('0xb')](_0x3ad1('0x13'),_0x12aa97);logger[_0x3ad1('0x1d')](_0x3ad1('0x13'),_0x12aa97,JSON['stringify'](_0x3c9892));_0x4403e5(_0x3c9892);})['catch'](function(_0x5b44d6){logger[_0x3ad1('0xf')](_0x3ad1('0x13'),_0x5b44d6[_0x3ad1('0x11')],_0x12aa97);_0x5d8c65(_0x267253['error'](0x1f4,_0x5b44d6[_0x3ad1('0x11')]));});});};exports[_0x3ad1('0x1e')]=function(_0x263285){var _0x24e12c=this;return new Promise(function(_0x18baff,_0x548e9b){return db[_0x3ad1('0x14')][_0x3ad1('0x1f')]({'raw':_0x263285[_0x3ad1('0x15')]?_0x263285['options'][_0x3ad1('0x16')]===undefined?!![]:![]:!![],'where':_0x263285[_0x3ad1('0x15')]?_0x263285[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null,'attributes':_0x263285[_0x3ad1('0x15')]?_0x263285[_0x3ad1('0x15')][_0x3ad1('0x1c')]||null:null,'include':_0x263285[_0x3ad1('0x15')]?_0x263285['options'][_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x263285[_0x3ad1('0x15')]['include'],function(_0x483e13){return{'model':db[_0x483e13[_0x3ad1('0x1b')]],'as':_0x483e13['as'],'attributes':_0x483e13[_0x3ad1('0x1c')],'include':_0x483e13[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x483e13[_0x3ad1('0x19')],function(_0x5afc95){return{'model':db[_0x5afc95[_0x3ad1('0x1b')]],'as':_0x5afc95['as'],'attributes':_0x5afc95[_0x3ad1('0x1c')],'include':_0x5afc95['include']?_[_0x3ad1('0x1a')](_0x5afc95['include'],function(_0x1ccc7c){return{'model':db[_0x1ccc7c['model']],'as':_0x1ccc7c['as'],'attributes':_0x1ccc7c[_0x3ad1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43a7cc){logger['info'](_0x3ad1('0x1e'),_0x263285);logger[_0x3ad1('0x1d')](_0x3ad1('0x1e'),_0x263285,JSON[_0x3ad1('0xe')](_0x43a7cc));_0x18baff(_0x43a7cc);})['catch'](function(_0x11f14e){logger[_0x3ad1('0xf')](_0x3ad1('0x1e'),_0x11f14e[_0x3ad1('0x11')],_0x263285);_0x548e9b(_0x24e12c[_0x3ad1('0xf')](0x1f4,_0x11f14e['message']));});});};exports[_0x3ad1('0x20')]=function(_0x371b0f){var _0x220cf0=this;return new Promise(function(_0x356aba,_0x1b94f5){return db[_0x3ad1('0x14')]['create'](_0x371b0f[_0x3ad1('0x21')],{'raw':_0x371b0f[_0x3ad1('0x15')]?_0x371b0f[_0x3ad1('0x15')][_0x3ad1('0x16')]===undefined?!![]:![]:!![]})[_0x3ad1('0xa')](function(_0x15f528){logger['info'](_0x3ad1('0x20'),_0x371b0f);logger[_0x3ad1('0x1d')](_0x3ad1('0x20'),_0x371b0f,JSON['stringify'](_0x15f528));_0x356aba(_0x15f528);})[_0x3ad1('0x22')](function(_0x1e114a){logger[_0x3ad1('0xf')](_0x3ad1('0x20'),_0x1e114a[_0x3ad1('0x11')],_0x371b0f);_0x1b94f5(_0x220cf0[_0x3ad1('0xf')](0x1f4,_0x1e114a[_0x3ad1('0x11')]));});});};exports['UpdateCmHopper']=function(_0x2bb149){var _0x43f159=this;return new Promise(function(_0x3563e8,_0x3cf113){return db[_0x3ad1('0x14')]['update'](_0x2bb149[_0x3ad1('0x21')],{'raw':_0x2bb149[_0x3ad1('0x15')]?_0x2bb149[_0x3ad1('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb149['options']?_0x2bb149[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null,'attributes':_0x2bb149[_0x3ad1('0x15')]?_0x2bb149[_0x3ad1('0x15')][_0x3ad1('0x1c')]||null:null,'limit':_0x2bb149['options']?_0x2bb149['options']['limit']||null:null})[_0x3ad1('0xa')](function(_0x51c834){logger[_0x3ad1('0xb')](_0x3ad1('0x23'),_0x2bb149);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2bb149[_0x3ad1('0x15')][_0x3ad1('0x17')]),_0x2bb149[_0x3ad1('0x21')][_0x3ad1('0x24')]);logger[_0x3ad1('0x1d')]('UpdateCmHopper',_0x2bb149,JSON[_0x3ad1('0xe')](_0x51c834));_0x3563e8(_0x51c834);})[_0x3ad1('0x22')](function(_0x33da38){logger[_0x3ad1('0xf')](_0x3ad1('0x23'),_0x33da38['message'],_0x2bb149);_0x3cf113(_0x43f159['error'](0x1f4,_0x33da38[_0x3ad1('0x11')]));});});};exports[_0x3ad1('0x25')]=function(_0x15a902){var _0x52c733=this;return new Promise(function(_0x5608a6,_0x1f00ba){return db[_0x3ad1('0x14')][_0x3ad1('0x26')]({'where':_0x15a902[_0x3ad1('0x15')]?_0x15a902[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null})['then'](function(_0x1e1df2){logger['info']('DestroyCmHopper',_0x15a902);logger[_0x3ad1('0x1d')](_0x3ad1('0x25'),_0x15a902,JSON[_0x3ad1('0xe')](_0x1e1df2));_0x5608a6(_0x1e1df2);})['catch'](function(_0x2f13a9){logger['error'](_0x3ad1('0x25'),_0x2f13a9[_0x3ad1('0x11')],_0x15a902);_0x1f00ba(_0x52c733[_0x3ad1('0xf')](0x1f4,_0x2f13a9[_0x3ad1('0x11')]));});});};exports['GetContactDialer']=function(_0x213809){var _0x38077f=this;return new Promise(function(_0x443f05,_0x4a75b5){return db[_0x3ad1('0x27')][_0x3ad1('0x28')]()['then'](function(_0x3b82d4){return db['sequelize'][_0x3ad1('0x29')](function(_0xbd419b){return db[_0x3ad1('0x14')]['findAll']({'where':_0x213809[_0x3ad1('0x15')]?_0x213809['options'][_0x3ad1('0x17')]||null:null,'attributes':_0x213809[_0x3ad1('0x15')]?_0x213809[_0x3ad1('0x15')][_0x3ad1('0x1c')]||null:null,'limit':_0x213809[_0x3ad1('0x15')]?_0x213809[_0x3ad1('0x15')][_0x3ad1('0x18')]||null:null,'order':_0x213809[_0x3ad1('0x15')]?_0x213809[_0x3ad1('0x15')]['order']||null:null,'transaction':_0xbd419b,'lock':_0xbd419b[_0x3ad1('0x2a')][_0x3ad1('0x2b')],'include':[{'model':db[_0x3ad1('0x27')],'as':_0x3ad1('0x2c'),'attributes':_[_0x3ad1('0x2d')](_0x3b82d4)},{'model':db[_0x3ad1('0x2e')],'as':_0x3ad1('0x2f'),'attributes':['id',_0x3ad1('0x30'),_0x3ad1('0x31')]}]})[_0x3ad1('0xa')](function(_0xe88164){var _0x517ab7=[];var _0x5c2a32=[];for(var _0x230717=0x0;_0x230717<_0xe88164[_0x3ad1('0x32')];_0x230717+=0x1){var _0x3c45fb=_0xe88164[_0x230717][_0x3ad1('0x33')];if(_0x3c45fb===null){_0x517ab7[_0x3ad1('0x34')](_0xe88164[_0x230717][_0x3ad1('0x35')](_0x213809[_0x3ad1('0x21')],{'transaction':_0xbd419b}));}else if(!_0x5c2a32[_0x3ad1('0x36')](_0x3c45fb)){_0x5c2a32[_0x3ad1('0x34')](_0x3c45fb);_0x517ab7['push'](_0xe88164[_0x230717][_0x3ad1('0x35')](_0x213809['body'],{'transaction':_0xbd419b}));}}return BPromise[_0x3ad1('0x37')](_0x517ab7);});})[_0x3ad1('0xa')](function(_0x1bc602){logger['info'](_0x3ad1('0x38'),_0x213809);if(_0x1bc602[_0x3ad1('0x32')]>0x0){logger[_0x3ad1('0xb')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1bc602[0x0][_0x3ad1('0x39')]['id'],_0x1bc602[0x0][_0x3ad1('0x39')][_0x3ad1('0x3a')],_0x1bc602[0x0]['dataValues'][_0x3ad1('0x24')]);}logger[_0x3ad1('0x1d')](_0x3ad1('0x38'),_0x213809,JSON[_0x3ad1('0xe')](_0x1bc602));_0x443f05(_0x1bc602);})[_0x3ad1('0x22')](function(_0xb31a83){logger[_0x3ad1('0xf')](_0x3ad1('0x38'),_0xb31a83[_0x3ad1('0x11')],_0x213809);_0x4a75b5(_0x38077f[_0x3ad1('0xf')](0x1f4,_0xb31a83['message']));});});});};exports[_0x3ad1('0x3b')]=function(_0x37b510){var _0x257a3b=this;return new Promise(function(_0x41443e,_0x46ebf3){return db['sequelize'][_0x3ad1('0x29')](function(_0xf925ab){return db[_0x3ad1('0x3c')][_0x3ad1('0x3d')](_0x37b510[_0x3ad1('0x21')],{'raw':_0x37b510['options']?_0x37b510[_0x3ad1('0x15')][_0x3ad1('0x16')]===undefined?!![]:![]:!![],'transaction':_0xf925ab})['then'](function(){logger[_0x3ad1('0xb')](_0x3ad1('0x3e'),JSON[_0x3ad1('0xe')](_0x37b510[_0x3ad1('0x15')][_0x3ad1('0x17')]),_0x37b510[_0x3ad1('0x15')]['where'][_0x3ad1('0x24')]);return db['CmHopper']['destroy']({'where':_0x37b510[_0x3ad1('0x15')]?_0x37b510['options'][_0x3ad1('0x17')]||null:null,'transaction':_0xf925ab});});})[_0x3ad1('0xa')](function(_0xc5b6eb){logger[_0x3ad1('0xb')](_0x3ad1('0x3b'),_0x37b510);logger['debug'](_0x3ad1('0x3b'),_0x37b510,JSON[_0x3ad1('0xe')](_0xc5b6eb));_0x41443e(_0xc5b6eb);})[_0x3ad1('0x22')](function(_0x2341ea){logger['error']('MoveContactManagedDialer',_0x2341ea[_0x3ad1('0x11')],_0x37b510);_0x46ebf3(_0x257a3b[_0x3ad1('0xf')](0x1f4,_0x2341ea[_0x3ad1('0x11')]));});});};exports[_0x3ad1('0x3f')]=function(_0x5ccf2e){var _0x2bd9fa=this;return new Promise(function(_0xd0709,_0x19260f){return db['CmHopper'][_0x3ad1('0x40')]({'raw':_0x5ccf2e[_0x3ad1('0x15')]?_0x5ccf2e['options'][_0x3ad1('0x16')]===undefined?!![]:![]:!![],'where':_0x5ccf2e['options']?_0x5ccf2e['options']['where']||null:null,'attributes':[[db[_0x3ad1('0x41')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3ad1('0x41')]['literal'](_0x3ad1('0x42')+util[_0x3ad1('0x43')](_0x3ad1('0x44'),moment()[_0x3ad1('0x43')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x3ad1('0x45')))),_0x3ad1('0x46')]]})[_0x3ad1('0xa')](function(_0x5ea684){logger[_0x3ad1('0xb')](_0x3ad1('0x3f'),_0x5ccf2e);logger[_0x3ad1('0x1d')]('CountReScheduled',_0x5ccf2e,JSON[_0x3ad1('0xe')](_0x5ea684));_0xd0709(_0x5ea684);})[_0x3ad1('0x22')](function(_0x20b389){logger['error'](_0x3ad1('0x3f'),_0x20b389['message'],_0x5ccf2e);_0x19260f(_0x2bd9fa['error'](0x1f4,_0x20b389[_0x3ad1('0x11')]));});});};exports['GetContactRecallMe']=function(_0x1adbf7){var _0x151baf=this;return new Promise(function(_0x32a198,_0x3343fa){return db[_0x3ad1('0x27')]['describe']()[_0x3ad1('0xa')](function(_0x58e809){return db[_0x3ad1('0x41')][_0x3ad1('0x29')](function(_0x559473){return db[_0x3ad1('0x14')][_0x3ad1('0x40')]({'where':_0x1adbf7['options']?_0x1adbf7[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null,'attributes':_0x1adbf7[_0x3ad1('0x15')]?_0x1adbf7[_0x3ad1('0x15')][_0x3ad1('0x1c')]||null:null,'limit':0x1,'order':_0x1adbf7['options']?_0x1adbf7[_0x3ad1('0x15')][_0x3ad1('0x47')]||null:null,'group':db[_0x3ad1('0x14')][_0x3ad1('0x33')],'transaction':_0x559473,'lock':_0x559473[_0x3ad1('0x2a')][_0x3ad1('0x2b')],'include':_0x1adbf7[_0x3ad1('0x15')]?_0x1adbf7[_0x3ad1('0x15')]['include']?_[_0x3ad1('0x1a')](_0x1adbf7[_0x3ad1('0x15')][_0x3ad1('0x19')],function(_0x5098ca){return{'model':db[_0x5098ca['model']],'as':_0x5098ca['as'],'attributes':_0x5098ca[_0x3ad1('0x1c')],'include':_0x5098ca[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x5098ca[_0x3ad1('0x19')],function(_0xe7f2e8){return{'model':db[_0xe7f2e8['model']],'as':_0xe7f2e8['as'],'attributes':_0xe7f2e8[_0x3ad1('0x1c')],'include':_0xe7f2e8[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0xe7f2e8[_0x3ad1('0x19')],function(_0x51a198){return{'model':db[_0x51a198[_0x3ad1('0x1b')]],'as':_0x51a198['as'],'attributes':_0x51a198[_0x3ad1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3ad1('0xa')](function(_0x1fe16f){var _0x86b670=[];for(var _0x181fb7=0x0;_0x181fb7<_0x1fe16f[_0x3ad1('0x32')];_0x181fb7+=0x1){_0x86b670[_0x3ad1('0x34')](_0x1fe16f[_0x181fb7][_0x3ad1('0x35')](_0x1adbf7[_0x3ad1('0x21')],{'transaction':_0x559473}));}return BPromise[_0x3ad1('0x37')](_0x86b670);});})[_0x3ad1('0xa')](function(_0x50d26a){logger[_0x3ad1('0xb')](_0x3ad1('0x48'),_0x1adbf7);logger[_0x3ad1('0x1d')](_0x3ad1('0x48'),_0x1adbf7,JSON[_0x3ad1('0xe')](_0x50d26a));_0x32a198(_0x50d26a);})[_0x3ad1('0x22')](function(_0x472dad){logger[_0x3ad1('0xf')](_0x3ad1('0x48'),_0x472dad[_0x3ad1('0x11')],_0x1adbf7);_0x3343fa(_0x151baf['error'](0x1f4,_0x472dad[_0x3ad1('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x34ef88){var _0xfe1346=this;return new Promise(function(_0x59f53c,_0x408c5a){db[_0x3ad1('0x27')][_0x3ad1('0x28')]()['then'](function(_0x9d086e){return db[_0x3ad1('0x14')][_0x3ad1('0x40')]({'raw':_0x34ef88['options']?_0x34ef88['options'][_0x3ad1('0x16')]===undefined?!![]:![]:!![],'where':_0x34ef88[_0x3ad1('0x15')]?_0x34ef88[_0x3ad1('0x15')][_0x3ad1('0x17')]||null:null,'attributes':_0x34ef88[_0x3ad1('0x15')]?_0x34ef88[_0x3ad1('0x15')][_0x3ad1('0x1c')]||null:null,'limit':_0x34ef88[_0x3ad1('0x15')]?_0x34ef88[_0x3ad1('0x15')][_0x3ad1('0x18')]||null:null,'include':_0x34ef88[_0x3ad1('0x15')]?_0x34ef88[_0x3ad1('0x15')][_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x34ef88[_0x3ad1('0x15')][_0x3ad1('0x19')],function(_0x5b27dd){return{'model':db[_0x5b27dd['model']],'as':_0x5b27dd['as'],'attributes':_0x5b27dd['as']==='Contact'?_[_0x3ad1('0x2d')](_0x9d086e):_0x5b27dd[_0x3ad1('0x1c')],'include':_0x5b27dd[_0x3ad1('0x19')]?_[_0x3ad1('0x1a')](_0x5b27dd[_0x3ad1('0x19')],function(_0x4f88da){return{'model':db[_0x4f88da[_0x3ad1('0x1b')]],'as':_0x4f88da['as'],'attributes':_0x4f88da[_0x3ad1('0x1c')],'include':_0x4f88da['include']?_[_0x3ad1('0x1a')](_0x4f88da[_0x3ad1('0x19')],function(_0x3648bf){return{'model':db[_0x3648bf[_0x3ad1('0x1b')]],'as':_0x3648bf['as'],'attributes':_0x3648bf[_0x3ad1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3ad1('0xa')](function(_0x5201de){logger[_0x3ad1('0xb')](_0x3ad1('0x13'),_0x34ef88);logger[_0x3ad1('0x1d')](_0x3ad1('0x13'),_0x34ef88,JSON[_0x3ad1('0xe')](_0x5201de));_0x59f53c(_0x5201de);})[_0x3ad1('0x22')](function(_0x573469){logger[_0x3ad1('0xf')]('GetCmHopper',_0x573469['message'],_0x34ef88);_0x408c5a(_0xfe1346[_0x3ad1('0xf')](0x1f4,_0x573469[_0x3ad1('0x11')]));});});});};exports[_0x3ad1('0x49')]=function(_0x212acf){var _0x3d0eaf=this;return new Promise(function(_0x4411b2,_0x98cb80){return db[_0x3ad1('0x41')][_0x3ad1('0x29')](function(_0xf7bcb5){return db['CmHopper'][_0x3ad1('0x35')]({'active':![]},{'where':{},'transaction':_0xf7bcb5})[_0x3ad1('0xa')](function(_0x447e1f){logger['info'](_0x3ad1('0x49'),_0x212acf);logger[_0x3ad1('0x1d')](_0x3ad1('0x49'),_0x212acf,JSON['stringify'](_0x447e1f));_0x4411b2(_0x447e1f);})[_0x3ad1('0x22')](function(_0x310de4){logger[_0x3ad1('0xf')](_0x3ad1('0x49'),_0x310de4[_0x3ad1('0x11')],_0x212acf);_0x98cb80(_0x3d0eaf[_0x3ad1('0xf')](0x1f4,_0x310de4[_0x3ad1('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8b3f45b..4d19a2b 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 _0x4aa2=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','getPreview','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7fd728,_0x4936f){var _0x55790b=function(_0x483da0){while(--_0x483da0){_0x7fd728['push'](_0x7fd728['shift']());}};_0x55790b(++_0x4936f);}(_0x4aa2,0x76));var _0x24aa=function(_0x322439,_0x27de1b){_0x322439=_0x322439-0x0;var _0x2945a1=_0x4aa2[_0x322439];return _0x2945a1;};'use strict';var multer=require(_0x24aa('0x0'));var util=require(_0x24aa('0x1'));var path=require('path');var timeout=require(_0x24aa('0x2'));var express=require(_0x24aa('0x3'));var router=express[_0x24aa('0x4')]();var fs_extra=require(_0x24aa('0x5'));var auth=require(_0x24aa('0x6'));var interaction=require(_0x24aa('0x7'));var config=require(_0x24aa('0x8'));var controller=require('./cmHopper.controller');router[_0x24aa('0x9')]('/',auth[_0x24aa('0xa')](),controller[_0x24aa('0xb')]);router[_0x24aa('0x9')](_0x24aa('0xc'),auth[_0x24aa('0xa')](),controller[_0x24aa('0xd')]);router['get'](_0x24aa('0xe'),auth[_0x24aa('0xa')](),controller[_0x24aa('0xf')]);router[_0x24aa('0x9')](_0x24aa('0x10'),auth[_0x24aa('0xa')](),controller[_0x24aa('0x11')]);router[_0x24aa('0x12')]('/',auth[_0x24aa('0xa')](),controller[_0x24aa('0x13')]);router[_0x24aa('0x12')]('/preview',auth[_0x24aa('0xa')](),controller[_0x24aa('0x14')]);router[_0x24aa('0x15')](_0x24aa('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x24aa('0x16')]('/:id',auth[_0x24aa('0xa')](),controller[_0x24aa('0x17')]);module[_0x24aa('0x18')]=router; \ No newline at end of file +var _0x6b21=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','isAuthenticated','describe','get','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview','put','update','/:id','destroy','path','connect-timeout'];(function(_0x3b60ef,_0x213ab2){var _0x11595=function(_0x5f3514){while(--_0x5f3514){_0x3b60ef['push'](_0x3b60ef['shift']());}};_0x11595(++_0x213ab2);}(_0x6b21,0x148));var _0x16b2=function(_0x1b0d14,_0x226a5b){_0x1b0d14=_0x1b0d14-0x0;var _0x149b00=_0x6b21[_0x1b0d14];return _0x149b00;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x16b2('0x0'));var timeout=require(_0x16b2('0x1'));var express=require(_0x16b2('0x2'));var router=express[_0x16b2('0x3')]();var fs_extra=require(_0x16b2('0x4'));var auth=require(_0x16b2('0x5'));var interaction=require(_0x16b2('0x6'));var config=require('../../config/environment');var controller=require(_0x16b2('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x16b2('0x8')](),controller[_0x16b2('0x9')]);router[_0x16b2('0xa')](_0x16b2('0xb'),auth['isAuthenticated'](),controller[_0x16b2('0xc')]);router[_0x16b2('0xa')]('/:id',auth[_0x16b2('0x8')](),controller[_0x16b2('0xd')]);router[_0x16b2('0xe')]('/',auth[_0x16b2('0x8')](),controller[_0x16b2('0xf')]);router['post'](_0x16b2('0x10'),auth[_0x16b2('0x8')](),controller[_0x16b2('0x11')]);router[_0x16b2('0x12')]('/:id',auth[_0x16b2('0x8')](),controller[_0x16b2('0x13')]);router['delete'](_0x16b2('0x14'),auth['isAuthenticated'](),controller[_0x16b2('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index f2f182b..a714214 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 _0x952a=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x1396a9,_0x14cfa0){var _0x95917f=function(_0x5a8b95){while(--_0x5a8b95){_0x1396a9['push'](_0x1396a9['shift']());}};_0x95917f(++_0x14cfa0);}(_0x952a,0x1b1));var _0xa952=function(_0x43b495,_0xb57a7c){_0x43b495=_0x43b495-0x0;var _0x3532e7=_0x952a[_0x43b495];return _0x3532e7;};'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 +var _0x5292=['contactListQueue','INTEGER','moment','sequelize','STRING'];(function(_0x43a4e9,_0x2d6b0d){var _0xc03385=function(_0x56e742){while(--_0x56e742){_0x43a4e9['push'](_0x43a4e9['shift']());}};_0xc03385(++_0x2d6b0d);}(_0x5292,0xf7));var _0x2529=function(_0x2d0f1d,_0x34ea6f){_0x2d0f1d=_0x2d0f1d-0x0;var _0x42866f=_0x5292[_0x2d0f1d];return _0x42866f;};'use strict';var moment=require(_0x2529('0x0'));var Sequelize=require(_0x2529('0x1'));module['exports']={'phone':{'type':Sequelize[_0x2529('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2529('0x3')},'ListId':{'type':Sequelize[_0x2529('0x4')],'unique':_0x2529('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2529('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 11f59d9..1c167e3 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 _0x6014=['destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','options','include','rows','show','params','keys','includeAll','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x375cef,_0x38852e){var _0x11b102=function(_0x541ece){while(--_0x541ece){_0x375cef['push'](_0x375cef['shift']());}};_0x11b102(++_0x38852e);}(_0x6014,0x6d));var _0x4601=function(_0x13ef4f,_0x268dae){_0x13ef4f=_0x13ef4f-0x0;var _0x568fa4=_0x6014[_0x13ef4f];return _0x568fa4;};'use strict';var emlformat=require(_0x4601('0x0'));var rimraf=require(_0x4601('0x1'));var zipdir=require(_0x4601('0x2'));var jsonpatch=require(_0x4601('0x3'));var rp=require('request-promise');var moment=require(_0x4601('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4601('0x5'));var util=require('util');var path=require(_0x4601('0x6'));var sox=require('sox');var csv=require(_0x4601('0x7'));var ejs=require(_0x4601('0x8'));var fs=require('fs');var fs_extra=require(_0x4601('0x9'));var _=require(_0x4601('0xa'));var squel=require(_0x4601('0xb'));var crypto=require(_0x4601('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4601('0xd'));var Papa=require('papaparse');var Redis=require(_0x4601('0xe'));var authService=require(_0x4601('0xf'));var qs=require(_0x4601('0x10'));var as=require(_0x4601('0x11'));var hardwareService=require(_0x4601('0x12'));var logger=require(_0x4601('0x13'))(_0x4601('0x14'));var utils=require(_0x4601('0x15'));var config=require(_0x4601('0x16'));var licenseUtil=require(_0x4601('0x17'));var db=require(_0x4601('0x18'))['db'];function respondWithStatusCode(_0x5231dc,_0x1a7dc0){_0x1a7dc0=_0x1a7dc0||0xcc;return function(_0x10f5a6){if(_0x10f5a6){return _0x5231dc[_0x4601('0x19')](_0x1a7dc0);}return _0x5231dc[_0x4601('0x1a')](_0x1a7dc0)[_0x4601('0x1b')]();};}function respondWithResult(_0x54a379,_0x4401b7){_0x4401b7=_0x4401b7||0xc8;return function(_0x59dedc){if(_0x59dedc){return _0x54a379['status'](_0x4401b7)[_0x4601('0x1c')](_0x59dedc);}};}function respondWithFilteredResult(_0x4350e3,_0x312b45){return function(_0x51f9d2){if(_0x51f9d2){var _0x36a35f=typeof _0x312b45[_0x4601('0x1d')]==='undefined'&&typeof _0x312b45['limit']===_0x4601('0x1e');var _0x43b4c6=_0x51f9d2[_0x4601('0x1f')];var _0x239ae0=_0x36a35f?0x0:_0x312b45['offset'];var _0x5da56d=_0x36a35f?_0x51f9d2['count']:_0x312b45[_0x4601('0x1d')]+_0x312b45['limit'];var _0x3d7d9f;if(_0x5da56d>=_0x43b4c6){_0x5da56d=_0x43b4c6;_0x3d7d9f=0xc8;}else{_0x3d7d9f=0xce;}_0x4350e3[_0x4601('0x1a')](_0x3d7d9f);return _0x4350e3[_0x4601('0x20')](_0x4601('0x21'),_0x239ae0+'-'+_0x5da56d+'/'+_0x43b4c6)[_0x4601('0x1c')](_0x51f9d2);}return null;};}function patchUpdates(_0x4ed8ff){return function(_0x4c9e8c){try{jsonpatch[_0x4601('0x22')](_0x4c9e8c,_0x4ed8ff,!![]);}catch(_0x3876c8){return BPromise[_0x4601('0x23')](_0x3876c8);}return _0x4c9e8c[_0x4601('0x24')]();};}function saveUpdates(_0xc1a97e,_0xccecf3){return function(_0x24a128){if(_0x24a128){return _0x24a128[_0x4601('0x25')](_0xc1a97e)[_0x4601('0x26')](function(_0x4e7939){return _0x4e7939;});}return null;};}function removeEntity(_0x26ff2c,_0x5b341a){return function(_0x26a3e9){if(_0x26a3e9){return _0x26a3e9[_0x4601('0x27')]()[_0x4601('0x26')](function(){_0x26ff2c['status'](0xcc)[_0x4601('0x1b')]();});}};}function handleEntityNotFound(_0x575d6d,_0x2ef5e1){return function(_0x3ecd21){if(!_0x3ecd21){_0x575d6d[_0x4601('0x19')](0x194);}return _0x3ecd21;};}function handleError(_0x23a660,_0x419d42){_0x419d42=_0x419d42||0x1f4;return function(_0x460fc6){logger[_0x4601('0x28')](_0x460fc6[_0x4601('0x29')]);if(_0x460fc6[_0x4601('0x2a')]){delete _0x460fc6[_0x4601('0x2a')];}_0x23a660[_0x4601('0x1a')](_0x419d42)[_0x4601('0x2b')](_0x460fc6);};}exports[_0x4601('0x2c')]=function(_0x1264fb,_0x135ad6){var _0x5eeb7f={},_0x45249a={},_0xf051d={'count':0x0,'rows':[]};var _0x57b0df=_['map'](db[_0x4601('0x2d')][_0x4601('0x2e')],function(_0x3e21da){return{'name':_0x3e21da['fieldName'],'type':_0x3e21da['type']['key']};});_0x45249a[_0x4601('0x2f')]=_[_0x4601('0x30')](_0x57b0df,_0x4601('0x2a'));_0x45249a[_0x4601('0x31')]=_['keys'](_0x1264fb['query']);_0x45249a[_0x4601('0x32')]=_[_0x4601('0x33')](_0x45249a['model'],_0x45249a[_0x4601('0x31')]);_0x5eeb7f['attributes']=_[_0x4601('0x33')](_0x45249a[_0x4601('0x2f')],qs[_0x4601('0x34')](_0x1264fb[_0x4601('0x31')][_0x4601('0x34')]));_0x5eeb7f[_0x4601('0x35')]=_0x5eeb7f['attributes'][_0x4601('0x36')]?_0x5eeb7f['attributes']:_0x45249a['model'];if(!_0x1264fb[_0x4601('0x31')][_0x4601('0x37')]('nolimit')){_0x5eeb7f[_0x4601('0x38')]=qs[_0x4601('0x38')](_0x1264fb[_0x4601('0x31')][_0x4601('0x38')]);_0x5eeb7f[_0x4601('0x1d')]=qs[_0x4601('0x1d')](_0x1264fb['query'][_0x4601('0x1d')]);}_0x5eeb7f[_0x4601('0x39')]=qs[_0x4601('0x3a')](_0x1264fb[_0x4601('0x31')][_0x4601('0x3a')]);_0x5eeb7f['where']=qs[_0x4601('0x32')](_[_0x4601('0x3b')](_0x1264fb['query'],_0x45249a[_0x4601('0x32')]),_0x57b0df);if(_0x1264fb[_0x4601('0x31')][_0x4601('0x3c')]){_0x5eeb7f[_0x4601('0x3d')]=_[_0x4601('0x3e')](_0x5eeb7f['where'],{'$or':_[_0x4601('0x30')](_0x57b0df,function(_0x52867c){if(_0x52867c[_0x4601('0x3f')]!=='VIRTUAL'){var _0x31320a={};_0x31320a[_0x52867c[_0x4601('0x2a')]]={'$like':'%'+_0x1264fb[_0x4601('0x31')][_0x4601('0x3c')]+'%'};return _0x31320a;}})});}_0x5eeb7f=_[_0x4601('0x3e')]({},_0x5eeb7f,_0x1264fb[_0x4601('0x40')]);var _0x4cdedd={'where':_0x5eeb7f[_0x4601('0x3d')]};return db[_0x4601('0x2d')][_0x4601('0x1f')](_0x4cdedd)[_0x4601('0x26')](function(_0x2736af){_0xf051d['count']=_0x2736af;if(_0x1264fb[_0x4601('0x31')]['includeAll']){_0x5eeb7f[_0x4601('0x41')]=[{'all':!![]}];}return db[_0x4601('0x2d')]['findAll'](_0x5eeb7f);})[_0x4601('0x26')](function(_0xfd130f){_0xf051d[_0x4601('0x42')]=_0xfd130f;return _0xf051d;})[_0x4601('0x26')](respondWithFilteredResult(_0x135ad6,_0x5eeb7f))['catch'](handleError(_0x135ad6,null));};exports[_0x4601('0x43')]=function(_0x36e076,_0x38a22a){var _0x3230df={'raw':!![],'where':{'id':_0x36e076[_0x4601('0x44')]['id']}},_0x4b7605={};_0x4b7605[_0x4601('0x2f')]=_[_0x4601('0x45')](db[_0x4601('0x2d')][_0x4601('0x2e')]);_0x4b7605['query']=_[_0x4601('0x45')](_0x36e076[_0x4601('0x31')]);_0x4b7605[_0x4601('0x32')]=_[_0x4601('0x33')](_0x4b7605[_0x4601('0x2f')],_0x4b7605[_0x4601('0x31')]);_0x3230df[_0x4601('0x35')]=_[_0x4601('0x33')](_0x4b7605['model'],qs[_0x4601('0x34')](_0x36e076['query'][_0x4601('0x34')]));_0x3230df[_0x4601('0x35')]=_0x3230df['attributes'][_0x4601('0x36')]?_0x3230df['attributes']:_0x4b7605[_0x4601('0x2f')];if(_0x36e076[_0x4601('0x31')][_0x4601('0x46')]){_0x3230df[_0x4601('0x41')]=[{'all':!![]}];}_0x3230df=_['merge']({},_0x3230df,_0x36e076[_0x4601('0x40')]);return db[_0x4601('0x2d')]['find'](_0x3230df)[_0x4601('0x26')](handleEntityNotFound(_0x38a22a,null))[_0x4601('0x26')](respondWithResult(_0x38a22a,null))[_0x4601('0x47')](handleError(_0x38a22a,null));};exports[_0x4601('0x25')]=function(_0x5750fe,_0x25e567){if(_0x5750fe['body']['id']){delete _0x5750fe[_0x4601('0x48')]['id'];}return db[_0x4601('0x2d')][_0x4601('0x49')]({'where':{'id':_0x5750fe[_0x4601('0x44')]['id']}})[_0x4601('0x26')](handleEntityNotFound(_0x25e567,null))[_0x4601('0x26')](saveUpdates(_0x5750fe['body'],null))[_0x4601('0x26')](respondWithResult(_0x25e567,null))['catch'](handleError(_0x25e567,null));};exports['destroy']=function(_0x1eb1b3,_0x2d986b){return db[_0x4601('0x2d')][_0x4601('0x49')]({'where':{'id':_0x1eb1b3['params']['id']}})[_0x4601('0x26')](handleEntityNotFound(_0x2d986b,null))['then'](removeEntity(_0x2d986b,null))['catch'](handleError(_0x2d986b,null));};exports['describe']=function(_0x10e111,_0x3c05d7){return db[_0x4601('0x2d')]['describe']()['then'](respondWithResult(_0x3c05d7,null))['catch'](handleError(_0x3c05d7,null));}; \ No newline at end of file +var _0x8270=['VIRTUAL','filter','options','CmHopperBlack','include','findAll','rows','catch','show','params','includeAll','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','path','sox','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type'];(function(_0x13fcfa,_0x5d4bd4){var _0x5170e5=function(_0x46f212){while(--_0x46f212){_0x13fcfa['push'](_0x13fcfa['shift']());}};_0x5170e5(++_0x5d4bd4);}(_0x8270,0xe3));var _0x0827=function(_0x55646d,_0x10c17e){_0x55646d=_0x55646d-0x0;var _0x4b01d3=_0x8270[_0x55646d];return _0x4b01d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0827('0x0'));var jsonpatch=require(_0x0827('0x1'));var rp=require(_0x0827('0x2'));var moment=require(_0x0827('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0827('0x4'));var sox=require(_0x0827('0x5'));var csv=require(_0x0827('0x6'));var ejs=require(_0x0827('0x7'));var fs=require('fs');var fs_extra=require(_0x0827('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0827('0x9'));var deskjs=require(_0x0827('0xa'));var toCsv=require(_0x0827('0x6'));var querystring=require(_0x0827('0xb'));var Papa=require(_0x0827('0xc'));var Redis=require(_0x0827('0xd'));var authService=require(_0x0827('0xe'));var qs=require(_0x0827('0xf'));var as=require(_0x0827('0x10'));var hardwareService=require(_0x0827('0x11'));var logger=require(_0x0827('0x12'))(_0x0827('0x13'));var utils=require(_0x0827('0x14'));var config=require(_0x0827('0x15'));var licenseUtil=require(_0x0827('0x16'));var db=require(_0x0827('0x17'))['db'];function respondWithStatusCode(_0x1f8f18,_0x55fdac){_0x55fdac=_0x55fdac||0xcc;return function(_0x454ecf){if(_0x454ecf){return _0x1f8f18['sendStatus'](_0x55fdac);}return _0x1f8f18[_0x0827('0x18')](_0x55fdac)[_0x0827('0x19')]();};}function respondWithResult(_0x410410,_0x31e8dd){_0x31e8dd=_0x31e8dd||0xc8;return function(_0x52ebd0){if(_0x52ebd0){return _0x410410[_0x0827('0x18')](_0x31e8dd)[_0x0827('0x1a')](_0x52ebd0);}};}function respondWithFilteredResult(_0x48f6c0,_0x4dae6b){return function(_0xc0c89d){if(_0xc0c89d){var _0x48a911=typeof _0x4dae6b[_0x0827('0x1b')]===_0x0827('0x1c')&&typeof _0x4dae6b[_0x0827('0x1d')]===_0x0827('0x1c');var _0x5ba0e9=_0xc0c89d[_0x0827('0x1e')];var _0x36b91d=_0x48a911?0x0:_0x4dae6b[_0x0827('0x1b')];var _0x44626f=_0x48a911?_0xc0c89d[_0x0827('0x1e')]:_0x4dae6b['offset']+_0x4dae6b[_0x0827('0x1d')];var _0x2ad0cb;if(_0x44626f>=_0x5ba0e9){_0x44626f=_0x5ba0e9;_0x2ad0cb=0xc8;}else{_0x2ad0cb=0xce;}_0x48f6c0[_0x0827('0x18')](_0x2ad0cb);return _0x48f6c0['set'](_0x0827('0x1f'),_0x36b91d+'-'+_0x44626f+'/'+_0x5ba0e9)[_0x0827('0x1a')](_0xc0c89d);}return null;};}function patchUpdates(_0x3cbfb6){return function(_0x1793a6){try{jsonpatch[_0x0827('0x20')](_0x1793a6,_0x3cbfb6,!![]);}catch(_0x244d65){return BPromise['reject'](_0x244d65);}return _0x1793a6[_0x0827('0x21')]();};}function saveUpdates(_0x59ad84,_0x2840cd){return function(_0x156103){if(_0x156103){return _0x156103[_0x0827('0x22')](_0x59ad84)[_0x0827('0x23')](function(_0x187476){return _0x187476;});}return null;};}function removeEntity(_0x3a0087,_0x4e11a3){return function(_0x4bde4b){if(_0x4bde4b){return _0x4bde4b['destroy']()[_0x0827('0x23')](function(){_0x3a0087[_0x0827('0x18')](0xcc)[_0x0827('0x19')]();});}};}function handleEntityNotFound(_0x309219,_0x30cf94){return function(_0x3073e0){if(!_0x3073e0){_0x309219[_0x0827('0x24')](0x194);}return _0x3073e0;};}function handleError(_0x14ba93,_0x42d557){_0x42d557=_0x42d557||0x1f4;return function(_0x54c617){logger[_0x0827('0x25')](_0x54c617[_0x0827('0x26')]);if(_0x54c617['name']){delete _0x54c617[_0x0827('0x27')];}_0x14ba93[_0x0827('0x18')](_0x42d557)['send'](_0x54c617);};}exports['index']=function(_0x48937b,_0x29f70a){var _0xc86a68={},_0x527835={},_0x437426={'count':0x0,'rows':[]};var _0x4d6e05=_[_0x0827('0x28')](db['CmHopperBlack'][_0x0827('0x29')],function(_0x5aa960){return{'name':_0x5aa960['fieldName'],'type':_0x5aa960['type']['key']};});_0x527835[_0x0827('0x2a')]=_['map'](_0x4d6e05,_0x0827('0x27'));_0x527835[_0x0827('0x2b')]=_[_0x0827('0x2c')](_0x48937b[_0x0827('0x2b')]);_0x527835[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x527835[_0x0827('0x2a')],_0x527835[_0x0827('0x2b')]);_0xc86a68[_0x0827('0x2f')]=_[_0x0827('0x2e')](_0x527835['model'],qs[_0x0827('0x30')](_0x48937b[_0x0827('0x2b')]['fields']));_0xc86a68[_0x0827('0x2f')]=_0xc86a68[_0x0827('0x2f')][_0x0827('0x31')]?_0xc86a68[_0x0827('0x2f')]:_0x527835['model'];if(!_0x48937b[_0x0827('0x2b')][_0x0827('0x32')]('nolimit')){_0xc86a68[_0x0827('0x1d')]=qs[_0x0827('0x1d')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1d')]);_0xc86a68['offset']=qs[_0x0827('0x1b')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1b')]);}_0xc86a68[_0x0827('0x33')]=qs[_0x0827('0x34')](_0x48937b[_0x0827('0x2b')]['sort']);_0xc86a68[_0x0827('0x35')]=qs[_0x0827('0x2d')](_[_0x0827('0x36')](_0x48937b[_0x0827('0x2b')],_0x527835[_0x0827('0x2d')]),_0x4d6e05);if(_0x48937b[_0x0827('0x2b')]['filter']){_0xc86a68['where']=_[_0x0827('0x37')](_0xc86a68['where'],{'$or':_['map'](_0x4d6e05,function(_0x30df35){if(_0x30df35[_0x0827('0x38')]!==_0x0827('0x39')){var _0x5ef676={};_0x5ef676[_0x30df35[_0x0827('0x27')]]={'$like':'%'+_0x48937b['query'][_0x0827('0x3a')]+'%'};return _0x5ef676;}})});}_0xc86a68=_['merge']({},_0xc86a68,_0x48937b[_0x0827('0x3b')]);var _0xf0f355={'where':_0xc86a68[_0x0827('0x35')]};return db[_0x0827('0x3c')][_0x0827('0x1e')](_0xf0f355)[_0x0827('0x23')](function(_0x2e18b0){_0x437426[_0x0827('0x1e')]=_0x2e18b0;if(_0x48937b[_0x0827('0x2b')]['includeAll']){_0xc86a68[_0x0827('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0827('0x3e')](_0xc86a68);})[_0x0827('0x23')](function(_0x2c8fe8){_0x437426[_0x0827('0x3f')]=_0x2c8fe8;return _0x437426;})[_0x0827('0x23')](respondWithFilteredResult(_0x29f70a,_0xc86a68))[_0x0827('0x40')](handleError(_0x29f70a,null));};exports[_0x0827('0x41')]=function(_0x1a934f,_0x106fb1){var _0x57e6c3={'raw':!![],'where':{'id':_0x1a934f[_0x0827('0x42')]['id']}},_0x2eeffa={};_0x2eeffa[_0x0827('0x2a')]=_[_0x0827('0x2c')](db[_0x0827('0x3c')][_0x0827('0x29')]);_0x2eeffa[_0x0827('0x2b')]=_['keys'](_0x1a934f[_0x0827('0x2b')]);_0x2eeffa[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x2eeffa['model'],_0x2eeffa[_0x0827('0x2b')]);_0x57e6c3['attributes']=_[_0x0827('0x2e')](_0x2eeffa[_0x0827('0x2a')],qs[_0x0827('0x30')](_0x1a934f[_0x0827('0x2b')][_0x0827('0x30')]));_0x57e6c3[_0x0827('0x2f')]=_0x57e6c3['attributes']['length']?_0x57e6c3['attributes']:_0x2eeffa['model'];if(_0x1a934f[_0x0827('0x2b')][_0x0827('0x43')]){_0x57e6c3[_0x0827('0x3d')]=[{'all':!![]}];}_0x57e6c3=_[_0x0827('0x37')]({},_0x57e6c3,_0x1a934f[_0x0827('0x3b')]);return db['CmHopperBlack'][_0x0827('0x44')](_0x57e6c3)[_0x0827('0x23')](handleEntityNotFound(_0x106fb1,null))[_0x0827('0x23')](respondWithResult(_0x106fb1,null))[_0x0827('0x40')](handleError(_0x106fb1,null));};exports['update']=function(_0x4eaf06,_0x3e845e){if(_0x4eaf06[_0x0827('0x45')]['id']){delete _0x4eaf06[_0x0827('0x45')]['id'];}return db['CmHopperBlack'][_0x0827('0x44')]({'where':{'id':_0x4eaf06[_0x0827('0x42')]['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x3e845e,null))[_0x0827('0x23')](saveUpdates(_0x4eaf06[_0x0827('0x45')],null))[_0x0827('0x23')](respondWithResult(_0x3e845e,null))['catch'](handleError(_0x3e845e,null));};exports['destroy']=function(_0x2d37bb,_0x419cb6){return db[_0x0827('0x3c')]['find']({'where':{'id':_0x2d37bb['params']['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x419cb6,null))[_0x0827('0x23')](removeEntity(_0x419cb6,null))[_0x0827('0x40')](handleError(_0x419cb6,null));};exports[_0x0827('0x46')]=function(_0x331afe,_0x20f6e0){return db[_0x0827('0x3c')][_0x0827('0x46')]()['then'](respondWithResult(_0x20f6e0,null))[_0x0827('0x40')](handleError(_0x20f6e0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 5d2d5a0..3ff75d6 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 _0xf18b=['util','moment','bluebird','request-promise','rimraf','exports','CmHopperBlack','lodash'];(function(_0x325519,_0xf79bdc){var _0x5a350c=function(_0x225d6e){while(--_0x225d6e){_0x325519['push'](_0x325519['shift']());}};_0x5a350c(++_0xf79bdc);}(_0xf18b,0x127));var _0xbf18=function(_0x41bc0f,_0x1c55f7){_0x41bc0f=_0x41bc0f-0x0;var _0x1ecf21=_0xf18b[_0x41bc0f];return _0x1ecf21;};'use strict';var _=require(_0xbf18('0x0'));var util=require(_0xbf18('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf18('0x2'));var BPromise=require(_0xbf18('0x3'));var rp=require(_0xbf18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf18('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0xbf18('0x6')]=function(_0x4adc81,_0x24d214){return _0x4adc81['define'](_0xbf18('0x7'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a4=['rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','util','path'];(function(_0x2a7f87,_0x517b09){var _0x92e34e=function(_0x5bdb55){while(--_0x5bdb55){_0x2a7f87['push'](_0x2a7f87['shift']());}};_0x92e34e(++_0x517b09);}(_0xc7a4,0x196));var _0x4c7a=function(_0x123d10,_0x649a4a){_0x123d10=_0x123d10-0x0;var _0x34cbef=_0xc7a4[_0x123d10];return _0x34cbef;};'use strict';var _=require('lodash');var util=require(_0x4c7a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c7a('0x1'));var rimraf=require(_0x4c7a('0x2'));var config=require(_0x4c7a('0x3'));var attributes=require(_0x4c7a('0x4'));module['exports']=function(_0xa15faa,_0x17aa00){return _0xa15faa['define'](_0x4c7a('0x5'),attributes,{'tableName':'cm_hopper_black','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 3ca29dd..9bbb18d 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 _0x74f9=['options','raw','where','limit','include','model','attributes','then','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll'];(function(_0x2e5d2f,_0xfe1255){var _0x3e2030=function(_0x49ab2e){while(--_0x49ab2e){_0x2e5d2f['push'](_0x2e5d2f['shift']());}};_0x3e2030(++_0xfe1255);}(_0x74f9,0x1c7));var _0x974f=function(_0x570305,_0x38ee56){_0x570305=_0x570305-0x0;var _0x1d3026=_0x74f9[_0x570305];return _0x1d3026;};'use strict';var _=require(_0x974f('0x0'));var util=require(_0x974f('0x1'));var moment=require(_0x974f('0x2'));var BPromise=require('bluebird');var rs=require(_0x974f('0x3'));var fs=require('fs');var Redis=require(_0x974f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x974f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x974f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x974f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x177bd1,_0x3afeb8,_0xbaa039){return new BPromise(function(_0xdd62a6,_0xdd7e09){return client[_0x974f('0x8')](_0x177bd1,_0xbaa039)['then'](function(_0x1faab8){logger[_0x974f('0x9')](_0x974f('0xa'),_0x3afeb8,_0x974f('0xb'));logger[_0x974f('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3afeb8,_0x974f('0xb'),JSON[_0x974f('0xd')](_0x1faab8));if(_0x1faab8[_0x974f('0xe')]){if(_0x1faab8['error']['code']===0x1f4){logger[_0x974f('0xe')](_0x974f('0xa'),_0x3afeb8,_0x1faab8[_0x974f('0xe')][_0x974f('0xf')]);return _0xdd7e09(_0x1faab8['error']['message']);}logger[_0x974f('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x3afeb8,_0x1faab8[_0x974f('0xe')][_0x974f('0xf')]);return _0xdd62a6(_0x1faab8[_0x974f('0xe')][_0x974f('0xf')]);}else{logger[_0x974f('0x9')](_0x974f('0xa'),_0x3afeb8,_0x974f('0xb'));_0xdd62a6(_0x1faab8[_0x974f('0x10')][_0x974f('0xf')]);}})[_0x974f('0x11')](function(_0x329dca){logger[_0x974f('0xe')](_0x974f('0xa'),_0x3afeb8,_0x329dca);_0xdd7e09(_0x329dca);});});}exports[_0x974f('0x12')]=function(_0xecebae){var _0x4200e6=this;return new Promise(function(_0xbe009a,_0x2cf13e){return db[_0x974f('0x13')][_0x974f('0x14')]({'raw':_0xecebae[_0x974f('0x15')]?_0xecebae['options'][_0x974f('0x16')]===undefined?!![]:![]:!![],'where':_0xecebae[_0x974f('0x15')]?_0xecebae['options'][_0x974f('0x17')]||null:null,'attributes':_0xecebae[_0x974f('0x15')]?_0xecebae[_0x974f('0x15')]['attributes']||null:null,'limit':_0xecebae[_0x974f('0x15')]?_0xecebae['options'][_0x974f('0x18')]||null:null,'include':_0xecebae['options']?_0xecebae[_0x974f('0x15')][_0x974f('0x19')]?_['map'](_0xecebae['options'][_0x974f('0x19')],function(_0x502eba){return{'model':db[_0x502eba[_0x974f('0x1a')]],'as':_0x502eba['as'],'attributes':_0x502eba[_0x974f('0x1b')],'include':_0x502eba[_0x974f('0x19')]?_['map'](_0x502eba['include'],function(_0x11047f){return{'model':db[_0x11047f[_0x974f('0x1a')]],'as':_0x11047f['as'],'attributes':_0x11047f['attributes'],'include':_0x11047f['include']?_['map'](_0x11047f[_0x974f('0x19')],function(_0x5eb58c){return{'model':db[_0x5eb58c['model']],'as':_0x5eb58c['as'],'attributes':_0x5eb58c['attributes']};}):[]};}):[]};}):[]:[]})[_0x974f('0x1c')](function(_0x2f35be){logger['info'](_0x974f('0x12'),_0xecebae);logger[_0x974f('0xc')](_0x974f('0x12'),_0xecebae,JSON[_0x974f('0xd')](_0x2f35be));_0xbe009a(_0x2f35be);})[_0x974f('0x11')](function(_0x59f7a5){logger[_0x974f('0xe')]('GetCmHopperBlack',_0x59f7a5['message'],_0xecebae);_0x2cf13e(_0x4200e6[_0x974f('0xe')](0x1f4,_0x59f7a5['message']));});});};exports[_0x974f('0x1d')]=function(_0x808fb6){var _0x4396ad=this;return new Promise(function(_0x446c0c,_0x518367){return db[_0x974f('0x13')][_0x974f('0x1e')](_0x808fb6[_0x974f('0x1f')],{'raw':_0x808fb6[_0x974f('0x15')]?_0x808fb6[_0x974f('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x808fb6[_0x974f('0x15')]?_0x808fb6[_0x974f('0x15')][_0x974f('0x17')]||null:null,'attributes':_0x808fb6[_0x974f('0x15')]?_0x808fb6[_0x974f('0x15')][_0x974f('0x1b')]||null:null,'limit':_0x808fb6[_0x974f('0x15')]?_0x808fb6[_0x974f('0x15')]['limit']||null:null})['then'](function(_0x4a7cb8){logger[_0x974f('0x9')](_0x974f('0x1d'),_0x808fb6);logger[_0x974f('0xc')]('UpdateCmHopperBlack',_0x808fb6,JSON[_0x974f('0xd')](_0x4a7cb8));_0x446c0c(_0x4a7cb8);})[_0x974f('0x11')](function(_0x4785b2){logger[_0x974f('0xe')]('UpdateCmHopperBlack',_0x4785b2[_0x974f('0xf')],_0x808fb6);_0x518367(_0x4396ad[_0x974f('0xe')](0x1f4,_0x4785b2['message']));});});};exports['DestroyCmHopperBlack']=function(_0xbf83e7){var _0x230017=this;return new Promise(function(_0xb1a568,_0x1898b9){return db[_0x974f('0x13')][_0x974f('0x20')]({'where':_0xbf83e7['options']?_0xbf83e7[_0x974f('0x15')][_0x974f('0x17')]||null:null})[_0x974f('0x1c')](function(_0x4fe4a5){logger[_0x974f('0x9')](_0x974f('0x21'),_0xbf83e7);logger[_0x974f('0xc')](_0x974f('0x21'),_0xbf83e7,JSON[_0x974f('0xd')](_0x4fe4a5));_0xb1a568(_0x4fe4a5);})[_0x974f('0x11')](function(_0x2c9853){logger[_0x974f('0xe')](_0x974f('0x21'),_0x2c9853[_0x974f('0xf')],_0xbf83e7);_0x1898b9(_0x230017[_0x974f('0xe')](0x1f4,_0x2c9853['message']));});});}; \ No newline at end of file +var _0x5325=['map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include'];(function(_0x2759e3,_0x1aaefb){var _0x4f165f=function(_0x3124ab){while(--_0x3124ab){_0x2759e3['push'](_0x2759e3['shift']());}};_0x4f165f(++_0x1aaefb);}(_0x5325,0x18d));var _0x5532=function(_0x5cd918,_0x186159){_0x5cd918=_0x5cd918-0x0;var _0x44619b=_0x5325[_0x5cd918];return _0x44619b;};'use strict';var _=require(_0x5532('0x0'));var util=require(_0x5532('0x1'));var moment=require(_0x5532('0x2'));var BPromise=require(_0x5532('0x3'));var rs=require(_0x5532('0x4'));var fs=require('fs');var Redis=require(_0x5532('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5532('0x6'))(_0x5532('0x7'));var config=require(_0x5532('0x8'));var jayson=require(_0x5532('0x9'));var client=jayson[_0x5532('0xa')][_0x5532('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841fc,_0x27ba12,_0x2161d0){return new BPromise(function(_0x23da0a,_0x3c8a76){return client[_0x5532('0xc')](_0x2841fc,_0x2161d0)[_0x5532('0xd')](function(_0x540e61){logger[_0x5532('0xe')](_0x5532('0xf'),_0x27ba12,_0x5532('0x10'));logger[_0x5532('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x27ba12,_0x5532('0x10'),JSON[_0x5532('0x12')](_0x540e61));if(_0x540e61['error']){if(_0x540e61[_0x5532('0x13')]['code']===0x1f4){logger[_0x5532('0x13')](_0x5532('0xf'),_0x27ba12,_0x540e61[_0x5532('0x13')][_0x5532('0x14')]);return _0x3c8a76(_0x540e61[_0x5532('0x13')][_0x5532('0x14')]);}logger['error'](_0x5532('0xf'),_0x27ba12,_0x540e61[_0x5532('0x13')]['message']);return _0x23da0a(_0x540e61['error'][_0x5532('0x14')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x27ba12,'request\x20sent');_0x23da0a(_0x540e61[_0x5532('0x15')][_0x5532('0x14')]);}})[_0x5532('0x16')](function(_0x3ed809){logger[_0x5532('0x13')](_0x5532('0xf'),_0x27ba12,_0x3ed809);_0x3c8a76(_0x3ed809);});});}exports[_0x5532('0x17')]=function(_0x753436){var _0x176b69=this;return new Promise(function(_0x4c95f3,_0x5940b6){return db[_0x5532('0x18')][_0x5532('0x19')]({'raw':_0x753436[_0x5532('0x1a')]?_0x753436[_0x5532('0x1a')][_0x5532('0x1b')]===undefined?!![]:![]:!![],'where':_0x753436['options']?_0x753436[_0x5532('0x1a')][_0x5532('0x1c')]||null:null,'attributes':_0x753436[_0x5532('0x1a')]?_0x753436[_0x5532('0x1a')][_0x5532('0x1d')]||null:null,'limit':_0x753436[_0x5532('0x1a')]?_0x753436['options'][_0x5532('0x1e')]||null:null,'include':_0x753436['options']?_0x753436[_0x5532('0x1a')][_0x5532('0x1f')]?_[_0x5532('0x20')](_0x753436[_0x5532('0x1a')]['include'],function(_0xc780a){return{'model':db[_0xc780a['model']],'as':_0xc780a['as'],'attributes':_0xc780a[_0x5532('0x1d')],'include':_0xc780a[_0x5532('0x1f')]?_['map'](_0xc780a[_0x5532('0x1f')],function(_0x339278){return{'model':db[_0x339278[_0x5532('0x21')]],'as':_0x339278['as'],'attributes':_0x339278[_0x5532('0x1d')],'include':_0x339278['include']?_[_0x5532('0x20')](_0x339278[_0x5532('0x1f')],function(_0x41f2f7){return{'model':db[_0x41f2f7['model']],'as':_0x41f2f7['as'],'attributes':_0x41f2f7[_0x5532('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5532('0xd')](function(_0x24992f){logger[_0x5532('0xe')]('GetCmHopperBlack',_0x753436);logger[_0x5532('0x11')](_0x5532('0x17'),_0x753436,JSON[_0x5532('0x12')](_0x24992f));_0x4c95f3(_0x24992f);})[_0x5532('0x16')](function(_0x5cfa54){logger[_0x5532('0x13')](_0x5532('0x17'),_0x5cfa54[_0x5532('0x14')],_0x753436);_0x5940b6(_0x176b69[_0x5532('0x13')](0x1f4,_0x5cfa54[_0x5532('0x14')]));});});};exports[_0x5532('0x22')]=function(_0x2b18aa){var _0x4b6f6e=this;return new Promise(function(_0x5378d,_0x3c6922){return db['CmHopperBlack'][_0x5532('0x23')](_0x2b18aa[_0x5532('0x24')],{'raw':_0x2b18aa[_0x5532('0x1a')]?_0x2b18aa[_0x5532('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b18aa[_0x5532('0x1a')]?_0x2b18aa[_0x5532('0x1a')]['where']||null:null,'attributes':_0x2b18aa[_0x5532('0x1a')]?_0x2b18aa[_0x5532('0x1a')][_0x5532('0x1d')]||null:null,'limit':_0x2b18aa[_0x5532('0x1a')]?_0x2b18aa['options'][_0x5532('0x1e')]||null:null})[_0x5532('0xd')](function(_0x56094e){logger[_0x5532('0xe')](_0x5532('0x22'),_0x2b18aa);logger[_0x5532('0x11')](_0x5532('0x22'),_0x2b18aa,JSON[_0x5532('0x12')](_0x56094e));_0x5378d(_0x56094e);})[_0x5532('0x16')](function(_0x29b905){logger[_0x5532('0x13')](_0x5532('0x22'),_0x29b905[_0x5532('0x14')],_0x2b18aa);_0x3c6922(_0x4b6f6e[_0x5532('0x13')](0x1f4,_0x29b905[_0x5532('0x14')]));});});};exports[_0x5532('0x25')]=function(_0x25e28a){var _0x1d0cd0=this;return new Promise(function(_0x75c8a,_0x17cd74){return db[_0x5532('0x18')][_0x5532('0x26')]({'where':_0x25e28a['options']?_0x25e28a[_0x5532('0x1a')][_0x5532('0x1c')]||null:null})[_0x5532('0xd')](function(_0x1aabdd){logger[_0x5532('0xe')]('DestroyCmHopperBlack',_0x25e28a);logger[_0x5532('0x11')](_0x5532('0x25'),_0x25e28a,JSON[_0x5532('0x12')](_0x1aabdd));_0x75c8a(_0x1aabdd);})[_0x5532('0x16')](function(_0x11aefc){logger['error'](_0x5532('0x25'),_0x11aefc[_0x5532('0x14')],_0x25e28a);_0x17cd74(_0x1d0cd0[_0x5532('0x13')](0x1f4,_0x11aefc['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 68fc6d5..e2390ed 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 _0x8ace=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','put'];(function(_0x5f1066,_0x29d237){var _0x1b4034=function(_0x1d9f42){while(--_0x1d9f42){_0x5f1066['push'](_0x5f1066['shift']());}};_0x1b4034(++_0x29d237);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3400ca,_0x27c04d){_0x3400ca=_0x3400ca-0x0;var _0x26e8d1=_0x8ace[_0x3400ca];return _0x26e8d1;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['describe']);router['get'](_0xe8ac('0xf'),auth['isAuthenticated'](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')](_0xe8ac('0xf'),auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x12')]);router[_0xe8ac('0x13')]('/:id',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x14')]);module[_0xe8ac('0x15')]=router; \ No newline at end of file +var _0x3f8a=['describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x19bb81,_0x4a0b7f){var _0x4bcf66=function(_0x27a00f){while(--_0x27a00f){_0x19bb81['push'](_0x19bb81['shift']());}};_0x4bcf66(++_0x4a0b7f);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x580bc6,_0xa1f79b){_0x580bc6=_0x580bc6-0x0;var _0xca0497=_0x3f8a[_0x580bc6];return _0xca0497;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['put'](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')]('/:id',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x13')]);module[_0xa3f8('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 98ca3db..67ce8da 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 _0xc0c9=['INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','moment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0c9,0xf0));var _0x9c0c=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc0c9[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9c0c('0x0'));module[_0x9c0c('0x1')]={'state':{'type':Sequelize[_0x9c0c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9c0c('0x3')]},'scheduledat':{'type':Sequelize[_0x9c0c('0x4')]},'countbusyretry':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x9c0c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9c0c('0x3')]},'calleridnum':{'type':Sequelize[_0x9c0c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9c0c('0x4')]},'responsetime':{'type':Sequelize[_0x9c0c('0x4')]},'answertime':{'type':Sequelize[_0x9c0c('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9c0c('0x4')]},'ringtime':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9c0c('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9c0c('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9c0c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9c0c('0x3')]},'dispositionat':{'type':Sequelize[_0x9c0c('0x4')],'set':function(_0x555bbc){var _0x3c926d=this['getDataValue'](_0x9c0c('0x5'));if(_0x3c926d&&_0x555bbc){this[_0x9c0c('0x6')](_0x9c0c('0x7'),moment(_0x555bbc)[_0x9c0c('0x8')](moment(_0x3c926d),_0x9c0c('0x9')));}return this['setDataValue']('dispositionat',_0x555bbc);}},'amd':{'type':Sequelize[_0x9c0c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9c0c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9c0c('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9c0c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9c0c('0x4')]},'callback':{'type':Sequelize[_0x9c0c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9c0c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9c0c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9c0c('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9c0c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x10aa=['endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER','DATE','STRING','getDataValue'];(function(_0x54a210,_0x24e8d7){var _0x51484f=function(_0x31e4a3){while(--_0x31e4a3){_0x54a210['push'](_0x54a210['shift']());}};_0x51484f(++_0x24e8d7);}(_0x10aa,0x1c2));var _0xa10a=function(_0x3ea9c7,_0x159481){_0x3ea9c7=_0x3ea9c7-0x0;var _0x2e4aff=_0x10aa[_0x3ea9c7];return _0x2e4aff;};'use strict';var Sequelize=require(_0xa10a('0x0'));var moment=require(_0xa10a('0x1'));module['exports']={'state':{'type':Sequelize[_0xa10a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa10a('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa10a('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xa10a('0x4')]},'originatecalleridname':{'type':Sequelize[_0xa10a('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa10a('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa10a('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa10a('0x3')]},'endtime':{'type':Sequelize[_0xa10a('0x3')]},'ringtime':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa10a('0x4')]},'campaign':{'type':Sequelize[_0xa10a('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa10a('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa10a('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x264c5d){var _0x1dceec=this[_0xa10a('0x5')](_0xa10a('0x6'));if(_0x1dceec&&_0x264c5d){this[_0xa10a('0x7')](_0xa10a('0x8'),moment(_0x264c5d)['diff'](moment(_0x1dceec),_0xa10a('0x9')));}return this[_0xa10a('0x7')](_0xa10a('0xa'),_0x264c5d);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa10a('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa10a('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa10a('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa10a('0x3')]},'callback':{'type':Sequelize[_0xa10a('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa10a('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa10a('0x3')]},'deleted':{'type':Sequelize[_0xa10a('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa10a('0x3')]},'recallme':{'type':Sequelize[_0xa10a('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa10a('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa10a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 75b4c68..ea2f2ee 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 _0x2675=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','describe','body','uniqueid','params','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','busyContacts','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','phone','from','calleridnum','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','group','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x27460a,_0x1c38f7){var _0x235d03=function(_0xc956ea){while(--_0xc956ea){_0x27460a['push'](_0x27460a['shift']());}};_0x235d03(++_0x1c38f7);}(_0x2675,0x75));var _0x5267=function(_0x3ad3ab,_0x36e845){_0x3ad3ab=_0x3ad3ab-0x0;var _0x2d325c=_0x2675[_0x3ad3ab];return _0x2d325c;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['CmHopperFinal'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['CmHopperFinal'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['describe']=function(_0x12d6a8,_0x4ee826){return db['CmHopperFinal'][_0x5267('0x43')]()[_0x5267('0x22')](respondWithResult(_0x4ee826,null))['catch'](handleError(_0x4ee826,null));};exports['update']=function(_0x383ebe,_0xe0439e){if(_0x383ebe[_0x5267('0x44')][_0x5267('0x45')]){delete _0x383ebe[_0x5267('0x44')][_0x5267('0x45')];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'uniqueid':_0x383ebe[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0xe0439e,null))[_0x5267('0x22')](saveUpdates(_0x383ebe[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0xe0439e,null))[_0x5267('0x3d')](handleError(_0xe0439e,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x8636d0,_0x466d46,_0x371486){return db['CmHopperFinal'][_0x5267('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x8636d0[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4a')))),'noSuchContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db['sequelize']['fn']('COUNT',db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),'busyContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x51')))),_0x5267('0x52')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x53')))),'abandonedContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x54')))),_0x5267('0x55')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x466d46,null))['then'](respondWithResult(_0x466d46,null))['catch'](handleError(_0x466d46,null));};exports[_0x5267('0x58')]=function(_0x5393e9,_0x3f5cda,_0x47059c){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x5393e9[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4a')))),_0x5267('0x59')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),_0x5267('0x5a')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x51')))),_0x5267('0x52')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x53')))),_0x5267('0x5b')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x3f5cda,null))[_0x5267('0x22')](respondWithResult(_0x3f5cda,null))[_0x5267('0x3d')](handleError(_0x3f5cda,null));};exports[_0x5267('0x5c')]=function(_0x21338f,_0x1103c5,_0x489b9a){return db['VoiceQueue']['find']({'where':{'id':_0x21338f[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x1103c5,null))[_0x5267('0x22')](function(_0x457d84){var _0x4974d1;if(_0x457d84){_0x4974d1=squel[_0x5267('0x5d')]()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')](['phone',_0x5267('0x61'),_0x5267('0x62'),'ListId',_0x5267('0x63'),_0x5267('0x64'),'updatedAt'],squel['select']()[_0x5267('0x65')](_0x5267('0x66'),'phone')['field'](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')](_0x5267('0x68'),_0x5267('0x62'))['field'](_0x5267('0x69'),_0x5267('0x6a'))['field'](_0x5267('0x6b'),_0x5267('0x63'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))['from']('cm_hopper_final')[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())['where'](_0x5267('0x6f'),_0x21338f['body'][_0x5267('0x70')][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x71'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x73'))[_0x5267('0x74')](_0x5267('0x5f'))[_0x5267('0x34')]('VoiceQueueId\x20=\x20?',_0x21338f[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))['group'](_0x5267('0x62')))[_0x5267('0x6e')]();return db['sequelize'][_0x5267('0x2c')](_0x4974d1);}return[];})[_0x5267('0x22')](respondWithResult(_0x1103c5,null))[_0x5267('0x3d')](handleError(_0x1103c5,null));};exports[_0x5267('0x78')]=function(_0xd18795,_0x37b007,_0x358543){return db['Campaign'][_0x5267('0x42')]({'where':{'id':_0xd18795[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x37b007,null))[_0x5267('0x22')](function(_0x1cdf9f){var _0x4dbaa2;if(_0x1cdf9f){_0x4dbaa2=squel['insert']()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')]([_0x5267('0x73'),'scheduledAt',_0x5267('0x62'),_0x5267('0x6a'),_0x5267('0x79'),_0x5267('0x64'),_0x5267('0x6c')],squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x66'),_0x5267('0x73'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')]('ANY_VALUE(ContactId)',_0x5267('0x62'))[_0x5267('0x65')](_0x5267('0x69'),_0x5267('0x6a'))[_0x5267('0x65')](_0x5267('0x7a'),_0x5267('0x79'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x7b'),_0xd18795[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x6f'),_0xd18795[_0x5267('0x44')][_0x5267('0x70')]['toString']())[_0x5267('0x34')](_0x5267('0x71'))[_0x5267('0x34')](_0x5267('0x7c'),squel[_0x5267('0x72')]()['field'](_0x5267('0x73'))[_0x5267('0x74')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0xd18795[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')]('CampaignId\x20=\x20?',_0xd18795['params']['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))[_0x5267('0x7d')](_0x5267('0x62')))['toString']();return db[_0x5267('0x48')]['query'](_0x4dbaa2);}return[];})['then'](respondWithResult(_0x37b007,null))[_0x5267('0x3d')](handleError(_0x37b007,null));};exports['checkContactHopper']=function(_0x5da8d6,_0x3ebe63,_0x321322){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x5da8d6['body'][_0x5267('0x63')],'CampaignId':_0x5da8d6['body'][_0x5267('0x79')],'ContactId':_0x5da8d6['body'][_0x5267('0x62')]}})[_0x5267('0x22')](handleEntityNotFound(_0x3ebe63,null))['then'](function(_0x1ae9fe){if(_0x1ae9fe){return _0x1ae9fe;}return null;})[_0x5267('0x22')](respondWithResult(_0x3ebe63,null))[_0x5267('0x3d')](handleError(_0x3ebe63,null));}; \ No newline at end of file +var _0x4137=['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','CmHopperFinal','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','literal','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'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['CmHopperFinal'][_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['describe']=function(_0x513657,_0x3c1f1a){return db['CmHopperFinal']['describe']()[_0x7413('0x25')](respondWithResult(_0x3c1f1a,null))[_0x7413('0x47')](handleError(_0x3c1f1a,null));};exports['update']=function(_0x2aa12c,_0x586d25){if(_0x2aa12c['body'][_0x7413('0x48')]){delete _0x2aa12c['body'][_0x7413('0x48')];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'uniqueid':_0x2aa12c[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x586d25,null))[_0x7413('0x25')](saveUpdates(_0x2aa12c[_0x7413('0x49')],null))[_0x7413('0x25')](respondWithResult(_0x586d25,null))[_0x7413('0x47')](handleError(_0x586d25,null));};exports[_0x7413('0x4a')]=function(_0x50a27d,_0x369891,_0x501407){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x50a27d[_0x7413('0x43')]['id']},'attributes':[[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7413('0x4d')))),'noSuchContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x7413('0x4e')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x4f')))),_0x7413('0x50')],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7413('0x51')))),_0x7413('0x52')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x53')))),'dropContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x55')))),'abandonedContacts'],[db[_0x7413('0x4b')]['fn']('COUNT',db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')]['literal'](_0x7413('0x56')))),_0x7413('0x57')],[db['sequelize']['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x58')))),_0x7413('0x59')]]})[_0x7413('0x25')](handleEntityNotFound(_0x369891,null))[_0x7413('0x25')](respondWithResult(_0x369891,null))[_0x7413('0x47')](handleError(_0x369891,null));};exports[_0x7413('0x5a')]=function(_0x28130e,_0x593571,_0x35f7e8){return db['CmHopperFinal'][_0x7413('0x41')]({'raw':![],'where':{'CampaignId':_0x28130e[_0x7413('0x43')]['id']},'attributes':[[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x5b')))),_0x7413('0x4e')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x4f')))),_0x7413('0x50')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db['sequelize'][_0x7413('0x54')](_0x7413('0x51')))),'congestionContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x53')))),'dropContacts'],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db[_0x7413('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7413('0x5c')],[db[_0x7413('0x4b')]['fn'](_0x7413('0x4c'),db[_0x7413('0x4b')]['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x56')))),_0x7413('0x57')],[db['sequelize']['fn'](_0x7413('0x4c'),db['sequelize']['fn']('IF',db[_0x7413('0x4b')][_0x7413('0x54')](_0x7413('0x58')))),_0x7413('0x59')]]})[_0x7413('0x25')](handleEntityNotFound(_0x593571,null))[_0x7413('0x25')](respondWithResult(_0x593571,null))[_0x7413('0x47')](handleError(_0x593571,null));};exports[_0x7413('0x5d')]=function(_0x2c504e,_0x50910a,_0x5988bd){return db[_0x7413('0x5e')]['find']({'where':{'id':_0x2c504e[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x50910a,null))['then'](function(_0x2be9b1){var _0x4b676a;if(_0x2be9b1){_0x4b676a=squel[_0x7413('0x5f')]()[_0x7413('0x60')]('cm_hopper')['fromQuery']([_0x7413('0x61'),_0x7413('0x62'),_0x7413('0x63'),'ListId',_0x7413('0x64'),_0x7413('0x65'),_0x7413('0x66')],squel[_0x7413('0x67')]()[_0x7413('0x68')](_0x7413('0x69'),'phone')[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x62'))['field'](_0x7413('0x6b'),_0x7413('0x63'))[_0x7413('0x68')](_0x7413('0x6c'),_0x7413('0x6d'))[_0x7413('0x68')](_0x7413('0x6e'),_0x7413('0x64'))[_0x7413('0x68')]('NOW()',_0x7413('0x65'))[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x66'))[_0x7413('0x6f')](_0x7413('0x70'))['where'](_0x7413('0x71'),_0x2c504e['params']['id']['toString']())[_0x7413('0x3b')](_0x7413('0x72'),_0x2c504e['body'][_0x7413('0x73')][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x75'))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')]('phone')[_0x7413('0x6f')]('cm_hopper')[_0x7413('0x3b')](_0x7413('0x71'),_0x2c504e['params']['id'][_0x7413('0x74')]()))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')](_0x7413('0x77'))[_0x7413('0x6f')](_0x7413('0x70'))[_0x7413('0x3b')](_0x7413('0x71'),_0x2c504e['params']['id'][_0x7413('0x74')]())[_0x7413('0x3b')]('state\x20=\x204'))['group']('ContactId'))[_0x7413('0x74')]();return db['sequelize'][_0x7413('0x32')](_0x4b676a);}return[];})[_0x7413('0x25')](respondWithResult(_0x50910a,null))[_0x7413('0x47')](handleError(_0x50910a,null));};exports[_0x7413('0x78')]=function(_0x470c21,_0x17c115,_0xbba3c7){return db[_0x7413('0x79')][_0x7413('0x46')]({'where':{'id':_0x470c21['params']['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x17c115,null))[_0x7413('0x25')](function(_0x38bb4e){var _0x4ea60e;if(_0x38bb4e){_0x4ea60e=squel[_0x7413('0x5f')]()[_0x7413('0x60')](_0x7413('0x7a'))[_0x7413('0x7b')]([_0x7413('0x61'),_0x7413('0x62'),_0x7413('0x63'),_0x7413('0x6d'),_0x7413('0x7c'),_0x7413('0x65'),'updatedAt'],squel[_0x7413('0x67')]()[_0x7413('0x68')]('ANY_VALUE(calleridnum)',_0x7413('0x61'))[_0x7413('0x68')]('NOW()',_0x7413('0x62'))[_0x7413('0x68')](_0x7413('0x6b'),'ContactId')[_0x7413('0x68')]('ANY_VALUE(ListId)',_0x7413('0x6d'))[_0x7413('0x68')](_0x7413('0x7d'),_0x7413('0x7c'))[_0x7413('0x68')](_0x7413('0x6a'),'createdAt')[_0x7413('0x68')](_0x7413('0x6a'),_0x7413('0x66'))[_0x7413('0x6f')](_0x7413('0x70'))['where'](_0x7413('0x7e'),_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x72'),_0x470c21['body']['state'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x75'))[_0x7413('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x7413('0x68')](_0x7413('0x61'))[_0x7413('0x6f')]('cm_hopper')['where'](_0x7413('0x7e'),_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]()))[_0x7413('0x3b')](_0x7413('0x76'),squel[_0x7413('0x67')]()[_0x7413('0x68')]('calleridnum')['from'](_0x7413('0x70'))[_0x7413('0x3b')]('CampaignId\x20=\x20?',_0x470c21[_0x7413('0x43')]['id'][_0x7413('0x74')]())[_0x7413('0x3b')](_0x7413('0x7f')))[_0x7413('0x80')](_0x7413('0x63')))[_0x7413('0x74')]();return db[_0x7413('0x4b')][_0x7413('0x32')](_0x4ea60e);}return[];})['then'](respondWithResult(_0x17c115,null))[_0x7413('0x47')](handleError(_0x17c115,null));};exports[_0x7413('0x81')]=function(_0x59d665,_0x1f3e26,_0xccd480){return db[_0x7413('0x82')]['findOne']({'where':{'VoiceQueueId':_0x59d665['body']['VoiceQueueId'],'CampaignId':_0x59d665[_0x7413('0x49')][_0x7413('0x7c')],'ContactId':_0x59d665[_0x7413('0x49')][_0x7413('0x63')]}})[_0x7413('0x25')](handleEntityNotFound(_0x1f3e26,null))[_0x7413('0x25')](function(_0x207293){if(_0x207293){return _0x207293;}return null;})[_0x7413('0x25')](respondWithResult(_0x1f3e26,null))['catch'](handleError(_0x1f3e26,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index dd984f4..68b6650 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 _0x3c5c=['calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final'];(function(_0x459853,_0xb114ba){var _0x5c9b96=function(_0x2651ba){while(--_0x2651ba){_0x459853['push'](_0x459853['shift']());}};_0x5c9b96(++_0xb114ba);}(_0x3c5c,0xfe));var _0xc3c5=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x3c5c[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require(_0xc3c5('0x0'));var logger=require(_0xc3c5('0x1'))(_0xc3c5('0x2'));var moment=require(_0xc3c5('0x3'));var BPromise=require(_0xc3c5('0x4'));var rp=require(_0xc3c5('0x5'));var fs=require('fs');var path=require(_0xc3c5('0x6'));var rimraf=require(_0xc3c5('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xc3c5('0x8')]=function(_0x3d4d4f,_0xd0508f){return _0x3d4d4f[_0xc3c5('0x9')](_0xc3c5('0xa'),attributes,{'tableName':_0xc3c5('0xb'),'paranoid':![],'indexes':[{'name':_0xc3c5('0xc'),'fields':['calleridnum']},{'name':_0xc3c5('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe5a=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x180852,_0x50a37e){var _0x25868c=function(_0x29b475){while(--_0x29b475){_0x180852['push'](_0x180852['shift']());}};_0x25868c(++_0x50a37e);}(_0xfe5a,0x177));var _0xafe5=function(_0xcc3fae,_0x122871){_0xcc3fae=_0xcc3fae-0x0;var _0x45c2cd=_0xfe5a[_0xcc3fae];return _0x45c2cd;};'use strict';var _=require(_0xafe5('0x0'));var util=require(_0xafe5('0x1'));var logger=require('../../config/logger')(_0xafe5('0x2'));var moment=require(_0xafe5('0x3'));var BPromise=require(_0xafe5('0x4'));var rp=require(_0xafe5('0x5'));var fs=require('fs');var path=require(_0xafe5('0x6'));var rimraf=require(_0xafe5('0x7'));var config=require(_0xafe5('0x8'));var attributes=require(_0xafe5('0x9'));module[_0xafe5('0xa')]=function(_0x351d80,_0x28977a){return _0x351d80[_0xafe5('0xb')](_0xafe5('0xc'),attributes,{'tableName':_0xafe5('0xd'),'paranoid':![],'indexes':[{'name':_0xafe5('0xe'),'fields':[_0xafe5('0xe')]},{'name':'uniqueid','fields':[_0xafe5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index b4e4bbe..9d82ed8 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(_0x1095d9,_0x5a3186){var _0x153ea4=function(_0x1f258a){while(--_0x1f258a){_0x1095d9['push'](_0x1095d9['shift']());}};_0x153ea4(++_0x5a3186);}(_0xb10b,0x12a));var _0xbb10=function(_0x252782,_0x5b7839){_0x252782=_0x252782-0x0;var _0x5123ea=_0xb10b[_0x252782];return _0x5123ea;};'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(_0x4feb37,_0xba05d5){var _0x30dd7d=function(_0x16e841){while(--_0x16e841){_0x4feb37['push'](_0x4feb37['shift']());}};_0x30dd7d(++_0xba05d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b70f0,_0x189655){_0x5b70f0=_0x5b70f0-0x0;var _0x49a246=_0xb10b[_0x5b70f0];return _0x49a246;};'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 b2d5763..3878f17 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 _0x5aa0=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x22c5fe,_0x391286){var _0x3cea05=function(_0x1dae9c){while(--_0x1dae9c){_0x22c5fe['push'](_0x22c5fe['shift']());}};_0x3cea05(++_0x391286);}(_0x5aa0,0x135));var _0x05aa=function(_0x4ce986,_0x5d4e4f){_0x4ce986=_0x4ce986-0x0;var _0x1f8568=_0x5aa0[_0x4ce986];return _0x1f8568;};'use strict';var multer=require(_0x05aa('0x0'));var util=require(_0x05aa('0x1'));var path=require(_0x05aa('0x2'));var timeout=require(_0x05aa('0x3'));var express=require('express');var router=express[_0x05aa('0x4')]();var fs_extra=require(_0x05aa('0x5'));var auth=require(_0x05aa('0x6'));var interaction=require(_0x05aa('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x05aa('0x8')](),controller[_0x05aa('0x9')]);router[_0x05aa('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x05aa('0xb')]);router[_0x05aa('0xa')](_0x05aa('0xc'),auth['isAuthenticated'](),controller[_0x05aa('0xd')]);router['get'](_0x05aa('0xe'),auth[_0x05aa('0x8')](),controller[_0x05aa('0xf')]);router[_0x05aa('0xa')](_0x05aa('0x10'),auth[_0x05aa('0x8')](),controller[_0x05aa('0x11')]);router[_0x05aa('0x12')](_0x05aa('0x13'),auth[_0x05aa('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x05aa('0x12')](_0x05aa('0x14'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x05aa('0x12')](_0x05aa('0x15'),auth[_0x05aa('0x8')](),controller[_0x05aa('0x16')]);router[_0x05aa('0x17')](_0x05aa('0xc'),auth[_0x05aa('0x8')](),controller[_0x05aa('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc759=['isAuthenticated','/describe','/:id','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x55c23c,_0x3458ac){var _0x6e1b34=function(_0x3b4bd9){while(--_0x3b4bd9){_0x55c23c['push'](_0x55c23c['shift']());}};_0x6e1b34(++_0x3458ac);}(_0xc759,0xa0));var _0x9c75=function(_0x17d44b,_0x5a6307){_0x17d44b=_0x17d44b-0x0;var _0x45b774=_0xc759[_0x17d44b];return _0x45b774;};'use strict';var multer=require('multer');var util=require(_0x9c75('0x0'));var path=require(_0x9c75('0x1'));var timeout=require(_0x9c75('0x2'));var express=require(_0x9c75('0x3'));var router=express['Router']();var fs_extra=require(_0x9c75('0x4'));var auth=require(_0x9c75('0x5'));var interaction=require(_0x9c75('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x9c75('0x7')]('/',auth[_0x9c75('0x8')](),controller['index']);router[_0x9c75('0x7')](_0x9c75('0x9'),auth[_0x9c75('0x8')](),controller['describe']);router[_0x9c75('0x7')](_0x9c75('0xa'),auth[_0x9c75('0x8')](),controller['show']);router[_0x9c75('0x7')](_0x9c75('0xb'),auth[_0x9c75('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x9c75('0x7')](_0x9c75('0xc'),auth[_0x9c75('0x8')](),controller[_0x9c75('0xd')]);router[_0x9c75('0xe')](_0x9c75('0xf'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x10')]);router[_0x9c75('0xe')]('/voice/campaign/moveContacts/:id',auth[_0x9c75('0x8')](),controller[_0x9c75('0x11')]);router[_0x9c75('0xe')]('/checkContactHopper',auth[_0x9c75('0x8')](),controller[_0x9c75('0x12')]);router['put'](_0x9c75('0xa'),auth[_0x9c75('0x8')](),controller[_0x9c75('0x13')]);module[_0x9c75('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c2a4652..4837119 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 _0x6c60=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x4cda0c,_0x1286ca){var _0x1e0224=function(_0x23164b){while(--_0x23164b){_0x4cda0c['push'](_0x4cda0c['shift']());}};_0x1e0224(++_0x1286ca);}(_0x6c60,0x168));var _0x06c6=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x6c60[_0x5c6994];return _0x1d5c84;};'use strict';var Sequelize=require(_0x06c6('0x0'));module[_0x06c6('0x1')]={'state':{'type':Sequelize[_0x06c6('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x06c6('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x06c6('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x06c6('0x4')]},'originatecalleridname':{'type':Sequelize[_0x06c6('0x4')]},'calleridnum':{'type':Sequelize[_0x06c6('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x06c6('0x3')]},'responsetime':{'type':Sequelize[_0x06c6('0x3')]},'answertime':{'type':Sequelize[_0x06c6('0x3')]},'droptime':{'type':Sequelize[_0x06c6('0x3')]},'endtime':{'type':Sequelize[_0x06c6('0x3')]},'ringtime':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x06c6('0x4')]},'campaign':{'type':Sequelize[_0x06c6('0x4')]},'campaigntype':{'type':Sequelize[_0x06c6('0x4')]},'membername':{'type':Sequelize[_0x06c6('0x4')]},'reason':{'type':Sequelize[_0x06c6('0x4')]},'amd':{'type':Sequelize[_0x06c6('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x06c6('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x06c6('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x06c6('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x06c6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x85f1=['INTEGER','DATE','STRING','BOOLEAN','exports'];(function(_0x1a0dd4,_0x4c982f){var _0x411caf=function(_0x13775b){while(--_0x13775b){_0x1a0dd4['push'](_0x1a0dd4['shift']());}};_0x411caf(++_0x4c982f);}(_0x85f1,0xdb));var _0x185f=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x85f1[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require('sequelize');module[_0x185f('0x0')]={'state':{'type':Sequelize[_0x185f('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x185f('0x2')]},'countbusyretry':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x185f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x185f('0x3')]},'originatecalleridname':{'type':Sequelize[_0x185f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x185f('0x3')]},'starttime':{'type':Sequelize[_0x185f('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x185f('0x2')]},'ringtime':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x185f('0x3')]},'campaigntype':{'type':Sequelize[_0x185f('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x185f('0x3')]},'amd':{'type':Sequelize[_0x185f('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x185f('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x185f('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x185f('0x2')]},'recallme':{'type':Sequelize[_0x185f('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x185f('0x2')]},'edited':{'type':Sequelize[_0x185f('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x185f('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 63407db..0e4ad55 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 _0x74c2=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','type','query','keys','model','fields','length','attributes','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','catch','show','params','CmHopperHistory','rawAttributes','intersection','create','body','uniqueid','find','eml-format','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x74c2,0xc9));var _0x274c=function(_0x2e1749,_0x462b40){_0x2e1749=_0x2e1749-0x0;var _0x12d260=_0x74c2[_0x2e1749];return _0x12d260;};'use strict';var emlformat=require(_0x274c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x274c('0x1'));var jsonpatch=require(_0x274c('0x2'));var rp=require('request-promise');var moment=require(_0x274c('0x3'));var BPromise=require(_0x274c('0x4'));var Mustache=require(_0x274c('0x5'));var util=require(_0x274c('0x6'));var path=require('path');var sox=require(_0x274c('0x7'));var csv=require(_0x274c('0x8'));var ejs=require(_0x274c('0x9'));var fs=require('fs');var fs_extra=require(_0x274c('0xa'));var _=require(_0x274c('0xb'));var squel=require(_0x274c('0xc'));var crypto=require('crypto');var jsforce=require(_0x274c('0xd'));var deskjs=require(_0x274c('0xe'));var toCsv=require(_0x274c('0x8'));var querystring=require(_0x274c('0xf'));var Papa=require(_0x274c('0x10'));var Redis=require(_0x274c('0x11'));var authService=require(_0x274c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x274c('0x13'));var hardwareService=require(_0x274c('0x14'));var logger=require(_0x274c('0x15'))(_0x274c('0x16'));var utils=require(_0x274c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x274c('0x18'));var db=require(_0x274c('0x19'))['db'];function respondWithStatusCode(_0x2b7235,_0x1380a1){_0x1380a1=_0x1380a1||0xcc;return function(_0x33b7ea){if(_0x33b7ea){return _0x2b7235[_0x274c('0x1a')](_0x1380a1);}return _0x2b7235[_0x274c('0x1b')](_0x1380a1)['end']();};}function respondWithResult(_0x126a75,_0x5d786c){_0x5d786c=_0x5d786c||0xc8;return function(_0x1529a9){if(_0x1529a9){return _0x126a75['status'](_0x5d786c)[_0x274c('0x1c')](_0x1529a9);}};}function respondWithFilteredResult(_0x363d0f,_0x446032){return function(_0x2bcbf1){if(_0x2bcbf1){var _0x2cd5df=typeof _0x446032[_0x274c('0x1d')]===_0x274c('0x1e')&&typeof _0x446032[_0x274c('0x1f')]==='undefined';var _0x462cd3=_0x2bcbf1[_0x274c('0x20')];var _0x446387=_0x2cd5df?0x0:_0x446032[_0x274c('0x1d')];var _0x22b487=_0x2cd5df?_0x2bcbf1[_0x274c('0x20')]:_0x446032[_0x274c('0x1d')]+_0x446032[_0x274c('0x1f')];var _0x998d56;if(_0x22b487>=_0x462cd3){_0x22b487=_0x462cd3;_0x998d56=0xc8;}else{_0x998d56=0xce;}_0x363d0f[_0x274c('0x1b')](_0x998d56);return _0x363d0f[_0x274c('0x21')](_0x274c('0x22'),_0x446387+'-'+_0x22b487+'/'+_0x462cd3)[_0x274c('0x1c')](_0x2bcbf1);}return null;};}function patchUpdates(_0x3ba96a){return function(_0x54395c){try{jsonpatch[_0x274c('0x23')](_0x54395c,_0x3ba96a,!![]);}catch(_0x4c697c){return BPromise[_0x274c('0x24')](_0x4c697c);}return _0x54395c[_0x274c('0x25')]();};}function saveUpdates(_0x4f7b64,_0x54d9f5){return function(_0x5576be){if(_0x5576be){return _0x5576be[_0x274c('0x26')](_0x4f7b64)[_0x274c('0x27')](function(_0x18b176){return _0x18b176;});}return null;};}function removeEntity(_0xcdd75f,_0x4e6838){return function(_0xd589b9){if(_0xd589b9){return _0xd589b9[_0x274c('0x28')]()['then'](function(){_0xcdd75f['status'](0xcc)[_0x274c('0x29')]();});}};}function handleEntityNotFound(_0x292647,_0x3fc58e){return function(_0x109f55){if(!_0x109f55){_0x292647[_0x274c('0x1a')](0x194);}return _0x109f55;};}function handleError(_0x1574a9,_0x4e2bae){_0x4e2bae=_0x4e2bae||0x1f4;return function(_0x2a0d74){logger[_0x274c('0x2a')](_0x2a0d74[_0x274c('0x2b')]);if(_0x2a0d74[_0x274c('0x2c')]){delete _0x2a0d74[_0x274c('0x2c')];}_0x1574a9['status'](_0x4e2bae)[_0x274c('0x2d')](_0x2a0d74);};}exports[_0x274c('0x2e')]=function(_0x4386f0,_0x1d0fa8){var _0x2725ba={},_0x3f61e3={},_0x59dcde={'count':0x0,'rows':[]};var _0x5bbdf9=_[_0x274c('0x2f')](db['CmHopperHistory']['rawAttributes'],function(_0x2806c5){return{'name':_0x2806c5['fieldName'],'type':_0x2806c5[_0x274c('0x30')]['key']};});_0x3f61e3['model']=_[_0x274c('0x2f')](_0x5bbdf9,_0x274c('0x2c'));_0x3f61e3[_0x274c('0x31')]=_[_0x274c('0x32')](_0x4386f0[_0x274c('0x31')]);_0x3f61e3['filters']=_['intersection'](_0x3f61e3['model'],_0x3f61e3['query']);_0x2725ba['attributes']=_['intersection'](_0x3f61e3[_0x274c('0x33')],qs[_0x274c('0x34')](_0x4386f0[_0x274c('0x31')][_0x274c('0x34')]));_0x2725ba['attributes']=_0x2725ba['attributes'][_0x274c('0x35')]?_0x2725ba[_0x274c('0x36')]:_0x3f61e3[_0x274c('0x33')];if(!_0x4386f0[_0x274c('0x31')]['hasOwnProperty'](_0x274c('0x37'))){_0x2725ba[_0x274c('0x1f')]=qs[_0x274c('0x1f')](_0x4386f0['query']['limit']);_0x2725ba[_0x274c('0x1d')]=qs[_0x274c('0x1d')](_0x4386f0[_0x274c('0x31')][_0x274c('0x1d')]);}_0x2725ba[_0x274c('0x38')]=qs[_0x274c('0x39')](_0x4386f0[_0x274c('0x31')][_0x274c('0x39')]);_0x2725ba['where']=qs[_0x274c('0x3a')](_[_0x274c('0x3b')](_0x4386f0[_0x274c('0x31')],_0x3f61e3[_0x274c('0x3a')]),_0x5bbdf9);if(_0x4386f0['query'][_0x274c('0x3c')]){_0x2725ba['where']=_[_0x274c('0x3d')](_0x2725ba[_0x274c('0x3e')],{'$or':_['map'](_0x5bbdf9,function(_0x5ac424){if(_0x5ac424[_0x274c('0x30')]!=='VIRTUAL'){var _0x517b7f={};_0x517b7f[_0x5ac424[_0x274c('0x2c')]]={'$like':'%'+_0x4386f0[_0x274c('0x31')][_0x274c('0x3c')]+'%'};return _0x517b7f;}})});}_0x2725ba=_[_0x274c('0x3d')]({},_0x2725ba,_0x4386f0[_0x274c('0x3f')]);var _0x106245={'where':_0x2725ba[_0x274c('0x3e')]};return db['CmHopperHistory'][_0x274c('0x20')](_0x106245)[_0x274c('0x27')](function(_0x51042d){_0x59dcde[_0x274c('0x20')]=_0x51042d;if(_0x4386f0['query'][_0x274c('0x40')]){_0x2725ba[_0x274c('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x2725ba);})['then'](function(_0x31d9){_0x59dcde['rows']=_0x31d9;return _0x59dcde;})['then'](respondWithFilteredResult(_0x1d0fa8,_0x2725ba))[_0x274c('0x42')](handleError(_0x1d0fa8,null));};exports[_0x274c('0x43')]=function(_0x39d234,_0x59ade0){var _0x59b55a={'raw':!![],'where':{'id':_0x39d234[_0x274c('0x44')]['id']}},_0x1ba314={};_0x1ba314[_0x274c('0x33')]=_[_0x274c('0x32')](db[_0x274c('0x45')][_0x274c('0x46')]);_0x1ba314[_0x274c('0x31')]=_[_0x274c('0x32')](_0x39d234[_0x274c('0x31')]);_0x1ba314[_0x274c('0x3a')]=_[_0x274c('0x47')](_0x1ba314[_0x274c('0x33')],_0x1ba314['query']);_0x59b55a['attributes']=_['intersection'](_0x1ba314[_0x274c('0x33')],qs['fields'](_0x39d234['query']['fields']));_0x59b55a[_0x274c('0x36')]=_0x59b55a['attributes'][_0x274c('0x35')]?_0x59b55a['attributes']:_0x1ba314[_0x274c('0x33')];if(_0x39d234['query'][_0x274c('0x40')]){_0x59b55a['include']=[{'all':!![]}];}_0x59b55a=_['merge']({},_0x59b55a,_0x39d234[_0x274c('0x3f')]);return db[_0x274c('0x45')]['find'](_0x59b55a)[_0x274c('0x27')](handleEntityNotFound(_0x59ade0,null))[_0x274c('0x27')](respondWithResult(_0x59ade0,null))[_0x274c('0x42')](handleError(_0x59ade0,null));};exports[_0x274c('0x48')]=function(_0x29109a,_0x1576bc){return db['CmHopperHistory'][_0x274c('0x48')](_0x29109a[_0x274c('0x49')],{})[_0x274c('0x27')](respondWithResult(_0x1576bc,0xc9))[_0x274c('0x42')](handleError(_0x1576bc,null));};exports['describe']=function(_0x396f19,_0x58efe8){return db[_0x274c('0x45')]['describe']()[_0x274c('0x27')](respondWithResult(_0x58efe8,null))[_0x274c('0x42')](handleError(_0x58efe8,null));};exports[_0x274c('0x26')]=function(_0x36247f,_0x471d3c){if(_0x36247f[_0x274c('0x49')][_0x274c('0x4a')]){delete _0x36247f[_0x274c('0x49')][_0x274c('0x4a')];}return db['CmHopperHistory'][_0x274c('0x4b')]({'where':{'uniqueid':_0x36247f[_0x274c('0x44')]['id']}})[_0x274c('0x27')](handleEntityNotFound(_0x471d3c,null))[_0x274c('0x27')](saveUpdates(_0x36247f[_0x274c('0x49')],null))[_0x274c('0x27')](respondWithResult(_0x471d3c,null))[_0x274c('0x42')](handleError(_0x471d3c,null));}; \ No newline at end of file +var _0xa729=['eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','create','body','describe','uniqueid','find','params'];(function(_0x582bd6,_0x2302a2){var _0x536e5d=function(_0x1f7fbb){while(--_0x1f7fbb){_0x582bd6['push'](_0x582bd6['shift']());}};_0x536e5d(++_0x2302a2);}(_0xa729,0x134));var _0x9a72=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xa729[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x9a72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9a72('0x1'));var rp=require(_0x9a72('0x2'));var moment=require('moment');var BPromise=require(_0x9a72('0x3'));var Mustache=require(_0x9a72('0x4'));var util=require(_0x9a72('0x5'));var path=require(_0x9a72('0x6'));var sox=require(_0x9a72('0x7'));var csv=require(_0x9a72('0x8'));var ejs=require(_0x9a72('0x9'));var fs=require('fs');var fs_extra=require(_0x9a72('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a72('0xb'));var jsforce=require(_0x9a72('0xc'));var deskjs=require(_0x9a72('0xd'));var toCsv=require(_0x9a72('0x8'));var querystring=require(_0x9a72('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a72('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9a72('0x10'));var as=require(_0x9a72('0x11'));var hardwareService=require(_0x9a72('0x12'));var logger=require(_0x9a72('0x13'))(_0x9a72('0x14'));var utils=require('../../config/utils');var config=require(_0x9a72('0x15'));var licenseUtil=require(_0x9a72('0x16'));var db=require(_0x9a72('0x17'))['db'];function respondWithStatusCode(_0x4cade4,_0x1ce160){_0x1ce160=_0x1ce160||0xcc;return function(_0x46436e){if(_0x46436e){return _0x4cade4['sendStatus'](_0x1ce160);}return _0x4cade4[_0x9a72('0x18')](_0x1ce160)[_0x9a72('0x19')]();};}function respondWithResult(_0x38f005,_0x562538){_0x562538=_0x562538||0xc8;return function(_0x4d74c4){if(_0x4d74c4){return _0x38f005[_0x9a72('0x18')](_0x562538)[_0x9a72('0x1a')](_0x4d74c4);}};}function respondWithFilteredResult(_0x4bd242,_0x2af6fa){return function(_0x5c0c55){if(_0x5c0c55){var _0x426641=typeof _0x2af6fa[_0x9a72('0x1b')]===_0x9a72('0x1c')&&typeof _0x2af6fa[_0x9a72('0x1d')]===_0x9a72('0x1c');var _0x408a15=_0x5c0c55[_0x9a72('0x1e')];var _0x1d65c4=_0x426641?0x0:_0x2af6fa[_0x9a72('0x1b')];var _0x2ab55b=_0x426641?_0x5c0c55[_0x9a72('0x1e')]:_0x2af6fa[_0x9a72('0x1b')]+_0x2af6fa[_0x9a72('0x1d')];var _0x22e037;if(_0x2ab55b>=_0x408a15){_0x2ab55b=_0x408a15;_0x22e037=0xc8;}else{_0x22e037=0xce;}_0x4bd242[_0x9a72('0x18')](_0x22e037);return _0x4bd242[_0x9a72('0x1f')](_0x9a72('0x20'),_0x1d65c4+'-'+_0x2ab55b+'/'+_0x408a15)['json'](_0x5c0c55);}return null;};}function patchUpdates(_0x53b0d8){return function(_0x10f9c8){try{jsonpatch[_0x9a72('0x21')](_0x10f9c8,_0x53b0d8,!![]);}catch(_0x367433){return BPromise[_0x9a72('0x22')](_0x367433);}return _0x10f9c8[_0x9a72('0x23')]();};}function saveUpdates(_0x5a12b1,_0x13e550){return function(_0xa9202d){if(_0xa9202d){return _0xa9202d[_0x9a72('0x24')](_0x5a12b1)[_0x9a72('0x25')](function(_0x5d5e5f){return _0x5d5e5f;});}return null;};}function removeEntity(_0xd76232,_0x237d17){return function(_0x5dee8c){if(_0x5dee8c){return _0x5dee8c[_0x9a72('0x26')]()['then'](function(){_0xd76232[_0x9a72('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1084,_0x4feab1){return function(_0x4ff86e){if(!_0x4ff86e){_0x4e1084[_0x9a72('0x27')](0x194);}return _0x4ff86e;};}function handleError(_0xf6510a,_0x541bdb){_0x541bdb=_0x541bdb||0x1f4;return function(_0x26a57b){logger['error'](_0x26a57b['stack']);if(_0x26a57b[_0x9a72('0x28')]){delete _0x26a57b['name'];}_0xf6510a[_0x9a72('0x18')](_0x541bdb)[_0x9a72('0x29')](_0x26a57b);};}exports[_0x9a72('0x2a')]=function(_0x10e07a,_0x52d058){var _0x3a03d3={},_0x5ef3cd={},_0x1fd715={'count':0x0,'rows':[]};var _0x26648e=_[_0x9a72('0x2b')](db[_0x9a72('0x2c')][_0x9a72('0x2d')],function(_0x59ce2b){return{'name':_0x59ce2b[_0x9a72('0x2e')],'type':_0x59ce2b[_0x9a72('0x2f')][_0x9a72('0x30')]};});_0x5ef3cd[_0x9a72('0x31')]=_[_0x9a72('0x2b')](_0x26648e,'name');_0x5ef3cd[_0x9a72('0x32')]=_['keys'](_0x10e07a[_0x9a72('0x32')]);_0x5ef3cd[_0x9a72('0x33')]=_[_0x9a72('0x34')](_0x5ef3cd['model'],_0x5ef3cd[_0x9a72('0x32')]);_0x3a03d3['attributes']=_[_0x9a72('0x34')](_0x5ef3cd[_0x9a72('0x31')],qs['fields'](_0x10e07a['query'][_0x9a72('0x35')]));_0x3a03d3['attributes']=_0x3a03d3[_0x9a72('0x36')][_0x9a72('0x37')]?_0x3a03d3[_0x9a72('0x36')]:_0x5ef3cd[_0x9a72('0x31')];if(!_0x10e07a[_0x9a72('0x32')][_0x9a72('0x38')](_0x9a72('0x39'))){_0x3a03d3['limit']=qs['limit'](_0x10e07a[_0x9a72('0x32')][_0x9a72('0x1d')]);_0x3a03d3[_0x9a72('0x1b')]=qs['offset'](_0x10e07a[_0x9a72('0x32')][_0x9a72('0x1b')]);}_0x3a03d3[_0x9a72('0x3a')]=qs[_0x9a72('0x3b')](_0x10e07a[_0x9a72('0x32')]['sort']);_0x3a03d3[_0x9a72('0x3c')]=qs[_0x9a72('0x33')](_['pick'](_0x10e07a['query'],_0x5ef3cd[_0x9a72('0x33')]),_0x26648e);if(_0x10e07a[_0x9a72('0x32')][_0x9a72('0x3d')]){_0x3a03d3[_0x9a72('0x3c')]=_[_0x9a72('0x3e')](_0x3a03d3[_0x9a72('0x3c')],{'$or':_['map'](_0x26648e,function(_0x540798){if(_0x540798[_0x9a72('0x2f')]!==_0x9a72('0x3f')){var _0x42cea6={};_0x42cea6[_0x540798[_0x9a72('0x28')]]={'$like':'%'+_0x10e07a[_0x9a72('0x32')][_0x9a72('0x3d')]+'%'};return _0x42cea6;}})});}_0x3a03d3=_[_0x9a72('0x3e')]({},_0x3a03d3,_0x10e07a[_0x9a72('0x40')]);var _0x190a68={'where':_0x3a03d3[_0x9a72('0x3c')]};return db[_0x9a72('0x2c')][_0x9a72('0x1e')](_0x190a68)[_0x9a72('0x25')](function(_0xcf4161){_0x1fd715[_0x9a72('0x1e')]=_0xcf4161;if(_0x10e07a['query'][_0x9a72('0x41')]){_0x3a03d3[_0x9a72('0x42')]=[{'all':!![]}];}return db[_0x9a72('0x2c')][_0x9a72('0x43')](_0x3a03d3);})[_0x9a72('0x25')](function(_0x4ec77d){_0x1fd715['rows']=_0x4ec77d;return _0x1fd715;})[_0x9a72('0x25')](respondWithFilteredResult(_0x52d058,_0x3a03d3))[_0x9a72('0x44')](handleError(_0x52d058,null));};exports[_0x9a72('0x45')]=function(_0x39638f,_0x54cd55){var _0x32ff17={'raw':!![],'where':{'id':_0x39638f['params']['id']}},_0x288054={};_0x288054[_0x9a72('0x31')]=_[_0x9a72('0x46')](db['CmHopperHistory'][_0x9a72('0x2d')]);_0x288054[_0x9a72('0x32')]=_['keys'](_0x39638f[_0x9a72('0x32')]);_0x288054[_0x9a72('0x33')]=_[_0x9a72('0x34')](_0x288054[_0x9a72('0x31')],_0x288054[_0x9a72('0x32')]);_0x32ff17[_0x9a72('0x36')]=_[_0x9a72('0x34')](_0x288054[_0x9a72('0x31')],qs[_0x9a72('0x35')](_0x39638f[_0x9a72('0x32')][_0x9a72('0x35')]));_0x32ff17['attributes']=_0x32ff17[_0x9a72('0x36')][_0x9a72('0x37')]?_0x32ff17[_0x9a72('0x36')]:_0x288054[_0x9a72('0x31')];if(_0x39638f[_0x9a72('0x32')][_0x9a72('0x41')]){_0x32ff17['include']=[{'all':!![]}];}_0x32ff17=_[_0x9a72('0x3e')]({},_0x32ff17,_0x39638f[_0x9a72('0x40')]);return db['CmHopperHistory']['find'](_0x32ff17)[_0x9a72('0x25')](handleEntityNotFound(_0x54cd55,null))[_0x9a72('0x25')](respondWithResult(_0x54cd55,null))[_0x9a72('0x44')](handleError(_0x54cd55,null));};exports[_0x9a72('0x47')]=function(_0x25b2bc,_0x184f19){return db[_0x9a72('0x2c')][_0x9a72('0x47')](_0x25b2bc[_0x9a72('0x48')],{})['then'](respondWithResult(_0x184f19,0xc9))['catch'](handleError(_0x184f19,null));};exports[_0x9a72('0x49')]=function(_0x105f9b,_0x146d74){return db[_0x9a72('0x2c')][_0x9a72('0x49')]()[_0x9a72('0x25')](respondWithResult(_0x146d74,null))[_0x9a72('0x44')](handleError(_0x146d74,null));};exports[_0x9a72('0x24')]=function(_0x3b7fae,_0x116647){if(_0x3b7fae[_0x9a72('0x48')]['uniqueid']){delete _0x3b7fae['body'][_0x9a72('0x4a')];}return db[_0x9a72('0x2c')][_0x9a72('0x4b')]({'where':{'uniqueid':_0x3b7fae[_0x9a72('0x4c')]['id']}})[_0x9a72('0x25')](handleEntityNotFound(_0x116647,null))['then'](saveUpdates(_0x3b7fae[_0x9a72('0x48')],null))['then'](respondWithResult(_0x116647,null))[_0x9a72('0x44')](handleError(_0x116647,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 520426d..5465ef0 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 _0x3f2e=['./cmHopperHistory.attributes','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x52e774,_0x57a2b5){var _0x505359=function(_0x4208da){while(--_0x4208da){_0x52e774['push'](_0x52e774['shift']());}};_0x505359(++_0x57a2b5);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x120564,_0x3c18cf){_0x120564=_0x120564-0x0;var _0x579980=_0x3f2e[_0x120564];return _0x579980;};'use strict';var _=require(_0xe3f2('0x0'));var util=require('util');var logger=require(_0xe3f2('0x1'))(_0xe3f2('0x2'));var moment=require(_0xe3f2('0x3'));var BPromise=require(_0xe3f2('0x4'));var rp=require(_0xe3f2('0x5'));var fs=require('fs');var path=require(_0xe3f2('0x6'));var rimraf=require(_0xe3f2('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3f2('0x8'));module['exports']=function(_0x7cdd2e,_0x2d6460){return _0x7cdd2e['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xe3f2('0x9'),'fields':[_0xe3f2('0x9')]},{'name':_0xe3f2('0xa'),'fields':[_0xe3f2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a38=['../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1a38,0xb0));var _0x81a3=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x1a38[_0x334651];return _0x29657c;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var logger=require(_0x81a3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81a3('0x3'));var fs=require('fs');var path=require(_0x81a3('0x4'));var rimraf=require(_0x81a3('0x5'));var config=require(_0x81a3('0x6'));var attributes=require(_0x81a3('0x7'));module[_0x81a3('0x8')]=function(_0x2f0a07,_0x189c2b){return _0x2f0a07[_0x81a3('0x9')](_0x81a3('0xa'),attributes,{'tableName':_0x81a3('0xb'),'paranoid':![],'indexes':[{'name':_0x81a3('0xc'),'fields':[_0x81a3('0xc')]},{'name':'uniqueid','fields':[_0x81a3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b1d4f95..489b779 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 _0x74a1=['CreateCmHopperHistory','findAll','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','where','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`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','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','campaign','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory','body','options','raw'];(function(_0x18745a,_0x1d7a87){var _0x29a25b=function(_0x15d469){while(--_0x15d469){_0x18745a['push'](_0x18745a['shift']());}};_0x29a25b(++_0x1d7a87);}(_0x74a1,0xff));var _0x174a=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x74a1[_0x2bcb75];return _0x175345;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var moment=require('moment');var BPromise=require(_0x174a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x174a('0x3'));var db=require(_0x174a('0x4'))['db'];var utils=require(_0x174a('0x5'));var logger=require(_0x174a('0x6'))(_0x174a('0x7'));var config=require(_0x174a('0x8'));var jayson=require(_0x174a('0x9'));var client=jayson[_0x174a('0xa')][_0x174a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3297b6,_0x1f30d8,_0x46b36a){return new BPromise(function(_0x4547c2,_0x2a4bf7){return client[_0x174a('0xc')](_0x3297b6,_0x46b36a)[_0x174a('0xd')](function(_0x1f1a52){logger[_0x174a('0xe')](_0x174a('0xf'),_0x1f30d8,_0x174a('0x10'));logger[_0x174a('0x11')](_0x174a('0x12'),_0x1f30d8,_0x174a('0x10'),JSON[_0x174a('0x13')](_0x1f1a52));if(_0x1f1a52[_0x174a('0x14')]){if(_0x1f1a52[_0x174a('0x14')][_0x174a('0x15')]===0x1f4){logger['error'](_0x174a('0xf'),_0x1f30d8,_0x1f1a52[_0x174a('0x14')][_0x174a('0x16')]);return _0x2a4bf7(_0x1f1a52[_0x174a('0x14')][_0x174a('0x16')]);}logger[_0x174a('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x1f30d8,_0x1f1a52[_0x174a('0x14')]['message']);return _0x4547c2(_0x1f1a52['error']['message']);}else{logger['info'](_0x174a('0xf'),_0x1f30d8,_0x174a('0x10'));_0x4547c2(_0x1f1a52[_0x174a('0x17')][_0x174a('0x16')]);}})[_0x174a('0x18')](function(_0xa93b47){logger[_0x174a('0x14')](_0x174a('0xf'),_0x1f30d8,_0xa93b47);_0x2a4bf7(_0xa93b47);});});}exports['CreateCmHopperHistory']=function(_0x53da20){var _0x3a28ab=this;return new Promise(function(_0x416b4f,_0x4f8b8f){return db[_0x174a('0x19')]['create'](_0x53da20[_0x174a('0x1a')],{'raw':_0x53da20[_0x174a('0x1b')]?_0x53da20[_0x174a('0x1b')][_0x174a('0x1c')]===undefined?!![]:![]:!![]})[_0x174a('0xd')](function(_0x24d080){logger['info'](_0x174a('0x1d'),_0x53da20);logger[_0x174a('0x11')](_0x174a('0x1d'),_0x53da20,JSON[_0x174a('0x13')](_0x24d080));_0x416b4f(_0x24d080);})[_0x174a('0x18')](function(_0x4fcc28){logger[_0x174a('0x14')]('CreateCmHopperHistory',_0x4fcc28[_0x174a('0x16')],_0x53da20);_0x4f8b8f(_0x3a28ab[_0x174a('0x14')](0x1f4,_0x4fcc28['message']));});});};exports['AvgHandleTime']=function(_0x58da55){var _0x5d429b=this;return new Promise(function(_0xad968d,_0x485661){return db[_0x174a('0x19')][_0x174a('0x1e')]({'raw':_0x58da55[_0x174a('0x1b')]?_0x58da55['options'][_0x174a('0x1c')]===undefined?!![]:![]:!![],'where':_0x58da55['options']?_0x58da55[_0x174a('0x1b')]['where']||null:null,'attributes':[[db[_0x174a('0x1f')]['fn']('COUNT',db['sequelize'][_0x174a('0x20')]('id')),_0x174a('0x21')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db['sequelize'][_0x174a('0x25')](_0x174a('0x26')))),_0x174a('0x27')],[db['sequelize']['fn'](_0x174a('0x28'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x174a('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x28'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x2a')))),'predictiveIntervalAvgTalktime']]})[_0x174a('0xd')](function(_0x1c11cd){logger[_0x174a('0xe')]('AvgHandleTime',_0x58da55);logger[_0x174a('0x11')](_0x174a('0x2b'),_0x58da55,JSON['stringify'](_0x1c11cd));_0xad968d(_0x1c11cd);})[_0x174a('0x18')](function(_0x2ee060){logger['error'](_0x174a('0x2b'),_0x2ee060[_0x174a('0x16')],_0x58da55);_0x485661(_0x5d429b[_0x174a('0x14')](0x1f4,_0x2ee060[_0x174a('0x16')]));});});};exports[_0x174a('0x2c')]=function(_0x1f5992){var _0x4ae867=this;return new Promise(function(_0x223c8e,_0x51c318){return db[_0x174a('0x19')][_0x174a('0x1e')]({'raw':_0x1f5992[_0x174a('0x1b')]?_0x1f5992[_0x174a('0x1b')][_0x174a('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f5992[_0x174a('0x1b')]?_0x1f5992[_0x174a('0x1b')][_0x174a('0x2d')]||null:null,'attributes':[['campaign','name'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x2e')))),_0x174a('0x2f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x174a('0x1f')]['fn']('COUNT',db[_0x174a('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x174a('0x31')))),_0x174a('0x32')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x33')))),_0x174a('0x34')],[db[_0x174a('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x35')))),_0x174a('0x36')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x37')))),_0x174a('0x38')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db['sequelize'][_0x174a('0x25')](_0x174a('0x39')))),_0x174a('0x3a')],[db['sequelize']['fn'](_0x174a('0x22'),db['sequelize']['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x3b')))),_0x174a('0x3c')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db['sequelize']['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x3d')))),_0x174a('0x3e')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db['sequelize']['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x3f')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x40')))),'outboundRejectCallsDay'],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')]['literal'](_0x174a('0x41')))),'outboundReCallsDay']],'group':['campaign']})[_0x174a('0xd')](function(_0x1f6873){logger[_0x174a('0xe')]('GetVoiceQueueHopperHistory',_0x1f5992);logger[_0x174a('0x11')](_0x174a('0x2c'),_0x1f5992,JSON[_0x174a('0x13')](_0x1f6873));_0x223c8e(_0x1f6873);})[_0x174a('0x18')](function(_0x102d1a){logger[_0x174a('0x14')](_0x174a('0x2c'),_0x102d1a['message'],_0x1f5992);_0x51c318(_0x4ae867[_0x174a('0x14')](0x1f4,_0x102d1a[_0x174a('0x16')]));});});};exports[_0x174a('0x42')]=function(_0x3291c9){var _0xd439ab=this;return new Promise(function(_0x14cd0c,_0x5d1598){return db['CmHopperHistory']['findAll']({'raw':_0x3291c9[_0x174a('0x1b')]?_0x3291c9['options'][_0x174a('0x1c')]===undefined?!![]:![]:!![],'where':_0x3291c9[_0x174a('0x1b')]?_0x3291c9[_0x174a('0x1b')][_0x174a('0x2d')]||null:null,'attributes':[['campaign',_0x174a('0x43')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')][_0x174a('0x20')]('id')),_0x174a('0x44')],[db[_0x174a('0x1f')]['fn'](_0x174a('0x22'),db[_0x174a('0x1f')]['fn']('IF',db[_0x174a('0x1f')][_0x174a('0x25')](_0x174a('0x23')))),_0x174a('0x45')]],'group':[_0x174a('0x46')]})['then'](function(_0x5f0e91){logger[_0x174a('0xe')](_0x174a('0x42'),_0x3291c9);logger['debug'](_0x174a('0x42'),_0x3291c9,JSON['stringify'](_0x5f0e91));_0x14cd0c(_0x5f0e91);})[_0x174a('0x18')](function(_0x441364){logger[_0x174a('0x14')]('GetCampaignHopperHistory',_0x441364[_0x174a('0x16')],_0x3291c9);_0x5d1598(_0xd439ab['error'](0x1f4,_0x441364[_0x174a('0x16')]));});});}; \ No newline at end of file +var _0x3451=['`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','literal','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name'];(function(_0x111cd4,_0x44241b){var _0x45206f=function(_0x533e0c){while(--_0x533e0c){_0x111cd4['push'](_0x111cd4['shift']());}};_0x45206f(++_0x44241b);}(_0x3451,0x19a));var _0x1345=function(_0x48b31e,_0x500c78){_0x48b31e=_0x48b31e-0x0;var _0x5242dc=_0x3451[_0x48b31e];return _0x5242dc;};'use strict';var _=require(_0x1345('0x0'));var util=require(_0x1345('0x1'));var moment=require('moment');var BPromise=require(_0x1345('0x2'));var rs=require(_0x1345('0x3'));var fs=require('fs');var Redis=require(_0x1345('0x4'));var db=require(_0x1345('0x5'))['db'];var utils=require(_0x1345('0x6'));var logger=require(_0x1345('0x7'))(_0x1345('0x8'));var config=require(_0x1345('0x9'));var jayson=require(_0x1345('0xa'));var client=jayson[_0x1345('0xb')][_0x1345('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34c716,_0x4b90dd,_0x3e236d){return new BPromise(function(_0x40689f,_0x516d55){return client[_0x1345('0xd')](_0x34c716,_0x3e236d)['then'](function(_0x4b9de8){logger[_0x1345('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x4b90dd,_0x1345('0xf'));logger[_0x1345('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4b90dd,'request\x20sent',JSON[_0x1345('0x11')](_0x4b9de8));if(_0x4b9de8['error']){if(_0x4b9de8[_0x1345('0x12')][_0x1345('0x13')]===0x1f4){logger[_0x1345('0x12')](_0x1345('0x14'),_0x4b90dd,_0x4b9de8['error'][_0x1345('0x15')]);return _0x516d55(_0x4b9de8[_0x1345('0x12')][_0x1345('0x15')]);}logger[_0x1345('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x4b90dd,_0x4b9de8[_0x1345('0x12')][_0x1345('0x15')]);return _0x40689f(_0x4b9de8[_0x1345('0x12')][_0x1345('0x15')]);}else{logger[_0x1345('0xe')](_0x1345('0x14'),_0x4b90dd,_0x1345('0xf'));_0x40689f(_0x4b9de8[_0x1345('0x16')][_0x1345('0x15')]);}})[_0x1345('0x17')](function(_0x318a0d){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4b90dd,_0x318a0d);_0x516d55(_0x318a0d);});});}exports[_0x1345('0x18')]=function(_0x1afc89){var _0x1862eb=this;return new Promise(function(_0x1db636,_0x55b95c){return db[_0x1345('0x19')][_0x1345('0x1a')](_0x1afc89[_0x1345('0x1b')],{'raw':_0x1afc89[_0x1345('0x1c')]?_0x1afc89[_0x1345('0x1c')][_0x1345('0x1d')]===undefined?!![]:![]:!![]})[_0x1345('0x1e')](function(_0x43d209){logger[_0x1345('0xe')](_0x1345('0x18'),_0x1afc89);logger[_0x1345('0x10')]('CreateCmHopperHistory',_0x1afc89,JSON[_0x1345('0x11')](_0x43d209));_0x1db636(_0x43d209);})[_0x1345('0x17')](function(_0xaf6ecc){logger[_0x1345('0x12')](_0x1345('0x18'),_0xaf6ecc[_0x1345('0x15')],_0x1afc89);_0x55b95c(_0x1862eb[_0x1345('0x12')](0x1f4,_0xaf6ecc[_0x1345('0x15')]));});});};exports[_0x1345('0x1f')]=function(_0x339ea9){var _0x2e7206=this;return new Promise(function(_0x26358e,_0x39a950){return db['CmHopperHistory'][_0x1345('0x20')]({'raw':_0x339ea9['options']?_0x339ea9[_0x1345('0x1c')][_0x1345('0x1d')]===undefined?!![]:![]:!![],'where':_0x339ea9[_0x1345('0x1c')]?_0x339ea9[_0x1345('0x1c')][_0x1345('0x21')]||null:null,'attributes':[[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')][_0x1345('0x24')]('id')),_0x1345('0x25')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x1345('0x26')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')]['literal'](_0x1345('0x27')))),_0x1345('0x28')],[db[_0x1345('0x22')]['fn']('COUNT',db[_0x1345('0x22')]['fn']('IF',db['sequelize']['literal'](_0x1345('0x29')))),_0x1345('0x2a')],[db[_0x1345('0x22')]['fn'](_0x1345('0x2b'),db['sequelize']['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x2d')))),_0x1345('0x2e')],[db[_0x1345('0x22')]['fn'](_0x1345('0x2b'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x2f')))),_0x1345('0x30')]]})['then'](function(_0x422ac9){logger[_0x1345('0xe')](_0x1345('0x1f'),_0x339ea9);logger[_0x1345('0x10')](_0x1345('0x1f'),_0x339ea9,JSON['stringify'](_0x422ac9));_0x26358e(_0x422ac9);})[_0x1345('0x17')](function(_0x5da4c8){logger['error'](_0x1345('0x1f'),_0x5da4c8[_0x1345('0x15')],_0x339ea9);_0x39a950(_0x2e7206[_0x1345('0x12')](0x1f4,_0x5da4c8['message']));});});};exports[_0x1345('0x31')]=function(_0x33ee2d){var _0x46a62c=this;return new Promise(function(_0x2c49b9,_0x3cf188){return db[_0x1345('0x19')][_0x1345('0x20')]({'raw':_0x33ee2d['options']?_0x33ee2d['options']['raw']===undefined?!![]:![]:!![],'where':_0x33ee2d['options']?_0x33ee2d['options'][_0x1345('0x21')]||null:null,'attributes':[[_0x1345('0x32'),_0x1345('0x33')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x1345('0x2c')](_0x1345('0x34')))),_0x1345('0x35')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db['sequelize'][_0x1345('0x2c')](_0x1345('0x36')))),_0x1345('0x37')],[db[_0x1345('0x22')]['fn']('COUNT',db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')]('`state`\x20=\x204,\x201,\x20null'))),_0x1345('0x38')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x39')))),_0x1345('0x3a')],[db[_0x1345('0x22')]['fn']('COUNT',db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x3b')))),'outboundCongestionCallsDay'],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x3c')))),_0x1345('0x3d')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x3e')))),_0x1345('0x3f')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x40')))),_0x1345('0x41')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')](_0x1345('0x42')))),_0x1345('0x43')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')]['literal'](_0x1345('0x44')))),_0x1345('0x45')],[db['sequelize']['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db[_0x1345('0x22')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1345('0x46')],[db['sequelize']['fn'](_0x1345('0x23'),db['sequelize']['fn']('IF',db[_0x1345('0x22')][_0x1345('0x2c')]('`state`\x20=\x2020,\x201,\x20null'))),_0x1345('0x47')],[db[_0x1345('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1345('0x22')]['literal'](_0x1345('0x48')))),_0x1345('0x49')]],'group':[_0x1345('0x32')]})['then'](function(_0x5d6526){logger['info'](_0x1345('0x31'),_0x33ee2d);logger[_0x1345('0x10')](_0x1345('0x31'),_0x33ee2d,JSON[_0x1345('0x11')](_0x5d6526));_0x2c49b9(_0x5d6526);})['catch'](function(_0x257009){logger['error'](_0x1345('0x31'),_0x257009[_0x1345('0x15')],_0x33ee2d);_0x3cf188(_0x46a62c[_0x1345('0x12')](0x1f4,_0x257009[_0x1345('0x15')]));});});};exports[_0x1345('0x4a')]=function(_0x17857f){var _0xbd274=this;return new Promise(function(_0x409976,_0x439682){return db[_0x1345('0x19')]['findAll']({'raw':_0x17857f[_0x1345('0x1c')]?_0x17857f[_0x1345('0x1c')][_0x1345('0x1d')]===undefined?!![]:![]:!![],'where':_0x17857f[_0x1345('0x1c')]?_0x17857f[_0x1345('0x1c')][_0x1345('0x21')]||null:null,'attributes':[[_0x1345('0x32'),_0x1345('0x33')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')][_0x1345('0x24')]('id')),_0x1345('0x4b')],[db[_0x1345('0x22')]['fn'](_0x1345('0x23'),db[_0x1345('0x22')]['fn']('IF',db['sequelize'][_0x1345('0x2c')](_0x1345('0x4c')))),'ivrAnswerCallsDay']],'group':[_0x1345('0x32')]})[_0x1345('0x1e')](function(_0x162b19){logger['info'](_0x1345('0x4a'),_0x17857f);logger[_0x1345('0x10')](_0x1345('0x4a'),_0x17857f,JSON[_0x1345('0x11')](_0x162b19));_0x409976(_0x162b19);})[_0x1345('0x17')](function(_0x102ba0){logger[_0x1345('0x12')](_0x1345('0x4a'),_0x102ba0[_0x1345('0x15')],_0x17857f);_0x439682(_0xbd274[_0x1345('0x12')](0x1f4,_0x102ba0[_0x1345('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b9f19a6..67c6c37 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 _0x2cb5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','exports','util','path','connect-timeout','express','Router'];(function(_0x2c2b29,_0x44451d){var _0x58f94c=function(_0x316cb6){while(--_0x316cb6){_0x2c2b29['push'](_0x2c2b29['shift']());}};_0x58f94c(++_0x44451d);}(_0x2cb5,0x127));var _0x52cb=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0x2cb5[_0xf89c3];return _0x274fc8;};'use strict';var multer=require('multer');var util=require(_0x52cb('0x0'));var path=require(_0x52cb('0x1'));var timeout=require(_0x52cb('0x2'));var express=require(_0x52cb('0x3'));var router=express[_0x52cb('0x4')]();var fs_extra=require(_0x52cb('0x5'));var auth=require(_0x52cb('0x6'));var interaction=require(_0x52cb('0x7'));var config=require(_0x52cb('0x8'));var controller=require(_0x52cb('0x9'));router[_0x52cb('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x52cb('0xb'),auth[_0x52cb('0xc')](),controller[_0x52cb('0xd')]);router[_0x52cb('0xa')](_0x52cb('0xe'),auth[_0x52cb('0xc')](),controller[_0x52cb('0xf')]);router[_0x52cb('0x10')]('/',auth['isAuthenticated'](),controller[_0x52cb('0x11')]);router[_0x52cb('0x12')](_0x52cb('0xe'),auth['isAuthenticated'](),controller['update']);module[_0x52cb('0x13')]=router; \ No newline at end of file +var _0x0b65=['post','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x10842a,_0x3a6467){var _0x33a53f=function(_0x4d0042){while(--_0x4d0042){_0x10842a['push'](_0x10842a['shift']());}};_0x33a53f(++_0x3a6467);}(_0x0b65,0x111));var _0x50b6=function(_0x56356f,_0x47ae10){_0x56356f=_0x56356f-0x0;var _0x765dc9=_0x0b65[_0x56356f];return _0x765dc9;};'use strict';var multer=require(_0x50b6('0x0'));var util=require(_0x50b6('0x1'));var path=require(_0x50b6('0x2'));var timeout=require(_0x50b6('0x3'));var express=require(_0x50b6('0x4'));var router=express[_0x50b6('0x5')]();var fs_extra=require(_0x50b6('0x6'));var auth=require(_0x50b6('0x7'));var interaction=require(_0x50b6('0x8'));var config=require('../../config/environment');var controller=require(_0x50b6('0x9'));router['get']('/',auth[_0x50b6('0xa')](),controller[_0x50b6('0xb')]);router[_0x50b6('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x50b6('0xd')]);router[_0x50b6('0xc')](_0x50b6('0xe'),auth[_0x50b6('0xa')](),controller[_0x50b6('0xf')]);router[_0x50b6('0x10')]('/',auth[_0x50b6('0xa')](),controller['create']);router['put'](_0x50b6('0xe'),auth['isAuthenticated'](),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 21b0d1e..c4fbcc0 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 _0xe015=['sequelize','exports','STRING'];(function(_0x47ac0f,_0x186469){var _0x27117b=function(_0x21f950){while(--_0x21f950){_0x47ac0f['push'](_0x47ac0f['shift']());}};_0x27117b(++_0x186469);}(_0xe015,0x13b));var _0x5e01=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe015[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5e01('0x0'));module[_0x5e01('0x1')]={'name':{'type':Sequelize[_0x5e01('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x5e01('0x2')]}}; \ No newline at end of file +var _0x2159=['exports','STRING','name','sequelize'];(function(_0x47a385,_0x5d8781){var _0x31abb9=function(_0x210f7a){while(--_0x210f7a){_0x47a385['push'](_0x47a385['shift']());}};_0x31abb9(++_0x5d8781);}(_0x2159,0x17f));var _0x9215=function(_0x43e1ec,_0x4f72ae){_0x43e1ec=_0x43e1ec-0x0;var _0x150568=_0x2159[_0x43e1ec];return _0x150568;};'use strict';var Sequelize=require(_0x9215('0x0'));module[_0x9215('0x1')]={'name':{'type':Sequelize[_0x9215('0x2')],'unique':_0x9215('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x9215('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 24ab74d..1b11975 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 _0x9907=['User','eml-format','rimraf','zip-dir','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/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','show','params','length','includeAll','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','findOne','Disposition','rows','ids','addContacts','CmContact','tags','join','each','omit','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','getAgents'];(function(_0x40e52d,_0x4f3882){var _0x12476e=function(_0x350d97){while(--_0x350d97){_0x40e52d['push'](_0x40e52d['shift']());}};_0x12476e(++_0x4f3882);}(_0x9907,0x11f));var _0x7990=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x9907[_0x5ff517];return _0x19a245;};'use strict';var emlformat=require(_0x7990('0x0'));var rimraf=require(_0x7990('0x1'));var zipdir=require(_0x7990('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7990('0x3'));var Mustache=require(_0x7990('0x4'));var util=require(_0x7990('0x5'));var path=require(_0x7990('0x6'));var sox=require(_0x7990('0x7'));var csv=require(_0x7990('0x8'));var ejs=require(_0x7990('0x9'));var fs=require('fs');var fs_extra=require(_0x7990('0xa'));var _=require(_0x7990('0xb'));var squel=require(_0x7990('0xc'));var crypto=require(_0x7990('0xd'));var jsforce=require(_0x7990('0xe'));var deskjs=require(_0x7990('0xf'));var toCsv=require(_0x7990('0x8'));var querystring=require(_0x7990('0x10'));var Papa=require(_0x7990('0x11'));var Redis=require('ioredis');var authService=require(_0x7990('0x12'));var qs=require(_0x7990('0x13'));var as=require(_0x7990('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7990('0x15'))('api');var utils=require(_0x7990('0x16'));var config=require(_0x7990('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7990('0x18'))['db'];config[_0x7990('0x19')]=_[_0x7990('0x1a')](config[_0x7990('0x19')],{'host':_0x7990('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7990('0x19')]));require(_0x7990('0x1c'))['register'](socket);function respondWithStatusCode(_0x208f6f,_0x34d53f){_0x34d53f=_0x34d53f||0xcc;return function(_0x4e6250){if(_0x4e6250){return _0x208f6f['sendStatus'](_0x34d53f);}return _0x208f6f[_0x7990('0x1d')](_0x34d53f)['end']();};}function respondWithResult(_0x25aeec,_0x26d963){_0x26d963=_0x26d963||0xc8;return function(_0x26849e){if(_0x26849e){return _0x25aeec[_0x7990('0x1d')](_0x26d963)[_0x7990('0x1e')](_0x26849e);}};}function respondWithFilteredResult(_0x5e125a,_0x29ed6e){return function(_0x4c67a4){if(_0x4c67a4){var _0x28549c=typeof _0x29ed6e[_0x7990('0x1f')]===_0x7990('0x20')&&typeof _0x29ed6e[_0x7990('0x21')]===_0x7990('0x20');var _0x47f8d4=_0x4c67a4[_0x7990('0x22')];var _0x4305cd=_0x28549c?0x0:_0x29ed6e['offset'];var _0x26a420=_0x28549c?_0x4c67a4['count']:_0x29ed6e[_0x7990('0x1f')]+_0x29ed6e[_0x7990('0x21')];var _0x1d5ad5;if(_0x26a420>=_0x47f8d4){_0x26a420=_0x47f8d4;_0x1d5ad5=0xc8;}else{_0x1d5ad5=0xce;}_0x5e125a['status'](_0x1d5ad5);return _0x5e125a[_0x7990('0x23')](_0x7990('0x24'),_0x4305cd+'-'+_0x26a420+'/'+_0x47f8d4)['json'](_0x4c67a4);}return null;};}function patchUpdates(_0x302e28){return function(_0x3659eb){try{jsonpatch['apply'](_0x3659eb,_0x302e28,!![]);}catch(_0x54403e){return BPromise[_0x7990('0x25')](_0x54403e);}return _0x3659eb['save']();};}function saveUpdates(_0xdf0d47,_0x53ceec){return function(_0xffbe11){if(_0xffbe11){return _0xffbe11[_0x7990('0x26')](_0xdf0d47)[_0x7990('0x27')](function(_0x783685){return _0x783685;});}return null;};}function removeEntity(_0x1fe690,_0x5e76c5){return function(_0x32ea3f){if(_0x32ea3f){return _0x32ea3f[_0x7990('0x28')]()[_0x7990('0x27')](function(){var _0x30bd0b=_0x32ea3f[_0x7990('0x29')]({'plain':!![]});var _0x3289a8=_0x7990('0x2a');return db[_0x7990('0x2b')][_0x7990('0x28')]({'where':{'type':_0x3289a8,'resourceId':_0x30bd0b['id']}})[_0x7990('0x27')](function(){return _0x32ea3f;});})[_0x7990('0x27')](function(){_0x1fe690['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x252ad4,_0x30e459){return function(_0x40a1e0){if(!_0x40a1e0){_0x252ad4[_0x7990('0x2c')](0x194);}return _0x40a1e0;};}function handleError(_0x3e0194,_0x19304d){_0x19304d=_0x19304d||0x1f4;return function(_0x3b9d24){logger[_0x7990('0x2d')](_0x3b9d24[_0x7990('0x2e')]);if(_0x3b9d24[_0x7990('0x2f')]){delete _0x3b9d24[_0x7990('0x2f')];}_0x3e0194[_0x7990('0x1d')](_0x19304d)[_0x7990('0x30')](_0x3b9d24);};}exports[_0x7990('0x31')]=function(_0x53a1f7,_0x21f32c){var _0x1dbc89={},_0x1093ff={},_0x82d008={'count':0x0,'rows':[]};var _0x300bbe=_[_0x7990('0x32')](db[_0x7990('0x33')][_0x7990('0x34')],function(_0x482a26){return{'name':_0x482a26['fieldName'],'type':_0x482a26['type'][_0x7990('0x35')]};});_0x1093ff[_0x7990('0x36')]=_[_0x7990('0x32')](_0x300bbe,_0x7990('0x2f'));_0x1093ff[_0x7990('0x37')]=_[_0x7990('0x38')](_0x53a1f7['query']);_0x1093ff[_0x7990('0x39')]=_[_0x7990('0x3a')](_0x1093ff[_0x7990('0x36')],_0x1093ff[_0x7990('0x37')]);_0x1dbc89[_0x7990('0x3b')]=_[_0x7990('0x3a')](_0x1093ff[_0x7990('0x36')],qs[_0x7990('0x3c')](_0x53a1f7[_0x7990('0x37')]['fields']));_0x1dbc89[_0x7990('0x3b')]=_0x1dbc89['attributes']['length']?_0x1dbc89[_0x7990('0x3b')]:_0x1093ff['model'];if(!_0x53a1f7[_0x7990('0x37')][_0x7990('0x3d')](_0x7990('0x3e'))){_0x1dbc89['limit']=qs[_0x7990('0x21')](_0x53a1f7[_0x7990('0x37')][_0x7990('0x21')]);_0x1dbc89[_0x7990('0x1f')]=qs[_0x7990('0x1f')](_0x53a1f7[_0x7990('0x37')][_0x7990('0x1f')]);}_0x1dbc89[_0x7990('0x3f')]=qs[_0x7990('0x40')](_0x53a1f7[_0x7990('0x37')][_0x7990('0x40')]);_0x1dbc89[_0x7990('0x41')]=qs['filters'](_[_0x7990('0x42')](_0x53a1f7[_0x7990('0x37')],_0x1093ff[_0x7990('0x39')]),_0x300bbe);if(_0x53a1f7[_0x7990('0x37')][_0x7990('0x43')]){_0x1dbc89[_0x7990('0x41')]=_[_0x7990('0x44')](_0x1dbc89['where'],{'$or':_['map'](_0x300bbe,function(_0x1fba67){if(_0x1fba67[_0x7990('0x45')]!==_0x7990('0x46')){var _0x17024b={};_0x17024b[_0x1fba67[_0x7990('0x2f')]]={'$like':'%'+_0x53a1f7[_0x7990('0x37')][_0x7990('0x43')]+'%'};return _0x17024b;}})});}_0x1dbc89=_[_0x7990('0x44')]({},_0x1dbc89,_0x53a1f7[_0x7990('0x47')]);var _0x47a917={'where':_0x1dbc89['where']};return db[_0x7990('0x33')]['count'](_0x47a917)[_0x7990('0x27')](function(_0xca1b8a){_0x82d008['count']=_0xca1b8a;if(_0x53a1f7[_0x7990('0x37')]['includeAll']){_0x1dbc89['include']=[{'all':!![]}];}return db['CmList'][_0x7990('0x48')](_0x1dbc89);})[_0x7990('0x27')](function(_0xd8e1d6){_0x82d008['rows']=_0xd8e1d6;return _0x82d008;})[_0x7990('0x27')](respondWithFilteredResult(_0x21f32c,_0x1dbc89))['catch'](handleError(_0x21f32c,null));};exports[_0x7990('0x49')]=function(_0x591111,_0x5a35c7){var _0x35aa48={'raw':![],'where':{'id':_0x591111[_0x7990('0x4a')]['id']}},_0x17e418={};_0x17e418[_0x7990('0x36')]=_[_0x7990('0x38')](db['CmList'][_0x7990('0x34')]);_0x17e418[_0x7990('0x37')]=_[_0x7990('0x38')](_0x591111[_0x7990('0x37')]);_0x17e418['filters']=_[_0x7990('0x3a')](_0x17e418[_0x7990('0x36')],_0x17e418[_0x7990('0x37')]);_0x35aa48[_0x7990('0x3b')]=_['intersection'](_0x17e418[_0x7990('0x36')],qs[_0x7990('0x3c')](_0x591111['query'][_0x7990('0x3c')]));_0x35aa48[_0x7990('0x3b')]=_0x35aa48['attributes'][_0x7990('0x4b')]?_0x35aa48[_0x7990('0x3b')]:_0x17e418[_0x7990('0x36')];if(_0x591111[_0x7990('0x37')][_0x7990('0x4c')]){_0x35aa48[_0x7990('0x4d')]=[{'all':!![]}];}_0x35aa48=_[_0x7990('0x44')]({},_0x35aa48,_0x591111['options']);return db['CmList'][_0x7990('0x4e')](_0x35aa48)[_0x7990('0x27')](handleEntityNotFound(_0x5a35c7,null))[_0x7990('0x27')](respondWithResult(_0x5a35c7,null))[_0x7990('0x4f')](handleError(_0x5a35c7,null));};exports[_0x7990('0x50')]=function(_0x230b30,_0x288181){return db[_0x7990('0x33')][_0x7990('0x50')](_0x230b30[_0x7990('0x51')],{})['then'](function(_0x151232){var _0x3daf5a=_0x230b30[_0x7990('0x52')]['get']({'plain':!![]});if(!_0x3daf5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3daf5a[_0x7990('0x53')]==='user'){var _0x5bfadc=_0x151232[_0x7990('0x29')]({'plain':!![]});var _0x59a1cc=_0x7990('0x2a');return db[_0x7990('0x54')][_0x7990('0x4e')]({'where':{'name':_0x59a1cc,'userProfileId':_0x3daf5a[_0x7990('0x55')]},'raw':!![]})['then'](function(_0x5383ae){if(_0x5383ae&&_0x5383ae[_0x7990('0x56')]===0x0){return db[_0x7990('0x2b')][_0x7990('0x50')]({'name':_0x5bfadc[_0x7990('0x2f')],'resourceId':_0x5bfadc['id'],'type':_0x5383ae[_0x7990('0x2f')],'sectionId':_0x5383ae['id']},{})[_0x7990('0x27')](function(){return _0x151232;});}else{return _0x151232;}})['catch'](function(_0x87073a){logger['error'](_0x7990('0x57'),_0x87073a);throw _0x87073a;});}return _0x151232;})[_0x7990('0x27')](respondWithResult(_0x288181,0xc9))[_0x7990('0x4f')](handleError(_0x288181,null));};exports[_0x7990('0x26')]=function(_0x593bd2,_0x111464){if(_0x593bd2['body']['id']){delete _0x593bd2['body']['id'];}return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0x593bd2[_0x7990('0x4a')]['id']}})[_0x7990('0x27')](handleEntityNotFound(_0x111464,null))['then'](saveUpdates(_0x593bd2[_0x7990('0x51')],null))[_0x7990('0x27')](respondWithResult(_0x111464,null))['catch'](handleError(_0x111464,null));};exports['destroy']=function(_0x1d4b08,_0x16e79f){return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0x1d4b08['params']['id']}})['then'](handleEntityNotFound(_0x16e79f,null))[_0x7990('0x27')](removeEntity(_0x16e79f,null))[_0x7990('0x4f')](handleError(_0x16e79f,null));};exports[_0x7990('0x58')]=function(_0xc9489d,_0x21b2bb){return db[_0x7990('0x33')][_0x7990('0x58')]()[_0x7990('0x27')](respondWithResult(_0x21b2bb,null))[_0x7990('0x4f')](handleError(_0x21b2bb,null));};exports[_0x7990('0x59')]=function(_0x10413f,_0xd348a,_0x4a08f0){if(_0x10413f[_0x7990('0x51')]['id']){delete _0x10413f[_0x7990('0x51')]['id'];}return db['CmList'][_0x7990('0x4e')]({'where':{'id':_0x10413f[_0x7990('0x4a')]['id']}})[_0x7990('0x27')](handleEntityNotFound(_0xd348a,null))[_0x7990('0x27')](function(_0x5c51a8){if(_0x5c51a8){_0x10413f[_0x7990('0x51')][_0x7990('0x5a')]=_0x5c51a8['id'];return db['Disposition'][_0x7990('0x50')](_0x10413f['body']);}})[_0x7990('0x27')](respondWithResult(_0xd348a,null))[_0x7990('0x4f')](handleError(_0xd348a,null));};exports['getDispositions']=function(_0x3ea79a,_0x13838c,_0xb69f0a){var _0x282c01={'raw':![],'where':{}};var _0x3f7cf3={};var _0x2a7ecf={'count':0x0,'rows':[]};return db['CmList'][_0x7990('0x5b')]({'where':{'id':_0x3ea79a[_0x7990('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13838c,null))[_0x7990('0x27')](function(_0x2eff17){if(_0x2eff17){_0x3f7cf3[_0x7990('0x36')]=_[_0x7990('0x38')](db[_0x7990('0x5c')]['rawAttributes']);_0x3f7cf3[_0x7990('0x37')]=_[_0x7990('0x38')](_0x3ea79a[_0x7990('0x37')]);_0x3f7cf3['filters']=_[_0x7990('0x3a')](_0x3f7cf3['model'],_0x3f7cf3['query']);_0x282c01[_0x7990('0x3b')]=_[_0x7990('0x3a')](_0x3f7cf3[_0x7990('0x36')],qs['fields'](_0x3ea79a['query'][_0x7990('0x3c')]));_0x282c01[_0x7990('0x3b')]=_0x282c01[_0x7990('0x3b')][_0x7990('0x4b')]?_0x282c01[_0x7990('0x3b')]:_0x3f7cf3[_0x7990('0x36')];if(!_0x3ea79a[_0x7990('0x37')][_0x7990('0x3d')](_0x7990('0x3e'))){_0x282c01[_0x7990('0x21')]=qs[_0x7990('0x21')](_0x3ea79a['query'][_0x7990('0x21')]);_0x282c01[_0x7990('0x1f')]=qs[_0x7990('0x1f')](_0x3ea79a[_0x7990('0x37')][_0x7990('0x1f')]);}_0x282c01[_0x7990('0x3f')]=qs['sort'](_0x3ea79a[_0x7990('0x37')][_0x7990('0x40')]);_0x282c01['where']=qs[_0x7990('0x39')](_[_0x7990('0x42')](_0x3ea79a[_0x7990('0x37')],_0x3f7cf3[_0x7990('0x39')]));_0x282c01[_0x7990('0x41')][_0x7990('0x5a')]=_0x2eff17['id'];if(_0x3ea79a[_0x7990('0x37')][_0x7990('0x43')]){_0x282c01[_0x7990('0x41')]=_[_0x7990('0x44')](_0x282c01[_0x7990('0x41')],{'$or':_[_0x7990('0x32')](_0x282c01[_0x7990('0x3b')],function(_0x36b361){var _0x1433da={};_0x1433da[_0x36b361]={'$like':'%'+_0x3ea79a['query']['filter']+'%'};return _0x1433da;})});}_0x282c01=_['merge']({},_0x282c01,_0x3ea79a[_0x7990('0x47')]);return db['Disposition']['count']({'where':_0x282c01[_0x7990('0x41')]})[_0x7990('0x27')](function(_0x3bcf71){_0x2a7ecf[_0x7990('0x22')]=_0x3bcf71;if(_0x3ea79a[_0x7990('0x37')][_0x7990('0x4c')]){_0x282c01[_0x7990('0x4d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x282c01);})[_0x7990('0x27')](function(_0x21c6dd){_0x2a7ecf[_0x7990('0x5d')]=_0x21c6dd;return _0x2a7ecf;});}})[_0x7990('0x27')](respondWithFilteredResult(_0x13838c,_0x282c01))['catch'](handleError(_0x13838c,null));};exports['removeDispositions']=function(_0x71b871,_0x375c98,_0x53a1a3){return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0x71b871[_0x7990('0x4a')]['id']}})[_0x7990('0x27')](handleEntityNotFound(_0x375c98,null))[_0x7990('0x27')](function(_0x340d89){if(_0x340d89){return _0x340d89['removeDispositions'](_0x71b871['query'][_0x7990('0x5e')]);}})[_0x7990('0x27')](respondWithStatusCode(_0x375c98,null))['catch'](handleError(_0x375c98,null));};exports[_0x7990('0x5f')]=function(_0x25155d,_0x4fdafb,_0x35cbcb){return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0x25155d[_0x7990('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fdafb,null))[_0x7990('0x27')](function(_0x19c6c4){if(_0x19c6c4){var _0x4e7f41=[];var _0x1f02d5={'success':[],'errors':[]};return db[_0x7990('0x60')][_0x7990('0x58')]()[_0x7990('0x27')](function(_0x4fad4e){if(_0x25155d['body']['tags']&&_['isArray'](_0x25155d[_0x7990('0x51')][_0x7990('0x61')])){if(_0x25155d[_0x7990('0x51')]['tags'][_0x7990('0x4b')]){_0x25155d['body'][_0x7990('0x61')]=_0x25155d[_0x7990('0x51')][_0x7990('0x61')][_0x7990('0x62')](';')+';';}else{_0x25155d[_0x7990('0x51')]['tags']=null;}}else{_0x25155d[_0x7990('0x51')][_0x7990('0x61')]=null;}if(_0x25155d[_0x7990('0x51')]&&_['isArray'](_0x25155d['body'])){for(var _0x59c0dc=0x0;_0x59c0dc<_0x25155d[_0x7990('0x51')]['length'];_0x59c0dc+=0x1){_0x25155d[_0x7990('0x51')][_0x59c0dc][_0x7990('0x5a')]=_0x25155d[_0x7990('0x4a')]['id'];_0x4e7f41['push'](_0x25155d['body'][_0x59c0dc]);}return BPromise[_0x7990('0x63')](_0x4e7f41,function(_0x4f1ca0){return db[_0x7990('0x60')][_0x7990('0x50')](_[_0x7990('0x64')](_0x4f1ca0,['ids','id'])||{},{'fields':_[_0x7990('0x38')](_0x4fad4e),'raw':!![]})['then'](function(_0x5da2f0){_0x1f02d5[_0x7990('0x65')][_0x7990('0x66')](_0x5da2f0[_0x7990('0x67')]);})['catch'](function(_0x47db05){_0x1f02d5[_0x7990('0x68')]['push']({'data':_0x4f1ca0,'error':_0x47db05['message']});});})[_0x7990('0x27')](function(_0x3ffec0){return _0x1f02d5;})[_0x7990('0x4f')](function(_0x26a370){return _0x26a370;});}else{_0x4fdafb[_0x7990('0x1d')](0x190)[_0x7990('0x1e')]({'message':_0x7990('0x69')});}});}})[_0x7990('0x27')](respondWithResult(_0x4fdafb,null))[_0x7990('0x4f')](handleError(_0x4fdafb,null));};exports[_0x7990('0x6a')]=function(_0x3a4187,_0x5694af,_0x13f1b8){var _0x42b931;return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0x3a4187[_0x7990('0x4a')]['id']},'include':[{'model':db[_0x7990('0x6b')],'as':_0x7990('0x6c')}]})[_0x7990('0x27')](handleEntityNotFound(_0x5694af,null))['then'](function(_0x457b40){if(_0x457b40){_0x42b931=_0x457b40;return db['CmContact'][_0x7990('0x34')];}})['then'](function(_0x3e081d){if(_0x3e081d){var _0x2a4d2f={};var _0x1ce630={};_0x1ce630[_0x7990('0x36')]=_[_0x7990('0x6d')](_[_0x7990('0x38')](_0x3e081d),_['map'](_0x42b931[_0x7990('0x6c')],function(_0x29ae0f){return util['format'](_0x7990('0x6e'),_0x29ae0f['id']);}));_0x1ce630[_0x7990('0x37')]=_[_0x7990('0x38')](_0x3a4187[_0x7990('0x37')]);_0x1ce630[_0x7990('0x39')]=_[_0x7990('0x3a')](_0x1ce630[_0x7990('0x36')],_0x1ce630[_0x7990('0x37')]);_0x2a4d2f[_0x7990('0x3b')]=_['intersection'](_0x1ce630[_0x7990('0x36')],qs['fields'](_0x3a4187['query']['fields']));_0x2a4d2f[_0x7990('0x3b')]=_0x2a4d2f[_0x7990('0x3b')][_0x7990('0x4b')]?_0x2a4d2f['attributes']:_0x1ce630['model'];if(!_0x3a4187[_0x7990('0x37')]['hasOwnProperty'](_0x7990('0x3e'))){_0x2a4d2f[_0x7990('0x21')]=qs[_0x7990('0x21')](_0x3a4187['query']['limit']);_0x2a4d2f[_0x7990('0x1f')]=qs[_0x7990('0x1f')](_0x3a4187['query'][_0x7990('0x1f')]);}_0x2a4d2f['order']=qs[_0x7990('0x40')](_0x3a4187[_0x7990('0x37')]['sort']);_0x2a4d2f[_0x7990('0x41')]=qs['filters'](_[_0x7990('0x42')](_0x3a4187[_0x7990('0x37')],_0x1ce630['filters']));_0x2a4d2f[_0x7990('0x6f')]=!![];if(_0x3a4187[_0x7990('0x37')]['filter']){_0x2a4d2f[_0x7990('0x41')]=_['merge'](_0x2a4d2f[_0x7990('0x41')],{'$or':_[_0x7990('0x32')](_0x2a4d2f['attributes'],function(_0x386bca){var _0x3ae942={};_0x3ae942[_0x386bca]={'$like':'%'+_0x3a4187['query'][_0x7990('0x43')]+'%'};return _0x3ae942;})});}_0x2a4d2f=_[_0x7990('0x44')]({},_0x2a4d2f,_0x3a4187[_0x7990('0x47')]);return _0x42b931['getContacts'](_0x2a4d2f);}})[_0x7990('0x27')](respondWithResult(_0x5694af,null))[_0x7990('0x4f')](handleError(_0x5694af,null));};exports[_0x7990('0x70')]=function(_0x4f6dc8,_0x79680f,_0x2a5ff5){var _0x2cae2c;return db[_0x7990('0x33')]['find']({'where':{'id':_0x4f6dc8['params']['id']},'include':[{'model':db[_0x7990('0x6b')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x79680f,null))[_0x7990('0x27')](function(_0x50f024){if(_0x50f024){_0x2cae2c=_0x50f024;return db[_0x7990('0x60')]['rawAttributes'];}})[_0x7990('0x27')](function(_0x36bc0c){if(_0x36bc0c){var _0x3a920a={};var _0x482610={};_0x482610['model']=_[_0x7990('0x6d')](_[_0x7990('0x38')](_0x36bc0c),_['map'](_0x2cae2c[_0x7990('0x6c')],function(_0x8b403a){return util[_0x7990('0x71')](_0x7990('0x6e'),_0x8b403a['id']);}));_0x482610[_0x7990('0x37')]=_[_0x7990('0x38')](_0x4f6dc8['query']);_0x482610[_0x7990('0x39')]=_[_0x7990('0x3a')](_0x482610[_0x7990('0x36')],_0x482610[_0x7990('0x37')]);_0x3a920a[_0x7990('0x3b')]=_[_0x7990('0x3a')](_0x482610[_0x7990('0x36')],qs[_0x7990('0x3c')](_0x4f6dc8[_0x7990('0x37')][_0x7990('0x3c')]));_0x3a920a[_0x7990('0x3b')]=_0x3a920a[_0x7990('0x3b')][_0x7990('0x4b')]?_0x3a920a[_0x7990('0x3b')]:_0x482610['model'];if(!_0x4f6dc8[_0x7990('0x37')]['hasOwnProperty'](_0x7990('0x3e'))){_0x3a920a[_0x7990('0x21')]=qs[_0x7990('0x21')](_0x4f6dc8[_0x7990('0x37')][_0x7990('0x21')]);_0x3a920a[_0x7990('0x1f')]=qs[_0x7990('0x1f')](_0x4f6dc8[_0x7990('0x37')][_0x7990('0x1f')]);}_0x3a920a[_0x7990('0x3f')]=qs[_0x7990('0x40')](_0x4f6dc8['query'][_0x7990('0x40')]);_0x3a920a[_0x7990('0x41')]=qs['filters'](_[_0x7990('0x42')](_0x4f6dc8[_0x7990('0x37')],_0x482610['filters']));_0x3a920a['raw']=!![];if(_0x4f6dc8[_0x7990('0x37')][_0x7990('0x43')]){_0x3a920a[_0x7990('0x41')]=_['merge'](_0x3a920a['where'],{'$or':_[_0x7990('0x32')](_0x3a920a['attributes'],function(_0x50eab7){var _0x3fda3e={};_0x3fda3e[_0x50eab7]={'$like':'%'+_0x4f6dc8[_0x7990('0x37')][_0x7990('0x43')]+'%'};return _0x3fda3e;})});}_0x3a920a=_[_0x7990('0x44')]({},_0x3a920a,_0x4f6dc8['options']);return _0x2cae2c[_0x7990('0x6a')](_0x3a920a);}})[_0x7990('0x27')](function(_0x1af593){if(!_[_0x7990('0x72')](_0x1af593)){var _0x1152d2=toCsv(_0x1af593);var _0x40e585=Date['now']();fs[_0x7990('0x73')](util[_0x7990('0x71')](_0x7990('0x74'),_0x2cae2c['id'],_0x40e585),_0x1152d2);_0x79680f[_0x7990('0x75')](_0x7990('0x76'),_0x7990('0x77')+util['format']('list_%d_%s.csv',_0x2cae2c['id'],_0x40e585));_0x79680f[_0x7990('0x75')]('Content-type',_0x7990('0x78'));return _0x79680f[_0x7990('0x79')](util['format'](_0x7990('0x74'),_0x2cae2c['id'],_0x40e585));}else{return _0x79680f[_0x7990('0x2c')](0xcc);}})[_0x7990('0x4f')](handleError(_0x79680f,null));};exports[_0x7990('0x7a')]=function(_0x3762fd,_0x234abb,_0x5c97a1){var _0x9fc8ab;delete _0x3762fd[_0x7990('0x51')]['id'];return db['CmList'][_0x7990('0x5b')]({'where':{'id':_0x3762fd[_0x7990('0x4a')]['id']}})['then'](handleEntityNotFound(_0x234abb,null))[_0x7990('0x27')](function(_0x2fd41b){if(_0x2fd41b){return db[_0x7990('0x7b')][_0x7990('0x7c')](function(_0x5b2a04){return db[_0x7990('0x6b')]['create'](_0x3762fd[_0x7990('0x51')],{'transaction':_0x5b2a04})[_0x7990('0x27')](function(_0x5e9502){_0x9fc8ab=_0x5e9502;return _0x2fd41b['addCustomFields'](_0x5e9502,{'transaction':_0x5b2a04});})[_0x7990('0x27')](function(){var _0x4a908f={'type':db[_0x7990('0x7d')][_0x7990('0x7e')],'transaction':_0x5b2a04};switch(_0x3762fd[_0x7990('0x51')]['type']){case _0x7990('0x7f'):_0x4a908f['type']=db[_0x7990('0x7d')][_0x7990('0x7e')];break;case _0x7990('0x80'):_0x4a908f[_0x7990('0x45')]=db[_0x7990('0x7d')][_0x7990('0x81')];break;case _0x7990('0x82'):_0x4a908f[_0x7990('0x45')]=db[_0x7990('0x7d')][_0x7990('0x83')];_0x4a908f[_0x7990('0x84')]=![];break;default:}return db[_0x7990('0x7b')][_0x7990('0x85')][_0x7990('0x86')]('cm_contacts',util[_0x7990('0x71')](_0x7990('0x87'),_0x9fc8ab['id']),_0x4a908f);})[_0x7990('0x27')](function(){return _0x9fc8ab;});});}})[_0x7990('0x27')](respondWithResult(_0x234abb,null))[_0x7990('0x4f')](handleError(_0x234abb,null));};exports['getCustomFields']=function(_0x3cb2fd,_0x554a33,_0xf9a92b){var _0x3af5cb={};var _0x195a94={};var _0x411798;var _0x125d20;return db[_0x7990('0x33')][_0x7990('0x5b')]({'where':{'id':_0x3cb2fd[_0x7990('0x4a')]['id']}})[_0x7990('0x27')](handleEntityNotFound(_0x554a33,null))[_0x7990('0x27')](function(_0x445791){if(_0x445791){_0x411798=_0x445791;_0x195a94[_0x7990('0x36')]=_[_0x7990('0x38')](db[_0x7990('0x6b')][_0x7990('0x34')]);_0x195a94[_0x7990('0x37')]=_[_0x7990('0x38')](_0x3cb2fd[_0x7990('0x37')]);_0x195a94[_0x7990('0x39')]=_[_0x7990('0x3a')](_0x195a94['model'],_0x195a94[_0x7990('0x37')]);_0x3af5cb[_0x7990('0x3b')]=_[_0x7990('0x3a')](_0x195a94[_0x7990('0x36')],qs['fields'](_0x3cb2fd[_0x7990('0x37')][_0x7990('0x3c')]));_0x3af5cb[_0x7990('0x3b')]=_0x3af5cb['attributes']['length']?_0x3af5cb[_0x7990('0x3b')]:_0x195a94[_0x7990('0x36')];_0x3af5cb[_0x7990('0x3f')]=qs[_0x7990('0x40')](_0x3cb2fd[_0x7990('0x37')]['sort']);_0x3af5cb[_0x7990('0x41')]=qs[_0x7990('0x39')](_[_0x7990('0x42')](_0x3cb2fd[_0x7990('0x37')],_0x195a94[_0x7990('0x39')]));_0x3af5cb[_0x7990('0x41')]=_[_0x7990('0x44')](_0x3af5cb['where'],{'$or':[{'ListId':_0x445791['id']},{'ListId':null}]});if(_0x3cb2fd[_0x7990('0x37')][_0x7990('0x43')]){_0x3af5cb[_0x7990('0x41')]=_['merge'](_0x3af5cb[_0x7990('0x41')],{'$or':_['map'](_0x3af5cb[_0x7990('0x3b')],function(_0x48889a){var _0x5a4885={};_0x5a4885[_0x48889a]={'$like':'%'+_0x3cb2fd[_0x7990('0x37')]['filter']+'%'};return _0x5a4885;})});}_0x3af5cb=_[_0x7990('0x44')]({},_0x3af5cb,_0x3cb2fd[_0x7990('0x47')]);return db[_0x7990('0x6b')][_0x7990('0x88')](_0x3af5cb);}})[_0x7990('0x27')](respondWithResult(_0x554a33,null))[_0x7990('0x4f')](handleError(_0x554a33,null));};exports[_0x7990('0x89')]=function(_0xc4654e,_0x59b17c,_0x2805f6){return db[_0x7990('0x33')][_0x7990('0x4e')]({'where':{'id':_0xc4654e[_0x7990('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59b17c,null))[_0x7990('0x27')](function(_0x400a21){if(_0x400a21){return _0x400a21[_0x7990('0x89')](_0xc4654e['body'][_0x7990('0x5e')],_[_0x7990('0x64')](_0xc4654e[_0x7990('0x51')],[_0x7990('0x5e'),'id'])||{})['spread'](function(_0x488311){for(var _0x3aa51e=0x0;_0x3aa51e<_0xc4654e[_0x7990('0x51')]['ids'][_0x7990('0x4b')];_0x3aa51e+=0x1){socket[_0x7990('0x8a')](_0x7990('0x8b'),{'UserId':Number(_0xc4654e[_0x7990('0x51')]['ids'][_0x3aa51e]),'CmListId':Number(_0xc4654e['params']['id'])});}return _0x488311;});}})['then'](respondWithResult(_0x59b17c,null))[_0x7990('0x4f')](handleError(_0x59b17c,null));};exports[_0x7990('0x8c')]=function(_0x337256,_0x72e5ff,_0x11badd){return db[_0x7990('0x33')]['find']({'where':{'id':_0x337256['params']['id']}})[_0x7990('0x27')](handleEntityNotFound(_0x72e5ff,null))[_0x7990('0x27')](function(_0x4e98d0){if(_0x4e98d0){return _0x4e98d0[_0x7990('0x8c')](_0x337256['query']['ids'])[_0x7990('0x27')](function(){if(_['isArray'](_0x337256[_0x7990('0x37')][_0x7990('0x5e')])){for(var _0x5046e6=0x0;_0x5046e6<_0x337256[_0x7990('0x37')][_0x7990('0x5e')][_0x7990('0x4b')];_0x5046e6+=0x1){socket[_0x7990('0x8a')]('userCmList:remove',{'UserId':Number(_0x337256[_0x7990('0x37')]['ids'][_0x5046e6]),'CmListId':Number(_0x337256['params']['id'])});}}else{socket[_0x7990('0x8a')]('userCmList:remove',{'UserId':Number(_0x337256[_0x7990('0x37')]['ids']),'CmListId':Number(_0x337256[_0x7990('0x4a')]['id'])});}});}})[_0x7990('0x27')](respondWithStatusCode(_0x72e5ff,null))[_0x7990('0x4f')](handleError(_0x72e5ff,null));};exports[_0x7990('0x8d')]=function(_0x545d3a,_0x40854d,_0x40972d){var _0x311f70={};var _0x1399ac={};var _0x1efc9a;var _0x77dab0;return db[_0x7990('0x33')][_0x7990('0x5b')]({'where':{'id':_0x545d3a[_0x7990('0x4a')]['id']}})[_0x7990('0x27')](handleEntityNotFound(_0x40854d,null))[_0x7990('0x27')](function(_0x2b26b2){if(_0x2b26b2){_0x1efc9a=_0x2b26b2;_0x1399ac[_0x7990('0x36')]=_[_0x7990('0x38')](db[_0x7990('0x8e')]['rawAttributes']);_0x1399ac[_0x7990('0x37')]=_[_0x7990('0x38')](_0x545d3a['query']);_0x1399ac[_0x7990('0x39')]=_[_0x7990('0x3a')](_0x1399ac['model'],_0x1399ac['query']);_0x311f70['attributes']=_[_0x7990('0x3a')](_0x1399ac[_0x7990('0x36')],qs[_0x7990('0x3c')](_0x545d3a[_0x7990('0x37')][_0x7990('0x3c')]));_0x311f70['attributes']=_0x311f70['attributes'][_0x7990('0x4b')]?_0x311f70[_0x7990('0x3b')]:_0x1399ac[_0x7990('0x36')];_0x311f70[_0x7990('0x3f')]=qs['sort'](_0x545d3a[_0x7990('0x37')][_0x7990('0x40')]);_0x311f70[_0x7990('0x41')]=qs[_0x7990('0x39')](_[_0x7990('0x42')](_0x545d3a['query'],_0x1399ac[_0x7990('0x39')]));if(_0x545d3a[_0x7990('0x37')][_0x7990('0x43')]){_0x311f70['where']=_[_0x7990('0x44')](_0x311f70[_0x7990('0x41')],{'$or':_['map'](_0x311f70[_0x7990('0x3b')],function(_0x3c2fe8){var _0xac64b5={};_0xac64b5[_0x3c2fe8]={'$like':'%'+_0x545d3a[_0x7990('0x37')][_0x7990('0x43')]+'%'};return _0xac64b5;})});}_0x311f70=_['merge']({},_0x311f70,_0x545d3a[_0x7990('0x47')]);return _0x1efc9a['getAgents'](_0x311f70);}})[_0x7990('0x27')](function(_0x426f3f){if(_0x426f3f){_0x77dab0=_0x426f3f['length'];if(!_0x545d3a['query']['hasOwnProperty']('nolimit')){_0x311f70[_0x7990('0x21')]=qs[_0x7990('0x21')](_0x545d3a[_0x7990('0x37')][_0x7990('0x21')]);_0x311f70[_0x7990('0x1f')]=qs[_0x7990('0x1f')](_0x545d3a['query']['offset']);}return _0x1efc9a['getAgents'](_0x311f70);}})[_0x7990('0x27')](function(_0x69bc84){if(_0x69bc84){return _0x69bc84?{'count':_0x77dab0,'rows':_0x69bc84}:null;}})[_0x7990('0x27')](respondWithResult(_0x40854d,null))[_0x7990('0x4f')](handleError(_0x40854d,null));}; \ No newline at end of file +var _0xc0ab=['get','UserProfileResource','destroy','error','stack','name','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','user','Lists','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','Disposition','findOne','removeDispositions','addContacts','CmContact','isArray','tags','join','ListId','push','each','omit','ids','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then'];(function(_0xe37aa1,_0xe47a5e){var _0x3fffd8=function(_0x8aebe2){while(--_0x8aebe2){_0xe37aa1['push'](_0xe37aa1['shift']());}};_0x3fffd8(++_0xe47a5e);}(_0xc0ab,0x64));var _0xbc0a=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0xc0ab[_0x1cfc39];return _0x957a28;};'use strict';var emlformat=require(_0xbc0a('0x0'));var rimraf=require(_0xbc0a('0x1'));var zipdir=require(_0xbc0a('0x2'));var jsonpatch=require(_0xbc0a('0x3'));var rp=require(_0xbc0a('0x4'));var moment=require('moment');var BPromise=require(_0xbc0a('0x5'));var Mustache=require('mustache');var util=require(_0xbc0a('0x6'));var path=require(_0xbc0a('0x7'));var sox=require(_0xbc0a('0x8'));var csv=require(_0xbc0a('0x9'));var ejs=require(_0xbc0a('0xa'));var fs=require('fs');var fs_extra=require(_0xbc0a('0xb'));var _=require(_0xbc0a('0xc'));var squel=require('squel');var crypto=require(_0xbc0a('0xd'));var jsforce=require(_0xbc0a('0xe'));var deskjs=require(_0xbc0a('0xf'));var toCsv=require(_0xbc0a('0x9'));var querystring=require('querystring');var Papa=require(_0xbc0a('0x10'));var Redis=require(_0xbc0a('0x11'));var authService=require(_0xbc0a('0x12'));var qs=require(_0xbc0a('0x13'));var as=require(_0xbc0a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc0a('0x15'))('api');var utils=require(_0xbc0a('0x16'));var config=require(_0xbc0a('0x17'));var licenseUtil=require(_0xbc0a('0x18'));var db=require(_0xbc0a('0x19'))['db'];config[_0xbc0a('0x1a')]=_[_0xbc0a('0x1b')](config['redis'],{'host':_0xbc0a('0x1c'),'port':0x18eb});var socket=require(_0xbc0a('0x1d'))(new Redis(config[_0xbc0a('0x1a')]));require(_0xbc0a('0x1e'))[_0xbc0a('0x1f')](socket);function respondWithStatusCode(_0x2ecfa1,_0x32e503){_0x32e503=_0x32e503||0xcc;return function(_0x3d8d1a){if(_0x3d8d1a){return _0x2ecfa1[_0xbc0a('0x20')](_0x32e503);}return _0x2ecfa1[_0xbc0a('0x21')](_0x32e503)[_0xbc0a('0x22')]();};}function respondWithResult(_0x3f05c2,_0x22291e){_0x22291e=_0x22291e||0xc8;return function(_0x51ae07){if(_0x51ae07){return _0x3f05c2[_0xbc0a('0x21')](_0x22291e)[_0xbc0a('0x23')](_0x51ae07);}};}function respondWithFilteredResult(_0x3d6cf1,_0xa7aa7f){return function(_0x3757f8){if(_0x3757f8){var _0x5a4668=typeof _0xa7aa7f[_0xbc0a('0x24')]===_0xbc0a('0x25')&&typeof _0xa7aa7f['limit']===_0xbc0a('0x25');var _0x152249=_0x3757f8[_0xbc0a('0x26')];var _0x25f26a=_0x5a4668?0x0:_0xa7aa7f[_0xbc0a('0x24')];var _0x2ed33c=_0x5a4668?_0x3757f8['count']:_0xa7aa7f['offset']+_0xa7aa7f[_0xbc0a('0x27')];var _0x3f40a0;if(_0x2ed33c>=_0x152249){_0x2ed33c=_0x152249;_0x3f40a0=0xc8;}else{_0x3f40a0=0xce;}_0x3d6cf1['status'](_0x3f40a0);return _0x3d6cf1[_0xbc0a('0x28')](_0xbc0a('0x29'),_0x25f26a+'-'+_0x2ed33c+'/'+_0x152249)[_0xbc0a('0x23')](_0x3757f8);}return null;};}function patchUpdates(_0x157baa){return function(_0x45451e){try{jsonpatch[_0xbc0a('0x2a')](_0x45451e,_0x157baa,!![]);}catch(_0x15444d){return BPromise['reject'](_0x15444d);}return _0x45451e[_0xbc0a('0x2b')]();};}function saveUpdates(_0x1695ed,_0x5befcd){return function(_0xfbfb19){if(_0xfbfb19){return _0xfbfb19[_0xbc0a('0x2c')](_0x1695ed)['then'](function(_0x272849){return _0x272849;});}return null;};}function removeEntity(_0x201558,_0x2ffb18){return function(_0x44ff79){if(_0x44ff79){return _0x44ff79['destroy']()[_0xbc0a('0x2d')](function(){var _0x5109ac=_0x44ff79[_0xbc0a('0x2e')]({'plain':!![]});var _0x2dc3f4='Lists';return db[_0xbc0a('0x2f')][_0xbc0a('0x30')]({'where':{'type':_0x2dc3f4,'resourceId':_0x5109ac['id']}})['then'](function(){return _0x44ff79;});})[_0xbc0a('0x2d')](function(){_0x201558[_0xbc0a('0x21')](0xcc)[_0xbc0a('0x22')]();});}};}function handleEntityNotFound(_0x39785a,_0x1ae140){return function(_0x111e19){if(!_0x111e19){_0x39785a[_0xbc0a('0x20')](0x194);}return _0x111e19;};}function handleError(_0x44c32b,_0x53fff4){_0x53fff4=_0x53fff4||0x1f4;return function(_0x250617){logger[_0xbc0a('0x31')](_0x250617[_0xbc0a('0x32')]);if(_0x250617[_0xbc0a('0x33')]){delete _0x250617['name'];}_0x44c32b[_0xbc0a('0x21')](_0x53fff4)['send'](_0x250617);};}exports[_0xbc0a('0x34')]=function(_0x4e70cb,_0x15211b){var _0xf70df0={},_0x42c0ef={},_0x51973a={'count':0x0,'rows':[]};var _0x24369b=_['map'](db[_0xbc0a('0x35')][_0xbc0a('0x36')],function(_0x420d24){return{'name':_0x420d24[_0xbc0a('0x37')],'type':_0x420d24[_0xbc0a('0x38')][_0xbc0a('0x39')]};});_0x42c0ef[_0xbc0a('0x3a')]=_[_0xbc0a('0x3b')](_0x24369b,_0xbc0a('0x33'));_0x42c0ef[_0xbc0a('0x3c')]=_[_0xbc0a('0x3d')](_0x4e70cb['query']);_0x42c0ef[_0xbc0a('0x3e')]=_['intersection'](_0x42c0ef[_0xbc0a('0x3a')],_0x42c0ef[_0xbc0a('0x3c')]);_0xf70df0[_0xbc0a('0x3f')]=_[_0xbc0a('0x40')](_0x42c0ef[_0xbc0a('0x3a')],qs[_0xbc0a('0x41')](_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x41')]));_0xf70df0[_0xbc0a('0x3f')]=_0xf70df0['attributes'][_0xbc0a('0x42')]?_0xf70df0[_0xbc0a('0x3f')]:_0x42c0ef[_0xbc0a('0x3a')];if(!_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x43')](_0xbc0a('0x44'))){_0xf70df0[_0xbc0a('0x27')]=qs['limit'](_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x27')]);_0xf70df0[_0xbc0a('0x24')]=qs['offset'](_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x24')]);}_0xf70df0[_0xbc0a('0x45')]=qs['sort'](_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x46')]);_0xf70df0[_0xbc0a('0x47')]=qs['filters'](_[_0xbc0a('0x48')](_0x4e70cb[_0xbc0a('0x3c')],_0x42c0ef[_0xbc0a('0x3e')]),_0x24369b);if(_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x49')]){_0xf70df0[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0xf70df0[_0xbc0a('0x47')],{'$or':_[_0xbc0a('0x3b')](_0x24369b,function(_0x5eac97){if(_0x5eac97['type']!==_0xbc0a('0x4b')){var _0x242203={};_0x242203[_0x5eac97[_0xbc0a('0x33')]]={'$like':'%'+_0x4e70cb['query'][_0xbc0a('0x49')]+'%'};return _0x242203;}})});}_0xf70df0=_['merge']({},_0xf70df0,_0x4e70cb[_0xbc0a('0x4c')]);var _0x3077cd={'where':_0xf70df0[_0xbc0a('0x47')]};return db[_0xbc0a('0x35')][_0xbc0a('0x26')](_0x3077cd)['then'](function(_0xcee4a5){_0x51973a['count']=_0xcee4a5;if(_0x4e70cb[_0xbc0a('0x3c')][_0xbc0a('0x4d')]){_0xf70df0[_0xbc0a('0x4e')]=[{'all':!![]}];}return db[_0xbc0a('0x35')][_0xbc0a('0x4f')](_0xf70df0);})[_0xbc0a('0x2d')](function(_0x2ba776){_0x51973a[_0xbc0a('0x50')]=_0x2ba776;return _0x51973a;})['then'](respondWithFilteredResult(_0x15211b,_0xf70df0))['catch'](handleError(_0x15211b,null));};exports['show']=function(_0x501e49,_0x5b70d6){var _0x319754={'raw':![],'where':{'id':_0x501e49['params']['id']}},_0x3f4fac={};_0x3f4fac[_0xbc0a('0x3a')]=_[_0xbc0a('0x3d')](db['CmList'][_0xbc0a('0x36')]);_0x3f4fac[_0xbc0a('0x3c')]=_[_0xbc0a('0x3d')](_0x501e49[_0xbc0a('0x3c')]);_0x3f4fac[_0xbc0a('0x3e')]=_['intersection'](_0x3f4fac[_0xbc0a('0x3a')],_0x3f4fac['query']);_0x319754[_0xbc0a('0x3f')]=_[_0xbc0a('0x40')](_0x3f4fac['model'],qs[_0xbc0a('0x41')](_0x501e49[_0xbc0a('0x3c')][_0xbc0a('0x41')]));_0x319754[_0xbc0a('0x3f')]=_0x319754['attributes'][_0xbc0a('0x42')]?_0x319754[_0xbc0a('0x3f')]:_0x3f4fac[_0xbc0a('0x3a')];if(_0x501e49[_0xbc0a('0x3c')][_0xbc0a('0x4d')]){_0x319754[_0xbc0a('0x4e')]=[{'all':!![]}];}_0x319754=_[_0xbc0a('0x4a')]({},_0x319754,_0x501e49[_0xbc0a('0x4c')]);return db[_0xbc0a('0x35')][_0xbc0a('0x51')](_0x319754)['then'](handleEntityNotFound(_0x5b70d6,null))['then'](respondWithResult(_0x5b70d6,null))[_0xbc0a('0x52')](handleError(_0x5b70d6,null));};exports[_0xbc0a('0x53')]=function(_0x332d7a,_0x40ef4a){return db[_0xbc0a('0x35')][_0xbc0a('0x53')](_0x332d7a[_0xbc0a('0x54')],{})[_0xbc0a('0x2d')](function(_0x1fbf51){var _0x24dfe3=_0x332d7a[_0xbc0a('0x55')][_0xbc0a('0x2e')]({'plain':!![]});if(!_0x24dfe3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24dfe3['role']===_0xbc0a('0x55')){var _0x5113f4=_0x1fbf51[_0xbc0a('0x2e')]({'plain':!![]});var _0x384fa3=_0xbc0a('0x56');return db[_0xbc0a('0x57')][_0xbc0a('0x51')]({'where':{'name':_0x384fa3,'userProfileId':_0x24dfe3[_0xbc0a('0x58')]},'raw':!![]})[_0xbc0a('0x2d')](function(_0x3c0d3f){if(_0x3c0d3f&&_0x3c0d3f[_0xbc0a('0x59')]===0x0){return db[_0xbc0a('0x2f')][_0xbc0a('0x53')]({'name':_0x5113f4[_0xbc0a('0x33')],'resourceId':_0x5113f4['id'],'type':_0x3c0d3f['name'],'sectionId':_0x3c0d3f['id']},{})[_0xbc0a('0x2d')](function(){return _0x1fbf51;});}else{return _0x1fbf51;}})[_0xbc0a('0x52')](function(_0x4ca0c7){logger[_0xbc0a('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ca0c7);throw _0x4ca0c7;});}return _0x1fbf51;})[_0xbc0a('0x2d')](respondWithResult(_0x40ef4a,0xc9))[_0xbc0a('0x52')](handleError(_0x40ef4a,null));};exports[_0xbc0a('0x2c')]=function(_0x3ee9fa,_0x516af9){if(_0x3ee9fa[_0xbc0a('0x54')]['id']){delete _0x3ee9fa[_0xbc0a('0x54')]['id'];}return db[_0xbc0a('0x35')][_0xbc0a('0x51')]({'where':{'id':_0x3ee9fa[_0xbc0a('0x5a')]['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x516af9,null))[_0xbc0a('0x2d')](saveUpdates(_0x3ee9fa[_0xbc0a('0x54')],null))[_0xbc0a('0x2d')](respondWithResult(_0x516af9,null))[_0xbc0a('0x52')](handleError(_0x516af9,null));};exports[_0xbc0a('0x30')]=function(_0xa00b41,_0x48e92a){return db[_0xbc0a('0x35')]['find']({'where':{'id':_0xa00b41[_0xbc0a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x48e92a,null))['then'](removeEntity(_0x48e92a,null))[_0xbc0a('0x52')](handleError(_0x48e92a,null));};exports[_0xbc0a('0x5b')]=function(_0x15016c,_0x89bd27){return db[_0xbc0a('0x35')][_0xbc0a('0x5b')]()['then'](respondWithResult(_0x89bd27,null))[_0xbc0a('0x52')](handleError(_0x89bd27,null));};exports[_0xbc0a('0x5c')]=function(_0x272ee5,_0x463c53,_0x544d45){if(_0x272ee5[_0xbc0a('0x54')]['id']){delete _0x272ee5['body']['id'];}return db[_0xbc0a('0x35')][_0xbc0a('0x51')]({'where':{'id':_0x272ee5[_0xbc0a('0x5a')]['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x463c53,null))[_0xbc0a('0x2d')](function(_0xae685b){if(_0xae685b){_0x272ee5['body']['ListId']=_0xae685b['id'];return db[_0xbc0a('0x5d')][_0xbc0a('0x53')](_0x272ee5[_0xbc0a('0x54')]);}})[_0xbc0a('0x2d')](respondWithResult(_0x463c53,null))['catch'](handleError(_0x463c53,null));};exports['getDispositions']=function(_0x1b75f1,_0x45501f,_0x352444){var _0xf2119a={'raw':![],'where':{}};var _0x35cd55={};var _0x37e8ff={'count':0x0,'rows':[]};return db['CmList'][_0xbc0a('0x5e')]({'where':{'id':_0x1b75f1[_0xbc0a('0x5a')]['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x45501f,null))[_0xbc0a('0x2d')](function(_0x309053){if(_0x309053){_0x35cd55[_0xbc0a('0x3a')]=_['keys'](db[_0xbc0a('0x5d')][_0xbc0a('0x36')]);_0x35cd55[_0xbc0a('0x3c')]=_['keys'](_0x1b75f1[_0xbc0a('0x3c')]);_0x35cd55[_0xbc0a('0x3e')]=_[_0xbc0a('0x40')](_0x35cd55[_0xbc0a('0x3a')],_0x35cd55['query']);_0xf2119a[_0xbc0a('0x3f')]=_[_0xbc0a('0x40')](_0x35cd55['model'],qs['fields'](_0x1b75f1['query'][_0xbc0a('0x41')]));_0xf2119a[_0xbc0a('0x3f')]=_0xf2119a['attributes'][_0xbc0a('0x42')]?_0xf2119a['attributes']:_0x35cd55['model'];if(!_0x1b75f1[_0xbc0a('0x3c')][_0xbc0a('0x43')](_0xbc0a('0x44'))){_0xf2119a['limit']=qs[_0xbc0a('0x27')](_0x1b75f1[_0xbc0a('0x3c')][_0xbc0a('0x27')]);_0xf2119a[_0xbc0a('0x24')]=qs[_0xbc0a('0x24')](_0x1b75f1['query']['offset']);}_0xf2119a[_0xbc0a('0x45')]=qs['sort'](_0x1b75f1['query'][_0xbc0a('0x46')]);_0xf2119a['where']=qs[_0xbc0a('0x3e')](_[_0xbc0a('0x48')](_0x1b75f1[_0xbc0a('0x3c')],_0x35cd55[_0xbc0a('0x3e')]));_0xf2119a['where']['ListId']=_0x309053['id'];if(_0x1b75f1[_0xbc0a('0x3c')][_0xbc0a('0x49')]){_0xf2119a[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0xf2119a['where'],{'$or':_[_0xbc0a('0x3b')](_0xf2119a['attributes'],function(_0x171f4b){var _0x19d067={};_0x19d067[_0x171f4b]={'$like':'%'+_0x1b75f1['query'][_0xbc0a('0x49')]+'%'};return _0x19d067;})});}_0xf2119a=_['merge']({},_0xf2119a,_0x1b75f1[_0xbc0a('0x4c')]);return db['Disposition'][_0xbc0a('0x26')]({'where':_0xf2119a[_0xbc0a('0x47')]})['then'](function(_0x2e6896){_0x37e8ff['count']=_0x2e6896;if(_0x1b75f1[_0xbc0a('0x3c')][_0xbc0a('0x4d')]){_0xf2119a[_0xbc0a('0x4e')]=[{'all':!![]}];}return db[_0xbc0a('0x5d')]['findAll'](_0xf2119a);})['then'](function(_0x58cf54){_0x37e8ff['rows']=_0x58cf54;return _0x37e8ff;});}})[_0xbc0a('0x2d')](respondWithFilteredResult(_0x45501f,_0xf2119a))[_0xbc0a('0x52')](handleError(_0x45501f,null));};exports[_0xbc0a('0x5f')]=function(_0x362447,_0x3511a8,_0x45ae5a){return db[_0xbc0a('0x35')]['find']({'where':{'id':_0x362447[_0xbc0a('0x5a')]['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x3511a8,null))[_0xbc0a('0x2d')](function(_0x21d4e1){if(_0x21d4e1){return _0x21d4e1[_0xbc0a('0x5f')](_0x362447['query']['ids']);}})[_0xbc0a('0x2d')](respondWithStatusCode(_0x3511a8,null))[_0xbc0a('0x52')](handleError(_0x3511a8,null));};exports[_0xbc0a('0x60')]=function(_0x2fa402,_0x5afb1f,_0x3ae49c){return db[_0xbc0a('0x35')][_0xbc0a('0x51')]({'where':{'id':_0x2fa402[_0xbc0a('0x5a')]['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x5afb1f,null))[_0xbc0a('0x2d')](function(_0x4dd27d){if(_0x4dd27d){var _0x34a7f4=[];var _0x551b15={'success':[],'errors':[]};return db[_0xbc0a('0x61')][_0xbc0a('0x5b')]()[_0xbc0a('0x2d')](function(_0xb7fdde){if(_0x2fa402[_0xbc0a('0x54')]['tags']&&_[_0xbc0a('0x62')](_0x2fa402[_0xbc0a('0x54')][_0xbc0a('0x63')])){if(_0x2fa402['body'][_0xbc0a('0x63')][_0xbc0a('0x42')]){_0x2fa402['body']['tags']=_0x2fa402['body'][_0xbc0a('0x63')][_0xbc0a('0x64')](';')+';';}else{_0x2fa402['body']['tags']=null;}}else{_0x2fa402[_0xbc0a('0x54')][_0xbc0a('0x63')]=null;}if(_0x2fa402[_0xbc0a('0x54')]&&_[_0xbc0a('0x62')](_0x2fa402[_0xbc0a('0x54')])){for(var _0xe502d6=0x0;_0xe502d6<_0x2fa402[_0xbc0a('0x54')][_0xbc0a('0x42')];_0xe502d6+=0x1){_0x2fa402['body'][_0xe502d6][_0xbc0a('0x65')]=_0x2fa402[_0xbc0a('0x5a')]['id'];_0x34a7f4[_0xbc0a('0x66')](_0x2fa402[_0xbc0a('0x54')][_0xe502d6]);}return BPromise[_0xbc0a('0x67')](_0x34a7f4,function(_0x1488b3){return db[_0xbc0a('0x61')][_0xbc0a('0x53')](_[_0xbc0a('0x68')](_0x1488b3,[_0xbc0a('0x69'),'id'])||{},{'fields':_['keys'](_0xb7fdde),'raw':!![]})['then'](function(_0x37062b){_0x551b15[_0xbc0a('0x6a')][_0xbc0a('0x66')](_0x37062b[_0xbc0a('0x6b')]);})['catch'](function(_0xae9510){_0x551b15[_0xbc0a('0x6c')]['push']({'data':_0x1488b3,'error':_0xae9510[_0xbc0a('0x6d')]});});})['then'](function(_0x14f2a9){return _0x551b15;})[_0xbc0a('0x52')](function(_0x681b8c){return _0x681b8c;});}else{_0x5afb1f[_0xbc0a('0x21')](0x190)[_0xbc0a('0x23')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x5afb1f,null))[_0xbc0a('0x52')](handleError(_0x5afb1f,null));};exports[_0xbc0a('0x6e')]=function(_0x2cd978,_0x28582c,_0x1d8ad1){var _0x4e36c3;return db['CmList'][_0xbc0a('0x51')]({'where':{'id':_0x2cd978[_0xbc0a('0x5a')]['id']},'include':[{'model':db[_0xbc0a('0x6f')],'as':_0xbc0a('0x70')}]})[_0xbc0a('0x2d')](handleEntityNotFound(_0x28582c,null))[_0xbc0a('0x2d')](function(_0xf9bc16){if(_0xf9bc16){_0x4e36c3=_0xf9bc16;return db[_0xbc0a('0x61')]['rawAttributes'];}})[_0xbc0a('0x2d')](function(_0x82470c){if(_0x82470c){var _0x2d0348={};var _0x127097={};_0x127097['model']=_[_0xbc0a('0x71')](_[_0xbc0a('0x3d')](_0x82470c),_[_0xbc0a('0x3b')](_0x4e36c3[_0xbc0a('0x70')],function(_0x4b024b){return util[_0xbc0a('0x72')]('cf_%d',_0x4b024b['id']);}));_0x127097[_0xbc0a('0x3c')]=_[_0xbc0a('0x3d')](_0x2cd978[_0xbc0a('0x3c')]);_0x127097[_0xbc0a('0x3e')]=_[_0xbc0a('0x40')](_0x127097[_0xbc0a('0x3a')],_0x127097[_0xbc0a('0x3c')]);_0x2d0348[_0xbc0a('0x3f')]=_[_0xbc0a('0x40')](_0x127097[_0xbc0a('0x3a')],qs[_0xbc0a('0x41')](_0x2cd978[_0xbc0a('0x3c')]['fields']));_0x2d0348[_0xbc0a('0x3f')]=_0x2d0348[_0xbc0a('0x3f')][_0xbc0a('0x42')]?_0x2d0348[_0xbc0a('0x3f')]:_0x127097[_0xbc0a('0x3a')];if(!_0x2cd978['query'][_0xbc0a('0x43')](_0xbc0a('0x44'))){_0x2d0348[_0xbc0a('0x27')]=qs[_0xbc0a('0x27')](_0x2cd978['query'][_0xbc0a('0x27')]);_0x2d0348[_0xbc0a('0x24')]=qs[_0xbc0a('0x24')](_0x2cd978[_0xbc0a('0x3c')]['offset']);}_0x2d0348[_0xbc0a('0x45')]=qs[_0xbc0a('0x46')](_0x2cd978[_0xbc0a('0x3c')][_0xbc0a('0x46')]);_0x2d0348[_0xbc0a('0x47')]=qs[_0xbc0a('0x3e')](_[_0xbc0a('0x48')](_0x2cd978[_0xbc0a('0x3c')],_0x127097[_0xbc0a('0x3e')]));_0x2d0348[_0xbc0a('0x73')]=!![];if(_0x2cd978['query'][_0xbc0a('0x49')]){_0x2d0348[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0x2d0348[_0xbc0a('0x47')],{'$or':_[_0xbc0a('0x3b')](_0x2d0348[_0xbc0a('0x3f')],function(_0x482897){var _0x2e96b3={};_0x2e96b3[_0x482897]={'$like':'%'+_0x2cd978[_0xbc0a('0x3c')][_0xbc0a('0x49')]+'%'};return _0x2e96b3;})});}_0x2d0348=_[_0xbc0a('0x4a')]({},_0x2d0348,_0x2cd978[_0xbc0a('0x4c')]);return _0x4e36c3[_0xbc0a('0x6e')](_0x2d0348);}})['then'](respondWithResult(_0x28582c,null))['catch'](handleError(_0x28582c,null));};exports[_0xbc0a('0x74')]=function(_0x11ad39,_0x3957ee,_0x3204b0){var _0x588709;return db[_0xbc0a('0x35')][_0xbc0a('0x51')]({'where':{'id':_0x11ad39[_0xbc0a('0x5a')]['id']},'include':[{'model':db[_0xbc0a('0x6f')],'as':_0xbc0a('0x70')}]})[_0xbc0a('0x2d')](handleEntityNotFound(_0x3957ee,null))[_0xbc0a('0x2d')](function(_0x5efe11){if(_0x5efe11){_0x588709=_0x5efe11;return db['CmContact'][_0xbc0a('0x36')];}})['then'](function(_0x43fae1){if(_0x43fae1){var _0x59df32={};var _0x3b4d7e={};_0x3b4d7e[_0xbc0a('0x3a')]=_[_0xbc0a('0x71')](_[_0xbc0a('0x3d')](_0x43fae1),_[_0xbc0a('0x3b')](_0x588709[_0xbc0a('0x70')],function(_0x3b75b1){return util['format'](_0xbc0a('0x75'),_0x3b75b1['id']);}));_0x3b4d7e[_0xbc0a('0x3c')]=_['keys'](_0x11ad39[_0xbc0a('0x3c')]);_0x3b4d7e[_0xbc0a('0x3e')]=_[_0xbc0a('0x40')](_0x3b4d7e['model'],_0x3b4d7e[_0xbc0a('0x3c')]);_0x59df32['attributes']=_[_0xbc0a('0x40')](_0x3b4d7e[_0xbc0a('0x3a')],qs[_0xbc0a('0x41')](_0x11ad39[_0xbc0a('0x3c')][_0xbc0a('0x41')]));_0x59df32['attributes']=_0x59df32[_0xbc0a('0x3f')]['length']?_0x59df32[_0xbc0a('0x3f')]:_0x3b4d7e[_0xbc0a('0x3a')];if(!_0x11ad39['query'][_0xbc0a('0x43')](_0xbc0a('0x44'))){_0x59df32[_0xbc0a('0x27')]=qs[_0xbc0a('0x27')](_0x11ad39[_0xbc0a('0x3c')][_0xbc0a('0x27')]);_0x59df32[_0xbc0a('0x24')]=qs[_0xbc0a('0x24')](_0x11ad39[_0xbc0a('0x3c')]['offset']);}_0x59df32[_0xbc0a('0x45')]=qs[_0xbc0a('0x46')](_0x11ad39['query']['sort']);_0x59df32['where']=qs['filters'](_[_0xbc0a('0x48')](_0x11ad39[_0xbc0a('0x3c')],_0x3b4d7e[_0xbc0a('0x3e')]));_0x59df32[_0xbc0a('0x73')]=!![];if(_0x11ad39[_0xbc0a('0x3c')][_0xbc0a('0x49')]){_0x59df32[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0x59df32[_0xbc0a('0x47')],{'$or':_[_0xbc0a('0x3b')](_0x59df32[_0xbc0a('0x3f')],function(_0x1a221d){var _0x1138d4={};_0x1138d4[_0x1a221d]={'$like':'%'+_0x11ad39[_0xbc0a('0x3c')]['filter']+'%'};return _0x1138d4;})});}_0x59df32=_[_0xbc0a('0x4a')]({},_0x59df32,_0x11ad39[_0xbc0a('0x4c')]);return _0x588709[_0xbc0a('0x6e')](_0x59df32);}})[_0xbc0a('0x2d')](function(_0x2c465d){if(!_[_0xbc0a('0x76')](_0x2c465d)){var _0x20dfac=toCsv(_0x2c465d);var _0x45361a=Date[_0xbc0a('0x77')]();fs[_0xbc0a('0x78')](util[_0xbc0a('0x72')](_0xbc0a('0x79'),_0x588709['id'],_0x45361a),_0x20dfac);_0x3957ee[_0xbc0a('0x7a')](_0xbc0a('0x7b'),_0xbc0a('0x7c')+util[_0xbc0a('0x72')]('list_%d_%s.csv',_0x588709['id'],_0x45361a));_0x3957ee[_0xbc0a('0x7a')](_0xbc0a('0x7d'),_0xbc0a('0x7e'));return _0x3957ee['download'](util['format'](_0xbc0a('0x79'),_0x588709['id'],_0x45361a));}else{return _0x3957ee[_0xbc0a('0x20')](0xcc);}})[_0xbc0a('0x52')](handleError(_0x3957ee,null));};exports['addCustomField']=function(_0x3b9e64,_0x5926da,_0x424433){var _0x11b093;delete _0x3b9e64[_0xbc0a('0x54')]['id'];return db[_0xbc0a('0x35')][_0xbc0a('0x5e')]({'where':{'id':_0x3b9e64[_0xbc0a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5926da,null))['then'](function(_0x1902c7){if(_0x1902c7){return db[_0xbc0a('0x7f')][_0xbc0a('0x80')](function(_0x8ecec4){return db[_0xbc0a('0x6f')][_0xbc0a('0x53')](_0x3b9e64[_0xbc0a('0x54')],{'transaction':_0x8ecec4})['then'](function(_0x5bb421){_0x11b093=_0x5bb421;return _0x1902c7[_0xbc0a('0x81')](_0x5bb421,{'transaction':_0x8ecec4});})[_0xbc0a('0x2d')](function(){var _0x143cfa={'type':db[_0xbc0a('0x82')][_0xbc0a('0x83')],'transaction':_0x8ecec4};switch(_0x3b9e64[_0xbc0a('0x54')][_0xbc0a('0x38')]){case _0xbc0a('0x84'):_0x143cfa[_0xbc0a('0x38')]=db[_0xbc0a('0x82')][_0xbc0a('0x83')];break;case'number':_0x143cfa[_0xbc0a('0x38')]=db['Sequelize'][_0xbc0a('0x85')];break;case'switch':_0x143cfa[_0xbc0a('0x38')]=db[_0xbc0a('0x82')]['BOOLEAN'];_0x143cfa[_0xbc0a('0x86')]=![];break;default:}return db[_0xbc0a('0x7f')][_0xbc0a('0x87')][_0xbc0a('0x88')]('cm_contacts',util['format'](_0xbc0a('0x89'),_0x11b093['id']),_0x143cfa);})['then'](function(){return _0x11b093;});});}})['then'](respondWithResult(_0x5926da,null))[_0xbc0a('0x52')](handleError(_0x5926da,null));};exports[_0xbc0a('0x8a')]=function(_0x2ceed5,_0x571e92,_0x56254c){var _0x1b45cd={};var _0x5b5ad7={};var _0x41f58d;var _0x3c0707;return db[_0xbc0a('0x35')][_0xbc0a('0x5e')]({'where':{'id':_0x2ceed5['params']['id']}})['then'](handleEntityNotFound(_0x571e92,null))[_0xbc0a('0x2d')](function(_0x27f97a){if(_0x27f97a){_0x41f58d=_0x27f97a;_0x5b5ad7[_0xbc0a('0x3a')]=_[_0xbc0a('0x3d')](db['CmCustomField'][_0xbc0a('0x36')]);_0x5b5ad7['query']=_[_0xbc0a('0x3d')](_0x2ceed5[_0xbc0a('0x3c')]);_0x5b5ad7[_0xbc0a('0x3e')]=_[_0xbc0a('0x40')](_0x5b5ad7[_0xbc0a('0x3a')],_0x5b5ad7[_0xbc0a('0x3c')]);_0x1b45cd[_0xbc0a('0x3f')]=_[_0xbc0a('0x40')](_0x5b5ad7[_0xbc0a('0x3a')],qs[_0xbc0a('0x41')](_0x2ceed5[_0xbc0a('0x3c')][_0xbc0a('0x41')]));_0x1b45cd['attributes']=_0x1b45cd[_0xbc0a('0x3f')]['length']?_0x1b45cd[_0xbc0a('0x3f')]:_0x5b5ad7[_0xbc0a('0x3a')];_0x1b45cd[_0xbc0a('0x45')]=qs['sort'](_0x2ceed5['query']['sort']);_0x1b45cd['where']=qs[_0xbc0a('0x3e')](_[_0xbc0a('0x48')](_0x2ceed5['query'],_0x5b5ad7[_0xbc0a('0x3e')]));_0x1b45cd[_0xbc0a('0x47')]=_['merge'](_0x1b45cd[_0xbc0a('0x47')],{'$or':[{'ListId':_0x27f97a['id']},{'ListId':null}]});if(_0x2ceed5['query'][_0xbc0a('0x49')]){_0x1b45cd[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0x1b45cd[_0xbc0a('0x47')],{'$or':_[_0xbc0a('0x3b')](_0x1b45cd['attributes'],function(_0x37e207){var _0x3f56ab={};_0x3f56ab[_0x37e207]={'$like':'%'+_0x2ceed5[_0xbc0a('0x3c')]['filter']+'%'};return _0x3f56ab;})});}_0x1b45cd=_['merge']({},_0x1b45cd,_0x2ceed5[_0xbc0a('0x4c')]);return db[_0xbc0a('0x6f')][_0xbc0a('0x8b')](_0x1b45cd);}})[_0xbc0a('0x2d')](respondWithResult(_0x571e92,null))['catch'](handleError(_0x571e92,null));};exports[_0xbc0a('0x8c')]=function(_0x52c6f9,_0x28c0fb,_0xee7091){return db[_0xbc0a('0x35')][_0xbc0a('0x51')]({'where':{'id':_0x52c6f9['params']['id']}})['then'](handleEntityNotFound(_0x28c0fb,null))[_0xbc0a('0x2d')](function(_0x3e2f73){if(_0x3e2f73){return _0x3e2f73[_0xbc0a('0x8c')](_0x52c6f9[_0xbc0a('0x54')][_0xbc0a('0x69')],_[_0xbc0a('0x68')](_0x52c6f9['body'],[_0xbc0a('0x69'),'id'])||{})[_0xbc0a('0x8d')](function(_0x935cba){for(var _0x515ce6=0x0;_0x515ce6<_0x52c6f9[_0xbc0a('0x54')][_0xbc0a('0x69')][_0xbc0a('0x42')];_0x515ce6+=0x1){socket[_0xbc0a('0x8e')]('userCmList:save',{'UserId':Number(_0x52c6f9[_0xbc0a('0x54')][_0xbc0a('0x69')][_0x515ce6]),'CmListId':Number(_0x52c6f9[_0xbc0a('0x5a')]['id'])});}return _0x935cba;});}})[_0xbc0a('0x2d')](respondWithResult(_0x28c0fb,null))[_0xbc0a('0x52')](handleError(_0x28c0fb,null));};exports[_0xbc0a('0x8f')]=function(_0x4d8220,_0x572ad2,_0x4076d2){return db[_0xbc0a('0x35')]['find']({'where':{'id':_0x4d8220['params']['id']}})[_0xbc0a('0x2d')](handleEntityNotFound(_0x572ad2,null))['then'](function(_0x17a657){if(_0x17a657){return _0x17a657[_0xbc0a('0x8f')](_0x4d8220[_0xbc0a('0x3c')][_0xbc0a('0x69')])[_0xbc0a('0x2d')](function(){if(_[_0xbc0a('0x62')](_0x4d8220[_0xbc0a('0x3c')][_0xbc0a('0x69')])){for(var _0x25b686=0x0;_0x25b686<_0x4d8220[_0xbc0a('0x3c')]['ids'][_0xbc0a('0x42')];_0x25b686+=0x1){socket[_0xbc0a('0x8e')]('userCmList:remove',{'UserId':Number(_0x4d8220[_0xbc0a('0x3c')]['ids'][_0x25b686]),'CmListId':Number(_0x4d8220[_0xbc0a('0x5a')]['id'])});}}else{socket[_0xbc0a('0x8e')](_0xbc0a('0x90'),{'UserId':Number(_0x4d8220[_0xbc0a('0x3c')]['ids']),'CmListId':Number(_0x4d8220['params']['id'])});}});}})['then'](respondWithStatusCode(_0x572ad2,null))['catch'](handleError(_0x572ad2,null));};exports[_0xbc0a('0x91')]=function(_0x4a49fe,_0x449222,_0x83299){var _0x2d8a20={};var _0x486881={};var _0x37e477;var _0x3af049;return db[_0xbc0a('0x35')][_0xbc0a('0x5e')]({'where':{'id':_0x4a49fe['params']['id']}})['then'](handleEntityNotFound(_0x449222,null))[_0xbc0a('0x2d')](function(_0x4bfa73){if(_0x4bfa73){_0x37e477=_0x4bfa73;_0x486881[_0xbc0a('0x3a')]=_[_0xbc0a('0x3d')](db['User']['rawAttributes']);_0x486881[_0xbc0a('0x3c')]=_['keys'](_0x4a49fe[_0xbc0a('0x3c')]);_0x486881[_0xbc0a('0x3e')]=_[_0xbc0a('0x40')](_0x486881[_0xbc0a('0x3a')],_0x486881[_0xbc0a('0x3c')]);_0x2d8a20[_0xbc0a('0x3f')]=_['intersection'](_0x486881[_0xbc0a('0x3a')],qs[_0xbc0a('0x41')](_0x4a49fe['query']['fields']));_0x2d8a20['attributes']=_0x2d8a20[_0xbc0a('0x3f')][_0xbc0a('0x42')]?_0x2d8a20['attributes']:_0x486881[_0xbc0a('0x3a')];_0x2d8a20['order']=qs[_0xbc0a('0x46')](_0x4a49fe[_0xbc0a('0x3c')][_0xbc0a('0x46')]);_0x2d8a20[_0xbc0a('0x47')]=qs[_0xbc0a('0x3e')](_[_0xbc0a('0x48')](_0x4a49fe[_0xbc0a('0x3c')],_0x486881[_0xbc0a('0x3e')]));if(_0x4a49fe[_0xbc0a('0x3c')]['filter']){_0x2d8a20[_0xbc0a('0x47')]=_[_0xbc0a('0x4a')](_0x2d8a20['where'],{'$or':_[_0xbc0a('0x3b')](_0x2d8a20[_0xbc0a('0x3f')],function(_0xacad53){var _0x4e349f={};_0x4e349f[_0xacad53]={'$like':'%'+_0x4a49fe[_0xbc0a('0x3c')][_0xbc0a('0x49')]+'%'};return _0x4e349f;})});}_0x2d8a20=_[_0xbc0a('0x4a')]({},_0x2d8a20,_0x4a49fe[_0xbc0a('0x4c')]);return _0x37e477[_0xbc0a('0x91')](_0x2d8a20);}})['then'](function(_0x26695d){if(_0x26695d){_0x3af049=_0x26695d[_0xbc0a('0x42')];if(!_0x4a49fe[_0xbc0a('0x3c')][_0xbc0a('0x43')](_0xbc0a('0x44'))){_0x2d8a20[_0xbc0a('0x27')]=qs[_0xbc0a('0x27')](_0x4a49fe[_0xbc0a('0x3c')][_0xbc0a('0x27')]);_0x2d8a20[_0xbc0a('0x24')]=qs[_0xbc0a('0x24')](_0x4a49fe[_0xbc0a('0x3c')][_0xbc0a('0x24')]);}return _0x37e477[_0xbc0a('0x91')](_0x2d8a20);}})[_0xbc0a('0x2d')](function(_0x1b0bf0){if(_0x1b0bf0){return _0x1b0bf0?{'count':_0x3af049,'rows':_0x1b0bf0}:null;}})['then'](respondWithResult(_0x449222,null))[_0xbc0a('0x52')](handleError(_0x449222,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 62c6579..5b4773f 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x27c59c,_0x355b73){var _0x2ed45a=function(_0x3581d8){while(--_0x3581d8){_0x27c59c['push'](_0x27c59c['shift']());}};_0x2ed45a(++_0x355b73);}(_0x814b,0x1a2));var _0xb814=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x814b[_0x2ff4bd];return _0x28edc6;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x5fc3[_0x1cc961];return _0x471d86;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index fdda8bd..5316ab5 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 _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0x4615f3,_0x42d419){var _0x4b7b57=function(_0x1130d3){while(--_0x1130d3){_0x4615f3['push'](_0x4615f3['shift']());}};_0x4b7b57(++_0x42d419);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4249b4,_0x9adec3){_0x4249b4=_0x4249b4-0x0;var _0x31d915=_0xb43b[_0x4249b4];return _0x31d915;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb58b=['CmList','cm_lists','util','../../config/logger','api','bluebird','request-promise','rimraf','./cmList.attributes','exports','define'];(function(_0x3be658,_0x5b5905){var _0x8382ed=function(_0x361b7d){while(--_0x361b7d){_0x3be658['push'](_0x3be658['shift']());}};_0x8382ed(++_0x5b5905);}(_0xb58b,0x1f1));var _0xbb58=function(_0x239461,_0x1afb39){_0x239461=_0x239461-0x0;var _0x183ac6=_0xb58b[_0x239461];return _0x183ac6;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require('moment');var BPromise=require(_0xbb58('0x3'));var rp=require(_0xbb58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb58('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb58('0x6'));module[_0xbb58('0x7')]=function(_0x33fe85,_0x5cf8b1){return _0x33fe85[_0xbb58('0x8')](_0xbb58('0x9'),attributes,{'tableName':_0xbb58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index dc6808c..b1713c6 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 _0x425e=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x293947,_0x1ac925){var _0x585cc8=function(_0x331873){while(--_0x331873){_0x293947['push'](_0x293947['shift']());}};_0x585cc8(++_0x1ac925);}(_0x425e,0xfe));var _0xe425=function(_0x471935,_0x7ed33a){_0x471935=_0x471935-0x0;var _0x588ceb=_0x425e[_0x471935];return _0x588ceb;};'use strict';var _=require(_0xe425('0x0'));var util=require('util');var moment=require(_0xe425('0x1'));var BPromise=require(_0xe425('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe425('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe425('0x4'));var logger=require(_0xe425('0x5'))(_0xe425('0x6'));var config=require(_0xe425('0x7'));var jayson=require(_0xe425('0x8'));var client=jayson[_0xe425('0x9')][_0xe425('0xa')]({'port':0x232a});config[_0xe425('0xb')]=_['defaults'](config[_0xe425('0xb')],{'host':_0xe425('0xc'),'port':0x18eb});var socket=require(_0xe425('0xd'))(new Redis(config['redis']));require(_0xe425('0xe'))['register'](socket);function respondWithRpcPromise(_0x28407b,_0x11cb41,_0x521c40){return new BPromise(function(_0x2e3c2b,_0x112077){return client[_0xe425('0xf')](_0x28407b,_0x521c40)['then'](function(_0x57220d){logger[_0xe425('0x10')](_0xe425('0x11'),_0x11cb41,_0xe425('0x12'));logger['debug'](_0xe425('0x13'),_0x11cb41,_0xe425('0x12'),JSON[_0xe425('0x14')](_0x57220d));if(_0x57220d[_0xe425('0x15')]){if(_0x57220d[_0xe425('0x15')][_0xe425('0x16')]===0x1f4){logger['error'](_0xe425('0x11'),_0x11cb41,_0x57220d[_0xe425('0x15')]['message']);return _0x112077(_0x57220d[_0xe425('0x15')]['message']);}logger['error'](_0xe425('0x11'),_0x11cb41,_0x57220d[_0xe425('0x15')][_0xe425('0x17')]);return _0x2e3c2b(_0x57220d[_0xe425('0x15')][_0xe425('0x17')]);}else{logger[_0xe425('0x10')](_0xe425('0x11'),_0x11cb41,_0xe425('0x12'));_0x2e3c2b(_0x57220d[_0xe425('0x18')][_0xe425('0x17')]);}})[_0xe425('0x19')](function(_0x21c1f9){logger[_0xe425('0x15')]('CmList,\x20%s,\x20%s',_0x11cb41,_0x21c1f9);_0x112077(_0x21c1f9);});});} \ No newline at end of file +var _0x8a2c=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5b7ae8,_0x1b18bc){var _0x187f05=function(_0x23c807){while(--_0x23c807){_0x5b7ae8['push'](_0x5b7ae8['shift']());}};_0x187f05(++_0x1b18bc);}(_0x8a2c,0x144));var _0xc8a2=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8a2c[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xc8a2('0x0'));var util=require(_0xc8a2('0x1'));var moment=require('moment');var BPromise=require(_0xc8a2('0x2'));var rs=require(_0xc8a2('0x3'));var fs=require('fs');var Redis=require(_0xc8a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8a2('0x5'));var logger=require(_0xc8a2('0x6'))(_0xc8a2('0x7'));var config=require(_0xc8a2('0x8'));var jayson=require(_0xc8a2('0x9'));var client=jayson[_0xc8a2('0xa')][_0xc8a2('0xb')]({'port':0x232a});config[_0xc8a2('0xc')]=_[_0xc8a2('0xd')](config[_0xc8a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8a2('0xc')]));require(_0xc8a2('0xe'))['register'](socket);function respondWithRpcPromise(_0x4fccfe,_0x51c69f,_0xf1f06e){return new BPromise(function(_0x49543f,_0x4249d4){return client[_0xc8a2('0xf')](_0x4fccfe,_0xf1f06e)[_0xc8a2('0x10')](function(_0x35ff01){logger[_0xc8a2('0x11')](_0xc8a2('0x12'),_0x51c69f,'request\x20sent');logger[_0xc8a2('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x51c69f,_0xc8a2('0x14'),JSON[_0xc8a2('0x15')](_0x35ff01));if(_0x35ff01[_0xc8a2('0x16')]){if(_0x35ff01['error'][_0xc8a2('0x17')]===0x1f4){logger[_0xc8a2('0x16')](_0xc8a2('0x12'),_0x51c69f,_0x35ff01[_0xc8a2('0x16')][_0xc8a2('0x18')]);return _0x4249d4(_0x35ff01['error'][_0xc8a2('0x18')]);}logger[_0xc8a2('0x16')]('CmList,\x20%s,\x20%s',_0x51c69f,_0x35ff01['error'][_0xc8a2('0x18')]);return _0x49543f(_0x35ff01[_0xc8a2('0x16')][_0xc8a2('0x18')]);}else{logger['info'](_0xc8a2('0x12'),_0x51c69f,'request\x20sent');_0x49543f(_0x35ff01[_0xc8a2('0x19')]['message']);}})[_0xc8a2('0x1a')](function(_0xec9c0c){logger[_0xc8a2('0x16')](_0xc8a2('0x12'),_0x51c69f,_0xec9c0c);_0x4249d4(_0xec9c0c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 37d339e..20446d1 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 _0xbc69=['./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0xbc69,0x134));var _0x9bc6=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xbc69[_0x381589];return _0x2a075d;};'use strict';var CmListEvents=require(_0x9bc6('0x0'));var events=[_0x9bc6('0x1'),_0x9bc6('0x2'),_0x9bc6('0x3')];function createListener(_0x133d99,_0x1a0c4e){return function(_0x321b0b){_0x1a0c4e[_0x9bc6('0x4')](_0x133d99,_0x321b0b);};}function removeListener(_0x30045f,_0x51b045){return function(){CmListEvents[_0x9bc6('0x5')](_0x30045f,_0x51b045);};}exports[_0x9bc6('0x6')]=function(_0x2347a9){for(var _0x23b1b8=0x0,_0x1762bd=events['length'];_0x23b1b8<_0x1762bd;_0x23b1b8++){var _0x1d66ff=events[_0x23b1b8];var _0x320520=createListener('cmList:'+_0x1d66ff,_0x2347a9);CmListEvents['on'](_0x1d66ff,_0x320520);}}; \ No newline at end of file +var _0x86eb=['cmList:','./cmList.events','save','remove','update','emit','register','length'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x86eb,0x139));var _0xb86e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86eb[_0x20a584];return _0x4b41a8;};'use strict';var CmListEvents=require(_0xb86e('0x0'));var events=[_0xb86e('0x1'),_0xb86e('0x2'),_0xb86e('0x3')];function createListener(_0x2b0268,_0x42c507){return function(_0x2f423a){_0x42c507[_0xb86e('0x4')](_0x2b0268,_0x2f423a);};}function removeListener(_0x753331,_0x4d89ef){return function(){CmListEvents['removeListener'](_0x753331,_0x4d89ef);};}exports[_0xb86e('0x5')]=function(_0x276008){for(var _0x38ba26=0x0,_0x59fafc=events[_0xb86e('0x6')];_0x38ba26<_0x59fafc;_0x38ba26++){var _0x1e0d28=events[_0x38ba26];var _0x3c01b4=createListener(_0xb86e('0x7')+_0x1e0d28,_0x276008);CmListEvents['on'](_0x1e0d28,_0x3c01b4);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index cb63995..4b15d97 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 _0x3bc3=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','create','post','/:id/dispositions','/:id/contacts','addContacts','addCustomField','addAgents'];(function(_0x327a80,_0xff6da3){var _0x1ff3b0=function(_0x22813e){while(--_0x22813e){_0x327a80['push'](_0x327a80['shift']());}};_0x1ff3b0(++_0xff6da3);}(_0x3bc3,0xaa));var _0x33bc=function(_0x1f023c,_0x33d0fd){_0x1f023c=_0x1f023c-0x0;var _0x13a3cf=_0x3bc3[_0x1f023c];return _0x13a3cf;};'use strict';var multer=require('multer');var util=require(_0x33bc('0x0'));var path=require(_0x33bc('0x1'));var timeout=require(_0x33bc('0x2'));var express=require(_0x33bc('0x3'));var router=express['Router']();var fs_extra=require(_0x33bc('0x4'));var auth=require(_0x33bc('0x5'));var interaction=require(_0x33bc('0x6'));var config=require(_0x33bc('0x7'));var controller=require(_0x33bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x33bc('0x9')]);router[_0x33bc('0xa')](_0x33bc('0xb'),auth[_0x33bc('0xc')](),controller[_0x33bc('0xd')]);router['get'](_0x33bc('0xe'),auth[_0x33bc('0xc')](),controller[_0x33bc('0xf')]);router[_0x33bc('0xa')]('/:id/dispositions',auth[_0x33bc('0xc')](),controller['getDispositions']);router[_0x33bc('0xa')]('/:id/contacts',auth[_0x33bc('0xc')](),controller[_0x33bc('0x10')]);router[_0x33bc('0xa')]('/:id/contacts/csv',auth[_0x33bc('0xc')](),controller[_0x33bc('0x11')]);router['get'](_0x33bc('0x12'),auth[_0x33bc('0xc')](),controller[_0x33bc('0x13')]);router[_0x33bc('0xa')](_0x33bc('0x14'),auth[_0x33bc('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x33bc('0x15')]);router[_0x33bc('0x16')](_0x33bc('0x17'),auth[_0x33bc('0xc')](),controller['addDisposition']);router['post'](_0x33bc('0x18'),auth[_0x33bc('0xc')](),controller[_0x33bc('0x19')]);router[_0x33bc('0x16')](_0x33bc('0x12'),auth[_0x33bc('0xc')](),controller[_0x33bc('0x1a')]);router[_0x33bc('0x16')](_0x33bc('0x14'),auth['isAuthenticated'](),controller[_0x33bc('0x1b')]);router[_0x33bc('0x1c')](_0x33bc('0xe'),auth[_0x33bc('0xc')](),controller[_0x33bc('0x1d')]);router[_0x33bc('0x1e')]('/:id',auth[_0x33bc('0xc')](),controller[_0x33bc('0x1f')]);router['delete'](_0x33bc('0x17'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x33bc('0x1e')]('/:id/users',auth[_0x33bc('0xc')](),controller['removeAgents']);module[_0x33bc('0x20')]=router; \ No newline at end of file +var _0x9abc=['put','update','delete','/:id','removeDispositions','removeAgents','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x9abc,0x165));var _0xc9ab=function(_0x190084,_0x28ae3c){_0x190084=_0x190084-0x0;var _0x214211=_0x9abc[_0x190084];return _0x214211;};'use strict';var multer=require(_0xc9ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc9ab('0x1'));var express=require(_0xc9ab('0x2'));var router=express[_0xc9ab('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc9ab('0x4'));var config=require(_0xc9ab('0x5'));var controller=require(_0xc9ab('0x6'));router[_0xc9ab('0x7')]('/',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x9')]);router[_0xc9ab('0x7')](_0xc9ab('0xa'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0xb')]);router[_0xc9ab('0x7')]('/:id',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0xc')]);router[_0xc9ab('0x7')]('/:id/dispositions',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0xd')]);router[_0xc9ab('0x7')]('/:id/contacts',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0xe')]);router[_0xc9ab('0x7')](_0xc9ab('0xf'),auth['isAuthenticated'](),controller[_0xc9ab('0x10')]);router[_0xc9ab('0x7')](_0xc9ab('0x11'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x12')]);router['get'](_0xc9ab('0x13'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x14')]);router[_0xc9ab('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc9ab('0x15')](_0xc9ab('0x16'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x17')]);router[_0xc9ab('0x15')](_0xc9ab('0x18'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x19')]);router[_0xc9ab('0x15')]('/:id/fields',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x1a')]);router[_0xc9ab('0x15')](_0xc9ab('0x13'),auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x1b')]);router[_0xc9ab('0x1c')]('/:id',auth[_0xc9ab('0x8')](),controller[_0xc9ab('0x1d')]);router[_0xc9ab('0x1e')](_0xc9ab('0x1f'),auth[_0xc9ab('0x8')](),controller['destroy']);router[_0xc9ab('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc9ab('0x20')]);router[_0xc9ab('0x1e')](_0xc9ab('0x13'),auth['isAuthenticated'](),controller[_0xc9ab('0x21')]);module[_0xc9ab('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 557d7ca..b4db670 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 _0x2d62=['STRING','sequelize','exports','getDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2d62,0xc1));var _0x22d6=function(_0x53bf25,_0x2a04b6){_0x53bf25=_0x53bf25-0x0;var _0x3630c6=_0x2d62[_0x53bf25];return _0x3630c6;};'use strict';var Sequelize=require(_0x22d6('0x0'));module[_0x22d6('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x139962){return this[_0x22d6('0x2')]('field');}},'field':{'type':Sequelize[_0x22d6('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x22d6('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x22d6('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x19c5=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0x41ca86,_0xa74542){var _0x4d3676=function(_0x270634){while(--_0x270634){_0x41ca86['push'](_0x41ca86['shift']());}};_0x4d3676(++_0xa74542);}(_0x19c5,0x89));var _0x519c=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x19c5[_0x5e6cb8];return _0x3faeb3;};'use strict';var Sequelize=require('sequelize');module[_0x519c('0x0')]={'name':{'type':Sequelize[_0x519c('0x1')],'get':function(_0x15e518){return this[_0x519c('0x2')](_0x519c('0x3'));}},'field':{'type':Sequelize[_0x519c('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x519c('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x519c('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 838ee43..ed277a1 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3b8f00,_0x3714ce){var _0x540410=function(_0x2d5260){while(--_0x2d5260){_0x3b8f00['push'](_0x3b8f00['shift']());}};_0x540410(++_0x3714ce);}(_0x7a54,0x106));var _0x47a5=function(_0x84b6bb,_0x58485c){_0x84b6bb=_0x84b6bb-0x0;var _0x4195bf=_0x7a54[_0x84b6bb];return _0x4195bf;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x431128,_0x2ec391){var _0x5b327e=function(_0x50f295){while(--_0x50f295){_0x431128['push'](_0x431128['shift']());}};_0x5b327e(++_0x2ec391);}(_0x7a54,0x106));var _0x47a5=function(_0x2da352,_0x3d96ad){_0x2da352=_0x2da352-0x0;var _0x33bafd=_0x7a54[_0x2da352];return _0x33bafd;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 1eaec43..fd2f73a 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 _0xa7df=['path','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','api','moment','bluebird'];(function(_0x1494a8,_0x4e05a0){var _0x31d57a=function(_0x41657e){while(--_0x41657e){_0x1494a8['push'](_0x1494a8['shift']());}};_0x31d57a(++_0x4e05a0);}(_0xa7df,0x17c));var _0xfa7d=function(_0x1a6fdd,_0x4e79fb){_0x1a6fdd=_0x1a6fdd-0x0;var _0x5f3d59=_0xa7df[_0x1a6fdd];return _0x5f3d59;};'use strict';var _=require(_0xfa7d('0x0'));var util=require(_0xfa7d('0x1'));var logger=require('../../config/logger')(_0xfa7d('0x2'));var moment=require(_0xfa7d('0x3'));var BPromise=require(_0xfa7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa7d('0x5'));var rimraf=require(_0xfa7d('0x6'));var config=require(_0xfa7d('0x7'));var attributes=require(_0xfa7d('0x8'));module['exports']=function(_0x57c5c9,_0x4322bb){return _0x57c5c9['define'](_0xfa7d('0x9'),attributes,{'tableName':_0xfa7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32d9=['moment','request-promise','rimraf','./condition.attributes','Condition','lodash','util','../../config/logger'];(function(_0x3ed495,_0x145ec6){var _0x21fe10=function(_0x167c14){while(--_0x167c14){_0x3ed495['push'](_0x3ed495['shift']());}};_0x21fe10(++_0x145ec6);}(_0x32d9,0xb5));var _0x932d=function(_0x1b0569,_0x1d4a6b){_0x1b0569=_0x1b0569-0x0;var _0x5df4c3=_0x32d9[_0x1b0569];return _0x5df4c3;};'use strict';var _=require(_0x932d('0x0'));var util=require(_0x932d('0x1'));var logger=require(_0x932d('0x2'))('api');var moment=require(_0x932d('0x3'));var BPromise=require('bluebird');var rp=require(_0x932d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x932d('0x5'));var config=require('../../config/environment');var attributes=require(_0x932d('0x6'));module['exports']=function(_0x5bb48e,_0x57e20e){return _0x5bb48e['define'](_0x932d('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 49c208a..b3a71bd 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 _0x95ca=['rpc','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe124a5,_0x53aed4){var _0x567a51=function(_0xc8159c){while(--_0xc8159c){_0xe124a5['push'](_0xe124a5['shift']());}};_0x567a51(++_0x53aed4);}(_0x95ca,0x14a));var _0xa95c=function(_0x314b9d,_0xb552dd){_0x314b9d=_0x314b9d-0x0;var _0x602312=_0x95ca[_0x314b9d];return _0x602312;};'use strict';var _=require(_0xa95c('0x0'));var util=require(_0xa95c('0x1'));var moment=require(_0xa95c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa95c('0x3'))['db'];var utils=require(_0xa95c('0x4'));var logger=require(_0xa95c('0x5'))(_0xa95c('0x6'));var config=require('../../config/environment');var jayson=require(_0xa95c('0x7'));var client=jayson[_0xa95c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52b3dd,_0x10f70b,_0x4fd8c1){return new BPromise(function(_0x50bac9,_0x5885b){return client['request'](_0x52b3dd,_0x4fd8c1)[_0xa95c('0x9')](function(_0x20da51){logger[_0xa95c('0xa')](_0xa95c('0xb'),_0x10f70b,_0xa95c('0xc'));logger[_0xa95c('0xd')](_0xa95c('0xe'),_0x10f70b,_0xa95c('0xc'),JSON[_0xa95c('0xf')](_0x20da51));if(_0x20da51['error']){if(_0x20da51[_0xa95c('0x10')][_0xa95c('0x11')]===0x1f4){logger[_0xa95c('0x10')](_0xa95c('0xb'),_0x10f70b,_0x20da51[_0xa95c('0x10')][_0xa95c('0x12')]);return _0x5885b(_0x20da51[_0xa95c('0x10')][_0xa95c('0x12')]);}logger['error'](_0xa95c('0xb'),_0x10f70b,_0x20da51['error'][_0xa95c('0x12')]);return _0x50bac9(_0x20da51['error'][_0xa95c('0x12')]);}else{logger[_0xa95c('0xa')]('Condition,\x20%s,\x20%s',_0x10f70b,'request\x20sent');_0x50bac9(_0x20da51[_0xa95c('0x13')]['message']);}})[_0xa95c('0x14')](function(_0x1111e7){logger[_0xa95c('0x10')](_0xa95c('0xb'),_0x10f70b,_0x1111e7);_0x5885b(_0x1111e7);});});} \ No newline at end of file +var _0x4690=['client','http','request','then','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x436bfb,_0x1f0207){var _0x6dcb8e=function(_0x1ce93c){while(--_0x1ce93c){_0x436bfb['push'](_0x436bfb['shift']());}};_0x6dcb8e(++_0x1f0207);}(_0x4690,0x119));var _0x0469=function(_0x2d16af,_0x3a404e){_0x2d16af=_0x2d16af-0x0;var _0x34e67c=_0x4690[_0x2d16af];return _0x34e67c;};'use strict';var _=require(_0x0469('0x0'));var util=require(_0x0469('0x1'));var moment=require(_0x0469('0x2'));var BPromise=require(_0x0469('0x3'));var rs=require(_0x0469('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0469('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0469('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0469('0x7')][_0x0469('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18c77d,_0x13dd75,_0x3d2b91){return new BPromise(function(_0x4f4140,_0x5561e2){return client[_0x0469('0x9')](_0x18c77d,_0x3d2b91)[_0x0469('0xa')](function(_0xfcf4be){logger[_0x0469('0xb')](_0x0469('0xc'),_0x13dd75,'request\x20sent');logger['debug'](_0x0469('0xd'),_0x13dd75,_0x0469('0xe'),JSON['stringify'](_0xfcf4be));if(_0xfcf4be[_0x0469('0xf')]){if(_0xfcf4be[_0x0469('0xf')][_0x0469('0x10')]===0x1f4){logger[_0x0469('0xf')](_0x0469('0xc'),_0x13dd75,_0xfcf4be[_0x0469('0xf')][_0x0469('0x11')]);return _0x5561e2(_0xfcf4be[_0x0469('0xf')]['message']);}logger[_0x0469('0xf')](_0x0469('0xc'),_0x13dd75,_0xfcf4be[_0x0469('0xf')][_0x0469('0x11')]);return _0x4f4140(_0xfcf4be['error'][_0x0469('0x11')]);}else{logger['info'](_0x0469('0xc'),_0x13dd75,_0x0469('0xe'));_0x4f4140(_0xfcf4be['result'][_0x0469('0x11')]);}})['catch'](function(_0x48b165){logger[_0x0469('0xf')](_0x0469('0xc'),_0x13dd75,_0x48b165);_0x5561e2(_0x48b165);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a268bb1..8c0fa39 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 _0x44ee=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller'];(function(_0x268b0d,_0x5a2929){var _0x36264b=function(_0x45e078){while(--_0x45e078){_0x268b0d['push'](_0x268b0d['shift']());}};_0x36264b(++_0x5a2929);}(_0x44ee,0x1e7));var _0xe44e=function(_0x49d687,_0x3951ab){_0x49d687=_0x49d687-0x0;var _0x25fa32=_0x44ee[_0x49d687];return _0x25fa32;};'use strict';var multer=require(_0xe44e('0x0'));var util=require(_0xe44e('0x1'));var path=require(_0xe44e('0x2'));var timeout=require('connect-timeout');var express=require(_0xe44e('0x3'));var router=express[_0xe44e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe44e('0x5'));var interaction=require(_0xe44e('0x6'));var config=require('../../config/environment');var controller=require(_0xe44e('0x7'));router[_0xe44e('0x8')](_0xe44e('0x9'),auth[_0xe44e('0xa')](),controller[_0xe44e('0xb')]);router[_0xe44e('0xc')](_0xe44e('0x9'),auth['isAuthenticated'](),controller[_0xe44e('0xd')]);module[_0xe44e('0xe')]=router; \ No newline at end of file +var _0xb630=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x394427,_0x2f5d2c){var _0x5f3b2b=function(_0x58167f){while(--_0x58167f){_0x394427['push'](_0x394427['shift']());}};_0x5f3b2b(++_0x2f5d2c);}(_0xb630,0xbe));var _0x0b63=function(_0x54ab1f,_0x1585d6){_0x54ab1f=_0x54ab1f-0x0;var _0x24c869=_0xb630[_0x54ab1f];return _0x24c869;};'use strict';var multer=require(_0x0b63('0x0'));var util=require(_0x0b63('0x1'));var path=require(_0x0b63('0x2'));var timeout=require(_0x0b63('0x3'));var express=require(_0x0b63('0x4'));var router=express[_0x0b63('0x5')]();var fs_extra=require(_0x0b63('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0b63('0x7'));var config=require('../../config/environment');var controller=require(_0x0b63('0x8'));router[_0x0b63('0x9')](_0x0b63('0xa'),auth[_0x0b63('0xb')](),controller[_0x0b63('0xc')]);router[_0x0b63('0xd')](_0x0b63('0xa'),auth['isAuthenticated'](),controller[_0x0b63('0xe')]);module[_0x0b63('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 a948b23..9567c34 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x21ad46,_0x2f9603){var _0x367873=function(_0x579f19){while(--_0x579f19){_0x21ad46['push'](_0x21ad46['shift']());}};_0x367873(++_0x2f9603);}(_0xb10b,0x12a));var _0xbb10=function(_0xfd084b,_0x26977e){_0xfd084b=_0xfd084b-0x0;var _0x375d60=_0xb10b[_0xfd084b];return _0x375d60;};'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 _0x0713=['STRING','name'];(function(_0x160582,_0x451d94){var _0x4cf348=function(_0x342118){while(--_0x342118){_0x160582['push'](_0x160582['shift']());}};_0x4cf348(++_0x451d94);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 30de3c2..0656005 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 _0xca4a=['omit','createdAt','updatedAt','UserProfileSection','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x38baac,_0x2772b3){var _0x47baf1=function(_0x5646a8){while(--_0x5646a8){_0x38baac['push'](_0x38baac['shift']());}};_0x47baf1(++_0x2772b3);}(_0xca4a,0xae));var _0xaca4=function(_0x3ff33f,_0x41d12c){_0x3ff33f=_0x3ff33f-0x0;var _0x3d1398=_0xca4a[_0x3ff33f];return _0x3d1398;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaca4('0x0'));var zipdir=require(_0xaca4('0x1'));var jsonpatch=require(_0xaca4('0x2'));var rp=require('request-promise');var moment=require(_0xaca4('0x3'));var BPromise=require(_0xaca4('0x4'));var Mustache=require(_0xaca4('0x5'));var util=require('util');var path=require(_0xaca4('0x6'));var sox=require(_0xaca4('0x7'));var csv=require(_0xaca4('0x8'));var ejs=require(_0xaca4('0x9'));var fs=require('fs');var fs_extra=require(_0xaca4('0xa'));var _=require(_0xaca4('0xb'));var squel=require(_0xaca4('0xc'));var crypto=require(_0xaca4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaca4('0xe'));var toCsv=require(_0xaca4('0x8'));var querystring=require(_0xaca4('0xf'));var Papa=require(_0xaca4('0x10'));var Redis=require(_0xaca4('0x11'));var authService=require(_0xaca4('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaca4('0x13'));var logger=require(_0xaca4('0x14'))(_0xaca4('0x15'));var utils=require(_0xaca4('0x16'));var config=require(_0xaca4('0x17'));var licenseUtil=require(_0xaca4('0x18'));var db=require(_0xaca4('0x19'))['db'];config[_0xaca4('0x1a')]=_[_0xaca4('0x1b')](config[_0xaca4('0x1a')],{'host':_0xaca4('0x1c'),'port':0x18eb});var socket=require(_0xaca4('0x1d'))(new Redis(config[_0xaca4('0x1a')]));require(_0xaca4('0x1e'))[_0xaca4('0x1f')](socket);function respondWithStatusCode(_0x30961c,_0x2e930e){_0x2e930e=_0x2e930e||0xcc;return function(_0x3f1200){if(_0x3f1200){return _0x30961c[_0xaca4('0x20')](_0x2e930e);}return _0x30961c[_0xaca4('0x21')](_0x2e930e)[_0xaca4('0x22')]();};}function respondWithResult(_0x2dce14,_0x4e5e65){_0x4e5e65=_0x4e5e65||0xc8;return function(_0x4aefd7){if(_0x4aefd7){return _0x2dce14[_0xaca4('0x21')](_0x4e5e65)[_0xaca4('0x23')](_0x4aefd7);}};}function respondWithFilteredResult(_0x538346,_0x546585){return function(_0x38de4f){if(_0x38de4f){var _0x16bdfc=typeof _0x546585[_0xaca4('0x24')]==='undefined'&&typeof _0x546585[_0xaca4('0x25')]===_0xaca4('0x26');var _0x379d39=_0x38de4f[_0xaca4('0x27')];var _0x2bdfb4=_0x16bdfc?0x0:_0x546585[_0xaca4('0x24')];var _0x3c6382=_0x16bdfc?_0x38de4f['count']:_0x546585['offset']+_0x546585[_0xaca4('0x25')];var _0x1988e2;if(_0x3c6382>=_0x379d39){_0x3c6382=_0x379d39;_0x1988e2=0xc8;}else{_0x1988e2=0xce;}_0x538346[_0xaca4('0x21')](_0x1988e2);return _0x538346['set'](_0xaca4('0x28'),_0x2bdfb4+'-'+_0x3c6382+'/'+_0x379d39)['json'](_0x38de4f);}return null;};}function patchUpdates(_0x10830a){return function(_0x584c00){try{jsonpatch[_0xaca4('0x29')](_0x584c00,_0x10830a,!![]);}catch(_0x318ad6){return BPromise[_0xaca4('0x2a')](_0x318ad6);}return _0x584c00[_0xaca4('0x2b')]();};}function saveUpdates(_0x3a12ea,_0x59ebd0){return function(_0x807258){if(_0x807258){return _0x807258[_0xaca4('0x2c')](_0x3a12ea)['then'](function(_0x30f4b5){return _0x30f4b5;});}return null;};}function removeEntity(_0x2673f8,_0x416232){return function(_0x6bcba){if(_0x6bcba){return _0x6bcba[_0xaca4('0x2d')]()[_0xaca4('0x2e')](function(){var _0x3d4b65=_0x6bcba['get']({'plain':!![]});var _0x3cf5d7=_0xaca4('0x2f');return db[_0xaca4('0x30')][_0xaca4('0x2d')]({'where':{'type':_0x3cf5d7,'resourceId':_0x3d4b65['id']}})['then'](function(){return _0x6bcba;});})[_0xaca4('0x2e')](function(){_0x2673f8[_0xaca4('0x21')](0xcc)[_0xaca4('0x22')]();});}};}function handleEntityNotFound(_0x1397e5,_0xa0632d){return function(_0x2c5cb7){if(!_0x2c5cb7){_0x1397e5[_0xaca4('0x20')](0x194);}return _0x2c5cb7;};}function handleError(_0x56732a,_0xf859ea){_0xf859ea=_0xf859ea||0x1f4;return function(_0x4d37b7){logger[_0xaca4('0x31')](_0x4d37b7[_0xaca4('0x32')]);if(_0x4d37b7[_0xaca4('0x33')]){delete _0x4d37b7['name'];}_0x56732a[_0xaca4('0x21')](_0xf859ea)['send'](_0x4d37b7);};}exports[_0xaca4('0x34')]=function(_0x99ad10,_0x202a7f){var _0x724345={},_0x38678b={},_0x1e5dfc={'count':0x0,'rows':[]};var _0x36652e=_[_0xaca4('0x35')](db[_0xaca4('0x36')][_0xaca4('0x37')],function(_0x4c142a){return{'name':_0x4c142a[_0xaca4('0x38')],'type':_0x4c142a[_0xaca4('0x39')][_0xaca4('0x3a')]};});_0x38678b[_0xaca4('0x3b')]=_[_0xaca4('0x35')](_0x36652e,_0xaca4('0x33'));_0x38678b['query']=_[_0xaca4('0x3c')](_0x99ad10[_0xaca4('0x3d')]);_0x38678b[_0xaca4('0x3e')]=_[_0xaca4('0x3f')](_0x38678b['model'],_0x38678b[_0xaca4('0x3d')]);_0x724345['attributes']=_[_0xaca4('0x3f')](_0x38678b['model'],qs['fields'](_0x99ad10['query'][_0xaca4('0x40')]));_0x724345[_0xaca4('0x41')]=_0x724345[_0xaca4('0x41')]['length']?_0x724345[_0xaca4('0x41')]:_0x38678b[_0xaca4('0x3b')];if(!_0x99ad10['query'][_0xaca4('0x42')](_0xaca4('0x43'))){_0x724345[_0xaca4('0x25')]=qs['limit'](_0x99ad10[_0xaca4('0x3d')][_0xaca4('0x25')]);_0x724345[_0xaca4('0x24')]=qs[_0xaca4('0x24')](_0x99ad10[_0xaca4('0x3d')]['offset']);}_0x724345[_0xaca4('0x44')]=qs[_0xaca4('0x45')](_0x99ad10[_0xaca4('0x3d')]['sort']);_0x724345[_0xaca4('0x46')]=qs['filters'](_[_0xaca4('0x47')](_0x99ad10[_0xaca4('0x3d')],_0x38678b[_0xaca4('0x3e')]),_0x36652e);if(_0x99ad10[_0xaca4('0x3d')][_0xaca4('0x48')]){_0x724345[_0xaca4('0x46')]=_[_0xaca4('0x49')](_0x724345[_0xaca4('0x46')],{'$or':_[_0xaca4('0x35')](_0x36652e,function(_0xc7370a){if(_0xc7370a[_0xaca4('0x39')]!==_0xaca4('0x4a')){var _0x4846a5={};_0x4846a5[_0xc7370a[_0xaca4('0x33')]]={'$like':'%'+_0x99ad10[_0xaca4('0x3d')][_0xaca4('0x48')]+'%'};return _0x4846a5;}})});}_0x724345=_['merge']({},_0x724345,_0x99ad10['options']);var _0x3e1f3d={'where':_0x724345[_0xaca4('0x46')]};return db[_0xaca4('0x36')][_0xaca4('0x27')](_0x3e1f3d)['then'](function(_0x1c4de7){_0x1e5dfc[_0xaca4('0x27')]=_0x1c4de7;if(_0x99ad10[_0xaca4('0x3d')][_0xaca4('0x4b')]){_0x724345[_0xaca4('0x4c')]=[{'all':!![]}];}return db[_0xaca4('0x36')][_0xaca4('0x4d')](_0x724345);})[_0xaca4('0x2e')](function(_0xe4fe80){_0x1e5dfc[_0xaca4('0x4e')]=_0xe4fe80;return _0x1e5dfc;})[_0xaca4('0x2e')](respondWithFilteredResult(_0x202a7f,_0x724345))['catch'](handleError(_0x202a7f,null));};exports[_0xaca4('0x4f')]=function(_0x1539e6,_0x21ea2c){var _0x4b9302={'raw':![],'where':{'id':_0x1539e6[_0xaca4('0x50')]['id']}},_0x2efa9a={};_0x2efa9a['model']=_[_0xaca4('0x3c')](db[_0xaca4('0x36')]['rawAttributes']);_0x2efa9a[_0xaca4('0x3d')]=_[_0xaca4('0x3c')](_0x1539e6['query']);_0x2efa9a[_0xaca4('0x3e')]=_['intersection'](_0x2efa9a[_0xaca4('0x3b')],_0x2efa9a[_0xaca4('0x3d')]);_0x4b9302[_0xaca4('0x41')]=_[_0xaca4('0x3f')](_0x2efa9a[_0xaca4('0x3b')],qs[_0xaca4('0x40')](_0x1539e6['query']['fields']));_0x4b9302['attributes']=_0x4b9302['attributes'][_0xaca4('0x51')]?_0x4b9302[_0xaca4('0x41')]:_0x2efa9a[_0xaca4('0x3b')];if(_0x1539e6['query'][_0xaca4('0x4b')]){_0x4b9302[_0xaca4('0x4c')]=[{'all':!![]}];}_0x4b9302=_[_0xaca4('0x49')]({},_0x4b9302,_0x1539e6[_0xaca4('0x52')]);return db[_0xaca4('0x36')][_0xaca4('0x53')](_0x4b9302)[_0xaca4('0x2e')](handleEntityNotFound(_0x21ea2c,null))[_0xaca4('0x2e')](respondWithResult(_0x21ea2c,null))[_0xaca4('0x54')](handleError(_0x21ea2c,null));};exports[_0xaca4('0x55')]=function(_0x75eea3,_0x34f5b1){return db['Dashboard'][_0xaca4('0x55')](_0x75eea3[_0xaca4('0x56')],{})[_0xaca4('0x2e')](function(_0x65c0b9){var _0x2992ce=_0x75eea3[_0xaca4('0x57')][_0xaca4('0x58')]({'plain':!![]});if(!_0x2992ce)throw new Error(_0xaca4('0x59'));if(_0x2992ce['role']===_0xaca4('0x57')){var _0x2e8bcc=_0x65c0b9[_0xaca4('0x58')]({'plain':!![]});var _0x5c9462='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x5c9462,'userProfileId':_0x2992ce['userProfileId']},'raw':!![]})[_0xaca4('0x2e')](function(_0x2376b5){if(_0x2376b5&&_0x2376b5[_0xaca4('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e8bcc['name'],'resourceId':_0x2e8bcc['id'],'type':_0x2376b5[_0xaca4('0x33')],'sectionId':_0x2376b5['id']},{})[_0xaca4('0x2e')](function(){return _0x65c0b9;});}else{return _0x65c0b9;}})[_0xaca4('0x54')](function(_0x32bb79){logger[_0xaca4('0x31')](_0xaca4('0x5b'),_0x32bb79);throw _0x32bb79;});}return _0x65c0b9;})['then'](respondWithResult(_0x34f5b1,0xc9))[_0xaca4('0x54')](handleError(_0x34f5b1,null));};exports['clone']=function(_0x4c10d6,_0x67a0ff){var _0x5d8591={'where':{'id':_0x4c10d6[_0xaca4('0x50')]['id']}},_0x294009={};_0x294009[_0xaca4('0x3b')]=_['keys'](db[_0xaca4('0x36')][_0xaca4('0x37')]);_0x5d8591['attributes']=_[_0xaca4('0x3f')](_0x294009[_0xaca4('0x3b')],qs[_0xaca4('0x40')](_0x4c10d6[_0xaca4('0x3d')]['fields']));_0x5d8591['attributes']=_0x5d8591[_0xaca4('0x41')]['length']?_0x5d8591[_0xaca4('0x41')]:_0x294009['model'];if(_0x4c10d6[_0xaca4('0x3d')][_0xaca4('0x4b')]){_0x5d8591[_0xaca4('0x4c')]=[{'all':!![]}];}_0x5d8591=_['merge']({},_0x5d8591,_0x4c10d6[_0xaca4('0x52')]);return db[_0xaca4('0x36')]['find'](_0x5d8591)['then'](handleEntityNotFound(_0x67a0ff,null))[_0xaca4('0x2e')](function(_0x2eb0ed){if(_0x2eb0ed){var _0x4f986e=_0x2eb0ed[_0xaca4('0x58')]({'plain':!![]});_0x4f986e=qs[_0xaca4('0x5c')](_0x4f986e,['id',_0xaca4('0x5d'),_0xaca4('0x5e')]);_0x4c10d6[_0xaca4('0x56')]=_['omit'](_0x4c10d6[_0xaca4('0x56')],['id','createdAt',_0xaca4('0x5e')]);return db['Dashboard'][_0xaca4('0x55')](_['merge'](_0x4f986e,_0x4c10d6[_0xaca4('0x56')]),{'include':_0x4c10d6['query'][_0xaca4('0x4b')]?[{'all':!![]}]:undefined})[_0xaca4('0x2e')](function(_0x493b4c){var _0x1c4c79=_0x4c10d6[_0xaca4('0x57')]['get']({'plain':!![]});if(!_0x1c4c79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c4c79['role']===_0xaca4('0x57')){var _0x36e522=_0x493b4c['get']({'plain':!![]});var _0x39c96b=_0xaca4('0x2f');return db[_0xaca4('0x5f')][_0xaca4('0x53')]({'where':{'name':_0x39c96b,'userProfileId':_0x1c4c79[_0xaca4('0x60')]},'raw':!![]})[_0xaca4('0x2e')](function(_0x3c1d0b){if(_0x3c1d0b&&_0x3c1d0b[_0xaca4('0x5a')]===0x0){return db[_0xaca4('0x30')][_0xaca4('0x55')]({'name':_0x36e522['name'],'resourceId':_0x36e522['id'],'type':_0x3c1d0b['name'],'sectionId':_0x3c1d0b['id']},{})['then'](function(){return _0x493b4c;});}else{return _0x493b4c;}})[_0xaca4('0x54')](function(_0x327783){logger[_0xaca4('0x31')](_0xaca4('0x5b'),_0x327783);throw _0x327783;});}return _0x493b4c;});}})['then'](respondWithResult(_0x67a0ff,0xc9))[_0xaca4('0x54')](handleError(_0x67a0ff,null));};exports[_0xaca4('0x2c')]=function(_0x315185,_0x1aefdc){if(_0x315185[_0xaca4('0x56')]['id']){delete _0x315185['body']['id'];}return db[_0xaca4('0x36')][_0xaca4('0x53')]({'where':{'id':_0x315185[_0xaca4('0x50')]['id']}})[_0xaca4('0x2e')](handleEntityNotFound(_0x1aefdc,null))[_0xaca4('0x2e')](saveUpdates(_0x315185[_0xaca4('0x56')],null))[_0xaca4('0x2e')](respondWithResult(_0x1aefdc,null))[_0xaca4('0x54')](handleError(_0x1aefdc,null));};exports[_0xaca4('0x2d')]=function(_0x34a84f,_0x4f3c6a){return db[_0xaca4('0x36')]['find']({'where':{'id':_0x34a84f['params']['id']}})[_0xaca4('0x2e')](handleEntityNotFound(_0x4f3c6a,null))[_0xaca4('0x2e')](removeEntity(_0x4f3c6a,null))[_0xaca4('0x54')](handleError(_0x4f3c6a,null));};function widgetAttributes(_0xa09059){try{switch(_0xa09059[_0xaca4('0x39')]){case _0xaca4('0x61'):return[{'name':_0xaca4('0x62'),'value':_0xa09059[_0xaca4('0x62')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059[_0xaca4('0x63')][0x0][_0xaca4('0x64')]:undefined)||_0xaca4('0x65')}];case _0xaca4('0x66'):return[{'name':_0xaca4('0x67'),'value':_0xa09059[_0xaca4('0x67')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059['attrs'][0x0][_0xaca4('0x64')]:undefined)||''}];case _0xaca4('0x68'):return[{'name':'attrHourFormat','value':_0xa09059['attrHourFormat']||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059[_0xaca4('0x63')][0x0]['value']:undefined)||_0xaca4('0x69')},{'name':'attrTimezone','value':_0xa09059[_0xaca4('0x6a')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059['attrs'][0x1]?_0xa09059[_0xaca4('0x63')][0x1]['value']:undefined)||'0.00'},{'name':_0xaca4('0x6b'),'value':_0xa09059[_0xaca4('0x6b')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x2]?_0xa09059[_0xaca4('0x63')][0x2][_0xaca4('0x64')]:undefined)||0xc}];case'counter':return[{'name':_0xaca4('0x6c'),'value':_0xa09059['attrMetric']||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059[_0xaca4('0x63')][0x0][_0xaca4('0x64')]:undefined)||'total'},{'name':_0xaca4('0x6d'),'value':_0xa09059['attrVoiceQueues']||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x1]?_0xa09059[_0xaca4('0x63')][0x1][_0xaca4('0x64')]:undefined)||[]},{'name':_0xaca4('0x6b'),'value':_0xa09059[_0xaca4('0x6b')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x2]?_0xa09059[_0xaca4('0x63')][0x2][_0xaca4('0x64')]:undefined)||0x14},{'name':_0xaca4('0x6e'),'value':_0xa09059['attrChannel']||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x3]?_0xa09059['attrs'][0x3][_0xaca4('0x64')]:undefined)||'voice'},{'name':_0xaca4('0x6f'),'value':_0xa09059[_0xaca4('0x6f')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x4]?_0xa09059['attrs'][0x4]['value']:undefined)||''},{'name':_0xaca4('0x70'),'value':_0xa09059['attrFaxAccounts']||(_0xa09059['attrs']&&_0xa09059[_0xaca4('0x63')][0x5]?_0xa09059['attrs'][0x5][_0xaca4('0x64')]:undefined)||''},{'name':_0xaca4('0x71'),'value':_0xa09059[_0xaca4('0x71')]||(_0xa09059['attrs']&&_0xa09059[_0xaca4('0x63')][0x6]?_0xa09059[_0xaca4('0x63')][0x6][_0xaca4('0x64')]:undefined)||''},{'name':_0xaca4('0x72'),'value':_0xa09059[_0xaca4('0x72')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x7]?_0xa09059[_0xaca4('0x63')][0x7][_0xaca4('0x64')]:undefined)||''},{'name':_0xaca4('0x73'),'value':_0xa09059[_0xaca4('0x73')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x8]?_0xa09059[_0xaca4('0x63')][0x8][_0xaca4('0x64')]:undefined)||''},{'name':_0xaca4('0x74'),'value':_0xa09059[_0xaca4('0x74')]||(_0xa09059['attrs']&&_0xa09059[_0xaca4('0x63')][0x9]?_0xa09059['attrs'][0x9][_0xaca4('0x64')]:undefined)||''}];case _0xaca4('0x75'):case _0xaca4('0x76'):return[{'name':_0xaca4('0x77'),'value':_0xa09059[_0xaca4('0x77')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059[_0xaca4('0x63')][0x0][_0xaca4('0x64')]:undefined)||'total'},{'name':'attrSerie2','value':_0xa09059[_0xaca4('0x78')]||(_0xa09059['attrs']&&_0xa09059[_0xaca4('0x63')][0x1]?_0xa09059['attrs'][0x1][_0xaca4('0x64')]:undefined)||null},{'name':'attrSerie3','value':_0xa09059[_0xaca4('0x79')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x2]?_0xa09059[_0xaca4('0x63')][0x2][_0xaca4('0x64')]:undefined)||null},{'name':_0xaca4('0x6d'),'value':_0xa09059[_0xaca4('0x6d')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x3]?_0xa09059['attrs'][0x3][_0xaca4('0x64')]:undefined)||[]},{'name':_0xaca4('0x6e'),'value':_0xa09059[_0xaca4('0x6e')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x4]?_0xa09059[_0xaca4('0x63')][0x4][_0xaca4('0x64')]:undefined)||'voice'},{'name':_0xaca4('0x6f'),'value':_0xa09059[_0xaca4('0x6f')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x5]?_0xa09059[_0xaca4('0x63')][0x5][_0xaca4('0x64')]:undefined)||''},{'name':_0xaca4('0x70'),'value':_0xa09059[_0xaca4('0x70')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x6]?_0xa09059['attrs'][0x6]['value']:undefined)||''},{'name':_0xaca4('0x71'),'value':_0xa09059[_0xaca4('0x71')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x7]?_0xa09059[_0xaca4('0x63')][0x7]['value']:undefined)||''},{'name':_0xaca4('0x72'),'value':_0xa09059[_0xaca4('0x72')]||(_0xa09059['attrs']&&_0xa09059['attrs'][0x8]?_0xa09059[_0xaca4('0x63')][0x8]['value']:undefined)||''},{'name':_0xaca4('0x73'),'value':_0xa09059[_0xaca4('0x73')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x9]?_0xa09059[_0xaca4('0x63')][0x9]['value']:undefined)||''},{'name':_0xaca4('0x74'),'value':_0xa09059['attrChatWebsites']||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0xa]?_0xa09059['attrs'][0xa]['value']:undefined)||''}];case _0xaca4('0x7a'):return[{'name':_0xaca4('0x7b'),'type':_0xa09059[_0xaca4('0x7c')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059['attrs'][0x0][_0xaca4('0x39')]:undefined)||null,'value':_0xa09059[_0xaca4('0x7b')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x0]?_0xa09059[_0xaca4('0x63')][0x0][_0xaca4('0x64')]:undefined)||null},{'name':_0xaca4('0x7d'),'value':_0xa09059[_0xaca4('0x7d')]||(_0xa09059[_0xaca4('0x63')]&&_0xa09059[_0xaca4('0x63')][0x1]?_0xa09059[_0xaca4('0x63')][0x1][_0xaca4('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x137302){logger[_0xaca4('0x31')](_0xaca4('0x7e'),JSON[_0xaca4('0x7f')](_0x137302));return[];}}exports[_0xaca4('0x80')]=function(_0x131cf9,_0x28c78b,_0x5bfd54){if(_0x131cf9[_0xaca4('0x56')]['id']){delete _0x131cf9[_0xaca4('0x56')]['id'];}return db[_0xaca4('0x36')][_0xaca4('0x53')]({'where':{'id':_0x131cf9[_0xaca4('0x50')]['id']}})[_0xaca4('0x2e')](handleEntityNotFound(_0x28c78b,null))[_0xaca4('0x2e')](function(_0x2b18c3){if(_0x2b18c3){_0x131cf9[_0xaca4('0x56')][_0xaca4('0x81')]=_0x2b18c3['id'];_0x131cf9[_0xaca4('0x56')][_0xaca4('0x63')]=widgetAttributes(_0x131cf9[_0xaca4('0x56')]);return db[_0xaca4('0x82')][_0xaca4('0x55')](_0x131cf9[_0xaca4('0x56')]);}})['then'](respondWithResult(_0x28c78b,null))[_0xaca4('0x54')](handleError(_0x28c78b,null));};exports[_0xaca4('0x83')]=function(_0x291b2e,_0x3e3681,_0x460bd2){var _0x2f52d9={};var _0xa0a21c={};var _0x363fd8;var _0x4823e4;return db[_0xaca4('0x36')][_0xaca4('0x84')]({'where':{'id':_0x291b2e[_0xaca4('0x50')]['id']}})[_0xaca4('0x2e')](handleEntityNotFound(_0x3e3681,null))[_0xaca4('0x2e')](function(_0xfd3266){if(_0xfd3266){_0x363fd8=_0xfd3266;_0xa0a21c[_0xaca4('0x3b')]=_[_0xaca4('0x3c')](db[_0xaca4('0x82')][_0xaca4('0x37')]);_0xa0a21c[_0xaca4('0x3d')]=_[_0xaca4('0x3c')](_0x291b2e[_0xaca4('0x3d')]);_0xa0a21c['filters']=_[_0xaca4('0x3f')](_0xa0a21c[_0xaca4('0x3b')],_0xa0a21c['query']);_0x2f52d9[_0xaca4('0x41')]=_['intersection'](_0xa0a21c[_0xaca4('0x3b')],qs[_0xaca4('0x40')](_0x291b2e[_0xaca4('0x3d')]['fields']));_0x2f52d9[_0xaca4('0x41')]=_0x2f52d9[_0xaca4('0x41')][_0xaca4('0x51')]?_0x2f52d9[_0xaca4('0x41')]:_0xa0a21c[_0xaca4('0x3b')];_0x2f52d9['order']=qs[_0xaca4('0x45')](_0x291b2e['query'][_0xaca4('0x45')]);_0x2f52d9['where']=qs['filters'](_['pick'](_0x291b2e['query'],_0xa0a21c[_0xaca4('0x3e')]));if(_0x291b2e[_0xaca4('0x3d')][_0xaca4('0x48')]){_0x2f52d9['where']=_['merge'](_0x2f52d9['where'],{'$or':_[_0xaca4('0x35')](_0x2f52d9[_0xaca4('0x41')],function(_0x36512b){var _0x3fd009={};_0x3fd009[_0x36512b]={'$like':'%'+_0x291b2e[_0xaca4('0x3d')][_0xaca4('0x48')]+'%'};return _0x3fd009;})});}_0x2f52d9=_[_0xaca4('0x49')]({},_0x2f52d9,_0x291b2e['options']);return _0x363fd8[_0xaca4('0x83')](_0x2f52d9);}})[_0xaca4('0x2e')](function(_0x2a43cb){if(_0x2a43cb){_0x4823e4=_0x2a43cb['length'];if(!_0x291b2e['query'][_0xaca4('0x42')]('nolimit')){_0x2f52d9[_0xaca4('0x25')]=qs[_0xaca4('0x25')](_0x291b2e[_0xaca4('0x3d')][_0xaca4('0x25')]);_0x2f52d9['offset']=qs[_0xaca4('0x24')](_0x291b2e['query'][_0xaca4('0x24')]);}return _0x363fd8[_0xaca4('0x83')](_0x2f52d9);}})['then'](function(_0x2a44a8){if(_0x2a44a8){return _0x2a44a8?{'count':_0x4823e4,'rows':_0x2a44a8}:null;}})[_0xaca4('0x2e')](respondWithResult(_0x3e3681,null))[_0xaca4('0x54')](handleError(_0x3e3681,null));}; \ No newline at end of file +var _0xe254=['attrSerie2','attrSerie3','voice','web-report','attrReport','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','json','offset','undefined','limit','count','status','set','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','Dashboard','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','createdAt','omit','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1'];(function(_0x202053,_0x199f83){var _0x4a3ab8=function(_0x3cf085){while(--_0x3cf085){_0x202053['push'](_0x202053['shift']());}};_0x4a3ab8(++_0x199f83);}(_0xe254,0x86));var _0x4e25=function(_0x2f4ae1,_0xb42ea5){_0x2f4ae1=_0x2f4ae1-0x0;var _0x159912=_0xe254[_0x2f4ae1];return _0x159912;};'use strict';var emlformat=require(_0x4e25('0x0'));var rimraf=require(_0x4e25('0x1'));var zipdir=require(_0x4e25('0x2'));var jsonpatch=require(_0x4e25('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4e25('0x4'));var util=require(_0x4e25('0x5'));var path=require('path');var sox=require(_0x4e25('0x6'));var csv=require(_0x4e25('0x7'));var ejs=require(_0x4e25('0x8'));var fs=require('fs');var fs_extra=require(_0x4e25('0x9'));var _=require(_0x4e25('0xa'));var squel=require('squel');var crypto=require(_0x4e25('0xb'));var jsforce=require(_0x4e25('0xc'));var deskjs=require(_0x4e25('0xd'));var toCsv=require(_0x4e25('0x7'));var querystring=require(_0x4e25('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4e25('0xf'));var qs=require(_0x4e25('0x10'));var as=require(_0x4e25('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e25('0x12'));var utils=require(_0x4e25('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4e25('0x14'));var db=require(_0x4e25('0x15'))['db'];config['redis']=_[_0x4e25('0x16')](config[_0x4e25('0x17')],{'host':_0x4e25('0x18'),'port':0x18eb});var socket=require(_0x4e25('0x19'))(new Redis(config[_0x4e25('0x17')]));require(_0x4e25('0x1a'))[_0x4e25('0x1b')](socket);function respondWithStatusCode(_0xdd1288,_0x50d67e){_0x50d67e=_0x50d67e||0xcc;return function(_0x12fee8){if(_0x12fee8){return _0xdd1288[_0x4e25('0x1c')](_0x50d67e);}return _0xdd1288['status'](_0x50d67e)['end']();};}function respondWithResult(_0x117630,_0x148a96){_0x148a96=_0x148a96||0xc8;return function(_0x4b7d38){if(_0x4b7d38){return _0x117630['status'](_0x148a96)[_0x4e25('0x1d')](_0x4b7d38);}};}function respondWithFilteredResult(_0x1cca6f,_0x314b92){return function(_0x3caeb5){if(_0x3caeb5){var _0x2c2b06=typeof _0x314b92[_0x4e25('0x1e')]===_0x4e25('0x1f')&&typeof _0x314b92[_0x4e25('0x20')]===_0x4e25('0x1f');var _0x416337=_0x3caeb5['count'];var _0x2dd7e2=_0x2c2b06?0x0:_0x314b92[_0x4e25('0x1e')];var _0x49de1c=_0x2c2b06?_0x3caeb5[_0x4e25('0x21')]:_0x314b92[_0x4e25('0x1e')]+_0x314b92[_0x4e25('0x20')];var _0x51e5e8;if(_0x49de1c>=_0x416337){_0x49de1c=_0x416337;_0x51e5e8=0xc8;}else{_0x51e5e8=0xce;}_0x1cca6f[_0x4e25('0x22')](_0x51e5e8);return _0x1cca6f[_0x4e25('0x23')]('Content-Range',_0x2dd7e2+'-'+_0x49de1c+'/'+_0x416337)[_0x4e25('0x1d')](_0x3caeb5);}return null;};}function patchUpdates(_0x38ab99){return function(_0x3017cf){try{jsonpatch['apply'](_0x3017cf,_0x38ab99,!![]);}catch(_0x54238b){return BPromise[_0x4e25('0x24')](_0x54238b);}return _0x3017cf[_0x4e25('0x25')]();};}function saveUpdates(_0x4bca76,_0x2b1a56){return function(_0x273265){if(_0x273265){return _0x273265[_0x4e25('0x26')](_0x4bca76)['then'](function(_0x5c1247){return _0x5c1247;});}return null;};}function removeEntity(_0x552107,_0x12f958){return function(_0x2ec998){if(_0x2ec998){return _0x2ec998[_0x4e25('0x27')]()[_0x4e25('0x28')](function(){var _0x23dc81=_0x2ec998[_0x4e25('0x29')]({'plain':!![]});var _0x5388d8=_0x4e25('0x2a');return db[_0x4e25('0x2b')][_0x4e25('0x27')]({'where':{'type':_0x5388d8,'resourceId':_0x23dc81['id']}})[_0x4e25('0x28')](function(){return _0x2ec998;});})[_0x4e25('0x28')](function(){_0x552107['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cab71,_0xe45159){return function(_0x3fb776){if(!_0x3fb776){_0x3cab71[_0x4e25('0x1c')](0x194);}return _0x3fb776;};}function handleError(_0x38a259,_0xb8d184){_0xb8d184=_0xb8d184||0x1f4;return function(_0x386f20){logger[_0x4e25('0x2c')](_0x386f20[_0x4e25('0x2d')]);if(_0x386f20[_0x4e25('0x2e')]){delete _0x386f20[_0x4e25('0x2e')];}_0x38a259[_0x4e25('0x22')](_0xb8d184)[_0x4e25('0x2f')](_0x386f20);};}exports[_0x4e25('0x30')]=function(_0x2befa0,_0x3bc12c){var _0x30dac1={},_0x3700f0={},_0x278e04={'count':0x0,'rows':[]};var _0x47f9e8=_[_0x4e25('0x31')](db['Dashboard'][_0x4e25('0x32')],function(_0x10471d){return{'name':_0x10471d[_0x4e25('0x33')],'type':_0x10471d[_0x4e25('0x34')][_0x4e25('0x35')]};});_0x3700f0[_0x4e25('0x36')]=_['map'](_0x47f9e8,'name');_0x3700f0[_0x4e25('0x37')]=_[_0x4e25('0x38')](_0x2befa0[_0x4e25('0x37')]);_0x3700f0[_0x4e25('0x39')]=_[_0x4e25('0x3a')](_0x3700f0[_0x4e25('0x36')],_0x3700f0['query']);_0x30dac1[_0x4e25('0x3b')]=_[_0x4e25('0x3a')](_0x3700f0['model'],qs[_0x4e25('0x3c')](_0x2befa0[_0x4e25('0x37')]['fields']));_0x30dac1[_0x4e25('0x3b')]=_0x30dac1[_0x4e25('0x3b')][_0x4e25('0x3d')]?_0x30dac1['attributes']:_0x3700f0['model'];if(!_0x2befa0[_0x4e25('0x37')][_0x4e25('0x3e')](_0x4e25('0x3f'))){_0x30dac1[_0x4e25('0x20')]=qs['limit'](_0x2befa0[_0x4e25('0x37')][_0x4e25('0x20')]);_0x30dac1[_0x4e25('0x1e')]=qs['offset'](_0x2befa0[_0x4e25('0x37')][_0x4e25('0x1e')]);}_0x30dac1[_0x4e25('0x40')]=qs['sort'](_0x2befa0[_0x4e25('0x37')][_0x4e25('0x41')]);_0x30dac1['where']=qs[_0x4e25('0x39')](_['pick'](_0x2befa0[_0x4e25('0x37')],_0x3700f0[_0x4e25('0x39')]),_0x47f9e8);if(_0x2befa0[_0x4e25('0x37')][_0x4e25('0x42')]){_0x30dac1['where']=_[_0x4e25('0x43')](_0x30dac1[_0x4e25('0x44')],{'$or':_[_0x4e25('0x31')](_0x47f9e8,function(_0x104ff6){if(_0x104ff6[_0x4e25('0x34')]!==_0x4e25('0x45')){var _0x3d3391={};_0x3d3391[_0x104ff6[_0x4e25('0x2e')]]={'$like':'%'+_0x2befa0[_0x4e25('0x37')][_0x4e25('0x42')]+'%'};return _0x3d3391;}})});}_0x30dac1=_[_0x4e25('0x43')]({},_0x30dac1,_0x2befa0[_0x4e25('0x46')]);var _0x25050f={'where':_0x30dac1[_0x4e25('0x44')]};return db[_0x4e25('0x47')]['count'](_0x25050f)[_0x4e25('0x28')](function(_0x32e284){_0x278e04[_0x4e25('0x21')]=_0x32e284;if(_0x2befa0[_0x4e25('0x37')][_0x4e25('0x48')]){_0x30dac1[_0x4e25('0x49')]=[{'all':!![]}];}return db[_0x4e25('0x47')]['findAll'](_0x30dac1);})['then'](function(_0x527fe4){_0x278e04[_0x4e25('0x4a')]=_0x527fe4;return _0x278e04;})[_0x4e25('0x28')](respondWithFilteredResult(_0x3bc12c,_0x30dac1))['catch'](handleError(_0x3bc12c,null));};exports[_0x4e25('0x4b')]=function(_0x4a2b01,_0x33e975){var _0xdffdd6={'raw':![],'where':{'id':_0x4a2b01[_0x4e25('0x4c')]['id']}},_0x21819c={};_0x21819c['model']=_['keys'](db[_0x4e25('0x47')][_0x4e25('0x32')]);_0x21819c[_0x4e25('0x37')]=_[_0x4e25('0x38')](_0x4a2b01['query']);_0x21819c['filters']=_[_0x4e25('0x3a')](_0x21819c[_0x4e25('0x36')],_0x21819c[_0x4e25('0x37')]);_0xdffdd6['attributes']=_[_0x4e25('0x3a')](_0x21819c[_0x4e25('0x36')],qs[_0x4e25('0x3c')](_0x4a2b01[_0x4e25('0x37')][_0x4e25('0x3c')]));_0xdffdd6[_0x4e25('0x3b')]=_0xdffdd6[_0x4e25('0x3b')]['length']?_0xdffdd6[_0x4e25('0x3b')]:_0x21819c[_0x4e25('0x36')];if(_0x4a2b01[_0x4e25('0x37')][_0x4e25('0x48')]){_0xdffdd6[_0x4e25('0x49')]=[{'all':!![]}];}_0xdffdd6=_[_0x4e25('0x43')]({},_0xdffdd6,_0x4a2b01[_0x4e25('0x46')]);return db[_0x4e25('0x47')][_0x4e25('0x4d')](_0xdffdd6)[_0x4e25('0x28')](handleEntityNotFound(_0x33e975,null))[_0x4e25('0x28')](respondWithResult(_0x33e975,null))[_0x4e25('0x4e')](handleError(_0x33e975,null));};exports['create']=function(_0x32b7e,_0x160ca0){return db[_0x4e25('0x47')][_0x4e25('0x4f')](_0x32b7e[_0x4e25('0x50')],{})[_0x4e25('0x28')](function(_0x411c8c){var _0x543fd3=_0x32b7e[_0x4e25('0x51')][_0x4e25('0x29')]({'plain':!![]});if(!_0x543fd3)throw new Error(_0x4e25('0x52'));if(_0x543fd3[_0x4e25('0x53')]===_0x4e25('0x51')){var _0x147a00=_0x411c8c['get']({'plain':!![]});var _0x5e198d='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x5e198d,'userProfileId':_0x543fd3[_0x4e25('0x54')]},'raw':!![]})[_0x4e25('0x28')](function(_0x159e78){if(_0x159e78&&_0x159e78['autoAssociation']===0x0){return db[_0x4e25('0x2b')][_0x4e25('0x4f')]({'name':_0x147a00['name'],'resourceId':_0x147a00['id'],'type':_0x159e78['name'],'sectionId':_0x159e78['id']},{})[_0x4e25('0x28')](function(){return _0x411c8c;});}else{return _0x411c8c;}})[_0x4e25('0x4e')](function(_0x504b19){logger[_0x4e25('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x504b19);throw _0x504b19;});}return _0x411c8c;})['then'](respondWithResult(_0x160ca0,0xc9))[_0x4e25('0x4e')](handleError(_0x160ca0,null));};exports['clone']=function(_0x46a8d4,_0x1cebdf){var _0x28b7e4={'where':{'id':_0x46a8d4[_0x4e25('0x4c')]['id']}},_0x292ab3={};_0x292ab3[_0x4e25('0x36')]=_[_0x4e25('0x38')](db[_0x4e25('0x47')][_0x4e25('0x32')]);_0x28b7e4['attributes']=_[_0x4e25('0x3a')](_0x292ab3[_0x4e25('0x36')],qs[_0x4e25('0x3c')](_0x46a8d4[_0x4e25('0x37')]['fields']));_0x28b7e4[_0x4e25('0x3b')]=_0x28b7e4[_0x4e25('0x3b')]['length']?_0x28b7e4['attributes']:_0x292ab3[_0x4e25('0x36')];if(_0x46a8d4[_0x4e25('0x37')][_0x4e25('0x48')]){_0x28b7e4[_0x4e25('0x49')]=[{'all':!![]}];}_0x28b7e4=_[_0x4e25('0x43')]({},_0x28b7e4,_0x46a8d4['options']);return db[_0x4e25('0x47')][_0x4e25('0x4d')](_0x28b7e4)[_0x4e25('0x28')](handleEntityNotFound(_0x1cebdf,null))[_0x4e25('0x28')](function(_0x2dfc96){if(_0x2dfc96){var _0x2f44fc=_0x2dfc96[_0x4e25('0x29')]({'plain':!![]});_0x2f44fc=qs['omit'](_0x2f44fc,['id',_0x4e25('0x55'),'updatedAt']);_0x46a8d4[_0x4e25('0x50')]=_[_0x4e25('0x56')](_0x46a8d4[_0x4e25('0x50')],['id',_0x4e25('0x55'),_0x4e25('0x57')]);return db[_0x4e25('0x47')][_0x4e25('0x4f')](_['merge'](_0x2f44fc,_0x46a8d4[_0x4e25('0x50')]),{'include':_0x46a8d4[_0x4e25('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x4e25('0x28')](function(_0x1afc15){var _0x529e2f=_0x46a8d4[_0x4e25('0x51')]['get']({'plain':!![]});if(!_0x529e2f)throw new Error(_0x4e25('0x52'));if(_0x529e2f[_0x4e25('0x53')]===_0x4e25('0x51')){var _0x50b1b3=_0x1afc15['get']({'plain':!![]});var _0x28ce69=_0x4e25('0x2a');return db[_0x4e25('0x58')][_0x4e25('0x4d')]({'where':{'name':_0x28ce69,'userProfileId':_0x529e2f['userProfileId']},'raw':!![]})['then'](function(_0x4dd2e9){if(_0x4dd2e9&&_0x4dd2e9[_0x4e25('0x59')]===0x0){return db[_0x4e25('0x2b')][_0x4e25('0x4f')]({'name':_0x50b1b3[_0x4e25('0x2e')],'resourceId':_0x50b1b3['id'],'type':_0x4dd2e9[_0x4e25('0x2e')],'sectionId':_0x4dd2e9['id']},{})[_0x4e25('0x28')](function(){return _0x1afc15;});}else{return _0x1afc15;}})[_0x4e25('0x4e')](function(_0x4f1822){logger['error'](_0x4e25('0x5a'),_0x4f1822);throw _0x4f1822;});}return _0x1afc15;});}})[_0x4e25('0x28')](respondWithResult(_0x1cebdf,0xc9))[_0x4e25('0x4e')](handleError(_0x1cebdf,null));};exports[_0x4e25('0x26')]=function(_0x1743a4,_0x180160){if(_0x1743a4[_0x4e25('0x50')]['id']){delete _0x1743a4[_0x4e25('0x50')]['id'];}return db['Dashboard'][_0x4e25('0x4d')]({'where':{'id':_0x1743a4[_0x4e25('0x4c')]['id']}})[_0x4e25('0x28')](handleEntityNotFound(_0x180160,null))[_0x4e25('0x28')](saveUpdates(_0x1743a4[_0x4e25('0x50')],null))[_0x4e25('0x28')](respondWithResult(_0x180160,null))['catch'](handleError(_0x180160,null));};exports[_0x4e25('0x27')]=function(_0x20bac3,_0x54b722){return db[_0x4e25('0x47')][_0x4e25('0x4d')]({'where':{'id':_0x20bac3[_0x4e25('0x4c')]['id']}})[_0x4e25('0x28')](handleEntityNotFound(_0x54b722,null))[_0x4e25('0x28')](removeEntity(_0x54b722,null))[_0x4e25('0x4e')](handleError(_0x54b722,null));};function widgetAttributes(_0x31ee0f){try{switch(_0x31ee0f[_0x4e25('0x34')]){case _0x4e25('0x5b'):return[{'name':'attrUrl','value':_0x31ee0f['attrUrl']||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f['attrs'][0x0][_0x4e25('0x5d')]:undefined)||'https://'}];case _0x4e25('0x5e'):return[{'name':_0x4e25('0x5f'),'value':_0x31ee0f['attrPath']||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f[_0x4e25('0x5c')][0x0][_0x4e25('0x5d')]:undefined)||''}];case _0x4e25('0x60'):return[{'name':'attrHourFormat','value':_0x31ee0f[_0x4e25('0x61')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f['attrs'][0x0][_0x4e25('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0x4e25('0x62'),'value':_0x31ee0f[_0x4e25('0x62')]||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x1]?_0x31ee0f[_0x4e25('0x5c')][0x1][_0x4e25('0x5d')]:undefined)||_0x4e25('0x63')},{'name':'attrFontSize','value':_0x31ee0f[_0x4e25('0x64')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x2]?_0x31ee0f[_0x4e25('0x5c')][0x2]['value']:undefined)||0xc}];case _0x4e25('0x65'):return[{'name':'attrMetric','value':_0x31ee0f[_0x4e25('0x66')]||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f[_0x4e25('0x5c')][0x0][_0x4e25('0x5d')]:undefined)||'total'},{'name':_0x4e25('0x67'),'value':_0x31ee0f[_0x4e25('0x67')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x1]?_0x31ee0f['attrs'][0x1][_0x4e25('0x5d')]:undefined)||[]},{'name':_0x4e25('0x64'),'value':_0x31ee0f['attrFontSize']||(_0x31ee0f['attrs']&&_0x31ee0f['attrs'][0x2]?_0x31ee0f[_0x4e25('0x5c')][0x2][_0x4e25('0x5d')]:undefined)||0x14},{'name':_0x4e25('0x68'),'value':_0x31ee0f[_0x4e25('0x68')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x3]?_0x31ee0f[_0x4e25('0x5c')][0x3][_0x4e25('0x5d')]:undefined)||'voice'},{'name':_0x4e25('0x69'),'value':_0x31ee0f[_0x4e25('0x69')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x4]?_0x31ee0f[_0x4e25('0x5c')][0x4][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6a'),'value':_0x31ee0f[_0x4e25('0x6a')]||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x5]?_0x31ee0f[_0x4e25('0x5c')][0x5]['value']:undefined)||''},{'name':_0x4e25('0x6b'),'value':_0x31ee0f[_0x4e25('0x6b')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f['attrs'][0x6]?_0x31ee0f['attrs'][0x6]['value']:undefined)||''},{'name':_0x4e25('0x6c'),'value':_0x31ee0f[_0x4e25('0x6c')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x7]?_0x31ee0f[_0x4e25('0x5c')][0x7][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6d'),'value':_0x31ee0f[_0x4e25('0x6d')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x8]?_0x31ee0f['attrs'][0x8][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6e'),'value':_0x31ee0f[_0x4e25('0x6e')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x9]?_0x31ee0f[_0x4e25('0x5c')][0x9][_0x4e25('0x5d')]:undefined)||''}];case _0x4e25('0x6f'):case _0x4e25('0x70'):return[{'name':_0x4e25('0x71'),'value':_0x31ee0f[_0x4e25('0x71')]||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f[_0x4e25('0x5c')][0x0][_0x4e25('0x5d')]:undefined)||'total'},{'name':_0x4e25('0x72'),'value':_0x31ee0f[_0x4e25('0x72')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x1]?_0x31ee0f[_0x4e25('0x5c')][0x1]['value']:undefined)||null},{'name':_0x4e25('0x73'),'value':_0x31ee0f[_0x4e25('0x73')]||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x2]?_0x31ee0f['attrs'][0x2][_0x4e25('0x5d')]:undefined)||null},{'name':_0x4e25('0x67'),'value':_0x31ee0f[_0x4e25('0x67')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x3]?_0x31ee0f[_0x4e25('0x5c')][0x3][_0x4e25('0x5d')]:undefined)||[]},{'name':_0x4e25('0x68'),'value':_0x31ee0f[_0x4e25('0x68')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f['attrs'][0x4]?_0x31ee0f[_0x4e25('0x5c')][0x4]['value']:undefined)||_0x4e25('0x74')},{'name':'attrEmailAccounts','value':_0x31ee0f['attrEmailAccounts']||(_0x31ee0f['attrs']&&_0x31ee0f[_0x4e25('0x5c')][0x5]?_0x31ee0f['attrs'][0x5][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6a'),'value':_0x31ee0f[_0x4e25('0x6a')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x6]?_0x31ee0f[_0x4e25('0x5c')][0x6]['value']:undefined)||''},{'name':_0x4e25('0x6b'),'value':_0x31ee0f[_0x4e25('0x6b')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x7]?_0x31ee0f['attrs'][0x7][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6c'),'value':_0x31ee0f[_0x4e25('0x6c')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x8]?_0x31ee0f[_0x4e25('0x5c')][0x8]['value']:undefined)||''},{'name':_0x4e25('0x6d'),'value':_0x31ee0f[_0x4e25('0x6d')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x9]?_0x31ee0f[_0x4e25('0x5c')][0x9][_0x4e25('0x5d')]:undefined)||''},{'name':_0x4e25('0x6e'),'value':_0x31ee0f[_0x4e25('0x6e')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f['attrs'][0xa]?_0x31ee0f[_0x4e25('0x5c')][0xa][_0x4e25('0x5d')]:undefined)||''}];case _0x4e25('0x75'):return[{'name':_0x4e25('0x76'),'type':_0x31ee0f['reportType']||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f['attrs'][0x0]['type']:undefined)||null,'value':_0x31ee0f[_0x4e25('0x76')]||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f[_0x4e25('0x5c')][0x0]?_0x31ee0f[_0x4e25('0x5c')][0x0][_0x4e25('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x31ee0f['attrRefresh']||(_0x31ee0f[_0x4e25('0x5c')]&&_0x31ee0f['attrs'][0x1]?_0x31ee0f[_0x4e25('0x5c')][0x1][_0x4e25('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x5c7976){logger['error'](_0x4e25('0x77'),JSON[_0x4e25('0x78')](_0x5c7976));return[];}}exports['addItem']=function(_0x4a8f5f,_0x196505,_0x457695){if(_0x4a8f5f['body']['id']){delete _0x4a8f5f[_0x4e25('0x50')]['id'];}return db['Dashboard'][_0x4e25('0x4d')]({'where':{'id':_0x4a8f5f[_0x4e25('0x4c')]['id']}})[_0x4e25('0x28')](handleEntityNotFound(_0x196505,null))[_0x4e25('0x28')](function(_0x42f508){if(_0x42f508){_0x4a8f5f[_0x4e25('0x50')]['DashboardId']=_0x42f508['id'];_0x4a8f5f[_0x4e25('0x50')]['attrs']=widgetAttributes(_0x4a8f5f[_0x4e25('0x50')]);return db[_0x4e25('0x79')][_0x4e25('0x4f')](_0x4a8f5f[_0x4e25('0x50')]);}})[_0x4e25('0x28')](respondWithResult(_0x196505,null))['catch'](handleError(_0x196505,null));};exports[_0x4e25('0x7a')]=function(_0x5bcd42,_0x1036a9,_0x2fa4ce){var _0x5c05aa={};var _0xb9bbbd={};var _0x2f9dae;var _0x493d4e;return db[_0x4e25('0x47')][_0x4e25('0x7b')]({'where':{'id':_0x5bcd42[_0x4e25('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1036a9,null))[_0x4e25('0x28')](function(_0x5b5f85){if(_0x5b5f85){_0x2f9dae=_0x5b5f85;_0xb9bbbd[_0x4e25('0x36')]=_[_0x4e25('0x38')](db[_0x4e25('0x79')][_0x4e25('0x32')]);_0xb9bbbd[_0x4e25('0x37')]=_[_0x4e25('0x38')](_0x5bcd42[_0x4e25('0x37')]);_0xb9bbbd[_0x4e25('0x39')]=_[_0x4e25('0x3a')](_0xb9bbbd[_0x4e25('0x36')],_0xb9bbbd[_0x4e25('0x37')]);_0x5c05aa[_0x4e25('0x3b')]=_[_0x4e25('0x3a')](_0xb9bbbd[_0x4e25('0x36')],qs['fields'](_0x5bcd42[_0x4e25('0x37')][_0x4e25('0x3c')]));_0x5c05aa['attributes']=_0x5c05aa['attributes'][_0x4e25('0x3d')]?_0x5c05aa[_0x4e25('0x3b')]:_0xb9bbbd['model'];_0x5c05aa['order']=qs['sort'](_0x5bcd42[_0x4e25('0x37')][_0x4e25('0x41')]);_0x5c05aa['where']=qs['filters'](_['pick'](_0x5bcd42[_0x4e25('0x37')],_0xb9bbbd[_0x4e25('0x39')]));if(_0x5bcd42[_0x4e25('0x37')][_0x4e25('0x42')]){_0x5c05aa[_0x4e25('0x44')]=_['merge'](_0x5c05aa[_0x4e25('0x44')],{'$or':_[_0x4e25('0x31')](_0x5c05aa[_0x4e25('0x3b')],function(_0x10da61){var _0x56af8d={};_0x56af8d[_0x10da61]={'$like':'%'+_0x5bcd42['query'][_0x4e25('0x42')]+'%'};return _0x56af8d;})});}_0x5c05aa=_[_0x4e25('0x43')]({},_0x5c05aa,_0x5bcd42[_0x4e25('0x46')]);return _0x2f9dae[_0x4e25('0x7a')](_0x5c05aa);}})['then'](function(_0x499927){if(_0x499927){_0x493d4e=_0x499927['length'];if(!_0x5bcd42['query'][_0x4e25('0x3e')](_0x4e25('0x3f'))){_0x5c05aa[_0x4e25('0x20')]=qs[_0x4e25('0x20')](_0x5bcd42[_0x4e25('0x37')][_0x4e25('0x20')]);_0x5c05aa[_0x4e25('0x1e')]=qs[_0x4e25('0x1e')](_0x5bcd42['query'][_0x4e25('0x1e')]);}return _0x2f9dae[_0x4e25('0x7a')](_0x5c05aa);}})[_0x4e25('0x28')](function(_0x34e7f2){if(_0x34e7f2){return _0x34e7f2?{'count':_0x493d4e,'rows':_0x34e7f2}:null;}})['then'](respondWithResult(_0x1036a9,null))['catch'](handleError(_0x1036a9,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 021b4ef..5e4b86a 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 _0x9f7a=['hasOwnProperty','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x2a5bb7,_0x3a0bf3){var _0x503330=function(_0x61d76b){while(--_0x61d76b){_0x2a5bb7['push'](_0x2a5bb7['shift']());}};_0x503330(++_0x3a0bf3);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x9f7a[_0x87b0ff];return _0x3bc0b2;};'use strict';var EventEmitter=require(_0xa9f7('0x0'));var Dashboard=require(_0xa9f7('0x1'))['db'][_0xa9f7('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa9f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d188f){return function(_0x59823f,_0x22dbdd,_0x44545d){DashboardEvents['emit'](_0x4d188f+':'+_0x59823f['id'],_0x59823f);DashboardEvents['emit'](_0x4d188f,_0x59823f);_0x44545d(null);};}for(var e in events){if(events[_0xa9f7('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xc27c=['events','../../mysqldb','Dashboard','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0xc27c,0x129));var _0xcc27=function(_0x5c0bca,_0x4e23dd){_0x5c0bca=_0x5c0bca-0x0;var _0x505743=_0xc27c[_0x5c0bca];return _0x505743;};'use strict';var EventEmitter=require(_0xcc27('0x0'));var Dashboard=require(_0xcc27('0x1'))['db'][_0xcc27('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc27('0x3'),'afterDestroy':_0xcc27('0x4')};function emitEvent(_0x1d4aff){return function(_0x1325f5,_0x4d4866,_0x304c61){DashboardEvents[_0xcc27('0x5')](_0x1d4aff+':'+_0x1325f5['id'],_0x1325f5);DashboardEvents[_0xcc27('0x5')](_0x1d4aff,_0x1325f5);_0x304c61(null);};}for(var e in events){if(events[_0xcc27('0x6')](e)){var event=events[e];Dashboard[_0xcc27('0x7')](e,emitEvent(event));}}module[_0xcc27('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 aada624..7d5a731 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 _0xe4ed=['bluebird','request-promise','path','../../config/environment','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0xff6648,_0x40608e){var _0x2b6b96=function(_0x145031){while(--_0x145031){_0xff6648['push'](_0xff6648['shift']());}};_0x2b6b96(++_0x40608e);}(_0xe4ed,0x114));var _0xde4e=function(_0x5f4b54,_0x17ec2b){_0x5f4b54=_0x5f4b54-0x0;var _0x3fddfe=_0xe4ed[_0x5f4b54];return _0x3fddfe;};'use strict';var _=require(_0xde4e('0x0'));var util=require(_0xde4e('0x1'));var logger=require(_0xde4e('0x2'))(_0xde4e('0x3'));var moment=require('moment');var BPromise=require(_0xde4e('0x4'));var rp=require(_0xde4e('0x5'));var fs=require('fs');var path=require(_0xde4e('0x6'));var rimraf=require('rimraf');var config=require(_0xde4e('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x5e17cf,_0x4e1822){return _0x5e17cf['define'](_0xde4e('0x8'),attributes,{'tableName':_0xde4e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ef=['path','rimraf','../../config/environment','exports','../../config/logger'];(function(_0x486c64,_0x22b69c){var _0x3cc8f1=function(_0x1d5bff){while(--_0x1d5bff){_0x486c64['push'](_0x486c64['shift']());}};_0x3cc8f1(++_0x22b69c);}(_0x06ef,0x185));var _0xf06e=function(_0x13c715,_0x363c1d){_0x13c715=_0x13c715-0x0;var _0x5785b2=_0x06ef[_0x13c715];return _0x5785b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf06e('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf06e('0x1'));var rimraf=require(_0xf06e('0x2'));var config=require(_0xf06e('0x3'));var attributes=require('./dashboard.attributes');module[_0xf06e('0x4')]=function(_0x71a36,_0x4be428){return _0x71a36['define']('Dashboard',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 c763e31..db75305 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 _0x977c=['Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19eb6a,_0x3f2b51){var _0x49160d=function(_0x10a495){while(--_0x10a495){_0x19eb6a['push'](_0x19eb6a['shift']());}};_0x49160d(++_0x3f2b51);}(_0x977c,0x132));var _0xc977=function(_0x37df68,_0x1169ae){_0x37df68=_0x37df68-0x0;var _0x30c8f9=_0x977c[_0x37df68];return _0x30c8f9;};'use strict';var _=require(_0xc977('0x0'));var util=require(_0xc977('0x1'));var moment=require(_0xc977('0x2'));var BPromise=require(_0xc977('0x3'));var rs=require(_0xc977('0x4'));var fs=require('fs');var Redis=require(_0xc977('0x5'));var db=require(_0xc977('0x6'))['db'];var utils=require(_0xc977('0x7'));var logger=require(_0xc977('0x8'))(_0xc977('0x9'));var config=require(_0xc977('0xa'));var jayson=require(_0xc977('0xb'));var client=jayson[_0xc977('0xc')][_0xc977('0xd')]({'port':0x232a});config[_0xc977('0xe')]=_['defaults'](config[_0xc977('0xe')],{'host':_0xc977('0xf'),'port':0x18eb});var socket=require(_0xc977('0x10'))(new Redis(config[_0xc977('0xe')]));require(_0xc977('0x11'))[_0xc977('0x12')](socket);function respondWithRpcPromise(_0x35a01b,_0x2254be,_0x305b8c){return new BPromise(function(_0x3b8028,_0x58cff9){return client['request'](_0x35a01b,_0x305b8c)[_0xc977('0x13')](function(_0x40df10){logger[_0xc977('0x14')](_0xc977('0x15'),_0x2254be,_0xc977('0x16'));logger[_0xc977('0x17')](_0xc977('0x18'),_0x2254be,_0xc977('0x16'),JSON['stringify'](_0x40df10));if(_0x40df10[_0xc977('0x19')]){if(_0x40df10[_0xc977('0x19')][_0xc977('0x1a')]===0x1f4){logger[_0xc977('0x19')](_0xc977('0x15'),_0x2254be,_0x40df10[_0xc977('0x19')][_0xc977('0x1b')]);return _0x58cff9(_0x40df10['error'][_0xc977('0x1b')]);}logger['error'](_0xc977('0x15'),_0x2254be,_0x40df10[_0xc977('0x19')][_0xc977('0x1b')]);return _0x3b8028(_0x40df10[_0xc977('0x19')][_0xc977('0x1b')]);}else{logger[_0xc977('0x14')](_0xc977('0x15'),_0x2254be,_0xc977('0x16'));_0x3b8028(_0x40df10[_0xc977('0x1c')][_0xc977('0x1b')]);}})[_0xc977('0x1d')](function(_0x4a0425){logger[_0xc977('0x19')](_0xc977('0x15'),_0x2254be,_0x4a0425);_0x58cff9(_0x4a0425);});});} \ No newline at end of file +var _0xfd15=['request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x2f8d26,_0x320773){var _0x57f618=function(_0x58b6db){while(--_0x58b6db){_0x2f8d26['push'](_0x2f8d26['shift']());}};_0x57f618(++_0x320773);}(_0xfd15,0x192));var _0x5fd1=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfd15[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x5fd1('0x0'));var moment=require(_0x5fd1('0x1'));var BPromise=require('bluebird');var rs=require(_0x5fd1('0x2'));var fs=require('fs');var Redis=require(_0x5fd1('0x3'));var db=require(_0x5fd1('0x4'))['db'];var utils=require(_0x5fd1('0x5'));var logger=require(_0x5fd1('0x6'))(_0x5fd1('0x7'));var config=require(_0x5fd1('0x8'));var jayson=require(_0x5fd1('0x9'));var client=jayson[_0x5fd1('0xa')][_0x5fd1('0xb')]({'port':0x232a});config['redis']=_[_0x5fd1('0xc')](config[_0x5fd1('0xd')],{'host':_0x5fd1('0xe'),'port':0x18eb});var socket=require(_0x5fd1('0xf'))(new Redis(config[_0x5fd1('0xd')]));require(_0x5fd1('0x10'))[_0x5fd1('0x11')](socket);function respondWithRpcPromise(_0x2f698c,_0x4384bb,_0x2d3bab){return new BPromise(function(_0x566d8d,_0x423e78){return client[_0x5fd1('0x12')](_0x2f698c,_0x2d3bab)['then'](function(_0x226dba){logger[_0x5fd1('0x13')](_0x5fd1('0x14'),_0x4384bb,_0x5fd1('0x15'));logger[_0x5fd1('0x16')](_0x5fd1('0x17'),_0x4384bb,_0x5fd1('0x15'),JSON[_0x5fd1('0x18')](_0x226dba));if(_0x226dba['error']){if(_0x226dba['error'][_0x5fd1('0x19')]===0x1f4){logger[_0x5fd1('0x1a')]('Dashboard,\x20%s,\x20%s',_0x4384bb,_0x226dba[_0x5fd1('0x1a')][_0x5fd1('0x1b')]);return _0x423e78(_0x226dba[_0x5fd1('0x1a')][_0x5fd1('0x1b')]);}logger['error'](_0x5fd1('0x14'),_0x4384bb,_0x226dba[_0x5fd1('0x1a')]['message']);return _0x566d8d(_0x226dba[_0x5fd1('0x1a')][_0x5fd1('0x1b')]);}else{logger[_0x5fd1('0x13')](_0x5fd1('0x14'),_0x4384bb,_0x5fd1('0x15'));_0x566d8d(_0x226dba[_0x5fd1('0x1c')][_0x5fd1('0x1b')]);}})[_0x5fd1('0x1d')](function(_0x206d5f){logger[_0x5fd1('0x1a')](_0x5fd1('0x14'),_0x4384bb,_0x206d5f);_0x423e78(_0x206d5f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ddb8ee5..7e3184e 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 _0x43d8=['remove','update','emit','removeListener','register','length','./dashboard.events','save'];(function(_0x5eaa8a,_0x396d27){var _0x558bc8=function(_0x38e99d){while(--_0x38e99d){_0x5eaa8a['push'](_0x5eaa8a['shift']());}};_0x558bc8(++_0x396d27);}(_0x43d8,0x1ce));var _0x843d=function(_0x111614,_0x4a7ac4){_0x111614=_0x111614-0x0;var _0x2c958e=_0x43d8[_0x111614];return _0x2c958e;};'use strict';var DashboardEvents=require(_0x843d('0x0'));var events=[_0x843d('0x1'),_0x843d('0x2'),_0x843d('0x3')];function createListener(_0x3250e5,_0x7532a){return function(_0x40130f){_0x7532a[_0x843d('0x4')](_0x3250e5,_0x40130f);};}function removeListener(_0x5d677e,_0x5a51cd){return function(){DashboardEvents[_0x843d('0x5')](_0x5d677e,_0x5a51cd);};}exports[_0x843d('0x6')]=function(_0x4fc74b){for(var _0x2b48d4=0x0,_0x526d61=events[_0x843d('0x7')];_0x2b48d4<_0x526d61;_0x2b48d4++){var _0x1d76ea=events[_0x2b48d4];var _0x9336ff=createListener('dashboard:'+_0x1d76ea,_0x4fc74b);DashboardEvents['on'](_0x1d76ea,_0x9336ff);}}; \ No newline at end of file +var _0xe21d=['dashboard:','./dashboard.events','remove','emit','register','length'];(function(_0x2e1795,_0x154782){var _0x514ff3=function(_0x152b71){while(--_0x152b71){_0x2e1795['push'](_0x2e1795['shift']());}};_0x514ff3(++_0x154782);}(_0xe21d,0x181));var _0xde21=function(_0x482186,_0x2ce84c){_0x482186=_0x482186-0x0;var _0xc60592=_0xe21d[_0x482186];return _0xc60592;};'use strict';var DashboardEvents=require(_0xde21('0x0'));var events=['save',_0xde21('0x1'),'update'];function createListener(_0x30d8b4,_0x16239c){return function(_0xdc428f){_0x16239c[_0xde21('0x2')](_0x30d8b4,_0xdc428f);};}function removeListener(_0x1a791f,_0x2e1766){return function(){DashboardEvents['removeListener'](_0x1a791f,_0x2e1766);};}exports[_0xde21('0x3')]=function(_0x5504e8){for(var _0x442f50=0x0,_0x170fd9=events[_0xde21('0x4')];_0x442f50<_0x170fd9;_0x442f50++){var _0x28e45d=events[_0x442f50];var _0x1f7e09=createListener(_0xde21('0x5')+_0x28e45d,_0x5504e8);DashboardEvents['on'](_0x28e45d,_0x1f7e09);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 75131da..fbcb409 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 _0x873f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','post','create','/:id/clone','clone','put','update','delete','exports','multer'];(function(_0xfb90d3,_0x4e7cea){var _0x306f34=function(_0x3b4cce){while(--_0x3b4cce){_0xfb90d3['push'](_0xfb90d3['shift']());}};_0x306f34(++_0x4e7cea);}(_0x873f,0xaf));var _0xf873=function(_0x3487db,_0x2d0569){_0x3487db=_0x3487db-0x0;var _0x51f9de=_0x873f[_0x3487db];return _0x51f9de;};'use strict';var multer=require(_0xf873('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf873('0x1'));var express=require(_0xf873('0x2'));var router=express['Router']();var fs_extra=require(_0xf873('0x3'));var auth=require(_0xf873('0x4'));var interaction=require(_0xf873('0x5'));var config=require(_0xf873('0x6'));var controller=require(_0xf873('0x7'));router[_0xf873('0x8')]('/',auth['isAuthenticated'](),controller[_0xf873('0x9')]);router[_0xf873('0x8')](_0xf873('0xa'),auth[_0xf873('0xb')](),controller[_0xf873('0xc')]);router[_0xf873('0x8')](_0xf873('0xd'),auth[_0xf873('0xb')](),controller['getItems']);router[_0xf873('0xe')]('/',auth[_0xf873('0xb')](),controller[_0xf873('0xf')]);router[_0xf873('0xe')](_0xf873('0x10'),auth[_0xf873('0xb')](),controller[_0xf873('0x11')]);router[_0xf873('0xe')](_0xf873('0xd'),auth['isAuthenticated'](),controller['addItem']);router[_0xf873('0x12')](_0xf873('0xa'),auth[_0xf873('0xb')](),controller[_0xf873('0x13')]);router[_0xf873('0x14')](_0xf873('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xf873('0x15')]=router; \ No newline at end of file +var _0x48e5=['/:id/clone','addItem','put','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create'];(function(_0x16cc95,_0xcf4b3f){var _0x26713e=function(_0x13e1f0){while(--_0x13e1f0){_0x16cc95['push'](_0x16cc95['shift']());}};_0x26713e(++_0xcf4b3f);}(_0x48e5,0x1e6));var _0x548e=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x48e5[_0x43b584];return _0x48f27b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x548e('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x548e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x548e('0x2'));var interaction=require(_0x548e('0x3'));var config=require(_0x548e('0x4'));var controller=require('./dashboard.controller');router[_0x548e('0x5')]('/',auth[_0x548e('0x6')](),controller[_0x548e('0x7')]);router['get'](_0x548e('0x8'),auth[_0x548e('0x6')](),controller[_0x548e('0x9')]);router[_0x548e('0x5')](_0x548e('0xa'),auth['isAuthenticated'](),controller[_0x548e('0xb')]);router[_0x548e('0xc')]('/',auth[_0x548e('0x6')](),controller[_0x548e('0xd')]);router[_0x548e('0xc')](_0x548e('0xe'),auth[_0x548e('0x6')](),controller['clone']);router[_0x548e('0xc')]('/:id/items',auth[_0x548e('0x6')](),controller[_0x548e('0xf')]);router[_0x548e('0x10')](_0x548e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x548e('0x11')](_0x548e('0x8'),auth[_0x548e('0x6')](),controller[_0x548e('0x12')]);module[_0x548e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 01cb086..6558f69 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 _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x19d58c,_0x39024e){var _0x131d14=function(_0x43ebd1){while(--_0x43ebd1){_0x19d58c['push'](_0x19d58c['shift']());}};_0x131d14(++_0x39024e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xd117=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd117,0x182));var _0x7d11=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xd117[_0xab0515];return _0x443d59;};'use strict';var Sequelize=require(_0x7d11('0x0'));var squel=require(_0x7d11('0x1'));var _=require(_0x7d11('0x2'));module[_0x7d11('0x3')]={'title':{'type':Sequelize[_0x7d11('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6')),'get':function(){try{return JSON[_0x7d11('0x7')](this[_0x7d11('0x8')](_0x7d11('0x9')));}catch(_0x2689c6){return[];}},'set':function(_0x27d7e8){try{this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')](_0x27d7e8));}catch(_0x47b5e6){this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7d11('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7d11('0xc')]},'col':{'type':Sequelize[_0x7d11('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7d11('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7d11('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index b21e3ad..77e6d7b 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 _0x27eb=['HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','body','create','update','find','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','localhost','redis','register','sendStatus','end','status','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat'];(function(_0x3146cf,_0x223e5d){var _0x5dc826=function(_0x3a18d7){while(--_0x3a18d7){_0x3146cf['push'](_0x3146cf['shift']());}};_0x5dc826(++_0x223e5d);}(_0x27eb,0xd0));var _0xb27e=function(_0x32f3d3,_0x598398){_0x32f3d3=_0x32f3d3-0x0;var _0x543e6b=_0x27eb[_0x32f3d3];return _0x543e6b;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require(_0xb27e('0x4'));var Mustache=require('mustache');var util=require(_0xb27e('0x5'));var path=require(_0xb27e('0x6'));var sox=require(_0xb27e('0x7'));var csv=require(_0xb27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require(_0xb27e('0xb'));var crypto=require(_0xb27e('0xc'));var jsforce=require(_0xb27e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb27e('0x8'));var querystring=require(_0xb27e('0xe'));var Papa=require(_0xb27e('0xf'));var Redis=require(_0xb27e('0x10'));var authService=require(_0xb27e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb27e('0x12'));var hardwareService=require(_0xb27e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb27e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb27e('0x15'));var db=require(_0xb27e('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb27e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27e('0x18')]));require('./dashboardItem.socket')[_0xb27e('0x19')](socket);function respondWithStatusCode(_0x5aa86f,_0x1453e5){_0x1453e5=_0x1453e5||0xcc;return function(_0x1cb58c){if(_0x1cb58c){return _0x5aa86f[_0xb27e('0x1a')](_0x1453e5);}return _0x5aa86f['status'](_0x1453e5)[_0xb27e('0x1b')]();};}function respondWithResult(_0x1d14bb,_0x24fc3e){_0x24fc3e=_0x24fc3e||0xc8;return function(_0x188073){if(_0x188073){return _0x1d14bb[_0xb27e('0x1c')](_0x24fc3e)[_0xb27e('0x1d')](_0x188073);}};}function respondWithFilteredResult(_0x25ce70,_0x336679){return function(_0x317f4e){if(_0x317f4e){var _0x48b70f=typeof _0x336679[_0xb27e('0x1e')]===_0xb27e('0x1f')&&typeof _0x336679[_0xb27e('0x20')]==='undefined';var _0x352856=_0x317f4e['count'];var _0x517932=_0x48b70f?0x0:_0x336679[_0xb27e('0x1e')];var _0x15dc7e=_0x48b70f?_0x317f4e['count']:_0x336679[_0xb27e('0x1e')]+_0x336679[_0xb27e('0x20')];var _0x16c950;if(_0x15dc7e>=_0x352856){_0x15dc7e=_0x352856;_0x16c950=0xc8;}else{_0x16c950=0xce;}_0x25ce70[_0xb27e('0x1c')](_0x16c950);return _0x25ce70['set'](_0xb27e('0x21'),_0x517932+'-'+_0x15dc7e+'/'+_0x352856)['json'](_0x317f4e);}return null;};}function patchUpdates(_0x19c0f2){return function(_0x2b8f05){try{jsonpatch['apply'](_0x2b8f05,_0x19c0f2,!![]);}catch(_0x58fc84){return BPromise[_0xb27e('0x22')](_0x58fc84);}return _0x2b8f05[_0xb27e('0x23')]();};}function saveUpdates(_0x3703ab,_0x3c4aa2){return function(_0x1e1bb9){if(_0x1e1bb9){return _0x1e1bb9['update'](_0x3703ab)[_0xb27e('0x24')](function(_0x4cba0b){return _0x4cba0b;});}return null;};}function removeEntity(_0x3972bc,_0x1ac460){return function(_0x289bb5){if(_0x289bb5){return _0x289bb5[_0xb27e('0x25')]()[_0xb27e('0x24')](function(){_0x3972bc['status'](0xcc)[_0xb27e('0x1b')]();});}};}function handleEntityNotFound(_0x5bae7c,_0x2839cf){return function(_0x2f44f3){if(!_0x2f44f3){_0x5bae7c[_0xb27e('0x1a')](0x194);}return _0x2f44f3;};}function handleError(_0x10dfc1,_0x3da666){_0x3da666=_0x3da666||0x1f4;return function(_0x35169a){logger[_0xb27e('0x26')](_0x35169a[_0xb27e('0x27')]);if(_0x35169a[_0xb27e('0x28')]){delete _0x35169a['name'];}_0x10dfc1[_0xb27e('0x1c')](_0x3da666)[_0xb27e('0x29')](_0x35169a);};}exports[_0xb27e('0x2a')]=function(_0x41fc88,_0x58a1a9){var _0x1ba773={'raw':![],'where':{'id':_0x41fc88[_0xb27e('0x2b')]['id']}},_0x28927a={};_0x28927a[_0xb27e('0x2c')]=_[_0xb27e('0x2d')](db[_0xb27e('0x2e')][_0xb27e('0x2f')]);_0x28927a['query']=_['keys'](_0x41fc88[_0xb27e('0x30')]);_0x28927a['filters']=_[_0xb27e('0x31')](_0x28927a['model'],_0x28927a[_0xb27e('0x30')]);_0x1ba773[_0xb27e('0x32')]=_[_0xb27e('0x31')](_0x28927a[_0xb27e('0x2c')],qs[_0xb27e('0x33')](_0x41fc88[_0xb27e('0x30')]['fields']));_0x1ba773[_0xb27e('0x32')]=_0x1ba773['attributes'][_0xb27e('0x34')]?_0x1ba773['attributes']:_0x28927a[_0xb27e('0x2c')];if(_0x41fc88['query'][_0xb27e('0x35')]){_0x1ba773[_0xb27e('0x36')]=[{'all':!![]}];}_0x1ba773=_['merge']({},_0x1ba773,_0x41fc88['options']);return db[_0xb27e('0x2e')]['find'](_0x1ba773)['then'](handleEntityNotFound(_0x58a1a9,null))['then'](respondWithResult(_0x58a1a9,null))[_0xb27e('0x37')](handleError(_0x58a1a9,null));};exports[_0xb27e('0x25')]=function(_0x583414,_0xa6ff7b){return db[_0xb27e('0x2e')]['find']({'where':{'id':_0x583414['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0xa6ff7b,null))['then'](removeEntity(_0xa6ff7b,null))[_0xb27e('0x37')](handleError(_0xa6ff7b,null));};function widgetAttributes(_0x551038){try{switch(_0x551038[_0xb27e('0x38')]){case _0xb27e('0x39'):return[{'name':_0xb27e('0x3a'),'value':_0x551038[_0xb27e('0x3a')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038[_0xb27e('0x3b')][0x0][_0xb27e('0x3c')]:undefined)||'https://'}];case _0xb27e('0x3d'):return[{'name':_0xb27e('0x3e'),'value':_0x551038[_0xb27e('0x3e')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038['attrs'][0x0]['value']:undefined)||''}];case _0xb27e('0x3f'):return[{'name':_0xb27e('0x40'),'value':_0x551038[_0xb27e('0x40')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038[_0xb27e('0x3b')][0x0][_0xb27e('0x3c')]:undefined)||_0xb27e('0x41')},{'name':_0xb27e('0x42'),'value':_0x551038[_0xb27e('0x42')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038['attrs'][0x1]?_0x551038['attrs'][0x1][_0xb27e('0x3c')]:undefined)||_0xb27e('0x43')},{'name':_0xb27e('0x44'),'value':_0x551038[_0xb27e('0x44')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x2]?_0x551038[_0xb27e('0x3b')][0x2][_0xb27e('0x3c')]:undefined)||0xc}];case'counter':return[{'name':_0xb27e('0x45'),'value':_0x551038[_0xb27e('0x45')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038['attrs'][0x0][_0xb27e('0x3c')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x551038[_0xb27e('0x46')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038['attrs'][0x1]?_0x551038[_0xb27e('0x3b')][0x1][_0xb27e('0x3c')]:undefined)||[]},{'name':_0xb27e('0x44'),'value':_0x551038[_0xb27e('0x44')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x2]?_0x551038[_0xb27e('0x3b')][0x2]['value']:undefined)||0x14},{'name':_0xb27e('0x47'),'value':_0x551038['attrChannel']||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x3]?_0x551038[_0xb27e('0x3b')][0x3][_0xb27e('0x3c')]:undefined)||_0xb27e('0x48')},{'name':_0xb27e('0x49'),'value':_0x551038['attrEmailAccounts']||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x4]?_0x551038[_0xb27e('0x3b')][0x4][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4a'),'value':_0x551038[_0xb27e('0x4a')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x5]?_0x551038[_0xb27e('0x3b')][0x5][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4b'),'value':_0x551038[_0xb27e('0x4b')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x6]?_0x551038[_0xb27e('0x3b')][0x6][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4c'),'value':_0x551038[_0xb27e('0x4c')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x7]?_0x551038['attrs'][0x7][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4d'),'value':_0x551038[_0xb27e('0x4d')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x8]?_0x551038[_0xb27e('0x3b')][0x8][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4e'),'value':_0x551038['attrChatWebsites']||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x9]?_0x551038[_0xb27e('0x3b')][0x9][_0xb27e('0x3c')]:undefined)||''}];case'multibar-chart':case _0xb27e('0x4f'):return[{'name':'attrSerie1','value':_0x551038[_0xb27e('0x50')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038['attrs'][0x0][_0xb27e('0x3c')]:undefined)||'total'},{'name':_0xb27e('0x51'),'value':_0x551038[_0xb27e('0x51')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x1]?_0x551038['attrs'][0x1][_0xb27e('0x3c')]:undefined)||null},{'name':_0xb27e('0x52'),'value':_0x551038[_0xb27e('0x52')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x2]?_0x551038[_0xb27e('0x3b')][0x2][_0xb27e('0x3c')]:undefined)||null},{'name':_0xb27e('0x46'),'value':_0x551038[_0xb27e('0x46')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x3]?_0x551038['attrs'][0x3]['value']:undefined)||[]},{'name':_0xb27e('0x47'),'value':_0x551038[_0xb27e('0x47')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x4]?_0x551038[_0xb27e('0x3b')][0x4]['value']:undefined)||'voice'},{'name':_0xb27e('0x49'),'value':_0x551038[_0xb27e('0x49')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x5]?_0x551038[_0xb27e('0x3b')][0x5][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4a'),'value':_0x551038[_0xb27e('0x4a')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x6]?_0x551038[_0xb27e('0x3b')][0x6]['value']:undefined)||''},{'name':_0xb27e('0x4b'),'value':_0x551038[_0xb27e('0x4b')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x7]?_0x551038[_0xb27e('0x3b')][0x7][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4c'),'value':_0x551038[_0xb27e('0x4c')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x8]?_0x551038[_0xb27e('0x3b')][0x8][_0xb27e('0x3c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x551038[_0xb27e('0x4d')]||(_0x551038['attrs']&&_0x551038['attrs'][0x9]?_0x551038[_0xb27e('0x3b')][0x9][_0xb27e('0x3c')]:undefined)||''},{'name':_0xb27e('0x4e'),'value':_0x551038[_0xb27e('0x4e')]||(_0x551038[_0xb27e('0x3b')]&&_0x551038['attrs'][0xa]?_0x551038[_0xb27e('0x3b')][0xa][_0xb27e('0x3c')]:undefined)||''}];case _0xb27e('0x53'):return[{'name':_0xb27e('0x54'),'type':_0x551038['reportType']||(_0x551038[_0xb27e('0x3b')]&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038[_0xb27e('0x3b')][0x0][_0xb27e('0x38')]:undefined)||null,'value':_0x551038[_0xb27e('0x54')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x0]?_0x551038[_0xb27e('0x3b')][0x0]['value']:undefined)||null},{'name':_0xb27e('0x55'),'value':_0x551038[_0xb27e('0x55')]||(_0x551038['attrs']&&_0x551038[_0xb27e('0x3b')][0x1]?_0x551038[_0xb27e('0x3b')][0x1][_0xb27e('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x4ede55){logger[_0xb27e('0x26')]('widgetAttributes:\x20%s',JSON[_0xb27e('0x56')](_0x4ede55));return[];}}exports['create']=function(_0x32d9ec,_0x104e8e){if(_0x32d9ec[_0xb27e('0x57')]){_0x32d9ec[_0xb27e('0x57')][_0xb27e('0x3b')]=widgetAttributes(_0x32d9ec[_0xb27e('0x57')]);}return db[_0xb27e('0x2e')][_0xb27e('0x58')](_0x32d9ec['body'],{})[_0xb27e('0x24')](respondWithResult(_0x104e8e,0xc9))['catch'](handleError(_0x104e8e,null));};exports[_0xb27e('0x59')]=function(_0x48e11b,_0x861def){if(_0x48e11b[_0xb27e('0x57')]['id']){delete _0x48e11b[_0xb27e('0x57')]['id'];}_0x48e11b[_0xb27e('0x57')][_0xb27e('0x3b')]=widgetAttributes(_0x48e11b[_0xb27e('0x57')]);return db[_0xb27e('0x2e')][_0xb27e('0x5a')]({'where':{'id':_0x48e11b['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x861def,null))[_0xb27e('0x24')](saveUpdates(_0x48e11b[_0xb27e('0x57')],null))[_0xb27e('0x24')](respondWithResult(_0x861def,null))[_0xb27e('0x37')](handleError(_0x861def,null));}; \ No newline at end of file +var _0x9134=['includeAll','merge','options','find','catch','type','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9134,0x87));var _0x4913=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9134[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4913('0x0'));var zipdir=require(_0x4913('0x1'));var jsonpatch=require(_0x4913('0x2'));var rp=require(_0x4913('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4913('0x4'));var util=require(_0x4913('0x5'));var path=require(_0x4913('0x6'));var sox=require(_0x4913('0x7'));var csv=require(_0x4913('0x8'));var ejs=require(_0x4913('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4913('0xa'));var squel=require(_0x4913('0xb'));var crypto=require(_0x4913('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4913('0xd'));var toCsv=require(_0x4913('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4913('0xe'));var authService=require(_0x4913('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4913('0x10'));var hardwareService=require(_0x4913('0x11'));var logger=require(_0x4913('0x12'))(_0x4913('0x13'));var utils=require(_0x4913('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4913('0x15'));var db=require('../../mysqldb')['db'];config[_0x4913('0x16')]=_['defaults'](config[_0x4913('0x16')],{'host':_0x4913('0x17'),'port':0x18eb});var socket=require(_0x4913('0x18'))(new Redis(config['redis']));require(_0x4913('0x19'))[_0x4913('0x1a')](socket);function respondWithStatusCode(_0x525990,_0x499290){_0x499290=_0x499290||0xcc;return function(_0x352c77){if(_0x352c77){return _0x525990[_0x4913('0x1b')](_0x499290);}return _0x525990[_0x4913('0x1c')](_0x499290)[_0x4913('0x1d')]();};}function respondWithResult(_0x579144,_0x6636ca){_0x6636ca=_0x6636ca||0xc8;return function(_0x3b153f){if(_0x3b153f){return _0x579144['status'](_0x6636ca)[_0x4913('0x1e')](_0x3b153f);}};}function respondWithFilteredResult(_0x504efe,_0x340e55){return function(_0x398f2f){if(_0x398f2f){var _0x4b07d5=typeof _0x340e55[_0x4913('0x1f')]==='undefined'&&typeof _0x340e55[_0x4913('0x20')]===_0x4913('0x21');var _0x3c22de=_0x398f2f['count'];var _0x52fe67=_0x4b07d5?0x0:_0x340e55[_0x4913('0x1f')];var _0x50b0ef=_0x4b07d5?_0x398f2f[_0x4913('0x22')]:_0x340e55[_0x4913('0x1f')]+_0x340e55['limit'];var _0x15935b;if(_0x50b0ef>=_0x3c22de){_0x50b0ef=_0x3c22de;_0x15935b=0xc8;}else{_0x15935b=0xce;}_0x504efe[_0x4913('0x1c')](_0x15935b);return _0x504efe[_0x4913('0x23')](_0x4913('0x24'),_0x52fe67+'-'+_0x50b0ef+'/'+_0x3c22de)[_0x4913('0x1e')](_0x398f2f);}return null;};}function patchUpdates(_0x3c099e){return function(_0x3dbf4e){try{jsonpatch['apply'](_0x3dbf4e,_0x3c099e,!![]);}catch(_0x262cab){return BPromise['reject'](_0x262cab);}return _0x3dbf4e[_0x4913('0x25')]();};}function saveUpdates(_0x3ff8de,_0x299cc1){return function(_0x179edf){if(_0x179edf){return _0x179edf[_0x4913('0x26')](_0x3ff8de)[_0x4913('0x27')](function(_0x8f40a9){return _0x8f40a9;});}return null;};}function removeEntity(_0x4139a1,_0x203ba7){return function(_0x40a8b2){if(_0x40a8b2){return _0x40a8b2[_0x4913('0x28')]()[_0x4913('0x27')](function(){_0x4139a1['status'](0xcc)[_0x4913('0x1d')]();});}};}function handleEntityNotFound(_0x435e90,_0x58590c){return function(_0x13b7cd){if(!_0x13b7cd){_0x435e90[_0x4913('0x1b')](0x194);}return _0x13b7cd;};}function handleError(_0x592e1d,_0x4e656a){_0x4e656a=_0x4e656a||0x1f4;return function(_0x115f54){logger[_0x4913('0x29')](_0x115f54[_0x4913('0x2a')]);if(_0x115f54['name']){delete _0x115f54[_0x4913('0x2b')];}_0x592e1d[_0x4913('0x1c')](_0x4e656a)[_0x4913('0x2c')](_0x115f54);};}exports[_0x4913('0x2d')]=function(_0x225b85,_0x3ba6ea){var _0x465533={'raw':![],'where':{'id':_0x225b85[_0x4913('0x2e')]['id']}},_0x34df3d={};_0x34df3d[_0x4913('0x2f')]=_[_0x4913('0x30')](db[_0x4913('0x31')][_0x4913('0x32')]);_0x34df3d[_0x4913('0x33')]=_['keys'](_0x225b85[_0x4913('0x33')]);_0x34df3d['filters']=_['intersection'](_0x34df3d[_0x4913('0x2f')],_0x34df3d[_0x4913('0x33')]);_0x465533[_0x4913('0x34')]=_[_0x4913('0x35')](_0x34df3d[_0x4913('0x2f')],qs[_0x4913('0x36')](_0x225b85[_0x4913('0x33')][_0x4913('0x36')]));_0x465533[_0x4913('0x34')]=_0x465533[_0x4913('0x34')]['length']?_0x465533[_0x4913('0x34')]:_0x34df3d['model'];if(_0x225b85[_0x4913('0x33')][_0x4913('0x37')]){_0x465533['include']=[{'all':!![]}];}_0x465533=_[_0x4913('0x38')]({},_0x465533,_0x225b85[_0x4913('0x39')]);return db[_0x4913('0x31')][_0x4913('0x3a')](_0x465533)['then'](handleEntityNotFound(_0x3ba6ea,null))[_0x4913('0x27')](respondWithResult(_0x3ba6ea,null))[_0x4913('0x3b')](handleError(_0x3ba6ea,null));};exports['destroy']=function(_0x41a0e5,_0x4ad451){return db[_0x4913('0x31')]['find']({'where':{'id':_0x41a0e5['params']['id']}})['then'](handleEntityNotFound(_0x4ad451,null))[_0x4913('0x27')](removeEntity(_0x4ad451,null))[_0x4913('0x3b')](handleError(_0x4ad451,null));};function widgetAttributes(_0x497e10){try{switch(_0x497e10[_0x4913('0x3c')]){case'iframe':return[{'name':_0x4913('0x3d'),'value':_0x497e10[_0x4913('0x3d')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10[_0x4913('0x3e')][0x0][_0x4913('0x3f')]:undefined)||_0x4913('0x40')}];case _0x4913('0x41'):return[{'name':_0x4913('0x42'),'value':_0x497e10[_0x4913('0x42')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x0]?_0x497e10[_0x4913('0x3e')][0x0][_0x4913('0x3f')]:undefined)||''}];case'clock':return[{'name':_0x4913('0x43'),'value':_0x497e10['attrHourFormat']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10['attrs'][0x0][_0x4913('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0x4913('0x44'),'value':_0x497e10['attrTimezone']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x1]?_0x497e10[_0x4913('0x3e')][0x1]['value']:undefined)||_0x4913('0x45')},{'name':_0x4913('0x46'),'value':_0x497e10[_0x4913('0x46')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x2]?_0x497e10['attrs'][0x2][_0x4913('0x3f')]:undefined)||0xc}];case _0x4913('0x47'):return[{'name':_0x4913('0x48'),'value':_0x497e10[_0x4913('0x48')]||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10[_0x4913('0x3e')][0x0][_0x4913('0x3f')]:undefined)||_0x4913('0x49')},{'name':_0x4913('0x4a'),'value':_0x497e10['attrVoiceQueues']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x1]?_0x497e10[_0x4913('0x3e')][0x1]['value']:undefined)||[]},{'name':_0x4913('0x46'),'value':_0x497e10[_0x4913('0x46')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x2]?_0x497e10[_0x4913('0x3e')][0x2][_0x4913('0x3f')]:undefined)||0x14},{'name':_0x4913('0x4b'),'value':_0x497e10[_0x4913('0x4b')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x3]?_0x497e10['attrs'][0x3]['value']:undefined)||_0x4913('0x4c')},{'name':_0x4913('0x4d'),'value':_0x497e10['attrEmailAccounts']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x4]?_0x497e10['attrs'][0x4][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x4e'),'value':_0x497e10[_0x4913('0x4e')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x5]?_0x497e10[_0x4913('0x3e')][0x5][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x4f'),'value':_0x497e10[_0x4913('0x4f')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x6]?_0x497e10[_0x4913('0x3e')][0x6][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x50'),'value':_0x497e10['attrOpenchannelAccounts']||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x7]?_0x497e10[_0x4913('0x3e')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x497e10[_0x4913('0x51')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x8]?_0x497e10[_0x4913('0x3e')][0x8][_0x4913('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x497e10[_0x4913('0x52')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x9]?_0x497e10['attrs'][0x9][_0x4913('0x3f')]:undefined)||''}];case _0x4913('0x53'):case _0x4913('0x54'):return[{'name':_0x4913('0x55'),'value':_0x497e10[_0x4913('0x55')]||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10['attrs'][0x0][_0x4913('0x3f')]:undefined)||_0x4913('0x49')},{'name':_0x4913('0x56'),'value':_0x497e10['attrSerie2']||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x1]?_0x497e10[_0x4913('0x3e')][0x1]['value']:undefined)||null},{'name':_0x4913('0x57'),'value':_0x497e10[_0x4913('0x57')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x2]?_0x497e10['attrs'][0x2]['value']:undefined)||null},{'name':_0x4913('0x4a'),'value':_0x497e10[_0x4913('0x4a')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x3]?_0x497e10['attrs'][0x3][_0x4913('0x3f')]:undefined)||[]},{'name':_0x4913('0x4b'),'value':_0x497e10[_0x4913('0x4b')]||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x4]?_0x497e10[_0x4913('0x3e')][0x4][_0x4913('0x3f')]:undefined)||_0x4913('0x4c')},{'name':'attrEmailAccounts','value':_0x497e10['attrEmailAccounts']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x5]?_0x497e10['attrs'][0x5][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x4e'),'value':_0x497e10[_0x4913('0x4e')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x6]?_0x497e10[_0x4913('0x3e')][0x6]['value']:undefined)||''},{'name':_0x4913('0x4f'),'value':_0x497e10[_0x4913('0x4f')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x7]?_0x497e10[_0x4913('0x3e')][0x7][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x50'),'value':_0x497e10['attrOpenchannelAccounts']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10['attrs'][0x8]?_0x497e10[_0x4913('0x3e')][0x8][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x51'),'value':_0x497e10['attrWhatsappAccounts']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x9]?_0x497e10['attrs'][0x9][_0x4913('0x3f')]:undefined)||''},{'name':_0x4913('0x52'),'value':_0x497e10['attrChatWebsites']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0xa]?_0x497e10['attrs'][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x4913('0x58'),'type':_0x497e10[_0x4913('0x59')]||(_0x497e10['attrs']&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10[_0x4913('0x3e')][0x0][_0x4913('0x3c')]:undefined)||null,'value':_0x497e10['attrReport']||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x0]?_0x497e10[_0x4913('0x3e')][0x0][_0x4913('0x3f')]:undefined)||null},{'name':_0x4913('0x5a'),'value':_0x497e10[_0x4913('0x5a')]||(_0x497e10[_0x4913('0x3e')]&&_0x497e10[_0x4913('0x3e')][0x1]?_0x497e10[_0x4913('0x3e')][0x1][_0x4913('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x32f905){logger[_0x4913('0x29')](_0x4913('0x5b'),JSON[_0x4913('0x5c')](_0x32f905));return[];}}exports[_0x4913('0x5d')]=function(_0x40ed60,_0x7d760d){if(_0x40ed60[_0x4913('0x5e')]){_0x40ed60[_0x4913('0x5e')][_0x4913('0x3e')]=widgetAttributes(_0x40ed60[_0x4913('0x5e')]);}return db[_0x4913('0x31')][_0x4913('0x5d')](_0x40ed60[_0x4913('0x5e')],{})[_0x4913('0x27')](respondWithResult(_0x7d760d,0xc9))[_0x4913('0x3b')](handleError(_0x7d760d,null));};exports[_0x4913('0x26')]=function(_0x36efe4,_0x3dce3b){if(_0x36efe4['body']['id']){delete _0x36efe4[_0x4913('0x5e')]['id'];}_0x36efe4['body']['attrs']=widgetAttributes(_0x36efe4[_0x4913('0x5e')]);return db[_0x4913('0x31')]['find']({'where':{'id':_0x36efe4['params']['id']}})['then'](handleEntityNotFound(_0x3dce3b,null))[_0x4913('0x27')](saveUpdates(_0x36efe4[_0x4913('0x5e')],null))['then'](respondWithResult(_0x3dce3b,null))[_0x4913('0x3b')](handleError(_0x3dce3b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index c62bf3a..7a415a9 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 _0xdafb=['save','update','remove','emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners'];(function(_0x247ff9,_0x17eed5){var _0x1b995b=function(_0x47ccc0){while(--_0x47ccc0){_0x247ff9['push'](_0x247ff9['shift']());}};_0x1b995b(++_0x17eed5);}(_0xdafb,0x6a));var _0xbdaf=function(_0x4e0813,_0xa22fd7){_0x4e0813=_0x4e0813-0x0;var _0x37e612=_0xdafb[_0x4e0813];return _0x37e612;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xbdaf('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbdaf('0x1')](0x0);var events={'afterCreate':_0xbdaf('0x2'),'afterUpdate':_0xbdaf('0x3'),'afterDestroy':_0xbdaf('0x4')};function emitEvent(_0x44f756){return function(_0x550dd9,_0x34af40,_0x505af5){DashboardItemEvents[_0xbdaf('0x5')](_0x44f756+':'+_0x550dd9['id'],_0x550dd9);DashboardItemEvents[_0xbdaf('0x5')](_0x44f756,_0x550dd9);_0x505af5(null);};}for(var e in events){if(events[_0xbdaf('0x6')](e)){var event=events[e];DashboardItem[_0xbdaf('0x7')](e,emitEvent(event));}}module[_0xbdaf('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xfdb4=['emit','hasOwnProperty','exports','DashboardItem','save','update','remove'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xfdb4,0xf8));var _0x4fdb=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xfdb4[_0x2aa0e7];return _0x1472c0;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x4fdb('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fdb('0x1'),'afterUpdate':_0x4fdb('0x2'),'afterDestroy':_0x4fdb('0x3')};function emitEvent(_0x110d31){return function(_0x164e94,_0x32da04,_0x2e0a9b){DashboardItemEvents[_0x4fdb('0x4')](_0x110d31+':'+_0x164e94['id'],_0x164e94);DashboardItemEvents[_0x4fdb('0x4')](_0x110d31,_0x164e94);_0x2e0a9b(null);};}for(var e in events){if(events[_0x4fdb('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x4fdb('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 90fc1e9..75bfbb5 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 _0xbac3=['path','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4db7dd,_0x41ecbc){var _0x1393eb=function(_0x4619ab){while(--_0x4619ab){_0x4db7dd['push'](_0x4db7dd['shift']());}};_0x1393eb(++_0x41ecbc);}(_0xbac3,0x1df));var _0x3bac=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xbac3[_0xce9195];return _0x530fe6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3bac('0x0'))(_0x3bac('0x1'));var moment=require(_0x3bac('0x2'));var BPromise=require(_0x3bac('0x3'));var rp=require(_0x3bac('0x4'));var fs=require('fs');var path=require(_0x3bac('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3bac('0x6'));module[_0x3bac('0x7')]=function(_0x222aea,_0x47246a){return _0x222aea[_0x3bac('0x8')](_0x3bac('0x9'),attributes,{'tableName':_0x3bac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2e6=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x13cc56,_0x3f991b){_0x13cc56=_0x13cc56-0x0;var _0x4df4f5=_0xb2e6[_0x13cc56];return _0x4df4f5;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var logger=require(_0x6b2e('0x2'))(_0x6b2e('0x3'));var moment=require('moment');var BPromise=require(_0x6b2e('0x4'));var rp=require(_0x6b2e('0x5'));var fs=require('fs');var path=require(_0x6b2e('0x6'));var rimraf=require('rimraf');var config=require(_0x6b2e('0x7'));var attributes=require(_0x6b2e('0x8'));module[_0x6b2e('0x9')]=function(_0x36e668,_0x443171){return _0x36e668[_0x6b2e('0xa')](_0x6b2e('0xb'),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 8a6aa93..7b2bc05 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 _0x11b3=['socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0x11b3,0x114));var _0x311b=function(_0x36ae6e,_0x55212a){_0x36ae6e=_0x36ae6e-0x0;var _0x1e7267=_0x11b3[_0x36ae6e];return _0x1e7267;};'use strict';var _=require(_0x311b('0x0'));var util=require(_0x311b('0x1'));var moment=require('moment');var BPromise=require(_0x311b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x311b('0x3'));var db=require(_0x311b('0x4'))['db'];var utils=require(_0x311b('0x5'));var logger=require('../../config/logger')(_0x311b('0x6'));var config=require(_0x311b('0x7'));var jayson=require(_0x311b('0x8'));var client=jayson[_0x311b('0x9')][_0x311b('0xa')]({'port':0x232a});config[_0x311b('0xb')]=_[_0x311b('0xc')](config['redis'],{'host':_0x311b('0xd'),'port':0x18eb});var socket=require(_0x311b('0xe'))(new Redis(config[_0x311b('0xb')]));require(_0x311b('0xf'))['register'](socket);function respondWithRpcPromise(_0x297c6b,_0x43ccf7,_0x43202f){return new BPromise(function(_0x1880af,_0x3c3b70){return client[_0x311b('0x10')](_0x297c6b,_0x43202f)[_0x311b('0x11')](function(_0x406322){logger[_0x311b('0x12')](_0x311b('0x13'),_0x43ccf7,_0x311b('0x14'));logger[_0x311b('0x15')](_0x311b('0x16'),_0x43ccf7,_0x311b('0x14'),JSON[_0x311b('0x17')](_0x406322));if(_0x406322[_0x311b('0x18')]){if(_0x406322[_0x311b('0x18')][_0x311b('0x19')]===0x1f4){logger[_0x311b('0x18')](_0x311b('0x13'),_0x43ccf7,_0x406322[_0x311b('0x18')][_0x311b('0x1a')]);return _0x3c3b70(_0x406322[_0x311b('0x18')][_0x311b('0x1a')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x43ccf7,_0x406322['error']['message']);return _0x1880af(_0x406322['error']['message']);}else{logger[_0x311b('0x12')](_0x311b('0x13'),_0x43ccf7,_0x311b('0x14'));_0x1880af(_0x406322[_0x311b('0x1b')][_0x311b('0x1a')]);}})[_0x311b('0x1c')](function(_0xd0cbb){logger[_0x311b('0x18')](_0x311b('0x13'),_0x43ccf7,_0xd0cbb);_0x3c3b70(_0xd0cbb);});});} \ No newline at end of file +var _0xaa9b=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0xaa9b,0x141));var _0xbaa9=function(_0x41dccc,_0xfe6bfc){_0x41dccc=_0x41dccc-0x0;var _0x7bd6da=_0xaa9b[_0x41dccc];return _0x7bd6da;};'use strict';var _=require(_0xbaa9('0x0'));var util=require(_0xbaa9('0x1'));var moment=require(_0xbaa9('0x2'));var BPromise=require(_0xbaa9('0x3'));var rs=require(_0xbaa9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbaa9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbaa9('0x6'))(_0xbaa9('0x7'));var config=require('../../config/environment');var jayson=require(_0xbaa9('0x8'));var client=jayson[_0xbaa9('0x9')][_0xbaa9('0xa')]({'port':0x232a});config[_0xbaa9('0xb')]=_[_0xbaa9('0xc')](config[_0xbaa9('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbaa9('0xb')]));require(_0xbaa9('0xd'))['register'](socket);function respondWithRpcPromise(_0x4d5f2d,_0x1049c0,_0x50fce1){return new BPromise(function(_0x367986,_0x41507f){return client[_0xbaa9('0xe')](_0x4d5f2d,_0x50fce1)['then'](function(_0x1d558b){logger[_0xbaa9('0xf')](_0xbaa9('0x10'),_0x1049c0,_0xbaa9('0x11'));logger['debug'](_0xbaa9('0x12'),_0x1049c0,'request\x20sent',JSON[_0xbaa9('0x13')](_0x1d558b));if(_0x1d558b[_0xbaa9('0x14')]){if(_0x1d558b[_0xbaa9('0x14')][_0xbaa9('0x15')]===0x1f4){logger['error'](_0xbaa9('0x10'),_0x1049c0,_0x1d558b[_0xbaa9('0x14')][_0xbaa9('0x16')]);return _0x41507f(_0x1d558b[_0xbaa9('0x14')]['message']);}logger[_0xbaa9('0x14')](_0xbaa9('0x10'),_0x1049c0,_0x1d558b[_0xbaa9('0x14')]['message']);return _0x367986(_0x1d558b[_0xbaa9('0x14')][_0xbaa9('0x16')]);}else{logger[_0xbaa9('0xf')](_0xbaa9('0x10'),_0x1049c0,'request\x20sent');_0x367986(_0x1d558b[_0xbaa9('0x17')][_0xbaa9('0x16')]);}})[_0xbaa9('0x18')](function(_0x44a5e0){logger[_0xbaa9('0x14')](_0xbaa9('0x10'),_0x1049c0,_0x44a5e0);_0x41507f(_0x44a5e0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 49c6174..7155d1d 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 _0x2d0d=['removeListener','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x2d0d,0x179));var _0xd2d0=function(_0x1bbe54,_0xdc2c1b){_0x1bbe54=_0x1bbe54-0x0;var _0x1c5952=_0x2d0d[_0x1bbe54];return _0x1c5952;};'use strict';var DashboardItemEvents=require(_0xd2d0('0x0'));var events=['save',_0xd2d0('0x1'),_0xd2d0('0x2')];function createListener(_0x11b8d9,_0x36517c){return function(_0x40922c){_0x36517c['emit'](_0x11b8d9,_0x40922c);};}function removeListener(_0x1a16eb,_0x209eb0){return function(){DashboardItemEvents[_0xd2d0('0x3')](_0x1a16eb,_0x209eb0);};}exports['register']=function(_0x296347){for(var _0x11ea0a=0x0,_0x42b5b7=events['length'];_0x11ea0a<_0x42b5b7;_0x11ea0a++){var _0x539e62=events[_0x11ea0a];var _0x229b53=createListener(_0xd2d0('0x4')+_0x539e62,_0x296347);DashboardItemEvents['on'](_0x539e62,_0x229b53);}}; \ No newline at end of file +var _0x40f5=['update','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x40f5,0xd0));var _0x540f=function(_0x2a9bb2,_0xccdbcb){_0x2a9bb2=_0x2a9bb2-0x0;var _0x58c695=_0x40f5[_0x2a9bb2];return _0x58c695;};'use strict';var DashboardItemEvents=require(_0x540f('0x0'));var events=[_0x540f('0x1'),'remove',_0x540f('0x2')];function createListener(_0x1f2ab,_0x163128){return function(_0x57bacd){_0x163128['emit'](_0x1f2ab,_0x57bacd);};}function removeListener(_0x2cfb10,_0x433360){return function(){DashboardItemEvents['removeListener'](_0x2cfb10,_0x433360);};}exports[_0x540f('0x3')]=function(_0x18256e){for(var _0xa37141=0x0,_0x440243=events[_0x540f('0x4')];_0xa37141<_0x440243;_0xa37141++){var _0x8ab4ba=events[_0xa37141];var _0x3b8b69=createListener(_0x540f('0x5')+_0x8ab4ba,_0x18256e);DashboardItemEvents['on'](_0x8ab4ba,_0x3b8b69);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d601ee7..d25db65 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 _0x9999=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x9999,0x92));var _0x9999=function(_0x3975bb,_0x40338d){_0x3975bb=_0x3975bb-0x0;var _0x15c97b=_0x9999[_0x3975bb];return _0x15c97b;};'use strict';var multer=require(_0x9999('0x0'));var util=require('util');var path=require(_0x9999('0x1'));var timeout=require(_0x9999('0x2'));var express=require('express');var router=express[_0x9999('0x3')]();var fs_extra=require(_0x9999('0x4'));var auth=require(_0x9999('0x5'));var interaction=require(_0x9999('0x6'));var config=require(_0x9999('0x7'));var controller=require(_0x9999('0x8'));router[_0x9999('0x9')](_0x9999('0xa'),auth['isAuthenticated'](),controller[_0x9999('0xb')]);router[_0x9999('0xc')]('/',auth[_0x9999('0xd')](),controller[_0x9999('0xe')]);router['put'](_0x9999('0xa'),auth['isAuthenticated'](),controller[_0x9999('0xf')]);router[_0x9999('0x10')](_0x9999('0xa'),auth['isAuthenticated'](),controller[_0x9999('0x11')]);module[_0x9999('0x12')]=router; \ No newline at end of file +var _0x8c5b=['get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x32224b,_0x2f7c43){var _0x4d7bdc=function(_0x2ccc2a){while(--_0x2ccc2a){_0x32224b['push'](_0x32224b['shift']());}};_0x4d7bdc(++_0x2f7c43);}(_0x8c5b,0x1aa));var _0xb8c5=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x8c5b[_0xcd4d8e];return _0x1c3c61;};'use strict';var multer=require(_0xb8c5('0x0'));var util=require(_0xb8c5('0x1'));var path=require(_0xb8c5('0x2'));var timeout=require(_0xb8c5('0x3'));var express=require(_0xb8c5('0x4'));var router=express[_0xb8c5('0x5')]();var fs_extra=require(_0xb8c5('0x6'));var auth=require(_0xb8c5('0x7'));var interaction=require(_0xb8c5('0x8'));var config=require(_0xb8c5('0x9'));var controller=require(_0xb8c5('0xa'));router[_0xb8c5('0xb')](_0xb8c5('0xc'),auth[_0xb8c5('0xd')](),controller[_0xb8c5('0xe')]);router['post']('/',auth[_0xb8c5('0xd')](),controller['create']);router[_0xb8c5('0xf')]('/:id',auth[_0xb8c5('0xd')](),controller[_0xb8c5('0x10')]);router[_0xb8c5('0x11')](_0xb8c5('0xc'),auth['isAuthenticated'](),controller[_0xb8c5('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 8ca8425..446aedb 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 _0xad6a=['STRING','ENUM','first','second','exports'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xad6a,0x1d5));var _0xaad6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xad6a[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0xaad6('0x0')]={'name':{'type':Sequelize[_0xaad6('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xaad6('0x2')](_0xaad6('0x3'),_0xaad6('0x4'),'third'),'allowNull':![],'defaultValue':_0xaad6('0x3')},'description':{'type':Sequelize[_0xaad6('0x1')]}}; \ No newline at end of file +var _0xccd4=['second','sequelize','exports','STRING','first'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xccd4,0x1e6));var _0x4ccd=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xccd4[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x4ccd('0x0'));module[_0x4ccd('0x1')]={'name':{'type':Sequelize[_0x4ccd('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x4ccd('0x3'),_0x4ccd('0x4'),'third'),'allowNull':![],'defaultValue':_0x4ccd('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index aeecca2..daa9222 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 _0xebdc=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','index','map','Disposition','fieldName','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','name','filter','merge','options','includeAll','include','findAll','rows','catch','params','filters','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xebdc,0x9d));var _0xcebd=function(_0x41414d,_0x5526f9){_0x41414d=_0x41414d-0x0;var _0x723bc7=_0xebdc[_0x41414d];return _0x723bc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcebd('0x0'));var zipdir=require(_0xcebd('0x1'));var jsonpatch=require(_0xcebd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcebd('0x3'));var util=require(_0xcebd('0x4'));var path=require('path');var sox=require(_0xcebd('0x5'));var csv=require(_0xcebd('0x6'));var ejs=require(_0xcebd('0x7'));var fs=require('fs');var fs_extra=require(_0xcebd('0x8'));var _=require(_0xcebd('0x9'));var squel=require('squel');var crypto=require(_0xcebd('0xa'));var jsforce=require(_0xcebd('0xb'));var deskjs=require(_0xcebd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcebd('0xd'));var Papa=require(_0xcebd('0xe'));var Redis=require(_0xcebd('0xf'));var authService=require(_0xcebd('0x10'));var qs=require(_0xcebd('0x11'));var as=require(_0xcebd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcebd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcebd('0x14'));var db=require(_0xcebd('0x15'))['db'];function respondWithStatusCode(_0x36bfcd,_0x15f18d){_0x15f18d=_0x15f18d||0xcc;return function(_0x2bf4cd){if(_0x2bf4cd){return _0x36bfcd[_0xcebd('0x16')](_0x15f18d);}return _0x36bfcd[_0xcebd('0x17')](_0x15f18d)[_0xcebd('0x18')]();};}function respondWithResult(_0x494535,_0x23db43){_0x23db43=_0x23db43||0xc8;return function(_0x4f61f5){if(_0x4f61f5){return _0x494535[_0xcebd('0x17')](_0x23db43)['json'](_0x4f61f5);}};}function respondWithFilteredResult(_0x14a286,_0x26d395){return function(_0x15af60){if(_0x15af60){var _0x130ddf=typeof _0x26d395[_0xcebd('0x19')]===_0xcebd('0x1a')&&typeof _0x26d395['limit']==='undefined';var _0x1224aa=_0x15af60[_0xcebd('0x1b')];var _0x5916bd=_0x130ddf?0x0:_0x26d395['offset'];var _0x4acf94=_0x130ddf?_0x15af60[_0xcebd('0x1b')]:_0x26d395[_0xcebd('0x19')]+_0x26d395[_0xcebd('0x1c')];var _0x4a730e;if(_0x4acf94>=_0x1224aa){_0x4acf94=_0x1224aa;_0x4a730e=0xc8;}else{_0x4a730e=0xce;}_0x14a286['status'](_0x4a730e);return _0x14a286[_0xcebd('0x1d')](_0xcebd('0x1e'),_0x5916bd+'-'+_0x4acf94+'/'+_0x1224aa)['json'](_0x15af60);}return null;};}function patchUpdates(_0x313854){return function(_0x3ea72d){try{jsonpatch[_0xcebd('0x1f')](_0x3ea72d,_0x313854,!![]);}catch(_0x47aaee){return BPromise[_0xcebd('0x20')](_0x47aaee);}return _0x3ea72d[_0xcebd('0x21')]();};}function saveUpdates(_0x172547,_0x14bdb4){return function(_0x3fa0ec){if(_0x3fa0ec){return _0x3fa0ec[_0xcebd('0x22')](_0x172547)[_0xcebd('0x23')](function(_0x1cd887){return _0x1cd887;});}return null;};}function removeEntity(_0x8e02d0,_0x26235a){return function(_0x24b2bd){if(_0x24b2bd){return _0x24b2bd[_0xcebd('0x24')]()['then'](function(){var _0x5b51c8=_0x24b2bd[_0xcebd('0x25')]({'plain':!![]});var _0x51e1da=_0xcebd('0x26');return db['UserProfileResource'][_0xcebd('0x24')]({'where':{'type':_0x51e1da,'resourceId':_0x5b51c8['id']}})[_0xcebd('0x23')](function(){return _0x24b2bd;});})[_0xcebd('0x23')](function(){_0x8e02d0[_0xcebd('0x17')](0xcc)[_0xcebd('0x18')]();});}};}function handleEntityNotFound(_0x514cbb,_0x42f68f){return function(_0x296143){if(!_0x296143){_0x514cbb[_0xcebd('0x16')](0x194);}return _0x296143;};}function handleError(_0x1bdd7b,_0x575300){_0x575300=_0x575300||0x1f4;return function(_0x11d94a){logger[_0xcebd('0x27')](_0x11d94a[_0xcebd('0x28')]);if(_0x11d94a['name']){delete _0x11d94a['name'];}_0x1bdd7b[_0xcebd('0x17')](_0x575300)['send'](_0x11d94a);};}exports[_0xcebd('0x29')]=function(_0x312a59,_0x362287){var _0xb8fab8={},_0xd3afcc={},_0x947abf={'count':0x0,'rows':[]};var _0x3dd8aa=_[_0xcebd('0x2a')](db[_0xcebd('0x2b')]['rawAttributes'],function(_0x37884f){return{'name':_0x37884f[_0xcebd('0x2c')],'type':_0x37884f['type'][_0xcebd('0x2d')]};});_0xd3afcc[_0xcebd('0x2e')]=_['map'](_0x3dd8aa,'name');_0xd3afcc['query']=_[_0xcebd('0x2f')](_0x312a59[_0xcebd('0x30')]);_0xd3afcc['filters']=_['intersection'](_0xd3afcc[_0xcebd('0x2e')],_0xd3afcc[_0xcebd('0x30')]);_0xb8fab8[_0xcebd('0x31')]=_[_0xcebd('0x32')](_0xd3afcc[_0xcebd('0x2e')],qs[_0xcebd('0x33')](_0x312a59[_0xcebd('0x30')][_0xcebd('0x33')]));_0xb8fab8['attributes']=_0xb8fab8['attributes']['length']?_0xb8fab8[_0xcebd('0x31')]:_0xd3afcc[_0xcebd('0x2e')];if(!_0x312a59[_0xcebd('0x30')][_0xcebd('0x34')](_0xcebd('0x35'))){_0xb8fab8[_0xcebd('0x1c')]=qs[_0xcebd('0x1c')](_0x312a59[_0xcebd('0x30')][_0xcebd('0x1c')]);_0xb8fab8[_0xcebd('0x19')]=qs[_0xcebd('0x19')](_0x312a59[_0xcebd('0x30')][_0xcebd('0x19')]);}_0xb8fab8[_0xcebd('0x36')]=qs[_0xcebd('0x37')](_0x312a59[_0xcebd('0x30')][_0xcebd('0x37')]);_0xb8fab8['where']=qs['filters'](_[_0xcebd('0x38')](_0x312a59[_0xcebd('0x30')],_0xd3afcc['filters']),_0x3dd8aa);if(_0x312a59[_0xcebd('0x30')]['filter']){_0xb8fab8[_0xcebd('0x39')]=_['merge'](_0xb8fab8[_0xcebd('0x39')],{'$or':_['map'](_0x3dd8aa,function(_0x13bcbc){if(_0x13bcbc[_0xcebd('0x3a')]!==_0xcebd('0x3b')){var _0xb3bac8={};_0xb3bac8[_0x13bcbc[_0xcebd('0x3c')]]={'$like':'%'+_0x312a59['query'][_0xcebd('0x3d')]+'%'};return _0xb3bac8;}})});}_0xb8fab8=_[_0xcebd('0x3e')]({},_0xb8fab8,_0x312a59[_0xcebd('0x3f')]);var _0x21c449={'where':_0xb8fab8[_0xcebd('0x39')]};return db[_0xcebd('0x2b')][_0xcebd('0x1b')](_0x21c449)[_0xcebd('0x23')](function(_0x21a49b){_0x947abf['count']=_0x21a49b;if(_0x312a59[_0xcebd('0x30')][_0xcebd('0x40')]){_0xb8fab8[_0xcebd('0x41')]=[{'all':!![]}];}return db[_0xcebd('0x2b')][_0xcebd('0x42')](_0xb8fab8);})[_0xcebd('0x23')](function(_0x3d37f4){_0x947abf[_0xcebd('0x43')]=_0x3d37f4;return _0x947abf;})[_0xcebd('0x23')](respondWithFilteredResult(_0x362287,_0xb8fab8))[_0xcebd('0x44')](handleError(_0x362287,null));};exports['show']=function(_0x4e35c9,_0x4f725d){var _0x101071={'raw':!![],'where':{'id':_0x4e35c9[_0xcebd('0x45')]['id']}},_0x5edbf1={};_0x5edbf1[_0xcebd('0x2e')]=_[_0xcebd('0x2f')](db[_0xcebd('0x2b')]['rawAttributes']);_0x5edbf1['query']=_[_0xcebd('0x2f')](_0x4e35c9[_0xcebd('0x30')]);_0x5edbf1[_0xcebd('0x46')]=_['intersection'](_0x5edbf1[_0xcebd('0x2e')],_0x5edbf1['query']);_0x101071[_0xcebd('0x31')]=_[_0xcebd('0x32')](_0x5edbf1[_0xcebd('0x2e')],qs[_0xcebd('0x33')](_0x4e35c9[_0xcebd('0x30')][_0xcebd('0x33')]));_0x101071['attributes']=_0x101071[_0xcebd('0x31')][_0xcebd('0x47')]?_0x101071['attributes']:_0x5edbf1[_0xcebd('0x2e')];if(_0x4e35c9[_0xcebd('0x30')][_0xcebd('0x40')]){_0x101071[_0xcebd('0x41')]=[{'all':!![]}];}_0x101071=_['merge']({},_0x101071,_0x4e35c9['options']);return db[_0xcebd('0x2b')][_0xcebd('0x48')](_0x101071)[_0xcebd('0x23')](handleEntityNotFound(_0x4f725d,null))['then'](respondWithResult(_0x4f725d,null))[_0xcebd('0x44')](handleError(_0x4f725d,null));};exports[_0xcebd('0x49')]=function(_0x4a68f,_0x3c9765){return db[_0xcebd('0x2b')]['create'](_0x4a68f[_0xcebd('0x4a')],{})[_0xcebd('0x23')](function(_0x4b13ec){var _0x269ea3=_0x4a68f['user'][_0xcebd('0x25')]({'plain':!![]});if(!_0x269ea3)throw new Error(_0xcebd('0x4b'));if(_0x269ea3[_0xcebd('0x4c')]===_0xcebd('0x4d')){var _0x2ca938=_0x4b13ec[_0xcebd('0x25')]({'plain':!![]});var _0x1cd1c2=_0xcebd('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x1cd1c2,'userProfileId':_0x269ea3[_0xcebd('0x4e')]},'raw':!![]})[_0xcebd('0x23')](function(_0x857e07){if(_0x857e07&&_0x857e07[_0xcebd('0x4f')]===0x0){return db[_0xcebd('0x50')][_0xcebd('0x49')]({'name':_0x2ca938[_0xcebd('0x3c')],'resourceId':_0x2ca938['id'],'type':_0x857e07[_0xcebd('0x3c')],'sectionId':_0x857e07['id']},{})[_0xcebd('0x23')](function(){return _0x4b13ec;});}else{return _0x4b13ec;}})[_0xcebd('0x44')](function(_0xd0c30d){logger[_0xcebd('0x27')](_0xcebd('0x51'),_0xd0c30d);throw _0xd0c30d;});}return _0x4b13ec;})['then'](respondWithResult(_0x3c9765,0xc9))['catch'](handleError(_0x3c9765,null));};exports[_0xcebd('0x22')]=function(_0x56f412,_0x9e75e7){if(_0x56f412[_0xcebd('0x4a')]['id']){delete _0x56f412[_0xcebd('0x4a')]['id'];}return db['Disposition'][_0xcebd('0x48')]({'where':{'id':_0x56f412[_0xcebd('0x45')]['id']}})['then'](handleEntityNotFound(_0x9e75e7,null))['then'](saveUpdates(_0x56f412[_0xcebd('0x4a')],null))['then'](respondWithResult(_0x9e75e7,null))[_0xcebd('0x44')](handleError(_0x9e75e7,null));};exports[_0xcebd('0x24')]=function(_0x5dee6c,_0x39d5a4){return db[_0xcebd('0x2b')][_0xcebd('0x48')]({'where':{'id':_0x5dee6c[_0xcebd('0x45')]['id']}})[_0xcebd('0x23')](handleEntityNotFound(_0x39d5a4,null))['then'](removeEntity(_0x39d5a4,null))[_0xcebd('0x44')](handleError(_0x39d5a4,null));}; \ No newline at end of file +var _0x09b0=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','name','index','Disposition','rawAttributes','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0xf65ee,_0x1aa2ec){var _0x461dff=function(_0x3eccee){while(--_0x3eccee){_0xf65ee['push'](_0xf65ee['shift']());}};_0x461dff(++_0x1aa2ec);}(_0x09b0,0xa0));var _0x009b=function(_0x509568,_0x26cba9){_0x509568=_0x509568-0x0;var _0x4eae81=_0x09b0[_0x509568];return _0x4eae81;};'use strict';var emlformat=require(_0x009b('0x0'));var rimraf=require(_0x009b('0x1'));var zipdir=require(_0x009b('0x2'));var jsonpatch=require(_0x009b('0x3'));var rp=require(_0x009b('0x4'));var moment=require('moment');var BPromise=require(_0x009b('0x5'));var Mustache=require('mustache');var util=require(_0x009b('0x6'));var path=require(_0x009b('0x7'));var sox=require(_0x009b('0x8'));var csv=require(_0x009b('0x9'));var ejs=require(_0x009b('0xa'));var fs=require('fs');var fs_extra=require(_0x009b('0xb'));var _=require(_0x009b('0xc'));var squel=require(_0x009b('0xd'));var crypto=require(_0x009b('0xe'));var jsforce=require(_0x009b('0xf'));var deskjs=require(_0x009b('0x10'));var toCsv=require(_0x009b('0x9'));var querystring=require(_0x009b('0x11'));var Papa=require(_0x009b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x009b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x009b('0x14'));var logger=require(_0x009b('0x15'))('api');var utils=require(_0x009b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x009b('0x17'))['db'];function respondWithStatusCode(_0x58a43d,_0x29d08f){_0x29d08f=_0x29d08f||0xcc;return function(_0x10b6b3){if(_0x10b6b3){return _0x58a43d[_0x009b('0x18')](_0x29d08f);}return _0x58a43d[_0x009b('0x19')](_0x29d08f)[_0x009b('0x1a')]();};}function respondWithResult(_0x1388f4,_0x239994){_0x239994=_0x239994||0xc8;return function(_0x43202e){if(_0x43202e){return _0x1388f4[_0x009b('0x19')](_0x239994)[_0x009b('0x1b')](_0x43202e);}};}function respondWithFilteredResult(_0x3513bc,_0x225827){return function(_0x3c0268){if(_0x3c0268){var _0x583381=typeof _0x225827[_0x009b('0x1c')]===_0x009b('0x1d')&&typeof _0x225827[_0x009b('0x1e')]===_0x009b('0x1d');var _0x3cad4a=_0x3c0268[_0x009b('0x1f')];var _0x53e764=_0x583381?0x0:_0x225827[_0x009b('0x1c')];var _0x293ab2=_0x583381?_0x3c0268[_0x009b('0x1f')]:_0x225827[_0x009b('0x1c')]+_0x225827[_0x009b('0x1e')];var _0x14986c;if(_0x293ab2>=_0x3cad4a){_0x293ab2=_0x3cad4a;_0x14986c=0xc8;}else{_0x14986c=0xce;}_0x3513bc[_0x009b('0x19')](_0x14986c);return _0x3513bc[_0x009b('0x20')](_0x009b('0x21'),_0x53e764+'-'+_0x293ab2+'/'+_0x3cad4a)['json'](_0x3c0268);}return null;};}function patchUpdates(_0x5e5431){return function(_0x2e5d5e){try{jsonpatch[_0x009b('0x22')](_0x2e5d5e,_0x5e5431,!![]);}catch(_0x1d7fa9){return BPromise[_0x009b('0x23')](_0x1d7fa9);}return _0x2e5d5e[_0x009b('0x24')]();};}function saveUpdates(_0x2a3708,_0x46d088){return function(_0x247d47){if(_0x247d47){return _0x247d47[_0x009b('0x25')](_0x2a3708)[_0x009b('0x26')](function(_0x42b5e3){return _0x42b5e3;});}return null;};}function removeEntity(_0x4433be,_0x502cb3){return function(_0x5def89){if(_0x5def89){return _0x5def89[_0x009b('0x27')]()[_0x009b('0x26')](function(){var _0x48e116=_0x5def89['get']({'plain':!![]});var _0x57d3b2=_0x009b('0x28');return db[_0x009b('0x29')][_0x009b('0x27')]({'where':{'type':_0x57d3b2,'resourceId':_0x48e116['id']}})[_0x009b('0x26')](function(){return _0x5def89;});})['then'](function(){_0x4433be[_0x009b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef9d4,_0x55088f){return function(_0x5b824f){if(!_0x5b824f){_0x3ef9d4[_0x009b('0x18')](0x194);}return _0x5b824f;};}function handleError(_0x49de8e,_0x1df343){_0x1df343=_0x1df343||0x1f4;return function(_0x33f815){logger[_0x009b('0x2a')](_0x33f815['stack']);if(_0x33f815[_0x009b('0x2b')]){delete _0x33f815[_0x009b('0x2b')];}_0x49de8e['status'](_0x1df343)['send'](_0x33f815);};}exports[_0x009b('0x2c')]=function(_0x10f2aa,_0x3c55c8){var _0x5811da={},_0x32b268={},_0x2f939d={'count':0x0,'rows':[]};var _0x476936=_['map'](db[_0x009b('0x2d')][_0x009b('0x2e')],function(_0x3ebd8a){return{'name':_0x3ebd8a['fieldName'],'type':_0x3ebd8a['type'][_0x009b('0x2f')]};});_0x32b268[_0x009b('0x30')]=_[_0x009b('0x31')](_0x476936,_0x009b('0x2b'));_0x32b268[_0x009b('0x32')]=_['keys'](_0x10f2aa[_0x009b('0x32')]);_0x32b268['filters']=_[_0x009b('0x33')](_0x32b268[_0x009b('0x30')],_0x32b268['query']);_0x5811da[_0x009b('0x34')]=_[_0x009b('0x33')](_0x32b268[_0x009b('0x30')],qs['fields'](_0x10f2aa[_0x009b('0x32')][_0x009b('0x35')]));_0x5811da[_0x009b('0x34')]=_0x5811da[_0x009b('0x34')][_0x009b('0x36')]?_0x5811da[_0x009b('0x34')]:_0x32b268['model'];if(!_0x10f2aa[_0x009b('0x32')][_0x009b('0x37')]('nolimit')){_0x5811da[_0x009b('0x1e')]=qs['limit'](_0x10f2aa[_0x009b('0x32')]['limit']);_0x5811da[_0x009b('0x1c')]=qs[_0x009b('0x1c')](_0x10f2aa[_0x009b('0x32')][_0x009b('0x1c')]);}_0x5811da[_0x009b('0x38')]=qs[_0x009b('0x39')](_0x10f2aa[_0x009b('0x32')][_0x009b('0x39')]);_0x5811da[_0x009b('0x3a')]=qs[_0x009b('0x3b')](_[_0x009b('0x3c')](_0x10f2aa[_0x009b('0x32')],_0x32b268[_0x009b('0x3b')]),_0x476936);if(_0x10f2aa[_0x009b('0x32')][_0x009b('0x3d')]){_0x5811da[_0x009b('0x3a')]=_[_0x009b('0x3e')](_0x5811da[_0x009b('0x3a')],{'$or':_[_0x009b('0x31')](_0x476936,function(_0x2bc82e){if(_0x2bc82e[_0x009b('0x3f')]!==_0x009b('0x40')){var _0x493c9d={};_0x493c9d[_0x2bc82e[_0x009b('0x2b')]]={'$like':'%'+_0x10f2aa[_0x009b('0x32')][_0x009b('0x3d')]+'%'};return _0x493c9d;}})});}_0x5811da=_[_0x009b('0x3e')]({},_0x5811da,_0x10f2aa['options']);var _0x506316={'where':_0x5811da[_0x009b('0x3a')]};return db[_0x009b('0x2d')]['count'](_0x506316)['then'](function(_0xfe9d06){_0x2f939d[_0x009b('0x1f')]=_0xfe9d06;if(_0x10f2aa[_0x009b('0x32')][_0x009b('0x41')]){_0x5811da['include']=[{'all':!![]}];}return db[_0x009b('0x2d')]['findAll'](_0x5811da);})[_0x009b('0x26')](function(_0x3fdd71){_0x2f939d[_0x009b('0x42')]=_0x3fdd71;return _0x2f939d;})[_0x009b('0x26')](respondWithFilteredResult(_0x3c55c8,_0x5811da))[_0x009b('0x43')](handleError(_0x3c55c8,null));};exports[_0x009b('0x44')]=function(_0x5eb66e,_0x4159a5){var _0x15cde0={'raw':!![],'where':{'id':_0x5eb66e[_0x009b('0x45')]['id']}},_0x2648e6={};_0x2648e6[_0x009b('0x30')]=_[_0x009b('0x46')](db[_0x009b('0x2d')][_0x009b('0x2e')]);_0x2648e6[_0x009b('0x32')]=_['keys'](_0x5eb66e['query']);_0x2648e6['filters']=_[_0x009b('0x33')](_0x2648e6[_0x009b('0x30')],_0x2648e6[_0x009b('0x32')]);_0x15cde0['attributes']=_[_0x009b('0x33')](_0x2648e6['model'],qs[_0x009b('0x35')](_0x5eb66e[_0x009b('0x32')][_0x009b('0x35')]));_0x15cde0['attributes']=_0x15cde0['attributes'][_0x009b('0x36')]?_0x15cde0[_0x009b('0x34')]:_0x2648e6[_0x009b('0x30')];if(_0x5eb66e[_0x009b('0x32')]['includeAll']){_0x15cde0['include']=[{'all':!![]}];}_0x15cde0=_['merge']({},_0x15cde0,_0x5eb66e['options']);return db['Disposition'][_0x009b('0x47')](_0x15cde0)[_0x009b('0x26')](handleEntityNotFound(_0x4159a5,null))[_0x009b('0x26')](respondWithResult(_0x4159a5,null))['catch'](handleError(_0x4159a5,null));};exports[_0x009b('0x48')]=function(_0x1ddfb4,_0x2fe0ed){return db[_0x009b('0x2d')]['create'](_0x1ddfb4[_0x009b('0x49')],{})['then'](function(_0x7c2711){var _0x4c7eb2=_0x1ddfb4[_0x009b('0x4a')][_0x009b('0x4b')]({'plain':!![]});if(!_0x4c7eb2)throw new Error(_0x009b('0x4c'));if(_0x4c7eb2[_0x009b('0x4d')]===_0x009b('0x4a')){var _0x2fd75b=_0x7c2711[_0x009b('0x4b')]({'plain':!![]});var _0x545634=_0x009b('0x28');return db[_0x009b('0x4e')][_0x009b('0x47')]({'where':{'name':_0x545634,'userProfileId':_0x4c7eb2['userProfileId']},'raw':!![]})[_0x009b('0x26')](function(_0x34b492){if(_0x34b492&&_0x34b492[_0x009b('0x4f')]===0x0){return db['UserProfileResource'][_0x009b('0x48')]({'name':_0x2fd75b['name'],'resourceId':_0x2fd75b['id'],'type':_0x34b492['name'],'sectionId':_0x34b492['id']},{})[_0x009b('0x26')](function(){return _0x7c2711;});}else{return _0x7c2711;}})[_0x009b('0x43')](function(_0x323a28){logger[_0x009b('0x2a')](_0x009b('0x50'),_0x323a28);throw _0x323a28;});}return _0x7c2711;})['then'](respondWithResult(_0x2fe0ed,0xc9))[_0x009b('0x43')](handleError(_0x2fe0ed,null));};exports['update']=function(_0x34446d,_0x2e8ca3){if(_0x34446d[_0x009b('0x49')]['id']){delete _0x34446d[_0x009b('0x49')]['id'];}return db[_0x009b('0x2d')]['find']({'where':{'id':_0x34446d[_0x009b('0x45')]['id']}})[_0x009b('0x26')](handleEntityNotFound(_0x2e8ca3,null))['then'](saveUpdates(_0x34446d['body'],null))[_0x009b('0x26')](respondWithResult(_0x2e8ca3,null))[_0x009b('0x43')](handleError(_0x2e8ca3,null));};exports[_0x009b('0x27')]=function(_0x3cea05,_0x38159e){return db['Disposition'][_0x009b('0x47')]({'where':{'id':_0x3cea05['params']['id']}})[_0x009b('0x26')](handleEntityNotFound(_0x38159e,null))[_0x009b('0x26')](removeEntity(_0x38159e,null))[_0x009b('0x43')](handleError(_0x38159e,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1077064..57876d1 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 _0xde13=['FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x3a9457,_0x1158bc){var _0x8575fd=function(_0x4c528c){while(--_0x4c528c){_0x3a9457['push'](_0x3a9457['shift']());}};_0x8575fd(++_0x1158bc);}(_0xde13,0x149));var _0x3de1=function(_0x4acb5b,_0x1a2182){_0x4acb5b=_0x4acb5b-0x0;var _0x1d30ef=_0xde13[_0x4acb5b];return _0x1d30ef;};'use strict';var _=require(_0x3de1('0x0'));var util=require('util');var logger=require(_0x3de1('0x1'))(_0x3de1('0x2'));var moment=require('moment');var BPromise=require(_0x3de1('0x3'));var rp=require(_0x3de1('0x4'));var fs=require('fs');var path=require(_0x3de1('0x5'));var rimraf=require(_0x3de1('0x6'));var config=require(_0x3de1('0x7'));var attributes=require(_0x3de1('0x8'));module[_0x3de1('0x9')]=function(_0x1689ed,_0x38d943){return _0x1689ed['define'](_0x3de1('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x3de1('0xb'),'fields':[_0x3de1('0xc'),_0x3de1('0xd')]},{'unique':!![],'name':_0x3de1('0xe'),'fields':[_0x3de1('0xc'),_0x3de1('0xf')]},{'unique':!![],'name':_0x3de1('0x10'),'fields':[_0x3de1('0xc'),_0x3de1('0x11')]},{'unique':!![],'name':_0x3de1('0x12'),'fields':[_0x3de1('0xc'),_0x3de1('0x13')]},{'unique':!![],'name':_0x3de1('0x14'),'fields':['name',_0x3de1('0x15')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x3de1('0x16')]},{'unique':!![],'name':_0x3de1('0x17'),'fields':[_0x3de1('0xc'),_0x3de1('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5116=['Disposition','name_voice','name','ListId','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define'];(function(_0x5395f8,_0xfe9d67){var _0xd6638e=function(_0x4933aa){while(--_0x4933aa){_0x5395f8['push'](_0x5395f8['shift']());}};_0xd6638e(++_0xfe9d67);}(_0x5116,0xee));var _0x6511=function(_0x169405,_0x22b96f){_0x169405=_0x169405-0x0;var _0x322695=_0x5116[_0x169405];return _0x322695;};'use strict';var _=require(_0x6511('0x0'));var util=require(_0x6511('0x1'));var logger=require(_0x6511('0x2'))(_0x6511('0x3'));var moment=require(_0x6511('0x4'));var BPromise=require(_0x6511('0x5'));var rp=require(_0x6511('0x6'));var fs=require('fs');var path=require(_0x6511('0x7'));var rimraf=require('rimraf');var config=require(_0x6511('0x8'));var attributes=require(_0x6511('0x9'));module[_0x6511('0xa')]=function(_0x3ce9cd,_0x2b162a){return _0x3ce9cd[_0x6511('0xb')](_0x6511('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6511('0xd'),'fields':[_0x6511('0xe'),_0x6511('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0x6511('0xe'),_0x6511('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x6511('0xe'),_0x6511('0x11')]},{'unique':!![],'name':_0x6511('0x12'),'fields':['name',_0x6511('0x13')]},{'unique':!![],'name':_0x6511('0x14'),'fields':[_0x6511('0xe'),_0x6511('0x15')]},{'unique':!![],'name':_0x6511('0x16'),'fields':[_0x6511('0xe'),_0x6511('0x17')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x6511('0xe'),_0x6511('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 97948da..99f9b56 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(_0xf6d747,_0x3bbefc){var _0x21fe1a=function(_0x5a9723){while(--_0x5a9723){_0xf6d747['push'](_0xf6d747['shift']());}};_0x21fe1a(++_0x3bbefc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x544801,_0x42ca3f){var _0x39d88a=function(_0x127a1e){while(--_0x127a1e){_0x544801['push'](_0x544801['shift']());}};_0x39d88a(++_0x42ca3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 5f050c6..25821f2 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 _0xa010=['post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa010,0xb2));var _0x0a01=function(_0x12deb3,_0x541af1){_0x12deb3=_0x12deb3-0x0;var _0x16139c=_0xa010[_0x12deb3];return _0x16139c;};'use strict';var multer=require(_0x0a01('0x0'));var util=require(_0x0a01('0x1'));var path=require(_0x0a01('0x2'));var timeout=require(_0x0a01('0x3'));var express=require(_0x0a01('0x4'));var router=express[_0x0a01('0x5')]();var fs_extra=require(_0x0a01('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0a01('0x7'));var config=require(_0x0a01('0x8'));var controller=require('./disposition.controller');router['get']('/',auth[_0x0a01('0x9')](),controller['index']);router[_0x0a01('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a01('0xb')]);router[_0x0a01('0xc')]('/',auth[_0x0a01('0x9')](),controller[_0x0a01('0xd')]);router[_0x0a01('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0a01('0xf')](_0x0a01('0x10'),auth[_0x0a01('0x9')](),controller[_0x0a01('0x11')]);module[_0x0a01('0x12')]=router; \ No newline at end of file +var _0xbf94=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5a0895,_0x3c35b8){var _0x253cbc=function(_0x48f39c){while(--_0x48f39c){_0x5a0895['push'](_0x5a0895['shift']());}};_0x253cbc(++_0x3c35b8);}(_0xbf94,0xe9));var _0x4bf9=function(_0x470e47,_0x52ae97){_0x470e47=_0x470e47-0x0;var _0x42b396=_0xbf94[_0x470e47];return _0x42b396;};'use strict';var multer=require(_0x4bf9('0x0'));var util=require('util');var path=require(_0x4bf9('0x1'));var timeout=require(_0x4bf9('0x2'));var express=require(_0x4bf9('0x3'));var router=express[_0x4bf9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4bf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4bf9('0x6'));var controller=require(_0x4bf9('0x7'));router[_0x4bf9('0x8')]('/',auth[_0x4bf9('0x9')](),controller[_0x4bf9('0xa')]);router[_0x4bf9('0x8')](_0x4bf9('0xb'),auth['isAuthenticated'](),controller[_0x4bf9('0xc')]);router[_0x4bf9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4bf9('0xe')](_0x4bf9('0xb'),auth[_0x4bf9('0x9')](),controller[_0x4bf9('0xf')]);router[_0x4bf9('0x10')](_0x4bf9('0xb'),auth[_0x4bf9('0x9')](),controller[_0x4bf9('0x11')]);module[_0x4bf9('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index c8aad86..27f2add 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 _0x17fc=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','7200','12000','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN'];(function(_0x5aa4c5,_0x2ab636){var _0x1ad5b9=function(_0x25ca44){while(--_0x25ca44){_0x5aa4c5['push'](_0x5aa4c5['shift']());}};_0x1ad5b9(++_0x2ab636);}(_0x17fc,0x1ae));var _0xc17f=function(_0x1d56ac,_0x4b9c84){_0x1d56ac=_0x1d56ac-0x0;var _0xa7d71e=_0x17fc[_0x1d56ac];return _0xa7d71e;};'use strict';var Sequelize=require(_0xc17f('0x0'));module[_0xc17f('0x1')]={'name':{'type':Sequelize[_0xc17f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xc17f('0x3')](_0xc17f('0x4'),'no'),'defaultValue':_0xc17f('0x4')},'headerinfo':{'type':Sequelize[_0xc17f('0x2')],'defaultValue':_0xc17f('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xc17f('0x6')},'minrate':{'type':Sequelize[_0xc17f('0x3')](_0xc17f('0x7'),_0xc17f('0x8'),'7200',_0xc17f('0x9'),'12000',_0xc17f('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xc17f('0x3')]('2400',_0xc17f('0x8'),_0xc17f('0xb'),'9600',_0xc17f('0xc'),'14400'),'defaultValue':_0xc17f('0xa')},'modem':{'type':Sequelize[_0xc17f('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc17f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc17f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc17f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc17f('0x3')](_0xc17f('0xe'),_0xc17f('0xf'),_0xc17f('0x10'),_0xc17f('0x11')),'defaultValue':_0xc17f('0xe')},'key':{'type':Sequelize[_0xc17f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc17f('0x12')],'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[_0xc17f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc17f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc17f('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc17f('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xc17f('0x13')],'defaultValue':![],'comment':_0xc17f('0x15'),'set':function(_0x683ddb){if(!_0x683ddb)this[_0xc17f('0x16')](_0xc17f('0x17'),null);this['setDataValue'](_0xc17f('0x18'),_0x683ddb);}}}; \ No newline at end of file +var _0x1515=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1515,0x104));var _0x5151=function(_0x129c99,_0x1e1b6b){_0x129c99=_0x129c99-0x0;var _0x1b6dbc=_0x1515[_0x129c99];return _0x1b6dbc;};'use strict';var Sequelize=require(_0x5151('0x0'));module['exports']={'name':{'type':Sequelize[_0x5151('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5151('0x1')]},'ecm':{'type':Sequelize[_0x5151('0x2')](_0x5151('0x3'),'no'),'defaultValue':_0x5151('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x5151('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0x5151('0x5'),_0x5151('0x6'),_0x5151('0x7'),_0x5151('0x8'),'12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x5151('0x2')](_0x5151('0x5'),_0x5151('0x6'),_0x5151('0x7'),_0x5151('0x8'),_0x5151('0x9'),'14400'),'defaultValue':_0x5151('0xa')},'modem':{'type':Sequelize[_0x5151('0x1')],'defaultValue':_0x5151('0xb')},'gateway':{'type':Sequelize[_0x5151('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5151('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5151('0x2')](_0x5151('0xd'),_0x5151('0xe'),'DADHI',_0x5151('0xf')),'defaultValue':_0x5151('0xd')},'key':{'type':Sequelize[_0x5151('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5151('0x10')],'defaultValue':function(){return _0x5151('0x11');}},'notificationSound':{'type':Sequelize[_0x5151('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5151('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5151('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5151('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5151('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5151('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5151('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5151('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x5151('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x5151('0x12')],'defaultValue':![],'comment':_0x5151('0x14'),'set':function(_0x4cb5da){if(!_0x4cb5da)this[_0x5151('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5151('0x16'),_0x4cb5da);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e69acbe..96957a9 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 _0x4548=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','pick','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','tech','key','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','FaxAccounts','sendStatus','stack','name','send','index','Pause','FaxAccount','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','mandatoryDispositionPause','includeAll','find','create','body'];(function(_0x4f5587,_0x29137f){var _0x7445e1=function(_0x82acb1){while(--_0x82acb1){_0x4f5587['push'](_0x4f5587['shift']());}};_0x7445e1(++_0x29137f);}(_0x4548,0x127));var _0x8454=function(_0x407f63,_0x4c045f){_0x407f63=_0x407f63-0x0;var _0x2ff96b=_0x4548[_0x407f63];return _0x2ff96b;};'use strict';var emlformat=require(_0x8454('0x0'));var rimraf=require(_0x8454('0x1'));var zipdir=require(_0x8454('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8454('0x3'));var BPromise=require(_0x8454('0x4'));var Mustache=require(_0x8454('0x5'));var util=require(_0x8454('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(_0x8454('0x7'));var _=require('lodash');var squel=require(_0x8454('0x8'));var crypto=require(_0x8454('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8454('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8454('0xb'));var Papa=require(_0x8454('0xc'));var Redis=require('ioredis');var authService=require(_0x8454('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8454('0xe'));var logger=require('../../config/logger')(_0x8454('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8454('0x10'))['db'];config[_0x8454('0x11')]=_[_0x8454('0x12')](config[_0x8454('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x8454('0x13'))(new Redis(config[_0x8454('0x11')]));require(_0x8454('0x14'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8454('0x15')][_0x8454('0x16')]({'port':0x232c});var client9002=jayson[_0x8454('0x15')][_0x8454('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5c0da7,_0x45e0fc,_0x438f8a,_0x547f32){return new BPromise(function(_0x4a614a,_0x35201a){var _0x28298c=_0x547f32||client;return _0x28298c[_0x8454('0x17')](_0x5c0da7,_0x438f8a)[_0x8454('0x18')](function(_0x49cd15){logger[_0x8454('0x19')]('FaxAccount,\x20%s,\x20%s',_0x45e0fc,'request\x20sent');logger[_0x8454('0x1a')](_0x8454('0x1b'),_0x45e0fc,_0x8454('0x1c'),JSON[_0x8454('0x1d')](_0x49cd15));if(_0x49cd15[_0x8454('0x1e')]){if(_0x49cd15[_0x8454('0x1e')]['code']===0x1f4){logger[_0x8454('0x1e')](_0x8454('0x1f'),_0x45e0fc,_0x49cd15['error']['message']);return _0x35201a(_0x49cd15[_0x8454('0x1e')][_0x8454('0x20')]);}logger[_0x8454('0x1e')](_0x8454('0x1f'),_0x45e0fc,_0x49cd15[_0x8454('0x1e')][_0x8454('0x20')]);return _0x4a614a(_0x49cd15[_0x8454('0x1e')]['message']);}else{logger['info'](_0x8454('0x1f'),_0x45e0fc,_0x8454('0x1c'));_0x4a614a(_0x49cd15[_0x8454('0x21')][_0x8454('0x20')]);}})['catch'](function(_0x38e5af){logger[_0x8454('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x45e0fc,_0x38e5af);_0x35201a(_0x38e5af);});});}function respondWithStatusCode(_0x3c8f34,_0x3642d4){_0x3642d4=_0x3642d4||0xcc;return function(_0x170d4b){if(_0x170d4b){return _0x3c8f34['sendStatus'](_0x3642d4);}return _0x3c8f34['status'](_0x3642d4)[_0x8454('0x22')]();};}function respondWithResult(_0x1a7cd8,_0x2e3769){_0x2e3769=_0x2e3769||0xc8;return function(_0x5dee76){if(_0x5dee76){return _0x1a7cd8[_0x8454('0x23')](_0x2e3769)[_0x8454('0x24')](_0x5dee76);}};}function respondWithFilteredResult(_0x59c8ab,_0x4a80a6){return function(_0x39984c){if(_0x39984c){var _0x302a3d=typeof _0x4a80a6[_0x8454('0x25')]===_0x8454('0x26')&&typeof _0x4a80a6[_0x8454('0x27')]===_0x8454('0x26');var _0x33612d=_0x39984c[_0x8454('0x28')];var _0x1bb9d3=_0x302a3d?0x0:_0x4a80a6[_0x8454('0x25')];var _0x1bddf5=_0x302a3d?_0x39984c[_0x8454('0x28')]:_0x4a80a6[_0x8454('0x25')]+_0x4a80a6[_0x8454('0x27')];var _0x127699;if(_0x1bddf5>=_0x33612d){_0x1bddf5=_0x33612d;_0x127699=0xc8;}else{_0x127699=0xce;}_0x59c8ab[_0x8454('0x23')](_0x127699);return _0x59c8ab[_0x8454('0x29')]('Content-Range',_0x1bb9d3+'-'+_0x1bddf5+'/'+_0x33612d)[_0x8454('0x24')](_0x39984c);}return null;};}function patchUpdates(_0x5cb749){return function(_0x43282f){try{jsonpatch[_0x8454('0x2a')](_0x43282f,_0x5cb749,!![]);}catch(_0x265b4f){return BPromise[_0x8454('0x2b')](_0x265b4f);}return _0x43282f[_0x8454('0x2c')]();};}function saveUpdates(_0x3f3f9c,_0x79e5d8){return function(_0x4b0885){if(_0x4b0885){return _0x4b0885[_0x8454('0x2d')](_0x3f3f9c)['then'](function(_0x376dfe){return _0x376dfe;});}return null;};}function removeEntity(_0x316a85,_0x208162){return function(_0x571778){if(_0x571778){return _0x571778[_0x8454('0x2e')]()['then'](function(){var _0x3d13ff=_0x571778['get']({'plain':!![]});var _0x3f0b33=_0x8454('0x2f');return db['UserProfileResource'][_0x8454('0x2e')]({'where':{'type':_0x3f0b33,'resourceId':_0x3d13ff['id']}})['then'](function(){return _0x571778;});})['then'](function(){_0x316a85[_0x8454('0x23')](0xcc)[_0x8454('0x22')]();});}};}function handleEntityNotFound(_0xc5a363,_0x559f47){return function(_0x42351d){if(!_0x42351d){_0xc5a363[_0x8454('0x30')](0x194);}return _0x42351d;};}function handleError(_0x1c07aa,_0x303427){_0x303427=_0x303427||0x1f4;return function(_0xc9ca48){logger[_0x8454('0x1e')](_0xc9ca48[_0x8454('0x31')]);if(_0xc9ca48[_0x8454('0x32')]){delete _0xc9ca48['name'];}_0x1c07aa[_0x8454('0x23')](_0x303427)[_0x8454('0x33')](_0xc9ca48);};}exports[_0x8454('0x34')]=function(_0x3955da,_0x5079c2){var _0x3968a0={'include':[{'model':db[_0x8454('0x35')],'as':'mandatoryDispositionPause'}]},_0x5da5de={},_0x10d5c9={'count':0x0,'rows':[]};var _0xd589c2=_['map'](db[_0x8454('0x36')][_0x8454('0x37')],function(_0x4cbfa0){return{'name':_0x4cbfa0[_0x8454('0x38')],'type':_0x4cbfa0[_0x8454('0x39')]['key']};});_0x5da5de[_0x8454('0x3a')]=_[_0x8454('0x3b')](_0xd589c2,_0x8454('0x32'));_0x5da5de['query']=_[_0x8454('0x3c')](_0x3955da[_0x8454('0x3d')]);_0x5da5de[_0x8454('0x3e')]=_['intersection'](_0x5da5de[_0x8454('0x3a')],_0x5da5de['query']);_0x3968a0[_0x8454('0x3f')]=_[_0x8454('0x40')](_0x5da5de[_0x8454('0x3a')],qs[_0x8454('0x41')](_0x3955da[_0x8454('0x3d')][_0x8454('0x41')]));_0x3968a0['attributes']=_0x3968a0[_0x8454('0x3f')][_0x8454('0x42')]?_0x3968a0['attributes']:_0x5da5de[_0x8454('0x3a')];if(!_0x3955da[_0x8454('0x3d')][_0x8454('0x43')](_0x8454('0x44'))){_0x3968a0[_0x8454('0x27')]=qs['limit'](_0x3955da[_0x8454('0x3d')][_0x8454('0x27')]);_0x3968a0[_0x8454('0x25')]=qs[_0x8454('0x25')](_0x3955da['query'][_0x8454('0x25')]);}_0x3968a0[_0x8454('0x45')]=qs[_0x8454('0x46')](_0x3955da[_0x8454('0x3d')][_0x8454('0x46')]);_0x3968a0['where']=qs[_0x8454('0x3e')](_['pick'](_0x3955da['query'],_0x5da5de[_0x8454('0x3e')]),_0xd589c2);if(_0x3955da[_0x8454('0x3d')][_0x8454('0x47')]){_0x3968a0['where']=_['merge'](_0x3968a0[_0x8454('0x48')],{'$or':_['map'](_0xd589c2,function(_0x1ff1d5){if(_0x1ff1d5[_0x8454('0x39')]!==_0x8454('0x49')){var _0x469a12={};_0x469a12[_0x1ff1d5[_0x8454('0x32')]]={'$like':'%'+_0x3955da['query']['filter']+'%'};return _0x469a12;}})});}_0x3968a0=_[_0x8454('0x4a')]({},_0x3968a0,_0x3955da[_0x8454('0x4b')]);var _0x2f234d={'where':_0x3968a0[_0x8454('0x48')]};return db[_0x8454('0x36')][_0x8454('0x28')](_0x2f234d)[_0x8454('0x18')](function(_0x84f4db){_0x10d5c9[_0x8454('0x28')]=_0x84f4db;if(_0x3955da[_0x8454('0x3d')]['includeAll']){_0x3968a0[_0x8454('0x4c')]=[{'all':!![]}];}return db['FaxAccount'][_0x8454('0x4d')](_0x3968a0);})[_0x8454('0x18')](function(_0x4bac47){_0x10d5c9[_0x8454('0x4e')]=_0x4bac47;return _0x10d5c9;})[_0x8454('0x18')](respondWithFilteredResult(_0x5079c2,_0x3968a0))[_0x8454('0x4f')](handleError(_0x5079c2,null));};exports[_0x8454('0x50')]=function(_0xccbd7,_0x3e9be0){var _0x3e6c13={'raw':![],'where':{'id':_0xccbd7[_0x8454('0x51')]['id']},'include':[{'model':db[_0x8454('0x35')],'as':_0x8454('0x52')}]},_0x1db622={};_0x1db622['model']=_[_0x8454('0x3c')](db[_0x8454('0x36')][_0x8454('0x37')]);_0x1db622[_0x8454('0x3d')]=_[_0x8454('0x3c')](_0xccbd7[_0x8454('0x3d')]);_0x1db622[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x1db622['model'],_0x1db622[_0x8454('0x3d')]);_0x3e6c13[_0x8454('0x3f')]=_[_0x8454('0x40')](_0x1db622[_0x8454('0x3a')],qs[_0x8454('0x41')](_0xccbd7[_0x8454('0x3d')][_0x8454('0x41')]));_0x3e6c13[_0x8454('0x3f')]=_0x3e6c13[_0x8454('0x3f')][_0x8454('0x42')]?_0x3e6c13[_0x8454('0x3f')]:_0x1db622[_0x8454('0x3a')];if(_0xccbd7['query'][_0x8454('0x53')]){_0x3e6c13[_0x8454('0x4c')]=[{'all':!![]}];}_0x3e6c13=_[_0x8454('0x4a')]({},_0x3e6c13,_0xccbd7[_0x8454('0x4b')]);return db[_0x8454('0x36')][_0x8454('0x54')](_0x3e6c13)['then'](handleEntityNotFound(_0x3e9be0,null))[_0x8454('0x18')](respondWithResult(_0x3e9be0,null))[_0x8454('0x4f')](handleError(_0x3e9be0,null));};exports[_0x8454('0x55')]=function(_0x3be133,_0x49740f){return db[_0x8454('0x36')][_0x8454('0x55')](_0x3be133[_0x8454('0x56')],{})[_0x8454('0x18')](function(_0x8420d2){var _0x3dd307=_0x3be133['user'][_0x8454('0x57')]({'plain':!![]});if(!_0x3dd307)throw new Error(_0x8454('0x58'));if(_0x3dd307[_0x8454('0x59')]===_0x8454('0x5a')){var _0x2125db=_0x8420d2[_0x8454('0x57')]({'plain':!![]});var _0x46cd3a=_0x8454('0x2f');return db['UserProfileSection'][_0x8454('0x54')]({'where':{'name':_0x46cd3a,'userProfileId':_0x3dd307['userProfileId']},'raw':!![]})[_0x8454('0x18')](function(_0x165c6b){if(_0x165c6b&&_0x165c6b[_0x8454('0x5b')]===0x0){return db['UserProfileResource'][_0x8454('0x55')]({'name':_0x2125db[_0x8454('0x32')],'resourceId':_0x2125db['id'],'type':_0x165c6b[_0x8454('0x32')],'sectionId':_0x165c6b['id']},{})[_0x8454('0x18')](function(){return _0x8420d2;});}else{return _0x8420d2;}})['catch'](function(_0x33482a){logger[_0x8454('0x1e')](_0x8454('0x5c'),_0x33482a);throw _0x33482a;});}return _0x8420d2;})[_0x8454('0x18')](respondWithResult(_0x49740f,0xc9))[_0x8454('0x4f')](handleError(_0x49740f,null));};exports[_0x8454('0x2d')]=function(_0x5c289e,_0x46b3c4){if(_0x5c289e[_0x8454('0x56')]['id']){delete _0x5c289e[_0x8454('0x56')]['id'];}return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x5c289e['params']['id']},'include':[{'model':db[_0x8454('0x35')],'as':_0x8454('0x52')}]})[_0x8454('0x18')](handleEntityNotFound(_0x46b3c4,null))[_0x8454('0x18')](saveUpdates(_0x5c289e[_0x8454('0x56')],null))[_0x8454('0x18')](respondWithResult(_0x46b3c4,null))['catch'](handleError(_0x46b3c4,null));};exports['destroy']=function(_0x37e7c7,_0x35e925){return db['FaxAccount'][_0x8454('0x54')]({'where':{'id':_0x37e7c7['params']['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x35e925,null))[_0x8454('0x18')](removeEntity(_0x35e925,null))[_0x8454('0x4f')](handleError(_0x35e925,null));};exports[_0x8454('0x5d')]=function(_0x440b54,_0xc0377e){return db[_0x8454('0x36')][_0x8454('0x5d')]()[_0x8454('0x18')](respondWithResult(_0xc0377e,null))[_0x8454('0x4f')](handleError(_0xc0377e,null));};exports[_0x8454('0x5e')]=function(_0x309c4c,_0x137e61,_0x230f95){if(_0x309c4c[_0x8454('0x56')]['id']){delete _0x309c4c[_0x8454('0x56')]['id'];}return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x309c4c[_0x8454('0x51')]['id']}})['then'](handleEntityNotFound(_0x137e61,null))[_0x8454('0x18')](function(_0x4d6d61){if(_0x4d6d61){_0x309c4c[_0x8454('0x56')][_0x8454('0x5f')]=_0x4d6d61['id'];return db[_0x8454('0x60')][_0x8454('0x55')](_0x309c4c[_0x8454('0x56')]);}})[_0x8454('0x18')](respondWithResult(_0x137e61,null))['catch'](handleError(_0x137e61,null));};exports[_0x8454('0x61')]=function(_0x10ae60,_0x3adac3,_0x27f838){var _0x53b747={'raw':![],'where':{}};var _0x27fd3e={};var _0x49ba16={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8454('0x62')]({'where':{'id':_0x10ae60['params']['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x3adac3,null))[_0x8454('0x18')](function(_0x14e99f){if(_0x14e99f){_0x27fd3e[_0x8454('0x3a')]=_[_0x8454('0x3c')](db[_0x8454('0x60')][_0x8454('0x37')]);_0x27fd3e[_0x8454('0x3d')]=_[_0x8454('0x3c')](_0x10ae60['query']);_0x27fd3e[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x27fd3e[_0x8454('0x3a')],_0x27fd3e[_0x8454('0x3d')]);_0x53b747[_0x8454('0x3f')]=_['intersection'](_0x27fd3e[_0x8454('0x3a')],qs[_0x8454('0x41')](_0x10ae60[_0x8454('0x3d')][_0x8454('0x41')]));_0x53b747[_0x8454('0x3f')]=_0x53b747[_0x8454('0x3f')]['length']?_0x53b747[_0x8454('0x3f')]:_0x27fd3e[_0x8454('0x3a')];if(!_0x10ae60['query'][_0x8454('0x43')](_0x8454('0x44'))){_0x53b747[_0x8454('0x27')]=qs[_0x8454('0x27')](_0x10ae60[_0x8454('0x3d')][_0x8454('0x27')]);_0x53b747[_0x8454('0x25')]=qs[_0x8454('0x25')](_0x10ae60[_0x8454('0x3d')]['offset']);}_0x53b747[_0x8454('0x45')]=qs['sort'](_0x10ae60[_0x8454('0x3d')]['sort']);_0x53b747[_0x8454('0x48')]=qs[_0x8454('0x3e')](_[_0x8454('0x63')](_0x10ae60['query'],_0x27fd3e['filters']));_0x53b747[_0x8454('0x48')][_0x8454('0x5f')]=_0x14e99f['id'];if(_0x10ae60[_0x8454('0x3d')][_0x8454('0x47')]){_0x53b747[_0x8454('0x48')]=_[_0x8454('0x4a')](_0x53b747[_0x8454('0x48')],{'$or':_[_0x8454('0x3b')](_0x53b747['attributes'],function(_0x2e8d43){var _0x1604dc={};_0x1604dc[_0x2e8d43]={'$like':'%'+_0x10ae60['query'][_0x8454('0x47')]+'%'};return _0x1604dc;})});}_0x53b747=_[_0x8454('0x4a')]({},_0x53b747,_0x10ae60[_0x8454('0x4b')]);return db[_0x8454('0x60')][_0x8454('0x28')]({'where':_0x53b747[_0x8454('0x48')]})[_0x8454('0x18')](function(_0x3186c3){_0x49ba16['count']=_0x3186c3;if(_0x10ae60[_0x8454('0x3d')][_0x8454('0x53')]){_0x53b747['include']=[{'all':!![]}];}return db[_0x8454('0x60')][_0x8454('0x4d')](_0x53b747);})[_0x8454('0x18')](function(_0x3d17c8){_0x49ba16[_0x8454('0x4e')]=_0x3d17c8;return _0x49ba16;});}})['then'](respondWithFilteredResult(_0x3adac3,_0x53b747))[_0x8454('0x4f')](handleError(_0x3adac3,null));};exports['removeDispositions']=function(_0x5ede15,_0x550149,_0x4eabf){return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x5ede15[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x550149,null))[_0x8454('0x18')](function(_0x48abb9){if(_0x48abb9){return _0x48abb9['removeDispositions'](_0x5ede15[_0x8454('0x3d')][_0x8454('0x64')]);}})[_0x8454('0x18')](respondWithStatusCode(_0x550149,null))[_0x8454('0x4f')](handleError(_0x550149,null));};exports[_0x8454('0x65')]=function(_0x5e0af4,_0x3fd194,_0x5ab737){if(_0x5e0af4[_0x8454('0x56')]['id']){delete _0x5e0af4[_0x8454('0x56')]['id'];}return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x5e0af4[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x3fd194,null))['then'](function(_0x3a91f9){if(_0x3a91f9){_0x5e0af4['body']['FaxAccountId']=_0x3a91f9['id'];return db['CannedAnswer']['create'](_0x5e0af4[_0x8454('0x56')]);}})[_0x8454('0x18')](respondWithResult(_0x3fd194,null))[_0x8454('0x4f')](handleError(_0x3fd194,null));};exports[_0x8454('0x66')]=function(_0x3d831a,_0x29cc84,_0x224d4f){var _0x2abf3d={'raw':![],'where':{}};var _0x28465e={};var _0x16c322={'count':0x0,'rows':[]};return db[_0x8454('0x36')][_0x8454('0x62')]({'where':{'id':_0x3d831a[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x29cc84,null))[_0x8454('0x18')](function(_0x390736){if(_0x390736){_0x28465e[_0x8454('0x3a')]=_[_0x8454('0x3c')](db[_0x8454('0x67')][_0x8454('0x37')]);_0x28465e[_0x8454('0x3d')]=_[_0x8454('0x3c')](_0x3d831a['query']);_0x28465e[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x28465e['model'],_0x28465e['query']);_0x2abf3d[_0x8454('0x3f')]=_[_0x8454('0x40')](_0x28465e[_0x8454('0x3a')],qs[_0x8454('0x41')](_0x3d831a[_0x8454('0x3d')]['fields']));_0x2abf3d[_0x8454('0x3f')]=_0x2abf3d[_0x8454('0x3f')][_0x8454('0x42')]?_0x2abf3d[_0x8454('0x3f')]:_0x28465e['model'];if(!_0x3d831a['query'][_0x8454('0x43')](_0x8454('0x44'))){_0x2abf3d['limit']=qs[_0x8454('0x27')](_0x3d831a[_0x8454('0x3d')]['limit']);_0x2abf3d[_0x8454('0x25')]=qs[_0x8454('0x25')](_0x3d831a[_0x8454('0x3d')][_0x8454('0x25')]);}_0x2abf3d[_0x8454('0x45')]=qs[_0x8454('0x46')](_0x3d831a[_0x8454('0x3d')][_0x8454('0x46')]);_0x2abf3d[_0x8454('0x48')]=qs['filters'](_[_0x8454('0x63')](_0x3d831a['query'],_0x28465e['filters']));_0x2abf3d[_0x8454('0x48')][_0x8454('0x5f')]=_0x390736['id'];if(_0x3d831a[_0x8454('0x3d')][_0x8454('0x47')]){_0x2abf3d[_0x8454('0x48')]=_[_0x8454('0x4a')](_0x2abf3d[_0x8454('0x48')],{'$or':_['map'](_0x2abf3d[_0x8454('0x3f')],function(_0x4ae159){var _0x5b7902={};_0x5b7902[_0x4ae159]={'$like':'%'+_0x3d831a[_0x8454('0x3d')][_0x8454('0x47')]+'%'};return _0x5b7902;})});}_0x2abf3d=_[_0x8454('0x4a')]({},_0x2abf3d,_0x3d831a[_0x8454('0x4b')]);return db[_0x8454('0x67')]['count']({'where':_0x2abf3d[_0x8454('0x48')]})['then'](function(_0x4fb9dd){_0x16c322[_0x8454('0x28')]=_0x4fb9dd;if(_0x3d831a['query'][_0x8454('0x53')]){_0x2abf3d[_0x8454('0x4c')]=[{'all':!![]}];}return db[_0x8454('0x67')][_0x8454('0x4d')](_0x2abf3d);})[_0x8454('0x18')](function(_0x25b771){_0x16c322[_0x8454('0x4e')]=_0x25b771;return _0x16c322;});}})[_0x8454('0x18')](respondWithFilteredResult(_0x29cc84,_0x2abf3d))[_0x8454('0x4f')](handleError(_0x29cc84,null));};exports[_0x8454('0x68')]=function(_0x4b02b7,_0x14269c,_0xb242e4){return db[_0x8454('0x36')]['find']({'where':{'id':_0x4b02b7[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x14269c,null))[_0x8454('0x18')](function(_0x5de1f6){if(_0x5de1f6){return _0x5de1f6[_0x8454('0x68')](_0x4b02b7[_0x8454('0x3d')][_0x8454('0x64')]);}})[_0x8454('0x18')](respondWithStatusCode(_0x14269c,null))[_0x8454('0x4f')](handleError(_0x14269c,null));};exports['addInteraction']=function(_0x4b8c34,_0x5f4cb9,_0xf29c5f){return db[_0x8454('0x69')][_0x8454('0x54')]({'where':{'id':_0x4b8c34[_0x8454('0x51')]['id']}})['then'](handleEntityNotFound(_0x5f4cb9,null))[_0x8454('0x18')](function(_0x4998fb){if(_0x4998fb){return _0x4998fb[_0x8454('0x6a')](_0x4b8c34[_0x8454('0x56')][_0x8454('0x64')],_[_0x8454('0x6b')](_0x4b8c34['body'],['ids','id'])||{});}})[_0x8454('0x18')](respondWithResult(_0x5f4cb9,null))[_0x8454('0x4f')](handleError(_0x5f4cb9,null));};exports[_0x8454('0x6c')]=function(_0x48df0f,_0x4e6ba8,_0x173c48){var _0x11c250={'raw':![],'where':{}};var _0x2e4501={};var _0x3fb644={'count':0x0,'rows':[]};return db[_0x8454('0x36')]['findOne']({'where':{'id':_0x48df0f[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x4e6ba8,null))[_0x8454('0x18')](function(_0x183120){if(_0x183120){_0x2e4501[_0x8454('0x3a')]=_[_0x8454('0x3c')](db['FaxInteraction'][_0x8454('0x37')]);_0x2e4501[_0x8454('0x3d')]=_[_0x8454('0x3c')](_0x48df0f['query']);_0x2e4501[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x2e4501[_0x8454('0x3a')],_0x2e4501[_0x8454('0x3d')]);_0x11c250[_0x8454('0x3f')]=_[_0x8454('0x40')](_0x2e4501['model'],qs['fields'](_0x48df0f[_0x8454('0x3d')][_0x8454('0x41')]));_0x11c250['attributes']=_0x11c250[_0x8454('0x3f')][_0x8454('0x42')]?_0x11c250[_0x8454('0x3f')]:_0x2e4501['model'];if(!_0x48df0f['query'][_0x8454('0x43')](_0x8454('0x44'))){_0x11c250[_0x8454('0x27')]=qs[_0x8454('0x27')](_0x48df0f['query'][_0x8454('0x27')]);_0x11c250[_0x8454('0x25')]=qs['offset'](_0x48df0f[_0x8454('0x3d')][_0x8454('0x25')]);}_0x11c250[_0x8454('0x45')]=qs[_0x8454('0x46')](_0x48df0f[_0x8454('0x3d')]['sort']);_0x11c250[_0x8454('0x48')]=qs[_0x8454('0x3e')](_[_0x8454('0x63')](_0x48df0f[_0x8454('0x3d')],_0x2e4501[_0x8454('0x3e')]));_0x11c250[_0x8454('0x48')][_0x8454('0x5f')]=_0x183120['id'];if(_0x48df0f[_0x8454('0x3d')][_0x8454('0x47')]){_0x11c250[_0x8454('0x48')]=_['merge'](_0x11c250[_0x8454('0x48')],{'$or':_['map'](_0x11c250['attributes'],function(_0xef804f){var _0x32a72f={};_0x32a72f[_0xef804f]={'$like':'%'+_0x48df0f['query'][_0x8454('0x47')]+'%'};return _0x32a72f;})});}_0x11c250=_[_0x8454('0x4a')]({},_0x11c250,_0x48df0f['options']);return db['FaxInteraction'][_0x8454('0x28')]({'where':_0x11c250[_0x8454('0x48')]})[_0x8454('0x18')](function(_0x34a711){_0x3fb644[_0x8454('0x28')]=_0x34a711;if(_0x48df0f[_0x8454('0x3d')][_0x8454('0x53')]){_0x11c250['include']=[{'model':db[_0x8454('0x6d')],'as':_0x8454('0x6e'),'required':![]},{'model':db[_0x8454('0x6f')],'as':_0x8454('0x70'),'attributes':['name',_0x8454('0x71'),_0x8454('0x72')],'required':![]},{'model':db[_0x8454('0x73')],'as':_0x8454('0x74'),'attributes':['id',_0x8454('0x32'),_0x8454('0x75')],'where':_0x48df0f[_0x8454('0x3d')][_0x8454('0x76')]?{'id':_0x48df0f[_0x8454('0x3d')][_0x8454('0x76')]}:undefined,'required':_0x48df0f['query'][_0x8454('0x76')]?!![]:![]}];}return db[_0x8454('0x69')][_0x8454('0x4d')](_0x11c250);})[_0x8454('0x18')](function(_0x100d01){_0x3fb644['rows']=_0x100d01;return _0x3fb644;});}})['then'](respondWithFilteredResult(_0x4e6ba8,_0x11c250))[_0x8454('0x4f')](handleError(_0x4e6ba8,null));};exports['addApplications']=function(_0x21fc3b,_0x363881){var _0x2b2185=_0x21fc3b[_0x8454('0x51')]['id'];var _0x45a08a=_0x21fc3b[_0x8454('0x56')];var _0x1970ce=0xc8;var _0x528d45=null;return db[_0x8454('0x77')]['transaction']({'isolationLevel':db[_0x8454('0x77')][_0x8454('0x78')][_0x8454('0x79')][_0x8454('0x7a')]},function(_0x277e5){return db['FaxAccount'][_0x8454('0x62')]({'where':{'id':_0x2b2185},'transaction':_0x277e5})[_0x8454('0x18')](function(_0x269b20){if(_0x269b20){return db[_0x8454('0x7b')][_0x8454('0x2e')]({'where':{'FaxAccountId':_0x2b2185},'transaction':_0x277e5})[_0x8454('0x18')](function(){var _0x3dfd70=_[_0x8454('0x3b')](_0x45a08a,function(_0x481885){_0x481885['FaxAccountId']=_0x2b2185;return _0x481885;});return db[_0x8454('0x7b')][_0x8454('0x7c')](_0x3dfd70,{'transaction':_0x277e5});});}else{_0x1970ce=0x194;_0x528d45=[];}});})['then'](function(){if(_0x1970ce!==0x194){return db[_0x8454('0x7b')][_0x8454('0x7d')]({'where':{'FaxAccountId':_0x2b2185},'order':_0x8454('0x7e')})[_0x8454('0x18')](function(_0x1c46ab){_0x528d45=_0x1c46ab;});}})[_0x8454('0x4f')](function(_0xaa715b){_0x1970ce=0x1f4;logger[_0x8454('0x1e')](_0xaa715b[_0x8454('0x31')]);if(_0xaa715b[_0x8454('0x32')]){delete _0xaa715b[_0x8454('0x32')];}_0x528d45=_0xaa715b;})['finally'](function(){if(_0x528d45===null){_0x363881[_0x8454('0x30')](_0x1970ce);}else{if(_0x1970ce===0x1f4){_0x363881[_0x8454('0x23')](_0x1970ce)[_0x8454('0x33')](_0x528d45);}else{_0x363881[_0x8454('0x23')](_0x1970ce)[_0x8454('0x24')](_0x528d45);}}});};exports[_0x8454('0x7f')]=function(_0x366c60,_0x4226c0,_0x3ac3e){var _0x3b55be={};var _0x15e9dd={};var _0x3742ab;var _0x4ab8c9;return db[_0x8454('0x36')][_0x8454('0x62')]({'where':{'id':_0x366c60['params']['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x4226c0,null))[_0x8454('0x18')](function(_0x4ed15c){if(_0x4ed15c){_0x3742ab=_0x4ed15c;_0x15e9dd['model']=_[_0x8454('0x3c')](db[_0x8454('0x7b')][_0x8454('0x37')]);_0x15e9dd[_0x8454('0x3d')]=_[_0x8454('0x3c')](_0x366c60[_0x8454('0x3d')]);_0x15e9dd[_0x8454('0x3e')]=_['intersection'](_0x15e9dd[_0x8454('0x3a')],_0x15e9dd['query']);_0x3b55be[_0x8454('0x3f')]=_[_0x8454('0x40')](_0x15e9dd[_0x8454('0x3a')],qs[_0x8454('0x41')](_0x366c60[_0x8454('0x3d')][_0x8454('0x41')]));_0x3b55be[_0x8454('0x3f')]=_0x3b55be[_0x8454('0x3f')][_0x8454('0x42')]?_0x3b55be[_0x8454('0x3f')]:_0x15e9dd['model'];_0x3b55be['order']=qs['sort'](_0x366c60[_0x8454('0x3d')][_0x8454('0x46')]);_0x3b55be[_0x8454('0x48')]=qs['filters'](_['pick'](_0x366c60['query'],_0x15e9dd[_0x8454('0x3e')]));if(_0x366c60[_0x8454('0x3d')]['filter']){_0x3b55be['where']=_['merge'](_0x3b55be[_0x8454('0x48')],{'$or':_[_0x8454('0x3b')](_0x3b55be[_0x8454('0x3f')],function(_0xe8a2f8){var _0x449dee={};_0x449dee[_0xe8a2f8]={'$like':'%'+_0x366c60['query'][_0x8454('0x47')]+'%'};return _0x449dee;})});}_0x3b55be=_[_0x8454('0x4a')]({},_0x3b55be,_0x366c60[_0x8454('0x4b')]);return _0x3742ab[_0x8454('0x7f')](_0x3b55be);}})[_0x8454('0x18')](function(_0x34c98c){if(_0x34c98c){_0x4ab8c9=_0x34c98c[_0x8454('0x42')];if(!_0x366c60[_0x8454('0x3d')][_0x8454('0x43')]('nolimit')){_0x3b55be[_0x8454('0x27')]=qs[_0x8454('0x27')](_0x366c60[_0x8454('0x3d')][_0x8454('0x27')]);_0x3b55be['offset']=qs['offset'](_0x366c60['query'][_0x8454('0x25')]);}return _0x3742ab[_0x8454('0x7f')](_0x3b55be);}})[_0x8454('0x18')](function(_0x1aa980){if(_0x1aa980){return _0x1aa980?{'count':_0x4ab8c9,'rows':_0x1aa980}:null;}})[_0x8454('0x18')](respondWithResult(_0x4226c0,null))[_0x8454('0x4f')](handleError(_0x4226c0,null));};function Extension(_0x43ecd9,_0x3b7ad3,_0x536ca6,_0xd0c35f){this[_0x8454('0x80')]=_0x8454('0x81');this['exten']=_0x43ecd9[_0x8454('0x82')];this[_0x8454('0x83')]=_0xd0c35f;this[_0x8454('0x39')]=_0x8454('0x84');this[_0x8454('0x85')]=_0x8454('0x86');this[_0x8454('0x5f')]=_0x43ecd9['id'];this[_0x8454('0x7e')]=_0x3b7ad3;this[_0x8454('0x87')]=_0x536ca6;}function createExtensionsReciveFax(_0x1b7c4d){var _0x189601=0x1;var _0x1c573c=[];_0x1c573c['push'](new Extension(_0x1b7c4d,_0x189601,'',_0x8454('0x88')));_0x189601+=0x1;_0x1c573c[_0x8454('0x89')](new Extension(_0x1b7c4d,_0x189601,_0x8454('0x8a'),_0x8454('0x8b')));_0x189601+=0x1;for(var _0x19d515 in _0x1b7c4d){if(_0x1b7c4d[_0x8454('0x43')](_0x19d515)&&(_0x19d515==='ecm'||_0x19d515===_0x8454('0x82')||_0x19d515==='gateway'||_0x19d515===_0x8454('0x8c')||_0x19d515===_0x8454('0x8d')||_0x19d515===_0x8454('0x8e')||_0x19d515===_0x8454('0x8f')||_0x19d515===_0x8454('0x90')||_0x19d515===_0x8454('0x91'))){_0x1c573c[_0x8454('0x89')](new Extension(_0x1b7c4d,_0x189601,_0x8454('0x92')+_0x19d515+')='+_0x1b7c4d[_0x19d515],_0x8454('0x8b')));_0x189601+=0x1;}}_0x1c573c['push'](new Extension(_0x1b7c4d,_0x189601,'6',_0x8454('0x93')));_0x189601+=0x1;_0x1c573c[_0x8454('0x89')](new Extension(_0x1b7c4d,_0x189601,'/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'));_0x189601=0x0;return _0x1c573c;}exports[_0x8454('0x94')]=function(_0x248f19,_0x321a42,_0x4698b7){var _0x23066d;return db[_0x8454('0x77')]['transaction'](function(_0x5d4b3c){return db[_0x8454('0x36')]['create'](_0x248f19[_0x8454('0x56')],{'transaction':_0x5d4b3c})[_0x8454('0x18')](function(_0x17c82f){_0x23066d=_0x17c82f[_0x8454('0x57')]({'plain':!![]});return db[_0x8454('0x95')][_0x8454('0x7c')](createExtensionsReciveFax(_0x23066d),{'transaction':_0x5d4b3c});});})['then'](function(){return _0x23066d;})[_0x8454('0x18')](respondWithResult(_0x321a42,null))[_0x8454('0x4f')](handleError(_0x321a42,null));};exports[_0x8454('0x96')]=function(_0x2cf783,_0x4521a1,_0x2365d5){var _0x418213;return db['sequelize'][_0x8454('0x97')](function(_0x84cf70){return db[_0x8454('0x36')]['update'](_0x2cf783['body'],{'where':{'id':_0x2cf783[_0x8454('0x56')]['id']},'transaction':_0x84cf70})[_0x8454('0x18')](function(_0x2b2ebe){return db['VoiceExtension'][_0x8454('0x2e')]({'where':{'FaxAccountId':_0x2cf783[_0x8454('0x56')]['id']},'transaction':_0x84cf70})[_0x8454('0x18')](function(_0x207a99){return db[_0x8454('0x95')][_0x8454('0x7c')](createExtensionsReciveFax(_[_0x8454('0x6b')](_0x2cf783[_0x8454('0x56')],[_0x8454('0x98'),_0x8454('0x99'),_0x8454('0x9a'),_0x8454('0x9b'),'TrunkId',_0x8454('0x9c')])),{'transaction':_0x84cf70});});});})[_0x8454('0x18')](function(){return db[_0x8454('0x36')]['findById'](_0x2cf783[_0x8454('0x56')]['id']);})[_0x8454('0x18')](respondWithResult(_0x4521a1,null))[_0x8454('0x4f')](handleError(_0x4521a1,null));};exports[_0x8454('0x9d')]=function(_0x2a71f1,_0x878764,_0x2458bb){var _0x5dee41={'raw':!![],'where':{}};var _0x5bede2={};var _0x2e6b93={'count':0x0,'rows':[]};return db[_0x8454('0x36')][_0x8454('0x62')]({'where':{'id':_0x2a71f1[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x878764,null))['then'](function(_0x4bbc47){if(_0x4bbc47){_0x5bede2[_0x8454('0x3a')]=_['keys'](db[_0x8454('0x9e')][_0x8454('0x37')]);_0x5bede2[_0x8454('0x3d')]=_['keys'](_0x2a71f1['query']);_0x5bede2[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x5bede2[_0x8454('0x3a')],_0x5bede2[_0x8454('0x3d')]);_0x5dee41['attributes']=_[_0x8454('0x40')](_0x5bede2[_0x8454('0x3a')],qs[_0x8454('0x41')](_0x2a71f1[_0x8454('0x3d')][_0x8454('0x41')]));_0x5dee41[_0x8454('0x3f')]=_0x5dee41[_0x8454('0x3f')][_0x8454('0x42')]?_0x5dee41[_0x8454('0x3f')]:_0x5bede2[_0x8454('0x3a')];if(!_0x2a71f1[_0x8454('0x3d')]['hasOwnProperty'](_0x8454('0x44'))){_0x5dee41[_0x8454('0x27')]=qs[_0x8454('0x27')](_0x2a71f1[_0x8454('0x3d')][_0x8454('0x27')]);_0x5dee41['offset']=qs[_0x8454('0x25')](_0x2a71f1[_0x8454('0x3d')][_0x8454('0x25')]);}_0x5dee41[_0x8454('0x45')]=qs[_0x8454('0x46')](_0x2a71f1[_0x8454('0x3d')]['sort']);_0x5dee41[_0x8454('0x48')]=qs[_0x8454('0x3e')](_[_0x8454('0x63')](_0x2a71f1[_0x8454('0x3d')],_0x5bede2['filters']));_0x5dee41[_0x8454('0x48')][_0x8454('0x5f')]=_0x4bbc47['id'];if(_0x2a71f1['query'][_0x8454('0x47')]){_0x5dee41[_0x8454('0x48')]=_[_0x8454('0x4a')](_0x5dee41[_0x8454('0x48')],{'$or':_[_0x8454('0x3b')](_0x5dee41['attributes'],function(_0x181a65){var _0x4bd195={};_0x4bd195[_0x181a65]={'$like':'%'+_0x2a71f1[_0x8454('0x3d')][_0x8454('0x47')]+'%'};return _0x4bd195;})});}if(_0x2a71f1['query'][_0x8454('0x9f')]){var _0x30c9d1=_0x2a71f1[_0x8454('0x3d')][_0x8454('0x9f')][_0x8454('0xa0')](',');var _0xcd9bb7={};_0xcd9bb7[_0x30c9d1[0x0]]={'$gte':moment(_0x30c9d1[0x1])['format'](_0x8454('0xa1'))};_0x5dee41[_0x8454('0x48')]=_[_0x8454('0x4a')](_0x5dee41[_0x8454('0x48')],_0xcd9bb7);}_0x5dee41=_[_0x8454('0x4a')]({},_0x5dee41,_0x2a71f1[_0x8454('0x4b')]);return db[_0x8454('0x9e')][_0x8454('0x28')]({'where':_0x5dee41[_0x8454('0x48')]})[_0x8454('0x18')](function(_0x4227c0){_0x2e6b93[_0x8454('0x28')]=_0x4227c0;if(_0x2a71f1[_0x8454('0x3d')][_0x8454('0x53')]){_0x5dee41['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8454('0x4d')](_0x5dee41);})[_0x8454('0x18')](function(_0x5bbed5){_0x2e6b93[_0x8454('0x4e')]=_0x5bbed5;return _0x2e6b93;});}})[_0x8454('0x18')](respondWithFilteredResult(_0x878764,_0x5dee41))[_0x8454('0x4f')](handleError(_0x878764,null));};exports[_0x8454('0x33')]=function(_0x136973,_0x2e8046,_0x31c4dc){var _0x37a4ec,_0x421a64={},_0x517c30;if(_0x136973[_0x8454('0x56')]['to']){_0x517c30=_0x136973[_0x8454('0x56')]['to'][0x0];}return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x136973['params']['id']},'include':[{'model':db[_0x8454('0xa2')],'as':_0x8454('0xa3'),'include':[{'model':db['CmContact'],'as':_0x8454('0xa4'),'where':{'fax':_0x517c30},'limit':0x1,'order':[[_0x8454('0x9b'),'DESC']]}]}]})[_0x8454('0x18')](handleEntityNotFound(_0x2e8046,null))['then'](function(_0x5edf4f){_0x37a4ec=_0x5edf4f;if(_0x136973[_0x8454('0x56')][_0x8454('0xa5')]&&_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x8454('0x42')]){for(var _0x4a48bf=0x0;_0x4a48bf<_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x8454('0x42')];_0x4a48bf+=0x1){_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x4a48bf]={'filename':_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x4a48bf][_0x8454('0x32')],'id':_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x4a48bf]['id'],'path':path[_0x8454('0xa6')](config['root'],_0x8454('0xa7'),_0x136973[_0x8454('0x56')][_0x8454('0xa5')][_0x4a48bf][_0x8454('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x8454('0xa9'),{'FaxAccountId':_[_0x8454('0xaa')](_0x136973['params']['id'])?undefined:_0x136973[_0x8454('0x51')]['id'],'path':_[_0x8454('0xaa')](_0x136973[_0x8454('0x56')][_0x8454('0xa5')][0x0][_0x8454('0xab')])?undefined:_0x136973[_0x8454('0x56')][_0x8454('0xa5')][0x0][_0x8454('0xab')],'fax':_[_0x8454('0xaa')](_0x136973[_0x8454('0x56')]['to'][0x0])?undefined:_0x136973[_0x8454('0x56')]['to'][0x0]},client9002);})['then'](function(){if(_0x37a4ec){if(_[_0x8454('0xaa')](_0x136973[_0x8454('0x56')]['from'])){_0x136973[_0x8454('0x56')][_0x8454('0xac')]=util['format']('\x22%s\x22\x20<%s>',_0x37a4ec['name'],_0x37a4ec['fax']);}if(_0x37a4ec[_0x8454('0xa3')]){if(_0x37a4ec[_0x8454('0xa3')][_0x8454('0xa4')]['length']){return _0x37a4ec[_0x8454('0xa3')][_0x8454('0xa4')][0x0];}else{return db[_0x8454('0x6d')][_0x8454('0x55')](_['defaults'](_0x136973[_0x8454('0x56')],{'firstName':_0x136973[_0x8454('0x56')]['to'][0x0],'phone':_0x136973[_0x8454('0x56')]['to'][0x0],'fax':_0x136973[_0x8454('0x56')]['to'][0x0],'ListId':_0x37a4ec[_0x8454('0x9c')]}));}}else{throw new Error(_0x8454('0xad'));}}else{throw new Error(_0x8454('0xae'));}})[_0x8454('0x18')](function(_0x5e032a){if(_0x5e032a){return db[_0x8454('0x69')][_0x8454('0x54')]({'where':{'ContactId':_0x5e032a['id'],'closed':![],'FaxAccountId':_0x37a4ec['id']}})['then'](function(_0x31c2f6){if(_0x31c2f6){return[_0x31c2f6,![]];}return db[_0x8454('0x69')][_0x8454('0x55')]({'UserId':_0x136973['user']['id'],'ContactId':_0x5e032a['id'],'FaxAccountId':_0x37a4ec['id'],'fax':_0x136973['body']['to'][0x0],'firstMsgDirection':_0x8454('0xaf'),'Messages':[_[_0x8454('0x4a')](_0x136973[_0x8454('0x56')],{'read':![],'body':_0x136973[_0x8454('0x56')][_0x8454('0xa5')][0x0][_0x8454('0xb0')],'FaxAccountId':_0x37a4ec['id'],'UserId':_0x136973['user']['id'],'ContactId':_0x5e032a['id'],'AttachmentId':_0x136973[_0x8454('0x56')][_0x8454('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8454('0xb1')}]})[_0x8454('0x18')](function(_0x1aa576){return[_0x1aa576,!![]];});});}else{throw new Error(_0x8454('0xb2'));}})[_0x8454('0xb3')](function(_0x362c01,_0x2ea04a){if(_0x2ea04a){return _0x362c01;}return db['FaxMessage']['create']({'direction':_0x8454('0xaf'),'read':![],'body':_0x136973[_0x8454('0x56')]['attachments'][0x0]['filename'],'FaxAccountId':_0x37a4ec['id'],'FaxInteractionId':_0x362c01['id'],'UserId':_0x136973[_0x8454('0x5a')]['id'],'ContactId':_0x362c01[_0x8454('0xb4')],'AttachmentId':_0x136973['body'][_0x8454('0xa5')][0x0]['id']})[_0x8454('0x18')](function(_0x19c71e){_0x362c01[_0x8454('0xb5')][_0x8454('0xb1')]=[];_0x362c01[_0x8454('0xb5')][_0x8454('0xb1')][_0x8454('0x89')](_0x19c71e['dataValues']);return _0x362c01;});})[_0x8454('0x18')](function(_0x199367){respondWithRpcPromise(_0x8454('0xb6'),'SendFax',{'FaxAccountId':_[_0x8454('0xaa')](_0x136973[_0x8454('0x51')]['id'])?undefined:_0x136973[_0x8454('0x51')]['id'],'path':_[_0x8454('0xaa')](_0x136973[_0x8454('0x56')][_0x8454('0xa5')][0x0]['path'])?undefined:_0x136973['body'][_0x8454('0xa5')][0x0][_0x8454('0xab')],'fax':_['isNil'](_0x136973[_0x8454('0x56')]['to'][0x0])?undefined:_0x136973[_0x8454('0x56')]['to'][0x0],'AttachmentId':_0x136973['body'][_0x8454('0xa5')][0x0]['id']},client9002)[_0x8454('0x18')](function(_0x55be89){logger[_0x8454('0x19')](_0x8454('0xb7'),_0x55be89);})[_0x8454('0x4f')](function(_0x44fab7){logger['info']('SendFaxRpc,\x20%s',_0x44fab7);});return _0x199367;})[_0x8454('0x18')](respondWithResult(_0x2e8046,null))[_0x8454('0x4f')](handleError(_0x2e8046,null));};exports['addAgents']=function(_0x554692,_0xd23046,_0x3ad9eb){return db[_0x8454('0x36')][_0x8454('0x54')]({'where':{'id':_0x554692[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0xd23046,null))[_0x8454('0x18')](function(_0x119e63){if(_0x119e63){return _0x119e63[_0x8454('0xb8')](_0x554692[_0x8454('0x56')][_0x8454('0x64')],_[_0x8454('0x6b')](_0x554692[_0x8454('0x56')],['ids','id'])||{})[_0x8454('0xb3')](function(_0x458a36){for(var _0x4965f2=0x0;_0x4965f2<_0x554692['body'][_0x8454('0x64')][_0x8454('0x42')];_0x4965f2+=0x1){socket[_0x8454('0xb9')](_0x8454('0xba'),{'UserId':Number(_0x554692[_0x8454('0x56')][_0x8454('0x64')][_0x4965f2]),'FaxAccountId':Number(_0x554692[_0x8454('0x51')]['id'])});}return _0x458a36;});}})[_0x8454('0x18')](respondWithResult(_0xd23046,null))[_0x8454('0x4f')](handleError(_0xd23046,null));};exports['removeAgents']=function(_0x2c79b5,_0x24a2ca,_0x285565){return db[_0x8454('0x36')]['find']({'where':{'id':_0x2c79b5[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x24a2ca,null))[_0x8454('0x18')](function(_0x280c5a){if(_0x280c5a){return _0x280c5a[_0x8454('0xbb')](_0x2c79b5[_0x8454('0x3d')][_0x8454('0x64')])[_0x8454('0x18')](function(){if(_[_0x8454('0xbc')](_0x2c79b5[_0x8454('0x3d')]['ids'])){for(var _0x450461=0x0;_0x450461<_0x2c79b5[_0x8454('0x3d')][_0x8454('0x64')][_0x8454('0x42')];_0x450461+=0x1){socket['emit'](_0x8454('0xbd'),{'UserId':Number(_0x2c79b5[_0x8454('0x3d')]['ids'][_0x450461]),'FaxAccountId':Number(_0x2c79b5[_0x8454('0x51')]['id'])});}}else{socket[_0x8454('0xb9')](_0x8454('0xbd'),{'UserId':Number(_0x2c79b5[_0x8454('0x3d')]['ids']),'FaxAccountId':Number(_0x2c79b5[_0x8454('0x51')]['id'])});}});}})[_0x8454('0x18')](respondWithStatusCode(_0x24a2ca,null))[_0x8454('0x4f')](handleError(_0x24a2ca,null));};exports['getAgents']=function(_0x178973,_0x48202e,_0x58445b){var _0x49b04c={};var _0x3e5638={};var _0x132363;var _0xec6353;return db['FaxAccount'][_0x8454('0x62')]({'where':{'id':_0x178973[_0x8454('0x51')]['id']}})[_0x8454('0x18')](handleEntityNotFound(_0x48202e,null))['then'](function(_0x1c6009){if(_0x1c6009){_0x132363=_0x1c6009;_0x3e5638[_0x8454('0x3a')]=_[_0x8454('0x3c')](db[_0x8454('0x6f')]['rawAttributes']);_0x3e5638[_0x8454('0x3d')]=_['keys'](_0x178973['query']);_0x3e5638[_0x8454('0x3e')]=_[_0x8454('0x40')](_0x3e5638[_0x8454('0x3a')],_0x3e5638[_0x8454('0x3d')]);_0x49b04c[_0x8454('0x3f')]=_['intersection'](_0x3e5638['model'],qs['fields'](_0x178973[_0x8454('0x3d')][_0x8454('0x41')]));_0x49b04c[_0x8454('0x3f')]=_0x49b04c[_0x8454('0x3f')][_0x8454('0x42')]?_0x49b04c[_0x8454('0x3f')]:_0x3e5638['model'];_0x49b04c[_0x8454('0x45')]=qs['sort'](_0x178973[_0x8454('0x3d')][_0x8454('0x46')]);_0x49b04c[_0x8454('0x48')]=qs['filters'](_[_0x8454('0x63')](_0x178973[_0x8454('0x3d')],_0x3e5638['filters']));if(_0x178973['query']['filter']){_0x49b04c[_0x8454('0x48')]=_[_0x8454('0x4a')](_0x49b04c['where'],{'$or':_['map'](_0x49b04c[_0x8454('0x3f')],function(_0x3add04){var _0x1c81f4={};_0x1c81f4[_0x3add04]={'$like':'%'+_0x178973['query']['filter']+'%'};return _0x1c81f4;})});}_0x49b04c=_[_0x8454('0x4a')]({},_0x49b04c,_0x178973['options']);return _0x132363['getAgents'](_0x49b04c);}})[_0x8454('0x18')](function(_0x237f51){if(_0x237f51){_0xec6353=_0x237f51[_0x8454('0x42')];if(!_0x178973[_0x8454('0x3d')][_0x8454('0x43')](_0x8454('0x44'))){_0x49b04c[_0x8454('0x27')]=qs[_0x8454('0x27')](_0x178973[_0x8454('0x3d')][_0x8454('0x27')]);_0x49b04c[_0x8454('0x25')]=qs[_0x8454('0x25')](_0x178973['query'][_0x8454('0x25')]);}return _0x132363[_0x8454('0xbe')](_0x49b04c);}})[_0x8454('0x18')](function(_0x5d79a3){if(_0x5d79a3){return _0x5d79a3?{'count':_0xec6353,'rows':_0x5d79a3}:null;}})[_0x8454('0x18')](respondWithResult(_0x48202e,null))[_0x8454('0x4f')](handleError(_0x48202e,null));}; \ No newline at end of file +var _0x7a40=['addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','localstationid','system','description','Fax\x20Extension','priority','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0x7a40,0x126));var _0x07a4=function(_0x3ac7ad,_0x363e9c){_0x3ac7ad=_0x3ac7ad-0x0;var _0x2d34bc=_0x7a40[_0x3ac7ad];return _0x2d34bc;};'use strict';var emlformat=require(_0x07a4('0x0'));var rimraf=require(_0x07a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x07a4('0x2'));var rp=require(_0x07a4('0x3'));var moment=require(_0x07a4('0x4'));var BPromise=require(_0x07a4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x07a4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x07a4('0x7'));var squel=require('squel');var crypto=require(_0x07a4('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x07a4('0x9'));var toCsv=require(_0x07a4('0x6'));var querystring=require(_0x07a4('0xa'));var Papa=require(_0x07a4('0xb'));var Redis=require(_0x07a4('0xc'));var authService=require(_0x07a4('0xd'));var qs=require(_0x07a4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07a4('0xf'));var logger=require(_0x07a4('0x10'))(_0x07a4('0x11'));var utils=require('../../config/utils');var config=require(_0x07a4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x07a4('0x13'))['db'];config[_0x07a4('0x14')]=_[_0x07a4('0x15')](config[_0x07a4('0x14')],{'host':_0x07a4('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x07a4('0x14')]));require(_0x07a4('0x17'))['register'](socket);var jayson=require(_0x07a4('0x18'));var client=jayson[_0x07a4('0x19')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43bd72,_0xb6b168,_0x5ef1b4,_0x27f6ec){return new BPromise(function(_0xf1eaff,_0x2e6a1f){var _0x1c32c3=_0x27f6ec||client;return _0x1c32c3[_0x07a4('0x1a')](_0x43bd72,_0x5ef1b4)[_0x07a4('0x1b')](function(_0x10863a){logger['info'](_0x07a4('0x1c'),_0xb6b168,_0x07a4('0x1d'));logger[_0x07a4('0x1e')](_0x07a4('0x1f'),_0xb6b168,'request\x20sent',JSON['stringify'](_0x10863a));if(_0x10863a[_0x07a4('0x20')]){if(_0x10863a[_0x07a4('0x20')][_0x07a4('0x21')]===0x1f4){logger[_0x07a4('0x20')]('FaxAccount,\x20%s,\x20%s',_0xb6b168,_0x10863a[_0x07a4('0x20')]['message']);return _0x2e6a1f(_0x10863a[_0x07a4('0x20')]['message']);}logger[_0x07a4('0x20')]('FaxAccount,\x20%s,\x20%s',_0xb6b168,_0x10863a['error'][_0x07a4('0x22')]);return _0xf1eaff(_0x10863a[_0x07a4('0x20')][_0x07a4('0x22')]);}else{logger['info'](_0x07a4('0x1c'),_0xb6b168,_0x07a4('0x1d'));_0xf1eaff(_0x10863a[_0x07a4('0x23')][_0x07a4('0x22')]);}})[_0x07a4('0x24')](function(_0x3973f3){logger['error']('FaxAccount,\x20%s,\x20%s',_0xb6b168,_0x3973f3);_0x2e6a1f(_0x3973f3);});});}function respondWithStatusCode(_0x5642a7,_0x2a4bda){_0x2a4bda=_0x2a4bda||0xcc;return function(_0xf417ac){if(_0xf417ac){return _0x5642a7[_0x07a4('0x25')](_0x2a4bda);}return _0x5642a7[_0x07a4('0x26')](_0x2a4bda)[_0x07a4('0x27')]();};}function respondWithResult(_0x4f8058,_0x5b1985){_0x5b1985=_0x5b1985||0xc8;return function(_0x3402c4){if(_0x3402c4){return _0x4f8058[_0x07a4('0x26')](_0x5b1985)[_0x07a4('0x28')](_0x3402c4);}};}function respondWithFilteredResult(_0x322e38,_0x429ab0){return function(_0x24233b){if(_0x24233b){var _0x308eca=typeof _0x429ab0[_0x07a4('0x29')]===_0x07a4('0x2a')&&typeof _0x429ab0[_0x07a4('0x2b')]===_0x07a4('0x2a');var _0x58de53=_0x24233b[_0x07a4('0x2c')];var _0x236fd5=_0x308eca?0x0:_0x429ab0['offset'];var _0xbe356a=_0x308eca?_0x24233b[_0x07a4('0x2c')]:_0x429ab0[_0x07a4('0x29')]+_0x429ab0['limit'];var _0x4c69b9;if(_0xbe356a>=_0x58de53){_0xbe356a=_0x58de53;_0x4c69b9=0xc8;}else{_0x4c69b9=0xce;}_0x322e38[_0x07a4('0x26')](_0x4c69b9);return _0x322e38['set']('Content-Range',_0x236fd5+'-'+_0xbe356a+'/'+_0x58de53)[_0x07a4('0x28')](_0x24233b);}return null;};}function patchUpdates(_0x54042b){return function(_0x2f6800){try{jsonpatch[_0x07a4('0x2d')](_0x2f6800,_0x54042b,!![]);}catch(_0x48b873){return BPromise['reject'](_0x48b873);}return _0x2f6800[_0x07a4('0x2e')]();};}function saveUpdates(_0x14c6eb,_0x13db10){return function(_0xa8680f){if(_0xa8680f){return _0xa8680f[_0x07a4('0x2f')](_0x14c6eb)[_0x07a4('0x1b')](function(_0x5ee424){return _0x5ee424;});}return null;};}function removeEntity(_0x981836,_0x9baa39){return function(_0x5ab2c8){if(_0x5ab2c8){return _0x5ab2c8['destroy']()['then'](function(){var _0x4f6b85=_0x5ab2c8[_0x07a4('0x30')]({'plain':!![]});var _0x4d0d01=_0x07a4('0x31');return db[_0x07a4('0x32')]['destroy']({'where':{'type':_0x4d0d01,'resourceId':_0x4f6b85['id']}})[_0x07a4('0x1b')](function(){return _0x5ab2c8;});})[_0x07a4('0x1b')](function(){_0x981836['status'](0xcc)[_0x07a4('0x27')]();});}};}function handleEntityNotFound(_0x4a7b68,_0x342499){return function(_0x552632){if(!_0x552632){_0x4a7b68[_0x07a4('0x25')](0x194);}return _0x552632;};}function handleError(_0x4d06b3,_0x331327){_0x331327=_0x331327||0x1f4;return function(_0xc44a56){logger[_0x07a4('0x20')](_0xc44a56[_0x07a4('0x33')]);if(_0xc44a56[_0x07a4('0x34')]){delete _0xc44a56[_0x07a4('0x34')];}_0x4d06b3[_0x07a4('0x26')](_0x331327)[_0x07a4('0x35')](_0xc44a56);};}exports[_0x07a4('0x36')]=function(_0x2e7f72,_0x9946e6){var _0x26469c={'include':[{'model':db[_0x07a4('0x37')],'as':_0x07a4('0x38')}]},_0x45817a={},_0x3a38e4={'count':0x0,'rows':[]};var _0x68894=_[_0x07a4('0x39')](db[_0x07a4('0x3a')][_0x07a4('0x3b')],function(_0x2d1eaa){return{'name':_0x2d1eaa['fieldName'],'type':_0x2d1eaa[_0x07a4('0x3c')][_0x07a4('0x3d')]};});_0x45817a[_0x07a4('0x3e')]=_[_0x07a4('0x39')](_0x68894,_0x07a4('0x34'));_0x45817a[_0x07a4('0x3f')]=_[_0x07a4('0x40')](_0x2e7f72[_0x07a4('0x3f')]);_0x45817a[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x45817a[_0x07a4('0x3e')],_0x45817a[_0x07a4('0x3f')]);_0x26469c[_0x07a4('0x43')]=_['intersection'](_0x45817a[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x2e7f72[_0x07a4('0x3f')][_0x07a4('0x44')]));_0x26469c[_0x07a4('0x43')]=_0x26469c[_0x07a4('0x43')][_0x07a4('0x45')]?_0x26469c[_0x07a4('0x43')]:_0x45817a['model'];if(!_0x2e7f72[_0x07a4('0x3f')][_0x07a4('0x46')](_0x07a4('0x47'))){_0x26469c[_0x07a4('0x2b')]=qs[_0x07a4('0x2b')](_0x2e7f72[_0x07a4('0x3f')]['limit']);_0x26469c[_0x07a4('0x29')]=qs[_0x07a4('0x29')](_0x2e7f72[_0x07a4('0x3f')][_0x07a4('0x29')]);}_0x26469c['order']=qs['sort'](_0x2e7f72['query'][_0x07a4('0x48')]);_0x26469c[_0x07a4('0x49')]=qs[_0x07a4('0x41')](_[_0x07a4('0x4a')](_0x2e7f72[_0x07a4('0x3f')],_0x45817a[_0x07a4('0x41')]),_0x68894);if(_0x2e7f72[_0x07a4('0x3f')][_0x07a4('0x4b')]){_0x26469c[_0x07a4('0x49')]=_[_0x07a4('0x4c')](_0x26469c[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x68894,function(_0x56f85a){if(_0x56f85a[_0x07a4('0x3c')]!=='VIRTUAL'){var _0x2eb099={};_0x2eb099[_0x56f85a[_0x07a4('0x34')]]={'$like':'%'+_0x2e7f72['query'][_0x07a4('0x4b')]+'%'};return _0x2eb099;}})});}_0x26469c=_[_0x07a4('0x4c')]({},_0x26469c,_0x2e7f72[_0x07a4('0x4d')]);var _0x5dcf40={'where':_0x26469c[_0x07a4('0x49')]};return db['FaxAccount'][_0x07a4('0x2c')](_0x5dcf40)[_0x07a4('0x1b')](function(_0x971361){_0x3a38e4[_0x07a4('0x2c')]=_0x971361;if(_0x2e7f72[_0x07a4('0x3f')][_0x07a4('0x4e')]){_0x26469c[_0x07a4('0x4f')]=[{'all':!![]}];}return db['FaxAccount'][_0x07a4('0x50')](_0x26469c);})[_0x07a4('0x1b')](function(_0x3672a5){_0x3a38e4['rows']=_0x3672a5;return _0x3a38e4;})[_0x07a4('0x1b')](respondWithFilteredResult(_0x9946e6,_0x26469c))[_0x07a4('0x24')](handleError(_0x9946e6,null));};exports[_0x07a4('0x51')]=function(_0x2e6c4f,_0x31368b){var _0x1bb143={'raw':![],'where':{'id':_0x2e6c4f[_0x07a4('0x52')]['id']},'include':[{'model':db[_0x07a4('0x37')],'as':'mandatoryDispositionPause'}]},_0x3335d9={};_0x3335d9[_0x07a4('0x3e')]=_[_0x07a4('0x40')](db['FaxAccount'][_0x07a4('0x3b')]);_0x3335d9['query']=_[_0x07a4('0x40')](_0x2e6c4f[_0x07a4('0x3f')]);_0x3335d9[_0x07a4('0x41')]=_['intersection'](_0x3335d9[_0x07a4('0x3e')],_0x3335d9[_0x07a4('0x3f')]);_0x1bb143[_0x07a4('0x43')]=_[_0x07a4('0x42')](_0x3335d9[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x2e6c4f[_0x07a4('0x3f')][_0x07a4('0x44')]));_0x1bb143[_0x07a4('0x43')]=_0x1bb143[_0x07a4('0x43')]['length']?_0x1bb143['attributes']:_0x3335d9[_0x07a4('0x3e')];if(_0x2e6c4f[_0x07a4('0x3f')][_0x07a4('0x4e')]){_0x1bb143['include']=[{'all':!![]}];}_0x1bb143=_['merge']({},_0x1bb143,_0x2e6c4f[_0x07a4('0x4d')]);return db[_0x07a4('0x3a')]['find'](_0x1bb143)[_0x07a4('0x1b')](handleEntityNotFound(_0x31368b,null))[_0x07a4('0x1b')](respondWithResult(_0x31368b,null))[_0x07a4('0x24')](handleError(_0x31368b,null));};exports[_0x07a4('0x53')]=function(_0x27059b,_0x376ebf){return db[_0x07a4('0x3a')]['create'](_0x27059b[_0x07a4('0x54')],{})['then'](function(_0x283ffb){var _0x201db0=_0x27059b[_0x07a4('0x55')]['get']({'plain':!![]});if(!_0x201db0)throw new Error(_0x07a4('0x56'));if(_0x201db0[_0x07a4('0x57')]===_0x07a4('0x55')){var _0x847b63=_0x283ffb[_0x07a4('0x30')]({'plain':!![]});var _0x21cdf5=_0x07a4('0x31');return db[_0x07a4('0x58')][_0x07a4('0x59')]({'where':{'name':_0x21cdf5,'userProfileId':_0x201db0[_0x07a4('0x5a')]},'raw':!![]})[_0x07a4('0x1b')](function(_0x102eb8){if(_0x102eb8&&_0x102eb8['autoAssociation']===0x0){return db[_0x07a4('0x32')][_0x07a4('0x53')]({'name':_0x847b63[_0x07a4('0x34')],'resourceId':_0x847b63['id'],'type':_0x102eb8[_0x07a4('0x34')],'sectionId':_0x102eb8['id']},{})[_0x07a4('0x1b')](function(){return _0x283ffb;});}else{return _0x283ffb;}})['catch'](function(_0x4a4816){logger[_0x07a4('0x20')](_0x07a4('0x5b'),_0x4a4816);throw _0x4a4816;});}return _0x283ffb;})[_0x07a4('0x1b')](respondWithResult(_0x376ebf,0xc9))[_0x07a4('0x24')](handleError(_0x376ebf,null));};exports['update']=function(_0x3fb993,_0x50e9c3){if(_0x3fb993['body']['id']){delete _0x3fb993['body']['id'];}return db['FaxAccount'][_0x07a4('0x59')]({'where':{'id':_0x3fb993[_0x07a4('0x52')]['id']},'include':[{'model':db[_0x07a4('0x37')],'as':_0x07a4('0x38')}]})[_0x07a4('0x1b')](handleEntityNotFound(_0x50e9c3,null))['then'](saveUpdates(_0x3fb993[_0x07a4('0x54')],null))[_0x07a4('0x1b')](respondWithResult(_0x50e9c3,null))['catch'](handleError(_0x50e9c3,null));};exports[_0x07a4('0x5c')]=function(_0x434379,_0x382a6b){return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x434379[_0x07a4('0x52')]['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x382a6b,null))[_0x07a4('0x1b')](removeEntity(_0x382a6b,null))[_0x07a4('0x24')](handleError(_0x382a6b,null));};exports['describe']=function(_0x25ceb7,_0x3976f7){return db[_0x07a4('0x3a')][_0x07a4('0x5d')]()[_0x07a4('0x1b')](respondWithResult(_0x3976f7,null))[_0x07a4('0x24')](handleError(_0x3976f7,null));};exports[_0x07a4('0x5e')]=function(_0x21dd50,_0x3be2cb,_0xbedad6){if(_0x21dd50[_0x07a4('0x54')]['id']){delete _0x21dd50['body']['id'];}return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x21dd50[_0x07a4('0x52')]['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x3be2cb,null))['then'](function(_0x3f9f4c){if(_0x3f9f4c){_0x21dd50['body'][_0x07a4('0x5f')]=_0x3f9f4c['id'];return db[_0x07a4('0x60')][_0x07a4('0x53')](_0x21dd50['body']);}})[_0x07a4('0x1b')](respondWithResult(_0x3be2cb,null))['catch'](handleError(_0x3be2cb,null));};exports[_0x07a4('0x61')]=function(_0x11c02c,_0x159ed0,_0x659df1){var _0x422f85={'raw':![],'where':{}};var _0x305f61={};var _0x33ddf4={'count':0x0,'rows':[]};return db[_0x07a4('0x3a')][_0x07a4('0x62')]({'where':{'id':_0x11c02c['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x159ed0,null))[_0x07a4('0x1b')](function(_0x50e9ee){if(_0x50e9ee){_0x305f61[_0x07a4('0x3e')]=_[_0x07a4('0x40')](db[_0x07a4('0x60')][_0x07a4('0x3b')]);_0x305f61[_0x07a4('0x3f')]=_['keys'](_0x11c02c['query']);_0x305f61[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x305f61[_0x07a4('0x3e')],_0x305f61[_0x07a4('0x3f')]);_0x422f85[_0x07a4('0x43')]=_[_0x07a4('0x42')](_0x305f61[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x11c02c[_0x07a4('0x3f')]['fields']));_0x422f85['attributes']=_0x422f85[_0x07a4('0x43')][_0x07a4('0x45')]?_0x422f85['attributes']:_0x305f61['model'];if(!_0x11c02c[_0x07a4('0x3f')][_0x07a4('0x46')](_0x07a4('0x47'))){_0x422f85[_0x07a4('0x2b')]=qs['limit'](_0x11c02c[_0x07a4('0x3f')]['limit']);_0x422f85[_0x07a4('0x29')]=qs[_0x07a4('0x29')](_0x11c02c[_0x07a4('0x3f')][_0x07a4('0x29')]);}_0x422f85[_0x07a4('0x63')]=qs['sort'](_0x11c02c[_0x07a4('0x3f')]['sort']);_0x422f85[_0x07a4('0x49')]=qs[_0x07a4('0x41')](_['pick'](_0x11c02c[_0x07a4('0x3f')],_0x305f61['filters']));_0x422f85['where'][_0x07a4('0x5f')]=_0x50e9ee['id'];if(_0x11c02c[_0x07a4('0x3f')][_0x07a4('0x4b')]){_0x422f85['where']=_[_0x07a4('0x4c')](_0x422f85[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x422f85['attributes'],function(_0x3e2278){var _0x3bd264={};_0x3bd264[_0x3e2278]={'$like':'%'+_0x11c02c[_0x07a4('0x3f')][_0x07a4('0x4b')]+'%'};return _0x3bd264;})});}_0x422f85=_[_0x07a4('0x4c')]({},_0x422f85,_0x11c02c[_0x07a4('0x4d')]);return db[_0x07a4('0x60')][_0x07a4('0x2c')]({'where':_0x422f85[_0x07a4('0x49')]})[_0x07a4('0x1b')](function(_0x34920c){_0x33ddf4['count']=_0x34920c;if(_0x11c02c[_0x07a4('0x3f')]['includeAll']){_0x422f85[_0x07a4('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x07a4('0x50')](_0x422f85);})[_0x07a4('0x1b')](function(_0x569e1f){_0x33ddf4['rows']=_0x569e1f;return _0x33ddf4;});}})[_0x07a4('0x1b')](respondWithFilteredResult(_0x159ed0,_0x422f85))[_0x07a4('0x24')](handleError(_0x159ed0,null));};exports[_0x07a4('0x64')]=function(_0x551c32,_0x5a9364,_0x30b7b5){return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x551c32[_0x07a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x5a9364,null))[_0x07a4('0x1b')](function(_0x110b78){if(_0x110b78){return _0x110b78[_0x07a4('0x64')](_0x551c32['query'][_0x07a4('0x65')]);}})[_0x07a4('0x1b')](respondWithStatusCode(_0x5a9364,null))[_0x07a4('0x24')](handleError(_0x5a9364,null));};exports[_0x07a4('0x66')]=function(_0x3f7e53,_0x105345,_0x25a03a){if(_0x3f7e53[_0x07a4('0x54')]['id']){delete _0x3f7e53[_0x07a4('0x54')]['id'];}return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x3f7e53[_0x07a4('0x52')]['id']}})['then'](handleEntityNotFound(_0x105345,null))['then'](function(_0x1b6484){if(_0x1b6484){_0x3f7e53[_0x07a4('0x54')][_0x07a4('0x5f')]=_0x1b6484['id'];return db['CannedAnswer'][_0x07a4('0x53')](_0x3f7e53[_0x07a4('0x54')]);}})['then'](respondWithResult(_0x105345,null))[_0x07a4('0x24')](handleError(_0x105345,null));};exports['getAnswers']=function(_0x3d9f38,_0xc023f8,_0x4d169b){var _0x5043ea={'raw':![],'where':{}};var _0x3d039d={};var _0x19b0fd={'count':0x0,'rows':[]};return db[_0x07a4('0x3a')]['findOne']({'where':{'id':_0x3d9f38[_0x07a4('0x52')]['id']}})['then'](handleEntityNotFound(_0xc023f8,null))[_0x07a4('0x1b')](function(_0xe0f11e){if(_0xe0f11e){_0x3d039d[_0x07a4('0x3e')]=_[_0x07a4('0x40')](db[_0x07a4('0x67')][_0x07a4('0x3b')]);_0x3d039d[_0x07a4('0x3f')]=_[_0x07a4('0x40')](_0x3d9f38['query']);_0x3d039d[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x3d039d[_0x07a4('0x3e')],_0x3d039d[_0x07a4('0x3f')]);_0x5043ea['attributes']=_[_0x07a4('0x42')](_0x3d039d[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x3d9f38[_0x07a4('0x3f')]['fields']));_0x5043ea[_0x07a4('0x43')]=_0x5043ea['attributes'][_0x07a4('0x45')]?_0x5043ea[_0x07a4('0x43')]:_0x3d039d['model'];if(!_0x3d9f38[_0x07a4('0x3f')]['hasOwnProperty'](_0x07a4('0x47'))){_0x5043ea[_0x07a4('0x2b')]=qs[_0x07a4('0x2b')](_0x3d9f38[_0x07a4('0x3f')][_0x07a4('0x2b')]);_0x5043ea['offset']=qs['offset'](_0x3d9f38['query'][_0x07a4('0x29')]);}_0x5043ea[_0x07a4('0x63')]=qs[_0x07a4('0x48')](_0x3d9f38['query'][_0x07a4('0x48')]);_0x5043ea['where']=qs[_0x07a4('0x41')](_['pick'](_0x3d9f38[_0x07a4('0x3f')],_0x3d039d[_0x07a4('0x41')]));_0x5043ea[_0x07a4('0x49')][_0x07a4('0x5f')]=_0xe0f11e['id'];if(_0x3d9f38[_0x07a4('0x3f')][_0x07a4('0x4b')]){_0x5043ea[_0x07a4('0x49')]=_[_0x07a4('0x4c')](_0x5043ea[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x5043ea[_0x07a4('0x43')],function(_0x172b69){var _0x423b3b={};_0x423b3b[_0x172b69]={'$like':'%'+_0x3d9f38[_0x07a4('0x3f')]['filter']+'%'};return _0x423b3b;})});}_0x5043ea=_[_0x07a4('0x4c')]({},_0x5043ea,_0x3d9f38[_0x07a4('0x4d')]);return db['CannedAnswer']['count']({'where':_0x5043ea[_0x07a4('0x49')]})[_0x07a4('0x1b')](function(_0x178ce4){_0x19b0fd['count']=_0x178ce4;if(_0x3d9f38[_0x07a4('0x3f')]['includeAll']){_0x5043ea[_0x07a4('0x4f')]=[{'all':!![]}];}return db[_0x07a4('0x67')][_0x07a4('0x50')](_0x5043ea);})[_0x07a4('0x1b')](function(_0x26fa3e){_0x19b0fd[_0x07a4('0x68')]=_0x26fa3e;return _0x19b0fd;});}})[_0x07a4('0x1b')](respondWithFilteredResult(_0xc023f8,_0x5043ea))['catch'](handleError(_0xc023f8,null));};exports['removeAnswers']=function(_0x37a017,_0x54d9a7,_0x3a7b02){return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x37a017[_0x07a4('0x52')]['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x54d9a7,null))['then'](function(_0x3e65bb){if(_0x3e65bb){return _0x3e65bb[_0x07a4('0x69')](_0x37a017[_0x07a4('0x3f')][_0x07a4('0x65')]);}})[_0x07a4('0x1b')](respondWithStatusCode(_0x54d9a7,null))[_0x07a4('0x24')](handleError(_0x54d9a7,null));};exports['addInteraction']=function(_0x88f9e6,_0x4eea13,_0x1280a1){return db['FaxInteraction'][_0x07a4('0x59')]({'where':{'id':_0x88f9e6['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x4eea13,null))[_0x07a4('0x1b')](function(_0x2f9499){if(_0x2f9499){return _0x2f9499[_0x07a4('0x6a')](_0x88f9e6[_0x07a4('0x54')]['ids'],_[_0x07a4('0x6b')](_0x88f9e6['body'],[_0x07a4('0x65'),'id'])||{});}})[_0x07a4('0x1b')](respondWithResult(_0x4eea13,null))['catch'](handleError(_0x4eea13,null));};exports[_0x07a4('0x6c')]=function(_0x397376,_0x5b1c07,_0x2c632c){var _0x178568={'raw':![],'where':{}};var _0x390456={};var _0x330d84={'count':0x0,'rows':[]};return db['FaxAccount'][_0x07a4('0x62')]({'where':{'id':_0x397376['params']['id']}})['then'](handleEntityNotFound(_0x5b1c07,null))[_0x07a4('0x1b')](function(_0x41b832){if(_0x41b832){_0x390456[_0x07a4('0x3e')]=_['keys'](db[_0x07a4('0x6d')][_0x07a4('0x3b')]);_0x390456[_0x07a4('0x3f')]=_['keys'](_0x397376['query']);_0x390456[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x390456['model'],_0x390456[_0x07a4('0x3f')]);_0x178568[_0x07a4('0x43')]=_[_0x07a4('0x42')](_0x390456[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x397376[_0x07a4('0x3f')][_0x07a4('0x44')]));_0x178568['attributes']=_0x178568[_0x07a4('0x43')][_0x07a4('0x45')]?_0x178568['attributes']:_0x390456[_0x07a4('0x3e')];if(!_0x397376[_0x07a4('0x3f')][_0x07a4('0x46')]('nolimit')){_0x178568[_0x07a4('0x2b')]=qs[_0x07a4('0x2b')](_0x397376['query']['limit']);_0x178568[_0x07a4('0x29')]=qs['offset'](_0x397376[_0x07a4('0x3f')][_0x07a4('0x29')]);}_0x178568[_0x07a4('0x63')]=qs[_0x07a4('0x48')](_0x397376[_0x07a4('0x3f')][_0x07a4('0x48')]);_0x178568[_0x07a4('0x49')]=qs[_0x07a4('0x41')](_['pick'](_0x397376['query'],_0x390456['filters']));_0x178568[_0x07a4('0x49')][_0x07a4('0x5f')]=_0x41b832['id'];if(_0x397376['query'][_0x07a4('0x4b')]){_0x178568[_0x07a4('0x49')]=_[_0x07a4('0x4c')](_0x178568[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x178568['attributes'],function(_0x5c0bc9){var _0x4f8101={};_0x4f8101[_0x5c0bc9]={'$like':'%'+_0x397376[_0x07a4('0x3f')][_0x07a4('0x4b')]+'%'};return _0x4f8101;})});}_0x178568=_['merge']({},_0x178568,_0x397376[_0x07a4('0x4d')]);return db['FaxInteraction'][_0x07a4('0x2c')]({'where':_0x178568[_0x07a4('0x49')]})[_0x07a4('0x1b')](function(_0x47a519){_0x330d84['count']=_0x47a519;if(_0x397376['query'][_0x07a4('0x4e')]){_0x178568[_0x07a4('0x4f')]=[{'model':db['CmContact'],'as':_0x07a4('0x6e'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x07a4('0x34'),_0x07a4('0x6f'),_0x07a4('0x70')],'required':![]},{'model':db[_0x07a4('0x71')],'as':_0x07a4('0x72'),'attributes':['id',_0x07a4('0x34'),_0x07a4('0x73')],'where':_0x397376['query'][_0x07a4('0x74')]?{'id':_0x397376[_0x07a4('0x3f')][_0x07a4('0x74')]}:undefined,'required':_0x397376[_0x07a4('0x3f')]['tag']?!![]:![]}];}return db[_0x07a4('0x6d')]['findAll'](_0x178568);})[_0x07a4('0x1b')](function(_0x1ecbfb){_0x330d84[_0x07a4('0x68')]=_0x1ecbfb;return _0x330d84;});}})[_0x07a4('0x1b')](respondWithFilteredResult(_0x5b1c07,_0x178568))[_0x07a4('0x24')](handleError(_0x5b1c07,null));};exports[_0x07a4('0x75')]=function(_0x4c479b,_0x1606f9){var _0x137a11=_0x4c479b['params']['id'];var _0x2eec34=_0x4c479b[_0x07a4('0x54')];var _0x1b742f=0xc8;var _0xd5114c=null;return db[_0x07a4('0x76')][_0x07a4('0x77')]({'isolationLevel':db[_0x07a4('0x76')]['Transaction'][_0x07a4('0x78')][_0x07a4('0x79')]},function(_0x30ebe9){return db['FaxAccount']['findOne']({'where':{'id':_0x137a11},'transaction':_0x30ebe9})[_0x07a4('0x1b')](function(_0x19026c){if(_0x19026c){return db['FaxApplication'][_0x07a4('0x5c')]({'where':{'FaxAccountId':_0x137a11},'transaction':_0x30ebe9})[_0x07a4('0x1b')](function(){var _0x2abff3=_['map'](_0x2eec34,function(_0x367b24){_0x367b24[_0x07a4('0x5f')]=_0x137a11;return _0x367b24;});return db[_0x07a4('0x7a')][_0x07a4('0x7b')](_0x2abff3,{'transaction':_0x30ebe9});});}else{_0x1b742f=0x194;_0xd5114c=[];}});})[_0x07a4('0x1b')](function(){if(_0x1b742f!==0x194){return db[_0x07a4('0x7a')][_0x07a4('0x7c')]({'where':{'FaxAccountId':_0x137a11},'order':'priority'})['then'](function(_0x4c06de){_0xd5114c=_0x4c06de;});}})[_0x07a4('0x24')](function(_0x3eca72){_0x1b742f=0x1f4;logger['error'](_0x3eca72[_0x07a4('0x33')]);if(_0x3eca72[_0x07a4('0x34')]){delete _0x3eca72[_0x07a4('0x34')];}_0xd5114c=_0x3eca72;})[_0x07a4('0x7d')](function(){if(_0xd5114c===null){_0x1606f9['sendStatus'](_0x1b742f);}else{if(_0x1b742f===0x1f4){_0x1606f9[_0x07a4('0x26')](_0x1b742f)[_0x07a4('0x35')](_0xd5114c);}else{_0x1606f9[_0x07a4('0x26')](_0x1b742f)[_0x07a4('0x28')](_0xd5114c);}}});};exports[_0x07a4('0x7e')]=function(_0xf579d8,_0xcd6b34,_0x200827){var _0x492381={};var _0x1b290c={};var _0x27fe61;var _0x5bcf4d;return db[_0x07a4('0x3a')][_0x07a4('0x62')]({'where':{'id':_0xf579d8['params']['id']}})['then'](handleEntityNotFound(_0xcd6b34,null))[_0x07a4('0x1b')](function(_0x3ec09f){if(_0x3ec09f){_0x27fe61=_0x3ec09f;_0x1b290c['model']=_[_0x07a4('0x40')](db['FaxApplication']['rawAttributes']);_0x1b290c[_0x07a4('0x3f')]=_[_0x07a4('0x40')](_0xf579d8[_0x07a4('0x3f')]);_0x1b290c[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x1b290c[_0x07a4('0x3e')],_0x1b290c[_0x07a4('0x3f')]);_0x492381[_0x07a4('0x43')]=_['intersection'](_0x1b290c[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x44')]));_0x492381[_0x07a4('0x43')]=_0x492381[_0x07a4('0x43')]['length']?_0x492381[_0x07a4('0x43')]:_0x1b290c[_0x07a4('0x3e')];_0x492381['order']=qs[_0x07a4('0x48')](_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x48')]);_0x492381[_0x07a4('0x49')]=qs['filters'](_[_0x07a4('0x4a')](_0xf579d8[_0x07a4('0x3f')],_0x1b290c[_0x07a4('0x41')]));if(_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x4b')]){_0x492381['where']=_[_0x07a4('0x4c')](_0x492381[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x492381[_0x07a4('0x43')],function(_0x656aac){var _0x218eab={};_0x218eab[_0x656aac]={'$like':'%'+_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x4b')]+'%'};return _0x218eab;})});}_0x492381=_['merge']({},_0x492381,_0xf579d8[_0x07a4('0x4d')]);return _0x27fe61[_0x07a4('0x7e')](_0x492381);}})[_0x07a4('0x1b')](function(_0x11197d){if(_0x11197d){_0x5bcf4d=_0x11197d[_0x07a4('0x45')];if(!_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x46')](_0x07a4('0x47'))){_0x492381[_0x07a4('0x2b')]=qs[_0x07a4('0x2b')](_0xf579d8[_0x07a4('0x3f')][_0x07a4('0x2b')]);_0x492381[_0x07a4('0x29')]=qs[_0x07a4('0x29')](_0xf579d8[_0x07a4('0x3f')]['offset']);}return _0x27fe61['getApplications'](_0x492381);}})[_0x07a4('0x1b')](function(_0x53caa3){if(_0x53caa3){return _0x53caa3?{'count':_0x5bcf4d,'rows':_0x53caa3}:null;}})[_0x07a4('0x1b')](respondWithResult(_0xcd6b34,null))[_0x07a4('0x24')](handleError(_0xcd6b34,null));};function Extension(_0x4c18f6,_0x1fcfd4,_0x24d4e4,_0x1f34e4){this[_0x07a4('0x7f')]='from-voip-provider';this['exten']=_0x4c18f6[_0x07a4('0x80')];this['app']=_0x1f34e4;this[_0x07a4('0x3c')]=_0x07a4('0x81');this[_0x07a4('0x82')]=_0x07a4('0x83');this[_0x07a4('0x5f')]=_0x4c18f6['id'];this[_0x07a4('0x84')]=_0x1fcfd4;this[_0x07a4('0x85')]=_0x24d4e4;}function createExtensionsReciveFax(_0xdc77c){var _0x3548df=0x1;var _0x468c9=[];_0x468c9[_0x07a4('0x86')](new Extension(_0xdc77c,_0x3548df,'','Answer'));_0x3548df+=0x1;_0x468c9[_0x07a4('0x86')](new Extension(_0xdc77c,_0x3548df,_0x07a4('0x87'),_0x07a4('0x88')));_0x3548df+=0x1;for(var _0x52270f in _0xdc77c){if(_0xdc77c['hasOwnProperty'](_0x52270f)&&(_0x52270f===_0x07a4('0x89')||_0x52270f===_0x07a4('0x80')||_0x52270f===_0x07a4('0x8a')||_0x52270f===_0x07a4('0x8b')||_0x52270f===_0x07a4('0x8c')||_0x52270f===_0x07a4('0x8d')||_0x52270f===_0x07a4('0x8e')||_0x52270f===_0x07a4('0x8f')||_0x52270f===_0x07a4('0x90'))){_0x468c9[_0x07a4('0x86')](new Extension(_0xdc77c,_0x3548df,'FAXOPT('+_0x52270f+')='+_0xdc77c[_0x52270f],_0x07a4('0x88')));_0x3548df+=0x1;}}_0x468c9[_0x07a4('0x86')](new Extension(_0xdc77c,_0x3548df,'6',_0x07a4('0x91')));_0x3548df+=0x1;_0x468c9['push'](new Extension(_0xdc77c,_0x3548df,'/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',_0x07a4('0x92')));_0x3548df=0x0;return _0x468c9;}exports[_0x07a4('0x93')]=function(_0x2fb7da,_0x5a92e2,_0x4e556c){var _0x3d97c7;return db[_0x07a4('0x76')]['transaction'](function(_0xc993df){return db[_0x07a4('0x3a')]['create'](_0x2fb7da['body'],{'transaction':_0xc993df})['then'](function(_0x411f9b){_0x3d97c7=_0x411f9b[_0x07a4('0x30')]({'plain':!![]});return db[_0x07a4('0x94')][_0x07a4('0x7b')](createExtensionsReciveFax(_0x3d97c7),{'transaction':_0xc993df});});})[_0x07a4('0x1b')](function(){return _0x3d97c7;})['then'](respondWithResult(_0x5a92e2,null))[_0x07a4('0x24')](handleError(_0x5a92e2,null));};exports[_0x07a4('0x95')]=function(_0x347872,_0x54e634,_0x193e2b){var _0x5759f9;return db['sequelize']['transaction'](function(_0x44c785){return db[_0x07a4('0x3a')][_0x07a4('0x2f')](_0x347872[_0x07a4('0x54')],{'where':{'id':_0x347872['body']['id']},'transaction':_0x44c785})[_0x07a4('0x1b')](function(_0x59ac61){return db['VoiceExtension'][_0x07a4('0x5c')]({'where':{'FaxAccountId':_0x347872[_0x07a4('0x54')]['id']},'transaction':_0x44c785})[_0x07a4('0x1b')](function(_0x24a77d){return db['VoiceExtension'][_0x07a4('0x7b')](createExtensionsReciveFax(_[_0x07a4('0x6b')](_0x347872[_0x07a4('0x54')],[_0x07a4('0x96'),_0x07a4('0x3d'),_0x07a4('0x97'),_0x07a4('0x98'),_0x07a4('0x99'),_0x07a4('0x9a')])),{'transaction':_0x44c785});});});})['then'](function(){return db[_0x07a4('0x3a')][_0x07a4('0x9b')](_0x347872[_0x07a4('0x54')]['id']);})[_0x07a4('0x1b')](respondWithResult(_0x54e634,null))[_0x07a4('0x24')](handleError(_0x54e634,null));};exports['getMessages']=function(_0x4a17f0,_0x51df33,_0x5a3b95){var _0x188353={'raw':!![],'where':{}};var _0x564909={};var _0x2823fb={'count':0x0,'rows':[]};return db[_0x07a4('0x3a')][_0x07a4('0x62')]({'where':{'id':_0x4a17f0['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x51df33,null))[_0x07a4('0x1b')](function(_0x12d4ca){if(_0x12d4ca){_0x564909[_0x07a4('0x3e')]=_[_0x07a4('0x40')](db[_0x07a4('0x9c')][_0x07a4('0x3b')]);_0x564909[_0x07a4('0x3f')]=_['keys'](_0x4a17f0['query']);_0x564909[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x564909[_0x07a4('0x3e')],_0x564909[_0x07a4('0x3f')]);_0x188353['attributes']=_[_0x07a4('0x42')](_0x564909[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x4a17f0[_0x07a4('0x3f')]['fields']));_0x188353[_0x07a4('0x43')]=_0x188353[_0x07a4('0x43')][_0x07a4('0x45')]?_0x188353[_0x07a4('0x43')]:_0x564909[_0x07a4('0x3e')];if(!_0x4a17f0['query'][_0x07a4('0x46')]('nolimit')){_0x188353['limit']=qs[_0x07a4('0x2b')](_0x4a17f0[_0x07a4('0x3f')][_0x07a4('0x2b')]);_0x188353[_0x07a4('0x29')]=qs[_0x07a4('0x29')](_0x4a17f0[_0x07a4('0x3f')][_0x07a4('0x29')]);}_0x188353[_0x07a4('0x63')]=qs[_0x07a4('0x48')](_0x4a17f0['query'][_0x07a4('0x48')]);_0x188353[_0x07a4('0x49')]=qs[_0x07a4('0x41')](_[_0x07a4('0x4a')](_0x4a17f0['query'],_0x564909[_0x07a4('0x41')]));_0x188353[_0x07a4('0x49')]['FaxAccountId']=_0x12d4ca['id'];if(_0x4a17f0['query']['filter']){_0x188353[_0x07a4('0x49')]=_['merge'](_0x188353[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x188353['attributes'],function(_0x88816f){var _0x33d3bb={};_0x33d3bb[_0x88816f]={'$like':'%'+_0x4a17f0[_0x07a4('0x3f')]['filter']+'%'};return _0x33d3bb;})});}if(_0x4a17f0['query'][_0x07a4('0x9d')]){var _0x1ae042=_0x4a17f0[_0x07a4('0x3f')][_0x07a4('0x9d')]['split'](',');var _0x3a63ac={};_0x3a63ac[_0x1ae042[0x0]]={'$gte':moment(_0x1ae042[0x1])[_0x07a4('0x9e')](_0x07a4('0x9f'))};_0x188353[_0x07a4('0x49')]=_[_0x07a4('0x4c')](_0x188353[_0x07a4('0x49')],_0x3a63ac);}_0x188353=_[_0x07a4('0x4c')]({},_0x188353,_0x4a17f0[_0x07a4('0x4d')]);return db['FaxMessage'][_0x07a4('0x2c')]({'where':_0x188353[_0x07a4('0x49')]})[_0x07a4('0x1b')](function(_0x48064){_0x2823fb['count']=_0x48064;if(_0x4a17f0[_0x07a4('0x3f')]['includeAll']){_0x188353['include']=[{'all':!![]}];}return db[_0x07a4('0x9c')][_0x07a4('0x50')](_0x188353);})[_0x07a4('0x1b')](function(_0x3d05a5){_0x2823fb[_0x07a4('0x68')]=_0x3d05a5;return _0x2823fb;});}})['then'](respondWithFilteredResult(_0x51df33,_0x188353))['catch'](handleError(_0x51df33,null));};exports[_0x07a4('0x35')]=function(_0x1482b1,_0x518ac2,_0x9b0bdf){var _0x2c27cb,_0x279d79={},_0x42996b;if(_0x1482b1['body']['to']){_0x42996b=_0x1482b1['body']['to'][0x0];}return db[_0x07a4('0x3a')][_0x07a4('0x59')]({'where':{'id':_0x1482b1['params']['id']},'include':[{'model':db[_0x07a4('0xa0')],'as':_0x07a4('0xa1'),'include':[{'model':db[_0x07a4('0xa2')],'as':_0x07a4('0xa3'),'where':{'fax':_0x42996b},'limit':0x1,'order':[[_0x07a4('0x98'),_0x07a4('0xa4')]]}]}]})[_0x07a4('0x1b')](handleEntityNotFound(_0x518ac2,null))[_0x07a4('0x1b')](function(_0x1ec8ef){_0x2c27cb=_0x1ec8ef;if(_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')]&&_0x1482b1['body']['attachments'][_0x07a4('0x45')]){for(var _0x3d40f3=0x0;_0x3d40f3<_0x1482b1['body'][_0x07a4('0xa5')][_0x07a4('0x45')];_0x3d40f3+=0x1){_0x1482b1['body'][_0x07a4('0xa5')][_0x3d40f3]={'filename':_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][_0x3d40f3][_0x07a4('0x34')],'id':_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][_0x3d40f3]['id'],'path':path[_0x07a4('0xa6')](config[_0x07a4('0xa7')],_0x07a4('0xa8'),_0x1482b1['body']['attachments'][_0x3d40f3]['basename'])};}}return respondWithRpcPromise(_0x07a4('0xa9'),_0x07a4('0xa9'),{'FaxAccountId':_[_0x07a4('0xaa')](_0x1482b1[_0x07a4('0x52')]['id'])?undefined:_0x1482b1[_0x07a4('0x52')]['id'],'path':_['isNil'](_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0]['path'])?undefined:_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0][_0x07a4('0xab')],'fax':_[_0x07a4('0xaa')](_0x1482b1[_0x07a4('0x54')]['to'][0x0])?undefined:_0x1482b1[_0x07a4('0x54')]['to'][0x0]},client9002);})[_0x07a4('0x1b')](function(){if(_0x2c27cb){if(_['isNil'](_0x1482b1[_0x07a4('0x54')]['from'])){_0x1482b1[_0x07a4('0x54')][_0x07a4('0xac')]=util['format'](_0x07a4('0xad'),_0x2c27cb[_0x07a4('0x34')],_0x2c27cb['fax']);}if(_0x2c27cb[_0x07a4('0xa1')]){if(_0x2c27cb[_0x07a4('0xa1')][_0x07a4('0xa3')][_0x07a4('0x45')]){return _0x2c27cb[_0x07a4('0xa1')][_0x07a4('0xa3')][0x0];}else{return db[_0x07a4('0xa2')][_0x07a4('0x53')](_[_0x07a4('0x15')](_0x1482b1['body'],{'firstName':_0x1482b1[_0x07a4('0x54')]['to'][0x0],'phone':_0x1482b1[_0x07a4('0x54')]['to'][0x0],'fax':_0x1482b1[_0x07a4('0x54')]['to'][0x0],'ListId':_0x2c27cb[_0x07a4('0x9a')]}));}}else{throw new Error(_0x07a4('0xae'));}}else{throw new Error(_0x07a4('0xaf'));}})['then'](function(_0x410608){if(_0x410608){return db[_0x07a4('0x6d')][_0x07a4('0x59')]({'where':{'ContactId':_0x410608['id'],'closed':![],'FaxAccountId':_0x2c27cb['id']}})[_0x07a4('0x1b')](function(_0x124614){if(_0x124614){return[_0x124614,![]];}return db['FaxInteraction'][_0x07a4('0x53')]({'UserId':_0x1482b1[_0x07a4('0x55')]['id'],'ContactId':_0x410608['id'],'FaxAccountId':_0x2c27cb['id'],'fax':_0x1482b1[_0x07a4('0x54')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x07a4('0x4c')](_0x1482b1[_0x07a4('0x54')],{'read':![],'body':_0x1482b1['body'][_0x07a4('0xa5')][0x0]['filename'],'FaxAccountId':_0x2c27cb['id'],'UserId':_0x1482b1[_0x07a4('0x55')]['id'],'ContactId':_0x410608['id'],'AttachmentId':_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0x07a4('0x9c')],'as':_0x07a4('0xb0')}]})['then'](function(_0x52aa58){return[_0x52aa58,!![]];});});}else{throw new Error(_0x07a4('0xb1'));}})[_0x07a4('0xb2')](function(_0x2d6ace,_0x1b799a){if(_0x1b799a){return _0x2d6ace;}return db[_0x07a4('0x9c')][_0x07a4('0x53')]({'direction':_0x07a4('0xb3'),'read':![],'body':_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0][_0x07a4('0xb4')],'FaxAccountId':_0x2c27cb['id'],'FaxInteractionId':_0x2d6ace['id'],'UserId':_0x1482b1['user']['id'],'ContactId':_0x2d6ace[_0x07a4('0xb5')],'AttachmentId':_0x1482b1['body'][_0x07a4('0xa5')][0x0]['id']})[_0x07a4('0x1b')](function(_0x4ca168){_0x2d6ace[_0x07a4('0xb6')][_0x07a4('0xb0')]=[];_0x2d6ace[_0x07a4('0xb6')][_0x07a4('0xb0')]['push'](_0x4ca168[_0x07a4('0xb6')]);return _0x2d6ace;});})['then'](function(_0x4acac0){respondWithRpcPromise(_0x07a4('0xb7'),'SendFax',{'FaxAccountId':_[_0x07a4('0xaa')](_0x1482b1['params']['id'])?undefined:_0x1482b1[_0x07a4('0x52')]['id'],'path':_[_0x07a4('0xaa')](_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0][_0x07a4('0xab')])?undefined:_0x1482b1[_0x07a4('0x54')][_0x07a4('0xa5')][0x0][_0x07a4('0xab')],'fax':_['isNil'](_0x1482b1[_0x07a4('0x54')]['to'][0x0])?undefined:_0x1482b1[_0x07a4('0x54')]['to'][0x0],'AttachmentId':_0x1482b1[_0x07a4('0x54')]['attachments'][0x0]['id']},client9002)[_0x07a4('0x1b')](function(_0xefe702){logger[_0x07a4('0xb8')](_0x07a4('0xb9'),_0xefe702);})[_0x07a4('0x24')](function(_0x1f85c5){logger[_0x07a4('0xb8')](_0x07a4('0xb9'),_0x1f85c5);});return _0x4acac0;})['then'](respondWithResult(_0x518ac2,null))[_0x07a4('0x24')](handleError(_0x518ac2,null));};exports[_0x07a4('0xba')]=function(_0x25c551,_0x11c29f,_0x4d5745){return db['FaxAccount'][_0x07a4('0x59')]({'where':{'id':_0x25c551['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x11c29f,null))['then'](function(_0x3d54aa){if(_0x3d54aa){return _0x3d54aa['addAgents'](_0x25c551['body'][_0x07a4('0x65')],_[_0x07a4('0x6b')](_0x25c551[_0x07a4('0x54')],['ids','id'])||{})[_0x07a4('0xb2')](function(_0x65534e){for(var _0x1f2516=0x0;_0x1f2516<_0x25c551['body'][_0x07a4('0x65')]['length'];_0x1f2516+=0x1){socket['emit'](_0x07a4('0xbb'),{'UserId':Number(_0x25c551['body'][_0x07a4('0x65')][_0x1f2516]),'FaxAccountId':Number(_0x25c551['params']['id'])});}return _0x65534e;});}})['then'](respondWithResult(_0x11c29f,null))['catch'](handleError(_0x11c29f,null));};exports[_0x07a4('0xbc')]=function(_0x16cc32,_0x3d57b3,_0x3fa5b4){return db[_0x07a4('0x3a')]['find']({'where':{'id':_0x16cc32['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x3d57b3,null))['then'](function(_0x3dcc5b){if(_0x3dcc5b){return _0x3dcc5b[_0x07a4('0xbc')](_0x16cc32['query'][_0x07a4('0x65')])[_0x07a4('0x1b')](function(){if(_[_0x07a4('0xbd')](_0x16cc32[_0x07a4('0x3f')][_0x07a4('0x65')])){for(var _0x114876=0x0;_0x114876<_0x16cc32[_0x07a4('0x3f')][_0x07a4('0x65')][_0x07a4('0x45')];_0x114876+=0x1){socket[_0x07a4('0xbe')](_0x07a4('0xbf'),{'UserId':Number(_0x16cc32[_0x07a4('0x3f')]['ids'][_0x114876]),'FaxAccountId':Number(_0x16cc32[_0x07a4('0x52')]['id'])});}}else{socket[_0x07a4('0xbe')](_0x07a4('0xbf'),{'UserId':Number(_0x16cc32[_0x07a4('0x3f')][_0x07a4('0x65')]),'FaxAccountId':Number(_0x16cc32[_0x07a4('0x52')]['id'])});}});}})[_0x07a4('0x1b')](respondWithStatusCode(_0x3d57b3,null))[_0x07a4('0x24')](handleError(_0x3d57b3,null));};exports[_0x07a4('0xc0')]=function(_0x3d8fb3,_0x4f710b,_0x24463b){var _0x1317e9={};var _0x4c5c38={};var _0x516c48;var _0x3c88b1;return db['FaxAccount'][_0x07a4('0x62')]({'where':{'id':_0x3d8fb3['params']['id']}})[_0x07a4('0x1b')](handleEntityNotFound(_0x4f710b,null))[_0x07a4('0x1b')](function(_0x376eb2){if(_0x376eb2){_0x516c48=_0x376eb2;_0x4c5c38[_0x07a4('0x3e')]=_[_0x07a4('0x40')](db[_0x07a4('0xc1')][_0x07a4('0x3b')]);_0x4c5c38[_0x07a4('0x3f')]=_[_0x07a4('0x40')](_0x3d8fb3[_0x07a4('0x3f')]);_0x4c5c38[_0x07a4('0x41')]=_[_0x07a4('0x42')](_0x4c5c38[_0x07a4('0x3e')],_0x4c5c38[_0x07a4('0x3f')]);_0x1317e9['attributes']=_[_0x07a4('0x42')](_0x4c5c38[_0x07a4('0x3e')],qs[_0x07a4('0x44')](_0x3d8fb3['query'][_0x07a4('0x44')]));_0x1317e9['attributes']=_0x1317e9[_0x07a4('0x43')][_0x07a4('0x45')]?_0x1317e9[_0x07a4('0x43')]:_0x4c5c38[_0x07a4('0x3e')];_0x1317e9['order']=qs[_0x07a4('0x48')](_0x3d8fb3['query'][_0x07a4('0x48')]);_0x1317e9[_0x07a4('0x49')]=qs[_0x07a4('0x41')](_[_0x07a4('0x4a')](_0x3d8fb3[_0x07a4('0x3f')],_0x4c5c38[_0x07a4('0x41')]));if(_0x3d8fb3['query']['filter']){_0x1317e9[_0x07a4('0x49')]=_['merge'](_0x1317e9[_0x07a4('0x49')],{'$or':_[_0x07a4('0x39')](_0x1317e9[_0x07a4('0x43')],function(_0x191749){var _0x3e7714={};_0x3e7714[_0x191749]={'$like':'%'+_0x3d8fb3[_0x07a4('0x3f')][_0x07a4('0x4b')]+'%'};return _0x3e7714;})});}_0x1317e9=_['merge']({},_0x1317e9,_0x3d8fb3[_0x07a4('0x4d')]);return _0x516c48[_0x07a4('0xc0')](_0x1317e9);}})[_0x07a4('0x1b')](function(_0xe41f46){if(_0xe41f46){_0x3c88b1=_0xe41f46[_0x07a4('0x45')];if(!_0x3d8fb3['query'][_0x07a4('0x46')](_0x07a4('0x47'))){_0x1317e9[_0x07a4('0x2b')]=qs['limit'](_0x3d8fb3[_0x07a4('0x3f')]['limit']);_0x1317e9[_0x07a4('0x29')]=qs[_0x07a4('0x29')](_0x3d8fb3[_0x07a4('0x3f')][_0x07a4('0x29')]);}return _0x516c48[_0x07a4('0xc0')](_0x1317e9);}})[_0x07a4('0x1b')](function(_0x3c6669){if(_0x3c6669){return _0x3c6669?{'count':_0x3c88b1,'rows':_0x3c6669}:null;}})[_0x07a4('0x1b')](respondWithResult(_0x4f710b,null))[_0x07a4('0x24')](handleError(_0x4f710b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d548f1d..034010d 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 _0x6eeb=['exports','events','../../mysqldb','emit','hook'];(function(_0x29b56a,_0x1663cc){var _0x4747cb=function(_0x28b2cc){while(--_0x28b2cc){_0x29b56a['push'](_0x29b56a['shift']());}};_0x4747cb(++_0x1663cc);}(_0x6eeb,0x97));var _0xb6ee=function(_0x2dd970,_0x316ea1){_0x2dd970=_0x2dd970-0x0;var _0x109177=_0x6eeb[_0x2dd970];return _0x109177;};'use strict';var EventEmitter=require(_0xb6ee('0x0'));var FaxAccount=require(_0xb6ee('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f6762){return function(_0x149d0f,_0x13a120,_0x533e0e){FaxAccountEvents[_0xb6ee('0x2')](_0x1f6762+':'+_0x149d0f['id'],_0x149d0f);FaxAccountEvents[_0xb6ee('0x2')](_0x1f6762,_0x149d0f);_0x533e0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xb6ee('0x3')](e,emitEvent(event));}}module[_0xb6ee('0x4')]=FaxAccountEvents; \ No newline at end of file +var _0xe9cb=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4402fc,_0x1670af){var _0xb13a0=function(_0x2c3378){while(--_0x2c3378){_0x4402fc['push'](_0x4402fc['shift']());}};_0xb13a0(++_0x1670af);}(_0xe9cb,0xbf));var _0xbe9c=function(_0x231544,_0x592bab){_0x231544=_0x231544-0x0;var _0x3a96df=_0xe9cb[_0x231544];return _0x3a96df;};'use strict';var EventEmitter=require(_0xbe9c('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xbe9c('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbe9c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe9c('0x3'),'afterDestroy':_0xbe9c('0x4')};function emitEvent(_0x4ec6c2){return function(_0x580bb3,_0x2a9f97,_0x4ccc31){FaxAccountEvents[_0xbe9c('0x5')](_0x4ec6c2+':'+_0x580bb3['id'],_0x580bb3);FaxAccountEvents[_0xbe9c('0x5')](_0x4ec6c2,_0x580bb3);_0x4ccc31(null);};}for(var e in events){if(events[_0xbe9c('0x6')](e)){var event=events[e];FaxAccount[_0xbe9c('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bc7cd87..71bc366 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 _0x8ff1=['api','bluebird','request-promise','rimraf','./faxAccount.attributes','define','FaxAccount','lodash','util','../../config/logger'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x8ff1,0x9d));var _0x18ff=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x8ff1[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x18ff('0x0'));var util=require(_0x18ff('0x1'));var logger=require(_0x18ff('0x2'))(_0x18ff('0x3'));var moment=require('moment');var BPromise=require(_0x18ff('0x4'));var rp=require(_0x18ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ff('0x6'));var config=require('../../config/environment');var attributes=require(_0x18ff('0x7'));module['exports']=function(_0x143bd9,_0x327595){return _0x143bd9[_0x18ff('0x8')](_0x18ff('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf285=['api','moment','bluebird','path','./faxAccount.attributes','exports','define','fax_accounts','util','../../config/logger'];(function(_0x1080ef,_0x15990d){var _0x5d9b1a=function(_0x33fceb){while(--_0x33fceb){_0x1080ef['push'](_0x1080ef['shift']());}};_0x5d9b1a(++_0x15990d);}(_0xf285,0x166));var _0x5f28=function(_0x99cafc,_0x4567c8){_0x99cafc=_0x99cafc-0x0;var _0x479b93=_0xf285[_0x99cafc];return _0x479b93;};'use strict';var _=require('lodash');var util=require(_0x5f28('0x0'));var logger=require(_0x5f28('0x1'))(_0x5f28('0x2'));var moment=require(_0x5f28('0x3'));var BPromise=require(_0x5f28('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f28('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f28('0x6'));module[_0x5f28('0x7')]=function(_0xe4aa21,_0x1d7a0a){return _0xe4aa21[_0x5f28('0x8')]('FaxAccount',attributes,{'tableName':_0x5f28('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 4bf21de..03a3526 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 _0x0f8a=['List','Applications','get','applications','orderBy','priority','asc','Contacts','length','ListId','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account'];(function(_0x8930d8,_0x2c5eb9){var _0x4362be=function(_0x190b6b){while(--_0x190b6b){_0x8930d8['push'](_0x8930d8['shift']());}};_0x4362be(++_0x2c5eb9);}(_0x0f8a,0x17e));var _0xa0f8=function(_0x33945e,_0x35a8f1){_0x33945e=_0x33945e-0x0;var _0x2240bc=_0x0f8a[_0x33945e];return _0x2240bc;};'use strict';var _=require(_0xa0f8('0x0'));var util=require('util');var moment=require(_0xa0f8('0x1'));var BPromise=require(_0xa0f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0f8('0x3'));var logger=require(_0xa0f8('0x4'))(_0xa0f8('0x5'));var config=require(_0xa0f8('0x6'));var jayson=require(_0xa0f8('0x7'));var client=jayson[_0xa0f8('0x8')][_0xa0f8('0x9')]({'port':0x232c});config[_0xa0f8('0xa')]=_[_0xa0f8('0xb')](config['redis'],{'host':_0xa0f8('0xc'),'port':0x18eb});var socket=require(_0xa0f8('0xd'))(new Redis(config['redis']));require(_0xa0f8('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f4656,_0x4daf2c,_0x55710c){return new BPromise(function(_0x466d3a,_0x3273d){return client[_0xa0f8('0xf')](_0x1f4656,_0x55710c)[_0xa0f8('0x10')](function(_0x30212d){logger[_0xa0f8('0x11')](_0xa0f8('0x12'),_0x4daf2c,_0xa0f8('0x13'));logger[_0xa0f8('0x14')](_0xa0f8('0x15'),_0x4daf2c,_0xa0f8('0x13'),JSON[_0xa0f8('0x16')](_0x30212d));if(_0x30212d[_0xa0f8('0x17')]){if(_0x30212d[_0xa0f8('0x17')][_0xa0f8('0x18')]===0x1f4){logger[_0xa0f8('0x17')](_0xa0f8('0x12'),_0x4daf2c,_0x30212d[_0xa0f8('0x17')][_0xa0f8('0x19')]);return _0x3273d(_0x30212d[_0xa0f8('0x17')][_0xa0f8('0x19')]);}logger[_0xa0f8('0x17')](_0xa0f8('0x12'),_0x4daf2c,_0x30212d[_0xa0f8('0x17')]['message']);return _0x466d3a(_0x30212d['error']['message']);}else{logger[_0xa0f8('0x11')](_0xa0f8('0x12'),_0x4daf2c,'request\x20sent');_0x466d3a(_0x30212d[_0xa0f8('0x1a')][_0xa0f8('0x19')]);}})[_0xa0f8('0x1b')](function(_0x57fe31){logger[_0xa0f8('0x17')](_0xa0f8('0x12'),_0x4daf2c,_0x57fe31);_0x3273d(_0x57fe31);});});}exports[_0xa0f8('0x1c')]=function(_0x432ded){var _0x719980=this;return new Promise(function(_0x2fa403,_0x375cd9){return db[_0xa0f8('0x1d')][_0xa0f8('0x1e')]({'raw':_0x432ded[_0xa0f8('0x1f')]?_0x432ded[_0xa0f8('0x1f')][_0xa0f8('0x20')]===undefined?!![]:![]:!![],'where':_0x432ded[_0xa0f8('0x1f')]?_0x432ded[_0xa0f8('0x1f')][_0xa0f8('0x21')]||null:null,'attributes':_0x432ded[_0xa0f8('0x1f')]?_0x432ded[_0xa0f8('0x1f')]['attributes']||null:null,'limit':_0x432ded[_0xa0f8('0x1f')]?_0x432ded[_0xa0f8('0x1f')][_0xa0f8('0x22')]||null:null,'include':_0x432ded[_0xa0f8('0x1f')]?_0x432ded[_0xa0f8('0x1f')][_0xa0f8('0x23')]?_[_0xa0f8('0x24')](_0x432ded[_0xa0f8('0x1f')]['include'],function(_0x38ac98){return{'model':db[_0x38ac98[_0xa0f8('0x25')]],'as':_0x38ac98['as'],'attributes':_0x38ac98[_0xa0f8('0x26')],'include':_0x38ac98[_0xa0f8('0x23')]?_[_0xa0f8('0x24')](_0x38ac98[_0xa0f8('0x23')],function(_0x4db9b1){return{'model':db[_0x4db9b1['model']],'as':_0x4db9b1['as'],'attributes':_0x4db9b1[_0xa0f8('0x26')],'include':_0x4db9b1[_0xa0f8('0x23')]?_['map'](_0x4db9b1[_0xa0f8('0x23')],function(_0x5ab607){return{'model':db[_0x5ab607[_0xa0f8('0x25')]],'as':_0x5ab607['as'],'attributes':_0x5ab607[_0xa0f8('0x26')]};}):[]};}):[]};}):[]:[]})[_0xa0f8('0x10')](function(_0x4aac6c){logger[_0xa0f8('0x11')]('GetFaxAccount',_0x432ded);logger[_0xa0f8('0x14')]('GetFaxAccount',_0x432ded,JSON[_0xa0f8('0x16')](_0x4aac6c));_0x2fa403(_0x4aac6c);})[_0xa0f8('0x1b')](function(_0x354d30){logger[_0xa0f8('0x17')](_0xa0f8('0x1c'),_0x354d30[_0xa0f8('0x19')],_0x432ded);_0x375cd9(_0x719980[_0xa0f8('0x17')](0x1f4,_0x354d30[_0xa0f8('0x19')]));});});};exports[_0xa0f8('0x27')]=function(_0x5646c8,_0x3ce122,_0x2e8ee7){var _0x2c8307=this;return new Promise(function(_0x7c387,_0x526c23){var _0x44b5de={'body':_0x5646c8[_0xa0f8('0x28')],'channel':_0xa0f8('0x29')};var _0x44d004=[];var _0x5ede27=[];var _0x4eed24={};return db[_0xa0f8('0x2a')]['describe']()[_0xa0f8('0x10')](function(_0x2706e1){if(!_0x2706e1){throw new db[(_0xa0f8('0x2b'))][(_0xa0f8('0x2c'))](_0xa0f8('0x2d'));}_0x44d004=_[_0xa0f8('0x2e')](_['keys'](_0x2706e1),['createdAt',_0xa0f8('0x2f')]);_0x5ede27=_[_0xa0f8('0x2e')](_[_0xa0f8('0x30')](_0x2706e1),['createdAt','updatedAt',_0xa0f8('0x31'),'ListId']);if(_0x5646c8[_0xa0f8('0x28')]['id']){delete _0x5646c8[_0xa0f8('0x28')]['id'];}if(_[_0xa0f8('0x32')](_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x33')])){throw new db[(_0xa0f8('0x2b'))][(_0xa0f8('0x2c'))](_0xa0f8('0x34'));}if(_[_0xa0f8('0x32')](_0x5646c8['body']['body'])||_0x5646c8['body'][_0xa0f8('0x28')]===''){throw new db[(_0xa0f8('0x2b'))][(_0xa0f8('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa0f8('0x32')](_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x35')])){throw new db[(_0xa0f8('0x2b'))][(_0xa0f8('0x2c'))](_0xa0f8('0x36')+_0x5ede27);}if(!_[_0xa0f8('0x37')](_0x5ede27,_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x35')])){throw new db[(_0xa0f8('0x2b'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ede27);}_0x4eed24[_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x35')]]=_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x33')];})[_0xa0f8('0x10')](function(){return db[_0xa0f8('0x1d')][_0xa0f8('0x38')]({'where':{'id':_0x5646c8[_0xa0f8('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xa0f8('0x3a'),'include':[{'model':db[_0xa0f8('0x2a')],'as':'Contacts','where':_0x4eed24,'limit':0x1,'order':[[_0xa0f8('0x2f'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xa0f8('0x3b')}]});})[_0xa0f8('0x10')](function(_0x5b8b93){if(_0x5b8b93&&_0x5b8b93['List']){var _0x42b509=_0x5b8b93[_0xa0f8('0x3c')]({'plain':!![]});_0x44b5de[_0xa0f8('0x39')]=_0x42b509;_0x44b5de['applications']=_0x42b509[_0xa0f8('0x3b')];_0x44b5de['list']=_0x42b509[_0xa0f8('0x3a')];_0x44b5de[_0xa0f8('0x3d')]=_[_0xa0f8('0x3e')](_0x44b5de[_0xa0f8('0x3d')],[_0xa0f8('0x3f')],[_0xa0f8('0x40')]);if(_0x44b5de['account']['Applications']){delete _0x44b5de[_0xa0f8('0x39')][_0xa0f8('0x3b')];}if(_0x44b5de['account'][_0xa0f8('0x3a')]&&_0x44b5de[_0xa0f8('0x39')][_0xa0f8('0x3a')][_0xa0f8('0x41')][_0xa0f8('0x42')]){return _0x44b5de[_0xa0f8('0x39')][_0xa0f8('0x3a')][_0xa0f8('0x41')][0x0];}var _0x5f2193=_[_0xa0f8('0xb')](_0x5646c8['body'],{'firstName':_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x33')],'ListId':_0x42b509[_0xa0f8('0x43')]});_0x5f2193[_0x5646c8[_0xa0f8('0x28')]['mapKey']]=_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x33')];return db[_0xa0f8('0x2a')][_0xa0f8('0x44')](_0x5f2193,{'fields':_0x44d004,'raw':!![]});}})[_0xa0f8('0x10')](function(_0x57a8f5){_0x44b5de['contact']=_0x57a8f5;if(_0x57a8f5){var _0x335d41={'ContactId':_0x57a8f5['id'],'FaxAccountId':_0x5646c8[_0xa0f8('0x39')]['id'],'fax':_0x57a8f5[_0xa0f8('0x29')]};return db[_0xa0f8('0x45')]['find']({'where':{'ContactId':_0x57a8f5['id'],'closed':![],'FaxAccountId':_0x5646c8['account']['id']}})[_0xa0f8('0x10')](function(_0x5d7a31){if(_0x5d7a31){return[_0x5d7a31,![]];}return db[_0xa0f8('0x45')]['create'](_0x335d41)[_0xa0f8('0x10')](function(_0xb5e274){return[_0xb5e274,!![]];});});}else{throw new Error(_0xa0f8('0x46'));}})['spread'](function(_0x44e4f4,_0x2e6e6f){var _0x53700a=_0x44e4f4[_0xa0f8('0x3c')]({'plain':!![]});if(_0x2e6e6f){if(_0x44b5de[_0xa0f8('0x39')][_0xa0f8('0x47')]){_0x44b5de[_0xa0f8('0x3d')][_0xa0f8('0x48')]({'id':0x0,'priority':_0x44b5de[_0xa0f8('0x3d')][_0xa0f8('0x42')]+0x1,'app':_0xa0f8('0x49'),'appdata':_0xa0f8('0x4a'),'interval':_0xa0f8('0x4b')});}_0x53700a[_0xa0f8('0x4c')]=!![];}else{_0x53700a[_0xa0f8('0x4c')]=![];}_0x44b5de[_0xa0f8('0x4d')]=_0x53700a;return db[_0xa0f8('0x4e')][_0xa0f8('0x44')]({'body':_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x28')],'FaxAccountId':_0x5646c8[_0xa0f8('0x39')]['id'],'FaxInteractionId':_0x44e4f4['id'],'direction':'in','ContactId':_0x44e4f4[_0xa0f8('0x4f')],'AttachmentId':_0x5646c8[_0xa0f8('0x28')][_0xa0f8('0x50')]});})[_0xa0f8('0x10')](function(_0x150a3d){_0x44b5de[_0xa0f8('0x19')]=_0x150a3d;if(_0x44b5de[_0xa0f8('0x4d')][_0xa0f8('0x51')]){return db[_0xa0f8('0x52')]['find']({'attributes':['id',_0xa0f8('0x53')],'where':{'id':_0x44b5de['interaction'][_0xa0f8('0x51')]}})[_0xa0f8('0x10')](function(_0x1363f0){if(_0x1363f0){_0x44b5de[_0xa0f8('0x3d')][_0xa0f8('0x54')]({'id':0x0,'priority':0x0,'app':_0xa0f8('0x55'),'appdata':_0x1363f0[_0xa0f8('0x53')]+','+(_0x44b5de[_0xa0f8('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xa0f8('0x4b')});}return respondWithRpcPromise(_0xa0f8('0x56'),'startRouting',_0x44b5de);});}return respondWithRpcPromise(_0xa0f8('0x56'),_0xa0f8('0x57'),_0x44b5de);})[_0xa0f8('0x10')](function(_0x580c3c){_0x7c387(_0x580c3c);})[_0xa0f8('0x1b')](function(_0x4b94ed){_0x526c23(_0x2c8307['error'](0x1f4,_0x4b94ed[_0xa0f8('0x19')]));});});}; \ No newline at end of file +var _0x2a0b=['request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetFaxAccount','findAll','options','where','limit','map','include','model','attributes','debug','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','keys','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','applications','Applications','list','orderBy','priority','asc','length','contact','FaxInteraction','create','Contact\x20not\x20found','spread','get','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','name','unshift','agent','Start','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s'];(function(_0x3c52f5,_0x14c305){var _0x4a536e=function(_0x5d52e3){while(--_0x5d52e3){_0x3c52f5['push'](_0x3c52f5['shift']());}};_0x4a536e(++_0x14c305);}(_0x2a0b,0xf9));var _0xb2a0=function(_0x512cde,_0x2394a2){_0x512cde=_0x512cde-0x0;var _0x165af2=_0x2a0b[_0x512cde];return _0x165af2;};'use strict';var _=require('lodash');var util=require(_0xb2a0('0x0'));var moment=require('moment');var BPromise=require(_0xb2a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2a0('0x2'))['db'];var utils=require(_0xb2a0('0x3'));var logger=require(_0xb2a0('0x4'))(_0xb2a0('0x5'));var config=require(_0xb2a0('0x6'));var jayson=require(_0xb2a0('0x7'));var client=jayson[_0xb2a0('0x8')][_0xb2a0('0x9')]({'port':0x232c});config['redis']=_[_0xb2a0('0xa')](config[_0xb2a0('0xb')],{'host':_0xb2a0('0xc'),'port':0x18eb});var socket=require(_0xb2a0('0xd'))(new Redis(config[_0xb2a0('0xb')]));require('./faxAccount.socket')[_0xb2a0('0xe')](socket);function respondWithRpcPromise(_0x506e43,_0x26d808,_0xe05e19){return new BPromise(function(_0x1c5ed4,_0x224935){return client[_0xb2a0('0xf')](_0x506e43,_0xe05e19)[_0xb2a0('0x10')](function(_0x46e6bc){logger['info'](_0xb2a0('0x11'),_0x26d808,_0xb2a0('0x12'));logger['debug'](_0xb2a0('0x13'),_0x26d808,_0xb2a0('0x12'),JSON['stringify'](_0x46e6bc));if(_0x46e6bc[_0xb2a0('0x14')]){if(_0x46e6bc[_0xb2a0('0x14')][_0xb2a0('0x15')]===0x1f4){logger['error'](_0xb2a0('0x11'),_0x26d808,_0x46e6bc[_0xb2a0('0x14')]['message']);return _0x224935(_0x46e6bc['error'][_0xb2a0('0x16')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x26d808,_0x46e6bc[_0xb2a0('0x14')][_0xb2a0('0x16')]);return _0x1c5ed4(_0x46e6bc[_0xb2a0('0x14')][_0xb2a0('0x16')]);}else{logger[_0xb2a0('0x17')]('FaxAccount,\x20%s,\x20%s',_0x26d808,_0xb2a0('0x12'));_0x1c5ed4(_0x46e6bc[_0xb2a0('0x18')][_0xb2a0('0x16')]);}})['catch'](function(_0x181abd){logger[_0xb2a0('0x14')](_0xb2a0('0x11'),_0x26d808,_0x181abd);_0x224935(_0x181abd);});});}exports[_0xb2a0('0x19')]=function(_0x5a449a){var _0x5ceb67=this;return new Promise(function(_0x4b3687,_0x230e46){return db['FaxAccount'][_0xb2a0('0x1a')]({'raw':_0x5a449a[_0xb2a0('0x1b')]?_0x5a449a[_0xb2a0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5a449a['options']?_0x5a449a[_0xb2a0('0x1b')][_0xb2a0('0x1c')]||null:null,'attributes':_0x5a449a[_0xb2a0('0x1b')]?_0x5a449a[_0xb2a0('0x1b')]['attributes']||null:null,'limit':_0x5a449a['options']?_0x5a449a['options'][_0xb2a0('0x1d')]||null:null,'include':_0x5a449a[_0xb2a0('0x1b')]?_0x5a449a[_0xb2a0('0x1b')]['include']?_[_0xb2a0('0x1e')](_0x5a449a[_0xb2a0('0x1b')][_0xb2a0('0x1f')],function(_0x3a5b70){return{'model':db[_0x3a5b70[_0xb2a0('0x20')]],'as':_0x3a5b70['as'],'attributes':_0x3a5b70[_0xb2a0('0x21')],'include':_0x3a5b70[_0xb2a0('0x1f')]?_['map'](_0x3a5b70[_0xb2a0('0x1f')],function(_0x5940db){return{'model':db[_0x5940db[_0xb2a0('0x20')]],'as':_0x5940db['as'],'attributes':_0x5940db[_0xb2a0('0x21')],'include':_0x5940db[_0xb2a0('0x1f')]?_['map'](_0x5940db[_0xb2a0('0x1f')],function(_0x2b329b){return{'model':db[_0x2b329b[_0xb2a0('0x20')]],'as':_0x2b329b['as'],'attributes':_0x2b329b[_0xb2a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb2a0('0x10')](function(_0x1dce3c){logger[_0xb2a0('0x17')](_0xb2a0('0x19'),_0x5a449a);logger[_0xb2a0('0x22')](_0xb2a0('0x19'),_0x5a449a,JSON['stringify'](_0x1dce3c));_0x4b3687(_0x1dce3c);})[_0xb2a0('0x23')](function(_0x1b67d5){logger[_0xb2a0('0x14')](_0xb2a0('0x19'),_0x1b67d5[_0xb2a0('0x16')],_0x5a449a);_0x230e46(_0x5ceb67[_0xb2a0('0x14')](0x1f4,_0x1b67d5[_0xb2a0('0x16')]));});});};exports[_0xb2a0('0x24')]=function(_0x1f690a,_0x1947bf,_0x379f1d){var _0x2defc=this;return new Promise(function(_0x4550cd,_0x35f6ea){var _0x2c6682={'body':_0x1f690a[_0xb2a0('0x25')],'channel':_0xb2a0('0x26')};var _0x423d51=[];var _0x54021c=[];var _0x42e78c={};return db[_0xb2a0('0x27')][_0xb2a0('0x28')]()[_0xb2a0('0x10')](function(_0x4d8564){if(!_0x4d8564){throw new db[(_0xb2a0('0x29'))][(_0xb2a0('0x2a'))]('no\x20available\x20attributes');}_0x423d51=_['difference'](_[_0xb2a0('0x2b')](_0x4d8564),[_0xb2a0('0x2c'),_0xb2a0('0x2d')]);_0x54021c=_[_0xb2a0('0x2e')](_['keys'](_0x4d8564),[_0xb2a0('0x2c'),_0xb2a0('0x2d'),_0xb2a0('0x2f'),_0xb2a0('0x30')]);if(_0x1f690a['body']['id']){delete _0x1f690a[_0xb2a0('0x25')]['id'];}if(_[_0xb2a0('0x31')](_0x1f690a['body'][_0xb2a0('0x32')])){throw new db[(_0xb2a0('0x29'))][(_0xb2a0('0x2a'))](_0xb2a0('0x33'));}if(_[_0xb2a0('0x31')](_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x25')])||_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x25')]===''){throw new db[(_0xb2a0('0x29'))]['ValidationError'](_0xb2a0('0x34'));}if(_['isNil'](_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x35')])){throw new db['Sequelize'][(_0xb2a0('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54021c);}if(!_['includes'](_0x54021c,_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x35')])){throw new db[(_0xb2a0('0x29'))][(_0xb2a0('0x2a'))](_0xb2a0('0x36')+_0x54021c);}_0x42e78c[_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x35')]]=_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x32')];})['then'](function(){return db[_0xb2a0('0x37')][_0xb2a0('0x38')]({'where':{'id':_0x1f690a[_0xb2a0('0x39')]['id']},'include':[{'model':db[_0xb2a0('0x3a')],'as':_0xb2a0('0x3b'),'include':[{'model':db[_0xb2a0('0x27')],'as':_0xb2a0('0x3c'),'where':_0x42e78c,'limit':0x1,'order':[[_0xb2a0('0x2d'),_0xb2a0('0x3d')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xb2a0('0x10')](function(_0x1ebea8){if(_0x1ebea8&&_0x1ebea8['List']){var _0x236a56=_0x1ebea8['get']({'plain':!![]});_0x2c6682[_0xb2a0('0x39')]=_0x236a56;_0x2c6682[_0xb2a0('0x3e')]=_0x236a56[_0xb2a0('0x3f')];_0x2c6682[_0xb2a0('0x40')]=_0x236a56[_0xb2a0('0x3b')];_0x2c6682[_0xb2a0('0x3e')]=_[_0xb2a0('0x41')](_0x2c6682['applications'],[_0xb2a0('0x42')],[_0xb2a0('0x43')]);if(_0x2c6682['account'][_0xb2a0('0x3f')]){delete _0x2c6682[_0xb2a0('0x39')][_0xb2a0('0x3f')];}if(_0x2c6682['account']['List']&&_0x2c6682[_0xb2a0('0x39')]['List'][_0xb2a0('0x3c')][_0xb2a0('0x44')]){return _0x2c6682[_0xb2a0('0x39')][_0xb2a0('0x3b')][_0xb2a0('0x3c')][0x0];}var _0x1d43a8=_[_0xb2a0('0xa')](_0x1f690a[_0xb2a0('0x25')],{'firstName':_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x32')],'ListId':_0x236a56[_0xb2a0('0x30')]});_0x1d43a8[_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x35')]]=_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x32')];return db['CmContact']['create'](_0x1d43a8,{'fields':_0x423d51,'raw':!![]});}})[_0xb2a0('0x10')](function(_0x3e2e44){_0x2c6682[_0xb2a0('0x45')]=_0x3e2e44;if(_0x3e2e44){var _0x70ef67={'ContactId':_0x3e2e44['id'],'FaxAccountId':_0x1f690a[_0xb2a0('0x39')]['id'],'fax':_0x3e2e44['fax']};return db['FaxInteraction'][_0xb2a0('0x38')]({'where':{'ContactId':_0x3e2e44['id'],'closed':![],'FaxAccountId':_0x1f690a['account']['id']}})['then'](function(_0x4732e4){if(_0x4732e4){return[_0x4732e4,![]];}return db[_0xb2a0('0x46')][_0xb2a0('0x47')](_0x70ef67)[_0xb2a0('0x10')](function(_0x3b04e1){return[_0x3b04e1,!![]];});});}else{throw new Error(_0xb2a0('0x48'));}})[_0xb2a0('0x49')](function(_0x3d7865,_0x22ee7d){var _0x36e4cf=_0x3d7865[_0xb2a0('0x4a')]({'plain':!![]});if(_0x22ee7d){if(_0x2c6682['account']['autoclose']){_0x2c6682[_0xb2a0('0x3e')][_0xb2a0('0x4b')]({'id':0x0,'priority':_0x2c6682[_0xb2a0('0x3e')][_0xb2a0('0x44')]+0x1,'app':_0xb2a0('0x4c'),'appdata':_0xb2a0('0x4d'),'interval':_0xb2a0('0x4e')});}_0x36e4cf[_0xb2a0('0x4f')]=!![];}else{_0x36e4cf['created']=![];}_0x2c6682['interaction']=_0x36e4cf;return db[_0xb2a0('0x50')]['create']({'body':_0x1f690a[_0xb2a0('0x25')][_0xb2a0('0x25')],'FaxAccountId':_0x1f690a[_0xb2a0('0x39')]['id'],'FaxInteractionId':_0x3d7865['id'],'direction':'in','ContactId':_0x3d7865[_0xb2a0('0x51')],'AttachmentId':_0x1f690a[_0xb2a0('0x25')]['AttachmentId']});})[_0xb2a0('0x10')](function(_0xf69694){_0x2c6682[_0xb2a0('0x16')]=_0xf69694;if(_0x2c6682[_0xb2a0('0x52')][_0xb2a0('0x53')]){return db[_0xb2a0('0x54')][_0xb2a0('0x38')]({'attributes':['id',_0xb2a0('0x55')],'where':{'id':_0x2c6682[_0xb2a0('0x52')][_0xb2a0('0x53')]}})[_0xb2a0('0x10')](function(_0x28d012){if(_0x28d012){_0x2c6682[_0xb2a0('0x3e')][_0xb2a0('0x56')]({'id':0x0,'priority':0x0,'app':_0xb2a0('0x57'),'appdata':_0x28d012[_0xb2a0('0x55')]+','+(_0x2c6682[_0xb2a0('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xb2a0('0x4e')});}return respondWithRpcPromise(_0xb2a0('0x58'),'startRouting',_0x2c6682);});}return respondWithRpcPromise(_0xb2a0('0x58'),'startRouting',_0x2c6682);})[_0xb2a0('0x10')](function(_0x3e01ba){_0x4550cd(_0x3e01ba);})[_0xb2a0('0x23')](function(_0x127f13){_0x35f6ea(_0x2defc[_0xb2a0('0x14')](0x1f4,_0x127f13[_0xb2a0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index a14a96e..088b05d 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 _0xaa41=['register','faxAccount:','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x5c77c2,_0x42bf6e){var _0x441ea4=function(_0x56b58b){while(--_0x56b58b){_0x5c77c2['push'](_0x5c77c2['shift']());}};_0x441ea4(++_0x42bf6e);}(_0xaa41,0xe9));var _0x1aa4=function(_0x34f6b0,_0xcca86a){_0x34f6b0=_0x34f6b0-0x0;var _0x420432=_0xaa41[_0x34f6b0];return _0x420432;};'use strict';var FaxAccountEvents=require(_0x1aa4('0x0'));var events=['save',_0x1aa4('0x1'),_0x1aa4('0x2')];function createListener(_0x4def76,_0x2b1eca){return function(_0x2142cd){_0x2b1eca[_0x1aa4('0x3')](_0x4def76,_0x2142cd);};}function removeListener(_0x23dfbf,_0x530a52){return function(){FaxAccountEvents[_0x1aa4('0x4')](_0x23dfbf,_0x530a52);};}exports[_0x1aa4('0x5')]=function(_0x4e138f){for(var _0x5bae38=0x0,_0x449ab9=events['length'];_0x5bae38<_0x449ab9;_0x5bae38++){var _0xf5b872=events[_0x5bae38];var _0x3e5e65=createListener(_0x1aa4('0x6')+_0xf5b872,_0x4e138f);FaxAccountEvents['on'](_0xf5b872,_0x3e5e65);}}; \ No newline at end of file +var _0x4a96=['emit','removeListener','register','length','faxAccount:','save','update'];(function(_0x40ebb6,_0x271df0){var _0x1be41d=function(_0xa82da){while(--_0xa82da){_0x40ebb6['push'](_0x40ebb6['shift']());}};_0x1be41d(++_0x271df0);}(_0x4a96,0x1e1));var _0x64a9=function(_0x260277,_0x638dcf){_0x260277=_0x260277-0x0;var _0x2b190b=_0x4a96[_0x260277];return _0x2b190b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x64a9('0x0'),'remove',_0x64a9('0x1')];function createListener(_0x430bcf,_0x42eb35){return function(_0x64eb72){_0x42eb35[_0x64a9('0x2')](_0x430bcf,_0x64eb72);};}function removeListener(_0x364cf1,_0x5b9454){return function(){FaxAccountEvents[_0x64a9('0x3')](_0x364cf1,_0x5b9454);};}exports[_0x64a9('0x4')]=function(_0x1afba8){for(var _0x4abefa=0x0,_0x4163ac=events[_0x64a9('0x5')];_0x4abefa<_0x4163ac;_0x4abefa++){var _0x5b43d7=events[_0x4abefa];var _0x5c3abf=createListener(_0x64a9('0x6')+_0x5b43d7,_0x1afba8);FaxAccountEvents['on'](_0x5b43d7,_0x5c3abf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index e3c21d2..91d5b30 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(_0x4cf380,_0x1fe075){var _0x3a5948=function(_0x48b31d){while(--_0x48b31d){_0x4cf380['push'](_0x4cf380['shift']());}};_0x3a5948(++_0x1fe075);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x451638,_0x263f62){var _0x35fdeb=function(_0x511708){while(--_0x511708){_0x451638['push'](_0x451638['shift']());}};_0x35fdeb(++_0x263f62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 a5a99d2..dc65969 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 _0x7687=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0xae794a,_0x3fd004){var _0xd36235=function(_0x550933){while(--_0x550933){_0xae794a['push'](_0xae794a['shift']());}};_0xd36235(++_0x3fd004);}(_0x7687,0x1cd));var _0x7768=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x7687[_0x5817e6];return _0x51916a;};'use strict';var Sequelize=require('sequelize');module[_0x7768('0x0')]={'priority':{'type':Sequelize[_0x7768('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7768('0x2')],'allowNull':![],'defaultValue':_0x7768('0x3')},'appdata':{'type':Sequelize[_0x7768('0x4')]()},'description':{'type':Sequelize[_0x7768('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7768('0x5')}}; \ No newline at end of file +var _0x79c1=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x79c1,0x18a));var _0x179c=function(_0x5094e6,_0x4b7d91){_0x5094e6=_0x5094e6-0x0;var _0x421999=_0x79c1[_0x5094e6];return _0x421999;};'use strict';var Sequelize=require(_0x179c('0x0'));module[_0x179c('0x1')]={'priority':{'type':Sequelize[_0x179c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x179c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x179c('0x3')]},'interval':{'type':Sequelize[_0x179c('0x3')],'defaultValue':_0x179c('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9716d85..55cc07d 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 _0x1d51=['lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy','error','stack','index','map','FaxApplication','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x97f17e,_0x5e96b6){var _0x491e17=function(_0x513f66){while(--_0x513f66){_0x97f17e['push'](_0x97f17e['shift']());}};_0x491e17(++_0x5e96b6);}(_0x1d51,0xd3));var _0x11d5=function(_0x4c0ba8,_0xbfd449){_0x4c0ba8=_0x4c0ba8-0x0;var _0x110a9c=_0x1d51[_0x4c0ba8];return _0x110a9c;};'use strict';var emlformat=require(_0x11d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11d5('0x1'));var jsonpatch=require(_0x11d5('0x2'));var rp=require('request-promise');var moment=require(_0x11d5('0x3'));var BPromise=require(_0x11d5('0x4'));var Mustache=require(_0x11d5('0x5'));var util=require('util');var path=require(_0x11d5('0x6'));var sox=require(_0x11d5('0x7'));var csv=require(_0x11d5('0x8'));var ejs=require(_0x11d5('0x9'));var fs=require('fs');var fs_extra=require(_0x11d5('0xa'));var _=require(_0x11d5('0xb'));var squel=require(_0x11d5('0xc'));var crypto=require('crypto');var jsforce=require(_0x11d5('0xd'));var deskjs=require(_0x11d5('0xe'));var toCsv=require(_0x11d5('0x8'));var querystring=require(_0x11d5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11d5('0x10'));var hardwareService=require(_0x11d5('0x11'));var logger=require(_0x11d5('0x12'))('api');var utils=require(_0x11d5('0x13'));var config=require(_0x11d5('0x14'));var licenseUtil=require(_0x11d5('0x15'));var db=require(_0x11d5('0x16'))['db'];function respondWithStatusCode(_0x5d4c6f,_0x2428ed){_0x2428ed=_0x2428ed||0xcc;return function(_0x3c3d88){if(_0x3c3d88){return _0x5d4c6f[_0x11d5('0x17')](_0x2428ed);}return _0x5d4c6f[_0x11d5('0x18')](_0x2428ed)[_0x11d5('0x19')]();};}function respondWithResult(_0x130435,_0x47c4de){_0x47c4de=_0x47c4de||0xc8;return function(_0x28b9ec){if(_0x28b9ec){return _0x130435[_0x11d5('0x18')](_0x47c4de)[_0x11d5('0x1a')](_0x28b9ec);}};}function respondWithFilteredResult(_0x49da8a,_0x570aad){return function(_0x46e413){if(_0x46e413){var _0x12a9d3=typeof _0x570aad[_0x11d5('0x1b')]===_0x11d5('0x1c')&&typeof _0x570aad[_0x11d5('0x1d')]==='undefined';var _0x7cf469=_0x46e413['count'];var _0x397c8d=_0x12a9d3?0x0:_0x570aad['offset'];var _0x400e87=_0x12a9d3?_0x46e413['count']:_0x570aad[_0x11d5('0x1b')]+_0x570aad[_0x11d5('0x1d')];var _0x42dbce;if(_0x400e87>=_0x7cf469){_0x400e87=_0x7cf469;_0x42dbce=0xc8;}else{_0x42dbce=0xce;}_0x49da8a[_0x11d5('0x18')](_0x42dbce);return _0x49da8a['set']('Content-Range',_0x397c8d+'-'+_0x400e87+'/'+_0x7cf469)[_0x11d5('0x1a')](_0x46e413);}return null;};}function patchUpdates(_0x1c106b){return function(_0x59f863){try{jsonpatch[_0x11d5('0x1e')](_0x59f863,_0x1c106b,!![]);}catch(_0x270374){return BPromise[_0x11d5('0x1f')](_0x270374);}return _0x59f863[_0x11d5('0x20')]();};}function saveUpdates(_0x5b659d,_0x15f1ef){return function(_0x481b66){if(_0x481b66){return _0x481b66[_0x11d5('0x21')](_0x5b659d)[_0x11d5('0x22')](function(_0x3c26ff){return _0x3c26ff;});}return null;};}function removeEntity(_0x42d616,_0xb807d3){return function(_0x1e326f){if(_0x1e326f){return _0x1e326f[_0x11d5('0x23')]()[_0x11d5('0x22')](function(){_0x42d616[_0x11d5('0x18')](0xcc)[_0x11d5('0x19')]();});}};}function handleEntityNotFound(_0x147fcf,_0x1bc56a){return function(_0x514979){if(!_0x514979){_0x147fcf[_0x11d5('0x17')](0x194);}return _0x514979;};}function handleError(_0x1795fc,_0x4bc5f5){_0x4bc5f5=_0x4bc5f5||0x1f4;return function(_0x441fc2){logger[_0x11d5('0x24')](_0x441fc2[_0x11d5('0x25')]);if(_0x441fc2['name']){delete _0x441fc2['name'];}_0x1795fc[_0x11d5('0x18')](_0x4bc5f5)['send'](_0x441fc2);};}exports[_0x11d5('0x26')]=function(_0x2fe917,_0x88c3c8){var _0x48d7f5={},_0x26e261={},_0x3c90e1={'count':0x0,'rows':[]};var _0x3cbc15=_[_0x11d5('0x27')](db[_0x11d5('0x28')][_0x11d5('0x29')],function(_0x1cc36e){return{'name':_0x1cc36e[_0x11d5('0x2a')],'type':_0x1cc36e['type']['key']};});_0x26e261[_0x11d5('0x2b')]=_[_0x11d5('0x27')](_0x3cbc15,_0x11d5('0x2c'));_0x26e261[_0x11d5('0x2d')]=_[_0x11d5('0x2e')](_0x2fe917['query']);_0x26e261[_0x11d5('0x2f')]=_[_0x11d5('0x30')](_0x26e261[_0x11d5('0x2b')],_0x26e261[_0x11d5('0x2d')]);_0x48d7f5[_0x11d5('0x31')]=_[_0x11d5('0x30')](_0x26e261['model'],qs[_0x11d5('0x32')](_0x2fe917['query'][_0x11d5('0x32')]));_0x48d7f5['attributes']=_0x48d7f5['attributes'][_0x11d5('0x33')]?_0x48d7f5[_0x11d5('0x31')]:_0x26e261[_0x11d5('0x2b')];if(!_0x2fe917['query'][_0x11d5('0x34')](_0x11d5('0x35'))){_0x48d7f5['limit']=qs['limit'](_0x2fe917[_0x11d5('0x2d')]['limit']);_0x48d7f5['offset']=qs[_0x11d5('0x1b')](_0x2fe917[_0x11d5('0x2d')][_0x11d5('0x1b')]);}_0x48d7f5[_0x11d5('0x36')]=qs[_0x11d5('0x37')](_0x2fe917['query']['sort']);_0x48d7f5[_0x11d5('0x38')]=qs['filters'](_[_0x11d5('0x39')](_0x2fe917['query'],_0x26e261['filters']),_0x3cbc15);if(_0x2fe917[_0x11d5('0x2d')]['filter']){_0x48d7f5[_0x11d5('0x38')]=_[_0x11d5('0x3a')](_0x48d7f5[_0x11d5('0x38')],{'$or':_[_0x11d5('0x27')](_0x3cbc15,function(_0x3b0eef){if(_0x3b0eef[_0x11d5('0x3b')]!==_0x11d5('0x3c')){var _0x267c60={};_0x267c60[_0x3b0eef[_0x11d5('0x2c')]]={'$like':'%'+_0x2fe917[_0x11d5('0x2d')][_0x11d5('0x3d')]+'%'};return _0x267c60;}})});}_0x48d7f5=_['merge']({},_0x48d7f5,_0x2fe917[_0x11d5('0x3e')]);var _0x4f7403={'where':_0x48d7f5['where']};return db[_0x11d5('0x28')][_0x11d5('0x3f')](_0x4f7403)[_0x11d5('0x22')](function(_0x546c0d){_0x3c90e1[_0x11d5('0x3f')]=_0x546c0d;if(_0x2fe917[_0x11d5('0x2d')][_0x11d5('0x40')]){_0x48d7f5[_0x11d5('0x41')]=[{'all':!![]}];}return db[_0x11d5('0x28')][_0x11d5('0x42')](_0x48d7f5);})[_0x11d5('0x22')](function(_0x4a217e){_0x3c90e1[_0x11d5('0x43')]=_0x4a217e;return _0x3c90e1;})['then'](respondWithFilteredResult(_0x88c3c8,_0x48d7f5))['catch'](handleError(_0x88c3c8,null));};exports[_0x11d5('0x44')]=function(_0x5cb0c9,_0x3cc3d1){var _0x2f08c5={'raw':!![],'where':{'id':_0x5cb0c9[_0x11d5('0x45')]['id']}},_0xd7fbcb={};_0xd7fbcb[_0x11d5('0x2b')]=_[_0x11d5('0x2e')](db[_0x11d5('0x28')]['rawAttributes']);_0xd7fbcb['query']=_[_0x11d5('0x2e')](_0x5cb0c9[_0x11d5('0x2d')]);_0xd7fbcb[_0x11d5('0x2f')]=_[_0x11d5('0x30')](_0xd7fbcb[_0x11d5('0x2b')],_0xd7fbcb[_0x11d5('0x2d')]);_0x2f08c5['attributes']=_[_0x11d5('0x30')](_0xd7fbcb[_0x11d5('0x2b')],qs['fields'](_0x5cb0c9[_0x11d5('0x2d')]['fields']));_0x2f08c5['attributes']=_0x2f08c5[_0x11d5('0x31')][_0x11d5('0x33')]?_0x2f08c5[_0x11d5('0x31')]:_0xd7fbcb[_0x11d5('0x2b')];if(_0x5cb0c9[_0x11d5('0x2d')]['includeAll']){_0x2f08c5['include']=[{'all':!![]}];}_0x2f08c5=_[_0x11d5('0x3a')]({},_0x2f08c5,_0x5cb0c9[_0x11d5('0x3e')]);return db['FaxApplication'][_0x11d5('0x46')](_0x2f08c5)[_0x11d5('0x22')](handleEntityNotFound(_0x3cc3d1,null))[_0x11d5('0x22')](respondWithResult(_0x3cc3d1,null))[_0x11d5('0x47')](handleError(_0x3cc3d1,null));};exports[_0x11d5('0x48')]=function(_0x502b1b,_0x3b2a29){return db[_0x11d5('0x28')][_0x11d5('0x48')](_0x502b1b['body'],{})[_0x11d5('0x22')](respondWithResult(_0x3b2a29,0xc9))['catch'](handleError(_0x3b2a29,null));};exports[_0x11d5('0x21')]=function(_0x828740,_0xc225a2){if(_0x828740['body']['id']){delete _0x828740[_0x11d5('0x49')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x828740[_0x11d5('0x45')]['id']}})[_0x11d5('0x22')](handleEntityNotFound(_0xc225a2,null))[_0x11d5('0x22')](saveUpdates(_0x828740[_0x11d5('0x49')],null))[_0x11d5('0x22')](respondWithResult(_0xc225a2,null))['catch'](handleError(_0xc225a2,null));};exports[_0x11d5('0x23')]=function(_0x27d6ff,_0x2c76c4){return db[_0x11d5('0x28')][_0x11d5('0x46')]({'where':{'id':_0x27d6ff[_0x11d5('0x45')]['id']}})[_0x11d5('0x22')](handleEntityNotFound(_0x2c76c4,null))[_0x11d5('0x22')](removeEntity(_0x2c76c4,null))[_0x11d5('0x47')](handleError(_0x2c76c4,null));}; \ No newline at end of file +var _0x92ff=['end','stack','name','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x92ff,0xb9));var _0xf92f=function(_0x4c4b4f,_0x5a9a42){_0x4c4b4f=_0x4c4b4f-0x0;var _0x56fd91=_0x92ff[_0x4c4b4f];return _0x56fd91;};'use strict';var emlformat=require(_0xf92f('0x0'));var rimraf=require(_0xf92f('0x1'));var zipdir=require(_0xf92f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf92f('0x3'));var moment=require(_0xf92f('0x4'));var BPromise=require(_0xf92f('0x5'));var Mustache=require(_0xf92f('0x6'));var util=require(_0xf92f('0x7'));var path=require(_0xf92f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf92f('0x9'));var fs=require('fs');var fs_extra=require(_0xf92f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf92f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf92f('0xc'));var querystring=require(_0xf92f('0xd'));var Papa=require(_0xf92f('0xe'));var Redis=require(_0xf92f('0xf'));var authService=require(_0xf92f('0x10'));var qs=require(_0xf92f('0x11'));var as=require(_0xf92f('0x12'));var hardwareService=require(_0xf92f('0x13'));var logger=require(_0xf92f('0x14'))('api');var utils=require(_0xf92f('0x15'));var config=require(_0xf92f('0x16'));var licenseUtil=require(_0xf92f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27e05e,_0x9b6620){_0x9b6620=_0x9b6620||0xcc;return function(_0x5f4e95){if(_0x5f4e95){return _0x27e05e[_0xf92f('0x18')](_0x9b6620);}return _0x27e05e[_0xf92f('0x19')](_0x9b6620)['end']();};}function respondWithResult(_0x17ed5b,_0x472f49){_0x472f49=_0x472f49||0xc8;return function(_0x23074d){if(_0x23074d){return _0x17ed5b['status'](_0x472f49)[_0xf92f('0x1a')](_0x23074d);}};}function respondWithFilteredResult(_0x3c7f9e,_0xe6cc8c){return function(_0x1bed5a){if(_0x1bed5a){var _0x26a7ca=typeof _0xe6cc8c[_0xf92f('0x1b')]===_0xf92f('0x1c')&&typeof _0xe6cc8c[_0xf92f('0x1d')]===_0xf92f('0x1c');var _0x2e9bf1=_0x1bed5a[_0xf92f('0x1e')];var _0x29ac50=_0x26a7ca?0x0:_0xe6cc8c[_0xf92f('0x1b')];var _0x1c53d0=_0x26a7ca?_0x1bed5a[_0xf92f('0x1e')]:_0xe6cc8c[_0xf92f('0x1b')]+_0xe6cc8c[_0xf92f('0x1d')];var _0x46896f;if(_0x1c53d0>=_0x2e9bf1){_0x1c53d0=_0x2e9bf1;_0x46896f=0xc8;}else{_0x46896f=0xce;}_0x3c7f9e[_0xf92f('0x19')](_0x46896f);return _0x3c7f9e[_0xf92f('0x1f')]('Content-Range',_0x29ac50+'-'+_0x1c53d0+'/'+_0x2e9bf1)['json'](_0x1bed5a);}return null;};}function patchUpdates(_0x4674e6){return function(_0x38bf31){try{jsonpatch[_0xf92f('0x20')](_0x38bf31,_0x4674e6,!![]);}catch(_0x1b9743){return BPromise['reject'](_0x1b9743);}return _0x38bf31[_0xf92f('0x21')]();};}function saveUpdates(_0x1d8052,_0x247ec5){return function(_0x2d2ca7){if(_0x2d2ca7){return _0x2d2ca7[_0xf92f('0x22')](_0x1d8052)['then'](function(_0x371d70){return _0x371d70;});}return null;};}function removeEntity(_0x3a0a10,_0x4d711e){return function(_0x140177){if(_0x140177){return _0x140177[_0xf92f('0x23')]()[_0xf92f('0x24')](function(){_0x3a0a10[_0xf92f('0x19')](0xcc)[_0xf92f('0x25')]();});}};}function handleEntityNotFound(_0x394623,_0x42d954){return function(_0x5a476d){if(!_0x5a476d){_0x394623['sendStatus'](0x194);}return _0x5a476d;};}function handleError(_0x4c3b82,_0x157c37){_0x157c37=_0x157c37||0x1f4;return function(_0x5d6430){logger['error'](_0x5d6430[_0xf92f('0x26')]);if(_0x5d6430[_0xf92f('0x27')]){delete _0x5d6430['name'];}_0x4c3b82['status'](_0x157c37)['send'](_0x5d6430);};}exports['index']=function(_0x467f81,_0x1ce37b){var _0x5308ac={},_0x38b363={},_0x2c8043={'count':0x0,'rows':[]};var _0x28075e=_[_0xf92f('0x28')](db[_0xf92f('0x29')][_0xf92f('0x2a')],function(_0x43e99d){return{'name':_0x43e99d[_0xf92f('0x2b')],'type':_0x43e99d[_0xf92f('0x2c')][_0xf92f('0x2d')]};});_0x38b363['model']=_[_0xf92f('0x28')](_0x28075e,_0xf92f('0x27'));_0x38b363['query']=_[_0xf92f('0x2e')](_0x467f81[_0xf92f('0x2f')]);_0x38b363[_0xf92f('0x30')]=_['intersection'](_0x38b363[_0xf92f('0x31')],_0x38b363['query']);_0x5308ac[_0xf92f('0x32')]=_[_0xf92f('0x33')](_0x38b363[_0xf92f('0x31')],qs[_0xf92f('0x34')](_0x467f81[_0xf92f('0x2f')]['fields']));_0x5308ac[_0xf92f('0x32')]=_0x5308ac[_0xf92f('0x32')][_0xf92f('0x35')]?_0x5308ac['attributes']:_0x38b363[_0xf92f('0x31')];if(!_0x467f81['query'][_0xf92f('0x36')](_0xf92f('0x37'))){_0x5308ac[_0xf92f('0x1d')]=qs[_0xf92f('0x1d')](_0x467f81[_0xf92f('0x2f')][_0xf92f('0x1d')]);_0x5308ac[_0xf92f('0x1b')]=qs[_0xf92f('0x1b')](_0x467f81['query']['offset']);}_0x5308ac[_0xf92f('0x38')]=qs[_0xf92f('0x39')](_0x467f81['query'][_0xf92f('0x39')]);_0x5308ac[_0xf92f('0x3a')]=qs[_0xf92f('0x30')](_[_0xf92f('0x3b')](_0x467f81[_0xf92f('0x2f')],_0x38b363[_0xf92f('0x30')]),_0x28075e);if(_0x467f81[_0xf92f('0x2f')][_0xf92f('0x3c')]){_0x5308ac['where']=_[_0xf92f('0x3d')](_0x5308ac[_0xf92f('0x3a')],{'$or':_['map'](_0x28075e,function(_0x2b4313){if(_0x2b4313[_0xf92f('0x2c')]!==_0xf92f('0x3e')){var _0x432552={};_0x432552[_0x2b4313[_0xf92f('0x27')]]={'$like':'%'+_0x467f81[_0xf92f('0x2f')][_0xf92f('0x3c')]+'%'};return _0x432552;}})});}_0x5308ac=_[_0xf92f('0x3d')]({},_0x5308ac,_0x467f81[_0xf92f('0x3f')]);var _0x1a15b0={'where':_0x5308ac[_0xf92f('0x3a')]};return db[_0xf92f('0x29')][_0xf92f('0x1e')](_0x1a15b0)[_0xf92f('0x24')](function(_0xe4f5d5){_0x2c8043[_0xf92f('0x1e')]=_0xe4f5d5;if(_0x467f81['query'][_0xf92f('0x40')]){_0x5308ac['include']=[{'all':!![]}];}return db[_0xf92f('0x29')][_0xf92f('0x41')](_0x5308ac);})[_0xf92f('0x24')](function(_0x39ee0b){_0x2c8043[_0xf92f('0x42')]=_0x39ee0b;return _0x2c8043;})[_0xf92f('0x24')](respondWithFilteredResult(_0x1ce37b,_0x5308ac))[_0xf92f('0x43')](handleError(_0x1ce37b,null));};exports[_0xf92f('0x44')]=function(_0x287cf1,_0x38484e){var _0x3b88a0={'raw':!![],'where':{'id':_0x287cf1[_0xf92f('0x45')]['id']}},_0x18d395={};_0x18d395['model']=_[_0xf92f('0x2e')](db[_0xf92f('0x29')]['rawAttributes']);_0x18d395['query']=_[_0xf92f('0x2e')](_0x287cf1[_0xf92f('0x2f')]);_0x18d395[_0xf92f('0x30')]=_['intersection'](_0x18d395['model'],_0x18d395[_0xf92f('0x2f')]);_0x3b88a0[_0xf92f('0x32')]=_[_0xf92f('0x33')](_0x18d395['model'],qs[_0xf92f('0x34')](_0x287cf1['query'][_0xf92f('0x34')]));_0x3b88a0[_0xf92f('0x32')]=_0x3b88a0[_0xf92f('0x32')][_0xf92f('0x35')]?_0x3b88a0[_0xf92f('0x32')]:_0x18d395[_0xf92f('0x31')];if(_0x287cf1[_0xf92f('0x2f')]['includeAll']){_0x3b88a0[_0xf92f('0x46')]=[{'all':!![]}];}_0x3b88a0=_[_0xf92f('0x3d')]({},_0x3b88a0,_0x287cf1[_0xf92f('0x3f')]);return db[_0xf92f('0x29')][_0xf92f('0x47')](_0x3b88a0)[_0xf92f('0x24')](handleEntityNotFound(_0x38484e,null))[_0xf92f('0x24')](respondWithResult(_0x38484e,null))['catch'](handleError(_0x38484e,null));};exports[_0xf92f('0x48')]=function(_0x260134,_0x3dc87c){return db[_0xf92f('0x29')]['create'](_0x260134[_0xf92f('0x49')],{})[_0xf92f('0x24')](respondWithResult(_0x3dc87c,0xc9))[_0xf92f('0x43')](handleError(_0x3dc87c,null));};exports[_0xf92f('0x22')]=function(_0x45f55f,_0x2a13a0){if(_0x45f55f['body']['id']){delete _0x45f55f['body']['id'];}return db[_0xf92f('0x29')][_0xf92f('0x47')]({'where':{'id':_0x45f55f[_0xf92f('0x45')]['id']}})[_0xf92f('0x24')](handleEntityNotFound(_0x2a13a0,null))['then'](saveUpdates(_0x45f55f[_0xf92f('0x49')],null))[_0xf92f('0x24')](respondWithResult(_0x2a13a0,null))[_0xf92f('0x43')](handleError(_0x2a13a0,null));};exports[_0xf92f('0x23')]=function(_0x34e0d1,_0x4b4813){return db['FaxApplication'][_0xf92f('0x47')]({'where':{'id':_0x34e0d1['params']['id']}})[_0xf92f('0x24')](handleEntityNotFound(_0x4b4813,null))['then'](removeEntity(_0x4b4813,null))['catch'](handleError(_0x4b4813,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4aef973..13a8ac6 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 _0xd3ec=['rimraf','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x536e46,_0x464403){var _0x4a1b66=function(_0xa86a88){while(--_0xa86a88){_0x536e46['push'](_0x536e46['shift']());}};_0x4a1b66(++_0x464403);}(_0xd3ec,0x132));var _0xcd3e=function(_0x44806c,_0xbe7fda){_0x44806c=_0x44806c-0x0;var _0x52a403=_0xd3ec[_0x44806c];return _0x52a403;};'use strict';var _=require('lodash');var util=require(_0xcd3e('0x0'));var logger=require(_0xcd3e('0x1'))('api');var moment=require(_0xcd3e('0x2'));var BPromise=require(_0xcd3e('0x3'));var rp=require(_0xcd3e('0x4'));var fs=require('fs');var path=require(_0xcd3e('0x5'));var rimraf=require(_0xcd3e('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xcd3e('0x7')]=function(_0xc0e8f3,_0x11fceb){return _0xc0e8f3[_0xcd3e('0x8')](_0xcd3e('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd3e('0xa'),'collate':_0xcd3e('0xb')});}; \ No newline at end of file +var _0xa764=['path','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xa764,0x152));var _0x4a76=function(_0x507cc2,_0x43b1db){_0x507cc2=_0x507cc2-0x0;var _0x5e757b=_0xa764[_0x507cc2];return _0x5e757b;};'use strict';var _=require(_0x4a76('0x0'));var util=require(_0x4a76('0x1'));var logger=require(_0x4a76('0x2'))(_0x4a76('0x3'));var moment=require(_0x4a76('0x4'));var BPromise=require(_0x4a76('0x5'));var rp=require(_0x4a76('0x6'));var fs=require('fs');var path=require(_0x4a76('0x7'));var rimraf=require(_0x4a76('0x8'));var config=require('../../config/environment');var attributes=require(_0x4a76('0x9'));module[_0x4a76('0xa')]=function(_0x21d91a,_0x2d22d8){return _0x21d91a[_0x4a76('0xb')]('FaxApplication',attributes,{'tableName':_0x4a76('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a76('0xd'),'collate':_0x4a76('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0953cb2..e22b366 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 _0xa631=['stringify','error','code','message','UpdateFaxApplication','FaxApplication','update','options','where','attributes','limit','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x458721,_0x1e2edf){var _0x4ba65b=function(_0x3f7504){while(--_0x3f7504){_0x458721['push'](_0x458721['shift']());}};_0x4ba65b(++_0x1e2edf);}(_0xa631,0xe4));var _0x1a63=function(_0x3121b9,_0x565cc3){_0x3121b9=_0x3121b9-0x0;var _0xd9877=_0xa631[_0x3121b9];return _0xd9877;};'use strict';var _=require('lodash');var util=require(_0x1a63('0x0'));var moment=require(_0x1a63('0x1'));var BPromise=require(_0x1a63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a63('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a63('0x4'))(_0x1a63('0x5'));var config=require(_0x1a63('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df65f,_0x2a8dd9,_0xf1cb96){return new BPromise(function(_0xd81213,_0x58f178){return client['request'](_0x5df65f,_0xf1cb96)[_0x1a63('0x7')](function(_0x403dc5){logger[_0x1a63('0x8')](_0x1a63('0x9'),_0x2a8dd9,_0x1a63('0xa'));logger['debug'](_0x1a63('0xb'),_0x2a8dd9,_0x1a63('0xa'),JSON[_0x1a63('0xc')](_0x403dc5));if(_0x403dc5[_0x1a63('0xd')]){if(_0x403dc5['error'][_0x1a63('0xe')]===0x1f4){logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x403dc5['error'][_0x1a63('0xf')]);return _0x58f178(_0x403dc5['error'][_0x1a63('0xf')]);}logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x403dc5['error']['message']);return _0xd81213(_0x403dc5[_0x1a63('0xd')][_0x1a63('0xf')]);}else{logger[_0x1a63('0x8')](_0x1a63('0x9'),_0x2a8dd9,_0x1a63('0xa'));_0xd81213(_0x403dc5['result'][_0x1a63('0xf')]);}})['catch'](function(_0x2711c7){logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x2711c7);_0x58f178(_0x2711c7);});});}exports[_0x1a63('0x10')]=function(_0x52fdd1){var _0x24996e=this;return new Promise(function(_0x365ab8,_0x41c13e){return db[_0x1a63('0x11')][_0x1a63('0x12')](_0x52fdd1['body'],{'raw':_0x52fdd1[_0x1a63('0x13')]?_0x52fdd1[_0x1a63('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52fdd1[_0x1a63('0x13')]?_0x52fdd1[_0x1a63('0x13')][_0x1a63('0x14')]||null:null,'attributes':_0x52fdd1[_0x1a63('0x13')]?_0x52fdd1[_0x1a63('0x13')][_0x1a63('0x15')]||null:null,'limit':_0x52fdd1[_0x1a63('0x13')]?_0x52fdd1['options'][_0x1a63('0x16')]||null:null})['then'](function(_0x218c66){logger[_0x1a63('0x8')]('UpdateFaxApplication',_0x52fdd1);logger['debug'](_0x1a63('0x10'),_0x52fdd1,JSON[_0x1a63('0xc')](_0x218c66));_0x365ab8(_0x218c66);})[_0x1a63('0x17')](function(_0x1827ff){logger[_0x1a63('0xd')]('UpdateFaxApplication',_0x1827ff[_0x1a63('0xf')],_0x52fdd1);_0x41c13e(_0x24996e[_0x1a63('0xd')](0x1f4,_0x1827ff[_0x1a63('0xf')]));});});}; \ No newline at end of file +var _0xa01c=['FaxApplication','update','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xa01c,0x14b));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xca01('0x0'));var util=require(_0xca01('0x1'));var moment=require(_0xca01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca01('0x3'));var db=require(_0xca01('0x4'))['db'];var utils=require(_0xca01('0x5'));var logger=require(_0xca01('0x6'))('rpc');var config=require(_0xca01('0x7'));var jayson=require(_0xca01('0x8'));var client=jayson[_0xca01('0x9')][_0xca01('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x551eb0,_0x138843,_0x5a42c5){return new BPromise(function(_0x50774c,_0x1776f7){return client[_0xca01('0xb')](_0x551eb0,_0x5a42c5)['then'](function(_0x4dbd54){logger[_0xca01('0xc')]('FaxApplication,\x20%s,\x20%s',_0x138843,_0xca01('0xd'));logger['debug'](_0xca01('0xe'),_0x138843,_0xca01('0xd'),JSON[_0xca01('0xf')](_0x4dbd54));if(_0x4dbd54[_0xca01('0x10')]){if(_0x4dbd54[_0xca01('0x10')]['code']===0x1f4){logger['error'](_0xca01('0x11'),_0x138843,_0x4dbd54['error'][_0xca01('0x12')]);return _0x1776f7(_0x4dbd54[_0xca01('0x10')][_0xca01('0x12')]);}logger[_0xca01('0x10')](_0xca01('0x11'),_0x138843,_0x4dbd54[_0xca01('0x10')]['message']);return _0x50774c(_0x4dbd54[_0xca01('0x10')][_0xca01('0x12')]);}else{logger[_0xca01('0xc')](_0xca01('0x11'),_0x138843,_0xca01('0xd'));_0x50774c(_0x4dbd54[_0xca01('0x13')][_0xca01('0x12')]);}})[_0xca01('0x14')](function(_0x2a8b92){logger['error'](_0xca01('0x11'),_0x138843,_0x2a8b92);_0x1776f7(_0x2a8b92);});});}exports['UpdateFaxApplication']=function(_0x372697){var _0x2416ee=this;return new Promise(function(_0x8e4fcb,_0x2365bc){return db[_0xca01('0x15')][_0xca01('0x16')](_0x372697[_0xca01('0x17')],{'raw':_0x372697['options']?_0x372697[_0xca01('0x18')][_0xca01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x372697[_0xca01('0x18')]?_0x372697[_0xca01('0x18')][_0xca01('0x1a')]||null:null,'attributes':_0x372697[_0xca01('0x18')]?_0x372697[_0xca01('0x18')][_0xca01('0x1b')]||null:null,'limit':_0x372697[_0xca01('0x18')]?_0x372697['options'][_0xca01('0x1c')]||null:null})[_0xca01('0x1d')](function(_0x59342b){logger['info'](_0xca01('0x1e'),_0x372697);logger[_0xca01('0x1f')](_0xca01('0x1e'),_0x372697,JSON[_0xca01('0xf')](_0x59342b));_0x8e4fcb(_0x59342b);})[_0xca01('0x14')](function(_0x258bd1){logger[_0xca01('0x10')](_0xca01('0x1e'),_0x258bd1['message'],_0x372697);_0x2365bc(_0x2416ee[_0xca01('0x10')](0x1f4,_0x258bd1[_0xca01('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4417873..0aaceed 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 _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x2cb8e9,_0x1baa87){var _0x121a74=function(_0x300f91){while(--_0x300f91){_0x2cb8e9['push'](_0x2cb8e9['shift']());}};_0x121a74(++_0x1baa87);}(_0x7708,0x188));var _0x8770=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x7708[_0x3818c0];return _0x55ec33;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router; \ No newline at end of file +var _0x9348=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','show','post','delete','/:id','destroy','exports','multer'];(function(_0x2d9e51,_0x45f4ea){var _0x256a82=function(_0x150a42){while(--_0x150a42){_0x2d9e51['push'](_0x2d9e51['shift']());}};_0x256a82(++_0x45f4ea);}(_0x9348,0x10d));var _0x8934=function(_0x36ac6a,_0x1195e1){_0x36ac6a=_0x36ac6a-0x0;var _0x1f992b=_0x9348[_0x36ac6a];return _0x1f992b;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x8934('0xa')](),controller['update']);router[_0x8934('0xe')](_0x8934('0xf'),auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);module[_0x8934('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 655c264..0291548 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 _0x7919=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x10d9e6,_0x4d35d8){var _0x3447c2=function(_0x35a8da){while(--_0x35a8da){_0x10d9e6['push'](_0x10d9e6['shift']());}};_0x3447c2(++_0x4d35d8);}(_0x7919,0x75));var _0x9791=function(_0x939ae7,_0xfcb301){_0x939ae7=_0x939ae7-0x0;var _0x39ab52=_0x7919[_0x939ae7];return _0x39ab52;};'use strict';var Sequelize=require(_0x9791('0x0'));module[_0x9791('0x1')]={'closed':{'type':Sequelize[_0x9791('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9791('0x3')]},'secondDisposition':{'type':Sequelize[_0x9791('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9791('0x3')]},'note':{'type':Sequelize[_0x9791('0x3')]},'read1stAt':{'type':Sequelize[_0x9791('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x9791('0x5')]('in',_0x9791('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9791('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9791('0x5')]('in',_0x9791('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0f36=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x1a4f00,_0x2b290f){var _0x40aa5a=function(_0x3c82af){while(--_0x3c82af){_0x1a4f00['push'](_0x1a4f00['shift']());}};_0x40aa5a(++_0x2b290f);}(_0x0f36,0x1cb));var _0x60f3=function(_0x40e8e7,_0x5892a0){_0x40e8e7=_0x40e8e7-0x0;var _0x3adfe4=_0x0f36[_0x40e8e7];return _0x3adfe4;};'use strict';var Sequelize=require(_0x60f3('0x0'));module['exports']={'closed':{'type':Sequelize[_0x60f3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60f3('0x2')]},'disposition':{'type':Sequelize[_0x60f3('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x60f3('0x3')]},'note':{'type':Sequelize[_0x60f3('0x3')]},'read1stAt':{'type':Sequelize[_0x60f3('0x2')]},'fax':{'type':Sequelize[_0x60f3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x60f3('0x4')]('in',_0x60f3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x60f3('0x5')),'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 05be43e..13c353b 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 _0x6268=['Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','show','includeAll','include','create','params','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','root','server','join','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','closed','UserId','total','index','map','FaxInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','field','from','tools_tags','select','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','start','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.fax'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x6268,0x1ea));var _0x8626=function(_0x4751a8,_0x1af0f8){_0x4751a8=_0x4751a8-0x0;var _0x133e31=_0x6268[_0x4751a8];return _0x133e31;};'use strict';var emlformat=require(_0x8626('0x0'));var rimraf=require(_0x8626('0x1'));var zipdir=require(_0x8626('0x2'));var jsonpatch=require(_0x8626('0x3'));var rp=require(_0x8626('0x4'));var moment=require(_0x8626('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8626('0x6'));var util=require(_0x8626('0x7'));var path=require(_0x8626('0x8'));var sox=require(_0x8626('0x9'));var csv=require(_0x8626('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8626('0xb'));var _=require('lodash');var squel=require(_0x8626('0xc'));var crypto=require(_0x8626('0xd'));var jsforce=require(_0x8626('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8626('0xa'));var querystring=require('querystring');var Papa=require(_0x8626('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8626('0x10'));var as=require(_0x8626('0x11'));var hardwareService=require(_0x8626('0x12'));var logger=require(_0x8626('0x13'))('api');var utils=require(_0x8626('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8626('0x15'));var db=require(_0x8626('0x16'))['db'];config[_0x8626('0x17')]=_['defaults'](config[_0x8626('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8626('0x18'))(new Redis(config[_0x8626('0x17')]));require('./faxInteraction.socket')[_0x8626('0x19')](socket);function respondWithStatusCode(_0x495363,_0x1b3a2f){_0x1b3a2f=_0x1b3a2f||0xcc;return function(_0x28801d){if(_0x28801d){return _0x495363[_0x8626('0x1a')](_0x1b3a2f);}return _0x495363[_0x8626('0x1b')](_0x1b3a2f)[_0x8626('0x1c')]();};}function respondWithResult(_0x4061c5,_0x156cd0){_0x156cd0=_0x156cd0||0xc8;return function(_0x4ec9ad){if(_0x4ec9ad){return _0x4061c5[_0x8626('0x1b')](_0x156cd0)[_0x8626('0x1d')](_0x4ec9ad);}};}function respondWithFilteredResult(_0x1decd6,_0x461e36){return function(_0x3dca80){if(_0x3dca80){var _0x1e338d=typeof _0x461e36[_0x8626('0x1e')]===_0x8626('0x1f')&&typeof _0x461e36[_0x8626('0x20')]===_0x8626('0x1f');var _0xf36c3=_0x3dca80[_0x8626('0x21')];var _0x282b5f=_0x1e338d?0x0:_0x461e36['offset'];var _0x263c8b=_0x1e338d?_0x3dca80[_0x8626('0x21')]:_0x461e36[_0x8626('0x1e')]+_0x461e36[_0x8626('0x20')];var _0x1df1ad;if(_0x263c8b>=_0xf36c3){_0x263c8b=_0xf36c3;_0x1df1ad=0xc8;}else{_0x1df1ad=0xce;}_0x1decd6['status'](_0x1df1ad);return _0x1decd6[_0x8626('0x22')](_0x8626('0x23'),_0x282b5f+'-'+_0x263c8b+'/'+_0xf36c3)[_0x8626('0x1d')](_0x3dca80);}return null;};}function patchUpdates(_0x2333fc){return function(_0x374833){try{jsonpatch[_0x8626('0x24')](_0x374833,_0x2333fc,!![]);}catch(_0x59e84a){return BPromise['reject'](_0x59e84a);}return _0x374833[_0x8626('0x25')]();};}function saveUpdates(_0x4de624,_0x465001){return function(_0x161086){if(_0x161086){return _0x161086[_0x8626('0x26')](_0x4de624)[_0x8626('0x27')](function(_0x5df8d1){return _0x5df8d1;});}return null;};}function removeEntity(_0x42c22f,_0x2ac3ea){return function(_0x290fec){if(_0x290fec){return _0x290fec[_0x8626('0x28')]()[_0x8626('0x27')](function(){_0x42c22f[_0x8626('0x1b')](0xcc)[_0x8626('0x1c')]();});}};}function handleEntityNotFound(_0x2d4d11,_0x203389){return function(_0x33387e){if(!_0x33387e){_0x2d4d11[_0x8626('0x1a')](0x194);}return _0x33387e;};}function handleError(_0x26d96a,_0x27dbf7){_0x27dbf7=_0x27dbf7||0x1f4;return function(_0x4e60fd){logger['error'](_0x4e60fd[_0x8626('0x29')]);if(_0x4e60fd[_0x8626('0x2a')]){delete _0x4e60fd['name'];}_0x26d96a['status'](_0x27dbf7)[_0x8626('0x2b')](_0x4e60fd);};}function getInteractionUsers(_0x39648e,_0x5968fb){return new BPromise(function(_0x2f159a,_0x232f11){try{if(_0x5968fb[_0x39648e['id']]){_0x39648e[_0x8626('0x2c')]=_['map'](_0x5968fb[_0x39648e['id']],function(_0x4d28a1){return{'id':_0x4d28a1['id'],'fullname':_0x4d28a1[_0x8626('0x2d')]};});}}catch(_0x5d925c){_0x232f11(_0x5d925c);}_0x2f159a(_0x39648e);});}function getInteractionTags(_0x30b5bb,_0x25a160){return new BPromise(function(_0x2a6155,_0x115e8b){try{if(_0x30b5bb[_0x8626('0x2e')]){_0x30b5bb['Tags']=[];_0x30b5bb[_0x8626('0x2e')][_0x8626('0x2f')](',')[_0x8626('0x30')](function(_0x1f6925){_0x30b5bb[_0x8626('0x31')][_0x8626('0x32')](_0x25a160[_0x1f6925]);});}delete _0x30b5bb['TagIds'];}catch(_0x418257){_0x115e8b(_0x418257);}_0x2a6155(_0x30b5bb);});}function updateFaxInteraction(_0x5940c6,_0x1d1c60,_0x1b54bb){return new BPromise(function(_0x4e01d4,_0x255f4c){return getInteractionUsers(_0x5940c6,_0x1b54bb)[_0x8626('0x27')](function(_0x54f7d5){return getInteractionTags(_0x54f7d5,_0x1d1c60);})[_0x8626('0x27')](function(_0x349c4a){return getStateInteraction(_0x349c4a);})['then'](function(_0x1bf9e){_0x4e01d4(_0x1bf9e);})['catch'](function(_0x21db3e){_0x255f4c(_0x21db3e);});});}function getStateInteraction(_0x4403a5){return new BPromise(function(_0x7bed60){_0x4403a5[_0x8626('0x33')]=0x0;_0x4403a5[_0x8626('0x34')]=0x0;_0x4403a5[_0x8626('0x35')]=0x0;_0x4403a5[_0x8626('0x36')]=0x0;_0x4403a5['total']=0x0;if(!_0x4403a5[_0x8626('0x37')]&&!_0x4403a5[_0x8626('0x38')]){_0x4403a5[_0x8626('0x33')]+=0x1;}if(!_0x4403a5[_0x8626('0x37')]&&_0x4403a5[_0x8626('0x38')]){_0x4403a5[_0x8626('0x34')]+=0x1;if(_0x4403a5[_0x8626('0x33')]){_0x4403a5[_0x8626('0x33')]-=0x1;}}if(_0x4403a5[_0x8626('0x37')]&&_0x4403a5[_0x8626('0x38')]){_0x4403a5[_0x8626('0x35')]+=0x1;if(_0x4403a5[_0x8626('0x34')]){_0x4403a5['talking']-=0x1;}}if(_0x4403a5[_0x8626('0x37')]&&!_0x4403a5[_0x8626('0x38')]){_0x4403a5[_0x8626('0x36')]+=0x1;if(_0x4403a5[_0x8626('0x33')]){_0x4403a5[_0x8626('0x33')]-=0x1;}}_0x4403a5[_0x8626('0x39')]+=0x1;_0x7bed60(_0x4403a5);});}exports[_0x8626('0x3a')]=function(_0x4f51cf,_0x58c2e8){var _0x27c4ff={},_0x2b2331={},_0x5b2e52={'count':0x0,'rows':[]};var _0x38e991=_[_0x8626('0x3b')](db[_0x8626('0x3c')]['rawAttributes'],function(_0x6224a2){return{'name':_0x6224a2['fieldName'],'type':_0x6224a2[_0x8626('0x3d')][_0x8626('0x3e')]};});_0x2b2331[_0x8626('0x3f')]=_[_0x8626('0x3b')](_0x38e991,'name');_0x2b2331[_0x8626('0x40')]=_[_0x8626('0x41')](_0x4f51cf[_0x8626('0x40')]);_0x2b2331[_0x8626('0x42')]=_[_0x8626('0x43')](_0x2b2331[_0x8626('0x3f')],_0x2b2331[_0x8626('0x40')]);_0x27c4ff[_0x8626('0x44')]=_[_0x8626('0x43')](_0x2b2331[_0x8626('0x3f')],qs[_0x8626('0x45')](_0x4f51cf[_0x8626('0x40')]['fields']));_0x27c4ff[_0x8626('0x44')]=_0x27c4ff[_0x8626('0x44')][_0x8626('0x46')]?_0x27c4ff['attributes']:_0x2b2331[_0x8626('0x3f')];if(!_0x4f51cf[_0x8626('0x40')]['hasOwnProperty']('nolimit')){_0x27c4ff[_0x8626('0x20')]=qs['limit'](_0x4f51cf[_0x8626('0x40')][_0x8626('0x20')]);_0x27c4ff['offset']=qs[_0x8626('0x1e')](_0x4f51cf[_0x8626('0x40')][_0x8626('0x1e')]);}_0x27c4ff[_0x8626('0x47')]=qs[_0x8626('0x48')](_0x4f51cf[_0x8626('0x40')][_0x8626('0x48')]);_0x27c4ff[_0x8626('0x49')]=qs[_0x8626('0x42')](_[_0x8626('0x4a')](_0x4f51cf[_0x8626('0x40')],_0x2b2331[_0x8626('0x42')]),_0x38e991);var _0xfee146=[];var _0x489ebd=squel['select']()[_0x8626('0x4b')]('id')[_0x8626('0x4b')]('name')[_0x8626('0x4b')]('color')[_0x8626('0x4c')](_0x8626('0x4d'));var _0x539683=squel[_0x8626('0x4e')]()['field']('u.id')[_0x8626('0x4b')]('u.fullname')[_0x8626('0x4b')](_0x8626('0x4f'))[_0x8626('0x4c')](_0x8626('0x50'),'ui')['left_join'](_0x8626('0x51'),'u',_0x8626('0x52'));var _0x3326ac=squel[_0x8626('0x4e')]()[_0x8626('0x4c')](_0x8626('0x53'),'i')['left_join'](_0x8626('0x54'),'c',_0x8626('0x55'))[_0x8626('0x56')]('users','o',_0x8626('0x57'))['left_join'](_0x8626('0x58'),'a',_0x8626('0x59'))[_0x8626('0x56')](_0x8626('0x5a'),'me',_0x8626('0x5b'))[_0x8626('0x56')](_0x8626('0x5c'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x8626('0x56')](_0x8626('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x26992e=squel[_0x8626('0x5d')]();var _0x1a5185=[];var _0x2f9086=squel[_0x8626('0x5d')]();var _0x14f796;if(_0x4f51cf[_0x8626('0x40')][_0x8626('0x5e')]){_0x14f796=as[_0x8626('0x5f')](_0x4f51cf[_0x8626('0x40')][_0x8626('0x5e')]);var _0xe7ae3c=_0x14f796[_0x8626('0x60')];for(var _0x53bf39=0x0;_0x53bf39<_0x14f796['conditions'][_0x8626('0x46')];_0x53bf39++){var _0x5815a7=_0x14f796[_0x8626('0x61')][_0x53bf39];var _0x33a35f='i';var _0x5dc176=_['find'](_0x38e991,[_0x8626('0x2a'),_0x5815a7[_0x8626('0x4b')]]);if(!_0x5dc176){switch(_0x5815a7[_0x8626('0x4b')]){case _0x8626('0x62'):if(_0x5815a7[_0x8626('0x63')]==0x1){_0x3326ac[_0x8626('0x64')]('`'+_0x5815a7[_0x8626('0x4b')]+_0x8626('0x65'));}else{_0x3326ac[_0x8626('0x64')]('`'+_0x5815a7[_0x8626('0x4b')]+_0x8626('0x66'));}break;case'Contact':if(_0x5815a7[_0x8626('0x67')]==='$substring'){if(_0x5815a7['value'][_0x8626('0x2f')]('\x20')[_0x8626('0x46')]>0x1){_0x26992e[_0xe7ae3c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5815a7[_0x8626('0x63')]),null);}else{var _0x5e0dcf='%'+_0x5815a7[_0x8626('0x63')]+'%';_0x26992e[_0xe7ae3c](_0x8626('0x68'),_0x5e0dcf,_0x5e0dcf,_0x5e0dcf);}}else{_0x5dc176=_[_0x8626('0x69')](_0x38e991,[_0x8626('0x2a'),_0x8626('0x6a')]);_0x5815a7[_0x8626('0x4b')]=_0x8626('0x6a');_0x39fd4d=as[_0x8626('0x6b')](_0x33a35f,_0x5dc176['type'],_0x5815a7);_0x26992e[_0xe7ae3c](_0x39fd4d['text'],_0x39fd4d[_0x8626('0x63')]['start'],_0x39fd4d[_0x8626('0x63')][_0x8626('0x1c')]);}break;case _0x8626('0x6c'):var _0xaf6958=_0x5815a7['value'][_0x8626('0x2f')](',')[_0x8626('0x3b')](function(_0x197532){return Number(_0x197532);});_0xaf6958[_0x8626('0x30')](function(_0x51bda7){_0x2f9086['or'](_0x8626('0x6d'),'%,'+_0x51bda7+',%');});_0x1a5185=_[_0x8626('0x6e')](_0x1a5185,_0xaf6958);break;case _0x8626('0x6f'):if(_0x5815a7[_0x8626('0x67')]===_0x8626('0x70')){_0x26992e[_0xe7ae3c](_0x8626('0x71'),'%'+_0x5815a7[_0x8626('0x63')]+'%',null);}else{_0x5dc176=_['find'](_0x38e991,[_0x8626('0x2a'),_0x8626('0x38')]);_0x5815a7['field']=_0x8626('0x38');_0x39fd4d=as['buildExpression'](_0x33a35f,_0x5dc176[_0x8626('0x3d')],_0x5815a7);_0x26992e[_0xe7ae3c](_0x39fd4d['text'],_0x39fd4d[_0x8626('0x63')]['start'],_0x39fd4d[_0x8626('0x63')][_0x8626('0x1c')]);}break;case _0x8626('0x72'):_0x39fd4d=as['buildExpression']('me',null,_0x5815a7);_0x26992e[_0xe7ae3c](_0x39fd4d[_0x8626('0x73')],_0x39fd4d[_0x8626('0x63')]['start'],_0x39fd4d[_0x8626('0x63')][_0x8626('0x1c')]);break;}}else{var _0x39fd4d=as['buildExpression'](_0x33a35f,_0x5dc176['type'],_0x5815a7);_0x26992e[_0xe7ae3c](_0x39fd4d['text'],_0x39fd4d[_0x8626('0x63')][_0x8626('0x74')],_0x39fd4d[_0x8626('0x63')][_0x8626('0x1c')]);}}}else{var _0x3b885e=_(_0x4f51cf[_0x8626('0x40')])[_0x8626('0x41')]()[_0x8626('0x3b')](function(_0x33994a){return _[_0x8626('0x75')](_0x38e991,[_0x8626('0x2a'),_0x33994a])?_0x33994a:undefined;})[_0x8626('0x76')]()['value']();if(!_[_0x8626('0x77')](_0x3b885e)){_0x3b885e[_0x8626('0x30')](function(_0x38f220){if(_0x38f220===_0x8626('0x78')){_0x3326ac['where'](_0x8626('0x79'),[][_0x8626('0x7a')](_0x4f51cf[_0x8626('0x40')][_0x38f220]));}else if(_0x38f220===_0x8626('0x7b')){var _0x34f497=JSON[_0x8626('0x7c')](_0x4f51cf[_0x8626('0x40')][_0x38f220])[_0x8626('0x7d')];var _0x57ed4f=JSON['parse'](_0x4f51cf[_0x8626('0x40')][_0x38f220])[_0x8626('0x7e')];_0x3326ac[_0x8626('0x49')](_0x8626('0x7f'),_0x34f497,_0x57ed4f);}else{if(_0x4f51cf['query'][_0x38f220]===_0x8626('0x80')){_0x3326ac[_0x8626('0x49')]('i.'+_0x38f220+_0x8626('0x81'));}else{_0x3326ac[_0x8626('0x49')]('i.'+_0x38f220+_0x8626('0x82'),_0x4f51cf[_0x8626('0x40')][_0x38f220]);}}});}if(_0x4f51cf['query'][_0x8626('0x83')]){if(_0x4f51cf[_0x8626('0x40')][_0x8626('0x83')]==0x1){_0x3326ac[_0x8626('0x64')]('`unreadMessages`\x20=\x200');}else{_0x3326ac['having'](_0x8626('0x84'));}}if(_0x4f51cf[_0x8626('0x40')][_0x8626('0x85')]){_0x1a5185=_[_0x8626('0x86')](_0x4f51cf[_0x8626('0x40')][_0x8626('0x85')])?_0x4f51cf[_0x8626('0x40')][_0x8626('0x85')]:new Array(_0x4f51cf[_0x8626('0x40')][_0x8626('0x85')]);_0x1a5185[_0x8626('0x30')](function(_0x11bdcd){_0x2f9086['or'](_0x8626('0x6d'),'%,'+_0x11bdcd+',%');});}if(_0x4f51cf['query'][_0x8626('0x87')]){var _0x3cef0c=_0x4f51cf['query'][_0x8626('0x87')][_0x8626('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3cef0c)){_0x26992e['or'](_0x8626('0x89'),_0x3cef0c+'%')['or'](_0x8626('0x8a'),_0x3cef0c+'%');}_0x26992e['or'](_0x8626('0x8b'),_0x3cef0c+'%');}}_0x3326ac[_0x8626('0x49')](_0x26992e);_0x3326ac[_0x8626('0x8c')](_0x8626('0x8d'));var _0x5a4a41={'type':db['Sequelize'][_0x8626('0x8e')][_0x8626('0x8f')],'raw':!![]};var _0x9790b1=_0x3326ac[_0x8626('0x90')]();_0x9790b1[_0x8626('0x4b')]('i.id');_0x9790b1['field'](_0x8626('0x91'),_0x8626('0x62'));if(_0x27c4ff[_0x8626('0x47')]){_0x27c4ff['order'][_0x8626('0x30')](function(_0x1de586){var _0x31fdad=_0x1de586[0x0]===_0x8626('0x92')?_0x1de586[0x0]:'i.'+_0x1de586[0x0];_0x3326ac[_0x8626('0x47')](_0x31fdad,_0x1de586[0x1]===_0x8626('0x93')?![]:!![]);});}if(!_[_0x8626('0x77')](_0x1a5185)){_0x3326ac[_0x8626('0x64')](_0x2f9086);_0x9790b1[_0x8626('0x49')](_0x8626('0x94'),_0x1a5185);}BPromise[_0x8626('0x95')]()[_0x8626('0x27')](function(){if(!_0x14f796){if(_0x4f51cf['query'][_0x8626('0x78')])return;_0x9790b1['where'](_0x8626('0x96'));_0x3326ac['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4f51cf['user']['role']!=='agent')return;return _0x4f51cf[_0x8626('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x10f3b2){if(_[_0x8626('0x77')](_0x10f3b2)){_0x9790b1[_0x8626('0x49')](_0x8626('0x98'));_0x3326ac[_0x8626('0x49')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x9790b1['where'](_0x8626('0x79'),_[_0x8626('0x3b')](_0x10f3b2,'id'));_0x3326ac[_0x8626('0x49')]('i.FaxAccountId\x20IN\x20?',_[_0x8626('0x3b')](_0x10f3b2,'id'));}});})['then'](function(){if(_0x4f51cf[_0x8626('0x97')][_0x8626('0x99')]===_0x8626('0x9a')&&!_0x14f796&&!_0x4f51cf['query']['FaxAccountId'])return[];return db['sequelize'][_0x8626('0x40')](_0x9790b1['toString'](),_0x5a4a41);})[_0x8626('0x27')](function(_0x3423b0){_0x5b2e52[_0x8626('0x21')]=_0x3423b0[_0x8626('0x46')];if(_0x5b2e52[_0x8626('0x21')]===0x0)return[];return db[_0x8626('0x9b')][_0x8626('0x40')](_0x489ebd[_0x8626('0x9c')](),_0x5a4a41)['then'](function(_0x1e10c4){_0xfee146=_[_0x8626('0x9d')](_0x1e10c4,'id');_0x5a4a41=_[_0x8626('0x9e')](_0x5a4a41,{'model':db[_0x8626('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f51cf[_0x8626('0x40')]['fields']){_0x27c4ff['attributes'][_0x8626('0x30')](function(_0x813223){_0x3326ac['field']('i.'+_0x813223);});}else{_0x3326ac[_0x8626('0x4b')](_0x8626('0x91'),_0x8626('0x62'));_0x3326ac[_0x8626('0x4b')](_0x8626('0x9f'),_0x8626('0xa0'));_0x3326ac[_0x8626('0x4b')]('a.mandatoryDisposition',_0x8626('0xa1'));_0x3326ac['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',_0x8626('0x92'));_0x3326ac[_0x8626('0x4b')](_0x8626('0xa2'));_0x3326ac['field'](_0x8626('0xa3'),_0x8626('0xa4'));_0x3326ac[_0x8626('0x4b')](_0x8626('0xa5'),_0x8626('0xa6'));_0x3326ac[_0x8626('0x4b')](_0x8626('0xa7'),_0x8626('0xa8'));_0x3326ac[_0x8626('0x4b')]('c.phone','Contact.phone');_0x3326ac[_0x8626('0x4b')]('c.mobile','Contact.mobile');_0x3326ac[_0x8626('0x4b')](_0x8626('0xa9'),_0x8626('0xaa'));_0x3326ac[_0x8626('0x4b')](_0x8626('0xab'),_0x8626('0xac'));_0x3326ac[_0x8626('0x4b')](_0x8626('0xad'),_0x8626('0xae'));_0x3326ac['field'](_0x8626('0xaf'),'TagIds');}if(_0x27c4ff['limit'])_0x3326ac['limit'](_0x27c4ff[_0x8626('0x20')]);if(_0x27c4ff[_0x8626('0x1e')])_0x3326ac[_0x8626('0x1e')](_0x27c4ff[_0x8626('0x1e')]);return db[_0x8626('0x9b')][_0x8626('0x40')](_0x3326ac[_0x8626('0x9c')](),_0x5a4a41);})[_0x8626('0x27')](function(_0x4ea1c3){if(_0x4ea1c3[_0x8626('0x46')]>0x0)_0x539683[_0x8626('0x49')](_0x8626('0xb0'),_[_0x8626('0x3b')](_0x4ea1c3,'id'));return db[_0x8626('0x9b')][_0x8626('0x40')](_0x539683[_0x8626('0x9c')](),_0x5a4a41)['then'](function(_0x2f8ff9){var _0xf844ba=_[_0x8626('0xb1')](_0x2f8ff9,_0x8626('0xb2'));var _0x20547f=[];_0x4ea1c3[_0x8626('0x30')](function(_0x3f8330){_0x20547f[_0x8626('0x32')](updateFaxInteraction(_0x3f8330,_0xfee146,_0xf844ba));});return BPromise[_0x8626('0xb3')](_0x20547f);});});})[_0x8626('0x27')](function(_0x4aa3e5){_0x5b2e52[_0x8626('0xb4')]=_0x4aa3e5;return _0x5b2e52;})[_0x8626('0x27')](respondWithFilteredResult(_0x58c2e8,_0x27c4ff))[_0x8626('0xb5')](handleError(_0x58c2e8,null));};exports[_0x8626('0xb6')]=function(_0x283eba,_0x1bb8d5){var _0xc2684a={'raw':![],'where':{'id':_0x283eba['params']['id']}},_0x268e0d={};_0x268e0d[_0x8626('0x3f')]=_[_0x8626('0x41')](db['FaxInteraction']['rawAttributes']);_0x268e0d[_0x8626('0x40')]=_['keys'](_0x283eba[_0x8626('0x40')]);_0x268e0d[_0x8626('0x42')]=_[_0x8626('0x43')](_0x268e0d['model'],_0x268e0d[_0x8626('0x40')]);_0xc2684a[_0x8626('0x44')]=_[_0x8626('0x43')](_0x268e0d[_0x8626('0x3f')],qs['fields'](_0x283eba[_0x8626('0x40')]['fields']));_0xc2684a[_0x8626('0x44')]=_0xc2684a[_0x8626('0x44')][_0x8626('0x46')]?_0xc2684a[_0x8626('0x44')]:_0x268e0d[_0x8626('0x3f')];if(_0x283eba['query'][_0x8626('0xb7')]){_0xc2684a[_0x8626('0xb8')]=[{'all':!![]}];}_0xc2684a=_[_0x8626('0x9e')]({},_0xc2684a,_0x283eba['options']);return db['FaxInteraction'][_0x8626('0x69')](_0xc2684a)[_0x8626('0x27')](handleEntityNotFound(_0x1bb8d5,null))[_0x8626('0x27')](respondWithResult(_0x1bb8d5,null))[_0x8626('0xb5')](handleError(_0x1bb8d5,null));};exports['create']=function(_0x46055b,_0x3d9374){return db[_0x8626('0x3c')][_0x8626('0xb9')](_0x46055b['body'],{})[_0x8626('0x27')](respondWithResult(_0x3d9374,0xc9))['catch'](handleError(_0x3d9374,null));};exports[_0x8626('0x26')]=function(_0x1bc5b9,_0x4a5ad9){if(_0x1bc5b9[_0x8626('0x72')]['id']){delete _0x1bc5b9['body']['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x1bc5b9[_0x8626('0xba')]['id']}})['then'](handleEntityNotFound(_0x4a5ad9,null))[_0x8626('0x27')](saveUpdates(_0x1bc5b9[_0x8626('0x72')],null))[_0x8626('0x27')](respondWithResult(_0x4a5ad9,null))[_0x8626('0xb5')](handleError(_0x4a5ad9,null));};exports['destroy']=function(_0x14f8e4,_0x482c7d){return db['FaxInteraction'][_0x8626('0x69')]({'where':{'id':_0x14f8e4[_0x8626('0xba')]['id']}})[_0x8626('0x27')](handleEntityNotFound(_0x482c7d,null))[_0x8626('0x27')](removeEntity(_0x482c7d,null))[_0x8626('0xb5')](handleError(_0x482c7d,null));};exports[_0x8626('0xbb')]=function(_0x213ae3,_0xd78101){return db[_0x8626('0x3c')][_0x8626('0xbb')]()[_0x8626('0x27')](respondWithResult(_0xd78101,null))[_0x8626('0xb5')](handleError(_0xd78101,null));};exports[_0x8626('0xbc')]=function(_0x54484a,_0x402e43,_0x118c56){return db[_0x8626('0xbd')][_0x8626('0x69')]({'where':{'id':_0x54484a[_0x8626('0xba')]['id']}})[_0x8626('0x27')](handleEntityNotFound(_0x402e43,null))[_0x8626('0x27')](function(_0x432bbb){if(_0x432bbb){return _0x432bbb[_0x8626('0xbc')](_0x54484a[_0x8626('0x72')][_0x8626('0xbe')],_[_0x8626('0xbf')](_0x54484a['body'],[_0x8626('0xbe'),'id'])||{});}})[_0x8626('0x27')](respondWithResult(_0x402e43,null))[_0x8626('0xb5')](handleError(_0x402e43,null));};exports['getMessages']=function(_0x306681,_0x345b8e,_0xb310cb){var _0x3e14a7={'raw':![],'where':{}};var _0x5b03a9={};var _0x553201={'count':0x0,'rows':[]};return db[_0x8626('0x3c')][_0x8626('0xc0')]({'where':{'id':_0x306681[_0x8626('0xba')]['id']}})[_0x8626('0x27')](handleEntityNotFound(_0x345b8e,null))[_0x8626('0x27')](function(_0x41b1ed){if(_0x41b1ed){_0x5b03a9[_0x8626('0x3f')]=_[_0x8626('0x41')](db[_0x8626('0xbd')]['rawAttributes']);_0x5b03a9[_0x8626('0x40')]=_['keys'](_0x306681[_0x8626('0x40')]);_0x5b03a9['filters']=_['intersection'](_0x5b03a9['model'],_0x5b03a9['query']);_0x3e14a7[_0x8626('0x44')]=_[_0x8626('0x43')](_0x5b03a9[_0x8626('0x3f')],qs[_0x8626('0x45')](_0x306681[_0x8626('0x40')][_0x8626('0x45')]));_0x3e14a7['attributes']=_0x3e14a7['attributes'][_0x8626('0x46')]?_0x3e14a7[_0x8626('0x44')]:_0x5b03a9[_0x8626('0x3f')];if(!_0x306681[_0x8626('0x40')][_0x8626('0xc1')](_0x8626('0xc2'))){_0x3e14a7[_0x8626('0x20')]=qs[_0x8626('0x20')](_0x306681[_0x8626('0x40')][_0x8626('0x20')]);_0x3e14a7[_0x8626('0x1e')]=qs[_0x8626('0x1e')](_0x306681[_0x8626('0x40')][_0x8626('0x1e')]);}_0x3e14a7['order']=qs['sort'](_0x306681[_0x8626('0x40')][_0x8626('0x48')]);_0x3e14a7[_0x8626('0x49')]=qs[_0x8626('0x42')](_[_0x8626('0x4a')](_0x306681['query'],_0x5b03a9['filters']));_0x3e14a7[_0x8626('0x49')][_0x8626('0xb2')]=_0x41b1ed['id'];if(_0x306681[_0x8626('0x40')][_0x8626('0x87')]){_0x3e14a7[_0x8626('0x49')]=_[_0x8626('0x9e')](_0x3e14a7[_0x8626('0x49')],{'$or':_[_0x8626('0x3b')](_0x3e14a7[_0x8626('0x44')],function(_0x386c44){var _0x5f2b0e={};_0x5f2b0e[_0x386c44]={'$like':'%'+_0x306681['query'][_0x8626('0x87')]+'%'};return _0x5f2b0e;})});}if(_0x306681[_0x8626('0x40')]['$gte']){var _0x4515e7=_0x306681['query'][_0x8626('0x7d')][_0x8626('0x2f')](',');var _0x2969a0={};_0x2969a0[_0x4515e7[0x0]]={'$gte':moment(_0x4515e7[0x1])[_0x8626('0xc3')](_0x8626('0xc4'))};_0x3e14a7[_0x8626('0x49')]=_[_0x8626('0x9e')](_0x3e14a7[_0x8626('0x49')],_0x2969a0);}_0x3e14a7=_['merge']({},_0x3e14a7,_0x306681['options']);return db['FaxMessage']['count']({'where':_0x3e14a7[_0x8626('0x49')]})['then'](function(_0xab1663){_0x553201[_0x8626('0x21')]=_0xab1663;if(_0x306681[_0x8626('0x40')][_0x8626('0xb7')]){_0x3e14a7['include']=[{'all':!![]}];}return db[_0x8626('0xbd')][_0x8626('0xc5')](_0x3e14a7);})[_0x8626('0x27')](function(_0x5eb8ad){_0x553201[_0x8626('0xb4')]=_0x5eb8ad;return _0x553201;});}})[_0x8626('0x27')](respondWithFilteredResult(_0x345b8e,_0x3e14a7))[_0x8626('0xb5')](handleError(_0x345b8e,null));};exports[_0x8626('0xc6')]=function(_0x22a26f,_0x292806,_0x21a06e){return db[_0x8626('0x3c')][_0x8626('0x69')]({'where':{'id':_0x22a26f['params']['id']}})[_0x8626('0x27')](handleEntityNotFound(_0x292806,null))['then'](function(_0x58fa60){if(_0x58fa60){return _0x58fa60[_0x8626('0xc7')](_0x22a26f['body'][_0x8626('0xbe')],_[_0x8626('0xbf')](_0x22a26f[_0x8626('0x72')],['ids','id'])||{})[_0x8626('0xc8')](function(){return db[_0x8626('0x6c')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x22a26f[_0x8626('0x72')][_0x8626('0xbe')]}});})[_0x8626('0x27')](function(_0x31cf6e){socket[_0x8626('0xc9')](_0x8626('0xca'),{'id':Number(_0x22a26f[_0x8626('0xba')]['id']),'tags':_0x31cf6e||[]});return{'id':Number(_0x22a26f[_0x8626('0xba')]['id']),'tags':_0x31cf6e||[]};});}})[_0x8626('0x27')](respondWithResult(_0x292806,null))[_0x8626('0xb5')](handleError(_0x292806,null));};exports['removeTags']=function(_0x48dffb,_0x242595,_0x2d294a){return db['FaxInteraction'][_0x8626('0x69')]({'where':{'id':_0x48dffb[_0x8626('0xba')]['id']}})[_0x8626('0x27')](handleEntityNotFound(_0x242595,null))['then'](function(_0x14e56e){if(_0x14e56e){return _0x14e56e[_0x8626('0xcb')](_0x48dffb[_0x8626('0x40')]['ids']);}})[_0x8626('0x27')](respondWithStatusCode(_0x242595,null))[_0x8626('0xb5')](handleError(_0x242595,null));};exports['download']=function(_0x3601b5,_0x8003d5){var _0x1d9a32=moment()['unix']()['toString']();var _0x5529c2=path['join'](config[_0x8626('0xcc')],_0x8626('0xcd'),'files','tmp');var _0x3e3f02=path[_0x8626('0xce')](config[_0x8626('0xcc')],_0x8626('0xcd'),'files',_0x8626('0xcf'));var _0x467a93=path['join'](_0x5529c2,_0x1d9a32);var _0x3894d6=util[_0x8626('0xc3')](_0x8626('0xd0'),_0x3601b5[_0x8626('0xba')]['id'],_0x1d9a32);var _0x204518=path[_0x8626('0xce')](_0x5529c2,_0x3894d6);var _0x3bff1c=[];_0x3bff1c[_0x8626('0x32')]({'model':db[_0x8626('0xd1')],'as':_0x8626('0xd1'),'raw':!![]});var _0x43bc1f=[{'model':db[_0x8626('0xbd')],'as':_0x8626('0xd2'),'attributes':['id',_0x8626('0x72'),'createdAt'],'include':_0x3bff1c}];return db[_0x8626('0x3c')][_0x8626('0x69')]({'where':{'id':_0x3601b5['params']['id']},'include':_0x43bc1f})[_0x8626('0x27')](handleEntityNotFound(_0x8003d5,null))[_0x8626('0x27')](function(_0x10d1b7){if(_0x10d1b7&&_0x10d1b7[_0x8626('0xd2')]){var _0x5423a9=_0x10d1b7[_0x8626('0xd3')]({'plain':!![]});fs[_0x8626('0xd4')](_0x467a93);for(var _0x3fd5bc=0x0;_0x3fd5bc<_0x5423a9['Messages']['length'];_0x3fd5bc++){var _0xb27c98=_0x5423a9[_0x8626('0xd2')][_0x3fd5bc][_0x8626('0xd1')];if(_0xb27c98){var _0x5c4c03=path[_0x8626('0xce')](_0x3e3f02,_0xb27c98[_0x8626('0xd5')]);if(fs[_0x8626('0xd6')](_0x5c4c03)){fs['createReadStream'](_0x5c4c03)[_0x8626('0xd7')](fs[_0x8626('0xd8')](path['join'](_0x467a93,_0xb27c98['basename'])));}}}return BPromise[_0x8626('0x95')]()[_0x8626('0x27')](function(){return new BPromise(function(_0x38dbfe,_0x95d308){zipdir(_0x467a93,{'saveTo':_0x204518},function(_0x55c937,_0x286e1b){if(_0x55c937)return _0x95d308(_0x55c937);return _0x38dbfe(_0x286e1b);});})[_0x8626('0x27')](function(){return new BPromise(function(_0x1e9e79,_0x204c53){rimraf(_0x467a93,function(_0x91b502){if(_0x91b502)_0x204c53(_0x91b502);return _0x1e9e79();});});})[_0x8626('0x27')](function(){return _0x8003d5['download'](_0x204518,_0x3894d6,function(_0x3ece89){if(_0x3ece89){console[_0x8626('0xd9')](_0x8626('0xda'),_0x3ece89);}else{fs[_0x8626('0xdb')](_0x204518);}});});});}else{return _0x8003d5[_0x8626('0x1a')](0xc8);}})['catch'](handleError(_0x8003d5,null));}; \ No newline at end of file +var _0xfa89=['status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','answered','unmanaged','total','closed','UserId','waiting','talking','index','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','agent','FaxAccountId','toString','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','create','describe','FaxMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','pick','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','setTags','omit','spread','findAll','emit','removeTags','download','unix','join','root','server','files','attachments','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./faxInteraction.socket','register'];(function(_0x4bee21,_0x188341){var _0x3fddcc=function(_0x3b5a69){while(--_0x3b5a69){_0x4bee21['push'](_0x4bee21['shift']());}};_0x3fddcc(++_0x188341);}(_0xfa89,0xc6));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9fa8('0x0'));var rimraf=require(_0x9fa8('0x1'));var zipdir=require(_0x9fa8('0x2'));var jsonpatch=require(_0x9fa8('0x3'));var rp=require(_0x9fa8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9fa8('0x5'));var util=require('util');var path=require(_0x9fa8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9fa8('0x7'));var fs=require('fs');var fs_extra=require(_0x9fa8('0x8'));var _=require(_0x9fa8('0x9'));var squel=require('squel');var crypto=require(_0x9fa8('0xa'));var jsforce=require(_0x9fa8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9fa8('0xc'));var querystring=require('querystring');var Papa=require(_0x9fa8('0xd'));var Redis=require(_0x9fa8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9fa8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fa8('0x10'));var logger=require(_0x9fa8('0x11'))(_0x9fa8('0x12'));var utils=require(_0x9fa8('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9fa8('0x14'))['db'];config[_0x9fa8('0x15')]=_['defaults'](config[_0x9fa8('0x15')],{'host':_0x9fa8('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fa8('0x15')]));require(_0x9fa8('0x17'))[_0x9fa8('0x18')](socket);function respondWithStatusCode(_0x32f2e5,_0x285d91){_0x285d91=_0x285d91||0xcc;return function(_0x389d70){if(_0x389d70){return _0x32f2e5['sendStatus'](_0x285d91);}return _0x32f2e5[_0x9fa8('0x19')](_0x285d91)['end']();};}function respondWithResult(_0x1a5465,_0x23bafe){_0x23bafe=_0x23bafe||0xc8;return function(_0x25ab21){if(_0x25ab21){return _0x1a5465[_0x9fa8('0x19')](_0x23bafe)[_0x9fa8('0x1a')](_0x25ab21);}};}function respondWithFilteredResult(_0x2395af,_0xd2e7df){return function(_0x120845){if(_0x120845){var _0x541b5f=typeof _0xd2e7df['offset']===_0x9fa8('0x1b')&&typeof _0xd2e7df[_0x9fa8('0x1c')]==='undefined';var _0x3daeb9=_0x120845[_0x9fa8('0x1d')];var _0x3d5bae=_0x541b5f?0x0:_0xd2e7df['offset'];var _0x106b4f=_0x541b5f?_0x120845[_0x9fa8('0x1d')]:_0xd2e7df[_0x9fa8('0x1e')]+_0xd2e7df[_0x9fa8('0x1c')];var _0x382b32;if(_0x106b4f>=_0x3daeb9){_0x106b4f=_0x3daeb9;_0x382b32=0xc8;}else{_0x382b32=0xce;}_0x2395af[_0x9fa8('0x19')](_0x382b32);return _0x2395af[_0x9fa8('0x1f')](_0x9fa8('0x20'),_0x3d5bae+'-'+_0x106b4f+'/'+_0x3daeb9)['json'](_0x120845);}return null;};}function patchUpdates(_0x1acd94){return function(_0x63f08a){try{jsonpatch[_0x9fa8('0x21')](_0x63f08a,_0x1acd94,!![]);}catch(_0x45367){return BPromise[_0x9fa8('0x22')](_0x45367);}return _0x63f08a[_0x9fa8('0x23')]();};}function saveUpdates(_0x30da5d,_0x39c807){return function(_0x1d468){if(_0x1d468){return _0x1d468[_0x9fa8('0x24')](_0x30da5d)[_0x9fa8('0x25')](function(_0xd94886){return _0xd94886;});}return null;};}function removeEntity(_0x9b0d8e,_0x3177db){return function(_0x2f0091){if(_0x2f0091){return _0x2f0091[_0x9fa8('0x26')]()[_0x9fa8('0x25')](function(){_0x9b0d8e[_0x9fa8('0x19')](0xcc)[_0x9fa8('0x27')]();});}};}function handleEntityNotFound(_0x59a940,_0x5d5245){return function(_0x3918ab){if(!_0x3918ab){_0x59a940['sendStatus'](0x194);}return _0x3918ab;};}function handleError(_0x5cf4d8,_0x908c9c){_0x908c9c=_0x908c9c||0x1f4;return function(_0x414e5f){logger[_0x9fa8('0x28')](_0x414e5f['stack']);if(_0x414e5f[_0x9fa8('0x29')]){delete _0x414e5f[_0x9fa8('0x29')];}_0x5cf4d8[_0x9fa8('0x19')](_0x908c9c)[_0x9fa8('0x2a')](_0x414e5f);};}function getInteractionUsers(_0x395982,_0x261a61){return new BPromise(function(_0x27ec6b,_0x14f6e2){try{if(_0x261a61[_0x395982['id']]){_0x395982[_0x9fa8('0x2b')]=_[_0x9fa8('0x2c')](_0x261a61[_0x395982['id']],function(_0x17ae47){return{'id':_0x17ae47['id'],'fullname':_0x17ae47['fullname']};});}}catch(_0x20a207){_0x14f6e2(_0x20a207);}_0x27ec6b(_0x395982);});}function getInteractionTags(_0x383747,_0x354bec){return new BPromise(function(_0x22271a,_0x1526a2){try{if(_0x383747[_0x9fa8('0x2d')]){_0x383747[_0x9fa8('0x2e')]=[];_0x383747[_0x9fa8('0x2d')][_0x9fa8('0x2f')](',')[_0x9fa8('0x30')](function(_0x3cc241){_0x383747['Tags'][_0x9fa8('0x31')](_0x354bec[_0x3cc241]);});}delete _0x383747[_0x9fa8('0x2d')];}catch(_0x32af7a){_0x1526a2(_0x32af7a);}_0x22271a(_0x383747);});}function updateFaxInteraction(_0xf05f79,_0x46780d,_0x4b0bd1){return new BPromise(function(_0x48ac2b,_0x13ffbe){return getInteractionUsers(_0xf05f79,_0x4b0bd1)[_0x9fa8('0x25')](function(_0x424d69){return getInteractionTags(_0x424d69,_0x46780d);})['then'](function(_0x9ad9b4){return getStateInteraction(_0x9ad9b4);})[_0x9fa8('0x25')](function(_0x5c9002){_0x48ac2b(_0x5c9002);})[_0x9fa8('0x32')](function(_0x33dcc0){_0x13ffbe(_0x33dcc0);});});}function getStateInteraction(_0x20306a){return new BPromise(function(_0x3f40a8){_0x20306a['waiting']=0x0;_0x20306a['talking']=0x0;_0x20306a[_0x9fa8('0x33')]=0x0;_0x20306a[_0x9fa8('0x34')]=0x0;_0x20306a[_0x9fa8('0x35')]=0x0;if(!_0x20306a[_0x9fa8('0x36')]&&!_0x20306a[_0x9fa8('0x37')]){_0x20306a[_0x9fa8('0x38')]+=0x1;}if(!_0x20306a[_0x9fa8('0x36')]&&_0x20306a[_0x9fa8('0x37')]){_0x20306a[_0x9fa8('0x39')]+=0x1;if(_0x20306a[_0x9fa8('0x38')]){_0x20306a['waiting']-=0x1;}}if(_0x20306a[_0x9fa8('0x36')]&&_0x20306a[_0x9fa8('0x37')]){_0x20306a[_0x9fa8('0x33')]+=0x1;if(_0x20306a[_0x9fa8('0x39')]){_0x20306a[_0x9fa8('0x39')]-=0x1;}}if(_0x20306a['closed']&&!_0x20306a[_0x9fa8('0x37')]){_0x20306a[_0x9fa8('0x34')]+=0x1;if(_0x20306a['waiting']){_0x20306a['waiting']-=0x1;}}_0x20306a['total']+=0x1;_0x3f40a8(_0x20306a);});}exports[_0x9fa8('0x3a')]=function(_0x3312f2,_0x160941){var _0x5a061d={},_0x1c3331={},_0x4d9470={'count':0x0,'rows':[]};var _0x3c6c4a=_[_0x9fa8('0x2c')](db[_0x9fa8('0x3b')][_0x9fa8('0x3c')],function(_0x228121){return{'name':_0x228121[_0x9fa8('0x3d')],'type':_0x228121[_0x9fa8('0x3e')][_0x9fa8('0x3f')]};});_0x1c3331['model']=_[_0x9fa8('0x2c')](_0x3c6c4a,_0x9fa8('0x29'));_0x1c3331[_0x9fa8('0x40')]=_[_0x9fa8('0x41')](_0x3312f2['query']);_0x1c3331[_0x9fa8('0x42')]=_[_0x9fa8('0x43')](_0x1c3331['model'],_0x1c3331['query']);_0x5a061d[_0x9fa8('0x44')]=_[_0x9fa8('0x43')](_0x1c3331[_0x9fa8('0x45')],qs['fields'](_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x46')]));_0x5a061d[_0x9fa8('0x44')]=_0x5a061d[_0x9fa8('0x44')]['length']?_0x5a061d['attributes']:_0x1c3331[_0x9fa8('0x45')];if(!_0x3312f2['query']['hasOwnProperty']('nolimit')){_0x5a061d[_0x9fa8('0x1c')]=qs[_0x9fa8('0x1c')](_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x1c')]);_0x5a061d[_0x9fa8('0x1e')]=qs['offset'](_0x3312f2[_0x9fa8('0x40')]['offset']);}_0x5a061d[_0x9fa8('0x47')]=qs[_0x9fa8('0x48')](_0x3312f2['query'][_0x9fa8('0x48')]);_0x5a061d['where']=qs[_0x9fa8('0x42')](_['pick'](_0x3312f2[_0x9fa8('0x40')],_0x1c3331[_0x9fa8('0x42')]),_0x3c6c4a);var _0x1082d4=[];var _0xdfe6ac=squel[_0x9fa8('0x49')]()[_0x9fa8('0x4a')]('id')[_0x9fa8('0x4a')](_0x9fa8('0x29'))['field'](_0x9fa8('0x4b'))[_0x9fa8('0x4c')](_0x9fa8('0x4d'));var _0x3961d1=squel[_0x9fa8('0x49')]()[_0x9fa8('0x4a')](_0x9fa8('0x4e'))['field'](_0x9fa8('0x4f'))[_0x9fa8('0x4a')](_0x9fa8('0x50'))[_0x9fa8('0x4c')]('user_has_fax_interactions','ui')[_0x9fa8('0x51')](_0x9fa8('0x52'),'u',_0x9fa8('0x53'));var _0x393360=squel[_0x9fa8('0x49')]()[_0x9fa8('0x4c')](_0x9fa8('0x54'),'i')[_0x9fa8('0x51')](_0x9fa8('0x55'),'c',_0x9fa8('0x56'))[_0x9fa8('0x51')](_0x9fa8('0x52'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x9fa8('0x57'),'a',_0x9fa8('0x58'))[_0x9fa8('0x51')]('fax_messages','me',_0x9fa8('0x59'))[_0x9fa8('0x51')](_0x9fa8('0x5a'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x9fa8('0x51')](_0x9fa8('0x4d'),'t',_0x9fa8('0x5b'));var _0x19eaab=squel[_0x9fa8('0x5c')]();var _0x1f365d=[];var _0x3e761c=squel[_0x9fa8('0x5c')]();var _0x3c0ad;if(_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x5d')]){_0x3c0ad=as[_0x9fa8('0x5e')](_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x5d')]);var _0x12257b=_0x3c0ad['sqlOperator'];for(var _0x57f78b=0x0;_0x57f78b<_0x3c0ad[_0x9fa8('0x5f')]['length'];_0x57f78b++){var _0x2f5816=_0x3c0ad[_0x9fa8('0x5f')][_0x57f78b];var _0x1dc904='i';var _0x22175f=_[_0x9fa8('0x60')](_0x3c6c4a,[_0x9fa8('0x29'),_0x2f5816[_0x9fa8('0x4a')]]);if(!_0x22175f){switch(_0x2f5816[_0x9fa8('0x4a')]){case _0x9fa8('0x61'):if(_0x2f5816[_0x9fa8('0x62')]==0x1){_0x393360[_0x9fa8('0x63')]('`'+_0x2f5816[_0x9fa8('0x4a')]+_0x9fa8('0x64'));}else{_0x393360['having']('`'+_0x2f5816[_0x9fa8('0x4a')]+_0x9fa8('0x65'));}break;case _0x9fa8('0x66'):if(_0x2f5816['operator']===_0x9fa8('0x67')){if(_0x2f5816[_0x9fa8('0x62')][_0x9fa8('0x2f')]('\x20')[_0x9fa8('0x68')]>0x1){_0x19eaab[_0x12257b](_0x9fa8('0x69'),qs[_0x9fa8('0x6a')](_0x2f5816[_0x9fa8('0x62')]),null);}else{var _0x44ab36='%'+_0x2f5816[_0x9fa8('0x62')]+'%';_0x19eaab[_0x12257b](_0x9fa8('0x6b'),_0x44ab36,_0x44ab36,_0x44ab36);}}else{_0x22175f=_[_0x9fa8('0x60')](_0x3c6c4a,['name',_0x9fa8('0x6c')]);_0x2f5816[_0x9fa8('0x4a')]=_0x9fa8('0x6c');_0x100a4f=as[_0x9fa8('0x6d')](_0x1dc904,_0x22175f[_0x9fa8('0x3e')],_0x2f5816);_0x19eaab[_0x12257b](_0x100a4f[_0x9fa8('0x6e')],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x6f')],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x27')]);}break;case _0x9fa8('0x70'):var _0x5c0fff=_0x2f5816[_0x9fa8('0x62')][_0x9fa8('0x2f')](',')['map'](function(_0x4c3c8d){return Number(_0x4c3c8d);});_0x5c0fff['forEach'](function(_0x175a91){_0x3e761c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x175a91+',%');});_0x1f365d=_[_0x9fa8('0x71')](_0x1f365d,_0x5c0fff);break;case _0x9fa8('0x72'):if(_0x2f5816[_0x9fa8('0x73')]===_0x9fa8('0x67')){_0x19eaab[_0x12257b](_0x9fa8('0x74'),'%'+_0x2f5816['value']+'%',null);}else{_0x22175f=_[_0x9fa8('0x60')](_0x3c6c4a,[_0x9fa8('0x29'),_0x9fa8('0x37')]);_0x2f5816[_0x9fa8('0x4a')]=_0x9fa8('0x37');_0x100a4f=as[_0x9fa8('0x6d')](_0x1dc904,_0x22175f[_0x9fa8('0x3e')],_0x2f5816);_0x19eaab[_0x12257b](_0x100a4f[_0x9fa8('0x6e')],_0x100a4f['value']['start'],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x27')]);}break;case _0x9fa8('0x75'):_0x100a4f=as[_0x9fa8('0x6d')]('me',null,_0x2f5816);_0x19eaab[_0x12257b](_0x100a4f[_0x9fa8('0x6e')],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x6f')],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x27')]);break;}}else{var _0x100a4f=as['buildExpression'](_0x1dc904,_0x22175f[_0x9fa8('0x3e')],_0x2f5816);_0x19eaab[_0x12257b](_0x100a4f[_0x9fa8('0x6e')],_0x100a4f[_0x9fa8('0x62')][_0x9fa8('0x6f')],_0x100a4f[_0x9fa8('0x62')]['end']);}}}else{var _0x568422=_(_0x3312f2[_0x9fa8('0x40')])[_0x9fa8('0x41')]()[_0x9fa8('0x2c')](function(_0x2c54cf){return _[_0x9fa8('0x76')](_0x3c6c4a,['name',_0x2c54cf])?_0x2c54cf:undefined;})[_0x9fa8('0x77')]()['value']();if(!_[_0x9fa8('0x78')](_0x568422)){_0x568422[_0x9fa8('0x30')](function(_0x3eceb1){if(_0x3eceb1==='FaxAccountId'){_0x393360[_0x9fa8('0x79')](_0x9fa8('0x7a'),[][_0x9fa8('0x7b')](_0x3312f2[_0x9fa8('0x40')][_0x3eceb1]));}else if(_0x3eceb1===_0x9fa8('0x7c')){var _0x544749=JSON[_0x9fa8('0x7d')](_0x3312f2[_0x9fa8('0x40')][_0x3eceb1])['$gte'];var _0xa2c50e=JSON['parse'](_0x3312f2['query'][_0x3eceb1])[_0x9fa8('0x7e')];_0x393360[_0x9fa8('0x79')](_0x9fa8('0x7f'),_0x544749,_0xa2c50e);}else{if(_0x3312f2['query'][_0x3eceb1]===_0x9fa8('0x80')){_0x393360[_0x9fa8('0x79')]('i.'+_0x3eceb1+_0x9fa8('0x81'));}else{_0x393360[_0x9fa8('0x79')]('i.'+_0x3eceb1+'\x20=\x20?',_0x3312f2[_0x9fa8('0x40')][_0x3eceb1]);}}});}if(_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x82')]){if(_0x3312f2['query']['read']==0x1){_0x393360[_0x9fa8('0x63')]('`unreadMessages`\x20=\x200');}else{_0x393360['having'](_0x9fa8('0x83'));}}if(_0x3312f2[_0x9fa8('0x40')]['tag']){_0x1f365d=_[_0x9fa8('0x84')](_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x85')])?_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x85')]:new Array(_0x3312f2[_0x9fa8('0x40')][_0x9fa8('0x85')]);_0x1f365d['forEach'](function(_0x3a3e3c){_0x3e761c['or'](_0x9fa8('0x86'),'%,'+_0x3a3e3c+',%');});}if(_0x3312f2['query'][_0x9fa8('0x87')]){var _0x384be8=_0x3312f2['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x9fa8('0x88')](/'/g,'\x27\x27');if(qs[_0x9fa8('0x89')](_0x384be8)){_0x19eaab['or'](_0x9fa8('0x8a'),_0x384be8+'%')['or'](_0x9fa8('0x8b'),_0x384be8+'%');}_0x19eaab['or'](_0x9fa8('0x8c'),_0x384be8+'%');}}_0x393360['where'](_0x19eaab);_0x393360[_0x9fa8('0x8d')](_0x9fa8('0x8e'));var _0x2874cb={'type':db[_0x9fa8('0x8f')][_0x9fa8('0x90')]['SELECT'],'raw':!![]};var _0x75b9c6=_0x393360['clone']();_0x75b9c6['field']('i.id');_0x75b9c6[_0x9fa8('0x4a')](_0x9fa8('0x91'),_0x9fa8('0x61'));if(_0x5a061d[_0x9fa8('0x47')]){_0x5a061d[_0x9fa8('0x47')]['forEach'](function(_0x4c2985){var _0x2d0fb3=_0x4c2985[0x0]===_0x9fa8('0x92')?_0x4c2985[0x0]:'i.'+_0x4c2985[0x0];_0x393360[_0x9fa8('0x47')](_0x2d0fb3,_0x4c2985[0x1]===_0x9fa8('0x93')?![]:!![]);});}if(!_[_0x9fa8('0x78')](_0x1f365d)){_0x393360[_0x9fa8('0x63')](_0x3e761c);_0x75b9c6[_0x9fa8('0x79')]('t.id\x20IN\x20?',_0x1f365d);}BPromise['resolve']()[_0x9fa8('0x25')](function(){if(!_0x3c0ad){if(_0x3312f2[_0x9fa8('0x40')]['FaxAccountId'])return;_0x75b9c6['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x393360['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3312f2[_0x9fa8('0x94')]['role']!=='agent')return;return _0x3312f2[_0x9fa8('0x94')][_0x9fa8('0x95')]({'attributes':['id'],'raw':!![]})[_0x9fa8('0x25')](function(_0x5e4335){if(_[_0x9fa8('0x78')](_0x5e4335)){_0x75b9c6[_0x9fa8('0x79')](_0x9fa8('0x96'));_0x393360[_0x9fa8('0x79')](_0x9fa8('0x96'));}else{_0x75b9c6[_0x9fa8('0x79')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x5e4335,'id'));_0x393360[_0x9fa8('0x79')](_0x9fa8('0x7a'),_[_0x9fa8('0x2c')](_0x5e4335,'id'));}});})[_0x9fa8('0x25')](function(){if(_0x3312f2['user'][_0x9fa8('0x97')]===_0x9fa8('0x98')&&!_0x3c0ad&&!_0x3312f2['query'][_0x9fa8('0x99')])return[];return db['sequelize'][_0x9fa8('0x40')](_0x75b9c6[_0x9fa8('0x9a')](),_0x2874cb);})[_0x9fa8('0x25')](function(_0x3f5b4d){_0x4d9470[_0x9fa8('0x1d')]=_0x3f5b4d[_0x9fa8('0x68')];if(_0x4d9470[_0x9fa8('0x1d')]===0x0)return[];return db[_0x9fa8('0x9b')]['query'](_0xdfe6ac[_0x9fa8('0x9a')](),_0x2874cb)[_0x9fa8('0x25')](function(_0x1475ef){_0x1082d4=_[_0x9fa8('0x9c')](_0x1475ef,'id');_0x2874cb=_[_0x9fa8('0x9d')](_0x2874cb,{'model':db[_0x9fa8('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3312f2['query'][_0x9fa8('0x46')]){_0x5a061d['attributes'][_0x9fa8('0x30')](function(_0x3df203){_0x393360[_0x9fa8('0x4a')]('i.'+_0x3df203);});}else{_0x393360[_0x9fa8('0x4a')](_0x9fa8('0x91'),_0x9fa8('0x61'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0x9e'),_0x9fa8('0x9f'));_0x393360['field']('a.mandatoryDisposition',_0x9fa8('0xa0'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xa1'),_0x9fa8('0x92'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xa2'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xa3'),'Contact.firstName');_0x393360['field'](_0x9fa8('0xa4'),_0x9fa8('0xa5'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xa6'),_0x9fa8('0xa7'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xa8'),_0x9fa8('0xa9'));_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xaa'),_0x9fa8('0xab'));_0x393360['field']('c.fax',_0x9fa8('0xac'));_0x393360[_0x9fa8('0x4a')]('o.fullname','Owner.fullname');_0x393360[_0x9fa8('0x4a')](_0x9fa8('0xad'),_0x9fa8('0xae'));_0x393360[_0x9fa8('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9fa8('0x2d'));}if(_0x5a061d[_0x9fa8('0x1c')])_0x393360[_0x9fa8('0x1c')](_0x5a061d[_0x9fa8('0x1c')]);if(_0x5a061d[_0x9fa8('0x1e')])_0x393360[_0x9fa8('0x1e')](_0x5a061d[_0x9fa8('0x1e')]);return db[_0x9fa8('0x9b')][_0x9fa8('0x40')](_0x393360[_0x9fa8('0x9a')](),_0x2874cb);})['then'](function(_0x113612){if(_0x113612['length']>0x0)_0x3961d1[_0x9fa8('0x79')](_0x9fa8('0xaf'),_['map'](_0x113612,'id'));return db[_0x9fa8('0x9b')][_0x9fa8('0x40')](_0x3961d1[_0x9fa8('0x9a')](),_0x2874cb)[_0x9fa8('0x25')](function(_0x31d701){var _0x4db707=_['groupBy'](_0x31d701,'FaxInteractionId');var _0x132aa7=[];_0x113612[_0x9fa8('0x30')](function(_0x4c1d75){_0x132aa7[_0x9fa8('0x31')](updateFaxInteraction(_0x4c1d75,_0x1082d4,_0x4db707));});return BPromise[_0x9fa8('0xb0')](_0x132aa7);});});})[_0x9fa8('0x25')](function(_0x373e8a){_0x4d9470[_0x9fa8('0xb1')]=_0x373e8a;return _0x4d9470;})['then'](respondWithFilteredResult(_0x160941,_0x5a061d))[_0x9fa8('0x32')](handleError(_0x160941,null));};exports[_0x9fa8('0xb2')]=function(_0x430006,_0x4de8e2){var _0x39ec49={'raw':![],'where':{'id':_0x430006[_0x9fa8('0xb3')]['id']}},_0x3c1c65={};_0x3c1c65['model']=_[_0x9fa8('0x41')](db[_0x9fa8('0x3b')][_0x9fa8('0x3c')]);_0x3c1c65['query']=_[_0x9fa8('0x41')](_0x430006[_0x9fa8('0x40')]);_0x3c1c65[_0x9fa8('0x42')]=_[_0x9fa8('0x43')](_0x3c1c65['model'],_0x3c1c65[_0x9fa8('0x40')]);_0x39ec49[_0x9fa8('0x44')]=_['intersection'](_0x3c1c65[_0x9fa8('0x45')],qs[_0x9fa8('0x46')](_0x430006[_0x9fa8('0x40')][_0x9fa8('0x46')]));_0x39ec49['attributes']=_0x39ec49[_0x9fa8('0x44')][_0x9fa8('0x68')]?_0x39ec49[_0x9fa8('0x44')]:_0x3c1c65[_0x9fa8('0x45')];if(_0x430006[_0x9fa8('0x40')]['includeAll']){_0x39ec49['include']=[{'all':!![]}];}_0x39ec49=_[_0x9fa8('0x9d')]({},_0x39ec49,_0x430006['options']);return db['FaxInteraction']['find'](_0x39ec49)[_0x9fa8('0x25')](handleEntityNotFound(_0x4de8e2,null))[_0x9fa8('0x25')](respondWithResult(_0x4de8e2,null))[_0x9fa8('0x32')](handleError(_0x4de8e2,null));};exports[_0x9fa8('0xb4')]=function(_0x91e837,_0xbfb2fd){return db['FaxInteraction']['create'](_0x91e837[_0x9fa8('0x75')],{})['then'](respondWithResult(_0xbfb2fd,0xc9))[_0x9fa8('0x32')](handleError(_0xbfb2fd,null));};exports[_0x9fa8('0x24')]=function(_0x122f4b,_0x1305b6){if(_0x122f4b[_0x9fa8('0x75')]['id']){delete _0x122f4b[_0x9fa8('0x75')]['id'];}return db[_0x9fa8('0x3b')][_0x9fa8('0x60')]({'where':{'id':_0x122f4b[_0x9fa8('0xb3')]['id']}})['then'](handleEntityNotFound(_0x1305b6,null))[_0x9fa8('0x25')](saveUpdates(_0x122f4b['body'],null))['then'](respondWithResult(_0x1305b6,null))[_0x9fa8('0x32')](handleError(_0x1305b6,null));};exports['destroy']=function(_0x2c0f49,_0x4798c8){return db[_0x9fa8('0x3b')][_0x9fa8('0x60')]({'where':{'id':_0x2c0f49['params']['id']}})[_0x9fa8('0x25')](handleEntityNotFound(_0x4798c8,null))[_0x9fa8('0x25')](removeEntity(_0x4798c8,null))[_0x9fa8('0x32')](handleError(_0x4798c8,null));};exports[_0x9fa8('0xb5')]=function(_0x1673e5,_0x537e0d){return db[_0x9fa8('0x3b')]['describe']()[_0x9fa8('0x25')](respondWithResult(_0x537e0d,null))['catch'](handleError(_0x537e0d,null));};exports['addMessage']=function(_0x591c27,_0x50211,_0x444eb8){return db[_0x9fa8('0xb6')][_0x9fa8('0x60')]({'where':{'id':_0x591c27[_0x9fa8('0xb3')]['id']}})['then'](handleEntityNotFound(_0x50211,null))[_0x9fa8('0x25')](function(_0x158b85){if(_0x158b85){return _0x158b85[_0x9fa8('0xb7')](_0x591c27['body'][_0x9fa8('0xb8')],_['omit'](_0x591c27[_0x9fa8('0x75')],[_0x9fa8('0xb8'),'id'])||{});}})[_0x9fa8('0x25')](respondWithResult(_0x50211,null))[_0x9fa8('0x32')](handleError(_0x50211,null));};exports[_0x9fa8('0xb9')]=function(_0x560155,_0x19595d,_0x3ff7e7){var _0x5d7248={'raw':![],'where':{}};var _0x514919={};var _0x41e246={'count':0x0,'rows':[]};return db[_0x9fa8('0x3b')][_0x9fa8('0xba')]({'where':{'id':_0x560155[_0x9fa8('0xb3')]['id']}})['then'](handleEntityNotFound(_0x19595d,null))['then'](function(_0x2d54d3){if(_0x2d54d3){_0x514919[_0x9fa8('0x45')]=_[_0x9fa8('0x41')](db[_0x9fa8('0xb6')]['rawAttributes']);_0x514919[_0x9fa8('0x40')]=_[_0x9fa8('0x41')](_0x560155[_0x9fa8('0x40')]);_0x514919[_0x9fa8('0x42')]=_[_0x9fa8('0x43')](_0x514919[_0x9fa8('0x45')],_0x514919[_0x9fa8('0x40')]);_0x5d7248[_0x9fa8('0x44')]=_['intersection'](_0x514919[_0x9fa8('0x45')],qs[_0x9fa8('0x46')](_0x560155['query'][_0x9fa8('0x46')]));_0x5d7248[_0x9fa8('0x44')]=_0x5d7248['attributes'][_0x9fa8('0x68')]?_0x5d7248[_0x9fa8('0x44')]:_0x514919[_0x9fa8('0x45')];if(!_0x560155['query'][_0x9fa8('0xbb')](_0x9fa8('0xbc'))){_0x5d7248['limit']=qs[_0x9fa8('0x1c')](_0x560155['query'][_0x9fa8('0x1c')]);_0x5d7248[_0x9fa8('0x1e')]=qs[_0x9fa8('0x1e')](_0x560155['query'][_0x9fa8('0x1e')]);}_0x5d7248['order']=qs[_0x9fa8('0x48')](_0x560155[_0x9fa8('0x40')]['sort']);_0x5d7248['where']=qs[_0x9fa8('0x42')](_[_0x9fa8('0xbd')](_0x560155[_0x9fa8('0x40')],_0x514919['filters']));_0x5d7248[_0x9fa8('0x79')][_0x9fa8('0xbe')]=_0x2d54d3['id'];if(_0x560155[_0x9fa8('0x40')][_0x9fa8('0x87')]){_0x5d7248['where']=_[_0x9fa8('0x9d')](_0x5d7248[_0x9fa8('0x79')],{'$or':_[_0x9fa8('0x2c')](_0x5d7248[_0x9fa8('0x44')],function(_0x1051ce){var _0x99fd80={};_0x99fd80[_0x1051ce]={'$like':'%'+_0x560155[_0x9fa8('0x40')][_0x9fa8('0x87')]+'%'};return _0x99fd80;})});}if(_0x560155[_0x9fa8('0x40')][_0x9fa8('0xbf')]){var _0x4fec7b=_0x560155['query'][_0x9fa8('0xbf')][_0x9fa8('0x2f')](',');var _0x4cb8d9={};_0x4cb8d9[_0x4fec7b[0x0]]={'$gte':moment(_0x4fec7b[0x1])[_0x9fa8('0xc0')](_0x9fa8('0xc1'))};_0x5d7248['where']=_['merge'](_0x5d7248[_0x9fa8('0x79')],_0x4cb8d9);}_0x5d7248=_[_0x9fa8('0x9d')]({},_0x5d7248,_0x560155[_0x9fa8('0xc2')]);return db[_0x9fa8('0xb6')][_0x9fa8('0x1d')]({'where':_0x5d7248[_0x9fa8('0x79')]})[_0x9fa8('0x25')](function(_0x1c76d8){_0x41e246['count']=_0x1c76d8;if(_0x560155[_0x9fa8('0x40')][_0x9fa8('0xc3')]){_0x5d7248[_0x9fa8('0xc4')]=[{'all':!![]}];}return db[_0x9fa8('0xb6')]['findAll'](_0x5d7248);})[_0x9fa8('0x25')](function(_0x3534fb){_0x41e246[_0x9fa8('0xb1')]=_0x3534fb;return _0x41e246;});}})[_0x9fa8('0x25')](respondWithFilteredResult(_0x19595d,_0x5d7248))['catch'](handleError(_0x19595d,null));};exports['addTags']=function(_0x1cb72b,_0x289a74,_0x27e3e1){return db['FaxInteraction'][_0x9fa8('0x60')]({'where':{'id':_0x1cb72b[_0x9fa8('0xb3')]['id']}})[_0x9fa8('0x25')](handleEntityNotFound(_0x289a74,null))['then'](function(_0x364780){if(_0x364780){return _0x364780[_0x9fa8('0xc5')](_0x1cb72b['body'][_0x9fa8('0xb8')],_[_0x9fa8('0xc6')](_0x1cb72b['body'],[_0x9fa8('0xb8'),'id'])||{})[_0x9fa8('0xc7')](function(){return db['Tag'][_0x9fa8('0xc8')]({'attributes':['id','name',_0x9fa8('0x4b')],'where':{'id':_0x1cb72b['body'][_0x9fa8('0xb8')]}});})[_0x9fa8('0x25')](function(_0x35925a){socket[_0x9fa8('0xc9')]('faxInteractionTags:save',{'id':Number(_0x1cb72b['params']['id']),'tags':_0x35925a||[]});return{'id':Number(_0x1cb72b[_0x9fa8('0xb3')]['id']),'tags':_0x35925a||[]};});}})['then'](respondWithResult(_0x289a74,null))['catch'](handleError(_0x289a74,null));};exports['removeTags']=function(_0x47ef54,_0x36afd3,_0x3d4350){return db[_0x9fa8('0x3b')][_0x9fa8('0x60')]({'where':{'id':_0x47ef54['params']['id']}})[_0x9fa8('0x25')](handleEntityNotFound(_0x36afd3,null))[_0x9fa8('0x25')](function(_0x2b1f3a){if(_0x2b1f3a){return _0x2b1f3a[_0x9fa8('0xca')](_0x47ef54['query'][_0x9fa8('0xb8')]);}})[_0x9fa8('0x25')](respondWithStatusCode(_0x36afd3,null))[_0x9fa8('0x32')](handleError(_0x36afd3,null));};exports[_0x9fa8('0xcb')]=function(_0x5e723c,_0x2f0a29){var _0x2bb703=moment()[_0x9fa8('0xcc')]()[_0x9fa8('0x9a')]();var _0x27c111=path[_0x9fa8('0xcd')](config[_0x9fa8('0xce')],_0x9fa8('0xcf'),_0x9fa8('0xd0'),'tmp');var _0x1445e4=path[_0x9fa8('0xcd')](config[_0x9fa8('0xce')],_0x9fa8('0xcf'),_0x9fa8('0xd0'),_0x9fa8('0xd1'));var _0xb121f9=path[_0x9fa8('0xcd')](_0x27c111,_0x2bb703);var _0x24d678=util[_0x9fa8('0xc0')]('transcript-%d-%s.zip',_0x5e723c['params']['id'],_0x2bb703);var _0x842265=path['join'](_0x27c111,_0x24d678);var _0x393156=[];_0x393156[_0x9fa8('0x31')]({'model':db[_0x9fa8('0xd2')],'as':'Attachment','raw':!![]});var _0x427da8=[{'model':db[_0x9fa8('0xb6')],'as':_0x9fa8('0xd3'),'attributes':['id',_0x9fa8('0x75'),_0x9fa8('0x7c')],'include':_0x393156}];return db[_0x9fa8('0x3b')][_0x9fa8('0x60')]({'where':{'id':_0x5e723c[_0x9fa8('0xb3')]['id']},'include':_0x427da8})['then'](handleEntityNotFound(_0x2f0a29,null))['then'](function(_0x54df80){if(_0x54df80&&_0x54df80['Messages']){var _0x3fbec2=_0x54df80['get']({'plain':!![]});fs[_0x9fa8('0xd4')](_0xb121f9);for(var _0x27ab20=0x0;_0x27ab20<_0x3fbec2['Messages'][_0x9fa8('0x68')];_0x27ab20++){var _0x4408a1=_0x3fbec2[_0x9fa8('0xd3')][_0x27ab20][_0x9fa8('0xd2')];if(_0x4408a1){var _0x1fe47f=path[_0x9fa8('0xcd')](_0x1445e4,_0x4408a1[_0x9fa8('0xd5')]);if(fs[_0x9fa8('0xd6')](_0x1fe47f)){fs[_0x9fa8('0xd7')](_0x1fe47f)[_0x9fa8('0xd8')](fs[_0x9fa8('0xd9')](path['join'](_0xb121f9,_0x4408a1[_0x9fa8('0xd5')])));}}}return BPromise[_0x9fa8('0xda')]()[_0x9fa8('0x25')](function(){return new BPromise(function(_0x217779,_0xb57106){zipdir(_0xb121f9,{'saveTo':_0x842265},function(_0x505b0f,_0xbf068d){if(_0x505b0f)return _0xb57106(_0x505b0f);return _0x217779(_0xbf068d);});})['then'](function(){return new BPromise(function(_0x3a225d,_0x4a7f75){rimraf(_0xb121f9,function(_0x111bfe){if(_0x111bfe)_0x4a7f75(_0x111bfe);return _0x3a225d();});});})[_0x9fa8('0x25')](function(){return _0x2f0a29[_0x9fa8('0xcb')](_0x842265,_0x24d678,function(_0x1db0b6){if(_0x1db0b6){console[_0x9fa8('0xdb')](_0x9fa8('0xdc'),_0x1db0b6);}else{fs[_0x9fa8('0xdd')](_0x842265);}});});});}else{return _0x2f0a29[_0x9fa8('0xde')](0xc8);}})[_0x9fa8('0x32')](handleError(_0x2f0a29,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1ea2a59..503111e 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 _0xd814=['catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd814,0x1d8));var _0x4d81=function(_0x400b72,_0x5d9686){_0x400b72=_0x400b72-0x0;var _0xfa795d=_0xd814[_0x400b72];return _0xfa795d;};'use strict';var EventEmitter=require(_0x4d81('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x4d81('0x1')];var FaxMessage=require(_0x4d81('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4d81('0x3'),'afterUpdate':_0x4d81('0x4'),'afterDestroy':_0x4d81('0x5')};function emitEvent(_0x523145){return function(_0x546581,_0xc1beaa,_0x26579f){_0x546581[_0x4d81('0x6')]({'attributes':['id'],'raw':!![]})[_0x4d81('0x7')](function(_0x58e1a3){_0x546581['setDataValue']('Users',_0x58e1a3[_0x4d81('0x8')](function(_0x12dacb){return{'id':_0x12dacb['id']};}));return FaxMessage[_0x4d81('0x9')]({'where':{'FaxInteractionId':_0x546581['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ff0b9){_0x546581[_0x4d81('0xa')](_0x4d81('0xb'),_0x4ff0b9[_0x4d81('0xc')]);FaxInteractionEvents['emit'](_0x523145+':'+_0x546581['id'],_0x546581);FaxInteractionEvents[_0x4d81('0xd')](_0x523145,_0x546581);_0x26579f(null);})[_0x4d81('0xe')](_0x26579f(null));};}for(var e in events){if(events[_0x4d81('0xf')](e)){var event=events[e];FaxInteraction[_0x4d81('0x10')](e,emitEvent(event));}}module[_0x4d81('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x9696=['catch','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x11f1fd,_0xce95a8){var _0x2d1215=function(_0x532087){while(--_0x532087){_0x11f1fd['push'](_0x11f1fd['shift']());}};_0x2d1215(++_0xce95a8);}(_0x9696,0x192));var _0x6969=function(_0x102b49,_0x44ed4f){_0x102b49=_0x102b49-0x0;var _0x77e1da=_0x9696[_0x102b49];return _0x77e1da;};'use strict';var EventEmitter=require(_0x6969('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x6969('0x1'))['db'][_0x6969('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6969('0x3')](0x0);var events={'afterCreate':_0x6969('0x4'),'afterUpdate':_0x6969('0x5'),'afterDestroy':_0x6969('0x6')};function emitEvent(_0x1252cd){return function(_0x49e320,_0x1b0dea,_0x2de853){_0x49e320[_0x6969('0x7')]({'attributes':['id'],'raw':!![]})[_0x6969('0x8')](function(_0x35a212){_0x49e320[_0x6969('0x9')](_0x6969('0xa'),_0x35a212[_0x6969('0xb')](function(_0xdaed1){return{'id':_0xdaed1['id']};}));return FaxMessage[_0x6969('0xc')]({'where':{'FaxInteractionId':_0x49e320['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x176287){_0x49e320[_0x6969('0x9')](_0x6969('0xd'),_0x176287[_0x6969('0xe')]);FaxInteractionEvents[_0x6969('0xf')](_0x1252cd+':'+_0x49e320['id'],_0x49e320);FaxInteractionEvents['emit'](_0x1252cd,_0x49e320);_0x2de853(null);})[_0x6969('0x10')](_0x2de853(null));};}for(var e in events){if(events[_0x6969('0x11')](e)){var event=events[e];FaxInteraction[_0x6969('0x12')](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 9319f0b..34599d7 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 _0x1a85=['api','moment','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1a85,0x178));var _0x51a8=function(_0x54d506,_0xabf5c2){_0x54d506=_0x54d506-0x0;var _0x5d3040=_0x1a85[_0x54d506];return _0x5d3040;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./faxInteraction.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f3919,_0x228c64,_0x513685){if(_0x4f3919['changed'](_0x51a8('0x9'))){_0x4f3919[_0x51a8('0xa')]=moment()[_0x51a8('0xb')](_0x51a8('0xc'));}_0x513685(null,_0x4f3919);}}});}; \ No newline at end of file +var _0x081e=['define','FaxInteraction','fax_interactions','changed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports'];(function(_0x1bbc24,_0x532e5a){var _0x295418=function(_0x35df2f){while(--_0x35df2f){_0x1bbc24['push'](_0x1bbc24['shift']());}};_0x295418(++_0x532e5a);}(_0x081e,0x9f));var _0xe081=function(_0x116573,_0x234dde){_0x116573=_0x116573-0x0;var _0x4274e0=_0x081e[_0x116573];return _0x4274e0;};'use strict';var _=require(_0xe081('0x0'));var util=require(_0xe081('0x1'));var logger=require(_0xe081('0x2'))(_0xe081('0x3'));var moment=require(_0xe081('0x4'));var BPromise=require(_0xe081('0x5'));var rp=require(_0xe081('0x6'));var fs=require('fs');var path=require(_0xe081('0x7'));var rimraf=require(_0xe081('0x8'));var config=require('../../config/environment');var attributes=require(_0xe081('0x9'));module[_0xe081('0xa')]=function(_0x426fbb,_0x33bacc){return _0x426fbb[_0xe081('0xb')](_0xe081('0xc'),attributes,{'tableName':_0xe081('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35572a,_0x360848,_0x40c1fa){if(_0x35572a[_0xe081('0xe')]('closed')){_0x35572a[_0xe081('0xf')]=moment()[_0xe081('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x40c1fa(null,_0x35572a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index b10e398..f38aa98 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 _0x6354=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','UpdateFaxInteraction','body','options','raw','where','attributes','limit','stringify','find'];(function(_0x1ece25,_0x2bbbcc){var _0x153926=function(_0x464b41){while(--_0x464b41){_0x1ece25['push'](_0x1ece25['shift']());}};_0x153926(++_0x2bbbcc);}(_0x6354,0xd6));var _0x4635=function(_0x3e2423,_0x5554c6){_0x3e2423=_0x3e2423-0x0;var _0x26c422=_0x6354[_0x3e2423];return _0x26c422;};'use strict';var _=require(_0x4635('0x0'));var util=require(_0x4635('0x1'));var moment=require(_0x4635('0x2'));var BPromise=require(_0x4635('0x3'));var rs=require(_0x4635('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4635('0x5'))['db'];var utils=require(_0x4635('0x6'));var logger=require(_0x4635('0x7'))(_0x4635('0x8'));var config=require(_0x4635('0x9'));var jayson=require(_0x4635('0xa'));var client=jayson[_0x4635('0xb')][_0x4635('0xc')]({'port':0x232a});config['redis']=_[_0x4635('0xd')](config['redis'],{'host':_0x4635('0xe'),'port':0x18eb});var socket=require(_0x4635('0xf'))(new Redis(config[_0x4635('0x10')]));require(_0x4635('0x11'))[_0x4635('0x12')](socket);function respondWithRpcPromise(_0x307d61,_0x5e0d0b,_0x125bb9){return new BPromise(function(_0x56caec,_0x4c8754){return client[_0x4635('0x13')](_0x307d61,_0x125bb9)[_0x4635('0x14')](function(_0x2351c4){logger['info'](_0x4635('0x15'),_0x5e0d0b,_0x4635('0x16'));logger[_0x4635('0x17')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5e0d0b,'request\x20sent',JSON['stringify'](_0x2351c4));if(_0x2351c4['error']){if(_0x2351c4[_0x4635('0x18')]['code']===0x1f4){logger[_0x4635('0x18')](_0x4635('0x15'),_0x5e0d0b,_0x2351c4[_0x4635('0x18')][_0x4635('0x19')]);return _0x4c8754(_0x2351c4[_0x4635('0x18')][_0x4635('0x19')]);}logger[_0x4635('0x18')](_0x4635('0x15'),_0x5e0d0b,_0x2351c4[_0x4635('0x18')][_0x4635('0x19')]);return _0x56caec(_0x2351c4[_0x4635('0x18')][_0x4635('0x19')]);}else{logger[_0x4635('0x1a')](_0x4635('0x15'),_0x5e0d0b,'request\x20sent');_0x56caec(_0x2351c4[_0x4635('0x1b')][_0x4635('0x19')]);}})[_0x4635('0x1c')](function(_0x520cb8){logger[_0x4635('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x5e0d0b,_0x520cb8);_0x4c8754(_0x520cb8);});});}exports[_0x4635('0x1d')]=function(_0x185cc9){var _0x2ba5f6=this;return new Promise(function(_0xad1811,_0x2594ee){return db['FaxInteraction']['update'](_0x185cc9[_0x4635('0x1e')],{'raw':_0x185cc9[_0x4635('0x1f')]?_0x185cc9['options'][_0x4635('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x185cc9[_0x4635('0x1f')]?_0x185cc9[_0x4635('0x1f')][_0x4635('0x21')]||null:null,'attributes':_0x185cc9[_0x4635('0x1f')]?_0x185cc9['options'][_0x4635('0x22')]||null:null,'limit':_0x185cc9[_0x4635('0x1f')]?_0x185cc9[_0x4635('0x1f')][_0x4635('0x23')]||null:null})[_0x4635('0x14')](function(_0x2aff36){logger[_0x4635('0x1a')](_0x4635('0x1d'),_0x185cc9);logger[_0x4635('0x17')](_0x4635('0x1d'),_0x185cc9,JSON[_0x4635('0x24')](_0x2aff36));_0xad1811(_0x2aff36);})[_0x4635('0x1c')](function(_0x458438){logger[_0x4635('0x18')](_0x4635('0x1d'),_0x458438['message'],_0x185cc9);_0x2594ee(_0x2ba5f6[_0x4635('0x18')](0x1f4,_0x458438[_0x4635('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0xfd0cba){return new Promise(function(_0x4eabaa,_0x50e4fa){return db['FaxInteraction'][_0x4635('0x25')]({'where':_0xfd0cba[_0x4635('0x1f')]?_0xfd0cba[_0x4635('0x1f')][_0x4635('0x21')]||null:null})['then'](function(_0x5adda3){if(_0x5adda3){return _0x5adda3[_0x4635('0x26')](_0xfd0cba[_0x4635('0x1e')][_0x4635('0x27')],_['omit'](_0xfd0cba[_0x4635('0x1e')],[_0x4635('0x27'),'id'])||{});}})[_0x4635('0x28')](function(_0x148222){logger[_0x4635('0x1a')]('AddTags',_0xfd0cba);logger['debug'](_0x4635('0x29'),_0xfd0cba,JSON['stringify'](_0x148222));_0x4eabaa(_0x148222);})['catch'](function(_0x503d06){logger[_0x4635('0x18')](_0x4635('0x29'),_0x503d06[_0x4635('0x19')],_0xfd0cba);_0x50e4fa(_this[_0x4635('0x18')](0x1f4,_0x503d06[_0x4635('0x19')]));});});}; \ No newline at end of file +var _0x09c6=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','FaxInteraction,\x20%s,\x20%s','result','FaxInteraction','update','body','options','limit','then','UpdateFaxInteraction','stringify','catch','find','where','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','request\x20sent','debug'];(function(_0x32f099,_0x8e8c68){var _0x4d010a=function(_0x4c4d13){while(--_0x4c4d13){_0x32f099['push'](_0x32f099['shift']());}};_0x4d010a(++_0x8e8c68);}(_0x09c6,0xdc));var _0x609c=function(_0x73a8f4,_0x5bf6ef){_0x73a8f4=_0x73a8f4-0x0;var _0xe1c173=_0x09c6[_0x73a8f4];return _0xe1c173;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x609c('0x0'));var BPromise=require(_0x609c('0x1'));var rs=require(_0x609c('0x2'));var fs=require('fs');var Redis=require(_0x609c('0x3'));var db=require(_0x609c('0x4'))['db'];var utils=require(_0x609c('0x5'));var logger=require(_0x609c('0x6'))('rpc');var config=require(_0x609c('0x7'));var jayson=require(_0x609c('0x8'));var client=jayson[_0x609c('0x9')][_0x609c('0xa')]({'port':0x232a});config[_0x609c('0xb')]=_[_0x609c('0xc')](config[_0x609c('0xb')],{'host':_0x609c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x609c('0xb')]));require(_0x609c('0xe'))[_0x609c('0xf')](socket);function respondWithRpcPromise(_0x27eb63,_0x3378f2,_0x2c5f65){return new BPromise(function(_0x111ba3,_0x5aaf6f){return client[_0x609c('0x10')](_0x27eb63,_0x2c5f65)['then'](function(_0x5849d5){logger[_0x609c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x3378f2,_0x609c('0x12'));logger[_0x609c('0x13')](_0x609c('0x14'),_0x3378f2,_0x609c('0x12'),JSON['stringify'](_0x5849d5));if(_0x5849d5['error']){if(_0x5849d5[_0x609c('0x15')]['code']===0x1f4){logger[_0x609c('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x3378f2,_0x5849d5['error'][_0x609c('0x16')]);return _0x5aaf6f(_0x5849d5[_0x609c('0x15')]['message']);}logger[_0x609c('0x15')](_0x609c('0x17'),_0x3378f2,_0x5849d5['error']['message']);return _0x111ba3(_0x5849d5[_0x609c('0x15')][_0x609c('0x16')]);}else{logger[_0x609c('0x11')](_0x609c('0x17'),_0x3378f2,'request\x20sent');_0x111ba3(_0x5849d5[_0x609c('0x18')][_0x609c('0x16')]);}})['catch'](function(_0x2f0c13){logger[_0x609c('0x15')](_0x609c('0x17'),_0x3378f2,_0x2f0c13);_0x5aaf6f(_0x2f0c13);});});}exports['UpdateFaxInteraction']=function(_0x3f19dc){var _0x119197=this;return new Promise(function(_0x5d0b96,_0x2f4f35){return db[_0x609c('0x19')][_0x609c('0x1a')](_0x3f19dc[_0x609c('0x1b')],{'raw':_0x3f19dc[_0x609c('0x1c')]?_0x3f19dc[_0x609c('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f19dc[_0x609c('0x1c')]?_0x3f19dc['options']['where']||null:null,'attributes':_0x3f19dc[_0x609c('0x1c')]?_0x3f19dc[_0x609c('0x1c')]['attributes']||null:null,'limit':_0x3f19dc[_0x609c('0x1c')]?_0x3f19dc['options'][_0x609c('0x1d')]||null:null})[_0x609c('0x1e')](function(_0x5c65cb){logger[_0x609c('0x11')](_0x609c('0x1f'),_0x3f19dc);logger[_0x609c('0x13')](_0x609c('0x1f'),_0x3f19dc,JSON[_0x609c('0x20')](_0x5c65cb));_0x5d0b96(_0x5c65cb);})[_0x609c('0x21')](function(_0x41ab9a){logger[_0x609c('0x15')](_0x609c('0x1f'),_0x41ab9a[_0x609c('0x16')],_0x3f19dc);_0x2f4f35(_0x119197[_0x609c('0x15')](0x1f4,_0x41ab9a['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x49cc42){return new Promise(function(_0xcfaca6,_0x2e4e12){return db['FaxInteraction'][_0x609c('0x22')]({'where':_0x49cc42[_0x609c('0x1c')]?_0x49cc42[_0x609c('0x1c')][_0x609c('0x23')]||null:null})[_0x609c('0x1e')](function(_0x46bd2f){if(_0x46bd2f){return _0x46bd2f[_0x609c('0x24')](_0x49cc42[_0x609c('0x1b')][_0x609c('0x25')],_[_0x609c('0x26')](_0x49cc42[_0x609c('0x1b')],['ids','id'])||{});}})['spread'](function(_0x5d2c1b){logger[_0x609c('0x11')](_0x609c('0x27'),_0x49cc42);logger[_0x609c('0x13')](_0x609c('0x27'),_0x49cc42,JSON[_0x609c('0x20')](_0x5d2c1b));_0xcfaca6(_0x5d2c1b);})[_0x609c('0x21')](function(_0x3d1025){logger[_0x609c('0x15')](_0x609c('0x27'),_0x3d1025[_0x609c('0x16')],_0x49cc42);_0x2e4e12(_this[_0x609c('0x15')](0x1f4,_0x3d1025[_0x609c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ac9d27e..24ce9c7 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 _0x0a99=['remove','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x1ac6bb,_0x567138){var _0xb9233b=function(_0x4787da){while(--_0x4787da){_0x1ac6bb['push'](_0x1ac6bb['shift']());}};_0xb9233b(++_0x567138);}(_0x0a99,0xa6));var _0x90a9=function(_0x346471,_0x153033){_0x346471=_0x346471-0x0;var _0x1c8098=_0x0a99[_0x346471];return _0x1c8098;};'use strict';var FaxInteractionEvents=require(_0x90a9('0x0'));var events=[_0x90a9('0x1'),_0x90a9('0x2'),'update'];function createListener(_0x32e3a6,_0x257b6d){return function(_0x214cbf){_0x257b6d[_0x90a9('0x3')](_0x32e3a6,_0x214cbf);};}function removeListener(_0x1a059d,_0x3a1938){return function(){FaxInteractionEvents[_0x90a9('0x4')](_0x1a059d,_0x3a1938);};}exports[_0x90a9('0x5')]=function(_0x3df000){for(var _0x1e10b1=0x0,_0x17f4b7=events[_0x90a9('0x6')];_0x1e10b1<_0x17f4b7;_0x1e10b1++){var _0x719945=events[_0x1e10b1];var _0x43b512=createListener(_0x90a9('0x7')+_0x719945,_0x3df000);FaxInteractionEvents['on'](_0x719945,_0x43b512);}}; \ No newline at end of file +var _0xc144=['length','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xc144,0x1e2));var _0x4c14=function(_0xf6e07a,_0x125dd2){_0xf6e07a=_0xf6e07a-0x0;var _0x11fd56=_0xc144[_0xf6e07a];return _0x11fd56;};'use strict';var FaxInteractionEvents=require(_0x4c14('0x0'));var events=[_0x4c14('0x1'),_0x4c14('0x2'),_0x4c14('0x3')];function createListener(_0x3e01c9,_0x2319ff){return function(_0x29d24d){_0x2319ff['emit'](_0x3e01c9,_0x29d24d);};}function removeListener(_0x73f1ee,_0x5843c3){return function(){FaxInteractionEvents[_0x4c14('0x4')](_0x73f1ee,_0x5843c3);};}exports[_0x4c14('0x5')]=function(_0x3cdf41){for(var _0x1a8c02=0x0,_0xa25e92=events[_0x4c14('0x6')];_0x1a8c02<_0xa25e92;_0x1a8c02++){var _0x16064e=events[_0x1a8c02];var _0x3c65d3=createListener(_0x4c14('0x7')+_0x16064e,_0x3cdf41);FaxInteractionEvents['on'](_0x16064e,_0x3c65d3);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 8328106..2c5e755 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 _0xcecb=['isAuthenticated','describe','/:id','show','/:id/messages','post','addMessage','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxInteraction.controller','get'];(function(_0x544036,_0x23b647){var _0x45013c=function(_0x2b0eab){while(--_0x2b0eab){_0x544036['push'](_0x544036['shift']());}};_0x45013c(++_0x23b647);}(_0xcecb,0xfc));var _0xbcec=function(_0x16c7d4,_0x1fd6a5){_0x16c7d4=_0x16c7d4-0x0;var _0x54c042=_0xcecb[_0x16c7d4];return _0x54c042;};'use strict';var multer=require(_0xbcec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbcec('0x1'));var express=require(_0xbcec('0x2'));var router=express[_0xbcec('0x3')]();var fs_extra=require(_0xbcec('0x4'));var auth=require(_0xbcec('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbcec('0x6'));router[_0xbcec('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xbcec('0x8')](),controller[_0xbcec('0x9')]);router[_0xbcec('0x7')](_0xbcec('0xa'),auth[_0xbcec('0x8')](),controller[_0xbcec('0xb')]);router[_0xbcec('0x7')](_0xbcec('0xc'),auth[_0xbcec('0x8')](),controller['getMessages']);router[_0xbcec('0x7')]('/:id/download',auth[_0xbcec('0x8')](),controller['download']);router[_0xbcec('0xd')]('/',auth[_0xbcec('0x8')](),controller['create']);router[_0xbcec('0xd')]('/:id/messages',auth[_0xbcec('0x8')](),controller[_0xbcec('0xe')]);router[_0xbcec('0xd')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xbcec('0xf')](_0xbcec('0x10'),_0xbcec('0x11')),controller['addTags']);router[_0xbcec('0x12')](_0xbcec('0xa'),auth[_0xbcec('0x8')](),interaction[_0xbcec('0xf')](_0xbcec('0x10'),_0xbcec('0x13')),controller[_0xbcec('0x14')]);router[_0xbcec('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0xbcec('0xf')](_0xbcec('0x10'),_0xbcec('0x16')),controller[_0xbcec('0x17')]);router['delete'](_0xbcec('0x18'),auth['isAuthenticated'](),controller['removeTags']);module[_0xbcec('0x19')]=router; \ No newline at end of file +var _0x9978=['removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','/:id/download','download','post','/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','update','destroy'];(function(_0x4d821c,_0x22bd0e){var _0x15dd5b=function(_0x20e8f2){while(--_0x20e8f2){_0x4d821c['push'](_0x4d821c['shift']());}};_0x15dd5b(++_0x22bd0e);}(_0x9978,0x1c1));var _0x8997=function(_0x94ff4f,_0x4e7570){_0x94ff4f=_0x94ff4f-0x0;var _0x412c53=_0x9978[_0x94ff4f];return _0x412c53;};'use strict';var multer=require(_0x8997('0x0'));var util=require('util');var path=require(_0x8997('0x1'));var timeout=require(_0x8997('0x2'));var express=require(_0x8997('0x3'));var router=express[_0x8997('0x4')]();var fs_extra=require(_0x8997('0x5'));var auth=require(_0x8997('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8997('0x7'));var controller=require(_0x8997('0x8'));router[_0x8997('0x9')]('/',auth[_0x8997('0xa')](),controller[_0x8997('0xb')]);router[_0x8997('0x9')]('/describe',auth[_0x8997('0xa')](),controller[_0x8997('0xc')]);router[_0x8997('0x9')]('/:id',auth[_0x8997('0xa')](),controller[_0x8997('0xd')]);router[_0x8997('0x9')](_0x8997('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x8997('0x9')](_0x8997('0xf'),auth[_0x8997('0xa')](),controller[_0x8997('0x10')]);router['post']('/',auth[_0x8997('0xa')](),controller['create']);router['post'](_0x8997('0xe'),auth[_0x8997('0xa')](),controller['addMessage']);router[_0x8997('0x11')](_0x8997('0x12'),auth['isAuthenticated'](),interaction[_0x8997('0x13')](_0x8997('0x14'),'faxinteraction:addtags'),controller[_0x8997('0x15')]);router[_0x8997('0x16')](_0x8997('0x17'),auth[_0x8997('0xa')](),interaction[_0x8997('0x13')]('fax',_0x8997('0x18')),controller[_0x8997('0x19')]);router['delete'](_0x8997('0x17'),auth['isAuthenticated'](),interaction['tracked']('fax','faxinteraction:destroy'),controller[_0x8997('0x1a')]);router['delete'](_0x8997('0x12'),auth[_0x8997('0xa')](),controller[_0x8997('0x1b')]);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 3e903a3..9626b77 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 _0xc368=['ENUM','out','DATE','exports','medium','BOOLEAN'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xc368,0x7b));var _0x8c36=function(_0x27b0cb,_0x2cd4f5){_0x27b0cb=_0x27b0cb-0x0;var _0x1b8d9d=_0xc368[_0x27b0cb];return _0x1b8d9d;};'use strict';var Sequelize=require('sequelize');module[_0x8c36('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8c36('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x8c36('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8c36('0x3')]('in',_0x8c36('0x4')),'defaultValue':_0x8c36('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x8c36('0x5')]}}; \ No newline at end of file +var _0x7764=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x5df62c,_0x302e58){var _0x455dd0=function(_0x5d1d09){while(--_0x5d1d09){_0x5df62c['push'](_0x5df62c['shift']());}};_0x455dd0(++_0x302e58);}(_0x7764,0xa4));var _0x4776=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x7764[_0x2053ea];return _0x2232c4;};'use strict';var Sequelize=require(_0x4776('0x0'));module[_0x4776('0x1')]={'body':{'type':Sequelize[_0x4776('0x2')](_0x4776('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4776('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4776('0x5')]('in',_0x4776('0x6')),'defaultValue':_0x4776('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4776('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4776('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d53caa3..231bee0 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 _0x4476=['fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','agent','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','role','RejectMessage','rejectMessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','server','attachments','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4476,0x10a));var _0x6447=function(_0x5a25f6,_0x3db5cb){_0x5a25f6=_0x5a25f6-0x0;var _0x5a524d=_0x4476[_0x5a25f6];return _0x5a524d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6447('0x0'));var zipdir=require(_0x6447('0x1'));var jsonpatch=require(_0x6447('0x2'));var rp=require(_0x6447('0x3'));var moment=require(_0x6447('0x4'));var BPromise=require(_0x6447('0x5'));var Mustache=require('mustache');var util=require(_0x6447('0x6'));var path=require(_0x6447('0x7'));var sox=require(_0x6447('0x8'));var csv=require('to-csv');var ejs=require(_0x6447('0x9'));var fs=require('fs');var fs_extra=require(_0x6447('0xa'));var _=require('lodash');var squel=require(_0x6447('0xb'));var crypto=require(_0x6447('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6447('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6447('0xe'));var Papa=require(_0x6447('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6447('0x10'));var as=require(_0x6447('0x11'));var hardwareService=require(_0x6447('0x12'));var logger=require(_0x6447('0x13'))(_0x6447('0x14'));var utils=require('../../config/utils');var config=require(_0x6447('0x15'));var licenseUtil=require(_0x6447('0x16'));var db=require('../../mysqldb')['db'];config[_0x6447('0x17')]=_[_0x6447('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6447('0x19'))(new Redis(config[_0x6447('0x17')]));require('./faxMessage.socket')[_0x6447('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6447('0x1b')][_0x6447('0x1c')]({'port':0x232c});var client9002=jayson[_0x6447('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2124,_0x191013,_0x199d8c,_0x38eb1c){return new BPromise(function(_0x491ca2,_0x18137a){var _0x2e80eb=_0x38eb1c||client;return _0x2e80eb['request'](_0x1d2124,_0x199d8c)[_0x6447('0x1d')](function(_0x5f1044){logger[_0x6447('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x191013,_0x6447('0x1f'));logger[_0x6447('0x20')](_0x6447('0x21'),_0x191013,_0x6447('0x1f'),JSON[_0x6447('0x22')](_0x5f1044));if(_0x5f1044[_0x6447('0x23')]){if(_0x5f1044[_0x6447('0x23')]['code']===0x1f4){logger[_0x6447('0x23')](_0x6447('0x24'),_0x191013,_0x5f1044[_0x6447('0x23')]['message']);return _0x18137a(_0x5f1044[_0x6447('0x23')][_0x6447('0x25')]);}logger[_0x6447('0x23')]('FaxMessage,\x20%s,\x20%s',_0x191013,_0x5f1044[_0x6447('0x23')]['message']);return _0x491ca2(_0x5f1044['error'][_0x6447('0x25')]);}else{logger[_0x6447('0x1e')](_0x6447('0x24'),_0x191013,_0x6447('0x1f'));_0x491ca2(_0x5f1044[_0x6447('0x26')][_0x6447('0x25')]);}})[_0x6447('0x27')](function(_0x2f15e5){logger[_0x6447('0x23')](_0x6447('0x24'),_0x191013,_0x2f15e5);_0x18137a(_0x2f15e5);});});}function respondWithStatusCode(_0x28ca6c,_0x1cb058){_0x1cb058=_0x1cb058||0xcc;return function(_0x2dc0a0){if(_0x2dc0a0){return _0x28ca6c['sendStatus'](_0x1cb058);}return _0x28ca6c[_0x6447('0x28')](_0x1cb058)[_0x6447('0x29')]();};}function respondWithResult(_0x5c016e,_0x81abda){_0x81abda=_0x81abda||0xc8;return function(_0x3664e9){if(_0x3664e9){return _0x5c016e[_0x6447('0x28')](_0x81abda)['json'](_0x3664e9);}};}function respondWithFilteredResult(_0x6bb2b3,_0x5c51a8){return function(_0x4cd756){if(_0x4cd756){var _0x3e4078=typeof _0x5c51a8[_0x6447('0x2a')]===_0x6447('0x2b')&&typeof _0x5c51a8[_0x6447('0x2c')]==='undefined';var _0x457ced=_0x4cd756[_0x6447('0x2d')];var _0x2af31e=_0x3e4078?0x0:_0x5c51a8[_0x6447('0x2a')];var _0x168939=_0x3e4078?_0x4cd756['count']:_0x5c51a8[_0x6447('0x2a')]+_0x5c51a8['limit'];var _0x1f4f70;if(_0x168939>=_0x457ced){_0x168939=_0x457ced;_0x1f4f70=0xc8;}else{_0x1f4f70=0xce;}_0x6bb2b3[_0x6447('0x28')](_0x1f4f70);return _0x6bb2b3[_0x6447('0x2e')]('Content-Range',_0x2af31e+'-'+_0x168939+'/'+_0x457ced)[_0x6447('0x2f')](_0x4cd756);}return null;};}function patchUpdates(_0x510080){return function(_0x35d7f4){try{jsonpatch[_0x6447('0x30')](_0x35d7f4,_0x510080,!![]);}catch(_0x28c6a0){return BPromise[_0x6447('0x31')](_0x28c6a0);}return _0x35d7f4[_0x6447('0x32')]();};}function saveUpdates(_0x4c66cc,_0x502875){return function(_0x228412){if(_0x228412){return _0x228412[_0x6447('0x33')](_0x4c66cc)['then'](function(_0x3ac5be){return _0x3ac5be;});}return null;};}function removeEntity(_0x5f4094,_0x593f12){return function(_0x2b2f1a){if(_0x2b2f1a){return _0x2b2f1a[_0x6447('0x34')]()[_0x6447('0x1d')](function(){_0x5f4094['status'](0xcc)[_0x6447('0x29')]();});}};}function handleEntityNotFound(_0x50add9,_0x3fdd09){return function(_0x464da2){if(!_0x464da2){_0x50add9[_0x6447('0x35')](0x194);}return _0x464da2;};}function handleError(_0x58e4da,_0x15994d){_0x15994d=_0x15994d||0x1f4;return function(_0x267fa5){logger[_0x6447('0x23')](_0x267fa5[_0x6447('0x36')]);if(_0x267fa5[_0x6447('0x37')]){delete _0x267fa5[_0x6447('0x37')];}_0x58e4da['status'](_0x15994d)['send'](_0x267fa5);};}exports[_0x6447('0x38')]=function(_0x364f27,_0x3814d4){var _0x9c3c13={},_0x3c7ee7={},_0x4fb69c={'count':0x0,'rows':[]};var _0x5ab32b=_[_0x6447('0x39')](db[_0x6447('0x3a')][_0x6447('0x3b')],function(_0x52a09b){return{'name':_0x52a09b[_0x6447('0x3c')],'type':_0x52a09b[_0x6447('0x3d')]['key']};});_0x3c7ee7[_0x6447('0x3e')]=_[_0x6447('0x39')](_0x5ab32b,_0x6447('0x37'));_0x3c7ee7['query']=_[_0x6447('0x3f')](_0x364f27[_0x6447('0x40')]);_0x3c7ee7['filters']=_['intersection'](_0x3c7ee7[_0x6447('0x3e')],_0x3c7ee7[_0x6447('0x40')]);_0x9c3c13[_0x6447('0x41')]=_[_0x6447('0x42')](_0x3c7ee7[_0x6447('0x3e')],qs[_0x6447('0x43')](_0x364f27[_0x6447('0x40')][_0x6447('0x43')]));_0x9c3c13[_0x6447('0x41')]=_0x9c3c13['attributes'][_0x6447('0x44')]?_0x9c3c13[_0x6447('0x41')]:_0x3c7ee7[_0x6447('0x3e')];if(!_0x364f27[_0x6447('0x40')][_0x6447('0x45')](_0x6447('0x46'))){_0x9c3c13[_0x6447('0x2c')]=qs[_0x6447('0x2c')](_0x364f27[_0x6447('0x40')]['limit']);_0x9c3c13[_0x6447('0x2a')]=qs[_0x6447('0x2a')](_0x364f27[_0x6447('0x40')][_0x6447('0x2a')]);}_0x9c3c13[_0x6447('0x47')]=qs[_0x6447('0x48')](_0x364f27[_0x6447('0x40')][_0x6447('0x48')]);_0x9c3c13[_0x6447('0x49')]=qs['filters'](_[_0x6447('0x4a')](_0x364f27['query'],_0x3c7ee7[_0x6447('0x4b')]),_0x5ab32b);if(_0x364f27[_0x6447('0x40')][_0x6447('0x4c')]){_0x9c3c13[_0x6447('0x49')]=_[_0x6447('0x4d')](_0x9c3c13[_0x6447('0x49')],{'$or':_[_0x6447('0x39')](_0x5ab32b,function(_0x51de57){if(_0x51de57[_0x6447('0x3d')]!==_0x6447('0x4e')){var _0x76054e={};_0x76054e[_0x51de57['name']]={'$like':'%'+_0x364f27[_0x6447('0x40')][_0x6447('0x4c')]+'%'};return _0x76054e;}})});}_0x9c3c13=_[_0x6447('0x4d')]({},_0x9c3c13,_0x364f27[_0x6447('0x4f')]);var _0x208c8b={'where':_0x9c3c13[_0x6447('0x49')]};return db[_0x6447('0x3a')][_0x6447('0x2d')](_0x208c8b)[_0x6447('0x1d')](function(_0x57576a){_0x4fb69c['count']=_0x57576a;if(_0x364f27[_0x6447('0x40')]['includeAll']){_0x9c3c13[_0x6447('0x50')]=[{'all':!![]}];}return db[_0x6447('0x3a')]['findAll'](_0x9c3c13);})[_0x6447('0x1d')](function(_0x121941){_0x4fb69c[_0x6447('0x51')]=_0x121941;return _0x4fb69c;})[_0x6447('0x1d')](respondWithFilteredResult(_0x3814d4,_0x9c3c13))['catch'](handleError(_0x3814d4,null));};exports[_0x6447('0x52')]=function(_0x30d55e,_0x4633c1){var _0x9a85b2={'raw':!![],'where':{'id':_0x30d55e[_0x6447('0x53')]['id']}},_0x133954={};_0x133954[_0x6447('0x3e')]=_[_0x6447('0x3f')](db['FaxMessage'][_0x6447('0x3b')]);_0x133954[_0x6447('0x40')]=_[_0x6447('0x3f')](_0x30d55e[_0x6447('0x40')]);_0x133954[_0x6447('0x4b')]=_[_0x6447('0x42')](_0x133954[_0x6447('0x3e')],_0x133954[_0x6447('0x40')]);_0x9a85b2[_0x6447('0x41')]=_[_0x6447('0x42')](_0x133954[_0x6447('0x3e')],qs[_0x6447('0x43')](_0x30d55e[_0x6447('0x40')]['fields']));_0x9a85b2[_0x6447('0x41')]=_0x9a85b2[_0x6447('0x41')][_0x6447('0x44')]?_0x9a85b2['attributes']:_0x133954['model'];if(_0x30d55e['query'][_0x6447('0x54')]){_0x9a85b2[_0x6447('0x50')]=[{'all':!![]}];}_0x9a85b2=_[_0x6447('0x4d')]({},_0x9a85b2,_0x30d55e[_0x6447('0x4f')]);return db['FaxMessage'][_0x6447('0x55')](_0x9a85b2)['then'](handleEntityNotFound(_0x4633c1,null))['then'](respondWithResult(_0x4633c1,null))[_0x6447('0x27')](handleError(_0x4633c1,null));};exports[_0x6447('0x33')]=function(_0x3ecae5,_0x3e520f){if(_0x3ecae5[_0x6447('0x56')]['id']){delete _0x3ecae5[_0x6447('0x56')]['id'];}return db[_0x6447('0x3a')][_0x6447('0x55')]({'where':{'id':_0x3ecae5[_0x6447('0x53')]['id']}})[_0x6447('0x1d')](handleEntityNotFound(_0x3e520f,null))['then'](saveUpdates(_0x3ecae5['body'],null))['then'](respondWithResult(_0x3e520f,null))[_0x6447('0x27')](handleError(_0x3e520f,null));};exports[_0x6447('0x34')]=function(_0x1debf3,_0x3ba095){return db[_0x6447('0x3a')][_0x6447('0x55')]({'where':{'id':_0x1debf3[_0x6447('0x53')]['id']}})[_0x6447('0x1d')](handleEntityNotFound(_0x3ba095,null))[_0x6447('0x1d')](removeEntity(_0x3ba095,null))[_0x6447('0x27')](handleError(_0x3ba095,null));};exports[_0x6447('0x57')]=function(_0x51ecac,_0x37d774){return db[_0x6447('0x3a')][_0x6447('0x57')]()[_0x6447('0x1d')](respondWithResult(_0x37d774,null))[_0x6447('0x27')](handleError(_0x37d774,null));};var interaction_log=require(_0x6447('0x13'))(_0x6447('0x58'));exports[_0x6447('0x59')]=function(_0x51c488,_0x24aefb,_0x4fc7b8){var _0x5624c4={'agent':{},'channel':_0x6447('0x5a')};if(_0x51c488[_0x6447('0x56')]['id']){delete _0x51c488[_0x6447('0x56')]['id'];}_0x51c488[_0x6447('0x56')][_0x6447('0x5b')]=!![];_0x51c488[_0x6447('0x56')]['readAt']=moment()[_0x6447('0x5c')](_0x6447('0x5d'));_0x51c488['body'][_0x6447('0x5e')]=_0x51c488['body'][_0x6447('0x5e')]||_0x51c488[_0x6447('0x5f')]['id'];_0x5624c4['agent']['id']=_0x51c488['body'][_0x6447('0x5e')];return db[_0x6447('0x3a')][_0x6447('0x55')]({'where':{'id':_0x51c488[_0x6447('0x53')]['id'],'UserId':null}})[_0x6447('0x1d')](handleEntityNotFound(_0x24aefb,null))[_0x6447('0x1d')](saveUpdates(_0x51c488[_0x6447('0x56')],null))[_0x6447('0x1d')](function(_0x57d5cf){if(_0x57d5cf){_0x5624c4[_0x6447('0x25')]=_0x57d5cf['get']({'plain':!![]});return db[_0x6447('0x60')][_0x6447('0x55')]({'where':{'id':_0x57d5cf[_0x6447('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x24aefb,null))['then'](function(_0x57e0f1){if(_0x57e0f1){return _0x57e0f1[_0x6447('0x33')]({'UserId':_0x51c488[_0x6447('0x56')][_0x6447('0x5e')],'read1stAt':_[_0x6447('0x62')](_0x57e0f1[_0x6447('0x63')])?moment()[_0x6447('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6447('0x1d')](function(_0x398996){if(_0x398996){_0x5624c4[_0x6447('0x64')]=_0x398996[_0x6447('0x65')]({'plain':!![]});interaction_log[_0x6447('0x1e')](_0x6447('0x66'),_0x51c488[_0x6447('0x5f')]['id'],_0x51c488[_0x6447('0x5f')][_0x6447('0x37')],_0x51c488[_0x6447('0x5f')]['role'],_0x5624c4[_0x6447('0x64')]['id'],_0x51c488['body']?JSON[_0x6447('0x22')](_0x51c488[_0x6447('0x56')]):_0x6447('0x67'));return respondWithRpcPromise(_0x6447('0x68'),_0x6447('0x69'),_0x5624c4);}return null;})['then'](function(_0xc6d5d0){var _0x353fa4=_0x6447('0x6a')+_0xc6d5d0[_0x6447('0x25')]['ContactId'];return db[_0x6447('0x6b')]['query'](_0x353fa4,{'type':db[_0x6447('0x6c')][_0x6447('0x6d')][_0x6447('0x6e')],'raw':!![]})[_0x6447('0x1d')](function(_0x1201c0){return _0x1201c0;});})[_0x6447('0x1d')](function(_0x155696){if(_0x155696){_0x5624c4['message'][_0x6447('0x6f')]=_0x155696[0x0];if(!_0x51c488[_0x6447('0x56')][_0x6447('0x5e')])return;return db[_0x6447('0x70')][_0x6447('0x55')]({'where':{'id':_0x51c488[_0x6447('0x56')][_0x6447('0x5e')],'role':'agent'},'attributes':['id',_0x6447('0x37'),_0x6447('0x71'),'email',_0x6447('0x72')],'raw':!![]});}return null;})[_0x6447('0x1d')](function(_0x10e6b6){if(!_0x10e6b6)return null;_0x5624c4[_0x6447('0x25')][_0x6447('0x73')]=_0x10e6b6;return _0x5624c4;})['then'](function(_0xcdb425){if(_0xcdb425){if(_0x51c488[_0x6447('0x56')]['manual']){_0x5624c4[_0x6447('0x25')]['interface']=util[_0x6447('0x5c')](_0x6447('0x74'),_0x51c488['user'][_0x6447('0x37')]);_0x5624c4[_0x6447('0x25')]['channel']=_0x5624c4['channel'];_0x5624c4[_0x6447('0x25')][_0x6447('0x75')]=_0x5624c4[_0x6447('0x76')];_0x5624c4[_0x6447('0x25')][_0x6447('0x77')]=_0x6447('0x59');return respondWithRpcPromise(_0x6447('0x78'),_0x6447('0x78'),{'event':_0x6447('0x79'),'message':_0x5624c4[_0x6447('0x25')]},client9002)[_0x6447('0x1d')](function(){return _0x5624c4;});}return _0x5624c4;}return null;})[_0x6447('0x1d')](respondWithResult(_0x24aefb,null))['catch'](handleError(_0x24aefb,null));};var interaction_log=require(_0x6447('0x13'))(_0x6447('0x58'));exports[_0x6447('0x31')]=function(_0x567452,_0x46f33a,_0x98e071){var _0xbdeded={'agent':{},'channel':_0x6447('0x5a')};if(_0x567452[_0x6447('0x56')]['id']){delete _0x567452[_0x6447('0x56')]['id'];}_0x567452[_0x6447('0x56')][_0x6447('0x5e')]=_0x567452['body'][_0x6447('0x5e')]||_0x567452[_0x6447('0x5f')]['id'];_0xbdeded[_0x6447('0x73')]['id']=_0x567452['body'][_0x6447('0x5e')];return db[_0x6447('0x3a')][_0x6447('0x55')]({'where':{'id':_0x567452[_0x6447('0x53')]['id'],'UserId':null}})[_0x6447('0x1d')](handleEntityNotFound(_0x46f33a,null))[_0x6447('0x1d')](function(_0x3fb7be){if(_0x3fb7be){_0xbdeded['message']=_0x3fb7be[_0x6447('0x65')]({'plain':!![]});return db[_0x6447('0x60')][_0x6447('0x55')]({'where':{'id':_0x3fb7be[_0x6447('0x61')]}});}return null;})[_0x6447('0x1d')](handleEntityNotFound(_0x46f33a,null))[_0x6447('0x1d')](function(_0x4f5ad5){if(_0x4f5ad5){_0xbdeded[_0x6447('0x64')]=_0x4f5ad5[_0x6447('0x65')]({'plain':!![]});interaction_log[_0x6447('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x567452['user']['id'],_0x567452[_0x6447('0x5f')][_0x6447('0x37')],_0x567452['user'][_0x6447('0x7a')],_0xbdeded['interaction']['id'],_0x567452[_0x6447('0x56')]?JSON[_0x6447('0x22')](_0x567452['body']):_0x6447('0x67'));return respondWithRpcPromise(_0x6447('0x7b'),_0x6447('0x7c'),_0xbdeded);}return null;})['then'](function(_0x19024a){var _0x4f1fea=_0x6447('0x6a')+_0x19024a[_0x6447('0x25')]['ContactId'];return db[_0x6447('0x6b')]['query'](_0x4f1fea,{'type':db[_0x6447('0x6c')][_0x6447('0x6d')][_0x6447('0x6e')],'raw':!![]})[_0x6447('0x1d')](function(_0x12c60c){return _0x12c60c;});})[_0x6447('0x1d')](function(_0x25e8bf){if(_0x25e8bf){_0xbdeded[_0x6447('0x25')]['contact']=_0x25e8bf[0x0];if(!_0x567452[_0x6447('0x56')]['UserId'])return;return db['User']['find']({'where':{'id':_0x567452[_0x6447('0x56')][_0x6447('0x5e')],'role':_0x6447('0x73')},'attributes':['id',_0x6447('0x37'),_0x6447('0x71'),'email',_0x6447('0x72')],'raw':!![]});}return null;})['then'](function(_0x375b5d){if(!_0x375b5d)return null;_0xbdeded[_0x6447('0x25')][_0x6447('0x73')]=_0x375b5d;return _0xbdeded;})['then'](function(_0x451b23){if(_0x451b23){_0x451b23['message']['interface']=util[_0x6447('0x5c')](_0x6447('0x74'),_0x567452[_0x6447('0x5f')][_0x6447('0x37')]);_0x451b23[_0x6447('0x25')][_0x6447('0x76')]=_0xbdeded[_0x6447('0x76')];_0x451b23[_0x6447('0x25')][_0x6447('0x75')]=_0xbdeded[_0x6447('0x76')];_0x451b23[_0x6447('0x25')][_0x6447('0x77')]=_0x6447('0x31');respondWithRpcPromise(_0x6447('0x78'),'EventManager',{'event':'rejectmessage','message':_0x451b23[_0x6447('0x25')]},client9002);return _0xbdeded;}return null;})[_0x6447('0x1d')](respondWithResult(_0x46f33a,null))[_0x6447('0x27')](handleError(_0x46f33a,null));};exports[_0x6447('0x7d')]=function(_0x5403b8,_0x16e78a){var _0x15b4e9;return db[_0x6447('0x3a')][_0x6447('0x7d')](_0x5403b8[_0x6447('0x56')],{})[_0x6447('0x1d')](function(_0x27559a){_0x15b4e9=_0x27559a;return db['CmContact'][_0x6447('0x7e')]({'where':{'id':_0x15b4e9[_0x6447('0x7f')]}});})[_0x6447('0x1d')](function(_0x48c3c2){if(_[_0x6447('0x62')](_0x48c3c2)){return;}else{_0x15b4e9[_0x6447('0x5a')]=_0x48c3c2[_0x6447('0x5a')];return db[_0x6447('0x80')][_0x6447('0x7e')]({'where':{'id':_0x15b4e9[_0x6447('0x81')]}});}})['then'](function(_0x4bfdb5){return respondWithRpcPromise(_0x6447('0x82'),_0x6447('0x82'),{'FaxAccountId':_[_0x6447('0x62')](_0x5403b8[_0x6447('0x56')])?undefined:_0x5403b8[_0x6447('0x56')][_0x6447('0x83')],'path':_[_0x6447('0x62')](_0x4bfdb5)?undefined:util[_0x6447('0x5c')](_0x6447('0x84'),_0x4bfdb5['basename']),'fax':_[_0x6447('0x62')](_0x15b4e9[_0x6447('0x5a')])?undefined:_0x15b4e9[_0x6447('0x5a')],'AttachmentId':_0x15b4e9['AttachmentId']},client9002);})[_0x6447('0x1d')](respondWithResult(_0x16e78a,0xc9))[_0x6447('0x27')](handleError(_0x16e78a,null));};exports[_0x6447('0x85')]=function(_0x13bf24,_0x1719ea){var _0x31b80b=path[_0x6447('0x86')](config['root'],_0x6447('0x87'),'files',_0x6447('0x88'));return db[_0x6447('0x3a')][_0x6447('0x55')]({'where':{'id':_0x13bf24[_0x6447('0x53')]['id']},'include':[{'model':db[_0x6447('0x80')],'as':'Attachment'}]})[_0x6447('0x1d')](handleEntityNotFound(_0x1719ea,null))[_0x6447('0x1d')](function(_0x495bae){if(_0x495bae){return _0x1719ea[_0x6447('0x85')](path[_0x6447('0x86')](_0x31b80b,_0x495bae['Attachment'][_0x6447('0x89')]));}})['catch'](handleError(_0x1719ea,null));}; \ No newline at end of file +var _0x31da=['sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','include','find','update','body','destroy','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','user','role','ContactId','sequelize','Sequelize','contact','agent','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','User','motionChannel','rejectmessage','create','findOne','fax','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','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','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','status','end','undefined','count','offset','limit','set','json','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31da,0x16d));var _0xa31d=function(_0x5afacf,_0x3c8414){_0x5afacf=_0x5afacf-0x0;var _0x3e2c16=_0x31da[_0x5afacf];return _0x3e2c16;};'use strict';var emlformat=require(_0xa31d('0x0'));var rimraf=require(_0xa31d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa31d('0x2'));var rp=require(_0xa31d('0x3'));var moment=require(_0xa31d('0x4'));var BPromise=require(_0xa31d('0x5'));var Mustache=require('mustache');var util=require(_0xa31d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa31d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa31d('0x8'));var crypto=require(_0xa31d('0x9'));var jsforce=require(_0xa31d('0xa'));var deskjs=require(_0xa31d('0xb'));var toCsv=require(_0xa31d('0xc'));var querystring=require('querystring');var Papa=require(_0xa31d('0xd'));var Redis=require(_0xa31d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa31d('0xf'));var as=require(_0xa31d('0x10'));var hardwareService=require(_0xa31d('0x11'));var logger=require(_0xa31d('0x12'))('api');var utils=require(_0xa31d('0x13'));var config=require(_0xa31d('0x14'));var licenseUtil=require(_0xa31d('0x15'));var db=require(_0xa31d('0x16'))['db'];config[_0xa31d('0x17')]=_[_0xa31d('0x18')](config['redis'],{'host':_0xa31d('0x19'),'port':0x18eb});var socket=require(_0xa31d('0x1a'))(new Redis(config[_0xa31d('0x17')]));require(_0xa31d('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa31d('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xa31d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x11a6e0,_0x552729,_0x1c99d5,_0x51553b){return new BPromise(function(_0x1d5bec,_0x344e82){var _0x2d28fc=_0x51553b||client;return _0x2d28fc[_0xa31d('0x1d')](_0x11a6e0,_0x1c99d5)[_0xa31d('0x1e')](function(_0x4826d4){logger[_0xa31d('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x552729,'request\x20sent');logger[_0xa31d('0x20')](_0xa31d('0x21'),_0x552729,_0xa31d('0x22'),JSON[_0xa31d('0x23')](_0x4826d4));if(_0x4826d4[_0xa31d('0x24')]){if(_0x4826d4[_0xa31d('0x24')][_0xa31d('0x25')]===0x1f4){logger[_0xa31d('0x24')](_0xa31d('0x26'),_0x552729,_0x4826d4[_0xa31d('0x24')][_0xa31d('0x27')]);return _0x344e82(_0x4826d4[_0xa31d('0x24')][_0xa31d('0x27')]);}logger[_0xa31d('0x24')](_0xa31d('0x26'),_0x552729,_0x4826d4['error'][_0xa31d('0x27')]);return _0x1d5bec(_0x4826d4[_0xa31d('0x24')][_0xa31d('0x27')]);}else{logger[_0xa31d('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x552729,_0xa31d('0x22'));_0x1d5bec(_0x4826d4[_0xa31d('0x28')][_0xa31d('0x27')]);}})[_0xa31d('0x29')](function(_0x23a819){logger[_0xa31d('0x24')](_0xa31d('0x26'),_0x552729,_0x23a819);_0x344e82(_0x23a819);});});}function respondWithStatusCode(_0x259244,_0x849ea9){_0x849ea9=_0x849ea9||0xcc;return function(_0x2927cb){if(_0x2927cb){return _0x259244['sendStatus'](_0x849ea9);}return _0x259244[_0xa31d('0x2a')](_0x849ea9)[_0xa31d('0x2b')]();};}function respondWithResult(_0x290361,_0x4b314c){_0x4b314c=_0x4b314c||0xc8;return function(_0xf87188){if(_0xf87188){return _0x290361[_0xa31d('0x2a')](_0x4b314c)['json'](_0xf87188);}};}function respondWithFilteredResult(_0x152441,_0x229489){return function(_0x210902){if(_0x210902){var _0x3946ba=typeof _0x229489['offset']===_0xa31d('0x2c')&&typeof _0x229489['limit']==='undefined';var _0x4afe32=_0x210902[_0xa31d('0x2d')];var _0x3fc15a=_0x3946ba?0x0:_0x229489[_0xa31d('0x2e')];var _0x465a96=_0x3946ba?_0x210902['count']:_0x229489[_0xa31d('0x2e')]+_0x229489[_0xa31d('0x2f')];var _0x36d074;if(_0x465a96>=_0x4afe32){_0x465a96=_0x4afe32;_0x36d074=0xc8;}else{_0x36d074=0xce;}_0x152441[_0xa31d('0x2a')](_0x36d074);return _0x152441[_0xa31d('0x30')]('Content-Range',_0x3fc15a+'-'+_0x465a96+'/'+_0x4afe32)[_0xa31d('0x31')](_0x210902);}return null;};}function patchUpdates(_0x2e428b){return function(_0x1000dc){try{jsonpatch[_0xa31d('0x32')](_0x1000dc,_0x2e428b,!![]);}catch(_0x4ed92){return BPromise[_0xa31d('0x33')](_0x4ed92);}return _0x1000dc['save']();};}function saveUpdates(_0x1d2fdf,_0x2b6346){return function(_0x4c7c78){if(_0x4c7c78){return _0x4c7c78['update'](_0x1d2fdf)[_0xa31d('0x1e')](function(_0x5cb35c){return _0x5cb35c;});}return null;};}function removeEntity(_0x3794db,_0x2da1b6){return function(_0x310207){if(_0x310207){return _0x310207['destroy']()['then'](function(){_0x3794db[_0xa31d('0x2a')](0xcc)[_0xa31d('0x2b')]();});}};}function handleEntityNotFound(_0x4529ab,_0x55136a){return function(_0x11e788){if(!_0x11e788){_0x4529ab[_0xa31d('0x34')](0x194);}return _0x11e788;};}function handleError(_0x4fc722,_0x1309bb){_0x1309bb=_0x1309bb||0x1f4;return function(_0x1daf6a){logger[_0xa31d('0x24')](_0x1daf6a[_0xa31d('0x35')]);if(_0x1daf6a[_0xa31d('0x36')]){delete _0x1daf6a[_0xa31d('0x36')];}_0x4fc722[_0xa31d('0x2a')](_0x1309bb)[_0xa31d('0x37')](_0x1daf6a);};}exports[_0xa31d('0x38')]=function(_0x307ba9,_0x5899f6){var _0x57dfe1={},_0x2438ca={},_0x412328={'count':0x0,'rows':[]};var _0x5f1640=_[_0xa31d('0x39')](db[_0xa31d('0x3a')][_0xa31d('0x3b')],function(_0x55539e){return{'name':_0x55539e[_0xa31d('0x3c')],'type':_0x55539e[_0xa31d('0x3d')][_0xa31d('0x3e')]};});_0x2438ca[_0xa31d('0x3f')]=_[_0xa31d('0x39')](_0x5f1640,'name');_0x2438ca[_0xa31d('0x40')]=_['keys'](_0x307ba9[_0xa31d('0x40')]);_0x2438ca[_0xa31d('0x41')]=_[_0xa31d('0x42')](_0x2438ca[_0xa31d('0x3f')],_0x2438ca[_0xa31d('0x40')]);_0x57dfe1[_0xa31d('0x43')]=_[_0xa31d('0x42')](_0x2438ca[_0xa31d('0x3f')],qs[_0xa31d('0x44')](_0x307ba9[_0xa31d('0x40')][_0xa31d('0x44')]));_0x57dfe1[_0xa31d('0x43')]=_0x57dfe1[_0xa31d('0x43')][_0xa31d('0x45')]?_0x57dfe1[_0xa31d('0x43')]:_0x2438ca[_0xa31d('0x3f')];if(!_0x307ba9[_0xa31d('0x40')]['hasOwnProperty'](_0xa31d('0x46'))){_0x57dfe1[_0xa31d('0x2f')]=qs[_0xa31d('0x2f')](_0x307ba9['query'][_0xa31d('0x2f')]);_0x57dfe1['offset']=qs[_0xa31d('0x2e')](_0x307ba9[_0xa31d('0x40')]['offset']);}_0x57dfe1['order']=qs[_0xa31d('0x47')](_0x307ba9[_0xa31d('0x40')][_0xa31d('0x47')]);_0x57dfe1[_0xa31d('0x48')]=qs['filters'](_[_0xa31d('0x49')](_0x307ba9['query'],_0x2438ca[_0xa31d('0x41')]),_0x5f1640);if(_0x307ba9['query']['filter']){_0x57dfe1['where']=_[_0xa31d('0x4a')](_0x57dfe1[_0xa31d('0x48')],{'$or':_[_0xa31d('0x39')](_0x5f1640,function(_0x28a098){if(_0x28a098['type']!==_0xa31d('0x4b')){var _0x38bb26={};_0x38bb26[_0x28a098[_0xa31d('0x36')]]={'$like':'%'+_0x307ba9[_0xa31d('0x40')][_0xa31d('0x4c')]+'%'};return _0x38bb26;}})});}_0x57dfe1=_['merge']({},_0x57dfe1,_0x307ba9[_0xa31d('0x4d')]);var _0x54bb7a={'where':_0x57dfe1[_0xa31d('0x48')]};return db[_0xa31d('0x3a')]['count'](_0x54bb7a)[_0xa31d('0x1e')](function(_0x543e10){_0x412328['count']=_0x543e10;if(_0x307ba9['query'][_0xa31d('0x4e')]){_0x57dfe1['include']=[{'all':!![]}];}return db[_0xa31d('0x3a')][_0xa31d('0x4f')](_0x57dfe1);})[_0xa31d('0x1e')](function(_0x2928cc){_0x412328[_0xa31d('0x50')]=_0x2928cc;return _0x412328;})[_0xa31d('0x1e')](respondWithFilteredResult(_0x5899f6,_0x57dfe1))['catch'](handleError(_0x5899f6,null));};exports['show']=function(_0x3550a0,_0x6b118a){var _0x3f645a={'raw':!![],'where':{'id':_0x3550a0[_0xa31d('0x51')]['id']}},_0x526c31={};_0x526c31[_0xa31d('0x3f')]=_['keys'](db[_0xa31d('0x3a')][_0xa31d('0x3b')]);_0x526c31['query']=_[_0xa31d('0x52')](_0x3550a0[_0xa31d('0x40')]);_0x526c31['filters']=_[_0xa31d('0x42')](_0x526c31[_0xa31d('0x3f')],_0x526c31['query']);_0x3f645a[_0xa31d('0x43')]=_[_0xa31d('0x42')](_0x526c31[_0xa31d('0x3f')],qs['fields'](_0x3550a0[_0xa31d('0x40')]['fields']));_0x3f645a['attributes']=_0x3f645a[_0xa31d('0x43')][_0xa31d('0x45')]?_0x3f645a[_0xa31d('0x43')]:_0x526c31[_0xa31d('0x3f')];if(_0x3550a0[_0xa31d('0x40')][_0xa31d('0x4e')]){_0x3f645a[_0xa31d('0x53')]=[{'all':!![]}];}_0x3f645a=_['merge']({},_0x3f645a,_0x3550a0[_0xa31d('0x4d')]);return db['FaxMessage'][_0xa31d('0x54')](_0x3f645a)[_0xa31d('0x1e')](handleEntityNotFound(_0x6b118a,null))[_0xa31d('0x1e')](respondWithResult(_0x6b118a,null))['catch'](handleError(_0x6b118a,null));};exports[_0xa31d('0x55')]=function(_0x1c1b04,_0xf73773){if(_0x1c1b04[_0xa31d('0x56')]['id']){delete _0x1c1b04[_0xa31d('0x56')]['id'];}return db[_0xa31d('0x3a')][_0xa31d('0x54')]({'where':{'id':_0x1c1b04[_0xa31d('0x51')]['id']}})[_0xa31d('0x1e')](handleEntityNotFound(_0xf73773,null))[_0xa31d('0x1e')](saveUpdates(_0x1c1b04[_0xa31d('0x56')],null))[_0xa31d('0x1e')](respondWithResult(_0xf73773,null))['catch'](handleError(_0xf73773,null));};exports[_0xa31d('0x57')]=function(_0x2ca506,_0x15731d){return db[_0xa31d('0x3a')][_0xa31d('0x54')]({'where':{'id':_0x2ca506[_0xa31d('0x51')]['id']}})[_0xa31d('0x1e')](handleEntityNotFound(_0x15731d,null))['then'](removeEntity(_0x15731d,null))[_0xa31d('0x29')](handleError(_0x15731d,null));};exports['describe']=function(_0x448463,_0x4414dc){return db[_0xa31d('0x3a')][_0xa31d('0x58')]()[_0xa31d('0x1e')](respondWithResult(_0x4414dc,null))[_0xa31d('0x29')](handleError(_0x4414dc,null));};var interaction_log=require('../../config/logger')(_0xa31d('0x59'));exports[_0xa31d('0x5a')]=function(_0x4b4c78,_0x48aa26,_0x9fb00){var _0x49ac64={'agent':{},'channel':'fax'};if(_0x4b4c78['body']['id']){delete _0x4b4c78['body']['id'];}_0x4b4c78['body'][_0xa31d('0x5b')]=!![];_0x4b4c78[_0xa31d('0x56')]['readAt']=moment()[_0xa31d('0x5c')](_0xa31d('0x5d'));_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x5e')]=_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x5e')]||_0x4b4c78['user']['id'];_0x49ac64['agent']['id']=_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x5e')];return db[_0xa31d('0x3a')]['find']({'where':{'id':_0x4b4c78['params']['id'],'UserId':null}})[_0xa31d('0x1e')](handleEntityNotFound(_0x48aa26,null))[_0xa31d('0x1e')](saveUpdates(_0x4b4c78[_0xa31d('0x56')],null))['then'](function(_0x5d90fc){if(_0x5d90fc){_0x49ac64['message']=_0x5d90fc[_0xa31d('0x5f')]({'plain':!![]});return db[_0xa31d('0x60')][_0xa31d('0x54')]({'where':{'id':_0x5d90fc[_0xa31d('0x61')]}});}return null;})[_0xa31d('0x1e')](handleEntityNotFound(_0x48aa26,null))[_0xa31d('0x1e')](function(_0x9407fc){if(_0x9407fc){return _0x9407fc['update']({'UserId':_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x5e')],'read1stAt':_[_0xa31d('0x62')](_0x9407fc[_0xa31d('0x63')])?moment()['format'](_0xa31d('0x5d')):undefined});}return null;})[_0xa31d('0x1e')](function(_0x251d6b){if(_0x251d6b){_0x49ac64['interaction']=_0x251d6b[_0xa31d('0x5f')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b4c78[_0xa31d('0x64')]['id'],_0x4b4c78[_0xa31d('0x64')][_0xa31d('0x36')],_0x4b4c78[_0xa31d('0x64')][_0xa31d('0x65')],_0x49ac64['interaction']['id'],_0x4b4c78[_0xa31d('0x56')]?JSON[_0xa31d('0x23')](_0x4b4c78[_0xa31d('0x56')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x49ac64);}return null;})[_0xa31d('0x1e')](function(_0x48559c){var _0x2d43c0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x48559c['message'][_0xa31d('0x66')];return db[_0xa31d('0x67')]['query'](_0x2d43c0,{'type':db[_0xa31d('0x68')]['QueryTypes']['SELECT'],'raw':!![]})[_0xa31d('0x1e')](function(_0x380bac){return _0x380bac;});})[_0xa31d('0x1e')](function(_0x41b42d){if(_0x41b42d){_0x49ac64[_0xa31d('0x27')][_0xa31d('0x69')]=_0x41b42d[0x0];if(!_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x5e')])return;return db['User'][_0xa31d('0x54')]({'where':{'id':_0x4b4c78['body']['UserId'],'role':_0xa31d('0x6a')},'attributes':['id',_0xa31d('0x36'),_0xa31d('0x6b'),_0xa31d('0x6c'),'internal'],'raw':!![]});}return null;})[_0xa31d('0x1e')](function(_0x1f42bc){if(!_0x1f42bc)return null;_0x49ac64['message'][_0xa31d('0x6a')]=_0x1f42bc;return _0x49ac64;})[_0xa31d('0x1e')](function(_0x3532a2){if(_0x3532a2){if(_0x4b4c78[_0xa31d('0x56')][_0xa31d('0x6d')]){_0x49ac64['message'][_0xa31d('0x6e')]=util[_0xa31d('0x5c')](_0xa31d('0x6f'),_0x4b4c78[_0xa31d('0x64')][_0xa31d('0x36')]);_0x49ac64['message'][_0xa31d('0x70')]=_0x49ac64[_0xa31d('0x70')];_0x49ac64[_0xa31d('0x27')]['motionChannel']=_0x49ac64['channel'];_0x49ac64[_0xa31d('0x27')][_0xa31d('0x71')]=_0xa31d('0x5a');return respondWithRpcPromise(_0xa31d('0x72'),_0xa31d('0x72'),{'event':_0xa31d('0x73'),'message':_0x49ac64[_0xa31d('0x27')]},client9002)[_0xa31d('0x1e')](function(){return _0x49ac64;});}return _0x49ac64;}return null;})[_0xa31d('0x1e')](respondWithResult(_0x48aa26,null))[_0xa31d('0x29')](handleError(_0x48aa26,null));};var interaction_log=require(_0xa31d('0x12'))(_0xa31d('0x59'));exports['reject']=function(_0x354059,_0x3bac95,_0x38d139){var _0x33df95={'agent':{},'channel':'fax'};if(_0x354059[_0xa31d('0x56')]['id']){delete _0x354059['body']['id'];}_0x354059[_0xa31d('0x56')][_0xa31d('0x5e')]=_0x354059[_0xa31d('0x56')][_0xa31d('0x5e')]||_0x354059[_0xa31d('0x64')]['id'];_0x33df95['agent']['id']=_0x354059['body'][_0xa31d('0x5e')];return db['FaxMessage'][_0xa31d('0x54')]({'where':{'id':_0x354059[_0xa31d('0x51')]['id'],'UserId':null}})[_0xa31d('0x1e')](handleEntityNotFound(_0x3bac95,null))[_0xa31d('0x1e')](function(_0x48472b){if(_0x48472b){_0x33df95[_0xa31d('0x27')]=_0x48472b['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x48472b[_0xa31d('0x61')]}});}return null;})[_0xa31d('0x1e')](handleEntityNotFound(_0x3bac95,null))[_0xa31d('0x1e')](function(_0x469d64){if(_0x469d64){_0x33df95[_0xa31d('0x74')]=_0x469d64[_0xa31d('0x5f')]({'plain':!![]});interaction_log[_0xa31d('0x1f')](_0xa31d('0x75'),_0x354059[_0xa31d('0x64')]['id'],_0x354059[_0xa31d('0x64')][_0xa31d('0x36')],_0x354059[_0xa31d('0x64')][_0xa31d('0x65')],_0x33df95[_0xa31d('0x74')]['id'],_0x354059[_0xa31d('0x56')]?JSON['stringify'](_0x354059[_0xa31d('0x56')]):_0xa31d('0x76'));return respondWithRpcPromise('RejectMessage',_0xa31d('0x77'),_0x33df95);}return null;})[_0xa31d('0x1e')](function(_0x5e6df1){var _0x19cf23=_0xa31d('0x78')+_0x5e6df1['message'][_0xa31d('0x66')];return db[_0xa31d('0x67')]['query'](_0x19cf23,{'type':db[_0xa31d('0x68')][_0xa31d('0x79')][_0xa31d('0x7a')],'raw':!![]})[_0xa31d('0x1e')](function(_0x2594c1){return _0x2594c1;});})[_0xa31d('0x1e')](function(_0x215d41){if(_0x215d41){_0x33df95[_0xa31d('0x27')][_0xa31d('0x69')]=_0x215d41[0x0];if(!_0x354059[_0xa31d('0x56')]['UserId'])return;return db[_0xa31d('0x7b')][_0xa31d('0x54')]({'where':{'id':_0x354059[_0xa31d('0x56')][_0xa31d('0x5e')],'role':_0xa31d('0x6a')},'attributes':['id','name',_0xa31d('0x6b'),_0xa31d('0x6c'),'internal'],'raw':!![]});}return null;})[_0xa31d('0x1e')](function(_0x2149e9){if(!_0x2149e9)return null;_0x33df95[_0xa31d('0x27')][_0xa31d('0x6a')]=_0x2149e9;return _0x33df95;})[_0xa31d('0x1e')](function(_0x2dba68){if(_0x2dba68){_0x2dba68[_0xa31d('0x27')][_0xa31d('0x6e')]=util[_0xa31d('0x5c')](_0xa31d('0x6f'),_0x354059[_0xa31d('0x64')][_0xa31d('0x36')]);_0x2dba68[_0xa31d('0x27')][_0xa31d('0x70')]=_0x33df95[_0xa31d('0x70')];_0x2dba68[_0xa31d('0x27')][_0xa31d('0x7c')]=_0x33df95['channel'];_0x2dba68[_0xa31d('0x27')]['event']=_0xa31d('0x33');respondWithRpcPromise(_0xa31d('0x72'),'EventManager',{'event':_0xa31d('0x7d'),'message':_0x2dba68[_0xa31d('0x27')]},client9002);return _0x33df95;}return null;})[_0xa31d('0x1e')](respondWithResult(_0x3bac95,null))['catch'](handleError(_0x3bac95,null));};exports[_0xa31d('0x7e')]=function(_0x4ef40a,_0xda9a0b){var _0x262659;return db['FaxMessage'][_0xa31d('0x7e')](_0x4ef40a[_0xa31d('0x56')],{})[_0xa31d('0x1e')](function(_0x5d8208){_0x262659=_0x5d8208;return db['CmContact'][_0xa31d('0x7f')]({'where':{'id':_0x262659[_0xa31d('0x66')]}});})[_0xa31d('0x1e')](function(_0x5156f1){if(_[_0xa31d('0x62')](_0x5156f1)){return;}else{_0x262659[_0xa31d('0x80')]=_0x5156f1[_0xa31d('0x80')];return db[_0xa31d('0x81')][_0xa31d('0x7f')]({'where':{'id':_0x262659[_0xa31d('0x82')]}});}})[_0xa31d('0x1e')](function(_0x5cabc4){return respondWithRpcPromise(_0xa31d('0x83'),_0xa31d('0x83'),{'FaxAccountId':_[_0xa31d('0x62')](_0x4ef40a[_0xa31d('0x56')])?undefined:_0x4ef40a[_0xa31d('0x56')][_0xa31d('0x84')],'path':_[_0xa31d('0x62')](_0x5cabc4)?undefined:util['format'](_0xa31d('0x85'),_0x5cabc4[_0xa31d('0x86')]),'fax':_[_0xa31d('0x62')](_0x262659[_0xa31d('0x80')])?undefined:_0x262659[_0xa31d('0x80')],'AttachmentId':_0x262659['AttachmentId']},client9002);})[_0xa31d('0x1e')](respondWithResult(_0xda9a0b,0xc9))[_0xa31d('0x29')](handleError(_0xda9a0b,null));};exports[_0xa31d('0x87')]=function(_0x4477c3,_0x537a74){var _0x18a5ba=path[_0xa31d('0x88')](config[_0xa31d('0x89')],_0xa31d('0x8a'),'files','attachments');return db[_0xa31d('0x3a')]['find']({'where':{'id':_0x4477c3[_0xa31d('0x51')]['id']},'include':[{'model':db[_0xa31d('0x81')],'as':_0xa31d('0x81')}]})[_0xa31d('0x1e')](handleEntityNotFound(_0x537a74,null))[_0xa31d('0x1e')](function(_0x67838f){if(_0x67838f){return _0x537a74['download'](path[_0xa31d('0x88')](_0x18a5ba,_0x67838f[_0xa31d('0x81')][_0xa31d('0x86')]));}})[_0xa31d('0x29')](handleError(_0x537a74,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 79cb586..464c650 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 _0xe9ef=['events','FaxMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x211af2,_0x1cc8ae){var _0x1bbe2f=function(_0x549d84){while(--_0x549d84){_0x211af2['push'](_0x211af2['shift']());}};_0x1bbe2f(++_0x1cc8ae);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xe9ef[_0x48999d];return _0x1ad0d1;};'use strict';var EventEmitter=require(_0xfe9e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xfe9e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xfe9e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23904d){return function(_0x45bf15,_0x199f65,_0x20d75f){FaxMessageEvents['emit'](_0x23904d+':'+_0x45bf15['id'],_0x45bf15);FaxMessageEvents[_0xfe9e('0x4')](_0x23904d,_0x45bf15);_0x20d75f(null);};}for(var e in events){if(events[_0xfe9e('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xae35=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x505e11,_0x23c698){var _0x42fc5d=function(_0x2fee57){while(--_0x2fee57){_0x505e11['push'](_0x505e11['shift']());}};_0x42fc5d(++_0x23c698);}(_0xae35,0x172));var _0x5ae3=function(_0xbea29f,_0x382951){_0xbea29f=_0xbea29f-0x0;var _0x5afec6=_0xae35[_0xbea29f];return _0x5afec6;};'use strict';var EventEmitter=require(_0x5ae3('0x0'));var FaxMessage=require(_0x5ae3('0x1'))['db'][_0x5ae3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5ae3('0x3')](0x0);var events={'afterCreate':_0x5ae3('0x4'),'afterUpdate':_0x5ae3('0x5'),'afterDestroy':_0x5ae3('0x6')};function emitEvent(_0x39d9b7){return function(_0x54c0f2,_0x6dffe3,_0x4d1536){FaxMessageEvents[_0x5ae3('0x7')](_0x39d9b7+':'+_0x54c0f2['id'],_0x54c0f2);FaxMessageEvents[_0x5ae3('0x7')](_0x39d9b7,_0x54c0f2);_0x4d1536(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x5ae3('0x8')](e,emitEvent(event));}}module[_0x5ae3('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4093683..f07e914 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 _0x31bc=['update','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','fti_fax_messages','body','direction','out','isNil','UserId','findOne','then'];(function(_0x3ab8ec,_0x413c80){var _0x42801d=function(_0x3add67){while(--_0x3add67){_0x3ab8ec['push'](_0x3ab8ec['shift']());}};_0x42801d(++_0x413c80);}(_0x31bc,0x90));var _0xc31b=function(_0x3095c7,_0x4a7663){_0x3095c7=_0x3095c7-0x0;var _0x4c678c=_0x31bc[_0x3095c7];return _0x4c678c;};'use strict';var _=require(_0xc31b('0x0'));var util=require(_0xc31b('0x1'));var logger=require(_0xc31b('0x2'))(_0xc31b('0x3'));var moment=require('moment');var BPromise=require(_0xc31b('0x4'));var rp=require(_0xc31b('0x5'));var fs=require('fs');var path=require(_0xc31b('0x6'));var rimraf=require('rimraf');var config=require(_0xc31b('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x2c9e14,_0x4b168a){return _0x2c9e14[_0xc31b('0x8')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xc31b('0x9'),'fields':[_0xc31b('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33a2bb,_0x4a4d21,_0x4b3ece){var _0x352c83=_0x2c9e14['models'];var _0x3ff12c=_0x33a2bb['get']({'plain':!![]});if(_0x3ff12c[_0xc31b('0xb')]['toLowerCase']()==='in'||_0x3ff12c[_0xc31b('0xb')]['toLowerCase']()===_0xc31b('0xc')&&!_0x3ff12c['secret']&&!_[_0xc31b('0xd')](_0x3ff12c[_0xc31b('0xe')])){_0x352c83['FaxInteraction'][_0xc31b('0xf')]({'where':{'id':_0x3ff12c['FaxInteractionId']}})[_0xc31b('0x10')](function(_0x15d0ee){if(_0x15d0ee){_0x15d0ee[_0xc31b('0x11')]({'lastMsgAt':_0x3ff12c[_0xc31b('0x12')],'lastMsgDirection':_0x3ff12c[_0xc31b('0xb')][_0xc31b('0x13')]()});}})['catch'](function(_0x392a45){console[_0xc31b('0x14')](_0x392a45);});}_0x4b3ece();}},'charset':_0xc31b('0x15'),'collate':_0xc31b('0x16')});}; \ No newline at end of file +var _0x3ce5=['error','utf8mb4_unicode_ci','lodash','util','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','FaxInteraction','FaxInteractionId','then','update','catch'];(function(_0x3755a2,_0x5be61e){var _0x2df8e4=function(_0x316bae){while(--_0x316bae){_0x3755a2['push'](_0x3755a2['shift']());}};_0x2df8e4(++_0x5be61e);}(_0x3ce5,0xd2));var _0x53ce=function(_0x23767e,_0x2c4870){_0x23767e=_0x23767e-0x0;var _0x35df32=_0x3ce5[_0x23767e];return _0x35df32;};'use strict';var _=require(_0x53ce('0x0'));var util=require(_0x53ce('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53ce('0x2'));var rimraf=require(_0x53ce('0x3'));var config=require(_0x53ce('0x4'));var attributes=require(_0x53ce('0x5'));module[_0x53ce('0x6')]=function(_0x2f78e9,_0x44e7a7){return _0x2f78e9[_0x53ce('0x7')](_0x53ce('0x8'),attributes,{'tableName':_0x53ce('0x9'),'paranoid':![],'indexes':[{'name':_0x53ce('0xa'),'fields':[_0x53ce('0xb')],'type':_0x53ce('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5af1f2,_0x3d10fb,_0x1d903b){var _0x346a3d=_0x2f78e9[_0x53ce('0xd')];var _0x48c185=_0x5af1f2[_0x53ce('0xe')]({'plain':!![]});if(_0x48c185[_0x53ce('0xf')][_0x53ce('0x10')]()==='in'||_0x48c185[_0x53ce('0xf')]['toLowerCase']()===_0x53ce('0x11')&&!_0x48c185['secret']&&!_[_0x53ce('0x12')](_0x48c185['UserId'])){_0x346a3d[_0x53ce('0x13')]['findOne']({'where':{'id':_0x48c185[_0x53ce('0x14')]}})[_0x53ce('0x15')](function(_0x581f9f){if(_0x581f9f){_0x581f9f[_0x53ce('0x16')]({'lastMsgAt':_0x48c185['createdAt'],'lastMsgDirection':_0x48c185[_0x53ce('0xf')][_0x53ce('0x10')]()});}})[_0x53ce('0x17')](function(_0x1ae7b5){console[_0x53ce('0x18')](_0x1ae7b5);});}_0x1d903b();}},'charset':'utf8mb4','collate':_0x53ce('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 08608a9..0a58514 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 _0xedd9=['create','body','raw','CreateFaxMessage','catch','FaxMessage','update','options','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x98262,_0x3e7abd){var _0x3cd546=function(_0x22b318){while(--_0x22b318){_0x98262['push'](_0x98262['shift']());}};_0x3cd546(++_0x3e7abd);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d2b17,_0x4c9f74){_0x5d2b17=_0x5d2b17-0x0;var _0x4b5305=_0xedd9[_0x5d2b17];return _0x4b5305;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});config['redis']=_[_0x9edd('0xc')](config['redis'],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xf')]));require(_0x9edd('0x10'))['register'](socket);function respondWithRpcPromise(_0x494a24,_0x5d2f90,_0x2076fc){return new BPromise(function(_0x138767,_0x523026){return client[_0x9edd('0x11')](_0x494a24,_0x2076fc)[_0x9edd('0x12')](function(_0x5b6c00){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x5d2f90,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x5b6c00));if(_0x5b6c00[_0x9edd('0x19')]){if(_0x5b6c00['error'][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')](_0x9edd('0x14'),_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x523026(_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);}logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x138767(_0x5b6c00[_0x9edd('0x19')]['message']);}else{logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));_0x138767(_0x5b6c00['result'][_0x9edd('0x1b')]);}})['catch'](function(_0x2cdcef){logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x2cdcef);_0x523026(_0x2cdcef);});});}exports['CreateFaxMessage']=function(_0x45c3ab){var _0x50338f=this;return new Promise(function(_0x27a95a,_0x54a03f){return db['FaxMessage'][_0x9edd('0x1c')](_0x45c3ab[_0x9edd('0x1d')],{'raw':_0x45c3ab['options']?_0x45c3ab['options'][_0x9edd('0x1e')]===undefined?!![]:![]:!![]})[_0x9edd('0x12')](function(_0x477878){logger['info'](_0x9edd('0x1f'),_0x45c3ab);logger[_0x9edd('0x16')](_0x9edd('0x1f'),_0x45c3ab,JSON[_0x9edd('0x18')](_0x477878));_0x27a95a(_0x477878);})[_0x9edd('0x20')](function(_0x4c75d2){logger[_0x9edd('0x19')](_0x9edd('0x1f'),_0x4c75d2[_0x9edd('0x1b')],_0x45c3ab);_0x54a03f(_0x50338f[_0x9edd('0x19')](0x1f4,_0x4c75d2[_0x9edd('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x4b3d1b){var _0x3276ee=this;return new Promise(function(_0xfeca7b,_0x8d67aa){return db[_0x9edd('0x21')][_0x9edd('0x22')](_0x4b3d1b['body'],{'raw':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b['options'][_0x9edd('0x24')]||null:null,'attributes':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x25')]||null:null,'limit':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x26')]||null:null})[_0x9edd('0x12')](function(_0x12c1bc){logger[_0x9edd('0x13')](_0x9edd('0x27'),_0x4b3d1b);logger[_0x9edd('0x16')](_0x9edd('0x27'),_0x4b3d1b,JSON[_0x9edd('0x18')](_0x12c1bc));_0xfeca7b(_0x12c1bc);})[_0x9edd('0x20')](function(_0x4fd03f){logger[_0x9edd('0x19')](_0x9edd('0x27'),_0x4fd03f[_0x9edd('0x1b')],_0x4b3d1b);_0x8d67aa(_0x3276ee[_0x9edd('0x19')](0x1f4,_0x4fd03f['message']));});});}; \ No newline at end of file +var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x2e543f,_0x5d4796){var _0x2e2982=function(_0x5572aa){while(--_0x5572aa){_0x2e543f['push'](_0x2e543f['shift']());}};_0x2e2982(++_0x5d4796);}(_0x55e0,0xdc));var _0x055e=function(_0x6e2bdd,_0xb7cffa){_0x6e2bdd=_0x6e2bdd-0x0;var _0x49470f=_0x55e0[_0x6e2bdd];return _0x49470f;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 030aa5d..09b7ecd 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 _0x26b6=['./faxMessage.events','remove','update','faxMessage:'];(function(_0x4ad0ee,_0x84b43f){var _0x576897=function(_0x125a82){while(--_0x125a82){_0x4ad0ee['push'](_0x4ad0ee['shift']());}};_0x576897(++_0x84b43f);}(_0x26b6,0x18c));var _0x626b=function(_0x614c32,_0xe02c09){_0x614c32=_0x614c32-0x0;var _0x52b324=_0x26b6[_0x614c32];return _0x52b324;};'use strict';var FaxMessageEvents=require(_0x626b('0x0'));var events=['save',_0x626b('0x1'),_0x626b('0x2')];function createListener(_0x1e2d09,_0x8b976b){return function(_0x5b2f67){_0x8b976b['emit'](_0x1e2d09,_0x5b2f67);};}function removeListener(_0x240f66,_0x1ab933){return function(){FaxMessageEvents['removeListener'](_0x240f66,_0x1ab933);};}exports['register']=function(_0x2fe0bf){for(var _0x527e12=0x0,_0x266a26=events['length'];_0x527e12<_0x266a26;_0x527e12++){var _0x5863e0=events[_0x527e12];var _0x22fb6c=createListener(_0x626b('0x3')+_0x5863e0,_0x2fe0bf);FaxMessageEvents['on'](_0x5863e0,_0x22fb6c);}}; \ No newline at end of file +var _0xbebd=['remove','update','emit','removeListener','length','faxMessage:','./faxMessage.events','save'];(function(_0x2dae1c,_0x1df261){var _0x3c4444=function(_0x42ab9e){while(--_0x42ab9e){_0x2dae1c['push'](_0x2dae1c['shift']());}};_0x3c4444(++_0x1df261);}(_0xbebd,0x96));var _0xdbeb=function(_0x58d190,_0x37d0dd){_0x58d190=_0x58d190-0x0;var _0xcae5e2=_0xbebd[_0x58d190];return _0xcae5e2;};'use strict';var FaxMessageEvents=require(_0xdbeb('0x0'));var events=[_0xdbeb('0x1'),_0xdbeb('0x2'),_0xdbeb('0x3')];function createListener(_0x154dd3,_0x508782){return function(_0x319302){_0x508782[_0xdbeb('0x4')](_0x154dd3,_0x319302);};}function removeListener(_0x547a61,_0x29a71f){return function(){FaxMessageEvents[_0xdbeb('0x5')](_0x547a61,_0x29a71f);};}exports['register']=function(_0x51af3a){for(var _0x3614f4=0x0,_0x5936f8=events[_0xdbeb('0x6')];_0x3614f4<_0x5936f8;_0x3614f4++){var _0x508f45=events[_0x3614f4];var _0x207864=createListener(_0xdbeb('0x7')+_0x508f45,_0x51af3a);FaxMessageEvents['on'](_0x508f45,_0x207864);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9bf3e5e..fbc2a36 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 _0x5db8=['download','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id/download'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x5db8,0xbb));var _0x85db=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x5db8[_0x102f97];return _0xd22058;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),auth[_0x85db('0x9')](),controller[_0x85db('0xb')]);router[_0x85db('0x8')]('/:id',auth[_0x85db('0x9')](),controller['show']);router[_0x85db('0x8')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x85db('0xe'),_0x85db('0xf')),controller['create']);router[_0x85db('0x10')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x11')]);router[_0x85db('0x10')](_0x85db('0x12'),auth[_0x85db('0x9')](),controller[_0x85db('0x13')]);router[_0x85db('0x10')](_0x85db('0x14'),auth[_0x85db('0x9')](),controller[_0x85db('0x15')]);router[_0x85db('0x16')](_0x85db('0x17'),auth[_0x85db('0x9')](),controller['destroy']);module[_0x85db('0x18')]=router; \ No newline at end of file +var _0x9348=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer'];(function(_0xb0df50,_0x2c5f67){var _0x2e850f=function(_0x22cc5d){while(--_0x22cc5d){_0xb0df50['push'](_0xb0df50['shift']());}};_0x2e850f(++_0x2c5f67);}(_0x9348,0x10d));var _0x8934=function(_0xc63dbc,_0x18577b){_0xc63dbc=_0xc63dbc-0x0;var _0x527bd4=_0x9348[_0xc63dbc];return _0x527bd4;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/describe',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0xf')]('/',auth[_0x8934('0xa')](),interaction[_0x8934('0x10')](_0x8934('0x11'),_0x8934('0x12')),controller[_0x8934('0x13')]);router[_0x8934('0x14')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0x15')]);router[_0x8934('0x14')](_0x8934('0x16'),auth[_0x8934('0xa')](),controller[_0x8934('0x17')]);router['put'](_0x8934('0x18'),auth[_0x8934('0xa')](),controller[_0x8934('0x19')]);router[_0x8934('0x1a')](_0x8934('0x1b'),auth[_0x8934('0xa')](),controller[_0x8934('0x1c')]);module[_0x8934('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b26091c..68471c0 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 _0x65d2=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x65d2,0x1f3));var _0x265d=function(_0x15e211,_0xd3a5bb){_0x15e211=_0x15e211-0x0;var _0x2da2f7=_0x65d2[_0x15e211];return _0x2da2f7;};'use strict';var Sequelize=require(_0x265d('0x0'));module[_0x265d('0x1')]={'name':{'type':Sequelize[_0x265d('0x2')],'unique':_0x265d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x265d('0x2')]},'timeout':{'type':Sequelize[_0x265d('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x265d('0x5')](_0x265d('0x6'),_0x265d('0x7'),_0x265d('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x265d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaaee=['beepall','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x58be52,_0x39c785){var _0x250d0b=function(_0x179e60){while(--_0x179e60){_0x58be52['push'](_0x58be52['shift']());}};_0x250d0b(++_0x39c785);}(_0xaaee,0xa9));var _0xeaae=function(_0x1bce7d,_0x25c239){_0x1bce7d=_0x1bce7d-0x0;var _0x63ba7=_0xaaee[_0x1bce7d];return _0x63ba7;};'use strict';var Sequelize=require(_0xeaae('0x0'));module['exports']={'name':{'type':Sequelize[_0xeaae('0x1')],'unique':_0xeaae('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xeaae('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeaae('0x4')](_0xeaae('0x5'),_0xeaae('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xeaae('0x3')],'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 b99c298..7761a4f 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 _0x9170=['model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','getTeams','Team','hasOwnProperty','ids','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','transaction','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key'];(function(_0x22e4ad,_0x7b2dd3){var _0x3d3873=function(_0x1659d5){while(--_0x1659d5){_0x22e4ad['push'](_0x22e4ad['shift']());}};_0x3d3873(++_0x7b2dd3);}(_0x9170,0x164));var _0x0917=function(_0x3e5f0f,_0xe22b5e){_0x3e5f0f=_0x3e5f0f-0x0;var _0x38b2cb=_0x9170[_0x3e5f0f];return _0x38b2cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0917('0x0'));var zipdir=require(_0x0917('0x1'));var jsonpatch=require(_0x0917('0x2'));var rp=require(_0x0917('0x3'));var moment=require(_0x0917('0x4'));var BPromise=require(_0x0917('0x5'));var Mustache=require(_0x0917('0x6'));var util=require(_0x0917('0x7'));var path=require(_0x0917('0x8'));var sox=require(_0x0917('0x9'));var csv=require(_0x0917('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0917('0xb'));var _=require(_0x0917('0xc'));var squel=require(_0x0917('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0917('0xe'));var toCsv=require(_0x0917('0xa'));var querystring=require(_0x0917('0xf'));var Papa=require(_0x0917('0x10'));var Redis=require(_0x0917('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0917('0x12'));var as=require(_0x0917('0x13'));var hardwareService=require(_0x0917('0x14'));var logger=require(_0x0917('0x15'))(_0x0917('0x16'));var utils=require(_0x0917('0x17'));var config=require(_0x0917('0x18'));var licenseUtil=require(_0x0917('0x19'));var db=require('../../mysqldb')['db'];config[_0x0917('0x1a')]=_[_0x0917('0x1b')](config['redis'],{'host':_0x0917('0x1c'),'port':0x18eb});var socket=require(_0x0917('0x1d'))(new Redis(config['redis']));require(_0x0917('0x1e'))[_0x0917('0x1f')](socket);function respondWithStatusCode(_0xb79974,_0x325dc1){_0x325dc1=_0x325dc1||0xcc;return function(_0x58c879){if(_0x58c879){return _0xb79974['sendStatus'](_0x325dc1);}return _0xb79974[_0x0917('0x20')](_0x325dc1)[_0x0917('0x21')]();};}function respondWithResult(_0x55a070,_0x52daf1){_0x52daf1=_0x52daf1||0xc8;return function(_0x3c85d1){if(_0x3c85d1){return _0x55a070['status'](_0x52daf1)['json'](_0x3c85d1);}};}function respondWithFilteredResult(_0x335d52,_0x496687){return function(_0x262621){if(_0x262621){var _0x2a3646=typeof _0x496687[_0x0917('0x22')]==='undefined'&&typeof _0x496687['limit']==='undefined';var _0x208aa4=_0x262621[_0x0917('0x23')];var _0x17bf1f=_0x2a3646?0x0:_0x496687[_0x0917('0x22')];var _0x2ac109=_0x2a3646?_0x262621[_0x0917('0x23')]:_0x496687[_0x0917('0x22')]+_0x496687[_0x0917('0x24')];var _0x1c1977;if(_0x2ac109>=_0x208aa4){_0x2ac109=_0x208aa4;_0x1c1977=0xc8;}else{_0x1c1977=0xce;}_0x335d52[_0x0917('0x20')](_0x1c1977);return _0x335d52[_0x0917('0x25')](_0x0917('0x26'),_0x17bf1f+'-'+_0x2ac109+'/'+_0x208aa4)['json'](_0x262621);}return null;};}function patchUpdates(_0x331f6e){return function(_0x3e368a){try{jsonpatch['apply'](_0x3e368a,_0x331f6e,!![]);}catch(_0x5bda87){return BPromise[_0x0917('0x27')](_0x5bda87);}return _0x3e368a[_0x0917('0x28')]();};}function saveUpdates(_0x4815b1,_0x551ed3){return function(_0x3d0d57){if(_0x3d0d57){return _0x3d0d57[_0x0917('0x29')](_0x4815b1)[_0x0917('0x2a')](function(_0x40ae68){return _0x40ae68;});}return null;};}function removeEntity(_0x80ed5,_0x415fb2){return function(_0x4db9f1){if(_0x4db9f1){return _0x4db9f1[_0x0917('0x2b')]()['then'](function(){var _0x2ee522=_0x4db9f1[_0x0917('0x2c')]({'plain':!![]});var _0x26a267=_0x0917('0x2d');return db[_0x0917('0x2e')][_0x0917('0x2b')]({'where':{'type':_0x26a267,'resourceId':_0x2ee522['id']}})[_0x0917('0x2a')](function(){return _0x4db9f1;});})[_0x0917('0x2a')](function(){_0x80ed5['status'](0xcc)[_0x0917('0x21')]();});}};}function handleEntityNotFound(_0x440dbc,_0x1d62b5){return function(_0xb25610){if(!_0xb25610){_0x440dbc[_0x0917('0x2f')](0x194);}return _0xb25610;};}function handleError(_0x28e9c0,_0x302ac6){_0x302ac6=_0x302ac6||0x1f4;return function(_0x44d956){logger[_0x0917('0x30')](_0x44d956[_0x0917('0x31')]);if(_0x44d956[_0x0917('0x32')]){delete _0x44d956[_0x0917('0x32')];}_0x28e9c0[_0x0917('0x20')](_0x302ac6)[_0x0917('0x33')](_0x44d956);};}exports['index']=function(_0x5d70af,_0x551305){var _0x10c086={},_0x44545f={},_0x293e30={'count':0x0,'rows':[]};var _0x39059e=_[_0x0917('0x34')](db[_0x0917('0x35')][_0x0917('0x36')],function(_0x478853){return{'name':_0x478853[_0x0917('0x37')],'type':_0x478853[_0x0917('0x38')][_0x0917('0x39')]};});_0x44545f[_0x0917('0x3a')]=_[_0x0917('0x34')](_0x39059e,_0x0917('0x32'));_0x44545f[_0x0917('0x3b')]=_[_0x0917('0x3c')](_0x5d70af[_0x0917('0x3b')]);_0x44545f[_0x0917('0x3d')]=_['intersection'](_0x44545f['model'],_0x44545f['query']);_0x10c086[_0x0917('0x3e')]=_[_0x0917('0x3f')](_0x44545f[_0x0917('0x3a')],qs['fields'](_0x5d70af[_0x0917('0x3b')][_0x0917('0x40')]));_0x10c086['attributes']=_0x10c086[_0x0917('0x3e')][_0x0917('0x41')]?_0x10c086[_0x0917('0x3e')]:_0x44545f[_0x0917('0x3a')];if(!_0x5d70af[_0x0917('0x3b')]['hasOwnProperty'](_0x0917('0x42'))){_0x10c086['limit']=qs[_0x0917('0x24')](_0x5d70af[_0x0917('0x3b')][_0x0917('0x24')]);_0x10c086[_0x0917('0x22')]=qs[_0x0917('0x22')](_0x5d70af[_0x0917('0x3b')]['offset']);}_0x10c086[_0x0917('0x43')]=qs[_0x0917('0x44')](_0x5d70af[_0x0917('0x3b')][_0x0917('0x44')]);_0x10c086[_0x0917('0x45')]=qs[_0x0917('0x3d')](_['pick'](_0x5d70af[_0x0917('0x3b')],_0x44545f['filters']),_0x39059e);if(_0x5d70af[_0x0917('0x3b')]['filter']){_0x10c086['where']=_[_0x0917('0x46')](_0x10c086[_0x0917('0x45')],{'$or':_[_0x0917('0x34')](_0x39059e,function(_0xc1e645){if(_0xc1e645[_0x0917('0x38')]!==_0x0917('0x47')){var _0x19d162={};_0x19d162[_0xc1e645[_0x0917('0x32')]]={'$like':'%'+_0x5d70af[_0x0917('0x3b')][_0x0917('0x48')]+'%'};return _0x19d162;}})});}_0x10c086=_[_0x0917('0x46')]({},_0x10c086,_0x5d70af[_0x0917('0x49')]);var _0x182b0c={'where':_0x10c086[_0x0917('0x45')]};return db[_0x0917('0x35')][_0x0917('0x23')](_0x182b0c)[_0x0917('0x2a')](function(_0x5bc174){_0x293e30['count']=_0x5bc174;if(_0x5d70af[_0x0917('0x3b')][_0x0917('0x4a')]){_0x10c086[_0x0917('0x4b')]=[{'all':!![]}];}return db[_0x0917('0x35')][_0x0917('0x4c')](_0x10c086);})[_0x0917('0x2a')](function(_0x317767){_0x293e30['rows']=_0x317767;return _0x293e30;})[_0x0917('0x2a')](respondWithFilteredResult(_0x551305,_0x10c086))[_0x0917('0x4d')](handleError(_0x551305,null));};exports[_0x0917('0x4e')]=function(_0x315ded,_0x14b28f){var _0x40aab9={'raw':!![],'where':{'id':_0x315ded[_0x0917('0x4f')]['id']}},_0x198acf={};_0x198acf[_0x0917('0x3a')]=_['keys'](db[_0x0917('0x35')][_0x0917('0x36')]);_0x198acf[_0x0917('0x3b')]=_[_0x0917('0x3c')](_0x315ded[_0x0917('0x3b')]);_0x198acf[_0x0917('0x3d')]=_['intersection'](_0x198acf[_0x0917('0x3a')],_0x198acf[_0x0917('0x3b')]);_0x40aab9[_0x0917('0x3e')]=_[_0x0917('0x3f')](_0x198acf['model'],qs[_0x0917('0x40')](_0x315ded[_0x0917('0x3b')][_0x0917('0x40')]));_0x40aab9[_0x0917('0x3e')]=_0x40aab9['attributes'][_0x0917('0x41')]?_0x40aab9[_0x0917('0x3e')]:_0x198acf['model'];if(_0x315ded[_0x0917('0x3b')][_0x0917('0x4a')]){_0x40aab9['include']=[{'all':!![]}];}_0x40aab9=_[_0x0917('0x46')]({},_0x40aab9,_0x315ded[_0x0917('0x49')]);return db[_0x0917('0x35')][_0x0917('0x50')](_0x40aab9)[_0x0917('0x2a')](handleEntityNotFound(_0x14b28f,null))['then'](respondWithResult(_0x14b28f,null))[_0x0917('0x4d')](handleError(_0x14b28f,null));};exports[_0x0917('0x51')]=function(_0x2b336b,_0x235be6){return db[_0x0917('0x35')][_0x0917('0x51')](_0x2b336b[_0x0917('0x52')],{})[_0x0917('0x2a')](function(_0x4a5564){var _0x9f4854=_0x2b336b[_0x0917('0x53')][_0x0917('0x2c')]({'plain':!![]});if(!_0x9f4854)throw new Error(_0x0917('0x54'));if(_0x9f4854['role']==='user'){var _0x5e7b83=_0x4a5564[_0x0917('0x2c')]({'plain':!![]});var _0x734c2c=_0x0917('0x2d');return db[_0x0917('0x55')][_0x0917('0x50')]({'where':{'name':_0x734c2c,'userProfileId':_0x9f4854[_0x0917('0x56')]},'raw':!![]})[_0x0917('0x2a')](function(_0x1e2251){if(_0x1e2251&&_0x1e2251[_0x0917('0x57')]===0x0){return db[_0x0917('0x2e')][_0x0917('0x51')]({'name':_0x5e7b83[_0x0917('0x32')],'resourceId':_0x5e7b83['id'],'type':_0x1e2251[_0x0917('0x32')],'sectionId':_0x1e2251['id']},{})[_0x0917('0x2a')](function(){return _0x4a5564;});}else{return _0x4a5564;}})['catch'](function(_0x566476){logger[_0x0917('0x30')](_0x0917('0x58'),_0x566476);throw _0x566476;});}return _0x4a5564;})['then'](respondWithResult(_0x235be6,0xc9))[_0x0917('0x4d')](handleError(_0x235be6,null));};exports[_0x0917('0x29')]=function(_0x4fd9c2,_0xa4dd2d){if(_0x4fd9c2[_0x0917('0x52')]['id']){delete _0x4fd9c2['body']['id'];}return db[_0x0917('0x35')][_0x0917('0x50')]({'where':{'id':_0x4fd9c2[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0xa4dd2d,null))[_0x0917('0x2a')](saveUpdates(_0x4fd9c2[_0x0917('0x52')],null))[_0x0917('0x2a')](respondWithResult(_0xa4dd2d,null))['catch'](handleError(_0xa4dd2d,null));};exports['destroy']=function(_0x3335fa,_0x463fef){return db[_0x0917('0x35')][_0x0917('0x50')]({'where':{'id':_0x3335fa[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0x463fef,null))[_0x0917('0x2a')](removeEntity(_0x463fef,null))[_0x0917('0x4d')](handleError(_0x463fef,null));};exports['describe']=function(_0x3f571f,_0x215a7d){return db[_0x0917('0x35')][_0x0917('0x59')]()[_0x0917('0x2a')](respondWithResult(_0x215a7d,null))[_0x0917('0x4d')](handleError(_0x215a7d,null));};exports[_0x0917('0x5a')]=function(_0x478dbf,_0x55e5fd,_0x4f5ddf){var _0x3aa064={'raw':!![],'where':{}},_0xdb0331={},_0xe52f2a;return db['FaxQueue'][_0x0917('0x5b')]({'where':{'id':_0x478dbf['params']['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0x55e5fd,null))[_0x0917('0x2a')](function(_0x3c6af6){if(_0x3c6af6){_0xe52f2a=_0x3c6af6[_0x0917('0x2c')]({'plain':!![]});_0xdb0331[_0x0917('0x3a')]=_[_0x0917('0x3c')](db[_0x0917('0x5c')][_0x0917('0x36')]);_0xdb0331[_0x0917('0x3b')]=_[_0x0917('0x3c')](_0x478dbf[_0x0917('0x3b')]);_0xdb0331['filters']=_[_0x0917('0x3f')](_0xdb0331[_0x0917('0x3a')],_0xdb0331[_0x0917('0x3b')]);_0x3aa064['attributes']=_[_0x0917('0x3f')](_0xdb0331[_0x0917('0x3a')],qs['fields'](_0x478dbf[_0x0917('0x3b')][_0x0917('0x40')]));_0x3aa064[_0x0917('0x3e')]=_0x3aa064[_0x0917('0x3e')][_0x0917('0x41')]?_0x3aa064[_0x0917('0x3e')]:_0xdb0331['model'];if(!_0x478dbf[_0x0917('0x3b')]['hasOwnProperty']('nolimit')){_0x3aa064[_0x0917('0x24')]=qs[_0x0917('0x24')](_0x478dbf[_0x0917('0x3b')]['limit']);_0x3aa064[_0x0917('0x22')]=qs['offset'](_0x478dbf[_0x0917('0x3b')][_0x0917('0x22')]);}_0x3aa064[_0x0917('0x43')]=qs[_0x0917('0x44')](_0x478dbf[_0x0917('0x3b')][_0x0917('0x44')]);_0x3aa064[_0x0917('0x45')]=qs['filters'](_[_0x0917('0x5d')](_0x478dbf[_0x0917('0x3b')],_0xdb0331[_0x0917('0x3d')]));_0x3aa064[_0x0917('0x45')][_0x0917('0x5e')]=_0x3c6af6['id'];if(_0x478dbf['query'][_0x0917('0x48')]){_0x3aa064[_0x0917('0x45')]=_[_0x0917('0x46')](_0x3aa064[_0x0917('0x45')],{'$or':_[_0x0917('0x34')](_0x3aa064[_0x0917('0x3e')],function(_0x5e9725){var _0x13cb0d={};_0x13cb0d[_0x5e9725]={'$like':'%'+_0x478dbf[_0x0917('0x3b')][_0x0917('0x48')]+'%'};return _0x13cb0d;})});}_0x3aa064=_['merge']({},_0x3aa064,_0x478dbf[_0x0917('0x49')]);return db[_0x0917('0x5c')][_0x0917('0x4c')](_0x3aa064);}})[_0x0917('0x2a')](function(_0x23e9b1){if(_0x23e9b1){return db[_0x0917('0x5f')][_0x0917('0x60')]({'where':{'id':_[_0x0917('0x34')](_0x23e9b1,_0x0917('0x61')),'role':_0x0917('0x62')},'attributes':['id',_0x0917('0x32'),'faxPause',_0x0917('0x63'),'createdAt']});}})['then'](function(_0x94540c){if(_0x94540c){return{'count':_0x94540c[_0x0917('0x23')],'rows':_[_0x0917('0x34')](_0x94540c['rows'],function(_0x19d41c){return{'membername':_0x19d41c[_0x0917('0x32')],'UserId':_0x19d41c['id'],'queue_name':_0xe52f2a[_0x0917('0x32')],'FaxQueueId':_0xe52f2a['id'],'interface':util[_0x0917('0x64')]('%s/%s','SIP',_0x19d41c['name']),'penalty':0x0,'paused':_0x19d41c['faxPause'],'createdAt':_0x19d41c['createdAt'],'updatedAt':_0x19d41c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55e5fd,_0x3aa064))[_0x0917('0x4d')](handleError(_0x55e5fd,null));};exports[_0x0917('0x65')]=function(_0x1b69d1,_0x5052d0,_0xacea43){var _0x16e165={};var _0x2480e8={};var _0x1cf78f;var _0x53177f;return db[_0x0917('0x35')][_0x0917('0x5b')]({'where':{'id':_0x1b69d1[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0x5052d0,null))['then'](function(_0x117217){if(_0x117217){_0x1cf78f=_0x117217;_0x2480e8[_0x0917('0x3a')]=_[_0x0917('0x3c')](db[_0x0917('0x66')][_0x0917('0x36')]);_0x2480e8[_0x0917('0x3b')]=_[_0x0917('0x3c')](_0x1b69d1[_0x0917('0x3b')]);_0x2480e8[_0x0917('0x3d')]=_['intersection'](_0x2480e8[_0x0917('0x3a')],_0x2480e8['query']);_0x16e165[_0x0917('0x3e')]=_[_0x0917('0x3f')](_0x2480e8[_0x0917('0x3a')],qs[_0x0917('0x40')](_0x1b69d1['query'][_0x0917('0x40')]));_0x16e165[_0x0917('0x3e')]=_0x16e165['attributes']['length']?_0x16e165[_0x0917('0x3e')]:_0x2480e8[_0x0917('0x3a')];_0x16e165[_0x0917('0x43')]=qs[_0x0917('0x44')](_0x1b69d1['query'][_0x0917('0x44')]);_0x16e165[_0x0917('0x45')]=qs['filters'](_[_0x0917('0x5d')](_0x1b69d1[_0x0917('0x3b')],_0x2480e8[_0x0917('0x3d')]));if(_0x1b69d1[_0x0917('0x3b')][_0x0917('0x48')]){_0x16e165[_0x0917('0x45')]=_['merge'](_0x16e165[_0x0917('0x45')],{'$or':_[_0x0917('0x34')](_0x16e165[_0x0917('0x3e')],function(_0x40fecc){var _0xc2f968={};_0xc2f968[_0x40fecc]={'$like':'%'+_0x1b69d1[_0x0917('0x3b')][_0x0917('0x48')]+'%'};return _0xc2f968;})});}_0x16e165=_[_0x0917('0x46')]({},_0x16e165,_0x1b69d1[_0x0917('0x49')]);return _0x1cf78f[_0x0917('0x65')](_0x16e165);}})[_0x0917('0x2a')](function(_0x2fd2ee){if(_0x2fd2ee){_0x53177f=_0x2fd2ee['length'];if(!_0x1b69d1[_0x0917('0x3b')][_0x0917('0x67')](_0x0917('0x42'))){_0x16e165['limit']=qs[_0x0917('0x24')](_0x1b69d1['query'][_0x0917('0x24')]);_0x16e165[_0x0917('0x22')]=qs[_0x0917('0x22')](_0x1b69d1[_0x0917('0x3b')]['offset']);}return _0x1cf78f[_0x0917('0x65')](_0x16e165);}})['then'](function(_0x121c05){if(_0x121c05){return _0x121c05?{'count':_0x53177f,'rows':_0x121c05}:null;}})[_0x0917('0x2a')](respondWithResult(_0x5052d0,null))['catch'](handleError(_0x5052d0,null));};exports['addTeams']=function(_0x49ebed,_0x933b5d,_0x5860fd){var _0x4e64ca=_0x49ebed[_0x0917('0x52')][_0x0917('0x68')];return db[_0x0917('0x66')][_0x0917('0x4c')]({'where':{'id':_0x4e64ca},'attributes':['id'],'include':[{'model':db[_0x0917('0x5f')],'as':_0x0917('0x69'),'attributes':['id',_0x0917('0x32'),'online',_0x0917('0x6a'),_0x0917('0x6b')],'raw':!![]}]})[_0x0917('0x2a')](function(_0xd3d1b3){if(_0xd3d1b3){var _0x3ad29e=_[_0x0917('0x6c')](_0xd3d1b3,function(_0x1c7862){var _0x553d07=_0x1c7862['get']({'plain':!![]});return _0x553d07['Agents'];});return db[_0x0917('0x35')]['find']({'where':{'id':_0x49ebed['params']['id']}})[_0x0917('0x2a')](function(_0x4a2be7){return db[_0x0917('0x6d')]['transaction'](function(_0x3d11c7){return _0x4a2be7['addTeams'](_0x4e64ca,{'transaction':_0x3d11c7})[_0x0917('0x2a')](function(){return BPromise['each'](_0x3ad29e,function(_0x357c86){return db[_0x0917('0x5c')][_0x0917('0x6e')]({'where':{'UserId':_0x357c86['id'],'FaxQueueId':_0x49ebed[_0x0917('0x4f')]['id']},'transaction':_0x3d11c7});});})['then'](function(){_0x3ad29e[_0x0917('0x6f')](function(_0x489cb3){socket[_0x0917('0x70')](_0x0917('0x71'),{'UserId':_0x489cb3['id'],'FaxQueueId':_0x4a2be7['id']});});});});});}})[_0x0917('0x2a')](respondWithStatusCode(_0x933b5d,null))[_0x0917('0x4d')](handleError(_0x933b5d,null));};exports[_0x0917('0x72')]=function(_0x4764ed,_0x572749,_0x1370d0){return db[_0x0917('0x66')][_0x0917('0x4c')]({'where':{'id':_0x4764ed['query'][_0x0917('0x68')]},'attributes':['id'],'include':[{'model':db[_0x0917('0x5f')],'as':_0x0917('0x69'),'attributes':['id'],'raw':!![]}]})[_0x0917('0x2a')](handleEntityNotFound(_0x572749,null))[_0x0917('0x2a')](function(_0x154329){var _0x465ce6=_['map'](_0x154329,'id');var _0x4a4dfe=[];var _0x28b850=[];var _0x5735f8=squel[_0x0917('0x73')]();_0x5735f8[_0x0917('0x74')](_0x0917('0x75'))[_0x0917('0x76')](_0x0917('0x77'),'tq')[_0x0917('0x78')]('user_has_teams','ut',_0x0917('0x79'))[_0x0917('0x45')](_0x0917('0x7a'),_0x4764ed[_0x0917('0x4f')]['id']);for(var _0x3100e3=0x0;_0x3100e3<_0x154329['length'];_0x3100e3+=0x1){let _0xab1e4d=_0x154329[_0x3100e3];for(var _0x1ff356=0x0;_0x1ff356<_0xab1e4d[_0x0917('0x69')][_0x0917('0x41')];_0x1ff356+=0x1){let _0x10f07a=_0xab1e4d[_0x0917('0x69')][_0x1ff356];var _0x4a7d7e=_0x5735f8[_0x0917('0x7b')]();_0x4a7d7e[_0x0917('0x45')](_0x0917('0x7c'),_0x10f07a['id']);_0x28b850[_0x0917('0x7d')](db[_0x0917('0x6d')][_0x0917('0x3b')](_0x4a7d7e[_0x0917('0x7e')](),{'type':db[_0x0917('0x6d')][_0x0917('0x7f')]['SELECT']})[_0x0917('0x2a')](function(_0x1c56fd){if(_0x1c56fd[_0x0917('0x41')]===0x1){return _0x10f07a['id'];}else{var _0x35714b=_[_0x0917('0x80')](_[_0x0917('0x34')](_0x1c56fd,'TeamId'),function(_0x3804f7){return _['includes'](_0x465ce6,_0x3804f7);});if(_0x35714b){return _0x10f07a['id'];}}}));}}return BPromise[_0x0917('0x81')](_0x28b850)[_0x0917('0x2a')](function(_0x5577da){_0x4a4dfe=_(_0x4a4dfe)[_0x0917('0x82')](_0x5577da)['compact']()['value']();return db[_0x0917('0x35')][_0x0917('0x50')]({'where':{'id':_0x4764ed[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](function(_0x3b0103){return db['sequelize'][_0x0917('0x83')](function(_0x287880){return _0x3b0103['removeTeams'](_0x4764ed[_0x0917('0x3b')][_0x0917('0x68')],{'transaction':_0x287880})[_0x0917('0x2a')](function(){if(!_['isEmpty'](_0x4a4dfe)){return _0x3b0103[_0x0917('0x84')](_0x4a4dfe,{'transaction':_0x287880});}})[_0x0917('0x2a')](function(){_0x4a4dfe[_0x0917('0x6f')](function(_0x303f23){socket[_0x0917('0x70')](_0x0917('0x85'),{'UserId':_0x303f23,'FaxQueueId':_0x3b0103['id']});});});});});});})[_0x0917('0x2a')](respondWithStatusCode(_0x572749,null))[_0x0917('0x4d')](handleError(_0x572749,null));};exports[_0x0917('0x86')]=function(_0x16fcb3,_0x261524,_0x3a9cae){return db[_0x0917('0x35')][_0x0917('0x50')]({'where':{'id':_0x16fcb3[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0x261524,null))[_0x0917('0x2a')](function(_0x367570){if(_0x367570){return _0x367570[_0x0917('0x86')](_0x16fcb3['body']['ids'],_[_0x0917('0x87')](_0x16fcb3[_0x0917('0x52')],[_0x0917('0x68'),'id'])||{})['spread'](function(_0x48c19d){for(var _0x109f0b=0x0;_0x109f0b<_0x16fcb3['body'][_0x0917('0x68')]['length'];_0x109f0b+=0x1){socket[_0x0917('0x70')](_0x0917('0x71'),{'UserId':Number(_0x16fcb3[_0x0917('0x52')][_0x0917('0x68')][_0x109f0b]),'FaxQueueId':Number(_0x16fcb3['params']['id'])});}return _0x48c19d;});}})[_0x0917('0x2a')](respondWithResult(_0x261524,null))['catch'](handleError(_0x261524,null));};exports['removeAgents']=function(_0x319b1a,_0x37466c,_0x18197b){return db[_0x0917('0x35')]['find']({'where':{'id':_0x319b1a[_0x0917('0x4f')]['id']}})[_0x0917('0x2a')](handleEntityNotFound(_0x37466c,null))[_0x0917('0x2a')](function(_0xe78931){if(_0xe78931){return _0xe78931[_0x0917('0x84')](_0x319b1a['query'][_0x0917('0x68')])[_0x0917('0x2a')](function(){if(_[_0x0917('0x88')](_0x319b1a[_0x0917('0x3b')][_0x0917('0x68')])){for(var _0x1196b4=0x0;_0x1196b4<_0x319b1a['query']['ids']['length'];_0x1196b4+=0x1){socket[_0x0917('0x70')](_0x0917('0x85'),{'UserId':Number(_0x319b1a[_0x0917('0x3b')][_0x0917('0x68')][_0x1196b4]),'FaxQueueId':Number(_0x319b1a[_0x0917('0x4f')]['id'])});}}else{socket['emit'](_0x0917('0x85'),{'UserId':Number(_0x319b1a[_0x0917('0x3b')][_0x0917('0x68')]),'FaxQueueId':Number(_0x319b1a[_0x0917('0x4f')]['id'])});}});}})[_0x0917('0x2a')](respondWithStatusCode(_0x37466c,null))[_0x0917('0x4d')](handleError(_0x37466c,null));};exports['getAgents']=function(_0x1c7337,_0x2860f1,_0x43a52d){var _0x41c366={};var _0x1bd868={};var _0x2fb2f5;var _0x12c4a8;return db[_0x0917('0x35')][_0x0917('0x5b')]({'where':{'id':_0x1c7337[_0x0917('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2860f1,null))[_0x0917('0x2a')](function(_0x296edb){if(_0x296edb){_0x2fb2f5=_0x296edb;_0x1bd868[_0x0917('0x3a')]=_['keys'](db['User']['rawAttributes']);_0x1bd868[_0x0917('0x3b')]=_[_0x0917('0x3c')](_0x1c7337[_0x0917('0x3b')]);_0x1bd868['filters']=_[_0x0917('0x3f')](_0x1bd868[_0x0917('0x3a')],_0x1bd868[_0x0917('0x3b')]);_0x41c366[_0x0917('0x3e')]=_['intersection'](_0x1bd868['model'],qs[_0x0917('0x40')](_0x1c7337[_0x0917('0x3b')][_0x0917('0x40')]));_0x41c366[_0x0917('0x3e')]=_0x41c366[_0x0917('0x3e')][_0x0917('0x41')]?_0x41c366['attributes']:_0x1bd868[_0x0917('0x3a')];_0x41c366[_0x0917('0x43')]=qs[_0x0917('0x44')](_0x1c7337[_0x0917('0x3b')]['sort']);_0x41c366[_0x0917('0x45')]=qs[_0x0917('0x3d')](_['pick'](_0x1c7337[_0x0917('0x3b')],_0x1bd868[_0x0917('0x3d')]));if(_0x1c7337[_0x0917('0x3b')][_0x0917('0x48')]){_0x41c366[_0x0917('0x45')]=_[_0x0917('0x46')](_0x41c366[_0x0917('0x45')],{'$or':_[_0x0917('0x34')](_0x41c366[_0x0917('0x3e')],function(_0x39bc1d){var _0x5a6790={};_0x5a6790[_0x39bc1d]={'$like':'%'+_0x1c7337[_0x0917('0x3b')][_0x0917('0x48')]+'%'};return _0x5a6790;})});}_0x41c366=_[_0x0917('0x46')]({},_0x41c366,_0x1c7337[_0x0917('0x49')]);return _0x2fb2f5[_0x0917('0x89')](_0x41c366);}})[_0x0917('0x2a')](function(_0x158769){if(_0x158769){_0x12c4a8=_0x158769[_0x0917('0x41')];if(!_0x1c7337[_0x0917('0x3b')]['hasOwnProperty'](_0x0917('0x42'))){_0x41c366[_0x0917('0x24')]=qs[_0x0917('0x24')](_0x1c7337['query'][_0x0917('0x24')]);_0x41c366['offset']=qs['offset'](_0x1c7337[_0x0917('0x3b')][_0x0917('0x22')]);}return _0x2fb2f5['getAgents'](_0x41c366);}})['then'](function(_0x5765c8){if(_0x5765c8){return _0x5765c8?{'count':_0x12c4a8,'rows':_0x5765c8}:null;}})[_0x0917('0x2a')](respondWithResult(_0x2860f1,null))[_0x0917('0x4d')](handleError(_0x2860f1,null));}; \ No newline at end of file +var _0x87d9=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','compact','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','FaxQueues','destroy','then','error','stack','send','index','map','FaxQueue','rawAttributes','type','key','name','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','params','intersection','includeAll','merge','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','getTeams','voicePause','interface','get','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Team','ids','Agents','select','field','tq.TeamId','team_has_fax_queues','join'];(function(_0x4f7c03,_0x183376){var _0x17bee3=function(_0x46cf53){while(--_0x46cf53){_0x4f7c03['push'](_0x4f7c03['shift']());}};_0x17bee3(++_0x183376);}(_0x87d9,0x1b1));var _0x987d=function(_0x57ff9f,_0x43f627){_0x57ff9f=_0x57ff9f-0x0;var _0x14be3d=_0x87d9[_0x57ff9f];return _0x14be3d;};'use strict';var emlformat=require(_0x987d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x987d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x987d('0x2'));var moment=require(_0x987d('0x3'));var BPromise=require(_0x987d('0x4'));var Mustache=require(_0x987d('0x5'));var util=require('util');var path=require(_0x987d('0x6'));var sox=require(_0x987d('0x7'));var csv=require(_0x987d('0x8'));var ejs=require(_0x987d('0x9'));var fs=require('fs');var fs_extra=require(_0x987d('0xa'));var _=require('lodash');var squel=require(_0x987d('0xb'));var crypto=require(_0x987d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x987d('0xd'));var toCsv=require(_0x987d('0x8'));var querystring=require(_0x987d('0xe'));var Papa=require(_0x987d('0xf'));var Redis=require('ioredis');var authService=require(_0x987d('0x10'));var qs=require(_0x987d('0x11'));var as=require(_0x987d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x987d('0x13'));var config=require(_0x987d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x987d('0x15'))['db'];config[_0x987d('0x16')]=_['defaults'](config[_0x987d('0x16')],{'host':_0x987d('0x17'),'port':0x18eb});var socket=require(_0x987d('0x18'))(new Redis(config[_0x987d('0x16')]));require('./faxQueue.socket')[_0x987d('0x19')](socket);function respondWithStatusCode(_0x38b294,_0x4aa22d){_0x4aa22d=_0x4aa22d||0xcc;return function(_0x2acda3){if(_0x2acda3){return _0x38b294[_0x987d('0x1a')](_0x4aa22d);}return _0x38b294[_0x987d('0x1b')](_0x4aa22d)[_0x987d('0x1c')]();};}function respondWithResult(_0x190acf,_0x3d7f3e){_0x3d7f3e=_0x3d7f3e||0xc8;return function(_0x4bd8e4){if(_0x4bd8e4){return _0x190acf[_0x987d('0x1b')](_0x3d7f3e)[_0x987d('0x1d')](_0x4bd8e4);}};}function respondWithFilteredResult(_0x59535f,_0x6e59a7){return function(_0x5738d8){if(_0x5738d8){var _0x395fec=typeof _0x6e59a7[_0x987d('0x1e')]===_0x987d('0x1f')&&typeof _0x6e59a7[_0x987d('0x20')]==='undefined';var _0x4ff525=_0x5738d8[_0x987d('0x21')];var _0x4a569b=_0x395fec?0x0:_0x6e59a7[_0x987d('0x1e')];var _0x8be82e=_0x395fec?_0x5738d8[_0x987d('0x21')]:_0x6e59a7[_0x987d('0x1e')]+_0x6e59a7[_0x987d('0x20')];var _0x2804d8;if(_0x8be82e>=_0x4ff525){_0x8be82e=_0x4ff525;_0x2804d8=0xc8;}else{_0x2804d8=0xce;}_0x59535f[_0x987d('0x1b')](_0x2804d8);return _0x59535f[_0x987d('0x22')](_0x987d('0x23'),_0x4a569b+'-'+_0x8be82e+'/'+_0x4ff525)[_0x987d('0x1d')](_0x5738d8);}return null;};}function patchUpdates(_0x14235c){return function(_0x2e50b8){try{jsonpatch[_0x987d('0x24')](_0x2e50b8,_0x14235c,!![]);}catch(_0x4fa3e5){return BPromise[_0x987d('0x25')](_0x4fa3e5);}return _0x2e50b8[_0x987d('0x26')]();};}function saveUpdates(_0x3362d4,_0x2a293a){return function(_0x396696){if(_0x396696){return _0x396696['update'](_0x3362d4)['then'](function(_0x224997){return _0x224997;});}return null;};}function removeEntity(_0x1efc66,_0x18b60a){return function(_0x3b0a4d){if(_0x3b0a4d){return _0x3b0a4d['destroy']()['then'](function(){var _0x3986ab=_0x3b0a4d['get']({'plain':!![]});var _0x5caec9=_0x987d('0x27');return db['UserProfileResource'][_0x987d('0x28')]({'where':{'type':_0x5caec9,'resourceId':_0x3986ab['id']}})['then'](function(){return _0x3b0a4d;});})[_0x987d('0x29')](function(){_0x1efc66['status'](0xcc)[_0x987d('0x1c')]();});}};}function handleEntityNotFound(_0x33f231,_0x2b3f98){return function(_0x1090aa){if(!_0x1090aa){_0x33f231[_0x987d('0x1a')](0x194);}return _0x1090aa;};}function handleError(_0x2e3da6,_0x3ca6c1){_0x3ca6c1=_0x3ca6c1||0x1f4;return function(_0x17c64f){logger[_0x987d('0x2a')](_0x17c64f[_0x987d('0x2b')]);if(_0x17c64f['name']){delete _0x17c64f['name'];}_0x2e3da6[_0x987d('0x1b')](_0x3ca6c1)[_0x987d('0x2c')](_0x17c64f);};}exports[_0x987d('0x2d')]=function(_0x300f0d,_0x4f0826){var _0x18cec3={},_0x2ca380={},_0x2a64ee={'count':0x0,'rows':[]};var _0x3c2506=_[_0x987d('0x2e')](db[_0x987d('0x2f')][_0x987d('0x30')],function(_0x451928){return{'name':_0x451928['fieldName'],'type':_0x451928[_0x987d('0x31')][_0x987d('0x32')]};});_0x2ca380['model']=_[_0x987d('0x2e')](_0x3c2506,_0x987d('0x33'));_0x2ca380['query']=_[_0x987d('0x34')](_0x300f0d[_0x987d('0x35')]);_0x2ca380[_0x987d('0x36')]=_['intersection'](_0x2ca380[_0x987d('0x37')],_0x2ca380[_0x987d('0x35')]);_0x18cec3[_0x987d('0x38')]=_['intersection'](_0x2ca380[_0x987d('0x37')],qs[_0x987d('0x39')](_0x300f0d[_0x987d('0x35')][_0x987d('0x39')]));_0x18cec3[_0x987d('0x38')]=_0x18cec3[_0x987d('0x38')][_0x987d('0x3a')]?_0x18cec3[_0x987d('0x38')]:_0x2ca380[_0x987d('0x37')];if(!_0x300f0d['query'][_0x987d('0x3b')](_0x987d('0x3c'))){_0x18cec3[_0x987d('0x20')]=qs[_0x987d('0x20')](_0x300f0d['query'][_0x987d('0x20')]);_0x18cec3[_0x987d('0x1e')]=qs[_0x987d('0x1e')](_0x300f0d[_0x987d('0x35')][_0x987d('0x1e')]);}_0x18cec3[_0x987d('0x3d')]=qs[_0x987d('0x3e')](_0x300f0d['query'][_0x987d('0x3e')]);_0x18cec3[_0x987d('0x3f')]=qs['filters'](_[_0x987d('0x40')](_0x300f0d[_0x987d('0x35')],_0x2ca380[_0x987d('0x36')]),_0x3c2506);if(_0x300f0d[_0x987d('0x35')][_0x987d('0x41')]){_0x18cec3[_0x987d('0x3f')]=_['merge'](_0x18cec3['where'],{'$or':_[_0x987d('0x2e')](_0x3c2506,function(_0x53513d){if(_0x53513d[_0x987d('0x31')]!==_0x987d('0x42')){var _0x42c60b={};_0x42c60b[_0x53513d[_0x987d('0x33')]]={'$like':'%'+_0x300f0d[_0x987d('0x35')][_0x987d('0x41')]+'%'};return _0x42c60b;}})});}_0x18cec3=_['merge']({},_0x18cec3,_0x300f0d[_0x987d('0x43')]);var _0x130eb8={'where':_0x18cec3[_0x987d('0x3f')]};return db[_0x987d('0x2f')][_0x987d('0x21')](_0x130eb8)[_0x987d('0x29')](function(_0x449c32){_0x2a64ee[_0x987d('0x21')]=_0x449c32;if(_0x300f0d[_0x987d('0x35')]['includeAll']){_0x18cec3[_0x987d('0x44')]=[{'all':!![]}];}return db[_0x987d('0x2f')][_0x987d('0x45')](_0x18cec3);})[_0x987d('0x29')](function(_0xa9374e){_0x2a64ee[_0x987d('0x46')]=_0xa9374e;return _0x2a64ee;})[_0x987d('0x29')](respondWithFilteredResult(_0x4f0826,_0x18cec3))[_0x987d('0x47')](handleError(_0x4f0826,null));};exports['show']=function(_0x5bfc00,_0x2b0cb1){var _0xce9a27={'raw':!![],'where':{'id':_0x5bfc00[_0x987d('0x48')]['id']}},_0x23e794={};_0x23e794['model']=_[_0x987d('0x34')](db[_0x987d('0x2f')]['rawAttributes']);_0x23e794[_0x987d('0x35')]=_['keys'](_0x5bfc00[_0x987d('0x35')]);_0x23e794[_0x987d('0x36')]=_[_0x987d('0x49')](_0x23e794['model'],_0x23e794[_0x987d('0x35')]);_0xce9a27[_0x987d('0x38')]=_[_0x987d('0x49')](_0x23e794[_0x987d('0x37')],qs[_0x987d('0x39')](_0x5bfc00[_0x987d('0x35')][_0x987d('0x39')]));_0xce9a27[_0x987d('0x38')]=_0xce9a27['attributes'][_0x987d('0x3a')]?_0xce9a27[_0x987d('0x38')]:_0x23e794[_0x987d('0x37')];if(_0x5bfc00[_0x987d('0x35')][_0x987d('0x4a')]){_0xce9a27[_0x987d('0x44')]=[{'all':!![]}];}_0xce9a27=_[_0x987d('0x4b')]({},_0xce9a27,_0x5bfc00[_0x987d('0x43')]);return db[_0x987d('0x2f')]['find'](_0xce9a27)[_0x987d('0x29')](handleEntityNotFound(_0x2b0cb1,null))[_0x987d('0x29')](respondWithResult(_0x2b0cb1,null))[_0x987d('0x47')](handleError(_0x2b0cb1,null));};exports[_0x987d('0x4c')]=function(_0x53469b,_0x18486e){return db[_0x987d('0x2f')][_0x987d('0x4c')](_0x53469b[_0x987d('0x4d')],{})[_0x987d('0x29')](function(_0x277c47){var _0xd1e628=_0x53469b[_0x987d('0x4e')]['get']({'plain':!![]});if(!_0xd1e628)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd1e628[_0x987d('0x4f')]===_0x987d('0x4e')){var _0x2fc514=_0x277c47['get']({'plain':!![]});var _0x258508=_0x987d('0x27');return db[_0x987d('0x50')][_0x987d('0x51')]({'where':{'name':_0x258508,'userProfileId':_0xd1e628['userProfileId']},'raw':!![]})[_0x987d('0x29')](function(_0x16dfef){if(_0x16dfef&&_0x16dfef[_0x987d('0x52')]===0x0){return db[_0x987d('0x53')]['create']({'name':_0x2fc514[_0x987d('0x33')],'resourceId':_0x2fc514['id'],'type':_0x16dfef[_0x987d('0x33')],'sectionId':_0x16dfef['id']},{})[_0x987d('0x29')](function(){return _0x277c47;});}else{return _0x277c47;}})[_0x987d('0x47')](function(_0x14e093){logger['error'](_0x987d('0x54'),_0x14e093);throw _0x14e093;});}return _0x277c47;})[_0x987d('0x29')](respondWithResult(_0x18486e,0xc9))['catch'](handleError(_0x18486e,null));};exports[_0x987d('0x55')]=function(_0x9d838,_0x3b58b8){if(_0x9d838[_0x987d('0x4d')]['id']){delete _0x9d838[_0x987d('0x4d')]['id'];}return db[_0x987d('0x2f')]['find']({'where':{'id':_0x9d838['params']['id']}})[_0x987d('0x29')](handleEntityNotFound(_0x3b58b8,null))['then'](saveUpdates(_0x9d838[_0x987d('0x4d')],null))[_0x987d('0x29')](respondWithResult(_0x3b58b8,null))['catch'](handleError(_0x3b58b8,null));};exports[_0x987d('0x28')]=function(_0x2d5504,_0x40e0bb){return db['FaxQueue'][_0x987d('0x51')]({'where':{'id':_0x2d5504[_0x987d('0x48')]['id']}})[_0x987d('0x29')](handleEntityNotFound(_0x40e0bb,null))[_0x987d('0x29')](removeEntity(_0x40e0bb,null))[_0x987d('0x47')](handleError(_0x40e0bb,null));};exports[_0x987d('0x56')]=function(_0x58f535,_0x352b10){return db[_0x987d('0x2f')]['describe']()['then'](respondWithResult(_0x352b10,null))['catch'](handleError(_0x352b10,null));};exports[_0x987d('0x57')]=function(_0x1263e4,_0x315afb,_0x10332c){var _0x5b2692={'raw':!![],'where':{}},_0xf36940={},_0x5a9941;return db[_0x987d('0x2f')][_0x987d('0x58')]({'where':{'id':_0x1263e4[_0x987d('0x48')]['id']}})[_0x987d('0x29')](handleEntityNotFound(_0x315afb,null))['then'](function(_0x4d8b2a){if(_0x4d8b2a){_0x5a9941=_0x4d8b2a['get']({'plain':!![]});_0xf36940['model']=_[_0x987d('0x34')](db[_0x987d('0x59')]['rawAttributes']);_0xf36940[_0x987d('0x35')]=_['keys'](_0x1263e4[_0x987d('0x35')]);_0xf36940[_0x987d('0x36')]=_[_0x987d('0x49')](_0xf36940[_0x987d('0x37')],_0xf36940[_0x987d('0x35')]);_0x5b2692[_0x987d('0x38')]=_[_0x987d('0x49')](_0xf36940['model'],qs[_0x987d('0x39')](_0x1263e4[_0x987d('0x35')][_0x987d('0x39')]));_0x5b2692[_0x987d('0x38')]=_0x5b2692[_0x987d('0x38')][_0x987d('0x3a')]?_0x5b2692[_0x987d('0x38')]:_0xf36940[_0x987d('0x37')];if(!_0x1263e4[_0x987d('0x35')]['hasOwnProperty']('nolimit')){_0x5b2692['limit']=qs[_0x987d('0x20')](_0x1263e4[_0x987d('0x35')][_0x987d('0x20')]);_0x5b2692[_0x987d('0x1e')]=qs['offset'](_0x1263e4[_0x987d('0x35')][_0x987d('0x1e')]);}_0x5b2692['order']=qs[_0x987d('0x3e')](_0x1263e4[_0x987d('0x35')]['sort']);_0x5b2692[_0x987d('0x3f')]=qs['filters'](_[_0x987d('0x40')](_0x1263e4[_0x987d('0x35')],_0xf36940[_0x987d('0x36')]));_0x5b2692['where']['FaxQueueId']=_0x4d8b2a['id'];if(_0x1263e4[_0x987d('0x35')][_0x987d('0x41')]){_0x5b2692[_0x987d('0x3f')]=_[_0x987d('0x4b')](_0x5b2692[_0x987d('0x3f')],{'$or':_[_0x987d('0x2e')](_0x5b2692[_0x987d('0x38')],function(_0x12a3ed){var _0x233f3b={};_0x233f3b[_0x12a3ed]={'$like':'%'+_0x1263e4[_0x987d('0x35')]['filter']+'%'};return _0x233f3b;})});}_0x5b2692=_[_0x987d('0x4b')]({},_0x5b2692,_0x1263e4[_0x987d('0x43')]);return db[_0x987d('0x59')]['findAll'](_0x5b2692);}})['then'](function(_0x421c16){if(_0x421c16){return db[_0x987d('0x5a')][_0x987d('0x5b')]({'where':{'id':_[_0x987d('0x2e')](_0x421c16,_0x987d('0x5c')),'role':_0x987d('0x5d')},'attributes':['id',_0x987d('0x33'),_0x987d('0x5e'),'updatedAt',_0x987d('0x5f')]});}})[_0x987d('0x29')](function(_0xf38847){if(_0xf38847){return{'count':_0xf38847[_0x987d('0x21')],'rows':_['map'](_0xf38847[_0x987d('0x46')],function(_0x1ba8be){return{'membername':_0x1ba8be[_0x987d('0x33')],'UserId':_0x1ba8be['id'],'queue_name':_0x5a9941[_0x987d('0x33')],'FaxQueueId':_0x5a9941['id'],'interface':util[_0x987d('0x60')](_0x987d('0x61'),_0x987d('0x62'),_0x1ba8be[_0x987d('0x33')]),'penalty':0x0,'paused':_0x1ba8be[_0x987d('0x5e')],'createdAt':_0x1ba8be[_0x987d('0x5f')],'updatedAt':_0x1ba8be['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x315afb,_0x5b2692))[_0x987d('0x47')](handleError(_0x315afb,null));};exports['getTeams']=function(_0x5278e5,_0x30c614,_0x59e05f){var _0x141d13={};var _0x426d24={};var _0x285ff0;var _0xc80244;return db[_0x987d('0x2f')]['findOne']({'where':{'id':_0x5278e5[_0x987d('0x48')]['id']}})['then'](handleEntityNotFound(_0x30c614,null))[_0x987d('0x29')](function(_0x225aa3){if(_0x225aa3){_0x285ff0=_0x225aa3;_0x426d24['model']=_['keys'](db['Team'][_0x987d('0x30')]);_0x426d24['query']=_[_0x987d('0x34')](_0x5278e5[_0x987d('0x35')]);_0x426d24['filters']=_[_0x987d('0x49')](_0x426d24[_0x987d('0x37')],_0x426d24[_0x987d('0x35')]);_0x141d13[_0x987d('0x38')]=_[_0x987d('0x49')](_0x426d24[_0x987d('0x37')],qs[_0x987d('0x39')](_0x5278e5['query'][_0x987d('0x39')]));_0x141d13['attributes']=_0x141d13['attributes'][_0x987d('0x3a')]?_0x141d13['attributes']:_0x426d24[_0x987d('0x37')];_0x141d13[_0x987d('0x3d')]=qs['sort'](_0x5278e5[_0x987d('0x35')][_0x987d('0x3e')]);_0x141d13['where']=qs[_0x987d('0x36')](_[_0x987d('0x40')](_0x5278e5[_0x987d('0x35')],_0x426d24['filters']));if(_0x5278e5[_0x987d('0x35')]['filter']){_0x141d13['where']=_['merge'](_0x141d13['where'],{'$or':_[_0x987d('0x2e')](_0x141d13['attributes'],function(_0x5166ee){var _0x52d3a4={};_0x52d3a4[_0x5166ee]={'$like':'%'+_0x5278e5[_0x987d('0x35')][_0x987d('0x41')]+'%'};return _0x52d3a4;})});}_0x141d13=_[_0x987d('0x4b')]({},_0x141d13,_0x5278e5[_0x987d('0x43')]);return _0x285ff0['getTeams'](_0x141d13);}})['then'](function(_0x4130c9){if(_0x4130c9){_0xc80244=_0x4130c9[_0x987d('0x3a')];if(!_0x5278e5[_0x987d('0x35')]['hasOwnProperty'](_0x987d('0x3c'))){_0x141d13[_0x987d('0x20')]=qs['limit'](_0x5278e5['query'][_0x987d('0x20')]);_0x141d13[_0x987d('0x1e')]=qs[_0x987d('0x1e')](_0x5278e5[_0x987d('0x35')][_0x987d('0x1e')]);}return _0x285ff0[_0x987d('0x63')](_0x141d13);}})[_0x987d('0x29')](function(_0x52786a){if(_0x52786a){return _0x52786a?{'count':_0xc80244,'rows':_0x52786a}:null;}})[_0x987d('0x29')](respondWithResult(_0x30c614,null))[_0x987d('0x47')](handleError(_0x30c614,null));};exports['addTeams']=function(_0x4c7c8,_0x43c78b,_0x4148ff){var _0x25c101=_0x4c7c8[_0x987d('0x4d')]['ids'];return db['Team'][_0x987d('0x45')]({'where':{'id':_0x25c101},'attributes':['id'],'include':[{'model':db[_0x987d('0x5a')],'as':'Agents','attributes':['id',_0x987d('0x33'),'online',_0x987d('0x64'),_0x987d('0x65')],'raw':!![]}]})[_0x987d('0x29')](function(_0x35deb7){if(_0x35deb7){var _0x1079d8=_['flatMap'](_0x35deb7,function(_0x31f03d){var _0x363ac8=_0x31f03d[_0x987d('0x66')]({'plain':!![]});return _0x363ac8['Agents'];});return db[_0x987d('0x2f')][_0x987d('0x51')]({'where':{'id':_0x4c7c8[_0x987d('0x48')]['id']}})['then'](function(_0x228451){return db[_0x987d('0x67')][_0x987d('0x68')](function(_0x440c30){return _0x228451['addTeams'](_0x25c101,{'transaction':_0x440c30})['then'](function(){return BPromise[_0x987d('0x69')](_0x1079d8,function(_0x5120b0){return db[_0x987d('0x59')][_0x987d('0x6a')]({'where':{'UserId':_0x5120b0['id'],'FaxQueueId':_0x4c7c8[_0x987d('0x48')]['id']},'transaction':_0x440c30});});})[_0x987d('0x29')](function(){_0x1079d8[_0x987d('0x6b')](function(_0x5833e1){socket[_0x987d('0x6c')](_0x987d('0x6d'),{'UserId':_0x5833e1['id'],'FaxQueueId':_0x228451['id']});});});});});}})[_0x987d('0x29')](respondWithStatusCode(_0x43c78b,null))['catch'](handleError(_0x43c78b,null));};exports[_0x987d('0x6e')]=function(_0x435ed3,_0xcdd2b7,_0x3c72c1){return db[_0x987d('0x6f')][_0x987d('0x45')]({'where':{'id':_0x435ed3[_0x987d('0x35')][_0x987d('0x70')]},'attributes':['id'],'include':[{'model':db[_0x987d('0x5a')],'as':_0x987d('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xcdd2b7,null))[_0x987d('0x29')](function(_0x2866c8){var _0x444829=_[_0x987d('0x2e')](_0x2866c8,'id');var _0x246b83=[];var _0x5e32ad=[];var _0x5c7dbe=squel[_0x987d('0x72')]();_0x5c7dbe[_0x987d('0x73')](_0x987d('0x74'))['from'](_0x987d('0x75'),'tq')[_0x987d('0x76')](_0x987d('0x77'),'ut',_0x987d('0x78'))[_0x987d('0x3f')](_0x987d('0x79'),_0x435ed3['params']['id']);for(var _0x4bca41=0x0;_0x4bca41<_0x2866c8[_0x987d('0x3a')];_0x4bca41+=0x1){let _0x2f7368=_0x2866c8[_0x4bca41];for(var _0x58893b=0x0;_0x58893b<_0x2f7368[_0x987d('0x71')]['length'];_0x58893b+=0x1){let _0x3ee297=_0x2f7368[_0x987d('0x71')][_0x58893b];var _0x4ec4d8=_0x5c7dbe[_0x987d('0x7a')]();_0x4ec4d8[_0x987d('0x3f')](_0x987d('0x7b'),_0x3ee297['id']);_0x5e32ad[_0x987d('0x7c')](db[_0x987d('0x67')][_0x987d('0x35')](_0x4ec4d8['toString'](),{'type':db[_0x987d('0x67')][_0x987d('0x7d')]['SELECT']})[_0x987d('0x29')](function(_0x337011){if(_0x337011[_0x987d('0x3a')]===0x1){return _0x3ee297['id'];}else{var _0x33b35e=_[_0x987d('0x7e')](_['map'](_0x337011,_0x987d('0x7f')),function(_0x383ef9){return _['includes'](_0x444829,_0x383ef9);});if(_0x33b35e){return _0x3ee297['id'];}}}));}}return BPromise[_0x987d('0x80')](_0x5e32ad)[_0x987d('0x29')](function(_0x3524f5){_0x246b83=_(_0x246b83)[_0x987d('0x81')](_0x3524f5)[_0x987d('0x82')]()['value']();return db[_0x987d('0x2f')][_0x987d('0x51')]({'where':{'id':_0x435ed3[_0x987d('0x48')]['id']}})[_0x987d('0x29')](function(_0x316aec){return db['sequelize']['transaction'](function(_0x166974){return _0x316aec['removeTeams'](_0x435ed3[_0x987d('0x35')][_0x987d('0x70')],{'transaction':_0x166974})[_0x987d('0x29')](function(){if(!_['isEmpty'](_0x246b83)){return _0x316aec[_0x987d('0x83')](_0x246b83,{'transaction':_0x166974});}})[_0x987d('0x29')](function(){_0x246b83[_0x987d('0x6b')](function(_0x409df2){socket['emit'](_0x987d('0x84'),{'UserId':_0x409df2,'FaxQueueId':_0x316aec['id']});});});});});});})[_0x987d('0x29')](respondWithStatusCode(_0xcdd2b7,null))['catch'](handleError(_0xcdd2b7,null));};exports[_0x987d('0x85')]=function(_0x53b7b4,_0x2f7fb7,_0x36a443){return db[_0x987d('0x2f')][_0x987d('0x51')]({'where':{'id':_0x53b7b4['params']['id']}})['then'](handleEntityNotFound(_0x2f7fb7,null))[_0x987d('0x29')](function(_0x2f4610){if(_0x2f4610){return _0x2f4610[_0x987d('0x85')](_0x53b7b4[_0x987d('0x4d')][_0x987d('0x70')],_[_0x987d('0x86')](_0x53b7b4[_0x987d('0x4d')],[_0x987d('0x70'),'id'])||{})[_0x987d('0x87')](function(_0x1e6f0b){for(var _0x5aa7dd=0x0;_0x5aa7dd<_0x53b7b4['body'][_0x987d('0x70')][_0x987d('0x3a')];_0x5aa7dd+=0x1){socket[_0x987d('0x6c')](_0x987d('0x6d'),{'UserId':Number(_0x53b7b4[_0x987d('0x4d')][_0x987d('0x70')][_0x5aa7dd]),'FaxQueueId':Number(_0x53b7b4['params']['id'])});}return _0x1e6f0b;});}})[_0x987d('0x29')](respondWithResult(_0x2f7fb7,null))[_0x987d('0x47')](handleError(_0x2f7fb7,null));};exports['removeAgents']=function(_0x3778df,_0x5b2cd9,_0x330d83){return db[_0x987d('0x2f')]['find']({'where':{'id':_0x3778df['params']['id']}})[_0x987d('0x29')](handleEntityNotFound(_0x5b2cd9,null))['then'](function(_0x36f4ed){if(_0x36f4ed){return _0x36f4ed[_0x987d('0x83')](_0x3778df[_0x987d('0x35')]['ids'])[_0x987d('0x29')](function(){if(_[_0x987d('0x88')](_0x3778df[_0x987d('0x35')]['ids'])){for(var _0x46a2dd=0x0;_0x46a2dd<_0x3778df['query'][_0x987d('0x70')][_0x987d('0x3a')];_0x46a2dd+=0x1){socket[_0x987d('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0x3778df[_0x987d('0x35')][_0x987d('0x70')][_0x46a2dd]),'FaxQueueId':Number(_0x3778df[_0x987d('0x48')]['id'])});}}else{socket['emit'](_0x987d('0x84'),{'UserId':Number(_0x3778df[_0x987d('0x35')][_0x987d('0x70')]),'FaxQueueId':Number(_0x3778df[_0x987d('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b2cd9,null))['catch'](handleError(_0x5b2cd9,null));};exports[_0x987d('0x89')]=function(_0x1d42e6,_0x38bd9b,_0x4bb0cd){var _0x31e788={};var _0x4e08da={};var _0x4d2573;var _0xb4580c;return db['FaxQueue']['findOne']({'where':{'id':_0x1d42e6[_0x987d('0x48')]['id']}})[_0x987d('0x29')](handleEntityNotFound(_0x38bd9b,null))[_0x987d('0x29')](function(_0x12f2c1){if(_0x12f2c1){_0x4d2573=_0x12f2c1;_0x4e08da[_0x987d('0x37')]=_[_0x987d('0x34')](db['User'][_0x987d('0x30')]);_0x4e08da['query']=_['keys'](_0x1d42e6[_0x987d('0x35')]);_0x4e08da[_0x987d('0x36')]=_[_0x987d('0x49')](_0x4e08da[_0x987d('0x37')],_0x4e08da[_0x987d('0x35')]);_0x31e788[_0x987d('0x38')]=_[_0x987d('0x49')](_0x4e08da['model'],qs[_0x987d('0x39')](_0x1d42e6[_0x987d('0x35')][_0x987d('0x39')]));_0x31e788[_0x987d('0x38')]=_0x31e788[_0x987d('0x38')]['length']?_0x31e788[_0x987d('0x38')]:_0x4e08da['model'];_0x31e788[_0x987d('0x3d')]=qs[_0x987d('0x3e')](_0x1d42e6[_0x987d('0x35')][_0x987d('0x3e')]);_0x31e788['where']=qs[_0x987d('0x36')](_[_0x987d('0x40')](_0x1d42e6[_0x987d('0x35')],_0x4e08da[_0x987d('0x36')]));if(_0x1d42e6[_0x987d('0x35')]['filter']){_0x31e788[_0x987d('0x3f')]=_[_0x987d('0x4b')](_0x31e788['where'],{'$or':_['map'](_0x31e788[_0x987d('0x38')],function(_0x2d3afc){var _0x56f7d5={};_0x56f7d5[_0x2d3afc]={'$like':'%'+_0x1d42e6[_0x987d('0x35')][_0x987d('0x41')]+'%'};return _0x56f7d5;})});}_0x31e788=_['merge']({},_0x31e788,_0x1d42e6['options']);return _0x4d2573[_0x987d('0x89')](_0x31e788);}})['then'](function(_0x5a9439){if(_0x5a9439){_0xb4580c=_0x5a9439[_0x987d('0x3a')];if(!_0x1d42e6[_0x987d('0x35')][_0x987d('0x3b')]('nolimit')){_0x31e788[_0x987d('0x20')]=qs[_0x987d('0x20')](_0x1d42e6['query']['limit']);_0x31e788[_0x987d('0x1e')]=qs[_0x987d('0x1e')](_0x1d42e6[_0x987d('0x35')][_0x987d('0x1e')]);}return _0x4d2573[_0x987d('0x89')](_0x31e788);}})[_0x987d('0x29')](function(_0x376806){if(_0x376806){return _0x376806?{'count':_0xb4580c,'rows':_0x376806}:null;}})['then'](respondWithResult(_0x38bd9b,null))[_0x987d('0x47')](handleError(_0x38bd9b,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 16d396f..3f7483e 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 _0x0925=['events','../../mysqldb','FaxQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x3aad4d,_0x5bdcb6){var _0x2e3ae4=function(_0x3f06a3){while(--_0x3f06a3){_0x3aad4d['push'](_0x3aad4d['shift']());}};_0x2e3ae4(++_0x5bdcb6);}(_0x0925,0xc6));var _0x5092=function(_0x544754,_0x386539){_0x544754=_0x544754-0x0;var _0x4dfea8=_0x0925[_0x544754];return _0x4dfea8;};'use strict';var EventEmitter=require(_0x5092('0x0'));var FaxQueue=require(_0x5092('0x1'))['db'][_0x5092('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5092('0x3')](0x0);var events={'afterCreate':_0x5092('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b26f4){return function(_0x25fd38,_0x4a272b,_0x58fd08){FaxQueueEvents[_0x5092('0x5')](_0x3b26f4+':'+_0x25fd38['id'],_0x25fd38);FaxQueueEvents[_0x5092('0x5')](_0x3b26f4,_0x25fd38);_0x58fd08(null);};}for(var e in events){if(events[_0x5092('0x6')](e)){var event=events[e];FaxQueue[_0x5092('0x7')](e,emitEvent(event));}}module[_0x5092('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x8553=['save','update','emit','hasOwnProperty','exports','events','FaxQueue'];(function(_0x2bcdf4,_0x1a2f20){var _0x4a0f7a=function(_0x1e924f){while(--_0x1e924f){_0x2bcdf4['push'](_0x2bcdf4['shift']());}};_0x4a0f7a(++_0x1a2f20);}(_0x8553,0x10f));var _0x3855=function(_0x20c9a6,_0x3d0b2a){_0x20c9a6=_0x20c9a6-0x0;var _0x4a1e1e=_0x8553[_0x20c9a6];return _0x4a1e1e;};'use strict';var EventEmitter=require(_0x3855('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x3855('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3855('0x2'),'afterUpdate':_0x3855('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4dba42){return function(_0x3bc793,_0x58f1e1,_0x376a1b){FaxQueueEvents[_0x3855('0x4')](_0x4dba42+':'+_0x3bc793['id'],_0x3bc793);FaxQueueEvents[_0x3855('0x4')](_0x4dba42,_0x3bc793);_0x376a1b(null);};}for(var e in events){if(events[_0x3855('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3855('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 6d9964f..0e8b87d 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 _0xf237=['FaxQueue','fax_queues','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x548fe9,_0x1950e2){var _0x3c9dd3=function(_0x36c09e){while(--_0x36c09e){_0x548fe9['push'](_0x548fe9['shift']());}};_0x3c9dd3(++_0x1950e2);}(_0xf237,0x120));var _0x7f23=function(_0x4429e7,_0x526de3){_0x4429e7=_0x4429e7-0x0;var _0x491054=_0xf237[_0x4429e7];return _0x491054;};'use strict';var _=require(_0x7f23('0x0'));var util=require('util');var logger=require(_0x7f23('0x1'))(_0x7f23('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f23('0x3'));var fs=require('fs');var path=require(_0x7f23('0x4'));var rimraf=require(_0x7f23('0x5'));var config=require(_0x7f23('0x6'));var attributes=require('./faxQueue.attributes');module[_0x7f23('0x7')]=function(_0x10847d,_0x4fe594){return _0x10847d[_0x7f23('0x8')](_0x7f23('0x9'),attributes,{'tableName':_0x7f23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3508=['api','bluebird','request-promise','path','exports','FaxQueue','lodash','util','../../config/logger'];(function(_0x5011b6,_0x2391f6){var _0x1012fd=function(_0x1692b7){while(--_0x1692b7){_0x5011b6['push'](_0x5011b6['shift']());}};_0x1012fd(++_0x2391f6);}(_0x3508,0x1da));var _0x8350=function(_0x3440b3,_0x491cd4){_0x3440b3=_0x3440b3-0x0;var _0x1fd4db=_0x3508[_0x3440b3];return _0x1fd4db;};'use strict';var _=require(_0x8350('0x0'));var util=require(_0x8350('0x1'));var logger=require(_0x8350('0x2'))(_0x8350('0x3'));var moment=require('moment');var BPromise=require(_0x8350('0x4'));var rp=require(_0x8350('0x5'));var fs=require('fs');var path=require(_0x8350('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x8350('0x7')]=function(_0x467374,_0x210e9d){return _0x467374['define'](_0x8350('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 017d251..21740ee 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 _0xe2f8=['lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','where','ShowFaxQueue'];(function(_0x4ad71f,_0x5166de){var _0x3ff9b5=function(_0x45204e){while(--_0x45204e){_0x4ad71f['push'](_0x4ad71f['shift']());}};_0x3ff9b5(++_0x5166de);}(_0xe2f8,0x94));var _0x8e2f=function(_0x5f35ef,_0x30b358){_0x5f35ef=_0x5f35ef-0x0;var _0x32f38d=_0xe2f8[_0x5f35ef];return _0x32f38d;};'use strict';var _=require(_0x8e2f('0x0'));var util=require(_0x8e2f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e2f('0x2'));var fs=require('fs');var Redis=require(_0x8e2f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e2f('0x4'));var logger=require(_0x8e2f('0x5'))(_0x8e2f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e2f('0x7')]['http']({'port':0x232a});config[_0x8e2f('0x8')]=_[_0x8e2f('0x9')](config['redis'],{'host':_0x8e2f('0xa'),'port':0x18eb});var socket=require(_0x8e2f('0xb'))(new Redis(config[_0x8e2f('0x8')]));require(_0x8e2f('0xc'))[_0x8e2f('0xd')](socket);function respondWithRpcPromise(_0x55de23,_0x34c6b3,_0x1d2fd6){return new BPromise(function(_0x5be9d6,_0x547104){return client[_0x8e2f('0xe')](_0x55de23,_0x1d2fd6)[_0x8e2f('0xf')](function(_0x4bdeac){logger[_0x8e2f('0x10')](_0x8e2f('0x11'),_0x34c6b3,_0x8e2f('0x12'));logger[_0x8e2f('0x13')](_0x8e2f('0x14'),_0x34c6b3,_0x8e2f('0x12'),JSON['stringify'](_0x4bdeac));if(_0x4bdeac['error']){if(_0x4bdeac[_0x8e2f('0x15')][_0x8e2f('0x16')]===0x1f4){logger['error'](_0x8e2f('0x11'),_0x34c6b3,_0x4bdeac[_0x8e2f('0x15')][_0x8e2f('0x17')]);return _0x547104(_0x4bdeac['error'][_0x8e2f('0x17')]);}logger['error'](_0x8e2f('0x11'),_0x34c6b3,_0x4bdeac[_0x8e2f('0x15')][_0x8e2f('0x17')]);return _0x5be9d6(_0x4bdeac[_0x8e2f('0x15')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x34c6b3,_0x8e2f('0x12'));_0x5be9d6(_0x4bdeac[_0x8e2f('0x18')][_0x8e2f('0x17')]);}})[_0x8e2f('0x19')](function(_0x22a3a1){logger[_0x8e2f('0x15')]('FaxQueue,\x20%s,\x20%s',_0x34c6b3,_0x22a3a1);_0x547104(_0x22a3a1);});});}exports[_0x8e2f('0x1a')]=function(_0x34ca21){var _0x2e227c=this;return new Promise(function(_0x4152f3,_0x59ce09){return db['FaxQueue'][_0x8e2f('0x1b')]({'raw':_0x34ca21['options']?_0x34ca21[_0x8e2f('0x1c')][_0x8e2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x34ca21[_0x8e2f('0x1c')]?_0x34ca21[_0x8e2f('0x1c')]['where']||null:null,'attributes':_0x34ca21[_0x8e2f('0x1c')]?_0x34ca21['options'][_0x8e2f('0x1e')]||null:null,'limit':_0x34ca21[_0x8e2f('0x1c')]?_0x34ca21['options'][_0x8e2f('0x1f')]||null:null,'include':_0x34ca21[_0x8e2f('0x1c')]?_0x34ca21['options'][_0x8e2f('0x20')]?_[_0x8e2f('0x21')](_0x34ca21[_0x8e2f('0x1c')][_0x8e2f('0x20')],function(_0x296efd){return{'model':db[_0x296efd[_0x8e2f('0x22')]],'as':_0x296efd['as'],'attributes':_0x296efd['attributes'],'include':_0x296efd['include']?_[_0x8e2f('0x21')](_0x296efd['include'],function(_0x2650c2){return{'model':db[_0x2650c2[_0x8e2f('0x22')]],'as':_0x2650c2['as'],'attributes':_0x2650c2[_0x8e2f('0x1e')],'include':_0x2650c2['include']?_['map'](_0x2650c2[_0x8e2f('0x20')],function(_0x5c5b90){return{'model':db[_0x5c5b90[_0x8e2f('0x22')]],'as':_0x5c5b90['as'],'attributes':_0x5c5b90[_0x8e2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8e2f('0xf')](function(_0x229363){logger[_0x8e2f('0x10')]('GetFaxQueue',_0x34ca21);logger[_0x8e2f('0x13')](_0x8e2f('0x1a'),_0x34ca21,JSON['stringify'](_0x229363));_0x4152f3(_0x229363);})[_0x8e2f('0x19')](function(_0x403e36){logger['error'](_0x8e2f('0x1a'),_0x403e36[_0x8e2f('0x17')],_0x34ca21);_0x59ce09(_0x2e227c[_0x8e2f('0x15')](0x1f4,_0x403e36[_0x8e2f('0x17')]));});});};exports['ShowFaxQueue']=function(_0x1c40e4){var _0x3f13c9=this;return new Promise(function(_0x10b537,_0x19b394){return db['FaxQueue']['find']({'raw':_0x1c40e4['options']?_0x1c40e4[_0x8e2f('0x1c')][_0x8e2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c40e4[_0x8e2f('0x1c')]?_0x1c40e4['options'][_0x8e2f('0x23')]||null:null,'attributes':_0x1c40e4['options']?_0x1c40e4[_0x8e2f('0x1c')][_0x8e2f('0x1e')]||null:null,'include':_0x1c40e4[_0x8e2f('0x1c')]?_0x1c40e4[_0x8e2f('0x1c')][_0x8e2f('0x20')]?_['map'](_0x1c40e4[_0x8e2f('0x1c')][_0x8e2f('0x20')],function(_0x4dfa91){return{'model':db[_0x4dfa91[_0x8e2f('0x22')]],'as':_0x4dfa91['as'],'attributes':_0x4dfa91[_0x8e2f('0x1e')],'include':_0x4dfa91['include']?_[_0x8e2f('0x21')](_0x4dfa91[_0x8e2f('0x20')],function(_0x41748c){return{'model':db[_0x41748c[_0x8e2f('0x22')]],'as':_0x41748c['as'],'attributes':_0x41748c[_0x8e2f('0x1e')],'include':_0x41748c['include']?_['map'](_0x41748c[_0x8e2f('0x20')],function(_0x17bdd2){return{'model':db[_0x17bdd2[_0x8e2f('0x22')]],'as':_0x17bdd2['as'],'attributes':_0x17bdd2[_0x8e2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8e2f('0xf')](function(_0x25ce82){logger['info'](_0x8e2f('0x24'),_0x1c40e4);logger[_0x8e2f('0x13')](_0x8e2f('0x24'),_0x1c40e4,JSON['stringify'](_0x25ce82));_0x10b537(_0x25ce82);})[_0x8e2f('0x19')](function(_0x502d69){logger[_0x8e2f('0x15')](_0x8e2f('0x24'),_0x502d69[_0x8e2f('0x17')],_0x1c40e4);_0x19b394(_0x3f13c9[_0x8e2f('0x15')](0x1f4,_0x502d69[_0x8e2f('0x17')]));});});}; \ No newline at end of file +var _0x5798=['ShowFaxQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','info'];(function(_0x42a545,_0x43b019){var _0x479d8d=function(_0x14032b){while(--_0x14032b){_0x42a545['push'](_0x42a545['shift']());}};_0x479d8d(++_0x43b019);}(_0x5798,0x104));var _0x8579=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x5798[_0x72895a];return _0x5226d5;};'use strict';var _=require(_0x8579('0x0'));var util=require('util');var moment=require(_0x8579('0x1'));var BPromise=require(_0x8579('0x2'));var rs=require(_0x8579('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8579('0x4'))['db'];var utils=require(_0x8579('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8579('0x6'));var jayson=require(_0x8579('0x7'));var client=jayson['client'][_0x8579('0x8')]({'port':0x232a});config[_0x8579('0x9')]=_[_0x8579('0xa')](config[_0x8579('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8579('0xb'))(new Redis(config[_0x8579('0x9')]));require('./faxQueue.socket')[_0x8579('0xc')](socket);function respondWithRpcPromise(_0x22e4eb,_0x1b960b,_0x1a130a){return new BPromise(function(_0xebf6c2,_0x4891a0){return client['request'](_0x22e4eb,_0x1a130a)[_0x8579('0xd')](function(_0x469912){logger['info']('FaxQueue,\x20%s,\x20%s',_0x1b960b,_0x8579('0xe'));logger[_0x8579('0xf')](_0x8579('0x10'),_0x1b960b,'request\x20sent',JSON[_0x8579('0x11')](_0x469912));if(_0x469912[_0x8579('0x12')]){if(_0x469912[_0x8579('0x12')][_0x8579('0x13')]===0x1f4){logger[_0x8579('0x12')](_0x8579('0x14'),_0x1b960b,_0x469912[_0x8579('0x12')][_0x8579('0x15')]);return _0x4891a0(_0x469912[_0x8579('0x12')][_0x8579('0x15')]);}logger['error'](_0x8579('0x14'),_0x1b960b,_0x469912[_0x8579('0x12')][_0x8579('0x15')]);return _0xebf6c2(_0x469912[_0x8579('0x12')][_0x8579('0x15')]);}else{logger['info'](_0x8579('0x14'),_0x1b960b,_0x8579('0xe'));_0xebf6c2(_0x469912[_0x8579('0x16')][_0x8579('0x15')]);}})[_0x8579('0x17')](function(_0x4a18ce){logger[_0x8579('0x12')](_0x8579('0x14'),_0x1b960b,_0x4a18ce);_0x4891a0(_0x4a18ce);});});}exports[_0x8579('0x18')]=function(_0x4651ea){var _0x24b5fd=this;return new Promise(function(_0x463122,_0x51d09e){return db['FaxQueue'][_0x8579('0x19')]({'raw':_0x4651ea[_0x8579('0x1a')]?_0x4651ea[_0x8579('0x1a')][_0x8579('0x1b')]===undefined?!![]:![]:!![],'where':_0x4651ea['options']?_0x4651ea['options'][_0x8579('0x1c')]||null:null,'attributes':_0x4651ea[_0x8579('0x1a')]?_0x4651ea[_0x8579('0x1a')][_0x8579('0x1d')]||null:null,'limit':_0x4651ea[_0x8579('0x1a')]?_0x4651ea[_0x8579('0x1a')][_0x8579('0x1e')]||null:null,'include':_0x4651ea[_0x8579('0x1a')]?_0x4651ea[_0x8579('0x1a')][_0x8579('0x1f')]?_[_0x8579('0x20')](_0x4651ea[_0x8579('0x1a')][_0x8579('0x1f')],function(_0x56e95a){return{'model':db[_0x56e95a[_0x8579('0x21')]],'as':_0x56e95a['as'],'attributes':_0x56e95a[_0x8579('0x1d')],'include':_0x56e95a[_0x8579('0x1f')]?_[_0x8579('0x20')](_0x56e95a[_0x8579('0x1f')],function(_0x22f33d){return{'model':db[_0x22f33d[_0x8579('0x21')]],'as':_0x22f33d['as'],'attributes':_0x22f33d[_0x8579('0x1d')],'include':_0x22f33d[_0x8579('0x1f')]?_[_0x8579('0x20')](_0x22f33d[_0x8579('0x1f')],function(_0x3992fc){return{'model':db[_0x3992fc['model']],'as':_0x3992fc['as'],'attributes':_0x3992fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x8579('0xd')](function(_0x25fc8b){logger['info']('GetFaxQueue',_0x4651ea);logger[_0x8579('0xf')](_0x8579('0x18'),_0x4651ea,JSON['stringify'](_0x25fc8b));_0x463122(_0x25fc8b);})[_0x8579('0x17')](function(_0x10b70b){logger[_0x8579('0x12')](_0x8579('0x18'),_0x10b70b[_0x8579('0x15')],_0x4651ea);_0x51d09e(_0x24b5fd['error'](0x1f4,_0x10b70b[_0x8579('0x15')]));});});};exports['ShowFaxQueue']=function(_0x24d97c){var _0x4e17ac=this;return new Promise(function(_0x49d465,_0x2c9c36){return db['FaxQueue'][_0x8579('0x22')]({'raw':_0x24d97c['options']?_0x24d97c[_0x8579('0x1a')][_0x8579('0x1b')]===undefined?!![]:![]:!![],'where':_0x24d97c[_0x8579('0x1a')]?_0x24d97c[_0x8579('0x1a')]['where']||null:null,'attributes':_0x24d97c[_0x8579('0x1a')]?_0x24d97c['options']['attributes']||null:null,'include':_0x24d97c[_0x8579('0x1a')]?_0x24d97c['options'][_0x8579('0x1f')]?_['map'](_0x24d97c[_0x8579('0x1a')][_0x8579('0x1f')],function(_0x3c227a){return{'model':db[_0x3c227a[_0x8579('0x21')]],'as':_0x3c227a['as'],'attributes':_0x3c227a[_0x8579('0x1d')],'include':_0x3c227a[_0x8579('0x1f')]?_[_0x8579('0x20')](_0x3c227a['include'],function(_0x5e8c2c){return{'model':db[_0x5e8c2c[_0x8579('0x21')]],'as':_0x5e8c2c['as'],'attributes':_0x5e8c2c[_0x8579('0x1d')],'include':_0x5e8c2c['include']?_[_0x8579('0x20')](_0x5e8c2c[_0x8579('0x1f')],function(_0xf2bcd5){return{'model':db[_0xf2bcd5['model']],'as':_0xf2bcd5['as'],'attributes':_0xf2bcd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x8579('0xd')](function(_0x462609){logger[_0x8579('0x23')]('ShowFaxQueue',_0x24d97c);logger['debug'](_0x8579('0x24'),_0x24d97c,JSON[_0x8579('0x11')](_0x462609));_0x49d465(_0x462609);})[_0x8579('0x17')](function(_0x336858){logger[_0x8579('0x12')](_0x8579('0x24'),_0x336858[_0x8579('0x15')],_0x24d97c);_0x2c9c36(_0x4e17ac[_0x8579('0x12')](0x1f4,_0x336858[_0x8579('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 47d2f3b..e3b99e6 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 _0x1326=['save','update','register','length','faxQueue:','./faxQueue.events'];(function(_0x401e62,_0x53bfd6){var _0x39c0e5=function(_0x1589e1){while(--_0x1589e1){_0x401e62['push'](_0x401e62['shift']());}};_0x39c0e5(++_0x53bfd6);}(_0x1326,0xdd));var _0x6132=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x1326[_0x590b61];return _0x1a14dc;};'use strict';var FaxQueueEvents=require(_0x6132('0x0'));var events=[_0x6132('0x1'),'remove',_0x6132('0x2')];function createListener(_0x406cfa,_0x2976be){return function(_0x39e653){_0x2976be['emit'](_0x406cfa,_0x39e653);};}function removeListener(_0x24974b,_0x4335e9){return function(){FaxQueueEvents['removeListener'](_0x24974b,_0x4335e9);};}exports[_0x6132('0x3')]=function(_0x297b04){for(var _0x1feb34=0x0,_0x40ae62=events[_0x6132('0x4')];_0x1feb34<_0x40ae62;_0x1feb34++){var _0x2ce902=events[_0x1feb34];var _0x11f440=createListener(_0x6132('0x5')+_0x2ce902,_0x297b04);FaxQueueEvents['on'](_0x2ce902,_0x11f440);}}; \ No newline at end of file +var _0x3304=['update','removeListener','register','length','faxQueue:'];(function(_0x1c8264,_0x40401d){var _0x5431f3=function(_0x544591){while(--_0x544591){_0x1c8264['push'](_0x1c8264['shift']());}};_0x5431f3(++_0x40401d);}(_0x3304,0xc8));var _0x4330=function(_0x5965a7,_0x2913b3){_0x5965a7=_0x5965a7-0x0;var _0x5365e7=_0x3304[_0x5965a7];return _0x5365e7;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0x4330('0x0')];function createListener(_0xdc234c,_0x4105f0){return function(_0x97d75c){_0x4105f0['emit'](_0xdc234c,_0x97d75c);};}function removeListener(_0xfd8c3e,_0x363ea6){return function(){FaxQueueEvents[_0x4330('0x1')](_0xfd8c3e,_0x363ea6);};}exports[_0x4330('0x2')]=function(_0x312352){for(var _0x59d5e8=0x0,_0x42050c=events[_0x4330('0x3')];_0x59d5e8<_0x42050c;_0x59d5e8++){var _0x37ee6c=events[_0x59d5e8];var _0x29dc64=createListener(_0x4330('0x4')+_0x37ee6c,_0x312352);FaxQueueEvents['on'](_0x37ee6c,_0x29dc64);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c8c27fe..b3a7a7f 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 _0x5fab=['/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers'];(function(_0x14df0e,_0x46040b){var _0x468f38=function(_0x59bb0c){while(--_0x59bb0c){_0x14df0e['push'](_0x14df0e['shift']());}};_0x468f38(++_0x46040b);}(_0x5fab,0x177));var _0xb5fa=function(_0x38495b,_0x11e1e2){_0x38495b=_0x38495b-0x0;var _0x529cd6=_0x5fab[_0x38495b];return _0x529cd6;};'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['get']('/:id/members',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getAgents']);router[_0xb5fa('0x14')]('/',auth[_0xb5fa('0xb')](),controller['create']);router[_0xb5fa('0x14')]('/:id/teams',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x15')]);router[_0xb5fa('0x14')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['addAgents']);router['put'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x16')]);router[_0xb5fa('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x18')]);router[_0xb5fa('0x17')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x17')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1a')]);module[_0xb5fa('0x1b')]=router; \ No newline at end of file +var _0xa809=['express','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addAgents','put','update','delete','removeTeams','/:id/users','exports','util'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xa809,0x1f3));var _0x9a80=function(_0x2efbdf,_0x24eaf6){_0x2efbdf=_0x2efbdf-0x0;var _0x544286=_0xa809[_0x2efbdf];return _0x544286;};'use strict';var multer=require('multer');var util=require(_0x9a80('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a80('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9a80('0x2'));var config=require(_0x9a80('0x3'));var controller=require(_0x9a80('0x4'));router[_0x9a80('0x5')]('/',auth['isAuthenticated'](),controller[_0x9a80('0x6')]);router['get'](_0x9a80('0x7'),auth[_0x9a80('0x8')](),controller['describe']);router[_0x9a80('0x5')](_0x9a80('0x9'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xa')]);router['get'](_0x9a80('0xb'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xc')]);router[_0x9a80('0x5')](_0x9a80('0xd'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xe')]);router[_0x9a80('0x5')]('/:id/users',auth[_0x9a80('0x8')](),controller[_0x9a80('0xf')]);router[_0x9a80('0x10')]('/',auth[_0x9a80('0x8')](),controller[_0x9a80('0x11')]);router[_0x9a80('0x10')](_0x9a80('0xd'),auth[_0x9a80('0x8')](),controller['addTeams']);router[_0x9a80('0x10')]('/:id/users',auth[_0x9a80('0x8')](),controller[_0x9a80('0x12')]);router[_0x9a80('0x13')]('/:id',auth[_0x9a80('0x8')](),controller[_0x9a80('0x14')]);router[_0x9a80('0x15')](_0x9a80('0x9'),auth[_0x9a80('0x8')](),controller['destroy']);router[_0x9a80('0x15')]('/:id/teams',auth[_0x9a80('0x8')](),controller[_0x9a80('0x16')]);router[_0x9a80('0x15')](_0x9a80('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9a80('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a61cf7a..b63e8dc 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 _0xb20f=['moment','sequelize','exports','STRING','DATE'];(function(_0x5d74ad,_0x48ae08){var _0x24e78e=function(_0x3d8d14){while(--_0x3d8d14){_0x5d74ad['push'](_0x5d74ad['shift']());}};_0x24e78e(++_0x48ae08);}(_0xb20f,0x1ef));var _0xfb20=function(_0x48d5b5,_0xad7948){_0x48d5b5=_0x48d5b5-0x0;var _0x7c85b6=_0xb20f[_0x48d5b5];return _0x7c85b6;};'use strict';var moment=require(_0xfb20('0x0'));var Sequelize=require(_0xfb20('0x1'));module[_0xfb20('0x2')]={'uniqueid':{'type':Sequelize[_0xfb20('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfb20('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfb20('0x4')]},'acceptAt':{'type':Sequelize[_0xfb20('0x4')]},'exitAt':{'type':Sequelize[_0xfb20('0x4')]},'reason':{'type':Sequelize[_0xfb20('0x3')]}}; \ No newline at end of file +var _0xa4d4=['sequelize','exports','STRING','DATE','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa4d4,0xef));var _0x4a4d=function(_0x23f170,_0x27385a){_0x23f170=_0x23f170-0x0;var _0x897a88=_0xa4d4[_0x23f170];return _0x897a88;};'use strict';var moment=require(_0x4a4d('0x0'));var Sequelize=require(_0x4a4d('0x1'));module[_0x4a4d('0x2')]={'uniqueid':{'type':Sequelize[_0x4a4d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4a4d('0x3')]},'joinAt':{'type':Sequelize[_0x4a4d('0x4')]},'leaveAt':{'type':Sequelize[_0x4a4d('0x4')]},'acceptAt':{'type':Sequelize[_0x4a4d('0x4')]},'exitAt':{'type':Sequelize[_0x4a4d('0x4')]},'reason':{'type':Sequelize[_0x4a4d('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1b7da4e..26b70a2 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 _0x710e=['type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','length','includeAll','find','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x710e,0xb6));var _0xe710=function(_0x289dac,_0x4f0322){_0x289dac=_0x289dac-0x0;var _0x1d6d08=_0x710e[_0x289dac];return _0x1d6d08;};'use strict';var emlformat=require(_0xe710('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe710('0x1'));var rp=require(_0xe710('0x2'));var moment=require(_0xe710('0x3'));var BPromise=require(_0xe710('0x4'));var Mustache=require(_0xe710('0x5'));var util=require('util');var path=require(_0xe710('0x6'));var sox=require(_0xe710('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe710('0x8'));var _=require(_0xe710('0x9'));var squel=require(_0xe710('0xa'));var crypto=require(_0xe710('0xb'));var jsforce=require(_0xe710('0xc'));var deskjs=require(_0xe710('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe710('0xe'));var authService=require(_0xe710('0xf'));var qs=require(_0xe710('0x10'));var as=require(_0xe710('0x11'));var hardwareService=require(_0xe710('0x12'));var logger=require(_0xe710('0x13'))(_0xe710('0x14'));var utils=require(_0xe710('0x15'));var config=require(_0xe710('0x16'));var licenseUtil=require(_0xe710('0x17'));var db=require(_0xe710('0x18'))['db'];function respondWithStatusCode(_0x25cef4,_0x2061a1){_0x2061a1=_0x2061a1||0xcc;return function(_0x546c5a){if(_0x546c5a){return _0x25cef4['sendStatus'](_0x2061a1);}return _0x25cef4[_0xe710('0x19')](_0x2061a1)[_0xe710('0x1a')]();};}function respondWithResult(_0x1af2ff,_0x183334){_0x183334=_0x183334||0xc8;return function(_0x422a84){if(_0x422a84){return _0x1af2ff[_0xe710('0x19')](_0x183334)['json'](_0x422a84);}};}function respondWithFilteredResult(_0x1a3def,_0xac5508){return function(_0x329590){if(_0x329590){var _0x145312=typeof _0xac5508[_0xe710('0x1b')]===_0xe710('0x1c')&&typeof _0xac5508[_0xe710('0x1d')]===_0xe710('0x1c');var _0x3daac1=_0x329590[_0xe710('0x1e')];var _0x417afd=_0x145312?0x0:_0xac5508[_0xe710('0x1b')];var _0x2b4efb=_0x145312?_0x329590['count']:_0xac5508[_0xe710('0x1b')]+_0xac5508['limit'];var _0x496b3a;if(_0x2b4efb>=_0x3daac1){_0x2b4efb=_0x3daac1;_0x496b3a=0xc8;}else{_0x496b3a=0xce;}_0x1a3def['status'](_0x496b3a);return _0x1a3def['set']('Content-Range',_0x417afd+'-'+_0x2b4efb+'/'+_0x3daac1)[_0xe710('0x1f')](_0x329590);}return null;};}function patchUpdates(_0x1d6a27){return function(_0x1c3d82){try{jsonpatch['apply'](_0x1c3d82,_0x1d6a27,!![]);}catch(_0x33597a){return BPromise['reject'](_0x33597a);}return _0x1c3d82[_0xe710('0x20')]();};}function saveUpdates(_0xf6a255,_0x2568e9){return function(_0x21b6b9){if(_0x21b6b9){return _0x21b6b9[_0xe710('0x21')](_0xf6a255)[_0xe710('0x22')](function(_0x41d924){return _0x41d924;});}return null;};}function removeEntity(_0x4de0fa,_0x54084a){return function(_0x2401ac){if(_0x2401ac){return _0x2401ac[_0xe710('0x23')]()['then'](function(){_0x4de0fa[_0xe710('0x19')](0xcc)[_0xe710('0x1a')]();});}};}function handleEntityNotFound(_0x34ab78,_0x3ce2ec){return function(_0x538063){if(!_0x538063){_0x34ab78[_0xe710('0x24')](0x194);}return _0x538063;};}function handleError(_0x191dbd,_0x3a6f1b){_0x3a6f1b=_0x3a6f1b||0x1f4;return function(_0x3e9998){logger[_0xe710('0x25')](_0x3e9998[_0xe710('0x26')]);if(_0x3e9998[_0xe710('0x27')]){delete _0x3e9998[_0xe710('0x27')];}_0x191dbd[_0xe710('0x19')](_0x3a6f1b)[_0xe710('0x28')](_0x3e9998);};}exports[_0xe710('0x29')]=function(_0x2d808c,_0x5df3fe){var _0x20cf73={},_0x2a620c={},_0xd4864a={'count':0x0,'rows':[]};var _0x469f7b=_[_0xe710('0x2a')](db[_0xe710('0x2b')][_0xe710('0x2c')],function(_0x15360f){return{'name':_0x15360f[_0xe710('0x2d')],'type':_0x15360f[_0xe710('0x2e')][_0xe710('0x2f')]};});_0x2a620c[_0xe710('0x30')]=_[_0xe710('0x2a')](_0x469f7b,'name');_0x2a620c[_0xe710('0x31')]=_['keys'](_0x2d808c['query']);_0x2a620c[_0xe710('0x32')]=_[_0xe710('0x33')](_0x2a620c['model'],_0x2a620c[_0xe710('0x31')]);_0x20cf73[_0xe710('0x34')]=_[_0xe710('0x33')](_0x2a620c[_0xe710('0x30')],qs[_0xe710('0x35')](_0x2d808c[_0xe710('0x31')][_0xe710('0x35')]));_0x20cf73[_0xe710('0x34')]=_0x20cf73['attributes']['length']?_0x20cf73[_0xe710('0x34')]:_0x2a620c[_0xe710('0x30')];if(!_0x2d808c['query'][_0xe710('0x36')](_0xe710('0x37'))){_0x20cf73[_0xe710('0x1d')]=qs[_0xe710('0x1d')](_0x2d808c[_0xe710('0x31')]['limit']);_0x20cf73[_0xe710('0x1b')]=qs[_0xe710('0x1b')](_0x2d808c[_0xe710('0x31')][_0xe710('0x1b')]);}_0x20cf73[_0xe710('0x38')]=qs['sort'](_0x2d808c[_0xe710('0x31')][_0xe710('0x39')]);_0x20cf73[_0xe710('0x3a')]=qs[_0xe710('0x32')](_[_0xe710('0x3b')](_0x2d808c['query'],_0x2a620c[_0xe710('0x32')]),_0x469f7b);if(_0x2d808c[_0xe710('0x31')]['filter']){_0x20cf73[_0xe710('0x3a')]=_[_0xe710('0x3c')](_0x20cf73[_0xe710('0x3a')],{'$or':_[_0xe710('0x2a')](_0x469f7b,function(_0x19932d){if(_0x19932d[_0xe710('0x2e')]!==_0xe710('0x3d')){var _0x424b40={};_0x424b40[_0x19932d[_0xe710('0x27')]]={'$like':'%'+_0x2d808c[_0xe710('0x31')][_0xe710('0x3e')]+'%'};return _0x424b40;}})});}_0x20cf73=_[_0xe710('0x3c')]({},_0x20cf73,_0x2d808c[_0xe710('0x3f')]);var _0x1b4d4b={'where':_0x20cf73[_0xe710('0x3a')]};return db[_0xe710('0x2b')][_0xe710('0x1e')](_0x1b4d4b)[_0xe710('0x22')](function(_0x28d1a6){_0xd4864a[_0xe710('0x1e')]=_0x28d1a6;if(_0x2d808c[_0xe710('0x31')]['includeAll']){_0x20cf73[_0xe710('0x40')]=[{'all':!![]}];}return db[_0xe710('0x2b')][_0xe710('0x41')](_0x20cf73);})[_0xe710('0x22')](function(_0x559c8c){_0xd4864a[_0xe710('0x42')]=_0x559c8c;return _0xd4864a;})[_0xe710('0x22')](respondWithFilteredResult(_0x5df3fe,_0x20cf73))[_0xe710('0x43')](handleError(_0x5df3fe,null));};exports[_0xe710('0x44')]=function(_0x17262b,_0x1455eb){var _0x5dcf48={'raw':!![],'where':{'id':_0x17262b['params']['id']}},_0x3d6f00={};_0x3d6f00[_0xe710('0x30')]=_[_0xe710('0x45')](db['FaxQueueReport'][_0xe710('0x2c')]);_0x3d6f00['query']=_[_0xe710('0x45')](_0x17262b[_0xe710('0x31')]);_0x3d6f00[_0xe710('0x32')]=_[_0xe710('0x33')](_0x3d6f00['model'],_0x3d6f00[_0xe710('0x31')]);_0x5dcf48[_0xe710('0x34')]=_[_0xe710('0x33')](_0x3d6f00[_0xe710('0x30')],qs[_0xe710('0x35')](_0x17262b[_0xe710('0x31')][_0xe710('0x35')]));_0x5dcf48['attributes']=_0x5dcf48[_0xe710('0x34')][_0xe710('0x46')]?_0x5dcf48[_0xe710('0x34')]:_0x3d6f00[_0xe710('0x30')];if(_0x17262b[_0xe710('0x31')][_0xe710('0x47')]){_0x5dcf48[_0xe710('0x40')]=[{'all':!![]}];}_0x5dcf48=_['merge']({},_0x5dcf48,_0x17262b[_0xe710('0x3f')]);return db[_0xe710('0x2b')][_0xe710('0x48')](_0x5dcf48)['then'](handleEntityNotFound(_0x1455eb,null))['then'](respondWithResult(_0x1455eb,null))[_0xe710('0x43')](handleError(_0x1455eb,null));};exports['create']=function(_0x4ad532,_0x31b39c){return db[_0xe710('0x2b')]['create'](_0x4ad532['body'],{})[_0xe710('0x22')](respondWithResult(_0x31b39c,0xc9))[_0xe710('0x43')](handleError(_0x31b39c,null));};exports['update']=function(_0x12310f,_0x6a906b){if(_0x12310f['body']['id']){delete _0x12310f[_0xe710('0x49')]['id'];}return db[_0xe710('0x2b')][_0xe710('0x48')]({'where':{'id':_0x12310f[_0xe710('0x4a')]['id']}})[_0xe710('0x22')](handleEntityNotFound(_0x6a906b,null))[_0xe710('0x22')](saveUpdates(_0x12310f[_0xe710('0x49')],null))[_0xe710('0x22')](respondWithResult(_0x6a906b,null))['catch'](handleError(_0x6a906b,null));};exports['destroy']=function(_0x35376a,_0x2f87f9){return db['FaxQueueReport'][_0xe710('0x48')]({'where':{'id':_0x35376a[_0xe710('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f87f9,null))['then'](removeEntity(_0x2f87f9,null))[_0xe710('0x43')](handleError(_0x2f87f9,null));};exports[_0xe710('0x4b')]=function(_0x4ab705,_0x115419){return db[_0xe710('0x2b')][_0xe710('0x4b')]()['then'](respondWithResult(_0x115419,null))[_0xe710('0x43')](handleError(_0x115419,null));}; \ No newline at end of file +var _0x61a1=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','name','send','map','FaxQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','describe','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4466b8,_0x1fd0da){var _0x29c18a=function(_0x2671fa){while(--_0x2671fa){_0x4466b8['push'](_0x4466b8['shift']());}};_0x29c18a(++_0x1fd0da);}(_0x61a1,0x127));var _0x161a=function(_0xc36d01,_0x3bf1a6){_0xc36d01=_0xc36d01-0x0;var _0xecb231=_0x61a1[_0xc36d01];return _0xecb231;};'use strict';var emlformat=require(_0x161a('0x0'));var rimraf=require(_0x161a('0x1'));var zipdir=require(_0x161a('0x2'));var jsonpatch=require(_0x161a('0x3'));var rp=require(_0x161a('0x4'));var moment=require('moment');var BPromise=require(_0x161a('0x5'));var Mustache=require(_0x161a('0x6'));var util=require('util');var path=require(_0x161a('0x7'));var sox=require(_0x161a('0x8'));var csv=require(_0x161a('0x9'));var ejs=require(_0x161a('0xa'));var fs=require('fs');var fs_extra=require(_0x161a('0xb'));var _=require(_0x161a('0xc'));var squel=require(_0x161a('0xd'));var crypto=require(_0x161a('0xe'));var jsforce=require(_0x161a('0xf'));var deskjs=require(_0x161a('0x10'));var toCsv=require(_0x161a('0x9'));var querystring=require(_0x161a('0x11'));var Papa=require(_0x161a('0x12'));var Redis=require(_0x161a('0x13'));var authService=require(_0x161a('0x14'));var qs=require(_0x161a('0x15'));var as=require(_0x161a('0x16'));var hardwareService=require(_0x161a('0x17'));var logger=require(_0x161a('0x18'))(_0x161a('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x561e37,_0x2f61f0){_0x2f61f0=_0x2f61f0||0xcc;return function(_0xe588d6){if(_0xe588d6){return _0x561e37[_0x161a('0x1a')](_0x2f61f0);}return _0x561e37[_0x161a('0x1b')](_0x2f61f0)[_0x161a('0x1c')]();};}function respondWithResult(_0x2f6a2c,_0x891d45){_0x891d45=_0x891d45||0xc8;return function(_0x4a16a8){if(_0x4a16a8){return _0x2f6a2c['status'](_0x891d45)['json'](_0x4a16a8);}};}function respondWithFilteredResult(_0x2b2a3e,_0x42eebf){return function(_0x4cbdb3){if(_0x4cbdb3){var _0x359ccd=typeof _0x42eebf[_0x161a('0x1d')]==='undefined'&&typeof _0x42eebf[_0x161a('0x1e')]===_0x161a('0x1f');var _0x1dd836=_0x4cbdb3[_0x161a('0x20')];var _0x28c9bf=_0x359ccd?0x0:_0x42eebf[_0x161a('0x1d')];var _0x25a286=_0x359ccd?_0x4cbdb3[_0x161a('0x20')]:_0x42eebf[_0x161a('0x1d')]+_0x42eebf[_0x161a('0x1e')];var _0x4118fe;if(_0x25a286>=_0x1dd836){_0x25a286=_0x1dd836;_0x4118fe=0xc8;}else{_0x4118fe=0xce;}_0x2b2a3e[_0x161a('0x1b')](_0x4118fe);return _0x2b2a3e[_0x161a('0x21')]('Content-Range',_0x28c9bf+'-'+_0x25a286+'/'+_0x1dd836)[_0x161a('0x22')](_0x4cbdb3);}return null;};}function patchUpdates(_0x172488){return function(_0x8243dd){try{jsonpatch[_0x161a('0x23')](_0x8243dd,_0x172488,!![]);}catch(_0x1d14b0){return BPromise[_0x161a('0x24')](_0x1d14b0);}return _0x8243dd[_0x161a('0x25')]();};}function saveUpdates(_0x79e925,_0xffe8e1){return function(_0xa11a84){if(_0xa11a84){return _0xa11a84['update'](_0x79e925)[_0x161a('0x26')](function(_0x4bd93e){return _0x4bd93e;});}return null;};}function removeEntity(_0x40aedb,_0x2e7a46){return function(_0x4da7fa){if(_0x4da7fa){return _0x4da7fa[_0x161a('0x27')]()[_0x161a('0x26')](function(){_0x40aedb[_0x161a('0x1b')](0xcc)[_0x161a('0x1c')]();});}};}function handleEntityNotFound(_0x1541c6,_0x475c90){return function(_0x3e0d94){if(!_0x3e0d94){_0x1541c6[_0x161a('0x1a')](0x194);}return _0x3e0d94;};}function handleError(_0x5b54b3,_0x1c1964){_0x1c1964=_0x1c1964||0x1f4;return function(_0x1b10b0){logger['error'](_0x1b10b0['stack']);if(_0x1b10b0[_0x161a('0x28')]){delete _0x1b10b0[_0x161a('0x28')];}_0x5b54b3['status'](_0x1c1964)[_0x161a('0x29')](_0x1b10b0);};}exports['index']=function(_0x5def9c,_0x17cca5){var _0xdc57e={},_0x2c5039={},_0x6f840b={'count':0x0,'rows':[]};var _0x1b66dc=_[_0x161a('0x2a')](db[_0x161a('0x2b')]['rawAttributes'],function(_0x354db5){return{'name':_0x354db5[_0x161a('0x2c')],'type':_0x354db5[_0x161a('0x2d')][_0x161a('0x2e')]};});_0x2c5039['model']=_['map'](_0x1b66dc,_0x161a('0x28'));_0x2c5039[_0x161a('0x2f')]=_[_0x161a('0x30')](_0x5def9c[_0x161a('0x2f')]);_0x2c5039[_0x161a('0x31')]=_[_0x161a('0x32')](_0x2c5039[_0x161a('0x33')],_0x2c5039[_0x161a('0x2f')]);_0xdc57e['attributes']=_[_0x161a('0x32')](_0x2c5039[_0x161a('0x33')],qs[_0x161a('0x34')](_0x5def9c[_0x161a('0x2f')]['fields']));_0xdc57e[_0x161a('0x35')]=_0xdc57e[_0x161a('0x35')][_0x161a('0x36')]?_0xdc57e[_0x161a('0x35')]:_0x2c5039[_0x161a('0x33')];if(!_0x5def9c[_0x161a('0x2f')][_0x161a('0x37')](_0x161a('0x38'))){_0xdc57e['limit']=qs[_0x161a('0x1e')](_0x5def9c[_0x161a('0x2f')][_0x161a('0x1e')]);_0xdc57e[_0x161a('0x1d')]=qs['offset'](_0x5def9c[_0x161a('0x2f')][_0x161a('0x1d')]);}_0xdc57e['order']=qs[_0x161a('0x39')](_0x5def9c[_0x161a('0x2f')]['sort']);_0xdc57e[_0x161a('0x3a')]=qs[_0x161a('0x31')](_[_0x161a('0x3b')](_0x5def9c[_0x161a('0x2f')],_0x2c5039[_0x161a('0x31')]),_0x1b66dc);if(_0x5def9c[_0x161a('0x2f')][_0x161a('0x3c')]){_0xdc57e[_0x161a('0x3a')]=_[_0x161a('0x3d')](_0xdc57e[_0x161a('0x3a')],{'$or':_[_0x161a('0x2a')](_0x1b66dc,function(_0x13d61f){if(_0x13d61f[_0x161a('0x2d')]!==_0x161a('0x3e')){var _0x36deef={};_0x36deef[_0x13d61f[_0x161a('0x28')]]={'$like':'%'+_0x5def9c[_0x161a('0x2f')][_0x161a('0x3c')]+'%'};return _0x36deef;}})});}_0xdc57e=_[_0x161a('0x3d')]({},_0xdc57e,_0x5def9c[_0x161a('0x3f')]);var _0x4708fb={'where':_0xdc57e['where']};return db[_0x161a('0x2b')][_0x161a('0x20')](_0x4708fb)[_0x161a('0x26')](function(_0x2eaea6){_0x6f840b['count']=_0x2eaea6;if(_0x5def9c[_0x161a('0x2f')][_0x161a('0x40')]){_0xdc57e[_0x161a('0x41')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xdc57e);})['then'](function(_0x1e6bc0){_0x6f840b[_0x161a('0x42')]=_0x1e6bc0;return _0x6f840b;})[_0x161a('0x26')](respondWithFilteredResult(_0x17cca5,_0xdc57e))['catch'](handleError(_0x17cca5,null));};exports[_0x161a('0x43')]=function(_0x4dd881,_0x5b72aa){var _0x4f7d49={'raw':!![],'where':{'id':_0x4dd881[_0x161a('0x44')]['id']}},_0x45d930={};_0x45d930['model']=_[_0x161a('0x30')](db[_0x161a('0x2b')][_0x161a('0x45')]);_0x45d930[_0x161a('0x2f')]=_['keys'](_0x4dd881[_0x161a('0x2f')]);_0x45d930[_0x161a('0x31')]=_[_0x161a('0x32')](_0x45d930['model'],_0x45d930[_0x161a('0x2f')]);_0x4f7d49['attributes']=_[_0x161a('0x32')](_0x45d930[_0x161a('0x33')],qs[_0x161a('0x34')](_0x4dd881[_0x161a('0x2f')][_0x161a('0x34')]));_0x4f7d49[_0x161a('0x35')]=_0x4f7d49[_0x161a('0x35')][_0x161a('0x36')]?_0x4f7d49['attributes']:_0x45d930[_0x161a('0x33')];if(_0x4dd881[_0x161a('0x2f')][_0x161a('0x40')]){_0x4f7d49[_0x161a('0x41')]=[{'all':!![]}];}_0x4f7d49=_['merge']({},_0x4f7d49,_0x4dd881[_0x161a('0x3f')]);return db[_0x161a('0x2b')][_0x161a('0x46')](_0x4f7d49)[_0x161a('0x26')](handleEntityNotFound(_0x5b72aa,null))[_0x161a('0x26')](respondWithResult(_0x5b72aa,null))['catch'](handleError(_0x5b72aa,null));};exports[_0x161a('0x47')]=function(_0x51444d,_0xcc75e4){return db[_0x161a('0x2b')][_0x161a('0x47')](_0x51444d[_0x161a('0x48')],{})[_0x161a('0x26')](respondWithResult(_0xcc75e4,0xc9))['catch'](handleError(_0xcc75e4,null));};exports['update']=function(_0x1b744a,_0x24f920){if(_0x1b744a['body']['id']){delete _0x1b744a[_0x161a('0x48')]['id'];}return db[_0x161a('0x2b')]['find']({'where':{'id':_0x1b744a[_0x161a('0x44')]['id']}})[_0x161a('0x26')](handleEntityNotFound(_0x24f920,null))[_0x161a('0x26')](saveUpdates(_0x1b744a[_0x161a('0x48')],null))[_0x161a('0x26')](respondWithResult(_0x24f920,null))['catch'](handleError(_0x24f920,null));};exports['destroy']=function(_0xd13bfc,_0x4b5e03){return db[_0x161a('0x2b')]['find']({'where':{'id':_0xd13bfc[_0x161a('0x44')]['id']}})[_0x161a('0x26')](handleEntityNotFound(_0x4b5e03,null))[_0x161a('0x26')](removeEntity(_0x4b5e03,null))['catch'](handleError(_0x4b5e03,null));};exports[_0x161a('0x49')]=function(_0x2d8c2d,_0x53dc06){return db[_0x161a('0x2b')][_0x161a('0x49')]()[_0x161a('0x26')](respondWithResult(_0x53dc06,null))[_0x161a('0x4a')](handleError(_0x53dc06,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 64fcc46..bb1f12a 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 _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x3e6480,_0x2188a0){var _0x145f30=function(_0x39372e){while(--_0x39372e){_0x3e6480['push'](_0x3e6480['shift']());}};_0x145f30(++_0x2188a0);}(_0x0295,0x1f0));var _0x5029=function(_0x455161,_0x520f10){_0x455161=_0x455161-0x0;var _0x3e7c03=_0x0295[_0x455161];return _0x3e7c03;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2ef2b8,_0x3e46da){var _0x57979b=function(_0x5ec401){while(--_0x5ec401){_0x2ef2b8['push'](_0x2ef2b8['shift']());}};_0x57979b(++_0x3e46da);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index cb06dec..8de5c40 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 _0x2b2b=['../../config/environment','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','body','options','raw','CreateFaxQueueReport','debug','UpdateFaxQueueReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x2b2b,0x1d4));var _0xb2b2=function(_0x214d46,_0xb1fed1){_0x214d46=_0x214d46-0x0;var _0x5e1df3=_0x2b2b[_0x214d46];return _0x5e1df3;};'use strict';var _=require('lodash');var util=require(_0xb2b2('0x0'));var moment=require(_0xb2b2('0x1'));var BPromise=require(_0xb2b2('0x2'));var rs=require(_0xb2b2('0x3'));var fs=require('fs');var Redis=require(_0xb2b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2b2('0x5'));var logger=require(_0xb2b2('0x6'))(_0xb2b2('0x7'));var config=require(_0xb2b2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb2b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x576e47,_0x443847,_0x1642d7){return new BPromise(function(_0x41a1ed,_0x3217d4){return client['request'](_0x576e47,_0x1642d7)[_0xb2b2('0xa')](function(_0x1c0ebe){logger[_0xb2b2('0xb')](_0xb2b2('0xc'),_0x443847,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x443847,_0xb2b2('0xd'),JSON[_0xb2b2('0xe')](_0x1c0ebe));if(_0x1c0ebe[_0xb2b2('0xf')]){if(_0x1c0ebe[_0xb2b2('0xf')][_0xb2b2('0x10')]===0x1f4){logger['error'](_0xb2b2('0xc'),_0x443847,_0x1c0ebe['error'][_0xb2b2('0x11')]);return _0x3217d4(_0x1c0ebe[_0xb2b2('0xf')][_0xb2b2('0x11')]);}logger[_0xb2b2('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x443847,_0x1c0ebe[_0xb2b2('0xf')][_0xb2b2('0x11')]);return _0x41a1ed(_0x1c0ebe[_0xb2b2('0xf')][_0xb2b2('0x11')]);}else{logger[_0xb2b2('0xb')](_0xb2b2('0xc'),_0x443847,'request\x20sent');_0x41a1ed(_0x1c0ebe['result'][_0xb2b2('0x11')]);}})[_0xb2b2('0x12')](function(_0x12d3d6){logger['error'](_0xb2b2('0xc'),_0x443847,_0x12d3d6);_0x3217d4(_0x12d3d6);});});}exports['CreateFaxQueueReport']=function(_0x54fc3f){var _0x4219c7=this;return new Promise(function(_0xe1014c,_0x13faf2){return db['FaxQueueReport']['create'](_0x54fc3f[_0xb2b2('0x13')],{'raw':_0x54fc3f['options']?_0x54fc3f[_0xb2b2('0x14')][_0xb2b2('0x15')]===undefined?!![]:![]:!![]})[_0xb2b2('0xa')](function(_0x269c6d){logger[_0xb2b2('0xb')](_0xb2b2('0x16'),_0x54fc3f);logger[_0xb2b2('0x17')](_0xb2b2('0x16'),_0x54fc3f,JSON['stringify'](_0x269c6d));_0xe1014c(_0x269c6d);})[_0xb2b2('0x12')](function(_0x475aae){logger[_0xb2b2('0xf')](_0xb2b2('0x16'),_0x475aae[_0xb2b2('0x11')],_0x54fc3f);_0x13faf2(_0x4219c7[_0xb2b2('0xf')](0x1f4,_0x475aae['message']));});});};exports[_0xb2b2('0x18')]=function(_0x449111){var _0x3f8bb8=this;return new Promise(function(_0x5af88c,_0x301728){return db['FaxQueueReport'][_0xb2b2('0x19')](_0x449111[_0xb2b2('0x13')],{'raw':_0x449111[_0xb2b2('0x14')]?_0x449111[_0xb2b2('0x14')][_0xb2b2('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449111[_0xb2b2('0x14')]?_0x449111[_0xb2b2('0x14')][_0xb2b2('0x1a')]||null:null,'attributes':_0x449111[_0xb2b2('0x14')]?_0x449111[_0xb2b2('0x14')][_0xb2b2('0x1b')]||null:null,'limit':_0x449111['options']?_0x449111[_0xb2b2('0x14')]['limit']||null:null})[_0xb2b2('0xa')](function(_0x392a7d){logger['info'](_0xb2b2('0x18'),_0x449111);logger[_0xb2b2('0x17')](_0xb2b2('0x18'),_0x449111,JSON[_0xb2b2('0xe')](_0x392a7d));_0x5af88c(_0x392a7d);})[_0xb2b2('0x12')](function(_0x38d882){logger[_0xb2b2('0xf')]('UpdateFaxQueueReport',_0x38d882['message'],_0x449111);_0x301728(_0x3f8bb8['error'](0x1f4,_0x38d882[_0xb2b2('0x11')]));});});}; \ No newline at end of file +var _0xa0f2=['limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','FaxQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','CreateFaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','update','where','attributes'];(function(_0x1232f9,_0x5aa500){var _0x43f173=function(_0x3ff4a5){while(--_0x3ff4a5){_0x1232f9['push'](_0x1232f9['shift']());}};_0x43f173(++_0x5aa500);}(_0xa0f2,0x12a));var _0x2a0f=function(_0x1299c9,_0x9873c9){_0x1299c9=_0x1299c9-0x0;var _0x2e73ad=_0xa0f2[_0x1299c9];return _0x2e73ad;};'use strict';var _=require(_0x2a0f('0x0'));var util=require(_0x2a0f('0x1'));var moment=require(_0x2a0f('0x2'));var BPromise=require(_0x2a0f('0x3'));var rs=require(_0x2a0f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a0f('0x5'))['db'];var utils=require(_0x2a0f('0x6'));var logger=require(_0x2a0f('0x7'))('rpc');var config=require(_0x2a0f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2a0f('0x9')][_0x2a0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25671c,_0x4f2554,_0x10d875){return new BPromise(function(_0xf1619d,_0x5e0fc0){return client[_0x2a0f('0xb')](_0x25671c,_0x10d875)['then'](function(_0x5e24cc){logger['info'](_0x2a0f('0xc'),_0x4f2554,'request\x20sent');logger[_0x2a0f('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4f2554,'request\x20sent',JSON[_0x2a0f('0xe')](_0x5e24cc));if(_0x5e24cc[_0x2a0f('0xf')]){if(_0x5e24cc[_0x2a0f('0xf')][_0x2a0f('0x10')]===0x1f4){logger[_0x2a0f('0xf')](_0x2a0f('0xc'),_0x4f2554,_0x5e24cc['error'][_0x2a0f('0x11')]);return _0x5e0fc0(_0x5e24cc['error'][_0x2a0f('0x11')]);}logger['error'](_0x2a0f('0xc'),_0x4f2554,_0x5e24cc['error'][_0x2a0f('0x11')]);return _0xf1619d(_0x5e24cc[_0x2a0f('0xf')][_0x2a0f('0x11')]);}else{logger[_0x2a0f('0x12')](_0x2a0f('0xc'),_0x4f2554,_0x2a0f('0x13'));_0xf1619d(_0x5e24cc[_0x2a0f('0x14')][_0x2a0f('0x11')]);}})[_0x2a0f('0x15')](function(_0x2c2c20){logger[_0x2a0f('0xf')](_0x2a0f('0xc'),_0x4f2554,_0x2c2c20);_0x5e0fc0(_0x2c2c20);});});}exports[_0x2a0f('0x16')]=function(_0x3aa34f){var _0x16533b=this;return new Promise(function(_0x36c29a,_0x1e7b51){return db['FaxQueueReport'][_0x2a0f('0x17')](_0x3aa34f[_0x2a0f('0x18')],{'raw':_0x3aa34f[_0x2a0f('0x19')]?_0x3aa34f[_0x2a0f('0x19')][_0x2a0f('0x1a')]===undefined?!![]:![]:!![]})[_0x2a0f('0x1b')](function(_0x1357a0){logger['info']('CreateFaxQueueReport',_0x3aa34f);logger[_0x2a0f('0xd')]('CreateFaxQueueReport',_0x3aa34f,JSON['stringify'](_0x1357a0));_0x36c29a(_0x1357a0);})[_0x2a0f('0x15')](function(_0x2ed0f4){logger[_0x2a0f('0xf')](_0x2a0f('0x16'),_0x2ed0f4[_0x2a0f('0x11')],_0x3aa34f);_0x1e7b51(_0x16533b[_0x2a0f('0xf')](0x1f4,_0x2ed0f4[_0x2a0f('0x11')]));});});};exports[_0x2a0f('0x1c')]=function(_0x250918){var _0x4506fd=this;return new Promise(function(_0x60bad2,_0x130591){return db['FaxQueueReport'][_0x2a0f('0x1d')](_0x250918[_0x2a0f('0x18')],{'raw':_0x250918[_0x2a0f('0x19')]?_0x250918[_0x2a0f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250918['options']?_0x250918[_0x2a0f('0x19')][_0x2a0f('0x1e')]||null:null,'attributes':_0x250918['options']?_0x250918['options'][_0x2a0f('0x1f')]||null:null,'limit':_0x250918['options']?_0x250918[_0x2a0f('0x19')][_0x2a0f('0x20')]||null:null})[_0x2a0f('0x1b')](function(_0x3f113e){logger[_0x2a0f('0x12')](_0x2a0f('0x1c'),_0x250918);logger['debug']('UpdateFaxQueueReport',_0x250918,JSON['stringify'](_0x3f113e));_0x60bad2(_0x3f113e);})[_0x2a0f('0x15')](function(_0x5499c3){logger['error']('UpdateFaxQueueReport',_0x5499c3[_0x2a0f('0x11')],_0x250918);_0x130591(_0x4506fd[_0x2a0f('0xf')](0x1f4,_0x5499c3[_0x2a0f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4a73df2..30ab92c 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 _0xddb9=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','post'];(function(_0x16bb1c,_0x58f468){var _0xace56c=function(_0x216f59){while(--_0x216f59){_0x16bb1c['push'](_0x16bb1c['shift']());}};_0xace56c(++_0x58f468);}(_0xddb9,0x75));var _0x9ddb=function(_0x12d89d,_0x41cca1){_0x12d89d=_0x12d89d-0x0;var _0x1d268b=_0xddb9[_0x12d89d];return _0x1d268b;};'use strict';var multer=require('multer');var util=require(_0x9ddb('0x0'));var path=require(_0x9ddb('0x1'));var timeout=require(_0x9ddb('0x2'));var express=require(_0x9ddb('0x3'));var router=express[_0x9ddb('0x4')]();var fs_extra=require(_0x9ddb('0x5'));var auth=require(_0x9ddb('0x6'));var interaction=require(_0x9ddb('0x7'));var config=require(_0x9ddb('0x8'));var controller=require('./faxQueueReport.controller');router[_0x9ddb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9ddb('0xa')]);router['get'](_0x9ddb('0xb'),auth[_0x9ddb('0xc')](),controller[_0x9ddb('0xd')]);router[_0x9ddb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9ddb('0xe')]('/',auth[_0x9ddb('0xc')](),controller[_0x9ddb('0xf')]);router[_0x9ddb('0x10')](_0x9ddb('0x11'),auth['isAuthenticated'](),controller[_0x9ddb('0x12')]);router[_0x9ddb('0x13')](_0x9ddb('0x11'),auth[_0x9ddb('0xc')](),controller[_0x9ddb('0x14')]);module[_0x9ddb('0x15')]=router; \ No newline at end of file +var _0xae00=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xae00,0x18d));var _0x0ae0=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0xae00[_0x2dee2f];return _0x327c18;};'use strict';var multer=require(_0x0ae0('0x0'));var util=require(_0x0ae0('0x1'));var path=require(_0x0ae0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae0('0x3'));var router=express['Router']();var fs_extra=require(_0x0ae0('0x4'));var auth=require(_0x0ae0('0x5'));var interaction=require(_0x0ae0('0x6'));var config=require(_0x0ae0('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0ae0('0x8')]);router[_0x0ae0('0x9')](_0x0ae0('0xa'),auth[_0x0ae0('0xb')](),controller['describe']);router[_0x0ae0('0x9')](_0x0ae0('0xc'),auth[_0x0ae0('0xb')](),controller[_0x0ae0('0xd')]);router[_0x0ae0('0xe')]('/',auth[_0x0ae0('0xb')](),controller['create']);router[_0x0ae0('0xf')](_0x0ae0('0xc'),auth['isAuthenticated'](),controller[_0x0ae0('0x10')]);router[_0x0ae0('0x11')](_0x0ae0('0xc'),auth['isAuthenticated'](),controller[_0x0ae0('0x12')]);module[_0x0ae0('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 5793bbc..3a985f8 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0xf3c8e2,_0x317530){var _0x3372a3=function(_0xca45eb){while(--_0xca45eb){_0xf3c8e2['push'](_0xf3c8e2['shift']());}};_0x3372a3(++_0x317530);}(_0xf4eb,0xec));var _0xbf4e=function(_0xebefdd,_0x3e413e){_0xebefdd=_0xebefdd-0x0;var _0x4ed136=_0xf4eb[_0xebefdd];return _0x4ed136;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4fd976,_0x2d6add){_0x4fd976=_0x4fd976-0x0;var _0x2f04ad=_0x9bde[_0x4fd976];return _0x2f04ad;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a6ea1cc..2a4c217 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 _0x920c=['fieldName','key','model','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x920c,0x66));var _0xc920=function(_0x57d997,_0x367ce4){_0x57d997=_0x57d997-0x0;var _0x2cb473=_0x920c[_0x57d997];return _0x2cb473;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc920('0x0'));var zipdir=require(_0xc920('0x1'));var jsonpatch=require(_0xc920('0x2'));var rp=require('request-promise');var moment=require(_0xc920('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc920('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc920('0x5'));var csv=require(_0xc920('0x6'));var ejs=require(_0xc920('0x7'));var fs=require('fs');var fs_extra=require(_0xc920('0x8'));var _=require('lodash');var squel=require(_0xc920('0x9'));var crypto=require(_0xc920('0xa'));var jsforce=require(_0xc920('0xb'));var deskjs=require(_0xc920('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc920('0xd'));var Redis=require(_0xc920('0xe'));var authService=require(_0xc920('0xf'));var qs=require(_0xc920('0x10'));var as=require(_0xc920('0x11'));var hardwareService=require(_0xc920('0x12'));var logger=require(_0xc920('0x13'))(_0xc920('0x14'));var utils=require('../../config/utils');var config=require(_0xc920('0x15'));var licenseUtil=require(_0xc920('0x16'));var db=require(_0xc920('0x17'))['db'];function respondWithStatusCode(_0x4bc726,_0x23d243){_0x23d243=_0x23d243||0xcc;return function(_0x277160){if(_0x277160){return _0x4bc726[_0xc920('0x18')](_0x23d243);}return _0x4bc726['status'](_0x23d243)[_0xc920('0x19')]();};}function respondWithResult(_0x527cba,_0x590ab5){_0x590ab5=_0x590ab5||0xc8;return function(_0x1f85c8){if(_0x1f85c8){return _0x527cba[_0xc920('0x1a')](_0x590ab5)['json'](_0x1f85c8);}};}function respondWithFilteredResult(_0x3ab40b,_0x35fdb1){return function(_0x291bd9){if(_0x291bd9){var _0x1e37ea=typeof _0x35fdb1[_0xc920('0x1b')]===_0xc920('0x1c')&&typeof _0x35fdb1[_0xc920('0x1d')]===_0xc920('0x1c');var _0x4de2b9=_0x291bd9[_0xc920('0x1e')];var _0x51790f=_0x1e37ea?0x0:_0x35fdb1[_0xc920('0x1b')];var _0x1f6173=_0x1e37ea?_0x291bd9[_0xc920('0x1e')]:_0x35fdb1[_0xc920('0x1b')]+_0x35fdb1[_0xc920('0x1d')];var _0xd710f5;if(_0x1f6173>=_0x4de2b9){_0x1f6173=_0x4de2b9;_0xd710f5=0xc8;}else{_0xd710f5=0xce;}_0x3ab40b['status'](_0xd710f5);return _0x3ab40b[_0xc920('0x1f')](_0xc920('0x20'),_0x51790f+'-'+_0x1f6173+'/'+_0x4de2b9)[_0xc920('0x21')](_0x291bd9);}return null;};}function patchUpdates(_0x677978){return function(_0x265c6a){try{jsonpatch[_0xc920('0x22')](_0x265c6a,_0x677978,!![]);}catch(_0x57b6ac){return BPromise[_0xc920('0x23')](_0x57b6ac);}return _0x265c6a[_0xc920('0x24')]();};}function saveUpdates(_0x20272e,_0x26aa91){return function(_0x3dc032){if(_0x3dc032){return _0x3dc032[_0xc920('0x25')](_0x20272e)[_0xc920('0x26')](function(_0x1802aa){return _0x1802aa;});}return null;};}function removeEntity(_0xe558e5,_0x5d6821){return function(_0x1fa408){if(_0x1fa408){return _0x1fa408[_0xc920('0x27')]()['then'](function(){_0xe558e5[_0xc920('0x1a')](0xcc)[_0xc920('0x19')]();});}};}function handleEntityNotFound(_0x58d302,_0x283e4a){return function(_0x3975f6){if(!_0x3975f6){_0x58d302[_0xc920('0x18')](0x194);}return _0x3975f6;};}function handleError(_0x1b2639,_0x411b83){_0x411b83=_0x411b83||0x1f4;return function(_0xfae2cc){logger[_0xc920('0x28')](_0xfae2cc[_0xc920('0x29')]);if(_0xfae2cc['name']){delete _0xfae2cc[_0xc920('0x2a')];}_0x1b2639[_0xc920('0x1a')](_0x411b83)[_0xc920('0x2b')](_0xfae2cc);};}exports[_0xc920('0x2c')]=function(_0x14fd9d,_0x55efc6){var _0x1f409c={},_0x7ba3b4={},_0x1daa95={'count':0x0,'rows':[]};var _0x2156e2=_[_0xc920('0x2d')](db[_0xc920('0x2e')][_0xc920('0x2f')],function(_0x43d766){return{'name':_0x43d766[_0xc920('0x30')],'type':_0x43d766['type'][_0xc920('0x31')]};});_0x7ba3b4[_0xc920('0x32')]=_[_0xc920('0x2d')](_0x2156e2,_0xc920('0x2a'));_0x7ba3b4[_0xc920('0x33')]=_['keys'](_0x14fd9d[_0xc920('0x33')]);_0x7ba3b4[_0xc920('0x34')]=_['intersection'](_0x7ba3b4[_0xc920('0x32')],_0x7ba3b4['query']);_0x1f409c[_0xc920('0x35')]=_[_0xc920('0x36')](_0x7ba3b4[_0xc920('0x32')],qs[_0xc920('0x37')](_0x14fd9d[_0xc920('0x33')][_0xc920('0x37')]));_0x1f409c[_0xc920('0x35')]=_0x1f409c[_0xc920('0x35')][_0xc920('0x38')]?_0x1f409c[_0xc920('0x35')]:_0x7ba3b4['model'];if(!_0x14fd9d['query']['hasOwnProperty']('nolimit')){_0x1f409c[_0xc920('0x1d')]=qs[_0xc920('0x1d')](_0x14fd9d['query']['limit']);_0x1f409c[_0xc920('0x1b')]=qs['offset'](_0x14fd9d[_0xc920('0x33')][_0xc920('0x1b')]);}_0x1f409c['order']=qs[_0xc920('0x39')](_0x14fd9d[_0xc920('0x33')][_0xc920('0x39')]);_0x1f409c[_0xc920('0x3a')]=qs[_0xc920('0x34')](_[_0xc920('0x3b')](_0x14fd9d[_0xc920('0x33')],_0x7ba3b4[_0xc920('0x34')]),_0x2156e2);if(_0x14fd9d['query'][_0xc920('0x3c')]){_0x1f409c[_0xc920('0x3a')]=_[_0xc920('0x3d')](_0x1f409c[_0xc920('0x3a')],{'$or':_[_0xc920('0x2d')](_0x2156e2,function(_0x408510){if(_0x408510['type']!==_0xc920('0x3e')){var _0x181f67={};_0x181f67[_0x408510[_0xc920('0x2a')]]={'$like':'%'+_0x14fd9d[_0xc920('0x33')]['filter']+'%'};return _0x181f67;}})});}_0x1f409c=_['merge']({},_0x1f409c,_0x14fd9d[_0xc920('0x3f')]);var _0x1caa6b={'where':_0x1f409c[_0xc920('0x3a')]};return db[_0xc920('0x2e')][_0xc920('0x1e')](_0x1caa6b)[_0xc920('0x26')](function(_0x376e7f){_0x1daa95[_0xc920('0x1e')]=_0x376e7f;if(_0x14fd9d[_0xc920('0x33')]['includeAll']){_0x1f409c[_0xc920('0x40')]=[{'all':!![]}];}return db[_0xc920('0x2e')][_0xc920('0x41')](_0x1f409c);})[_0xc920('0x26')](function(_0x11798a){_0x1daa95[_0xc920('0x42')]=_0x11798a;return _0x1daa95;})[_0xc920('0x26')](respondWithFilteredResult(_0x55efc6,_0x1f409c))[_0xc920('0x43')](handleError(_0x55efc6,null));};exports[_0xc920('0x44')]=function(_0x371870,_0x11d5a6){var _0x331b6d={'raw':!![],'where':{'id':_0x371870['params']['id']}},_0x4c61a7={};_0x4c61a7[_0xc920('0x32')]=_[_0xc920('0x45')](db[_0xc920('0x2e')][_0xc920('0x2f')]);_0x4c61a7[_0xc920('0x33')]=_[_0xc920('0x45')](_0x371870[_0xc920('0x33')]);_0x4c61a7[_0xc920('0x34')]=_['intersection'](_0x4c61a7[_0xc920('0x32')],_0x4c61a7[_0xc920('0x33')]);_0x331b6d[_0xc920('0x35')]=_[_0xc920('0x36')](_0x4c61a7['model'],qs['fields'](_0x371870[_0xc920('0x33')][_0xc920('0x37')]));_0x331b6d[_0xc920('0x35')]=_0x331b6d['attributes'][_0xc920('0x38')]?_0x331b6d[_0xc920('0x35')]:_0x4c61a7[_0xc920('0x32')];if(_0x371870[_0xc920('0x33')]['includeAll']){_0x331b6d[_0xc920('0x40')]=[{'all':!![]}];}_0x331b6d=_[_0xc920('0x3d')]({},_0x331b6d,_0x371870[_0xc920('0x3f')]);return db[_0xc920('0x2e')][_0xc920('0x46')](_0x331b6d)[_0xc920('0x26')](handleEntityNotFound(_0x11d5a6,null))['then'](respondWithResult(_0x11d5a6,null))[_0xc920('0x43')](handleError(_0x11d5a6,null));};exports[_0xc920('0x47')]=function(_0x2711ca,_0x225d29){return db['FaxTransferReport']['create'](_0x2711ca[_0xc920('0x48')],{})['then'](respondWithResult(_0x225d29,0xc9))[_0xc920('0x43')](handleError(_0x225d29,null));};exports[_0xc920('0x25')]=function(_0x5de7b2,_0x32004f){if(_0x5de7b2[_0xc920('0x48')]['id']){delete _0x5de7b2[_0xc920('0x48')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x5de7b2[_0xc920('0x49')]['id']}})['then'](handleEntityNotFound(_0x32004f,null))[_0xc920('0x26')](saveUpdates(_0x5de7b2[_0xc920('0x48')],null))[_0xc920('0x26')](respondWithResult(_0x32004f,null))['catch'](handleError(_0x32004f,null));};exports[_0xc920('0x27')]=function(_0x5cdd16,_0x51191c){return db[_0xc920('0x2e')][_0xc920('0x46')]({'where':{'id':_0x5cdd16[_0xc920('0x49')]['id']}})[_0xc920('0x26')](handleEntityNotFound(_0x51191c,null))['then'](removeEntity(_0x51191c,null))[_0xc920('0x43')](handleError(_0x51191c,null));};exports['describe']=function(_0x5a3e1e,_0x8089c4){return db[_0xc920('0x2e')][_0xc920('0x4a')]()[_0xc920('0x26')](respondWithResult(_0x8089c4,null))[_0xc920('0x43')](handleError(_0x8089c4,null));}; \ No newline at end of file +var _0x59e9=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','update','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x171567,_0x431db2){var _0x29c8b5=function(_0x41cd4d){while(--_0x41cd4d){_0x171567['push'](_0x171567['shift']());}};_0x29c8b5(++_0x431db2);}(_0x59e9,0xcb));var _0x959e=function(_0x11f5e1,_0x16f5c6){_0x11f5e1=_0x11f5e1-0x0;var _0x2747af=_0x59e9[_0x11f5e1];return _0x2747af;};'use strict';var emlformat=require(_0x959e('0x0'));var rimraf=require(_0x959e('0x1'));var zipdir=require(_0x959e('0x2'));var jsonpatch=require(_0x959e('0x3'));var rp=require(_0x959e('0x4'));var moment=require(_0x959e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x959e('0x6'));var util=require(_0x959e('0x7'));var path=require('path');var sox=require(_0x959e('0x8'));var csv=require(_0x959e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x959e('0xa'));var crypto=require(_0x959e('0xb'));var jsforce=require(_0x959e('0xc'));var deskjs=require(_0x959e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x959e('0xe'));var Papa=require('papaparse');var Redis=require(_0x959e('0xf'));var authService=require(_0x959e('0x10'));var qs=require(_0x959e('0x11'));var as=require(_0x959e('0x12'));var hardwareService=require(_0x959e('0x13'));var logger=require(_0x959e('0x14'))(_0x959e('0x15'));var utils=require('../../config/utils');var config=require(_0x959e('0x16'));var licenseUtil=require(_0x959e('0x17'));var db=require(_0x959e('0x18'))['db'];function respondWithStatusCode(_0x3ad81c,_0x2bb469){_0x2bb469=_0x2bb469||0xcc;return function(_0x1a9c8b){if(_0x1a9c8b){return _0x3ad81c[_0x959e('0x19')](_0x2bb469);}return _0x3ad81c[_0x959e('0x1a')](_0x2bb469)[_0x959e('0x1b')]();};}function respondWithResult(_0x19bd41,_0x5696f4){_0x5696f4=_0x5696f4||0xc8;return function(_0x3b94dd){if(_0x3b94dd){return _0x19bd41[_0x959e('0x1a')](_0x5696f4)[_0x959e('0x1c')](_0x3b94dd);}};}function respondWithFilteredResult(_0x4e393a,_0x445b39){return function(_0x504db3){if(_0x504db3){var _0x51d543=typeof _0x445b39['offset']===_0x959e('0x1d')&&typeof _0x445b39[_0x959e('0x1e')]===_0x959e('0x1d');var _0x4f666b=_0x504db3[_0x959e('0x1f')];var _0x2a66b0=_0x51d543?0x0:_0x445b39[_0x959e('0x20')];var _0x5753a3=_0x51d543?_0x504db3[_0x959e('0x1f')]:_0x445b39[_0x959e('0x20')]+_0x445b39[_0x959e('0x1e')];var _0x7cb570;if(_0x5753a3>=_0x4f666b){_0x5753a3=_0x4f666b;_0x7cb570=0xc8;}else{_0x7cb570=0xce;}_0x4e393a['status'](_0x7cb570);return _0x4e393a[_0x959e('0x21')](_0x959e('0x22'),_0x2a66b0+'-'+_0x5753a3+'/'+_0x4f666b)[_0x959e('0x1c')](_0x504db3);}return null;};}function patchUpdates(_0x2c0704){return function(_0xd16868){try{jsonpatch['apply'](_0xd16868,_0x2c0704,!![]);}catch(_0x505afb){return BPromise['reject'](_0x505afb);}return _0xd16868[_0x959e('0x23')]();};}function saveUpdates(_0x5e79fd,_0x57c466){return function(_0x2b018b){if(_0x2b018b){return _0x2b018b['update'](_0x5e79fd)[_0x959e('0x24')](function(_0x2a98e8){return _0x2a98e8;});}return null;};}function removeEntity(_0x4aeb65,_0x5e4afc){return function(_0xf6d3da){if(_0xf6d3da){return _0xf6d3da['destroy']()[_0x959e('0x24')](function(){_0x4aeb65[_0x959e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3810fa,_0x6a5dad){return function(_0x590b90){if(!_0x590b90){_0x3810fa[_0x959e('0x19')](0x194);}return _0x590b90;};}function handleError(_0x1dd46d,_0x52bd3e){_0x52bd3e=_0x52bd3e||0x1f4;return function(_0x5b2924){logger[_0x959e('0x25')](_0x5b2924[_0x959e('0x26')]);if(_0x5b2924[_0x959e('0x27')]){delete _0x5b2924['name'];}_0x1dd46d['status'](_0x52bd3e)[_0x959e('0x28')](_0x5b2924);};}exports[_0x959e('0x29')]=function(_0x584b1a,_0x4ff964){var _0x5dbaff={},_0x1d8b70={},_0x10abf0={'count':0x0,'rows':[]};var _0x494909=_[_0x959e('0x2a')](db[_0x959e('0x2b')][_0x959e('0x2c')],function(_0x3106f2){return{'name':_0x3106f2[_0x959e('0x2d')],'type':_0x3106f2[_0x959e('0x2e')][_0x959e('0x2f')]};});_0x1d8b70[_0x959e('0x30')]=_[_0x959e('0x2a')](_0x494909,_0x959e('0x27'));_0x1d8b70[_0x959e('0x31')]=_['keys'](_0x584b1a['query']);_0x1d8b70[_0x959e('0x32')]=_[_0x959e('0x33')](_0x1d8b70[_0x959e('0x30')],_0x1d8b70[_0x959e('0x31')]);_0x5dbaff[_0x959e('0x34')]=_[_0x959e('0x33')](_0x1d8b70['model'],qs[_0x959e('0x35')](_0x584b1a[_0x959e('0x31')][_0x959e('0x35')]));_0x5dbaff[_0x959e('0x34')]=_0x5dbaff['attributes'][_0x959e('0x36')]?_0x5dbaff[_0x959e('0x34')]:_0x1d8b70[_0x959e('0x30')];if(!_0x584b1a['query']['hasOwnProperty'](_0x959e('0x37'))){_0x5dbaff[_0x959e('0x1e')]=qs[_0x959e('0x1e')](_0x584b1a['query'][_0x959e('0x1e')]);_0x5dbaff[_0x959e('0x20')]=qs['offset'](_0x584b1a[_0x959e('0x31')]['offset']);}_0x5dbaff[_0x959e('0x38')]=qs[_0x959e('0x39')](_0x584b1a[_0x959e('0x31')][_0x959e('0x39')]);_0x5dbaff[_0x959e('0x3a')]=qs[_0x959e('0x32')](_[_0x959e('0x3b')](_0x584b1a[_0x959e('0x31')],_0x1d8b70[_0x959e('0x32')]),_0x494909);if(_0x584b1a[_0x959e('0x31')][_0x959e('0x3c')]){_0x5dbaff[_0x959e('0x3a')]=_['merge'](_0x5dbaff['where'],{'$or':_['map'](_0x494909,function(_0x1b6d09){if(_0x1b6d09[_0x959e('0x2e')]!=='VIRTUAL'){var _0x5609d4={};_0x5609d4[_0x1b6d09[_0x959e('0x27')]]={'$like':'%'+_0x584b1a[_0x959e('0x31')]['filter']+'%'};return _0x5609d4;}})});}_0x5dbaff=_[_0x959e('0x3d')]({},_0x5dbaff,_0x584b1a[_0x959e('0x3e')]);var _0x3b3f62={'where':_0x5dbaff['where']};return db[_0x959e('0x2b')][_0x959e('0x1f')](_0x3b3f62)['then'](function(_0x29011f){_0x10abf0[_0x959e('0x1f')]=_0x29011f;if(_0x584b1a[_0x959e('0x31')][_0x959e('0x3f')]){_0x5dbaff[_0x959e('0x40')]=[{'all':!![]}];}return db[_0x959e('0x2b')][_0x959e('0x41')](_0x5dbaff);})[_0x959e('0x24')](function(_0x2e56c2){_0x10abf0['rows']=_0x2e56c2;return _0x10abf0;})['then'](respondWithFilteredResult(_0x4ff964,_0x5dbaff))[_0x959e('0x42')](handleError(_0x4ff964,null));};exports[_0x959e('0x43')]=function(_0x1680d6,_0x2b89e1){var _0x2b83a2={'raw':!![],'where':{'id':_0x1680d6[_0x959e('0x44')]['id']}},_0x519ae3={};_0x519ae3['model']=_[_0x959e('0x45')](db['FaxTransferReport']['rawAttributes']);_0x519ae3[_0x959e('0x31')]=_[_0x959e('0x45')](_0x1680d6['query']);_0x519ae3[_0x959e('0x32')]=_[_0x959e('0x33')](_0x519ae3[_0x959e('0x30')],_0x519ae3[_0x959e('0x31')]);_0x2b83a2[_0x959e('0x34')]=_[_0x959e('0x33')](_0x519ae3[_0x959e('0x30')],qs[_0x959e('0x35')](_0x1680d6['query'][_0x959e('0x35')]));_0x2b83a2['attributes']=_0x2b83a2[_0x959e('0x34')][_0x959e('0x36')]?_0x2b83a2[_0x959e('0x34')]:_0x519ae3[_0x959e('0x30')];if(_0x1680d6[_0x959e('0x31')][_0x959e('0x3f')]){_0x2b83a2[_0x959e('0x40')]=[{'all':!![]}];}_0x2b83a2=_[_0x959e('0x3d')]({},_0x2b83a2,_0x1680d6[_0x959e('0x3e')]);return db[_0x959e('0x2b')][_0x959e('0x46')](_0x2b83a2)['then'](handleEntityNotFound(_0x2b89e1,null))['then'](respondWithResult(_0x2b89e1,null))[_0x959e('0x42')](handleError(_0x2b89e1,null));};exports['create']=function(_0x58db08,_0x32d8f4){return db[_0x959e('0x2b')]['create'](_0x58db08['body'],{})['then'](respondWithResult(_0x32d8f4,0xc9))[_0x959e('0x42')](handleError(_0x32d8f4,null));};exports[_0x959e('0x47')]=function(_0x4c1398,_0x16a54a){if(_0x4c1398[_0x959e('0x48')]['id']){delete _0x4c1398['body']['id'];}return db['FaxTransferReport'][_0x959e('0x46')]({'where':{'id':_0x4c1398[_0x959e('0x44')]['id']}})[_0x959e('0x24')](handleEntityNotFound(_0x16a54a,null))[_0x959e('0x24')](saveUpdates(_0x4c1398[_0x959e('0x48')],null))[_0x959e('0x24')](respondWithResult(_0x16a54a,null))[_0x959e('0x42')](handleError(_0x16a54a,null));};exports[_0x959e('0x49')]=function(_0x4d02fd,_0x3d90e1){return db[_0x959e('0x2b')][_0x959e('0x46')]({'where':{'id':_0x4d02fd[_0x959e('0x44')]['id']}})[_0x959e('0x24')](handleEntityNotFound(_0x3d90e1,null))['then'](removeEntity(_0x3d90e1,null))[_0x959e('0x42')](handleError(_0x3d90e1,null));};exports[_0x959e('0x4a')]=function(_0x5231cd,_0x454a2c){return db[_0x959e('0x2b')][_0x959e('0x4a')]()[_0x959e('0x24')](respondWithResult(_0x454a2c,null))[_0x959e('0x42')](handleError(_0x454a2c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3ef3198..6f10b4e 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 _0xd3d3=['../../config/logger','api','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0xa62a6b,_0x50f390){var _0x57380b=function(_0x29be07){while(--_0x29be07){_0xa62a6b['push'](_0xa62a6b['shift']());}};_0x57380b(++_0x50f390);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd3d3[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3d3d('0x0'))(_0x3d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d3d('0x2'));var rimraf=require(_0x3d3d('0x3'));var config=require(_0x3d3d('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0x3d3d('0x5')]=function(_0x5de1f8,_0x228033){return _0x5de1f8[_0x3d3d('0x6')](_0x3d3d('0x7'),attributes,{'tableName':_0x3d3d('0x8'),'paranoid':![],'indexes':[{'name':_0x3d3d('0x9'),'fields':[_0x3d3d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69d4=['util','api','moment','bluebird','path','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash'];(function(_0x2af489,_0x5a006d){var _0x2c5d20=function(_0x4290d6){while(--_0x4290d6){_0x2af489['push'](_0x2af489['shift']());}};_0x2c5d20(++_0x5a006d);}(_0x69d4,0x83));var _0x469d=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x69d4[_0x296809];return _0x18c0d3;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var logger=require('../../config/logger')(_0x469d('0x2'));var moment=require(_0x469d('0x3'));var BPromise=require(_0x469d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x469d('0x5'));var rimraf=require('rimraf');var config=require(_0x469d('0x6'));var attributes=require(_0x469d('0x7'));module[_0x469d('0x8')]=function(_0x336101,_0x3d0ec8){return _0x336101[_0x469d('0x9')]('FaxTransferReport',attributes,{'tableName':_0x469d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x469d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 9bdda56..2dcc795 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 _0x1797=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','catch','util'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1797,0x18e));var _0x7179=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x1797[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require('lodash');var util=require(_0x7179('0x0'));var moment=require(_0x7179('0x1'));var BPromise=require(_0x7179('0x2'));var rs=require(_0x7179('0x3'));var fs=require('fs');var Redis=require(_0x7179('0x4'));var db=require(_0x7179('0x5'))['db'];var utils=require(_0x7179('0x6'));var logger=require(_0x7179('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7179('0x8'));var client=jayson[_0x7179('0x9')][_0x7179('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189cc5,_0x4a24e2,_0x2dc8f1){return new BPromise(function(_0x5de8b9,_0x506a7f){return client[_0x7179('0xb')](_0x189cc5,_0x2dc8f1)[_0x7179('0xc')](function(_0x428fb8){logger[_0x7179('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x4a24e2,'request\x20sent');logger['debug'](_0x7179('0xe'),_0x4a24e2,_0x7179('0xf'),JSON[_0x7179('0x10')](_0x428fb8));if(_0x428fb8['error']){if(_0x428fb8[_0x7179('0x11')]['code']===0x1f4){logger[_0x7179('0x11')](_0x7179('0x12'),_0x4a24e2,_0x428fb8[_0x7179('0x11')]['message']);return _0x506a7f(_0x428fb8['error']['message']);}logger['error'](_0x7179('0x12'),_0x4a24e2,_0x428fb8[_0x7179('0x11')][_0x7179('0x13')]);return _0x5de8b9(_0x428fb8['error']['message']);}else{logger[_0x7179('0xd')](_0x7179('0x12'),_0x4a24e2,'request\x20sent');_0x5de8b9(_0x428fb8['result'][_0x7179('0x13')]);}})[_0x7179('0x14')](function(_0x96190e){logger['error'](_0x7179('0x12'),_0x4a24e2,_0x96190e);_0x506a7f(_0x96190e);});});} \ No newline at end of file +var _0x274d=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxTransferReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x3cb2f5,_0x1e7a77){var _0x4aa1a5=function(_0x464b62){while(--_0x464b62){_0x3cb2f5['push'](_0x3cb2f5['shift']());}};_0x4aa1a5(++_0x1e7a77);}(_0x274d,0x168));var _0xd274=function(_0x56ee4c,_0xbf11c3){_0x56ee4c=_0x56ee4c-0x0;var _0x2eddd0=_0x274d[_0x56ee4c];return _0x2eddd0;};'use strict';var _=require(_0xd274('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd274('0x1'));var fs=require('fs');var Redis=require(_0xd274('0x2'));var db=require(_0xd274('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd274('0x4'))('rpc');var config=require(_0xd274('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd274('0x6')][_0xd274('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a0efe,_0x367c5d,_0x406016){return new BPromise(function(_0x58c9f0,_0x4f22d8){return client[_0xd274('0x8')](_0x1a0efe,_0x406016)[_0xd274('0x9')](function(_0x48b49f){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x367c5d,_0xd274('0xa'));logger[_0xd274('0xb')](_0xd274('0xc'),_0x367c5d,'request\x20sent',JSON[_0xd274('0xd')](_0x48b49f));if(_0x48b49f[_0xd274('0xe')]){if(_0x48b49f[_0xd274('0xe')]['code']===0x1f4){logger[_0xd274('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x367c5d,_0x48b49f[_0xd274('0xe')][_0xd274('0xf')]);return _0x4f22d8(_0x48b49f[_0xd274('0xe')][_0xd274('0xf')]);}logger['error'](_0xd274('0x10'),_0x367c5d,_0x48b49f[_0xd274('0xe')][_0xd274('0xf')]);return _0x58c9f0(_0x48b49f['error'][_0xd274('0xf')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x367c5d,_0xd274('0xa'));_0x58c9f0(_0x48b49f[_0xd274('0x11')][_0xd274('0xf')]);}})[_0xd274('0x12')](function(_0x2c0e6a){logger[_0xd274('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x367c5d,_0x2c0e6a);_0x4f22d8(_0x2c0e6a);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b76f127..b28cd1e 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 _0xa1a7=['get','isAuthenticated','describe','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller'];(function(_0x352fff,_0x3589c6){var _0x185606=function(_0x280476){while(--_0x280476){_0x352fff['push'](_0x352fff['shift']());}};_0x185606(++_0x3589c6);}(_0xa1a7,0x6e));var _0x7a1a=function(_0x25e95a,_0x2efe4a){_0x25e95a=_0x25e95a-0x0;var _0x2b35e8=_0xa1a7[_0x25e95a];return _0x2b35e8;};'use strict';var multer=require(_0x7a1a('0x0'));var util=require(_0x7a1a('0x1'));var path=require(_0x7a1a('0x2'));var timeout=require(_0x7a1a('0x3'));var express=require(_0x7a1a('0x4'));var router=express[_0x7a1a('0x5')]();var fs_extra=require(_0x7a1a('0x6'));var auth=require(_0x7a1a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7a1a('0x8'));var controller=require(_0x7a1a('0x9'));router[_0x7a1a('0xa')]('/',auth[_0x7a1a('0xb')](),controller['index']);router[_0x7a1a('0xa')]('/describe',auth[_0x7a1a('0xb')](),controller[_0x7a1a('0xc')]);router[_0x7a1a('0xa')]('/:id',auth[_0x7a1a('0xb')](),controller['show']);router[_0x7a1a('0xd')]('/',auth[_0x7a1a('0xb')](),controller[_0x7a1a('0xe')]);router[_0x7a1a('0xf')](_0x7a1a('0x10'),auth[_0x7a1a('0xb')](),controller[_0x7a1a('0x11')]);router[_0x7a1a('0x12')](_0x7a1a('0x10'),auth[_0x7a1a('0xb')](),controller['destroy']);module[_0x7a1a('0x13')]=router; \ No newline at end of file +var _0xed07=['./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed07,0xac));var _0x7ed0=function(_0x198741,_0x429542){_0x198741=_0x198741-0x0;var _0x299570=_0xed07[_0x198741];return _0x299570;};'use strict';var multer=require(_0x7ed0('0x0'));var util=require(_0x7ed0('0x1'));var path=require(_0x7ed0('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ed0('0x3'));var router=express['Router']();var fs_extra=require(_0x7ed0('0x4'));var auth=require(_0x7ed0('0x5'));var interaction=require(_0x7ed0('0x6'));var config=require(_0x7ed0('0x7'));var controller=require(_0x7ed0('0x8'));router[_0x7ed0('0x9')]('/',auth[_0x7ed0('0xa')](),controller['index']);router[_0x7ed0('0x9')](_0x7ed0('0xb'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xc')]);router[_0x7ed0('0x9')](_0x7ed0('0xd'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xe')]);router['post']('/',auth[_0x7ed0('0xa')](),controller[_0x7ed0('0xf')]);router['put'](_0x7ed0('0xd'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0x10')]);router[_0x7ed0('0x11')](_0x7ed0('0xd'),auth[_0x7ed0('0xa')](),controller[_0x7ed0('0x12')]);module[_0x7ed0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f4d5bc8..d519d15 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 _0x8e3d=['/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x8e3d,0x80));var _0xd8e3=function(_0x3e3c3c,_0x58c0f4){_0x3e3c3c=_0x3e3c3c-0x0;var _0x4b3dc6=_0x8e3d[_0x3e3c3c];return _0x4b3dc6;};'use strict';var multer=require('multer');var util=require(_0xd8e3('0x0'));var path=require(_0xd8e3('0x1'));var timeout=require(_0xd8e3('0x2'));var express=require(_0xd8e3('0x3'));var router=express[_0xd8e3('0x4')]();var fs_extra=require(_0xd8e3('0x5'));var auth=require(_0xd8e3('0x6'));var interaction=require(_0xd8e3('0x7'));var config=require(_0xd8e3('0x8'));var controller=require(_0xd8e3('0x9'));router['get']('/',auth[_0xd8e3('0xa')](),controller[_0xd8e3('0xb')]);router[_0xd8e3('0xc')]('/:id',auth[_0xd8e3('0xa')](),controller[_0xd8e3('0xd')]);router[_0xd8e3('0xc')](_0xd8e3('0xe'),auth[_0xd8e3('0xa')](),controller[_0xd8e3('0xf')]);router[_0xd8e3('0xc')](_0xd8e3('0x10'),auth[_0xd8e3('0xa')](),controller[_0xd8e3('0x11')]);router[_0xd8e3('0x12')]('/',auth[_0xd8e3('0xa')](),controller[_0xd8e3('0x13')]);router[_0xd8e3('0x12')](_0xd8e3('0xe'),auth[_0xd8e3('0xa')](),controller[_0xd8e3('0x14')]);router[_0xd8e3('0x15')](_0xd8e3('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xd8e3('0x17')](_0xd8e3('0x16'),auth[_0xd8e3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbd58=['./intDeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x149b00,_0x30f5c4){var _0x492892=function(_0x4202f0){while(--_0x4202f0){_0x149b00['push'](_0x149b00['shift']());}};_0x492892(++_0x30f5c4);}(_0xbd58,0xad));var _0x8bd5=function(_0x50798b,_0x22ccf8){_0x50798b=_0x50798b-0x0;var _0x4b1d26=_0xbd58[_0x50798b];return _0x4b1d26;};'use strict';var multer=require(_0x8bd5('0x0'));var util=require(_0x8bd5('0x1'));var path=require('path');var timeout=require(_0x8bd5('0x2'));var express=require(_0x8bd5('0x3'));var router=express[_0x8bd5('0x4')]();var fs_extra=require(_0x8bd5('0x5'));var auth=require(_0x8bd5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8bd5('0x7'));router[_0x8bd5('0x8')]('/',auth['isAuthenticated'](),controller[_0x8bd5('0x9')]);router[_0x8bd5('0x8')]('/:id',auth[_0x8bd5('0xa')](),controller['show']);router[_0x8bd5('0x8')](_0x8bd5('0xb'),auth['isAuthenticated'](),controller[_0x8bd5('0xc')]);router['get'](_0x8bd5('0xd'),auth[_0x8bd5('0xa')](),controller[_0x8bd5('0xe')]);router[_0x8bd5('0xf')]('/',auth[_0x8bd5('0xa')](),controller[_0x8bd5('0x10')]);router['post']('/:id/configurations',auth[_0x8bd5('0xa')](),controller[_0x8bd5('0x11')]);router['put'](_0x8bd5('0x12'),auth[_0x8bd5('0xa')](),controller['update']);router[_0x8bd5('0x13')]('/:id',auth[_0x8bd5('0xa')](),controller['destroy']);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 f414818..2ccc6ba 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 _0xfdbd=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x142344,_0x3b2628){var _0x2e87f7=function(_0xa651fe){while(--_0xa651fe){_0x142344['push'](_0x142344['shift']());}};_0x2e87f7(++_0x3b2628);}(_0xfdbd,0x99));var _0xdfdb=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0xfdbd[_0x20fdc1];return _0x25397c;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xdfdb('0x2')]},'authType':{'type':Sequelize[_0xdfdb('0x3')](_0xdfdb('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xdfdb('0x2')]},'consumerKey':{'type':Sequelize[_0xdfdb('0x2')]},'consumerSecret':{'type':Sequelize[_0xdfdb('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x3')](_0xdfdb('0x5'),_0xdfdb('0x6')),'defaultValue':_0xdfdb('0x5')}}; \ No newline at end of file +var _0x72ad=['integrationTab','newTab','sequelize','exports','STRING','basic','ENUM'];(function(_0x146979,_0x4dfc32){var _0x103856=function(_0x286e2e){while(--_0x286e2e){_0x146979['push'](_0x146979['shift']());}};_0x103856(++_0x4dfc32);}(_0x72ad,0x159));var _0xd72a=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x72ad[_0x1cbcf1];return _0x3a06f0;};'use strict';var Sequelize=require(_0xd72a('0x0'));module[_0xd72a('0x1')]={'name':{'type':Sequelize[_0xd72a('0x2')]},'description':{'type':Sequelize[_0xd72a('0x2')]},'username':{'type':Sequelize[_0xd72a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xd72a('0x3')),'defaultValue':_0xd72a('0x3')},'password':{'type':Sequelize[_0xd72a('0x2')]},'consumerKey':{'type':Sequelize[_0xd72a('0x2')]},'consumerSecret':{'type':Sequelize[_0xd72a('0x2')]},'token':{'type':Sequelize[_0xd72a('0x2')]},'tokenSecret':{'type':Sequelize[_0xd72a('0x2')]},'serverUrl':{'type':Sequelize[_0xd72a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd72a('0x4')](_0xd72a('0x5'),_0xd72a('0x6')),'defaultValue':_0xd72a('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5f7bd72..f13e26c 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 _0xc0d9=['pick','filter','merge','options','DeskAccount','includeAll','include','rows','catch','show','rawAttributes','length','find','create','body','params','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','GET','format','%s/custom_fields','application/json','basic','headers','password','toString','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','then','error','stack','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x38243a,_0x3ecaea){var _0x4c3410=function(_0x267c8e){while(--_0x267c8e){_0x38243a['push'](_0x38243a['shift']());}};_0x4c3410(++_0x3ecaea);}(_0xc0d9,0x111));var _0x9c0d=function(_0x14216d,_0x4cc511){_0x14216d=_0x14216d-0x0;var _0x4be461=_0xc0d9[_0x14216d];return _0x4be461;};'use strict';var emlformat=require(_0x9c0d('0x0'));var rimraf=require(_0x9c0d('0x1'));var zipdir=require(_0x9c0d('0x2'));var jsonpatch=require(_0x9c0d('0x3'));var rp=require(_0x9c0d('0x4'));var moment=require(_0x9c0d('0x5'));var BPromise=require(_0x9c0d('0x6'));var Mustache=require(_0x9c0d('0x7'));var util=require(_0x9c0d('0x8'));var path=require(_0x9c0d('0x9'));var sox=require(_0x9c0d('0xa'));var csv=require(_0x9c0d('0xb'));var ejs=require(_0x9c0d('0xc'));var fs=require('fs');var fs_extra=require(_0x9c0d('0xd'));var _=require(_0x9c0d('0xe'));var squel=require(_0x9c0d('0xf'));var crypto=require(_0x9c0d('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x9c0d('0x11'));var toCsv=require(_0x9c0d('0xb'));var querystring=require(_0x9c0d('0x12'));var Papa=require(_0x9c0d('0x13'));var Redis=require(_0x9c0d('0x14'));var authService=require(_0x9c0d('0x15'));var qs=require(_0x9c0d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c0d('0x17'));var logger=require(_0x9c0d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x9c0d('0x19'));var licenseUtil=require(_0x9c0d('0x1a'));var db=require(_0x9c0d('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1ad26c,_0x10e851){_0x10e851=_0x10e851||0xcc;return function(_0x11ab8e){if(_0x11ab8e){return _0x1ad26c[_0x9c0d('0x1c')](_0x10e851);}return _0x1ad26c['status'](_0x10e851)[_0x9c0d('0x1d')]();};}function respondWithResult(_0x572b53,_0x5915fe){_0x5915fe=_0x5915fe||0xc8;return function(_0x1c696d){if(_0x1c696d){return _0x572b53[_0x9c0d('0x1e')](_0x5915fe)[_0x9c0d('0x1f')](_0x1c696d);}};}function respondWithFilteredResult(_0x4d2652,_0x44657f){return function(_0x576839){if(_0x576839){var _0x1e0251=typeof _0x44657f[_0x9c0d('0x20')]==='undefined'&&typeof _0x44657f['limit']===_0x9c0d('0x21');var _0x3a43c3=_0x576839[_0x9c0d('0x22')];var _0x46be45=_0x1e0251?0x0:_0x44657f[_0x9c0d('0x20')];var _0x5c2ce9=_0x1e0251?_0x576839['count']:_0x44657f[_0x9c0d('0x20')]+_0x44657f[_0x9c0d('0x23')];var _0x4a1b6c;if(_0x5c2ce9>=_0x3a43c3){_0x5c2ce9=_0x3a43c3;_0x4a1b6c=0xc8;}else{_0x4a1b6c=0xce;}_0x4d2652[_0x9c0d('0x1e')](_0x4a1b6c);return _0x4d2652['set'](_0x9c0d('0x24'),_0x46be45+'-'+_0x5c2ce9+'/'+_0x3a43c3)[_0x9c0d('0x1f')](_0x576839);}return null;};}function patchUpdates(_0x210a8c){return function(_0x1eb120){try{jsonpatch[_0x9c0d('0x25')](_0x1eb120,_0x210a8c,!![]);}catch(_0x4776d0){return BPromise['reject'](_0x4776d0);}return _0x1eb120['save']();};}function saveUpdates(_0x28c665,_0x3716a3){return function(_0x50fd46){if(_0x50fd46){return _0x50fd46[_0x9c0d('0x26')](_0x28c665)['then'](function(_0x4d1bd1){return _0x4d1bd1;});}return null;};}function removeEntity(_0x4e325e,_0x20be43){return function(_0x5908ce){if(_0x5908ce){return _0x5908ce[_0x9c0d('0x27')]()[_0x9c0d('0x28')](function(){_0x4e325e[_0x9c0d('0x1e')](0xcc)[_0x9c0d('0x1d')]();});}};}function handleEntityNotFound(_0x355afe,_0x251d8f){return function(_0x2e3cf1){if(!_0x2e3cf1){_0x355afe[_0x9c0d('0x1c')](0x194);}return _0x2e3cf1;};}function handleError(_0x513d11,_0x4cd868){_0x4cd868=_0x4cd868||0x1f4;return function(_0x427584){logger[_0x9c0d('0x29')](_0x427584[_0x9c0d('0x2a')]);if(_0x427584['name']){delete _0x427584['name'];}_0x513d11[_0x9c0d('0x1e')](_0x4cd868)['send'](_0x427584);};}exports[_0x9c0d('0x2b')]=function(_0x10e892,_0xd8fab8){var _0x1cd70d={},_0x4a9744={},_0x5aabb6={'count':0x0,'rows':[]};var _0x1b5e6b=_[_0x9c0d('0x2c')](db['DeskAccount']['rawAttributes'],function(_0x488453){return{'name':_0x488453[_0x9c0d('0x2d')],'type':_0x488453[_0x9c0d('0x2e')][_0x9c0d('0x2f')]};});_0x4a9744[_0x9c0d('0x30')]=_[_0x9c0d('0x2c')](_0x1b5e6b,_0x9c0d('0x31'));_0x4a9744[_0x9c0d('0x32')]=_[_0x9c0d('0x33')](_0x10e892['query']);_0x4a9744[_0x9c0d('0x34')]=_[_0x9c0d('0x35')](_0x4a9744[_0x9c0d('0x30')],_0x4a9744[_0x9c0d('0x32')]);_0x1cd70d[_0x9c0d('0x36')]=_[_0x9c0d('0x35')](_0x4a9744[_0x9c0d('0x30')],qs[_0x9c0d('0x37')](_0x10e892[_0x9c0d('0x32')]['fields']));_0x1cd70d[_0x9c0d('0x36')]=_0x1cd70d['attributes']['length']?_0x1cd70d[_0x9c0d('0x36')]:_0x4a9744[_0x9c0d('0x30')];if(!_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x38')](_0x9c0d('0x39'))){_0x1cd70d[_0x9c0d('0x23')]=qs[_0x9c0d('0x23')](_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x23')]);_0x1cd70d[_0x9c0d('0x20')]=qs['offset'](_0x10e892['query'][_0x9c0d('0x20')]);}_0x1cd70d['order']=qs[_0x9c0d('0x3a')](_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x3a')]);_0x1cd70d[_0x9c0d('0x3b')]=qs['filters'](_[_0x9c0d('0x3c')](_0x10e892[_0x9c0d('0x32')],_0x4a9744[_0x9c0d('0x34')]),_0x1b5e6b);if(_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x3d')]){_0x1cd70d[_0x9c0d('0x3b')]=_[_0x9c0d('0x3e')](_0x1cd70d['where'],{'$or':_[_0x9c0d('0x2c')](_0x1b5e6b,function(_0xc063d2){if(_0xc063d2[_0x9c0d('0x2e')]!=='VIRTUAL'){var _0x2cc3a8={};_0x2cc3a8[_0xc063d2[_0x9c0d('0x31')]]={'$like':'%'+_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x3d')]+'%'};return _0x2cc3a8;}})});}_0x1cd70d=_[_0x9c0d('0x3e')]({},_0x1cd70d,_0x10e892[_0x9c0d('0x3f')]);var _0xee2132={'where':_0x1cd70d[_0x9c0d('0x3b')]};return db[_0x9c0d('0x40')][_0x9c0d('0x22')](_0xee2132)[_0x9c0d('0x28')](function(_0x80812f){_0x5aabb6[_0x9c0d('0x22')]=_0x80812f;if(_0x10e892[_0x9c0d('0x32')][_0x9c0d('0x41')]){_0x1cd70d[_0x9c0d('0x42')]=[{'all':!![]}];}return db[_0x9c0d('0x40')]['findAll'](_0x1cd70d);})[_0x9c0d('0x28')](function(_0x4f5d8c){_0x5aabb6[_0x9c0d('0x43')]=_0x4f5d8c;return _0x5aabb6;})['then'](respondWithFilteredResult(_0xd8fab8,_0x1cd70d))[_0x9c0d('0x44')](handleError(_0xd8fab8,null));};exports[_0x9c0d('0x45')]=function(_0x4b8c02,_0x49ea56){var _0x19a954={'raw':![],'where':{'id':_0x4b8c02['params']['id']}},_0x346c6b={};_0x346c6b['model']=_[_0x9c0d('0x33')](db['DeskAccount'][_0x9c0d('0x46')]);_0x346c6b[_0x9c0d('0x32')]=_[_0x9c0d('0x33')](_0x4b8c02[_0x9c0d('0x32')]);_0x346c6b[_0x9c0d('0x34')]=_['intersection'](_0x346c6b[_0x9c0d('0x30')],_0x346c6b['query']);_0x19a954[_0x9c0d('0x36')]=_[_0x9c0d('0x35')](_0x346c6b[_0x9c0d('0x30')],qs[_0x9c0d('0x37')](_0x4b8c02['query']['fields']));_0x19a954[_0x9c0d('0x36')]=_0x19a954[_0x9c0d('0x36')][_0x9c0d('0x47')]?_0x19a954[_0x9c0d('0x36')]:_0x346c6b[_0x9c0d('0x30')];if(_0x4b8c02[_0x9c0d('0x32')]['includeAll']){_0x19a954[_0x9c0d('0x42')]=[{'all':!![]}];}_0x19a954=_[_0x9c0d('0x3e')]({},_0x19a954,_0x4b8c02[_0x9c0d('0x3f')]);return db[_0x9c0d('0x40')][_0x9c0d('0x48')](_0x19a954)[_0x9c0d('0x28')](handleEntityNotFound(_0x49ea56,null))[_0x9c0d('0x28')](respondWithResult(_0x49ea56,null))[_0x9c0d('0x44')](handleError(_0x49ea56,null));};exports[_0x9c0d('0x49')]=function(_0x268fc0,_0x23e3f0){return db['DeskAccount'][_0x9c0d('0x49')](_0x268fc0['body'],{})[_0x9c0d('0x28')](respondWithResult(_0x23e3f0,0xc9))[_0x9c0d('0x44')](handleError(_0x23e3f0,null));};exports[_0x9c0d('0x26')]=function(_0x3f6111,_0x4083c6){if(_0x3f6111[_0x9c0d('0x4a')]['id']){delete _0x3f6111['body']['id'];}return db[_0x9c0d('0x40')][_0x9c0d('0x48')]({'where':{'id':_0x3f6111[_0x9c0d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4083c6,null))[_0x9c0d('0x28')](saveUpdates(_0x3f6111[_0x9c0d('0x4a')],null))[_0x9c0d('0x28')](respondWithResult(_0x4083c6,null))[_0x9c0d('0x44')](handleError(_0x4083c6,null));};exports['destroy']=function(_0x191f04,_0x111cdd){return db['DeskAccount'][_0x9c0d('0x48')]({'where':{'id':_0x191f04[_0x9c0d('0x4b')]['id']}})[_0x9c0d('0x28')](handleEntityNotFound(_0x111cdd,null))['then'](removeEntity(_0x111cdd,null))[_0x9c0d('0x44')](handleError(_0x111cdd,null));};exports['getConfigurations']=function(_0x587d45,_0x5e2345,_0x178b63){var _0x13ee0a={};var _0x417609={};var _0x53fd61;var _0x231d37;return db[_0x9c0d('0x40')][_0x9c0d('0x4c')]({'where':{'id':_0x587d45[_0x9c0d('0x4b')]['id']}})[_0x9c0d('0x28')](handleEntityNotFound(_0x5e2345,null))[_0x9c0d('0x28')](function(_0x2a2daf){if(_0x2a2daf){_0x53fd61=_0x2a2daf;_0x417609[_0x9c0d('0x30')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x417609[_0x9c0d('0x32')]=_['keys'](_0x587d45[_0x9c0d('0x32')]);_0x417609[_0x9c0d('0x34')]=_['intersection'](_0x417609[_0x9c0d('0x30')],_0x417609[_0x9c0d('0x32')]);_0x13ee0a['attributes']=_['intersection'](_0x417609[_0x9c0d('0x30')],qs[_0x9c0d('0x37')](_0x587d45[_0x9c0d('0x32')][_0x9c0d('0x37')]));_0x13ee0a[_0x9c0d('0x36')]=_0x13ee0a[_0x9c0d('0x36')][_0x9c0d('0x47')]?_0x13ee0a[_0x9c0d('0x36')]:_0x417609['model'];_0x13ee0a['order']=qs[_0x9c0d('0x3a')](_0x587d45['query']['sort']);_0x13ee0a[_0x9c0d('0x3b')]=qs[_0x9c0d('0x34')](_['pick'](_0x587d45[_0x9c0d('0x32')],_0x417609[_0x9c0d('0x34')]));if(_0x587d45['query'][_0x9c0d('0x3d')]){_0x13ee0a[_0x9c0d('0x3b')]=_[_0x9c0d('0x3e')](_0x13ee0a['where'],{'$or':_['map'](_0x13ee0a['attributes'],function(_0x86fa82){var _0xe01b9d={};_0xe01b9d[_0x86fa82]={'$like':'%'+_0x587d45[_0x9c0d('0x32')]['filter']+'%'};return _0xe01b9d;})});}_0x13ee0a=_[_0x9c0d('0x3e')]({},_0x13ee0a,_0x587d45['options']);return _0x53fd61[_0x9c0d('0x4d')](_0x13ee0a);}})[_0x9c0d('0x28')](function(_0x32cba9){if(_0x32cba9){_0x231d37=_0x32cba9[_0x9c0d('0x47')];if(!_0x587d45[_0x9c0d('0x32')][_0x9c0d('0x38')](_0x9c0d('0x39'))){_0x13ee0a[_0x9c0d('0x23')]=qs[_0x9c0d('0x23')](_0x587d45[_0x9c0d('0x32')][_0x9c0d('0x23')]);_0x13ee0a[_0x9c0d('0x20')]=qs['offset'](_0x587d45[_0x9c0d('0x32')][_0x9c0d('0x20')]);}return _0x53fd61[_0x9c0d('0x4d')](_0x13ee0a);}})[_0x9c0d('0x28')](function(_0x57a678){if(_0x57a678){return _0x57a678?{'count':_0x231d37,'rows':_0x57a678}:null;}})[_0x9c0d('0x28')](respondWithResult(_0x5e2345,null))[_0x9c0d('0x44')](handleError(_0x5e2345,null));};exports[_0x9c0d('0x4e')]=function(_0x279671,_0x26d92b,_0x5b8972){if(_0x279671[_0x9c0d('0x4a')]['id']){delete _0x279671[_0x9c0d('0x4a')]['id'];}return db[_0x9c0d('0x40')][_0x9c0d('0x4c')]({'where':{'id':_0x279671[_0x9c0d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26d92b,null))[_0x9c0d('0x28')](function(_0x50c1f0){if(_0x50c1f0){_0x279671['body'][_0x9c0d('0x4f')]=_0x50c1f0['id'];_0x279671[_0x9c0d('0x4a')][_0x9c0d('0x50')]=integrations[_0x9c0d('0x51')](_0x279671['body']['channel'],_0x279671[_0x9c0d('0x4a')][_0x9c0d('0x2e')]);_0x279671['body'][_0x9c0d('0x52')]=integrations[_0x9c0d('0x53')](_0x279671[_0x9c0d('0x4a')][_0x9c0d('0x54')],_0x279671['body'][_0x9c0d('0x2e')]);return db[_0x9c0d('0x55')][_0x9c0d('0x49')](_0x279671['body'],{'include':[{'model':db['DeskField'],'as':_0x9c0d('0x50')},{'model':db[_0x9c0d('0x56')],'as':_0x9c0d('0x52')}]});}return null;})[_0x9c0d('0x28')](respondWithResult(_0x26d92b,null))[_0x9c0d('0x44')](handleError(_0x26d92b,null));};exports[_0x9c0d('0x57')]=function(_0x470879,_0x2ef6e0,_0x495a42){var _0x1cfbe0=[{'name':_0x9c0d('0x58'),'label':_0x9c0d('0x58'),'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 _0x21393a='';return db[_0x9c0d('0x40')][_0x9c0d('0x4c')]({'where':{'id':_0x470879[_0x9c0d('0x4b')]['id']},'attributes':['id',_0x9c0d('0x59'),_0x9c0d('0x5a'),_0x9c0d('0x5b'),'password',_0x9c0d('0x5c'),_0x9c0d('0x5d'),_0x9c0d('0x5e'),_0x9c0d('0x5f')]})[_0x9c0d('0x28')](handleEntityNotFound(_0x2ef6e0,null))[_0x9c0d('0x28')](function(_0x32869f){if(_0x32869f){_0x21393a=_0x32869f[_0x9c0d('0x59')];var _0x16fc65=_0x21393a[_0x9c0d('0x60')](-0x1);if(_0x16fc65==='/'){_0x21393a=_0x21393a['substring'](0x0,_0x21393a['lastIndexOf'](_0x16fc65));}var _0x5cbb62={'method':_0x9c0d('0x61'),'uri':util[_0x9c0d('0x62')](_0x9c0d('0x63'),_0x21393a),'headers':{'Content-Type':_0x9c0d('0x64'),'Accept':_0x9c0d('0x64')},'json':!![]};if(_0x32869f[_0x9c0d('0x5a')]===_0x9c0d('0x65')){_0x5cbb62[_0x9c0d('0x66')]['Authorization']=util[_0x9c0d('0x62')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x32869f['username'],_0x32869f[_0x9c0d('0x67')]))[_0x9c0d('0x68')]('base64'));}return rp(_0x5cbb62)['then'](function(_0x3885ec){return _0x1cfbe0['concat'](_['map'](_0x3885ec['_embedded'][_0x9c0d('0x69')],function(_0x4201f9){return{'id':_0x4201f9[_0x9c0d('0x31')],'name':_0x4201f9[_0x9c0d('0x31')],'type':_0x4201f9[_0x9c0d('0x2e')],'active':_0x4201f9['active'],'label':_0x4201f9[_0x9c0d('0x6a')],'custom':!![]};}));});}})[_0x9c0d('0x28')](function(_0x10deb8){return{'count':_0x10deb8[_0x9c0d('0x47')],'rows':_0x10deb8};})[_0x9c0d('0x28')](respondWithResult(_0x2ef6e0,null))[_0x9c0d('0x44')](function(_0x297162){var _0x537aab=_0x470879[_0x9c0d('0x32')][_0x9c0d('0x6b')]?0x1f4:_0x297162[_0x9c0d('0x6c')]||0x1f4;logger[_0x9c0d('0x29')](_0x9c0d('0x6d'),'getFields',_0x537aab,JSON['stringify'](_0x297162));delete _0x297162[_0x9c0d('0x31')];if(_0x537aab===0x191){_0x537aab=0x190;}_0x2ef6e0[_0x9c0d('0x1e')](_0x537aab)['send'](_0x470879[_0x9c0d('0x32')][_0x9c0d('0x6b')]?{'message':_0x9c0d('0x6e'),'statusCode':_0x297162[_0x9c0d('0x6c')]}:_0x297162);});}; \ No newline at end of file +var _0xa80d=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','getConfigurations','DeskConfiguration','length','order','hasOwnProperty','body','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','toString','base64','active','label','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa80d,0x149));var _0xda80=function(_0x24556a,_0x465a63){_0x24556a=_0x24556a-0x0;var _0xc7ec92=_0xa80d[_0x24556a];return _0xc7ec92;};'use strict';var emlformat=require(_0xda80('0x0'));var rimraf=require(_0xda80('0x1'));var zipdir=require(_0xda80('0x2'));var jsonpatch=require(_0xda80('0x3'));var rp=require(_0xda80('0x4'));var moment=require(_0xda80('0x5'));var BPromise=require(_0xda80('0x6'));var Mustache=require(_0xda80('0x7'));var util=require(_0xda80('0x8'));var path=require(_0xda80('0x9'));var sox=require('sox');var csv=require(_0xda80('0xa'));var ejs=require(_0xda80('0xb'));var fs=require('fs');var fs_extra=require(_0xda80('0xc'));var _=require(_0xda80('0xd'));var squel=require(_0xda80('0xe'));var crypto=require(_0xda80('0xf'));var jsforce=require(_0xda80('0x10'));var deskjs=require(_0xda80('0x11'));var toCsv=require(_0xda80('0xa'));var querystring=require(_0xda80('0x12'));var Papa=require('papaparse');var Redis=require(_0xda80('0x13'));var authService=require(_0xda80('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda80('0x15'));var logger=require(_0xda80('0x16'))('api');var utils=require(_0xda80('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xda80('0x18'));var db=require(_0xda80('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4b3370,_0x553a4f){_0x553a4f=_0x553a4f||0xcc;return function(_0x5cbf78){if(_0x5cbf78){return _0x4b3370[_0xda80('0x1a')](_0x553a4f);}return _0x4b3370[_0xda80('0x1b')](_0x553a4f)[_0xda80('0x1c')]();};}function respondWithResult(_0x5295f7,_0x5082a6){_0x5082a6=_0x5082a6||0xc8;return function(_0x5278b6){if(_0x5278b6){return _0x5295f7[_0xda80('0x1b')](_0x5082a6)[_0xda80('0x1d')](_0x5278b6);}};}function respondWithFilteredResult(_0x4643c8,_0x3a8b73){return function(_0x257f1c){if(_0x257f1c){var _0x43e2b1=typeof _0x3a8b73[_0xda80('0x1e')]==='undefined'&&typeof _0x3a8b73[_0xda80('0x1f')]===_0xda80('0x20');var _0x1c0297=_0x257f1c[_0xda80('0x21')];var _0x4f85ea=_0x43e2b1?0x0:_0x3a8b73[_0xda80('0x1e')];var _0x1281b4=_0x43e2b1?_0x257f1c[_0xda80('0x21')]:_0x3a8b73['offset']+_0x3a8b73[_0xda80('0x1f')];var _0x136876;if(_0x1281b4>=_0x1c0297){_0x1281b4=_0x1c0297;_0x136876=0xc8;}else{_0x136876=0xce;}_0x4643c8[_0xda80('0x1b')](_0x136876);return _0x4643c8[_0xda80('0x22')](_0xda80('0x23'),_0x4f85ea+'-'+_0x1281b4+'/'+_0x1c0297)['json'](_0x257f1c);}return null;};}function patchUpdates(_0x4f7cff){return function(_0x36f964){try{jsonpatch[_0xda80('0x24')](_0x36f964,_0x4f7cff,!![]);}catch(_0x48371e){return BPromise[_0xda80('0x25')](_0x48371e);}return _0x36f964[_0xda80('0x26')]();};}function saveUpdates(_0x3adca6,_0x19b32d){return function(_0x13d463){if(_0x13d463){return _0x13d463[_0xda80('0x27')](_0x3adca6)['then'](function(_0x10d6a2){return _0x10d6a2;});}return null;};}function removeEntity(_0x2b6f79,_0x15799f){return function(_0x10b25b){if(_0x10b25b){return _0x10b25b[_0xda80('0x28')]()[_0xda80('0x29')](function(){_0x2b6f79[_0xda80('0x1b')](0xcc)[_0xda80('0x1c')]();});}};}function handleEntityNotFound(_0x335370,_0xe76ede){return function(_0x3297c5){if(!_0x3297c5){_0x335370['sendStatus'](0x194);}return _0x3297c5;};}function handleError(_0x54d2aa,_0x3f7bec){_0x3f7bec=_0x3f7bec||0x1f4;return function(_0x38b12f){logger['error'](_0x38b12f[_0xda80('0x2a')]);if(_0x38b12f[_0xda80('0x2b')]){delete _0x38b12f[_0xda80('0x2b')];}_0x54d2aa[_0xda80('0x1b')](_0x3f7bec)[_0xda80('0x2c')](_0x38b12f);};}exports[_0xda80('0x2d')]=function(_0x156a2a,_0x1fa8b9){var _0x366beb={},_0x313058={},_0x37be9c={'count':0x0,'rows':[]};var _0x238bae=_[_0xda80('0x2e')](db[_0xda80('0x2f')][_0xda80('0x30')],function(_0x25ae07){return{'name':_0x25ae07[_0xda80('0x31')],'type':_0x25ae07[_0xda80('0x32')][_0xda80('0x33')]};});_0x313058[_0xda80('0x34')]=_[_0xda80('0x2e')](_0x238bae,_0xda80('0x2b'));_0x313058[_0xda80('0x35')]=_[_0xda80('0x36')](_0x156a2a[_0xda80('0x35')]);_0x313058['filters']=_[_0xda80('0x37')](_0x313058[_0xda80('0x34')],_0x313058[_0xda80('0x35')]);_0x366beb[_0xda80('0x38')]=_[_0xda80('0x37')](_0x313058[_0xda80('0x34')],qs[_0xda80('0x39')](_0x156a2a[_0xda80('0x35')]['fields']));_0x366beb[_0xda80('0x38')]=_0x366beb[_0xda80('0x38')]['length']?_0x366beb[_0xda80('0x38')]:_0x313058['model'];if(!_0x156a2a[_0xda80('0x35')]['hasOwnProperty'](_0xda80('0x3a'))){_0x366beb[_0xda80('0x1f')]=qs[_0xda80('0x1f')](_0x156a2a['query'][_0xda80('0x1f')]);_0x366beb['offset']=qs[_0xda80('0x1e')](_0x156a2a['query'][_0xda80('0x1e')]);}_0x366beb['order']=qs[_0xda80('0x3b')](_0x156a2a[_0xda80('0x35')][_0xda80('0x3b')]);_0x366beb[_0xda80('0x3c')]=qs[_0xda80('0x3d')](_[_0xda80('0x3e')](_0x156a2a[_0xda80('0x35')],_0x313058[_0xda80('0x3d')]),_0x238bae);if(_0x156a2a[_0xda80('0x35')][_0xda80('0x3f')]){_0x366beb[_0xda80('0x3c')]=_[_0xda80('0x40')](_0x366beb['where'],{'$or':_[_0xda80('0x2e')](_0x238bae,function(_0x240cc5){if(_0x240cc5[_0xda80('0x32')]!==_0xda80('0x41')){var _0x2b1c4a={};_0x2b1c4a[_0x240cc5['name']]={'$like':'%'+_0x156a2a['query'][_0xda80('0x3f')]+'%'};return _0x2b1c4a;}})});}_0x366beb=_['merge']({},_0x366beb,_0x156a2a[_0xda80('0x42')]);var _0x4f5399={'where':_0x366beb[_0xda80('0x3c')]};return db['DeskAccount'][_0xda80('0x21')](_0x4f5399)['then'](function(_0x142e59){_0x37be9c[_0xda80('0x21')]=_0x142e59;if(_0x156a2a[_0xda80('0x35')][_0xda80('0x43')]){_0x366beb[_0xda80('0x44')]=[{'all':!![]}];}return db[_0xda80('0x2f')][_0xda80('0x45')](_0x366beb);})['then'](function(_0x23b962){_0x37be9c[_0xda80('0x46')]=_0x23b962;return _0x37be9c;})['then'](respondWithFilteredResult(_0x1fa8b9,_0x366beb))[_0xda80('0x47')](handleError(_0x1fa8b9,null));};exports[_0xda80('0x48')]=function(_0x3931ed,_0x5874a7){var _0x21740b={'raw':![],'where':{'id':_0x3931ed[_0xda80('0x49')]['id']}},_0x17c435={};_0x17c435[_0xda80('0x34')]=_[_0xda80('0x36')](db[_0xda80('0x2f')][_0xda80('0x30')]);_0x17c435[_0xda80('0x35')]=_['keys'](_0x3931ed[_0xda80('0x35')]);_0x17c435[_0xda80('0x3d')]=_[_0xda80('0x37')](_0x17c435[_0xda80('0x34')],_0x17c435[_0xda80('0x35')]);_0x21740b[_0xda80('0x38')]=_[_0xda80('0x37')](_0x17c435[_0xda80('0x34')],qs[_0xda80('0x39')](_0x3931ed['query'][_0xda80('0x39')]));_0x21740b[_0xda80('0x38')]=_0x21740b['attributes']['length']?_0x21740b[_0xda80('0x38')]:_0x17c435[_0xda80('0x34')];if(_0x3931ed[_0xda80('0x35')][_0xda80('0x43')]){_0x21740b['include']=[{'all':!![]}];}_0x21740b=_[_0xda80('0x40')]({},_0x21740b,_0x3931ed['options']);return db[_0xda80('0x2f')][_0xda80('0x4a')](_0x21740b)[_0xda80('0x29')](handleEntityNotFound(_0x5874a7,null))['then'](respondWithResult(_0x5874a7,null))['catch'](handleError(_0x5874a7,null));};exports[_0xda80('0x4b')]=function(_0x482350,_0xa55ef3){return db[_0xda80('0x2f')][_0xda80('0x4b')](_0x482350['body'],{})[_0xda80('0x29')](respondWithResult(_0xa55ef3,0xc9))[_0xda80('0x47')](handleError(_0xa55ef3,null));};exports[_0xda80('0x27')]=function(_0x103714,_0x4d5dba){if(_0x103714['body']['id']){delete _0x103714['body']['id'];}return db['DeskAccount'][_0xda80('0x4a')]({'where':{'id':_0x103714[_0xda80('0x49')]['id']}})[_0xda80('0x29')](handleEntityNotFound(_0x4d5dba,null))['then'](saveUpdates(_0x103714['body'],null))[_0xda80('0x29')](respondWithResult(_0x4d5dba,null))[_0xda80('0x47')](handleError(_0x4d5dba,null));};exports[_0xda80('0x28')]=function(_0x2c41cb,_0x51ccb7){return db[_0xda80('0x2f')][_0xda80('0x4a')]({'where':{'id':_0x2c41cb[_0xda80('0x49')]['id']}})[_0xda80('0x29')](handleEntityNotFound(_0x51ccb7,null))['then'](removeEntity(_0x51ccb7,null))[_0xda80('0x47')](handleError(_0x51ccb7,null));};exports[_0xda80('0x4c')]=function(_0x272e32,_0xc3c978,_0x281887){var _0xc47575={};var _0x233679={};var _0x1174a0;var _0x5aebd3;return db[_0xda80('0x2f')]['findOne']({'where':{'id':_0x272e32['params']['id']}})[_0xda80('0x29')](handleEntityNotFound(_0xc3c978,null))[_0xda80('0x29')](function(_0x5bada9){if(_0x5bada9){_0x1174a0=_0x5bada9;_0x233679['model']=_['keys'](db[_0xda80('0x4d')]['rawAttributes']);_0x233679[_0xda80('0x35')]=_[_0xda80('0x36')](_0x272e32[_0xda80('0x35')]);_0x233679[_0xda80('0x3d')]=_[_0xda80('0x37')](_0x233679[_0xda80('0x34')],_0x233679[_0xda80('0x35')]);_0xc47575[_0xda80('0x38')]=_[_0xda80('0x37')](_0x233679[_0xda80('0x34')],qs[_0xda80('0x39')](_0x272e32[_0xda80('0x35')][_0xda80('0x39')]));_0xc47575[_0xda80('0x38')]=_0xc47575['attributes'][_0xda80('0x4e')]?_0xc47575['attributes']:_0x233679[_0xda80('0x34')];_0xc47575[_0xda80('0x4f')]=qs[_0xda80('0x3b')](_0x272e32[_0xda80('0x35')]['sort']);_0xc47575[_0xda80('0x3c')]=qs['filters'](_['pick'](_0x272e32['query'],_0x233679[_0xda80('0x3d')]));if(_0x272e32[_0xda80('0x35')][_0xda80('0x3f')]){_0xc47575[_0xda80('0x3c')]=_[_0xda80('0x40')](_0xc47575[_0xda80('0x3c')],{'$or':_[_0xda80('0x2e')](_0xc47575[_0xda80('0x38')],function(_0xd1acde){var _0xb1ac43={};_0xb1ac43[_0xd1acde]={'$like':'%'+_0x272e32[_0xda80('0x35')][_0xda80('0x3f')]+'%'};return _0xb1ac43;})});}_0xc47575=_[_0xda80('0x40')]({},_0xc47575,_0x272e32['options']);return _0x1174a0[_0xda80('0x4c')](_0xc47575);}})[_0xda80('0x29')](function(_0x529d56){if(_0x529d56){_0x5aebd3=_0x529d56[_0xda80('0x4e')];if(!_0x272e32[_0xda80('0x35')][_0xda80('0x50')](_0xda80('0x3a'))){_0xc47575['limit']=qs['limit'](_0x272e32[_0xda80('0x35')][_0xda80('0x1f')]);_0xc47575[_0xda80('0x1e')]=qs[_0xda80('0x1e')](_0x272e32['query'][_0xda80('0x1e')]);}return _0x1174a0[_0xda80('0x4c')](_0xc47575);}})[_0xda80('0x29')](function(_0x317137){if(_0x317137){return _0x317137?{'count':_0x5aebd3,'rows':_0x317137}:null;}})['then'](respondWithResult(_0xc3c978,null))['catch'](handleError(_0xc3c978,null));};exports['addConfiguration']=function(_0x320f4c,_0x2d231e,_0x584977){if(_0x320f4c[_0xda80('0x51')]['id']){delete _0x320f4c[_0xda80('0x51')]['id'];}return db[_0xda80('0x2f')][_0xda80('0x52')]({'where':{'id':_0x320f4c[_0xda80('0x49')]['id']}})[_0xda80('0x29')](handleEntityNotFound(_0x2d231e,null))[_0xda80('0x29')](function(_0x57a589){if(_0x57a589){_0x320f4c[_0xda80('0x51')][_0xda80('0x53')]=_0x57a589['id'];_0x320f4c[_0xda80('0x51')][_0xda80('0x54')]=integrations['getSubjects'](_0x320f4c['body'][_0xda80('0x55')],_0x320f4c[_0xda80('0x51')][_0xda80('0x32')]);_0x320f4c[_0xda80('0x51')][_0xda80('0x56')]=integrations[_0xda80('0x57')](_0x320f4c[_0xda80('0x51')][_0xda80('0x55')],_0x320f4c['body'][_0xda80('0x32')]);return db[_0xda80('0x4d')][_0xda80('0x4b')](_0x320f4c[_0xda80('0x51')],{'include':[{'model':db[_0xda80('0x58')],'as':_0xda80('0x54')},{'model':db['DeskField'],'as':_0xda80('0x56')}]});}return null;})['then'](respondWithResult(_0x2d231e,null))[_0xda80('0x47')](handleError(_0x2d231e,null));};exports[_0xda80('0x59')]=function(_0x3fefef,_0x547a98,_0x4472b2){var _0x5b0e0b=[{'name':_0xda80('0x5a'),'label':_0xda80('0x5a'),'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 _0x5137c0='';return db['DeskAccount'][_0xda80('0x52')]({'where':{'id':_0x3fefef['params']['id']},'attributes':['id',_0xda80('0x5b'),_0xda80('0x5c'),_0xda80('0x5d'),_0xda80('0x5e'),_0xda80('0x5f'),'consumerSecret',_0xda80('0x60'),'tokenSecret']})[_0xda80('0x29')](handleEntityNotFound(_0x547a98,null))[_0xda80('0x29')](function(_0x167418){if(_0x167418){_0x5137c0=_0x167418[_0xda80('0x5b')];var _0x210f9f=_0x5137c0[_0xda80('0x61')](-0x1);if(_0x210f9f==='/'){_0x5137c0=_0x5137c0[_0xda80('0x62')](0x0,_0x5137c0[_0xda80('0x63')](_0x210f9f));}var _0x274f53={'method':'GET','uri':util['format'](_0xda80('0x64'),_0x5137c0),'headers':{'Content-Type':_0xda80('0x65'),'Accept':_0xda80('0x65')},'json':!![]};if(_0x167418[_0xda80('0x5c')]===_0xda80('0x66')){_0x274f53[_0xda80('0x67')][_0xda80('0x68')]=util[_0xda80('0x69')](_0xda80('0x6a'),new Buffer(util[_0xda80('0x69')]('%s:%s',_0x167418[_0xda80('0x5d')],_0x167418['password']))[_0xda80('0x6b')](_0xda80('0x6c')));}return rp(_0x274f53)['then'](function(_0x34a0e1){return _0x5b0e0b['concat'](_[_0xda80('0x2e')](_0x34a0e1['_embedded']['entries'],function(_0x14b93b){return{'id':_0x14b93b['name'],'name':_0x14b93b[_0xda80('0x2b')],'type':_0x14b93b[_0xda80('0x32')],'active':_0x14b93b[_0xda80('0x6d')],'label':_0x14b93b[_0xda80('0x6e')],'custom':!![]};}));});}})['then'](function(_0x4a6db2){return{'count':_0x4a6db2[_0xda80('0x4e')],'rows':_0x4a6db2};})[_0xda80('0x29')](respondWithResult(_0x547a98,null))['catch'](function(_0x382fb4){var _0x3acca9=_0x3fefef[_0xda80('0x35')][_0xda80('0x6f')]?0x1f4:_0x382fb4['statusCode']||0x1f4;logger[_0xda80('0x70')](_0xda80('0x71'),_0xda80('0x59'),_0x3acca9,JSON[_0xda80('0x72')](_0x382fb4));delete _0x382fb4[_0xda80('0x2b')];if(_0x3acca9===0x191){_0x3acca9=0x190;}_0x547a98['status'](_0x3acca9)[_0xda80('0x2c')](_0x3fefef['query'][_0xda80('0x6f')]?{'message':_0xda80('0x73'),'statusCode':_0x382fb4['statusCode']}:_0x382fb4);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9c7d9a1..08a9086 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 _0x3afe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x21c1a5,_0x1261af){var _0x290db7=function(_0x16af94){while(--_0x16af94){_0x21c1a5['push'](_0x21c1a5['shift']());}};_0x290db7(++_0x1261af);}(_0x3afe,0x186));var _0xe3af=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x3afe[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0xe3af('0x0'));var util=require(_0xe3af('0x1'));var logger=require(_0xe3af('0x2'))(_0xe3af('0x3'));var moment=require(_0xe3af('0x4'));var BPromise=require(_0xe3af('0x5'));var rp=require(_0xe3af('0x6'));var fs=require('fs');var path=require(_0xe3af('0x7'));var rimraf=require(_0xe3af('0x8'));var config=require('../../config/environment');var attributes=require(_0xe3af('0x9'));var integrations=require(_0xe3af('0xa'));module[_0xe3af('0xb')]=function(_0x5e01ca,_0xd26fa7){return _0x5e01ca['define'](_0xe3af('0xc'),attributes,{'tableName':_0xe3af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38d9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0xe98dfb,_0x595705){var _0x13efc1=function(_0x461903){while(--_0x461903){_0xe98dfb['push'](_0xe98dfb['shift']());}};_0x13efc1(++_0x595705);}(_0x38d9,0x132));var _0x938d=function(_0x202f08,_0x1f4d07){_0x202f08=_0x202f08-0x0;var _0x4da917=_0x38d9[_0x202f08];return _0x4da917;};'use strict';var _=require(_0x938d('0x0'));var util=require(_0x938d('0x1'));var logger=require(_0x938d('0x2'))(_0x938d('0x3'));var moment=require(_0x938d('0x4'));var BPromise=require(_0x938d('0x5'));var rp=require(_0x938d('0x6'));var fs=require('fs');var path=require(_0x938d('0x7'));var rimraf=require(_0x938d('0x8'));var config=require(_0x938d('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x938d('0xa'));module['exports']=function(_0x19a960,_0x453bb3){return _0x19a960[_0x938d('0xb')](_0x938d('0xc'),attributes,{'tableName':_0x938d('0xd'),'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 59cbfe7..cf5cc05 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 _0x453a=['options','raw','where','attributes','limit','map','include','ShowDeskAccount','find','model','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x104051,_0x2cdcc3){var _0x455e26=function(_0x108375){while(--_0x108375){_0x104051['push'](_0x104051['shift']());}};_0x455e26(++_0x2cdcc3);}(_0x453a,0x112));var _0xa453=function(_0x159641,_0x292389){_0x159641=_0x159641-0x0;var _0x41c53a=_0x453a[_0x159641];return _0x41c53a;};'use strict';var _=require('lodash');var util=require(_0xa453('0x0'));var moment=require(_0xa453('0x1'));var BPromise=require(_0xa453('0x2'));var rs=require(_0xa453('0x3'));var fs=require('fs');var Redis=require(_0xa453('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa453('0x5'));var jayson=require(_0xa453('0x6'));var client=jayson[_0xa453('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3b4d,_0xd2645f,_0x328921){return new BPromise(function(_0x36206,_0x46fe2e){return client[_0xa453('0x8')](_0x2f3b4d,_0x328921)[_0xa453('0x9')](function(_0x21d673){logger[_0xa453('0xa')](_0xa453('0xb'),_0xd2645f,_0xa453('0xc'));logger[_0xa453('0xd')](_0xa453('0xe'),_0xd2645f,_0xa453('0xc'),JSON[_0xa453('0xf')](_0x21d673));if(_0x21d673[_0xa453('0x10')]){if(_0x21d673[_0xa453('0x10')]['code']===0x1f4){logger[_0xa453('0x10')](_0xa453('0xb'),_0xd2645f,_0x21d673['error']['message']);return _0x46fe2e(_0x21d673[_0xa453('0x10')][_0xa453('0x11')]);}logger[_0xa453('0x10')](_0xa453('0xb'),_0xd2645f,_0x21d673[_0xa453('0x10')][_0xa453('0x11')]);return _0x36206(_0x21d673[_0xa453('0x10')]['message']);}else{logger['info'](_0xa453('0xb'),_0xd2645f,'request\x20sent');_0x36206(_0x21d673[_0xa453('0x12')][_0xa453('0x11')]);}})[_0xa453('0x13')](function(_0x12aad0){logger[_0xa453('0x10')]('DeskAccount,\x20%s,\x20%s',_0xd2645f,_0x12aad0);_0x46fe2e(_0x12aad0);});});}exports[_0xa453('0x14')]=function(_0xf880e6){var _0xa5c337=this;return new Promise(function(_0x1a8c47,_0xdebd83){return db[_0xa453('0x15')][_0xa453('0x16')]({'raw':_0xf880e6[_0xa453('0x17')]?_0xf880e6[_0xa453('0x17')][_0xa453('0x18')]===undefined?!![]:![]:!![],'where':_0xf880e6[_0xa453('0x17')]?_0xf880e6['options'][_0xa453('0x19')]||null:null,'attributes':_0xf880e6[_0xa453('0x17')]?_0xf880e6[_0xa453('0x17')][_0xa453('0x1a')]||null:null,'limit':_0xf880e6[_0xa453('0x17')]?_0xf880e6[_0xa453('0x17')][_0xa453('0x1b')]||null:null,'include':_0xf880e6[_0xa453('0x17')]?_0xf880e6[_0xa453('0x17')]['include']?_[_0xa453('0x1c')](_0xf880e6[_0xa453('0x17')][_0xa453('0x1d')],function(_0x5377a5){return{'model':db[_0x5377a5['model']],'as':_0x5377a5['as'],'attributes':_0x5377a5[_0xa453('0x1a')],'include':_0x5377a5[_0xa453('0x1d')]?_[_0xa453('0x1c')](_0x5377a5[_0xa453('0x1d')],function(_0x4ca049){return{'model':db[_0x4ca049['model']],'as':_0x4ca049['as'],'attributes':_0x4ca049[_0xa453('0x1a')],'include':_0x4ca049['include']?_[_0xa453('0x1c')](_0x4ca049[_0xa453('0x1d')],function(_0x4ed049){return{'model':db[_0x4ed049['model']],'as':_0x4ed049['as'],'attributes':_0x4ed049[_0xa453('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa453('0x9')](function(_0x22c42a){logger[_0xa453('0xa')](_0xa453('0x14'),_0xf880e6);logger[_0xa453('0xd')](_0xa453('0x14'),_0xf880e6,JSON[_0xa453('0xf')](_0x22c42a));_0x1a8c47(_0x22c42a);})[_0xa453('0x13')](function(_0x521615){logger[_0xa453('0x10')](_0xa453('0x14'),_0x521615[_0xa453('0x11')],_0xf880e6);_0xdebd83(_0xa5c337[_0xa453('0x10')](0x1f4,_0x521615[_0xa453('0x11')]));});});};exports[_0xa453('0x1e')]=function(_0x15ab60){var _0x4e34e1=this;return new Promise(function(_0x262846,_0x365be9){return db[_0xa453('0x15')][_0xa453('0x1f')]({'raw':_0x15ab60[_0xa453('0x17')]?_0x15ab60[_0xa453('0x17')][_0xa453('0x18')]===undefined?!![]:![]:!![],'where':_0x15ab60[_0xa453('0x17')]?_0x15ab60['options']['where']||null:null,'attributes':_0x15ab60[_0xa453('0x17')]?_0x15ab60['options'][_0xa453('0x1a')]||null:null,'include':_0x15ab60[_0xa453('0x17')]?_0x15ab60[_0xa453('0x17')]['include']?_[_0xa453('0x1c')](_0x15ab60['options'][_0xa453('0x1d')],function(_0x443d9b){return{'model':db[_0x443d9b[_0xa453('0x20')]],'as':_0x443d9b['as'],'attributes':_0x443d9b[_0xa453('0x1a')],'include':_0x443d9b[_0xa453('0x1d')]?_[_0xa453('0x1c')](_0x443d9b['include'],function(_0x127a86){return{'model':db[_0x127a86[_0xa453('0x20')]],'as':_0x127a86['as'],'attributes':_0x127a86[_0xa453('0x1a')],'include':_0x127a86['include']?_[_0xa453('0x1c')](_0x127a86[_0xa453('0x1d')],function(_0x1ea622){return{'model':db[_0x1ea622['model']],'as':_0x1ea622['as'],'attributes':_0x1ea622[_0xa453('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa453('0x9')](function(_0x33b8b6){logger['info'](_0xa453('0x1e'),_0x15ab60);logger[_0xa453('0xd')](_0xa453('0x1e'),_0x15ab60,JSON[_0xa453('0xf')](_0x33b8b6));_0x262846(_0x33b8b6);})['catch'](function(_0x4be5d1){logger[_0xa453('0x10')]('ShowDeskAccount',_0x4be5d1[_0xa453('0x11')],_0x15ab60);_0x365be9(_0x4e34e1[_0xa453('0x10')](0x1f4,_0x4be5d1[_0xa453('0x11')]));});});}; \ No newline at end of file +var _0x57a2=['error','code','message','GetDeskAccount','DeskAccount','findAll','raw','options','where','attributes','limit','include','model','map','debug','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x57a2,0x1ce));var _0x257a=function(_0x71ea91,_0x29c712){_0x71ea91=_0x71ea91-0x0;var _0x55955b=_0x57a2[_0x71ea91];return _0x55955b;};'use strict';var _=require(_0x257a('0x0'));var util=require(_0x257a('0x1'));var moment=require(_0x257a('0x2'));var BPromise=require(_0x257a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x257a('0x4'));var db=require(_0x257a('0x5'))['db'];var utils=require(_0x257a('0x6'));var logger=require(_0x257a('0x7'))('rpc');var config=require(_0x257a('0x8'));var jayson=require(_0x257a('0x9'));var client=jayson[_0x257a('0xa')][_0x257a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463b66,_0x2f2e94,_0x3e2246){return new BPromise(function(_0x37c4b9,_0x5571e2){return client[_0x257a('0xc')](_0x463b66,_0x3e2246)[_0x257a('0xd')](function(_0x3ca294){logger[_0x257a('0xe')](_0x257a('0xf'),_0x2f2e94,_0x257a('0x10'));logger['debug'](_0x257a('0x11'),_0x2f2e94,_0x257a('0x10'),JSON[_0x257a('0x12')](_0x3ca294));if(_0x3ca294[_0x257a('0x13')]){if(_0x3ca294[_0x257a('0x13')][_0x257a('0x14')]===0x1f4){logger[_0x257a('0x13')](_0x257a('0xf'),_0x2f2e94,_0x3ca294['error'][_0x257a('0x15')]);return _0x5571e2(_0x3ca294[_0x257a('0x13')][_0x257a('0x15')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x2f2e94,_0x3ca294[_0x257a('0x13')]['message']);return _0x37c4b9(_0x3ca294[_0x257a('0x13')]['message']);}else{logger[_0x257a('0xe')](_0x257a('0xf'),_0x2f2e94,_0x257a('0x10'));_0x37c4b9(_0x3ca294['result'][_0x257a('0x15')]);}})['catch'](function(_0x395232){logger[_0x257a('0x13')](_0x257a('0xf'),_0x2f2e94,_0x395232);_0x5571e2(_0x395232);});});}exports[_0x257a('0x16')]=function(_0x48a7fa){var _0x2cf88a=this;return new Promise(function(_0x18fd8f,_0x5a1b93){return db[_0x257a('0x17')][_0x257a('0x18')]({'raw':_0x48a7fa['options']?_0x48a7fa['options'][_0x257a('0x19')]===undefined?!![]:![]:!![],'where':_0x48a7fa[_0x257a('0x1a')]?_0x48a7fa[_0x257a('0x1a')][_0x257a('0x1b')]||null:null,'attributes':_0x48a7fa[_0x257a('0x1a')]?_0x48a7fa[_0x257a('0x1a')][_0x257a('0x1c')]||null:null,'limit':_0x48a7fa[_0x257a('0x1a')]?_0x48a7fa['options'][_0x257a('0x1d')]||null:null,'include':_0x48a7fa[_0x257a('0x1a')]?_0x48a7fa['options'][_0x257a('0x1e')]?_['map'](_0x48a7fa[_0x257a('0x1a')]['include'],function(_0x316b91){return{'model':db[_0x316b91[_0x257a('0x1f')]],'as':_0x316b91['as'],'attributes':_0x316b91[_0x257a('0x1c')],'include':_0x316b91[_0x257a('0x1e')]?_[_0x257a('0x20')](_0x316b91[_0x257a('0x1e')],function(_0x2b64c5){return{'model':db[_0x2b64c5[_0x257a('0x1f')]],'as':_0x2b64c5['as'],'attributes':_0x2b64c5[_0x257a('0x1c')],'include':_0x2b64c5[_0x257a('0x1e')]?_[_0x257a('0x20')](_0x2b64c5['include'],function(_0x358a3a){return{'model':db[_0x358a3a[_0x257a('0x1f')]],'as':_0x358a3a['as'],'attributes':_0x358a3a[_0x257a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x257a('0xd')](function(_0x312516){logger['info'](_0x257a('0x16'),_0x48a7fa);logger[_0x257a('0x21')](_0x257a('0x16'),_0x48a7fa,JSON[_0x257a('0x12')](_0x312516));_0x18fd8f(_0x312516);})[_0x257a('0x22')](function(_0x26f361){logger[_0x257a('0x13')](_0x257a('0x16'),_0x26f361[_0x257a('0x15')],_0x48a7fa);_0x5a1b93(_0x2cf88a[_0x257a('0x13')](0x1f4,_0x26f361[_0x257a('0x15')]));});});};exports[_0x257a('0x23')]=function(_0x328a1c){var _0x1fe837=this;return new Promise(function(_0xce6aad,_0x514a25){return db[_0x257a('0x17')][_0x257a('0x24')]({'raw':_0x328a1c[_0x257a('0x1a')]?_0x328a1c[_0x257a('0x1a')][_0x257a('0x19')]===undefined?!![]:![]:!![],'where':_0x328a1c['options']?_0x328a1c[_0x257a('0x1a')]['where']||null:null,'attributes':_0x328a1c[_0x257a('0x1a')]?_0x328a1c['options'][_0x257a('0x1c')]||null:null,'include':_0x328a1c[_0x257a('0x1a')]?_0x328a1c[_0x257a('0x1a')][_0x257a('0x1e')]?_['map'](_0x328a1c['options'][_0x257a('0x1e')],function(_0xadd7e3){return{'model':db[_0xadd7e3[_0x257a('0x1f')]],'as':_0xadd7e3['as'],'attributes':_0xadd7e3[_0x257a('0x1c')],'include':_0xadd7e3['include']?_[_0x257a('0x20')](_0xadd7e3[_0x257a('0x1e')],function(_0x14de82){return{'model':db[_0x14de82[_0x257a('0x1f')]],'as':_0x14de82['as'],'attributes':_0x14de82[_0x257a('0x1c')],'include':_0x14de82[_0x257a('0x1e')]?_[_0x257a('0x20')](_0x14de82['include'],function(_0x1bc5d5){return{'model':db[_0x1bc5d5['model']],'as':_0x1bc5d5['as'],'attributes':_0x1bc5d5[_0x257a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x257a('0xd')](function(_0x3dfe1f){logger['info'](_0x257a('0x23'),_0x328a1c);logger[_0x257a('0x21')](_0x257a('0x23'),_0x328a1c,JSON[_0x257a('0x12')](_0x3dfe1f));_0xce6aad(_0x3dfe1f);})[_0x257a('0x22')](function(_0x25b763){logger[_0x257a('0x13')](_0x257a('0x23'),_0x25b763[_0x257a('0x15')],_0x328a1c);_0x514a25(_0x1fe837['error'](0x1f4,_0x25b763[_0x257a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ba55393..b369d6a 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 _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x24f1ee,_0x312eab){var _0xa795e6=function(_0x24b9a2){while(--_0x24b9a2){_0x24f1ee['push'](_0x24f1ee['shift']());}};_0xa795e6(++_0x312eab);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'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['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3bfffa,_0x46123d){var _0x28e970=function(_0x5c905b){while(--_0x5c905b){_0x3bfffa['push'](_0x3bfffa['shift']());}};_0x28e970(++_0x46123d);}(_0x3e74,0x175));var _0x43e7=function(_0x51629a,_0x39db40){_0x51629a=_0x51629a-0x0;var _0x4e9c2c=_0x3e74[_0x51629a];return _0x4e9c2c;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 226b1c9..c253dd3 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 _0xd78a=['sequelize'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd78a,0xf1));var _0xad78=function(_0x4ddbe2,_0x2823e3){_0x4ddbe2=_0x4ddbe2-0x0;var _0x5f25fa=_0xd78a[_0x4ddbe2];return _0x5f25fa;};'use strict';var Sequelize=require(_0xad78('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9b26=['STRING'];(function(_0x41fd72,_0x2da32c){var _0x373233=function(_0xf78ce9){while(--_0xf78ce9){_0x41fd72['push'](_0x41fd72['shift']());}};_0x373233(++_0x2da32c);}(_0x9b26,0x72));var _0x69b2=function(_0x19084c,_0x3e4442){_0x19084c=_0x19084c-0x0;var _0x5d6efb=_0x9b26[_0x19084c];return _0x5d6efb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x69b2('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b6df924..6c471db 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 _0x4e9d=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','DeskConfiguration','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','create','body','params','getFields','findOne','getSubjects','DeskField','pick','getDescriptions'];(function(_0x833c79,_0x25ab03){var _0x397755=function(_0x2e51f8){while(--_0x2e51f8){_0x833c79['push'](_0x833c79['shift']());}};_0x397755(++_0x25ab03);}(_0x4e9d,0xae));var _0xd4e9=function(_0x3e0600,_0x9bb3c9){_0x3e0600=_0x3e0600-0x0;var _0x5e1117=_0x4e9d[_0x3e0600];return _0x5e1117;};'use strict';var emlformat=require(_0xd4e9('0x0'));var rimraf=require(_0xd4e9('0x1'));var zipdir=require(_0xd4e9('0x2'));var jsonpatch=require(_0xd4e9('0x3'));var rp=require(_0xd4e9('0x4'));var moment=require(_0xd4e9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd4e9('0x6'));var path=require(_0xd4e9('0x7'));var sox=require(_0xd4e9('0x8'));var csv=require(_0xd4e9('0x9'));var ejs=require(_0xd4e9('0xa'));var fs=require('fs');var fs_extra=require(_0xd4e9('0xb'));var _=require(_0xd4e9('0xc'));var squel=require(_0xd4e9('0xd'));var crypto=require(_0xd4e9('0xe'));var jsforce=require(_0xd4e9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd4e9('0x9'));var querystring=require(_0xd4e9('0x10'));var Papa=require(_0xd4e9('0x11'));var Redis=require('ioredis');var authService=require(_0xd4e9('0x12'));var qs=require(_0xd4e9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4e9('0x14'));var logger=require(_0xd4e9('0x15'))(_0xd4e9('0x16'));var utils=require(_0xd4e9('0x17'));var config=require(_0xd4e9('0x18'));var licenseUtil=require(_0xd4e9('0x19'));var db=require(_0xd4e9('0x1a'))['db'];function respondWithStatusCode(_0x1ee811,_0x54e53e){_0x54e53e=_0x54e53e||0xcc;return function(_0x310055){if(_0x310055){return _0x1ee811['sendStatus'](_0x54e53e);}return _0x1ee811[_0xd4e9('0x1b')](_0x54e53e)[_0xd4e9('0x1c')]();};}function respondWithResult(_0x26c2c0,_0x464af0){_0x464af0=_0x464af0||0xc8;return function(_0xf9483c){if(_0xf9483c){return _0x26c2c0[_0xd4e9('0x1b')](_0x464af0)[_0xd4e9('0x1d')](_0xf9483c);}};}function respondWithFilteredResult(_0x44a00f,_0x3e8e46){return function(_0x3130da){if(_0x3130da){var _0x50a97c=typeof _0x3e8e46[_0xd4e9('0x1e')]===_0xd4e9('0x1f')&&typeof _0x3e8e46[_0xd4e9('0x20')]===_0xd4e9('0x1f');var _0x161b98=_0x3130da[_0xd4e9('0x21')];var _0x148c81=_0x50a97c?0x0:_0x3e8e46['offset'];var _0x85c250=_0x50a97c?_0x3130da[_0xd4e9('0x21')]:_0x3e8e46[_0xd4e9('0x1e')]+_0x3e8e46[_0xd4e9('0x20')];var _0x183705;if(_0x85c250>=_0x161b98){_0x85c250=_0x161b98;_0x183705=0xc8;}else{_0x183705=0xce;}_0x44a00f[_0xd4e9('0x1b')](_0x183705);return _0x44a00f['set'](_0xd4e9('0x22'),_0x148c81+'-'+_0x85c250+'/'+_0x161b98)[_0xd4e9('0x1d')](_0x3130da);}return null;};}function patchUpdates(_0x2add84){return function(_0x1b69b8){try{jsonpatch['apply'](_0x1b69b8,_0x2add84,!![]);}catch(_0x2e0dab){return BPromise[_0xd4e9('0x23')](_0x2e0dab);}return _0x1b69b8['save']();};}function saveUpdates(_0x4cde6a,_0x4aae1f){return function(_0x1328c4){if(_0x1328c4){return _0x1328c4[_0xd4e9('0x24')](_0x4cde6a)[_0xd4e9('0x25')](function(_0x3f96f7){return _0x3f96f7;});}return null;};}function removeEntity(_0x380676,_0x18e83a){return function(_0x577ab8){if(_0x577ab8){return _0x577ab8[_0xd4e9('0x26')]()[_0xd4e9('0x25')](function(){_0x380676['status'](0xcc)[_0xd4e9('0x1c')]();});}};}function handleEntityNotFound(_0xa8d501,_0x5ae2aa){return function(_0xbe1dd3){if(!_0xbe1dd3){_0xa8d501['sendStatus'](0x194);}return _0xbe1dd3;};}function handleError(_0x1e6691,_0x3e863f){_0x3e863f=_0x3e863f||0x1f4;return function(_0x76be90){logger[_0xd4e9('0x27')](_0x76be90[_0xd4e9('0x28')]);if(_0x76be90['name']){delete _0x76be90[_0xd4e9('0x29')];}_0x1e6691[_0xd4e9('0x1b')](_0x3e863f)[_0xd4e9('0x2a')](_0x76be90);};}exports['index']=function(_0x1a54e0,_0xc5fdc9){var _0x4cabcb={},_0x582b52={},_0x4a85b7={'count':0x0,'rows':[]};var _0x525466=_[_0xd4e9('0x2b')](db['DeskConfiguration']['rawAttributes'],function(_0x28586d){return{'name':_0x28586d[_0xd4e9('0x2c')],'type':_0x28586d['type'][_0xd4e9('0x2d')]};});_0x582b52[_0xd4e9('0x2e')]=_[_0xd4e9('0x2b')](_0x525466,_0xd4e9('0x29'));_0x582b52[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](_0x1a54e0[_0xd4e9('0x2f')]);_0x582b52[_0xd4e9('0x31')]=_['intersection'](_0x582b52[_0xd4e9('0x2e')],_0x582b52['query']);_0x4cabcb['attributes']=_[_0xd4e9('0x32')](_0x582b52[_0xd4e9('0x2e')],qs['fields'](_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x33')]));_0x4cabcb[_0xd4e9('0x34')]=_0x4cabcb['attributes']['length']?_0x4cabcb['attributes']:_0x582b52[_0xd4e9('0x2e')];if(!_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x35')](_0xd4e9('0x36'))){_0x4cabcb[_0xd4e9('0x20')]=qs[_0xd4e9('0x20')](_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x20')]);_0x4cabcb[_0xd4e9('0x1e')]=qs[_0xd4e9('0x1e')](_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x1e')]);}_0x4cabcb[_0xd4e9('0x37')]=qs[_0xd4e9('0x38')](_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x38')]);_0x4cabcb[_0xd4e9('0x39')]=qs[_0xd4e9('0x31')](_['pick'](_0x1a54e0[_0xd4e9('0x2f')],_0x582b52[_0xd4e9('0x31')]),_0x525466);if(_0x1a54e0[_0xd4e9('0x2f')]['filter']){_0x4cabcb[_0xd4e9('0x39')]=_[_0xd4e9('0x3a')](_0x4cabcb[_0xd4e9('0x39')],{'$or':_[_0xd4e9('0x2b')](_0x525466,function(_0x35aecd){if(_0x35aecd['type']!==_0xd4e9('0x3b')){var _0x5cc096={};_0x5cc096[_0x35aecd[_0xd4e9('0x29')]]={'$like':'%'+_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x3c')]+'%'};return _0x5cc096;}})});}_0x4cabcb=_[_0xd4e9('0x3a')]({},_0x4cabcb,_0x1a54e0[_0xd4e9('0x3d')]);var _0x4a1c5b={'where':_0x4cabcb[_0xd4e9('0x39')]};return db[_0xd4e9('0x3e')]['count'](_0x4a1c5b)['then'](function(_0x43f11c){_0x4a85b7['count']=_0x43f11c;if(_0x1a54e0[_0xd4e9('0x2f')][_0xd4e9('0x3f')]){_0x4cabcb['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xd4e9('0x40')](_0x4cabcb);})['then'](function(_0x4c79bb){_0x4a85b7[_0xd4e9('0x41')]=_0x4c79bb;return _0x4a85b7;})[_0xd4e9('0x25')](respondWithFilteredResult(_0xc5fdc9,_0x4cabcb))[_0xd4e9('0x42')](handleError(_0xc5fdc9,null));};exports[_0xd4e9('0x43')]=function(_0x50e5dc,_0x55eef9){var _0x11c37b={'raw':![],'where':{'id':_0x50e5dc['params']['id']}},_0x4980ac={};_0x4980ac[_0xd4e9('0x2e')]=_[_0xd4e9('0x30')](db[_0xd4e9('0x3e')][_0xd4e9('0x44')]);_0x4980ac[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](_0x50e5dc[_0xd4e9('0x2f')]);_0x4980ac[_0xd4e9('0x31')]=_[_0xd4e9('0x32')](_0x4980ac[_0xd4e9('0x2e')],_0x4980ac[_0xd4e9('0x2f')]);_0x11c37b['attributes']=_['intersection'](_0x4980ac[_0xd4e9('0x2e')],qs[_0xd4e9('0x33')](_0x50e5dc[_0xd4e9('0x2f')]['fields']));_0x11c37b[_0xd4e9('0x34')]=_0x11c37b[_0xd4e9('0x34')][_0xd4e9('0x45')]?_0x11c37b[_0xd4e9('0x34')]:_0x4980ac['model'];if(_0x50e5dc['query'][_0xd4e9('0x3f')]){_0x11c37b[_0xd4e9('0x46')]=[{'all':!![]}];}_0x11c37b=_[_0xd4e9('0x3a')]({},_0x11c37b,_0x50e5dc[_0xd4e9('0x3d')]);return db[_0xd4e9('0x3e')][_0xd4e9('0x47')](_0x11c37b)[_0xd4e9('0x25')](handleEntityNotFound(_0x55eef9,null))[_0xd4e9('0x25')](respondWithResult(_0x55eef9,null))[_0xd4e9('0x42')](handleError(_0x55eef9,null));};exports[_0xd4e9('0x48')]=function(_0x22062b,_0x5f559d){return db[_0xd4e9('0x3e')][_0xd4e9('0x48')](_0x22062b[_0xd4e9('0x49')],{})[_0xd4e9('0x25')](respondWithResult(_0x5f559d,0xc9))[_0xd4e9('0x42')](handleError(_0x5f559d,null));};exports['update']=function(_0x29440a,_0x154121){if(_0x29440a[_0xd4e9('0x49')]['id']){delete _0x29440a['body']['id'];}return db[_0xd4e9('0x3e')][_0xd4e9('0x47')]({'where':{'id':_0x29440a['params']['id']}})[_0xd4e9('0x25')](handleEntityNotFound(_0x154121,null))[_0xd4e9('0x25')](saveUpdates(_0x29440a['body'],null))['then'](respondWithResult(_0x154121,null))['catch'](handleError(_0x154121,null));};exports[_0xd4e9('0x26')]=function(_0x44cdda,_0x35d649){return db[_0xd4e9('0x3e')]['find']({'where':{'id':_0x44cdda[_0xd4e9('0x4a')]['id']}})[_0xd4e9('0x25')](handleEntityNotFound(_0x35d649,null))['then'](removeEntity(_0x35d649,null))['catch'](handleError(_0x35d649,null));};exports[_0xd4e9('0x4b')]=function(_0x258108,_0xfbbf29,_0x19dadd){var _0x3ec5b2={};var _0x135e19={};var _0x422bb2;var _0x2b8f30;return db[_0xd4e9('0x3e')][_0xd4e9('0x4c')]({'where':{'id':_0x258108[_0xd4e9('0x4a')]['id']}})[_0xd4e9('0x25')](handleEntityNotFound(_0xfbbf29,null))['then'](function(_0x7c5941){if(_0x7c5941){_0x422bb2=_0x7c5941;_0x135e19[_0xd4e9('0x2e')]=_[_0xd4e9('0x30')](db['DeskField'][_0xd4e9('0x44')]);_0x135e19[_0xd4e9('0x2f')]=_['keys'](_0x258108[_0xd4e9('0x2f')]);_0x135e19[_0xd4e9('0x31')]=_[_0xd4e9('0x32')](_0x135e19['model'],_0x135e19[_0xd4e9('0x2f')]);_0x3ec5b2[_0xd4e9('0x34')]=_[_0xd4e9('0x32')](_0x135e19[_0xd4e9('0x2e')],qs[_0xd4e9('0x33')](_0x258108['query'][_0xd4e9('0x33')]));_0x3ec5b2['attributes']=_0x3ec5b2[_0xd4e9('0x34')][_0xd4e9('0x45')]?_0x3ec5b2[_0xd4e9('0x34')]:_0x135e19[_0xd4e9('0x2e')];_0x3ec5b2[_0xd4e9('0x37')]=qs[_0xd4e9('0x38')](_0x258108['query'][_0xd4e9('0x38')]);_0x3ec5b2[_0xd4e9('0x39')]=qs[_0xd4e9('0x31')](_['pick'](_0x258108[_0xd4e9('0x2f')],_0x135e19[_0xd4e9('0x31')]));if(_0x258108[_0xd4e9('0x2f')][_0xd4e9('0x3c')]){_0x3ec5b2['where']=_[_0xd4e9('0x3a')](_0x3ec5b2[_0xd4e9('0x39')],{'$or':_[_0xd4e9('0x2b')](_0x3ec5b2[_0xd4e9('0x34')],function(_0x5d499){var _0x226e4e={};_0x226e4e[_0x5d499]={'$like':'%'+_0x258108[_0xd4e9('0x2f')][_0xd4e9('0x3c')]+'%'};return _0x226e4e;})});}_0x3ec5b2=_[_0xd4e9('0x3a')]({},_0x3ec5b2,_0x258108[_0xd4e9('0x3d')]);return _0x422bb2[_0xd4e9('0x4b')](_0x3ec5b2);}})[_0xd4e9('0x25')](function(_0x218b1f){if(_0x218b1f){_0x2b8f30=_0x218b1f['length'];if(!_0x258108[_0xd4e9('0x2f')]['hasOwnProperty'](_0xd4e9('0x36'))){_0x3ec5b2[_0xd4e9('0x20')]=qs[_0xd4e9('0x20')](_0x258108[_0xd4e9('0x2f')]['limit']);_0x3ec5b2[_0xd4e9('0x1e')]=qs[_0xd4e9('0x1e')](_0x258108[_0xd4e9('0x2f')][_0xd4e9('0x1e')]);}return _0x422bb2[_0xd4e9('0x4b')](_0x3ec5b2);}})[_0xd4e9('0x25')](function(_0x1f4fce){if(_0x1f4fce){return _0x1f4fce?{'count':_0x2b8f30,'rows':_0x1f4fce}:null;}})[_0xd4e9('0x25')](respondWithResult(_0xfbbf29,null))[_0xd4e9('0x42')](handleError(_0xfbbf29,null));};exports[_0xd4e9('0x4d')]=function(_0x50f1b1,_0x383880,_0x251081){var _0x3c1ecc={};var _0x18192a={};var _0x3ea350;var _0x2d2e0a;return db[_0xd4e9('0x3e')][_0xd4e9('0x4c')]({'where':{'id':_0x50f1b1[_0xd4e9('0x4a')]['id']}})[_0xd4e9('0x25')](handleEntityNotFound(_0x383880,null))[_0xd4e9('0x25')](function(_0x336300){if(_0x336300){_0x3ea350=_0x336300;_0x18192a[_0xd4e9('0x2e')]=_[_0xd4e9('0x30')](db[_0xd4e9('0x4e')]['rawAttributes']);_0x18192a[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](_0x50f1b1[_0xd4e9('0x2f')]);_0x18192a[_0xd4e9('0x31')]=_[_0xd4e9('0x32')](_0x18192a[_0xd4e9('0x2e')],_0x18192a[_0xd4e9('0x2f')]);_0x3c1ecc[_0xd4e9('0x34')]=_[_0xd4e9('0x32')](_0x18192a[_0xd4e9('0x2e')],qs[_0xd4e9('0x33')](_0x50f1b1['query'][_0xd4e9('0x33')]));_0x3c1ecc[_0xd4e9('0x34')]=_0x3c1ecc[_0xd4e9('0x34')][_0xd4e9('0x45')]?_0x3c1ecc['attributes']:_0x18192a[_0xd4e9('0x2e')];_0x3c1ecc[_0xd4e9('0x37')]=qs[_0xd4e9('0x38')](_0x50f1b1['query'][_0xd4e9('0x38')]);_0x3c1ecc[_0xd4e9('0x39')]=qs[_0xd4e9('0x31')](_[_0xd4e9('0x4f')](_0x50f1b1['query'],_0x18192a['filters']));if(_0x50f1b1[_0xd4e9('0x2f')][_0xd4e9('0x3c')]){_0x3c1ecc[_0xd4e9('0x39')]=_[_0xd4e9('0x3a')](_0x3c1ecc[_0xd4e9('0x39')],{'$or':_['map'](_0x3c1ecc[_0xd4e9('0x34')],function(_0x4d0c0a){var _0x1b8ef8={};_0x1b8ef8[_0x4d0c0a]={'$like':'%'+_0x50f1b1['query'][_0xd4e9('0x3c')]+'%'};return _0x1b8ef8;})});}_0x3c1ecc=_['merge']({},_0x3c1ecc,_0x50f1b1[_0xd4e9('0x3d')]);return _0x3ea350[_0xd4e9('0x4d')](_0x3c1ecc);}})[_0xd4e9('0x25')](function(_0x11f131){if(_0x11f131){_0x2d2e0a=_0x11f131['length'];if(!_0x50f1b1[_0xd4e9('0x2f')][_0xd4e9('0x35')](_0xd4e9('0x36'))){_0x3c1ecc[_0xd4e9('0x20')]=qs[_0xd4e9('0x20')](_0x50f1b1[_0xd4e9('0x2f')][_0xd4e9('0x20')]);_0x3c1ecc['offset']=qs[_0xd4e9('0x1e')](_0x50f1b1[_0xd4e9('0x2f')][_0xd4e9('0x1e')]);}return _0x3ea350['getSubjects'](_0x3c1ecc);}})[_0xd4e9('0x25')](function(_0x4ccf08){if(_0x4ccf08){return _0x4ccf08?{'count':_0x2d2e0a,'rows':_0x4ccf08}:null;}})[_0xd4e9('0x25')](respondWithResult(_0x383880,null))[_0xd4e9('0x42')](handleError(_0x383880,null));};exports[_0xd4e9('0x50')]=function(_0x4b2267,_0x3b1f8e,_0x6455ca){var _0x1857f5={};var _0x470ab6={};var _0x34c9c5;var _0x1efc19;return db['DeskConfiguration'][_0xd4e9('0x4c')]({'where':{'id':_0x4b2267['params']['id']}})['then'](handleEntityNotFound(_0x3b1f8e,null))[_0xd4e9('0x25')](function(_0x285233){if(_0x285233){_0x34c9c5=_0x285233;_0x470ab6[_0xd4e9('0x2e')]=_['keys'](db[_0xd4e9('0x4e')][_0xd4e9('0x44')]);_0x470ab6[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](_0x4b2267[_0xd4e9('0x2f')]);_0x470ab6[_0xd4e9('0x31')]=_[_0xd4e9('0x32')](_0x470ab6[_0xd4e9('0x2e')],_0x470ab6[_0xd4e9('0x2f')]);_0x1857f5[_0xd4e9('0x34')]=_[_0xd4e9('0x32')](_0x470ab6['model'],qs['fields'](_0x4b2267[_0xd4e9('0x2f')][_0xd4e9('0x33')]));_0x1857f5['attributes']=_0x1857f5[_0xd4e9('0x34')][_0xd4e9('0x45')]?_0x1857f5[_0xd4e9('0x34')]:_0x470ab6['model'];_0x1857f5[_0xd4e9('0x37')]=qs['sort'](_0x4b2267[_0xd4e9('0x2f')][_0xd4e9('0x38')]);_0x1857f5[_0xd4e9('0x39')]=qs[_0xd4e9('0x31')](_[_0xd4e9('0x4f')](_0x4b2267[_0xd4e9('0x2f')],_0x470ab6[_0xd4e9('0x31')]));if(_0x4b2267[_0xd4e9('0x2f')][_0xd4e9('0x3c')]){_0x1857f5[_0xd4e9('0x39')]=_['merge'](_0x1857f5['where'],{'$or':_['map'](_0x1857f5[_0xd4e9('0x34')],function(_0x356b63){var _0x52b1e2={};_0x52b1e2[_0x356b63]={'$like':'%'+_0x4b2267[_0xd4e9('0x2f')][_0xd4e9('0x3c')]+'%'};return _0x52b1e2;})});}_0x1857f5=_[_0xd4e9('0x3a')]({},_0x1857f5,_0x4b2267[_0xd4e9('0x3d')]);return _0x34c9c5[_0xd4e9('0x50')](_0x1857f5);}})[_0xd4e9('0x25')](function(_0x447281){if(_0x447281){_0x1efc19=_0x447281['length'];if(!_0x4b2267[_0xd4e9('0x2f')][_0xd4e9('0x35')](_0xd4e9('0x36'))){_0x1857f5['limit']=qs[_0xd4e9('0x20')](_0x4b2267['query'][_0xd4e9('0x20')]);_0x1857f5['offset']=qs[_0xd4e9('0x1e')](_0x4b2267['query'][_0xd4e9('0x1e')]);}return _0x34c9c5[_0xd4e9('0x50')](_0x1857f5);}})[_0xd4e9('0x25')](function(_0x1c7010){if(_0x1c7010){return _0x1c7010?{'count':_0x1efc19,'rows':_0x1c7010}:null;}})[_0xd4e9('0x25')](respondWithResult(_0x3b1f8e,null))[_0xd4e9('0x42')](handleError(_0x3b1f8e,null));};exports[_0xd4e9('0x51')]=function(_0x148b67,_0x31183c,_0x435956){var _0x4ce670={};var _0x24361b={};var _0x13c904;var _0xfe3f84;return db[_0xd4e9('0x3e')][_0xd4e9('0x4c')]({'where':{'id':_0x148b67['params']['id']}})[_0xd4e9('0x25')](handleEntityNotFound(_0x31183c,null))[_0xd4e9('0x25')](function(_0x379f00){if(_0x379f00){_0x13c904=_0x379f00;_0x24361b[_0xd4e9('0x2e')]=_[_0xd4e9('0x30')](db[_0xd4e9('0x52')][_0xd4e9('0x44')]);_0x24361b['query']=_[_0xd4e9('0x30')](_0x148b67[_0xd4e9('0x2f')]);_0x24361b['filters']=_['intersection'](_0x24361b[_0xd4e9('0x2e')],_0x24361b['query']);_0x4ce670[_0xd4e9('0x34')]=_[_0xd4e9('0x32')](_0x24361b[_0xd4e9('0x2e')],qs['fields'](_0x148b67[_0xd4e9('0x2f')][_0xd4e9('0x33')]));_0x4ce670[_0xd4e9('0x34')]=_0x4ce670[_0xd4e9('0x34')][_0xd4e9('0x45')]?_0x4ce670[_0xd4e9('0x34')]:_0x24361b[_0xd4e9('0x2e')];_0x4ce670['order']=qs['sort'](_0x148b67[_0xd4e9('0x2f')][_0xd4e9('0x38')]);_0x4ce670['where']=qs[_0xd4e9('0x31')](_[_0xd4e9('0x4f')](_0x148b67['query'],_0x24361b[_0xd4e9('0x31')]));if(_0x148b67[_0xd4e9('0x2f')]['filter']){_0x4ce670[_0xd4e9('0x39')]=_['merge'](_0x4ce670[_0xd4e9('0x39')],{'$or':_[_0xd4e9('0x2b')](_0x4ce670[_0xd4e9('0x34')],function(_0x231fc3){var _0x405642={};_0x405642[_0x231fc3]={'$like':'%'+_0x148b67['query']['filter']+'%'};return _0x405642;})});}_0x4ce670=_[_0xd4e9('0x3a')]({},_0x4ce670,_0x148b67['options']);return _0x13c904['getTags'](_0x4ce670);}})[_0xd4e9('0x25')](function(_0x1189f0){if(_0x1189f0){_0xfe3f84=_0x1189f0[_0xd4e9('0x45')];if(!_0x148b67['query'][_0xd4e9('0x35')](_0xd4e9('0x36'))){_0x4ce670[_0xd4e9('0x20')]=qs[_0xd4e9('0x20')](_0x148b67[_0xd4e9('0x2f')]['limit']);_0x4ce670[_0xd4e9('0x1e')]=qs['offset'](_0x148b67['query'][_0xd4e9('0x1e')]);}return _0x13c904[_0xd4e9('0x51')](_0x4ce670);}})['then'](function(_0x2aca0a){if(_0x2aca0a){return _0x2aca0a?{'count':_0xfe3f84,'rows':_0x2aca0a}:null;}})[_0xd4e9('0x25')](respondWithResult(_0x31183c,null))[_0xd4e9('0x42')](handleError(_0x31183c,null));};exports[_0xd4e9('0x53')]=function(_0x219693,_0x3e08de,_0x17610f){if(_0x219693['body']['id']){delete _0x219693['body']['id'];}return db[_0xd4e9('0x3e')][_0xd4e9('0x4c')]({'where':{'id':_0x219693[_0xd4e9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e08de,null))['then'](function(_0x3c979c){if(_0x3c979c){return _0x3c979c[_0xd4e9('0x53')](_0x219693['body'][_0xd4e9('0x54')]||[]);}return null;})[_0xd4e9('0x25')](respondWithResult(_0x3e08de,null))[_0xd4e9('0x42')](handleError(_0x3e08de,null));}; \ No newline at end of file +var _0x22c4=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','create','body','find','destroy','getFields','DeskField','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields'];(function(_0x248bf0,_0x29a685){var _0x455c00=function(_0x44da4d){while(--_0x44da4d){_0x248bf0['push'](_0x248bf0['shift']());}};_0x455c00(++_0x29a685);}(_0x22c4,0x1ae));var _0x422c=function(_0x3f7861,_0x13619b){_0x3f7861=_0x3f7861-0x0;var _0x36fdae=_0x22c4[_0x3f7861];return _0x36fdae;};'use strict';var emlformat=require(_0x422c('0x0'));var rimraf=require(_0x422c('0x1'));var zipdir=require(_0x422c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x422c('0x3'));var util=require('util');var path=require(_0x422c('0x4'));var sox=require(_0x422c('0x5'));var csv=require(_0x422c('0x6'));var ejs=require(_0x422c('0x7'));var fs=require('fs');var fs_extra=require(_0x422c('0x8'));var _=require(_0x422c('0x9'));var squel=require(_0x422c('0xa'));var crypto=require('crypto');var jsforce=require(_0x422c('0xb'));var deskjs=require(_0x422c('0xc'));var toCsv=require(_0x422c('0x6'));var querystring=require(_0x422c('0xd'));var Papa=require('papaparse');var Redis=require(_0x422c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x422c('0xf'));var as=require(_0x422c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x422c('0x11'));var utils=require(_0x422c('0x12'));var config=require(_0x422c('0x13'));var licenseUtil=require(_0x422c('0x14'));var db=require(_0x422c('0x15'))['db'];function respondWithStatusCode(_0x3713e7,_0x189947){_0x189947=_0x189947||0xcc;return function(_0x632d7){if(_0x632d7){return _0x3713e7['sendStatus'](_0x189947);}return _0x3713e7['status'](_0x189947)['end']();};}function respondWithResult(_0x25576d,_0x2beb53){_0x2beb53=_0x2beb53||0xc8;return function(_0x238976){if(_0x238976){return _0x25576d[_0x422c('0x16')](_0x2beb53)[_0x422c('0x17')](_0x238976);}};}function respondWithFilteredResult(_0x5a41ae,_0x29f7ee){return function(_0x4ca88c){if(_0x4ca88c){var _0x186a92=typeof _0x29f7ee[_0x422c('0x18')]===_0x422c('0x19')&&typeof _0x29f7ee['limit']==='undefined';var _0x14efd4=_0x4ca88c['count'];var _0x47b6ba=_0x186a92?0x0:_0x29f7ee[_0x422c('0x18')];var _0x5f092f=_0x186a92?_0x4ca88c[_0x422c('0x1a')]:_0x29f7ee['offset']+_0x29f7ee[_0x422c('0x1b')];var _0x5b81d3;if(_0x5f092f>=_0x14efd4){_0x5f092f=_0x14efd4;_0x5b81d3=0xc8;}else{_0x5b81d3=0xce;}_0x5a41ae[_0x422c('0x16')](_0x5b81d3);return _0x5a41ae[_0x422c('0x1c')](_0x422c('0x1d'),_0x47b6ba+'-'+_0x5f092f+'/'+_0x14efd4)[_0x422c('0x17')](_0x4ca88c);}return null;};}function patchUpdates(_0x35b8e2){return function(_0x317ebe){try{jsonpatch[_0x422c('0x1e')](_0x317ebe,_0x35b8e2,!![]);}catch(_0xf608a7){return BPromise['reject'](_0xf608a7);}return _0x317ebe[_0x422c('0x1f')]();};}function saveUpdates(_0x34fefa,_0x108302){return function(_0x26ebc0){if(_0x26ebc0){return _0x26ebc0[_0x422c('0x20')](_0x34fefa)[_0x422c('0x21')](function(_0x2aaeec){return _0x2aaeec;});}return null;};}function removeEntity(_0x91258f,_0x319ed6){return function(_0x13f456){if(_0x13f456){return _0x13f456['destroy']()['then'](function(){_0x91258f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18dde2,_0x38a737){return function(_0x212436){if(!_0x212436){_0x18dde2[_0x422c('0x22')](0x194);}return _0x212436;};}function handleError(_0x4d61c9,_0x345ebb){_0x345ebb=_0x345ebb||0x1f4;return function(_0x39e861){logger[_0x422c('0x23')](_0x39e861[_0x422c('0x24')]);if(_0x39e861[_0x422c('0x25')]){delete _0x39e861[_0x422c('0x25')];}_0x4d61c9['status'](_0x345ebb)[_0x422c('0x26')](_0x39e861);};}exports['index']=function(_0x338c7d,_0x3e0040){var _0x428a2f={},_0x17fd9f={},_0x34f5fc={'count':0x0,'rows':[]};var _0x585e83=_[_0x422c('0x27')](db[_0x422c('0x28')][_0x422c('0x29')],function(_0x398fa9){return{'name':_0x398fa9[_0x422c('0x2a')],'type':_0x398fa9['type'][_0x422c('0x2b')]};});_0x17fd9f[_0x422c('0x2c')]=_[_0x422c('0x27')](_0x585e83,_0x422c('0x25'));_0x17fd9f['query']=_[_0x422c('0x2d')](_0x338c7d[_0x422c('0x2e')]);_0x17fd9f[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x17fd9f[_0x422c('0x2c')],_0x17fd9f[_0x422c('0x2e')]);_0x428a2f['attributes']=_['intersection'](_0x17fd9f[_0x422c('0x2c')],qs[_0x422c('0x31')](_0x338c7d['query']['fields']));_0x428a2f[_0x422c('0x32')]=_0x428a2f[_0x422c('0x32')][_0x422c('0x33')]?_0x428a2f['attributes']:_0x17fd9f['model'];if(!_0x338c7d[_0x422c('0x2e')][_0x422c('0x34')](_0x422c('0x35'))){_0x428a2f[_0x422c('0x1b')]=qs['limit'](_0x338c7d['query'][_0x422c('0x1b')]);_0x428a2f['offset']=qs[_0x422c('0x18')](_0x338c7d[_0x422c('0x2e')][_0x422c('0x18')]);}_0x428a2f[_0x422c('0x36')]=qs[_0x422c('0x37')](_0x338c7d[_0x422c('0x2e')][_0x422c('0x37')]);_0x428a2f[_0x422c('0x38')]=qs[_0x422c('0x2f')](_[_0x422c('0x39')](_0x338c7d[_0x422c('0x2e')],_0x17fd9f['filters']),_0x585e83);if(_0x338c7d[_0x422c('0x2e')][_0x422c('0x3a')]){_0x428a2f[_0x422c('0x38')]=_['merge'](_0x428a2f['where'],{'$or':_[_0x422c('0x27')](_0x585e83,function(_0x4a8112){if(_0x4a8112['type']!=='VIRTUAL'){var _0x3e7767={};_0x3e7767[_0x4a8112[_0x422c('0x25')]]={'$like':'%'+_0x338c7d[_0x422c('0x2e')][_0x422c('0x3a')]+'%'};return _0x3e7767;}})});}_0x428a2f=_[_0x422c('0x3b')]({},_0x428a2f,_0x338c7d['options']);var _0x2b6153={'where':_0x428a2f['where']};return db[_0x422c('0x28')][_0x422c('0x1a')](_0x2b6153)[_0x422c('0x21')](function(_0x1c6944){_0x34f5fc[_0x422c('0x1a')]=_0x1c6944;if(_0x338c7d['query'][_0x422c('0x3c')]){_0x428a2f[_0x422c('0x3d')]=[{'all':!![]}];}return db[_0x422c('0x28')]['findAll'](_0x428a2f);})[_0x422c('0x21')](function(_0x546eb2){_0x34f5fc[_0x422c('0x3e')]=_0x546eb2;return _0x34f5fc;})['then'](respondWithFilteredResult(_0x3e0040,_0x428a2f))[_0x422c('0x3f')](handleError(_0x3e0040,null));};exports[_0x422c('0x40')]=function(_0x3281a5,_0xf8b24f){var _0x56ac71={'raw':![],'where':{'id':_0x3281a5[_0x422c('0x41')]['id']}},_0x52c464={};_0x52c464['model']=_[_0x422c('0x2d')](db['DeskConfiguration']['rawAttributes']);_0x52c464[_0x422c('0x2e')]=_['keys'](_0x3281a5[_0x422c('0x2e')]);_0x52c464[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x52c464['model'],_0x52c464[_0x422c('0x2e')]);_0x56ac71['attributes']=_[_0x422c('0x30')](_0x52c464[_0x422c('0x2c')],qs['fields'](_0x3281a5[_0x422c('0x2e')][_0x422c('0x31')]));_0x56ac71[_0x422c('0x32')]=_0x56ac71[_0x422c('0x32')][_0x422c('0x33')]?_0x56ac71[_0x422c('0x32')]:_0x52c464[_0x422c('0x2c')];if(_0x3281a5[_0x422c('0x2e')][_0x422c('0x3c')]){_0x56ac71[_0x422c('0x3d')]=[{'all':!![]}];}_0x56ac71=_[_0x422c('0x3b')]({},_0x56ac71,_0x3281a5[_0x422c('0x42')]);return db[_0x422c('0x28')]['find'](_0x56ac71)['then'](handleEntityNotFound(_0xf8b24f,null))['then'](respondWithResult(_0xf8b24f,null))[_0x422c('0x3f')](handleError(_0xf8b24f,null));};exports[_0x422c('0x43')]=function(_0x75b953,_0xbf882d){return db[_0x422c('0x28')][_0x422c('0x43')](_0x75b953[_0x422c('0x44')],{})[_0x422c('0x21')](respondWithResult(_0xbf882d,0xc9))[_0x422c('0x3f')](handleError(_0xbf882d,null));};exports[_0x422c('0x20')]=function(_0x4ea913,_0x472141){if(_0x4ea913['body']['id']){delete _0x4ea913[_0x422c('0x44')]['id'];}return db[_0x422c('0x28')][_0x422c('0x45')]({'where':{'id':_0x4ea913['params']['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x472141,null))['then'](saveUpdates(_0x4ea913[_0x422c('0x44')],null))[_0x422c('0x21')](respondWithResult(_0x472141,null))[_0x422c('0x3f')](handleError(_0x472141,null));};exports[_0x422c('0x46')]=function(_0x2879fd,_0x1f6c71){return db['DeskConfiguration'][_0x422c('0x45')]({'where':{'id':_0x2879fd[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x1f6c71,null))[_0x422c('0x21')](removeEntity(_0x1f6c71,null))['catch'](handleError(_0x1f6c71,null));};exports['getFields']=function(_0x4aeafc,_0x42e87d,_0x22eada){var _0x386d0f={};var _0x654424={};var _0x22a9ec;var _0x568973;return db[_0x422c('0x28')]['findOne']({'where':{'id':_0x4aeafc[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x42e87d,null))[_0x422c('0x21')](function(_0x5b96d8){if(_0x5b96d8){_0x22a9ec=_0x5b96d8;_0x654424[_0x422c('0x2c')]=_[_0x422c('0x2d')](db['DeskField']['rawAttributes']);_0x654424[_0x422c('0x2e')]=_['keys'](_0x4aeafc[_0x422c('0x2e')]);_0x654424[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x654424['model'],_0x654424[_0x422c('0x2e')]);_0x386d0f[_0x422c('0x32')]=_[_0x422c('0x30')](_0x654424[_0x422c('0x2c')],qs[_0x422c('0x31')](_0x4aeafc['query'][_0x422c('0x31')]));_0x386d0f[_0x422c('0x32')]=_0x386d0f['attributes']['length']?_0x386d0f[_0x422c('0x32')]:_0x654424['model'];_0x386d0f[_0x422c('0x36')]=qs[_0x422c('0x37')](_0x4aeafc[_0x422c('0x2e')][_0x422c('0x37')]);_0x386d0f[_0x422c('0x38')]=qs[_0x422c('0x2f')](_['pick'](_0x4aeafc[_0x422c('0x2e')],_0x654424[_0x422c('0x2f')]));if(_0x4aeafc[_0x422c('0x2e')][_0x422c('0x3a')]){_0x386d0f[_0x422c('0x38')]=_['merge'](_0x386d0f[_0x422c('0x38')],{'$or':_['map'](_0x386d0f[_0x422c('0x32')],function(_0x5d917e){var _0x2e9f65={};_0x2e9f65[_0x5d917e]={'$like':'%'+_0x4aeafc[_0x422c('0x2e')][_0x422c('0x3a')]+'%'};return _0x2e9f65;})});}_0x386d0f=_[_0x422c('0x3b')]({},_0x386d0f,_0x4aeafc[_0x422c('0x42')]);return _0x22a9ec[_0x422c('0x47')](_0x386d0f);}})[_0x422c('0x21')](function(_0x2695e8){if(_0x2695e8){_0x568973=_0x2695e8[_0x422c('0x33')];if(!_0x4aeafc[_0x422c('0x2e')][_0x422c('0x34')](_0x422c('0x35'))){_0x386d0f[_0x422c('0x1b')]=qs[_0x422c('0x1b')](_0x4aeafc[_0x422c('0x2e')][_0x422c('0x1b')]);_0x386d0f[_0x422c('0x18')]=qs[_0x422c('0x18')](_0x4aeafc[_0x422c('0x2e')][_0x422c('0x18')]);}return _0x22a9ec[_0x422c('0x47')](_0x386d0f);}})['then'](function(_0x2b70fc){if(_0x2b70fc){return _0x2b70fc?{'count':_0x568973,'rows':_0x2b70fc}:null;}})['then'](respondWithResult(_0x42e87d,null))[_0x422c('0x3f')](handleError(_0x42e87d,null));};exports['getSubjects']=function(_0x438e2b,_0x5833bb,_0x3caeb2){var _0x29bb77={};var _0x52c8a8={};var _0x1265d8;var _0x3362c7;return db[_0x422c('0x28')]['findOne']({'where':{'id':_0x438e2b[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x5833bb,null))['then'](function(_0x45464a){if(_0x45464a){_0x1265d8=_0x45464a;_0x52c8a8[_0x422c('0x2c')]=_[_0x422c('0x2d')](db[_0x422c('0x48')]['rawAttributes']);_0x52c8a8[_0x422c('0x2e')]=_[_0x422c('0x2d')](_0x438e2b[_0x422c('0x2e')]);_0x52c8a8[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x52c8a8[_0x422c('0x2c')],_0x52c8a8[_0x422c('0x2e')]);_0x29bb77[_0x422c('0x32')]=_[_0x422c('0x30')](_0x52c8a8[_0x422c('0x2c')],qs[_0x422c('0x31')](_0x438e2b[_0x422c('0x2e')][_0x422c('0x31')]));_0x29bb77[_0x422c('0x32')]=_0x29bb77[_0x422c('0x32')][_0x422c('0x33')]?_0x29bb77[_0x422c('0x32')]:_0x52c8a8['model'];_0x29bb77[_0x422c('0x36')]=qs['sort'](_0x438e2b[_0x422c('0x2e')][_0x422c('0x37')]);_0x29bb77[_0x422c('0x38')]=qs['filters'](_[_0x422c('0x39')](_0x438e2b[_0x422c('0x2e')],_0x52c8a8[_0x422c('0x2f')]));if(_0x438e2b['query'][_0x422c('0x3a')]){_0x29bb77[_0x422c('0x38')]=_[_0x422c('0x3b')](_0x29bb77[_0x422c('0x38')],{'$or':_[_0x422c('0x27')](_0x29bb77['attributes'],function(_0xae869f){var _0x27cf2f={};_0x27cf2f[_0xae869f]={'$like':'%'+_0x438e2b[_0x422c('0x2e')][_0x422c('0x3a')]+'%'};return _0x27cf2f;})});}_0x29bb77=_[_0x422c('0x3b')]({},_0x29bb77,_0x438e2b[_0x422c('0x42')]);return _0x1265d8[_0x422c('0x49')](_0x29bb77);}})[_0x422c('0x21')](function(_0x2fedd4){if(_0x2fedd4){_0x3362c7=_0x2fedd4[_0x422c('0x33')];if(!_0x438e2b[_0x422c('0x2e')][_0x422c('0x34')](_0x422c('0x35'))){_0x29bb77['limit']=qs[_0x422c('0x1b')](_0x438e2b[_0x422c('0x2e')][_0x422c('0x1b')]);_0x29bb77['offset']=qs['offset'](_0x438e2b[_0x422c('0x2e')]['offset']);}return _0x1265d8['getSubjects'](_0x29bb77);}})[_0x422c('0x21')](function(_0x37b0cd){if(_0x37b0cd){return _0x37b0cd?{'count':_0x3362c7,'rows':_0x37b0cd}:null;}})[_0x422c('0x21')](respondWithResult(_0x5833bb,null))[_0x422c('0x3f')](handleError(_0x5833bb,null));};exports[_0x422c('0x4a')]=function(_0x1f0b27,_0x18520d,_0x142ec6){var _0x75006f={};var _0x25e29f={};var _0x156d05;var _0x225b00;return db[_0x422c('0x28')][_0x422c('0x4b')]({'where':{'id':_0x1f0b27[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x18520d,null))[_0x422c('0x21')](function(_0x52dd49){if(_0x52dd49){_0x156d05=_0x52dd49;_0x25e29f['model']=_[_0x422c('0x2d')](db[_0x422c('0x48')][_0x422c('0x29')]);_0x25e29f[_0x422c('0x2e')]=_[_0x422c('0x2d')](_0x1f0b27[_0x422c('0x2e')]);_0x25e29f[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x25e29f['model'],_0x25e29f[_0x422c('0x2e')]);_0x75006f['attributes']=_[_0x422c('0x30')](_0x25e29f[_0x422c('0x2c')],qs['fields'](_0x1f0b27['query'][_0x422c('0x31')]));_0x75006f[_0x422c('0x32')]=_0x75006f[_0x422c('0x32')][_0x422c('0x33')]?_0x75006f['attributes']:_0x25e29f['model'];_0x75006f['order']=qs[_0x422c('0x37')](_0x1f0b27[_0x422c('0x2e')][_0x422c('0x37')]);_0x75006f[_0x422c('0x38')]=qs['filters'](_[_0x422c('0x39')](_0x1f0b27['query'],_0x25e29f[_0x422c('0x2f')]));if(_0x1f0b27[_0x422c('0x2e')]['filter']){_0x75006f[_0x422c('0x38')]=_[_0x422c('0x3b')](_0x75006f[_0x422c('0x38')],{'$or':_[_0x422c('0x27')](_0x75006f[_0x422c('0x32')],function(_0x27d4f7){var _0x425f4c={};_0x425f4c[_0x27d4f7]={'$like':'%'+_0x1f0b27[_0x422c('0x2e')][_0x422c('0x3a')]+'%'};return _0x425f4c;})});}_0x75006f=_[_0x422c('0x3b')]({},_0x75006f,_0x1f0b27[_0x422c('0x42')]);return _0x156d05['getDescriptions'](_0x75006f);}})[_0x422c('0x21')](function(_0x4bc9e8){if(_0x4bc9e8){_0x225b00=_0x4bc9e8[_0x422c('0x33')];if(!_0x1f0b27[_0x422c('0x2e')][_0x422c('0x34')]('nolimit')){_0x75006f[_0x422c('0x1b')]=qs[_0x422c('0x1b')](_0x1f0b27[_0x422c('0x2e')][_0x422c('0x1b')]);_0x75006f[_0x422c('0x18')]=qs['offset'](_0x1f0b27[_0x422c('0x2e')]['offset']);}return _0x156d05['getDescriptions'](_0x75006f);}})['then'](function(_0x53c27b){if(_0x53c27b){return _0x53c27b?{'count':_0x225b00,'rows':_0x53c27b}:null;}})['then'](respondWithResult(_0x18520d,null))['catch'](handleError(_0x18520d,null));};exports[_0x422c('0x4c')]=function(_0x177fcf,_0x361055,_0x297c5c){var _0x3d459a={};var _0x40a712={};var _0x53124a;var _0x5a9202;return db[_0x422c('0x28')]['findOne']({'where':{'id':_0x177fcf[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x361055,null))['then'](function(_0x443cab){if(_0x443cab){_0x53124a=_0x443cab;_0x40a712[_0x422c('0x2c')]=_['keys'](db[_0x422c('0x4d')][_0x422c('0x29')]);_0x40a712[_0x422c('0x2e')]=_[_0x422c('0x2d')](_0x177fcf[_0x422c('0x2e')]);_0x40a712[_0x422c('0x2f')]=_[_0x422c('0x30')](_0x40a712[_0x422c('0x2c')],_0x40a712['query']);_0x3d459a['attributes']=_[_0x422c('0x30')](_0x40a712[_0x422c('0x2c')],qs['fields'](_0x177fcf[_0x422c('0x2e')][_0x422c('0x31')]));_0x3d459a[_0x422c('0x32')]=_0x3d459a[_0x422c('0x32')][_0x422c('0x33')]?_0x3d459a['attributes']:_0x40a712[_0x422c('0x2c')];_0x3d459a[_0x422c('0x36')]=qs[_0x422c('0x37')](_0x177fcf[_0x422c('0x2e')][_0x422c('0x37')]);_0x3d459a[_0x422c('0x38')]=qs[_0x422c('0x2f')](_[_0x422c('0x39')](_0x177fcf[_0x422c('0x2e')],_0x40a712[_0x422c('0x2f')]));if(_0x177fcf['query'][_0x422c('0x3a')]){_0x3d459a[_0x422c('0x38')]=_['merge'](_0x3d459a[_0x422c('0x38')],{'$or':_[_0x422c('0x27')](_0x3d459a[_0x422c('0x32')],function(_0x5b4cde){var _0x4ed580={};_0x4ed580[_0x5b4cde]={'$like':'%'+_0x177fcf['query']['filter']+'%'};return _0x4ed580;})});}_0x3d459a=_[_0x422c('0x3b')]({},_0x3d459a,_0x177fcf[_0x422c('0x42')]);return _0x53124a[_0x422c('0x4c')](_0x3d459a);}})['then'](function(_0x2dc7c7){if(_0x2dc7c7){_0x5a9202=_0x2dc7c7['length'];if(!_0x177fcf[_0x422c('0x2e')][_0x422c('0x34')](_0x422c('0x35'))){_0x3d459a[_0x422c('0x1b')]=qs['limit'](_0x177fcf[_0x422c('0x2e')][_0x422c('0x1b')]);_0x3d459a[_0x422c('0x18')]=qs[_0x422c('0x18')](_0x177fcf[_0x422c('0x2e')]['offset']);}return _0x53124a['getTags'](_0x3d459a);}})[_0x422c('0x21')](function(_0xf64913){if(_0xf64913){return _0xf64913?{'count':_0x5a9202,'rows':_0xf64913}:null;}})[_0x422c('0x21')](respondWithResult(_0x361055,null))[_0x422c('0x3f')](handleError(_0x361055,null));};exports[_0x422c('0x4e')]=function(_0x1dcfff,_0x607d1,_0x34e85f){if(_0x1dcfff[_0x422c('0x44')]['id']){delete _0x1dcfff[_0x422c('0x44')]['id'];}return db['DeskConfiguration'][_0x422c('0x4b')]({'where':{'id':_0x1dcfff[_0x422c('0x41')]['id']}})[_0x422c('0x21')](handleEntityNotFound(_0x607d1,null))[_0x422c('0x21')](function(_0x4bcdd6){if(_0x4bcdd6){return _0x4bcdd6[_0x422c('0x4e')](_0x1dcfff[_0x422c('0x44')][_0x422c('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x607d1,null))['catch'](handleError(_0x607d1,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index ec55a4e..3434558 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 _0x7ee3=['int_desk_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','DeskConfiguration'];(function(_0x546478,_0x933455){var _0x477363=function(_0x38f6ed){while(--_0x38f6ed){_0x546478['push'](_0x546478['shift']());}};_0x477363(++_0x933455);}(_0x7ee3,0xf3));var _0x37ee=function(_0x1ba862,_0x6f5fe4){_0x1ba862=_0x1ba862-0x0;var _0x1ce09d=_0x7ee3[_0x1ba862];return _0x1ce09d;};'use strict';var _=require('lodash');var util=require(_0x37ee('0x0'));var logger=require(_0x37ee('0x1'))(_0x37ee('0x2'));var moment=require(_0x37ee('0x3'));var BPromise=require(_0x37ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37ee('0x5'));var rimraf=require(_0x37ee('0x6'));var config=require(_0x37ee('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x51f200,_0x5383d4){return _0x51f200[_0x37ee('0x8')](_0x37ee('0x9'),attributes,{'tableName':_0x37ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0d3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x50d325,_0x1873d5){var _0x564346=function(_0x221966){while(--_0x221966){_0x50d325['push'](_0x50d325['shift']());}};_0x564346(++_0x1873d5);}(_0xe0d3,0x1a2));var _0x3e0d=function(_0xf771ff,_0x407adb){_0xf771ff=_0xf771ff-0x0;var _0x18fb76=_0xe0d3[_0xf771ff];return _0x18fb76;};'use strict';var _=require(_0x3e0d('0x0'));var util=require(_0x3e0d('0x1'));var logger=require('../../config/logger')(_0x3e0d('0x2'));var moment=require(_0x3e0d('0x3'));var BPromise=require(_0x3e0d('0x4'));var rp=require(_0x3e0d('0x5'));var fs=require('fs');var path=require(_0x3e0d('0x6'));var rimraf=require(_0x3e0d('0x7'));var config=require(_0x3e0d('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x3e0d('0x9')]=function(_0x354067,_0x3cb914){return _0x354067['define'](_0x3e0d('0xa'),attributes,{'tableName':_0x3e0d('0xb'),'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 e123399..50b6888 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 _0x7ae6=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x7ae6,0x94));var _0x67ae=function(_0x2d59e1,_0x1bd3f2){_0x2d59e1=_0x2d59e1-0x0;var _0x1f6614=_0x7ae6[_0x2d59e1];return _0x1f6614;};'use strict';var _=require('lodash');var util=require(_0x67ae('0x0'));var moment=require('moment');var BPromise=require(_0x67ae('0x1'));var rs=require(_0x67ae('0x2'));var fs=require('fs');var Redis=require(_0x67ae('0x3'));var db=require(_0x67ae('0x4'))['db'];var utils=require(_0x67ae('0x5'));var logger=require(_0x67ae('0x6'))('rpc');var config=require(_0x67ae('0x7'));var jayson=require(_0x67ae('0x8'));var client=jayson[_0x67ae('0x9')][_0x67ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33bc99,_0x51f7f2,_0x456ca9){return new BPromise(function(_0x460304,_0x2591a1){return client[_0x67ae('0xb')](_0x33bc99,_0x456ca9)[_0x67ae('0xc')](function(_0x11c49a){logger[_0x67ae('0xd')](_0x67ae('0xe'),_0x51f7f2,_0x67ae('0xf'));logger[_0x67ae('0x10')](_0x67ae('0x11'),_0x51f7f2,_0x67ae('0xf'),JSON[_0x67ae('0x12')](_0x11c49a));if(_0x11c49a[_0x67ae('0x13')]){if(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x14')]===0x1f4){logger[_0x67ae('0x13')](_0x67ae('0xe'),_0x51f7f2,_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);return _0x2591a1(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);}logger[_0x67ae('0x13')](_0x67ae('0xe'),_0x51f7f2,_0x11c49a['error'][_0x67ae('0x15')]);return _0x460304(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x51f7f2,_0x67ae('0xf'));_0x460304(_0x11c49a['result']['message']);}})[_0x67ae('0x16')](function(_0x2c47f9){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x51f7f2,_0x2c47f9);_0x2591a1(_0x2c47f9);});});} \ No newline at end of file +var _0xdef9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e322c,_0x4c95b3){var _0x358af7=function(_0x3de861){while(--_0x3de861){_0x4e322c['push'](_0x4e322c['shift']());}};_0x358af7(++_0x4c95b3);}(_0xdef9,0x1ed));var _0x9def=function(_0x4f01a9,_0x4a0d3a){_0x4f01a9=_0x4f01a9-0x0;var _0x5f5ade=_0xdef9[_0x4f01a9];return _0x5f5ade;};'use strict';var _=require(_0x9def('0x0'));var util=require(_0x9def('0x1'));var moment=require(_0x9def('0x2'));var BPromise=require(_0x9def('0x3'));var rs=require(_0x9def('0x4'));var fs=require('fs');var Redis=require(_0x9def('0x5'));var db=require(_0x9def('0x6'))['db'];var utils=require(_0x9def('0x7'));var logger=require(_0x9def('0x8'))(_0x9def('0x9'));var config=require(_0x9def('0xa'));var jayson=require(_0x9def('0xb'));var client=jayson[_0x9def('0xc')][_0x9def('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40c607,_0x25a03e,_0x42296c){return new BPromise(function(_0x1efce0,_0x8262f1){return client['request'](_0x40c607,_0x42296c)[_0x9def('0xe')](function(_0x4f0a0d){logger['info'](_0x9def('0xf'),_0x25a03e,_0x9def('0x10'));logger[_0x9def('0x11')](_0x9def('0x12'),_0x25a03e,'request\x20sent',JSON[_0x9def('0x13')](_0x4f0a0d));if(_0x4f0a0d[_0x9def('0x14')]){if(_0x4f0a0d[_0x9def('0x14')][_0x9def('0x15')]===0x1f4){logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')]['message']);return _0x8262f1(_0x4f0a0d[_0x9def('0x14')]['message']);}logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')][_0x9def('0x16')]);return _0x1efce0(_0x4f0a0d['error'][_0x9def('0x16')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x25a03e,_0x9def('0x10'));_0x1efce0(_0x4f0a0d[_0x9def('0x17')][_0x9def('0x16')]);}})[_0x9def('0x18')](function(_0x463520){logger[_0x9def('0x14')](_0x9def('0xf'),_0x25a03e,_0x463520);_0x8262f1(_0x463520);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 598ca4b..db69f25 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 _0x2f56=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x375aad,_0xd6d1de){var _0x2f5483=function(_0x29eb27){while(--_0x29eb27){_0x375aad['push'](_0x375aad['shift']());}};_0x2f5483(++_0xd6d1de);}(_0x2f56,0xcd));var _0x62f5=function(_0x8ac44e,_0x37c2d6){_0x8ac44e=_0x8ac44e-0x0;var _0x6fea15=_0x2f56[_0x8ac44e];return _0x6fea15;};'use strict';var multer=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var path=require(_0x62f5('0x2'));var timeout=require(_0x62f5('0x3'));var express=require(_0x62f5('0x4'));var router=express[_0x62f5('0x5')]();var fs_extra=require(_0x62f5('0x6'));var auth=require(_0x62f5('0x7'));var interaction=require(_0x62f5('0x8'));var config=require(_0x62f5('0x9'));var controller=require(_0x62f5('0xa'));router[_0x62f5('0xb')]('/',auth[_0x62f5('0xc')](),controller[_0x62f5('0xd')]);router[_0x62f5('0xb')](_0x62f5('0xe'),auth['isAuthenticated'](),controller[_0x62f5('0xf')]);router[_0x62f5('0x10')]('/',auth[_0x62f5('0xc')](),controller[_0x62f5('0x11')]);router[_0x62f5('0x12')](_0x62f5('0xe'),auth[_0x62f5('0xc')](),controller[_0x62f5('0x13')]);router[_0x62f5('0x14')](_0x62f5('0xe'),auth[_0x62f5('0xc')](),controller[_0x62f5('0x15')]);module[_0x62f5('0x16')]=router; \ No newline at end of file +var _0x29a1=['isAuthenticated','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x3cb664,_0x3cf322){var _0x4c59f3=function(_0x5d2642){while(--_0x5d2642){_0x3cb664['push'](_0x3cb664['shift']());}};_0x4c59f3(++_0x3cf322);}(_0x29a1,0x98));var _0x129a=function(_0x113f01,_0x3c577d){_0x113f01=_0x113f01-0x0;var _0x4af058=_0x29a1[_0x113f01];return _0x4af058;};'use strict';var multer=require('multer');var util=require(_0x129a('0x0'));var path=require(_0x129a('0x1'));var timeout=require(_0x129a('0x2'));var express=require(_0x129a('0x3'));var router=express[_0x129a('0x4')]();var fs_extra=require(_0x129a('0x5'));var auth=require(_0x129a('0x6'));var interaction=require(_0x129a('0x7'));var config=require('../../config/environment');var controller=require(_0x129a('0x8'));router[_0x129a('0x9')]('/',auth[_0x129a('0xa')](),controller['index']);router[_0x129a('0x9')](_0x129a('0xb'),auth[_0x129a('0xa')](),controller[_0x129a('0xc')]);router['post']('/',auth[_0x129a('0xa')](),controller[_0x129a('0xd')]);router[_0x129a('0xe')](_0x129a('0xb'),auth[_0x129a('0xa')](),controller['update']);router[_0x129a('0xf')](_0x129a('0xb'),auth[_0x129a('0xa')](),controller[_0x129a('0x10')]);module[_0x129a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 31f705a..e5f2a3d 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 _0x41c7=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x41c7,0xf6));var _0x741c=function(_0x36c92f,_0x370f3a){_0x36c92f=_0x36c92f-0x0;var _0x1132f6=_0x41c7[_0x36c92f];return _0x1132f6;};'use strict';var Sequelize=require(_0x741c('0x0'));module[_0x741c('0x1')]={'type':{'type':Sequelize[_0x741c('0x2')]('string',_0x741c('0x3'),_0x741c('0x4'),_0x741c('0x5'),_0x741c('0x6')),'defaultValue':_0x741c('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x741c('0x8')]},'keyType':{'type':Sequelize[_0x741c('0x2')](_0x741c('0x7'),_0x741c('0x3'),_0x741c('0x4'))},'keyContent':{'type':Sequelize[_0x741c('0x8')]},'idField':{'type':Sequelize[_0x741c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x741c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x741c('0x8')]}}; \ No newline at end of file +var _0x40b6=['ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','STRING'];(function(_0x134595,_0x405598){var _0x402769=function(_0x480745){while(--_0x480745){_0x134595['push'](_0x134595['shift']());}};_0x402769(++_0x405598);}(_0x40b6,0x1a0));var _0x640b=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x40b6[_0x3132e8];return _0x43eb8c;};'use strict';var Sequelize=require(_0x640b('0x0'));module[_0x640b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x640b('0x2'),_0x640b('0x3'),_0x640b('0x4'),'picklist'),'defaultValue':_0x640b('0x5')},'content':{'type':Sequelize[_0x640b('0x6')]},'key':{'type':Sequelize[_0x640b('0x6')]},'keyType':{'type':Sequelize[_0x640b('0x7')](_0x640b('0x5'),_0x640b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x640b('0x6')]},'idField':{'type':Sequelize[_0x640b('0x6')]},'nameField':{'type':Sequelize[_0x640b('0x6')]},'customField':{'type':Sequelize[_0x640b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x640b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 252ec63..c0f78fe 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 _0x59ee=['includeAll','include','rows','catch','params','options','find','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','name','send','index','map','DeskField','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59ee,0x1a0));var _0xe59e=function(_0x2effa2,_0x2b6ec1){_0x2effa2=_0x2effa2-0x0;var _0x587fe5=_0x59ee[_0x2effa2];return _0x587fe5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe59e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe59e('0x1'));var rp=require('request-promise');var moment=require(_0xe59e('0x2'));var BPromise=require(_0xe59e('0x3'));var Mustache=require(_0xe59e('0x4'));var util=require(_0xe59e('0x5'));var path=require(_0xe59e('0x6'));var sox=require(_0xe59e('0x7'));var csv=require(_0xe59e('0x8'));var ejs=require(_0xe59e('0x9'));var fs=require('fs');var fs_extra=require(_0xe59e('0xa'));var _=require('lodash');var squel=require(_0xe59e('0xb'));var crypto=require(_0xe59e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe59e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe59e('0xe'));var Redis=require(_0xe59e('0xf'));var authService=require(_0xe59e('0x10'));var qs=require(_0xe59e('0x11'));var as=require(_0xe59e('0x12'));var hardwareService=require(_0xe59e('0x13'));var logger=require(_0xe59e('0x14'))('api');var utils=require(_0xe59e('0x15'));var config=require(_0xe59e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe59e('0x17'))['db'];function respondWithStatusCode(_0x5ba628,_0x104596){_0x104596=_0x104596||0xcc;return function(_0x1c4b3f){if(_0x1c4b3f){return _0x5ba628['sendStatus'](_0x104596);}return _0x5ba628['status'](_0x104596)[_0xe59e('0x18')]();};}function respondWithResult(_0x4c770d,_0x40fde8){_0x40fde8=_0x40fde8||0xc8;return function(_0x1bf77f){if(_0x1bf77f){return _0x4c770d[_0xe59e('0x19')](_0x40fde8)[_0xe59e('0x1a')](_0x1bf77f);}};}function respondWithFilteredResult(_0x23d15a,_0x1e3c28){return function(_0x3f17ff){if(_0x3f17ff){var _0x187288=typeof _0x1e3c28[_0xe59e('0x1b')]===_0xe59e('0x1c')&&typeof _0x1e3c28[_0xe59e('0x1d')]===_0xe59e('0x1c');var _0x5e0b07=_0x3f17ff['count'];var _0x1e2446=_0x187288?0x0:_0x1e3c28[_0xe59e('0x1b')];var _0x2538c2=_0x187288?_0x3f17ff[_0xe59e('0x1e')]:_0x1e3c28[_0xe59e('0x1b')]+_0x1e3c28[_0xe59e('0x1d')];var _0x5e7e65;if(_0x2538c2>=_0x5e0b07){_0x2538c2=_0x5e0b07;_0x5e7e65=0xc8;}else{_0x5e7e65=0xce;}_0x23d15a['status'](_0x5e7e65);return _0x23d15a['set'](_0xe59e('0x1f'),_0x1e2446+'-'+_0x2538c2+'/'+_0x5e0b07)[_0xe59e('0x1a')](_0x3f17ff);}return null;};}function patchUpdates(_0x5d92ec){return function(_0x32a73e){try{jsonpatch[_0xe59e('0x20')](_0x32a73e,_0x5d92ec,!![]);}catch(_0x19d5e3){return BPromise['reject'](_0x19d5e3);}return _0x32a73e[_0xe59e('0x21')]();};}function saveUpdates(_0x5a97ae,_0x2c346a){return function(_0x1e6bbf){if(_0x1e6bbf){return _0x1e6bbf['update'](_0x5a97ae)[_0xe59e('0x22')](function(_0x203b40){return _0x203b40;});}return null;};}function removeEntity(_0x361b94,_0x59fb46){return function(_0x40a158){if(_0x40a158){return _0x40a158[_0xe59e('0x23')]()['then'](function(){_0x361b94[_0xe59e('0x19')](0xcc)[_0xe59e('0x18')]();});}};}function handleEntityNotFound(_0x27ff6d,_0x4fad62){return function(_0x958392){if(!_0x958392){_0x27ff6d['sendStatus'](0x194);}return _0x958392;};}function handleError(_0x47cc95,_0x1a091a){_0x1a091a=_0x1a091a||0x1f4;return function(_0xfe8217){logger['error'](_0xfe8217['stack']);if(_0xfe8217[_0xe59e('0x24')]){delete _0xfe8217[_0xe59e('0x24')];}_0x47cc95[_0xe59e('0x19')](_0x1a091a)[_0xe59e('0x25')](_0xfe8217);};}exports[_0xe59e('0x26')]=function(_0x2d3abf,_0x5d438d){var _0x38c814={},_0x4be7d6={},_0x32c4ac={'count':0x0,'rows':[]};var _0x13a34b=_[_0xe59e('0x27')](db[_0xe59e('0x28')][_0xe59e('0x29')],function(_0x4d936f){return{'name':_0x4d936f['fieldName'],'type':_0x4d936f[_0xe59e('0x2a')][_0xe59e('0x2b')]};});_0x4be7d6[_0xe59e('0x2c')]=_[_0xe59e('0x27')](_0x13a34b,_0xe59e('0x24'));_0x4be7d6['query']=_[_0xe59e('0x2d')](_0x2d3abf[_0xe59e('0x2e')]);_0x4be7d6['filters']=_['intersection'](_0x4be7d6[_0xe59e('0x2c')],_0x4be7d6[_0xe59e('0x2e')]);_0x38c814['attributes']=_[_0xe59e('0x2f')](_0x4be7d6[_0xe59e('0x2c')],qs['fields'](_0x2d3abf[_0xe59e('0x2e')][_0xe59e('0x30')]));_0x38c814['attributes']=_0x38c814[_0xe59e('0x31')][_0xe59e('0x32')]?_0x38c814[_0xe59e('0x31')]:_0x4be7d6[_0xe59e('0x2c')];if(!_0x2d3abf[_0xe59e('0x2e')][_0xe59e('0x33')](_0xe59e('0x34'))){_0x38c814['limit']=qs[_0xe59e('0x1d')](_0x2d3abf[_0xe59e('0x2e')]['limit']);_0x38c814[_0xe59e('0x1b')]=qs[_0xe59e('0x1b')](_0x2d3abf[_0xe59e('0x2e')]['offset']);}_0x38c814[_0xe59e('0x35')]=qs[_0xe59e('0x36')](_0x2d3abf[_0xe59e('0x2e')][_0xe59e('0x36')]);_0x38c814[_0xe59e('0x37')]=qs['filters'](_[_0xe59e('0x38')](_0x2d3abf['query'],_0x4be7d6[_0xe59e('0x39')]),_0x13a34b);if(_0x2d3abf[_0xe59e('0x2e')][_0xe59e('0x3a')]){_0x38c814[_0xe59e('0x37')]=_['merge'](_0x38c814[_0xe59e('0x37')],{'$or':_[_0xe59e('0x27')](_0x13a34b,function(_0x3c1a4f){if(_0x3c1a4f[_0xe59e('0x2a')]!==_0xe59e('0x3b')){var _0x495fa8={};_0x495fa8[_0x3c1a4f[_0xe59e('0x24')]]={'$like':'%'+_0x2d3abf['query'][_0xe59e('0x3a')]+'%'};return _0x495fa8;}})});}_0x38c814=_['merge']({},_0x38c814,_0x2d3abf['options']);var _0x885723={'where':_0x38c814[_0xe59e('0x37')]};return db[_0xe59e('0x28')]['count'](_0x885723)[_0xe59e('0x22')](function(_0x3cca55){_0x32c4ac[_0xe59e('0x1e')]=_0x3cca55;if(_0x2d3abf[_0xe59e('0x2e')][_0xe59e('0x3c')]){_0x38c814[_0xe59e('0x3d')]=[{'all':!![]}];}return db[_0xe59e('0x28')]['findAll'](_0x38c814);})['then'](function(_0x565992){_0x32c4ac[_0xe59e('0x3e')]=_0x565992;return _0x32c4ac;})[_0xe59e('0x22')](respondWithFilteredResult(_0x5d438d,_0x38c814))[_0xe59e('0x3f')](handleError(_0x5d438d,null));};exports['show']=function(_0x75bd34,_0x221747){var _0x1fe594={'raw':!![],'where':{'id':_0x75bd34[_0xe59e('0x40')]['id']}},_0x16ef39={};_0x16ef39['model']=_[_0xe59e('0x2d')](db[_0xe59e('0x28')]['rawAttributes']);_0x16ef39[_0xe59e('0x2e')]=_[_0xe59e('0x2d')](_0x75bd34[_0xe59e('0x2e')]);_0x16ef39[_0xe59e('0x39')]=_[_0xe59e('0x2f')](_0x16ef39[_0xe59e('0x2c')],_0x16ef39[_0xe59e('0x2e')]);_0x1fe594[_0xe59e('0x31')]=_['intersection'](_0x16ef39[_0xe59e('0x2c')],qs[_0xe59e('0x30')](_0x75bd34[_0xe59e('0x2e')][_0xe59e('0x30')]));_0x1fe594[_0xe59e('0x31')]=_0x1fe594[_0xe59e('0x31')][_0xe59e('0x32')]?_0x1fe594[_0xe59e('0x31')]:_0x16ef39['model'];if(_0x75bd34['query'][_0xe59e('0x3c')]){_0x1fe594[_0xe59e('0x3d')]=[{'all':!![]}];}_0x1fe594=_['merge']({},_0x1fe594,_0x75bd34[_0xe59e('0x41')]);return db[_0xe59e('0x28')][_0xe59e('0x42')](_0x1fe594)[_0xe59e('0x22')](handleEntityNotFound(_0x221747,null))[_0xe59e('0x22')](respondWithResult(_0x221747,null))['catch'](handleError(_0x221747,null));};exports['create']=function(_0x52567d,_0x3f2060){return db[_0xe59e('0x28')]['create'](_0x52567d['body'],{})['then'](respondWithResult(_0x3f2060,0xc9))[_0xe59e('0x3f')](handleError(_0x3f2060,null));};exports['update']=function(_0x254741,_0xa8a250){if(_0x254741[_0xe59e('0x43')]['id']){delete _0x254741[_0xe59e('0x43')]['id'];}return db['DeskField'][_0xe59e('0x42')]({'where':{'id':_0x254741[_0xe59e('0x40')]['id']}})['then'](handleEntityNotFound(_0xa8a250,null))[_0xe59e('0x22')](saveUpdates(_0x254741[_0xe59e('0x43')],null))[_0xe59e('0x22')](respondWithResult(_0xa8a250,null))['catch'](handleError(_0xa8a250,null));};exports[_0xe59e('0x23')]=function(_0x1337b1,_0x5e14f1){return db[_0xe59e('0x28')][_0xe59e('0x42')]({'where':{'id':_0x1337b1['params']['id']}})[_0xe59e('0x22')](handleEntityNotFound(_0x5e14f1,null))[_0xe59e('0x22')](removeEntity(_0x5e14f1,null))[_0xe59e('0x3f')](handleError(_0x5e14f1,null));}; \ No newline at end of file +var _0x1488=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','DeskField','count','include','findAll','show','params','keys','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x17b57d,_0x386c51){var _0x30dd8f=function(_0x4e9e8d){while(--_0x4e9e8d){_0x17b57d['push'](_0x17b57d['shift']());}};_0x30dd8f(++_0x386c51);}(_0x1488,0x88));var _0x8148=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x1488[_0x99ff94];return _0x1b5bc0;};'use strict';var emlformat=require(_0x8148('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8148('0x1'));var jsonpatch=require(_0x8148('0x2'));var rp=require(_0x8148('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8148('0x4'));var util=require('util');var path=require(_0x8148('0x5'));var sox=require(_0x8148('0x6'));var csv=require(_0x8148('0x7'));var ejs=require(_0x8148('0x8'));var fs=require('fs');var fs_extra=require(_0x8148('0x9'));var _=require(_0x8148('0xa'));var squel=require(_0x8148('0xb'));var crypto=require(_0x8148('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8148('0xd'));var toCsv=require(_0x8148('0x7'));var querystring=require(_0x8148('0xe'));var Papa=require(_0x8148('0xf'));var Redis=require(_0x8148('0x10'));var authService=require(_0x8148('0x11'));var qs=require(_0x8148('0x12'));var as=require(_0x8148('0x13'));var hardwareService=require(_0x8148('0x14'));var logger=require(_0x8148('0x15'))(_0x8148('0x16'));var utils=require(_0x8148('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8148('0x18'));var db=require(_0x8148('0x19'))['db'];function respondWithStatusCode(_0x14a40a,_0x50d09d){_0x50d09d=_0x50d09d||0xcc;return function(_0x4ca1a4){if(_0x4ca1a4){return _0x14a40a[_0x8148('0x1a')](_0x50d09d);}return _0x14a40a[_0x8148('0x1b')](_0x50d09d)['end']();};}function respondWithResult(_0x1bf571,_0x15478c){_0x15478c=_0x15478c||0xc8;return function(_0x431dcb){if(_0x431dcb){return _0x1bf571[_0x8148('0x1b')](_0x15478c)[_0x8148('0x1c')](_0x431dcb);}};}function respondWithFilteredResult(_0x5b99a2,_0x41c69f){return function(_0x544034){if(_0x544034){var _0x4f9ce4=typeof _0x41c69f[_0x8148('0x1d')]==='undefined'&&typeof _0x41c69f['limit']===_0x8148('0x1e');var _0x4a3135=_0x544034['count'];var _0x48391c=_0x4f9ce4?0x0:_0x41c69f[_0x8148('0x1d')];var _0x58d1b8=_0x4f9ce4?_0x544034['count']:_0x41c69f[_0x8148('0x1d')]+_0x41c69f['limit'];var _0x1e5e6b;if(_0x58d1b8>=_0x4a3135){_0x58d1b8=_0x4a3135;_0x1e5e6b=0xc8;}else{_0x1e5e6b=0xce;}_0x5b99a2['status'](_0x1e5e6b);return _0x5b99a2[_0x8148('0x1f')](_0x8148('0x20'),_0x48391c+'-'+_0x58d1b8+'/'+_0x4a3135)[_0x8148('0x1c')](_0x544034);}return null;};}function patchUpdates(_0x3d1e67){return function(_0x23bff1){try{jsonpatch[_0x8148('0x21')](_0x23bff1,_0x3d1e67,!![]);}catch(_0x3c0113){return BPromise[_0x8148('0x22')](_0x3c0113);}return _0x23bff1[_0x8148('0x23')]();};}function saveUpdates(_0x209079,_0xcb268d){return function(_0x1a2fb6){if(_0x1a2fb6){return _0x1a2fb6[_0x8148('0x24')](_0x209079)[_0x8148('0x25')](function(_0x5b128a){return _0x5b128a;});}return null;};}function removeEntity(_0x243a7a,_0xba5a07){return function(_0x52e0d4){if(_0x52e0d4){return _0x52e0d4['destroy']()[_0x8148('0x25')](function(){_0x243a7a['status'](0xcc)[_0x8148('0x26')]();});}};}function handleEntityNotFound(_0x122dc0,_0x150304){return function(_0x5af4d2){if(!_0x5af4d2){_0x122dc0['sendStatus'](0x194);}return _0x5af4d2;};}function handleError(_0x29b4cc,_0x25c2b9){_0x25c2b9=_0x25c2b9||0x1f4;return function(_0x482d40){logger[_0x8148('0x27')](_0x482d40[_0x8148('0x28')]);if(_0x482d40['name']){delete _0x482d40[_0x8148('0x29')];}_0x29b4cc[_0x8148('0x1b')](_0x25c2b9)[_0x8148('0x2a')](_0x482d40);};}exports['index']=function(_0x37deec,_0x41844e){var _0x4487ba={},_0x3aa8a8={},_0x54ea46={'count':0x0,'rows':[]};var _0x454856=_['map'](db['DeskField'][_0x8148('0x2b')],function(_0x5b3120){return{'name':_0x5b3120[_0x8148('0x2c')],'type':_0x5b3120[_0x8148('0x2d')][_0x8148('0x2e')]};});_0x3aa8a8[_0x8148('0x2f')]=_[_0x8148('0x30')](_0x454856,_0x8148('0x29'));_0x3aa8a8[_0x8148('0x31')]=_['keys'](_0x37deec[_0x8148('0x31')]);_0x3aa8a8[_0x8148('0x32')]=_[_0x8148('0x33')](_0x3aa8a8['model'],_0x3aa8a8[_0x8148('0x31')]);_0x4487ba[_0x8148('0x34')]=_[_0x8148('0x33')](_0x3aa8a8[_0x8148('0x2f')],qs[_0x8148('0x35')](_0x37deec['query'][_0x8148('0x35')]));_0x4487ba[_0x8148('0x34')]=_0x4487ba[_0x8148('0x34')][_0x8148('0x36')]?_0x4487ba[_0x8148('0x34')]:_0x3aa8a8[_0x8148('0x2f')];if(!_0x37deec[_0x8148('0x31')][_0x8148('0x37')](_0x8148('0x38'))){_0x4487ba[_0x8148('0x39')]=qs['limit'](_0x37deec[_0x8148('0x31')][_0x8148('0x39')]);_0x4487ba[_0x8148('0x1d')]=qs[_0x8148('0x1d')](_0x37deec[_0x8148('0x31')][_0x8148('0x1d')]);}_0x4487ba['order']=qs[_0x8148('0x3a')](_0x37deec['query']['sort']);_0x4487ba[_0x8148('0x3b')]=qs[_0x8148('0x32')](_[_0x8148('0x3c')](_0x37deec[_0x8148('0x31')],_0x3aa8a8['filters']),_0x454856);if(_0x37deec[_0x8148('0x31')][_0x8148('0x3d')]){_0x4487ba[_0x8148('0x3b')]=_[_0x8148('0x3e')](_0x4487ba[_0x8148('0x3b')],{'$or':_[_0x8148('0x30')](_0x454856,function(_0x5012b4){if(_0x5012b4[_0x8148('0x2d')]!==_0x8148('0x3f')){var _0x455449={};_0x455449[_0x5012b4[_0x8148('0x29')]]={'$like':'%'+_0x37deec['query']['filter']+'%'};return _0x455449;}})});}_0x4487ba=_[_0x8148('0x3e')]({},_0x4487ba,_0x37deec[_0x8148('0x40')]);var _0x3398ba={'where':_0x4487ba['where']};return db[_0x8148('0x41')][_0x8148('0x42')](_0x3398ba)[_0x8148('0x25')](function(_0x39a901){_0x54ea46['count']=_0x39a901;if(_0x37deec[_0x8148('0x31')]['includeAll']){_0x4487ba[_0x8148('0x43')]=[{'all':!![]}];}return db[_0x8148('0x41')][_0x8148('0x44')](_0x4487ba);})['then'](function(_0xa4ba8e){_0x54ea46['rows']=_0xa4ba8e;return _0x54ea46;})[_0x8148('0x25')](respondWithFilteredResult(_0x41844e,_0x4487ba))['catch'](handleError(_0x41844e,null));};exports[_0x8148('0x45')]=function(_0x931d97,_0x1980ed){var _0x1d75e4={'raw':!![],'where':{'id':_0x931d97[_0x8148('0x46')]['id']}},_0xcd9484={};_0xcd9484[_0x8148('0x2f')]=_[_0x8148('0x47')](db[_0x8148('0x41')][_0x8148('0x2b')]);_0xcd9484[_0x8148('0x31')]=_['keys'](_0x931d97[_0x8148('0x31')]);_0xcd9484[_0x8148('0x32')]=_[_0x8148('0x33')](_0xcd9484['model'],_0xcd9484[_0x8148('0x31')]);_0x1d75e4['attributes']=_['intersection'](_0xcd9484['model'],qs[_0x8148('0x35')](_0x931d97[_0x8148('0x31')]['fields']));_0x1d75e4[_0x8148('0x34')]=_0x1d75e4['attributes']['length']?_0x1d75e4[_0x8148('0x34')]:_0xcd9484[_0x8148('0x2f')];if(_0x931d97['query'][_0x8148('0x48')]){_0x1d75e4[_0x8148('0x43')]=[{'all':!![]}];}_0x1d75e4=_['merge']({},_0x1d75e4,_0x931d97['options']);return db[_0x8148('0x41')][_0x8148('0x49')](_0x1d75e4)[_0x8148('0x25')](handleEntityNotFound(_0x1980ed,null))[_0x8148('0x25')](respondWithResult(_0x1980ed,null))[_0x8148('0x4a')](handleError(_0x1980ed,null));};exports[_0x8148('0x4b')]=function(_0x1421a5,_0x509262){return db[_0x8148('0x41')][_0x8148('0x4b')](_0x1421a5[_0x8148('0x4c')],{})[_0x8148('0x25')](respondWithResult(_0x509262,0xc9))[_0x8148('0x4a')](handleError(_0x509262,null));};exports[_0x8148('0x24')]=function(_0x14c8a9,_0x6c3d22){if(_0x14c8a9[_0x8148('0x4c')]['id']){delete _0x14c8a9['body']['id'];}return db[_0x8148('0x41')][_0x8148('0x49')]({'where':{'id':_0x14c8a9[_0x8148('0x46')]['id']}})[_0x8148('0x25')](handleEntityNotFound(_0x6c3d22,null))['then'](saveUpdates(_0x14c8a9[_0x8148('0x4c')],null))[_0x8148('0x25')](respondWithResult(_0x6c3d22,null))[_0x8148('0x4a')](handleError(_0x6c3d22,null));};exports['destroy']=function(_0x5c4427,_0x365567){return db[_0x8148('0x41')][_0x8148('0x49')]({'where':{'id':_0x5c4427[_0x8148('0x46')]['id']}})['then'](handleEntityNotFound(_0x365567,null))[_0x8148('0x25')](removeEntity(_0x365567,null))[_0x8148('0x4a')](handleError(_0x365567,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c3dba77..ad6b4e8 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 _0xbb19=['path','rimraf','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','moment','bluebird','request-promise'];(function(_0x3f2c2e,_0xf9e8c3){var _0x302fb4=function(_0x3ad4ff){while(--_0x3ad4ff){_0x3f2c2e['push'](_0x3f2c2e['shift']());}};_0x302fb4(++_0xf9e8c3);}(_0xbb19,0x8c));var _0x9bb1=function(_0x56badd,_0x2b24b5){_0x56badd=_0x56badd-0x0;var _0x3313c7=_0xbb19[_0x56badd];return _0x3313c7;};'use strict';var _=require(_0x9bb1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9bb1('0x1'));var BPromise=require(_0x9bb1('0x2'));var rp=require(_0x9bb1('0x3'));var fs=require('fs');var path=require(_0x9bb1('0x4'));var rimraf=require(_0x9bb1('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x9bb1('0x6')]=function(_0x27e067,_0x30eb5a){return _0x27e067[_0x9bb1('0x7')](_0x9bb1('0x8'),attributes,{'tableName':_0x9bb1('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x9bb1('0xa'),_0x9bb1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x180a=['../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x2a1185,_0x2740c5){var _0x5588d9=function(_0x16024c){while(--_0x16024c){_0x2a1185['push'](_0x2a1185['shift']());}};_0x5588d9(++_0x2740c5);}(_0x180a,0xad));var _0xa180=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x180a[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xa180('0x0'));var util=require(_0xa180('0x1'));var logger=require(_0xa180('0x2'))('api');var moment=require(_0xa180('0x3'));var BPromise=require(_0xa180('0x4'));var rp=require(_0xa180('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa180('0x6'));var config=require(_0xa180('0x7'));var attributes=require(_0xa180('0x8'));module['exports']=function(_0x54eba6,_0x23e3ec){return _0x54eba6[_0xa180('0x9')](_0xa180('0xa'),attributes,{'tableName':_0xa180('0xb'),'paranoid':![],'indexes':[{'name':_0xa180('0xc'),'fields':[_0xa180('0xd'),_0xa180('0xe')],'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 9ffdf58..0d38ceb 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 _0x2d4e=['error','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b1cb9,_0x909374){var _0x205fa3=function(_0x491823){while(--_0x491823){_0x5b1cb9['push'](_0x5b1cb9['shift']());}};_0x205fa3(++_0x909374);}(_0x2d4e,0x143));var _0xe2d4=function(_0x25bc96,_0x27e9c5){_0x25bc96=_0x25bc96-0x0;var _0x3c0302=_0x2d4e[_0x25bc96];return _0x3c0302;};'use strict';var _=require(_0xe2d4('0x0'));var util=require(_0xe2d4('0x1'));var moment=require(_0xe2d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe2d4('0x4'));var logger=require(_0xe2d4('0x5'))(_0xe2d4('0x6'));var config=require(_0xe2d4('0x7'));var jayson=require(_0xe2d4('0x8'));var client=jayson[_0xe2d4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x439d16,_0x2065cc,_0x1ae860){return new BPromise(function(_0x39abfb,_0x32cb75){return client[_0xe2d4('0xa')](_0x439d16,_0x1ae860)[_0xe2d4('0xb')](function(_0xae521){logger[_0xe2d4('0xc')](_0xe2d4('0xd'),_0x2065cc,_0xe2d4('0xe'));logger['debug'](_0xe2d4('0xf'),_0x2065cc,_0xe2d4('0xe'),JSON[_0xe2d4('0x10')](_0xae521));if(_0xae521['error']){if(_0xae521[_0xe2d4('0x11')]['code']===0x1f4){logger['error'](_0xe2d4('0xd'),_0x2065cc,_0xae521[_0xe2d4('0x11')][_0xe2d4('0x12')]);return _0x32cb75(_0xae521['error']['message']);}logger[_0xe2d4('0x11')](_0xe2d4('0xd'),_0x2065cc,_0xae521['error'][_0xe2d4('0x12')]);return _0x39abfb(_0xae521[_0xe2d4('0x11')][_0xe2d4('0x12')]);}else{logger['info'](_0xe2d4('0xd'),_0x2065cc,_0xe2d4('0xe'));_0x39abfb(_0xae521[_0xe2d4('0x13')]['message']);}})['catch'](function(_0x25d05a){logger[_0xe2d4('0x11')](_0xe2d4('0xd'),_0x2065cc,_0x25d05a);_0x32cb75(_0x25d05a);});});} \ No newline at end of file +var _0x334b=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch'];(function(_0x493ca0,_0x36e43e){var _0x304979=function(_0x15a8e1){while(--_0x15a8e1){_0x493ca0['push'](_0x493ca0['shift']());}};_0x304979(++_0x36e43e);}(_0x334b,0x9a));var _0xb334=function(_0x2e0687,_0x572217){_0x2e0687=_0x2e0687-0x0;var _0x411aaf=_0x334b[_0x2e0687];return _0x411aaf;};'use strict';var _=require(_0xb334('0x0'));var util=require(_0xb334('0x1'));var moment=require('moment');var BPromise=require(_0xb334('0x2'));var rs=require(_0xb334('0x3'));var fs=require('fs');var Redis=require(_0xb334('0x4'));var db=require(_0xb334('0x5'))['db'];var utils=require(_0xb334('0x6'));var logger=require(_0xb334('0x7'))(_0xb334('0x8'));var config=require(_0xb334('0x9'));var jayson=require(_0xb334('0xa'));var client=jayson[_0xb334('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x315347,_0x50b53f,_0x440d1a){return new BPromise(function(_0x29221e,_0x172375){return client[_0xb334('0xc')](_0x315347,_0x440d1a)['then'](function(_0x51785b){logger[_0xb334('0xd')]('DeskField,\x20%s,\x20%s',_0x50b53f,_0xb334('0xe'));logger[_0xb334('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x50b53f,'request\x20sent',JSON[_0xb334('0x10')](_0x51785b));if(_0x51785b['error']){if(_0x51785b['error']['code']===0x1f4){logger[_0xb334('0x11')](_0xb334('0x12'),_0x50b53f,_0x51785b[_0xb334('0x11')][_0xb334('0x13')]);return _0x172375(_0x51785b[_0xb334('0x11')]['message']);}logger[_0xb334('0x11')](_0xb334('0x12'),_0x50b53f,_0x51785b['error'][_0xb334('0x13')]);return _0x29221e(_0x51785b['error'][_0xb334('0x13')]);}else{logger[_0xb334('0xd')](_0xb334('0x12'),_0x50b53f,_0xb334('0xe'));_0x29221e(_0x51785b[_0xb334('0x14')][_0xb334('0x13')]);}})[_0xb334('0x15')](function(_0x7ab7f4){logger[_0xb334('0x11')](_0xb334('0x12'),_0x50b53f,_0x7ab7f4);_0x172375(_0x7ab7f4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 683871e..6dc7678 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 _0x16a5=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','create','post','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1469a5,_0x212533){var _0x2745a9=function(_0x4ed41a){while(--_0x4ed41a){_0x1469a5['push'](_0x1469a5['shift']());}};_0x2745a9(++_0x212533);}(_0x16a5,0x197));var _0x516a=function(_0x343b56,_0x27ebbf){_0x343b56=_0x343b56-0x0;var _0x4bdc57=_0x16a5[_0x343b56];return _0x4bdc57;};'use strict';var multer=require(_0x516a('0x0'));var util=require(_0x516a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x516a('0x2'));var router=express[_0x516a('0x3')]();var fs_extra=require(_0x516a('0x4'));var auth=require(_0x516a('0x5'));var interaction=require(_0x516a('0x6'));var config=require(_0x516a('0x7'));var controller=require(_0x516a('0x8'));router[_0x516a('0x9')]('/',auth[_0x516a('0xa')](),controller[_0x516a('0xb')]);router['get'](_0x516a('0xc'),auth[_0x516a('0xa')](),controller[_0x516a('0xd')]);router[_0x516a('0x9')](_0x516a('0xe'),auth[_0x516a('0xa')](),controller[_0x516a('0xf')]);router[_0x516a('0x9')]('/:id/fields',auth[_0x516a('0xa')](),controller['getFields']);router['post']('/',auth[_0x516a('0xa')](),controller[_0x516a('0x10')]);router[_0x516a('0x11')](_0x516a('0xe'),auth[_0x516a('0xa')](),controller['addConfiguration']);router[_0x516a('0x12')]('/:id',auth[_0x516a('0xa')](),controller[_0x516a('0x13')]);router[_0x516a('0x14')](_0x516a('0xc'),auth[_0x516a('0xa')](),controller[_0x516a('0x15')]);module[_0x516a('0x16')]=router; \ No newline at end of file +var _0x9270=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','/:id','update','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9270,0xb0));var _0x0927=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x9270[_0xc77819];return _0x1c9434;};'use strict';var multer=require('multer');var util=require(_0x0927('0x0'));var path=require(_0x0927('0x1'));var timeout=require('connect-timeout');var express=require(_0x0927('0x2'));var router=express[_0x0927('0x3')]();var fs_extra=require(_0x0927('0x4'));var auth=require(_0x0927('0x5'));var interaction=require(_0x0927('0x6'));var config=require(_0x0927('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x0927('0x8')]('/',auth[_0x0927('0x9')](),controller[_0x0927('0xa')]);router[_0x0927('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0927('0x8')]('/:id/configurations',auth[_0x0927('0x9')](),controller[_0x0927('0xb')]);router[_0x0927('0x8')](_0x0927('0xc'),auth[_0x0927('0x9')](),controller[_0x0927('0xd')]);router[_0x0927('0xe')]('/',auth[_0x0927('0x9')](),controller['create']);router[_0x0927('0xe')](_0x0927('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x0927('0x10')](_0x0927('0x11'),auth['isAuthenticated'](),controller[_0x0927('0x12')]);router[_0x0927('0x13')]('/:id',auth[_0x0927('0x9')](),controller[_0x0927('0x14')]);module[_0x0927('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c882dc3..72bd3e8 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 _0xba44=['sequelize','exports','STRING'];(function(_0x542c11,_0x35d5df){var _0xd5ba30=function(_0x352bff){while(--_0x352bff){_0x542c11['push'](_0x542c11['shift']());}};_0xd5ba30(++_0x35d5df);}(_0xba44,0xea));var _0x4ba4=function(_0x346400,_0x4d2bd9){_0x346400=_0x346400-0x0;var _0x178730=_0xba44[_0x346400];return _0x178730;};'use strict';var Sequelize=require(_0x4ba4('0x0'));module[_0x4ba4('0x1')]={'name':{'type':Sequelize[_0x4ba4('0x2')]},'username':{'type':Sequelize[_0x4ba4('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4ba4('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4ba4('0x2')]},'clientSecret':{'type':Sequelize[_0x4ba4('0x2')]},'serverUrl':{'type':Sequelize[_0x4ba4('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2957=['STRING'];(function(_0x4f5a2d,_0x3c2eb4){var _0x46ca10=function(_0x317902){while(--_0x317902){_0x4f5a2d['push'](_0x4f5a2d['shift']());}};_0x46ca10(++_0x3c2eb4);}(_0x2957,0x112));var _0x7295=function(_0x3b368f,_0x2cb716){_0x3b368f=_0x3b368f-0x0;var _0x414e2a=_0x2957[_0x3b368f];return _0x414e2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7295('0x0')]},'username':{'type':Sequelize[_0x7295('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7295('0x0')]},'tenantId':{'type':Sequelize[_0x7295('0x0')]},'clientId':{'type':Sequelize[_0x7295('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7295('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index ec69d50..afa2a5b 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 _0x92f0=['responseby','responsiblecontactidname','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','send','test',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','keys','filters','intersection','query','model','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','followupby','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x92f0,0x10d));var _0x092f=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x92f0[_0x34d346];return _0x122d76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x092f('0x0'));var zipdir=require(_0x092f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x092f('0x2'));var moment=require(_0x092f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x092f('0x4'));var path=require(_0x092f('0x5'));var sox=require(_0x092f('0x6'));var csv=require(_0x092f('0x7'));var ejs=require(_0x092f('0x8'));var fs=require('fs');var fs_extra=require(_0x092f('0x9'));var _=require('lodash');var squel=require(_0x092f('0xa'));var crypto=require('crypto');var jsforce=require(_0x092f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x092f('0x7'));var querystring=require('querystring');var Papa=require(_0x092f('0xc'));var Redis=require('ioredis');var authService=require(_0x092f('0xd'));var qs=require(_0x092f('0xe'));var as=require(_0x092f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x092f('0x10'))(_0x092f('0x11'));var utils=require(_0x092f('0x12'));var config=require(_0x092f('0x13'));var licenseUtil=require(_0x092f('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x092f('0x15'));function respondWithStatusCode(_0x3e9305,_0x5c6d22){_0x5c6d22=_0x5c6d22||0xcc;return function(_0x1f395e){if(_0x1f395e){return _0x3e9305[_0x092f('0x16')](_0x5c6d22);}return _0x3e9305[_0x092f('0x17')](_0x5c6d22)[_0x092f('0x18')]();};}function respondWithResult(_0x954956,_0x3b1f34){_0x3b1f34=_0x3b1f34||0xc8;return function(_0x1984df){if(_0x1984df){return _0x954956[_0x092f('0x17')](_0x3b1f34)['json'](_0x1984df);}};}function respondWithFilteredResult(_0x352456,_0x346c68){return function(_0x33b0c0){if(_0x33b0c0){var _0x212e99=typeof _0x346c68['offset']==='undefined'&&typeof _0x346c68[_0x092f('0x19')]===_0x092f('0x1a');var _0x36da9b=_0x33b0c0[_0x092f('0x1b')];var _0x1711e2=_0x212e99?0x0:_0x346c68['offset'];var _0x4e97d4=_0x212e99?_0x33b0c0[_0x092f('0x1b')]:_0x346c68[_0x092f('0x1c')]+_0x346c68[_0x092f('0x19')];var _0x25a208;if(_0x4e97d4>=_0x36da9b){_0x4e97d4=_0x36da9b;_0x25a208=0xc8;}else{_0x25a208=0xce;}_0x352456[_0x092f('0x17')](_0x25a208);return _0x352456['set'](_0x092f('0x1d'),_0x1711e2+'-'+_0x4e97d4+'/'+_0x36da9b)['json'](_0x33b0c0);}return null;};}function patchUpdates(_0x5e600a){return function(_0x4cb5da){try{jsonpatch[_0x092f('0x1e')](_0x4cb5da,_0x5e600a,!![]);}catch(_0x5e88ce){return BPromise['reject'](_0x5e88ce);}return _0x4cb5da[_0x092f('0x1f')]();};}function saveUpdates(_0x2cbf68,_0xcd0039){return function(_0x5dd225){if(_0x5dd225){return _0x5dd225[_0x092f('0x20')](_0x2cbf68)['then'](function(_0x2757c3){return _0x2757c3;});}return null;};}function removeEntity(_0x1528c0,_0x9efe68){return function(_0x30b2c4){if(_0x30b2c4){return _0x30b2c4[_0x092f('0x21')]()[_0x092f('0x22')](function(){_0x1528c0[_0x092f('0x17')](0xcc)[_0x092f('0x18')]();});}};}function handleEntityNotFound(_0xb52de5,_0x3a3622){return function(_0x27004c){if(!_0x27004c){_0xb52de5[_0x092f('0x16')](0x194);}return _0x27004c;};}function handleError(_0x29ac64,_0x1212f4){_0x1212f4=_0x1212f4||0x1f4;return function(_0x505dbf){logger[_0x092f('0x23')](_0x505dbf[_0x092f('0x24')]);if(_0x505dbf['name']){delete _0x505dbf[_0x092f('0x25')];}_0x29ac64['status'](_0x1212f4)['send'](_0x505dbf);};}exports[_0x092f('0x26')]=function(_0x282d53,_0x32bc9f){var _0x41a3b4={},_0x4c9cd0={},_0x301f10={'count':0x0,'rows':[]};var _0x55f71b=_[_0x092f('0x27')](db[_0x092f('0x28')][_0x092f('0x29')],function(_0x2eeb50){return{'name':_0x2eeb50[_0x092f('0x2a')],'type':_0x2eeb50[_0x092f('0x2b')]['key']};});_0x4c9cd0['model']=_['map'](_0x55f71b,_0x092f('0x25'));_0x4c9cd0['query']=_[_0x092f('0x2c')](_0x282d53['query']);_0x4c9cd0[_0x092f('0x2d')]=_[_0x092f('0x2e')](_0x4c9cd0['model'],_0x4c9cd0[_0x092f('0x2f')]);_0x41a3b4['attributes']=_[_0x092f('0x2e')](_0x4c9cd0[_0x092f('0x30')],qs[_0x092f('0x31')](_0x282d53[_0x092f('0x2f')][_0x092f('0x31')]));_0x41a3b4[_0x092f('0x32')]=_0x41a3b4['attributes'][_0x092f('0x33')]?_0x41a3b4[_0x092f('0x32')]:_0x4c9cd0[_0x092f('0x30')];if(!_0x282d53[_0x092f('0x2f')]['hasOwnProperty'](_0x092f('0x34'))){_0x41a3b4[_0x092f('0x19')]=qs[_0x092f('0x19')](_0x282d53['query'][_0x092f('0x19')]);_0x41a3b4[_0x092f('0x1c')]=qs[_0x092f('0x1c')](_0x282d53[_0x092f('0x2f')][_0x092f('0x1c')]);}_0x41a3b4[_0x092f('0x35')]=qs[_0x092f('0x36')](_0x282d53[_0x092f('0x2f')]['sort']);_0x41a3b4['where']=qs[_0x092f('0x2d')](_['pick'](_0x282d53[_0x092f('0x2f')],_0x4c9cd0[_0x092f('0x2d')]),_0x55f71b);if(_0x282d53[_0x092f('0x2f')][_0x092f('0x37')]){_0x41a3b4[_0x092f('0x38')]=_[_0x092f('0x39')](_0x41a3b4['where'],{'$or':_[_0x092f('0x27')](_0x55f71b,function(_0x172d76){if(_0x172d76[_0x092f('0x2b')]!==_0x092f('0x3a')){var _0x2e51b5={};_0x2e51b5[_0x172d76[_0x092f('0x25')]]={'$like':'%'+_0x282d53[_0x092f('0x2f')][_0x092f('0x37')]+'%'};return _0x2e51b5;}})});}_0x41a3b4=_[_0x092f('0x39')]({},_0x41a3b4,_0x282d53[_0x092f('0x3b')]);var _0x4c46c3={'where':_0x41a3b4[_0x092f('0x38')]};return db['Dynamics365Account']['count'](_0x4c46c3)['then'](function(_0x32036d){_0x301f10[_0x092f('0x1b')]=_0x32036d;if(_0x282d53[_0x092f('0x2f')][_0x092f('0x3c')]){_0x41a3b4[_0x092f('0x3d')]=[{'all':!![]}];}return db[_0x092f('0x28')][_0x092f('0x3e')](_0x41a3b4);})['then'](function(_0x5a4362){_0x301f10[_0x092f('0x3f')]=_0x5a4362;return _0x301f10;})['then'](respondWithFilteredResult(_0x32bc9f,_0x41a3b4))[_0x092f('0x40')](handleError(_0x32bc9f,null));};exports[_0x092f('0x41')]=function(_0x4823e6,_0x33ac97){var _0x1e8f5c={'raw':![],'where':{'id':_0x4823e6[_0x092f('0x42')]['id']}},_0x3255fc={};_0x3255fc[_0x092f('0x30')]=_[_0x092f('0x2c')](db[_0x092f('0x28')][_0x092f('0x29')]);_0x3255fc['query']=_[_0x092f('0x2c')](_0x4823e6[_0x092f('0x2f')]);_0x3255fc[_0x092f('0x2d')]=_[_0x092f('0x2e')](_0x3255fc[_0x092f('0x30')],_0x3255fc[_0x092f('0x2f')]);_0x1e8f5c['attributes']=_[_0x092f('0x2e')](_0x3255fc['model'],qs[_0x092f('0x31')](_0x4823e6[_0x092f('0x2f')][_0x092f('0x31')]));_0x1e8f5c[_0x092f('0x32')]=_0x1e8f5c[_0x092f('0x32')]['length']?_0x1e8f5c[_0x092f('0x32')]:_0x3255fc['model'];if(_0x4823e6[_0x092f('0x2f')][_0x092f('0x3c')]){_0x1e8f5c[_0x092f('0x3d')]=[{'all':!![]}];}_0x1e8f5c=_[_0x092f('0x39')]({},_0x1e8f5c,_0x4823e6['options']);return db['Dynamics365Account'][_0x092f('0x43')](_0x1e8f5c)['then'](handleEntityNotFound(_0x33ac97,null))[_0x092f('0x22')](respondWithResult(_0x33ac97,null))[_0x092f('0x40')](handleError(_0x33ac97,null));};exports['create']=function(_0x285eb3,_0x6b9cb6){return db[_0x092f('0x28')][_0x092f('0x44')](_0x285eb3[_0x092f('0x45')],{})[_0x092f('0x22')](respondWithResult(_0x6b9cb6,0xc9))['catch'](handleError(_0x6b9cb6,null));};exports[_0x092f('0x20')]=function(_0xaf3701,_0x3c6118){if(_0xaf3701[_0x092f('0x45')]['id']){delete _0xaf3701[_0x092f('0x45')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0xaf3701[_0x092f('0x42')]['id']}})[_0x092f('0x22')](handleEntityNotFound(_0x3c6118,null))[_0x092f('0x22')](saveUpdates(_0xaf3701['body'],null))[_0x092f('0x22')](respondWithResult(_0x3c6118,null))[_0x092f('0x40')](handleError(_0x3c6118,null));};exports[_0x092f('0x21')]=function(_0x2df933,_0x13f3c4){return db[_0x092f('0x28')][_0x092f('0x43')]({'where':{'id':_0x2df933['params']['id']}})[_0x092f('0x22')](handleEntityNotFound(_0x13f3c4,null))[_0x092f('0x22')](removeEntity(_0x13f3c4,null))[_0x092f('0x40')](handleError(_0x13f3c4,null));};exports[_0x092f('0x46')]=function(_0x11a690,_0x22b201,_0x2144dd){var _0x506694={};var _0xece0bc={};var _0x36a0f0;var _0x18f1d;return db[_0x092f('0x28')]['findOne']({'where':{'id':_0x11a690[_0x092f('0x42')]['id']}})[_0x092f('0x22')](handleEntityNotFound(_0x22b201,null))['then'](function(_0xf44cf8){if(_0xf44cf8){_0x36a0f0=_0xf44cf8;_0xece0bc['model']=_[_0x092f('0x2c')](db[_0x092f('0x47')][_0x092f('0x29')]);_0xece0bc['query']=_['keys'](_0x11a690[_0x092f('0x2f')]);_0xece0bc[_0x092f('0x2d')]=_[_0x092f('0x2e')](_0xece0bc[_0x092f('0x30')],_0xece0bc[_0x092f('0x2f')]);_0x506694[_0x092f('0x32')]=_['intersection'](_0xece0bc[_0x092f('0x30')],qs[_0x092f('0x31')](_0x11a690[_0x092f('0x2f')]['fields']));_0x506694['attributes']=_0x506694[_0x092f('0x32')]['length']?_0x506694[_0x092f('0x32')]:_0xece0bc[_0x092f('0x30')];_0x506694[_0x092f('0x35')]=qs[_0x092f('0x36')](_0x11a690[_0x092f('0x2f')][_0x092f('0x36')]);_0x506694['where']=qs[_0x092f('0x2d')](_[_0x092f('0x48')](_0x11a690[_0x092f('0x2f')],_0xece0bc['filters']));if(_0x11a690[_0x092f('0x2f')]['filter']){_0x506694['where']=_['merge'](_0x506694[_0x092f('0x38')],{'$or':_[_0x092f('0x27')](_0x506694[_0x092f('0x32')],function(_0x14931b){var _0x3c6861={};_0x3c6861[_0x14931b]={'$like':'%'+_0x11a690[_0x092f('0x2f')][_0x092f('0x37')]+'%'};return _0x3c6861;})});}_0x506694=_[_0x092f('0x39')]({},_0x506694,_0x11a690['options']);return _0x36a0f0[_0x092f('0x46')](_0x506694);}})[_0x092f('0x22')](function(_0x2149b9){if(_0x2149b9){_0x18f1d=_0x2149b9[_0x092f('0x33')];if(!_0x11a690['query'][_0x092f('0x49')](_0x092f('0x34'))){_0x506694[_0x092f('0x19')]=qs[_0x092f('0x19')](_0x11a690[_0x092f('0x2f')]['limit']);_0x506694[_0x092f('0x1c')]=qs[_0x092f('0x1c')](_0x11a690[_0x092f('0x2f')][_0x092f('0x1c')]);}return _0x36a0f0[_0x092f('0x46')](_0x506694);}})[_0x092f('0x22')](function(_0x4aef4d){if(_0x4aef4d){return _0x4aef4d?{'count':_0x18f1d,'rows':_0x4aef4d}:null;}})[_0x092f('0x22')](respondWithResult(_0x22b201,null))[_0x092f('0x40')](handleError(_0x22b201,null));};exports[_0x092f('0x4a')]=function(_0x371b6c,_0x5053db,_0x24d511){if(_0x371b6c[_0x092f('0x45')]['id']){delete _0x371b6c[_0x092f('0x45')]['id'];}return db[_0x092f('0x28')][_0x092f('0x4b')]({'where':{'id':_0x371b6c[_0x092f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5053db,null))[_0x092f('0x22')](function(_0x521f83){if(_0x521f83){_0x371b6c[_0x092f('0x45')][_0x092f('0x4c')]=_0x521f83['id'];_0x371b6c['body'][_0x092f('0x4d')]=integrations['getSubjects'](_0x371b6c[_0x092f('0x45')][_0x092f('0x4e')],_0x371b6c[_0x092f('0x45')][_0x092f('0x2b')]);_0x371b6c[_0x092f('0x45')][_0x092f('0x4f')]=integrations[_0x092f('0x50')](_0x371b6c[_0x092f('0x45')]['channel'],_0x371b6c[_0x092f('0x45')][_0x092f('0x2b')]);return db[_0x092f('0x47')][_0x092f('0x44')](_0x371b6c['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x092f('0x4d')},{'model':db[_0x092f('0x51')],'as':_0x092f('0x4f')}]});}return null;})[_0x092f('0x22')](respondWithResult(_0x5053db,null))[_0x092f('0x40')](handleError(_0x5053db,null));};exports[_0x092f('0x52')]=function(_0x2f4983,_0x59ca53,_0x2cf40e){var _0x431ded=_0x2f4983[_0x092f('0x2f')][_0x092f('0x53')];var _0x2fcc35=_0x431ded===_0x092f('0x54')?'Incident':_0x092f('0x55');var _0x54fb52='';var _0x39f551='';var _0x1dfe53='';var _0x501c52='';var _0x1a05e5='';var _0x413a27='';var _0x1e4258='';var _0xfa61c='';var _0x588e54=['title',_0x092f('0x56'),_0x092f('0x57'),_0x092f('0x58'),'caseorigincode',_0x092f('0x59'),_0x092f('0x5a'),_0x092f('0x5b'),_0x092f('0x5c'),_0x092f('0x5d')];var _0x36f7db=[_0x092f('0x5e'),_0x092f('0x5f'),'actualserviceunits',_0x092f('0x60'),_0x092f('0x61'),_0x092f('0x62'),_0x092f('0x63'),_0x092f('0x64'),_0x092f('0x65'),'createdbyexternalpartyyominame',_0x092f('0x66'),_0x092f('0x67'),_0x092f('0x68'),'createdonbehalfbyname',_0x092f('0x69'),'customeridname',_0x092f('0x6a'),_0x092f('0x6b'),_0x092f('0x6c'),'entitlementidname',_0x092f('0x6d'),_0x092f('0x6e'),'escalatedon',_0x092f('0x6f'),'firstresponsebykpiidname',_0x092f('0x70'),'importsequencenumber',_0x092f('0x71'),'kbarticleidname','lastonholdtime',_0x092f('0x72'),_0x092f('0x73'),'modifiedbyexternalpartyyominame',_0x092f('0x74'),_0x092f('0x75'),_0x092f('0x76'),_0x092f('0x77'),'modifiedonbehalfbyyominame',_0x092f('0x78'),_0x092f('0x79'),_0x092f('0x7a'),'onholdtime','overriddencreatedon',_0x092f('0x7b'),_0x092f('0x7c'),'owneridyominame',_0x092f('0x7d'),_0x092f('0x7e'),_0x092f('0x7f'),_0x092f('0x80'),_0x092f('0x81'),_0x092f('0x82'),_0x092f('0x83'),_0x092f('0x84'),_0x092f('0x85'),_0x092f('0x86'),'responsiblecontactidyominame','sentimentvalue',_0x092f('0x87'),_0x092f('0x88'),'socialprofileidname',_0x092f('0x89'),_0x092f('0x8a'),_0x092f('0x8b'),_0x092f('0x8c'),_0x092f('0x8d'),_0x092f('0x8e'),_0x092f('0x8f'),_0x092f('0x90'),_0x092f('0x91')];var _0x395398=_0x588e54[_0x092f('0x92')](_0x36f7db);return db[_0x092f('0x28')][_0x092f('0x4b')]({'where':{'id':_0x2f4983[_0x092f('0x42')]['id']},'attributes':['id',_0x092f('0x93'),_0x092f('0x94'),_0x092f('0x95'),_0x092f('0x96'),'clientId',_0x092f('0x97')]})[_0x092f('0x22')](handleEntityNotFound(_0x59ca53,null))['then'](function(_0x3c0f73){if(_0x3c0f73){_0xfa61c=_0x3c0f73['remoteUri'];var _0x25705b=_0xfa61c[_0x092f('0x98')](-0x1);if(_0x25705b==='/'){_0xfa61c=_0xfa61c[_0x092f('0x99')](0x0,_0xfa61c['lastIndexOf'](_0x25705b));}_0x1e4258=util[_0x092f('0x9a')](_0x092f('0x9b'),_0xfa61c);var _0xb2f768={'method':_0x092f('0x9c'),'uri':_0x092f('0x9d')+_0x3c0f73[_0x092f('0x96')]+_0x092f('0x9e'),'form':{'client_id':_0x3c0f73['clientId'],'resource':_0xfa61c,'username':_0x3c0f73['username'],'password':_0x3c0f73[_0x092f('0x94')],'grant_type':_0x092f('0x94'),'client_secret':_0x3c0f73[_0x092f('0x97')]},'json':!![]};return rp(_0xb2f768);}})[_0x092f('0x22')](function(_0x15b3e0){_0x413a27=_0x15b3e0['access_token'];var _0x2197ff={'method':'GET','uri':encodeURI(_0x1e4258+_0x092f('0x9f')+_0x2fcc35+'\x27'),'headers':{'Authorization':_0x092f('0xa0')+_0x413a27,'If-None-Match':null,'OData-Version':_0x092f('0xa1')},'json':!![]};return rp(_0x2197ff);})['then'](function(_0x1d3ddb){var _0x5d3566=_0x1d3ddb[_0x092f('0xa2')][0x0];var _0xbc3717=_0x5d3566[_0x092f('0xa3')];var _0x239da6={'method':_0x092f('0xa4'),'uri':_0x1e4258+_0x092f('0xa5')+_0xbc3717+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x092f('0xa0')+_0x413a27,'If-None-Match':null,'OData-Version':_0x092f('0xa1')},'json':!![]};return rp(_0x239da6);})[_0x092f('0x22')](function(_0x25d20f){_0x54fb52=_0x25d20f;_0x39f551=_0x54fb52[_0x092f('0xa6')];_0x39f551=_[_0x092f('0xa7')](_0x39f551,function(_0x87c5ec){return!_0x395398['includes'](_0x87c5ec[_0x092f('0xa8')]);});var _0x21df78=[];var _0x12f8de=[];_0x39f551[_0x092f('0xa9')](function(_0x24b1be){if(_0x24b1be[_0x092f('0xaa')]){var _0x526c7d=_0x24b1be[_0x092f('0xaa')][_0x092f('0x99')](_0x24b1be[_0x092f('0xaa')][_0x092f('0xab')]('.')+0x1);if(_0x526c7d==='PicklistAttributeMetadata'){_0x21df78['push'](getSelectList(_0x1e4258,_0x431ded,_0x12f8de,_0x54fb52[_0x092f('0xa3')],_0x24b1be[_0x092f('0xa3')],_0x413a27));}}});return Promise['all'](_0x21df78);})[_0x092f('0x22')](function(_0x210a54){_0x1dfe53=_0x210a54[0x0];var _0xd52405=[];var _0x16c2df=[];_0x39f551['forEach'](function(_0x1e663b){if(!_[_0x092f('0xac')](_0x1e663b[_0x092f('0xaa')])){var _0x2a88ff=_0x1e663b[_0x092f('0xaa')]['substring'](_0x1e663b[_0x092f('0xaa')][_0x092f('0xab')]('.')+0x1);if(_0x2a88ff===_0x092f('0xad')){_0xd52405[_0x092f('0xae')](getBooleanList(_0x1e4258,_0x431ded,_0x16c2df,_0x54fb52['MetadataId'],_0x1e663b[_0x092f('0xa3')],_0x413a27));}}});return Promise[_0x092f('0xaf')](_0xd52405);})[_0x092f('0x22')](function(_0x1cb222){_0x501c52=_0x1cb222[0x0];var _0x3aa983=[];var _0x30f2f7=[];_0x39f551[_0x092f('0xa9')](function(_0xecafb9){if(_0xecafb9[_0x092f('0xaa')]){var _0x5e211a=_0xecafb9[_0x092f('0xaa')]['substring'](_0xecafb9[_0x092f('0xaa')][_0x092f('0xab')]('.')+0x1);if(_0x5e211a===_0x092f('0xb0')||_0x5e211a===_0x092f('0xb1')||_0x5e211a===_0x092f('0xb2')||_0x5e211a===_0x092f('0xb3')||_0x5e211a===_0x092f('0xb4')||_0x5e211a===_0x092f('0xb5')||_0x5e211a===_0x092f('0xb6')||_0x5e211a===_0x092f('0xb7')||_0x5e211a==='StateAttributeMetadata'||_0x5e211a===_0x092f('0xb8')){_0x3aa983[_0x092f('0xae')](getInputList(_0x1e4258,_0x431ded,_0x5e211a,_0x30f2f7,_0x54fb52[_0x092f('0xa3')],_0xecafb9[_0x092f('0xa3')],_0x413a27));}}});return Promise[_0x092f('0xaf')](_0x3aa983);})[_0x092f('0x22')](function(_0x3ae2e3){_0x1a05e5=_0x3ae2e3[0x0];var _0x9fc9df=_0x1dfe53[_0x092f('0x92')](_0x501c52)['concat'](_0x1a05e5);var _0x1fc17b={'count':_0x9fc9df[_0x092f('0x33')],'rows':_0x9fc9df};return _0x1fc17b;})[_0x092f('0x22')](respondWithResult(_0x59ca53,null))[_0x092f('0x40')](function(_0x3468ff){var _0x3086c2=_0x2f4983[_0x092f('0x2f')]['test']?0x1f4:_0x3468ff[_0x092f('0xb9')]||0x1f4;logger['error'](_0x3468ff[_0x092f('0x24')]);delete _0x3468ff['name'];if(_0x3086c2===0x191){_0x3086c2=0x190;}_0x59ca53[_0x092f('0x17')](_0x3086c2)[_0x092f('0xba')](_0x2f4983[_0x092f('0x2f')][_0x092f('0xbb')]?{'message':'Wrong\x20credentials','statusCode':_0x3468ff[_0x092f('0xb9')]}:_0x3468ff);});};function getSelectList(_0x494462,_0x255fd3,_0x4e83ce,_0x48d748,_0x5b32ee,_0x5c7801){var _0x381706={'method':_0x092f('0xa4'),'uri':_0x494462+'EntityDefinitions('+_0x48d748+_0x092f('0xbc')+_0x5b32ee+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x092f('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x5c7801,'If-None-Match':null,'OData-Version':_0x092f('0xa1')},'json':!![]};return rp(_0x381706)[_0x092f('0x22')](function(_0xe11394){var _0x7af6e7=[];var _0x3e4563=_0xe11394[_0x092f('0xbe')][_0x092f('0xbf')];_0x3e4563['forEach'](function(_0x542853){_0x7af6e7['push']({'name':_0x542853[_0x092f('0xc0')]['UserLocalizedLabel']['Label'],'value':String(_0x542853[_0x092f('0xc1')])});});var _0xf68c75={'id':_0x255fd3+'_'+_0xe11394[_0x092f('0xa8')],'name':_0xe11394[_0x092f('0xc2')][_0x092f('0xc3')][_0x092f('0xc0')],'custom':![],'options':_0x7af6e7};_0x4e83ce[_0x092f('0xae')](_0xf68c75);return _0x4e83ce;});}function getBooleanList(_0x1ad689,_0x5afeef,_0xbb03c3,_0x52cd8a,_0x3f257d,_0x42fe7a){var _0x8b9767={'method':_0x092f('0xa4'),'uri':_0x1ad689+'EntityDefinitions('+_0x52cd8a+_0x092f('0xbc')+_0x3f257d+_0x092f('0xc4'),'headers':{'Authorization':'Bearer\x20'+_0x42fe7a,'If-None-Match':null,'OData-Version':_0x092f('0xa1')},'json':!![]};return rp(_0x8b9767)['then'](function(_0xcaee1b){var _0x46b762=[];_0x46b762[_0x092f('0xae')]({'name':_0xcaee1b[_0x092f('0xbe')][_0x092f('0xc5')][_0x092f('0xc0')][_0x092f('0xc3')]['Label'],'value':'true'},{'name':_0xcaee1b[_0x092f('0xbe')][_0x092f('0xc6')][_0x092f('0xc0')][_0x092f('0xc3')][_0x092f('0xc0')],'value':'false'});var _0xd7e8ee={'id':_0x5afeef+'_'+_0xcaee1b[_0x092f('0xa8')],'name':_0xcaee1b[_0x092f('0xc2')][_0x092f('0xc3')][_0x092f('0xc0')],'custom':![],'options':_0x46b762};_0xbb03c3[_0x092f('0xae')](_0xd7e8ee);return _0xbb03c3;});}function getInputList(_0xc05a95,_0x51f23f,_0x534ad9,_0x2ad31d,_0x15bc35,_0x216c3d,_0x5d03ec){var _0x207823={'method':_0x092f('0xa4'),'uri':_0xc05a95+'EntityDefinitions('+_0x15bc35+_0x092f('0xbc')+_0x216c3d+_0x092f('0xc7')+_0x534ad9+_0x092f('0xc8'),'headers':{'Authorization':'Bearer\x20'+_0x5d03ec,'If-None-Match':null,'OData-Version':_0x092f('0xa1')},'json':!![]};return rp(_0x207823)[_0x092f('0x22')](function(_0x34e942){var _0xab1531={'id':_0x51f23f+'_'+_0x34e942['LogicalName'],'name':_0x34e942[_0x092f('0xc2')][_0x092f('0xc3')]?_0x34e942[_0x092f('0xc2')]['UserLocalizedLabel'][_0x092f('0xc0')]:_0x34e942[_0x092f('0xa8')],'custom':![],'options':[]};_0x2ad31d['push'](_0xab1531);return _0x2ad31d;});} \ No newline at end of file +var _0x4d9e=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','getConfigurations','findOne','Dynamics365Configuration','pick','nolimit','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','error','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','Value','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x39b2c9,_0x5b92ee){var _0x302a77=function(_0x5b0de6){while(--_0x5b0de6){_0x39b2c9['push'](_0x39b2c9['shift']());}};_0x302a77(++_0x5b92ee);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3ed733,_0x13ab9e){_0x3ed733=_0x3ed733-0x0;var _0x338a58=_0x4d9e[_0x3ed733];return _0x338a58;};'use strict';var emlformat=require(_0xe4d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe4d9('0x1'));var rp=require('request-promise');var moment=require(_0xe4d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe4d9('0x3'));var util=require(_0xe4d9('0x4'));var path=require('path');var sox=require(_0xe4d9('0x5'));var csv=require(_0xe4d9('0x6'));var ejs=require(_0xe4d9('0x7'));var fs=require('fs');var fs_extra=require(_0xe4d9('0x8'));var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x6'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var as=require(_0xe4d9('0x11'));var hardwareService=require(_0xe4d9('0x12'));var logger=require(_0xe4d9('0x13'))(_0xe4d9('0x14'));var utils=require(_0xe4d9('0x15'));var config=require(_0xe4d9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e0d15,_0x564383){_0x564383=_0x564383||0xcc;return function(_0x4b5b09){if(_0x4b5b09){return _0x4e0d15['sendStatus'](_0x564383);}return _0x4e0d15['status'](_0x564383)[_0xe4d9('0x17')]();};}function respondWithResult(_0x3238d4,_0x3f884c){_0x3f884c=_0x3f884c||0xc8;return function(_0x4bfbd5){if(_0x4bfbd5){return _0x3238d4[_0xe4d9('0x18')](_0x3f884c)[_0xe4d9('0x19')](_0x4bfbd5);}};}function respondWithFilteredResult(_0xe4f133,_0x4283f7){return function(_0x58d0cf){if(_0x58d0cf){var _0x331ef3=typeof _0x4283f7[_0xe4d9('0x1a')]===_0xe4d9('0x1b')&&typeof _0x4283f7['limit']==='undefined';var _0x7abb80=_0x58d0cf[_0xe4d9('0x1c')];var _0x5ab3d1=_0x331ef3?0x0:_0x4283f7[_0xe4d9('0x1a')];var _0x4f8dba=_0x331ef3?_0x58d0cf[_0xe4d9('0x1c')]:_0x4283f7[_0xe4d9('0x1a')]+_0x4283f7[_0xe4d9('0x1d')];var _0x2522f3;if(_0x4f8dba>=_0x7abb80){_0x4f8dba=_0x7abb80;_0x2522f3=0xc8;}else{_0x2522f3=0xce;}_0xe4f133['status'](_0x2522f3);return _0xe4f133[_0xe4d9('0x1e')](_0xe4d9('0x1f'),_0x5ab3d1+'-'+_0x4f8dba+'/'+_0x7abb80)[_0xe4d9('0x19')](_0x58d0cf);}return null;};}function patchUpdates(_0x171224){return function(_0x2c6b89){try{jsonpatch[_0xe4d9('0x20')](_0x2c6b89,_0x171224,!![]);}catch(_0x30d923){return BPromise[_0xe4d9('0x21')](_0x30d923);}return _0x2c6b89[_0xe4d9('0x22')]();};}function saveUpdates(_0x4fed7f,_0x44f1aa){return function(_0x26b0b2){if(_0x26b0b2){return _0x26b0b2['update'](_0x4fed7f)[_0xe4d9('0x23')](function(_0x50d377){return _0x50d377;});}return null;};}function removeEntity(_0x14f3d7,_0x125320){return function(_0x5b494d){if(_0x5b494d){return _0x5b494d[_0xe4d9('0x24')]()[_0xe4d9('0x23')](function(){_0x14f3d7['status'](0xcc)[_0xe4d9('0x17')]();});}};}function handleEntityNotFound(_0x2af9b0,_0x36444c){return function(_0x5bb43b){if(!_0x5bb43b){_0x2af9b0['sendStatus'](0x194);}return _0x5bb43b;};}function handleError(_0x42e6a0,_0x2846e2){_0x2846e2=_0x2846e2||0x1f4;return function(_0x52ef56){logger['error'](_0x52ef56['stack']);if(_0x52ef56['name']){delete _0x52ef56[_0xe4d9('0x25')];}_0x42e6a0['status'](_0x2846e2)[_0xe4d9('0x26')](_0x52ef56);};}exports[_0xe4d9('0x27')]=function(_0x4192bb,_0x535200){var _0xec8d64={},_0x2a0d1f={},_0x250de5={'count':0x0,'rows':[]};var _0x45e8a3=_[_0xe4d9('0x28')](db[_0xe4d9('0x29')][_0xe4d9('0x2a')],function(_0x449cb8){return{'name':_0x449cb8[_0xe4d9('0x2b')],'type':_0x449cb8[_0xe4d9('0x2c')][_0xe4d9('0x2d')]};});_0x2a0d1f[_0xe4d9('0x2e')]=_['map'](_0x45e8a3,_0xe4d9('0x25'));_0x2a0d1f[_0xe4d9('0x2f')]=_[_0xe4d9('0x30')](_0x4192bb[_0xe4d9('0x2f')]);_0x2a0d1f[_0xe4d9('0x31')]=_[_0xe4d9('0x32')](_0x2a0d1f['model'],_0x2a0d1f['query']);_0xec8d64['attributes']=_[_0xe4d9('0x32')](_0x2a0d1f[_0xe4d9('0x2e')],qs[_0xe4d9('0x33')](_0x4192bb['query']['fields']));_0xec8d64['attributes']=_0xec8d64['attributes'][_0xe4d9('0x34')]?_0xec8d64[_0xe4d9('0x35')]:_0x2a0d1f['model'];if(!_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x36')]('nolimit')){_0xec8d64[_0xe4d9('0x1d')]=qs[_0xe4d9('0x1d')](_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x1d')]);_0xec8d64[_0xe4d9('0x1a')]=qs[_0xe4d9('0x1a')](_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x1a')]);}_0xec8d64[_0xe4d9('0x37')]=qs[_0xe4d9('0x38')](_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x38')]);_0xec8d64[_0xe4d9('0x39')]=qs[_0xe4d9('0x31')](_['pick'](_0x4192bb[_0xe4d9('0x2f')],_0x2a0d1f[_0xe4d9('0x31')]),_0x45e8a3);if(_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x3a')]){_0xec8d64[_0xe4d9('0x39')]=_[_0xe4d9('0x3b')](_0xec8d64[_0xe4d9('0x39')],{'$or':_[_0xe4d9('0x28')](_0x45e8a3,function(_0x96a350){if(_0x96a350['type']!=='VIRTUAL'){var _0x5f5bc5={};_0x5f5bc5[_0x96a350[_0xe4d9('0x25')]]={'$like':'%'+_0x4192bb[_0xe4d9('0x2f')][_0xe4d9('0x3a')]+'%'};return _0x5f5bc5;}})});}_0xec8d64=_[_0xe4d9('0x3b')]({},_0xec8d64,_0x4192bb[_0xe4d9('0x3c')]);var _0x324679={'where':_0xec8d64[_0xe4d9('0x39')]};return db['Dynamics365Account']['count'](_0x324679)['then'](function(_0x3437cd){_0x250de5[_0xe4d9('0x1c')]=_0x3437cd;if(_0x4192bb['query'][_0xe4d9('0x3d')]){_0xec8d64[_0xe4d9('0x3e')]=[{'all':!![]}];}return db[_0xe4d9('0x29')][_0xe4d9('0x3f')](_0xec8d64);})['then'](function(_0x2f5423){_0x250de5[_0xe4d9('0x40')]=_0x2f5423;return _0x250de5;})[_0xe4d9('0x23')](respondWithFilteredResult(_0x535200,_0xec8d64))[_0xe4d9('0x41')](handleError(_0x535200,null));};exports[_0xe4d9('0x42')]=function(_0x1b9d00,_0x25b1f0){var _0x3e9653={'raw':![],'where':{'id':_0x1b9d00[_0xe4d9('0x43')]['id']}},_0x86bc71={};_0x86bc71[_0xe4d9('0x2e')]=_['keys'](db[_0xe4d9('0x29')][_0xe4d9('0x2a')]);_0x86bc71[_0xe4d9('0x2f')]=_[_0xe4d9('0x30')](_0x1b9d00[_0xe4d9('0x2f')]);_0x86bc71['filters']=_[_0xe4d9('0x32')](_0x86bc71[_0xe4d9('0x2e')],_0x86bc71[_0xe4d9('0x2f')]);_0x3e9653[_0xe4d9('0x35')]=_[_0xe4d9('0x32')](_0x86bc71[_0xe4d9('0x2e')],qs[_0xe4d9('0x33')](_0x1b9d00[_0xe4d9('0x2f')][_0xe4d9('0x33')]));_0x3e9653[_0xe4d9('0x35')]=_0x3e9653['attributes'][_0xe4d9('0x34')]?_0x3e9653[_0xe4d9('0x35')]:_0x86bc71[_0xe4d9('0x2e')];if(_0x1b9d00['query'][_0xe4d9('0x3d')]){_0x3e9653[_0xe4d9('0x3e')]=[{'all':!![]}];}_0x3e9653=_[_0xe4d9('0x3b')]({},_0x3e9653,_0x1b9d00[_0xe4d9('0x3c')]);return db[_0xe4d9('0x29')][_0xe4d9('0x44')](_0x3e9653)[_0xe4d9('0x23')](handleEntityNotFound(_0x25b1f0,null))['then'](respondWithResult(_0x25b1f0,null))[_0xe4d9('0x41')](handleError(_0x25b1f0,null));};exports[_0xe4d9('0x45')]=function(_0x38bc8f,_0x15ea5a){return db[_0xe4d9('0x29')][_0xe4d9('0x45')](_0x38bc8f['body'],{})[_0xe4d9('0x23')](respondWithResult(_0x15ea5a,0xc9))[_0xe4d9('0x41')](handleError(_0x15ea5a,null));};exports[_0xe4d9('0x46')]=function(_0x38468c,_0x1aab17){if(_0x38468c[_0xe4d9('0x47')]['id']){delete _0x38468c['body']['id'];}return db[_0xe4d9('0x29')][_0xe4d9('0x44')]({'where':{'id':_0x38468c['params']['id']}})[_0xe4d9('0x23')](handleEntityNotFound(_0x1aab17,null))['then'](saveUpdates(_0x38468c[_0xe4d9('0x47')],null))[_0xe4d9('0x23')](respondWithResult(_0x1aab17,null))['catch'](handleError(_0x1aab17,null));};exports[_0xe4d9('0x24')]=function(_0x5e5267,_0x27a5e4){return db[_0xe4d9('0x29')][_0xe4d9('0x44')]({'where':{'id':_0x5e5267['params']['id']}})[_0xe4d9('0x23')](handleEntityNotFound(_0x27a5e4,null))[_0xe4d9('0x23')](removeEntity(_0x27a5e4,null))['catch'](handleError(_0x27a5e4,null));};exports[_0xe4d9('0x48')]=function(_0x1af63a,_0x37af58,_0x42d15b){var _0x4dfb9d={};var _0x50f513={};var _0x198e92;var _0x40674d;return db[_0xe4d9('0x29')][_0xe4d9('0x49')]({'where':{'id':_0x1af63a[_0xe4d9('0x43')]['id']}})[_0xe4d9('0x23')](handleEntityNotFound(_0x37af58,null))['then'](function(_0x5a57ad){if(_0x5a57ad){_0x198e92=_0x5a57ad;_0x50f513[_0xe4d9('0x2e')]=_[_0xe4d9('0x30')](db[_0xe4d9('0x4a')][_0xe4d9('0x2a')]);_0x50f513[_0xe4d9('0x2f')]=_[_0xe4d9('0x30')](_0x1af63a['query']);_0x50f513[_0xe4d9('0x31')]=_[_0xe4d9('0x32')](_0x50f513[_0xe4d9('0x2e')],_0x50f513['query']);_0x4dfb9d[_0xe4d9('0x35')]=_[_0xe4d9('0x32')](_0x50f513[_0xe4d9('0x2e')],qs['fields'](_0x1af63a[_0xe4d9('0x2f')]['fields']));_0x4dfb9d[_0xe4d9('0x35')]=_0x4dfb9d[_0xe4d9('0x35')][_0xe4d9('0x34')]?_0x4dfb9d['attributes']:_0x50f513['model'];_0x4dfb9d['order']=qs[_0xe4d9('0x38')](_0x1af63a['query'][_0xe4d9('0x38')]);_0x4dfb9d['where']=qs['filters'](_[_0xe4d9('0x4b')](_0x1af63a[_0xe4d9('0x2f')],_0x50f513[_0xe4d9('0x31')]));if(_0x1af63a[_0xe4d9('0x2f')][_0xe4d9('0x3a')]){_0x4dfb9d['where']=_['merge'](_0x4dfb9d['where'],{'$or':_['map'](_0x4dfb9d[_0xe4d9('0x35')],function(_0xc787fc){var _0x466eef={};_0x466eef[_0xc787fc]={'$like':'%'+_0x1af63a[_0xe4d9('0x2f')][_0xe4d9('0x3a')]+'%'};return _0x466eef;})});}_0x4dfb9d=_[_0xe4d9('0x3b')]({},_0x4dfb9d,_0x1af63a[_0xe4d9('0x3c')]);return _0x198e92['getConfigurations'](_0x4dfb9d);}})['then'](function(_0x7d1fb9){if(_0x7d1fb9){_0x40674d=_0x7d1fb9[_0xe4d9('0x34')];if(!_0x1af63a[_0xe4d9('0x2f')][_0xe4d9('0x36')](_0xe4d9('0x4c'))){_0x4dfb9d[_0xe4d9('0x1d')]=qs[_0xe4d9('0x1d')](_0x1af63a[_0xe4d9('0x2f')][_0xe4d9('0x1d')]);_0x4dfb9d[_0xe4d9('0x1a')]=qs[_0xe4d9('0x1a')](_0x1af63a[_0xe4d9('0x2f')]['offset']);}return _0x198e92[_0xe4d9('0x48')](_0x4dfb9d);}})[_0xe4d9('0x23')](function(_0x121e8d){if(_0x121e8d){return _0x121e8d?{'count':_0x40674d,'rows':_0x121e8d}:null;}})[_0xe4d9('0x23')](respondWithResult(_0x37af58,null))['catch'](handleError(_0x37af58,null));};exports['addConfiguration']=function(_0x5c67a1,_0x12af56,_0x1166c9){if(_0x5c67a1[_0xe4d9('0x47')]['id']){delete _0x5c67a1[_0xe4d9('0x47')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x5c67a1[_0xe4d9('0x43')]['id']}})[_0xe4d9('0x23')](handleEntityNotFound(_0x12af56,null))[_0xe4d9('0x23')](function(_0x2a576b){if(_0x2a576b){_0x5c67a1[_0xe4d9('0x47')][_0xe4d9('0x4d')]=_0x2a576b['id'];_0x5c67a1['body'][_0xe4d9('0x4e')]=integrations['getSubjects'](_0x5c67a1[_0xe4d9('0x47')][_0xe4d9('0x4f')],_0x5c67a1['body'][_0xe4d9('0x2c')]);_0x5c67a1[_0xe4d9('0x47')]['Descriptions']=integrations[_0xe4d9('0x50')](_0x5c67a1[_0xe4d9('0x47')][_0xe4d9('0x4f')],_0x5c67a1[_0xe4d9('0x47')][_0xe4d9('0x2c')]);return db[_0xe4d9('0x4a')]['create'](_0x5c67a1['body'],{'include':[{'model':db[_0xe4d9('0x51')],'as':'Subjects'},{'model':db[_0xe4d9('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x12af56,null))[_0xe4d9('0x41')](handleError(_0x12af56,null));};exports[_0xe4d9('0x52')]=function(_0x12e656,_0x5b0471,_0x16fbe0){var _0x564269=_0x12e656[_0xe4d9('0x2f')][_0xe4d9('0x53')];var _0xf7fc1d=_0x564269===_0xe4d9('0x54')?'Incident':_0xe4d9('0x55');var _0x3ab549='';var _0x1a2335='';var _0x2d6a65='';var _0xd450d8='';var _0xff5ed5='';var _0x1fa518='';var _0x2ce194='';var _0x29c3fe='';var _0x5442f7=[_0xe4d9('0x56'),'description',_0xe4d9('0x57'),_0xe4d9('0x58'),_0xe4d9('0x59'),_0xe4d9('0x5a'),'phonenumber','regardingobjectid',_0xe4d9('0x5b'),_0xe4d9('0x5c')];var _0x21624b=[_0xe4d9('0x5d'),_0xe4d9('0x5e'),_0xe4d9('0x5f'),_0xe4d9('0x60'),_0xe4d9('0x61'),_0xe4d9('0x62'),'contractdetailidname',_0xe4d9('0x63'),_0xe4d9('0x64'),'createdbyexternalpartyyominame',_0xe4d9('0x65'),_0xe4d9('0x66'),_0xe4d9('0x67'),_0xe4d9('0x68'),_0xe4d9('0x69'),'customeridname',_0xe4d9('0x6a'),_0xe4d9('0x6b'),_0xe4d9('0x6c'),_0xe4d9('0x6d'),_0xe4d9('0x6e'),_0xe4d9('0x6f'),_0xe4d9('0x70'),_0xe4d9('0x71'),_0xe4d9('0x72'),'followupby',_0xe4d9('0x73'),'influencescore',_0xe4d9('0x74'),_0xe4d9('0x75'),_0xe4d9('0x76'),_0xe4d9('0x77'),'modifiedbyexternalpartyyominame',_0xe4d9('0x78'),_0xe4d9('0x79'),'modifiedon',_0xe4d9('0x7a'),_0xe4d9('0x7b'),'msdyn_incidenttypename',_0xe4d9('0x7c'),_0xe4d9('0x7d'),_0xe4d9('0x7e'),_0xe4d9('0x7f'),_0xe4d9('0x80'),_0xe4d9('0x81'),_0xe4d9('0x82'),_0xe4d9('0x83'),_0xe4d9('0x84'),'primarycontactidyominame',_0xe4d9('0x85'),'productidname',_0xe4d9('0x86'),'resolveby',_0xe4d9('0x87'),_0xe4d9('0x88'),_0xe4d9('0x89'),_0xe4d9('0x8a'),_0xe4d9('0x8b'),_0xe4d9('0x8c'),_0xe4d9('0x8d'),_0xe4d9('0x8e'),'statecode',_0xe4d9('0x8f'),_0xe4d9('0x90'),_0xe4d9('0x91'),_0xe4d9('0x92'),_0xe4d9('0x93'),_0xe4d9('0x94'),_0xe4d9('0x95'),_0xe4d9('0x96')];var _0x208887=_0x5442f7[_0xe4d9('0x97')](_0x21624b);return db[_0xe4d9('0x29')][_0xe4d9('0x49')]({'where':{'id':_0x12e656[_0xe4d9('0x43')]['id']},'attributes':['id','username',_0xe4d9('0x98'),_0xe4d9('0x99'),'tenantId',_0xe4d9('0x9a'),_0xe4d9('0x9b')]})['then'](handleEntityNotFound(_0x5b0471,null))[_0xe4d9('0x23')](function(_0x1859b2){if(_0x1859b2){_0x29c3fe=_0x1859b2[_0xe4d9('0x99')];var _0x1a10b0=_0x29c3fe[_0xe4d9('0x9c')](-0x1);if(_0x1a10b0==='/'){_0x29c3fe=_0x29c3fe[_0xe4d9('0x9d')](0x0,_0x29c3fe[_0xe4d9('0x9e')](_0x1a10b0));}_0x2ce194=util[_0xe4d9('0x9f')](_0xe4d9('0xa0'),_0x29c3fe);var _0x2bc36d={'method':_0xe4d9('0xa1'),'uri':_0xe4d9('0xa2')+_0x1859b2[_0xe4d9('0xa3')]+'/oauth2/token','form':{'client_id':_0x1859b2['clientId'],'resource':_0x29c3fe,'username':_0x1859b2['username'],'password':_0x1859b2[_0xe4d9('0x98')],'grant_type':_0xe4d9('0x98'),'client_secret':_0x1859b2['clientSecret']},'json':!![]};return rp(_0x2bc36d);}})['then'](function(_0x2198ab){_0x1fa518=_0x2198ab['access_token'];var _0x456401={'method':'GET','uri':encodeURI(_0x2ce194+_0xe4d9('0xa4')+_0xf7fc1d+'\x27'),'headers':{'Authorization':_0xe4d9('0xa5')+_0x1fa518,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x456401);})[_0xe4d9('0x23')](function(_0x29ae02){var _0x46bd17=_0x29ae02['value'][0x0];var _0x311160=_0x46bd17[_0xe4d9('0xa6')];var _0x3eb91b={'method':_0xe4d9('0xa7'),'uri':_0x2ce194+_0xe4d9('0xa8')+_0x311160+_0xe4d9('0xa9'),'headers':{'Authorization':_0xe4d9('0xa5')+_0x1fa518,'If-None-Match':null,'OData-Version':_0xe4d9('0xaa')},'json':!![]};return rp(_0x3eb91b);})[_0xe4d9('0x23')](function(_0x319c67){_0x3ab549=_0x319c67;_0x1a2335=_0x3ab549[_0xe4d9('0xab')];_0x1a2335=_[_0xe4d9('0xac')](_0x1a2335,function(_0x1936ab){return!_0x208887[_0xe4d9('0xad')](_0x1936ab[_0xe4d9('0xae')]);});var _0x2e5384=[];var _0x12cb8e=[];_0x1a2335[_0xe4d9('0xaf')](function(_0x2c1ac4){if(_0x2c1ac4[_0xe4d9('0xb0')]){var _0x103296=_0x2c1ac4[_0xe4d9('0xb0')][_0xe4d9('0x9d')](_0x2c1ac4[_0xe4d9('0xb0')]['lastIndexOf']('.')+0x1);if(_0x103296===_0xe4d9('0xb1')){_0x2e5384[_0xe4d9('0xb2')](getSelectList(_0x2ce194,_0x564269,_0x12cb8e,_0x3ab549[_0xe4d9('0xa6')],_0x2c1ac4[_0xe4d9('0xa6')],_0x1fa518));}}});return Promise[_0xe4d9('0xb3')](_0x2e5384);})['then'](function(_0x2dcdf9){_0x2d6a65=_0x2dcdf9[0x0];var _0x57adb6=[];var _0x14e4f5=[];_0x1a2335[_0xe4d9('0xaf')](function(_0x3645f0){if(!_[_0xe4d9('0xb4')](_0x3645f0[_0xe4d9('0xb0')])){var _0x5cf029=_0x3645f0[_0xe4d9('0xb0')][_0xe4d9('0x9d')](_0x3645f0[_0xe4d9('0xb0')][_0xe4d9('0x9e')]('.')+0x1);if(_0x5cf029==='BooleanAttributeMetadata'){_0x57adb6['push'](getBooleanList(_0x2ce194,_0x564269,_0x14e4f5,_0x3ab549[_0xe4d9('0xa6')],_0x3645f0[_0xe4d9('0xa6')],_0x1fa518));}}});return Promise['all'](_0x57adb6);})[_0xe4d9('0x23')](function(_0x35a316){_0xd450d8=_0x35a316[0x0];var _0x312699=[];var _0x2ab4a3=[];_0x1a2335[_0xe4d9('0xaf')](function(_0x28c84a){if(_0x28c84a[_0xe4d9('0xb0')]){var _0x7ae4d5=_0x28c84a[_0xe4d9('0xb0')][_0xe4d9('0x9d')](_0x28c84a[_0xe4d9('0xb0')]['lastIndexOf']('.')+0x1);if(_0x7ae4d5===_0xe4d9('0xb5')||_0x7ae4d5==='DoubleAttributeMetadata'||_0x7ae4d5==='BigIntAttributeMetadata'||_0x7ae4d5==='IntegerAttributeMetadata'||_0x7ae4d5===_0xe4d9('0xb6')||_0x7ae4d5===_0xe4d9('0xb7')||_0x7ae4d5===_0xe4d9('0xb8')||_0x7ae4d5===_0xe4d9('0xb9')||_0x7ae4d5===_0xe4d9('0xba')||_0x7ae4d5===_0xe4d9('0xbb')){_0x312699[_0xe4d9('0xb2')](getInputList(_0x2ce194,_0x564269,_0x7ae4d5,_0x2ab4a3,_0x3ab549['MetadataId'],_0x28c84a[_0xe4d9('0xa6')],_0x1fa518));}}});return Promise[_0xe4d9('0xb3')](_0x312699);})[_0xe4d9('0x23')](function(_0x2f450e){_0xff5ed5=_0x2f450e[0x0];var _0x350dcb=_0x2d6a65['concat'](_0xd450d8)[_0xe4d9('0x97')](_0xff5ed5);var _0x8c4f35={'count':_0x350dcb['length'],'rows':_0x350dcb};return _0x8c4f35;})[_0xe4d9('0x23')](respondWithResult(_0x5b0471,null))[_0xe4d9('0x41')](function(_0x3c4f82){var _0x35ec86=_0x12e656['query'][_0xe4d9('0xbc')]?0x1f4:_0x3c4f82['statusCode']||0x1f4;logger[_0xe4d9('0xbd')](_0x3c4f82[_0xe4d9('0xbe')]);delete _0x3c4f82[_0xe4d9('0x25')];if(_0x35ec86===0x191){_0x35ec86=0x190;}_0x5b0471[_0xe4d9('0x18')](_0x35ec86)[_0xe4d9('0x26')](_0x12e656[_0xe4d9('0x2f')][_0xe4d9('0xbc')]?{'message':'Wrong\x20credentials','statusCode':_0x3c4f82['statusCode']}:_0x3c4f82);});};function getSelectList(_0xc3e879,_0x432caf,_0x451bd5,_0x42a5f2,_0x5caa1f,_0x4ae522){var _0x56d369={'method':_0xe4d9('0xa7'),'uri':_0xc3e879+_0xe4d9('0xa8')+_0x42a5f2+_0xe4d9('0xbf')+_0x5caa1f+_0xe4d9('0xc0')+_0xe4d9('0xc1'),'headers':{'Authorization':_0xe4d9('0xa5')+_0x4ae522,'If-None-Match':null,'OData-Version':_0xe4d9('0xaa')},'json':!![]};return rp(_0x56d369)[_0xe4d9('0x23')](function(_0x57a98f){var _0x1bb725=[];var _0xef250d=_0x57a98f['OptionSet']['Options'];_0xef250d[_0xe4d9('0xaf')](function(_0x2f22d9){_0x1bb725[_0xe4d9('0xb2')]({'name':_0x2f22d9[_0xe4d9('0xc2')]['UserLocalizedLabel'][_0xe4d9('0xc2')],'value':String(_0x2f22d9[_0xe4d9('0xc3')])});});var _0x544117={'id':_0x432caf+'_'+_0x57a98f[_0xe4d9('0xae')],'name':_0x57a98f['DisplayName'][_0xe4d9('0xc4')]['Label'],'custom':![],'options':_0x1bb725};_0x451bd5[_0xe4d9('0xb2')](_0x544117);return _0x451bd5;});}function getBooleanList(_0x51812b,_0x8eb345,_0x1b2036,_0x34696a,_0x393384,_0x255b71){var _0xa54eb0={'method':_0xe4d9('0xa7'),'uri':_0x51812b+_0xe4d9('0xa8')+_0x34696a+')/Attributes('+_0x393384+_0xe4d9('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x255b71,'If-None-Match':null,'OData-Version':_0xe4d9('0xaa')},'json':!![]};return rp(_0xa54eb0)[_0xe4d9('0x23')](function(_0x23e26a){var _0xe41a2b=[];_0xe41a2b[_0xe4d9('0xb2')]({'name':_0x23e26a[_0xe4d9('0xc6')]['TrueOption'][_0xe4d9('0xc2')][_0xe4d9('0xc4')][_0xe4d9('0xc2')],'value':_0xe4d9('0xc7')},{'name':_0x23e26a[_0xe4d9('0xc6')][_0xe4d9('0xc8')][_0xe4d9('0xc2')][_0xe4d9('0xc4')][_0xe4d9('0xc2')],'value':'false'});var _0x4f6da5={'id':_0x8eb345+'_'+_0x23e26a[_0xe4d9('0xae')],'name':_0x23e26a[_0xe4d9('0xc9')][_0xe4d9('0xc4')][_0xe4d9('0xc2')],'custom':![],'options':_0xe41a2b};_0x1b2036['push'](_0x4f6da5);return _0x1b2036;});}function getInputList(_0x21c2e9,_0x5a66d9,_0x462428,_0x412af9,_0x51e730,_0x4db2d0,_0x4272c3){var _0x42f183={'method':_0xe4d9('0xa7'),'uri':_0x21c2e9+_0xe4d9('0xa8')+_0x51e730+_0xe4d9('0xbf')+_0x4db2d0+_0xe4d9('0xca')+_0x462428+_0xe4d9('0xcb'),'headers':{'Authorization':_0xe4d9('0xa5')+_0x4272c3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x42f183)[_0xe4d9('0x23')](function(_0x460d28){var _0x11c83c={'id':_0x5a66d9+'_'+_0x460d28['LogicalName'],'name':_0x460d28[_0xe4d9('0xc9')][_0xe4d9('0xc4')]?_0x460d28['DisplayName'][_0xe4d9('0xc4')][_0xe4d9('0xc2')]:_0x460d28[_0xe4d9('0xae')],'custom':![],'options':[]};_0x412af9[_0xe4d9('0xb2')](_0x11c83c);return _0x412af9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 8f0f66b..66afb22 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(_0x42ef50,_0xde0b23){var _0x3d13d2=function(_0x58cd02){while(--_0x58cd02){_0x42ef50['push'](_0x42ef50['shift']());}};_0x3d13d2(++_0xde0b23);}(_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('./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(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_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 d501dc4..d4ce2eb 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 _0x6b4a=['limit','include','model','map','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x6b4a,0x17c));var _0xa6b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b4a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa6b4('0x0'));var util=require(_0xa6b4('0x1'));var moment=require(_0xa6b4('0x2'));var BPromise=require(_0xa6b4('0x3'));var rs=require(_0xa6b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6b4('0x5'))['db'];var utils=require(_0xa6b4('0x6'));var logger=require(_0xa6b4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6b4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43ec18,_0x2ee5d5,_0x4ff6d2){return new BPromise(function(_0x3b9f24,_0xf61d16){return client['request'](_0x43ec18,_0x4ff6d2)[_0xa6b4('0x9')](function(_0x27cbdd){logger[_0xa6b4('0xa')](_0xa6b4('0xb'),_0x2ee5d5,_0xa6b4('0xc'));logger[_0xa6b4('0xd')](_0xa6b4('0xe'),_0x2ee5d5,_0xa6b4('0xc'),JSON[_0xa6b4('0xf')](_0x27cbdd));if(_0x27cbdd[_0xa6b4('0x10')]){if(_0x27cbdd[_0xa6b4('0x10')][_0xa6b4('0x11')]===0x1f4){logger[_0xa6b4('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x2ee5d5,_0x27cbdd[_0xa6b4('0x10')]['message']);return _0xf61d16(_0x27cbdd['error'][_0xa6b4('0x12')]);}logger[_0xa6b4('0x10')](_0xa6b4('0xb'),_0x2ee5d5,_0x27cbdd[_0xa6b4('0x10')][_0xa6b4('0x12')]);return _0x3b9f24(_0x27cbdd[_0xa6b4('0x10')]['message']);}else{logger[_0xa6b4('0xa')](_0xa6b4('0xb'),_0x2ee5d5,_0xa6b4('0xc'));_0x3b9f24(_0x27cbdd[_0xa6b4('0x13')][_0xa6b4('0x12')]);}})[_0xa6b4('0x14')](function(_0x19024b){logger[_0xa6b4('0x10')](_0xa6b4('0xb'),_0x2ee5d5,_0x19024b);_0xf61d16(_0x19024b);});});}exports[_0xa6b4('0x15')]=function(_0x571f58){var _0x2bd9ba=this;return new Promise(function(_0x589a65,_0xc77824){return db[_0xa6b4('0x16')][_0xa6b4('0x17')]({'raw':_0x571f58[_0xa6b4('0x18')]?_0x571f58[_0xa6b4('0x18')][_0xa6b4('0x19')]===undefined?!![]:![]:!![],'where':_0x571f58[_0xa6b4('0x18')]?_0x571f58[_0xa6b4('0x18')][_0xa6b4('0x1a')]||null:null,'attributes':_0x571f58['options']?_0x571f58[_0xa6b4('0x18')][_0xa6b4('0x1b')]||null:null,'limit':_0x571f58[_0xa6b4('0x18')]?_0x571f58[_0xa6b4('0x18')][_0xa6b4('0x1c')]||null:null,'include':_0x571f58[_0xa6b4('0x18')]?_0x571f58[_0xa6b4('0x18')]['include']?_['map'](_0x571f58[_0xa6b4('0x18')][_0xa6b4('0x1d')],function(_0x46d795){return{'model':db[_0x46d795[_0xa6b4('0x1e')]],'as':_0x46d795['as'],'attributes':_0x46d795[_0xa6b4('0x1b')],'include':_0x46d795['include']?_['map'](_0x46d795[_0xa6b4('0x1d')],function(_0x2f8e63){return{'model':db[_0x2f8e63[_0xa6b4('0x1e')]],'as':_0x2f8e63['as'],'attributes':_0x2f8e63[_0xa6b4('0x1b')],'include':_0x2f8e63[_0xa6b4('0x1d')]?_[_0xa6b4('0x1f')](_0x2f8e63[_0xa6b4('0x1d')],function(_0x5f1f63){return{'model':db[_0x5f1f63[_0xa6b4('0x1e')]],'as':_0x5f1f63['as'],'attributes':_0x5f1f63[_0xa6b4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa6b4('0x9')](function(_0x1b4e8a){logger['info'](_0xa6b4('0x15'),_0x571f58);logger[_0xa6b4('0xd')]('GetDynamics365Account',_0x571f58,JSON['stringify'](_0x1b4e8a));_0x589a65(_0x1b4e8a);})[_0xa6b4('0x14')](function(_0x5bd59a){logger[_0xa6b4('0x10')]('GetDynamics365Account',_0x5bd59a[_0xa6b4('0x12')],_0x571f58);_0xc77824(_0x2bd9ba[_0xa6b4('0x10')](0x1f4,_0x5bd59a['message']));});});};exports[_0xa6b4('0x20')]=function(_0x3b3145){var _0x357e9f=this;return new Promise(function(_0x58013b,_0x55d9c8){return db[_0xa6b4('0x16')][_0xa6b4('0x21')]({'raw':_0x3b3145[_0xa6b4('0x18')]?_0x3b3145[_0xa6b4('0x18')][_0xa6b4('0x19')]===undefined?!![]:![]:!![],'where':_0x3b3145[_0xa6b4('0x18')]?_0x3b3145[_0xa6b4('0x18')][_0xa6b4('0x1a')]||null:null,'attributes':_0x3b3145['options']?_0x3b3145['options']['attributes']||null:null,'include':_0x3b3145['options']?_0x3b3145['options']['include']?_[_0xa6b4('0x1f')](_0x3b3145[_0xa6b4('0x18')][_0xa6b4('0x1d')],function(_0x3f57f3){return{'model':db[_0x3f57f3[_0xa6b4('0x1e')]],'as':_0x3f57f3['as'],'attributes':_0x3f57f3[_0xa6b4('0x1b')],'include':_0x3f57f3[_0xa6b4('0x1d')]?_[_0xa6b4('0x1f')](_0x3f57f3[_0xa6b4('0x1d')],function(_0x182ea9){return{'model':db[_0x182ea9[_0xa6b4('0x1e')]],'as':_0x182ea9['as'],'attributes':_0x182ea9[_0xa6b4('0x1b')],'include':_0x182ea9['include']?_[_0xa6b4('0x1f')](_0x182ea9[_0xa6b4('0x1d')],function(_0x310363){return{'model':db[_0x310363[_0xa6b4('0x1e')]],'as':_0x310363['as'],'attributes':_0x310363[_0xa6b4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa6b4('0x9')](function(_0x13b257){logger[_0xa6b4('0xa')](_0xa6b4('0x20'),_0x3b3145);logger[_0xa6b4('0xd')]('ShowDynamics365Account',_0x3b3145,JSON[_0xa6b4('0xf')](_0x13b257));_0x58013b(_0x13b257);})[_0xa6b4('0x14')](function(_0xe71d60){logger['error'](_0xa6b4('0x20'),_0xe71d60[_0xa6b4('0x12')],_0x3b3145);_0x55d9c8(_0x357e9f[_0xa6b4('0x10')](0x1f4,_0xe71d60[_0xa6b4('0x12')]));});});}; \ No newline at end of file +var _0x3947=['find','raw','ShowDynamics365Account','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','model','map','catch'];(function(_0x1237fa,_0x4bd158){var _0x20e581=function(_0x1d5be5){while(--_0x1d5be5){_0x1237fa['push'](_0x1237fa['shift']());}};_0x20e581(++_0x4bd158);}(_0x3947,0x1ca));var _0x7394=function(_0x2a534b,_0x4a2cd1){_0x2a534b=_0x2a534b-0x0;var _0x45278=_0x3947[_0x2a534b];return _0x45278;};'use strict';var _=require(_0x7394('0x0'));var util=require(_0x7394('0x1'));var moment=require(_0x7394('0x2'));var BPromise=require('bluebird');var rs=require(_0x7394('0x3'));var fs=require('fs');var Redis=require(_0x7394('0x4'));var db=require(_0x7394('0x5'))['db'];var utils=require(_0x7394('0x6'));var logger=require(_0x7394('0x7'))(_0x7394('0x8'));var config=require(_0x7394('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7394('0xa')][_0x7394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48f6bd,_0x481e82,_0x357fb5){return new BPromise(function(_0x45cf56,_0xcd44b5){return client[_0x7394('0xc')](_0x48f6bd,_0x357fb5)[_0x7394('0xd')](function(_0x125355){logger[_0x7394('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x481e82,_0x7394('0xf'));logger[_0x7394('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x481e82,_0x7394('0xf'),JSON[_0x7394('0x11')](_0x125355));if(_0x125355[_0x7394('0x12')]){if(_0x125355[_0x7394('0x12')]['code']===0x1f4){logger[_0x7394('0x12')](_0x7394('0x13'),_0x481e82,_0x125355[_0x7394('0x12')]['message']);return _0xcd44b5(_0x125355['error'][_0x7394('0x14')]);}logger[_0x7394('0x12')](_0x7394('0x13'),_0x481e82,_0x125355[_0x7394('0x12')]['message']);return _0x45cf56(_0x125355['error'][_0x7394('0x14')]);}else{logger[_0x7394('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x481e82,'request\x20sent');_0x45cf56(_0x125355[_0x7394('0x15')][_0x7394('0x14')]);}})['catch'](function(_0x129fbd){logger[_0x7394('0x12')](_0x7394('0x13'),_0x481e82,_0x129fbd);_0xcd44b5(_0x129fbd);});});}exports[_0x7394('0x16')]=function(_0x57ccde){var _0x513d66=this;return new Promise(function(_0x358490,_0x36d2f5){return db[_0x7394('0x17')]['findAll']({'raw':_0x57ccde['options']?_0x57ccde[_0x7394('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x57ccde['options']?_0x57ccde[_0x7394('0x18')][_0x7394('0x19')]||null:null,'attributes':_0x57ccde[_0x7394('0x18')]?_0x57ccde['options'][_0x7394('0x1a')]||null:null,'limit':_0x57ccde[_0x7394('0x18')]?_0x57ccde[_0x7394('0x18')][_0x7394('0x1b')]||null:null,'include':_0x57ccde[_0x7394('0x18')]?_0x57ccde[_0x7394('0x18')]['include']?_['map'](_0x57ccde[_0x7394('0x18')][_0x7394('0x1c')],function(_0x245f1c){return{'model':db[_0x245f1c[_0x7394('0x1d')]],'as':_0x245f1c['as'],'attributes':_0x245f1c[_0x7394('0x1a')],'include':_0x245f1c[_0x7394('0x1c')]?_[_0x7394('0x1e')](_0x245f1c['include'],function(_0x4bc334){return{'model':db[_0x4bc334['model']],'as':_0x4bc334['as'],'attributes':_0x4bc334[_0x7394('0x1a')],'include':_0x4bc334['include']?_[_0x7394('0x1e')](_0x4bc334[_0x7394('0x1c')],function(_0x1a1fe4){return{'model':db[_0x1a1fe4[_0x7394('0x1d')]],'as':_0x1a1fe4['as'],'attributes':_0x1a1fe4[_0x7394('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ab0ed){logger[_0x7394('0xe')](_0x7394('0x16'),_0x57ccde);logger[_0x7394('0x10')](_0x7394('0x16'),_0x57ccde,JSON['stringify'](_0x1ab0ed));_0x358490(_0x1ab0ed);})[_0x7394('0x1f')](function(_0x24102b){logger[_0x7394('0x12')]('GetDynamics365Account',_0x24102b[_0x7394('0x14')],_0x57ccde);_0x36d2f5(_0x513d66[_0x7394('0x12')](0x1f4,_0x24102b[_0x7394('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x192655){var _0x21ee9a=this;return new Promise(function(_0x1b569f,_0x53d234){return db[_0x7394('0x17')][_0x7394('0x20')]({'raw':_0x192655[_0x7394('0x18')]?_0x192655[_0x7394('0x18')][_0x7394('0x21')]===undefined?!![]:![]:!![],'where':_0x192655[_0x7394('0x18')]?_0x192655[_0x7394('0x18')][_0x7394('0x19')]||null:null,'attributes':_0x192655[_0x7394('0x18')]?_0x192655['options'][_0x7394('0x1a')]||null:null,'include':_0x192655[_0x7394('0x18')]?_0x192655[_0x7394('0x18')][_0x7394('0x1c')]?_['map'](_0x192655[_0x7394('0x18')][_0x7394('0x1c')],function(_0x28285a){return{'model':db[_0x28285a[_0x7394('0x1d')]],'as':_0x28285a['as'],'attributes':_0x28285a[_0x7394('0x1a')],'include':_0x28285a[_0x7394('0x1c')]?_[_0x7394('0x1e')](_0x28285a[_0x7394('0x1c')],function(_0x273f6d){return{'model':db[_0x273f6d[_0x7394('0x1d')]],'as':_0x273f6d['as'],'attributes':_0x273f6d[_0x7394('0x1a')],'include':_0x273f6d[_0x7394('0x1c')]?_[_0x7394('0x1e')](_0x273f6d['include'],function(_0x584cee){return{'model':db[_0x584cee['model']],'as':_0x584cee['as'],'attributes':_0x584cee[_0x7394('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37f42f){logger[_0x7394('0xe')](_0x7394('0x22'),_0x192655);logger['debug'](_0x7394('0x22'),_0x192655,JSON[_0x7394('0x11')](_0x37f42f));_0x1b569f(_0x37f42f);})[_0x7394('0x1f')](function(_0x383876){logger['error'](_0x7394('0x22'),_0x383876['message'],_0x192655);_0x53d234(_0x21ee9a[_0x7394('0x12')](0x1f4,_0x383876['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1749fcf..d27a25e 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 _0x9619=['fs-extra','../../components/interaction/service','index','/:id','isAuthenticated','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x841828,_0x5d19f5){var _0x1ab061=function(_0x1a4a61){while(--_0x1a4a61){_0x841828['push'](_0x841828['shift']());}};_0x1ab061(++_0x5d19f5);}(_0x9619,0x6e));var _0x9961=function(_0x194034,_0x36c22c){_0x194034=_0x194034-0x0;var _0x391a9b=_0x9619[_0x194034];return _0x391a9b;};'use strict';var multer=require(_0x9961('0x0'));var util=require(_0x9961('0x1'));var path=require(_0x9961('0x2'));var timeout=require('connect-timeout');var express=require(_0x9961('0x3'));var router=express[_0x9961('0x4')]();var fs_extra=require(_0x9961('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9961('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9961('0x7')]);router['get'](_0x9961('0x8'),auth[_0x9961('0x9')](),controller['show']);router[_0x9961('0xa')]('/:id/fields',auth[_0x9961('0x9')](),controller[_0x9961('0xb')]);router['get'](_0x9961('0xc'),auth[_0x9961('0x9')](),controller[_0x9961('0xd')]);router[_0x9961('0xa')](_0x9961('0xe'),auth['isAuthenticated'](),controller[_0x9961('0xf')]);router[_0x9961('0x10')]('/',auth[_0x9961('0x9')](),controller[_0x9961('0x11')]);router[_0x9961('0x12')](_0x9961('0x8'),auth[_0x9961('0x9')](),controller[_0x9961('0x13')]);router[_0x9961('0x14')](_0x9961('0x8'),auth[_0x9961('0x9')](),controller[_0x9961('0x15')]);module[_0x9961('0x16')]=router; \ No newline at end of file +var _0x45c8=['/:id/descriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','index','get','/:id','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x500ab6,_0x2673d8){var _0x1c5a87=function(_0x4bc1a9){while(--_0x4bc1a9){_0x500ab6['push'](_0x500ab6['shift']());}};_0x1c5a87(++_0x2673d8);}(_0x45c8,0x8b));var _0x845c=function(_0x37143b,_0x3d5d0c){_0x37143b=_0x37143b-0x0;var _0x2f7aa9=_0x45c8[_0x37143b];return _0x2f7aa9;};'use strict';var multer=require(_0x845c('0x0'));var util=require(_0x845c('0x1'));var path=require(_0x845c('0x2'));var timeout=require(_0x845c('0x3'));var express=require(_0x845c('0x4'));var router=express[_0x845c('0x5')]();var fs_extra=require(_0x845c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x845c('0x7'));var config=require('../../config/environment');var controller=require(_0x845c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x845c('0x9')]);router[_0x845c('0xa')](_0x845c('0xb'),auth[_0x845c('0xc')](),controller['show']);router[_0x845c('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x845c('0xa')](_0x845c('0xd'),auth[_0x845c('0xc')](),controller[_0x845c('0xe')]);router[_0x845c('0xa')](_0x845c('0xf'),auth[_0x845c('0xc')](),controller['getDescriptions']);router[_0x845c('0x10')]('/',auth['isAuthenticated'](),controller[_0x845c('0x11')]);router[_0x845c('0x12')]('/:id',auth[_0x845c('0xc')](),controller['update']);router[_0x845c('0x13')](_0x845c('0xb'),auth['isAuthenticated'](),controller[_0x845c('0x14')]);module[_0x845c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f87250b..3d5d46f 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 _0x7030=['contact','nothing','exports','STRING','ENUM','incident'];(function(_0x1e8b30,_0xb4c3a2){var _0x434cb2=function(_0xd4404f){while(--_0xd4404f){_0x1e8b30['push'](_0x1e8b30['shift']());}};_0x434cb2(++_0xb4c3a2);}(_0x7030,0x1dc));var _0x0703=function(_0x3d03cf,_0x4b8f22){_0x3d03cf=_0x3d03cf-0x0;var _0x31ca3a=_0x7030[_0x3d03cf];return _0x31ca3a;};'use strict';var Sequelize=require('sequelize');module[_0x0703('0x0')]={'name':{'type':Sequelize[_0x0703('0x1')]},'description':{'type':Sequelize[_0x0703('0x1')]},'ticketType':{'type':Sequelize[_0x0703('0x2')]('incident','phonecall'),'defaultValue':_0x0703('0x3')},'moduleCreate':{'type':Sequelize[_0x0703('0x2')](_0x0703('0x4'),_0x0703('0x5')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0x3229=['phonecall','incident','ENUM','contact','nothing','sequelize','exports','STRING'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x3229,0xed));var _0x9322=function(_0x2c2844,_0x16308a){_0x2c2844=_0x2c2844-0x0;var _0x53bfbe=_0x3229[_0x2c2844];return _0x53bfbe;};'use strict';var Sequelize=require(_0x9322('0x0'));module[_0x9322('0x1')]={'name':{'type':Sequelize[_0x9322('0x2')]},'description':{'type':Sequelize[_0x9322('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x9322('0x3')),'defaultValue':_0x9322('0x4')},'moduleCreate':{'type':Sequelize[_0x9322('0x5')](_0x9322('0x6'),_0x9322('0x7')),'defaultValue':_0x9322('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7139ac4..1346ead 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 _0xd008=['to-csv','ejs','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x43a1c8,_0x4976ca){var _0x51397f=function(_0x27fde7){while(--_0x27fde7){_0x43a1c8['push'](_0x43a1c8['shift']());}};_0x51397f(++_0x4976ca);}(_0xd008,0x94));var _0x8d00=function(_0x387313,_0x31e306){_0x387313=_0x387313-0x0;var _0x416b29=_0xd008[_0x387313];return _0x416b29;};'use strict';var emlformat=require(_0x8d00('0x0'));var rimraf=require(_0x8d00('0x1'));var zipdir=require(_0x8d00('0x2'));var jsonpatch=require(_0x8d00('0x3'));var rp=require('request-promise');var moment=require(_0x8d00('0x4'));var BPromise=require(_0x8d00('0x5'));var Mustache=require(_0x8d00('0x6'));var util=require(_0x8d00('0x7'));var path=require(_0x8d00('0x8'));var sox=require(_0x8d00('0x9'));var csv=require(_0x8d00('0xa'));var ejs=require(_0x8d00('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d00('0xc'));var squel=require('squel');var crypto=require(_0x8d00('0xd'));var jsforce=require(_0x8d00('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8d00('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8d00('0xf'));var qs=require(_0x8d00('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d00('0x11'));var logger=require(_0x8d00('0x12'))(_0x8d00('0x13'));var utils=require(_0x8d00('0x14'));var config=require(_0x8d00('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d00('0x16'))['db'];function respondWithStatusCode(_0x2c62c3,_0x34c084){_0x34c084=_0x34c084||0xcc;return function(_0x58a1a7){if(_0x58a1a7){return _0x2c62c3[_0x8d00('0x17')](_0x34c084);}return _0x2c62c3['status'](_0x34c084)[_0x8d00('0x18')]();};}function respondWithResult(_0x19bfd4,_0x198f97){_0x198f97=_0x198f97||0xc8;return function(_0xe654a8){if(_0xe654a8){return _0x19bfd4[_0x8d00('0x19')](_0x198f97)[_0x8d00('0x1a')](_0xe654a8);}};}function respondWithFilteredResult(_0x19d47f,_0x4215e9){return function(_0x4dd65b){if(_0x4dd65b){var _0x45e0b8=typeof _0x4215e9[_0x8d00('0x1b')]===_0x8d00('0x1c')&&typeof _0x4215e9[_0x8d00('0x1d')]===_0x8d00('0x1c');var _0x157737=_0x4dd65b[_0x8d00('0x1e')];var _0xcc9e25=_0x45e0b8?0x0:_0x4215e9['offset'];var _0x95ac1c=_0x45e0b8?_0x4dd65b[_0x8d00('0x1e')]:_0x4215e9[_0x8d00('0x1b')]+_0x4215e9[_0x8d00('0x1d')];var _0x43cd4a;if(_0x95ac1c>=_0x157737){_0x95ac1c=_0x157737;_0x43cd4a=0xc8;}else{_0x43cd4a=0xce;}_0x19d47f[_0x8d00('0x19')](_0x43cd4a);return _0x19d47f[_0x8d00('0x1f')](_0x8d00('0x20'),_0xcc9e25+'-'+_0x95ac1c+'/'+_0x157737)[_0x8d00('0x1a')](_0x4dd65b);}return null;};}function patchUpdates(_0x585b2b){return function(_0x3892ef){try{jsonpatch[_0x8d00('0x21')](_0x3892ef,_0x585b2b,!![]);}catch(_0x17c6de){return BPromise[_0x8d00('0x22')](_0x17c6de);}return _0x3892ef[_0x8d00('0x23')]();};}function saveUpdates(_0x1976ad,_0x146f9a){return function(_0x136663){if(_0x136663){return _0x136663[_0x8d00('0x24')](_0x1976ad)['then'](function(_0x218f63){return _0x218f63;});}return null;};}function removeEntity(_0x207c66,_0x4191eb){return function(_0x1a453c){if(_0x1a453c){return _0x1a453c[_0x8d00('0x25')]()[_0x8d00('0x26')](function(){_0x207c66['status'](0xcc)[_0x8d00('0x18')]();});}};}function handleEntityNotFound(_0x5c28a9,_0x492ed8){return function(_0x1385d9){if(!_0x1385d9){_0x5c28a9[_0x8d00('0x17')](0x194);}return _0x1385d9;};}function handleError(_0x55db17,_0x402956){_0x402956=_0x402956||0x1f4;return function(_0x3e003b){logger['error'](_0x3e003b[_0x8d00('0x27')]);if(_0x3e003b[_0x8d00('0x28')]){delete _0x3e003b[_0x8d00('0x28')];}_0x55db17[_0x8d00('0x19')](_0x402956)[_0x8d00('0x29')](_0x3e003b);};}exports['index']=function(_0x5c08ab,_0x3ff90b){var _0x272c3b={},_0x4f22fb={},_0x1c0cf3={'count':0x0,'rows':[]};var _0x594aa3=_[_0x8d00('0x2a')](db[_0x8d00('0x2b')][_0x8d00('0x2c')],function(_0x44c816){return{'name':_0x44c816[_0x8d00('0x2d')],'type':_0x44c816[_0x8d00('0x2e')][_0x8d00('0x2f')]};});_0x4f22fb['model']=_[_0x8d00('0x2a')](_0x594aa3,_0x8d00('0x28'));_0x4f22fb[_0x8d00('0x30')]=_['keys'](_0x5c08ab[_0x8d00('0x30')]);_0x4f22fb[_0x8d00('0x31')]=_[_0x8d00('0x32')](_0x4f22fb['model'],_0x4f22fb[_0x8d00('0x30')]);_0x272c3b[_0x8d00('0x33')]=_[_0x8d00('0x32')](_0x4f22fb[_0x8d00('0x34')],qs[_0x8d00('0x35')](_0x5c08ab[_0x8d00('0x30')][_0x8d00('0x35')]));_0x272c3b['attributes']=_0x272c3b[_0x8d00('0x33')][_0x8d00('0x36')]?_0x272c3b[_0x8d00('0x33')]:_0x4f22fb[_0x8d00('0x34')];if(!_0x5c08ab[_0x8d00('0x30')][_0x8d00('0x37')](_0x8d00('0x38'))){_0x272c3b['limit']=qs['limit'](_0x5c08ab[_0x8d00('0x30')][_0x8d00('0x1d')]);_0x272c3b[_0x8d00('0x1b')]=qs[_0x8d00('0x1b')](_0x5c08ab[_0x8d00('0x30')][_0x8d00('0x1b')]);}_0x272c3b[_0x8d00('0x39')]=qs[_0x8d00('0x3a')](_0x5c08ab['query'][_0x8d00('0x3a')]);_0x272c3b[_0x8d00('0x3b')]=qs['filters'](_[_0x8d00('0x3c')](_0x5c08ab[_0x8d00('0x30')],_0x4f22fb[_0x8d00('0x31')]),_0x594aa3);if(_0x5c08ab['query'][_0x8d00('0x3d')]){_0x272c3b[_0x8d00('0x3b')]=_[_0x8d00('0x3e')](_0x272c3b['where'],{'$or':_[_0x8d00('0x2a')](_0x594aa3,function(_0x331011){if(_0x331011[_0x8d00('0x2e')]!=='VIRTUAL'){var _0x10462d={};_0x10462d[_0x331011[_0x8d00('0x28')]]={'$like':'%'+_0x5c08ab[_0x8d00('0x30')][_0x8d00('0x3d')]+'%'};return _0x10462d;}})});}_0x272c3b=_[_0x8d00('0x3e')]({},_0x272c3b,_0x5c08ab[_0x8d00('0x3f')]);var _0xc0dae9={'where':_0x272c3b[_0x8d00('0x3b')]};return db['Dynamics365Configuration'][_0x8d00('0x1e')](_0xc0dae9)[_0x8d00('0x26')](function(_0x6cd807){_0x1c0cf3[_0x8d00('0x1e')]=_0x6cd807;if(_0x5c08ab['query'][_0x8d00('0x40')]){_0x272c3b[_0x8d00('0x41')]=[{'all':!![]}];}return db[_0x8d00('0x2b')][_0x8d00('0x42')](_0x272c3b);})[_0x8d00('0x26')](function(_0x2a57de){_0x1c0cf3[_0x8d00('0x43')]=_0x2a57de;return _0x1c0cf3;})[_0x8d00('0x26')](respondWithFilteredResult(_0x3ff90b,_0x272c3b))['catch'](handleError(_0x3ff90b,null));};exports[_0x8d00('0x44')]=function(_0x393404,_0x1a19ea){var _0x2f9709={'raw':![],'where':{'id':_0x393404[_0x8d00('0x45')]['id']}},_0x221674={};_0x221674[_0x8d00('0x34')]=_[_0x8d00('0x46')](db[_0x8d00('0x2b')][_0x8d00('0x2c')]);_0x221674['query']=_[_0x8d00('0x46')](_0x393404[_0x8d00('0x30')]);_0x221674[_0x8d00('0x31')]=_[_0x8d00('0x32')](_0x221674['model'],_0x221674['query']);_0x2f9709[_0x8d00('0x33')]=_[_0x8d00('0x32')](_0x221674[_0x8d00('0x34')],qs['fields'](_0x393404['query']['fields']));_0x2f9709[_0x8d00('0x33')]=_0x2f9709['attributes'][_0x8d00('0x36')]?_0x2f9709[_0x8d00('0x33')]:_0x221674[_0x8d00('0x34')];if(_0x393404[_0x8d00('0x30')][_0x8d00('0x40')]){_0x2f9709[_0x8d00('0x41')]=[{'all':!![]}];}_0x2f9709=_['merge']({},_0x2f9709,_0x393404[_0x8d00('0x3f')]);return db[_0x8d00('0x2b')]['find'](_0x2f9709)[_0x8d00('0x26')](handleEntityNotFound(_0x1a19ea,null))[_0x8d00('0x26')](respondWithResult(_0x1a19ea,null))[_0x8d00('0x47')](handleError(_0x1a19ea,null));};exports[_0x8d00('0x48')]=function(_0x5ac0d4,_0x5e9781){return db[_0x8d00('0x2b')]['create'](_0x5ac0d4[_0x8d00('0x49')],{})[_0x8d00('0x26')](respondWithResult(_0x5e9781,0xc9))['catch'](handleError(_0x5e9781,null));};exports[_0x8d00('0x24')]=function(_0x352b5c,_0x30bc8e){if(_0x352b5c[_0x8d00('0x49')]['id']){delete _0x352b5c[_0x8d00('0x49')]['id'];}return db[_0x8d00('0x2b')]['find']({'where':{'id':_0x352b5c['params']['id']}})[_0x8d00('0x26')](handleEntityNotFound(_0x30bc8e,null))[_0x8d00('0x26')](saveUpdates(_0x352b5c['body'],null))[_0x8d00('0x26')](respondWithResult(_0x30bc8e,null))[_0x8d00('0x47')](handleError(_0x30bc8e,null));};exports['destroy']=function(_0x48584e,_0x197bfc){return db['Dynamics365Configuration']['find']({'where':{'id':_0x48584e[_0x8d00('0x45')]['id']}})[_0x8d00('0x26')](handleEntityNotFound(_0x197bfc,null))[_0x8d00('0x26')](removeEntity(_0x197bfc,null))[_0x8d00('0x47')](handleError(_0x197bfc,null));};exports[_0x8d00('0x4a')]=function(_0x26d578,_0x30b478,_0x4f7b75){var _0x186e3a={};var _0x186a83={};var _0x1c0d7d;var _0x129215;return db[_0x8d00('0x2b')][_0x8d00('0x4b')]({'where':{'id':_0x26d578['params']['id']}})[_0x8d00('0x26')](handleEntityNotFound(_0x30b478,null))[_0x8d00('0x26')](function(_0xd86c17){if(_0xd86c17){_0x1c0d7d=_0xd86c17;_0x186a83[_0x8d00('0x34')]=_[_0x8d00('0x46')](db['Dynamics365Field'][_0x8d00('0x2c')]);_0x186a83[_0x8d00('0x30')]=_['keys'](_0x26d578[_0x8d00('0x30')]);_0x186a83['filters']=_[_0x8d00('0x32')](_0x186a83[_0x8d00('0x34')],_0x186a83[_0x8d00('0x30')]);_0x186e3a[_0x8d00('0x33')]=_[_0x8d00('0x32')](_0x186a83[_0x8d00('0x34')],qs['fields'](_0x26d578[_0x8d00('0x30')]['fields']));_0x186e3a[_0x8d00('0x33')]=_0x186e3a[_0x8d00('0x33')][_0x8d00('0x36')]?_0x186e3a[_0x8d00('0x33')]:_0x186a83[_0x8d00('0x34')];_0x186e3a['order']=qs[_0x8d00('0x3a')](_0x26d578[_0x8d00('0x30')][_0x8d00('0x3a')]);_0x186e3a['where']=qs[_0x8d00('0x31')](_[_0x8d00('0x3c')](_0x26d578[_0x8d00('0x30')],_0x186a83[_0x8d00('0x31')]));if(_0x26d578[_0x8d00('0x30')][_0x8d00('0x3d')]){_0x186e3a['where']=_[_0x8d00('0x3e')](_0x186e3a[_0x8d00('0x3b')],{'$or':_[_0x8d00('0x2a')](_0x186e3a[_0x8d00('0x33')],function(_0x5deb08){var _0x332737={};_0x332737[_0x5deb08]={'$like':'%'+_0x26d578[_0x8d00('0x30')]['filter']+'%'};return _0x332737;})});}_0x186e3a=_[_0x8d00('0x3e')]({},_0x186e3a,_0x26d578[_0x8d00('0x3f')]);return _0x1c0d7d[_0x8d00('0x4a')](_0x186e3a);}})[_0x8d00('0x26')](function(_0x2d677b){if(_0x2d677b){_0x129215=_0x2d677b['length'];if(!_0x26d578['query'][_0x8d00('0x37')](_0x8d00('0x38'))){_0x186e3a[_0x8d00('0x1d')]=qs['limit'](_0x26d578[_0x8d00('0x30')]['limit']);_0x186e3a[_0x8d00('0x1b')]=qs[_0x8d00('0x1b')](_0x26d578[_0x8d00('0x30')]['offset']);}return _0x1c0d7d[_0x8d00('0x4a')](_0x186e3a);}})[_0x8d00('0x26')](function(_0x465920){if(_0x465920){return _0x465920?{'count':_0x129215,'rows':_0x465920}:null;}})[_0x8d00('0x26')](respondWithResult(_0x30b478,null))[_0x8d00('0x47')](handleError(_0x30b478,null));};exports[_0x8d00('0x4c')]=function(_0xa8ea66,_0x11d159,_0x41838e){var _0x453340={};var _0x309ddd={};var _0x23e781;var _0x284500;return db[_0x8d00('0x2b')][_0x8d00('0x4b')]({'where':{'id':_0xa8ea66[_0x8d00('0x45')]['id']}})[_0x8d00('0x26')](handleEntityNotFound(_0x11d159,null))[_0x8d00('0x26')](function(_0x52ab68){if(_0x52ab68){_0x23e781=_0x52ab68;_0x309ddd[_0x8d00('0x34')]=_[_0x8d00('0x46')](db[_0x8d00('0x4d')]['rawAttributes']);_0x309ddd[_0x8d00('0x30')]=_[_0x8d00('0x46')](_0xa8ea66[_0x8d00('0x30')]);_0x309ddd[_0x8d00('0x31')]=_[_0x8d00('0x32')](_0x309ddd[_0x8d00('0x34')],_0x309ddd['query']);_0x453340[_0x8d00('0x33')]=_[_0x8d00('0x32')](_0x309ddd['model'],qs[_0x8d00('0x35')](_0xa8ea66[_0x8d00('0x30')][_0x8d00('0x35')]));_0x453340[_0x8d00('0x33')]=_0x453340[_0x8d00('0x33')][_0x8d00('0x36')]?_0x453340[_0x8d00('0x33')]:_0x309ddd[_0x8d00('0x34')];_0x453340[_0x8d00('0x39')]=qs['sort'](_0xa8ea66[_0x8d00('0x30')]['sort']);_0x453340[_0x8d00('0x3b')]=qs[_0x8d00('0x31')](_[_0x8d00('0x3c')](_0xa8ea66[_0x8d00('0x30')],_0x309ddd[_0x8d00('0x31')]));if(_0xa8ea66[_0x8d00('0x30')][_0x8d00('0x3d')]){_0x453340[_0x8d00('0x3b')]=_[_0x8d00('0x3e')](_0x453340[_0x8d00('0x3b')],{'$or':_[_0x8d00('0x2a')](_0x453340['attributes'],function(_0x12979e){var _0x49e0bc={};_0x49e0bc[_0x12979e]={'$like':'%'+_0xa8ea66[_0x8d00('0x30')]['filter']+'%'};return _0x49e0bc;})});}_0x453340=_[_0x8d00('0x3e')]({},_0x453340,_0xa8ea66[_0x8d00('0x3f')]);return _0x23e781[_0x8d00('0x4c')](_0x453340);}})[_0x8d00('0x26')](function(_0x9c7f2c){if(_0x9c7f2c){_0x284500=_0x9c7f2c['length'];if(!_0xa8ea66[_0x8d00('0x30')][_0x8d00('0x37')]('nolimit')){_0x453340[_0x8d00('0x1d')]=qs['limit'](_0xa8ea66[_0x8d00('0x30')][_0x8d00('0x1d')]);_0x453340[_0x8d00('0x1b')]=qs['offset'](_0xa8ea66[_0x8d00('0x30')][_0x8d00('0x1b')]);}return _0x23e781[_0x8d00('0x4c')](_0x453340);}})[_0x8d00('0x26')](function(_0x35c47b){if(_0x35c47b){return _0x35c47b?{'count':_0x284500,'rows':_0x35c47b}:null;}})[_0x8d00('0x26')](respondWithResult(_0x11d159,null))['catch'](handleError(_0x11d159,null));};exports[_0x8d00('0x4e')]=function(_0x4cc35a,_0x17faa9,_0x1af3d){var _0x3e5e4f={};var _0x470bfb={};var _0x2a739e;var _0x24a6c1;return db[_0x8d00('0x2b')][_0x8d00('0x4b')]({'where':{'id':_0x4cc35a['params']['id']}})[_0x8d00('0x26')](handleEntityNotFound(_0x17faa9,null))[_0x8d00('0x26')](function(_0x41ebc3){if(_0x41ebc3){_0x2a739e=_0x41ebc3;_0x470bfb[_0x8d00('0x34')]=_['keys'](db[_0x8d00('0x4d')]['rawAttributes']);_0x470bfb['query']=_['keys'](_0x4cc35a[_0x8d00('0x30')]);_0x470bfb[_0x8d00('0x31')]=_[_0x8d00('0x32')](_0x470bfb[_0x8d00('0x34')],_0x470bfb['query']);_0x3e5e4f[_0x8d00('0x33')]=_[_0x8d00('0x32')](_0x470bfb[_0x8d00('0x34')],qs[_0x8d00('0x35')](_0x4cc35a['query'][_0x8d00('0x35')]));_0x3e5e4f[_0x8d00('0x33')]=_0x3e5e4f[_0x8d00('0x33')]['length']?_0x3e5e4f[_0x8d00('0x33')]:_0x470bfb[_0x8d00('0x34')];_0x3e5e4f[_0x8d00('0x39')]=qs[_0x8d00('0x3a')](_0x4cc35a['query']['sort']);_0x3e5e4f[_0x8d00('0x3b')]=qs['filters'](_[_0x8d00('0x3c')](_0x4cc35a[_0x8d00('0x30')],_0x470bfb['filters']));if(_0x4cc35a[_0x8d00('0x30')][_0x8d00('0x3d')]){_0x3e5e4f[_0x8d00('0x3b')]=_[_0x8d00('0x3e')](_0x3e5e4f['where'],{'$or':_['map'](_0x3e5e4f[_0x8d00('0x33')],function(_0xcea3be){var _0x43ef74={};_0x43ef74[_0xcea3be]={'$like':'%'+_0x4cc35a[_0x8d00('0x30')][_0x8d00('0x3d')]+'%'};return _0x43ef74;})});}_0x3e5e4f=_[_0x8d00('0x3e')]({},_0x3e5e4f,_0x4cc35a['options']);return _0x2a739e[_0x8d00('0x4e')](_0x3e5e4f);}})[_0x8d00('0x26')](function(_0xd30fcd){if(_0xd30fcd){_0x24a6c1=_0xd30fcd[_0x8d00('0x36')];if(!_0x4cc35a[_0x8d00('0x30')]['hasOwnProperty'](_0x8d00('0x38'))){_0x3e5e4f[_0x8d00('0x1d')]=qs[_0x8d00('0x1d')](_0x4cc35a['query']['limit']);_0x3e5e4f['offset']=qs[_0x8d00('0x1b')](_0x4cc35a[_0x8d00('0x30')]['offset']);}return _0x2a739e['getDescriptions'](_0x3e5e4f);}})['then'](function(_0x376108){if(_0x376108){return _0x376108?{'count':_0x24a6c1,'rows':_0x376108}:null;}})[_0x8d00('0x26')](respondWithResult(_0x17faa9,null))['catch'](handleError(_0x17faa9,null));}; \ No newline at end of file +var _0x1304=['undefined','offset','count','limit','set','reject','save','destroy','then','end','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','rows','catch','params','includeAll','create','body','update','find','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','filter','getDescriptions','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x5cbc1c,_0x14f901){var _0x5f2ea1=function(_0x410bf3){while(--_0x410bf3){_0x5cbc1c['push'](_0x5cbc1c['shift']());}};_0x5f2ea1(++_0x14f901);}(_0x1304,0xd3));var _0x4130=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1304[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4130('0x0'));var rimraf=require(_0x4130('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4130('0x2'));var rp=require(_0x4130('0x3'));var moment=require(_0x4130('0x4'));var BPromise=require(_0x4130('0x5'));var Mustache=require(_0x4130('0x6'));var util=require(_0x4130('0x7'));var path=require(_0x4130('0x8'));var sox=require(_0x4130('0x9'));var csv=require(_0x4130('0xa'));var ejs=require(_0x4130('0xb'));var fs=require('fs');var fs_extra=require(_0x4130('0xc'));var _=require(_0x4130('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4130('0xe'));var toCsv=require(_0x4130('0xa'));var querystring=require(_0x4130('0xf'));var Papa=require(_0x4130('0x10'));var Redis=require(_0x4130('0x11'));var authService=require(_0x4130('0x12'));var qs=require(_0x4130('0x13'));var as=require(_0x4130('0x14'));var hardwareService=require(_0x4130('0x15'));var logger=require(_0x4130('0x16'))('api');var utils=require(_0x4130('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4130('0x18'));var db=require(_0x4130('0x19'))['db'];function respondWithStatusCode(_0x464955,_0x38af16){_0x38af16=_0x38af16||0xcc;return function(_0x5bdb09){if(_0x5bdb09){return _0x464955[_0x4130('0x1a')](_0x38af16);}return _0x464955['status'](_0x38af16)['end']();};}function respondWithResult(_0x38cdbb,_0x19379a){_0x19379a=_0x19379a||0xc8;return function(_0x498181){if(_0x498181){return _0x38cdbb[_0x4130('0x1b')](_0x19379a)[_0x4130('0x1c')](_0x498181);}};}function respondWithFilteredResult(_0xfc6290,_0xc6cddf){return function(_0x4131de){if(_0x4131de){var _0x5c5a0c=typeof _0xc6cddf['offset']===_0x4130('0x1d')&&typeof _0xc6cddf['limit']==='undefined';var _0x10820a=_0x4131de['count'];var _0x195a01=_0x5c5a0c?0x0:_0xc6cddf[_0x4130('0x1e')];var _0x22adad=_0x5c5a0c?_0x4131de[_0x4130('0x1f')]:_0xc6cddf[_0x4130('0x1e')]+_0xc6cddf[_0x4130('0x20')];var _0x3cf008;if(_0x22adad>=_0x10820a){_0x22adad=_0x10820a;_0x3cf008=0xc8;}else{_0x3cf008=0xce;}_0xfc6290[_0x4130('0x1b')](_0x3cf008);return _0xfc6290[_0x4130('0x21')]('Content-Range',_0x195a01+'-'+_0x22adad+'/'+_0x10820a)['json'](_0x4131de);}return null;};}function patchUpdates(_0xf4142){return function(_0x468f07){try{jsonpatch['apply'](_0x468f07,_0xf4142,!![]);}catch(_0x2b9de1){return BPromise[_0x4130('0x22')](_0x2b9de1);}return _0x468f07[_0x4130('0x23')]();};}function saveUpdates(_0x5d08eb,_0x2ed01a){return function(_0x1f0125){if(_0x1f0125){return _0x1f0125['update'](_0x5d08eb)['then'](function(_0x345b07){return _0x345b07;});}return null;};}function removeEntity(_0x5105af,_0x39a3cc){return function(_0x51e8e5){if(_0x51e8e5){return _0x51e8e5[_0x4130('0x24')]()[_0x4130('0x25')](function(){_0x5105af[_0x4130('0x1b')](0xcc)[_0x4130('0x26')]();});}};}function handleEntityNotFound(_0x49c284,_0x22ee14){return function(_0x493fba){if(!_0x493fba){_0x49c284[_0x4130('0x1a')](0x194);}return _0x493fba;};}function handleError(_0x1a1747,_0x50444f){_0x50444f=_0x50444f||0x1f4;return function(_0x895cfb){logger[_0x4130('0x27')](_0x895cfb[_0x4130('0x28')]);if(_0x895cfb[_0x4130('0x29')]){delete _0x895cfb[_0x4130('0x29')];}_0x1a1747[_0x4130('0x1b')](_0x50444f)[_0x4130('0x2a')](_0x895cfb);};}exports[_0x4130('0x2b')]=function(_0x4b953f,_0x23fdaa){var _0x14fa2e={},_0x93ba95={},_0x4713e8={'count':0x0,'rows':[]};var _0x2162d0=_['map'](db[_0x4130('0x2c')][_0x4130('0x2d')],function(_0x20e67e){return{'name':_0x20e67e[_0x4130('0x2e')],'type':_0x20e67e['type']['key']};});_0x93ba95[_0x4130('0x2f')]=_['map'](_0x2162d0,_0x4130('0x29'));_0x93ba95['query']=_[_0x4130('0x30')](_0x4b953f[_0x4130('0x31')]);_0x93ba95[_0x4130('0x32')]=_[_0x4130('0x33')](_0x93ba95['model'],_0x93ba95[_0x4130('0x31')]);_0x14fa2e[_0x4130('0x34')]=_[_0x4130('0x33')](_0x93ba95['model'],qs['fields'](_0x4b953f[_0x4130('0x31')][_0x4130('0x35')]));_0x14fa2e[_0x4130('0x34')]=_0x14fa2e['attributes'][_0x4130('0x36')]?_0x14fa2e[_0x4130('0x34')]:_0x93ba95[_0x4130('0x2f')];if(!_0x4b953f['query']['hasOwnProperty'](_0x4130('0x37'))){_0x14fa2e[_0x4130('0x20')]=qs[_0x4130('0x20')](_0x4b953f['query']['limit']);_0x14fa2e[_0x4130('0x1e')]=qs['offset'](_0x4b953f['query'][_0x4130('0x1e')]);}_0x14fa2e[_0x4130('0x38')]=qs[_0x4130('0x39')](_0x4b953f['query'][_0x4130('0x39')]);_0x14fa2e[_0x4130('0x3a')]=qs[_0x4130('0x32')](_[_0x4130('0x3b')](_0x4b953f['query'],_0x93ba95[_0x4130('0x32')]),_0x2162d0);if(_0x4b953f[_0x4130('0x31')]['filter']){_0x14fa2e[_0x4130('0x3a')]=_[_0x4130('0x3c')](_0x14fa2e[_0x4130('0x3a')],{'$or':_['map'](_0x2162d0,function(_0x49f638){if(_0x49f638[_0x4130('0x3d')]!==_0x4130('0x3e')){var _0x1488f3={};_0x1488f3[_0x49f638[_0x4130('0x29')]]={'$like':'%'+_0x4b953f[_0x4130('0x31')]['filter']+'%'};return _0x1488f3;}})});}_0x14fa2e=_['merge']({},_0x14fa2e,_0x4b953f[_0x4130('0x3f')]);var _0x5f198={'where':_0x14fa2e[_0x4130('0x3a')]};return db[_0x4130('0x2c')][_0x4130('0x1f')](_0x5f198)[_0x4130('0x25')](function(_0x125b99){_0x4713e8[_0x4130('0x1f')]=_0x125b99;if(_0x4b953f['query']['includeAll']){_0x14fa2e['include']=[{'all':!![]}];}return db[_0x4130('0x2c')]['findAll'](_0x14fa2e);})[_0x4130('0x25')](function(_0xca029d){_0x4713e8[_0x4130('0x40')]=_0xca029d;return _0x4713e8;})['then'](respondWithFilteredResult(_0x23fdaa,_0x14fa2e))[_0x4130('0x41')](handleError(_0x23fdaa,null));};exports['show']=function(_0x2a4fad,_0x3c71d9){var _0x29e5a0={'raw':![],'where':{'id':_0x2a4fad[_0x4130('0x42')]['id']}},_0x542fcb={};_0x542fcb[_0x4130('0x2f')]=_[_0x4130('0x30')](db[_0x4130('0x2c')][_0x4130('0x2d')]);_0x542fcb[_0x4130('0x31')]=_[_0x4130('0x30')](_0x2a4fad[_0x4130('0x31')]);_0x542fcb[_0x4130('0x32')]=_[_0x4130('0x33')](_0x542fcb[_0x4130('0x2f')],_0x542fcb[_0x4130('0x31')]);_0x29e5a0[_0x4130('0x34')]=_['intersection'](_0x542fcb[_0x4130('0x2f')],qs[_0x4130('0x35')](_0x2a4fad[_0x4130('0x31')]['fields']));_0x29e5a0[_0x4130('0x34')]=_0x29e5a0[_0x4130('0x34')][_0x4130('0x36')]?_0x29e5a0[_0x4130('0x34')]:_0x542fcb[_0x4130('0x2f')];if(_0x2a4fad[_0x4130('0x31')][_0x4130('0x43')]){_0x29e5a0['include']=[{'all':!![]}];}_0x29e5a0=_[_0x4130('0x3c')]({},_0x29e5a0,_0x2a4fad[_0x4130('0x3f')]);return db['Dynamics365Configuration']['find'](_0x29e5a0)[_0x4130('0x25')](handleEntityNotFound(_0x3c71d9,null))['then'](respondWithResult(_0x3c71d9,null))['catch'](handleError(_0x3c71d9,null));};exports['create']=function(_0x5114cf,_0x21c686){return db['Dynamics365Configuration'][_0x4130('0x44')](_0x5114cf[_0x4130('0x45')],{})[_0x4130('0x25')](respondWithResult(_0x21c686,0xc9))['catch'](handleError(_0x21c686,null));};exports[_0x4130('0x46')]=function(_0x2bd8b9,_0x214fe6){if(_0x2bd8b9['body']['id']){delete _0x2bd8b9[_0x4130('0x45')]['id'];}return db[_0x4130('0x2c')][_0x4130('0x47')]({'where':{'id':_0x2bd8b9['params']['id']}})[_0x4130('0x25')](handleEntityNotFound(_0x214fe6,null))['then'](saveUpdates(_0x2bd8b9[_0x4130('0x45')],null))[_0x4130('0x25')](respondWithResult(_0x214fe6,null))[_0x4130('0x41')](handleError(_0x214fe6,null));};exports[_0x4130('0x24')]=function(_0x5a4236,_0x26299b){return db[_0x4130('0x2c')]['find']({'where':{'id':_0x5a4236[_0x4130('0x42')]['id']}})['then'](handleEntityNotFound(_0x26299b,null))[_0x4130('0x25')](removeEntity(_0x26299b,null))['catch'](handleError(_0x26299b,null));};exports[_0x4130('0x48')]=function(_0x2b89bb,_0x440079,_0x4ed191){var _0x19889b={};var _0xa05558={};var _0x51cb3d;var _0x3d3b01;return db[_0x4130('0x2c')][_0x4130('0x49')]({'where':{'id':_0x2b89bb[_0x4130('0x42')]['id']}})[_0x4130('0x25')](handleEntityNotFound(_0x440079,null))['then'](function(_0x3b7155){if(_0x3b7155){_0x51cb3d=_0x3b7155;_0xa05558['model']=_['keys'](db[_0x4130('0x4a')]['rawAttributes']);_0xa05558[_0x4130('0x31')]=_['keys'](_0x2b89bb[_0x4130('0x31')]);_0xa05558[_0x4130('0x32')]=_[_0x4130('0x33')](_0xa05558[_0x4130('0x2f')],_0xa05558[_0x4130('0x31')]);_0x19889b[_0x4130('0x34')]=_[_0x4130('0x33')](_0xa05558[_0x4130('0x2f')],qs[_0x4130('0x35')](_0x2b89bb['query'][_0x4130('0x35')]));_0x19889b[_0x4130('0x34')]=_0x19889b[_0x4130('0x34')][_0x4130('0x36')]?_0x19889b[_0x4130('0x34')]:_0xa05558[_0x4130('0x2f')];_0x19889b[_0x4130('0x38')]=qs[_0x4130('0x39')](_0x2b89bb['query']['sort']);_0x19889b[_0x4130('0x3a')]=qs['filters'](_[_0x4130('0x3b')](_0x2b89bb[_0x4130('0x31')],_0xa05558[_0x4130('0x32')]));if(_0x2b89bb[_0x4130('0x31')]['filter']){_0x19889b[_0x4130('0x3a')]=_[_0x4130('0x3c')](_0x19889b[_0x4130('0x3a')],{'$or':_['map'](_0x19889b[_0x4130('0x34')],function(_0x19de47){var _0x14a826={};_0x14a826[_0x19de47]={'$like':'%'+_0x2b89bb[_0x4130('0x31')]['filter']+'%'};return _0x14a826;})});}_0x19889b=_[_0x4130('0x3c')]({},_0x19889b,_0x2b89bb[_0x4130('0x3f')]);return _0x51cb3d[_0x4130('0x48')](_0x19889b);}})[_0x4130('0x25')](function(_0x2f2a1c){if(_0x2f2a1c){_0x3d3b01=_0x2f2a1c[_0x4130('0x36')];if(!_0x2b89bb[_0x4130('0x31')][_0x4130('0x4b')](_0x4130('0x37'))){_0x19889b[_0x4130('0x20')]=qs[_0x4130('0x20')](_0x2b89bb[_0x4130('0x31')][_0x4130('0x20')]);_0x19889b[_0x4130('0x1e')]=qs[_0x4130('0x1e')](_0x2b89bb['query'][_0x4130('0x1e')]);}return _0x51cb3d[_0x4130('0x48')](_0x19889b);}})[_0x4130('0x25')](function(_0x319c51){if(_0x319c51){return _0x319c51?{'count':_0x3d3b01,'rows':_0x319c51}:null;}})[_0x4130('0x25')](respondWithResult(_0x440079,null))['catch'](handleError(_0x440079,null));};exports[_0x4130('0x4c')]=function(_0x3469fb,_0x19bf05,_0x166eb2){var _0x53b2ff={};var _0x351eba={};var _0xbcccca;var _0x1d43b3;return db[_0x4130('0x2c')][_0x4130('0x49')]({'where':{'id':_0x3469fb['params']['id']}})[_0x4130('0x25')](handleEntityNotFound(_0x19bf05,null))[_0x4130('0x25')](function(_0xce9150){if(_0xce9150){_0xbcccca=_0xce9150;_0x351eba[_0x4130('0x2f')]=_[_0x4130('0x30')](db[_0x4130('0x4a')][_0x4130('0x2d')]);_0x351eba[_0x4130('0x31')]=_['keys'](_0x3469fb[_0x4130('0x31')]);_0x351eba['filters']=_['intersection'](_0x351eba[_0x4130('0x2f')],_0x351eba[_0x4130('0x31')]);_0x53b2ff['attributes']=_[_0x4130('0x33')](_0x351eba['model'],qs[_0x4130('0x35')](_0x3469fb[_0x4130('0x31')]['fields']));_0x53b2ff[_0x4130('0x34')]=_0x53b2ff[_0x4130('0x34')][_0x4130('0x36')]?_0x53b2ff['attributes']:_0x351eba['model'];_0x53b2ff[_0x4130('0x38')]=qs[_0x4130('0x39')](_0x3469fb[_0x4130('0x31')][_0x4130('0x39')]);_0x53b2ff[_0x4130('0x3a')]=qs['filters'](_[_0x4130('0x3b')](_0x3469fb['query'],_0x351eba[_0x4130('0x32')]));if(_0x3469fb[_0x4130('0x31')][_0x4130('0x4d')]){_0x53b2ff['where']=_[_0x4130('0x3c')](_0x53b2ff[_0x4130('0x3a')],{'$or':_['map'](_0x53b2ff['attributes'],function(_0x590515){var _0x46325b={};_0x46325b[_0x590515]={'$like':'%'+_0x3469fb['query']['filter']+'%'};return _0x46325b;})});}_0x53b2ff=_['merge']({},_0x53b2ff,_0x3469fb[_0x4130('0x3f')]);return _0xbcccca[_0x4130('0x4c')](_0x53b2ff);}})[_0x4130('0x25')](function(_0x5b1d3e){if(_0x5b1d3e){_0x1d43b3=_0x5b1d3e['length'];if(!_0x3469fb[_0x4130('0x31')][_0x4130('0x4b')](_0x4130('0x37'))){_0x53b2ff['limit']=qs['limit'](_0x3469fb[_0x4130('0x31')][_0x4130('0x20')]);_0x53b2ff[_0x4130('0x1e')]=qs[_0x4130('0x1e')](_0x3469fb[_0x4130('0x31')][_0x4130('0x1e')]);}return _0xbcccca[_0x4130('0x4c')](_0x53b2ff);}})[_0x4130('0x25')](function(_0x5f3d8f){if(_0x5f3d8f){return _0x5f3d8f?{'count':_0x1d43b3,'rows':_0x5f3d8f}:null;}})[_0x4130('0x25')](respondWithResult(_0x19bf05,null))[_0x4130('0x41')](handleError(_0x19bf05,null));};exports[_0x4130('0x4e')]=function(_0x87a7a5,_0x423566,_0x29d993){var _0x73e4eb={};var _0x4e26b9={};var _0x198c69;var _0x5369e9;return db['Dynamics365Configuration'][_0x4130('0x49')]({'where':{'id':_0x87a7a5[_0x4130('0x42')]['id']}})['then'](handleEntityNotFound(_0x423566,null))[_0x4130('0x25')](function(_0x162e8e){if(_0x162e8e){_0x198c69=_0x162e8e;_0x4e26b9['model']=_['keys'](db['Dynamics365Field'][_0x4130('0x2d')]);_0x4e26b9['query']=_[_0x4130('0x30')](_0x87a7a5[_0x4130('0x31')]);_0x4e26b9['filters']=_[_0x4130('0x33')](_0x4e26b9[_0x4130('0x2f')],_0x4e26b9['query']);_0x73e4eb[_0x4130('0x34')]=_[_0x4130('0x33')](_0x4e26b9['model'],qs['fields'](_0x87a7a5[_0x4130('0x31')][_0x4130('0x35')]));_0x73e4eb[_0x4130('0x34')]=_0x73e4eb[_0x4130('0x34')][_0x4130('0x36')]?_0x73e4eb[_0x4130('0x34')]:_0x4e26b9[_0x4130('0x2f')];_0x73e4eb[_0x4130('0x38')]=qs['sort'](_0x87a7a5[_0x4130('0x31')][_0x4130('0x39')]);_0x73e4eb[_0x4130('0x3a')]=qs[_0x4130('0x32')](_['pick'](_0x87a7a5[_0x4130('0x31')],_0x4e26b9[_0x4130('0x32')]));if(_0x87a7a5[_0x4130('0x31')][_0x4130('0x4d')]){_0x73e4eb[_0x4130('0x3a')]=_[_0x4130('0x3c')](_0x73e4eb[_0x4130('0x3a')],{'$or':_[_0x4130('0x4f')](_0x73e4eb[_0x4130('0x34')],function(_0x38fab2){var _0x28c64b={};_0x28c64b[_0x38fab2]={'$like':'%'+_0x87a7a5['query'][_0x4130('0x4d')]+'%'};return _0x28c64b;})});}_0x73e4eb=_['merge']({},_0x73e4eb,_0x87a7a5[_0x4130('0x3f')]);return _0x198c69[_0x4130('0x4e')](_0x73e4eb);}})[_0x4130('0x25')](function(_0x49324d){if(_0x49324d){_0x5369e9=_0x49324d[_0x4130('0x36')];if(!_0x87a7a5[_0x4130('0x31')][_0x4130('0x4b')](_0x4130('0x37'))){_0x73e4eb[_0x4130('0x20')]=qs[_0x4130('0x20')](_0x87a7a5[_0x4130('0x31')][_0x4130('0x20')]);_0x73e4eb[_0x4130('0x1e')]=qs[_0x4130('0x1e')](_0x87a7a5['query'][_0x4130('0x1e')]);}return _0x198c69[_0x4130('0x4e')](_0x73e4eb);}})[_0x4130('0x25')](function(_0x25ff1e){if(_0x25ff1e){return _0x25ff1e?{'count':_0x5369e9,'rows':_0x25ff1e}:null;}})[_0x4130('0x25')](respondWithResult(_0x423566,null))[_0x4130('0x41')](handleError(_0x423566,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ab4c26c..591e8f3 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 _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x55ca,0x126));var _0xa55c=function(_0x21f88f,_0x48cfba){_0x21f88f=_0x21f88f-0x0;var _0x3b9ff5=_0x55ca[_0x21f88f];return _0x3b9ff5;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81bd=['../../config/environment','./intDynamics365Configuration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1c2ee5,_0x30a9a4){var _0x570b5c=function(_0x360854){while(--_0x360854){_0x1c2ee5['push'](_0x1c2ee5['shift']());}};_0x570b5c(++_0x30a9a4);}(_0x81bd,0x7c));var _0xd81b=function(_0x24bd83,_0x1830c4){_0x24bd83=_0x24bd83-0x0;var _0x3a047e=_0x81bd[_0x24bd83];return _0x3a047e;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 2d43b94..e03b31d 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 _0x50ec=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5cf6eb,_0x5be218){var _0x5489c2=function(_0x588f2a){while(--_0x588f2a){_0x5cf6eb['push'](_0x5cf6eb['shift']());}};_0x5489c2(++_0x5be218);}(_0x50ec,0x17b));var _0xc50e=function(_0x35ee07,_0x3a4198){_0x35ee07=_0x35ee07-0x0;var _0x423b8b=_0x50ec[_0x35ee07];return _0x423b8b;};'use strict';var _=require(_0xc50e('0x0'));var util=require('util');var moment=require(_0xc50e('0x1'));var BPromise=require(_0xc50e('0x2'));var rs=require(_0xc50e('0x3'));var fs=require('fs');var Redis=require(_0xc50e('0x4'));var db=require(_0xc50e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc50e('0x6'))(_0xc50e('0x7'));var config=require(_0xc50e('0x8'));var jayson=require(_0xc50e('0x9'));var client=jayson[_0xc50e('0xa')][_0xc50e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4894a2,_0x33928a,_0x4b9744){return new BPromise(function(_0x24c9ad,_0x582c3b){return client[_0xc50e('0xc')](_0x4894a2,_0x4b9744)[_0xc50e('0xd')](function(_0x454b19){logger[_0xc50e('0xe')](_0xc50e('0xf'),_0x33928a,'request\x20sent');logger[_0xc50e('0x10')](_0xc50e('0x11'),_0x33928a,'request\x20sent',JSON[_0xc50e('0x12')](_0x454b19));if(_0x454b19[_0xc50e('0x13')]){if(_0x454b19['error'][_0xc50e('0x14')]===0x1f4){logger['error'](_0xc50e('0xf'),_0x33928a,_0x454b19[_0xc50e('0x13')]['message']);return _0x582c3b(_0x454b19[_0xc50e('0x13')][_0xc50e('0x15')]);}logger[_0xc50e('0x13')](_0xc50e('0xf'),_0x33928a,_0x454b19[_0xc50e('0x13')][_0xc50e('0x15')]);return _0x24c9ad(_0x454b19[_0xc50e('0x13')][_0xc50e('0x15')]);}else{logger[_0xc50e('0xe')](_0xc50e('0xf'),_0x33928a,_0xc50e('0x16'));_0x24c9ad(_0x454b19[_0xc50e('0x17')]['message']);}})['catch'](function(_0x55bd27){logger[_0xc50e('0x13')](_0xc50e('0xf'),_0x33928a,_0x55bd27);_0x582c3b(_0x55bd27);});});} \ No newline at end of file +var _0x480f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1610e5,_0x2470a1){var _0x116401=function(_0x2d468d){while(--_0x2d468d){_0x1610e5['push'](_0x1610e5['shift']());}};_0x116401(++_0x2470a1);}(_0x480f,0x69));var _0xf480=function(_0xa087f5,_0x34fd10){_0xa087f5=_0xa087f5-0x0;var _0x4c8806=_0x480f[_0xa087f5];return _0x4c8806;};'use strict';var _=require(_0xf480('0x0'));var util=require(_0xf480('0x1'));var moment=require(_0xf480('0x2'));var BPromise=require(_0xf480('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf480('0x4'));var db=require(_0xf480('0x5'))['db'];var utils=require(_0xf480('0x6'));var logger=require(_0xf480('0x7'))(_0xf480('0x8'));var config=require('../../config/environment');var jayson=require(_0xf480('0x9'));var client=jayson[_0xf480('0xa')][_0xf480('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f8870,_0x33c623,_0xd70658){return new BPromise(function(_0x14a62e,_0x15fbbf){return client[_0xf480('0xc')](_0x4f8870,_0xd70658)['then'](function(_0x4c388b){logger[_0xf480('0xd')](_0xf480('0xe'),_0x33c623,_0xf480('0xf'));logger['debug'](_0xf480('0x10'),_0x33c623,_0xf480('0xf'),JSON[_0xf480('0x11')](_0x4c388b));if(_0x4c388b[_0xf480('0x12')]){if(_0x4c388b[_0xf480('0x12')]['code']===0x1f4){logger['error'](_0xf480('0xe'),_0x33c623,_0x4c388b['error'][_0xf480('0x13')]);return _0x15fbbf(_0x4c388b[_0xf480('0x12')][_0xf480('0x13')]);}logger[_0xf480('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x33c623,_0x4c388b[_0xf480('0x12')][_0xf480('0x13')]);return _0x14a62e(_0x4c388b[_0xf480('0x12')][_0xf480('0x13')]);}else{logger[_0xf480('0xd')](_0xf480('0xe'),_0x33c623,_0xf480('0xf'));_0x14a62e(_0x4c388b[_0xf480('0x14')][_0xf480('0x13')]);}})[_0xf480('0x15')](function(_0x306d35){logger['error'](_0xf480('0xe'),_0x33c623,_0x306d35);_0x15fbbf(_0x306d35);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8be5a01..3e6499e 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 _0x5e2a=['create','put','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x5e2a,0x154));var _0xa5e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e2a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa5e2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa5e2('0x1'));var express=require('express');var router=express[_0xa5e2('0x2')]();var fs_extra=require(_0xa5e2('0x3'));var auth=require(_0xa5e2('0x4'));var interaction=require(_0xa5e2('0x5'));var config=require(_0xa5e2('0x6'));var controller=require(_0xa5e2('0x7'));router[_0xa5e2('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5e2('0x9')]);router[_0xa5e2('0x8')](_0xa5e2('0xa'),auth[_0xa5e2('0xb')](),controller['show']);router['post']('/',auth[_0xa5e2('0xb')](),controller[_0xa5e2('0xc')]);router[_0xa5e2('0xd')](_0xa5e2('0xa'),auth[_0xa5e2('0xb')](),controller[_0xa5e2('0xe')]);router['delete']('/:id',auth[_0xa5e2('0xb')](),controller['destroy']);module[_0xa5e2('0xf')]=router; \ No newline at end of file +var _0x25f9=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0x25f9,0x19c));var _0x925f=function(_0x12d34c,_0xae2f8f){_0x12d34c=_0x12d34c-0x0;var _0x14b456=_0x25f9[_0x12d34c];return _0x14b456;};'use strict';var multer=require(_0x925f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x925f('0x1'));var express=require(_0x925f('0x2'));var router=express[_0x925f('0x3')]();var fs_extra=require(_0x925f('0x4'));var auth=require(_0x925f('0x5'));var interaction=require(_0x925f('0x6'));var config=require(_0x925f('0x7'));var controller=require(_0x925f('0x8'));router[_0x925f('0x9')]('/',auth[_0x925f('0xa')](),controller[_0x925f('0xb')]);router[_0x925f('0x9')](_0x925f('0xc'),auth[_0x925f('0xa')](),controller[_0x925f('0xd')]);router[_0x925f('0xe')]('/',auth[_0x925f('0xa')](),controller[_0x925f('0xf')]);router[_0x925f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x925f('0x11')]);router[_0x925f('0x12')]('/:id',auth[_0x925f('0xa')](),controller[_0x925f('0x13')]);module[_0x925f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index ec88e21..b349f4b 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 _0x2230=['sequelize','ENUM','string','variable','customVariable','STRING'];(function(_0x39388e,_0x331d2e){var _0x49d62f=function(_0x570726){while(--_0x570726){_0x39388e['push'](_0x39388e['shift']());}};_0x49d62f(++_0x331d2e);}(_0x2230,0x174));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0223('0x0'));module['exports']={'type':{'type':Sequelize[_0x0223('0x1')](_0x0223('0x2'),_0x0223('0x3'),_0x0223('0x4'),'keyValue','picklist'),'defaultValue':_0x0223('0x2')},'content':{'type':Sequelize[_0x0223('0x5')]},'key':{'type':Sequelize[_0x0223('0x5')]},'keyType':{'type':Sequelize[_0x0223('0x1')]('string','variable',_0x0223('0x4'))},'keyContent':{'type':Sequelize[_0x0223('0x5')]},'idField':{'type':Sequelize[_0x0223('0x5')]},'nameField':{'type':Sequelize[_0x0223('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4322=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x4322,0x94));var _0x2432=function(_0x44ae1c,_0x45b288){_0x44ae1c=_0x44ae1c-0x0;var _0x5db685=_0x4322[_0x44ae1c];return _0x5db685;};'use strict';var Sequelize=require(_0x2432('0x0'));module['exports']={'type':{'type':Sequelize[_0x2432('0x1')]('string',_0x2432('0x2'),_0x2432('0x3'),_0x2432('0x4'),_0x2432('0x5')),'defaultValue':_0x2432('0x6')},'content':{'type':Sequelize[_0x2432('0x7')]},'key':{'type':Sequelize[_0x2432('0x7')]},'keyType':{'type':Sequelize[_0x2432('0x1')](_0x2432('0x6'),_0x2432('0x2'),_0x2432('0x3'))},'keyContent':{'type':Sequelize[_0x2432('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2432('0x7')]},'customField':{'type':Sequelize[_0x2432('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f5743ca..d3e7ee4 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 _0xa4dd=['update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','body','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa4dd,0x169));var _0xda4d=function(_0x48051b,_0x339115){_0x48051b=_0x48051b-0x0;var _0x2a4f6e=_0xa4dd[_0x48051b];return _0x2a4f6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda4d('0x0'));var zipdir=require(_0xda4d('0x1'));var jsonpatch=require(_0xda4d('0x2'));var rp=require(_0xda4d('0x3'));var moment=require(_0xda4d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xda4d('0x5'));var util=require(_0xda4d('0x6'));var path=require(_0xda4d('0x7'));var sox=require('sox');var csv=require(_0xda4d('0x8'));var ejs=require(_0xda4d('0x9'));var fs=require('fs');var fs_extra=require(_0xda4d('0xa'));var _=require(_0xda4d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda4d('0xc'));var deskjs=require(_0xda4d('0xd'));var toCsv=require(_0xda4d('0x8'));var querystring=require(_0xda4d('0xe'));var Papa=require(_0xda4d('0xf'));var Redis=require(_0xda4d('0x10'));var authService=require(_0xda4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xda4d('0x12'));var hardwareService=require(_0xda4d('0x13'));var logger=require(_0xda4d('0x14'))(_0xda4d('0x15'));var utils=require(_0xda4d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda4d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f7c2b,_0x502124){_0x502124=_0x502124||0xcc;return function(_0x22bccd){if(_0x22bccd){return _0x1f7c2b[_0xda4d('0x18')](_0x502124);}return _0x1f7c2b[_0xda4d('0x19')](_0x502124)[_0xda4d('0x1a')]();};}function respondWithResult(_0x2fb0cb,_0x1d87b3){_0x1d87b3=_0x1d87b3||0xc8;return function(_0x249304){if(_0x249304){return _0x2fb0cb[_0xda4d('0x19')](_0x1d87b3)[_0xda4d('0x1b')](_0x249304);}};}function respondWithFilteredResult(_0x34eb4c,_0x6b3edc){return function(_0x3bdf3d){if(_0x3bdf3d){var _0x58e541=typeof _0x6b3edc[_0xda4d('0x1c')]===_0xda4d('0x1d')&&typeof _0x6b3edc[_0xda4d('0x1e')]===_0xda4d('0x1d');var _0xdbd57=_0x3bdf3d[_0xda4d('0x1f')];var _0x35d5b4=_0x58e541?0x0:_0x6b3edc[_0xda4d('0x1c')];var _0x509da1=_0x58e541?_0x3bdf3d[_0xda4d('0x1f')]:_0x6b3edc[_0xda4d('0x1c')]+_0x6b3edc[_0xda4d('0x1e')];var _0x1e8b05;if(_0x509da1>=_0xdbd57){_0x509da1=_0xdbd57;_0x1e8b05=0xc8;}else{_0x1e8b05=0xce;}_0x34eb4c['status'](_0x1e8b05);return _0x34eb4c[_0xda4d('0x20')](_0xda4d('0x21'),_0x35d5b4+'-'+_0x509da1+'/'+_0xdbd57)['json'](_0x3bdf3d);}return null;};}function patchUpdates(_0x387a98){return function(_0x7272ad){try{jsonpatch['apply'](_0x7272ad,_0x387a98,!![]);}catch(_0xdb2446){return BPromise['reject'](_0xdb2446);}return _0x7272ad[_0xda4d('0x22')]();};}function saveUpdates(_0x3b303f,_0x1b519a){return function(_0x7374b6){if(_0x7374b6){return _0x7374b6['update'](_0x3b303f)[_0xda4d('0x23')](function(_0x5e3547){return _0x5e3547;});}return null;};}function removeEntity(_0x1344d4,_0x3fcdd9){return function(_0x3a269f){if(_0x3a269f){return _0x3a269f[_0xda4d('0x24')]()[_0xda4d('0x23')](function(){_0x1344d4[_0xda4d('0x19')](0xcc)[_0xda4d('0x1a')]();});}};}function handleEntityNotFound(_0x3f2441,_0x1eee9b){return function(_0x16391a){if(!_0x16391a){_0x3f2441['sendStatus'](0x194);}return _0x16391a;};}function handleError(_0x992a35,_0x2d9f00){_0x2d9f00=_0x2d9f00||0x1f4;return function(_0x3bef61){logger[_0xda4d('0x25')](_0x3bef61['stack']);if(_0x3bef61[_0xda4d('0x26')]){delete _0x3bef61[_0xda4d('0x26')];}_0x992a35[_0xda4d('0x19')](_0x2d9f00)[_0xda4d('0x27')](_0x3bef61);};}exports[_0xda4d('0x28')]=function(_0x3ba142,_0x4c772e){var _0x5cf912={},_0x3cd651={},_0x2b13af={'count':0x0,'rows':[]};var _0x2040eb=_[_0xda4d('0x29')](db[_0xda4d('0x2a')][_0xda4d('0x2b')],function(_0x3bbc6c){return{'name':_0x3bbc6c[_0xda4d('0x2c')],'type':_0x3bbc6c[_0xda4d('0x2d')][_0xda4d('0x2e')]};});_0x3cd651['model']=_['map'](_0x2040eb,_0xda4d('0x26'));_0x3cd651['query']=_[_0xda4d('0x2f')](_0x3ba142[_0xda4d('0x30')]);_0x3cd651['filters']=_['intersection'](_0x3cd651['model'],_0x3cd651[_0xda4d('0x30')]);_0x5cf912[_0xda4d('0x31')]=_[_0xda4d('0x32')](_0x3cd651[_0xda4d('0x33')],qs[_0xda4d('0x34')](_0x3ba142['query'][_0xda4d('0x34')]));_0x5cf912['attributes']=_0x5cf912[_0xda4d('0x31')][_0xda4d('0x35')]?_0x5cf912[_0xda4d('0x31')]:_0x3cd651['model'];if(!_0x3ba142[_0xda4d('0x30')][_0xda4d('0x36')]('nolimit')){_0x5cf912[_0xda4d('0x1e')]=qs[_0xda4d('0x1e')](_0x3ba142['query']['limit']);_0x5cf912['offset']=qs[_0xda4d('0x1c')](_0x3ba142[_0xda4d('0x30')][_0xda4d('0x1c')]);}_0x5cf912['order']=qs[_0xda4d('0x37')](_0x3ba142[_0xda4d('0x30')][_0xda4d('0x37')]);_0x5cf912['where']=qs[_0xda4d('0x38')](_[_0xda4d('0x39')](_0x3ba142[_0xda4d('0x30')],_0x3cd651['filters']),_0x2040eb);if(_0x3ba142[_0xda4d('0x30')][_0xda4d('0x3a')]){_0x5cf912[_0xda4d('0x3b')]=_[_0xda4d('0x3c')](_0x5cf912[_0xda4d('0x3b')],{'$or':_['map'](_0x2040eb,function(_0x4e2d2d){if(_0x4e2d2d['type']!=='VIRTUAL'){var _0x133388={};_0x133388[_0x4e2d2d['name']]={'$like':'%'+_0x3ba142[_0xda4d('0x30')][_0xda4d('0x3a')]+'%'};return _0x133388;}})});}_0x5cf912=_[_0xda4d('0x3c')]({},_0x5cf912,_0x3ba142[_0xda4d('0x3d')]);var _0x1c0f63={'where':_0x5cf912['where']};return db[_0xda4d('0x2a')]['count'](_0x1c0f63)[_0xda4d('0x23')](function(_0x527b23){_0x2b13af[_0xda4d('0x1f')]=_0x527b23;if(_0x3ba142[_0xda4d('0x30')][_0xda4d('0x3e')]){_0x5cf912[_0xda4d('0x3f')]=[{'all':!![]}];}return db[_0xda4d('0x2a')][_0xda4d('0x40')](_0x5cf912);})[_0xda4d('0x23')](function(_0x3ffb1f){_0x2b13af[_0xda4d('0x41')]=_0x3ffb1f;return _0x2b13af;})['then'](respondWithFilteredResult(_0x4c772e,_0x5cf912))['catch'](handleError(_0x4c772e,null));};exports[_0xda4d('0x42')]=function(_0x4c6ae1,_0x3cbf49){var _0x5d2a45={'raw':!![],'where':{'id':_0x4c6ae1[_0xda4d('0x43')]['id']}},_0x30f961={};_0x30f961['model']=_[_0xda4d('0x2f')](db[_0xda4d('0x2a')]['rawAttributes']);_0x30f961[_0xda4d('0x30')]=_[_0xda4d('0x2f')](_0x4c6ae1[_0xda4d('0x30')]);_0x30f961['filters']=_[_0xda4d('0x32')](_0x30f961[_0xda4d('0x33')],_0x30f961[_0xda4d('0x30')]);_0x5d2a45[_0xda4d('0x31')]=_[_0xda4d('0x32')](_0x30f961['model'],qs[_0xda4d('0x34')](_0x4c6ae1[_0xda4d('0x30')][_0xda4d('0x34')]));_0x5d2a45['attributes']=_0x5d2a45['attributes'][_0xda4d('0x35')]?_0x5d2a45['attributes']:_0x30f961[_0xda4d('0x33')];if(_0x4c6ae1[_0xda4d('0x30')]['includeAll']){_0x5d2a45[_0xda4d('0x3f')]=[{'all':!![]}];}_0x5d2a45=_[_0xda4d('0x3c')]({},_0x5d2a45,_0x4c6ae1[_0xda4d('0x3d')]);return db[_0xda4d('0x2a')][_0xda4d('0x44')](_0x5d2a45)[_0xda4d('0x23')](handleEntityNotFound(_0x3cbf49,null))[_0xda4d('0x23')](respondWithResult(_0x3cbf49,null))['catch'](handleError(_0x3cbf49,null));};exports['create']=function(_0xc9c48f,_0x25d697){return db[_0xda4d('0x2a')]['create'](_0xc9c48f[_0xda4d('0x45')],{})[_0xda4d('0x23')](respondWithResult(_0x25d697,0xc9))[_0xda4d('0x46')](handleError(_0x25d697,null));};exports[_0xda4d('0x47')]=function(_0x52afd9,_0x6fba4){if(_0x52afd9[_0xda4d('0x45')]['id']){delete _0x52afd9[_0xda4d('0x45')]['id'];}return db[_0xda4d('0x2a')]['find']({'where':{'id':_0x52afd9['params']['id']}})[_0xda4d('0x23')](handleEntityNotFound(_0x6fba4,null))[_0xda4d('0x23')](saveUpdates(_0x52afd9[_0xda4d('0x45')],null))[_0xda4d('0x23')](respondWithResult(_0x6fba4,null))[_0xda4d('0x46')](handleError(_0x6fba4,null));};exports[_0xda4d('0x24')]=function(_0x9a573e,_0x4b0a34){return db[_0xda4d('0x2a')][_0xda4d('0x44')]({'where':{'id':_0x9a573e[_0xda4d('0x43')]['id']}})[_0xda4d('0x23')](handleEntityNotFound(_0x4b0a34,null))[_0xda4d('0x23')](removeEntity(_0x4b0a34,null))['catch'](handleError(_0x4b0a34,null));}; \ No newline at end of file +var _0x9c1f=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','Dynamics365Field','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x3ac4f3,_0x2de061){var _0x1315ac=function(_0x3b2527){while(--_0x3b2527){_0x3ac4f3['push'](_0x3ac4f3['shift']());}};_0x1315ac(++_0x2de061);}(_0x9c1f,0xce));var _0xf9c1=function(_0x248ab5,_0x29af97){_0x248ab5=_0x248ab5-0x0;var _0x2f075a=_0x9c1f[_0x248ab5];return _0x2f075a;};'use strict';var emlformat=require(_0xf9c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9c1('0x1'));var jsonpatch=require(_0xf9c1('0x2'));var rp=require(_0xf9c1('0x3'));var moment=require('moment');var BPromise=require(_0xf9c1('0x4'));var Mustache=require(_0xf9c1('0x5'));var util=require(_0xf9c1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf9c1('0x7'));var ejs=require(_0xf9c1('0x8'));var fs=require('fs');var fs_extra=require(_0xf9c1('0x9'));var _=require(_0xf9c1('0xa'));var squel=require('squel');var crypto=require(_0xf9c1('0xb'));var jsforce=require(_0xf9c1('0xc'));var deskjs=require(_0xf9c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf9c1('0xe'));var Papa=require('papaparse');var Redis=require(_0xf9c1('0xf'));var authService=require(_0xf9c1('0x10'));var qs=require(_0xf9c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9c1('0x12'))(_0xf9c1('0x13'));var utils=require(_0xf9c1('0x14'));var config=require(_0xf9c1('0x15'));var licenseUtil=require(_0xf9c1('0x16'));var db=require(_0xf9c1('0x17'))['db'];function respondWithStatusCode(_0x527ea0,_0x306720){_0x306720=_0x306720||0xcc;return function(_0x404276){if(_0x404276){return _0x527ea0['sendStatus'](_0x306720);}return _0x527ea0['status'](_0x306720)['end']();};}function respondWithResult(_0x39a175,_0x32bdd6){_0x32bdd6=_0x32bdd6||0xc8;return function(_0x4cd3dd){if(_0x4cd3dd){return _0x39a175[_0xf9c1('0x18')](_0x32bdd6)['json'](_0x4cd3dd);}};}function respondWithFilteredResult(_0x4b8adb,_0x18c53f){return function(_0x43a57e){if(_0x43a57e){var _0x58a9d5=typeof _0x18c53f['offset']===_0xf9c1('0x19')&&typeof _0x18c53f[_0xf9c1('0x1a')]===_0xf9c1('0x19');var _0x36dc33=_0x43a57e[_0xf9c1('0x1b')];var _0x3ed912=_0x58a9d5?0x0:_0x18c53f[_0xf9c1('0x1c')];var _0x3d65f2=_0x58a9d5?_0x43a57e[_0xf9c1('0x1b')]:_0x18c53f[_0xf9c1('0x1c')]+_0x18c53f[_0xf9c1('0x1a')];var _0x37504c;if(_0x3d65f2>=_0x36dc33){_0x3d65f2=_0x36dc33;_0x37504c=0xc8;}else{_0x37504c=0xce;}_0x4b8adb[_0xf9c1('0x18')](_0x37504c);return _0x4b8adb[_0xf9c1('0x1d')](_0xf9c1('0x1e'),_0x3ed912+'-'+_0x3d65f2+'/'+_0x36dc33)[_0xf9c1('0x1f')](_0x43a57e);}return null;};}function patchUpdates(_0x46d804){return function(_0x380ce1){try{jsonpatch[_0xf9c1('0x20')](_0x380ce1,_0x46d804,!![]);}catch(_0x44978c){return BPromise['reject'](_0x44978c);}return _0x380ce1[_0xf9c1('0x21')]();};}function saveUpdates(_0x2b9b45,_0x9b2250){return function(_0x5f4cf4){if(_0x5f4cf4){return _0x5f4cf4[_0xf9c1('0x22')](_0x2b9b45)[_0xf9c1('0x23')](function(_0x36013b){return _0x36013b;});}return null;};}function removeEntity(_0x10b39a,_0x78cd2c){return function(_0x244820){if(_0x244820){return _0x244820[_0xf9c1('0x24')]()[_0xf9c1('0x23')](function(){_0x10b39a['status'](0xcc)[_0xf9c1('0x25')]();});}};}function handleEntityNotFound(_0xb4eda6,_0x9077bd){return function(_0x263842){if(!_0x263842){_0xb4eda6[_0xf9c1('0x26')](0x194);}return _0x263842;};}function handleError(_0x4573a3,_0x4d8563){_0x4d8563=_0x4d8563||0x1f4;return function(_0xa23a91){logger[_0xf9c1('0x27')](_0xa23a91['stack']);if(_0xa23a91['name']){delete _0xa23a91[_0xf9c1('0x28')];}_0x4573a3[_0xf9c1('0x18')](_0x4d8563)['send'](_0xa23a91);};}exports[_0xf9c1('0x29')]=function(_0x21acfb,_0x30d32c){var _0x25675a={},_0x5ed34d={},_0xb319cd={'count':0x0,'rows':[]};var _0x1e1c0d=_['map'](db['Dynamics365Field'][_0xf9c1('0x2a')],function(_0x39dd85){return{'name':_0x39dd85['fieldName'],'type':_0x39dd85['type'][_0xf9c1('0x2b')]};});_0x5ed34d[_0xf9c1('0x2c')]=_[_0xf9c1('0x2d')](_0x1e1c0d,_0xf9c1('0x28'));_0x5ed34d[_0xf9c1('0x2e')]=_[_0xf9c1('0x2f')](_0x21acfb['query']);_0x5ed34d[_0xf9c1('0x30')]=_[_0xf9c1('0x31')](_0x5ed34d['model'],_0x5ed34d[_0xf9c1('0x2e')]);_0x25675a['attributes']=_[_0xf9c1('0x31')](_0x5ed34d['model'],qs[_0xf9c1('0x32')](_0x21acfb['query'][_0xf9c1('0x32')]));_0x25675a[_0xf9c1('0x33')]=_0x25675a['attributes'][_0xf9c1('0x34')]?_0x25675a[_0xf9c1('0x33')]:_0x5ed34d[_0xf9c1('0x2c')];if(!_0x21acfb[_0xf9c1('0x2e')][_0xf9c1('0x35')](_0xf9c1('0x36'))){_0x25675a[_0xf9c1('0x1a')]=qs['limit'](_0x21acfb[_0xf9c1('0x2e')][_0xf9c1('0x1a')]);_0x25675a['offset']=qs['offset'](_0x21acfb['query']['offset']);}_0x25675a[_0xf9c1('0x37')]=qs[_0xf9c1('0x38')](_0x21acfb['query'][_0xf9c1('0x38')]);_0x25675a[_0xf9c1('0x39')]=qs['filters'](_[_0xf9c1('0x3a')](_0x21acfb[_0xf9c1('0x2e')],_0x5ed34d[_0xf9c1('0x30')]),_0x1e1c0d);if(_0x21acfb[_0xf9c1('0x2e')][_0xf9c1('0x3b')]){_0x25675a[_0xf9c1('0x39')]=_['merge'](_0x25675a[_0xf9c1('0x39')],{'$or':_['map'](_0x1e1c0d,function(_0x5dd797){if(_0x5dd797[_0xf9c1('0x3c')]!==_0xf9c1('0x3d')){var _0x9a43b6={};_0x9a43b6[_0x5dd797['name']]={'$like':'%'+_0x21acfb[_0xf9c1('0x2e')]['filter']+'%'};return _0x9a43b6;}})});}_0x25675a=_[_0xf9c1('0x3e')]({},_0x25675a,_0x21acfb[_0xf9c1('0x3f')]);var _0x218556={'where':_0x25675a[_0xf9c1('0x39')]};return db['Dynamics365Field']['count'](_0x218556)[_0xf9c1('0x23')](function(_0x4d8849){_0xb319cd[_0xf9c1('0x1b')]=_0x4d8849;if(_0x21acfb[_0xf9c1('0x2e')][_0xf9c1('0x40')]){_0x25675a[_0xf9c1('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x25675a);})[_0xf9c1('0x23')](function(_0x156827){_0xb319cd[_0xf9c1('0x42')]=_0x156827;return _0xb319cd;})[_0xf9c1('0x23')](respondWithFilteredResult(_0x30d32c,_0x25675a))[_0xf9c1('0x43')](handleError(_0x30d32c,null));};exports['show']=function(_0x53df48,_0x323ef6){var _0x4b3666={'raw':!![],'where':{'id':_0x53df48['params']['id']}},_0x5ca4c6={};_0x5ca4c6[_0xf9c1('0x2c')]=_['keys'](db[_0xf9c1('0x44')][_0xf9c1('0x2a')]);_0x5ca4c6[_0xf9c1('0x2e')]=_[_0xf9c1('0x2f')](_0x53df48[_0xf9c1('0x2e')]);_0x5ca4c6[_0xf9c1('0x30')]=_[_0xf9c1('0x31')](_0x5ca4c6[_0xf9c1('0x2c')],_0x5ca4c6[_0xf9c1('0x2e')]);_0x4b3666[_0xf9c1('0x33')]=_['intersection'](_0x5ca4c6['model'],qs[_0xf9c1('0x32')](_0x53df48[_0xf9c1('0x2e')][_0xf9c1('0x32')]));_0x4b3666['attributes']=_0x4b3666[_0xf9c1('0x33')][_0xf9c1('0x34')]?_0x4b3666['attributes']:_0x5ca4c6['model'];if(_0x53df48[_0xf9c1('0x2e')][_0xf9c1('0x40')]){_0x4b3666[_0xf9c1('0x41')]=[{'all':!![]}];}_0x4b3666=_[_0xf9c1('0x3e')]({},_0x4b3666,_0x53df48['options']);return db[_0xf9c1('0x44')][_0xf9c1('0x45')](_0x4b3666)[_0xf9c1('0x23')](handleEntityNotFound(_0x323ef6,null))[_0xf9c1('0x23')](respondWithResult(_0x323ef6,null))['catch'](handleError(_0x323ef6,null));};exports[_0xf9c1('0x46')]=function(_0x238adb,_0x2db923){return db[_0xf9c1('0x44')]['create'](_0x238adb[_0xf9c1('0x47')],{})['then'](respondWithResult(_0x2db923,0xc9))['catch'](handleError(_0x2db923,null));};exports[_0xf9c1('0x22')]=function(_0x121a35,_0x1ebf48){if(_0x121a35[_0xf9c1('0x47')]['id']){delete _0x121a35['body']['id'];}return db[_0xf9c1('0x44')][_0xf9c1('0x45')]({'where':{'id':_0x121a35[_0xf9c1('0x48')]['id']}})[_0xf9c1('0x23')](handleEntityNotFound(_0x1ebf48,null))['then'](saveUpdates(_0x121a35[_0xf9c1('0x47')],null))[_0xf9c1('0x23')](respondWithResult(_0x1ebf48,null))['catch'](handleError(_0x1ebf48,null));};exports[_0xf9c1('0x24')]=function(_0x5afed3,_0x13546a){return db[_0xf9c1('0x44')][_0xf9c1('0x45')]({'where':{'id':_0x5afed3[_0xf9c1('0x48')]['id']}})['then'](handleEntityNotFound(_0x13546a,null))[_0xf9c1('0x23')](removeEntity(_0x13546a,null))[_0xf9c1('0x43')](handleError(_0x13546a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 5bcc67a..d98aa52 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 _0x1da6=['idField','../../config/logger','api','path','rimraf','./intDynamics365Field.attributes','define','dynamics365_unique_index'];(function(_0x551597,_0x11e749){var _0x51dfed=function(_0x3f03d7){while(--_0x3f03d7){_0x551597['push'](_0x551597['shift']());}};_0x51dfed(++_0x11e749);}(_0x1da6,0x1b1));var _0x61da=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x1da6[_0xe1b5f6];return _0x44636e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x61da('0x0'))(_0x61da('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61da('0x2'));var rimraf=require(_0x61da('0x3'));var config=require('../../config/environment');var attributes=require(_0x61da('0x4'));module['exports']=function(_0x5a94a2,_0xc5f16f){return _0x5a94a2[_0x61da('0x5')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x61da('0x6'),'fields':[_0x61da('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf274=['define','int_dynamics365_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4c8700,_0x25e672){var _0x16dcaa=function(_0x18c324){while(--_0x18c324){_0x4c8700['push'](_0x4c8700['shift']());}};_0x16dcaa(++_0x25e672);}(_0xf274,0xba));var _0x4f27=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xf274[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x4f27('0x0'));var util=require('util');var logger=require(_0x4f27('0x1'))(_0x4f27('0x2'));var moment=require(_0x4f27('0x3'));var BPromise=require(_0x4f27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f27('0x5'));var rimraf=require(_0x4f27('0x6'));var config=require(_0x4f27('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x4f27('0x8')]=function(_0x5be6ce,_0x537819){return _0x5be6ce[_0x4f27('0x9')]('Dynamics365Field',attributes,{'tableName':_0x4f27('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x4f27('0xb'),_0x4f27('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index b89925f..e84bec1 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 _0x5e65=['then','Dynamics365Field,\x20%s,\x20%s','debug','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x52e7e4,_0x726a6c){var _0x1e26d0=function(_0x10d4ee){while(--_0x10d4ee){_0x52e7e4['push'](_0x52e7e4['shift']());}};_0x1e26d0(++_0x726a6c);}(_0x5e65,0x13b));var _0x55e6=function(_0x48f453,_0x2c4b39){_0x48f453=_0x48f453-0x0;var _0x5b862d=_0x5e65[_0x48f453];return _0x5b862d;};'use strict';var _=require(_0x55e6('0x0'));var util=require(_0x55e6('0x1'));var moment=require(_0x55e6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x55e6('0x4'));var logger=require(_0x55e6('0x5'))('rpc');var config=require(_0x55e6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55e6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbf191f,_0x3d1a5a,_0x51790e){return new BPromise(function(_0x3c8600,_0xc0e5d8){return client[_0x55e6('0x8')](_0xbf191f,_0x51790e)[_0x55e6('0x9')](function(_0x2bbb15){logger['info'](_0x55e6('0xa'),_0x3d1a5a,'request\x20sent');logger[_0x55e6('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3d1a5a,'request\x20sent',JSON[_0x55e6('0xc')](_0x2bbb15));if(_0x2bbb15[_0x55e6('0xd')]){if(_0x2bbb15[_0x55e6('0xd')]['code']===0x1f4){logger[_0x55e6('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3d1a5a,_0x2bbb15[_0x55e6('0xd')][_0x55e6('0xe')]);return _0xc0e5d8(_0x2bbb15['error'][_0x55e6('0xe')]);}logger[_0x55e6('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3d1a5a,_0x2bbb15[_0x55e6('0xd')][_0x55e6('0xe')]);return _0x3c8600(_0x2bbb15[_0x55e6('0xd')][_0x55e6('0xe')]);}else{logger[_0x55e6('0xf')](_0x55e6('0xa'),_0x3d1a5a,'request\x20sent');_0x3c8600(_0x2bbb15[_0x55e6('0x10')][_0x55e6('0xe')]);}})[_0x55e6('0x11')](function(_0x3e3787){logger[_0x55e6('0xd')](_0x55e6('0xa'),_0x3d1a5a,_0x3e3787);_0xc0e5d8(_0x3e3787);});});} \ No newline at end of file +var _0x51d9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x51d9,0x65));var _0x951d=function(_0x1859eb,_0x1b6507){_0x1859eb=_0x1859eb-0x0;var _0x29dc10=_0x51d9[_0x1859eb];return _0x29dc10;};'use strict';var _=require(_0x951d('0x0'));var util=require(_0x951d('0x1'));var moment=require(_0x951d('0x2'));var BPromise=require(_0x951d('0x3'));var rs=require(_0x951d('0x4'));var fs=require('fs');var Redis=require(_0x951d('0x5'));var db=require(_0x951d('0x6'))['db'];var utils=require(_0x951d('0x7'));var logger=require(_0x951d('0x8'))(_0x951d('0x9'));var config=require('../../config/environment');var jayson=require(_0x951d('0xa'));var client=jayson[_0x951d('0xb')][_0x951d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d735b,_0x48f40b,_0x31a758){return new BPromise(function(_0x1320bf,_0x1c8917){return client[_0x951d('0xd')](_0x2d735b,_0x31a758)[_0x951d('0xe')](function(_0x222667){logger[_0x951d('0xf')](_0x951d('0x10'),_0x48f40b,'request\x20sent');logger[_0x951d('0x11')](_0x951d('0x12'),_0x48f40b,'request\x20sent',JSON['stringify'](_0x222667));if(_0x222667['error']){if(_0x222667[_0x951d('0x13')][_0x951d('0x14')]===0x1f4){logger[_0x951d('0x13')](_0x951d('0x10'),_0x48f40b,_0x222667[_0x951d('0x13')][_0x951d('0x15')]);return _0x1c8917(_0x222667[_0x951d('0x13')][_0x951d('0x15')]);}logger[_0x951d('0x13')](_0x951d('0x10'),_0x48f40b,_0x222667[_0x951d('0x13')]['message']);return _0x1320bf(_0x222667[_0x951d('0x13')]['message']);}else{logger[_0x951d('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x48f40b,_0x951d('0x16'));_0x1320bf(_0x222667[_0x951d('0x17')]['message']);}})[_0x951d('0x18')](function(_0xe4fd53){logger[_0x951d('0x13')](_0x951d('0x10'),_0x48f40b,_0xe4fd53);_0x1c8917(_0xe4fd53);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index fef05ce..e4a3963 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 _0x242d=['show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index'];(function(_0x1a2f63,_0x3afbfd){var _0x42c42d=function(_0x562528){while(--_0x562528){_0x1a2f63['push'](_0x1a2f63['shift']());}};_0x42c42d(++_0x3afbfd);}(_0x242d,0x1b5));var _0xd242=function(_0x170b4a,_0x561ed5){_0x170b4a=_0x170b4a-0x0;var _0x4351a1=_0x242d[_0x170b4a];return _0x4351a1;};'use strict';var multer=require(_0xd242('0x0'));var util=require(_0xd242('0x1'));var path=require(_0xd242('0x2'));var timeout=require(_0xd242('0x3'));var express=require(_0xd242('0x4'));var router=express[_0xd242('0x5')]();var fs_extra=require(_0xd242('0x6'));var auth=require(_0xd242('0x7'));var interaction=require(_0xd242('0x8'));var config=require(_0xd242('0x9'));var controller=require(_0xd242('0xa'));router['get']('/',auth[_0xd242('0xb')](),controller[_0xd242('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd242('0xd')]);router[_0xd242('0xe')](_0xd242('0xf'),auth[_0xd242('0xb')](),controller[_0xd242('0x10')]);router[_0xd242('0xe')](_0xd242('0x11'),auth[_0xd242('0xb')](),controller[_0xd242('0x12')]);router[_0xd242('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd242('0x13')](_0xd242('0xf'),auth[_0xd242('0xb')](),controller[_0xd242('0x14')]);router[_0xd242('0x15')]('/:id',auth[_0xd242('0xb')](),controller['update']);router[_0xd242('0x16')](_0xd242('0x17'),auth[_0xd242('0xb')](),controller['destroy']);module[_0xd242('0x18')]=router; \ No newline at end of file +var _0xfb03=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16d1ea,_0x51f1db){var _0x3bcb5f=function(_0x103046){while(--_0x103046){_0x16d1ea['push'](_0x16d1ea['shift']());}};_0x3bcb5f(++_0x51f1db);}(_0xfb03,0x1b1));var _0x3fb0=function(_0x523369,_0x15585d){_0x523369=_0x523369-0x0;var _0x21284d=_0xfb03[_0x523369];return _0x21284d;};'use strict';var multer=require(_0x3fb0('0x0'));var util=require(_0x3fb0('0x1'));var path=require(_0x3fb0('0x2'));var timeout=require(_0x3fb0('0x3'));var express=require(_0x3fb0('0x4'));var router=express[_0x3fb0('0x5')]();var fs_extra=require(_0x3fb0('0x6'));var auth=require(_0x3fb0('0x7'));var interaction=require(_0x3fb0('0x8'));var config=require(_0x3fb0('0x9'));var controller=require('./intFreshdeskAccount.controller');router[_0x3fb0('0xa')]('/',auth[_0x3fb0('0xb')](),controller[_0x3fb0('0xc')]);router[_0x3fb0('0xa')](_0x3fb0('0xd'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0xe')]);router[_0x3fb0('0xa')](_0x3fb0('0xf'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x10')]);router[_0x3fb0('0xa')](_0x3fb0('0x11'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x12')]);router['post']('/',auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x13')]);router[_0x3fb0('0x14')](_0x3fb0('0xf'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x15')]);router['put'](_0x3fb0('0xd'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x16')]);router[_0x3fb0('0x17')](_0x3fb0('0xd'),auth[_0x3fb0('0xb')](),controller[_0x3fb0('0x18')]);module[_0x3fb0('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4fb7884..3bc28d7 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 _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x3cd285,_0x3da025){var _0x12673a=function(_0x5501f4){while(--_0x5501f4){_0x3cd285['push'](_0x3cd285['shift']());}};_0x12673a(++_0x3da025);}(_0x5464,0x15d));var _0x4546=function(_0x35ba7d,_0x1c3685){_0x35ba7d=_0x35ba7d-0x0;var _0x1beaad=_0x5464[_0x35ba7d];return _0x1beaad;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x66fa=['exports','STRING','username','remoteUri','sequelize'];(function(_0x3f12d6,_0x14cdbb){var _0x2b97e3=function(_0x18c0b3){while(--_0x18c0b3){_0x3f12d6['push'](_0x3f12d6['shift']());}};_0x2b97e3(++_0x14cdbb);}(_0x66fa,0x117));var _0xa66f=function(_0x1ec534,_0x5b5926){_0x1ec534=_0x1ec534-0x0;var _0x2679b7=_0x66fa[_0x1ec534];return _0x2679b7;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'apiKey':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'serverUrl':{'type':Sequelize[_0xa66f('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 1f8f9a5..1a22f25 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 _0xd84c=['toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','label','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s:X','apiKey'];(function(_0x1ea6c6,_0xeaa372){var _0x3c04e3=function(_0x3da708){while(--_0x3da708){_0x1ea6c6['push'](_0x1ea6c6['shift']());}};_0x3c04e3(++_0xeaa372);}(_0xd84c,0x102));var _0xcd84=function(_0x1b88a4,_0x4a704e){_0x1b88a4=_0x1b88a4-0x0;var _0x405068=_0xd84c[_0x1b88a4];return _0x405068;};'use strict';var emlformat=require(_0xcd84('0x0'));var rimraf=require(_0xcd84('0x1'));var zipdir=require(_0xcd84('0x2'));var jsonpatch=require(_0xcd84('0x3'));var rp=require(_0xcd84('0x4'));var moment=require(_0xcd84('0x5'));var BPromise=require(_0xcd84('0x6'));var Mustache=require(_0xcd84('0x7'));var util=require(_0xcd84('0x8'));var path=require('path');var sox=require(_0xcd84('0x9'));var csv=require(_0xcd84('0xa'));var ejs=require(_0xcd84('0xb'));var fs=require('fs');var fs_extra=require(_0xcd84('0xc'));var _=require('lodash');var squel=require(_0xcd84('0xd'));var crypto=require(_0xcd84('0xe'));var jsforce=require(_0xcd84('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd84('0xa'));var querystring=require(_0xcd84('0x10'));var Papa=require(_0xcd84('0x11'));var Redis=require(_0xcd84('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcd84('0x13'));var as=require(_0xcd84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd84('0x15'))(_0xcd84('0x16'));var utils=require(_0xcd84('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd84('0x18'));var db=require(_0xcd84('0x19'))['db'];var integrations=require(_0xcd84('0x1a'));function respondWithStatusCode(_0x116423,_0x4e1291){_0x4e1291=_0x4e1291||0xcc;return function(_0x222303){if(_0x222303){return _0x116423[_0xcd84('0x1b')](_0x4e1291);}return _0x116423[_0xcd84('0x1c')](_0x4e1291)[_0xcd84('0x1d')]();};}function respondWithResult(_0x1271b4,_0x100a7b){_0x100a7b=_0x100a7b||0xc8;return function(_0xea177a){if(_0xea177a){return _0x1271b4[_0xcd84('0x1c')](_0x100a7b)[_0xcd84('0x1e')](_0xea177a);}};}function respondWithFilteredResult(_0x45a92e,_0x223127){return function(_0x23b116){if(_0x23b116){var _0x1bd068=typeof _0x223127[_0xcd84('0x1f')]===_0xcd84('0x20')&&typeof _0x223127[_0xcd84('0x21')]===_0xcd84('0x20');var _0x9ddd5d=_0x23b116['count'];var _0x3c2d33=_0x1bd068?0x0:_0x223127[_0xcd84('0x1f')];var _0x4c9509=_0x1bd068?_0x23b116[_0xcd84('0x22')]:_0x223127[_0xcd84('0x1f')]+_0x223127[_0xcd84('0x21')];var _0xb4f1ee;if(_0x4c9509>=_0x9ddd5d){_0x4c9509=_0x9ddd5d;_0xb4f1ee=0xc8;}else{_0xb4f1ee=0xce;}_0x45a92e[_0xcd84('0x1c')](_0xb4f1ee);return _0x45a92e['set'](_0xcd84('0x23'),_0x3c2d33+'-'+_0x4c9509+'/'+_0x9ddd5d)[_0xcd84('0x1e')](_0x23b116);}return null;};}function patchUpdates(_0x225e15){return function(_0x53f8a0){try{jsonpatch['apply'](_0x53f8a0,_0x225e15,!![]);}catch(_0x98bf1f){return BPromise['reject'](_0x98bf1f);}return _0x53f8a0[_0xcd84('0x24')]();};}function saveUpdates(_0x20b0ce,_0x5cb006){return function(_0x454586){if(_0x454586){return _0x454586[_0xcd84('0x25')](_0x20b0ce)[_0xcd84('0x26')](function(_0x13996e){return _0x13996e;});}return null;};}function removeEntity(_0x14cf35,_0xfc2a17){return function(_0x49f7e8){if(_0x49f7e8){return _0x49f7e8[_0xcd84('0x27')]()[_0xcd84('0x26')](function(){_0x14cf35[_0xcd84('0x1c')](0xcc)[_0xcd84('0x1d')]();});}};}function handleEntityNotFound(_0x243368,_0x40d00a){return function(_0x5af4b9){if(!_0x5af4b9){_0x243368['sendStatus'](0x194);}return _0x5af4b9;};}function handleError(_0x5d610b,_0x1967f6){_0x1967f6=_0x1967f6||0x1f4;return function(_0x5c46c7){logger['error'](_0x5c46c7['stack']);if(_0x5c46c7[_0xcd84('0x28')]){delete _0x5c46c7[_0xcd84('0x28')];}_0x5d610b['status'](_0x1967f6)[_0xcd84('0x29')](_0x5c46c7);};}exports[_0xcd84('0x2a')]=function(_0x1f75ac,_0x5661a4){var _0x33fc4f={},_0x5d4bff={},_0x288cdd={'count':0x0,'rows':[]};var _0x71d465=_[_0xcd84('0x2b')](db[_0xcd84('0x2c')][_0xcd84('0x2d')],function(_0x3f10b1){return{'name':_0x3f10b1[_0xcd84('0x2e')],'type':_0x3f10b1[_0xcd84('0x2f')][_0xcd84('0x30')]};});_0x5d4bff[_0xcd84('0x31')]=_[_0xcd84('0x2b')](_0x71d465,_0xcd84('0x28'));_0x5d4bff['query']=_[_0xcd84('0x32')](_0x1f75ac[_0xcd84('0x33')]);_0x5d4bff[_0xcd84('0x34')]=_[_0xcd84('0x35')](_0x5d4bff['model'],_0x5d4bff[_0xcd84('0x33')]);_0x33fc4f[_0xcd84('0x36')]=_[_0xcd84('0x35')](_0x5d4bff[_0xcd84('0x31')],qs[_0xcd84('0x37')](_0x1f75ac['query'][_0xcd84('0x37')]));_0x33fc4f[_0xcd84('0x36')]=_0x33fc4f[_0xcd84('0x36')][_0xcd84('0x38')]?_0x33fc4f[_0xcd84('0x36')]:_0x5d4bff[_0xcd84('0x31')];if(!_0x1f75ac[_0xcd84('0x33')]['hasOwnProperty'](_0xcd84('0x39'))){_0x33fc4f[_0xcd84('0x21')]=qs['limit'](_0x1f75ac[_0xcd84('0x33')]['limit']);_0x33fc4f[_0xcd84('0x1f')]=qs[_0xcd84('0x1f')](_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x1f')]);}_0x33fc4f[_0xcd84('0x3a')]=qs[_0xcd84('0x3b')](_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x3b')]);_0x33fc4f[_0xcd84('0x3c')]=qs[_0xcd84('0x34')](_[_0xcd84('0x3d')](_0x1f75ac[_0xcd84('0x33')],_0x5d4bff[_0xcd84('0x34')]),_0x71d465);if(_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x3e')]){_0x33fc4f['where']=_[_0xcd84('0x3f')](_0x33fc4f['where'],{'$or':_['map'](_0x71d465,function(_0xa8f23e){if(_0xa8f23e[_0xcd84('0x2f')]!==_0xcd84('0x40')){var _0x4d69b={};_0x4d69b[_0xa8f23e['name']]={'$like':'%'+_0x1f75ac['query'][_0xcd84('0x3e')]+'%'};return _0x4d69b;}})});}_0x33fc4f=_['merge']({},_0x33fc4f,_0x1f75ac[_0xcd84('0x41')]);var _0x40c5a7={'where':_0x33fc4f['where']};return db[_0xcd84('0x2c')]['count'](_0x40c5a7)[_0xcd84('0x26')](function(_0x1ccee1){_0x288cdd[_0xcd84('0x22')]=_0x1ccee1;if(_0x1f75ac['query']['includeAll']){_0x33fc4f[_0xcd84('0x42')]=[{'all':!![]}];}return db[_0xcd84('0x2c')][_0xcd84('0x43')](_0x33fc4f);})[_0xcd84('0x26')](function(_0x4c119c){_0x288cdd[_0xcd84('0x44')]=_0x4c119c;return _0x288cdd;})[_0xcd84('0x26')](respondWithFilteredResult(_0x5661a4,_0x33fc4f))[_0xcd84('0x45')](handleError(_0x5661a4,null));};exports[_0xcd84('0x46')]=function(_0x3fc17d,_0x1254cd){var _0x38d17d={'raw':![],'where':{'id':_0x3fc17d[_0xcd84('0x47')]['id']}},_0xabfe95={};_0xabfe95['model']=_[_0xcd84('0x32')](db['FreshdeskAccount'][_0xcd84('0x2d')]);_0xabfe95['query']=_[_0xcd84('0x32')](_0x3fc17d[_0xcd84('0x33')]);_0xabfe95['filters']=_['intersection'](_0xabfe95[_0xcd84('0x31')],_0xabfe95[_0xcd84('0x33')]);_0x38d17d[_0xcd84('0x36')]=_['intersection'](_0xabfe95['model'],qs[_0xcd84('0x37')](_0x3fc17d['query'][_0xcd84('0x37')]));_0x38d17d[_0xcd84('0x36')]=_0x38d17d['attributes'][_0xcd84('0x38')]?_0x38d17d[_0xcd84('0x36')]:_0xabfe95['model'];if(_0x3fc17d[_0xcd84('0x33')][_0xcd84('0x48')]){_0x38d17d[_0xcd84('0x42')]=[{'all':!![]}];}_0x38d17d=_['merge']({},_0x38d17d,_0x3fc17d['options']);return db['FreshdeskAccount'][_0xcd84('0x49')](_0x38d17d)[_0xcd84('0x26')](handleEntityNotFound(_0x1254cd,null))[_0xcd84('0x26')](respondWithResult(_0x1254cd,null))[_0xcd84('0x45')](handleError(_0x1254cd,null));};exports[_0xcd84('0x4a')]=function(_0x5d44ff,_0x4da28d){return db[_0xcd84('0x2c')][_0xcd84('0x4a')](_0x5d44ff['body'],{})['then'](respondWithResult(_0x4da28d,0xc9))[_0xcd84('0x45')](handleError(_0x4da28d,null));};exports[_0xcd84('0x25')]=function(_0x1b3ee1,_0x13bcc8){if(_0x1b3ee1[_0xcd84('0x4b')]['id']){delete _0x1b3ee1[_0xcd84('0x4b')]['id'];}return db[_0xcd84('0x2c')][_0xcd84('0x49')]({'where':{'id':_0x1b3ee1[_0xcd84('0x47')]['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x13bcc8,null))[_0xcd84('0x26')](saveUpdates(_0x1b3ee1['body'],null))[_0xcd84('0x26')](respondWithResult(_0x13bcc8,null))['catch'](handleError(_0x13bcc8,null));};exports[_0xcd84('0x27')]=function(_0x4c50df,_0x1e131a){return db['FreshdeskAccount'][_0xcd84('0x49')]({'where':{'id':_0x4c50df['params']['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x1e131a,null))[_0xcd84('0x26')](removeEntity(_0x1e131a,null))['catch'](handleError(_0x1e131a,null));};exports[_0xcd84('0x4c')]=function(_0x268fe5,_0x216c9,_0x5a3496){var _0x4c6c46={};var _0x402595={};var _0x3899dc;var _0x4f8e02;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x268fe5['params']['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x216c9,null))[_0xcd84('0x26')](function(_0x8ae28f){if(_0x8ae28f){_0x3899dc=_0x8ae28f;_0x402595['model']=_[_0xcd84('0x32')](db[_0xcd84('0x4d')][_0xcd84('0x2d')]);_0x402595[_0xcd84('0x33')]=_[_0xcd84('0x32')](_0x268fe5[_0xcd84('0x33')]);_0x402595[_0xcd84('0x34')]=_[_0xcd84('0x35')](_0x402595[_0xcd84('0x31')],_0x402595[_0xcd84('0x33')]);_0x4c6c46[_0xcd84('0x36')]=_[_0xcd84('0x35')](_0x402595[_0xcd84('0x31')],qs[_0xcd84('0x37')](_0x268fe5[_0xcd84('0x33')][_0xcd84('0x37')]));_0x4c6c46[_0xcd84('0x36')]=_0x4c6c46[_0xcd84('0x36')][_0xcd84('0x38')]?_0x4c6c46['attributes']:_0x402595[_0xcd84('0x31')];_0x4c6c46[_0xcd84('0x3a')]=qs[_0xcd84('0x3b')](_0x268fe5['query'][_0xcd84('0x3b')]);_0x4c6c46[_0xcd84('0x3c')]=qs[_0xcd84('0x34')](_[_0xcd84('0x3d')](_0x268fe5[_0xcd84('0x33')],_0x402595['filters']));if(_0x268fe5[_0xcd84('0x33')][_0xcd84('0x3e')]){_0x4c6c46[_0xcd84('0x3c')]=_[_0xcd84('0x3f')](_0x4c6c46[_0xcd84('0x3c')],{'$or':_['map'](_0x4c6c46[_0xcd84('0x36')],function(_0x325da1){var _0x452329={};_0x452329[_0x325da1]={'$like':'%'+_0x268fe5['query'][_0xcd84('0x3e')]+'%'};return _0x452329;})});}_0x4c6c46=_[_0xcd84('0x3f')]({},_0x4c6c46,_0x268fe5[_0xcd84('0x41')]);return _0x3899dc['getConfigurations'](_0x4c6c46);}})[_0xcd84('0x26')](function(_0x504918){if(_0x504918){_0x4f8e02=_0x504918[_0xcd84('0x38')];if(!_0x268fe5[_0xcd84('0x33')][_0xcd84('0x4e')]('nolimit')){_0x4c6c46[_0xcd84('0x21')]=qs[_0xcd84('0x21')](_0x268fe5[_0xcd84('0x33')][_0xcd84('0x21')]);_0x4c6c46[_0xcd84('0x1f')]=qs[_0xcd84('0x1f')](_0x268fe5['query']['offset']);}return _0x3899dc['getConfigurations'](_0x4c6c46);}})[_0xcd84('0x26')](function(_0x387c8f){if(_0x387c8f){return _0x387c8f?{'count':_0x4f8e02,'rows':_0x387c8f}:null;}})[_0xcd84('0x26')](respondWithResult(_0x216c9,null))[_0xcd84('0x45')](handleError(_0x216c9,null));};exports[_0xcd84('0x4f')]=function(_0x4ab032,_0x4e4f10,_0x58cdfd){if(_0x4ab032[_0xcd84('0x4b')]['id']){delete _0x4ab032[_0xcd84('0x4b')]['id'];}return db[_0xcd84('0x2c')][_0xcd84('0x50')]({'where':{'id':_0x4ab032[_0xcd84('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e4f10,null))['then'](function(_0xcc39ca){if(_0xcc39ca){_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x51')]=_0xcc39ca['id'];_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x52')]=integrations[_0xcd84('0x53')](_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x54')],_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x2f')]);_0x4ab032['body'][_0xcd84('0x55')]=integrations[_0xcd84('0x56')](_0x4ab032['body'][_0xcd84('0x54')],_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x2f')]);return db[_0xcd84('0x4d')][_0xcd84('0x4a')](_0x4ab032[_0xcd84('0x4b')],{'include':[{'model':db[_0xcd84('0x57')],'as':_0xcd84('0x52')},{'model':db[_0xcd84('0x57')],'as':_0xcd84('0x55')}]});}return null;})[_0xcd84('0x26')](respondWithResult(_0x4e4f10,null))[_0xcd84('0x45')](handleError(_0x4e4f10,null));};exports[_0xcd84('0x58')]=function(_0x4e8536,_0x4b476e,_0x300cf7){var _0x273be1='';return db['FreshdeskAccount'][_0xcd84('0x50')]({'where':{'id':_0x4e8536[_0xcd84('0x47')]['id']},'attributes':['id',_0xcd84('0x59'),'apiKey']})['then'](handleEntityNotFound(_0x4b476e,null))['then'](function(_0x165a66){if(_0x165a66){_0x273be1=_0x165a66[_0xcd84('0x59')];var _0x1b7464=_0x273be1[_0xcd84('0x5a')](-0x1);if(_0x1b7464==='/'){_0x273be1=_0x273be1['substring'](0x0,_0x273be1[_0xcd84('0x5b')](_0x1b7464));}return rp({'method':_0xcd84('0x5c'),'uri':util['format']('%s/%s',_0x273be1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xcd84('0x5d')]('Basic\x20%s',new Buffer(util[_0xcd84('0x5d')](_0xcd84('0x5e'),_0x165a66[_0xcd84('0x5f')]))[_0xcd84('0x60')](_0xcd84('0x61')))},'json':!![]});}})[_0xcd84('0x26')](function(_0xcf40cb){if(_0xcf40cb){var _0x1208d5=['requester',_0xcd84('0x62'),_0xcd84('0x63'),_0xcd84('0x64'),_0xcd84('0x1c'),_0xcd84('0x65'),_0xcd84('0x66'),_0xcd84('0x67'),_0xcd84('0x68'),_0xcd84('0x66'),_0xcd84('0x69')];_[_0xcd84('0x6a')](_0xcf40cb,function(_0x1bbcbf){return _0x1208d5[_0xcd84('0x6b')](_0x1bbcbf[_0xcd84('0x28')])||!_0x1bbcbf[_0xcd84('0x6c')]&&_0x1bbcbf[_0xcd84('0x2f')]!==_0xcd84('0x6d')&&_0x1bbcbf[_0xcd84('0x2f')]!=='custom_dropdown';});return{'count':_0xcf40cb['length'],'rows':_[_0xcd84('0x2b')](_0xcf40cb,function(_0xe94bff){return{'id':_0xe94bff['name'],'name':_0xe94bff[_0xcd84('0x6e')],'custom':!_0xe94bff[_0xcd84('0x6c')],'options':_0xe94bff[_0xcd84('0x6f')]?_[_0xcd84('0x2b')](_0xe94bff['choices'],function(_0x187057){return{'name':_[_0xcd84('0x70')](_0x187057),'value':_0x187057};}):[]};})};}})[_0xcd84('0x26')](respondWithResult(_0x4b476e,null))[_0xcd84('0x45')](function(_0x1b825f){var _0x43df4d=_0x4e8536['query'][_0xcd84('0x71')]?0x1f4:_0x1b825f['statusCode']||0x1f4;logger[_0xcd84('0x72')](_0xcd84('0x73'),_0xcd84('0x58'),_0x43df4d,JSON['stringify'](_0x1b825f));delete _0x1b825f['name'];if(_0x43df4d===0x191){_0x43df4d=0x190;}_0x4b476e['status'](_0x43df4d)['send'](_0x4e8536[_0xcd84('0x33')][_0xcd84('0x71')]?{'message':_0xcd84('0x74'),'statusCode':_0x1b825f[_0xcd84('0x75')]}:_0x1b825f);});}; \ No newline at end of file +var _0xcea2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','catch','create','body','find','findOne','FreshdeskConfiguration','pick','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x479d51,_0x19218e){var _0x3b47cf=function(_0x5159d1){while(--_0x5159d1){_0x479d51['push'](_0x479d51['shift']());}};_0x3b47cf(++_0x19218e);}(_0xcea2,0x15a));var _0x2cea=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xcea2[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x2cea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cea('0x2'));var moment=require(_0x2cea('0x3'));var BPromise=require(_0x2cea('0x4'));var Mustache=require('mustache');var util=require(_0x2cea('0x5'));var path=require(_0x2cea('0x6'));var sox=require(_0x2cea('0x7'));var csv=require('to-csv');var ejs=require(_0x2cea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0xe'));var querystring=require('querystring');var Papa=require(_0x2cea('0xf'));var Redis=require(_0x2cea('0x10'));var authService=require(_0x2cea('0x11'));var qs=require(_0x2cea('0x12'));var as=require(_0x2cea('0x13'));var hardwareService=require(_0x2cea('0x14'));var logger=require(_0x2cea('0x15'))(_0x2cea('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cea('0x17'));var db=require(_0x2cea('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4bd265,_0x160eaf){_0x160eaf=_0x160eaf||0xcc;return function(_0x4e0da7){if(_0x4e0da7){return _0x4bd265[_0x2cea('0x19')](_0x160eaf);}return _0x4bd265[_0x2cea('0x1a')](_0x160eaf)[_0x2cea('0x1b')]();};}function respondWithResult(_0x5cf805,_0x4d7f8b){_0x4d7f8b=_0x4d7f8b||0xc8;return function(_0x578c3e){if(_0x578c3e){return _0x5cf805[_0x2cea('0x1a')](_0x4d7f8b)['json'](_0x578c3e);}};}function respondWithFilteredResult(_0x3c7130,_0x338669){return function(_0x981e3f){if(_0x981e3f){var _0x17322c=typeof _0x338669[_0x2cea('0x1c')]===_0x2cea('0x1d')&&typeof _0x338669[_0x2cea('0x1e')]===_0x2cea('0x1d');var _0x5eee09=_0x981e3f[_0x2cea('0x1f')];var _0x464f7d=_0x17322c?0x0:_0x338669[_0x2cea('0x1c')];var _0x43ae15=_0x17322c?_0x981e3f[_0x2cea('0x1f')]:_0x338669[_0x2cea('0x1c')]+_0x338669['limit'];var _0x27375b;if(_0x43ae15>=_0x5eee09){_0x43ae15=_0x5eee09;_0x27375b=0xc8;}else{_0x27375b=0xce;}_0x3c7130['status'](_0x27375b);return _0x3c7130[_0x2cea('0x20')](_0x2cea('0x21'),_0x464f7d+'-'+_0x43ae15+'/'+_0x5eee09)[_0x2cea('0x22')](_0x981e3f);}return null;};}function patchUpdates(_0x4fd3d5){return function(_0x46a112){try{jsonpatch[_0x2cea('0x23')](_0x46a112,_0x4fd3d5,!![]);}catch(_0x210d7e){return BPromise[_0x2cea('0x24')](_0x210d7e);}return _0x46a112[_0x2cea('0x25')]();};}function saveUpdates(_0x3f6f0e,_0x10f13a){return function(_0x566ce2){if(_0x566ce2){return _0x566ce2[_0x2cea('0x26')](_0x3f6f0e)['then'](function(_0x7d88b9){return _0x7d88b9;});}return null;};}function removeEntity(_0x4926ff,_0x3966d5){return function(_0x18a394){if(_0x18a394){return _0x18a394['destroy']()[_0x2cea('0x27')](function(){_0x4926ff[_0x2cea('0x1a')](0xcc)[_0x2cea('0x1b')]();});}};}function handleEntityNotFound(_0xf0bfbe,_0x3f3ee0){return function(_0x79529b){if(!_0x79529b){_0xf0bfbe['sendStatus'](0x194);}return _0x79529b;};}function handleError(_0x4ec9b3,_0x32b6a3){_0x32b6a3=_0x32b6a3||0x1f4;return function(_0x2bbe9b){logger[_0x2cea('0x28')](_0x2bbe9b[_0x2cea('0x29')]);if(_0x2bbe9b[_0x2cea('0x2a')]){delete _0x2bbe9b[_0x2cea('0x2a')];}_0x4ec9b3[_0x2cea('0x1a')](_0x32b6a3)['send'](_0x2bbe9b);};}exports[_0x2cea('0x2b')]=function(_0x128863,_0x5f3fb4){var _0xfeb8bd={},_0xc398c5={},_0x271b2f={'count':0x0,'rows':[]};var _0x16cf9f=_['map'](db[_0x2cea('0x2c')][_0x2cea('0x2d')],function(_0x4a51e5){return{'name':_0x4a51e5[_0x2cea('0x2e')],'type':_0x4a51e5[_0x2cea('0x2f')][_0x2cea('0x30')]};});_0xc398c5[_0x2cea('0x31')]=_[_0x2cea('0x32')](_0x16cf9f,_0x2cea('0x2a'));_0xc398c5[_0x2cea('0x33')]=_[_0x2cea('0x34')](_0x128863[_0x2cea('0x33')]);_0xc398c5[_0x2cea('0x35')]=_[_0x2cea('0x36')](_0xc398c5['model'],_0xc398c5[_0x2cea('0x33')]);_0xfeb8bd[_0x2cea('0x37')]=_[_0x2cea('0x36')](_0xc398c5[_0x2cea('0x31')],qs['fields'](_0x128863['query'][_0x2cea('0x38')]));_0xfeb8bd[_0x2cea('0x37')]=_0xfeb8bd['attributes'][_0x2cea('0x39')]?_0xfeb8bd['attributes']:_0xc398c5[_0x2cea('0x31')];if(!_0x128863['query'][_0x2cea('0x3a')]('nolimit')){_0xfeb8bd[_0x2cea('0x1e')]=qs[_0x2cea('0x1e')](_0x128863['query'][_0x2cea('0x1e')]);_0xfeb8bd[_0x2cea('0x1c')]=qs['offset'](_0x128863[_0x2cea('0x33')][_0x2cea('0x1c')]);}_0xfeb8bd[_0x2cea('0x3b')]=qs[_0x2cea('0x3c')](_0x128863[_0x2cea('0x33')]['sort']);_0xfeb8bd[_0x2cea('0x3d')]=qs[_0x2cea('0x35')](_['pick'](_0x128863['query'],_0xc398c5[_0x2cea('0x35')]),_0x16cf9f);if(_0x128863['query']['filter']){_0xfeb8bd['where']=_['merge'](_0xfeb8bd[_0x2cea('0x3d')],{'$or':_[_0x2cea('0x32')](_0x16cf9f,function(_0x53d597){if(_0x53d597[_0x2cea('0x2f')]!==_0x2cea('0x3e')){var _0x249aaa={};_0x249aaa[_0x53d597['name']]={'$like':'%'+_0x128863[_0x2cea('0x33')][_0x2cea('0x3f')]+'%'};return _0x249aaa;}})});}_0xfeb8bd=_[_0x2cea('0x40')]({},_0xfeb8bd,_0x128863[_0x2cea('0x41')]);var _0x167e40={'where':_0xfeb8bd[_0x2cea('0x3d')]};return db[_0x2cea('0x2c')][_0x2cea('0x1f')](_0x167e40)[_0x2cea('0x27')](function(_0x27677c){_0x271b2f[_0x2cea('0x1f')]=_0x27677c;if(_0x128863[_0x2cea('0x33')][_0x2cea('0x42')]){_0xfeb8bd[_0x2cea('0x43')]=[{'all':!![]}];}return db[_0x2cea('0x2c')][_0x2cea('0x44')](_0xfeb8bd);})[_0x2cea('0x27')](function(_0xa0692d){_0x271b2f['rows']=_0xa0692d;return _0x271b2f;})[_0x2cea('0x27')](respondWithFilteredResult(_0x5f3fb4,_0xfeb8bd))['catch'](handleError(_0x5f3fb4,null));};exports[_0x2cea('0x45')]=function(_0x1afbb9,_0x22ce6b){var _0x5b5d71={'raw':![],'where':{'id':_0x1afbb9[_0x2cea('0x46')]['id']}},_0x2c703b={};_0x2c703b[_0x2cea('0x31')]=_[_0x2cea('0x34')](db[_0x2cea('0x2c')][_0x2cea('0x2d')]);_0x2c703b['query']=_['keys'](_0x1afbb9[_0x2cea('0x33')]);_0x2c703b[_0x2cea('0x35')]=_['intersection'](_0x2c703b[_0x2cea('0x31')],_0x2c703b['query']);_0x5b5d71[_0x2cea('0x37')]=_['intersection'](_0x2c703b[_0x2cea('0x31')],qs[_0x2cea('0x38')](_0x1afbb9[_0x2cea('0x33')][_0x2cea('0x38')]));_0x5b5d71[_0x2cea('0x37')]=_0x5b5d71[_0x2cea('0x37')][_0x2cea('0x39')]?_0x5b5d71[_0x2cea('0x37')]:_0x2c703b[_0x2cea('0x31')];if(_0x1afbb9[_0x2cea('0x33')]['includeAll']){_0x5b5d71[_0x2cea('0x43')]=[{'all':!![]}];}_0x5b5d71=_[_0x2cea('0x40')]({},_0x5b5d71,_0x1afbb9[_0x2cea('0x41')]);return db[_0x2cea('0x2c')]['find'](_0x5b5d71)['then'](handleEntityNotFound(_0x22ce6b,null))[_0x2cea('0x27')](respondWithResult(_0x22ce6b,null))[_0x2cea('0x47')](handleError(_0x22ce6b,null));};exports[_0x2cea('0x48')]=function(_0x510e0f,_0x2a5e20){return db[_0x2cea('0x2c')][_0x2cea('0x48')](_0x510e0f[_0x2cea('0x49')],{})['then'](respondWithResult(_0x2a5e20,0xc9))[_0x2cea('0x47')](handleError(_0x2a5e20,null));};exports['update']=function(_0x4d1b77,_0x42379a){if(_0x4d1b77[_0x2cea('0x49')]['id']){delete _0x4d1b77[_0x2cea('0x49')]['id'];}return db[_0x2cea('0x2c')]['find']({'where':{'id':_0x4d1b77['params']['id']}})[_0x2cea('0x27')](handleEntityNotFound(_0x42379a,null))[_0x2cea('0x27')](saveUpdates(_0x4d1b77[_0x2cea('0x49')],null))[_0x2cea('0x27')](respondWithResult(_0x42379a,null))['catch'](handleError(_0x42379a,null));};exports['destroy']=function(_0x5d7cb6,_0x31c559){return db[_0x2cea('0x2c')][_0x2cea('0x4a')]({'where':{'id':_0x5d7cb6[_0x2cea('0x46')]['id']}})[_0x2cea('0x27')](handleEntityNotFound(_0x31c559,null))[_0x2cea('0x27')](removeEntity(_0x31c559,null))[_0x2cea('0x47')](handleError(_0x31c559,null));};exports['getConfigurations']=function(_0x3f0fd0,_0x39937e,_0x3ccb9f){var _0x4b9f75={};var _0x103f18={};var _0x59dbbe;var _0x471147;return db[_0x2cea('0x2c')][_0x2cea('0x4b')]({'where':{'id':_0x3f0fd0[_0x2cea('0x46')]['id']}})[_0x2cea('0x27')](handleEntityNotFound(_0x39937e,null))[_0x2cea('0x27')](function(_0x33f411){if(_0x33f411){_0x59dbbe=_0x33f411;_0x103f18[_0x2cea('0x31')]=_['keys'](db[_0x2cea('0x4c')]['rawAttributes']);_0x103f18[_0x2cea('0x33')]=_[_0x2cea('0x34')](_0x3f0fd0[_0x2cea('0x33')]);_0x103f18['filters']=_[_0x2cea('0x36')](_0x103f18['model'],_0x103f18['query']);_0x4b9f75[_0x2cea('0x37')]=_[_0x2cea('0x36')](_0x103f18[_0x2cea('0x31')],qs[_0x2cea('0x38')](_0x3f0fd0[_0x2cea('0x33')]['fields']));_0x4b9f75['attributes']=_0x4b9f75[_0x2cea('0x37')][_0x2cea('0x39')]?_0x4b9f75[_0x2cea('0x37')]:_0x103f18[_0x2cea('0x31')];_0x4b9f75['order']=qs[_0x2cea('0x3c')](_0x3f0fd0['query'][_0x2cea('0x3c')]);_0x4b9f75[_0x2cea('0x3d')]=qs[_0x2cea('0x35')](_[_0x2cea('0x4d')](_0x3f0fd0[_0x2cea('0x33')],_0x103f18['filters']));if(_0x3f0fd0[_0x2cea('0x33')][_0x2cea('0x3f')]){_0x4b9f75[_0x2cea('0x3d')]=_[_0x2cea('0x40')](_0x4b9f75[_0x2cea('0x3d')],{'$or':_['map'](_0x4b9f75[_0x2cea('0x37')],function(_0x469601){var _0x511aa1={};_0x511aa1[_0x469601]={'$like':'%'+_0x3f0fd0[_0x2cea('0x33')][_0x2cea('0x3f')]+'%'};return _0x511aa1;})});}_0x4b9f75=_[_0x2cea('0x40')]({},_0x4b9f75,_0x3f0fd0[_0x2cea('0x41')]);return _0x59dbbe['getConfigurations'](_0x4b9f75);}})['then'](function(_0x1c53bf){if(_0x1c53bf){_0x471147=_0x1c53bf[_0x2cea('0x39')];if(!_0x3f0fd0['query'][_0x2cea('0x3a')](_0x2cea('0x4e'))){_0x4b9f75['limit']=qs[_0x2cea('0x1e')](_0x3f0fd0[_0x2cea('0x33')][_0x2cea('0x1e')]);_0x4b9f75[_0x2cea('0x1c')]=qs[_0x2cea('0x1c')](_0x3f0fd0['query'][_0x2cea('0x1c')]);}return _0x59dbbe[_0x2cea('0x4f')](_0x4b9f75);}})['then'](function(_0x28f6d8){if(_0x28f6d8){return _0x28f6d8?{'count':_0x471147,'rows':_0x28f6d8}:null;}})[_0x2cea('0x27')](respondWithResult(_0x39937e,null))[_0x2cea('0x47')](handleError(_0x39937e,null));};exports[_0x2cea('0x50')]=function(_0x36cc18,_0x2f37bc,_0xa57e5c){if(_0x36cc18[_0x2cea('0x49')]['id']){delete _0x36cc18[_0x2cea('0x49')]['id'];}return db[_0x2cea('0x2c')][_0x2cea('0x4b')]({'where':{'id':_0x36cc18[_0x2cea('0x46')]['id']}})[_0x2cea('0x27')](handleEntityNotFound(_0x2f37bc,null))['then'](function(_0x5c81b4){if(_0x5c81b4){_0x36cc18[_0x2cea('0x49')][_0x2cea('0x51')]=_0x5c81b4['id'];_0x36cc18[_0x2cea('0x49')][_0x2cea('0x52')]=integrations[_0x2cea('0x53')](_0x36cc18[_0x2cea('0x49')][_0x2cea('0x54')],_0x36cc18['body']['type']);_0x36cc18[_0x2cea('0x49')][_0x2cea('0x55')]=integrations[_0x2cea('0x56')](_0x36cc18['body']['channel'],_0x36cc18['body'][_0x2cea('0x2f')]);return db[_0x2cea('0x4c')]['create'](_0x36cc18['body'],{'include':[{'model':db[_0x2cea('0x57')],'as':_0x2cea('0x52')},{'model':db[_0x2cea('0x57')],'as':_0x2cea('0x55')}]});}return null;})[_0x2cea('0x27')](respondWithResult(_0x2f37bc,null))[_0x2cea('0x47')](handleError(_0x2f37bc,null));};exports[_0x2cea('0x58')]=function(_0x3a1242,_0x520061,_0x3c7055){var _0x4080bf='';return db[_0x2cea('0x2c')][_0x2cea('0x4b')]({'where':{'id':_0x3a1242[_0x2cea('0x46')]['id']},'attributes':['id','remoteUri',_0x2cea('0x59')]})[_0x2cea('0x27')](handleEntityNotFound(_0x520061,null))['then'](function(_0x10419c){if(_0x10419c){_0x4080bf=_0x10419c[_0x2cea('0x5a')];var _0xaeeba5=_0x4080bf[_0x2cea('0x5b')](-0x1);if(_0xaeeba5==='/'){_0x4080bf=_0x4080bf['substring'](0x0,_0x4080bf[_0x2cea('0x5c')](_0xaeeba5));}return rp({'method':_0x2cea('0x5d'),'uri':util[_0x2cea('0x5e')]('%s/%s',_0x4080bf,_0x2cea('0x5f')),'headers':{'Authorization':util[_0x2cea('0x5e')](_0x2cea('0x60'),new Buffer(util[_0x2cea('0x5e')](_0x2cea('0x61'),_0x10419c[_0x2cea('0x59')]))[_0x2cea('0x62')](_0x2cea('0x63')))},'json':!![]});}})[_0x2cea('0x27')](function(_0x4d9c3b){if(_0x4d9c3b){var _0x1112c6=[_0x2cea('0x64'),_0x2cea('0x65'),_0x2cea('0x66'),'description',_0x2cea('0x1a'),_0x2cea('0x67'),_0x2cea('0x68'),_0x2cea('0x69'),'ticket_type',_0x2cea('0x68'),_0x2cea('0x6a')];_[_0x2cea('0x6b')](_0x4d9c3b,function(_0x2ae3f1){return _0x1112c6[_0x2cea('0x6c')](_0x2ae3f1[_0x2cea('0x2a')])||!_0x2ae3f1[_0x2cea('0x6d')]&&_0x2ae3f1[_0x2cea('0x2f')]!==_0x2cea('0x6e')&&_0x2ae3f1[_0x2cea('0x2f')]!==_0x2cea('0x6f');});return{'count':_0x4d9c3b[_0x2cea('0x39')],'rows':_[_0x2cea('0x32')](_0x4d9c3b,function(_0x1efbd1){return{'id':_0x1efbd1['name'],'name':_0x1efbd1[_0x2cea('0x70')],'custom':!_0x1efbd1['default'],'options':_0x1efbd1[_0x2cea('0x71')]?_[_0x2cea('0x32')](_0x1efbd1[_0x2cea('0x71')],function(_0x3058ed){return{'name':_[_0x2cea('0x72')](_0x3058ed),'value':_0x3058ed};}):[]};})};}})['then'](respondWithResult(_0x520061,null))[_0x2cea('0x47')](function(_0x4ac911){var _0x5ddfba=_0x3a1242[_0x2cea('0x33')][_0x2cea('0x73')]?0x1f4:_0x4ac911[_0x2cea('0x74')]||0x1f4;logger['error'](_0x2cea('0x75'),_0x2cea('0x58'),_0x5ddfba,JSON[_0x2cea('0x76')](_0x4ac911));delete _0x4ac911[_0x2cea('0x2a')];if(_0x5ddfba===0x191){_0x5ddfba=0x190;}_0x520061['status'](_0x5ddfba)[_0x2cea('0x77')](_0x3a1242[_0x2cea('0x33')]['test']?{'message':_0x2cea('0x78'),'statusCode':_0x4ac911[_0x2cea('0x74')]}:_0x4ac911);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 10ee089..3e753b9 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 _0x7bf8=['path','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0x7bf8,0x156));var _0x87bf=function(_0x13086d,_0x4fce98){_0x13086d=_0x13086d-0x0;var _0x4b5d5b=_0x7bf8[_0x13086d];return _0x4b5d5b;};'use strict';var _=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var logger=require('../../config/logger')(_0x87bf('0x2'));var moment=require(_0x87bf('0x3'));var BPromise=require(_0x87bf('0x4'));var rp=require(_0x87bf('0x5'));var fs=require('fs');var path=require(_0x87bf('0x6'));var rimraf=require('rimraf');var config=require(_0x87bf('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x87bf('0x8'));module[_0x87bf('0x9')]=function(_0x2a1111,_0x154899){return _0x2a1111['define'](_0x87bf('0xa'),attributes,{'tableName':_0x87bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0146=['int_freshdesk_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0146,0xc4));var _0x6014=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0x0146[_0x1cb0b4];return _0x525b60;};'use strict';var _=require(_0x6014('0x0'));var util=require(_0x6014('0x1'));var logger=require(_0x6014('0x2'))('api');var moment=require(_0x6014('0x3'));var BPromise=require('bluebird');var rp=require(_0x6014('0x4'));var fs=require('fs');var path=require(_0x6014('0x5'));var rimraf=require(_0x6014('0x6'));var config=require(_0x6014('0x7'));var attributes=require(_0x6014('0x8'));var integrations=require(_0x6014('0x9'));module['exports']=function(_0xae0813,_0x5c5a7b){return _0xae0813[_0x6014('0xa')](_0x6014('0xb'),attributes,{'tableName':_0x6014('0xc'),'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 0bc630d..5dafc4b 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 _0x245c=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshdeskAccount','find','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x290ca9,_0xd26e8c){var _0x5c2fa2=function(_0x12e894){while(--_0x12e894){_0x290ca9['push'](_0x290ca9['shift']());}};_0x5c2fa2(++_0xd26e8c);}(_0x245c,0x10a));var _0xc245=function(_0x809c44,_0x23d0e9){_0x809c44=_0x809c44-0x0;var _0x493668=_0x245c[_0x809c44];return _0x493668;};'use strict';var _=require('lodash');var util=require(_0xc245('0x0'));var moment=require('moment');var BPromise=require(_0xc245('0x1'));var rs=require(_0xc245('0x2'));var fs=require('fs');var Redis=require(_0xc245('0x3'));var db=require(_0xc245('0x4'))['db'];var utils=require(_0xc245('0x5'));var logger=require(_0xc245('0x6'))(_0xc245('0x7'));var config=require(_0xc245('0x8'));var jayson=require(_0xc245('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b250d,_0x29072e,_0x141f20){return new BPromise(function(_0x417b9b,_0x5397ca){return client[_0xc245('0xa')](_0x5b250d,_0x141f20)[_0xc245('0xb')](function(_0x55f513){logger[_0xc245('0xc')](_0xc245('0xd'),_0x29072e,_0xc245('0xe'));logger[_0xc245('0xf')](_0xc245('0x10'),_0x29072e,_0xc245('0xe'),JSON[_0xc245('0x11')](_0x55f513));if(_0x55f513[_0xc245('0x12')]){if(_0x55f513[_0xc245('0x12')][_0xc245('0x13')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x29072e,_0x55f513[_0xc245('0x12')][_0xc245('0x14')]);return _0x5397ca(_0x55f513[_0xc245('0x12')][_0xc245('0x14')]);}logger['error'](_0xc245('0xd'),_0x29072e,_0x55f513[_0xc245('0x12')][_0xc245('0x14')]);return _0x417b9b(_0x55f513[_0xc245('0x12')][_0xc245('0x14')]);}else{logger[_0xc245('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x29072e,'request\x20sent');_0x417b9b(_0x55f513['result'][_0xc245('0x14')]);}})[_0xc245('0x15')](function(_0x10c956){logger['error'](_0xc245('0xd'),_0x29072e,_0x10c956);_0x5397ca(_0x10c956);});});}exports[_0xc245('0x16')]=function(_0x9d95a7){var _0x19c56e=this;return new Promise(function(_0x19c553,_0x42fc3e){return db[_0xc245('0x17')][_0xc245('0x18')]({'raw':_0x9d95a7[_0xc245('0x19')]?_0x9d95a7[_0xc245('0x19')][_0xc245('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d95a7[_0xc245('0x19')]?_0x9d95a7[_0xc245('0x19')]['where']||null:null,'attributes':_0x9d95a7[_0xc245('0x19')]?_0x9d95a7[_0xc245('0x19')][_0xc245('0x1b')]||null:null,'limit':_0x9d95a7[_0xc245('0x19')]?_0x9d95a7[_0xc245('0x19')][_0xc245('0x1c')]||null:null,'include':_0x9d95a7[_0xc245('0x19')]?_0x9d95a7['options'][_0xc245('0x1d')]?_[_0xc245('0x1e')](_0x9d95a7['options']['include'],function(_0x1b8e2c){return{'model':db[_0x1b8e2c['model']],'as':_0x1b8e2c['as'],'attributes':_0x1b8e2c['attributes'],'include':_0x1b8e2c[_0xc245('0x1d')]?_[_0xc245('0x1e')](_0x1b8e2c[_0xc245('0x1d')],function(_0x3e82a6){return{'model':db[_0x3e82a6['model']],'as':_0x3e82a6['as'],'attributes':_0x3e82a6['attributes'],'include':_0x3e82a6[_0xc245('0x1d')]?_[_0xc245('0x1e')](_0x3e82a6[_0xc245('0x1d')],function(_0x51d5f6){return{'model':db[_0x51d5f6[_0xc245('0x1f')]],'as':_0x51d5f6['as'],'attributes':_0x51d5f6[_0xc245('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc245('0xb')](function(_0x1f2ffb){logger[_0xc245('0xc')](_0xc245('0x16'),_0x9d95a7);logger['debug'](_0xc245('0x16'),_0x9d95a7,JSON['stringify'](_0x1f2ffb));_0x19c553(_0x1f2ffb);})[_0xc245('0x15')](function(_0x22cc23){logger[_0xc245('0x12')](_0xc245('0x16'),_0x22cc23[_0xc245('0x14')],_0x9d95a7);_0x42fc3e(_0x19c56e['error'](0x1f4,_0x22cc23[_0xc245('0x14')]));});});};exports[_0xc245('0x20')]=function(_0x118fa9){var _0x5bebad=this;return new Promise(function(_0x61c134,_0x3e5b53){return db['FreshdeskAccount'][_0xc245('0x21')]({'raw':_0x118fa9['options']?_0x118fa9['options'][_0xc245('0x1a')]===undefined?!![]:![]:!![],'where':_0x118fa9[_0xc245('0x19')]?_0x118fa9[_0xc245('0x19')][_0xc245('0x22')]||null:null,'attributes':_0x118fa9[_0xc245('0x19')]?_0x118fa9['options'][_0xc245('0x1b')]||null:null,'include':_0x118fa9[_0xc245('0x19')]?_0x118fa9[_0xc245('0x19')][_0xc245('0x1d')]?_[_0xc245('0x1e')](_0x118fa9[_0xc245('0x19')][_0xc245('0x1d')],function(_0x29ae46){return{'model':db[_0x29ae46[_0xc245('0x1f')]],'as':_0x29ae46['as'],'attributes':_0x29ae46[_0xc245('0x1b')],'include':_0x29ae46[_0xc245('0x1d')]?_[_0xc245('0x1e')](_0x29ae46[_0xc245('0x1d')],function(_0x5ba385){return{'model':db[_0x5ba385[_0xc245('0x1f')]],'as':_0x5ba385['as'],'attributes':_0x5ba385[_0xc245('0x1b')],'include':_0x5ba385['include']?_[_0xc245('0x1e')](_0x5ba385['include'],function(_0xe6a1cf){return{'model':db[_0xe6a1cf[_0xc245('0x1f')]],'as':_0xe6a1cf['as'],'attributes':_0xe6a1cf[_0xc245('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc245('0xb')](function(_0x36f089){logger[_0xc245('0xc')](_0xc245('0x20'),_0x118fa9);logger[_0xc245('0xf')](_0xc245('0x20'),_0x118fa9,JSON[_0xc245('0x11')](_0x36f089));_0x61c134(_0x36f089);})[_0xc245('0x15')](function(_0x130fca){logger[_0xc245('0x12')](_0xc245('0x20'),_0x130fca[_0xc245('0x14')],_0x118fa9);_0x3e5b53(_0x5bebad[_0xc245('0x12')](0x1f4,_0x130fca['message']));});});}; \ No newline at end of file +var _0xdae0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','options','raw','where','limit','include','model','attributes','then','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','map','lodash','util','moment','randomstring'];(function(_0x4238ca,_0x3cfb28){var _0x499200=function(_0x183ce8){while(--_0x183ce8){_0x4238ca['push'](_0x4238ca['shift']());}};_0x499200(++_0x3cfb28);}(_0xdae0,0x15a));var _0x0dae=function(_0x11d890,_0x5b2fc1){_0x11d890=_0x11d890-0x0;var _0x533d6f=_0xdae0[_0x11d890];return _0x533d6f;};'use strict';var _=require(_0x0dae('0x0'));var util=require(_0x0dae('0x1'));var moment=require(_0x0dae('0x2'));var BPromise=require('bluebird');var rs=require(_0x0dae('0x3'));var fs=require('fs');var Redis=require(_0x0dae('0x4'));var db=require(_0x0dae('0x5'))['db'];var utils=require(_0x0dae('0x6'));var logger=require(_0x0dae('0x7'))(_0x0dae('0x8'));var config=require(_0x0dae('0x9'));var jayson=require(_0x0dae('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1bb6,_0x530f72,_0x1e23d3){return new BPromise(function(_0x575b05,_0x2caaea){return client['request'](_0x5c1bb6,_0x1e23d3)['then'](function(_0x1396bf){logger[_0x0dae('0xb')](_0x0dae('0xc'),_0x530f72,_0x0dae('0xd'));logger[_0x0dae('0xe')](_0x0dae('0xf'),_0x530f72,_0x0dae('0xd'),JSON[_0x0dae('0x10')](_0x1396bf));if(_0x1396bf[_0x0dae('0x11')]){if(_0x1396bf[_0x0dae('0x11')][_0x0dae('0x12')]===0x1f4){logger[_0x0dae('0x11')](_0x0dae('0xc'),_0x530f72,_0x1396bf['error'][_0x0dae('0x13')]);return _0x2caaea(_0x1396bf[_0x0dae('0x11')][_0x0dae('0x13')]);}logger[_0x0dae('0x11')](_0x0dae('0xc'),_0x530f72,_0x1396bf[_0x0dae('0x11')][_0x0dae('0x13')]);return _0x575b05(_0x1396bf['error']['message']);}else{logger[_0x0dae('0xb')](_0x0dae('0xc'),_0x530f72,'request\x20sent');_0x575b05(_0x1396bf[_0x0dae('0x14')][_0x0dae('0x13')]);}})['catch'](function(_0x3c7906){logger[_0x0dae('0x11')](_0x0dae('0xc'),_0x530f72,_0x3c7906);_0x2caaea(_0x3c7906);});});}exports['GetFreshdeskAccount']=function(_0xcb7770){var _0x469e2d=this;return new Promise(function(_0x28a9c8,_0x366912){return db[_0x0dae('0x15')]['findAll']({'raw':_0xcb7770[_0x0dae('0x16')]?_0xcb7770[_0x0dae('0x16')][_0x0dae('0x17')]===undefined?!![]:![]:!![],'where':_0xcb7770[_0x0dae('0x16')]?_0xcb7770[_0x0dae('0x16')][_0x0dae('0x18')]||null:null,'attributes':_0xcb7770[_0x0dae('0x16')]?_0xcb7770[_0x0dae('0x16')]['attributes']||null:null,'limit':_0xcb7770['options']?_0xcb7770['options'][_0x0dae('0x19')]||null:null,'include':_0xcb7770[_0x0dae('0x16')]?_0xcb7770[_0x0dae('0x16')][_0x0dae('0x1a')]?_['map'](_0xcb7770[_0x0dae('0x16')][_0x0dae('0x1a')],function(_0x1386bd){return{'model':db[_0x1386bd[_0x0dae('0x1b')]],'as':_0x1386bd['as'],'attributes':_0x1386bd['attributes'],'include':_0x1386bd['include']?_['map'](_0x1386bd[_0x0dae('0x1a')],function(_0x58f62d){return{'model':db[_0x58f62d['model']],'as':_0x58f62d['as'],'attributes':_0x58f62d['attributes'],'include':_0x58f62d['include']?_['map'](_0x58f62d[_0x0dae('0x1a')],function(_0x5cdf6a){return{'model':db[_0x5cdf6a[_0x0dae('0x1b')]],'as':_0x5cdf6a['as'],'attributes':_0x5cdf6a[_0x0dae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0dae('0x1d')](function(_0x5e7bdc){logger['info']('GetFreshdeskAccount',_0xcb7770);logger['debug'](_0x0dae('0x1e'),_0xcb7770,JSON['stringify'](_0x5e7bdc));_0x28a9c8(_0x5e7bdc);})[_0x0dae('0x1f')](function(_0x33541c){logger[_0x0dae('0x11')](_0x0dae('0x1e'),_0x33541c[_0x0dae('0x13')],_0xcb7770);_0x366912(_0x469e2d[_0x0dae('0x11')](0x1f4,_0x33541c[_0x0dae('0x13')]));});});};exports[_0x0dae('0x20')]=function(_0x2043d9){var _0x1ba894=this;return new Promise(function(_0x50e018,_0x36aa74){return db[_0x0dae('0x15')][_0x0dae('0x21')]({'raw':_0x2043d9[_0x0dae('0x16')]?_0x2043d9[_0x0dae('0x16')][_0x0dae('0x17')]===undefined?!![]:![]:!![],'where':_0x2043d9[_0x0dae('0x16')]?_0x2043d9[_0x0dae('0x16')]['where']||null:null,'attributes':_0x2043d9[_0x0dae('0x16')]?_0x2043d9[_0x0dae('0x16')][_0x0dae('0x1c')]||null:null,'include':_0x2043d9[_0x0dae('0x16')]?_0x2043d9[_0x0dae('0x16')][_0x0dae('0x1a')]?_[_0x0dae('0x22')](_0x2043d9[_0x0dae('0x16')]['include'],function(_0x261b35){return{'model':db[_0x261b35[_0x0dae('0x1b')]],'as':_0x261b35['as'],'attributes':_0x261b35[_0x0dae('0x1c')],'include':_0x261b35['include']?_[_0x0dae('0x22')](_0x261b35['include'],function(_0x4ca9c7){return{'model':db[_0x4ca9c7[_0x0dae('0x1b')]],'as':_0x4ca9c7['as'],'attributes':_0x4ca9c7['attributes'],'include':_0x4ca9c7[_0x0dae('0x1a')]?_['map'](_0x4ca9c7[_0x0dae('0x1a')],function(_0x571656){return{'model':db[_0x571656['model']],'as':_0x571656['as'],'attributes':_0x571656[_0x0dae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0dae('0x1d')](function(_0x335565){logger[_0x0dae('0xb')]('ShowFreshdeskAccount',_0x2043d9);logger[_0x0dae('0xe')]('ShowFreshdeskAccount',_0x2043d9,JSON['stringify'](_0x335565));_0x50e018(_0x335565);})[_0x0dae('0x1f')](function(_0x28a1c7){logger[_0x0dae('0x11')]('ShowFreshdeskAccount',_0x28a1c7[_0x0dae('0x13')],_0x2043d9);_0x36aa74(_0x1ba894[_0x0dae('0x11')](0x1f4,_0x28a1c7[_0x0dae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index ab98a1a..c324d1e 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 _0x4fce=['show','/:id/fields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x455102,_0x2690e2){var _0x2ba134=function(_0x1bba68){while(--_0x1bba68){_0x455102['push'](_0x455102['shift']());}};_0x2ba134(++_0x2690e2);}(_0x4fce,0x174));var _0xe4fc=function(_0x42955a,_0x344c12){_0x42955a=_0x42955a-0x0;var _0x279d62=_0x4fce[_0x42955a];return _0x279d62;};'use strict';var multer=require('multer');var util=require(_0xe4fc('0x0'));var path=require('path');var timeout=require(_0xe4fc('0x1'));var express=require(_0xe4fc('0x2'));var router=express[_0xe4fc('0x3')]();var fs_extra=require(_0xe4fc('0x4'));var auth=require(_0xe4fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4fc('0x6'));var controller=require(_0xe4fc('0x7'));router[_0xe4fc('0x8')]('/',auth[_0xe4fc('0x9')](),controller[_0xe4fc('0xa')]);router[_0xe4fc('0x8')](_0xe4fc('0xb'),auth[_0xe4fc('0x9')](),controller[_0xe4fc('0xc')]);router['get'](_0xe4fc('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xe4fc('0x8')](_0xe4fc('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xe4fc('0x8')]('/:id/descriptions',auth[_0xe4fc('0x9')](),controller[_0xe4fc('0xf')]);router[_0xe4fc('0x8')](_0xe4fc('0x10'),auth[_0xe4fc('0x9')](),controller[_0xe4fc('0x11')]);router[_0xe4fc('0x12')]('/',auth[_0xe4fc('0x9')](),controller[_0xe4fc('0x13')]);router[_0xe4fc('0x12')](_0xe4fc('0x10'),auth[_0xe4fc('0x9')](),controller[_0xe4fc('0x14')]);router['put']('/:id',auth[_0xe4fc('0x9')](),controller['update']);router[_0xe4fc('0x15')](_0xe4fc('0xb'),auth[_0xe4fc('0x9')](),controller[_0xe4fc('0x16')]);module[_0xe4fc('0x17')]=router; \ No newline at end of file +var _0x0435=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0435,0x16a));var _0x5043=function(_0x316fef,_0xbe8705){_0x316fef=_0x316fef-0x0;var _0x153dd9=_0x0435[_0x316fef];return _0x153dd9;};'use strict';var multer=require(_0x5043('0x0'));var util=require(_0x5043('0x1'));var path=require('path');var timeout=require(_0x5043('0x2'));var express=require('express');var router=express[_0x5043('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5043('0x4'));var interaction=require(_0x5043('0x5'));var config=require(_0x5043('0x6'));var controller=require(_0x5043('0x7'));router[_0x5043('0x8')]('/',auth[_0x5043('0x9')](),controller['index']);router[_0x5043('0x8')](_0x5043('0xa'),auth['isAuthenticated'](),controller[_0x5043('0xb')]);router[_0x5043('0x8')](_0x5043('0xc'),auth['isAuthenticated'](),controller[_0x5043('0xd')]);router['get'](_0x5043('0xe'),auth['isAuthenticated'](),controller[_0x5043('0xf')]);router[_0x5043('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5043('0x10')]);router[_0x5043('0x8')](_0x5043('0x11'),auth[_0x5043('0x9')](),controller['getTags']);router[_0x5043('0x12')]('/',auth[_0x5043('0x9')](),controller[_0x5043('0x13')]);router[_0x5043('0x12')](_0x5043('0x11'),auth[_0x5043('0x9')](),controller[_0x5043('0x14')]);router[_0x5043('0x15')](_0x5043('0xa'),auth[_0x5043('0x9')](),controller[_0x5043('0x16')]);router[_0x5043('0x17')]('/:id',auth[_0x5043('0x9')](),controller[_0x5043('0x18')]);module[_0x5043('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c862a31..e63288f 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 _0xd5af=['sequelize','exports','STRING'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xd5af,0x1a7));var _0xfd5a=function(_0x37ceee,_0x4b97e3){_0x37ceee=_0x37ceee-0x0;var _0x2db164=_0xd5af[_0x37ceee];return _0x2db164;};'use strict';var Sequelize=require(_0xfd5a('0x0'));module[_0xfd5a('0x1')]={'name':{'type':Sequelize[_0xfd5a('0x2')]},'description':{'type':Sequelize[_0xfd5a('0x2')]}}; \ No newline at end of file +var _0xda9a=['exports','STRING','sequelize'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0xda9a,0xf8));var _0xada9=function(_0x2295fa,_0x53f01b){_0x2295fa=_0x2295fa-0x0;var _0xcdd3b7=_0xda9a[_0x2295fa];return _0xcdd3b7;};'use strict';var Sequelize=require(_0xada9('0x0'));module[_0xada9('0x1')]={'name':{'type':Sequelize[_0xada9('0x2')]},'description':{'type':Sequelize[_0xada9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 17499e7..dc16f14 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 _0xd0c1=['destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','rawAttributes','length','include','catch','create','body','find','getFields','findOne','FreshdeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then'];(function(_0x2f5184,_0x49cc78){var _0x4481e7=function(_0x22012a){while(--_0x22012a){_0x2f5184['push'](_0x2f5184['shift']());}};_0x4481e7(++_0x49cc78);}(_0xd0c1,0xd5));var _0x1d0c=function(_0x5f0e13,_0x120503){_0x5f0e13=_0x5f0e13-0x0;var _0x600af4=_0xd0c1[_0x5f0e13];return _0x600af4;};'use strict';var emlformat=require(_0x1d0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d0c('0x1'));var jsonpatch=require(_0x1d0c('0x2'));var rp=require(_0x1d0c('0x3'));var moment=require(_0x1d0c('0x4'));var BPromise=require(_0x1d0c('0x5'));var Mustache=require(_0x1d0c('0x6'));var util=require(_0x1d0c('0x7'));var path=require('path');var sox=require(_0x1d0c('0x8'));var csv=require(_0x1d0c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d0c('0xa'));var _=require(_0x1d0c('0xb'));var squel=require('squel');var crypto=require(_0x1d0c('0xc'));var jsforce=require(_0x1d0c('0xd'));var deskjs=require(_0x1d0c('0xe'));var toCsv=require(_0x1d0c('0x9'));var querystring=require(_0x1d0c('0xf'));var Papa=require(_0x1d0c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d0c('0x11'));var as=require(_0x1d0c('0x12'));var hardwareService=require(_0x1d0c('0x13'));var logger=require(_0x1d0c('0x14'))(_0x1d0c('0x15'));var utils=require('../../config/utils');var config=require(_0x1d0c('0x16'));var licenseUtil=require(_0x1d0c('0x17'));var db=require(_0x1d0c('0x18'))['db'];function respondWithStatusCode(_0x4d3943,_0x5e2ef4){_0x5e2ef4=_0x5e2ef4||0xcc;return function(_0x230901){if(_0x230901){return _0x4d3943[_0x1d0c('0x19')](_0x5e2ef4);}return _0x4d3943[_0x1d0c('0x1a')](_0x5e2ef4)[_0x1d0c('0x1b')]();};}function respondWithResult(_0x4601bc,_0x109e6d){_0x109e6d=_0x109e6d||0xc8;return function(_0x30c6e6){if(_0x30c6e6){return _0x4601bc[_0x1d0c('0x1a')](_0x109e6d)['json'](_0x30c6e6);}};}function respondWithFilteredResult(_0x36b31a,_0x183e7b){return function(_0x9c9b14){if(_0x9c9b14){var _0x97553c=typeof _0x183e7b['offset']===_0x1d0c('0x1c')&&typeof _0x183e7b['limit']==='undefined';var _0x191321=_0x9c9b14[_0x1d0c('0x1d')];var _0x26a620=_0x97553c?0x0:_0x183e7b['offset'];var _0x336173=_0x97553c?_0x9c9b14[_0x1d0c('0x1d')]:_0x183e7b[_0x1d0c('0x1e')]+_0x183e7b[_0x1d0c('0x1f')];var _0x49f746;if(_0x336173>=_0x191321){_0x336173=_0x191321;_0x49f746=0xc8;}else{_0x49f746=0xce;}_0x36b31a['status'](_0x49f746);return _0x36b31a[_0x1d0c('0x20')](_0x1d0c('0x21'),_0x26a620+'-'+_0x336173+'/'+_0x191321)[_0x1d0c('0x22')](_0x9c9b14);}return null;};}function patchUpdates(_0x1d258a){return function(_0x338d33){try{jsonpatch[_0x1d0c('0x23')](_0x338d33,_0x1d258a,!![]);}catch(_0x9a5ced){return BPromise[_0x1d0c('0x24')](_0x9a5ced);}return _0x338d33['save']();};}function saveUpdates(_0xe26751,_0x56377b){return function(_0xefe0a2){if(_0xefe0a2){return _0xefe0a2[_0x1d0c('0x25')](_0xe26751)[_0x1d0c('0x26')](function(_0x3f6e32){return _0x3f6e32;});}return null;};}function removeEntity(_0x34a349,_0x150fca){return function(_0xbb0994){if(_0xbb0994){return _0xbb0994[_0x1d0c('0x27')]()['then'](function(){_0x34a349[_0x1d0c('0x1a')](0xcc)[_0x1d0c('0x1b')]();});}};}function handleEntityNotFound(_0x1f94db,_0x2b7ed2){return function(_0x4ea283){if(!_0x4ea283){_0x1f94db['sendStatus'](0x194);}return _0x4ea283;};}function handleError(_0x1fceff,_0x114e0b){_0x114e0b=_0x114e0b||0x1f4;return function(_0x2640ad){logger['error'](_0x2640ad[_0x1d0c('0x28')]);if(_0x2640ad[_0x1d0c('0x29')]){delete _0x2640ad['name'];}_0x1fceff['status'](_0x114e0b)[_0x1d0c('0x2a')](_0x2640ad);};}exports[_0x1d0c('0x2b')]=function(_0xd2b7f2,_0x41ea0f){var _0xaaf448={},_0x58fba3={},_0xa1e52d={'count':0x0,'rows':[]};var _0x4f22a5=_[_0x1d0c('0x2c')](db[_0x1d0c('0x2d')]['rawAttributes'],function(_0x3a9656){return{'name':_0x3a9656[_0x1d0c('0x2e')],'type':_0x3a9656['type'][_0x1d0c('0x2f')]};});_0x58fba3[_0x1d0c('0x30')]=_[_0x1d0c('0x2c')](_0x4f22a5,_0x1d0c('0x29'));_0x58fba3[_0x1d0c('0x31')]=_[_0x1d0c('0x32')](_0xd2b7f2[_0x1d0c('0x31')]);_0x58fba3[_0x1d0c('0x33')]=_[_0x1d0c('0x34')](_0x58fba3['model'],_0x58fba3[_0x1d0c('0x31')]);_0xaaf448['attributes']=_[_0x1d0c('0x34')](_0x58fba3[_0x1d0c('0x30')],qs[_0x1d0c('0x35')](_0xd2b7f2['query'][_0x1d0c('0x35')]));_0xaaf448[_0x1d0c('0x36')]=_0xaaf448[_0x1d0c('0x36')]['length']?_0xaaf448[_0x1d0c('0x36')]:_0x58fba3['model'];if(!_0xd2b7f2['query']['hasOwnProperty']('nolimit')){_0xaaf448[_0x1d0c('0x1f')]=qs[_0x1d0c('0x1f')](_0xd2b7f2['query'][_0x1d0c('0x1f')]);_0xaaf448[_0x1d0c('0x1e')]=qs['offset'](_0xd2b7f2[_0x1d0c('0x31')][_0x1d0c('0x1e')]);}_0xaaf448[_0x1d0c('0x37')]=qs['sort'](_0xd2b7f2[_0x1d0c('0x31')][_0x1d0c('0x38')]);_0xaaf448[_0x1d0c('0x39')]=qs[_0x1d0c('0x33')](_[_0x1d0c('0x3a')](_0xd2b7f2[_0x1d0c('0x31')],_0x58fba3[_0x1d0c('0x33')]),_0x4f22a5);if(_0xd2b7f2['query'][_0x1d0c('0x3b')]){_0xaaf448[_0x1d0c('0x39')]=_[_0x1d0c('0x3c')](_0xaaf448['where'],{'$or':_['map'](_0x4f22a5,function(_0x1f1a4d){if(_0x1f1a4d[_0x1d0c('0x3d')]!==_0x1d0c('0x3e')){var _0x512091={};_0x512091[_0x1f1a4d[_0x1d0c('0x29')]]={'$like':'%'+_0xd2b7f2[_0x1d0c('0x31')]['filter']+'%'};return _0x512091;}})});}_0xaaf448=_[_0x1d0c('0x3c')]({},_0xaaf448,_0xd2b7f2[_0x1d0c('0x3f')]);var _0x5f34dc={'where':_0xaaf448[_0x1d0c('0x39')]};return db[_0x1d0c('0x2d')][_0x1d0c('0x1d')](_0x5f34dc)['then'](function(_0xf50854){_0xa1e52d[_0x1d0c('0x1d')]=_0xf50854;if(_0xd2b7f2[_0x1d0c('0x31')][_0x1d0c('0x40')]){_0xaaf448['include']=[{'all':!![]}];}return db[_0x1d0c('0x2d')]['findAll'](_0xaaf448);})[_0x1d0c('0x26')](function(_0x4fa99e){_0xa1e52d[_0x1d0c('0x41')]=_0x4fa99e;return _0xa1e52d;})[_0x1d0c('0x26')](respondWithFilteredResult(_0x41ea0f,_0xaaf448))['catch'](handleError(_0x41ea0f,null));};exports['show']=function(_0x20f7c4,_0x60e774){var _0x28f82f={'raw':![],'where':{'id':_0x20f7c4[_0x1d0c('0x42')]['id']}},_0x34a1fd={};_0x34a1fd[_0x1d0c('0x30')]=_['keys'](db['FreshdeskConfiguration'][_0x1d0c('0x43')]);_0x34a1fd[_0x1d0c('0x31')]=_['keys'](_0x20f7c4['query']);_0x34a1fd[_0x1d0c('0x33')]=_[_0x1d0c('0x34')](_0x34a1fd[_0x1d0c('0x30')],_0x34a1fd[_0x1d0c('0x31')]);_0x28f82f[_0x1d0c('0x36')]=_['intersection'](_0x34a1fd[_0x1d0c('0x30')],qs['fields'](_0x20f7c4[_0x1d0c('0x31')]['fields']));_0x28f82f[_0x1d0c('0x36')]=_0x28f82f['attributes'][_0x1d0c('0x44')]?_0x28f82f['attributes']:_0x34a1fd[_0x1d0c('0x30')];if(_0x20f7c4[_0x1d0c('0x31')][_0x1d0c('0x40')]){_0x28f82f[_0x1d0c('0x45')]=[{'all':!![]}];}_0x28f82f=_[_0x1d0c('0x3c')]({},_0x28f82f,_0x20f7c4['options']);return db['FreshdeskConfiguration']['find'](_0x28f82f)['then'](handleEntityNotFound(_0x60e774,null))[_0x1d0c('0x26')](respondWithResult(_0x60e774,null))[_0x1d0c('0x46')](handleError(_0x60e774,null));};exports[_0x1d0c('0x47')]=function(_0x2ea709,_0x479441){return db[_0x1d0c('0x2d')][_0x1d0c('0x47')](_0x2ea709[_0x1d0c('0x48')],{})[_0x1d0c('0x26')](respondWithResult(_0x479441,0xc9))[_0x1d0c('0x46')](handleError(_0x479441,null));};exports[_0x1d0c('0x25')]=function(_0xc909d,_0x205885){if(_0xc909d[_0x1d0c('0x48')]['id']){delete _0xc909d[_0x1d0c('0x48')]['id'];}return db[_0x1d0c('0x2d')][_0x1d0c('0x49')]({'where':{'id':_0xc909d[_0x1d0c('0x42')]['id']}})[_0x1d0c('0x26')](handleEntityNotFound(_0x205885,null))['then'](saveUpdates(_0xc909d[_0x1d0c('0x48')],null))[_0x1d0c('0x26')](respondWithResult(_0x205885,null))[_0x1d0c('0x46')](handleError(_0x205885,null));};exports[_0x1d0c('0x27')]=function(_0x4f5253,_0x4a2f3c){return db['FreshdeskConfiguration'][_0x1d0c('0x49')]({'where':{'id':_0x4f5253[_0x1d0c('0x42')]['id']}})[_0x1d0c('0x26')](handleEntityNotFound(_0x4a2f3c,null))[_0x1d0c('0x26')](removeEntity(_0x4a2f3c,null))[_0x1d0c('0x46')](handleError(_0x4a2f3c,null));};exports[_0x1d0c('0x4a')]=function(_0x48df27,_0x3e5a57,_0x28393f){var _0x1263da={};var _0x20166d={};var _0x2d34fc;var _0x135446;return db[_0x1d0c('0x2d')][_0x1d0c('0x4b')]({'where':{'id':_0x48df27[_0x1d0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e5a57,null))[_0x1d0c('0x26')](function(_0x12b779){if(_0x12b779){_0x2d34fc=_0x12b779;_0x20166d[_0x1d0c('0x30')]=_[_0x1d0c('0x32')](db[_0x1d0c('0x4c')][_0x1d0c('0x43')]);_0x20166d[_0x1d0c('0x31')]=_[_0x1d0c('0x32')](_0x48df27['query']);_0x20166d[_0x1d0c('0x33')]=_[_0x1d0c('0x34')](_0x20166d['model'],_0x20166d[_0x1d0c('0x31')]);_0x1263da[_0x1d0c('0x36')]=_[_0x1d0c('0x34')](_0x20166d[_0x1d0c('0x30')],qs[_0x1d0c('0x35')](_0x48df27['query'][_0x1d0c('0x35')]));_0x1263da[_0x1d0c('0x36')]=_0x1263da['attributes'][_0x1d0c('0x44')]?_0x1263da['attributes']:_0x20166d[_0x1d0c('0x30')];_0x1263da[_0x1d0c('0x37')]=qs[_0x1d0c('0x38')](_0x48df27[_0x1d0c('0x31')]['sort']);_0x1263da[_0x1d0c('0x39')]=qs['filters'](_['pick'](_0x48df27['query'],_0x20166d[_0x1d0c('0x33')]));if(_0x48df27[_0x1d0c('0x31')][_0x1d0c('0x3b')]){_0x1263da['where']=_['merge'](_0x1263da[_0x1d0c('0x39')],{'$or':_['map'](_0x1263da[_0x1d0c('0x36')],function(_0x28a516){var _0x4bead8={};_0x4bead8[_0x28a516]={'$like':'%'+_0x48df27[_0x1d0c('0x31')][_0x1d0c('0x3b')]+'%'};return _0x4bead8;})});}_0x1263da=_['merge']({},_0x1263da,_0x48df27[_0x1d0c('0x3f')]);return _0x2d34fc['getFields'](_0x1263da);}})['then'](function(_0x3151c){if(_0x3151c){_0x135446=_0x3151c[_0x1d0c('0x44')];if(!_0x48df27[_0x1d0c('0x31')]['hasOwnProperty']('nolimit')){_0x1263da['limit']=qs[_0x1d0c('0x1f')](_0x48df27[_0x1d0c('0x31')][_0x1d0c('0x1f')]);_0x1263da[_0x1d0c('0x1e')]=qs[_0x1d0c('0x1e')](_0x48df27[_0x1d0c('0x31')]['offset']);}return _0x2d34fc[_0x1d0c('0x4a')](_0x1263da);}})[_0x1d0c('0x26')](function(_0x452580){if(_0x452580){return _0x452580?{'count':_0x135446,'rows':_0x452580}:null;}})[_0x1d0c('0x26')](respondWithResult(_0x3e5a57,null))[_0x1d0c('0x46')](handleError(_0x3e5a57,null));};exports[_0x1d0c('0x4d')]=function(_0x4a9361,_0x3a688a,_0x10257e){var _0x328faf={};var _0x189c6d={};var _0x2b96f6;var _0x3d4954;return db['FreshdeskConfiguration'][_0x1d0c('0x4b')]({'where':{'id':_0x4a9361[_0x1d0c('0x42')]['id']}})[_0x1d0c('0x26')](handleEntityNotFound(_0x3a688a,null))[_0x1d0c('0x26')](function(_0x38808e){if(_0x38808e){_0x2b96f6=_0x38808e;_0x189c6d[_0x1d0c('0x30')]=_[_0x1d0c('0x32')](db['FreshdeskField'][_0x1d0c('0x43')]);_0x189c6d['query']=_['keys'](_0x4a9361[_0x1d0c('0x31')]);_0x189c6d['filters']=_['intersection'](_0x189c6d[_0x1d0c('0x30')],_0x189c6d['query']);_0x328faf[_0x1d0c('0x36')]=_[_0x1d0c('0x34')](_0x189c6d[_0x1d0c('0x30')],qs[_0x1d0c('0x35')](_0x4a9361[_0x1d0c('0x31')]['fields']));_0x328faf[_0x1d0c('0x36')]=_0x328faf[_0x1d0c('0x36')][_0x1d0c('0x44')]?_0x328faf[_0x1d0c('0x36')]:_0x189c6d[_0x1d0c('0x30')];_0x328faf[_0x1d0c('0x37')]=qs[_0x1d0c('0x38')](_0x4a9361[_0x1d0c('0x31')][_0x1d0c('0x38')]);_0x328faf['where']=qs[_0x1d0c('0x33')](_[_0x1d0c('0x3a')](_0x4a9361[_0x1d0c('0x31')],_0x189c6d['filters']));if(_0x4a9361['query'][_0x1d0c('0x3b')]){_0x328faf['where']=_[_0x1d0c('0x3c')](_0x328faf[_0x1d0c('0x39')],{'$or':_[_0x1d0c('0x2c')](_0x328faf[_0x1d0c('0x36')],function(_0x390488){var _0x59c145={};_0x59c145[_0x390488]={'$like':'%'+_0x4a9361[_0x1d0c('0x31')][_0x1d0c('0x3b')]+'%'};return _0x59c145;})});}_0x328faf=_[_0x1d0c('0x3c')]({},_0x328faf,_0x4a9361[_0x1d0c('0x3f')]);return _0x2b96f6['getSubjects'](_0x328faf);}})[_0x1d0c('0x26')](function(_0x5a2596){if(_0x5a2596){_0x3d4954=_0x5a2596[_0x1d0c('0x44')];if(!_0x4a9361['query'][_0x1d0c('0x4e')](_0x1d0c('0x4f'))){_0x328faf['limit']=qs[_0x1d0c('0x1f')](_0x4a9361['query']['limit']);_0x328faf['offset']=qs[_0x1d0c('0x1e')](_0x4a9361[_0x1d0c('0x31')][_0x1d0c('0x1e')]);}return _0x2b96f6[_0x1d0c('0x4d')](_0x328faf);}})[_0x1d0c('0x26')](function(_0x30ddd9){if(_0x30ddd9){return _0x30ddd9?{'count':_0x3d4954,'rows':_0x30ddd9}:null;}})[_0x1d0c('0x26')](respondWithResult(_0x3a688a,null))['catch'](handleError(_0x3a688a,null));};exports['getDescriptions']=function(_0x45e6b4,_0x1d82dc,_0xd4fc3f){var _0x248360={};var _0x1fa72={};var _0x349163;var _0xd76f23;return db['FreshdeskConfiguration'][_0x1d0c('0x4b')]({'where':{'id':_0x45e6b4[_0x1d0c('0x42')]['id']}})[_0x1d0c('0x26')](handleEntityNotFound(_0x1d82dc,null))[_0x1d0c('0x26')](function(_0x2bc48f){if(_0x2bc48f){_0x349163=_0x2bc48f;_0x1fa72[_0x1d0c('0x30')]=_[_0x1d0c('0x32')](db[_0x1d0c('0x4c')][_0x1d0c('0x43')]);_0x1fa72[_0x1d0c('0x31')]=_[_0x1d0c('0x32')](_0x45e6b4[_0x1d0c('0x31')]);_0x1fa72[_0x1d0c('0x33')]=_[_0x1d0c('0x34')](_0x1fa72[_0x1d0c('0x30')],_0x1fa72[_0x1d0c('0x31')]);_0x248360[_0x1d0c('0x36')]=_[_0x1d0c('0x34')](_0x1fa72[_0x1d0c('0x30')],qs[_0x1d0c('0x35')](_0x45e6b4[_0x1d0c('0x31')][_0x1d0c('0x35')]));_0x248360[_0x1d0c('0x36')]=_0x248360[_0x1d0c('0x36')]['length']?_0x248360[_0x1d0c('0x36')]:_0x1fa72[_0x1d0c('0x30')];_0x248360[_0x1d0c('0x37')]=qs[_0x1d0c('0x38')](_0x45e6b4[_0x1d0c('0x31')]['sort']);_0x248360[_0x1d0c('0x39')]=qs[_0x1d0c('0x33')](_[_0x1d0c('0x3a')](_0x45e6b4[_0x1d0c('0x31')],_0x1fa72['filters']));if(_0x45e6b4[_0x1d0c('0x31')][_0x1d0c('0x3b')]){_0x248360['where']=_['merge'](_0x248360['where'],{'$or':_['map'](_0x248360[_0x1d0c('0x36')],function(_0x3870bb){var _0x49e85c={};_0x49e85c[_0x3870bb]={'$like':'%'+_0x45e6b4[_0x1d0c('0x31')][_0x1d0c('0x3b')]+'%'};return _0x49e85c;})});}_0x248360=_[_0x1d0c('0x3c')]({},_0x248360,_0x45e6b4[_0x1d0c('0x3f')]);return _0x349163[_0x1d0c('0x50')](_0x248360);}})[_0x1d0c('0x26')](function(_0x482db6){if(_0x482db6){_0xd76f23=_0x482db6[_0x1d0c('0x44')];if(!_0x45e6b4[_0x1d0c('0x31')][_0x1d0c('0x4e')](_0x1d0c('0x4f'))){_0x248360['limit']=qs['limit'](_0x45e6b4['query']['limit']);_0x248360['offset']=qs[_0x1d0c('0x1e')](_0x45e6b4[_0x1d0c('0x31')][_0x1d0c('0x1e')]);}return _0x349163[_0x1d0c('0x50')](_0x248360);}})[_0x1d0c('0x26')](function(_0x219287){if(_0x219287){return _0x219287?{'count':_0xd76f23,'rows':_0x219287}:null;}})[_0x1d0c('0x26')](respondWithResult(_0x1d82dc,null))[_0x1d0c('0x46')](handleError(_0x1d82dc,null));};exports[_0x1d0c('0x51')]=function(_0x52b2c0,_0x3156b6,_0x28d242){var _0x4bb53={};var _0x57c30e={};var _0x4096f1;var _0x2324b2;return db[_0x1d0c('0x2d')][_0x1d0c('0x4b')]({'where':{'id':_0x52b2c0[_0x1d0c('0x42')]['id']}})[_0x1d0c('0x26')](handleEntityNotFound(_0x3156b6,null))[_0x1d0c('0x26')](function(_0x2b3e0b){if(_0x2b3e0b){_0x4096f1=_0x2b3e0b;_0x57c30e['model']=_['keys'](db[_0x1d0c('0x52')][_0x1d0c('0x43')]);_0x57c30e['query']=_[_0x1d0c('0x32')](_0x52b2c0[_0x1d0c('0x31')]);_0x57c30e[_0x1d0c('0x33')]=_[_0x1d0c('0x34')](_0x57c30e[_0x1d0c('0x30')],_0x57c30e[_0x1d0c('0x31')]);_0x4bb53['attributes']=_[_0x1d0c('0x34')](_0x57c30e[_0x1d0c('0x30')],qs[_0x1d0c('0x35')](_0x52b2c0['query'][_0x1d0c('0x35')]));_0x4bb53[_0x1d0c('0x36')]=_0x4bb53[_0x1d0c('0x36')][_0x1d0c('0x44')]?_0x4bb53[_0x1d0c('0x36')]:_0x57c30e[_0x1d0c('0x30')];_0x4bb53[_0x1d0c('0x37')]=qs[_0x1d0c('0x38')](_0x52b2c0[_0x1d0c('0x31')][_0x1d0c('0x38')]);_0x4bb53[_0x1d0c('0x39')]=qs['filters'](_[_0x1d0c('0x3a')](_0x52b2c0[_0x1d0c('0x31')],_0x57c30e[_0x1d0c('0x33')]));if(_0x52b2c0[_0x1d0c('0x31')][_0x1d0c('0x3b')]){_0x4bb53[_0x1d0c('0x39')]=_['merge'](_0x4bb53['where'],{'$or':_['map'](_0x4bb53['attributes'],function(_0x36d31d){var _0x387f0d={};_0x387f0d[_0x36d31d]={'$like':'%'+_0x52b2c0[_0x1d0c('0x31')][_0x1d0c('0x3b')]+'%'};return _0x387f0d;})});}_0x4bb53=_[_0x1d0c('0x3c')]({},_0x4bb53,_0x52b2c0[_0x1d0c('0x3f')]);return _0x4096f1[_0x1d0c('0x51')](_0x4bb53);}})[_0x1d0c('0x26')](function(_0xf78812){if(_0xf78812){_0x2324b2=_0xf78812['length'];if(!_0x52b2c0[_0x1d0c('0x31')][_0x1d0c('0x4e')](_0x1d0c('0x4f'))){_0x4bb53[_0x1d0c('0x1f')]=qs[_0x1d0c('0x1f')](_0x52b2c0[_0x1d0c('0x31')][_0x1d0c('0x1f')]);_0x4bb53[_0x1d0c('0x1e')]=qs[_0x1d0c('0x1e')](_0x52b2c0[_0x1d0c('0x31')]['offset']);}return _0x4096f1[_0x1d0c('0x51')](_0x4bb53);}})[_0x1d0c('0x26')](function(_0x534d84){if(_0x534d84){return _0x534d84?{'count':_0x2324b2,'rows':_0x534d84}:null;}})[_0x1d0c('0x26')](respondWithResult(_0x3156b6,null))[_0x1d0c('0x46')](handleError(_0x3156b6,null));};exports[_0x1d0c('0x53')]=function(_0x4c790a,_0x94c929,_0x582faf){if(_0x4c790a[_0x1d0c('0x48')]['id']){delete _0x4c790a[_0x1d0c('0x48')]['id'];}return db[_0x1d0c('0x2d')][_0x1d0c('0x4b')]({'where':{'id':_0x4c790a['params']['id']}})['then'](handleEntityNotFound(_0x94c929,null))[_0x1d0c('0x26')](function(_0x1c52d9){if(_0x1c52d9){return _0x1c52d9[_0x1d0c('0x53')](_0x4c790a['body']['ids']||[]);}return null;})[_0x1d0c('0x26')](respondWithResult(_0x94c929,null))[_0x1d0c('0x46')](handleError(_0x94c929,null));}; \ No newline at end of file +var _0xe4a5=['setTags','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','create','body','catch','destroy','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag'];(function(_0x308bc6,_0x564ec7){var _0x422fcf=function(_0x8451a8){while(--_0x8451a8){_0x308bc6['push'](_0x308bc6['shift']());}};_0x422fcf(++_0x564ec7);}(_0xe4a5,0x131));var _0x5e4a=function(_0x3758fb,_0x11db3b){_0x3758fb=_0x3758fb-0x0;var _0x569da=_0xe4a5[_0x3758fb];return _0x569da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e4a('0x0'));var jsonpatch=require(_0x5e4a('0x1'));var rp=require('request-promise');var moment=require(_0x5e4a('0x2'));var BPromise=require(_0x5e4a('0x3'));var Mustache=require(_0x5e4a('0x4'));var util=require(_0x5e4a('0x5'));var path=require('path');var sox=require(_0x5e4a('0x6'));var csv=require(_0x5e4a('0x7'));var ejs=require(_0x5e4a('0x8'));var fs=require('fs');var fs_extra=require(_0x5e4a('0x9'));var _=require('lodash');var squel=require(_0x5e4a('0xa'));var crypto=require(_0x5e4a('0xb'));var jsforce=require(_0x5e4a('0xc'));var deskjs=require(_0x5e4a('0xd'));var toCsv=require(_0x5e4a('0x7'));var querystring=require(_0x5e4a('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e4a('0xf'));var authService=require(_0x5e4a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e4a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e4a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310258,_0xa3c90f){_0xa3c90f=_0xa3c90f||0xcc;return function(_0x48521b){if(_0x48521b){return _0x310258[_0x5e4a('0x13')](_0xa3c90f);}return _0x310258[_0x5e4a('0x14')](_0xa3c90f)[_0x5e4a('0x15')]();};}function respondWithResult(_0x47380a,_0x4f7484){_0x4f7484=_0x4f7484||0xc8;return function(_0x3ceccd){if(_0x3ceccd){return _0x47380a[_0x5e4a('0x14')](_0x4f7484)[_0x5e4a('0x16')](_0x3ceccd);}};}function respondWithFilteredResult(_0x115bd1,_0x43d90b){return function(_0x1b7734){if(_0x1b7734){var _0x50ddb3=typeof _0x43d90b[_0x5e4a('0x17')]==='undefined'&&typeof _0x43d90b[_0x5e4a('0x18')]===_0x5e4a('0x19');var _0x3adbe2=_0x1b7734[_0x5e4a('0x1a')];var _0x3281cc=_0x50ddb3?0x0:_0x43d90b['offset'];var _0x4f04b7=_0x50ddb3?_0x1b7734['count']:_0x43d90b['offset']+_0x43d90b[_0x5e4a('0x18')];var _0x2665f4;if(_0x4f04b7>=_0x3adbe2){_0x4f04b7=_0x3adbe2;_0x2665f4=0xc8;}else{_0x2665f4=0xce;}_0x115bd1[_0x5e4a('0x14')](_0x2665f4);return _0x115bd1[_0x5e4a('0x1b')]('Content-Range',_0x3281cc+'-'+_0x4f04b7+'/'+_0x3adbe2)[_0x5e4a('0x16')](_0x1b7734);}return null;};}function patchUpdates(_0x45939d){return function(_0x93adc8){try{jsonpatch[_0x5e4a('0x1c')](_0x93adc8,_0x45939d,!![]);}catch(_0x4e3185){return BPromise['reject'](_0x4e3185);}return _0x93adc8['save']();};}function saveUpdates(_0x3fcf18,_0x3843e1){return function(_0x2d3582){if(_0x2d3582){return _0x2d3582[_0x5e4a('0x1d')](_0x3fcf18)[_0x5e4a('0x1e')](function(_0x5db3a3){return _0x5db3a3;});}return null;};}function removeEntity(_0x3cc083,_0x5eec34){return function(_0x51cef3){if(_0x51cef3){return _0x51cef3['destroy']()[_0x5e4a('0x1e')](function(){_0x3cc083[_0x5e4a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13e308,_0x1deee8){return function(_0x532111){if(!_0x532111){_0x13e308[_0x5e4a('0x13')](0x194);}return _0x532111;};}function handleError(_0x5b819c,_0x813e38){_0x813e38=_0x813e38||0x1f4;return function(_0x3eee1f){logger['error'](_0x3eee1f[_0x5e4a('0x1f')]);if(_0x3eee1f[_0x5e4a('0x20')]){delete _0x3eee1f[_0x5e4a('0x20')];}_0x5b819c[_0x5e4a('0x14')](_0x813e38)[_0x5e4a('0x21')](_0x3eee1f);};}exports[_0x5e4a('0x22')]=function(_0x373cd3,_0x25c24f){var _0xfe0ae9={},_0xa00a6c={},_0x3630dc={'count':0x0,'rows':[]};var _0x28f887=_[_0x5e4a('0x23')](db[_0x5e4a('0x24')][_0x5e4a('0x25')],function(_0x38d262){return{'name':_0x38d262['fieldName'],'type':_0x38d262[_0x5e4a('0x26')][_0x5e4a('0x27')]};});_0xa00a6c['model']=_[_0x5e4a('0x23')](_0x28f887,_0x5e4a('0x20'));_0xa00a6c[_0x5e4a('0x28')]=_[_0x5e4a('0x29')](_0x373cd3[_0x5e4a('0x28')]);_0xa00a6c['filters']=_[_0x5e4a('0x2a')](_0xa00a6c[_0x5e4a('0x2b')],_0xa00a6c[_0x5e4a('0x28')]);_0xfe0ae9[_0x5e4a('0x2c')]=_[_0x5e4a('0x2a')](_0xa00a6c[_0x5e4a('0x2b')],qs[_0x5e4a('0x2d')](_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x2d')]));_0xfe0ae9[_0x5e4a('0x2c')]=_0xfe0ae9[_0x5e4a('0x2c')]['length']?_0xfe0ae9[_0x5e4a('0x2c')]:_0xa00a6c[_0x5e4a('0x2b')];if(!_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x2e')](_0x5e4a('0x2f'))){_0xfe0ae9[_0x5e4a('0x18')]=qs[_0x5e4a('0x18')](_0x373cd3['query'][_0x5e4a('0x18')]);_0xfe0ae9[_0x5e4a('0x17')]=qs[_0x5e4a('0x17')](_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x17')]);}_0xfe0ae9[_0x5e4a('0x30')]=qs[_0x5e4a('0x31')](_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x31')]);_0xfe0ae9[_0x5e4a('0x32')]=qs[_0x5e4a('0x33')](_[_0x5e4a('0x34')](_0x373cd3['query'],_0xa00a6c[_0x5e4a('0x33')]),_0x28f887);if(_0x373cd3['query']['filter']){_0xfe0ae9[_0x5e4a('0x32')]=_[_0x5e4a('0x35')](_0xfe0ae9[_0x5e4a('0x32')],{'$or':_[_0x5e4a('0x23')](_0x28f887,function(_0x5f42fc){if(_0x5f42fc[_0x5e4a('0x26')]!==_0x5e4a('0x36')){var _0x24f9d9={};_0x24f9d9[_0x5f42fc['name']]={'$like':'%'+_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x37')]+'%'};return _0x24f9d9;}})});}_0xfe0ae9=_[_0x5e4a('0x35')]({},_0xfe0ae9,_0x373cd3[_0x5e4a('0x38')]);var _0x505cdf={'where':_0xfe0ae9[_0x5e4a('0x32')]};return db[_0x5e4a('0x24')]['count'](_0x505cdf)[_0x5e4a('0x1e')](function(_0x396655){_0x3630dc[_0x5e4a('0x1a')]=_0x396655;if(_0x373cd3[_0x5e4a('0x28')][_0x5e4a('0x39')]){_0xfe0ae9[_0x5e4a('0x3a')]=[{'all':!![]}];}return db[_0x5e4a('0x24')][_0x5e4a('0x3b')](_0xfe0ae9);})['then'](function(_0x32f306){_0x3630dc[_0x5e4a('0x3c')]=_0x32f306;return _0x3630dc;})[_0x5e4a('0x1e')](respondWithFilteredResult(_0x25c24f,_0xfe0ae9))['catch'](handleError(_0x25c24f,null));};exports['show']=function(_0x53e0a6,_0xea08e2){var _0x1cfe12={'raw':![],'where':{'id':_0x53e0a6[_0x5e4a('0x3d')]['id']}},_0x251610={};_0x251610[_0x5e4a('0x2b')]=_[_0x5e4a('0x29')](db[_0x5e4a('0x24')][_0x5e4a('0x25')]);_0x251610[_0x5e4a('0x28')]=_['keys'](_0x53e0a6[_0x5e4a('0x28')]);_0x251610[_0x5e4a('0x33')]=_[_0x5e4a('0x2a')](_0x251610[_0x5e4a('0x2b')],_0x251610[_0x5e4a('0x28')]);_0x1cfe12['attributes']=_['intersection'](_0x251610[_0x5e4a('0x2b')],qs['fields'](_0x53e0a6[_0x5e4a('0x28')][_0x5e4a('0x2d')]));_0x1cfe12[_0x5e4a('0x2c')]=_0x1cfe12[_0x5e4a('0x2c')][_0x5e4a('0x3e')]?_0x1cfe12['attributes']:_0x251610['model'];if(_0x53e0a6['query'][_0x5e4a('0x39')]){_0x1cfe12[_0x5e4a('0x3a')]=[{'all':!![]}];}_0x1cfe12=_[_0x5e4a('0x35')]({},_0x1cfe12,_0x53e0a6['options']);return db[_0x5e4a('0x24')][_0x5e4a('0x3f')](_0x1cfe12)['then'](handleEntityNotFound(_0xea08e2,null))[_0x5e4a('0x1e')](respondWithResult(_0xea08e2,null))['catch'](handleError(_0xea08e2,null));};exports[_0x5e4a('0x40')]=function(_0x58fe44,_0x450815){return db[_0x5e4a('0x24')][_0x5e4a('0x40')](_0x58fe44[_0x5e4a('0x41')],{})[_0x5e4a('0x1e')](respondWithResult(_0x450815,0xc9))[_0x5e4a('0x42')](handleError(_0x450815,null));};exports[_0x5e4a('0x1d')]=function(_0x5ce3ff,_0x301793){if(_0x5ce3ff['body']['id']){delete _0x5ce3ff[_0x5e4a('0x41')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x5ce3ff[_0x5e4a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x301793,null))[_0x5e4a('0x1e')](saveUpdates(_0x5ce3ff['body'],null))[_0x5e4a('0x1e')](respondWithResult(_0x301793,null))[_0x5e4a('0x42')](handleError(_0x301793,null));};exports[_0x5e4a('0x43')]=function(_0x480a0f,_0x1738a8){return db[_0x5e4a('0x24')][_0x5e4a('0x3f')]({'where':{'id':_0x480a0f[_0x5e4a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1738a8,null))[_0x5e4a('0x1e')](removeEntity(_0x1738a8,null))['catch'](handleError(_0x1738a8,null));};exports['getFields']=function(_0x1b0736,_0x3e4087,_0x3470f5){var _0x1619a4={};var _0x3f42ea={};var _0x107adf;var _0x49edf4;return db[_0x5e4a('0x24')][_0x5e4a('0x44')]({'where':{'id':_0x1b0736[_0x5e4a('0x3d')]['id']}})[_0x5e4a('0x1e')](handleEntityNotFound(_0x3e4087,null))[_0x5e4a('0x1e')](function(_0x58ceb8){if(_0x58ceb8){_0x107adf=_0x58ceb8;_0x3f42ea[_0x5e4a('0x2b')]=_[_0x5e4a('0x29')](db[_0x5e4a('0x45')]['rawAttributes']);_0x3f42ea[_0x5e4a('0x28')]=_[_0x5e4a('0x29')](_0x1b0736[_0x5e4a('0x28')]);_0x3f42ea[_0x5e4a('0x33')]=_['intersection'](_0x3f42ea[_0x5e4a('0x2b')],_0x3f42ea[_0x5e4a('0x28')]);_0x1619a4['attributes']=_[_0x5e4a('0x2a')](_0x3f42ea[_0x5e4a('0x2b')],qs[_0x5e4a('0x2d')](_0x1b0736['query']['fields']));_0x1619a4['attributes']=_0x1619a4[_0x5e4a('0x2c')][_0x5e4a('0x3e')]?_0x1619a4[_0x5e4a('0x2c')]:_0x3f42ea[_0x5e4a('0x2b')];_0x1619a4[_0x5e4a('0x30')]=qs[_0x5e4a('0x31')](_0x1b0736[_0x5e4a('0x28')]['sort']);_0x1619a4[_0x5e4a('0x32')]=qs['filters'](_[_0x5e4a('0x34')](_0x1b0736[_0x5e4a('0x28')],_0x3f42ea[_0x5e4a('0x33')]));if(_0x1b0736[_0x5e4a('0x28')][_0x5e4a('0x37')]){_0x1619a4['where']=_[_0x5e4a('0x35')](_0x1619a4[_0x5e4a('0x32')],{'$or':_['map'](_0x1619a4[_0x5e4a('0x2c')],function(_0x24dfd9){var _0x4605ca={};_0x4605ca[_0x24dfd9]={'$like':'%'+_0x1b0736[_0x5e4a('0x28')][_0x5e4a('0x37')]+'%'};return _0x4605ca;})});}_0x1619a4=_[_0x5e4a('0x35')]({},_0x1619a4,_0x1b0736['options']);return _0x107adf[_0x5e4a('0x46')](_0x1619a4);}})['then'](function(_0x1a31fc){if(_0x1a31fc){_0x49edf4=_0x1a31fc[_0x5e4a('0x3e')];if(!_0x1b0736[_0x5e4a('0x28')][_0x5e4a('0x2e')](_0x5e4a('0x2f'))){_0x1619a4[_0x5e4a('0x18')]=qs[_0x5e4a('0x18')](_0x1b0736[_0x5e4a('0x28')][_0x5e4a('0x18')]);_0x1619a4[_0x5e4a('0x17')]=qs[_0x5e4a('0x17')](_0x1b0736[_0x5e4a('0x28')][_0x5e4a('0x17')]);}return _0x107adf['getFields'](_0x1619a4);}})[_0x5e4a('0x1e')](function(_0x5c85cf){if(_0x5c85cf){return _0x5c85cf?{'count':_0x49edf4,'rows':_0x5c85cf}:null;}})['then'](respondWithResult(_0x3e4087,null))[_0x5e4a('0x42')](handleError(_0x3e4087,null));};exports[_0x5e4a('0x47')]=function(_0x418674,_0x16ee2c,_0x3573c8){var _0x4c8ba4={};var _0x291d62={};var _0x39997e;var _0x4d4841;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x418674[_0x5e4a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x16ee2c,null))['then'](function(_0x5e23b7){if(_0x5e23b7){_0x39997e=_0x5e23b7;_0x291d62[_0x5e4a('0x2b')]=_[_0x5e4a('0x29')](db['FreshdeskField'][_0x5e4a('0x25')]);_0x291d62[_0x5e4a('0x28')]=_['keys'](_0x418674[_0x5e4a('0x28')]);_0x291d62['filters']=_[_0x5e4a('0x2a')](_0x291d62[_0x5e4a('0x2b')],_0x291d62[_0x5e4a('0x28')]);_0x4c8ba4['attributes']=_[_0x5e4a('0x2a')](_0x291d62[_0x5e4a('0x2b')],qs[_0x5e4a('0x2d')](_0x418674[_0x5e4a('0x28')][_0x5e4a('0x2d')]));_0x4c8ba4[_0x5e4a('0x2c')]=_0x4c8ba4[_0x5e4a('0x2c')]['length']?_0x4c8ba4[_0x5e4a('0x2c')]:_0x291d62['model'];_0x4c8ba4[_0x5e4a('0x30')]=qs[_0x5e4a('0x31')](_0x418674[_0x5e4a('0x28')][_0x5e4a('0x31')]);_0x4c8ba4[_0x5e4a('0x32')]=qs['filters'](_['pick'](_0x418674[_0x5e4a('0x28')],_0x291d62[_0x5e4a('0x33')]));if(_0x418674['query']['filter']){_0x4c8ba4[_0x5e4a('0x32')]=_[_0x5e4a('0x35')](_0x4c8ba4[_0x5e4a('0x32')],{'$or':_[_0x5e4a('0x23')](_0x4c8ba4[_0x5e4a('0x2c')],function(_0xb007a0){var _0x35d105={};_0x35d105[_0xb007a0]={'$like':'%'+_0x418674[_0x5e4a('0x28')][_0x5e4a('0x37')]+'%'};return _0x35d105;})});}_0x4c8ba4=_[_0x5e4a('0x35')]({},_0x4c8ba4,_0x418674['options']);return _0x39997e[_0x5e4a('0x47')](_0x4c8ba4);}})['then'](function(_0x58b980){if(_0x58b980){_0x4d4841=_0x58b980['length'];if(!_0x418674[_0x5e4a('0x28')][_0x5e4a('0x2e')](_0x5e4a('0x2f'))){_0x4c8ba4[_0x5e4a('0x18')]=qs[_0x5e4a('0x18')](_0x418674[_0x5e4a('0x28')][_0x5e4a('0x18')]);_0x4c8ba4[_0x5e4a('0x17')]=qs[_0x5e4a('0x17')](_0x418674[_0x5e4a('0x28')]['offset']);}return _0x39997e['getSubjects'](_0x4c8ba4);}})[_0x5e4a('0x1e')](function(_0x56d893){if(_0x56d893){return _0x56d893?{'count':_0x4d4841,'rows':_0x56d893}:null;}})[_0x5e4a('0x1e')](respondWithResult(_0x16ee2c,null))[_0x5e4a('0x42')](handleError(_0x16ee2c,null));};exports[_0x5e4a('0x48')]=function(_0xc882ed,_0x3ad5c1,_0xc53afe){var _0x2f11f7={};var _0x4d5525={};var _0x355126;var _0x39f795;return db[_0x5e4a('0x24')][_0x5e4a('0x44')]({'where':{'id':_0xc882ed[_0x5e4a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3ad5c1,null))[_0x5e4a('0x1e')](function(_0x50a33a){if(_0x50a33a){_0x355126=_0x50a33a;_0x4d5525[_0x5e4a('0x2b')]=_[_0x5e4a('0x29')](db[_0x5e4a('0x45')][_0x5e4a('0x25')]);_0x4d5525['query']=_[_0x5e4a('0x29')](_0xc882ed[_0x5e4a('0x28')]);_0x4d5525[_0x5e4a('0x33')]=_['intersection'](_0x4d5525[_0x5e4a('0x2b')],_0x4d5525[_0x5e4a('0x28')]);_0x2f11f7['attributes']=_[_0x5e4a('0x2a')](_0x4d5525[_0x5e4a('0x2b')],qs[_0x5e4a('0x2d')](_0xc882ed[_0x5e4a('0x28')][_0x5e4a('0x2d')]));_0x2f11f7['attributes']=_0x2f11f7[_0x5e4a('0x2c')][_0x5e4a('0x3e')]?_0x2f11f7[_0x5e4a('0x2c')]:_0x4d5525['model'];_0x2f11f7['order']=qs['sort'](_0xc882ed[_0x5e4a('0x28')]['sort']);_0x2f11f7[_0x5e4a('0x32')]=qs[_0x5e4a('0x33')](_[_0x5e4a('0x34')](_0xc882ed[_0x5e4a('0x28')],_0x4d5525[_0x5e4a('0x33')]));if(_0xc882ed[_0x5e4a('0x28')][_0x5e4a('0x37')]){_0x2f11f7['where']=_[_0x5e4a('0x35')](_0x2f11f7[_0x5e4a('0x32')],{'$or':_[_0x5e4a('0x23')](_0x2f11f7[_0x5e4a('0x2c')],function(_0x588c48){var _0x42310d={};_0x42310d[_0x588c48]={'$like':'%'+_0xc882ed['query'][_0x5e4a('0x37')]+'%'};return _0x42310d;})});}_0x2f11f7=_[_0x5e4a('0x35')]({},_0x2f11f7,_0xc882ed['options']);return _0x355126[_0x5e4a('0x48')](_0x2f11f7);}})['then'](function(_0x47ac9d){if(_0x47ac9d){_0x39f795=_0x47ac9d[_0x5e4a('0x3e')];if(!_0xc882ed[_0x5e4a('0x28')][_0x5e4a('0x2e')]('nolimit')){_0x2f11f7[_0x5e4a('0x18')]=qs[_0x5e4a('0x18')](_0xc882ed['query']['limit']);_0x2f11f7[_0x5e4a('0x17')]=qs[_0x5e4a('0x17')](_0xc882ed[_0x5e4a('0x28')][_0x5e4a('0x17')]);}return _0x355126[_0x5e4a('0x48')](_0x2f11f7);}})[_0x5e4a('0x1e')](function(_0x22fc72){if(_0x22fc72){return _0x22fc72?{'count':_0x39f795,'rows':_0x22fc72}:null;}})['then'](respondWithResult(_0x3ad5c1,null))[_0x5e4a('0x42')](handleError(_0x3ad5c1,null));};exports[_0x5e4a('0x49')]=function(_0x54e42b,_0x3aa89e,_0x3f7212){var _0x34c838={};var _0x40edbb={};var _0x4f9f3e;var _0x4c27dc;return db[_0x5e4a('0x24')][_0x5e4a('0x44')]({'where':{'id':_0x54e42b[_0x5e4a('0x3d')]['id']}})[_0x5e4a('0x1e')](handleEntityNotFound(_0x3aa89e,null))[_0x5e4a('0x1e')](function(_0x1f9495){if(_0x1f9495){_0x4f9f3e=_0x1f9495;_0x40edbb['model']=_[_0x5e4a('0x29')](db[_0x5e4a('0x4a')]['rawAttributes']);_0x40edbb[_0x5e4a('0x28')]=_[_0x5e4a('0x29')](_0x54e42b[_0x5e4a('0x28')]);_0x40edbb['filters']=_[_0x5e4a('0x2a')](_0x40edbb['model'],_0x40edbb['query']);_0x34c838['attributes']=_[_0x5e4a('0x2a')](_0x40edbb[_0x5e4a('0x2b')],qs['fields'](_0x54e42b[_0x5e4a('0x28')]['fields']));_0x34c838[_0x5e4a('0x2c')]=_0x34c838[_0x5e4a('0x2c')][_0x5e4a('0x3e')]?_0x34c838[_0x5e4a('0x2c')]:_0x40edbb['model'];_0x34c838[_0x5e4a('0x30')]=qs['sort'](_0x54e42b[_0x5e4a('0x28')][_0x5e4a('0x31')]);_0x34c838[_0x5e4a('0x32')]=qs[_0x5e4a('0x33')](_[_0x5e4a('0x34')](_0x54e42b[_0x5e4a('0x28')],_0x40edbb['filters']));if(_0x54e42b[_0x5e4a('0x28')]['filter']){_0x34c838[_0x5e4a('0x32')]=_[_0x5e4a('0x35')](_0x34c838[_0x5e4a('0x32')],{'$or':_[_0x5e4a('0x23')](_0x34c838[_0x5e4a('0x2c')],function(_0x490765){var _0x2ee00e={};_0x2ee00e[_0x490765]={'$like':'%'+_0x54e42b[_0x5e4a('0x28')][_0x5e4a('0x37')]+'%'};return _0x2ee00e;})});}_0x34c838=_[_0x5e4a('0x35')]({},_0x34c838,_0x54e42b['options']);return _0x4f9f3e[_0x5e4a('0x49')](_0x34c838);}})[_0x5e4a('0x1e')](function(_0x58ceaf){if(_0x58ceaf){_0x4c27dc=_0x58ceaf[_0x5e4a('0x3e')];if(!_0x54e42b['query'][_0x5e4a('0x2e')](_0x5e4a('0x2f'))){_0x34c838[_0x5e4a('0x18')]=qs[_0x5e4a('0x18')](_0x54e42b[_0x5e4a('0x28')][_0x5e4a('0x18')]);_0x34c838[_0x5e4a('0x17')]=qs['offset'](_0x54e42b[_0x5e4a('0x28')][_0x5e4a('0x17')]);}return _0x4f9f3e['getTags'](_0x34c838);}})[_0x5e4a('0x1e')](function(_0x4f564f){if(_0x4f564f){return _0x4f564f?{'count':_0x4c27dc,'rows':_0x4f564f}:null;}})[_0x5e4a('0x1e')](respondWithResult(_0x3aa89e,null))['catch'](handleError(_0x3aa89e,null));};exports[_0x5e4a('0x4b')]=function(_0x12b162,_0x42d68a,_0x519455){if(_0x12b162[_0x5e4a('0x41')]['id']){delete _0x12b162[_0x5e4a('0x41')]['id'];}return db['FreshdeskConfiguration'][_0x5e4a('0x44')]({'where':{'id':_0x12b162[_0x5e4a('0x3d')]['id']}})[_0x5e4a('0x1e')](handleEntityNotFound(_0x42d68a,null))['then'](function(_0xadf5b5){if(_0xadf5b5){return _0xadf5b5['setTags'](_0x12b162[_0x5e4a('0x41')]['ids']||[]);}return null;})[_0x5e4a('0x1e')](respondWithResult(_0x42d68a,null))[_0x5e4a('0x42')](handleError(_0x42d68a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c2934d8..70a02b8 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 _0x26cb=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x4f144e,_0x75ab72){var _0x7735e8=function(_0x3e4d5d){while(--_0x3e4d5d){_0x4f144e['push'](_0x4f144e['shift']());}};_0x7735e8(++_0x75ab72);}(_0x26cb,0x1c7));var _0xb26c=function(_0x238ad7,_0x1f8412){_0x238ad7=_0x238ad7-0x0;var _0xbed449=_0x26cb[_0x238ad7];return _0xbed449;};'use strict';var _=require('lodash');var util=require(_0xb26c('0x0'));var logger=require(_0xb26c('0x1'))(_0xb26c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb26c('0x3'));var rimraf=require(_0xb26c('0x4'));var config=require(_0xb26c('0x5'));var attributes=require(_0xb26c('0x6'));module[_0xb26c('0x7')]=function(_0x1b04d2,_0x1d47b6){return _0x1b04d2[_0xb26c('0x8')](_0xb26c('0x9'),attributes,{'tableName':_0xb26c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf83e=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','util','api','moment','bluebird','request-promise','path'];(function(_0x2c9725,_0xba430d){var _0x26b14b=function(_0x10f3c2){while(--_0x10f3c2){_0x2c9725['push'](_0x2c9725['shift']());}};_0x26b14b(++_0xba430d);}(_0xf83e,0xf7));var _0xef83=function(_0x567703,_0x4b1cfa){_0x567703=_0x567703-0x0;var _0x1cd94a=_0xf83e[_0x567703];return _0x1cd94a;};'use strict';var _=require('lodash');var util=require(_0xef83('0x0'));var logger=require('../../config/logger')(_0xef83('0x1'));var moment=require(_0xef83('0x2'));var BPromise=require(_0xef83('0x3'));var rp=require(_0xef83('0x4'));var fs=require('fs');var path=require(_0xef83('0x5'));var rimraf=require(_0xef83('0x6'));var config=require(_0xef83('0x7'));var attributes=require(_0xef83('0x8'));module['exports']=function(_0x374465,_0x3b48fb){return _0x374465[_0xef83('0x9')](_0xef83('0xa'),attributes,{'tableName':'int_freshdesk_configurations','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 597ef67..e7a1695 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 _0x9ed1=['request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/environment','client','http','then','info'];(function(_0x376ac7,_0xe8ddfd){var _0x2463df=function(_0x1559b3){while(--_0x1559b3){_0x376ac7['push'](_0x376ac7['shift']());}};_0x2463df(++_0xe8ddfd);}(_0x9ed1,0x98));var _0x19ed=function(_0x547e67,_0x383ce6){_0x547e67=_0x547e67-0x0;var _0x59738c=_0x9ed1[_0x547e67];return _0x59738c;};'use strict';var _=require(_0x19ed('0x0'));var util=require(_0x19ed('0x1'));var moment=require(_0x19ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19ed('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x19ed('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x19ed('0x6')][_0x19ed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bdc28,_0x43b351,_0xdefe44){return new BPromise(function(_0x6d71dc,_0x2bf92d){return client['request'](_0x5bdc28,_0xdefe44)[_0x19ed('0x8')](function(_0x1fa710){logger[_0x19ed('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x43b351,_0x19ed('0xa'));logger['debug'](_0x19ed('0xb'),_0x43b351,_0x19ed('0xa'),JSON['stringify'](_0x1fa710));if(_0x1fa710[_0x19ed('0xc')]){if(_0x1fa710[_0x19ed('0xc')][_0x19ed('0xd')]===0x1f4){logger[_0x19ed('0xc')](_0x19ed('0xe'),_0x43b351,_0x1fa710[_0x19ed('0xc')][_0x19ed('0xf')]);return _0x2bf92d(_0x1fa710[_0x19ed('0xc')][_0x19ed('0xf')]);}logger[_0x19ed('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x43b351,_0x1fa710['error'][_0x19ed('0xf')]);return _0x6d71dc(_0x1fa710[_0x19ed('0xc')][_0x19ed('0xf')]);}else{logger[_0x19ed('0x9')](_0x19ed('0xe'),_0x43b351,_0x19ed('0xa'));_0x6d71dc(_0x1fa710[_0x19ed('0x10')]['message']);}})[_0x19ed('0x11')](function(_0x95ddf9){logger[_0x19ed('0xc')](_0x19ed('0xe'),_0x43b351,_0x95ddf9);_0x2bf92d(_0x95ddf9);});});} \ No newline at end of file +var _0xa383=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x57989a,_0x3065c1){var _0x154d54=function(_0x3aa379){while(--_0x3aa379){_0x57989a['push'](_0x57989a['shift']());}};_0x154d54(++_0x3065c1);}(_0xa383,0x164));var _0x3a38=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa383[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x3a38('0x0'));var util=require(_0x3a38('0x1'));var moment=require(_0x3a38('0x2'));var BPromise=require(_0x3a38('0x3'));var rs=require(_0x3a38('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a38('0x5'))['db'];var utils=require(_0x3a38('0x6'));var logger=require(_0x3a38('0x7'))(_0x3a38('0x8'));var config=require(_0x3a38('0x9'));var jayson=require(_0x3a38('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aaf57,_0x4abf97,_0x2b70c2){return new BPromise(function(_0x3ae10e,_0x26dfe3){return client[_0x3a38('0xb')](_0x5aaf57,_0x2b70c2)['then'](function(_0x43c45a){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4abf97,'request\x20sent');logger[_0x3a38('0xc')](_0x3a38('0xd'),_0x4abf97,'request\x20sent',JSON[_0x3a38('0xe')](_0x43c45a));if(_0x43c45a[_0x3a38('0xf')]){if(_0x43c45a[_0x3a38('0xf')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4abf97,_0x43c45a[_0x3a38('0xf')]['message']);return _0x26dfe3(_0x43c45a['error'][_0x3a38('0x10')]);}logger[_0x3a38('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4abf97,_0x43c45a[_0x3a38('0xf')][_0x3a38('0x10')]);return _0x3ae10e(_0x43c45a[_0x3a38('0xf')]['message']);}else{logger[_0x3a38('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4abf97,_0x3a38('0x12'));_0x3ae10e(_0x43c45a['result'][_0x3a38('0x10')]);}})['catch'](function(_0x169e27){logger[_0x3a38('0xf')](_0x3a38('0x13'),_0x4abf97,_0x169e27);_0x26dfe3(_0x169e27);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index fe40e92..c40f467 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 _0x0ab4=['index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x2d1d51,_0x5b278f){var _0x474ee7=function(_0x3ad293){while(--_0x3ad293){_0x2d1d51['push'](_0x2d1d51['shift']());}};_0x474ee7(++_0x5b278f);}(_0x0ab4,0xf3));var _0x40ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ab4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x40ab('0x0'));var util=require(_0x40ab('0x1'));var path=require(_0x40ab('0x2'));var timeout=require(_0x40ab('0x3'));var express=require('express');var router=express[_0x40ab('0x4')]();var fs_extra=require(_0x40ab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x40ab('0x6'));var config=require(_0x40ab('0x7'));var controller=require(_0x40ab('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x40ab('0x9')]);router[_0x40ab('0xa')](_0x40ab('0xb'),auth[_0x40ab('0xc')](),controller[_0x40ab('0xd')]);router[_0x40ab('0xe')]('/',auth[_0x40ab('0xc')](),controller[_0x40ab('0xf')]);router[_0x40ab('0x10')](_0x40ab('0xb'),auth[_0x40ab('0xc')](),controller[_0x40ab('0x11')]);router[_0x40ab('0x12')](_0x40ab('0xb'),auth['isAuthenticated'](),controller[_0x40ab('0x13')]);module[_0x40ab('0x14')]=router; \ No newline at end of file +var _0x94a7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','put','update','destroy','exports','multer','util'];(function(_0x87f881,_0x57c4e6){var _0x57db3a=function(_0x20503a){while(--_0x20503a){_0x87f881['push'](_0x87f881['shift']());}};_0x57db3a(++_0x57c4e6);}(_0x94a7,0xa0));var _0x794a=function(_0x213560,_0x26e9ba){_0x213560=_0x213560-0x0;var _0xb1e3bd=_0x94a7[_0x213560];return _0xb1e3bd;};'use strict';var multer=require(_0x794a('0x0'));var util=require(_0x794a('0x1'));var path=require(_0x794a('0x2'));var timeout=require(_0x794a('0x3'));var express=require(_0x794a('0x4'));var router=express[_0x794a('0x5')]();var fs_extra=require(_0x794a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x794a('0x7'));var config=require(_0x794a('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x794a('0x9')]('/',auth['isAuthenticated'](),controller[_0x794a('0xa')]);router['get'](_0x794a('0xb'),auth[_0x794a('0xc')](),controller['show']);router[_0x794a('0xd')]('/',auth[_0x794a('0xc')](),controller['create']);router[_0x794a('0xe')](_0x794a('0xb'),auth[_0x794a('0xc')](),controller[_0x794a('0xf')]);router['delete'](_0x794a('0xb'),auth['isAuthenticated'](),controller[_0x794a('0x10')]);module[_0x794a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index c4243be..a90467a 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 _0x776e=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x776e,0x94));var _0xe776=function(_0x2c96f8,_0x4c3c0c){_0x2c96f8=_0x2c96f8-0x0;var _0x2976b7=_0x776e[_0x2c96f8];return _0x2976b7;};'use strict';var Sequelize=require(_0xe776('0x0'));module['exports']={'type':{'type':Sequelize[_0xe776('0x1')]('string',_0xe776('0x2'),_0xe776('0x3'),_0xe776('0x4'),_0xe776('0x5')),'defaultValue':_0xe776('0x6')},'content':{'type':Sequelize[_0xe776('0x7')]},'key':{'type':Sequelize[_0xe776('0x7')]},'keyType':{'type':Sequelize[_0xe776('0x1')](_0xe776('0x6'),_0xe776('0x2'),_0xe776('0x3'))},'keyContent':{'type':Sequelize[_0xe776('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe776('0x7')]},'customField':{'type':Sequelize[_0xe776('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe776('0x7')]}}; \ No newline at end of file +var _0x4004=['variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x64cc60,_0xb6b24b){var _0x6f968e=function(_0x4e8def){while(--_0x4e8def){_0x64cc60['push'](_0x64cc60['shift']());}};_0x6f968e(++_0xb6b24b);}(_0x4004,0xa8));var _0x4400=function(_0x43c223,_0x2d61d9){_0x43c223=_0x43c223-0x0;var _0x2299a7=_0x4004[_0x43c223];return _0x2299a7;};'use strict';var Sequelize=require(_0x4400('0x0'));module[_0x4400('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4400('0x2'),_0x4400('0x3'),'customVariable','keyValue',_0x4400('0x4')),'defaultValue':_0x4400('0x2')},'content':{'type':Sequelize[_0x4400('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4400('0x6')]('string',_0x4400('0x3'),_0x4400('0x7'))},'keyContent':{'type':Sequelize[_0x4400('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4400('0x5')]},'customField':{'type':Sequelize[_0x4400('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4400('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7cecabd..df918fe 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 _0x19ea=['attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','include','findAll','catch','show','fields','includeAll','merge','find','create','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19ea,0xfe));var _0xa19e=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x19ea[_0x4017b0];return _0x5ed4f7;};'use strict';var emlformat=require(_0xa19e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa19e('0x1'));var rp=require('request-promise');var moment=require(_0xa19e('0x2'));var BPromise=require(_0xa19e('0x3'));var Mustache=require(_0xa19e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa19e('0x5'));var csv=require(_0xa19e('0x6'));var ejs=require(_0xa19e('0x7'));var fs=require('fs');var fs_extra=require(_0xa19e('0x8'));var _=require(_0xa19e('0x9'));var squel=require(_0xa19e('0xa'));var crypto=require(_0xa19e('0xb'));var jsforce=require(_0xa19e('0xc'));var deskjs=require(_0xa19e('0xd'));var toCsv=require(_0xa19e('0x6'));var querystring=require(_0xa19e('0xe'));var Papa=require('papaparse');var Redis=require(_0xa19e('0xf'));var authService=require(_0xa19e('0x10'));var qs=require(_0xa19e('0x11'));var as=require(_0xa19e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa19e('0x13'))(_0xa19e('0x14'));var utils=require(_0xa19e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa19e('0x16'));var db=require(_0xa19e('0x17'))['db'];function respondWithStatusCode(_0xc781a2,_0x1bd1f5){_0x1bd1f5=_0x1bd1f5||0xcc;return function(_0x35ca5b){if(_0x35ca5b){return _0xc781a2['sendStatus'](_0x1bd1f5);}return _0xc781a2[_0xa19e('0x18')](_0x1bd1f5)[_0xa19e('0x19')]();};}function respondWithResult(_0xa7e0c4,_0x28dedd){_0x28dedd=_0x28dedd||0xc8;return function(_0x564d2a){if(_0x564d2a){return _0xa7e0c4[_0xa19e('0x18')](_0x28dedd)[_0xa19e('0x1a')](_0x564d2a);}};}function respondWithFilteredResult(_0x245bcb,_0x3be281){return function(_0x1fdea2){if(_0x1fdea2){var _0x2598f5=typeof _0x3be281['offset']===_0xa19e('0x1b')&&typeof _0x3be281[_0xa19e('0x1c')]===_0xa19e('0x1b');var _0x256819=_0x1fdea2[_0xa19e('0x1d')];var _0x38e398=_0x2598f5?0x0:_0x3be281[_0xa19e('0x1e')];var _0x530a75=_0x2598f5?_0x1fdea2[_0xa19e('0x1d')]:_0x3be281['offset']+_0x3be281[_0xa19e('0x1c')];var _0x5d05fd;if(_0x530a75>=_0x256819){_0x530a75=_0x256819;_0x5d05fd=0xc8;}else{_0x5d05fd=0xce;}_0x245bcb['status'](_0x5d05fd);return _0x245bcb[_0xa19e('0x1f')](_0xa19e('0x20'),_0x38e398+'-'+_0x530a75+'/'+_0x256819)['json'](_0x1fdea2);}return null;};}function patchUpdates(_0x1cb9f9){return function(_0x3f2060){try{jsonpatch[_0xa19e('0x21')](_0x3f2060,_0x1cb9f9,!![]);}catch(_0x93eb86){return BPromise['reject'](_0x93eb86);}return _0x3f2060[_0xa19e('0x22')]();};}function saveUpdates(_0x33b588,_0x105874){return function(_0x301f6d){if(_0x301f6d){return _0x301f6d[_0xa19e('0x23')](_0x33b588)[_0xa19e('0x24')](function(_0x2a416e){return _0x2a416e;});}return null;};}function removeEntity(_0x20a649,_0xc16a44){return function(_0x536386){if(_0x536386){return _0x536386[_0xa19e('0x25')]()[_0xa19e('0x24')](function(){_0x20a649['status'](0xcc)[_0xa19e('0x19')]();});}};}function handleEntityNotFound(_0x1d3ce6,_0x4e06b8){return function(_0x20b05c){if(!_0x20b05c){_0x1d3ce6[_0xa19e('0x26')](0x194);}return _0x20b05c;};}function handleError(_0x5d5559,_0x40dc1c){_0x40dc1c=_0x40dc1c||0x1f4;return function(_0x10682d){logger[_0xa19e('0x27')](_0x10682d[_0xa19e('0x28')]);if(_0x10682d[_0xa19e('0x29')]){delete _0x10682d[_0xa19e('0x29')];}_0x5d5559[_0xa19e('0x18')](_0x40dc1c)[_0xa19e('0x2a')](_0x10682d);};}exports[_0xa19e('0x2b')]=function(_0x24dd51,_0x30e490){var _0x3d1cae={},_0x1ce643={},_0x475a26={'count':0x0,'rows':[]};var _0xdf0b20=_[_0xa19e('0x2c')](db[_0xa19e('0x2d')][_0xa19e('0x2e')],function(_0x3dcd74){return{'name':_0x3dcd74[_0xa19e('0x2f')],'type':_0x3dcd74['type'][_0xa19e('0x30')]};});_0x1ce643[_0xa19e('0x31')]=_[_0xa19e('0x2c')](_0xdf0b20,_0xa19e('0x29'));_0x1ce643[_0xa19e('0x32')]=_[_0xa19e('0x33')](_0x24dd51['query']);_0x1ce643[_0xa19e('0x34')]=_[_0xa19e('0x35')](_0x1ce643['model'],_0x1ce643[_0xa19e('0x32')]);_0x3d1cae['attributes']=_['intersection'](_0x1ce643[_0xa19e('0x31')],qs['fields'](_0x24dd51['query']['fields']));_0x3d1cae[_0xa19e('0x36')]=_0x3d1cae[_0xa19e('0x36')][_0xa19e('0x37')]?_0x3d1cae['attributes']:_0x1ce643[_0xa19e('0x31')];if(!_0x24dd51[_0xa19e('0x32')][_0xa19e('0x38')](_0xa19e('0x39'))){_0x3d1cae[_0xa19e('0x1c')]=qs[_0xa19e('0x1c')](_0x24dd51['query'][_0xa19e('0x1c')]);_0x3d1cae[_0xa19e('0x1e')]=qs['offset'](_0x24dd51[_0xa19e('0x32')][_0xa19e('0x1e')]);}_0x3d1cae[_0xa19e('0x3a')]=qs['sort'](_0x24dd51['query'][_0xa19e('0x3b')]);_0x3d1cae['where']=qs[_0xa19e('0x34')](_[_0xa19e('0x3c')](_0x24dd51[_0xa19e('0x32')],_0x1ce643[_0xa19e('0x34')]),_0xdf0b20);if(_0x24dd51['query'][_0xa19e('0x3d')]){_0x3d1cae[_0xa19e('0x3e')]=_['merge'](_0x3d1cae[_0xa19e('0x3e')],{'$or':_['map'](_0xdf0b20,function(_0x374201){if(_0x374201[_0xa19e('0x3f')]!==_0xa19e('0x40')){var _0x5ed1ce={};_0x5ed1ce[_0x374201[_0xa19e('0x29')]]={'$like':'%'+_0x24dd51[_0xa19e('0x32')][_0xa19e('0x3d')]+'%'};return _0x5ed1ce;}})});}_0x3d1cae=_['merge']({},_0x3d1cae,_0x24dd51[_0xa19e('0x41')]);var _0x244ee5={'where':_0x3d1cae['where']};return db['FreshdeskField'][_0xa19e('0x1d')](_0x244ee5)[_0xa19e('0x24')](function(_0x5dd159){_0x475a26[_0xa19e('0x1d')]=_0x5dd159;if(_0x24dd51[_0xa19e('0x32')]['includeAll']){_0x3d1cae[_0xa19e('0x42')]=[{'all':!![]}];}return db[_0xa19e('0x2d')][_0xa19e('0x43')](_0x3d1cae);})[_0xa19e('0x24')](function(_0x30fdfb){_0x475a26['rows']=_0x30fdfb;return _0x475a26;})[_0xa19e('0x24')](respondWithFilteredResult(_0x30e490,_0x3d1cae))[_0xa19e('0x44')](handleError(_0x30e490,null));};exports[_0xa19e('0x45')]=function(_0x29d254,_0x124e8c){var _0x51f0f4={'raw':!![],'where':{'id':_0x29d254['params']['id']}},_0x315341={};_0x315341[_0xa19e('0x31')]=_[_0xa19e('0x33')](db['FreshdeskField'][_0xa19e('0x2e')]);_0x315341[_0xa19e('0x32')]=_['keys'](_0x29d254[_0xa19e('0x32')]);_0x315341['filters']=_[_0xa19e('0x35')](_0x315341[_0xa19e('0x31')],_0x315341[_0xa19e('0x32')]);_0x51f0f4[_0xa19e('0x36')]=_[_0xa19e('0x35')](_0x315341[_0xa19e('0x31')],qs[_0xa19e('0x46')](_0x29d254[_0xa19e('0x32')]['fields']));_0x51f0f4[_0xa19e('0x36')]=_0x51f0f4[_0xa19e('0x36')]['length']?_0x51f0f4['attributes']:_0x315341[_0xa19e('0x31')];if(_0x29d254[_0xa19e('0x32')][_0xa19e('0x47')]){_0x51f0f4['include']=[{'all':!![]}];}_0x51f0f4=_[_0xa19e('0x48')]({},_0x51f0f4,_0x29d254[_0xa19e('0x41')]);return db['FreshdeskField'][_0xa19e('0x49')](_0x51f0f4)[_0xa19e('0x24')](handleEntityNotFound(_0x124e8c,null))[_0xa19e('0x24')](respondWithResult(_0x124e8c,null))['catch'](handleError(_0x124e8c,null));};exports[_0xa19e('0x4a')]=function(_0x52cf31,_0x349543){return db[_0xa19e('0x2d')][_0xa19e('0x4a')](_0x52cf31[_0xa19e('0x4b')],{})[_0xa19e('0x24')](respondWithResult(_0x349543,0xc9))['catch'](handleError(_0x349543,null));};exports[_0xa19e('0x23')]=function(_0x4c90fe,_0x4779d8){if(_0x4c90fe['body']['id']){delete _0x4c90fe[_0xa19e('0x4b')]['id'];}return db[_0xa19e('0x2d')][_0xa19e('0x49')]({'where':{'id':_0x4c90fe[_0xa19e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4779d8,null))[_0xa19e('0x24')](saveUpdates(_0x4c90fe[_0xa19e('0x4b')],null))[_0xa19e('0x24')](respondWithResult(_0x4779d8,null))[_0xa19e('0x44')](handleError(_0x4779d8,null));};exports['destroy']=function(_0x454c9f,_0x5ae431){return db[_0xa19e('0x2d')][_0xa19e('0x49')]({'where':{'id':_0x454c9f[_0xa19e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ae431,null))[_0xa19e('0x24')](removeEntity(_0x5ae431,null))[_0xa19e('0x44')](handleError(_0x5ae431,null));}; \ No newline at end of file +var _0xd139=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x5e7b05,_0x16f42f){var _0x44e1ef=function(_0x18aa38){while(--_0x18aa38){_0x5e7b05['push'](_0x5e7b05['shift']());}};_0x44e1ef(++_0x16f42f);}(_0xd139,0x14e));var _0x9d13=function(_0x5e56f3,_0x107965){_0x5e56f3=_0x5e56f3-0x0;var _0x356077=_0xd139[_0x5e56f3];return _0x356077;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];function respondWithStatusCode(_0x3933d1,_0x39020){_0x39020=_0x39020||0xcc;return function(_0x331fea){if(_0x331fea){return _0x3933d1[_0x9d13('0x16')](_0x39020);}return _0x3933d1['status'](_0x39020)['end']();};}function respondWithResult(_0x37607a,_0x43bf27){_0x43bf27=_0x43bf27||0xc8;return function(_0x2f5442){if(_0x2f5442){return _0x37607a[_0x9d13('0x17')](_0x43bf27)[_0x9d13('0x18')](_0x2f5442);}};}function respondWithFilteredResult(_0x1a2b65,_0x38f368){return function(_0x47bcd3){if(_0x47bcd3){var _0x3acfc1=typeof _0x38f368[_0x9d13('0x19')]===_0x9d13('0x1a')&&typeof _0x38f368[_0x9d13('0x1b')]===_0x9d13('0x1a');var _0x42d5a5=_0x47bcd3[_0x9d13('0x1c')];var _0x10aa89=_0x3acfc1?0x0:_0x38f368[_0x9d13('0x19')];var _0x2acb0b=_0x3acfc1?_0x47bcd3[_0x9d13('0x1c')]:_0x38f368[_0x9d13('0x19')]+_0x38f368[_0x9d13('0x1b')];var _0x4d6b9d;if(_0x2acb0b>=_0x42d5a5){_0x2acb0b=_0x42d5a5;_0x4d6b9d=0xc8;}else{_0x4d6b9d=0xce;}_0x1a2b65[_0x9d13('0x17')](_0x4d6b9d);return _0x1a2b65[_0x9d13('0x1d')](_0x9d13('0x1e'),_0x10aa89+'-'+_0x2acb0b+'/'+_0x42d5a5)[_0x9d13('0x18')](_0x47bcd3);}return null;};}function patchUpdates(_0x4e1425){return function(_0x48ce3d){try{jsonpatch['apply'](_0x48ce3d,_0x4e1425,!![]);}catch(_0x223ea5){return BPromise[_0x9d13('0x1f')](_0x223ea5);}return _0x48ce3d[_0x9d13('0x20')]();};}function saveUpdates(_0x1fefe4,_0x3971e0){return function(_0x3040e7){if(_0x3040e7){return _0x3040e7[_0x9d13('0x21')](_0x1fefe4)[_0x9d13('0x22')](function(_0x5d14c8){return _0x5d14c8;});}return null;};}function removeEntity(_0xb34817,_0xd5a981){return function(_0x22963f){if(_0x22963f){return _0x22963f[_0x9d13('0x23')]()['then'](function(){_0xb34817[_0x9d13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c673,_0xfaf587){return function(_0xe0c57){if(!_0xe0c57){_0x40c673[_0x9d13('0x16')](0x194);}return _0xe0c57;};}function handleError(_0x453536,_0x45a299){_0x45a299=_0x45a299||0x1f4;return function(_0x1c36e5){logger[_0x9d13('0x24')](_0x1c36e5['stack']);if(_0x1c36e5[_0x9d13('0x25')]){delete _0x1c36e5['name'];}_0x453536[_0x9d13('0x17')](_0x45a299)[_0x9d13('0x26')](_0x1c36e5);};}exports[_0x9d13('0x27')]=function(_0x1d9f56,_0x5ebfaf){var _0x23c91f={},_0x441118={},_0x3dcc6c={'count':0x0,'rows':[]};var _0x34e5df=_[_0x9d13('0x28')](db[_0x9d13('0x29')][_0x9d13('0x2a')],function(_0x523e5e){return{'name':_0x523e5e[_0x9d13('0x2b')],'type':_0x523e5e['type'][_0x9d13('0x2c')]};});_0x441118[_0x9d13('0x2d')]=_['map'](_0x34e5df,_0x9d13('0x25'));_0x441118[_0x9d13('0x2e')]=_['keys'](_0x1d9f56['query']);_0x441118['filters']=_[_0x9d13('0x2f')](_0x441118['model'],_0x441118[_0x9d13('0x2e')]);_0x23c91f[_0x9d13('0x30')]=_[_0x9d13('0x2f')](_0x441118['model'],qs[_0x9d13('0x31')](_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x31')]));_0x23c91f[_0x9d13('0x30')]=_0x23c91f['attributes']['length']?_0x23c91f[_0x9d13('0x30')]:_0x441118[_0x9d13('0x2d')];if(!_0x1d9f56['query'][_0x9d13('0x32')](_0x9d13('0x33'))){_0x23c91f[_0x9d13('0x1b')]=qs[_0x9d13('0x1b')](_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x1b')]);_0x23c91f[_0x9d13('0x19')]=qs['offset'](_0x1d9f56[_0x9d13('0x2e')]['offset']);}_0x23c91f['order']=qs['sort'](_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x34')]);_0x23c91f[_0x9d13('0x35')]=qs[_0x9d13('0x36')](_[_0x9d13('0x37')](_0x1d9f56['query'],_0x441118[_0x9d13('0x36')]),_0x34e5df);if(_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x38')]){_0x23c91f[_0x9d13('0x35')]=_[_0x9d13('0x39')](_0x23c91f[_0x9d13('0x35')],{'$or':_['map'](_0x34e5df,function(_0x3f2bb9){if(_0x3f2bb9[_0x9d13('0x3a')]!==_0x9d13('0x3b')){var _0x547a6b={};_0x547a6b[_0x3f2bb9['name']]={'$like':'%'+_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x38')]+'%'};return _0x547a6b;}})});}_0x23c91f=_[_0x9d13('0x39')]({},_0x23c91f,_0x1d9f56['options']);var _0x206f29={'where':_0x23c91f[_0x9d13('0x35')]};return db['FreshdeskField'][_0x9d13('0x1c')](_0x206f29)[_0x9d13('0x22')](function(_0x4635b5){_0x3dcc6c[_0x9d13('0x1c')]=_0x4635b5;if(_0x1d9f56[_0x9d13('0x2e')][_0x9d13('0x3c')]){_0x23c91f[_0x9d13('0x3d')]=[{'all':!![]}];}return db[_0x9d13('0x29')][_0x9d13('0x3e')](_0x23c91f);})['then'](function(_0x56943){_0x3dcc6c[_0x9d13('0x3f')]=_0x56943;return _0x3dcc6c;})[_0x9d13('0x22')](respondWithFilteredResult(_0x5ebfaf,_0x23c91f))[_0x9d13('0x40')](handleError(_0x5ebfaf,null));};exports[_0x9d13('0x41')]=function(_0x20e89e,_0x395972){var _0x5635f4={'raw':!![],'where':{'id':_0x20e89e[_0x9d13('0x42')]['id']}},_0x30114a={};_0x30114a[_0x9d13('0x2d')]=_[_0x9d13('0x43')](db[_0x9d13('0x29')][_0x9d13('0x2a')]);_0x30114a['query']=_['keys'](_0x20e89e[_0x9d13('0x2e')]);_0x30114a['filters']=_[_0x9d13('0x2f')](_0x30114a['model'],_0x30114a[_0x9d13('0x2e')]);_0x5635f4[_0x9d13('0x30')]=_[_0x9d13('0x2f')](_0x30114a[_0x9d13('0x2d')],qs[_0x9d13('0x31')](_0x20e89e['query'][_0x9d13('0x31')]));_0x5635f4[_0x9d13('0x30')]=_0x5635f4[_0x9d13('0x30')][_0x9d13('0x44')]?_0x5635f4[_0x9d13('0x30')]:_0x30114a[_0x9d13('0x2d')];if(_0x20e89e[_0x9d13('0x2e')][_0x9d13('0x3c')]){_0x5635f4[_0x9d13('0x3d')]=[{'all':!![]}];}_0x5635f4=_[_0x9d13('0x39')]({},_0x5635f4,_0x20e89e['options']);return db['FreshdeskField'][_0x9d13('0x45')](_0x5635f4)[_0x9d13('0x22')](handleEntityNotFound(_0x395972,null))['then'](respondWithResult(_0x395972,null))[_0x9d13('0x40')](handleError(_0x395972,null));};exports['create']=function(_0xd81e84,_0x20b834){return db['FreshdeskField']['create'](_0xd81e84[_0x9d13('0x46')],{})[_0x9d13('0x22')](respondWithResult(_0x20b834,0xc9))[_0x9d13('0x40')](handleError(_0x20b834,null));};exports[_0x9d13('0x21')]=function(_0x35865e,_0x70514d){if(_0x35865e[_0x9d13('0x46')]['id']){delete _0x35865e[_0x9d13('0x46')]['id'];}return db[_0x9d13('0x29')]['find']({'where':{'id':_0x35865e[_0x9d13('0x42')]['id']}})['then'](handleEntityNotFound(_0x70514d,null))['then'](saveUpdates(_0x35865e[_0x9d13('0x46')],null))['then'](respondWithResult(_0x70514d,null))[_0x9d13('0x40')](handleError(_0x70514d,null));};exports[_0x9d13('0x23')]=function(_0x3457e5,_0x5dde68){return db[_0x9d13('0x29')][_0x9d13('0x45')]({'where':{'id':_0x3457e5['params']['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x5dde68,null))[_0x9d13('0x22')](removeEntity(_0x5dde68,null))[_0x9d13('0x40')](handleError(_0x5dde68,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index bc1b627..182c627 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 _0xecd0=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x12a66f,_0x30e98d){var _0x36a7d9=function(_0x235039){while(--_0x235039){_0x12a66f['push'](_0x12a66f['shift']());}};_0x36a7d9(++_0x30e98d);}(_0xecd0,0x162));var _0x0ecd=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0xecd0[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var logger=require(_0x0ecd('0x2'))(_0x0ecd('0x3'));var moment=require(_0x0ecd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ecd('0x5'));var fs=require('fs');var path=require(_0x0ecd('0x6'));var rimraf=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x0ecd('0x9')]=function(_0x1cde06,_0xff2f1c){return _0x1cde06[_0x0ecd('0xa')](_0x0ecd('0xb'),attributes,{'tableName':_0x0ecd('0xc'),'paranoid':![],'indexes':[{'name':_0x0ecd('0xd'),'fields':[_0x0ecd('0xe'),_0x0ecd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee81=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash'];(function(_0x4de6b4,_0x4bc89f){var _0x58febb=function(_0x52b390){while(--_0x52b390){_0x4de6b4['push'](_0x4de6b4['shift']());}};_0x58febb(++_0x4bc89f);}(_0xee81,0x15e));var _0x1ee8=function(_0x307fcf,_0x394370){_0x307fcf=_0x307fcf-0x0;var _0x35522f=_0xee81[_0x307fcf];return _0x35522f;};'use strict';var _=require(_0x1ee8('0x0'));var util=require(_0x1ee8('0x1'));var logger=require(_0x1ee8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1ee8('0x3'));var rp=require(_0x1ee8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ee8('0x5'));var config=require(_0x1ee8('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x1ee8('0x7')]=function(_0xd6987,_0x1f303b){return _0xd6987[_0x1ee8('0x8')](_0x1ee8('0x9'),attributes,{'tableName':_0x1ee8('0xa'),'paranoid':![],'indexes':[{'name':_0x1ee8('0xb'),'fields':[_0x1ee8('0xc'),'FieldId'],'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 a61ada1..68b25ae 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 _0xb295=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x200cda,_0x302b96){var _0x487bd6=function(_0x2e0dd6){while(--_0x2e0dd6){_0x200cda['push'](_0x200cda['shift']());}};_0x487bd6(++_0x302b96);}(_0xb295,0x1b4));var _0x5b29=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb295[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x5b29('0x0'));var util=require(_0x5b29('0x1'));var moment=require(_0x5b29('0x2'));var BPromise=require(_0x5b29('0x3'));var rs=require(_0x5b29('0x4'));var fs=require('fs');var Redis=require(_0x5b29('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b29('0x6'));var logger=require(_0x5b29('0x7'))(_0x5b29('0x8'));var config=require(_0x5b29('0x9'));var jayson=require(_0x5b29('0xa'));var client=jayson['client'][_0x5b29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x263009,_0x2adda0,_0x5eabdd){return new BPromise(function(_0x5f55d0,_0x46fb6d){return client[_0x5b29('0xc')](_0x263009,_0x5eabdd)[_0x5b29('0xd')](function(_0x21b4e7){logger[_0x5b29('0xe')](_0x5b29('0xf'),_0x2adda0,_0x5b29('0x10'));logger[_0x5b29('0x11')](_0x5b29('0x12'),_0x2adda0,'request\x20sent',JSON[_0x5b29('0x13')](_0x21b4e7));if(_0x21b4e7[_0x5b29('0x14')]){if(_0x21b4e7['error'][_0x5b29('0x15')]===0x1f4){logger[_0x5b29('0x14')](_0x5b29('0xf'),_0x2adda0,_0x21b4e7[_0x5b29('0x14')][_0x5b29('0x16')]);return _0x46fb6d(_0x21b4e7['error'][_0x5b29('0x16')]);}logger[_0x5b29('0x14')](_0x5b29('0xf'),_0x2adda0,_0x21b4e7['error'][_0x5b29('0x16')]);return _0x5f55d0(_0x21b4e7[_0x5b29('0x14')][_0x5b29('0x16')]);}else{logger['info'](_0x5b29('0xf'),_0x2adda0,_0x5b29('0x10'));_0x5f55d0(_0x21b4e7['result'][_0x5b29('0x16')]);}})[_0x5b29('0x17')](function(_0x158e44){logger[_0x5b29('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x2adda0,_0x158e44);_0x46fb6d(_0x158e44);});});} \ No newline at end of file +var _0xd1de=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0xd1de,0x1e4));var _0xed1d=function(_0x4f63f6,_0x54f160){_0x4f63f6=_0x4f63f6-0x0;var _0x44e4e9=_0xd1de[_0x4f63f6];return _0x44e4e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed1d('0x0'));var BPromise=require('bluebird');var rs=require(_0xed1d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed1d('0x2'))['db'];var utils=require(_0xed1d('0x3'));var logger=require(_0xed1d('0x4'))('rpc');var config=require(_0xed1d('0x5'));var jayson=require(_0xed1d('0x6'));var client=jayson[_0xed1d('0x7')][_0xed1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2356ce,_0x41d432,_0x3faf25){return new BPromise(function(_0x4ec7d9,_0x4d8978){return client[_0xed1d('0x9')](_0x2356ce,_0x3faf25)[_0xed1d('0xa')](function(_0x5bc6d1){logger[_0xed1d('0xb')](_0xed1d('0xc'),_0x41d432,'request\x20sent');logger[_0xed1d('0xd')](_0xed1d('0xe'),_0x41d432,'request\x20sent',JSON[_0xed1d('0xf')](_0x5bc6d1));if(_0x5bc6d1[_0xed1d('0x10')]){if(_0x5bc6d1[_0xed1d('0x10')][_0xed1d('0x11')]===0x1f4){logger[_0xed1d('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x41d432,_0x5bc6d1['error'][_0xed1d('0x12')]);return _0x4d8978(_0x5bc6d1[_0xed1d('0x10')][_0xed1d('0x12')]);}logger[_0xed1d('0x10')](_0xed1d('0xc'),_0x41d432,_0x5bc6d1[_0xed1d('0x10')]['message']);return _0x4ec7d9(_0x5bc6d1[_0xed1d('0x10')]['message']);}else{logger[_0xed1d('0xb')](_0xed1d('0xc'),_0x41d432,_0xed1d('0x13'));_0x4ec7d9(_0x5bc6d1[_0xed1d('0x14')][_0xed1d('0x12')]);}})[_0xed1d('0x15')](function(_0x274591){logger[_0xed1d('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x41d432,_0x274591);_0x4d8978(_0x274591);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 612793c..1f597ae 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 _0xbc9d=['express','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x3637ca,_0x204c46){var _0x2820e2=function(_0x4c1d08){while(--_0x4c1d08){_0x3637ca['push'](_0x3637ca['shift']());}};_0x2820e2(++_0x204c46);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x15d629,_0x5bb845){_0x15d629=_0x15d629-0x0;var _0x28ad25=_0xbc9d[_0x15d629];return _0x28ad25;};'use strict';var multer=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var path=require(_0xdbc9('0x2'));var timeout=require(_0xdbc9('0x3'));var express=require(_0xdbc9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var controller=require(_0xdbc9('0x7'));router[_0xdbc9('0x8')]('/',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xa')]);router[_0xdbc9('0x8')]('/:id',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xb')]);router[_0xdbc9('0x8')]('/:id/configurations',auth[_0xdbc9('0x9')](),controller['getConfigurations']);router['get'](_0xdbc9('0xc'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xd')]);router[_0xdbc9('0xe')]('/',auth['isAuthenticated'](),controller[_0xdbc9('0xf')]);router[_0xdbc9('0xe')](_0xdbc9('0x10'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x11')]);router[_0xdbc9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xdbc9('0x13')]);router[_0xdbc9('0x14')](_0xdbc9('0x15'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9c00=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x106790,_0x251faa){var _0x2f9735=function(_0x559018){while(--_0x559018){_0x106790['push'](_0x106790['shift']());}};_0x2f9735(++_0x251faa);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3dda0f,_0x5b9902){_0x3dda0f=_0x3dda0f-0x0;var _0x1b0488=_0x9c00[_0x3dda0f];return _0x1b0488;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id/configurations',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0x11'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x13')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x14')]);router[_0x09c0('0x15')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);module[_0x09c0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7832e0e..4d82856 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 _0x430c=['sequelize','STRING','username'];(function(_0x4e82d2,_0x2b7a3b){var _0xc6285d=function(_0x114cc6){while(--_0x114cc6){_0x4e82d2['push'](_0x4e82d2['shift']());}};_0xc6285d(++_0x2b7a3b);}(_0x430c,0x1a1));var _0xc430=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x430c[_0x12f688];return _0x59c3de;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x93e9=['sequelize','exports','STRING','username'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x93e9,0xcc));var _0x993e=function(_0xd714ef,_0x53d219){_0xd714ef=_0xd714ef-0x0;var _0x47bede=_0x93e9[_0xd714ef];return _0x47bede;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('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 197c535..c56aff9 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 _0x293b=['type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','fieldName'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x293b,0x9f));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb293('0x0'));var zipdir=require(_0xb293('0x1'));var jsonpatch=require(_0xb293('0x2'));var rp=require(_0xb293('0x3'));var moment=require('moment');var BPromise=require(_0xb293('0x4'));var Mustache=require(_0xb293('0x5'));var util=require(_0xb293('0x6'));var path=require('path');var sox=require(_0xb293('0x7'));var csv=require(_0xb293('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb293('0x9'));var _=require(_0xb293('0xa'));var squel=require(_0xb293('0xb'));var crypto=require(_0xb293('0xc'));var jsforce=require(_0xb293('0xd'));var deskjs=require(_0xb293('0xe'));var toCsv=require(_0xb293('0x8'));var querystring=require(_0xb293('0xf'));var Papa=require(_0xb293('0x10'));var Redis=require(_0xb293('0x11'));var authService=require(_0xb293('0x12'));var qs=require(_0xb293('0x13'));var as=require(_0xb293('0x14'));var hardwareService=require(_0xb293('0x15'));var logger=require(_0xb293('0x16'))(_0xb293('0x17'));var utils=require(_0xb293('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb293('0x19'))['db'];var integrations=require(_0xb293('0x1a'));function respondWithStatusCode(_0x394b21,_0x529754){_0x529754=_0x529754||0xcc;return function(_0x189db9){if(_0x189db9){return _0x394b21['sendStatus'](_0x529754);}return _0x394b21[_0xb293('0x1b')](_0x529754)[_0xb293('0x1c')]();};}function respondWithResult(_0xb5ab28,_0x107fa3){_0x107fa3=_0x107fa3||0xc8;return function(_0x1de303){if(_0x1de303){return _0xb5ab28['status'](_0x107fa3)[_0xb293('0x1d')](_0x1de303);}};}function respondWithFilteredResult(_0x3d04b9,_0x5abd28){return function(_0xb9707d){if(_0xb9707d){var _0x3d6da2=typeof _0x5abd28[_0xb293('0x1e')]===_0xb293('0x1f')&&typeof _0x5abd28[_0xb293('0x20')]===_0xb293('0x1f');var _0x5e61fc=_0xb9707d[_0xb293('0x21')];var _0x5ba568=_0x3d6da2?0x0:_0x5abd28[_0xb293('0x1e')];var _0x5e2e9a=_0x3d6da2?_0xb9707d[_0xb293('0x21')]:_0x5abd28[_0xb293('0x1e')]+_0x5abd28['limit'];var _0x2057ca;if(_0x5e2e9a>=_0x5e61fc){_0x5e2e9a=_0x5e61fc;_0x2057ca=0xc8;}else{_0x2057ca=0xce;}_0x3d04b9[_0xb293('0x1b')](_0x2057ca);return _0x3d04b9[_0xb293('0x22')](_0xb293('0x23'),_0x5ba568+'-'+_0x5e2e9a+'/'+_0x5e61fc)[_0xb293('0x1d')](_0xb9707d);}return null;};}function patchUpdates(_0x578fb2){return function(_0x2f386b){try{jsonpatch['apply'](_0x2f386b,_0x578fb2,!![]);}catch(_0x212f9f){return BPromise['reject'](_0x212f9f);}return _0x2f386b[_0xb293('0x24')]();};}function saveUpdates(_0x264bd8,_0x169b5a){return function(_0x2680e6){if(_0x2680e6){return _0x2680e6[_0xb293('0x25')](_0x264bd8)[_0xb293('0x26')](function(_0x5a6eec){return _0x5a6eec;});}return null;};}function removeEntity(_0x5174c3,_0x37d3df){return function(_0x6d90d9){if(_0x6d90d9){return _0x6d90d9[_0xb293('0x27')]()['then'](function(){_0x5174c3[_0xb293('0x1b')](0xcc)[_0xb293('0x1c')]();});}};}function handleEntityNotFound(_0x15d277,_0x38e9b0){return function(_0x7927c6){if(!_0x7927c6){_0x15d277[_0xb293('0x28')](0x194);}return _0x7927c6;};}function handleError(_0x46b613,_0x3d8857){_0x3d8857=_0x3d8857||0x1f4;return function(_0x4e600e){logger[_0xb293('0x29')](_0x4e600e[_0xb293('0x2a')]);if(_0x4e600e[_0xb293('0x2b')]){delete _0x4e600e[_0xb293('0x2b')];}_0x46b613['status'](_0x3d8857)[_0xb293('0x2c')](_0x4e600e);};}exports[_0xb293('0x2d')]=function(_0x51358f,_0x4e76e4){var _0x21fe85={},_0x96c265={},_0x65579d={'count':0x0,'rows':[]};var _0x1ddff2=_[_0xb293('0x2e')](db[_0xb293('0x2f')]['rawAttributes'],function(_0x384108){return{'name':_0x384108[_0xb293('0x30')],'type':_0x384108[_0xb293('0x31')][_0xb293('0x32')]};});_0x96c265[_0xb293('0x33')]=_[_0xb293('0x2e')](_0x1ddff2,_0xb293('0x2b'));_0x96c265[_0xb293('0x34')]=_[_0xb293('0x35')](_0x51358f[_0xb293('0x34')]);_0x96c265[_0xb293('0x36')]=_['intersection'](_0x96c265[_0xb293('0x33')],_0x96c265[_0xb293('0x34')]);_0x21fe85[_0xb293('0x37')]=_[_0xb293('0x38')](_0x96c265[_0xb293('0x33')],qs[_0xb293('0x39')](_0x51358f[_0xb293('0x34')][_0xb293('0x39')]));_0x21fe85[_0xb293('0x37')]=_0x21fe85[_0xb293('0x37')][_0xb293('0x3a')]?_0x21fe85['attributes']:_0x96c265[_0xb293('0x33')];if(!_0x51358f[_0xb293('0x34')][_0xb293('0x3b')](_0xb293('0x3c'))){_0x21fe85['limit']=qs[_0xb293('0x20')](_0x51358f[_0xb293('0x34')][_0xb293('0x20')]);_0x21fe85[_0xb293('0x1e')]=qs[_0xb293('0x1e')](_0x51358f[_0xb293('0x34')][_0xb293('0x1e')]);}_0x21fe85['order']=qs[_0xb293('0x3d')](_0x51358f['query'][_0xb293('0x3d')]);_0x21fe85[_0xb293('0x3e')]=qs[_0xb293('0x36')](_[_0xb293('0x3f')](_0x51358f[_0xb293('0x34')],_0x96c265[_0xb293('0x36')]),_0x1ddff2);if(_0x51358f['query'][_0xb293('0x40')]){_0x21fe85[_0xb293('0x3e')]=_[_0xb293('0x41')](_0x21fe85[_0xb293('0x3e')],{'$or':_[_0xb293('0x2e')](_0x1ddff2,function(_0x2f1558){if(_0x2f1558[_0xb293('0x31')]!==_0xb293('0x42')){var _0x5d317b={};_0x5d317b[_0x2f1558[_0xb293('0x2b')]]={'$like':'%'+_0x51358f['query']['filter']+'%'};return _0x5d317b;}})});}_0x21fe85=_[_0xb293('0x41')]({},_0x21fe85,_0x51358f[_0xb293('0x43')]);var _0x3dc9d1={'where':_0x21fe85[_0xb293('0x3e')]};return db[_0xb293('0x2f')][_0xb293('0x21')](_0x3dc9d1)[_0xb293('0x26')](function(_0x1624e4){_0x65579d[_0xb293('0x21')]=_0x1624e4;if(_0x51358f[_0xb293('0x34')][_0xb293('0x44')]){_0x21fe85[_0xb293('0x45')]=[{'all':!![]}];}return db[_0xb293('0x2f')][_0xb293('0x46')](_0x21fe85);})[_0xb293('0x26')](function(_0x429635){_0x65579d[_0xb293('0x47')]=_0x429635;return _0x65579d;})[_0xb293('0x26')](respondWithFilteredResult(_0x4e76e4,_0x21fe85))[_0xb293('0x48')](handleError(_0x4e76e4,null));};exports[_0xb293('0x49')]=function(_0x1daa66,_0x27e80f){var _0x30d8d7={'raw':![],'where':{'id':_0x1daa66[_0xb293('0x4a')]['id']}},_0x7aa429={};_0x7aa429[_0xb293('0x33')]=_[_0xb293('0x35')](db[_0xb293('0x2f')][_0xb293('0x4b')]);_0x7aa429['query']=_[_0xb293('0x35')](_0x1daa66[_0xb293('0x34')]);_0x7aa429[_0xb293('0x36')]=_[_0xb293('0x38')](_0x7aa429[_0xb293('0x33')],_0x7aa429['query']);_0x30d8d7[_0xb293('0x37')]=_[_0xb293('0x38')](_0x7aa429[_0xb293('0x33')],qs[_0xb293('0x39')](_0x1daa66[_0xb293('0x34')][_0xb293('0x39')]));_0x30d8d7['attributes']=_0x30d8d7['attributes']['length']?_0x30d8d7[_0xb293('0x37')]:_0x7aa429[_0xb293('0x33')];if(_0x1daa66['query'][_0xb293('0x44')]){_0x30d8d7['include']=[{'all':!![]}];}_0x30d8d7=_[_0xb293('0x41')]({},_0x30d8d7,_0x1daa66[_0xb293('0x43')]);return db[_0xb293('0x2f')][_0xb293('0x4c')](_0x30d8d7)[_0xb293('0x26')](handleEntityNotFound(_0x27e80f,null))['then'](respondWithResult(_0x27e80f,null))[_0xb293('0x48')](handleError(_0x27e80f,null));};exports[_0xb293('0x4d')]=function(_0x92a0d9,_0x4953e4){return db[_0xb293('0x2f')][_0xb293('0x4d')](_0x92a0d9[_0xb293('0x4e')],{})[_0xb293('0x26')](respondWithResult(_0x4953e4,0xc9))['catch'](handleError(_0x4953e4,null));};exports[_0xb293('0x25')]=function(_0x4df78f,_0x357d88){if(_0x4df78f['body']['id']){delete _0x4df78f[_0xb293('0x4e')]['id'];}return db[_0xb293('0x2f')][_0xb293('0x4c')]({'where':{'id':_0x4df78f['params']['id']}})[_0xb293('0x26')](handleEntityNotFound(_0x357d88,null))['then'](saveUpdates(_0x4df78f[_0xb293('0x4e')],null))[_0xb293('0x26')](respondWithResult(_0x357d88,null))['catch'](handleError(_0x357d88,null));};exports['destroy']=function(_0x181ff7,_0x5f30e7){return db[_0xb293('0x2f')][_0xb293('0x4c')]({'where':{'id':_0x181ff7[_0xb293('0x4a')]['id']}})[_0xb293('0x26')](handleEntityNotFound(_0x5f30e7,null))[_0xb293('0x26')](removeEntity(_0x5f30e7,null))[_0xb293('0x48')](handleError(_0x5f30e7,null));};exports['getConfigurations']=function(_0x3d1022,_0x1f382d,_0x5a78f6){var _0x4d9e77={};var _0x1f1a2d={};var _0x53a1e0;var _0x1bf158;return db[_0xb293('0x2f')][_0xb293('0x4f')]({'where':{'id':_0x3d1022[_0xb293('0x4a')]['id']}})[_0xb293('0x26')](handleEntityNotFound(_0x1f382d,null))[_0xb293('0x26')](function(_0x293273){if(_0x293273){_0x53a1e0=_0x293273;_0x1f1a2d[_0xb293('0x33')]=_[_0xb293('0x35')](db[_0xb293('0x50')][_0xb293('0x4b')]);_0x1f1a2d[_0xb293('0x34')]=_[_0xb293('0x35')](_0x3d1022[_0xb293('0x34')]);_0x1f1a2d['filters']=_[_0xb293('0x38')](_0x1f1a2d[_0xb293('0x33')],_0x1f1a2d[_0xb293('0x34')]);_0x4d9e77[_0xb293('0x37')]=_[_0xb293('0x38')](_0x1f1a2d[_0xb293('0x33')],qs[_0xb293('0x39')](_0x3d1022[_0xb293('0x34')][_0xb293('0x39')]));_0x4d9e77[_0xb293('0x37')]=_0x4d9e77[_0xb293('0x37')][_0xb293('0x3a')]?_0x4d9e77[_0xb293('0x37')]:_0x1f1a2d[_0xb293('0x33')];_0x4d9e77['order']=qs[_0xb293('0x3d')](_0x3d1022['query']['sort']);_0x4d9e77['where']=qs[_0xb293('0x36')](_[_0xb293('0x3f')](_0x3d1022['query'],_0x1f1a2d[_0xb293('0x36')]));if(_0x3d1022[_0xb293('0x34')][_0xb293('0x40')]){_0x4d9e77[_0xb293('0x3e')]=_[_0xb293('0x41')](_0x4d9e77[_0xb293('0x3e')],{'$or':_['map'](_0x4d9e77[_0xb293('0x37')],function(_0x9d1fdb){var _0x3e0d4f={};_0x3e0d4f[_0x9d1fdb]={'$like':'%'+_0x3d1022[_0xb293('0x34')][_0xb293('0x40')]+'%'};return _0x3e0d4f;})});}_0x4d9e77=_[_0xb293('0x41')]({},_0x4d9e77,_0x3d1022[_0xb293('0x43')]);return _0x53a1e0['getConfigurations'](_0x4d9e77);}})['then'](function(_0x20cfdc){if(_0x20cfdc){_0x1bf158=_0x20cfdc[_0xb293('0x3a')];if(!_0x3d1022[_0xb293('0x34')][_0xb293('0x3b')](_0xb293('0x3c'))){_0x4d9e77[_0xb293('0x20')]=qs[_0xb293('0x20')](_0x3d1022[_0xb293('0x34')][_0xb293('0x20')]);_0x4d9e77[_0xb293('0x1e')]=qs['offset'](_0x3d1022[_0xb293('0x34')][_0xb293('0x1e')]);}return _0x53a1e0['getConfigurations'](_0x4d9e77);}})[_0xb293('0x26')](function(_0x43748e){if(_0x43748e){return _0x43748e?{'count':_0x1bf158,'rows':_0x43748e}:null;}})[_0xb293('0x26')](respondWithResult(_0x1f382d,null))[_0xb293('0x48')](handleError(_0x1f382d,null));};exports[_0xb293('0x51')]=function(_0x510694,_0x2875bf,_0x4358ad){if(_0x510694['body']['id']){delete _0x510694[_0xb293('0x4e')]['id'];}return db['FreshsalesAccount'][_0xb293('0x4f')]({'where':{'id':_0x510694['params']['id']}})[_0xb293('0x26')](handleEntityNotFound(_0x2875bf,null))['then'](function(_0x3dd894){if(_0x3dd894){_0x510694[_0xb293('0x4e')][_0xb293('0x52')]=_0x3dd894['id'];_0x510694[_0xb293('0x4e')][_0xb293('0x53')]=integrations['getSubjects'](_0x510694['body']['channel'],_0x510694['body'][_0xb293('0x31')]);_0x510694[_0xb293('0x4e')][_0xb293('0x54')]=integrations[_0xb293('0x55')](_0x510694[_0xb293('0x4e')][_0xb293('0x56')],_0x510694[_0xb293('0x4e')][_0xb293('0x31')]);return db['FreshsalesConfiguration']['create'](_0x510694[_0xb293('0x4e')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0xb293('0x57')],'as':_0xb293('0x54')}]});}return null;})[_0xb293('0x26')](respondWithResult(_0x2875bf,null))['catch'](handleError(_0x2875bf,null));};exports[_0xb293('0x58')]=function(_0xbf9f20,_0x126dc0,_0x26fb1a){var _0xe10492='';var _0x5501b1='';return db[_0xb293('0x2f')][_0xb293('0x4f')]({'where':{'id':_0xbf9f20[_0xb293('0x4a')]['id']},'attributes':['id',_0xb293('0x59'),_0xb293('0x5a'),_0xb293('0x5b')]})[_0xb293('0x26')](handleEntityNotFound(_0x126dc0,null))['then'](function(_0x4fe154){if(_0x4fe154){_0x5501b1=_0x4fe154[_0xb293('0x59')];_0xe10492=_0x4fe154['remoteUri'];var _0x32e8ce=_0x4fe154['remoteUri']['slice'](-0x1);if(_0x32e8ce==='/'){_0xe10492=_0xe10492['substring'](0x0,_0xe10492['lastIndexOf'](_0x32e8ce));}return rp({'method':_0xb293('0x5c'),'uri':util[_0xb293('0x5d')](_0xb293('0x5e'),_0xe10492,_0xb293('0x5f')),'headers':{'Authorization':_0xb293('0x60')+_0x4fe154[_0xb293('0x5b')]},'json':!![]});}})[_0xb293('0x26')](function(_0x19f9c8){if(_0x19f9c8){var _0x8cfa3a=_0x19f9c8[_0xb293('0x61')];var _0x230364=![];var _0x54167f=null;for(_0x54167f=0x0;_0x54167f<_0x8cfa3a[_0xb293('0x3a')];_0x54167f++){if(_0x8cfa3a[_0x54167f][_0xb293('0x62')]===_0x5501b1){_0x230364=!![];}}if(_0x230364){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb293('0x63')});}}})['then'](respondWithResult(_0x126dc0,null))[_0xb293('0x48')](function(_0x4f6027){var _0x1ff257=_0xbf9f20[_0xb293('0x34')][_0xb293('0x64')]?0x1f4:_0x4f6027['statusCode']||0x1f4;logger[_0xb293('0x29')](_0xb293('0x65'),'getFields',_0x1ff257,JSON[_0xb293('0x66')](_0x4f6027));delete _0x4f6027[_0xb293('0x2b')];if(_0x1ff257===0x191){_0x1ff257=0x190;}_0x126dc0['status'](_0x1ff257)[_0xb293('0x2c')](_0xbf9f20[_0xb293('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4f6027[_0xb293('0x67')]}:_0x4f6027);});}; \ No newline at end of file +var _0x503f=['apply','reject','update','destroy','then','status','end','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','FreshsalesConfiguration','order','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','limit','undefined','count','offset','set','json'];(function(_0x2c145d,_0x2f2a9c){var _0x131748=function(_0x53510a){while(--_0x53510a){_0x2c145d['push'](_0x2c145d['shift']());}};_0x131748(++_0x2f2a9c);}(_0x503f,0x1d4));var _0xf503=function(_0x5daa04,_0x2bb0fa){_0x5daa04=_0x5daa04-0x0;var _0x2cf68c=_0x503f[_0x5daa04];return _0x2cf68c;};'use strict';var emlformat=require(_0xf503('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf503('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf503('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf503('0x3'));var util=require(_0xf503('0x4'));var path=require(_0xf503('0x5'));var sox=require('sox');var csv=require(_0xf503('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf503('0x7'));var crypto=require(_0xf503('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf503('0x9'));var toCsv=require(_0xf503('0x6'));var querystring=require(_0xf503('0xa'));var Papa=require('papaparse');var Redis=require(_0xf503('0xb'));var authService=require(_0xf503('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xf503('0xd'));var hardwareService=require(_0xf503('0xe'));var logger=require(_0xf503('0xf'))(_0xf503('0x10'));var utils=require('../../config/utils');var config=require(_0xf503('0x11'));var licenseUtil=require(_0xf503('0x12'));var db=require(_0xf503('0x13'))['db'];var integrations=require(_0xf503('0x14'));function respondWithStatusCode(_0x1cd76e,_0x183b89){_0x183b89=_0x183b89||0xcc;return function(_0x18da42){if(_0x18da42){return _0x1cd76e['sendStatus'](_0x183b89);}return _0x1cd76e['status'](_0x183b89)['end']();};}function respondWithResult(_0x370e35,_0x2a8785){_0x2a8785=_0x2a8785||0xc8;return function(_0x5d20d7){if(_0x5d20d7){return _0x370e35['status'](_0x2a8785)['json'](_0x5d20d7);}};}function respondWithFilteredResult(_0x167312,_0x43529f){return function(_0x478a72){if(_0x478a72){var _0x282c49=typeof _0x43529f['offset']==='undefined'&&typeof _0x43529f[_0xf503('0x15')]===_0xf503('0x16');var _0x411b7c=_0x478a72[_0xf503('0x17')];var _0xa092ad=_0x282c49?0x0:_0x43529f[_0xf503('0x18')];var _0x2dea3c=_0x282c49?_0x478a72[_0xf503('0x17')]:_0x43529f['offset']+_0x43529f[_0xf503('0x15')];var _0x3d2a13;if(_0x2dea3c>=_0x411b7c){_0x2dea3c=_0x411b7c;_0x3d2a13=0xc8;}else{_0x3d2a13=0xce;}_0x167312['status'](_0x3d2a13);return _0x167312[_0xf503('0x19')]('Content-Range',_0xa092ad+'-'+_0x2dea3c+'/'+_0x411b7c)[_0xf503('0x1a')](_0x478a72);}return null;};}function patchUpdates(_0x1e8b49){return function(_0x393edf){try{jsonpatch[_0xf503('0x1b')](_0x393edf,_0x1e8b49,!![]);}catch(_0x4684ce){return BPromise[_0xf503('0x1c')](_0x4684ce);}return _0x393edf['save']();};}function saveUpdates(_0x1c3cf7,_0x2d7e60){return function(_0x2aef8a){if(_0x2aef8a){return _0x2aef8a[_0xf503('0x1d')](_0x1c3cf7)['then'](function(_0x92215f){return _0x92215f;});}return null;};}function removeEntity(_0x5e9f9c,_0x43bf5c){return function(_0x48f010){if(_0x48f010){return _0x48f010[_0xf503('0x1e')]()[_0xf503('0x1f')](function(){_0x5e9f9c[_0xf503('0x20')](0xcc)[_0xf503('0x21')]();});}};}function handleEntityNotFound(_0x126e24,_0x245d09){return function(_0x172476){if(!_0x172476){_0x126e24['sendStatus'](0x194);}return _0x172476;};}function handleError(_0x46c59a,_0x33a59a){_0x33a59a=_0x33a59a||0x1f4;return function(_0x1050cb){logger['error'](_0x1050cb[_0xf503('0x22')]);if(_0x1050cb[_0xf503('0x23')]){delete _0x1050cb['name'];}_0x46c59a['status'](_0x33a59a)[_0xf503('0x24')](_0x1050cb);};}exports['index']=function(_0x56342c,_0x340981){var _0x5ea8ec={},_0x42537c={},_0x87c9d8={'count':0x0,'rows':[]};var _0x3c5dc0=_[_0xf503('0x25')](db['FreshsalesAccount'][_0xf503('0x26')],function(_0x327c07){return{'name':_0x327c07[_0xf503('0x27')],'type':_0x327c07[_0xf503('0x28')][_0xf503('0x29')]};});_0x42537c['model']=_['map'](_0x3c5dc0,_0xf503('0x23'));_0x42537c[_0xf503('0x2a')]=_[_0xf503('0x2b')](_0x56342c[_0xf503('0x2a')]);_0x42537c[_0xf503('0x2c')]=_[_0xf503('0x2d')](_0x42537c[_0xf503('0x2e')],_0x42537c[_0xf503('0x2a')]);_0x5ea8ec['attributes']=_['intersection'](_0x42537c[_0xf503('0x2e')],qs[_0xf503('0x2f')](_0x56342c['query']['fields']));_0x5ea8ec[_0xf503('0x30')]=_0x5ea8ec[_0xf503('0x30')][_0xf503('0x31')]?_0x5ea8ec[_0xf503('0x30')]:_0x42537c[_0xf503('0x2e')];if(!_0x56342c[_0xf503('0x2a')][_0xf503('0x32')](_0xf503('0x33'))){_0x5ea8ec['limit']=qs['limit'](_0x56342c[_0xf503('0x2a')][_0xf503('0x15')]);_0x5ea8ec[_0xf503('0x18')]=qs[_0xf503('0x18')](_0x56342c[_0xf503('0x2a')]['offset']);}_0x5ea8ec['order']=qs[_0xf503('0x34')](_0x56342c[_0xf503('0x2a')][_0xf503('0x34')]);_0x5ea8ec[_0xf503('0x35')]=qs[_0xf503('0x2c')](_[_0xf503('0x36')](_0x56342c[_0xf503('0x2a')],_0x42537c[_0xf503('0x2c')]),_0x3c5dc0);if(_0x56342c[_0xf503('0x2a')][_0xf503('0x37')]){_0x5ea8ec[_0xf503('0x35')]=_[_0xf503('0x38')](_0x5ea8ec['where'],{'$or':_[_0xf503('0x25')](_0x3c5dc0,function(_0xd7cec2){if(_0xd7cec2[_0xf503('0x28')]!==_0xf503('0x39')){var _0x14148b={};_0x14148b[_0xd7cec2['name']]={'$like':'%'+_0x56342c[_0xf503('0x2a')][_0xf503('0x37')]+'%'};return _0x14148b;}})});}_0x5ea8ec=_[_0xf503('0x38')]({},_0x5ea8ec,_0x56342c[_0xf503('0x3a')]);var _0x298f78={'where':_0x5ea8ec[_0xf503('0x35')]};return db[_0xf503('0x3b')][_0xf503('0x17')](_0x298f78)[_0xf503('0x1f')](function(_0x3329fe){_0x87c9d8[_0xf503('0x17')]=_0x3329fe;if(_0x56342c['query']['includeAll']){_0x5ea8ec[_0xf503('0x3c')]=[{'all':!![]}];}return db[_0xf503('0x3b')][_0xf503('0x3d')](_0x5ea8ec);})[_0xf503('0x1f')](function(_0x185d07){_0x87c9d8[_0xf503('0x3e')]=_0x185d07;return _0x87c9d8;})['then'](respondWithFilteredResult(_0x340981,_0x5ea8ec))[_0xf503('0x3f')](handleError(_0x340981,null));};exports[_0xf503('0x40')]=function(_0x3278d6,_0x3b4bf0){var _0xd76f7b={'raw':![],'where':{'id':_0x3278d6[_0xf503('0x41')]['id']}},_0x509417={};_0x509417[_0xf503('0x2e')]=_[_0xf503('0x2b')](db[_0xf503('0x3b')][_0xf503('0x26')]);_0x509417[_0xf503('0x2a')]=_[_0xf503('0x2b')](_0x3278d6[_0xf503('0x2a')]);_0x509417['filters']=_['intersection'](_0x509417[_0xf503('0x2e')],_0x509417['query']);_0xd76f7b[_0xf503('0x30')]=_[_0xf503('0x2d')](_0x509417[_0xf503('0x2e')],qs[_0xf503('0x2f')](_0x3278d6['query'][_0xf503('0x2f')]));_0xd76f7b[_0xf503('0x30')]=_0xd76f7b[_0xf503('0x30')][_0xf503('0x31')]?_0xd76f7b[_0xf503('0x30')]:_0x509417[_0xf503('0x2e')];if(_0x3278d6[_0xf503('0x2a')][_0xf503('0x42')]){_0xd76f7b['include']=[{'all':!![]}];}_0xd76f7b=_['merge']({},_0xd76f7b,_0x3278d6[_0xf503('0x3a')]);return db[_0xf503('0x3b')][_0xf503('0x43')](_0xd76f7b)[_0xf503('0x1f')](handleEntityNotFound(_0x3b4bf0,null))[_0xf503('0x1f')](respondWithResult(_0x3b4bf0,null))[_0xf503('0x3f')](handleError(_0x3b4bf0,null));};exports['create']=function(_0x1d3fc2,_0x3be5dc){return db[_0xf503('0x3b')][_0xf503('0x44')](_0x1d3fc2['body'],{})['then'](respondWithResult(_0x3be5dc,0xc9))[_0xf503('0x3f')](handleError(_0x3be5dc,null));};exports[_0xf503('0x1d')]=function(_0x371b5e,_0x5951c3){if(_0x371b5e[_0xf503('0x45')]['id']){delete _0x371b5e[_0xf503('0x45')]['id'];}return db[_0xf503('0x3b')][_0xf503('0x43')]({'where':{'id':_0x371b5e[_0xf503('0x41')]['id']}})[_0xf503('0x1f')](handleEntityNotFound(_0x5951c3,null))['then'](saveUpdates(_0x371b5e[_0xf503('0x45')],null))['then'](respondWithResult(_0x5951c3,null))[_0xf503('0x3f')](handleError(_0x5951c3,null));};exports[_0xf503('0x1e')]=function(_0x35e42b,_0x3f6627){return db['FreshsalesAccount'][_0xf503('0x43')]({'where':{'id':_0x35e42b[_0xf503('0x41')]['id']}})[_0xf503('0x1f')](handleEntityNotFound(_0x3f6627,null))[_0xf503('0x1f')](removeEntity(_0x3f6627,null))[_0xf503('0x3f')](handleError(_0x3f6627,null));};exports[_0xf503('0x46')]=function(_0x2dbdfa,_0x3f6a51,_0x2691ad){var _0x3e8703={};var _0x22b95a={};var _0x105fe9;var _0x56fe76;return db[_0xf503('0x3b')]['findOne']({'where':{'id':_0x2dbdfa['params']['id']}})[_0xf503('0x1f')](handleEntityNotFound(_0x3f6a51,null))[_0xf503('0x1f')](function(_0x2652e8){if(_0x2652e8){_0x105fe9=_0x2652e8;_0x22b95a[_0xf503('0x2e')]=_['keys'](db[_0xf503('0x47')]['rawAttributes']);_0x22b95a[_0xf503('0x2a')]=_[_0xf503('0x2b')](_0x2dbdfa['query']);_0x22b95a[_0xf503('0x2c')]=_['intersection'](_0x22b95a[_0xf503('0x2e')],_0x22b95a['query']);_0x3e8703[_0xf503('0x30')]=_[_0xf503('0x2d')](_0x22b95a[_0xf503('0x2e')],qs[_0xf503('0x2f')](_0x2dbdfa['query'][_0xf503('0x2f')]));_0x3e8703[_0xf503('0x30')]=_0x3e8703[_0xf503('0x30')][_0xf503('0x31')]?_0x3e8703[_0xf503('0x30')]:_0x22b95a[_0xf503('0x2e')];_0x3e8703[_0xf503('0x48')]=qs[_0xf503('0x34')](_0x2dbdfa['query'][_0xf503('0x34')]);_0x3e8703['where']=qs[_0xf503('0x2c')](_[_0xf503('0x36')](_0x2dbdfa[_0xf503('0x2a')],_0x22b95a[_0xf503('0x2c')]));if(_0x2dbdfa[_0xf503('0x2a')][_0xf503('0x37')]){_0x3e8703[_0xf503('0x35')]=_['merge'](_0x3e8703[_0xf503('0x35')],{'$or':_[_0xf503('0x25')](_0x3e8703['attributes'],function(_0x1d4205){var _0x572982={};_0x572982[_0x1d4205]={'$like':'%'+_0x2dbdfa[_0xf503('0x2a')][_0xf503('0x37')]+'%'};return _0x572982;})});}_0x3e8703=_[_0xf503('0x38')]({},_0x3e8703,_0x2dbdfa['options']);return _0x105fe9[_0xf503('0x46')](_0x3e8703);}})[_0xf503('0x1f')](function(_0x196cbf){if(_0x196cbf){_0x56fe76=_0x196cbf['length'];if(!_0x2dbdfa[_0xf503('0x2a')][_0xf503('0x32')](_0xf503('0x33'))){_0x3e8703[_0xf503('0x15')]=qs[_0xf503('0x15')](_0x2dbdfa[_0xf503('0x2a')][_0xf503('0x15')]);_0x3e8703[_0xf503('0x18')]=qs['offset'](_0x2dbdfa[_0xf503('0x2a')][_0xf503('0x18')]);}return _0x105fe9[_0xf503('0x46')](_0x3e8703);}})[_0xf503('0x1f')](function(_0x37c513){if(_0x37c513){return _0x37c513?{'count':_0x56fe76,'rows':_0x37c513}:null;}})['then'](respondWithResult(_0x3f6a51,null))[_0xf503('0x3f')](handleError(_0x3f6a51,null));};exports['addConfiguration']=function(_0x28a34f,_0x1ba3d9,_0x2a8171){if(_0x28a34f[_0xf503('0x45')]['id']){delete _0x28a34f[_0xf503('0x45')]['id'];}return db['FreshsalesAccount'][_0xf503('0x49')]({'where':{'id':_0x28a34f['params']['id']}})[_0xf503('0x1f')](handleEntityNotFound(_0x1ba3d9,null))[_0xf503('0x1f')](function(_0x39fe7a){if(_0x39fe7a){_0x28a34f['body'][_0xf503('0x4a')]=_0x39fe7a['id'];_0x28a34f[_0xf503('0x45')][_0xf503('0x4b')]=integrations[_0xf503('0x4c')](_0x28a34f[_0xf503('0x45')][_0xf503('0x4d')],_0x28a34f[_0xf503('0x45')][_0xf503('0x28')]);_0x28a34f[_0xf503('0x45')][_0xf503('0x4e')]=integrations[_0xf503('0x4f')](_0x28a34f[_0xf503('0x45')][_0xf503('0x4d')],_0x28a34f[_0xf503('0x45')]['type']);return db[_0xf503('0x47')][_0xf503('0x44')](_0x28a34f[_0xf503('0x45')],{'include':[{'model':db[_0xf503('0x50')],'as':_0xf503('0x4b')},{'model':db['FreshsalesField'],'as':_0xf503('0x4e')}]});}return null;})[_0xf503('0x1f')](respondWithResult(_0x1ba3d9,null))[_0xf503('0x3f')](handleError(_0x1ba3d9,null));};exports[_0xf503('0x51')]=function(_0x599243,_0x1e48b8,_0x39c08b){var _0x5aff5c='';var _0x4b4406='';return db[_0xf503('0x3b')][_0xf503('0x49')]({'where':{'id':_0x599243[_0xf503('0x41')]['id']},'attributes':['id',_0xf503('0x52'),_0xf503('0x53'),_0xf503('0x54')]})['then'](handleEntityNotFound(_0x1e48b8,null))[_0xf503('0x1f')](function(_0x4f9223){if(_0x4f9223){_0x4b4406=_0x4f9223[_0xf503('0x52')];_0x5aff5c=_0x4f9223[_0xf503('0x53')];var _0x349d33=_0x4f9223[_0xf503('0x53')][_0xf503('0x55')](-0x1);if(_0x349d33==='/'){_0x5aff5c=_0x5aff5c['substring'](0x0,_0x5aff5c[_0xf503('0x56')](_0x349d33));}return rp({'method':_0xf503('0x57'),'uri':util[_0xf503('0x58')](_0xf503('0x59'),_0x5aff5c,_0xf503('0x5a')),'headers':{'Authorization':'Token\x20token='+_0x4f9223[_0xf503('0x54')]},'json':!![]});}})[_0xf503('0x1f')](function(_0x529e5f){if(_0x529e5f){var _0x5479c7=_0x529e5f['users'];var _0x3f979e=![];var _0x32808c=null;for(_0x32808c=0x0;_0x32808c<_0x5479c7[_0xf503('0x31')];_0x32808c++){if(_0x5479c7[_0x32808c][_0xf503('0x5b')]===_0x4b4406){_0x3f979e=!![];}}if(_0x3f979e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf503('0x5c')});}}})[_0xf503('0x1f')](respondWithResult(_0x1e48b8,null))['catch'](function(_0x358ae0){var _0x1095c7=_0x599243['query'][_0xf503('0x5d')]?0x1f4:_0x358ae0['statusCode']||0x1f4;logger[_0xf503('0x5e')](_0xf503('0x5f'),'getFields',_0x1095c7,JSON[_0xf503('0x60')](_0x358ae0));delete _0x358ae0[_0xf503('0x23')];if(_0x1095c7===0x191){_0x1095c7=0x190;}_0x1e48b8[_0xf503('0x20')](_0x1095c7)[_0xf503('0x24')](_0x599243[_0xf503('0x2a')][_0xf503('0x5d')]?{'message':_0xf503('0x61'),'statusCode':_0x358ae0[_0xf503('0x62')]}:_0x358ae0);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5b73fd2..4ea1a77 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 _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x29c9c6,_0x1e43ee){var _0x4855ae=function(_0x4a5c49){while(--_0x4a5c49){_0x29c9c6['push'](_0x29c9c6['shift']());}};_0x4855ae(++_0x1e43ee);}(_0x323f,0x1ee));var _0xf323=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x323f[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));var integrations=require(_0xf323('0x9'));module[_0xf323('0xa')]=function(_0x5d7d60,_0xb9a667){return _0x5d7d60[_0xf323('0xb')](_0xf323('0xc'),attributes,{'tableName':_0xf323('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x36aeba,_0x5e9ada){var _0x5cc09f=function(_0x3824d3){while(--_0x3824d3){_0x36aeba['push'](_0x36aeba['shift']());}};_0x5cc09f(++_0x5e9ada);}(_0xa456,0x142));var _0x6a45=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xa456[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));var integrations=require(_0x6a45('0x9'));module[_0x6a45('0xa')]=function(_0x4dfbfa,_0x25cf8d){return _0x4dfbfa[_0x6a45('0xb')](_0x6a45('0xc'),attributes,{'tableName':_0x6a45('0xd'),'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 b0b86a5..d600de7 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 _0x5fab=['map','model','info','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','include','attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5fab,0x177));var _0xb5fa=function(_0xc465f5,_0xa9c358){_0xc465f5=_0xc465f5-0x0;var _0x3dd839=_0x5fab[_0xc465f5];return _0x3dd839;};'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']('FreshsalesAccount,\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')]('FreshsalesAccount,\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']('FreshsalesAccount,\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);});});}exports[_0xb5fa('0x18')]=function(_0x32e9e5){var _0x46eef0=this;return new Promise(function(_0x324ba5,_0x13e82b){return db[_0xb5fa('0x19')][_0xb5fa('0x1a')]({'raw':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0x32e9e5['options']?_0x32e9e5[_0xb5fa('0x1b')]['attributes']||null:null,'limit':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')]['limit']||null:null,'include':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')]?_['map'](_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')],function(_0x444237){return{'model':db[_0x444237['model']],'as':_0x444237['as'],'attributes':_0x444237[_0xb5fa('0x1f')],'include':_0x444237['include']?_[_0xb5fa('0x20')](_0x444237[_0xb5fa('0x1e')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x21')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x11053a[_0xb5fa('0x1e')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28a350){logger[_0xb5fa('0x22')](_0xb5fa('0x18'),_0x32e9e5);logger[_0xb5fa('0xf')](_0xb5fa('0x18'),_0x32e9e5,JSON[_0xb5fa('0x11')](_0x28a350));_0x324ba5(_0x28a350);})[_0xb5fa('0x17')](function(_0x353314){logger[_0xb5fa('0x12')](_0xb5fa('0x18'),_0x353314[_0xb5fa('0x14')],_0x32e9e5);_0x13e82b(_0x46eef0[_0xb5fa('0x12')](0x1f4,_0x353314[_0xb5fa('0x14')]));});});};exports[_0xb5fa('0x23')]=function(_0xed02e){var _0x116773=this;return new Promise(function(_0x5a0152,_0x3fd1fb){return db[_0xb5fa('0x19')][_0xb5fa('0x24')]({'raw':_0xed02e[_0xb5fa('0x1b')]?_0xed02e[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0xed02e['options']?_0xed02e['options']['attributes']||null:null,'include':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1e')]?_['map'](_0xed02e['options'][_0xb5fa('0x1e')],function(_0x934b49){return{'model':db[_0x934b49['model']],'as':_0x934b49['as'],'attributes':_0x934b49['attributes'],'include':_0x934b49[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x934b49[_0xb5fa('0x1e')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x21')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x20')](_0x560b53[_0xb5fa('0x1e')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0xd')](function(_0x24ef11){logger['info'](_0xb5fa('0x23'),_0xed02e);logger[_0xb5fa('0xf')](_0xb5fa('0x23'),_0xed02e,JSON[_0xb5fa('0x11')](_0x24ef11));_0x5a0152(_0x24ef11);})['catch'](function(_0x4bba91){logger['error']('ShowFreshsalesAccount',_0x4bba91['message'],_0xed02e);_0x3fd1fb(_0x116773['error'](0x1f4,_0x4bba91[_0xb5fa('0x14')]));});});}; \ No newline at end of file +var _0xacf4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshsalesAccount'];(function(_0x356749,_0x1edd55){var _0x49db33=function(_0x591d31){while(--_0x591d31){_0x356749['push'](_0x356749['shift']());}};_0x49db33(++_0x1edd55);}(_0xacf4,0xe7));var _0x4acf=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0xacf4[_0x2bda14];return _0xb5dd49;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')]({'raw':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x18')]||null:null,'attributes':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x19')]||null:null,'limit':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1a')]||null:null,'include':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x240c00[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x53885f){return{'model':db[_0x53885f[_0x4acf('0x1d')]],'as':_0x53885f['as'],'attributes':_0x53885f[_0x4acf('0x19')],'include':_0x53885f['include']?_[_0x4acf('0x1c')](_0x53885f[_0x4acf('0x1b')],function(_0x52a84a){return{'model':db[_0x52a84a[_0x4acf('0x1d')]],'as':_0x52a84a['as'],'attributes':_0x52a84a[_0x4acf('0x19')],'include':_0x52a84a[_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x52a84a['include'],function(_0x50236d){return{'model':db[_0x50236d[_0x4acf('0x1d')]],'as':_0x50236d['as'],'attributes':_0x50236d[_0x4acf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0x42c90c){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1e')](_0x4acf('0x13'),_0x240c00,JSON[_0x4acf('0x1f')](_0x42c90c));_0x2a678b(_0x42c90c);})[_0x4acf('0x12')](function(_0x57989e){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57989e[_0x4acf('0x10')],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57989e[_0x4acf('0x10')]));});});};exports[_0x4acf('0x20')]=function(_0x27384c){var _0x5d862f=this;return new Promise(function(_0x337b3c,_0x1d221b){return db[_0x4acf('0x14')]['find']({'raw':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x27384c[_0x4acf('0x16')]?_0x27384c['options'][_0x4acf('0x18')]||null:null,'attributes':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')]['attributes']||null:null,'include':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x490880){return{'model':db[_0x490880[_0x4acf('0x1d')]],'as':_0x490880['as'],'attributes':_0x490880[_0x4acf('0x19')],'include':_0x490880['include']?_[_0x4acf('0x1c')](_0x490880['include'],function(_0x4cd020){return{'model':db[_0x4cd020['model']],'as':_0x4cd020['as'],'attributes':_0x4cd020['attributes'],'include':_0x4cd020['include']?_['map'](_0x4cd020['include'],function(_0x3364dd){return{'model':db[_0x3364dd[_0x4acf('0x1d')]],'as':_0x3364dd['as'],'attributes':_0x3364dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0xbd0f92){logger[_0x4acf('0xb')](_0x4acf('0x20'),_0x27384c);logger[_0x4acf('0x1e')](_0x4acf('0x20'),_0x27384c,JSON[_0x4acf('0x1f')](_0xbd0f92));_0x337b3c(_0xbd0f92);})[_0x4acf('0x12')](function(_0x24465b){logger[_0x4acf('0xf')]('ShowFreshsalesAccount',_0x24465b['message'],_0x27384c);_0x1d221b(_0x5d862f[_0x4acf('0xf')](0x1f4,_0x24465b[_0x4acf('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 4757df4..074d06f 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 _0x9be6=['index','/:id','show','/:id/subjects','getDescriptions','/:id/fields','getFields','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated'];(function(_0x1dea10,_0x2850ab){var _0x3c5973=function(_0x48f208){while(--_0x48f208){_0x1dea10['push'](_0x1dea10['shift']());}};_0x3c5973(++_0x2850ab);}(_0x9be6,0x67));var _0x69be=function(_0xa46138,_0x3e404b){_0xa46138=_0xa46138-0x0;var _0x5c08de=_0x9be6[_0xa46138];return _0x5c08de;};'use strict';var multer=require(_0x69be('0x0'));var util=require(_0x69be('0x1'));var path=require(_0x69be('0x2'));var timeout=require(_0x69be('0x3'));var express=require(_0x69be('0x4'));var router=express[_0x69be('0x5')]();var fs_extra=require(_0x69be('0x6'));var auth=require(_0x69be('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x69be('0x8'));var controller=require(_0x69be('0x9'));router[_0x69be('0xa')]('/',auth[_0x69be('0xb')](),controller[_0x69be('0xc')]);router[_0x69be('0xa')](_0x69be('0xd'),auth[_0x69be('0xb')](),controller[_0x69be('0xe')]);router[_0x69be('0xa')](_0x69be('0xf'),auth[_0x69be('0xb')](),controller['getSubjects']);router[_0x69be('0xa')]('/:id/descriptions',auth[_0x69be('0xb')](),controller[_0x69be('0x10')]);router['get'](_0x69be('0x11'),auth['isAuthenticated'](),controller[_0x69be('0x12')]);router['post']('/',auth[_0x69be('0xb')](),controller['create']);router[_0x69be('0x13')](_0x69be('0xd'),auth[_0x69be('0xb')](),controller[_0x69be('0x14')]);router[_0x69be('0x15')]('/:id',auth[_0x69be('0xb')](),controller[_0x69be('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8e1d=['show','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5a909b,_0x4a7af1){var _0x1ee86f=function(_0x12f1af){while(--_0x12f1af){_0x5a909b['push'](_0x5a909b['shift']());}};_0x1ee86f(++_0x4a7af1);}(_0x8e1d,0xa6));var _0xd8e1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8e1d[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xd8e1('0x0'));var util=require(_0xd8e1('0x1'));var path=require(_0xd8e1('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8e1('0x3'));var router=express[_0xd8e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd8e1('0x5'));var interaction=require(_0xd8e1('0x6'));var config=require(_0xd8e1('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xd8e1('0x8')]('/',auth[_0xd8e1('0x9')](),controller['index']);router[_0xd8e1('0x8')]('/:id',auth[_0xd8e1('0x9')](),controller[_0xd8e1('0xa')]);router['get']('/:id/subjects',auth[_0xd8e1('0x9')](),controller['getSubjects']);router['get'](_0xd8e1('0xb'),auth[_0xd8e1('0x9')](),controller[_0xd8e1('0xc')]);router[_0xd8e1('0x8')](_0xd8e1('0xd'),auth['isAuthenticated'](),controller[_0xd8e1('0xe')]);router[_0xd8e1('0xf')]('/',auth[_0xd8e1('0x9')](),controller[_0xd8e1('0x10')]);router[_0xd8e1('0x11')](_0xd8e1('0x12'),auth['isAuthenticated'](),controller[_0xd8e1('0x13')]);router['delete'](_0xd8e1('0x12'),auth[_0xd8e1('0x9')](),controller[_0xd8e1('0x14')]);module[_0xd8e1('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 ef7e44f..22137d6 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 _0x128b=['STRING','sequelize','exports'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x128b,0x1e7));var _0xb128=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x128b[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xb128('0x0'));module[_0xb128('0x1')]={'name':{'type':Sequelize[_0xb128('0x2')]},'description':{'type':Sequelize[_0xb128('0x2')]}}; \ No newline at end of file +var _0xe201=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe201,0x71));var _0x1e20=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xe201[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x1e20('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e20('0x1')]},'description':{'type':Sequelize[_0x1e20('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1e2b31f..7895c6c 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 _0xced4=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','update','then','destroy','error','stack','name','map','FreshsalesConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','getSubjects','order','getDescriptions','findOne','FreshsalesField','getFields','rimraf','zip-dir','request-promise'];(function(_0x41f26a,_0x290b9f){var _0x357b7c=function(_0x5407fe){while(--_0x5407fe){_0x41f26a['push'](_0x41f26a['shift']());}};_0x357b7c(++_0x290b9f);}(_0xced4,0x12d));var _0x4ced=function(_0x292a0b,_0x3b2a29){_0x292a0b=_0x292a0b-0x0;var _0x2f3ccc=_0xced4[_0x292a0b];return _0x2f3ccc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ced('0x0'));var zipdir=require(_0x4ced('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ced('0x2'));var moment=require(_0x4ced('0x3'));var BPromise=require(_0x4ced('0x4'));var Mustache=require(_0x4ced('0x5'));var util=require(_0x4ced('0x6'));var path=require(_0x4ced('0x7'));var sox=require(_0x4ced('0x8'));var csv=require(_0x4ced('0x9'));var ejs=require(_0x4ced('0xa'));var fs=require('fs');var fs_extra=require(_0x4ced('0xb'));var _=require(_0x4ced('0xc'));var squel=require(_0x4ced('0xd'));var crypto=require(_0x4ced('0xe'));var jsforce=require(_0x4ced('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ced('0x10'));var Redis=require(_0x4ced('0x11'));var authService=require(_0x4ced('0x12'));var qs=require(_0x4ced('0x13'));var as=require(_0x4ced('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ced('0x15'))(_0x4ced('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4ced('0x17'))['db'];function respondWithStatusCode(_0x343562,_0x6c3e){_0x6c3e=_0x6c3e||0xcc;return function(_0xbedde9){if(_0xbedde9){return _0x343562[_0x4ced('0x18')](_0x6c3e);}return _0x343562[_0x4ced('0x19')](_0x6c3e)[_0x4ced('0x1a')]();};}function respondWithResult(_0x46dd7d,_0x240bc0){_0x240bc0=_0x240bc0||0xc8;return function(_0x54310c){if(_0x54310c){return _0x46dd7d['status'](_0x240bc0)[_0x4ced('0x1b')](_0x54310c);}};}function respondWithFilteredResult(_0xc6a568,_0xd47a7e){return function(_0x398241){if(_0x398241){var _0x237c35=typeof _0xd47a7e['offset']==='undefined'&&typeof _0xd47a7e[_0x4ced('0x1c')]===_0x4ced('0x1d');var _0x1e648a=_0x398241[_0x4ced('0x1e')];var _0x4a9e96=_0x237c35?0x0:_0xd47a7e['offset'];var _0x393c3f=_0x237c35?_0x398241[_0x4ced('0x1e')]:_0xd47a7e['offset']+_0xd47a7e[_0x4ced('0x1c')];var _0x5d8602;if(_0x393c3f>=_0x1e648a){_0x393c3f=_0x1e648a;_0x5d8602=0xc8;}else{_0x5d8602=0xce;}_0xc6a568[_0x4ced('0x19')](_0x5d8602);return _0xc6a568['set']('Content-Range',_0x4a9e96+'-'+_0x393c3f+'/'+_0x1e648a)[_0x4ced('0x1b')](_0x398241);}return null;};}function patchUpdates(_0x52d596){return function(_0x4f6610){try{jsonpatch['apply'](_0x4f6610,_0x52d596,!![]);}catch(_0x189804){return BPromise['reject'](_0x189804);}return _0x4f6610['save']();};}function saveUpdates(_0x5e160c,_0x336546){return function(_0xafd634){if(_0xafd634){return _0xafd634[_0x4ced('0x1f')](_0x5e160c)[_0x4ced('0x20')](function(_0x2861be){return _0x2861be;});}return null;};}function removeEntity(_0x11e4bc,_0x4145d6){return function(_0x538ba5){if(_0x538ba5){return _0x538ba5[_0x4ced('0x21')]()['then'](function(){_0x11e4bc[_0x4ced('0x19')](0xcc)[_0x4ced('0x1a')]();});}};}function handleEntityNotFound(_0x3eab90,_0x234ed2){return function(_0x4115ca){if(!_0x4115ca){_0x3eab90[_0x4ced('0x18')](0x194);}return _0x4115ca;};}function handleError(_0x23652d,_0x2316ad){_0x2316ad=_0x2316ad||0x1f4;return function(_0xd51170){logger[_0x4ced('0x22')](_0xd51170[_0x4ced('0x23')]);if(_0xd51170[_0x4ced('0x24')]){delete _0xd51170[_0x4ced('0x24')];}_0x23652d[_0x4ced('0x19')](_0x2316ad)['send'](_0xd51170);};}exports['index']=function(_0x437be7,_0x2487e9){var _0x1d851a={},_0x34060b={},_0x5b0eac={'count':0x0,'rows':[]};var _0x25bfd4=_[_0x4ced('0x25')](db[_0x4ced('0x26')][_0x4ced('0x27')],function(_0x30db4f){return{'name':_0x30db4f[_0x4ced('0x28')],'type':_0x30db4f['type'][_0x4ced('0x29')]};});_0x34060b['model']=_[_0x4ced('0x25')](_0x25bfd4,'name');_0x34060b[_0x4ced('0x2a')]=_[_0x4ced('0x2b')](_0x437be7[_0x4ced('0x2a')]);_0x34060b[_0x4ced('0x2c')]=_[_0x4ced('0x2d')](_0x34060b['model'],_0x34060b[_0x4ced('0x2a')]);_0x1d851a[_0x4ced('0x2e')]=_['intersection'](_0x34060b[_0x4ced('0x2f')],qs[_0x4ced('0x30')](_0x437be7[_0x4ced('0x2a')]['fields']));_0x1d851a[_0x4ced('0x2e')]=_0x1d851a[_0x4ced('0x2e')][_0x4ced('0x31')]?_0x1d851a[_0x4ced('0x2e')]:_0x34060b[_0x4ced('0x2f')];if(!_0x437be7[_0x4ced('0x2a')][_0x4ced('0x32')](_0x4ced('0x33'))){_0x1d851a[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x437be7[_0x4ced('0x2a')]['limit']);_0x1d851a[_0x4ced('0x34')]=qs['offset'](_0x437be7['query']['offset']);}_0x1d851a['order']=qs[_0x4ced('0x35')](_0x437be7[_0x4ced('0x2a')][_0x4ced('0x35')]);_0x1d851a[_0x4ced('0x36')]=qs[_0x4ced('0x2c')](_[_0x4ced('0x37')](_0x437be7[_0x4ced('0x2a')],_0x34060b[_0x4ced('0x2c')]),_0x25bfd4);if(_0x437be7[_0x4ced('0x2a')][_0x4ced('0x38')]){_0x1d851a[_0x4ced('0x36')]=_['merge'](_0x1d851a[_0x4ced('0x36')],{'$or':_[_0x4ced('0x25')](_0x25bfd4,function(_0x1f2769){if(_0x1f2769[_0x4ced('0x39')]!==_0x4ced('0x3a')){var _0x1c23ec={};_0x1c23ec[_0x1f2769['name']]={'$like':'%'+_0x437be7[_0x4ced('0x2a')][_0x4ced('0x38')]+'%'};return _0x1c23ec;}})});}_0x1d851a=_[_0x4ced('0x3b')]({},_0x1d851a,_0x437be7[_0x4ced('0x3c')]);var _0x3bd4cf={'where':_0x1d851a['where']};return db[_0x4ced('0x26')][_0x4ced('0x1e')](_0x3bd4cf)[_0x4ced('0x20')](function(_0x4407b0){_0x5b0eac[_0x4ced('0x1e')]=_0x4407b0;if(_0x437be7['query'][_0x4ced('0x3d')]){_0x1d851a[_0x4ced('0x3e')]=[{'all':!![]}];}return db[_0x4ced('0x26')][_0x4ced('0x3f')](_0x1d851a);})['then'](function(_0x44b3e2){_0x5b0eac['rows']=_0x44b3e2;return _0x5b0eac;})[_0x4ced('0x20')](respondWithFilteredResult(_0x2487e9,_0x1d851a))[_0x4ced('0x40')](handleError(_0x2487e9,null));};exports[_0x4ced('0x41')]=function(_0x59f389,_0x544efe){var _0x1aebf9={'raw':![],'where':{'id':_0x59f389['params']['id']}},_0x5b64e3={};_0x5b64e3[_0x4ced('0x2f')]=_[_0x4ced('0x2b')](db[_0x4ced('0x26')]['rawAttributes']);_0x5b64e3[_0x4ced('0x2a')]=_['keys'](_0x59f389[_0x4ced('0x2a')]);_0x5b64e3['filters']=_[_0x4ced('0x2d')](_0x5b64e3[_0x4ced('0x2f')],_0x5b64e3[_0x4ced('0x2a')]);_0x1aebf9['attributes']=_['intersection'](_0x5b64e3['model'],qs['fields'](_0x59f389['query'][_0x4ced('0x30')]));_0x1aebf9['attributes']=_0x1aebf9[_0x4ced('0x2e')][_0x4ced('0x31')]?_0x1aebf9[_0x4ced('0x2e')]:_0x5b64e3[_0x4ced('0x2f')];if(_0x59f389[_0x4ced('0x2a')]['includeAll']){_0x1aebf9[_0x4ced('0x3e')]=[{'all':!![]}];}_0x1aebf9=_[_0x4ced('0x3b')]({},_0x1aebf9,_0x59f389[_0x4ced('0x3c')]);return db[_0x4ced('0x26')][_0x4ced('0x42')](_0x1aebf9)['then'](handleEntityNotFound(_0x544efe,null))[_0x4ced('0x20')](respondWithResult(_0x544efe,null))['catch'](handleError(_0x544efe,null));};exports[_0x4ced('0x43')]=function(_0x543d24,_0x167688){return db[_0x4ced('0x26')][_0x4ced('0x43')](_0x543d24[_0x4ced('0x44')],{})[_0x4ced('0x20')](respondWithResult(_0x167688,0xc9))[_0x4ced('0x40')](handleError(_0x167688,null));};exports[_0x4ced('0x1f')]=function(_0x66c14a,_0x47a2f6){if(_0x66c14a[_0x4ced('0x44')]['id']){delete _0x66c14a[_0x4ced('0x44')]['id'];}return db[_0x4ced('0x26')][_0x4ced('0x42')]({'where':{'id':_0x66c14a[_0x4ced('0x45')]['id']}})[_0x4ced('0x20')](handleEntityNotFound(_0x47a2f6,null))[_0x4ced('0x20')](saveUpdates(_0x66c14a[_0x4ced('0x44')],null))[_0x4ced('0x20')](respondWithResult(_0x47a2f6,null))[_0x4ced('0x40')](handleError(_0x47a2f6,null));};exports[_0x4ced('0x21')]=function(_0x460ef1,_0x28f1e7){return db[_0x4ced('0x26')][_0x4ced('0x42')]({'where':{'id':_0x460ef1['params']['id']}})[_0x4ced('0x20')](handleEntityNotFound(_0x28f1e7,null))[_0x4ced('0x20')](removeEntity(_0x28f1e7,null))['catch'](handleError(_0x28f1e7,null));};exports[_0x4ced('0x46')]=function(_0x21e2be,_0x1243e5,_0x47cb33){var _0x4bc9fa={};var _0x703ee3={};var _0xf4f838;var _0x270dec;return db[_0x4ced('0x26')]['findOne']({'where':{'id':_0x21e2be[_0x4ced('0x45')]['id']}})[_0x4ced('0x20')](handleEntityNotFound(_0x1243e5,null))[_0x4ced('0x20')](function(_0x328cf7){if(_0x328cf7){_0xf4f838=_0x328cf7;_0x703ee3[_0x4ced('0x2f')]=_[_0x4ced('0x2b')](db['FreshsalesField'][_0x4ced('0x27')]);_0x703ee3[_0x4ced('0x2a')]=_[_0x4ced('0x2b')](_0x21e2be[_0x4ced('0x2a')]);_0x703ee3[_0x4ced('0x2c')]=_[_0x4ced('0x2d')](_0x703ee3[_0x4ced('0x2f')],_0x703ee3['query']);_0x4bc9fa[_0x4ced('0x2e')]=_[_0x4ced('0x2d')](_0x703ee3['model'],qs[_0x4ced('0x30')](_0x21e2be[_0x4ced('0x2a')][_0x4ced('0x30')]));_0x4bc9fa['attributes']=_0x4bc9fa['attributes']['length']?_0x4bc9fa[_0x4ced('0x2e')]:_0x703ee3['model'];_0x4bc9fa[_0x4ced('0x47')]=qs[_0x4ced('0x35')](_0x21e2be[_0x4ced('0x2a')]['sort']);_0x4bc9fa[_0x4ced('0x36')]=qs[_0x4ced('0x2c')](_[_0x4ced('0x37')](_0x21e2be[_0x4ced('0x2a')],_0x703ee3[_0x4ced('0x2c')]));if(_0x21e2be[_0x4ced('0x2a')][_0x4ced('0x38')]){_0x4bc9fa[_0x4ced('0x36')]=_[_0x4ced('0x3b')](_0x4bc9fa[_0x4ced('0x36')],{'$or':_[_0x4ced('0x25')](_0x4bc9fa[_0x4ced('0x2e')],function(_0x24d5ee){var _0x4df828={};_0x4df828[_0x24d5ee]={'$like':'%'+_0x21e2be[_0x4ced('0x2a')][_0x4ced('0x38')]+'%'};return _0x4df828;})});}_0x4bc9fa=_[_0x4ced('0x3b')]({},_0x4bc9fa,_0x21e2be[_0x4ced('0x3c')]);return _0xf4f838[_0x4ced('0x46')](_0x4bc9fa);}})[_0x4ced('0x20')](function(_0x4d937c){if(_0x4d937c){_0x270dec=_0x4d937c[_0x4ced('0x31')];if(!_0x21e2be[_0x4ced('0x2a')]['hasOwnProperty']('nolimit')){_0x4bc9fa['limit']=qs[_0x4ced('0x1c')](_0x21e2be[_0x4ced('0x2a')]['limit']);_0x4bc9fa['offset']=qs[_0x4ced('0x34')](_0x21e2be[_0x4ced('0x2a')][_0x4ced('0x34')]);}return _0xf4f838['getSubjects'](_0x4bc9fa);}})[_0x4ced('0x20')](function(_0x5d22ad){if(_0x5d22ad){return _0x5d22ad?{'count':_0x270dec,'rows':_0x5d22ad}:null;}})[_0x4ced('0x20')](respondWithResult(_0x1243e5,null))[_0x4ced('0x40')](handleError(_0x1243e5,null));};exports[_0x4ced('0x48')]=function(_0x17d485,_0x5463b9,_0x5d4c16){var _0x4007c1={};var _0x5b04ee={};var _0x2b9699;var _0x7709b4;return db['FreshsalesConfiguration'][_0x4ced('0x49')]({'where':{'id':_0x17d485['params']['id']}})[_0x4ced('0x20')](handleEntityNotFound(_0x5463b9,null))[_0x4ced('0x20')](function(_0x1d9aeb){if(_0x1d9aeb){_0x2b9699=_0x1d9aeb;_0x5b04ee[_0x4ced('0x2f')]=_[_0x4ced('0x2b')](db[_0x4ced('0x4a')]['rawAttributes']);_0x5b04ee[_0x4ced('0x2a')]=_[_0x4ced('0x2b')](_0x17d485[_0x4ced('0x2a')]);_0x5b04ee['filters']=_['intersection'](_0x5b04ee[_0x4ced('0x2f')],_0x5b04ee['query']);_0x4007c1[_0x4ced('0x2e')]=_['intersection'](_0x5b04ee['model'],qs['fields'](_0x17d485[_0x4ced('0x2a')][_0x4ced('0x30')]));_0x4007c1[_0x4ced('0x2e')]=_0x4007c1[_0x4ced('0x2e')][_0x4ced('0x31')]?_0x4007c1[_0x4ced('0x2e')]:_0x5b04ee['model'];_0x4007c1[_0x4ced('0x47')]=qs[_0x4ced('0x35')](_0x17d485[_0x4ced('0x2a')][_0x4ced('0x35')]);_0x4007c1[_0x4ced('0x36')]=qs[_0x4ced('0x2c')](_[_0x4ced('0x37')](_0x17d485['query'],_0x5b04ee[_0x4ced('0x2c')]));if(_0x17d485[_0x4ced('0x2a')]['filter']){_0x4007c1[_0x4ced('0x36')]=_['merge'](_0x4007c1[_0x4ced('0x36')],{'$or':_[_0x4ced('0x25')](_0x4007c1[_0x4ced('0x2e')],function(_0x479733){var _0x2db8ee={};_0x2db8ee[_0x479733]={'$like':'%'+_0x17d485['query'][_0x4ced('0x38')]+'%'};return _0x2db8ee;})});}_0x4007c1=_[_0x4ced('0x3b')]({},_0x4007c1,_0x17d485[_0x4ced('0x3c')]);return _0x2b9699[_0x4ced('0x48')](_0x4007c1);}})[_0x4ced('0x20')](function(_0x5269c1){if(_0x5269c1){_0x7709b4=_0x5269c1['length'];if(!_0x17d485[_0x4ced('0x2a')][_0x4ced('0x32')](_0x4ced('0x33'))){_0x4007c1['limit']=qs['limit'](_0x17d485[_0x4ced('0x2a')][_0x4ced('0x1c')]);_0x4007c1['offset']=qs[_0x4ced('0x34')](_0x17d485['query'][_0x4ced('0x34')]);}return _0x2b9699['getDescriptions'](_0x4007c1);}})[_0x4ced('0x20')](function(_0x504f19){if(_0x504f19){return _0x504f19?{'count':_0x7709b4,'rows':_0x504f19}:null;}})[_0x4ced('0x20')](respondWithResult(_0x5463b9,null))['catch'](handleError(_0x5463b9,null));};exports[_0x4ced('0x4b')]=function(_0x20ba65,_0x2443dd,_0x13d34a){var _0x49a8fc={};var _0x1ebcd6={};var _0x3dc43b;var _0x5d4c97;return db[_0x4ced('0x26')][_0x4ced('0x49')]({'where':{'id':_0x20ba65[_0x4ced('0x45')]['id']}})[_0x4ced('0x20')](handleEntityNotFound(_0x2443dd,null))[_0x4ced('0x20')](function(_0x5eb1f1){if(_0x5eb1f1){_0x3dc43b=_0x5eb1f1;_0x1ebcd6['model']=_[_0x4ced('0x2b')](db[_0x4ced('0x4a')]['rawAttributes']);_0x1ebcd6[_0x4ced('0x2a')]=_['keys'](_0x20ba65['query']);_0x1ebcd6[_0x4ced('0x2c')]=_[_0x4ced('0x2d')](_0x1ebcd6[_0x4ced('0x2f')],_0x1ebcd6['query']);_0x49a8fc[_0x4ced('0x2e')]=_['intersection'](_0x1ebcd6['model'],qs[_0x4ced('0x30')](_0x20ba65[_0x4ced('0x2a')][_0x4ced('0x30')]));_0x49a8fc['attributes']=_0x49a8fc[_0x4ced('0x2e')][_0x4ced('0x31')]?_0x49a8fc['attributes']:_0x1ebcd6[_0x4ced('0x2f')];_0x49a8fc[_0x4ced('0x47')]=qs[_0x4ced('0x35')](_0x20ba65['query'][_0x4ced('0x35')]);_0x49a8fc[_0x4ced('0x36')]=qs[_0x4ced('0x2c')](_[_0x4ced('0x37')](_0x20ba65['query'],_0x1ebcd6[_0x4ced('0x2c')]));if(_0x20ba65[_0x4ced('0x2a')]['filter']){_0x49a8fc[_0x4ced('0x36')]=_[_0x4ced('0x3b')](_0x49a8fc[_0x4ced('0x36')],{'$or':_[_0x4ced('0x25')](_0x49a8fc[_0x4ced('0x2e')],function(_0x42de2c){var _0x93feef={};_0x93feef[_0x42de2c]={'$like':'%'+_0x20ba65[_0x4ced('0x2a')]['filter']+'%'};return _0x93feef;})});}_0x49a8fc=_[_0x4ced('0x3b')]({},_0x49a8fc,_0x20ba65[_0x4ced('0x3c')]);return _0x3dc43b[_0x4ced('0x4b')](_0x49a8fc);}})[_0x4ced('0x20')](function(_0x29fc71){if(_0x29fc71){_0x5d4c97=_0x29fc71[_0x4ced('0x31')];if(!_0x20ba65[_0x4ced('0x2a')][_0x4ced('0x32')](_0x4ced('0x33'))){_0x49a8fc[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x20ba65[_0x4ced('0x2a')][_0x4ced('0x1c')]);_0x49a8fc[_0x4ced('0x34')]=qs[_0x4ced('0x34')](_0x20ba65['query'][_0x4ced('0x34')]);}return _0x3dc43b[_0x4ced('0x4b')](_0x49a8fc);}})[_0x4ced('0x20')](function(_0x17503c){if(_0x17503c){return _0x17503c?{'count':_0x5d4c97,'rows':_0x17503c}:null;}})[_0x4ced('0x20')](respondWithResult(_0x2443dd,null))[_0x4ced('0x40')](handleError(_0x2443dd,null));}; \ No newline at end of file +var _0x905c=['includeAll','find','create','update','body','params','findOne','FreshsalesField','getSubjects','length','nolimit','getDescriptions','getFields','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show'];(function(_0x5e2fb0,_0xa95a6b){var _0x437628=function(_0x4223fa){while(--_0x4223fa){_0x5e2fb0['push'](_0x5e2fb0['shift']());}};_0x437628(++_0xa95a6b);}(_0x905c,0x131));var _0xc905=function(_0x59e7d4,_0x441fa7){_0x59e7d4=_0x59e7d4-0x0;var _0x5ec89f=_0x905c[_0x59e7d4];return _0x5ec89f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc905('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc905('0x1'));var rp=require('request-promise');var moment=require(_0xc905('0x2'));var BPromise=require(_0xc905('0x3'));var Mustache=require(_0xc905('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc905('0x5'));var csv=require('to-csv');var ejs=require(_0xc905('0x6'));var fs=require('fs');var fs_extra=require(_0xc905('0x7'));var _=require('lodash');var squel=require(_0xc905('0x8'));var crypto=require(_0xc905('0x9'));var jsforce=require(_0xc905('0xa'));var deskjs=require(_0xc905('0xb'));var toCsv=require(_0xc905('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc905('0xd'));var qs=require(_0xc905('0xe'));var as=require(_0xc905('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc905('0x10'));var config=require(_0xc905('0x11'));var licenseUtil=require(_0xc905('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20e939,_0x4eacc0){_0x4eacc0=_0x4eacc0||0xcc;return function(_0x51da62){if(_0x51da62){return _0x20e939[_0xc905('0x13')](_0x4eacc0);}return _0x20e939['status'](_0x4eacc0)[_0xc905('0x14')]();};}function respondWithResult(_0x52eb83,_0x2c73c0){_0x2c73c0=_0x2c73c0||0xc8;return function(_0x21d257){if(_0x21d257){return _0x52eb83[_0xc905('0x15')](_0x2c73c0)[_0xc905('0x16')](_0x21d257);}};}function respondWithFilteredResult(_0x1ff2bd,_0x16e4fb){return function(_0x1a1a39){if(_0x1a1a39){var _0x1c6d6c=typeof _0x16e4fb['offset']===_0xc905('0x17')&&typeof _0x16e4fb[_0xc905('0x18')]==='undefined';var _0x4f72c3=_0x1a1a39[_0xc905('0x19')];var _0x5480dc=_0x1c6d6c?0x0:_0x16e4fb[_0xc905('0x1a')];var _0x31313e=_0x1c6d6c?_0x1a1a39[_0xc905('0x19')]:_0x16e4fb[_0xc905('0x1a')]+_0x16e4fb[_0xc905('0x18')];var _0x354efe;if(_0x31313e>=_0x4f72c3){_0x31313e=_0x4f72c3;_0x354efe=0xc8;}else{_0x354efe=0xce;}_0x1ff2bd[_0xc905('0x15')](_0x354efe);return _0x1ff2bd[_0xc905('0x1b')](_0xc905('0x1c'),_0x5480dc+'-'+_0x31313e+'/'+_0x4f72c3)[_0xc905('0x16')](_0x1a1a39);}return null;};}function patchUpdates(_0x11a44c){return function(_0x3a583e){try{jsonpatch[_0xc905('0x1d')](_0x3a583e,_0x11a44c,!![]);}catch(_0x37c019){return BPromise[_0xc905('0x1e')](_0x37c019);}return _0x3a583e['save']();};}function saveUpdates(_0x405469,_0x103e00){return function(_0x49ad15){if(_0x49ad15){return _0x49ad15['update'](_0x405469)['then'](function(_0xd23361){return _0xd23361;});}return null;};}function removeEntity(_0x245e89,_0x1f75e8){return function(_0x49d44a){if(_0x49d44a){return _0x49d44a[_0xc905('0x1f')]()[_0xc905('0x20')](function(){_0x245e89['status'](0xcc)[_0xc905('0x14')]();});}};}function handleEntityNotFound(_0x14c25e,_0x9f6f7d){return function(_0x3b7835){if(!_0x3b7835){_0x14c25e[_0xc905('0x13')](0x194);}return _0x3b7835;};}function handleError(_0x877866,_0x34c314){_0x34c314=_0x34c314||0x1f4;return function(_0x31358d){logger['error'](_0x31358d[_0xc905('0x21')]);if(_0x31358d[_0xc905('0x22')]){delete _0x31358d[_0xc905('0x22')];}_0x877866[_0xc905('0x15')](_0x34c314)[_0xc905('0x23')](_0x31358d);};}exports[_0xc905('0x24')]=function(_0x533799,_0x1cca3e){var _0x50e500={},_0x51cf2f={},_0x5e6da7={'count':0x0,'rows':[]};var _0x520b1a=_[_0xc905('0x25')](db[_0xc905('0x26')][_0xc905('0x27')],function(_0x590ec4){return{'name':_0x590ec4[_0xc905('0x28')],'type':_0x590ec4['type'][_0xc905('0x29')]};});_0x51cf2f[_0xc905('0x2a')]=_['map'](_0x520b1a,_0xc905('0x22'));_0x51cf2f['query']=_[_0xc905('0x2b')](_0x533799['query']);_0x51cf2f[_0xc905('0x2c')]=_[_0xc905('0x2d')](_0x51cf2f[_0xc905('0x2a')],_0x51cf2f[_0xc905('0x2e')]);_0x50e500[_0xc905('0x2f')]=_[_0xc905('0x2d')](_0x51cf2f['model'],qs['fields'](_0x533799[_0xc905('0x2e')][_0xc905('0x30')]));_0x50e500[_0xc905('0x2f')]=_0x50e500[_0xc905('0x2f')]['length']?_0x50e500[_0xc905('0x2f')]:_0x51cf2f['model'];if(!_0x533799[_0xc905('0x2e')][_0xc905('0x31')]('nolimit')){_0x50e500[_0xc905('0x18')]=qs['limit'](_0x533799[_0xc905('0x2e')][_0xc905('0x18')]);_0x50e500['offset']=qs[_0xc905('0x1a')](_0x533799[_0xc905('0x2e')][_0xc905('0x1a')]);}_0x50e500[_0xc905('0x32')]=qs[_0xc905('0x33')](_0x533799['query']['sort']);_0x50e500[_0xc905('0x34')]=qs[_0xc905('0x2c')](_[_0xc905('0x35')](_0x533799['query'],_0x51cf2f['filters']),_0x520b1a);if(_0x533799[_0xc905('0x2e')][_0xc905('0x36')]){_0x50e500[_0xc905('0x34')]=_[_0xc905('0x37')](_0x50e500[_0xc905('0x34')],{'$or':_['map'](_0x520b1a,function(_0x157798){if(_0x157798['type']!==_0xc905('0x38')){var _0x28034b={};_0x28034b[_0x157798['name']]={'$like':'%'+_0x533799[_0xc905('0x2e')][_0xc905('0x36')]+'%'};return _0x28034b;}})});}_0x50e500=_['merge']({},_0x50e500,_0x533799[_0xc905('0x39')]);var _0x54421f={'where':_0x50e500[_0xc905('0x34')]};return db['FreshsalesConfiguration'][_0xc905('0x19')](_0x54421f)[_0xc905('0x20')](function(_0x1906f4){_0x5e6da7[_0xc905('0x19')]=_0x1906f4;if(_0x533799[_0xc905('0x2e')]['includeAll']){_0x50e500['include']=[{'all':!![]}];}return db[_0xc905('0x26')]['findAll'](_0x50e500);})[_0xc905('0x20')](function(_0x30706f){_0x5e6da7['rows']=_0x30706f;return _0x5e6da7;})[_0xc905('0x20')](respondWithFilteredResult(_0x1cca3e,_0x50e500))[_0xc905('0x3a')](handleError(_0x1cca3e,null));};exports[_0xc905('0x3b')]=function(_0x5bca70,_0xcc9531){var _0x538983={'raw':![],'where':{'id':_0x5bca70['params']['id']}},_0x1dc896={};_0x1dc896['model']=_[_0xc905('0x2b')](db['FreshsalesConfiguration']['rawAttributes']);_0x1dc896[_0xc905('0x2e')]=_[_0xc905('0x2b')](_0x5bca70[_0xc905('0x2e')]);_0x1dc896[_0xc905('0x2c')]=_[_0xc905('0x2d')](_0x1dc896[_0xc905('0x2a')],_0x1dc896[_0xc905('0x2e')]);_0x538983[_0xc905('0x2f')]=_[_0xc905('0x2d')](_0x1dc896[_0xc905('0x2a')],qs['fields'](_0x5bca70[_0xc905('0x2e')][_0xc905('0x30')]));_0x538983[_0xc905('0x2f')]=_0x538983[_0xc905('0x2f')]['length']?_0x538983[_0xc905('0x2f')]:_0x1dc896[_0xc905('0x2a')];if(_0x5bca70['query'][_0xc905('0x3c')]){_0x538983['include']=[{'all':!![]}];}_0x538983=_[_0xc905('0x37')]({},_0x538983,_0x5bca70[_0xc905('0x39')]);return db[_0xc905('0x26')][_0xc905('0x3d')](_0x538983)[_0xc905('0x20')](handleEntityNotFound(_0xcc9531,null))[_0xc905('0x20')](respondWithResult(_0xcc9531,null))[_0xc905('0x3a')](handleError(_0xcc9531,null));};exports[_0xc905('0x3e')]=function(_0x3a4401,_0x2068c3){return db[_0xc905('0x26')]['create'](_0x3a4401['body'],{})[_0xc905('0x20')](respondWithResult(_0x2068c3,0xc9))[_0xc905('0x3a')](handleError(_0x2068c3,null));};exports[_0xc905('0x3f')]=function(_0x3e417b,_0x51a36f){if(_0x3e417b['body']['id']){delete _0x3e417b[_0xc905('0x40')]['id'];}return db[_0xc905('0x26')][_0xc905('0x3d')]({'where':{'id':_0x3e417b[_0xc905('0x41')]['id']}})[_0xc905('0x20')](handleEntityNotFound(_0x51a36f,null))[_0xc905('0x20')](saveUpdates(_0x3e417b['body'],null))[_0xc905('0x20')](respondWithResult(_0x51a36f,null))[_0xc905('0x3a')](handleError(_0x51a36f,null));};exports[_0xc905('0x1f')]=function(_0x4c3de4,_0x39353b){return db[_0xc905('0x26')][_0xc905('0x3d')]({'where':{'id':_0x4c3de4['params']['id']}})[_0xc905('0x20')](handleEntityNotFound(_0x39353b,null))[_0xc905('0x20')](removeEntity(_0x39353b,null))['catch'](handleError(_0x39353b,null));};exports['getSubjects']=function(_0xb60434,_0x40f7c9,_0x449c8d){var _0x2e7060={};var _0x23211f={};var _0x192ebe;var _0x50f05c;return db[_0xc905('0x26')][_0xc905('0x42')]({'where':{'id':_0xb60434[_0xc905('0x41')]['id']}})[_0xc905('0x20')](handleEntityNotFound(_0x40f7c9,null))[_0xc905('0x20')](function(_0x56aff7){if(_0x56aff7){_0x192ebe=_0x56aff7;_0x23211f[_0xc905('0x2a')]=_[_0xc905('0x2b')](db[_0xc905('0x43')][_0xc905('0x27')]);_0x23211f[_0xc905('0x2e')]=_[_0xc905('0x2b')](_0xb60434[_0xc905('0x2e')]);_0x23211f[_0xc905('0x2c')]=_[_0xc905('0x2d')](_0x23211f[_0xc905('0x2a')],_0x23211f[_0xc905('0x2e')]);_0x2e7060[_0xc905('0x2f')]=_[_0xc905('0x2d')](_0x23211f[_0xc905('0x2a')],qs[_0xc905('0x30')](_0xb60434[_0xc905('0x2e')]['fields']));_0x2e7060['attributes']=_0x2e7060[_0xc905('0x2f')]['length']?_0x2e7060[_0xc905('0x2f')]:_0x23211f[_0xc905('0x2a')];_0x2e7060['order']=qs[_0xc905('0x33')](_0xb60434[_0xc905('0x2e')][_0xc905('0x33')]);_0x2e7060['where']=qs['filters'](_[_0xc905('0x35')](_0xb60434['query'],_0x23211f[_0xc905('0x2c')]));if(_0xb60434['query'][_0xc905('0x36')]){_0x2e7060['where']=_['merge'](_0x2e7060['where'],{'$or':_[_0xc905('0x25')](_0x2e7060[_0xc905('0x2f')],function(_0x456740){var _0x1449c3={};_0x1449c3[_0x456740]={'$like':'%'+_0xb60434[_0xc905('0x2e')][_0xc905('0x36')]+'%'};return _0x1449c3;})});}_0x2e7060=_['merge']({},_0x2e7060,_0xb60434[_0xc905('0x39')]);return _0x192ebe[_0xc905('0x44')](_0x2e7060);}})[_0xc905('0x20')](function(_0x3b0808){if(_0x3b0808){_0x50f05c=_0x3b0808[_0xc905('0x45')];if(!_0xb60434[_0xc905('0x2e')][_0xc905('0x31')](_0xc905('0x46'))){_0x2e7060[_0xc905('0x18')]=qs[_0xc905('0x18')](_0xb60434['query']['limit']);_0x2e7060[_0xc905('0x1a')]=qs[_0xc905('0x1a')](_0xb60434['query'][_0xc905('0x1a')]);}return _0x192ebe[_0xc905('0x44')](_0x2e7060);}})[_0xc905('0x20')](function(_0x2e742d){if(_0x2e742d){return _0x2e742d?{'count':_0x50f05c,'rows':_0x2e742d}:null;}})[_0xc905('0x20')](respondWithResult(_0x40f7c9,null))[_0xc905('0x3a')](handleError(_0x40f7c9,null));};exports[_0xc905('0x47')]=function(_0x304617,_0x2dac01,_0x999935){var _0x40dd1b={};var _0x5d3db3={};var _0x149b34;var _0x5da129;return db[_0xc905('0x26')]['findOne']({'where':{'id':_0x304617[_0xc905('0x41')]['id']}})['then'](handleEntityNotFound(_0x2dac01,null))['then'](function(_0x2eb6bc){if(_0x2eb6bc){_0x149b34=_0x2eb6bc;_0x5d3db3['model']=_[_0xc905('0x2b')](db[_0xc905('0x43')][_0xc905('0x27')]);_0x5d3db3[_0xc905('0x2e')]=_[_0xc905('0x2b')](_0x304617['query']);_0x5d3db3[_0xc905('0x2c')]=_['intersection'](_0x5d3db3[_0xc905('0x2a')],_0x5d3db3['query']);_0x40dd1b[_0xc905('0x2f')]=_[_0xc905('0x2d')](_0x5d3db3[_0xc905('0x2a')],qs[_0xc905('0x30')](_0x304617[_0xc905('0x2e')][_0xc905('0x30')]));_0x40dd1b[_0xc905('0x2f')]=_0x40dd1b['attributes'][_0xc905('0x45')]?_0x40dd1b[_0xc905('0x2f')]:_0x5d3db3['model'];_0x40dd1b['order']=qs[_0xc905('0x33')](_0x304617[_0xc905('0x2e')][_0xc905('0x33')]);_0x40dd1b[_0xc905('0x34')]=qs[_0xc905('0x2c')](_[_0xc905('0x35')](_0x304617[_0xc905('0x2e')],_0x5d3db3['filters']));if(_0x304617[_0xc905('0x2e')][_0xc905('0x36')]){_0x40dd1b[_0xc905('0x34')]=_[_0xc905('0x37')](_0x40dd1b[_0xc905('0x34')],{'$or':_[_0xc905('0x25')](_0x40dd1b['attributes'],function(_0xc84888){var _0x452397={};_0x452397[_0xc84888]={'$like':'%'+_0x304617[_0xc905('0x2e')][_0xc905('0x36')]+'%'};return _0x452397;})});}_0x40dd1b=_[_0xc905('0x37')]({},_0x40dd1b,_0x304617[_0xc905('0x39')]);return _0x149b34[_0xc905('0x47')](_0x40dd1b);}})[_0xc905('0x20')](function(_0x1746f0){if(_0x1746f0){_0x5da129=_0x1746f0[_0xc905('0x45')];if(!_0x304617[_0xc905('0x2e')][_0xc905('0x31')](_0xc905('0x46'))){_0x40dd1b[_0xc905('0x18')]=qs[_0xc905('0x18')](_0x304617[_0xc905('0x2e')]['limit']);_0x40dd1b[_0xc905('0x1a')]=qs['offset'](_0x304617[_0xc905('0x2e')][_0xc905('0x1a')]);}return _0x149b34[_0xc905('0x47')](_0x40dd1b);}})[_0xc905('0x20')](function(_0x198b50){if(_0x198b50){return _0x198b50?{'count':_0x5da129,'rows':_0x198b50}:null;}})[_0xc905('0x20')](respondWithResult(_0x2dac01,null))[_0xc905('0x3a')](handleError(_0x2dac01,null));};exports[_0xc905('0x48')]=function(_0x4375ab,_0x3caceb,_0x42b611){var _0x30386a={};var _0x7d8a25={};var _0x54f9e7;var _0x5bdf06;return db[_0xc905('0x26')][_0xc905('0x42')]({'where':{'id':_0x4375ab[_0xc905('0x41')]['id']}})['then'](handleEntityNotFound(_0x3caceb,null))[_0xc905('0x20')](function(_0x15a524){if(_0x15a524){_0x54f9e7=_0x15a524;_0x7d8a25[_0xc905('0x2a')]=_[_0xc905('0x2b')](db[_0xc905('0x43')][_0xc905('0x27')]);_0x7d8a25[_0xc905('0x2e')]=_[_0xc905('0x2b')](_0x4375ab[_0xc905('0x2e')]);_0x7d8a25[_0xc905('0x2c')]=_[_0xc905('0x2d')](_0x7d8a25[_0xc905('0x2a')],_0x7d8a25[_0xc905('0x2e')]);_0x30386a[_0xc905('0x2f')]=_['intersection'](_0x7d8a25[_0xc905('0x2a')],qs[_0xc905('0x30')](_0x4375ab['query'][_0xc905('0x30')]));_0x30386a['attributes']=_0x30386a[_0xc905('0x2f')][_0xc905('0x45')]?_0x30386a[_0xc905('0x2f')]:_0x7d8a25[_0xc905('0x2a')];_0x30386a[_0xc905('0x32')]=qs['sort'](_0x4375ab[_0xc905('0x2e')][_0xc905('0x33')]);_0x30386a[_0xc905('0x34')]=qs['filters'](_[_0xc905('0x35')](_0x4375ab[_0xc905('0x2e')],_0x7d8a25[_0xc905('0x2c')]));if(_0x4375ab['query']['filter']){_0x30386a[_0xc905('0x34')]=_[_0xc905('0x37')](_0x30386a[_0xc905('0x34')],{'$or':_[_0xc905('0x25')](_0x30386a[_0xc905('0x2f')],function(_0x2b0921){var _0x715586={};_0x715586[_0x2b0921]={'$like':'%'+_0x4375ab[_0xc905('0x2e')]['filter']+'%'};return _0x715586;})});}_0x30386a=_[_0xc905('0x37')]({},_0x30386a,_0x4375ab[_0xc905('0x39')]);return _0x54f9e7[_0xc905('0x48')](_0x30386a);}})[_0xc905('0x20')](function(_0x5034a9){if(_0x5034a9){_0x5bdf06=_0x5034a9[_0xc905('0x45')];if(!_0x4375ab[_0xc905('0x2e')][_0xc905('0x31')](_0xc905('0x46'))){_0x30386a['limit']=qs[_0xc905('0x18')](_0x4375ab[_0xc905('0x2e')]['limit']);_0x30386a[_0xc905('0x1a')]=qs[_0xc905('0x1a')](_0x4375ab[_0xc905('0x2e')][_0xc905('0x1a')]);}return _0x54f9e7[_0xc905('0x48')](_0x30386a);}})['then'](function(_0x3c0232){if(_0x3c0232){return _0x3c0232?{'count':_0x5bdf06,'rows':_0x3c0232}:null;}})[_0xc905('0x20')](respondWithResult(_0x3caceb,null))[_0xc905('0x3a')](handleError(_0x3caceb,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 2dd5a6e..0d3f8f4 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 _0xd6dc=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0xd6dc,0x103));var _0xcd6d=function(_0x38decc,_0x414790){_0x38decc=_0x38decc-0x0;var _0x549e5a=_0xd6dc[_0x38decc];return _0x549e5a;};'use strict';var _=require(_0xcd6d('0x0'));var util=require(_0xcd6d('0x1'));var logger=require(_0xcd6d('0x2'))(_0xcd6d('0x3'));var moment=require(_0xcd6d('0x4'));var BPromise=require(_0xcd6d('0x5'));var rp=require(_0xcd6d('0x6'));var fs=require('fs');var path=require(_0xcd6d('0x7'));var rimraf=require(_0xcd6d('0x8'));var config=require(_0xcd6d('0x9'));var attributes=require(_0xcd6d('0xa'));module[_0xcd6d('0xb')]=function(_0x2d7526,_0x1aa4a7){return _0x2d7526[_0xcd6d('0xc')](_0xcd6d('0xd'),attributes,{'tableName':_0xcd6d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6c7=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x3f01b0,_0x238925){var _0xab4622=function(_0x381eed){while(--_0x381eed){_0x3f01b0['push'](_0x3f01b0['shift']());}};_0xab4622(++_0x238925);}(_0xe6c7,0x120));var _0x7e6c=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xe6c7[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x7e6c('0x0'));var util=require(_0x7e6c('0x1'));var logger=require(_0x7e6c('0x2'))(_0x7e6c('0x3'));var moment=require(_0x7e6c('0x4'));var BPromise=require(_0x7e6c('0x5'));var rp=require(_0x7e6c('0x6'));var fs=require('fs');var path=require(_0x7e6c('0x7'));var rimraf=require('rimraf');var config=require(_0x7e6c('0x8'));var attributes=require(_0x7e6c('0x9'));module[_0x7e6c('0xa')]=function(_0x249352,_0x15ef3b){return _0x249352['define'](_0x7e6c('0xb'),attributes,{'tableName':_0x7e6c('0xc'),'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 fb383c5..cb85dfd 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 _0xa23c=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0xb1ee0e,_0x2126df){var _0x376116=function(_0x44b7ad){while(--_0x44b7ad){_0xb1ee0e['push'](_0xb1ee0e['shift']());}};_0x376116(++_0x2126df);}(_0xa23c,0x144));var _0xca23=function(_0x21d9b6,_0x1069a6){_0x21d9b6=_0x21d9b6-0x0;var _0x416486=_0xa23c[_0x21d9b6];return _0x416486;};'use strict';var _=require(_0xca23('0x0'));var util=require(_0xca23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca23('0x2'));var fs=require('fs');var Redis=require(_0xca23('0x3'));var db=require(_0xca23('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xca23('0x5'))(_0xca23('0x6'));var config=require(_0xca23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xca23('0x8')][_0xca23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126a34,_0x56ca47,_0x2a3d1b){return new BPromise(function(_0x1d93fc,_0x3c13dd){return client['request'](_0x126a34,_0x2a3d1b)[_0xca23('0xa')](function(_0x7ca924){logger[_0xca23('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x56ca47,_0xca23('0xc'));logger[_0xca23('0xd')](_0xca23('0xe'),_0x56ca47,_0xca23('0xc'),JSON[_0xca23('0xf')](_0x7ca924));if(_0x7ca924[_0xca23('0x10')]){if(_0x7ca924[_0xca23('0x10')][_0xca23('0x11')]===0x1f4){logger[_0xca23('0x10')](_0xca23('0x12'),_0x56ca47,_0x7ca924[_0xca23('0x10')]['message']);return _0x3c13dd(_0x7ca924['error'][_0xca23('0x13')]);}logger[_0xca23('0x10')](_0xca23('0x12'),_0x56ca47,_0x7ca924[_0xca23('0x10')]['message']);return _0x1d93fc(_0x7ca924[_0xca23('0x10')][_0xca23('0x13')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x56ca47,_0xca23('0xc'));_0x1d93fc(_0x7ca924[_0xca23('0x14')]['message']);}})['catch'](function(_0x11756b){logger[_0xca23('0x10')](_0xca23('0x12'),_0x56ca47,_0x11756b);_0x3c13dd(_0x11756b);});});} \ No newline at end of file +var _0x879d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x10f5ea,_0xeb348a){var _0x5c4f0f=function(_0x3644db){while(--_0x3644db){_0x10f5ea['push'](_0x10f5ea['shift']());}};_0x5c4f0f(++_0xeb348a);}(_0x879d,0x145));var _0xd879=function(_0x3810ab,_0x5701b5){_0x3810ab=_0x3810ab-0x0;var _0x24cb3e=_0x879d[_0x3810ab];return _0x24cb3e;};'use strict';var _=require(_0xd879('0x0'));var util=require(_0xd879('0x1'));var moment=require(_0xd879('0x2'));var BPromise=require(_0xd879('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd879('0x4'));var db=require(_0xd879('0x5'))['db'];var utils=require(_0xd879('0x6'));var logger=require(_0xd879('0x7'))(_0xd879('0x8'));var config=require(_0xd879('0x9'));var jayson=require(_0xd879('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36b87f,_0x4e8924,_0x504d54){return new BPromise(function(_0x437834,_0x211965){return client['request'](_0x36b87f,_0x504d54)['then'](function(_0x5f2748){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4e8924,_0xd879('0xb'));logger[_0xd879('0xc')](_0xd879('0xd'),_0x4e8924,'request\x20sent',JSON[_0xd879('0xe')](_0x5f2748));if(_0x5f2748[_0xd879('0xf')]){if(_0x5f2748[_0xd879('0xf')][_0xd879('0x10')]===0x1f4){logger['error'](_0xd879('0x11'),_0x4e8924,_0x5f2748[_0xd879('0xf')][_0xd879('0x12')]);return _0x211965(_0x5f2748['error'][_0xd879('0x12')]);}logger[_0xd879('0xf')](_0xd879('0x11'),_0x4e8924,_0x5f2748['error'][_0xd879('0x12')]);return _0x437834(_0x5f2748[_0xd879('0xf')][_0xd879('0x12')]);}else{logger[_0xd879('0x13')](_0xd879('0x11'),_0x4e8924,_0xd879('0xb'));_0x437834(_0x5f2748[_0xd879('0x14')][_0xd879('0x12')]);}})[_0xd879('0x15')](function(_0xc650dd){logger[_0xd879('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4e8924,_0xc650dd);_0x211965(_0xc650dd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 90e4247..9aa2cb1 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 _0xb0d9=['express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x4ca2a8,_0x3d15f8){_0x4ca2a8=_0x4ca2a8-0x0;var _0x494340=_0xb0d9[_0x4ca2a8];return _0x494340;};'use strict';var multer=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var path=require(_0x9b0d('0x2'));var timeout=require(_0x9b0d('0x3'));var express=require(_0x9b0d('0x4'));var router=express[_0x9b0d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b0d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x9b0d('0x7')]('/',auth[_0x9b0d('0x8')](),controller[_0x9b0d('0x9')]);router[_0x9b0d('0x7')](_0x9b0d('0xa'),auth[_0x9b0d('0x8')](),controller[_0x9b0d('0xb')]);router[_0x9b0d('0xc')]('/',auth[_0x9b0d('0x8')](),controller['create']);router['put'](_0x9b0d('0xa'),auth[_0x9b0d('0x8')](),controller['update']);router[_0x9b0d('0xd')](_0x9b0d('0xa'),auth['isAuthenticated'](),controller[_0x9b0d('0xe')]);module[_0x9b0d('0xf')]=router; \ No newline at end of file +var _0x33a1=['put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x133a('0x2'));var auth=require(_0x133a('0x3'));var interaction=require(_0x133a('0x4'));var config=require('../../config/environment');var controller=require(_0x133a('0x5'));router[_0x133a('0x6')]('/',auth[_0x133a('0x7')](),controller['index']);router[_0x133a('0x6')](_0x133a('0x8'),auth[_0x133a('0x7')](),controller['show']);router[_0x133a('0x9')]('/',auth[_0x133a('0x7')](),controller[_0x133a('0xa')]);router[_0x133a('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x133a('0xc')](_0x133a('0x8'),auth[_0x133a('0x7')](),controller[_0x133a('0xd')]);module[_0x133a('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 411f922..ccc5942 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 _0x4325=['variable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x39a1f1,_0x522fd7){var _0xbbbc47=function(_0x173de8){while(--_0x173de8){_0x39a1f1['push'](_0x39a1f1['shift']());}};_0xbbbc47(++_0x522fd7);}(_0x4325,0x153));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'type':{'type':Sequelize[_0x5432('0x2')](_0x5432('0x3'),_0x5432('0x4'),'customVariable',_0x5432('0x5'),'picklist'),'defaultValue':_0x5432('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5432('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x5432('0x6')]},'idField':{'type':Sequelize[_0x5432('0x6')]},'nameField':{'type':Sequelize[_0x5432('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9890=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x12d25e,_0x46aa08){var _0x1300b7=function(_0x6e0c12){while(--_0x6e0c12){_0x12d25e['push'](_0x12d25e['shift']());}};_0x1300b7(++_0x46aa08);}(_0x9890,0x1af));var _0x0989=function(_0x13f85c,_0x3eeaf7){_0x13f85c=_0x13f85c-0x0;var _0x49540c=_0x9890[_0x13f85c];return _0x49540c;};'use strict';var Sequelize=require(_0x0989('0x0'));module[_0x0989('0x1')]={'type':{'type':Sequelize[_0x0989('0x2')](_0x0989('0x3'),_0x0989('0x4'),_0x0989('0x5'),_0x0989('0x6'),_0x0989('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0989('0x8')]},'key':{'type':Sequelize[_0x0989('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x0989('0x3'),_0x0989('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x0989('0x8')]},'idField':{'type':Sequelize[_0x0989('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0989('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0989('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index db7c169..e78e216 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 _0x12a6=['send','index','map','FreshsalesField','key','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','apply','save','update','then','error','stack','name'];(function(_0xd7f44d,_0x3d6b8d){var _0x5856f7=function(_0x23af35){while(--_0x23af35){_0xd7f44d['push'](_0xd7f44d['shift']());}};_0x5856f7(++_0x3d6b8d);}(_0x12a6,0x15a));var _0x612a=function(_0x17dab8,_0x19d0ec){_0x17dab8=_0x17dab8-0x0;var _0x336fb5=_0x12a6[_0x17dab8];return _0x336fb5;};'use strict';var emlformat=require(_0x612a('0x0'));var rimraf=require(_0x612a('0x1'));var zipdir=require(_0x612a('0x2'));var jsonpatch=require(_0x612a('0x3'));var rp=require(_0x612a('0x4'));var moment=require(_0x612a('0x5'));var BPromise=require(_0x612a('0x6'));var Mustache=require(_0x612a('0x7'));var util=require(_0x612a('0x8'));var path=require(_0x612a('0x9'));var sox=require(_0x612a('0xa'));var csv=require(_0x612a('0xb'));var ejs=require(_0x612a('0xc'));var fs=require('fs');var fs_extra=require(_0x612a('0xd'));var _=require(_0x612a('0xe'));var squel=require(_0x612a('0xf'));var crypto=require(_0x612a('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x612a('0x11'));var toCsv=require('to-csv');var querystring=require(_0x612a('0x12'));var Papa=require(_0x612a('0x13'));var Redis=require(_0x612a('0x14'));var authService=require(_0x612a('0x15'));var qs=require(_0x612a('0x16'));var as=require(_0x612a('0x17'));var hardwareService=require(_0x612a('0x18'));var logger=require('../../config/logger')(_0x612a('0x19'));var utils=require(_0x612a('0x1a'));var config=require(_0x612a('0x1b'));var licenseUtil=require(_0x612a('0x1c'));var db=require(_0x612a('0x1d'))['db'];function respondWithStatusCode(_0x449d31,_0x12363a){_0x12363a=_0x12363a||0xcc;return function(_0x4f154f){if(_0x4f154f){return _0x449d31[_0x612a('0x1e')](_0x12363a);}return _0x449d31['status'](_0x12363a)[_0x612a('0x1f')]();};}function respondWithResult(_0x3b6185,_0x29b351){_0x29b351=_0x29b351||0xc8;return function(_0x930593){if(_0x930593){return _0x3b6185[_0x612a('0x20')](_0x29b351)[_0x612a('0x21')](_0x930593);}};}function respondWithFilteredResult(_0x351a28,_0xc63e90){return function(_0x8cef89){if(_0x8cef89){var _0x5724dc=typeof _0xc63e90['offset']==='undefined'&&typeof _0xc63e90[_0x612a('0x22')]===_0x612a('0x23');var _0x2b8de7=_0x8cef89[_0x612a('0x24')];var _0x41c195=_0x5724dc?0x0:_0xc63e90['offset'];var _0x4d1a9c=_0x5724dc?_0x8cef89[_0x612a('0x24')]:_0xc63e90['offset']+_0xc63e90[_0x612a('0x22')];var _0x1a61ce;if(_0x4d1a9c>=_0x2b8de7){_0x4d1a9c=_0x2b8de7;_0x1a61ce=0xc8;}else{_0x1a61ce=0xce;}_0x351a28[_0x612a('0x20')](_0x1a61ce);return _0x351a28['set']('Content-Range',_0x41c195+'-'+_0x4d1a9c+'/'+_0x2b8de7)[_0x612a('0x21')](_0x8cef89);}return null;};}function patchUpdates(_0x31d02a){return function(_0x415608){try{jsonpatch[_0x612a('0x25')](_0x415608,_0x31d02a,!![]);}catch(_0x120be1){return BPromise['reject'](_0x120be1);}return _0x415608[_0x612a('0x26')]();};}function saveUpdates(_0x318a63,_0x2cc41f){return function(_0x482d42){if(_0x482d42){return _0x482d42[_0x612a('0x27')](_0x318a63)[_0x612a('0x28')](function(_0x35152d){return _0x35152d;});}return null;};}function removeEntity(_0x5d95f1,_0x545f7c){return function(_0x32f2fe){if(_0x32f2fe){return _0x32f2fe['destroy']()[_0x612a('0x28')](function(){_0x5d95f1['status'](0xcc)[_0x612a('0x1f')]();});}};}function handleEntityNotFound(_0x465491,_0x200c2a){return function(_0x3002d2){if(!_0x3002d2){_0x465491[_0x612a('0x1e')](0x194);}return _0x3002d2;};}function handleError(_0x5a4432,_0x187297){_0x187297=_0x187297||0x1f4;return function(_0x376d98){logger[_0x612a('0x29')](_0x376d98[_0x612a('0x2a')]);if(_0x376d98[_0x612a('0x2b')]){delete _0x376d98[_0x612a('0x2b')];}_0x5a4432['status'](_0x187297)[_0x612a('0x2c')](_0x376d98);};}exports[_0x612a('0x2d')]=function(_0xd76aaa,_0x171871){var _0xe1a0dc={},_0x2710a9={},_0x296467={'count':0x0,'rows':[]};var _0x54e8d8=_[_0x612a('0x2e')](db[_0x612a('0x2f')]['rawAttributes'],function(_0x3308f5){return{'name':_0x3308f5['fieldName'],'type':_0x3308f5['type'][_0x612a('0x30')]};});_0x2710a9[_0x612a('0x31')]=_[_0x612a('0x2e')](_0x54e8d8,_0x612a('0x2b'));_0x2710a9[_0x612a('0x32')]=_[_0x612a('0x33')](_0xd76aaa[_0x612a('0x32')]);_0x2710a9['filters']=_[_0x612a('0x34')](_0x2710a9['model'],_0x2710a9['query']);_0xe1a0dc[_0x612a('0x35')]=_[_0x612a('0x34')](_0x2710a9[_0x612a('0x31')],qs[_0x612a('0x36')](_0xd76aaa[_0x612a('0x32')][_0x612a('0x36')]));_0xe1a0dc[_0x612a('0x35')]=_0xe1a0dc['attributes'][_0x612a('0x37')]?_0xe1a0dc['attributes']:_0x2710a9['model'];if(!_0xd76aaa[_0x612a('0x32')]['hasOwnProperty'](_0x612a('0x38'))){_0xe1a0dc[_0x612a('0x22')]=qs[_0x612a('0x22')](_0xd76aaa[_0x612a('0x32')][_0x612a('0x22')]);_0xe1a0dc[_0x612a('0x39')]=qs[_0x612a('0x39')](_0xd76aaa[_0x612a('0x32')][_0x612a('0x39')]);}_0xe1a0dc[_0x612a('0x3a')]=qs[_0x612a('0x3b')](_0xd76aaa[_0x612a('0x32')][_0x612a('0x3b')]);_0xe1a0dc[_0x612a('0x3c')]=qs['filters'](_[_0x612a('0x3d')](_0xd76aaa[_0x612a('0x32')],_0x2710a9[_0x612a('0x3e')]),_0x54e8d8);if(_0xd76aaa[_0x612a('0x32')]['filter']){_0xe1a0dc[_0x612a('0x3c')]=_[_0x612a('0x3f')](_0xe1a0dc[_0x612a('0x3c')],{'$or':_[_0x612a('0x2e')](_0x54e8d8,function(_0x17923c){if(_0x17923c[_0x612a('0x40')]!==_0x612a('0x41')){var _0x1d7acc={};_0x1d7acc[_0x17923c[_0x612a('0x2b')]]={'$like':'%'+_0xd76aaa[_0x612a('0x32')][_0x612a('0x42')]+'%'};return _0x1d7acc;}})});}_0xe1a0dc=_[_0x612a('0x3f')]({},_0xe1a0dc,_0xd76aaa[_0x612a('0x43')]);var _0x244c4f={'where':_0xe1a0dc[_0x612a('0x3c')]};return db[_0x612a('0x2f')][_0x612a('0x24')](_0x244c4f)[_0x612a('0x28')](function(_0x325e69){_0x296467[_0x612a('0x24')]=_0x325e69;if(_0xd76aaa['query'][_0x612a('0x44')]){_0xe1a0dc[_0x612a('0x45')]=[{'all':!![]}];}return db[_0x612a('0x2f')][_0x612a('0x46')](_0xe1a0dc);})[_0x612a('0x28')](function(_0x32f2ee){_0x296467['rows']=_0x32f2ee;return _0x296467;})[_0x612a('0x28')](respondWithFilteredResult(_0x171871,_0xe1a0dc))[_0x612a('0x47')](handleError(_0x171871,null));};exports['show']=function(_0x549073,_0x55302a){var _0x201f89={'raw':!![],'where':{'id':_0x549073[_0x612a('0x48')]['id']}},_0x414d5a={};_0x414d5a[_0x612a('0x31')]=_['keys'](db[_0x612a('0x2f')][_0x612a('0x49')]);_0x414d5a[_0x612a('0x32')]=_['keys'](_0x549073[_0x612a('0x32')]);_0x414d5a[_0x612a('0x3e')]=_[_0x612a('0x34')](_0x414d5a[_0x612a('0x31')],_0x414d5a[_0x612a('0x32')]);_0x201f89[_0x612a('0x35')]=_[_0x612a('0x34')](_0x414d5a[_0x612a('0x31')],qs[_0x612a('0x36')](_0x549073[_0x612a('0x32')]['fields']));_0x201f89['attributes']=_0x201f89[_0x612a('0x35')]['length']?_0x201f89['attributes']:_0x414d5a['model'];if(_0x549073[_0x612a('0x32')][_0x612a('0x44')]){_0x201f89[_0x612a('0x45')]=[{'all':!![]}];}_0x201f89=_[_0x612a('0x3f')]({},_0x201f89,_0x549073[_0x612a('0x43')]);return db[_0x612a('0x2f')][_0x612a('0x4a')](_0x201f89)[_0x612a('0x28')](handleEntityNotFound(_0x55302a,null))[_0x612a('0x28')](respondWithResult(_0x55302a,null))[_0x612a('0x47')](handleError(_0x55302a,null));};exports[_0x612a('0x4b')]=function(_0x19c59b,_0x20b8f9){return db[_0x612a('0x2f')][_0x612a('0x4b')](_0x19c59b['body'],{})[_0x612a('0x28')](respondWithResult(_0x20b8f9,0xc9))[_0x612a('0x47')](handleError(_0x20b8f9,null));};exports[_0x612a('0x27')]=function(_0x4c0073,_0x11894b){if(_0x4c0073[_0x612a('0x4c')]['id']){delete _0x4c0073[_0x612a('0x4c')]['id'];}return db[_0x612a('0x2f')][_0x612a('0x4a')]({'where':{'id':_0x4c0073[_0x612a('0x48')]['id']}})[_0x612a('0x28')](handleEntityNotFound(_0x11894b,null))[_0x612a('0x28')](saveUpdates(_0x4c0073[_0x612a('0x4c')],null))[_0x612a('0x28')](respondWithResult(_0x11894b,null))[_0x612a('0x47')](handleError(_0x11894b,null));};exports[_0x612a('0x4d')]=function(_0x530de1,_0x3750b9){return db['FreshsalesField'][_0x612a('0x4a')]({'where':{'id':_0x530de1[_0x612a('0x48')]['id']}})[_0x612a('0x28')](handleEntityNotFound(_0x3750b9,null))[_0x612a('0x28')](removeEntity(_0x3750b9,null))[_0x612a('0x47')](handleError(_0x3750b9,null));}; \ No newline at end of file +var _0x9ef2=['include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ef2,0x1cd));var _0x29ef=function(_0x61eed3,_0x4d4289){_0x61eed3=_0x61eed3-0x0;var _0x1a4350=_0x9ef2[_0x61eed3];return _0x1a4350;};'use strict';var emlformat=require(_0x29ef('0x0'));var rimraf=require(_0x29ef('0x1'));var zipdir=require(_0x29ef('0x2'));var jsonpatch=require(_0x29ef('0x3'));var rp=require(_0x29ef('0x4'));var moment=require(_0x29ef('0x5'));var BPromise=require(_0x29ef('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x29ef('0x7'));var sox=require(_0x29ef('0x8'));var csv=require(_0x29ef('0x9'));var ejs=require(_0x29ef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29ef('0xb'));var squel=require(_0x29ef('0xc'));var crypto=require(_0x29ef('0xd'));var jsforce=require(_0x29ef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x29ef('0x9'));var querystring=require('querystring');var Papa=require(_0x29ef('0xf'));var Redis=require(_0x29ef('0x10'));var authService=require(_0x29ef('0x11'));var qs=require(_0x29ef('0x12'));var as=require(_0x29ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29ef('0x14'))(_0x29ef('0x15'));var utils=require(_0x29ef('0x16'));var config=require(_0x29ef('0x17'));var licenseUtil=require(_0x29ef('0x18'));var db=require(_0x29ef('0x19'))['db'];function respondWithStatusCode(_0x334043,_0x3558d3){_0x3558d3=_0x3558d3||0xcc;return function(_0x2e733f){if(_0x2e733f){return _0x334043[_0x29ef('0x1a')](_0x3558d3);}return _0x334043['status'](_0x3558d3)[_0x29ef('0x1b')]();};}function respondWithResult(_0x20cc26,_0x55ea6a){_0x55ea6a=_0x55ea6a||0xc8;return function(_0x1fbf7c){if(_0x1fbf7c){return _0x20cc26[_0x29ef('0x1c')](_0x55ea6a)['json'](_0x1fbf7c);}};}function respondWithFilteredResult(_0x27cf99,_0x2ba56f){return function(_0xbae00b){if(_0xbae00b){var _0xf188ce=typeof _0x2ba56f['offset']===_0x29ef('0x1d')&&typeof _0x2ba56f['limit']==='undefined';var _0x1fb183=_0xbae00b[_0x29ef('0x1e')];var _0x383037=_0xf188ce?0x0:_0x2ba56f[_0x29ef('0x1f')];var _0xa7af52=_0xf188ce?_0xbae00b['count']:_0x2ba56f[_0x29ef('0x1f')]+_0x2ba56f[_0x29ef('0x20')];var _0x4fb455;if(_0xa7af52>=_0x1fb183){_0xa7af52=_0x1fb183;_0x4fb455=0xc8;}else{_0x4fb455=0xce;}_0x27cf99[_0x29ef('0x1c')](_0x4fb455);return _0x27cf99[_0x29ef('0x21')](_0x29ef('0x22'),_0x383037+'-'+_0xa7af52+'/'+_0x1fb183)[_0x29ef('0x23')](_0xbae00b);}return null;};}function patchUpdates(_0x46192c){return function(_0x4b5e91){try{jsonpatch[_0x29ef('0x24')](_0x4b5e91,_0x46192c,!![]);}catch(_0x47738d){return BPromise['reject'](_0x47738d);}return _0x4b5e91['save']();};}function saveUpdates(_0x47ae1c,_0xc67b3a){return function(_0x26a11e){if(_0x26a11e){return _0x26a11e[_0x29ef('0x25')](_0x47ae1c)[_0x29ef('0x26')](function(_0xa878c1){return _0xa878c1;});}return null;};}function removeEntity(_0x54a9e2,_0x305b6a){return function(_0x3c8a9e){if(_0x3c8a9e){return _0x3c8a9e[_0x29ef('0x27')]()['then'](function(){_0x54a9e2[_0x29ef('0x1c')](0xcc)[_0x29ef('0x1b')]();});}};}function handleEntityNotFound(_0x447412,_0x30f716){return function(_0x45cee1){if(!_0x45cee1){_0x447412[_0x29ef('0x1a')](0x194);}return _0x45cee1;};}function handleError(_0x118084,_0x4ba44e){_0x4ba44e=_0x4ba44e||0x1f4;return function(_0x2533c1){logger['error'](_0x2533c1[_0x29ef('0x28')]);if(_0x2533c1[_0x29ef('0x29')]){delete _0x2533c1[_0x29ef('0x29')];}_0x118084[_0x29ef('0x1c')](_0x4ba44e)[_0x29ef('0x2a')](_0x2533c1);};}exports[_0x29ef('0x2b')]=function(_0x3d259b,_0x5dc0ee){var _0x127e84={},_0x2030c5={},_0x10a477={'count':0x0,'rows':[]};var _0x2c91a3=_['map'](db[_0x29ef('0x2c')][_0x29ef('0x2d')],function(_0x41ad7e){return{'name':_0x41ad7e[_0x29ef('0x2e')],'type':_0x41ad7e[_0x29ef('0x2f')][_0x29ef('0x30')]};});_0x2030c5[_0x29ef('0x31')]=_[_0x29ef('0x32')](_0x2c91a3,'name');_0x2030c5[_0x29ef('0x33')]=_['keys'](_0x3d259b[_0x29ef('0x33')]);_0x2030c5[_0x29ef('0x34')]=_[_0x29ef('0x35')](_0x2030c5[_0x29ef('0x31')],_0x2030c5['query']);_0x127e84[_0x29ef('0x36')]=_[_0x29ef('0x35')](_0x2030c5['model'],qs[_0x29ef('0x37')](_0x3d259b[_0x29ef('0x33')][_0x29ef('0x37')]));_0x127e84[_0x29ef('0x36')]=_0x127e84[_0x29ef('0x36')][_0x29ef('0x38')]?_0x127e84[_0x29ef('0x36')]:_0x2030c5['model'];if(!_0x3d259b['query'][_0x29ef('0x39')]('nolimit')){_0x127e84[_0x29ef('0x20')]=qs['limit'](_0x3d259b[_0x29ef('0x33')][_0x29ef('0x20')]);_0x127e84['offset']=qs[_0x29ef('0x1f')](_0x3d259b[_0x29ef('0x33')][_0x29ef('0x1f')]);}_0x127e84['order']=qs[_0x29ef('0x3a')](_0x3d259b[_0x29ef('0x33')][_0x29ef('0x3a')]);_0x127e84[_0x29ef('0x3b')]=qs[_0x29ef('0x34')](_[_0x29ef('0x3c')](_0x3d259b[_0x29ef('0x33')],_0x2030c5[_0x29ef('0x34')]),_0x2c91a3);if(_0x3d259b[_0x29ef('0x33')]['filter']){_0x127e84[_0x29ef('0x3b')]=_['merge'](_0x127e84[_0x29ef('0x3b')],{'$or':_['map'](_0x2c91a3,function(_0x21b058){if(_0x21b058[_0x29ef('0x2f')]!=='VIRTUAL'){var _0x2b09cd={};_0x2b09cd[_0x21b058[_0x29ef('0x29')]]={'$like':'%'+_0x3d259b[_0x29ef('0x33')][_0x29ef('0x3d')]+'%'};return _0x2b09cd;}})});}_0x127e84=_[_0x29ef('0x3e')]({},_0x127e84,_0x3d259b[_0x29ef('0x3f')]);var _0x1cc606={'where':_0x127e84[_0x29ef('0x3b')]};return db['FreshsalesField'][_0x29ef('0x1e')](_0x1cc606)['then'](function(_0x12c74e){_0x10a477[_0x29ef('0x1e')]=_0x12c74e;if(_0x3d259b[_0x29ef('0x33')]['includeAll']){_0x127e84[_0x29ef('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0x29ef('0x41')](_0x127e84);})[_0x29ef('0x26')](function(_0x23f64f){_0x10a477[_0x29ef('0x42')]=_0x23f64f;return _0x10a477;})[_0x29ef('0x26')](respondWithFilteredResult(_0x5dc0ee,_0x127e84))[_0x29ef('0x43')](handleError(_0x5dc0ee,null));};exports[_0x29ef('0x44')]=function(_0x4fc0c1,_0x9ffd07){var _0x1930f9={'raw':!![],'where':{'id':_0x4fc0c1[_0x29ef('0x45')]['id']}},_0x5431d5={};_0x5431d5[_0x29ef('0x31')]=_[_0x29ef('0x46')](db[_0x29ef('0x2c')][_0x29ef('0x2d')]);_0x5431d5[_0x29ef('0x33')]=_[_0x29ef('0x46')](_0x4fc0c1[_0x29ef('0x33')]);_0x5431d5[_0x29ef('0x34')]=_[_0x29ef('0x35')](_0x5431d5[_0x29ef('0x31')],_0x5431d5[_0x29ef('0x33')]);_0x1930f9[_0x29ef('0x36')]=_[_0x29ef('0x35')](_0x5431d5[_0x29ef('0x31')],qs['fields'](_0x4fc0c1[_0x29ef('0x33')][_0x29ef('0x37')]));_0x1930f9[_0x29ef('0x36')]=_0x1930f9[_0x29ef('0x36')][_0x29ef('0x38')]?_0x1930f9[_0x29ef('0x36')]:_0x5431d5[_0x29ef('0x31')];if(_0x4fc0c1[_0x29ef('0x33')][_0x29ef('0x47')]){_0x1930f9['include']=[{'all':!![]}];}_0x1930f9=_['merge']({},_0x1930f9,_0x4fc0c1[_0x29ef('0x3f')]);return db[_0x29ef('0x2c')][_0x29ef('0x48')](_0x1930f9)[_0x29ef('0x26')](handleEntityNotFound(_0x9ffd07,null))[_0x29ef('0x26')](respondWithResult(_0x9ffd07,null))[_0x29ef('0x43')](handleError(_0x9ffd07,null));};exports['create']=function(_0x57270e,_0x1635e1){return db[_0x29ef('0x2c')][_0x29ef('0x49')](_0x57270e[_0x29ef('0x4a')],{})['then'](respondWithResult(_0x1635e1,0xc9))[_0x29ef('0x43')](handleError(_0x1635e1,null));};exports[_0x29ef('0x25')]=function(_0x3acdb1,_0x7de881){if(_0x3acdb1[_0x29ef('0x4a')]['id']){delete _0x3acdb1[_0x29ef('0x4a')]['id'];}return db[_0x29ef('0x2c')][_0x29ef('0x48')]({'where':{'id':_0x3acdb1[_0x29ef('0x45')]['id']}})[_0x29ef('0x26')](handleEntityNotFound(_0x7de881,null))[_0x29ef('0x26')](saveUpdates(_0x3acdb1[_0x29ef('0x4a')],null))[_0x29ef('0x26')](respondWithResult(_0x7de881,null))[_0x29ef('0x43')](handleError(_0x7de881,null));};exports[_0x29ef('0x27')]=function(_0x31becb,_0x59d3e8){return db['FreshsalesField'][_0x29ef('0x48')]({'where':{'id':_0x31becb['params']['id']}})['then'](handleEntityNotFound(_0x59d3e8,null))['then'](removeEntity(_0x59d3e8,null))[_0x29ef('0x43')](handleError(_0x59d3e8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 677d661..24efbd6 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 _0x2515=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId'];(function(_0x44c4c7,_0x4ed953){var _0x2669de=function(_0xa85c8a){while(--_0xa85c8a){_0x44c4c7['push'](_0x44c4c7['shift']());}};_0x2669de(++_0x4ed953);}(_0x2515,0x1c2));var _0x5251=function(_0x154009,_0x54f6b0){_0x154009=_0x154009-0x0;var _0x599565=_0x2515[_0x154009];return _0x599565;};'use strict';var _=require(_0x5251('0x0'));var util=require(_0x5251('0x1'));var logger=require('../../config/logger')(_0x5251('0x2'));var moment=require(_0x5251('0x3'));var BPromise=require(_0x5251('0x4'));var rp=require(_0x5251('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5251('0x6'));var config=require(_0x5251('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x5251('0x8')]=function(_0xa2b768,_0x228dcd){return _0xa2b768[_0x5251('0x9')](_0x5251('0xa'),attributes,{'tableName':_0x5251('0xb'),'paranoid':![],'indexes':[{'name':_0x5251('0xc'),'fields':[_0x5251('0xd'),_0x5251('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c9a=['request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger','moment','bluebird'];(function(_0x964c35,_0x5ce28c){var _0x4c00df=function(_0x252649){while(--_0x252649){_0x964c35['push'](_0x964c35['shift']());}};_0x4c00df(++_0x5ce28c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x2a49ed,_0x57d6f3){_0x2a49ed=_0x2a49ed-0x0;var _0x106147=_0x1c9a[_0x2a49ed];return _0x106147;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var logger=require(_0xa1c9('0x1'))('api');var moment=require(_0xa1c9('0x2'));var BPromise=require(_0xa1c9('0x3'));var rp=require(_0xa1c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c9('0x5'));var config=require(_0xa1c9('0x6'));var attributes=require(_0xa1c9('0x7'));module[_0xa1c9('0x8')]=function(_0x572229,_0x144e91){return _0x572229['define'](_0xa1c9('0x9'),attributes,{'tableName':_0xa1c9('0xa'),'paranoid':![],'indexes':[{'name':_0xa1c9('0xb'),'fields':['idField',_0xa1c9('0xc')],'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 a0361d5..2f2345e 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4975,0x86));var _0x5497=function(_0x56aec0,_0x152f0b){_0x56aec0=_0x56aec0-0x0;var _0x127c78=_0x4975[_0x56aec0];return _0x127c78;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x5d17=['request','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x15e4cb,_0x13056a){var _0x67c1ae=function(_0x228565){while(--_0x228565){_0x15e4cb['push'](_0x15e4cb['shift']());}};_0x67c1ae(++_0x13056a);}(_0x5d17,0x114));var _0x75d1=function(_0x1b2cd4,_0x220d18){_0x1b2cd4=_0x1b2cd4-0x0;var _0x3e2ff5=_0x5d17[_0x1b2cd4];return _0x3e2ff5;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index bc0e879..56cbf6f 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x13ebc3,_0x57d179){var _0x1aafd1=function(_0x36512e){while(--_0x36512e){_0x13ebc3['push'](_0x13ebc3['shift']());}};_0x1aafd1(++_0x57d179);}(_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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1a26a5,_0x11d94b){var _0x498f12=function(_0x1fbf72){while(--_0x1fbf72){_0x1a26a5['push'](_0x1a26a5['shift']());}};_0x498f12(++_0x11d94b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 f90a01d..b0d0d93 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 _0xe9e5=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x23da70,_0x455207){var _0x11ea06=function(_0x285294){while(--_0x285294){_0x23da70['push'](_0x23da70['shift']());}};_0x11ea06(++_0x455207);}(_0xe9e5,0x138));var _0x5e9e=function(_0x459943,_0xad659){_0x459943=_0x459943-0x0;var _0x2b09b3=_0xe9e5[_0x459943];return _0x2b09b3;};'use strict';var Sequelize=require(_0x5e9e('0x0'));module[_0x5e9e('0x1')]={'name':{'type':Sequelize[_0x5e9e('0x2')]},'description':{'type':Sequelize[_0x5e9e('0x2')]},'username':{'type':Sequelize[_0x5e9e('0x2')],'unique':_0x5e9e('0x3')},'remoteUri':{'type':Sequelize[_0x5e9e('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x5e9e('0x2')]},'clientSecret':{'type':Sequelize[_0x5e9e('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5e9e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5e9e('0x4')](_0x5e9e('0x5'),_0x5e9e('0x6')),'defaultValue':_0x5e9e('0x5')}}; \ No newline at end of file +var _0xf34f=['sequelize','STRING','ENUM','newTab'];(function(_0x2f8aea,_0x5795f2){var _0x28a9f6=function(_0x31fdb3){while(--_0x31fdb3){_0x2f8aea['push'](_0x2f8aea['shift']());}};_0x28a9f6(++_0x5795f2);}(_0xf34f,0x64));var _0xff34=function(_0xdd19af,_0x14aa80){_0xdd19af=_0xdd19af-0x0;var _0x418584=_0xf34f[_0xdd19af];return _0x418584;};'use strict';var Sequelize=require(_0xff34('0x0'));module['exports']={'name':{'type':Sequelize[_0xff34('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xff34('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xff34('0x1')]},'password':{'type':Sequelize[_0xff34('0x1')]},'clientId':{'type':Sequelize[_0xff34('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xff34('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xff34('0x2')]('integrationTab',_0xff34('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4f8614c..f642f5e 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 _0x994f=['Subject','int','email','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','rows','catch','show','params','keys','length','include','options','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientSecret','username','password','slice','Connection','clientId','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsRecurrence'];(function(_0x5520df,_0x330cec){var _0x2016c8=function(_0x1b4af2){while(--_0x1b4af2){_0x5520df['push'](_0x5520df['shift']());}};_0x2016c8(++_0x330cec);}(_0x994f,0x90));var _0xf994=function(_0x5af9ba,_0x30adfb){_0x5af9ba=_0x5af9ba-0x0;var _0x488c7c=_0x994f[_0x5af9ba];return _0x488c7c;};'use strict';var emlformat=require(_0xf994('0x0'));var rimraf=require(_0xf994('0x1'));var zipdir=require(_0xf994('0x2'));var jsonpatch=require(_0xf994('0x3'));var rp=require(_0xf994('0x4'));var moment=require('moment');var BPromise=require(_0xf994('0x5'));var Mustache=require(_0xf994('0x6'));var util=require(_0xf994('0x7'));var path=require(_0xf994('0x8'));var sox=require('sox');var csv=require(_0xf994('0x9'));var ejs=require(_0xf994('0xa'));var fs=require('fs');var fs_extra=require(_0xf994('0xb'));var _=require(_0xf994('0xc'));var squel=require(_0xf994('0xd'));var crypto=require(_0xf994('0xe'));var jsforce=require(_0xf994('0xf'));var deskjs=require(_0xf994('0x10'));var toCsv=require(_0xf994('0x9'));var querystring=require(_0xf994('0x11'));var Papa=require('papaparse');var Redis=require(_0xf994('0x12'));var authService=require(_0xf994('0x13'));var qs=require(_0xf994('0x14'));var as=require(_0xf994('0x15'));var hardwareService=require(_0xf994('0x16'));var logger=require(_0xf994('0x17'))(_0xf994('0x18'));var utils=require(_0xf994('0x19'));var config=require(_0xf994('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf994('0x1b'));function respondWithStatusCode(_0x3bf461,_0x2f3673){_0x2f3673=_0x2f3673||0xcc;return function(_0x1adc37){if(_0x1adc37){return _0x3bf461[_0xf994('0x1c')](_0x2f3673);}return _0x3bf461['status'](_0x2f3673)[_0xf994('0x1d')]();};}function respondWithResult(_0x146525,_0x274b46){_0x274b46=_0x274b46||0xc8;return function(_0x223a9f){if(_0x223a9f){return _0x146525['status'](_0x274b46)[_0xf994('0x1e')](_0x223a9f);}};}function respondWithFilteredResult(_0x56af00,_0x3e7e1b){return function(_0xc02aa4){if(_0xc02aa4){var _0x57d5a7=typeof _0x3e7e1b[_0xf994('0x1f')]==='undefined'&&typeof _0x3e7e1b['limit']===_0xf994('0x20');var _0x5b061b=_0xc02aa4[_0xf994('0x21')];var _0x3dce4b=_0x57d5a7?0x0:_0x3e7e1b[_0xf994('0x1f')];var _0x325038=_0x57d5a7?_0xc02aa4[_0xf994('0x21')]:_0x3e7e1b['offset']+_0x3e7e1b[_0xf994('0x22')];var _0x3a049c;if(_0x325038>=_0x5b061b){_0x325038=_0x5b061b;_0x3a049c=0xc8;}else{_0x3a049c=0xce;}_0x56af00[_0xf994('0x23')](_0x3a049c);return _0x56af00[_0xf994('0x24')](_0xf994('0x25'),_0x3dce4b+'-'+_0x325038+'/'+_0x5b061b)['json'](_0xc02aa4);}return null;};}function patchUpdates(_0x1029de){return function(_0x590ab){try{jsonpatch[_0xf994('0x26')](_0x590ab,_0x1029de,!![]);}catch(_0x4bbdbc){return BPromise['reject'](_0x4bbdbc);}return _0x590ab[_0xf994('0x27')]();};}function saveUpdates(_0x71743b,_0x38bcd2){return function(_0xec6c76){if(_0xec6c76){return _0xec6c76[_0xf994('0x28')](_0x71743b)[_0xf994('0x29')](function(_0x51587a){return _0x51587a;});}return null;};}function removeEntity(_0xe64923,_0x62591c){return function(_0x8b8b8){if(_0x8b8b8){return _0x8b8b8['destroy']()[_0xf994('0x29')](function(){_0xe64923['status'](0xcc)[_0xf994('0x1d')]();});}};}function handleEntityNotFound(_0x5d2e1a,_0xecd685){return function(_0xb2639f){if(!_0xb2639f){_0x5d2e1a['sendStatus'](0x194);}return _0xb2639f;};}function handleError(_0x234984,_0x49285b){_0x49285b=_0x49285b||0x1f4;return function(_0x30bf15){logger[_0xf994('0x2a')](_0x30bf15[_0xf994('0x2b')]);if(_0x30bf15['name']){delete _0x30bf15[_0xf994('0x2c')];}_0x234984[_0xf994('0x23')](_0x49285b)[_0xf994('0x2d')](_0x30bf15);};}exports[_0xf994('0x2e')]=function(_0x57d5ec,_0x4bf62d){var _0x871ed6={},_0x464eaa={},_0xcbd735={'count':0x0,'rows':[]};var _0x128642=_[_0xf994('0x2f')](db[_0xf994('0x30')][_0xf994('0x31')],function(_0x1e9ade){return{'name':_0x1e9ade[_0xf994('0x32')],'type':_0x1e9ade[_0xf994('0x33')]['key']};});_0x464eaa['model']=_[_0xf994('0x2f')](_0x128642,_0xf994('0x2c'));_0x464eaa[_0xf994('0x34')]=_['keys'](_0x57d5ec[_0xf994('0x34')]);_0x464eaa[_0xf994('0x35')]=_[_0xf994('0x36')](_0x464eaa['model'],_0x464eaa[_0xf994('0x34')]);_0x871ed6[_0xf994('0x37')]=_[_0xf994('0x36')](_0x464eaa['model'],qs[_0xf994('0x38')](_0x57d5ec[_0xf994('0x34')][_0xf994('0x38')]));_0x871ed6[_0xf994('0x37')]=_0x871ed6[_0xf994('0x37')]['length']?_0x871ed6[_0xf994('0x37')]:_0x464eaa[_0xf994('0x39')];if(!_0x57d5ec['query'][_0xf994('0x3a')](_0xf994('0x3b'))){_0x871ed6['limit']=qs[_0xf994('0x22')](_0x57d5ec[_0xf994('0x34')][_0xf994('0x22')]);_0x871ed6[_0xf994('0x1f')]=qs[_0xf994('0x1f')](_0x57d5ec['query'][_0xf994('0x1f')]);}_0x871ed6[_0xf994('0x3c')]=qs[_0xf994('0x3d')](_0x57d5ec[_0xf994('0x34')]['sort']);_0x871ed6[_0xf994('0x3e')]=qs[_0xf994('0x35')](_[_0xf994('0x3f')](_0x57d5ec[_0xf994('0x34')],_0x464eaa[_0xf994('0x35')]),_0x128642);if(_0x57d5ec[_0xf994('0x34')]['filter']){_0x871ed6[_0xf994('0x3e')]=_['merge'](_0x871ed6[_0xf994('0x3e')],{'$or':_['map'](_0x128642,function(_0x340df6){if(_0x340df6[_0xf994('0x33')]!==_0xf994('0x40')){var _0x2c1d9e={};_0x2c1d9e[_0x340df6[_0xf994('0x2c')]]={'$like':'%'+_0x57d5ec[_0xf994('0x34')]['filter']+'%'};return _0x2c1d9e;}})});}_0x871ed6=_[_0xf994('0x41')]({},_0x871ed6,_0x57d5ec['options']);var _0x3e0a54={'where':_0x871ed6[_0xf994('0x3e')]};return db[_0xf994('0x30')][_0xf994('0x21')](_0x3e0a54)['then'](function(_0x5551f3){_0xcbd735['count']=_0x5551f3;if(_0x57d5ec['query'][_0xf994('0x42')]){_0x871ed6['include']=[{'all':!![]}];}return db[_0xf994('0x30')]['findAll'](_0x871ed6);})[_0xf994('0x29')](function(_0x2372ba){_0xcbd735[_0xf994('0x43')]=_0x2372ba;return _0xcbd735;})[_0xf994('0x29')](respondWithFilteredResult(_0x4bf62d,_0x871ed6))[_0xf994('0x44')](handleError(_0x4bf62d,null));};exports[_0xf994('0x45')]=function(_0xf51449,_0x552c0d){var _0xc3ac0c={'raw':![],'where':{'id':_0xf51449[_0xf994('0x46')]['id']}},_0x2da542={};_0x2da542['model']=_[_0xf994('0x47')](db[_0xf994('0x30')][_0xf994('0x31')]);_0x2da542[_0xf994('0x34')]=_[_0xf994('0x47')](_0xf51449['query']);_0x2da542['filters']=_[_0xf994('0x36')](_0x2da542[_0xf994('0x39')],_0x2da542[_0xf994('0x34')]);_0xc3ac0c[_0xf994('0x37')]=_[_0xf994('0x36')](_0x2da542['model'],qs['fields'](_0xf51449[_0xf994('0x34')]['fields']));_0xc3ac0c[_0xf994('0x37')]=_0xc3ac0c[_0xf994('0x37')][_0xf994('0x48')]?_0xc3ac0c['attributes']:_0x2da542[_0xf994('0x39')];if(_0xf51449[_0xf994('0x34')][_0xf994('0x42')]){_0xc3ac0c[_0xf994('0x49')]=[{'all':!![]}];}_0xc3ac0c=_[_0xf994('0x41')]({},_0xc3ac0c,_0xf51449[_0xf994('0x4a')]);return db['SalesforceAccount'][_0xf994('0x4b')](_0xc3ac0c)[_0xf994('0x29')](handleEntityNotFound(_0x552c0d,null))[_0xf994('0x29')](respondWithResult(_0x552c0d,null))[_0xf994('0x44')](handleError(_0x552c0d,null));};exports[_0xf994('0x4c')]=function(_0x46d03c,_0x39e2a){return db[_0xf994('0x30')]['create'](_0x46d03c[_0xf994('0x4d')],{})['then'](respondWithResult(_0x39e2a,0xc9))[_0xf994('0x44')](handleError(_0x39e2a,null));};exports[_0xf994('0x28')]=function(_0x5ca65a,_0x4073be){if(_0x5ca65a['body']['id']){delete _0x5ca65a[_0xf994('0x4d')]['id'];}return db[_0xf994('0x30')]['find']({'where':{'id':_0x5ca65a[_0xf994('0x46')]['id']}})[_0xf994('0x29')](handleEntityNotFound(_0x4073be,null))[_0xf994('0x29')](saveUpdates(_0x5ca65a[_0xf994('0x4d')],null))[_0xf994('0x29')](respondWithResult(_0x4073be,null))[_0xf994('0x44')](handleError(_0x4073be,null));};exports[_0xf994('0x4e')]=function(_0x59bd26,_0x845cbf){return db['SalesforceAccount']['find']({'where':{'id':_0x59bd26[_0xf994('0x46')]['id']}})[_0xf994('0x29')](handleEntityNotFound(_0x845cbf,null))[_0xf994('0x29')](removeEntity(_0x845cbf,null))[_0xf994('0x44')](handleError(_0x845cbf,null));};exports[_0xf994('0x4f')]=function(_0x35bca8,_0x18a727,_0x3fde53){var _0x2aedc0={};var _0x905fbd={};var _0x385eff;var _0x1f871b;return db['SalesforceAccount'][_0xf994('0x50')]({'where':{'id':_0x35bca8['params']['id']}})[_0xf994('0x29')](handleEntityNotFound(_0x18a727,null))[_0xf994('0x29')](function(_0x591d1f){if(_0x591d1f){_0x385eff=_0x591d1f;_0x905fbd[_0xf994('0x39')]=_[_0xf994('0x47')](db[_0xf994('0x51')][_0xf994('0x31')]);_0x905fbd[_0xf994('0x34')]=_[_0xf994('0x47')](_0x35bca8[_0xf994('0x34')]);_0x905fbd[_0xf994('0x35')]=_['intersection'](_0x905fbd['model'],_0x905fbd[_0xf994('0x34')]);_0x2aedc0[_0xf994('0x37')]=_[_0xf994('0x36')](_0x905fbd[_0xf994('0x39')],qs['fields'](_0x35bca8[_0xf994('0x34')][_0xf994('0x38')]));_0x2aedc0[_0xf994('0x37')]=_0x2aedc0['attributes'][_0xf994('0x48')]?_0x2aedc0[_0xf994('0x37')]:_0x905fbd[_0xf994('0x39')];_0x2aedc0[_0xf994('0x3c')]=qs[_0xf994('0x3d')](_0x35bca8[_0xf994('0x34')]['sort']);_0x2aedc0['where']=qs[_0xf994('0x35')](_[_0xf994('0x3f')](_0x35bca8[_0xf994('0x34')],_0x905fbd[_0xf994('0x35')]));if(_0x35bca8[_0xf994('0x34')][_0xf994('0x52')]){_0x2aedc0[_0xf994('0x3e')]=_[_0xf994('0x41')](_0x2aedc0['where'],{'$or':_['map'](_0x2aedc0['attributes'],function(_0x92eb6){var _0x327d3f={};_0x327d3f[_0x92eb6]={'$like':'%'+_0x35bca8[_0xf994('0x34')][_0xf994('0x52')]+'%'};return _0x327d3f;})});}_0x2aedc0=_[_0xf994('0x41')]({},_0x2aedc0,_0x35bca8[_0xf994('0x4a')]);return _0x385eff[_0xf994('0x4f')](_0x2aedc0);}})[_0xf994('0x29')](function(_0x3fae22){if(_0x3fae22){_0x1f871b=_0x3fae22[_0xf994('0x48')];if(!_0x35bca8[_0xf994('0x34')]['hasOwnProperty'](_0xf994('0x3b'))){_0x2aedc0['limit']=qs[_0xf994('0x22')](_0x35bca8[_0xf994('0x34')][_0xf994('0x22')]);_0x2aedc0[_0xf994('0x1f')]=qs[_0xf994('0x1f')](_0x35bca8[_0xf994('0x34')][_0xf994('0x1f')]);}return _0x385eff['getConfigurations'](_0x2aedc0);}})[_0xf994('0x29')](function(_0x3353ce){if(_0x3353ce){return _0x3353ce?{'count':_0x1f871b,'rows':_0x3353ce}:null;}})['then'](respondWithResult(_0x18a727,null))['catch'](handleError(_0x18a727,null));};exports[_0xf994('0x53')]=function(_0x48ca46,_0xaa6ecd,_0x14e721){if(_0x48ca46[_0xf994('0x4d')]['id']){delete _0x48ca46['body']['id'];}return db[_0xf994('0x30')][_0xf994('0x50')]({'where':{'id':_0x48ca46[_0xf994('0x46')]['id']}})[_0xf994('0x29')](handleEntityNotFound(_0xaa6ecd,null))[_0xf994('0x29')](function(_0x3db115){if(_0x3db115){_0x48ca46[_0xf994('0x4d')]['AccountId']=_0x3db115['id'];_0x48ca46[_0xf994('0x4d')][_0xf994('0x54')]=integrations[_0xf994('0x55')](_0x48ca46[_0xf994('0x4d')][_0xf994('0x56')],_0x48ca46[_0xf994('0x4d')][_0xf994('0x33')]);_0x48ca46[_0xf994('0x4d')][_0xf994('0x57')]=integrations[_0xf994('0x58')](_0x48ca46['body'][_0xf994('0x56')],_0x48ca46['body']['type']);return db[_0xf994('0x51')][_0xf994('0x4c')](_0x48ca46[_0xf994('0x4d')],{'include':[{'model':db['SalesforceField'],'as':_0xf994('0x54')},{'model':db[_0xf994('0x59')],'as':_0xf994('0x57')}]});}return null;})[_0xf994('0x29')](respondWithResult(_0xaa6ecd,null))[_0xf994('0x44')](handleError(_0xaa6ecd,null));};exports['getFields']=function(_0x551940,_0x467b0f,_0x93f923){var _0x8b21ef;var _0xa6941e='';var _0x13fe7d=_0xf994('0x5a');return db[_0xf994('0x30')][_0xf994('0x50')]({'where':{'id':_0x551940[_0xf994('0x46')]['id']},'attributes':['id',_0xf994('0x5b'),'clientId',_0xf994('0x5c'),_0xf994('0x5d'),_0xf994('0x5e'),'securityToken']})['then'](handleEntityNotFound(_0x467b0f,null))[_0xf994('0x29')](function(_0x1911f0){if(_0x1911f0){_0xa6941e=_0x1911f0['remoteUri'];var _0xd16fb=_0xa6941e[_0xf994('0x5f')](-0x1);if(_0xd16fb==='/'){_0xa6941e=_0xa6941e['substring'](0x0,_0xa6941e['lastIndexOf'](_0xd16fb));}_0x8b21ef=new jsforce[(_0xf994('0x60'))]({'oauth2':{'loginUrl':_0xa6941e,'clientId':_0x1911f0[_0xf994('0x61')],'clientSecret':_0x1911f0[_0xf994('0x5c')]}});return _0x8b21ef[_0xf994('0x62')](_0x1911f0['username'],_0x1911f0[_0xf994('0x5e')][_0xf994('0x63')](_0x1911f0['securityToken']));}})['then'](function(_0x3e0051){if(_0x3e0051){if(!_[_0xf994('0x64')](_0x551940[_0xf994('0x34')][_0xf994('0x65')])){_0x13fe7d=_0x551940['query']['ticketType'];}return _0x8b21ef['sobject'](_0x13fe7d)[_0xf994('0x66')]();}})[_0xf994('0x29')](function(_0x27e4cf){var _0x55da37=[_0xf994('0x67'),_0xf994('0x68'),'IsReminderSet',_0xf994('0x69'),_0xf994('0x6a'),'Description'];var _0x327862=['string',_0xf994('0x6b'),'picklist','boolean',_0xf994('0x6c'),'textarea','phone'];if(_0x27e4cf){_[_0xf994('0x6d')](_0x27e4cf[_0xf994('0x38')],function(_0x1f478d){return _0x55da37[_0xf994('0x6e')](_0x1f478d[_0xf994('0x2c')])||!_0x327862['includes'](_0x1f478d['type']);});return{'count':_0x27e4cf[_0xf994('0x38')][_0xf994('0x48')],'rows':_[_0xf994('0x2f')](_0x27e4cf['fields'],function(_0x3d2176){return{'id':_0x3d2176['name'],'name':_0x3d2176[_0xf994('0x6f')],'custom':_0x3d2176[_0xf994('0x70')],'options':_0x3d2176[_0xf994('0x71')][_0xf994('0x48')]>0x0?_['map'](_0x3d2176[_0xf994('0x71')],function(_0x4fad25){return{'name':_0x4fad25[_0xf994('0x6f')],'value':_0x4fad25[_0xf994('0x72')]};}):_0x3d2176['type']==_0xf994('0x73')?[{'name':_0xf994('0x74'),'value':_0xf994('0x75')},{'name':_0xf994('0x76'),'value':'false'}]:[]};})};}})[_0xf994('0x29')](respondWithResult(_0x467b0f,null))[_0xf994('0x44')](function(_0x3c42f7){var _0x10ff29=_0x551940[_0xf994('0x34')][_0xf994('0x77')]?0x1f4:_0x3c42f7['statusCode']||0x1f4;logger[_0xf994('0x2a')](_0xf994('0x78'),_0xf994('0x79'),_0x10ff29,JSON[_0xf994('0x7a')](_0x3c42f7));delete _0x3c42f7['name'];if(_0x10ff29===0x191){_0x10ff29=0x190;}_0x467b0f[_0xf994('0x23')](_0x10ff29)['send'](_0x551940[_0xf994('0x34')][_0xf994('0x77')]?{'message':_0xf994('0x7b'),'statusCode':_0x3c42f7[_0xf994('0x7c')]}:_0x3c42f7);});}; \ No newline at end of file +var _0x3b6d=['True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','fields','options','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','Subject','Description','string','int','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value'];(function(_0x3c10b7,_0x10fb4a){var _0xbd891b=function(_0x256dc3){while(--_0x256dc3){_0x3c10b7['push'](_0x3c10b7['shift']());}};_0xbd891b(++_0x10fb4a);}(_0x3b6d,0x86));var _0xd3b6=function(_0x2e7ecc,_0x4dbfac){_0x2e7ecc=_0x2e7ecc-0x0;var _0x708a4d=_0x3b6d[_0x2e7ecc];return _0x708a4d;};'use strict';var emlformat=require(_0xd3b6('0x0'));var rimraf=require(_0xd3b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd3b6('0x2'));var moment=require(_0xd3b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd3b6('0x4'));var util=require(_0xd3b6('0x5'));var path=require(_0xd3b6('0x6'));var sox=require(_0xd3b6('0x7'));var csv=require(_0xd3b6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd3b6('0x9'));var deskjs=require(_0xd3b6('0xa'));var toCsv=require(_0xd3b6('0x8'));var querystring=require('querystring');var Papa=require(_0xd3b6('0xb'));var Redis=require(_0xd3b6('0xc'));var authService=require(_0xd3b6('0xd'));var qs=require(_0xd3b6('0xe'));var as=require(_0xd3b6('0xf'));var hardwareService=require(_0xd3b6('0x10'));var logger=require(_0xd3b6('0x11'))(_0xd3b6('0x12'));var utils=require('../../config/utils');var config=require(_0xd3b6('0x13'));var licenseUtil=require(_0xd3b6('0x14'));var db=require(_0xd3b6('0x15'))['db'];var integrations=require(_0xd3b6('0x16'));function respondWithStatusCode(_0x3be403,_0x38775e){_0x38775e=_0x38775e||0xcc;return function(_0x4f582f){if(_0x4f582f){return _0x3be403[_0xd3b6('0x17')](_0x38775e);}return _0x3be403['status'](_0x38775e)[_0xd3b6('0x18')]();};}function respondWithResult(_0x5bb6c4,_0x192f9e){_0x192f9e=_0x192f9e||0xc8;return function(_0x116be4){if(_0x116be4){return _0x5bb6c4[_0xd3b6('0x19')](_0x192f9e)[_0xd3b6('0x1a')](_0x116be4);}};}function respondWithFilteredResult(_0x5bfeda,_0x37ed80){return function(_0x3aa974){if(_0x3aa974){var _0x37fc91=typeof _0x37ed80[_0xd3b6('0x1b')]===_0xd3b6('0x1c')&&typeof _0x37ed80[_0xd3b6('0x1d')]==='undefined';var _0x105108=_0x3aa974[_0xd3b6('0x1e')];var _0x31d21f=_0x37fc91?0x0:_0x37ed80[_0xd3b6('0x1b')];var _0x272805=_0x37fc91?_0x3aa974[_0xd3b6('0x1e')]:_0x37ed80[_0xd3b6('0x1b')]+_0x37ed80[_0xd3b6('0x1d')];var _0x498741;if(_0x272805>=_0x105108){_0x272805=_0x105108;_0x498741=0xc8;}else{_0x498741=0xce;}_0x5bfeda[_0xd3b6('0x19')](_0x498741);return _0x5bfeda[_0xd3b6('0x1f')](_0xd3b6('0x20'),_0x31d21f+'-'+_0x272805+'/'+_0x105108)[_0xd3b6('0x1a')](_0x3aa974);}return null;};}function patchUpdates(_0x5da872){return function(_0x5342d1){try{jsonpatch[_0xd3b6('0x21')](_0x5342d1,_0x5da872,!![]);}catch(_0x4d3a6f){return BPromise[_0xd3b6('0x22')](_0x4d3a6f);}return _0x5342d1[_0xd3b6('0x23')]();};}function saveUpdates(_0x23ab03,_0x11e0f3){return function(_0x3c408e){if(_0x3c408e){return _0x3c408e['update'](_0x23ab03)['then'](function(_0x17eb48){return _0x17eb48;});}return null;};}function removeEntity(_0x477466,_0xc2e800){return function(_0x3f47ee){if(_0x3f47ee){return _0x3f47ee[_0xd3b6('0x24')]()[_0xd3b6('0x25')](function(){_0x477466[_0xd3b6('0x19')](0xcc)[_0xd3b6('0x18')]();});}};}function handleEntityNotFound(_0x1fe3ec,_0x41e929){return function(_0x51277d){if(!_0x51277d){_0x1fe3ec[_0xd3b6('0x17')](0x194);}return _0x51277d;};}function handleError(_0x538109,_0xe7bc29){_0xe7bc29=_0xe7bc29||0x1f4;return function(_0x4b0962){logger[_0xd3b6('0x26')](_0x4b0962[_0xd3b6('0x27')]);if(_0x4b0962[_0xd3b6('0x28')]){delete _0x4b0962[_0xd3b6('0x28')];}_0x538109[_0xd3b6('0x19')](_0xe7bc29)[_0xd3b6('0x29')](_0x4b0962);};}exports[_0xd3b6('0x2a')]=function(_0x3ede36,_0x569d67){var _0xbf5c73={},_0x158013={},_0x553489={'count':0x0,'rows':[]};var _0x103f89=_[_0xd3b6('0x2b')](db[_0xd3b6('0x2c')][_0xd3b6('0x2d')],function(_0x420fc5){return{'name':_0x420fc5[_0xd3b6('0x2e')],'type':_0x420fc5[_0xd3b6('0x2f')][_0xd3b6('0x30')]};});_0x158013['model']=_[_0xd3b6('0x2b')](_0x103f89,'name');_0x158013[_0xd3b6('0x31')]=_['keys'](_0x3ede36[_0xd3b6('0x31')]);_0x158013['filters']=_[_0xd3b6('0x32')](_0x158013[_0xd3b6('0x33')],_0x158013[_0xd3b6('0x31')]);_0xbf5c73[_0xd3b6('0x34')]=_[_0xd3b6('0x32')](_0x158013[_0xd3b6('0x33')],qs['fields'](_0x3ede36[_0xd3b6('0x31')]['fields']));_0xbf5c73[_0xd3b6('0x34')]=_0xbf5c73['attributes'][_0xd3b6('0x35')]?_0xbf5c73[_0xd3b6('0x34')]:_0x158013[_0xd3b6('0x33')];if(!_0x3ede36['query'][_0xd3b6('0x36')](_0xd3b6('0x37'))){_0xbf5c73[_0xd3b6('0x1d')]=qs['limit'](_0x3ede36[_0xd3b6('0x31')]['limit']);_0xbf5c73[_0xd3b6('0x1b')]=qs[_0xd3b6('0x1b')](_0x3ede36[_0xd3b6('0x31')][_0xd3b6('0x1b')]);}_0xbf5c73[_0xd3b6('0x38')]=qs[_0xd3b6('0x39')](_0x3ede36[_0xd3b6('0x31')][_0xd3b6('0x39')]);_0xbf5c73[_0xd3b6('0x3a')]=qs[_0xd3b6('0x3b')](_['pick'](_0x3ede36[_0xd3b6('0x31')],_0x158013[_0xd3b6('0x3b')]),_0x103f89);if(_0x3ede36[_0xd3b6('0x31')][_0xd3b6('0x3c')]){_0xbf5c73[_0xd3b6('0x3a')]=_[_0xd3b6('0x3d')](_0xbf5c73['where'],{'$or':_[_0xd3b6('0x2b')](_0x103f89,function(_0x26b9f5){if(_0x26b9f5['type']!==_0xd3b6('0x3e')){var _0x4c2fbd={};_0x4c2fbd[_0x26b9f5[_0xd3b6('0x28')]]={'$like':'%'+_0x3ede36[_0xd3b6('0x31')][_0xd3b6('0x3c')]+'%'};return _0x4c2fbd;}})});}_0xbf5c73=_[_0xd3b6('0x3d')]({},_0xbf5c73,_0x3ede36['options']);var _0x4039ec={'where':_0xbf5c73[_0xd3b6('0x3a')]};return db['SalesforceAccount'][_0xd3b6('0x1e')](_0x4039ec)['then'](function(_0x52bc86){_0x553489[_0xd3b6('0x1e')]=_0x52bc86;if(_0x3ede36[_0xd3b6('0x31')][_0xd3b6('0x3f')]){_0xbf5c73[_0xd3b6('0x40')]=[{'all':!![]}];}return db[_0xd3b6('0x2c')][_0xd3b6('0x41')](_0xbf5c73);})[_0xd3b6('0x25')](function(_0x52f65b){_0x553489[_0xd3b6('0x42')]=_0x52f65b;return _0x553489;})[_0xd3b6('0x25')](respondWithFilteredResult(_0x569d67,_0xbf5c73))[_0xd3b6('0x43')](handleError(_0x569d67,null));};exports['show']=function(_0x8966fe,_0x21029c){var _0xdc9cea={'raw':![],'where':{'id':_0x8966fe[_0xd3b6('0x44')]['id']}},_0x2c45c7={};_0x2c45c7[_0xd3b6('0x33')]=_[_0xd3b6('0x45')](db[_0xd3b6('0x2c')][_0xd3b6('0x2d')]);_0x2c45c7[_0xd3b6('0x31')]=_['keys'](_0x8966fe[_0xd3b6('0x31')]);_0x2c45c7[_0xd3b6('0x3b')]=_[_0xd3b6('0x32')](_0x2c45c7[_0xd3b6('0x33')],_0x2c45c7[_0xd3b6('0x31')]);_0xdc9cea[_0xd3b6('0x34')]=_[_0xd3b6('0x32')](_0x2c45c7[_0xd3b6('0x33')],qs[_0xd3b6('0x46')](_0x8966fe[_0xd3b6('0x31')][_0xd3b6('0x46')]));_0xdc9cea['attributes']=_0xdc9cea[_0xd3b6('0x34')][_0xd3b6('0x35')]?_0xdc9cea[_0xd3b6('0x34')]:_0x2c45c7[_0xd3b6('0x33')];if(_0x8966fe[_0xd3b6('0x31')][_0xd3b6('0x3f')]){_0xdc9cea[_0xd3b6('0x40')]=[{'all':!![]}];}_0xdc9cea=_[_0xd3b6('0x3d')]({},_0xdc9cea,_0x8966fe[_0xd3b6('0x47')]);return db[_0xd3b6('0x2c')][_0xd3b6('0x48')](_0xdc9cea)['then'](handleEntityNotFound(_0x21029c,null))['then'](respondWithResult(_0x21029c,null))[_0xd3b6('0x43')](handleError(_0x21029c,null));};exports['create']=function(_0x593712,_0xf7687f){return db[_0xd3b6('0x2c')][_0xd3b6('0x49')](_0x593712[_0xd3b6('0x4a')],{})['then'](respondWithResult(_0xf7687f,0xc9))['catch'](handleError(_0xf7687f,null));};exports[_0xd3b6('0x4b')]=function(_0x723d91,_0x13009e){if(_0x723d91[_0xd3b6('0x4a')]['id']){delete _0x723d91[_0xd3b6('0x4a')]['id'];}return db[_0xd3b6('0x2c')]['find']({'where':{'id':_0x723d91[_0xd3b6('0x44')]['id']}})[_0xd3b6('0x25')](handleEntityNotFound(_0x13009e,null))[_0xd3b6('0x25')](saveUpdates(_0x723d91['body'],null))[_0xd3b6('0x25')](respondWithResult(_0x13009e,null))[_0xd3b6('0x43')](handleError(_0x13009e,null));};exports['destroy']=function(_0x26c216,_0x181861){return db[_0xd3b6('0x2c')]['find']({'where':{'id':_0x26c216[_0xd3b6('0x44')]['id']}})['then'](handleEntityNotFound(_0x181861,null))['then'](removeEntity(_0x181861,null))['catch'](handleError(_0x181861,null));};exports[_0xd3b6('0x4c')]=function(_0x52512c,_0x311063,_0x49c54f){var _0x29dd42={};var _0x59c43c={};var _0x387630;var _0x1f3871;return db[_0xd3b6('0x2c')][_0xd3b6('0x4d')]({'where':{'id':_0x52512c[_0xd3b6('0x44')]['id']}})[_0xd3b6('0x25')](handleEntityNotFound(_0x311063,null))[_0xd3b6('0x25')](function(_0xbfddf){if(_0xbfddf){_0x387630=_0xbfddf;_0x59c43c[_0xd3b6('0x33')]=_[_0xd3b6('0x45')](db[_0xd3b6('0x4e')][_0xd3b6('0x2d')]);_0x59c43c['query']=_[_0xd3b6('0x45')](_0x52512c['query']);_0x59c43c[_0xd3b6('0x3b')]=_[_0xd3b6('0x32')](_0x59c43c[_0xd3b6('0x33')],_0x59c43c['query']);_0x29dd42['attributes']=_['intersection'](_0x59c43c[_0xd3b6('0x33')],qs[_0xd3b6('0x46')](_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x46')]));_0x29dd42['attributes']=_0x29dd42[_0xd3b6('0x34')]['length']?_0x29dd42[_0xd3b6('0x34')]:_0x59c43c[_0xd3b6('0x33')];_0x29dd42['order']=qs[_0xd3b6('0x39')](_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x39')]);_0x29dd42['where']=qs[_0xd3b6('0x3b')](_[_0xd3b6('0x4f')](_0x52512c[_0xd3b6('0x31')],_0x59c43c[_0xd3b6('0x3b')]));if(_0x52512c['query']['filter']){_0x29dd42[_0xd3b6('0x3a')]=_['merge'](_0x29dd42[_0xd3b6('0x3a')],{'$or':_['map'](_0x29dd42[_0xd3b6('0x34')],function(_0x421451){var _0x44b349={};_0x44b349[_0x421451]={'$like':'%'+_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x3c')]+'%'};return _0x44b349;})});}_0x29dd42=_[_0xd3b6('0x3d')]({},_0x29dd42,_0x52512c[_0xd3b6('0x47')]);return _0x387630[_0xd3b6('0x4c')](_0x29dd42);}})['then'](function(_0x16b459){if(_0x16b459){_0x1f3871=_0x16b459[_0xd3b6('0x35')];if(!_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x36')]('nolimit')){_0x29dd42[_0xd3b6('0x1d')]=qs['limit'](_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x1d')]);_0x29dd42[_0xd3b6('0x1b')]=qs[_0xd3b6('0x1b')](_0x52512c[_0xd3b6('0x31')][_0xd3b6('0x1b')]);}return _0x387630[_0xd3b6('0x4c')](_0x29dd42);}})[_0xd3b6('0x25')](function(_0x2264fe){if(_0x2264fe){return _0x2264fe?{'count':_0x1f3871,'rows':_0x2264fe}:null;}})[_0xd3b6('0x25')](respondWithResult(_0x311063,null))[_0xd3b6('0x43')](handleError(_0x311063,null));};exports[_0xd3b6('0x50')]=function(_0x45ba1d,_0x2836c9,_0x9bed04){if(_0x45ba1d[_0xd3b6('0x4a')]['id']){delete _0x45ba1d[_0xd3b6('0x4a')]['id'];}return db[_0xd3b6('0x2c')][_0xd3b6('0x4d')]({'where':{'id':_0x45ba1d['params']['id']}})[_0xd3b6('0x25')](handleEntityNotFound(_0x2836c9,null))[_0xd3b6('0x25')](function(_0x25bf4e){if(_0x25bf4e){_0x45ba1d[_0xd3b6('0x4a')][_0xd3b6('0x51')]=_0x25bf4e['id'];_0x45ba1d[_0xd3b6('0x4a')][_0xd3b6('0x52')]=integrations['getSubjects'](_0x45ba1d['body'][_0xd3b6('0x53')],_0x45ba1d['body'][_0xd3b6('0x2f')]);_0x45ba1d['body']['Descriptions']=integrations[_0xd3b6('0x54')](_0x45ba1d[_0xd3b6('0x4a')][_0xd3b6('0x53')],_0x45ba1d[_0xd3b6('0x4a')][_0xd3b6('0x2f')]);return db[_0xd3b6('0x4e')]['create'](_0x45ba1d[_0xd3b6('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0xd3b6('0x52')},{'model':db[_0xd3b6('0x55')],'as':'Descriptions'}]});}return null;})[_0xd3b6('0x25')](respondWithResult(_0x2836c9,null))['catch'](handleError(_0x2836c9,null));};exports[_0xd3b6('0x56')]=function(_0x5ea3b4,_0x3da389,_0x25c571){var _0x1dc675;var _0x5804d4='';var _0x15ed50=_0xd3b6('0x57');return db['SalesforceAccount'][_0xd3b6('0x4d')]({'where':{'id':_0x5ea3b4[_0xd3b6('0x44')]['id']},'attributes':['id',_0xd3b6('0x58'),_0xd3b6('0x59'),'clientSecret',_0xd3b6('0x5a'),_0xd3b6('0x5b'),_0xd3b6('0x5c')]})[_0xd3b6('0x25')](handleEntityNotFound(_0x3da389,null))[_0xd3b6('0x25')](function(_0x184e4e){if(_0x184e4e){_0x5804d4=_0x184e4e[_0xd3b6('0x58')];var _0x4892df=_0x5804d4[_0xd3b6('0x5d')](-0x1);if(_0x4892df==='/'){_0x5804d4=_0x5804d4[_0xd3b6('0x5e')](0x0,_0x5804d4[_0xd3b6('0x5f')](_0x4892df));}_0x1dc675=new jsforce[(_0xd3b6('0x60'))]({'oauth2':{'loginUrl':_0x5804d4,'clientId':_0x184e4e[_0xd3b6('0x59')],'clientSecret':_0x184e4e[_0xd3b6('0x61')]}});return _0x1dc675[_0xd3b6('0x62')](_0x184e4e[_0xd3b6('0x5a')],_0x184e4e[_0xd3b6('0x5b')]['concat'](_0x184e4e[_0xd3b6('0x5c')]));}})[_0xd3b6('0x25')](function(_0x48d7f7){if(_0x48d7f7){if(!_[_0xd3b6('0x63')](_0x5ea3b4[_0xd3b6('0x31')]['ticketType'])){_0x15ed50=_0x5ea3b4[_0xd3b6('0x31')][_0xd3b6('0x64')];}return _0x1dc675[_0xd3b6('0x65')](_0x15ed50)[_0xd3b6('0x66')]();}})['then'](function(_0x19bb19){var _0x35ef8f=[_0xd3b6('0x67'),_0xd3b6('0x68'),'IsReminderSet','IsRecurrence',_0xd3b6('0x69'),_0xd3b6('0x6a')];var _0x5c8be7=[_0xd3b6('0x6b'),_0xd3b6('0x6c'),'picklist',_0xd3b6('0x6d'),'email',_0xd3b6('0x6e'),_0xd3b6('0x6f')];if(_0x19bb19){_[_0xd3b6('0x70')](_0x19bb19['fields'],function(_0x514d4a){return _0x35ef8f[_0xd3b6('0x71')](_0x514d4a[_0xd3b6('0x28')])||!_0x5c8be7[_0xd3b6('0x71')](_0x514d4a[_0xd3b6('0x2f')]);});return{'count':_0x19bb19[_0xd3b6('0x46')][_0xd3b6('0x35')],'rows':_[_0xd3b6('0x2b')](_0x19bb19[_0xd3b6('0x46')],function(_0x526b47){return{'id':_0x526b47[_0xd3b6('0x28')],'name':_0x526b47[_0xd3b6('0x72')],'custom':_0x526b47[_0xd3b6('0x73')],'options':_0x526b47['picklistValues'][_0xd3b6('0x35')]>0x0?_[_0xd3b6('0x2b')](_0x526b47[_0xd3b6('0x74')],function(_0x1f2844){return{'name':_0x1f2844['label'],'value':_0x1f2844[_0xd3b6('0x75')]};}):_0x526b47[_0xd3b6('0x2f')]=='boolean'?[{'name':_0xd3b6('0x76'),'value':_0xd3b6('0x77')},{'name':_0xd3b6('0x78'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x3da389,null))[_0xd3b6('0x43')](function(_0x37b9c9){var _0x25d1b4=_0x5ea3b4[_0xd3b6('0x31')][_0xd3b6('0x79')]?0x1f4:_0x37b9c9[_0xd3b6('0x7a')]||0x1f4;logger[_0xd3b6('0x26')](_0xd3b6('0x7b'),_0xd3b6('0x56'),_0x25d1b4,JSON[_0xd3b6('0x7c')](_0x37b9c9));delete _0x37b9c9[_0xd3b6('0x28')];if(_0x25d1b4===0x191){_0x25d1b4=0x190;}_0x3da389[_0xd3b6('0x19')](_0x25d1b4)['send'](_0x5ea3b4[_0xd3b6('0x31')][_0xd3b6('0x79')]?{'message':_0xd3b6('0x7d'),'statusCode':_0x37b9c9[_0xd3b6('0x7a')]}:_0x37b9c9);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4579855..d912083 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 _0x5dea=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5dea,0x1bc));var _0xa5de=function(_0x22e0e2,_0x3523ca){_0x22e0e2=_0x22e0e2-0x0;var _0x48143a=_0x5dea[_0x22e0e2];return _0x48143a;};'use strict';var _=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var logger=require(_0xa5de('0x2'))(_0xa5de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5de('0x5'));var config=require(_0xa5de('0x6'));var attributes=require(_0xa5de('0x7'));var integrations=require(_0xa5de('0x8'));module['exports']=function(_0x894aad,_0x52ab35){return _0x894aad[_0xa5de('0x9')](_0xa5de('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0d5=['path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','bluebird','request-promise'];(function(_0x4f4510,_0x170115){var _0xba7774=function(_0x514626){while(--_0x514626){_0x4f4510['push'](_0x4f4510['shift']());}};_0xba7774(++_0x170115);}(_0xd0d5,0x1ed));var _0x5d0d=function(_0x609a1d,_0xbfa0dd){_0x609a1d=_0x609a1d-0x0;var _0x44ae5b=_0xd0d5[_0x609a1d];return _0x44ae5b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5d0d('0x0'));var rp=require(_0x5d0d('0x1'));var fs=require('fs');var path=require(_0x5d0d('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d0d('0x3'));var integrations=require(_0x5d0d('0x4'));module[_0x5d0d('0x5')]=function(_0x4259ce,_0x5ace89){return _0x4259ce[_0x5d0d('0x6')](_0x5d0d('0x7'),attributes,{'tableName':_0x5d0d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 6949d9f..1ff428d 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 _0xdb9a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','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','raw','where','attributes','include','map','model','info','ShowSalesforceAccount','find','lodash','moment','randomstring','ioredis'];(function(_0x16b238,_0x4834f4){var _0x4ce3e0=function(_0x173092){while(--_0x173092){_0x16b238['push'](_0x16b238['shift']());}};_0x4ce3e0(++_0x4834f4);}(_0xdb9a,0xce));var _0xadb9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdb9a[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xadb9('0x0'));var util=require('util');var moment=require(_0xadb9('0x1'));var BPromise=require('bluebird');var rs=require(_0xadb9('0x2'));var fs=require('fs');var Redis=require(_0xadb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xadb9('0x4'))(_0xadb9('0x5'));var config=require(_0xadb9('0x6'));var jayson=require(_0xadb9('0x7'));var client=jayson[_0xadb9('0x8')][_0xadb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x459e91,_0xdb3385,_0x5d4675){return new BPromise(function(_0x49428,_0x1b08ad){return client[_0xadb9('0xa')](_0x459e91,_0x5d4675)[_0xadb9('0xb')](function(_0x30bdd0){logger['info'](_0xadb9('0xc'),_0xdb3385,_0xadb9('0xd'));logger[_0xadb9('0xe')](_0xadb9('0xf'),_0xdb3385,_0xadb9('0xd'),JSON[_0xadb9('0x10')](_0x30bdd0));if(_0x30bdd0[_0xadb9('0x11')]){if(_0x30bdd0[_0xadb9('0x11')][_0xadb9('0x12')]===0x1f4){logger[_0xadb9('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0xdb3385,_0x30bdd0[_0xadb9('0x11')]['message']);return _0x1b08ad(_0x30bdd0[_0xadb9('0x11')][_0xadb9('0x13')]);}logger['error'](_0xadb9('0xc'),_0xdb3385,_0x30bdd0[_0xadb9('0x11')][_0xadb9('0x13')]);return _0x49428(_0x30bdd0['error'][_0xadb9('0x13')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xdb3385,_0xadb9('0xd'));_0x49428(_0x30bdd0[_0xadb9('0x14')][_0xadb9('0x13')]);}})[_0xadb9('0x15')](function(_0x3b6c66){logger[_0xadb9('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0xdb3385,_0x3b6c66);_0x1b08ad(_0x3b6c66);});});}exports[_0xadb9('0x16')]=function(_0x247227){var _0x101f5b=this;return new Promise(function(_0x5c523f,_0x361d32){return db[_0xadb9('0x17')][_0xadb9('0x18')]({'raw':_0x247227[_0xadb9('0x19')]?_0x247227[_0xadb9('0x19')][_0xadb9('0x1a')]===undefined?!![]:![]:!![],'where':_0x247227[_0xadb9('0x19')]?_0x247227[_0xadb9('0x19')][_0xadb9('0x1b')]||null:null,'attributes':_0x247227[_0xadb9('0x19')]?_0x247227[_0xadb9('0x19')][_0xadb9('0x1c')]||null:null,'limit':_0x247227['options']?_0x247227[_0xadb9('0x19')]['limit']||null:null,'include':_0x247227[_0xadb9('0x19')]?_0x247227['options'][_0xadb9('0x1d')]?_[_0xadb9('0x1e')](_0x247227['options']['include'],function(_0x43d689){return{'model':db[_0x43d689[_0xadb9('0x1f')]],'as':_0x43d689['as'],'attributes':_0x43d689[_0xadb9('0x1c')],'include':_0x43d689[_0xadb9('0x1d')]?_['map'](_0x43d689[_0xadb9('0x1d')],function(_0x413756){return{'model':db[_0x413756[_0xadb9('0x1f')]],'as':_0x413756['as'],'attributes':_0x413756['attributes'],'include':_0x413756[_0xadb9('0x1d')]?_['map'](_0x413756[_0xadb9('0x1d')],function(_0xfbd858){return{'model':db[_0xfbd858[_0xadb9('0x1f')]],'as':_0xfbd858['as'],'attributes':_0xfbd858['attributes']};}):[]};}):[]};}):[]:[]})[_0xadb9('0xb')](function(_0x397a13){logger[_0xadb9('0x20')](_0xadb9('0x16'),_0x247227);logger[_0xadb9('0xe')](_0xadb9('0x16'),_0x247227,JSON['stringify'](_0x397a13));_0x5c523f(_0x397a13);})[_0xadb9('0x15')](function(_0x483146){logger['error'](_0xadb9('0x16'),_0x483146[_0xadb9('0x13')],_0x247227);_0x361d32(_0x101f5b['error'](0x1f4,_0x483146['message']));});});};exports[_0xadb9('0x21')]=function(_0x3aaa20){var _0x1461d3=this;return new Promise(function(_0x34ed88,_0xe94410){return db[_0xadb9('0x17')][_0xadb9('0x22')]({'raw':_0x3aaa20['options']?_0x3aaa20[_0xadb9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3aaa20[_0xadb9('0x19')]?_0x3aaa20[_0xadb9('0x19')][_0xadb9('0x1b')]||null:null,'attributes':_0x3aaa20[_0xadb9('0x19')]?_0x3aaa20[_0xadb9('0x19')]['attributes']||null:null,'include':_0x3aaa20['options']?_0x3aaa20[_0xadb9('0x19')][_0xadb9('0x1d')]?_[_0xadb9('0x1e')](_0x3aaa20[_0xadb9('0x19')]['include'],function(_0x16d25b){return{'model':db[_0x16d25b[_0xadb9('0x1f')]],'as':_0x16d25b['as'],'attributes':_0x16d25b['attributes'],'include':_0x16d25b[_0xadb9('0x1d')]?_['map'](_0x16d25b[_0xadb9('0x1d')],function(_0x1791b6){return{'model':db[_0x1791b6[_0xadb9('0x1f')]],'as':_0x1791b6['as'],'attributes':_0x1791b6[_0xadb9('0x1c')],'include':_0x1791b6[_0xadb9('0x1d')]?_['map'](_0x1791b6[_0xadb9('0x1d')],function(_0x356cde){return{'model':db[_0x356cde['model']],'as':_0x356cde['as'],'attributes':_0x356cde[_0xadb9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xadb9('0xb')](function(_0x2ac94d){logger[_0xadb9('0x20')]('ShowSalesforceAccount',_0x3aaa20);logger['debug'](_0xadb9('0x21'),_0x3aaa20,JSON[_0xadb9('0x10')](_0x2ac94d));_0x34ed88(_0x2ac94d);})[_0xadb9('0x15')](function(_0x387aba){logger[_0xadb9('0x11')](_0xadb9('0x21'),_0x387aba[_0xadb9('0x13')],_0x3aaa20);_0xe94410(_0x1461d3[_0xadb9('0x11')](0x1f4,_0x387aba[_0xadb9('0x13')]));});});}; \ No newline at end of file +var _0x94e1=['options','raw','where','attributes','include','model','map','ShowSalesforceAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x94e1,0x132));var _0x194e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x94e1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x194e('0x0'));var util=require(_0x194e('0x1'));var moment=require(_0x194e('0x2'));var BPromise=require(_0x194e('0x3'));var rs=require(_0x194e('0x4'));var fs=require('fs');var Redis=require(_0x194e('0x5'));var db=require(_0x194e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x194e('0x7'))(_0x194e('0x8'));var config=require(_0x194e('0x9'));var jayson=require(_0x194e('0xa'));var client=jayson[_0x194e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21183a,_0x8896db,_0x1104f8){return new BPromise(function(_0x3c9111,_0x3697a7){return client[_0x194e('0xc')](_0x21183a,_0x1104f8)[_0x194e('0xd')](function(_0x51160b){logger['info'](_0x194e('0xe'),_0x8896db,_0x194e('0xf'));logger[_0x194e('0x10')](_0x194e('0x11'),_0x8896db,_0x194e('0xf'),JSON['stringify'](_0x51160b));if(_0x51160b[_0x194e('0x12')]){if(_0x51160b[_0x194e('0x12')][_0x194e('0x13')]===0x1f4){logger[_0x194e('0x12')](_0x194e('0xe'),_0x8896db,_0x51160b['error'][_0x194e('0x14')]);return _0x3697a7(_0x51160b[_0x194e('0x12')][_0x194e('0x14')]);}logger['error'](_0x194e('0xe'),_0x8896db,_0x51160b[_0x194e('0x12')][_0x194e('0x14')]);return _0x3c9111(_0x51160b[_0x194e('0x12')][_0x194e('0x14')]);}else{logger[_0x194e('0x15')](_0x194e('0xe'),_0x8896db,'request\x20sent');_0x3c9111(_0x51160b[_0x194e('0x16')][_0x194e('0x14')]);}})[_0x194e('0x17')](function(_0x472dc5){logger[_0x194e('0x12')](_0x194e('0xe'),_0x8896db,_0x472dc5);_0x3697a7(_0x472dc5);});});}exports[_0x194e('0x18')]=function(_0x18001f){var _0x3b28ab=this;return new Promise(function(_0x1e7f12,_0x3e4bea){return db[_0x194e('0x19')][_0x194e('0x1a')]({'raw':_0x18001f[_0x194e('0x1b')]?_0x18001f[_0x194e('0x1b')][_0x194e('0x1c')]===undefined?!![]:![]:!![],'where':_0x18001f[_0x194e('0x1b')]?_0x18001f[_0x194e('0x1b')][_0x194e('0x1d')]||null:null,'attributes':_0x18001f[_0x194e('0x1b')]?_0x18001f[_0x194e('0x1b')][_0x194e('0x1e')]||null:null,'limit':_0x18001f[_0x194e('0x1b')]?_0x18001f[_0x194e('0x1b')]['limit']||null:null,'include':_0x18001f[_0x194e('0x1b')]?_0x18001f[_0x194e('0x1b')]['include']?_['map'](_0x18001f[_0x194e('0x1b')][_0x194e('0x1f')],function(_0x17f51c){return{'model':db[_0x17f51c[_0x194e('0x20')]],'as':_0x17f51c['as'],'attributes':_0x17f51c[_0x194e('0x1e')],'include':_0x17f51c['include']?_[_0x194e('0x21')](_0x17f51c[_0x194e('0x1f')],function(_0xba8af){return{'model':db[_0xba8af['model']],'as':_0xba8af['as'],'attributes':_0xba8af[_0x194e('0x1e')],'include':_0xba8af[_0x194e('0x1f')]?_['map'](_0xba8af[_0x194e('0x1f')],function(_0x182e12){return{'model':db[_0x182e12[_0x194e('0x20')]],'as':_0x182e12['as'],'attributes':_0x182e12[_0x194e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x194e('0xd')](function(_0x142d06){logger[_0x194e('0x15')](_0x194e('0x18'),_0x18001f);logger[_0x194e('0x10')](_0x194e('0x18'),_0x18001f,JSON['stringify'](_0x142d06));_0x1e7f12(_0x142d06);})[_0x194e('0x17')](function(_0x106eb8){logger[_0x194e('0x12')](_0x194e('0x18'),_0x106eb8[_0x194e('0x14')],_0x18001f);_0x3e4bea(_0x3b28ab[_0x194e('0x12')](0x1f4,_0x106eb8['message']));});});};exports[_0x194e('0x22')]=function(_0x3dd793){var _0x53b888=this;return new Promise(function(_0x5abb9c,_0x30a13a){return db['SalesforceAccount'][_0x194e('0x23')]({'raw':_0x3dd793[_0x194e('0x1b')]?_0x3dd793[_0x194e('0x1b')][_0x194e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3dd793[_0x194e('0x1b')]?_0x3dd793[_0x194e('0x1b')][_0x194e('0x1d')]||null:null,'attributes':_0x3dd793[_0x194e('0x1b')]?_0x3dd793[_0x194e('0x1b')][_0x194e('0x1e')]||null:null,'include':_0x3dd793[_0x194e('0x1b')]?_0x3dd793[_0x194e('0x1b')][_0x194e('0x1f')]?_['map'](_0x3dd793[_0x194e('0x1b')][_0x194e('0x1f')],function(_0x7dc8b5){return{'model':db[_0x7dc8b5['model']],'as':_0x7dc8b5['as'],'attributes':_0x7dc8b5[_0x194e('0x1e')],'include':_0x7dc8b5[_0x194e('0x1f')]?_['map'](_0x7dc8b5[_0x194e('0x1f')],function(_0x1c0a1e){return{'model':db[_0x1c0a1e[_0x194e('0x20')]],'as':_0x1c0a1e['as'],'attributes':_0x1c0a1e[_0x194e('0x1e')],'include':_0x1c0a1e[_0x194e('0x1f')]?_[_0x194e('0x21')](_0x1c0a1e[_0x194e('0x1f')],function(_0x3a7597){return{'model':db[_0x3a7597[_0x194e('0x20')]],'as':_0x3a7597['as'],'attributes':_0x3a7597['attributes']};}):[]};}):[]};}):[]:[]})[_0x194e('0xd')](function(_0x25512d){logger[_0x194e('0x15')](_0x194e('0x22'),_0x3dd793);logger[_0x194e('0x10')]('ShowSalesforceAccount',_0x3dd793,JSON[_0x194e('0x24')](_0x25512d));_0x5abb9c(_0x25512d);})[_0x194e('0x17')](function(_0x5f26b5){logger['error'](_0x194e('0x22'),_0x5f26b5[_0x194e('0x14')],_0x3dd793);_0x30a13a(_0x53b888['error'](0x1f4,_0x5f26b5[_0x194e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 48a6f14..fc0385d 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x37ee56,_0x8666a7){var _0x30f88a=function(_0x1f468e){while(--_0x1f468e){_0x37ee56['push'](_0x37ee56['shift']());}};_0x30f88a(++_0x8666a7);}(_0x7a54,0x106));var _0x47a5=function(_0x4012e7,_0x301931){_0x4012e7=_0x4012e7-0x0;var _0x1c5c4a=_0x7a54[_0x4012e7];return _0x1c5c4a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x92cf41,_0x215d97){_0x92cf41=_0x92cf41-0x0;var _0x36a96d=_0x2032[_0x92cf41];return _0x36a96d;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index faf6335..3620c17 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 _0xafd0=['nothing','contact','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xafd0,0x18e));var _0x0afd=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xafd0[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x0afd('0x0'));module[_0x0afd('0x1')]={'name':{'type':Sequelize[_0x0afd('0x2')]},'description':{'type':Sequelize[_0x0afd('0x2')]},'ticketType':{'type':Sequelize[_0x0afd('0x3')](_0x0afd('0x4'),_0x0afd('0x5')),'defaultValue':_0x0afd('0x4')},'moduleSearch':{'type':Sequelize[_0x0afd('0x3')](_0x0afd('0x6'),'contact',_0x0afd('0x7'),_0x0afd('0x8'),'account'),'defaultValue':_0x0afd('0x6')},'moduleCreate':{'type':Sequelize[_0x0afd('0x3')](_0x0afd('0x9'),_0x0afd('0xa'),_0x0afd('0x7'),'account'),'defaultValue':_0x0afd('0x7')},'leadId':{'type':Sequelize[_0x0afd('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0afd('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x0afd('0x2')]}}; \ No newline at end of file +var _0xa1e8=['STRING','ENUM','Case','contact_lead','contact','lead','account','nothing','sequelize'];(function(_0x5404b0,_0x3ad1f0){var _0x16cdfe=function(_0x4cb6e4){while(--_0x4cb6e4){_0x5404b0['push'](_0x5404b0['shift']());}};_0x16cdfe(++_0x3ad1f0);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x2543c8,_0x4af6fe){_0x2543c8=_0x2543c8-0x0;var _0x55d9fd=_0xa1e8[_0x2543c8];return _0x55d9fd;};'use strict';var Sequelize=require(_0x8a1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a1e('0x1')]},'description':{'type':Sequelize[_0x8a1e('0x1')]},'ticketType':{'type':Sequelize[_0x8a1e('0x2')]('Task',_0x8a1e('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x8a1e('0x2')](_0x8a1e('0x4'),_0x8a1e('0x5'),_0x8a1e('0x6'),'account_contact_lead',_0x8a1e('0x7')),'defaultValue':_0x8a1e('0x4')},'moduleCreate':{'type':Sequelize[_0x8a1e('0x2')](_0x8a1e('0x8'),'contact',_0x8a1e('0x6'),_0x8a1e('0x7')),'defaultValue':_0x8a1e('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x8a1e('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x8a1e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 2a2a487..7b727f8 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 _0x131c=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','find','catch','create','body','update','params','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','order','getDescriptions','rimraf','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x131c,0x1e8));var _0xc131=function(_0x156696,_0x3a9a2e){_0x156696=_0x156696-0x0;var _0x5ab7c4=_0x131c[_0x156696];return _0x5ab7c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc131('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc131('0x1'));var util=require(_0xc131('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0xc131('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc131('0x4'));var _=require(_0xc131('0x5'));var squel=require('squel');var crypto=require(_0xc131('0x6'));var jsforce=require('jsforce');var deskjs=require(_0xc131('0x7'));var toCsv=require(_0xc131('0x3'));var querystring=require(_0xc131('0x8'));var Papa=require(_0xc131('0x9'));var Redis=require(_0xc131('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc131('0xb'));var logger=require(_0xc131('0xc'))(_0xc131('0xd'));var utils=require(_0xc131('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc131('0xf'))['db'];function respondWithStatusCode(_0x1e53d0,_0x3cf27f){_0x3cf27f=_0x3cf27f||0xcc;return function(_0x28426e){if(_0x28426e){return _0x1e53d0[_0xc131('0x10')](_0x3cf27f);}return _0x1e53d0[_0xc131('0x11')](_0x3cf27f)[_0xc131('0x12')]();};}function respondWithResult(_0x293cb3,_0x421b48){_0x421b48=_0x421b48||0xc8;return function(_0x5c14cf){if(_0x5c14cf){return _0x293cb3[_0xc131('0x11')](_0x421b48)['json'](_0x5c14cf);}};}function respondWithFilteredResult(_0x2056a6,_0x5261aa){return function(_0x4e08bd){if(_0x4e08bd){var _0x33f210=typeof _0x5261aa[_0xc131('0x13')]===_0xc131('0x14')&&typeof _0x5261aa[_0xc131('0x15')]===_0xc131('0x14');var _0x54ff34=_0x4e08bd[_0xc131('0x16')];var _0x2c9b71=_0x33f210?0x0:_0x5261aa['offset'];var _0x4780a3=_0x33f210?_0x4e08bd['count']:_0x5261aa['offset']+_0x5261aa['limit'];var _0x1691ed;if(_0x4780a3>=_0x54ff34){_0x4780a3=_0x54ff34;_0x1691ed=0xc8;}else{_0x1691ed=0xce;}_0x2056a6[_0xc131('0x11')](_0x1691ed);return _0x2056a6[_0xc131('0x17')](_0xc131('0x18'),_0x2c9b71+'-'+_0x4780a3+'/'+_0x54ff34)['json'](_0x4e08bd);}return null;};}function patchUpdates(_0x1ca11d){return function(_0x4a1bb4){try{jsonpatch[_0xc131('0x19')](_0x4a1bb4,_0x1ca11d,!![]);}catch(_0x5f017b){return BPromise[_0xc131('0x1a')](_0x5f017b);}return _0x4a1bb4['save']();};}function saveUpdates(_0x3e7657,_0x17f66b){return function(_0x225958){if(_0x225958){return _0x225958['update'](_0x3e7657)['then'](function(_0x5bea5e){return _0x5bea5e;});}return null;};}function removeEntity(_0x1ccc65,_0x14da6d){return function(_0x424255){if(_0x424255){return _0x424255[_0xc131('0x1b')]()[_0xc131('0x1c')](function(){_0x1ccc65[_0xc131('0x11')](0xcc)[_0xc131('0x12')]();});}};}function handleEntityNotFound(_0x2e7424,_0x48968e){return function(_0x45ab09){if(!_0x45ab09){_0x2e7424[_0xc131('0x10')](0x194);}return _0x45ab09;};}function handleError(_0x4bd5b5,_0x16e3a6){_0x16e3a6=_0x16e3a6||0x1f4;return function(_0x763764){logger[_0xc131('0x1d')](_0x763764[_0xc131('0x1e')]);if(_0x763764[_0xc131('0x1f')]){delete _0x763764['name'];}_0x4bd5b5[_0xc131('0x11')](_0x16e3a6)[_0xc131('0x20')](_0x763764);};}exports[_0xc131('0x21')]=function(_0x29af38,_0x39ad65){var _0x11d833={},_0x333c64={},_0x4f5471={'count':0x0,'rows':[]};var _0x5f4524=_[_0xc131('0x22')](db[_0xc131('0x23')][_0xc131('0x24')],function(_0x39cd28){return{'name':_0x39cd28[_0xc131('0x25')],'type':_0x39cd28[_0xc131('0x26')]['key']};});_0x333c64[_0xc131('0x27')]=_[_0xc131('0x22')](_0x5f4524,_0xc131('0x1f'));_0x333c64[_0xc131('0x28')]=_[_0xc131('0x29')](_0x29af38[_0xc131('0x28')]);_0x333c64[_0xc131('0x2a')]=_[_0xc131('0x2b')](_0x333c64[_0xc131('0x27')],_0x333c64[_0xc131('0x28')]);_0x11d833[_0xc131('0x2c')]=_[_0xc131('0x2b')](_0x333c64['model'],qs[_0xc131('0x2d')](_0x29af38[_0xc131('0x28')][_0xc131('0x2d')]));_0x11d833[_0xc131('0x2c')]=_0x11d833[_0xc131('0x2c')][_0xc131('0x2e')]?_0x11d833[_0xc131('0x2c')]:_0x333c64['model'];if(!_0x29af38[_0xc131('0x28')]['hasOwnProperty'](_0xc131('0x2f'))){_0x11d833[_0xc131('0x15')]=qs[_0xc131('0x15')](_0x29af38[_0xc131('0x28')][_0xc131('0x15')]);_0x11d833[_0xc131('0x13')]=qs['offset'](_0x29af38[_0xc131('0x28')][_0xc131('0x13')]);}_0x11d833['order']=qs[_0xc131('0x30')](_0x29af38[_0xc131('0x28')]['sort']);_0x11d833['where']=qs[_0xc131('0x2a')](_[_0xc131('0x31')](_0x29af38[_0xc131('0x28')],_0x333c64[_0xc131('0x2a')]),_0x5f4524);if(_0x29af38[_0xc131('0x28')][_0xc131('0x32')]){_0x11d833[_0xc131('0x33')]=_[_0xc131('0x34')](_0x11d833[_0xc131('0x33')],{'$or':_[_0xc131('0x22')](_0x5f4524,function(_0x3defb6){if(_0x3defb6[_0xc131('0x26')]!==_0xc131('0x35')){var _0x3c7881={};_0x3c7881[_0x3defb6[_0xc131('0x1f')]]={'$like':'%'+_0x29af38[_0xc131('0x28')][_0xc131('0x32')]+'%'};return _0x3c7881;}})});}_0x11d833=_[_0xc131('0x34')]({},_0x11d833,_0x29af38[_0xc131('0x36')]);var _0x20d0ff={'where':_0x11d833['where']};return db[_0xc131('0x23')][_0xc131('0x16')](_0x20d0ff)[_0xc131('0x1c')](function(_0x527bfb){_0x4f5471[_0xc131('0x16')]=_0x527bfb;if(_0x29af38[_0xc131('0x28')]['includeAll']){_0x11d833[_0xc131('0x37')]=[{'all':!![]}];}return db[_0xc131('0x23')][_0xc131('0x38')](_0x11d833);})[_0xc131('0x1c')](function(_0x5fcf0b){_0x4f5471[_0xc131('0x39')]=_0x5fcf0b;return _0x4f5471;})[_0xc131('0x1c')](respondWithFilteredResult(_0x39ad65,_0x11d833))['catch'](handleError(_0x39ad65,null));};exports[_0xc131('0x3a')]=function(_0x310728,_0x2f873e){var _0x5b9d48={'raw':![],'where':{'id':_0x310728['params']['id']}},_0x517914={};_0x517914[_0xc131('0x27')]=_[_0xc131('0x29')](db[_0xc131('0x23')][_0xc131('0x24')]);_0x517914[_0xc131('0x28')]=_[_0xc131('0x29')](_0x310728[_0xc131('0x28')]);_0x517914[_0xc131('0x2a')]=_[_0xc131('0x2b')](_0x517914[_0xc131('0x27')],_0x517914[_0xc131('0x28')]);_0x5b9d48[_0xc131('0x2c')]=_[_0xc131('0x2b')](_0x517914[_0xc131('0x27')],qs[_0xc131('0x2d')](_0x310728['query']['fields']));_0x5b9d48[_0xc131('0x2c')]=_0x5b9d48['attributes']['length']?_0x5b9d48[_0xc131('0x2c')]:_0x517914['model'];if(_0x310728['query']['includeAll']){_0x5b9d48[_0xc131('0x37')]=[{'all':!![]}];}_0x5b9d48=_['merge']({},_0x5b9d48,_0x310728[_0xc131('0x36')]);return db[_0xc131('0x23')][_0xc131('0x3b')](_0x5b9d48)[_0xc131('0x1c')](handleEntityNotFound(_0x2f873e,null))[_0xc131('0x1c')](respondWithResult(_0x2f873e,null))[_0xc131('0x3c')](handleError(_0x2f873e,null));};exports[_0xc131('0x3d')]=function(_0x4291eb,_0x3d7708){return db['SalesforceConfiguration'][_0xc131('0x3d')](_0x4291eb[_0xc131('0x3e')],{})[_0xc131('0x1c')](respondWithResult(_0x3d7708,0xc9))[_0xc131('0x3c')](handleError(_0x3d7708,null));};exports[_0xc131('0x3f')]=function(_0x5e3621,_0x191821){if(_0x5e3621['body']['id']){delete _0x5e3621[_0xc131('0x3e')]['id'];}return db[_0xc131('0x23')]['find']({'where':{'id':_0x5e3621['params']['id']}})[_0xc131('0x1c')](handleEntityNotFound(_0x191821,null))[_0xc131('0x1c')](saveUpdates(_0x5e3621[_0xc131('0x3e')],null))['then'](respondWithResult(_0x191821,null))[_0xc131('0x3c')](handleError(_0x191821,null));};exports[_0xc131('0x1b')]=function(_0x221b2e,_0xc11a8c){return db['SalesforceConfiguration'][_0xc131('0x3b')]({'where':{'id':_0x221b2e[_0xc131('0x40')]['id']}})[_0xc131('0x1c')](handleEntityNotFound(_0xc11a8c,null))[_0xc131('0x1c')](removeEntity(_0xc11a8c,null))[_0xc131('0x3c')](handleError(_0xc11a8c,null));};exports[_0xc131('0x41')]=function(_0x21b19d,_0x171a7a,_0x3c350c){var _0x2263ed={};var _0x209a56={};var _0x1ab4cf;var _0x4436d9;return db[_0xc131('0x23')][_0xc131('0x42')]({'where':{'id':_0x21b19d[_0xc131('0x40')]['id']}})[_0xc131('0x1c')](handleEntityNotFound(_0x171a7a,null))['then'](function(_0x5595cc){if(_0x5595cc){_0x1ab4cf=_0x5595cc;_0x209a56['model']=_[_0xc131('0x29')](db[_0xc131('0x43')][_0xc131('0x24')]);_0x209a56['query']=_['keys'](_0x21b19d[_0xc131('0x28')]);_0x209a56['filters']=_[_0xc131('0x2b')](_0x209a56['model'],_0x209a56[_0xc131('0x28')]);_0x2263ed[_0xc131('0x2c')]=_[_0xc131('0x2b')](_0x209a56['model'],qs['fields'](_0x21b19d['query'][_0xc131('0x2d')]));_0x2263ed[_0xc131('0x2c')]=_0x2263ed['attributes'][_0xc131('0x2e')]?_0x2263ed[_0xc131('0x2c')]:_0x209a56['model'];_0x2263ed['order']=qs[_0xc131('0x30')](_0x21b19d[_0xc131('0x28')][_0xc131('0x30')]);_0x2263ed[_0xc131('0x33')]=qs[_0xc131('0x2a')](_[_0xc131('0x31')](_0x21b19d[_0xc131('0x28')],_0x209a56[_0xc131('0x2a')]));if(_0x21b19d[_0xc131('0x28')][_0xc131('0x32')]){_0x2263ed['where']=_['merge'](_0x2263ed[_0xc131('0x33')],{'$or':_['map'](_0x2263ed['attributes'],function(_0x1ab9fb){var _0x2c0030={};_0x2c0030[_0x1ab9fb]={'$like':'%'+_0x21b19d[_0xc131('0x28')][_0xc131('0x32')]+'%'};return _0x2c0030;})});}_0x2263ed=_[_0xc131('0x34')]({},_0x2263ed,_0x21b19d[_0xc131('0x36')]);return _0x1ab4cf[_0xc131('0x41')](_0x2263ed);}})[_0xc131('0x1c')](function(_0x5cf707){if(_0x5cf707){_0x4436d9=_0x5cf707[_0xc131('0x2e')];if(!_0x21b19d['query'][_0xc131('0x44')]('nolimit')){_0x2263ed[_0xc131('0x15')]=qs[_0xc131('0x15')](_0x21b19d['query'][_0xc131('0x15')]);_0x2263ed[_0xc131('0x13')]=qs[_0xc131('0x13')](_0x21b19d[_0xc131('0x28')][_0xc131('0x13')]);}return _0x1ab4cf[_0xc131('0x41')](_0x2263ed);}})[_0xc131('0x1c')](function(_0x1c5a1f){if(_0x1c5a1f){return _0x1c5a1f?{'count':_0x4436d9,'rows':_0x1c5a1f}:null;}})[_0xc131('0x1c')](respondWithResult(_0x171a7a,null))[_0xc131('0x3c')](handleError(_0x171a7a,null));};exports[_0xc131('0x45')]=function(_0x35334a,_0x3d9fb2,_0x3f8cc2){var _0x247235={};var _0x493298={};var _0x397c43;var _0x487772;return db[_0xc131('0x23')]['findOne']({'where':{'id':_0x35334a[_0xc131('0x40')]['id']}})[_0xc131('0x1c')](handleEntityNotFound(_0x3d9fb2,null))['then'](function(_0x118acf){if(_0x118acf){_0x397c43=_0x118acf;_0x493298[_0xc131('0x27')]=_[_0xc131('0x29')](db['SalesforceField']['rawAttributes']);_0x493298[_0xc131('0x28')]=_[_0xc131('0x29')](_0x35334a[_0xc131('0x28')]);_0x493298['filters']=_[_0xc131('0x2b')](_0x493298[_0xc131('0x27')],_0x493298['query']);_0x247235[_0xc131('0x2c')]=_[_0xc131('0x2b')](_0x493298['model'],qs[_0xc131('0x2d')](_0x35334a[_0xc131('0x28')][_0xc131('0x2d')]));_0x247235[_0xc131('0x2c')]=_0x247235[_0xc131('0x2c')][_0xc131('0x2e')]?_0x247235['attributes']:_0x493298[_0xc131('0x27')];_0x247235[_0xc131('0x46')]=qs[_0xc131('0x30')](_0x35334a[_0xc131('0x28')][_0xc131('0x30')]);_0x247235[_0xc131('0x33')]=qs[_0xc131('0x2a')](_[_0xc131('0x31')](_0x35334a[_0xc131('0x28')],_0x493298[_0xc131('0x2a')]));if(_0x35334a[_0xc131('0x28')][_0xc131('0x32')]){_0x247235[_0xc131('0x33')]=_[_0xc131('0x34')](_0x247235[_0xc131('0x33')],{'$or':_[_0xc131('0x22')](_0x247235[_0xc131('0x2c')],function(_0x4078f1){var _0x1b2f9e={};_0x1b2f9e[_0x4078f1]={'$like':'%'+_0x35334a[_0xc131('0x28')][_0xc131('0x32')]+'%'};return _0x1b2f9e;})});}_0x247235=_[_0xc131('0x34')]({},_0x247235,_0x35334a[_0xc131('0x36')]);return _0x397c43[_0xc131('0x45')](_0x247235);}})[_0xc131('0x1c')](function(_0x1bf642){if(_0x1bf642){_0x487772=_0x1bf642[_0xc131('0x2e')];if(!_0x35334a[_0xc131('0x28')][_0xc131('0x44')]('nolimit')){_0x247235[_0xc131('0x15')]=qs[_0xc131('0x15')](_0x35334a[_0xc131('0x28')][_0xc131('0x15')]);_0x247235[_0xc131('0x13')]=qs['offset'](_0x35334a[_0xc131('0x28')][_0xc131('0x13')]);}return _0x397c43[_0xc131('0x45')](_0x247235);}})[_0xc131('0x1c')](function(_0x5364ef){if(_0x5364ef){return _0x5364ef?{'count':_0x487772,'rows':_0x5364ef}:null;}})['then'](respondWithResult(_0x3d9fb2,null))[_0xc131('0x3c')](handleError(_0x3d9fb2,null));};exports[_0xc131('0x47')]=function(_0x382cc4,_0x47daca,_0x5abe41){var _0x80c010={};var _0x198b57={};var _0x538c45;var _0xf7cca6;return db[_0xc131('0x23')]['findOne']({'where':{'id':_0x382cc4[_0xc131('0x40')]['id']}})['then'](handleEntityNotFound(_0x47daca,null))[_0xc131('0x1c')](function(_0x54a66b){if(_0x54a66b){_0x538c45=_0x54a66b;_0x198b57[_0xc131('0x27')]=_[_0xc131('0x29')](db[_0xc131('0x43')][_0xc131('0x24')]);_0x198b57['query']=_[_0xc131('0x29')](_0x382cc4[_0xc131('0x28')]);_0x198b57['filters']=_[_0xc131('0x2b')](_0x198b57['model'],_0x198b57[_0xc131('0x28')]);_0x80c010[_0xc131('0x2c')]=_[_0xc131('0x2b')](_0x198b57['model'],qs['fields'](_0x382cc4[_0xc131('0x28')][_0xc131('0x2d')]));_0x80c010['attributes']=_0x80c010[_0xc131('0x2c')][_0xc131('0x2e')]?_0x80c010[_0xc131('0x2c')]:_0x198b57[_0xc131('0x27')];_0x80c010['order']=qs[_0xc131('0x30')](_0x382cc4['query']['sort']);_0x80c010['where']=qs[_0xc131('0x2a')](_[_0xc131('0x31')](_0x382cc4[_0xc131('0x28')],_0x198b57['filters']));if(_0x382cc4[_0xc131('0x28')][_0xc131('0x32')]){_0x80c010[_0xc131('0x33')]=_[_0xc131('0x34')](_0x80c010[_0xc131('0x33')],{'$or':_['map'](_0x80c010[_0xc131('0x2c')],function(_0xb5e008){var _0x408b7a={};_0x408b7a[_0xb5e008]={'$like':'%'+_0x382cc4[_0xc131('0x28')][_0xc131('0x32')]+'%'};return _0x408b7a;})});}_0x80c010=_[_0xc131('0x34')]({},_0x80c010,_0x382cc4[_0xc131('0x36')]);return _0x538c45[_0xc131('0x47')](_0x80c010);}})[_0xc131('0x1c')](function(_0x3cae5f){if(_0x3cae5f){_0xf7cca6=_0x3cae5f[_0xc131('0x2e')];if(!_0x382cc4['query'][_0xc131('0x44')](_0xc131('0x2f'))){_0x80c010[_0xc131('0x15')]=qs['limit'](_0x382cc4['query'][_0xc131('0x15')]);_0x80c010['offset']=qs[_0xc131('0x13')](_0x382cc4['query'][_0xc131('0x13')]);}return _0x538c45[_0xc131('0x47')](_0x80c010);}})[_0xc131('0x1c')](function(_0x1876aa){if(_0x1876aa){return _0x1876aa?{'count':_0xf7cca6,'rows':_0x1876aa}:null;}})[_0xc131('0x1c')](respondWithResult(_0x47daca,null))[_0xc131('0x3c')](handleError(_0x47daca,null));}; \ No newline at end of file +var _0xd2a3=['../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','length','include','find','create','body','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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'];(function(_0x326fa4,_0x1b54a9){var _0x5c9497=function(_0x391f92){while(--_0x391f92){_0x326fa4['push'](_0x326fa4['shift']());}};_0x5c9497(++_0x1b54a9);}(_0xd2a3,0x12d));var _0x3d2a=function(_0x446a14,_0x157ad7){_0x446a14=_0x446a14-0x0;var _0x9ba763=_0xd2a3[_0x446a14];return _0x9ba763;};'use strict';var emlformat=require(_0x3d2a('0x0'));var rimraf=require(_0x3d2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d2a('0x2'));var rp=require(_0x3d2a('0x3'));var moment=require(_0x3d2a('0x4'));var BPromise=require(_0x3d2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d2a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d2a('0x7'));var fs=require('fs');var fs_extra=require(_0x3d2a('0x8'));var _=require(_0x3d2a('0x9'));var squel=require(_0x3d2a('0xa'));var crypto=require(_0x3d2a('0xb'));var jsforce=require(_0x3d2a('0xc'));var deskjs=require(_0x3d2a('0xd'));var toCsv=require(_0x3d2a('0xe'));var querystring=require(_0x3d2a('0xf'));var Papa=require(_0x3d2a('0x10'));var Redis=require(_0x3d2a('0x11'));var authService=require(_0x3d2a('0x12'));var qs=require(_0x3d2a('0x13'));var as=require(_0x3d2a('0x14'));var hardwareService=require(_0x3d2a('0x15'));var logger=require(_0x3d2a('0x16'))(_0x3d2a('0x17'));var utils=require(_0x3d2a('0x18'));var config=require(_0x3d2a('0x19'));var licenseUtil=require(_0x3d2a('0x1a'));var db=require(_0x3d2a('0x1b'))['db'];function respondWithStatusCode(_0x1953a4,_0x5b05f1){_0x5b05f1=_0x5b05f1||0xcc;return function(_0x85505a){if(_0x85505a){return _0x1953a4[_0x3d2a('0x1c')](_0x5b05f1);}return _0x1953a4[_0x3d2a('0x1d')](_0x5b05f1)[_0x3d2a('0x1e')]();};}function respondWithResult(_0x3fac2c,_0x1b87fd){_0x1b87fd=_0x1b87fd||0xc8;return function(_0x48031e){if(_0x48031e){return _0x3fac2c[_0x3d2a('0x1d')](_0x1b87fd)['json'](_0x48031e);}};}function respondWithFilteredResult(_0x1fc71c,_0x5430d0){return function(_0x532333){if(_0x532333){var _0x1465c6=typeof _0x5430d0[_0x3d2a('0x1f')]==='undefined'&&typeof _0x5430d0[_0x3d2a('0x20')]==='undefined';var _0x41598c=_0x532333[_0x3d2a('0x21')];var _0x1379e1=_0x1465c6?0x0:_0x5430d0['offset'];var _0x2b1f01=_0x1465c6?_0x532333[_0x3d2a('0x21')]:_0x5430d0[_0x3d2a('0x1f')]+_0x5430d0[_0x3d2a('0x20')];var _0x7cfaa2;if(_0x2b1f01>=_0x41598c){_0x2b1f01=_0x41598c;_0x7cfaa2=0xc8;}else{_0x7cfaa2=0xce;}_0x1fc71c['status'](_0x7cfaa2);return _0x1fc71c['set'](_0x3d2a('0x22'),_0x1379e1+'-'+_0x2b1f01+'/'+_0x41598c)[_0x3d2a('0x23')](_0x532333);}return null;};}function patchUpdates(_0x20895a){return function(_0x584c8a){try{jsonpatch['apply'](_0x584c8a,_0x20895a,!![]);}catch(_0x517185){return BPromise[_0x3d2a('0x24')](_0x517185);}return _0x584c8a[_0x3d2a('0x25')]();};}function saveUpdates(_0x4e9af9,_0x5e3b67){return function(_0xd4b41b){if(_0xd4b41b){return _0xd4b41b[_0x3d2a('0x26')](_0x4e9af9)[_0x3d2a('0x27')](function(_0x59684c){return _0x59684c;});}return null;};}function removeEntity(_0xaf9019,_0x26ac90){return function(_0x118710){if(_0x118710){return _0x118710[_0x3d2a('0x28')]()['then'](function(){_0xaf9019[_0x3d2a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277ee8,_0xd765a){return function(_0x191c05){if(!_0x191c05){_0x277ee8['sendStatus'](0x194);}return _0x191c05;};}function handleError(_0x5ca314,_0x1195be){_0x1195be=_0x1195be||0x1f4;return function(_0x19139d){logger[_0x3d2a('0x29')](_0x19139d['stack']);if(_0x19139d['name']){delete _0x19139d[_0x3d2a('0x2a')];}_0x5ca314[_0x3d2a('0x1d')](_0x1195be)[_0x3d2a('0x2b')](_0x19139d);};}exports[_0x3d2a('0x2c')]=function(_0x10477a,_0x1e4057){var _0x303d18={},_0x34da23={},_0x209d59={'count':0x0,'rows':[]};var _0x1ea8f1=_[_0x3d2a('0x2d')](db[_0x3d2a('0x2e')][_0x3d2a('0x2f')],function(_0x325eac){return{'name':_0x325eac[_0x3d2a('0x30')],'type':_0x325eac[_0x3d2a('0x31')]['key']};});_0x34da23['model']=_[_0x3d2a('0x2d')](_0x1ea8f1,'name');_0x34da23['query']=_[_0x3d2a('0x32')](_0x10477a[_0x3d2a('0x33')]);_0x34da23[_0x3d2a('0x34')]=_['intersection'](_0x34da23['model'],_0x34da23[_0x3d2a('0x33')]);_0x303d18[_0x3d2a('0x35')]=_[_0x3d2a('0x36')](_0x34da23[_0x3d2a('0x37')],qs[_0x3d2a('0x38')](_0x10477a[_0x3d2a('0x33')]['fields']));_0x303d18['attributes']=_0x303d18[_0x3d2a('0x35')]['length']?_0x303d18['attributes']:_0x34da23[_0x3d2a('0x37')];if(!_0x10477a[_0x3d2a('0x33')][_0x3d2a('0x39')](_0x3d2a('0x3a'))){_0x303d18['limit']=qs[_0x3d2a('0x20')](_0x10477a[_0x3d2a('0x33')][_0x3d2a('0x20')]);_0x303d18[_0x3d2a('0x1f')]=qs[_0x3d2a('0x1f')](_0x10477a['query'][_0x3d2a('0x1f')]);}_0x303d18['order']=qs[_0x3d2a('0x3b')](_0x10477a['query'][_0x3d2a('0x3b')]);_0x303d18[_0x3d2a('0x3c')]=qs[_0x3d2a('0x34')](_[_0x3d2a('0x3d')](_0x10477a[_0x3d2a('0x33')],_0x34da23['filters']),_0x1ea8f1);if(_0x10477a[_0x3d2a('0x33')][_0x3d2a('0x3e')]){_0x303d18[_0x3d2a('0x3c')]=_['merge'](_0x303d18[_0x3d2a('0x3c')],{'$or':_[_0x3d2a('0x2d')](_0x1ea8f1,function(_0x5876a6){if(_0x5876a6[_0x3d2a('0x31')]!==_0x3d2a('0x3f')){var _0x2096cd={};_0x2096cd[_0x5876a6[_0x3d2a('0x2a')]]={'$like':'%'+_0x10477a['query'][_0x3d2a('0x3e')]+'%'};return _0x2096cd;}})});}_0x303d18=_[_0x3d2a('0x40')]({},_0x303d18,_0x10477a[_0x3d2a('0x41')]);var _0x4592ab={'where':_0x303d18['where']};return db[_0x3d2a('0x2e')][_0x3d2a('0x21')](_0x4592ab)['then'](function(_0x3a3b39){_0x209d59[_0x3d2a('0x21')]=_0x3a3b39;if(_0x10477a[_0x3d2a('0x33')][_0x3d2a('0x42')]){_0x303d18['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x3d2a('0x43')](_0x303d18);})[_0x3d2a('0x27')](function(_0x3055c7){_0x209d59[_0x3d2a('0x44')]=_0x3055c7;return _0x209d59;})[_0x3d2a('0x27')](respondWithFilteredResult(_0x1e4057,_0x303d18))[_0x3d2a('0x45')](handleError(_0x1e4057,null));};exports['show']=function(_0x2220d3,_0xea3f9){var _0x4c59c9={'raw':![],'where':{'id':_0x2220d3['params']['id']}},_0xccdd8a={};_0xccdd8a['model']=_[_0x3d2a('0x32')](db[_0x3d2a('0x2e')][_0x3d2a('0x2f')]);_0xccdd8a[_0x3d2a('0x33')]=_[_0x3d2a('0x32')](_0x2220d3[_0x3d2a('0x33')]);_0xccdd8a['filters']=_[_0x3d2a('0x36')](_0xccdd8a[_0x3d2a('0x37')],_0xccdd8a[_0x3d2a('0x33')]);_0x4c59c9[_0x3d2a('0x35')]=_['intersection'](_0xccdd8a[_0x3d2a('0x37')],qs[_0x3d2a('0x38')](_0x2220d3[_0x3d2a('0x33')][_0x3d2a('0x38')]));_0x4c59c9[_0x3d2a('0x35')]=_0x4c59c9[_0x3d2a('0x35')][_0x3d2a('0x46')]?_0x4c59c9[_0x3d2a('0x35')]:_0xccdd8a[_0x3d2a('0x37')];if(_0x2220d3[_0x3d2a('0x33')][_0x3d2a('0x42')]){_0x4c59c9[_0x3d2a('0x47')]=[{'all':!![]}];}_0x4c59c9=_[_0x3d2a('0x40')]({},_0x4c59c9,_0x2220d3['options']);return db[_0x3d2a('0x2e')][_0x3d2a('0x48')](_0x4c59c9)[_0x3d2a('0x27')](handleEntityNotFound(_0xea3f9,null))[_0x3d2a('0x27')](respondWithResult(_0xea3f9,null))[_0x3d2a('0x45')](handleError(_0xea3f9,null));};exports[_0x3d2a('0x49')]=function(_0x4ba865,_0x2ea61b){return db[_0x3d2a('0x2e')]['create'](_0x4ba865[_0x3d2a('0x4a')],{})[_0x3d2a('0x27')](respondWithResult(_0x2ea61b,0xc9))['catch'](handleError(_0x2ea61b,null));};exports[_0x3d2a('0x26')]=function(_0x57c2a7,_0x2e91ea){if(_0x57c2a7[_0x3d2a('0x4a')]['id']){delete _0x57c2a7[_0x3d2a('0x4a')]['id'];}return db[_0x3d2a('0x2e')][_0x3d2a('0x48')]({'where':{'id':_0x57c2a7[_0x3d2a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e91ea,null))[_0x3d2a('0x27')](saveUpdates(_0x57c2a7['body'],null))[_0x3d2a('0x27')](respondWithResult(_0x2e91ea,null))['catch'](handleError(_0x2e91ea,null));};exports[_0x3d2a('0x28')]=function(_0x147540,_0x27bb63){return db[_0x3d2a('0x2e')][_0x3d2a('0x48')]({'where':{'id':_0x147540[_0x3d2a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27bb63,null))[_0x3d2a('0x27')](removeEntity(_0x27bb63,null))[_0x3d2a('0x45')](handleError(_0x27bb63,null));};exports[_0x3d2a('0x4c')]=function(_0x211f3b,_0x23a7d8,_0x14e42d){var _0x577ea3={};var _0x34a43c={};var _0x25ae8e;var _0x2cd5f5;return db['SalesforceConfiguration'][_0x3d2a('0x4d')]({'where':{'id':_0x211f3b[_0x3d2a('0x4b')]['id']}})[_0x3d2a('0x27')](handleEntityNotFound(_0x23a7d8,null))[_0x3d2a('0x27')](function(_0x3dec83){if(_0x3dec83){_0x25ae8e=_0x3dec83;_0x34a43c[_0x3d2a('0x37')]=_[_0x3d2a('0x32')](db[_0x3d2a('0x4e')][_0x3d2a('0x2f')]);_0x34a43c[_0x3d2a('0x33')]=_['keys'](_0x211f3b[_0x3d2a('0x33')]);_0x34a43c['filters']=_['intersection'](_0x34a43c[_0x3d2a('0x37')],_0x34a43c[_0x3d2a('0x33')]);_0x577ea3['attributes']=_[_0x3d2a('0x36')](_0x34a43c[_0x3d2a('0x37')],qs['fields'](_0x211f3b[_0x3d2a('0x33')][_0x3d2a('0x38')]));_0x577ea3[_0x3d2a('0x35')]=_0x577ea3[_0x3d2a('0x35')]['length']?_0x577ea3['attributes']:_0x34a43c[_0x3d2a('0x37')];_0x577ea3[_0x3d2a('0x4f')]=qs[_0x3d2a('0x3b')](_0x211f3b['query'][_0x3d2a('0x3b')]);_0x577ea3[_0x3d2a('0x3c')]=qs[_0x3d2a('0x34')](_[_0x3d2a('0x3d')](_0x211f3b[_0x3d2a('0x33')],_0x34a43c[_0x3d2a('0x34')]));if(_0x211f3b[_0x3d2a('0x33')]['filter']){_0x577ea3[_0x3d2a('0x3c')]=_['merge'](_0x577ea3[_0x3d2a('0x3c')],{'$or':_['map'](_0x577ea3['attributes'],function(_0x2fc4c0){var _0x2dae81={};_0x2dae81[_0x2fc4c0]={'$like':'%'+_0x211f3b[_0x3d2a('0x33')][_0x3d2a('0x3e')]+'%'};return _0x2dae81;})});}_0x577ea3=_[_0x3d2a('0x40')]({},_0x577ea3,_0x211f3b[_0x3d2a('0x41')]);return _0x25ae8e[_0x3d2a('0x4c')](_0x577ea3);}})[_0x3d2a('0x27')](function(_0x2f3371){if(_0x2f3371){_0x2cd5f5=_0x2f3371[_0x3d2a('0x46')];if(!_0x211f3b['query'][_0x3d2a('0x39')](_0x3d2a('0x3a'))){_0x577ea3[_0x3d2a('0x20')]=qs[_0x3d2a('0x20')](_0x211f3b['query'][_0x3d2a('0x20')]);_0x577ea3[_0x3d2a('0x1f')]=qs[_0x3d2a('0x1f')](_0x211f3b['query'][_0x3d2a('0x1f')]);}return _0x25ae8e['getFields'](_0x577ea3);}})[_0x3d2a('0x27')](function(_0x290972){if(_0x290972){return _0x290972?{'count':_0x2cd5f5,'rows':_0x290972}:null;}})[_0x3d2a('0x27')](respondWithResult(_0x23a7d8,null))[_0x3d2a('0x45')](handleError(_0x23a7d8,null));};exports[_0x3d2a('0x50')]=function(_0x4985c4,_0x466b56,_0x1d8e37){var _0x4a3c2e={};var _0x5baa3a={};var _0x2793cf;var _0x5cb34c;return db['SalesforceConfiguration'][_0x3d2a('0x4d')]({'where':{'id':_0x4985c4[_0x3d2a('0x4b')]['id']}})[_0x3d2a('0x27')](handleEntityNotFound(_0x466b56,null))['then'](function(_0x29a1a6){if(_0x29a1a6){_0x2793cf=_0x29a1a6;_0x5baa3a[_0x3d2a('0x37')]=_[_0x3d2a('0x32')](db[_0x3d2a('0x4e')][_0x3d2a('0x2f')]);_0x5baa3a[_0x3d2a('0x33')]=_[_0x3d2a('0x32')](_0x4985c4[_0x3d2a('0x33')]);_0x5baa3a[_0x3d2a('0x34')]=_[_0x3d2a('0x36')](_0x5baa3a['model'],_0x5baa3a['query']);_0x4a3c2e[_0x3d2a('0x35')]=_['intersection'](_0x5baa3a[_0x3d2a('0x37')],qs[_0x3d2a('0x38')](_0x4985c4[_0x3d2a('0x33')][_0x3d2a('0x38')]));_0x4a3c2e[_0x3d2a('0x35')]=_0x4a3c2e[_0x3d2a('0x35')][_0x3d2a('0x46')]?_0x4a3c2e[_0x3d2a('0x35')]:_0x5baa3a[_0x3d2a('0x37')];_0x4a3c2e[_0x3d2a('0x4f')]=qs[_0x3d2a('0x3b')](_0x4985c4['query']['sort']);_0x4a3c2e['where']=qs['filters'](_[_0x3d2a('0x3d')](_0x4985c4[_0x3d2a('0x33')],_0x5baa3a[_0x3d2a('0x34')]));if(_0x4985c4['query'][_0x3d2a('0x3e')]){_0x4a3c2e['where']=_[_0x3d2a('0x40')](_0x4a3c2e[_0x3d2a('0x3c')],{'$or':_[_0x3d2a('0x2d')](_0x4a3c2e[_0x3d2a('0x35')],function(_0xbae968){var _0x1f1148={};_0x1f1148[_0xbae968]={'$like':'%'+_0x4985c4['query'][_0x3d2a('0x3e')]+'%'};return _0x1f1148;})});}_0x4a3c2e=_[_0x3d2a('0x40')]({},_0x4a3c2e,_0x4985c4[_0x3d2a('0x41')]);return _0x2793cf[_0x3d2a('0x50')](_0x4a3c2e);}})['then'](function(_0x24547f){if(_0x24547f){_0x5cb34c=_0x24547f[_0x3d2a('0x46')];if(!_0x4985c4[_0x3d2a('0x33')][_0x3d2a('0x39')](_0x3d2a('0x3a'))){_0x4a3c2e[_0x3d2a('0x20')]=qs['limit'](_0x4985c4['query']['limit']);_0x4a3c2e[_0x3d2a('0x1f')]=qs['offset'](_0x4985c4[_0x3d2a('0x33')][_0x3d2a('0x1f')]);}return _0x2793cf['getSubjects'](_0x4a3c2e);}})['then'](function(_0x31cca7){if(_0x31cca7){return _0x31cca7?{'count':_0x5cb34c,'rows':_0x31cca7}:null;}})[_0x3d2a('0x27')](respondWithResult(_0x466b56,null))[_0x3d2a('0x45')](handleError(_0x466b56,null));};exports[_0x3d2a('0x51')]=function(_0x31e7c7,_0x10da8d,_0x26dd6d){var _0x390b35={};var _0x1a679d={};var _0x2bc93d;var _0x1b6185;return db[_0x3d2a('0x2e')][_0x3d2a('0x4d')]({'where':{'id':_0x31e7c7[_0x3d2a('0x4b')]['id']}})[_0x3d2a('0x27')](handleEntityNotFound(_0x10da8d,null))['then'](function(_0x958c13){if(_0x958c13){_0x2bc93d=_0x958c13;_0x1a679d['model']=_[_0x3d2a('0x32')](db[_0x3d2a('0x4e')]['rawAttributes']);_0x1a679d[_0x3d2a('0x33')]=_[_0x3d2a('0x32')](_0x31e7c7[_0x3d2a('0x33')]);_0x1a679d[_0x3d2a('0x34')]=_[_0x3d2a('0x36')](_0x1a679d[_0x3d2a('0x37')],_0x1a679d['query']);_0x390b35['attributes']=_[_0x3d2a('0x36')](_0x1a679d['model'],qs[_0x3d2a('0x38')](_0x31e7c7[_0x3d2a('0x33')][_0x3d2a('0x38')]));_0x390b35[_0x3d2a('0x35')]=_0x390b35[_0x3d2a('0x35')][_0x3d2a('0x46')]?_0x390b35[_0x3d2a('0x35')]:_0x1a679d[_0x3d2a('0x37')];_0x390b35[_0x3d2a('0x4f')]=qs[_0x3d2a('0x3b')](_0x31e7c7[_0x3d2a('0x33')][_0x3d2a('0x3b')]);_0x390b35['where']=qs[_0x3d2a('0x34')](_[_0x3d2a('0x3d')](_0x31e7c7['query'],_0x1a679d[_0x3d2a('0x34')]));if(_0x31e7c7['query']['filter']){_0x390b35['where']=_['merge'](_0x390b35[_0x3d2a('0x3c')],{'$or':_[_0x3d2a('0x2d')](_0x390b35[_0x3d2a('0x35')],function(_0x3e8207){var _0x588330={};_0x588330[_0x3e8207]={'$like':'%'+_0x31e7c7[_0x3d2a('0x33')][_0x3d2a('0x3e')]+'%'};return _0x588330;})});}_0x390b35=_[_0x3d2a('0x40')]({},_0x390b35,_0x31e7c7['options']);return _0x2bc93d[_0x3d2a('0x51')](_0x390b35);}})['then'](function(_0x1bf633){if(_0x1bf633){_0x1b6185=_0x1bf633[_0x3d2a('0x46')];if(!_0x31e7c7[_0x3d2a('0x33')][_0x3d2a('0x39')](_0x3d2a('0x3a'))){_0x390b35[_0x3d2a('0x20')]=qs[_0x3d2a('0x20')](_0x31e7c7[_0x3d2a('0x33')]['limit']);_0x390b35[_0x3d2a('0x1f')]=qs['offset'](_0x31e7c7[_0x3d2a('0x33')][_0x3d2a('0x1f')]);}return _0x2bc93d['getDescriptions'](_0x390b35);}})[_0x3d2a('0x27')](function(_0x3dc903){if(_0x3dc903){return _0x3dc903?{'count':_0x1b6185,'rows':_0x3dc903}:null;}})['then'](respondWithResult(_0x10da8d,null))[_0x3d2a('0x45')](handleError(_0x10da8d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 659ed45..caf90ab 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 _0xb9a4=['define','SalesforceConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x5eba8a,_0xf09d80){var _0x44b210=function(_0x4b0ab2){while(--_0x4b0ab2){_0x5eba8a['push'](_0x5eba8a['shift']());}};_0x44b210(++_0xf09d80);}(_0xb9a4,0xe6));var _0x4b9a=function(_0x34f865,_0x1a8e39){_0x34f865=_0x34f865-0x0;var _0x4150bf=_0xb9a4[_0x34f865];return _0x4150bf;};'use strict';var _=require(_0x4b9a('0x0'));var util=require(_0x4b9a('0x1'));var logger=require(_0x4b9a('0x2'))('api');var moment=require(_0x4b9a('0x3'));var BPromise=require(_0x4b9a('0x4'));var rp=require(_0x4b9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b9a('0x6'));var config=require(_0x4b9a('0x7'));var attributes=require(_0x4b9a('0x8'));module[_0x4b9a('0x9')]=function(_0x40a4f0,_0x1b35e6){return _0x40a4f0[_0x4b9a('0xa')](_0x4b9a('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc7c=['rimraf','exports','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1213e5,_0x281e61){var _0x59a452=function(_0x32781f){while(--_0x32781f){_0x1213e5['push'](_0x1213e5['shift']());}};_0x59a452(++_0x281e61);}(_0xfc7c,0x189));var _0xcfc7=function(_0x134af3,_0x40556c){_0x134af3=_0x134af3-0x0;var _0x19490f=_0xfc7c[_0x134af3];return _0x19490f;};'use strict';var _=require(_0xcfc7('0x0'));var util=require(_0xcfc7('0x1'));var logger=require(_0xcfc7('0x2'))(_0xcfc7('0x3'));var moment=require(_0xcfc7('0x4'));var BPromise=require('bluebird');var rp=require(_0xcfc7('0x5'));var fs=require('fs');var path=require(_0xcfc7('0x6'));var rimraf=require(_0xcfc7('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xcfc7('0x8')]=function(_0x4c945a,_0x4b6981){return _0x4c945a['define'](_0xcfc7('0x9'),attributes,{'tableName':'int_salesforce_configurations','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 ad8535b..13d1ebf 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 _0x1b86=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x4b77f4,_0x201ba6){var _0x48cd53=function(_0xe8c7b7){while(--_0xe8c7b7){_0x4b77f4['push'](_0x4b77f4['shift']());}};_0x48cd53(++_0x201ba6);}(_0x1b86,0xe1));var _0x61b8=function(_0x3583f5,_0x1778a9){_0x3583f5=_0x3583f5-0x0;var _0x2e1846=_0x1b86[_0x3583f5];return _0x2e1846;};'use strict';var _=require('lodash');var util=require(_0x61b8('0x0'));var moment=require(_0x61b8('0x1'));var BPromise=require('bluebird');var rs=require(_0x61b8('0x2'));var fs=require('fs');var Redis=require(_0x61b8('0x3'));var db=require(_0x61b8('0x4'))['db'];var utils=require(_0x61b8('0x5'));var logger=require(_0x61b8('0x6'))(_0x61b8('0x7'));var config=require(_0x61b8('0x8'));var jayson=require(_0x61b8('0x9'));var client=jayson[_0x61b8('0xa')][_0x61b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30ee9c,_0x3b2e24,_0xb28d2a){return new BPromise(function(_0x115e80,_0x3bf9a3){return client[_0x61b8('0xc')](_0x30ee9c,_0xb28d2a)[_0x61b8('0xd')](function(_0x1ae215){logger['info'](_0x61b8('0xe'),_0x3b2e24,_0x61b8('0xf'));logger[_0x61b8('0x10')](_0x61b8('0x11'),_0x3b2e24,_0x61b8('0xf'),JSON[_0x61b8('0x12')](_0x1ae215));if(_0x1ae215[_0x61b8('0x13')]){if(_0x1ae215[_0x61b8('0x13')][_0x61b8('0x14')]===0x1f4){logger['error'](_0x61b8('0xe'),_0x3b2e24,_0x1ae215[_0x61b8('0x13')]['message']);return _0x3bf9a3(_0x1ae215[_0x61b8('0x13')][_0x61b8('0x15')]);}logger[_0x61b8('0x13')](_0x61b8('0xe'),_0x3b2e24,_0x1ae215[_0x61b8('0x13')]['message']);return _0x115e80(_0x1ae215['error']['message']);}else{logger[_0x61b8('0x16')](_0x61b8('0xe'),_0x3b2e24,_0x61b8('0xf'));_0x115e80(_0x1ae215[_0x61b8('0x17')][_0x61b8('0x15')]);}})[_0x61b8('0x18')](function(_0x1591fe){logger[_0x61b8('0x13')](_0x61b8('0xe'),_0x3b2e24,_0x1591fe);_0x3bf9a3(_0x1591fe);});});} \ No newline at end of file +var _0x6ffa=['jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x53b3ad,_0x808e35){var _0x27e44f=function(_0x3eace7){while(--_0x3eace7){_0x53b3ad['push'](_0x53b3ad['shift']());}};_0x27e44f(++_0x808e35);}(_0x6ffa,0x80));var _0xa6ff=function(_0x8abb0e,_0x52c276){_0x8abb0e=_0x8abb0e-0x0;var _0x1eb677=_0x6ffa[_0x8abb0e];return _0x1eb677;};'use strict';var _=require('lodash');var util=require(_0xa6ff('0x0'));var moment=require(_0xa6ff('0x1'));var BPromise=require(_0xa6ff('0x2'));var rs=require(_0xa6ff('0x3'));var fs=require('fs');var Redis=require(_0xa6ff('0x4'));var db=require(_0xa6ff('0x5'))['db'];var utils=require(_0xa6ff('0x6'));var logger=require(_0xa6ff('0x7'))(_0xa6ff('0x8'));var config=require(_0xa6ff('0x9'));var jayson=require(_0xa6ff('0xa'));var client=jayson[_0xa6ff('0xb')][_0xa6ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b88cc,_0x6ab513,_0x45e3b0){return new BPromise(function(_0x191574,_0x2db57f){return client[_0xa6ff('0xd')](_0x5b88cc,_0x45e3b0)['then'](function(_0x5d76e2){logger['info'](_0xa6ff('0xe'),_0x6ab513,_0xa6ff('0xf'));logger[_0xa6ff('0x10')](_0xa6ff('0x11'),_0x6ab513,_0xa6ff('0xf'),JSON['stringify'](_0x5d76e2));if(_0x5d76e2[_0xa6ff('0x12')]){if(_0x5d76e2['error'][_0xa6ff('0x13')]===0x1f4){logger[_0xa6ff('0x12')](_0xa6ff('0xe'),_0x6ab513,_0x5d76e2['error']['message']);return _0x2db57f(_0x5d76e2['error'][_0xa6ff('0x14')]);}logger[_0xa6ff('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x6ab513,_0x5d76e2['error'][_0xa6ff('0x14')]);return _0x191574(_0x5d76e2[_0xa6ff('0x12')][_0xa6ff('0x14')]);}else{logger[_0xa6ff('0x15')](_0xa6ff('0xe'),_0x6ab513,'request\x20sent');_0x191574(_0x5d76e2['result'][_0xa6ff('0x14')]);}})[_0xa6ff('0x16')](function(_0x38b1d7){logger[_0xa6ff('0x12')](_0xa6ff('0xe'),_0x6ab513,_0x38b1d7);_0x2db57f(_0x38b1d7);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index c4cd0c9..8df461e 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 _0x71cb=['isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x19046c,_0x2494b5){var _0x469c79=function(_0x59cd03){while(--_0x59cd03){_0x19046c['push'](_0x19046c['shift']());}};_0x469c79(++_0x2494b5);}(_0x71cb,0x7e));var _0xb71c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x71cb[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0xb71c('0x0'));var util=require(_0xb71c('0x1'));var path=require(_0xb71c('0x2'));var timeout=require(_0xb71c('0x3'));var express=require(_0xb71c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb71c('0x5'));var config=require(_0xb71c('0x6'));var controller=require('./intSalesforceField.controller');router[_0xb71c('0x7')]('/',auth['isAuthenticated'](),controller[_0xb71c('0x8')]);router[_0xb71c('0x7')](_0xb71c('0x9'),auth[_0xb71c('0xa')](),controller['show']);router[_0xb71c('0xb')]('/',auth[_0xb71c('0xa')](),controller['create']);router[_0xb71c('0xc')](_0xb71c('0x9'),auth[_0xb71c('0xa')](),controller[_0xb71c('0xd')]);router[_0xb71c('0xe')](_0xb71c('0x9'),auth[_0xb71c('0xa')](),controller[_0xb71c('0xf')]);module[_0xb71c('0x10')]=router; \ No newline at end of file +var _0x81cb=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81cb,0x8d));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb81c('0x0'));var util=require('util');var path=require(_0xb81c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb81c('0x2'));var router=express[_0xb81c('0x3')]();var fs_extra=require(_0xb81c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb81c('0x5'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0xb81c('0x6')]('/',auth[_0xb81c('0x7')](),controller[_0xb81c('0x8')]);router[_0xb81c('0x6')](_0xb81c('0x9'),auth[_0xb81c('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb81c('0xa')]);router[_0xb81c('0xb')](_0xb81c('0x9'),auth[_0xb81c('0x7')](),controller[_0xb81c('0xc')]);router[_0xb81c('0xd')](_0xb81c('0x9'),auth[_0xb81c('0x7')](),controller[_0xb81c('0xe')]);module[_0xb81c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 47b4cfd..8b66535 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 _0x2a70=['variable','keyValue','STRING','string','sequelize','exports','ENUM'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x2a70,0xd6));var _0x02a7=function(_0x306bea,_0x50fd02){_0x306bea=_0x306bea-0x0;var _0x570538=_0x2a70[_0x306bea];return _0x570538;};'use strict';var Sequelize=require(_0x02a7('0x0'));module[_0x02a7('0x1')]={'type':{'type':Sequelize[_0x02a7('0x2')]('string',_0x02a7('0x3'),'customVariable',_0x02a7('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x02a7('0x5')]},'key':{'type':Sequelize[_0x02a7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x02a7('0x6'),_0x02a7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x02a7('0x5')]},'idField':{'type':Sequelize[_0x02a7('0x5')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef05=['picklist','STRING','ENUM','string','variable','customVariable','keyValue'];(function(_0x27d228,_0xbee8e8){var _0x24f17a=function(_0x1fd312){while(--_0x1fd312){_0x27d228['push'](_0x27d228['shift']());}};_0x24f17a(++_0xbee8e8);}(_0xef05,0xb1));var _0x5ef0=function(_0x40e5b5,_0x49976a){_0x40e5b5=_0x40e5b5-0x0;var _0xa22ae3=_0xef05[_0x40e5b5];return _0xa22ae3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5ef0('0x0')](_0x5ef0('0x1'),_0x5ef0('0x2'),_0x5ef0('0x3'),_0x5ef0('0x4'),_0x5ef0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5ef0('0x6')]},'keyType':{'type':Sequelize[_0x5ef0('0x0')](_0x5ef0('0x1'),_0x5ef0('0x2'),_0x5ef0('0x3'))},'keyContent':{'type':Sequelize[_0x5ef0('0x6')]},'idField':{'type':Sequelize[_0x5ef0('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ff71010..9083831 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 _0x1202=['limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1202,0xb8));var _0x2120=function(_0x245cab,_0x189536){_0x245cab=_0x245cab-0x0;var _0x2f19cb=_0x1202[_0x245cab];return _0x2f19cb;};'use strict';var emlformat=require(_0x2120('0x0'));var rimraf=require(_0x2120('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2120('0x2'));var rp=require(_0x2120('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2120('0x4'));var util=require(_0x2120('0x5'));var path=require(_0x2120('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2120('0x7'));var fs=require('fs');var fs_extra=require(_0x2120('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2120('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2120('0xa'));var Papa=require('papaparse');var Redis=require(_0x2120('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2120('0xc'));var logger=require(_0x2120('0xd'))(_0x2120('0xe'));var utils=require(_0x2120('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x2120('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ab46,_0x2bb4bb){_0x2bb4bb=_0x2bb4bb||0xcc;return function(_0x20ae22){if(_0x20ae22){return _0x42ab46[_0x2120('0x11')](_0x2bb4bb);}return _0x42ab46[_0x2120('0x12')](_0x2bb4bb)['end']();};}function respondWithResult(_0x14e8a3,_0x6fddf1){_0x6fddf1=_0x6fddf1||0xc8;return function(_0xce2c64){if(_0xce2c64){return _0x14e8a3[_0x2120('0x12')](_0x6fddf1)[_0x2120('0x13')](_0xce2c64);}};}function respondWithFilteredResult(_0x7d1c56,_0x49eaf6){return function(_0x1c1d85){if(_0x1c1d85){var _0x3e7b1e=typeof _0x49eaf6['offset']===_0x2120('0x14')&&typeof _0x49eaf6['limit']==='undefined';var _0x5b7edd=_0x1c1d85[_0x2120('0x15')];var _0x1aaafa=_0x3e7b1e?0x0:_0x49eaf6[_0x2120('0x16')];var _0x36c705=_0x3e7b1e?_0x1c1d85[_0x2120('0x15')]:_0x49eaf6[_0x2120('0x16')]+_0x49eaf6[_0x2120('0x17')];var _0x44539c;if(_0x36c705>=_0x5b7edd){_0x36c705=_0x5b7edd;_0x44539c=0xc8;}else{_0x44539c=0xce;}_0x7d1c56[_0x2120('0x12')](_0x44539c);return _0x7d1c56[_0x2120('0x18')](_0x2120('0x19'),_0x1aaafa+'-'+_0x36c705+'/'+_0x5b7edd)[_0x2120('0x13')](_0x1c1d85);}return null;};}function patchUpdates(_0x15414a){return function(_0x3551a6){try{jsonpatch[_0x2120('0x1a')](_0x3551a6,_0x15414a,!![]);}catch(_0x56b963){return BPromise[_0x2120('0x1b')](_0x56b963);}return _0x3551a6['save']();};}function saveUpdates(_0x61759a,_0x14c075){return function(_0x1b4c31){if(_0x1b4c31){return _0x1b4c31[_0x2120('0x1c')](_0x61759a)['then'](function(_0x644f82){return _0x644f82;});}return null;};}function removeEntity(_0x1e01eb,_0x3a1dbc){return function(_0x1e3d65){if(_0x1e3d65){return _0x1e3d65[_0x2120('0x1d')]()[_0x2120('0x1e')](function(){_0x1e01eb['status'](0xcc)[_0x2120('0x1f')]();});}};}function handleEntityNotFound(_0xd5eba5,_0x13fdfa){return function(_0x213169){if(!_0x213169){_0xd5eba5['sendStatus'](0x194);}return _0x213169;};}function handleError(_0x1456e3,_0x652a7){_0x652a7=_0x652a7||0x1f4;return function(_0x24a3bc){logger[_0x2120('0x20')](_0x24a3bc[_0x2120('0x21')]);if(_0x24a3bc[_0x2120('0x22')]){delete _0x24a3bc[_0x2120('0x22')];}_0x1456e3[_0x2120('0x12')](_0x652a7)[_0x2120('0x23')](_0x24a3bc);};}exports['index']=function(_0x5dac3e,_0x2903a5){var _0x16fd14={},_0x385428={},_0x179d35={'count':0x0,'rows':[]};var _0x4eed72=_[_0x2120('0x24')](db[_0x2120('0x25')][_0x2120('0x26')],function(_0x49907d){return{'name':_0x49907d[_0x2120('0x27')],'type':_0x49907d['type'][_0x2120('0x28')]};});_0x385428['model']=_[_0x2120('0x24')](_0x4eed72,'name');_0x385428[_0x2120('0x29')]=_[_0x2120('0x2a')](_0x5dac3e[_0x2120('0x29')]);_0x385428[_0x2120('0x2b')]=_[_0x2120('0x2c')](_0x385428[_0x2120('0x2d')],_0x385428['query']);_0x16fd14[_0x2120('0x2e')]=_[_0x2120('0x2c')](_0x385428[_0x2120('0x2d')],qs[_0x2120('0x2f')](_0x5dac3e['query'][_0x2120('0x2f')]));_0x16fd14[_0x2120('0x2e')]=_0x16fd14[_0x2120('0x2e')][_0x2120('0x30')]?_0x16fd14[_0x2120('0x2e')]:_0x385428[_0x2120('0x2d')];if(!_0x5dac3e[_0x2120('0x29')][_0x2120('0x31')](_0x2120('0x32'))){_0x16fd14[_0x2120('0x17')]=qs[_0x2120('0x17')](_0x5dac3e[_0x2120('0x29')]['limit']);_0x16fd14['offset']=qs[_0x2120('0x16')](_0x5dac3e['query'][_0x2120('0x16')]);}_0x16fd14[_0x2120('0x33')]=qs[_0x2120('0x34')](_0x5dac3e[_0x2120('0x29')][_0x2120('0x34')]);_0x16fd14[_0x2120('0x35')]=qs[_0x2120('0x2b')](_['pick'](_0x5dac3e['query'],_0x385428[_0x2120('0x2b')]),_0x4eed72);if(_0x5dac3e[_0x2120('0x29')][_0x2120('0x36')]){_0x16fd14[_0x2120('0x35')]=_[_0x2120('0x37')](_0x16fd14[_0x2120('0x35')],{'$or':_[_0x2120('0x24')](_0x4eed72,function(_0x45308d){if(_0x45308d[_0x2120('0x38')]!==_0x2120('0x39')){var _0x2e3238={};_0x2e3238[_0x45308d['name']]={'$like':'%'+_0x5dac3e[_0x2120('0x29')][_0x2120('0x36')]+'%'};return _0x2e3238;}})});}_0x16fd14=_['merge']({},_0x16fd14,_0x5dac3e[_0x2120('0x3a')]);var _0x2df082={'where':_0x16fd14[_0x2120('0x35')]};return db[_0x2120('0x25')][_0x2120('0x15')](_0x2df082)[_0x2120('0x1e')](function(_0x14427f){_0x179d35['count']=_0x14427f;if(_0x5dac3e['query'][_0x2120('0x3b')]){_0x16fd14[_0x2120('0x3c')]=[{'all':!![]}];}return db[_0x2120('0x25')][_0x2120('0x3d')](_0x16fd14);})[_0x2120('0x1e')](function(_0x438c55){_0x179d35[_0x2120('0x3e')]=_0x438c55;return _0x179d35;})['then'](respondWithFilteredResult(_0x2903a5,_0x16fd14))[_0x2120('0x3f')](handleError(_0x2903a5,null));};exports[_0x2120('0x40')]=function(_0x3ddab6,_0x1077d7){var _0x37b0b6={'raw':!![],'where':{'id':_0x3ddab6[_0x2120('0x41')]['id']}},_0x3025a4={};_0x3025a4[_0x2120('0x2d')]=_['keys'](db[_0x2120('0x25')]['rawAttributes']);_0x3025a4[_0x2120('0x29')]=_[_0x2120('0x2a')](_0x3ddab6['query']);_0x3025a4[_0x2120('0x2b')]=_[_0x2120('0x2c')](_0x3025a4[_0x2120('0x2d')],_0x3025a4['query']);_0x37b0b6[_0x2120('0x2e')]=_[_0x2120('0x2c')](_0x3025a4['model'],qs[_0x2120('0x2f')](_0x3ddab6[_0x2120('0x29')][_0x2120('0x2f')]));_0x37b0b6[_0x2120('0x2e')]=_0x37b0b6['attributes'][_0x2120('0x30')]?_0x37b0b6[_0x2120('0x2e')]:_0x3025a4['model'];if(_0x3ddab6[_0x2120('0x29')][_0x2120('0x3b')]){_0x37b0b6[_0x2120('0x3c')]=[{'all':!![]}];}_0x37b0b6=_[_0x2120('0x37')]({},_0x37b0b6,_0x3ddab6['options']);return db['SalesforceField'][_0x2120('0x42')](_0x37b0b6)[_0x2120('0x1e')](handleEntityNotFound(_0x1077d7,null))[_0x2120('0x1e')](respondWithResult(_0x1077d7,null))[_0x2120('0x3f')](handleError(_0x1077d7,null));};exports[_0x2120('0x43')]=function(_0x409a1c,_0x46f144){return db[_0x2120('0x25')][_0x2120('0x43')](_0x409a1c['body'],{})[_0x2120('0x1e')](respondWithResult(_0x46f144,0xc9))['catch'](handleError(_0x46f144,null));};exports[_0x2120('0x1c')]=function(_0x2428ee,_0x5af658){if(_0x2428ee[_0x2120('0x44')]['id']){delete _0x2428ee[_0x2120('0x44')]['id'];}return db[_0x2120('0x25')][_0x2120('0x42')]({'where':{'id':_0x2428ee[_0x2120('0x41')]['id']}})['then'](handleEntityNotFound(_0x5af658,null))['then'](saveUpdates(_0x2428ee[_0x2120('0x44')],null))[_0x2120('0x1e')](respondWithResult(_0x5af658,null))[_0x2120('0x3f')](handleError(_0x5af658,null));};exports[_0x2120('0x1d')]=function(_0x16a192,_0x158288){return db[_0x2120('0x25')][_0x2120('0x42')]({'where':{'id':_0x16a192['params']['id']}})['then'](handleEntityNotFound(_0x158288,null))[_0x2120('0x1e')](removeEntity(_0x158288,null))[_0x2120('0x3f')](handleError(_0x158288,null));}; \ No newline at end of file +var _0x5295=['fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes'];(function(_0x5d8c25,_0xf839d0){var _0x1b0e8c=function(_0xad0a45){while(--_0xad0a45){_0x5d8c25['push'](_0x5d8c25['shift']());}};_0x1b0e8c(++_0xf839d0);}(_0x5295,0x6c));var _0x5529=function(_0x11750e,_0x254057){_0x11750e=_0x11750e-0x0;var _0x212c41=_0x5295[_0x11750e];return _0x212c41;};'use strict';var emlformat=require(_0x5529('0x0'));var rimraf=require(_0x5529('0x1'));var zipdir=require(_0x5529('0x2'));var jsonpatch=require(_0x5529('0x3'));var rp=require(_0x5529('0x4'));var moment=require(_0x5529('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5529('0x6'));var util=require(_0x5529('0x7'));var path=require(_0x5529('0x8'));var sox=require(_0x5529('0x9'));var csv=require(_0x5529('0xa'));var ejs=require(_0x5529('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5529('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5529('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5529('0xe'));var Redis=require(_0x5529('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5529('0x10'));var as=require(_0x5529('0x11'));var hardwareService=require(_0x5529('0x12'));var logger=require(_0x5529('0x13'))(_0x5529('0x14'));var utils=require(_0x5529('0x15'));var config=require(_0x5529('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5529('0x17'))['db'];function respondWithStatusCode(_0x1c8fee,_0x38cfaf){_0x38cfaf=_0x38cfaf||0xcc;return function(_0x443ffa){if(_0x443ffa){return _0x1c8fee[_0x5529('0x18')](_0x38cfaf);}return _0x1c8fee[_0x5529('0x19')](_0x38cfaf)[_0x5529('0x1a')]();};}function respondWithResult(_0x5d92a3,_0x57c330){_0x57c330=_0x57c330||0xc8;return function(_0x1190ba){if(_0x1190ba){return _0x5d92a3[_0x5529('0x19')](_0x57c330)[_0x5529('0x1b')](_0x1190ba);}};}function respondWithFilteredResult(_0x1bf0e9,_0x48a28c){return function(_0x1c6dfa){if(_0x1c6dfa){var _0x470394=typeof _0x48a28c['offset']==='undefined'&&typeof _0x48a28c['limit']===_0x5529('0x1c');var _0xc54665=_0x1c6dfa[_0x5529('0x1d')];var _0x292085=_0x470394?0x0:_0x48a28c['offset'];var _0x166450=_0x470394?_0x1c6dfa['count']:_0x48a28c[_0x5529('0x1e')]+_0x48a28c[_0x5529('0x1f')];var _0x32b922;if(_0x166450>=_0xc54665){_0x166450=_0xc54665;_0x32b922=0xc8;}else{_0x32b922=0xce;}_0x1bf0e9['status'](_0x32b922);return _0x1bf0e9[_0x5529('0x20')](_0x5529('0x21'),_0x292085+'-'+_0x166450+'/'+_0xc54665)[_0x5529('0x1b')](_0x1c6dfa);}return null;};}function patchUpdates(_0x1c93e1){return function(_0x4aa6e8){try{jsonpatch[_0x5529('0x22')](_0x4aa6e8,_0x1c93e1,!![]);}catch(_0x3ad677){return BPromise[_0x5529('0x23')](_0x3ad677);}return _0x4aa6e8[_0x5529('0x24')]();};}function saveUpdates(_0x10cdda,_0x58d25f){return function(_0x4a428e){if(_0x4a428e){return _0x4a428e['update'](_0x10cdda)[_0x5529('0x25')](function(_0x3abbe6){return _0x3abbe6;});}return null;};}function removeEntity(_0xdf03a8,_0x27e7ee){return function(_0x1e7bed){if(_0x1e7bed){return _0x1e7bed[_0x5529('0x26')]()['then'](function(){_0xdf03a8[_0x5529('0x19')](0xcc)[_0x5529('0x1a')]();});}};}function handleEntityNotFound(_0x1e4634,_0x404342){return function(_0x4eca34){if(!_0x4eca34){_0x1e4634[_0x5529('0x18')](0x194);}return _0x4eca34;};}function handleError(_0x352ba1,_0x3e7c57){_0x3e7c57=_0x3e7c57||0x1f4;return function(_0x307352){logger[_0x5529('0x27')](_0x307352[_0x5529('0x28')]);if(_0x307352[_0x5529('0x29')]){delete _0x307352['name'];}_0x352ba1[_0x5529('0x19')](_0x3e7c57)[_0x5529('0x2a')](_0x307352);};}exports[_0x5529('0x2b')]=function(_0x546627,_0x2332f5){var _0x1f2985={},_0x392d19={},_0xcfa4a6={'count':0x0,'rows':[]};var _0xb7e9f9=_['map'](db[_0x5529('0x2c')][_0x5529('0x2d')],function(_0xeaaffe){return{'name':_0xeaaffe[_0x5529('0x2e')],'type':_0xeaaffe[_0x5529('0x2f')][_0x5529('0x30')]};});_0x392d19[_0x5529('0x31')]=_['map'](_0xb7e9f9,_0x5529('0x29'));_0x392d19['query']=_[_0x5529('0x32')](_0x546627[_0x5529('0x33')]);_0x392d19[_0x5529('0x34')]=_[_0x5529('0x35')](_0x392d19['model'],_0x392d19[_0x5529('0x33')]);_0x1f2985['attributes']=_[_0x5529('0x35')](_0x392d19['model'],qs[_0x5529('0x36')](_0x546627[_0x5529('0x33')][_0x5529('0x36')]));_0x1f2985[_0x5529('0x37')]=_0x1f2985['attributes'][_0x5529('0x38')]?_0x1f2985[_0x5529('0x37')]:_0x392d19[_0x5529('0x31')];if(!_0x546627[_0x5529('0x33')][_0x5529('0x39')](_0x5529('0x3a'))){_0x1f2985[_0x5529('0x1f')]=qs[_0x5529('0x1f')](_0x546627[_0x5529('0x33')][_0x5529('0x1f')]);_0x1f2985[_0x5529('0x1e')]=qs['offset'](_0x546627['query'][_0x5529('0x1e')]);}_0x1f2985['order']=qs[_0x5529('0x3b')](_0x546627[_0x5529('0x33')][_0x5529('0x3b')]);_0x1f2985[_0x5529('0x3c')]=qs[_0x5529('0x34')](_[_0x5529('0x3d')](_0x546627[_0x5529('0x33')],_0x392d19['filters']),_0xb7e9f9);if(_0x546627[_0x5529('0x33')][_0x5529('0x3e')]){_0x1f2985[_0x5529('0x3c')]=_[_0x5529('0x3f')](_0x1f2985['where'],{'$or':_[_0x5529('0x40')](_0xb7e9f9,function(_0xf7ff6e){if(_0xf7ff6e[_0x5529('0x2f')]!==_0x5529('0x41')){var _0xe7285c={};_0xe7285c[_0xf7ff6e[_0x5529('0x29')]]={'$like':'%'+_0x546627['query'][_0x5529('0x3e')]+'%'};return _0xe7285c;}})});}_0x1f2985=_['merge']({},_0x1f2985,_0x546627[_0x5529('0x42')]);var _0x14ddd4={'where':_0x1f2985[_0x5529('0x3c')]};return db[_0x5529('0x2c')][_0x5529('0x1d')](_0x14ddd4)[_0x5529('0x25')](function(_0x13f0ed){_0xcfa4a6[_0x5529('0x1d')]=_0x13f0ed;if(_0x546627['query'][_0x5529('0x43')]){_0x1f2985[_0x5529('0x44')]=[{'all':!![]}];}return db[_0x5529('0x2c')]['findAll'](_0x1f2985);})[_0x5529('0x25')](function(_0x522b27){_0xcfa4a6[_0x5529('0x45')]=_0x522b27;return _0xcfa4a6;})[_0x5529('0x25')](respondWithFilteredResult(_0x2332f5,_0x1f2985))[_0x5529('0x46')](handleError(_0x2332f5,null));};exports[_0x5529('0x47')]=function(_0x5b4e33,_0x24d5fb){var _0x3bb6af={'raw':!![],'where':{'id':_0x5b4e33[_0x5529('0x48')]['id']}},_0xd6e5d1={};_0xd6e5d1[_0x5529('0x31')]=_[_0x5529('0x32')](db[_0x5529('0x2c')][_0x5529('0x2d')]);_0xd6e5d1[_0x5529('0x33')]=_['keys'](_0x5b4e33[_0x5529('0x33')]);_0xd6e5d1[_0x5529('0x34')]=_[_0x5529('0x35')](_0xd6e5d1['model'],_0xd6e5d1[_0x5529('0x33')]);_0x3bb6af[_0x5529('0x37')]=_[_0x5529('0x35')](_0xd6e5d1[_0x5529('0x31')],qs[_0x5529('0x36')](_0x5b4e33[_0x5529('0x33')][_0x5529('0x36')]));_0x3bb6af[_0x5529('0x37')]=_0x3bb6af['attributes']['length']?_0x3bb6af['attributes']:_0xd6e5d1['model'];if(_0x5b4e33[_0x5529('0x33')][_0x5529('0x43')]){_0x3bb6af['include']=[{'all':!![]}];}_0x3bb6af=_[_0x5529('0x3f')]({},_0x3bb6af,_0x5b4e33[_0x5529('0x42')]);return db[_0x5529('0x2c')]['find'](_0x3bb6af)[_0x5529('0x25')](handleEntityNotFound(_0x24d5fb,null))['then'](respondWithResult(_0x24d5fb,null))[_0x5529('0x46')](handleError(_0x24d5fb,null));};exports[_0x5529('0x49')]=function(_0x10d29e,_0x4605fb){return db[_0x5529('0x2c')][_0x5529('0x49')](_0x10d29e[_0x5529('0x4a')],{})[_0x5529('0x25')](respondWithResult(_0x4605fb,0xc9))[_0x5529('0x46')](handleError(_0x4605fb,null));};exports[_0x5529('0x4b')]=function(_0x25fcd2,_0x2536bd){if(_0x25fcd2[_0x5529('0x4a')]['id']){delete _0x25fcd2[_0x5529('0x4a')]['id'];}return db['SalesforceField'][_0x5529('0x4c')]({'where':{'id':_0x25fcd2['params']['id']}})[_0x5529('0x25')](handleEntityNotFound(_0x2536bd,null))['then'](saveUpdates(_0x25fcd2[_0x5529('0x4a')],null))[_0x5529('0x25')](respondWithResult(_0x2536bd,null))[_0x5529('0x46')](handleError(_0x2536bd,null));};exports[_0x5529('0x26')]=function(_0x5b29db,_0x4b5211){return db[_0x5529('0x2c')][_0x5529('0x4c')]({'where':{'id':_0x5b29db['params']['id']}})[_0x5529('0x25')](handleEntityNotFound(_0x4b5211,null))[_0x5529('0x25')](removeEntity(_0x4b5211,null))['catch'](handleError(_0x4b5211,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f44fbb6..a95183b 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 _0xf0b8=['./intSalesforceField.attributes','exports','define','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0xf0b8,0xbb));var _0x8f0b=function(_0x32558d,_0x1843ca){_0x32558d=_0x32558d-0x0;var _0x3a1f08=_0xf0b8[_0x32558d];return _0x3a1f08;};'use strict';var _=require(_0x8f0b('0x0'));var util=require(_0x8f0b('0x1'));var logger=require(_0x8f0b('0x2'))(_0x8f0b('0x3'));var moment=require('moment');var BPromise=require(_0x8f0b('0x4'));var rp=require(_0x8f0b('0x5'));var fs=require('fs');var path=require(_0x8f0b('0x6'));var rimraf=require(_0x8f0b('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f0b('0x8'));module[_0x8f0b('0x9')]=function(_0x353d1f,_0x264002){return _0x353d1f[_0x8f0b('0xa')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x8f0b('0xb'),'fields':['idField',_0x8f0b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5e8=['SalesforceField','int_salesforce_fields','salesforce_unique_index','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x452ac2,_0x45f034){var _0x5a589a=function(_0x3c3fe8){while(--_0x3c3fe8){_0x452ac2['push'](_0x452ac2['shift']());}};_0x5a589a(++_0x45f034);}(_0xf5e8,0x137));var _0x8f5e=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xf5e8[_0x380a3f];return _0x2b4eca;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require(_0x8f5e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8f5e('0x6'));var config=require(_0x8f5e('0x7'));var attributes=require(_0x8f5e('0x8'));module[_0x8f5e('0x9')]=function(_0x14cbf9,_0x270a1c){return _0x14cbf9[_0x8f5e('0xa')](_0x8f5e('0xb'),attributes,{'tableName':_0x8f5e('0xc'),'paranoid':![],'indexes':[{'name':_0x8f5e('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index f09cf94..f32a4bd 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 _0xa904=['stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x18fd4b,_0x475e2e){var _0xe5d6b4=function(_0x591c9b){while(--_0x591c9b){_0x18fd4b['push'](_0x18fd4b['shift']());}};_0xe5d6b4(++_0x475e2e);}(_0xa904,0x158));var _0x4a90=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xa904[_0x35a274];return _0x40d905;};'use strict';var _=require(_0x4a90('0x0'));var util=require('util');var moment=require(_0x4a90('0x1'));var BPromise=require(_0x4a90('0x2'));var rs=require(_0x4a90('0x3'));var fs=require('fs');var Redis=require(_0x4a90('0x4'));var db=require(_0x4a90('0x5'))['db'];var utils=require(_0x4a90('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4a90('0x7'));var jayson=require(_0x4a90('0x8'));var client=jayson[_0x4a90('0x9')][_0x4a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cf2bf,_0x6c3cb1,_0x30012a){return new BPromise(function(_0x55e4db,_0x39f98a){return client[_0x4a90('0xb')](_0x2cf2bf,_0x30012a)[_0x4a90('0xc')](function(_0x27f330){logger[_0x4a90('0xd')](_0x4a90('0xe'),_0x6c3cb1,_0x4a90('0xf'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x6c3cb1,_0x4a90('0xf'),JSON[_0x4a90('0x10')](_0x27f330));if(_0x27f330['error']){if(_0x27f330[_0x4a90('0x11')]['code']===0x1f4){logger[_0x4a90('0x11')](_0x4a90('0xe'),_0x6c3cb1,_0x27f330[_0x4a90('0x11')][_0x4a90('0x12')]);return _0x39f98a(_0x27f330[_0x4a90('0x11')][_0x4a90('0x12')]);}logger[_0x4a90('0x11')](_0x4a90('0xe'),_0x6c3cb1,_0x27f330[_0x4a90('0x11')][_0x4a90('0x12')]);return _0x55e4db(_0x27f330['error'][_0x4a90('0x12')]);}else{logger[_0x4a90('0xd')](_0x4a90('0xe'),_0x6c3cb1,'request\x20sent');_0x55e4db(_0x27f330['result'][_0x4a90('0x12')]);}})[_0x4a90('0x13')](function(_0x15ec2a){logger['error'](_0x4a90('0xe'),_0x6c3cb1,_0x15ec2a);_0x39f98a(_0x15ec2a);});});} \ No newline at end of file +var _0x7d03=['../../config/environment','client','http','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39e3c1,_0x229f28){var _0xcf5c89=function(_0x665c91){while(--_0x665c91){_0x39e3c1['push'](_0x39e3c1['shift']());}};_0xcf5c89(++_0x229f28);}(_0x7d03,0x151));var _0x37d0=function(_0x43465d,_0x4f4e32){_0x43465d=_0x43465d-0x0;var _0x1cf1e2=_0x7d03[_0x43465d];return _0x1cf1e2;};'use strict';var _=require('lodash');var util=require(_0x37d0('0x0'));var moment=require(_0x37d0('0x1'));var BPromise=require(_0x37d0('0x2'));var rs=require(_0x37d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37d0('0x4'))['db'];var utils=require(_0x37d0('0x5'));var logger=require(_0x37d0('0x6'))(_0x37d0('0x7'));var config=require(_0x37d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x37d0('0x9')][_0x37d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3541cf,_0x35d848,_0x4f9bc0){return new BPromise(function(_0x4d4309,_0x405d13){return client['request'](_0x3541cf,_0x4f9bc0)[_0x37d0('0xb')](function(_0x260cb3){logger[_0x37d0('0xc')]('SalesforceField,\x20%s,\x20%s',_0x35d848,_0x37d0('0xd'));logger[_0x37d0('0xe')](_0x37d0('0xf'),_0x35d848,_0x37d0('0xd'),JSON[_0x37d0('0x10')](_0x260cb3));if(_0x260cb3[_0x37d0('0x11')]){if(_0x260cb3[_0x37d0('0x11')][_0x37d0('0x12')]===0x1f4){logger['error'](_0x37d0('0x13'),_0x35d848,_0x260cb3[_0x37d0('0x11')][_0x37d0('0x14')]);return _0x405d13(_0x260cb3[_0x37d0('0x11')][_0x37d0('0x14')]);}logger['error'](_0x37d0('0x13'),_0x35d848,_0x260cb3[_0x37d0('0x11')][_0x37d0('0x14')]);return _0x4d4309(_0x260cb3[_0x37d0('0x11')][_0x37d0('0x14')]);}else{logger[_0x37d0('0xc')](_0x37d0('0x13'),_0x35d848,_0x37d0('0xd'));_0x4d4309(_0x260cb3[_0x37d0('0x15')]['message']);}})[_0x37d0('0x16')](function(_0x5478ba){logger[_0x37d0('0x11')](_0x37d0('0x13'),_0x35d848,_0x5478ba);_0x405d13(_0x5478ba);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 28d23e6..8026e9a 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 _0x865c=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy'];(function(_0x232fd1,_0x470b70){var _0x3e1559=function(_0x1e428a){while(--_0x1e428a){_0x232fd1['push'](_0x232fd1['shift']());}};_0x3e1559(++_0x470b70);}(_0x865c,0x91));var _0xc865=function(_0x3c27eb,_0x5dd307){_0x3c27eb=_0x3c27eb-0x0;var _0x1282be=_0x865c[_0x3c27eb];return _0x1282be;};'use strict';var multer=require(_0xc865('0x0'));var util=require(_0xc865('0x1'));var path=require('path');var timeout=require(_0xc865('0x2'));var express=require('express');var router=express[_0xc865('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc865('0x4'));var interaction=require(_0xc865('0x5'));var config=require(_0xc865('0x6'));var controller=require(_0xc865('0x7'));router[_0xc865('0x8')]('/',auth['isAuthenticated'](),controller[_0xc865('0x9')]);router[_0xc865('0x8')](_0xc865('0xa'),auth[_0xc865('0xb')](),controller[_0xc865('0xc')]);router[_0xc865('0x8')](_0xc865('0xd'),auth[_0xc865('0xb')](),controller[_0xc865('0xe')]);router[_0xc865('0x8')](_0xc865('0xf'),auth[_0xc865('0xb')](),controller[_0xc865('0x10')]);router[_0xc865('0x11')]('/',auth['isAuthenticated'](),controller[_0xc865('0x12')]);router['post'](_0xc865('0xd'),auth[_0xc865('0xb')](),controller[_0xc865('0x13')]);router[_0xc865('0x14')]('/:id',auth[_0xc865('0xb')](),controller['update']);router[_0xc865('0x15')]('/:id',auth[_0xc865('0xb')](),controller[_0xc865('0x16')]);module[_0xc865('0x17')]=router; \ No newline at end of file +var _0x5dd5=['destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','addConfiguration','put','delete'];(function(_0x589d05,_0x1c08fc){var _0x3cfef8=function(_0x48d9cc){while(--_0x48d9cc){_0x589d05['push'](_0x589d05['shift']());}};_0x3cfef8(++_0x1c08fc);}(_0x5dd5,0x1a0));var _0x55dd=function(_0x1bea3e,_0x36314d){_0x1bea3e=_0x1bea3e-0x0;var _0x9c17f8=_0x5dd5[_0x1bea3e];return _0x9c17f8;};'use strict';var multer=require('multer');var util=require(_0x55dd('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x55dd('0x1'));var router=express[_0x55dd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x55dd('0x3'));var interaction=require(_0x55dd('0x4'));var config=require('../../config/environment');var controller=require(_0x55dd('0x5'));router[_0x55dd('0x6')]('/',auth[_0x55dd('0x7')](),controller[_0x55dd('0x8')]);router[_0x55dd('0x6')](_0x55dd('0x9'),auth[_0x55dd('0x7')](),controller['show']);router[_0x55dd('0x6')](_0x55dd('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x55dd('0xb'),auth[_0x55dd('0x7')](),controller[_0x55dd('0xc')]);router['post']('/',auth[_0x55dd('0x7')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x55dd('0xd')]);router[_0x55dd('0xe')](_0x55dd('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x55dd('0xf')](_0x55dd('0x9'),auth[_0x55dd('0x7')](),controller[_0x55dd('0x10')]);module[_0x55dd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 134cb11..39fcbfe 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 _0x7d74=['sequelize','STRING','username','remoteUri'];(function(_0x35eb5b,_0x271615){var _0xaf0396=function(_0x4c7259){while(--_0x4c7259){_0x35eb5b['push'](_0x35eb5b['shift']());}};_0xaf0396(++_0x271615);}(_0x7d74,0xb8));var _0x47d7=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7d74[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x47d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x47d7('0x1')]},'description':{'type':Sequelize[_0x47d7('0x1')]},'username':{'type':Sequelize[_0x47d7('0x1')],'unique':_0x47d7('0x2')},'password':{'type':Sequelize[_0x47d7('0x1')]},'email':{'type':Sequelize[_0x47d7('0x1')]},'remoteUri':{'type':Sequelize[_0x47d7('0x1')],'unique':_0x47d7('0x3')},'serverUrl':{'type':Sequelize[_0x47d7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x63f4=['exports','STRING','remoteUri','sequelize'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x63f4,0x1b7));var _0x463f=function(_0xb08f6,_0x2632e3){_0xb08f6=_0xb08f6-0x0;var _0xbd7afc=_0x63f4[_0xb08f6];return _0xbd7afc;};'use strict';var Sequelize=require(_0x463f('0x0'));module[_0x463f('0x1')]={'name':{'type':Sequelize[_0x463f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x463f('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x463f('0x2')]},'email':{'type':Sequelize[_0x463f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x463f('0x3')},'serverUrl':{'type':Sequelize[_0x463f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 95a57f7..85e0c83 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 _0x0151=['apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','ServicenowAccount','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','rows','rawAttributes','include','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','Subjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','made_sla','watch_list','upon_reject','child_incidents','number','resolved_by','sys_updated_by','sys_domain','sys_created_by','closed_at','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','business_stc','description','calendar_duration','notify','sys_class_name','follow_up','parent_incident','sys_id','urgency','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','reopen_count','sys_tags','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','substring','format','%s/api/now/doc/table/schema/','password','GET','result','assign','includes','all','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','push','test','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','label','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','limit','undefined','count','offset','set','Content-Range'];(function(_0x5a7617,_0x3c85fe){var _0x1df2bc=function(_0x557502){while(--_0x557502){_0x5a7617['push'](_0x5a7617['shift']());}};_0x1df2bc(++_0x3c85fe);}(_0x0151,0x137));var _0x1015=function(_0x4b2192,_0x50d31f){_0x4b2192=_0x4b2192-0x0;var _0x5d3e16=_0x0151[_0x4b2192];return _0x5d3e16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1015('0x0'));var zipdir=require(_0x1015('0x1'));var jsonpatch=require(_0x1015('0x2'));var rp=require(_0x1015('0x3'));var moment=require(_0x1015('0x4'));var BPromise=require(_0x1015('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1015('0x6'));var csv=require('to-csv');var ejs=require(_0x1015('0x7'));var fs=require('fs');var fs_extra=require(_0x1015('0x8'));var _=require(_0x1015('0x9'));var squel=require(_0x1015('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1015('0xb'));var toCsv=require(_0x1015('0xc'));var querystring=require(_0x1015('0xd'));var Papa=require(_0x1015('0xe'));var Redis=require(_0x1015('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1015('0x10'));var hardwareService=require(_0x1015('0x11'));var logger=require(_0x1015('0x12'))(_0x1015('0x13'));var utils=require(_0x1015('0x14'));var config=require(_0x1015('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1015('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2fe970,_0x2621a1){_0x2621a1=_0x2621a1||0xcc;return function(_0x479fc0){if(_0x479fc0){return _0x2fe970['sendStatus'](_0x2621a1);}return _0x2fe970[_0x1015('0x17')](_0x2621a1)[_0x1015('0x18')]();};}function respondWithResult(_0xb02da9,_0xc88f13){_0xc88f13=_0xc88f13||0xc8;return function(_0x159981){if(_0x159981){return _0xb02da9[_0x1015('0x17')](_0xc88f13)['json'](_0x159981);}};}function respondWithFilteredResult(_0x3aeb29,_0x5cd9e1){return function(_0x5b00b5){if(_0x5b00b5){var _0x2743e1=typeof _0x5cd9e1['offset']==='undefined'&&typeof _0x5cd9e1[_0x1015('0x19')]===_0x1015('0x1a');var _0x3c9959=_0x5b00b5[_0x1015('0x1b')];var _0x24c1a7=_0x2743e1?0x0:_0x5cd9e1[_0x1015('0x1c')];var _0x5ea8c6=_0x2743e1?_0x5b00b5['count']:_0x5cd9e1['offset']+_0x5cd9e1[_0x1015('0x19')];var _0x5ddad9;if(_0x5ea8c6>=_0x3c9959){_0x5ea8c6=_0x3c9959;_0x5ddad9=0xc8;}else{_0x5ddad9=0xce;}_0x3aeb29[_0x1015('0x17')](_0x5ddad9);return _0x3aeb29[_0x1015('0x1d')](_0x1015('0x1e'),_0x24c1a7+'-'+_0x5ea8c6+'/'+_0x3c9959)['json'](_0x5b00b5);}return null;};}function patchUpdates(_0x5d0af2){return function(_0x1f63ca){try{jsonpatch[_0x1015('0x1f')](_0x1f63ca,_0x5d0af2,!![]);}catch(_0x54ba8c){return BPromise[_0x1015('0x20')](_0x54ba8c);}return _0x1f63ca[_0x1015('0x21')]();};}function saveUpdates(_0x4993d1,_0x18c794){return function(_0x3c0308){if(_0x3c0308){return _0x3c0308[_0x1015('0x22')](_0x4993d1)['then'](function(_0x18a46f){return _0x18a46f;});}return null;};}function removeEntity(_0x7d33d,_0x3417d1){return function(_0x28f9fe){if(_0x28f9fe){return _0x28f9fe[_0x1015('0x23')]()[_0x1015('0x24')](function(){_0x7d33d[_0x1015('0x17')](0xcc)[_0x1015('0x18')]();});}};}function handleEntityNotFound(_0xe40765,_0x1e98dc){return function(_0x522eea){if(!_0x522eea){_0xe40765[_0x1015('0x25')](0x194);}return _0x522eea;};}function handleError(_0x2a5db7,_0x241ac3){_0x241ac3=_0x241ac3||0x1f4;return function(_0x4654b6){logger[_0x1015('0x26')](_0x4654b6[_0x1015('0x27')]);if(_0x4654b6[_0x1015('0x28')]){delete _0x4654b6[_0x1015('0x28')];}_0x2a5db7[_0x1015('0x17')](_0x241ac3)[_0x1015('0x29')](_0x4654b6);};}exports[_0x1015('0x2a')]=function(_0x481c4a,_0x127705){var _0x1a4e8a={},_0x4c3b7a={},_0x42cd97={'count':0x0,'rows':[]};var _0x32267f=_['map'](db[_0x1015('0x2b')]['rawAttributes'],function(_0x3cd030){return{'name':_0x3cd030[_0x1015('0x2c')],'type':_0x3cd030[_0x1015('0x2d')]['key']};});_0x4c3b7a[_0x1015('0x2e')]=_['map'](_0x32267f,_0x1015('0x28'));_0x4c3b7a['query']=_[_0x1015('0x2f')](_0x481c4a[_0x1015('0x30')]);_0x4c3b7a[_0x1015('0x31')]=_['intersection'](_0x4c3b7a['model'],_0x4c3b7a[_0x1015('0x30')]);_0x1a4e8a[_0x1015('0x32')]=_[_0x1015('0x33')](_0x4c3b7a[_0x1015('0x2e')],qs['fields'](_0x481c4a['query'][_0x1015('0x34')]));_0x1a4e8a[_0x1015('0x32')]=_0x1a4e8a[_0x1015('0x32')][_0x1015('0x35')]?_0x1a4e8a[_0x1015('0x32')]:_0x4c3b7a[_0x1015('0x2e')];if(!_0x481c4a[_0x1015('0x30')][_0x1015('0x36')](_0x1015('0x37'))){_0x1a4e8a[_0x1015('0x19')]=qs['limit'](_0x481c4a[_0x1015('0x30')][_0x1015('0x19')]);_0x1a4e8a['offset']=qs[_0x1015('0x1c')](_0x481c4a[_0x1015('0x30')][_0x1015('0x1c')]);}_0x1a4e8a[_0x1015('0x38')]=qs[_0x1015('0x39')](_0x481c4a[_0x1015('0x30')][_0x1015('0x39')]);_0x1a4e8a[_0x1015('0x3a')]=qs[_0x1015('0x31')](_[_0x1015('0x3b')](_0x481c4a[_0x1015('0x30')],_0x4c3b7a[_0x1015('0x31')]),_0x32267f);if(_0x481c4a[_0x1015('0x30')]['filter']){_0x1a4e8a[_0x1015('0x3a')]=_['merge'](_0x1a4e8a[_0x1015('0x3a')],{'$or':_[_0x1015('0x3c')](_0x32267f,function(_0x4bc1fc){if(_0x4bc1fc[_0x1015('0x2d')]!==_0x1015('0x3d')){var _0x374cea={};_0x374cea[_0x4bc1fc['name']]={'$like':'%'+_0x481c4a[_0x1015('0x30')][_0x1015('0x3e')]+'%'};return _0x374cea;}})});}_0x1a4e8a=_[_0x1015('0x3f')]({},_0x1a4e8a,_0x481c4a[_0x1015('0x40')]);var _0x97695a={'where':_0x1a4e8a[_0x1015('0x3a')]};return db[_0x1015('0x2b')][_0x1015('0x1b')](_0x97695a)[_0x1015('0x24')](function(_0x16310c){_0x42cd97[_0x1015('0x1b')]=_0x16310c;if(_0x481c4a[_0x1015('0x30')][_0x1015('0x41')]){_0x1a4e8a['include']=[{'all':!![]}];}return db[_0x1015('0x2b')]['findAll'](_0x1a4e8a);})[_0x1015('0x24')](function(_0x51a022){_0x42cd97[_0x1015('0x42')]=_0x51a022;return _0x42cd97;})[_0x1015('0x24')](respondWithFilteredResult(_0x127705,_0x1a4e8a))['catch'](handleError(_0x127705,null));};exports['show']=function(_0x3caa70,_0x21cb30){var _0x281655={'raw':![],'where':{'id':_0x3caa70['params']['id']}},_0x205a4a={};_0x205a4a[_0x1015('0x2e')]=_[_0x1015('0x2f')](db[_0x1015('0x2b')][_0x1015('0x43')]);_0x205a4a[_0x1015('0x30')]=_[_0x1015('0x2f')](_0x3caa70[_0x1015('0x30')]);_0x205a4a[_0x1015('0x31')]=_[_0x1015('0x33')](_0x205a4a[_0x1015('0x2e')],_0x205a4a[_0x1015('0x30')]);_0x281655[_0x1015('0x32')]=_['intersection'](_0x205a4a[_0x1015('0x2e')],qs['fields'](_0x3caa70[_0x1015('0x30')]['fields']));_0x281655['attributes']=_0x281655['attributes'][_0x1015('0x35')]?_0x281655[_0x1015('0x32')]:_0x205a4a[_0x1015('0x2e')];if(_0x3caa70[_0x1015('0x30')][_0x1015('0x41')]){_0x281655[_0x1015('0x44')]=[{'all':!![]}];}_0x281655=_[_0x1015('0x3f')]({},_0x281655,_0x3caa70[_0x1015('0x40')]);return db[_0x1015('0x2b')][_0x1015('0x45')](_0x281655)['then'](handleEntityNotFound(_0x21cb30,null))[_0x1015('0x24')](respondWithResult(_0x21cb30,null))[_0x1015('0x46')](handleError(_0x21cb30,null));};exports[_0x1015('0x47')]=function(_0xdd4766,_0x28419e){return db['ServicenowAccount'][_0x1015('0x47')](_0xdd4766['body'],{})['then'](respondWithResult(_0x28419e,0xc9))['catch'](handleError(_0x28419e,null));};exports[_0x1015('0x22')]=function(_0x2b969c,_0x371843){if(_0x2b969c[_0x1015('0x48')]['id']){delete _0x2b969c[_0x1015('0x48')]['id'];}return db[_0x1015('0x2b')][_0x1015('0x45')]({'where':{'id':_0x2b969c[_0x1015('0x49')]['id']}})[_0x1015('0x24')](handleEntityNotFound(_0x371843,null))['then'](saveUpdates(_0x2b969c['body'],null))['then'](respondWithResult(_0x371843,null))['catch'](handleError(_0x371843,null));};exports[_0x1015('0x23')]=function(_0x126056,_0x13d2b6){return db[_0x1015('0x2b')][_0x1015('0x45')]({'where':{'id':_0x126056[_0x1015('0x49')]['id']}})[_0x1015('0x24')](handleEntityNotFound(_0x13d2b6,null))['then'](removeEntity(_0x13d2b6,null))[_0x1015('0x46')](handleError(_0x13d2b6,null));};exports[_0x1015('0x4a')]=function(_0x39dd1e,_0xca0473,_0x53181b){var _0x2d8312={};var _0x197b01={};var _0xbf9b63;var _0x51d0c4;return db[_0x1015('0x2b')][_0x1015('0x4b')]({'where':{'id':_0x39dd1e[_0x1015('0x49')]['id']}})['then'](handleEntityNotFound(_0xca0473,null))[_0x1015('0x24')](function(_0x1f9b2e){if(_0x1f9b2e){_0xbf9b63=_0x1f9b2e;_0x197b01[_0x1015('0x2e')]=_['keys'](db[_0x1015('0x4c')][_0x1015('0x43')]);_0x197b01[_0x1015('0x30')]=_['keys'](_0x39dd1e[_0x1015('0x30')]);_0x197b01[_0x1015('0x31')]=_[_0x1015('0x33')](_0x197b01[_0x1015('0x2e')],_0x197b01[_0x1015('0x30')]);_0x2d8312[_0x1015('0x32')]=_['intersection'](_0x197b01[_0x1015('0x2e')],qs[_0x1015('0x34')](_0x39dd1e[_0x1015('0x30')][_0x1015('0x34')]));_0x2d8312[_0x1015('0x32')]=_0x2d8312[_0x1015('0x32')][_0x1015('0x35')]?_0x2d8312[_0x1015('0x32')]:_0x197b01[_0x1015('0x2e')];_0x2d8312[_0x1015('0x38')]=qs[_0x1015('0x39')](_0x39dd1e[_0x1015('0x30')][_0x1015('0x39')]);_0x2d8312[_0x1015('0x3a')]=qs['filters'](_['pick'](_0x39dd1e[_0x1015('0x30')],_0x197b01['filters']));if(_0x39dd1e[_0x1015('0x30')][_0x1015('0x3e')]){_0x2d8312[_0x1015('0x3a')]=_[_0x1015('0x3f')](_0x2d8312['where'],{'$or':_[_0x1015('0x3c')](_0x2d8312['attributes'],function(_0x3b8932){var _0x15f2b3={};_0x15f2b3[_0x3b8932]={'$like':'%'+_0x39dd1e['query'][_0x1015('0x3e')]+'%'};return _0x15f2b3;})});}_0x2d8312=_[_0x1015('0x3f')]({},_0x2d8312,_0x39dd1e[_0x1015('0x40')]);return _0xbf9b63[_0x1015('0x4a')](_0x2d8312);}})[_0x1015('0x24')](function(_0x4446dc){if(_0x4446dc){_0x51d0c4=_0x4446dc[_0x1015('0x35')];if(!_0x39dd1e[_0x1015('0x30')][_0x1015('0x36')]('nolimit')){_0x2d8312[_0x1015('0x19')]=qs[_0x1015('0x19')](_0x39dd1e['query'][_0x1015('0x19')]);_0x2d8312[_0x1015('0x1c')]=qs[_0x1015('0x1c')](_0x39dd1e[_0x1015('0x30')][_0x1015('0x1c')]);}return _0xbf9b63[_0x1015('0x4a')](_0x2d8312);}})[_0x1015('0x24')](function(_0x2ae344){if(_0x2ae344){return _0x2ae344?{'count':_0x51d0c4,'rows':_0x2ae344}:null;}})[_0x1015('0x24')](respondWithResult(_0xca0473,null))[_0x1015('0x46')](handleError(_0xca0473,null));};exports[_0x1015('0x4d')]=function(_0x296db4,_0x5cdb18,_0x4310fb){if(_0x296db4[_0x1015('0x48')]['id']){delete _0x296db4[_0x1015('0x48')]['id'];}return db[_0x1015('0x2b')][_0x1015('0x4b')]({'where':{'id':_0x296db4[_0x1015('0x49')]['id']}})[_0x1015('0x24')](handleEntityNotFound(_0x5cdb18,null))[_0x1015('0x24')](function(_0x190e30){if(_0x190e30){_0x296db4['body']['AccountId']=_0x190e30['id'];_0x296db4[_0x1015('0x48')][_0x1015('0x4e')]=integrations['getSubjects'](_0x296db4[_0x1015('0x48')][_0x1015('0x4f')],_0x296db4[_0x1015('0x48')][_0x1015('0x2d')]);_0x296db4[_0x1015('0x48')]['Descriptions']=integrations[_0x1015('0x50')](_0x296db4['body'][_0x1015('0x4f')],_0x296db4[_0x1015('0x48')][_0x1015('0x2d')]);return db[_0x1015('0x4c')][_0x1015('0x47')](_0x296db4[_0x1015('0x48')],{'include':[{'model':db[_0x1015('0x51')],'as':_0x1015('0x4e')},{'model':db[_0x1015('0x51')],'as':_0x1015('0x52')}]});}return null;})[_0x1015('0x24')](respondWithResult(_0x5cdb18,null))[_0x1015('0x46')](handleError(_0x5cdb18,null));};exports[_0x1015('0x53')]=function(_0x3ed978,_0x140c17,_0x29acee){var _0x33a28c=['made_sla',_0x1015('0x54'),_0x1015('0x55'),_0x1015('0x56'),_0x1015('0x57'),'notify',_0x1015('0x58'),_0x1015('0x59'),_0x1015('0x5a')];var _0x432748=['parent',_0x1015('0x5b'),'caused_by',_0x1015('0x5c'),_0x1015('0x5d'),'sys_updated_on',_0x1015('0x5e'),_0x1015('0x54'),'approval_history',_0x1015('0x5f'),_0x1015('0x60'),_0x1015('0x61'),'opened_by','user_input','sys_created_on',_0x1015('0x62'),'state',_0x1015('0x63'),_0x1015('0x55'),_0x1015('0x38'),'calendar_stc',_0x1015('0x64'),_0x1015('0x65'),_0x1015('0x66'),'impact','active',_0x1015('0x67'),_0x1015('0x68'),_0x1015('0x69'),'sys_domain_path',_0x1015('0x6a'),_0x1015('0x6b'),_0x1015('0x6c'),'opened_at',_0x1015('0x6d'),_0x1015('0x6e'),'work_end',_0x1015('0x6f'),_0x1015('0x70'),_0x1015('0x71'),_0x1015('0x72'),'subcategory','work_notes',_0x1015('0x73'),'close_code',_0x1015('0x74'),_0x1015('0x75'),_0x1015('0x76'),'assignment_group',_0x1015('0x77'),'additional_assignee_list',_0x1015('0x78'),_0x1015('0x79'),_0x1015('0x7a'),_0x1015('0x7b'),'close_notes','closed_by',_0x1015('0x7c'),_0x1015('0x7d'),_0x1015('0x7e'),'contact_type','reopened_by',_0x1015('0x58'),_0x1015('0x7f'),'problem_id',_0x1015('0x80'),_0x1015('0x81'),_0x1015('0x82'),_0x1015('0x83'),'severity',_0x1015('0x84'),'sla_due',_0x1015('0x85'),_0x1015('0x86'),'due_date','sys_mod_count',_0x1015('0x87'),_0x1015('0x88'),'escalation',_0x1015('0x89'),_0x1015('0x8a'),_0x1015('0x8b'),_0x1015('0x5a')];var _0x659c53='';var _0x1d4f6b='';var _0x5cef75=[];var _0x144215='';var _0x291ffd='';var _0x263990=[];var _0x41f818='';var _0x45ac5b='';var _0xdcf4a1={};var _0x1596ba='';return db[_0x1015('0x2b')][_0x1015('0x4b')]({'where':{'id':_0x3ed978[_0x1015('0x49')]['id']},'attributes':['id',_0x1015('0x8c'),'password',_0x1015('0x8d'),_0x1015('0x8e'),_0x1015('0x8f')]})[_0x1015('0x24')](handleEntityNotFound(_0x140c17,null))['then'](function(_0x32cd83){if(_0x32cd83){_0x1596ba=_0x32cd83[_0x1015('0x8e')];var _0x590ab5=_0x1596ba['slice'](-0x1);if(_0x590ab5==='/'){_0x1596ba=_0x1596ba[_0x1015('0x90')](0x0,_0x1596ba['lastIndexOf'](_0x590ab5));}_0x45ac5b=util[_0x1015('0x91')](_0x1015('0x92'),_0x1596ba);_0x41f818=util[_0x1015('0x91')]('%s/api/now/table/',_0x1596ba);_0xdcf4a1={'user':_0x32cd83['username'],'pass':_0x32cd83[_0x1015('0x93')]};var _0x3380c1={'method':_0x1015('0x94'),'uri':_0x45ac5b+'incident?sysparm_display_value=all','auth':_0xdcf4a1,'json':!![]};return rp(_0x3380c1);}})[_0x1015('0x24')](function(_0x592368){if(_0x592368['result'][_0x1015('0x35')]>0x0){_0x659c53=_0x592368[_0x1015('0x95')];}console['log']('incident\x20table\x20objects',_0x659c53);_0x263990=[];_0x1d4f6b=Object[_0x1015('0x96')]([],_0x659c53);_['remove'](_0x1d4f6b,function(_0xadf6ab){return!_0x33a28c[_0x1015('0x97')](_0xadf6ab[_0x1015('0x28')]);});_0x1d4f6b['forEach'](function(_0xb41812){var _0x258f21=createFieldObject(_0x41f818,_0xdcf4a1,_0xb41812['internalType'],_0xb41812['name'],_0xb41812['label'],![]);_0x263990['push'](_0x258f21);});return Promise[_0x1015('0x98')](_0x263990);})[_0x1015('0x24')](function(_0x339907){_0x5cef75=_0x339907;_0x144215=Object['assign']([],_0x659c53);console[_0x1015('0x99')](_0x1015('0x9a'),_0x659c53);_[_0x1015('0x9b')](_0x144215,function(_0x16dc2e){return _0x432748['includes'](_0x16dc2e[_0x1015('0x28')]);});console[_0x1015('0x99')](_0x1015('0x9c'),_0x144215);_0x263990=[];_0x144215[_0x1015('0x9d')](function(_0xb201b){var _0x2ba5a1=createFieldObject(_0x41f818,_0xdcf4a1,_0xb201b[_0x1015('0x9e')],_0xb201b[_0x1015('0x28')],_0xb201b['label'],!![]);_0x263990[_0x1015('0x9f')](_0x2ba5a1);});return Promise[_0x1015('0x98')](_0x263990);})['then'](function(_0x431e83){_0x291ffd=_0x431e83;var _0x3de084=_0x5cef75['concat'](_0x291ffd);return{'count':_0x3de084[_0x1015('0x35')],'rows':_0x3de084};})[_0x1015('0x24')](respondWithResult(_0x140c17,null))[_0x1015('0x46')](function(_0x2db1c2){console[_0x1015('0x99')]('ServiceNow\x20error:\x20'+_0x2db1c2);var _0x565f96=_0x3ed978[_0x1015('0x30')][_0x1015('0xa0')]?0x1f4:_0x2db1c2['statusCode']||0x1f4;logger[_0x1015('0x26')](_0x2db1c2['stack']);delete _0x2db1c2[_0x1015('0x28')];if(_0x565f96===0x191){_0x565f96=0x190;}_0x140c17['status'](_0x565f96)[_0x1015('0x29')](_0x3ed978[_0x1015('0x30')][_0x1015('0xa0')]?{'message':_0x1015('0xa1'),'statusCode':_0x2db1c2[_0x1015('0xa2')]}:_0x2db1c2);});};function createFieldObject(_0x5a78f1,_0xb30128,_0x3bf882,_0x30dd77,_0x5eb158,_0x37f16e){return new Promise(function(_0x3a57fa,_0x3fcd39){var _0x240509={'id':_0x30dd77,'name':_0x5eb158,'custom':_0x37f16e};if(_0x3bf882===_0x1015('0xa3')){_0x240509[_0x1015('0x40')]=[{'name':_0x1015('0xa4'),'value':'true'},{'name':_0x1015('0xa5'),'value':_0x1015('0xa6')}];_0x3a57fa(_0x240509);}else{var _0x34a84d={'method':'GET','uri':_0x5a78f1+_0x1015('0xa7')+_0x30dd77,'auth':_0xb30128,'json':!![]};return rp(_0x34a84d)[_0x1015('0x24')](function(_0xe00189){var _0x19e686=[];if(_0xe00189['result'][_0x1015('0x35')]>0x0){_0xe00189[_0x1015('0x95')][_0x1015('0x9d')](function(_0x47caa2){if(_0x47caa2[_0x1015('0xa8')]==='false'){var _0x2f83dd={'name':_0x47caa2[_0x1015('0xa9')],'value':_0x47caa2[_0x1015('0xaa')]};_0x19e686[_0x1015('0x9f')](_0x2f83dd);}});}_0x240509[_0x1015('0x40')]=_0x19e686;if(_0x240509['options'][_0x1015('0x35')]>0x0){_0x3a57fa(_0x240509);}else{if(_0x37f16e==![]){_0x3a57fa();}else{_0x3a57fa(_0x240509);}}});}});} \ No newline at end of file +var _0xbc9c=['cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','forEach','internalType','label','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','ServiceNow\x20error:\x20','test','statusCode','boolean','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','ServicenowAccount','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','order','closed_at'];(function(_0x4a2937,_0x3add76){var _0x30ed7d=function(_0x3a6605){while(--_0x3a6605){_0x4a2937['push'](_0x4a2937['shift']());}};_0x30ed7d(++_0x3add76);}(_0xbc9c,0x1c3));var _0xcbc9=function(_0x39b559,_0x1e6162){_0x39b559=_0x39b559-0x0;var _0x115270=_0xbc9c[_0x39b559];return _0x115270;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbc9('0x0'));var zipdir=require(_0xcbc9('0x1'));var jsonpatch=require(_0xcbc9('0x2'));var rp=require(_0xcbc9('0x3'));var moment=require(_0xcbc9('0x4'));var BPromise=require(_0xcbc9('0x5'));var Mustache=require('mustache');var util=require(_0xcbc9('0x6'));var path=require('path');var sox=require(_0xcbc9('0x7'));var csv=require(_0xcbc9('0x8'));var ejs=require(_0xcbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xcbc9('0xa'));var _=require(_0xcbc9('0xb'));var squel=require(_0xcbc9('0xc'));var crypto=require(_0xcbc9('0xd'));var jsforce=require(_0xcbc9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcbc9('0x8'));var querystring=require('querystring');var Papa=require(_0xcbc9('0xf'));var Redis=require(_0xcbc9('0x10'));var authService=require(_0xcbc9('0x11'));var qs=require(_0xcbc9('0x12'));var as=require(_0xcbc9('0x13'));var hardwareService=require(_0xcbc9('0x14'));var logger=require(_0xcbc9('0x15'))(_0xcbc9('0x16'));var utils=require(_0xcbc9('0x17'));var config=require(_0xcbc9('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xcbc9('0x19'));function respondWithStatusCode(_0x2527a8,_0x240735){_0x240735=_0x240735||0xcc;return function(_0x543b2c){if(_0x543b2c){return _0x2527a8[_0xcbc9('0x1a')](_0x240735);}return _0x2527a8['status'](_0x240735)[_0xcbc9('0x1b')]();};}function respondWithResult(_0x1043ca,_0x2277d9){_0x2277d9=_0x2277d9||0xc8;return function(_0x2a6488){if(_0x2a6488){return _0x1043ca[_0xcbc9('0x1c')](_0x2277d9)[_0xcbc9('0x1d')](_0x2a6488);}};}function respondWithFilteredResult(_0x4d8e52,_0x2906e5){return function(_0x29f6d0){if(_0x29f6d0){var _0x51f59d=typeof _0x2906e5[_0xcbc9('0x1e')]===_0xcbc9('0x1f')&&typeof _0x2906e5[_0xcbc9('0x20')]===_0xcbc9('0x1f');var _0x4dd6d5=_0x29f6d0[_0xcbc9('0x21')];var _0x58f51d=_0x51f59d?0x0:_0x2906e5[_0xcbc9('0x1e')];var _0x30b7e4=_0x51f59d?_0x29f6d0[_0xcbc9('0x21')]:_0x2906e5[_0xcbc9('0x1e')]+_0x2906e5[_0xcbc9('0x20')];var _0x4b2d9d;if(_0x30b7e4>=_0x4dd6d5){_0x30b7e4=_0x4dd6d5;_0x4b2d9d=0xc8;}else{_0x4b2d9d=0xce;}_0x4d8e52['status'](_0x4b2d9d);return _0x4d8e52[_0xcbc9('0x22')](_0xcbc9('0x23'),_0x58f51d+'-'+_0x30b7e4+'/'+_0x4dd6d5)['json'](_0x29f6d0);}return null;};}function patchUpdates(_0x515444){return function(_0x1e0e03){try{jsonpatch[_0xcbc9('0x24')](_0x1e0e03,_0x515444,!![]);}catch(_0x1be7f2){return BPromise['reject'](_0x1be7f2);}return _0x1e0e03[_0xcbc9('0x25')]();};}function saveUpdates(_0x168c1d,_0x505174){return function(_0x3b4ab3){if(_0x3b4ab3){return _0x3b4ab3[_0xcbc9('0x26')](_0x168c1d)[_0xcbc9('0x27')](function(_0x3e26ae){return _0x3e26ae;});}return null;};}function removeEntity(_0x2f9b2a,_0x45c795){return function(_0x4b751e){if(_0x4b751e){return _0x4b751e[_0xcbc9('0x28')]()[_0xcbc9('0x27')](function(){_0x2f9b2a[_0xcbc9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3857a2,_0x448db4){return function(_0x2f9b51){if(!_0x2f9b51){_0x3857a2[_0xcbc9('0x1a')](0x194);}return _0x2f9b51;};}function handleError(_0x3f51eb,_0x3fa50a){_0x3fa50a=_0x3fa50a||0x1f4;return function(_0x3d497e){logger[_0xcbc9('0x29')](_0x3d497e[_0xcbc9('0x2a')]);if(_0x3d497e[_0xcbc9('0x2b')]){delete _0x3d497e['name'];}_0x3f51eb[_0xcbc9('0x1c')](_0x3fa50a)[_0xcbc9('0x2c')](_0x3d497e);};}exports['index']=function(_0x14a7c1,_0x16a855){var _0x340d55={},_0x448894={},_0x1929c2={'count':0x0,'rows':[]};var _0x5231f4=_['map'](db[_0xcbc9('0x2d')]['rawAttributes'],function(_0x46568e){return{'name':_0x46568e[_0xcbc9('0x2e')],'type':_0x46568e[_0xcbc9('0x2f')]['key']};});_0x448894[_0xcbc9('0x30')]=_[_0xcbc9('0x31')](_0x5231f4,'name');_0x448894['query']=_[_0xcbc9('0x32')](_0x14a7c1[_0xcbc9('0x33')]);_0x448894['filters']=_[_0xcbc9('0x34')](_0x448894[_0xcbc9('0x30')],_0x448894['query']);_0x340d55[_0xcbc9('0x35')]=_[_0xcbc9('0x34')](_0x448894[_0xcbc9('0x30')],qs[_0xcbc9('0x36')](_0x14a7c1[_0xcbc9('0x33')][_0xcbc9('0x36')]));_0x340d55[_0xcbc9('0x35')]=_0x340d55[_0xcbc9('0x35')][_0xcbc9('0x37')]?_0x340d55[_0xcbc9('0x35')]:_0x448894[_0xcbc9('0x30')];if(!_0x14a7c1['query']['hasOwnProperty'](_0xcbc9('0x38'))){_0x340d55[_0xcbc9('0x20')]=qs['limit'](_0x14a7c1[_0xcbc9('0x33')][_0xcbc9('0x20')]);_0x340d55[_0xcbc9('0x1e')]=qs[_0xcbc9('0x1e')](_0x14a7c1['query'][_0xcbc9('0x1e')]);}_0x340d55['order']=qs[_0xcbc9('0x39')](_0x14a7c1[_0xcbc9('0x33')]['sort']);_0x340d55[_0xcbc9('0x3a')]=qs['filters'](_[_0xcbc9('0x3b')](_0x14a7c1[_0xcbc9('0x33')],_0x448894[_0xcbc9('0x3c')]),_0x5231f4);if(_0x14a7c1[_0xcbc9('0x33')][_0xcbc9('0x3d')]){_0x340d55[_0xcbc9('0x3a')]=_[_0xcbc9('0x3e')](_0x340d55[_0xcbc9('0x3a')],{'$or':_['map'](_0x5231f4,function(_0x5274b4){if(_0x5274b4[_0xcbc9('0x2f')]!=='VIRTUAL'){var _0x280b7d={};_0x280b7d[_0x5274b4[_0xcbc9('0x2b')]]={'$like':'%'+_0x14a7c1[_0xcbc9('0x33')]['filter']+'%'};return _0x280b7d;}})});}_0x340d55=_[_0xcbc9('0x3e')]({},_0x340d55,_0x14a7c1[_0xcbc9('0x3f')]);var _0x3cdeb0={'where':_0x340d55['where']};return db[_0xcbc9('0x2d')][_0xcbc9('0x21')](_0x3cdeb0)[_0xcbc9('0x27')](function(_0x52c472){_0x1929c2['count']=_0x52c472;if(_0x14a7c1['query'][_0xcbc9('0x40')]){_0x340d55[_0xcbc9('0x41')]=[{'all':!![]}];}return db[_0xcbc9('0x2d')][_0xcbc9('0x42')](_0x340d55);})[_0xcbc9('0x27')](function(_0x24717f){_0x1929c2[_0xcbc9('0x43')]=_0x24717f;return _0x1929c2;})[_0xcbc9('0x27')](respondWithFilteredResult(_0x16a855,_0x340d55))['catch'](handleError(_0x16a855,null));};exports[_0xcbc9('0x44')]=function(_0x1eef26,_0xec71f1){var _0x109f69={'raw':![],'where':{'id':_0x1eef26[_0xcbc9('0x45')]['id']}},_0x53141e={};_0x53141e[_0xcbc9('0x30')]=_[_0xcbc9('0x32')](db[_0xcbc9('0x2d')][_0xcbc9('0x46')]);_0x53141e['query']=_[_0xcbc9('0x32')](_0x1eef26['query']);_0x53141e[_0xcbc9('0x3c')]=_[_0xcbc9('0x34')](_0x53141e[_0xcbc9('0x30')],_0x53141e[_0xcbc9('0x33')]);_0x109f69[_0xcbc9('0x35')]=_['intersection'](_0x53141e[_0xcbc9('0x30')],qs['fields'](_0x1eef26['query'][_0xcbc9('0x36')]));_0x109f69[_0xcbc9('0x35')]=_0x109f69['attributes'][_0xcbc9('0x37')]?_0x109f69['attributes']:_0x53141e[_0xcbc9('0x30')];if(_0x1eef26['query']['includeAll']){_0x109f69[_0xcbc9('0x41')]=[{'all':!![]}];}_0x109f69=_['merge']({},_0x109f69,_0x1eef26[_0xcbc9('0x3f')]);return db['ServicenowAccount'][_0xcbc9('0x47')](_0x109f69)['then'](handleEntityNotFound(_0xec71f1,null))[_0xcbc9('0x27')](respondWithResult(_0xec71f1,null))[_0xcbc9('0x48')](handleError(_0xec71f1,null));};exports[_0xcbc9('0x49')]=function(_0x294c87,_0x2ac8c5){return db['ServicenowAccount']['create'](_0x294c87['body'],{})[_0xcbc9('0x27')](respondWithResult(_0x2ac8c5,0xc9))[_0xcbc9('0x48')](handleError(_0x2ac8c5,null));};exports[_0xcbc9('0x26')]=function(_0x142daf,_0x4a5167){if(_0x142daf[_0xcbc9('0x4a')]['id']){delete _0x142daf[_0xcbc9('0x4a')]['id'];}return db[_0xcbc9('0x2d')]['find']({'where':{'id':_0x142daf[_0xcbc9('0x45')]['id']}})[_0xcbc9('0x27')](handleEntityNotFound(_0x4a5167,null))[_0xcbc9('0x27')](saveUpdates(_0x142daf[_0xcbc9('0x4a')],null))['then'](respondWithResult(_0x4a5167,null))[_0xcbc9('0x48')](handleError(_0x4a5167,null));};exports['destroy']=function(_0x422703,_0x57c227){return db[_0xcbc9('0x2d')][_0xcbc9('0x47')]({'where':{'id':_0x422703[_0xcbc9('0x45')]['id']}})[_0xcbc9('0x27')](handleEntityNotFound(_0x57c227,null))[_0xcbc9('0x27')](removeEntity(_0x57c227,null))['catch'](handleError(_0x57c227,null));};exports[_0xcbc9('0x4b')]=function(_0x405634,_0x42f764,_0x409cf8){var _0x5e39cb={};var _0x535f78={};var _0x5a756f;var _0x50b96e;return db[_0xcbc9('0x2d')]['findOne']({'where':{'id':_0x405634[_0xcbc9('0x45')]['id']}})[_0xcbc9('0x27')](handleEntityNotFound(_0x42f764,null))[_0xcbc9('0x27')](function(_0x5c9548){if(_0x5c9548){_0x5a756f=_0x5c9548;_0x535f78['model']=_[_0xcbc9('0x32')](db[_0xcbc9('0x4c')][_0xcbc9('0x46')]);_0x535f78[_0xcbc9('0x33')]=_[_0xcbc9('0x32')](_0x405634[_0xcbc9('0x33')]);_0x535f78[_0xcbc9('0x3c')]=_[_0xcbc9('0x34')](_0x535f78['model'],_0x535f78[_0xcbc9('0x33')]);_0x5e39cb[_0xcbc9('0x35')]=_[_0xcbc9('0x34')](_0x535f78[_0xcbc9('0x30')],qs[_0xcbc9('0x36')](_0x405634[_0xcbc9('0x33')][_0xcbc9('0x36')]));_0x5e39cb[_0xcbc9('0x35')]=_0x5e39cb[_0xcbc9('0x35')][_0xcbc9('0x37')]?_0x5e39cb['attributes']:_0x535f78[_0xcbc9('0x30')];_0x5e39cb['order']=qs[_0xcbc9('0x39')](_0x405634['query'][_0xcbc9('0x39')]);_0x5e39cb['where']=qs['filters'](_[_0xcbc9('0x3b')](_0x405634['query'],_0x535f78[_0xcbc9('0x3c')]));if(_0x405634[_0xcbc9('0x33')][_0xcbc9('0x3d')]){_0x5e39cb[_0xcbc9('0x3a')]=_[_0xcbc9('0x3e')](_0x5e39cb[_0xcbc9('0x3a')],{'$or':_[_0xcbc9('0x31')](_0x5e39cb['attributes'],function(_0x440a97){var _0x4a5117={};_0x4a5117[_0x440a97]={'$like':'%'+_0x405634[_0xcbc9('0x33')][_0xcbc9('0x3d')]+'%'};return _0x4a5117;})});}_0x5e39cb=_[_0xcbc9('0x3e')]({},_0x5e39cb,_0x405634[_0xcbc9('0x3f')]);return _0x5a756f[_0xcbc9('0x4b')](_0x5e39cb);}})[_0xcbc9('0x27')](function(_0x1b7eb1){if(_0x1b7eb1){_0x50b96e=_0x1b7eb1['length'];if(!_0x405634['query']['hasOwnProperty']('nolimit')){_0x5e39cb[_0xcbc9('0x20')]=qs[_0xcbc9('0x20')](_0x405634[_0xcbc9('0x33')]['limit']);_0x5e39cb[_0xcbc9('0x1e')]=qs[_0xcbc9('0x1e')](_0x405634[_0xcbc9('0x33')][_0xcbc9('0x1e')]);}return _0x5a756f['getConfigurations'](_0x5e39cb);}})[_0xcbc9('0x27')](function(_0x1f6118){if(_0x1f6118){return _0x1f6118?{'count':_0x50b96e,'rows':_0x1f6118}:null;}})[_0xcbc9('0x27')](respondWithResult(_0x42f764,null))['catch'](handleError(_0x42f764,null));};exports[_0xcbc9('0x4d')]=function(_0x133dda,_0x2a8fee,_0x44d28f){if(_0x133dda[_0xcbc9('0x4a')]['id']){delete _0x133dda[_0xcbc9('0x4a')]['id'];}return db[_0xcbc9('0x2d')][_0xcbc9('0x4e')]({'where':{'id':_0x133dda[_0xcbc9('0x45')]['id']}})[_0xcbc9('0x27')](handleEntityNotFound(_0x2a8fee,null))[_0xcbc9('0x27')](function(_0x532e09){if(_0x532e09){_0x133dda[_0xcbc9('0x4a')][_0xcbc9('0x4f')]=_0x532e09['id'];_0x133dda[_0xcbc9('0x4a')][_0xcbc9('0x50')]=integrations['getSubjects'](_0x133dda[_0xcbc9('0x4a')][_0xcbc9('0x51')],_0x133dda[_0xcbc9('0x4a')]['type']);_0x133dda['body'][_0xcbc9('0x52')]=integrations[_0xcbc9('0x53')](_0x133dda[_0xcbc9('0x4a')]['channel'],_0x133dda[_0xcbc9('0x4a')][_0xcbc9('0x2f')]);return db['ServicenowConfiguration'][_0xcbc9('0x49')](_0x133dda[_0xcbc9('0x4a')],{'include':[{'model':db[_0xcbc9('0x54')],'as':'Subjects'},{'model':db[_0xcbc9('0x54')],'as':_0xcbc9('0x52')}]});}return null;})['then'](respondWithResult(_0x2a8fee,null))['catch'](handleError(_0x2a8fee,null));};exports[_0xcbc9('0x55')]=function(_0x4e2eab,_0x5890eb,_0x255e6d){var _0x19f15f=[_0xcbc9('0x56'),_0xcbc9('0x57'),_0xcbc9('0x58'),_0xcbc9('0x59'),_0xcbc9('0x5a'),_0xcbc9('0x5b'),_0xcbc9('0x5c'),'severity',_0xcbc9('0x5d')];var _0xf3b649=['parent','made_sla',_0xcbc9('0x5e'),'watch_list',_0xcbc9('0x5f'),_0xcbc9('0x60'),_0xcbc9('0x61'),_0xcbc9('0x57'),_0xcbc9('0x62'),_0xcbc9('0x63'),_0xcbc9('0x64'),'sys_updated_by',_0xcbc9('0x65'),'user_input',_0xcbc9('0x66'),_0xcbc9('0x67'),_0xcbc9('0x68'),'sys_created_by',_0xcbc9('0x58'),_0xcbc9('0x69'),'calendar_stc',_0xcbc9('0x6a'),_0xcbc9('0x6b'),_0xcbc9('0x6c'),_0xcbc9('0x6d'),_0xcbc9('0x6e'),_0xcbc9('0x6f'),_0xcbc9('0x70'),_0xcbc9('0x71'),'sys_domain_path',_0xcbc9('0x72'),'time_worked',_0xcbc9('0x73'),_0xcbc9('0x74'),_0xcbc9('0x75'),_0xcbc9('0x76'),_0xcbc9('0x77'),_0xcbc9('0x78'),_0xcbc9('0x79'),_0xcbc9('0x7a'),_0xcbc9('0x7b'),_0xcbc9('0x59'),_0xcbc9('0x7c'),_0xcbc9('0x7d'),_0xcbc9('0x5a'),'correlation_display',_0xcbc9('0x7e'),_0xcbc9('0x7f'),'assignment_group',_0xcbc9('0x80'),_0xcbc9('0x81'),_0xcbc9('0x82'),'calendar_duration',_0xcbc9('0x5b'),_0xcbc9('0x83'),_0xcbc9('0x84'),_0xcbc9('0x85'),'follow_up',_0xcbc9('0x86'),_0xcbc9('0x87'),_0xcbc9('0x88'),_0xcbc9('0x89'),_0xcbc9('0x5c'),_0xcbc9('0x8a'),_0xcbc9('0x8b'),_0xcbc9('0x8c'),_0xcbc9('0x8d'),_0xcbc9('0x8e'),_0xcbc9('0x8f'),_0xcbc9('0x90'),'comments',_0xcbc9('0x91'),'approval',_0xcbc9('0x92'),_0xcbc9('0x93'),_0xcbc9('0x94'),_0xcbc9('0x95'),_0xcbc9('0x96'),_0xcbc9('0x97'),_0xcbc9('0x98'),_0xcbc9('0x99'),_0xcbc9('0x9a'),_0xcbc9('0x5d')];var _0x55a4fa='';var _0x1b7f6f='';var _0x2126a7=[];var _0x100946='';var _0x3bc123='';var _0x3d379f=[];var _0x3ee222='';var _0x54018c='';var _0x1ff782={};var _0x58f8f1='';return db[_0xcbc9('0x2d')][_0xcbc9('0x4e')]({'where':{'id':_0x4e2eab[_0xcbc9('0x45')]['id']},'attributes':['id',_0xcbc9('0x9b'),_0xcbc9('0x9c'),'email',_0xcbc9('0x9d'),_0xcbc9('0x9e')]})[_0xcbc9('0x27')](handleEntityNotFound(_0x5890eb,null))[_0xcbc9('0x27')](function(_0x55a4db){if(_0x55a4db){_0x58f8f1=_0x55a4db['remoteUri'];var _0x7d9332=_0x58f8f1[_0xcbc9('0x9f')](-0x1);if(_0x7d9332==='/'){_0x58f8f1=_0x58f8f1[_0xcbc9('0xa0')](0x0,_0x58f8f1[_0xcbc9('0xa1')](_0x7d9332));}_0x54018c=util[_0xcbc9('0xa2')]('%s/api/now/doc/table/schema/',_0x58f8f1);_0x3ee222=util[_0xcbc9('0xa2')](_0xcbc9('0xa3'),_0x58f8f1);_0x1ff782={'user':_0x55a4db[_0xcbc9('0x9b')],'pass':_0x55a4db[_0xcbc9('0x9c')]};var _0x5141d3={'method':_0xcbc9('0xa4'),'uri':_0x54018c+'incident?sysparm_display_value=all','auth':_0x1ff782,'json':!![]};return rp(_0x5141d3);}})[_0xcbc9('0x27')](function(_0x29e401){if(_0x29e401[_0xcbc9('0xa5')][_0xcbc9('0x37')]>0x0){_0x55a4fa=_0x29e401['result'];}console[_0xcbc9('0xa6')](_0xcbc9('0xa7'),_0x55a4fa);_0x3d379f=[];_0x1b7f6f=Object[_0xcbc9('0xa8')]([],_0x55a4fa);_['remove'](_0x1b7f6f,function(_0x3d0447){return!_0x19f15f['includes'](_0x3d0447[_0xcbc9('0x2b')]);});_0x1b7f6f[_0xcbc9('0xa9')](function(_0x79007){var _0x4971f0=createFieldObject(_0x3ee222,_0x1ff782,_0x79007[_0xcbc9('0xaa')],_0x79007[_0xcbc9('0x2b')],_0x79007[_0xcbc9('0xab')],![]);_0x3d379f['push'](_0x4971f0);});return Promise[_0xcbc9('0xac')](_0x3d379f);})[_0xcbc9('0x27')](function(_0x4ae3a3){_0x2126a7=_0x4ae3a3;_0x100946=Object['assign']([],_0x55a4fa);console[_0xcbc9('0xa6')](_0xcbc9('0xad'),_0x55a4fa);_[_0xcbc9('0xae')](_0x100946,function(_0x43e9de){return _0xf3b649[_0xcbc9('0xaf')](_0x43e9de[_0xcbc9('0x2b')]);});console[_0xcbc9('0xa6')](_0xcbc9('0xb0'),_0x100946);_0x3d379f=[];_0x100946[_0xcbc9('0xa9')](function(_0x246af4){var _0x195695=createFieldObject(_0x3ee222,_0x1ff782,_0x246af4[_0xcbc9('0xaa')],_0x246af4['name'],_0x246af4['label'],!![]);_0x3d379f[_0xcbc9('0xb1')](_0x195695);});return Promise[_0xcbc9('0xac')](_0x3d379f);})['then'](function(_0x1ca6d5){_0x3bc123=_0x1ca6d5;var _0x5dae89=_0x2126a7['concat'](_0x3bc123);return{'count':_0x5dae89[_0xcbc9('0x37')],'rows':_0x5dae89};})[_0xcbc9('0x27')](respondWithResult(_0x5890eb,null))[_0xcbc9('0x48')](function(_0x55f8fb){console[_0xcbc9('0xa6')](_0xcbc9('0xb2')+_0x55f8fb);var _0x29b2ab=_0x4e2eab[_0xcbc9('0x33')][_0xcbc9('0xb3')]?0x1f4:_0x55f8fb[_0xcbc9('0xb4')]||0x1f4;logger['error'](_0x55f8fb[_0xcbc9('0x2a')]);delete _0x55f8fb[_0xcbc9('0x2b')];if(_0x29b2ab===0x191){_0x29b2ab=0x190;}_0x5890eb[_0xcbc9('0x1c')](_0x29b2ab)[_0xcbc9('0x2c')](_0x4e2eab[_0xcbc9('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x55f8fb[_0xcbc9('0xb4')]}:_0x55f8fb);});};function createFieldObject(_0x25e6ac,_0xb4e736,_0xc50c21,_0x441f41,_0x3383b3,_0x4cf943){return new Promise(function(_0x2b5f2e,_0x2d03c2){var _0x36949d={'id':_0x441f41,'name':_0x3383b3,'custom':_0x4cf943};if(_0xc50c21===_0xcbc9('0xb5')){_0x36949d['options']=[{'name':'True','value':'true'},{'name':'False','value':'false'}];_0x2b5f2e(_0x36949d);}else{var _0x995bc5={'method':_0xcbc9('0xa4'),'uri':_0x25e6ac+_0xcbc9('0xb6')+_0x441f41,'auth':_0xb4e736,'json':!![]};return rp(_0x995bc5)['then'](function(_0x43dfd5){var _0x77fe29=[];if(_0x43dfd5['result']['length']>0x0){_0x43dfd5[_0xcbc9('0xa5')][_0xcbc9('0xa9')](function(_0x273e7d){if(_0x273e7d[_0xcbc9('0xb7')]===_0xcbc9('0xb8')){var _0x1a747a={'name':_0x273e7d[_0xcbc9('0xab')],'value':_0x273e7d[_0xcbc9('0xb9')]};_0x77fe29[_0xcbc9('0xb1')](_0x1a747a);}});}_0x36949d['options']=_0x77fe29;if(_0x36949d[_0xcbc9('0x3f')][_0xcbc9('0x37')]>0x0){_0x2b5f2e(_0x36949d);}else{if(_0x4cf943==![]){_0x2b5f2e();}else{_0x2b5f2e(_0x36949d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3d8ce13..4ccc638 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 _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x4a9328,_0x4ef3fd){var _0x43c0a1=function(_0x50ddb5){while(--_0x50ddb5){_0x4a9328['push'](_0x4a9328['shift']());}};_0x43c0a1(++_0x4ef3fd);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));var integrations=require(_0x7721('0x8'));module[_0x7721('0x9')]=function(_0xb239e0,_0xf7ff37){return _0xb239e0[_0x7721('0xa')](_0x7721('0xb'),attributes,{'tableName':_0x7721('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x35b2a1,_0x4cdca8){var _0x6023da=function(_0x10cd9f){while(--_0x10cd9f){_0x35b2a1['push'](_0x35b2a1['shift']());}};_0x6023da(++_0x4cdca8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x46123b,_0x56504f){_0x46123b=_0x46123b-0x0;var _0x112994=_0x1cb9[_0x46123b];return _0x112994;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('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 8c0ed8d..f8c167a 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 _0xd7d2=['client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetServicenowAccount','ServicenowAccount','options','raw','where','include','map','model','attributes','catch','ShowServicenowAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7d2,0xf7));var _0x2d7d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd7d2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2d7d('0x0'));var util=require('util');var moment=require(_0x2d7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d7d('0x2'));var fs=require('fs');var Redis=require(_0x2d7d('0x3'));var db=require(_0x2d7d('0x4'))['db'];var utils=require(_0x2d7d('0x5'));var logger=require(_0x2d7d('0x6'))(_0x2d7d('0x7'));var config=require('../../config/environment');var jayson=require(_0x2d7d('0x8'));var client=jayson[_0x2d7d('0x9')][_0x2d7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x259ea3,_0x1aa14b,_0x82b17c){return new BPromise(function(_0x10aed6,_0x443a76){return client[_0x2d7d('0xb')](_0x259ea3,_0x82b17c)[_0x2d7d('0xc')](function(_0x3a1c79){logger[_0x2d7d('0xd')](_0x2d7d('0xe'),_0x1aa14b,_0x2d7d('0xf'));logger[_0x2d7d('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1aa14b,_0x2d7d('0xf'),JSON[_0x2d7d('0x11')](_0x3a1c79));if(_0x3a1c79[_0x2d7d('0x12')]){if(_0x3a1c79[_0x2d7d('0x12')][_0x2d7d('0x13')]===0x1f4){logger[_0x2d7d('0x12')](_0x2d7d('0xe'),_0x1aa14b,_0x3a1c79[_0x2d7d('0x12')][_0x2d7d('0x14')]);return _0x443a76(_0x3a1c79[_0x2d7d('0x12')][_0x2d7d('0x14')]);}logger[_0x2d7d('0x12')](_0x2d7d('0xe'),_0x1aa14b,_0x3a1c79[_0x2d7d('0x12')][_0x2d7d('0x14')]);return _0x10aed6(_0x3a1c79[_0x2d7d('0x12')][_0x2d7d('0x14')]);}else{logger['info'](_0x2d7d('0xe'),_0x1aa14b,_0x2d7d('0xf'));_0x10aed6(_0x3a1c79['result'][_0x2d7d('0x14')]);}})['catch'](function(_0x8157d5){logger[_0x2d7d('0x12')](_0x2d7d('0xe'),_0x1aa14b,_0x8157d5);_0x443a76(_0x8157d5);});});}exports[_0x2d7d('0x15')]=function(_0x52bae1){var _0x8cf5d2=this;return new Promise(function(_0x428b5c,_0x9d6ea3){return db[_0x2d7d('0x16')]['findAll']({'raw':_0x52bae1[_0x2d7d('0x17')]?_0x52bae1[_0x2d7d('0x17')][_0x2d7d('0x18')]===undefined?!![]:![]:!![],'where':_0x52bae1[_0x2d7d('0x17')]?_0x52bae1[_0x2d7d('0x17')][_0x2d7d('0x19')]||null:null,'attributes':_0x52bae1[_0x2d7d('0x17')]?_0x52bae1[_0x2d7d('0x17')]['attributes']||null:null,'limit':_0x52bae1[_0x2d7d('0x17')]?_0x52bae1[_0x2d7d('0x17')]['limit']||null:null,'include':_0x52bae1[_0x2d7d('0x17')]?_0x52bae1[_0x2d7d('0x17')][_0x2d7d('0x1a')]?_[_0x2d7d('0x1b')](_0x52bae1[_0x2d7d('0x17')]['include'],function(_0x4882a2){return{'model':db[_0x4882a2[_0x2d7d('0x1c')]],'as':_0x4882a2['as'],'attributes':_0x4882a2[_0x2d7d('0x1d')],'include':_0x4882a2[_0x2d7d('0x1a')]?_[_0x2d7d('0x1b')](_0x4882a2[_0x2d7d('0x1a')],function(_0x724e15){return{'model':db[_0x724e15[_0x2d7d('0x1c')]],'as':_0x724e15['as'],'attributes':_0x724e15[_0x2d7d('0x1d')],'include':_0x724e15['include']?_[_0x2d7d('0x1b')](_0x724e15['include'],function(_0x1d29aa){return{'model':db[_0x1d29aa['model']],'as':_0x1d29aa['as'],'attributes':_0x1d29aa[_0x2d7d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43af68){logger[_0x2d7d('0xd')]('GetServicenowAccount',_0x52bae1);logger['debug']('GetServicenowAccount',_0x52bae1,JSON['stringify'](_0x43af68));_0x428b5c(_0x43af68);})[_0x2d7d('0x1e')](function(_0xc09257){logger['error'](_0x2d7d('0x15'),_0xc09257['message'],_0x52bae1);_0x9d6ea3(_0x8cf5d2[_0x2d7d('0x12')](0x1f4,_0xc09257[_0x2d7d('0x14')]));});});};exports[_0x2d7d('0x1f')]=function(_0x118014){var _0x433f51=this;return new Promise(function(_0x45fc64,_0x58e23d){return db[_0x2d7d('0x16')]['find']({'raw':_0x118014[_0x2d7d('0x17')]?_0x118014[_0x2d7d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x118014[_0x2d7d('0x17')]?_0x118014['options'][_0x2d7d('0x19')]||null:null,'attributes':_0x118014['options']?_0x118014[_0x2d7d('0x17')][_0x2d7d('0x1d')]||null:null,'include':_0x118014[_0x2d7d('0x17')]?_0x118014[_0x2d7d('0x17')][_0x2d7d('0x1a')]?_[_0x2d7d('0x1b')](_0x118014[_0x2d7d('0x17')][_0x2d7d('0x1a')],function(_0x34c06f){return{'model':db[_0x34c06f[_0x2d7d('0x1c')]],'as':_0x34c06f['as'],'attributes':_0x34c06f['attributes'],'include':_0x34c06f[_0x2d7d('0x1a')]?_['map'](_0x34c06f[_0x2d7d('0x1a')],function(_0xcd1040){return{'model':db[_0xcd1040[_0x2d7d('0x1c')]],'as':_0xcd1040['as'],'attributes':_0xcd1040[_0x2d7d('0x1d')],'include':_0xcd1040['include']?_[_0x2d7d('0x1b')](_0xcd1040[_0x2d7d('0x1a')],function(_0x4bf7c4){return{'model':db[_0x4bf7c4[_0x2d7d('0x1c')]],'as':_0x4bf7c4['as'],'attributes':_0x4bf7c4[_0x2d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2d7d('0xc')](function(_0xebbb7d){logger[_0x2d7d('0xd')](_0x2d7d('0x1f'),_0x118014);logger[_0x2d7d('0x10')]('ShowServicenowAccount',_0x118014,JSON[_0x2d7d('0x11')](_0xebbb7d));_0x45fc64(_0xebbb7d);})[_0x2d7d('0x1e')](function(_0x31df9f){logger[_0x2d7d('0x12')]('ShowServicenowAccount',_0x31df9f[_0x2d7d('0x14')],_0x118014);_0x58e23d(_0x433f51['error'](0x1f4,_0x31df9f[_0x2d7d('0x14')]));});});}; \ No newline at end of file +var _0x96ee=['limit','include','map','model','ShowServicenowAccount','ServicenowAccount','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','options','raw','where','attributes'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x96ee,0x1c1));var _0xe96e=function(_0x19be52,_0x417078){_0x19be52=_0x19be52-0x0;var _0x42dfd2=_0x96ee[_0x19be52];return _0x42dfd2;};'use strict';var _=require(_0xe96e('0x0'));var util=require(_0xe96e('0x1'));var moment=require(_0xe96e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe96e('0x3'));var fs=require('fs');var Redis=require(_0xe96e('0x4'));var db=require(_0xe96e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe96e('0x6'))(_0xe96e('0x7'));var config=require(_0xe96e('0x8'));var jayson=require(_0xe96e('0x9'));var client=jayson[_0xe96e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21bd3a,_0x22a957,_0xd39bbd){return new BPromise(function(_0x1d5daa,_0x458360){return client[_0xe96e('0xb')](_0x21bd3a,_0xd39bbd)['then'](function(_0x50b81b){logger[_0xe96e('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x22a957,_0xe96e('0xd'));logger[_0xe96e('0xe')](_0xe96e('0xf'),_0x22a957,_0xe96e('0xd'),JSON[_0xe96e('0x10')](_0x50b81b));if(_0x50b81b[_0xe96e('0x11')]){if(_0x50b81b['error']['code']===0x1f4){logger[_0xe96e('0x11')](_0xe96e('0x12'),_0x22a957,_0x50b81b['error'][_0xe96e('0x13')]);return _0x458360(_0x50b81b[_0xe96e('0x11')][_0xe96e('0x13')]);}logger['error'](_0xe96e('0x12'),_0x22a957,_0x50b81b['error']['message']);return _0x1d5daa(_0x50b81b[_0xe96e('0x11')][_0xe96e('0x13')]);}else{logger[_0xe96e('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x22a957,_0xe96e('0xd'));_0x1d5daa(_0x50b81b[_0xe96e('0x14')]['message']);}})[_0xe96e('0x15')](function(_0x33cdfe){logger[_0xe96e('0x11')](_0xe96e('0x12'),_0x22a957,_0x33cdfe);_0x458360(_0x33cdfe);});});}exports[_0xe96e('0x16')]=function(_0x1a1103){var _0x244329=this;return new Promise(function(_0x53aa0b,_0x23146e){return db['ServicenowAccount']['findAll']({'raw':_0x1a1103[_0xe96e('0x17')]?_0x1a1103[_0xe96e('0x17')][_0xe96e('0x18')]===undefined?!![]:![]:!![],'where':_0x1a1103[_0xe96e('0x17')]?_0x1a1103[_0xe96e('0x17')][_0xe96e('0x19')]||null:null,'attributes':_0x1a1103['options']?_0x1a1103['options'][_0xe96e('0x1a')]||null:null,'limit':_0x1a1103[_0xe96e('0x17')]?_0x1a1103[_0xe96e('0x17')][_0xe96e('0x1b')]||null:null,'include':_0x1a1103[_0xe96e('0x17')]?_0x1a1103[_0xe96e('0x17')][_0xe96e('0x1c')]?_[_0xe96e('0x1d')](_0x1a1103['options']['include'],function(_0x3324f8){return{'model':db[_0x3324f8['model']],'as':_0x3324f8['as'],'attributes':_0x3324f8[_0xe96e('0x1a')],'include':_0x3324f8[_0xe96e('0x1c')]?_[_0xe96e('0x1d')](_0x3324f8[_0xe96e('0x1c')],function(_0x50e6be){return{'model':db[_0x50e6be[_0xe96e('0x1e')]],'as':_0x50e6be['as'],'attributes':_0x50e6be[_0xe96e('0x1a')],'include':_0x50e6be['include']?_['map'](_0x50e6be[_0xe96e('0x1c')],function(_0x3339ce){return{'model':db[_0x3339ce['model']],'as':_0x3339ce['as'],'attributes':_0x3339ce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x319ffd){logger[_0xe96e('0xc')]('GetServicenowAccount',_0x1a1103);logger[_0xe96e('0xe')](_0xe96e('0x16'),_0x1a1103,JSON[_0xe96e('0x10')](_0x319ffd));_0x53aa0b(_0x319ffd);})[_0xe96e('0x15')](function(_0x47d645){logger[_0xe96e('0x11')]('GetServicenowAccount',_0x47d645[_0xe96e('0x13')],_0x1a1103);_0x23146e(_0x244329[_0xe96e('0x11')](0x1f4,_0x47d645[_0xe96e('0x13')]));});});};exports[_0xe96e('0x1f')]=function(_0x481a2f){var _0x32c567=this;return new Promise(function(_0x15d85e,_0x4db963){return db[_0xe96e('0x20')]['find']({'raw':_0x481a2f[_0xe96e('0x17')]?_0x481a2f['options'][_0xe96e('0x18')]===undefined?!![]:![]:!![],'where':_0x481a2f[_0xe96e('0x17')]?_0x481a2f[_0xe96e('0x17')]['where']||null:null,'attributes':_0x481a2f[_0xe96e('0x17')]?_0x481a2f[_0xe96e('0x17')][_0xe96e('0x1a')]||null:null,'include':_0x481a2f[_0xe96e('0x17')]?_0x481a2f[_0xe96e('0x17')][_0xe96e('0x1c')]?_[_0xe96e('0x1d')](_0x481a2f['options']['include'],function(_0x254f4f){return{'model':db[_0x254f4f['model']],'as':_0x254f4f['as'],'attributes':_0x254f4f[_0xe96e('0x1a')],'include':_0x254f4f['include']?_[_0xe96e('0x1d')](_0x254f4f[_0xe96e('0x1c')],function(_0x236325){return{'model':db[_0x236325[_0xe96e('0x1e')]],'as':_0x236325['as'],'attributes':_0x236325[_0xe96e('0x1a')],'include':_0x236325['include']?_[_0xe96e('0x1d')](_0x236325['include'],function(_0x299dd4){return{'model':db[_0x299dd4[_0xe96e('0x1e')]],'as':_0x299dd4['as'],'attributes':_0x299dd4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe96e('0x21')](function(_0xf04724){logger[_0xe96e('0xc')]('ShowServicenowAccount',_0x481a2f);logger['debug'](_0xe96e('0x1f'),_0x481a2f,JSON['stringify'](_0xf04724));_0x15d85e(_0xf04724);})['catch'](function(_0x11775c){logger['error'](_0xe96e('0x1f'),_0x11775c['message'],_0x481a2f);_0x4db963(_0x32c567['error'](0x1f4,_0x11775c['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index e6d7305..b872b2a 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 _0xef2a=['fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','destroy','multer','path','connect-timeout','Router'];(function(_0xcc04c2,_0x5d13cf){var _0x24c46b=function(_0xcec449){while(--_0xcec449){_0xcc04c2['push'](_0xcc04c2['shift']());}};_0x24c46b(++_0x5d13cf);}(_0xef2a,0x1df));var _0xaef2=function(_0x20afd6,_0x21c25e){_0x20afd6=_0x20afd6-0x0;var _0x3e7aa1=_0xef2a[_0x20afd6];return _0x3e7aa1;};'use strict';var multer=require(_0xaef2('0x0'));var util=require('util');var path=require(_0xaef2('0x1'));var timeout=require(_0xaef2('0x2'));var express=require('express');var router=express[_0xaef2('0x3')]();var fs_extra=require(_0xaef2('0x4'));var auth=require(_0xaef2('0x5'));var interaction=require(_0xaef2('0x6'));var config=require('../../config/environment');var controller=require(_0xaef2('0x7'));router[_0xaef2('0x8')]('/',auth[_0xaef2('0x9')](),controller['index']);router[_0xaef2('0x8')]('/:id',auth[_0xaef2('0x9')](),controller[_0xaef2('0xa')]);router[_0xaef2('0x8')](_0xaef2('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xaef2('0x8')](_0xaef2('0xc'),auth[_0xaef2('0x9')](),controller[_0xaef2('0xd')]);router['get'](_0xaef2('0xe'),auth[_0xaef2('0x9')](),controller[_0xaef2('0xf')]);router[_0xaef2('0x10')]('/',auth[_0xaef2('0x9')](),controller[_0xaef2('0x11')]);router[_0xaef2('0x12')](_0xaef2('0x13'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xaef2('0x9')](),controller[_0xaef2('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3d74=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy'];(function(_0x1ab159,_0x48fa7b){var _0x1280e9=function(_0x3daa49){while(--_0x3daa49){_0x1ab159['push'](_0x1ab159['shift']());}};_0x1280e9(++_0x48fa7b);}(_0x3d74,0xe2));var _0x43d7=function(_0x89fe9f,_0x4115a9){_0x89fe9f=_0x89fe9f-0x0;var _0x1a965f=_0x3d74[_0x89fe9f];return _0x1a965f;};'use strict';var multer=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var path=require(_0x43d7('0x2'));var timeout=require(_0x43d7('0x3'));var express=require(_0x43d7('0x4'));var router=express[_0x43d7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x43d7('0x6'));var interaction=require(_0x43d7('0x7'));var config=require('../../config/environment');var controller=require(_0x43d7('0x8'));router['get']('/',auth[_0x43d7('0x9')](),controller[_0x43d7('0xa')]);router[_0x43d7('0xb')](_0x43d7('0xc'),auth[_0x43d7('0x9')](),controller[_0x43d7('0xd')]);router['get'](_0x43d7('0xe'),auth['isAuthenticated'](),controller[_0x43d7('0xf')]);router[_0x43d7('0xb')](_0x43d7('0x10'),auth[_0x43d7('0x9')](),controller['getSubjects']);router[_0x43d7('0xb')](_0x43d7('0x11'),auth[_0x43d7('0x9')](),controller[_0x43d7('0x12')]);router[_0x43d7('0x13')]('/',auth[_0x43d7('0x9')](),controller[_0x43d7('0x14')]);router[_0x43d7('0x15')](_0x43d7('0xc'),auth[_0x43d7('0x9')](),controller['update']);router[_0x43d7('0x16')](_0x43d7('0xc'),auth['isAuthenticated'](),controller[_0x43d7('0x17')]);module[_0x43d7('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 9bcd46c..4e09021 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 _0x99ab=['STRING','sequelize'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x99ab,0x1d9));var _0xb99a=function(_0x502d5a,_0x3ef88e){_0x502d5a=_0x502d5a-0x0;var _0x346217=_0x99ab[_0x502d5a];return _0x346217;};'use strict';var Sequelize=require(_0xb99a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb99a('0x1')]},'description':{'type':Sequelize[_0xb99a('0x1')]}}; \ No newline at end of file +var _0x6d86=['sequelize','exports','STRING'];(function(_0x599cf2,_0x26f37e){var _0x53d6c2=function(_0x557060){while(--_0x557060){_0x599cf2['push'](_0x599cf2['shift']());}};_0x53d6c2(++_0x26f37e);}(_0x6d86,0x9c));var _0x66d8=function(_0x5c147d,_0x27a036){_0x5c147d=_0x5c147d-0x0;var _0x491168=_0x6d86[_0x5c147d];return _0x491168;};'use strict';var Sequelize=require(_0x66d8('0x0'));module[_0x66d8('0x1')]={'name':{'type':Sequelize[_0x66d8('0x2')]},'description':{'type':Sequelize[_0x66d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 2384300..1c79b8e 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 _0x182b=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','findAll','rows','catch','find','create','body','params','pick','getFields','getSubjects','findOne','ServicenowField','rawAttributes','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1b2b84,_0x3ccde4){var _0x4044b7=function(_0x33af42){while(--_0x33af42){_0x1b2b84['push'](_0x1b2b84['shift']());}};_0x4044b7(++_0x3ccde4);}(_0x182b,0x17c));var _0xb182=function(_0x54921e,_0x228f69){_0x54921e=_0x54921e-0x0;var _0x2c3ea7=_0x182b[_0x54921e];return _0x2c3ea7;};'use strict';var emlformat=require(_0xb182('0x0'));var rimraf=require(_0xb182('0x1'));var zipdir=require(_0xb182('0x2'));var jsonpatch=require(_0xb182('0x3'));var rp=require(_0xb182('0x4'));var moment=require(_0xb182('0x5'));var BPromise=require(_0xb182('0x6'));var Mustache=require('mustache');var util=require(_0xb182('0x7'));var path=require(_0xb182('0x8'));var sox=require('sox');var csv=require(_0xb182('0x9'));var ejs=require(_0xb182('0xa'));var fs=require('fs');var fs_extra=require(_0xb182('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb182('0xc'));var jsforce=require(_0xb182('0xd'));var deskjs=require(_0xb182('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb182('0xf'));var Papa=require(_0xb182('0x10'));var Redis=require(_0xb182('0x11'));var authService=require(_0xb182('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb182('0x13'));var logger=require(_0xb182('0x14'))(_0xb182('0x15'));var utils=require(_0xb182('0x16'));var config=require(_0xb182('0x17'));var licenseUtil=require(_0xb182('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd413e,_0x6bb590){_0x6bb590=_0x6bb590||0xcc;return function(_0x15183e){if(_0x15183e){return _0xcd413e[_0xb182('0x19')](_0x6bb590);}return _0xcd413e['status'](_0x6bb590)[_0xb182('0x1a')]();};}function respondWithResult(_0x2811ad,_0x2b0bc9){_0x2b0bc9=_0x2b0bc9||0xc8;return function(_0x1a7e50){if(_0x1a7e50){return _0x2811ad[_0xb182('0x1b')](_0x2b0bc9)[_0xb182('0x1c')](_0x1a7e50);}};}function respondWithFilteredResult(_0x27b58f,_0x21917d){return function(_0x4c5829){if(_0x4c5829){var _0x2ef943=typeof _0x21917d[_0xb182('0x1d')]===_0xb182('0x1e')&&typeof _0x21917d[_0xb182('0x1f')]==='undefined';var _0x3d9849=_0x4c5829[_0xb182('0x20')];var _0x39d4cc=_0x2ef943?0x0:_0x21917d[_0xb182('0x1d')];var _0x45fe73=_0x2ef943?_0x4c5829[_0xb182('0x20')]:_0x21917d[_0xb182('0x1d')]+_0x21917d[_0xb182('0x1f')];var _0x585b0b;if(_0x45fe73>=_0x3d9849){_0x45fe73=_0x3d9849;_0x585b0b=0xc8;}else{_0x585b0b=0xce;}_0x27b58f[_0xb182('0x1b')](_0x585b0b);return _0x27b58f[_0xb182('0x21')]('Content-Range',_0x39d4cc+'-'+_0x45fe73+'/'+_0x3d9849)[_0xb182('0x1c')](_0x4c5829);}return null;};}function patchUpdates(_0x136546){return function(_0x1801cf){try{jsonpatch[_0xb182('0x22')](_0x1801cf,_0x136546,!![]);}catch(_0x17735e){return BPromise['reject'](_0x17735e);}return _0x1801cf[_0xb182('0x23')]();};}function saveUpdates(_0x535e3c,_0x34564c){return function(_0x4066e9){if(_0x4066e9){return _0x4066e9[_0xb182('0x24')](_0x535e3c)[_0xb182('0x25')](function(_0x1d59a2){return _0x1d59a2;});}return null;};}function removeEntity(_0x4d39a9,_0xd680e1){return function(_0x1aa606){if(_0x1aa606){return _0x1aa606[_0xb182('0x26')]()['then'](function(){_0x4d39a9[_0xb182('0x1b')](0xcc)[_0xb182('0x1a')]();});}};}function handleEntityNotFound(_0x174e2c,_0x370e95){return function(_0x41a7f3){if(!_0x41a7f3){_0x174e2c['sendStatus'](0x194);}return _0x41a7f3;};}function handleError(_0x150a34,_0x464524){_0x464524=_0x464524||0x1f4;return function(_0x418a57){logger[_0xb182('0x27')](_0x418a57[_0xb182('0x28')]);if(_0x418a57[_0xb182('0x29')]){delete _0x418a57['name'];}_0x150a34[_0xb182('0x1b')](_0x464524)[_0xb182('0x2a')](_0x418a57);};}exports[_0xb182('0x2b')]=function(_0x11bae7,_0x4a0f0f){var _0x29937b={},_0x39a985={},_0x6ba241={'count':0x0,'rows':[]};var _0x1f35de=_[_0xb182('0x2c')](db['ServicenowConfiguration']['rawAttributes'],function(_0x3f74c3){return{'name':_0x3f74c3[_0xb182('0x2d')],'type':_0x3f74c3[_0xb182('0x2e')][_0xb182('0x2f')]};});_0x39a985[_0xb182('0x30')]=_[_0xb182('0x2c')](_0x1f35de,'name');_0x39a985['query']=_[_0xb182('0x31')](_0x11bae7[_0xb182('0x32')]);_0x39a985[_0xb182('0x33')]=_[_0xb182('0x34')](_0x39a985[_0xb182('0x30')],_0x39a985[_0xb182('0x32')]);_0x29937b[_0xb182('0x35')]=_[_0xb182('0x34')](_0x39a985[_0xb182('0x30')],qs[_0xb182('0x36')](_0x11bae7[_0xb182('0x32')][_0xb182('0x36')]));_0x29937b[_0xb182('0x35')]=_0x29937b[_0xb182('0x35')][_0xb182('0x37')]?_0x29937b['attributes']:_0x39a985[_0xb182('0x30')];if(!_0x11bae7[_0xb182('0x32')][_0xb182('0x38')](_0xb182('0x39'))){_0x29937b[_0xb182('0x1f')]=qs[_0xb182('0x1f')](_0x11bae7[_0xb182('0x32')][_0xb182('0x1f')]);_0x29937b[_0xb182('0x1d')]=qs[_0xb182('0x1d')](_0x11bae7['query'][_0xb182('0x1d')]);}_0x29937b['order']=qs[_0xb182('0x3a')](_0x11bae7[_0xb182('0x32')]['sort']);_0x29937b[_0xb182('0x3b')]=qs[_0xb182('0x33')](_['pick'](_0x11bae7[_0xb182('0x32')],_0x39a985[_0xb182('0x33')]),_0x1f35de);if(_0x11bae7[_0xb182('0x32')][_0xb182('0x3c')]){_0x29937b[_0xb182('0x3b')]=_[_0xb182('0x3d')](_0x29937b[_0xb182('0x3b')],{'$or':_['map'](_0x1f35de,function(_0x370b5f){if(_0x370b5f['type']!==_0xb182('0x3e')){var _0x1d8e11={};_0x1d8e11[_0x370b5f[_0xb182('0x29')]]={'$like':'%'+_0x11bae7['query'][_0xb182('0x3c')]+'%'};return _0x1d8e11;}})});}_0x29937b=_['merge']({},_0x29937b,_0x11bae7[_0xb182('0x3f')]);var _0x4dd09b={'where':_0x29937b['where']};return db[_0xb182('0x40')][_0xb182('0x20')](_0x4dd09b)['then'](function(_0x282277){_0x6ba241['count']=_0x282277;if(_0x11bae7[_0xb182('0x32')][_0xb182('0x41')]){_0x29937b['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xb182('0x42')](_0x29937b);})[_0xb182('0x25')](function(_0x3b89f6){_0x6ba241[_0xb182('0x43')]=_0x3b89f6;return _0x6ba241;})[_0xb182('0x25')](respondWithFilteredResult(_0x4a0f0f,_0x29937b))[_0xb182('0x44')](handleError(_0x4a0f0f,null));};exports['show']=function(_0xa441e1,_0x2efa74){var _0x5b57d4={'raw':![],'where':{'id':_0xa441e1['params']['id']}},_0x4a9efd={};_0x4a9efd[_0xb182('0x30')]=_[_0xb182('0x31')](db['ServicenowConfiguration']['rawAttributes']);_0x4a9efd['query']=_[_0xb182('0x31')](_0xa441e1['query']);_0x4a9efd[_0xb182('0x33')]=_['intersection'](_0x4a9efd['model'],_0x4a9efd[_0xb182('0x32')]);_0x5b57d4[_0xb182('0x35')]=_[_0xb182('0x34')](_0x4a9efd[_0xb182('0x30')],qs[_0xb182('0x36')](_0xa441e1[_0xb182('0x32')][_0xb182('0x36')]));_0x5b57d4['attributes']=_0x5b57d4[_0xb182('0x35')][_0xb182('0x37')]?_0x5b57d4['attributes']:_0x4a9efd[_0xb182('0x30')];if(_0xa441e1[_0xb182('0x32')][_0xb182('0x41')]){_0x5b57d4['include']=[{'all':!![]}];}_0x5b57d4=_[_0xb182('0x3d')]({},_0x5b57d4,_0xa441e1[_0xb182('0x3f')]);return db[_0xb182('0x40')][_0xb182('0x45')](_0x5b57d4)[_0xb182('0x25')](handleEntityNotFound(_0x2efa74,null))['then'](respondWithResult(_0x2efa74,null))[_0xb182('0x44')](handleError(_0x2efa74,null));};exports[_0xb182('0x46')]=function(_0x3b8922,_0x555bdb){return db[_0xb182('0x40')][_0xb182('0x46')](_0x3b8922['body'],{})[_0xb182('0x25')](respondWithResult(_0x555bdb,0xc9))[_0xb182('0x44')](handleError(_0x555bdb,null));};exports[_0xb182('0x24')]=function(_0x100db3,_0x64e678){if(_0x100db3[_0xb182('0x47')]['id']){delete _0x100db3[_0xb182('0x47')]['id'];}return db[_0xb182('0x40')][_0xb182('0x45')]({'where':{'id':_0x100db3[_0xb182('0x48')]['id']}})['then'](handleEntityNotFound(_0x64e678,null))[_0xb182('0x25')](saveUpdates(_0x100db3[_0xb182('0x47')],null))[_0xb182('0x25')](respondWithResult(_0x64e678,null))[_0xb182('0x44')](handleError(_0x64e678,null));};exports['destroy']=function(_0x303a57,_0x544274){return db[_0xb182('0x40')][_0xb182('0x45')]({'where':{'id':_0x303a57['params']['id']}})[_0xb182('0x25')](handleEntityNotFound(_0x544274,null))[_0xb182('0x25')](removeEntity(_0x544274,null))[_0xb182('0x44')](handleError(_0x544274,null));};exports['getFields']=function(_0x2e4085,_0x16d057,_0x5a7375){var _0x2b15f2={};var _0x48ff7a={};var _0x473ef1;var _0x2d37ab;return db[_0xb182('0x40')]['findOne']({'where':{'id':_0x2e4085['params']['id']}})[_0xb182('0x25')](handleEntityNotFound(_0x16d057,null))[_0xb182('0x25')](function(_0x2d2b3f){if(_0x2d2b3f){_0x473ef1=_0x2d2b3f;_0x48ff7a[_0xb182('0x30')]=_[_0xb182('0x31')](db['ServicenowField']['rawAttributes']);_0x48ff7a[_0xb182('0x32')]=_[_0xb182('0x31')](_0x2e4085[_0xb182('0x32')]);_0x48ff7a[_0xb182('0x33')]=_[_0xb182('0x34')](_0x48ff7a[_0xb182('0x30')],_0x48ff7a[_0xb182('0x32')]);_0x2b15f2[_0xb182('0x35')]=_['intersection'](_0x48ff7a[_0xb182('0x30')],qs['fields'](_0x2e4085[_0xb182('0x32')][_0xb182('0x36')]));_0x2b15f2[_0xb182('0x35')]=_0x2b15f2[_0xb182('0x35')][_0xb182('0x37')]?_0x2b15f2[_0xb182('0x35')]:_0x48ff7a['model'];_0x2b15f2['order']=qs['sort'](_0x2e4085[_0xb182('0x32')]['sort']);_0x2b15f2[_0xb182('0x3b')]=qs[_0xb182('0x33')](_[_0xb182('0x49')](_0x2e4085[_0xb182('0x32')],_0x48ff7a[_0xb182('0x33')]));if(_0x2e4085['query'][_0xb182('0x3c')]){_0x2b15f2[_0xb182('0x3b')]=_['merge'](_0x2b15f2[_0xb182('0x3b')],{'$or':_[_0xb182('0x2c')](_0x2b15f2['attributes'],function(_0x52c77f){var _0x3ccb08={};_0x3ccb08[_0x52c77f]={'$like':'%'+_0x2e4085[_0xb182('0x32')]['filter']+'%'};return _0x3ccb08;})});}_0x2b15f2=_[_0xb182('0x3d')]({},_0x2b15f2,_0x2e4085[_0xb182('0x3f')]);return _0x473ef1[_0xb182('0x4a')](_0x2b15f2);}})[_0xb182('0x25')](function(_0x192d67){if(_0x192d67){_0x2d37ab=_0x192d67[_0xb182('0x37')];if(!_0x2e4085[_0xb182('0x32')]['hasOwnProperty'](_0xb182('0x39'))){_0x2b15f2[_0xb182('0x1f')]=qs[_0xb182('0x1f')](_0x2e4085[_0xb182('0x32')][_0xb182('0x1f')]);_0x2b15f2['offset']=qs[_0xb182('0x1d')](_0x2e4085[_0xb182('0x32')]['offset']);}return _0x473ef1[_0xb182('0x4a')](_0x2b15f2);}})[_0xb182('0x25')](function(_0x3b7db7){if(_0x3b7db7){return _0x3b7db7?{'count':_0x2d37ab,'rows':_0x3b7db7}:null;}})['then'](respondWithResult(_0x16d057,null))['catch'](handleError(_0x16d057,null));};exports[_0xb182('0x4b')]=function(_0x25d34d,_0x369596,_0x51d067){var _0x123da3={};var _0x410333={};var _0x140bdb;var _0x379834;return db[_0xb182('0x40')][_0xb182('0x4c')]({'where':{'id':_0x25d34d[_0xb182('0x48')]['id']}})[_0xb182('0x25')](handleEntityNotFound(_0x369596,null))['then'](function(_0x352ec7){if(_0x352ec7){_0x140bdb=_0x352ec7;_0x410333[_0xb182('0x30')]=_[_0xb182('0x31')](db[_0xb182('0x4d')][_0xb182('0x4e')]);_0x410333[_0xb182('0x32')]=_['keys'](_0x25d34d[_0xb182('0x32')]);_0x410333[_0xb182('0x33')]=_[_0xb182('0x34')](_0x410333[_0xb182('0x30')],_0x410333[_0xb182('0x32')]);_0x123da3['attributes']=_[_0xb182('0x34')](_0x410333['model'],qs[_0xb182('0x36')](_0x25d34d['query'][_0xb182('0x36')]));_0x123da3[_0xb182('0x35')]=_0x123da3[_0xb182('0x35')][_0xb182('0x37')]?_0x123da3[_0xb182('0x35')]:_0x410333[_0xb182('0x30')];_0x123da3[_0xb182('0x4f')]=qs[_0xb182('0x3a')](_0x25d34d['query'][_0xb182('0x3a')]);_0x123da3['where']=qs['filters'](_[_0xb182('0x49')](_0x25d34d[_0xb182('0x32')],_0x410333[_0xb182('0x33')]));if(_0x25d34d[_0xb182('0x32')][_0xb182('0x3c')]){_0x123da3[_0xb182('0x3b')]=_[_0xb182('0x3d')](_0x123da3['where'],{'$or':_[_0xb182('0x2c')](_0x123da3[_0xb182('0x35')],function(_0x4b9022){var _0x5ac36b={};_0x5ac36b[_0x4b9022]={'$like':'%'+_0x25d34d[_0xb182('0x32')]['filter']+'%'};return _0x5ac36b;})});}_0x123da3=_[_0xb182('0x3d')]({},_0x123da3,_0x25d34d[_0xb182('0x3f')]);return _0x140bdb['getSubjects'](_0x123da3);}})[_0xb182('0x25')](function(_0x312278){if(_0x312278){_0x379834=_0x312278[_0xb182('0x37')];if(!_0x25d34d[_0xb182('0x32')][_0xb182('0x38')]('nolimit')){_0x123da3[_0xb182('0x1f')]=qs[_0xb182('0x1f')](_0x25d34d['query'][_0xb182('0x1f')]);_0x123da3[_0xb182('0x1d')]=qs[_0xb182('0x1d')](_0x25d34d[_0xb182('0x32')][_0xb182('0x1d')]);}return _0x140bdb['getSubjects'](_0x123da3);}})[_0xb182('0x25')](function(_0x5c35ae){if(_0x5c35ae){return _0x5c35ae?{'count':_0x379834,'rows':_0x5c35ae}:null;}})[_0xb182('0x25')](respondWithResult(_0x369596,null))[_0xb182('0x44')](handleError(_0x369596,null));};exports['getDescriptions']=function(_0x82af87,_0xd5cb7c,_0x54ee76){var _0x5a3268={};var _0x43c58d={};var _0x27fe72;var _0x3df3bf;return db[_0xb182('0x40')][_0xb182('0x4c')]({'where':{'id':_0x82af87[_0xb182('0x48')]['id']}})[_0xb182('0x25')](handleEntityNotFound(_0xd5cb7c,null))[_0xb182('0x25')](function(_0x5440be){if(_0x5440be){_0x27fe72=_0x5440be;_0x43c58d[_0xb182('0x30')]=_[_0xb182('0x31')](db[_0xb182('0x4d')][_0xb182('0x4e')]);_0x43c58d['query']=_['keys'](_0x82af87[_0xb182('0x32')]);_0x43c58d[_0xb182('0x33')]=_['intersection'](_0x43c58d[_0xb182('0x30')],_0x43c58d[_0xb182('0x32')]);_0x5a3268[_0xb182('0x35')]=_['intersection'](_0x43c58d[_0xb182('0x30')],qs[_0xb182('0x36')](_0x82af87[_0xb182('0x32')][_0xb182('0x36')]));_0x5a3268[_0xb182('0x35')]=_0x5a3268[_0xb182('0x35')]['length']?_0x5a3268[_0xb182('0x35')]:_0x43c58d[_0xb182('0x30')];_0x5a3268['order']=qs[_0xb182('0x3a')](_0x82af87[_0xb182('0x32')][_0xb182('0x3a')]);_0x5a3268[_0xb182('0x3b')]=qs['filters'](_[_0xb182('0x49')](_0x82af87[_0xb182('0x32')],_0x43c58d[_0xb182('0x33')]));if(_0x82af87[_0xb182('0x32')]['filter']){_0x5a3268['where']=_[_0xb182('0x3d')](_0x5a3268[_0xb182('0x3b')],{'$or':_[_0xb182('0x2c')](_0x5a3268[_0xb182('0x35')],function(_0x389d7c){var _0x134659={};_0x134659[_0x389d7c]={'$like':'%'+_0x82af87['query']['filter']+'%'};return _0x134659;})});}_0x5a3268=_['merge']({},_0x5a3268,_0x82af87[_0xb182('0x3f')]);return _0x27fe72[_0xb182('0x50')](_0x5a3268);}})[_0xb182('0x25')](function(_0xdd1067){if(_0xdd1067){_0x3df3bf=_0xdd1067[_0xb182('0x37')];if(!_0x82af87[_0xb182('0x32')][_0xb182('0x38')]('nolimit')){_0x5a3268['limit']=qs['limit'](_0x82af87[_0xb182('0x32')][_0xb182('0x1f')]);_0x5a3268[_0xb182('0x1d')]=qs['offset'](_0x82af87[_0xb182('0x32')][_0xb182('0x1d')]);}return _0x27fe72[_0xb182('0x50')](_0x5a3268);}})[_0xb182('0x25')](function(_0x580ca8){if(_0x580ca8){return _0x580ca8?{'count':_0x3df3bf,'rows':_0x580ca8}:null;}})[_0xb182('0x25')](respondWithResult(_0xd5cb7c,null))[_0xb182('0x44')](handleError(_0xd5cb7c,null));}; \ No newline at end of file +var _0x1fa3=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','count','include','findAll','rows','catch','show','params','keys','intersection','includeAll','options','create','body','find','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x2702ec,_0x9ee11b){var _0x37bae4=function(_0x1c09da){while(--_0x1c09da){_0x2702ec['push'](_0x2702ec['shift']());}};_0x37bae4(++_0x9ee11b);}(_0x1fa3,0x188));var _0x31fa=function(_0x36f38d,_0x153a8e){_0x36f38d=_0x36f38d-0x0;var _0x10a871=_0x1fa3[_0x36f38d];return _0x10a871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31fa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31fa('0x1'));var rp=require(_0x31fa('0x2'));var moment=require(_0x31fa('0x3'));var BPromise=require(_0x31fa('0x4'));var Mustache=require(_0x31fa('0x5'));var util=require('util');var path=require(_0x31fa('0x6'));var sox=require('sox');var csv=require(_0x31fa('0x7'));var ejs=require(_0x31fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31fa('0x9'));var squel=require(_0x31fa('0xa'));var crypto=require(_0x31fa('0xb'));var jsforce=require(_0x31fa('0xc'));var deskjs=require(_0x31fa('0xd'));var toCsv=require(_0x31fa('0x7'));var querystring=require(_0x31fa('0xe'));var Papa=require(_0x31fa('0xf'));var Redis=require(_0x31fa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31fa('0x11'));var as=require(_0x31fa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31fa('0x13'))(_0x31fa('0x14'));var utils=require(_0x31fa('0x15'));var config=require(_0x31fa('0x16'));var licenseUtil=require(_0x31fa('0x17'));var db=require(_0x31fa('0x18'))['db'];function respondWithStatusCode(_0x1245ad,_0x303702){_0x303702=_0x303702||0xcc;return function(_0x2f7cee){if(_0x2f7cee){return _0x1245ad[_0x31fa('0x19')](_0x303702);}return _0x1245ad[_0x31fa('0x1a')](_0x303702)[_0x31fa('0x1b')]();};}function respondWithResult(_0x32ba50,_0x360616){_0x360616=_0x360616||0xc8;return function(_0x1a5071){if(_0x1a5071){return _0x32ba50[_0x31fa('0x1a')](_0x360616)[_0x31fa('0x1c')](_0x1a5071);}};}function respondWithFilteredResult(_0x129d22,_0x1c71fd){return function(_0x13952a){if(_0x13952a){var _0x47d253=typeof _0x1c71fd['offset']===_0x31fa('0x1d')&&typeof _0x1c71fd[_0x31fa('0x1e')]==='undefined';var _0x596f7a=_0x13952a['count'];var _0x98db41=_0x47d253?0x0:_0x1c71fd[_0x31fa('0x1f')];var _0xd7a178=_0x47d253?_0x13952a['count']:_0x1c71fd[_0x31fa('0x1f')]+_0x1c71fd['limit'];var _0x38b237;if(_0xd7a178>=_0x596f7a){_0xd7a178=_0x596f7a;_0x38b237=0xc8;}else{_0x38b237=0xce;}_0x129d22['status'](_0x38b237);return _0x129d22['set'](_0x31fa('0x20'),_0x98db41+'-'+_0xd7a178+'/'+_0x596f7a)[_0x31fa('0x1c')](_0x13952a);}return null;};}function patchUpdates(_0x136e0d){return function(_0x5b719b){try{jsonpatch[_0x31fa('0x21')](_0x5b719b,_0x136e0d,!![]);}catch(_0x400174){return BPromise[_0x31fa('0x22')](_0x400174);}return _0x5b719b['save']();};}function saveUpdates(_0x11db0b,_0x4c4b9b){return function(_0x4976d5){if(_0x4976d5){return _0x4976d5[_0x31fa('0x23')](_0x11db0b)[_0x31fa('0x24')](function(_0x254b07){return _0x254b07;});}return null;};}function removeEntity(_0x18d682,_0x3f0f89){return function(_0x4eba93){if(_0x4eba93){return _0x4eba93[_0x31fa('0x25')]()['then'](function(){_0x18d682[_0x31fa('0x1a')](0xcc)[_0x31fa('0x1b')]();});}};}function handleEntityNotFound(_0x227bd4,_0x3aa42f){return function(_0x1d709c){if(!_0x1d709c){_0x227bd4[_0x31fa('0x19')](0x194);}return _0x1d709c;};}function handleError(_0x39d0be,_0xdee27b){_0xdee27b=_0xdee27b||0x1f4;return function(_0x40b5c9){logger[_0x31fa('0x26')](_0x40b5c9[_0x31fa('0x27')]);if(_0x40b5c9['name']){delete _0x40b5c9[_0x31fa('0x28')];}_0x39d0be[_0x31fa('0x1a')](_0xdee27b)[_0x31fa('0x29')](_0x40b5c9);};}exports[_0x31fa('0x2a')]=function(_0x3a7cb1,_0x1d6e9d){var _0x502481={},_0x56bd42={},_0xe5a26={'count':0x0,'rows':[]};var _0x3fa1c4=_[_0x31fa('0x2b')](db[_0x31fa('0x2c')][_0x31fa('0x2d')],function(_0x4f21bc){return{'name':_0x4f21bc['fieldName'],'type':_0x4f21bc['type'][_0x31fa('0x2e')]};});_0x56bd42['model']=_[_0x31fa('0x2b')](_0x3fa1c4,_0x31fa('0x28'));_0x56bd42[_0x31fa('0x2f')]=_['keys'](_0x3a7cb1['query']);_0x56bd42[_0x31fa('0x30')]=_['intersection'](_0x56bd42[_0x31fa('0x31')],_0x56bd42[_0x31fa('0x2f')]);_0x502481['attributes']=_['intersection'](_0x56bd42[_0x31fa('0x31')],qs[_0x31fa('0x32')](_0x3a7cb1[_0x31fa('0x2f')][_0x31fa('0x32')]));_0x502481[_0x31fa('0x33')]=_0x502481[_0x31fa('0x33')][_0x31fa('0x34')]?_0x502481[_0x31fa('0x33')]:_0x56bd42['model'];if(!_0x3a7cb1[_0x31fa('0x2f')][_0x31fa('0x35')](_0x31fa('0x36'))){_0x502481[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x3a7cb1[_0x31fa('0x2f')]['limit']);_0x502481['offset']=qs['offset'](_0x3a7cb1[_0x31fa('0x2f')][_0x31fa('0x1f')]);}_0x502481[_0x31fa('0x37')]=qs['sort'](_0x3a7cb1['query'][_0x31fa('0x38')]);_0x502481[_0x31fa('0x39')]=qs[_0x31fa('0x30')](_['pick'](_0x3a7cb1['query'],_0x56bd42[_0x31fa('0x30')]),_0x3fa1c4);if(_0x3a7cb1[_0x31fa('0x2f')]['filter']){_0x502481[_0x31fa('0x39')]=_['merge'](_0x502481[_0x31fa('0x39')],{'$or':_['map'](_0x3fa1c4,function(_0xf8f9be){if(_0xf8f9be['type']!==_0x31fa('0x3a')){var _0x206b01={};_0x206b01[_0xf8f9be[_0x31fa('0x28')]]={'$like':'%'+_0x3a7cb1[_0x31fa('0x2f')][_0x31fa('0x3b')]+'%'};return _0x206b01;}})});}_0x502481=_[_0x31fa('0x3c')]({},_0x502481,_0x3a7cb1['options']);var _0x5872f0={'where':_0x502481[_0x31fa('0x39')]};return db[_0x31fa('0x2c')][_0x31fa('0x3d')](_0x5872f0)[_0x31fa('0x24')](function(_0x124f59){_0xe5a26[_0x31fa('0x3d')]=_0x124f59;if(_0x3a7cb1['query']['includeAll']){_0x502481[_0x31fa('0x3e')]=[{'all':!![]}];}return db[_0x31fa('0x2c')][_0x31fa('0x3f')](_0x502481);})[_0x31fa('0x24')](function(_0x4c29d9){_0xe5a26[_0x31fa('0x40')]=_0x4c29d9;return _0xe5a26;})[_0x31fa('0x24')](respondWithFilteredResult(_0x1d6e9d,_0x502481))[_0x31fa('0x41')](handleError(_0x1d6e9d,null));};exports[_0x31fa('0x42')]=function(_0x5329de,_0x19d62d){var _0x4383d9={'raw':![],'where':{'id':_0x5329de[_0x31fa('0x43')]['id']}},_0xeba16e={};_0xeba16e[_0x31fa('0x31')]=_[_0x31fa('0x44')](db['ServicenowConfiguration'][_0x31fa('0x2d')]);_0xeba16e['query']=_['keys'](_0x5329de[_0x31fa('0x2f')]);_0xeba16e[_0x31fa('0x30')]=_[_0x31fa('0x45')](_0xeba16e[_0x31fa('0x31')],_0xeba16e[_0x31fa('0x2f')]);_0x4383d9[_0x31fa('0x33')]=_[_0x31fa('0x45')](_0xeba16e['model'],qs['fields'](_0x5329de[_0x31fa('0x2f')]['fields']));_0x4383d9[_0x31fa('0x33')]=_0x4383d9['attributes'][_0x31fa('0x34')]?_0x4383d9[_0x31fa('0x33')]:_0xeba16e[_0x31fa('0x31')];if(_0x5329de[_0x31fa('0x2f')][_0x31fa('0x46')]){_0x4383d9['include']=[{'all':!![]}];}_0x4383d9=_[_0x31fa('0x3c')]({},_0x4383d9,_0x5329de[_0x31fa('0x47')]);return db[_0x31fa('0x2c')]['find'](_0x4383d9)['then'](handleEntityNotFound(_0x19d62d,null))[_0x31fa('0x24')](respondWithResult(_0x19d62d,null))[_0x31fa('0x41')](handleError(_0x19d62d,null));};exports[_0x31fa('0x48')]=function(_0x385182,_0x4bdf01){return db[_0x31fa('0x2c')][_0x31fa('0x48')](_0x385182[_0x31fa('0x49')],{})[_0x31fa('0x24')](respondWithResult(_0x4bdf01,0xc9))[_0x31fa('0x41')](handleError(_0x4bdf01,null));};exports[_0x31fa('0x23')]=function(_0x1d610c,_0x5399b7){if(_0x1d610c[_0x31fa('0x49')]['id']){delete _0x1d610c[_0x31fa('0x49')]['id'];}return db['ServicenowConfiguration'][_0x31fa('0x4a')]({'where':{'id':_0x1d610c[_0x31fa('0x43')]['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x5399b7,null))[_0x31fa('0x24')](saveUpdates(_0x1d610c[_0x31fa('0x49')],null))[_0x31fa('0x24')](respondWithResult(_0x5399b7,null))[_0x31fa('0x41')](handleError(_0x5399b7,null));};exports[_0x31fa('0x25')]=function(_0x12e8e7,_0x2b428c){return db[_0x31fa('0x2c')]['find']({'where':{'id':_0x12e8e7['params']['id']}})['then'](handleEntityNotFound(_0x2b428c,null))[_0x31fa('0x24')](removeEntity(_0x2b428c,null))[_0x31fa('0x41')](handleError(_0x2b428c,null));};exports[_0x31fa('0x4b')]=function(_0x3a50eb,_0x13cd56,_0x5be2ec){var _0x10bd86={};var _0x2e97ca={};var _0x16fea3;var _0x17fe4b;return db['ServicenowConfiguration'][_0x31fa('0x4c')]({'where':{'id':_0x3a50eb['params']['id']}})[_0x31fa('0x24')](handleEntityNotFound(_0x13cd56,null))[_0x31fa('0x24')](function(_0x5ed057){if(_0x5ed057){_0x16fea3=_0x5ed057;_0x2e97ca['model']=_[_0x31fa('0x44')](db[_0x31fa('0x4d')][_0x31fa('0x2d')]);_0x2e97ca['query']=_['keys'](_0x3a50eb[_0x31fa('0x2f')]);_0x2e97ca[_0x31fa('0x30')]=_['intersection'](_0x2e97ca['model'],_0x2e97ca[_0x31fa('0x2f')]);_0x10bd86[_0x31fa('0x33')]=_['intersection'](_0x2e97ca[_0x31fa('0x31')],qs[_0x31fa('0x32')](_0x3a50eb[_0x31fa('0x2f')]['fields']));_0x10bd86[_0x31fa('0x33')]=_0x10bd86['attributes'][_0x31fa('0x34')]?_0x10bd86[_0x31fa('0x33')]:_0x2e97ca[_0x31fa('0x31')];_0x10bd86[_0x31fa('0x37')]=qs['sort'](_0x3a50eb[_0x31fa('0x2f')][_0x31fa('0x38')]);_0x10bd86[_0x31fa('0x39')]=qs[_0x31fa('0x30')](_[_0x31fa('0x4e')](_0x3a50eb[_0x31fa('0x2f')],_0x2e97ca['filters']));if(_0x3a50eb[_0x31fa('0x2f')][_0x31fa('0x3b')]){_0x10bd86['where']=_['merge'](_0x10bd86[_0x31fa('0x39')],{'$or':_[_0x31fa('0x2b')](_0x10bd86[_0x31fa('0x33')],function(_0x363ebc){var _0x54f9b3={};_0x54f9b3[_0x363ebc]={'$like':'%'+_0x3a50eb['query'][_0x31fa('0x3b')]+'%'};return _0x54f9b3;})});}_0x10bd86=_['merge']({},_0x10bd86,_0x3a50eb[_0x31fa('0x47')]);return _0x16fea3[_0x31fa('0x4b')](_0x10bd86);}})['then'](function(_0x50d7b4){if(_0x50d7b4){_0x17fe4b=_0x50d7b4[_0x31fa('0x34')];if(!_0x3a50eb[_0x31fa('0x2f')][_0x31fa('0x35')](_0x31fa('0x36'))){_0x10bd86[_0x31fa('0x1e')]=qs[_0x31fa('0x1e')](_0x3a50eb[_0x31fa('0x2f')][_0x31fa('0x1e')]);_0x10bd86[_0x31fa('0x1f')]=qs[_0x31fa('0x1f')](_0x3a50eb[_0x31fa('0x2f')]['offset']);}return _0x16fea3[_0x31fa('0x4b')](_0x10bd86);}})['then'](function(_0x165d27){if(_0x165d27){return _0x165d27?{'count':_0x17fe4b,'rows':_0x165d27}:null;}})[_0x31fa('0x24')](respondWithResult(_0x13cd56,null))['catch'](handleError(_0x13cd56,null));};exports['getSubjects']=function(_0x538f43,_0x524b32,_0x5498cd){var _0x49b4f8={};var _0x40dba4={};var _0x47f71a;var _0x3d9c9a;return db[_0x31fa('0x2c')]['findOne']({'where':{'id':_0x538f43[_0x31fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x524b32,null))['then'](function(_0x1d9e0e){if(_0x1d9e0e){_0x47f71a=_0x1d9e0e;_0x40dba4[_0x31fa('0x31')]=_[_0x31fa('0x44')](db[_0x31fa('0x4d')]['rawAttributes']);_0x40dba4['query']=_[_0x31fa('0x44')](_0x538f43[_0x31fa('0x2f')]);_0x40dba4[_0x31fa('0x30')]=_[_0x31fa('0x45')](_0x40dba4[_0x31fa('0x31')],_0x40dba4[_0x31fa('0x2f')]);_0x49b4f8[_0x31fa('0x33')]=_['intersection'](_0x40dba4['model'],qs[_0x31fa('0x32')](_0x538f43[_0x31fa('0x2f')][_0x31fa('0x32')]));_0x49b4f8[_0x31fa('0x33')]=_0x49b4f8[_0x31fa('0x33')]['length']?_0x49b4f8[_0x31fa('0x33')]:_0x40dba4[_0x31fa('0x31')];_0x49b4f8[_0x31fa('0x37')]=qs[_0x31fa('0x38')](_0x538f43[_0x31fa('0x2f')]['sort']);_0x49b4f8[_0x31fa('0x39')]=qs['filters'](_[_0x31fa('0x4e')](_0x538f43['query'],_0x40dba4[_0x31fa('0x30')]));if(_0x538f43[_0x31fa('0x2f')][_0x31fa('0x3b')]){_0x49b4f8['where']=_[_0x31fa('0x3c')](_0x49b4f8[_0x31fa('0x39')],{'$or':_[_0x31fa('0x2b')](_0x49b4f8[_0x31fa('0x33')],function(_0x2fb4ce){var _0x43b929={};_0x43b929[_0x2fb4ce]={'$like':'%'+_0x538f43['query'][_0x31fa('0x3b')]+'%'};return _0x43b929;})});}_0x49b4f8=_[_0x31fa('0x3c')]({},_0x49b4f8,_0x538f43['options']);return _0x47f71a[_0x31fa('0x4f')](_0x49b4f8);}})[_0x31fa('0x24')](function(_0x220e1d){if(_0x220e1d){_0x3d9c9a=_0x220e1d[_0x31fa('0x34')];if(!_0x538f43[_0x31fa('0x2f')]['hasOwnProperty']('nolimit')){_0x49b4f8['limit']=qs[_0x31fa('0x1e')](_0x538f43[_0x31fa('0x2f')][_0x31fa('0x1e')]);_0x49b4f8['offset']=qs[_0x31fa('0x1f')](_0x538f43[_0x31fa('0x2f')][_0x31fa('0x1f')]);}return _0x47f71a[_0x31fa('0x4f')](_0x49b4f8);}})[_0x31fa('0x24')](function(_0x57a825){if(_0x57a825){return _0x57a825?{'count':_0x3d9c9a,'rows':_0x57a825}:null;}})[_0x31fa('0x24')](respondWithResult(_0x524b32,null))[_0x31fa('0x41')](handleError(_0x524b32,null));};exports[_0x31fa('0x50')]=function(_0x5e0853,_0x52ac48,_0x1e1632){var _0x2da08a={};var _0x2bc808={};var _0x2085a8;var _0x20527e;return db[_0x31fa('0x2c')][_0x31fa('0x4c')]({'where':{'id':_0x5e0853['params']['id']}})['then'](handleEntityNotFound(_0x52ac48,null))[_0x31fa('0x24')](function(_0x482b4b){if(_0x482b4b){_0x2085a8=_0x482b4b;_0x2bc808[_0x31fa('0x31')]=_[_0x31fa('0x44')](db['ServicenowField'][_0x31fa('0x2d')]);_0x2bc808[_0x31fa('0x2f')]=_[_0x31fa('0x44')](_0x5e0853[_0x31fa('0x2f')]);_0x2bc808[_0x31fa('0x30')]=_['intersection'](_0x2bc808[_0x31fa('0x31')],_0x2bc808[_0x31fa('0x2f')]);_0x2da08a[_0x31fa('0x33')]=_[_0x31fa('0x45')](_0x2bc808[_0x31fa('0x31')],qs[_0x31fa('0x32')](_0x5e0853['query'][_0x31fa('0x32')]));_0x2da08a['attributes']=_0x2da08a[_0x31fa('0x33')][_0x31fa('0x34')]?_0x2da08a[_0x31fa('0x33')]:_0x2bc808[_0x31fa('0x31')];_0x2da08a['order']=qs[_0x31fa('0x38')](_0x5e0853[_0x31fa('0x2f')][_0x31fa('0x38')]);_0x2da08a[_0x31fa('0x39')]=qs[_0x31fa('0x30')](_[_0x31fa('0x4e')](_0x5e0853[_0x31fa('0x2f')],_0x2bc808[_0x31fa('0x30')]));if(_0x5e0853[_0x31fa('0x2f')][_0x31fa('0x3b')]){_0x2da08a[_0x31fa('0x39')]=_[_0x31fa('0x3c')](_0x2da08a[_0x31fa('0x39')],{'$or':_[_0x31fa('0x2b')](_0x2da08a[_0x31fa('0x33')],function(_0x38ec26){var _0x1de1e1={};_0x1de1e1[_0x38ec26]={'$like':'%'+_0x5e0853['query'][_0x31fa('0x3b')]+'%'};return _0x1de1e1;})});}_0x2da08a=_[_0x31fa('0x3c')]({},_0x2da08a,_0x5e0853[_0x31fa('0x47')]);return _0x2085a8[_0x31fa('0x50')](_0x2da08a);}})[_0x31fa('0x24')](function(_0x2c7648){if(_0x2c7648){_0x20527e=_0x2c7648[_0x31fa('0x34')];if(!_0x5e0853[_0x31fa('0x2f')][_0x31fa('0x35')](_0x31fa('0x36'))){_0x2da08a['limit']=qs['limit'](_0x5e0853[_0x31fa('0x2f')][_0x31fa('0x1e')]);_0x2da08a['offset']=qs['offset'](_0x5e0853['query'][_0x31fa('0x1f')]);}return _0x2085a8[_0x31fa('0x50')](_0x2da08a);}})[_0x31fa('0x24')](function(_0x447a5b){if(_0x447a5b){return _0x447a5b?{'count':_0x20527e,'rows':_0x447a5b}:null;}})[_0x31fa('0x24')](respondWithResult(_0x52ac48,null))['catch'](handleError(_0x52ac48,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 50d9272..ffa1337 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 _0xc06d=['bluebird','request-promise','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api'];(function(_0xc5b3e3,_0x3b049c){var _0x88a2ca=function(_0x5643a9){while(--_0x5643a9){_0xc5b3e3['push'](_0xc5b3e3['shift']());}};_0x88a2ca(++_0x3b049c);}(_0xc06d,0x15a));var _0xdc06=function(_0x2e8c79,_0x281bea){_0x2e8c79=_0x2e8c79-0x0;var _0x8688e=_0xc06d[_0x2e8c79];return _0x8688e;};'use strict';var _=require(_0xdc06('0x0'));var util=require(_0xdc06('0x1'));var logger=require(_0xdc06('0x2'))(_0xdc06('0x3'));var moment=require('moment');var BPromise=require(_0xdc06('0x4'));var rp=require(_0xdc06('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc06('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xdc06('0x7')]=function(_0x2f7692,_0x5ce60c){return _0x2f7692['define'](_0xdc06('0x8'),attributes,{'tableName':_0xdc06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa702=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x2f3461,_0x56b95f){var _0x1928bd=function(_0x3891d6){while(--_0x3891d6){_0x2f3461['push'](_0x2f3461['shift']());}};_0x1928bd(++_0x56b95f);}(_0xa702,0x1ae));var _0x2a70=function(_0x13bc36,_0x3563e4){_0x13bc36=_0x13bc36-0x0;var _0x48125a=_0xa702[_0x13bc36];return _0x48125a;};'use strict';var _=require(_0x2a70('0x0'));var util=require(_0x2a70('0x1'));var logger=require(_0x2a70('0x2'))(_0x2a70('0x3'));var moment=require(_0x2a70('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a70('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x2a70('0x7')]=function(_0x16cdc3,_0x4b2915){return _0x16cdc3['define'](_0x2a70('0x8'),attributes,{'tableName':_0x2a70('0x9'),'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 2db56b7..b327131 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 _0x874d=['request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ServicenowConfiguration,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x40d37d,_0x537149){var _0x3a978a=function(_0x2c6169){while(--_0x2c6169){_0x40d37d['push'](_0x40d37d['shift']());}};_0x3a978a(++_0x537149);}(_0x874d,0x1e8));var _0xd874=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x874d[_0x5f49c0];return _0x5ab653;};'use strict';var _=require('lodash');var util=require(_0xd874('0x0'));var moment=require(_0xd874('0x1'));var BPromise=require(_0xd874('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd874('0x3'));var db=require(_0xd874('0x4'))['db'];var utils=require(_0xd874('0x5'));var logger=require(_0xd874('0x6'))('rpc');var config=require(_0xd874('0x7'));var jayson=require(_0xd874('0x8'));var client=jayson[_0xd874('0x9')][_0xd874('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f9f80,_0x4f22a5,_0x267aee){return new BPromise(function(_0x13d084,_0x3b1f59){return client['request'](_0x2f9f80,_0x267aee)['then'](function(_0x2ecdc4){logger[_0xd874('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4f22a5,_0xd874('0xc'));logger[_0xd874('0xd')](_0xd874('0xe'),_0x4f22a5,'request\x20sent',JSON[_0xd874('0xf')](_0x2ecdc4));if(_0x2ecdc4['error']){if(_0x2ecdc4['error'][_0xd874('0x10')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4f22a5,_0x2ecdc4[_0xd874('0x11')][_0xd874('0x12')]);return _0x3b1f59(_0x2ecdc4[_0xd874('0x11')][_0xd874('0x12')]);}logger[_0xd874('0x11')](_0xd874('0x13'),_0x4f22a5,_0x2ecdc4['error']['message']);return _0x13d084(_0x2ecdc4[_0xd874('0x11')][_0xd874('0x12')]);}else{logger['info'](_0xd874('0x13'),_0x4f22a5,'request\x20sent');_0x13d084(_0x2ecdc4['result'][_0xd874('0x12')]);}})['catch'](function(_0x2596b0){logger['error'](_0xd874('0x13'),_0x4f22a5,_0x2596b0);_0x3b1f59(_0x2596b0);});});} \ No newline at end of file +var _0x649e=['../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','code','message','info','ServicenowConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ef092,_0x5bbb06){var _0x1191a1=function(_0x1d15d9){while(--_0x1d15d9){_0x3ef092['push'](_0x3ef092['shift']());}};_0x1191a1(++_0x5bbb06);}(_0x649e,0xdd));var _0xe649=function(_0x2663ed,_0x6d1d46){_0x2663ed=_0x2663ed-0x0;var _0x2ffbe=_0x649e[_0x2663ed];return _0x2ffbe;};'use strict';var _=require(_0xe649('0x0'));var util=require(_0xe649('0x1'));var moment=require(_0xe649('0x2'));var BPromise=require(_0xe649('0x3'));var rs=require(_0xe649('0x4'));var fs=require('fs');var Redis=require(_0xe649('0x5'));var db=require(_0xe649('0x6'))['db'];var utils=require(_0xe649('0x7'));var logger=require(_0xe649('0x8'))('rpc');var config=require(_0xe649('0x9'));var jayson=require(_0xe649('0xa'));var client=jayson[_0xe649('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13e3b5,_0x3cc06b,_0x2ac422){return new BPromise(function(_0x1086b7,_0x396270){return client[_0xe649('0xc')](_0x13e3b5,_0x2ac422)[_0xe649('0xd')](function(_0x2556e0){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0xe649('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3cc06b,'request\x20sent',JSON[_0xe649('0xf')](_0x2556e0));if(_0x2556e0[_0xe649('0x10')]){if(_0x2556e0[_0xe649('0x10')][_0xe649('0x11')]===0x1f4){logger[_0xe649('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0x2556e0[_0xe649('0x10')]['message']);return _0x396270(_0x2556e0['error'][_0xe649('0x12')]);}logger[_0xe649('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0x2556e0[_0xe649('0x10')]['message']);return _0x1086b7(_0x2556e0[_0xe649('0x10')][_0xe649('0x12')]);}else{logger[_0xe649('0x13')](_0xe649('0x14'),_0x3cc06b,_0xe649('0xe'));_0x1086b7(_0x2556e0[_0xe649('0x15')][_0xe649('0x12')]);}})[_0xe649('0x16')](function(_0xb11506){logger[_0xe649('0x10')](_0xe649('0x14'),_0x3cc06b,_0xb11506);_0x396270(_0xb11506);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index a899857..a034123 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 _0x30e2=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x30e2,0xf3));var _0x230e=function(_0x39a07f,_0x60bf07){_0x39a07f=_0x39a07f-0x0;var _0x4fd849=_0x30e2[_0x39a07f];return _0x4fd849;};'use strict';var multer=require(_0x230e('0x0'));var util=require(_0x230e('0x1'));var path=require(_0x230e('0x2'));var timeout=require(_0x230e('0x3'));var express=require(_0x230e('0x4'));var router=express[_0x230e('0x5')]();var fs_extra=require(_0x230e('0x6'));var auth=require(_0x230e('0x7'));var interaction=require(_0x230e('0x8'));var config=require(_0x230e('0x9'));var controller=require(_0x230e('0xa'));router[_0x230e('0xb')]('/',auth[_0x230e('0xc')](),controller[_0x230e('0xd')]);router['get'](_0x230e('0xe'),auth['isAuthenticated'](),controller[_0x230e('0xf')]);router[_0x230e('0x10')]('/',auth['isAuthenticated'](),controller[_0x230e('0x11')]);router[_0x230e('0x12')](_0x230e('0xe'),auth[_0x230e('0xc')](),controller['update']);router[_0x230e('0x13')](_0x230e('0xe'),auth[_0x230e('0xc')](),controller['destroy']);module[_0x230e('0x14')]=router; \ No newline at end of file +var _0x67fc=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x922cfe,_0x14d4ac){var _0xb52a37=function(_0x412190){while(--_0x412190){_0x922cfe['push'](_0x922cfe['shift']());}};_0xb52a37(++_0x14d4ac);}(_0x67fc,0x14d));var _0xc67f=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x67fc[_0x5beda8];return _0x2aa042;};'use strict';var multer=require(_0xc67f('0x0'));var util=require('util');var path=require(_0xc67f('0x1'));var timeout=require(_0xc67f('0x2'));var express=require('express');var router=express[_0xc67f('0x3')]();var fs_extra=require(_0xc67f('0x4'));var auth=require(_0xc67f('0x5'));var interaction=require(_0xc67f('0x6'));var config=require(_0xc67f('0x7'));var controller=require(_0xc67f('0x8'));router[_0xc67f('0x9')]('/',auth[_0xc67f('0xa')](),controller[_0xc67f('0xb')]);router[_0xc67f('0x9')](_0xc67f('0xc'),auth[_0xc67f('0xa')](),controller[_0xc67f('0xd')]);router[_0xc67f('0xe')]('/',auth[_0xc67f('0xa')](),controller[_0xc67f('0xf')]);router[_0xc67f('0x10')](_0xc67f('0xc'),auth[_0xc67f('0xa')](),controller[_0xc67f('0x11')]);router['delete'](_0xc67f('0xc'),auth[_0xc67f('0xa')](),controller[_0xc67f('0x12')]);module[_0xc67f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 62794d0..89e46bd 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 _0x5a3b=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x5a3b,0x14c));var _0xb5a3=function(_0x30138d,_0x2fa070){_0x30138d=_0x30138d-0x0;var _0x751df9=_0x5a3b[_0x30138d];return _0x751df9;};'use strict';var Sequelize=require(_0xb5a3('0x0'));module[_0xb5a3('0x1')]={'type':{'type':Sequelize[_0xb5a3('0x2')]('string',_0xb5a3('0x3'),_0xb5a3('0x4'),_0xb5a3('0x5'),_0xb5a3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb5a3('0x7')]},'key':{'type':Sequelize[_0xb5a3('0x7')]},'keyType':{'type':Sequelize[_0xb5a3('0x2')]('string',_0xb5a3('0x3'),_0xb5a3('0x4'))},'keyContent':{'type':Sequelize[_0xb5a3('0x7')]},'idField':{'type':Sequelize[_0xb5a3('0x7')]},'nameField':{'type':Sequelize[_0xb5a3('0x7')]},'customField':{'type':Sequelize[_0xb5a3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb5a3('0x7')]}}; \ No newline at end of file +var _0xc351=['customVariable','BOOLEAN','sequelize','string','variable','STRING'];(function(_0x53d4a0,_0x4cb464){var _0x1e2b43=function(_0x449afa){while(--_0x449afa){_0x53d4a0['push'](_0x53d4a0['shift']());}};_0x1e2b43(++_0x4cb464);}(_0xc351,0x164));var _0x1c35=function(_0x2c27df,_0x4c7b2c){_0x2c27df=_0x2c27df-0x0;var _0x4ee8fd=_0xc351[_0x2c27df];return _0x4ee8fd;};'use strict';var Sequelize=require(_0x1c35('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1c35('0x1'),_0x1c35('0x2'),'customVariable','keyValue','picklist'),'defaultValue':_0x1c35('0x1')},'content':{'type':Sequelize[_0x1c35('0x3')]},'key':{'type':Sequelize[_0x1c35('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x1c35('0x1'),_0x1c35('0x2'),_0x1c35('0x4'))},'keyContent':{'type':Sequelize[_0x1c35('0x3')]},'idField':{'type':Sequelize[_0x1c35('0x3')]},'nameField':{'type':Sequelize[_0x1c35('0x3')]},'customField':{'type':Sequelize[_0x1c35('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c35('0x3')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c0e59a0..253a4dc 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 _0x4daf=['type','key','model','query','keys','intersection','attributes','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','rows','catch','show','params','fields','options','find','create','body','destroy','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ServicenowField','rawAttributes','fieldName'];(function(_0x6d2628,_0x79d294){var _0x2f77c6=function(_0x1401df){while(--_0x1401df){_0x6d2628['push'](_0x6d2628['shift']());}};_0x2f77c6(++_0x79d294);}(_0x4daf,0xec));var _0xf4da=function(_0xb6388,_0x44f06e){_0xb6388=_0xb6388-0x0;var _0x3385af=_0x4daf[_0xb6388];return _0x3385af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4da('0x0'));var zipdir=require(_0xf4da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf4da('0x2'));var Mustache=require(_0xf4da('0x3'));var util=require(_0xf4da('0x4'));var path=require(_0xf4da('0x5'));var sox=require(_0xf4da('0x6'));var csv=require(_0xf4da('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4da('0x8'));var _=require(_0xf4da('0x9'));var squel=require(_0xf4da('0xa'));var crypto=require(_0xf4da('0xb'));var jsforce=require(_0xf4da('0xc'));var deskjs=require(_0xf4da('0xd'));var toCsv=require(_0xf4da('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf4da('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf4da('0xf'));var hardwareService=require(_0xf4da('0x10'));var logger=require('../../config/logger')(_0xf4da('0x11'));var utils=require(_0xf4da('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf4da('0x13'));var db=require(_0xf4da('0x14'))['db'];function respondWithStatusCode(_0x175be4,_0x46485e){_0x46485e=_0x46485e||0xcc;return function(_0x1ac90d){if(_0x1ac90d){return _0x175be4[_0xf4da('0x15')](_0x46485e);}return _0x175be4[_0xf4da('0x16')](_0x46485e)[_0xf4da('0x17')]();};}function respondWithResult(_0x112fdc,_0x244f77){_0x244f77=_0x244f77||0xc8;return function(_0x2a8c7c){if(_0x2a8c7c){return _0x112fdc[_0xf4da('0x16')](_0x244f77)[_0xf4da('0x18')](_0x2a8c7c);}};}function respondWithFilteredResult(_0x187349,_0x204c34){return function(_0x4dd924){if(_0x4dd924){var _0xbfa10c=typeof _0x204c34['offset']===_0xf4da('0x19')&&typeof _0x204c34[_0xf4da('0x1a')]===_0xf4da('0x19');var _0x13cce1=_0x4dd924[_0xf4da('0x1b')];var _0x1391ff=_0xbfa10c?0x0:_0x204c34['offset'];var _0x42450e=_0xbfa10c?_0x4dd924['count']:_0x204c34[_0xf4da('0x1c')]+_0x204c34[_0xf4da('0x1a')];var _0x8c4d99;if(_0x42450e>=_0x13cce1){_0x42450e=_0x13cce1;_0x8c4d99=0xc8;}else{_0x8c4d99=0xce;}_0x187349[_0xf4da('0x16')](_0x8c4d99);return _0x187349[_0xf4da('0x1d')](_0xf4da('0x1e'),_0x1391ff+'-'+_0x42450e+'/'+_0x13cce1)['json'](_0x4dd924);}return null;};}function patchUpdates(_0x24fc25){return function(_0xf91021){try{jsonpatch[_0xf4da('0x1f')](_0xf91021,_0x24fc25,!![]);}catch(_0x595744){return BPromise[_0xf4da('0x20')](_0x595744);}return _0xf91021[_0xf4da('0x21')]();};}function saveUpdates(_0x1679b2,_0x506d26){return function(_0x3f9436){if(_0x3f9436){return _0x3f9436[_0xf4da('0x22')](_0x1679b2)[_0xf4da('0x23')](function(_0x547b08){return _0x547b08;});}return null;};}function removeEntity(_0x3b2414,_0x230ba0){return function(_0x5c456f){if(_0x5c456f){return _0x5c456f['destroy']()[_0xf4da('0x23')](function(){_0x3b2414['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x324457,_0x2f6b2e){return function(_0x2ad18b){if(!_0x2ad18b){_0x324457['sendStatus'](0x194);}return _0x2ad18b;};}function handleError(_0x2be855,_0x1b126d){_0x1b126d=_0x1b126d||0x1f4;return function(_0x12d175){logger[_0xf4da('0x24')](_0x12d175['stack']);if(_0x12d175[_0xf4da('0x25')]){delete _0x12d175[_0xf4da('0x25')];}_0x2be855[_0xf4da('0x16')](_0x1b126d)[_0xf4da('0x26')](_0x12d175);};}exports[_0xf4da('0x27')]=function(_0xb76c30,_0xa65c83){var _0x228862={},_0x5776ab={},_0x53e02b={'count':0x0,'rows':[]};var _0x4de46c=_[_0xf4da('0x28')](db[_0xf4da('0x29')][_0xf4da('0x2a')],function(_0x22e92e){return{'name':_0x22e92e[_0xf4da('0x2b')],'type':_0x22e92e[_0xf4da('0x2c')][_0xf4da('0x2d')]};});_0x5776ab[_0xf4da('0x2e')]=_[_0xf4da('0x28')](_0x4de46c,_0xf4da('0x25'));_0x5776ab[_0xf4da('0x2f')]=_[_0xf4da('0x30')](_0xb76c30[_0xf4da('0x2f')]);_0x5776ab['filters']=_[_0xf4da('0x31')](_0x5776ab[_0xf4da('0x2e')],_0x5776ab[_0xf4da('0x2f')]);_0x228862[_0xf4da('0x32')]=_[_0xf4da('0x31')](_0x5776ab[_0xf4da('0x2e')],qs['fields'](_0xb76c30[_0xf4da('0x2f')]['fields']));_0x228862[_0xf4da('0x32')]=_0x228862[_0xf4da('0x32')][_0xf4da('0x33')]?_0x228862[_0xf4da('0x32')]:_0x5776ab['model'];if(!_0xb76c30['query']['hasOwnProperty'](_0xf4da('0x34'))){_0x228862['limit']=qs[_0xf4da('0x1a')](_0xb76c30[_0xf4da('0x2f')][_0xf4da('0x1a')]);_0x228862['offset']=qs['offset'](_0xb76c30[_0xf4da('0x2f')][_0xf4da('0x1c')]);}_0x228862['order']=qs[_0xf4da('0x35')](_0xb76c30[_0xf4da('0x2f')][_0xf4da('0x35')]);_0x228862[_0xf4da('0x36')]=qs[_0xf4da('0x37')](_[_0xf4da('0x38')](_0xb76c30[_0xf4da('0x2f')],_0x5776ab['filters']),_0x4de46c);if(_0xb76c30[_0xf4da('0x2f')][_0xf4da('0x39')]){_0x228862[_0xf4da('0x36')]=_[_0xf4da('0x3a')](_0x228862[_0xf4da('0x36')],{'$or':_[_0xf4da('0x28')](_0x4de46c,function(_0x165238){if(_0x165238[_0xf4da('0x2c')]!=='VIRTUAL'){var _0x11f61b={};_0x11f61b[_0x165238[_0xf4da('0x25')]]={'$like':'%'+_0xb76c30['query'][_0xf4da('0x39')]+'%'};return _0x11f61b;}})});}_0x228862=_[_0xf4da('0x3a')]({},_0x228862,_0xb76c30['options']);var _0x2fe14f={'where':_0x228862[_0xf4da('0x36')]};return db['ServicenowField'][_0xf4da('0x1b')](_0x2fe14f)[_0xf4da('0x23')](function(_0x5ca988){_0x53e02b[_0xf4da('0x1b')]=_0x5ca988;if(_0xb76c30[_0xf4da('0x2f')][_0xf4da('0x3b')]){_0x228862['include']=[{'all':!![]}];}return db[_0xf4da('0x29')]['findAll'](_0x228862);})[_0xf4da('0x23')](function(_0x133da2){_0x53e02b[_0xf4da('0x3c')]=_0x133da2;return _0x53e02b;})[_0xf4da('0x23')](respondWithFilteredResult(_0xa65c83,_0x228862))[_0xf4da('0x3d')](handleError(_0xa65c83,null));};exports[_0xf4da('0x3e')]=function(_0x3fb067,_0x21867f){var _0x72ba15={'raw':!![],'where':{'id':_0x3fb067[_0xf4da('0x3f')]['id']}},_0x4ac682={};_0x4ac682['model']=_[_0xf4da('0x30')](db[_0xf4da('0x29')][_0xf4da('0x2a')]);_0x4ac682[_0xf4da('0x2f')]=_[_0xf4da('0x30')](_0x3fb067[_0xf4da('0x2f')]);_0x4ac682[_0xf4da('0x37')]=_['intersection'](_0x4ac682[_0xf4da('0x2e')],_0x4ac682[_0xf4da('0x2f')]);_0x72ba15[_0xf4da('0x32')]=_[_0xf4da('0x31')](_0x4ac682['model'],qs[_0xf4da('0x40')](_0x3fb067['query'][_0xf4da('0x40')]));_0x72ba15['attributes']=_0x72ba15[_0xf4da('0x32')][_0xf4da('0x33')]?_0x72ba15[_0xf4da('0x32')]:_0x4ac682['model'];if(_0x3fb067[_0xf4da('0x2f')]['includeAll']){_0x72ba15['include']=[{'all':!![]}];}_0x72ba15=_[_0xf4da('0x3a')]({},_0x72ba15,_0x3fb067[_0xf4da('0x41')]);return db['ServicenowField'][_0xf4da('0x42')](_0x72ba15)['then'](handleEntityNotFound(_0x21867f,null))[_0xf4da('0x23')](respondWithResult(_0x21867f,null))[_0xf4da('0x3d')](handleError(_0x21867f,null));};exports[_0xf4da('0x43')]=function(_0x1ac137,_0x3f9bd0){return db[_0xf4da('0x29')][_0xf4da('0x43')](_0x1ac137[_0xf4da('0x44')],{})[_0xf4da('0x23')](respondWithResult(_0x3f9bd0,0xc9))[_0xf4da('0x3d')](handleError(_0x3f9bd0,null));};exports[_0xf4da('0x22')]=function(_0x2c7582,_0x6b7dea){if(_0x2c7582[_0xf4da('0x44')]['id']){delete _0x2c7582['body']['id'];}return db[_0xf4da('0x29')][_0xf4da('0x42')]({'where':{'id':_0x2c7582[_0xf4da('0x3f')]['id']}})[_0xf4da('0x23')](handleEntityNotFound(_0x6b7dea,null))[_0xf4da('0x23')](saveUpdates(_0x2c7582[_0xf4da('0x44')],null))[_0xf4da('0x23')](respondWithResult(_0x6b7dea,null))[_0xf4da('0x3d')](handleError(_0x6b7dea,null));};exports[_0xf4da('0x45')]=function(_0x514959,_0xcbd0fc){return db[_0xf4da('0x29')][_0xf4da('0x42')]({'where':{'id':_0x514959[_0xf4da('0x3f')]['id']}})['then'](handleEntityNotFound(_0xcbd0fc,null))[_0xf4da('0x23')](removeEntity(_0xcbd0fc,null))[_0xf4da('0x3d')](handleError(_0xcbd0fc,null));}; \ No newline at end of file +var _0x9366=['order','sort','where','merge','VIRTUAL','filter','then','includeAll','include','ServicenowField','rows','catch','params','keys','options','find','create','body','eml-format','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1b3963,_0x14185e){var _0x369d3f=function(_0x900435){while(--_0x900435){_0x1b3963['push'](_0x1b3963['shift']());}};_0x369d3f(++_0x14185e);}(_0x9366,0xac));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6936('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6936('0x1'));var rp=require(_0x6936('0x2'));var moment=require(_0x6936('0x3'));var BPromise=require(_0x6936('0x4'));var Mustache=require(_0x6936('0x5'));var util=require(_0x6936('0x6'));var path=require(_0x6936('0x7'));var sox=require(_0x6936('0x8'));var csv=require(_0x6936('0x9'));var ejs=require(_0x6936('0xa'));var fs=require('fs');var fs_extra=require(_0x6936('0xb'));var _=require(_0x6936('0xc'));var squel=require(_0x6936('0xd'));var crypto=require(_0x6936('0xe'));var jsforce=require(_0x6936('0xf'));var deskjs=require(_0x6936('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6936('0x11'));var Papa=require(_0x6936('0x12'));var Redis=require(_0x6936('0x13'));var authService=require(_0x6936('0x14'));var qs=require(_0x6936('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6936('0x16'))(_0x6936('0x17'));var utils=require('../../config/utils');var config=require(_0x6936('0x18'));var licenseUtil=require(_0x6936('0x19'));var db=require(_0x6936('0x1a'))['db'];function respondWithStatusCode(_0x1bbd24,_0x3be500){_0x3be500=_0x3be500||0xcc;return function(_0x51665b){if(_0x51665b){return _0x1bbd24[_0x6936('0x1b')](_0x3be500);}return _0x1bbd24['status'](_0x3be500)[_0x6936('0x1c')]();};}function respondWithResult(_0x402db8,_0x40238){_0x40238=_0x40238||0xc8;return function(_0xc9b2c0){if(_0xc9b2c0){return _0x402db8['status'](_0x40238)[_0x6936('0x1d')](_0xc9b2c0);}};}function respondWithFilteredResult(_0x5dd750,_0x57804f){return function(_0x4cc026){if(_0x4cc026){var _0x572999=typeof _0x57804f['offset']==='undefined'&&typeof _0x57804f[_0x6936('0x1e')]==='undefined';var _0x3009a5=_0x4cc026[_0x6936('0x1f')];var _0x48de87=_0x572999?0x0:_0x57804f[_0x6936('0x20')];var _0x36670f=_0x572999?_0x4cc026[_0x6936('0x1f')]:_0x57804f[_0x6936('0x20')]+_0x57804f[_0x6936('0x1e')];var _0x39e5e9;if(_0x36670f>=_0x3009a5){_0x36670f=_0x3009a5;_0x39e5e9=0xc8;}else{_0x39e5e9=0xce;}_0x5dd750[_0x6936('0x21')](_0x39e5e9);return _0x5dd750[_0x6936('0x22')](_0x6936('0x23'),_0x48de87+'-'+_0x36670f+'/'+_0x3009a5)['json'](_0x4cc026);}return null;};}function patchUpdates(_0x5b8c5b){return function(_0x2c8587){try{jsonpatch[_0x6936('0x24')](_0x2c8587,_0x5b8c5b,!![]);}catch(_0x3f49ae){return BPromise[_0x6936('0x25')](_0x3f49ae);}return _0x2c8587[_0x6936('0x26')]();};}function saveUpdates(_0x2c3ed6,_0x522a0f){return function(_0x3ca093){if(_0x3ca093){return _0x3ca093[_0x6936('0x27')](_0x2c3ed6)['then'](function(_0xb8f449){return _0xb8f449;});}return null;};}function removeEntity(_0x1ee07d,_0x18f0f4){return function(_0x1e1b43){if(_0x1e1b43){return _0x1e1b43[_0x6936('0x28')]()['then'](function(){_0x1ee07d[_0x6936('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x965c26,_0x1d78c){return function(_0x29ae8e){if(!_0x29ae8e){_0x965c26[_0x6936('0x1b')](0x194);}return _0x29ae8e;};}function handleError(_0x178ef0,_0xa4e089){_0xa4e089=_0xa4e089||0x1f4;return function(_0x14e861){logger[_0x6936('0x29')](_0x14e861[_0x6936('0x2a')]);if(_0x14e861[_0x6936('0x2b')]){delete _0x14e861['name'];}_0x178ef0[_0x6936('0x21')](_0xa4e089)[_0x6936('0x2c')](_0x14e861);};}exports[_0x6936('0x2d')]=function(_0x4e2812,_0x2a1848){var _0x527ed1={},_0x1ba00c={},_0xa45403={'count':0x0,'rows':[]};var _0x28bd4a=_[_0x6936('0x2e')](db['ServicenowField'][_0x6936('0x2f')],function(_0x456726){return{'name':_0x456726[_0x6936('0x30')],'type':_0x456726[_0x6936('0x31')][_0x6936('0x32')]};});_0x1ba00c[_0x6936('0x33')]=_[_0x6936('0x2e')](_0x28bd4a,_0x6936('0x2b'));_0x1ba00c[_0x6936('0x34')]=_['keys'](_0x4e2812['query']);_0x1ba00c[_0x6936('0x35')]=_['intersection'](_0x1ba00c[_0x6936('0x33')],_0x1ba00c['query']);_0x527ed1[_0x6936('0x36')]=_['intersection'](_0x1ba00c['model'],qs[_0x6936('0x37')](_0x4e2812[_0x6936('0x34')][_0x6936('0x37')]));_0x527ed1[_0x6936('0x36')]=_0x527ed1[_0x6936('0x36')][_0x6936('0x38')]?_0x527ed1[_0x6936('0x36')]:_0x1ba00c[_0x6936('0x33')];if(!_0x4e2812[_0x6936('0x34')][_0x6936('0x39')](_0x6936('0x3a'))){_0x527ed1[_0x6936('0x1e')]=qs[_0x6936('0x1e')](_0x4e2812[_0x6936('0x34')]['limit']);_0x527ed1['offset']=qs[_0x6936('0x20')](_0x4e2812[_0x6936('0x34')][_0x6936('0x20')]);}_0x527ed1[_0x6936('0x3b')]=qs[_0x6936('0x3c')](_0x4e2812[_0x6936('0x34')][_0x6936('0x3c')]);_0x527ed1[_0x6936('0x3d')]=qs[_0x6936('0x35')](_['pick'](_0x4e2812[_0x6936('0x34')],_0x1ba00c[_0x6936('0x35')]),_0x28bd4a);if(_0x4e2812[_0x6936('0x34')]['filter']){_0x527ed1[_0x6936('0x3d')]=_[_0x6936('0x3e')](_0x527ed1[_0x6936('0x3d')],{'$or':_[_0x6936('0x2e')](_0x28bd4a,function(_0x334c52){if(_0x334c52[_0x6936('0x31')]!==_0x6936('0x3f')){var _0x4ad005={};_0x4ad005[_0x334c52[_0x6936('0x2b')]]={'$like':'%'+_0x4e2812[_0x6936('0x34')][_0x6936('0x40')]+'%'};return _0x4ad005;}})});}_0x527ed1=_[_0x6936('0x3e')]({},_0x527ed1,_0x4e2812['options']);var _0x271ebb={'where':_0x527ed1[_0x6936('0x3d')]};return db['ServicenowField'][_0x6936('0x1f')](_0x271ebb)[_0x6936('0x41')](function(_0xd530b0){_0xa45403[_0x6936('0x1f')]=_0xd530b0;if(_0x4e2812[_0x6936('0x34')][_0x6936('0x42')]){_0x527ed1[_0x6936('0x43')]=[{'all':!![]}];}return db[_0x6936('0x44')]['findAll'](_0x527ed1);})[_0x6936('0x41')](function(_0x4e0d7c){_0xa45403[_0x6936('0x45')]=_0x4e0d7c;return _0xa45403;})['then'](respondWithFilteredResult(_0x2a1848,_0x527ed1))[_0x6936('0x46')](handleError(_0x2a1848,null));};exports['show']=function(_0x2db933,_0x59494b){var _0x2e2e69={'raw':!![],'where':{'id':_0x2db933[_0x6936('0x47')]['id']}},_0x938fcd={};_0x938fcd['model']=_[_0x6936('0x48')](db[_0x6936('0x44')]['rawAttributes']);_0x938fcd['query']=_[_0x6936('0x48')](_0x2db933['query']);_0x938fcd[_0x6936('0x35')]=_['intersection'](_0x938fcd[_0x6936('0x33')],_0x938fcd['query']);_0x2e2e69[_0x6936('0x36')]=_['intersection'](_0x938fcd[_0x6936('0x33')],qs[_0x6936('0x37')](_0x2db933['query']['fields']));_0x2e2e69['attributes']=_0x2e2e69[_0x6936('0x36')][_0x6936('0x38')]?_0x2e2e69['attributes']:_0x938fcd[_0x6936('0x33')];if(_0x2db933['query']['includeAll']){_0x2e2e69[_0x6936('0x43')]=[{'all':!![]}];}_0x2e2e69=_[_0x6936('0x3e')]({},_0x2e2e69,_0x2db933[_0x6936('0x49')]);return db[_0x6936('0x44')][_0x6936('0x4a')](_0x2e2e69)[_0x6936('0x41')](handleEntityNotFound(_0x59494b,null))[_0x6936('0x41')](respondWithResult(_0x59494b,null))[_0x6936('0x46')](handleError(_0x59494b,null));};exports[_0x6936('0x4b')]=function(_0x345c98,_0x40fd13){return db[_0x6936('0x44')]['create'](_0x345c98['body'],{})[_0x6936('0x41')](respondWithResult(_0x40fd13,0xc9))[_0x6936('0x46')](handleError(_0x40fd13,null));};exports[_0x6936('0x27')]=function(_0x10a776,_0x1f3273){if(_0x10a776[_0x6936('0x4c')]['id']){delete _0x10a776['body']['id'];}return db[_0x6936('0x44')][_0x6936('0x4a')]({'where':{'id':_0x10a776[_0x6936('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f3273,null))[_0x6936('0x41')](saveUpdates(_0x10a776[_0x6936('0x4c')],null))[_0x6936('0x41')](respondWithResult(_0x1f3273,null))[_0x6936('0x46')](handleError(_0x1f3273,null));};exports['destroy']=function(_0x3bcf2a,_0x117d74){return db[_0x6936('0x44')]['find']({'where':{'id':_0x3bcf2a['params']['id']}})[_0x6936('0x41')](handleEntityNotFound(_0x117d74,null))[_0x6936('0x41')](removeEntity(_0x117d74,null))[_0x6936('0x46')](handleError(_0x117d74,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 9a0366a..eeedaff 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 _0x0915=['lodash','util','../../config/logger','api','moment','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId'];(function(_0x1c4b30,_0x21d23b){var _0x536864=function(_0x5e7768){while(--_0x5e7768){_0x1c4b30['push'](_0x1c4b30['shift']());}};_0x536864(++_0x21d23b);}(_0x0915,0x104));var _0x5091=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x0915[_0x2468b5];return _0x1056e4;};'use strict';var _=require(_0x5091('0x0'));var util=require(_0x5091('0x1'));var logger=require(_0x5091('0x2'))(_0x5091('0x3'));var moment=require(_0x5091('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(_0x5091('0x5'));var attributes=require(_0x5091('0x6'));module[_0x5091('0x7')]=function(_0x5eacff,_0x202ea0){return _0x5eacff[_0x5091('0x8')](_0x5091('0x9'),attributes,{'tableName':_0x5091('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5091('0xb'),_0x5091('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac8e=['./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3a83fb,_0x18eb3c){var _0xc2157d=function(_0x493790){while(--_0x493790){_0x3a83fb['push'](_0x3a83fb['shift']());}};_0xc2157d(++_0x18eb3c);}(_0xac8e,0x66));var _0xeac8=function(_0x1342ba,_0xc46994){_0x1342ba=_0x1342ba-0x0;var _0x913d0b=_0xac8e[_0x1342ba];return _0x913d0b;};'use strict';var _=require('lodash');var util=require(_0xeac8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xeac8('0x1'));var BPromise=require(_0xeac8('0x2'));var rp=require(_0xeac8('0x3'));var fs=require('fs');var path=require(_0xeac8('0x4'));var rimraf=require(_0xeac8('0x5'));var config=require('../../config/environment');var attributes=require(_0xeac8('0x6'));module[_0xeac8('0x7')]=function(_0x5ef5e4,_0x3e3575){return _0x5ef5e4[_0xeac8('0x8')](_0xeac8('0x9'),attributes,{'tableName':_0xeac8('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xeac8('0xb'),'FieldId'],'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 a33d2c4..fc2bbd5 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x5bfb77,_0x335ef9){var _0x16de7e=function(_0x284fa3){while(--_0x284fa3){_0x5bfb77['push'](_0x5bfb77['shift']());}};_0x16de7e(++_0x335ef9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2ae31d,_0x320c4f){_0x2ae31d=_0x2ae31d-0x0;var _0x5a33c3=_0x9ffd[_0x2ae31d];return _0x5a33c3;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xda3f,0xec));var _0xfda3=function(_0x44f94d,_0x2859fa){_0x44f94d=_0x44f94d-0x0;var _0x584dd1=_0xda3f[_0x44f94d];return _0x584dd1;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 618e7a1..9972538 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(_0x5d599f,_0x13dc1f){var _0x8addfd=function(_0x1acc6e){while(--_0x1acc6e){_0x5d599f['push'](_0x5d599f['shift']());}};_0x8addfd(++_0x13dc1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0xd20913,_0x212035){var _0x51ce25=function(_0x55fbed){while(--_0x55fbed){_0xd20913['push'](_0xd20913['shift']());}};_0x51ce25(++_0x212035);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 0338bd5..e8f90d9 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(_0x555b46,_0x4de0a7){var _0x5c727c=function(_0x65b5e0){while(--_0x65b5e0){_0x555b46['push'](_0x555b46['shift']());}};_0x5c727c(++_0x4de0a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1bf1b0,_0x5551fa){var _0x44adfd=function(_0x5a5f49){while(--_0x5a5f49){_0x1bf1b0['push'](_0x1bf1b0['shift']());}};_0x44adfd(++_0x5551fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 a122c17..21cefe2 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 _0xa3f5=['JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','format','%s%s','stringify','Calls','values','module_fields','remove','label','value','test','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','SugarcrmAccount','includeAll','include','show','rawAttributes','length','find','catch','create','body','params','getConfigurations','SugarcrmConfiguration','pick','addConfiguration','getSubjects','channel','Descriptions','Subjects','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','substring','lastIndexOf','/service/v4_1/rest.php'];(function(_0x450d4e,_0xcacc3){var _0x300304=function(_0x49ab27){while(--_0x49ab27){_0x450d4e['push'](_0x450d4e['shift']());}};_0x300304(++_0xcacc3);}(_0xa3f5,0x80));var _0x5a3f=function(_0x3f9568,_0x533147){_0x3f9568=_0x3f9568-0x0;var _0x45ff96=_0xa3f5[_0x3f9568];return _0x45ff96;};'use strict';var emlformat=require(_0x5a3f('0x0'));var rimraf=require(_0x5a3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a3f('0x2'));var rp=require(_0x5a3f('0x3'));var moment=require(_0x5a3f('0x4'));var BPromise=require(_0x5a3f('0x5'));var Mustache=require(_0x5a3f('0x6'));var util=require(_0x5a3f('0x7'));var path=require(_0x5a3f('0x8'));var sox=require(_0x5a3f('0x9'));var csv=require(_0x5a3f('0xa'));var ejs=require(_0x5a3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a3f('0xc'));var squel=require(_0x5a3f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a3f('0xa'));var querystring=require(_0x5a3f('0xe'));var Papa=require(_0x5a3f('0xf'));var Redis=require(_0x5a3f('0x10'));var authService=require(_0x5a3f('0x11'));var qs=require(_0x5a3f('0x12'));var as=require(_0x5a3f('0x13'));var hardwareService=require(_0x5a3f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5a3f('0x15'));var config=require(_0x5a3f('0x16'));var licenseUtil=require(_0x5a3f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5a3f('0x18'));function respondWithStatusCode(_0x3a5a6d,_0x31cf1e){_0x31cf1e=_0x31cf1e||0xcc;return function(_0x3a2158){if(_0x3a2158){return _0x3a5a6d['sendStatus'](_0x31cf1e);}return _0x3a5a6d[_0x5a3f('0x19')](_0x31cf1e)[_0x5a3f('0x1a')]();};}function respondWithResult(_0x5a574b,_0x287230){_0x287230=_0x287230||0xc8;return function(_0x42158b){if(_0x42158b){return _0x5a574b[_0x5a3f('0x19')](_0x287230)[_0x5a3f('0x1b')](_0x42158b);}};}function respondWithFilteredResult(_0x20aa4d,_0x15f357){return function(_0x330f10){if(_0x330f10){var _0x6cca3=typeof _0x15f357[_0x5a3f('0x1c')]==='undefined'&&typeof _0x15f357[_0x5a3f('0x1d')]===_0x5a3f('0x1e');var _0x5298e1=_0x330f10[_0x5a3f('0x1f')];var _0x1c698b=_0x6cca3?0x0:_0x15f357[_0x5a3f('0x1c')];var _0x2dbdef=_0x6cca3?_0x330f10[_0x5a3f('0x1f')]:_0x15f357['offset']+_0x15f357[_0x5a3f('0x1d')];var _0x27c88b;if(_0x2dbdef>=_0x5298e1){_0x2dbdef=_0x5298e1;_0x27c88b=0xc8;}else{_0x27c88b=0xce;}_0x20aa4d['status'](_0x27c88b);return _0x20aa4d['set']('Content-Range',_0x1c698b+'-'+_0x2dbdef+'/'+_0x5298e1)[_0x5a3f('0x1b')](_0x330f10);}return null;};}function patchUpdates(_0x11a631){return function(_0x409969){try{jsonpatch['apply'](_0x409969,_0x11a631,!![]);}catch(_0x3a4c29){return BPromise[_0x5a3f('0x20')](_0x3a4c29);}return _0x409969[_0x5a3f('0x21')]();};}function saveUpdates(_0x1be329,_0x108bf9){return function(_0x397c6e){if(_0x397c6e){return _0x397c6e['update'](_0x1be329)[_0x5a3f('0x22')](function(_0x136d58){return _0x136d58;});}return null;};}function removeEntity(_0x121fdd,_0x439e37){return function(_0x306eb6){if(_0x306eb6){return _0x306eb6[_0x5a3f('0x23')]()[_0x5a3f('0x22')](function(){_0x121fdd[_0x5a3f('0x19')](0xcc)[_0x5a3f('0x1a')]();});}};}function handleEntityNotFound(_0xe79f77,_0x8928a8){return function(_0x43e957){if(!_0x43e957){_0xe79f77['sendStatus'](0x194);}return _0x43e957;};}function handleError(_0x29af56,_0x1a0b60){_0x1a0b60=_0x1a0b60||0x1f4;return function(_0x4f2b9a){logger[_0x5a3f('0x24')](_0x4f2b9a[_0x5a3f('0x25')]);if(_0x4f2b9a['name']){delete _0x4f2b9a[_0x5a3f('0x26')];}_0x29af56[_0x5a3f('0x19')](_0x1a0b60)[_0x5a3f('0x27')](_0x4f2b9a);};}exports[_0x5a3f('0x28')]=function(_0x5490ba,_0x21d356){var _0xdc237={},_0x1ca8ba={},_0xd4d2ca={'count':0x0,'rows':[]};var _0x1d87f1=_[_0x5a3f('0x29')](db['SugarcrmAccount']['rawAttributes'],function(_0x3e0caf){return{'name':_0x3e0caf[_0x5a3f('0x2a')],'type':_0x3e0caf[_0x5a3f('0x2b')]['key']};});_0x1ca8ba['model']=_['map'](_0x1d87f1,_0x5a3f('0x26'));_0x1ca8ba['query']=_[_0x5a3f('0x2c')](_0x5490ba[_0x5a3f('0x2d')]);_0x1ca8ba['filters']=_[_0x5a3f('0x2e')](_0x1ca8ba['model'],_0x1ca8ba[_0x5a3f('0x2d')]);_0xdc237[_0x5a3f('0x2f')]=_[_0x5a3f('0x2e')](_0x1ca8ba[_0x5a3f('0x30')],qs[_0x5a3f('0x31')](_0x5490ba[_0x5a3f('0x2d')][_0x5a3f('0x31')]));_0xdc237[_0x5a3f('0x2f')]=_0xdc237[_0x5a3f('0x2f')]['length']?_0xdc237[_0x5a3f('0x2f')]:_0x1ca8ba[_0x5a3f('0x30')];if(!_0x5490ba['query'][_0x5a3f('0x32')](_0x5a3f('0x33'))){_0xdc237[_0x5a3f('0x1d')]=qs[_0x5a3f('0x1d')](_0x5490ba[_0x5a3f('0x2d')][_0x5a3f('0x1d')]);_0xdc237[_0x5a3f('0x1c')]=qs[_0x5a3f('0x1c')](_0x5490ba[_0x5a3f('0x2d')][_0x5a3f('0x1c')]);}_0xdc237[_0x5a3f('0x34')]=qs[_0x5a3f('0x35')](_0x5490ba[_0x5a3f('0x2d')]['sort']);_0xdc237[_0x5a3f('0x36')]=qs[_0x5a3f('0x37')](_['pick'](_0x5490ba[_0x5a3f('0x2d')],_0x1ca8ba[_0x5a3f('0x37')]),_0x1d87f1);if(_0x5490ba['query']['filter']){_0xdc237['where']=_[_0x5a3f('0x38')](_0xdc237[_0x5a3f('0x36')],{'$or':_[_0x5a3f('0x29')](_0x1d87f1,function(_0x4e2dd7){if(_0x4e2dd7['type']!=='VIRTUAL'){var _0xc1c168={};_0xc1c168[_0x4e2dd7['name']]={'$like':'%'+_0x5490ba[_0x5a3f('0x2d')][_0x5a3f('0x39')]+'%'};return _0xc1c168;}})});}_0xdc237=_['merge']({},_0xdc237,_0x5490ba[_0x5a3f('0x3a')]);var _0x12bd96={'where':_0xdc237['where']};return db[_0x5a3f('0x3b')][_0x5a3f('0x1f')](_0x12bd96)[_0x5a3f('0x22')](function(_0x240b51){_0xd4d2ca[_0x5a3f('0x1f')]=_0x240b51;if(_0x5490ba[_0x5a3f('0x2d')][_0x5a3f('0x3c')]){_0xdc237[_0x5a3f('0x3d')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0xdc237);})[_0x5a3f('0x22')](function(_0x1eb409){_0xd4d2ca['rows']=_0x1eb409;return _0xd4d2ca;})[_0x5a3f('0x22')](respondWithFilteredResult(_0x21d356,_0xdc237))['catch'](handleError(_0x21d356,null));};exports[_0x5a3f('0x3e')]=function(_0x2e5f30,_0x3df424){var _0x8ecd93={'raw':![],'where':{'id':_0x2e5f30['params']['id']}},_0x10a748={};_0x10a748[_0x5a3f('0x30')]=_[_0x5a3f('0x2c')](db['SugarcrmAccount'][_0x5a3f('0x3f')]);_0x10a748['query']=_[_0x5a3f('0x2c')](_0x2e5f30[_0x5a3f('0x2d')]);_0x10a748['filters']=_[_0x5a3f('0x2e')](_0x10a748['model'],_0x10a748['query']);_0x8ecd93[_0x5a3f('0x2f')]=_['intersection'](_0x10a748[_0x5a3f('0x30')],qs['fields'](_0x2e5f30[_0x5a3f('0x2d')][_0x5a3f('0x31')]));_0x8ecd93['attributes']=_0x8ecd93[_0x5a3f('0x2f')][_0x5a3f('0x40')]?_0x8ecd93[_0x5a3f('0x2f')]:_0x10a748['model'];if(_0x2e5f30[_0x5a3f('0x2d')]['includeAll']){_0x8ecd93[_0x5a3f('0x3d')]=[{'all':!![]}];}_0x8ecd93=_[_0x5a3f('0x38')]({},_0x8ecd93,_0x2e5f30[_0x5a3f('0x3a')]);return db['SugarcrmAccount'][_0x5a3f('0x41')](_0x8ecd93)[_0x5a3f('0x22')](handleEntityNotFound(_0x3df424,null))[_0x5a3f('0x22')](respondWithResult(_0x3df424,null))[_0x5a3f('0x42')](handleError(_0x3df424,null));};exports[_0x5a3f('0x43')]=function(_0x398529,_0x18b3f5){return db[_0x5a3f('0x3b')][_0x5a3f('0x43')](_0x398529[_0x5a3f('0x44')],{})[_0x5a3f('0x22')](respondWithResult(_0x18b3f5,0xc9))[_0x5a3f('0x42')](handleError(_0x18b3f5,null));};exports['update']=function(_0xaab583,_0x530f5e){if(_0xaab583['body']['id']){delete _0xaab583[_0x5a3f('0x44')]['id'];}return db['SugarcrmAccount'][_0x5a3f('0x41')]({'where':{'id':_0xaab583['params']['id']}})[_0x5a3f('0x22')](handleEntityNotFound(_0x530f5e,null))[_0x5a3f('0x22')](saveUpdates(_0xaab583[_0x5a3f('0x44')],null))['then'](respondWithResult(_0x530f5e,null))[_0x5a3f('0x42')](handleError(_0x530f5e,null));};exports[_0x5a3f('0x23')]=function(_0x4d6af6,_0x4fa946){return db[_0x5a3f('0x3b')][_0x5a3f('0x41')]({'where':{'id':_0x4d6af6[_0x5a3f('0x45')]['id']}})[_0x5a3f('0x22')](handleEntityNotFound(_0x4fa946,null))[_0x5a3f('0x22')](removeEntity(_0x4fa946,null))[_0x5a3f('0x42')](handleError(_0x4fa946,null));};exports[_0x5a3f('0x46')]=function(_0x441f3c,_0x47e16b,_0x536584){var _0x4530f8={};var _0x28964d={};var _0x32eecf;var _0x3035b5;return db[_0x5a3f('0x3b')]['findOne']({'where':{'id':_0x441f3c[_0x5a3f('0x45')]['id']}})[_0x5a3f('0x22')](handleEntityNotFound(_0x47e16b,null))['then'](function(_0x131896){if(_0x131896){_0x32eecf=_0x131896;_0x28964d['model']=_['keys'](db[_0x5a3f('0x47')][_0x5a3f('0x3f')]);_0x28964d[_0x5a3f('0x2d')]=_['keys'](_0x441f3c[_0x5a3f('0x2d')]);_0x28964d['filters']=_[_0x5a3f('0x2e')](_0x28964d[_0x5a3f('0x30')],_0x28964d[_0x5a3f('0x2d')]);_0x4530f8['attributes']=_[_0x5a3f('0x2e')](_0x28964d[_0x5a3f('0x30')],qs['fields'](_0x441f3c[_0x5a3f('0x2d')][_0x5a3f('0x31')]));_0x4530f8[_0x5a3f('0x2f')]=_0x4530f8[_0x5a3f('0x2f')]['length']?_0x4530f8[_0x5a3f('0x2f')]:_0x28964d[_0x5a3f('0x30')];_0x4530f8[_0x5a3f('0x34')]=qs['sort'](_0x441f3c['query'][_0x5a3f('0x35')]);_0x4530f8[_0x5a3f('0x36')]=qs[_0x5a3f('0x37')](_[_0x5a3f('0x48')](_0x441f3c['query'],_0x28964d[_0x5a3f('0x37')]));if(_0x441f3c[_0x5a3f('0x2d')][_0x5a3f('0x39')]){_0x4530f8['where']=_[_0x5a3f('0x38')](_0x4530f8['where'],{'$or':_['map'](_0x4530f8[_0x5a3f('0x2f')],function(_0x34a52f){var _0x5c2cd7={};_0x5c2cd7[_0x34a52f]={'$like':'%'+_0x441f3c[_0x5a3f('0x2d')][_0x5a3f('0x39')]+'%'};return _0x5c2cd7;})});}_0x4530f8=_[_0x5a3f('0x38')]({},_0x4530f8,_0x441f3c[_0x5a3f('0x3a')]);return _0x32eecf[_0x5a3f('0x46')](_0x4530f8);}})[_0x5a3f('0x22')](function(_0x5c26b0){if(_0x5c26b0){_0x3035b5=_0x5c26b0[_0x5a3f('0x40')];if(!_0x441f3c[_0x5a3f('0x2d')]['hasOwnProperty'](_0x5a3f('0x33'))){_0x4530f8[_0x5a3f('0x1d')]=qs['limit'](_0x441f3c[_0x5a3f('0x2d')]['limit']);_0x4530f8['offset']=qs[_0x5a3f('0x1c')](_0x441f3c[_0x5a3f('0x2d')][_0x5a3f('0x1c')]);}return _0x32eecf[_0x5a3f('0x46')](_0x4530f8);}})['then'](function(_0x1db4fb){if(_0x1db4fb){return _0x1db4fb?{'count':_0x3035b5,'rows':_0x1db4fb}:null;}})[_0x5a3f('0x22')](respondWithResult(_0x47e16b,null))[_0x5a3f('0x42')](handleError(_0x47e16b,null));};exports[_0x5a3f('0x49')]=function(_0x40373c,_0x89f814,_0x3ab068){if(_0x40373c['body']['id']){delete _0x40373c['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x40373c[_0x5a3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x89f814,null))['then'](function(_0x4c103c){if(_0x4c103c){_0x40373c['body']['AccountId']=_0x4c103c['id'];_0x40373c['body']['Subjects']=integrations[_0x5a3f('0x4a')](_0x40373c[_0x5a3f('0x44')][_0x5a3f('0x4b')],_0x40373c[_0x5a3f('0x44')][_0x5a3f('0x2b')]);_0x40373c[_0x5a3f('0x44')][_0x5a3f('0x4c')]=integrations['getDescriptions'](_0x40373c[_0x5a3f('0x44')][_0x5a3f('0x4b')],_0x40373c[_0x5a3f('0x44')][_0x5a3f('0x2b')]);return db[_0x5a3f('0x47')][_0x5a3f('0x43')](_0x40373c[_0x5a3f('0x44')],{'include':[{'model':db['SugarcrmField'],'as':_0x5a3f('0x4d')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x5a3f('0x22')](respondWithResult(_0x89f814,null))[_0x5a3f('0x42')](handleError(_0x89f814,null));};exports['getFields']=function(_0x1e6d91,_0xeadc4a,_0x1fd596){var _0x780a8c='';var _0xbdd894=['id',_0x5a3f('0x26'),_0x5a3f('0x4e'),_0x5a3f('0x4f'),_0x5a3f('0x50'),_0x5a3f('0x51'),_0x5a3f('0x52'),_0x5a3f('0x53'),_0x5a3f('0x54'),_0x5a3f('0x55'),_0x5a3f('0x56'),_0x5a3f('0x57')];return db[_0x5a3f('0x3b')][_0x5a3f('0x58')]({'where':{'id':_0x1e6d91['params']['id']},'attributes':['id',_0x5a3f('0x59'),_0x5a3f('0x5a'),'remoteUri']})[_0x5a3f('0x22')](handleEntityNotFound(_0xeadc4a,null))[_0x5a3f('0x22')](function(_0x5a0bee){if(_0x5a0bee){_0x780a8c=_0x5a0bee['remoteUri'];var _0x5a3e29=_0x780a8c['slice'](-0x1);if(_0x5a3e29==='/'){_0x780a8c=_0x780a8c[_0x5a3f('0x5b')](0x0,_0x780a8c[_0x5a3f('0x5c')](_0x5a3e29));}return rp({'method':'POST','uri':util['format']('%s%s',_0x780a8c,_0x5a3f('0x5d')),'json':!![],'form':{'method':'login','input_type':_0x5a3f('0x5e'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5a0bee[_0x5a3f('0x59')],'password':_0x5a0bee['password'],'encryption':_0x5a3f('0x5f')},'application':_0x5a3f('0x60')})}});}})[_0x5a3f('0x22')](function(_0x139581){if(_0x139581&&_0x139581[_0x5a3f('0x26')]!=='Invalid\x20Login'&&_0x139581['name']!==_0x5a3f('0x61')){return rp({'method':_0x5a3f('0x62'),'uri':util[_0x5a3f('0x63')](_0x5a3f('0x64'),_0x780a8c,_0x5a3f('0x5d')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5a3f('0x5e'),'response_type':_0x5a3f('0x5e'),'rest_data':JSON[_0x5a3f('0x65')]({'session':_0x139581['id'],'module_name':_0x5a3f('0x66')})}})[_0x5a3f('0x22')](function(_0x2a9c28){if(_0x2a9c28){var _0x5bd673=_[_0x5a3f('0x67')](_0x2a9c28[_0x5a3f('0x68')]);_[_0x5a3f('0x69')](_0x5bd673,function(_0x38bab2){return _0xbdd894['includes'](_0x38bab2['name']);});return{'count':_0x5bd673[_0x5a3f('0x40')],'rows':_[_0x5a3f('0x29')](_0x5bd673,function(_0x203cef){return{'id':_0x203cef[_0x5a3f('0x26')],'name':_0x203cef[_0x5a3f('0x6a')],'custom':_['endsWith'](_0x203cef[_0x5a3f('0x26')],'_c')?!![]:![],'options':_0x203cef[_0x5a3f('0x3a')]?_['map'](_[_0x5a3f('0x67')](_0x203cef[_0x5a3f('0x3a')]),function(_0xd03a9c){return{'name':_0xd03a9c[_0x5a3f('0x6b')],'value':_0xd03a9c[_0x5a3f('0x26')]};}):[]};})};}})[_0x5a3f('0x22')](respondWithResult(_0xeadc4a,null))['catch'](function(_0xe7187f){var _0x4f25c7=_0x1e6d91[_0x5a3f('0x2d')][_0x5a3f('0x6c')]?0x1f4:_0xe7187f['statusCode']||0x1f4;logger[_0x5a3f('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x5a3f('0x6d'),_0x4f25c7,JSON[_0x5a3f('0x65')](_0xe7187f));delete _0xe7187f[_0x5a3f('0x26')];if(_0x4f25c7===0x191){_0x4f25c7=0x190;}_0xeadc4a['status'](_0x4f25c7)[_0x5a3f('0x27')](_0x1e6d91[_0x5a3f('0x2d')][_0x5a3f('0x6c')]?{'message':_0x5a3f('0x6e'),'statusCode':_0xe7187f['statusCode']}:_0xe7187f);});}else{var _0x2c033e=0x1f4;_0xeadc4a['status'](_0x2c033e)[_0x5a3f('0x27')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x1f7e=['PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','includes','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','then','error','send','index','map','SugarcrmAccount','rawAttributes','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','name','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify'];(function(_0x3cc312,_0x1c56e1){var _0x13da2b=function(_0x4bbe11){while(--_0x4bbe11){_0x3cc312['push'](_0x3cc312['shift']());}};_0x13da2b(++_0x1c56e1);}(_0x1f7e,0x1ed));var _0xe1f7=function(_0x1c730c,_0x3b4de3){_0x1c730c=_0x1c730c-0x0;var _0x3c0cac=_0x1f7e[_0x1c730c];return _0x3c0cac;};'use strict';var emlformat=require(_0xe1f7('0x0'));var rimraf=require(_0xe1f7('0x1'));var zipdir=require(_0xe1f7('0x2'));var jsonpatch=require(_0xe1f7('0x3'));var rp=require(_0xe1f7('0x4'));var moment=require(_0xe1f7('0x5'));var BPromise=require(_0xe1f7('0x6'));var Mustache=require('mustache');var util=require(_0xe1f7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe1f7('0x8'));var ejs=require(_0xe1f7('0x9'));var fs=require('fs');var fs_extra=require(_0xe1f7('0xa'));var _=require(_0xe1f7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe1f7('0xc'));var deskjs=require(_0xe1f7('0xd'));var toCsv=require(_0xe1f7('0x8'));var querystring=require(_0xe1f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xe1f7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe1f7('0x10'));var as=require(_0xe1f7('0x11'));var hardwareService=require(_0xe1f7('0x12'));var logger=require(_0xe1f7('0x13'))(_0xe1f7('0x14'));var utils=require(_0xe1f7('0x15'));var config=require(_0xe1f7('0x16'));var licenseUtil=require(_0xe1f7('0x17'));var db=require(_0xe1f7('0x18'))['db'];var integrations=require(_0xe1f7('0x19'));function respondWithStatusCode(_0x3136d1,_0x1f0ae1){_0x1f0ae1=_0x1f0ae1||0xcc;return function(_0x2713bd){if(_0x2713bd){return _0x3136d1[_0xe1f7('0x1a')](_0x1f0ae1);}return _0x3136d1[_0xe1f7('0x1b')](_0x1f0ae1)[_0xe1f7('0x1c')]();};}function respondWithResult(_0x5af16f,_0x311e7b){_0x311e7b=_0x311e7b||0xc8;return function(_0x24e4e1){if(_0x24e4e1){return _0x5af16f[_0xe1f7('0x1b')](_0x311e7b)['json'](_0x24e4e1);}};}function respondWithFilteredResult(_0x18133e,_0x2d3ea4){return function(_0x447e57){if(_0x447e57){var _0x40a051=typeof _0x2d3ea4['offset']===_0xe1f7('0x1d')&&typeof _0x2d3ea4[_0xe1f7('0x1e')]==='undefined';var _0xfdaf61=_0x447e57[_0xe1f7('0x1f')];var _0x1317de=_0x40a051?0x0:_0x2d3ea4[_0xe1f7('0x20')];var _0x26b155=_0x40a051?_0x447e57['count']:_0x2d3ea4[_0xe1f7('0x20')]+_0x2d3ea4[_0xe1f7('0x1e')];var _0x26fb31;if(_0x26b155>=_0xfdaf61){_0x26b155=_0xfdaf61;_0x26fb31=0xc8;}else{_0x26fb31=0xce;}_0x18133e[_0xe1f7('0x1b')](_0x26fb31);return _0x18133e[_0xe1f7('0x21')]('Content-Range',_0x1317de+'-'+_0x26b155+'/'+_0xfdaf61)[_0xe1f7('0x22')](_0x447e57);}return null;};}function patchUpdates(_0x52d6a0){return function(_0x1f382c){try{jsonpatch[_0xe1f7('0x23')](_0x1f382c,_0x52d6a0,!![]);}catch(_0x52e80b){return BPromise[_0xe1f7('0x24')](_0x52e80b);}return _0x1f382c[_0xe1f7('0x25')]();};}function saveUpdates(_0x1700dd,_0x332b0f){return function(_0x4a2462){if(_0x4a2462){return _0x4a2462[_0xe1f7('0x26')](_0x1700dd)['then'](function(_0x370356){return _0x370356;});}return null;};}function removeEntity(_0x1028c6,_0x1697f6){return function(_0x36e288){if(_0x36e288){return _0x36e288[_0xe1f7('0x27')]()[_0xe1f7('0x28')](function(){_0x1028c6[_0xe1f7('0x1b')](0xcc)[_0xe1f7('0x1c')]();});}};}function handleEntityNotFound(_0x19984b,_0x35c65b){return function(_0x2f6c60){if(!_0x2f6c60){_0x19984b[_0xe1f7('0x1a')](0x194);}return _0x2f6c60;};}function handleError(_0x175b0b,_0x2864c6){_0x2864c6=_0x2864c6||0x1f4;return function(_0x5ccbd4){logger[_0xe1f7('0x29')](_0x5ccbd4['stack']);if(_0x5ccbd4['name']){delete _0x5ccbd4['name'];}_0x175b0b[_0xe1f7('0x1b')](_0x2864c6)[_0xe1f7('0x2a')](_0x5ccbd4);};}exports[_0xe1f7('0x2b')]=function(_0xe61b11,_0x5e9207){var _0x516c08={},_0x3ec756={},_0x18bfba={'count':0x0,'rows':[]};var _0x45a043=_[_0xe1f7('0x2c')](db[_0xe1f7('0x2d')][_0xe1f7('0x2e')],function(_0x2264df){return{'name':_0x2264df['fieldName'],'type':_0x2264df['type']['key']};});_0x3ec756['model']=_[_0xe1f7('0x2c')](_0x45a043,'name');_0x3ec756[_0xe1f7('0x2f')]=_[_0xe1f7('0x30')](_0xe61b11['query']);_0x3ec756['filters']=_[_0xe1f7('0x31')](_0x3ec756[_0xe1f7('0x32')],_0x3ec756[_0xe1f7('0x2f')]);_0x516c08[_0xe1f7('0x33')]=_[_0xe1f7('0x31')](_0x3ec756['model'],qs[_0xe1f7('0x34')](_0xe61b11[_0xe1f7('0x2f')][_0xe1f7('0x34')]));_0x516c08['attributes']=_0x516c08[_0xe1f7('0x33')][_0xe1f7('0x35')]?_0x516c08['attributes']:_0x3ec756[_0xe1f7('0x32')];if(!_0xe61b11[_0xe1f7('0x2f')]['hasOwnProperty'](_0xe1f7('0x36'))){_0x516c08[_0xe1f7('0x1e')]=qs[_0xe1f7('0x1e')](_0xe61b11[_0xe1f7('0x2f')][_0xe1f7('0x1e')]);_0x516c08[_0xe1f7('0x20')]=qs['offset'](_0xe61b11[_0xe1f7('0x2f')][_0xe1f7('0x20')]);}_0x516c08[_0xe1f7('0x37')]=qs[_0xe1f7('0x38')](_0xe61b11[_0xe1f7('0x2f')]['sort']);_0x516c08[_0xe1f7('0x39')]=qs[_0xe1f7('0x3a')](_['pick'](_0xe61b11[_0xe1f7('0x2f')],_0x3ec756[_0xe1f7('0x3a')]),_0x45a043);if(_0xe61b11[_0xe1f7('0x2f')][_0xe1f7('0x3b')]){_0x516c08['where']=_[_0xe1f7('0x3c')](_0x516c08['where'],{'$or':_[_0xe1f7('0x2c')](_0x45a043,function(_0x2a5665){if(_0x2a5665[_0xe1f7('0x3d')]!==_0xe1f7('0x3e')){var _0x4f2eef={};_0x4f2eef[_0x2a5665['name']]={'$like':'%'+_0xe61b11[_0xe1f7('0x2f')]['filter']+'%'};return _0x4f2eef;}})});}_0x516c08=_[_0xe1f7('0x3c')]({},_0x516c08,_0xe61b11[_0xe1f7('0x3f')]);var _0x435fb4={'where':_0x516c08[_0xe1f7('0x39')]};return db[_0xe1f7('0x2d')][_0xe1f7('0x1f')](_0x435fb4)[_0xe1f7('0x28')](function(_0x4f89dd){_0x18bfba['count']=_0x4f89dd;if(_0xe61b11[_0xe1f7('0x2f')][_0xe1f7('0x40')]){_0x516c08[_0xe1f7('0x41')]=[{'all':!![]}];}return db[_0xe1f7('0x2d')]['findAll'](_0x516c08);})[_0xe1f7('0x28')](function(_0x3d03ff){_0x18bfba['rows']=_0x3d03ff;return _0x18bfba;})['then'](respondWithFilteredResult(_0x5e9207,_0x516c08))[_0xe1f7('0x42')](handleError(_0x5e9207,null));};exports[_0xe1f7('0x43')]=function(_0x57c385,_0x482aa6){var _0x54e5e0={'raw':![],'where':{'id':_0x57c385['params']['id']}},_0x468cf3={};_0x468cf3[_0xe1f7('0x32')]=_[_0xe1f7('0x30')](db['SugarcrmAccount']['rawAttributes']);_0x468cf3[_0xe1f7('0x2f')]=_[_0xe1f7('0x30')](_0x57c385['query']);_0x468cf3[_0xe1f7('0x3a')]=_['intersection'](_0x468cf3[_0xe1f7('0x32')],_0x468cf3['query']);_0x54e5e0[_0xe1f7('0x33')]=_[_0xe1f7('0x31')](_0x468cf3[_0xe1f7('0x32')],qs['fields'](_0x57c385[_0xe1f7('0x2f')][_0xe1f7('0x34')]));_0x54e5e0[_0xe1f7('0x33')]=_0x54e5e0[_0xe1f7('0x33')][_0xe1f7('0x35')]?_0x54e5e0[_0xe1f7('0x33')]:_0x468cf3[_0xe1f7('0x32')];if(_0x57c385['query'][_0xe1f7('0x40')]){_0x54e5e0[_0xe1f7('0x41')]=[{'all':!![]}];}_0x54e5e0=_[_0xe1f7('0x3c')]({},_0x54e5e0,_0x57c385[_0xe1f7('0x3f')]);return db[_0xe1f7('0x2d')][_0xe1f7('0x44')](_0x54e5e0)[_0xe1f7('0x28')](handleEntityNotFound(_0x482aa6,null))['then'](respondWithResult(_0x482aa6,null))[_0xe1f7('0x42')](handleError(_0x482aa6,null));};exports[_0xe1f7('0x45')]=function(_0x3899d3,_0x4b56ef){return db[_0xe1f7('0x2d')][_0xe1f7('0x45')](_0x3899d3['body'],{})[_0xe1f7('0x28')](respondWithResult(_0x4b56ef,0xc9))[_0xe1f7('0x42')](handleError(_0x4b56ef,null));};exports['update']=function(_0x10a0bb,_0x37ae37){if(_0x10a0bb[_0xe1f7('0x46')]['id']){delete _0x10a0bb[_0xe1f7('0x46')]['id'];}return db[_0xe1f7('0x2d')][_0xe1f7('0x44')]({'where':{'id':_0x10a0bb['params']['id']}})[_0xe1f7('0x28')](handleEntityNotFound(_0x37ae37,null))[_0xe1f7('0x28')](saveUpdates(_0x10a0bb[_0xe1f7('0x46')],null))[_0xe1f7('0x28')](respondWithResult(_0x37ae37,null))[_0xe1f7('0x42')](handleError(_0x37ae37,null));};exports[_0xe1f7('0x27')]=function(_0x44bb24,_0xb3653){return db[_0xe1f7('0x2d')][_0xe1f7('0x44')]({'where':{'id':_0x44bb24[_0xe1f7('0x47')]['id']}})['then'](handleEntityNotFound(_0xb3653,null))[_0xe1f7('0x28')](removeEntity(_0xb3653,null))[_0xe1f7('0x42')](handleError(_0xb3653,null));};exports[_0xe1f7('0x48')]=function(_0x5d1968,_0x352cfa,_0x5962b9){var _0x90f003={};var _0x52a9f9={};var _0x52dc94;var _0x34b329;return db['SugarcrmAccount'][_0xe1f7('0x49')]({'where':{'id':_0x5d1968['params']['id']}})[_0xe1f7('0x28')](handleEntityNotFound(_0x352cfa,null))['then'](function(_0x31e305){if(_0x31e305){_0x52dc94=_0x31e305;_0x52a9f9[_0xe1f7('0x32')]=_[_0xe1f7('0x30')](db[_0xe1f7('0x4a')][_0xe1f7('0x2e')]);_0x52a9f9[_0xe1f7('0x2f')]=_['keys'](_0x5d1968[_0xe1f7('0x2f')]);_0x52a9f9[_0xe1f7('0x3a')]=_[_0xe1f7('0x31')](_0x52a9f9[_0xe1f7('0x32')],_0x52a9f9[_0xe1f7('0x2f')]);_0x90f003['attributes']=_[_0xe1f7('0x31')](_0x52a9f9['model'],qs['fields'](_0x5d1968[_0xe1f7('0x2f')][_0xe1f7('0x34')]));_0x90f003[_0xe1f7('0x33')]=_0x90f003[_0xe1f7('0x33')]['length']?_0x90f003[_0xe1f7('0x33')]:_0x52a9f9[_0xe1f7('0x32')];_0x90f003['order']=qs[_0xe1f7('0x38')](_0x5d1968[_0xe1f7('0x2f')][_0xe1f7('0x38')]);_0x90f003[_0xe1f7('0x39')]=qs[_0xe1f7('0x3a')](_[_0xe1f7('0x4b')](_0x5d1968['query'],_0x52a9f9['filters']));if(_0x5d1968['query']['filter']){_0x90f003[_0xe1f7('0x39')]=_[_0xe1f7('0x3c')](_0x90f003['where'],{'$or':_[_0xe1f7('0x2c')](_0x90f003[_0xe1f7('0x33')],function(_0x27196f){var _0x279c1f={};_0x279c1f[_0x27196f]={'$like':'%'+_0x5d1968['query']['filter']+'%'};return _0x279c1f;})});}_0x90f003=_['merge']({},_0x90f003,_0x5d1968[_0xe1f7('0x3f')]);return _0x52dc94['getConfigurations'](_0x90f003);}})[_0xe1f7('0x28')](function(_0x2327a4){if(_0x2327a4){_0x34b329=_0x2327a4['length'];if(!_0x5d1968['query'][_0xe1f7('0x4c')](_0xe1f7('0x36'))){_0x90f003['limit']=qs[_0xe1f7('0x1e')](_0x5d1968[_0xe1f7('0x2f')][_0xe1f7('0x1e')]);_0x90f003[_0xe1f7('0x20')]=qs[_0xe1f7('0x20')](_0x5d1968[_0xe1f7('0x2f')][_0xe1f7('0x20')]);}return _0x52dc94[_0xe1f7('0x48')](_0x90f003);}})[_0xe1f7('0x28')](function(_0x53ce4e){if(_0x53ce4e){return _0x53ce4e?{'count':_0x34b329,'rows':_0x53ce4e}:null;}})[_0xe1f7('0x28')](respondWithResult(_0x352cfa,null))[_0xe1f7('0x42')](handleError(_0x352cfa,null));};exports['addConfiguration']=function(_0x5a938b,_0x3dfb6f,_0x4b84cf){if(_0x5a938b[_0xe1f7('0x46')]['id']){delete _0x5a938b['body']['id'];}return db[_0xe1f7('0x2d')][_0xe1f7('0x49')]({'where':{'id':_0x5a938b[_0xe1f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x3dfb6f,null))[_0xe1f7('0x28')](function(_0x22d45e){if(_0x22d45e){_0x5a938b[_0xe1f7('0x46')][_0xe1f7('0x4d')]=_0x22d45e['id'];_0x5a938b['body'][_0xe1f7('0x4e')]=integrations[_0xe1f7('0x4f')](_0x5a938b[_0xe1f7('0x46')][_0xe1f7('0x50')],_0x5a938b[_0xe1f7('0x46')][_0xe1f7('0x3d')]);_0x5a938b[_0xe1f7('0x46')][_0xe1f7('0x51')]=integrations[_0xe1f7('0x52')](_0x5a938b[_0xe1f7('0x46')]['channel'],_0x5a938b[_0xe1f7('0x46')][_0xe1f7('0x3d')]);return db[_0xe1f7('0x4a')][_0xe1f7('0x45')](_0x5a938b['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xe1f7('0x4e')},{'model':db[_0xe1f7('0x53')],'as':_0xe1f7('0x51')}]});}return null;})[_0xe1f7('0x28')](respondWithResult(_0x3dfb6f,null))[_0xe1f7('0x42')](handleError(_0x3dfb6f,null));};exports[_0xe1f7('0x54')]=function(_0x2a8a23,_0xde9093,_0x560173){var _0x4000f2='';var _0x116d37=['id',_0xe1f7('0x55'),_0xe1f7('0x56'),_0xe1f7('0x57'),_0xe1f7('0x58'),_0xe1f7('0x59'),_0xe1f7('0x5a'),_0xe1f7('0x5b'),_0xe1f7('0x5c'),_0xe1f7('0x5d'),_0xe1f7('0x5e'),'direction'];return db['SugarcrmAccount'][_0xe1f7('0x49')]({'where':{'id':_0x2a8a23[_0xe1f7('0x47')]['id']},'attributes':['id','username',_0xe1f7('0x5f'),_0xe1f7('0x60')]})[_0xe1f7('0x28')](handleEntityNotFound(_0xde9093,null))[_0xe1f7('0x28')](function(_0x1211e8){if(_0x1211e8){_0x4000f2=_0x1211e8[_0xe1f7('0x60')];var _0x20da6a=_0x4000f2[_0xe1f7('0x61')](-0x1);if(_0x20da6a==='/'){_0x4000f2=_0x4000f2[_0xe1f7('0x62')](0x0,_0x4000f2[_0xe1f7('0x63')](_0x20da6a));}return rp({'method':_0xe1f7('0x64'),'uri':util[_0xe1f7('0x65')](_0xe1f7('0x66'),_0x4000f2,_0xe1f7('0x67')),'json':!![],'form':{'method':_0xe1f7('0x68'),'input_type':_0xe1f7('0x69'),'response_type':_0xe1f7('0x69'),'rest_data':JSON[_0xe1f7('0x6a')]({'user_auth':{'user_name':_0x1211e8['username'],'password':_0x1211e8['password'],'encryption':_0xe1f7('0x6b')},'application':_0xe1f7('0x6c')})}});}})[_0xe1f7('0x28')](function(_0x58197d){if(_0x58197d&&_0x58197d[_0xe1f7('0x55')]!==_0xe1f7('0x6d')&&_0x58197d[_0xe1f7('0x55')]!==_0xe1f7('0x6e')){return rp({'method':_0xe1f7('0x64'),'uri':util[_0xe1f7('0x65')](_0xe1f7('0x66'),_0x4000f2,_0xe1f7('0x67')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xe1f7('0x69'),'response_type':_0xe1f7('0x69'),'rest_data':JSON[_0xe1f7('0x6a')]({'session':_0x58197d['id'],'module_name':_0xe1f7('0x6f')})}})['then'](function(_0x15037d){if(_0x15037d){var _0x3d7d2b=_[_0xe1f7('0x70')](_0x15037d[_0xe1f7('0x71')]);_['remove'](_0x3d7d2b,function(_0x144295){return _0x116d37[_0xe1f7('0x72')](_0x144295['name']);});return{'count':_0x3d7d2b[_0xe1f7('0x35')],'rows':_[_0xe1f7('0x2c')](_0x3d7d2b,function(_0x3c25e4){return{'id':_0x3c25e4[_0xe1f7('0x55')],'name':_0x3c25e4['label'],'custom':_['endsWith'](_0x3c25e4[_0xe1f7('0x55')],'_c')?!![]:![],'options':_0x3c25e4[_0xe1f7('0x3f')]?_[_0xe1f7('0x2c')](_[_0xe1f7('0x70')](_0x3c25e4[_0xe1f7('0x3f')]),function(_0x4b8fe5){return{'name':_0x4b8fe5[_0xe1f7('0x73')],'value':_0x4b8fe5[_0xe1f7('0x55')]};}):[]};})};}})[_0xe1f7('0x28')](respondWithResult(_0xde9093,null))['catch'](function(_0x313fd3){var _0xf7af12=_0x2a8a23[_0xe1f7('0x2f')][_0xe1f7('0x74')]?0x1f4:_0x313fd3[_0xe1f7('0x75')]||0x1f4;logger['error'](_0xe1f7('0x76'),_0xe1f7('0x54'),_0xf7af12,JSON[_0xe1f7('0x6a')](_0x313fd3));delete _0x313fd3[_0xe1f7('0x55')];if(_0xf7af12===0x191){_0xf7af12=0x190;}_0xde9093[_0xe1f7('0x1b')](_0xf7af12)[_0xe1f7('0x2a')](_0x2a8a23[_0xe1f7('0x2f')][_0xe1f7('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x313fd3['statusCode']}:_0x313fd3);});}else{var _0x580ce8=0x1f4;_0xde9093[_0xe1f7('0x1b')](_0x580ce8)['send']({'message':_0xe1f7('0x77'),'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 b5f710e..91586e5 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 _0x722d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','lodash','util'];(function(_0xc0921a,_0x1f107f){var _0x3f6189=function(_0x5cd2fe){while(--_0x5cd2fe){_0xc0921a['push'](_0xc0921a['shift']());}};_0x3f6189(++_0x1f107f);}(_0x722d,0x17e));var _0xd722=function(_0x47eaff,_0x502553){_0x47eaff=_0x47eaff-0x0;var _0x53103e=_0x722d[_0x47eaff];return _0x53103e;};'use strict';var _=require(_0xd722('0x0'));var util=require(_0xd722('0x1'));var logger=require('../../config/logger')(_0xd722('0x2'));var moment=require(_0xd722('0x3'));var BPromise=require(_0xd722('0x4'));var rp=require(_0xd722('0x5'));var fs=require('fs');var path=require(_0xd722('0x6'));var rimraf=require(_0xd722('0x7'));var config=require(_0xd722('0x8'));var attributes=require(_0xd722('0x9'));var integrations=require(_0xd722('0xa'));module['exports']=function(_0x188813,_0x283aef){return _0x188813['define'](_0xd722('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb27=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x3625e4,_0x2efee3){var _0x5efcb3=function(_0x19b73a){while(--_0x19b73a){_0x3625e4['push'](_0x3625e4['shift']());}};_0x5efcb3(++_0x2efee3);}(_0xfb27,0x7e));var _0x7fb2=function(_0x40570e,_0x53df30){_0x40570e=_0x40570e-0x0;var _0x16336a=_0xfb27[_0x40570e];return _0x16336a;};'use strict';var _=require(_0x7fb2('0x0'));var util=require(_0x7fb2('0x1'));var logger=require(_0x7fb2('0x2'))(_0x7fb2('0x3'));var moment=require(_0x7fb2('0x4'));var BPromise=require('bluebird');var rp=require(_0x7fb2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb2('0x6'));var config=require(_0x7fb2('0x7'));var attributes=require(_0x7fb2('0x8'));var integrations=require(_0x7fb2('0x9'));module[_0x7fb2('0xa')]=function(_0x434849,_0x22dc8d){return _0x434849[_0x7fb2('0xb')](_0x7fb2('0xc'),attributes,{'tableName':_0x7fb2('0xd'),'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 1b8a7dc..79c85d6 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 _0x0730=['findAll','options','where','attributes','limit','include','map','model','then','ShowSugarcrmAccount','find','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSugarcrmAccount'];(function(_0x322e89,_0x29cc1d){var _0x88f22b=function(_0x1aedce){while(--_0x1aedce){_0x322e89['push'](_0x322e89['shift']());}};_0x88f22b(++_0x29cc1d);}(_0x0730,0x1be));var _0x0073=function(_0x26c616,_0x40e688){_0x26c616=_0x26c616-0x0;var _0x17783c=_0x0730[_0x26c616];return _0x17783c;};'use strict';var _=require(_0x0073('0x0'));var util=require(_0x0073('0x1'));var moment=require(_0x0073('0x2'));var BPromise=require(_0x0073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0073('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0073('0x5'))(_0x0073('0x6'));var config=require(_0x0073('0x7'));var jayson=require(_0x0073('0x8'));var client=jayson[_0x0073('0x9')][_0x0073('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56f041,_0x3d2351,_0x1e1afa){return new BPromise(function(_0x2fcc44,_0x5217c1){return client[_0x0073('0xb')](_0x56f041,_0x1e1afa)['then'](function(_0x113ac4){logger[_0x0073('0xc')](_0x0073('0xd'),_0x3d2351,_0x0073('0xe'));logger[_0x0073('0xf')](_0x0073('0x10'),_0x3d2351,_0x0073('0xe'),JSON['stringify'](_0x113ac4));if(_0x113ac4[_0x0073('0x11')]){if(_0x113ac4['error'][_0x0073('0x12')]===0x1f4){logger['error'](_0x0073('0xd'),_0x3d2351,_0x113ac4[_0x0073('0x11')]['message']);return _0x5217c1(_0x113ac4['error'][_0x0073('0x13')]);}logger[_0x0073('0x11')](_0x0073('0xd'),_0x3d2351,_0x113ac4[_0x0073('0x11')][_0x0073('0x13')]);return _0x2fcc44(_0x113ac4['error'][_0x0073('0x13')]);}else{logger[_0x0073('0xc')](_0x0073('0xd'),_0x3d2351,_0x0073('0xe'));_0x2fcc44(_0x113ac4[_0x0073('0x14')][_0x0073('0x13')]);}})['catch'](function(_0x5da55b){logger['error'](_0x0073('0xd'),_0x3d2351,_0x5da55b);_0x5217c1(_0x5da55b);});});}exports[_0x0073('0x15')]=function(_0x5e0908){var _0x3c653b=this;return new Promise(function(_0x5a8688,_0x46bac7){return db['SugarcrmAccount'][_0x0073('0x16')]({'raw':_0x5e0908[_0x0073('0x17')]?_0x5e0908['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e0908[_0x0073('0x17')]?_0x5e0908[_0x0073('0x17')][_0x0073('0x18')]||null:null,'attributes':_0x5e0908['options']?_0x5e0908[_0x0073('0x17')][_0x0073('0x19')]||null:null,'limit':_0x5e0908[_0x0073('0x17')]?_0x5e0908['options'][_0x0073('0x1a')]||null:null,'include':_0x5e0908['options']?_0x5e0908[_0x0073('0x17')][_0x0073('0x1b')]?_[_0x0073('0x1c')](_0x5e0908[_0x0073('0x17')][_0x0073('0x1b')],function(_0xbd8e0){return{'model':db[_0xbd8e0[_0x0073('0x1d')]],'as':_0xbd8e0['as'],'attributes':_0xbd8e0[_0x0073('0x19')],'include':_0xbd8e0[_0x0073('0x1b')]?_[_0x0073('0x1c')](_0xbd8e0['include'],function(_0xd18e59){return{'model':db[_0xd18e59[_0x0073('0x1d')]],'as':_0xd18e59['as'],'attributes':_0xd18e59[_0x0073('0x19')],'include':_0xd18e59['include']?_[_0x0073('0x1c')](_0xd18e59[_0x0073('0x1b')],function(_0x21c29d){return{'model':db[_0x21c29d['model']],'as':_0x21c29d['as'],'attributes':_0x21c29d[_0x0073('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0073('0x1e')](function(_0x317bfe){logger[_0x0073('0xc')](_0x0073('0x15'),_0x5e0908);logger['debug'](_0x0073('0x15'),_0x5e0908,JSON['stringify'](_0x317bfe));_0x5a8688(_0x317bfe);})['catch'](function(_0x5c98ca){logger[_0x0073('0x11')](_0x0073('0x15'),_0x5c98ca['message'],_0x5e0908);_0x46bac7(_0x3c653b['error'](0x1f4,_0x5c98ca[_0x0073('0x13')]));});});};exports[_0x0073('0x1f')]=function(_0x511776){var _0x1da1d2=this;return new Promise(function(_0x3d2a58,_0xd2d207){return db['SugarcrmAccount'][_0x0073('0x20')]({'raw':_0x511776['options']?_0x511776[_0x0073('0x17')][_0x0073('0x21')]===undefined?!![]:![]:!![],'where':_0x511776[_0x0073('0x17')]?_0x511776[_0x0073('0x17')]['where']||null:null,'attributes':_0x511776['options']?_0x511776[_0x0073('0x17')][_0x0073('0x19')]||null:null,'include':_0x511776[_0x0073('0x17')]?_0x511776['options'][_0x0073('0x1b')]?_[_0x0073('0x1c')](_0x511776['options'][_0x0073('0x1b')],function(_0x2b4b5e){return{'model':db[_0x2b4b5e['model']],'as':_0x2b4b5e['as'],'attributes':_0x2b4b5e[_0x0073('0x19')],'include':_0x2b4b5e[_0x0073('0x1b')]?_['map'](_0x2b4b5e[_0x0073('0x1b')],function(_0x3b9147){return{'model':db[_0x3b9147['model']],'as':_0x3b9147['as'],'attributes':_0x3b9147['attributes'],'include':_0x3b9147['include']?_['map'](_0x3b9147[_0x0073('0x1b')],function(_0x907e64){return{'model':db[_0x907e64[_0x0073('0x1d')]],'as':_0x907e64['as'],'attributes':_0x907e64[_0x0073('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0073('0x1e')](function(_0x524b93){logger[_0x0073('0xc')](_0x0073('0x1f'),_0x511776);logger[_0x0073('0xf')](_0x0073('0x1f'),_0x511776,JSON[_0x0073('0x22')](_0x524b93));_0x3d2a58(_0x524b93);})[_0x0073('0x23')](function(_0x2299b6){logger['error'](_0x0073('0x1f'),_0x2299b6[_0x0073('0x13')],_0x511776);_0xd2d207(_0x1da1d2[_0x0073('0x11')](0x1f4,_0x2299b6[_0x0073('0x13')]));});});}; \ No newline at end of file +var _0x56ce=['options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SugarcrmAccount','findAll'];(function(_0x1604e9,_0x15214b){var _0x5c2d61=function(_0x44085a){while(--_0x44085a){_0x1604e9['push'](_0x1604e9['shift']());}};_0x5c2d61(++_0x15214b);}(_0x56ce,0xe9));var _0xe56c=function(_0x4b12f4,_0x29bb3e){_0x4b12f4=_0x4b12f4-0x0;var _0xb6e028=_0x56ce[_0x4b12f4];return _0xb6e028;};'use strict';var _=require(_0xe56c('0x0'));var util=require(_0xe56c('0x1'));var moment=require(_0xe56c('0x2'));var BPromise=require(_0xe56c('0x3'));var rs=require(_0xe56c('0x4'));var fs=require('fs');var Redis=require(_0xe56c('0x5'));var db=require(_0xe56c('0x6'))['db'];var utils=require(_0xe56c('0x7'));var logger=require('../../config/logger')(_0xe56c('0x8'));var config=require('../../config/environment');var jayson=require(_0xe56c('0x9'));var client=jayson[_0xe56c('0xa')][_0xe56c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x132af3,_0x50e84c,_0x4593a7){return new BPromise(function(_0x42fbb3,_0x5e4bd6){return client[_0xe56c('0xc')](_0x132af3,_0x4593a7)[_0xe56c('0xd')](function(_0x5420fe){logger[_0xe56c('0xe')](_0xe56c('0xf'),_0x50e84c,_0xe56c('0x10'));logger[_0xe56c('0x11')](_0xe56c('0x12'),_0x50e84c,_0xe56c('0x10'),JSON[_0xe56c('0x13')](_0x5420fe));if(_0x5420fe[_0xe56c('0x14')]){if(_0x5420fe[_0xe56c('0x14')][_0xe56c('0x15')]===0x1f4){logger[_0xe56c('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x50e84c,_0x5420fe['error'][_0xe56c('0x16')]);return _0x5e4bd6(_0x5420fe[_0xe56c('0x14')]['message']);}logger[_0xe56c('0x14')](_0xe56c('0xf'),_0x50e84c,_0x5420fe[_0xe56c('0x14')][_0xe56c('0x16')]);return _0x42fbb3(_0x5420fe['error'][_0xe56c('0x16')]);}else{logger[_0xe56c('0xe')](_0xe56c('0xf'),_0x50e84c,_0xe56c('0x10'));_0x42fbb3(_0x5420fe['result'][_0xe56c('0x16')]);}})[_0xe56c('0x17')](function(_0x57039a){logger[_0xe56c('0x14')](_0xe56c('0xf'),_0x50e84c,_0x57039a);_0x5e4bd6(_0x57039a);});});}exports['GetSugarcrmAccount']=function(_0x9facd7){var _0xc908e0=this;return new Promise(function(_0x5b44d6,_0x1af3b7){return db[_0xe56c('0x18')][_0xe56c('0x19')]({'raw':_0x9facd7[_0xe56c('0x1a')]?_0x9facd7['options'][_0xe56c('0x1b')]===undefined?!![]:![]:!![],'where':_0x9facd7[_0xe56c('0x1a')]?_0x9facd7[_0xe56c('0x1a')][_0xe56c('0x1c')]||null:null,'attributes':_0x9facd7[_0xe56c('0x1a')]?_0x9facd7[_0xe56c('0x1a')][_0xe56c('0x1d')]||null:null,'limit':_0x9facd7['options']?_0x9facd7[_0xe56c('0x1a')][_0xe56c('0x1e')]||null:null,'include':_0x9facd7['options']?_0x9facd7['options'][_0xe56c('0x1f')]?_[_0xe56c('0x20')](_0x9facd7[_0xe56c('0x1a')][_0xe56c('0x1f')],function(_0x7862a){return{'model':db[_0x7862a['model']],'as':_0x7862a['as'],'attributes':_0x7862a[_0xe56c('0x1d')],'include':_0x7862a['include']?_['map'](_0x7862a[_0xe56c('0x1f')],function(_0x426058){return{'model':db[_0x426058[_0xe56c('0x21')]],'as':_0x426058['as'],'attributes':_0x426058['attributes'],'include':_0x426058[_0xe56c('0x1f')]?_['map'](_0x426058['include'],function(_0x51bd13){return{'model':db[_0x51bd13[_0xe56c('0x21')]],'as':_0x51bd13['as'],'attributes':_0x51bd13['attributes']};}):[]};}):[]};}):[]:[]})[_0xe56c('0xd')](function(_0x191b66){logger[_0xe56c('0xe')]('GetSugarcrmAccount',_0x9facd7);logger[_0xe56c('0x11')](_0xe56c('0x22'),_0x9facd7,JSON[_0xe56c('0x13')](_0x191b66));_0x5b44d6(_0x191b66);})[_0xe56c('0x17')](function(_0x3e32ae){logger[_0xe56c('0x14')](_0xe56c('0x22'),_0x3e32ae['message'],_0x9facd7);_0x1af3b7(_0xc908e0['error'](0x1f4,_0x3e32ae[_0xe56c('0x16')]));});});};exports[_0xe56c('0x23')]=function(_0x1321b7){var _0x165533=this;return new Promise(function(_0x19ebe5,_0x8a5100){return db[_0xe56c('0x18')][_0xe56c('0x24')]({'raw':_0x1321b7[_0xe56c('0x1a')]?_0x1321b7[_0xe56c('0x1a')][_0xe56c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1321b7[_0xe56c('0x1a')]?_0x1321b7[_0xe56c('0x1a')][_0xe56c('0x1c')]||null:null,'attributes':_0x1321b7[_0xe56c('0x1a')]?_0x1321b7[_0xe56c('0x1a')][_0xe56c('0x1d')]||null:null,'include':_0x1321b7[_0xe56c('0x1a')]?_0x1321b7[_0xe56c('0x1a')]['include']?_[_0xe56c('0x20')](_0x1321b7['options'][_0xe56c('0x1f')],function(_0x1044c8){return{'model':db[_0x1044c8[_0xe56c('0x21')]],'as':_0x1044c8['as'],'attributes':_0x1044c8[_0xe56c('0x1d')],'include':_0x1044c8[_0xe56c('0x1f')]?_[_0xe56c('0x20')](_0x1044c8['include'],function(_0x2aac60){return{'model':db[_0x2aac60[_0xe56c('0x21')]],'as':_0x2aac60['as'],'attributes':_0x2aac60[_0xe56c('0x1d')],'include':_0x2aac60['include']?_[_0xe56c('0x20')](_0x2aac60['include'],function(_0x1b88b4){return{'model':db[_0x1b88b4[_0xe56c('0x21')]],'as':_0x1b88b4['as'],'attributes':_0x1b88b4[_0xe56c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe56c('0xd')](function(_0x5666a8){logger[_0xe56c('0xe')](_0xe56c('0x23'),_0x1321b7);logger['debug'](_0xe56c('0x23'),_0x1321b7,JSON[_0xe56c('0x13')](_0x5666a8));_0x19ebe5(_0x5666a8);})['catch'](function(_0x3d4ded){logger['error']('ShowSugarcrmAccount',_0x3d4ded[_0xe56c('0x16')],_0x1321b7);_0x8a5100(_0x165533['error'](0x1f4,_0x3d4ded[_0xe56c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 639ac0f..2c52042 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 _0xd05e=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c2e5f,_0x3a9410){var _0x1bd4ee=function(_0x480cb1){while(--_0x480cb1){_0x1c2e5f['push'](_0x1c2e5f['shift']());}};_0x1bd4ee(++_0x3a9410);}(_0xd05e,0x75));var _0xed05=function(_0xb378e,_0x2904cc){_0xb378e=_0xb378e-0x0;var _0x9b147e=_0xd05e[_0xb378e];return _0x9b147e;};'use strict';var multer=require(_0xed05('0x0'));var util=require(_0xed05('0x1'));var path=require(_0xed05('0x2'));var timeout=require(_0xed05('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xed05('0x4'));var auth=require(_0xed05('0x5'));var interaction=require(_0xed05('0x6'));var config=require(_0xed05('0x7'));var controller=require(_0xed05('0x8'));router[_0xed05('0x9')]('/',auth[_0xed05('0xa')](),controller[_0xed05('0xb')]);router[_0xed05('0x9')](_0xed05('0xc'),auth[_0xed05('0xa')](),controller[_0xed05('0xd')]);router[_0xed05('0x9')](_0xed05('0xe'),auth[_0xed05('0xa')](),controller[_0xed05('0xf')]);router[_0xed05('0x9')](_0xed05('0x10'),auth[_0xed05('0xa')](),controller[_0xed05('0x11')]);router['get']('/:id/descriptions',auth[_0xed05('0xa')](),controller[_0xed05('0x12')]);router[_0xed05('0x13')]('/',auth['isAuthenticated'](),controller[_0xed05('0x14')]);router[_0xed05('0x15')](_0xed05('0xc'),auth['isAuthenticated'](),controller[_0xed05('0x16')]);router[_0xed05('0x17')](_0xed05('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xed05('0x18')]=router; \ No newline at end of file +var _0xd35f=['put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','create'];(function(_0x9ed916,_0x559a29){var _0x57b7a5=function(_0x463707){while(--_0x463707){_0x9ed916['push'](_0x9ed916['shift']());}};_0x57b7a5(++_0x559a29);}(_0xd35f,0xd2));var _0xfd35=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xd35f[_0x5d88c0];return _0x1b40f0;};'use strict';var multer=require(_0xfd35('0x0'));var util=require('util');var path=require(_0xfd35('0x1'));var timeout=require(_0xfd35('0x2'));var express=require(_0xfd35('0x3'));var router=express[_0xfd35('0x4')]();var fs_extra=require(_0xfd35('0x5'));var auth=require(_0xfd35('0x6'));var interaction=require(_0xfd35('0x7'));var config=require(_0xfd35('0x8'));var controller=require(_0xfd35('0x9'));router[_0xfd35('0xa')]('/',auth[_0xfd35('0xb')](),controller[_0xfd35('0xc')]);router['get'](_0xfd35('0xd'),auth[_0xfd35('0xb')](),controller[_0xfd35('0xe')]);router[_0xfd35('0xa')](_0xfd35('0xf'),auth[_0xfd35('0xb')](),controller[_0xfd35('0x10')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xfd35('0x11')]);router[_0xfd35('0xa')]('/:id/descriptions',auth[_0xfd35('0xb')](),controller[_0xfd35('0x12')]);router['post']('/',auth[_0xfd35('0xb')](),controller[_0xfd35('0x13')]);router[_0xfd35('0x14')](_0xfd35('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfd35('0x15')](_0xfd35('0xd'),auth[_0xfd35('0xb')](),controller['destroy']);module[_0xfd35('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1e1647e..93a3960 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 _0xc7ca=['STRING','sequelize','exports'];(function(_0x4fa1eb,_0x54c509){var _0x17524f=function(_0x1af641){while(--_0x1af641){_0x4fa1eb['push'](_0x4fa1eb['shift']());}};_0x17524f(++_0x54c509);}(_0xc7ca,0x106));var _0xac7c=function(_0x426238,_0x11772a){_0x426238=_0x426238-0x0;var _0x412450=_0xc7ca[_0x426238];return _0x412450;};'use strict';var Sequelize=require(_0xac7c('0x0'));module[_0xac7c('0x1')]={'name':{'type':Sequelize[_0xac7c('0x2')]},'description':{'type':Sequelize[_0xac7c('0x2')]}}; \ No newline at end of file +var _0x4c44=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c44,0x11c));var _0x44c4=function(_0x3ba00e,_0xbd1c3d){_0x3ba00e=_0x3ba00e-0x0;var _0x33cb79=_0x4c44[_0x3ba00e];return _0x33cb79;};'use strict';var Sequelize=require(_0x44c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x44c4('0x1')]},'description':{'type':Sequelize[_0x44c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b80df4b..8a8083c 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 _0x2d5e=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','params','include','merge','create','body','find','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','limit','undefined','count','offset','status','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2d5e,0x163));var _0xe2d5=function(_0x3edff8,_0x40ee0f){_0x3edff8=_0x3edff8-0x0;var _0x1118bb=_0x2d5e[_0x3edff8];return _0x1118bb;};'use strict';var emlformat=require(_0xe2d5('0x0'));var rimraf=require(_0xe2d5('0x1'));var zipdir=require(_0xe2d5('0x2'));var jsonpatch=require(_0xe2d5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2d5('0x4'));var Mustache=require('mustache');var util=require(_0xe2d5('0x5'));var path=require('path');var sox=require(_0xe2d5('0x6'));var csv=require('to-csv');var ejs=require(_0xe2d5('0x7'));var fs=require('fs');var fs_extra=require(_0xe2d5('0x8'));var _=require(_0xe2d5('0x9'));var squel=require(_0xe2d5('0xa'));var crypto=require(_0xe2d5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe2d5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2d5('0xd'));var Redis=require(_0xe2d5('0xe'));var authService=require(_0xe2d5('0xf'));var qs=require(_0xe2d5('0x10'));var as=require(_0xe2d5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2d5('0x12'))('api');var utils=require(_0xe2d5('0x13'));var config=require(_0xe2d5('0x14'));var licenseUtil=require(_0xe2d5('0x15'));var db=require(_0xe2d5('0x16'))['db'];function respondWithStatusCode(_0x47d7b6,_0x24e5c1){_0x24e5c1=_0x24e5c1||0xcc;return function(_0x2c59ec){if(_0x2c59ec){return _0x47d7b6[_0xe2d5('0x17')](_0x24e5c1);}return _0x47d7b6['status'](_0x24e5c1)[_0xe2d5('0x18')]();};}function respondWithResult(_0x3b87b2,_0x3544e4){_0x3544e4=_0x3544e4||0xc8;return function(_0x4602f9){if(_0x4602f9){return _0x3b87b2['status'](_0x3544e4)['json'](_0x4602f9);}};}function respondWithFilteredResult(_0x20c0df,_0x224c12){return function(_0x4a58cc){if(_0x4a58cc){var _0x578cdc=typeof _0x224c12['offset']==='undefined'&&typeof _0x224c12[_0xe2d5('0x19')]===_0xe2d5('0x1a');var _0x5b1022=_0x4a58cc[_0xe2d5('0x1b')];var _0x242784=_0x578cdc?0x0:_0x224c12[_0xe2d5('0x1c')];var _0x74f106=_0x578cdc?_0x4a58cc[_0xe2d5('0x1b')]:_0x224c12[_0xe2d5('0x1c')]+_0x224c12[_0xe2d5('0x19')];var _0x462dd0;if(_0x74f106>=_0x5b1022){_0x74f106=_0x5b1022;_0x462dd0=0xc8;}else{_0x462dd0=0xce;}_0x20c0df[_0xe2d5('0x1d')](_0x462dd0);return _0x20c0df[_0xe2d5('0x1e')]('Content-Range',_0x242784+'-'+_0x74f106+'/'+_0x5b1022)[_0xe2d5('0x1f')](_0x4a58cc);}return null;};}function patchUpdates(_0xe133bc){return function(_0x50afc0){try{jsonpatch[_0xe2d5('0x20')](_0x50afc0,_0xe133bc,!![]);}catch(_0x20756d){return BPromise[_0xe2d5('0x21')](_0x20756d);}return _0x50afc0[_0xe2d5('0x22')]();};}function saveUpdates(_0x5dc2af,_0x318193){return function(_0x24264e){if(_0x24264e){return _0x24264e[_0xe2d5('0x23')](_0x5dc2af)['then'](function(_0x101f0e){return _0x101f0e;});}return null;};}function removeEntity(_0x18b77b,_0x22944c){return function(_0x4edb42){if(_0x4edb42){return _0x4edb42['destroy']()[_0xe2d5('0x24')](function(){_0x18b77b[_0xe2d5('0x1d')](0xcc)[_0xe2d5('0x18')]();});}};}function handleEntityNotFound(_0x3b1dc7,_0x36a39b){return function(_0x4776f9){if(!_0x4776f9){_0x3b1dc7[_0xe2d5('0x17')](0x194);}return _0x4776f9;};}function handleError(_0xd8bf9a,_0x383d99){_0x383d99=_0x383d99||0x1f4;return function(_0x41f4b8){logger[_0xe2d5('0x25')](_0x41f4b8[_0xe2d5('0x26')]);if(_0x41f4b8[_0xe2d5('0x27')]){delete _0x41f4b8[_0xe2d5('0x27')];}_0xd8bf9a[_0xe2d5('0x1d')](_0x383d99)[_0xe2d5('0x28')](_0x41f4b8);};}exports[_0xe2d5('0x29')]=function(_0x4887bc,_0x4988d8){var _0x5a3292={},_0x3b6702={},_0x503d43={'count':0x0,'rows':[]};var _0x1fb478=_[_0xe2d5('0x2a')](db['SugarcrmConfiguration'][_0xe2d5('0x2b')],function(_0x3afaa0){return{'name':_0x3afaa0[_0xe2d5('0x2c')],'type':_0x3afaa0['type'][_0xe2d5('0x2d')]};});_0x3b6702[_0xe2d5('0x2e')]=_[_0xe2d5('0x2a')](_0x1fb478,'name');_0x3b6702['query']=_[_0xe2d5('0x2f')](_0x4887bc[_0xe2d5('0x30')]);_0x3b6702[_0xe2d5('0x31')]=_[_0xe2d5('0x32')](_0x3b6702[_0xe2d5('0x2e')],_0x3b6702['query']);_0x5a3292[_0xe2d5('0x33')]=_[_0xe2d5('0x32')](_0x3b6702['model'],qs[_0xe2d5('0x34')](_0x4887bc[_0xe2d5('0x30')]['fields']));_0x5a3292[_0xe2d5('0x33')]=_0x5a3292[_0xe2d5('0x33')][_0xe2d5('0x35')]?_0x5a3292[_0xe2d5('0x33')]:_0x3b6702['model'];if(!_0x4887bc['query'][_0xe2d5('0x36')](_0xe2d5('0x37'))){_0x5a3292['limit']=qs['limit'](_0x4887bc['query']['limit']);_0x5a3292['offset']=qs['offset'](_0x4887bc[_0xe2d5('0x30')][_0xe2d5('0x1c')]);}_0x5a3292[_0xe2d5('0x38')]=qs[_0xe2d5('0x39')](_0x4887bc[_0xe2d5('0x30')][_0xe2d5('0x39')]);_0x5a3292[_0xe2d5('0x3a')]=qs[_0xe2d5('0x31')](_[_0xe2d5('0x3b')](_0x4887bc['query'],_0x3b6702[_0xe2d5('0x31')]),_0x1fb478);if(_0x4887bc[_0xe2d5('0x30')][_0xe2d5('0x3c')]){_0x5a3292[_0xe2d5('0x3a')]=_['merge'](_0x5a3292['where'],{'$or':_[_0xe2d5('0x2a')](_0x1fb478,function(_0x15eb5c){if(_0x15eb5c['type']!==_0xe2d5('0x3d')){var _0x29250b={};_0x29250b[_0x15eb5c[_0xe2d5('0x27')]]={'$like':'%'+_0x4887bc['query']['filter']+'%'};return _0x29250b;}})});}_0x5a3292=_['merge']({},_0x5a3292,_0x4887bc[_0xe2d5('0x3e')]);var _0x285164={'where':_0x5a3292['where']};return db[_0xe2d5('0x3f')][_0xe2d5('0x1b')](_0x285164)[_0xe2d5('0x24')](function(_0x1e204b){_0x503d43['count']=_0x1e204b;if(_0x4887bc['query'][_0xe2d5('0x40')]){_0x5a3292['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xe2d5('0x41')](_0x5a3292);})['then'](function(_0x3bf979){_0x503d43[_0xe2d5('0x42')]=_0x3bf979;return _0x503d43;})[_0xe2d5('0x24')](respondWithFilteredResult(_0x4988d8,_0x5a3292))[_0xe2d5('0x43')](handleError(_0x4988d8,null));};exports[_0xe2d5('0x44')]=function(_0x3704fb,_0x5164cb){var _0x5de173={'raw':![],'where':{'id':_0x3704fb[_0xe2d5('0x45')]['id']}},_0x5057e4={};_0x5057e4[_0xe2d5('0x2e')]=_[_0xe2d5('0x2f')](db[_0xe2d5('0x3f')][_0xe2d5('0x2b')]);_0x5057e4[_0xe2d5('0x30')]=_[_0xe2d5('0x2f')](_0x3704fb[_0xe2d5('0x30')]);_0x5057e4['filters']=_[_0xe2d5('0x32')](_0x5057e4[_0xe2d5('0x2e')],_0x5057e4[_0xe2d5('0x30')]);_0x5de173[_0xe2d5('0x33')]=_[_0xe2d5('0x32')](_0x5057e4[_0xe2d5('0x2e')],qs['fields'](_0x3704fb[_0xe2d5('0x30')][_0xe2d5('0x34')]));_0x5de173[_0xe2d5('0x33')]=_0x5de173['attributes'][_0xe2d5('0x35')]?_0x5de173[_0xe2d5('0x33')]:_0x5057e4['model'];if(_0x3704fb[_0xe2d5('0x30')][_0xe2d5('0x40')]){_0x5de173[_0xe2d5('0x46')]=[{'all':!![]}];}_0x5de173=_[_0xe2d5('0x47')]({},_0x5de173,_0x3704fb['options']);return db[_0xe2d5('0x3f')]['find'](_0x5de173)[_0xe2d5('0x24')](handleEntityNotFound(_0x5164cb,null))[_0xe2d5('0x24')](respondWithResult(_0x5164cb,null))['catch'](handleError(_0x5164cb,null));};exports[_0xe2d5('0x48')]=function(_0x4fcdcd,_0x4671cd){return db['SugarcrmConfiguration'][_0xe2d5('0x48')](_0x4fcdcd[_0xe2d5('0x49')],{})[_0xe2d5('0x24')](respondWithResult(_0x4671cd,0xc9))[_0xe2d5('0x43')](handleError(_0x4671cd,null));};exports[_0xe2d5('0x23')]=function(_0x548e47,_0xc5ac4){if(_0x548e47[_0xe2d5('0x49')]['id']){delete _0x548e47[_0xe2d5('0x49')]['id'];}return db[_0xe2d5('0x3f')][_0xe2d5('0x4a')]({'where':{'id':_0x548e47[_0xe2d5('0x45')]['id']}})[_0xe2d5('0x24')](handleEntityNotFound(_0xc5ac4,null))['then'](saveUpdates(_0x548e47[_0xe2d5('0x49')],null))[_0xe2d5('0x24')](respondWithResult(_0xc5ac4,null))[_0xe2d5('0x43')](handleError(_0xc5ac4,null));};exports[_0xe2d5('0x4b')]=function(_0x4a1958,_0x32be9e){return db[_0xe2d5('0x3f')]['find']({'where':{'id':_0x4a1958[_0xe2d5('0x45')]['id']}})[_0xe2d5('0x24')](handleEntityNotFound(_0x32be9e,null))['then'](removeEntity(_0x32be9e,null))['catch'](handleError(_0x32be9e,null));};exports[_0xe2d5('0x4c')]=function(_0xa324fe,_0x3ef7dc,_0x17d982){var _0x246936={};var _0x9d34f5={};var _0x5bf0f0;var _0x39ea8e;return db[_0xe2d5('0x3f')][_0xe2d5('0x4d')]({'where':{'id':_0xa324fe['params']['id']}})[_0xe2d5('0x24')](handleEntityNotFound(_0x3ef7dc,null))[_0xe2d5('0x24')](function(_0x5540cd){if(_0x5540cd){_0x5bf0f0=_0x5540cd;_0x9d34f5['model']=_[_0xe2d5('0x2f')](db[_0xe2d5('0x4e')]['rawAttributes']);_0x9d34f5[_0xe2d5('0x30')]=_[_0xe2d5('0x2f')](_0xa324fe[_0xe2d5('0x30')]);_0x9d34f5[_0xe2d5('0x31')]=_[_0xe2d5('0x32')](_0x9d34f5['model'],_0x9d34f5[_0xe2d5('0x30')]);_0x246936[_0xe2d5('0x33')]=_['intersection'](_0x9d34f5[_0xe2d5('0x2e')],qs[_0xe2d5('0x34')](_0xa324fe[_0xe2d5('0x30')][_0xe2d5('0x34')]));_0x246936[_0xe2d5('0x33')]=_0x246936[_0xe2d5('0x33')]['length']?_0x246936['attributes']:_0x9d34f5['model'];_0x246936[_0xe2d5('0x38')]=qs['sort'](_0xa324fe[_0xe2d5('0x30')][_0xe2d5('0x39')]);_0x246936[_0xe2d5('0x3a')]=qs[_0xe2d5('0x31')](_[_0xe2d5('0x3b')](_0xa324fe[_0xe2d5('0x30')],_0x9d34f5[_0xe2d5('0x31')]));if(_0xa324fe[_0xe2d5('0x30')][_0xe2d5('0x3c')]){_0x246936[_0xe2d5('0x3a')]=_['merge'](_0x246936[_0xe2d5('0x3a')],{'$or':_[_0xe2d5('0x2a')](_0x246936[_0xe2d5('0x33')],function(_0x145815){var _0x3100d3={};_0x3100d3[_0x145815]={'$like':'%'+_0xa324fe['query'][_0xe2d5('0x3c')]+'%'};return _0x3100d3;})});}_0x246936=_[_0xe2d5('0x47')]({},_0x246936,_0xa324fe[_0xe2d5('0x3e')]);return _0x5bf0f0[_0xe2d5('0x4c')](_0x246936);}})['then'](function(_0x4fa581){if(_0x4fa581){_0x39ea8e=_0x4fa581[_0xe2d5('0x35')];if(!_0xa324fe[_0xe2d5('0x30')]['hasOwnProperty'](_0xe2d5('0x37'))){_0x246936['limit']=qs[_0xe2d5('0x19')](_0xa324fe['query'][_0xe2d5('0x19')]);_0x246936[_0xe2d5('0x1c')]=qs[_0xe2d5('0x1c')](_0xa324fe[_0xe2d5('0x30')][_0xe2d5('0x1c')]);}return _0x5bf0f0[_0xe2d5('0x4c')](_0x246936);}})['then'](function(_0x83b785){if(_0x83b785){return _0x83b785?{'count':_0x39ea8e,'rows':_0x83b785}:null;}})[_0xe2d5('0x24')](respondWithResult(_0x3ef7dc,null))[_0xe2d5('0x43')](handleError(_0x3ef7dc,null));};exports[_0xe2d5('0x4f')]=function(_0x2a5afa,_0x1fb085,_0x284762){var _0xdf1507={};var _0x5e48f9={};var _0x5199f3;var _0x58a503;return db['SugarcrmConfiguration'][_0xe2d5('0x4d')]({'where':{'id':_0x2a5afa[_0xe2d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fb085,null))[_0xe2d5('0x24')](function(_0x348389){if(_0x348389){_0x5199f3=_0x348389;_0x5e48f9[_0xe2d5('0x2e')]=_['keys'](db[_0xe2d5('0x4e')][_0xe2d5('0x2b')]);_0x5e48f9[_0xe2d5('0x30')]=_[_0xe2d5('0x2f')](_0x2a5afa[_0xe2d5('0x30')]);_0x5e48f9['filters']=_[_0xe2d5('0x32')](_0x5e48f9[_0xe2d5('0x2e')],_0x5e48f9[_0xe2d5('0x30')]);_0xdf1507[_0xe2d5('0x33')]=_['intersection'](_0x5e48f9['model'],qs[_0xe2d5('0x34')](_0x2a5afa['query']['fields']));_0xdf1507[_0xe2d5('0x33')]=_0xdf1507['attributes'][_0xe2d5('0x35')]?_0xdf1507[_0xe2d5('0x33')]:_0x5e48f9['model'];_0xdf1507[_0xe2d5('0x38')]=qs['sort'](_0x2a5afa[_0xe2d5('0x30')][_0xe2d5('0x39')]);_0xdf1507['where']=qs[_0xe2d5('0x31')](_['pick'](_0x2a5afa[_0xe2d5('0x30')],_0x5e48f9[_0xe2d5('0x31')]));if(_0x2a5afa[_0xe2d5('0x30')][_0xe2d5('0x3c')]){_0xdf1507['where']=_[_0xe2d5('0x47')](_0xdf1507[_0xe2d5('0x3a')],{'$or':_['map'](_0xdf1507['attributes'],function(_0x57cc74){var _0x501995={};_0x501995[_0x57cc74]={'$like':'%'+_0x2a5afa[_0xe2d5('0x30')][_0xe2d5('0x3c')]+'%'};return _0x501995;})});}_0xdf1507=_[_0xe2d5('0x47')]({},_0xdf1507,_0x2a5afa[_0xe2d5('0x3e')]);return _0x5199f3[_0xe2d5('0x4f')](_0xdf1507);}})[_0xe2d5('0x24')](function(_0x9993c8){if(_0x9993c8){_0x58a503=_0x9993c8['length'];if(!_0x2a5afa[_0xe2d5('0x30')][_0xe2d5('0x36')](_0xe2d5('0x37'))){_0xdf1507[_0xe2d5('0x19')]=qs[_0xe2d5('0x19')](_0x2a5afa[_0xe2d5('0x30')][_0xe2d5('0x19')]);_0xdf1507[_0xe2d5('0x1c')]=qs[_0xe2d5('0x1c')](_0x2a5afa[_0xe2d5('0x30')]['offset']);}return _0x5199f3[_0xe2d5('0x4f')](_0xdf1507);}})['then'](function(_0x472e9c){if(_0x472e9c){return _0x472e9c?{'count':_0x58a503,'rows':_0x472e9c}:null;}})['then'](respondWithResult(_0x1fb085,null))['catch'](handleError(_0x1fb085,null));};exports[_0xe2d5('0x50')]=function(_0x2192ed,_0x5c13c5,_0x23c9ff){var _0x5f272e={};var _0x5cd185={};var _0x45c224;var _0x15a998;return db[_0xe2d5('0x3f')][_0xe2d5('0x4d')]({'where':{'id':_0x2192ed[_0xe2d5('0x45')]['id']}})[_0xe2d5('0x24')](handleEntityNotFound(_0x5c13c5,null))[_0xe2d5('0x24')](function(_0x4f15b9){if(_0x4f15b9){_0x45c224=_0x4f15b9;_0x5cd185[_0xe2d5('0x2e')]=_[_0xe2d5('0x2f')](db[_0xe2d5('0x4e')][_0xe2d5('0x2b')]);_0x5cd185[_0xe2d5('0x30')]=_[_0xe2d5('0x2f')](_0x2192ed[_0xe2d5('0x30')]);_0x5cd185[_0xe2d5('0x31')]=_[_0xe2d5('0x32')](_0x5cd185[_0xe2d5('0x2e')],_0x5cd185[_0xe2d5('0x30')]);_0x5f272e[_0xe2d5('0x33')]=_[_0xe2d5('0x32')](_0x5cd185[_0xe2d5('0x2e')],qs['fields'](_0x2192ed[_0xe2d5('0x30')][_0xe2d5('0x34')]));_0x5f272e['attributes']=_0x5f272e[_0xe2d5('0x33')][_0xe2d5('0x35')]?_0x5f272e[_0xe2d5('0x33')]:_0x5cd185[_0xe2d5('0x2e')];_0x5f272e[_0xe2d5('0x38')]=qs['sort'](_0x2192ed[_0xe2d5('0x30')][_0xe2d5('0x39')]);_0x5f272e[_0xe2d5('0x3a')]=qs[_0xe2d5('0x31')](_[_0xe2d5('0x3b')](_0x2192ed['query'],_0x5cd185[_0xe2d5('0x31')]));if(_0x2192ed['query'][_0xe2d5('0x3c')]){_0x5f272e[_0xe2d5('0x3a')]=_[_0xe2d5('0x47')](_0x5f272e[_0xe2d5('0x3a')],{'$or':_[_0xe2d5('0x2a')](_0x5f272e['attributes'],function(_0x420ab6){var _0x3f9cfd={};_0x3f9cfd[_0x420ab6]={'$like':'%'+_0x2192ed[_0xe2d5('0x30')]['filter']+'%'};return _0x3f9cfd;})});}_0x5f272e=_[_0xe2d5('0x47')]({},_0x5f272e,_0x2192ed[_0xe2d5('0x3e')]);return _0x45c224['getDescriptions'](_0x5f272e);}})['then'](function(_0x1c6ee5){if(_0x1c6ee5){_0x15a998=_0x1c6ee5[_0xe2d5('0x35')];if(!_0x2192ed[_0xe2d5('0x30')]['hasOwnProperty'](_0xe2d5('0x37'))){_0x5f272e[_0xe2d5('0x19')]=qs[_0xe2d5('0x19')](_0x2192ed[_0xe2d5('0x30')][_0xe2d5('0x19')]);_0x5f272e[_0xe2d5('0x1c')]=qs[_0xe2d5('0x1c')](_0x2192ed[_0xe2d5('0x30')][_0xe2d5('0x1c')]);}return _0x45c224[_0xe2d5('0x50')](_0x5f272e);}})['then'](function(_0x2b0eb7){if(_0x2b0eb7){return _0x2b0eb7?{'count':_0x15a998,'rows':_0x2b0eb7}:null;}})[_0xe2d5('0x24')](respondWithResult(_0x5c13c5,null))['catch'](handleError(_0x5c13c5,null));}; \ No newline at end of file +var _0x236b=['undefined','limit','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','getFields','SugarcrmField','order','pick','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x2d28f2,_0x3a93da){var _0x5adabf=function(_0x55bdbf){while(--_0x55bdbf){_0x2d28f2['push'](_0x2d28f2['shift']());}};_0x5adabf(++_0x3a93da);}(_0x236b,0x132));var _0xb236=function(_0x402d9d,_0x3667c3){_0x402d9d=_0x402d9d-0x0;var _0xe93876=_0x236b[_0x402d9d];return _0xe93876;};'use strict';var emlformat=require(_0xb236('0x0'));var rimraf=require(_0xb236('0x1'));var zipdir=require(_0xb236('0x2'));var jsonpatch=require(_0xb236('0x3'));var rp=require(_0xb236('0x4'));var moment=require(_0xb236('0x5'));var BPromise=require(_0xb236('0x6'));var Mustache=require(_0xb236('0x7'));var util=require('util');var path=require(_0xb236('0x8'));var sox=require(_0xb236('0x9'));var csv=require('to-csv');var ejs=require(_0xb236('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb236('0xb'));var squel=require(_0xb236('0xc'));var crypto=require(_0xb236('0xd'));var jsforce=require(_0xb236('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb236('0xf'));var querystring=require(_0xb236('0x10'));var Papa=require(_0xb236('0x11'));var Redis=require('ioredis');var authService=require(_0xb236('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb236('0x13'));var logger=require(_0xb236('0x14'))(_0xb236('0x15'));var utils=require(_0xb236('0x16'));var config=require(_0xb236('0x17'));var licenseUtil=require(_0xb236('0x18'));var db=require(_0xb236('0x19'))['db'];function respondWithStatusCode(_0x14327e,_0x20fc20){_0x20fc20=_0x20fc20||0xcc;return function(_0x5d1c14){if(_0x5d1c14){return _0x14327e[_0xb236('0x1a')](_0x20fc20);}return _0x14327e[_0xb236('0x1b')](_0x20fc20)['end']();};}function respondWithResult(_0x155052,_0x2ec2a8){_0x2ec2a8=_0x2ec2a8||0xc8;return function(_0x1f68c1){if(_0x1f68c1){return _0x155052[_0xb236('0x1b')](_0x2ec2a8)[_0xb236('0x1c')](_0x1f68c1);}};}function respondWithFilteredResult(_0x2759b6,_0x593370){return function(_0x1ff36d){if(_0x1ff36d){var _0x21d319=typeof _0x593370[_0xb236('0x1d')]===_0xb236('0x1e')&&typeof _0x593370[_0xb236('0x1f')]===_0xb236('0x1e');var _0x5bd2df=_0x1ff36d['count'];var _0x4b1145=_0x21d319?0x0:_0x593370['offset'];var _0x34094f=_0x21d319?_0x1ff36d['count']:_0x593370[_0xb236('0x1d')]+_0x593370['limit'];var _0x172344;if(_0x34094f>=_0x5bd2df){_0x34094f=_0x5bd2df;_0x172344=0xc8;}else{_0x172344=0xce;}_0x2759b6[_0xb236('0x1b')](_0x172344);return _0x2759b6['set'](_0xb236('0x20'),_0x4b1145+'-'+_0x34094f+'/'+_0x5bd2df)[_0xb236('0x1c')](_0x1ff36d);}return null;};}function patchUpdates(_0x1af4f5){return function(_0x1d0bfb){try{jsonpatch[_0xb236('0x21')](_0x1d0bfb,_0x1af4f5,!![]);}catch(_0x580acd){return BPromise[_0xb236('0x22')](_0x580acd);}return _0x1d0bfb[_0xb236('0x23')]();};}function saveUpdates(_0x152205,_0x4269c6){return function(_0x266219){if(_0x266219){return _0x266219['update'](_0x152205)[_0xb236('0x24')](function(_0x2ad7b9){return _0x2ad7b9;});}return null;};}function removeEntity(_0x50baf7,_0x382326){return function(_0x450813){if(_0x450813){return _0x450813[_0xb236('0x25')]()[_0xb236('0x24')](function(){_0x50baf7[_0xb236('0x1b')](0xcc)[_0xb236('0x26')]();});}};}function handleEntityNotFound(_0x7ce8d9,_0x5ed59d){return function(_0x3fa538){if(!_0x3fa538){_0x7ce8d9[_0xb236('0x1a')](0x194);}return _0x3fa538;};}function handleError(_0x128ea8,_0x3097f7){_0x3097f7=_0x3097f7||0x1f4;return function(_0x1cba5a){logger[_0xb236('0x27')](_0x1cba5a[_0xb236('0x28')]);if(_0x1cba5a[_0xb236('0x29')]){delete _0x1cba5a[_0xb236('0x29')];}_0x128ea8[_0xb236('0x1b')](_0x3097f7)[_0xb236('0x2a')](_0x1cba5a);};}exports[_0xb236('0x2b')]=function(_0x3d45a8,_0x5f3f58){var _0x2f9a93={},_0x2ec04f={},_0x3f8f11={'count':0x0,'rows':[]};var _0x762041=_[_0xb236('0x2c')](db[_0xb236('0x2d')]['rawAttributes'],function(_0x45044b){return{'name':_0x45044b[_0xb236('0x2e')],'type':_0x45044b[_0xb236('0x2f')][_0xb236('0x30')]};});_0x2ec04f[_0xb236('0x31')]=_[_0xb236('0x2c')](_0x762041,'name');_0x2ec04f[_0xb236('0x32')]=_['keys'](_0x3d45a8[_0xb236('0x32')]);_0x2ec04f[_0xb236('0x33')]=_[_0xb236('0x34')](_0x2ec04f[_0xb236('0x31')],_0x2ec04f[_0xb236('0x32')]);_0x2f9a93[_0xb236('0x35')]=_[_0xb236('0x34')](_0x2ec04f[_0xb236('0x31')],qs[_0xb236('0x36')](_0x3d45a8[_0xb236('0x32')][_0xb236('0x36')]));_0x2f9a93[_0xb236('0x35')]=_0x2f9a93['attributes'][_0xb236('0x37')]?_0x2f9a93[_0xb236('0x35')]:_0x2ec04f[_0xb236('0x31')];if(!_0x3d45a8[_0xb236('0x32')][_0xb236('0x38')](_0xb236('0x39'))){_0x2f9a93['limit']=qs[_0xb236('0x1f')](_0x3d45a8[_0xb236('0x32')][_0xb236('0x1f')]);_0x2f9a93[_0xb236('0x1d')]=qs['offset'](_0x3d45a8[_0xb236('0x32')][_0xb236('0x1d')]);}_0x2f9a93['order']=qs[_0xb236('0x3a')](_0x3d45a8[_0xb236('0x32')][_0xb236('0x3a')]);_0x2f9a93[_0xb236('0x3b')]=qs[_0xb236('0x33')](_['pick'](_0x3d45a8[_0xb236('0x32')],_0x2ec04f['filters']),_0x762041);if(_0x3d45a8[_0xb236('0x32')][_0xb236('0x3c')]){_0x2f9a93[_0xb236('0x3b')]=_[_0xb236('0x3d')](_0x2f9a93['where'],{'$or':_[_0xb236('0x2c')](_0x762041,function(_0x1d9932){if(_0x1d9932[_0xb236('0x2f')]!=='VIRTUAL'){var _0x3fe562={};_0x3fe562[_0x1d9932[_0xb236('0x29')]]={'$like':'%'+_0x3d45a8[_0xb236('0x32')][_0xb236('0x3c')]+'%'};return _0x3fe562;}})});}_0x2f9a93=_[_0xb236('0x3d')]({},_0x2f9a93,_0x3d45a8[_0xb236('0x3e')]);var _0x49f300={'where':_0x2f9a93[_0xb236('0x3b')]};return db[_0xb236('0x2d')][_0xb236('0x3f')](_0x49f300)['then'](function(_0x1c8bf2){_0x3f8f11['count']=_0x1c8bf2;if(_0x3d45a8[_0xb236('0x32')][_0xb236('0x40')]){_0x2f9a93[_0xb236('0x41')]=[{'all':!![]}];}return db[_0xb236('0x2d')][_0xb236('0x42')](_0x2f9a93);})[_0xb236('0x24')](function(_0x268c84){_0x3f8f11[_0xb236('0x43')]=_0x268c84;return _0x3f8f11;})['then'](respondWithFilteredResult(_0x5f3f58,_0x2f9a93))[_0xb236('0x44')](handleError(_0x5f3f58,null));};exports[_0xb236('0x45')]=function(_0x17961b,_0x18f0e0){var _0x1133f8={'raw':![],'where':{'id':_0x17961b[_0xb236('0x46')]['id']}},_0x71a5b2={};_0x71a5b2['model']=_[_0xb236('0x47')](db[_0xb236('0x2d')][_0xb236('0x48')]);_0x71a5b2[_0xb236('0x32')]=_['keys'](_0x17961b[_0xb236('0x32')]);_0x71a5b2['filters']=_[_0xb236('0x34')](_0x71a5b2[_0xb236('0x31')],_0x71a5b2[_0xb236('0x32')]);_0x1133f8[_0xb236('0x35')]=_[_0xb236('0x34')](_0x71a5b2[_0xb236('0x31')],qs[_0xb236('0x36')](_0x17961b[_0xb236('0x32')][_0xb236('0x36')]));_0x1133f8[_0xb236('0x35')]=_0x1133f8['attributes'][_0xb236('0x37')]?_0x1133f8['attributes']:_0x71a5b2[_0xb236('0x31')];if(_0x17961b[_0xb236('0x32')][_0xb236('0x40')]){_0x1133f8[_0xb236('0x41')]=[{'all':!![]}];}_0x1133f8=_[_0xb236('0x3d')]({},_0x1133f8,_0x17961b[_0xb236('0x3e')]);return db['SugarcrmConfiguration'][_0xb236('0x49')](_0x1133f8)[_0xb236('0x24')](handleEntityNotFound(_0x18f0e0,null))[_0xb236('0x24')](respondWithResult(_0x18f0e0,null))[_0xb236('0x44')](handleError(_0x18f0e0,null));};exports[_0xb236('0x4a')]=function(_0x576b76,_0x426e7d){return db['SugarcrmConfiguration'][_0xb236('0x4a')](_0x576b76[_0xb236('0x4b')],{})['then'](respondWithResult(_0x426e7d,0xc9))[_0xb236('0x44')](handleError(_0x426e7d,null));};exports[_0xb236('0x4c')]=function(_0x123807,_0x47c815){if(_0x123807[_0xb236('0x4b')]['id']){delete _0x123807[_0xb236('0x4b')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x123807[_0xb236('0x46')]['id']}})['then'](handleEntityNotFound(_0x47c815,null))[_0xb236('0x24')](saveUpdates(_0x123807[_0xb236('0x4b')],null))[_0xb236('0x24')](respondWithResult(_0x47c815,null))[_0xb236('0x44')](handleError(_0x47c815,null));};exports['destroy']=function(_0x657d6a,_0x413731){return db[_0xb236('0x2d')][_0xb236('0x49')]({'where':{'id':_0x657d6a['params']['id']}})['then'](handleEntityNotFound(_0x413731,null))[_0xb236('0x24')](removeEntity(_0x413731,null))[_0xb236('0x44')](handleError(_0x413731,null));};exports[_0xb236('0x4d')]=function(_0x819182,_0x358402,_0xac87fa){var _0x4721c7={};var _0x11fc34={};var _0xfd325b;var _0x3a9658;return db[_0xb236('0x2d')]['findOne']({'where':{'id':_0x819182[_0xb236('0x46')]['id']}})[_0xb236('0x24')](handleEntityNotFound(_0x358402,null))[_0xb236('0x24')](function(_0x282a9c){if(_0x282a9c){_0xfd325b=_0x282a9c;_0x11fc34['model']=_[_0xb236('0x47')](db[_0xb236('0x4e')][_0xb236('0x48')]);_0x11fc34[_0xb236('0x32')]=_['keys'](_0x819182[_0xb236('0x32')]);_0x11fc34[_0xb236('0x33')]=_[_0xb236('0x34')](_0x11fc34['model'],_0x11fc34[_0xb236('0x32')]);_0x4721c7[_0xb236('0x35')]=_['intersection'](_0x11fc34[_0xb236('0x31')],qs[_0xb236('0x36')](_0x819182[_0xb236('0x32')]['fields']));_0x4721c7['attributes']=_0x4721c7[_0xb236('0x35')][_0xb236('0x37')]?_0x4721c7[_0xb236('0x35')]:_0x11fc34[_0xb236('0x31')];_0x4721c7[_0xb236('0x4f')]=qs[_0xb236('0x3a')](_0x819182['query']['sort']);_0x4721c7[_0xb236('0x3b')]=qs[_0xb236('0x33')](_[_0xb236('0x50')](_0x819182['query'],_0x11fc34[_0xb236('0x33')]));if(_0x819182[_0xb236('0x32')]['filter']){_0x4721c7['where']=_['merge'](_0x4721c7[_0xb236('0x3b')],{'$or':_[_0xb236('0x2c')](_0x4721c7[_0xb236('0x35')],function(_0x27dbdb){var _0x3c7d2b={};_0x3c7d2b[_0x27dbdb]={'$like':'%'+_0x819182[_0xb236('0x32')]['filter']+'%'};return _0x3c7d2b;})});}_0x4721c7=_['merge']({},_0x4721c7,_0x819182[_0xb236('0x3e')]);return _0xfd325b[_0xb236('0x4d')](_0x4721c7);}})[_0xb236('0x24')](function(_0x2c8bde){if(_0x2c8bde){_0x3a9658=_0x2c8bde['length'];if(!_0x819182[_0xb236('0x32')][_0xb236('0x38')](_0xb236('0x39'))){_0x4721c7['limit']=qs[_0xb236('0x1f')](_0x819182[_0xb236('0x32')][_0xb236('0x1f')]);_0x4721c7['offset']=qs[_0xb236('0x1d')](_0x819182['query'][_0xb236('0x1d')]);}return _0xfd325b[_0xb236('0x4d')](_0x4721c7);}})['then'](function(_0x39518a){if(_0x39518a){return _0x39518a?{'count':_0x3a9658,'rows':_0x39518a}:null;}})[_0xb236('0x24')](respondWithResult(_0x358402,null))[_0xb236('0x44')](handleError(_0x358402,null));};exports['getSubjects']=function(_0x1db20e,_0x15740c,_0x439a56){var _0x94949f={};var _0x2fed8c={};var _0x449383;var _0xd76b70;return db[_0xb236('0x2d')][_0xb236('0x51')]({'where':{'id':_0x1db20e[_0xb236('0x46')]['id']}})[_0xb236('0x24')](handleEntityNotFound(_0x15740c,null))[_0xb236('0x24')](function(_0x30af85){if(_0x30af85){_0x449383=_0x30af85;_0x2fed8c[_0xb236('0x31')]=_[_0xb236('0x47')](db['SugarcrmField']['rawAttributes']);_0x2fed8c[_0xb236('0x32')]=_['keys'](_0x1db20e[_0xb236('0x32')]);_0x2fed8c['filters']=_[_0xb236('0x34')](_0x2fed8c['model'],_0x2fed8c['query']);_0x94949f[_0xb236('0x35')]=_[_0xb236('0x34')](_0x2fed8c[_0xb236('0x31')],qs[_0xb236('0x36')](_0x1db20e[_0xb236('0x32')][_0xb236('0x36')]));_0x94949f[_0xb236('0x35')]=_0x94949f['attributes']['length']?_0x94949f[_0xb236('0x35')]:_0x2fed8c[_0xb236('0x31')];_0x94949f['order']=qs[_0xb236('0x3a')](_0x1db20e[_0xb236('0x32')][_0xb236('0x3a')]);_0x94949f[_0xb236('0x3b')]=qs[_0xb236('0x33')](_[_0xb236('0x50')](_0x1db20e[_0xb236('0x32')],_0x2fed8c['filters']));if(_0x1db20e[_0xb236('0x32')]['filter']){_0x94949f['where']=_[_0xb236('0x3d')](_0x94949f[_0xb236('0x3b')],{'$or':_[_0xb236('0x2c')](_0x94949f[_0xb236('0x35')],function(_0x414771){var _0x56e7ac={};_0x56e7ac[_0x414771]={'$like':'%'+_0x1db20e[_0xb236('0x32')]['filter']+'%'};return _0x56e7ac;})});}_0x94949f=_[_0xb236('0x3d')]({},_0x94949f,_0x1db20e[_0xb236('0x3e')]);return _0x449383['getSubjects'](_0x94949f);}})['then'](function(_0x5928cb){if(_0x5928cb){_0xd76b70=_0x5928cb[_0xb236('0x37')];if(!_0x1db20e[_0xb236('0x32')][_0xb236('0x38')](_0xb236('0x39'))){_0x94949f[_0xb236('0x1f')]=qs[_0xb236('0x1f')](_0x1db20e['query']['limit']);_0x94949f[_0xb236('0x1d')]=qs['offset'](_0x1db20e[_0xb236('0x32')][_0xb236('0x1d')]);}return _0x449383[_0xb236('0x52')](_0x94949f);}})[_0xb236('0x24')](function(_0x2b25c6){if(_0x2b25c6){return _0x2b25c6?{'count':_0xd76b70,'rows':_0x2b25c6}:null;}})[_0xb236('0x24')](respondWithResult(_0x15740c,null))['catch'](handleError(_0x15740c,null));};exports['getDescriptions']=function(_0x261237,_0x15ab4c,_0x2d3732){var _0x31ec30={};var _0x5cd5be={};var _0x94c0b9;var _0x3a9e10;return db['SugarcrmConfiguration'][_0xb236('0x51')]({'where':{'id':_0x261237[_0xb236('0x46')]['id']}})[_0xb236('0x24')](handleEntityNotFound(_0x15ab4c,null))[_0xb236('0x24')](function(_0x214cb7){if(_0x214cb7){_0x94c0b9=_0x214cb7;_0x5cd5be[_0xb236('0x31')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x5cd5be['query']=_['keys'](_0x261237[_0xb236('0x32')]);_0x5cd5be[_0xb236('0x33')]=_[_0xb236('0x34')](_0x5cd5be[_0xb236('0x31')],_0x5cd5be[_0xb236('0x32')]);_0x31ec30[_0xb236('0x35')]=_[_0xb236('0x34')](_0x5cd5be[_0xb236('0x31')],qs[_0xb236('0x36')](_0x261237[_0xb236('0x32')][_0xb236('0x36')]));_0x31ec30[_0xb236('0x35')]=_0x31ec30[_0xb236('0x35')][_0xb236('0x37')]?_0x31ec30[_0xb236('0x35')]:_0x5cd5be[_0xb236('0x31')];_0x31ec30['order']=qs[_0xb236('0x3a')](_0x261237[_0xb236('0x32')]['sort']);_0x31ec30[_0xb236('0x3b')]=qs[_0xb236('0x33')](_[_0xb236('0x50')](_0x261237[_0xb236('0x32')],_0x5cd5be[_0xb236('0x33')]));if(_0x261237[_0xb236('0x32')]['filter']){_0x31ec30[_0xb236('0x3b')]=_['merge'](_0x31ec30[_0xb236('0x3b')],{'$or':_['map'](_0x31ec30['attributes'],function(_0x484924){var _0x20a1c7={};_0x20a1c7[_0x484924]={'$like':'%'+_0x261237['query']['filter']+'%'};return _0x20a1c7;})});}_0x31ec30=_[_0xb236('0x3d')]({},_0x31ec30,_0x261237[_0xb236('0x3e')]);return _0x94c0b9[_0xb236('0x53')](_0x31ec30);}})[_0xb236('0x24')](function(_0x240b09){if(_0x240b09){_0x3a9e10=_0x240b09['length'];if(!_0x261237['query'][_0xb236('0x38')](_0xb236('0x39'))){_0x31ec30[_0xb236('0x1f')]=qs[_0xb236('0x1f')](_0x261237[_0xb236('0x32')][_0xb236('0x1f')]);_0x31ec30[_0xb236('0x1d')]=qs[_0xb236('0x1d')](_0x261237[_0xb236('0x32')]['offset']);}return _0x94c0b9[_0xb236('0x53')](_0x31ec30);}})[_0xb236('0x24')](function(_0x18c489){if(_0x18c489){return _0x18c489?{'count':_0x3a9e10,'rows':_0x18c489}:null;}})[_0xb236('0x24')](respondWithResult(_0x15ab4c,null))[_0xb236('0x44')](handleError(_0x15ab4c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 44c4085..5614318 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 _0x459a=['../../config/environment','exports','define','int_sugarcrm_configurations','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x29cc72,_0x219c02){var _0x3b6570=function(_0x5f4517){while(--_0x5f4517){_0x29cc72['push'](_0x29cc72['shift']());}};_0x3b6570(++_0x219c02);}(_0x459a,0x1da));var _0xa459=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x459a[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require(_0xa459('0x0'));var util=require(_0xa459('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa459('0x2'));var BPromise=require(_0xa459('0x3'));var rp=require(_0xa459('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa459('0x5'));var config=require(_0xa459('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xa459('0x7')]=function(_0x2d312f,_0x1bfd19){return _0x2d312f[_0xa459('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xa459('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e20=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x66524f,_0x437009){var _0x1f1b8e=function(_0xc30b81){while(--_0xc30b81){_0x66524f['push'](_0x66524f['shift']());}};_0x1f1b8e(++_0x437009);}(_0x8e20,0xf2));var _0x08e2=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x8e20[_0x79b649];return _0x1af9b1;};'use strict';var _=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var logger=require(_0x08e2('0x2'))(_0x08e2('0x3'));var moment=require(_0x08e2('0x4'));var BPromise=require(_0x08e2('0x5'));var rp=require(_0x08e2('0x6'));var fs=require('fs');var path=require(_0x08e2('0x7'));var rimraf=require('rimraf');var config=require(_0x08e2('0x8'));var attributes=require(_0x08e2('0x9'));module[_0x08e2('0xa')]=function(_0x48cd41,_0x53f2d5){return _0x48cd41[_0x08e2('0xb')](_0x08e2('0xc'),attributes,{'tableName':_0x08e2('0xd'),'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 9ba6db2..7d29499 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 _0xae7e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0xae7e,0x136));var _0xeae7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae7e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xeae7('0x0'));var util=require(_0xeae7('0x1'));var moment=require(_0xeae7('0x2'));var BPromise=require(_0xeae7('0x3'));var rs=require(_0xeae7('0x4'));var fs=require('fs');var Redis=require(_0xeae7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeae7('0x6'));var logger=require(_0xeae7('0x7'))(_0xeae7('0x8'));var config=require('../../config/environment');var jayson=require(_0xeae7('0x9'));var client=jayson['client'][_0xeae7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3128f3,_0xc71bb7,_0x2f12e4){return new BPromise(function(_0x2db003,_0x1702ca){return client[_0xeae7('0xb')](_0x3128f3,_0x2f12e4)[_0xeae7('0xc')](function(_0x586e44){logger[_0xeae7('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc71bb7,_0xeae7('0xe'));logger[_0xeae7('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xc71bb7,_0xeae7('0xe'),JSON[_0xeae7('0x10')](_0x586e44));if(_0x586e44[_0xeae7('0x11')]){if(_0x586e44['error']['code']===0x1f4){logger[_0xeae7('0x11')](_0xeae7('0x12'),_0xc71bb7,_0x586e44[_0xeae7('0x11')][_0xeae7('0x13')]);return _0x1702ca(_0x586e44[_0xeae7('0x11')][_0xeae7('0x13')]);}logger[_0xeae7('0x11')](_0xeae7('0x12'),_0xc71bb7,_0x586e44[_0xeae7('0x11')][_0xeae7('0x13')]);return _0x2db003(_0x586e44[_0xeae7('0x11')][_0xeae7('0x13')]);}else{logger[_0xeae7('0xd')](_0xeae7('0x12'),_0xc71bb7,_0xeae7('0xe'));_0x2db003(_0x586e44[_0xeae7('0x14')][_0xeae7('0x13')]);}})[_0xeae7('0x15')](function(_0x348eca){logger['error'](_0xeae7('0x12'),_0xc71bb7,_0x348eca);_0x1702ca(_0x348eca);});});} \ No newline at end of file +var _0x855e=['../../config/environment','jayson/promise','client','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','moment','rpc'];(function(_0x1a1a3b,_0xc8ce3c){var _0x57bd21=function(_0x15a067){while(--_0x15a067){_0x1a1a3b['push'](_0x1a1a3b['shift']());}};_0x57bd21(++_0xc8ce3c);}(_0x855e,0x184));var _0xe855=function(_0x54f1dc,_0x863c6b){_0x54f1dc=_0x54f1dc-0x0;var _0x257fcb=_0x855e[_0x54f1dc];return _0x257fcb;};'use strict';var _=require(_0xe855('0x0'));var util=require('util');var moment=require(_0xe855('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe855('0x2'));var config=require(_0xe855('0x3'));var jayson=require(_0xe855('0x4'));var client=jayson[_0xe855('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3284ac,_0x16527b,_0x37fa9e){return new BPromise(function(_0x13eec7,_0x217292){return client['request'](_0x3284ac,_0x37fa9e)[_0xe855('0x6')](function(_0x23ab45){logger[_0xe855('0x7')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x16527b,'request\x20sent');logger[_0xe855('0x8')](_0xe855('0x9'),_0x16527b,'request\x20sent',JSON[_0xe855('0xa')](_0x23ab45));if(_0x23ab45[_0xe855('0xb')]){if(_0x23ab45[_0xe855('0xb')][_0xe855('0xc')]===0x1f4){logger['error'](_0xe855('0xd'),_0x16527b,_0x23ab45['error'][_0xe855('0xe')]);return _0x217292(_0x23ab45[_0xe855('0xb')][_0xe855('0xe')]);}logger[_0xe855('0xb')](_0xe855('0xd'),_0x16527b,_0x23ab45[_0xe855('0xb')][_0xe855('0xe')]);return _0x13eec7(_0x23ab45[_0xe855('0xb')][_0xe855('0xe')]);}else{logger[_0xe855('0x7')](_0xe855('0xd'),_0x16527b,_0xe855('0xf'));_0x13eec7(_0x23ab45[_0xe855('0x10')][_0xe855('0xe')]);}})['catch'](function(_0x2b9e59){logger[_0xe855('0xb')](_0xe855('0xd'),_0x16527b,_0x2b9e59);_0x217292(_0x2b9e59);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0cff1f3..706658d 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 _0xf9ff=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0xf9ff,0x17c));var _0xff9f=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xf9ff[_0x3902c1];return _0x1266cc;};'use strict';var multer=require(_0xff9f('0x0'));var util=require(_0xff9f('0x1'));var path=require(_0xff9f('0x2'));var timeout=require(_0xff9f('0x3'));var express=require(_0xff9f('0x4'));var router=express[_0xff9f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xff9f('0x6'));var interaction=require(_0xff9f('0x7'));var config=require('../../config/environment');var controller=require(_0xff9f('0x8'));router[_0xff9f('0x9')]('/',auth[_0xff9f('0xa')](),controller[_0xff9f('0xb')]);router['get'](_0xff9f('0xc'),auth[_0xff9f('0xa')](),controller[_0xff9f('0xd')]);router[_0xff9f('0xe')]('/',auth[_0xff9f('0xa')](),controller[_0xff9f('0xf')]);router['put'](_0xff9f('0xc'),auth[_0xff9f('0xa')](),controller[_0xff9f('0x10')]);router[_0xff9f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xff9f('0x12')]);module[_0xff9f('0x13')]=router; \ No newline at end of file +var _0x95a6=['/:id','show','post','create','put','update','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x18451a,_0x260806){var _0x3c7667=function(_0x3d1ed3){while(--_0x3d1ed3){_0x18451a['push'](_0x18451a['shift']());}};_0x3c7667(++_0x260806);}(_0x95a6,0x18c));var _0x695a=function(_0x1a6f89,_0x103ab7){_0x1a6f89=_0x1a6f89-0x0;var _0x4477d2=_0x95a6[_0x1a6f89];return _0x4477d2;};'use strict';var multer=require('multer');var util=require(_0x695a('0x0'));var path=require(_0x695a('0x1'));var timeout=require(_0x695a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x695a('0x3'));var auth=require(_0x695a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x695a('0x5'));var controller=require('./intSugarcrmField.controller');router[_0x695a('0x6')]('/',auth[_0x695a('0x7')](),controller[_0x695a('0x8')]);router[_0x695a('0x6')](_0x695a('0x9'),auth[_0x695a('0x7')](),controller[_0x695a('0xa')]);router[_0x695a('0xb')]('/',auth[_0x695a('0x7')](),controller[_0x695a('0xc')]);router[_0x695a('0xd')]('/:id',auth[_0x695a('0x7')](),controller[_0x695a('0xe')]);router['delete'](_0x695a('0x9'),auth['isAuthenticated'](),controller['destroy']);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 a52aaed..6c5dbd2 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 _0x8b68=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x6629ee,_0x5cb519){var _0x23eaa4=function(_0x56c7dd){while(--_0x56c7dd){_0x6629ee['push'](_0x6629ee['shift']());}};_0x23eaa4(++_0x5cb519);}(_0x8b68,0x12a));var _0x88b6=function(_0x2fabed,_0x596c43){_0x2fabed=_0x2fabed-0x0;var _0xffe771=_0x8b68[_0x2fabed];return _0xffe771;};'use strict';var Sequelize=require(_0x88b6('0x0'));module[_0x88b6('0x1')]={'type':{'type':Sequelize[_0x88b6('0x2')](_0x88b6('0x3'),_0x88b6('0x4'),'customVariable',_0x88b6('0x5'),_0x88b6('0x6')),'defaultValue':_0x88b6('0x3')},'content':{'type':Sequelize[_0x88b6('0x7')]},'key':{'type':Sequelize[_0x88b6('0x7')]},'keyType':{'type':Sequelize[_0x88b6('0x2')](_0x88b6('0x3'),_0x88b6('0x4'),_0x88b6('0x8'))},'keyContent':{'type':Sequelize[_0x88b6('0x7')]},'idField':{'type':Sequelize[_0x88b6('0x7')]},'nameField':{'type':Sequelize[_0x88b6('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5913=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x41e603,_0x55ceba){var _0x150338=function(_0x214381){while(--_0x214381){_0x41e603['push'](_0x41e603['shift']());}};_0x150338(++_0x55ceba);}(_0x5913,0x9f));var _0x3591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5913[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3591('0x0')]={'type':{'type':Sequelize[_0x3591('0x1')](_0x3591('0x2'),_0x3591('0x3'),_0x3591('0x4'),_0x3591('0x5'),_0x3591('0x6')),'defaultValue':_0x3591('0x2')},'content':{'type':Sequelize[_0x3591('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x3591('0x2'),_0x3591('0x3'),_0x3591('0x4'))},'keyContent':{'type':Sequelize[_0x3591('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3591('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3591('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ebfe81b..cae94d1 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 _0xc3b7=['update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','keys','find','body','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0xc3b7,0x1d7));var _0x7c3b=function(_0x57864d,_0xadb42b){_0x57864d=_0x57864d-0x0;var _0x598abf=_0xc3b7[_0x57864d];return _0x598abf;};'use strict';var emlformat=require(_0x7c3b('0x0'));var rimraf=require(_0x7c3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7c3b('0x2'));var moment=require(_0x7c3b('0x3'));var BPromise=require(_0x7c3b('0x4'));var Mustache=require(_0x7c3b('0x5'));var util=require(_0x7c3b('0x6'));var path=require(_0x7c3b('0x7'));var sox=require(_0x7c3b('0x8'));var csv=require(_0x7c3b('0x9'));var ejs=require(_0x7c3b('0xa'));var fs=require('fs');var fs_extra=require(_0x7c3b('0xb'));var _=require('lodash');var squel=require(_0x7c3b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c3b('0xd'));var toCsv=require(_0x7c3b('0x9'));var querystring=require(_0x7c3b('0xe'));var Papa=require(_0x7c3b('0xf'));var Redis=require(_0x7c3b('0x10'));var authService=require(_0x7c3b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c3b('0x12'))(_0x7c3b('0x13'));var utils=require(_0x7c3b('0x14'));var config=require(_0x7c3b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9ea3,_0x474481){_0x474481=_0x474481||0xcc;return function(_0x3f541d){if(_0x3f541d){return _0x3d9ea3[_0x7c3b('0x16')](_0x474481);}return _0x3d9ea3['status'](_0x474481)[_0x7c3b('0x17')]();};}function respondWithResult(_0x2a1bfc,_0x37f51e){_0x37f51e=_0x37f51e||0xc8;return function(_0x27bb95){if(_0x27bb95){return _0x2a1bfc[_0x7c3b('0x18')](_0x37f51e)[_0x7c3b('0x19')](_0x27bb95);}};}function respondWithFilteredResult(_0x50f7bc,_0x3c848b){return function(_0x25e98d){if(_0x25e98d){var _0x158363=typeof _0x3c848b[_0x7c3b('0x1a')]===_0x7c3b('0x1b')&&typeof _0x3c848b['limit']===_0x7c3b('0x1b');var _0xe55342=_0x25e98d[_0x7c3b('0x1c')];var _0x2459b4=_0x158363?0x0:_0x3c848b[_0x7c3b('0x1a')];var _0x4625a3=_0x158363?_0x25e98d[_0x7c3b('0x1c')]:_0x3c848b[_0x7c3b('0x1a')]+_0x3c848b['limit'];var _0x170a93;if(_0x4625a3>=_0xe55342){_0x4625a3=_0xe55342;_0x170a93=0xc8;}else{_0x170a93=0xce;}_0x50f7bc[_0x7c3b('0x18')](_0x170a93);return _0x50f7bc['set'](_0x7c3b('0x1d'),_0x2459b4+'-'+_0x4625a3+'/'+_0xe55342)[_0x7c3b('0x19')](_0x25e98d);}return null;};}function patchUpdates(_0x4886ec){return function(_0x36476d){try{jsonpatch[_0x7c3b('0x1e')](_0x36476d,_0x4886ec,!![]);}catch(_0xe900fa){return BPromise[_0x7c3b('0x1f')](_0xe900fa);}return _0x36476d[_0x7c3b('0x20')]();};}function saveUpdates(_0x25096f,_0x1c3d29){return function(_0x4af6ce){if(_0x4af6ce){return _0x4af6ce[_0x7c3b('0x21')](_0x25096f)[_0x7c3b('0x22')](function(_0xa585d3){return _0xa585d3;});}return null;};}function removeEntity(_0x5e44eb,_0x225687){return function(_0x48911d){if(_0x48911d){return _0x48911d[_0x7c3b('0x23')]()[_0x7c3b('0x22')](function(){_0x5e44eb[_0x7c3b('0x18')](0xcc)[_0x7c3b('0x17')]();});}};}function handleEntityNotFound(_0x450e4c,_0x3eb6e8){return function(_0x361690){if(!_0x361690){_0x450e4c['sendStatus'](0x194);}return _0x361690;};}function handleError(_0x304691,_0x572370){_0x572370=_0x572370||0x1f4;return function(_0x35435e){logger[_0x7c3b('0x24')](_0x35435e[_0x7c3b('0x25')]);if(_0x35435e[_0x7c3b('0x26')]){delete _0x35435e[_0x7c3b('0x26')];}_0x304691[_0x7c3b('0x18')](_0x572370)[_0x7c3b('0x27')](_0x35435e);};}exports[_0x7c3b('0x28')]=function(_0x486d34,_0x17e90d){var _0x1b1b2b={},_0x530459={},_0x1525a5={'count':0x0,'rows':[]};var _0x5ce39b=_[_0x7c3b('0x29')](db[_0x7c3b('0x2a')]['rawAttributes'],function(_0x1244c1){return{'name':_0x1244c1[_0x7c3b('0x2b')],'type':_0x1244c1[_0x7c3b('0x2c')][_0x7c3b('0x2d')]};});_0x530459['model']=_[_0x7c3b('0x29')](_0x5ce39b,_0x7c3b('0x26'));_0x530459[_0x7c3b('0x2e')]=_['keys'](_0x486d34[_0x7c3b('0x2e')]);_0x530459[_0x7c3b('0x2f')]=_[_0x7c3b('0x30')](_0x530459[_0x7c3b('0x31')],_0x530459['query']);_0x1b1b2b[_0x7c3b('0x32')]=_['intersection'](_0x530459[_0x7c3b('0x31')],qs[_0x7c3b('0x33')](_0x486d34[_0x7c3b('0x2e')][_0x7c3b('0x33')]));_0x1b1b2b[_0x7c3b('0x32')]=_0x1b1b2b[_0x7c3b('0x32')][_0x7c3b('0x34')]?_0x1b1b2b[_0x7c3b('0x32')]:_0x530459[_0x7c3b('0x31')];if(!_0x486d34[_0x7c3b('0x2e')][_0x7c3b('0x35')](_0x7c3b('0x36'))){_0x1b1b2b[_0x7c3b('0x37')]=qs['limit'](_0x486d34[_0x7c3b('0x2e')][_0x7c3b('0x37')]);_0x1b1b2b[_0x7c3b('0x1a')]=qs[_0x7c3b('0x1a')](_0x486d34[_0x7c3b('0x2e')]['offset']);}_0x1b1b2b[_0x7c3b('0x38')]=qs[_0x7c3b('0x39')](_0x486d34['query'][_0x7c3b('0x39')]);_0x1b1b2b['where']=qs[_0x7c3b('0x2f')](_[_0x7c3b('0x3a')](_0x486d34[_0x7c3b('0x2e')],_0x530459[_0x7c3b('0x2f')]),_0x5ce39b);if(_0x486d34['query'][_0x7c3b('0x3b')]){_0x1b1b2b[_0x7c3b('0x3c')]=_[_0x7c3b('0x3d')](_0x1b1b2b['where'],{'$or':_[_0x7c3b('0x29')](_0x5ce39b,function(_0x36944d){if(_0x36944d['type']!==_0x7c3b('0x3e')){var _0x316e89={};_0x316e89[_0x36944d[_0x7c3b('0x26')]]={'$like':'%'+_0x486d34[_0x7c3b('0x2e')][_0x7c3b('0x3b')]+'%'};return _0x316e89;}})});}_0x1b1b2b=_[_0x7c3b('0x3d')]({},_0x1b1b2b,_0x486d34[_0x7c3b('0x3f')]);var _0x250903={'where':_0x1b1b2b['where']};return db['SugarcrmField'][_0x7c3b('0x1c')](_0x250903)[_0x7c3b('0x22')](function(_0x56fc54){_0x1525a5[_0x7c3b('0x1c')]=_0x56fc54;if(_0x486d34[_0x7c3b('0x2e')][_0x7c3b('0x40')]){_0x1b1b2b[_0x7c3b('0x41')]=[{'all':!![]}];}return db[_0x7c3b('0x2a')]['findAll'](_0x1b1b2b);})[_0x7c3b('0x22')](function(_0x675052){_0x1525a5['rows']=_0x675052;return _0x1525a5;})[_0x7c3b('0x22')](respondWithFilteredResult(_0x17e90d,_0x1b1b2b))['catch'](handleError(_0x17e90d,null));};exports[_0x7c3b('0x42')]=function(_0x23546e,_0x376652){var _0xb5ce5e={'raw':!![],'where':{'id':_0x23546e[_0x7c3b('0x43')]['id']}},_0x14fe3a={};_0x14fe3a[_0x7c3b('0x31')]=_[_0x7c3b('0x44')](db['SugarcrmField']['rawAttributes']);_0x14fe3a[_0x7c3b('0x2e')]=_['keys'](_0x23546e['query']);_0x14fe3a[_0x7c3b('0x2f')]=_[_0x7c3b('0x30')](_0x14fe3a[_0x7c3b('0x31')],_0x14fe3a['query']);_0xb5ce5e[_0x7c3b('0x32')]=_['intersection'](_0x14fe3a[_0x7c3b('0x31')],qs[_0x7c3b('0x33')](_0x23546e['query'][_0x7c3b('0x33')]));_0xb5ce5e[_0x7c3b('0x32')]=_0xb5ce5e[_0x7c3b('0x32')][_0x7c3b('0x34')]?_0xb5ce5e['attributes']:_0x14fe3a[_0x7c3b('0x31')];if(_0x23546e['query'][_0x7c3b('0x40')]){_0xb5ce5e[_0x7c3b('0x41')]=[{'all':!![]}];}_0xb5ce5e=_[_0x7c3b('0x3d')]({},_0xb5ce5e,_0x23546e['options']);return db['SugarcrmField'][_0x7c3b('0x45')](_0xb5ce5e)[_0x7c3b('0x22')](handleEntityNotFound(_0x376652,null))['then'](respondWithResult(_0x376652,null))['catch'](handleError(_0x376652,null));};exports['create']=function(_0x2040bd,_0x50a88f){return db[_0x7c3b('0x2a')]['create'](_0x2040bd[_0x7c3b('0x46')],{})[_0x7c3b('0x22')](respondWithResult(_0x50a88f,0xc9))['catch'](handleError(_0x50a88f,null));};exports[_0x7c3b('0x21')]=function(_0x188ff2,_0x40fc41){if(_0x188ff2['body']['id']){delete _0x188ff2[_0x7c3b('0x46')]['id'];}return db[_0x7c3b('0x2a')]['find']({'where':{'id':_0x188ff2[_0x7c3b('0x43')]['id']}})[_0x7c3b('0x22')](handleEntityNotFound(_0x40fc41,null))[_0x7c3b('0x22')](saveUpdates(_0x188ff2['body'],null))[_0x7c3b('0x22')](respondWithResult(_0x40fc41,null))[_0x7c3b('0x47')](handleError(_0x40fc41,null));};exports['destroy']=function(_0x4dae8b,_0xd314a1){return db[_0x7c3b('0x2a')][_0x7c3b('0x45')]({'where':{'id':_0x4dae8b[_0x7c3b('0x43')]['id']}})['then'](handleEntityNotFound(_0xd314a1,null))[_0x7c3b('0x22')](removeEntity(_0xd314a1,null))[_0x7c3b('0x47')](handleError(_0xd314a1,null));}; \ No newline at end of file +var _0x6700=['sendStatus','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','status','error','name','send','index','map','SugarcrmField','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','rows','show','params','keys','include','create','catch','update','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3182a2,_0x35d270){var _0x34309=function(_0x292459){while(--_0x292459){_0x3182a2['push'](_0x3182a2['shift']());}};_0x34309(++_0x35d270);}(_0x6700,0x7a));var _0x0670=function(_0x480ea4,_0x4c5b42){_0x480ea4=_0x480ea4-0x0;var _0x489564=_0x6700[_0x480ea4];return _0x489564;};'use strict';var emlformat=require(_0x0670('0x0'));var rimraf=require(_0x0670('0x1'));var zipdir=require(_0x0670('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0670('0x3'));var moment=require(_0x0670('0x4'));var BPromise=require(_0x0670('0x5'));var Mustache=require(_0x0670('0x6'));var util=require(_0x0670('0x7'));var path=require(_0x0670('0x8'));var sox=require(_0x0670('0x9'));var csv=require(_0x0670('0xa'));var ejs=require(_0x0670('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0670('0xc'));var squel=require(_0x0670('0xd'));var crypto=require(_0x0670('0xe'));var jsforce=require(_0x0670('0xf'));var deskjs=require(_0x0670('0x10'));var toCsv=require(_0x0670('0xa'));var querystring=require(_0x0670('0x11'));var Papa=require('papaparse');var Redis=require(_0x0670('0x12'));var authService=require(_0x0670('0x13'));var qs=require(_0x0670('0x14'));var as=require(_0x0670('0x15'));var hardwareService=require(_0x0670('0x16'));var logger=require('../../config/logger')(_0x0670('0x17'));var utils=require(_0x0670('0x18'));var config=require(_0x0670('0x19'));var licenseUtil=require(_0x0670('0x1a'));var db=require(_0x0670('0x1b'))['db'];function respondWithStatusCode(_0x1125c9,_0x515dc1){_0x515dc1=_0x515dc1||0xcc;return function(_0x22f779){if(_0x22f779){return _0x1125c9[_0x0670('0x1c')](_0x515dc1);}return _0x1125c9['status'](_0x515dc1)['end']();};}function respondWithResult(_0x47be92,_0x514f3a){_0x514f3a=_0x514f3a||0xc8;return function(_0x3a3f04){if(_0x3a3f04){return _0x47be92['status'](_0x514f3a)[_0x0670('0x1d')](_0x3a3f04);}};}function respondWithFilteredResult(_0x460e64,_0x1d2e90){return function(_0x5ce39b){if(_0x5ce39b){var _0x441b49=typeof _0x1d2e90[_0x0670('0x1e')]===_0x0670('0x1f')&&typeof _0x1d2e90['limit']===_0x0670('0x1f');var _0x23514c=_0x5ce39b['count'];var _0x10a2af=_0x441b49?0x0:_0x1d2e90[_0x0670('0x1e')];var _0xf105f9=_0x441b49?_0x5ce39b[_0x0670('0x20')]:_0x1d2e90[_0x0670('0x1e')]+_0x1d2e90[_0x0670('0x21')];var _0x3dc281;if(_0xf105f9>=_0x23514c){_0xf105f9=_0x23514c;_0x3dc281=0xc8;}else{_0x3dc281=0xce;}_0x460e64['status'](_0x3dc281);return _0x460e64[_0x0670('0x22')](_0x0670('0x23'),_0x10a2af+'-'+_0xf105f9+'/'+_0x23514c)[_0x0670('0x1d')](_0x5ce39b);}return null;};}function patchUpdates(_0x4f7db5){return function(_0x75a751){try{jsonpatch[_0x0670('0x24')](_0x75a751,_0x4f7db5,!![]);}catch(_0x23d09f){return BPromise[_0x0670('0x25')](_0x23d09f);}return _0x75a751['save']();};}function saveUpdates(_0x4f5beb,_0x1318b6){return function(_0x53975b){if(_0x53975b){return _0x53975b['update'](_0x4f5beb)[_0x0670('0x26')](function(_0x5ea669){return _0x5ea669;});}return null;};}function removeEntity(_0xc80a8a,_0x5aad9e){return function(_0x585af4){if(_0x585af4){return _0x585af4[_0x0670('0x27')]()[_0x0670('0x26')](function(){_0xc80a8a[_0x0670('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e33e0,_0x48e223){return function(_0xffcf85){if(!_0xffcf85){_0x4e33e0['sendStatus'](0x194);}return _0xffcf85;};}function handleError(_0x34aea1,_0xc2ee16){_0xc2ee16=_0xc2ee16||0x1f4;return function(_0x4877fc){logger[_0x0670('0x29')](_0x4877fc['stack']);if(_0x4877fc[_0x0670('0x2a')]){delete _0x4877fc['name'];}_0x34aea1[_0x0670('0x28')](_0xc2ee16)[_0x0670('0x2b')](_0x4877fc);};}exports[_0x0670('0x2c')]=function(_0x1f0f87,_0xec19e3){var _0x36c1b4={},_0x159797={},_0x21aaba={'count':0x0,'rows':[]};var _0x5e6d3c=_[_0x0670('0x2d')](db[_0x0670('0x2e')][_0x0670('0x2f')],function(_0x358712){return{'name':_0x358712['fieldName'],'type':_0x358712['type']['key']};});_0x159797[_0x0670('0x30')]=_['map'](_0x5e6d3c,_0x0670('0x2a'));_0x159797[_0x0670('0x31')]=_['keys'](_0x1f0f87[_0x0670('0x31')]);_0x159797['filters']=_[_0x0670('0x32')](_0x159797['model'],_0x159797[_0x0670('0x31')]);_0x36c1b4['attributes']=_[_0x0670('0x32')](_0x159797[_0x0670('0x30')],qs[_0x0670('0x33')](_0x1f0f87['query'][_0x0670('0x33')]));_0x36c1b4[_0x0670('0x34')]=_0x36c1b4[_0x0670('0x34')][_0x0670('0x35')]?_0x36c1b4['attributes']:_0x159797[_0x0670('0x30')];if(!_0x1f0f87[_0x0670('0x31')][_0x0670('0x36')](_0x0670('0x37'))){_0x36c1b4[_0x0670('0x21')]=qs['limit'](_0x1f0f87[_0x0670('0x31')][_0x0670('0x21')]);_0x36c1b4['offset']=qs[_0x0670('0x1e')](_0x1f0f87['query'][_0x0670('0x1e')]);}_0x36c1b4[_0x0670('0x38')]=qs[_0x0670('0x39')](_0x1f0f87[_0x0670('0x31')][_0x0670('0x39')]);_0x36c1b4[_0x0670('0x3a')]=qs[_0x0670('0x3b')](_[_0x0670('0x3c')](_0x1f0f87['query'],_0x159797[_0x0670('0x3b')]),_0x5e6d3c);if(_0x1f0f87[_0x0670('0x31')][_0x0670('0x3d')]){_0x36c1b4[_0x0670('0x3a')]=_[_0x0670('0x3e')](_0x36c1b4[_0x0670('0x3a')],{'$or':_['map'](_0x5e6d3c,function(_0x4683bb){if(_0x4683bb['type']!=='VIRTUAL'){var _0x32c064={};_0x32c064[_0x4683bb['name']]={'$like':'%'+_0x1f0f87['query'][_0x0670('0x3d')]+'%'};return _0x32c064;}})});}_0x36c1b4=_[_0x0670('0x3e')]({},_0x36c1b4,_0x1f0f87[_0x0670('0x3f')]);var _0x133fbc={'where':_0x36c1b4['where']};return db['SugarcrmField'][_0x0670('0x20')](_0x133fbc)[_0x0670('0x26')](function(_0x11b429){_0x21aaba[_0x0670('0x20')]=_0x11b429;if(_0x1f0f87[_0x0670('0x31')][_0x0670('0x40')]){_0x36c1b4['include']=[{'all':!![]}];}return db[_0x0670('0x2e')]['findAll'](_0x36c1b4);})[_0x0670('0x26')](function(_0x323987){_0x21aaba[_0x0670('0x41')]=_0x323987;return _0x21aaba;})['then'](respondWithFilteredResult(_0xec19e3,_0x36c1b4))['catch'](handleError(_0xec19e3,null));};exports[_0x0670('0x42')]=function(_0x1aa0ad,_0x217cb2){var _0x5c84f7={'raw':!![],'where':{'id':_0x1aa0ad[_0x0670('0x43')]['id']}},_0x3b910a={};_0x3b910a[_0x0670('0x30')]=_[_0x0670('0x44')](db['SugarcrmField'][_0x0670('0x2f')]);_0x3b910a['query']=_[_0x0670('0x44')](_0x1aa0ad[_0x0670('0x31')]);_0x3b910a[_0x0670('0x3b')]=_[_0x0670('0x32')](_0x3b910a[_0x0670('0x30')],_0x3b910a[_0x0670('0x31')]);_0x5c84f7[_0x0670('0x34')]=_[_0x0670('0x32')](_0x3b910a[_0x0670('0x30')],qs[_0x0670('0x33')](_0x1aa0ad[_0x0670('0x31')][_0x0670('0x33')]));_0x5c84f7[_0x0670('0x34')]=_0x5c84f7[_0x0670('0x34')][_0x0670('0x35')]?_0x5c84f7[_0x0670('0x34')]:_0x3b910a[_0x0670('0x30')];if(_0x1aa0ad[_0x0670('0x31')][_0x0670('0x40')]){_0x5c84f7[_0x0670('0x45')]=[{'all':!![]}];}_0x5c84f7=_[_0x0670('0x3e')]({},_0x5c84f7,_0x1aa0ad[_0x0670('0x3f')]);return db[_0x0670('0x2e')]['find'](_0x5c84f7)[_0x0670('0x26')](handleEntityNotFound(_0x217cb2,null))[_0x0670('0x26')](respondWithResult(_0x217cb2,null))['catch'](handleError(_0x217cb2,null));};exports[_0x0670('0x46')]=function(_0x154406,_0x168001){return db['SugarcrmField']['create'](_0x154406['body'],{})[_0x0670('0x26')](respondWithResult(_0x168001,0xc9))[_0x0670('0x47')](handleError(_0x168001,null));};exports[_0x0670('0x48')]=function(_0x22c844,_0x1f6fd0){if(_0x22c844[_0x0670('0x49')]['id']){delete _0x22c844[_0x0670('0x49')]['id'];}return db[_0x0670('0x2e')][_0x0670('0x4a')]({'where':{'id':_0x22c844[_0x0670('0x43')]['id']}})[_0x0670('0x26')](handleEntityNotFound(_0x1f6fd0,null))['then'](saveUpdates(_0x22c844['body'],null))[_0x0670('0x26')](respondWithResult(_0x1f6fd0,null))[_0x0670('0x47')](handleError(_0x1f6fd0,null));};exports['destroy']=function(_0x2ee2ee,_0x33ad64){return db[_0x0670('0x2e')][_0x0670('0x4a')]({'where':{'id':_0x2ee2ee['params']['id']}})[_0x0670('0x26')](handleEntityNotFound(_0x33ad64,null))[_0x0670('0x26')](removeEntity(_0x33ad64,null))['catch'](handleError(_0x33ad64,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 578fe1f..8f3e2ef 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 _0x996b=['sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0x7fb8ec,_0x224c06){var _0x46c3d5=function(_0x442195){while(--_0x442195){_0x7fb8ec['push'](_0x7fb8ec['shift']());}};_0x46c3d5(++_0x224c06);}(_0x996b,0x13d));var _0xb996=function(_0x52105a,_0x300588){_0x52105a=_0x52105a-0x0;var _0x53943e=_0x996b[_0x52105a];return _0x53943e;};'use strict';var _=require(_0xb996('0x0'));var util=require(_0xb996('0x1'));var logger=require(_0xb996('0x2'))(_0xb996('0x3'));var moment=require(_0xb996('0x4'));var BPromise=require(_0xb996('0x5'));var rp=require(_0xb996('0x6'));var fs=require('fs');var path=require(_0xb996('0x7'));var rimraf=require(_0xb996('0x8'));var config=require(_0xb996('0x9'));var attributes=require(_0xb996('0xa'));module[_0xb996('0xb')]=function(_0xe3629c,_0x221861){return _0xe3629c['define'](_0xb996('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xb996('0xd'),'fields':['idField',_0xb996('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e6b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x44c8cb,_0x2e28c7){var _0x3bf406=function(_0x2dbe74){while(--_0x2dbe74){_0x44c8cb['push'](_0x44c8cb['shift']());}};_0x3bf406(++_0x2e28c7);}(_0x1e6b,0xcf));var _0xb1e6=function(_0x4356,_0x293465){_0x4356=_0x4356-0x0;var _0x5b2f32=_0x1e6b[_0x4356];return _0x5b2f32;};'use strict';var _=require(_0xb1e6('0x0'));var util=require('util');var logger=require(_0xb1e6('0x1'))(_0xb1e6('0x2'));var moment=require(_0xb1e6('0x3'));var BPromise=require(_0xb1e6('0x4'));var rp=require(_0xb1e6('0x5'));var fs=require('fs');var path=require(_0xb1e6('0x6'));var rimraf=require('rimraf');var config=require(_0xb1e6('0x7'));var attributes=require(_0xb1e6('0x8'));module[_0xb1e6('0x9')]=function(_0x301a94,_0xc3bb93){return _0x301a94[_0xb1e6('0xa')](_0xb1e6('0xb'),attributes,{'tableName':_0xb1e6('0xc'),'paranoid':![],'indexes':[{'name':_0xb1e6('0xd'),'fields':[_0xb1e6('0xe'),_0xb1e6('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 1d17ee3..996e633 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 _0x79b0=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x46c2cb,_0x54c2ad){var _0x20cfad=function(_0x401d07){while(--_0x401d07){_0x46c2cb['push'](_0x46c2cb['shift']());}};_0x20cfad(++_0x54c2ad);}(_0x79b0,0xe3));var _0x079b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x79b0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x079b('0x0'));var util=require(_0x079b('0x1'));var moment=require(_0x079b('0x2'));var BPromise=require(_0x079b('0x3'));var rs=require(_0x079b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x079b('0x5'))['db'];var utils=require(_0x079b('0x6'));var logger=require(_0x079b('0x7'))(_0x079b('0x8'));var config=require(_0x079b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x079b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3492,_0x57f368,_0x167a22){return new BPromise(function(_0xd0c956,_0x31e715){return client[_0x079b('0xb')](_0x4b3492,_0x167a22)[_0x079b('0xc')](function(_0x2333d8){logger[_0x079b('0xd')](_0x079b('0xe'),_0x57f368,_0x079b('0xf'));logger[_0x079b('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x57f368,'request\x20sent',JSON['stringify'](_0x2333d8));if(_0x2333d8[_0x079b('0x11')]){if(_0x2333d8[_0x079b('0x11')][_0x079b('0x12')]===0x1f4){logger[_0x079b('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x57f368,_0x2333d8['error'][_0x079b('0x13')]);return _0x31e715(_0x2333d8[_0x079b('0x11')][_0x079b('0x13')]);}logger['error'](_0x079b('0xe'),_0x57f368,_0x2333d8['error']['message']);return _0xd0c956(_0x2333d8[_0x079b('0x11')]['message']);}else{logger[_0x079b('0xd')](_0x079b('0xe'),_0x57f368,_0x079b('0xf'));_0xd0c956(_0x2333d8[_0x079b('0x14')][_0x079b('0x13')]);}})[_0x079b('0x15')](function(_0x2754b3){logger[_0x079b('0x11')](_0x079b('0xe'),_0x57f368,_0x2754b3);_0x31e715(_0x2754b3);});});} \ No newline at end of file +var _0x7677=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x7677,0x12f));var _0x7767=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7677[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7767('0x0'));var util=require(_0x7767('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7767('0x2'));var fs=require('fs');var Redis=require(_0x7767('0x3'));var db=require(_0x7767('0x4'))['db'];var utils=require(_0x7767('0x5'));var logger=require(_0x7767('0x6'))(_0x7767('0x7'));var config=require('../../config/environment');var jayson=require(_0x7767('0x8'));var client=jayson[_0x7767('0x9')][_0x7767('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c393b,_0x4f1cbb,_0x550682){return new BPromise(function(_0x5eb0e7,_0x3680fb){return client[_0x7767('0xb')](_0x1c393b,_0x550682)['then'](function(_0x5a2707){logger[_0x7767('0xc')](_0x7767('0xd'),_0x4f1cbb,_0x7767('0xe'));logger[_0x7767('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x4f1cbb,_0x7767('0xe'),JSON['stringify'](_0x5a2707));if(_0x5a2707[_0x7767('0x10')]){if(_0x5a2707[_0x7767('0x10')]['code']===0x1f4){logger[_0x7767('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x4f1cbb,_0x5a2707['error'][_0x7767('0x11')]);return _0x3680fb(_0x5a2707[_0x7767('0x10')][_0x7767('0x11')]);}logger[_0x7767('0x10')](_0x7767('0xd'),_0x4f1cbb,_0x5a2707[_0x7767('0x10')]['message']);return _0x5eb0e7(_0x5a2707[_0x7767('0x10')][_0x7767('0x11')]);}else{logger[_0x7767('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x4f1cbb,_0x7767('0xe'));_0x5eb0e7(_0x5a2707[_0x7767('0x12')][_0x7767('0x11')]);}})['catch'](function(_0x3881a5){logger[_0x7767('0x10')](_0x7767('0xd'),_0x4f1cbb,_0x3881a5);_0x3680fb(_0x3881a5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 034610d..c00086a 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 _0x9e88=['index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x26c395,_0x252be8){var _0x457bcf=function(_0xf1ca9b){while(--_0xf1ca9b){_0x26c395['push'](_0x26c395['shift']());}};_0x457bcf(++_0x252be8);}(_0x9e88,0x7e));var _0x89e8=function(_0x5461d8,_0x47ac9b){_0x5461d8=_0x5461d8-0x0;var _0x43e78e=_0x9e88[_0x5461d8];return _0x43e78e;};'use strict';var multer=require(_0x89e8('0x0'));var util=require(_0x89e8('0x1'));var path=require(_0x89e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x89e8('0x3'));var router=express[_0x89e8('0x4')]();var fs_extra=require(_0x89e8('0x5'));var auth=require(_0x89e8('0x6'));var interaction=require(_0x89e8('0x7'));var config=require(_0x89e8('0x8'));var controller=require(_0x89e8('0x9'));router[_0x89e8('0xa')]('/',auth[_0x89e8('0xb')](),controller[_0x89e8('0xc')]);router[_0x89e8('0xa')](_0x89e8('0xd'),auth[_0x89e8('0xb')](),controller[_0x89e8('0xe')]);router['get'](_0x89e8('0xf'),auth[_0x89e8('0xb')](),controller['getConfigurations']);router['get'](_0x89e8('0x10'),auth[_0x89e8('0xb')](),controller[_0x89e8('0x11')]);router[_0x89e8('0x12')]('/',auth[_0x89e8('0xb')](),controller['create']);router[_0x89e8('0x12')](_0x89e8('0xf'),auth[_0x89e8('0xb')](),controller[_0x89e8('0x13')]);router[_0x89e8('0x14')](_0x89e8('0xd'),auth[_0x89e8('0xb')](),controller[_0x89e8('0x15')]);router['delete']('/:id',auth[_0x89e8('0xb')](),controller[_0x89e8('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8ff3=['post','create','addConfiguration','put','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x32f75b,_0x16cde7){var _0x26f5c7=function(_0x2f80b8){while(--_0x2f80b8){_0x32f75b['push'](_0x32f75b['shift']());}};_0x26f5c7(++_0x16cde7);}(_0x8ff3,0x1bb));var _0x38ff=function(_0x3416d9,_0x6a56f9){_0x3416d9=_0x3416d9-0x0;var _0x589ad9=_0x8ff3[_0x3416d9];return _0x589ad9;};'use strict';var multer=require('multer');var util=require(_0x38ff('0x0'));var path=require('path');var timeout=require(_0x38ff('0x1'));var express=require(_0x38ff('0x2'));var router=express[_0x38ff('0x3')]();var fs_extra=require(_0x38ff('0x4'));var auth=require(_0x38ff('0x5'));var interaction=require(_0x38ff('0x6'));var config=require(_0x38ff('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x38ff('0x8')]('/',auth[_0x38ff('0x9')](),controller[_0x38ff('0xa')]);router[_0x38ff('0x8')](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xc')]);router[_0x38ff('0x8')](_0x38ff('0xd'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xe')]);router[_0x38ff('0x8')](_0x38ff('0xf'),auth['isAuthenticated'](),controller[_0x38ff('0x10')]);router[_0x38ff('0x11')]('/',auth[_0x38ff('0x9')](),controller[_0x38ff('0x12')]);router['post'](_0x38ff('0xd'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x13')]);router[_0x38ff('0x14')](_0x38ff('0xb'),auth['isAuthenticated'](),controller[_0x38ff('0x15')]);router['delete'](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x16')]);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 8280e23..3bce5ff 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 _0x6667=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6667,0x1ab));var _0x7666=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x6667[_0x4c445a];return _0x2f611c;};'use strict';var Sequelize=require(_0x7666('0x0'));module[_0x7666('0x1')]={'name':{'type':Sequelize[_0x7666('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7666('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7666('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x7666('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7666('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7666('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1979=['exports','STRING','sequelize'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x1979,0x161));var _0x9197=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0x1979[_0x21ecc8];return _0x510c1d;};'use strict';var Sequelize=require(_0x9197('0x0'));module[_0x9197('0x1')]={'name':{'type':Sequelize[_0x9197('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9197('0x2')]},'username':{'type':Sequelize[_0x9197('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x9197('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9197('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 1c6f1c8..13a3d08 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 _0x395c=['sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','success','login','result','sessionName','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','Content-Range','apply','save','update','destroy','then','error','name','index','map','VtigerAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x395c,0xad));var _0xc395=function(_0x53f20c,_0x218da9){_0x53f20c=_0x53f20c-0x0;var _0x27ca14=_0x395c[_0x53f20c];return _0x27ca14;};'use strict';var emlformat=require(_0xc395('0x0'));var rimraf=require(_0xc395('0x1'));var zipdir=require(_0xc395('0x2'));var jsonpatch=require(_0xc395('0x3'));var rp=require(_0xc395('0x4'));var moment=require(_0xc395('0x5'));var BPromise=require(_0xc395('0x6'));var Mustache=require(_0xc395('0x7'));var util=require('util');var path=require(_0xc395('0x8'));var sox=require(_0xc395('0x9'));var csv=require(_0xc395('0xa'));var ejs=require(_0xc395('0xb'));var fs=require('fs');var fs_extra=require(_0xc395('0xc'));var _=require(_0xc395('0xd'));var squel=require(_0xc395('0xe'));var crypto=require(_0xc395('0xf'));var jsforce=require(_0xc395('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc395('0xa'));var querystring=require(_0xc395('0x11'));var Papa=require(_0xc395('0x12'));var Redis=require(_0xc395('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc395('0x14'));var as=require(_0xc395('0x15'));var hardwareService=require(_0xc395('0x16'));var logger=require(_0xc395('0x17'))('api');var utils=require(_0xc395('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc395('0x19'))['db'];var integrations=require(_0xc395('0x1a'));function respondWithStatusCode(_0x8508b4,_0x4436b8){_0x4436b8=_0x4436b8||0xcc;return function(_0x7a37d6){if(_0x7a37d6){return _0x8508b4[_0xc395('0x1b')](_0x4436b8);}return _0x8508b4[_0xc395('0x1c')](_0x4436b8)['end']();};}function respondWithResult(_0x24c52b,_0x441e5b){_0x441e5b=_0x441e5b||0xc8;return function(_0x1c4c44){if(_0x1c4c44){return _0x24c52b['status'](_0x441e5b)[_0xc395('0x1d')](_0x1c4c44);}};}function respondWithFilteredResult(_0x4c72f7,_0x3185ca){return function(_0x45ee1e){if(_0x45ee1e){var _0x207fd3=typeof _0x3185ca[_0xc395('0x1e')]==='undefined'&&typeof _0x3185ca[_0xc395('0x1f')]==='undefined';var _0x8bbde3=_0x45ee1e['count'];var _0x1bcd19=_0x207fd3?0x0:_0x3185ca['offset'];var _0x5632f0=_0x207fd3?_0x45ee1e[_0xc395('0x20')]:_0x3185ca[_0xc395('0x1e')]+_0x3185ca[_0xc395('0x1f')];var _0x36a12e;if(_0x5632f0>=_0x8bbde3){_0x5632f0=_0x8bbde3;_0x36a12e=0xc8;}else{_0x36a12e=0xce;}_0x4c72f7[_0xc395('0x1c')](_0x36a12e);return _0x4c72f7['set'](_0xc395('0x21'),_0x1bcd19+'-'+_0x5632f0+'/'+_0x8bbde3)[_0xc395('0x1d')](_0x45ee1e);}return null;};}function patchUpdates(_0x38a2c3){return function(_0x36a0b5){try{jsonpatch[_0xc395('0x22')](_0x36a0b5,_0x38a2c3,!![]);}catch(_0x4dd0e8){return BPromise['reject'](_0x4dd0e8);}return _0x36a0b5[_0xc395('0x23')]();};}function saveUpdates(_0x24e859,_0x22c2c1){return function(_0x1a21c8){if(_0x1a21c8){return _0x1a21c8[_0xc395('0x24')](_0x24e859)['then'](function(_0x165922){return _0x165922;});}return null;};}function removeEntity(_0x37d615,_0x141988){return function(_0x53f20c){if(_0x53f20c){return _0x53f20c[_0xc395('0x25')]()[_0xc395('0x26')](function(){_0x37d615[_0xc395('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c160,_0x51698b){return function(_0x3d30e9){if(!_0x3d30e9){_0x3c160[_0xc395('0x1b')](0x194);}return _0x3d30e9;};}function handleError(_0x325d7e,_0x441833){_0x441833=_0x441833||0x1f4;return function(_0x4e38c4){logger[_0xc395('0x27')](_0x4e38c4['stack']);if(_0x4e38c4['name']){delete _0x4e38c4[_0xc395('0x28')];}_0x325d7e[_0xc395('0x1c')](_0x441833)['send'](_0x4e38c4);};}exports[_0xc395('0x29')]=function(_0x1f6d30,_0x1564f9){var _0x4bad6e={},_0x106b9a={},_0x26455a={'count':0x0,'rows':[]};var _0x11231e=_[_0xc395('0x2a')](db[_0xc395('0x2b')]['rawAttributes'],function(_0x1d55e2){return{'name':_0x1d55e2['fieldName'],'type':_0x1d55e2[_0xc395('0x2c')][_0xc395('0x2d')]};});_0x106b9a[_0xc395('0x2e')]=_['map'](_0x11231e,'name');_0x106b9a[_0xc395('0x2f')]=_[_0xc395('0x30')](_0x1f6d30[_0xc395('0x2f')]);_0x106b9a[_0xc395('0x31')]=_[_0xc395('0x32')](_0x106b9a[_0xc395('0x2e')],_0x106b9a[_0xc395('0x2f')]);_0x4bad6e[_0xc395('0x33')]=_[_0xc395('0x32')](_0x106b9a[_0xc395('0x2e')],qs[_0xc395('0x34')](_0x1f6d30[_0xc395('0x2f')][_0xc395('0x34')]));_0x4bad6e[_0xc395('0x33')]=_0x4bad6e[_0xc395('0x33')][_0xc395('0x35')]?_0x4bad6e[_0xc395('0x33')]:_0x106b9a[_0xc395('0x2e')];if(!_0x1f6d30[_0xc395('0x2f')][_0xc395('0x36')](_0xc395('0x37'))){_0x4bad6e[_0xc395('0x1f')]=qs[_0xc395('0x1f')](_0x1f6d30[_0xc395('0x2f')][_0xc395('0x1f')]);_0x4bad6e['offset']=qs['offset'](_0x1f6d30[_0xc395('0x2f')]['offset']);}_0x4bad6e[_0xc395('0x38')]=qs['sort'](_0x1f6d30[_0xc395('0x2f')][_0xc395('0x39')]);_0x4bad6e[_0xc395('0x3a')]=qs[_0xc395('0x31')](_['pick'](_0x1f6d30[_0xc395('0x2f')],_0x106b9a[_0xc395('0x31')]),_0x11231e);if(_0x1f6d30[_0xc395('0x2f')][_0xc395('0x3b')]){_0x4bad6e['where']=_[_0xc395('0x3c')](_0x4bad6e[_0xc395('0x3a')],{'$or':_[_0xc395('0x2a')](_0x11231e,function(_0x69aab){if(_0x69aab[_0xc395('0x2c')]!==_0xc395('0x3d')){var _0x5365cc={};_0x5365cc[_0x69aab[_0xc395('0x28')]]={'$like':'%'+_0x1f6d30[_0xc395('0x2f')][_0xc395('0x3b')]+'%'};return _0x5365cc;}})});}_0x4bad6e=_['merge']({},_0x4bad6e,_0x1f6d30[_0xc395('0x3e')]);var _0x42541d={'where':_0x4bad6e[_0xc395('0x3a')]};return db['VtigerAccount'][_0xc395('0x20')](_0x42541d)[_0xc395('0x26')](function(_0x502963){_0x26455a[_0xc395('0x20')]=_0x502963;if(_0x1f6d30[_0xc395('0x2f')][_0xc395('0x3f')]){_0x4bad6e[_0xc395('0x40')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x4bad6e);})[_0xc395('0x26')](function(_0x5bd1c0){_0x26455a[_0xc395('0x41')]=_0x5bd1c0;return _0x26455a;})[_0xc395('0x26')](respondWithFilteredResult(_0x1564f9,_0x4bad6e))[_0xc395('0x42')](handleError(_0x1564f9,null));};exports[_0xc395('0x43')]=function(_0x334972,_0x37b899){var _0x4f9c55={'raw':![],'where':{'id':_0x334972[_0xc395('0x44')]['id']}},_0x208d71={};_0x208d71[_0xc395('0x2e')]=_['keys'](db['VtigerAccount'][_0xc395('0x45')]);_0x208d71[_0xc395('0x2f')]=_[_0xc395('0x30')](_0x334972['query']);_0x208d71['filters']=_[_0xc395('0x32')](_0x208d71[_0xc395('0x2e')],_0x208d71['query']);_0x4f9c55[_0xc395('0x33')]=_[_0xc395('0x32')](_0x208d71['model'],qs['fields'](_0x334972['query'][_0xc395('0x34')]));_0x4f9c55[_0xc395('0x33')]=_0x4f9c55[_0xc395('0x33')][_0xc395('0x35')]?_0x4f9c55[_0xc395('0x33')]:_0x208d71[_0xc395('0x2e')];if(_0x334972[_0xc395('0x2f')][_0xc395('0x3f')]){_0x4f9c55['include']=[{'all':!![]}];}_0x4f9c55=_['merge']({},_0x4f9c55,_0x334972[_0xc395('0x3e')]);return db[_0xc395('0x2b')][_0xc395('0x46')](_0x4f9c55)[_0xc395('0x26')](handleEntityNotFound(_0x37b899,null))[_0xc395('0x26')](respondWithResult(_0x37b899,null))['catch'](handleError(_0x37b899,null));};exports[_0xc395('0x47')]=function(_0x13cac6,_0x481938){return db[_0xc395('0x2b')][_0xc395('0x47')](_0x13cac6[_0xc395('0x48')],{})[_0xc395('0x26')](respondWithResult(_0x481938,0xc9))['catch'](handleError(_0x481938,null));};exports[_0xc395('0x24')]=function(_0x152e00,_0x249d7d){if(_0x152e00[_0xc395('0x48')]['id']){delete _0x152e00[_0xc395('0x48')]['id'];}return db[_0xc395('0x2b')][_0xc395('0x46')]({'where':{'id':_0x152e00[_0xc395('0x44')]['id']}})[_0xc395('0x26')](handleEntityNotFound(_0x249d7d,null))['then'](saveUpdates(_0x152e00[_0xc395('0x48')],null))[_0xc395('0x26')](respondWithResult(_0x249d7d,null))['catch'](handleError(_0x249d7d,null));};exports[_0xc395('0x25')]=function(_0x2e574a,_0x352327){return db[_0xc395('0x2b')][_0xc395('0x46')]({'where':{'id':_0x2e574a[_0xc395('0x44')]['id']}})[_0xc395('0x26')](handleEntityNotFound(_0x352327,null))[_0xc395('0x26')](removeEntity(_0x352327,null))[_0xc395('0x42')](handleError(_0x352327,null));};exports['getConfigurations']=function(_0x1ceea9,_0x2cb5ef,_0x3a9cf3){var _0xea2536={};var _0x128841={};var _0x27c234;var _0x136da1;return db['VtigerAccount'][_0xc395('0x49')]({'where':{'id':_0x1ceea9[_0xc395('0x44')]['id']}})[_0xc395('0x26')](handleEntityNotFound(_0x2cb5ef,null))[_0xc395('0x26')](function(_0x28becb){if(_0x28becb){_0x27c234=_0x28becb;_0x128841['model']=_[_0xc395('0x30')](db[_0xc395('0x4a')][_0xc395('0x45')]);_0x128841[_0xc395('0x2f')]=_[_0xc395('0x30')](_0x1ceea9[_0xc395('0x2f')]);_0x128841[_0xc395('0x31')]=_['intersection'](_0x128841[_0xc395('0x2e')],_0x128841[_0xc395('0x2f')]);_0xea2536[_0xc395('0x33')]=_['intersection'](_0x128841[_0xc395('0x2e')],qs[_0xc395('0x34')](_0x1ceea9[_0xc395('0x2f')][_0xc395('0x34')]));_0xea2536[_0xc395('0x33')]=_0xea2536[_0xc395('0x33')][_0xc395('0x35')]?_0xea2536[_0xc395('0x33')]:_0x128841[_0xc395('0x2e')];_0xea2536[_0xc395('0x38')]=qs[_0xc395('0x39')](_0x1ceea9['query'][_0xc395('0x39')]);_0xea2536[_0xc395('0x3a')]=qs[_0xc395('0x31')](_['pick'](_0x1ceea9['query'],_0x128841[_0xc395('0x31')]));if(_0x1ceea9[_0xc395('0x2f')][_0xc395('0x3b')]){_0xea2536['where']=_[_0xc395('0x3c')](_0xea2536[_0xc395('0x3a')],{'$or':_[_0xc395('0x2a')](_0xea2536[_0xc395('0x33')],function(_0x5b1959){var _0x35a956={};_0x35a956[_0x5b1959]={'$like':'%'+_0x1ceea9[_0xc395('0x2f')][_0xc395('0x3b')]+'%'};return _0x35a956;})});}_0xea2536=_[_0xc395('0x3c')]({},_0xea2536,_0x1ceea9[_0xc395('0x3e')]);return _0x27c234[_0xc395('0x4b')](_0xea2536);}})[_0xc395('0x26')](function(_0x3c5066){if(_0x3c5066){_0x136da1=_0x3c5066['length'];if(!_0x1ceea9[_0xc395('0x2f')][_0xc395('0x36')](_0xc395('0x37'))){_0xea2536[_0xc395('0x1f')]=qs[_0xc395('0x1f')](_0x1ceea9[_0xc395('0x2f')][_0xc395('0x1f')]);_0xea2536[_0xc395('0x1e')]=qs['offset'](_0x1ceea9[_0xc395('0x2f')][_0xc395('0x1e')]);}return _0x27c234[_0xc395('0x4b')](_0xea2536);}})[_0xc395('0x26')](function(_0xad663b){if(_0xad663b){return _0xad663b?{'count':_0x136da1,'rows':_0xad663b}:null;}})['then'](respondWithResult(_0x2cb5ef,null))[_0xc395('0x42')](handleError(_0x2cb5ef,null));};exports[_0xc395('0x4c')]=function(_0x34905a,_0x2499ec,_0x1c3ae1){if(_0x34905a['body']['id']){delete _0x34905a['body']['id'];}return db[_0xc395('0x2b')][_0xc395('0x49')]({'where':{'id':_0x34905a[_0xc395('0x44')]['id']}})[_0xc395('0x26')](handleEntityNotFound(_0x2499ec,null))[_0xc395('0x26')](function(_0x2dae05){if(_0x2dae05){_0x34905a[_0xc395('0x48')][_0xc395('0x4d')]=_0x2dae05['id'];_0x34905a[_0xc395('0x48')][_0xc395('0x4e')]=integrations[_0xc395('0x4f')](_0x34905a[_0xc395('0x48')][_0xc395('0x50')],_0x34905a['body'][_0xc395('0x2c')]);_0x34905a[_0xc395('0x48')]['Descriptions']=integrations[_0xc395('0x51')](_0x34905a['body']['channel'],_0x34905a[_0xc395('0x48')][_0xc395('0x2c')]);return db[_0xc395('0x4a')][_0xc395('0x47')](_0x34905a[_0xc395('0x48')],{'include':[{'model':db[_0xc395('0x52')],'as':'Subjects'},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xc395('0x26')](respondWithResult(_0x2499ec,null))['catch'](handleError(_0x2499ec,null));};var md5=require('md5');exports[_0xc395('0x53')]=function(_0x365090,_0x59e6bb,_0x4d642a){var _0x44f80f=null;var _0x591f5e=null;var _0x5ac5a0=null;var _0x53d048=null;var _0x20dbfb='';return db['VtigerAccount']['findOne']({'where':{'id':_0x365090[_0xc395('0x44')]['id']},'attributes':['id',_0xc395('0x28'),_0xc395('0x54'),'description',_0xc395('0x55'),_0xc395('0x56'),_0xc395('0x57'),_0xc395('0x58')]})[_0xc395('0x26')](handleEntityNotFound(_0x59e6bb,null))[_0xc395('0x26')](function(_0x748bb4){if(_0x748bb4){_0x44f80f=_0x748bb4[_0xc395('0x54')];_0x591f5e=_0x748bb4[_0xc395('0x58')];_0x5ac5a0=_0x748bb4['moduleName'];_0x20dbfb=_0x748bb4[_0xc395('0x56')];var _0x468107=_0x20dbfb[_0xc395('0x59')](-0x1);if(_0x468107==='/'){_0x20dbfb=_0x20dbfb[_0xc395('0x5a')](0x0,_0x20dbfb['lastIndexOf'](_0x468107));}_0x53d048=util[_0xc395('0x5b')](_0xc395('0x5c'),_0x20dbfb);var _0x135b65={'method':_0xc395('0x5d'),'uri':_0x53d048,'qs':{'operation':'getchallenge','username':_0x748bb4['username']},'json':!![]};return rp(_0x135b65);}})[_0xc395('0x26')](function(_0x1717a5){if(_0x1717a5[_0xc395('0x5e')]){var _0x8652b5={'method':'POST','uri':_0x53d048,'form':{'operation':_0xc395('0x5f'),'username':_0x44f80f,'accessKey':md5(_0x1717a5[_0xc395('0x60')]['token']+_0x591f5e)},'json':!![]};return rp(_0x8652b5);}})[_0xc395('0x26')](function(_0x72d107){if(_0x72d107[_0xc395('0x5e')]){var _0x384b89={'method':_0xc395('0x5d'),'uri':_0x53d048,'qs':{'operation':'describe','username':_0x44f80f,'sessionName':_0x72d107['result'][_0xc395('0x61')],'elementType':_0x5ac5a0},'json':!![]};return rp(_0x384b89);}})[_0xc395('0x26')](function(_0x1ff8ad){if(_0x1ff8ad[_0xc395('0x5e')]){var _0x2ccf34=[_0xc395('0x62'),_0xc395('0x63'),'owner'];_[_0xc395('0x64')](_0x1ff8ad[_0xc395('0x60')][_0xc395('0x34')],function(_0x487d23){return _0x2ccf34[_0xc395('0x65')](_0x487d23['type'][_0xc395('0x28')]);});_['remove'](_0x1ff8ad[_0xc395('0x60')][_0xc395('0x34')],function(_0x5f27b8){return _0x5f27b8[_0xc395('0x66')]===_0xc395('0x67');});return{'count':_0x1ff8ad['result']['fields']['length'],'rows':_['map'](_0x1ff8ad[_0xc395('0x60')][_0xc395('0x34')],function(_0x2ee73e){return{'id':_0x2ee73e[_0xc395('0x28')],'name':_0x2ee73e[_0xc395('0x68')],'custom':_[_0xc395('0x69')](_0x2ee73e[_0xc395('0x28')],_0xc395('0x6a'))?!![]:![],'options':_0x2ee73e[_0xc395('0x2c')][_0xc395('0x28')]===_0xc395('0x6b')&&_0x2ee73e[_0xc395('0x2c')][_0xc395('0x6c')]['length']>0x0?_[_0xc395('0x2a')](_0x2ee73e[_0xc395('0x2c')][_0xc395('0x6c')],function(_0x41fbd3){return{'name':_0x41fbd3[_0xc395('0x68')],'value':_0x41fbd3[_0xc395('0x6d')]};}):[]};})};}})['then'](respondWithResult(_0x59e6bb,null))[_0xc395('0x42')](function(_0x168f2d){console[_0xc395('0x6e')](_0xc395('0x6f')+_0x168f2d);var _0x2a8f51=_0x365090['query'][_0xc395('0x70')]?0x1f4:_0x168f2d[_0xc395('0x71')]||0x1f4;logger[_0xc395('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xc395('0x53'),_0x2a8f51,JSON[_0xc395('0x72')](_0x168f2d));delete _0x168f2d[_0xc395('0x28')];if(_0x2a8f51===0x191){_0x2a8f51=0x190;}_0x59e6bb[_0xc395('0x1c')](_0x2a8f51)['send'](_0x365090['query'][_0xc395('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x168f2d[_0xc395('0x71')]}:_0x168f2d);});}; \ No newline at end of file +var _0x0a69=['query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','VtigerConfiguration','options','nolimit','addConfiguration','findOne','channel','getDescriptions','Subjects','VtigerField','Descriptions','username','description','moduleName','remoteUri','serverUrl','accessKey','lastIndexOf','format','GET','getchallenge','success','login','result','token','describe','sessionName','autogenerated','reference','owner','includes','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','map','VtigerAccount','fieldName','type','key','model','keys'];(function(_0x55a250,_0x2e6962){var _0x95ac01=function(_0xff76e9){while(--_0xff76e9){_0x55a250['push'](_0x55a250['shift']());}};_0x95ac01(++_0x2e6962);}(_0x0a69,0x1a4));var _0x90a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a69[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x90a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x90a6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90a6('0x3'));var util=require(_0x90a6('0x4'));var path=require('path');var sox=require(_0x90a6('0x5'));var csv=require(_0x90a6('0x6'));var ejs=require(_0x90a6('0x7'));var fs=require('fs');var fs_extra=require(_0x90a6('0x8'));var _=require(_0x90a6('0x9'));var squel=require(_0x90a6('0xa'));var crypto=require(_0x90a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x90a6('0xc'));var toCsv=require(_0x90a6('0x6'));var querystring=require(_0x90a6('0xd'));var Papa=require(_0x90a6('0xe'));var Redis=require('ioredis');var authService=require(_0x90a6('0xf'));var qs=require(_0x90a6('0x10'));var as=require(_0x90a6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90a6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x90a6('0x13'));var licenseUtil=require(_0x90a6('0x14'));var db=require(_0x90a6('0x15'))['db'];var integrations=require(_0x90a6('0x16'));function respondWithStatusCode(_0x23770b,_0x545c17){_0x545c17=_0x545c17||0xcc;return function(_0x108c27){if(_0x108c27){return _0x23770b[_0x90a6('0x17')](_0x545c17);}return _0x23770b[_0x90a6('0x18')](_0x545c17)['end']();};}function respondWithResult(_0x3a2ed1,_0x39fdfb){_0x39fdfb=_0x39fdfb||0xc8;return function(_0x446b69){if(_0x446b69){return _0x3a2ed1['status'](_0x39fdfb)[_0x90a6('0x19')](_0x446b69);}};}function respondWithFilteredResult(_0x1732d0,_0x270eab){return function(_0x5e70bb){if(_0x5e70bb){var _0x5b819b=typeof _0x270eab[_0x90a6('0x1a')]===_0x90a6('0x1b')&&typeof _0x270eab['limit']===_0x90a6('0x1b');var _0x53a6ef=_0x5e70bb[_0x90a6('0x1c')];var _0x4e688e=_0x5b819b?0x0:_0x270eab[_0x90a6('0x1a')];var _0x149324=_0x5b819b?_0x5e70bb[_0x90a6('0x1c')]:_0x270eab[_0x90a6('0x1a')]+_0x270eab[_0x90a6('0x1d')];var _0x4582d7;if(_0x149324>=_0x53a6ef){_0x149324=_0x53a6ef;_0x4582d7=0xc8;}else{_0x4582d7=0xce;}_0x1732d0[_0x90a6('0x18')](_0x4582d7);return _0x1732d0[_0x90a6('0x1e')]('Content-Range',_0x4e688e+'-'+_0x149324+'/'+_0x53a6ef)[_0x90a6('0x19')](_0x5e70bb);}return null;};}function patchUpdates(_0x3a6f25){return function(_0xe9b0f0){try{jsonpatch[_0x90a6('0x1f')](_0xe9b0f0,_0x3a6f25,!![]);}catch(_0x558d51){return BPromise[_0x90a6('0x20')](_0x558d51);}return _0xe9b0f0[_0x90a6('0x21')]();};}function saveUpdates(_0x51b02d,_0x1fe80d){return function(_0x39633c){if(_0x39633c){return _0x39633c['update'](_0x51b02d)[_0x90a6('0x22')](function(_0x46b11a){return _0x46b11a;});}return null;};}function removeEntity(_0x2593d7,_0x226d14){return function(_0x10fb3a){if(_0x10fb3a){return _0x10fb3a[_0x90a6('0x23')]()[_0x90a6('0x22')](function(){_0x2593d7['status'](0xcc)[_0x90a6('0x24')]();});}};}function handleEntityNotFound(_0x33d93e,_0x28dc33){return function(_0x3f53b3){if(!_0x3f53b3){_0x33d93e['sendStatus'](0x194);}return _0x3f53b3;};}function handleError(_0x594307,_0x9e7b5b){_0x9e7b5b=_0x9e7b5b||0x1f4;return function(_0x185348){logger[_0x90a6('0x25')](_0x185348[_0x90a6('0x26')]);if(_0x185348['name']){delete _0x185348[_0x90a6('0x27')];}_0x594307[_0x90a6('0x18')](_0x9e7b5b)[_0x90a6('0x28')](_0x185348);};}exports['index']=function(_0x5c8395,_0x4f76b9){var _0xecb5bd={},_0x4a8065={},_0x969770={'count':0x0,'rows':[]};var _0x2193d1=_[_0x90a6('0x29')](db[_0x90a6('0x2a')]['rawAttributes'],function(_0x5db9fe){return{'name':_0x5db9fe[_0x90a6('0x2b')],'type':_0x5db9fe[_0x90a6('0x2c')][_0x90a6('0x2d')]};});_0x4a8065[_0x90a6('0x2e')]=_[_0x90a6('0x29')](_0x2193d1,_0x90a6('0x27'));_0x4a8065['query']=_[_0x90a6('0x2f')](_0x5c8395[_0x90a6('0x30')]);_0x4a8065['filters']=_[_0x90a6('0x31')](_0x4a8065[_0x90a6('0x2e')],_0x4a8065[_0x90a6('0x30')]);_0xecb5bd[_0x90a6('0x32')]=_[_0x90a6('0x31')](_0x4a8065[_0x90a6('0x2e')],qs[_0x90a6('0x33')](_0x5c8395[_0x90a6('0x30')]['fields']));_0xecb5bd['attributes']=_0xecb5bd[_0x90a6('0x32')][_0x90a6('0x34')]?_0xecb5bd[_0x90a6('0x32')]:_0x4a8065[_0x90a6('0x2e')];if(!_0x5c8395['query'][_0x90a6('0x35')]('nolimit')){_0xecb5bd[_0x90a6('0x1d')]=qs[_0x90a6('0x1d')](_0x5c8395['query'][_0x90a6('0x1d')]);_0xecb5bd['offset']=qs[_0x90a6('0x1a')](_0x5c8395[_0x90a6('0x30')][_0x90a6('0x1a')]);}_0xecb5bd[_0x90a6('0x36')]=qs['sort'](_0x5c8395['query'][_0x90a6('0x37')]);_0xecb5bd['where']=qs['filters'](_[_0x90a6('0x38')](_0x5c8395[_0x90a6('0x30')],_0x4a8065[_0x90a6('0x39')]),_0x2193d1);if(_0x5c8395[_0x90a6('0x30')][_0x90a6('0x3a')]){_0xecb5bd[_0x90a6('0x3b')]=_['merge'](_0xecb5bd[_0x90a6('0x3b')],{'$or':_[_0x90a6('0x29')](_0x2193d1,function(_0x4a671e){if(_0x4a671e['type']!==_0x90a6('0x3c')){var _0x58148f={};_0x58148f[_0x4a671e[_0x90a6('0x27')]]={'$like':'%'+_0x5c8395[_0x90a6('0x30')][_0x90a6('0x3a')]+'%'};return _0x58148f;}})});}_0xecb5bd=_[_0x90a6('0x3d')]({},_0xecb5bd,_0x5c8395['options']);var _0x31a92a={'where':_0xecb5bd[_0x90a6('0x3b')]};return db[_0x90a6('0x2a')][_0x90a6('0x1c')](_0x31a92a)['then'](function(_0xf3404){_0x969770[_0x90a6('0x1c')]=_0xf3404;if(_0x5c8395['query'][_0x90a6('0x3e')]){_0xecb5bd['include']=[{'all':!![]}];}return db[_0x90a6('0x2a')]['findAll'](_0xecb5bd);})['then'](function(_0x2e1751){_0x969770[_0x90a6('0x3f')]=_0x2e1751;return _0x969770;})[_0x90a6('0x22')](respondWithFilteredResult(_0x4f76b9,_0xecb5bd))[_0x90a6('0x40')](handleError(_0x4f76b9,null));};exports[_0x90a6('0x41')]=function(_0x3f555b,_0x4bdab9){var _0x5b69e2={'raw':![],'where':{'id':_0x3f555b[_0x90a6('0x42')]['id']}},_0x55e405={};_0x55e405[_0x90a6('0x2e')]=_[_0x90a6('0x2f')](db[_0x90a6('0x2a')][_0x90a6('0x43')]);_0x55e405[_0x90a6('0x30')]=_[_0x90a6('0x2f')](_0x3f555b[_0x90a6('0x30')]);_0x55e405['filters']=_[_0x90a6('0x31')](_0x55e405[_0x90a6('0x2e')],_0x55e405[_0x90a6('0x30')]);_0x5b69e2['attributes']=_[_0x90a6('0x31')](_0x55e405[_0x90a6('0x2e')],qs[_0x90a6('0x33')](_0x3f555b[_0x90a6('0x30')][_0x90a6('0x33')]));_0x5b69e2[_0x90a6('0x32')]=_0x5b69e2[_0x90a6('0x32')]['length']?_0x5b69e2[_0x90a6('0x32')]:_0x55e405[_0x90a6('0x2e')];if(_0x3f555b[_0x90a6('0x30')][_0x90a6('0x3e')]){_0x5b69e2[_0x90a6('0x44')]=[{'all':!![]}];}_0x5b69e2=_[_0x90a6('0x3d')]({},_0x5b69e2,_0x3f555b['options']);return db[_0x90a6('0x2a')][_0x90a6('0x45')](_0x5b69e2)[_0x90a6('0x22')](handleEntityNotFound(_0x4bdab9,null))['then'](respondWithResult(_0x4bdab9,null))[_0x90a6('0x40')](handleError(_0x4bdab9,null));};exports[_0x90a6('0x46')]=function(_0x4c8a32,_0x54ade9){return db[_0x90a6('0x2a')][_0x90a6('0x46')](_0x4c8a32[_0x90a6('0x47')],{})['then'](respondWithResult(_0x54ade9,0xc9))['catch'](handleError(_0x54ade9,null));};exports['update']=function(_0x7db7ea,_0x4bef2a){if(_0x7db7ea[_0x90a6('0x47')]['id']){delete _0x7db7ea['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x7db7ea[_0x90a6('0x42')]['id']}})[_0x90a6('0x22')](handleEntityNotFound(_0x4bef2a,null))['then'](saveUpdates(_0x7db7ea[_0x90a6('0x47')],null))[_0x90a6('0x22')](respondWithResult(_0x4bef2a,null))[_0x90a6('0x40')](handleError(_0x4bef2a,null));};exports[_0x90a6('0x23')]=function(_0x2561de,_0x1213c5){return db[_0x90a6('0x2a')][_0x90a6('0x45')]({'where':{'id':_0x2561de[_0x90a6('0x42')]['id']}})[_0x90a6('0x22')](handleEntityNotFound(_0x1213c5,null))['then'](removeEntity(_0x1213c5,null))[_0x90a6('0x40')](handleError(_0x1213c5,null));};exports[_0x90a6('0x48')]=function(_0x5d2084,_0x176398,_0x560d99){var _0x47b04c={};var _0x5d2b54={};var _0x25781f;var _0x5e7ece;return db['VtigerAccount']['findOne']({'where':{'id':_0x5d2084[_0x90a6('0x42')]['id']}})[_0x90a6('0x22')](handleEntityNotFound(_0x176398,null))[_0x90a6('0x22')](function(_0xdc1836){if(_0xdc1836){_0x25781f=_0xdc1836;_0x5d2b54[_0x90a6('0x2e')]=_[_0x90a6('0x2f')](db[_0x90a6('0x49')][_0x90a6('0x43')]);_0x5d2b54[_0x90a6('0x30')]=_[_0x90a6('0x2f')](_0x5d2084[_0x90a6('0x30')]);_0x5d2b54['filters']=_[_0x90a6('0x31')](_0x5d2b54[_0x90a6('0x2e')],_0x5d2b54[_0x90a6('0x30')]);_0x47b04c['attributes']=_['intersection'](_0x5d2b54[_0x90a6('0x2e')],qs[_0x90a6('0x33')](_0x5d2084['query'][_0x90a6('0x33')]));_0x47b04c[_0x90a6('0x32')]=_0x47b04c['attributes'][_0x90a6('0x34')]?_0x47b04c[_0x90a6('0x32')]:_0x5d2b54[_0x90a6('0x2e')];_0x47b04c[_0x90a6('0x36')]=qs[_0x90a6('0x37')](_0x5d2084['query'][_0x90a6('0x37')]);_0x47b04c['where']=qs[_0x90a6('0x39')](_[_0x90a6('0x38')](_0x5d2084[_0x90a6('0x30')],_0x5d2b54[_0x90a6('0x39')]));if(_0x5d2084['query'][_0x90a6('0x3a')]){_0x47b04c[_0x90a6('0x3b')]=_[_0x90a6('0x3d')](_0x47b04c['where'],{'$or':_[_0x90a6('0x29')](_0x47b04c[_0x90a6('0x32')],function(_0x5812a3){var _0x298b72={};_0x298b72[_0x5812a3]={'$like':'%'+_0x5d2084[_0x90a6('0x30')][_0x90a6('0x3a')]+'%'};return _0x298b72;})});}_0x47b04c=_[_0x90a6('0x3d')]({},_0x47b04c,_0x5d2084[_0x90a6('0x4a')]);return _0x25781f[_0x90a6('0x48')](_0x47b04c);}})[_0x90a6('0x22')](function(_0xefc7bf){if(_0xefc7bf){_0x5e7ece=_0xefc7bf[_0x90a6('0x34')];if(!_0x5d2084[_0x90a6('0x30')][_0x90a6('0x35')](_0x90a6('0x4b'))){_0x47b04c['limit']=qs[_0x90a6('0x1d')](_0x5d2084['query']['limit']);_0x47b04c[_0x90a6('0x1a')]=qs[_0x90a6('0x1a')](_0x5d2084[_0x90a6('0x30')][_0x90a6('0x1a')]);}return _0x25781f[_0x90a6('0x48')](_0x47b04c);}})[_0x90a6('0x22')](function(_0x4c6e8e){if(_0x4c6e8e){return _0x4c6e8e?{'count':_0x5e7ece,'rows':_0x4c6e8e}:null;}})['then'](respondWithResult(_0x176398,null))[_0x90a6('0x40')](handleError(_0x176398,null));};exports[_0x90a6('0x4c')]=function(_0x5e8ca6,_0x3fab46,_0x301339){if(_0x5e8ca6[_0x90a6('0x47')]['id']){delete _0x5e8ca6[_0x90a6('0x47')]['id'];}return db[_0x90a6('0x2a')][_0x90a6('0x4d')]({'where':{'id':_0x5e8ca6['params']['id']}})['then'](handleEntityNotFound(_0x3fab46,null))[_0x90a6('0x22')](function(_0x19c6a8){if(_0x19c6a8){_0x5e8ca6[_0x90a6('0x47')]['AccountId']=_0x19c6a8['id'];_0x5e8ca6[_0x90a6('0x47')]['Subjects']=integrations['getSubjects'](_0x5e8ca6[_0x90a6('0x47')][_0x90a6('0x4e')],_0x5e8ca6[_0x90a6('0x47')][_0x90a6('0x2c')]);_0x5e8ca6[_0x90a6('0x47')]['Descriptions']=integrations[_0x90a6('0x4f')](_0x5e8ca6[_0x90a6('0x47')][_0x90a6('0x4e')],_0x5e8ca6[_0x90a6('0x47')]['type']);return db[_0x90a6('0x49')][_0x90a6('0x46')](_0x5e8ca6[_0x90a6('0x47')],{'include':[{'model':db['VtigerField'],'as':_0x90a6('0x50')},{'model':db[_0x90a6('0x51')],'as':_0x90a6('0x52')}]});}return null;})[_0x90a6('0x22')](respondWithResult(_0x3fab46,null))[_0x90a6('0x40')](handleError(_0x3fab46,null));};var md5=require('md5');exports['getFields']=function(_0x3d00f7,_0x150a9d,_0x392219){var _0x1a755e=null;var _0x366a17=null;var _0x41f739=null;var _0xe45467=null;var _0x15a2bc='';return db['VtigerAccount']['findOne']({'where':{'id':_0x3d00f7[_0x90a6('0x42')]['id']},'attributes':['id',_0x90a6('0x27'),_0x90a6('0x53'),_0x90a6('0x54'),_0x90a6('0x55'),_0x90a6('0x56'),_0x90a6('0x57'),_0x90a6('0x58')]})[_0x90a6('0x22')](handleEntityNotFound(_0x150a9d,null))[_0x90a6('0x22')](function(_0x2e60de){if(_0x2e60de){_0x1a755e=_0x2e60de[_0x90a6('0x53')];_0x366a17=_0x2e60de[_0x90a6('0x58')];_0x41f739=_0x2e60de['moduleName'];_0x15a2bc=_0x2e60de[_0x90a6('0x56')];var _0x4acc6b=_0x15a2bc['slice'](-0x1);if(_0x4acc6b==='/'){_0x15a2bc=_0x15a2bc['substring'](0x0,_0x15a2bc[_0x90a6('0x59')](_0x4acc6b));}_0xe45467=util[_0x90a6('0x5a')]('%s/webservice.php',_0x15a2bc);var _0x31ba16={'method':_0x90a6('0x5b'),'uri':_0xe45467,'qs':{'operation':_0x90a6('0x5c'),'username':_0x2e60de[_0x90a6('0x53')]},'json':!![]};return rp(_0x31ba16);}})[_0x90a6('0x22')](function(_0x4afe7f){if(_0x4afe7f[_0x90a6('0x5d')]){var _0x33194c={'method':'POST','uri':_0xe45467,'form':{'operation':_0x90a6('0x5e'),'username':_0x1a755e,'accessKey':md5(_0x4afe7f[_0x90a6('0x5f')][_0x90a6('0x60')]+_0x366a17)},'json':!![]};return rp(_0x33194c);}})[_0x90a6('0x22')](function(_0x1d2b88){if(_0x1d2b88[_0x90a6('0x5d')]){var _0x355f9d={'method':_0x90a6('0x5b'),'uri':_0xe45467,'qs':{'operation':_0x90a6('0x61'),'username':_0x1a755e,'sessionName':_0x1d2b88[_0x90a6('0x5f')][_0x90a6('0x62')],'elementType':_0x41f739},'json':!![]};return rp(_0x355f9d);}})['then'](function(_0x50e280){if(_0x50e280[_0x90a6('0x5d')]){var _0x3e5512=[_0x90a6('0x63'),_0x90a6('0x64'),_0x90a6('0x65')];_['remove'](_0x50e280['result'][_0x90a6('0x33')],function(_0x4e29b5){return _0x3e5512[_0x90a6('0x66')](_0x4e29b5[_0x90a6('0x2c')][_0x90a6('0x27')]);});_['remove'](_0x50e280[_0x90a6('0x5f')][_0x90a6('0x33')],function(_0x2f3dbf){return _0x2f3dbf[_0x90a6('0x67')]===_0x90a6('0x68');});return{'count':_0x50e280[_0x90a6('0x5f')]['fields'][_0x90a6('0x34')],'rows':_['map'](_0x50e280[_0x90a6('0x5f')][_0x90a6('0x33')],function(_0x3f354f){return{'id':_0x3f354f[_0x90a6('0x27')],'name':_0x3f354f[_0x90a6('0x69')],'custom':_['startsWith'](_0x3f354f[_0x90a6('0x27')],_0x90a6('0x6a'))?!![]:![],'options':_0x3f354f[_0x90a6('0x2c')]['name']===_0x90a6('0x6b')&&_0x3f354f[_0x90a6('0x2c')][_0x90a6('0x6c')]['length']>0x0?_[_0x90a6('0x29')](_0x3f354f[_0x90a6('0x2c')][_0x90a6('0x6c')],function(_0x5a1bec){return{'name':_0x5a1bec[_0x90a6('0x69')],'value':_0x5a1bec[_0x90a6('0x6d')]};}):[]};})};}})[_0x90a6('0x22')](respondWithResult(_0x150a9d,null))['catch'](function(_0x2aad6b){console[_0x90a6('0x6e')](_0x90a6('0x6f')+_0x2aad6b);var _0x55cbbe=_0x3d00f7[_0x90a6('0x30')][_0x90a6('0x70')]?0x1f4:_0x2aad6b[_0x90a6('0x71')]||0x1f4;logger[_0x90a6('0x25')](_0x90a6('0x72'),_0x90a6('0x73'),_0x55cbbe,JSON['stringify'](_0x2aad6b));delete _0x2aad6b[_0x90a6('0x27')];if(_0x55cbbe===0x191){_0x55cbbe=0x190;}_0x150a9d[_0x90a6('0x18')](_0x55cbbe)[_0x90a6('0x28')](_0x3d00f7['query'][_0x90a6('0x70')]?{'message':_0x90a6('0x74'),'statusCode':_0x2aad6b[_0x90a6('0x71')]}:_0x2aad6b);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a72a8d9..c6d3c62 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 _0xeaa0=['VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x14612f,_0x1c3389){var _0x3c41ad=function(_0x41043c){while(--_0x41043c){_0x14612f['push'](_0x14612f['shift']());}};_0x3c41ad(++_0x1c3389);}(_0xeaa0,0x16e));var _0x0eaa=function(_0x3a465a,_0x3e8001){_0x3a465a=_0x3a465a-0x0;var _0x1ed244=_0xeaa0[_0x3a465a];return _0x1ed244;};'use strict';var _=require(_0x0eaa('0x0'));var util=require(_0x0eaa('0x1'));var logger=require(_0x0eaa('0x2'))(_0x0eaa('0x3'));var moment=require(_0x0eaa('0x4'));var BPromise=require('bluebird');var rp=require(_0x0eaa('0x5'));var fs=require('fs');var path=require(_0x0eaa('0x6'));var rimraf=require('rimraf');var config=require(_0x0eaa('0x7'));var attributes=require(_0x0eaa('0x8'));var integrations=require(_0x0eaa('0x9'));module[_0x0eaa('0xa')]=function(_0x2e7484,_0x4bbbc5){return _0x2e7484[_0x0eaa('0xb')](_0x0eaa('0xc'),attributes,{'tableName':_0x0eaa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0687=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x295e24,_0x3a71b5){var _0x47cdc1=function(_0x3e22a2){while(--_0x3e22a2){_0x295e24['push'](_0x295e24['shift']());}};_0x47cdc1(++_0x3a71b5);}(_0x0687,0x101));var _0x7068=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0687[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7068('0x0'));var util=require(_0x7068('0x1'));var logger=require(_0x7068('0x2'))(_0x7068('0x3'));var moment=require(_0x7068('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7068('0x5'));var rimraf=require('rimraf');var config=require(_0x7068('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7068('0x7')]=function(_0x19a5d9,_0x2b3b44){return _0x19a5d9[_0x7068('0x8')](_0x7068('0x9'),attributes,{'tableName':_0x7068('0xa'),'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 ff09377..71a32a9 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 _0xbaf0=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','model','map','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58e32c,_0x309781){var _0x481e60=function(_0x5326ab){while(--_0x5326ab){_0x58e32c['push'](_0x58e32c['shift']());}};_0x481e60(++_0x309781);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetVtigerAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowVtigerAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0x153f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x5361d4,_0x114539){var _0x3b816c=function(_0x30e51c){while(--_0x30e51c){_0x5361d4['push'](_0x5361d4['shift']());}};_0x3b816c(++_0x114539);}(_0x153f,0x15b));var _0xf153=function(_0xd47332,_0x41142c){_0xd47332=_0xd47332-0x0;var _0x2a7384=_0x153f[_0xd47332];return _0x2a7384;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')]({'raw':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1c')]||null:null,'attributes':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1d')]||null:null,'limit':_0x138dbe['options']?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1e')]||null:null,'include':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')]?_[_0xf153('0x20')](_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')],function(_0xf67cde){return{'model':db[_0xf67cde[_0xf153('0x21')]],'as':_0xf67cde['as'],'attributes':_0xf67cde[_0xf153('0x1d')],'include':_0xf67cde[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xf67cde[_0xf153('0x1f')],function(_0xe490f8){return{'model':db[_0xe490f8[_0xf153('0x21')]],'as':_0xe490f8['as'],'attributes':_0xe490f8[_0xf153('0x1d')],'include':_0xe490f8[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xe490f8[_0xf153('0x1f')],function(_0x48ebdc){return{'model':db[_0x48ebdc[_0xf153('0x21')]],'as':_0x48ebdc['as'],'attributes':_0x48ebdc[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cdcd){logger[_0xf153('0xe')]('GetVtigerAccount',_0x138dbe);logger[_0xf153('0x11')](_0xf153('0x17'),_0x138dbe,JSON[_0xf153('0x12')](_0x16cdcd));_0x4e790d(_0x16cdcd);})[_0xf153('0x22')](function(_0x339e96){logger[_0xf153('0x13')](_0xf153('0x17'),_0x339e96[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x339e96[_0xf153('0x15')]));});});};exports[_0xf153('0x23')]=function(_0x415a5f){var _0x5b5237=this;return new Promise(function(_0x258fb0,_0xbb3619){return db[_0xf153('0x18')][_0xf153('0x24')]({'raw':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1c')]||null:null,'attributes':_0x415a5f['options']?_0x415a5f[_0xf153('0x1a')]['attributes']||null:null,'include':_0x415a5f[_0xf153('0x1a')]?_0x415a5f[_0xf153('0x1a')]['include']?_[_0xf153('0x20')](_0x415a5f[_0xf153('0x1a')][_0xf153('0x1f')],function(_0x40be52){return{'model':db[_0x40be52[_0xf153('0x21')]],'as':_0x40be52['as'],'attributes':_0x40be52[_0xf153('0x1d')],'include':_0x40be52['include']?_[_0xf153('0x20')](_0x40be52['include'],function(_0x40834b){return{'model':db[_0x40834b[_0xf153('0x21')]],'as':_0x40834b['as'],'attributes':_0x40834b[_0xf153('0x1d')],'include':_0x40834b[_0xf153('0x1f')]?_[_0xf153('0x20')](_0x40834b[_0xf153('0x1f')],function(_0x4becf3){return{'model':db[_0x4becf3[_0xf153('0x21')]],'as':_0x4becf3['as'],'attributes':_0x4becf3[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf153('0xd')](function(_0x4e0634){logger[_0xf153('0xe')](_0xf153('0x23'),_0x415a5f);logger[_0xf153('0x11')](_0xf153('0x23'),_0x415a5f,JSON[_0xf153('0x12')](_0x4e0634));_0x258fb0(_0x4e0634);})[_0xf153('0x22')](function(_0x4cc481){logger[_0xf153('0x13')](_0xf153('0x23'),_0x4cc481['message'],_0x415a5f);_0xbb3619(_0x5b5237[_0xf153('0x13')](0x1f4,_0x4cc481[_0xf153('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 94fdf41..c1ac18b 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 _0x8e73=['get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index'];(function(_0x50263a,_0x76145f){var _0x5e2d5c=function(_0x39cb24){while(--_0x39cb24){_0x50263a['push'](_0x50263a['shift']());}};_0x5e2d5c(++_0x76145f);}(_0x8e73,0x107));var _0x38e7=function(_0x50294c,_0x397b71){_0x50294c=_0x50294c-0x0;var _0x4147bd=_0x8e73[_0x50294c];return _0x4147bd;};'use strict';var multer=require(_0x38e7('0x0'));var util=require(_0x38e7('0x1'));var path=require(_0x38e7('0x2'));var timeout=require(_0x38e7('0x3'));var express=require('express');var router=express[_0x38e7('0x4')]();var fs_extra=require(_0x38e7('0x5'));var auth=require(_0x38e7('0x6'));var interaction=require(_0x38e7('0x7'));var config=require(_0x38e7('0x8'));var controller=require(_0x38e7('0x9'));router['get']('/',auth[_0x38e7('0xa')](),controller[_0x38e7('0xb')]);router[_0x38e7('0xc')](_0x38e7('0xd'),auth[_0x38e7('0xa')](),controller[_0x38e7('0xe')]);router['get'](_0x38e7('0xf'),auth[_0x38e7('0xa')](),controller['getFields']);router[_0x38e7('0xc')]('/:id/subjects',auth[_0x38e7('0xa')](),controller[_0x38e7('0x10')]);router[_0x38e7('0xc')](_0x38e7('0x11'),auth['isAuthenticated'](),controller[_0x38e7('0x12')]);router[_0x38e7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x38e7('0x14')](_0x38e7('0xd'),auth['isAuthenticated'](),controller[_0x38e7('0x15')]);router[_0x38e7('0x16')](_0x38e7('0xd'),auth[_0x38e7('0xa')](),controller[_0x38e7('0x17')]);module[_0x38e7('0x18')]=router; \ No newline at end of file +var _0xf341=['post','create','put','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2dd1f,_0x128d69){var _0x377c53=function(_0x5316ae){while(--_0x5316ae){_0x2dd1f['push'](_0x2dd1f['shift']());}};_0x377c53(++_0x128d69);}(_0xf341,0x1bd));var _0x1f34=function(_0x316eac,_0x4acbe4){_0x316eac=_0x316eac-0x0;var _0x14c49c=_0xf341[_0x316eac];return _0x14c49c;};'use strict';var multer=require('multer');var util=require(_0x1f34('0x0'));var path=require(_0x1f34('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f34('0x2'));var router=express[_0x1f34('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f34('0x4'));var interaction=require(_0x1f34('0x5'));var config=require('../../config/environment');var controller=require(_0x1f34('0x6'));router[_0x1f34('0x7')]('/',auth[_0x1f34('0x8')](),controller[_0x1f34('0x9')]);router[_0x1f34('0x7')](_0x1f34('0xa'),auth[_0x1f34('0x8')](),controller[_0x1f34('0xb')]);router[_0x1f34('0x7')](_0x1f34('0xc'),auth[_0x1f34('0x8')](),controller[_0x1f34('0xd')]);router[_0x1f34('0x7')](_0x1f34('0xe'),auth[_0x1f34('0x8')](),controller[_0x1f34('0xf')]);router[_0x1f34('0x7')]('/:id/descriptions',auth[_0x1f34('0x8')](),controller[_0x1f34('0x10')]);router[_0x1f34('0x11')]('/',auth[_0x1f34('0x8')](),controller[_0x1f34('0x12')]);router[_0x1f34('0x13')](_0x1f34('0xa'),auth[_0x1f34('0x8')](),controller['update']);router['delete'](_0x1f34('0xa'),auth[_0x1f34('0x8')](),controller[_0x1f34('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 57ccec5..2c42e73 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 _0x0c00=['sequelize','exports','STRING'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0x0c00,0x183));var _0x00c0=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x0c00[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x00c0('0x0'));module[_0x00c0('0x1')]={'name':{'type':Sequelize[_0x00c0('0x2')]},'description':{'type':Sequelize[_0x00c0('0x2')]}}; \ No newline at end of file +var _0x2350=['STRING','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2350,0x1ab));var _0x0235=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x2350[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require(_0x0235('0x0'));module[_0x0235('0x1')]={'name':{'type':Sequelize[_0x0235('0x2')]},'description':{'type':Sequelize[_0x0235('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d605a26..836a8e6 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 _0x2b9a=['map','VtigerConfiguration','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','params','destroy','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','save','update','then','sendStatus','error','stack','name','index'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x2b9a,0x164));var _0xa2b9=function(_0x17c5fc,_0x391710){_0x17c5fc=_0x17c5fc-0x0;var _0x279632=_0x2b9a[_0x17c5fc];return _0x279632;};'use strict';var emlformat=require(_0xa2b9('0x0'));var rimraf=require(_0xa2b9('0x1'));var zipdir=require(_0xa2b9('0x2'));var jsonpatch=require(_0xa2b9('0x3'));var rp=require(_0xa2b9('0x4'));var moment=require(_0xa2b9('0x5'));var BPromise=require(_0xa2b9('0x6'));var Mustache=require(_0xa2b9('0x7'));var util=require('util');var path=require(_0xa2b9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2b9('0x9'));var _=require(_0xa2b9('0xa'));var squel=require(_0xa2b9('0xb'));var crypto=require(_0xa2b9('0xc'));var jsforce=require(_0xa2b9('0xd'));var deskjs=require(_0xa2b9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa2b9('0xf'));var Papa=require(_0xa2b9('0x10'));var Redis=require(_0xa2b9('0x11'));var authService=require(_0xa2b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa2b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2b9('0x14'))('api');var utils=require(_0xa2b9('0x15'));var config=require(_0xa2b9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2b9('0x17'))['db'];function respondWithStatusCode(_0x57a0f1,_0x8d7aea){_0x8d7aea=_0x8d7aea||0xcc;return function(_0x4dff10){if(_0x4dff10){return _0x57a0f1['sendStatus'](_0x8d7aea);}return _0x57a0f1[_0xa2b9('0x18')](_0x8d7aea)[_0xa2b9('0x19')]();};}function respondWithResult(_0xe480b7,_0x4174b0){_0x4174b0=_0x4174b0||0xc8;return function(_0xa73733){if(_0xa73733){return _0xe480b7[_0xa2b9('0x18')](_0x4174b0)[_0xa2b9('0x1a')](_0xa73733);}};}function respondWithFilteredResult(_0x7eeac8,_0x1081e3){return function(_0x5d9ab5){if(_0x5d9ab5){var _0x269154=typeof _0x1081e3[_0xa2b9('0x1b')]===_0xa2b9('0x1c')&&typeof _0x1081e3['limit']===_0xa2b9('0x1c');var _0x288d0e=_0x5d9ab5[_0xa2b9('0x1d')];var _0x5cddf6=_0x269154?0x0:_0x1081e3[_0xa2b9('0x1b')];var _0x713d18=_0x269154?_0x5d9ab5[_0xa2b9('0x1d')]:_0x1081e3[_0xa2b9('0x1b')]+_0x1081e3['limit'];var _0x9cd678;if(_0x713d18>=_0x288d0e){_0x713d18=_0x288d0e;_0x9cd678=0xc8;}else{_0x9cd678=0xce;}_0x7eeac8['status'](_0x9cd678);return _0x7eeac8['set'](_0xa2b9('0x1e'),_0x5cddf6+'-'+_0x713d18+'/'+_0x288d0e)['json'](_0x5d9ab5);}return null;};}function patchUpdates(_0x270647){return function(_0x2d4b78){try{jsonpatch['apply'](_0x2d4b78,_0x270647,!![]);}catch(_0x4597dc){return BPromise['reject'](_0x4597dc);}return _0x2d4b78[_0xa2b9('0x1f')]();};}function saveUpdates(_0x254c8e,_0x5d3cac){return function(_0x121762){if(_0x121762){return _0x121762[_0xa2b9('0x20')](_0x254c8e)['then'](function(_0x4f7017){return _0x4f7017;});}return null;};}function removeEntity(_0x555f5a,_0x3f6999){return function(_0x2bf443){if(_0x2bf443){return _0x2bf443['destroy']()[_0xa2b9('0x21')](function(){_0x555f5a[_0xa2b9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9c70,_0xee1e){return function(_0x2e5ce9){if(!_0x2e5ce9){_0x2d9c70[_0xa2b9('0x22')](0x194);}return _0x2e5ce9;};}function handleError(_0x2ce9f1,_0xa624b3){_0xa624b3=_0xa624b3||0x1f4;return function(_0x403da8){logger[_0xa2b9('0x23')](_0x403da8[_0xa2b9('0x24')]);if(_0x403da8[_0xa2b9('0x25')]){delete _0x403da8[_0xa2b9('0x25')];}_0x2ce9f1['status'](_0xa624b3)['send'](_0x403da8);};}exports[_0xa2b9('0x26')]=function(_0x2201fb,_0x12cc9b){var _0x55bcee={},_0x234498={},_0x34f66e={'count':0x0,'rows':[]};var _0x1ef6bd=_[_0xa2b9('0x27')](db[_0xa2b9('0x28')][_0xa2b9('0x29')],function(_0x200816){return{'name':_0x200816[_0xa2b9('0x2a')],'type':_0x200816['type'][_0xa2b9('0x2b')]};});_0x234498['model']=_[_0xa2b9('0x27')](_0x1ef6bd,_0xa2b9('0x25'));_0x234498['query']=_[_0xa2b9('0x2c')](_0x2201fb[_0xa2b9('0x2d')]);_0x234498[_0xa2b9('0x2e')]=_['intersection'](_0x234498[_0xa2b9('0x2f')],_0x234498[_0xa2b9('0x2d')]);_0x55bcee[_0xa2b9('0x30')]=_[_0xa2b9('0x31')](_0x234498[_0xa2b9('0x2f')],qs['fields'](_0x2201fb[_0xa2b9('0x2d')]['fields']));_0x55bcee[_0xa2b9('0x30')]=_0x55bcee['attributes'][_0xa2b9('0x32')]?_0x55bcee[_0xa2b9('0x30')]:_0x234498[_0xa2b9('0x2f')];if(!_0x2201fb['query'][_0xa2b9('0x33')](_0xa2b9('0x34'))){_0x55bcee[_0xa2b9('0x35')]=qs[_0xa2b9('0x35')](_0x2201fb[_0xa2b9('0x2d')]['limit']);_0x55bcee[_0xa2b9('0x1b')]=qs[_0xa2b9('0x1b')](_0x2201fb['query'][_0xa2b9('0x1b')]);}_0x55bcee[_0xa2b9('0x36')]=qs[_0xa2b9('0x37')](_0x2201fb[_0xa2b9('0x2d')][_0xa2b9('0x37')]);_0x55bcee[_0xa2b9('0x38')]=qs['filters'](_['pick'](_0x2201fb[_0xa2b9('0x2d')],_0x234498[_0xa2b9('0x2e')]),_0x1ef6bd);if(_0x2201fb[_0xa2b9('0x2d')][_0xa2b9('0x39')]){_0x55bcee[_0xa2b9('0x38')]=_[_0xa2b9('0x3a')](_0x55bcee[_0xa2b9('0x38')],{'$or':_[_0xa2b9('0x27')](_0x1ef6bd,function(_0x3a29c5){if(_0x3a29c5[_0xa2b9('0x3b')]!=='VIRTUAL'){var _0x5171a9={};_0x5171a9[_0x3a29c5['name']]={'$like':'%'+_0x2201fb[_0xa2b9('0x2d')][_0xa2b9('0x39')]+'%'};return _0x5171a9;}})});}_0x55bcee=_['merge']({},_0x55bcee,_0x2201fb['options']);var _0x47a908={'where':_0x55bcee[_0xa2b9('0x38')]};return db[_0xa2b9('0x28')][_0xa2b9('0x1d')](_0x47a908)['then'](function(_0x398c88){_0x34f66e['count']=_0x398c88;if(_0x2201fb[_0xa2b9('0x2d')][_0xa2b9('0x3c')]){_0x55bcee[_0xa2b9('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa2b9('0x3e')](_0x55bcee);})['then'](function(_0x4ce627){_0x34f66e[_0xa2b9('0x3f')]=_0x4ce627;return _0x34f66e;})[_0xa2b9('0x21')](respondWithFilteredResult(_0x12cc9b,_0x55bcee))[_0xa2b9('0x40')](handleError(_0x12cc9b,null));};exports[_0xa2b9('0x41')]=function(_0x3b2494,_0x5108fc){var _0x3dbb06={'raw':![],'where':{'id':_0x3b2494['params']['id']}},_0x457783={};_0x457783[_0xa2b9('0x2f')]=_[_0xa2b9('0x2c')](db[_0xa2b9('0x28')]['rawAttributes']);_0x457783[_0xa2b9('0x2d')]=_[_0xa2b9('0x2c')](_0x3b2494[_0xa2b9('0x2d')]);_0x457783[_0xa2b9('0x2e')]=_['intersection'](_0x457783[_0xa2b9('0x2f')],_0x457783[_0xa2b9('0x2d')]);_0x3dbb06['attributes']=_[_0xa2b9('0x31')](_0x457783[_0xa2b9('0x2f')],qs[_0xa2b9('0x42')](_0x3b2494['query'][_0xa2b9('0x42')]));_0x3dbb06[_0xa2b9('0x30')]=_0x3dbb06['attributes'][_0xa2b9('0x32')]?_0x3dbb06[_0xa2b9('0x30')]:_0x457783[_0xa2b9('0x2f')];if(_0x3b2494[_0xa2b9('0x2d')]['includeAll']){_0x3dbb06[_0xa2b9('0x3d')]=[{'all':!![]}];}_0x3dbb06=_[_0xa2b9('0x3a')]({},_0x3dbb06,_0x3b2494[_0xa2b9('0x43')]);return db['VtigerConfiguration'][_0xa2b9('0x44')](_0x3dbb06)['then'](handleEntityNotFound(_0x5108fc,null))[_0xa2b9('0x21')](respondWithResult(_0x5108fc,null))[_0xa2b9('0x40')](handleError(_0x5108fc,null));};exports[_0xa2b9('0x45')]=function(_0x1e133e,_0x753514){return db[_0xa2b9('0x28')][_0xa2b9('0x45')](_0x1e133e[_0xa2b9('0x46')],{})[_0xa2b9('0x21')](respondWithResult(_0x753514,0xc9))[_0xa2b9('0x40')](handleError(_0x753514,null));};exports['update']=function(_0x5f2f96,_0x3edfa8){if(_0x5f2f96[_0xa2b9('0x46')]['id']){delete _0x5f2f96['body']['id'];}return db[_0xa2b9('0x28')]['find']({'where':{'id':_0x5f2f96[_0xa2b9('0x47')]['id']}})[_0xa2b9('0x21')](handleEntityNotFound(_0x3edfa8,null))[_0xa2b9('0x21')](saveUpdates(_0x5f2f96[_0xa2b9('0x46')],null))['then'](respondWithResult(_0x3edfa8,null))[_0xa2b9('0x40')](handleError(_0x3edfa8,null));};exports[_0xa2b9('0x48')]=function(_0x15287d,_0x4bc1aa){return db[_0xa2b9('0x28')][_0xa2b9('0x44')]({'where':{'id':_0x15287d[_0xa2b9('0x47')]['id']}})[_0xa2b9('0x21')](handleEntityNotFound(_0x4bc1aa,null))[_0xa2b9('0x21')](removeEntity(_0x4bc1aa,null))['catch'](handleError(_0x4bc1aa,null));};exports[_0xa2b9('0x49')]=function(_0x399431,_0x1beaaf,_0x34bc96){var _0x554a81={};var _0x263aa2={};var _0x32d3fb;var _0x43ba7a;return db[_0xa2b9('0x28')][_0xa2b9('0x4a')]({'where':{'id':_0x399431[_0xa2b9('0x47')]['id']}})[_0xa2b9('0x21')](handleEntityNotFound(_0x1beaaf,null))[_0xa2b9('0x21')](function(_0x54ac20){if(_0x54ac20){_0x32d3fb=_0x54ac20;_0x263aa2['model']=_[_0xa2b9('0x2c')](db[_0xa2b9('0x4b')][_0xa2b9('0x29')]);_0x263aa2['query']=_[_0xa2b9('0x2c')](_0x399431[_0xa2b9('0x2d')]);_0x263aa2[_0xa2b9('0x2e')]=_[_0xa2b9('0x31')](_0x263aa2['model'],_0x263aa2[_0xa2b9('0x2d')]);_0x554a81[_0xa2b9('0x30')]=_[_0xa2b9('0x31')](_0x263aa2['model'],qs['fields'](_0x399431[_0xa2b9('0x2d')]['fields']));_0x554a81[_0xa2b9('0x30')]=_0x554a81[_0xa2b9('0x30')][_0xa2b9('0x32')]?_0x554a81['attributes']:_0x263aa2[_0xa2b9('0x2f')];_0x554a81[_0xa2b9('0x36')]=qs[_0xa2b9('0x37')](_0x399431[_0xa2b9('0x2d')][_0xa2b9('0x37')]);_0x554a81[_0xa2b9('0x38')]=qs[_0xa2b9('0x2e')](_[_0xa2b9('0x4c')](_0x399431[_0xa2b9('0x2d')],_0x263aa2[_0xa2b9('0x2e')]));if(_0x399431[_0xa2b9('0x2d')]['filter']){_0x554a81[_0xa2b9('0x38')]=_[_0xa2b9('0x3a')](_0x554a81[_0xa2b9('0x38')],{'$or':_[_0xa2b9('0x27')](_0x554a81['attributes'],function(_0x1059b3){var _0x381e4e={};_0x381e4e[_0x1059b3]={'$like':'%'+_0x399431[_0xa2b9('0x2d')]['filter']+'%'};return _0x381e4e;})});}_0x554a81=_[_0xa2b9('0x3a')]({},_0x554a81,_0x399431[_0xa2b9('0x43')]);return _0x32d3fb[_0xa2b9('0x49')](_0x554a81);}})[_0xa2b9('0x21')](function(_0x5b427d){if(_0x5b427d){_0x43ba7a=_0x5b427d[_0xa2b9('0x32')];if(!_0x399431[_0xa2b9('0x2d')]['hasOwnProperty'](_0xa2b9('0x34'))){_0x554a81['limit']=qs[_0xa2b9('0x35')](_0x399431[_0xa2b9('0x2d')]['limit']);_0x554a81[_0xa2b9('0x1b')]=qs[_0xa2b9('0x1b')](_0x399431[_0xa2b9('0x2d')][_0xa2b9('0x1b')]);}return _0x32d3fb[_0xa2b9('0x49')](_0x554a81);}})[_0xa2b9('0x21')](function(_0x17788c){if(_0x17788c){return _0x17788c?{'count':_0x43ba7a,'rows':_0x17788c}:null;}})[_0xa2b9('0x21')](respondWithResult(_0x1beaaf,null))[_0xa2b9('0x40')](handleError(_0x1beaaf,null));};exports[_0xa2b9('0x4d')]=function(_0x4e7332,_0x2d10be,_0x1e7cc6){var _0x436675={};var _0x50eae4={};var _0x440ac3;var _0x4315a9;return db[_0xa2b9('0x28')]['findOne']({'where':{'id':_0x4e7332[_0xa2b9('0x47')]['id']}})[_0xa2b9('0x21')](handleEntityNotFound(_0x2d10be,null))[_0xa2b9('0x21')](function(_0x39111e){if(_0x39111e){_0x440ac3=_0x39111e;_0x50eae4[_0xa2b9('0x2f')]=_[_0xa2b9('0x2c')](db[_0xa2b9('0x4b')]['rawAttributes']);_0x50eae4[_0xa2b9('0x2d')]=_[_0xa2b9('0x2c')](_0x4e7332['query']);_0x50eae4['filters']=_[_0xa2b9('0x31')](_0x50eae4[_0xa2b9('0x2f')],_0x50eae4[_0xa2b9('0x2d')]);_0x436675[_0xa2b9('0x30')]=_[_0xa2b9('0x31')](_0x50eae4[_0xa2b9('0x2f')],qs[_0xa2b9('0x42')](_0x4e7332[_0xa2b9('0x2d')][_0xa2b9('0x42')]));_0x436675['attributes']=_0x436675[_0xa2b9('0x30')][_0xa2b9('0x32')]?_0x436675['attributes']:_0x50eae4[_0xa2b9('0x2f')];_0x436675[_0xa2b9('0x36')]=qs[_0xa2b9('0x37')](_0x4e7332[_0xa2b9('0x2d')][_0xa2b9('0x37')]);_0x436675[_0xa2b9('0x38')]=qs[_0xa2b9('0x2e')](_[_0xa2b9('0x4c')](_0x4e7332[_0xa2b9('0x2d')],_0x50eae4[_0xa2b9('0x2e')]));if(_0x4e7332['query'][_0xa2b9('0x39')]){_0x436675[_0xa2b9('0x38')]=_['merge'](_0x436675[_0xa2b9('0x38')],{'$or':_[_0xa2b9('0x27')](_0x436675[_0xa2b9('0x30')],function(_0x8a6943){var _0x41cbb5={};_0x41cbb5[_0x8a6943]={'$like':'%'+_0x4e7332[_0xa2b9('0x2d')][_0xa2b9('0x39')]+'%'};return _0x41cbb5;})});}_0x436675=_[_0xa2b9('0x3a')]({},_0x436675,_0x4e7332[_0xa2b9('0x43')]);return _0x440ac3['getSubjects'](_0x436675);}})['then'](function(_0x4f6b6e){if(_0x4f6b6e){_0x4315a9=_0x4f6b6e[_0xa2b9('0x32')];if(!_0x4e7332['query']['hasOwnProperty'](_0xa2b9('0x34'))){_0x436675[_0xa2b9('0x35')]=qs['limit'](_0x4e7332['query'][_0xa2b9('0x35')]);_0x436675[_0xa2b9('0x1b')]=qs[_0xa2b9('0x1b')](_0x4e7332[_0xa2b9('0x2d')][_0xa2b9('0x1b')]);}return _0x440ac3[_0xa2b9('0x4d')](_0x436675);}})[_0xa2b9('0x21')](function(_0x3b6d77){if(_0x3b6d77){return _0x3b6d77?{'count':_0x4315a9,'rows':_0x3b6d77}:null;}})[_0xa2b9('0x21')](respondWithResult(_0x2d10be,null))[_0xa2b9('0x40')](handleError(_0x2d10be,null));};exports[_0xa2b9('0x4e')]=function(_0x45a8a0,_0x16acfa,_0x9d956b){var _0x15c75e={};var _0x345012={};var _0x4a0e6a;var _0x20edb8;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x45a8a0[_0xa2b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x16acfa,null))['then'](function(_0x49adfa){if(_0x49adfa){_0x4a0e6a=_0x49adfa;_0x345012[_0xa2b9('0x2f')]=_[_0xa2b9('0x2c')](db[_0xa2b9('0x4b')][_0xa2b9('0x29')]);_0x345012[_0xa2b9('0x2d')]=_['keys'](_0x45a8a0[_0xa2b9('0x2d')]);_0x345012[_0xa2b9('0x2e')]=_[_0xa2b9('0x31')](_0x345012['model'],_0x345012['query']);_0x15c75e['attributes']=_['intersection'](_0x345012['model'],qs[_0xa2b9('0x42')](_0x45a8a0[_0xa2b9('0x2d')][_0xa2b9('0x42')]));_0x15c75e[_0xa2b9('0x30')]=_0x15c75e[_0xa2b9('0x30')][_0xa2b9('0x32')]?_0x15c75e[_0xa2b9('0x30')]:_0x345012[_0xa2b9('0x2f')];_0x15c75e[_0xa2b9('0x36')]=qs[_0xa2b9('0x37')](_0x45a8a0['query'][_0xa2b9('0x37')]);_0x15c75e['where']=qs[_0xa2b9('0x2e')](_[_0xa2b9('0x4c')](_0x45a8a0[_0xa2b9('0x2d')],_0x345012[_0xa2b9('0x2e')]));if(_0x45a8a0[_0xa2b9('0x2d')]['filter']){_0x15c75e[_0xa2b9('0x38')]=_['merge'](_0x15c75e[_0xa2b9('0x38')],{'$or':_['map'](_0x15c75e[_0xa2b9('0x30')],function(_0x2cc24c){var _0x54725b={};_0x54725b[_0x2cc24c]={'$like':'%'+_0x45a8a0['query']['filter']+'%'};return _0x54725b;})});}_0x15c75e=_[_0xa2b9('0x3a')]({},_0x15c75e,_0x45a8a0[_0xa2b9('0x43')]);return _0x4a0e6a['getDescriptions'](_0x15c75e);}})['then'](function(_0x5a7cb2){if(_0x5a7cb2){_0x20edb8=_0x5a7cb2['length'];if(!_0x45a8a0[_0xa2b9('0x2d')][_0xa2b9('0x33')](_0xa2b9('0x34'))){_0x15c75e['limit']=qs[_0xa2b9('0x35')](_0x45a8a0['query']['limit']);_0x15c75e[_0xa2b9('0x1b')]=qs[_0xa2b9('0x1b')](_0x45a8a0['query'][_0xa2b9('0x1b')]);}return _0x4a0e6a[_0xa2b9('0x4e')](_0x15c75e);}})[_0xa2b9('0x21')](function(_0xd2bf98){if(_0xd2bf98){return _0xd2bf98?{'count':_0x20edb8,'rows':_0xd2bf98}:null;}})[_0xa2b9('0x21')](respondWithResult(_0x16acfa,null))[_0xa2b9('0x40')](handleError(_0x16acfa,null));}; \ No newline at end of file +var _0xaea0=['save','update','then','error','name','index','map','VtigerConfiguration','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','destroy','params','getFields','findOne','VtigerField','filters','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x550f91,_0x5343fb){var _0x394695=function(_0x2d0d5d){while(--_0x2d0d5d){_0x550f91['push'](_0x550f91['shift']());}};_0x394695(++_0x5343fb);}(_0xaea0,0x165));var _0x0aea=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0xaea0[_0x4a93bb];return _0x208468;};'use strict';var emlformat=require(_0x0aea('0x0'));var rimraf=require(_0x0aea('0x1'));var zipdir=require(_0x0aea('0x2'));var jsonpatch=require(_0x0aea('0x3'));var rp=require(_0x0aea('0x4'));var moment=require('moment');var BPromise=require(_0x0aea('0x5'));var Mustache=require(_0x0aea('0x6'));var util=require(_0x0aea('0x7'));var path=require('path');var sox=require(_0x0aea('0x8'));var csv=require('to-csv');var ejs=require(_0x0aea('0x9'));var fs=require('fs');var fs_extra=require(_0x0aea('0xa'));var _=require(_0x0aea('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0aea('0xc'));var querystring=require(_0x0aea('0xd'));var Papa=require(_0x0aea('0xe'));var Redis=require(_0x0aea('0xf'));var authService=require(_0x0aea('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0aea('0x11'));var hardwareService=require(_0x0aea('0x12'));var logger=require('../../config/logger')(_0x0aea('0x13'));var utils=require(_0x0aea('0x14'));var config=require(_0x0aea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0aea('0x16'))['db'];function respondWithStatusCode(_0x5ea767,_0x4d7fdc){_0x4d7fdc=_0x4d7fdc||0xcc;return function(_0x244dd3){if(_0x244dd3){return _0x5ea767[_0x0aea('0x17')](_0x4d7fdc);}return _0x5ea767[_0x0aea('0x18')](_0x4d7fdc)[_0x0aea('0x19')]();};}function respondWithResult(_0x508885,_0x5cae5b){_0x5cae5b=_0x5cae5b||0xc8;return function(_0x3bc2c8){if(_0x3bc2c8){return _0x508885[_0x0aea('0x18')](_0x5cae5b)[_0x0aea('0x1a')](_0x3bc2c8);}};}function respondWithFilteredResult(_0x4467a7,_0x1ec14b){return function(_0x75cac3){if(_0x75cac3){var _0x51372e=typeof _0x1ec14b[_0x0aea('0x1b')]===_0x0aea('0x1c')&&typeof _0x1ec14b[_0x0aea('0x1d')]==='undefined';var _0x2e3915=_0x75cac3['count'];var _0x323c02=_0x51372e?0x0:_0x1ec14b['offset'];var _0x5678be=_0x51372e?_0x75cac3[_0x0aea('0x1e')]:_0x1ec14b['offset']+_0x1ec14b[_0x0aea('0x1d')];var _0x21d193;if(_0x5678be>=_0x2e3915){_0x5678be=_0x2e3915;_0x21d193=0xc8;}else{_0x21d193=0xce;}_0x4467a7[_0x0aea('0x18')](_0x21d193);return _0x4467a7['set'](_0x0aea('0x1f'),_0x323c02+'-'+_0x5678be+'/'+_0x2e3915)[_0x0aea('0x1a')](_0x75cac3);}return null;};}function patchUpdates(_0x52cba8){return function(_0x1fdd5b){try{jsonpatch[_0x0aea('0x20')](_0x1fdd5b,_0x52cba8,!![]);}catch(_0x1fa9e0){return BPromise['reject'](_0x1fa9e0);}return _0x1fdd5b[_0x0aea('0x21')]();};}function saveUpdates(_0x40137a,_0x5cf391){return function(_0x382a30){if(_0x382a30){return _0x382a30[_0x0aea('0x22')](_0x40137a)[_0x0aea('0x23')](function(_0x40c058){return _0x40c058;});}return null;};}function removeEntity(_0x4a5f66,_0x180203){return function(_0x3d70c4){if(_0x3d70c4){return _0x3d70c4['destroy']()[_0x0aea('0x23')](function(){_0x4a5f66[_0x0aea('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2902,_0x168bd7){return function(_0x2fdd6b){if(!_0x2fdd6b){_0x4c2902[_0x0aea('0x17')](0x194);}return _0x2fdd6b;};}function handleError(_0x2a0b6a,_0x46cece){_0x46cece=_0x46cece||0x1f4;return function(_0x468d1a){logger[_0x0aea('0x24')](_0x468d1a['stack']);if(_0x468d1a['name']){delete _0x468d1a[_0x0aea('0x25')];}_0x2a0b6a[_0x0aea('0x18')](_0x46cece)['send'](_0x468d1a);};}exports[_0x0aea('0x26')]=function(_0x2597e8,_0x55ec88){var _0x155467={},_0x55ef2f={},_0x47f903={'count':0x0,'rows':[]};var _0x39c8f1=_[_0x0aea('0x27')](db[_0x0aea('0x28')]['rawAttributes'],function(_0x4b5065){return{'name':_0x4b5065['fieldName'],'type':_0x4b5065[_0x0aea('0x29')][_0x0aea('0x2a')]};});_0x55ef2f[_0x0aea('0x2b')]=_[_0x0aea('0x27')](_0x39c8f1,_0x0aea('0x25'));_0x55ef2f[_0x0aea('0x2c')]=_[_0x0aea('0x2d')](_0x2597e8[_0x0aea('0x2c')]);_0x55ef2f['filters']=_['intersection'](_0x55ef2f[_0x0aea('0x2b')],_0x55ef2f[_0x0aea('0x2c')]);_0x155467[_0x0aea('0x2e')]=_[_0x0aea('0x2f')](_0x55ef2f[_0x0aea('0x2b')],qs[_0x0aea('0x30')](_0x2597e8['query']['fields']));_0x155467[_0x0aea('0x2e')]=_0x155467[_0x0aea('0x2e')]['length']?_0x155467[_0x0aea('0x2e')]:_0x55ef2f['model'];if(!_0x2597e8['query'][_0x0aea('0x31')](_0x0aea('0x32'))){_0x155467[_0x0aea('0x1d')]=qs[_0x0aea('0x1d')](_0x2597e8[_0x0aea('0x2c')]['limit']);_0x155467['offset']=qs[_0x0aea('0x1b')](_0x2597e8[_0x0aea('0x2c')][_0x0aea('0x1b')]);}_0x155467[_0x0aea('0x33')]=qs[_0x0aea('0x34')](_0x2597e8['query'][_0x0aea('0x34')]);_0x155467[_0x0aea('0x35')]=qs['filters'](_[_0x0aea('0x36')](_0x2597e8[_0x0aea('0x2c')],_0x55ef2f['filters']),_0x39c8f1);if(_0x2597e8[_0x0aea('0x2c')][_0x0aea('0x37')]){_0x155467[_0x0aea('0x35')]=_[_0x0aea('0x38')](_0x155467[_0x0aea('0x35')],{'$or':_[_0x0aea('0x27')](_0x39c8f1,function(_0x5f0d48){if(_0x5f0d48[_0x0aea('0x29')]!==_0x0aea('0x39')){var _0x72d5ce={};_0x72d5ce[_0x5f0d48[_0x0aea('0x25')]]={'$like':'%'+_0x2597e8[_0x0aea('0x2c')][_0x0aea('0x37')]+'%'};return _0x72d5ce;}})});}_0x155467=_[_0x0aea('0x38')]({},_0x155467,_0x2597e8[_0x0aea('0x3a')]);var _0x15f657={'where':_0x155467['where']};return db[_0x0aea('0x28')][_0x0aea('0x1e')](_0x15f657)[_0x0aea('0x23')](function(_0x16cbaf){_0x47f903['count']=_0x16cbaf;if(_0x2597e8['query'][_0x0aea('0x3b')]){_0x155467[_0x0aea('0x3c')]=[{'all':!![]}];}return db[_0x0aea('0x28')][_0x0aea('0x3d')](_0x155467);})['then'](function(_0x5855a1){_0x47f903[_0x0aea('0x3e')]=_0x5855a1;return _0x47f903;})[_0x0aea('0x23')](respondWithFilteredResult(_0x55ec88,_0x155467))[_0x0aea('0x3f')](handleError(_0x55ec88,null));};exports[_0x0aea('0x40')]=function(_0x554b57,_0x40c3ab){var _0xb4818={'raw':![],'where':{'id':_0x554b57['params']['id']}},_0x40eb02={};_0x40eb02['model']=_[_0x0aea('0x2d')](db[_0x0aea('0x28')][_0x0aea('0x41')]);_0x40eb02[_0x0aea('0x2c')]=_['keys'](_0x554b57[_0x0aea('0x2c')]);_0x40eb02['filters']=_['intersection'](_0x40eb02[_0x0aea('0x2b')],_0x40eb02['query']);_0xb4818['attributes']=_['intersection'](_0x40eb02[_0x0aea('0x2b')],qs['fields'](_0x554b57['query']['fields']));_0xb4818[_0x0aea('0x2e')]=_0xb4818[_0x0aea('0x2e')][_0x0aea('0x42')]?_0xb4818[_0x0aea('0x2e')]:_0x40eb02['model'];if(_0x554b57[_0x0aea('0x2c')][_0x0aea('0x3b')]){_0xb4818[_0x0aea('0x3c')]=[{'all':!![]}];}_0xb4818=_[_0x0aea('0x38')]({},_0xb4818,_0x554b57[_0x0aea('0x3a')]);return db['VtigerConfiguration'][_0x0aea('0x43')](_0xb4818)[_0x0aea('0x23')](handleEntityNotFound(_0x40c3ab,null))[_0x0aea('0x23')](respondWithResult(_0x40c3ab,null))[_0x0aea('0x3f')](handleError(_0x40c3ab,null));};exports[_0x0aea('0x44')]=function(_0x4029c8,_0x5c8c0e){return db['VtigerConfiguration']['create'](_0x4029c8[_0x0aea('0x45')],{})['then'](respondWithResult(_0x5c8c0e,0xc9))[_0x0aea('0x3f')](handleError(_0x5c8c0e,null));};exports[_0x0aea('0x22')]=function(_0x56dc9c,_0x14766b){if(_0x56dc9c[_0x0aea('0x45')]['id']){delete _0x56dc9c[_0x0aea('0x45')]['id'];}return db[_0x0aea('0x28')][_0x0aea('0x43')]({'where':{'id':_0x56dc9c['params']['id']}})[_0x0aea('0x23')](handleEntityNotFound(_0x14766b,null))['then'](saveUpdates(_0x56dc9c[_0x0aea('0x45')],null))[_0x0aea('0x23')](respondWithResult(_0x14766b,null))[_0x0aea('0x3f')](handleError(_0x14766b,null));};exports[_0x0aea('0x46')]=function(_0x530f58,_0x10a643){return db[_0x0aea('0x28')]['find']({'where':{'id':_0x530f58[_0x0aea('0x47')]['id']}})['then'](handleEntityNotFound(_0x10a643,null))['then'](removeEntity(_0x10a643,null))[_0x0aea('0x3f')](handleError(_0x10a643,null));};exports[_0x0aea('0x48')]=function(_0x303481,_0x56f5a5,_0x2e7010){var _0x122c9b={};var _0x579771={};var _0x17a10f;var _0x570507;return db['VtigerConfiguration'][_0x0aea('0x49')]({'where':{'id':_0x303481[_0x0aea('0x47')]['id']}})[_0x0aea('0x23')](handleEntityNotFound(_0x56f5a5,null))[_0x0aea('0x23')](function(_0x4cdbda){if(_0x4cdbda){_0x17a10f=_0x4cdbda;_0x579771['model']=_['keys'](db[_0x0aea('0x4a')][_0x0aea('0x41')]);_0x579771[_0x0aea('0x2c')]=_[_0x0aea('0x2d')](_0x303481[_0x0aea('0x2c')]);_0x579771[_0x0aea('0x4b')]=_[_0x0aea('0x2f')](_0x579771[_0x0aea('0x2b')],_0x579771['query']);_0x122c9b[_0x0aea('0x2e')]=_[_0x0aea('0x2f')](_0x579771['model'],qs[_0x0aea('0x30')](_0x303481[_0x0aea('0x2c')][_0x0aea('0x30')]));_0x122c9b[_0x0aea('0x2e')]=_0x122c9b['attributes'][_0x0aea('0x42')]?_0x122c9b[_0x0aea('0x2e')]:_0x579771[_0x0aea('0x2b')];_0x122c9b[_0x0aea('0x33')]=qs[_0x0aea('0x34')](_0x303481[_0x0aea('0x2c')][_0x0aea('0x34')]);_0x122c9b[_0x0aea('0x35')]=qs['filters'](_[_0x0aea('0x36')](_0x303481[_0x0aea('0x2c')],_0x579771[_0x0aea('0x4b')]));if(_0x303481[_0x0aea('0x2c')][_0x0aea('0x37')]){_0x122c9b['where']=_[_0x0aea('0x38')](_0x122c9b[_0x0aea('0x35')],{'$or':_[_0x0aea('0x27')](_0x122c9b['attributes'],function(_0x105e27){var _0x4b4a54={};_0x4b4a54[_0x105e27]={'$like':'%'+_0x303481[_0x0aea('0x2c')]['filter']+'%'};return _0x4b4a54;})});}_0x122c9b=_['merge']({},_0x122c9b,_0x303481[_0x0aea('0x3a')]);return _0x17a10f[_0x0aea('0x48')](_0x122c9b);}})[_0x0aea('0x23')](function(_0x562af2){if(_0x562af2){_0x570507=_0x562af2[_0x0aea('0x42')];if(!_0x303481['query']['hasOwnProperty'](_0x0aea('0x32'))){_0x122c9b[_0x0aea('0x1d')]=qs[_0x0aea('0x1d')](_0x303481['query'][_0x0aea('0x1d')]);_0x122c9b[_0x0aea('0x1b')]=qs[_0x0aea('0x1b')](_0x303481['query'][_0x0aea('0x1b')]);}return _0x17a10f[_0x0aea('0x48')](_0x122c9b);}})['then'](function(_0x406972){if(_0x406972){return _0x406972?{'count':_0x570507,'rows':_0x406972}:null;}})[_0x0aea('0x23')](respondWithResult(_0x56f5a5,null))[_0x0aea('0x3f')](handleError(_0x56f5a5,null));};exports[_0x0aea('0x4c')]=function(_0x55d444,_0x109071,_0x474063){var _0x18c631={};var _0x17d9a6={};var _0x4b703e;var _0x4d0d1b;return db['VtigerConfiguration'][_0x0aea('0x49')]({'where':{'id':_0x55d444[_0x0aea('0x47')]['id']}})[_0x0aea('0x23')](handleEntityNotFound(_0x109071,null))[_0x0aea('0x23')](function(_0x3f0a5b){if(_0x3f0a5b){_0x4b703e=_0x3f0a5b;_0x17d9a6['model']=_[_0x0aea('0x2d')](db[_0x0aea('0x4a')][_0x0aea('0x41')]);_0x17d9a6[_0x0aea('0x2c')]=_[_0x0aea('0x2d')](_0x55d444[_0x0aea('0x2c')]);_0x17d9a6[_0x0aea('0x4b')]=_['intersection'](_0x17d9a6['model'],_0x17d9a6['query']);_0x18c631[_0x0aea('0x2e')]=_['intersection'](_0x17d9a6['model'],qs[_0x0aea('0x30')](_0x55d444[_0x0aea('0x2c')][_0x0aea('0x30')]));_0x18c631[_0x0aea('0x2e')]=_0x18c631[_0x0aea('0x2e')][_0x0aea('0x42')]?_0x18c631[_0x0aea('0x2e')]:_0x17d9a6[_0x0aea('0x2b')];_0x18c631[_0x0aea('0x33')]=qs[_0x0aea('0x34')](_0x55d444[_0x0aea('0x2c')]['sort']);_0x18c631[_0x0aea('0x35')]=qs['filters'](_[_0x0aea('0x36')](_0x55d444[_0x0aea('0x2c')],_0x17d9a6['filters']));if(_0x55d444['query']['filter']){_0x18c631['where']=_[_0x0aea('0x38')](_0x18c631[_0x0aea('0x35')],{'$or':_['map'](_0x18c631['attributes'],function(_0x5d50b0){var _0x443890={};_0x443890[_0x5d50b0]={'$like':'%'+_0x55d444[_0x0aea('0x2c')][_0x0aea('0x37')]+'%'};return _0x443890;})});}_0x18c631=_[_0x0aea('0x38')]({},_0x18c631,_0x55d444['options']);return _0x4b703e[_0x0aea('0x4c')](_0x18c631);}})[_0x0aea('0x23')](function(_0x23f8d2){if(_0x23f8d2){_0x4d0d1b=_0x23f8d2[_0x0aea('0x42')];if(!_0x55d444['query'][_0x0aea('0x31')](_0x0aea('0x32'))){_0x18c631[_0x0aea('0x1d')]=qs['limit'](_0x55d444[_0x0aea('0x2c')][_0x0aea('0x1d')]);_0x18c631[_0x0aea('0x1b')]=qs[_0x0aea('0x1b')](_0x55d444[_0x0aea('0x2c')][_0x0aea('0x1b')]);}return _0x4b703e[_0x0aea('0x4c')](_0x18c631);}})[_0x0aea('0x23')](function(_0x39a4a4){if(_0x39a4a4){return _0x39a4a4?{'count':_0x4d0d1b,'rows':_0x39a4a4}:null;}})[_0x0aea('0x23')](respondWithResult(_0x109071,null))[_0x0aea('0x3f')](handleError(_0x109071,null));};exports[_0x0aea('0x4d')]=function(_0x32a6a8,_0x452515,_0x1ac7e3){var _0xe7a6c2={};var _0x127dc3={};var _0x1591f3;var _0xcfe225;return db[_0x0aea('0x28')][_0x0aea('0x49')]({'where':{'id':_0x32a6a8[_0x0aea('0x47')]['id']}})[_0x0aea('0x23')](handleEntityNotFound(_0x452515,null))[_0x0aea('0x23')](function(_0x59238d){if(_0x59238d){_0x1591f3=_0x59238d;_0x127dc3[_0x0aea('0x2b')]=_[_0x0aea('0x2d')](db[_0x0aea('0x4a')][_0x0aea('0x41')]);_0x127dc3[_0x0aea('0x2c')]=_[_0x0aea('0x2d')](_0x32a6a8[_0x0aea('0x2c')]);_0x127dc3['filters']=_[_0x0aea('0x2f')](_0x127dc3[_0x0aea('0x2b')],_0x127dc3[_0x0aea('0x2c')]);_0xe7a6c2['attributes']=_[_0x0aea('0x2f')](_0x127dc3['model'],qs[_0x0aea('0x30')](_0x32a6a8[_0x0aea('0x2c')][_0x0aea('0x30')]));_0xe7a6c2[_0x0aea('0x2e')]=_0xe7a6c2[_0x0aea('0x2e')][_0x0aea('0x42')]?_0xe7a6c2[_0x0aea('0x2e')]:_0x127dc3[_0x0aea('0x2b')];_0xe7a6c2[_0x0aea('0x33')]=qs[_0x0aea('0x34')](_0x32a6a8[_0x0aea('0x2c')][_0x0aea('0x34')]);_0xe7a6c2[_0x0aea('0x35')]=qs[_0x0aea('0x4b')](_['pick'](_0x32a6a8[_0x0aea('0x2c')],_0x127dc3['filters']));if(_0x32a6a8[_0x0aea('0x2c')][_0x0aea('0x37')]){_0xe7a6c2[_0x0aea('0x35')]=_['merge'](_0xe7a6c2[_0x0aea('0x35')],{'$or':_['map'](_0xe7a6c2['attributes'],function(_0x1b73f2){var _0x7493d9={};_0x7493d9[_0x1b73f2]={'$like':'%'+_0x32a6a8[_0x0aea('0x2c')][_0x0aea('0x37')]+'%'};return _0x7493d9;})});}_0xe7a6c2=_[_0x0aea('0x38')]({},_0xe7a6c2,_0x32a6a8[_0x0aea('0x3a')]);return _0x1591f3['getDescriptions'](_0xe7a6c2);}})[_0x0aea('0x23')](function(_0x2cc261){if(_0x2cc261){_0xcfe225=_0x2cc261['length'];if(!_0x32a6a8['query'][_0x0aea('0x31')](_0x0aea('0x32'))){_0xe7a6c2['limit']=qs[_0x0aea('0x1d')](_0x32a6a8['query']['limit']);_0xe7a6c2[_0x0aea('0x1b')]=qs[_0x0aea('0x1b')](_0x32a6a8[_0x0aea('0x2c')][_0x0aea('0x1b')]);}return _0x1591f3['getDescriptions'](_0xe7a6c2);}})[_0x0aea('0x23')](function(_0x2e9d4f){if(_0x2e9d4f){return _0x2e9d4f?{'count':_0xcfe225,'rows':_0x2e9d4f}:null;}})[_0x0aea('0x23')](respondWithResult(_0x452515,null))[_0x0aea('0x3f')](handleError(_0x452515,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 278a220..2d49218 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 _0x01f2=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3c6755,_0x391785){var _0x18bc7d=function(_0x3deb12){while(--_0x3deb12){_0x3c6755['push'](_0x3c6755['shift']());}};_0x18bc7d(++_0x391785);}(_0x01f2,0x156));var _0x201f=function(_0x2b0f4d,_0x20722b){_0x2b0f4d=_0x2b0f4d-0x0;var _0x5da91c=_0x01f2[_0x2b0f4d];return _0x5da91c;};'use strict';var _=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var logger=require(_0x201f('0x2'))(_0x201f('0x3'));var moment=require(_0x201f('0x4'));var BPromise=require('bluebird');var rp=require(_0x201f('0x5'));var fs=require('fs');var path=require(_0x201f('0x6'));var rimraf=require(_0x201f('0x7'));var config=require(_0x201f('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x201f('0x9')]=function(_0x52c755,_0x48ae9f){return _0x52c755[_0x201f('0xa')](_0x201f('0xb'),attributes,{'tableName':_0x201f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcea9=['bluebird','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment'];(function(_0x2c5b71,_0x201d96){var _0x27658f=function(_0x3e8e38){while(--_0x3e8e38){_0x2c5b71['push'](_0x2c5b71['shift']());}};_0x27658f(++_0x201d96);}(_0xcea9,0x17c));var _0x9cea=function(_0x4ee104,_0x554e0a){_0x4ee104=_0x4ee104-0x0;var _0x2a0831=_0xcea9[_0x4ee104];return _0x2a0831;};'use strict';var _=require(_0x9cea('0x0'));var util=require(_0x9cea('0x1'));var logger=require('../../config/logger')(_0x9cea('0x2'));var moment=require(_0x9cea('0x3'));var BPromise=require(_0x9cea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cea('0x5'));var rimraf=require(_0x9cea('0x6'));var config=require('../../config/environment');var attributes=require(_0x9cea('0x7'));module[_0x9cea('0x8')]=function(_0x3e14ae,_0x12afb7){return _0x3e14ae[_0x9cea('0x9')](_0x9cea('0xa'),attributes,{'tableName':_0x9cea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index cd0152c..7944df2 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 _0x9fa6=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x9fa6,0x10b));var _0x69fa=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x9fa6[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x69fa('0x0'));var util=require(_0x69fa('0x1'));var moment=require(_0x69fa('0x2'));var BPromise=require(_0x69fa('0x3'));var rs=require(_0x69fa('0x4'));var fs=require('fs');var Redis=require(_0x69fa('0x5'));var db=require(_0x69fa('0x6'))['db'];var utils=require(_0x69fa('0x7'));var logger=require('../../config/logger')(_0x69fa('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69fa('0x9')][_0x69fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15ea8b,_0x5c9c43,_0x15a816){return new BPromise(function(_0x38b0c2,_0x309890){return client[_0x69fa('0xb')](_0x15ea8b,_0x15a816)[_0x69fa('0xc')](function(_0x47b03a){logger[_0x69fa('0xd')](_0x69fa('0xe'),_0x5c9c43,_0x69fa('0xf'));logger[_0x69fa('0x10')](_0x69fa('0x11'),_0x5c9c43,_0x69fa('0xf'),JSON[_0x69fa('0x12')](_0x47b03a));if(_0x47b03a[_0x69fa('0x13')]){if(_0x47b03a[_0x69fa('0x13')][_0x69fa('0x14')]===0x1f4){logger[_0x69fa('0x13')](_0x69fa('0xe'),_0x5c9c43,_0x47b03a['error'][_0x69fa('0x15')]);return _0x309890(_0x47b03a[_0x69fa('0x13')]['message']);}logger[_0x69fa('0x13')](_0x69fa('0xe'),_0x5c9c43,_0x47b03a[_0x69fa('0x13')]['message']);return _0x38b0c2(_0x47b03a['error'][_0x69fa('0x15')]);}else{logger[_0x69fa('0xd')](_0x69fa('0xe'),_0x5c9c43,_0x69fa('0xf'));_0x38b0c2(_0x47b03a[_0x69fa('0x16')][_0x69fa('0x15')]);}})['catch'](function(_0x2262c9){logger[_0x69fa('0x13')](_0x69fa('0xe'),_0x5c9c43,_0x2262c9);_0x309890(_0x2262c9);});});} \ No newline at end of file +var _0xc9a6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4a4215,_0x1c0896){var _0x3efed5=function(_0x329cd2){while(--_0x329cd2){_0x4a4215['push'](_0x4a4215['shift']());}};_0x3efed5(++_0x1c0896);}(_0xc9a6,0x1b6));var _0x6c9a=function(_0x468d3a,_0x2e922b){_0x468d3a=_0x468d3a-0x0;var _0x29871b=_0xc9a6[_0x468d3a];return _0x29871b;};'use strict';var _=require(_0x6c9a('0x0'));var util=require(_0x6c9a('0x1'));var moment=require(_0x6c9a('0x2'));var BPromise=require(_0x6c9a('0x3'));var rs=require(_0x6c9a('0x4'));var fs=require('fs');var Redis=require(_0x6c9a('0x5'));var db=require(_0x6c9a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c9a('0x7'))(_0x6c9a('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c9a('0x9'));var client=jayson[_0x6c9a('0xa')][_0x6c9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48ea9e,_0x3d3478,_0x53af78){return new BPromise(function(_0x6673e0,_0x14baa2){return client[_0x6c9a('0xc')](_0x48ea9e,_0x53af78)['then'](function(_0x37c634){logger[_0x6c9a('0xd')](_0x6c9a('0xe'),_0x3d3478,'request\x20sent');logger[_0x6c9a('0xf')](_0x6c9a('0x10'),_0x3d3478,_0x6c9a('0x11'),JSON[_0x6c9a('0x12')](_0x37c634));if(_0x37c634[_0x6c9a('0x13')]){if(_0x37c634[_0x6c9a('0x13')][_0x6c9a('0x14')]===0x1f4){logger['error'](_0x6c9a('0xe'),_0x3d3478,_0x37c634[_0x6c9a('0x13')][_0x6c9a('0x15')]);return _0x14baa2(_0x37c634[_0x6c9a('0x13')][_0x6c9a('0x15')]);}logger[_0x6c9a('0x13')](_0x6c9a('0xe'),_0x3d3478,_0x37c634[_0x6c9a('0x13')]['message']);return _0x6673e0(_0x37c634[_0x6c9a('0x13')][_0x6c9a('0x15')]);}else{logger[_0x6c9a('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x3d3478,_0x6c9a('0x11'));_0x6673e0(_0x37c634[_0x6c9a('0x16')]['message']);}})[_0x6c9a('0x17')](function(_0x3c2853){logger[_0x6c9a('0x13')](_0x6c9a('0xe'),_0x3d3478,_0x3c2853);_0x14baa2(_0x3c2853);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 19ae80e..8610df5 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 _0xefb7=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','util','path','express','Router','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xefb7,0x13e));var _0x7efb=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xefb7[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require(_0x7efb('0x0'));var path=require(_0x7efb('0x1'));var timeout=require('connect-timeout');var express=require(_0x7efb('0x2'));var router=express[_0x7efb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7efb('0x4'));var interaction=require(_0x7efb('0x5'));var config=require(_0x7efb('0x6'));var controller=require(_0x7efb('0x7'));router['get']('/',auth[_0x7efb('0x8')](),controller[_0x7efb('0x9')]);router[_0x7efb('0xa')](_0x7efb('0xb'),auth[_0x7efb('0x8')](),controller['show']);router[_0x7efb('0xc')]('/',auth[_0x7efb('0x8')](),controller[_0x7efb('0xd')]);router[_0x7efb('0xe')](_0x7efb('0xb'),auth[_0x7efb('0x8')](),controller[_0x7efb('0xf')]);router[_0x7efb('0x10')](_0x7efb('0xb'),auth[_0x7efb('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9e8=['index','show','post','create','/:id','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x55fe01,_0x12ed37){var _0x5b42f0=function(_0x461191){while(--_0x461191){_0x55fe01['push'](_0x55fe01['shift']());}};_0x5b42f0(++_0x12ed37);}(_0xa9e8,0xeb));var _0x8a9e=function(_0xd94707,_0x3cacec){_0xd94707=_0xd94707-0x0;var _0x273bf8=_0xa9e8[_0xd94707];return _0x273bf8;};'use strict';var multer=require(_0x8a9e('0x0'));var util=require(_0x8a9e('0x1'));var path=require(_0x8a9e('0x2'));var timeout=require(_0x8a9e('0x3'));var express=require(_0x8a9e('0x4'));var router=express['Router']();var fs_extra=require(_0x8a9e('0x5'));var auth=require(_0x8a9e('0x6'));var interaction=require(_0x8a9e('0x7'));var config=require(_0x8a9e('0x8'));var controller=require(_0x8a9e('0x9'));router[_0x8a9e('0xa')]('/',auth[_0x8a9e('0xb')](),controller[_0x8a9e('0xc')]);router[_0x8a9e('0xa')]('/:id',auth[_0x8a9e('0xb')](),controller[_0x8a9e('0xd')]);router[_0x8a9e('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a9e('0xf')]);router['put'](_0x8a9e('0x10'),auth['isAuthenticated'](),controller[_0x8a9e('0x11')]);router['delete'](_0x8a9e('0x10'),auth[_0x8a9e('0xb')](),controller[_0x8a9e('0x12')]);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 cafe29e..cbbcfdd 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 _0x59ac=['STRING','ENUM','customVariable','exports','variable','keyValue','string'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x59ac,0xd5));var _0xc59a=function(_0x41d724,_0x27ef20){_0x41d724=_0x41d724-0x0;var _0x4884b3=_0x59ac[_0x41d724];return _0x4884b3;};'use strict';var Sequelize=require('sequelize');module[_0xc59a('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xc59a('0x1'),'customVariable',_0xc59a('0x2'),'picklist'),'defaultValue':_0xc59a('0x3')},'content':{'type':Sequelize[_0xc59a('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc59a('0x5')](_0xc59a('0x3'),'variable',_0xc59a('0x6'))},'keyContent':{'type':Sequelize[_0xc59a('0x4')]},'idField':{'type':Sequelize[_0xc59a('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xced9=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','variable'];(function(_0x45e335,_0x1add07){var _0x31497d=function(_0x3578e9){while(--_0x3578e9){_0x45e335['push'](_0x45e335['shift']());}};_0x31497d(++_0x1add07);}(_0xced9,0x1e3));var _0x9ced=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xced9[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0x9ced('0x0'));module[_0x9ced('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x9ced('0x2'),_0x9ced('0x3'),_0x9ced('0x4'),_0x9ced('0x5')),'defaultValue':_0x9ced('0x6')},'content':{'type':Sequelize[_0x9ced('0x7')]},'key':{'type':Sequelize[_0x9ced('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x9ced('0x6'),_0x9ced('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x9ced('0x7')]},'idField':{'type':Sequelize[_0x9ced('0x7')]},'nameField':{'type':Sequelize[_0x9ced('0x7')]},'customField':{'type':Sequelize[_0x9ced('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ced('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 155585f..c2e33fc 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 _0x76f7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','VtigerField','findAll','rows','catch','show','params','length','include','options','find','create','body','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5a18ed,_0x9936d2){var _0x12d357=function(_0x1bfa4c){while(--_0x1bfa4c){_0x5a18ed['push'](_0x5a18ed['shift']());}};_0x12d357(++_0x9936d2);}(_0x76f7,0x1a1));var _0x776f=function(_0x5f0545,_0x24fc7a){_0x5f0545=_0x5f0545-0x0;var _0xcce318=_0x76f7[_0x5f0545];return _0xcce318;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x776f('0x0'));var zipdir=require(_0x776f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x776f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x776f('0x3'));var sox=require(_0x776f('0x4'));var csv=require(_0x776f('0x5'));var ejs=require(_0x776f('0x6'));var fs=require('fs');var fs_extra=require(_0x776f('0x7'));var _=require(_0x776f('0x8'));var squel=require(_0x776f('0x9'));var crypto=require('crypto');var jsforce=require(_0x776f('0xa'));var deskjs=require(_0x776f('0xb'));var toCsv=require(_0x776f('0x5'));var querystring=require(_0x776f('0xc'));var Papa=require(_0x776f('0xd'));var Redis=require(_0x776f('0xe'));var authService=require(_0x776f('0xf'));var qs=require(_0x776f('0x10'));var as=require(_0x776f('0x11'));var hardwareService=require(_0x776f('0x12'));var logger=require('../../config/logger')(_0x776f('0x13'));var utils=require(_0x776f('0x14'));var config=require(_0x776f('0x15'));var licenseUtil=require(_0x776f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x94dda4,_0x2017d6){_0x2017d6=_0x2017d6||0xcc;return function(_0x3f76ef){if(_0x3f76ef){return _0x94dda4[_0x776f('0x17')](_0x2017d6);}return _0x94dda4['status'](_0x2017d6)[_0x776f('0x18')]();};}function respondWithResult(_0x553fac,_0x5bc3e8){_0x5bc3e8=_0x5bc3e8||0xc8;return function(_0x3d7ec8){if(_0x3d7ec8){return _0x553fac[_0x776f('0x19')](_0x5bc3e8)[_0x776f('0x1a')](_0x3d7ec8);}};}function respondWithFilteredResult(_0x23a617,_0x51a1ac){return function(_0x33196d){if(_0x33196d){var _0xa91517=typeof _0x51a1ac[_0x776f('0x1b')]===_0x776f('0x1c')&&typeof _0x51a1ac[_0x776f('0x1d')]===_0x776f('0x1c');var _0x17fb02=_0x33196d[_0x776f('0x1e')];var _0x4d3c84=_0xa91517?0x0:_0x51a1ac[_0x776f('0x1b')];var _0x5f1bae=_0xa91517?_0x33196d[_0x776f('0x1e')]:_0x51a1ac['offset']+_0x51a1ac[_0x776f('0x1d')];var _0x13fcdb;if(_0x5f1bae>=_0x17fb02){_0x5f1bae=_0x17fb02;_0x13fcdb=0xc8;}else{_0x13fcdb=0xce;}_0x23a617['status'](_0x13fcdb);return _0x23a617[_0x776f('0x1f')](_0x776f('0x20'),_0x4d3c84+'-'+_0x5f1bae+'/'+_0x17fb02)[_0x776f('0x1a')](_0x33196d);}return null;};}function patchUpdates(_0x2b84e0){return function(_0x1a97b5){try{jsonpatch[_0x776f('0x21')](_0x1a97b5,_0x2b84e0,!![]);}catch(_0x1454dd){return BPromise['reject'](_0x1454dd);}return _0x1a97b5['save']();};}function saveUpdates(_0x1a78cf,_0x5c9763){return function(_0x183c9d){if(_0x183c9d){return _0x183c9d[_0x776f('0x22')](_0x1a78cf)[_0x776f('0x23')](function(_0x5177b8){return _0x5177b8;});}return null;};}function removeEntity(_0x67ac52,_0x1fd49e){return function(_0xe033e6){if(_0xe033e6){return _0xe033e6[_0x776f('0x24')]()[_0x776f('0x23')](function(){_0x67ac52[_0x776f('0x19')](0xcc)[_0x776f('0x18')]();});}};}function handleEntityNotFound(_0x33f6b6,_0x12b10f){return function(_0x3af9e0){if(!_0x3af9e0){_0x33f6b6['sendStatus'](0x194);}return _0x3af9e0;};}function handleError(_0x6898df,_0x2eac15){_0x2eac15=_0x2eac15||0x1f4;return function(_0x28c4de){logger[_0x776f('0x25')](_0x28c4de['stack']);if(_0x28c4de[_0x776f('0x26')]){delete _0x28c4de['name'];}_0x6898df[_0x776f('0x19')](_0x2eac15)[_0x776f('0x27')](_0x28c4de);};}exports[_0x776f('0x28')]=function(_0x490752,_0xe2d603){var _0x42ac41={},_0xe4c45e={},_0x21ed2f={'count':0x0,'rows':[]};var _0x5536ee=_[_0x776f('0x29')](db['VtigerField'][_0x776f('0x2a')],function(_0x56249b){return{'name':_0x56249b[_0x776f('0x2b')],'type':_0x56249b[_0x776f('0x2c')][_0x776f('0x2d')]};});_0xe4c45e['model']=_[_0x776f('0x29')](_0x5536ee,_0x776f('0x26'));_0xe4c45e[_0x776f('0x2e')]=_[_0x776f('0x2f')](_0x490752['query']);_0xe4c45e[_0x776f('0x30')]=_[_0x776f('0x31')](_0xe4c45e[_0x776f('0x32')],_0xe4c45e[_0x776f('0x2e')]);_0x42ac41[_0x776f('0x33')]=_[_0x776f('0x31')](_0xe4c45e[_0x776f('0x32')],qs[_0x776f('0x34')](_0x490752[_0x776f('0x2e')][_0x776f('0x34')]));_0x42ac41[_0x776f('0x33')]=_0x42ac41[_0x776f('0x33')]['length']?_0x42ac41[_0x776f('0x33')]:_0xe4c45e[_0x776f('0x32')];if(!_0x490752['query'][_0x776f('0x35')]('nolimit')){_0x42ac41['limit']=qs[_0x776f('0x1d')](_0x490752[_0x776f('0x2e')]['limit']);_0x42ac41[_0x776f('0x1b')]=qs[_0x776f('0x1b')](_0x490752[_0x776f('0x2e')][_0x776f('0x1b')]);}_0x42ac41['order']=qs[_0x776f('0x36')](_0x490752[_0x776f('0x2e')]['sort']);_0x42ac41[_0x776f('0x37')]=qs['filters'](_[_0x776f('0x38')](_0x490752[_0x776f('0x2e')],_0xe4c45e['filters']),_0x5536ee);if(_0x490752[_0x776f('0x2e')][_0x776f('0x39')]){_0x42ac41[_0x776f('0x37')]=_[_0x776f('0x3a')](_0x42ac41[_0x776f('0x37')],{'$or':_[_0x776f('0x29')](_0x5536ee,function(_0x15c536){if(_0x15c536[_0x776f('0x2c')]!==_0x776f('0x3b')){var _0x446c54={};_0x446c54[_0x15c536[_0x776f('0x26')]]={'$like':'%'+_0x490752[_0x776f('0x2e')][_0x776f('0x39')]+'%'};return _0x446c54;}})});}_0x42ac41=_[_0x776f('0x3a')]({},_0x42ac41,_0x490752['options']);var _0x41b6c1={'where':_0x42ac41[_0x776f('0x37')]};return db[_0x776f('0x3c')][_0x776f('0x1e')](_0x41b6c1)['then'](function(_0x4401de){_0x21ed2f[_0x776f('0x1e')]=_0x4401de;if(_0x490752[_0x776f('0x2e')]['includeAll']){_0x42ac41['include']=[{'all':!![]}];}return db[_0x776f('0x3c')][_0x776f('0x3d')](_0x42ac41);})['then'](function(_0x4f9e65){_0x21ed2f[_0x776f('0x3e')]=_0x4f9e65;return _0x21ed2f;})[_0x776f('0x23')](respondWithFilteredResult(_0xe2d603,_0x42ac41))[_0x776f('0x3f')](handleError(_0xe2d603,null));};exports[_0x776f('0x40')]=function(_0x361444,_0x2afcee){var _0x1a8197={'raw':!![],'where':{'id':_0x361444[_0x776f('0x41')]['id']}},_0x10d444={};_0x10d444['model']=_['keys'](db[_0x776f('0x3c')][_0x776f('0x2a')]);_0x10d444['query']=_[_0x776f('0x2f')](_0x361444['query']);_0x10d444[_0x776f('0x30')]=_[_0x776f('0x31')](_0x10d444[_0x776f('0x32')],_0x10d444['query']);_0x1a8197[_0x776f('0x33')]=_[_0x776f('0x31')](_0x10d444[_0x776f('0x32')],qs[_0x776f('0x34')](_0x361444[_0x776f('0x2e')][_0x776f('0x34')]));_0x1a8197[_0x776f('0x33')]=_0x1a8197[_0x776f('0x33')][_0x776f('0x42')]?_0x1a8197['attributes']:_0x10d444[_0x776f('0x32')];if(_0x361444[_0x776f('0x2e')]['includeAll']){_0x1a8197[_0x776f('0x43')]=[{'all':!![]}];}_0x1a8197=_[_0x776f('0x3a')]({},_0x1a8197,_0x361444[_0x776f('0x44')]);return db['VtigerField'][_0x776f('0x45')](_0x1a8197)[_0x776f('0x23')](handleEntityNotFound(_0x2afcee,null))[_0x776f('0x23')](respondWithResult(_0x2afcee,null))['catch'](handleError(_0x2afcee,null));};exports[_0x776f('0x46')]=function(_0x132687,_0x51f87c){return db['VtigerField'][_0x776f('0x46')](_0x132687[_0x776f('0x47')],{})[_0x776f('0x23')](respondWithResult(_0x51f87c,0xc9))[_0x776f('0x3f')](handleError(_0x51f87c,null));};exports[_0x776f('0x22')]=function(_0x580b66,_0x3e14a5){if(_0x580b66['body']['id']){delete _0x580b66[_0x776f('0x47')]['id'];}return db['VtigerField'][_0x776f('0x45')]({'where':{'id':_0x580b66['params']['id']}})['then'](handleEntityNotFound(_0x3e14a5,null))[_0x776f('0x23')](saveUpdates(_0x580b66[_0x776f('0x47')],null))[_0x776f('0x23')](respondWithResult(_0x3e14a5,null))[_0x776f('0x3f')](handleError(_0x3e14a5,null));};exports['destroy']=function(_0x2cf8c3,_0x5df5f9){return db[_0x776f('0x3c')][_0x776f('0x45')]({'where':{'id':_0x2cf8c3[_0x776f('0x41')]['id']}})[_0x776f('0x23')](handleEntityNotFound(_0x5df5f9,null))[_0x776f('0x23')](removeEntity(_0x5df5f9,null))[_0x776f('0x3f')](handleError(_0x5df5f9,null));}; \ No newline at end of file +var _0x02dd=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x45c129,_0x7c3cfc){var _0x2d7623=function(_0x1a711d){while(--_0x1a711d){_0x45c129['push'](_0x45c129['shift']());}};_0x2d7623(++_0x7c3cfc);}(_0x02dd,0xc4));var _0xd02d=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x02dd[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xd02d('0x0'));var rimraf=require(_0xd02d('0x1'));var zipdir=require(_0xd02d('0x2'));var jsonpatch=require(_0xd02d('0x3'));var rp=require('request-promise');var moment=require(_0xd02d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd02d('0x5'));var util=require(_0xd02d('0x6'));var path=require(_0xd02d('0x7'));var sox=require(_0xd02d('0x8'));var csv=require(_0xd02d('0x9'));var ejs=require(_0xd02d('0xa'));var fs=require('fs');var fs_extra=require(_0xd02d('0xb'));var _=require('lodash');var squel=require(_0xd02d('0xc'));var crypto=require(_0xd02d('0xd'));var jsforce=require(_0xd02d('0xe'));var deskjs=require(_0xd02d('0xf'));var toCsv=require(_0xd02d('0x9'));var querystring=require(_0xd02d('0x10'));var Papa=require(_0xd02d('0x11'));var Redis=require(_0xd02d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd02d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd02d('0x14'));var config=require(_0xd02d('0x15'));var licenseUtil=require(_0xd02d('0x16'));var db=require(_0xd02d('0x17'))['db'];function respondWithStatusCode(_0xb93773,_0x187070){_0x187070=_0x187070||0xcc;return function(_0x2789dc){if(_0x2789dc){return _0xb93773[_0xd02d('0x18')](_0x187070);}return _0xb93773['status'](_0x187070)[_0xd02d('0x19')]();};}function respondWithResult(_0x1ff8ab,_0x4a4ff5){_0x4a4ff5=_0x4a4ff5||0xc8;return function(_0x568f2a){if(_0x568f2a){return _0x1ff8ab[_0xd02d('0x1a')](_0x4a4ff5)['json'](_0x568f2a);}};}function respondWithFilteredResult(_0x29a6a1,_0x22c659){return function(_0x514a4d){if(_0x514a4d){var _0x4b6cbc=typeof _0x22c659['offset']===_0xd02d('0x1b')&&typeof _0x22c659[_0xd02d('0x1c')]==='undefined';var _0x5e891c=_0x514a4d[_0xd02d('0x1d')];var _0x1df3e7=_0x4b6cbc?0x0:_0x22c659[_0xd02d('0x1e')];var _0x5ac0a1=_0x4b6cbc?_0x514a4d[_0xd02d('0x1d')]:_0x22c659[_0xd02d('0x1e')]+_0x22c659[_0xd02d('0x1c')];var _0x2d413c;if(_0x5ac0a1>=_0x5e891c){_0x5ac0a1=_0x5e891c;_0x2d413c=0xc8;}else{_0x2d413c=0xce;}_0x29a6a1[_0xd02d('0x1a')](_0x2d413c);return _0x29a6a1[_0xd02d('0x1f')](_0xd02d('0x20'),_0x1df3e7+'-'+_0x5ac0a1+'/'+_0x5e891c)['json'](_0x514a4d);}return null;};}function patchUpdates(_0x418bc8){return function(_0x372b12){try{jsonpatch[_0xd02d('0x21')](_0x372b12,_0x418bc8,!![]);}catch(_0x28b2d9){return BPromise[_0xd02d('0x22')](_0x28b2d9);}return _0x372b12[_0xd02d('0x23')]();};}function saveUpdates(_0x4ea92e,_0x13ae94){return function(_0x50344a){if(_0x50344a){return _0x50344a[_0xd02d('0x24')](_0x4ea92e)[_0xd02d('0x25')](function(_0x25afbd){return _0x25afbd;});}return null;};}function removeEntity(_0x4f8440,_0x567d81){return function(_0x210949){if(_0x210949){return _0x210949[_0xd02d('0x26')]()[_0xd02d('0x25')](function(){_0x4f8440[_0xd02d('0x1a')](0xcc)[_0xd02d('0x19')]();});}};}function handleEntityNotFound(_0x47bbcd,_0x584702){return function(_0x7f50bd){if(!_0x7f50bd){_0x47bbcd[_0xd02d('0x18')](0x194);}return _0x7f50bd;};}function handleError(_0x47c594,_0x469181){_0x469181=_0x469181||0x1f4;return function(_0x1a31bf){logger['error'](_0x1a31bf[_0xd02d('0x27')]);if(_0x1a31bf[_0xd02d('0x28')]){delete _0x1a31bf['name'];}_0x47c594[_0xd02d('0x1a')](_0x469181)[_0xd02d('0x29')](_0x1a31bf);};}exports[_0xd02d('0x2a')]=function(_0x292fe5,_0x52846b){var _0x51d4fb={},_0xfdd16b={},_0x30612e={'count':0x0,'rows':[]};var _0x4bff12=_['map'](db[_0xd02d('0x2b')][_0xd02d('0x2c')],function(_0x2dbd7c){return{'name':_0x2dbd7c[_0xd02d('0x2d')],'type':_0x2dbd7c[_0xd02d('0x2e')]['key']};});_0xfdd16b[_0xd02d('0x2f')]=_[_0xd02d('0x30')](_0x4bff12,_0xd02d('0x28'));_0xfdd16b[_0xd02d('0x31')]=_[_0xd02d('0x32')](_0x292fe5[_0xd02d('0x31')]);_0xfdd16b[_0xd02d('0x33')]=_[_0xd02d('0x34')](_0xfdd16b['model'],_0xfdd16b[_0xd02d('0x31')]);_0x51d4fb[_0xd02d('0x35')]=_[_0xd02d('0x34')](_0xfdd16b['model'],qs[_0xd02d('0x36')](_0x292fe5[_0xd02d('0x31')][_0xd02d('0x36')]));_0x51d4fb[_0xd02d('0x35')]=_0x51d4fb[_0xd02d('0x35')][_0xd02d('0x37')]?_0x51d4fb[_0xd02d('0x35')]:_0xfdd16b['model'];if(!_0x292fe5[_0xd02d('0x31')][_0xd02d('0x38')]('nolimit')){_0x51d4fb[_0xd02d('0x1c')]=qs[_0xd02d('0x1c')](_0x292fe5[_0xd02d('0x31')]['limit']);_0x51d4fb[_0xd02d('0x1e')]=qs[_0xd02d('0x1e')](_0x292fe5[_0xd02d('0x31')]['offset']);}_0x51d4fb['order']=qs['sort'](_0x292fe5['query']['sort']);_0x51d4fb[_0xd02d('0x39')]=qs['filters'](_[_0xd02d('0x3a')](_0x292fe5['query'],_0xfdd16b[_0xd02d('0x33')]),_0x4bff12);if(_0x292fe5[_0xd02d('0x31')]['filter']){_0x51d4fb[_0xd02d('0x39')]=_[_0xd02d('0x3b')](_0x51d4fb[_0xd02d('0x39')],{'$or':_[_0xd02d('0x30')](_0x4bff12,function(_0x2306c4){if(_0x2306c4[_0xd02d('0x2e')]!==_0xd02d('0x3c')){var _0x5c3b75={};_0x5c3b75[_0x2306c4[_0xd02d('0x28')]]={'$like':'%'+_0x292fe5[_0xd02d('0x31')][_0xd02d('0x3d')]+'%'};return _0x5c3b75;}})});}_0x51d4fb=_[_0xd02d('0x3b')]({},_0x51d4fb,_0x292fe5['options']);var _0x50cf02={'where':_0x51d4fb[_0xd02d('0x39')]};return db[_0xd02d('0x2b')][_0xd02d('0x1d')](_0x50cf02)['then'](function(_0x569e78){_0x30612e['count']=_0x569e78;if(_0x292fe5[_0xd02d('0x31')]['includeAll']){_0x51d4fb[_0xd02d('0x3e')]=[{'all':!![]}];}return db[_0xd02d('0x2b')][_0xd02d('0x3f')](_0x51d4fb);})[_0xd02d('0x25')](function(_0x190223){_0x30612e[_0xd02d('0x40')]=_0x190223;return _0x30612e;})[_0xd02d('0x25')](respondWithFilteredResult(_0x52846b,_0x51d4fb))[_0xd02d('0x41')](handleError(_0x52846b,null));};exports[_0xd02d('0x42')]=function(_0x3f9a28,_0x125b5a){var _0x51e94b={'raw':!![],'where':{'id':_0x3f9a28[_0xd02d('0x43')]['id']}},_0x162036={};_0x162036[_0xd02d('0x2f')]=_[_0xd02d('0x32')](db[_0xd02d('0x2b')][_0xd02d('0x2c')]);_0x162036[_0xd02d('0x31')]=_['keys'](_0x3f9a28[_0xd02d('0x31')]);_0x162036['filters']=_[_0xd02d('0x34')](_0x162036[_0xd02d('0x2f')],_0x162036[_0xd02d('0x31')]);_0x51e94b[_0xd02d('0x35')]=_[_0xd02d('0x34')](_0x162036[_0xd02d('0x2f')],qs['fields'](_0x3f9a28[_0xd02d('0x31')][_0xd02d('0x36')]));_0x51e94b[_0xd02d('0x35')]=_0x51e94b[_0xd02d('0x35')][_0xd02d('0x37')]?_0x51e94b[_0xd02d('0x35')]:_0x162036[_0xd02d('0x2f')];if(_0x3f9a28['query']['includeAll']){_0x51e94b['include']=[{'all':!![]}];}_0x51e94b=_[_0xd02d('0x3b')]({},_0x51e94b,_0x3f9a28[_0xd02d('0x44')]);return db[_0xd02d('0x2b')]['find'](_0x51e94b)[_0xd02d('0x25')](handleEntityNotFound(_0x125b5a,null))[_0xd02d('0x25')](respondWithResult(_0x125b5a,null))['catch'](handleError(_0x125b5a,null));};exports[_0xd02d('0x45')]=function(_0x1bf8a8,_0x1fb813){return db[_0xd02d('0x2b')][_0xd02d('0x45')](_0x1bf8a8[_0xd02d('0x46')],{})[_0xd02d('0x25')](respondWithResult(_0x1fb813,0xc9))[_0xd02d('0x41')](handleError(_0x1fb813,null));};exports['update']=function(_0x1582e5,_0x250bde){if(_0x1582e5['body']['id']){delete _0x1582e5[_0xd02d('0x46')]['id'];}return db[_0xd02d('0x2b')][_0xd02d('0x47')]({'where':{'id':_0x1582e5[_0xd02d('0x43')]['id']}})[_0xd02d('0x25')](handleEntityNotFound(_0x250bde,null))[_0xd02d('0x25')](saveUpdates(_0x1582e5['body'],null))['then'](respondWithResult(_0x250bde,null))[_0xd02d('0x41')](handleError(_0x250bde,null));};exports[_0xd02d('0x26')]=function(_0x162d83,_0x341764){return db[_0xd02d('0x2b')][_0xd02d('0x47')]({'where':{'id':_0x162d83['params']['id']}})[_0xd02d('0x25')](handleEntityNotFound(_0x341764,null))[_0xd02d('0x25')](removeEntity(_0x341764,null))['catch'](handleError(_0x341764,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 90727ed..d1a43d9 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 _0xaacb=['../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','int_vtiger_fields','FieldId','lodash','util'];(function(_0x5487de,_0x16be9f){var _0x36871a=function(_0xaa4900){while(--_0xaa4900){_0x5487de['push'](_0x5487de['shift']());}};_0x36871a(++_0x16be9f);}(_0xaacb,0x174));var _0xbaac=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0xaacb[_0x4dcb47];return _0x352b40;};'use strict';var _=require(_0xbaac('0x0'));var util=require(_0xbaac('0x1'));var logger=require(_0xbaac('0x2'))(_0xbaac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbaac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbaac('0x5'));var config=require(_0xbaac('0x6'));var attributes=require('./intVtigerField.attributes');module[_0xbaac('0x7')]=function(_0x1bac5b,_0x4f4ad5){return _0x1bac5b[_0xbaac('0x8')]('VtigerField',attributes,{'tableName':_0xbaac('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xbaac('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x84a8=['./intVtigerField.attributes','exports','int_vtiger_fields','vtiger_unique_index','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x36a4ff,_0x1a69f8){var _0x45643b=function(_0x4aa4a1){while(--_0x4aa4a1){_0x36a4ff['push'](_0x36a4ff['shift']());}};_0x45643b(++_0x1a69f8);}(_0x84a8,0x16f));var _0x884a=function(_0x276c4f,_0x1a044a){_0x276c4f=_0x276c4f-0x0;var _0x5bba7f=_0x84a8[_0x276c4f];return _0x5bba7f;};'use strict';var _=require(_0x884a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x884a('0x1'));var moment=require(_0x884a('0x2'));var BPromise=require('bluebird');var rp=require(_0x884a('0x3'));var fs=require('fs');var path=require(_0x884a('0x4'));var rimraf=require(_0x884a('0x5'));var config=require(_0x884a('0x6'));var attributes=require(_0x884a('0x7'));module[_0x884a('0x8')]=function(_0x53cd07,_0x1e5cdb){return _0x53cd07['define']('VtigerField',attributes,{'tableName':_0x884a('0x9'),'paranoid':![],'indexes':[{'name':_0x884a('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 3ae5b4f..dfd40c3 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 _0x8320=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x230513,_0x3c7ea1){var _0x316f48=function(_0x5e8dcc){while(--_0x5e8dcc){_0x230513['push'](_0x230513['shift']());}};_0x316f48(++_0x3c7ea1);}(_0x8320,0x87));var _0x0832=function(_0x1300ec,_0x3ff267){_0x1300ec=_0x1300ec-0x0;var _0x2c13c9=_0x8320[_0x1300ec];return _0x2c13c9;};'use strict';var _=require(_0x0832('0x0'));var util=require(_0x0832('0x1'));var moment=require(_0x0832('0x2'));var BPromise=require(_0x0832('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0832('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0832('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0832('0x6'));var jayson=require(_0x0832('0x7'));var client=jayson['client'][_0x0832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x240a89,_0x3cceb3,_0x2eaa43){return new BPromise(function(_0x387075,_0x4d5754){return client[_0x0832('0x9')](_0x240a89,_0x2eaa43)[_0x0832('0xa')](function(_0xf28f1d){logger[_0x0832('0xb')](_0x0832('0xc'),_0x3cceb3,_0x0832('0xd'));logger[_0x0832('0xe')](_0x0832('0xf'),_0x3cceb3,_0x0832('0xd'),JSON[_0x0832('0x10')](_0xf28f1d));if(_0xf28f1d['error']){if(_0xf28f1d[_0x0832('0x11')][_0x0832('0x12')]===0x1f4){logger[_0x0832('0x11')]('VtigerField,\x20%s,\x20%s',_0x3cceb3,_0xf28f1d[_0x0832('0x11')]['message']);return _0x4d5754(_0xf28f1d[_0x0832('0x11')][_0x0832('0x13')]);}logger[_0x0832('0x11')](_0x0832('0xc'),_0x3cceb3,_0xf28f1d[_0x0832('0x11')][_0x0832('0x13')]);return _0x387075(_0xf28f1d['error']['message']);}else{logger[_0x0832('0xb')](_0x0832('0xc'),_0x3cceb3,'request\x20sent');_0x387075(_0xf28f1d[_0x0832('0x14')]['message']);}})[_0x0832('0x15')](function(_0x2d9485){logger[_0x0832('0x11')](_0x0832('0xc'),_0x3cceb3,_0x2d9485);_0x4d5754(_0x2d9485);});});} \ No newline at end of file +var _0xd14e=['../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2eb52f,_0x167d29){var _0x1f3cf7=function(_0x446d4a){while(--_0x446d4a){_0x2eb52f['push'](_0x2eb52f['shift']());}};_0x1f3cf7(++_0x167d29);}(_0xd14e,0x17e));var _0xed14=function(_0x3cb5a7,_0x5c5fbc){_0x3cb5a7=_0x3cb5a7-0x0;var _0x4d50c1=_0xd14e[_0x3cb5a7];return _0x4d50c1;};'use strict';var _=require(_0xed14('0x0'));var util=require(_0xed14('0x1'));var moment=require('moment');var BPromise=require(_0xed14('0x2'));var rs=require(_0xed14('0x3'));var fs=require('fs');var Redis=require(_0xed14('0x4'));var db=require(_0xed14('0x5'))['db'];var utils=require(_0xed14('0x6'));var logger=require(_0xed14('0x7'))(_0xed14('0x8'));var config=require(_0xed14('0x9'));var jayson=require(_0xed14('0xa'));var client=jayson[_0xed14('0xb')][_0xed14('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x325d64,_0x3d5a80,_0x313c99){return new BPromise(function(_0x179476,_0x2df1d2){return client[_0xed14('0xd')](_0x325d64,_0x313c99)[_0xed14('0xe')](function(_0x5a4e1e){logger[_0xed14('0xf')](_0xed14('0x10'),_0x3d5a80,_0xed14('0x11'));logger[_0xed14('0x12')](_0xed14('0x13'),_0x3d5a80,_0xed14('0x11'),JSON[_0xed14('0x14')](_0x5a4e1e));if(_0x5a4e1e['error']){if(_0x5a4e1e[_0xed14('0x15')]['code']===0x1f4){logger['error'](_0xed14('0x10'),_0x3d5a80,_0x5a4e1e[_0xed14('0x15')][_0xed14('0x16')]);return _0x2df1d2(_0x5a4e1e['error']['message']);}logger[_0xed14('0x15')]('VtigerField,\x20%s,\x20%s',_0x3d5a80,_0x5a4e1e['error']['message']);return _0x179476(_0x5a4e1e[_0xed14('0x15')]['message']);}else{logger[_0xed14('0xf')]('VtigerField,\x20%s,\x20%s',_0x3d5a80,'request\x20sent');_0x179476(_0x5a4e1e['result'][_0xed14('0x16')]);}})['catch'](function(_0x27035e){logger[_0xed14('0x15')](_0xed14('0x10'),_0x3d5a80,_0x27035e);_0x2df1d2(_0x27035e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 31b1ada..5a92f50 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 _0x5bf5=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x5af11e,_0x5eb1ec){var _0x1d6b90=function(_0x5e937d){while(--_0x5e937d){_0x5af11e['push'](_0x5af11e['shift']());}};_0x1d6b90(++_0x5eb1ec);}(_0x5bf5,0xf1));var _0x55bf=function(_0x221d98,_0x109719){_0x221d98=_0x221d98-0x0;var _0x540a98=_0x5bf5[_0x221d98];return _0x540a98;};'use strict';var multer=require(_0x55bf('0x0'));var util=require(_0x55bf('0x1'));var path=require(_0x55bf('0x2'));var timeout=require(_0x55bf('0x3'));var express=require(_0x55bf('0x4'));var router=express['Router']();var fs_extra=require(_0x55bf('0x5'));var auth=require(_0x55bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x55bf('0x7'));var controller=require(_0x55bf('0x8'));router[_0x55bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x55bf('0xa')]);router[_0x55bf('0x9')]('/:id',auth[_0x55bf('0xb')](),controller['show']);router[_0x55bf('0x9')](_0x55bf('0xc'),auth[_0x55bf('0xb')](),controller['getConfigurations']);router[_0x55bf('0x9')]('/:id/fields',auth[_0x55bf('0xb')](),controller[_0x55bf('0xd')]);router[_0x55bf('0xe')]('/',auth[_0x55bf('0xb')](),controller[_0x55bf('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x55bf('0x10')]);router[_0x55bf('0x11')]('/:id',auth[_0x55bf('0xb')](),controller[_0x55bf('0x12')]);router[_0x55bf('0x13')]('/:id',auth[_0x55bf('0xb')](),controller[_0x55bf('0x14')]);module[_0x55bf('0x15')]=router; \ No newline at end of file +var _0x54a2=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','post','put','/:id'];(function(_0x10d924,_0x2c7dc1){var _0x49d9e7=function(_0x3ff82d){while(--_0x3ff82d){_0x10d924['push'](_0x10d924['shift']());}};_0x49d9e7(++_0x2c7dc1);}(_0x54a2,0x9d));var _0x254a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x54a2[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x254a('0x0'));var util=require(_0x254a('0x1'));var path=require(_0x254a('0x2'));var timeout=require(_0x254a('0x3'));var express=require('express');var router=express[_0x254a('0x4')]();var fs_extra=require(_0x254a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x254a('0x6'));var config=require(_0x254a('0x7'));var controller=require(_0x254a('0x8'));router[_0x254a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x254a('0xa')](),controller[_0x254a('0xb')]);router[_0x254a('0x9')](_0x254a('0xc'),auth[_0x254a('0xa')](),controller['getConfigurations']);router[_0x254a('0x9')](_0x254a('0xd'),auth[_0x254a('0xa')](),controller[_0x254a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x254a('0xf')]);router[_0x254a('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x254a('0x11')](_0x254a('0x12'),auth[_0x254a('0xa')](),controller[_0x254a('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x254a('0x14')]);module[_0x254a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index feb85a6..a088dd0 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 _0x81d4=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','exports'];(function(_0x321cb9,_0x1c3579){var _0x59c6bf=function(_0xfcaaf8){while(--_0xfcaaf8){_0x321cb9['push'](_0x321cb9['shift']());}};_0x59c6bf(++_0x1c3579);}(_0x81d4,0x197));var _0x481d=function(_0x2c7957,_0x5b5529){_0x2c7957=_0x2c7957-0x0;var _0x28717e=_0x81d4[_0x2c7957];return _0x28717e;};'use strict';var Sequelize=require('sequelize');module[_0x481d('0x0')]={'name':{'type':Sequelize[_0x481d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x481d('0x1')],'unique':_0x481d('0x2')},'password':{'type':Sequelize[_0x481d('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x481d('0x3')},'authType':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x5'),'token'),'defaultValue':_0x481d('0x5')},'serverUrl':{'type':Sequelize[_0x481d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x6'),_0x481d('0x7')),'defaultValue':_0x481d('0x6')}}; \ No newline at end of file +var _0x8cad=['password','token','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x8cad,0xfe));var _0xd8ca=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x8cad[_0x2080a3];return _0x8d7d17;};'use strict';var Sequelize=require(_0xd8ca('0x0'));module[_0xd8ca('0x1')]={'name':{'type':Sequelize[_0xd8ca('0x2')]},'description':{'type':Sequelize[_0xd8ca('0x2')]},'username':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x3')},'password':{'type':Sequelize[_0xd8ca('0x2')]},'token':{'type':Sequelize[_0xd8ca('0x2')]},'remoteUri':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x4')},'authType':{'type':Sequelize[_0xd8ca('0x5')](_0xd8ca('0x6'),_0xd8ca('0x7')),'defaultValue':_0xd8ca('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd8ca('0x5')](_0xd8ca('0x8'),_0xd8ca('0x9')),'defaultValue':_0xd8ca('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b6839ad..a729ccc 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 _0xb9be=['count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xb9be,0xc5));var _0xeb9b=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xb9be[_0xc8db6b];return _0x12cb81;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['ZendeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['ZendeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['ZendeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['ZendeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['ZendeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56'),_0xeb9b('0x57'),_0xeb9b('0x58'),_0xeb9b('0x59')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x128d43){if(_0x128d43){_0x25398e=_0x128d43[_0xeb9b('0x59')];var _0xbbde9c=_0x25398e[_0xeb9b('0x5a')](-0x1);if(_0xbbde9c==='/'){_0x25398e=_0x25398e[_0xeb9b('0x5b')](0x0,_0x25398e[_0xeb9b('0x5c')](_0xbbde9c));}var _0xd619ca={'method':'GET','uri':util[_0xeb9b('0x5d')](_0xeb9b('0x5e'),_0x25398e,_0xeb9b('0x5f')),'json':!![]};switch(_0x128d43['authType']){case'password':_0xd619ca[_0xeb9b('0x60')]={'Authorization':util['format'](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')](_0xeb9b('0x62'),_0x128d43[_0xeb9b('0x55')],_0x128d43[_0xeb9b('0x56')]))[_0xeb9b('0x63')](_0xeb9b('0x64')))};break;case _0xeb9b('0x57'):_0xd619ca[_0xeb9b('0x60')]={'Authorization':util[_0xeb9b('0x5d')](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')]('%s/token:%s',_0x128d43['username'],_0x128d43[_0xeb9b('0x57')]))['toString']('base64'))};break;default:throw new db[(_0xeb9b('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd619ca);}})['then'](function(_0x346ba9){if(_0x346ba9){var _0x3147bc=[_0xeb9b('0x66'),_0xeb9b('0x67'),'group',_0xeb9b('0x68')];_[_0xeb9b('0x69')](_0x346ba9[_0xeb9b('0x5f')],function(_0x4e5cfb){return _0x3147bc['includes'](_0x4e5cfb[_0xeb9b('0x4f')]);});return{'count':_0x346ba9['ticket_fields'][_0xeb9b('0x37')],'rows':_['map'](_0x346ba9['ticket_fields'],function(_0xa7e9c3){return{'id':_0xa7e9c3['id'],'name':_0xa7e9c3['position']>0x7?_0xa7e9c3[_0xeb9b('0x6a')]:_0xa7e9c3['type'],'custom':_0xa7e9c3['position']>0x7?!![]:![],'options':_0xa7e9c3[_0xeb9b('0x6b')]?_0xa7e9c3[_0xeb9b('0x6b')]:_0xa7e9c3[_0xeb9b('0x6c')]?_0xa7e9c3[_0xeb9b('0x6c')]:[]};})};}})['then'](respondWithResult(_0x6a85fd,null))[_0xeb9b('0x44')](function(_0x31de58){var _0x3f395a=_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?0x1f4:_0x31de58[_0xeb9b('0x6e')]||0x1f4;logger['error'](_0xeb9b('0x6f'),'getFields',_0x3f395a,JSON[_0xeb9b('0x70')](_0x31de58));delete _0x31de58[_0xeb9b('0x2a')];if(_0x3f395a===0x191){_0x3f395a=0x190;}_0x6a85fd['status'](_0x3f395a)[_0xeb9b('0x71')](_0x289654['query'][_0xeb9b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x31de58[_0xeb9b('0x6e')]}:_0x31de58);});}; \ No newline at end of file +var _0xa74f=['Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','catch','create','body','findOne','getConfigurations','addConfiguration'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0xa74f,0x9a));var _0xfa74=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xa74f[_0x44fef1];return _0x3c3a04;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa74('0x16'));function respondWithStatusCode(_0x998585,_0x78173f){_0x78173f=_0x78173f||0xcc;return function(_0x278e8b){if(_0x278e8b){return _0x998585['sendStatus'](_0x78173f);}return _0x998585[_0xfa74('0x17')](_0x78173f)[_0xfa74('0x18')]();};}function respondWithResult(_0x3eb49b,_0x3947ca){_0x3947ca=_0x3947ca||0xc8;return function(_0xe3c97e){if(_0xe3c97e){return _0x3eb49b['status'](_0x3947ca)[_0xfa74('0x19')](_0xe3c97e);}};}function respondWithFilteredResult(_0x13d911,_0x947da6){return function(_0x1f1de0){if(_0x1f1de0){var _0x3867f8=typeof _0x947da6[_0xfa74('0x1a')]===_0xfa74('0x1b')&&typeof _0x947da6['limit']===_0xfa74('0x1b');var _0xe0e33d=_0x1f1de0['count'];var _0x4928b6=_0x3867f8?0x0:_0x947da6[_0xfa74('0x1a')];var _0x25a36b=_0x3867f8?_0x1f1de0[_0xfa74('0x1c')]:_0x947da6['offset']+_0x947da6[_0xfa74('0x1d')];var _0x2edebb;if(_0x25a36b>=_0xe0e33d){_0x25a36b=_0xe0e33d;_0x2edebb=0xc8;}else{_0x2edebb=0xce;}_0x13d911[_0xfa74('0x17')](_0x2edebb);return _0x13d911['set'](_0xfa74('0x1e'),_0x4928b6+'-'+_0x25a36b+'/'+_0xe0e33d)[_0xfa74('0x19')](_0x1f1de0);}return null;};}function patchUpdates(_0x2e6c33){return function(_0x4a5ee4){try{jsonpatch['apply'](_0x4a5ee4,_0x2e6c33,!![]);}catch(_0x100851){return BPromise[_0xfa74('0x1f')](_0x100851);}return _0x4a5ee4[_0xfa74('0x20')]();};}function saveUpdates(_0xeaaa19,_0x1a453d){return function(_0x554e0e){if(_0x554e0e){return _0x554e0e['update'](_0xeaaa19)[_0xfa74('0x21')](function(_0x5aa8a7){return _0x5aa8a7;});}return null;};}function removeEntity(_0x48cbd3,_0x529810){return function(_0x42c439){if(_0x42c439){return _0x42c439[_0xfa74('0x22')]()[_0xfa74('0x21')](function(){_0x48cbd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eb68c,_0xeb6c11){return function(_0x5ed1c8){if(!_0x5ed1c8){_0x9eb68c[_0xfa74('0x23')](0x194);}return _0x5ed1c8;};}function handleError(_0x5d3b26,_0x1a8cf7){_0x1a8cf7=_0x1a8cf7||0x1f4;return function(_0x153b2a){logger['error'](_0x153b2a[_0xfa74('0x24')]);if(_0x153b2a[_0xfa74('0x25')]){delete _0x153b2a[_0xfa74('0x25')];}_0x5d3b26[_0xfa74('0x17')](_0x1a8cf7)['send'](_0x153b2a);};}exports[_0xfa74('0x26')]=function(_0x2f7cd7,_0x204e01){var _0x57d90e={},_0x4d4bed={},_0x1322a4={'count':0x0,'rows':[]};var _0x8b706e=_['map'](db['ZendeskAccount'][_0xfa74('0x27')],function(_0x564060){return{'name':_0x564060[_0xfa74('0x28')],'type':_0x564060['type'][_0xfa74('0x29')]};});_0x4d4bed[_0xfa74('0x2a')]=_[_0xfa74('0x2b')](_0x8b706e,_0xfa74('0x25'));_0x4d4bed['query']=_[_0xfa74('0x2c')](_0x2f7cd7[_0xfa74('0x2d')]);_0x4d4bed[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x4d4bed[_0xfa74('0x2a')],_0x4d4bed[_0xfa74('0x2d')]);_0x57d90e[_0xfa74('0x30')]=_['intersection'](_0x4d4bed[_0xfa74('0x2a')],qs['fields'](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x57d90e[_0xfa74('0x30')]=_0x57d90e[_0xfa74('0x30')]['length']?_0x57d90e['attributes']:_0x4d4bed[_0xfa74('0x2a')];if(!_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x32')](_0xfa74('0x33'))){_0x57d90e['limit']=qs[_0xfa74('0x1d')](_0x2f7cd7[_0xfa74('0x2d')]['limit']);_0x57d90e['offset']=qs['offset'](_0x2f7cd7['query']['offset']);}_0x57d90e[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x57d90e[_0xfa74('0x36')]=qs[_0xfa74('0x2e')](_[_0xfa74('0x37')](_0x2f7cd7[_0xfa74('0x2d')],_0x4d4bed[_0xfa74('0x2e')]),_0x8b706e);if(_0x2f7cd7['query'][_0xfa74('0x38')]){_0x57d90e[_0xfa74('0x36')]=_[_0xfa74('0x39')](_0x57d90e[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x8b706e,function(_0x186126){if(_0x186126['type']!==_0xfa74('0x3a')){var _0x1f0806={};_0x1f0806[_0x186126[_0xfa74('0x25')]]={'$like':'%'+_0x2f7cd7[_0xfa74('0x2d')]['filter']+'%'};return _0x1f0806;}})});}_0x57d90e=_[_0xfa74('0x39')]({},_0x57d90e,_0x2f7cd7[_0xfa74('0x3b')]);var _0xe8491b={'where':_0x57d90e[_0xfa74('0x36')]};return db['ZendeskAccount'][_0xfa74('0x1c')](_0xe8491b)[_0xfa74('0x21')](function(_0x3dacc2){_0x1322a4['count']=_0x3dacc2;if(_0x2f7cd7['query'][_0xfa74('0x3c')]){_0x57d90e[_0xfa74('0x3d')]=[{'all':!![]}];}return db[_0xfa74('0x3e')][_0xfa74('0x3f')](_0x57d90e);})['then'](function(_0x1ab026){_0x1322a4[_0xfa74('0x40')]=_0x1ab026;return _0x1322a4;})['then'](respondWithFilteredResult(_0x204e01,_0x57d90e))['catch'](handleError(_0x204e01,null));};exports['show']=function(_0x492c7d,_0x95c891){var _0x3098ca={'raw':![],'where':{'id':_0x492c7d[_0xfa74('0x41')]['id']}},_0x3f92b2={};_0x3f92b2[_0xfa74('0x2a')]=_[_0xfa74('0x2c')](db[_0xfa74('0x3e')]['rawAttributes']);_0x3f92b2[_0xfa74('0x2d')]=_[_0xfa74('0x2c')](_0x492c7d[_0xfa74('0x2d')]);_0x3f92b2[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x3f92b2['model'],_0x3f92b2[_0xfa74('0x2d')]);_0x3098ca[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x3f92b2[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x492c7d[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x3098ca[_0xfa74('0x30')]=_0x3098ca[_0xfa74('0x30')][_0xfa74('0x42')]?_0x3098ca['attributes']:_0x3f92b2[_0xfa74('0x2a')];if(_0x492c7d['query'][_0xfa74('0x3c')]){_0x3098ca[_0xfa74('0x3d')]=[{'all':!![]}];}_0x3098ca=_[_0xfa74('0x39')]({},_0x3098ca,_0x492c7d[_0xfa74('0x3b')]);return db['ZendeskAccount'][_0xfa74('0x43')](_0x3098ca)[_0xfa74('0x21')](handleEntityNotFound(_0x95c891,null))['then'](respondWithResult(_0x95c891,null))[_0xfa74('0x44')](handleError(_0x95c891,null));};exports[_0xfa74('0x45')]=function(_0x5cbb70,_0x2be89f){return db[_0xfa74('0x3e')][_0xfa74('0x45')](_0x5cbb70[_0xfa74('0x46')],{})[_0xfa74('0x21')](respondWithResult(_0x2be89f,0xc9))['catch'](handleError(_0x2be89f,null));};exports['update']=function(_0x36f6ca,_0x91df44){if(_0x36f6ca['body']['id']){delete _0x36f6ca[_0xfa74('0x46')]['id'];}return db[_0xfa74('0x3e')][_0xfa74('0x43')]({'where':{'id':_0x36f6ca['params']['id']}})['then'](handleEntityNotFound(_0x91df44,null))[_0xfa74('0x21')](saveUpdates(_0x36f6ca[_0xfa74('0x46')],null))[_0xfa74('0x21')](respondWithResult(_0x91df44,null))[_0xfa74('0x44')](handleError(_0x91df44,null));};exports[_0xfa74('0x22')]=function(_0x3cb23d,_0x2d217d){return db[_0xfa74('0x3e')]['find']({'where':{'id':_0x3cb23d[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2d217d,null))[_0xfa74('0x21')](removeEntity(_0x2d217d,null))[_0xfa74('0x44')](handleError(_0x2d217d,null));};exports['getConfigurations']=function(_0x4ec218,_0x3146de,_0x5b3404){var _0x152eaa={};var _0x221dc7={};var _0x427469;var _0x33e31e;return db[_0xfa74('0x3e')][_0xfa74('0x47')]({'where':{'id':_0x4ec218[_0xfa74('0x41')]['id']}})['then'](handleEntityNotFound(_0x3146de,null))[_0xfa74('0x21')](function(_0x4bcee3){if(_0x4bcee3){_0x427469=_0x4bcee3;_0x221dc7[_0xfa74('0x2a')]=_['keys'](db['ZendeskConfiguration'][_0xfa74('0x27')]);_0x221dc7[_0xfa74('0x2d')]=_['keys'](_0x4ec218['query']);_0x221dc7[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],_0x221dc7[_0xfa74('0x2d')]);_0x152eaa[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x152eaa['attributes']=_0x152eaa[_0xfa74('0x30')][_0xfa74('0x42')]?_0x152eaa['attributes']:_0x221dc7['model'];_0x152eaa[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x152eaa[_0xfa74('0x36')]=qs['filters'](_[_0xfa74('0x37')](_0x4ec218['query'],_0x221dc7[_0xfa74('0x2e')]));if(_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]){_0x152eaa['where']=_['merge'](_0x152eaa[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x152eaa[_0xfa74('0x30')],function(_0x1b3484){var _0x53eca4={};_0x53eca4[_0x1b3484]={'$like':'%'+_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]+'%'};return _0x53eca4;})});}_0x152eaa=_['merge']({},_0x152eaa,_0x4ec218[_0xfa74('0x3b')]);return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x1681e7){if(_0x1681e7){_0x33e31e=_0x1681e7['length'];if(!_0x4ec218[_0xfa74('0x2d')]['hasOwnProperty'](_0xfa74('0x33'))){_0x152eaa[_0xfa74('0x1d')]=qs[_0xfa74('0x1d')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1d')]);_0x152eaa[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1a')]);}return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x930728){if(_0x930728){return _0x930728?{'count':_0x33e31e,'rows':_0x930728}:null;}})[_0xfa74('0x21')](respondWithResult(_0x3146de,null))[_0xfa74('0x44')](handleError(_0x3146de,null));};exports[_0xfa74('0x49')]=function(_0x512b58,_0x2361d2,_0x3b0dd5){if(_0x512b58['body']['id']){delete _0x512b58['body']['id'];}return db[_0xfa74('0x3e')]['findOne']({'where':{'id':_0x512b58[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2361d2,null))[_0xfa74('0x21')](function(_0x529921){if(_0x529921){_0x512b58[_0xfa74('0x46')]['AccountId']=_0x529921['id'];_0x512b58['body'][_0xfa74('0x4a')]=integrations[_0xfa74('0x4b')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58[_0xfa74('0x46')][_0xfa74('0x4d')]);_0x512b58[_0xfa74('0x46')][_0xfa74('0x4e')]=integrations[_0xfa74('0x4f')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58['body'][_0xfa74('0x4d')]);return db['ZendeskConfiguration'][_0xfa74('0x45')](_0x512b58[_0xfa74('0x46')],{'include':[{'model':db[_0xfa74('0x50')],'as':'Subjects'},{'model':db[_0xfa74('0x50')],'as':_0xfa74('0x4e')}]});}return null;})[_0xfa74('0x21')](respondWithResult(_0x2361d2,null))['catch'](handleError(_0x2361d2,null));};exports[_0xfa74('0x51')]=function(_0x34e772,_0x474462,_0x1105e5){var _0x10e5f5='';return db['ZendeskAccount'][_0xfa74('0x47')]({'where':{'id':_0x34e772[_0xfa74('0x41')]['id']},'attributes':['id',_0xfa74('0x52'),_0xfa74('0x53'),_0xfa74('0x54'),_0xfa74('0x55'),_0xfa74('0x56')]})[_0xfa74('0x21')](handleEntityNotFound(_0x474462,null))[_0xfa74('0x21')](function(_0x3526d7){if(_0x3526d7){_0x10e5f5=_0x3526d7[_0xfa74('0x56')];var _0x30aec7=_0x10e5f5['slice'](-0x1);if(_0x30aec7==='/'){_0x10e5f5=_0x10e5f5[_0xfa74('0x57')](0x0,_0x10e5f5[_0xfa74('0x58')](_0x30aec7));}var _0xdffc88={'method':_0xfa74('0x59'),'uri':util[_0xfa74('0x5a')](_0xfa74('0x5b'),_0x10e5f5,_0xfa74('0x5c')),'json':!![]};switch(_0x3526d7[_0xfa74('0x55')]){case'password':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util[_0xfa74('0x5a')](_0xfa74('0x5e'),new Buffer(util[_0xfa74('0x5a')]('%s:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x53')]))[_0xfa74('0x5f')](_0xfa74('0x60')))};break;case'token':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfa74('0x5a')]('%s/token:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x54')]))['toString']('base64'))};break;default:throw new db[(_0xfa74('0x61'))][(_0xfa74('0x62'))](_0xfa74('0x63'));}return rp(_0xdffc88);}})[_0xfa74('0x21')](function(_0x4f1acc){if(_0x4f1acc){var _0x5acb9b=['subject',_0xfa74('0x64'),_0xfa74('0x65'),_0xfa74('0x66')];_[_0xfa74('0x67')](_0x4f1acc[_0xfa74('0x5c')],function(_0x52e8ac){return _0x5acb9b[_0xfa74('0x68')](_0x52e8ac[_0xfa74('0x4d')]);});return{'count':_0x4f1acc[_0xfa74('0x5c')][_0xfa74('0x42')],'rows':_[_0xfa74('0x2b')](_0x4f1acc[_0xfa74('0x5c')],function(_0x358db2){return{'id':_0x358db2['id'],'name':_0x358db2[_0xfa74('0x69')]>0x7?_0x358db2[_0xfa74('0x6a')]:_0x358db2['type'],'custom':_0x358db2['position']>0x7?!![]:![],'options':_0x358db2['system_field_options']?_0x358db2[_0xfa74('0x6b')]:_0x358db2[_0xfa74('0x6c')]?_0x358db2[_0xfa74('0x6c')]:[]};})};}})[_0xfa74('0x21')](respondWithResult(_0x474462,null))[_0xfa74('0x44')](function(_0x533649){var _0x3e4323=_0x34e772[_0xfa74('0x2d')]['test']?0x1f4:_0x533649[_0xfa74('0x6d')]||0x1f4;logger['error'](_0xfa74('0x6e'),_0xfa74('0x51'),_0x3e4323,JSON[_0xfa74('0x6f')](_0x533649));delete _0x533649[_0xfa74('0x25')];if(_0x3e4323===0x191){_0x3e4323=0x190;}_0x474462[_0xfa74('0x17')](_0x3e4323)[_0xfa74('0x70')](_0x34e772[_0xfa74('0x2d')][_0xfa74('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x533649['statusCode']}:_0x533649);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 9566d44..c9e6075 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 _0xbebb=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbebb,0x10d));var _0xbbeb=function(_0x5a38b9,_0x4ca412){_0x5a38b9=_0x5a38b9-0x0;var _0xf8dd88=_0xbebb[_0x5a38b9];return _0xf8dd88;};'use strict';var _=require(_0xbbeb('0x0'));var util=require(_0xbbeb('0x1'));var logger=require(_0xbbeb('0x2'))('api');var moment=require(_0xbbeb('0x3'));var BPromise=require(_0xbbeb('0x4'));var rp=require(_0xbbeb('0x5'));var fs=require('fs');var path=require(_0xbbeb('0x6'));var rimraf=require(_0xbbeb('0x7'));var config=require(_0xbbeb('0x8'));var attributes=require(_0xbbeb('0x9'));var integrations=require(_0xbbeb('0xa'));module[_0xbbeb('0xb')]=function(_0x4719d2,_0x5d8f50){return _0x4719d2[_0xbbeb('0xc')](_0xbbeb('0xd'),attributes,{'tableName':_0xbbeb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fa=['../../config/logger','api','bluebird','request-promise','./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','lodash','util'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x07fa,0x17a));var _0xa07f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x07fa[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xa07f('0x0'));var util=require(_0xa07f('0x1'));var logger=require(_0xa07f('0x2'))(_0xa07f('0x3'));var moment=require('moment');var BPromise=require(_0xa07f('0x4'));var rp=require(_0xa07f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa07f('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xa07f('0x7')]=function(_0x4f6c82,_0xfbdb7){return _0x4f6c82[_0xa07f('0x8')]('ZendeskAccount',attributes,{'tableName':_0xa07f('0x9'),'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 1bfb427..aeb8cd0 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 _0x7f24=['GetZendeskAccount','ZendeskAccount','findAll','where','options','attributes','limit','map','include','model','find','raw','ShowZendeskAccount','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message'];(function(_0x4d1cbd,_0x351c59){var _0x33cebb=function(_0x8906ec){while(--_0x8906ec){_0x4d1cbd['push'](_0x4d1cbd['shift']());}};_0x33cebb(++_0x351c59);}(_0x7f24,0x8e));var _0x47f2=function(_0x1fa873,_0x1319ab){_0x1fa873=_0x1fa873-0x0;var _0x599fbc=_0x7f24[_0x1fa873];return _0x599fbc;};'use strict';var _=require(_0x47f2('0x0'));var util=require('util');var moment=require(_0x47f2('0x1'));var BPromise=require(_0x47f2('0x2'));var rs=require(_0x47f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x47f2('0x5'));var jayson=require(_0x47f2('0x6'));var client=jayson[_0x47f2('0x7')][_0x47f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e9062,_0x340307,_0x287f8c){return new BPromise(function(_0x46271e,_0x4bdea4){return client[_0x47f2('0x9')](_0x2e9062,_0x287f8c)['then'](function(_0x5eaf33){logger[_0x47f2('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x340307,_0x47f2('0xb'));logger[_0x47f2('0xc')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x340307,'request\x20sent',JSON[_0x47f2('0xd')](_0x5eaf33));if(_0x5eaf33[_0x47f2('0xe')]){if(_0x5eaf33['error'][_0x47f2('0xf')]===0x1f4){logger[_0x47f2('0xe')](_0x47f2('0x10'),_0x340307,_0x5eaf33[_0x47f2('0xe')][_0x47f2('0x11')]);return _0x4bdea4(_0x5eaf33[_0x47f2('0xe')][_0x47f2('0x11')]);}logger[_0x47f2('0xe')](_0x47f2('0x10'),_0x340307,_0x5eaf33[_0x47f2('0xe')][_0x47f2('0x11')]);return _0x46271e(_0x5eaf33[_0x47f2('0xe')][_0x47f2('0x11')]);}else{logger[_0x47f2('0xa')](_0x47f2('0x10'),_0x340307,'request\x20sent');_0x46271e(_0x5eaf33['result'][_0x47f2('0x11')]);}})['catch'](function(_0x538b7a){logger[_0x47f2('0xe')](_0x47f2('0x10'),_0x340307,_0x538b7a);_0x4bdea4(_0x538b7a);});});}exports[_0x47f2('0x12')]=function(_0x35195e){var _0x5e142e=this;return new Promise(function(_0x197a73,_0x57aeef){return db[_0x47f2('0x13')][_0x47f2('0x14')]({'raw':_0x35195e['options']?_0x35195e['options']['raw']===undefined?!![]:![]:!![],'where':_0x35195e['options']?_0x35195e['options'][_0x47f2('0x15')]||null:null,'attributes':_0x35195e[_0x47f2('0x16')]?_0x35195e['options'][_0x47f2('0x17')]||null:null,'limit':_0x35195e['options']?_0x35195e[_0x47f2('0x16')][_0x47f2('0x18')]||null:null,'include':_0x35195e[_0x47f2('0x16')]?_0x35195e[_0x47f2('0x16')]['include']?_[_0x47f2('0x19')](_0x35195e[_0x47f2('0x16')][_0x47f2('0x1a')],function(_0x54c9a9){return{'model':db[_0x54c9a9[_0x47f2('0x1b')]],'as':_0x54c9a9['as'],'attributes':_0x54c9a9[_0x47f2('0x17')],'include':_0x54c9a9[_0x47f2('0x1a')]?_['map'](_0x54c9a9[_0x47f2('0x1a')],function(_0x5c7c9c){return{'model':db[_0x5c7c9c[_0x47f2('0x1b')]],'as':_0x5c7c9c['as'],'attributes':_0x5c7c9c[_0x47f2('0x17')],'include':_0x5c7c9c['include']?_[_0x47f2('0x19')](_0x5c7c9c[_0x47f2('0x1a')],function(_0x45d663){return{'model':db[_0x45d663[_0x47f2('0x1b')]],'as':_0x45d663['as'],'attributes':_0x45d663[_0x47f2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf003e7){logger['info']('GetZendeskAccount',_0x35195e);logger[_0x47f2('0xc')](_0x47f2('0x12'),_0x35195e,JSON[_0x47f2('0xd')](_0xf003e7));_0x197a73(_0xf003e7);})['catch'](function(_0x10903f){logger['error'](_0x47f2('0x12'),_0x10903f[_0x47f2('0x11')],_0x35195e);_0x57aeef(_0x5e142e[_0x47f2('0xe')](0x1f4,_0x10903f[_0x47f2('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x506456){var _0x3db329=this;return new Promise(function(_0x36cef8,_0x104273){return db['ZendeskAccount'][_0x47f2('0x1c')]({'raw':_0x506456[_0x47f2('0x16')]?_0x506456[_0x47f2('0x16')][_0x47f2('0x1d')]===undefined?!![]:![]:!![],'where':_0x506456[_0x47f2('0x16')]?_0x506456[_0x47f2('0x16')][_0x47f2('0x15')]||null:null,'attributes':_0x506456[_0x47f2('0x16')]?_0x506456['options']['attributes']||null:null,'include':_0x506456['options']?_0x506456[_0x47f2('0x16')][_0x47f2('0x1a')]?_['map'](_0x506456[_0x47f2('0x16')]['include'],function(_0x1cad35){return{'model':db[_0x1cad35[_0x47f2('0x1b')]],'as':_0x1cad35['as'],'attributes':_0x1cad35[_0x47f2('0x17')],'include':_0x1cad35['include']?_[_0x47f2('0x19')](_0x1cad35[_0x47f2('0x1a')],function(_0x29e183){return{'model':db[_0x29e183[_0x47f2('0x1b')]],'as':_0x29e183['as'],'attributes':_0x29e183[_0x47f2('0x17')],'include':_0x29e183[_0x47f2('0x1a')]?_[_0x47f2('0x19')](_0x29e183[_0x47f2('0x1a')],function(_0x516a64){return{'model':db[_0x516a64[_0x47f2('0x1b')]],'as':_0x516a64['as'],'attributes':_0x516a64[_0x47f2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb92e9e){logger[_0x47f2('0xa')](_0x47f2('0x1e'),_0x506456);logger[_0x47f2('0xc')](_0x47f2('0x1e'),_0x506456,JSON[_0x47f2('0xd')](_0xb92e9e));_0x36cef8(_0xb92e9e);})[_0x47f2('0x1f')](function(_0xc780ec){logger[_0x47f2('0xe')](_0x47f2('0x1e'),_0xc780ec[_0x47f2('0x11')],_0x506456);_0x104273(_0x3db329[_0x47f2('0xe')](0x1f4,_0xc780ec[_0x47f2('0x11')]));});});}; \ No newline at end of file +var _0x9120=['ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZendeskAccount','options','raw','where','limit','include','map','attributes','model'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x9120,0x1b3));var _0x0912=function(_0x46d60e,_0x417274){_0x46d60e=_0x46d60e-0x0;var _0x554900=_0x9120[_0x46d60e];return _0x554900;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var moment=require(_0x0912('0x2'));var BPromise=require(_0x0912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0912('0x4'))['db'];var utils=require(_0x0912('0x5'));var logger=require(_0x0912('0x6'))(_0x0912('0x7'));var config=require(_0x0912('0x8'));var jayson=require(_0x0912('0x9'));var client=jayson['client'][_0x0912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345969,_0x438bb2,_0x564522){return new BPromise(function(_0x674709,_0x4383c7){return client[_0x0912('0xb')](_0x345969,_0x564522)[_0x0912('0xc')](function(_0x1532bd){logger['info'](_0x0912('0xd'),_0x438bb2,_0x0912('0xe'));logger[_0x0912('0xf')](_0x0912('0x10'),_0x438bb2,'request\x20sent',JSON[_0x0912('0x11')](_0x1532bd));if(_0x1532bd['error']){if(_0x1532bd[_0x0912('0x12')][_0x0912('0x13')]===0x1f4){logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x4383c7(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x674709(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}else{logger[_0x0912('0x15')]('ZendeskAccount,\x20%s,\x20%s',_0x438bb2,'request\x20sent');_0x674709(_0x1532bd[_0x0912('0x16')]['message']);}})[_0x0912('0x17')](function(_0x5cd19f){logger[_0x0912('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x438bb2,_0x5cd19f);_0x4383c7(_0x5cd19f);});});}exports[_0x0912('0x18')]=function(_0x5eace1){var _0x22befd=this;return new Promise(function(_0x5357db,_0x495e2e){return db['ZendeskAccount']['findAll']({'raw':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1a')]===undefined?!![]:![]:!![],'where':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1b')]||null:null,'attributes':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')]['attributes']||null:null,'limit':_0x5eace1['options']?_0x5eace1[_0x0912('0x19')][_0x0912('0x1c')]||null:null,'include':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')]?_[_0x0912('0x1e')](_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')],function(_0xca7f8b){return{'model':db[_0xca7f8b['model']],'as':_0xca7f8b['as'],'attributes':_0xca7f8b[_0x0912('0x1f')],'include':_0xca7f8b[_0x0912('0x1d')]?_[_0x0912('0x1e')](_0xca7f8b['include'],function(_0x4a938e){return{'model':db[_0x4a938e[_0x0912('0x20')]],'as':_0x4a938e['as'],'attributes':_0x4a938e['attributes'],'include':_0x4a938e['include']?_[_0x0912('0x1e')](_0x4a938e[_0x0912('0x1d')],function(_0x4d45d2){return{'model':db[_0x4d45d2[_0x0912('0x20')]],'as':_0x4d45d2['as'],'attributes':_0x4d45d2[_0x0912('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0912('0xc')](function(_0x2c8e48){logger[_0x0912('0x15')]('GetZendeskAccount',_0x5eace1);logger[_0x0912('0xf')](_0x0912('0x18'),_0x5eace1,JSON['stringify'](_0x2c8e48));_0x5357db(_0x2c8e48);})[_0x0912('0x17')](function(_0x3428a9){logger[_0x0912('0x12')]('GetZendeskAccount',_0x3428a9[_0x0912('0x14')],_0x5eace1);_0x495e2e(_0x22befd[_0x0912('0x12')](0x1f4,_0x3428a9[_0x0912('0x14')]));});});};exports[_0x0912('0x21')]=function(_0x5a30d8){var _0x448fa3=this;return new Promise(function(_0x195c08,_0x2a9282){return db[_0x0912('0x22')][_0x0912('0x23')]({'raw':_0x5a30d8[_0x0912('0x19')]?_0x5a30d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a30d8[_0x0912('0x19')]?_0x5a30d8[_0x0912('0x19')]['where']||null:null,'attributes':_0x5a30d8['options']?_0x5a30d8[_0x0912('0x19')][_0x0912('0x1f')]||null:null,'include':_0x5a30d8[_0x0912('0x19')]?_0x5a30d8[_0x0912('0x19')][_0x0912('0x1d')]?_[_0x0912('0x1e')](_0x5a30d8[_0x0912('0x19')][_0x0912('0x1d')],function(_0x52fa70){return{'model':db[_0x52fa70['model']],'as':_0x52fa70['as'],'attributes':_0x52fa70[_0x0912('0x1f')],'include':_0x52fa70[_0x0912('0x1d')]?_['map'](_0x52fa70[_0x0912('0x1d')],function(_0x271a9c){return{'model':db[_0x271a9c[_0x0912('0x20')]],'as':_0x271a9c['as'],'attributes':_0x271a9c[_0x0912('0x1f')],'include':_0x271a9c[_0x0912('0x1d')]?_[_0x0912('0x1e')](_0x271a9c[_0x0912('0x1d')],function(_0x2d1f12){return{'model':db[_0x2d1f12[_0x0912('0x20')]],'as':_0x2d1f12['as'],'attributes':_0x2d1f12['attributes']};}):[]};}):[]};}):[]:[]})[_0x0912('0xc')](function(_0x3cdce3){logger[_0x0912('0x15')](_0x0912('0x21'),_0x5a30d8);logger[_0x0912('0xf')](_0x0912('0x21'),_0x5a30d8,JSON[_0x0912('0x11')](_0x3cdce3));_0x195c08(_0x3cdce3);})['catch'](function(_0x1d9be2){logger['error']('ShowZendeskAccount',_0x1d9be2['message'],_0x5a30d8);_0x2a9282(_0x448fa3[_0x0912('0x12')](0x1f4,_0x1d9be2[_0x0912('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6e205ca..0a4625f 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 _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1f544e,_0x1edbbd){var _0x394caa=function(_0x30ef1b){while(--_0x30ef1b){_0x1f544e['push'](_0x1f544e['shift']());}};_0x394caa(++_0x1edbbd);}(_0xea28,0x13a));var _0x8ea2=function(_0x551fa1,_0x54183e){_0x551fa1=_0x551fa1-0x0;var _0x1d77ce=_0xea28[_0x551fa1];return _0x1d77ce;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x1bd114,_0x3d3d8d){var _0x449228=function(_0x4cdeac){while(--_0x4cdeac){_0x1bd114['push'](_0x1bd114['shift']());}};_0x449228(++_0x3d3d8d);}(_0x087b,0x11a));var _0xb087=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x087b[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 235b9a6..fd84743 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 _0xed01=['STRING','sequelize','exports'];(function(_0xe44509,_0xa2eb09){var _0x2e5320=function(_0x1638c4){while(--_0x1638c4){_0xe44509['push'](_0xe44509['shift']());}};_0x2e5320(++_0xa2eb09);}(_0xed01,0xe5));var _0x1ed0=function(_0x38d672,_0xc41411){_0x38d672=_0x38d672-0x0;var _0x33b0ca=_0xed01[_0x38d672];return _0x33b0ca;};'use strict';var Sequelize=require(_0x1ed0('0x0'));module[_0x1ed0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1ed0('0x2')]}}; \ No newline at end of file +var _0x9bed=['STRING'];(function(_0xd04b50,_0x3d635d){var _0x5de236=function(_0x9129b1){while(--_0x9129b1){_0xd04b50['push'](_0xd04b50['shift']());}};_0x5de236(++_0x3d635d);}(_0x9bed,0xb8));var _0xd9be=function(_0x479b7e,_0x5c5676){_0x479b7e=_0x479b7e-0x0;var _0x524eb1=_0x9bed[_0x479b7e];return _0x524eb1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd9be('0x0')]},'description':{'type':Sequelize[_0xd9be('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index ef2611d..2d501bc 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 _0x1c2a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','offset','count','limit','set','json','apply','save','then','destroy','sendStatus','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','create','body','find','getFields','findOne','ZendeskField','pick','getSubjects','order','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5ea326,_0x3d52fa){var _0x48cf87=function(_0xb15ba1){while(--_0xb15ba1){_0x5ea326['push'](_0x5ea326['shift']());}};_0x48cf87(++_0x3d52fa);}(_0x1c2a,0x186));var _0xa1c2=function(_0x16f6a4,_0x547cf4){_0x16f6a4=_0x16f6a4-0x0;var _0xe6cc72=_0x1c2a[_0x16f6a4];return _0xe6cc72;};'use strict';var emlformat=require(_0xa1c2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1c2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1c2('0x2'));var Mustache=require(_0xa1c2('0x3'));var util=require('util');var path=require(_0xa1c2('0x4'));var sox=require(_0xa1c2('0x5'));var csv=require(_0xa1c2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1c2('0x7'));var squel=require(_0xa1c2('0x8'));var crypto=require(_0xa1c2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa1c2('0xa'));var toCsv=require(_0xa1c2('0x6'));var querystring=require(_0xa1c2('0xb'));var Papa=require(_0xa1c2('0xc'));var Redis=require(_0xa1c2('0xd'));var authService=require(_0xa1c2('0xe'));var qs=require(_0xa1c2('0xf'));var as=require(_0xa1c2('0x10'));var hardwareService=require(_0xa1c2('0x11'));var logger=require(_0xa1c2('0x12'))(_0xa1c2('0x13'));var utils=require(_0xa1c2('0x14'));var config=require(_0xa1c2('0x15'));var licenseUtil=require(_0xa1c2('0x16'));var db=require(_0xa1c2('0x17'))['db'];function respondWithStatusCode(_0x3260b9,_0x450ec4){_0x450ec4=_0x450ec4||0xcc;return function(_0x481247){if(_0x481247){return _0x3260b9['sendStatus'](_0x450ec4);}return _0x3260b9[_0xa1c2('0x18')](_0x450ec4)[_0xa1c2('0x19')]();};}function respondWithResult(_0x4a9b59,_0x10aa74){_0x10aa74=_0x10aa74||0xc8;return function(_0x34d20c){if(_0x34d20c){return _0x4a9b59['status'](_0x10aa74)['json'](_0x34d20c);}};}function respondWithFilteredResult(_0x29811e,_0x5766d4){return function(_0x1bcd6b){if(_0x1bcd6b){var _0x1f3c10=typeof _0x5766d4['offset']===_0xa1c2('0x1a')&&typeof _0x5766d4['limit']===_0xa1c2('0x1a');var _0x44e9c8=_0x1bcd6b['count'];var _0x38368b=_0x1f3c10?0x0:_0x5766d4[_0xa1c2('0x1b')];var _0x28b1ba=_0x1f3c10?_0x1bcd6b[_0xa1c2('0x1c')]:_0x5766d4['offset']+_0x5766d4[_0xa1c2('0x1d')];var _0x25bb8b;if(_0x28b1ba>=_0x44e9c8){_0x28b1ba=_0x44e9c8;_0x25bb8b=0xc8;}else{_0x25bb8b=0xce;}_0x29811e['status'](_0x25bb8b);return _0x29811e[_0xa1c2('0x1e')]('Content-Range',_0x38368b+'-'+_0x28b1ba+'/'+_0x44e9c8)[_0xa1c2('0x1f')](_0x1bcd6b);}return null;};}function patchUpdates(_0x32687a){return function(_0x390e9f){try{jsonpatch[_0xa1c2('0x20')](_0x390e9f,_0x32687a,!![]);}catch(_0x3b7e07){return BPromise['reject'](_0x3b7e07);}return _0x390e9f[_0xa1c2('0x21')]();};}function saveUpdates(_0xba51c6,_0x115f24){return function(_0x3c6072){if(_0x3c6072){return _0x3c6072['update'](_0xba51c6)[_0xa1c2('0x22')](function(_0x593eb9){return _0x593eb9;});}return null;};}function removeEntity(_0x303d90,_0x3b4646){return function(_0x56d609){if(_0x56d609){return _0x56d609[_0xa1c2('0x23')]()[_0xa1c2('0x22')](function(){_0x303d90[_0xa1c2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8439,_0x4c702a){return function(_0x1fe27e){if(!_0x1fe27e){_0x3a8439[_0xa1c2('0x24')](0x194);}return _0x1fe27e;};}function handleError(_0x4b0a1c,_0x5d5994){_0x5d5994=_0x5d5994||0x1f4;return function(_0x4250be){logger['error'](_0x4250be['stack']);if(_0x4250be[_0xa1c2('0x25')]){delete _0x4250be['name'];}_0x4b0a1c[_0xa1c2('0x18')](_0x5d5994)[_0xa1c2('0x26')](_0x4250be);};}exports[_0xa1c2('0x27')]=function(_0xd4196,_0x58cad9){var _0x17386b={},_0x14f338={},_0x19de6e={'count':0x0,'rows':[]};var _0x1ba749=_[_0xa1c2('0x28')](db[_0xa1c2('0x29')][_0xa1c2('0x2a')],function(_0x5725ea){return{'name':_0x5725ea[_0xa1c2('0x2b')],'type':_0x5725ea[_0xa1c2('0x2c')][_0xa1c2('0x2d')]};});_0x14f338[_0xa1c2('0x2e')]=_[_0xa1c2('0x28')](_0x1ba749,_0xa1c2('0x25'));_0x14f338[_0xa1c2('0x2f')]=_[_0xa1c2('0x30')](_0xd4196[_0xa1c2('0x2f')]);_0x14f338[_0xa1c2('0x31')]=_[_0xa1c2('0x32')](_0x14f338['model'],_0x14f338[_0xa1c2('0x2f')]);_0x17386b[_0xa1c2('0x33')]=_[_0xa1c2('0x32')](_0x14f338['model'],qs[_0xa1c2('0x34')](_0xd4196['query']['fields']));_0x17386b[_0xa1c2('0x33')]=_0x17386b[_0xa1c2('0x33')][_0xa1c2('0x35')]?_0x17386b['attributes']:_0x14f338[_0xa1c2('0x2e')];if(!_0xd4196[_0xa1c2('0x2f')]['hasOwnProperty'](_0xa1c2('0x36'))){_0x17386b[_0xa1c2('0x1d')]=qs[_0xa1c2('0x1d')](_0xd4196[_0xa1c2('0x2f')][_0xa1c2('0x1d')]);_0x17386b[_0xa1c2('0x1b')]=qs[_0xa1c2('0x1b')](_0xd4196[_0xa1c2('0x2f')][_0xa1c2('0x1b')]);}_0x17386b['order']=qs[_0xa1c2('0x37')](_0xd4196[_0xa1c2('0x2f')][_0xa1c2('0x37')]);_0x17386b[_0xa1c2('0x38')]=qs[_0xa1c2('0x31')](_['pick'](_0xd4196[_0xa1c2('0x2f')],_0x14f338['filters']),_0x1ba749);if(_0xd4196[_0xa1c2('0x2f')]['filter']){_0x17386b[_0xa1c2('0x38')]=_[_0xa1c2('0x39')](_0x17386b[_0xa1c2('0x38')],{'$or':_[_0xa1c2('0x28')](_0x1ba749,function(_0x5977dd){if(_0x5977dd['type']!==_0xa1c2('0x3a')){var _0x3a6d15={};_0x3a6d15[_0x5977dd[_0xa1c2('0x25')]]={'$like':'%'+_0xd4196[_0xa1c2('0x2f')][_0xa1c2('0x3b')]+'%'};return _0x3a6d15;}})});}_0x17386b=_['merge']({},_0x17386b,_0xd4196[_0xa1c2('0x3c')]);var _0x6356cb={'where':_0x17386b[_0xa1c2('0x38')]};return db[_0xa1c2('0x29')][_0xa1c2('0x1c')](_0x6356cb)[_0xa1c2('0x22')](function(_0x2066d3){_0x19de6e[_0xa1c2('0x1c')]=_0x2066d3;if(_0xd4196[_0xa1c2('0x2f')][_0xa1c2('0x3d')]){_0x17386b['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xa1c2('0x3e')](_0x17386b);})[_0xa1c2('0x22')](function(_0x13e73c){_0x19de6e['rows']=_0x13e73c;return _0x19de6e;})[_0xa1c2('0x22')](respondWithFilteredResult(_0x58cad9,_0x17386b))[_0xa1c2('0x3f')](handleError(_0x58cad9,null));};exports[_0xa1c2('0x40')]=function(_0x57f7ed,_0x248d90){var _0x2b02a4={'raw':![],'where':{'id':_0x57f7ed[_0xa1c2('0x41')]['id']}},_0x26bc9c={};_0x26bc9c[_0xa1c2('0x2e')]=_['keys'](db['ZendeskConfiguration'][_0xa1c2('0x2a')]);_0x26bc9c[_0xa1c2('0x2f')]=_[_0xa1c2('0x30')](_0x57f7ed[_0xa1c2('0x2f')]);_0x26bc9c[_0xa1c2('0x31')]=_[_0xa1c2('0x32')](_0x26bc9c[_0xa1c2('0x2e')],_0x26bc9c[_0xa1c2('0x2f')]);_0x2b02a4[_0xa1c2('0x33')]=_[_0xa1c2('0x32')](_0x26bc9c[_0xa1c2('0x2e')],qs[_0xa1c2('0x34')](_0x57f7ed[_0xa1c2('0x2f')][_0xa1c2('0x34')]));_0x2b02a4['attributes']=_0x2b02a4[_0xa1c2('0x33')][_0xa1c2('0x35')]?_0x2b02a4['attributes']:_0x26bc9c[_0xa1c2('0x2e')];if(_0x57f7ed[_0xa1c2('0x2f')][_0xa1c2('0x3d')]){_0x2b02a4[_0xa1c2('0x42')]=[{'all':!![]}];}_0x2b02a4=_[_0xa1c2('0x39')]({},_0x2b02a4,_0x57f7ed[_0xa1c2('0x3c')]);return db[_0xa1c2('0x29')]['find'](_0x2b02a4)['then'](handleEntityNotFound(_0x248d90,null))[_0xa1c2('0x22')](respondWithResult(_0x248d90,null))[_0xa1c2('0x3f')](handleError(_0x248d90,null));};exports[_0xa1c2('0x43')]=function(_0x539a9d,_0x2c8b83){return db[_0xa1c2('0x29')][_0xa1c2('0x43')](_0x539a9d[_0xa1c2('0x44')],{})[_0xa1c2('0x22')](respondWithResult(_0x2c8b83,0xc9))[_0xa1c2('0x3f')](handleError(_0x2c8b83,null));};exports['update']=function(_0x5caed0,_0x1a3a70){if(_0x5caed0['body']['id']){delete _0x5caed0[_0xa1c2('0x44')]['id'];}return db[_0xa1c2('0x29')]['find']({'where':{'id':_0x5caed0[_0xa1c2('0x41')]['id']}})[_0xa1c2('0x22')](handleEntityNotFound(_0x1a3a70,null))['then'](saveUpdates(_0x5caed0['body'],null))[_0xa1c2('0x22')](respondWithResult(_0x1a3a70,null))['catch'](handleError(_0x1a3a70,null));};exports[_0xa1c2('0x23')]=function(_0xc405fb,_0x23972a){return db[_0xa1c2('0x29')][_0xa1c2('0x45')]({'where':{'id':_0xc405fb[_0xa1c2('0x41')]['id']}})[_0xa1c2('0x22')](handleEntityNotFound(_0x23972a,null))[_0xa1c2('0x22')](removeEntity(_0x23972a,null))[_0xa1c2('0x3f')](handleError(_0x23972a,null));};exports[_0xa1c2('0x46')]=function(_0x386288,_0x1322dc,_0x3838ef){var _0xd067a5={};var _0x640de1={};var _0x536181;var _0x30f43f;return db[_0xa1c2('0x29')][_0xa1c2('0x47')]({'where':{'id':_0x386288['params']['id']}})['then'](handleEntityNotFound(_0x1322dc,null))[_0xa1c2('0x22')](function(_0x474a3d){if(_0x474a3d){_0x536181=_0x474a3d;_0x640de1[_0xa1c2('0x2e')]=_[_0xa1c2('0x30')](db[_0xa1c2('0x48')][_0xa1c2('0x2a')]);_0x640de1[_0xa1c2('0x2f')]=_[_0xa1c2('0x30')](_0x386288[_0xa1c2('0x2f')]);_0x640de1[_0xa1c2('0x31')]=_['intersection'](_0x640de1['model'],_0x640de1[_0xa1c2('0x2f')]);_0xd067a5['attributes']=_[_0xa1c2('0x32')](_0x640de1[_0xa1c2('0x2e')],qs[_0xa1c2('0x34')](_0x386288[_0xa1c2('0x2f')]['fields']));_0xd067a5['attributes']=_0xd067a5[_0xa1c2('0x33')][_0xa1c2('0x35')]?_0xd067a5[_0xa1c2('0x33')]:_0x640de1[_0xa1c2('0x2e')];_0xd067a5['order']=qs[_0xa1c2('0x37')](_0x386288[_0xa1c2('0x2f')][_0xa1c2('0x37')]);_0xd067a5['where']=qs[_0xa1c2('0x31')](_[_0xa1c2('0x49')](_0x386288[_0xa1c2('0x2f')],_0x640de1[_0xa1c2('0x31')]));if(_0x386288[_0xa1c2('0x2f')][_0xa1c2('0x3b')]){_0xd067a5[_0xa1c2('0x38')]=_[_0xa1c2('0x39')](_0xd067a5['where'],{'$or':_[_0xa1c2('0x28')](_0xd067a5[_0xa1c2('0x33')],function(_0x424377){var _0x434349={};_0x434349[_0x424377]={'$like':'%'+_0x386288[_0xa1c2('0x2f')][_0xa1c2('0x3b')]+'%'};return _0x434349;})});}_0xd067a5=_[_0xa1c2('0x39')]({},_0xd067a5,_0x386288[_0xa1c2('0x3c')]);return _0x536181[_0xa1c2('0x46')](_0xd067a5);}})[_0xa1c2('0x22')](function(_0x41f42b){if(_0x41f42b){_0x30f43f=_0x41f42b[_0xa1c2('0x35')];if(!_0x386288['query']['hasOwnProperty'](_0xa1c2('0x36'))){_0xd067a5[_0xa1c2('0x1d')]=qs['limit'](_0x386288[_0xa1c2('0x2f')]['limit']);_0xd067a5[_0xa1c2('0x1b')]=qs['offset'](_0x386288['query'][_0xa1c2('0x1b')]);}return _0x536181['getFields'](_0xd067a5);}})[_0xa1c2('0x22')](function(_0x2a238e){if(_0x2a238e){return _0x2a238e?{'count':_0x30f43f,'rows':_0x2a238e}:null;}})[_0xa1c2('0x22')](respondWithResult(_0x1322dc,null))[_0xa1c2('0x3f')](handleError(_0x1322dc,null));};exports[_0xa1c2('0x4a')]=function(_0x3020b4,_0x319e26,_0xff1b0f){var _0x5deb61={};var _0x30ec0a={};var _0x2c457c;var _0x254339;return db[_0xa1c2('0x29')][_0xa1c2('0x47')]({'where':{'id':_0x3020b4['params']['id']}})['then'](handleEntityNotFound(_0x319e26,null))[_0xa1c2('0x22')](function(_0x4309a4){if(_0x4309a4){_0x2c457c=_0x4309a4;_0x30ec0a[_0xa1c2('0x2e')]=_[_0xa1c2('0x30')](db[_0xa1c2('0x48')]['rawAttributes']);_0x30ec0a[_0xa1c2('0x2f')]=_['keys'](_0x3020b4[_0xa1c2('0x2f')]);_0x30ec0a[_0xa1c2('0x31')]=_[_0xa1c2('0x32')](_0x30ec0a[_0xa1c2('0x2e')],_0x30ec0a[_0xa1c2('0x2f')]);_0x5deb61[_0xa1c2('0x33')]=_[_0xa1c2('0x32')](_0x30ec0a[_0xa1c2('0x2e')],qs[_0xa1c2('0x34')](_0x3020b4['query'][_0xa1c2('0x34')]));_0x5deb61[_0xa1c2('0x33')]=_0x5deb61[_0xa1c2('0x33')][_0xa1c2('0x35')]?_0x5deb61[_0xa1c2('0x33')]:_0x30ec0a[_0xa1c2('0x2e')];_0x5deb61[_0xa1c2('0x4b')]=qs['sort'](_0x3020b4['query'][_0xa1c2('0x37')]);_0x5deb61[_0xa1c2('0x38')]=qs[_0xa1c2('0x31')](_[_0xa1c2('0x49')](_0x3020b4['query'],_0x30ec0a[_0xa1c2('0x31')]));if(_0x3020b4[_0xa1c2('0x2f')]['filter']){_0x5deb61[_0xa1c2('0x38')]=_[_0xa1c2('0x39')](_0x5deb61[_0xa1c2('0x38')],{'$or':_[_0xa1c2('0x28')](_0x5deb61[_0xa1c2('0x33')],function(_0x3e3c93){var _0x50cde8={};_0x50cde8[_0x3e3c93]={'$like':'%'+_0x3020b4[_0xa1c2('0x2f')]['filter']+'%'};return _0x50cde8;})});}_0x5deb61=_[_0xa1c2('0x39')]({},_0x5deb61,_0x3020b4[_0xa1c2('0x3c')]);return _0x2c457c['getSubjects'](_0x5deb61);}})[_0xa1c2('0x22')](function(_0x3c588e){if(_0x3c588e){_0x254339=_0x3c588e['length'];if(!_0x3020b4[_0xa1c2('0x2f')][_0xa1c2('0x4c')](_0xa1c2('0x36'))){_0x5deb61[_0xa1c2('0x1d')]=qs[_0xa1c2('0x1d')](_0x3020b4['query'][_0xa1c2('0x1d')]);_0x5deb61[_0xa1c2('0x1b')]=qs[_0xa1c2('0x1b')](_0x3020b4['query']['offset']);}return _0x2c457c['getSubjects'](_0x5deb61);}})[_0xa1c2('0x22')](function(_0x2642b9){if(_0x2642b9){return _0x2642b9?{'count':_0x254339,'rows':_0x2642b9}:null;}})[_0xa1c2('0x22')](respondWithResult(_0x319e26,null))[_0xa1c2('0x3f')](handleError(_0x319e26,null));};exports[_0xa1c2('0x4d')]=function(_0x4e3cd1,_0x4a809a,_0x4909b2){var _0x11995b={};var _0x388c0a={};var _0x15f4eb;var _0x1470ba;return db[_0xa1c2('0x29')][_0xa1c2('0x47')]({'where':{'id':_0x4e3cd1[_0xa1c2('0x41')]['id']}})[_0xa1c2('0x22')](handleEntityNotFound(_0x4a809a,null))[_0xa1c2('0x22')](function(_0x39d566){if(_0x39d566){_0x15f4eb=_0x39d566;_0x388c0a[_0xa1c2('0x2e')]=_['keys'](db[_0xa1c2('0x48')][_0xa1c2('0x2a')]);_0x388c0a['query']=_[_0xa1c2('0x30')](_0x4e3cd1[_0xa1c2('0x2f')]);_0x388c0a[_0xa1c2('0x31')]=_[_0xa1c2('0x32')](_0x388c0a[_0xa1c2('0x2e')],_0x388c0a[_0xa1c2('0x2f')]);_0x11995b[_0xa1c2('0x33')]=_['intersection'](_0x388c0a['model'],qs[_0xa1c2('0x34')](_0x4e3cd1[_0xa1c2('0x2f')]['fields']));_0x11995b[_0xa1c2('0x33')]=_0x11995b[_0xa1c2('0x33')][_0xa1c2('0x35')]?_0x11995b['attributes']:_0x388c0a[_0xa1c2('0x2e')];_0x11995b[_0xa1c2('0x4b')]=qs[_0xa1c2('0x37')](_0x4e3cd1['query'][_0xa1c2('0x37')]);_0x11995b[_0xa1c2('0x38')]=qs[_0xa1c2('0x31')](_[_0xa1c2('0x49')](_0x4e3cd1['query'],_0x388c0a[_0xa1c2('0x31')]));if(_0x4e3cd1[_0xa1c2('0x2f')][_0xa1c2('0x3b')]){_0x11995b[_0xa1c2('0x38')]=_[_0xa1c2('0x39')](_0x11995b[_0xa1c2('0x38')],{'$or':_[_0xa1c2('0x28')](_0x11995b[_0xa1c2('0x33')],function(_0x271426){var _0x5f08ba={};_0x5f08ba[_0x271426]={'$like':'%'+_0x4e3cd1[_0xa1c2('0x2f')][_0xa1c2('0x3b')]+'%'};return _0x5f08ba;})});}_0x11995b=_[_0xa1c2('0x39')]({},_0x11995b,_0x4e3cd1[_0xa1c2('0x3c')]);return _0x15f4eb[_0xa1c2('0x4d')](_0x11995b);}})[_0xa1c2('0x22')](function(_0x73096a){if(_0x73096a){_0x1470ba=_0x73096a['length'];if(!_0x4e3cd1[_0xa1c2('0x2f')][_0xa1c2('0x4c')](_0xa1c2('0x36'))){_0x11995b['limit']=qs[_0xa1c2('0x1d')](_0x4e3cd1[_0xa1c2('0x2f')][_0xa1c2('0x1d')]);_0x11995b[_0xa1c2('0x1b')]=qs['offset'](_0x4e3cd1['query'][_0xa1c2('0x1b')]);}return _0x15f4eb[_0xa1c2('0x4d')](_0x11995b);}})[_0xa1c2('0x22')](function(_0x2503a2){if(_0x2503a2){return _0x2503a2?{'count':_0x1470ba,'rows':_0x2503a2}:null;}})['then'](respondWithResult(_0x4a809a,null))[_0xa1c2('0x3f')](handleError(_0x4a809a,null));};exports[_0xa1c2('0x4e')]=function(_0x215cc2,_0x37c78a,_0x283206){var _0x30e1b9={};var _0x4e74f4={};var _0x1a9ae3;var _0x7043e1;return db[_0xa1c2('0x29')][_0xa1c2('0x47')]({'where':{'id':_0x215cc2[_0xa1c2('0x41')]['id']}})['then'](handleEntityNotFound(_0x37c78a,null))['then'](function(_0x1e732f){if(_0x1e732f){_0x1a9ae3=_0x1e732f;_0x4e74f4['model']=_[_0xa1c2('0x30')](db[_0xa1c2('0x4f')][_0xa1c2('0x2a')]);_0x4e74f4[_0xa1c2('0x2f')]=_['keys'](_0x215cc2[_0xa1c2('0x2f')]);_0x4e74f4[_0xa1c2('0x31')]=_[_0xa1c2('0x32')](_0x4e74f4[_0xa1c2('0x2e')],_0x4e74f4[_0xa1c2('0x2f')]);_0x30e1b9[_0xa1c2('0x33')]=_['intersection'](_0x4e74f4[_0xa1c2('0x2e')],qs[_0xa1c2('0x34')](_0x215cc2[_0xa1c2('0x2f')][_0xa1c2('0x34')]));_0x30e1b9[_0xa1c2('0x33')]=_0x30e1b9['attributes'][_0xa1c2('0x35')]?_0x30e1b9[_0xa1c2('0x33')]:_0x4e74f4[_0xa1c2('0x2e')];_0x30e1b9[_0xa1c2('0x4b')]=qs[_0xa1c2('0x37')](_0x215cc2[_0xa1c2('0x2f')]['sort']);_0x30e1b9[_0xa1c2('0x38')]=qs[_0xa1c2('0x31')](_[_0xa1c2('0x49')](_0x215cc2[_0xa1c2('0x2f')],_0x4e74f4[_0xa1c2('0x31')]));if(_0x215cc2[_0xa1c2('0x2f')][_0xa1c2('0x3b')]){_0x30e1b9[_0xa1c2('0x38')]=_[_0xa1c2('0x39')](_0x30e1b9['where'],{'$or':_[_0xa1c2('0x28')](_0x30e1b9[_0xa1c2('0x33')],function(_0x51c53e){var _0x2d4b89={};_0x2d4b89[_0x51c53e]={'$like':'%'+_0x215cc2[_0xa1c2('0x2f')][_0xa1c2('0x3b')]+'%'};return _0x2d4b89;})});}_0x30e1b9=_[_0xa1c2('0x39')]({},_0x30e1b9,_0x215cc2[_0xa1c2('0x3c')]);return _0x1a9ae3[_0xa1c2('0x4e')](_0x30e1b9);}})[_0xa1c2('0x22')](function(_0x983197){if(_0x983197){_0x7043e1=_0x983197[_0xa1c2('0x35')];if(!_0x215cc2[_0xa1c2('0x2f')][_0xa1c2('0x4c')](_0xa1c2('0x36'))){_0x30e1b9[_0xa1c2('0x1d')]=qs['limit'](_0x215cc2[_0xa1c2('0x2f')][_0xa1c2('0x1d')]);_0x30e1b9['offset']=qs[_0xa1c2('0x1b')](_0x215cc2['query'][_0xa1c2('0x1b')]);}return _0x1a9ae3[_0xa1c2('0x4e')](_0x30e1b9);}})['then'](function(_0x3b2825){if(_0x3b2825){return _0x3b2825?{'count':_0x7043e1,'rows':_0x3b2825}:null;}})[_0xa1c2('0x22')](respondWithResult(_0x37c78a,null))[_0xa1c2('0x3f')](handleError(_0x37c78a,null));};exports[_0xa1c2('0x50')]=function(_0xacdd5,_0x3fde68,_0x2f49ed){if(_0xacdd5[_0xa1c2('0x44')]['id']){delete _0xacdd5[_0xa1c2('0x44')]['id'];}return db[_0xa1c2('0x29')]['findOne']({'where':{'id':_0xacdd5[_0xa1c2('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fde68,null))['then'](function(_0x103a8d){if(_0x103a8d){return _0x103a8d[_0xa1c2('0x50')](_0xacdd5[_0xa1c2('0x44')][_0xa1c2('0x51')]||[]);}return null;})[_0xa1c2('0x22')](respondWithResult(_0x3fde68,null))[_0xa1c2('0x3f')](handleError(_0x3fde68,null));}; \ No newline at end of file +var _0x4ec1=['type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','VIRTUAL','options','includeAll','ZendeskConfiguration','findAll','rows','catch','show','params','keys','include','find','create','body','getFields','findOne','ZendeskField','order','sort','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','mustache','util','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','index','rawAttributes'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x4ec1,0xcc));var _0x14ec=function(_0x56046c,_0x48f853){_0x56046c=_0x56046c-0x0;var _0xfa490d=_0x4ec1[_0x56046c];return _0xfa490d;};'use strict';var emlformat=require(_0x14ec('0x0'));var rimraf=require(_0x14ec('0x1'));var zipdir=require(_0x14ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x14ec('0x3'));var util=require(_0x14ec('0x4'));var path=require('path');var sox=require(_0x14ec('0x5'));var csv=require(_0x14ec('0x6'));var ejs=require(_0x14ec('0x7'));var fs=require('fs');var fs_extra=require(_0x14ec('0x8'));var _=require(_0x14ec('0x9'));var squel=require(_0x14ec('0xa'));var crypto=require(_0x14ec('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x14ec('0x6'));var querystring=require(_0x14ec('0xc'));var Papa=require(_0x14ec('0xd'));var Redis=require(_0x14ec('0xe'));var authService=require(_0x14ec('0xf'));var qs=require(_0x14ec('0x10'));var as=require(_0x14ec('0x11'));var hardwareService=require(_0x14ec('0x12'));var logger=require(_0x14ec('0x13'))(_0x14ec('0x14'));var utils=require('../../config/utils');var config=require(_0x14ec('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x14ec('0x16'))['db'];function respondWithStatusCode(_0xe7c02c,_0x4b10bf){_0x4b10bf=_0x4b10bf||0xcc;return function(_0x287e14){if(_0x287e14){return _0xe7c02c[_0x14ec('0x17')](_0x4b10bf);}return _0xe7c02c[_0x14ec('0x18')](_0x4b10bf)[_0x14ec('0x19')]();};}function respondWithResult(_0x1126ec,_0x259449){_0x259449=_0x259449||0xc8;return function(_0x348254){if(_0x348254){return _0x1126ec['status'](_0x259449)[_0x14ec('0x1a')](_0x348254);}};}function respondWithFilteredResult(_0x209ef9,_0x4eaddb){return function(_0x33120d){if(_0x33120d){var _0x420c9c=typeof _0x4eaddb[_0x14ec('0x1b')]===_0x14ec('0x1c')&&typeof _0x4eaddb[_0x14ec('0x1d')]==='undefined';var _0x58c7c4=_0x33120d['count'];var _0x5fff97=_0x420c9c?0x0:_0x4eaddb[_0x14ec('0x1b')];var _0x6666fd=_0x420c9c?_0x33120d[_0x14ec('0x1e')]:_0x4eaddb[_0x14ec('0x1b')]+_0x4eaddb[_0x14ec('0x1d')];var _0xa1db58;if(_0x6666fd>=_0x58c7c4){_0x6666fd=_0x58c7c4;_0xa1db58=0xc8;}else{_0xa1db58=0xce;}_0x209ef9[_0x14ec('0x18')](_0xa1db58);return _0x209ef9[_0x14ec('0x1f')](_0x14ec('0x20'),_0x5fff97+'-'+_0x6666fd+'/'+_0x58c7c4)[_0x14ec('0x1a')](_0x33120d);}return null;};}function patchUpdates(_0x718711){return function(_0x48ed26){try{jsonpatch[_0x14ec('0x21')](_0x48ed26,_0x718711,!![]);}catch(_0x2def22){return BPromise['reject'](_0x2def22);}return _0x48ed26[_0x14ec('0x22')]();};}function saveUpdates(_0x41ba13,_0x75512){return function(_0xc6d129){if(_0xc6d129){return _0xc6d129[_0x14ec('0x23')](_0x41ba13)[_0x14ec('0x24')](function(_0x279f8f){return _0x279f8f;});}return null;};}function removeEntity(_0x26780d,_0x4ddd8c){return function(_0x4550b6){if(_0x4550b6){return _0x4550b6[_0x14ec('0x25')]()[_0x14ec('0x24')](function(){_0x26780d[_0x14ec('0x18')](0xcc)[_0x14ec('0x19')]();});}};}function handleEntityNotFound(_0x217836,_0x2d0d6a){return function(_0xdaf9a6){if(!_0xdaf9a6){_0x217836[_0x14ec('0x17')](0x194);}return _0xdaf9a6;};}function handleError(_0x580c30,_0xa4a66){_0xa4a66=_0xa4a66||0x1f4;return function(_0x393173){logger['error'](_0x393173[_0x14ec('0x26')]);if(_0x393173[_0x14ec('0x27')]){delete _0x393173['name'];}_0x580c30[_0x14ec('0x18')](_0xa4a66)['send'](_0x393173);};}exports[_0x14ec('0x28')]=function(_0x200b75,_0x135176){var _0x5797e3={},_0x1c2123={},_0x2e9be4={'count':0x0,'rows':[]};var _0x1cefb2=_['map'](db['ZendeskConfiguration'][_0x14ec('0x29')],function(_0xd718b1){return{'name':_0xd718b1['fieldName'],'type':_0xd718b1[_0x14ec('0x2a')]['key']};});_0x1c2123['model']=_['map'](_0x1cefb2,_0x14ec('0x27'));_0x1c2123['query']=_['keys'](_0x200b75[_0x14ec('0x2b')]);_0x1c2123[_0x14ec('0x2c')]=_[_0x14ec('0x2d')](_0x1c2123['model'],_0x1c2123['query']);_0x5797e3[_0x14ec('0x2e')]=_[_0x14ec('0x2d')](_0x1c2123[_0x14ec('0x2f')],qs[_0x14ec('0x30')](_0x200b75['query'][_0x14ec('0x30')]));_0x5797e3['attributes']=_0x5797e3[_0x14ec('0x2e')][_0x14ec('0x31')]?_0x5797e3[_0x14ec('0x2e')]:_0x1c2123[_0x14ec('0x2f')];if(!_0x200b75['query'][_0x14ec('0x32')](_0x14ec('0x33'))){_0x5797e3['limit']=qs[_0x14ec('0x1d')](_0x200b75[_0x14ec('0x2b')][_0x14ec('0x1d')]);_0x5797e3[_0x14ec('0x1b')]=qs[_0x14ec('0x1b')](_0x200b75[_0x14ec('0x2b')][_0x14ec('0x1b')]);}_0x5797e3['order']=qs['sort'](_0x200b75[_0x14ec('0x2b')]['sort']);_0x5797e3[_0x14ec('0x34')]=qs[_0x14ec('0x2c')](_[_0x14ec('0x35')](_0x200b75['query'],_0x1c2123['filters']),_0x1cefb2);if(_0x200b75['query'][_0x14ec('0x36')]){_0x5797e3[_0x14ec('0x34')]=_[_0x14ec('0x37')](_0x5797e3[_0x14ec('0x34')],{'$or':_[_0x14ec('0x38')](_0x1cefb2,function(_0x42f5c6){if(_0x42f5c6[_0x14ec('0x2a')]!==_0x14ec('0x39')){var _0x3be75a={};_0x3be75a[_0x42f5c6[_0x14ec('0x27')]]={'$like':'%'+_0x200b75[_0x14ec('0x2b')][_0x14ec('0x36')]+'%'};return _0x3be75a;}})});}_0x5797e3=_['merge']({},_0x5797e3,_0x200b75[_0x14ec('0x3a')]);var _0xd79c53={'where':_0x5797e3[_0x14ec('0x34')]};return db['ZendeskConfiguration'][_0x14ec('0x1e')](_0xd79c53)[_0x14ec('0x24')](function(_0x3357fc){_0x2e9be4[_0x14ec('0x1e')]=_0x3357fc;if(_0x200b75[_0x14ec('0x2b')][_0x14ec('0x3b')]){_0x5797e3['include']=[{'all':!![]}];}return db[_0x14ec('0x3c')][_0x14ec('0x3d')](_0x5797e3);})['then'](function(_0x135f74){_0x2e9be4[_0x14ec('0x3e')]=_0x135f74;return _0x2e9be4;})['then'](respondWithFilteredResult(_0x135176,_0x5797e3))[_0x14ec('0x3f')](handleError(_0x135176,null));};exports[_0x14ec('0x40')]=function(_0x55d415,_0x53ae15){var _0x26b62d={'raw':![],'where':{'id':_0x55d415[_0x14ec('0x41')]['id']}},_0x399dc9={};_0x399dc9[_0x14ec('0x2f')]=_['keys'](db[_0x14ec('0x3c')][_0x14ec('0x29')]);_0x399dc9[_0x14ec('0x2b')]=_[_0x14ec('0x42')](_0x55d415[_0x14ec('0x2b')]);_0x399dc9[_0x14ec('0x2c')]=_[_0x14ec('0x2d')](_0x399dc9['model'],_0x399dc9[_0x14ec('0x2b')]);_0x26b62d['attributes']=_[_0x14ec('0x2d')](_0x399dc9[_0x14ec('0x2f')],qs[_0x14ec('0x30')](_0x55d415['query']['fields']));_0x26b62d[_0x14ec('0x2e')]=_0x26b62d['attributes'][_0x14ec('0x31')]?_0x26b62d[_0x14ec('0x2e')]:_0x399dc9[_0x14ec('0x2f')];if(_0x55d415[_0x14ec('0x2b')]['includeAll']){_0x26b62d[_0x14ec('0x43')]=[{'all':!![]}];}_0x26b62d=_[_0x14ec('0x37')]({},_0x26b62d,_0x55d415['options']);return db[_0x14ec('0x3c')][_0x14ec('0x44')](_0x26b62d)[_0x14ec('0x24')](handleEntityNotFound(_0x53ae15,null))[_0x14ec('0x24')](respondWithResult(_0x53ae15,null))[_0x14ec('0x3f')](handleError(_0x53ae15,null));};exports[_0x14ec('0x45')]=function(_0x5c9384,_0x724aaf){return db['ZendeskConfiguration'][_0x14ec('0x45')](_0x5c9384[_0x14ec('0x46')],{})[_0x14ec('0x24')](respondWithResult(_0x724aaf,0xc9))[_0x14ec('0x3f')](handleError(_0x724aaf,null));};exports[_0x14ec('0x23')]=function(_0x284b27,_0x359e86){if(_0x284b27[_0x14ec('0x46')]['id']){delete _0x284b27[_0x14ec('0x46')]['id'];}return db[_0x14ec('0x3c')][_0x14ec('0x44')]({'where':{'id':_0x284b27['params']['id']}})['then'](handleEntityNotFound(_0x359e86,null))['then'](saveUpdates(_0x284b27[_0x14ec('0x46')],null))[_0x14ec('0x24')](respondWithResult(_0x359e86,null))[_0x14ec('0x3f')](handleError(_0x359e86,null));};exports[_0x14ec('0x25')]=function(_0xc86187,_0x38c699){return db[_0x14ec('0x3c')][_0x14ec('0x44')]({'where':{'id':_0xc86187[_0x14ec('0x41')]['id']}})[_0x14ec('0x24')](handleEntityNotFound(_0x38c699,null))[_0x14ec('0x24')](removeEntity(_0x38c699,null))[_0x14ec('0x3f')](handleError(_0x38c699,null));};exports[_0x14ec('0x47')]=function(_0x17e39d,_0x1d0436,_0x5e515a){var _0x2b9b6d={};var _0x190bea={};var _0x2274cb;var _0x15c9ec;return db[_0x14ec('0x3c')][_0x14ec('0x48')]({'where':{'id':_0x17e39d[_0x14ec('0x41')]['id']}})[_0x14ec('0x24')](handleEntityNotFound(_0x1d0436,null))[_0x14ec('0x24')](function(_0x5387f4){if(_0x5387f4){_0x2274cb=_0x5387f4;_0x190bea['model']=_['keys'](db[_0x14ec('0x49')][_0x14ec('0x29')]);_0x190bea['query']=_[_0x14ec('0x42')](_0x17e39d[_0x14ec('0x2b')]);_0x190bea['filters']=_[_0x14ec('0x2d')](_0x190bea[_0x14ec('0x2f')],_0x190bea[_0x14ec('0x2b')]);_0x2b9b6d['attributes']=_[_0x14ec('0x2d')](_0x190bea[_0x14ec('0x2f')],qs[_0x14ec('0x30')](_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x30')]));_0x2b9b6d[_0x14ec('0x2e')]=_0x2b9b6d[_0x14ec('0x2e')][_0x14ec('0x31')]?_0x2b9b6d[_0x14ec('0x2e')]:_0x190bea[_0x14ec('0x2f')];_0x2b9b6d[_0x14ec('0x4a')]=qs[_0x14ec('0x4b')](_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x4b')]);_0x2b9b6d[_0x14ec('0x34')]=qs[_0x14ec('0x2c')](_[_0x14ec('0x35')](_0x17e39d['query'],_0x190bea[_0x14ec('0x2c')]));if(_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x36')]){_0x2b9b6d['where']=_[_0x14ec('0x37')](_0x2b9b6d[_0x14ec('0x34')],{'$or':_[_0x14ec('0x38')](_0x2b9b6d[_0x14ec('0x2e')],function(_0x3c30d6){var _0x1beae0={};_0x1beae0[_0x3c30d6]={'$like':'%'+_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x36')]+'%'};return _0x1beae0;})});}_0x2b9b6d=_[_0x14ec('0x37')]({},_0x2b9b6d,_0x17e39d['options']);return _0x2274cb[_0x14ec('0x47')](_0x2b9b6d);}})[_0x14ec('0x24')](function(_0x11550d){if(_0x11550d){_0x15c9ec=_0x11550d[_0x14ec('0x31')];if(!_0x17e39d['query'][_0x14ec('0x32')](_0x14ec('0x33'))){_0x2b9b6d[_0x14ec('0x1d')]=qs[_0x14ec('0x1d')](_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x1d')]);_0x2b9b6d['offset']=qs['offset'](_0x17e39d[_0x14ec('0x2b')][_0x14ec('0x1b')]);}return _0x2274cb[_0x14ec('0x47')](_0x2b9b6d);}})['then'](function(_0xaa3463){if(_0xaa3463){return _0xaa3463?{'count':_0x15c9ec,'rows':_0xaa3463}:null;}})['then'](respondWithResult(_0x1d0436,null))[_0x14ec('0x3f')](handleError(_0x1d0436,null));};exports[_0x14ec('0x4c')]=function(_0x4b8a02,_0x575fa0,_0x2e974a){var _0x5c6c3a={};var _0x5b2ece={};var _0x13b61f;var _0x2998d0;return db[_0x14ec('0x3c')][_0x14ec('0x48')]({'where':{'id':_0x4b8a02[_0x14ec('0x41')]['id']}})['then'](handleEntityNotFound(_0x575fa0,null))[_0x14ec('0x24')](function(_0x2a9c25){if(_0x2a9c25){_0x13b61f=_0x2a9c25;_0x5b2ece['model']=_[_0x14ec('0x42')](db[_0x14ec('0x49')][_0x14ec('0x29')]);_0x5b2ece[_0x14ec('0x2b')]=_[_0x14ec('0x42')](_0x4b8a02[_0x14ec('0x2b')]);_0x5b2ece[_0x14ec('0x2c')]=_[_0x14ec('0x2d')](_0x5b2ece[_0x14ec('0x2f')],_0x5b2ece[_0x14ec('0x2b')]);_0x5c6c3a[_0x14ec('0x2e')]=_['intersection'](_0x5b2ece[_0x14ec('0x2f')],qs['fields'](_0x4b8a02['query']['fields']));_0x5c6c3a[_0x14ec('0x2e')]=_0x5c6c3a[_0x14ec('0x2e')][_0x14ec('0x31')]?_0x5c6c3a[_0x14ec('0x2e')]:_0x5b2ece[_0x14ec('0x2f')];_0x5c6c3a['order']=qs[_0x14ec('0x4b')](_0x4b8a02[_0x14ec('0x2b')][_0x14ec('0x4b')]);_0x5c6c3a['where']=qs[_0x14ec('0x2c')](_[_0x14ec('0x35')](_0x4b8a02[_0x14ec('0x2b')],_0x5b2ece[_0x14ec('0x2c')]));if(_0x4b8a02[_0x14ec('0x2b')][_0x14ec('0x36')]){_0x5c6c3a['where']=_[_0x14ec('0x37')](_0x5c6c3a[_0x14ec('0x34')],{'$or':_[_0x14ec('0x38')](_0x5c6c3a[_0x14ec('0x2e')],function(_0x38d584){var _0x3cd94f={};_0x3cd94f[_0x38d584]={'$like':'%'+_0x4b8a02['query'][_0x14ec('0x36')]+'%'};return _0x3cd94f;})});}_0x5c6c3a=_[_0x14ec('0x37')]({},_0x5c6c3a,_0x4b8a02[_0x14ec('0x3a')]);return _0x13b61f[_0x14ec('0x4c')](_0x5c6c3a);}})[_0x14ec('0x24')](function(_0x4e557c){if(_0x4e557c){_0x2998d0=_0x4e557c[_0x14ec('0x31')];if(!_0x4b8a02['query'][_0x14ec('0x32')](_0x14ec('0x33'))){_0x5c6c3a[_0x14ec('0x1d')]=qs['limit'](_0x4b8a02[_0x14ec('0x2b')][_0x14ec('0x1d')]);_0x5c6c3a['offset']=qs[_0x14ec('0x1b')](_0x4b8a02[_0x14ec('0x2b')][_0x14ec('0x1b')]);}return _0x13b61f['getSubjects'](_0x5c6c3a);}})['then'](function(_0xa13083){if(_0xa13083){return _0xa13083?{'count':_0x2998d0,'rows':_0xa13083}:null;}})[_0x14ec('0x24')](respondWithResult(_0x575fa0,null))[_0x14ec('0x3f')](handleError(_0x575fa0,null));};exports[_0x14ec('0x4d')]=function(_0x33510b,_0x456150,_0x350ee8){var _0x56e645={};var _0xffa23d={};var _0x2fa1c7;var _0x286a8d;return db['ZendeskConfiguration'][_0x14ec('0x48')]({'where':{'id':_0x33510b[_0x14ec('0x41')]['id']}})[_0x14ec('0x24')](handleEntityNotFound(_0x456150,null))['then'](function(_0x141b83){if(_0x141b83){_0x2fa1c7=_0x141b83;_0xffa23d[_0x14ec('0x2f')]=_['keys'](db[_0x14ec('0x49')][_0x14ec('0x29')]);_0xffa23d[_0x14ec('0x2b')]=_[_0x14ec('0x42')](_0x33510b[_0x14ec('0x2b')]);_0xffa23d[_0x14ec('0x2c')]=_[_0x14ec('0x2d')](_0xffa23d[_0x14ec('0x2f')],_0xffa23d[_0x14ec('0x2b')]);_0x56e645[_0x14ec('0x2e')]=_['intersection'](_0xffa23d['model'],qs['fields'](_0x33510b[_0x14ec('0x2b')][_0x14ec('0x30')]));_0x56e645[_0x14ec('0x2e')]=_0x56e645['attributes'][_0x14ec('0x31')]?_0x56e645[_0x14ec('0x2e')]:_0xffa23d[_0x14ec('0x2f')];_0x56e645['order']=qs[_0x14ec('0x4b')](_0x33510b[_0x14ec('0x2b')]['sort']);_0x56e645[_0x14ec('0x34')]=qs[_0x14ec('0x2c')](_[_0x14ec('0x35')](_0x33510b['query'],_0xffa23d['filters']));if(_0x33510b[_0x14ec('0x2b')][_0x14ec('0x36')]){_0x56e645[_0x14ec('0x34')]=_[_0x14ec('0x37')](_0x56e645['where'],{'$or':_[_0x14ec('0x38')](_0x56e645[_0x14ec('0x2e')],function(_0x305e9f){var _0x1ca2df={};_0x1ca2df[_0x305e9f]={'$like':'%'+_0x33510b[_0x14ec('0x2b')]['filter']+'%'};return _0x1ca2df;})});}_0x56e645=_[_0x14ec('0x37')]({},_0x56e645,_0x33510b[_0x14ec('0x3a')]);return _0x2fa1c7[_0x14ec('0x4d')](_0x56e645);}})['then'](function(_0x35894c){if(_0x35894c){_0x286a8d=_0x35894c[_0x14ec('0x31')];if(!_0x33510b['query']['hasOwnProperty'](_0x14ec('0x33'))){_0x56e645[_0x14ec('0x1d')]=qs[_0x14ec('0x1d')](_0x33510b[_0x14ec('0x2b')][_0x14ec('0x1d')]);_0x56e645['offset']=qs[_0x14ec('0x1b')](_0x33510b[_0x14ec('0x2b')][_0x14ec('0x1b')]);}return _0x2fa1c7[_0x14ec('0x4d')](_0x56e645);}})[_0x14ec('0x24')](function(_0x55e689){if(_0x55e689){return _0x55e689?{'count':_0x286a8d,'rows':_0x55e689}:null;}})[_0x14ec('0x24')](respondWithResult(_0x456150,null))[_0x14ec('0x3f')](handleError(_0x456150,null));};exports[_0x14ec('0x4e')]=function(_0x13f174,_0x409927,_0x3ed7e8){var _0x4769f9={};var _0x4dad13={};var _0x3ac229;var _0x3db41e;return db[_0x14ec('0x3c')]['findOne']({'where':{'id':_0x13f174[_0x14ec('0x41')]['id']}})['then'](handleEntityNotFound(_0x409927,null))[_0x14ec('0x24')](function(_0x5ae81b){if(_0x5ae81b){_0x3ac229=_0x5ae81b;_0x4dad13[_0x14ec('0x2f')]=_[_0x14ec('0x42')](db[_0x14ec('0x4f')][_0x14ec('0x29')]);_0x4dad13[_0x14ec('0x2b')]=_['keys'](_0x13f174[_0x14ec('0x2b')]);_0x4dad13[_0x14ec('0x2c')]=_[_0x14ec('0x2d')](_0x4dad13[_0x14ec('0x2f')],_0x4dad13[_0x14ec('0x2b')]);_0x4769f9['attributes']=_['intersection'](_0x4dad13[_0x14ec('0x2f')],qs[_0x14ec('0x30')](_0x13f174[_0x14ec('0x2b')][_0x14ec('0x30')]));_0x4769f9[_0x14ec('0x2e')]=_0x4769f9[_0x14ec('0x2e')][_0x14ec('0x31')]?_0x4769f9[_0x14ec('0x2e')]:_0x4dad13[_0x14ec('0x2f')];_0x4769f9[_0x14ec('0x4a')]=qs['sort'](_0x13f174[_0x14ec('0x2b')][_0x14ec('0x4b')]);_0x4769f9[_0x14ec('0x34')]=qs[_0x14ec('0x2c')](_[_0x14ec('0x35')](_0x13f174[_0x14ec('0x2b')],_0x4dad13['filters']));if(_0x13f174['query'][_0x14ec('0x36')]){_0x4769f9[_0x14ec('0x34')]=_[_0x14ec('0x37')](_0x4769f9[_0x14ec('0x34')],{'$or':_[_0x14ec('0x38')](_0x4769f9[_0x14ec('0x2e')],function(_0x4979e5){var _0x4559d7={};_0x4559d7[_0x4979e5]={'$like':'%'+_0x13f174['query'][_0x14ec('0x36')]+'%'};return _0x4559d7;})});}_0x4769f9=_[_0x14ec('0x37')]({},_0x4769f9,_0x13f174[_0x14ec('0x3a')]);return _0x3ac229['getTags'](_0x4769f9);}})[_0x14ec('0x24')](function(_0x141ff7){if(_0x141ff7){_0x3db41e=_0x141ff7[_0x14ec('0x31')];if(!_0x13f174[_0x14ec('0x2b')][_0x14ec('0x32')]('nolimit')){_0x4769f9[_0x14ec('0x1d')]=qs[_0x14ec('0x1d')](_0x13f174[_0x14ec('0x2b')][_0x14ec('0x1d')]);_0x4769f9['offset']=qs[_0x14ec('0x1b')](_0x13f174[_0x14ec('0x2b')]['offset']);}return _0x3ac229[_0x14ec('0x4e')](_0x4769f9);}})[_0x14ec('0x24')](function(_0x124f20){if(_0x124f20){return _0x124f20?{'count':_0x3db41e,'rows':_0x124f20}:null;}})[_0x14ec('0x24')](respondWithResult(_0x409927,null))[_0x14ec('0x3f')](handleError(_0x409927,null));};exports[_0x14ec('0x50')]=function(_0x11b05f,_0x3b436b,_0x4b217b){if(_0x11b05f[_0x14ec('0x46')]['id']){delete _0x11b05f[_0x14ec('0x46')]['id'];}return db['ZendeskConfiguration'][_0x14ec('0x48')]({'where':{'id':_0x11b05f[_0x14ec('0x41')]['id']}})[_0x14ec('0x24')](handleEntityNotFound(_0x3b436b,null))[_0x14ec('0x24')](function(_0x6d85a4){if(_0x6d85a4){return _0x6d85a4[_0x14ec('0x50')](_0x11b05f[_0x14ec('0x46')][_0x14ec('0x51')]||[]);}return null;})['then'](respondWithResult(_0x3b436b,null))[_0x14ec('0x3f')](handleError(_0x3b436b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 613f96c..540fba6 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 _0x1c7c=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4e8cb4,_0x4d8b67){_0x4e8cb4=_0x4e8cb4-0x0;var _0x4a625a=_0x1c7c[_0x4e8cb4];return _0x4a625a;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var logger=require(_0xc1c7('0x2'))(_0xc1c7('0x3'));var moment=require('moment');var BPromise=require(_0xc1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c7('0x5'));var rimraf=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var attributes=require(_0xc1c7('0x8'));module[_0xc1c7('0x9')]=function(_0x364dde,_0x1f3e21){return _0x364dde[_0xc1c7('0xa')](_0xc1c7('0xb'),attributes,{'tableName':_0xc1c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3423=['ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define'];(function(_0x2f1720,_0x58225b){var _0x1bf268=function(_0x346d31){while(--_0x346d31){_0x2f1720['push'](_0x2f1720['shift']());}};_0x1bf268(++_0x58225b);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 9626d31..558b7be 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 _0x262f=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2aad02,_0x556ae7){var _0x546e5b=function(_0x129356){while(--_0x129356){_0x2aad02['push'](_0x2aad02['shift']());}};_0x546e5b(++_0x556ae7);}(_0x262f,0x195));var _0xf262=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x262f[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xf262('0x0'));var util=require('util');var moment=require(_0xf262('0x1'));var BPromise=require(_0xf262('0x2'));var rs=require(_0xf262('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf262('0x4'))['db'];var utils=require(_0xf262('0x5'));var logger=require(_0xf262('0x6'))(_0xf262('0x7'));var config=require(_0xf262('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5819ab,_0x1b4248,_0x418b8e){return new BPromise(function(_0x5c4a8a,_0x3905cc){return client[_0xf262('0x9')](_0x5819ab,_0x418b8e)['then'](function(_0x41e7ae){logger[_0xf262('0xa')](_0xf262('0xb'),_0x1b4248,_0xf262('0xc'));logger['debug'](_0xf262('0xd'),_0x1b4248,_0xf262('0xc'),JSON[_0xf262('0xe')](_0x41e7ae));if(_0x41e7ae[_0xf262('0xf')]){if(_0x41e7ae[_0xf262('0xf')][_0xf262('0x10')]===0x1f4){logger[_0xf262('0xf')](_0xf262('0xb'),_0x1b4248,_0x41e7ae[_0xf262('0xf')]['message']);return _0x3905cc(_0x41e7ae[_0xf262('0xf')][_0xf262('0x11')]);}logger[_0xf262('0xf')](_0xf262('0xb'),_0x1b4248,_0x41e7ae[_0xf262('0xf')][_0xf262('0x11')]);return _0x5c4a8a(_0x41e7ae[_0xf262('0xf')][_0xf262('0x11')]);}else{logger[_0xf262('0xa')](_0xf262('0xb'),_0x1b4248,_0xf262('0xc'));_0x5c4a8a(_0x41e7ae[_0xf262('0x12')][_0xf262('0x11')]);}})[_0xf262('0x13')](function(_0x11e3da){logger[_0xf262('0xf')](_0xf262('0xb'),_0x1b4248,_0x11e3da);_0x3905cc(_0x11e3da);});});} \ No newline at end of file +var _0x7f8e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7f8e,0x1e3));var _0xe7f8=function(_0x48ee4f,_0x1df959){_0x48ee4f=_0x48ee4f-0x0;var _0x41d4ec=_0x7f8e[_0x48ee4f];return _0x41d4ec;};'use strict';var _=require(_0xe7f8('0x0'));var util=require(_0xe7f8('0x1'));var moment=require(_0xe7f8('0x2'));var BPromise=require(_0xe7f8('0x3'));var rs=require(_0xe7f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7f8('0x5'))['db'];var utils=require(_0xe7f8('0x6'));var logger=require(_0xe7f8('0x7'))(_0xe7f8('0x8'));var config=require(_0xe7f8('0x9'));var jayson=require(_0xe7f8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb0b82b,_0x4ac880,_0x3bd8f3){return new BPromise(function(_0x2c96a4,_0x3ff7b7){return client[_0xe7f8('0xb')](_0xb0b82b,_0x3bd8f3)[_0xe7f8('0xc')](function(_0x29401d){logger[_0xe7f8('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ac880,_0xe7f8('0xe'));logger[_0xe7f8('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4ac880,_0xe7f8('0xe'),JSON[_0xe7f8('0x10')](_0x29401d));if(_0x29401d['error']){if(_0x29401d[_0xe7f8('0x11')]['code']===0x1f4){logger[_0xe7f8('0x11')](_0xe7f8('0x12'),_0x4ac880,_0x29401d['error'][_0xe7f8('0x13')]);return _0x3ff7b7(_0x29401d[_0xe7f8('0x11')][_0xe7f8('0x13')]);}logger[_0xe7f8('0x11')](_0xe7f8('0x12'),_0x4ac880,_0x29401d['error']['message']);return _0x2c96a4(_0x29401d[_0xe7f8('0x11')]['message']);}else{logger['info'](_0xe7f8('0x12'),_0x4ac880,'request\x20sent');_0x2c96a4(_0x29401d[_0xe7f8('0x14')][_0xe7f8('0x13')]);}})[_0xe7f8('0x15')](function(_0x5dcb1b){logger[_0xe7f8('0x11')](_0xe7f8('0x12'),_0x4ac880,_0x5dcb1b);_0x3ff7b7(_0x5dcb1b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 02b8142..17bd565 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 _0x75a1=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get'];(function(_0x2bb59b,_0x455c8d){var _0x3f59c3=function(_0xff2d97){while(--_0xff2d97){_0x2bb59b['push'](_0x2bb59b['shift']());}};_0x3f59c3(++_0x455c8d);}(_0x75a1,0x14c));var _0x175a=function(_0x5e1a11,_0x2a6d41){_0x5e1a11=_0x5e1a11-0x0;var _0x743dff=_0x75a1[_0x5e1a11];return _0x743dff;};'use strict';var multer=require(_0x175a('0x0'));var util=require(_0x175a('0x1'));var path=require(_0x175a('0x2'));var timeout=require(_0x175a('0x3'));var express=require(_0x175a('0x4'));var router=express[_0x175a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x175a('0x6'));var interaction=require(_0x175a('0x7'));var config=require('../../config/environment');var controller=require(_0x175a('0x8'));router[_0x175a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x175a('0x9')]('/:id',auth[_0x175a('0xa')](),controller[_0x175a('0xb')]);router[_0x175a('0xc')]('/',auth[_0x175a('0xa')](),controller[_0x175a('0xd')]);router[_0x175a('0xe')](_0x175a('0xf'),auth[_0x175a('0xa')](),controller[_0x175a('0x10')]);router[_0x175a('0x11')](_0x175a('0xf'),auth[_0x175a('0xa')](),controller[_0x175a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa433=['post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1fccbf,_0x565988){var _0x440a37=function(_0x3864a8){while(--_0x3864a8){_0x1fccbf['push'](_0x1fccbf['shift']());}};_0x440a37(++_0x565988);}(_0xa433,0x148));var _0x3a43=function(_0x1aaa93,_0x449546){_0x1aaa93=_0x1aaa93-0x0;var _0x2aad3c=_0xa433[_0x1aaa93];return _0x2aad3c;};'use strict';var multer=require(_0x3a43('0x0'));var util=require(_0x3a43('0x1'));var path=require(_0x3a43('0x2'));var timeout=require(_0x3a43('0x3'));var express=require(_0x3a43('0x4'));var router=express['Router']();var fs_extra=require(_0x3a43('0x5'));var auth=require(_0x3a43('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a43('0x7'));var controller=require(_0x3a43('0x8'));router[_0x3a43('0x9')]('/',auth[_0x3a43('0xa')](),controller[_0x3a43('0xb')]);router[_0x3a43('0x9')](_0x3a43('0xc'),auth[_0x3a43('0xa')](),controller[_0x3a43('0xd')]);router[_0x3a43('0xe')]('/',auth[_0x3a43('0xa')](),controller[_0x3a43('0xf')]);router[_0x3a43('0x10')](_0x3a43('0xc'),auth[_0x3a43('0xa')](),controller[_0x3a43('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3a43('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index baf50a2..5e5bc34 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 _0x4c56=['variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x40baa8,_0x1d116b){var _0x3c6826=function(_0x2c797d){while(--_0x2c797d){_0x40baa8['push'](_0x40baa8['shift']());}};_0x3c6826(++_0x1d116b);}(_0x4c56,0x106));var _0x64c5=function(_0x58924a,_0x39bc0e){_0x58924a=_0x58924a-0x0;var _0x5e6275=_0x4c56[_0x58924a];return _0x5e6275;};'use strict';var Sequelize=require(_0x64c5('0x0'));module[_0x64c5('0x1')]={'type':{'type':Sequelize[_0x64c5('0x2')](_0x64c5('0x3'),'variable',_0x64c5('0x4'),_0x64c5('0x5'),_0x64c5('0x6')),'defaultValue':_0x64c5('0x3')},'content':{'type':Sequelize[_0x64c5('0x7')]},'key':{'type':Sequelize[_0x64c5('0x7')]},'keyType':{'type':Sequelize[_0x64c5('0x2')](_0x64c5('0x3'),_0x64c5('0x8'),_0x64c5('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x64c5('0x7')]},'nameField':{'type':Sequelize[_0x64c5('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64c5('0x7')]}}; \ No newline at end of file +var _0x51f9=['customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x2e61d2,_0x306132){var _0x33dc2e=function(_0x2e9cbe){while(--_0x2e9cbe){_0x2e61d2['push'](_0x2e61d2['shift']());}};_0x33dc2e(++_0x306132);}(_0x51f9,0xb0));var _0x951f=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x51f9[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require(_0x951f('0x0'));module[_0x951f('0x1')]={'type':{'type':Sequelize[_0x951f('0x2')]('string',_0x951f('0x3'),_0x951f('0x4'),_0x951f('0x5'),_0x951f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x951f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x951f('0x8'),_0x951f('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x951f('0x7')]},'nameField':{'type':Sequelize[_0x951f('0x7')]},'customField':{'type':Sequelize[_0x951f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x951f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 96978ec..259584b 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 _0x9df6=['hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','length','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','set','json','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0xb15b66,_0x2f4694){var _0x353fb1=function(_0x13461a){while(--_0x13461a){_0xb15b66['push'](_0xb15b66['shift']());}};_0x353fb1(++_0x2f4694);}(_0x9df6,0x1ca));var _0x69df=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x9df6[_0x521929];return _0x632436;};'use strict';var emlformat=require(_0x69df('0x0'));var rimraf=require(_0x69df('0x1'));var zipdir=require(_0x69df('0x2'));var jsonpatch=require(_0x69df('0x3'));var rp=require(_0x69df('0x4'));var moment=require('moment');var BPromise=require(_0x69df('0x5'));var Mustache=require(_0x69df('0x6'));var util=require(_0x69df('0x7'));var path=require('path');var sox=require(_0x69df('0x8'));var csv=require('to-csv');var ejs=require(_0x69df('0x9'));var fs=require('fs');var fs_extra=require(_0x69df('0xa'));var _=require(_0x69df('0xb'));var squel=require(_0x69df('0xc'));var crypto=require(_0x69df('0xd'));var jsforce=require(_0x69df('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x69df('0xf'));var Papa=require(_0x69df('0x10'));var Redis=require(_0x69df('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69df('0x12'));var as=require(_0x69df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x69df('0x14'));var licenseUtil=require(_0x69df('0x15'));var db=require(_0x69df('0x16'))['db'];function respondWithStatusCode(_0xdee159,_0x227558){_0x227558=_0x227558||0xcc;return function(_0x2d0175){if(_0x2d0175){return _0xdee159['sendStatus'](_0x227558);}return _0xdee159[_0x69df('0x17')](_0x227558)['end']();};}function respondWithResult(_0x327cfa,_0x24652d){_0x24652d=_0x24652d||0xc8;return function(_0xcc7011){if(_0xcc7011){return _0x327cfa[_0x69df('0x17')](_0x24652d)['json'](_0xcc7011);}};}function respondWithFilteredResult(_0x213be5,_0x42e703){return function(_0x19ce18){if(_0x19ce18){var _0x4b2cbc=typeof _0x42e703[_0x69df('0x18')]===_0x69df('0x19')&&typeof _0x42e703['limit']===_0x69df('0x19');var _0x537029=_0x19ce18['count'];var _0x31b82e=_0x4b2cbc?0x0:_0x42e703[_0x69df('0x18')];var _0x324bf0=_0x4b2cbc?_0x19ce18['count']:_0x42e703[_0x69df('0x18')]+_0x42e703[_0x69df('0x1a')];var _0x36a9f5;if(_0x324bf0>=_0x537029){_0x324bf0=_0x537029;_0x36a9f5=0xc8;}else{_0x36a9f5=0xce;}_0x213be5[_0x69df('0x17')](_0x36a9f5);return _0x213be5[_0x69df('0x1b')]('Content-Range',_0x31b82e+'-'+_0x324bf0+'/'+_0x537029)[_0x69df('0x1c')](_0x19ce18);}return null;};}function patchUpdates(_0x229c9c){return function(_0x29b8f4){try{jsonpatch[_0x69df('0x1d')](_0x29b8f4,_0x229c9c,!![]);}catch(_0x43ff4d){return BPromise[_0x69df('0x1e')](_0x43ff4d);}return _0x29b8f4[_0x69df('0x1f')]();};}function saveUpdates(_0x5d69df,_0x35a43e){return function(_0x2a9ad2){if(_0x2a9ad2){return _0x2a9ad2['update'](_0x5d69df)[_0x69df('0x20')](function(_0x535119){return _0x535119;});}return null;};}function removeEntity(_0x216f8b,_0x2a58f9){return function(_0x4ee073){if(_0x4ee073){return _0x4ee073[_0x69df('0x21')]()[_0x69df('0x20')](function(){_0x216f8b[_0x69df('0x17')](0xcc)[_0x69df('0x22')]();});}};}function handleEntityNotFound(_0x379b5c,_0xe68058){return function(_0xadcb70){if(!_0xadcb70){_0x379b5c[_0x69df('0x23')](0x194);}return _0xadcb70;};}function handleError(_0x1a1c87,_0x1e7d97){_0x1e7d97=_0x1e7d97||0x1f4;return function(_0x25f714){logger['error'](_0x25f714[_0x69df('0x24')]);if(_0x25f714[_0x69df('0x25')]){delete _0x25f714[_0x69df('0x25')];}_0x1a1c87['status'](_0x1e7d97)[_0x69df('0x26')](_0x25f714);};}exports[_0x69df('0x27')]=function(_0x45f280,_0x49f6dd){var _0x417f32={},_0xed4a75={},_0x1075ef={'count':0x0,'rows':[]};var _0x4f6cdd=_[_0x69df('0x28')](db[_0x69df('0x29')][_0x69df('0x2a')],function(_0xdf7ec3){return{'name':_0xdf7ec3[_0x69df('0x2b')],'type':_0xdf7ec3[_0x69df('0x2c')][_0x69df('0x2d')]};});_0xed4a75['model']=_[_0x69df('0x28')](_0x4f6cdd,_0x69df('0x25'));_0xed4a75[_0x69df('0x2e')]=_[_0x69df('0x2f')](_0x45f280[_0x69df('0x2e')]);_0xed4a75[_0x69df('0x30')]=_['intersection'](_0xed4a75[_0x69df('0x31')],_0xed4a75[_0x69df('0x2e')]);_0x417f32[_0x69df('0x32')]=_[_0x69df('0x33')](_0xed4a75[_0x69df('0x31')],qs['fields'](_0x45f280[_0x69df('0x2e')][_0x69df('0x34')]));_0x417f32['attributes']=_0x417f32[_0x69df('0x32')]['length']?_0x417f32['attributes']:_0xed4a75[_0x69df('0x31')];if(!_0x45f280['query'][_0x69df('0x35')](_0x69df('0x36'))){_0x417f32[_0x69df('0x1a')]=qs[_0x69df('0x1a')](_0x45f280['query'][_0x69df('0x1a')]);_0x417f32[_0x69df('0x18')]=qs['offset'](_0x45f280[_0x69df('0x2e')]['offset']);}_0x417f32['order']=qs['sort'](_0x45f280[_0x69df('0x2e')]['sort']);_0x417f32[_0x69df('0x37')]=qs[_0x69df('0x30')](_[_0x69df('0x38')](_0x45f280[_0x69df('0x2e')],_0xed4a75[_0x69df('0x30')]),_0x4f6cdd);if(_0x45f280[_0x69df('0x2e')][_0x69df('0x39')]){_0x417f32[_0x69df('0x37')]=_[_0x69df('0x3a')](_0x417f32[_0x69df('0x37')],{'$or':_[_0x69df('0x28')](_0x4f6cdd,function(_0x528e47){if(_0x528e47[_0x69df('0x2c')]!==_0x69df('0x3b')){var _0x2e77e3={};_0x2e77e3[_0x528e47[_0x69df('0x25')]]={'$like':'%'+_0x45f280[_0x69df('0x2e')]['filter']+'%'};return _0x2e77e3;}})});}_0x417f32=_[_0x69df('0x3a')]({},_0x417f32,_0x45f280['options']);var _0x1a495f={'where':_0x417f32[_0x69df('0x37')]};return db[_0x69df('0x29')][_0x69df('0x3c')](_0x1a495f)[_0x69df('0x20')](function(_0x565a27){_0x1075ef[_0x69df('0x3c')]=_0x565a27;if(_0x45f280['query'][_0x69df('0x3d')]){_0x417f32[_0x69df('0x3e')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x417f32);})[_0x69df('0x20')](function(_0x5e9fc6){_0x1075ef[_0x69df('0x3f')]=_0x5e9fc6;return _0x1075ef;})[_0x69df('0x20')](respondWithFilteredResult(_0x49f6dd,_0x417f32))[_0x69df('0x40')](handleError(_0x49f6dd,null));};exports[_0x69df('0x41')]=function(_0x87a123,_0x174b5d){var _0x455097={'raw':!![],'where':{'id':_0x87a123[_0x69df('0x42')]['id']}},_0x2f5218={};_0x2f5218['model']=_[_0x69df('0x2f')](db[_0x69df('0x29')][_0x69df('0x2a')]);_0x2f5218['query']=_['keys'](_0x87a123[_0x69df('0x2e')]);_0x2f5218[_0x69df('0x30')]=_[_0x69df('0x33')](_0x2f5218[_0x69df('0x31')],_0x2f5218[_0x69df('0x2e')]);_0x455097[_0x69df('0x32')]=_[_0x69df('0x33')](_0x2f5218[_0x69df('0x31')],qs['fields'](_0x87a123['query'][_0x69df('0x34')]));_0x455097[_0x69df('0x32')]=_0x455097[_0x69df('0x32')][_0x69df('0x43')]?_0x455097[_0x69df('0x32')]:_0x2f5218[_0x69df('0x31')];if(_0x87a123[_0x69df('0x2e')]['includeAll']){_0x455097[_0x69df('0x3e')]=[{'all':!![]}];}_0x455097=_[_0x69df('0x3a')]({},_0x455097,_0x87a123[_0x69df('0x44')]);return db[_0x69df('0x29')][_0x69df('0x45')](_0x455097)[_0x69df('0x20')](handleEntityNotFound(_0x174b5d,null))[_0x69df('0x20')](respondWithResult(_0x174b5d,null))[_0x69df('0x40')](handleError(_0x174b5d,null));};exports[_0x69df('0x46')]=function(_0xa01f9c,_0xb1e3c){return db[_0x69df('0x29')][_0x69df('0x46')](_0xa01f9c[_0x69df('0x47')],{})[_0x69df('0x20')](respondWithResult(_0xb1e3c,0xc9))[_0x69df('0x40')](handleError(_0xb1e3c,null));};exports[_0x69df('0x48')]=function(_0x478088,_0x354487){if(_0x478088['body']['id']){delete _0x478088['body']['id'];}return db[_0x69df('0x29')]['find']({'where':{'id':_0x478088['params']['id']}})[_0x69df('0x20')](handleEntityNotFound(_0x354487,null))[_0x69df('0x20')](saveUpdates(_0x478088[_0x69df('0x47')],null))[_0x69df('0x20')](respondWithResult(_0x354487,null))['catch'](handleError(_0x354487,null));};exports['destroy']=function(_0x313070,_0x552c13){return db[_0x69df('0x29')][_0x69df('0x45')]({'where':{'id':_0x313070[_0x69df('0x42')]['id']}})[_0x69df('0x20')](handleEntityNotFound(_0x552c13,null))['then'](removeEntity(_0x552c13,null))[_0x69df('0x40')](handleError(_0x552c13,null));}; \ No newline at end of file +var _0xbf99=['mustache','util','path','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','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','ZendeskField','include','show','params','length','includeAll','options','find','create','body','catch','eml-format','zip-dir','request-promise','moment'];(function(_0x37b469,_0x4cd688){var _0x564014=function(_0x4b7cbf){while(--_0x4b7cbf){_0x37b469['push'](_0x37b469['shift']());}};_0x564014(++_0x4cd688);}(_0xbf99,0x8e));var _0x9bf9=function(_0x32ea6c,_0x20fe5e){_0x32ea6c=_0x32ea6c-0x0;var _0x399b11=_0xbf99[_0x32ea6c];return _0x399b11;};'use strict';var emlformat=require(_0x9bf9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bf9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bf9('0x2'));var moment=require(_0x9bf9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9bf9('0x4'));var util=require(_0x9bf9('0x5'));var path=require(_0x9bf9('0x6'));var sox=require(_0x9bf9('0x7'));var csv=require(_0x9bf9('0x8'));var ejs=require(_0x9bf9('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf9('0xa'));var _=require(_0x9bf9('0xb'));var squel=require(_0x9bf9('0xc'));var crypto=require(_0x9bf9('0xd'));var jsforce=require(_0x9bf9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9bf9('0x8'));var querystring=require(_0x9bf9('0xf'));var Papa=require('papaparse');var Redis=require(_0x9bf9('0x10'));var authService=require(_0x9bf9('0x11'));var qs=require(_0x9bf9('0x12'));var as=require(_0x9bf9('0x13'));var hardwareService=require(_0x9bf9('0x14'));var logger=require(_0x9bf9('0x15'))(_0x9bf9('0x16'));var utils=require(_0x9bf9('0x17'));var config=require(_0x9bf9('0x18'));var licenseUtil=require(_0x9bf9('0x19'));var db=require(_0x9bf9('0x1a'))['db'];function respondWithStatusCode(_0x5b405e,_0x1e778d){_0x1e778d=_0x1e778d||0xcc;return function(_0x5b4f02){if(_0x5b4f02){return _0x5b405e['sendStatus'](_0x1e778d);}return _0x5b405e['status'](_0x1e778d)[_0x9bf9('0x1b')]();};}function respondWithResult(_0x42b025,_0x3c9187){_0x3c9187=_0x3c9187||0xc8;return function(_0x477b8d){if(_0x477b8d){return _0x42b025[_0x9bf9('0x1c')](_0x3c9187)[_0x9bf9('0x1d')](_0x477b8d);}};}function respondWithFilteredResult(_0x182b05,_0x4b8e84){return function(_0x234f52){if(_0x234f52){var _0x269e03=typeof _0x4b8e84[_0x9bf9('0x1e')]===_0x9bf9('0x1f')&&typeof _0x4b8e84[_0x9bf9('0x20')]===_0x9bf9('0x1f');var _0x46a936=_0x234f52[_0x9bf9('0x21')];var _0x142bbe=_0x269e03?0x0:_0x4b8e84['offset'];var _0x1e8964=_0x269e03?_0x234f52['count']:_0x4b8e84['offset']+_0x4b8e84['limit'];var _0x4d792f;if(_0x1e8964>=_0x46a936){_0x1e8964=_0x46a936;_0x4d792f=0xc8;}else{_0x4d792f=0xce;}_0x182b05[_0x9bf9('0x1c')](_0x4d792f);return _0x182b05['set']('Content-Range',_0x142bbe+'-'+_0x1e8964+'/'+_0x46a936)[_0x9bf9('0x1d')](_0x234f52);}return null;};}function patchUpdates(_0x3820fc){return function(_0x184b1c){try{jsonpatch[_0x9bf9('0x22')](_0x184b1c,_0x3820fc,!![]);}catch(_0x14ea85){return BPromise[_0x9bf9('0x23')](_0x14ea85);}return _0x184b1c[_0x9bf9('0x24')]();};}function saveUpdates(_0x29c623,_0x5e2eb5){return function(_0xd4f711){if(_0xd4f711){return _0xd4f711[_0x9bf9('0x25')](_0x29c623)[_0x9bf9('0x26')](function(_0x582a40){return _0x582a40;});}return null;};}function removeEntity(_0x97439a,_0x5d1e27){return function(_0x37bf68){if(_0x37bf68){return _0x37bf68[_0x9bf9('0x27')]()[_0x9bf9('0x26')](function(){_0x97439a[_0x9bf9('0x1c')](0xcc)[_0x9bf9('0x1b')]();});}};}function handleEntityNotFound(_0x38dfd8,_0x3003e7){return function(_0x367170){if(!_0x367170){_0x38dfd8[_0x9bf9('0x28')](0x194);}return _0x367170;};}function handleError(_0x5dbc1b,_0x5b1639){_0x5b1639=_0x5b1639||0x1f4;return function(_0x2538cd){logger['error'](_0x2538cd[_0x9bf9('0x29')]);if(_0x2538cd[_0x9bf9('0x2a')]){delete _0x2538cd['name'];}_0x5dbc1b[_0x9bf9('0x1c')](_0x5b1639)[_0x9bf9('0x2b')](_0x2538cd);};}exports[_0x9bf9('0x2c')]=function(_0x4eff8d,_0x5d8b8a){var _0x50218b={},_0x43f52d={},_0x266be3={'count':0x0,'rows':[]};var _0x5804e4=_[_0x9bf9('0x2d')](db['ZendeskField'][_0x9bf9('0x2e')],function(_0x406717){return{'name':_0x406717[_0x9bf9('0x2f')],'type':_0x406717[_0x9bf9('0x30')]['key']};});_0x43f52d[_0x9bf9('0x31')]=_[_0x9bf9('0x2d')](_0x5804e4,_0x9bf9('0x2a'));_0x43f52d[_0x9bf9('0x32')]=_[_0x9bf9('0x33')](_0x4eff8d['query']);_0x43f52d[_0x9bf9('0x34')]=_[_0x9bf9('0x35')](_0x43f52d['model'],_0x43f52d[_0x9bf9('0x32')]);_0x50218b['attributes']=_[_0x9bf9('0x35')](_0x43f52d['model'],qs[_0x9bf9('0x36')](_0x4eff8d['query']['fields']));_0x50218b['attributes']=_0x50218b[_0x9bf9('0x37')]['length']?_0x50218b[_0x9bf9('0x37')]:_0x43f52d['model'];if(!_0x4eff8d[_0x9bf9('0x32')]['hasOwnProperty'](_0x9bf9('0x38'))){_0x50218b[_0x9bf9('0x20')]=qs['limit'](_0x4eff8d[_0x9bf9('0x32')][_0x9bf9('0x20')]);_0x50218b[_0x9bf9('0x1e')]=qs[_0x9bf9('0x1e')](_0x4eff8d[_0x9bf9('0x32')][_0x9bf9('0x1e')]);}_0x50218b['order']=qs[_0x9bf9('0x39')](_0x4eff8d['query'][_0x9bf9('0x39')]);_0x50218b[_0x9bf9('0x3a')]=qs[_0x9bf9('0x34')](_[_0x9bf9('0x3b')](_0x4eff8d[_0x9bf9('0x32')],_0x43f52d['filters']),_0x5804e4);if(_0x4eff8d[_0x9bf9('0x32')][_0x9bf9('0x3c')]){_0x50218b[_0x9bf9('0x3a')]=_['merge'](_0x50218b['where'],{'$or':_[_0x9bf9('0x2d')](_0x5804e4,function(_0x4b67ba){if(_0x4b67ba[_0x9bf9('0x30')]!=='VIRTUAL'){var _0x3fe3e2={};_0x3fe3e2[_0x4b67ba[_0x9bf9('0x2a')]]={'$like':'%'+_0x4eff8d['query']['filter']+'%'};return _0x3fe3e2;}})});}_0x50218b=_[_0x9bf9('0x3d')]({},_0x50218b,_0x4eff8d['options']);var _0x24dda6={'where':_0x50218b[_0x9bf9('0x3a')]};return db[_0x9bf9('0x3e')][_0x9bf9('0x21')](_0x24dda6)['then'](function(_0x1cdfd7){_0x266be3[_0x9bf9('0x21')]=_0x1cdfd7;if(_0x4eff8d['query']['includeAll']){_0x50218b[_0x9bf9('0x3f')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x50218b);})['then'](function(_0x4c0efb){_0x266be3['rows']=_0x4c0efb;return _0x266be3;})[_0x9bf9('0x26')](respondWithFilteredResult(_0x5d8b8a,_0x50218b))['catch'](handleError(_0x5d8b8a,null));};exports[_0x9bf9('0x40')]=function(_0x14d156,_0x276ba9){var _0x292a23={'raw':!![],'where':{'id':_0x14d156[_0x9bf9('0x41')]['id']}},_0x43a843={};_0x43a843[_0x9bf9('0x31')]=_[_0x9bf9('0x33')](db['ZendeskField'][_0x9bf9('0x2e')]);_0x43a843[_0x9bf9('0x32')]=_['keys'](_0x14d156[_0x9bf9('0x32')]);_0x43a843['filters']=_[_0x9bf9('0x35')](_0x43a843[_0x9bf9('0x31')],_0x43a843[_0x9bf9('0x32')]);_0x292a23['attributes']=_['intersection'](_0x43a843['model'],qs['fields'](_0x14d156['query'][_0x9bf9('0x36')]));_0x292a23['attributes']=_0x292a23[_0x9bf9('0x37')][_0x9bf9('0x42')]?_0x292a23[_0x9bf9('0x37')]:_0x43a843[_0x9bf9('0x31')];if(_0x14d156[_0x9bf9('0x32')][_0x9bf9('0x43')]){_0x292a23['include']=[{'all':!![]}];}_0x292a23=_[_0x9bf9('0x3d')]({},_0x292a23,_0x14d156[_0x9bf9('0x44')]);return db[_0x9bf9('0x3e')][_0x9bf9('0x45')](_0x292a23)[_0x9bf9('0x26')](handleEntityNotFound(_0x276ba9,null))[_0x9bf9('0x26')](respondWithResult(_0x276ba9,null))['catch'](handleError(_0x276ba9,null));};exports[_0x9bf9('0x46')]=function(_0x1a3512,_0x4bccc7){return db['ZendeskField'][_0x9bf9('0x46')](_0x1a3512['body'],{})['then'](respondWithResult(_0x4bccc7,0xc9))['catch'](handleError(_0x4bccc7,null));};exports['update']=function(_0x448aa2,_0x43a3a0){if(_0x448aa2[_0x9bf9('0x47')]['id']){delete _0x448aa2['body']['id'];}return db[_0x9bf9('0x3e')][_0x9bf9('0x45')]({'where':{'id':_0x448aa2[_0x9bf9('0x41')]['id']}})[_0x9bf9('0x26')](handleEntityNotFound(_0x43a3a0,null))[_0x9bf9('0x26')](saveUpdates(_0x448aa2['body'],null))[_0x9bf9('0x26')](respondWithResult(_0x43a3a0,null))[_0x9bf9('0x48')](handleError(_0x43a3a0,null));};exports[_0x9bf9('0x27')]=function(_0x1fd3e1,_0x3a6a9d){return db[_0x9bf9('0x3e')][_0x9bf9('0x45')]({'where':{'id':_0x1fd3e1[_0x9bf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a6a9d,null))[_0x9bf9('0x26')](removeEntity(_0x3a6a9d,null))['catch'](handleError(_0x3a6a9d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 80d3c6e..a860a58 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 _0xf9f5=['exports','define','zendesk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x22049d,_0x4705bd){var _0x121668=function(_0x1d7716){while(--_0x1d7716){_0x22049d['push'](_0x22049d['shift']());}};_0x121668(++_0x4705bd);}(_0xf9f5,0x1a8));var _0x5f9f=function(_0x595300,_0x479175){_0x595300=_0x595300-0x0;var _0x4827de=_0xf9f5[_0x595300];return _0x4827de;};'use strict';var _=require(_0x5f9f('0x0'));var util=require(_0x5f9f('0x1'));var logger=require(_0x5f9f('0x2'))(_0x5f9f('0x3'));var moment=require('moment');var BPromise=require(_0x5f9f('0x4'));var rp=require(_0x5f9f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f9f('0x6'));var config=require(_0x5f9f('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x5f9f('0x8')]=function(_0xfd346e,_0x387aee){return _0xfd346e[_0x5f9f('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x5f9f('0xa'),'fields':[_0x5f9f('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf02e=['FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x35ad27,_0x1a37f1){var _0x159aa1=function(_0x1b9ead){while(--_0x1b9ead){_0x35ad27['push'](_0x35ad27['shift']());}};_0x159aa1(++_0x1a37f1);}(_0xf02e,0xb5));var _0xef02=function(_0x21f10f,_0x4adae4){_0x21f10f=_0x21f10f-0x0;var _0x48a731=_0xf02e[_0x21f10f];return _0x48a731;};'use strict';var _=require('lodash');var util=require(_0xef02('0x0'));var logger=require('../../config/logger')(_0xef02('0x1'));var moment=require(_0xef02('0x2'));var BPromise=require(_0xef02('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef02('0x4'));var rimraf=require(_0xef02('0x5'));var config=require(_0xef02('0x6'));var attributes=require(_0xef02('0x7'));module[_0xef02('0x8')]=function(_0x51b10f,_0x24231c){return _0x51b10f[_0xef02('0x9')](_0xef02('0xa'),attributes,{'tableName':_0xef02('0xb'),'paranoid':![],'indexes':[{'name':_0xef02('0xc'),'fields':[_0xef02('0xd'),_0xef02('0xe')],'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 a13ab8c..016b7ba 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 _0x7630=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x46da34,_0x506caa){var _0x944b1a=function(_0x4d31ba){while(--_0x4d31ba){_0x46da34['push'](_0x46da34['shift']());}};_0x944b1a(++_0x506caa);}(_0x7630,0x19c));var _0x0763=function(_0x40d9d9,_0x11843e){_0x40d9d9=_0x40d9d9-0x0;var _0x4dcc2b=_0x7630[_0x40d9d9];return _0x4dcc2b;};'use strict';var _=require(_0x0763('0x0'));var util=require('util');var moment=require(_0x0763('0x1'));var BPromise=require(_0x0763('0x2'));var rs=require(_0x0763('0x3'));var fs=require('fs');var Redis=require(_0x0763('0x4'));var db=require(_0x0763('0x5'))['db'];var utils=require(_0x0763('0x6'));var logger=require(_0x0763('0x7'))(_0x0763('0x8'));var config=require(_0x0763('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0763('0xa')][_0x0763('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aab33,_0x4a7127,_0xae0596){return new BPromise(function(_0x5e2b3f,_0x4af37b){return client[_0x0763('0xc')](_0x2aab33,_0xae0596)[_0x0763('0xd')](function(_0xed3c66){logger[_0x0763('0xe')](_0x0763('0xf'),_0x4a7127,_0x0763('0x10'));logger['debug'](_0x0763('0x11'),_0x4a7127,_0x0763('0x10'),JSON['stringify'](_0xed3c66));if(_0xed3c66[_0x0763('0x12')]){if(_0xed3c66[_0x0763('0x12')]['code']===0x1f4){logger['error'](_0x0763('0xf'),_0x4a7127,_0xed3c66['error'][_0x0763('0x13')]);return _0x4af37b(_0xed3c66[_0x0763('0x12')][_0x0763('0x13')]);}logger[_0x0763('0x12')](_0x0763('0xf'),_0x4a7127,_0xed3c66[_0x0763('0x12')][_0x0763('0x13')]);return _0x5e2b3f(_0xed3c66[_0x0763('0x12')][_0x0763('0x13')]);}else{logger[_0x0763('0xe')](_0x0763('0xf'),_0x4a7127,_0x0763('0x10'));_0x5e2b3f(_0xed3c66[_0x0763('0x14')][_0x0763('0x13')]);}})[_0x0763('0x15')](function(_0x26dfca){logger[_0x0763('0x12')]('ZendeskField,\x20%s,\x20%s',_0x4a7127,_0x26dfca);_0x4af37b(_0x26dfca);});});} \ No newline at end of file +var _0xec4c=['../../config/utils','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x152ea8,_0x3fb53f){var _0x4c0ebe=function(_0x1c2641){while(--_0x1c2641){_0x152ea8['push'](_0x152ea8['shift']());}};_0x4c0ebe(++_0x3fb53f);}(_0xec4c,0x1f3));var _0xcec4=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xec4c[_0x3fb9dd];return _0x20136a;};'use strict';var _=require(_0xcec4('0x0'));var util=require(_0xcec4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcec4('0x2'));var fs=require('fs');var Redis=require(_0xcec4('0x3'));var db=require(_0xcec4('0x4'))['db'];var utils=require(_0xcec4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcec4('0x6'));var client=jayson[_0xcec4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6378,_0x155293,_0x532e01){return new BPromise(function(_0x183c16,_0x82635f){return client[_0xcec4('0x8')](_0x1d6378,_0x532e01)[_0xcec4('0x9')](function(_0x3fd36d){logger[_0xcec4('0xa')]('ZendeskField,\x20%s,\x20%s',_0x155293,'request\x20sent');logger['debug'](_0xcec4('0xb'),_0x155293,'request\x20sent',JSON[_0xcec4('0xc')](_0x3fd36d));if(_0x3fd36d[_0xcec4('0xd')]){if(_0x3fd36d[_0xcec4('0xd')][_0xcec4('0xe')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x155293,_0x3fd36d[_0xcec4('0xd')][_0xcec4('0xf')]);return _0x82635f(_0x3fd36d['error'][_0xcec4('0xf')]);}logger[_0xcec4('0xd')](_0xcec4('0x10'),_0x155293,_0x3fd36d['error'][_0xcec4('0xf')]);return _0x183c16(_0x3fd36d['error']['message']);}else{logger[_0xcec4('0xa')](_0xcec4('0x10'),_0x155293,'request\x20sent');_0x183c16(_0x3fd36d['result'][_0xcec4('0xf')]);}})[_0xcec4('0x11')](function(_0x4878de){logger[_0xcec4('0xd')](_0xcec4('0x10'),_0x155293,_0x4878de);_0x82635f(_0x4878de);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 5c4848a..278244f 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 _0x5a55=['/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x8c604c,_0xf65a17){var _0x4df905=function(_0x1c4637){while(--_0x1c4637){_0x8c604c['push'](_0x8c604c['shift']());}};_0x4df905(++_0xf65a17);}(_0x5a55,0xe6));var _0x55a5=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x5a55[_0x40b493];return _0x548365;};'use strict';var multer=require(_0x55a5('0x0'));var util=require(_0x55a5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x55a5('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x55a5('0x3'));var config=require(_0x55a5('0x4'));var controller=require('./intZohoAccount.controller');router[_0x55a5('0x5')]('/',auth[_0x55a5('0x6')](),controller[_0x55a5('0x7')]);router[_0x55a5('0x5')](_0x55a5('0x8'),auth[_0x55a5('0x6')](),controller[_0x55a5('0x9')]);router[_0x55a5('0x5')](_0x55a5('0xa'),auth[_0x55a5('0x6')](),controller['getConfigurations']);router[_0x55a5('0x5')]('/:id/fields',auth[_0x55a5('0x6')](),controller[_0x55a5('0xb')]);router[_0x55a5('0xc')]('/',auth[_0x55a5('0x6')](),controller[_0x55a5('0xd')]);router[_0x55a5('0xc')]('/:id/configurations',auth[_0x55a5('0x6')](),controller[_0x55a5('0xe')]);router[_0x55a5('0xf')](_0x55a5('0x8'),auth[_0x55a5('0x6')](),controller[_0x55a5('0x10')]);router[_0x55a5('0x11')](_0x55a5('0x8'),auth[_0x55a5('0x6')](),controller[_0x55a5('0x12')]);module[_0x55a5('0x13')]=router; \ No newline at end of file +var _0x3412=['addConfiguration','put','update','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x3412,0xd4));var _0x2341=function(_0x47d5ca,_0x341796){_0x47d5ca=_0x47d5ca-0x0;var _0xd9de9a=_0x3412[_0x47d5ca];return _0xd9de9a;};'use strict';var multer=require(_0x2341('0x0'));var util=require(_0x2341('0x1'));var path=require(_0x2341('0x2'));var timeout=require(_0x2341('0x3'));var express=require(_0x2341('0x4'));var router=express['Router']();var fs_extra=require(_0x2341('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2341('0x6'));var config=require(_0x2341('0x7'));var controller=require(_0x2341('0x8'));router[_0x2341('0x9')]('/',auth[_0x2341('0xa')](),controller[_0x2341('0xb')]);router[_0x2341('0x9')]('/:id',auth[_0x2341('0xa')](),controller['show']);router['get']('/:id/configurations',auth[_0x2341('0xa')](),controller[_0x2341('0xc')]);router['get'](_0x2341('0xd'),auth[_0x2341('0xa')](),controller[_0x2341('0xe')]);router[_0x2341('0xf')]('/',auth[_0x2341('0xa')](),controller[_0x2341('0x10')]);router['post'](_0x2341('0x11'),auth[_0x2341('0xa')](),controller[_0x2341('0x12')]);router[_0x2341('0x13')]('/:id',auth[_0x2341('0xa')](),controller[_0x2341('0x14')]);router['delete'](_0x2341('0x15'),auth[_0x2341('0xa')](),controller['destroy']);module[_0x2341('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9c4c31b..de16a0b 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['exports','STRING','sequelize'];(function(_0x43a568,_0x5776b6){var _0x3d61de=function(_0x744d2e){while(--_0x744d2e){_0x43a568['push'](_0x43a568['shift']());}};_0x3d61de(++_0x5776b6);}(_0xe14d,0x1ee));var _0xde14=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xe14d[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file +var _0x55e0=['STRING','sequelize','exports'];(function(_0xb17208,_0x16f568){var _0x160444=function(_0x20e377){while(--_0x20e377){_0xb17208['push'](_0xb17208['shift']());}};_0x160444(++_0x16f568);}(_0x55e0,0xdc));var _0x055e=function(_0x2b1655,_0x3fdd7b){_0x2b1655=_0x2b1655-0x0;var _0x16d108=_0x55e0[_0x2b1655];return _0x16d108;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'name':{'type':Sequelize[_0x055e('0x2')]},'description':{'type':Sequelize[_0x055e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x055e('0x2')]},'clientSecret':{'type':Sequelize[_0x055e('0x2')]},'serverUrl':{'type':Sequelize[_0x055e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x055e('0x2')]},'refreshToken':{'type':Sequelize[_0x055e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6339803..a192465 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 _0x609f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','getConfigurations','ZohoConfiguration','sort','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','refreshToken','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','clientSecret','serverUrl','code','host','zoho.eu','com','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','includes','system_mandatory','push','display_label','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x5acd55,_0x31fe62){var _0x72f7d5=function(_0x11bb6a){while(--_0x11bb6a){_0x5acd55['push'](_0x5acd55['shift']());}};_0x72f7d5(++_0x31fe62);}(_0x609f,0x170));var _0xf609=function(_0x1ca903,_0x197849){_0x1ca903=_0x1ca903-0x0;var _0x25826f=_0x609f[_0x1ca903];return _0x25826f;};'use strict';var emlformat=require(_0xf609('0x0'));var rimraf=require(_0xf609('0x1'));var zipdir=require(_0xf609('0x2'));var jsonpatch=require(_0xf609('0x3'));var rp=require(_0xf609('0x4'));var moment=require(_0xf609('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf609('0x6'));var util=require('util');var path=require(_0xf609('0x7'));var sox=require(_0xf609('0x8'));var csv=require(_0xf609('0x9'));var ejs=require(_0xf609('0xa'));var fs=require('fs');var fs_extra=require(_0xf609('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf609('0xc'));var jsforce=require(_0xf609('0xd'));var deskjs=require(_0xf609('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf609('0xf'));var Papa=require(_0xf609('0x10'));var Redis=require(_0xf609('0x11'));var authService=require(_0xf609('0x12'));var qs=require(_0xf609('0x13'));var as=require(_0xf609('0x14'));var hardwareService=require(_0xf609('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf609('0x16'));var config=require(_0xf609('0x17'));var licenseUtil=require(_0xf609('0x18'));var db=require(_0xf609('0x19'))['db'];var integrations=require(_0xf609('0x1a'));function respondWithStatusCode(_0x4fb4a3,_0x5a6560){_0x5a6560=_0x5a6560||0xcc;return function(_0x3540c6){if(_0x3540c6){return _0x4fb4a3[_0xf609('0x1b')](_0x5a6560);}return _0x4fb4a3[_0xf609('0x1c')](_0x5a6560)[_0xf609('0x1d')]();};}function respondWithResult(_0x12758c,_0x3e42ac){_0x3e42ac=_0x3e42ac||0xc8;return function(_0x10f43e){if(_0x10f43e){return _0x12758c['status'](_0x3e42ac)[_0xf609('0x1e')](_0x10f43e);}};}function respondWithFilteredResult(_0x15bb8b,_0x1d22bf){return function(_0x4d2d24){if(_0x4d2d24){var _0x3ad985=typeof _0x1d22bf[_0xf609('0x1f')]===_0xf609('0x20')&&typeof _0x1d22bf['limit']==='undefined';var _0x15e5cb=_0x4d2d24['count'];var _0x28b790=_0x3ad985?0x0:_0x1d22bf[_0xf609('0x1f')];var _0x25b9ff=_0x3ad985?_0x4d2d24[_0xf609('0x21')]:_0x1d22bf['offset']+_0x1d22bf[_0xf609('0x22')];var _0x25e1a5;if(_0x25b9ff>=_0x15e5cb){_0x25b9ff=_0x15e5cb;_0x25e1a5=0xc8;}else{_0x25e1a5=0xce;}_0x15bb8b['status'](_0x25e1a5);return _0x15bb8b[_0xf609('0x23')](_0xf609('0x24'),_0x28b790+'-'+_0x25b9ff+'/'+_0x15e5cb)[_0xf609('0x1e')](_0x4d2d24);}return null;};}function patchUpdates(_0x32d8da){return function(_0x16fe8b){try{jsonpatch[_0xf609('0x25')](_0x16fe8b,_0x32d8da,!![]);}catch(_0x4eb75b){return BPromise[_0xf609('0x26')](_0x4eb75b);}return _0x16fe8b[_0xf609('0x27')]();};}function saveUpdates(_0x368515,_0x2db8eb){return function(_0x36d320){if(_0x36d320){return _0x36d320[_0xf609('0x28')](_0x368515)[_0xf609('0x29')](function(_0x227070){return _0x227070;});}return null;};}function removeEntity(_0x8b60dd,_0x4a8096){return function(_0x280041){if(_0x280041){return _0x280041[_0xf609('0x2a')]()[_0xf609('0x29')](function(){_0x8b60dd['status'](0xcc)[_0xf609('0x1d')]();});}};}function handleEntityNotFound(_0x104690,_0xa86bbf){return function(_0x4cd236){if(!_0x4cd236){_0x104690[_0xf609('0x1b')](0x194);}return _0x4cd236;};}function handleError(_0x30558,_0x4cee78){_0x4cee78=_0x4cee78||0x1f4;return function(_0x182298){logger[_0xf609('0x2b')](_0x182298[_0xf609('0x2c')]);if(_0x182298['name']){delete _0x182298[_0xf609('0x2d')];}_0x30558[_0xf609('0x1c')](_0x4cee78)[_0xf609('0x2e')](_0x182298);};}exports['index']=function(_0x5e4e91,_0x472ef2){var _0x4e7910={},_0x40683f={},_0x17a94a={'count':0x0,'rows':[]};var _0x185b9b=_[_0xf609('0x2f')](db[_0xf609('0x30')][_0xf609('0x31')],function(_0x562d5d){return{'name':_0x562d5d[_0xf609('0x32')],'type':_0x562d5d[_0xf609('0x33')]['key']};});_0x40683f['model']=_[_0xf609('0x2f')](_0x185b9b,_0xf609('0x2d'));_0x40683f[_0xf609('0x34')]=_[_0xf609('0x35')](_0x5e4e91[_0xf609('0x34')]);_0x40683f[_0xf609('0x36')]=_[_0xf609('0x37')](_0x40683f[_0xf609('0x38')],_0x40683f[_0xf609('0x34')]);_0x4e7910[_0xf609('0x39')]=_['intersection'](_0x40683f[_0xf609('0x38')],qs['fields'](_0x5e4e91[_0xf609('0x34')][_0xf609('0x3a')]));_0x4e7910[_0xf609('0x39')]=_0x4e7910['attributes'][_0xf609('0x3b')]?_0x4e7910['attributes']:_0x40683f[_0xf609('0x38')];if(!_0x5e4e91['query'][_0xf609('0x3c')](_0xf609('0x3d'))){_0x4e7910[_0xf609('0x22')]=qs['limit'](_0x5e4e91['query'][_0xf609('0x22')]);_0x4e7910['offset']=qs['offset'](_0x5e4e91['query'][_0xf609('0x1f')]);}_0x4e7910[_0xf609('0x3e')]=qs['sort'](_0x5e4e91[_0xf609('0x34')]['sort']);_0x4e7910[_0xf609('0x3f')]=qs[_0xf609('0x36')](_[_0xf609('0x40')](_0x5e4e91[_0xf609('0x34')],_0x40683f[_0xf609('0x36')]),_0x185b9b);if(_0x5e4e91[_0xf609('0x34')]['filter']){_0x4e7910['where']=_[_0xf609('0x41')](_0x4e7910[_0xf609('0x3f')],{'$or':_['map'](_0x185b9b,function(_0x2f86d5){if(_0x2f86d5[_0xf609('0x33')]!=='VIRTUAL'){var _0x5b3231={};_0x5b3231[_0x2f86d5[_0xf609('0x2d')]]={'$like':'%'+_0x5e4e91[_0xf609('0x34')][_0xf609('0x42')]+'%'};return _0x5b3231;}})});}_0x4e7910=_[_0xf609('0x41')]({},_0x4e7910,_0x5e4e91[_0xf609('0x43')]);var _0x4eaf7c={'where':_0x4e7910[_0xf609('0x3f')]};return db[_0xf609('0x30')][_0xf609('0x21')](_0x4eaf7c)[_0xf609('0x29')](function(_0x49a271){_0x17a94a[_0xf609('0x21')]=_0x49a271;if(_0x5e4e91['query'][_0xf609('0x44')]){_0x4e7910['include']=[{'all':!![]}];}return db[_0xf609('0x30')][_0xf609('0x45')](_0x4e7910);})['then'](function(_0x4f727c){_0x17a94a[_0xf609('0x46')]=_0x4f727c;return _0x17a94a;})[_0xf609('0x29')](respondWithFilteredResult(_0x472ef2,_0x4e7910))[_0xf609('0x47')](handleError(_0x472ef2,null));};exports[_0xf609('0x48')]=function(_0x551980,_0x43dcb6){var _0x3b2d1e={'raw':![],'where':{'id':_0x551980[_0xf609('0x49')]['id']}},_0x51cb57={};_0x51cb57[_0xf609('0x38')]=_[_0xf609('0x35')](db[_0xf609('0x30')]['rawAttributes']);_0x51cb57[_0xf609('0x34')]=_[_0xf609('0x35')](_0x551980[_0xf609('0x34')]);_0x51cb57[_0xf609('0x36')]=_['intersection'](_0x51cb57['model'],_0x51cb57[_0xf609('0x34')]);_0x3b2d1e[_0xf609('0x39')]=_['intersection'](_0x51cb57[_0xf609('0x38')],qs[_0xf609('0x3a')](_0x551980['query'][_0xf609('0x3a')]));_0x3b2d1e[_0xf609('0x39')]=_0x3b2d1e[_0xf609('0x39')][_0xf609('0x3b')]?_0x3b2d1e[_0xf609('0x39')]:_0x51cb57['model'];if(_0x551980[_0xf609('0x34')]['includeAll']){_0x3b2d1e['include']=[{'all':!![]}];}_0x3b2d1e=_['merge']({},_0x3b2d1e,_0x551980[_0xf609('0x43')]);return db[_0xf609('0x30')][_0xf609('0x4a')](_0x3b2d1e)[_0xf609('0x29')](handleEntityNotFound(_0x43dcb6,null))[_0xf609('0x29')](respondWithResult(_0x43dcb6,null))[_0xf609('0x47')](handleError(_0x43dcb6,null));};exports[_0xf609('0x4b')]=function(_0x52a230,_0x5dc11a){return db[_0xf609('0x30')][_0xf609('0x4b')](_0x52a230[_0xf609('0x4c')],{})[_0xf609('0x29')](respondWithResult(_0x5dc11a,0xc9))[_0xf609('0x47')](handleError(_0x5dc11a,null));};exports[_0xf609('0x28')]=function(_0x53cfe3,_0x50eb3a){if(_0x53cfe3[_0xf609('0x4c')]['id']){delete _0x53cfe3[_0xf609('0x4c')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x53cfe3[_0xf609('0x49')]['id']}})[_0xf609('0x29')](handleEntityNotFound(_0x50eb3a,null))['then'](saveUpdates(_0x53cfe3[_0xf609('0x4c')],null))[_0xf609('0x29')](respondWithResult(_0x50eb3a,null))[_0xf609('0x47')](handleError(_0x50eb3a,null));};exports[_0xf609('0x2a')]=function(_0x28acdc,_0x168620){return db[_0xf609('0x30')][_0xf609('0x4a')]({'where':{'id':_0x28acdc[_0xf609('0x49')]['id']}})[_0xf609('0x29')](handleEntityNotFound(_0x168620,null))[_0xf609('0x29')](removeEntity(_0x168620,null))[_0xf609('0x47')](handleError(_0x168620,null));};exports[_0xf609('0x4d')]=function(_0x5dc0ca,_0x44b639,_0x2d2ab3){var _0x5571df={};var _0x4e02ad={};var _0x23799a;var _0x1057d9;return db['ZohoAccount']['findOne']({'where':{'id':_0x5dc0ca['params']['id']}})['then'](handleEntityNotFound(_0x44b639,null))[_0xf609('0x29')](function(_0x3f7c6f){if(_0x3f7c6f){_0x23799a=_0x3f7c6f;_0x4e02ad['model']=_[_0xf609('0x35')](db[_0xf609('0x4e')][_0xf609('0x31')]);_0x4e02ad[_0xf609('0x34')]=_[_0xf609('0x35')](_0x5dc0ca[_0xf609('0x34')]);_0x4e02ad[_0xf609('0x36')]=_[_0xf609('0x37')](_0x4e02ad['model'],_0x4e02ad[_0xf609('0x34')]);_0x5571df[_0xf609('0x39')]=_[_0xf609('0x37')](_0x4e02ad[_0xf609('0x38')],qs[_0xf609('0x3a')](_0x5dc0ca[_0xf609('0x34')][_0xf609('0x3a')]));_0x5571df[_0xf609('0x39')]=_0x5571df[_0xf609('0x39')][_0xf609('0x3b')]?_0x5571df['attributes']:_0x4e02ad[_0xf609('0x38')];_0x5571df[_0xf609('0x3e')]=qs['sort'](_0x5dc0ca['query'][_0xf609('0x4f')]);_0x5571df[_0xf609('0x3f')]=qs[_0xf609('0x36')](_[_0xf609('0x40')](_0x5dc0ca['query'],_0x4e02ad[_0xf609('0x36')]));if(_0x5dc0ca[_0xf609('0x34')][_0xf609('0x42')]){_0x5571df[_0xf609('0x3f')]=_[_0xf609('0x41')](_0x5571df[_0xf609('0x3f')],{'$or':_['map'](_0x5571df[_0xf609('0x39')],function(_0x240232){var _0x1047c8={};_0x1047c8[_0x240232]={'$like':'%'+_0x5dc0ca[_0xf609('0x34')][_0xf609('0x42')]+'%'};return _0x1047c8;})});}_0x5571df=_[_0xf609('0x41')]({},_0x5571df,_0x5dc0ca[_0xf609('0x43')]);return _0x23799a['getConfigurations'](_0x5571df);}})[_0xf609('0x29')](function(_0x11ee25){if(_0x11ee25){_0x1057d9=_0x11ee25[_0xf609('0x3b')];if(!_0x5dc0ca[_0xf609('0x34')][_0xf609('0x3c')]('nolimit')){_0x5571df[_0xf609('0x22')]=qs[_0xf609('0x22')](_0x5dc0ca[_0xf609('0x34')]['limit']);_0x5571df[_0xf609('0x1f')]=qs['offset'](_0x5dc0ca[_0xf609('0x34')][_0xf609('0x1f')]);}return _0x23799a[_0xf609('0x4d')](_0x5571df);}})['then'](function(_0x2752ec){if(_0x2752ec){return _0x2752ec?{'count':_0x1057d9,'rows':_0x2752ec}:null;}})['then'](respondWithResult(_0x44b639,null))['catch'](handleError(_0x44b639,null));};exports[_0xf609('0x50')]=function(_0x34f97b,_0x56e68b,_0x9eee20){if(_0x34f97b[_0xf609('0x4c')]['id']){delete _0x34f97b[_0xf609('0x4c')]['id'];}return db[_0xf609('0x30')][_0xf609('0x51')]({'where':{'id':_0x34f97b[_0xf609('0x49')]['id']}})[_0xf609('0x29')](handleEntityNotFound(_0x56e68b,null))[_0xf609('0x29')](function(_0x8062){if(_0x8062){_0x34f97b[_0xf609('0x4c')][_0xf609('0x52')]=_0x8062['id'];_0x34f97b['body'][_0xf609('0x53')]=integrations[_0xf609('0x54')](_0x34f97b[_0xf609('0x4c')][_0xf609('0x55')],_0x34f97b[_0xf609('0x4c')][_0xf609('0x33')]);_0x34f97b[_0xf609('0x4c')][_0xf609('0x56')]=integrations[_0xf609('0x57')](_0x34f97b['body'][_0xf609('0x55')],_0x34f97b[_0xf609('0x4c')][_0xf609('0x33')]);return db[_0xf609('0x4e')]['create'](_0x34f97b[_0xf609('0x4c')],{'include':[{'model':db[_0xf609('0x58')],'as':_0xf609('0x53')},{'model':db[_0xf609('0x58')],'as':_0xf609('0x56')}]});}return null;})[_0xf609('0x29')](respondWithResult(_0x56e68b,null))[_0xf609('0x47')](handleError(_0x56e68b,null));};function getAccessToken(_0x1ce93d){return new Promise(function(_0x26b034,_0x1d9182){var _0x5abb92;switch(_0x1ce93d['zone']){case'US':_0x5abb92=_0xf609('0x59');break;case'AU':_0x5abb92=_0xf609('0x5a');break;case'EU':_0x5abb92=_0xf609('0x5b');break;case'IN':_0x5abb92=_0xf609('0x5c');break;case'CN':_0x5abb92='https://accounts.zoho.com.cn';break;default:_0x5abb92=_0xf609('0x5b');break;}var _0x4afb18={'method':'POST','uri':_0x5abb92+'/oauth/v2/token','qs':{'refresh_token':_0x1ce93d[_0xf609('0x5d')],'client_id':_0x1ce93d['clientId'],'client_secret':_0x1ce93d['clientSecret'],'grant_type':_0xf609('0x5e')},'json':!![]};return rp(_0x4afb18)[_0xf609('0x29')](function(_0x3928f9){if(_0x3928f9[_0xf609('0x5f')]){_0x26b034(_0x3928f9[_0xf609('0x5f')]);}else{_0x1d9182(_0xf609('0x60'));}})['catch'](function(_0x51cd0f){_0x1d9182(_0x51cd0f);});});}exports[_0xf609('0x61')]=function(_0x2e67e1,_0x43e68f,_0x16af6e){var _0xeba2be,_0x266b6e,_0x44decf,_0x1c70a3,_0x1a3141;return db[_0xf609('0x30')][_0xf609('0x51')]({'where':{'id':_0x2e67e1['params']['id']},'attributes':['id','host',_0xf609('0x62'),'clientId',_0xf609('0x63'),_0xf609('0x64'),_0xf609('0x65'),_0xf609('0x5d')]})[_0xf609('0x29')](handleEntityNotFound(_0x43e68f,null))['then'](function(_0x17f951){_0x1a3141=_0x17f951;_0xeba2be=_0x1a3141[_0xf609('0x66')];_0x266b6e=_0xeba2be===_0xf609('0x67')?'eu':_0xf609('0x68');_0x44decf=_0x1a3141[_0xf609('0x64')];var _0x501a44=_0x44decf[_0xf609('0x69')](-0x1);if(_0x501a44==='/'||_0x501a44==='\x5c'||_0x501a44===':'){_0x44decf=_0x44decf[_0xf609('0x6a')](0x0,_0x44decf['lastIndexOf'](_0x501a44));}if(!_0x1a3141['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1a3141);})[_0xf609('0x29')](function(_0x561134){if(_0x561134){return rp({'method':_0xf609('0x6b'),'uri':util[_0xf609('0x6c')](_0xf609('0x6d'),_0x266b6e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xf609('0x6e')+_0x561134},'json':!![]});}})[_0xf609('0x29')](function(_0x19a1df){if(_0x19a1df){if(_0x19a1df[_0xf609('0x6f')]&&_0x19a1df[_0xf609('0x6f')][_0xf609('0x2b')]){throw new Error(_0x19a1df[_0xf609('0x6f')][_0xf609('0x2b')][_0xf609('0x70')]);}var _0x432773=[];var _0x12e825=[];var _0x37c0d7=[_0xf609('0x71'),_0xf609('0x72'),_0xf609('0x73'),_0xf609('0x74'),_0xf609('0x75'),_0xf609('0x76'),'Call_Start_Time',_0xf609('0x77')];_0x12e825=_['remove'](_0x19a1df[_0xf609('0x3a')],function(_0x378497){return _0x37c0d7[_0xf609('0x78')](_0x378497['api_name']);});for(var _0x34d490=0x0;_0x34d490<_0x12e825['length'];_0x34d490++){if(_0x12e825[_0x34d490][_0xf609('0x79')]===![]){_0x432773[_0xf609('0x7a')]({'id':_0x12e825[_0x34d490]['id'],'name':_0x12e825[_0x34d490][_0xf609('0x7b')],'custom':_0x12e825[_0x34d490]['custom_field'],'options':_0x12e825[_0x34d490]['data_type']==='picklist'&&_0x12e825[_0x34d490]['pick_list_values'][_0xf609('0x3b')]>-0x1?_[_0xf609('0x2f')](_0x12e825[_0x34d490][_0xf609('0x7c')],function(_0x12d164){return{'name':_0x12d164,'value':_0x12d164};}):[]});}}return{'count':_0x432773[_0xf609('0x3b')],'rows':_0x432773};}else{return{'count':0x0,'rows':[]};}})[_0xf609('0x29')](respondWithResult(_0x43e68f,null))[_0xf609('0x47')](function(_0x55f9bf){var _0x3de27e=_0x2e67e1[_0xf609('0x34')][_0xf609('0x7d')]?0x1f4:_0x55f9bf[_0xf609('0x7e')]||0x1f4;logger[_0xf609('0x2b')](_0xf609('0x7f'),_0xf609('0x61'),_0x3de27e,JSON['stringify'](_0x55f9bf));delete _0x55f9bf[_0xf609('0x2d')];if(_0x3de27e===0x191){_0x3de27e=0x190;}_0x43e68f[_0xf609('0x1c')](_0x3de27e)['send'](_0x2e67e1[_0xf609('0x34')][_0xf609('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x55f9bf[_0xf609('0x7e')]}:_0x55f9bf);});}; \ No newline at end of file +var _0x7f92=['set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','update','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','refreshToken','com','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset'];(function(_0x47bf55,_0x4deca7){var _0x1c1810=function(_0x163db0){while(--_0x163db0){_0x47bf55['push'](_0x47bf55['shift']());}};_0x1c1810(++_0x4deca7);}(_0x7f92,0x64));var _0x27f9=function(_0x296d24,_0x14d755){_0x296d24=_0x296d24-0x0;var _0x1cc450=_0x7f92[_0x296d24];return _0x1cc450;};'use strict';var emlformat=require(_0x27f9('0x0'));var rimraf=require(_0x27f9('0x1'));var zipdir=require(_0x27f9('0x2'));var jsonpatch=require(_0x27f9('0x3'));var rp=require(_0x27f9('0x4'));var moment=require(_0x27f9('0x5'));var BPromise=require(_0x27f9('0x6'));var Mustache=require('mustache');var util=require(_0x27f9('0x7'));var path=require('path');var sox=require(_0x27f9('0x8'));var csv=require(_0x27f9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27f9('0xa'));var _=require('lodash');var squel=require(_0x27f9('0xb'));var crypto=require(_0x27f9('0xc'));var jsforce=require(_0x27f9('0xd'));var deskjs=require(_0x27f9('0xe'));var toCsv=require(_0x27f9('0x9'));var querystring=require(_0x27f9('0xf'));var Papa=require('papaparse');var Redis=require(_0x27f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x27f9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27f9('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x27f9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x27f9('0x14'))['db'];var integrations=require(_0x27f9('0x15'));function respondWithStatusCode(_0x44d989,_0x2d8d2b){_0x2d8d2b=_0x2d8d2b||0xcc;return function(_0x3b9f23){if(_0x3b9f23){return _0x44d989[_0x27f9('0x16')](_0x2d8d2b);}return _0x44d989[_0x27f9('0x17')](_0x2d8d2b)[_0x27f9('0x18')]();};}function respondWithResult(_0x4bb330,_0x4aab0e){_0x4aab0e=_0x4aab0e||0xc8;return function(_0x56eb31){if(_0x56eb31){return _0x4bb330[_0x27f9('0x17')](_0x4aab0e)[_0x27f9('0x19')](_0x56eb31);}};}function respondWithFilteredResult(_0x520509,_0x23cb77){return function(_0x57577d){if(_0x57577d){var _0x571ef1=typeof _0x23cb77['offset']==='undefined'&&typeof _0x23cb77[_0x27f9('0x1a')]===_0x27f9('0x1b');var _0x229c3d=_0x57577d[_0x27f9('0x1c')];var _0x1f5605=_0x571ef1?0x0:_0x23cb77[_0x27f9('0x1d')];var _0x4620b1=_0x571ef1?_0x57577d[_0x27f9('0x1c')]:_0x23cb77[_0x27f9('0x1d')]+_0x23cb77[_0x27f9('0x1a')];var _0xd105f8;if(_0x4620b1>=_0x229c3d){_0x4620b1=_0x229c3d;_0xd105f8=0xc8;}else{_0xd105f8=0xce;}_0x520509[_0x27f9('0x17')](_0xd105f8);return _0x520509[_0x27f9('0x1e')](_0x27f9('0x1f'),_0x1f5605+'-'+_0x4620b1+'/'+_0x229c3d)['json'](_0x57577d);}return null;};}function patchUpdates(_0x3b5df7){return function(_0x5f160c){try{jsonpatch[_0x27f9('0x20')](_0x5f160c,_0x3b5df7,!![]);}catch(_0x5706a4){return BPromise[_0x27f9('0x21')](_0x5706a4);}return _0x5f160c['save']();};}function saveUpdates(_0x235e39,_0x3cdb2){return function(_0x551e76){if(_0x551e76){return _0x551e76['update'](_0x235e39)['then'](function(_0x117467){return _0x117467;});}return null;};}function removeEntity(_0x360914,_0x5781c6){return function(_0x4d0aec){if(_0x4d0aec){return _0x4d0aec[_0x27f9('0x22')]()[_0x27f9('0x23')](function(){_0x360914[_0x27f9('0x17')](0xcc)[_0x27f9('0x18')]();});}};}function handleEntityNotFound(_0x30898c,_0x12ccb0){return function(_0x551ef3){if(!_0x551ef3){_0x30898c[_0x27f9('0x16')](0x194);}return _0x551ef3;};}function handleError(_0x2b6317,_0x51c535){_0x51c535=_0x51c535||0x1f4;return function(_0x13007d){logger[_0x27f9('0x24')](_0x13007d[_0x27f9('0x25')]);if(_0x13007d[_0x27f9('0x26')]){delete _0x13007d[_0x27f9('0x26')];}_0x2b6317[_0x27f9('0x17')](_0x51c535)[_0x27f9('0x27')](_0x13007d);};}exports[_0x27f9('0x28')]=function(_0x5b780e,_0x10e746){var _0x359f0e={},_0x510329={},_0xb80c0a={'count':0x0,'rows':[]};var _0x4678b4=_[_0x27f9('0x29')](db[_0x27f9('0x2a')][_0x27f9('0x2b')],function(_0x291211){return{'name':_0x291211[_0x27f9('0x2c')],'type':_0x291211[_0x27f9('0x2d')][_0x27f9('0x2e')]};});_0x510329[_0x27f9('0x2f')]=_[_0x27f9('0x29')](_0x4678b4,_0x27f9('0x26'));_0x510329[_0x27f9('0x30')]=_[_0x27f9('0x31')](_0x5b780e[_0x27f9('0x30')]);_0x510329['filters']=_['intersection'](_0x510329[_0x27f9('0x2f')],_0x510329[_0x27f9('0x30')]);_0x359f0e[_0x27f9('0x32')]=_[_0x27f9('0x33')](_0x510329[_0x27f9('0x2f')],qs['fields'](_0x5b780e[_0x27f9('0x30')][_0x27f9('0x34')]));_0x359f0e['attributes']=_0x359f0e[_0x27f9('0x32')][_0x27f9('0x35')]?_0x359f0e[_0x27f9('0x32')]:_0x510329['model'];if(!_0x5b780e[_0x27f9('0x30')]['hasOwnProperty'](_0x27f9('0x36'))){_0x359f0e[_0x27f9('0x1a')]=qs[_0x27f9('0x1a')](_0x5b780e[_0x27f9('0x30')]['limit']);_0x359f0e[_0x27f9('0x1d')]=qs[_0x27f9('0x1d')](_0x5b780e[_0x27f9('0x30')][_0x27f9('0x1d')]);}_0x359f0e[_0x27f9('0x37')]=qs[_0x27f9('0x38')](_0x5b780e[_0x27f9('0x30')][_0x27f9('0x38')]);_0x359f0e[_0x27f9('0x39')]=qs['filters'](_[_0x27f9('0x3a')](_0x5b780e['query'],_0x510329[_0x27f9('0x3b')]),_0x4678b4);if(_0x5b780e[_0x27f9('0x30')][_0x27f9('0x3c')]){_0x359f0e[_0x27f9('0x39')]=_['merge'](_0x359f0e['where'],{'$or':_['map'](_0x4678b4,function(_0xc173c2){if(_0xc173c2[_0x27f9('0x2d')]!=='VIRTUAL'){var _0x5ac242={};_0x5ac242[_0xc173c2[_0x27f9('0x26')]]={'$like':'%'+_0x5b780e[_0x27f9('0x30')]['filter']+'%'};return _0x5ac242;}})});}_0x359f0e=_[_0x27f9('0x3d')]({},_0x359f0e,_0x5b780e[_0x27f9('0x3e')]);var _0x1f5db4={'where':_0x359f0e[_0x27f9('0x39')]};return db['ZohoAccount']['count'](_0x1f5db4)[_0x27f9('0x23')](function(_0x46d1c5){_0xb80c0a[_0x27f9('0x1c')]=_0x46d1c5;if(_0x5b780e[_0x27f9('0x30')][_0x27f9('0x3f')]){_0x359f0e[_0x27f9('0x40')]=[{'all':!![]}];}return db[_0x27f9('0x2a')]['findAll'](_0x359f0e);})[_0x27f9('0x23')](function(_0x56fd88){_0xb80c0a[_0x27f9('0x41')]=_0x56fd88;return _0xb80c0a;})[_0x27f9('0x23')](respondWithFilteredResult(_0x10e746,_0x359f0e))[_0x27f9('0x42')](handleError(_0x10e746,null));};exports[_0x27f9('0x43')]=function(_0x206cc4,_0x3acc5b){var _0xef56a3={'raw':![],'where':{'id':_0x206cc4[_0x27f9('0x44')]['id']}},_0x2bcce5={};_0x2bcce5[_0x27f9('0x2f')]=_['keys'](db['ZohoAccount'][_0x27f9('0x2b')]);_0x2bcce5[_0x27f9('0x30')]=_[_0x27f9('0x31')](_0x206cc4[_0x27f9('0x30')]);_0x2bcce5['filters']=_[_0x27f9('0x33')](_0x2bcce5[_0x27f9('0x2f')],_0x2bcce5['query']);_0xef56a3[_0x27f9('0x32')]=_[_0x27f9('0x33')](_0x2bcce5['model'],qs[_0x27f9('0x34')](_0x206cc4['query']['fields']));_0xef56a3[_0x27f9('0x32')]=_0xef56a3[_0x27f9('0x32')][_0x27f9('0x35')]?_0xef56a3[_0x27f9('0x32')]:_0x2bcce5['model'];if(_0x206cc4[_0x27f9('0x30')][_0x27f9('0x3f')]){_0xef56a3[_0x27f9('0x40')]=[{'all':!![]}];}_0xef56a3=_[_0x27f9('0x3d')]({},_0xef56a3,_0x206cc4[_0x27f9('0x3e')]);return db[_0x27f9('0x2a')][_0x27f9('0x45')](_0xef56a3)[_0x27f9('0x23')](handleEntityNotFound(_0x3acc5b,null))['then'](respondWithResult(_0x3acc5b,null))[_0x27f9('0x42')](handleError(_0x3acc5b,null));};exports['create']=function(_0x4d9ba3,_0x374e4b){return db[_0x27f9('0x2a')][_0x27f9('0x46')](_0x4d9ba3['body'],{})['then'](respondWithResult(_0x374e4b,0xc9))[_0x27f9('0x42')](handleError(_0x374e4b,null));};exports[_0x27f9('0x47')]=function(_0x50cab7,_0x2077e6){if(_0x50cab7[_0x27f9('0x48')]['id']){delete _0x50cab7[_0x27f9('0x48')]['id'];}return db[_0x27f9('0x2a')][_0x27f9('0x45')]({'where':{'id':_0x50cab7[_0x27f9('0x44')]['id']}})[_0x27f9('0x23')](handleEntityNotFound(_0x2077e6,null))[_0x27f9('0x23')](saveUpdates(_0x50cab7[_0x27f9('0x48')],null))[_0x27f9('0x23')](respondWithResult(_0x2077e6,null))['catch'](handleError(_0x2077e6,null));};exports['destroy']=function(_0x3ee8d3,_0x67fe11){return db[_0x27f9('0x2a')]['find']({'where':{'id':_0x3ee8d3[_0x27f9('0x44')]['id']}})[_0x27f9('0x23')](handleEntityNotFound(_0x67fe11,null))[_0x27f9('0x23')](removeEntity(_0x67fe11,null))[_0x27f9('0x42')](handleError(_0x67fe11,null));};exports[_0x27f9('0x49')]=function(_0x4936cb,_0x1d15d7,_0x860e5e){var _0x5a6aed={};var _0x4d88d3={};var _0x4e44dc;var _0x460123;return db[_0x27f9('0x2a')][_0x27f9('0x4a')]({'where':{'id':_0x4936cb['params']['id']}})['then'](handleEntityNotFound(_0x1d15d7,null))[_0x27f9('0x23')](function(_0x3e637b){if(_0x3e637b){_0x4e44dc=_0x3e637b;_0x4d88d3['model']=_[_0x27f9('0x31')](db['ZohoConfiguration'][_0x27f9('0x2b')]);_0x4d88d3[_0x27f9('0x30')]=_[_0x27f9('0x31')](_0x4936cb[_0x27f9('0x30')]);_0x4d88d3[_0x27f9('0x3b')]=_['intersection'](_0x4d88d3[_0x27f9('0x2f')],_0x4d88d3[_0x27f9('0x30')]);_0x5a6aed[_0x27f9('0x32')]=_['intersection'](_0x4d88d3[_0x27f9('0x2f')],qs[_0x27f9('0x34')](_0x4936cb['query'][_0x27f9('0x34')]));_0x5a6aed[_0x27f9('0x32')]=_0x5a6aed[_0x27f9('0x32')][_0x27f9('0x35')]?_0x5a6aed[_0x27f9('0x32')]:_0x4d88d3[_0x27f9('0x2f')];_0x5a6aed[_0x27f9('0x37')]=qs['sort'](_0x4936cb['query'][_0x27f9('0x38')]);_0x5a6aed[_0x27f9('0x39')]=qs['filters'](_['pick'](_0x4936cb[_0x27f9('0x30')],_0x4d88d3[_0x27f9('0x3b')]));if(_0x4936cb[_0x27f9('0x30')]['filter']){_0x5a6aed['where']=_[_0x27f9('0x3d')](_0x5a6aed[_0x27f9('0x39')],{'$or':_[_0x27f9('0x29')](_0x5a6aed[_0x27f9('0x32')],function(_0x1da76d){var _0x495501={};_0x495501[_0x1da76d]={'$like':'%'+_0x4936cb[_0x27f9('0x30')][_0x27f9('0x3c')]+'%'};return _0x495501;})});}_0x5a6aed=_['merge']({},_0x5a6aed,_0x4936cb[_0x27f9('0x3e')]);return _0x4e44dc['getConfigurations'](_0x5a6aed);}})[_0x27f9('0x23')](function(_0x3dfa69){if(_0x3dfa69){_0x460123=_0x3dfa69[_0x27f9('0x35')];if(!_0x4936cb[_0x27f9('0x30')][_0x27f9('0x4b')]('nolimit')){_0x5a6aed[_0x27f9('0x1a')]=qs['limit'](_0x4936cb[_0x27f9('0x30')][_0x27f9('0x1a')]);_0x5a6aed[_0x27f9('0x1d')]=qs['offset'](_0x4936cb[_0x27f9('0x30')][_0x27f9('0x1d')]);}return _0x4e44dc['getConfigurations'](_0x5a6aed);}})[_0x27f9('0x23')](function(_0x1b2261){if(_0x1b2261){return _0x1b2261?{'count':_0x460123,'rows':_0x1b2261}:null;}})['then'](respondWithResult(_0x1d15d7,null))[_0x27f9('0x42')](handleError(_0x1d15d7,null));};exports[_0x27f9('0x4c')]=function(_0x200b33,_0x2a8d1f,_0x5e157a){if(_0x200b33[_0x27f9('0x48')]['id']){delete _0x200b33['body']['id'];}return db['ZohoAccount'][_0x27f9('0x4a')]({'where':{'id':_0x200b33[_0x27f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a8d1f,null))[_0x27f9('0x23')](function(_0x29596e){if(_0x29596e){_0x200b33[_0x27f9('0x48')][_0x27f9('0x4d')]=_0x29596e['id'];_0x200b33[_0x27f9('0x48')]['Subjects']=integrations[_0x27f9('0x4e')](_0x200b33[_0x27f9('0x48')][_0x27f9('0x4f')],_0x200b33[_0x27f9('0x48')]['type']);_0x200b33[_0x27f9('0x48')][_0x27f9('0x50')]=integrations['getDescriptions'](_0x200b33[_0x27f9('0x48')][_0x27f9('0x4f')],_0x200b33[_0x27f9('0x48')]['type']);return db[_0x27f9('0x51')][_0x27f9('0x46')](_0x200b33[_0x27f9('0x48')],{'include':[{'model':db[_0x27f9('0x52')],'as':_0x27f9('0x53')},{'model':db[_0x27f9('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2a8d1f,null))[_0x27f9('0x42')](handleError(_0x2a8d1f,null));};function getAccessToken(_0x51b780){return new Promise(function(_0xd33f97,_0x43402c){var _0x7ecee6;switch(_0x51b780['zone']){case'US':_0x7ecee6=_0x27f9('0x54');break;case'AU':_0x7ecee6=_0x27f9('0x55');break;case'EU':_0x7ecee6='https://accounts.zoho.eu';break;case'IN':_0x7ecee6=_0x27f9('0x56');break;case'CN':_0x7ecee6='https://accounts.zoho.com.cn';break;default:_0x7ecee6=_0x27f9('0x57');break;}var _0x511adb={'method':_0x27f9('0x58'),'uri':_0x7ecee6+_0x27f9('0x59'),'qs':{'refresh_token':_0x51b780['refreshToken'],'client_id':_0x51b780[_0x27f9('0x5a')],'client_secret':_0x51b780[_0x27f9('0x5b')],'grant_type':_0x27f9('0x5c')},'json':!![]};return rp(_0x511adb)[_0x27f9('0x23')](function(_0x18c991){if(_0x18c991[_0x27f9('0x5d')]){_0xd33f97(_0x18c991[_0x27f9('0x5d')]);}else{_0x43402c(_0x27f9('0x5e'));}})[_0x27f9('0x42')](function(_0x228e60){_0x43402c(_0x228e60);});});}exports[_0x27f9('0x5f')]=function(_0x2d53a2,_0xcefcc0,_0x5df1ba){var _0x1e91ee,_0x2ffe01,_0x31f4e9,_0x3cf235,_0x42d60c;return db[_0x27f9('0x2a')][_0x27f9('0x4a')]({'where':{'id':_0x2d53a2['params']['id']},'attributes':['id',_0x27f9('0x60'),_0x27f9('0x61'),_0x27f9('0x5a'),_0x27f9('0x5b'),_0x27f9('0x62'),_0x27f9('0x63'),_0x27f9('0x64')]})[_0x27f9('0x23')](handleEntityNotFound(_0xcefcc0,null))[_0x27f9('0x23')](function(_0x2a7b8a){_0x42d60c=_0x2a7b8a;_0x1e91ee=_0x42d60c[_0x27f9('0x60')];_0x2ffe01=_0x1e91ee==='zoho.eu'?'eu':_0x27f9('0x65');_0x31f4e9=_0x42d60c[_0x27f9('0x62')];var _0x1743ec=_0x31f4e9['slice'](-0x1);if(_0x1743ec==='/'||_0x1743ec==='\x5c'||_0x1743ec===':'){_0x31f4e9=_0x31f4e9[_0x27f9('0x66')](0x0,_0x31f4e9[_0x27f9('0x67')](_0x1743ec));}if(!_0x42d60c[_0x27f9('0x64')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x42d60c);})[_0x27f9('0x23')](function(_0x27c133){if(_0x27c133){return rp({'method':_0x27f9('0x68'),'uri':util[_0x27f9('0x69')](_0x27f9('0x6a'),_0x2ffe01),'qs':{'module':'Calls'},'headers':{'Authorization':_0x27f9('0x6b')+_0x27c133},'json':!![]});}})[_0x27f9('0x23')](function(_0x23af05){if(_0x23af05){if(_0x23af05['response']&&_0x23af05['response'][_0x27f9('0x24')]){throw new Error(_0x23af05[_0x27f9('0x6c')][_0x27f9('0x24')][_0x27f9('0x6d')]);}var _0x303bb1=[];var _0x3f2152=[];var _0x22f3f3=[_0x27f9('0x6e'),_0x27f9('0x6f'),_0x27f9('0x70'),_0x27f9('0x71'),_0x27f9('0x72'),_0x27f9('0x73'),_0x27f9('0x74'),_0x27f9('0x75')];_0x3f2152=_[_0x27f9('0x76')](_0x23af05[_0x27f9('0x34')],function(_0x20485e){return _0x22f3f3[_0x27f9('0x77')](_0x20485e[_0x27f9('0x78')]);});for(var _0x47f696=0x0;_0x47f696<_0x3f2152['length'];_0x47f696++){if(_0x3f2152[_0x47f696]['system_mandatory']===![]){_0x303bb1[_0x27f9('0x79')]({'id':_0x3f2152[_0x47f696]['id'],'name':_0x3f2152[_0x47f696][_0x27f9('0x7a')],'custom':_0x3f2152[_0x47f696][_0x27f9('0x7b')],'options':_0x3f2152[_0x47f696][_0x27f9('0x7c')]===_0x27f9('0x7d')&&_0x3f2152[_0x47f696]['pick_list_values'][_0x27f9('0x35')]>-0x1?_[_0x27f9('0x29')](_0x3f2152[_0x47f696]['pick_list_values'],function(_0x13d380){return{'name':_0x13d380,'value':_0x13d380};}):[]});}}return{'count':_0x303bb1['length'],'rows':_0x303bb1};}else{return{'count':0x0,'rows':[]};}})[_0x27f9('0x23')](respondWithResult(_0xcefcc0,null))['catch'](function(_0x1c6633){var _0x232344=_0x2d53a2[_0x27f9('0x30')][_0x27f9('0x7e')]?0x1f4:_0x1c6633[_0x27f9('0x7f')]||0x1f4;logger[_0x27f9('0x24')](_0x27f9('0x80'),_0x27f9('0x5f'),_0x232344,JSON['stringify'](_0x1c6633));delete _0x1c6633[_0x27f9('0x26')];if(_0x232344===0x191){_0x232344=0x190;}_0xcefcc0[_0x27f9('0x17')](_0x232344)['send'](_0x2d53a2[_0x27f9('0x30')][_0x27f9('0x7e')]?{'message':_0x27f9('0x81'),'statusCode':_0x1c6633[_0x27f9('0x7f')]}:_0x1c6633);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 2b56fb2..dd4a7d6 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 _0xf5f4=['zone','changed','serverUrl','clientId','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','code','then','parse','refresh_token','refreshToken','info','format','name','error','catch','inspect','https://accounts.zoho.in','POST','authorization_code','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api','bluebird','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x33de51,_0x372a30){var _0x521785=function(_0xe5f90a){while(--_0xe5f90a){_0x33de51['push'](_0x33de51['shift']());}};_0x521785(++_0x372a30);}(_0xf5f4,0x1a2));var _0x4f5f=function(_0xf0e6ac,_0x46822d){_0xf0e6ac=_0xf0e6ac-0x0;var _0x1a0ceb=_0xf5f4[_0xf0e6ac];return _0x1a0ceb;};'use strict';var _=require('lodash');var util=require(_0x4f5f('0x0'));var logger=require(_0x4f5f('0x1'))(_0x4f5f('0x2'));var moment=require('moment');var BPromise=require(_0x4f5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f5f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f5f('0x5'));var integrations=require(_0x4f5f('0x6'));module[_0x4f5f('0x7')]=function(_0x510d93,_0x280eb3){return _0x510d93[_0x4f5f('0x8')](_0x4f5f('0x9'),attributes,{'tableName':_0x4f5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ddd68,_0x3f331a,_0x375507){if(_0x2ddd68['changed'](_0x4f5f('0xb'))||_0x2ddd68[_0x4f5f('0xc')](_0x4f5f('0xd'))||_0x2ddd68['changed'](_0x4f5f('0xe'))||_0x2ddd68[_0x4f5f('0xc')](_0x4f5f('0xf'))||_0x2ddd68[_0x4f5f('0xc')]('code')||_0x2ddd68[_0x4f5f('0xc')]('host')){var _0x37b09b,_0x522d6b;_0x37b09b=_0x2ddd68['serverUrl'];var _0x33dd54=_0x37b09b[_0x4f5f('0x10')](-0x1);if(_0x33dd54==='/'||_0x33dd54==='\x5c'||_0x33dd54===':'){_0x37b09b=_0x37b09b[_0x4f5f('0x11')](0x0,_0x37b09b[_0x4f5f('0x12')](_0x33dd54));}switch(_0x2ddd68[_0x4f5f('0xb')]){case'US':_0x522d6b=_0x4f5f('0x13');break;case'AU':_0x522d6b=_0x4f5f('0x14');break;case'IN':_0x522d6b='https://accounts.zoho.in';break;case'CN':_0x522d6b=_0x4f5f('0x15');break;default:_0x522d6b=_0x4f5f('0x16');break;}var _0x361bd9={'method':'POST','uri':_0x522d6b+_0x4f5f('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x2ddd68[_0x4f5f('0xe')],'client_secret':_0x2ddd68[_0x4f5f('0xf')],'redirect_uri':_0x2ddd68[_0x4f5f('0xd')],'code':_0x2ddd68[_0x4f5f('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x361bd9)[_0x4f5f('0x19')](function(_0x33acc4){var _0x4e71d2=JSON[_0x4f5f('0x1a')](_0x33acc4);if(_0x4e71d2[_0x4f5f('0x1b')]){_0x2ddd68[_0x4f5f('0x1c')]=_0x4e71d2[_0x4f5f('0x1b')];logger[_0x4f5f('0x1d')](util[_0x4f5f('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ddd68[_0x4f5f('0x1f')],_0x2ddd68['id']));}else{logger[_0x4f5f('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ddd68[_0x4f5f('0x1f')],_0x2ddd68['id']),util['inspect'](_0x4e71d2,{'showHidden':![],'depth':null}));}return _0x375507(null,_0x3f331a);})[_0x4f5f('0x21')](function(_0x291c5c){logger['error'](util[_0x4f5f('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ddd68['name'],_0x2ddd68['id']),util[_0x4f5f('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x375507(_0x291c5c);});}else{return _0x375507(null,_0x3f331a);}},'beforeUpdate':function(_0x1913af,_0x20b87a,_0x3fc2ab){if(_0x1913af[_0x4f5f('0xc')](_0x4f5f('0xb'))||_0x1913af['changed'](_0x4f5f('0xd'))||_0x1913af[_0x4f5f('0xc')](_0x4f5f('0xe'))||_0x1913af[_0x4f5f('0xc')](_0x4f5f('0xf'))||_0x1913af[_0x4f5f('0xc')](_0x4f5f('0x18'))||_0x1913af['changed']('host')){var _0x272428,_0x5c2807;_0x272428=_0x1913af['serverUrl'];var _0x3f897c=_0x272428[_0x4f5f('0x10')](-0x1);if(_0x3f897c==='/'||_0x3f897c==='\x5c'||_0x3f897c===':'){_0x272428=_0x272428[_0x4f5f('0x11')](0x0,_0x272428[_0x4f5f('0x12')](_0x3f897c));}switch(_0x1913af['zone']){case'US':_0x5c2807=_0x4f5f('0x13');break;case'AU':_0x5c2807='https://accounts.zoho.com.au';break;case'IN':_0x5c2807=_0x4f5f('0x23');break;case'CN':_0x5c2807='https://accounts.zoho.com.cn';break;default:_0x5c2807=_0x4f5f('0x16');break;}var _0x35ba16={'method':_0x4f5f('0x24'),'uri':_0x5c2807+_0x4f5f('0x17'),'form':{'grant_type':_0x4f5f('0x25'),'client_id':_0x1913af[_0x4f5f('0xe')],'client_secret':_0x1913af[_0x4f5f('0xf')],'redirect_uri':_0x1913af[_0x4f5f('0xd')],'code':_0x1913af[_0x4f5f('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x35ba16)[_0x4f5f('0x19')](function(_0x36ff7e){var _0x326ea0=JSON[_0x4f5f('0x1a')](_0x36ff7e);if(_0x326ea0[_0x4f5f('0x1b')]){_0x1913af[_0x4f5f('0x1c')]=_0x326ea0[_0x4f5f('0x1b')];logger[_0x4f5f('0x1d')](util[_0x4f5f('0x1e')](_0x4f5f('0x26'),_0x1913af[_0x4f5f('0x1f')],_0x1913af['id']));}else{logger['error'](util[_0x4f5f('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1913af[_0x4f5f('0x1f')],_0x1913af['id']),util['inspect'](_0x326ea0,{'showHidden':![],'depth':null}));}return _0x3fc2ab(null,_0x20b87a);})[_0x4f5f('0x21')](function(_0x23c2c3){logger['error'](util[_0x4f5f('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1913af[_0x4f5f('0x1f')],_0x1913af['id']),util[_0x4f5f('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3fc2ab(_0x23c2c3);});}else{return _0x3fc2ab(null,_0x20b87a);}}}});}; \ No newline at end of file +var _0x1550=['exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','code','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','/oauth/v2/token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x1550,0x7a));var _0x0155=function(_0x165314,_0x918f0c){_0x165314=_0x165314-0x0;var _0x43f8ae=_0x1550[_0x165314];return _0x43f8ae;};'use strict';var _=require(_0x0155('0x0'));var util=require(_0x0155('0x1'));var logger=require(_0x0155('0x2'))('api');var moment=require(_0x0155('0x3'));var BPromise=require(_0x0155('0x4'));var rp=require(_0x0155('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0155('0x6'));var config=require(_0x0155('0x7'));var attributes=require(_0x0155('0x8'));var integrations=require(_0x0155('0x9'));module[_0x0155('0xa')]=function(_0xb24b82,_0x3b6954){return _0xb24b82[_0x0155('0xb')](_0x0155('0xc'),attributes,{'tableName':_0x0155('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b7888,_0x33937e,_0xb3c419){if(_0x5b7888[_0x0155('0xe')]('zone')||_0x5b7888[_0x0155('0xe')](_0x0155('0xf'))||_0x5b7888[_0x0155('0xe')]('clientId')||_0x5b7888[_0x0155('0xe')](_0x0155('0x10'))||_0x5b7888[_0x0155('0xe')](_0x0155('0x11'))||_0x5b7888['changed'](_0x0155('0x12'))){var _0x23c30f,_0x276ed7;_0x23c30f=_0x5b7888[_0x0155('0xf')];var _0xc22b1=_0x23c30f[_0x0155('0x13')](-0x1);if(_0xc22b1==='/'||_0xc22b1==='\x5c'||_0xc22b1===':'){_0x23c30f=_0x23c30f[_0x0155('0x14')](0x0,_0x23c30f['lastIndexOf'](_0xc22b1));}switch(_0x5b7888[_0x0155('0x15')]){case'US':_0x276ed7=_0x0155('0x16');break;case'AU':_0x276ed7=_0x0155('0x17');break;case'IN':_0x276ed7='https://accounts.zoho.in';break;case'CN':_0x276ed7=_0x0155('0x18');break;default:_0x276ed7=_0x0155('0x19');break;}var _0x16c337={'method':_0x0155('0x1a'),'uri':_0x276ed7+'/oauth/v2/token','form':{'grant_type':_0x0155('0x1b'),'client_id':_0x5b7888[_0x0155('0x1c')],'client_secret':_0x5b7888[_0x0155('0x10')],'redirect_uri':_0x5b7888[_0x0155('0xf')],'code':_0x5b7888[_0x0155('0x11')]},'headers':{'Content-Type':_0x0155('0x1d')}};return rp(_0x16c337)[_0x0155('0x1e')](function(_0x5aca89){var _0x38c16a=JSON[_0x0155('0x1f')](_0x5aca89);if(_0x38c16a[_0x0155('0x20')]){_0x5b7888[_0x0155('0x21')]=_0x38c16a[_0x0155('0x20')];logger['info'](util[_0x0155('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5b7888[_0x0155('0x23')],_0x5b7888['id']));}else{logger[_0x0155('0x24')](util[_0x0155('0x22')](_0x0155('0x25'),_0x5b7888[_0x0155('0x23')],_0x5b7888['id']),util[_0x0155('0x26')](_0x38c16a,{'showHidden':![],'depth':null}));}return _0xb3c419(null,_0x33937e);})[_0x0155('0x27')](function(_0x165c8d){logger[_0x0155('0x24')](util[_0x0155('0x22')](_0x0155('0x25'),_0x5b7888[_0x0155('0x23')],_0x5b7888['id']),util[_0x0155('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0xb3c419(_0x165c8d);});}else{return _0xb3c419(null,_0x33937e);}},'beforeUpdate':function(_0x57da61,_0x3668f2,_0x49d19f){if(_0x57da61[_0x0155('0xe')](_0x0155('0x15'))||_0x57da61[_0x0155('0xe')]('serverUrl')||_0x57da61['changed'](_0x0155('0x1c'))||_0x57da61['changed']('clientSecret')||_0x57da61['changed'](_0x0155('0x11'))||_0x57da61['changed'](_0x0155('0x12'))){var _0x3bd95f,_0x33a400;_0x3bd95f=_0x57da61['serverUrl'];var _0x247639=_0x3bd95f[_0x0155('0x13')](-0x1);if(_0x247639==='/'||_0x247639==='\x5c'||_0x247639===':'){_0x3bd95f=_0x3bd95f[_0x0155('0x14')](0x0,_0x3bd95f[_0x0155('0x28')](_0x247639));}switch(_0x57da61[_0x0155('0x15')]){case'US':_0x33a400=_0x0155('0x16');break;case'AU':_0x33a400=_0x0155('0x17');break;case'IN':_0x33a400='https://accounts.zoho.in';break;case'CN':_0x33a400='https://accounts.zoho.com.cn';break;default:_0x33a400='https://accounts.zoho.eu';break;}var _0x45d63e={'method':'POST','uri':_0x33a400+_0x0155('0x29'),'form':{'grant_type':_0x0155('0x1b'),'client_id':_0x57da61[_0x0155('0x1c')],'client_secret':_0x57da61[_0x0155('0x10')],'redirect_uri':_0x57da61[_0x0155('0xf')],'code':_0x57da61[_0x0155('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x45d63e)['then'](function(_0x3efc4a){var _0x3373c5=JSON['parse'](_0x3efc4a);if(_0x3373c5['refresh_token']){_0x57da61[_0x0155('0x21')]=_0x3373c5['refresh_token'];logger[_0x0155('0x2a')](util[_0x0155('0x22')](_0x0155('0x2b'),_0x57da61[_0x0155('0x23')],_0x57da61['id']));}else{logger[_0x0155('0x24')](util[_0x0155('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x57da61['name'],_0x57da61['id']),util[_0x0155('0x26')](_0x3373c5,{'showHidden':![],'depth':null}));}return _0x49d19f(null,_0x3668f2);})[_0x0155('0x27')](function(_0x35da86){logger[_0x0155('0x24')](util[_0x0155('0x22')](_0x0155('0x25'),_0x57da61[_0x0155('0x23')],_0x57da61['id']),util[_0x0155('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x49d19f(_0x35da86);});}else{return _0x49d19f(null,_0x3668f2);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index c6408ca..bb5510d 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 _0x5eef=['../../config/logger','rpc','../../config/environment','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','limit','include','model','attributes','map','find','ShowZohoAccount','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x225eda,_0x48e6ee){var _0x3ef417=function(_0x323772){while(--_0x323772){_0x225eda['push'](_0x225eda['shift']());}};_0x3ef417(++_0x48e6ee);}(_0x5eef,0x9c));var _0xf5ee=function(_0x17e4a5,_0x2e7315){_0x17e4a5=_0x17e4a5-0x0;var _0xae81ac=_0x5eef[_0x17e4a5];return _0xae81ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ee('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x2'))['db'];var utils=require(_0xf5ee('0x3'));var logger=require(_0xf5ee('0x4'))(_0xf5ee('0x5'));var config=require(_0xf5ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae819,_0x24e3a5,_0x4f0e34){return new BPromise(function(_0x31c9d8,_0x2e4224){return client[_0xf5ee('0x7')](_0x3ae819,_0x4f0e34)[_0xf5ee('0x8')](function(_0x125def){logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));logger[_0xf5ee('0xc')](_0xf5ee('0xd'),_0x24e3a5,'request\x20sent',JSON[_0xf5ee('0xe')](_0x125def));if(_0x125def['error']){if(_0x125def[_0xf5ee('0xf')]['code']===0x1f4){logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')][_0xf5ee('0x10')]);return _0x2e4224(_0x125def['error'][_0xf5ee('0x10')]);}logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')]['message']);return _0x31c9d8(_0x125def['error'][_0xf5ee('0x10')]);}else{logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));_0x31c9d8(_0x125def[_0xf5ee('0x11')]['message']);}})[_0xf5ee('0x12')](function(_0x21a35c){logger['error'](_0xf5ee('0xa'),_0x24e3a5,_0x21a35c);_0x2e4224(_0x21a35c);});});}exports[_0xf5ee('0x13')]=function(_0x26cb76){var _0xb02e78=this;return new Promise(function(_0x47a0b2,_0x12462d){return db[_0xf5ee('0x14')][_0xf5ee('0x15')]({'raw':_0x26cb76['options']?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x17')]===undefined?!![]:![]:!![],'where':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x18')]||null:null,'attributes':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76['options']['attributes']||null:null,'limit':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x19')]||null:null,'include':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76['options'][_0xf5ee('0x1a')]?_['map'](_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x1a')],function(_0x2e2f35){return{'model':db[_0x2e2f35[_0xf5ee('0x1b')]],'as':_0x2e2f35['as'],'attributes':_0x2e2f35[_0xf5ee('0x1c')],'include':_0x2e2f35['include']?_[_0xf5ee('0x1d')](_0x2e2f35[_0xf5ee('0x1a')],function(_0x5b7744){return{'model':db[_0x5b7744[_0xf5ee('0x1b')]],'as':_0x5b7744['as'],'attributes':_0x5b7744[_0xf5ee('0x1c')],'include':_0x5b7744[_0xf5ee('0x1a')]?_[_0xf5ee('0x1d')](_0x5b7744[_0xf5ee('0x1a')],function(_0x3db008){return{'model':db[_0x3db008[_0xf5ee('0x1b')]],'as':_0x3db008['as'],'attributes':_0x3db008[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0x8')](function(_0x576d16){logger['info'](_0xf5ee('0x13'),_0x26cb76);logger[_0xf5ee('0xc')](_0xf5ee('0x13'),_0x26cb76,JSON[_0xf5ee('0xe')](_0x576d16));_0x47a0b2(_0x576d16);})[_0xf5ee('0x12')](function(_0x46359c){logger[_0xf5ee('0xf')](_0xf5ee('0x13'),_0x46359c['message'],_0x26cb76);_0x12462d(_0xb02e78['error'](0x1f4,_0x46359c[_0xf5ee('0x10')]));});});};exports['ShowZohoAccount']=function(_0x148ba1){var _0x4cdaa0=this;return new Promise(function(_0x36c069,_0x5589d1){return db[_0xf5ee('0x14')][_0xf5ee('0x1e')]({'raw':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x17')]===undefined?!![]:![]:!![],'where':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')]['where']||null:null,'attributes':_0x148ba1['options']?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x1c')]||null:null,'include':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x1a')]?_[_0xf5ee('0x1d')](_0x148ba1['options'][_0xf5ee('0x1a')],function(_0x3afa1e){return{'model':db[_0x3afa1e[_0xf5ee('0x1b')]],'as':_0x3afa1e['as'],'attributes':_0x3afa1e[_0xf5ee('0x1c')],'include':_0x3afa1e[_0xf5ee('0x1a')]?_['map'](_0x3afa1e['include'],function(_0x162857){return{'model':db[_0x162857[_0xf5ee('0x1b')]],'as':_0x162857['as'],'attributes':_0x162857[_0xf5ee('0x1c')],'include':_0x162857[_0xf5ee('0x1a')]?_['map'](_0x162857[_0xf5ee('0x1a')],function(_0xa4712f){return{'model':db[_0xa4712f[_0xf5ee('0x1b')]],'as':_0xa4712f['as'],'attributes':_0xa4712f[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0x8')](function(_0xce449c){logger[_0xf5ee('0x9')](_0xf5ee('0x1f'),_0x148ba1);logger[_0xf5ee('0xc')](_0xf5ee('0x1f'),_0x148ba1,JSON[_0xf5ee('0xe')](_0xce449c));_0x36c069(_0xce449c);})[_0xf5ee('0x12')](function(_0x121ba4){logger[_0xf5ee('0xf')](_0xf5ee('0x1f'),_0x121ba4[_0xf5ee('0x10')],_0x148ba1);_0x5589d1(_0x4cdaa0[_0xf5ee('0xf')](0x1f4,_0x121ba4[_0xf5ee('0x10')]));});});}; \ No newline at end of file +var _0x04d5=['where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ZohoAccount','options','raw','include','map','model','attributes','GetZohoAccount','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x04d5,0xe1));var _0x504d=function(_0x45b0b3,_0x4c3f98){_0x45b0b3=_0x45b0b3-0x0;var _0x321350=_0x04d5[_0x45b0b3];return _0x321350;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var moment=require('moment');var BPromise=require(_0x504d('0x2'));var rs=require(_0x504d('0x3'));var fs=require('fs');var Redis=require(_0x504d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x504d('0x5'));var logger=require(_0x504d('0x6'))(_0x504d('0x7'));var config=require(_0x504d('0x8'));var jayson=require(_0x504d('0x9'));var client=jayson['client'][_0x504d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278262,_0x87bf04,_0x49cb76){return new BPromise(function(_0x5712a7,_0x16da4f){return client[_0x504d('0xb')](_0x278262,_0x49cb76)[_0x504d('0xc')](function(_0x48e0e6){logger[_0x504d('0xd')](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));logger[_0x504d('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x87bf04,_0x504d('0xf'),JSON[_0x504d('0x11')](_0x48e0e6));if(_0x48e0e6[_0x504d('0x12')]){if(_0x48e0e6[_0x504d('0x12')][_0x504d('0x13')]===0x1f4){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6['error']['message']);return _0x16da4f(_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);}logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x48e0e6[_0x504d('0x12')][_0x504d('0x14')]);return _0x5712a7(_0x48e0e6['error'][_0x504d('0x14')]);}else{logger['info'](_0x504d('0xe'),_0x87bf04,_0x504d('0xf'));_0x5712a7(_0x48e0e6['result'][_0x504d('0x14')]);}})[_0x504d('0x15')](function(_0x1e3722){logger[_0x504d('0x12')](_0x504d('0xe'),_0x87bf04,_0x1e3722);_0x16da4f(_0x1e3722);});});}exports['GetZohoAccount']=function(_0x150cc7){var _0x4e11a0=this;return new Promise(function(_0x2bfc57,_0x4eec88){return db[_0x504d('0x16')]['findAll']({'raw':_0x150cc7[_0x504d('0x17')]?_0x150cc7[_0x504d('0x17')][_0x504d('0x18')]===undefined?!![]:![]:!![],'where':_0x150cc7[_0x504d('0x17')]?_0x150cc7[_0x504d('0x17')]['where']||null:null,'attributes':_0x150cc7['options']?_0x150cc7[_0x504d('0x17')]['attributes']||null:null,'limit':_0x150cc7[_0x504d('0x17')]?_0x150cc7[_0x504d('0x17')]['limit']||null:null,'include':_0x150cc7[_0x504d('0x17')]?_0x150cc7['options'][_0x504d('0x19')]?_[_0x504d('0x1a')](_0x150cc7[_0x504d('0x17')]['include'],function(_0x18fece){return{'model':db[_0x18fece['model']],'as':_0x18fece['as'],'attributes':_0x18fece['attributes'],'include':_0x18fece[_0x504d('0x19')]?_[_0x504d('0x1a')](_0x18fece['include'],function(_0x5bbef7){return{'model':db[_0x5bbef7[_0x504d('0x1b')]],'as':_0x5bbef7['as'],'attributes':_0x5bbef7[_0x504d('0x1c')],'include':_0x5bbef7['include']?_[_0x504d('0x1a')](_0x5bbef7[_0x504d('0x19')],function(_0xdce2f9){return{'model':db[_0xdce2f9[_0x504d('0x1b')]],'as':_0xdce2f9['as'],'attributes':_0xdce2f9[_0x504d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d4300){logger[_0x504d('0xd')](_0x504d('0x1d'),_0x150cc7);logger[_0x504d('0x10')]('GetZohoAccount',_0x150cc7,JSON['stringify'](_0x3d4300));_0x2bfc57(_0x3d4300);})[_0x504d('0x15')](function(_0x544296){logger[_0x504d('0x12')]('GetZohoAccount',_0x544296[_0x504d('0x14')],_0x150cc7);_0x4eec88(_0x4e11a0[_0x504d('0x12')](0x1f4,_0x544296[_0x504d('0x14')]));});});};exports['ShowZohoAccount']=function(_0x2e564c){var _0x4b0575=this;return new Promise(function(_0x506a22,_0x156472){return db[_0x504d('0x16')][_0x504d('0x1e')]({'raw':_0x2e564c['options']?_0x2e564c[_0x504d('0x17')][_0x504d('0x18')]===undefined?!![]:![]:!![],'where':_0x2e564c['options']?_0x2e564c['options'][_0x504d('0x1f')]||null:null,'attributes':_0x2e564c[_0x504d('0x17')]?_0x2e564c[_0x504d('0x17')]['attributes']||null:null,'include':_0x2e564c[_0x504d('0x17')]?_0x2e564c[_0x504d('0x17')][_0x504d('0x19')]?_[_0x504d('0x1a')](_0x2e564c[_0x504d('0x17')][_0x504d('0x19')],function(_0x6298bb){return{'model':db[_0x6298bb[_0x504d('0x1b')]],'as':_0x6298bb['as'],'attributes':_0x6298bb[_0x504d('0x1c')],'include':_0x6298bb['include']?_['map'](_0x6298bb[_0x504d('0x19')],function(_0x5f129b){return{'model':db[_0x5f129b[_0x504d('0x1b')]],'as':_0x5f129b['as'],'attributes':_0x5f129b[_0x504d('0x1c')],'include':_0x5f129b[_0x504d('0x19')]?_[_0x504d('0x1a')](_0x5f129b[_0x504d('0x19')],function(_0x45c80e){return{'model':db[_0x45c80e[_0x504d('0x1b')]],'as':_0x45c80e['as'],'attributes':_0x45c80e[_0x504d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x504d('0xc')](function(_0xfe6f06){logger[_0x504d('0xd')]('ShowZohoAccount',_0x2e564c);logger[_0x504d('0x10')]('ShowZohoAccount',_0x2e564c,JSON['stringify'](_0xfe6f06));_0x506a22(_0xfe6f06);})['catch'](function(_0x1310be){logger[_0x504d('0x12')]('ShowZohoAccount',_0x1310be[_0x504d('0x14')],_0x2e564c);_0x156472(_0x4b0575['error'](0x1f4,_0x1310be[_0x504d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index bb59d9c..1d6578b 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 _0x508e=['../../config/environment','./intZohoConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x508e,0x152));var _0xe508=function(_0x425d9,_0x24e135){_0x425d9=_0x425d9-0x0;var _0x2a786e=_0x508e[_0x425d9];return _0x2a786e;};'use strict';var multer=require(_0xe508('0x0'));var util=require(_0xe508('0x1'));var path=require('path');var timeout=require(_0xe508('0x2'));var express=require(_0xe508('0x3'));var router=express[_0xe508('0x4')]();var fs_extra=require(_0xe508('0x5'));var auth=require(_0xe508('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe508('0x7'));var controller=require(_0xe508('0x8'));router['get']('/',auth[_0xe508('0x9')](),controller['index']);router[_0xe508('0xa')](_0xe508('0xb'),auth[_0xe508('0x9')](),controller[_0xe508('0xc')]);router[_0xe508('0xa')](_0xe508('0xd'),auth['isAuthenticated'](),controller[_0xe508('0xe')]);router[_0xe508('0xa')](_0xe508('0xf'),auth[_0xe508('0x9')](),controller['getSubjects']);router['get'](_0xe508('0x10'),auth[_0xe508('0x9')](),controller[_0xe508('0x11')]);router[_0xe508('0x12')]('/',auth['isAuthenticated'](),controller[_0xe508('0x13')]);router[_0xe508('0x14')](_0xe508('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe508('0xb'),auth['isAuthenticated'](),controller[_0xe508('0x15')]);module[_0xe508('0x16')]=router; \ No newline at end of file +var _0xac7d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','path'];(function(_0x3716d3,_0x3979a7){var _0x318655=function(_0x103676){while(--_0x103676){_0x3716d3['push'](_0x3716d3['shift']());}};_0x318655(++_0x3979a7);}(_0xac7d,0xcd));var _0xdac7=function(_0x25175c,_0x40816f){_0x25175c=_0x25175c-0x0;var _0x256ff9=_0xac7d[_0x25175c];return _0x256ff9;};'use strict';var multer=require(_0xdac7('0x0'));var util=require('util');var path=require(_0xdac7('0x1'));var timeout=require(_0xdac7('0x2'));var express=require(_0xdac7('0x3'));var router=express[_0xdac7('0x4')]();var fs_extra=require(_0xdac7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdac7('0x6'));var config=require(_0xdac7('0x7'));var controller=require(_0xdac7('0x8'));router[_0xdac7('0x9')]('/',auth[_0xdac7('0xa')](),controller['index']);router[_0xdac7('0x9')](_0xdac7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdac7('0x9')](_0xdac7('0xc'),auth['isAuthenticated'](),controller[_0xdac7('0xd')]);router[_0xdac7('0x9')](_0xdac7('0xe'),auth[_0xdac7('0xa')](),controller[_0xdac7('0xf')]);router[_0xdac7('0x9')](_0xdac7('0x10'),auth[_0xdac7('0xa')](),controller[_0xdac7('0x11')]);router[_0xdac7('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdac7('0x13')]('/:id',auth[_0xdac7('0xa')](),controller[_0xdac7('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdac7('0x15')]);module[_0xdac7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 8b8123d..6f69d78 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 _0xd892=['contact_lead','sequelize','STRING','ENUM','lead','nothing'];(function(_0x2494f5,_0x1f1d3c){var _0x5c60a4=function(_0x437901){while(--_0x437901){_0x2494f5['push'](_0x2494f5['shift']());}};_0x5c60a4(++_0x1f1d3c);}(_0xd892,0x103));var _0x2d89=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xd892[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x2d89('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d89('0x1')]},'moduleCreate':{'type':Sequelize[_0x2d89('0x2')](_0x2d89('0x3'),'contact',_0x2d89('0x4')),'defaultValue':_0x2d89('0x3')},'moduleSearch':{'type':Sequelize[_0x2d89('0x2')](_0x2d89('0x5'),'contact',_0x2d89('0x3')),'defaultValue':_0x2d89('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa6ee=['contact_lead','sequelize','STRING','ENUM','lead','contact','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6ee,0xd3));var _0xea6e=function(_0x5bb5a1,_0x108278){_0x5bb5a1=_0x5bb5a1-0x0;var _0x40898c=_0xa6ee[_0x5bb5a1];return _0x40898c;};'use strict';var Sequelize=require(_0xea6e('0x0'));module['exports']={'name':{'type':Sequelize[_0xea6e('0x1')]},'moduleCreate':{'type':Sequelize[_0xea6e('0x2')](_0xea6e('0x3'),_0xea6e('0x4'),_0xea6e('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xea6e('0x6'),_0xea6e('0x4'),'lead'),'defaultValue':_0xea6e('0x6')},'description':{'type':Sequelize[_0xea6e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6d045b0..9ce25c9 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 _0x7059=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','save','update','then','destroy','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','getFields','findOne','order','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2612fd,_0x8320f1){var _0x212b94=function(_0x4e1c39){while(--_0x4e1c39){_0x2612fd['push'](_0x2612fd['shift']());}};_0x212b94(++_0x8320f1);}(_0x7059,0x12c));var _0x9705=function(_0x59b249,_0x131d69){_0x59b249=_0x59b249-0x0;var _0x245d8c=_0x7059[_0x59b249];return _0x245d8c;};'use strict';var emlformat=require(_0x9705('0x0'));var rimraf=require(_0x9705('0x1'));var zipdir=require(_0x9705('0x2'));var jsonpatch=require(_0x9705('0x3'));var rp=require(_0x9705('0x4'));var moment=require(_0x9705('0x5'));var BPromise=require(_0x9705('0x6'));var Mustache=require(_0x9705('0x7'));var util=require('util');var path=require(_0x9705('0x8'));var sox=require(_0x9705('0x9'));var csv=require(_0x9705('0xa'));var ejs=require(_0x9705('0xb'));var fs=require('fs');var fs_extra=require(_0x9705('0xc'));var _=require(_0x9705('0xd'));var squel=require(_0x9705('0xe'));var crypto=require(_0x9705('0xf'));var jsforce=require(_0x9705('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9705('0xa'));var querystring=require(_0x9705('0x11'));var Papa=require(_0x9705('0x12'));var Redis=require(_0x9705('0x13'));var authService=require(_0x9705('0x14'));var qs=require(_0x9705('0x15'));var as=require(_0x9705('0x16'));var hardwareService=require(_0x9705('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x9705('0x18'));var config=require(_0x9705('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x927adb,_0x52c351){_0x52c351=_0x52c351||0xcc;return function(_0x49717d){if(_0x49717d){return _0x927adb[_0x9705('0x1a')](_0x52c351);}return _0x927adb['status'](_0x52c351)[_0x9705('0x1b')]();};}function respondWithResult(_0x1c0c0b,_0x26e427){_0x26e427=_0x26e427||0xc8;return function(_0x21a504){if(_0x21a504){return _0x1c0c0b[_0x9705('0x1c')](_0x26e427)[_0x9705('0x1d')](_0x21a504);}};}function respondWithFilteredResult(_0x16ff6a,_0x5ea4fe){return function(_0x1e6fb7){if(_0x1e6fb7){var _0x1c75b1=typeof _0x5ea4fe['offset']==='undefined'&&typeof _0x5ea4fe['limit']===_0x9705('0x1e');var _0x5cfdbe=_0x1e6fb7[_0x9705('0x1f')];var _0x3e8214=_0x1c75b1?0x0:_0x5ea4fe[_0x9705('0x20')];var _0x2ab24d=_0x1c75b1?_0x1e6fb7[_0x9705('0x1f')]:_0x5ea4fe[_0x9705('0x20')]+_0x5ea4fe[_0x9705('0x21')];var _0x58fe8a;if(_0x2ab24d>=_0x5cfdbe){_0x2ab24d=_0x5cfdbe;_0x58fe8a=0xc8;}else{_0x58fe8a=0xce;}_0x16ff6a[_0x9705('0x1c')](_0x58fe8a);return _0x16ff6a['set'](_0x9705('0x22'),_0x3e8214+'-'+_0x2ab24d+'/'+_0x5cfdbe)['json'](_0x1e6fb7);}return null;};}function patchUpdates(_0x985ff8){return function(_0x588c06){try{jsonpatch['apply'](_0x588c06,_0x985ff8,!![]);}catch(_0x16d026){return BPromise['reject'](_0x16d026);}return _0x588c06[_0x9705('0x23')]();};}function saveUpdates(_0x4ce40a,_0x262fb5){return function(_0x424b27){if(_0x424b27){return _0x424b27[_0x9705('0x24')](_0x4ce40a)[_0x9705('0x25')](function(_0x3fe21a){return _0x3fe21a;});}return null;};}function removeEntity(_0x30acb9,_0x1518fb){return function(_0x294719){if(_0x294719){return _0x294719[_0x9705('0x26')]()['then'](function(){_0x30acb9[_0x9705('0x1c')](0xcc)[_0x9705('0x1b')]();});}};}function handleEntityNotFound(_0x31f95b,_0x5bec22){return function(_0xfbcb06){if(!_0xfbcb06){_0x31f95b[_0x9705('0x1a')](0x194);}return _0xfbcb06;};}function handleError(_0x1dec79,_0x370f97){_0x370f97=_0x370f97||0x1f4;return function(_0xd37fc1){logger['error'](_0xd37fc1[_0x9705('0x27')]);if(_0xd37fc1[_0x9705('0x28')]){delete _0xd37fc1[_0x9705('0x28')];}_0x1dec79[_0x9705('0x1c')](_0x370f97)[_0x9705('0x29')](_0xd37fc1);};}exports['index']=function(_0x194987,_0x2b782b){var _0x2fbc64={},_0x34ba28={},_0x3bcfcd={'count':0x0,'rows':[]};var _0x487104=_[_0x9705('0x2a')](db[_0x9705('0x2b')][_0x9705('0x2c')],function(_0x57125d){return{'name':_0x57125d[_0x9705('0x2d')],'type':_0x57125d[_0x9705('0x2e')]['key']};});_0x34ba28[_0x9705('0x2f')]=_[_0x9705('0x2a')](_0x487104,_0x9705('0x28'));_0x34ba28['query']=_['keys'](_0x194987[_0x9705('0x30')]);_0x34ba28['filters']=_[_0x9705('0x31')](_0x34ba28['model'],_0x34ba28['query']);_0x2fbc64[_0x9705('0x32')]=_[_0x9705('0x31')](_0x34ba28[_0x9705('0x2f')],qs[_0x9705('0x33')](_0x194987[_0x9705('0x30')][_0x9705('0x33')]));_0x2fbc64[_0x9705('0x32')]=_0x2fbc64['attributes']['length']?_0x2fbc64[_0x9705('0x32')]:_0x34ba28['model'];if(!_0x194987[_0x9705('0x30')][_0x9705('0x34')](_0x9705('0x35'))){_0x2fbc64[_0x9705('0x21')]=qs[_0x9705('0x21')](_0x194987[_0x9705('0x30')][_0x9705('0x21')]);_0x2fbc64['offset']=qs[_0x9705('0x20')](_0x194987[_0x9705('0x30')]['offset']);}_0x2fbc64['order']=qs[_0x9705('0x36')](_0x194987['query']['sort']);_0x2fbc64['where']=qs[_0x9705('0x37')](_[_0x9705('0x38')](_0x194987[_0x9705('0x30')],_0x34ba28[_0x9705('0x37')]),_0x487104);if(_0x194987[_0x9705('0x30')]['filter']){_0x2fbc64[_0x9705('0x39')]=_[_0x9705('0x3a')](_0x2fbc64[_0x9705('0x39')],{'$or':_['map'](_0x487104,function(_0x4afdb2){if(_0x4afdb2['type']!==_0x9705('0x3b')){var _0x30f829={};_0x30f829[_0x4afdb2[_0x9705('0x28')]]={'$like':'%'+_0x194987[_0x9705('0x30')][_0x9705('0x3c')]+'%'};return _0x30f829;}})});}_0x2fbc64=_[_0x9705('0x3a')]({},_0x2fbc64,_0x194987[_0x9705('0x3d')]);var _0x5bf38c={'where':_0x2fbc64[_0x9705('0x39')]};return db['ZohoConfiguration'][_0x9705('0x1f')](_0x5bf38c)[_0x9705('0x25')](function(_0x406cd1){_0x3bcfcd['count']=_0x406cd1;if(_0x194987[_0x9705('0x30')][_0x9705('0x3e')]){_0x2fbc64[_0x9705('0x3f')]=[{'all':!![]}];}return db[_0x9705('0x2b')][_0x9705('0x40')](_0x2fbc64);})[_0x9705('0x25')](function(_0x1efc5a){_0x3bcfcd['rows']=_0x1efc5a;return _0x3bcfcd;})[_0x9705('0x25')](respondWithFilteredResult(_0x2b782b,_0x2fbc64))[_0x9705('0x41')](handleError(_0x2b782b,null));};exports[_0x9705('0x42')]=function(_0xf6d0d6,_0x246c85){var _0x56681b={'raw':![],'where':{'id':_0xf6d0d6['params']['id']}},_0x19e21c={};_0x19e21c[_0x9705('0x2f')]=_[_0x9705('0x43')](db['ZohoConfiguration']['rawAttributes']);_0x19e21c[_0x9705('0x30')]=_[_0x9705('0x43')](_0xf6d0d6[_0x9705('0x30')]);_0x19e21c[_0x9705('0x37')]=_[_0x9705('0x31')](_0x19e21c[_0x9705('0x2f')],_0x19e21c[_0x9705('0x30')]);_0x56681b[_0x9705('0x32')]=_[_0x9705('0x31')](_0x19e21c[_0x9705('0x2f')],qs[_0x9705('0x33')](_0xf6d0d6[_0x9705('0x30')][_0x9705('0x33')]));_0x56681b['attributes']=_0x56681b[_0x9705('0x32')][_0x9705('0x44')]?_0x56681b[_0x9705('0x32')]:_0x19e21c[_0x9705('0x2f')];if(_0xf6d0d6['query'][_0x9705('0x3e')]){_0x56681b['include']=[{'all':!![]}];}_0x56681b=_['merge']({},_0x56681b,_0xf6d0d6[_0x9705('0x3d')]);return db[_0x9705('0x2b')][_0x9705('0x45')](_0x56681b)['then'](handleEntityNotFound(_0x246c85,null))[_0x9705('0x25')](respondWithResult(_0x246c85,null))[_0x9705('0x41')](handleError(_0x246c85,null));};exports[_0x9705('0x46')]=function(_0x10170c,_0x377c25){return db[_0x9705('0x2b')][_0x9705('0x46')](_0x10170c[_0x9705('0x47')],{})[_0x9705('0x25')](respondWithResult(_0x377c25,0xc9))['catch'](handleError(_0x377c25,null));};exports['update']=function(_0xff999e,_0x3a1263){if(_0xff999e[_0x9705('0x47')]['id']){delete _0xff999e[_0x9705('0x47')]['id'];}return db[_0x9705('0x2b')]['find']({'where':{'id':_0xff999e['params']['id']}})[_0x9705('0x25')](handleEntityNotFound(_0x3a1263,null))[_0x9705('0x25')](saveUpdates(_0xff999e[_0x9705('0x47')],null))[_0x9705('0x25')](respondWithResult(_0x3a1263,null))[_0x9705('0x41')](handleError(_0x3a1263,null));};exports['destroy']=function(_0x59027f,_0x17bc68){return db['ZohoConfiguration'][_0x9705('0x45')]({'where':{'id':_0x59027f[_0x9705('0x48')]['id']}})[_0x9705('0x25')](handleEntityNotFound(_0x17bc68,null))[_0x9705('0x25')](removeEntity(_0x17bc68,null))['catch'](handleError(_0x17bc68,null));};exports[_0x9705('0x49')]=function(_0x847f0c,_0x37cb27,_0x4e6ed5){var _0x4c6147={};var _0x2c9c90={};var _0x58413d;var _0x10dfdc;return db[_0x9705('0x2b')][_0x9705('0x4a')]({'where':{'id':_0x847f0c['params']['id']}})[_0x9705('0x25')](handleEntityNotFound(_0x37cb27,null))['then'](function(_0x1a34ab){if(_0x1a34ab){_0x58413d=_0x1a34ab;_0x2c9c90[_0x9705('0x2f')]=_[_0x9705('0x43')](db['ZohoField'][_0x9705('0x2c')]);_0x2c9c90[_0x9705('0x30')]=_['keys'](_0x847f0c[_0x9705('0x30')]);_0x2c9c90[_0x9705('0x37')]=_[_0x9705('0x31')](_0x2c9c90[_0x9705('0x2f')],_0x2c9c90[_0x9705('0x30')]);_0x4c6147[_0x9705('0x32')]=_[_0x9705('0x31')](_0x2c9c90[_0x9705('0x2f')],qs['fields'](_0x847f0c['query'][_0x9705('0x33')]));_0x4c6147[_0x9705('0x32')]=_0x4c6147[_0x9705('0x32')][_0x9705('0x44')]?_0x4c6147[_0x9705('0x32')]:_0x2c9c90['model'];_0x4c6147[_0x9705('0x4b')]=qs[_0x9705('0x36')](_0x847f0c[_0x9705('0x30')][_0x9705('0x36')]);_0x4c6147[_0x9705('0x39')]=qs['filters'](_[_0x9705('0x38')](_0x847f0c[_0x9705('0x30')],_0x2c9c90['filters']));if(_0x847f0c[_0x9705('0x30')][_0x9705('0x3c')]){_0x4c6147[_0x9705('0x39')]=_[_0x9705('0x3a')](_0x4c6147[_0x9705('0x39')],{'$or':_['map'](_0x4c6147['attributes'],function(_0x476246){var _0x3fe6c5={};_0x3fe6c5[_0x476246]={'$like':'%'+_0x847f0c[_0x9705('0x30')][_0x9705('0x3c')]+'%'};return _0x3fe6c5;})});}_0x4c6147=_[_0x9705('0x3a')]({},_0x4c6147,_0x847f0c[_0x9705('0x3d')]);return _0x58413d[_0x9705('0x49')](_0x4c6147);}})['then'](function(_0x501d2b){if(_0x501d2b){_0x10dfdc=_0x501d2b[_0x9705('0x44')];if(!_0x847f0c[_0x9705('0x30')]['hasOwnProperty'](_0x9705('0x35'))){_0x4c6147['limit']=qs[_0x9705('0x21')](_0x847f0c[_0x9705('0x30')][_0x9705('0x21')]);_0x4c6147['offset']=qs[_0x9705('0x20')](_0x847f0c[_0x9705('0x30')]['offset']);}return _0x58413d['getFields'](_0x4c6147);}})[_0x9705('0x25')](function(_0x26e510){if(_0x26e510){return _0x26e510?{'count':_0x10dfdc,'rows':_0x26e510}:null;}})[_0x9705('0x25')](respondWithResult(_0x37cb27,null))[_0x9705('0x41')](handleError(_0x37cb27,null));};exports[_0x9705('0x4c')]=function(_0x3ca0d4,_0x3586bb,_0x3058d3){var _0x24c339={};var _0x5026ee={};var _0x511125;var _0x3ea541;return db[_0x9705('0x2b')][_0x9705('0x4a')]({'where':{'id':_0x3ca0d4[_0x9705('0x48')]['id']}})[_0x9705('0x25')](handleEntityNotFound(_0x3586bb,null))[_0x9705('0x25')](function(_0x52b7cb){if(_0x52b7cb){_0x511125=_0x52b7cb;_0x5026ee[_0x9705('0x2f')]=_['keys'](db[_0x9705('0x4d')][_0x9705('0x2c')]);_0x5026ee[_0x9705('0x30')]=_['keys'](_0x3ca0d4[_0x9705('0x30')]);_0x5026ee[_0x9705('0x37')]=_['intersection'](_0x5026ee[_0x9705('0x2f')],_0x5026ee[_0x9705('0x30')]);_0x24c339[_0x9705('0x32')]=_[_0x9705('0x31')](_0x5026ee[_0x9705('0x2f')],qs[_0x9705('0x33')](_0x3ca0d4[_0x9705('0x30')]['fields']));_0x24c339[_0x9705('0x32')]=_0x24c339[_0x9705('0x32')]['length']?_0x24c339['attributes']:_0x5026ee[_0x9705('0x2f')];_0x24c339[_0x9705('0x4b')]=qs[_0x9705('0x36')](_0x3ca0d4[_0x9705('0x30')]['sort']);_0x24c339[_0x9705('0x39')]=qs['filters'](_[_0x9705('0x38')](_0x3ca0d4[_0x9705('0x30')],_0x5026ee['filters']));if(_0x3ca0d4[_0x9705('0x30')]['filter']){_0x24c339['where']=_[_0x9705('0x3a')](_0x24c339['where'],{'$or':_[_0x9705('0x2a')](_0x24c339[_0x9705('0x32')],function(_0x2bf635){var _0x4e1dfa={};_0x4e1dfa[_0x2bf635]={'$like':'%'+_0x3ca0d4[_0x9705('0x30')][_0x9705('0x3c')]+'%'};return _0x4e1dfa;})});}_0x24c339=_['merge']({},_0x24c339,_0x3ca0d4['options']);return _0x511125['getSubjects'](_0x24c339);}})[_0x9705('0x25')](function(_0x23af2d){if(_0x23af2d){_0x3ea541=_0x23af2d[_0x9705('0x44')];if(!_0x3ca0d4[_0x9705('0x30')][_0x9705('0x34')](_0x9705('0x35'))){_0x24c339[_0x9705('0x21')]=qs['limit'](_0x3ca0d4[_0x9705('0x30')]['limit']);_0x24c339[_0x9705('0x20')]=qs[_0x9705('0x20')](_0x3ca0d4['query'][_0x9705('0x20')]);}return _0x511125[_0x9705('0x4c')](_0x24c339);}})[_0x9705('0x25')](function(_0x5966f7){if(_0x5966f7){return _0x5966f7?{'count':_0x3ea541,'rows':_0x5966f7}:null;}})[_0x9705('0x25')](respondWithResult(_0x3586bb,null))['catch'](handleError(_0x3586bb,null));};exports[_0x9705('0x4e')]=function(_0x2cad89,_0x417c98,_0x2be818){var _0xc31cb5={};var _0x28e9a8={};var _0x350567;var _0x398dd3;return db[_0x9705('0x2b')]['findOne']({'where':{'id':_0x2cad89[_0x9705('0x48')]['id']}})['then'](handleEntityNotFound(_0x417c98,null))['then'](function(_0x1c2d73){if(_0x1c2d73){_0x350567=_0x1c2d73;_0x28e9a8[_0x9705('0x2f')]=_['keys'](db[_0x9705('0x4d')][_0x9705('0x2c')]);_0x28e9a8[_0x9705('0x30')]=_['keys'](_0x2cad89[_0x9705('0x30')]);_0x28e9a8[_0x9705('0x37')]=_[_0x9705('0x31')](_0x28e9a8[_0x9705('0x2f')],_0x28e9a8[_0x9705('0x30')]);_0xc31cb5[_0x9705('0x32')]=_[_0x9705('0x31')](_0x28e9a8[_0x9705('0x2f')],qs[_0x9705('0x33')](_0x2cad89['query']['fields']));_0xc31cb5[_0x9705('0x32')]=_0xc31cb5[_0x9705('0x32')][_0x9705('0x44')]?_0xc31cb5['attributes']:_0x28e9a8['model'];_0xc31cb5[_0x9705('0x4b')]=qs[_0x9705('0x36')](_0x2cad89['query'][_0x9705('0x36')]);_0xc31cb5['where']=qs[_0x9705('0x37')](_[_0x9705('0x38')](_0x2cad89['query'],_0x28e9a8[_0x9705('0x37')]));if(_0x2cad89['query'][_0x9705('0x3c')]){_0xc31cb5[_0x9705('0x39')]=_[_0x9705('0x3a')](_0xc31cb5[_0x9705('0x39')],{'$or':_[_0x9705('0x2a')](_0xc31cb5[_0x9705('0x32')],function(_0x2bfa9d){var _0x1de005={};_0x1de005[_0x2bfa9d]={'$like':'%'+_0x2cad89['query'][_0x9705('0x3c')]+'%'};return _0x1de005;})});}_0xc31cb5=_[_0x9705('0x3a')]({},_0xc31cb5,_0x2cad89[_0x9705('0x3d')]);return _0x350567['getDescriptions'](_0xc31cb5);}})[_0x9705('0x25')](function(_0x2a2889){if(_0x2a2889){_0x398dd3=_0x2a2889[_0x9705('0x44')];if(!_0x2cad89[_0x9705('0x30')][_0x9705('0x34')](_0x9705('0x35'))){_0xc31cb5[_0x9705('0x21')]=qs[_0x9705('0x21')](_0x2cad89[_0x9705('0x30')]['limit']);_0xc31cb5[_0x9705('0x20')]=qs[_0x9705('0x20')](_0x2cad89[_0x9705('0x30')]['offset']);}return _0x350567[_0x9705('0x4e')](_0xc31cb5);}})[_0x9705('0x25')](function(_0x24bb9){if(_0x24bb9){return _0x24bb9?{'count':_0x398dd3,'rows':_0x24bb9}:null;}})[_0x9705('0x25')](respondWithResult(_0x417c98,null))[_0x9705('0x41')](handleError(_0x417c98,null));}; \ No newline at end of file +var _0x1c84=['sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','create','body','find','getFields','ZohoField','order','pick','options','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x25ec29,_0x57082a){var _0x52214d=function(_0x360063){while(--_0x360063){_0x25ec29['push'](_0x25ec29['shift']());}};_0x52214d(++_0x57082a);}(_0x1c84,0x1da));var _0x41c8=function(_0x1d9813,_0x4ca59d){_0x1d9813=_0x1d9813-0x0;var _0x561d3e=_0x1c84[_0x1d9813];return _0x561d3e;};'use strict';var emlformat=require(_0x41c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41c8('0x1'));var jsonpatch=require(_0x41c8('0x2'));var rp=require(_0x41c8('0x3'));var moment=require('moment');var BPromise=require(_0x41c8('0x4'));var Mustache=require('mustache');var util=require(_0x41c8('0x5'));var path=require('path');var sox=require(_0x41c8('0x6'));var csv=require(_0x41c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41c8('0x8'));var _=require(_0x41c8('0x9'));var squel=require('squel');var crypto=require(_0x41c8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x41c8('0xb'));var toCsv=require(_0x41c8('0x7'));var querystring=require(_0x41c8('0xc'));var Papa=require('papaparse');var Redis=require(_0x41c8('0xd'));var authService=require(_0x41c8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x41c8('0xf'));var hardwareService=require(_0x41c8('0x10'));var logger=require(_0x41c8('0x11'))(_0x41c8('0x12'));var utils=require(_0x41c8('0x13'));var config=require(_0x41c8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c97f1,_0x338e06){_0x338e06=_0x338e06||0xcc;return function(_0x5eadbd){if(_0x5eadbd){return _0x5c97f1[_0x41c8('0x15')](_0x338e06);}return _0x5c97f1[_0x41c8('0x16')](_0x338e06)[_0x41c8('0x17')]();};}function respondWithResult(_0x2ce206,_0x558d82){_0x558d82=_0x558d82||0xc8;return function(_0x89d00f){if(_0x89d00f){return _0x2ce206[_0x41c8('0x16')](_0x558d82)[_0x41c8('0x18')](_0x89d00f);}};}function respondWithFilteredResult(_0x53cfbb,_0x3c071a){return function(_0x3bd64c){if(_0x3bd64c){var _0x5b4a78=typeof _0x3c071a[_0x41c8('0x19')]===_0x41c8('0x1a')&&typeof _0x3c071a[_0x41c8('0x1b')]===_0x41c8('0x1a');var _0x2e9d23=_0x3bd64c['count'];var _0x21ccfe=_0x5b4a78?0x0:_0x3c071a[_0x41c8('0x19')];var _0x59af8e=_0x5b4a78?_0x3bd64c[_0x41c8('0x1c')]:_0x3c071a[_0x41c8('0x19')]+_0x3c071a[_0x41c8('0x1b')];var _0x2e6c38;if(_0x59af8e>=_0x2e9d23){_0x59af8e=_0x2e9d23;_0x2e6c38=0xc8;}else{_0x2e6c38=0xce;}_0x53cfbb['status'](_0x2e6c38);return _0x53cfbb[_0x41c8('0x1d')](_0x41c8('0x1e'),_0x21ccfe+'-'+_0x59af8e+'/'+_0x2e9d23)[_0x41c8('0x18')](_0x3bd64c);}return null;};}function patchUpdates(_0x8a04e0){return function(_0x22bcf6){try{jsonpatch[_0x41c8('0x1f')](_0x22bcf6,_0x8a04e0,!![]);}catch(_0x137249){return BPromise['reject'](_0x137249);}return _0x22bcf6[_0x41c8('0x20')]();};}function saveUpdates(_0x170c93,_0x212935){return function(_0xbe95d1){if(_0xbe95d1){return _0xbe95d1[_0x41c8('0x21')](_0x170c93)[_0x41c8('0x22')](function(_0x4a6db3){return _0x4a6db3;});}return null;};}function removeEntity(_0x5582ae,_0x4c8a0d){return function(_0x5a4f20){if(_0x5a4f20){return _0x5a4f20[_0x41c8('0x23')]()[_0x41c8('0x22')](function(){_0x5582ae[_0x41c8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e058a,_0x589cf9){return function(_0x564837){if(!_0x564837){_0x3e058a[_0x41c8('0x15')](0x194);}return _0x564837;};}function handleError(_0x300fb4,_0x58ab74){_0x58ab74=_0x58ab74||0x1f4;return function(_0x416c51){logger[_0x41c8('0x24')](_0x416c51[_0x41c8('0x25')]);if(_0x416c51[_0x41c8('0x26')]){delete _0x416c51[_0x41c8('0x26')];}_0x300fb4['status'](_0x58ab74)[_0x41c8('0x27')](_0x416c51);};}exports[_0x41c8('0x28')]=function(_0x49ed80,_0x444949){var _0x1cfe9b={},_0xbcb0ba={},_0xd4efa7={'count':0x0,'rows':[]};var _0x4e0e83=_[_0x41c8('0x29')](db[_0x41c8('0x2a')][_0x41c8('0x2b')],function(_0x4109f6){return{'name':_0x4109f6[_0x41c8('0x2c')],'type':_0x4109f6[_0x41c8('0x2d')][_0x41c8('0x2e')]};});_0xbcb0ba[_0x41c8('0x2f')]=_[_0x41c8('0x29')](_0x4e0e83,_0x41c8('0x26'));_0xbcb0ba['query']=_[_0x41c8('0x30')](_0x49ed80[_0x41c8('0x31')]);_0xbcb0ba[_0x41c8('0x32')]=_[_0x41c8('0x33')](_0xbcb0ba[_0x41c8('0x2f')],_0xbcb0ba[_0x41c8('0x31')]);_0x1cfe9b['attributes']=_[_0x41c8('0x33')](_0xbcb0ba[_0x41c8('0x2f')],qs[_0x41c8('0x34')](_0x49ed80['query']['fields']));_0x1cfe9b['attributes']=_0x1cfe9b[_0x41c8('0x35')][_0x41c8('0x36')]?_0x1cfe9b[_0x41c8('0x35')]:_0xbcb0ba[_0x41c8('0x2f')];if(!_0x49ed80[_0x41c8('0x31')][_0x41c8('0x37')](_0x41c8('0x38'))){_0x1cfe9b['limit']=qs[_0x41c8('0x1b')](_0x49ed80[_0x41c8('0x31')][_0x41c8('0x1b')]);_0x1cfe9b[_0x41c8('0x19')]=qs[_0x41c8('0x19')](_0x49ed80['query'][_0x41c8('0x19')]);}_0x1cfe9b['order']=qs[_0x41c8('0x39')](_0x49ed80['query'][_0x41c8('0x39')]);_0x1cfe9b[_0x41c8('0x3a')]=qs['filters'](_['pick'](_0x49ed80[_0x41c8('0x31')],_0xbcb0ba[_0x41c8('0x32')]),_0x4e0e83);if(_0x49ed80[_0x41c8('0x31')][_0x41c8('0x3b')]){_0x1cfe9b['where']=_['merge'](_0x1cfe9b[_0x41c8('0x3a')],{'$or':_['map'](_0x4e0e83,function(_0x4fcd77){if(_0x4fcd77[_0x41c8('0x2d')]!==_0x41c8('0x3c')){var _0x5a2535={};_0x5a2535[_0x4fcd77[_0x41c8('0x26')]]={'$like':'%'+_0x49ed80[_0x41c8('0x31')][_0x41c8('0x3b')]+'%'};return _0x5a2535;}})});}_0x1cfe9b=_[_0x41c8('0x3d')]({},_0x1cfe9b,_0x49ed80['options']);var _0x51a219={'where':_0x1cfe9b[_0x41c8('0x3a')]};return db[_0x41c8('0x2a')]['count'](_0x51a219)['then'](function(_0x34dd19){_0xd4efa7[_0x41c8('0x1c')]=_0x34dd19;if(_0x49ed80[_0x41c8('0x31')][_0x41c8('0x3e')]){_0x1cfe9b['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x41c8('0x3f')](_0x1cfe9b);})['then'](function(_0x257056){_0xd4efa7[_0x41c8('0x40')]=_0x257056;return _0xd4efa7;})[_0x41c8('0x22')](respondWithFilteredResult(_0x444949,_0x1cfe9b))[_0x41c8('0x41')](handleError(_0x444949,null));};exports[_0x41c8('0x42')]=function(_0x46f17d,_0x3d242e){var _0x5a0fe8={'raw':![],'where':{'id':_0x46f17d[_0x41c8('0x43')]['id']}},_0x32594f={};_0x32594f[_0x41c8('0x2f')]=_['keys'](db[_0x41c8('0x2a')][_0x41c8('0x2b')]);_0x32594f[_0x41c8('0x31')]=_[_0x41c8('0x30')](_0x46f17d[_0x41c8('0x31')]);_0x32594f[_0x41c8('0x32')]=_[_0x41c8('0x33')](_0x32594f['model'],_0x32594f[_0x41c8('0x31')]);_0x5a0fe8[_0x41c8('0x35')]=_[_0x41c8('0x33')](_0x32594f[_0x41c8('0x2f')],qs['fields'](_0x46f17d[_0x41c8('0x31')][_0x41c8('0x34')]));_0x5a0fe8['attributes']=_0x5a0fe8['attributes'][_0x41c8('0x36')]?_0x5a0fe8[_0x41c8('0x35')]:_0x32594f[_0x41c8('0x2f')];if(_0x46f17d[_0x41c8('0x31')]['includeAll']){_0x5a0fe8[_0x41c8('0x44')]=[{'all':!![]}];}_0x5a0fe8=_[_0x41c8('0x3d')]({},_0x5a0fe8,_0x46f17d['options']);return db['ZohoConfiguration']['find'](_0x5a0fe8)[_0x41c8('0x22')](handleEntityNotFound(_0x3d242e,null))[_0x41c8('0x22')](respondWithResult(_0x3d242e,null))['catch'](handleError(_0x3d242e,null));};exports[_0x41c8('0x45')]=function(_0x1a5f3c,_0x108bc8){return db['ZohoConfiguration'][_0x41c8('0x45')](_0x1a5f3c['body'],{})[_0x41c8('0x22')](respondWithResult(_0x108bc8,0xc9))[_0x41c8('0x41')](handleError(_0x108bc8,null));};exports[_0x41c8('0x21')]=function(_0x411666,_0x3e2822){if(_0x411666[_0x41c8('0x46')]['id']){delete _0x411666[_0x41c8('0x46')]['id'];}return db[_0x41c8('0x2a')][_0x41c8('0x47')]({'where':{'id':_0x411666[_0x41c8('0x43')]['id']}})[_0x41c8('0x22')](handleEntityNotFound(_0x3e2822,null))[_0x41c8('0x22')](saveUpdates(_0x411666[_0x41c8('0x46')],null))[_0x41c8('0x22')](respondWithResult(_0x3e2822,null))[_0x41c8('0x41')](handleError(_0x3e2822,null));};exports[_0x41c8('0x23')]=function(_0x5c97b0,_0x30e748){return db[_0x41c8('0x2a')]['find']({'where':{'id':_0x5c97b0[_0x41c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x30e748,null))[_0x41c8('0x22')](removeEntity(_0x30e748,null))[_0x41c8('0x41')](handleError(_0x30e748,null));};exports[_0x41c8('0x48')]=function(_0x7a0a24,_0x963dde,_0xc763f6){var _0xa55209={};var _0x524162={};var _0x4ee067;var _0x1ade28;return db[_0x41c8('0x2a')]['findOne']({'where':{'id':_0x7a0a24['params']['id']}})[_0x41c8('0x22')](handleEntityNotFound(_0x963dde,null))[_0x41c8('0x22')](function(_0x29a85f){if(_0x29a85f){_0x4ee067=_0x29a85f;_0x524162[_0x41c8('0x2f')]=_['keys'](db[_0x41c8('0x49')]['rawAttributes']);_0x524162[_0x41c8('0x31')]=_[_0x41c8('0x30')](_0x7a0a24[_0x41c8('0x31')]);_0x524162[_0x41c8('0x32')]=_[_0x41c8('0x33')](_0x524162[_0x41c8('0x2f')],_0x524162['query']);_0xa55209[_0x41c8('0x35')]=_['intersection'](_0x524162[_0x41c8('0x2f')],qs[_0x41c8('0x34')](_0x7a0a24[_0x41c8('0x31')][_0x41c8('0x34')]));_0xa55209[_0x41c8('0x35')]=_0xa55209['attributes'][_0x41c8('0x36')]?_0xa55209[_0x41c8('0x35')]:_0x524162['model'];_0xa55209[_0x41c8('0x4a')]=qs['sort'](_0x7a0a24[_0x41c8('0x31')]['sort']);_0xa55209['where']=qs[_0x41c8('0x32')](_[_0x41c8('0x4b')](_0x7a0a24[_0x41c8('0x31')],_0x524162[_0x41c8('0x32')]));if(_0x7a0a24[_0x41c8('0x31')][_0x41c8('0x3b')]){_0xa55209['where']=_['merge'](_0xa55209['where'],{'$or':_['map'](_0xa55209[_0x41c8('0x35')],function(_0x316d38){var _0x8d6ff2={};_0x8d6ff2[_0x316d38]={'$like':'%'+_0x7a0a24[_0x41c8('0x31')]['filter']+'%'};return _0x8d6ff2;})});}_0xa55209=_[_0x41c8('0x3d')]({},_0xa55209,_0x7a0a24[_0x41c8('0x4c')]);return _0x4ee067[_0x41c8('0x48')](_0xa55209);}})['then'](function(_0x2dc232){if(_0x2dc232){_0x1ade28=_0x2dc232['length'];if(!_0x7a0a24[_0x41c8('0x31')][_0x41c8('0x37')]('nolimit')){_0xa55209[_0x41c8('0x1b')]=qs[_0x41c8('0x1b')](_0x7a0a24['query']['limit']);_0xa55209[_0x41c8('0x19')]=qs[_0x41c8('0x19')](_0x7a0a24[_0x41c8('0x31')]['offset']);}return _0x4ee067['getFields'](_0xa55209);}})[_0x41c8('0x22')](function(_0x1214ff){if(_0x1214ff){return _0x1214ff?{'count':_0x1ade28,'rows':_0x1214ff}:null;}})[_0x41c8('0x22')](respondWithResult(_0x963dde,null))['catch'](handleError(_0x963dde,null));};exports[_0x41c8('0x4d')]=function(_0x580015,_0x5637ea,_0x2b3758){var _0x5c4494={};var _0xa0929b={};var _0x175ea6;var _0x4755f3;return db[_0x41c8('0x2a')][_0x41c8('0x4e')]({'where':{'id':_0x580015[_0x41c8('0x43')]['id']}})[_0x41c8('0x22')](handleEntityNotFound(_0x5637ea,null))[_0x41c8('0x22')](function(_0x31a09a){if(_0x31a09a){_0x175ea6=_0x31a09a;_0xa0929b[_0x41c8('0x2f')]=_[_0x41c8('0x30')](db[_0x41c8('0x49')][_0x41c8('0x2b')]);_0xa0929b[_0x41c8('0x31')]=_['keys'](_0x580015[_0x41c8('0x31')]);_0xa0929b[_0x41c8('0x32')]=_[_0x41c8('0x33')](_0xa0929b[_0x41c8('0x2f')],_0xa0929b[_0x41c8('0x31')]);_0x5c4494[_0x41c8('0x35')]=_['intersection'](_0xa0929b[_0x41c8('0x2f')],qs[_0x41c8('0x34')](_0x580015[_0x41c8('0x31')][_0x41c8('0x34')]));_0x5c4494[_0x41c8('0x35')]=_0x5c4494[_0x41c8('0x35')][_0x41c8('0x36')]?_0x5c4494[_0x41c8('0x35')]:_0xa0929b[_0x41c8('0x2f')];_0x5c4494['order']=qs[_0x41c8('0x39')](_0x580015[_0x41c8('0x31')][_0x41c8('0x39')]);_0x5c4494[_0x41c8('0x3a')]=qs[_0x41c8('0x32')](_[_0x41c8('0x4b')](_0x580015[_0x41c8('0x31')],_0xa0929b[_0x41c8('0x32')]));if(_0x580015[_0x41c8('0x31')]['filter']){_0x5c4494[_0x41c8('0x3a')]=_[_0x41c8('0x3d')](_0x5c4494[_0x41c8('0x3a')],{'$or':_[_0x41c8('0x29')](_0x5c4494[_0x41c8('0x35')],function(_0x53bb47){var _0x55a826={};_0x55a826[_0x53bb47]={'$like':'%'+_0x580015[_0x41c8('0x31')][_0x41c8('0x3b')]+'%'};return _0x55a826;})});}_0x5c4494=_[_0x41c8('0x3d')]({},_0x5c4494,_0x580015[_0x41c8('0x4c')]);return _0x175ea6[_0x41c8('0x4d')](_0x5c4494);}})[_0x41c8('0x22')](function(_0x25f84e){if(_0x25f84e){_0x4755f3=_0x25f84e[_0x41c8('0x36')];if(!_0x580015[_0x41c8('0x31')][_0x41c8('0x37')](_0x41c8('0x38'))){_0x5c4494[_0x41c8('0x1b')]=qs[_0x41c8('0x1b')](_0x580015['query'][_0x41c8('0x1b')]);_0x5c4494[_0x41c8('0x19')]=qs[_0x41c8('0x19')](_0x580015[_0x41c8('0x31')]['offset']);}return _0x175ea6[_0x41c8('0x4d')](_0x5c4494);}})['then'](function(_0x50599b){if(_0x50599b){return _0x50599b?{'count':_0x4755f3,'rows':_0x50599b}:null;}})[_0x41c8('0x22')](respondWithResult(_0x5637ea,null))[_0x41c8('0x41')](handleError(_0x5637ea,null));};exports[_0x41c8('0x4f')]=function(_0x4ae770,_0x6c906f,_0x56a472){var _0x41be3e={};var _0x4b601d={};var _0x2daa09;var _0x56c5ab;return db[_0x41c8('0x2a')][_0x41c8('0x4e')]({'where':{'id':_0x4ae770[_0x41c8('0x43')]['id']}})[_0x41c8('0x22')](handleEntityNotFound(_0x6c906f,null))[_0x41c8('0x22')](function(_0x4b70e2){if(_0x4b70e2){_0x2daa09=_0x4b70e2;_0x4b601d[_0x41c8('0x2f')]=_[_0x41c8('0x30')](db['ZohoField'][_0x41c8('0x2b')]);_0x4b601d[_0x41c8('0x31')]=_[_0x41c8('0x30')](_0x4ae770[_0x41c8('0x31')]);_0x4b601d[_0x41c8('0x32')]=_[_0x41c8('0x33')](_0x4b601d[_0x41c8('0x2f')],_0x4b601d[_0x41c8('0x31')]);_0x41be3e[_0x41c8('0x35')]=_[_0x41c8('0x33')](_0x4b601d[_0x41c8('0x2f')],qs[_0x41c8('0x34')](_0x4ae770['query']['fields']));_0x41be3e[_0x41c8('0x35')]=_0x41be3e[_0x41c8('0x35')][_0x41c8('0x36')]?_0x41be3e['attributes']:_0x4b601d[_0x41c8('0x2f')];_0x41be3e[_0x41c8('0x4a')]=qs[_0x41c8('0x39')](_0x4ae770[_0x41c8('0x31')]['sort']);_0x41be3e[_0x41c8('0x3a')]=qs['filters'](_[_0x41c8('0x4b')](_0x4ae770[_0x41c8('0x31')],_0x4b601d[_0x41c8('0x32')]));if(_0x4ae770[_0x41c8('0x31')][_0x41c8('0x3b')]){_0x41be3e[_0x41c8('0x3a')]=_[_0x41c8('0x3d')](_0x41be3e[_0x41c8('0x3a')],{'$or':_[_0x41c8('0x29')](_0x41be3e[_0x41c8('0x35')],function(_0xf2af9f){var _0x529df0={};_0x529df0[_0xf2af9f]={'$like':'%'+_0x4ae770[_0x41c8('0x31')][_0x41c8('0x3b')]+'%'};return _0x529df0;})});}_0x41be3e=_['merge']({},_0x41be3e,_0x4ae770[_0x41c8('0x4c')]);return _0x2daa09[_0x41c8('0x4f')](_0x41be3e);}})[_0x41c8('0x22')](function(_0x32af44){if(_0x32af44){_0x56c5ab=_0x32af44[_0x41c8('0x36')];if(!_0x4ae770[_0x41c8('0x31')][_0x41c8('0x37')]('nolimit')){_0x41be3e[_0x41c8('0x1b')]=qs[_0x41c8('0x1b')](_0x4ae770[_0x41c8('0x31')][_0x41c8('0x1b')]);_0x41be3e[_0x41c8('0x19')]=qs[_0x41c8('0x19')](_0x4ae770[_0x41c8('0x31')]['offset']);}return _0x2daa09['getDescriptions'](_0x41be3e);}})[_0x41c8('0x22')](function(_0x4cf1ef){if(_0x4cf1ef){return _0x4cf1ef?{'count':_0x56c5ab,'rows':_0x4cf1ef}:null;}})['then'](respondWithResult(_0x6c906f,null))[_0x41c8('0x41')](handleError(_0x6c906f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6a37083..592890b 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 _0x8432=['lodash','util','../../config/logger','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x451da3,_0x187268){var _0x56f8c8=function(_0x1da859){while(--_0x1da859){_0x451da3['push'](_0x451da3['shift']());}};_0x56f8c8(++_0x187268);}(_0x8432,0x6e));var _0x2843=function(_0x5349ee,_0x3e8ed9){_0x5349ee=_0x5349ee-0x0;var _0x26dd71=_0x8432[_0x5349ee];return _0x26dd71;};'use strict';var _=require(_0x2843('0x0'));var util=require(_0x2843('0x1'));var logger=require(_0x2843('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2843('0x3'));var fs=require('fs');var path=require(_0x2843('0x4'));var rimraf=require(_0x2843('0x5'));var config=require('../../config/environment');var attributes=require(_0x2843('0x6'));module[_0x2843('0x7')]=function(_0x363af0,_0x3b8165){return _0x363af0[_0x2843('0x8')](_0x2843('0x9'),attributes,{'tableName':_0x2843('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbce6=['rimraf','./intZohoConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x36ee51,_0x1eba8d){var _0x3e90ce=function(_0x163937){while(--_0x163937){_0x36ee51['push'](_0x36ee51['shift']());}};_0x3e90ce(++_0x1eba8d);}(_0xbce6,0x7d));var _0x6bce=function(_0x53d2fe,_0x226c7e){_0x53d2fe=_0x53d2fe-0x0;var _0x1610a8=_0xbce6[_0x53d2fe];return _0x1610a8;};'use strict';var _=require(_0x6bce('0x0'));var util=require(_0x6bce('0x1'));var logger=require(_0x6bce('0x2'))(_0x6bce('0x3'));var moment=require(_0x6bce('0x4'));var BPromise=require('bluebird');var rp=require(_0x6bce('0x5'));var fs=require('fs');var path=require(_0x6bce('0x6'));var rimraf=require(_0x6bce('0x7'));var config=require('../../config/environment');var attributes=require(_0x6bce('0x8'));module[_0x6bce('0x9')]=function(_0x2dc250,_0x5366cc){return _0x2dc250[_0x6bce('0xa')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 94d6f4b..376f830 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 _0x2ded=['error','code','ZohoConfiguration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x48b827,_0x269c4e){var _0x2a0573=function(_0x1de6b4){while(--_0x1de6b4){_0x48b827['push'](_0x48b827['shift']());}};_0x2a0573(++_0x269c4e);}(_0x2ded,0xaf));var _0xd2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ded[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd2de('0x0'));var util=require(_0xd2de('0x1'));var moment=require(_0xd2de('0x2'));var BPromise=require(_0xd2de('0x3'));var rs=require(_0xd2de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2de('0x6'))(_0xd2de('0x7'));var config=require(_0xd2de('0x8'));var jayson=require(_0xd2de('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e6a06,_0x424f11,_0x472e76){return new BPromise(function(_0xab3157,_0x480b03){return client['request'](_0x3e6a06,_0x472e76)['then'](function(_0x510a6e){logger[_0xd2de('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x424f11,'request\x20sent');logger[_0xd2de('0xb')](_0xd2de('0xc'),_0x424f11,_0xd2de('0xd'),JSON[_0xd2de('0xe')](_0x510a6e));if(_0x510a6e['error']){if(_0x510a6e[_0xd2de('0xf')][_0xd2de('0x10')]===0x1f4){logger[_0xd2de('0xf')](_0xd2de('0x11'),_0x424f11,_0x510a6e['error'][_0xd2de('0x12')]);return _0x480b03(_0x510a6e[_0xd2de('0xf')][_0xd2de('0x12')]);}logger['error'](_0xd2de('0x11'),_0x424f11,_0x510a6e[_0xd2de('0xf')][_0xd2de('0x12')]);return _0xab3157(_0x510a6e[_0xd2de('0xf')][_0xd2de('0x12')]);}else{logger[_0xd2de('0xa')](_0xd2de('0x11'),_0x424f11,'request\x20sent');_0xab3157(_0x510a6e['result'][_0xd2de('0x12')]);}})['catch'](function(_0xe94a71){logger['error'](_0xd2de('0x11'),_0x424f11,_0xe94a71);_0x480b03(_0xe94a71);});});} \ No newline at end of file +var _0x01e8=['request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x01e8,0x120));var _0x801e=function(_0x13c5a9,_0x547d90){_0x13c5a9=_0x13c5a9-0x0;var _0x25f7dc=_0x01e8[_0x13c5a9];return _0x25f7dc;};'use strict';var _=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var moment=require('moment');var BPromise=require(_0x801e('0x2'));var rs=require(_0x801e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x801e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x801e('0x5'))(_0x801e('0x6'));var config=require(_0x801e('0x7'));var jayson=require(_0x801e('0x8'));var client=jayson[_0x801e('0x9')][_0x801e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208eb5,_0x32844b,_0x5f1775){return new BPromise(function(_0x359419,_0x2831a8){return client[_0x801e('0xb')](_0x208eb5,_0x5f1775)['then'](function(_0x14fbac){logger[_0x801e('0xc')](_0x801e('0xd'),_0x32844b,_0x801e('0xe'));logger[_0x801e('0xf')](_0x801e('0x10'),_0x32844b,_0x801e('0xe'),JSON[_0x801e('0x11')](_0x14fbac));if(_0x14fbac[_0x801e('0x12')]){if(_0x14fbac['error'][_0x801e('0x13')]===0x1f4){logger[_0x801e('0x12')](_0x801e('0xd'),_0x32844b,_0x14fbac[_0x801e('0x12')][_0x801e('0x14')]);return _0x2831a8(_0x14fbac[_0x801e('0x12')][_0x801e('0x14')]);}logger[_0x801e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x32844b,_0x14fbac[_0x801e('0x12')][_0x801e('0x14')]);return _0x359419(_0x14fbac[_0x801e('0x12')][_0x801e('0x14')]);}else{logger[_0x801e('0xc')](_0x801e('0xd'),_0x32844b,_0x801e('0xe'));_0x359419(_0x14fbac[_0x801e('0x15')][_0x801e('0x14')]);}})[_0x801e('0x16')](function(_0x1c2413){logger[_0x801e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x32844b,_0x1c2413);_0x2831a8(_0x1c2413);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 40b69b8..bff6ff6 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 _0x60a1=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x60a1,0x1db));var _0x160a=function(_0xe8d074,_0x39226a){_0xe8d074=_0xe8d074-0x0;var _0x1898ca=_0x60a1[_0xe8d074];return _0x1898ca;};'use strict';var multer=require(_0x160a('0x0'));var util=require(_0x160a('0x1'));var path=require(_0x160a('0x2'));var timeout=require(_0x160a('0x3'));var express=require(_0x160a('0x4'));var router=express[_0x160a('0x5')]();var fs_extra=require(_0x160a('0x6'));var auth=require(_0x160a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x160a('0x8'));var controller=require(_0x160a('0x9'));router[_0x160a('0xa')]('/',auth['isAuthenticated'](),controller[_0x160a('0xb')]);router['get'](_0x160a('0xc'),auth['isAuthenticated'](),controller[_0x160a('0xd')]);router[_0x160a('0xe')]('/',auth[_0x160a('0xf')](),controller[_0x160a('0x10')]);router[_0x160a('0x11')](_0x160a('0xc'),auth[_0x160a('0xf')](),controller[_0x160a('0x12')]);router['delete'](_0x160a('0xc'),auth[_0x160a('0xf')](),controller[_0x160a('0x13')]);module['exports']=router; \ No newline at end of file +var _0xaaee=['util','path','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x5f22b2,_0x55bd99){var _0x4cdf6b=function(_0x4952b5){while(--_0x4952b5){_0x5f22b2['push'](_0x5f22b2['shift']());}};_0x4cdf6b(++_0x55bd99);}(_0xaaee,0x153));var _0xeaae=function(_0x1da54b,_0x27ff79){_0x1da54b=_0x1da54b-0x0;var _0x4ae74d=_0xaaee[_0x1da54b];return _0x4ae74d;};'use strict';var multer=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var path=require(_0xeaae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeaae('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeaae('0x4'));var controller=require(_0xeaae('0x5'));router[_0xeaae('0x6')]('/',auth[_0xeaae('0x7')](),controller[_0xeaae('0x8')]);router[_0xeaae('0x6')](_0xeaae('0x9'),auth[_0xeaae('0x7')](),controller[_0xeaae('0xa')]);router['post']('/',auth[_0xeaae('0x7')](),controller[_0xeaae('0xb')]);router[_0xeaae('0xc')](_0xeaae('0x9'),auth['isAuthenticated'](),controller[_0xeaae('0xd')]);router[_0xeaae('0xe')](_0xeaae('0x9'),auth[_0xeaae('0x7')](),controller[_0xeaae('0xf')]);module[_0xeaae('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index fff1dc2..aa713d5 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 _0xd562=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x32511e,_0x1942ce){var _0x4cc684=function(_0x4da90e){while(--_0x4da90e){_0x32511e['push'](_0x32511e['shift']());}};_0x4cc684(++_0x1942ce);}(_0xd562,0x1a2));var _0x2d56=function(_0x5f4f03,_0xf00639){_0x5f4f03=_0x5f4f03-0x0;var _0x3bad18=_0xd562[_0x5f4f03];return _0x3bad18;};'use strict';var Sequelize=require(_0x2d56('0x0'));module[_0x2d56('0x1')]={'type':{'type':Sequelize[_0x2d56('0x2')](_0x2d56('0x3'),_0x2d56('0x4'),'customVariable',_0x2d56('0x5'),_0x2d56('0x6')),'defaultValue':_0x2d56('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2d56('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2d56('0x3'),_0x2d56('0x4'),_0x2d56('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2d56('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d56('0x7')]}}; \ No newline at end of file +var _0x80df=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x16e389,_0x2dc7c3){var _0x19e39b=function(_0x2ca84a){while(--_0x2ca84a){_0x16e389['push'](_0x16e389['shift']());}};_0x19e39b(++_0x2dc7c3);}(_0x80df,0x6d));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf80d('0x0'));module['exports']={'type':{'type':Sequelize[_0xf80d('0x1')](_0xf80d('0x2'),_0xf80d('0x3'),_0xf80d('0x4'),_0xf80d('0x5'),'picklist'),'defaultValue':_0xf80d('0x2')},'content':{'type':Sequelize[_0xf80d('0x6')]},'key':{'type':Sequelize[_0xf80d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf80d('0x2'),_0xf80d('0x3'),_0xf80d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf80d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf80d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9f0e175..bcc7993 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 _0xe808=['sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','index','map','ZohoField','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0xe808,0xe9));var _0x8e80=function(_0x2e8679,_0x4872fe){_0x2e8679=_0x2e8679-0x0;var _0x2a974c=_0xe808[_0x2e8679];return _0x2a974c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e80('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e80('0x1'));var rp=require('request-promise');var moment=require(_0x8e80('0x2'));var BPromise=require(_0x8e80('0x3'));var Mustache=require(_0x8e80('0x4'));var util=require(_0x8e80('0x5'));var path=require(_0x8e80('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e80('0x7'));var fs=require('fs');var fs_extra=require(_0x8e80('0x8'));var _=require('lodash');var squel=require(_0x8e80('0x9'));var crypto=require(_0x8e80('0xa'));var jsforce=require(_0x8e80('0xb'));var deskjs=require(_0x8e80('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8e80('0xd'));var Papa=require(_0x8e80('0xe'));var Redis=require(_0x8e80('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8e80('0x10'));var as=require(_0x8e80('0x11'));var hardwareService=require(_0x8e80('0x12'));var logger=require(_0x8e80('0x13'))(_0x8e80('0x14'));var utils=require('../../config/utils');var config=require(_0x8e80('0x15'));var licenseUtil=require(_0x8e80('0x16'));var db=require(_0x8e80('0x17'))['db'];function respondWithStatusCode(_0x3d7408,_0x1edc61){_0x1edc61=_0x1edc61||0xcc;return function(_0xbe7c47){if(_0xbe7c47){return _0x3d7408[_0x8e80('0x18')](_0x1edc61);}return _0x3d7408[_0x8e80('0x19')](_0x1edc61)[_0x8e80('0x1a')]();};}function respondWithResult(_0x4a2950,_0x50053c){_0x50053c=_0x50053c||0xc8;return function(_0x563976){if(_0x563976){return _0x4a2950[_0x8e80('0x19')](_0x50053c)[_0x8e80('0x1b')](_0x563976);}};}function respondWithFilteredResult(_0x4fbe91,_0x52a97d){return function(_0x39a289){if(_0x39a289){var _0x4a7431=typeof _0x52a97d[_0x8e80('0x1c')]===_0x8e80('0x1d')&&typeof _0x52a97d[_0x8e80('0x1e')]===_0x8e80('0x1d');var _0x56b258=_0x39a289[_0x8e80('0x1f')];var _0x241196=_0x4a7431?0x0:_0x52a97d['offset'];var _0x335f77=_0x4a7431?_0x39a289['count']:_0x52a97d[_0x8e80('0x1c')]+_0x52a97d[_0x8e80('0x1e')];var _0x20dc8a;if(_0x335f77>=_0x56b258){_0x335f77=_0x56b258;_0x20dc8a=0xc8;}else{_0x20dc8a=0xce;}_0x4fbe91[_0x8e80('0x19')](_0x20dc8a);return _0x4fbe91[_0x8e80('0x20')](_0x8e80('0x21'),_0x241196+'-'+_0x335f77+'/'+_0x56b258)[_0x8e80('0x1b')](_0x39a289);}return null;};}function patchUpdates(_0x1dc0c4){return function(_0x1fe79e){try{jsonpatch['apply'](_0x1fe79e,_0x1dc0c4,!![]);}catch(_0x43c3c2){return BPromise[_0x8e80('0x22')](_0x43c3c2);}return _0x1fe79e[_0x8e80('0x23')]();};}function saveUpdates(_0x5305ca,_0x138610){return function(_0xb5c91a){if(_0xb5c91a){return _0xb5c91a[_0x8e80('0x24')](_0x5305ca)[_0x8e80('0x25')](function(_0x1d7af7){return _0x1d7af7;});}return null;};}function removeEntity(_0x34c4a3,_0x43f0f5){return function(_0x409360){if(_0x409360){return _0x409360['destroy']()[_0x8e80('0x25')](function(){_0x34c4a3[_0x8e80('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a0f1,_0x3068bd){return function(_0x1e94f5){if(!_0x1e94f5){_0x47a0f1[_0x8e80('0x18')](0x194);}return _0x1e94f5;};}function handleError(_0x23897f,_0x4e12d0){_0x4e12d0=_0x4e12d0||0x1f4;return function(_0x339a38){logger[_0x8e80('0x26')](_0x339a38['stack']);if(_0x339a38[_0x8e80('0x27')]){delete _0x339a38[_0x8e80('0x27')];}_0x23897f[_0x8e80('0x19')](_0x4e12d0)['send'](_0x339a38);};}exports[_0x8e80('0x28')]=function(_0x52af49,_0x31d072){var _0x329a19={},_0x18e2ba={},_0x33a104={'count':0x0,'rows':[]};var _0x49c1a3=_[_0x8e80('0x29')](db[_0x8e80('0x2a')][_0x8e80('0x2b')],function(_0x227500){return{'name':_0x227500['fieldName'],'type':_0x227500[_0x8e80('0x2c')][_0x8e80('0x2d')]};});_0x18e2ba['model']=_[_0x8e80('0x29')](_0x49c1a3,_0x8e80('0x27'));_0x18e2ba['query']=_['keys'](_0x52af49[_0x8e80('0x2e')]);_0x18e2ba[_0x8e80('0x2f')]=_['intersection'](_0x18e2ba[_0x8e80('0x30')],_0x18e2ba[_0x8e80('0x2e')]);_0x329a19[_0x8e80('0x31')]=_[_0x8e80('0x32')](_0x18e2ba['model'],qs[_0x8e80('0x33')](_0x52af49[_0x8e80('0x2e')][_0x8e80('0x33')]));_0x329a19[_0x8e80('0x31')]=_0x329a19['attributes'][_0x8e80('0x34')]?_0x329a19[_0x8e80('0x31')]:_0x18e2ba[_0x8e80('0x30')];if(!_0x52af49[_0x8e80('0x2e')]['hasOwnProperty'](_0x8e80('0x35'))){_0x329a19[_0x8e80('0x1e')]=qs[_0x8e80('0x1e')](_0x52af49['query'][_0x8e80('0x1e')]);_0x329a19[_0x8e80('0x1c')]=qs[_0x8e80('0x1c')](_0x52af49[_0x8e80('0x2e')][_0x8e80('0x1c')]);}_0x329a19[_0x8e80('0x36')]=qs[_0x8e80('0x37')](_0x52af49[_0x8e80('0x2e')]['sort']);_0x329a19[_0x8e80('0x38')]=qs[_0x8e80('0x2f')](_['pick'](_0x52af49[_0x8e80('0x2e')],_0x18e2ba[_0x8e80('0x2f')]),_0x49c1a3);if(_0x52af49[_0x8e80('0x2e')][_0x8e80('0x39')]){_0x329a19[_0x8e80('0x38')]=_['merge'](_0x329a19[_0x8e80('0x38')],{'$or':_[_0x8e80('0x29')](_0x49c1a3,function(_0x406ff3){if(_0x406ff3['type']!==_0x8e80('0x3a')){var _0x54abc6={};_0x54abc6[_0x406ff3[_0x8e80('0x27')]]={'$like':'%'+_0x52af49['query'][_0x8e80('0x39')]+'%'};return _0x54abc6;}})});}_0x329a19=_['merge']({},_0x329a19,_0x52af49[_0x8e80('0x3b')]);var _0x4128e0={'where':_0x329a19[_0x8e80('0x38')]};return db['ZohoField'][_0x8e80('0x1f')](_0x4128e0)[_0x8e80('0x25')](function(_0x5da631){_0x33a104[_0x8e80('0x1f')]=_0x5da631;if(_0x52af49[_0x8e80('0x2e')][_0x8e80('0x3c')]){_0x329a19[_0x8e80('0x3d')]=[{'all':!![]}];}return db[_0x8e80('0x2a')][_0x8e80('0x3e')](_0x329a19);})[_0x8e80('0x25')](function(_0x1e92a3){_0x33a104[_0x8e80('0x3f')]=_0x1e92a3;return _0x33a104;})[_0x8e80('0x25')](respondWithFilteredResult(_0x31d072,_0x329a19))[_0x8e80('0x40')](handleError(_0x31d072,null));};exports[_0x8e80('0x41')]=function(_0x5a9a8a,_0x5b1d87){var _0x5f1065={'raw':!![],'where':{'id':_0x5a9a8a[_0x8e80('0x42')]['id']}},_0x281c02={};_0x281c02[_0x8e80('0x30')]=_[_0x8e80('0x43')](db[_0x8e80('0x2a')]['rawAttributes']);_0x281c02[_0x8e80('0x2e')]=_[_0x8e80('0x43')](_0x5a9a8a['query']);_0x281c02[_0x8e80('0x2f')]=_['intersection'](_0x281c02['model'],_0x281c02['query']);_0x5f1065[_0x8e80('0x31')]=_[_0x8e80('0x32')](_0x281c02[_0x8e80('0x30')],qs[_0x8e80('0x33')](_0x5a9a8a[_0x8e80('0x2e')]['fields']));_0x5f1065[_0x8e80('0x31')]=_0x5f1065[_0x8e80('0x31')][_0x8e80('0x34')]?_0x5f1065['attributes']:_0x281c02[_0x8e80('0x30')];if(_0x5a9a8a['query'][_0x8e80('0x3c')]){_0x5f1065[_0x8e80('0x3d')]=[{'all':!![]}];}_0x5f1065=_['merge']({},_0x5f1065,_0x5a9a8a[_0x8e80('0x3b')]);return db[_0x8e80('0x2a')][_0x8e80('0x44')](_0x5f1065)['then'](handleEntityNotFound(_0x5b1d87,null))['then'](respondWithResult(_0x5b1d87,null))[_0x8e80('0x40')](handleError(_0x5b1d87,null));};exports[_0x8e80('0x45')]=function(_0x5bf710,_0x2f3791){return db['ZohoField'][_0x8e80('0x45')](_0x5bf710[_0x8e80('0x46')],{})['then'](respondWithResult(_0x2f3791,0xc9))[_0x8e80('0x40')](handleError(_0x2f3791,null));};exports[_0x8e80('0x24')]=function(_0x2dc487,_0xb59b3e){if(_0x2dc487[_0x8e80('0x46')]['id']){delete _0x2dc487[_0x8e80('0x46')]['id'];}return db['ZohoField'][_0x8e80('0x44')]({'where':{'id':_0x2dc487[_0x8e80('0x42')]['id']}})[_0x8e80('0x25')](handleEntityNotFound(_0xb59b3e,null))[_0x8e80('0x25')](saveUpdates(_0x2dc487[_0x8e80('0x46')],null))[_0x8e80('0x25')](respondWithResult(_0xb59b3e,null))[_0x8e80('0x40')](handleError(_0xb59b3e,null));};exports[_0x8e80('0x47')]=function(_0x150def,_0x29520d){return db['ZohoField'][_0x8e80('0x44')]({'where':{'id':_0x150def[_0x8e80('0x42')]['id']}})[_0x8e80('0x25')](handleEntityNotFound(_0x29520d,null))[_0x8e80('0x25')](removeEntity(_0x29520d,null))[_0x8e80('0x40')](handleError(_0x29520d,null));}; \ No newline at end of file +var _0xea66=['fs-extra','squel','desk.js','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','params','include','find','create','update','body','eml-format','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xea66,0x104));var _0x6ea6=function(_0x156dba,_0x4e513e){_0x156dba=_0x156dba-0x0;var _0xa401c=_0xea66[_0x156dba];return _0xa401c;};'use strict';var emlformat=require(_0x6ea6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ea6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ea6('0x2'));var BPromise=require(_0x6ea6('0x3'));var Mustache=require(_0x6ea6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6ea6('0x5'));var csv=require(_0x6ea6('0x6'));var ejs=require(_0x6ea6('0x7'));var fs=require('fs');var fs_extra=require(_0x6ea6('0x8'));var _=require('lodash');var squel=require(_0x6ea6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ea6('0xa'));var toCsv=require(_0x6ea6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6ea6('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ea6('0xc'));var utils=require('../../config/utils');var config=require(_0x6ea6('0xd'));var licenseUtil=require(_0x6ea6('0xe'));var db=require(_0x6ea6('0xf'))['db'];function respondWithStatusCode(_0x141f43,_0x236b25){_0x236b25=_0x236b25||0xcc;return function(_0x3fe4d2){if(_0x3fe4d2){return _0x141f43[_0x6ea6('0x10')](_0x236b25);}return _0x141f43[_0x6ea6('0x11')](_0x236b25)[_0x6ea6('0x12')]();};}function respondWithResult(_0x4e0bad,_0x5a0b7b){_0x5a0b7b=_0x5a0b7b||0xc8;return function(_0x1eaf5a){if(_0x1eaf5a){return _0x4e0bad['status'](_0x5a0b7b)[_0x6ea6('0x13')](_0x1eaf5a);}};}function respondWithFilteredResult(_0x15d7e0,_0x2ed670){return function(_0x1ffaab){if(_0x1ffaab){var _0x264f42=typeof _0x2ed670[_0x6ea6('0x14')]==='undefined'&&typeof _0x2ed670[_0x6ea6('0x15')]===_0x6ea6('0x16');var _0xcaeab=_0x1ffaab[_0x6ea6('0x17')];var _0xe7ef61=_0x264f42?0x0:_0x2ed670[_0x6ea6('0x14')];var _0x5966b6=_0x264f42?_0x1ffaab[_0x6ea6('0x17')]:_0x2ed670[_0x6ea6('0x14')]+_0x2ed670[_0x6ea6('0x15')];var _0x5675a8;if(_0x5966b6>=_0xcaeab){_0x5966b6=_0xcaeab;_0x5675a8=0xc8;}else{_0x5675a8=0xce;}_0x15d7e0[_0x6ea6('0x11')](_0x5675a8);return _0x15d7e0[_0x6ea6('0x18')](_0x6ea6('0x19'),_0xe7ef61+'-'+_0x5966b6+'/'+_0xcaeab)[_0x6ea6('0x13')](_0x1ffaab);}return null;};}function patchUpdates(_0x1671d7){return function(_0x58acf7){try{jsonpatch[_0x6ea6('0x1a')](_0x58acf7,_0x1671d7,!![]);}catch(_0x3efda0){return BPromise[_0x6ea6('0x1b')](_0x3efda0);}return _0x58acf7[_0x6ea6('0x1c')]();};}function saveUpdates(_0x5bf965,_0x36825a){return function(_0x46b723){if(_0x46b723){return _0x46b723['update'](_0x5bf965)[_0x6ea6('0x1d')](function(_0x215be7){return _0x215be7;});}return null;};}function removeEntity(_0x4fed76,_0x3803ab){return function(_0x664a0b){if(_0x664a0b){return _0x664a0b[_0x6ea6('0x1e')]()['then'](function(){_0x4fed76[_0x6ea6('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d2c3b,_0x231675){return function(_0x6d44b7){if(!_0x6d44b7){_0x3d2c3b[_0x6ea6('0x10')](0x194);}return _0x6d44b7;};}function handleError(_0x4f00c8,_0x52e2b2){_0x52e2b2=_0x52e2b2||0x1f4;return function(_0x396903){logger[_0x6ea6('0x1f')](_0x396903[_0x6ea6('0x20')]);if(_0x396903[_0x6ea6('0x21')]){delete _0x396903['name'];}_0x4f00c8[_0x6ea6('0x11')](_0x52e2b2)[_0x6ea6('0x22')](_0x396903);};}exports['index']=function(_0x2c438a,_0xffd846){var _0x589058={},_0x372881={},_0x584e2a={'count':0x0,'rows':[]};var _0x52db68=_[_0x6ea6('0x23')](db[_0x6ea6('0x24')][_0x6ea6('0x25')],function(_0x202712){return{'name':_0x202712['fieldName'],'type':_0x202712[_0x6ea6('0x26')][_0x6ea6('0x27')]};});_0x372881[_0x6ea6('0x28')]=_['map'](_0x52db68,_0x6ea6('0x21'));_0x372881[_0x6ea6('0x29')]=_[_0x6ea6('0x2a')](_0x2c438a[_0x6ea6('0x29')]);_0x372881[_0x6ea6('0x2b')]=_['intersection'](_0x372881[_0x6ea6('0x28')],_0x372881[_0x6ea6('0x29')]);_0x589058['attributes']=_[_0x6ea6('0x2c')](_0x372881[_0x6ea6('0x28')],qs[_0x6ea6('0x2d')](_0x2c438a[_0x6ea6('0x29')][_0x6ea6('0x2d')]));_0x589058[_0x6ea6('0x2e')]=_0x589058['attributes'][_0x6ea6('0x2f')]?_0x589058[_0x6ea6('0x2e')]:_0x372881[_0x6ea6('0x28')];if(!_0x2c438a[_0x6ea6('0x29')][_0x6ea6('0x30')](_0x6ea6('0x31'))){_0x589058['limit']=qs[_0x6ea6('0x15')](_0x2c438a['query'][_0x6ea6('0x15')]);_0x589058['offset']=qs['offset'](_0x2c438a['query']['offset']);}_0x589058[_0x6ea6('0x32')]=qs[_0x6ea6('0x33')](_0x2c438a[_0x6ea6('0x29')]['sort']);_0x589058[_0x6ea6('0x34')]=qs[_0x6ea6('0x2b')](_[_0x6ea6('0x35')](_0x2c438a[_0x6ea6('0x29')],_0x372881[_0x6ea6('0x2b')]),_0x52db68);if(_0x2c438a[_0x6ea6('0x29')]['filter']){_0x589058[_0x6ea6('0x34')]=_[_0x6ea6('0x36')](_0x589058[_0x6ea6('0x34')],{'$or':_[_0x6ea6('0x23')](_0x52db68,function(_0x52a8d9){if(_0x52a8d9[_0x6ea6('0x26')]!==_0x6ea6('0x37')){var _0x54e788={};_0x54e788[_0x52a8d9[_0x6ea6('0x21')]]={'$like':'%'+_0x2c438a[_0x6ea6('0x29')][_0x6ea6('0x38')]+'%'};return _0x54e788;}})});}_0x589058=_[_0x6ea6('0x36')]({},_0x589058,_0x2c438a[_0x6ea6('0x39')]);var _0x28ec27={'where':_0x589058[_0x6ea6('0x34')]};return db[_0x6ea6('0x24')][_0x6ea6('0x17')](_0x28ec27)['then'](function(_0xd80c02){_0x584e2a[_0x6ea6('0x17')]=_0xd80c02;if(_0x2c438a[_0x6ea6('0x29')][_0x6ea6('0x3a')]){_0x589058['include']=[{'all':!![]}];}return db['ZohoField'][_0x6ea6('0x3b')](_0x589058);})[_0x6ea6('0x1d')](function(_0x57cf54){_0x584e2a['rows']=_0x57cf54;return _0x584e2a;})['then'](respondWithFilteredResult(_0xffd846,_0x589058))[_0x6ea6('0x3c')](handleError(_0xffd846,null));};exports['show']=function(_0x2d7144,_0x372cf8){var _0x4c3c15={'raw':!![],'where':{'id':_0x2d7144[_0x6ea6('0x3d')]['id']}},_0x3dcdd9={};_0x3dcdd9[_0x6ea6('0x28')]=_[_0x6ea6('0x2a')](db[_0x6ea6('0x24')][_0x6ea6('0x25')]);_0x3dcdd9[_0x6ea6('0x29')]=_['keys'](_0x2d7144[_0x6ea6('0x29')]);_0x3dcdd9[_0x6ea6('0x2b')]=_['intersection'](_0x3dcdd9['model'],_0x3dcdd9[_0x6ea6('0x29')]);_0x4c3c15[_0x6ea6('0x2e')]=_['intersection'](_0x3dcdd9[_0x6ea6('0x28')],qs[_0x6ea6('0x2d')](_0x2d7144[_0x6ea6('0x29')]['fields']));_0x4c3c15[_0x6ea6('0x2e')]=_0x4c3c15[_0x6ea6('0x2e')]['length']?_0x4c3c15[_0x6ea6('0x2e')]:_0x3dcdd9['model'];if(_0x2d7144['query'][_0x6ea6('0x3a')]){_0x4c3c15[_0x6ea6('0x3e')]=[{'all':!![]}];}_0x4c3c15=_[_0x6ea6('0x36')]({},_0x4c3c15,_0x2d7144[_0x6ea6('0x39')]);return db[_0x6ea6('0x24')][_0x6ea6('0x3f')](_0x4c3c15)[_0x6ea6('0x1d')](handleEntityNotFound(_0x372cf8,null))[_0x6ea6('0x1d')](respondWithResult(_0x372cf8,null))[_0x6ea6('0x3c')](handleError(_0x372cf8,null));};exports['create']=function(_0x5f37f4,_0x118106){return db[_0x6ea6('0x24')][_0x6ea6('0x40')](_0x5f37f4['body'],{})['then'](respondWithResult(_0x118106,0xc9))['catch'](handleError(_0x118106,null));};exports[_0x6ea6('0x41')]=function(_0xf432e,_0x1cecdc){if(_0xf432e['body']['id']){delete _0xf432e[_0x6ea6('0x42')]['id'];}return db[_0x6ea6('0x24')][_0x6ea6('0x3f')]({'where':{'id':_0xf432e[_0x6ea6('0x3d')]['id']}})[_0x6ea6('0x1d')](handleEntityNotFound(_0x1cecdc,null))['then'](saveUpdates(_0xf432e[_0x6ea6('0x42')],null))[_0x6ea6('0x1d')](respondWithResult(_0x1cecdc,null))[_0x6ea6('0x3c')](handleError(_0x1cecdc,null));};exports[_0x6ea6('0x1e')]=function(_0x1dfedb,_0x3a4232){return db[_0x6ea6('0x24')]['find']({'where':{'id':_0x1dfedb['params']['id']}})[_0x6ea6('0x1d')](handleEntityNotFound(_0x3a4232,null))[_0x6ea6('0x1d')](removeEntity(_0x3a4232,null))[_0x6ea6('0x3c')](handleError(_0x3a4232,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f8cad3d..e5ea444 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 _0x1883=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField'];(function(_0x2a3319,_0x5a003c){var _0x26b36e=function(_0x2400e7){while(--_0x2400e7){_0x2a3319['push'](_0x2a3319['shift']());}};_0x26b36e(++_0x5a003c);}(_0x1883,0xab));var _0x3188=function(_0x4be428,_0x42e8fd){_0x4be428=_0x4be428-0x0;var _0x2c082e=_0x1883[_0x4be428];return _0x2c082e;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x3188('0xf'),_0x3188('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x2a2137,_0x280212){var _0x466f22=function(_0x233867){while(--_0x233867){_0x2a2137['push'](_0x2a2137['shift']());}};_0x466f22(++_0x280212);}(_0x5496,0x175));var _0x6549=function(_0x4eba49,_0x1a2d1d){_0x4eba49=_0x4eba49-0x0;var _0x18efef=_0x5496[_0x4eba49];return _0x18efef;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('ZohoField',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 4106c65..f553ae8 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 _0xdbb5=['message','ZohoField,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x118439,_0x1907d9){var _0x209b67=function(_0x51e946){while(--_0x51e946){_0x118439['push'](_0x118439['shift']());}};_0x209b67(++_0x1907d9);}(_0xdbb5,0x1bb));var _0x5dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5dbb('0x0'));var util=require(_0x5dbb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbb('0x2'));var fs=require('fs');var Redis=require(_0x5dbb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dbb('0x4'));var logger=require(_0x5dbb('0x5'))(_0x5dbb('0x6'));var config=require(_0x5dbb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dbb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9537,_0x4f842c,_0x521911){return new BPromise(function(_0x36ac7b,_0x3ab786){return client[_0x5dbb('0x9')](_0x1c9537,_0x521911)[_0x5dbb('0xa')](function(_0x3511f6){logger[_0x5dbb('0xb')]('ZohoField,\x20%s,\x20%s',_0x4f842c,_0x5dbb('0xc'));logger[_0x5dbb('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4f842c,_0x5dbb('0xc'),JSON[_0x5dbb('0xe')](_0x3511f6));if(_0x3511f6[_0x5dbb('0xf')]){if(_0x3511f6[_0x5dbb('0xf')][_0x5dbb('0x10')]===0x1f4){logger[_0x5dbb('0xf')]('ZohoField,\x20%s,\x20%s',_0x4f842c,_0x3511f6[_0x5dbb('0xf')][_0x5dbb('0x11')]);return _0x3ab786(_0x3511f6[_0x5dbb('0xf')][_0x5dbb('0x11')]);}logger['error'](_0x5dbb('0x12'),_0x4f842c,_0x3511f6[_0x5dbb('0xf')]['message']);return _0x36ac7b(_0x3511f6[_0x5dbb('0xf')][_0x5dbb('0x11')]);}else{logger[_0x5dbb('0xb')](_0x5dbb('0x12'),_0x4f842c,_0x5dbb('0xc'));_0x36ac7b(_0x3511f6[_0x5dbb('0x13')][_0x5dbb('0x11')]);}})['catch'](function(_0x2d3c11){logger['error'](_0x5dbb('0x12'),_0x4f842c,_0x2d3c11);_0x3ab786(_0x2d3c11);});});} \ No newline at end of file +var _0x5b20=['message','info','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s'];(function(_0x5942c6,_0x3db044){var _0x2871c3=function(_0x44f6c4){while(--_0x44f6c4){_0x5942c6['push'](_0x5942c6['shift']());}};_0x2871c3(++_0x3db044);}(_0x5b20,0x93));var _0x05b2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b20[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x05b2('0x0'));var util=require('util');var moment=require(_0x05b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05b2('0x2'));var db=require(_0x05b2('0x3'))['db'];var utils=require(_0x05b2('0x4'));var logger=require(_0x05b2('0x5'))(_0x05b2('0x6'));var config=require('../../config/environment');var jayson=require(_0x05b2('0x7'));var client=jayson['client'][_0x05b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2051d4,_0x36596b,_0x48a5bc){return new BPromise(function(_0xc79396,_0x3b7538){return client[_0x05b2('0x9')](_0x2051d4,_0x48a5bc)['then'](function(_0x4678c8){logger['info']('ZohoField,\x20%s,\x20%s',_0x36596b,_0x05b2('0xa'));logger[_0x05b2('0xb')](_0x05b2('0xc'),_0x36596b,_0x05b2('0xa'),JSON['stringify'](_0x4678c8));if(_0x4678c8['error']){if(_0x4678c8['error']['code']===0x1f4){logger[_0x05b2('0xd')](_0x05b2('0xe'),_0x36596b,_0x4678c8[_0x05b2('0xd')][_0x05b2('0xf')]);return _0x3b7538(_0x4678c8[_0x05b2('0xd')][_0x05b2('0xf')]);}logger[_0x05b2('0xd')]('ZohoField,\x20%s,\x20%s',_0x36596b,_0x4678c8['error'][_0x05b2('0xf')]);return _0xc79396(_0x4678c8[_0x05b2('0xd')][_0x05b2('0xf')]);}else{logger[_0x05b2('0x10')](_0x05b2('0xe'),_0x36596b,_0x05b2('0xa'));_0xc79396(_0x4678c8['result'][_0x05b2('0xf')]);}})[_0x05b2('0x11')](function(_0x1726cd){logger[_0x05b2('0xd')]('ZohoField,\x20%s,\x20%s',_0x36596b,_0x1726cd);_0x3b7538(_0x1726cd);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8255fe5..ce8ca10 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x303161,_0x2d56d8){var _0x35016b=function(_0x2c9a3e){while(--_0x2c9a3e){_0x303161['push'](_0x303161['shift']());}};_0x35016b(++_0x2d56d8);}(_0xe706,0xa3));var _0x6e70=function(_0x3441e9,_0x269c8a){_0x3441e9=_0x3441e9-0x0;var _0x7f9ada=_0xe706[_0x3441e9];return _0x7f9ada;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x13a379,_0x389bfa){var _0x43a1dc=function(_0x3bf9f3){while(--_0x3bf9f3){_0x13a379['push'](_0x13a379['shift']());}};_0x43a1dc(++_0x389bfa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0xcb91[_0x5db657];return _0x2d6e70;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cc40420..82bde82 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 _0x0e7a=['state','sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x0e7a,0x1a5));var _0xa0e7=function(_0x271191,_0x3486bf){_0x271191=_0x271191-0x0;var _0x2765db=_0x0e7a[_0x271191];return _0x2765db;};'use strict';var Sequelize=require(_0xa0e7('0x0'));module[_0xa0e7('0x1')]={'name':{'type':Sequelize[_0xa0e7('0x2')],'allowNull':![],'unique':_0xa0e7('0x3')},'version':{'type':Sequelize[_0xa0e7('0x2')],'allowNull':![],'unique':_0xa0e7('0x3')},'main':{'type':Sequelize[_0xa0e7('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xa0e7('0x2')]},'path':{'type':Sequelize[_0xa0e7('0x2')]},'type':{'type':Sequelize[_0xa0e7('0x2')]},'size':{'type':Sequelize[_0xa0e7('0x4')]},'active':{'type':Sequelize[_0xa0e7('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xa0e7('0x2')]},'logo':{'type':Sequelize[_0xa0e7('0x2')]},'state':{'type':Sequelize[_0xa0e7('0x2')],'unique':_0xa0e7('0x6')},'description':{'type':Sequelize[_0xa0e7('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xa0e7('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xf2e2=['sequelize','exports','STRING','app.js','INTEGER','BOOLEAN','state'];(function(_0x3073c5,_0x426ccc){var _0x35f385=function(_0x45b159){while(--_0x45b159){_0x3073c5['push'](_0x3073c5['shift']());}};_0x35f385(++_0x426ccc);}(_0xf2e2,0x1ce));var _0x2f2e=function(_0x5ceb91,_0x1213c0){_0x5ceb91=_0x5ceb91-0x0;var _0x216e12=_0xf2e2[_0x5ceb91];return _0x216e12;};'use strict';var Sequelize=require(_0x2f2e('0x0'));module[_0x2f2e('0x1')]={'name':{'type':Sequelize[_0x2f2e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x2f2e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x2f2e('0x2')],'defaultValue':_0x2f2e('0x3')},'filename':{'type':Sequelize[_0x2f2e('0x2')]},'path':{'type':Sequelize[_0x2f2e('0x2')]},'type':{'type':Sequelize[_0x2f2e('0x2')]},'size':{'type':Sequelize[_0x2f2e('0x4')]},'active':{'type':Sequelize[_0x2f2e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x2f2e('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x2f2e('0x2')],'unique':_0x2f2e('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2f2e('0x2')]},'link':{'type':Sequelize[_0x2f2e('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d1e91c8..b70a1fd 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 _0x2a07=['name','send','index','map','Integration','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','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x2a07,0x74));var _0x72a0=function(_0x3ef892,_0x38fb64){_0x3ef892=_0x3ef892-0x0;var _0x19f2c0=_0x2a07[_0x3ef892];return _0x19f2c0;};'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['Integration'][_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')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));}; \ No newline at end of file +var _0x6343=['hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Integration','then','rows','catch','show','params','keys','includeAll','include','create','body','find','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length'];(function(_0x5a17aa,_0x4311fe){var _0x4d729f=function(_0x34fed8){while(--_0x34fed8){_0x5a17aa['push'](_0x5a17aa['shift']());}};_0x4d729f(++_0x4311fe);}(_0x6343,0x168));var _0x3634=function(_0x4c4c90,_0x64364b){_0x4c4c90=_0x4c4c90-0x0;var _0x240708=_0x6343[_0x4c4c90];return _0x240708;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['Integration'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7ed07bc..492334d 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 _0x25eb=['api','moment','bluebird','request-promise','../../config/environment','exports','define','Integration','integrations','util','../../config/logger'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x25eb,0x18a));var _0xb25e=function(_0x4cc9d3,_0x11ff73){_0x4cc9d3=_0x4cc9d3-0x0;var _0x1dcc97=_0x25eb[_0x4cc9d3];return _0x1dcc97;};'use strict';var _=require('lodash');var util=require(_0xb25e('0x0'));var logger=require(_0xb25e('0x1'))(_0xb25e('0x2'));var moment=require(_0xb25e('0x3'));var BPromise=require(_0xb25e('0x4'));var rp=require(_0xb25e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb25e('0x6'));var attributes=require('./integration.attributes');module[_0xb25e('0x7')]=function(_0x9448fa,_0x1221e2){return _0x9448fa[_0xb25e('0x8')](_0xb25e('0x9'),attributes,{'tableName':_0xb25e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf51a=['request-promise','../../config/environment','./integration.attributes','define','Integration','util','../../config/logger','api','moment','bluebird'];(function(_0x41db4d,_0xad6d70){var _0x17047b=function(_0x287fbd){while(--_0x287fbd){_0x41db4d['push'](_0x41db4d['shift']());}};_0x17047b(++_0xad6d70);}(_0xf51a,0x127));var _0xaf51=function(_0x5dd9cb,_0x5ab4c9){_0x5dd9cb=_0x5dd9cb-0x0;var _0x22107e=_0xf51a[_0x5dd9cb];return _0x22107e;};'use strict';var _=require('lodash');var util=require(_0xaf51('0x0'));var logger=require(_0xaf51('0x1'))(_0xaf51('0x2'));var moment=require(_0xaf51('0x3'));var BPromise=require(_0xaf51('0x4'));var rp=require(_0xaf51('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf51('0x6'));var attributes=require(_0xaf51('0x7'));module['exports']=function(_0x39ecc1,_0x2c5e1e){return _0x39ecc1[_0xaf51('0x8')](_0xaf51('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index af39fb3..b679d25 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c1d1b,_0x35d5ac){var _0x53491e=function(_0x325108){while(--_0x325108){_0x5c1d1b['push'](_0x5c1d1b['shift']());}};_0x53491e(++_0x35d5ac);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5f234a,_0x492185){_0x5f234a=_0x5f234a-0x0;var _0x594894=_0xc6ac[_0x5f234a];return _0x594894;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d1b11ef..dcdb438 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2eeced,_0x79d0ff){var _0x427116=function(_0xf62a86){while(--_0xf62a86){_0x2eeced['push'](_0x2eeced['shift']());}};_0x427116(++_0x79d0ff);}(_0x955f,0x1eb));var _0xf955=function(_0x2dbc55,_0xda9372){_0x2dbc55=_0x2dbc55-0x0;var _0x1a6c68=_0x955f[_0x2dbc55];return _0x1a6c68;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x38051b,_0x46cf1e){var _0x349422=function(_0x49b26e){while(--_0x49b26e){_0x38051b['push'](_0x38051b['shift']());}};_0x349422(++_0x46cf1e);}(_0x66fa,0x117));var _0xa66f=function(_0x54fbce,_0x479921){_0x54fbce=_0x54fbce-0x0;var _0x1688c3=_0x66fa[_0x54fbce];return _0x1688c3;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 3f908d3..89d2088 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 _0x414b=['SENDING','RECEIVED','FAILED','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x86d772,_0x5d3c72){var _0x58003a=function(_0x106210){while(--_0x106210){_0x86d772['push'](_0x86d772['shift']());}};_0x58003a(++_0x5d3c72);}(_0x414b,0x1b1));var _0xb414=function(_0x3fd0ad,_0x49efa3){_0x3fd0ad=_0x3fd0ad-0x0;var _0x52ba90=_0x414b[_0x3fd0ad];return _0x52ba90;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0xb414('0x0')]},'eventChannel':{'type':Sequelize[_0xb414('0x0')]},'exitStatus':{'type':Sequelize[_0xb414('0x0')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xb414('0x1')]},'contacts':{'type':Sequelize[_0xb414('0x0')]},'uniqueid':{'type':Sequelize[_0xb414('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb414('0x0')]},'membername':{'type':Sequelize[_0xb414('0x0')]},'agentcalledAt':{'type':Sequelize[_0xb414('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb414('0x2')]},'holdtime':{'type':Sequelize[_0xb414('0x1')]},'agentcomplete':{'type':Sequelize[_0xb414('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb414('0x2')]},'talktime':{'type':Sequelize[_0xb414('0x1')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xb414('0x0')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb414('0x2')]},'agentdump':{'type':Sequelize[_0xb414('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb414('0x2')]},'lastevent':{'type':Sequelize[_0xb414('0x0')]},'channel':{'type':Sequelize[_0xb414('0x0')]},'channelstate':{'type':Sequelize[_0xb414('0x1')]},'channelstatedesc':{'type':Sequelize[_0xb414('0x0')]},'connectedlinenum':{'type':Sequelize[_0xb414('0x0')]},'connectedlinename':{'type':Sequelize[_0xb414('0x0')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb414('0x0')]},'exten':{'type':Sequelize[_0xb414('0x0')]},'priority':{'type':Sequelize[_0xb414('0x0')]},'destchannel':{'type':Sequelize[_0xb414('0x0')]},'destchannelstate':{'type':Sequelize[_0xb414('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0xb414('0x0')]},'destcalleridnum':{'type':Sequelize[_0xb414('0x0')]},'destcalleridname':{'type':Sequelize[_0xb414('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb414('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb414('0x0')]},'destcontext':{'type':Sequelize[_0xb414('0x0')]},'destexten':{'type':Sequelize[_0xb414('0x0')]},'destpriority':{'type':Sequelize[_0xb414('0x0')]},'destuniqueid':{'type':Sequelize[_0xb414('0x0')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xb414('0x0')]},'subject':{'type':Sequelize[_0xb414('0x0')]},'from':{'type':Sequelize[_0xb414('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb414('0x0')]},'attachment':{'type':Sequelize[_0xb414('0x4')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xb414('0x4')]},'status':{'type':Sequelize[_0xb414('0x5')](_0xb414('0x6'),_0xb414('0x7'),_0xb414('0x8'),_0xb414('0x9'))},'url':{'type':Sequelize[_0xb414('0x0')]},'app':{'type':Sequelize[_0xb414('0x0')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xb414('0x1')]}}; \ No newline at end of file +var _0x55cb=['RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x3ec9f3,_0x14796e){var _0x156cde=function(_0x47f443){while(--_0x47f443){_0x3ec9f3['push'](_0x3ec9f3['shift']());}};_0x156cde(++_0x14796e);}(_0x55cb,0xe8));var _0xb55c=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0x55cb[_0x3d9557];return _0x359ff8;};'use strict';var Sequelize=require(_0xb55c('0x0'));module['exports']={'integration':{'type':Sequelize[_0xb55c('0x1')]},'eventChannel':{'type':Sequelize[_0xb55c('0x1')]},'exitStatus':{'type':Sequelize[_0xb55c('0x1')]},'ticketId':{'type':Sequelize[_0xb55c('0x1')]},'integrationId':{'type':Sequelize[_0xb55c('0x2')]},'contacts':{'type':Sequelize[_0xb55c('0x1')]},'uniqueid':{'type':Sequelize[_0xb55c('0x1')]},'calleridnum':{'type':Sequelize[_0xb55c('0x1')]},'calleridname':{'type':Sequelize[_0xb55c('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb55c('0x1')]},'membername':{'type':Sequelize[_0xb55c('0x1')]},'agentcalledAt':{'type':Sequelize[_0xb55c('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb55c('0x3')]},'holdtime':{'type':Sequelize[_0xb55c('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb55c('0x3')]},'talktime':{'type':Sequelize[_0xb55c('0x2')]},'agentacw':{'type':Sequelize[_0xb55c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb55c('0x2')]},'reason':{'type':Sequelize[_0xb55c('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb55c('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb55c('0x3')]},'lastevent':{'type':Sequelize[_0xb55c('0x1')]},'channel':{'type':Sequelize[_0xb55c('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb55c('0x1')]},'connectedlinename':{'type':Sequelize[_0xb55c('0x1')]},'language':{'type':Sequelize[_0xb55c('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb55c('0x1')]},'exten':{'type':Sequelize[_0xb55c('0x1')]},'priority':{'type':Sequelize[_0xb55c('0x1')]},'destchannel':{'type':Sequelize[_0xb55c('0x1')]},'destchannelstate':{'type':Sequelize[_0xb55c('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xb55c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb55c('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xb55c('0x1')]},'destaccountcode':{'type':Sequelize[_0xb55c('0x1')]},'destcontext':{'type':Sequelize[_0xb55c('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb55c('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xb55c('0x1')]},'from':{'type':Sequelize[_0xb55c('0x1')]},'to':{'type':Sequelize[_0xb55c('0x1')]},'cc':{'type':Sequelize[_0xb55c('0x1')]},'attachment':{'type':Sequelize[_0xb55c('0x5')]},'html':{'type':Sequelize[_0xb55c('0x5')]},'text':{'type':Sequelize[_0xb55c('0x5')]},'status':{'type':Sequelize['ENUM'](_0xb55c('0x6'),_0xb55c('0x7'),_0xb55c('0x8'),_0xb55c('0x9'))},'url':{'type':Sequelize[_0xb55c('0x1')]},'app':{'type':Sequelize[_0xb55c('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xb55c('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 5dc0910..ab5a6c4 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 _0xd57b=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','destroy','error','stack','send','map','IntegrationReport','fieldName','type','key','model','name','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','findAll','then','catch','show','params','rawAttributes','include','find','create','update','body','describe','zip-dir','request-promise','bluebird'];(function(_0x3fed68,_0x4c618e){var _0xf56c1e=function(_0x141211){while(--_0x141211){_0x3fed68['push'](_0x3fed68['shift']());}};_0xf56c1e(++_0x4c618e);}(_0xd57b,0x125));var _0xbd57=function(_0x4534e3,_0x56de6e){_0x4534e3=_0x4534e3-0x0;var _0x50c3a3=_0xd57b[_0x4534e3];return _0x50c3a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbd57('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd57('0x1'));var moment=require('moment');var BPromise=require(_0xbd57('0x2'));var Mustache=require(_0xbd57('0x3'));var util=require(_0xbd57('0x4'));var path=require('path');var sox=require(_0xbd57('0x5'));var csv=require(_0xbd57('0x6'));var ejs=require(_0xbd57('0x7'));var fs=require('fs');var fs_extra=require(_0xbd57('0x8'));var _=require(_0xbd57('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd57('0xa'));var deskjs=require(_0xbd57('0xb'));var toCsv=require(_0xbd57('0x6'));var querystring=require(_0xbd57('0xc'));var Papa=require('papaparse');var Redis=require(_0xbd57('0xd'));var authService=require(_0xbd57('0xe'));var qs=require(_0xbd57('0xf'));var as=require(_0xbd57('0x10'));var hardwareService=require(_0xbd57('0x11'));var logger=require('../../config/logger')(_0xbd57('0x12'));var utils=require(_0xbd57('0x13'));var config=require(_0xbd57('0x14'));var licenseUtil=require(_0xbd57('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35d2b3,_0x16b46a){_0x16b46a=_0x16b46a||0xcc;return function(_0x2ee991){if(_0x2ee991){return _0x35d2b3[_0xbd57('0x16')](_0x16b46a);}return _0x35d2b3[_0xbd57('0x17')](_0x16b46a)[_0xbd57('0x18')]();};}function respondWithResult(_0x4b5a2,_0x533af3){_0x533af3=_0x533af3||0xc8;return function(_0x5c4cb4){if(_0x5c4cb4){return _0x4b5a2['status'](_0x533af3)[_0xbd57('0x19')](_0x5c4cb4);}};}function respondWithFilteredResult(_0x48cbe2,_0x3a4ffe){return function(_0x11a0e8){if(_0x11a0e8){var _0x1ca847=typeof _0x3a4ffe[_0xbd57('0x1a')]===_0xbd57('0x1b')&&typeof _0x3a4ffe['limit']===_0xbd57('0x1b');var _0x186c34=_0x11a0e8['count'];var _0x2335a3=_0x1ca847?0x0:_0x3a4ffe[_0xbd57('0x1a')];var _0x25b656=_0x1ca847?_0x11a0e8['count']:_0x3a4ffe[_0xbd57('0x1a')]+_0x3a4ffe[_0xbd57('0x1c')];var _0x4356ac;if(_0x25b656>=_0x186c34){_0x25b656=_0x186c34;_0x4356ac=0xc8;}else{_0x4356ac=0xce;}_0x48cbe2[_0xbd57('0x17')](_0x4356ac);return _0x48cbe2[_0xbd57('0x1d')](_0xbd57('0x1e'),_0x2335a3+'-'+_0x25b656+'/'+_0x186c34)[_0xbd57('0x19')](_0x11a0e8);}return null;};}function patchUpdates(_0x2a8278){return function(_0x5beb3c){try{jsonpatch[_0xbd57('0x1f')](_0x5beb3c,_0x2a8278,!![]);}catch(_0x11bd21){return BPromise[_0xbd57('0x20')](_0x11bd21);}return _0x5beb3c['save']();};}function saveUpdates(_0x1b5912,_0x55e1aa){return function(_0x2d864e){if(_0x2d864e){return _0x2d864e['update'](_0x1b5912)['then'](function(_0x428c22){return _0x428c22;});}return null;};}function removeEntity(_0x459f6d,_0x248ed5){return function(_0x1504eb){if(_0x1504eb){return _0x1504eb[_0xbd57('0x21')]()['then'](function(){_0x459f6d[_0xbd57('0x17')](0xcc)[_0xbd57('0x18')]();});}};}function handleEntityNotFound(_0x5eb733,_0x7d5caf){return function(_0x2926d6){if(!_0x2926d6){_0x5eb733[_0xbd57('0x16')](0x194);}return _0x2926d6;};}function handleError(_0x2cbc63,_0x591d73){_0x591d73=_0x591d73||0x1f4;return function(_0x49a044){logger[_0xbd57('0x22')](_0x49a044[_0xbd57('0x23')]);if(_0x49a044['name']){delete _0x49a044['name'];}_0x2cbc63['status'](_0x591d73)[_0xbd57('0x24')](_0x49a044);};}exports['index']=function(_0x5e0349,_0x4d5581){var _0x2df562={},_0x5b426d={},_0x59bdbd={'count':0x0,'rows':[]};var _0xf597a8=_[_0xbd57('0x25')](db[_0xbd57('0x26')]['rawAttributes'],function(_0x39e43c){return{'name':_0x39e43c[_0xbd57('0x27')],'type':_0x39e43c[_0xbd57('0x28')][_0xbd57('0x29')]};});_0x5b426d[_0xbd57('0x2a')]=_['map'](_0xf597a8,_0xbd57('0x2b'));_0x5b426d['query']=_[_0xbd57('0x2c')](_0x5e0349['query']);_0x5b426d[_0xbd57('0x2d')]=_[_0xbd57('0x2e')](_0x5b426d[_0xbd57('0x2a')],_0x5b426d[_0xbd57('0x2f')]);_0x2df562['attributes']=_[_0xbd57('0x2e')](_0x5b426d['model'],qs['fields'](_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x30')]));_0x2df562['attributes']=_0x2df562['attributes'][_0xbd57('0x31')]?_0x2df562[_0xbd57('0x32')]:_0x5b426d[_0xbd57('0x2a')];if(!_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x33')]('nolimit')){_0x2df562['limit']=qs[_0xbd57('0x1c')](_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x1c')]);_0x2df562[_0xbd57('0x1a')]=qs[_0xbd57('0x1a')](_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x1a')]);}_0x2df562[_0xbd57('0x34')]=qs[_0xbd57('0x35')](_0x5e0349[_0xbd57('0x2f')]['sort']);_0x2df562[_0xbd57('0x36')]=qs[_0xbd57('0x2d')](_[_0xbd57('0x37')](_0x5e0349[_0xbd57('0x2f')],_0x5b426d[_0xbd57('0x2d')]),_0xf597a8);if(_0x5e0349[_0xbd57('0x2f')]['filter']){_0x2df562[_0xbd57('0x36')]=_[_0xbd57('0x38')](_0x2df562['where'],{'$or':_['map'](_0xf597a8,function(_0x933358){if(_0x933358['type']!==_0xbd57('0x39')){var _0x533dee={};_0x533dee[_0x933358[_0xbd57('0x2b')]]={'$like':'%'+_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x3a')]+'%'};return _0x533dee;}})});}_0x2df562=_[_0xbd57('0x38')]({},_0x2df562,_0x5e0349[_0xbd57('0x3b')]);var _0x3d3c3b={'where':_0x2df562['where']};return db[_0xbd57('0x26')][_0xbd57('0x3c')](_0x3d3c3b)['then'](function(_0x44dc66){_0x59bdbd[_0xbd57('0x3c')]=_0x44dc66;if(_0x5e0349[_0xbd57('0x2f')][_0xbd57('0x3d')]){_0x2df562['include']=[{'all':!![]}];}return db[_0xbd57('0x26')][_0xbd57('0x3e')](_0x2df562);})[_0xbd57('0x3f')](function(_0x3e0e21){_0x59bdbd['rows']=_0x3e0e21;return _0x59bdbd;})['then'](respondWithFilteredResult(_0x4d5581,_0x2df562))[_0xbd57('0x40')](handleError(_0x4d5581,null));};exports[_0xbd57('0x41')]=function(_0xcbdd8d,_0x3ecc7e){var _0x2ee4fc={'raw':![],'where':{'id':_0xcbdd8d[_0xbd57('0x42')]['id']}},_0xf6918c={};_0xf6918c[_0xbd57('0x2a')]=_['keys'](db[_0xbd57('0x26')][_0xbd57('0x43')]);_0xf6918c[_0xbd57('0x2f')]=_[_0xbd57('0x2c')](_0xcbdd8d[_0xbd57('0x2f')]);_0xf6918c[_0xbd57('0x2d')]=_[_0xbd57('0x2e')](_0xf6918c['model'],_0xf6918c[_0xbd57('0x2f')]);_0x2ee4fc[_0xbd57('0x32')]=_[_0xbd57('0x2e')](_0xf6918c[_0xbd57('0x2a')],qs['fields'](_0xcbdd8d[_0xbd57('0x2f')][_0xbd57('0x30')]));_0x2ee4fc[_0xbd57('0x32')]=_0x2ee4fc[_0xbd57('0x32')][_0xbd57('0x31')]?_0x2ee4fc['attributes']:_0xf6918c[_0xbd57('0x2a')];if(_0xcbdd8d[_0xbd57('0x2f')][_0xbd57('0x3d')]){_0x2ee4fc[_0xbd57('0x44')]=[{'all':!![]}];}_0x2ee4fc=_['merge']({},_0x2ee4fc,_0xcbdd8d[_0xbd57('0x3b')]);return db['IntegrationReport'][_0xbd57('0x45')](_0x2ee4fc)['then'](handleEntityNotFound(_0x3ecc7e,null))[_0xbd57('0x3f')](respondWithResult(_0x3ecc7e,null))[_0xbd57('0x40')](handleError(_0x3ecc7e,null));};exports[_0xbd57('0x46')]=function(_0xe966da,_0x3a9164){return db[_0xbd57('0x26')][_0xbd57('0x46')](_0xe966da['body'],{})[_0xbd57('0x3f')](respondWithResult(_0x3a9164,0xc9))['catch'](handleError(_0x3a9164,null));};exports[_0xbd57('0x47')]=function(_0x44c6ee,_0x479dc2){if(_0x44c6ee[_0xbd57('0x48')]['id']){delete _0x44c6ee[_0xbd57('0x48')]['id'];}return db[_0xbd57('0x26')][_0xbd57('0x45')]({'where':{'id':_0x44c6ee[_0xbd57('0x42')]['id']}})[_0xbd57('0x3f')](handleEntityNotFound(_0x479dc2,null))['then'](saveUpdates(_0x44c6ee[_0xbd57('0x48')],null))[_0xbd57('0x3f')](respondWithResult(_0x479dc2,null))[_0xbd57('0x40')](handleError(_0x479dc2,null));};exports['destroy']=function(_0x54e0de,_0x2a6d2d){return db[_0xbd57('0x26')][_0xbd57('0x45')]({'where':{'id':_0x54e0de[_0xbd57('0x42')]['id']}})[_0xbd57('0x3f')](handleEntityNotFound(_0x2a6d2d,null))['then'](removeEntity(_0x2a6d2d,null))[_0xbd57('0x40')](handleError(_0x2a6d2d,null));};exports[_0xbd57('0x49')]=function(_0x56dbf6,_0xeac0d0){return db[_0xbd57('0x26')]['describe']()[_0xbd57('0x3f')](respondWithResult(_0xeac0d0,null))['catch'](handleError(_0xeac0d0,null));}; \ No newline at end of file +var _0x00df=['type','VIRTUAL','include','findAll','rows','catch','params','options','create','body','find','describe','eml-format','rimraf','request-promise','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','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','end','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge'];(function(_0x5015d4,_0x1430df){var _0x290942=function(_0x2b5118){while(--_0x2b5118){_0x5015d4['push'](_0x5015d4['shift']());}};_0x290942(++_0x1430df);}(_0x00df,0x128));var _0xf00d=function(_0xefdaea,_0x54f201){_0xefdaea=_0xefdaea-0x0;var _0x24aa5e=_0x00df[_0xefdaea];return _0x24aa5e;};'use strict';var emlformat=require(_0xf00d('0x0'));var rimraf=require(_0xf00d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf00d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf00d('0x3'));var util=require(_0xf00d('0x4'));var path=require('path');var sox=require(_0xf00d('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf00d('0x6'));var squel=require(_0xf00d('0x7'));var crypto=require(_0xf00d('0x8'));var jsforce=require(_0xf00d('0x9'));var deskjs=require(_0xf00d('0xa'));var toCsv=require(_0xf00d('0xb'));var querystring=require(_0xf00d('0xc'));var Papa=require(_0xf00d('0xd'));var Redis=require(_0xf00d('0xe'));var authService=require(_0xf00d('0xf'));var qs=require(_0xf00d('0x10'));var as=require(_0xf00d('0x11'));var hardwareService=require(_0xf00d('0x12'));var logger=require(_0xf00d('0x13'))(_0xf00d('0x14'));var utils=require(_0xf00d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf00d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x87f1be,_0xd948f2){_0xd948f2=_0xd948f2||0xcc;return function(_0x2cc4a4){if(_0x2cc4a4){return _0x87f1be[_0xf00d('0x17')](_0xd948f2);}return _0x87f1be['status'](_0xd948f2)['end']();};}function respondWithResult(_0x4b4242,_0x297ced){_0x297ced=_0x297ced||0xc8;return function(_0x4e5a9d){if(_0x4e5a9d){return _0x4b4242[_0xf00d('0x18')](_0x297ced)[_0xf00d('0x19')](_0x4e5a9d);}};}function respondWithFilteredResult(_0x2c7b08,_0x48d812){return function(_0x2bdd48){if(_0x2bdd48){var _0x393861=typeof _0x48d812[_0xf00d('0x1a')]===_0xf00d('0x1b')&&typeof _0x48d812['limit']===_0xf00d('0x1b');var _0x294947=_0x2bdd48['count'];var _0x170164=_0x393861?0x0:_0x48d812[_0xf00d('0x1a')];var _0x5c7b43=_0x393861?_0x2bdd48[_0xf00d('0x1c')]:_0x48d812[_0xf00d('0x1a')]+_0x48d812[_0xf00d('0x1d')];var _0xdb52fe;if(_0x5c7b43>=_0x294947){_0x5c7b43=_0x294947;_0xdb52fe=0xc8;}else{_0xdb52fe=0xce;}_0x2c7b08[_0xf00d('0x18')](_0xdb52fe);return _0x2c7b08[_0xf00d('0x1e')]('Content-Range',_0x170164+'-'+_0x5c7b43+'/'+_0x294947)[_0xf00d('0x19')](_0x2bdd48);}return null;};}function patchUpdates(_0x11e053){return function(_0x4b1365){try{jsonpatch['apply'](_0x4b1365,_0x11e053,!![]);}catch(_0x56f433){return BPromise[_0xf00d('0x1f')](_0x56f433);}return _0x4b1365[_0xf00d('0x20')]();};}function saveUpdates(_0x5e0138,_0x3f4853){return function(_0x4deaa8){if(_0x4deaa8){return _0x4deaa8[_0xf00d('0x21')](_0x5e0138)[_0xf00d('0x22')](function(_0x28f6ce){return _0x28f6ce;});}return null;};}function removeEntity(_0x33eac1,_0xd06577){return function(_0x2ac4d6){if(_0x2ac4d6){return _0x2ac4d6[_0xf00d('0x23')]()['then'](function(){_0x33eac1[_0xf00d('0x18')](0xcc)[_0xf00d('0x24')]();});}};}function handleEntityNotFound(_0x4b18d2,_0x1fbf05){return function(_0x169c6a){if(!_0x169c6a){_0x4b18d2[_0xf00d('0x17')](0x194);}return _0x169c6a;};}function handleError(_0x37f9d2,_0x50362d){_0x50362d=_0x50362d||0x1f4;return function(_0x386e5a){logger[_0xf00d('0x25')](_0x386e5a[_0xf00d('0x26')]);if(_0x386e5a[_0xf00d('0x27')]){delete _0x386e5a[_0xf00d('0x27')];}_0x37f9d2['status'](_0x50362d)[_0xf00d('0x28')](_0x386e5a);};}exports['index']=function(_0x31561d,_0x5ae2db){var _0xe93263={},_0x4da17b={},_0x1ada17={'count':0x0,'rows':[]};var _0x157a5d=_[_0xf00d('0x29')](db[_0xf00d('0x2a')][_0xf00d('0x2b')],function(_0x105725){return{'name':_0x105725[_0xf00d('0x2c')],'type':_0x105725['type']['key']};});_0x4da17b[_0xf00d('0x2d')]=_['map'](_0x157a5d,'name');_0x4da17b[_0xf00d('0x2e')]=_[_0xf00d('0x2f')](_0x31561d[_0xf00d('0x2e')]);_0x4da17b['filters']=_['intersection'](_0x4da17b[_0xf00d('0x2d')],_0x4da17b[_0xf00d('0x2e')]);_0xe93263[_0xf00d('0x30')]=_[_0xf00d('0x31')](_0x4da17b[_0xf00d('0x2d')],qs[_0xf00d('0x32')](_0x31561d[_0xf00d('0x2e')]['fields']));_0xe93263[_0xf00d('0x30')]=_0xe93263['attributes'][_0xf00d('0x33')]?_0xe93263[_0xf00d('0x30')]:_0x4da17b[_0xf00d('0x2d')];if(!_0x31561d['query'][_0xf00d('0x34')]('nolimit')){_0xe93263[_0xf00d('0x1d')]=qs[_0xf00d('0x1d')](_0x31561d[_0xf00d('0x2e')]['limit']);_0xe93263['offset']=qs[_0xf00d('0x1a')](_0x31561d[_0xf00d('0x2e')][_0xf00d('0x1a')]);}_0xe93263['order']=qs['sort'](_0x31561d[_0xf00d('0x2e')][_0xf00d('0x35')]);_0xe93263[_0xf00d('0x36')]=qs[_0xf00d('0x37')](_[_0xf00d('0x38')](_0x31561d[_0xf00d('0x2e')],_0x4da17b[_0xf00d('0x37')]),_0x157a5d);if(_0x31561d[_0xf00d('0x2e')][_0xf00d('0x39')]){_0xe93263[_0xf00d('0x36')]=_[_0xf00d('0x3a')](_0xe93263[_0xf00d('0x36')],{'$or':_[_0xf00d('0x29')](_0x157a5d,function(_0x46b3f8){if(_0x46b3f8[_0xf00d('0x3b')]!==_0xf00d('0x3c')){var _0x3b8402={};_0x3b8402[_0x46b3f8[_0xf00d('0x27')]]={'$like':'%'+_0x31561d[_0xf00d('0x2e')]['filter']+'%'};return _0x3b8402;}})});}_0xe93263=_[_0xf00d('0x3a')]({},_0xe93263,_0x31561d['options']);var _0x335ef2={'where':_0xe93263[_0xf00d('0x36')]};return db[_0xf00d('0x2a')]['count'](_0x335ef2)[_0xf00d('0x22')](function(_0x3f8df7){_0x1ada17[_0xf00d('0x1c')]=_0x3f8df7;if(_0x31561d[_0xf00d('0x2e')]['includeAll']){_0xe93263[_0xf00d('0x3d')]=[{'all':!![]}];}return db[_0xf00d('0x2a')][_0xf00d('0x3e')](_0xe93263);})[_0xf00d('0x22')](function(_0x73339e){_0x1ada17[_0xf00d('0x3f')]=_0x73339e;return _0x1ada17;})['then'](respondWithFilteredResult(_0x5ae2db,_0xe93263))[_0xf00d('0x40')](handleError(_0x5ae2db,null));};exports['show']=function(_0x21c94c,_0x593118){var _0x2520fc={'raw':![],'where':{'id':_0x21c94c[_0xf00d('0x41')]['id']}},_0x1506b1={};_0x1506b1[_0xf00d('0x2d')]=_[_0xf00d('0x2f')](db[_0xf00d('0x2a')][_0xf00d('0x2b')]);_0x1506b1[_0xf00d('0x2e')]=_[_0xf00d('0x2f')](_0x21c94c[_0xf00d('0x2e')]);_0x1506b1[_0xf00d('0x37')]=_[_0xf00d('0x31')](_0x1506b1[_0xf00d('0x2d')],_0x1506b1['query']);_0x2520fc[_0xf00d('0x30')]=_[_0xf00d('0x31')](_0x1506b1[_0xf00d('0x2d')],qs[_0xf00d('0x32')](_0x21c94c['query'][_0xf00d('0x32')]));_0x2520fc['attributes']=_0x2520fc[_0xf00d('0x30')][_0xf00d('0x33')]?_0x2520fc[_0xf00d('0x30')]:_0x1506b1['model'];if(_0x21c94c[_0xf00d('0x2e')]['includeAll']){_0x2520fc[_0xf00d('0x3d')]=[{'all':!![]}];}_0x2520fc=_[_0xf00d('0x3a')]({},_0x2520fc,_0x21c94c[_0xf00d('0x42')]);return db[_0xf00d('0x2a')]['find'](_0x2520fc)[_0xf00d('0x22')](handleEntityNotFound(_0x593118,null))[_0xf00d('0x22')](respondWithResult(_0x593118,null))[_0xf00d('0x40')](handleError(_0x593118,null));};exports[_0xf00d('0x43')]=function(_0x520ea0,_0x527c45){return db['IntegrationReport'][_0xf00d('0x43')](_0x520ea0[_0xf00d('0x44')],{})['then'](respondWithResult(_0x527c45,0xc9))[_0xf00d('0x40')](handleError(_0x527c45,null));};exports[_0xf00d('0x21')]=function(_0xe03055,_0x1d4ab9){if(_0xe03055['body']['id']){delete _0xe03055[_0xf00d('0x44')]['id'];}return db[_0xf00d('0x2a')][_0xf00d('0x45')]({'where':{'id':_0xe03055[_0xf00d('0x41')]['id']}})[_0xf00d('0x22')](handleEntityNotFound(_0x1d4ab9,null))[_0xf00d('0x22')](saveUpdates(_0xe03055[_0xf00d('0x44')],null))[_0xf00d('0x22')](respondWithResult(_0x1d4ab9,null))[_0xf00d('0x40')](handleError(_0x1d4ab9,null));};exports[_0xf00d('0x23')]=function(_0x3826df,_0x4d84a8){return db[_0xf00d('0x2a')]['find']({'where':{'id':_0x3826df[_0xf00d('0x41')]['id']}})[_0xf00d('0x22')](handleEntityNotFound(_0x4d84a8,null))[_0xf00d('0x22')](removeEntity(_0x4d84a8,null))['catch'](handleError(_0x4d84a8,null));};exports['describe']=function(_0x4978fc,_0x3ee849){return db[_0xf00d('0x2a')][_0xf00d('0x46')]()[_0xf00d('0x22')](respondWithResult(_0x3ee849,null))[_0xf00d('0x40')](handleError(_0x3ee849,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6b09db5..ed7ddfe 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 _0x4023=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4023,0x1b6));var _0x3402=function(_0x3b1739,_0x28a67c){_0x3b1739=_0x3b1739-0x0;var _0x5d2274=_0x4023[_0x3b1739];return _0x5d2274;};'use strict';var _=require(_0x3402('0x0'));var util=require(_0x3402('0x1'));var logger=require(_0x3402('0x2'))(_0x3402('0x3'));var moment=require(_0x3402('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3402('0x5'));var rimraf=require(_0x3402('0x6'));var config=require(_0x3402('0x7'));var attributes=require('./integrationReport.attributes');module[_0x3402('0x8')]=function(_0x4ce02f,_0x56a649){return _0x4ce02f[_0x3402('0x9')](_0x3402('0xa'),attributes,{'tableName':_0x3402('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a0c=['../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a0c,0x1f4));var _0xc6a0=function(_0x3caddf,_0x3c0668){_0x3caddf=_0x3caddf-0x0;var _0x1c4a8e=_0x6a0c[_0x3caddf];return _0x1c4a8e;};'use strict';var _=require('lodash');var util=require(_0xc6a0('0x0'));var logger=require(_0xc6a0('0x1'))(_0xc6a0('0x2'));var moment=require(_0xc6a0('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6a0('0x4'));var fs=require('fs');var path=require(_0xc6a0('0x5'));var rimraf=require(_0xc6a0('0x6'));var config=require(_0xc6a0('0x7'));var attributes=require(_0xc6a0('0x8'));module[_0xc6a0('0x9')]=function(_0x3cb39c,_0x5457b8){return _0x3cb39c[_0xc6a0('0xa')](_0xc6a0('0xb'),attributes,{'tableName':_0xc6a0('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 31ec7a3..906e902 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 _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5d1822,_0x205419){var _0x3122ef=function(_0x441847){while(--_0x441847){_0x5d1822['push'](_0x5d1822['shift']());}};_0x3122ef(++_0x205419);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2ee2eb,_0x2a0cd6){var _0x31efcf=function(_0x343455){while(--_0x343455){_0x2ee2eb['push'](_0x2ee2eb['shift']());}};_0x31efcf(++_0x2a0cd6);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 814cebf..e40ac29 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 _0x2087=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2087,0xf3));var _0x7208=function(_0x38e11f,_0x3653ce){_0x38e11f=_0x38e11f-0x0;var _0x272dca=_0x2087[_0x38e11f];return _0x272dca;};'use strict';var multer=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var path=require(_0x7208('0x2'));var timeout=require(_0x7208('0x3'));var express=require('express');var router=express[_0x7208('0x4')]();var fs_extra=require(_0x7208('0x5'));var auth=require(_0x7208('0x6'));var interaction=require(_0x7208('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x7208('0x8')]('/',auth['isAuthenticated'](),controller[_0x7208('0x9')]);router['get'](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0xc')]);router[_0x7208('0x8')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0xe')]);router['post']('/',auth[_0x7208('0xb')](),controller[_0x7208('0xf')]);router[_0x7208('0x10')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0x11')]);router['post'](_0x7208('0x12'),auth[_0x7208('0xb')](),controller[_0x7208('0x13')]);router[_0x7208('0x14')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller['update']);router[_0x7208('0x15')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0x16')]);module[_0x7208('0x17')]=router; \ No newline at end of file +var _0x0514=['isAuthenticated','/:id','getIntervals','create','post','/:id/sub_intervals','addIntervals','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./interval.controller','get'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x0514,0x1f0));var _0x4051=function(_0x3011d2,_0x4f8091){_0x3011d2=_0x3011d2-0x0;var _0x54fb6e=_0x0514[_0x3011d2];return _0x54fb6e;};'use strict';var multer=require(_0x4051('0x0'));var util=require('util');var path=require(_0x4051('0x1'));var timeout=require(_0x4051('0x2'));var express=require('express');var router=express[_0x4051('0x3')]();var fs_extra=require(_0x4051('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4051('0x5'));var controller=require(_0x4051('0x6'));router[_0x4051('0x7')]('/',auth[_0x4051('0x8')](),controller['index']);router['get'](_0x4051('0x9'),auth[_0x4051('0x8')](),controller['show']);router[_0x4051('0x7')]('/:id/sub_intervals',auth[_0x4051('0x8')](),controller[_0x4051('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4051('0xb')]);router[_0x4051('0xc')](_0x4051('0xd'),auth[_0x4051('0x8')](),controller['addInterval']);router[_0x4051('0xc')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x4051('0xe')]);router[_0x4051('0xf')](_0x4051('0x9'),auth[_0x4051('0x8')](),controller['update']);router[_0x4051('0x10')]('/:id',auth[_0x4051('0x8')](),controller[_0x4051('0x11')]);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 fee4075..a529959 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 _0xf134=['sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf134,0xe1));var _0x4f13=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xf134[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0x4f13('0x0'));module[_0x4f13('0x1')]={'name':{'type':Sequelize[_0x4f13('0x2')]},'description':{'type':Sequelize[_0x4f13('0x2')]},'interval':{'type':Sequelize[_0x4f13('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x1d8d=['exports','STRING','sequelize'];(function(_0x36a212,_0x4dd44c){var _0x59393=function(_0x4b25a2){while(--_0x4b25a2){_0x36a212['push'](_0x36a212['shift']());}};_0x59393(++_0x4dd44c);}(_0x1d8d,0x1ca));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1d8('0x0'));module[_0xd1d8('0x1')]={'name':{'type':Sequelize[_0xd1d8('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd1d8('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8c4da7f..993cfd0 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 _0x1fb8=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','addInterval','IntervalId','getIntervals','findOne','options','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','Interval','findAll','rows','catch','params','keys','create'];(function(_0x556d82,_0x10bf5c){var _0x34133e=function(_0x3847d7){while(--_0x3847d7){_0x556d82['push'](_0x556d82['shift']());}};_0x34133e(++_0x10bf5c);}(_0x1fb8,0x72));var _0x81fb=function(_0x5a56cc,_0x29650c){_0x5a56cc=_0x5a56cc-0x0;var _0x589caa=_0x1fb8[_0x5a56cc];return _0x589caa;};'use strict';var emlformat=require(_0x81fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81fb('0x1'));var jsonpatch=require(_0x81fb('0x2'));var rp=require(_0x81fb('0x3'));var moment=require(_0x81fb('0x4'));var BPromise=require(_0x81fb('0x5'));var Mustache=require(_0x81fb('0x6'));var util=require(_0x81fb('0x7'));var path=require(_0x81fb('0x8'));var sox=require('sox');var csv=require(_0x81fb('0x9'));var ejs=require(_0x81fb('0xa'));var fs=require('fs');var fs_extra=require(_0x81fb('0xb'));var _=require(_0x81fb('0xc'));var squel=require(_0x81fb('0xd'));var crypto=require(_0x81fb('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x81fb('0x9'));var querystring=require(_0x81fb('0xf'));var Papa=require(_0x81fb('0x10'));var Redis=require(_0x81fb('0x11'));var authService=require(_0x81fb('0x12'));var qs=require(_0x81fb('0x13'));var as=require(_0x81fb('0x14'));var hardwareService=require(_0x81fb('0x15'));var logger=require(_0x81fb('0x16'))(_0x81fb('0x17'));var utils=require(_0x81fb('0x18'));var config=require(_0x81fb('0x19'));var licenseUtil=require(_0x81fb('0x1a'));var db=require(_0x81fb('0x1b'))['db'];var extensions=require(_0x81fb('0x1c'));function respondWithStatusCode(_0x15f619,_0x2e070d){_0x2e070d=_0x2e070d||0xcc;return function(_0x1aad0b){if(_0x1aad0b){return _0x15f619[_0x81fb('0x1d')](_0x2e070d);}return _0x15f619[_0x81fb('0x1e')](_0x2e070d)[_0x81fb('0x1f')]();};}function respondWithResult(_0x40ac5f,_0x140132){_0x140132=_0x140132||0xc8;return function(_0x2844e9){if(_0x2844e9){return _0x40ac5f['status'](_0x140132)[_0x81fb('0x20')](_0x2844e9);}};}function respondWithFilteredResult(_0x334601,_0x5627d8){return function(_0x2289b0){if(_0x2289b0){var _0x35fb8b=typeof _0x5627d8['offset']===_0x81fb('0x21')&&typeof _0x5627d8['limit']==='undefined';var _0x3c5f21=_0x2289b0['count'];var _0x120821=_0x35fb8b?0x0:_0x5627d8['offset'];var _0x349156=_0x35fb8b?_0x2289b0[_0x81fb('0x22')]:_0x5627d8[_0x81fb('0x23')]+_0x5627d8[_0x81fb('0x24')];var _0x33f648;if(_0x349156>=_0x3c5f21){_0x349156=_0x3c5f21;_0x33f648=0xc8;}else{_0x33f648=0xce;}_0x334601[_0x81fb('0x1e')](_0x33f648);return _0x334601[_0x81fb('0x25')](_0x81fb('0x26'),_0x120821+'-'+_0x349156+'/'+_0x3c5f21)[_0x81fb('0x20')](_0x2289b0);}return null;};}function patchUpdates(_0x1c3104){return function(_0x1a5161){try{jsonpatch['apply'](_0x1a5161,_0x1c3104,!![]);}catch(_0x551eeb){return BPromise['reject'](_0x551eeb);}return _0x1a5161[_0x81fb('0x27')]();};}function saveUpdates(_0x5dc0bb,_0x4286fc){return function(_0x23cb54){if(_0x23cb54){return _0x23cb54['update'](_0x5dc0bb)[_0x81fb('0x28')](function(_0x2a8871){return _0x2a8871;});}return null;};}function removeEntity(_0xa0dda6,_0x66558d){return function(_0x547343){if(_0x547343){return _0x547343[_0x81fb('0x29')]()['then'](function(){var _0x5b9031=_0x547343[_0x81fb('0x2a')]({'plain':!![]});var _0x34ffa5='Intervals';return db[_0x81fb('0x2b')]['destroy']({'where':{'type':_0x34ffa5,'resourceId':_0x5b9031['id']}})['then'](function(){return _0x547343;});})[_0x81fb('0x28')](function(){_0xa0dda6[_0x81fb('0x1e')](0xcc)[_0x81fb('0x1f')]();});}};}function handleEntityNotFound(_0x3dd949,_0x283ddd){return function(_0x23580e){if(!_0x23580e){_0x3dd949['sendStatus'](0x194);}return _0x23580e;};}function handleError(_0x4fb8d5,_0x4d58ac){_0x4d58ac=_0x4d58ac||0x1f4;return function(_0x4d1197){logger[_0x81fb('0x2c')](_0x4d1197[_0x81fb('0x2d')]);if(_0x4d1197['name']){delete _0x4d1197[_0x81fb('0x2e')];}_0x4fb8d5[_0x81fb('0x1e')](_0x4d58ac)[_0x81fb('0x2f')](_0x4d1197);};}exports['index']=function(_0x10abfe,_0x5e9094){var _0x3226d3={},_0x26d66e={},_0x50c443={'count':0x0,'rows':[]};var _0x31619a=_[_0x81fb('0x30')](db['Interval'][_0x81fb('0x31')],function(_0x52caf4){return{'name':_0x52caf4[_0x81fb('0x32')],'type':_0x52caf4[_0x81fb('0x33')][_0x81fb('0x34')]};});_0x26d66e[_0x81fb('0x35')]=_[_0x81fb('0x30')](_0x31619a,_0x81fb('0x2e'));_0x26d66e[_0x81fb('0x36')]=_['keys'](_0x10abfe[_0x81fb('0x36')]);_0x26d66e[_0x81fb('0x37')]=_[_0x81fb('0x38')](_0x26d66e[_0x81fb('0x35')],_0x26d66e[_0x81fb('0x36')]);_0x3226d3[_0x81fb('0x39')]=_[_0x81fb('0x38')](_0x26d66e['model'],qs['fields'](_0x10abfe[_0x81fb('0x36')][_0x81fb('0x3a')]));_0x3226d3[_0x81fb('0x39')]=_0x3226d3[_0x81fb('0x39')][_0x81fb('0x3b')]?_0x3226d3[_0x81fb('0x39')]:_0x26d66e[_0x81fb('0x35')];if(!_0x10abfe[_0x81fb('0x36')][_0x81fb('0x3c')](_0x81fb('0x3d'))){_0x3226d3[_0x81fb('0x24')]=qs[_0x81fb('0x24')](_0x10abfe[_0x81fb('0x36')]['limit']);_0x3226d3[_0x81fb('0x23')]=qs[_0x81fb('0x23')](_0x10abfe[_0x81fb('0x36')][_0x81fb('0x23')]);}_0x3226d3[_0x81fb('0x3e')]=qs[_0x81fb('0x3f')](_0x10abfe['query'][_0x81fb('0x3f')]);_0x3226d3[_0x81fb('0x40')]=qs[_0x81fb('0x37')](_[_0x81fb('0x41')](_0x10abfe['query'],_0x26d66e['filters']),_0x31619a);if(_0x10abfe[_0x81fb('0x36')][_0x81fb('0x42')]){_0x3226d3[_0x81fb('0x40')]=_['merge'](_0x3226d3[_0x81fb('0x40')],{'$or':_[_0x81fb('0x30')](_0x31619a,function(_0x499d59){if(_0x499d59[_0x81fb('0x33')]!==_0x81fb('0x43')){var _0x2b305b={};_0x2b305b[_0x499d59[_0x81fb('0x2e')]]={'$like':'%'+_0x10abfe['query'][_0x81fb('0x42')]+'%'};return _0x2b305b;}})});}_0x3226d3=_[_0x81fb('0x44')]({},_0x3226d3,_0x10abfe['options']);var _0x296f96={'where':_0x3226d3['where']};return db['Interval']['count'](_0x296f96)['then'](function(_0x461e50){_0x50c443['count']=_0x461e50;if(_0x10abfe['query'][_0x81fb('0x45')]){_0x3226d3[_0x81fb('0x46')]=[{'all':!![]}];}return db[_0x81fb('0x47')][_0x81fb('0x48')](_0x3226d3);})['then'](function(_0x1f97a3){_0x50c443[_0x81fb('0x49')]=_0x1f97a3;return _0x50c443;})['then'](respondWithFilteredResult(_0x5e9094,_0x3226d3))[_0x81fb('0x4a')](handleError(_0x5e9094,null));};exports['show']=function(_0x1857f9,_0x57a0bd){var _0x39bf92={'raw':!![],'where':{'id':_0x1857f9[_0x81fb('0x4b')]['id']}},_0x3a0e3e={};_0x3a0e3e['model']=_[_0x81fb('0x4c')](db[_0x81fb('0x47')]['rawAttributes']);_0x3a0e3e['query']=_[_0x81fb('0x4c')](_0x1857f9['query']);_0x3a0e3e[_0x81fb('0x37')]=_[_0x81fb('0x38')](_0x3a0e3e[_0x81fb('0x35')],_0x3a0e3e[_0x81fb('0x36')]);_0x39bf92['attributes']=_[_0x81fb('0x38')](_0x3a0e3e[_0x81fb('0x35')],qs[_0x81fb('0x3a')](_0x1857f9[_0x81fb('0x36')]['fields']));_0x39bf92[_0x81fb('0x39')]=_0x39bf92[_0x81fb('0x39')][_0x81fb('0x3b')]?_0x39bf92[_0x81fb('0x39')]:_0x3a0e3e['model'];if(_0x1857f9[_0x81fb('0x36')][_0x81fb('0x45')]){_0x39bf92[_0x81fb('0x46')]=[{'all':!![]}];}_0x39bf92=_[_0x81fb('0x44')]({},_0x39bf92,_0x1857f9['options']);return db['Interval']['find'](_0x39bf92)[_0x81fb('0x28')](handleEntityNotFound(_0x57a0bd,null))[_0x81fb('0x28')](respondWithResult(_0x57a0bd,null))[_0x81fb('0x4a')](handleError(_0x57a0bd,null));};exports[_0x81fb('0x4d')]=function(_0x189c54,_0x265aa9){return db[_0x81fb('0x47')][_0x81fb('0x4d')](_0x189c54[_0x81fb('0x4e')],{})['then'](function(_0x5162c4){var _0x2c1da7=_0x189c54[_0x81fb('0x4f')][_0x81fb('0x2a')]({'plain':!![]});if(!_0x2c1da7)throw new Error(_0x81fb('0x50'));if(_0x2c1da7[_0x81fb('0x51')]===_0x81fb('0x4f')){var _0x13c41=_0x5162c4[_0x81fb('0x2a')]({'plain':!![]});var _0x2386c7='Intervals';return db[_0x81fb('0x52')][_0x81fb('0x53')]({'where':{'name':_0x2386c7,'userProfileId':_0x2c1da7[_0x81fb('0x54')]},'raw':!![]})[_0x81fb('0x28')](function(_0x2acecc){if(_0x2acecc&&_0x2acecc[_0x81fb('0x55')]===0x0){return db[_0x81fb('0x2b')][_0x81fb('0x4d')]({'name':_0x13c41[_0x81fb('0x2e')],'resourceId':_0x13c41['id'],'type':_0x2acecc[_0x81fb('0x2e')],'sectionId':_0x2acecc['id']},{})[_0x81fb('0x28')](function(){return _0x5162c4;});}else{return _0x5162c4;}})[_0x81fb('0x4a')](function(_0x104abb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x104abb);throw _0x104abb;});}return _0x5162c4;})['then'](respondWithResult(_0x265aa9,0xc9))[_0x81fb('0x4a')](handleError(_0x265aa9,null));};exports[_0x81fb('0x56')]=function(_0x1f980e,_0x35844c){if(_0x1f980e[_0x81fb('0x4e')]['id']){delete _0x1f980e['body']['id'];}return db[_0x81fb('0x47')][_0x81fb('0x53')]({'where':{'id':_0x1f980e[_0x81fb('0x4b')]['id']}})[_0x81fb('0x28')](handleEntityNotFound(_0x35844c,null))[_0x81fb('0x28')](saveUpdates(_0x1f980e[_0x81fb('0x4e')],null))['then'](respondWithResult(_0x35844c,null))[_0x81fb('0x4a')](handleError(_0x35844c,null));};exports['destroy']=function(_0x1cf251,_0x41111c){return db[_0x81fb('0x47')][_0x81fb('0x53')]({'where':{'id':_0x1cf251[_0x81fb('0x4b')]['id']}})[_0x81fb('0x28')](handleEntityNotFound(_0x41111c,null))['then'](removeEntity(_0x41111c,null))[_0x81fb('0x4a')](handleError(_0x41111c,null));};exports[_0x81fb('0x57')]=function(_0x2b432d,_0x1c3a43,_0x9bcd6c){if(_0x2b432d[_0x81fb('0x4e')]['id']){delete _0x2b432d[_0x81fb('0x4e')]['id'];}return db[_0x81fb('0x47')][_0x81fb('0x53')]({'where':{'id':_0x2b432d[_0x81fb('0x4b')]['id']}})[_0x81fb('0x28')](handleEntityNotFound(_0x1c3a43,null))[_0x81fb('0x28')](function(_0x5c70b8){if(_0x5c70b8){_0x2b432d[_0x81fb('0x4e')][_0x81fb('0x58')]=_0x5c70b8['id'];return db[_0x81fb('0x47')][_0x81fb('0x4d')](_0x2b432d[_0x81fb('0x4e')]);}})[_0x81fb('0x28')](respondWithResult(_0x1c3a43,null))[_0x81fb('0x4a')](handleError(_0x1c3a43,null));};exports[_0x81fb('0x59')]=function(_0x22999b,_0x4c9156,_0x461708){var _0x556ce1={};var _0x7f9425={};var _0x18b1e1;var _0x4dbcde;return db[_0x81fb('0x47')][_0x81fb('0x5a')]({'where':{'id':_0x22999b[_0x81fb('0x4b')]['id']}})[_0x81fb('0x28')](handleEntityNotFound(_0x4c9156,null))[_0x81fb('0x28')](function(_0x406264){if(_0x406264){_0x18b1e1=_0x406264;_0x7f9425[_0x81fb('0x35')]=_[_0x81fb('0x4c')](db['Interval'][_0x81fb('0x31')]);_0x7f9425[_0x81fb('0x36')]=_['keys'](_0x22999b['query']);_0x7f9425[_0x81fb('0x37')]=_[_0x81fb('0x38')](_0x7f9425[_0x81fb('0x35')],_0x7f9425[_0x81fb('0x36')]);_0x556ce1[_0x81fb('0x39')]=_[_0x81fb('0x38')](_0x7f9425[_0x81fb('0x35')],qs[_0x81fb('0x3a')](_0x22999b[_0x81fb('0x36')][_0x81fb('0x3a')]));_0x556ce1[_0x81fb('0x39')]=_0x556ce1[_0x81fb('0x39')]['length']?_0x556ce1['attributes']:_0x7f9425['model'];_0x556ce1[_0x81fb('0x3e')]=qs[_0x81fb('0x3f')](_0x22999b['query'][_0x81fb('0x3f')]);_0x556ce1[_0x81fb('0x40')]=qs['filters'](_[_0x81fb('0x41')](_0x22999b[_0x81fb('0x36')],_0x7f9425[_0x81fb('0x37')]));if(_0x22999b[_0x81fb('0x36')][_0x81fb('0x42')]){_0x556ce1[_0x81fb('0x40')]=_[_0x81fb('0x44')](_0x556ce1[_0x81fb('0x40')],{'$or':_[_0x81fb('0x30')](_0x556ce1[_0x81fb('0x39')],function(_0x18de88){var _0x352dbc={};_0x352dbc[_0x18de88]={'$like':'%'+_0x22999b['query'][_0x81fb('0x42')]+'%'};return _0x352dbc;})});}_0x556ce1=_['merge']({},_0x556ce1,_0x22999b[_0x81fb('0x5b')]);return _0x18b1e1[_0x81fb('0x59')](_0x556ce1);}})[_0x81fb('0x28')](function(_0x5d3b91){if(_0x5d3b91){_0x4dbcde=_0x5d3b91[_0x81fb('0x3b')];if(!_0x22999b[_0x81fb('0x36')][_0x81fb('0x3c')](_0x81fb('0x3d'))){_0x556ce1[_0x81fb('0x24')]=qs[_0x81fb('0x24')](_0x22999b['query'][_0x81fb('0x24')]);_0x556ce1['offset']=qs[_0x81fb('0x23')](_0x22999b['query'][_0x81fb('0x23')]);}return _0x18b1e1[_0x81fb('0x59')](_0x556ce1);}})[_0x81fb('0x28')](function(_0x34da8a){if(_0x34da8a){return _0x34da8a?{'count':_0x4dbcde,'rows':_0x34da8a}:null;}})[_0x81fb('0x28')](respondWithResult(_0x4c9156,null))[_0x81fb('0x4a')](handleError(_0x4c9156,null));};exports[_0x81fb('0x5c')]=function(_0x1905ce,_0x3ddf96,_0x3916a9){return db['Interval']['findOne']({'where':{'id':_0x1905ce[_0x81fb('0x4b')]['id']}})[_0x81fb('0x28')](handleEntityNotFound(_0x3ddf96,null))[_0x81fb('0x28')](function(_0x3cf4be){if(_0x3cf4be){return db[_0x81fb('0x5d')][_0x81fb('0x5e')](function(_0x4372ab){return db['Interval']['destroy']({'where':{'IntervalId':_0x1905ce['params']['id']},'transaction':_0x4372ab})[_0x81fb('0x28')](function(_0x12342e){var _0x4abda1=_[_0x81fb('0x30')](_0x1905ce[_0x81fb('0x4e')],function(_0x27e9ec){delete _0x27e9ec['id'];_0x27e9ec[_0x81fb('0x58')]=_0x1905ce[_0x81fb('0x4b')]['id'];return _0x27e9ec;});return db[_0x81fb('0x47')][_0x81fb('0x5f')](_0x4abda1,{'transaction':_0x4372ab});});})[_0x81fb('0x28')](function(){return db[_0x81fb('0x47')][_0x81fb('0x48')]({'where':{'IntervalId':_0x1905ce[_0x81fb('0x4b')]['id']}});});}})[_0x81fb('0x28')](respondWithResult(_0x3ddf96,null))[_0x81fb('0x4a')](handleError(_0x3ddf96,null));}; \ No newline at end of file +var _0x2dea=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','Intervals','error','stack','name','send','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Interval','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2dea,0x1b7));var _0xa2de=function(_0xc5c4fd,_0x1464e6){_0xc5c4fd=_0xc5c4fd-0x0;var _0x25247e=_0x2dea[_0xc5c4fd];return _0x25247e;};'use strict';var emlformat=require(_0xa2de('0x0'));var rimraf=require(_0xa2de('0x1'));var zipdir=require(_0xa2de('0x2'));var jsonpatch=require(_0xa2de('0x3'));var rp=require('request-promise');var moment=require(_0xa2de('0x4'));var BPromise=require(_0xa2de('0x5'));var Mustache=require(_0xa2de('0x6'));var util=require(_0xa2de('0x7'));var path=require(_0xa2de('0x8'));var sox=require('sox');var csv=require(_0xa2de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa2de('0xa'));var crypto=require(_0xa2de('0xb'));var jsforce=require(_0xa2de('0xc'));var deskjs=require(_0xa2de('0xd'));var toCsv=require(_0xa2de('0x9'));var querystring=require('querystring');var Papa=require(_0xa2de('0xe'));var Redis=require('ioredis');var authService=require(_0xa2de('0xf'));var qs=require(_0xa2de('0x10'));var as=require(_0xa2de('0x11'));var hardwareService=require(_0xa2de('0x12'));var logger=require(_0xa2de('0x13'))(_0xa2de('0x14'));var utils=require('../../config/utils');var config=require(_0xa2de('0x15'));var licenseUtil=require(_0xa2de('0x16'));var db=require(_0xa2de('0x17'))['db'];var extensions=require(_0xa2de('0x18'));function respondWithStatusCode(_0x18e2cc,_0x3af0c3){_0x3af0c3=_0x3af0c3||0xcc;return function(_0x57344e){if(_0x57344e){return _0x18e2cc[_0xa2de('0x19')](_0x3af0c3);}return _0x18e2cc[_0xa2de('0x1a')](_0x3af0c3)[_0xa2de('0x1b')]();};}function respondWithResult(_0x16e9aa,_0x2b7cfa){_0x2b7cfa=_0x2b7cfa||0xc8;return function(_0x833ddb){if(_0x833ddb){return _0x16e9aa[_0xa2de('0x1a')](_0x2b7cfa)['json'](_0x833ddb);}};}function respondWithFilteredResult(_0x2d4ebd,_0x33af2d){return function(_0x241022){if(_0x241022){var _0x5b16aa=typeof _0x33af2d[_0xa2de('0x1c')]===_0xa2de('0x1d')&&typeof _0x33af2d[_0xa2de('0x1e')]===_0xa2de('0x1d');var _0x5ed5df=_0x241022['count'];var _0x398305=_0x5b16aa?0x0:_0x33af2d[_0xa2de('0x1c')];var _0xd06544=_0x5b16aa?_0x241022[_0xa2de('0x1f')]:_0x33af2d[_0xa2de('0x1c')]+_0x33af2d[_0xa2de('0x1e')];var _0x3dac2a;if(_0xd06544>=_0x5ed5df){_0xd06544=_0x5ed5df;_0x3dac2a=0xc8;}else{_0x3dac2a=0xce;}_0x2d4ebd['status'](_0x3dac2a);return _0x2d4ebd['set'](_0xa2de('0x20'),_0x398305+'-'+_0xd06544+'/'+_0x5ed5df)[_0xa2de('0x21')](_0x241022);}return null;};}function patchUpdates(_0x28540b){return function(_0x164cc5){try{jsonpatch[_0xa2de('0x22')](_0x164cc5,_0x28540b,!![]);}catch(_0xab003a){return BPromise[_0xa2de('0x23')](_0xab003a);}return _0x164cc5['save']();};}function saveUpdates(_0x5892e8,_0x39f616){return function(_0x346cd7){if(_0x346cd7){return _0x346cd7[_0xa2de('0x24')](_0x5892e8)[_0xa2de('0x25')](function(_0x3daf46){return _0x3daf46;});}return null;};}function removeEntity(_0x137a55,_0xfeacc6){return function(_0x18b4f6){if(_0x18b4f6){return _0x18b4f6[_0xa2de('0x26')]()['then'](function(){var _0x1e2ff7=_0x18b4f6[_0xa2de('0x27')]({'plain':!![]});var _0x3c7b68=_0xa2de('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c7b68,'resourceId':_0x1e2ff7['id']}})['then'](function(){return _0x18b4f6;});})[_0xa2de('0x25')](function(){_0x137a55[_0xa2de('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb65417,_0x643817){return function(_0x25a92b){if(!_0x25a92b){_0xb65417[_0xa2de('0x19')](0x194);}return _0x25a92b;};}function handleError(_0x10c54d,_0x15397c){_0x15397c=_0x15397c||0x1f4;return function(_0x768fc2){logger[_0xa2de('0x29')](_0x768fc2[_0xa2de('0x2a')]);if(_0x768fc2[_0xa2de('0x2b')]){delete _0x768fc2[_0xa2de('0x2b')];}_0x10c54d[_0xa2de('0x1a')](_0x15397c)[_0xa2de('0x2c')](_0x768fc2);};}exports['index']=function(_0x16464e,_0x1b853e){var _0x3bb5c8={},_0x36b204={},_0x4b4c57={'count':0x0,'rows':[]};var _0x1e50d8=_[_0xa2de('0x2d')](db['Interval'][_0xa2de('0x2e')],function(_0x479757){return{'name':_0x479757['fieldName'],'type':_0x479757[_0xa2de('0x2f')]['key']};});_0x36b204[_0xa2de('0x30')]=_[_0xa2de('0x2d')](_0x1e50d8,_0xa2de('0x2b'));_0x36b204[_0xa2de('0x31')]=_[_0xa2de('0x32')](_0x16464e[_0xa2de('0x31')]);_0x36b204[_0xa2de('0x33')]=_['intersection'](_0x36b204[_0xa2de('0x30')],_0x36b204[_0xa2de('0x31')]);_0x3bb5c8[_0xa2de('0x34')]=_[_0xa2de('0x35')](_0x36b204['model'],qs[_0xa2de('0x36')](_0x16464e[_0xa2de('0x31')][_0xa2de('0x36')]));_0x3bb5c8[_0xa2de('0x34')]=_0x3bb5c8['attributes'][_0xa2de('0x37')]?_0x3bb5c8[_0xa2de('0x34')]:_0x36b204['model'];if(!_0x16464e['query'][_0xa2de('0x38')](_0xa2de('0x39'))){_0x3bb5c8[_0xa2de('0x1e')]=qs['limit'](_0x16464e['query'][_0xa2de('0x1e')]);_0x3bb5c8[_0xa2de('0x1c')]=qs[_0xa2de('0x1c')](_0x16464e[_0xa2de('0x31')][_0xa2de('0x1c')]);}_0x3bb5c8[_0xa2de('0x3a')]=qs['sort'](_0x16464e['query'][_0xa2de('0x3b')]);_0x3bb5c8[_0xa2de('0x3c')]=qs[_0xa2de('0x33')](_[_0xa2de('0x3d')](_0x16464e[_0xa2de('0x31')],_0x36b204['filters']),_0x1e50d8);if(_0x16464e[_0xa2de('0x31')][_0xa2de('0x3e')]){_0x3bb5c8[_0xa2de('0x3c')]=_['merge'](_0x3bb5c8['where'],{'$or':_['map'](_0x1e50d8,function(_0x5857ea){if(_0x5857ea['type']!==_0xa2de('0x3f')){var _0x3e35c4={};_0x3e35c4[_0x5857ea[_0xa2de('0x2b')]]={'$like':'%'+_0x16464e['query'][_0xa2de('0x3e')]+'%'};return _0x3e35c4;}})});}_0x3bb5c8=_['merge']({},_0x3bb5c8,_0x16464e[_0xa2de('0x40')]);var _0x5f0fed={'where':_0x3bb5c8[_0xa2de('0x3c')]};return db[_0xa2de('0x41')][_0xa2de('0x1f')](_0x5f0fed)[_0xa2de('0x25')](function(_0x4833bd){_0x4b4c57[_0xa2de('0x1f')]=_0x4833bd;if(_0x16464e[_0xa2de('0x31')][_0xa2de('0x42')]){_0x3bb5c8[_0xa2de('0x43')]=[{'all':!![]}];}return db[_0xa2de('0x41')][_0xa2de('0x44')](_0x3bb5c8);})['then'](function(_0x43ae66){_0x4b4c57[_0xa2de('0x45')]=_0x43ae66;return _0x4b4c57;})[_0xa2de('0x25')](respondWithFilteredResult(_0x1b853e,_0x3bb5c8))['catch'](handleError(_0x1b853e,null));};exports[_0xa2de('0x46')]=function(_0x27bf6e,_0x3048ae){var _0x48bbef={'raw':!![],'where':{'id':_0x27bf6e[_0xa2de('0x47')]['id']}},_0x7f0a48={};_0x7f0a48['model']=_['keys'](db[_0xa2de('0x41')][_0xa2de('0x2e')]);_0x7f0a48[_0xa2de('0x31')]=_[_0xa2de('0x32')](_0x27bf6e['query']);_0x7f0a48[_0xa2de('0x33')]=_[_0xa2de('0x35')](_0x7f0a48[_0xa2de('0x30')],_0x7f0a48[_0xa2de('0x31')]);_0x48bbef[_0xa2de('0x34')]=_[_0xa2de('0x35')](_0x7f0a48[_0xa2de('0x30')],qs[_0xa2de('0x36')](_0x27bf6e[_0xa2de('0x31')][_0xa2de('0x36')]));_0x48bbef[_0xa2de('0x34')]=_0x48bbef[_0xa2de('0x34')]['length']?_0x48bbef[_0xa2de('0x34')]:_0x7f0a48[_0xa2de('0x30')];if(_0x27bf6e[_0xa2de('0x31')][_0xa2de('0x42')]){_0x48bbef[_0xa2de('0x43')]=[{'all':!![]}];}_0x48bbef=_[_0xa2de('0x48')]({},_0x48bbef,_0x27bf6e[_0xa2de('0x40')]);return db[_0xa2de('0x41')][_0xa2de('0x49')](_0x48bbef)[_0xa2de('0x25')](handleEntityNotFound(_0x3048ae,null))[_0xa2de('0x25')](respondWithResult(_0x3048ae,null))[_0xa2de('0x4a')](handleError(_0x3048ae,null));};exports[_0xa2de('0x4b')]=function(_0x12cc4b,_0x203e88){return db[_0xa2de('0x41')][_0xa2de('0x4b')](_0x12cc4b[_0xa2de('0x4c')],{})[_0xa2de('0x25')](function(_0x470fc9){var _0x1e25aa=_0x12cc4b[_0xa2de('0x4d')][_0xa2de('0x27')]({'plain':!![]});if(!_0x1e25aa)throw new Error(_0xa2de('0x4e'));if(_0x1e25aa['role']===_0xa2de('0x4d')){var _0x1c51cf=_0x470fc9[_0xa2de('0x27')]({'plain':!![]});var _0x59dd4a='Intervals';return db[_0xa2de('0x4f')][_0xa2de('0x49')]({'where':{'name':_0x59dd4a,'userProfileId':_0x1e25aa[_0xa2de('0x50')]},'raw':!![]})['then'](function(_0x33a069){if(_0x33a069&&_0x33a069[_0xa2de('0x51')]===0x0){return db[_0xa2de('0x52')]['create']({'name':_0x1c51cf[_0xa2de('0x2b')],'resourceId':_0x1c51cf['id'],'type':_0x33a069['name'],'sectionId':_0x33a069['id']},{})[_0xa2de('0x25')](function(){return _0x470fc9;});}else{return _0x470fc9;}})[_0xa2de('0x4a')](function(_0x357453){logger[_0xa2de('0x29')](_0xa2de('0x53'),_0x357453);throw _0x357453;});}return _0x470fc9;})[_0xa2de('0x25')](respondWithResult(_0x203e88,0xc9))[_0xa2de('0x4a')](handleError(_0x203e88,null));};exports[_0xa2de('0x24')]=function(_0x13fa9e,_0x23012c){if(_0x13fa9e[_0xa2de('0x4c')]['id']){delete _0x13fa9e['body']['id'];}return db[_0xa2de('0x41')][_0xa2de('0x49')]({'where':{'id':_0x13fa9e[_0xa2de('0x47')]['id']}})[_0xa2de('0x25')](handleEntityNotFound(_0x23012c,null))[_0xa2de('0x25')](saveUpdates(_0x13fa9e[_0xa2de('0x4c')],null))['then'](respondWithResult(_0x23012c,null))['catch'](handleError(_0x23012c,null));};exports['destroy']=function(_0x21c87c,_0x57fb6c){return db['Interval']['find']({'where':{'id':_0x21c87c[_0xa2de('0x47')]['id']}})[_0xa2de('0x25')](handleEntityNotFound(_0x57fb6c,null))[_0xa2de('0x25')](removeEntity(_0x57fb6c,null))[_0xa2de('0x4a')](handleError(_0x57fb6c,null));};exports['addInterval']=function(_0x535a82,_0x49cacb,_0x1183c1){if(_0x535a82['body']['id']){delete _0x535a82[_0xa2de('0x4c')]['id'];}return db[_0xa2de('0x41')]['find']({'where':{'id':_0x535a82[_0xa2de('0x47')]['id']}})[_0xa2de('0x25')](handleEntityNotFound(_0x49cacb,null))[_0xa2de('0x25')](function(_0x571b00){if(_0x571b00){_0x535a82[_0xa2de('0x4c')][_0xa2de('0x54')]=_0x571b00['id'];return db[_0xa2de('0x41')][_0xa2de('0x4b')](_0x535a82['body']);}})['then'](respondWithResult(_0x49cacb,null))[_0xa2de('0x4a')](handleError(_0x49cacb,null));};exports[_0xa2de('0x55')]=function(_0x315c24,_0x39032f,_0x240cf5){var _0x4a9936={};var _0x4a07f2={};var _0x169631;var _0x419ac5;return db[_0xa2de('0x41')][_0xa2de('0x56')]({'where':{'id':_0x315c24[_0xa2de('0x47')]['id']}})[_0xa2de('0x25')](handleEntityNotFound(_0x39032f,null))[_0xa2de('0x25')](function(_0x5a3766){if(_0x5a3766){_0x169631=_0x5a3766;_0x4a07f2['model']=_['keys'](db[_0xa2de('0x41')][_0xa2de('0x2e')]);_0x4a07f2[_0xa2de('0x31')]=_[_0xa2de('0x32')](_0x315c24[_0xa2de('0x31')]);_0x4a07f2[_0xa2de('0x33')]=_[_0xa2de('0x35')](_0x4a07f2[_0xa2de('0x30')],_0x4a07f2[_0xa2de('0x31')]);_0x4a9936[_0xa2de('0x34')]=_['intersection'](_0x4a07f2['model'],qs[_0xa2de('0x36')](_0x315c24[_0xa2de('0x31')][_0xa2de('0x36')]));_0x4a9936[_0xa2de('0x34')]=_0x4a9936[_0xa2de('0x34')][_0xa2de('0x37')]?_0x4a9936[_0xa2de('0x34')]:_0x4a07f2[_0xa2de('0x30')];_0x4a9936[_0xa2de('0x3a')]=qs[_0xa2de('0x3b')](_0x315c24['query'][_0xa2de('0x3b')]);_0x4a9936[_0xa2de('0x3c')]=qs[_0xa2de('0x33')](_[_0xa2de('0x3d')](_0x315c24['query'],_0x4a07f2[_0xa2de('0x33')]));if(_0x315c24['query'][_0xa2de('0x3e')]){_0x4a9936['where']=_[_0xa2de('0x48')](_0x4a9936[_0xa2de('0x3c')],{'$or':_[_0xa2de('0x2d')](_0x4a9936[_0xa2de('0x34')],function(_0x5af10a){var _0x46cbb6={};_0x46cbb6[_0x5af10a]={'$like':'%'+_0x315c24[_0xa2de('0x31')][_0xa2de('0x3e')]+'%'};return _0x46cbb6;})});}_0x4a9936=_[_0xa2de('0x48')]({},_0x4a9936,_0x315c24[_0xa2de('0x40')]);return _0x169631[_0xa2de('0x55')](_0x4a9936);}})[_0xa2de('0x25')](function(_0x34bb22){if(_0x34bb22){_0x419ac5=_0x34bb22[_0xa2de('0x37')];if(!_0x315c24['query'][_0xa2de('0x38')](_0xa2de('0x39'))){_0x4a9936[_0xa2de('0x1e')]=qs[_0xa2de('0x1e')](_0x315c24[_0xa2de('0x31')]['limit']);_0x4a9936[_0xa2de('0x1c')]=qs[_0xa2de('0x1c')](_0x315c24['query'][_0xa2de('0x1c')]);}return _0x169631[_0xa2de('0x55')](_0x4a9936);}})[_0xa2de('0x25')](function(_0x3bac97){if(_0x3bac97){return _0x3bac97?{'count':_0x419ac5,'rows':_0x3bac97}:null;}})[_0xa2de('0x25')](respondWithResult(_0x39032f,null))[_0xa2de('0x4a')](handleError(_0x39032f,null));};exports['addIntervals']=function(_0x55c3a5,_0x100eed,_0x33d37d){return db[_0xa2de('0x41')][_0xa2de('0x56')]({'where':{'id':_0x55c3a5[_0xa2de('0x47')]['id']}})['then'](handleEntityNotFound(_0x100eed,null))[_0xa2de('0x25')](function(_0x240fee){if(_0x240fee){return db['sequelize']['transaction'](function(_0xa59783){return db[_0xa2de('0x41')][_0xa2de('0x26')]({'where':{'IntervalId':_0x55c3a5[_0xa2de('0x47')]['id']},'transaction':_0xa59783})[_0xa2de('0x25')](function(_0x2d03ad){var _0x8c1a52=_[_0xa2de('0x2d')](_0x55c3a5[_0xa2de('0x4c')],function(_0x301576){delete _0x301576['id'];_0x301576[_0xa2de('0x54')]=_0x55c3a5['params']['id'];return _0x301576;});return db[_0xa2de('0x41')]['bulkCreate'](_0x8c1a52,{'transaction':_0xa59783});});})[_0xa2de('0x25')](function(){return db[_0xa2de('0x41')]['findAll']({'where':{'IntervalId':_0x55c3a5[_0xa2de('0x47')]['id']}});});}})[_0xa2de('0x25')](respondWithResult(_0x100eed,null))[_0xa2de('0x4a')](handleError(_0x100eed,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 037fdbd..ae2a2c5 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 _0xa391=['tools_intervals','rewrite','util','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa391,0x138));var _0x1a39=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa391[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x1a39('0x0'));var logger=require('../../config/logger')(_0x1a39('0x1'));var moment=require(_0x1a39('0x2'));var BPromise=require(_0x1a39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a39('0x4'));var rimraf=require(_0x1a39('0x5'));var config=require(_0x1a39('0x6'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x177375,_0x4240ce){return _0x177375[_0x1a39('0x7')]('Interval',attributes,{'tableName':_0x1a39('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x472224,_0x45b14d){extensions[_0x1a39('0x9')](_0x177375,_0x472224);},'afterBulkCreate':function(_0x1ecacd,_0x522533,_0x1cb66f){_0x1cb66f();extensions[_0x1a39('0x9')](_0x177375,_0x1ecacd[0x0]);},'afterUpdate':function(_0x411e36,_0x301673){extensions[_0x1a39('0x9')](_0x177375,_0x411e36);},'afterDestroy':function(_0x4d8b99,_0x4ed7db){extensions[_0x1a39('0x9')](_0x177375,_0x4d8b99);}}});}; \ No newline at end of file +var _0xe2df=['rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','api','bluebird','path'];(function(_0x5e17d8,_0x3ef6ac){var _0x59eafb=function(_0x32509c){while(--_0x32509c){_0x5e17d8['push'](_0x5e17d8['shift']());}};_0x59eafb(++_0x3ef6ac);}(_0xe2df,0xec));var _0xfe2d=function(_0x58e206,_0x1b060e){_0x58e206=_0x58e206-0x0;var _0x177395=_0xe2df[_0x58e206];return _0x177395;};'use strict';var _=require(_0xfe2d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfe2d('0x1'));var moment=require('moment');var BPromise=require(_0xfe2d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe2d('0x3'));var rimraf=require(_0xfe2d('0x4'));var config=require('../../config/environment');var attributes=require(_0xfe2d('0x5'));var extensions=require(_0xfe2d('0x6'));module[_0xfe2d('0x7')]=function(_0x2c74a4,_0x3e76ab){return _0x2c74a4[_0xfe2d('0x8')](_0xfe2d('0x9'),attributes,{'tableName':_0xfe2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f69fe,_0x43964c){extensions[_0xfe2d('0xb')](_0x2c74a4,_0x3f69fe);},'afterBulkCreate':function(_0x2e59f4,_0x2f2337,_0x3e76cc){_0x3e76cc();extensions[_0xfe2d('0xb')](_0x2c74a4,_0x2e59f4[0x0]);},'afterUpdate':function(_0x3270ea,_0xa8701b){extensions[_0xfe2d('0xb')](_0x2c74a4,_0x3270ea);},'afterDestroy':function(_0x1f5f2a,_0xd67fc3){extensions[_0xfe2d('0xb')](_0x2c74a4,_0x1f5f2a);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 32cd5b6..ccf2c2d 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(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_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 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(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 bfe4309..7f138df 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0xce675c,_0x1a705b){var _0x6305a0=function(_0x51c8e0){while(--_0x51c8e0){_0xce675c['push'](_0xce675c['shift']());}};_0x6305a0(++_0x1a705b);}(_0x2032,0xd9));var _0x2203=function(_0x4b39c7,_0x50414d){_0x4b39c7=_0x4b39c7-0x0;var _0x27ab59=_0x2032[_0x4b39c7];return _0x27ab59;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0xc26324,_0x4d0908){var _0x3e4341=function(_0x5b76ed){while(--_0x5b76ed){_0xc26324['push'](_0xc26324['shift']());}};_0x3e4341(++_0x4d0908);}(_0x2032,0xd9));var _0x2203=function(_0x226d59,_0x5680ea){_0x226d59=_0x226d59-0x0;var _0x66866c=_0x2032[_0x226d59];return _0x66866c;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index eac7ca1..98c0db8 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 _0x7fd6=['setEncoding','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','socket','remoteAddress','body','bluebird','https','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','issuetype','customfield_11501','fields','customfield_11502','newToken','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7fd6,0x194));var _0x67fd=function(_0xc1143f,_0x277c6a){_0xc1143f=_0xc1143f-0x0;var _0x694b1b=_0x7fd6[_0xc1143f];return _0x694b1b;};'use strict';var BPromise=require(_0x67fd('0x0'));var https=require(_0x67fd('0x1'));var logger=require('../../config/logger')(_0x67fd('0x2'));var USERNAME='support';var PASSWORD=_0x67fd('0x3');function openIssue(_0x546ec1,_0x578581){var _0x28f188={'fields':{'project':{'key':_0x546ec1[_0x67fd('0x4')]||'MOTGUI'},'summary':(_0x546ec1[_0x67fd('0x5')]||_0x67fd('0x6'))+_0x67fd('0x7')+_0x546ec1['ip'],'description':_0x546ec1[_0x67fd('0x8')]||JSON['stringify'](_0x546ec1),'issuetype':{'name':_0x546ec1[_0x67fd('0x9')]||'Bug'}}};_0x28f188['fields']['customfield_11500']=_0x546ec1['email'];_0x28f188['fields'][_0x67fd('0xa')]=_0x546ec1['oldToken'];_0x28f188[_0x67fd('0xb')][_0x67fd('0xc')]=_0x546ec1[_0x67fd('0xd')];_0x28f188[_0x67fd('0xb')][_0x67fd('0xe')]=_0x546ec1['name'];_0x28f188[_0x67fd('0xb')][_0x67fd('0xf')]=_0x546ec1['reason'];_0x28f188[_0x67fd('0xb')][_0x67fd('0x10')]=_0x546ec1['ip'];var _0x1fa280={'host':_0x67fd('0x11'),'port':0x1bb,'path':_0x67fd('0x12'),'method':_0x67fd('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x67fd('0x14'),'Authorization':_0x67fd('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x67fd('0x16')](_0x67fd('0x17'))}};var _0x574ca2=JSON[_0x67fd('0x18')](_0x28f188);var _0x40c320=https[_0x67fd('0x19')](_0x1fa280,function(_0x4bb2cd){_0x4bb2cd[_0x67fd('0x1a')](_0x67fd('0x1b'));var _0x2f0a7f='';_0x4bb2cd['on'](_0x67fd('0x1c'),function(_0xa03c93){_0x2f0a7f+=_0xa03c93;});_0x4bb2cd['on'](_0x67fd('0x1d'),function(){if(_0x578581){return _0x578581[_0x67fd('0x1e')](_0x4bb2cd['statusCode'])[_0x67fd('0x1f')](JSON['parse'](_0x2f0a7f));}});});_0x40c320['on'](_0x67fd('0x20'),function(_0x592834){if(_0x578581){return _0x578581[_0x67fd('0x1e')](0x1f4)[_0x67fd('0x1f')]({'errors':[{'message':_0x67fd('0x21'),'type':_0x67fd('0x22')}]});}});_0x40c320[_0x67fd('0x23')](_0x574ca2);_0x40c320['end']();}exports[_0x67fd('0x24')]=openIssue;exports[_0x67fd('0x25')]=function(_0x1ec0bc,_0x238e57){_0x1ec0bc['body']['ip']=_0x1ec0bc[_0x67fd('0x26')][_0x67fd('0x27')]||_0x1ec0bc['connection']['remoteAddress']||_0x1ec0bc[_0x67fd('0x28')][_0x67fd('0x29')]||_0x1ec0bc['connection'][_0x67fd('0x28')][_0x67fd('0x29')];return openIssue(_0x1ec0bc[_0x67fd('0x2a')],_0x238e57);}; \ No newline at end of file +var _0x07ad=['send','body','headers','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0xe25f69,_0x189354){var _0x4d4507=function(_0x55b1c3){while(--_0x55b1c3){_0xe25f69['push'](_0xe25f69['shift']());}};_0x4d4507(++_0x189354);}(_0x07ad,0x16e));var _0xd07a=function(_0x24a711,_0x2c44e7){_0x24a711=_0x24a711-0x0;var _0x24dad5=_0x07ad[_0x24a711];return _0x24dad5;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xd07a('0x0'))(_0xd07a('0x1'));var USERNAME=_0xd07a('0x2');var PASSWORD=_0xd07a('0x3');function openIssue(_0x5b7a99,_0x56a67b){var _0x332cf6={'fields':{'project':{'key':_0x5b7a99[_0xd07a('0x4')]||_0xd07a('0x5')},'summary':(_0x5b7a99['summary']||_0xd07a('0x6'))+_0xd07a('0x7')+_0x5b7a99['ip'],'description':_0x5b7a99['description']||JSON[_0xd07a('0x8')](_0x5b7a99),'issuetype':{'name':_0x5b7a99['issuetype']||_0xd07a('0x9')}}};_0x332cf6[_0xd07a('0xa')][_0xd07a('0xb')]=_0x5b7a99[_0xd07a('0xc')];_0x332cf6[_0xd07a('0xa')]['customfield_11501']=_0x5b7a99['oldToken'];_0x332cf6[_0xd07a('0xa')][_0xd07a('0xd')]=_0x5b7a99['newToken'];_0x332cf6[_0xd07a('0xa')][_0xd07a('0xe')]=_0x5b7a99[_0xd07a('0xf')];_0x332cf6[_0xd07a('0xa')][_0xd07a('0x10')]=_0x5b7a99[_0xd07a('0x11')];_0x332cf6['fields'][_0xd07a('0x12')]=_0x5b7a99['ip'];var _0x1c1ae7={'host':_0xd07a('0x13'),'port':0x1bb,'path':_0xd07a('0x14'),'method':_0xd07a('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xd07a('0x16'),'Authorization':_0xd07a('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xd07a('0x18')](_0xd07a('0x19'))}};var _0x342160=JSON['stringify'](_0x332cf6);var _0x17815d=https[_0xd07a('0x1a')](_0x1c1ae7,function(_0x23b686){_0x23b686[_0xd07a('0x1b')](_0xd07a('0x1c'));var _0x4ca058='';_0x23b686['on'](_0xd07a('0x1d'),function(_0x99ea5c){_0x4ca058+=_0x99ea5c;});_0x23b686['on'](_0xd07a('0x1e'),function(){if(_0x56a67b){return _0x56a67b[_0xd07a('0x1f')](_0x23b686[_0xd07a('0x20')])['json'](JSON[_0xd07a('0x21')](_0x4ca058));}});});_0x17815d['on'](_0xd07a('0x22'),function(_0x801057){if(_0x56a67b){return _0x56a67b[_0xd07a('0x1f')](0x1f4)['json']({'errors':[{'message':_0xd07a('0x23'),'type':_0xd07a('0x24')}]});}});_0x17815d[_0xd07a('0x25')](_0x342160);_0x17815d[_0xd07a('0x1e')]();}exports[_0xd07a('0x26')]=openIssue;exports[_0xd07a('0x27')]=function(_0xfe5274,_0x30a476){_0xfe5274[_0xd07a('0x28')]['ip']=_0xfe5274[_0xd07a('0x29')]['x-forwarded-for']||_0xfe5274[_0xd07a('0x2a')][_0xd07a('0x2b')]||_0xfe5274[_0xd07a('0x2c')][_0xd07a('0x2b')]||_0xfe5274[_0xd07a('0x2a')][_0xd07a('0x2c')]['remoteAddress'];return openIssue(_0xfe5274[_0xd07a('0x28')],_0x30a476);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4509b3f..f92c546 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 _0x0a9a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','util','connect-timeout','express'];(function(_0x409f30,_0xec568a){var _0x449122=function(_0xebbfa6){while(--_0xebbfa6){_0x409f30['push'](_0x409f30['shift']());}};_0x449122(++_0xec568a);}(_0x0a9a,0x183));var _0xa0a9=function(_0xee6158,_0x2769b4){_0xee6158=_0xee6158-0x0;var _0x3a42e4=_0x0a9a[_0xee6158];return _0x3a42e4;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/describe',auth[_0xa0a9('0x8')](),controller['describe']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xc')]);router['put']('/:id',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['delete'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x2750,0x13b));var _0x0275=function(_0x3185d8,_0x3b2628){_0x3185d8=_0x3185d8-0x0;var _0x300a18=_0x2750[_0x3185d8];return _0x300a18;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3fa3ca3..1e697fe 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x48cf38,_0x2f814f){_0x48cf38=_0x48cf38-0x0;var _0x526061=_0x7a54[_0x48cf38];return _0x526061;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x3e5d47,_0x476583){_0x3e5d47=_0x3e5d47-0x0;var _0x1ef25c=_0x7a54[_0x3e5d47];return _0x1ef25c;};'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 dff4aaa..9641a5b 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 _0x8a8b=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x8a8b,0xae));var _0xb8a8=function(_0x508233,_0x4bbda4){_0x508233=_0x508233-0x0;var _0x2b60e3=_0x8a8b[_0x508233];return _0x2b60e3;};'use strict';var emlformat=require(_0xb8a8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a8('0x1'));var rp=require(_0xb8a8('0x2'));var moment=require('moment');var BPromise=require(_0xb8a8('0x3'));var Mustache=require('mustache');var util=require(_0xb8a8('0x4'));var path=require('path');var sox=require(_0xb8a8('0x5'));var csv=require(_0xb8a8('0x6'));var ejs=require(_0xb8a8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8a8('0x8'));var squel=require('squel');var crypto=require(_0xb8a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb8a8('0xa'));var toCsv=require(_0xb8a8('0x6'));var querystring=require(_0xb8a8('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8a8('0xc'));var authService=require(_0xb8a8('0xd'));var qs=require(_0xb8a8('0xe'));var as=require(_0xb8a8('0xf'));var hardwareService=require(_0xb8a8('0x10'));var logger=require(_0xb8a8('0x11'))(_0xb8a8('0x12'));var utils=require(_0xb8a8('0x13'));var config=require(_0xb8a8('0x14'));var licenseUtil=require(_0xb8a8('0x15'));var db=require(_0xb8a8('0x16'))['db'];function respondWithStatusCode(_0x3ba314,_0x6e85aa){_0x6e85aa=_0x6e85aa||0xcc;return function(_0x5278f8){if(_0x5278f8){return _0x3ba314[_0xb8a8('0x17')](_0x6e85aa);}return _0x3ba314[_0xb8a8('0x18')](_0x6e85aa)[_0xb8a8('0x19')]();};}function respondWithResult(_0xad6499,_0x42fb99){_0x42fb99=_0x42fb99||0xc8;return function(_0xf3750e){if(_0xf3750e){return _0xad6499[_0xb8a8('0x18')](_0x42fb99)[_0xb8a8('0x1a')](_0xf3750e);}};}function respondWithFilteredResult(_0x22e0ac,_0x3d96dc){return function(_0x3ca02e){if(_0x3ca02e){var _0x4f6cd0=typeof _0x3d96dc[_0xb8a8('0x1b')]==='undefined'&&typeof _0x3d96dc[_0xb8a8('0x1c')]===_0xb8a8('0x1d');var _0x412041=_0x3ca02e[_0xb8a8('0x1e')];var _0x121be4=_0x4f6cd0?0x0:_0x3d96dc[_0xb8a8('0x1b')];var _0x1d0898=_0x4f6cd0?_0x3ca02e[_0xb8a8('0x1e')]:_0x3d96dc['offset']+_0x3d96dc['limit'];var _0x306c20;if(_0x1d0898>=_0x412041){_0x1d0898=_0x412041;_0x306c20=0xc8;}else{_0x306c20=0xce;}_0x22e0ac['status'](_0x306c20);return _0x22e0ac['set']('Content-Range',_0x121be4+'-'+_0x1d0898+'/'+_0x412041)[_0xb8a8('0x1a')](_0x3ca02e);}return null;};}function patchUpdates(_0x44cdee){return function(_0x421b58){try{jsonpatch[_0xb8a8('0x1f')](_0x421b58,_0x44cdee,!![]);}catch(_0x380fcb){return BPromise[_0xb8a8('0x20')](_0x380fcb);}return _0x421b58['save']();};}function saveUpdates(_0x17c2b8,_0x9ca4b){return function(_0x1a3ff2){if(_0x1a3ff2){return _0x1a3ff2[_0xb8a8('0x21')](_0x17c2b8)['then'](function(_0x404ca5){return _0x404ca5;});}return null;};}function removeEntity(_0x55c6aa,_0x32aba6){return function(_0x4bc82a){if(_0x4bc82a){return _0x4bc82a[_0xb8a8('0x22')]()['then'](function(){_0x55c6aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dadd6,_0x2dfad6){return function(_0xd25b42){if(!_0xd25b42){_0x5dadd6[_0xb8a8('0x17')](0x194);}return _0xd25b42;};}function handleError(_0x1672ba,_0x41b86d){_0x41b86d=_0x41b86d||0x1f4;return function(_0x4b6c93){logger[_0xb8a8('0x23')](_0x4b6c93[_0xb8a8('0x24')]);if(_0x4b6c93[_0xb8a8('0x25')]){delete _0x4b6c93[_0xb8a8('0x25')];}_0x1672ba[_0xb8a8('0x18')](_0x41b86d)['send'](_0x4b6c93);};}exports[_0xb8a8('0x26')]=function(_0x118f2d,_0xe1772e){var _0x1e7403={},_0x47464e={},_0x543e81={'count':0x0,'rows':[]};var _0x4aec01=_[_0xb8a8('0x27')](db[_0xb8a8('0x28')][_0xb8a8('0x29')],function(_0x3c2bea){return{'name':_0x3c2bea[_0xb8a8('0x2a')],'type':_0x3c2bea[_0xb8a8('0x2b')][_0xb8a8('0x2c')]};});_0x47464e[_0xb8a8('0x2d')]=_[_0xb8a8('0x27')](_0x4aec01,_0xb8a8('0x25'));_0x47464e['query']=_['keys'](_0x118f2d[_0xb8a8('0x2e')]);_0x47464e[_0xb8a8('0x2f')]=_[_0xb8a8('0x30')](_0x47464e['model'],_0x47464e['query']);_0x1e7403['attributes']=_['intersection'](_0x47464e['model'],qs[_0xb8a8('0x31')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x31')]));_0x1e7403['attributes']=_0x1e7403[_0xb8a8('0x32')][_0xb8a8('0x33')]?_0x1e7403[_0xb8a8('0x32')]:_0x47464e[_0xb8a8('0x2d')];if(!_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x34')]('nolimit')){_0x1e7403[_0xb8a8('0x1c')]=qs[_0xb8a8('0x1c')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x1c')]);_0x1e7403[_0xb8a8('0x1b')]=qs[_0xb8a8('0x1b')](_0x118f2d['query']['offset']);}_0x1e7403[_0xb8a8('0x35')]=qs[_0xb8a8('0x36')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x36')]);_0x1e7403[_0xb8a8('0x37')]=qs[_0xb8a8('0x2f')](_[_0xb8a8('0x38')](_0x118f2d['query'],_0x47464e[_0xb8a8('0x2f')]),_0x4aec01);if(_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x39')]){_0x1e7403[_0xb8a8('0x37')]=_[_0xb8a8('0x3a')](_0x1e7403[_0xb8a8('0x37')],{'$or':_[_0xb8a8('0x27')](_0x4aec01,function(_0x3901c8){if(_0x3901c8[_0xb8a8('0x2b')]!==_0xb8a8('0x3b')){var _0x27b287={};_0x27b287[_0x3901c8[_0xb8a8('0x25')]]={'$like':'%'+_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x39')]+'%'};return _0x27b287;}})});}_0x1e7403=_['merge']({},_0x1e7403,_0x118f2d[_0xb8a8('0x3c')]);var _0x605e15={'where':_0x1e7403[_0xb8a8('0x37')]};return db[_0xb8a8('0x28')][_0xb8a8('0x1e')](_0x605e15)[_0xb8a8('0x3d')](function(_0x3d011f){_0x543e81[_0xb8a8('0x1e')]=_0x3d011f;if(_0x118f2d['query'][_0xb8a8('0x3e')]){_0x1e7403[_0xb8a8('0x3f')]=[{'all':!![]}];}return db[_0xb8a8('0x28')][_0xb8a8('0x40')](_0x1e7403);})[_0xb8a8('0x3d')](function(_0x4eec73){_0x543e81[_0xb8a8('0x41')]=_0x4eec73;return _0x543e81;})[_0xb8a8('0x3d')](respondWithFilteredResult(_0xe1772e,_0x1e7403))['catch'](handleError(_0xe1772e,null));};exports[_0xb8a8('0x42')]=function(_0x2bfc77,_0x36c8e4){var _0x4d0f99={'raw':!![],'where':{'id':_0x2bfc77[_0xb8a8('0x43')]['id']}},_0x3590ac={};_0x3590ac[_0xb8a8('0x2d')]=_[_0xb8a8('0x44')](db['JscriptyAnswerReport'][_0xb8a8('0x29')]);_0x3590ac['query']=_[_0xb8a8('0x44')](_0x2bfc77['query']);_0x3590ac[_0xb8a8('0x2f')]=_[_0xb8a8('0x30')](_0x3590ac[_0xb8a8('0x2d')],_0x3590ac[_0xb8a8('0x2e')]);_0x4d0f99[_0xb8a8('0x32')]=_[_0xb8a8('0x30')](_0x3590ac[_0xb8a8('0x2d')],qs[_0xb8a8('0x31')](_0x2bfc77[_0xb8a8('0x2e')][_0xb8a8('0x31')]));_0x4d0f99[_0xb8a8('0x32')]=_0x4d0f99[_0xb8a8('0x32')][_0xb8a8('0x33')]?_0x4d0f99[_0xb8a8('0x32')]:_0x3590ac['model'];if(_0x2bfc77[_0xb8a8('0x2e')]['includeAll']){_0x4d0f99[_0xb8a8('0x3f')]=[{'all':!![]}];}_0x4d0f99=_[_0xb8a8('0x3a')]({},_0x4d0f99,_0x2bfc77[_0xb8a8('0x3c')]);return db[_0xb8a8('0x28')][_0xb8a8('0x45')](_0x4d0f99)[_0xb8a8('0x3d')](handleEntityNotFound(_0x36c8e4,null))[_0xb8a8('0x3d')](respondWithResult(_0x36c8e4,null))['catch'](handleError(_0x36c8e4,null));};exports[_0xb8a8('0x46')]=function(_0x4175e1,_0x3ca626){return db['JscriptyAnswerReport'][_0xb8a8('0x46')](_0x4175e1[_0xb8a8('0x47')],{})['then'](respondWithResult(_0x3ca626,0xc9))['catch'](handleError(_0x3ca626,null));};exports[_0xb8a8('0x21')]=function(_0x45e3d3,_0x2b6464){if(_0x45e3d3['body']['id']){delete _0x45e3d3[_0xb8a8('0x47')]['id'];}return db[_0xb8a8('0x28')][_0xb8a8('0x45')]({'where':{'id':_0x45e3d3[_0xb8a8('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b6464,null))[_0xb8a8('0x3d')](saveUpdates(_0x45e3d3[_0xb8a8('0x47')],null))[_0xb8a8('0x3d')](respondWithResult(_0x2b6464,null))[_0xb8a8('0x48')](handleError(_0x2b6464,null));};exports['destroy']=function(_0xa46a18,_0x32f688){return db[_0xb8a8('0x28')][_0xb8a8('0x45')]({'where':{'id':_0xa46a18[_0xb8a8('0x43')]['id']}})[_0xb8a8('0x3d')](handleEntityNotFound(_0x32f688,null))[_0xb8a8('0x3d')](removeEntity(_0x32f688,null))['catch'](handleError(_0x32f688,null));};exports['describe']=function(_0x823539,_0x2a7c05){return db[_0xb8a8('0x28')][_0xb8a8('0x49')]()['then'](respondWithResult(_0x2a7c05,null))['catch'](handleError(_0x2a7c05,null));}; \ No newline at end of file +var _0xf96b=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key'];(function(_0x388eea,_0x340518){var _0x4a175b=function(_0x595f94){while(--_0x595f94){_0x388eea['push'](_0x388eea['shift']());}};_0x4a175b(++_0x340518);}(_0xf96b,0x109));var _0xbf96=function(_0x314cfb,_0x36d310){_0x314cfb=_0x314cfb-0x0;var _0x36781f=_0xf96b[_0x314cfb];return _0x36781f;};'use strict';var emlformat=require(_0xbf96('0x0'));var rimraf=require(_0xbf96('0x1'));var zipdir=require(_0xbf96('0x2'));var jsonpatch=require(_0xbf96('0x3'));var rp=require(_0xbf96('0x4'));var moment=require(_0xbf96('0x5'));var BPromise=require(_0xbf96('0x6'));var Mustache=require(_0xbf96('0x7'));var util=require(_0xbf96('0x8'));var path=require(_0xbf96('0x9'));var sox=require(_0xbf96('0xa'));var csv=require(_0xbf96('0xb'));var ejs=require(_0xbf96('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf96('0xd'));var squel=require(_0xbf96('0xe'));var crypto=require(_0xbf96('0xf'));var jsforce=require(_0xbf96('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbf96('0xb'));var querystring=require(_0xbf96('0x11'));var Papa=require(_0xbf96('0x12'));var Redis=require(_0xbf96('0x13'));var authService=require(_0xbf96('0x14'));var qs=require(_0xbf96('0x15'));var as=require(_0xbf96('0x16'));var hardwareService=require(_0xbf96('0x17'));var logger=require('../../config/logger')(_0xbf96('0x18'));var utils=require(_0xbf96('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xbf96('0x1a'));var db=require(_0xbf96('0x1b'))['db'];function respondWithStatusCode(_0x17115d,_0x48a709){_0x48a709=_0x48a709||0xcc;return function(_0xafd96c){if(_0xafd96c){return _0x17115d[_0xbf96('0x1c')](_0x48a709);}return _0x17115d[_0xbf96('0x1d')](_0x48a709)[_0xbf96('0x1e')]();};}function respondWithResult(_0x424819,_0x3e7a6b){_0x3e7a6b=_0x3e7a6b||0xc8;return function(_0x59c141){if(_0x59c141){return _0x424819[_0xbf96('0x1d')](_0x3e7a6b)[_0xbf96('0x1f')](_0x59c141);}};}function respondWithFilteredResult(_0x1f1814,_0x2dc5c4){return function(_0x38205a){if(_0x38205a){var _0xbb399b=typeof _0x2dc5c4[_0xbf96('0x20')]==='undefined'&&typeof _0x2dc5c4[_0xbf96('0x21')]==='undefined';var _0x41254f=_0x38205a[_0xbf96('0x22')];var _0x568425=_0xbb399b?0x0:_0x2dc5c4[_0xbf96('0x20')];var _0x64b2f9=_0xbb399b?_0x38205a['count']:_0x2dc5c4[_0xbf96('0x20')]+_0x2dc5c4[_0xbf96('0x21')];var _0x2bef74;if(_0x64b2f9>=_0x41254f){_0x64b2f9=_0x41254f;_0x2bef74=0xc8;}else{_0x2bef74=0xce;}_0x1f1814[_0xbf96('0x1d')](_0x2bef74);return _0x1f1814[_0xbf96('0x23')](_0xbf96('0x24'),_0x568425+'-'+_0x64b2f9+'/'+_0x41254f)[_0xbf96('0x1f')](_0x38205a);}return null;};}function patchUpdates(_0x5450e4){return function(_0x38cc22){try{jsonpatch['apply'](_0x38cc22,_0x5450e4,!![]);}catch(_0xa44474){return BPromise[_0xbf96('0x25')](_0xa44474);}return _0x38cc22[_0xbf96('0x26')]();};}function saveUpdates(_0x4c65ae,_0x21cf3c){return function(_0x55025c){if(_0x55025c){return _0x55025c[_0xbf96('0x27')](_0x4c65ae)[_0xbf96('0x28')](function(_0xdd84d9){return _0xdd84d9;});}return null;};}function removeEntity(_0x4e511b,_0x1c92f9){return function(_0xf132af){if(_0xf132af){return _0xf132af['destroy']()['then'](function(){_0x4e511b[_0xbf96('0x1d')](0xcc)[_0xbf96('0x1e')]();});}};}function handleEntityNotFound(_0x363379,_0x56d265){return function(_0x527558){if(!_0x527558){_0x363379['sendStatus'](0x194);}return _0x527558;};}function handleError(_0x57c5cd,_0x8c3967){_0x8c3967=_0x8c3967||0x1f4;return function(_0x30f345){logger[_0xbf96('0x29')](_0x30f345[_0xbf96('0x2a')]);if(_0x30f345['name']){delete _0x30f345[_0xbf96('0x2b')];}_0x57c5cd[_0xbf96('0x1d')](_0x8c3967)[_0xbf96('0x2c')](_0x30f345);};}exports[_0xbf96('0x2d')]=function(_0x5e99b3,_0x59edc6){var _0x16a659={},_0x1366e6={},_0x4138ef={'count':0x0,'rows':[]};var _0xb248da=_[_0xbf96('0x2e')](db[_0xbf96('0x2f')][_0xbf96('0x30')],function(_0x2764e0){return{'name':_0x2764e0['fieldName'],'type':_0x2764e0[_0xbf96('0x31')][_0xbf96('0x32')]};});_0x1366e6[_0xbf96('0x33')]=_['map'](_0xb248da,'name');_0x1366e6[_0xbf96('0x34')]=_['keys'](_0x5e99b3[_0xbf96('0x34')]);_0x1366e6[_0xbf96('0x35')]=_[_0xbf96('0x36')](_0x1366e6[_0xbf96('0x33')],_0x1366e6[_0xbf96('0x34')]);_0x16a659[_0xbf96('0x37')]=_[_0xbf96('0x36')](_0x1366e6[_0xbf96('0x33')],qs[_0xbf96('0x38')](_0x5e99b3['query'][_0xbf96('0x38')]));_0x16a659['attributes']=_0x16a659[_0xbf96('0x37')][_0xbf96('0x39')]?_0x16a659[_0xbf96('0x37')]:_0x1366e6['model'];if(!_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x3a')](_0xbf96('0x3b'))){_0x16a659[_0xbf96('0x21')]=qs[_0xbf96('0x21')](_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x21')]);_0x16a659[_0xbf96('0x20')]=qs['offset'](_0x5e99b3[_0xbf96('0x34')]['offset']);}_0x16a659[_0xbf96('0x3c')]=qs[_0xbf96('0x3d')](_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x3d')]);_0x16a659[_0xbf96('0x3e')]=qs['filters'](_[_0xbf96('0x3f')](_0x5e99b3['query'],_0x1366e6[_0xbf96('0x35')]),_0xb248da);if(_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x40')]){_0x16a659[_0xbf96('0x3e')]=_[_0xbf96('0x41')](_0x16a659[_0xbf96('0x3e')],{'$or':_['map'](_0xb248da,function(_0x1ef8cd){if(_0x1ef8cd['type']!==_0xbf96('0x42')){var _0x3db5f7={};_0x3db5f7[_0x1ef8cd[_0xbf96('0x2b')]]={'$like':'%'+_0x5e99b3['query'][_0xbf96('0x40')]+'%'};return _0x3db5f7;}})});}_0x16a659=_[_0xbf96('0x41')]({},_0x16a659,_0x5e99b3[_0xbf96('0x43')]);var _0x4caef2={'where':_0x16a659[_0xbf96('0x3e')]};return db[_0xbf96('0x2f')][_0xbf96('0x22')](_0x4caef2)[_0xbf96('0x28')](function(_0x17f345){_0x4138ef[_0xbf96('0x22')]=_0x17f345;if(_0x5e99b3[_0xbf96('0x34')]['includeAll']){_0x16a659[_0xbf96('0x44')]=[{'all':!![]}];}return db[_0xbf96('0x2f')]['findAll'](_0x16a659);})[_0xbf96('0x28')](function(_0x3cfb3c){_0x4138ef[_0xbf96('0x45')]=_0x3cfb3c;return _0x4138ef;})[_0xbf96('0x28')](respondWithFilteredResult(_0x59edc6,_0x16a659))['catch'](handleError(_0x59edc6,null));};exports[_0xbf96('0x46')]=function(_0x1b6cfd,_0x1a39d1){var _0x2b565f={'raw':!![],'where':{'id':_0x1b6cfd[_0xbf96('0x47')]['id']}},_0x27b78d={};_0x27b78d['model']=_['keys'](db[_0xbf96('0x2f')][_0xbf96('0x30')]);_0x27b78d[_0xbf96('0x34')]=_['keys'](_0x1b6cfd[_0xbf96('0x34')]);_0x27b78d[_0xbf96('0x35')]=_[_0xbf96('0x36')](_0x27b78d[_0xbf96('0x33')],_0x27b78d[_0xbf96('0x34')]);_0x2b565f[_0xbf96('0x37')]=_[_0xbf96('0x36')](_0x27b78d[_0xbf96('0x33')],qs[_0xbf96('0x38')](_0x1b6cfd['query'][_0xbf96('0x38')]));_0x2b565f['attributes']=_0x2b565f['attributes'][_0xbf96('0x39')]?_0x2b565f['attributes']:_0x27b78d[_0xbf96('0x33')];if(_0x1b6cfd['query'][_0xbf96('0x48')]){_0x2b565f[_0xbf96('0x44')]=[{'all':!![]}];}_0x2b565f=_[_0xbf96('0x41')]({},_0x2b565f,_0x1b6cfd['options']);return db[_0xbf96('0x2f')][_0xbf96('0x49')](_0x2b565f)['then'](handleEntityNotFound(_0x1a39d1,null))[_0xbf96('0x28')](respondWithResult(_0x1a39d1,null))['catch'](handleError(_0x1a39d1,null));};exports[_0xbf96('0x4a')]=function(_0xa852de,_0x1bb569){return db[_0xbf96('0x2f')][_0xbf96('0x4a')](_0xa852de[_0xbf96('0x4b')],{})['then'](respondWithResult(_0x1bb569,0xc9))[_0xbf96('0x4c')](handleError(_0x1bb569,null));};exports[_0xbf96('0x27')]=function(_0x86135f,_0x4bb10e){if(_0x86135f['body']['id']){delete _0x86135f[_0xbf96('0x4b')]['id'];}return db[_0xbf96('0x2f')][_0xbf96('0x49')]({'where':{'id':_0x86135f[_0xbf96('0x47')]['id']}})[_0xbf96('0x28')](handleEntityNotFound(_0x4bb10e,null))['then'](saveUpdates(_0x86135f[_0xbf96('0x4b')],null))[_0xbf96('0x28')](respondWithResult(_0x4bb10e,null))[_0xbf96('0x4c')](handleError(_0x4bb10e,null));};exports[_0xbf96('0x4d')]=function(_0x5874b7,_0x4f173f){return db[_0xbf96('0x2f')][_0xbf96('0x49')]({'where':{'id':_0x5874b7[_0xbf96('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f173f,null))[_0xbf96('0x28')](removeEntity(_0x4f173f,null))['catch'](handleError(_0x4f173f,null));};exports['describe']=function(_0x45129c,_0x32cca5){return db[_0xbf96('0x2f')][_0xbf96('0x4e')]()[_0xbf96('0x28')](respondWithResult(_0x32cca5,null))['catch'](handleError(_0x32cca5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 62b0a78..e337e6d 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 _0xc31d=['bluebird','define','report_jscripty_answers','../../config/logger','api','moment'];(function(_0x112e63,_0x3591c8){var _0x1721dc=function(_0x526ce1){while(--_0x526ce1){_0x112e63['push'](_0x112e63['shift']());}};_0x1721dc(++_0x3591c8);}(_0xc31d,0x1ef));var _0xdc31=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xc31d[_0x15b399];return _0x199f2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdc31('0x0'))(_0xdc31('0x1'));var moment=require(_0xdc31('0x2'));var BPromise=require(_0xdc31('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x355ef4,_0x4c5813){return _0x355ef4[_0xdc31('0x4')]('JscriptyAnswerReport',attributes,{'tableName':_0xdc31('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcff=['report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfcff,0x1c8));var _0xffcf=function(_0xcc5533,_0x10a942){_0xcc5533=_0xcc5533-0x0;var _0xe11578=_0xfcff[_0xcc5533];return _0xe11578;};'use strict';var _=require(_0xffcf('0x0'));var util=require(_0xffcf('0x1'));var logger=require(_0xffcf('0x2'))(_0xffcf('0x3'));var moment=require(_0xffcf('0x4'));var BPromise=require(_0xffcf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffcf('0x6'));var rimraf=require(_0xffcf('0x7'));var config=require(_0xffcf('0x8'));var attributes=require(_0xffcf('0x9'));module[_0xffcf('0xa')]=function(_0x2b9502,_0x531b97){return _0x2b9502['define'](_0xffcf('0xb'),attributes,{'tableName':_0xffcf('0xc'),'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 b1b6207..6363713 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 _0x9b33=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42638c,_0x3fa74c){var _0x46e295=function(_0x41a3bb){while(--_0x41a3bb){_0x42638c['push'](_0x42638c['shift']());}};_0x46e295(++_0x3fa74c);}(_0x9b33,0x1a5));var _0x39b3=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x9b33[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x39b3('0x0'));var util=require(_0x39b3('0x1'));var moment=require(_0x39b3('0x2'));var BPromise=require(_0x39b3('0x3'));var rs=require(_0x39b3('0x4'));var fs=require('fs');var Redis=require(_0x39b3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x39b3('0x6'))('rpc');var config=require(_0x39b3('0x7'));var jayson=require(_0x39b3('0x8'));var client=jayson[_0x39b3('0x9')][_0x39b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x432f1a,_0x1ca54b,_0x336dbd){return new BPromise(function(_0x3746b1,_0x29e182){return client[_0x39b3('0xb')](_0x432f1a,_0x336dbd)[_0x39b3('0xc')](function(_0x579298){logger[_0x39b3('0xd')](_0x39b3('0xe'),_0x1ca54b,_0x39b3('0xf'));logger[_0x39b3('0x10')](_0x39b3('0x11'),_0x1ca54b,_0x39b3('0xf'),JSON[_0x39b3('0x12')](_0x579298));if(_0x579298['error']){if(_0x579298['error']['code']===0x1f4){logger['error'](_0x39b3('0xe'),_0x1ca54b,_0x579298[_0x39b3('0x13')][_0x39b3('0x14')]);return _0x29e182(_0x579298[_0x39b3('0x13')][_0x39b3('0x14')]);}logger[_0x39b3('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ca54b,_0x579298[_0x39b3('0x13')][_0x39b3('0x14')]);return _0x3746b1(_0x579298[_0x39b3('0x13')][_0x39b3('0x14')]);}else{logger[_0x39b3('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ca54b,_0x39b3('0xf'));_0x3746b1(_0x579298['result']['message']);}})[_0x39b3('0x15')](function(_0xfc6a37){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ca54b,_0xfc6a37);_0x29e182(_0xfc6a37);});});} \ No newline at end of file +var _0x8baf=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptyAnswerReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8baf,0x93));var _0xf8ba=function(_0x4bd4a2,_0x49c924){_0x4bd4a2=_0x4bd4a2-0x0;var _0x45060f=_0x8baf[_0x4bd4a2];return _0x45060f;};'use strict';var _=require(_0xf8ba('0x0'));var util=require(_0xf8ba('0x1'));var moment=require(_0xf8ba('0x2'));var BPromise=require(_0xf8ba('0x3'));var rs=require(_0xf8ba('0x4'));var fs=require('fs');var Redis=require(_0xf8ba('0x5'));var db=require(_0xf8ba('0x6'))['db'];var utils=require(_0xf8ba('0x7'));var logger=require('../../config/logger')(_0xf8ba('0x8'));var config=require(_0xf8ba('0x9'));var jayson=require(_0xf8ba('0xa'));var client=jayson[_0xf8ba('0xb')][_0xf8ba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181bb7,_0x1bedca,_0x3c3995){return new BPromise(function(_0x32b99c,_0x289a4f){return client[_0xf8ba('0xd')](_0x181bb7,_0x3c3995)[_0xf8ba('0xe')](function(_0x4c562c){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1bedca,_0xf8ba('0xf'));logger[_0xf8ba('0x10')](_0xf8ba('0x11'),_0x1bedca,'request\x20sent',JSON[_0xf8ba('0x12')](_0x4c562c));if(_0x4c562c['error']){if(_0x4c562c[_0xf8ba('0x13')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1bedca,_0x4c562c[_0xf8ba('0x13')][_0xf8ba('0x14')]);return _0x289a4f(_0x4c562c[_0xf8ba('0x13')][_0xf8ba('0x14')]);}logger[_0xf8ba('0x13')](_0xf8ba('0x15'),_0x1bedca,_0x4c562c[_0xf8ba('0x13')][_0xf8ba('0x14')]);return _0x32b99c(_0x4c562c['error'][_0xf8ba('0x14')]);}else{logger[_0xf8ba('0x16')](_0xf8ba('0x15'),_0x1bedca,_0xf8ba('0xf'));_0x32b99c(_0x4c562c[_0xf8ba('0x17')][_0xf8ba('0x14')]);}})[_0xf8ba('0x18')](function(_0xd1c3a3){logger[_0xf8ba('0x13')](_0xf8ba('0x15'),_0x1bedca,_0xd1c3a3);_0x289a4f(_0xd1c3a3);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ca9a8be..c5e0bc6 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 _0x419a=['clone','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','getSessions','getAnswers','30s','post','create','/:id/clone'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x419a,0xd5));var _0xa419=function(_0x146a25,_0x587d8c){_0x146a25=_0x146a25-0x0;var _0x493724=_0x419a[_0x146a25];return _0x493724;};'use strict';var multer=require('multer');var util=require(_0xa419('0x0'));var path=require(_0xa419('0x1'));var timeout=require(_0xa419('0x2'));var express=require(_0xa419('0x3'));var router=express[_0xa419('0x4')]();var fs_extra=require(_0xa419('0x5'));var auth=require(_0xa419('0x6'));var interaction=require(_0xa419('0x7'));var config=require(_0xa419('0x8'));var controller=require(_0xa419('0x9'));router[_0xa419('0xa')]('/',auth['isAuthenticated'](),controller[_0xa419('0xb')]);router[_0xa419('0xa')](_0xa419('0xc'),auth[_0xa419('0xd')](),controller[_0xa419('0xe')]);router['get']('/:id/sessions',auth[_0xa419('0xd')](),controller[_0xa419('0xf')]);router['get']('/:id/answers',auth[_0xa419('0xd')](),controller[_0xa419('0x10')]);router[_0xa419('0xa')]('/:id/summary',auth[_0xa419('0xd')](),timeout(_0xa419('0x11')),controller['getSummary']);router[_0xa419('0x12')]('/',auth['isAuthenticated'](),controller[_0xa419('0x13')]);router[_0xa419('0x12')](_0xa419('0x14'),auth[_0xa419('0xd')](),controller[_0xa419('0x15')]);router[_0xa419('0x16')](_0xa419('0xc'),auth[_0xa419('0xd')](),controller[_0xa419('0x17')]);router[_0xa419('0x18')](_0xa419('0xc'),auth[_0xa419('0xd')](),controller[_0xa419('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6a9f=['getSessions','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','index','get','/:id','isAuthenticated','show','/:id/sessions'];(function(_0x2da1c5,_0x5710ac){var _0x30d535=function(_0x3da9a0){while(--_0x3da9a0){_0x2da1c5['push'](_0x2da1c5['shift']());}};_0x30d535(++_0x5710ac);}(_0x6a9f,0x151));var _0xf6a9=function(_0x30a053,_0x337478){_0x30a053=_0x30a053-0x0;var _0x2cef38=_0x6a9f[_0x30a053];return _0x2cef38;};'use strict';var multer=require(_0xf6a9('0x0'));var util=require('util');var path=require(_0xf6a9('0x1'));var timeout=require(_0xf6a9('0x2'));var express=require(_0xf6a9('0x3'));var router=express['Router']();var fs_extra=require(_0xf6a9('0x4'));var auth=require(_0xf6a9('0x5'));var interaction=require(_0xf6a9('0x6'));var config=require('../../config/environment');var controller=require(_0xf6a9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf6a9('0x8')]);router[_0xf6a9('0x9')](_0xf6a9('0xa'),auth[_0xf6a9('0xb')](),controller[_0xf6a9('0xc')]);router[_0xf6a9('0x9')](_0xf6a9('0xd'),auth[_0xf6a9('0xb')](),controller[_0xf6a9('0xe')]);router[_0xf6a9('0x9')]('/:id/answers',auth[_0xf6a9('0xb')](),controller[_0xf6a9('0xf')]);router[_0xf6a9('0x9')](_0xf6a9('0x10'),auth['isAuthenticated'](),timeout(_0xf6a9('0x11')),controller['getSummary']);router[_0xf6a9('0x12')]('/',auth['isAuthenticated'](),controller[_0xf6a9('0x13')]);router[_0xf6a9('0x12')](_0xf6a9('0x14'),auth[_0xf6a9('0xb')](),controller[_0xf6a9('0x15')]);router[_0xf6a9('0x16')](_0xf6a9('0xa'),auth[_0xf6a9('0xb')](),controller[_0xf6a9('0x17')]);router[_0xf6a9('0x18')](_0xf6a9('0xa'),auth[_0xf6a9('0xb')](),controller[_0xf6a9('0x19')]);module[_0xf6a9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2a88b25..515c8ba 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 _0x5760=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x2077a3,_0x276483){var _0x29e4ad=function(_0x5e2ffd){while(--_0x5e2ffd){_0x2077a3['push'](_0x2077a3['shift']());}};_0x29e4ad(++_0x276483);}(_0x5760,0x164));var _0x0576=function(_0x252884,_0x117ddf){_0x252884=_0x252884-0x0;var _0x4de0e6=_0x5760[_0x252884];return _0x4de0e6;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0576('0x0'));var util=require('util');module[_0x0576('0x1')]={'name':{'type':Sequelize[_0x0576('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0576('0x3')](_0x0576('0x4')),'set':function(_0x9d910b){if(_[_0x0576('0x5')](_0x9d910b)){this[_0x0576('0x6')]('formData',JSON['stringify'](_0x9d910b));}else if(_['isString'](_0x9d910b)){this[_0x0576('0x6')]('formData',_0x9d910b);}else{this[_0x0576('0x6')](_0x0576('0x7'),util[_0x0576('0x8')](_0x0576('0x9'),this[_0x0576('0xa')]('name')||'',this['getDataValue'](_0x0576('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0576('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x2210=['STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','lodash','util','exports'];(function(_0x52fb88,_0x110c72){var _0xd759ec=function(_0x55e3cf){while(--_0x55e3cf){_0x52fb88['push'](_0x52fb88['shift']());}};_0xd759ec(++_0x110c72);}(_0x2210,0x11d));var _0x0221=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2210[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0221('0x0'));var util=require(_0x0221('0x1'));module[_0x0221('0x2')]={'name':{'type':Sequelize[_0x0221('0x3')],'unique':_0x0221('0x4')},'description':{'type':Sequelize[_0x0221('0x3')]},'formData':{'type':Sequelize[_0x0221('0x5')](_0x0221('0x6')),'set':function(_0x22a25d){if(_[_0x0221('0x7')](_0x22a25d)){this[_0x0221('0x8')](_0x0221('0x9'),JSON[_0x0221('0xa')](_0x22a25d));}else if(_[_0x0221('0xb')](_0x22a25d)){this[_0x0221('0x8')](_0x0221('0x9'),_0x22a25d);}else{this['setDataValue']('formData',util[_0x0221('0xc')](_0x0221('0xd'),this[_0x0221('0xe')](_0x0221('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0221('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0221('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index cad88a4..096234f 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 _0xbd20=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','name','index','map','JscriptyProject','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xbd20,0x14a));var _0x0bd2=function(_0x23266e,_0x3647e2){_0x23266e=_0x23266e-0x0;var _0x55c2b6=_0xbd20[_0x23266e];return _0x55c2b6;};'use strict';var emlformat=require(_0x0bd2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd2('0x1'));var rp=require(_0x0bd2('0x2'));var moment=require(_0x0bd2('0x3'));var BPromise=require(_0x0bd2('0x4'));var Mustache=require(_0x0bd2('0x5'));var util=require('util');var path=require(_0x0bd2('0x6'));var sox=require(_0x0bd2('0x7'));var csv=require(_0x0bd2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bd2('0x9'));var _=require(_0x0bd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bd2('0xb'));var deskjs=require(_0x0bd2('0xc'));var toCsv=require(_0x0bd2('0x8'));var querystring=require(_0x0bd2('0xd'));var Papa=require(_0x0bd2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bd2('0xf'));var as=require(_0x0bd2('0x10'));var hardwareService=require(_0x0bd2('0x11'));var logger=require(_0x0bd2('0x12'))(_0x0bd2('0x13'));var utils=require('../../config/utils');var config=require(_0x0bd2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bd2('0x15'))['db'];function respondWithStatusCode(_0x20571b,_0x4c6b99){_0x4c6b99=_0x4c6b99||0xcc;return function(_0x5f0205){if(_0x5f0205){return _0x20571b[_0x0bd2('0x16')](_0x4c6b99);}return _0x20571b[_0x0bd2('0x17')](_0x4c6b99)[_0x0bd2('0x18')]();};}function respondWithResult(_0x2cf837,_0x2abcc8){_0x2abcc8=_0x2abcc8||0xc8;return function(_0x561b0f){if(_0x561b0f){return _0x2cf837['status'](_0x2abcc8)[_0x0bd2('0x19')](_0x561b0f);}};}function respondWithFilteredResult(_0x36d899,_0x5255ec){return function(_0x283f31){if(_0x283f31){var _0xd988bb=typeof _0x5255ec[_0x0bd2('0x1a')]===_0x0bd2('0x1b')&&typeof _0x5255ec[_0x0bd2('0x1c')]===_0x0bd2('0x1b');var _0x36001b=_0x283f31['count'];var _0x56902d=_0xd988bb?0x0:_0x5255ec[_0x0bd2('0x1a')];var _0x5d6cef=_0xd988bb?_0x283f31[_0x0bd2('0x1d')]:_0x5255ec['offset']+_0x5255ec[_0x0bd2('0x1c')];var _0x48e632;if(_0x5d6cef>=_0x36001b){_0x5d6cef=_0x36001b;_0x48e632=0xc8;}else{_0x48e632=0xce;}_0x36d899[_0x0bd2('0x17')](_0x48e632);return _0x36d899['set'](_0x0bd2('0x1e'),_0x56902d+'-'+_0x5d6cef+'/'+_0x36001b)[_0x0bd2('0x19')](_0x283f31);}return null;};}function patchUpdates(_0x3b3c87){return function(_0x4b1a3e){try{jsonpatch[_0x0bd2('0x1f')](_0x4b1a3e,_0x3b3c87,!![]);}catch(_0x21bb2c){return BPromise[_0x0bd2('0x20')](_0x21bb2c);}return _0x4b1a3e[_0x0bd2('0x21')]();};}function saveUpdates(_0xff78ae,_0x5cdac7){return function(_0x36b3c4){if(_0x36b3c4){return _0x36b3c4[_0x0bd2('0x22')](_0xff78ae)[_0x0bd2('0x23')](function(_0x6d2f5e){return _0x6d2f5e;});}return null;};}function removeEntity(_0x277ae9,_0x343a99){return function(_0xe47fb){if(_0xe47fb){return _0xe47fb[_0x0bd2('0x24')]()[_0x0bd2('0x23')](function(){var _0x272d93=_0xe47fb[_0x0bd2('0x25')]({'plain':!![]});var _0x2028af=_0x0bd2('0x26');return db[_0x0bd2('0x27')][_0x0bd2('0x24')]({'where':{'type':_0x2028af,'resourceId':_0x272d93['id']}})[_0x0bd2('0x23')](function(){return _0xe47fb;});})[_0x0bd2('0x23')](function(){_0x277ae9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x361697,_0x33d9e7){return function(_0x3bdefc){if(!_0x3bdefc){_0x361697[_0x0bd2('0x16')](0x194);}return _0x3bdefc;};}function handleError(_0x3b1adf,_0x27ecd3){_0x27ecd3=_0x27ecd3||0x1f4;return function(_0x4d7ba1){logger[_0x0bd2('0x28')](_0x4d7ba1['stack']);if(_0x4d7ba1[_0x0bd2('0x29')]){delete _0x4d7ba1['name'];}_0x3b1adf[_0x0bd2('0x17')](_0x27ecd3)['send'](_0x4d7ba1);};}exports[_0x0bd2('0x2a')]=function(_0x2c7196,_0x5bdbf5){var _0x28d658={},_0x5681a0={},_0x4ebc65={'count':0x0,'rows':[]};var _0xe6b5c0=_[_0x0bd2('0x2b')](db[_0x0bd2('0x2c')]['rawAttributes'],function(_0x1cbcc2){return{'name':_0x1cbcc2[_0x0bd2('0x2d')],'type':_0x1cbcc2['type'][_0x0bd2('0x2e')]};});_0x5681a0[_0x0bd2('0x2f')]=_[_0x0bd2('0x2b')](_0xe6b5c0,'name');_0x5681a0[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x2c7196[_0x0bd2('0x30')]);_0x5681a0[_0x0bd2('0x32')]=_[_0x0bd2('0x33')](_0x5681a0['model'],_0x5681a0[_0x0bd2('0x30')]);_0x28d658['attributes']=_[_0x0bd2('0x33')](_0x5681a0[_0x0bd2('0x2f')],qs[_0x0bd2('0x34')](_0x2c7196[_0x0bd2('0x30')][_0x0bd2('0x34')]));_0x28d658[_0x0bd2('0x35')]=_0x28d658['attributes'][_0x0bd2('0x36')]?_0x28d658[_0x0bd2('0x35')]:_0x5681a0[_0x0bd2('0x2f')];if(!_0x2c7196['query']['hasOwnProperty'](_0x0bd2('0x37'))){_0x28d658[_0x0bd2('0x1c')]=qs[_0x0bd2('0x1c')](_0x2c7196[_0x0bd2('0x30')]['limit']);_0x28d658['offset']=qs[_0x0bd2('0x1a')](_0x2c7196[_0x0bd2('0x30')]['offset']);}_0x28d658[_0x0bd2('0x38')]=qs[_0x0bd2('0x39')](_0x2c7196[_0x0bd2('0x30')][_0x0bd2('0x39')]);_0x28d658[_0x0bd2('0x3a')]=qs[_0x0bd2('0x32')](_['pick'](_0x2c7196[_0x0bd2('0x30')],_0x5681a0[_0x0bd2('0x32')]),_0xe6b5c0);if(_0x2c7196[_0x0bd2('0x30')][_0x0bd2('0x3b')]){_0x28d658[_0x0bd2('0x3a')]=_[_0x0bd2('0x3c')](_0x28d658[_0x0bd2('0x3a')],{'$or':_[_0x0bd2('0x2b')](_0xe6b5c0,function(_0x1b6d7a){if(_0x1b6d7a['type']!==_0x0bd2('0x3d')){var _0x545c53={};_0x545c53[_0x1b6d7a[_0x0bd2('0x29')]]={'$like':'%'+_0x2c7196['query'][_0x0bd2('0x3b')]+'%'};return _0x545c53;}})});}_0x28d658=_[_0x0bd2('0x3c')]({},_0x28d658,_0x2c7196[_0x0bd2('0x3e')]);var _0x5a074a={'where':_0x28d658[_0x0bd2('0x3a')]};return db['JscriptyProject'][_0x0bd2('0x1d')](_0x5a074a)[_0x0bd2('0x23')](function(_0x2db5a9){_0x4ebc65['count']=_0x2db5a9;if(_0x2c7196['query']['includeAll']){_0x28d658[_0x0bd2('0x3f')]=[{'all':!![]}];}return db['JscriptyProject'][_0x0bd2('0x40')](_0x28d658);})[_0x0bd2('0x23')](function(_0x385dec){_0x4ebc65[_0x0bd2('0x41')]=_0x385dec;return _0x4ebc65;})[_0x0bd2('0x23')](respondWithFilteredResult(_0x5bdbf5,_0x28d658))[_0x0bd2('0x42')](handleError(_0x5bdbf5,null));};exports[_0x0bd2('0x43')]=function(_0x4406c9,_0xb7c05b){var _0xd721e2={'raw':![],'where':{'id':_0x4406c9[_0x0bd2('0x44')]['id']}},_0x2f3a7c={};_0x2f3a7c[_0x0bd2('0x2f')]=_[_0x0bd2('0x31')](db[_0x0bd2('0x2c')][_0x0bd2('0x45')]);_0x2f3a7c[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x4406c9[_0x0bd2('0x30')]);_0x2f3a7c[_0x0bd2('0x32')]=_['intersection'](_0x2f3a7c[_0x0bd2('0x2f')],_0x2f3a7c[_0x0bd2('0x30')]);_0xd721e2['attributes']=_['intersection'](_0x2f3a7c['model'],qs[_0x0bd2('0x34')](_0x4406c9[_0x0bd2('0x30')][_0x0bd2('0x34')]));_0xd721e2[_0x0bd2('0x35')]=_0xd721e2[_0x0bd2('0x35')][_0x0bd2('0x36')]?_0xd721e2['attributes']:_0x2f3a7c[_0x0bd2('0x2f')];if(_0x4406c9[_0x0bd2('0x30')][_0x0bd2('0x46')]){_0xd721e2[_0x0bd2('0x3f')]=[{'all':!![]}];}_0xd721e2=_['merge']({},_0xd721e2,_0x4406c9['options']);return db[_0x0bd2('0x2c')][_0x0bd2('0x47')](_0xd721e2)[_0x0bd2('0x23')](handleEntityNotFound(_0xb7c05b,null))['then'](respondWithResult(_0xb7c05b,null))[_0x0bd2('0x42')](handleError(_0xb7c05b,null));};exports[_0x0bd2('0x48')]=function(_0x3eac12,_0x59bbfb){return db[_0x0bd2('0x2c')][_0x0bd2('0x48')](_0x3eac12[_0x0bd2('0x49')],{})[_0x0bd2('0x23')](function(_0x54709c){var _0x5debdd=_0x3eac12[_0x0bd2('0x4a')][_0x0bd2('0x25')]({'plain':!![]});if(!_0x5debdd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5debdd['role']===_0x0bd2('0x4a')){var _0x49c69e=_0x54709c['get']({'plain':!![]});var _0xd9c3e3=_0x0bd2('0x26');return db[_0x0bd2('0x4b')][_0x0bd2('0x47')]({'where':{'name':_0xd9c3e3,'userProfileId':_0x5debdd[_0x0bd2('0x4c')]},'raw':!![]})['then'](function(_0x44d582){if(_0x44d582&&_0x44d582[_0x0bd2('0x4d')]===0x0){return db['UserProfileResource'][_0x0bd2('0x48')]({'name':_0x49c69e[_0x0bd2('0x29')],'resourceId':_0x49c69e['id'],'type':_0x44d582[_0x0bd2('0x29')],'sectionId':_0x44d582['id']},{})[_0x0bd2('0x23')](function(){return _0x54709c;});}else{return _0x54709c;}})[_0x0bd2('0x42')](function(_0x30f9c9){logger['error'](_0x0bd2('0x4e'),_0x30f9c9);throw _0x30f9c9;});}return _0x54709c;})[_0x0bd2('0x23')](respondWithResult(_0x59bbfb,0xc9))[_0x0bd2('0x42')](handleError(_0x59bbfb,null));};exports['clone']=function(_0x3ca4f1,_0x586bf7){var _0x366a08={'where':{'id':_0x3ca4f1['params']['id']}},_0xab3d81={};_0xab3d81[_0x0bd2('0x2f')]=_[_0x0bd2('0x31')](db['JscriptyProject'][_0x0bd2('0x45')]);_0x366a08[_0x0bd2('0x35')]=_['intersection'](_0xab3d81[_0x0bd2('0x2f')],qs['fields'](_0x3ca4f1[_0x0bd2('0x30')][_0x0bd2('0x34')]));_0x366a08[_0x0bd2('0x35')]=_0x366a08[_0x0bd2('0x35')][_0x0bd2('0x36')]?_0x366a08['attributes']:_0xab3d81['model'];if(_0x3ca4f1[_0x0bd2('0x30')][_0x0bd2('0x46')]){_0x366a08[_0x0bd2('0x3f')]=[{'all':!![]}];}_0x366a08=_['merge']({},_0x366a08,_0x3ca4f1[_0x0bd2('0x3e')]);return db['JscriptyProject'][_0x0bd2('0x47')](_0x366a08)['then'](handleEntityNotFound(_0x586bf7,null))[_0x0bd2('0x23')](function(_0x59e226){if(_0x59e226){var _0xee7c7f=_0x59e226[_0x0bd2('0x25')]({'plain':!![]});_0xee7c7f=qs[_0x0bd2('0x4f')](_0xee7c7f,['id',_0x0bd2('0x50'),_0x0bd2('0x51')]);_0x3ca4f1[_0x0bd2('0x49')]=_[_0x0bd2('0x4f')](_0x3ca4f1[_0x0bd2('0x49')],['id',_0x0bd2('0x50'),_0x0bd2('0x51')]);return db[_0x0bd2('0x2c')]['create'](_[_0x0bd2('0x3c')](_0xee7c7f,_0x3ca4f1['body']),{'include':_0x3ca4f1['query'][_0x0bd2('0x46')]?[{'all':!![]}]:undefined})[_0x0bd2('0x23')](function(_0x474b19){var _0x5b6dc8=_0x3ca4f1[_0x0bd2('0x4a')]['get']({'plain':!![]});if(!_0x5b6dc8)throw new Error(_0x0bd2('0x52'));if(_0x5b6dc8['role']===_0x0bd2('0x4a')){var _0x50db93=_0x474b19[_0x0bd2('0x25')]({'plain':!![]});var _0x2224ae=_0x0bd2('0x26');return db[_0x0bd2('0x4b')][_0x0bd2('0x47')]({'where':{'name':_0x2224ae,'userProfileId':_0x5b6dc8[_0x0bd2('0x4c')]},'raw':!![]})[_0x0bd2('0x23')](function(_0x384ec1){if(_0x384ec1&&_0x384ec1[_0x0bd2('0x4d')]===0x0){return db[_0x0bd2('0x27')]['create']({'name':_0x50db93[_0x0bd2('0x29')],'resourceId':_0x50db93['id'],'type':_0x384ec1[_0x0bd2('0x29')],'sectionId':_0x384ec1['id']},{})[_0x0bd2('0x23')](function(){return _0x474b19;});}else{return _0x474b19;}})[_0x0bd2('0x42')](function(_0x4299d3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4299d3);throw _0x4299d3;});}return _0x474b19;});}})[_0x0bd2('0x23')](respondWithResult(_0x586bf7,0xc9))[_0x0bd2('0x42')](handleError(_0x586bf7,null));};exports['update']=function(_0x4bd43e,_0x5f1e99){if(_0x4bd43e['body']['id']){delete _0x4bd43e[_0x0bd2('0x49')]['id'];}return db[_0x0bd2('0x2c')]['find']({'where':{'id':_0x4bd43e[_0x0bd2('0x44')]['id']}})[_0x0bd2('0x23')](handleEntityNotFound(_0x5f1e99,null))[_0x0bd2('0x23')](saveUpdates(_0x4bd43e[_0x0bd2('0x49')],null))[_0x0bd2('0x23')](respondWithResult(_0x5f1e99,null))['catch'](handleError(_0x5f1e99,null));};exports[_0x0bd2('0x24')]=function(_0x499bd,_0x3ebe76){return db[_0x0bd2('0x2c')]['find']({'where':{'id':_0x499bd['params']['id']}})[_0x0bd2('0x23')](handleEntityNotFound(_0x3ebe76,null))['then'](removeEntity(_0x3ebe76,null))['catch'](handleError(_0x3ebe76,null));};exports[_0x0bd2('0x53')]=function(_0x20000e,_0x1653d9,_0x464742){var _0x5280bf={'raw':!![],'where':{}};var _0x7d625c={};var _0x223c0a={'count':0x0,'rows':[]};return db[_0x0bd2('0x2c')][_0x0bd2('0x54')]({'where':{'id':_0x20000e[_0x0bd2('0x44')]['id']}})['then'](handleEntityNotFound(_0x1653d9,null))[_0x0bd2('0x23')](function(_0x2048fc){if(_0x2048fc){_0x7d625c['model']=_[_0x0bd2('0x31')](db[_0x0bd2('0x55')]['rawAttributes']);_0x7d625c[_0x0bd2('0x30')]=_[_0x0bd2('0x31')](_0x20000e[_0x0bd2('0x30')]);_0x7d625c[_0x0bd2('0x32')]=_[_0x0bd2('0x33')](_0x7d625c['model'],_0x7d625c[_0x0bd2('0x30')]);_0x5280bf[_0x0bd2('0x35')]=_[_0x0bd2('0x33')](_0x7d625c[_0x0bd2('0x2f')],qs[_0x0bd2('0x34')](_0x20000e[_0x0bd2('0x30')]['fields']));_0x5280bf[_0x0bd2('0x35')]=_0x5280bf[_0x0bd2('0x35')][_0x0bd2('0x36')]?_0x5280bf['attributes']:_0x7d625c[_0x0bd2('0x2f')];if(!_0x20000e[_0x0bd2('0x30')]['hasOwnProperty'](_0x0bd2('0x37'))){_0x5280bf[_0x0bd2('0x1c')]=qs[_0x0bd2('0x1c')](_0x20000e[_0x0bd2('0x30')]['limit']);_0x5280bf[_0x0bd2('0x1a')]=qs[_0x0bd2('0x1a')](_0x20000e[_0x0bd2('0x30')][_0x0bd2('0x1a')]);}_0x5280bf[_0x0bd2('0x38')]=qs['sort'](_0x20000e['query'][_0x0bd2('0x39')]);_0x5280bf['where']=qs[_0x0bd2('0x32')](_[_0x0bd2('0x56')](_0x20000e['query'],_0x7d625c[_0x0bd2('0x32')]));_0x5280bf[_0x0bd2('0x3a')][_0x0bd2('0x57')]=_0x2048fc['id'];if(_0x20000e[_0x0bd2('0x30')][_0x0bd2('0x3b')]){_0x5280bf[_0x0bd2('0x3a')]=_[_0x0bd2('0x3c')](_0x5280bf['where'],{'$or':_[_0x0bd2('0x2b')](_0x5280bf[_0x0bd2('0x35')],function(_0xf3d5a8){var _0x10b8ed={};_0x10b8ed[_0xf3d5a8]={'$like':'%'+_0x20000e[_0x0bd2('0x30')][_0x0bd2('0x3b')]+'%'};return _0x10b8ed;})});}_0x5280bf=_[_0x0bd2('0x3c')]({},_0x5280bf,_0x20000e[_0x0bd2('0x3e')]);return db[_0x0bd2('0x55')][_0x0bd2('0x1d')]({'where':_0x5280bf[_0x0bd2('0x3a')]})[_0x0bd2('0x23')](function(_0x3cc645){_0x223c0a['count']=_0x3cc645;if(_0x20000e[_0x0bd2('0x30')][_0x0bd2('0x46')]){_0x5280bf[_0x0bd2('0x3f')]=[{'all':!![]}];}return db[_0x0bd2('0x55')][_0x0bd2('0x40')](_0x5280bf);})['then'](function(_0x41d0e9){_0x223c0a[_0x0bd2('0x41')]=_0x41d0e9;return _0x223c0a;});}})[_0x0bd2('0x23')](respondWithFilteredResult(_0x1653d9,_0x5280bf))[_0x0bd2('0x42')](handleError(_0x1653d9,null));};exports[_0x0bd2('0x58')]=function(_0x41e3f0,_0x34911b,_0x32a3db){var _0x3f8886={'raw':!![],'where':{}};var _0x7ae54={};var _0x37e88c={'count':0x0,'rows':[]};return db[_0x0bd2('0x2c')]['findOne']({'where':{'id':_0x41e3f0[_0x0bd2('0x44')]['id']}})['then'](handleEntityNotFound(_0x34911b,null))[_0x0bd2('0x23')](function(_0x53f604){if(_0x53f604){_0x7ae54[_0x0bd2('0x2f')]=_[_0x0bd2('0x31')](db[_0x0bd2('0x59')][_0x0bd2('0x45')]);_0x7ae54[_0x0bd2('0x30')]=_['keys'](_0x41e3f0['query']);_0x7ae54['filters']=_[_0x0bd2('0x33')](_0x7ae54[_0x0bd2('0x2f')],_0x7ae54[_0x0bd2('0x30')]);_0x3f8886[_0x0bd2('0x35')]=_['intersection'](_0x7ae54['model'],qs[_0x0bd2('0x34')](_0x41e3f0[_0x0bd2('0x30')][_0x0bd2('0x34')]));_0x3f8886[_0x0bd2('0x35')]=_0x3f8886[_0x0bd2('0x35')][_0x0bd2('0x36')]?_0x3f8886['attributes']:_0x7ae54[_0x0bd2('0x2f')];if(!_0x41e3f0['query'][_0x0bd2('0x5a')](_0x0bd2('0x37'))){_0x3f8886[_0x0bd2('0x1c')]=qs[_0x0bd2('0x1c')](_0x41e3f0['query'][_0x0bd2('0x1c')]);_0x3f8886[_0x0bd2('0x1a')]=qs[_0x0bd2('0x1a')](_0x41e3f0[_0x0bd2('0x30')]['offset']);}_0x3f8886[_0x0bd2('0x38')]=qs[_0x0bd2('0x39')](_0x41e3f0[_0x0bd2('0x30')][_0x0bd2('0x39')]);_0x3f8886[_0x0bd2('0x3a')]=qs[_0x0bd2('0x32')](_[_0x0bd2('0x56')](_0x41e3f0[_0x0bd2('0x30')],_0x7ae54['filters']));_0x3f8886[_0x0bd2('0x3a')][_0x0bd2('0x57')]=_0x53f604['id'];if(_0x41e3f0['query'][_0x0bd2('0x3b')]){_0x3f8886[_0x0bd2('0x3a')]=_[_0x0bd2('0x3c')](_0x3f8886[_0x0bd2('0x3a')],{'$or':_[_0x0bd2('0x2b')](_0x3f8886['attributes'],function(_0xb28c37){var _0x324981={};_0x324981[_0xb28c37]={'$like':'%'+_0x41e3f0[_0x0bd2('0x30')][_0x0bd2('0x3b')]+'%'};return _0x324981;})});}_0x3f8886=_['merge']({},_0x3f8886,_0x41e3f0[_0x0bd2('0x3e')]);return db[_0x0bd2('0x59')][_0x0bd2('0x1d')]({'where':_0x3f8886[_0x0bd2('0x3a')]})[_0x0bd2('0x23')](function(_0x187b56){_0x37e88c[_0x0bd2('0x1d')]=_0x187b56;if(_0x41e3f0[_0x0bd2('0x30')][_0x0bd2('0x46')]){_0x3f8886[_0x0bd2('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x0bd2('0x40')](_0x3f8886);})[_0x0bd2('0x23')](function(_0x93eeaf){_0x37e88c[_0x0bd2('0x41')]=_0x93eeaf;return _0x37e88c;});}})[_0x0bd2('0x23')](respondWithFilteredResult(_0x34911b,_0x3f8886))['catch'](handleError(_0x34911b,null));};function char(_0x973f4){return _0x0bd2('0x5b')===typeof _0x973f4?String['fromCharCode'][_0x0bd2('0x1f')](null,arguments):_0x973f4;}function needsEncapsulation(_0x9f7d64){return!!_0x9f7d64&&(_0x9f7d64[_0x0bd2('0x5c')]()[_0x0bd2('0x5d')](char(0xd))>=0x0||_0x9f7d64[_0x0bd2('0x5c')]()[_0x0bd2('0x5d')](char(0xa))>=0x0||_0x9f7d64[_0x0bd2('0x5c')]()[_0x0bd2('0x5d')](char(0x2c))>=0x0||_0x9f7d64[_0x0bd2('0x5c')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x536a6b){var _0x5cd209=char(0x22),_0x1016a4='\x5c'+char(0x22),_0x42fa92=_0x536a6b[_0x0bd2('0x5c')]()[_0x0bd2('0x5e')](new RegExp(_0x5cd209,'g'),_0x1016a4);return _0x5cd209+_0x42fa92+_0x5cd209;}exports[_0x0bd2('0x5f')]=function(_0x26dd21,_0x2ba403,_0x13b5ca){var _0x5be856,_0x5dff9b;var _0x4ce59c={'where':{'ProjectId':_0x26dd21[_0x0bd2('0x44')]['id']}};if(_0x26dd21['query']['startTime']){_0x4ce59c['where'][_0x0bd2('0x60')]=JSON[_0x0bd2('0x61')](_0x26dd21['query'][_0x0bd2('0x62')]);}return db[_0x0bd2('0x55')]['findAll'](_0x4ce59c)[_0x0bd2('0x23')](handleEntityNotFound(_0x2ba403,null))[_0x0bd2('0x23')](function(_0x65a1ea){if(_0x65a1ea){_0x5be856=_0x65a1ea;return db[_0x0bd2('0x63')][_0x0bd2('0x40')]({'where':{'SessionId':{'$in':_[_0x0bd2('0x2b')](_0x5be856,'id')},'ProjectId':_0x26dd21['params']['id']},'order':_0x0bd2('0x64')});}})[_0x0bd2('0x23')](handleEntityNotFound(_0x2ba403,null))[_0x0bd2('0x23')](function(_0x153a89){if(_0x153a89){_0x5dff9b=_0x153a89;var _0x3e4e36={};for(var _0x24e9b8=0x0,_0x2857f4=_0x5dff9b[_0x0bd2('0x36')];_0x24e9b8<_0x2857f4;_0x24e9b8++){if(!_0x3e4e36['hasOwnProperty'](_0x5dff9b[_0x24e9b8][_0x0bd2('0x65')])){_0x3e4e36[_0x5dff9b[_0x24e9b8][_0x0bd2('0x65')]]=needsEncapsulation(_0x5dff9b[_0x24e9b8][_0x0bd2('0x66')])?encapsulate(_0x5dff9b[_0x24e9b8][_0x0bd2('0x66')]):_0x5dff9b[_0x24e9b8][_0x0bd2('0x66')];}}var _0x2eb3d6=[],_0x3cf6db={};for(var _0x268a7e=0x0,_0x5114b6=_0x5be856['length'];_0x268a7e<_0x5114b6;_0x268a7e++){_0x3cf6db={'ProjectId':_0x26dd21[_0x0bd2('0x44')]['id'],'SessionId':_0x5be856[_0x268a7e]['id'],'StartTime':moment(_0x5be856[_0x268a7e][_0x0bd2('0x60')])[_0x0bd2('0x67')](_0x0bd2('0x68'))};for(var _0xefdd5d=0x0,_0xc03f5a=_0x5dff9b['length'];_0xefdd5d<_0xc03f5a;_0xefdd5d++){if(_0x5dff9b[_0xefdd5d][_0x0bd2('0x69')]==_0x5be856[_0x268a7e]['id']&&_0x3e4e36[_0x0bd2('0x5a')](_0x5dff9b[_0xefdd5d][_0x0bd2('0x65')])){_0x3cf6db[_0x3e4e36[_0x5dff9b[_0xefdd5d][_0x0bd2('0x65')]]]=_0x5dff9b[_0xefdd5d][_0x0bd2('0x6a')];}}for(var _0x49f982 in _0x3e4e36){if(!_0x3cf6db[_0x0bd2('0x5a')](_0x3e4e36[_0x49f982])){_0x3cf6db[_0x3e4e36[_0x49f982]]=null;}}_0x2eb3d6[_0x0bd2('0x6b')](_0x3cf6db);}return _0x2eb3d6;}})[_0x0bd2('0x23')](function(_0xcb8296){if(!_['isEmpty'](_0xcb8296)){var _0x4d7a9d=toCsv(_0xcb8296);var _0x21570c=Date[_0x0bd2('0x6c')]();fs['writeFileSync'](util[_0x0bd2('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x26dd21[_0x0bd2('0x44')]['id'],_0x21570c),_0x4d7a9d);_0x2ba403[_0x0bd2('0x6d')](_0x0bd2('0x6e'),_0x0bd2('0x6f')+util[_0x0bd2('0x67')](_0x0bd2('0x70'),_0x26dd21[_0x0bd2('0x44')]['id'],_0x21570c));_0x2ba403[_0x0bd2('0x6d')](_0x0bd2('0x71'),'text/csv');return _0x2ba403[_0x0bd2('0x72')](util[_0x0bd2('0x67')](_0x0bd2('0x73'),_0x26dd21[_0x0bd2('0x44')]['id'],_0x21570c));}else{return _0x2ba403[_0x0bd2('0x16')](0xcc);}})['catch'](handleError(_0x2ba403,null));}; \ No newline at end of file +var _0xd0be=['JscriptyProject','findAll','show','params','keys','fields','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','UserProfileSection','update','findOne','ProjectId','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/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','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','get','Projects','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x46342d,_0x31f835){var _0x4470a8=function(_0x466066){while(--_0x466066){_0x46342d['push'](_0x46342d['shift']());}};_0x4470a8(++_0x31f835);}(_0xd0be,0x1a0));var _0xed0b=function(_0x2bc295,_0x34d992){_0x2bc295=_0x2bc295-0x0;var _0x5d4c21=_0xd0be[_0x2bc295];return _0x5d4c21;};'use strict';var emlformat=require(_0xed0b('0x0'));var rimraf=require(_0xed0b('0x1'));var zipdir=require(_0xed0b('0x2'));var jsonpatch=require(_0xed0b('0x3'));var rp=require(_0xed0b('0x4'));var moment=require(_0xed0b('0x5'));var BPromise=require(_0xed0b('0x6'));var Mustache=require(_0xed0b('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xed0b('0x8'));var ejs=require(_0xed0b('0x9'));var fs=require('fs');var fs_extra=require(_0xed0b('0xa'));var _=require(_0xed0b('0xb'));var squel=require(_0xed0b('0xc'));var crypto=require(_0xed0b('0xd'));var jsforce=require(_0xed0b('0xe'));var deskjs=require(_0xed0b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xed0b('0x10'));var Papa=require('papaparse');var Redis=require(_0xed0b('0x11'));var authService=require(_0xed0b('0x12'));var qs=require(_0xed0b('0x13'));var as=require(_0xed0b('0x14'));var hardwareService=require(_0xed0b('0x15'));var logger=require(_0xed0b('0x16'))(_0xed0b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed0b('0x18'));var db=require(_0xed0b('0x19'))['db'];function respondWithStatusCode(_0x5645d3,_0x5a2e10){_0x5a2e10=_0x5a2e10||0xcc;return function(_0x299574){if(_0x299574){return _0x5645d3[_0xed0b('0x1a')](_0x5a2e10);}return _0x5645d3[_0xed0b('0x1b')](_0x5a2e10)[_0xed0b('0x1c')]();};}function respondWithResult(_0x471c25,_0x5afaac){_0x5afaac=_0x5afaac||0xc8;return function(_0x5a15c9){if(_0x5a15c9){return _0x471c25[_0xed0b('0x1b')](_0x5afaac)[_0xed0b('0x1d')](_0x5a15c9);}};}function respondWithFilteredResult(_0x4e19ed,_0x680c4f){return function(_0x1dcad3){if(_0x1dcad3){var _0x43fcb7=typeof _0x680c4f[_0xed0b('0x1e')]===_0xed0b('0x1f')&&typeof _0x680c4f['limit']==='undefined';var _0x1bb8b5=_0x1dcad3[_0xed0b('0x20')];var _0x444f9b=_0x43fcb7?0x0:_0x680c4f[_0xed0b('0x1e')];var _0x3b9307=_0x43fcb7?_0x1dcad3[_0xed0b('0x20')]:_0x680c4f[_0xed0b('0x1e')]+_0x680c4f['limit'];var _0x281f1b;if(_0x3b9307>=_0x1bb8b5){_0x3b9307=_0x1bb8b5;_0x281f1b=0xc8;}else{_0x281f1b=0xce;}_0x4e19ed[_0xed0b('0x1b')](_0x281f1b);return _0x4e19ed[_0xed0b('0x21')](_0xed0b('0x22'),_0x444f9b+'-'+_0x3b9307+'/'+_0x1bb8b5)[_0xed0b('0x1d')](_0x1dcad3);}return null;};}function patchUpdates(_0x50ff2b){return function(_0x2e916d){try{jsonpatch[_0xed0b('0x23')](_0x2e916d,_0x50ff2b,!![]);}catch(_0x111a5d){return BPromise['reject'](_0x111a5d);}return _0x2e916d[_0xed0b('0x24')]();};}function saveUpdates(_0x1b1bc6,_0xbcc55e){return function(_0x56d8de){if(_0x56d8de){return _0x56d8de['update'](_0x1b1bc6)[_0xed0b('0x25')](function(_0x14852a){return _0x14852a;});}return null;};}function removeEntity(_0x3d8424,_0x36bc17){return function(_0x29a136){if(_0x29a136){return _0x29a136[_0xed0b('0x26')]()[_0xed0b('0x25')](function(){var _0x466862=_0x29a136[_0xed0b('0x27')]({'plain':!![]});var _0x7f27a5=_0xed0b('0x28');return db[_0xed0b('0x29')][_0xed0b('0x26')]({'where':{'type':_0x7f27a5,'resourceId':_0x466862['id']}})['then'](function(){return _0x29a136;});})['then'](function(){_0x3d8424[_0xed0b('0x1b')](0xcc)[_0xed0b('0x1c')]();});}};}function handleEntityNotFound(_0x110908,_0x30918f){return function(_0x54249f){if(!_0x54249f){_0x110908[_0xed0b('0x1a')](0x194);}return _0x54249f;};}function handleError(_0x2d5409,_0x4ff52a){_0x4ff52a=_0x4ff52a||0x1f4;return function(_0x16eeb2){logger['error'](_0x16eeb2[_0xed0b('0x2a')]);if(_0x16eeb2['name']){delete _0x16eeb2[_0xed0b('0x2b')];}_0x2d5409['status'](_0x4ff52a)['send'](_0x16eeb2);};}exports[_0xed0b('0x2c')]=function(_0x570245,_0x2c2150){var _0x45ca19={},_0x5931ca={},_0x17d25a={'count':0x0,'rows':[]};var _0x43d03a=_['map'](db['JscriptyProject'][_0xed0b('0x2d')],function(_0x2be4a4){return{'name':_0x2be4a4[_0xed0b('0x2e')],'type':_0x2be4a4[_0xed0b('0x2f')][_0xed0b('0x30')]};});_0x5931ca[_0xed0b('0x31')]=_[_0xed0b('0x32')](_0x43d03a,_0xed0b('0x2b'));_0x5931ca[_0xed0b('0x33')]=_['keys'](_0x570245[_0xed0b('0x33')]);_0x5931ca[_0xed0b('0x34')]=_[_0xed0b('0x35')](_0x5931ca['model'],_0x5931ca[_0xed0b('0x33')]);_0x45ca19[_0xed0b('0x36')]=_[_0xed0b('0x35')](_0x5931ca[_0xed0b('0x31')],qs['fields'](_0x570245[_0xed0b('0x33')]['fields']));_0x45ca19[_0xed0b('0x36')]=_0x45ca19[_0xed0b('0x36')][_0xed0b('0x37')]?_0x45ca19[_0xed0b('0x36')]:_0x5931ca[_0xed0b('0x31')];if(!_0x570245['query'][_0xed0b('0x38')]('nolimit')){_0x45ca19[_0xed0b('0x39')]=qs[_0xed0b('0x39')](_0x570245[_0xed0b('0x33')][_0xed0b('0x39')]);_0x45ca19[_0xed0b('0x1e')]=qs[_0xed0b('0x1e')](_0x570245[_0xed0b('0x33')]['offset']);}_0x45ca19[_0xed0b('0x3a')]=qs[_0xed0b('0x3b')](_0x570245[_0xed0b('0x33')][_0xed0b('0x3b')]);_0x45ca19[_0xed0b('0x3c')]=qs[_0xed0b('0x34')](_[_0xed0b('0x3d')](_0x570245[_0xed0b('0x33')],_0x5931ca['filters']),_0x43d03a);if(_0x570245[_0xed0b('0x33')][_0xed0b('0x3e')]){_0x45ca19[_0xed0b('0x3c')]=_[_0xed0b('0x3f')](_0x45ca19[_0xed0b('0x3c')],{'$or':_[_0xed0b('0x32')](_0x43d03a,function(_0x1d1fa0){if(_0x1d1fa0['type']!==_0xed0b('0x40')){var _0x3d9e88={};_0x3d9e88[_0x1d1fa0[_0xed0b('0x2b')]]={'$like':'%'+_0x570245['query'][_0xed0b('0x3e')]+'%'};return _0x3d9e88;}})});}_0x45ca19=_[_0xed0b('0x3f')]({},_0x45ca19,_0x570245[_0xed0b('0x41')]);var _0x430991={'where':_0x45ca19[_0xed0b('0x3c')]};return db['JscriptyProject'][_0xed0b('0x20')](_0x430991)[_0xed0b('0x25')](function(_0x2841dc){_0x17d25a[_0xed0b('0x20')]=_0x2841dc;if(_0x570245[_0xed0b('0x33')][_0xed0b('0x42')]){_0x45ca19[_0xed0b('0x43')]=[{'all':!![]}];}return db[_0xed0b('0x44')][_0xed0b('0x45')](_0x45ca19);})[_0xed0b('0x25')](function(_0x5bb8ea){_0x17d25a['rows']=_0x5bb8ea;return _0x17d25a;})[_0xed0b('0x25')](respondWithFilteredResult(_0x2c2150,_0x45ca19))['catch'](handleError(_0x2c2150,null));};exports[_0xed0b('0x46')]=function(_0x7aa96a,_0xf4cac){var _0x252aac={'raw':![],'where':{'id':_0x7aa96a[_0xed0b('0x47')]['id']}},_0x31b183={};_0x31b183[_0xed0b('0x31')]=_[_0xed0b('0x48')](db[_0xed0b('0x44')]['rawAttributes']);_0x31b183[_0xed0b('0x33')]=_[_0xed0b('0x48')](_0x7aa96a['query']);_0x31b183[_0xed0b('0x34')]=_[_0xed0b('0x35')](_0x31b183[_0xed0b('0x31')],_0x31b183[_0xed0b('0x33')]);_0x252aac['attributes']=_[_0xed0b('0x35')](_0x31b183[_0xed0b('0x31')],qs[_0xed0b('0x49')](_0x7aa96a[_0xed0b('0x33')][_0xed0b('0x49')]));_0x252aac[_0xed0b('0x36')]=_0x252aac['attributes'][_0xed0b('0x37')]?_0x252aac[_0xed0b('0x36')]:_0x31b183[_0xed0b('0x31')];if(_0x7aa96a[_0xed0b('0x33')]['includeAll']){_0x252aac[_0xed0b('0x43')]=[{'all':!![]}];}_0x252aac=_['merge']({},_0x252aac,_0x7aa96a[_0xed0b('0x41')]);return db['JscriptyProject']['find'](_0x252aac)['then'](handleEntityNotFound(_0xf4cac,null))[_0xed0b('0x25')](respondWithResult(_0xf4cac,null))[_0xed0b('0x4a')](handleError(_0xf4cac,null));};exports[_0xed0b('0x4b')]=function(_0x1e33e0,_0x2cc794){return db[_0xed0b('0x44')][_0xed0b('0x4b')](_0x1e33e0[_0xed0b('0x4c')],{})[_0xed0b('0x25')](function(_0x58b7a7){var _0x5cbfd3=_0x1e33e0[_0xed0b('0x4d')][_0xed0b('0x27')]({'plain':!![]});if(!_0x5cbfd3)throw new Error(_0xed0b('0x4e'));if(_0x5cbfd3[_0xed0b('0x4f')]===_0xed0b('0x4d')){var _0x324798=_0x58b7a7[_0xed0b('0x27')]({'plain':!![]});var _0x4d91f7=_0xed0b('0x28');return db['UserProfileSection'][_0xed0b('0x50')]({'where':{'name':_0x4d91f7,'userProfileId':_0x5cbfd3[_0xed0b('0x51')]},'raw':!![]})[_0xed0b('0x25')](function(_0x37d466){if(_0x37d466&&_0x37d466[_0xed0b('0x52')]===0x0){return db[_0xed0b('0x29')][_0xed0b('0x4b')]({'name':_0x324798['name'],'resourceId':_0x324798['id'],'type':_0x37d466[_0xed0b('0x2b')],'sectionId':_0x37d466['id']},{})[_0xed0b('0x25')](function(){return _0x58b7a7;});}else{return _0x58b7a7;}})['catch'](function(_0x1bfa21){logger[_0xed0b('0x53')](_0xed0b('0x54'),_0x1bfa21);throw _0x1bfa21;});}return _0x58b7a7;})[_0xed0b('0x25')](respondWithResult(_0x2cc794,0xc9))['catch'](handleError(_0x2cc794,null));};exports[_0xed0b('0x55')]=function(_0x499d52,_0x337000){var _0x3f18d7={'where':{'id':_0x499d52['params']['id']}},_0x53063e={};_0x53063e[_0xed0b('0x31')]=_[_0xed0b('0x48')](db[_0xed0b('0x44')]['rawAttributes']);_0x3f18d7[_0xed0b('0x36')]=_['intersection'](_0x53063e[_0xed0b('0x31')],qs['fields'](_0x499d52[_0xed0b('0x33')][_0xed0b('0x49')]));_0x3f18d7['attributes']=_0x3f18d7[_0xed0b('0x36')][_0xed0b('0x37')]?_0x3f18d7[_0xed0b('0x36')]:_0x53063e[_0xed0b('0x31')];if(_0x499d52[_0xed0b('0x33')]['includeAll']){_0x3f18d7[_0xed0b('0x43')]=[{'all':!![]}];}_0x3f18d7=_['merge']({},_0x3f18d7,_0x499d52[_0xed0b('0x41')]);return db[_0xed0b('0x44')][_0xed0b('0x50')](_0x3f18d7)[_0xed0b('0x25')](handleEntityNotFound(_0x337000,null))['then'](function(_0x18d71f){if(_0x18d71f){var _0x40a1f3=_0x18d71f[_0xed0b('0x27')]({'plain':!![]});_0x40a1f3=qs['omit'](_0x40a1f3,['id',_0xed0b('0x56'),'updatedAt']);_0x499d52[_0xed0b('0x4c')]=_[_0xed0b('0x57')](_0x499d52['body'],['id','createdAt',_0xed0b('0x58')]);return db[_0xed0b('0x44')][_0xed0b('0x4b')](_[_0xed0b('0x3f')](_0x40a1f3,_0x499d52[_0xed0b('0x4c')]),{'include':_0x499d52['query'][_0xed0b('0x42')]?[{'all':!![]}]:undefined})[_0xed0b('0x25')](function(_0x230f51){var _0x3e732b=_0x499d52[_0xed0b('0x4d')][_0xed0b('0x27')]({'plain':!![]});if(!_0x3e732b)throw new Error(_0xed0b('0x4e'));if(_0x3e732b[_0xed0b('0x4f')]===_0xed0b('0x4d')){var _0x41df59=_0x230f51[_0xed0b('0x27')]({'plain':!![]});var _0x1bd455=_0xed0b('0x28');return db[_0xed0b('0x59')][_0xed0b('0x50')]({'where':{'name':_0x1bd455,'userProfileId':_0x3e732b[_0xed0b('0x51')]},'raw':!![]})[_0xed0b('0x25')](function(_0x3b56fe){if(_0x3b56fe&&_0x3b56fe[_0xed0b('0x52')]===0x0){return db[_0xed0b('0x29')]['create']({'name':_0x41df59['name'],'resourceId':_0x41df59['id'],'type':_0x3b56fe[_0xed0b('0x2b')],'sectionId':_0x3b56fe['id']},{})[_0xed0b('0x25')](function(){return _0x230f51;});}else{return _0x230f51;}})['catch'](function(_0x120c19){logger['error'](_0xed0b('0x54'),_0x120c19);throw _0x120c19;});}return _0x230f51;});}})[_0xed0b('0x25')](respondWithResult(_0x337000,0xc9))['catch'](handleError(_0x337000,null));};exports[_0xed0b('0x5a')]=function(_0xca0f2b,_0x28f69b){if(_0xca0f2b[_0xed0b('0x4c')]['id']){delete _0xca0f2b[_0xed0b('0x4c')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0xca0f2b[_0xed0b('0x47')]['id']}})['then'](handleEntityNotFound(_0x28f69b,null))['then'](saveUpdates(_0xca0f2b[_0xed0b('0x4c')],null))[_0xed0b('0x25')](respondWithResult(_0x28f69b,null))[_0xed0b('0x4a')](handleError(_0x28f69b,null));};exports[_0xed0b('0x26')]=function(_0x315d5f,_0x52599d){return db['JscriptyProject'][_0xed0b('0x50')]({'where':{'id':_0x315d5f[_0xed0b('0x47')]['id']}})[_0xed0b('0x25')](handleEntityNotFound(_0x52599d,null))[_0xed0b('0x25')](removeEntity(_0x52599d,null))[_0xed0b('0x4a')](handleError(_0x52599d,null));};exports['getSessions']=function(_0xe1cb12,_0x376b04,_0x5920c6){var _0x342e28={'raw':!![],'where':{}};var _0x38b3f4={};var _0x5ed999={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xed0b('0x5b')]({'where':{'id':_0xe1cb12['params']['id']}})[_0xed0b('0x25')](handleEntityNotFound(_0x376b04,null))['then'](function(_0x17fd49){if(_0x17fd49){_0x38b3f4['model']=_[_0xed0b('0x48')](db['JscriptySessionReport']['rawAttributes']);_0x38b3f4[_0xed0b('0x33')]=_[_0xed0b('0x48')](_0xe1cb12[_0xed0b('0x33')]);_0x38b3f4['filters']=_[_0xed0b('0x35')](_0x38b3f4['model'],_0x38b3f4[_0xed0b('0x33')]);_0x342e28[_0xed0b('0x36')]=_[_0xed0b('0x35')](_0x38b3f4['model'],qs[_0xed0b('0x49')](_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x49')]));_0x342e28[_0xed0b('0x36')]=_0x342e28[_0xed0b('0x36')][_0xed0b('0x37')]?_0x342e28['attributes']:_0x38b3f4['model'];if(!_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x38')]('nolimit')){_0x342e28['limit']=qs[_0xed0b('0x39')](_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x39')]);_0x342e28[_0xed0b('0x1e')]=qs[_0xed0b('0x1e')](_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x1e')]);}_0x342e28[_0xed0b('0x3a')]=qs[_0xed0b('0x3b')](_0xe1cb12['query'][_0xed0b('0x3b')]);_0x342e28['where']=qs[_0xed0b('0x34')](_[_0xed0b('0x3d')](_0xe1cb12[_0xed0b('0x33')],_0x38b3f4[_0xed0b('0x34')]));_0x342e28[_0xed0b('0x3c')][_0xed0b('0x5c')]=_0x17fd49['id'];if(_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x3e')]){_0x342e28['where']=_[_0xed0b('0x3f')](_0x342e28['where'],{'$or':_[_0xed0b('0x32')](_0x342e28[_0xed0b('0x36')],function(_0x55c936){var _0xf02d83={};_0xf02d83[_0x55c936]={'$like':'%'+_0xe1cb12['query'][_0xed0b('0x3e')]+'%'};return _0xf02d83;})});}_0x342e28=_[_0xed0b('0x3f')]({},_0x342e28,_0xe1cb12['options']);return db[_0xed0b('0x5d')][_0xed0b('0x20')]({'where':_0x342e28[_0xed0b('0x3c')]})[_0xed0b('0x25')](function(_0x3c57e5){_0x5ed999[_0xed0b('0x20')]=_0x3c57e5;if(_0xe1cb12[_0xed0b('0x33')][_0xed0b('0x42')]){_0x342e28[_0xed0b('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xed0b('0x45')](_0x342e28);})[_0xed0b('0x25')](function(_0x58b269){_0x5ed999[_0xed0b('0x5e')]=_0x58b269;return _0x5ed999;});}})['then'](respondWithFilteredResult(_0x376b04,_0x342e28))[_0xed0b('0x4a')](handleError(_0x376b04,null));};exports[_0xed0b('0x5f')]=function(_0x61d854,_0x1ebd3e,_0x4a6508){var _0x24ac3f={'raw':!![],'where':{}};var _0x351504={};var _0x42696b={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xed0b('0x5b')]({'where':{'id':_0x61d854[_0xed0b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ebd3e,null))[_0xed0b('0x25')](function(_0x3c5330){if(_0x3c5330){_0x351504['model']=_[_0xed0b('0x48')](db[_0xed0b('0x60')][_0xed0b('0x2d')]);_0x351504['query']=_['keys'](_0x61d854['query']);_0x351504[_0xed0b('0x34')]=_['intersection'](_0x351504['model'],_0x351504[_0xed0b('0x33')]);_0x24ac3f[_0xed0b('0x36')]=_['intersection'](_0x351504[_0xed0b('0x31')],qs[_0xed0b('0x49')](_0x61d854[_0xed0b('0x33')][_0xed0b('0x49')]));_0x24ac3f['attributes']=_0x24ac3f[_0xed0b('0x36')][_0xed0b('0x37')]?_0x24ac3f[_0xed0b('0x36')]:_0x351504['model'];if(!_0x61d854[_0xed0b('0x33')]['hasOwnProperty']('nolimit')){_0x24ac3f[_0xed0b('0x39')]=qs[_0xed0b('0x39')](_0x61d854[_0xed0b('0x33')][_0xed0b('0x39')]);_0x24ac3f[_0xed0b('0x1e')]=qs[_0xed0b('0x1e')](_0x61d854[_0xed0b('0x33')]['offset']);}_0x24ac3f[_0xed0b('0x3a')]=qs[_0xed0b('0x3b')](_0x61d854[_0xed0b('0x33')][_0xed0b('0x3b')]);_0x24ac3f[_0xed0b('0x3c')]=qs[_0xed0b('0x34')](_[_0xed0b('0x3d')](_0x61d854[_0xed0b('0x33')],_0x351504[_0xed0b('0x34')]));_0x24ac3f['where'][_0xed0b('0x5c')]=_0x3c5330['id'];if(_0x61d854[_0xed0b('0x33')][_0xed0b('0x3e')]){_0x24ac3f[_0xed0b('0x3c')]=_['merge'](_0x24ac3f[_0xed0b('0x3c')],{'$or':_[_0xed0b('0x32')](_0x24ac3f['attributes'],function(_0x10627d){var _0x2bd146={};_0x2bd146[_0x10627d]={'$like':'%'+_0x61d854[_0xed0b('0x33')][_0xed0b('0x3e')]+'%'};return _0x2bd146;})});}_0x24ac3f=_[_0xed0b('0x3f')]({},_0x24ac3f,_0x61d854[_0xed0b('0x41')]);return db[_0xed0b('0x60')][_0xed0b('0x20')]({'where':_0x24ac3f[_0xed0b('0x3c')]})[_0xed0b('0x25')](function(_0x528aba){_0x42696b['count']=_0x528aba;if(_0x61d854['query'][_0xed0b('0x42')]){_0x24ac3f[_0xed0b('0x43')]=[{'all':!![]}];}return db[_0xed0b('0x60')]['findAll'](_0x24ac3f);})[_0xed0b('0x25')](function(_0x530e11){_0x42696b[_0xed0b('0x5e')]=_0x530e11;return _0x42696b;});}})[_0xed0b('0x25')](respondWithFilteredResult(_0x1ebd3e,_0x24ac3f))[_0xed0b('0x4a')](handleError(_0x1ebd3e,null));};function char(_0x42d339){return'number'===typeof _0x42d339?String['fromCharCode']['apply'](null,arguments):_0x42d339;}function needsEncapsulation(_0x20e350){return!!_0x20e350&&(_0x20e350[_0xed0b('0x61')]()[_0xed0b('0x62')](char(0xd))>=0x0||_0x20e350[_0xed0b('0x61')]()['indexOf'](char(0xa))>=0x0||_0x20e350['toString']()[_0xed0b('0x62')](char(0x2c))>=0x0||_0x20e350['toString']()[_0xed0b('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3aab67){var _0x4c60be=char(0x22),_0xdd645f='\x5c'+char(0x22),_0x52f7f1=_0x3aab67['toString']()['replace'](new RegExp(_0x4c60be,'g'),_0xdd645f);return _0x4c60be+_0x52f7f1+_0x4c60be;}exports[_0xed0b('0x63')]=function(_0x381122,_0x5c7a77,_0x20b7c2){var _0x4d2cbb,_0x5a96db;var _0x56312c={'where':{'ProjectId':_0x381122[_0xed0b('0x47')]['id']}};if(_0x381122[_0xed0b('0x33')][_0xed0b('0x64')]){_0x56312c[_0xed0b('0x3c')][_0xed0b('0x65')]=JSON[_0xed0b('0x66')](_0x381122[_0xed0b('0x33')][_0xed0b('0x64')]);}return db[_0xed0b('0x5d')]['findAll'](_0x56312c)[_0xed0b('0x25')](handleEntityNotFound(_0x5c7a77,null))[_0xed0b('0x25')](function(_0xcac236){if(_0xcac236){_0x4d2cbb=_0xcac236;return db[_0xed0b('0x67')][_0xed0b('0x45')]({'where':{'SessionId':{'$in':_[_0xed0b('0x32')](_0x4d2cbb,'id')},'ProjectId':_0x381122[_0xed0b('0x47')]['id']},'order':_0xed0b('0x68')});}})['then'](handleEntityNotFound(_0x5c7a77,null))[_0xed0b('0x25')](function(_0x4a9032){if(_0x4a9032){_0x5a96db=_0x4a9032;var _0x159e06={};for(var _0x4c0269=0x0,_0x29d076=_0x5a96db['length'];_0x4c0269<_0x29d076;_0x4c0269++){if(!_0x159e06[_0xed0b('0x38')](_0x5a96db[_0x4c0269][_0xed0b('0x69')])){_0x159e06[_0x5a96db[_0x4c0269][_0xed0b('0x69')]]=needsEncapsulation(_0x5a96db[_0x4c0269]['question'])?encapsulate(_0x5a96db[_0x4c0269][_0xed0b('0x6a')]):_0x5a96db[_0x4c0269][_0xed0b('0x6a')];}}var _0x52dcd3=[],_0x9710b9={};for(var _0x420608=0x0,_0x2c3e0a=_0x4d2cbb[_0xed0b('0x37')];_0x420608<_0x2c3e0a;_0x420608++){_0x9710b9={'ProjectId':_0x381122[_0xed0b('0x47')]['id'],'SessionId':_0x4d2cbb[_0x420608]['id'],'StartTime':moment(_0x4d2cbb[_0x420608][_0xed0b('0x65')])[_0xed0b('0x6b')](_0xed0b('0x6c'))};for(var _0x3872fc=0x0,_0x4a3de7=_0x5a96db[_0xed0b('0x37')];_0x3872fc<_0x4a3de7;_0x3872fc++){if(_0x5a96db[_0x3872fc][_0xed0b('0x6d')]==_0x4d2cbb[_0x420608]['id']&&_0x159e06[_0xed0b('0x38')](_0x5a96db[_0x3872fc][_0xed0b('0x69')])){_0x9710b9[_0x159e06[_0x5a96db[_0x3872fc][_0xed0b('0x69')]]]=_0x5a96db[_0x3872fc][_0xed0b('0x6e')];}}for(var _0x2cadc1 in _0x159e06){if(!_0x9710b9[_0xed0b('0x38')](_0x159e06[_0x2cadc1])){_0x9710b9[_0x159e06[_0x2cadc1]]=null;}}_0x52dcd3[_0xed0b('0x6f')](_0x9710b9);}return _0x52dcd3;}})[_0xed0b('0x25')](function(_0xffeffb){if(!_[_0xed0b('0x70')](_0xffeffb)){var _0x546274=toCsv(_0xffeffb);var _0x40c8a6=Date[_0xed0b('0x71')]();fs['writeFileSync'](util[_0xed0b('0x6b')](_0xed0b('0x72'),_0x381122[_0xed0b('0x47')]['id'],_0x40c8a6),_0x546274);_0x5c7a77[_0xed0b('0x73')](_0xed0b('0x74'),_0xed0b('0x75')+util['format'](_0xed0b('0x76'),_0x381122[_0xed0b('0x47')]['id'],_0x40c8a6));_0x5c7a77[_0xed0b('0x73')](_0xed0b('0x77'),'text/csv');return _0x5c7a77[_0xed0b('0x78')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x381122['params']['id'],_0x40c8a6));}else{return _0x5c7a77[_0xed0b('0x1a')](0xcc);}})[_0xed0b('0x4a')](handleError(_0x5c7a77,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e54d2ef..3e44647 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 _0x1db9=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x503325,_0x24a407){var _0x452fff=function(_0x42bf26){while(--_0x42bf26){_0x503325['push'](_0x503325['shift']());}};_0x452fff(++_0x24a407);}(_0x1db9,0x176));var _0x91db=function(_0x6094ee,_0x1aa181){_0x6094ee=_0x6094ee-0x0;var _0x167f74=_0x1db9[_0x6094ee];return _0x167f74;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7579=['define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x1992aa,_0x3a5437){var _0x2e1e42=function(_0x4bea8a){while(--_0x4bea8a){_0x1992aa['push'](_0x1992aa['shift']());}};_0x2e1e42(++_0x3a5437);}(_0x7579,0x1e2));var _0x9757=function(_0x1c9d42,_0x1e5fdb){_0x1c9d42=_0x1c9d42-0x0;var _0x376e48=_0x7579[_0x1c9d42];return _0x376e48;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('JscriptyProject',attributes,{'tableName':_0x9757('0xb'),'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 75b5c94..d521a18 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xda3f,0xec));var _0xfda3=function(_0xc2340c,_0x5c3d9b){_0xc2340c=_0xc2340c-0x0;var _0x4ba228=_0xda3f[_0xc2340c];return _0x4ba228;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xda3f,0xec));var _0xfda3=function(_0x2a9a03,_0x3e0107){_0x2a9a03=_0x2a9a03-0x0;var _0x212806=_0xda3f[_0x2a9a03];return _0x212806;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e54a1da..36c4905 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 _0xdf0d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create','put'];(function(_0x4bffb6,_0x15fb8e){var _0x1a44f3=function(_0x47145e){while(--_0x47145e){_0x4bffb6['push'](_0x4bffb6['shift']());}};_0x1a44f3(++_0x15fb8e);}(_0xdf0d,0x1d2));var _0xddf0=function(_0x16c263,_0x2b7e51){_0x16c263=_0x16c263-0x0;var _0x4f1434=_0xdf0d[_0x16c263];return _0x4f1434;};'use strict';var multer=require(_0xddf0('0x0'));var util=require(_0xddf0('0x1'));var path=require(_0xddf0('0x2'));var timeout=require(_0xddf0('0x3'));var express=require(_0xddf0('0x4'));var router=express[_0xddf0('0x5')]();var fs_extra=require(_0xddf0('0x6'));var auth=require(_0xddf0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xddf0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xddf0('0x9')]);router[_0xddf0('0xa')](_0xddf0('0xb'),auth['isAuthenticated'](),controller[_0xddf0('0xc')]);router['get'](_0xddf0('0xd'),auth[_0xddf0('0xe')](),controller[_0xddf0('0xf')]);router['post']('/',auth[_0xddf0('0xe')](),controller[_0xddf0('0x10')]);router[_0xddf0('0x11')](_0xddf0('0xd'),auth['isAuthenticated'](),controller[_0xddf0('0x12')]);router[_0xddf0('0x13')](_0xddf0('0xd'),auth['isAuthenticated'](),controller[_0xddf0('0x14')]);module[_0xddf0('0x15')]=router; \ No newline at end of file +var _0x2683=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0xd39472,_0x3e2493){var _0x295cb6=function(_0x144392){while(--_0x144392){_0xd39472['push'](_0xd39472['shift']());}};_0x295cb6(++_0x3e2493);}(_0x2683,0x109));var _0x3268=function(_0xa6e83b,_0x266b29){_0xa6e83b=_0xa6e83b-0x0;var _0x21d379=_0x2683[_0xa6e83b];return _0x21d379;};'use strict';var multer=require('multer');var util=require(_0x3268('0x0'));var path=require('path');var timeout=require(_0x3268('0x1'));var express=require(_0x3268('0x2'));var router=express[_0x3268('0x3')]();var fs_extra=require(_0x3268('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3268('0x5'));var config=require(_0x3268('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x3268('0x7')]('/',auth[_0x3268('0x8')](),controller[_0x3268('0x9')]);router[_0x3268('0x7')](_0x3268('0xa'),auth[_0x3268('0x8')](),controller[_0x3268('0xb')]);router[_0x3268('0x7')](_0x3268('0xc'),auth[_0x3268('0x8')](),controller[_0x3268('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3268('0xe')](_0x3268('0xc'),auth[_0x3268('0x8')](),controller[_0x3268('0xf')]);router[_0x3268('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3268('0x11')]);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 04ccefa..97a8b01 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(_0x4ab306,_0x52dfd5){_0x4ab306=_0x4ab306-0x0;var _0x29eb73=_0x7a54[_0x4ab306];return _0x29eb73;};'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(_0x37e20e,_0x27bd6f){_0x37e20e=_0x37e20e-0x0;var _0x2c82ca=_0x7a54[_0x37e20e];return _0x2c82ca;};'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 fee777b..8c45598 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 _0xdfe6=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xdfe6,0xfd));var _0x6dfe=function(_0x3631b2,_0x12f25f){_0x3631b2=_0x3631b2-0x0;var _0x424962=_0xdfe6[_0x3631b2];return _0x424962;};'use strict';var emlformat=require(_0x6dfe('0x0'));var rimraf=require(_0x6dfe('0x1'));var zipdir=require(_0x6dfe('0x2'));var jsonpatch=require(_0x6dfe('0x3'));var rp=require(_0x6dfe('0x4'));var moment=require('moment');var BPromise=require(_0x6dfe('0x5'));var Mustache=require(_0x6dfe('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6dfe('0x7'));var ejs=require(_0x6dfe('0x8'));var fs=require('fs');var fs_extra=require(_0x6dfe('0x9'));var _=require('lodash');var squel=require(_0x6dfe('0xa'));var crypto=require(_0x6dfe('0xb'));var jsforce=require(_0x6dfe('0xc'));var deskjs=require(_0x6dfe('0xd'));var toCsv=require(_0x6dfe('0x7'));var querystring=require(_0x6dfe('0xe'));var Papa=require(_0x6dfe('0xf'));var Redis=require(_0x6dfe('0x10'));var authService=require(_0x6dfe('0x11'));var qs=require(_0x6dfe('0x12'));var as=require(_0x6dfe('0x13'));var hardwareService=require(_0x6dfe('0x14'));var logger=require(_0x6dfe('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6dfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6dfe('0x17'))['db'];function respondWithStatusCode(_0x21be1d,_0x221a5f){_0x221a5f=_0x221a5f||0xcc;return function(_0x16ffdc){if(_0x16ffdc){return _0x21be1d[_0x6dfe('0x18')](_0x221a5f);}return _0x21be1d[_0x6dfe('0x19')](_0x221a5f)['end']();};}function respondWithResult(_0x39a1b8,_0x3d8315){_0x3d8315=_0x3d8315||0xc8;return function(_0x449a71){if(_0x449a71){return _0x39a1b8[_0x6dfe('0x19')](_0x3d8315)[_0x6dfe('0x1a')](_0x449a71);}};}function respondWithFilteredResult(_0x546fdc,_0x20f0cd){return function(_0xc48513){if(_0xc48513){var _0x407bc4=typeof _0x20f0cd[_0x6dfe('0x1b')]===_0x6dfe('0x1c')&&typeof _0x20f0cd[_0x6dfe('0x1d')]==='undefined';var _0x412774=_0xc48513['count'];var _0x38bb59=_0x407bc4?0x0:_0x20f0cd['offset'];var _0x4e4d1c=_0x407bc4?_0xc48513['count']:_0x20f0cd[_0x6dfe('0x1b')]+_0x20f0cd[_0x6dfe('0x1d')];var _0x4c3e9e;if(_0x4e4d1c>=_0x412774){_0x4e4d1c=_0x412774;_0x4c3e9e=0xc8;}else{_0x4c3e9e=0xce;}_0x546fdc['status'](_0x4c3e9e);return _0x546fdc[_0x6dfe('0x1e')](_0x6dfe('0x1f'),_0x38bb59+'-'+_0x4e4d1c+'/'+_0x412774)[_0x6dfe('0x1a')](_0xc48513);}return null;};}function patchUpdates(_0x4b834c){return function(_0x5332b9){try{jsonpatch[_0x6dfe('0x20')](_0x5332b9,_0x4b834c,!![]);}catch(_0x22313c){return BPromise['reject'](_0x22313c);}return _0x5332b9[_0x6dfe('0x21')]();};}function saveUpdates(_0x52eaf3,_0x1b8c0d){return function(_0x90a659){if(_0x90a659){return _0x90a659[_0x6dfe('0x22')](_0x52eaf3)[_0x6dfe('0x23')](function(_0x54bd27){return _0x54bd27;});}return null;};}function removeEntity(_0x6cb030,_0x467431){return function(_0x5ea8a4){if(_0x5ea8a4){return _0x5ea8a4[_0x6dfe('0x24')]()['then'](function(){_0x6cb030[_0x6dfe('0x19')](0xcc)[_0x6dfe('0x25')]();});}};}function handleEntityNotFound(_0x46191d,_0x5ed3bb){return function(_0x421b4d){if(!_0x421b4d){_0x46191d['sendStatus'](0x194);}return _0x421b4d;};}function handleError(_0x8c07c,_0x5149bf){_0x5149bf=_0x5149bf||0x1f4;return function(_0x4c8dfd){logger[_0x6dfe('0x26')](_0x4c8dfd[_0x6dfe('0x27')]);if(_0x4c8dfd[_0x6dfe('0x28')]){delete _0x4c8dfd[_0x6dfe('0x28')];}_0x8c07c['status'](_0x5149bf)[_0x6dfe('0x29')](_0x4c8dfd);};}exports[_0x6dfe('0x2a')]=function(_0x20625e,_0x193792){var _0x2af824={},_0x45745b={},_0x29cba9={'count':0x0,'rows':[]};var _0x1ea0fb=_['map'](db[_0x6dfe('0x2b')][_0x6dfe('0x2c')],function(_0x9ce723){return{'name':_0x9ce723[_0x6dfe('0x2d')],'type':_0x9ce723[_0x6dfe('0x2e')][_0x6dfe('0x2f')]};});_0x45745b[_0x6dfe('0x30')]=_[_0x6dfe('0x31')](_0x1ea0fb,_0x6dfe('0x28'));_0x45745b[_0x6dfe('0x32')]=_[_0x6dfe('0x33')](_0x20625e[_0x6dfe('0x32')]);_0x45745b[_0x6dfe('0x34')]=_[_0x6dfe('0x35')](_0x45745b['model'],_0x45745b[_0x6dfe('0x32')]);_0x2af824[_0x6dfe('0x36')]=_[_0x6dfe('0x35')](_0x45745b[_0x6dfe('0x30')],qs[_0x6dfe('0x37')](_0x20625e['query'][_0x6dfe('0x37')]));_0x2af824[_0x6dfe('0x36')]=_0x2af824[_0x6dfe('0x36')][_0x6dfe('0x38')]?_0x2af824[_0x6dfe('0x36')]:_0x45745b[_0x6dfe('0x30')];if(!_0x20625e['query'][_0x6dfe('0x39')](_0x6dfe('0x3a'))){_0x2af824[_0x6dfe('0x1d')]=qs[_0x6dfe('0x1d')](_0x20625e[_0x6dfe('0x32')][_0x6dfe('0x1d')]);_0x2af824[_0x6dfe('0x1b')]=qs['offset'](_0x20625e[_0x6dfe('0x32')][_0x6dfe('0x1b')]);}_0x2af824[_0x6dfe('0x3b')]=qs[_0x6dfe('0x3c')](_0x20625e[_0x6dfe('0x32')][_0x6dfe('0x3c')]);_0x2af824['where']=qs[_0x6dfe('0x34')](_['pick'](_0x20625e[_0x6dfe('0x32')],_0x45745b[_0x6dfe('0x34')]),_0x1ea0fb);if(_0x20625e[_0x6dfe('0x32')][_0x6dfe('0x3d')]){_0x2af824[_0x6dfe('0x3e')]=_[_0x6dfe('0x3f')](_0x2af824[_0x6dfe('0x3e')],{'$or':_[_0x6dfe('0x31')](_0x1ea0fb,function(_0x4a15d0){if(_0x4a15d0[_0x6dfe('0x2e')]!==_0x6dfe('0x40')){var _0x34d9e6={};_0x34d9e6[_0x4a15d0['name']]={'$like':'%'+_0x20625e[_0x6dfe('0x32')]['filter']+'%'};return _0x34d9e6;}})});}_0x2af824=_[_0x6dfe('0x3f')]({},_0x2af824,_0x20625e[_0x6dfe('0x41')]);var _0x12c5e1={'where':_0x2af824[_0x6dfe('0x3e')]};return db[_0x6dfe('0x2b')][_0x6dfe('0x42')](_0x12c5e1)['then'](function(_0x22d3bd){_0x29cba9[_0x6dfe('0x42')]=_0x22d3bd;if(_0x20625e[_0x6dfe('0x32')]['includeAll']){_0x2af824[_0x6dfe('0x43')]=[{'all':!![]}];}return db[_0x6dfe('0x2b')][_0x6dfe('0x44')](_0x2af824);})['then'](function(_0x7447c0){_0x29cba9[_0x6dfe('0x45')]=_0x7447c0;return _0x29cba9;})[_0x6dfe('0x23')](respondWithFilteredResult(_0x193792,_0x2af824))[_0x6dfe('0x46')](handleError(_0x193792,null));};exports[_0x6dfe('0x47')]=function(_0x32e498,_0x3127bc){var _0x1c0fad={'raw':!![],'where':{'id':_0x32e498['params']['id']}},_0x325d5c={};_0x325d5c['model']=_[_0x6dfe('0x33')](db['JscriptyQuestionReport'][_0x6dfe('0x2c')]);_0x325d5c[_0x6dfe('0x32')]=_[_0x6dfe('0x33')](_0x32e498['query']);_0x325d5c['filters']=_['intersection'](_0x325d5c[_0x6dfe('0x30')],_0x325d5c[_0x6dfe('0x32')]);_0x1c0fad[_0x6dfe('0x36')]=_[_0x6dfe('0x35')](_0x325d5c[_0x6dfe('0x30')],qs[_0x6dfe('0x37')](_0x32e498[_0x6dfe('0x32')]['fields']));_0x1c0fad[_0x6dfe('0x36')]=_0x1c0fad['attributes'][_0x6dfe('0x38')]?_0x1c0fad[_0x6dfe('0x36')]:_0x325d5c[_0x6dfe('0x30')];if(_0x32e498[_0x6dfe('0x32')][_0x6dfe('0x48')]){_0x1c0fad[_0x6dfe('0x43')]=[{'all':!![]}];}_0x1c0fad=_[_0x6dfe('0x3f')]({},_0x1c0fad,_0x32e498['options']);return db[_0x6dfe('0x2b')]['find'](_0x1c0fad)[_0x6dfe('0x23')](handleEntityNotFound(_0x3127bc,null))[_0x6dfe('0x23')](respondWithResult(_0x3127bc,null))['catch'](handleError(_0x3127bc,null));};exports[_0x6dfe('0x49')]=function(_0x302078,_0x1f1ef4){return db[_0x6dfe('0x2b')][_0x6dfe('0x49')](_0x302078[_0x6dfe('0x4a')],{})['then'](respondWithResult(_0x1f1ef4,0xc9))[_0x6dfe('0x46')](handleError(_0x1f1ef4,null));};exports[_0x6dfe('0x22')]=function(_0x263a71,_0x26bf47){if(_0x263a71[_0x6dfe('0x4a')]['id']){delete _0x263a71[_0x6dfe('0x4a')]['id'];}return db[_0x6dfe('0x2b')]['find']({'where':{'id':_0x263a71[_0x6dfe('0x4b')]['id']}})[_0x6dfe('0x23')](handleEntityNotFound(_0x26bf47,null))[_0x6dfe('0x23')](saveUpdates(_0x263a71[_0x6dfe('0x4a')],null))[_0x6dfe('0x23')](respondWithResult(_0x26bf47,null))[_0x6dfe('0x46')](handleError(_0x26bf47,null));};exports[_0x6dfe('0x24')]=function(_0x271ea,_0x3d9738){return db[_0x6dfe('0x2b')]['find']({'where':{'id':_0x271ea[_0x6dfe('0x4b')]['id']}})[_0x6dfe('0x23')](handleEntityNotFound(_0x3d9738,null))[_0x6dfe('0x23')](removeEntity(_0x3d9738,null))['catch'](handleError(_0x3d9738,null));};exports['describe']=function(_0x55ea19,_0x42e218){return db[_0x6dfe('0x2b')]['describe']()[_0x6dfe('0x23')](respondWithResult(_0x42e218,null))[_0x6dfe('0x46')](handleError(_0x42e218,null));}; \ No newline at end of file +var _0xfbb6=['create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','json','apply','save','update','then','destroy','error','stack','name','map','JscriptyQuestionReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','options','findAll','rows','catch','show','length','includeAll','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbb6,0x1e8));var _0x6fbb=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0xfbb6[_0x13945b];return _0x1b1643;};'use strict';var emlformat=require(_0x6fbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fbb('0x1'));var jsonpatch=require(_0x6fbb('0x2'));var rp=require(_0x6fbb('0x3'));var moment=require('moment');var BPromise=require(_0x6fbb('0x4'));var Mustache=require('mustache');var util=require(_0x6fbb('0x5'));var path=require(_0x6fbb('0x6'));var sox=require('sox');var csv=require(_0x6fbb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fbb('0x8'));var _=require(_0x6fbb('0x9'));var squel=require(_0x6fbb('0xa'));var crypto=require(_0x6fbb('0xb'));var jsforce=require(_0x6fbb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6fbb('0x7'));var querystring=require(_0x6fbb('0xd'));var Papa=require(_0x6fbb('0xe'));var Redis=require('ioredis');var authService=require(_0x6fbb('0xf'));var qs=require(_0x6fbb('0x10'));var as=require(_0x6fbb('0x11'));var hardwareService=require(_0x6fbb('0x12'));var logger=require(_0x6fbb('0x13'))('api');var utils=require(_0x6fbb('0x14'));var config=require(_0x6fbb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6fbb('0x16'))['db'];function respondWithStatusCode(_0x398a37,_0x219268){_0x219268=_0x219268||0xcc;return function(_0x265ab1){if(_0x265ab1){return _0x398a37[_0x6fbb('0x17')](_0x219268);}return _0x398a37[_0x6fbb('0x18')](_0x219268)[_0x6fbb('0x19')]();};}function respondWithResult(_0x381dbe,_0x366d3a){_0x366d3a=_0x366d3a||0xc8;return function(_0x304c82){if(_0x304c82){return _0x381dbe[_0x6fbb('0x18')](_0x366d3a)['json'](_0x304c82);}};}function respondWithFilteredResult(_0x530f9c,_0x33ff93){return function(_0x3af0a8){if(_0x3af0a8){var _0x322714=typeof _0x33ff93['offset']===_0x6fbb('0x1a')&&typeof _0x33ff93['limit']===_0x6fbb('0x1a');var _0x270af7=_0x3af0a8['count'];var _0x2d069e=_0x322714?0x0:_0x33ff93[_0x6fbb('0x1b')];var _0x459db4=_0x322714?_0x3af0a8[_0x6fbb('0x1c')]:_0x33ff93[_0x6fbb('0x1b')]+_0x33ff93[_0x6fbb('0x1d')];var _0x39f186;if(_0x459db4>=_0x270af7){_0x459db4=_0x270af7;_0x39f186=0xc8;}else{_0x39f186=0xce;}_0x530f9c['status'](_0x39f186);return _0x530f9c[_0x6fbb('0x1e')]('Content-Range',_0x2d069e+'-'+_0x459db4+'/'+_0x270af7)[_0x6fbb('0x1f')](_0x3af0a8);}return null;};}function patchUpdates(_0x4a070f){return function(_0x3c2d42){try{jsonpatch[_0x6fbb('0x20')](_0x3c2d42,_0x4a070f,!![]);}catch(_0xb8dfb9){return BPromise['reject'](_0xb8dfb9);}return _0x3c2d42[_0x6fbb('0x21')]();};}function saveUpdates(_0x47ff02,_0x4700ad){return function(_0x106fae){if(_0x106fae){return _0x106fae[_0x6fbb('0x22')](_0x47ff02)[_0x6fbb('0x23')](function(_0x1971d7){return _0x1971d7;});}return null;};}function removeEntity(_0x4c22ed,_0x44b57d){return function(_0x43a96b){if(_0x43a96b){return _0x43a96b[_0x6fbb('0x24')]()[_0x6fbb('0x23')](function(){_0x4c22ed[_0x6fbb('0x18')](0xcc)[_0x6fbb('0x19')]();});}};}function handleEntityNotFound(_0x5785ab,_0x59f4c8){return function(_0x13edab){if(!_0x13edab){_0x5785ab[_0x6fbb('0x17')](0x194);}return _0x13edab;};}function handleError(_0x22dee4,_0x6ed325){_0x6ed325=_0x6ed325||0x1f4;return function(_0x1a2c54){logger[_0x6fbb('0x25')](_0x1a2c54[_0x6fbb('0x26')]);if(_0x1a2c54[_0x6fbb('0x27')]){delete _0x1a2c54[_0x6fbb('0x27')];}_0x22dee4['status'](_0x6ed325)['send'](_0x1a2c54);};}exports['index']=function(_0x430dc5,_0x1a3f9e){var _0x2297ec={},_0x440c03={},_0x3f15a9={'count':0x0,'rows':[]};var _0x4827b6=_[_0x6fbb('0x28')](db[_0x6fbb('0x29')][_0x6fbb('0x2a')],function(_0x591438){return{'name':_0x591438[_0x6fbb('0x2b')],'type':_0x591438['type']['key']};});_0x440c03[_0x6fbb('0x2c')]=_['map'](_0x4827b6,'name');_0x440c03[_0x6fbb('0x2d')]=_[_0x6fbb('0x2e')](_0x430dc5[_0x6fbb('0x2d')]);_0x440c03[_0x6fbb('0x2f')]=_[_0x6fbb('0x30')](_0x440c03[_0x6fbb('0x2c')],_0x440c03['query']);_0x2297ec[_0x6fbb('0x31')]=_[_0x6fbb('0x30')](_0x440c03[_0x6fbb('0x2c')],qs[_0x6fbb('0x32')](_0x430dc5[_0x6fbb('0x2d')][_0x6fbb('0x32')]));_0x2297ec[_0x6fbb('0x31')]=_0x2297ec[_0x6fbb('0x31')]['length']?_0x2297ec[_0x6fbb('0x31')]:_0x440c03['model'];if(!_0x430dc5[_0x6fbb('0x2d')][_0x6fbb('0x33')](_0x6fbb('0x34'))){_0x2297ec[_0x6fbb('0x1d')]=qs[_0x6fbb('0x1d')](_0x430dc5[_0x6fbb('0x2d')][_0x6fbb('0x1d')]);_0x2297ec[_0x6fbb('0x1b')]=qs[_0x6fbb('0x1b')](_0x430dc5[_0x6fbb('0x2d')][_0x6fbb('0x1b')]);}_0x2297ec['order']=qs[_0x6fbb('0x35')](_0x430dc5[_0x6fbb('0x2d')][_0x6fbb('0x35')]);_0x2297ec[_0x6fbb('0x36')]=qs[_0x6fbb('0x2f')](_[_0x6fbb('0x37')](_0x430dc5[_0x6fbb('0x2d')],_0x440c03[_0x6fbb('0x2f')]),_0x4827b6);if(_0x430dc5[_0x6fbb('0x2d')]['filter']){_0x2297ec[_0x6fbb('0x36')]=_['merge'](_0x2297ec[_0x6fbb('0x36')],{'$or':_['map'](_0x4827b6,function(_0x4b0cbc){if(_0x4b0cbc['type']!=='VIRTUAL'){var _0x148527={};_0x148527[_0x4b0cbc[_0x6fbb('0x27')]]={'$like':'%'+_0x430dc5[_0x6fbb('0x2d')]['filter']+'%'};return _0x148527;}})});}_0x2297ec=_['merge']({},_0x2297ec,_0x430dc5[_0x6fbb('0x38')]);var _0x2d7373={'where':_0x2297ec['where']};return db[_0x6fbb('0x29')][_0x6fbb('0x1c')](_0x2d7373)['then'](function(_0x3e84c5){_0x3f15a9[_0x6fbb('0x1c')]=_0x3e84c5;if(_0x430dc5[_0x6fbb('0x2d')]['includeAll']){_0x2297ec['include']=[{'all':!![]}];}return db[_0x6fbb('0x29')][_0x6fbb('0x39')](_0x2297ec);})[_0x6fbb('0x23')](function(_0x45b7b7){_0x3f15a9[_0x6fbb('0x3a')]=_0x45b7b7;return _0x3f15a9;})[_0x6fbb('0x23')](respondWithFilteredResult(_0x1a3f9e,_0x2297ec))[_0x6fbb('0x3b')](handleError(_0x1a3f9e,null));};exports[_0x6fbb('0x3c')]=function(_0x2faae0,_0x3118a2){var _0x23dd6e={'raw':!![],'where':{'id':_0x2faae0['params']['id']}},_0x431608={};_0x431608[_0x6fbb('0x2c')]=_[_0x6fbb('0x2e')](db['JscriptyQuestionReport'][_0x6fbb('0x2a')]);_0x431608['query']=_['keys'](_0x2faae0[_0x6fbb('0x2d')]);_0x431608['filters']=_[_0x6fbb('0x30')](_0x431608[_0x6fbb('0x2c')],_0x431608[_0x6fbb('0x2d')]);_0x23dd6e[_0x6fbb('0x31')]=_['intersection'](_0x431608[_0x6fbb('0x2c')],qs[_0x6fbb('0x32')](_0x2faae0['query'][_0x6fbb('0x32')]));_0x23dd6e[_0x6fbb('0x31')]=_0x23dd6e[_0x6fbb('0x31')][_0x6fbb('0x3d')]?_0x23dd6e[_0x6fbb('0x31')]:_0x431608[_0x6fbb('0x2c')];if(_0x2faae0[_0x6fbb('0x2d')][_0x6fbb('0x3e')]){_0x23dd6e['include']=[{'all':!![]}];}_0x23dd6e=_[_0x6fbb('0x3f')]({},_0x23dd6e,_0x2faae0[_0x6fbb('0x38')]);return db[_0x6fbb('0x29')]['find'](_0x23dd6e)['then'](handleEntityNotFound(_0x3118a2,null))[_0x6fbb('0x23')](respondWithResult(_0x3118a2,null))[_0x6fbb('0x3b')](handleError(_0x3118a2,null));};exports[_0x6fbb('0x40')]=function(_0x4648d1,_0x479ab6){return db[_0x6fbb('0x29')][_0x6fbb('0x40')](_0x4648d1[_0x6fbb('0x41')],{})[_0x6fbb('0x23')](respondWithResult(_0x479ab6,0xc9))[_0x6fbb('0x3b')](handleError(_0x479ab6,null));};exports[_0x6fbb('0x22')]=function(_0x1e08fc,_0x21f422){if(_0x1e08fc[_0x6fbb('0x41')]['id']){delete _0x1e08fc['body']['id'];}return db[_0x6fbb('0x29')][_0x6fbb('0x42')]({'where':{'id':_0x1e08fc[_0x6fbb('0x43')]['id']}})['then'](handleEntityNotFound(_0x21f422,null))['then'](saveUpdates(_0x1e08fc[_0x6fbb('0x41')],null))['then'](respondWithResult(_0x21f422,null))[_0x6fbb('0x3b')](handleError(_0x21f422,null));};exports[_0x6fbb('0x24')]=function(_0x2e0d9c,_0x38978d){return db[_0x6fbb('0x29')][_0x6fbb('0x42')]({'where':{'id':_0x2e0d9c[_0x6fbb('0x43')]['id']}})[_0x6fbb('0x23')](handleEntityNotFound(_0x38978d,null))[_0x6fbb('0x23')](removeEntity(_0x38978d,null))['catch'](handleError(_0x38978d,null));};exports[_0x6fbb('0x44')]=function(_0x388a66,_0x1d3945){return db[_0x6fbb('0x29')]['describe']()[_0x6fbb('0x23')](respondWithResult(_0x1d3945,null))[_0x6fbb('0x3b')](handleError(_0x1d3945,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7c46a01..3999095 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 _0x8d5e=['./jscriptyQuestionReport.attributes','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0x8d5e,0x123));var _0xe8d5=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x8d5e[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xe8d5('0x0'));var util=require(_0xe8d5('0x1'));var logger=require(_0xe8d5('0x2'))('api');var moment=require(_0xe8d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8d5('0x5'));var config=require('../../config/environment');var attributes=require(_0xe8d5('0x6'));module['exports']=function(_0x43fc01,_0x1644c2){return _0x43fc01['define'](_0xe8d5('0x7'),attributes,{'tableName':_0xe8d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa188=['./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','lodash','util','request-promise','rimraf','../../config/environment'];(function(_0x35b135,_0x3e5de0){var _0x1e704f=function(_0x548553){while(--_0x548553){_0x35b135['push'](_0x35b135['shift']());}};_0x1e704f(++_0x3e5de0);}(_0xa188,0x13b));var _0x8a18=function(_0x5da98d,_0x5f4812){_0x5da98d=_0x5da98d-0x0;var _0x3d3704=_0xa188[_0x5da98d];return _0x3d3704;};'use strict';var _=require(_0x8a18('0x0'));var util=require(_0x8a18('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a18('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a18('0x3'));var config=require(_0x8a18('0x4'));var attributes=require(_0x8a18('0x5'));module['exports']=function(_0xfad76d,_0x40e9ef){return _0xfad76d[_0x8a18('0x6')](_0x8a18('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index c398f58..43953b8 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 _0x7c7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x19ef53,_0x400920){var _0x17bbb8=function(_0x24abb8){while(--_0x24abb8){_0x19ef53['push'](_0x19ef53['shift']());}};_0x17bbb8(++_0x400920);}(_0x7c7b,0x13d));var _0xb7c7=function(_0x2279a4,_0x154e58){_0x2279a4=_0x2279a4-0x0;var _0x27f559=_0x7c7b[_0x2279a4];return _0x27f559;};'use strict';var _=require(_0xb7c7('0x0'));var util=require(_0xb7c7('0x1'));var moment=require('moment');var BPromise=require(_0xb7c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7c7('0x3'));var db=require(_0xb7c7('0x4'))['db'];var utils=require(_0xb7c7('0x5'));var logger=require(_0xb7c7('0x6'))(_0xb7c7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb7c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47bc43,_0x4fa7dd,_0x508ead){return new BPromise(function(_0x458f9f,_0x5f9548){return client[_0xb7c7('0x9')](_0x47bc43,_0x508ead)[_0xb7c7('0xa')](function(_0x57d60f){logger[_0xb7c7('0xb')](_0xb7c7('0xc'),_0x4fa7dd,'request\x20sent');logger['debug'](_0xb7c7('0xd'),_0x4fa7dd,_0xb7c7('0xe'),JSON['stringify'](_0x57d60f));if(_0x57d60f[_0xb7c7('0xf')]){if(_0x57d60f[_0xb7c7('0xf')][_0xb7c7('0x10')]===0x1f4){logger[_0xb7c7('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4fa7dd,_0x57d60f[_0xb7c7('0xf')][_0xb7c7('0x11')]);return _0x5f9548(_0x57d60f[_0xb7c7('0xf')][_0xb7c7('0x11')]);}logger[_0xb7c7('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4fa7dd,_0x57d60f[_0xb7c7('0xf')][_0xb7c7('0x11')]);return _0x458f9f(_0x57d60f[_0xb7c7('0xf')][_0xb7c7('0x11')]);}else{logger[_0xb7c7('0xb')](_0xb7c7('0xc'),_0x4fa7dd,_0xb7c7('0xe'));_0x458f9f(_0x57d60f[_0xb7c7('0x12')][_0xb7c7('0x11')]);}})[_0xb7c7('0x13')](function(_0x470f33){logger['error'](_0xb7c7('0xc'),_0x4fa7dd,_0x470f33);_0x5f9548(_0x470f33);});});} \ No newline at end of file +var _0x7e7a=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x14a2ad,_0x428a5a){var _0x5a113c=function(_0x102a0c){while(--_0x102a0c){_0x14a2ad['push'](_0x14a2ad['shift']());}};_0x5a113c(++_0x428a5a);}(_0x7e7a,0x64));var _0xa7e7=function(_0x4d7819,_0xe84f12){_0x4d7819=_0x4d7819-0x0;var _0x5e811c=_0x7e7a[_0x4d7819];return _0x5e811c;};'use strict';var _=require(_0xa7e7('0x0'));var util=require(_0xa7e7('0x1'));var moment=require(_0xa7e7('0x2'));var BPromise=require(_0xa7e7('0x3'));var rs=require(_0xa7e7('0x4'));var fs=require('fs');var Redis=require(_0xa7e7('0x5'));var db=require(_0xa7e7('0x6'))['db'];var utils=require(_0xa7e7('0x7'));var logger=require(_0xa7e7('0x8'))(_0xa7e7('0x9'));var config=require(_0xa7e7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa7e7('0xb')][_0xa7e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb85faa,_0x554dd6,_0x19e986){return new BPromise(function(_0x407db9,_0x32bba3){return client['request'](_0xb85faa,_0x19e986)['then'](function(_0x12ba5b){logger[_0xa7e7('0xd')](_0xa7e7('0xe'),_0x554dd6,_0xa7e7('0xf'));logger[_0xa7e7('0x10')](_0xa7e7('0x11'),_0x554dd6,_0xa7e7('0xf'),JSON[_0xa7e7('0x12')](_0x12ba5b));if(_0x12ba5b[_0xa7e7('0x13')]){if(_0x12ba5b['error'][_0xa7e7('0x14')]===0x1f4){logger[_0xa7e7('0x13')](_0xa7e7('0xe'),_0x554dd6,_0x12ba5b[_0xa7e7('0x13')][_0xa7e7('0x15')]);return _0x32bba3(_0x12ba5b[_0xa7e7('0x13')][_0xa7e7('0x15')]);}logger[_0xa7e7('0x13')](_0xa7e7('0xe'),_0x554dd6,_0x12ba5b['error'][_0xa7e7('0x15')]);return _0x407db9(_0x12ba5b[_0xa7e7('0x13')][_0xa7e7('0x15')]);}else{logger[_0xa7e7('0xd')](_0xa7e7('0xe'),_0x554dd6,_0xa7e7('0xf'));_0x407db9(_0x12ba5b[_0xa7e7('0x16')][_0xa7e7('0x15')]);}})['catch'](function(_0x56f33c){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x554dd6,_0x56f33c);_0x32bba3(_0x56f33c);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 883486d..94b1882 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 _0x479e=['show','/:id/questions','getQuestions','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x479e,0x1d7));var _0xe479=function(_0x118a3e,_0x2e470f){_0x118a3e=_0x118a3e-0x0;var _0x37fb2d=_0x479e[_0x118a3e];return _0x37fb2d;};'use strict';var multer=require('multer');var util=require(_0xe479('0x0'));var path=require(_0xe479('0x1'));var timeout=require(_0xe479('0x2'));var express=require('express');var router=express[_0xe479('0x3')]();var fs_extra=require(_0xe479('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe479('0x5'));var config=require('../../config/environment');var controller=require(_0xe479('0x6'));router[_0xe479('0x7')]('/',auth['isAuthenticated'](),controller[_0xe479('0x8')]);router[_0xe479('0x7')]('/describe',auth[_0xe479('0x9')](),controller[_0xe479('0xa')]);router['get'](_0xe479('0xb'),auth[_0xe479('0x9')](),controller[_0xe479('0xc')]);router[_0xe479('0x7')](_0xe479('0xd'),auth[_0xe479('0x9')](),controller[_0xe479('0xe')]);router[_0xe479('0xf')]('/',auth[_0xe479('0x9')](),controller[_0xe479('0x10')]);router[_0xe479('0x11')](_0xe479('0xb'),auth[_0xe479('0x9')](),controller['update']);router[_0xe479('0x12')](_0xe479('0xb'),auth[_0xe479('0x9')](),controller[_0xe479('0x13')]);module[_0xe479('0x14')]=router; \ No newline at end of file +var _0xdcdb=['../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','getQuestions','create','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service'];(function(_0xfb75d2,_0x5b92c1){var _0x13173b=function(_0x5eb583){while(--_0x5eb583){_0xfb75d2['push'](_0xfb75d2['shift']());}};_0x13173b(++_0x5b92c1);}(_0xdcdb,0xaf));var _0xbdcd=function(_0x42e4dd,_0x51d43b){_0x42e4dd=_0x42e4dd-0x0;var _0x1b0e49=_0xdcdb[_0x42e4dd];return _0x1b0e49;};'use strict';var multer=require(_0xbdcd('0x0'));var util=require('util');var path=require(_0xbdcd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbdcd('0x2'));var router=express['Router']();var fs_extra=require(_0xbdcd('0x3'));var auth=require(_0xbdcd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbdcd('0x5'));var controller=require(_0xbdcd('0x6'));router['get']('/',auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x8')]);router[_0xbdcd('0x9')](_0xbdcd('0xa'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0xb')]);router[_0xbdcd('0x9')](_0xbdcd('0xc'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0xd')]);router[_0xbdcd('0x9')](_0xbdcd('0xe'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0xf')]);router['post']('/',auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x10')]);router['put']('/:id',auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x11')]);router[_0xbdcd('0x12')](_0xbdcd('0xc'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 52088bc..c4293fe 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 _0x275c=['starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x275c,0x70));var _0xc275=function(_0x1aeaa1,_0x1277cc){_0x1aeaa1=_0x1aeaa1-0x0;var _0x56347e=_0x275c[_0x1aeaa1];return _0x56347e;};'use strict';var moment=require(_0xc275('0x0'));var Sequelize=require(_0xc275('0x1'));module[_0xc275('0x2')]={'starttime':{'type':Sequelize[_0xc275('0x3')],'set':function(_0xc26e74){this[_0xc275('0x4')](_0xc275('0x5'),_0xc26e74);this[_0xc275('0x4')](_0xc275('0x6'),moment()['format'](_0xc275('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xc275('0x8')]},'projectname':{'type':Sequelize[_0xc275('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc275('0x8')]},'calleridname':{'type':Sequelize[_0xc275('0x8')]},'calleridnum':{'type':Sequelize[_0xc275('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8510=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','exports','setDataValue','starttime'];(function(_0x49835e,_0x3cfc98){var _0x3a7149=function(_0x327566){while(--_0x327566){_0x49835e['push'](_0x49835e['shift']());}};_0x3a7149(++_0x3cfc98);}(_0x8510,0xd5));var _0x0851=function(_0x3f807d,_0x32a3b1){_0x3f807d=_0x3f807d-0x0;var _0x45ad62=_0x8510[_0x3f807d];return _0x45ad62;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0851('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5d3241){this[_0x0851('0x1')](_0x0851('0x2'),_0x5d3241);this[_0x0851('0x1')]('endtime',moment()[_0x0851('0x3')](_0x0851('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x0851('0x5')]},'projectname':{'type':Sequelize[_0x0851('0x5')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0851('0x5')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0851('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 1b51524..31f7c6e 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 _0xe364=['merge','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','map','JscriptySessionReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x109ebe,_0x3bd081){var _0x41a17b=function(_0x2c8ae2){while(--_0x2c8ae2){_0x109ebe['push'](_0x109ebe['shift']());}};_0x41a17b(++_0x3bd081);}(_0xe364,0x183));var _0x4e36=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0xe364[_0xe30e17];return _0x2342c9;};'use strict';var emlformat=require(_0x4e36('0x0'));var rimraf=require(_0x4e36('0x1'));var zipdir=require(_0x4e36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e36('0x3'));var moment=require(_0x4e36('0x4'));var BPromise=require(_0x4e36('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4e36('0x6'));var sox=require(_0x4e36('0x7'));var csv=require(_0x4e36('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e36('0x9'));var squel=require(_0x4e36('0xa'));var crypto=require('crypto');var jsforce=require(_0x4e36('0xb'));var deskjs=require(_0x4e36('0xc'));var toCsv=require(_0x4e36('0x8'));var querystring=require(_0x4e36('0xd'));var Papa=require(_0x4e36('0xe'));var Redis=require(_0x4e36('0xf'));var authService=require(_0x4e36('0x10'));var qs=require(_0x4e36('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e36('0x12'));var logger=require(_0x4e36('0x13'))(_0x4e36('0x14'));var utils=require(_0x4e36('0x15'));var config=require(_0x4e36('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x542a34,_0x109795){_0x109795=_0x109795||0xcc;return function(_0x491942){if(_0x491942){return _0x542a34[_0x4e36('0x17')](_0x109795);}return _0x542a34['status'](_0x109795)[_0x4e36('0x18')]();};}function respondWithResult(_0x16b263,_0x3855cc){_0x3855cc=_0x3855cc||0xc8;return function(_0x538dd8){if(_0x538dd8){return _0x16b263[_0x4e36('0x19')](_0x3855cc)[_0x4e36('0x1a')](_0x538dd8);}};}function respondWithFilteredResult(_0x57e855,_0x12f2a3){return function(_0x130b14){if(_0x130b14){var _0x2e9226=typeof _0x12f2a3['offset']===_0x4e36('0x1b')&&typeof _0x12f2a3['limit']===_0x4e36('0x1b');var _0xfe5edd=_0x130b14[_0x4e36('0x1c')];var _0x29d309=_0x2e9226?0x0:_0x12f2a3[_0x4e36('0x1d')];var _0x1568eb=_0x2e9226?_0x130b14[_0x4e36('0x1c')]:_0x12f2a3['offset']+_0x12f2a3[_0x4e36('0x1e')];var _0x5086fb;if(_0x1568eb>=_0xfe5edd){_0x1568eb=_0xfe5edd;_0x5086fb=0xc8;}else{_0x5086fb=0xce;}_0x57e855[_0x4e36('0x19')](_0x5086fb);return _0x57e855['set'](_0x4e36('0x1f'),_0x29d309+'-'+_0x1568eb+'/'+_0xfe5edd)['json'](_0x130b14);}return null;};}function patchUpdates(_0x24c876){return function(_0x41dcd2){try{jsonpatch[_0x4e36('0x20')](_0x41dcd2,_0x24c876,!![]);}catch(_0x57ca47){return BPromise['reject'](_0x57ca47);}return _0x41dcd2[_0x4e36('0x21')]();};}function saveUpdates(_0x50d876,_0x584425){return function(_0x4c7c29){if(_0x4c7c29){return _0x4c7c29['update'](_0x50d876)[_0x4e36('0x22')](function(_0x11d6a8){return _0x11d6a8;});}return null;};}function removeEntity(_0x17a57f,_0x5a73b1){return function(_0x411420){if(_0x411420){return _0x411420[_0x4e36('0x23')]()[_0x4e36('0x22')](function(){_0x17a57f[_0x4e36('0x19')](0xcc)[_0x4e36('0x18')]();});}};}function handleEntityNotFound(_0x57f55a,_0x28a713){return function(_0x2aa275){if(!_0x2aa275){_0x57f55a[_0x4e36('0x17')](0x194);}return _0x2aa275;};}function handleError(_0x17fed7,_0x397cd2){_0x397cd2=_0x397cd2||0x1f4;return function(_0x5b7390){logger[_0x4e36('0x24')](_0x5b7390[_0x4e36('0x25')]);if(_0x5b7390[_0x4e36('0x26')]){delete _0x5b7390[_0x4e36('0x26')];}_0x17fed7[_0x4e36('0x19')](_0x397cd2)['send'](_0x5b7390);};}exports['index']=function(_0x320cd8,_0x1fe279){var _0x7e9cf8={},_0x5ebd76={},_0x3c7bca={'count':0x0,'rows':[]};var _0x2c1744=_[_0x4e36('0x27')](db[_0x4e36('0x28')][_0x4e36('0x29')],function(_0x759096){return{'name':_0x759096['fieldName'],'type':_0x759096[_0x4e36('0x2a')][_0x4e36('0x2b')]};});_0x5ebd76[_0x4e36('0x2c')]=_['map'](_0x2c1744,'name');_0x5ebd76[_0x4e36('0x2d')]=_['keys'](_0x320cd8[_0x4e36('0x2d')]);_0x5ebd76[_0x4e36('0x2e')]=_['intersection'](_0x5ebd76[_0x4e36('0x2c')],_0x5ebd76[_0x4e36('0x2d')]);_0x7e9cf8[_0x4e36('0x2f')]=_[_0x4e36('0x30')](_0x5ebd76[_0x4e36('0x2c')],qs[_0x4e36('0x31')](_0x320cd8['query']['fields']));_0x7e9cf8[_0x4e36('0x2f')]=_0x7e9cf8['attributes'][_0x4e36('0x32')]?_0x7e9cf8['attributes']:_0x5ebd76[_0x4e36('0x2c')];if(!_0x320cd8[_0x4e36('0x2d')][_0x4e36('0x33')](_0x4e36('0x34'))){_0x7e9cf8['limit']=qs[_0x4e36('0x1e')](_0x320cd8[_0x4e36('0x2d')]['limit']);_0x7e9cf8['offset']=qs[_0x4e36('0x1d')](_0x320cd8[_0x4e36('0x2d')][_0x4e36('0x1d')]);}_0x7e9cf8[_0x4e36('0x35')]=qs[_0x4e36('0x36')](_0x320cd8[_0x4e36('0x2d')][_0x4e36('0x36')]);_0x7e9cf8[_0x4e36('0x37')]=qs[_0x4e36('0x2e')](_[_0x4e36('0x38')](_0x320cd8[_0x4e36('0x2d')],_0x5ebd76[_0x4e36('0x2e')]),_0x2c1744);if(_0x320cd8[_0x4e36('0x2d')]['filter']){_0x7e9cf8[_0x4e36('0x37')]=_[_0x4e36('0x39')](_0x7e9cf8[_0x4e36('0x37')],{'$or':_[_0x4e36('0x27')](_0x2c1744,function(_0x89d918){if(_0x89d918['type']!=='VIRTUAL'){var _0x41452c={};_0x41452c[_0x89d918['name']]={'$like':'%'+_0x320cd8['query'][_0x4e36('0x3a')]+'%'};return _0x41452c;}})});}_0x7e9cf8=_[_0x4e36('0x39')]({},_0x7e9cf8,_0x320cd8['options']);var _0x29f46a={'where':_0x7e9cf8[_0x4e36('0x37')]};return db[_0x4e36('0x28')]['count'](_0x29f46a)[_0x4e36('0x22')](function(_0xefafff){_0x3c7bca[_0x4e36('0x1c')]=_0xefafff;if(_0x320cd8[_0x4e36('0x2d')][_0x4e36('0x3b')]){_0x7e9cf8[_0x4e36('0x3c')]=[{'all':!![]}];}return db[_0x4e36('0x28')][_0x4e36('0x3d')](_0x7e9cf8);})[_0x4e36('0x22')](function(_0x3efdaa){_0x3c7bca[_0x4e36('0x3e')]=_0x3efdaa;return _0x3c7bca;})[_0x4e36('0x22')](respondWithFilteredResult(_0x1fe279,_0x7e9cf8))[_0x4e36('0x3f')](handleError(_0x1fe279,null));};exports['show']=function(_0x45b0ae,_0x252aac){var _0x26ee7b={'raw':!![],'where':{'id':_0x45b0ae[_0x4e36('0x40')]['id']}},_0xdc9bad={};_0xdc9bad['model']=_[_0x4e36('0x41')](db[_0x4e36('0x28')][_0x4e36('0x29')]);_0xdc9bad[_0x4e36('0x2d')]=_[_0x4e36('0x41')](_0x45b0ae[_0x4e36('0x2d')]);_0xdc9bad[_0x4e36('0x2e')]=_[_0x4e36('0x30')](_0xdc9bad[_0x4e36('0x2c')],_0xdc9bad[_0x4e36('0x2d')]);_0x26ee7b['attributes']=_[_0x4e36('0x30')](_0xdc9bad[_0x4e36('0x2c')],qs[_0x4e36('0x31')](_0x45b0ae[_0x4e36('0x2d')][_0x4e36('0x31')]));_0x26ee7b[_0x4e36('0x2f')]=_0x26ee7b['attributes'][_0x4e36('0x32')]?_0x26ee7b[_0x4e36('0x2f')]:_0xdc9bad[_0x4e36('0x2c')];if(_0x45b0ae['query']['includeAll']){_0x26ee7b['include']=[{'all':!![]}];}_0x26ee7b=_[_0x4e36('0x39')]({},_0x26ee7b,_0x45b0ae[_0x4e36('0x42')]);return db[_0x4e36('0x28')][_0x4e36('0x43')](_0x26ee7b)[_0x4e36('0x22')](handleEntityNotFound(_0x252aac,null))['then'](respondWithResult(_0x252aac,null))['catch'](handleError(_0x252aac,null));};exports[_0x4e36('0x44')]=function(_0x3c54b8,_0x3d4aa9){return db[_0x4e36('0x28')][_0x4e36('0x44')](_0x3c54b8[_0x4e36('0x45')],{})[_0x4e36('0x22')](respondWithResult(_0x3d4aa9,0xc9))[_0x4e36('0x3f')](handleError(_0x3d4aa9,null));};exports['update']=function(_0x4de937,_0x546b9d){if(_0x4de937['body']['id']){delete _0x4de937[_0x4e36('0x45')]['id'];}return db[_0x4e36('0x28')][_0x4e36('0x43')]({'where':{'id':_0x4de937[_0x4e36('0x40')]['id']}})['then'](handleEntityNotFound(_0x546b9d,null))[_0x4e36('0x22')](saveUpdates(_0x4de937[_0x4e36('0x45')],null))['then'](respondWithResult(_0x546b9d,null))[_0x4e36('0x3f')](handleError(_0x546b9d,null));};exports['destroy']=function(_0x4bdb72,_0x6c0a8d){return db[_0x4e36('0x28')][_0x4e36('0x43')]({'where':{'id':_0x4bdb72[_0x4e36('0x40')]['id']}})[_0x4e36('0x22')](handleEntityNotFound(_0x6c0a8d,null))['then'](removeEntity(_0x6c0a8d,null))[_0x4e36('0x3f')](handleError(_0x6c0a8d,null));};exports['describe']=function(_0x31d3ab,_0x204ddd){return db[_0x4e36('0x28')]['describe']()[_0x4e36('0x22')](respondWithResult(_0x204ddd,null))['catch'](handleError(_0x204ddd,null));};exports[_0x4e36('0x46')]=function(_0x1639c4,_0x52557c,_0x50553f){var _0x175ec3={'raw':!![],'where':{}};var _0x21d00a={};var _0x14c7ea={'count':0x0,'rows':[]};return db[_0x4e36('0x28')][_0x4e36('0x47')]({'where':{'id':_0x1639c4[_0x4e36('0x40')]['id']}})['then'](handleEntityNotFound(_0x52557c,null))['then'](function(_0x68c50e){if(_0x68c50e){_0x21d00a[_0x4e36('0x2c')]=_[_0x4e36('0x41')](db[_0x4e36('0x48')][_0x4e36('0x29')]);_0x21d00a[_0x4e36('0x2d')]=_[_0x4e36('0x41')](_0x1639c4[_0x4e36('0x2d')]);_0x21d00a[_0x4e36('0x2e')]=_[_0x4e36('0x30')](_0x21d00a[_0x4e36('0x2c')],_0x21d00a[_0x4e36('0x2d')]);_0x175ec3['attributes']=_[_0x4e36('0x30')](_0x21d00a[_0x4e36('0x2c')],qs[_0x4e36('0x31')](_0x1639c4['query'][_0x4e36('0x31')]));_0x175ec3['attributes']=_0x175ec3[_0x4e36('0x2f')][_0x4e36('0x32')]?_0x175ec3['attributes']:_0x21d00a[_0x4e36('0x2c')];if(!_0x1639c4['query']['hasOwnProperty']('nolimit')){_0x175ec3[_0x4e36('0x1e')]=qs[_0x4e36('0x1e')](_0x1639c4[_0x4e36('0x2d')]['limit']);_0x175ec3[_0x4e36('0x1d')]=qs[_0x4e36('0x1d')](_0x1639c4[_0x4e36('0x2d')]['offset']);}_0x175ec3['order']=qs['sort'](_0x1639c4[_0x4e36('0x2d')][_0x4e36('0x36')]);_0x175ec3['where']=qs[_0x4e36('0x2e')](_[_0x4e36('0x38')](_0x1639c4['query'],_0x21d00a[_0x4e36('0x2e')]));_0x175ec3[_0x4e36('0x37')][_0x4e36('0x49')]=_0x68c50e['id'];if(_0x1639c4[_0x4e36('0x2d')][_0x4e36('0x3a')]){_0x175ec3[_0x4e36('0x37')]=_[_0x4e36('0x39')](_0x175ec3[_0x4e36('0x37')],{'$or':_[_0x4e36('0x27')](_0x175ec3[_0x4e36('0x2f')],function(_0xa3d557){var _0x1d31f7={};_0x1d31f7[_0xa3d557]={'$like':'%'+_0x1639c4[_0x4e36('0x2d')][_0x4e36('0x3a')]+'%'};return _0x1d31f7;})});}_0x175ec3=_[_0x4e36('0x39')]({},_0x175ec3,_0x1639c4[_0x4e36('0x42')]);return db[_0x4e36('0x48')][_0x4e36('0x1c')]({'where':_0x175ec3[_0x4e36('0x37')]})[_0x4e36('0x22')](function(_0x222559){_0x14c7ea[_0x4e36('0x1c')]=_0x222559;if(_0x1639c4[_0x4e36('0x2d')][_0x4e36('0x3b')]){_0x175ec3[_0x4e36('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4e36('0x3d')](_0x175ec3);})[_0x4e36('0x22')](function(_0x25d560){_0x14c7ea['rows']=_0x25d560;return _0x14c7ea;});}})[_0x4e36('0x22')](respondWithFilteredResult(_0x52557c,_0x175ec3))[_0x4e36('0x3f')](handleError(_0x52557c,null));}; \ No newline at end of file +var _0x1124=['VIRTUAL','merge','findAll','catch','show','params','includeAll','include','options','find','create','body','update','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','rows','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','name','send','JscriptySessionReport','rawAttributes','type','map','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filter'];(function(_0x2fe7b0,_0x21869d){var _0x5dcb21=function(_0xae0360){while(--_0xae0360){_0x2fe7b0['push'](_0x2fe7b0['shift']());}};_0x5dcb21(++_0x21869d);}(_0x1124,0x1ef));var _0x4112=function(_0x5cc63b,_0x359a94){_0x5cc63b=_0x5cc63b-0x0;var _0x2e7d2d=_0x1124[_0x5cc63b];return _0x2e7d2d;};'use strict';var emlformat=require(_0x4112('0x0'));var rimraf=require(_0x4112('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4112('0x2'));var moment=require(_0x4112('0x3'));var BPromise=require(_0x4112('0x4'));var Mustache=require(_0x4112('0x5'));var util=require(_0x4112('0x6'));var path=require('path');var sox=require(_0x4112('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4112('0x8'));var _=require(_0x4112('0x9'));var squel=require(_0x4112('0xa'));var crypto=require('crypto');var jsforce=require(_0x4112('0xb'));var deskjs=require(_0x4112('0xc'));var toCsv=require(_0x4112('0xd'));var querystring=require('querystring');var Papa=require(_0x4112('0xe'));var Redis=require(_0x4112('0xf'));var authService=require(_0x4112('0x10'));var qs=require(_0x4112('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4112('0x12'));var logger=require(_0x4112('0x13'))(_0x4112('0x14'));var utils=require(_0x4112('0x15'));var config=require(_0x4112('0x16'));var licenseUtil=require(_0x4112('0x17'));var db=require(_0x4112('0x18'))['db'];function respondWithStatusCode(_0x58f725,_0x8aaa92){_0x8aaa92=_0x8aaa92||0xcc;return function(_0x13224b){if(_0x13224b){return _0x58f725[_0x4112('0x19')](_0x8aaa92);}return _0x58f725['status'](_0x8aaa92)[_0x4112('0x1a')]();};}function respondWithResult(_0x5b9e35,_0x37ab76){_0x37ab76=_0x37ab76||0xc8;return function(_0x502e9c){if(_0x502e9c){return _0x5b9e35[_0x4112('0x1b')](_0x37ab76)[_0x4112('0x1c')](_0x502e9c);}};}function respondWithFilteredResult(_0x476939,_0x3f37f2){return function(_0x13471b){if(_0x13471b){var _0x48d397=typeof _0x3f37f2[_0x4112('0x1d')]===_0x4112('0x1e')&&typeof _0x3f37f2[_0x4112('0x1f')]===_0x4112('0x1e');var _0x1ec5a0=_0x13471b[_0x4112('0x20')];var _0x216c04=_0x48d397?0x0:_0x3f37f2['offset'];var _0x43477e=_0x48d397?_0x13471b[_0x4112('0x20')]:_0x3f37f2[_0x4112('0x1d')]+_0x3f37f2[_0x4112('0x1f')];var _0x41df81;if(_0x43477e>=_0x1ec5a0){_0x43477e=_0x1ec5a0;_0x41df81=0xc8;}else{_0x41df81=0xce;}_0x476939[_0x4112('0x1b')](_0x41df81);return _0x476939['set'](_0x4112('0x21'),_0x216c04+'-'+_0x43477e+'/'+_0x1ec5a0)[_0x4112('0x1c')](_0x13471b);}return null;};}function patchUpdates(_0x33f3a9){return function(_0x2535eb){try{jsonpatch[_0x4112('0x22')](_0x2535eb,_0x33f3a9,!![]);}catch(_0x42aa33){return BPromise['reject'](_0x42aa33);}return _0x2535eb[_0x4112('0x23')]();};}function saveUpdates(_0x20c043,_0x58878f){return function(_0x116386){if(_0x116386){return _0x116386['update'](_0x20c043)[_0x4112('0x24')](function(_0x4d0ffc){return _0x4d0ffc;});}return null;};}function removeEntity(_0x2a068a,_0x4c5219){return function(_0x93e3ac){if(_0x93e3ac){return _0x93e3ac['destroy']()[_0x4112('0x24')](function(){_0x2a068a[_0x4112('0x1b')](0xcc)[_0x4112('0x1a')]();});}};}function handleEntityNotFound(_0x21b166,_0xeaef44){return function(_0x394f68){if(!_0x394f68){_0x21b166[_0x4112('0x19')](0x194);}return _0x394f68;};}function handleError(_0x55290a,_0x2a1d7b){_0x2a1d7b=_0x2a1d7b||0x1f4;return function(_0x33db8f){logger[_0x4112('0x25')](_0x33db8f['stack']);if(_0x33db8f[_0x4112('0x26')]){delete _0x33db8f[_0x4112('0x26')];}_0x55290a[_0x4112('0x1b')](_0x2a1d7b)[_0x4112('0x27')](_0x33db8f);};}exports['index']=function(_0xbe2acc,_0x55fe7a){var _0x1ac9b7={},_0x3dd403={},_0x59f17c={'count':0x0,'rows':[]};var _0x1ca261=_['map'](db[_0x4112('0x28')][_0x4112('0x29')],function(_0x7279c3){return{'name':_0x7279c3['fieldName'],'type':_0x7279c3[_0x4112('0x2a')]['key']};});_0x3dd403['model']=_[_0x4112('0x2b')](_0x1ca261,_0x4112('0x26'));_0x3dd403[_0x4112('0x2c')]=_[_0x4112('0x2d')](_0xbe2acc[_0x4112('0x2c')]);_0x3dd403[_0x4112('0x2e')]=_[_0x4112('0x2f')](_0x3dd403['model'],_0x3dd403['query']);_0x1ac9b7[_0x4112('0x30')]=_[_0x4112('0x2f')](_0x3dd403['model'],qs[_0x4112('0x31')](_0xbe2acc[_0x4112('0x2c')]['fields']));_0x1ac9b7['attributes']=_0x1ac9b7[_0x4112('0x30')][_0x4112('0x32')]?_0x1ac9b7['attributes']:_0x3dd403[_0x4112('0x33')];if(!_0xbe2acc[_0x4112('0x2c')]['hasOwnProperty'](_0x4112('0x34'))){_0x1ac9b7[_0x4112('0x1f')]=qs[_0x4112('0x1f')](_0xbe2acc['query']['limit']);_0x1ac9b7['offset']=qs[_0x4112('0x1d')](_0xbe2acc[_0x4112('0x2c')]['offset']);}_0x1ac9b7[_0x4112('0x35')]=qs['sort'](_0xbe2acc[_0x4112('0x2c')][_0x4112('0x36')]);_0x1ac9b7[_0x4112('0x37')]=qs[_0x4112('0x2e')](_[_0x4112('0x38')](_0xbe2acc[_0x4112('0x2c')],_0x3dd403[_0x4112('0x2e')]),_0x1ca261);if(_0xbe2acc[_0x4112('0x2c')][_0x4112('0x39')]){_0x1ac9b7[_0x4112('0x37')]=_['merge'](_0x1ac9b7['where'],{'$or':_[_0x4112('0x2b')](_0x1ca261,function(_0x54d67f){if(_0x54d67f['type']!==_0x4112('0x3a')){var _0x5d0826={};_0x5d0826[_0x54d67f[_0x4112('0x26')]]={'$like':'%'+_0xbe2acc['query'][_0x4112('0x39')]+'%'};return _0x5d0826;}})});}_0x1ac9b7=_[_0x4112('0x3b')]({},_0x1ac9b7,_0xbe2acc['options']);var _0x5768fc={'where':_0x1ac9b7[_0x4112('0x37')]};return db['JscriptySessionReport'][_0x4112('0x20')](_0x5768fc)[_0x4112('0x24')](function(_0x519cc6){_0x59f17c[_0x4112('0x20')]=_0x519cc6;if(_0xbe2acc[_0x4112('0x2c')]['includeAll']){_0x1ac9b7['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4112('0x3c')](_0x1ac9b7);})[_0x4112('0x24')](function(_0x279299){_0x59f17c['rows']=_0x279299;return _0x59f17c;})[_0x4112('0x24')](respondWithFilteredResult(_0x55fe7a,_0x1ac9b7))[_0x4112('0x3d')](handleError(_0x55fe7a,null));};exports[_0x4112('0x3e')]=function(_0x4f963e,_0x18ddff){var _0x4abf65={'raw':!![],'where':{'id':_0x4f963e[_0x4112('0x3f')]['id']}},_0x42604a={};_0x42604a[_0x4112('0x33')]=_[_0x4112('0x2d')](db[_0x4112('0x28')][_0x4112('0x29')]);_0x42604a['query']=_[_0x4112('0x2d')](_0x4f963e[_0x4112('0x2c')]);_0x42604a['filters']=_[_0x4112('0x2f')](_0x42604a[_0x4112('0x33')],_0x42604a['query']);_0x4abf65['attributes']=_[_0x4112('0x2f')](_0x42604a[_0x4112('0x33')],qs[_0x4112('0x31')](_0x4f963e[_0x4112('0x2c')]['fields']));_0x4abf65[_0x4112('0x30')]=_0x4abf65['attributes'][_0x4112('0x32')]?_0x4abf65['attributes']:_0x42604a['model'];if(_0x4f963e[_0x4112('0x2c')][_0x4112('0x40')]){_0x4abf65[_0x4112('0x41')]=[{'all':!![]}];}_0x4abf65=_[_0x4112('0x3b')]({},_0x4abf65,_0x4f963e[_0x4112('0x42')]);return db[_0x4112('0x28')][_0x4112('0x43')](_0x4abf65)[_0x4112('0x24')](handleEntityNotFound(_0x18ddff,null))['then'](respondWithResult(_0x18ddff,null))[_0x4112('0x3d')](handleError(_0x18ddff,null));};exports[_0x4112('0x44')]=function(_0x37df34,_0x21fbac){return db[_0x4112('0x28')]['create'](_0x37df34[_0x4112('0x45')],{})[_0x4112('0x24')](respondWithResult(_0x21fbac,0xc9))[_0x4112('0x3d')](handleError(_0x21fbac,null));};exports[_0x4112('0x46')]=function(_0x37188e,_0x206806){if(_0x37188e[_0x4112('0x45')]['id']){delete _0x37188e[_0x4112('0x45')]['id'];}return db['JscriptySessionReport'][_0x4112('0x43')]({'where':{'id':_0x37188e[_0x4112('0x3f')]['id']}})[_0x4112('0x24')](handleEntityNotFound(_0x206806,null))[_0x4112('0x24')](saveUpdates(_0x37188e[_0x4112('0x45')],null))[_0x4112('0x24')](respondWithResult(_0x206806,null))[_0x4112('0x3d')](handleError(_0x206806,null));};exports[_0x4112('0x47')]=function(_0x18ca7d,_0x1cb81a){return db['JscriptySessionReport'][_0x4112('0x43')]({'where':{'id':_0x18ca7d[_0x4112('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cb81a,null))[_0x4112('0x24')](removeEntity(_0x1cb81a,null))[_0x4112('0x3d')](handleError(_0x1cb81a,null));};exports['describe']=function(_0x24133a,_0x4f2ecd){return db['JscriptySessionReport'][_0x4112('0x48')]()[_0x4112('0x24')](respondWithResult(_0x4f2ecd,null))['catch'](handleError(_0x4f2ecd,null));};exports[_0x4112('0x49')]=function(_0x3c914f,_0x50da6b,_0x2b4741){var _0x4deb7d={'raw':!![],'where':{}};var _0x1e7a10={};var _0x23a4e6={'count':0x0,'rows':[]};return db[_0x4112('0x28')][_0x4112('0x4a')]({'where':{'id':_0x3c914f[_0x4112('0x3f')]['id']}})[_0x4112('0x24')](handleEntityNotFound(_0x50da6b,null))[_0x4112('0x24')](function(_0x27b59c){if(_0x27b59c){_0x1e7a10['model']=_[_0x4112('0x2d')](db[_0x4112('0x4b')][_0x4112('0x29')]);_0x1e7a10['query']=_[_0x4112('0x2d')](_0x3c914f[_0x4112('0x2c')]);_0x1e7a10[_0x4112('0x2e')]=_[_0x4112('0x2f')](_0x1e7a10[_0x4112('0x33')],_0x1e7a10[_0x4112('0x2c')]);_0x4deb7d['attributes']=_[_0x4112('0x2f')](_0x1e7a10[_0x4112('0x33')],qs[_0x4112('0x31')](_0x3c914f[_0x4112('0x2c')][_0x4112('0x31')]));_0x4deb7d[_0x4112('0x30')]=_0x4deb7d[_0x4112('0x30')][_0x4112('0x32')]?_0x4deb7d[_0x4112('0x30')]:_0x1e7a10[_0x4112('0x33')];if(!_0x3c914f[_0x4112('0x2c')][_0x4112('0x4c')](_0x4112('0x34'))){_0x4deb7d[_0x4112('0x1f')]=qs['limit'](_0x3c914f['query'][_0x4112('0x1f')]);_0x4deb7d[_0x4112('0x1d')]=qs[_0x4112('0x1d')](_0x3c914f[_0x4112('0x2c')]['offset']);}_0x4deb7d['order']=qs[_0x4112('0x36')](_0x3c914f['query'][_0x4112('0x36')]);_0x4deb7d[_0x4112('0x37')]=qs['filters'](_[_0x4112('0x38')](_0x3c914f[_0x4112('0x2c')],_0x1e7a10[_0x4112('0x2e')]));_0x4deb7d[_0x4112('0x37')][_0x4112('0x4d')]=_0x27b59c['id'];if(_0x3c914f[_0x4112('0x2c')][_0x4112('0x39')]){_0x4deb7d[_0x4112('0x37')]=_[_0x4112('0x3b')](_0x4deb7d[_0x4112('0x37')],{'$or':_[_0x4112('0x2b')](_0x4deb7d[_0x4112('0x30')],function(_0x372d2d){var _0x5227c4={};_0x5227c4[_0x372d2d]={'$like':'%'+_0x3c914f['query'][_0x4112('0x39')]+'%'};return _0x5227c4;})});}_0x4deb7d=_['merge']({},_0x4deb7d,_0x3c914f[_0x4112('0x42')]);return db[_0x4112('0x4b')]['count']({'where':_0x4deb7d[_0x4112('0x37')]})[_0x4112('0x24')](function(_0x454250){_0x23a4e6[_0x4112('0x20')]=_0x454250;if(_0x3c914f['query']['includeAll']){_0x4deb7d['include']=[{'all':!![]}];}return db[_0x4112('0x4b')][_0x4112('0x3c')](_0x4deb7d);})['then'](function(_0x48b718){_0x23a4e6[_0x4112('0x4e')]=_0x48b718;return _0x23a4e6;});}})[_0x4112('0x24')](respondWithFilteredResult(_0x50da6b,_0x4deb7d))[_0x4112('0x3d')](handleError(_0x50da6b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 89bee54..f7682d7 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 _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e2349,_0x164391){var _0x5dae7c=function(_0x163d0f){while(--_0x163d0f){_0x5e2349['push'](_0x5e2349['shift']());}};_0x5dae7c(++_0x164391);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x14691b,_0x2420b7){_0x14691b=_0x14691b-0x0;var _0x1bda9c=_0xaa3f[_0x14691b];return _0x1bda9c;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd59=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x5d7142,_0x2ddd15){var _0x1eac09=function(_0x5ffb02){while(--_0x5ffb02){_0x5d7142['push'](_0x5d7142['shift']());}};_0x1eac09(++_0x2ddd15);}(_0xcd59,0x14b));var _0x9cd5=function(_0x23bf7f,_0x578f6c){_0x23bf7f=_0x23bf7f-0x0;var _0x64b00e=_0xcd59[_0x23bf7f];return _0x64b00e;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'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 abb70c6..1451931 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x14a67e,_0xb1c7bb){var _0x2a6bab=function(_0x1bbd5d){while(--_0x1bbd5d){_0x14a67e['push'](_0x14a67e['shift']());}};_0x2a6bab(++_0xb1c7bb);}(_0xdb28,0x106));var _0x8db2=function(_0x528924,_0xb823a6){_0x528924=_0x528924-0x0;var _0x59f8dd=_0xdb28[_0x528924];return _0x59f8dd;};'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')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x627e=['request','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0xb09883,_0x45841d){var _0x415ea8=function(_0x17ac95){while(--_0x17ac95){_0xb09883['push'](_0xb09883['shift']());}};_0x415ea8(++_0x45841d);}(_0x627e,0x14a));var _0xe627=function(_0x244f56,_0x21e76b){_0x244f56=_0x244f56-0x0;var _0x1e16b1=_0x627e[_0x244f56];return _0x1e16b1;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 33051af..d6d2561 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 _0x0f89=['isAuthenticated','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','index','put','/:id'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x0f89,0x111));var _0x90f8=function(_0x187fa7,_0xe92f80){_0x187fa7=_0x187fa7-0x0;var _0x2d7ecb=_0x0f89[_0x187fa7];return _0x2d7ecb;};'use strict';var multer=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var path=require(_0x90f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x90f8('0x3'));var router=express[_0x90f8('0x4')]();var fs_extra=require(_0x90f8('0x5'));var auth=require(_0x90f8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x90f8('0x7'));var controller=require(_0x90f8('0x8'));router['get']('/',controller[_0x90f8('0x9')]);router[_0x90f8('0xa')](_0x90f8('0xb'),auth[_0x90f8('0xc')](),controller[_0x90f8('0xd')]);module[_0x90f8('0xe')]=router; \ No newline at end of file +var _0x2383=['Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express'];(function(_0x4d0a22,_0x1c100e){var _0xc175cf=function(_0x4d4163){while(--_0x4d4163){_0x4d0a22['push'](_0x4d0a22['shift']());}};_0xc175cf(++_0x1c100e);}(_0x2383,0xb2));var _0x3238=function(_0x515090,_0x4c0240){_0x515090=_0x515090-0x0;var _0x4de7bd=_0x2383[_0x515090];return _0x4de7bd;};'use strict';var multer=require(_0x3238('0x0'));var util=require(_0x3238('0x1'));var path=require('path');var timeout=require(_0x3238('0x2'));var express=require(_0x3238('0x3'));var router=express[_0x3238('0x4')]();var fs_extra=require(_0x3238('0x5'));var auth=require(_0x3238('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x3238('0x7')]('/',controller[_0x3238('0x8')]);router['put'](_0x3238('0x9'),auth[_0x3238('0xa')](),controller[_0x3238('0xb')]);module[_0x3238('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 33320cb..49459cd 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 _0xd02e=['INTEGER','exports','STRING'];(function(_0x1cf629,_0x4a070a){var _0x581d42=function(_0x58a87b){while(--_0x58a87b){_0x1cf629['push'](_0x1cf629['shift']());}};_0x581d42(++_0x4a070a);}(_0xd02e,0x91));var _0xed02=function(_0x589aa0,_0x210a74){_0x589aa0=_0x589aa0-0x0;var _0x44fd8d=_0xd02e[_0x589aa0];return _0x44fd8d;};'use strict';var Sequelize=require('sequelize');module[_0xed02('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xed02('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xed02('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f49=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x4732be,_0x3ae7e1){var _0x5ed834=function(_0x4c6510){while(--_0x4c6510){_0x4732be['push'](_0x4732be['shift']());}};_0x5ed834(++_0x3ae7e1);}(_0x6f49,0x9a));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x96f4('0x0'));module[_0x96f4('0x1')]={'license':{'type':Sequelize[_0x96f4('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x96f4('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x96f4('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index d1e6946..c11c8cd 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x9eafb,_0x125c65){var _0x1f14b6=function(_0x5f43c4){while(--_0x5f43c4){_0x9eafb['push'](_0x9eafb['shift']());}};_0x1f14b6(++_0x125c65);}(_0x1261,0x144));var _0x1126=function(_0x26cab7,_0x1ccfca){_0x26cab7=_0x26cab7-0x0;var _0x31ba06=_0x1261[_0x26cab7];return _0x31ba06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f2e5e90..3ac80cf 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 _0x9599=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','lodash','../../config/logger','api'];(function(_0x9c3c94,_0x296e5a){var _0x598937=function(_0x2e3c3b){while(--_0x2e3c3b){_0x9c3c94['push'](_0x9c3c94['shift']());}};_0x598937(++_0x296e5a);}(_0x9599,0x81));var _0x9959=function(_0x2111bc,_0x2d65d5){_0x2111bc=_0x2111bc-0x0;var _0x1ff93b=_0x9599[_0x2111bc];return _0x1ff93b;};'use strict';var _=require(_0x9959('0x0'));var util=require('util');var logger=require(_0x9959('0x1'))(_0x9959('0x2'));var moment=require(_0x9959('0x3'));var BPromise=require(_0x9959('0x4'));var rp=require(_0x9959('0x5'));var fs=require('fs');var path=require(_0x9959('0x6'));var rimraf=require(_0x9959('0x7'));var config=require(_0x9959('0x8'));var attributes=require(_0x9959('0x9'));module[_0x9959('0xa')]=function(_0x4e6e96,_0x5cbd8a){return _0x4e6e96['define'](_0x9959('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc72e=['moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api'];(function(_0x29f5cc,_0x291966){var _0x35b22f=function(_0x3efb61){while(--_0x3efb61){_0x29f5cc['push'](_0x29f5cc['shift']());}};_0x35b22f(++_0x291966);}(_0xc72e,0x168));var _0xec72=function(_0x33cf5e,_0x25bfa4){_0x33cf5e=_0x33cf5e-0x0;var _0x176885=_0xc72e[_0x33cf5e];return _0x176885;};'use strict';var _=require(_0xec72('0x0'));var util=require(_0xec72('0x1'));var logger=require(_0xec72('0x2'))(_0xec72('0x3'));var moment=require(_0xec72('0x4'));var BPromise=require(_0xec72('0x5'));var rp=require(_0xec72('0x6'));var fs=require('fs');var path=require(_0xec72('0x7'));var rimraf=require(_0xec72('0x8'));var config=require('../../config/environment');var attributes=require(_0xec72('0x9'));module[_0xec72('0xa')]=function(_0x3c53c0,_0x51b6d5){return _0x3c53c0[_0xec72('0xb')](_0xec72('0xc'),attributes,{'tableName':_0xec72('0xd'),'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 3657d77..ad6c605 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 _0x1230=['jayson/promise','http','request','then','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2a187e,_0xb1d101){var _0x1bee7a=function(_0x21bfda){while(--_0x21bfda){_0x2a187e['push'](_0x2a187e['shift']());}};_0x1bee7a(++_0xb1d101);}(_0x1230,0x10b));var _0x0123=function(_0x5e97a5,_0x7c9f6b){_0x5e97a5=_0x5e97a5-0x0;var _0x31d269=_0x1230[_0x5e97a5];return _0x31d269;};'use strict';var _=require(_0x0123('0x0'));var util=require(_0x0123('0x1'));var moment=require(_0x0123('0x2'));var BPromise=require(_0x0123('0x3'));var rs=require(_0x0123('0x4'));var fs=require('fs');var Redis=require(_0x0123('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0123('0x6'));var logger=require(_0x0123('0x7'))('rpc');var config=require(_0x0123('0x8'));var jayson=require(_0x0123('0x9'));var client=jayson['client'][_0x0123('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52f9e4,_0x281e72,_0x379229){return new BPromise(function(_0x5a8e55,_0x103c03){return client[_0x0123('0xb')](_0x52f9e4,_0x379229)[_0x0123('0xc')](function(_0x4e122d){logger['info'](_0x0123('0xd'),_0x281e72,'request\x20sent');logger['debug'](_0x0123('0xe'),_0x281e72,_0x0123('0xf'),JSON[_0x0123('0x10')](_0x4e122d));if(_0x4e122d['error']){if(_0x4e122d[_0x0123('0x11')][_0x0123('0x12')]===0x1f4){logger['error'](_0x0123('0xd'),_0x281e72,_0x4e122d[_0x0123('0x11')][_0x0123('0x13')]);return _0x103c03(_0x4e122d['error'][_0x0123('0x13')]);}logger[_0x0123('0x11')](_0x0123('0xd'),_0x281e72,_0x4e122d['error'][_0x0123('0x13')]);return _0x5a8e55(_0x4e122d['error'][_0x0123('0x13')]);}else{logger[_0x0123('0x14')](_0x0123('0xd'),_0x281e72,_0x0123('0xf'));_0x5a8e55(_0x4e122d[_0x0123('0x15')][_0x0123('0x13')]);}})[_0x0123('0x16')](function(_0x23d43e){logger[_0x0123('0x11')](_0x0123('0xd'),_0x281e72,_0x23d43e);_0x103c03(_0x23d43e);});});} \ No newline at end of file +var _0xa134=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbb4bfe,_0x266320){var _0xa20b0d=function(_0xf9aa7f){while(--_0xf9aa7f){_0xbb4bfe['push'](_0xbb4bfe['shift']());}};_0xa20b0d(++_0x266320);}(_0xa134,0xb5));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a13('0x1'));var rs=require(_0x4a13('0x2'));var fs=require('fs');var Redis=require(_0x4a13('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a13('0x4'));var config=require(_0x4a13('0x5'));var jayson=require(_0x4a13('0x6'));var client=jayson[_0x4a13('0x7')][_0x4a13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x306a97,_0x45d0a1,_0x1d3011){return new BPromise(function(_0x336f47,_0x44d0fd){return client[_0x4a13('0x9')](_0x306a97,_0x1d3011)[_0x4a13('0xa')](function(_0x32c75e){logger[_0x4a13('0xb')](_0x4a13('0xc'),_0x45d0a1,_0x4a13('0xd'));logger[_0x4a13('0xe')](_0x4a13('0xf'),_0x45d0a1,_0x4a13('0xd'),JSON[_0x4a13('0x10')](_0x32c75e));if(_0x32c75e[_0x4a13('0x11')]){if(_0x32c75e[_0x4a13('0x11')][_0x4a13('0x12')]===0x1f4){logger[_0x4a13('0x11')](_0x4a13('0xc'),_0x45d0a1,_0x32c75e[_0x4a13('0x11')][_0x4a13('0x13')]);return _0x44d0fd(_0x32c75e[_0x4a13('0x11')][_0x4a13('0x13')]);}logger['error'](_0x4a13('0xc'),_0x45d0a1,_0x32c75e[_0x4a13('0x11')]['message']);return _0x336f47(_0x32c75e[_0x4a13('0x11')][_0x4a13('0x13')]);}else{logger[_0x4a13('0xb')](_0x4a13('0xc'),_0x45d0a1,_0x4a13('0xd'));_0x336f47(_0x32c75e[_0x4a13('0x14')][_0x4a13('0x13')]);}})[_0x4a13('0x15')](function(_0x573f8a){logger[_0x4a13('0x11')](_0x4a13('0xc'),_0x45d0a1,_0x573f8a);_0x44d0fd(_0x573f8a);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 49a9f6d..be57933 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 _0x8f63=['put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/:id','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents'];(function(_0x5bd4fc,_0x4fbd8c){var _0x14b56e=function(_0x361e5c){while(--_0x361e5c){_0x5bd4fc['push'](_0x5bd4fc['shift']());}};_0x14b56e(++_0x4fbd8c);}(_0x8f63,0xc1));var _0x38f6=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x8f63[_0x16938f];return _0x5c66e9;};'use strict';var multer=require(_0x38f6('0x0'));var util=require(_0x38f6('0x1'));var path=require(_0x38f6('0x2'));var timeout=require(_0x38f6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x38f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38f6('0x5'));var config=require('../../config/environment');var controller=require(_0x38f6('0x6'));router[_0x38f6('0x7')]('/',auth[_0x38f6('0x8')](),controller[_0x38f6('0x9')]);router[_0x38f6('0x7')]('/describe',auth[_0x38f6('0x8')](),controller['describe']);router['get'](_0x38f6('0xa'),auth[_0x38f6('0x8')](),controller['show']);router[_0x38f6('0x7')]('/:id/dispositions',auth[_0x38f6('0x8')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x38f6('0x8')](),controller['getAnswers']);router[_0x38f6('0x7')](_0x38f6('0xb'),auth[_0x38f6('0x8')](),controller[_0x38f6('0xc')]);router[_0x38f6('0x7')](_0x38f6('0xd'),auth[_0x38f6('0x8')](),controller[_0x38f6('0xe')]);router[_0x38f6('0x7')](_0x38f6('0xf'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x10')]);router[_0x38f6('0x7')](_0x38f6('0x11'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x12')]);router[_0x38f6('0x7')](_0x38f6('0x13'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x14')]);router['get'](_0x38f6('0x15'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x16')]);router[_0x38f6('0x7')](_0x38f6('0x17'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x18')]);router[_0x38f6('0x19')](_0x38f6('0x1a'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x1b')]);router['post'](_0x38f6('0x1c'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x1d')]);router[_0x38f6('0x19')]('/',auth[_0x38f6('0x8')](),controller[_0x38f6('0x1e')]);router[_0x38f6('0x19')](_0x38f6('0xb'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x1f')]);router[_0x38f6('0x19')](_0x38f6('0xd'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x20')]);router['post']('/:id/interactions',auth[_0x38f6('0x8')](),controller[_0x38f6('0x21')]);router[_0x38f6('0x19')](_0x38f6('0x11'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x22')]);router[_0x38f6('0x19')]('/:id/send',auth[_0x38f6('0x8')](),controller[_0x38f6('0x23')]);router[_0x38f6('0x19')]('/:id/users',auth[_0x38f6('0x8')](),controller[_0x38f6('0x24')]);router[_0x38f6('0x25')](_0x38f6('0xa'),auth['isAuthenticated'](),controller[_0x38f6('0x26')]);router['delete'](_0x38f6('0x1a'),auth[_0x38f6('0x8')](),controller['removeDispositions']);router[_0x38f6('0x27')](_0x38f6('0x1c'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x28')]);router['delete'](_0x38f6('0xb'),auth['isAuthenticated'](),controller[_0x38f6('0x29')]);router['delete'](_0x38f6('0xd'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x2a')]);router[_0x38f6('0x27')]('/:id',auth[_0x38f6('0x8')](),controller[_0x38f6('0x2b')]);router['delete'](_0x38f6('0x17'),auth[_0x38f6('0x8')](),controller[_0x38f6('0x2c')]);module[_0x38f6('0x2d')]=router; \ No newline at end of file +var _0x13f2=['/:id/in_servers','getImap','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','getAgents','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','/:id/send','send','addAgents','update','delete','/:id/dispositions','removeImap','/:id/out_servers','removeSmtp','/:id/users','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x27669b,_0x306a2c){var _0x31ed6e=function(_0x1a6b6c){while(--_0x1a6b6c){_0x27669b['push'](_0x27669b['shift']());}};_0x31ed6e(++_0x306a2c);}(_0x13f2,0x142));var _0x213f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13f2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x213f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x213f('0x1'));var router=express['Router']();var fs_extra=require(_0x213f('0x2'));var auth=require(_0x213f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x213f('0x4'));var controller=require(_0x213f('0x5'));router[_0x213f('0x6')]('/',auth['isAuthenticated'](),controller[_0x213f('0x7')]);router[_0x213f('0x6')]('/describe',auth[_0x213f('0x8')](),controller['describe']);router[_0x213f('0x6')](_0x213f('0x9'),auth['isAuthenticated'](),controller[_0x213f('0xa')]);router[_0x213f('0x6')]('/:id/dispositions',auth[_0x213f('0x8')](),controller[_0x213f('0xb')]);router[_0x213f('0x6')](_0x213f('0xc'),auth['isAuthenticated'](),controller[_0x213f('0xd')]);router[_0x213f('0x6')](_0x213f('0xe'),auth['isAuthenticated'](),controller[_0x213f('0xf')]);router[_0x213f('0x6')]('/:id/out_servers',auth[_0x213f('0x8')](),controller['getSmtp']);router['get']('/:id/interactions',auth[_0x213f('0x8')](),controller[_0x213f('0x10')]);router[_0x213f('0x6')](_0x213f('0x11'),auth[_0x213f('0x8')](),controller[_0x213f('0x12')]);router['get'](_0x213f('0x13'),auth[_0x213f('0x8')](),controller[_0x213f('0x14')]);router['get'](_0x213f('0x15'),auth[_0x213f('0x8')](),controller['verifySmtp']);router[_0x213f('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x213f('0x16')]);router[_0x213f('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x213f('0x8')](),controller[_0x213f('0x18')]);router[_0x213f('0x17')]('/',auth['isAuthenticated'](),controller[_0x213f('0x19')]);router[_0x213f('0x17')](_0x213f('0xe'),auth[_0x213f('0x8')](),controller[_0x213f('0x1a')]);router[_0x213f('0x17')]('/:id/out_servers',auth[_0x213f('0x8')](),controller[_0x213f('0x1b')]);router[_0x213f('0x17')](_0x213f('0x1c'),auth[_0x213f('0x8')](),controller[_0x213f('0x1d')]);router[_0x213f('0x17')](_0x213f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0x213f('0x17')](_0x213f('0x1e'),auth[_0x213f('0x8')](),controller[_0x213f('0x1f')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x213f('0x20')]);router['put'](_0x213f('0x9'),auth[_0x213f('0x8')](),controller[_0x213f('0x21')]);router[_0x213f('0x22')](_0x213f('0x23'),auth[_0x213f('0x8')](),controller['removeDispositions']);router[_0x213f('0x22')](_0x213f('0xc'),auth[_0x213f('0x8')](),controller['removeAnswers']);router[_0x213f('0x22')](_0x213f('0xe'),auth['isAuthenticated'](),controller[_0x213f('0x24')]);router['delete'](_0x213f('0x25'),auth[_0x213f('0x8')](),controller[_0x213f('0x26')]);router[_0x213f('0x22')](_0x213f('0x9'),auth[_0x213f('0x8')](),controller['destroy']);router['delete'](_0x213f('0x27'),auth[_0x213f('0x8')](),controller[_0x213f('0x28')]);module[_0x213f('0x29')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b6283ef..20efe36 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 _0x64f5=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','BOOLEAN','STRING','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x3ccee2,_0x46b051){var _0x332240=function(_0x786553){while(--_0x786553){_0x3ccee2['push'](_0x3ccee2['shift']());}};_0x332240(++_0x46b051);}(_0x64f5,0x17e));var _0x564f=function(_0x294b10,_0x29f576){_0x294b10=_0x294b10-0x0;var _0x42bb1a=_0x64f5[_0x294b10];return _0x42bb1a;};'use strict';var Sequelize=require(_0x564f('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x564f('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x564f('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x564f('0x2')],'allowNull':![],'defaultValue':_0x564f('0x3')},'fontSize':{'type':Sequelize[_0x564f('0x4')](0x2)[_0x564f('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x564f('0x6');}},'notificationSound':{'type':Sequelize[_0x564f('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x564f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x564f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x564f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x564f('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x564f('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x564f('0x1')],'defaultValue':![],'comment':_0x564f('0x8'),'set':function(_0x6b234d){if(!_0x6b234d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x564f('0x9')]('mandatoryDisposition',_0x6b234d);}}}; \ No newline at end of file +var _0xadb8=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x330d8e,_0x2dd774){var _0x503e0d=function(_0x37110a){while(--_0x37110a){_0x330d8e['push'](_0x330d8e['shift']());}};_0x503e0d(++_0x2dd774);}(_0xadb8,0x1d0));var _0x8adb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xadb8[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x8adb('0x0')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x8adb('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8adb('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x8adb('0x2')]},'markAsUnread':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8adb('0x0')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x8adb('0x3')](0x2)[_0x8adb('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8adb('0x2')],'defaultValue':function(){return _0x8adb('0x5');}},'notificationSound':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8adb('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8adb('0x3')],'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['BOOLEAN'],'defaultValue':![],'comment':_0x8adb('0x6'),'set':function(_0x628c45){if(!_0x628c45)this[_0x8adb('0x7')](_0x8adb('0x8'),null);this[_0x8adb('0x7')](_0x8adb('0x9'),_0x628c45);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 207b93a..52119a5 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 _0xda3f=['getMessages','$gte','format','MailMessage','true','split','CmList','List','CmContact','Contacts','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','keys','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','MailServerOut','Smtp','find','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','pick','options','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','email','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','getImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','send','getApplications'];(function(_0x3935b3,_0x16b9da){var _0x15ef68=function(_0x2c2b94){while(--_0x2c2b94){_0x3935b3['push'](_0x3935b3['shift']());}};_0x15ef68(++_0x16b9da);}(_0xda3f,0xec));var _0xfda3=function(_0x1f7e79,_0x558a27){_0x1f7e79=_0x1f7e79-0x0;var _0x350d01=_0xda3f[_0x1f7e79];return _0x350d01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var htmlToText=require(_0xfda3('0xd'));var juice=require(_0xfda3('0xe'));var Redis=require(_0xfda3('0xf'));var authService=require(_0xfda3('0x10'));var qs=require(_0xfda3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfda3('0x12'));var logger=require(_0xfda3('0x13'))(_0xfda3('0x14'));var utils=require(_0xfda3('0x15'));var config=require(_0xfda3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfda3('0x17'))['db'];config['redis']=_[_0xfda3('0x18')](config[_0xfda3('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfda3('0x1a'))[_0xfda3('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x80ea80,_0x474707,_0x249dc6,_0x3d8bcd){return new BPromise(function(_0x34900d,_0x40d702){var _0x2aadcb=_0x3d8bcd||client;return _0x2aadcb[_0xfda3('0x1c')](_0x80ea80,_0x249dc6)[_0xfda3('0x1d')](function(_0xc62ae6){logger['info'](_0xfda3('0x1e'),_0x474707,_0xfda3('0x1f'));logger[_0xfda3('0x20')](_0xfda3('0x21'),_0x474707,'request\x20sent',JSON[_0xfda3('0x22')](_0xc62ae6));if(_0xc62ae6[_0xfda3('0x23')]){if(_0xc62ae6[_0xfda3('0x23')]['code']===0x1f4){logger['error'](_0xfda3('0x1e'),_0x474707,_0xc62ae6[_0xfda3('0x23')][_0xfda3('0x24')]);return _0x40d702(_0xc62ae6['error'][_0xfda3('0x24')]);}logger[_0xfda3('0x23')](_0xfda3('0x1e'),_0x474707,_0xc62ae6[_0xfda3('0x23')][_0xfda3('0x24')]);return _0x34900d(_0xc62ae6[_0xfda3('0x23')][_0xfda3('0x24')]);}else{logger[_0xfda3('0x25')](_0xfda3('0x1e'),_0x474707,'request\x20sent');_0x34900d(_0xc62ae6[_0xfda3('0x26')][_0xfda3('0x24')]);}})[_0xfda3('0x27')](function(_0x4ae9b9){logger[_0xfda3('0x23')](_0xfda3('0x1e'),_0x474707,_0x4ae9b9);_0x40d702(_0x4ae9b9);});});}function respondWithStatusCode(_0x172cfb,_0x38946d){_0x38946d=_0x38946d||0xcc;return function(_0x1cb831){if(_0x1cb831){return _0x172cfb[_0xfda3('0x28')](_0x38946d);}return _0x172cfb['status'](_0x38946d)[_0xfda3('0x29')]();};}function respondWithResult(_0x1e87fe,_0x2bef2b){_0x2bef2b=_0x2bef2b||0xc8;return function(_0x1f2884){if(_0x1f2884){return _0x1e87fe[_0xfda3('0x2a')](_0x2bef2b)['json'](_0x1f2884);}};}function respondWithFilteredResult(_0x3c1549,_0x4101b1){return function(_0x301509){if(_0x301509){var _0x474992=typeof _0x4101b1[_0xfda3('0x2b')]===_0xfda3('0x2c')&&typeof _0x4101b1[_0xfda3('0x2d')]==='undefined';var _0x56ca3a=_0x301509[_0xfda3('0x2e')];var _0x4fd277=_0x474992?0x0:_0x4101b1['offset'];var _0x16b4a2=_0x474992?_0x301509[_0xfda3('0x2e')]:_0x4101b1[_0xfda3('0x2b')]+_0x4101b1[_0xfda3('0x2d')];var _0x179c90;if(_0x16b4a2>=_0x56ca3a){_0x16b4a2=_0x56ca3a;_0x179c90=0xc8;}else{_0x179c90=0xce;}_0x3c1549[_0xfda3('0x2a')](_0x179c90);return _0x3c1549[_0xfda3('0x2f')](_0xfda3('0x30'),_0x4fd277+'-'+_0x16b4a2+'/'+_0x56ca3a)[_0xfda3('0x31')](_0x301509);}return null;};}function patchUpdates(_0x5825bd){return function(_0x49f84c){try{jsonpatch[_0xfda3('0x32')](_0x49f84c,_0x5825bd,!![]);}catch(_0xacc8c){return BPromise[_0xfda3('0x33')](_0xacc8c);}return _0x49f84c[_0xfda3('0x34')]();};}function saveUpdates(_0xd6969e,_0x2b3afb){return function(_0x210763){if(_0x210763){return _0x210763[_0xfda3('0x35')](_0xd6969e)['then'](function(_0x51ecde){return _0x51ecde;});}return null;};}function removeEntity(_0x30e63e,_0x17cccb){return function(_0x58f805){if(_0x58f805){return _0x58f805[_0xfda3('0x36')]()[_0xfda3('0x1d')](function(){var _0x28ca96=_0x58f805['get']({'plain':!![]});var _0x1d92a9=_0xfda3('0x37');return db[_0xfda3('0x38')][_0xfda3('0x36')]({'where':{'type':_0x1d92a9,'resourceId':_0x28ca96['id']}})[_0xfda3('0x1d')](function(){return _0x58f805;});})['then'](function(){_0x30e63e[_0xfda3('0x2a')](0xcc)[_0xfda3('0x29')]();});}};}function handleEntityNotFound(_0x33bdfb,_0x56bed2){return function(_0x373c96){if(!_0x373c96){_0x33bdfb['sendStatus'](0x194);}return _0x373c96;};}function handleError(_0x2d9a3f,_0x5469df){_0x5469df=_0x5469df||0x1f4;return function(_0x43a58a){logger[_0xfda3('0x23')](_0x43a58a[_0xfda3('0x39')]);if(_0x43a58a[_0xfda3('0x3a')]){delete _0x43a58a[_0xfda3('0x3a')];}_0x2d9a3f[_0xfda3('0x2a')](_0x5469df)['send'](_0x43a58a);};}exports[_0xfda3('0x3b')]=function(_0xbfbc01,_0xd2dde0){var _0x8ed2ba={'include':[{'model':db[_0xfda3('0x3c')],'as':_0xfda3('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xfda3('0x3e')],'as':_0xfda3('0x3f')}]},_0x5cf8c0={},_0x2425f9={'count':0x0,'rows':[]};var _0x14716a=_[_0xfda3('0x40')](db[_0xfda3('0x41')][_0xfda3('0x42')],function(_0x40b814){return{'name':_0x40b814[_0xfda3('0x43')],'type':_0x40b814[_0xfda3('0x44')][_0xfda3('0x45')]};});_0x5cf8c0['model']=_[_0xfda3('0x40')](_0x14716a,_0xfda3('0x3a'));_0x5cf8c0['query']=_[_0xfda3('0x46')](_0xbfbc01['query']);_0x5cf8c0['filters']=_['intersection'](_0x5cf8c0[_0xfda3('0x47')],_0x5cf8c0[_0xfda3('0x48')]);_0x8ed2ba[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x5cf8c0['model'],qs[_0xfda3('0x4b')](_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x8ed2ba[_0xfda3('0x49')]=_0x8ed2ba['attributes'][_0xfda3('0x4c')]?_0x8ed2ba[_0xfda3('0x49')]:_0x5cf8c0[_0xfda3('0x47')];if(!_0xbfbc01['query']['hasOwnProperty'](_0xfda3('0x4d'))){_0x8ed2ba[_0xfda3('0x2d')]=qs[_0xfda3('0x2d')](_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x2d')]);_0x8ed2ba[_0xfda3('0x2b')]=qs[_0xfda3('0x2b')](_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x2b')]);}_0x8ed2ba[_0xfda3('0x4e')]=qs[_0xfda3('0x4f')](_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x4f')]);_0x8ed2ba[_0xfda3('0x50')]=qs['filters'](_['pick'](_0xbfbc01[_0xfda3('0x48')],_0x5cf8c0[_0xfda3('0x51')]),_0x14716a);if(_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x52')]){_0x8ed2ba[_0xfda3('0x50')]=_[_0xfda3('0x53')](_0x8ed2ba[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0x14716a,function(_0x1372ee){if(_0x1372ee[_0xfda3('0x44')]!=='VIRTUAL'){var _0x257839={};_0x257839[_0x1372ee[_0xfda3('0x3a')]]={'$like':'%'+_0xbfbc01[_0xfda3('0x48')][_0xfda3('0x52')]+'%'};return _0x257839;}})});}_0x8ed2ba=_[_0xfda3('0x53')]({},_0x8ed2ba,_0xbfbc01['options']);var _0x2105dc={'where':_0x8ed2ba[_0xfda3('0x50')]};return db[_0xfda3('0x41')]['count'](_0x2105dc)[_0xfda3('0x1d')](function(_0x39c96f){_0x2425f9[_0xfda3('0x2e')]=_0x39c96f;if(_0xbfbc01['query'][_0xfda3('0x54')]){_0x8ed2ba[_0xfda3('0x55')]=[{'all':!![]}];}return db[_0xfda3('0x41')][_0xfda3('0x56')](_0x8ed2ba);})[_0xfda3('0x1d')](function(_0x49662b){_0x2425f9[_0xfda3('0x57')]=_0x49662b;return _0x2425f9;})['then'](respondWithFilteredResult(_0xd2dde0,_0x8ed2ba))[_0xfda3('0x27')](handleError(_0xd2dde0,null));};exports['show']=function(_0x1b5e89,_0x6447){var _0x322b66={'raw':![],'where':{'id':_0x1b5e89['params']['id']},'include':[{'model':db[_0xfda3('0x3c')],'as':_0xfda3('0x3d')},{'model':db[_0xfda3('0x58')],'as':_0xfda3('0x59')},{'model':db[_0xfda3('0x3e')],'as':_0xfda3('0x3f')}]},_0x26ffee={};_0x26ffee[_0xfda3('0x47')]=_['keys'](db['MailAccount'][_0xfda3('0x42')]);_0x26ffee[_0xfda3('0x48')]=_[_0xfda3('0x46')](_0x1b5e89['query']);_0x26ffee['filters']=_[_0xfda3('0x4a')](_0x26ffee[_0xfda3('0x47')],_0x26ffee[_0xfda3('0x48')]);_0x322b66[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x26ffee['model'],qs[_0xfda3('0x4b')](_0x1b5e89[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x322b66[_0xfda3('0x49')]=_0x322b66[_0xfda3('0x49')][_0xfda3('0x4c')]?_0x322b66[_0xfda3('0x49')]:_0x26ffee[_0xfda3('0x47')];if(_0x1b5e89[_0xfda3('0x48')][_0xfda3('0x54')]){_0x322b66[_0xfda3('0x55')]=[{'all':!![]}];}_0x322b66=_[_0xfda3('0x53')]({},_0x322b66,_0x1b5e89['options']);return db[_0xfda3('0x41')][_0xfda3('0x5a')](_0x322b66)[_0xfda3('0x1d')](handleEntityNotFound(_0x6447,null))[_0xfda3('0x1d')](respondWithResult(_0x6447,null))[_0xfda3('0x27')](handleError(_0x6447,null));};exports[_0xfda3('0x35')]=function(_0x42c7a1,_0x4ce31c){if(_0x42c7a1['body']['id']){delete _0x42c7a1[_0xfda3('0x5b')]['id'];}return db[_0xfda3('0x41')]['find']({'where':{'id':_0x42c7a1[_0xfda3('0x5c')]['id']},'include':[{'model':db[_0xfda3('0x3c')],'as':_0xfda3('0x3d')},{'model':db[_0xfda3('0x58')],'as':'Smtp'},{'model':db['Pause'],'as':_0xfda3('0x3f')}]})[_0xfda3('0x1d')](handleEntityNotFound(_0x4ce31c,null))[_0xfda3('0x1d')](saveUpdates(_0x42c7a1['body'],null))[_0xfda3('0x1d')](function(_0x4b1216){if(_0x4b1216&&_0x42c7a1[_0xfda3('0x5b')][_0xfda3('0x3d')]){return db[_0xfda3('0x3c')][_0xfda3('0x35')](_0x42c7a1[_0xfda3('0x5b')][_0xfda3('0x3d')],{'where':{'MailAccountId':_0x4b1216['id']}})['then'](function(){return _0x4b1216;});}return _0x4b1216;})[_0xfda3('0x1d')](function(_0x471418){if(_0x471418&&_0x42c7a1[_0xfda3('0x5b')][_0xfda3('0x59')]){return db[_0xfda3('0x58')]['update'](_0x42c7a1['body'][_0xfda3('0x59')],{'where':{'MailAccountId':_0x471418['id']}})[_0xfda3('0x1d')](function(){return _0x471418;});}return _0x471418;})['then'](respondWithResult(_0x4ce31c,null))['catch'](handleError(_0x4ce31c,null));};exports['describe']=function(_0x248174,_0x2c93d4){return db['MailAccount'][_0xfda3('0x5d')]()[_0xfda3('0x1d')](respondWithResult(_0x2c93d4,null))[_0xfda3('0x27')](handleError(_0x2c93d4,null));};exports[_0xfda3('0x5e')]=function(_0x51e463,_0x1cd818,_0x2b14f0){if(_0x51e463[_0xfda3('0x5b')]['id']){delete _0x51e463[_0xfda3('0x5b')]['id'];}return db[_0xfda3('0x41')][_0xfda3('0x5a')]({'where':{'id':_0x51e463['params']['id']}})['then'](handleEntityNotFound(_0x1cd818,null))[_0xfda3('0x1d')](function(_0x5856fa){if(_0x5856fa){_0x51e463[_0xfda3('0x5b')][_0xfda3('0x5f')]=_0x5856fa['id'];return db[_0xfda3('0x60')][_0xfda3('0x61')](_0x51e463[_0xfda3('0x5b')]);}})[_0xfda3('0x1d')](respondWithResult(_0x1cd818,null))[_0xfda3('0x27')](handleError(_0x1cd818,null));};exports[_0xfda3('0x62')]=function(_0x29b9fb,_0x1eb4dc,_0x4aa383){var _0xee8462={'raw':![],'where':{}};var _0x49f04a={};var _0x5c0755={'count':0x0,'rows':[]};return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0x29b9fb['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x1eb4dc,null))[_0xfda3('0x1d')](function(_0x42e387){if(_0x42e387){_0x49f04a['model']=_[_0xfda3('0x46')](db[_0xfda3('0x60')][_0xfda3('0x42')]);_0x49f04a[_0xfda3('0x48')]=_[_0xfda3('0x46')](_0x29b9fb['query']);_0x49f04a['filters']=_['intersection'](_0x49f04a[_0xfda3('0x47')],_0x49f04a[_0xfda3('0x48')]);_0xee8462[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x49f04a[_0xfda3('0x47')],qs[_0xfda3('0x4b')](_0x29b9fb['query'][_0xfda3('0x4b')]));_0xee8462[_0xfda3('0x49')]=_0xee8462[_0xfda3('0x49')][_0xfda3('0x4c')]?_0xee8462['attributes']:_0x49f04a[_0xfda3('0x47')];if(!_0x29b9fb['query'][_0xfda3('0x64')](_0xfda3('0x4d'))){_0xee8462[_0xfda3('0x2d')]=qs[_0xfda3('0x2d')](_0x29b9fb[_0xfda3('0x48')][_0xfda3('0x2d')]);_0xee8462[_0xfda3('0x2b')]=qs['offset'](_0x29b9fb[_0xfda3('0x48')][_0xfda3('0x2b')]);}_0xee8462[_0xfda3('0x4e')]=qs[_0xfda3('0x4f')](_0x29b9fb[_0xfda3('0x48')][_0xfda3('0x4f')]);_0xee8462['where']=qs[_0xfda3('0x51')](_[_0xfda3('0x65')](_0x29b9fb[_0xfda3('0x48')],_0x49f04a[_0xfda3('0x51')]));_0xee8462[_0xfda3('0x50')]['MailAccountId']=_0x42e387['id'];if(_0x29b9fb[_0xfda3('0x48')][_0xfda3('0x52')]){_0xee8462[_0xfda3('0x50')]=_[_0xfda3('0x53')](_0xee8462[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0xee8462[_0xfda3('0x49')],function(_0x2283d2){var _0x3dad4a={};_0x3dad4a[_0x2283d2]={'$like':'%'+_0x29b9fb[_0xfda3('0x48')]['filter']+'%'};return _0x3dad4a;})});}_0xee8462=_[_0xfda3('0x53')]({},_0xee8462,_0x29b9fb[_0xfda3('0x66')]);return db[_0xfda3('0x60')][_0xfda3('0x2e')]({'where':_0xee8462[_0xfda3('0x50')]})['then'](function(_0x5e54e5){_0x5c0755[_0xfda3('0x2e')]=_0x5e54e5;if(_0x29b9fb[_0xfda3('0x48')][_0xfda3('0x54')]){_0xee8462[_0xfda3('0x55')]=[{'all':!![]}];}return db[_0xfda3('0x60')][_0xfda3('0x56')](_0xee8462);})[_0xfda3('0x1d')](function(_0x8fba91){_0x5c0755[_0xfda3('0x57')]=_0x8fba91;return _0x5c0755;});}})[_0xfda3('0x1d')](respondWithFilteredResult(_0x1eb4dc,_0xee8462))[_0xfda3('0x27')](handleError(_0x1eb4dc,null));};exports['removeDispositions']=function(_0x1ee8f4,_0x49f89a,_0x483060){return db['MailAccount'][_0xfda3('0x5a')]({'where':{'id':_0x1ee8f4['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x49f89a,null))[_0xfda3('0x1d')](function(_0x5d1ebe){if(_0x5d1ebe){return _0x5d1ebe[_0xfda3('0x67')](_0x1ee8f4[_0xfda3('0x48')]['ids']);}})[_0xfda3('0x1d')](respondWithStatusCode(_0x49f89a,null))['catch'](handleError(_0x49f89a,null));};exports[_0xfda3('0x68')]=function(_0x3a66ca,_0x5ee695,_0xdf324c){if(_0x3a66ca[_0xfda3('0x5b')]['id']){delete _0x3a66ca[_0xfda3('0x5b')]['id'];}return db[_0xfda3('0x41')][_0xfda3('0x5a')]({'where':{'id':_0x3a66ca['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x5ee695,null))[_0xfda3('0x1d')](function(_0x1b54ae){if(_0x1b54ae){_0x3a66ca[_0xfda3('0x5b')][_0xfda3('0x5f')]=_0x1b54ae['id'];return db['CannedAnswer']['create'](_0x3a66ca['body']);}})[_0xfda3('0x1d')](respondWithResult(_0x5ee695,null))[_0xfda3('0x27')](handleError(_0x5ee695,null));};exports[_0xfda3('0x69')]=function(_0x1bf64f,_0x88de32,_0x44d81d){var _0x4150b8={'raw':![],'where':{}};var _0xeb8e37={};var _0x504ad3={'count':0x0,'rows':[]};return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0x1bf64f['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x88de32,null))[_0xfda3('0x1d')](function(_0x481606){if(_0x481606){_0xeb8e37[_0xfda3('0x47')]=_[_0xfda3('0x46')](db[_0xfda3('0x6a')][_0xfda3('0x42')]);_0xeb8e37[_0xfda3('0x48')]=_['keys'](_0x1bf64f[_0xfda3('0x48')]);_0xeb8e37[_0xfda3('0x51')]=_[_0xfda3('0x4a')](_0xeb8e37[_0xfda3('0x47')],_0xeb8e37['query']);_0x4150b8[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0xeb8e37[_0xfda3('0x47')],qs[_0xfda3('0x4b')](_0x1bf64f[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x4150b8[_0xfda3('0x49')]=_0x4150b8[_0xfda3('0x49')][_0xfda3('0x4c')]?_0x4150b8[_0xfda3('0x49')]:_0xeb8e37[_0xfda3('0x47')];if(!_0x1bf64f['query']['hasOwnProperty'](_0xfda3('0x4d'))){_0x4150b8['limit']=qs[_0xfda3('0x2d')](_0x1bf64f['query']['limit']);_0x4150b8['offset']=qs[_0xfda3('0x2b')](_0x1bf64f[_0xfda3('0x48')]['offset']);}_0x4150b8['order']=qs['sort'](_0x1bf64f['query']['sort']);_0x4150b8['where']=qs[_0xfda3('0x51')](_['pick'](_0x1bf64f['query'],_0xeb8e37[_0xfda3('0x51')]));_0x4150b8['where']['MailAccountId']=_0x481606['id'];if(_0x1bf64f[_0xfda3('0x48')][_0xfda3('0x52')]){_0x4150b8[_0xfda3('0x50')]=_['merge'](_0x4150b8[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0x4150b8[_0xfda3('0x49')],function(_0x2c6f86){var _0x521c4a={};_0x521c4a[_0x2c6f86]={'$like':'%'+_0x1bf64f[_0xfda3('0x48')][_0xfda3('0x52')]+'%'};return _0x521c4a;})});}_0x4150b8=_['merge']({},_0x4150b8,_0x1bf64f[_0xfda3('0x66')]);return db[_0xfda3('0x6a')][_0xfda3('0x2e')]({'where':_0x4150b8[_0xfda3('0x50')]})[_0xfda3('0x1d')](function(_0x4bb625){_0x504ad3[_0xfda3('0x2e')]=_0x4bb625;if(_0x1bf64f[_0xfda3('0x48')]['includeAll']){_0x4150b8[_0xfda3('0x55')]=[{'all':!![]}];}return db[_0xfda3('0x6a')]['findAll'](_0x4150b8);})[_0xfda3('0x1d')](function(_0xb43cdb){_0x504ad3['rows']=_0xb43cdb;return _0x504ad3;});}})['then'](respondWithFilteredResult(_0x88de32,_0x4150b8))[_0xfda3('0x27')](handleError(_0x88de32,null));};exports[_0xfda3('0x6b')]=function(_0x232125,_0x628a3d,_0x23e996){return db[_0xfda3('0x41')][_0xfda3('0x5a')]({'where':{'id':_0x232125['params']['id']}})['then'](handleEntityNotFound(_0x628a3d,null))[_0xfda3('0x1d')](function(_0x18408a){if(_0x18408a){return _0x18408a[_0xfda3('0x6b')](_0x232125['query'][_0xfda3('0x6c')]);}})[_0xfda3('0x1d')](respondWithStatusCode(_0x628a3d,null))[_0xfda3('0x27')](handleError(_0x628a3d,null));};exports['create']=function(_0x4f9f5c,_0x182a3b){var _0x52eeee={'name':_0x4f9f5c[_0xfda3('0x5b')]['name'],'key':_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x45')],'email':_0x4f9f5c['body'][_0xfda3('0x6d')],'ListId':_0x4f9f5c[_0xfda3('0x5b')]['ListId'],'active':!_[_0xfda3('0x6e')](_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x6f')])?_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x6f')]:!![],'description':_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x4f9f5c['body'][_0xfda3('0x71')])){if(_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x72')]){_0x52eeee['Imap'][_0xfda3('0x73')]=_0x52eeee['Smtp']['user']=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x74')];_0x52eeee[_0xfda3('0x3d')][_0xfda3('0x75')]=_0x52eeee['Smtp'][_0xfda3('0x76')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x77')];}else{_0x52eeee[_0xfda3('0x3d')]['authentication']=_0x52eeee['Smtp'][_0xfda3('0x78')]=![];}_0x52eeee[_0xfda3('0x3d')][_0xfda3('0x79')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x3d')][_0xfda3('0x79')];_0x52eeee['Imap'][_0xfda3('0x7a')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x3d')][_0xfda3('0x7a')];_0x52eeee[_0xfda3('0x59')][_0xfda3('0x79')]=_0x4f9f5c[_0xfda3('0x5b')]['Smtp'][_0xfda3('0x79')];_0x52eeee[_0xfda3('0x59')][_0xfda3('0x7a')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x59')][_0xfda3('0x7a')];}else{_0x52eeee[_0xfda3('0x3d')][_0xfda3('0x7b')]=_0x52eeee['Smtp'][_0xfda3('0x7b')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x71')];_0x52eeee['Imap'][_0xfda3('0x73')]=_0x52eeee[_0xfda3('0x59')][_0xfda3('0x73')]=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x74')];_0x52eeee[_0xfda3('0x3d')][_0xfda3('0x75')]=_0x52eeee['Smtp']['pass']=_0x4f9f5c[_0xfda3('0x5b')][_0xfda3('0x77')];}return db[_0xfda3('0x41')][_0xfda3('0x61')](_0x52eeee,{'include':[{'model':db[_0xfda3('0x58')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xfda3('0x3d')}]})['then'](function(_0x35f006){var _0x283e47=_0x4f9f5c[_0xfda3('0x73')][_0xfda3('0x7c')]({'plain':!![]});if(!_0x283e47)throw new Error(_0xfda3('0x7d'));if(_0x283e47[_0xfda3('0x7e')]==='user'){var _0x5c5521=_0x35f006[_0xfda3('0x7c')]({'plain':!![]});return db[_0xfda3('0x7f')]['find']({'where':{'name':_0xfda3('0x37'),'userProfileId':_0x283e47[_0xfda3('0x80')]},'raw':!![]})['then'](function(_0x11a7ee){if(_0x11a7ee&&_0x11a7ee['autoAssociation']===0x0){return db[_0xfda3('0x38')][_0xfda3('0x61')]({'name':_0x5c5521['name'],'resourceId':_0x5c5521['id'],'type':_0x11a7ee[_0xfda3('0x3a')],'sectionId':_0x11a7ee['id']},{})[_0xfda3('0x1d')](function(){return _0x35f006;});}else{return _0x35f006;}})['catch'](function(_0x3b8674){logger[_0xfda3('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b8674);throw _0x3b8674;});}return _0x35f006;})[_0xfda3('0x1d')](respondWithResult(_0x182a3b,0xc9))[_0xfda3('0x27')](handleError(_0x182a3b,null));};exports[_0xfda3('0x81')]=function(_0x1df690,_0x40e82b,_0x44d0c9){return db['MailAccount'][_0xfda3('0x63')]({'where':{'id':_0x1df690[_0xfda3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x40e82b,null))['then'](function(_0x43f23c){if(_0x43f23c){return _0x43f23c['getImap']();}return null;})['then'](respondWithResult(_0x40e82b,null))[_0xfda3('0x27')](handleError(_0x40e82b,null));};exports['addImap']=function(_0x23d648,_0x35af25,_0x30f340){if(_0x23d648['body']['id']){delete _0x23d648[_0xfda3('0x5b')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x23d648[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x35af25,null))[_0xfda3('0x1d')](function(_0x1cb20f){if(_0x1cb20f){_0x23d648[_0xfda3('0x5b')]['MailAccountId']=_0x1cb20f['id'];return db[_0xfda3('0x3c')][_0xfda3('0x61')](_0x23d648['body']);}})[_0xfda3('0x1d')](respondWithResult(_0x35af25,null))['catch'](handleError(_0x35af25,null));};exports[_0xfda3('0x82')]=function(_0x304470,_0x169ede,_0x4ad47a){return db[_0xfda3('0x41')]['findOne']({'where':{'id':_0x304470['params']['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x169ede,null))[_0xfda3('0x1d')](function(_0x368cb3){if(_0x368cb3){return _0x368cb3['setImap'](null);}return null;})[_0xfda3('0x1d')](respondWithStatusCode(_0x169ede,null))[_0xfda3('0x27')](handleError(_0x169ede,null));};exports[_0xfda3('0x83')]=function(_0x5766ba,_0xca27e3,_0x4ef033){return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0x5766ba[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0xca27e3,null))['then'](function(_0x32c5c7){if(_0x32c5c7){return _0x32c5c7['getSmtp']();}return null;})[_0xfda3('0x1d')](respondWithResult(_0xca27e3,null))[_0xfda3('0x27')](handleError(_0xca27e3,null));};exports[_0xfda3('0x84')]=function(_0x5efa96,_0x583909,_0x43bdad){if(_0x5efa96[_0xfda3('0x5b')]['id']){delete _0x5efa96[_0xfda3('0x5b')]['id'];}return db[_0xfda3('0x41')][_0xfda3('0x5a')]({'where':{'id':_0x5efa96['params']['id']}})['then'](handleEntityNotFound(_0x583909,null))[_0xfda3('0x1d')](function(_0x24ab83){if(_0x24ab83){_0x5efa96['body'][_0xfda3('0x5f')]=_0x24ab83['id'];return db[_0xfda3('0x58')][_0xfda3('0x61')](_0x5efa96[_0xfda3('0x5b')]);}})[_0xfda3('0x1d')](respondWithResult(_0x583909,null))[_0xfda3('0x27')](handleError(_0x583909,null));};exports[_0xfda3('0x85')]=function(_0x1e5a5e,_0x62f9bb,_0x55bbab){return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0x1e5a5e[_0xfda3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x62f9bb,null))[_0xfda3('0x1d')](function(_0x328a26){if(_0x328a26){return _0x328a26[_0xfda3('0x86')](null);}return null;})[_0xfda3('0x1d')](respondWithStatusCode(_0x62f9bb,null))['catch'](handleError(_0x62f9bb,null));};exports['addInteraction']=function(_0x527513,_0x2086e6,_0x34536e){return db[_0xfda3('0x87')][_0xfda3('0x5a')]({'where':{'id':_0x527513[_0xfda3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2086e6,null))['then'](function(_0x50ae29){if(_0x50ae29){return _0x50ae29[_0xfda3('0x88')](_0x527513[_0xfda3('0x5b')][_0xfda3('0x6c')],_[_0xfda3('0x89')](_0x527513[_0xfda3('0x5b')],[_0xfda3('0x6c'),'id'])||{});}})[_0xfda3('0x1d')](respondWithResult(_0x2086e6,null))[_0xfda3('0x27')](handleError(_0x2086e6,null));};exports[_0xfda3('0x8a')]=function(_0xf87691,_0x26ac04,_0x4e6328){var _0x429b62={'raw':![],'where':{}};var _0x355f69={};var _0x169469={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xf87691[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x26ac04,null))[_0xfda3('0x1d')](function(_0x5c7309){if(_0x5c7309){_0x355f69[_0xfda3('0x47')]=_[_0xfda3('0x46')](db['MailInteraction']['rawAttributes']);_0x355f69[_0xfda3('0x48')]=_[_0xfda3('0x46')](_0xf87691['query']);_0x355f69[_0xfda3('0x51')]=_[_0xfda3('0x4a')](_0x355f69[_0xfda3('0x47')],_0x355f69['query']);_0x429b62[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x355f69[_0xfda3('0x47')],qs[_0xfda3('0x4b')](_0xf87691[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x429b62[_0xfda3('0x49')]=_0x429b62['attributes'][_0xfda3('0x4c')]?_0x429b62[_0xfda3('0x49')]:_0x355f69[_0xfda3('0x47')];if(!_0xf87691[_0xfda3('0x48')]['hasOwnProperty'](_0xfda3('0x4d'))){_0x429b62[_0xfda3('0x2d')]=qs['limit'](_0xf87691['query'][_0xfda3('0x2d')]);_0x429b62[_0xfda3('0x2b')]=qs[_0xfda3('0x2b')](_0xf87691['query'][_0xfda3('0x2b')]);}_0x429b62[_0xfda3('0x4e')]=qs[_0xfda3('0x4f')](_0xf87691['query'][_0xfda3('0x4f')]);_0x429b62['where']=qs['filters'](_['pick'](_0xf87691[_0xfda3('0x48')],_0x355f69[_0xfda3('0x51')]));_0x429b62[_0xfda3('0x50')][_0xfda3('0x5f')]=_0x5c7309['id'];if(_0xf87691['query'][_0xfda3('0x52')]){_0x429b62[_0xfda3('0x50')]=_['merge'](_0x429b62[_0xfda3('0x50')],{'$or':_['map'](_0x429b62[_0xfda3('0x49')],function(_0x13fa31){var _0x24f1af={};_0x24f1af[_0x13fa31]={'$like':'%'+_0xf87691[_0xfda3('0x48')][_0xfda3('0x52')]+'%'};return _0x24f1af;})});}_0x429b62=_['merge']({},_0x429b62,_0xf87691[_0xfda3('0x66')]);return db[_0xfda3('0x87')][_0xfda3('0x2e')]({'where':_0x429b62[_0xfda3('0x50')]})['then'](function(_0x1f16ce){_0x169469[_0xfda3('0x2e')]=_0x1f16ce;if(_0xf87691[_0xfda3('0x48')][_0xfda3('0x54')]){_0x429b62[_0xfda3('0x55')]=[{'model':db['CmContact'],'as':_0xfda3('0x8b'),'required':![]},{'model':db[_0xfda3('0x8c')],'as':_0xfda3('0x8d'),'attributes':['name','fullname',_0xfda3('0x8e')],'required':![]},{'model':db[_0xfda3('0x8f')],'as':_0xfda3('0x90'),'attributes':['id',_0xfda3('0x3a'),'color'],'where':_0xf87691[_0xfda3('0x48')][_0xfda3('0x91')]?{'id':_0xf87691[_0xfda3('0x48')][_0xfda3('0x91')]}:undefined,'required':_0xf87691[_0xfda3('0x48')][_0xfda3('0x91')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x429b62);})[_0xfda3('0x1d')](function(_0x1b6bc5){_0x169469['rows']=_0x1b6bc5;return _0x169469;});}})[_0xfda3('0x1d')](respondWithFilteredResult(_0x26ac04,_0x429b62))[_0xfda3('0x27')](handleError(_0x26ac04,null));};exports[_0xfda3('0x92')]=function addApplications(_0x5213a0,_0x12ddbd){var _0x1e8268=_0x5213a0[_0xfda3('0x5c')]['id'];var _0x4192a0=_0x5213a0['body'];var _0x305ee2=0xc8;var _0x1aea3a=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xfda3('0x93')][_0xfda3('0x94')][_0xfda3('0x95')][_0xfda3('0x96')]},function(_0xd77edc){return db['MailAccount'][_0xfda3('0x63')]({'where':{'id':_0x1e8268},'transaction':_0xd77edc})[_0xfda3('0x1d')](function(_0x4808f8){if(_0x4808f8){return db['MailApplication'][_0xfda3('0x36')]({'where':{'MailAccountId':_0x1e8268},'transaction':_0xd77edc})['then'](function(){var _0x4ac25c=_[_0xfda3('0x40')](_0x4192a0,function(_0x4a1223){_0x4a1223['MailAccountId']=_0x1e8268;return _0x4a1223;});return db[_0xfda3('0x97')][_0xfda3('0x98')](_0x4ac25c,{'transaction':_0xd77edc});});}else{_0x305ee2=0x194;_0x1aea3a=[];}});})[_0xfda3('0x1d')](function(){if(_0x305ee2!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x1e8268},'order':_0xfda3('0x99')})[_0xfda3('0x1d')](function(_0x4e5b98){_0x1aea3a=_0x4e5b98;});}})[_0xfda3('0x27')](function(_0xe03164){_0x305ee2=0x1f4;logger[_0xfda3('0x23')](_0xe03164[_0xfda3('0x39')]);if(_0xe03164[_0xfda3('0x3a')]){delete _0xe03164[_0xfda3('0x3a')];}_0x1aea3a=_0xe03164;})['finally'](function(){if(_0x1aea3a===null){_0x12ddbd[_0xfda3('0x28')](_0x305ee2);}else{if(_0x305ee2===0x1f4){_0x12ddbd['status'](_0x305ee2)[_0xfda3('0x9a')](_0x1aea3a);}else{_0x12ddbd[_0xfda3('0x2a')](_0x305ee2)[_0xfda3('0x31')](_0x1aea3a);}}});};exports[_0xfda3('0x9b')]=function(_0xaf416b,_0x2b69a4,_0x5cfd3a){var _0x425f29={};var _0x26311f={};var _0x43ec4d;var _0x3b1d2a;return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0xaf416b[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x2b69a4,null))[_0xfda3('0x1d')](function(_0xe0fb02){if(_0xe0fb02){_0x43ec4d=_0xe0fb02;_0x26311f[_0xfda3('0x47')]=_['keys'](db[_0xfda3('0x97')][_0xfda3('0x42')]);_0x26311f[_0xfda3('0x48')]=_[_0xfda3('0x46')](_0xaf416b[_0xfda3('0x48')]);_0x26311f[_0xfda3('0x51')]=_['intersection'](_0x26311f[_0xfda3('0x47')],_0x26311f[_0xfda3('0x48')]);_0x425f29[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x26311f[_0xfda3('0x47')],qs['fields'](_0xaf416b['query']['fields']));_0x425f29['attributes']=_0x425f29['attributes'][_0xfda3('0x4c')]?_0x425f29['attributes']:_0x26311f[_0xfda3('0x47')];_0x425f29['order']=qs['sort'](_0xaf416b[_0xfda3('0x48')][_0xfda3('0x4f')]);_0x425f29[_0xfda3('0x50')]=qs[_0xfda3('0x51')](_[_0xfda3('0x65')](_0xaf416b[_0xfda3('0x48')],_0x26311f[_0xfda3('0x51')]));if(_0xaf416b[_0xfda3('0x48')][_0xfda3('0x52')]){_0x425f29[_0xfda3('0x50')]=_['merge'](_0x425f29[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0x425f29[_0xfda3('0x49')],function(_0x10a6db){var _0x4c626c={};_0x4c626c[_0x10a6db]={'$like':'%'+_0xaf416b[_0xfda3('0x48')][_0xfda3('0x52')]+'%'};return _0x4c626c;})});}_0x425f29=_[_0xfda3('0x53')]({},_0x425f29,_0xaf416b[_0xfda3('0x66')]);return _0x43ec4d[_0xfda3('0x9b')](_0x425f29);}})[_0xfda3('0x1d')](function(_0x3d9a85){if(_0x3d9a85){_0x3b1d2a=_0x3d9a85['length'];if(!_0xaf416b[_0xfda3('0x48')][_0xfda3('0x64')](_0xfda3('0x4d'))){_0x425f29[_0xfda3('0x2d')]=qs[_0xfda3('0x2d')](_0xaf416b[_0xfda3('0x48')][_0xfda3('0x2d')]);_0x425f29[_0xfda3('0x2b')]=qs[_0xfda3('0x2b')](_0xaf416b[_0xfda3('0x48')][_0xfda3('0x2b')]);}return _0x43ec4d['getApplications'](_0x425f29);}})[_0xfda3('0x1d')](function(_0x416009){if(_0x416009){return _0x416009?{'count':_0x3b1d2a,'rows':_0x416009}:null;}})[_0xfda3('0x1d')](respondWithResult(_0x2b69a4,null))[_0xfda3('0x27')](handleError(_0x2b69a4,null));};exports[_0xfda3('0x9c')]=function(_0x4bc446,_0x1b79f9,_0x53c9a8){var _0x10438b={'raw':!![],'where':{}};var _0x17825e={};var _0x289a2b={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4bc446[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x1b79f9,null))[_0xfda3('0x1d')](function(_0x30728f){if(_0x30728f){_0x17825e['model']=_[_0xfda3('0x46')](db['MailMessage'][_0xfda3('0x42')]);_0x17825e[_0xfda3('0x48')]=_[_0xfda3('0x46')](_0x4bc446[_0xfda3('0x48')]);_0x17825e['filters']=_[_0xfda3('0x4a')](_0x17825e[_0xfda3('0x47')],_0x17825e[_0xfda3('0x48')]);_0x10438b[_0xfda3('0x49')]=_[_0xfda3('0x4a')](_0x17825e[_0xfda3('0x47')],qs[_0xfda3('0x4b')](_0x4bc446[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x10438b[_0xfda3('0x49')]=_0x10438b['attributes']['length']?_0x10438b[_0xfda3('0x49')]:_0x17825e['model'];if(!_0x4bc446['query'][_0xfda3('0x64')]('nolimit')){_0x10438b[_0xfda3('0x2d')]=qs['limit'](_0x4bc446[_0xfda3('0x48')]['limit']);_0x10438b[_0xfda3('0x2b')]=qs['offset'](_0x4bc446[_0xfda3('0x48')][_0xfda3('0x2b')]);}_0x10438b[_0xfda3('0x4e')]=qs[_0xfda3('0x4f')](_0x4bc446[_0xfda3('0x48')][_0xfda3('0x4f')]);_0x10438b[_0xfda3('0x50')]=qs[_0xfda3('0x51')](_[_0xfda3('0x65')](_0x4bc446[_0xfda3('0x48')],_0x17825e[_0xfda3('0x51')]));_0x10438b[_0xfda3('0x50')][_0xfda3('0x5f')]=_0x30728f['id'];if(_0x4bc446['query'][_0xfda3('0x52')]){_0x10438b[_0xfda3('0x50')]=_[_0xfda3('0x53')](_0x10438b[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0x10438b[_0xfda3('0x49')],function(_0x14605d){var _0x45a87d={};_0x45a87d[_0x14605d]={'$like':'%'+_0x4bc446[_0xfda3('0x48')][_0xfda3('0x52')]+'%'};return _0x45a87d;})});}if(_0x4bc446[_0xfda3('0x48')][_0xfda3('0x9d')]){var _0x45cce8=_0x4bc446['query'][_0xfda3('0x9d')]['split'](',');var _0x4b3b20={};_0x4b3b20[_0x45cce8[0x0]]={'$gte':moment(_0x45cce8[0x1])[_0xfda3('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10438b[_0xfda3('0x50')]=_['merge'](_0x10438b[_0xfda3('0x50')],_0x4b3b20);}_0x10438b=_['merge']({},_0x10438b,_0x4bc446[_0xfda3('0x66')]);return db[_0xfda3('0x9f')][_0xfda3('0x2e')]({'where':_0x10438b['where']})[_0xfda3('0x1d')](function(_0x427b03){_0x289a2b['count']=_0x427b03;if(_0x4bc446['query'][_0xfda3('0x54')]){_0x10438b[_0xfda3('0x55')]=[{'all':!![]}];}return db[_0xfda3('0x9f')][_0xfda3('0x56')](_0x10438b);})[_0xfda3('0x1d')](function(_0x303082){if(_0x4bc446[_0xfda3('0x48')]['inlineCss']===_0xfda3('0xa0')){for(var _0x6a5999=0x0;_0x6a5999<_0x303082['length'];_0x6a5999++){_0x303082[_0x6a5999][_0xfda3('0x5b')]=juice(_0x303082[_0x6a5999][_0xfda3('0x5b')]);}}_0x289a2b[_0xfda3('0x57')]=_0x303082;return _0x289a2b;});}})[_0xfda3('0x1d')](respondWithFilteredResult(_0x1b79f9,_0x10438b))[_0xfda3('0x27')](handleError(_0x1b79f9,null));};exports[_0xfda3('0x9a')]=function(_0x3da573,_0xdff8c3,_0x46de05){var _0x2e16f4,_0x244781={},_0x17fb82;if(_0x3da573[_0xfda3('0x5b')]['to']){_0x17fb82=_0x3da573['body']['to'][_0xfda3('0xa1')](',')[0x0];}return db[_0xfda3('0x41')]['find']({'where':{'id':_0x3da573[_0xfda3('0x5c')]['id']},'include':[{'model':db[_0xfda3('0xa2')],'as':_0xfda3('0xa3'),'include':[{'model':db[_0xfda3('0xa4')],'as':_0xfda3('0xa5'),'where':{'email':_0x17fb82},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfda3('0x58')],'as':_0xfda3('0x59'),'raw':!![]}]})[_0xfda3('0x1d')](handleEntityNotFound(_0xdff8c3,null))['then'](function(_0x51ecee){if(_0x51ecee){_0x2e16f4=_0x51ecee;if(_0x51ecee[_0xfda3('0x59')]){if(_[_0xfda3('0x6e')](_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa6')])){_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa6')]=util['format'](_0xfda3('0xa7'),_0x51ecee[_0xfda3('0x3a')],_0x51ecee[_0xfda3('0x6d')]||_0x51ecee['Smtp'][_0xfda3('0x73')]);}if(_0x3da573['body'][_0xfda3('0xa8')]&&_0x3da573['body'][_0xfda3('0xa8')][_0xfda3('0x4c')]){for(var _0x2b2d6d=0x0;_0x2b2d6d<_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa8')][_0xfda3('0x4c')];_0x2b2d6d+=0x1){_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa8')][_0x2b2d6d]={'filename':_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa8')][_0x2b2d6d]['name'],'path':path[_0xfda3('0xa9')](config[_0xfda3('0xaa')],_0xfda3('0xab'),_0x3da573[_0xfda3('0x5b')][_0xfda3('0xa8')][_0x2b2d6d][_0xfda3('0xac')])};}}var _0x30d181={'tls':{'rejectUnauthorized':![]}};if(_[_0xfda3('0x6e')](_0x51ecee['Smtp'][_0xfda3('0x7b')])){if(_0x51ecee[_0xfda3('0x59')][_0xfda3('0x78')]){_0x30d181[_0xfda3('0xad')]={'user':_0x51ecee[_0xfda3('0x59')][_0xfda3('0x73')],'pass':_0x51ecee['Smtp'][_0xfda3('0x76')]};}_0x30d181[_0xfda3('0x79')]=_0x51ecee['Smtp'][_0xfda3('0x79')];_0x30d181[_0xfda3('0x7a')]=_0x51ecee[_0xfda3('0x59')]['port'];_0x30d181[_0xfda3('0xae')]=_0x51ecee[_0xfda3('0x59')][_0xfda3('0xae')];}else{_0x30d181['service']=_0x51ecee['Smtp'][_0xfda3('0x7b')];_0x30d181[_0xfda3('0xad')]={'user':_0x51ecee[_0xfda3('0x59')][_0xfda3('0x73')],'pass':_0x51ecee['Smtp'][_0xfda3('0x76')]};}return respondWithRpcPromise(_0xfda3('0xaf'),_0xfda3('0xb0'),{'account':_0x30d181,'message':_0x3da573['body']});}else{throw new Error(_0xfda3('0xb1'));}}})[_0xfda3('0x1d')](function(_0x132de2){if(_0x132de2){_0x244781=_0x132de2;if(_0x2e16f4[_0xfda3('0xa3')]){if(_0x2e16f4[_0xfda3('0xa3')][_0xfda3('0xa5')]['length']){return _0x2e16f4[_0xfda3('0xa3')][_0xfda3('0xa5')][0x0];}else{return db['CmContact']['create'](_[_0xfda3('0x18')](_0x3da573[_0xfda3('0x5b')],{'firstName':_0x3da573[_0xfda3('0x5b')]['to'],'email':_0x3da573[_0xfda3('0x5b')]['to'],'phone':_0x3da573[_0xfda3('0x5b')]['to'],'ListId':_0x2e16f4[_0xfda3('0xb2')]}));}}else{throw new Error(_0xfda3('0xb1'));}}})[_0xfda3('0x1d')](function(_0x4c9348){if(_0x4c9348){var _0x1ffcdc={'UserId':_0x3da573['user']['id'],'ContactId':_0x4c9348['id'],'MailAccountId':_0x2e16f4['id'],'inReplyTo':_0x244781[_0xfda3('0xb3')],'to':_0x3da573[_0xfda3('0x5b')]['from'],'cc':_0x3da573[_0xfda3('0x5b')]['cc'],'subject':_0x3da573[_0xfda3('0x5b')][_0xfda3('0xb4')],'attach':_0x3da573[_0xfda3('0x5b')][_0xfda3('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xfda3('0x9e')](_0xfda3('0xb6')),'lastMsgDirection':_0xfda3('0xb7'),'Messages':[_['merge'](_0x3da573['body'],{'messageId':_0x244781[_0xfda3('0xb3')],'sentAt':moment()[_0xfda3('0x9e')](_0xfda3('0xb6')),'read':!![],'MailAccountId':_0x2e16f4['id'],'UserId':_0x3da573['user']['id'],'ContactId':_0x4c9348['id']})]};if(_0x3da573[_0xfda3('0x5b')][_0xfda3('0xb8')]){_0x1ffcdc=_[_0xfda3('0x53')](_0x1ffcdc,_0x3da573[_0xfda3('0x5b')][_0xfda3('0xb8')]);}return db['MailInteraction'][_0xfda3('0x61')](_0x1ffcdc,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0xfda3('0x1d')](respondWithResult(_0xdff8c3,null))[_0xfda3('0x27')](handleError(_0xdff8c3,null));};exports[_0xfda3('0xb9')]=function(_0x448dde,_0x58cca3,_0x13a1f3){return db[_0xfda3('0x41')][_0xfda3('0x5a')]({'where':{'id':_0x448dde['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0xfda3('0x59'),'raw':!![]}]})[_0xfda3('0x1d')](handleEntityNotFound(_0x58cca3,null))[_0xfda3('0x1d')](function(_0x5d81d7){if(_0x5d81d7&&_0x5d81d7[_0xfda3('0x59')]){var _0x49fafe={'id':_0x5d81d7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d81d7['Smtp'][_0xfda3('0x7b')]){_0x49fafe[_0xfda3('0x7b')]=_0x5d81d7['Smtp'][_0xfda3('0x7b')];}else{_0x49fafe[_0xfda3('0x79')]=_0x5d81d7['Smtp'][_0xfda3('0x79')];_0x49fafe[_0xfda3('0x7a')]=_0x5d81d7[_0xfda3('0x59')][_0xfda3('0x7a')];_0x49fafe[_0xfda3('0xae')]=_0x5d81d7[_0xfda3('0x59')][_0xfda3('0xae')];}if(_0x5d81d7[_0xfda3('0x59')]['authentication']){_0x49fafe[_0xfda3('0xad')]={'user':_0x5d81d7[_0xfda3('0x59')][_0xfda3('0x73')],'pass':_0x5d81d7[_0xfda3('0x59')][_0xfda3('0x76')]};}return respondWithRpcPromise(_0xfda3('0xba'),_0xfda3('0xb9'),{'account':_0x49fafe});}})['then'](respondWithResult(_0x58cca3,null))[_0xfda3('0x27')](handleError(_0x58cca3,null));};exports[_0xfda3('0x36')]=function(_0x22cb11,_0x51b1c4){return db['MailAccount'][_0xfda3('0x5a')]({'where':{'id':_0x22cb11[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x51b1c4,null))[_0xfda3('0x1d')](function(_0x69746f){if(_0x69746f&&_0x69746f['service']){throw new db['Sequelize'][(_0xfda3('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x69746f;})['then'](removeEntity(_0x51b1c4,null))[_0xfda3('0x27')](handleError(_0x51b1c4,null));};exports['addAgents']=function(_0x448589,_0x1c4ba3,_0x435f91){return db[_0xfda3('0x41')]['find']({'where':{'id':_0x448589['params']['id']}})['then'](handleEntityNotFound(_0x1c4ba3,null))[_0xfda3('0x1d')](function(_0x2e53b6){if(_0x2e53b6){return _0x2e53b6[_0xfda3('0xbc')](_0x448589[_0xfda3('0x5b')][_0xfda3('0x6c')],_[_0xfda3('0x89')](_0x448589['body'],[_0xfda3('0x6c'),'id'])||{})[_0xfda3('0xbd')](function(_0xb86fff){for(var _0x2a3b80=0x0;_0x2a3b80<_0x448589[_0xfda3('0x5b')][_0xfda3('0x6c')][_0xfda3('0x4c')];_0x2a3b80+=0x1){socket[_0xfda3('0xbe')](_0xfda3('0xbf'),{'UserId':Number(_0x448589['body'][_0xfda3('0x6c')][_0x2a3b80]),'MailAccountId':Number(_0x448589[_0xfda3('0x5c')]['id'])});}return _0xb86fff;});}})['then'](respondWithResult(_0x1c4ba3,null))[_0xfda3('0x27')](handleError(_0x1c4ba3,null));};exports[_0xfda3('0xc0')]=function(_0xf9f599,_0x13dfc8,_0xaae0c3){return db['MailAccount']['find']({'where':{'id':_0xf9f599[_0xfda3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13dfc8,null))[_0xfda3('0x1d')](function(_0x47fc94){if(_0x47fc94){return _0x47fc94[_0xfda3('0xc0')](_0xf9f599[_0xfda3('0x48')][_0xfda3('0x6c')])['then'](function(){if(_[_0xfda3('0xc1')](_0xf9f599['query']['ids'])){for(var _0x577c7a=0x0;_0x577c7a<_0xf9f599['query'][_0xfda3('0x6c')][_0xfda3('0x4c')];_0x577c7a+=0x1){socket[_0xfda3('0xbe')](_0xfda3('0xc2'),{'UserId':Number(_0xf9f599[_0xfda3('0x48')][_0xfda3('0x6c')][_0x577c7a]),'MailAccountId':Number(_0xf9f599['params']['id'])});}}else{socket[_0xfda3('0xbe')](_0xfda3('0xc2'),{'UserId':Number(_0xf9f599[_0xfda3('0x48')][_0xfda3('0x6c')]),'MailAccountId':Number(_0xf9f599[_0xfda3('0x5c')]['id'])});}});}})[_0xfda3('0x1d')](respondWithStatusCode(_0x13dfc8,null))[_0xfda3('0x27')](handleError(_0x13dfc8,null));};exports[_0xfda3('0xc3')]=function(_0x1b16b4,_0x500704,_0x1144ab){var _0x13f2c3={};var _0xc864af={};var _0x3f8027;var _0x2bba12;return db[_0xfda3('0x41')][_0xfda3('0x63')]({'where':{'id':_0x1b16b4[_0xfda3('0x5c')]['id']}})[_0xfda3('0x1d')](handleEntityNotFound(_0x500704,null))[_0xfda3('0x1d')](function(_0x167cef){if(_0x167cef){_0x3f8027=_0x167cef;_0xc864af[_0xfda3('0x47')]=_[_0xfda3('0x46')](db[_0xfda3('0x8c')][_0xfda3('0x42')]);_0xc864af['query']=_[_0xfda3('0x46')](_0x1b16b4[_0xfda3('0x48')]);_0xc864af[_0xfda3('0x51')]=_['intersection'](_0xc864af[_0xfda3('0x47')],_0xc864af[_0xfda3('0x48')]);_0x13f2c3['attributes']=_[_0xfda3('0x4a')](_0xc864af[_0xfda3('0x47')],qs[_0xfda3('0x4b')](_0x1b16b4[_0xfda3('0x48')][_0xfda3('0x4b')]));_0x13f2c3['attributes']=_0x13f2c3[_0xfda3('0x49')][_0xfda3('0x4c')]?_0x13f2c3[_0xfda3('0x49')]:_0xc864af[_0xfda3('0x47')];_0x13f2c3[_0xfda3('0x4e')]=qs['sort'](_0x1b16b4[_0xfda3('0x48')]['sort']);_0x13f2c3[_0xfda3('0x50')]=qs['filters'](_[_0xfda3('0x65')](_0x1b16b4[_0xfda3('0x48')],_0xc864af['filters']));if(_0x1b16b4['query'][_0xfda3('0x52')]){_0x13f2c3[_0xfda3('0x50')]=_[_0xfda3('0x53')](_0x13f2c3[_0xfda3('0x50')],{'$or':_[_0xfda3('0x40')](_0x13f2c3[_0xfda3('0x49')],function(_0x18e1e6){var _0x1a07a2={};_0x1a07a2[_0x18e1e6]={'$like':'%'+_0x1b16b4[_0xfda3('0x48')]['filter']+'%'};return _0x1a07a2;})});}_0x13f2c3=_[_0xfda3('0x53')]({},_0x13f2c3,_0x1b16b4[_0xfda3('0x66')]);return _0x3f8027[_0xfda3('0xc3')](_0x13f2c3);}})['then'](function(_0x13ad1f){if(_0x13ad1f){_0x2bba12=_0x13ad1f[_0xfda3('0x4c')];if(!_0x1b16b4[_0xfda3('0x48')][_0xfda3('0x64')](_0xfda3('0x4d'))){_0x13f2c3['limit']=qs[_0xfda3('0x2d')](_0x1b16b4[_0xfda3('0x48')]['limit']);_0x13f2c3[_0xfda3('0x2b')]=qs['offset'](_0x1b16b4['query'][_0xfda3('0x2b')]);}return _0x3f8027[_0xfda3('0xc3')](_0x13f2c3);}})[_0xfda3('0x1d')](function(_0x2f0f07){if(_0x2f0f07){return _0x2f0f07?{'count':_0x2bba12,'rows':_0x2f0f07}:null;}})['then'](respondWithResult(_0x500704,null))['catch'](handleError(_0x500704,null));}; \ No newline at end of file +var _0xb458=['userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','html-to-text','juice','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','get','destroy','sendStatus','stack','name','index','MailServerIn','MailServerOut','Pause','map','MailAccount','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','show','Imap','Smtp','mandatoryDispositionPause','body','find','params','describe','addDisposition','MailAccountId','create','findOne','Disposition','hasOwnProperty','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','user','cuser','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','send','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','Contacts','from','attachments','join','root','server/files/attachments','auth','secure','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xb458,0xca));var _0x8b45=function(_0x57c49b,_0x512e22){_0x57c49b=_0x57c49b-0x0;var _0x24fcb9=_0xb458[_0x57c49b];return _0x24fcb9;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require(_0x8b45('0x3'));var rp=require('request-promise');var moment=require(_0x8b45('0x4'));var BPromise=require(_0x8b45('0x5'));var Mustache=require(_0x8b45('0x6'));var util=require(_0x8b45('0x7'));var path=require(_0x8b45('0x8'));var sox=require(_0x8b45('0x9'));var csv=require(_0x8b45('0xa'));var ejs=require(_0x8b45('0xb'));var fs=require('fs');var fs_extra=require(_0x8b45('0xc'));var _=require(_0x8b45('0xd'));var squel=require(_0x8b45('0xe'));var crypto=require(_0x8b45('0xf'));var jsforce=require(_0x8b45('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x8b45('0x11'));var juice=require(_0x8b45('0x12'));var Redis=require(_0x8b45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8b45('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b45('0x15'));var logger=require(_0x8b45('0x16'))(_0x8b45('0x17'));var utils=require(_0x8b45('0x18'));var config=require(_0x8b45('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8b45('0x1a')]=_[_0x8b45('0x1b')](config[_0x8b45('0x1a')],{'host':_0x8b45('0x1c'),'port':0x18eb});var socket=require(_0x8b45('0x1d'))(new Redis(config[_0x8b45('0x1a')]));require(_0x8b45('0x1e'))[_0x8b45('0x1f')](socket);var jayson=require(_0x8b45('0x20'));var client=jayson[_0x8b45('0x21')][_0x8b45('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x153495,_0x29180d,_0x433010,_0x3ce169){return new BPromise(function(_0x59547e,_0x54db6e){var _0x777072=_0x3ce169||client;return _0x777072[_0x8b45('0x23')](_0x153495,_0x433010)[_0x8b45('0x24')](function(_0x3a832e){logger[_0x8b45('0x25')]('MailAccount,\x20%s,\x20%s',_0x29180d,_0x8b45('0x26'));logger['debug'](_0x8b45('0x27'),_0x29180d,'request\x20sent',JSON[_0x8b45('0x28')](_0x3a832e));if(_0x3a832e[_0x8b45('0x29')]){if(_0x3a832e[_0x8b45('0x29')]['code']===0x1f4){logger[_0x8b45('0x29')](_0x8b45('0x2a'),_0x29180d,_0x3a832e['error'][_0x8b45('0x2b')]);return _0x54db6e(_0x3a832e[_0x8b45('0x29')][_0x8b45('0x2b')]);}logger['error'](_0x8b45('0x2a'),_0x29180d,_0x3a832e[_0x8b45('0x29')][_0x8b45('0x2b')]);return _0x59547e(_0x3a832e['error'][_0x8b45('0x2b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x29180d,_0x8b45('0x26'));_0x59547e(_0x3a832e[_0x8b45('0x2c')][_0x8b45('0x2b')]);}})[_0x8b45('0x2d')](function(_0x40510c){logger['error'](_0x8b45('0x2a'),_0x29180d,_0x40510c);_0x54db6e(_0x40510c);});});}function respondWithStatusCode(_0x120b37,_0x4acd00){_0x4acd00=_0x4acd00||0xcc;return function(_0x4b6465){if(_0x4b6465){return _0x120b37['sendStatus'](_0x4acd00);}return _0x120b37[_0x8b45('0x2e')](_0x4acd00)[_0x8b45('0x2f')]();};}function respondWithResult(_0x5b9862,_0x4ca445){_0x4ca445=_0x4ca445||0xc8;return function(_0x5394ff){if(_0x5394ff){return _0x5b9862['status'](_0x4ca445)['json'](_0x5394ff);}};}function respondWithFilteredResult(_0x2b24f3,_0x53a363){return function(_0x28d540){if(_0x28d540){var _0x275c07=typeof _0x53a363[_0x8b45('0x30')]===_0x8b45('0x31')&&typeof _0x53a363['limit']===_0x8b45('0x31');var _0x556ce3=_0x28d540['count'];var _0x1d4bc0=_0x275c07?0x0:_0x53a363[_0x8b45('0x30')];var _0x12f8c0=_0x275c07?_0x28d540[_0x8b45('0x32')]:_0x53a363[_0x8b45('0x30')]+_0x53a363[_0x8b45('0x33')];var _0x375ac0;if(_0x12f8c0>=_0x556ce3){_0x12f8c0=_0x556ce3;_0x375ac0=0xc8;}else{_0x375ac0=0xce;}_0x2b24f3[_0x8b45('0x2e')](_0x375ac0);return _0x2b24f3[_0x8b45('0x34')](_0x8b45('0x35'),_0x1d4bc0+'-'+_0x12f8c0+'/'+_0x556ce3)[_0x8b45('0x36')](_0x28d540);}return null;};}function patchUpdates(_0x29b2f6){return function(_0x3ad042){try{jsonpatch[_0x8b45('0x37')](_0x3ad042,_0x29b2f6,!![]);}catch(_0x2b4186){return BPromise[_0x8b45('0x38')](_0x2b4186);}return _0x3ad042['save']();};}function saveUpdates(_0x1cb394,_0x1f6df6){return function(_0x4ecd9b){if(_0x4ecd9b){return _0x4ecd9b[_0x8b45('0x39')](_0x1cb394)[_0x8b45('0x24')](function(_0x4676c9){return _0x4676c9;});}return null;};}function removeEntity(_0x5e5701,_0x5e978a){return function(_0xb90a89){if(_0xb90a89){return _0xb90a89['destroy']()[_0x8b45('0x24')](function(){var _0x49c138=_0xb90a89[_0x8b45('0x3a')]({'plain':!![]});var _0x5407c6='MailAccounts';return db['UserProfileResource'][_0x8b45('0x3b')]({'where':{'type':_0x5407c6,'resourceId':_0x49c138['id']}})[_0x8b45('0x24')](function(){return _0xb90a89;});})[_0x8b45('0x24')](function(){_0x5e5701[_0x8b45('0x2e')](0xcc)[_0x8b45('0x2f')]();});}};}function handleEntityNotFound(_0x1355d4,_0x533394){return function(_0x1d9a50){if(!_0x1d9a50){_0x1355d4[_0x8b45('0x3c')](0x194);}return _0x1d9a50;};}function handleError(_0x5c4a5d,_0x485a3d){_0x485a3d=_0x485a3d||0x1f4;return function(_0x574f4e){logger[_0x8b45('0x29')](_0x574f4e[_0x8b45('0x3d')]);if(_0x574f4e[_0x8b45('0x3e')]){delete _0x574f4e[_0x8b45('0x3e')];}_0x5c4a5d['status'](_0x485a3d)['send'](_0x574f4e);};}exports[_0x8b45('0x3f')]=function(_0x5c0ee1,_0x3abe4f){var _0x292efd={'include':[{'model':db[_0x8b45('0x40')],'as':'Imap'},{'model':db[_0x8b45('0x41')],'as':'Smtp'},{'model':db[_0x8b45('0x42')],'as':'mandatoryDispositionPause'}]},_0x4bf950={},_0x3b94dc={'count':0x0,'rows':[]};var _0x40aeae=_[_0x8b45('0x43')](db[_0x8b45('0x44')][_0x8b45('0x45')],function(_0x2dc570){return{'name':_0x2dc570[_0x8b45('0x46')],'type':_0x2dc570[_0x8b45('0x47')][_0x8b45('0x48')]};});_0x4bf950[_0x8b45('0x49')]=_[_0x8b45('0x43')](_0x40aeae,_0x8b45('0x3e'));_0x4bf950[_0x8b45('0x4a')]=_[_0x8b45('0x4b')](_0x5c0ee1[_0x8b45('0x4a')]);_0x4bf950['filters']=_[_0x8b45('0x4c')](_0x4bf950[_0x8b45('0x49')],_0x4bf950[_0x8b45('0x4a')]);_0x292efd[_0x8b45('0x4d')]=_[_0x8b45('0x4c')](_0x4bf950[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x4e')]));_0x292efd[_0x8b45('0x4d')]=_0x292efd['attributes'][_0x8b45('0x4f')]?_0x292efd[_0x8b45('0x4d')]:_0x4bf950[_0x8b45('0x49')];if(!_0x5c0ee1[_0x8b45('0x4a')]['hasOwnProperty'](_0x8b45('0x50'))){_0x292efd[_0x8b45('0x33')]=qs[_0x8b45('0x33')](_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x33')]);_0x292efd[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x5c0ee1[_0x8b45('0x4a')]['offset']);}_0x292efd[_0x8b45('0x51')]=qs[_0x8b45('0x52')](_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x52')]);_0x292efd[_0x8b45('0x53')]=qs[_0x8b45('0x54')](_[_0x8b45('0x55')](_0x5c0ee1[_0x8b45('0x4a')],_0x4bf950['filters']),_0x40aeae);if(_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x56')]){_0x292efd[_0x8b45('0x53')]=_[_0x8b45('0x57')](_0x292efd['where'],{'$or':_['map'](_0x40aeae,function(_0xb54c53){if(_0xb54c53[_0x8b45('0x47')]!==_0x8b45('0x58')){var _0x4af8f3={};_0x4af8f3[_0xb54c53[_0x8b45('0x3e')]]={'$like':'%'+_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x56')]+'%'};return _0x4af8f3;}})});}_0x292efd=_[_0x8b45('0x57')]({},_0x292efd,_0x5c0ee1[_0x8b45('0x59')]);var _0x2edc95={'where':_0x292efd[_0x8b45('0x53')]};return db['MailAccount'][_0x8b45('0x32')](_0x2edc95)[_0x8b45('0x24')](function(_0x46aa61){_0x3b94dc[_0x8b45('0x32')]=_0x46aa61;if(_0x5c0ee1[_0x8b45('0x4a')][_0x8b45('0x5a')]){_0x292efd[_0x8b45('0x5b')]=[{'all':!![]}];}return db[_0x8b45('0x44')][_0x8b45('0x5c')](_0x292efd);})[_0x8b45('0x24')](function(_0x3eb663){_0x3b94dc[_0x8b45('0x5d')]=_0x3eb663;return _0x3b94dc;})[_0x8b45('0x24')](respondWithFilteredResult(_0x3abe4f,_0x292efd))[_0x8b45('0x2d')](handleError(_0x3abe4f,null));};exports[_0x8b45('0x5e')]=function(_0x48275b,_0x3d5f7b){var _0x3c535e={'raw':![],'where':{'id':_0x48275b['params']['id']},'include':[{'model':db[_0x8b45('0x40')],'as':_0x8b45('0x5f')},{'model':db[_0x8b45('0x41')],'as':_0x8b45('0x60')},{'model':db[_0x8b45('0x42')],'as':_0x8b45('0x61')}]},_0x71157b={};_0x71157b['model']=_[_0x8b45('0x4b')](db['MailAccount']['rawAttributes']);_0x71157b[_0x8b45('0x4a')]=_[_0x8b45('0x4b')](_0x48275b[_0x8b45('0x4a')]);_0x71157b[_0x8b45('0x54')]=_['intersection'](_0x71157b[_0x8b45('0x49')],_0x71157b['query']);_0x3c535e[_0x8b45('0x4d')]=_[_0x8b45('0x4c')](_0x71157b['model'],qs['fields'](_0x48275b[_0x8b45('0x4a')]['fields']));_0x3c535e['attributes']=_0x3c535e[_0x8b45('0x4d')][_0x8b45('0x4f')]?_0x3c535e[_0x8b45('0x4d')]:_0x71157b['model'];if(_0x48275b[_0x8b45('0x4a')]['includeAll']){_0x3c535e[_0x8b45('0x5b')]=[{'all':!![]}];}_0x3c535e=_[_0x8b45('0x57')]({},_0x3c535e,_0x48275b[_0x8b45('0x59')]);return db[_0x8b45('0x44')]['find'](_0x3c535e)[_0x8b45('0x24')](handleEntityNotFound(_0x3d5f7b,null))['then'](respondWithResult(_0x3d5f7b,null))[_0x8b45('0x2d')](handleError(_0x3d5f7b,null));};exports[_0x8b45('0x39')]=function(_0x2a0186,_0x374c6a){if(_0x2a0186[_0x8b45('0x62')]['id']){delete _0x2a0186[_0x8b45('0x62')]['id'];}return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0x2a0186[_0x8b45('0x64')]['id']},'include':[{'model':db[_0x8b45('0x40')],'as':_0x8b45('0x5f')},{'model':db[_0x8b45('0x41')],'as':_0x8b45('0x60')},{'model':db[_0x8b45('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x374c6a,null))['then'](saveUpdates(_0x2a0186['body'],null))[_0x8b45('0x24')](function(_0x4ed0ff){if(_0x4ed0ff&&_0x2a0186[_0x8b45('0x62')][_0x8b45('0x5f')]){return db[_0x8b45('0x40')]['update'](_0x2a0186[_0x8b45('0x62')][_0x8b45('0x5f')],{'where':{'MailAccountId':_0x4ed0ff['id']}})[_0x8b45('0x24')](function(){return _0x4ed0ff;});}return _0x4ed0ff;})[_0x8b45('0x24')](function(_0x2d0fdc){if(_0x2d0fdc&&_0x2a0186[_0x8b45('0x62')][_0x8b45('0x60')]){return db[_0x8b45('0x41')][_0x8b45('0x39')](_0x2a0186['body'][_0x8b45('0x60')],{'where':{'MailAccountId':_0x2d0fdc['id']}})[_0x8b45('0x24')](function(){return _0x2d0fdc;});}return _0x2d0fdc;})[_0x8b45('0x24')](respondWithResult(_0x374c6a,null))[_0x8b45('0x2d')](handleError(_0x374c6a,null));};exports[_0x8b45('0x65')]=function(_0x438a5a,_0x208f7a){return db[_0x8b45('0x44')][_0x8b45('0x65')]()[_0x8b45('0x24')](respondWithResult(_0x208f7a,null))[_0x8b45('0x2d')](handleError(_0x208f7a,null));};exports[_0x8b45('0x66')]=function(_0x53f941,_0x135e35,_0x5b29c5){if(_0x53f941['body']['id']){delete _0x53f941['body']['id'];}return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0x53f941[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x135e35,null))['then'](function(_0x16ef71){if(_0x16ef71){_0x53f941[_0x8b45('0x62')][_0x8b45('0x67')]=_0x16ef71['id'];return db['Disposition'][_0x8b45('0x68')](_0x53f941['body']);}})[_0x8b45('0x24')](respondWithResult(_0x135e35,null))[_0x8b45('0x2d')](handleError(_0x135e35,null));};exports['getDispositions']=function(_0x42084f,_0x4cdb15,_0x36899b){var _0x518fb0={'raw':![],'where':{}};var _0x54d4c2={};var _0x214df={'count':0x0,'rows':[]};return db['MailAccount'][_0x8b45('0x69')]({'where':{'id':_0x42084f[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x4cdb15,null))[_0x8b45('0x24')](function(_0x5d6efb){if(_0x5d6efb){_0x54d4c2['model']=_['keys'](db[_0x8b45('0x6a')][_0x8b45('0x45')]);_0x54d4c2['query']=_['keys'](_0x42084f[_0x8b45('0x4a')]);_0x54d4c2[_0x8b45('0x54')]=_[_0x8b45('0x4c')](_0x54d4c2['model'],_0x54d4c2[_0x8b45('0x4a')]);_0x518fb0[_0x8b45('0x4d')]=_[_0x8b45('0x4c')](_0x54d4c2[_0x8b45('0x49')],qs['fields'](_0x42084f[_0x8b45('0x4a')][_0x8b45('0x4e')]));_0x518fb0[_0x8b45('0x4d')]=_0x518fb0[_0x8b45('0x4d')]['length']?_0x518fb0['attributes']:_0x54d4c2[_0x8b45('0x49')];if(!_0x42084f[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x518fb0[_0x8b45('0x33')]=qs[_0x8b45('0x33')](_0x42084f[_0x8b45('0x4a')][_0x8b45('0x33')]);_0x518fb0[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x42084f[_0x8b45('0x4a')][_0x8b45('0x30')]);}_0x518fb0[_0x8b45('0x51')]=qs[_0x8b45('0x52')](_0x42084f[_0x8b45('0x4a')]['sort']);_0x518fb0['where']=qs[_0x8b45('0x54')](_[_0x8b45('0x55')](_0x42084f[_0x8b45('0x4a')],_0x54d4c2[_0x8b45('0x54')]));_0x518fb0[_0x8b45('0x53')][_0x8b45('0x67')]=_0x5d6efb['id'];if(_0x42084f[_0x8b45('0x4a')][_0x8b45('0x56')]){_0x518fb0[_0x8b45('0x53')]=_[_0x8b45('0x57')](_0x518fb0[_0x8b45('0x53')],{'$or':_[_0x8b45('0x43')](_0x518fb0[_0x8b45('0x4d')],function(_0x21b87b){var _0x3ec7d3={};_0x3ec7d3[_0x21b87b]={'$like':'%'+_0x42084f[_0x8b45('0x4a')][_0x8b45('0x56')]+'%'};return _0x3ec7d3;})});}_0x518fb0=_[_0x8b45('0x57')]({},_0x518fb0,_0x42084f[_0x8b45('0x59')]);return db[_0x8b45('0x6a')]['count']({'where':_0x518fb0[_0x8b45('0x53')]})[_0x8b45('0x24')](function(_0xf79c24){_0x214df[_0x8b45('0x32')]=_0xf79c24;if(_0x42084f[_0x8b45('0x4a')][_0x8b45('0x5a')]){_0x518fb0[_0x8b45('0x5b')]=[{'all':!![]}];}return db[_0x8b45('0x6a')][_0x8b45('0x5c')](_0x518fb0);})['then'](function(_0x6f5b49){_0x214df[_0x8b45('0x5d')]=_0x6f5b49;return _0x214df;});}})[_0x8b45('0x24')](respondWithFilteredResult(_0x4cdb15,_0x518fb0))[_0x8b45('0x2d')](handleError(_0x4cdb15,null));};exports['removeDispositions']=function(_0xb98e85,_0xc71e7f,_0x2bcd78){return db['MailAccount'][_0x8b45('0x63')]({'where':{'id':_0xb98e85[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0xc71e7f,null))[_0x8b45('0x24')](function(_0x4fb208){if(_0x4fb208){return _0x4fb208[_0x8b45('0x6c')](_0xb98e85[_0x8b45('0x4a')][_0x8b45('0x6d')]);}})[_0x8b45('0x24')](respondWithStatusCode(_0xc71e7f,null))['catch'](handleError(_0xc71e7f,null));};exports['addAnswer']=function(_0x1d4e14,_0x3aa212,_0x541688){if(_0x1d4e14[_0x8b45('0x62')]['id']){delete _0x1d4e14[_0x8b45('0x62')]['id'];}return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0x1d4e14[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x3aa212,null))[_0x8b45('0x24')](function(_0xece1b5){if(_0xece1b5){_0x1d4e14['body']['MailAccountId']=_0xece1b5['id'];return db['CannedAnswer'][_0x8b45('0x68')](_0x1d4e14[_0x8b45('0x62')]);}})[_0x8b45('0x24')](respondWithResult(_0x3aa212,null))['catch'](handleError(_0x3aa212,null));};exports[_0x8b45('0x6e')]=function(_0x494584,_0x327f9f,_0x1e6276){var _0x38694b={'raw':![],'where':{}};var _0x43a231={};var _0x366800={'count':0x0,'rows':[]};return db[_0x8b45('0x44')]['findOne']({'where':{'id':_0x494584[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x327f9f,null))[_0x8b45('0x24')](function(_0x30baa3){if(_0x30baa3){_0x43a231['model']=_[_0x8b45('0x4b')](db[_0x8b45('0x6f')][_0x8b45('0x45')]);_0x43a231[_0x8b45('0x4a')]=_[_0x8b45('0x4b')](_0x494584[_0x8b45('0x4a')]);_0x43a231['filters']=_[_0x8b45('0x4c')](_0x43a231[_0x8b45('0x49')],_0x43a231['query']);_0x38694b[_0x8b45('0x4d')]=_['intersection'](_0x43a231[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x494584[_0x8b45('0x4a')][_0x8b45('0x4e')]));_0x38694b[_0x8b45('0x4d')]=_0x38694b['attributes'][_0x8b45('0x4f')]?_0x38694b[_0x8b45('0x4d')]:_0x43a231[_0x8b45('0x49')];if(!_0x494584[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x38694b[_0x8b45('0x33')]=qs['limit'](_0x494584[_0x8b45('0x4a')][_0x8b45('0x33')]);_0x38694b[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x494584[_0x8b45('0x4a')][_0x8b45('0x30')]);}_0x38694b[_0x8b45('0x51')]=qs[_0x8b45('0x52')](_0x494584[_0x8b45('0x4a')][_0x8b45('0x52')]);_0x38694b[_0x8b45('0x53')]=qs[_0x8b45('0x54')](_[_0x8b45('0x55')](_0x494584[_0x8b45('0x4a')],_0x43a231[_0x8b45('0x54')]));_0x38694b[_0x8b45('0x53')][_0x8b45('0x67')]=_0x30baa3['id'];if(_0x494584[_0x8b45('0x4a')][_0x8b45('0x56')]){_0x38694b['where']=_[_0x8b45('0x57')](_0x38694b[_0x8b45('0x53')],{'$or':_[_0x8b45('0x43')](_0x38694b[_0x8b45('0x4d')],function(_0x208c2d){var _0x2e12f6={};_0x2e12f6[_0x208c2d]={'$like':'%'+_0x494584['query'][_0x8b45('0x56')]+'%'};return _0x2e12f6;})});}_0x38694b=_[_0x8b45('0x57')]({},_0x38694b,_0x494584['options']);return db[_0x8b45('0x6f')]['count']({'where':_0x38694b[_0x8b45('0x53')]})[_0x8b45('0x24')](function(_0x533f33){_0x366800[_0x8b45('0x32')]=_0x533f33;if(_0x494584[_0x8b45('0x4a')][_0x8b45('0x5a')]){_0x38694b[_0x8b45('0x5b')]=[{'all':!![]}];}return db[_0x8b45('0x6f')][_0x8b45('0x5c')](_0x38694b);})['then'](function(_0x2a79a9){_0x366800['rows']=_0x2a79a9;return _0x366800;});}})[_0x8b45('0x24')](respondWithFilteredResult(_0x327f9f,_0x38694b))[_0x8b45('0x2d')](handleError(_0x327f9f,null));};exports[_0x8b45('0x70')]=function(_0xee3f9a,_0x4fa795,_0x3fdcb3){return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0xee3f9a[_0x8b45('0x64')]['id']}})['then'](handleEntityNotFound(_0x4fa795,null))[_0x8b45('0x24')](function(_0x483545){if(_0x483545){return _0x483545[_0x8b45('0x70')](_0xee3f9a['query'][_0x8b45('0x6d')]);}})['then'](respondWithStatusCode(_0x4fa795,null))[_0x8b45('0x2d')](handleError(_0x4fa795,null));};exports[_0x8b45('0x68')]=function(_0x14c136,_0x45df26){var _0x308976={'name':_0x14c136['body'][_0x8b45('0x3e')],'key':_0x14c136['body'][_0x8b45('0x48')],'email':_0x14c136[_0x8b45('0x62')][_0x8b45('0x71')],'ListId':_0x14c136[_0x8b45('0x62')][_0x8b45('0x72')],'active':!_[_0x8b45('0x73')](_0x14c136[_0x8b45('0x62')][_0x8b45('0x74')])?_0x14c136['body']['active']:!![],'description':_0x14c136[_0x8b45('0x62')][_0x8b45('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0x8b45('0x73')](_0x14c136['body'][_0x8b45('0x76')])){if(_0x14c136[_0x8b45('0x62')]['cauthentication']){_0x308976[_0x8b45('0x5f')][_0x8b45('0x77')]=_0x308976[_0x8b45('0x60')][_0x8b45('0x77')]=_0x14c136[_0x8b45('0x62')][_0x8b45('0x78')];_0x308976[_0x8b45('0x5f')]['password']=_0x308976[_0x8b45('0x60')][_0x8b45('0x79')]=_0x14c136['body'][_0x8b45('0x7a')];}else{_0x308976[_0x8b45('0x5f')]['authentication']=_0x308976[_0x8b45('0x60')][_0x8b45('0x7b')]=![];}_0x308976[_0x8b45('0x5f')]['host']=_0x14c136[_0x8b45('0x62')][_0x8b45('0x5f')][_0x8b45('0x7c')];_0x308976[_0x8b45('0x5f')][_0x8b45('0x7d')]=_0x14c136[_0x8b45('0x62')]['Imap']['port'];_0x308976[_0x8b45('0x60')]['host']=_0x14c136['body'][_0x8b45('0x60')][_0x8b45('0x7c')];_0x308976['Smtp'][_0x8b45('0x7d')]=_0x14c136[_0x8b45('0x62')][_0x8b45('0x60')][_0x8b45('0x7d')];}else{_0x308976['Imap'][_0x8b45('0x7e')]=_0x308976[_0x8b45('0x60')][_0x8b45('0x7e')]=_0x14c136[_0x8b45('0x62')]['cservice'];_0x308976['Imap'][_0x8b45('0x77')]=_0x308976['Smtp'][_0x8b45('0x77')]=_0x14c136[_0x8b45('0x62')][_0x8b45('0x78')];_0x308976[_0x8b45('0x5f')][_0x8b45('0x7f')]=_0x308976[_0x8b45('0x60')][_0x8b45('0x79')]=_0x14c136['body'][_0x8b45('0x7a')];}return db[_0x8b45('0x44')]['create'](_0x308976,{'include':[{'model':db[_0x8b45('0x41')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x8b45('0x5f')}]})['then'](function(_0x174676){var _0x404186=_0x14c136['user'][_0x8b45('0x3a')]({'plain':!![]});if(!_0x404186)throw new Error(_0x8b45('0x80'));if(_0x404186['role']==='user'){var _0x2aa073=_0x174676[_0x8b45('0x3a')]({'plain':!![]});return db[_0x8b45('0x81')][_0x8b45('0x63')]({'where':{'name':_0x8b45('0x82'),'userProfileId':_0x404186[_0x8b45('0x83')]},'raw':!![]})[_0x8b45('0x24')](function(_0x32acb3){if(_0x32acb3&&_0x32acb3[_0x8b45('0x84')]===0x0){return db[_0x8b45('0x85')][_0x8b45('0x68')]({'name':_0x2aa073[_0x8b45('0x3e')],'resourceId':_0x2aa073['id'],'type':_0x32acb3['name'],'sectionId':_0x32acb3['id']},{})[_0x8b45('0x24')](function(){return _0x174676;});}else{return _0x174676;}})[_0x8b45('0x2d')](function(_0x3b00f8){logger[_0x8b45('0x29')](_0x8b45('0x86'),_0x3b00f8);throw _0x3b00f8;});}return _0x174676;})[_0x8b45('0x24')](respondWithResult(_0x45df26,0xc9))[_0x8b45('0x2d')](handleError(_0x45df26,null));};exports[_0x8b45('0x87')]=function(_0x2b6890,_0xe222b2,_0x32d08f){return db[_0x8b45('0x44')][_0x8b45('0x69')]({'where':{'id':_0x2b6890['params']['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0xe222b2,null))[_0x8b45('0x24')](function(_0x29d4a5){if(_0x29d4a5){return _0x29d4a5['getImap']();}return null;})['then'](respondWithResult(_0xe222b2,null))['catch'](handleError(_0xe222b2,null));};exports[_0x8b45('0x88')]=function(_0x1ac2bf,_0x4e8bc0,_0x5226bc){if(_0x1ac2bf[_0x8b45('0x62')]['id']){delete _0x1ac2bf[_0x8b45('0x62')]['id'];}return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0x1ac2bf[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x4e8bc0,null))['then'](function(_0x2e1319){if(_0x2e1319){_0x1ac2bf[_0x8b45('0x62')]['MailAccountId']=_0x2e1319['id'];return db[_0x8b45('0x40')][_0x8b45('0x68')](_0x1ac2bf[_0x8b45('0x62')]);}})[_0x8b45('0x24')](respondWithResult(_0x4e8bc0,null))[_0x8b45('0x2d')](handleError(_0x4e8bc0,null));};exports[_0x8b45('0x89')]=function(_0x5324ae,_0x5b9fc2,_0x280e56){return db[_0x8b45('0x44')]['findOne']({'where':{'id':_0x5324ae['params']['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x5b9fc2,null))[_0x8b45('0x24')](function(_0x3fa2a7){if(_0x3fa2a7){return _0x3fa2a7[_0x8b45('0x8a')](null);}return null;})[_0x8b45('0x24')](respondWithStatusCode(_0x5b9fc2,null))[_0x8b45('0x2d')](handleError(_0x5b9fc2,null));};exports['getSmtp']=function(_0x306894,_0x2e67ac,_0x49e968){return db[_0x8b45('0x44')][_0x8b45('0x69')]({'where':{'id':_0x306894[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x2e67ac,null))[_0x8b45('0x24')](function(_0x4242aa){if(_0x4242aa){return _0x4242aa[_0x8b45('0x8b')]();}return null;})[_0x8b45('0x24')](respondWithResult(_0x2e67ac,null))[_0x8b45('0x2d')](handleError(_0x2e67ac,null));};exports['addSmtp']=function(_0x5186b8,_0x442494,_0x5e2c7c){if(_0x5186b8[_0x8b45('0x62')]['id']){delete _0x5186b8[_0x8b45('0x62')]['id'];}return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0x5186b8['params']['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x442494,null))[_0x8b45('0x24')](function(_0x51551a){if(_0x51551a){_0x5186b8[_0x8b45('0x62')][_0x8b45('0x67')]=_0x51551a['id'];return db[_0x8b45('0x41')][_0x8b45('0x68')](_0x5186b8['body']);}})[_0x8b45('0x24')](respondWithResult(_0x442494,null))[_0x8b45('0x2d')](handleError(_0x442494,null));};exports['removeSmtp']=function(_0x3b1aa4,_0x4067de,_0x31eb8e){return db['MailAccount'][_0x8b45('0x69')]({'where':{'id':_0x3b1aa4['params']['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x4067de,null))[_0x8b45('0x24')](function(_0x16b4c3){if(_0x16b4c3){return _0x16b4c3[_0x8b45('0x8c')](null);}return null;})[_0x8b45('0x24')](respondWithStatusCode(_0x4067de,null))['catch'](handleError(_0x4067de,null));};exports[_0x8b45('0x8d')]=function(_0x437a5c,_0x2bf7a1,_0x37006d){return db[_0x8b45('0x8e')][_0x8b45('0x63')]({'where':{'id':_0x437a5c[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x2bf7a1,null))['then'](function(_0x2eb308){if(_0x2eb308){return _0x2eb308[_0x8b45('0x8d')](_0x437a5c[_0x8b45('0x62')]['ids'],_[_0x8b45('0x8f')](_0x437a5c[_0x8b45('0x62')],[_0x8b45('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x2bf7a1,null))[_0x8b45('0x2d')](handleError(_0x2bf7a1,null));};exports[_0x8b45('0x90')]=function(_0x4300aa,_0x1e35f4,_0x1d58fe){var _0x207b3d={'raw':![],'where':{}};var _0x4e4490={};var _0x272b8e={'count':0x0,'rows':[]};return db[_0x8b45('0x44')][_0x8b45('0x69')]({'where':{'id':_0x4300aa[_0x8b45('0x64')]['id']}})['then'](handleEntityNotFound(_0x1e35f4,null))[_0x8b45('0x24')](function(_0xcc3a03){if(_0xcc3a03){_0x4e4490[_0x8b45('0x49')]=_[_0x8b45('0x4b')](db[_0x8b45('0x8e')][_0x8b45('0x45')]);_0x4e4490[_0x8b45('0x4a')]=_['keys'](_0x4300aa[_0x8b45('0x4a')]);_0x4e4490[_0x8b45('0x54')]=_[_0x8b45('0x4c')](_0x4e4490['model'],_0x4e4490[_0x8b45('0x4a')]);_0x207b3d[_0x8b45('0x4d')]=_['intersection'](_0x4e4490[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x4e')]));_0x207b3d[_0x8b45('0x4d')]=_0x207b3d[_0x8b45('0x4d')][_0x8b45('0x4f')]?_0x207b3d[_0x8b45('0x4d')]:_0x4e4490[_0x8b45('0x49')];if(!_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x207b3d[_0x8b45('0x33')]=qs[_0x8b45('0x33')](_0x4300aa[_0x8b45('0x4a')]['limit']);_0x207b3d[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x30')]);}_0x207b3d[_0x8b45('0x51')]=qs[_0x8b45('0x52')](_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x52')]);_0x207b3d['where']=qs['filters'](_[_0x8b45('0x55')](_0x4300aa[_0x8b45('0x4a')],_0x4e4490[_0x8b45('0x54')]));_0x207b3d[_0x8b45('0x53')][_0x8b45('0x67')]=_0xcc3a03['id'];if(_0x4300aa['query'][_0x8b45('0x56')]){_0x207b3d[_0x8b45('0x53')]=_[_0x8b45('0x57')](_0x207b3d['where'],{'$or':_['map'](_0x207b3d[_0x8b45('0x4d')],function(_0x5bc9be){var _0x44571d={};_0x44571d[_0x5bc9be]={'$like':'%'+_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x56')]+'%'};return _0x44571d;})});}_0x207b3d=_[_0x8b45('0x57')]({},_0x207b3d,_0x4300aa[_0x8b45('0x59')]);return db[_0x8b45('0x8e')][_0x8b45('0x32')]({'where':_0x207b3d[_0x8b45('0x53')]})[_0x8b45('0x24')](function(_0x2544e4){_0x272b8e[_0x8b45('0x32')]=_0x2544e4;if(_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x5a')]){_0x207b3d[_0x8b45('0x5b')]=[{'model':db[_0x8b45('0x91')],'as':_0x8b45('0x92'),'required':![]},{'model':db[_0x8b45('0x93')],'as':'Owner','attributes':[_0x8b45('0x3e'),_0x8b45('0x94'),'internal'],'required':![]},{'model':db[_0x8b45('0x95')],'as':_0x8b45('0x96'),'attributes':['id',_0x8b45('0x3e'),_0x8b45('0x97')],'where':_0x4300aa[_0x8b45('0x4a')]['tag']?{'id':_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x98')]}:undefined,'required':_0x4300aa[_0x8b45('0x4a')][_0x8b45('0x98')]?!![]:![]}];}return db[_0x8b45('0x8e')]['findAll'](_0x207b3d);})['then'](function(_0x131efd){_0x272b8e[_0x8b45('0x5d')]=_0x131efd;return _0x272b8e;});}})['then'](respondWithFilteredResult(_0x1e35f4,_0x207b3d))[_0x8b45('0x2d')](handleError(_0x1e35f4,null));};exports[_0x8b45('0x99')]=function addApplications(_0x1db1ae,_0x24891e){var _0x140b91=_0x1db1ae['params']['id'];var _0x491341=_0x1db1ae[_0x8b45('0x62')];var _0x2465f2=0xc8;var _0x3e930f=null;return db['sequelize'][_0x8b45('0x9a')]({'isolationLevel':db[_0x8b45('0x9b')][_0x8b45('0x9c')][_0x8b45('0x9d')][_0x8b45('0x9e')]},function(_0x4da38f){return db[_0x8b45('0x44')][_0x8b45('0x69')]({'where':{'id':_0x140b91},'transaction':_0x4da38f})[_0x8b45('0x24')](function(_0x5720ad){if(_0x5720ad){return db[_0x8b45('0x9f')][_0x8b45('0x3b')]({'where':{'MailAccountId':_0x140b91},'transaction':_0x4da38f})[_0x8b45('0x24')](function(){var _0x4627be=_[_0x8b45('0x43')](_0x491341,function(_0x858966){_0x858966[_0x8b45('0x67')]=_0x140b91;return _0x858966;});return db['MailApplication'][_0x8b45('0xa0')](_0x4627be,{'transaction':_0x4da38f});});}else{_0x2465f2=0x194;_0x3e930f=[];}});})['then'](function(){if(_0x2465f2!==0x194){return db[_0x8b45('0x9f')][_0x8b45('0xa1')]({'where':{'MailAccountId':_0x140b91},'order':_0x8b45('0xa2')})[_0x8b45('0x24')](function(_0x2e22c0){_0x3e930f=_0x2e22c0;});}})[_0x8b45('0x2d')](function(_0x51ecb1){_0x2465f2=0x1f4;logger['error'](_0x51ecb1['stack']);if(_0x51ecb1[_0x8b45('0x3e')]){delete _0x51ecb1['name'];}_0x3e930f=_0x51ecb1;})['finally'](function(){if(_0x3e930f===null){_0x24891e[_0x8b45('0x3c')](_0x2465f2);}else{if(_0x2465f2===0x1f4){_0x24891e[_0x8b45('0x2e')](_0x2465f2)[_0x8b45('0xa3')](_0x3e930f);}else{_0x24891e['status'](_0x2465f2)['json'](_0x3e930f);}}});};exports[_0x8b45('0xa4')]=function(_0x192541,_0x1ef86b,_0x29bdc4){var _0x43a2ab={};var _0x418d04={};var _0x107ad7;var _0x26f9f1;return db['MailAccount'][_0x8b45('0x69')]({'where':{'id':_0x192541['params']['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x1ef86b,null))['then'](function(_0xcd3069){if(_0xcd3069){_0x107ad7=_0xcd3069;_0x418d04['model']=_[_0x8b45('0x4b')](db['MailApplication'][_0x8b45('0x45')]);_0x418d04[_0x8b45('0x4a')]=_['keys'](_0x192541['query']);_0x418d04[_0x8b45('0x54')]=_[_0x8b45('0x4c')](_0x418d04['model'],_0x418d04[_0x8b45('0x4a')]);_0x43a2ab[_0x8b45('0x4d')]=_[_0x8b45('0x4c')](_0x418d04[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x192541['query'][_0x8b45('0x4e')]));_0x43a2ab[_0x8b45('0x4d')]=_0x43a2ab[_0x8b45('0x4d')][_0x8b45('0x4f')]?_0x43a2ab[_0x8b45('0x4d')]:_0x418d04[_0x8b45('0x49')];_0x43a2ab[_0x8b45('0x51')]=qs['sort'](_0x192541[_0x8b45('0x4a')][_0x8b45('0x52')]);_0x43a2ab[_0x8b45('0x53')]=qs[_0x8b45('0x54')](_['pick'](_0x192541[_0x8b45('0x4a')],_0x418d04[_0x8b45('0x54')]));if(_0x192541[_0x8b45('0x4a')][_0x8b45('0x56')]){_0x43a2ab[_0x8b45('0x53')]=_[_0x8b45('0x57')](_0x43a2ab['where'],{'$or':_[_0x8b45('0x43')](_0x43a2ab['attributes'],function(_0x3cf91e){var _0x332f81={};_0x332f81[_0x3cf91e]={'$like':'%'+_0x192541['query'][_0x8b45('0x56')]+'%'};return _0x332f81;})});}_0x43a2ab=_['merge']({},_0x43a2ab,_0x192541[_0x8b45('0x59')]);return _0x107ad7['getApplications'](_0x43a2ab);}})[_0x8b45('0x24')](function(_0x123f33){if(_0x123f33){_0x26f9f1=_0x123f33[_0x8b45('0x4f')];if(!_0x192541[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x43a2ab['limit']=qs[_0x8b45('0x33')](_0x192541['query']['limit']);_0x43a2ab[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x192541[_0x8b45('0x4a')][_0x8b45('0x30')]);}return _0x107ad7['getApplications'](_0x43a2ab);}})['then'](function(_0x5821c5){if(_0x5821c5){return _0x5821c5?{'count':_0x26f9f1,'rows':_0x5821c5}:null;}})['then'](respondWithResult(_0x1ef86b,null))[_0x8b45('0x2d')](handleError(_0x1ef86b,null));};exports[_0x8b45('0xa5')]=function(_0x25fa14,_0x1f9004,_0x3ffcc3){var _0x3b7c40={'raw':!![],'where':{}};var _0x199b6e={};var _0x14c2a1={'count':0x0,'rows':[]};return db[_0x8b45('0x44')]['findOne']({'where':{'id':_0x25fa14['params']['id']}})['then'](handleEntityNotFound(_0x1f9004,null))[_0x8b45('0x24')](function(_0x7f9b63){if(_0x7f9b63){_0x199b6e[_0x8b45('0x49')]=_[_0x8b45('0x4b')](db['MailMessage']['rawAttributes']);_0x199b6e[_0x8b45('0x4a')]=_['keys'](_0x25fa14[_0x8b45('0x4a')]);_0x199b6e[_0x8b45('0x54')]=_[_0x8b45('0x4c')](_0x199b6e[_0x8b45('0x49')],_0x199b6e[_0x8b45('0x4a')]);_0x3b7c40['attributes']=_[_0x8b45('0x4c')](_0x199b6e[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x25fa14['query'][_0x8b45('0x4e')]));_0x3b7c40[_0x8b45('0x4d')]=_0x3b7c40[_0x8b45('0x4d')]['length']?_0x3b7c40[_0x8b45('0x4d')]:_0x199b6e['model'];if(!_0x25fa14[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x3b7c40[_0x8b45('0x33')]=qs['limit'](_0x25fa14[_0x8b45('0x4a')][_0x8b45('0x33')]);_0x3b7c40[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x25fa14[_0x8b45('0x4a')][_0x8b45('0x30')]);}_0x3b7c40['order']=qs[_0x8b45('0x52')](_0x25fa14[_0x8b45('0x4a')]['sort']);_0x3b7c40[_0x8b45('0x53')]=qs[_0x8b45('0x54')](_[_0x8b45('0x55')](_0x25fa14[_0x8b45('0x4a')],_0x199b6e[_0x8b45('0x54')]));_0x3b7c40[_0x8b45('0x53')][_0x8b45('0x67')]=_0x7f9b63['id'];if(_0x25fa14[_0x8b45('0x4a')]['filter']){_0x3b7c40['where']=_[_0x8b45('0x57')](_0x3b7c40['where'],{'$or':_[_0x8b45('0x43')](_0x3b7c40[_0x8b45('0x4d')],function(_0x2c38f7){var _0x2b2cd3={};_0x2b2cd3[_0x2c38f7]={'$like':'%'+_0x25fa14['query'][_0x8b45('0x56')]+'%'};return _0x2b2cd3;})});}if(_0x25fa14['query'][_0x8b45('0xa6')]){var _0x29e98f=_0x25fa14[_0x8b45('0x4a')][_0x8b45('0xa6')][_0x8b45('0xa7')](',');var _0x7a15e3={};_0x7a15e3[_0x29e98f[0x0]]={'$gte':moment(_0x29e98f[0x1])[_0x8b45('0xa8')](_0x8b45('0xa9'))};_0x3b7c40['where']=_[_0x8b45('0x57')](_0x3b7c40[_0x8b45('0x53')],_0x7a15e3);}_0x3b7c40=_[_0x8b45('0x57')]({},_0x3b7c40,_0x25fa14[_0x8b45('0x59')]);return db['MailMessage'][_0x8b45('0x32')]({'where':_0x3b7c40[_0x8b45('0x53')]})[_0x8b45('0x24')](function(_0x2c5c05){_0x14c2a1[_0x8b45('0x32')]=_0x2c5c05;if(_0x25fa14[_0x8b45('0x4a')][_0x8b45('0x5a')]){_0x3b7c40[_0x8b45('0x5b')]=[{'all':!![]}];}return db[_0x8b45('0xaa')][_0x8b45('0x5c')](_0x3b7c40);})[_0x8b45('0x24')](function(_0x17ac48){if(_0x25fa14[_0x8b45('0x4a')][_0x8b45('0xab')]==='true'){for(var _0x80a3da=0x0;_0x80a3da<_0x17ac48[_0x8b45('0x4f')];_0x80a3da++){_0x17ac48[_0x80a3da][_0x8b45('0x62')]=juice(_0x17ac48[_0x80a3da]['body']);}}_0x14c2a1[_0x8b45('0x5d')]=_0x17ac48;return _0x14c2a1;});}})[_0x8b45('0x24')](respondWithFilteredResult(_0x1f9004,_0x3b7c40))['catch'](handleError(_0x1f9004,null));};exports[_0x8b45('0xa3')]=function(_0xbb74c,_0x503c82,_0x2aedcf){var _0x1fe686,_0x21c41c={},_0x303d83;if(_0xbb74c[_0x8b45('0x62')]['to']){_0x303d83=_0xbb74c[_0x8b45('0x62')]['to']['split'](',')[0x0];}return db[_0x8b45('0x44')]['find']({'where':{'id':_0xbb74c['params']['id']},'include':[{'model':db[_0x8b45('0xac')],'as':_0x8b45('0xad'),'include':[{'model':db[_0x8b45('0x91')],'as':_0x8b45('0xae'),'where':{'email':_0x303d83},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8b45('0x41')],'as':'Smtp','raw':!![]}]})[_0x8b45('0x24')](handleEntityNotFound(_0x503c82,null))['then'](function(_0xdb711b){if(_0xdb711b){_0x1fe686=_0xdb711b;if(_0xdb711b[_0x8b45('0x60')]){if(_[_0x8b45('0x73')](_0xbb74c[_0x8b45('0x62')][_0x8b45('0xaf')])){_0xbb74c[_0x8b45('0x62')][_0x8b45('0xaf')]=util[_0x8b45('0xa8')]('%s\x20<%s>',_0xdb711b['name'],_0xdb711b[_0x8b45('0x71')]||_0xdb711b[_0x8b45('0x60')][_0x8b45('0x77')]);}if(_0xbb74c[_0x8b45('0x62')][_0x8b45('0xb0')]&&_0xbb74c[_0x8b45('0x62')][_0x8b45('0xb0')][_0x8b45('0x4f')]){for(var _0x648f91=0x0;_0x648f91<_0xbb74c[_0x8b45('0x62')]['attachments']['length'];_0x648f91+=0x1){_0xbb74c['body']['attachments'][_0x648f91]={'filename':_0xbb74c[_0x8b45('0x62')]['attachments'][_0x648f91][_0x8b45('0x3e')],'path':path[_0x8b45('0xb1')](config[_0x8b45('0xb2')],_0x8b45('0xb3'),_0xbb74c[_0x8b45('0x62')][_0x8b45('0xb0')][_0x648f91]['basename'])};}}var _0x188ba1={'tls':{'rejectUnauthorized':![]}};if(_[_0x8b45('0x73')](_0xdb711b[_0x8b45('0x60')][_0x8b45('0x7e')])){if(_0xdb711b[_0x8b45('0x60')][_0x8b45('0x7b')]){_0x188ba1[_0x8b45('0xb4')]={'user':_0xdb711b['Smtp'][_0x8b45('0x77')],'pass':_0xdb711b['Smtp'][_0x8b45('0x79')]};}_0x188ba1[_0x8b45('0x7c')]=_0xdb711b[_0x8b45('0x60')][_0x8b45('0x7c')];_0x188ba1[_0x8b45('0x7d')]=_0xdb711b[_0x8b45('0x60')][_0x8b45('0x7d')];_0x188ba1[_0x8b45('0xb5')]=_0xdb711b[_0x8b45('0x60')][_0x8b45('0xb5')];}else{_0x188ba1[_0x8b45('0x7e')]=_0xdb711b[_0x8b45('0x60')][_0x8b45('0x7e')];_0x188ba1['auth']={'user':_0xdb711b[_0x8b45('0x60')][_0x8b45('0x77')],'pass':_0xdb711b[_0x8b45('0x60')][_0x8b45('0x79')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x188ba1,'message':_0xbb74c[_0x8b45('0x62')]});}else{throw new Error(_0x8b45('0xb6'));}}})[_0x8b45('0x24')](function(_0x37a230){if(_0x37a230){_0x21c41c=_0x37a230;if(_0x1fe686[_0x8b45('0xad')]){if(_0x1fe686['List'][_0x8b45('0xae')][_0x8b45('0x4f')]){return _0x1fe686[_0x8b45('0xad')][_0x8b45('0xae')][0x0];}else{return db[_0x8b45('0x91')][_0x8b45('0x68')](_[_0x8b45('0x1b')](_0xbb74c[_0x8b45('0x62')],{'firstName':_0xbb74c[_0x8b45('0x62')]['to'],'email':_0xbb74c[_0x8b45('0x62')]['to'],'phone':_0xbb74c['body']['to'],'ListId':_0x1fe686[_0x8b45('0x72')]}));}}else{throw new Error(_0x8b45('0xb6'));}}})[_0x8b45('0x24')](function(_0x845e1a){if(_0x845e1a){var _0x1d9ca9={'UserId':_0xbb74c[_0x8b45('0x77')]['id'],'ContactId':_0x845e1a['id'],'MailAccountId':_0x1fe686['id'],'inReplyTo':_0x21c41c[_0x8b45('0xb7')],'to':_0xbb74c[_0x8b45('0x62')][_0x8b45('0xaf')],'cc':_0xbb74c[_0x8b45('0x62')]['cc'],'subject':_0xbb74c['body']['subject'],'attach':_0xbb74c[_0x8b45('0x62')][_0x8b45('0xb8')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x8b45('0xa9')),'lastMsgDirection':_0x8b45('0xb9'),'Messages':[_[_0x8b45('0x57')](_0xbb74c[_0x8b45('0x62')],{'messageId':_0x21c41c[_0x8b45('0xb7')],'sentAt':moment()['format'](_0x8b45('0xa9')),'read':!![],'MailAccountId':_0x1fe686['id'],'UserId':_0xbb74c['user']['id'],'ContactId':_0x845e1a['id']})]};if(_0xbb74c[_0x8b45('0x62')][_0x8b45('0xba')]){_0x1d9ca9=_[_0x8b45('0x57')](_0x1d9ca9,_0xbb74c[_0x8b45('0x62')][_0x8b45('0xba')]);}return db[_0x8b45('0x8e')][_0x8b45('0x68')](_0x1d9ca9,{'include':[{'model':db[_0x8b45('0xaa')],'as':_0x8b45('0xbb')}]});}})[_0x8b45('0x24')](respondWithResult(_0x503c82,null))[_0x8b45('0x2d')](handleError(_0x503c82,null));};exports[_0x8b45('0xbc')]=function(_0x1a3fd5,_0x1063a5,_0x43f363){return db['MailAccount'][_0x8b45('0x63')]({'where':{'id':_0x1a3fd5[_0x8b45('0x64')]['id']},'include':[{'model':db[_0x8b45('0x41')],'as':_0x8b45('0x60'),'raw':!![]}]})[_0x8b45('0x24')](handleEntityNotFound(_0x1063a5,null))[_0x8b45('0x24')](function(_0x3f7681){if(_0x3f7681&&_0x3f7681['Smtp']){var _0x1572a0={'id':_0x3f7681['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3f7681[_0x8b45('0x60')][_0x8b45('0x7e')]){_0x1572a0[_0x8b45('0x7e')]=_0x3f7681[_0x8b45('0x60')]['service'];}else{_0x1572a0[_0x8b45('0x7c')]=_0x3f7681[_0x8b45('0x60')][_0x8b45('0x7c')];_0x1572a0['port']=_0x3f7681[_0x8b45('0x60')][_0x8b45('0x7d')];_0x1572a0[_0x8b45('0xb5')]=_0x3f7681[_0x8b45('0x60')][_0x8b45('0xb5')];}if(_0x3f7681[_0x8b45('0x60')][_0x8b45('0x7b')]){_0x1572a0[_0x8b45('0xb4')]={'user':_0x3f7681[_0x8b45('0x60')][_0x8b45('0x77')],'pass':_0x3f7681[_0x8b45('0x60')][_0x8b45('0x79')]};}return respondWithRpcPromise(_0x8b45('0xbd'),_0x8b45('0xbc'),{'account':_0x1572a0});}})['then'](respondWithResult(_0x1063a5,null))[_0x8b45('0x2d')](handleError(_0x1063a5,null));};exports[_0x8b45('0x3b')]=function(_0x218706,_0x51aff4){return db[_0x8b45('0x44')]['find']({'where':{'id':_0x218706[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x51aff4,null))[_0x8b45('0x24')](function(_0x3acb3f){if(_0x3acb3f&&_0x3acb3f['service']){throw new db[(_0x8b45('0xbe'))][(_0x8b45('0xbf'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3acb3f;})['then'](removeEntity(_0x51aff4,null))['catch'](handleError(_0x51aff4,null));};exports[_0x8b45('0xc0')]=function(_0xa76968,_0x4f7716,_0xfa7263){return db[_0x8b45('0x44')][_0x8b45('0x63')]({'where':{'id':_0xa76968[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x4f7716,null))[_0x8b45('0x24')](function(_0x401d63){if(_0x401d63){return _0x401d63[_0x8b45('0xc0')](_0xa76968[_0x8b45('0x62')][_0x8b45('0x6d')],_[_0x8b45('0x8f')](_0xa76968['body'],[_0x8b45('0x6d'),'id'])||{})[_0x8b45('0xc1')](function(_0x590d17){for(var _0x4d9eaf=0x0;_0x4d9eaf<_0xa76968['body'][_0x8b45('0x6d')][_0x8b45('0x4f')];_0x4d9eaf+=0x1){socket[_0x8b45('0xc2')](_0x8b45('0xc3'),{'UserId':Number(_0xa76968[_0x8b45('0x62')][_0x8b45('0x6d')][_0x4d9eaf]),'MailAccountId':Number(_0xa76968[_0x8b45('0x64')]['id'])});}return _0x590d17;});}})[_0x8b45('0x24')](respondWithResult(_0x4f7716,null))[_0x8b45('0x2d')](handleError(_0x4f7716,null));};exports[_0x8b45('0xc4')]=function(_0x301f33,_0x206770,_0x34fece){return db['MailAccount'][_0x8b45('0x63')]({'where':{'id':_0x301f33[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x206770,null))[_0x8b45('0x24')](function(_0x2468e9){if(_0x2468e9){return _0x2468e9[_0x8b45('0xc4')](_0x301f33[_0x8b45('0x4a')]['ids'])[_0x8b45('0x24')](function(){if(_[_0x8b45('0xc5')](_0x301f33[_0x8b45('0x4a')][_0x8b45('0x6d')])){for(var _0x5bff56=0x0;_0x5bff56<_0x301f33['query'][_0x8b45('0x6d')][_0x8b45('0x4f')];_0x5bff56+=0x1){socket[_0x8b45('0xc2')](_0x8b45('0xc6'),{'UserId':Number(_0x301f33[_0x8b45('0x4a')][_0x8b45('0x6d')][_0x5bff56]),'MailAccountId':Number(_0x301f33['params']['id'])});}}else{socket[_0x8b45('0xc2')](_0x8b45('0xc6'),{'UserId':Number(_0x301f33[_0x8b45('0x4a')][_0x8b45('0x6d')]),'MailAccountId':Number(_0x301f33[_0x8b45('0x64')]['id'])});}});}})[_0x8b45('0x24')](respondWithStatusCode(_0x206770,null))[_0x8b45('0x2d')](handleError(_0x206770,null));};exports[_0x8b45('0xc7')]=function(_0x21e51e,_0x3109a8,_0x1dc735){var _0x1b5cc2={};var _0x46293e={};var _0x23adfa;var _0x5bab0c;return db[_0x8b45('0x44')]['findOne']({'where':{'id':_0x21e51e[_0x8b45('0x64')]['id']}})[_0x8b45('0x24')](handleEntityNotFound(_0x3109a8,null))[_0x8b45('0x24')](function(_0x4ef6e8){if(_0x4ef6e8){_0x23adfa=_0x4ef6e8;_0x46293e[_0x8b45('0x49')]=_[_0x8b45('0x4b')](db[_0x8b45('0x93')][_0x8b45('0x45')]);_0x46293e[_0x8b45('0x4a')]=_['keys'](_0x21e51e[_0x8b45('0x4a')]);_0x46293e[_0x8b45('0x54')]=_[_0x8b45('0x4c')](_0x46293e[_0x8b45('0x49')],_0x46293e[_0x8b45('0x4a')]);_0x1b5cc2[_0x8b45('0x4d')]=_[_0x8b45('0x4c')](_0x46293e[_0x8b45('0x49')],qs[_0x8b45('0x4e')](_0x21e51e[_0x8b45('0x4a')][_0x8b45('0x4e')]));_0x1b5cc2[_0x8b45('0x4d')]=_0x1b5cc2[_0x8b45('0x4d')]['length']?_0x1b5cc2['attributes']:_0x46293e['model'];_0x1b5cc2[_0x8b45('0x51')]=qs['sort'](_0x21e51e[_0x8b45('0x4a')]['sort']);_0x1b5cc2['where']=qs[_0x8b45('0x54')](_[_0x8b45('0x55')](_0x21e51e[_0x8b45('0x4a')],_0x46293e['filters']));if(_0x21e51e['query'][_0x8b45('0x56')]){_0x1b5cc2[_0x8b45('0x53')]=_[_0x8b45('0x57')](_0x1b5cc2[_0x8b45('0x53')],{'$or':_['map'](_0x1b5cc2[_0x8b45('0x4d')],function(_0x4f1538){var _0x438f7b={};_0x438f7b[_0x4f1538]={'$like':'%'+_0x21e51e['query'][_0x8b45('0x56')]+'%'};return _0x438f7b;})});}_0x1b5cc2=_[_0x8b45('0x57')]({},_0x1b5cc2,_0x21e51e[_0x8b45('0x59')]);return _0x23adfa[_0x8b45('0xc7')](_0x1b5cc2);}})[_0x8b45('0x24')](function(_0x10a44a){if(_0x10a44a){_0x5bab0c=_0x10a44a[_0x8b45('0x4f')];if(!_0x21e51e[_0x8b45('0x4a')][_0x8b45('0x6b')](_0x8b45('0x50'))){_0x1b5cc2[_0x8b45('0x33')]=qs[_0x8b45('0x33')](_0x21e51e['query'][_0x8b45('0x33')]);_0x1b5cc2[_0x8b45('0x30')]=qs['offset'](_0x21e51e[_0x8b45('0x4a')][_0x8b45('0x30')]);}return _0x23adfa['getAgents'](_0x1b5cc2);}})[_0x8b45('0x24')](function(_0x51fdab){if(_0x51fdab){return _0x51fdab?{'count':_0x5bab0c,'rows':_0x51fdab}:null;}})[_0x8b45('0x24')](respondWithResult(_0x3109a8,null))[_0x8b45('0x2d')](handleError(_0x3109a8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 707ba63..f29e6b5 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 _0xb201=['MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5104f5,_0x2908bd){var _0x2bb4f9=function(_0x431014){while(--_0x431014){_0x5104f5['push'](_0x5104f5['shift']());}};_0x2bb4f9(++_0x2908bd);}(_0xb201,0x117));var _0x1b20=function(_0x31c4fc,_0x35609){_0x31c4fc=_0x31c4fc-0x0;var _0x4318fb=_0xb201[_0x31c4fc];return _0x4318fb;};'use strict';var EventEmitter=require(_0x1b20('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x1b20('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1b20('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b20('0x3'),'afterDestroy':_0x1b20('0x4')};function emitEvent(_0x2857f3){return function(_0x57a68c,_0x48818a,_0xd76d73){MailAccountEvents[_0x1b20('0x5')](_0x2857f3+':'+_0x57a68c['id'],_0x57a68c);MailAccountEvents['emit'](_0x2857f3,_0x57a68c);_0xd76d73(null);};}for(var e in events){if(events[_0x1b20('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1b20('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xf105=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5ba8d0,_0x4b09de){var _0x42de44=function(_0x3dc9cd){while(--_0x3dc9cd){_0x5ba8d0['push'](_0x5ba8d0['shift']());}};_0x42de44(++_0x4b09de);}(_0xf105,0x1b0));var _0x5f10=function(_0x198790,_0x517c92){_0x198790=_0x198790-0x0;var _0xa0ddf=_0xf105[_0x198790];return _0xa0ddf;};'use strict';var EventEmitter=require(_0x5f10('0x0'));var MailAccount=require(_0x5f10('0x1'))['db'][_0x5f10('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5f10('0x3')](0x0);var events={'afterCreate':_0x5f10('0x4'),'afterUpdate':_0x5f10('0x5'),'afterDestroy':'remove'};function emitEvent(_0x395cc9){return function(_0x5a7fe7,_0x2c0393,_0x14dcab){MailAccountEvents[_0x5f10('0x6')](_0x395cc9+':'+_0x5a7fe7['id'],_0x5a7fe7);MailAccountEvents[_0x5f10('0x6')](_0x395cc9,_0x5a7fe7);_0x14dcab(null);};}for(var e in events){if(events[_0x5f10('0x7')](e)){var event=events[e];MailAccount[_0x5f10('0x8')](e,emitEvent(event));}}module[_0x5f10('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cef220b..b5c04de 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 _0x506c=['../../config/logger','api','moment','request-promise','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x506c,0x167));var _0xc506=function(_0x40020a,_0x134ad0){_0x40020a=_0x40020a-0x0;var _0xa0b963=_0x506c[_0x40020a];return _0xa0b963;};'use strict';var _=require(_0xc506('0x0'));var util=require('util');var logger=require(_0xc506('0x1'))(_0xc506('0x2'));var moment=require(_0xc506('0x3'));var BPromise=require('bluebird');var rp=require(_0xc506('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc506('0x5'));var attributes=require(_0xc506('0x6'));module[_0xc506('0x7')]=function(_0x7f3935,_0x2739f0){return _0x7f3935[_0xc506('0x8')](_0xc506('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd10=['../../config/logger','request-promise','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd10,0xc4));var _0x0fd1=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xfd10[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0fd1('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fd1('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fd1('0x2'));var config=require(_0x0fd1('0x3'));var attributes=require(_0x0fd1('0x4'));module['exports']=function(_0x35d5a0,_0x2452f9){return _0x35d5a0[_0x0fd1('0x5')](_0x0fd1('0x6'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 5e83f83..f46c209 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 _0xd8aa=['stringify','catch','ShowMailAccount','find','raw','where','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','updatedAt','CompanyId','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','account','CmList','Contacts','DESC','MailApplication','Applications','Smtp','List','get','list','applications','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','spread','subject','attach','interaction','created','MailMessage','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model'];(function(_0x27e55f,_0x26a305){var _0x4ebb60=function(_0x46610f){while(--_0x46610f){_0x27e55f['push'](_0x27e55f['shift']());}};_0x4ebb60(++_0x26a305);}(_0xd8aa,0x119));var _0xad8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xad8a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad8a('0x1'));var fs=require('fs');var Redis=require(_0xad8a('0x2'));var db=require(_0xad8a('0x3'))['db'];var utils=require(_0xad8a('0x4'));var logger=require(_0xad8a('0x5'))(_0xad8a('0x6'));var config=require('../../config/environment');var jayson=require(_0xad8a('0x7'));var client=jayson[_0xad8a('0x8')]['http']({'port':0x232c});config[_0xad8a('0x9')]=_[_0xad8a('0xa')](config[_0xad8a('0x9')],{'host':_0xad8a('0xb'),'port':0x18eb});var socket=require(_0xad8a('0xc'))(new Redis(config[_0xad8a('0x9')]));require(_0xad8a('0xd'))['register'](socket);function respondWithRpcPromise(_0x27d09d,_0x517a27,_0x45c1d4){return new BPromise(function(_0x48c403,_0x53a530){return client[_0xad8a('0xe')](_0x27d09d,_0x45c1d4)[_0xad8a('0xf')](function(_0x2d8fad){logger[_0xad8a('0x10')]('MailAccount,\x20%s,\x20%s',_0x517a27,_0xad8a('0x11'));logger[_0xad8a('0x12')](_0xad8a('0x13'),_0x517a27,_0xad8a('0x11'),JSON['stringify'](_0x2d8fad));if(_0x2d8fad[_0xad8a('0x14')]){if(_0x2d8fad['error'][_0xad8a('0x15')]===0x1f4){logger[_0xad8a('0x14')](_0xad8a('0x16'),_0x517a27,_0x2d8fad[_0xad8a('0x14')][_0xad8a('0x17')]);return _0x53a530(_0x2d8fad['error'][_0xad8a('0x17')]);}logger[_0xad8a('0x14')](_0xad8a('0x16'),_0x517a27,_0x2d8fad[_0xad8a('0x14')][_0xad8a('0x17')]);return _0x48c403(_0x2d8fad[_0xad8a('0x14')]['message']);}else{logger[_0xad8a('0x10')](_0xad8a('0x16'),_0x517a27,'request\x20sent');_0x48c403(_0x2d8fad[_0xad8a('0x18')][_0xad8a('0x17')]);}})['catch'](function(_0x26f9a6){logger['error'](_0xad8a('0x16'),_0x517a27,_0x26f9a6);_0x53a530(_0x26f9a6);});});}exports[_0xad8a('0x19')]=function(_0x3ddffe){var _0x1d7528=this;return new Promise(function(_0x3720d2,_0x4f13d4){return db[_0xad8a('0x1a')][_0xad8a('0x1b')]({'raw':_0x3ddffe['options']?_0x3ddffe[_0xad8a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3ddffe['options']?_0x3ddffe[_0xad8a('0x1c')]['where']||null:null,'attributes':_0x3ddffe[_0xad8a('0x1c')]?_0x3ddffe[_0xad8a('0x1c')][_0xad8a('0x1d')]||null:null,'limit':_0x3ddffe['options']?_0x3ddffe[_0xad8a('0x1c')][_0xad8a('0x1e')]||null:null,'include':_0x3ddffe[_0xad8a('0x1c')]?_0x3ddffe[_0xad8a('0x1c')][_0xad8a('0x1f')]?_[_0xad8a('0x20')](_0x3ddffe[_0xad8a('0x1c')][_0xad8a('0x1f')],function(_0x20b413){return{'model':db[_0x20b413[_0xad8a('0x21')]],'as':_0x20b413['as'],'attributes':_0x20b413[_0xad8a('0x1d')],'include':_0x20b413[_0xad8a('0x1f')]?_[_0xad8a('0x20')](_0x20b413[_0xad8a('0x1f')],function(_0xfaf3df){return{'model':db[_0xfaf3df[_0xad8a('0x21')]],'as':_0xfaf3df['as'],'attributes':_0xfaf3df['attributes'],'include':_0xfaf3df[_0xad8a('0x1f')]?_[_0xad8a('0x20')](_0xfaf3df[_0xad8a('0x1f')],function(_0x598e97){return{'model':db[_0x598e97[_0xad8a('0x21')]],'as':_0x598e97['as'],'attributes':_0x598e97[_0xad8a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3daa86){logger['info'](_0xad8a('0x19'),_0x3ddffe);logger['debug'](_0xad8a('0x19'),_0x3ddffe,JSON[_0xad8a('0x22')](_0x3daa86));_0x3720d2(_0x3daa86);})[_0xad8a('0x23')](function(_0x4c324f){logger['error'](_0xad8a('0x19'),_0x4c324f[_0xad8a('0x17')],_0x3ddffe);_0x4f13d4(_0x1d7528[_0xad8a('0x14')](0x1f4,_0x4c324f['message']));});});};exports[_0xad8a('0x24')]=function(_0x348abf){var _0x20168a=this;return new Promise(function(_0x2eaa8e,_0x38dd98){return db[_0xad8a('0x1a')][_0xad8a('0x25')]({'raw':_0x348abf[_0xad8a('0x1c')]?_0x348abf[_0xad8a('0x1c')][_0xad8a('0x26')]===undefined?!![]:![]:!![],'where':_0x348abf[_0xad8a('0x1c')]?_0x348abf[_0xad8a('0x1c')][_0xad8a('0x27')]||null:null,'attributes':_0x348abf['options']?_0x348abf[_0xad8a('0x1c')]['attributes']||null:null,'include':_0x348abf[_0xad8a('0x1c')]?_0x348abf['options'][_0xad8a('0x1f')]?_[_0xad8a('0x20')](_0x348abf[_0xad8a('0x1c')][_0xad8a('0x1f')],function(_0x27da3e){return{'model':db[_0x27da3e[_0xad8a('0x21')]],'as':_0x27da3e['as'],'attributes':_0x27da3e[_0xad8a('0x1d')],'include':_0x27da3e['include']?_[_0xad8a('0x20')](_0x27da3e[_0xad8a('0x1f')],function(_0x588994){return{'model':db[_0x588994[_0xad8a('0x21')]],'as':_0x588994['as'],'attributes':_0x588994[_0xad8a('0x1d')],'include':_0x588994[_0xad8a('0x1f')]?_[_0xad8a('0x20')](_0x588994['include'],function(_0x182ac4){return{'model':db[_0x182ac4[_0xad8a('0x21')]],'as':_0x182ac4['as'],'attributes':_0x182ac4['attributes']};}):[]};}):[]};}):[]:[]})[_0xad8a('0xf')](function(_0x5e1593){logger[_0xad8a('0x10')](_0xad8a('0x24'),_0x348abf);logger['debug']('ShowMailAccount',_0x348abf,JSON['stringify'](_0x5e1593));_0x2eaa8e(_0x5e1593);})[_0xad8a('0x23')](function(_0x369c31){logger['error'](_0xad8a('0x24'),_0x369c31[_0xad8a('0x17')],_0x348abf);_0x38dd98(_0x20168a['error'](0x1f4,_0x369c31[_0xad8a('0x17')]));});});};exports[_0xad8a('0x28')]=function(_0x567cce){var _0xcff6ed=this;return new Promise(function(_0x20003a,_0x20f89d){var _0x5ac889={'body':_0x567cce[_0xad8a('0x29')],'channel':_0xad8a('0x2a')};var _0x497ca4=_['difference'](_[_0xad8a('0x2b')](db[_0xad8a('0x2c')][_0xad8a('0x2d')]),['createdAt',_0xad8a('0x2e'),_0xad8a('0x2f'),'ListId']);var _0x389e83=![];if(_0x567cce[_0xad8a('0x29')]['id']){delete _0x567cce[_0xad8a('0x29')]['id'];}if(_['isNil'](_0x567cce[_0xad8a('0x29')][_0xad8a('0x30')])){return _0x20f89d(_0xcff6ed[_0xad8a('0x14')](0x1f4,_0xad8a('0x31')));}if(_[_0xad8a('0x32')](_0x567cce[_0xad8a('0x29')][_0xad8a('0x29')])||_0x567cce[_0xad8a('0x29')][_0xad8a('0x29')]===''){return _0x20f89d(_0xcff6ed['error'](0x1f4,_0xad8a('0x33')));}if(_['isNil'](_0x567cce['body'][_0xad8a('0x34')])){return _0x20f89d(_0xcff6ed[_0xad8a('0x14')](0x1f4,_0xad8a('0x35')+_0x497ca4));}if(!_['includes'](_0x497ca4,_0x567cce[_0xad8a('0x29')][_0xad8a('0x34')])){return _0x20f89d(_0xcff6ed[_0xad8a('0x14')](0x1f4,_0xad8a('0x36')+_0x497ca4));}var _0x1a2096={};_0x1a2096[_0x567cce['body'][_0xad8a('0x34')]]=_0x567cce[_0xad8a('0x29')][_0xad8a('0x30')];return db[_0xad8a('0x1a')][_0xad8a('0x25')]({'where':{'id':_0x567cce[_0xad8a('0x37')]['id']},'include':[{'model':db[_0xad8a('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xad8a('0x39'),'where':_0x1a2096,'limit':0x1,'order':[[_0xad8a('0x2e'),_0xad8a('0x3a')]]}]},{'model':db[_0xad8a('0x3b')],'as':_0xad8a('0x3c')},{'model':db['MailServerOut'],'as':_0xad8a('0x3d')}]})[_0xad8a('0xf')](function(_0x7b7a62){if(_0x7b7a62&&_0x7b7a62[_0xad8a('0x3e')]){var _0x327595=_0x7b7a62[_0xad8a('0x3f')]({'plain':!![]});_0x5ac889[_0xad8a('0x37')]=_['omit'](_0x327595,['Applications',_0xad8a('0x3e')]);_0x5ac889['applications']=_0x327595[_0xad8a('0x3c')];_0x5ac889[_0xad8a('0x40')]=_0x327595['List'];_0x5ac889[_0xad8a('0x41')]=_[_0xad8a('0x42')](_0x5ac889[_0xad8a('0x41')],[_0xad8a('0x43')],[_0xad8a('0x44')]);if(_0x5ac889[_0xad8a('0x37')]&&_0x5ac889[_0xad8a('0x37')][_0xad8a('0x45')]){_0x5ac889[_0xad8a('0x41')][_0xad8a('0x46')]({'id':0x0,'priority':_0x5ac889[_0xad8a('0x41')]['length']+0x1,'app':_0xad8a('0x47'),'appdata':_0xad8a('0x45'),'interval':_0xad8a('0x48')});}if(_0x5ac889[_0xad8a('0x37')][_0xad8a('0x3c')]){delete _0x5ac889[_0xad8a('0x37')][_0xad8a('0x3c')];}if(_0x5ac889['account'][_0xad8a('0x3e')]){delete _0x5ac889[_0xad8a('0x37')][_0xad8a('0x3e')];}if(_0x327595[_0xad8a('0x3e')][_0xad8a('0x39')]['length']){return _0x327595[_0xad8a('0x3e')][_0xad8a('0x39')][0x0];}var _0x103e0c=_[_0xad8a('0xa')](_0x567cce[_0xad8a('0x29')],{'firstName':_0x567cce[_0xad8a('0x29')]['from'],'ListId':_0x327595['ListId']});_0x103e0c[_0x567cce[_0xad8a('0x29')][_0xad8a('0x34')]]=_0x567cce['body'][_0xad8a('0x30')];return db[_0xad8a('0x2c')][_0xad8a('0x49')](_0x103e0c);}else{throw new Error(_0xad8a('0x4a'));}})[_0xad8a('0xf')](function(_0x17285b){_0x5ac889[_0xad8a('0x4b')]=_0x17285b;if(_0x17285b){if(!_0x567cce[_0xad8a('0x29')]['message'][_0xad8a('0x4c')]){_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x4c')]=rs[_0xad8a('0x4d')]()+'\x20'+_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x30')];}var _0x185c33={'ContactId':_0x17285b['id'],'MailAccountId':_0x567cce[_0xad8a('0x37')]['id'],'inReplyTo':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x4c')],'to':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x30')],'cc':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')]['cc'],'subject':_0x567cce['body']['message']['subject'],'attach':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')]['attach'],'lastMsgAt':moment()[_0xad8a('0x4e')](_0xad8a('0x4f')),'lastMsgDirection':'in'};return db[_0xad8a('0x50')]['find']({'where':{'closed':![],'MailAccountId':_0x567cce[_0xad8a('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0xad8a('0x51'),'attributes':[_0xad8a('0x4c')],'where':{'messageId':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x52')]}}]})[_0xad8a('0xf')](function(_0x51cab5){if(_0x51cab5){return[_0x51cab5,![]];}return db[_0xad8a('0x50')][_0xad8a('0x49')](_0x185c33)[_0xad8a('0xf')](function(_0x3a10c6){return[_0x3a10c6,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xad8a('0x53')](function(_0x5eb4ab,_0x44740e){if(_0x5eb4ab){_0x389e83=_0x44740e;if(!_0x44740e){return _0x5eb4ab['update']({'inReplyTo':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x4c')],'to':_0x567cce['body'][_0xad8a('0x17')][_0xad8a('0x30')],'cc':_0x567cce['body'][_0xad8a('0x17')]['cc'],'subject':_0x567cce['body']['message'][_0xad8a('0x54')],'attach':_0x5eb4ab[_0xad8a('0x55')]?_0x5eb4ab[_0xad8a('0x55')]:_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xad8a('0x4e')](_0xad8a('0x4f')),'lastMsgAt':moment()[_0xad8a('0x4e')](_0xad8a('0x4f')),'lastMsgDirection':'in'});}else{return _0x5eb4ab;}}})[_0xad8a('0xf')](function(_0x1f43af){_0x5ac889[_0xad8a('0x56')]=_0x1f43af[_0xad8a('0x3f')]({'plain':!![]});_0x5ac889[_0xad8a('0x56')][_0xad8a('0x57')]=_0x389e83;return db[_0xad8a('0x58')][_0xad8a('0x49')]({'body':_0x567cce[_0xad8a('0x29')][_0xad8a('0x29')],'MailAccountId':_0x567cce[_0xad8a('0x37')]['id'],'MailInteractionId':_0x1f43af['id'],'direction':'in','ContactId':_0x5ac889[_0xad8a('0x4b')]['id'],'messageId':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x4c')],'from':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x30')],'to':_0x567cce['body'][_0xad8a('0x17')]['to'],'cc':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')]['cc'],'subject':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x54')],'attach':_0x567cce['body']['message'][_0xad8a('0x55')],'Attachments':_0x567cce[_0xad8a('0x29')]['message'][_0xad8a('0x59')],'originTo':_0x567cce[_0xad8a('0x29')]['message'][_0xad8a('0x5a')],'originCc':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x5b')],'bcc':_0x567cce['body']['message']['bcc'],'ChatWebsiteId':_0x567cce[_0xad8a('0x29')]['message'][_0xad8a('0x5c')]||null,'originChannel':_0x567cce['body'][_0xad8a('0x17')][_0xad8a('0x5d')]||_0xad8a('0x5e'),'ChatOfflineMessageId':_0x567cce[_0xad8a('0x29')][_0xad8a('0x17')][_0xad8a('0x5f')]||null},{'include':[{'model':db[_0xad8a('0x60')],'as':_0xad8a('0x61')}]});})['then'](function(_0x1eae54){_0x5ac889[_0xad8a('0x17')]=_0x1eae54;if(_0x5ac889[_0xad8a('0x56')][_0xad8a('0x62')]){return db[_0xad8a('0x63')]['find']({'attributes':['id',_0xad8a('0x64')],'where':{'id':_0x5ac889[_0xad8a('0x56')][_0xad8a('0x62')]}})[_0xad8a('0xf')](function(_0x3c1ea6){if(_0x3c1ea6){_0x5ac889[_0xad8a('0x41')][_0xad8a('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3c1ea6[_0xad8a('0x64')]+','+(_0x5ac889[_0xad8a('0x37')][_0xad8a('0x66')]||0xa),'interval':_0xad8a('0x48')});}return respondWithRpcPromise(_0xad8a('0x67'),_0xad8a('0x68'),_0x5ac889);});}return respondWithRpcPromise('Start',_0xad8a('0x68'),_0x5ac889);})['then'](function(_0x2d75e5){_0x20003a(_0x2d75e5);})[_0xad8a('0x23')](function(_0x46ded8){_0x20f89d(_0xcff6ed[_0xad8a('0x14')](0x1f4,_0x46ded8['message']));});});}; \ No newline at end of file +var _0xacce=['ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','include','model','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','CmContact','createdAt','updatedAt','CompanyId','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','Contacts','MailApplication','Applications','Smtp','get','list','applications','priority','asc','length','close','autoclose','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','attachments','originTo','originCc','bcc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xacce,0x1b5));var _0xeacc=function(_0x535b50,_0x42f7c3){_0x535b50=_0x535b50-0x0;var _0x5af444=_0xacce[_0x535b50];return _0x5af444;};'use strict';var _=require(_0xeacc('0x0'));var util=require(_0xeacc('0x1'));var moment=require(_0xeacc('0x2'));var BPromise=require(_0xeacc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeacc('0x4'));var db=require(_0xeacc('0x5'))['db'];var utils=require(_0xeacc('0x6'));var logger=require(_0xeacc('0x7'))(_0xeacc('0x8'));var config=require(_0xeacc('0x9'));var jayson=require(_0xeacc('0xa'));var client=jayson['client'][_0xeacc('0xb')]({'port':0x232c});config[_0xeacc('0xc')]=_[_0xeacc('0xd')](config[_0xeacc('0xc')],{'host':_0xeacc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeacc('0xc')]));require(_0xeacc('0xf'))[_0xeacc('0x10')](socket);function respondWithRpcPromise(_0x437f69,_0x30f7ec,_0x2e5bf4){return new BPromise(function(_0x2cd686,_0x4470f7){return client['request'](_0x437f69,_0x2e5bf4)[_0xeacc('0x11')](function(_0x1c93cc){logger[_0xeacc('0x12')](_0xeacc('0x13'),_0x30f7ec,_0xeacc('0x14'));logger[_0xeacc('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x30f7ec,_0xeacc('0x14'),JSON[_0xeacc('0x16')](_0x1c93cc));if(_0x1c93cc[_0xeacc('0x17')]){if(_0x1c93cc['error'][_0xeacc('0x18')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x30f7ec,_0x1c93cc[_0xeacc('0x17')][_0xeacc('0x19')]);return _0x4470f7(_0x1c93cc['error'][_0xeacc('0x19')]);}logger['error'](_0xeacc('0x13'),_0x30f7ec,_0x1c93cc[_0xeacc('0x17')][_0xeacc('0x19')]);return _0x2cd686(_0x1c93cc[_0xeacc('0x17')]['message']);}else{logger[_0xeacc('0x12')](_0xeacc('0x13'),_0x30f7ec,_0xeacc('0x14'));_0x2cd686(_0x1c93cc['result'][_0xeacc('0x19')]);}})[_0xeacc('0x1a')](function(_0x17f521){logger[_0xeacc('0x17')](_0xeacc('0x13'),_0x30f7ec,_0x17f521);_0x4470f7(_0x17f521);});});}exports[_0xeacc('0x1b')]=function(_0xc2b459){var _0x18068e=this;return new Promise(function(_0x128857,_0xe860a9){return db[_0xeacc('0x1c')][_0xeacc('0x1d')]({'raw':_0xc2b459[_0xeacc('0x1e')]?_0xc2b459['options'][_0xeacc('0x1f')]===undefined?!![]:![]:!![],'where':_0xc2b459['options']?_0xc2b459[_0xeacc('0x1e')]['where']||null:null,'attributes':_0xc2b459[_0xeacc('0x1e')]?_0xc2b459[_0xeacc('0x1e')][_0xeacc('0x20')]||null:null,'limit':_0xc2b459['options']?_0xc2b459[_0xeacc('0x1e')][_0xeacc('0x21')]||null:null,'include':_0xc2b459[_0xeacc('0x1e')]?_0xc2b459[_0xeacc('0x1e')]['include']?_[_0xeacc('0x22')](_0xc2b459['options'][_0xeacc('0x23')],function(_0x209ac2){return{'model':db[_0x209ac2[_0xeacc('0x24')]],'as':_0x209ac2['as'],'attributes':_0x209ac2[_0xeacc('0x20')],'include':_0x209ac2[_0xeacc('0x23')]?_[_0xeacc('0x22')](_0x209ac2[_0xeacc('0x23')],function(_0x1f7a40){return{'model':db[_0x1f7a40['model']],'as':_0x1f7a40['as'],'attributes':_0x1f7a40[_0xeacc('0x20')],'include':_0x1f7a40[_0xeacc('0x23')]?_[_0xeacc('0x22')](_0x1f7a40[_0xeacc('0x23')],function(_0x321b67){return{'model':db[_0x321b67[_0xeacc('0x24')]],'as':_0x321b67['as'],'attributes':_0x321b67[_0xeacc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeacc('0x11')](function(_0x26f6e0){logger[_0xeacc('0x12')](_0xeacc('0x1b'),_0xc2b459);logger[_0xeacc('0x15')](_0xeacc('0x1b'),_0xc2b459,JSON[_0xeacc('0x16')](_0x26f6e0));_0x128857(_0x26f6e0);})[_0xeacc('0x1a')](function(_0x2d8c5c){logger['error']('GetMailAccount',_0x2d8c5c[_0xeacc('0x19')],_0xc2b459);_0xe860a9(_0x18068e['error'](0x1f4,_0x2d8c5c['message']));});});};exports[_0xeacc('0x25')]=function(_0x2e5f67){var _0x39d71f=this;return new Promise(function(_0x19375f,_0x371fd2){return db[_0xeacc('0x1c')][_0xeacc('0x26')]({'raw':_0x2e5f67['options']?_0x2e5f67[_0xeacc('0x1e')][_0xeacc('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e5f67[_0xeacc('0x1e')]?_0x2e5f67[_0xeacc('0x1e')]['where']||null:null,'attributes':_0x2e5f67['options']?_0x2e5f67['options'][_0xeacc('0x20')]||null:null,'include':_0x2e5f67[_0xeacc('0x1e')]?_0x2e5f67['options']['include']?_[_0xeacc('0x22')](_0x2e5f67[_0xeacc('0x1e')]['include'],function(_0x2049d3){return{'model':db[_0x2049d3['model']],'as':_0x2049d3['as'],'attributes':_0x2049d3['attributes'],'include':_0x2049d3['include']?_[_0xeacc('0x22')](_0x2049d3[_0xeacc('0x23')],function(_0x13adf3){return{'model':db[_0x13adf3[_0xeacc('0x24')]],'as':_0x13adf3['as'],'attributes':_0x13adf3[_0xeacc('0x20')],'include':_0x13adf3[_0xeacc('0x23')]?_[_0xeacc('0x22')](_0x13adf3[_0xeacc('0x23')],function(_0x22d01b){return{'model':db[_0x22d01b[_0xeacc('0x24')]],'as':_0x22d01b['as'],'attributes':_0x22d01b[_0xeacc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeacc('0x11')](function(_0x4ff2b5){logger[_0xeacc('0x12')](_0xeacc('0x25'),_0x2e5f67);logger[_0xeacc('0x15')](_0xeacc('0x25'),_0x2e5f67,JSON[_0xeacc('0x16')](_0x4ff2b5));_0x19375f(_0x4ff2b5);})[_0xeacc('0x1a')](function(_0x44dffa){logger[_0xeacc('0x17')](_0xeacc('0x25'),_0x44dffa['message'],_0x2e5f67);_0x371fd2(_0x39d71f[_0xeacc('0x17')](0x1f4,_0x44dffa[_0xeacc('0x19')]));});});};exports[_0xeacc('0x27')]=function(_0x4566ca){var _0x1e4eff=this;return new Promise(function(_0x44c9e9,_0x5e5e4c){var _0x51e9a0={'body':_0x4566ca[_0xeacc('0x28')],'channel':'mail'};var _0x264d4c=_[_0xeacc('0x29')](_[_0xeacc('0x2a')](db[_0xeacc('0x2b')]['rawAttributes']),[_0xeacc('0x2c'),_0xeacc('0x2d'),_0xeacc('0x2e'),'ListId']);var _0x205cec=![];if(_0x4566ca[_0xeacc('0x28')]['id']){delete _0x4566ca[_0xeacc('0x28')]['id'];}if(_[_0xeacc('0x2f')](_0x4566ca[_0xeacc('0x28')][_0xeacc('0x30')])){return _0x5e5e4c(_0x1e4eff[_0xeacc('0x17')](0x1f4,_0xeacc('0x31')));}if(_[_0xeacc('0x2f')](_0x4566ca['body']['body'])||_0x4566ca[_0xeacc('0x28')][_0xeacc('0x28')]===''){return _0x5e5e4c(_0x1e4eff['error'](0x1f4,_0xeacc('0x32')));}if(_[_0xeacc('0x2f')](_0x4566ca['body'][_0xeacc('0x33')])){return _0x5e5e4c(_0x1e4eff['error'](0x1f4,_0xeacc('0x34')+_0x264d4c));}if(!_[_0xeacc('0x35')](_0x264d4c,_0x4566ca[_0xeacc('0x28')][_0xeacc('0x33')])){return _0x5e5e4c(_0x1e4eff[_0xeacc('0x17')](0x1f4,_0xeacc('0x36')+_0x264d4c));}var _0x1ce2b8={};_0x1ce2b8[_0x4566ca[_0xeacc('0x28')]['mapKey']]=_0x4566ca[_0xeacc('0x28')][_0xeacc('0x30')];return db[_0xeacc('0x1c')][_0xeacc('0x26')]({'where':{'id':_0x4566ca[_0xeacc('0x37')]['id']},'include':[{'model':db[_0xeacc('0x38')],'as':_0xeacc('0x39'),'include':[{'model':db[_0xeacc('0x2b')],'as':_0xeacc('0x3a'),'where':_0x1ce2b8,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xeacc('0x3b')],'as':_0xeacc('0x3c')},{'model':db['MailServerOut'],'as':_0xeacc('0x3d')}]})[_0xeacc('0x11')](function(_0x487ccb){if(_0x487ccb&&_0x487ccb[_0xeacc('0x39')]){var _0x43d76b=_0x487ccb[_0xeacc('0x3e')]({'plain':!![]});_0x51e9a0[_0xeacc('0x37')]=_['omit'](_0x43d76b,[_0xeacc('0x3c'),_0xeacc('0x39')]);_0x51e9a0['applications']=_0x43d76b[_0xeacc('0x3c')];_0x51e9a0[_0xeacc('0x3f')]=_0x43d76b[_0xeacc('0x39')];_0x51e9a0[_0xeacc('0x40')]=_['orderBy'](_0x51e9a0[_0xeacc('0x40')],[_0xeacc('0x41')],[_0xeacc('0x42')]);if(_0x51e9a0[_0xeacc('0x37')]&&_0x51e9a0['account']['autoclose']){_0x51e9a0[_0xeacc('0x40')]['push']({'id':0x0,'priority':_0x51e9a0[_0xeacc('0x40')][_0xeacc('0x43')]+0x1,'app':_0xeacc('0x44'),'appdata':_0xeacc('0x45'),'interval':_0xeacc('0x46')});}if(_0x51e9a0[_0xeacc('0x37')]['Applications']){delete _0x51e9a0[_0xeacc('0x37')][_0xeacc('0x3c')];}if(_0x51e9a0[_0xeacc('0x37')][_0xeacc('0x39')]){delete _0x51e9a0[_0xeacc('0x37')]['List'];}if(_0x43d76b[_0xeacc('0x39')][_0xeacc('0x3a')][_0xeacc('0x43')]){return _0x43d76b[_0xeacc('0x39')][_0xeacc('0x3a')][0x0];}var _0x369f71=_[_0xeacc('0xd')](_0x4566ca['body'],{'firstName':_0x4566ca[_0xeacc('0x28')]['from'],'ListId':_0x43d76b[_0xeacc('0x47')]});_0x369f71[_0x4566ca[_0xeacc('0x28')][_0xeacc('0x33')]]=_0x4566ca[_0xeacc('0x28')]['from'];return db['CmContact'][_0xeacc('0x48')](_0x369f71);}else{throw new Error(_0xeacc('0x49'));}})['then'](function(_0x3633d3){_0x51e9a0[_0xeacc('0x4a')]=_0x3633d3;if(_0x3633d3){if(!_0x4566ca['body'][_0xeacc('0x19')][_0xeacc('0x4b')]){_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x4b')]=rs[_0xeacc('0x4c')]()+'\x20'+_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x30')];}var _0x1f04f6={'ContactId':_0x3633d3['id'],'MailAccountId':_0x4566ca[_0xeacc('0x37')]['id'],'inReplyTo':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x4b')],'to':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x30')],'cc':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')]['cc'],'subject':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x4d')],'attach':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')]['attach'],'lastMsgAt':moment()[_0xeacc('0x4e')](_0xeacc('0x4f')),'lastMsgDirection':'in'};return db[_0xeacc('0x50')]['find']({'where':{'closed':![],'MailAccountId':_0x4566ca[_0xeacc('0x37')]['id']},'include':[{'model':db[_0xeacc('0x51')],'as':_0xeacc('0x52'),'attributes':[_0xeacc('0x4b')],'where':{'messageId':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x53')]}}]})[_0xeacc('0x11')](function(_0x25586d){if(_0x25586d){return[_0x25586d,![]];}return db[_0xeacc('0x50')][_0xeacc('0x48')](_0x1f04f6)[_0xeacc('0x11')](function(_0x1ff2ed){return[_0x1ff2ed,!![]];});});}else{throw new Error(_0xeacc('0x54'));}})[_0xeacc('0x55')](function(_0x1a2a02,_0x9cc55a){if(_0x1a2a02){_0x205cec=_0x9cc55a;if(!_0x9cc55a){return _0x1a2a02[_0xeacc('0x56')]({'inReplyTo':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x4b')],'to':_0x4566ca['body']['message'][_0xeacc('0x30')],'cc':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')]['cc'],'subject':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x4d')],'attach':_0x1a2a02[_0xeacc('0x57')]?_0x1a2a02[_0xeacc('0x57')]:_0x4566ca['body'][_0xeacc('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xeacc('0x4e')](_0xeacc('0x4f')),'lastMsgAt':moment()[_0xeacc('0x4e')](_0xeacc('0x4f')),'lastMsgDirection':'in'});}else{return _0x1a2a02;}}})['then'](function(_0x3d104a){_0x51e9a0[_0xeacc('0x58')]=_0x3d104a['get']({'plain':!![]});_0x51e9a0[_0xeacc('0x58')]['created']=_0x205cec;return db[_0xeacc('0x51')][_0xeacc('0x48')]({'body':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x28')],'MailAccountId':_0x4566ca['account']['id'],'MailInteractionId':_0x3d104a['id'],'direction':'in','ContactId':_0x51e9a0[_0xeacc('0x4a')]['id'],'messageId':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x4b')],'from':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x30')],'to':_0x4566ca[_0xeacc('0x28')]['message']['to'],'cc':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')]['cc'],'subject':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x4d')],'attach':_0x4566ca['body'][_0xeacc('0x19')][_0xeacc('0x57')],'Attachments':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x59')],'originTo':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x5a')],'originCc':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x5b')],'bcc':_0x4566ca[_0xeacc('0x28')]['message'][_0xeacc('0x5c')],'ChatWebsiteId':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x5d')]||null,'originChannel':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')][_0xeacc('0x5e')]||_0xeacc('0x5f'),'ChatOfflineMessageId':_0x4566ca[_0xeacc('0x28')][_0xeacc('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xeacc('0x60')],'as':_0xeacc('0x61')}]});})['then'](function(_0x224a9e){_0x51e9a0[_0xeacc('0x19')]=_0x224a9e;if(_0x51e9a0[_0xeacc('0x58')]['UserId']){return db[_0xeacc('0x62')][_0xeacc('0x26')]({'attributes':['id',_0xeacc('0x63')],'where':{'id':_0x51e9a0[_0xeacc('0x58')][_0xeacc('0x64')]}})[_0xeacc('0x11')](function(_0x516a6c){if(_0x516a6c){_0x51e9a0[_0xeacc('0x40')][_0xeacc('0x65')]({'id':0x0,'priority':0x0,'app':_0xeacc('0x66'),'appdata':_0x516a6c[_0xeacc('0x63')]+','+(_0x51e9a0[_0xeacc('0x37')][_0xeacc('0x67')]||0xa),'interval':_0xeacc('0x46')});}return respondWithRpcPromise(_0xeacc('0x68'),_0xeacc('0x69'),_0x51e9a0);});}return respondWithRpcPromise(_0xeacc('0x68'),_0xeacc('0x69'),_0x51e9a0);})[_0xeacc('0x11')](function(_0xf6532a){_0x44c9e9(_0xf6532a);})[_0xeacc('0x1a')](function(_0x28e99f){_0x5e5e4c(_0x1e4eff['error'](0x1f4,_0x28e99f[_0xeacc('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 7f0ba97..d2d577d 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 _0x1ab2=['register','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x1ab2,0x198));var _0x21ab=function(_0x4e27c5,_0x17bbe3){_0x4e27c5=_0x4e27c5-0x0;var _0x20393b=_0x1ab2[_0x4e27c5];return _0x20393b;};'use strict';var MailAccountEvents=require(_0x21ab('0x0'));var events=[_0x21ab('0x1'),_0x21ab('0x2'),_0x21ab('0x3')];function createListener(_0x3bbe68,_0x4e1889){return function(_0x23361e){_0x4e1889[_0x21ab('0x4')](_0x3bbe68,_0x23361e);};}function removeListener(_0x3ec3cb,_0x11613e){return function(){MailAccountEvents['removeListener'](_0x3ec3cb,_0x11613e);};}exports[_0x21ab('0x5')]=function(_0x26d8fa){for(var _0x2a6592=0x0,_0x506332=events['length'];_0x2a6592<_0x506332;_0x2a6592++){var _0x5ab675=events[_0x2a6592];var _0x3251c4=createListener(_0x21ab('0x6')+_0x5ab675,_0x26d8fa);MailAccountEvents['on'](_0x5ab675,_0x3251c4);}}; \ No newline at end of file +var _0x9779=['update','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x1f5ef0,_0x5342bb){var _0x1a680a=function(_0x2f710d){while(--_0x2f710d){_0x1f5ef0['push'](_0x1f5ef0['shift']());}};_0x1a680a(++_0x5342bb);}(_0x9779,0x69));var _0x9977=function(_0xc6cddc,_0x35f176){_0xc6cddc=_0xc6cddc-0x0;var _0x42ab26=_0x9779[_0xc6cddc];return _0x42ab26;};'use strict';var MailAccountEvents=require(_0x9977('0x0'));var events=[_0x9977('0x1'),_0x9977('0x2'),_0x9977('0x3')];function createListener(_0x41444e,_0x58364d){return function(_0x260872){_0x58364d['emit'](_0x41444e,_0x260872);};}function removeListener(_0x16f528,_0x3044fd){return function(){MailAccountEvents['removeListener'](_0x16f528,_0x3044fd);};}exports['register']=function(_0x29b6dd){for(var _0x5d11e8=0x0,_0x37793b=events[_0x9977('0x4')];_0x5d11e8<_0x37793b;_0x5d11e8++){var _0x115d08=events[_0x5d11e8];var _0x567b04=createListener(_0x9977('0x5')+_0x115d08,_0x29b6dd);MailAccountEvents['on'](_0x115d08,_0x567b04);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 4d79d83..8694b45 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 _0xf41b=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x2db66a,_0x2e2114){var _0x298c4f=function(_0x2b1706){while(--_0x2b1706){_0x2db66a['push'](_0x2db66a['shift']());}};_0x298c4f(++_0x2e2114);}(_0xf41b,0x10e));var _0xbf41=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xf41b[_0x3c4f1f];return _0x19cb69;};'use strict';var multer=require(_0xbf41('0x0'));var util=require('util');var path=require(_0xbf41('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf41('0x2'));var router=express[_0xbf41('0x3')]();var fs_extra=require(_0xbf41('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbf41('0x5'));var config=require(_0xbf41('0x6'));var controller=require(_0xbf41('0x7'));router[_0xbf41('0x8')]('/:id',auth[_0xbf41('0x9')](),controller['show']);router[_0xbf41('0xa')](_0xbf41('0xb'),auth['isAuthenticated'](),controller[_0xbf41('0xc')]);router[_0xbf41('0xd')](_0xbf41('0xb'),auth[_0xbf41('0x9')](),controller[_0xbf41('0xe')]);module['exports']=router; \ No newline at end of file +var _0xad24=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','delete','destroy','exports'];(function(_0x35b5f9,_0x1fdd2b){var _0x5ee6d3=function(_0x13d7af){while(--_0x13d7af){_0x35b5f9['push'](_0x35b5f9['shift']());}};_0x5ee6d3(++_0x1fdd2b);}(_0xad24,0xf0));var _0x4ad2=function(_0x22d0dc,_0x4aa71f){_0x22d0dc=_0x22d0dc-0x0;var _0x21215d=_0xad24[_0x22d0dc];return _0x21215d;};'use strict';var multer=require(_0x4ad2('0x0'));var util=require(_0x4ad2('0x1'));var path=require(_0x4ad2('0x2'));var timeout=require(_0x4ad2('0x3'));var express=require(_0x4ad2('0x4'));var router=express['Router']();var fs_extra=require(_0x4ad2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ad2('0x6'));var config=require(_0x4ad2('0x7'));var controller=require(_0x4ad2('0x8'));router[_0x4ad2('0x9')](_0x4ad2('0xa'),auth[_0x4ad2('0xb')](),controller['show']);router[_0x4ad2('0xc')](_0x4ad2('0xa'),auth[_0x4ad2('0xb')](),controller['update']);router[_0x4ad2('0xd')](_0x4ad2('0xa'),auth[_0x4ad2('0xb')](),controller[_0x4ad2('0xe')]);module[_0x4ad2('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 65d74bb..c074e93 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 _0xf4ac=['INTEGER','*,*,*,*','sequelize'];(function(_0x73d3a0,_0x3dad5a){var _0x432516=function(_0x3c6033){while(--_0x3c6033){_0x73d3a0['push'](_0x73d3a0['shift']());}};_0x432516(++_0x3dad5a);}(_0xf4ac,0x13d));var _0xcf4a=function(_0x5da854,_0x2b1be9){_0x5da854=_0x5da854-0x0;var _0x4b3289=_0xf4ac[_0x5da854];return _0x4b3289;};'use strict';var Sequelize=require(_0xcf4a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xcf4a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcf4a('0x2')}}; \ No newline at end of file +var _0xf2c3=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xf2c3,0x75));var _0x3f2c=function(_0x2ac5b6,_0x3a6891){_0x2ac5b6=_0x2ac5b6-0x0;var _0xd46a31=_0xf2c3[_0x2ac5b6];return _0xd46a31;};'use strict';var Sequelize=require('sequelize');module[_0x3f2c('0x0')]={'priority':{'type':Sequelize[_0x3f2c('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3f2c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3f2c('0x3')]},'interval':{'type':Sequelize[_0x3f2c('0x3')],'defaultValue':_0x3f2c('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 19e734c..52b627e 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 _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x2c5351,_0x21a348){var _0x188767=function(_0x473cfb){while(--_0x473cfb){_0x2c5351['push'](_0x2c5351['shift']());}};_0x188767(++_0x21a348);}(_0xf4eb,0xec));var _0xbf4e=function(_0x188aee,_0x3bd0b1){_0x188aee=_0x188aee-0x0;var _0x2b0807=_0xf4eb[_0x188aee];return _0x2b0807;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','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','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x2164da,_0x16cd0b){var _0x12da0d=function(_0x5e5160){while(--_0x5e5160){_0x2164da['push'](_0x2164da['shift']());}};_0x12da0d(++_0x16cd0b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index c9bd281..df4c009 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 _0x9d1c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9d1c,0x17d));var _0xc9d1=function(_0x52e0fc,_0x431caa){_0x52e0fc=_0x52e0fc-0x0;var _0x1978c1=_0x9d1c[_0x52e0fc];return _0x1978c1;};'use strict';var _=require(_0xc9d1('0x0'));var util=require(_0xc9d1('0x1'));var logger=require(_0xc9d1('0x2'))(_0xc9d1('0x3'));var moment=require(_0xc9d1('0x4'));var BPromise=require(_0xc9d1('0x5'));var rp=require(_0xc9d1('0x6'));var fs=require('fs');var path=require(_0xc9d1('0x7'));var rimraf=require(_0xc9d1('0x8'));var config=require(_0xc9d1('0x9'));var attributes=require('./mailApplication.attributes');module[_0xc9d1('0xa')]=function(_0x2a9e90,_0x3c9edb){return _0x2a9e90[_0xc9d1('0xb')](_0xc9d1('0xc'),attributes,{'tableName':_0xc9d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9d1('0xe'),'collate':_0xc9d1('0xf')});}; \ No newline at end of file +var _0xf073=['rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x48cec9,_0x314f4a){var _0x343bca=function(_0x2cfea7){while(--_0x2cfea7){_0x48cec9['push'](_0x48cec9['shift']());}};_0x343bca(++_0x314f4a);}(_0xf073,0xda));var _0x3f07=function(_0x172c21,_0x272abf){_0x172c21=_0x172c21-0x0;var _0x59801d=_0xf073[_0x172c21];return _0x59801d;};'use strict';var _=require('lodash');var util=require(_0x3f07('0x0'));var logger=require(_0x3f07('0x1'))(_0x3f07('0x2'));var moment=require('moment');var BPromise=require(_0x3f07('0x3'));var rp=require(_0x3f07('0x4'));var fs=require('fs');var path=require(_0x3f07('0x5'));var rimraf=require(_0x3f07('0x6'));var config=require(_0x3f07('0x7'));var attributes=require(_0x3f07('0x8'));module[_0x3f07('0x9')]=function(_0x2bf9bb,_0x407260){return _0x2bf9bb[_0x3f07('0xa')]('MailApplication',attributes,{'tableName':_0x3f07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f07('0xc'),'collate':_0x3f07('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 376a7ca..8c25d89 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 _0x28a6=['limit','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','error','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','body','options','raw','where'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x28a6,0x8f));var _0x628a=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x28a6[_0x12d951];return _0x44de17;};'use strict';var _=require(_0x628a('0x0'));var util=require(_0x628a('0x1'));var moment=require(_0x628a('0x2'));var BPromise=require(_0x628a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x628a('0x4'))['db'];var utils=require(_0x628a('0x5'));var logger=require(_0x628a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x628a('0x7'));var client=jayson[_0x628a('0x8')][_0x628a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f4e2d,_0x18303c,_0x25a102){return new BPromise(function(_0x5559a3,_0x239fe0){return client[_0x628a('0xa')](_0x1f4e2d,_0x25a102)[_0x628a('0xb')](function(_0x55240b){logger['info']('MailApplication,\x20%s,\x20%s',_0x18303c,_0x628a('0xc'));logger[_0x628a('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x18303c,_0x628a('0xc'),JSON['stringify'](_0x55240b));if(_0x55240b['error']){if(_0x55240b['error']['code']===0x1f4){logger[_0x628a('0xe')](_0x628a('0xf'),_0x18303c,_0x55240b[_0x628a('0xe')]['message']);return _0x239fe0(_0x55240b[_0x628a('0xe')][_0x628a('0x10')]);}logger[_0x628a('0xe')]('MailApplication,\x20%s,\x20%s',_0x18303c,_0x55240b['error'][_0x628a('0x10')]);return _0x5559a3(_0x55240b[_0x628a('0xe')][_0x628a('0x10')]);}else{logger[_0x628a('0x11')]('MailApplication,\x20%s,\x20%s',_0x18303c,_0x628a('0xc'));_0x5559a3(_0x55240b[_0x628a('0x12')][_0x628a('0x10')]);}})['catch'](function(_0x137fe8){logger[_0x628a('0xe')]('MailApplication,\x20%s,\x20%s',_0x18303c,_0x137fe8);_0x239fe0(_0x137fe8);});});}exports[_0x628a('0x13')]=function(_0x3bbcd7){var _0x3f0147=this;return new Promise(function(_0x215d10,_0x52c484){return db[_0x628a('0x14')]['update'](_0x3bbcd7[_0x628a('0x15')],{'raw':_0x3bbcd7[_0x628a('0x16')]?_0x3bbcd7['options'][_0x628a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbcd7[_0x628a('0x16')]?_0x3bbcd7['options'][_0x628a('0x18')]||null:null,'attributes':_0x3bbcd7[_0x628a('0x16')]?_0x3bbcd7[_0x628a('0x16')]['attributes']||null:null,'limit':_0x3bbcd7['options']?_0x3bbcd7[_0x628a('0x16')][_0x628a('0x19')]||null:null})[_0x628a('0xb')](function(_0x32c800){logger['info'](_0x628a('0x13'),_0x3bbcd7);logger['debug'](_0x628a('0x13'),_0x3bbcd7,JSON[_0x628a('0x1a')](_0x32c800));_0x215d10(_0x32c800);})[_0x628a('0x1b')](function(_0x1344b4){logger[_0x628a('0xe')]('UpdateMailApplication',_0x1344b4[_0x628a('0x10')],_0x3bbcd7);_0x52c484(_0x3f0147['error'](0x1f4,_0x1344b4['message']));});});}; \ No newline at end of file +var _0xa512=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa512,0x89));var _0x2a51=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0xa512[_0xbc1a4b];return _0x108b87;};'use strict';var _=require(_0x2a51('0x0'));var util=require(_0x2a51('0x1'));var moment=require('moment');var BPromise=require(_0x2a51('0x2'));var rs=require(_0x2a51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a51('0x4'));var logger=require(_0x2a51('0x5'))(_0x2a51('0x6'));var config=require('../../config/environment');var jayson=require(_0x2a51('0x7'));var client=jayson[_0x2a51('0x8')][_0x2a51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x475f08,_0x2e3c61,_0x251a84){return new BPromise(function(_0x1ca534,_0x24e94b){return client[_0x2a51('0xa')](_0x475f08,_0x251a84)[_0x2a51('0xb')](function(_0x388e1c){logger[_0x2a51('0xc')](_0x2a51('0xd'),_0x2e3c61,_0x2a51('0xe'));logger[_0x2a51('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x2e3c61,_0x2a51('0xe'),JSON[_0x2a51('0x10')](_0x388e1c));if(_0x388e1c[_0x2a51('0x11')]){if(_0x388e1c['error'][_0x2a51('0x12')]===0x1f4){logger['error'](_0x2a51('0xd'),_0x2e3c61,_0x388e1c[_0x2a51('0x11')][_0x2a51('0x13')]);return _0x24e94b(_0x388e1c[_0x2a51('0x11')][_0x2a51('0x13')]);}logger[_0x2a51('0x11')]('MailApplication,\x20%s,\x20%s',_0x2e3c61,_0x388e1c[_0x2a51('0x11')][_0x2a51('0x13')]);return _0x1ca534(_0x388e1c[_0x2a51('0x11')][_0x2a51('0x13')]);}else{logger[_0x2a51('0xc')](_0x2a51('0xd'),_0x2e3c61,_0x2a51('0xe'));_0x1ca534(_0x388e1c[_0x2a51('0x14')]['message']);}})[_0x2a51('0x15')](function(_0x11c564){logger[_0x2a51('0x11')](_0x2a51('0xd'),_0x2e3c61,_0x11c564);_0x24e94b(_0x11c564);});});}exports[_0x2a51('0x16')]=function(_0x16726a){var _0x63ff06=this;return new Promise(function(_0x23e43b,_0x3ab653){return db[_0x2a51('0x17')][_0x2a51('0x18')](_0x16726a[_0x2a51('0x19')],{'raw':_0x16726a[_0x2a51('0x1a')]?_0x16726a[_0x2a51('0x1a')][_0x2a51('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16726a['options']?_0x16726a[_0x2a51('0x1a')]['where']||null:null,'attributes':_0x16726a['options']?_0x16726a['options'][_0x2a51('0x1c')]||null:null,'limit':_0x16726a['options']?_0x16726a[_0x2a51('0x1a')][_0x2a51('0x1d')]||null:null})[_0x2a51('0xb')](function(_0x401e4e){logger[_0x2a51('0xc')](_0x2a51('0x16'),_0x16726a);logger['debug']('UpdateMailApplication',_0x16726a,JSON['stringify'](_0x401e4e));_0x23e43b(_0x401e4e);})[_0x2a51('0x15')](function(_0x5b632d){logger['error'](_0x2a51('0x16'),_0x5b632d['message'],_0x16726a);_0x3ab653(_0x63ff06['error'](0x1f4,_0x5b632d[_0x2a51('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2aa619d..70c591f 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 _0x0786=['describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x43f8ff,_0x43374a){var _0x3768cb=function(_0x22e6e6){while(--_0x22e6e6){_0x43f8ff['push'](_0x43f8ff['shift']());}};_0x3768cb(++_0x43374a);}(_0x0786,0xa5));var _0x6078=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0x0786[_0x375325];return _0x228f57;};'use strict';var express=require(_0x6078('0x0'));var router=express[_0x6078('0x1')]();var auth=require(_0x6078('0x2'));var interaction=require(_0x6078('0x3'));var controller=require(_0x6078('0x4'));router[_0x6078('0x5')]('/',auth[_0x6078('0x6')](),controller[_0x6078('0x7')]);router['get'](_0x6078('0x8'),auth['isAuthenticated'](),controller[_0x6078('0x9')]);router[_0x6078('0x5')](_0x6078('0xa'),auth['isAuthenticated'](),controller[_0x6078('0xb')]);router[_0x6078('0x5')](_0x6078('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x6078('0x5')](_0x6078('0xd'),auth[_0x6078('0x6')](),controller[_0x6078('0xe')]);router['post']('/',auth[_0x6078('0x6')](),controller[_0x6078('0xf')]);router[_0x6078('0x10')](_0x6078('0xc'),auth['isAuthenticated'](),controller[_0x6078('0x11')]);router['post']('/:id/tags',auth[_0x6078('0x6')](),interaction[_0x6078('0x12')](_0x6078('0x13'),_0x6078('0x14')),controller[_0x6078('0x15')]);router[_0x6078('0x16')](_0x6078('0xa'),auth['isAuthenticated'](),interaction[_0x6078('0x12')]('mail',_0x6078('0x17')),controller['update']);router[_0x6078('0x18')](_0x6078('0xa'),auth[_0x6078('0x6')](),interaction[_0x6078('0x12')]('mail',_0x6078('0x19')),controller[_0x6078('0x1a')]);router[_0x6078('0x18')](_0x6078('0x1b'),auth[_0x6078('0x6')](),controller[_0x6078('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xbd37=['isAuthenticated','index','/describe','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','get'];(function(_0x41e81d,_0x2be61e){var _0x40292d=function(_0xbef560){while(--_0xbef560){_0x41e81d['push'](_0x41e81d['shift']());}};_0x40292d(++_0x2be61e);}(_0xbd37,0x1d0));var _0x7bd3=function(_0x27480c,_0x55cde9){_0x27480c=_0x27480c-0x0;var _0x425b8d=_0xbd37[_0x27480c];return _0x425b8d;};'use strict';var express=require(_0x7bd3('0x0'));var router=express[_0x7bd3('0x1')]();var auth=require(_0x7bd3('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x7bd3('0x3')]('/',auth[_0x7bd3('0x4')](),controller[_0x7bd3('0x5')]);router['get'](_0x7bd3('0x6'),auth[_0x7bd3('0x4')](),controller['describe']);router[_0x7bd3('0x3')]('/:id',auth[_0x7bd3('0x4')](),controller[_0x7bd3('0x7')]);router[_0x7bd3('0x3')](_0x7bd3('0x8'),auth[_0x7bd3('0x4')](),controller['getMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7bd3('0x9')]);router[_0x7bd3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7bd3('0xb')]);router[_0x7bd3('0xa')]('/:id/messages',auth[_0x7bd3('0x4')](),controller[_0x7bd3('0xc')]);router['post'](_0x7bd3('0xd'),auth[_0x7bd3('0x4')](),interaction[_0x7bd3('0xe')]('mail',_0x7bd3('0xf')),controller[_0x7bd3('0x10')]);router[_0x7bd3('0x11')](_0x7bd3('0x12'),auth['isAuthenticated'](),interaction[_0x7bd3('0xe')]('mail',_0x7bd3('0x13')),controller[_0x7bd3('0x14')]);router[_0x7bd3('0x15')](_0x7bd3('0x12'),auth[_0x7bd3('0x4')](),interaction[_0x7bd3('0xe')](_0x7bd3('0x16'),_0x7bd3('0x17')),controller[_0x7bd3('0x18')]);router[_0x7bd3('0x15')](_0x7bd3('0xd'),auth['isAuthenticated'](),controller['removeTags']);module[_0x7bd3('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 31f12f7..10798f6 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 _0x3aff=['sequelize','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out'];(function(_0x2df5d7,_0x5057d4){var _0x13b2fd=function(_0x51fbd2){while(--_0x51fbd2){_0x2df5d7['push'](_0x2df5d7['shift']());}};_0x13b2fd(++_0x5057d4);}(_0x3aff,0x148));var _0xf3af=function(_0x452418,_0x11ca76){_0x452418=_0x452418-0x0;var _0x53fa2d=_0x3aff[_0x452418];return _0x53fa2d;};'use strict';var Sequelize=require(_0xf3af('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf3af('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf3af('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf3af('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf3af('0x2')]},'cc':{'type':Sequelize[_0xf3af('0x3')](_0xf3af('0x4'))},'subject':{'type':Sequelize[_0xf3af('0x3')]()},'attach':{'type':Sequelize[_0xf3af('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf3af('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xf3af('0x6')]('in',_0xf3af('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf3af('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xf3af('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3af('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xd7ce=['DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long'];(function(_0x923148,_0x35a066){var _0x5e8164=function(_0x3c0132){while(--_0x3c0132){_0x923148['push'](_0x923148['shift']());}};_0x5e8164(++_0x35a066);}(_0xd7ce,0x16b));var _0xed7c=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xd7ce[_0x543242];return _0x4c99b6;};'use strict';var Sequelize=require(_0xed7c('0x0'));var iconv=require(_0xed7c('0x1'));module[_0xed7c('0x2')]={'closed':{'type':Sequelize[_0xed7c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xed7c('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xed7c('0x4')]},'cc':{'type':Sequelize[_0xed7c('0x5')](_0xed7c('0x6'))},'subject':{'type':Sequelize[_0xed7c('0x5')]()},'attach':{'type':Sequelize[_0xed7c('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xed7c('0x7')]},'substatus':{'type':Sequelize[_0xed7c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xed7c('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xed7c('0x8')]('in',_0xed7c('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xed7c('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xed7c('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xed7c('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 aea4ea1..00a1752 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 _0x7949=['attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','unmanaged','UserId','closed','answered','index','MailInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','from','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','tools_tags','expr','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','split','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','$lte','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','user','agent','sequelize','toString','merge','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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','Setting','show','params','keys','includeAll','include','options','update','body','describe','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','true','setTags','spread','Tag','color','emit','removeTags','download','unix','join','server','files','root'];(function(_0x1e8a52,_0x3f3b9e){var _0x2f9358=function(_0x536614){while(--_0x536614){_0x1e8a52['push'](_0x1e8a52['shift']());}};_0x2f9358(++_0x3f3b9e);}(_0x7949,0xfc));var _0x9794=function(_0x2bedfb,_0x3c4f64){_0x2bedfb=_0x2bedfb-0x0;var _0x5409c1=_0x7949[_0x2bedfb];return _0x5409c1;};'use strict';var emlformat=require(_0x9794('0x0'));var rimraf=require(_0x9794('0x1'));var zipdir=require(_0x9794('0x2'));var moment=require(_0x9794('0x3'));var BPromise=require(_0x9794('0x4'));var util=require('util');var path=require(_0x9794('0x5'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require(_0x9794('0x6'));var Redis=require(_0x9794('0x7'));var qs=require(_0x9794('0x8'));var as=require(_0x9794('0x9'));var logger=require('../../config/logger')(_0x9794('0xa'));var config=require(_0x9794('0xb'));var db=require(_0x9794('0xc'))['db'];var htmlEntities=require(_0x9794('0xd'));config['redis']=_[_0x9794('0xe')](config[_0x9794('0xf')],{'host':_0x9794('0x10'),'port':0x18eb});var socket=require(_0x9794('0x11'))(new Redis(config['redis']));require(_0x9794('0x12'))[_0x9794('0x13')](socket);function respondWithStatusCode(_0x2045c3,_0x52f09f){_0x52f09f=_0x52f09f||0xcc;return function(_0x3b42dd){if(_0x3b42dd){return _0x2045c3['sendStatus'](_0x52f09f);}return _0x2045c3[_0x9794('0x14')](_0x52f09f)[_0x9794('0x15')]();};}function respondWithResult(_0x5152fc,_0x33c185){_0x33c185=_0x33c185||0xc8;return function(_0x320fd7){if(_0x320fd7){return _0x5152fc[_0x9794('0x14')](_0x33c185)[_0x9794('0x16')](_0x320fd7);}};}function respondWithFilteredResult(_0x108310,_0x5f4525){return function(_0x166c7b){if(_0x166c7b){var _0x4dafc1=typeof _0x5f4525[_0x9794('0x17')]==='undefined'&&typeof _0x5f4525[_0x9794('0x18')]===_0x9794('0x19');var _0x2684d4=_0x166c7b[_0x9794('0x1a')];var _0x12cc35=_0x4dafc1?0x0:_0x5f4525['offset'];var _0x3cd1f9=_0x4dafc1?_0x166c7b[_0x9794('0x1a')]:_0x5f4525['offset']+_0x5f4525[_0x9794('0x18')];var _0x463a5e;if(_0x3cd1f9>=_0x2684d4){_0x3cd1f9=_0x2684d4;_0x463a5e=0xc8;}else{_0x463a5e=0xce;}_0x108310[_0x9794('0x14')](_0x463a5e);return _0x108310['set'](_0x9794('0x1b'),_0x12cc35+'-'+_0x3cd1f9+'/'+_0x2684d4)[_0x9794('0x16')](_0x166c7b);}return null;};}function saveUpdates(_0x4d9692){return function(_0x348192){if(_0x348192){return _0x348192['update'](_0x4d9692)[_0x9794('0x1c')](function(_0x3575c8){return _0x3575c8;});}return null;};}function removeEntity(_0x270ad0){return function(_0x11067f){if(_0x11067f){return _0x11067f[_0x9794('0x1d')]()['then'](function(){_0x270ad0[_0x9794('0x14')](0xcc)[_0x9794('0x15')]();});}};}function handleEntityNotFound(_0x4b0177){return function(_0x3537dc){if(!_0x3537dc){_0x4b0177[_0x9794('0x1e')](0x194);}return _0x3537dc;};}function handleError(_0x33eee0,_0x421365){_0x421365=_0x421365||0x1f4;return function(_0xe523aa){logger[_0x9794('0x1f')](_0xe523aa[_0x9794('0x20')]);if(_0xe523aa[_0x9794('0x21')]){delete _0xe523aa['name'];}_0x33eee0['status'](_0x421365)[_0x9794('0x22')](_0xe523aa);};}function getInteractionUsers(_0xdbd5f3,_0x25cc78){return new BPromise(function(_0x565580,_0x2bf294){try{if(_0x25cc78[_0xdbd5f3['id']]){_0xdbd5f3[_0x9794('0x23')]=_[_0x9794('0x24')](_0x25cc78[_0xdbd5f3['id']],function(_0x18af65){return{'id':_0x18af65['id'],'fullname':_0x18af65[_0x9794('0x25')]};});}}catch(_0x55e40a){_0x2bf294(_0x55e40a);}_0x565580(_0xdbd5f3);});}function getInteractionTags(_0x1974a5,_0x3a2c24){return new BPromise(function(_0x3cc1a2,_0x16e397){try{if(_0x1974a5[_0x9794('0x26')]){_0x1974a5[_0x9794('0x27')]=[];_0x1974a5['TagIds']['split'](',')[_0x9794('0x28')](function(_0x202405){_0x1974a5[_0x9794('0x27')]['push'](_0x3a2c24[_0x202405]);});}delete _0x1974a5[_0x9794('0x26')];}catch(_0x5ab59c){_0x16e397(_0x5ab59c);}_0x3cc1a2(_0x1974a5);});}function getLastMessageText(_0x5317dd){return new BPromise(function(_0x476f6c,_0x3572f0){return db[_0x9794('0x29')][_0x9794('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x5317dd['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9794('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9794('0x2c')],'order':_0x9794('0x2d'),'raw':!![]})[_0x9794('0x1c')](function(_0x9cbb0b){if(_0x9cbb0b&&_0x9cbb0b[_0x9794('0x2c')]){_0x5317dd[_0x9794('0x2e')]=_[_0x9794('0x2f')](_0x9cbb0b['plainBody']);}_0x476f6c(_0x5317dd);})[_0x9794('0x30')](function(_0x59eeca){_0x3572f0(_0x59eeca);});});}function updateMailInteraction(_0x26640e,_0x1ba12a,_0x40f85f,_0x4a0611){return new BPromise(function(_0x5cbd5b,_0x89a326){return getInteractionUsers(_0x26640e,_0x40f85f)['then'](function(_0x2d24c2){return getInteractionTags(_0x2d24c2,_0x1ba12a);})['then'](function(_0x11235a){return getStateInteraction(_0x11235a);})[_0x9794('0x1c')](function(_0x39eb5f){if(_0x4a0611){_0x5cbd5b(getLastMessageText(_0x39eb5f));}else{_0x5cbd5b(_0x39eb5f);}})['catch'](function(_0x1b1c9d){_0x89a326(_0x1b1c9d);});});}function getStateInteraction(_0x44a441){return new BPromise(function(_0x2a1c0b){_0x44a441[_0x9794('0x31')]=0x0;_0x44a441[_0x9794('0x32')]=0x0;_0x44a441['answered']=0x0;_0x44a441[_0x9794('0x33')]=0x0;_0x44a441['total']=0x0;if(!_0x44a441['closed']&&!_0x44a441[_0x9794('0x34')]){_0x44a441['waiting']+=0x1;}if(!_0x44a441['closed']&&_0x44a441['UserId']){_0x44a441[_0x9794('0x32')]+=0x1;if(_0x44a441[_0x9794('0x31')]){_0x44a441[_0x9794('0x31')]-=0x1;}}if(_0x44a441[_0x9794('0x35')]&&_0x44a441[_0x9794('0x34')]){_0x44a441[_0x9794('0x36')]+=0x1;if(_0x44a441[_0x9794('0x32')]){_0x44a441[_0x9794('0x32')]-=0x1;}}if(_0x44a441[_0x9794('0x35')]&&!_0x44a441[_0x9794('0x34')]){_0x44a441[_0x9794('0x33')]+=0x1;if(_0x44a441[_0x9794('0x31')]){_0x44a441[_0x9794('0x31')]-=0x1;}}_0x44a441['total']+=0x1;_0x2a1c0b(_0x44a441);});}exports[_0x9794('0x37')]=function(_0x2da093,_0x5ee18a){var _0x3dd3f3={},_0x59b5e9={},_0x2ead45={'count':0x0,'rows':[]};var _0x4d5029=_['map'](db[_0x9794('0x38')][_0x9794('0x39')],function(_0x3ed8e6){return{'name':_0x3ed8e6[_0x9794('0x3a')],'type':_0x3ed8e6[_0x9794('0x3b')][_0x9794('0x3c')]};});_0x59b5e9[_0x9794('0x3d')]=_[_0x9794('0x24')](_0x4d5029,_0x9794('0x21'));_0x59b5e9[_0x9794('0x3e')]=_['keys'](_0x2da093[_0x9794('0x3e')]);_0x59b5e9[_0x9794('0x3f')]=_[_0x9794('0x40')](_0x59b5e9[_0x9794('0x3d')],_0x59b5e9[_0x9794('0x3e')]);_0x3dd3f3['attributes']=_[_0x9794('0x40')](_0x59b5e9[_0x9794('0x3d')],qs['fields'](_0x2da093[_0x9794('0x3e')][_0x9794('0x41')]));_0x3dd3f3['attributes']=_0x3dd3f3[_0x9794('0x42')]['length']?_0x3dd3f3['attributes']:_0x59b5e9['model'];if(!_0x2da093[_0x9794('0x3e')][_0x9794('0x43')](_0x9794('0x44'))){_0x3dd3f3[_0x9794('0x18')]=qs[_0x9794('0x18')](_0x2da093['query'][_0x9794('0x18')]);_0x3dd3f3['offset']=qs[_0x9794('0x17')](_0x2da093[_0x9794('0x3e')]['offset']);}_0x3dd3f3[_0x9794('0x45')]=qs[_0x9794('0x46')](_0x2da093[_0x9794('0x3e')][_0x9794('0x46')]);_0x3dd3f3[_0x9794('0x47')]=qs[_0x9794('0x3f')](_['pick'](_0x2da093[_0x9794('0x3e')],_0x59b5e9[_0x9794('0x3f')]),_0x4d5029);var _0x40fb33=[];var _0x200812=squel[_0x9794('0x48')]()[_0x9794('0x49')]('id')[_0x9794('0x49')]('name')[_0x9794('0x49')]('color')[_0x9794('0x4a')]('tools_tags');var _0x222977=squel[_0x9794('0x48')]()[_0x9794('0x49')](_0x9794('0x4b'))[_0x9794('0x49')](_0x9794('0x4c'))[_0x9794('0x49')](_0x9794('0x4d'))[_0x9794('0x4a')](_0x9794('0x4e'),'ui')[_0x9794('0x4f')](_0x9794('0x50'),'u',_0x9794('0x51'));var _0x5ed33e=squel[_0x9794('0x48')]()[_0x9794('0x4a')](_0x9794('0x52'),'i')['left_join'](_0x9794('0x53'),'c',_0x9794('0x54'))[_0x9794('0x4f')]('users','o',_0x9794('0x55'))[_0x9794('0x4f')](_0x9794('0x56'),'a',_0x9794('0x57'))[_0x9794('0x4f')]('mail_messages','me',_0x9794('0x58'))[_0x9794('0x4f')](_0x9794('0x59'),'it','it.MailInteractionId\x20=\x20i.id')[_0x9794('0x4f')](_0x9794('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x15e5e9=squel[_0x9794('0x5b')]();var _0x5ba3af=[];var _0x42fbd8=squel[_0x9794('0x5b')]();var _0x18d25f;if(_0x2da093[_0x9794('0x3e')]['search']){_0x18d25f=as['parseSearch'](_0x2da093[_0x9794('0x3e')]['search']);var _0x13932c=_0x18d25f[_0x9794('0x5c')];for(var _0x59e9a2=0x0;_0x59e9a2<_0x18d25f[_0x9794('0x5d')]['length'];_0x59e9a2++){var _0x29bbcc=_0x18d25f[_0x9794('0x5d')][_0x59e9a2];var _0x122063='i';var _0x555a4f=_['find'](_0x4d5029,[_0x9794('0x21'),_0x29bbcc[_0x9794('0x49')]]);if(!_0x555a4f){switch(_0x29bbcc[_0x9794('0x49')]){case'unreadMessages':if(_0x29bbcc[_0x9794('0x5e')]==0x1){_0x5ed33e[_0x9794('0x5f')]('`'+_0x29bbcc[_0x9794('0x49')]+_0x9794('0x60'));}else{_0x5ed33e[_0x9794('0x5f')]('`'+_0x29bbcc[_0x9794('0x49')]+_0x9794('0x61'));}break;case'Contact':if(_0x29bbcc[_0x9794('0x62')]===_0x9794('0x63')){if(_0x29bbcc[_0x9794('0x5e')]['split']('\x20')[_0x9794('0x64')]>0x1){_0x15e5e9[_0x13932c](_0x9794('0x65'),qs[_0x9794('0x66')](_0x29bbcc[_0x9794('0x5e')]),null);}else{var _0x528469='%'+_0x29bbcc[_0x9794('0x5e')]+'%';_0x15e5e9[_0x13932c](_0x9794('0x67'),_0x528469,_0x528469,_0x528469);}}else{_0x555a4f=_['find'](_0x4d5029,[_0x9794('0x21'),_0x9794('0x68')]);_0x29bbcc[_0x9794('0x49')]=_0x9794('0x68');_0x993fdc=as[_0x9794('0x69')](_0x122063,_0x555a4f['type'],_0x29bbcc);_0x15e5e9[_0x13932c](_0x993fdc[_0x9794('0x6a')],_0x993fdc['value'][_0x9794('0x6b')],_0x993fdc['value'][_0x9794('0x15')]);}break;case'Tag':var _0x123eee=_0x29bbcc['value'][_0x9794('0x6c')](',')['map'](function(_0x1c26f7){return Number(_0x1c26f7);});_0x123eee[_0x9794('0x28')](function(_0x549cb7){_0x42fbd8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x549cb7+',%');});_0x5ba3af=_['union'](_0x5ba3af,_0x123eee);break;case _0x9794('0x6d'):if(_0x29bbcc[_0x9794('0x62')]===_0x9794('0x63')){_0x15e5e9[_0x13932c](_0x9794('0x6e'),'%'+_0x29bbcc['value']+'%',null);}else{_0x555a4f=_[_0x9794('0x6f')](_0x4d5029,[_0x9794('0x21'),_0x9794('0x34')]);_0x29bbcc[_0x9794('0x49')]=_0x9794('0x34');_0x993fdc=as['buildExpression'](_0x122063,_0x555a4f['type'],_0x29bbcc);_0x15e5e9[_0x13932c](_0x993fdc[_0x9794('0x6a')],_0x993fdc[_0x9794('0x5e')][_0x9794('0x6b')],_0x993fdc[_0x9794('0x5e')][_0x9794('0x15')]);}break;case _0x9794('0x2c'):_0x993fdc=as[_0x9794('0x69')]('me',null,_0x29bbcc);_0x15e5e9[_0x13932c](_0x993fdc[_0x9794('0x6a')],_0x993fdc[_0x9794('0x5e')]['start'],_0x993fdc[_0x9794('0x5e')]['end']);break;}}else{var _0x993fdc=as[_0x9794('0x69')](_0x122063,_0x555a4f[_0x9794('0x3b')],_0x29bbcc);_0x15e5e9[_0x13932c](_0x993fdc[_0x9794('0x6a')],_0x993fdc[_0x9794('0x5e')][_0x9794('0x6b')],_0x993fdc[_0x9794('0x5e')]['end']);}}}else{var _0x5b4c63=_(_0x2da093[_0x9794('0x3e')])['keys']()[_0x9794('0x24')](function(_0x5caec6){return _[_0x9794('0x70')](_0x4d5029,[_0x9794('0x21'),_0x5caec6])?_0x5caec6:undefined;})[_0x9794('0x71')]()[_0x9794('0x5e')]();if(!_[_0x9794('0x72')](_0x5b4c63)){_0x5b4c63[_0x9794('0x28')](function(_0x12574b){if(_0x12574b===_0x9794('0x73')){_0x5ed33e['where'](_0x9794('0x74'),[]['concat'](_0x2da093[_0x9794('0x3e')][_0x12574b]));}else if(_0x12574b==='createdAt'){var _0x4aeb26=JSON['parse'](_0x2da093['query'][_0x12574b])['$gte'];var _0xb5d506=JSON['parse'](_0x2da093[_0x9794('0x3e')][_0x12574b])[_0x9794('0x75')];_0x5ed33e[_0x9794('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4aeb26,_0xb5d506);}else{if(_0x2da093[_0x9794('0x3e')][_0x12574b]==='null'){_0x5ed33e['where']('i.'+_0x12574b+'\x20IS\x20NULL');}else{_0x5ed33e[_0x9794('0x47')]('i.'+_0x12574b+_0x9794('0x76'),_0x2da093[_0x9794('0x3e')][_0x12574b]);}}});}if(_0x2da093['query']['read']){if(_0x2da093[_0x9794('0x3e')][_0x9794('0x77')]==0x1){_0x5ed33e[_0x9794('0x5f')](_0x9794('0x78'));}else{_0x5ed33e[_0x9794('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x2da093['query'][_0x9794('0x79')]){_0x5ba3af=_[_0x9794('0x7a')](_0x2da093[_0x9794('0x3e')][_0x9794('0x79')])?_0x2da093[_0x9794('0x3e')]['tag']:new Array(_0x2da093['query']['tag']);_0x5ba3af[_0x9794('0x28')](function(_0x2b4e43){_0x42fbd8['or'](_0x9794('0x7b'),'%,'+_0x2b4e43+',%');});}if(_0x2da093['query'][_0x9794('0x7c')]){var _0xc3c18e=_0x2da093[_0x9794('0x3e')][_0x9794('0x7c')][_0x9794('0x7d')]('\x5c','\x5c\x5c')[_0x9794('0x7d')](/'/g,'\x27\x27');if(qs[_0x9794('0x7e')](_0xc3c18e)){_0x15e5e9['or'](_0x9794('0x7f'),_0xc3c18e+'%');}else if(qs[_0x9794('0x80')](_0xc3c18e)){_0x15e5e9['or'](_0x9794('0x81'),_0xc3c18e+'%');}else{_0x15e5e9['or'](_0x9794('0x82'),qs[_0x9794('0x66')](_0xc3c18e))['or'](_0x9794('0x83'),qs[_0x9794('0x66')](_0xc3c18e));}}}_0x5ed33e['where'](_0x15e5e9);_0x5ed33e[_0x9794('0x84')](_0x9794('0x85'));var _0x2602e3={'type':db[_0x9794('0x86')][_0x9794('0x87')]['SELECT'],'raw':!![]};var _0x2f146f=_0x5ed33e[_0x9794('0x88')]();_0x2f146f[_0x9794('0x49')](_0x9794('0x85'));_0x2f146f[_0x9794('0x49')](_0x9794('0x89'),_0x9794('0x8a'));if(_0x3dd3f3[_0x9794('0x45')]){_0x3dd3f3[_0x9794('0x45')][_0x9794('0x28')](function(_0x24f6b9){var _0x2263dd=_0x24f6b9[0x0]===_0x9794('0x8b')?_0x24f6b9[0x0]:'i.'+_0x24f6b9[0x0];_0x5ed33e[_0x9794('0x45')](_0x2263dd,_0x24f6b9[0x1]===_0x9794('0x8c')?![]:!![]);});}if(!_[_0x9794('0x72')](_0x5ba3af)){_0x5ed33e[_0x9794('0x5f')](_0x42fbd8);_0x2f146f[_0x9794('0x47')](_0x9794('0x8d'),_0x5ba3af);}BPromise[_0x9794('0x8e')]()[_0x9794('0x1c')](function(){if(!_0x18d25f){if(_0x2da093[_0x9794('0x3e')][_0x9794('0x73')])return;_0x2f146f['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x5ed33e[_0x9794('0x47')](_0x9794('0x8f'));return;}if(_0x2da093['user'][_0x9794('0x90')]!=='agent')return;return _0x2da093['user'][_0x9794('0x91')]({'attributes':['id'],'raw':!![]})[_0x9794('0x1c')](function(_0x52b35f){if(_[_0x9794('0x72')](_0x52b35f)){_0x2f146f[_0x9794('0x47')](_0x9794('0x92'));_0x5ed33e[_0x9794('0x47')]('i.MailAccountId\x20IS\x20NULL');}else{_0x2f146f[_0x9794('0x47')](_0x9794('0x74'),_[_0x9794('0x24')](_0x52b35f,'id'));_0x5ed33e['where']('i.MailAccountId\x20IN\x20?',_[_0x9794('0x24')](_0x52b35f,'id'));}});})[_0x9794('0x1c')](function(){if(_0x2da093[_0x9794('0x93')]['role']===_0x9794('0x94')&&!_0x18d25f&&!_0x2da093[_0x9794('0x3e')][_0x9794('0x73')])return[];return db['sequelize'][_0x9794('0x3e')](_0x2f146f['toString'](),_0x2602e3);})['then'](function(_0x28bdcc){_0x2ead45[_0x9794('0x1a')]=_0x28bdcc[_0x9794('0x64')];if(_0x2ead45[_0x9794('0x1a')]===0x0)return[];return db[_0x9794('0x95')][_0x9794('0x3e')](_0x200812[_0x9794('0x96')](),_0x2602e3)[_0x9794('0x1c')](function(_0x11b307){_0x40fb33=_['keyBy'](_0x11b307,'id');_0x2602e3=_[_0x9794('0x97')](_0x2602e3,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2da093[_0x9794('0x3e')]['fields']){_0x3dd3f3['attributes'][_0x9794('0x28')](function(_0x34fb04){_0x5ed33e[_0x9794('0x49')]('i.'+_0x34fb04);});}else{_0x5ed33e[_0x9794('0x49')](_0x9794('0x89'),'unreadMessages');_0x5ed33e[_0x9794('0x49')]('a.key','Account.key');_0x5ed33e[_0x9794('0x49')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5ed33e['field'](_0x9794('0x98'),_0x9794('0x8b'));_0x5ed33e[_0x9794('0x49')]('i.id');_0x5ed33e[_0x9794('0x49')](_0x9794('0x99'));_0x5ed33e[_0x9794('0x49')](_0x9794('0x9a'));_0x5ed33e[_0x9794('0x49')](_0x9794('0x9b'));_0x5ed33e['field'](_0x9794('0x9c'));_0x5ed33e[_0x9794('0x49')](_0x9794('0x9d'));_0x5ed33e[_0x9794('0x49')](_0x9794('0x9e'));_0x5ed33e[_0x9794('0x49')](_0x9794('0x9f'));_0x5ed33e['field'](_0x9794('0xa0'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xa1'));_0x5ed33e[_0x9794('0x49')]('i.secondDisposition');_0x5ed33e['field']('i.thirdDisposition');_0x5ed33e[_0x9794('0x49')](_0x9794('0xa2'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xa3'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xa4'));_0x5ed33e[_0x9794('0x49')]('i.MailAccountId');_0x5ed33e[_0x9794('0x49')](_0x9794('0xa5'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xa6'),_0x9794('0xa7'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xa8'),_0x9794('0xa9'));_0x5ed33e[_0x9794('0x49')]('c.email',_0x9794('0xaa'));_0x5ed33e['field'](_0x9794('0xab'),_0x9794('0xac'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xad'),_0x9794('0xae'));_0x5ed33e[_0x9794('0x49')]('c.fax',_0x9794('0xaf'));_0x5ed33e[_0x9794('0x49')](_0x9794('0xb0'),'Owner.fullname');_0x5ed33e[_0x9794('0x49')](_0x9794('0xb1'),_0x9794('0xb2'));_0x5ed33e[_0x9794('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3dd3f3['limit'])_0x5ed33e[_0x9794('0x18')](_0x3dd3f3['limit']);if(_0x3dd3f3['offset'])_0x5ed33e['offset'](_0x3dd3f3['offset']);return db['sequelize']['query'](_0x5ed33e[_0x9794('0x96')](),_0x2602e3);})[_0x9794('0x1c')](function(_0x2f5fc2){if(_0x2f5fc2['length']>0x0)_0x222977[_0x9794('0x47')]('ui.MailInteractionId\x20IN\x20?',_[_0x9794('0x24')](_0x2f5fc2,'id'));return db[_0x9794('0x95')][_0x9794('0x3e')](_0x222977[_0x9794('0x96')](),_0x2602e3)[_0x9794('0x1c')](function(_0x2ef4b4){var _0x3eb281=_[_0x9794('0xb3')](_0x2ef4b4,'MailInteractionId');var _0x293bed=[];return db[_0x9794('0xb4')][_0x9794('0x2a')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x9794('0x1c')](function(_0x53a354){var _0x1cd70e=_0x53a354['enableEmailPreview'];_0x2f5fc2[_0x9794('0x28')](function(_0x47cac5){_0x293bed['push'](updateMailInteraction(_0x47cac5,_0x40fb33,_0x3eb281,_0x1cd70e));});return BPromise['all'](_0x293bed);});});});})['then'](function(_0x470c24){_0x2ead45['rows']=_0x470c24;return _0x2ead45;})[_0x9794('0x1c')](respondWithFilteredResult(_0x5ee18a,_0x3dd3f3))[_0x9794('0x30')](handleError(_0x5ee18a,null));};exports[_0x9794('0xb5')]=function(_0x423953,_0x19196f){var _0x2695e5={'raw':![],'where':{'id':_0x423953[_0x9794('0xb6')]['id']}},_0x184955={};_0x184955['model']=_[_0x9794('0xb7')](db['MailInteraction'][_0x9794('0x39')]);_0x184955['query']=_[_0x9794('0xb7')](_0x423953[_0x9794('0x3e')]);_0x184955[_0x9794('0x3f')]=_[_0x9794('0x40')](_0x184955[_0x9794('0x3d')],_0x184955['query']);_0x2695e5[_0x9794('0x42')]=_[_0x9794('0x40')](_0x184955[_0x9794('0x3d')],qs['fields'](_0x423953[_0x9794('0x3e')]['fields']));_0x2695e5[_0x9794('0x42')]=_0x2695e5[_0x9794('0x42')]['length']?_0x2695e5[_0x9794('0x42')]:_0x184955[_0x9794('0x3d')];if(_0x423953[_0x9794('0x3e')][_0x9794('0xb8')]){_0x2695e5[_0x9794('0xb9')]=[{'all':!![]}];}_0x2695e5=_['merge']({},_0x2695e5,_0x423953[_0x9794('0xba')]);return db[_0x9794('0x38')][_0x9794('0x6f')](_0x2695e5)['then'](handleEntityNotFound(_0x19196f,null))[_0x9794('0x1c')](respondWithResult(_0x19196f,null))[_0x9794('0x30')](handleError(_0x19196f,null));};exports['create']=function(_0x555f62,_0x554f47){return db[_0x9794('0x38')]['create'](_0x555f62['body'],{})[_0x9794('0x1c')](respondWithResult(_0x554f47,0xc9))[_0x9794('0x30')](handleError(_0x554f47,null));};exports[_0x9794('0xbb')]=function(_0xdf7013,_0x4d2334){if(_0xdf7013[_0x9794('0xbc')]['id']){delete _0xdf7013['body']['id'];}return db[_0x9794('0x38')][_0x9794('0x6f')]({'where':{'id':_0xdf7013[_0x9794('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4d2334,null))[_0x9794('0x1c')](saveUpdates(_0xdf7013['body'],null))[_0x9794('0x1c')](respondWithResult(_0x4d2334,null))[_0x9794('0x30')](handleError(_0x4d2334,null));};exports[_0x9794('0x1d')]=function(_0x3946d6,_0x4bb3d9){return db[_0x9794('0x38')]['find']({'where':{'id':_0x3946d6[_0x9794('0xb6')]['id']}})[_0x9794('0x1c')](handleEntityNotFound(_0x4bb3d9,null))[_0x9794('0x1c')](removeEntity(_0x4bb3d9,null))[_0x9794('0x30')](handleError(_0x4bb3d9,null));};exports['describe']=function(_0x429c0b,_0x32f607){return db['MailInteraction'][_0x9794('0xbd')]()['then'](respondWithResult(_0x32f607,null))[_0x9794('0x30')](handleError(_0x32f607,null));};exports[_0x9794('0xbe')]=function(_0x3ae356,_0x1977ae){return db['MailMessage']['find']({'where':{'id':_0x3ae356[_0x9794('0xb6')]['id']}})[_0x9794('0x1c')](handleEntityNotFound(_0x1977ae,null))[_0x9794('0x1c')](function(_0x660fd1){if(_0x660fd1){return _0x660fd1[_0x9794('0xbe')](_0x3ae356['body'][_0x9794('0xbf')],_[_0x9794('0xc0')](_0x3ae356[_0x9794('0xbc')],[_0x9794('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x1977ae,null))[_0x9794('0x30')](handleError(_0x1977ae,null));};exports[_0x9794('0xc1')]=function(_0xa36cd6,_0x4944c2){var _0x2a9195={'raw':![],'where':{}};var _0x5dc25b={};var _0x151484={'count':0x0,'rows':[]};return db[_0x9794('0x38')][_0x9794('0x2a')]({'where':{'id':_0xa36cd6['params']['id']}})[_0x9794('0x1c')](handleEntityNotFound(_0x4944c2,null))[_0x9794('0x1c')](function(_0x2a32ba){if(_0x2a32ba){_0x5dc25b[_0x9794('0x3d')]=_[_0x9794('0xb7')](db[_0x9794('0x29')][_0x9794('0x39')]);_0x5dc25b[_0x9794('0x3e')]=_['keys'](_0xa36cd6[_0x9794('0x3e')]);_0x5dc25b['filters']=_['intersection'](_0x5dc25b[_0x9794('0x3d')],_0x5dc25b[_0x9794('0x3e')]);_0x2a9195[_0x9794('0x42')]=_[_0x9794('0x40')](_0x5dc25b['model'],qs['fields'](_0xa36cd6[_0x9794('0x3e')]['fields']));_0x2a9195[_0x9794('0x42')]=_0x2a9195[_0x9794('0x42')][_0x9794('0x64')]?_0x2a9195[_0x9794('0x42')]:_0x5dc25b['model'];if(!_0xa36cd6[_0x9794('0x3e')][_0x9794('0x43')](_0x9794('0x44'))){_0x2a9195[_0x9794('0x18')]=qs[_0x9794('0x18')](_0xa36cd6['query'][_0x9794('0x18')]);_0x2a9195[_0x9794('0x17')]=qs[_0x9794('0x17')](_0xa36cd6[_0x9794('0x3e')][_0x9794('0x17')]);}_0x2a9195['order']=qs[_0x9794('0x46')](_0xa36cd6['query'][_0x9794('0x46')]);_0x2a9195[_0x9794('0x47')]=qs[_0x9794('0x3f')](_[_0x9794('0xc2')](_0xa36cd6[_0x9794('0x3e')],_0x5dc25b[_0x9794('0x3f')]));_0x2a9195[_0x9794('0x47')]['MailInteractionId']=_0x2a32ba['id'];if(_0xa36cd6['query'][_0x9794('0x7c')]){_0x2a9195[_0x9794('0x47')]=_['merge'](_0x2a9195[_0x9794('0x47')],{'$or':_[_0x9794('0x24')](_0x2a9195[_0x9794('0x42')],function(_0x1d74f5){var _0x26288c={};_0x26288c[_0x1d74f5]={'$like':'%'+_0xa36cd6[_0x9794('0x3e')][_0x9794('0x7c')]+'%'};return _0x26288c;})});}if(_0xa36cd6[_0x9794('0x3e')]['$gte']){var _0x419f4e=_0xa36cd6['query']['$gte'][_0x9794('0x6c')](',');var _0x4e2286={};_0x4e2286[_0x419f4e[0x0]]={'$gte':moment(_0x419f4e[0x1])['format'](_0x9794('0xc3'))};_0x2a9195[_0x9794('0x47')]=_['merge'](_0x2a9195[_0x9794('0x47')],_0x4e2286);}_0x2a9195=_[_0x9794('0x97')]({},_0x2a9195,_0xa36cd6['options']);return db['MailMessage'][_0x9794('0x1a')]({'where':_0x2a9195[_0x9794('0x47')]})['then'](function(_0x584d97){_0x151484[_0x9794('0x1a')]=_0x584d97;if(_0xa36cd6[_0x9794('0x3e')]['includeAll']){_0x2a9195[_0x9794('0xb9')]=[{'all':!![]}];}return db[_0x9794('0x29')][_0x9794('0xc4')](_0x2a9195);})[_0x9794('0x1c')](function(_0x3e54bf){if(_0xa36cd6[_0x9794('0x3e')]['inlineCss']===_0x9794('0xc5')){for(var _0x9c9a73=0x0;_0x9c9a73<_0x3e54bf[_0x9794('0x64')];_0x9c9a73++){_0x3e54bf[_0x9c9a73][_0x9794('0xbc')]=juice(_0x3e54bf[_0x9c9a73][_0x9794('0xbc')]);}}_0x151484['rows']=_0x3e54bf;return _0x151484;});}})[_0x9794('0x1c')](respondWithFilteredResult(_0x4944c2,_0x2a9195))[_0x9794('0x30')](handleError(_0x4944c2,null));};exports['addTags']=function(_0x4c91bb,_0x44f607){return db[_0x9794('0x38')][_0x9794('0x6f')]({'where':{'id':_0x4c91bb['params']['id']}})[_0x9794('0x1c')](handleEntityNotFound(_0x44f607,null))[_0x9794('0x1c')](function(_0x4dab7b){if(_0x4dab7b){return _0x4dab7b[_0x9794('0xc6')](_0x4c91bb[_0x9794('0xbc')][_0x9794('0xbf')],_[_0x9794('0xc0')](_0x4c91bb[_0x9794('0xbc')],[_0x9794('0xbf'),'id'])||{})[_0x9794('0xc7')](function(){return db[_0x9794('0xc8')][_0x9794('0xc4')]({'attributes':['id',_0x9794('0x21'),_0x9794('0xc9')],'where':{'id':_0x4c91bb[_0x9794('0xbc')][_0x9794('0xbf')]}});})[_0x9794('0x1c')](function(_0x4b98b3){socket[_0x9794('0xca')]('mailInteractionTags:save',{'id':Number(_0x4c91bb[_0x9794('0xb6')]['id']),'tags':_0x4b98b3||[]});return{'id':Number(_0x4c91bb[_0x9794('0xb6')]['id']),'tags':_0x4b98b3||[]};});}})[_0x9794('0x1c')](respondWithResult(_0x44f607,null))[_0x9794('0x30')](handleError(_0x44f607,null));};exports[_0x9794('0xcb')]=function(_0x200116,_0x4b48d9){return db['MailInteraction'][_0x9794('0x6f')]({'where':{'id':_0x200116[_0x9794('0xb6')]['id']}})[_0x9794('0x1c')](handleEntityNotFound(_0x4b48d9,null))[_0x9794('0x1c')](function(_0x42e631){if(_0x42e631){return _0x42e631['removeTags'](_0x200116['query']['ids']);}})['then'](respondWithStatusCode(_0x4b48d9,null))[_0x9794('0x30')](handleError(_0x4b48d9,null));};exports[_0x9794('0xcc')]=function(_0x448b61,_0x10e302){var _0x3e360d=moment()[_0x9794('0xcd')]()[_0x9794('0x96')]();var _0x3e638b=path[_0x9794('0xce')](config['root'],_0x9794('0xcf'),_0x9794('0xd0'),'tmp');var _0xcf56ba=path['join'](config[_0x9794('0xd1')],_0x9794('0xcf'),_0x9794('0xd0'),_0x9794('0xd2'));var _0x1d4fc5=path['join'](_0x3e638b,_0x3e360d);var _0x31ce77=util[_0x9794('0xd3')](_0x9794('0xd4'),_0x448b61[_0x9794('0xb6')]['id'],_0x3e360d);var _0x392f21=path[_0x9794('0xce')](_0x3e638b,_0x31ce77);var _0xd240a=[];if(_0x448b61[_0x9794('0x3e')][_0x9794('0xd2')]){_0xd240a[_0x9794('0xd5')]({'model':db[_0x9794('0xd6')],'as':'Attachments','raw':!![]});}var _0x496e85=[{'model':db['MailMessage'],'as':_0x9794('0xd7'),'attributes':['id','body','from','to','cc',_0x9794('0xd8'),_0x9794('0xd9'),_0x9794('0xda')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0xd240a}];return db[_0x9794('0x38')][_0x9794('0x6f')]({'where':{'id':_0x448b61['params']['id']},'include':_0x496e85})[_0x9794('0x1c')](handleEntityNotFound(_0x10e302,null))[_0x9794('0x1c')](function(_0x49e2ef){if(_0x49e2ef&&_0x49e2ef['Messages']){var _0x4a1b26=_0x49e2ef[_0x9794('0xdb')]({'plain':!![]});fs[_0x9794('0xdc')](_0x1d4fc5);return BPromise[_0x9794('0xdd')](_0x4a1b26[_0x9794('0xd7')],function(_0x54ff24,_0x213d7b){var _0x454d93={'from':_0x54ff24[_0x9794('0x4a')],'to':_0x54ff24['to'],'subject':_0x54ff24[_0x9794('0xd9')],'html':htmlEntities[_0x9794('0xde')](_0x54ff24[_0x9794('0xbc')]),'headers':{'Date':moment(_0x54ff24[_0x9794('0xda')])[_0x9794('0xd3')](_0x9794('0xdf'))},'attachments':[]};if(_0x54ff24['cc']){_0x454d93[_0x9794('0xe0')]['Cc']=_0x54ff24['cc'];}if(_0x54ff24[_0x9794('0xd8')]){_0x454d93[_0x9794('0xe0')]['Bcc']=_0x54ff24[_0x9794('0xd8')];}return new BPromise(function(_0x2d4db6,_0x155897){if(_0x54ff24[_0x9794('0xe1')]){for(var _0x46dc8b=0x0;_0x46dc8b<_0x54ff24[_0x9794('0xe1')][_0x9794('0x64')];_0x46dc8b++){var _0x2aa543=_0x54ff24[_0x9794('0xe1')][_0x46dc8b];var _0x52dfb3=path[_0x9794('0xce')](_0xcf56ba,_0x2aa543[_0x9794('0xe2')]);if(fs[_0x9794('0xe3')](_0x52dfb3)){_0x454d93[_0x9794('0xd2')][_0x9794('0xd5')]({'name':_0x2aa543[_0x9794('0x21')],'contentType':_0x2aa543[_0x9794('0x3b')],'data':fs['readFileSync'](_0x52dfb3)});}}}emlformat[_0x9794('0xe4')](_0x454d93,function(_0xa07986,_0x306b94){if(_0xa07986)return _0x155897(_0xa07986);fs['writeFileSync'](path[_0x9794('0xce')](_0x1d4fc5,util[_0x9794('0xd3')](_0x9794('0xe5'),_0x213d7b)),_0x306b94);return _0x2d4db6(_0x306b94);});});})[_0x9794('0x1c')](function(){return new BPromise(function(_0x287d54,_0x4bc7c4){zipdir(_0x1d4fc5,{'saveTo':_0x392f21},function(_0x6927f7,_0x2c1171){if(_0x6927f7)return _0x4bc7c4(_0x6927f7);return _0x287d54(_0x2c1171);});})[_0x9794('0x1c')](function(){return new BPromise(function(_0x4b945a,_0x26a40c){rimraf(_0x1d4fc5,function(_0x8b7fba){if(_0x8b7fba)_0x26a40c(_0x8b7fba);return _0x4b945a();});});})[_0x9794('0x1c')](function(){return _0x10e302[_0x9794('0xcc')](_0x392f21,_0x31ce77,function(_0x354e7b){if(!_0x354e7b)fs[_0x9794('0xe6')](_0x392f21);});});});}else{return _0x10e302[_0x9794('0x1e')](0xc8);}})[_0x9794('0x30')](handleError(_0x10e302,null));}; \ No newline at end of file +var _0x9cf4=['juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','MailMessage','plainBody','-id','catch','waiting','total','UserId','closed','talking','answered','unmanaged','MailInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','select','field','from','tools_tags','u.fullname','ui.MailInteractionId','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','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','find','value','having','`\x20=\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\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)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','findOne','enableEmailPreview','rows','show','includeAll','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','hasOwnProperty','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','setTags','color','emit','removeTags','download','unix','server','files','tmp','join','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','moment','bluebird','lodash'];(function(_0x6001ec,_0x491f36){var _0x149733=function(_0x125282){while(--_0x125282){_0x6001ec['push'](_0x6001ec['shift']());}};_0x149733(++_0x491f36);}(_0x9cf4,0x1b9));var _0x49cf=function(_0x2fa33a,_0x279677){_0x2fa33a=_0x2fa33a-0x0;var _0x230eea=_0x9cf4[_0x2fa33a];return _0x230eea;};'use strict';var emlformat=require(_0x49cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49cf('0x1'));var moment=require(_0x49cf('0x2'));var BPromise=require(_0x49cf('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x49cf('0x4'));var squel=require('squel');var juice=require(_0x49cf('0x5'));var Redis=require(_0x49cf('0x6'));var qs=require(_0x49cf('0x7'));var as=require(_0x49cf('0x8'));var logger=require(_0x49cf('0x9'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x49cf('0xa'));config[_0x49cf('0xb')]=_['defaults'](config[_0x49cf('0xb')],{'host':_0x49cf('0xc'),'port':0x18eb});var socket=require(_0x49cf('0xd'))(new Redis(config[_0x49cf('0xb')]));require(_0x49cf('0xe'))[_0x49cf('0xf')](socket);function respondWithStatusCode(_0x454c1e,_0x319012){_0x319012=_0x319012||0xcc;return function(_0x3583f6){if(_0x3583f6){return _0x454c1e[_0x49cf('0x10')](_0x319012);}return _0x454c1e['status'](_0x319012)[_0x49cf('0x11')]();};}function respondWithResult(_0x31b2b7,_0x59ec6b){_0x59ec6b=_0x59ec6b||0xc8;return function(_0x3f1770){if(_0x3f1770){return _0x31b2b7[_0x49cf('0x12')](_0x59ec6b)['json'](_0x3f1770);}};}function respondWithFilteredResult(_0x191ba6,_0x3db9c6){return function(_0x3b3ac4){if(_0x3b3ac4){var _0x957d57=typeof _0x3db9c6[_0x49cf('0x13')]===_0x49cf('0x14')&&typeof _0x3db9c6[_0x49cf('0x15')]===_0x49cf('0x14');var _0x285ccf=_0x3b3ac4['count'];var _0x27b4c0=_0x957d57?0x0:_0x3db9c6[_0x49cf('0x13')];var _0xa85be6=_0x957d57?_0x3b3ac4[_0x49cf('0x16')]:_0x3db9c6[_0x49cf('0x13')]+_0x3db9c6[_0x49cf('0x15')];var _0x4410da;if(_0xa85be6>=_0x285ccf){_0xa85be6=_0x285ccf;_0x4410da=0xc8;}else{_0x4410da=0xce;}_0x191ba6[_0x49cf('0x12')](_0x4410da);return _0x191ba6[_0x49cf('0x17')](_0x49cf('0x18'),_0x27b4c0+'-'+_0xa85be6+'/'+_0x285ccf)[_0x49cf('0x19')](_0x3b3ac4);}return null;};}function saveUpdates(_0x19ddab){return function(_0x3868a1){if(_0x3868a1){return _0x3868a1[_0x49cf('0x1a')](_0x19ddab)[_0x49cf('0x1b')](function(_0x14fb8a){return _0x14fb8a;});}return null;};}function removeEntity(_0x33cebf){return function(_0x5a28aa){if(_0x5a28aa){return _0x5a28aa[_0x49cf('0x1c')]()[_0x49cf('0x1b')](function(){_0x33cebf[_0x49cf('0x12')](0xcc)[_0x49cf('0x11')]();});}};}function handleEntityNotFound(_0x2bf6fd){return function(_0x2fd177){if(!_0x2fd177){_0x2bf6fd[_0x49cf('0x10')](0x194);}return _0x2fd177;};}function handleError(_0x451ca4,_0xbed6c2){_0xbed6c2=_0xbed6c2||0x1f4;return function(_0x45d329){logger[_0x49cf('0x1d')](_0x45d329[_0x49cf('0x1e')]);if(_0x45d329[_0x49cf('0x1f')]){delete _0x45d329[_0x49cf('0x1f')];}_0x451ca4[_0x49cf('0x12')](_0xbed6c2)[_0x49cf('0x20')](_0x45d329);};}function getInteractionUsers(_0x40f5fb,_0xefec9b){return new BPromise(function(_0x53cb3c,_0x3f4e73){try{if(_0xefec9b[_0x40f5fb['id']]){_0x40f5fb[_0x49cf('0x21')]=_[_0x49cf('0x22')](_0xefec9b[_0x40f5fb['id']],function(_0x58749c){return{'id':_0x58749c['id'],'fullname':_0x58749c[_0x49cf('0x23')]};});}}catch(_0x5360bc){_0x3f4e73(_0x5360bc);}_0x53cb3c(_0x40f5fb);});}function getInteractionTags(_0x246406,_0x232572){return new BPromise(function(_0x7942be,_0x3305f1){try{if(_0x246406['TagIds']){_0x246406['Tags']=[];_0x246406[_0x49cf('0x24')][_0x49cf('0x25')](',')[_0x49cf('0x26')](function(_0x2cf9c6){_0x246406[_0x49cf('0x27')][_0x49cf('0x28')](_0x232572[_0x2cf9c6]);});}delete _0x246406['TagIds'];}catch(_0x315907){_0x3305f1(_0x315907);}_0x7942be(_0x246406);});}function getLastMessageText(_0x44c76b){return new BPromise(function(_0x72ee72,_0x5b3a38){return db[_0x49cf('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x44c76b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x49cf('0x2a')],'order':_0x49cf('0x2b'),'raw':!![]})['then'](function(_0x2f54fb){if(_0x2f54fb&&_0x2f54fb[_0x49cf('0x2a')]){_0x44c76b['lastMsgText']=_['trimStart'](_0x2f54fb[_0x49cf('0x2a')]);}_0x72ee72(_0x44c76b);})[_0x49cf('0x2c')](function(_0x5e537d){_0x5b3a38(_0x5e537d);});});}function updateMailInteraction(_0x5932d9,_0x26f589,_0x618edf,_0xfe1cbb){return new BPromise(function(_0x39d7ce,_0x5a5387){return getInteractionUsers(_0x5932d9,_0x618edf)[_0x49cf('0x1b')](function(_0x39b577){return getInteractionTags(_0x39b577,_0x26f589);})[_0x49cf('0x1b')](function(_0x1103b8){return getStateInteraction(_0x1103b8);})[_0x49cf('0x1b')](function(_0x2690b7){if(_0xfe1cbb){_0x39d7ce(getLastMessageText(_0x2690b7));}else{_0x39d7ce(_0x2690b7);}})[_0x49cf('0x2c')](function(_0xdddedc){_0x5a5387(_0xdddedc);});});}function getStateInteraction(_0x8fe8ac){return new BPromise(function(_0xc8cc5b){_0x8fe8ac[_0x49cf('0x2d')]=0x0;_0x8fe8ac['talking']=0x0;_0x8fe8ac['answered']=0x0;_0x8fe8ac['unmanaged']=0x0;_0x8fe8ac[_0x49cf('0x2e')]=0x0;if(!_0x8fe8ac['closed']&&!_0x8fe8ac[_0x49cf('0x2f')]){_0x8fe8ac[_0x49cf('0x2d')]+=0x1;}if(!_0x8fe8ac[_0x49cf('0x30')]&&_0x8fe8ac[_0x49cf('0x2f')]){_0x8fe8ac[_0x49cf('0x31')]+=0x1;if(_0x8fe8ac[_0x49cf('0x2d')]){_0x8fe8ac[_0x49cf('0x2d')]-=0x1;}}if(_0x8fe8ac[_0x49cf('0x30')]&&_0x8fe8ac['UserId']){_0x8fe8ac[_0x49cf('0x32')]+=0x1;if(_0x8fe8ac[_0x49cf('0x31')]){_0x8fe8ac[_0x49cf('0x31')]-=0x1;}}if(_0x8fe8ac[_0x49cf('0x30')]&&!_0x8fe8ac[_0x49cf('0x2f')]){_0x8fe8ac[_0x49cf('0x33')]+=0x1;if(_0x8fe8ac['waiting']){_0x8fe8ac['waiting']-=0x1;}}_0x8fe8ac[_0x49cf('0x2e')]+=0x1;_0xc8cc5b(_0x8fe8ac);});}exports['index']=function(_0x157700,_0x116ac2){var _0xd388fe={},_0x1b99c0={},_0x43329a={'count':0x0,'rows':[]};var _0x15894c=_[_0x49cf('0x22')](db[_0x49cf('0x34')][_0x49cf('0x35')],function(_0xa86335){return{'name':_0xa86335[_0x49cf('0x36')],'type':_0xa86335[_0x49cf('0x37')][_0x49cf('0x38')]};});_0x1b99c0['model']=_['map'](_0x15894c,_0x49cf('0x1f'));_0x1b99c0['query']=_[_0x49cf('0x39')](_0x157700[_0x49cf('0x3a')]);_0x1b99c0[_0x49cf('0x3b')]=_[_0x49cf('0x3c')](_0x1b99c0[_0x49cf('0x3d')],_0x1b99c0[_0x49cf('0x3a')]);_0xd388fe[_0x49cf('0x3e')]=_[_0x49cf('0x3c')](_0x1b99c0[_0x49cf('0x3d')],qs['fields'](_0x157700[_0x49cf('0x3a')][_0x49cf('0x3f')]));_0xd388fe[_0x49cf('0x3e')]=_0xd388fe[_0x49cf('0x3e')][_0x49cf('0x40')]?_0xd388fe['attributes']:_0x1b99c0[_0x49cf('0x3d')];if(!_0x157700['query']['hasOwnProperty'](_0x49cf('0x41'))){_0xd388fe[_0x49cf('0x15')]=qs[_0x49cf('0x15')](_0x157700[_0x49cf('0x3a')][_0x49cf('0x15')]);_0xd388fe[_0x49cf('0x13')]=qs[_0x49cf('0x13')](_0x157700[_0x49cf('0x3a')]['offset']);}_0xd388fe['order']=qs['sort'](_0x157700[_0x49cf('0x3a')][_0x49cf('0x42')]);_0xd388fe['where']=qs[_0x49cf('0x3b')](_[_0x49cf('0x43')](_0x157700['query'],_0x1b99c0['filters']),_0x15894c);var _0x37cb39=[];var _0xa1f626=squel[_0x49cf('0x44')]()[_0x49cf('0x45')]('id')['field'](_0x49cf('0x1f'))[_0x49cf('0x45')]('color')[_0x49cf('0x46')](_0x49cf('0x47'));var _0x5cc881=squel[_0x49cf('0x44')]()[_0x49cf('0x45')]('u.id')['field'](_0x49cf('0x48'))[_0x49cf('0x45')](_0x49cf('0x49'))[_0x49cf('0x46')]('user_has_mail_interactions','ui')[_0x49cf('0x4a')](_0x49cf('0x4b'),'u',_0x49cf('0x4c'));var _0x343fb1=squel[_0x49cf('0x44')]()[_0x49cf('0x46')]('mail_interactions','i')[_0x49cf('0x4a')](_0x49cf('0x4d'),'c',_0x49cf('0x4e'))[_0x49cf('0x4a')](_0x49cf('0x4b'),'o',_0x49cf('0x4f'))['left_join'](_0x49cf('0x50'),'a','a.id\x20=\x20i.MailAccountId')[_0x49cf('0x4a')](_0x49cf('0x51'),'me',_0x49cf('0x52'))[_0x49cf('0x4a')](_0x49cf('0x53'),'it',_0x49cf('0x54'))['left_join'](_0x49cf('0x47'),'t',_0x49cf('0x55'));var _0x2befdf=squel[_0x49cf('0x56')]();var _0x29869c=[];var _0x478d91=squel['expr']();var _0x5f097d;if(_0x157700[_0x49cf('0x3a')]['search']){_0x5f097d=as[_0x49cf('0x57')](_0x157700['query'][_0x49cf('0x58')]);var _0x34445b=_0x5f097d['sqlOperator'];for(var _0x39afb2=0x0;_0x39afb2<_0x5f097d['conditions'][_0x49cf('0x40')];_0x39afb2++){var _0x11394c=_0x5f097d['conditions'][_0x39afb2];var _0x58058d='i';var _0x521aca=_[_0x49cf('0x59')](_0x15894c,[_0x49cf('0x1f'),_0x11394c[_0x49cf('0x45')]]);if(!_0x521aca){switch(_0x11394c['field']){case'unreadMessages':if(_0x11394c[_0x49cf('0x5a')]==0x1){_0x343fb1[_0x49cf('0x5b')]('`'+_0x11394c[_0x49cf('0x45')]+_0x49cf('0x5c'));}else{_0x343fb1[_0x49cf('0x5b')]('`'+_0x11394c[_0x49cf('0x45')]+'`\x20>\x200');}break;case'Contact':if(_0x11394c['operator']===_0x49cf('0x5d')){if(_0x11394c['value'][_0x49cf('0x25')]('\x20')['length']>0x1){_0x2befdf[_0x34445b](_0x49cf('0x5e'),qs['getFullTextValue'](_0x11394c[_0x49cf('0x5a')]),null);}else{var _0x25bf14='%'+_0x11394c[_0x49cf('0x5a')]+'%';_0x2befdf[_0x34445b](_0x49cf('0x5f'),_0x25bf14,_0x25bf14,_0x25bf14);}}else{_0x521aca=_['find'](_0x15894c,[_0x49cf('0x1f'),_0x49cf('0x60')]);_0x11394c[_0x49cf('0x45')]='ContactId';_0x45439c=as['buildExpression'](_0x58058d,_0x521aca[_0x49cf('0x37')],_0x11394c);_0x2befdf[_0x34445b](_0x45439c[_0x49cf('0x61')],_0x45439c[_0x49cf('0x5a')][_0x49cf('0x62')],_0x45439c[_0x49cf('0x5a')][_0x49cf('0x11')]);}break;case _0x49cf('0x63'):var _0x5bb0a8=_0x11394c[_0x49cf('0x5a')]['split'](',')[_0x49cf('0x22')](function(_0x10d4f2){return Number(_0x10d4f2);});_0x5bb0a8[_0x49cf('0x26')](function(_0x1a218d){_0x478d91['or'](_0x49cf('0x64'),'%,'+_0x1a218d+',%');});_0x29869c=_['union'](_0x29869c,_0x5bb0a8);break;case _0x49cf('0x65'):if(_0x11394c['operator']===_0x49cf('0x5d')){_0x2befdf[_0x34445b](_0x49cf('0x66'),'%'+_0x11394c[_0x49cf('0x5a')]+'%',null);}else{_0x521aca=_[_0x49cf('0x59')](_0x15894c,[_0x49cf('0x1f'),_0x49cf('0x2f')]);_0x11394c['field']=_0x49cf('0x2f');_0x45439c=as['buildExpression'](_0x58058d,_0x521aca[_0x49cf('0x37')],_0x11394c);_0x2befdf[_0x34445b](_0x45439c[_0x49cf('0x61')],_0x45439c['value'][_0x49cf('0x62')],_0x45439c['value'][_0x49cf('0x11')]);}break;case _0x49cf('0x2a'):_0x45439c=as[_0x49cf('0x67')]('me',null,_0x11394c);_0x2befdf[_0x34445b](_0x45439c[_0x49cf('0x61')],_0x45439c[_0x49cf('0x5a')]['start'],_0x45439c[_0x49cf('0x5a')][_0x49cf('0x11')]);break;}}else{var _0x45439c=as['buildExpression'](_0x58058d,_0x521aca['type'],_0x11394c);_0x2befdf[_0x34445b](_0x45439c[_0x49cf('0x61')],_0x45439c['value']['start'],_0x45439c[_0x49cf('0x5a')][_0x49cf('0x11')]);}}}else{var _0x406c3f=_(_0x157700[_0x49cf('0x3a')])['keys']()[_0x49cf('0x22')](function(_0x54d90c){return _[_0x49cf('0x68')](_0x15894c,[_0x49cf('0x1f'),_0x54d90c])?_0x54d90c:undefined;})[_0x49cf('0x69')]()[_0x49cf('0x5a')]();if(!_[_0x49cf('0x6a')](_0x406c3f)){_0x406c3f[_0x49cf('0x26')](function(_0x2af2d0){if(_0x2af2d0==='MailAccountId'){_0x343fb1[_0x49cf('0x6b')](_0x49cf('0x6c'),[]['concat'](_0x157700[_0x49cf('0x3a')][_0x2af2d0]));}else if(_0x2af2d0===_0x49cf('0x6d')){var _0x3d4643=JSON[_0x49cf('0x6e')](_0x157700['query'][_0x2af2d0])[_0x49cf('0x6f')];var _0x4b2dec=JSON[_0x49cf('0x6e')](_0x157700['query'][_0x2af2d0])[_0x49cf('0x70')];_0x343fb1['where'](_0x49cf('0x71'),_0x3d4643,_0x4b2dec);}else{if(_0x157700[_0x49cf('0x3a')][_0x2af2d0]===_0x49cf('0x72')){_0x343fb1[_0x49cf('0x6b')]('i.'+_0x2af2d0+'\x20IS\x20NULL');}else{_0x343fb1[_0x49cf('0x6b')]('i.'+_0x2af2d0+_0x49cf('0x73'),_0x157700[_0x49cf('0x3a')][_0x2af2d0]);}}});}if(_0x157700[_0x49cf('0x3a')][_0x49cf('0x74')]){if(_0x157700[_0x49cf('0x3a')][_0x49cf('0x74')]==0x1){_0x343fb1['having'](_0x49cf('0x75'));}else{_0x343fb1[_0x49cf('0x5b')](_0x49cf('0x76'));}}if(_0x157700['query'][_0x49cf('0x77')]){_0x29869c=_['isArray'](_0x157700[_0x49cf('0x3a')][_0x49cf('0x77')])?_0x157700[_0x49cf('0x3a')][_0x49cf('0x77')]:new Array(_0x157700[_0x49cf('0x3a')]['tag']);_0x29869c[_0x49cf('0x26')](function(_0x26ab9b){_0x478d91['or'](_0x49cf('0x64'),'%,'+_0x26ab9b+',%');});}if(_0x157700[_0x49cf('0x3a')][_0x49cf('0x78')]){var _0x207dbe=_0x157700[_0x49cf('0x3a')][_0x49cf('0x78')][_0x49cf('0x79')]('\x5c','\x5c\x5c')[_0x49cf('0x79')](/'/g,'\x27\x27');if(qs[_0x49cf('0x7a')](_0x207dbe)){_0x2befdf['or'](_0x49cf('0x7b'),_0x207dbe+'%');}else if(qs['isEmail'](_0x207dbe)){_0x2befdf['or'](_0x49cf('0x7c'),_0x207dbe+'%');}else{_0x2befdf['or'](_0x49cf('0x7d'),qs[_0x49cf('0x7e')](_0x207dbe))['or'](_0x49cf('0x7f'),qs['getFullTextValue'](_0x207dbe));}}}_0x343fb1[_0x49cf('0x6b')](_0x2befdf);_0x343fb1[_0x49cf('0x80')](_0x49cf('0x81'));var _0x28aab0={'type':db[_0x49cf('0x82')]['QueryTypes']['SELECT'],'raw':!![]};var _0x34c73b=_0x343fb1['clone']();_0x34c73b[_0x49cf('0x45')](_0x49cf('0x81'));_0x34c73b[_0x49cf('0x45')](_0x49cf('0x83'),_0x49cf('0x84'));if(_0xd388fe[_0x49cf('0x85')]){_0xd388fe['order'][_0x49cf('0x26')](function(_0x41508d){var _0x3e893f=_0x41508d[0x0]==='contactName'?_0x41508d[0x0]:'i.'+_0x41508d[0x0];_0x343fb1[_0x49cf('0x85')](_0x3e893f,_0x41508d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x29869c)){_0x343fb1[_0x49cf('0x5b')](_0x478d91);_0x34c73b['where'](_0x49cf('0x86'),_0x29869c);}BPromise[_0x49cf('0x87')]()['then'](function(){if(!_0x5f097d){if(_0x157700[_0x49cf('0x3a')][_0x49cf('0x88')])return;_0x34c73b[_0x49cf('0x6b')](_0x49cf('0x89'));_0x343fb1[_0x49cf('0x6b')](_0x49cf('0x89'));return;}if(_0x157700[_0x49cf('0x8a')][_0x49cf('0x8b')]!==_0x49cf('0x8c'))return;return _0x157700['user'][_0x49cf('0x8d')]({'attributes':['id'],'raw':!![]})[_0x49cf('0x1b')](function(_0x198292){if(_[_0x49cf('0x6a')](_0x198292)){_0x34c73b['where'](_0x49cf('0x8e'));_0x343fb1['where'](_0x49cf('0x8e'));}else{_0x34c73b[_0x49cf('0x6b')]('i.MailAccountId\x20IN\x20?',_[_0x49cf('0x22')](_0x198292,'id'));_0x343fb1['where']('i.MailAccountId\x20IN\x20?',_[_0x49cf('0x22')](_0x198292,'id'));}});})[_0x49cf('0x1b')](function(){if(_0x157700[_0x49cf('0x8a')][_0x49cf('0x8b')]===_0x49cf('0x8c')&&!_0x5f097d&&!_0x157700[_0x49cf('0x3a')]['MailAccountId'])return[];return db[_0x49cf('0x8f')]['query'](_0x34c73b[_0x49cf('0x90')](),_0x28aab0);})[_0x49cf('0x1b')](function(_0x3c9954){_0x43329a[_0x49cf('0x16')]=_0x3c9954['length'];if(_0x43329a[_0x49cf('0x16')]===0x0)return[];return db[_0x49cf('0x8f')]['query'](_0xa1f626[_0x49cf('0x90')](),_0x28aab0)['then'](function(_0xbf3ee4){_0x37cb39=_['keyBy'](_0xbf3ee4,'id');_0x28aab0=_[_0x49cf('0x91')](_0x28aab0,{'model':db[_0x49cf('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x157700['query']['fields']){_0xd388fe[_0x49cf('0x3e')][_0x49cf('0x26')](function(_0x23c20){_0x343fb1[_0x49cf('0x45')]('i.'+_0x23c20);});}else{_0x343fb1[_0x49cf('0x45')](_0x49cf('0x83'),_0x49cf('0x84'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x92'),_0x49cf('0x93'));_0x343fb1[_0x49cf('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x343fb1[_0x49cf('0x45')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x343fb1[_0x49cf('0x45')](_0x49cf('0x81'));_0x343fb1[_0x49cf('0x45')]('i.createdAt');_0x343fb1[_0x49cf('0x45')](_0x49cf('0x94'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x95'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x96'));_0x343fb1['field'](_0x49cf('0x97'));_0x343fb1['field'](_0x49cf('0x98'));_0x343fb1['field']('i.lastMsgDirection');_0x343fb1['field'](_0x49cf('0x99'));_0x343fb1['field']('i.disposition');_0x343fb1[_0x49cf('0x45')](_0x49cf('0x9a'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x9b'));_0x343fb1['field'](_0x49cf('0x9c'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x9d'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0x9e'));_0x343fb1['field'](_0x49cf('0x9f'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0xa0'));_0x343fb1[_0x49cf('0x45')]('c.firstName',_0x49cf('0xa1'));_0x343fb1['field'](_0x49cf('0xa2'),'Contact.lastName');_0x343fb1[_0x49cf('0x45')](_0x49cf('0xa3'),_0x49cf('0xa4'));_0x343fb1[_0x49cf('0x45')]('c.phone',_0x49cf('0xa5'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0xa6'),'Contact.mobile');_0x343fb1[_0x49cf('0x45')](_0x49cf('0xa7'),_0x49cf('0xa8'));_0x343fb1['field']('o.fullname',_0x49cf('0xa9'));_0x343fb1[_0x49cf('0x45')]('o.internal',_0x49cf('0xaa'));_0x343fb1[_0x49cf('0x45')](_0x49cf('0xab'),_0x49cf('0x24'));}if(_0xd388fe[_0x49cf('0x15')])_0x343fb1['limit'](_0xd388fe[_0x49cf('0x15')]);if(_0xd388fe[_0x49cf('0x13')])_0x343fb1[_0x49cf('0x13')](_0xd388fe[_0x49cf('0x13')]);return db[_0x49cf('0x8f')][_0x49cf('0x3a')](_0x343fb1['toString'](),_0x28aab0);})[_0x49cf('0x1b')](function(_0x2a5504){if(_0x2a5504[_0x49cf('0x40')]>0x0)_0x5cc881[_0x49cf('0x6b')](_0x49cf('0xac'),_[_0x49cf('0x22')](_0x2a5504,'id'));return db[_0x49cf('0x8f')][_0x49cf('0x3a')](_0x5cc881[_0x49cf('0x90')](),_0x28aab0)[_0x49cf('0x1b')](function(_0x5d177b){var _0x4744f7=_[_0x49cf('0xad')](_0x5d177b,'MailInteractionId');var _0x495641=[];return db[_0x49cf('0xae')][_0x49cf('0xaf')]({'attributes':[_0x49cf('0xb0')],'raw':!![]})['then'](function(_0x44db7f){var _0x55bf58=_0x44db7f['enableEmailPreview'];_0x2a5504[_0x49cf('0x26')](function(_0x38a09d){_0x495641[_0x49cf('0x28')](updateMailInteraction(_0x38a09d,_0x37cb39,_0x4744f7,_0x55bf58));});return BPromise['all'](_0x495641);});});});})[_0x49cf('0x1b')](function(_0x1aeed5){_0x43329a[_0x49cf('0xb1')]=_0x1aeed5;return _0x43329a;})[_0x49cf('0x1b')](respondWithFilteredResult(_0x116ac2,_0xd388fe))[_0x49cf('0x2c')](handleError(_0x116ac2,null));};exports[_0x49cf('0xb2')]=function(_0x468e10,_0x31f575){var _0xc90dc1={'raw':![],'where':{'id':_0x468e10['params']['id']}},_0x198ded={};_0x198ded[_0x49cf('0x3d')]=_['keys'](db[_0x49cf('0x34')][_0x49cf('0x35')]);_0x198ded[_0x49cf('0x3a')]=_[_0x49cf('0x39')](_0x468e10[_0x49cf('0x3a')]);_0x198ded[_0x49cf('0x3b')]=_[_0x49cf('0x3c')](_0x198ded[_0x49cf('0x3d')],_0x198ded['query']);_0xc90dc1['attributes']=_[_0x49cf('0x3c')](_0x198ded['model'],qs['fields'](_0x468e10[_0x49cf('0x3a')]['fields']));_0xc90dc1[_0x49cf('0x3e')]=_0xc90dc1[_0x49cf('0x3e')][_0x49cf('0x40')]?_0xc90dc1[_0x49cf('0x3e')]:_0x198ded[_0x49cf('0x3d')];if(_0x468e10[_0x49cf('0x3a')][_0x49cf('0xb3')]){_0xc90dc1[_0x49cf('0xb4')]=[{'all':!![]}];}_0xc90dc1=_[_0x49cf('0x91')]({},_0xc90dc1,_0x468e10[_0x49cf('0xb5')]);return db['MailInteraction']['find'](_0xc90dc1)[_0x49cf('0x1b')](handleEntityNotFound(_0x31f575,null))[_0x49cf('0x1b')](respondWithResult(_0x31f575,null))[_0x49cf('0x2c')](handleError(_0x31f575,null));};exports[_0x49cf('0xb6')]=function(_0x1320ec,_0x159477){return db[_0x49cf('0x34')][_0x49cf('0xb6')](_0x1320ec[_0x49cf('0xb7')],{})['then'](respondWithResult(_0x159477,0xc9))[_0x49cf('0x2c')](handleError(_0x159477,null));};exports[_0x49cf('0x1a')]=function(_0x2a5808,_0x5a9bf0){if(_0x2a5808[_0x49cf('0xb7')]['id']){delete _0x2a5808[_0x49cf('0xb7')]['id'];}return db[_0x49cf('0x34')][_0x49cf('0x59')]({'where':{'id':_0x2a5808[_0x49cf('0xb8')]['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x5a9bf0,null))[_0x49cf('0x1b')](saveUpdates(_0x2a5808[_0x49cf('0xb7')],null))[_0x49cf('0x1b')](respondWithResult(_0x5a9bf0,null))[_0x49cf('0x2c')](handleError(_0x5a9bf0,null));};exports[_0x49cf('0x1c')]=function(_0x13978e,_0x3d341f){return db[_0x49cf('0x34')]['find']({'where':{'id':_0x13978e[_0x49cf('0xb8')]['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x3d341f,null))[_0x49cf('0x1b')](removeEntity(_0x3d341f,null))[_0x49cf('0x2c')](handleError(_0x3d341f,null));};exports['describe']=function(_0x22cf85,_0x169e06){return db[_0x49cf('0x34')][_0x49cf('0xb9')]()[_0x49cf('0x1b')](respondWithResult(_0x169e06,null))['catch'](handleError(_0x169e06,null));};exports[_0x49cf('0xba')]=function(_0x1fcc7a,_0x55a888){return db[_0x49cf('0x29')][_0x49cf('0x59')]({'where':{'id':_0x1fcc7a[_0x49cf('0xb8')]['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x55a888,null))[_0x49cf('0x1b')](function(_0x54dbff){if(_0x54dbff){return _0x54dbff[_0x49cf('0xba')](_0x1fcc7a[_0x49cf('0xb7')][_0x49cf('0xbb')],_[_0x49cf('0xbc')](_0x1fcc7a['body'],[_0x49cf('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x55a888,null))[_0x49cf('0x2c')](handleError(_0x55a888,null));};exports[_0x49cf('0xbd')]=function(_0x57b671,_0x133d2f){var _0x4992f8={'raw':![],'where':{}};var _0x34ac41={};var _0x622868={'count':0x0,'rows':[]};return db['MailInteraction'][_0x49cf('0xaf')]({'where':{'id':_0x57b671['params']['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x133d2f,null))[_0x49cf('0x1b')](function(_0x4243f){if(_0x4243f){_0x34ac41['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x34ac41[_0x49cf('0x3a')]=_['keys'](_0x57b671[_0x49cf('0x3a')]);_0x34ac41[_0x49cf('0x3b')]=_[_0x49cf('0x3c')](_0x34ac41[_0x49cf('0x3d')],_0x34ac41[_0x49cf('0x3a')]);_0x4992f8['attributes']=_[_0x49cf('0x3c')](_0x34ac41[_0x49cf('0x3d')],qs[_0x49cf('0x3f')](_0x57b671[_0x49cf('0x3a')]['fields']));_0x4992f8[_0x49cf('0x3e')]=_0x4992f8['attributes'][_0x49cf('0x40')]?_0x4992f8[_0x49cf('0x3e')]:_0x34ac41[_0x49cf('0x3d')];if(!_0x57b671[_0x49cf('0x3a')][_0x49cf('0xbe')](_0x49cf('0x41'))){_0x4992f8[_0x49cf('0x15')]=qs['limit'](_0x57b671[_0x49cf('0x3a')][_0x49cf('0x15')]);_0x4992f8[_0x49cf('0x13')]=qs[_0x49cf('0x13')](_0x57b671[_0x49cf('0x3a')]['offset']);}_0x4992f8['order']=qs['sort'](_0x57b671[_0x49cf('0x3a')][_0x49cf('0x42')]);_0x4992f8[_0x49cf('0x6b')]=qs[_0x49cf('0x3b')](_[_0x49cf('0x43')](_0x57b671[_0x49cf('0x3a')],_0x34ac41[_0x49cf('0x3b')]));_0x4992f8[_0x49cf('0x6b')][_0x49cf('0xbf')]=_0x4243f['id'];if(_0x57b671['query'][_0x49cf('0x78')]){_0x4992f8[_0x49cf('0x6b')]=_['merge'](_0x4992f8['where'],{'$or':_[_0x49cf('0x22')](_0x4992f8['attributes'],function(_0x5be229){var _0x39f83d={};_0x39f83d[_0x5be229]={'$like':'%'+_0x57b671['query'][_0x49cf('0x78')]+'%'};return _0x39f83d;})});}if(_0x57b671[_0x49cf('0x3a')][_0x49cf('0x6f')]){var _0x3eafce=_0x57b671[_0x49cf('0x3a')][_0x49cf('0x6f')][_0x49cf('0x25')](',');var _0x50aed2={};_0x50aed2[_0x3eafce[0x0]]={'$gte':moment(_0x3eafce[0x1])[_0x49cf('0xc0')](_0x49cf('0xc1'))};_0x4992f8[_0x49cf('0x6b')]=_['merge'](_0x4992f8[_0x49cf('0x6b')],_0x50aed2);}_0x4992f8=_[_0x49cf('0x91')]({},_0x4992f8,_0x57b671['options']);return db[_0x49cf('0x29')]['count']({'where':_0x4992f8[_0x49cf('0x6b')]})[_0x49cf('0x1b')](function(_0x19f677){_0x622868[_0x49cf('0x16')]=_0x19f677;if(_0x57b671[_0x49cf('0x3a')][_0x49cf('0xb3')]){_0x4992f8[_0x49cf('0xb4')]=[{'all':!![]}];}return db[_0x49cf('0x29')][_0x49cf('0xc2')](_0x4992f8);})[_0x49cf('0x1b')](function(_0x1bf51d){if(_0x57b671[_0x49cf('0x3a')][_0x49cf('0xc3')]==='true'){for(var _0x1f677e=0x0;_0x1f677e<_0x1bf51d[_0x49cf('0x40')];_0x1f677e++){_0x1bf51d[_0x1f677e][_0x49cf('0xb7')]=juice(_0x1bf51d[_0x1f677e][_0x49cf('0xb7')]);}}_0x622868['rows']=_0x1bf51d;return _0x622868;});}})[_0x49cf('0x1b')](respondWithFilteredResult(_0x133d2f,_0x4992f8))[_0x49cf('0x2c')](handleError(_0x133d2f,null));};exports['addTags']=function(_0x2dd860,_0x22bbd2){return db[_0x49cf('0x34')]['find']({'where':{'id':_0x2dd860[_0x49cf('0xb8')]['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x22bbd2,null))[_0x49cf('0x1b')](function(_0x5d369d){if(_0x5d369d){return _0x5d369d[_0x49cf('0xc4')](_0x2dd860[_0x49cf('0xb7')][_0x49cf('0xbb')],_[_0x49cf('0xbc')](_0x2dd860['body'],[_0x49cf('0xbb'),'id'])||{})['spread'](function(){return db['Tag'][_0x49cf('0xc2')]({'attributes':['id',_0x49cf('0x1f'),_0x49cf('0xc5')],'where':{'id':_0x2dd860['body'][_0x49cf('0xbb')]}});})[_0x49cf('0x1b')](function(_0xfc4b8){socket[_0x49cf('0xc6')]('mailInteractionTags:save',{'id':Number(_0x2dd860[_0x49cf('0xb8')]['id']),'tags':_0xfc4b8||[]});return{'id':Number(_0x2dd860[_0x49cf('0xb8')]['id']),'tags':_0xfc4b8||[]};});}})[_0x49cf('0x1b')](respondWithResult(_0x22bbd2,null))[_0x49cf('0x2c')](handleError(_0x22bbd2,null));};exports[_0x49cf('0xc7')]=function(_0x4324e7,_0x2d4ad8){return db[_0x49cf('0x34')][_0x49cf('0x59')]({'where':{'id':_0x4324e7['params']['id']}})[_0x49cf('0x1b')](handleEntityNotFound(_0x2d4ad8,null))[_0x49cf('0x1b')](function(_0xf52ca1){if(_0xf52ca1){return _0xf52ca1[_0x49cf('0xc7')](_0x4324e7['query'][_0x49cf('0xbb')]);}})['then'](respondWithStatusCode(_0x2d4ad8,null))['catch'](handleError(_0x2d4ad8,null));};exports[_0x49cf('0xc8')]=function(_0x2117ad,_0x22c4f3){var _0x50d9c1=moment()[_0x49cf('0xc9')]()[_0x49cf('0x90')]();var _0x34da0f=path['join'](config['root'],_0x49cf('0xca'),_0x49cf('0xcb'),_0x49cf('0xcc'));var _0x309c77=path[_0x49cf('0xcd')](config[_0x49cf('0xce')],'server',_0x49cf('0xcb'),_0x49cf('0xcf'));var _0x3c13bc=path[_0x49cf('0xcd')](_0x34da0f,_0x50d9c1);var _0x4fc2f1=util[_0x49cf('0xc0')](_0x49cf('0xd0'),_0x2117ad[_0x49cf('0xb8')]['id'],_0x50d9c1);var _0x17ff8f=path[_0x49cf('0xcd')](_0x34da0f,_0x4fc2f1);var _0x19c156=[];if(_0x2117ad[_0x49cf('0x3a')][_0x49cf('0xcf')]){_0x19c156['push']({'model':db[_0x49cf('0xd1')],'as':_0x49cf('0xd2'),'raw':!![]});}var _0x3f8488=[{'model':db[_0x49cf('0x29')],'as':_0x49cf('0xd3'),'attributes':['id',_0x49cf('0xb7'),_0x49cf('0x46'),'to','cc',_0x49cf('0xd4'),'subject',_0x49cf('0x6d')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x19c156}];return db[_0x49cf('0x34')][_0x49cf('0x59')]({'where':{'id':_0x2117ad[_0x49cf('0xb8')]['id']},'include':_0x3f8488})[_0x49cf('0x1b')](handleEntityNotFound(_0x22c4f3,null))[_0x49cf('0x1b')](function(_0x92db5e){if(_0x92db5e&&_0x92db5e[_0x49cf('0xd3')]){var _0x5d93d7=_0x92db5e[_0x49cf('0xd5')]({'plain':!![]});fs[_0x49cf('0xd6')](_0x3c13bc);return BPromise['each'](_0x5d93d7[_0x49cf('0xd3')],function(_0x1eac0e,_0x5a88c7){var _0x543e01={'from':_0x1eac0e[_0x49cf('0x46')],'to':_0x1eac0e['to'],'subject':_0x1eac0e[_0x49cf('0xd7')],'html':htmlEntities['decode'](_0x1eac0e[_0x49cf('0xb7')]),'headers':{'Date':moment(_0x1eac0e[_0x49cf('0x6d')])[_0x49cf('0xc0')](_0x49cf('0xd8'))},'attachments':[]};if(_0x1eac0e['cc']){_0x543e01[_0x49cf('0xd9')]['Cc']=_0x1eac0e['cc'];}if(_0x1eac0e['bcc']){_0x543e01[_0x49cf('0xd9')]['Bcc']=_0x1eac0e['bcc'];}return new BPromise(function(_0x27bb13,_0x2c9d04){if(_0x1eac0e[_0x49cf('0xd2')]){for(var _0x9be267=0x0;_0x9be267<_0x1eac0e[_0x49cf('0xd2')][_0x49cf('0x40')];_0x9be267++){var _0x1a1466=_0x1eac0e[_0x49cf('0xd2')][_0x9be267];var _0x35014d=path[_0x49cf('0xcd')](_0x309c77,_0x1a1466[_0x49cf('0xda')]);if(fs[_0x49cf('0xdb')](_0x35014d)){_0x543e01[_0x49cf('0xcf')][_0x49cf('0x28')]({'name':_0x1a1466[_0x49cf('0x1f')],'contentType':_0x1a1466[_0x49cf('0x37')],'data':fs['readFileSync'](_0x35014d)});}}}emlformat[_0x49cf('0xdc')](_0x543e01,function(_0x289774,_0x15a248){if(_0x289774)return _0x2c9d04(_0x289774);fs[_0x49cf('0xdd')](path[_0x49cf('0xcd')](_0x3c13bc,util[_0x49cf('0xc0')]('message%d.eml',_0x5a88c7)),_0x15a248);return _0x27bb13(_0x15a248);});});})[_0x49cf('0x1b')](function(){return new BPromise(function(_0x30435d,_0x596874){zipdir(_0x3c13bc,{'saveTo':_0x17ff8f},function(_0x1e2743,_0x4de0f7){if(_0x1e2743)return _0x596874(_0x1e2743);return _0x30435d(_0x4de0f7);});})[_0x49cf('0x1b')](function(){return new BPromise(function(_0x3c9b07,_0x9e4c38){rimraf(_0x3c13bc,function(_0x595b29){if(_0x595b29)_0x9e4c38(_0x595b29);return _0x3c9b07();});});})[_0x49cf('0x1b')](function(){return _0x22c4f3[_0x49cf('0xc8')](_0x17ff8f,_0x4fc2f1,function(_0x160e4f){if(!_0x160e4f)fs[_0x49cf('0xde')](_0x17ff8f);});});});}else{return _0x22c4f3[_0x49cf('0x10')](0xc8);}})[_0x49cf('0x2c')](handleError(_0x22c4f3,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8c9ec9b..9cd3bae 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 _0x9324=['setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage'];(function(_0x1fa8c2,_0x2b8012){var _0x4b0e05=function(_0xc3fe2b){while(--_0xc3fe2b){_0x1fa8c2['push'](_0x1fa8c2['shift']());}};_0x4b0e05(++_0x2b8012);}(_0x9324,0x1ea));var _0x4932=function(_0x5adc45,_0x7bba0c){_0x5adc45=_0x5adc45-0x0;var _0x243705=_0x9324[_0x5adc45];return _0x243705;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x4932('0x0'))['db'][_0x4932('0x1')];var MailMessage=require(_0x4932('0x0'))['db'][_0x4932('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4932('0x3')](0x0);var events={'afterCreate':_0x4932('0x4'),'afterUpdate':_0x4932('0x5'),'afterDestroy':_0x4932('0x6')};function emitEvent(_0x1746ae){return function(_0x106574,_0x457111,_0x2c193f){_0x106574[_0x4932('0x7')]({'attributes':['id'],'raw':!![]})[_0x4932('0x8')](function(_0x521e4a){_0x106574['setDataValue']('Users',_0x521e4a[_0x4932('0x9')](function(_0x10bc17){return{'id':_0x10bc17['id']};}));return MailMessage[_0x4932('0xa')]({'where':{'MailInteractionId':_0x106574['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4932('0x8')](function(_0x3811cb){_0x106574[_0x4932('0xb')](_0x4932('0xc'),_0x3811cb[_0x4932('0xd')]);MailInteractionEvents[_0x4932('0xe')](_0x1746ae+':'+_0x106574['id'],_0x106574);MailInteractionEvents['emit'](_0x1746ae,_0x106574);_0x2c193f(null);})['catch'](_0x2c193f(null));};}for(var e in events){if(events[_0x4932('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x4932('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x248c=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update'];(function(_0x3cc477,_0x4f827b){var _0x8091e1=function(_0x29c2ab){while(--_0x29c2ab){_0x3cc477['push'](_0x3cc477['shift']());}};_0x8091e1(++_0x4f827b);}(_0x248c,0x1ea));var _0xc248=function(_0xb9d87a,_0x1e02e0){_0xb9d87a=_0xb9d87a-0x0;var _0x66e277=_0x248c[_0xb9d87a];return _0x66e277;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xc248('0x0'))['db'][_0xc248('0x1')];var MailMessage=require(_0xc248('0x0'))['db'][_0xc248('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc248('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc248('0x4'),'afterDestroy':_0xc248('0x5')};function emitEvent(_0x316bce){return function(_0x788fd5,_0x276fe2,_0x3e0e6d){_0x788fd5[_0xc248('0x6')]({'attributes':['id'],'raw':!![]})[_0xc248('0x7')](function(_0x20e2f0){_0x788fd5[_0xc248('0x8')](_0xc248('0x9'),_0x20e2f0[_0xc248('0xa')](function(_0x5ff49a){return{'id':_0x5ff49a['id']};}));return MailMessage[_0xc248('0xb')]({'where':{'MailInteractionId':_0x788fd5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5f13a7){_0x788fd5[_0xc248('0x8')](_0xc248('0xc'),_0x5f13a7['length']);MailInteractionEvents[_0xc248('0xd')](_0x316bce+':'+_0x788fd5['id'],_0x788fd5);MailInteractionEvents[_0xc248('0xd')](_0x316bce,_0x788fd5);_0x3e0e6d(null);})['catch'](_0x3e0e6d(null));};}for(var e in events){if(events[_0xc248('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 214038e..b774fe6 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 _0x4324=['update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','MailMessage'];(function(_0x5bffed,_0x2b9fb7){var _0x5c4697=function(_0x17bf2d){while(--_0x17bf2d){_0x5bffed['push'](_0x5bffed['shift']());}};_0x5c4697(++_0x2b9fb7);}(_0x4324,0xb3));var _0x4432=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x4324[_0xaf29da];return _0x295c51;};'use strict';var _=require(_0x4432('0x0'));var util=require(_0x4432('0x1'));var logger=require(_0x4432('0x2'))('api');var moment=require(_0x4432('0x3'));var BPromise=require(_0x4432('0x4'));var rp=require(_0x4432('0x5'));var fs=require('fs');var path=require(_0x4432('0x6'));var rimraf=require('rimraf');var config=require(_0x4432('0x7'));var attributes=require(_0x4432('0x8'));module[_0x4432('0x9')]=function(_0x4ccde6,_0x3e8762){return _0x4ccde6[_0x4432('0xa')](_0x4432('0xb'),attributes,{'tableName':_0x4432('0xc'),'paranoid':![],'indexes':[{'name':_0x4432('0xd'),'fields':[_0x4432('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52c390,_0x245eb1,_0x37c5dc){if(_0x52c390[_0x4432('0xf')]){_0x52c390[_0x4432('0x10')]=moment()[_0x4432('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x52c390[_0x4432('0x12')]){_0x52c390[_0x4432('0x13')]=moment()['format'](_0x4432('0x14'));}_0x37c5dc(null,_0x245eb1);},'beforeUpdate':function(_0x2be441,_0x377ec3,_0x4fda34){if(_0x2be441[_0x4432('0x15')](_0x4432('0xf'))){_0x2be441[_0x4432('0x10')]=_0x2be441['substatus']?moment()[_0x4432('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2be441['changed']('closed')){_0x2be441[_0x4432('0x13')]=moment()[_0x4432('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x2be441[_0x4432('0xf')]=null;_0x2be441['substatusAt']=null;}_0x4fda34(null,_0x2be441);},'afterUpdate':function(_0x5b7d59,_0x37d1e1,_0x3fa698){var _0x5b9e9a=_0x4ccde6[_0x4432('0x16')];var _0x2eb70e=_0x5b7d59['get']({'plain':!![]});if(_0x2eb70e[_0x4432('0x12')]){return _0x5b9e9a[_0x4432('0x17')][_0x4432('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x2eb70e['id']}})[_0x4432('0x19')](function(){_0x3fa698();})[_0x4432('0x1a')](function(_0x3a3bc2){_0x3fa698(_0x3a3bc2);});}else{_0x3fa698();}}},'charset':_0x4432('0x1b'),'collate':_0x4432('0x1c')});}; \ No newline at end of file +var _0x9bba=['substatus','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed'];(function(_0x147a21,_0xe64bda){var _0x25ef0e=function(_0x38216d){while(--_0x38216d){_0x147a21['push'](_0x147a21['shift']());}};_0x25ef0e(++_0xe64bda);}(_0x9bba,0xa4));var _0xa9bb=function(_0x3ec9c6,_0x5e6cb3){_0x3ec9c6=_0x3ec9c6-0x0;var _0xc13e2c=_0x9bba[_0x3ec9c6];return _0xc13e2c;};'use strict';var _=require(_0xa9bb('0x0'));var util=require(_0xa9bb('0x1'));var logger=require(_0xa9bb('0x2'))(_0xa9bb('0x3'));var moment=require(_0xa9bb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa9bb('0x5'));var config=require(_0xa9bb('0x6'));var attributes=require('./mailInteraction.attributes');module[_0xa9bb('0x7')]=function(_0x27d056,_0x4a214b){return _0x27d056['define']('MailInteraction',attributes,{'tableName':_0xa9bb('0x8'),'paranoid':![],'indexes':[{'name':_0xa9bb('0x9'),'fields':[_0xa9bb('0xa'),'to'],'type':_0xa9bb('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ee408,_0x59ec87,_0x3c1255){if(_0x5ee408['substatus']){_0x5ee408[_0xa9bb('0xc')]=moment()[_0xa9bb('0xd')](_0xa9bb('0xe'));}if(_0x5ee408[_0xa9bb('0xf')]){_0x5ee408[_0xa9bb('0x10')]=moment()[_0xa9bb('0xd')](_0xa9bb('0xe'));}_0x3c1255(null,_0x59ec87);},'beforeUpdate':function(_0x270d38,_0x5b8e8b,_0x47af79){if(_0x270d38[_0xa9bb('0x11')](_0xa9bb('0x12'))){_0x270d38[_0xa9bb('0xc')]=_0x270d38[_0xa9bb('0x12')]?moment()[_0xa9bb('0xd')](_0xa9bb('0xe')):null;}if(_0x270d38[_0xa9bb('0x11')]('closed')){_0x270d38[_0xa9bb('0x10')]=moment()['format'](_0xa9bb('0xe'));_0x270d38[_0xa9bb('0x12')]=null;_0x270d38[_0xa9bb('0xc')]=null;}_0x47af79(null,_0x270d38);},'afterUpdate':function(_0x50b1b4,_0x30aee7,_0x4c7b69){var _0x3e5fed=_0x27d056[_0xa9bb('0x13')];var _0x212633=_0x50b1b4['get']({'plain':!![]});if(_0x212633[_0xa9bb('0xf')]){return _0x3e5fed[_0xa9bb('0x14')][_0xa9bb('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x212633['id']}})[_0xa9bb('0x16')](function(){_0x4c7b69();})[_0xa9bb('0x17')](function(_0x3fde05){_0x4c7b69(_0x3fde05);});}else{_0x4c7b69();}}},'charset':_0xa9bb('0x18'),'collate':_0xa9bb('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 48b6993..1a135b8 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 _0xb14b=['../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','debug','AddTagsToMailInteraction','find','then','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xb14b,0xff));var _0xbb14=function(_0x553fe2,_0x354765){_0x553fe2=_0x553fe2-0x0;var _0x10f2c6=_0xb14b[_0x553fe2];return _0x10f2c6;};'use strict';var _=require(_0xbb14('0x0'));var util=require(_0xbb14('0x1'));var moment=require(_0xbb14('0x2'));var BPromise=require(_0xbb14('0x3'));var rs=require(_0xbb14('0x4'));var fs=require('fs');var Redis=require(_0xbb14('0x5'));var db=require(_0xbb14('0x6'))['db'];var utils=require(_0xbb14('0x7'));var logger=require('../../config/logger')(_0xbb14('0x8'));var config=require(_0xbb14('0x9'));var jayson=require(_0xbb14('0xa'));var client=jayson['client'][_0xbb14('0xb')]({'port':0x232a});config[_0xbb14('0xc')]=_[_0xbb14('0xd')](config[_0xbb14('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb14('0xe'))(new Redis(config[_0xbb14('0xc')]));require(_0xbb14('0xf'))[_0xbb14('0x10')](socket);function respondWithRpcPromise(_0x5582e9,_0x21b1d2,_0x5ad2b4){return new BPromise(function(_0x4ebce1,_0x13d22c){return client[_0xbb14('0x11')](_0x5582e9,_0x5ad2b4)['then'](function(_0x25b2c4){logger[_0xbb14('0x12')]('MailInteraction,\x20%s,\x20%s',_0x21b1d2,_0xbb14('0x13'));logger['debug'](_0xbb14('0x14'),_0x21b1d2,_0xbb14('0x13'),JSON['stringify'](_0x25b2c4));if(_0x25b2c4[_0xbb14('0x15')]){if(_0x25b2c4[_0xbb14('0x15')][_0xbb14('0x16')]===0x1f4){logger['error'](_0xbb14('0x17'),_0x21b1d2,_0x25b2c4['error']['message']);return _0x13d22c(_0x25b2c4[_0xbb14('0x15')][_0xbb14('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x21b1d2,_0x25b2c4[_0xbb14('0x15')]['message']);return _0x4ebce1(_0x25b2c4[_0xbb14('0x15')][_0xbb14('0x18')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x21b1d2,_0xbb14('0x13'));_0x4ebce1(_0x25b2c4[_0xbb14('0x19')][_0xbb14('0x18')]);}})[_0xbb14('0x1a')](function(_0x4a62ff){logger[_0xbb14('0x15')](_0xbb14('0x17'),_0x21b1d2,_0x4a62ff);_0x13d22c(_0x4a62ff);});});}exports[_0xbb14('0x1b')]=function(_0x1c3043){var _0x42d1c7=this;return new Promise(function(_0x3def1d,_0x2885fe){return db[_0xbb14('0x1c')][_0xbb14('0x1d')](_0x1c3043[_0xbb14('0x1e')],{'raw':_0x1c3043['options']?_0x1c3043[_0xbb14('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c3043[_0xbb14('0x1f')]?_0x1c3043[_0xbb14('0x1f')][_0xbb14('0x20')]||null:null,'attributes':_0x1c3043[_0xbb14('0x1f')]?_0x1c3043[_0xbb14('0x1f')][_0xbb14('0x21')]||null:null,'limit':_0x1c3043[_0xbb14('0x1f')]?_0x1c3043[_0xbb14('0x1f')][_0xbb14('0x22')]||null:null})['then'](function(_0x1abac2){logger[_0xbb14('0x12')](_0xbb14('0x1b'),_0x1c3043);logger[_0xbb14('0x23')](_0xbb14('0x1b'),_0x1c3043,JSON['stringify'](_0x1abac2));_0x3def1d(_0x1abac2);})[_0xbb14('0x1a')](function(_0x4b660c){logger[_0xbb14('0x15')](_0xbb14('0x1b'),_0x4b660c['message'],_0x1c3043);_0x2885fe(_0x42d1c7[_0xbb14('0x15')](0x1f4,_0x4b660c[_0xbb14('0x18')]));});});};exports[_0xbb14('0x24')]=function(_0x58e71e){return new Promise(function(_0x2d1352,_0x9838c5){return db[_0xbb14('0x1c')][_0xbb14('0x25')]({'where':_0x58e71e[_0xbb14('0x1f')]?_0x58e71e[_0xbb14('0x1f')]['where']||null:null})[_0xbb14('0x26')](function(_0x1c1dab){if(_0x1c1dab){return _0x1c1dab['addTags'](_0x58e71e[_0xbb14('0x1e')][_0xbb14('0x27')],_[_0xbb14('0x28')](_0x58e71e[_0xbb14('0x1e')],[_0xbb14('0x27'),'id'])||{});}})[_0xbb14('0x29')](function(_0x52b06c){logger[_0xbb14('0x12')](_0xbb14('0x2a'),_0x58e71e);logger[_0xbb14('0x23')](_0xbb14('0x2a'),_0x58e71e,JSON[_0xbb14('0x2b')](_0x52b06c));_0x2d1352(_0x52b06c);})[_0xbb14('0x1a')](function(_0xcbe1c4){logger['error'](_0xbb14('0x2a'),_0xcbe1c4['message'],_0x58e71e);_0x9838c5(_this['error'](0x1f4,_0xcbe1c4[_0xbb14('0x18')]));});});}; \ No newline at end of file +var _0x9d35=['result','UpdateMailInteraction','update','options','raw','where','attributes','limit','then','catch','AddTagsToMailInteraction','MailInteraction','find','addTags','body','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d4afb,_0x59a69){var _0x31c33=function(_0x3316b5){while(--_0x3316b5){_0x5d4afb['push'](_0x5d4afb['shift']());}};_0x31c33(++_0x59a69);}(_0x9d35,0x174));var _0x59d3=function(_0x403db1,_0x59018e){_0x403db1=_0x403db1-0x0;var _0x47c48f=_0x9d35[_0x403db1];return _0x47c48f;};'use strict';var _=require(_0x59d3('0x0'));var util=require(_0x59d3('0x1'));var moment=require(_0x59d3('0x2'));var BPromise=require(_0x59d3('0x3'));var rs=require(_0x59d3('0x4'));var fs=require('fs');var Redis=require(_0x59d3('0x5'));var db=require(_0x59d3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x59d3('0x7'))(_0x59d3('0x8'));var config=require(_0x59d3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x59d3('0xa')]['http']({'port':0x232a});config[_0x59d3('0xb')]=_[_0x59d3('0xc')](config[_0x59d3('0xb')],{'host':_0x59d3('0xd'),'port':0x18eb});var socket=require(_0x59d3('0xe'))(new Redis(config[_0x59d3('0xb')]));require('./mailInteraction.socket')[_0x59d3('0xf')](socket);function respondWithRpcPromise(_0x473a07,_0x1ced67,_0x5d3bed){return new BPromise(function(_0xa51251,_0x544dba){return client['request'](_0x473a07,_0x5d3bed)['then'](function(_0x367ff7){logger[_0x59d3('0x10')](_0x59d3('0x11'),_0x1ced67,_0x59d3('0x12'));logger['debug'](_0x59d3('0x13'),_0x1ced67,'request\x20sent',JSON[_0x59d3('0x14')](_0x367ff7));if(_0x367ff7[_0x59d3('0x15')]){if(_0x367ff7[_0x59d3('0x15')][_0x59d3('0x16')]===0x1f4){logger[_0x59d3('0x15')](_0x59d3('0x11'),_0x1ced67,_0x367ff7[_0x59d3('0x15')][_0x59d3('0x17')]);return _0x544dba(_0x367ff7[_0x59d3('0x15')][_0x59d3('0x17')]);}logger[_0x59d3('0x15')](_0x59d3('0x11'),_0x1ced67,_0x367ff7['error'][_0x59d3('0x17')]);return _0xa51251(_0x367ff7[_0x59d3('0x15')][_0x59d3('0x17')]);}else{logger[_0x59d3('0x10')](_0x59d3('0x11'),_0x1ced67,_0x59d3('0x12'));_0xa51251(_0x367ff7[_0x59d3('0x18')]['message']);}})['catch'](function(_0x39fc89){logger[_0x59d3('0x15')](_0x59d3('0x11'),_0x1ced67,_0x39fc89);_0x544dba(_0x39fc89);});});}exports[_0x59d3('0x19')]=function(_0x3035f1){var _0xd4798e=this;return new Promise(function(_0x3d877b,_0x4cdfec){return db['MailInteraction'][_0x59d3('0x1a')](_0x3035f1['body'],{'raw':_0x3035f1[_0x59d3('0x1b')]?_0x3035f1[_0x59d3('0x1b')][_0x59d3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3035f1[_0x59d3('0x1b')]?_0x3035f1['options'][_0x59d3('0x1d')]||null:null,'attributes':_0x3035f1[_0x59d3('0x1b')]?_0x3035f1[_0x59d3('0x1b')][_0x59d3('0x1e')]||null:null,'limit':_0x3035f1['options']?_0x3035f1[_0x59d3('0x1b')][_0x59d3('0x1f')]||null:null})[_0x59d3('0x20')](function(_0xed7842){logger[_0x59d3('0x10')](_0x59d3('0x19'),_0x3035f1);logger['debug']('UpdateMailInteraction',_0x3035f1,JSON[_0x59d3('0x14')](_0xed7842));_0x3d877b(_0xed7842);})[_0x59d3('0x21')](function(_0x5ab4bf){logger[_0x59d3('0x15')](_0x59d3('0x19'),_0x5ab4bf[_0x59d3('0x17')],_0x3035f1);_0x4cdfec(_0xd4798e[_0x59d3('0x15')](0x1f4,_0x5ab4bf[_0x59d3('0x17')]));});});};exports[_0x59d3('0x22')]=function(_0x3d7e10){return new Promise(function(_0x2dce38,_0x378643){return db[_0x59d3('0x23')][_0x59d3('0x24')]({'where':_0x3d7e10[_0x59d3('0x1b')]?_0x3d7e10[_0x59d3('0x1b')][_0x59d3('0x1d')]||null:null})[_0x59d3('0x20')](function(_0x2aa888){if(_0x2aa888){return _0x2aa888[_0x59d3('0x25')](_0x3d7e10[_0x59d3('0x26')][_0x59d3('0x27')],_[_0x59d3('0x28')](_0x3d7e10[_0x59d3('0x26')],[_0x59d3('0x27'),'id'])||{});}})[_0x59d3('0x29')](function(_0x3f4620){logger[_0x59d3('0x10')](_0x59d3('0x2a'),_0x3d7e10);logger[_0x59d3('0x2b')](_0x59d3('0x2a'),_0x3d7e10,JSON[_0x59d3('0x14')](_0x3f4620));_0x2dce38(_0x3f4620);})[_0x59d3('0x21')](function(_0x573c66){logger[_0x59d3('0x15')]('AddTags',_0x573c66['message'],_0x3d7e10);_0x378643(_this['error'](0x1f4,_0x573c66['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b3a647c..6538cfd 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 _0xd05f=['update','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x5ea19e,_0x4f5d42){var _0x4d8eb1=function(_0x34444){while(--_0x34444){_0x5ea19e['push'](_0x5ea19e['shift']());}};_0x4d8eb1(++_0x4f5d42);}(_0xd05f,0xb3));var _0xfd05=function(_0x40653f,_0x3f8982){_0x40653f=_0x40653f-0x0;var _0x3bcd88=_0xd05f[_0x40653f];return _0x3bcd88;};'use strict';var MailInteractionEvents=require(_0xfd05('0x0'));var events=['save','remove',_0xfd05('0x1')];function createListener(_0x502932,_0x1168aa){return function(_0x43393e){_0x1168aa['emit'](_0x502932,_0x43393e);};}function removeListener(_0x12ad38,_0x225b6f){return function(){MailInteractionEvents['removeListener'](_0x12ad38,_0x225b6f);};}exports[_0xfd05('0x2')]=function(_0x19a73d){for(var _0xd37b6e=0x0,_0x291bff=events[_0xfd05('0x3')];_0xd37b6e<_0x291bff;_0xd37b6e++){var _0xb674d8=events[_0xd37b6e];var _0x8c6ac8=createListener(_0xfd05('0x4')+_0xb674d8,_0x19a73d);MailInteractionEvents['on'](_0xb674d8,_0x8c6ac8);}}; \ No newline at end of file +var _0xd7a7=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x3d335e,_0x3bc666){var _0x52866d=function(_0x26801a){while(--_0x26801a){_0x3d335e['push'](_0x3d335e['shift']());}};_0x52866d(++_0x3bc666);}(_0xd7a7,0x1d6));var _0x7d7a=function(_0x15822d,_0x5a56bb){_0x15822d=_0x15822d-0x0;var _0x3f307d=_0xd7a7[_0x15822d];return _0x3f307d;};'use strict';var MailInteractionEvents=require(_0x7d7a('0x0'));var events=[_0x7d7a('0x1'),'remove',_0x7d7a('0x2')];function createListener(_0x342fd3,_0x5b7bb5){return function(_0x3c04ba){_0x5b7bb5[_0x7d7a('0x3')](_0x342fd3,_0x3c04ba);};}function removeListener(_0x428074,_0x2a7c90){return function(){MailInteractionEvents[_0x7d7a('0x4')](_0x428074,_0x2a7c90);};}exports[_0x7d7a('0x5')]=function(_0xdc2133){for(var _0x2b550f=0x0,_0x247c52=events[_0x7d7a('0x6')];_0x2b550f<_0x247c52;_0x2b550f++){var _0x400bc1=events[_0x2b550f];var _0x533653=createListener(_0x7d7a('0x7')+_0x400bc1,_0xdc2133);MailInteractionEvents['on'](_0x400bc1,_0x533653);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b1c63f6..7e4765d 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 _0x4d08=['/:id','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x12ec65,_0x5bd7c9){var _0x28502f=function(_0x3958de){while(--_0x3958de){_0x12ec65['push'](_0x12ec65['shift']());}};_0x28502f(++_0x5bd7c9);}(_0x4d08,0x1a5));var _0x84d0=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x4d08[_0x57d370];return _0x550fd2;};'use strict';var multer=require(_0x84d0('0x0'));var util=require('util');var path=require(_0x84d0('0x1'));var timeout=require(_0x84d0('0x2'));var express=require(_0x84d0('0x3'));var router=express[_0x84d0('0x4')]();var fs_extra=require(_0x84d0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x84d0('0x6'));var config=require(_0x84d0('0x7'));var controller=require(_0x84d0('0x8'));router[_0x84d0('0x9')]('/',auth[_0x84d0('0xa')](),controller[_0x84d0('0xb')]);router[_0x84d0('0x9')](_0x84d0('0xc'),auth[_0x84d0('0xa')](),controller[_0x84d0('0xd')]);router[_0x84d0('0x9')](_0x84d0('0xe'),auth[_0x84d0('0xa')](),controller['show']);router['get']('/:id/download',auth[_0x84d0('0xa')](),controller[_0x84d0('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x84d0('0x10')](_0x84d0('0x11'),_0x84d0('0x12')),controller[_0x84d0('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x84d0('0x14')]);router[_0x84d0('0x15')](_0x84d0('0x16'),auth[_0x84d0('0xa')](),controller[_0x84d0('0x17')]);router[_0x84d0('0x15')](_0x84d0('0x18'),auth[_0x84d0('0xa')](),controller[_0x84d0('0x19')]);router[_0x84d0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x84d0('0x1b')]);module[_0x84d0('0x1c')]=router; \ No newline at end of file +var _0x5e49=['destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','/describe','isAuthenticated','/:id','show','/:id/download','download','post','mail','create','put','update','/:id/accept','accept','reject'];(function(_0x3f4a71,_0x367d39){var _0xee8f88=function(_0x4b43eb){while(--_0x4b43eb){_0x3f4a71['push'](_0x3f4a71['shift']());}};_0xee8f88(++_0x367d39);}(_0x5e49,0x152));var _0x95e4=function(_0x434339,_0x2abf5e){_0x434339=_0x434339-0x0;var _0x507ca6=_0x5e49[_0x434339];return _0x507ca6;};'use strict';var multer=require(_0x95e4('0x0'));var util=require(_0x95e4('0x1'));var path=require(_0x95e4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95e4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x95e4('0x4'));var interaction=require(_0x95e4('0x5'));var config=require('../../config/environment');var controller=require(_0x95e4('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x95e4('0x7')](_0x95e4('0x8'),auth[_0x95e4('0x9')](),controller['describe']);router['get'](_0x95e4('0xa'),auth[_0x95e4('0x9')](),controller[_0x95e4('0xb')]);router[_0x95e4('0x7')](_0x95e4('0xc'),auth['isAuthenticated'](),controller[_0x95e4('0xd')]);router[_0x95e4('0xe')]('/',auth[_0x95e4('0x9')](),interaction['tracked'](_0x95e4('0xf'),'mailmessage:create'),controller[_0x95e4('0x10')]);router[_0x95e4('0x11')](_0x95e4('0xa'),auth['isAuthenticated'](),controller[_0x95e4('0x12')]);router[_0x95e4('0x11')](_0x95e4('0x13'),auth[_0x95e4('0x9')](),controller[_0x95e4('0x14')]);router[_0x95e4('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0x95e4('0x15')]);router['delete'](_0x95e4('0xa'),auth[_0x95e4('0x9')](),controller[_0x95e4('0x16')]);module[_0x95e4('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c55a313..9a4fca9 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 _0xcfbd=['out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','lodash','exports','long','TEXT','ENUM'];(function(_0x5f13c7,_0x4b0f7b){var _0x348082=function(_0x4e42ac){while(--_0x4e42ac){_0x5f13c7['push'](_0x5f13c7['shift']());}};_0x348082(++_0x4b0f7b);}(_0xcfbd,0x133));var _0xdcfb=function(_0x5c311b,_0x59c334){_0x5c311b=_0x5c311b-0x0;var _0x55460d=_0xcfbd[_0x5c311b];return _0x55460d;};'use strict';var Sequelize=require('sequelize');var _=require(_0xdcfb('0x0'));module[_0xdcfb('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdcfb('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdcfb('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdcfb('0x4')]('in',_0xdcfb('0x5')),'defaultValue':_0xdcfb('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdcfb('0x6')](0x1fe)},'from':{'type':Sequelize[_0xdcfb('0x6')]},'to':{'type':Sequelize['TEXT'](_0xdcfb('0x2'))},'cc':{'type':Sequelize[_0xdcfb('0x3')](_0xdcfb('0x2'))},'bcc':{'type':Sequelize[_0xdcfb('0x3')](_0xdcfb('0x2'))},'subject':{'type':Sequelize[_0xdcfb('0x3')]},'sentAt':{'type':Sequelize[_0xdcfb('0x7')]},'attach':{'type':Sequelize[_0xdcfb('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdcfb('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xdcfb('0x3')](_0xdcfb('0x2'))},'originCc':{'type':Sequelize[_0xdcfb('0x3')](_0xdcfb('0x2'))},'originChannel':{'type':Sequelize[_0xdcfb('0x4')](_0xdcfb('0xa'),_0xdcfb('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xc11a=['out','STRING','long','DATE','Email','Chat','exports','TEXT','ENUM'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc11a,0x165));var _0xac11=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0xc11a[_0x4d0662];return _0x6eea6d;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xac11('0x0')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xac11('0x1')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xac11('0x2')]('in',_0xac11('0x3')),'defaultValue':_0xac11('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xac11('0x4')]},'to':{'type':Sequelize[_0xac11('0x1')](_0xac11('0x5'))},'cc':{'type':Sequelize[_0xac11('0x1')](_0xac11('0x5'))},'bcc':{'type':Sequelize[_0xac11('0x1')]('long')},'subject':{'type':Sequelize[_0xac11('0x1')]},'sentAt':{'type':Sequelize[_0xac11('0x6')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xac11('0x6')]},'originTo':{'type':Sequelize[_0xac11('0x1')](_0xac11('0x5'))},'originCc':{'type':Sequelize['TEXT'](_0xac11('0x5'))},'originChannel':{'type':Sequelize[_0xac11('0x2')](_0xac11('0x7'),_0xac11('0x8')),'defaultValue':_0xac11('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 4138f7c..f59144e 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 _0x1a14=['redis','defaults','localhost','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','json','update','then','stack','name','send','MailMessage','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','destroy','describe','create','direction','out','secret','split','MailAccountId','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','ContactId','email','rejectmessage','download','unix','root','tmp','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','headers','Bcc','existsSync','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','api','mail-interactions'];(function(_0x358240,_0x46091a){var _0x1db203=function(_0x20324f){while(--_0x20324f){_0x358240['push'](_0x358240['shift']());}};_0x1db203(++_0x46091a);}(_0x1a14,0x94));var _0x41a1=function(_0x4db12c,_0x52bf33){_0x4db12c=_0x4db12c-0x0;var _0xe62eb0=_0x1a14[_0x4db12c];return _0xe62eb0;};'use strict';var emlformat=require(_0x41a1('0x0'));var moment=require(_0x41a1('0x1'));var BPromise=require(_0x41a1('0x2'));var util=require(_0x41a1('0x3'));var path=require(_0x41a1('0x4'));var fs=require('fs');var _=require(_0x41a1('0x5'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x41a1('0x6'));var logger=require(_0x41a1('0x7'))(_0x41a1('0x8'));var interaction_log=require(_0x41a1('0x7'))(_0x41a1('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x41a1('0xa')]=_[_0x41a1('0xb')](config[_0x41a1('0xa')],{'host':_0x41a1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41a1('0xa')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x41a1('0xd')](socket);var jayson=require(_0x41a1('0xe'));var client=jayson['client'][_0x41a1('0xf')]({'port':0x232c});var client9003=jayson[_0x41a1('0x10')][_0x41a1('0xf')]({'port':0x232b});var client9002=jayson[_0x41a1('0x10')][_0x41a1('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x55c933,_0x2f0bcd,_0x832198,_0x400599){return new BPromise(function(_0x348570,_0x5f56a6){var _0x13df6f=_0x400599||client;return _0x13df6f[_0x41a1('0x11')](_0x55c933,_0x832198)['then'](function(_0x35dd33){logger[_0x41a1('0x12')](_0x41a1('0x13'),_0x2f0bcd,_0x41a1('0x14'));logger[_0x41a1('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2f0bcd,'request\x20sent',JSON[_0x41a1('0x16')](_0x35dd33));if(_0x35dd33[_0x41a1('0x17')]){if(_0x35dd33[_0x41a1('0x17')][_0x41a1('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x2f0bcd,_0x35dd33['error'][_0x41a1('0x19')]);return _0x5f56a6(_0x35dd33[_0x41a1('0x17')]['message']);}logger[_0x41a1('0x17')](_0x41a1('0x13'),_0x2f0bcd,_0x35dd33[_0x41a1('0x17')][_0x41a1('0x19')]);return _0x348570(_0x35dd33[_0x41a1('0x17')]['message']);}else{logger[_0x41a1('0x12')](_0x41a1('0x13'),_0x2f0bcd,_0x41a1('0x14'));_0x348570(_0x35dd33[_0x41a1('0x1a')][_0x41a1('0x19')]);}})[_0x41a1('0x1b')](function(_0x22c874){logger[_0x41a1('0x17')](_0x41a1('0x13'),_0x2f0bcd,_0x22c874);_0x5f56a6(_0x22c874);});});}function respondWithResult(_0x1c4772,_0x4b048f){_0x4b048f=_0x4b048f||0xc8;return function(_0x551ab7){if(_0x551ab7){return _0x1c4772[_0x41a1('0x1c')](_0x4b048f)['json'](_0x551ab7);}};}function respondWithFilteredResult(_0xa28dc2,_0x2b3306){return function(_0x206137){if(_0x206137){var _0x1f31da=typeof _0x2b3306[_0x41a1('0x1d')]===_0x41a1('0x1e')&&typeof _0x2b3306['limit']===_0x41a1('0x1e');var _0x1c20bf=_0x206137[_0x41a1('0x1f')];var _0x266107=_0x1f31da?0x0:_0x2b3306['offset'];var _0x1cf527=_0x1f31da?_0x206137['count']:_0x2b3306[_0x41a1('0x1d')]+_0x2b3306[_0x41a1('0x20')];var _0x4040ab;if(_0x1cf527>=_0x1c20bf){_0x1cf527=_0x1c20bf;_0x4040ab=0xc8;}else{_0x4040ab=0xce;}_0xa28dc2[_0x41a1('0x1c')](_0x4040ab);return _0xa28dc2['set']('Content-Range',_0x266107+'-'+_0x1cf527+'/'+_0x1c20bf)[_0x41a1('0x21')](_0x206137);}return null;};}function saveUpdates(_0x25952b){return function(_0x1a225b){if(_0x1a225b){return _0x1a225b[_0x41a1('0x22')](_0x25952b)[_0x41a1('0x23')](function(_0x39aa97){return _0x39aa97;});}return null;};}function removeEntity(_0x40d844){return function(_0x5195d6){if(_0x5195d6){return _0x5195d6['destroy']()[_0x41a1('0x23')](function(){_0x40d844[_0x41a1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492c2a){return function(_0xa490d2){if(!_0xa490d2){_0x492c2a['sendStatus'](0x194);}return _0xa490d2;};}function handleError(_0x3c98a8,_0x22b1b7){_0x22b1b7=_0x22b1b7||0x1f4;return function(_0x19eca7){logger[_0x41a1('0x17')](_0x19eca7[_0x41a1('0x24')]);if(_0x19eca7[_0x41a1('0x25')]){delete _0x19eca7['name'];}_0x3c98a8[_0x41a1('0x1c')](_0x22b1b7)[_0x41a1('0x26')](_0x19eca7);};}exports['index']=function(_0x582879,_0x521fab){var _0x110572={},_0x1e90c4={},_0x1d073a={'count':0x0,'rows':[]};var _0x497610=_['map'](db[_0x41a1('0x27')][_0x41a1('0x28')],function(_0x13f53f){return{'name':_0x13f53f['fieldName'],'type':_0x13f53f['type'][_0x41a1('0x29')]};});_0x1e90c4['model']=_['map'](_0x497610,_0x41a1('0x25'));_0x1e90c4[_0x41a1('0x2a')]=_[_0x41a1('0x2b')](_0x582879['query']);_0x1e90c4['filters']=_[_0x41a1('0x2c')](_0x1e90c4[_0x41a1('0x2d')],_0x1e90c4['query']);_0x110572[_0x41a1('0x2e')]=_[_0x41a1('0x2c')](_0x1e90c4[_0x41a1('0x2d')],qs[_0x41a1('0x2f')](_0x582879[_0x41a1('0x2a')]['fields']));_0x110572[_0x41a1('0x2e')]=_0x110572['attributes'][_0x41a1('0x30')]?_0x110572[_0x41a1('0x2e')]:_0x1e90c4[_0x41a1('0x2d')];if(!_0x582879['query'][_0x41a1('0x31')]('nolimit')){_0x110572[_0x41a1('0x20')]=qs[_0x41a1('0x20')](_0x582879['query']['limit']);_0x110572['offset']=qs[_0x41a1('0x1d')](_0x582879[_0x41a1('0x2a')][_0x41a1('0x1d')]);}_0x110572[_0x41a1('0x32')]=qs[_0x41a1('0x33')](_0x582879[_0x41a1('0x2a')][_0x41a1('0x33')]);_0x110572['where']=qs[_0x41a1('0x34')](_[_0x41a1('0x35')](_0x582879[_0x41a1('0x2a')],_0x1e90c4['filters']),_0x497610);if(_0x582879['query'][_0x41a1('0x36')]){_0x110572[_0x41a1('0x37')]=_['merge'](_0x110572[_0x41a1('0x37')],{'$or':_[_0x41a1('0x38')](_0x497610,function(_0x5d71a4){if(_0x5d71a4[_0x41a1('0x39')]!==_0x41a1('0x3a')){var _0x5aedb5={};_0x5aedb5[_0x5d71a4[_0x41a1('0x25')]]={'$like':'%'+_0x582879[_0x41a1('0x2a')][_0x41a1('0x36')]+'%'};return _0x5aedb5;}})});}_0x110572=_[_0x41a1('0x3b')]({},_0x110572,_0x582879[_0x41a1('0x3c')]);var _0x2f1e9f={'where':_0x110572[_0x41a1('0x37')]};return db[_0x41a1('0x27')]['count'](_0x2f1e9f)['then'](function(_0x478d08){_0x1d073a['count']=_0x478d08;if(_0x582879[_0x41a1('0x2a')][_0x41a1('0x3d')]){_0x110572[_0x41a1('0x3e')]=[{'all':!![]}];}return db['MailMessage'][_0x41a1('0x3f')](_0x110572);})[_0x41a1('0x23')](function(_0x22a11d){_0x1d073a[_0x41a1('0x40')]=_0x22a11d;return _0x1d073a;})['then'](respondWithFilteredResult(_0x521fab,_0x110572))[_0x41a1('0x1b')](handleError(_0x521fab,null));};exports[_0x41a1('0x41')]=function(_0x105e2a,_0x48b145){var _0x294725={'raw':!![],'where':{'id':_0x105e2a[_0x41a1('0x42')]['id']}},_0x3a768b={};_0x3a768b[_0x41a1('0x2d')]=_[_0x41a1('0x2b')](db[_0x41a1('0x27')][_0x41a1('0x28')]);_0x3a768b[_0x41a1('0x2a')]=_[_0x41a1('0x2b')](_0x105e2a[_0x41a1('0x2a')]);_0x3a768b[_0x41a1('0x34')]=_[_0x41a1('0x2c')](_0x3a768b[_0x41a1('0x2d')],_0x3a768b[_0x41a1('0x2a')]);_0x294725['attributes']=_[_0x41a1('0x2c')](_0x3a768b['model'],qs[_0x41a1('0x2f')](_0x105e2a[_0x41a1('0x2a')][_0x41a1('0x2f')]));_0x294725['attributes']=_0x294725['attributes'][_0x41a1('0x30')]?_0x294725[_0x41a1('0x2e')]:_0x3a768b[_0x41a1('0x2d')];if(_0x105e2a['query']['includeAll']){_0x294725[_0x41a1('0x3e')]=[{'all':!![]}];}_0x294725=_['merge']({},_0x294725,_0x105e2a[_0x41a1('0x3c')]);return db['MailMessage'][_0x41a1('0x43')](_0x294725)[_0x41a1('0x23')](handleEntityNotFound(_0x48b145,null))['then'](respondWithResult(_0x48b145,null))['catch'](handleError(_0x48b145,null));};exports['update']=function(_0x264a4d,_0x118af7){if(_0x264a4d[_0x41a1('0x44')]['id']){delete _0x264a4d[_0x41a1('0x44')]['id'];}return db[_0x41a1('0x27')][_0x41a1('0x43')]({'where':{'id':_0x264a4d[_0x41a1('0x42')]['id']}})[_0x41a1('0x23')](handleEntityNotFound(_0x118af7,null))[_0x41a1('0x23')](saveUpdates(_0x264a4d[_0x41a1('0x44')],null))['then'](respondWithResult(_0x118af7,null))[_0x41a1('0x1b')](handleError(_0x118af7,null));};exports[_0x41a1('0x45')]=function(_0xcd10a4,_0x287f21){return db[_0x41a1('0x27')]['find']({'where':{'id':_0xcd10a4[_0x41a1('0x42')]['id']}})[_0x41a1('0x23')](handleEntityNotFound(_0x287f21,null))[_0x41a1('0x23')](removeEntity(_0x287f21,null))['catch'](handleError(_0x287f21,null));};exports[_0x41a1('0x46')]=function(_0x499e2f,_0x117266){return db['MailMessage'][_0x41a1('0x46')]()[_0x41a1('0x23')](respondWithResult(_0x117266,null))[_0x41a1('0x1b')](handleError(_0x117266,null));};exports[_0x41a1('0x47')]=function(_0x120a34,_0x49cbfe){return db[_0x41a1('0x27')]['create'](_0x120a34[_0x41a1('0x44')])[_0x41a1('0x23')](function(_0x2054ac){if(_0x2054ac){if(_0x2054ac[_0x41a1('0x48')]===_0x41a1('0x49')&&!_0x2054ac[_0x41a1('0x4a')]){var _0x52f82e,_0x55db30,_0x206d82;if(_0x120a34[_0x41a1('0x44')]['to']){_0x55db30=_0x120a34['body']['to'][_0x41a1('0x4b')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x2054ac[_0x41a1('0x4c')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x41a1('0x4d')],'as':_0x41a1('0x4e'),'where':{'email':_0x55db30},'limit':0x1,'order':[[_0x41a1('0x4f'),_0x41a1('0x50')]]}]},{'model':db[_0x41a1('0x51')],'as':'Smtp','raw':!![]}]})[_0x41a1('0x23')](function(_0x1231e7){_0x52f82e=_0x1231e7;if(_0x52f82e&&_0x52f82e[_0x41a1('0x52')]){var _0x196f83={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x52f82e[_0x41a1('0x52')][_0x41a1('0x53')])){_0x196f83['host']=_0x52f82e[_0x41a1('0x52')][_0x41a1('0x54')];_0x196f83[_0x41a1('0x55')]=_0x52f82e['Smtp'][_0x41a1('0x55')];_0x196f83[_0x41a1('0x56')]=_0x52f82e['Smtp']['secure'];if(_0x52f82e[_0x41a1('0x52')][_0x41a1('0x57')]){_0x196f83[_0x41a1('0x58')]={'user':_0x52f82e[_0x41a1('0x52')][_0x41a1('0x59')],'pass':_0x52f82e[_0x41a1('0x52')][_0x41a1('0x5a')]};}}else{_0x196f83[_0x41a1('0x53')]=_0x52f82e[_0x41a1('0x52')]['service'];_0x196f83[_0x41a1('0x58')]={'user':_0x52f82e[_0x41a1('0x52')][_0x41a1('0x59')],'pass':_0x52f82e['Smtp'][_0x41a1('0x5a')]};_0x196f83[_0x41a1('0x56')]=_0x52f82e[_0x41a1('0x52')][_0x41a1('0x56')];}if(_0x120a34[_0x41a1('0x44')]['attachments']&&_0x120a34[_0x41a1('0x44')][_0x41a1('0x5b')][_0x41a1('0x30')]){for(var _0x3edd7d=0x0;_0x3edd7d<_0x120a34['body'][_0x41a1('0x5b')]['length'];_0x3edd7d+=0x1){_0x120a34[_0x41a1('0x44')][_0x41a1('0x5b')][_0x3edd7d]={'filename':_0x120a34[_0x41a1('0x44')][_0x41a1('0x5b')][_0x3edd7d]['name'],'path':path[_0x41a1('0x5c')](config['root'],_0x41a1('0x5d'),_0x120a34[_0x41a1('0x44')]['attachments'][_0x3edd7d][_0x41a1('0x5e')])};}}_0x206d82={'account':_0x196f83,'message':_0x120a34[_0x41a1('0x44')]};return;}})[_0x41a1('0x23')](function(){if(_0x52f82e[_0x41a1('0x5f')]){if(_0x52f82e[_0x41a1('0x5f')][_0x41a1('0x4e')][_0x41a1('0x30')]){return _0x52f82e[_0x41a1('0x5f')][_0x41a1('0x4e')][0x0];}else{return db['CmContact'][_0x41a1('0x47')](_[_0x41a1('0xb')](_0x120a34[_0x41a1('0x44')],{'firstName':_0x120a34[_0x41a1('0x44')]['to'],'email':_0x120a34[_0x41a1('0x44')]['to'],'phone':_0x120a34[_0x41a1('0x44')]['to'],'ListId':_0x52f82e[_0x41a1('0x60')]}));}}else{throw new Error(_0x41a1('0x61'));}})[_0x41a1('0x23')](function(){if(_0x206d82){return respondWithRpcPromise(_0x41a1('0x62'),_0x41a1('0x63'),_0x206d82,client9003)['then'](function(_0x2374bc){return _0x2054ac['update']({'read':!![],'messageId':_0x2374bc['messageId'],'sentAt':moment()[_0x41a1('0x64')](_0x41a1('0x65'))});})[_0x41a1('0x1b')](function(_0x5bff4f){logger['error']('%s',JSON[_0x41a1('0x16')](_0x5bff4f));return _0x2054ac;});}return _0x2054ac;});}return _0x2054ac;}})[_0x41a1('0x23')](respondWithResult(_0x49cbfe,0xc9))[_0x41a1('0x1b')](handleError(_0x49cbfe,null));};exports[_0x41a1('0x66')]=function(_0x3da326,_0x1f76e7){var _0x2e411e={'agent':{},'channel':'mail'};if(_0x3da326['body']['id']){delete _0x3da326[_0x41a1('0x44')]['id'];}_0x3da326['body'][_0x41a1('0x67')]=!![];_0x3da326[_0x41a1('0x44')][_0x41a1('0x68')]=moment()[_0x41a1('0x64')](_0x41a1('0x65'));_0x3da326[_0x41a1('0x44')]['UserId']=_0x3da326[_0x41a1('0x44')][_0x41a1('0x69')]||_0x3da326[_0x41a1('0x59')]['id'];_0x2e411e[_0x41a1('0x6a')]['id']=_0x3da326[_0x41a1('0x44')]['UserId'];return db[_0x41a1('0x27')][_0x41a1('0x43')]({'where':{'id':_0x3da326[_0x41a1('0x42')]['id'],'UserId':null}})[_0x41a1('0x23')](handleEntityNotFound(_0x1f76e7,null))[_0x41a1('0x23')](saveUpdates(_0x3da326['body'],null))[_0x41a1('0x23')](function(_0x4c1e3b){if(_0x4c1e3b){_0x2e411e[_0x41a1('0x19')]=_0x4c1e3b[_0x41a1('0x6b')]({'plain':!![]});return db[_0x41a1('0x6c')]['find']({'where':{'id':_0x4c1e3b[_0x41a1('0x6d')]}});}return null;})[_0x41a1('0x23')](handleEntityNotFound(_0x1f76e7,null))[_0x41a1('0x23')](function(_0x2fb81f){if(_0x2fb81f){return _0x2fb81f['update']({'UserId':_0x3da326['body']['UserId'],'read1stAt':_[_0x41a1('0x6e')](_0x2fb81f['read1stAt'])?moment()['format'](_0x41a1('0x65')):undefined});}return null;})[_0x41a1('0x23')](function(_0x3445d6){if(_0x3445d6){_0x2e411e[_0x41a1('0x6f')]=_0x3445d6[_0x41a1('0x6b')]({'plain':!![]});interaction_log[_0x41a1('0x12')](_0x41a1('0x70'),_0x3da326['user']['id'],_0x3da326['user'][_0x41a1('0x25')],_0x3da326[_0x41a1('0x59')][_0x41a1('0x71')],_0x2e411e['interaction']['id'],_0x3da326[_0x41a1('0x44')]?JSON['stringify'](_0x3da326[_0x41a1('0x44')]):'null');return respondWithRpcPromise('AcceptMessage',_0x41a1('0x72'),_0x2e411e);}return null;})[_0x41a1('0x23')](function(_0x25a329){var _0x527d79=_0x41a1('0x73')+_0x25a329[_0x41a1('0x19')]['ContactId'];return db[_0x41a1('0x74')]['query'](_0x527d79,{'type':db[_0x41a1('0x75')][_0x41a1('0x76')][_0x41a1('0x77')],'raw':!![]})[_0x41a1('0x23')](function(_0x5ee575){return _0x5ee575;});})[_0x41a1('0x23')](function(_0x5ef573){if(_0x5ef573){_0x2e411e['message'][_0x41a1('0x78')]=_0x5ef573[0x0];if(!_0x3da326[_0x41a1('0x44')][_0x41a1('0x69')])return;return db[_0x41a1('0x79')][_0x41a1('0x43')]({'where':{'id':_0x3da326[_0x41a1('0x44')][_0x41a1('0x69')],'role':'agent'},'attributes':['id',_0x41a1('0x25'),_0x41a1('0x7a'),'email',_0x41a1('0x7b')],'raw':!![]});}return null;})[_0x41a1('0x23')](function(_0xed608){if(!_0xed608)return null;_0x2e411e[_0x41a1('0x19')][_0x41a1('0x6a')]=_0xed608;return _0x2e411e;})[_0x41a1('0x23')](function(_0x1e747a){if(_0x1e747a){if(_0x3da326[_0x41a1('0x44')][_0x41a1('0x7c')]){_0x2e411e['message'][_0x41a1('0x7d')]=util[_0x41a1('0x64')](_0x41a1('0x7e'),_0x3da326[_0x41a1('0x59')][_0x41a1('0x25')]);_0x2e411e[_0x41a1('0x19')][_0x41a1('0x7f')]=_0x2e411e['channel'];_0x2e411e[_0x41a1('0x19')][_0x41a1('0x80')]=_0x2e411e['channel'];_0x2e411e[_0x41a1('0x19')][_0x41a1('0x81')]='accept';_0x2e411e[_0x41a1('0x19')][_0x41a1('0x44')]=htmlToText['fromString'](_0x2e411e[_0x41a1('0x19')][_0x41a1('0x44')]);return respondWithRpcPromise('EventManager',_0x41a1('0x82'),{'event':_0x41a1('0x83'),'message':_0x2e411e['message']},client9002)[_0x41a1('0x23')](function(){return _0x2e411e;});}return _0x2e411e;}return null;})[_0x41a1('0x23')](respondWithResult(_0x1f76e7,null))[_0x41a1('0x1b')](handleError(_0x1f76e7,null));};exports[_0x41a1('0x84')]=function(_0x19b1c6,_0x151331){var _0x59dab8={'agent':{},'channel':_0x41a1('0x85')};if(_0x19b1c6['body']['id']){delete _0x19b1c6[_0x41a1('0x44')]['id'];}_0x19b1c6['body'][_0x41a1('0x69')]=_0x19b1c6[_0x41a1('0x44')][_0x41a1('0x69')]||_0x19b1c6[_0x41a1('0x59')]['id'];_0x59dab8[_0x41a1('0x6a')]['id']=_0x19b1c6[_0x41a1('0x44')]['UserId'];return db[_0x41a1('0x27')][_0x41a1('0x43')]({'where':{'id':_0x19b1c6[_0x41a1('0x42')]['id'],'UserId':null}})[_0x41a1('0x23')](handleEntityNotFound(_0x151331,null))['then'](function(_0x4c0e89){if(_0x4c0e89){_0x59dab8[_0x41a1('0x19')]=_0x4c0e89[_0x41a1('0x6b')]({'plain':!![]});return db[_0x41a1('0x6c')]['find']({'where':{'id':_0x4c0e89[_0x41a1('0x6d')]}});}return null;})[_0x41a1('0x23')](handleEntityNotFound(_0x151331,null))[_0x41a1('0x23')](function(_0x5d184c){if(_0x5d184c){_0x59dab8[_0x41a1('0x6f')]=_0x5d184c[_0x41a1('0x6b')]({'plain':!![]});interaction_log['info'](_0x41a1('0x86'),_0x19b1c6['user']['id'],_0x19b1c6[_0x41a1('0x59')][_0x41a1('0x25')],_0x19b1c6[_0x41a1('0x59')][_0x41a1('0x71')],_0x59dab8[_0x41a1('0x6f')]['id'],_0x19b1c6['body']?JSON[_0x41a1('0x16')](_0x19b1c6[_0x41a1('0x44')]):_0x41a1('0x87'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x59dab8);}return null;})[_0x41a1('0x23')](function(_0x286edc){var _0x4192e5=_0x41a1('0x73')+_0x286edc[_0x41a1('0x19')][_0x41a1('0x88')];return db[_0x41a1('0x74')][_0x41a1('0x2a')](_0x4192e5,{'type':db[_0x41a1('0x75')][_0x41a1('0x76')][_0x41a1('0x77')],'raw':!![]})[_0x41a1('0x23')](function(_0x3b2c2d){return _0x3b2c2d;});})[_0x41a1('0x23')](function(_0x48a537){if(_0x48a537){_0x59dab8['message'][_0x41a1('0x78')]=_0x48a537[0x0];if(!_0x19b1c6[_0x41a1('0x44')]['UserId'])return;return db['User'][_0x41a1('0x43')]({'where':{'id':_0x19b1c6[_0x41a1('0x44')][_0x41a1('0x69')],'role':_0x41a1('0x6a')},'attributes':['id',_0x41a1('0x25'),_0x41a1('0x7a'),_0x41a1('0x89'),_0x41a1('0x7b')],'raw':!![]});}return null;})['then'](function(_0x275aba){if(!_0x275aba)return null;_0x59dab8[_0x41a1('0x19')]['agent']=_0x275aba;return _0x59dab8;})[_0x41a1('0x23')](function(_0x500c9d){if(_0x500c9d){_0x500c9d[_0x41a1('0x19')][_0x41a1('0x7d')]=util['format'](_0x41a1('0x7e'),_0x19b1c6[_0x41a1('0x59')][_0x41a1('0x25')]);_0x500c9d['message'][_0x41a1('0x7f')]=_0x59dab8['channel'];_0x500c9d[_0x41a1('0x19')][_0x41a1('0x80')]=_0x59dab8['channel'];_0x500c9d[_0x41a1('0x19')][_0x41a1('0x81')]=_0x41a1('0x84');_0x500c9d[_0x41a1('0x19')][_0x41a1('0x44')]=htmlToText['fromString'](_0x59dab8['message'][_0x41a1('0x44')]);respondWithRpcPromise(_0x41a1('0x82'),_0x41a1('0x82'),{'event':_0x41a1('0x8a'),'message':_0x500c9d[_0x41a1('0x19')]},client9002);return _0x59dab8;}return null;})[_0x41a1('0x23')](respondWithResult(_0x151331,null))[_0x41a1('0x1b')](handleError(_0x151331,null));};exports[_0x41a1('0x8b')]=function(_0x4cb57f,_0x377de9){var _0x264921=moment()[_0x41a1('0x8c')]()['toString']();var _0x3a92b0=path[_0x41a1('0x5c')](config[_0x41a1('0x8d')],'server','files',_0x41a1('0x8e'));var _0x5e99be=path['join'](config[_0x41a1('0x8d')],_0x41a1('0x8f'),_0x41a1('0x90'),'attachments');var _0x4b84ca=util['format'](_0x41a1('0x91'),_0x264921);return db['MailMessage'][_0x41a1('0x43')]({'where':{'id':_0x4cb57f[_0x41a1('0x42')]['id']},'attributes':['id',_0x41a1('0x44'),_0x41a1('0x92'),'to','cc',_0x41a1('0x93'),_0x41a1('0x94'),_0x41a1('0x95')],'include':_0x4cb57f[_0x41a1('0x2a')][_0x41a1('0x5b')]?[{'model':db[_0x41a1('0x96')],'as':_0x41a1('0x97')}]:undefined})[_0x41a1('0x23')](handleEntityNotFound(_0x377de9,null))['then'](function(_0x353569){if(_0x353569){var _0x56367f=_0x353569;var _0x35e906={'from':_0x56367f[_0x41a1('0x92')],'to':_0x56367f['to'],'subject':_0x56367f[_0x41a1('0x94')],'html':htmlEntities['decode'](_0x56367f[_0x41a1('0x44')]),'headers':{'Date':moment(_0x56367f['createdAt'])[_0x41a1('0x64')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x353569['cc']){_0x35e906[_0x41a1('0x98')]['Cc']=_0x353569['cc'];}if(_0x353569[_0x41a1('0x93')]){_0x35e906[_0x41a1('0x98')][_0x41a1('0x99')]=_0x353569['bcc'];}return new BPromise(function(_0x2606ea,_0x1da3df){if(_0x353569['Attachments']){for(var _0xa2873a=0x0;_0xa2873a<_0x353569[_0x41a1('0x97')][_0x41a1('0x30')];_0xa2873a++){var _0x384a2a=_0x353569['Attachments'][_0xa2873a];var _0x21df2a=path[_0x41a1('0x5c')](_0x5e99be,_0x384a2a[_0x41a1('0x5e')]);if(fs[_0x41a1('0x9a')](_0x21df2a)){_0x35e906[_0x41a1('0x5b')]['push']({'name':_0x384a2a[_0x41a1('0x25')],'contentType':_0x384a2a[_0x41a1('0x39')],'data':fs[_0x41a1('0x9b')](_0x21df2a)});}}}emlformat[_0x41a1('0x9c')](_0x35e906,function(_0x13abfc,_0x5e4111){if(_0x13abfc)return _0x1da3df(_0x13abfc);fs[_0x41a1('0x9d')](path[_0x41a1('0x5c')](_0x3a92b0,_0x4b84ca),_0x5e4111);return _0x2606ea(_0x5e4111);});});}})[_0x41a1('0x23')](function(_0x4bf88e){if(_0x4bf88e){return _0x377de9['download'](path['join'](_0x3a92b0,_0x4b84ca),_0x4b84ca,function(_0x11e127){if(!_0x11e127)fs['unlinkSync'](path[_0x41a1('0x5c')](_0x3a92b0,_0x4b84ca));});}})['catch'](handleError(_0x377de9,null));}; \ No newline at end of file +var _0x833e=['internal','interface','reject','unix','toString','root','server','files','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','readFileSync','build','writeFileSync','download','eml-format','moment','bluebird','util','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','includeAll','rows','params','merge','body','find','describe','create','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','service','host','port','secure','authentication','user','auth','pass','attachments','join','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x833e,0xbb));var _0xe833=function(_0x5d5ae5,_0x106d29){_0x5d5ae5=_0x5d5ae5-0x0;var _0x39f9d8=_0x833e[_0x5d5ae5];return _0x39f9d8;};'use strict';var emlformat=require(_0xe833('0x0'));var moment=require(_0xe833('0x1'));var BPromise=require(_0xe833('0x2'));var util=require(_0xe833('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xe833('0x4'));var htmlToText=require(_0xe833('0x5'));var qs=require(_0xe833('0x6'));var logger=require(_0xe833('0x7'))(_0xe833('0x8'));var interaction_log=require(_0xe833('0x7'))(_0xe833('0x9'));var config=require(_0xe833('0xa'));var db=require('../../mysqldb')['db'];config[_0xe833('0xb')]=_[_0xe833('0xc')](config[_0xe833('0xb')],{'host':_0xe833('0xd'),'port':0x18eb});var socket=require(_0xe833('0xe'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0xe833('0xf'))[_0xe833('0x10')](socket);var jayson=require(_0xe833('0x11'));var client=jayson[_0xe833('0x12')][_0xe833('0x13')]({'port':0x232c});var client9003=jayson[_0xe833('0x12')][_0xe833('0x13')]({'port':0x232b});var client9002=jayson[_0xe833('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e4119,_0x49627d,_0x1aa8e2,_0x10332){return new BPromise(function(_0x92ae7a,_0x1e9ced){var _0x4e8185=_0x10332||client;return _0x4e8185[_0xe833('0x14')](_0x1e4119,_0x1aa8e2)['then'](function(_0x3c23fb){logger[_0xe833('0x15')](_0xe833('0x16'),_0x49627d,'request\x20sent');logger[_0xe833('0x17')](_0xe833('0x18'),_0x49627d,_0xe833('0x19'),JSON['stringify'](_0x3c23fb));if(_0x3c23fb[_0xe833('0x1a')]){if(_0x3c23fb[_0xe833('0x1a')]['code']===0x1f4){logger['error'](_0xe833('0x16'),_0x49627d,_0x3c23fb[_0xe833('0x1a')][_0xe833('0x1b')]);return _0x1e9ced(_0x3c23fb['error'][_0xe833('0x1b')]);}logger[_0xe833('0x1a')](_0xe833('0x16'),_0x49627d,_0x3c23fb['error'][_0xe833('0x1b')]);return _0x92ae7a(_0x3c23fb[_0xe833('0x1a')][_0xe833('0x1b')]);}else{logger[_0xe833('0x15')](_0xe833('0x16'),_0x49627d,_0xe833('0x19'));_0x92ae7a(_0x3c23fb[_0xe833('0x1c')][_0xe833('0x1b')]);}})[_0xe833('0x1d')](function(_0xfefe7d){logger['error'](_0xe833('0x16'),_0x49627d,_0xfefe7d);_0x1e9ced(_0xfefe7d);});});}function respondWithResult(_0x4cd4a6,_0x3199ab){_0x3199ab=_0x3199ab||0xc8;return function(_0x36b3ce){if(_0x36b3ce){return _0x4cd4a6[_0xe833('0x1e')](_0x3199ab)[_0xe833('0x1f')](_0x36b3ce);}};}function respondWithFilteredResult(_0x92f245,_0x30501b){return function(_0x2ef16b){if(_0x2ef16b){var _0x58c90c=typeof _0x30501b[_0xe833('0x20')]===_0xe833('0x21')&&typeof _0x30501b[_0xe833('0x22')]===_0xe833('0x21');var _0x57cba6=_0x2ef16b[_0xe833('0x23')];var _0x3a742e=_0x58c90c?0x0:_0x30501b['offset'];var _0x56fd99=_0x58c90c?_0x2ef16b[_0xe833('0x23')]:_0x30501b[_0xe833('0x20')]+_0x30501b['limit'];var _0x2d3905;if(_0x56fd99>=_0x57cba6){_0x56fd99=_0x57cba6;_0x2d3905=0xc8;}else{_0x2d3905=0xce;}_0x92f245['status'](_0x2d3905);return _0x92f245[_0xe833('0x24')](_0xe833('0x25'),_0x3a742e+'-'+_0x56fd99+'/'+_0x57cba6)[_0xe833('0x1f')](_0x2ef16b);}return null;};}function saveUpdates(_0x18dc2c){return function(_0x39f80d){if(_0x39f80d){return _0x39f80d[_0xe833('0x26')](_0x18dc2c)[_0xe833('0x27')](function(_0xb1e174){return _0xb1e174;});}return null;};}function removeEntity(_0x3733ae){return function(_0x555038){if(_0x555038){return _0x555038[_0xe833('0x28')]()[_0xe833('0x27')](function(){_0x3733ae['status'](0xcc)[_0xe833('0x29')]();});}};}function handleEntityNotFound(_0x2ccecc){return function(_0x439496){if(!_0x439496){_0x2ccecc['sendStatus'](0x194);}return _0x439496;};}function handleError(_0x2e1ba0,_0x50f923){_0x50f923=_0x50f923||0x1f4;return function(_0x5ef5d7){logger[_0xe833('0x1a')](_0x5ef5d7[_0xe833('0x2a')]);if(_0x5ef5d7[_0xe833('0x2b')]){delete _0x5ef5d7[_0xe833('0x2b')];}_0x2e1ba0['status'](_0x50f923)[_0xe833('0x2c')](_0x5ef5d7);};}exports[_0xe833('0x2d')]=function(_0x5c9b96,_0x32168e){var _0x5a3bd9={},_0x27f93f={},_0x2a4895={'count':0x0,'rows':[]};var _0x240fdb=_[_0xe833('0x2e')](db[_0xe833('0x2f')][_0xe833('0x30')],function(_0x321520){return{'name':_0x321520['fieldName'],'type':_0x321520[_0xe833('0x31')][_0xe833('0x32')]};});_0x27f93f[_0xe833('0x33')]=_[_0xe833('0x2e')](_0x240fdb,_0xe833('0x2b'));_0x27f93f[_0xe833('0x34')]=_[_0xe833('0x35')](_0x5c9b96[_0xe833('0x34')]);_0x27f93f[_0xe833('0x36')]=_['intersection'](_0x27f93f[_0xe833('0x33')],_0x27f93f[_0xe833('0x34')]);_0x5a3bd9[_0xe833('0x37')]=_[_0xe833('0x38')](_0x27f93f[_0xe833('0x33')],qs['fields'](_0x5c9b96[_0xe833('0x34')][_0xe833('0x39')]));_0x5a3bd9[_0xe833('0x37')]=_0x5a3bd9[_0xe833('0x37')][_0xe833('0x3a')]?_0x5a3bd9['attributes']:_0x27f93f[_0xe833('0x33')];if(!_0x5c9b96[_0xe833('0x34')][_0xe833('0x3b')]('nolimit')){_0x5a3bd9[_0xe833('0x22')]=qs[_0xe833('0x22')](_0x5c9b96['query'][_0xe833('0x22')]);_0x5a3bd9[_0xe833('0x20')]=qs['offset'](_0x5c9b96[_0xe833('0x34')][_0xe833('0x20')]);}_0x5a3bd9['order']=qs['sort'](_0x5c9b96[_0xe833('0x34')][_0xe833('0x3c')]);_0x5a3bd9[_0xe833('0x3d')]=qs[_0xe833('0x36')](_[_0xe833('0x3e')](_0x5c9b96['query'],_0x27f93f[_0xe833('0x36')]),_0x240fdb);if(_0x5c9b96[_0xe833('0x34')][_0xe833('0x3f')]){_0x5a3bd9[_0xe833('0x3d')]=_['merge'](_0x5a3bd9[_0xe833('0x3d')],{'$or':_['map'](_0x240fdb,function(_0x3e7df5){if(_0x3e7df5[_0xe833('0x31')]!==_0xe833('0x40')){var _0x2e1b75={};_0x2e1b75[_0x3e7df5['name']]={'$like':'%'+_0x5c9b96[_0xe833('0x34')]['filter']+'%'};return _0x2e1b75;}})});}_0x5a3bd9=_['merge']({},_0x5a3bd9,_0x5c9b96['options']);var _0x45bad9={'where':_0x5a3bd9['where']};return db[_0xe833('0x2f')][_0xe833('0x23')](_0x45bad9)[_0xe833('0x27')](function(_0x3c2b7a){_0x2a4895[_0xe833('0x23')]=_0x3c2b7a;if(_0x5c9b96[_0xe833('0x34')][_0xe833('0x41')]){_0x5a3bd9['include']=[{'all':!![]}];}return db[_0xe833('0x2f')]['findAll'](_0x5a3bd9);})[_0xe833('0x27')](function(_0x5066f4){_0x2a4895[_0xe833('0x42')]=_0x5066f4;return _0x2a4895;})['then'](respondWithFilteredResult(_0x32168e,_0x5a3bd9))[_0xe833('0x1d')](handleError(_0x32168e,null));};exports['show']=function(_0x3c506a,_0x4e0c36){var _0x59046f={'raw':!![],'where':{'id':_0x3c506a[_0xe833('0x43')]['id']}},_0x2bc15c={};_0x2bc15c[_0xe833('0x33')]=_['keys'](db['MailMessage'][_0xe833('0x30')]);_0x2bc15c[_0xe833('0x34')]=_[_0xe833('0x35')](_0x3c506a['query']);_0x2bc15c['filters']=_[_0xe833('0x38')](_0x2bc15c['model'],_0x2bc15c[_0xe833('0x34')]);_0x59046f[_0xe833('0x37')]=_[_0xe833('0x38')](_0x2bc15c[_0xe833('0x33')],qs[_0xe833('0x39')](_0x3c506a['query']['fields']));_0x59046f[_0xe833('0x37')]=_0x59046f[_0xe833('0x37')][_0xe833('0x3a')]?_0x59046f['attributes']:_0x2bc15c['model'];if(_0x3c506a['query']['includeAll']){_0x59046f['include']=[{'all':!![]}];}_0x59046f=_[_0xe833('0x44')]({},_0x59046f,_0x3c506a['options']);return db[_0xe833('0x2f')]['find'](_0x59046f)[_0xe833('0x27')](handleEntityNotFound(_0x4e0c36,null))[_0xe833('0x27')](respondWithResult(_0x4e0c36,null))[_0xe833('0x1d')](handleError(_0x4e0c36,null));};exports['update']=function(_0x3d9077,_0x4e2b00){if(_0x3d9077[_0xe833('0x45')]['id']){delete _0x3d9077[_0xe833('0x45')]['id'];}return db[_0xe833('0x2f')][_0xe833('0x46')]({'where':{'id':_0x3d9077[_0xe833('0x43')]['id']}})[_0xe833('0x27')](handleEntityNotFound(_0x4e2b00,null))[_0xe833('0x27')](saveUpdates(_0x3d9077[_0xe833('0x45')],null))[_0xe833('0x27')](respondWithResult(_0x4e2b00,null))['catch'](handleError(_0x4e2b00,null));};exports['destroy']=function(_0x4cc6ff,_0x2ccffd){return db[_0xe833('0x2f')][_0xe833('0x46')]({'where':{'id':_0x4cc6ff[_0xe833('0x43')]['id']}})[_0xe833('0x27')](handleEntityNotFound(_0x2ccffd,null))['then'](removeEntity(_0x2ccffd,null))[_0xe833('0x1d')](handleError(_0x2ccffd,null));};exports['describe']=function(_0x2d135e,_0x3706f3){return db[_0xe833('0x2f')][_0xe833('0x47')]()['then'](respondWithResult(_0x3706f3,null))['catch'](handleError(_0x3706f3,null));};exports['create']=function(_0xcb3422,_0x385da3){return db[_0xe833('0x2f')][_0xe833('0x48')](_0xcb3422[_0xe833('0x45')])[_0xe833('0x27')](function(_0x4429f5){if(_0x4429f5){if(_0x4429f5['direction']===_0xe833('0x49')&&!_0x4429f5['secret']){var _0x3f7d44,_0x189637,_0x4171c3;if(_0xcb3422[_0xe833('0x45')]['to']){_0x189637=_0xcb3422[_0xe833('0x45')]['to'][_0xe833('0x4a')](',')[0x0];}return db[_0xe833('0x4b')][_0xe833('0x4c')]({'where':{'id':_0x4429f5[_0xe833('0x4d')]},'include':[{'model':db[_0xe833('0x4e')],'as':_0xe833('0x4f'),'include':[{'model':db[_0xe833('0x50')],'as':'Contacts','where':{'email':_0x189637},'limit':0x1,'order':[[_0xe833('0x51'),_0xe833('0x52')]]}]},{'model':db['MailServerOut'],'as':_0xe833('0x53'),'raw':!![]}]})[_0xe833('0x27')](function(_0x2ac020){_0x3f7d44=_0x2ac020;if(_0x3f7d44&&_0x3f7d44[_0xe833('0x53')]){var _0x3c884d={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3f7d44[_0xe833('0x53')][_0xe833('0x54')])){_0x3c884d[_0xe833('0x55')]=_0x3f7d44[_0xe833('0x53')][_0xe833('0x55')];_0x3c884d['port']=_0x3f7d44[_0xe833('0x53')][_0xe833('0x56')];_0x3c884d[_0xe833('0x57')]=_0x3f7d44[_0xe833('0x53')]['secure'];if(_0x3f7d44[_0xe833('0x53')][_0xe833('0x58')]){_0x3c884d['auth']={'user':_0x3f7d44[_0xe833('0x53')][_0xe833('0x59')],'pass':_0x3f7d44['Smtp']['pass']};}}else{_0x3c884d[_0xe833('0x54')]=_0x3f7d44[_0xe833('0x53')][_0xe833('0x54')];_0x3c884d[_0xe833('0x5a')]={'user':_0x3f7d44['Smtp'][_0xe833('0x59')],'pass':_0x3f7d44['Smtp'][_0xe833('0x5b')]};_0x3c884d['secure']=_0x3f7d44[_0xe833('0x53')][_0xe833('0x57')];}if(_0xcb3422[_0xe833('0x45')][_0xe833('0x5c')]&&_0xcb3422[_0xe833('0x45')][_0xe833('0x5c')][_0xe833('0x3a')]){for(var _0x196b01=0x0;_0x196b01<_0xcb3422[_0xe833('0x45')][_0xe833('0x5c')][_0xe833('0x3a')];_0x196b01+=0x1){_0xcb3422[_0xe833('0x45')][_0xe833('0x5c')][_0x196b01]={'filename':_0xcb3422['body'][_0xe833('0x5c')][_0x196b01][_0xe833('0x2b')],'path':path[_0xe833('0x5d')](config['root'],_0xe833('0x5e'),_0xcb3422[_0xe833('0x45')][_0xe833('0x5c')][_0x196b01][_0xe833('0x5f')])};}}_0x4171c3={'account':_0x3c884d,'message':_0xcb3422[_0xe833('0x45')]};return;}})['then'](function(){if(_0x3f7d44[_0xe833('0x4f')]){if(_0x3f7d44[_0xe833('0x4f')][_0xe833('0x60')][_0xe833('0x3a')]){return _0x3f7d44[_0xe833('0x4f')]['Contacts'][0x0];}else{return db[_0xe833('0x50')]['create'](_[_0xe833('0xc')](_0xcb3422['body'],{'firstName':_0xcb3422[_0xe833('0x45')]['to'],'email':_0xcb3422['body']['to'],'phone':_0xcb3422['body']['to'],'ListId':_0x3f7d44[_0xe833('0x61')]}));}}else{throw new Error(_0xe833('0x62'));}})[_0xe833('0x27')](function(){if(_0x4171c3){return respondWithRpcPromise(_0xe833('0x63'),_0xe833('0x64'),_0x4171c3,client9003)[_0xe833('0x27')](function(_0x48c28c){return _0x4429f5[_0xe833('0x26')]({'read':!![],'messageId':_0x48c28c['messageId'],'sentAt':moment()[_0xe833('0x65')](_0xe833('0x66'))});})[_0xe833('0x1d')](function(_0x54ee73){logger[_0xe833('0x1a')]('%s',JSON[_0xe833('0x67')](_0x54ee73));return _0x4429f5;});}return _0x4429f5;});}return _0x4429f5;}})[_0xe833('0x27')](respondWithResult(_0x385da3,0xc9))[_0xe833('0x1d')](handleError(_0x385da3,null));};exports[_0xe833('0x68')]=function(_0x5059a6,_0x17c9da){var _0x2e9d88={'agent':{},'channel':'mail'};if(_0x5059a6[_0xe833('0x45')]['id']){delete _0x5059a6[_0xe833('0x45')]['id'];}_0x5059a6[_0xe833('0x45')][_0xe833('0x69')]=!![];_0x5059a6['body'][_0xe833('0x6a')]=moment()[_0xe833('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x5059a6[_0xe833('0x45')][_0xe833('0x6b')]=_0x5059a6[_0xe833('0x45')][_0xe833('0x6b')]||_0x5059a6['user']['id'];_0x2e9d88[_0xe833('0x6c')]['id']=_0x5059a6[_0xe833('0x45')]['UserId'];return db[_0xe833('0x2f')][_0xe833('0x46')]({'where':{'id':_0x5059a6[_0xe833('0x43')]['id'],'UserId':null}})[_0xe833('0x27')](handleEntityNotFound(_0x17c9da,null))[_0xe833('0x27')](saveUpdates(_0x5059a6['body'],null))[_0xe833('0x27')](function(_0x139b96){if(_0x139b96){_0x2e9d88[_0xe833('0x1b')]=_0x139b96[_0xe833('0x6d')]({'plain':!![]});return db[_0xe833('0x6e')]['find']({'where':{'id':_0x139b96[_0xe833('0x6f')]}});}return null;})[_0xe833('0x27')](handleEntityNotFound(_0x17c9da,null))[_0xe833('0x27')](function(_0x5ea0df){if(_0x5ea0df){return _0x5ea0df[_0xe833('0x26')]({'UserId':_0x5059a6[_0xe833('0x45')]['UserId'],'read1stAt':_[_0xe833('0x70')](_0x5ea0df[_0xe833('0x71')])?moment()['format'](_0xe833('0x66')):undefined});}return null;})[_0xe833('0x27')](function(_0x2be256){if(_0x2be256){_0x2e9d88[_0xe833('0x72')]=_0x2be256[_0xe833('0x6d')]({'plain':!![]});interaction_log[_0xe833('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5059a6[_0xe833('0x59')]['id'],_0x5059a6[_0xe833('0x59')]['name'],_0x5059a6['user'][_0xe833('0x73')],_0x2e9d88[_0xe833('0x72')]['id'],_0x5059a6[_0xe833('0x45')]?JSON[_0xe833('0x67')](_0x5059a6[_0xe833('0x45')]):_0xe833('0x74'));return respondWithRpcPromise(_0xe833('0x75'),_0xe833('0x76'),_0x2e9d88);}return null;})[_0xe833('0x27')](function(_0x245704){var _0x53ab63=_0xe833('0x77')+_0x245704['message']['ContactId'];return db[_0xe833('0x78')][_0xe833('0x34')](_0x53ab63,{'type':db[_0xe833('0x79')][_0xe833('0x7a')][_0xe833('0x7b')],'raw':!![]})[_0xe833('0x27')](function(_0x27ff51){return _0x27ff51;});})[_0xe833('0x27')](function(_0x11d581){if(_0x11d581){_0x2e9d88[_0xe833('0x1b')][_0xe833('0x7c')]=_0x11d581[0x0];if(!_0x5059a6[_0xe833('0x45')]['UserId'])return;return db[_0xe833('0x7d')][_0xe833('0x46')]({'where':{'id':_0x5059a6[_0xe833('0x45')][_0xe833('0x6b')],'role':_0xe833('0x6c')},'attributes':['id',_0xe833('0x2b'),_0xe833('0x7e'),_0xe833('0x7f'),'internal'],'raw':!![]});}return null;})[_0xe833('0x27')](function(_0x777247){if(!_0x777247)return null;_0x2e9d88[_0xe833('0x1b')][_0xe833('0x6c')]=_0x777247;return _0x2e9d88;})[_0xe833('0x27')](function(_0x1f1ce7){if(_0x1f1ce7){if(_0x5059a6[_0xe833('0x45')][_0xe833('0x80')]){_0x2e9d88[_0xe833('0x1b')]['interface']=util[_0xe833('0x65')](_0xe833('0x81'),_0x5059a6['user']['name']);_0x2e9d88['message']['channel']=_0x2e9d88[_0xe833('0x82')];_0x2e9d88[_0xe833('0x1b')][_0xe833('0x83')]=_0x2e9d88[_0xe833('0x82')];_0x2e9d88[_0xe833('0x1b')][_0xe833('0x84')]=_0xe833('0x68');_0x2e9d88['message'][_0xe833('0x45')]=htmlToText[_0xe833('0x85')](_0x2e9d88[_0xe833('0x1b')][_0xe833('0x45')]);return respondWithRpcPromise(_0xe833('0x86'),'EventManager',{'event':_0xe833('0x87'),'message':_0x2e9d88[_0xe833('0x1b')]},client9002)[_0xe833('0x27')](function(){return _0x2e9d88;});}return _0x2e9d88;}return null;})[_0xe833('0x27')](respondWithResult(_0x17c9da,null))[_0xe833('0x1d')](handleError(_0x17c9da,null));};exports['reject']=function(_0x4ea1e2,_0x1fe53a){var _0x5f578e={'agent':{},'channel':_0xe833('0x88')};if(_0x4ea1e2[_0xe833('0x45')]['id']){delete _0x4ea1e2['body']['id'];}_0x4ea1e2[_0xe833('0x45')][_0xe833('0x6b')]=_0x4ea1e2['body'][_0xe833('0x6b')]||_0x4ea1e2[_0xe833('0x59')]['id'];_0x5f578e[_0xe833('0x6c')]['id']=_0x4ea1e2[_0xe833('0x45')]['UserId'];return db[_0xe833('0x2f')]['find']({'where':{'id':_0x4ea1e2[_0xe833('0x43')]['id'],'UserId':null}})[_0xe833('0x27')](handleEntityNotFound(_0x1fe53a,null))[_0xe833('0x27')](function(_0x57fc6a){if(_0x57fc6a){_0x5f578e[_0xe833('0x1b')]=_0x57fc6a['get']({'plain':!![]});return db[_0xe833('0x6e')][_0xe833('0x46')]({'where':{'id':_0x57fc6a[_0xe833('0x6f')]}});}return null;})[_0xe833('0x27')](handleEntityNotFound(_0x1fe53a,null))[_0xe833('0x27')](function(_0x4b4f21){if(_0x4b4f21){_0x5f578e[_0xe833('0x72')]=_0x4b4f21[_0xe833('0x6d')]({'plain':!![]});interaction_log[_0xe833('0x15')](_0xe833('0x89'),_0x4ea1e2[_0xe833('0x59')]['id'],_0x4ea1e2['user'][_0xe833('0x2b')],_0x4ea1e2[_0xe833('0x59')][_0xe833('0x73')],_0x5f578e['interaction']['id'],_0x4ea1e2[_0xe833('0x45')]?JSON[_0xe833('0x67')](_0x4ea1e2[_0xe833('0x45')]):_0xe833('0x74'));return respondWithRpcPromise(_0xe833('0x8a'),_0xe833('0x8b'),_0x5f578e);}return null;})[_0xe833('0x27')](function(_0x2875a2){var _0x47a6f7=_0xe833('0x77')+_0x2875a2['message'][_0xe833('0x8c')];return db[_0xe833('0x78')][_0xe833('0x34')](_0x47a6f7,{'type':db[_0xe833('0x79')]['QueryTypes'][_0xe833('0x7b')],'raw':!![]})[_0xe833('0x27')](function(_0x2e346f){return _0x2e346f;});})[_0xe833('0x27')](function(_0x356bad){if(_0x356bad){_0x5f578e[_0xe833('0x1b')]['contact']=_0x356bad[0x0];if(!_0x4ea1e2[_0xe833('0x45')][_0xe833('0x6b')])return;return db[_0xe833('0x7d')][_0xe833('0x46')]({'where':{'id':_0x4ea1e2[_0xe833('0x45')][_0xe833('0x6b')],'role':_0xe833('0x6c')},'attributes':['id','name','fullname','email',_0xe833('0x8d')],'raw':!![]});}return null;})[_0xe833('0x27')](function(_0x326a8f){if(!_0x326a8f)return null;_0x5f578e[_0xe833('0x1b')][_0xe833('0x6c')]=_0x326a8f;return _0x5f578e;})['then'](function(_0x13f125){if(_0x13f125){_0x13f125[_0xe833('0x1b')][_0xe833('0x8e')]=util['format'](_0xe833('0x81'),_0x4ea1e2[_0xe833('0x59')]['name']);_0x13f125['message'][_0xe833('0x82')]=_0x5f578e[_0xe833('0x82')];_0x13f125[_0xe833('0x1b')][_0xe833('0x83')]=_0x5f578e[_0xe833('0x82')];_0x13f125[_0xe833('0x1b')]['event']=_0xe833('0x8f');_0x13f125['message'][_0xe833('0x45')]=htmlToText[_0xe833('0x85')](_0x5f578e[_0xe833('0x1b')][_0xe833('0x45')]);respondWithRpcPromise(_0xe833('0x86'),'EventManager',{'event':'rejectmessage','message':_0x13f125[_0xe833('0x1b')]},client9002);return _0x5f578e;}return null;})[_0xe833('0x27')](respondWithResult(_0x1fe53a,null))['catch'](handleError(_0x1fe53a,null));};exports['download']=function(_0xed06ba,_0x3b9ea9){var _0x61a831=moment()[_0xe833('0x90')]()[_0xe833('0x91')]();var _0x4ccb09=path['join'](config[_0xe833('0x92')],_0xe833('0x93'),'files','tmp');var _0x5e58dc=path[_0xe833('0x5d')](config[_0xe833('0x92')],'server',_0xe833('0x94'),'attachments');var _0x802961=util[_0xe833('0x65')]('message-%s.eml',_0x61a831);return db[_0xe833('0x2f')][_0xe833('0x46')]({'where':{'id':_0xed06ba[_0xe833('0x43')]['id']},'attributes':['id','body',_0xe833('0x95'),'to','cc','bcc',_0xe833('0x96'),_0xe833('0x97')],'include':_0xed06ba[_0xe833('0x34')][_0xe833('0x5c')]?[{'model':db[_0xe833('0x98')],'as':_0xe833('0x99')}]:undefined})[_0xe833('0x27')](handleEntityNotFound(_0x3b9ea9,null))[_0xe833('0x27')](function(_0xb9f57e){if(_0xb9f57e){var _0x452d7d=_0xb9f57e;var _0x47d870={'from':_0x452d7d[_0xe833('0x95')],'to':_0x452d7d['to'],'subject':_0x452d7d[_0xe833('0x96')],'html':htmlEntities[_0xe833('0x9a')](_0x452d7d[_0xe833('0x45')]),'headers':{'Date':moment(_0x452d7d[_0xe833('0x97')])[_0xe833('0x65')](_0xe833('0x9b'))},'attachments':[]};if(_0xb9f57e['cc']){_0x47d870[_0xe833('0x9c')]['Cc']=_0xb9f57e['cc'];}if(_0xb9f57e['bcc']){_0x47d870['headers']['Bcc']=_0xb9f57e[_0xe833('0x9d')];}return new BPromise(function(_0x319e2a,_0x4064c3){if(_0xb9f57e['Attachments']){for(var _0x14b07d=0x0;_0x14b07d<_0xb9f57e[_0xe833('0x99')]['length'];_0x14b07d++){var _0x1e6783=_0xb9f57e[_0xe833('0x99')][_0x14b07d];var _0x444915=path[_0xe833('0x5d')](_0x5e58dc,_0x1e6783[_0xe833('0x5f')]);if(fs[_0xe833('0x9e')](_0x444915)){_0x47d870['attachments'][_0xe833('0x9f')]({'name':_0x1e6783[_0xe833('0x2b')],'contentType':_0x1e6783[_0xe833('0x31')],'data':fs[_0xe833('0xa0')](_0x444915)});}}}emlformat[_0xe833('0xa1')](_0x47d870,function(_0x11ba53,_0x38d300){if(_0x11ba53)return _0x4064c3(_0x11ba53);fs[_0xe833('0xa2')](path[_0xe833('0x5d')](_0x4ccb09,_0x802961),_0x38d300);return _0x319e2a(_0x38d300);});});}})[_0xe833('0x27')](function(_0x3637f5){if(_0x3637f5){return _0x3b9ea9[_0xe833('0xa3')](path['join'](_0x4ccb09,_0x802961),_0x802961,function(_0x4d0517){if(!_0x4d0517)fs['unlinkSync'](path[_0xe833('0x5d')](_0x4ccb09,_0x802961));});}})[_0xe833('0x1d')](handleError(_0x3b9ea9,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index a5a2c55..1b5f096 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 _0xc4ef=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x4cae2b,_0x35c826){var _0x33b275=function(_0x134af3){while(--_0x134af3){_0x4cae2b['push'](_0x4cae2b['shift']());}};_0x33b275(++_0x35c826);}(_0xc4ef,0x130));var _0xfc4e=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xc4ef[_0x503564];return _0x4be9fd;};'use strict';var EventEmitter=require(_0xfc4e('0x0'));var MailMessage=require(_0xfc4e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfc4e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfc4e('0x3')};function emitEvent(_0x122e9e){return function(_0x2300bc,_0x407a51,_0x230581){MailMessageEvents[_0xfc4e('0x4')](_0x122e9e+':'+_0x2300bc['id'],_0x2300bc);MailMessageEvents[_0xfc4e('0x4')](_0x122e9e,_0x2300bc);_0x230581(null);};}for(var e in events){if(events[_0xfc4e('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xfc4e('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xd6f3=['MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6f3,0x1ca));var _0x3d6f=function(_0x45a571,_0x4989ea){_0x45a571=_0x45a571-0x0;var _0x42e2f4=_0xd6f3[_0x45a571];return _0x42e2f4;};'use strict';var EventEmitter=require(_0x3d6f('0x0'));var MailMessage=require(_0x3d6f('0x1'))['db'][_0x3d6f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3d6f('0x3')](0x0);var events={'afterCreate':_0x3d6f('0x4'),'afterUpdate':_0x3d6f('0x5'),'afterDestroy':_0x3d6f('0x6')};function emitEvent(_0x237ac1){return function(_0x4f2f47,_0x38d80c,_0x5654d1){MailMessageEvents[_0x3d6f('0x7')](_0x237ac1+':'+_0x4f2f47['id'],_0x4f2f47);MailMessageEvents[_0x3d6f('0x7')](_0x237ac1,_0x4f2f47);_0x5654d1(null);};}for(var e in events){if(events[_0x3d6f('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x3d6f('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 6fb53db..dd72779 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 _0x1500=['secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','out'];(function(_0x8f21d9,_0x5198d0){var _0x156ea6=function(_0x302ced){while(--_0x302ced){_0x8f21d9['push'](_0x8f21d9['shift']());}};_0x156ea6(++_0x5198d0);}(_0x1500,0xbb));var _0x0150=function(_0x24bdd5,_0x52dd27){_0x24bdd5=_0x24bdd5-0x0;var _0x38ee6a=_0x1500[_0x24bdd5];return _0x38ee6a;};'use strict';var _=require(_0x0150('0x0'));var util=require(_0x0150('0x1'));var logger=require('../../config/logger')(_0x0150('0x2'));var moment=require(_0x0150('0x3'));var BPromise=require(_0x0150('0x4'));var rp=require(_0x0150('0x5'));var htmlToText=require(_0x0150('0x6'));var fs=require('fs');var path=require(_0x0150('0x7'));var rimraf=require(_0x0150('0x8'));var config=require(_0x0150('0x9'));var attributes=require('./mailMessage.attributes');module[_0x0150('0xa')]=function(_0x58b489,_0x322d0d){return _0x58b489[_0x0150('0xb')]('MailMessage',attributes,{'tableName':_0x0150('0xc'),'paranoid':![],'indexes':[{'name':_0x0150('0xd'),'fields':[_0x0150('0xd')]},{'name':_0x0150('0xe'),'fields':[_0x0150('0xf'),_0x0150('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x461d8b,_0x6b982a,_0x3a1b01){if(_0x461d8b[_0x0150('0x11')]){_0x461d8b[_0x0150('0xf')]=htmlToText['fromString'](_0x461d8b[_0x0150('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3a1b01(null,_0x6b982a);},'afterCreate':function(_0x525112,_0x31a335,_0x779987){var _0x1c57e9=_0x58b489[_0x0150('0x12')];var _0x36e29f=_0x525112[_0x0150('0x13')]({'plain':!![]});if(_0x36e29f['direction']['toLowerCase']()==='in'||_0x36e29f[_0x0150('0x14')][_0x0150('0x15')]()===_0x0150('0x16')&&!_0x36e29f[_0x0150('0x17')]&&!_[_0x0150('0x18')](_0x36e29f[_0x0150('0x19')])){_0x1c57e9[_0x0150('0x1a')][_0x0150('0x1b')]({'where':{'id':_0x36e29f[_0x0150('0x1c')]}})[_0x0150('0x1d')](function(_0x10dc1d){if(_0x10dc1d){_0x10dc1d['update']({'lastMsgAt':_0x36e29f[_0x0150('0x1e')],'lastMsgDirection':_0x36e29f[_0x0150('0x14')][_0x0150('0x15')]()});}})[_0x0150('0x1f')](function(_0x4c63ed){console[_0x0150('0x20')](_0x4c63ed);});}_0x779987();}},'charset':_0x0150('0x21'),'collate':_0x0150('0x22')});}; \ No newline at end of file +var _0x91a7=['error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','plainBody','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch'];(function(_0x4c4aa4,_0x1919fe){var _0x26f462=function(_0x1fb813){while(--_0x1fb813){_0x4c4aa4['push'](_0x4c4aa4['shift']());}};_0x26f462(++_0x1919fe);}(_0x91a7,0x16b));var _0x791a=function(_0x343bd9,_0x5691e8){_0x343bd9=_0x343bd9-0x0;var _0x573c69=_0x91a7[_0x343bd9];return _0x573c69;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require('../../config/logger')(_0x791a('0x1'));var moment=require(_0x791a('0x2'));var BPromise=require(_0x791a('0x3'));var rp=require(_0x791a('0x4'));var htmlToText=require(_0x791a('0x5'));var fs=require('fs');var path=require(_0x791a('0x6'));var rimraf=require(_0x791a('0x7'));var config=require(_0x791a('0x8'));var attributes=require(_0x791a('0x9'));module[_0x791a('0xa')]=function(_0x36f414,_0x4fa6ba){return _0x36f414[_0x791a('0xb')](_0x791a('0xc'),attributes,{'tableName':_0x791a('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x791a('0xe')]},{'name':'fti_mail_messages','fields':['plainBody',_0x791a('0xf')],'type':_0x791a('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x631260,_0x4ed89b,_0x1751c5){if(_0x631260[_0x791a('0x11')]){_0x631260[_0x791a('0x12')]=htmlToText[_0x791a('0x13')](_0x631260[_0x791a('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1751c5(null,_0x4ed89b);},'afterCreate':function(_0x38a207,_0x1cc2e5,_0x52c333){var _0x4891fe=_0x36f414[_0x791a('0x14')];var _0x49861f=_0x38a207['get']({'plain':!![]});if(_0x49861f[_0x791a('0x15')][_0x791a('0x16')]()==='in'||_0x49861f[_0x791a('0x15')][_0x791a('0x16')]()===_0x791a('0x17')&&!_0x49861f[_0x791a('0x18')]&&!_[_0x791a('0x19')](_0x49861f[_0x791a('0x1a')])){_0x4891fe['MailInteraction'][_0x791a('0x1b')]({'where':{'id':_0x49861f[_0x791a('0x1c')]}})[_0x791a('0x1d')](function(_0x3ae388){if(_0x3ae388){_0x3ae388[_0x791a('0x1e')]({'lastMsgAt':_0x49861f[_0x791a('0x1f')],'lastMsgDirection':_0x49861f[_0x791a('0x15')][_0x791a('0x16')]()});}})[_0x791a('0x20')](function(_0x30e4ad){console[_0x791a('0x21')](_0x30e4ad);});}_0x52c333();}},'charset':_0x791a('0x22'),'collate':_0x791a('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 61bdc83..48c8f01 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 _0xc900=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','body','options','raw','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xc900,0xb3));var _0x0c90=function(_0x571ecf,_0x3d6a38){_0x571ecf=_0x571ecf-0x0;var _0x52d094=_0xc900[_0x571ecf];return _0x52d094;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});config[_0x0c90('0xa')]=_['defaults'](config[_0x0c90('0xa')],{'host':_0x0c90('0xb'),'port':0x18eb});var socket=require(_0x0c90('0xc'))(new Redis(config[_0x0c90('0xa')]));require(_0x0c90('0xd'))[_0x0c90('0xe')](socket);function respondWithRpcPromise(_0x313ce9,_0x18d9fd,_0x3e0df6){return new BPromise(function(_0x34456e,_0x10daeb){return client[_0x0c90('0xf')](_0x313ce9,_0x3e0df6)[_0x0c90('0x10')](function(_0x57917b){logger[_0x0c90('0x11')]('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x0c90('0x12'));logger['debug'](_0x0c90('0x13'),_0x18d9fd,_0x0c90('0x12'),JSON[_0x0c90('0x14')](_0x57917b));if(_0x57917b[_0x0c90('0x15')]){if(_0x57917b[_0x0c90('0x15')]['code']===0x1f4){logger[_0x0c90('0x15')](_0x0c90('0x16'),_0x18d9fd,_0x57917b['error'][_0x0c90('0x17')]);return _0x10daeb(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);return _0x34456e(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}else{logger[_0x0c90('0x11')](_0x0c90('0x16'),_0x18d9fd,_0x0c90('0x12'));_0x34456e(_0x57917b['result'][_0x0c90('0x17')]);}})[_0x0c90('0x18')](function(_0x462d49){logger[_0x0c90('0x15')]('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x462d49);_0x10daeb(_0x462d49);});});}exports[_0x0c90('0x19')]=function(_0xd129ca){var _0x143047=this;return new Promise(function(_0x1241a9,_0x315932){return db[_0x0c90('0x1a')]['create'](_0xd129ca[_0x0c90('0x1b')],{'raw':_0xd129ca['options']?_0xd129ca[_0x0c90('0x1c')][_0x0c90('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2a053a){logger[_0x0c90('0x11')](_0x0c90('0x19'),_0xd129ca);logger[_0x0c90('0x1e')](_0x0c90('0x19'),_0xd129ca,JSON[_0x0c90('0x14')](_0x2a053a));_0x1241a9(_0x2a053a);})['catch'](function(_0x26f0a3){logger[_0x0c90('0x15')]('CreateMailMessage',_0x26f0a3['message'],_0xd129ca);_0x315932(_0x143047[_0x0c90('0x15')](0x1f4,_0x26f0a3[_0x0c90('0x17')]));});});}; \ No newline at end of file +var _0x3266=['result','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0x3266,0x6a));var _0x6326=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x3266[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});config[_0x6326('0xc')]=_['defaults'](config[_0x6326('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6326('0xd'))(new Redis(config[_0x6326('0xc')]));require(_0x6326('0xe'))[_0x6326('0xf')](socket);function respondWithRpcPromise(_0x37a23d,_0x53c3e1,_0x1b45a7){return new BPromise(function(_0x464a36,_0x3590ab){return client[_0x6326('0x10')](_0x37a23d,_0x1b45a7)[_0x6326('0x11')](function(_0x3b056c){logger[_0x6326('0x12')](_0x6326('0x13'),_0x53c3e1,_0x6326('0x14'));logger[_0x6326('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x53c3e1,'request\x20sent',JSON[_0x6326('0x16')](_0x3b056c));if(_0x3b056c[_0x6326('0x17')]){if(_0x3b056c['error'][_0x6326('0x18')]===0x1f4){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);return _0x3590ab(_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);}logger[_0x6326('0x17')]('MailMessage,\x20%s,\x20%s',_0x53c3e1,_0x3b056c[_0x6326('0x17')]['message']);return _0x464a36(_0x3b056c['error']['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x53c3e1,'request\x20sent');_0x464a36(_0x3b056c[_0x6326('0x1a')][_0x6326('0x19')]);}})[_0x6326('0x1b')](function(_0x556c4e){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x556c4e);_0x3590ab(_0x556c4e);});});}exports[_0x6326('0x1c')]=function(_0x272b5c){var _0x3db834=this;return new Promise(function(_0x3c08db,_0x25957a){return db[_0x6326('0x1d')]['create'](_0x272b5c[_0x6326('0x1e')],{'raw':_0x272b5c['options']?_0x272b5c[_0x6326('0x1f')][_0x6326('0x20')]===undefined?!![]:![]:!![]})[_0x6326('0x11')](function(_0x24fb78){logger[_0x6326('0x12')](_0x6326('0x1c'),_0x272b5c);logger[_0x6326('0x15')](_0x6326('0x1c'),_0x272b5c,JSON[_0x6326('0x16')](_0x24fb78));_0x3c08db(_0x24fb78);})[_0x6326('0x1b')](function(_0x34954b){logger['error'](_0x6326('0x1c'),_0x34954b[_0x6326('0x19')],_0x272b5c);_0x25957a(_0x3db834['error'](0x1f4,_0x34954b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b1fbcfc..c94e5a2 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 _0x760b=['register','length','save','remove','update','emit','removeListener'];(function(_0x194527,_0x42d679){var _0x24666a=function(_0x4e163f){while(--_0x4e163f){_0x194527['push'](_0x194527['shift']());}};_0x24666a(++_0x42d679);}(_0x760b,0x95));var _0xb760=function(_0x3190ec,_0x57c31d){_0x3190ec=_0x3190ec-0x0;var _0x570986=_0x760b[_0x3190ec];return _0x570986;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xb760('0x0'),_0xb760('0x1'),_0xb760('0x2')];function createListener(_0x234e72,_0x4d184f){return function(_0x54f509){_0x4d184f[_0xb760('0x3')](_0x234e72,_0x54f509);};}function removeListener(_0x8015b0,_0x46d654){return function(){MailMessageEvents[_0xb760('0x4')](_0x8015b0,_0x46d654);};}exports[_0xb760('0x5')]=function(_0x460bea){for(var _0x537214=0x0,_0x32e172=events[_0xb760('0x6')];_0x537214<_0x32e172;_0x537214++){var _0x143716=events[_0x537214];var _0xb100aa=createListener('mailMessage:'+_0x143716,_0x460bea);MailMessageEvents['on'](_0x143716,_0xb100aa);}}; \ No newline at end of file +var _0x63c5=['register','mailMessage:','remove','update'];(function(_0x33b34e,_0x5f2983){var _0x205ba2=function(_0x538981){while(--_0x538981){_0x33b34e['push'](_0x33b34e['shift']());}};_0x205ba2(++_0x5f2983);}(_0x63c5,0xde));var _0x563c=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x63c5[_0x259d17];return _0x407535;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x563c('0x0'),_0x563c('0x1')];function createListener(_0xc936c6,_0x1370fa){return function(_0x4c4b54){_0x1370fa['emit'](_0xc936c6,_0x4c4b54);};}function removeListener(_0x31a098,_0x3e4756){return function(){MailMessageEvents['removeListener'](_0x31a098,_0x3e4756);};}exports[_0x563c('0x2')]=function(_0xa046f1){for(var _0x2ee56f=0x0,_0x2e0232=events['length'];_0x2ee56f<_0x2e0232;_0x2ee56f++){var _0x117214=events[_0x2ee56f];var _0x48b80e=createListener(_0x563c('0x3')+_0x117214,_0xa046f1);MailMessageEvents['on'](_0x117214,_0x48b80e);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e80d90e..9862d50 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 _0x3fc8=['/:id/users','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams','getTeams'];(function(_0x136982,_0x687da){var _0x7e639b=function(_0x3f92cf){while(--_0x3f92cf){_0x136982['push'](_0x136982['shift']());}};_0x7e639b(++_0x687da);}(_0x3fc8,0x142));var _0x83fc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x3fc8[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x83fc('0x0'));var util=require(_0x83fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x83fc('0x2'));var router=express[_0x83fc('0x3')]();var fs_extra=require(_0x83fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x83fc('0x5'));var config=require(_0x83fc('0x6'));var controller=require(_0x83fc('0x7'));router[_0x83fc('0x8')]('/',auth[_0x83fc('0x9')](),controller[_0x83fc('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x83fc('0x8')](_0x83fc('0xb'),auth[_0x83fc('0x9')](),controller[_0x83fc('0xc')]);router[_0x83fc('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x83fc('0xd')]);router['get'](_0x83fc('0xe'),auth[_0x83fc('0x9')](),controller[_0x83fc('0xf')]);router[_0x83fc('0x8')](_0x83fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x83fc('0x11')]('/',auth[_0x83fc('0x9')](),controller[_0x83fc('0x12')]);router[_0x83fc('0x11')](_0x83fc('0xe'),auth[_0x83fc('0x9')](),controller['addTeams']);router[_0x83fc('0x11')](_0x83fc('0x10'),auth[_0x83fc('0x9')](),controller[_0x83fc('0x13')]);router[_0x83fc('0x14')](_0x83fc('0xb'),auth[_0x83fc('0x9')](),controller[_0x83fc('0x15')]);router[_0x83fc('0x16')](_0x83fc('0xb'),auth[_0x83fc('0x9')](),controller['destroy']);router[_0x83fc('0x16')](_0x83fc('0xe'),auth['isAuthenticated'](),controller[_0x83fc('0x17')]);router[_0x83fc('0x16')](_0x83fc('0x10'),auth[_0x83fc('0x9')](),controller[_0x83fc('0x18')]);module[_0x83fc('0x19')]=router; \ No newline at end of file +var _0x9c14=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x1b0379,_0x140f83){var _0x468957=function(_0x25d1dc){while(--_0x25d1dc){_0x1b0379['push'](_0x1b0379['shift']());}};_0x468957(++_0x140f83);}(_0x9c14,0x193));var _0x49c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c14[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x49c1('0x0'));var util=require(_0x49c1('0x1'));var path=require(_0x49c1('0x2'));var timeout=require('connect-timeout');var express=require(_0x49c1('0x3'));var router=express[_0x49c1('0x4')]();var fs_extra=require(_0x49c1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x49c1('0x6'));var config=require(_0x49c1('0x7'));var controller=require(_0x49c1('0x8'));router[_0x49c1('0x9')]('/',auth[_0x49c1('0xa')](),controller['index']);router[_0x49c1('0x9')](_0x49c1('0xb'),auth['isAuthenticated'](),controller[_0x49c1('0xc')]);router[_0x49c1('0x9')]('/:id',auth[_0x49c1('0xa')](),controller[_0x49c1('0xd')]);router[_0x49c1('0x9')](_0x49c1('0xe'),auth[_0x49c1('0xa')](),controller[_0x49c1('0xf')]);router[_0x49c1('0x9')](_0x49c1('0x10'),auth['isAuthenticated'](),controller[_0x49c1('0x11')]);router['get'](_0x49c1('0x12'),auth[_0x49c1('0xa')](),controller[_0x49c1('0x13')]);router['post']('/',auth[_0x49c1('0xa')](),controller[_0x49c1('0x14')]);router[_0x49c1('0x15')](_0x49c1('0x10'),auth[_0x49c1('0xa')](),controller[_0x49c1('0x16')]);router['post']('/:id/users',auth[_0x49c1('0xa')](),controller[_0x49c1('0x17')]);router[_0x49c1('0x18')](_0x49c1('0x19'),auth['isAuthenticated'](),controller[_0x49c1('0x1a')]);router['delete']('/:id',auth[_0x49c1('0xa')](),controller[_0x49c1('0x1b')]);router[_0x49c1('0x1c')](_0x49c1('0x10'),auth['isAuthenticated'](),controller[_0x49c1('0x1d')]);router[_0x49c1('0x1c')](_0x49c1('0x12'),auth['isAuthenticated'](),controller[_0x49c1('0x1e')]);module[_0x49c1('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0667550..7989aee 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 _0x82c7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x29e54f,_0x33535a){var _0x4c619f=function(_0xc98342){while(--_0xc98342){_0x29e54f['push'](_0x29e54f['shift']());}};_0x4c619f(++_0x33535a);}(_0x82c7,0x10b));var _0x782c=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x82c7[_0x5b5eb4];return _0x42af53;};'use strict';var Sequelize=require(_0x782c('0x0'));module[_0x782c('0x1')]={'name':{'type':Sequelize[_0x782c('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x782c('0x2')]},'timeout':{'type':Sequelize[_0x782c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x782c('0x4')](_0x782c('0x5'),_0x782c('0x6'),_0x782c('0x7'))}}; \ No newline at end of file +var _0xa449=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x58a330,_0xea6283){var _0xa05a2a=function(_0x37d8f5){while(--_0x37d8f5){_0x58a330['push'](_0x58a330['shift']());}};_0xa05a2a(++_0xea6283);}(_0xa449,0x143));var _0x9a44=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa449[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x9a44('0x0'));module[_0x9a44('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a44('0x2')]},'timeout':{'type':Sequelize[_0x9a44('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a44('0x4')](_0x9a44('0x5'),'beepall',_0x9a44('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 33133d0..c3c1f59 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 _0x1798=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserMailQueue','order','pick','MailQueueId','filter','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','offset','limit','count','status','set','Content-Range','reject','then','destroy','MailQueues','UserProfileResource','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','options','MailQueue','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1798,0x1d6));var _0x8179=function(_0x31b8b4,_0x208ba5){_0x31b8b4=_0x31b8b4-0x0;var _0x54a235=_0x1798[_0x31b8b4];return _0x54a235;};'use strict';var emlformat=require(_0x8179('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8179('0x1'));var jsonpatch=require(_0x8179('0x2'));var rp=require('request-promise');var moment=require(_0x8179('0x3'));var BPromise=require(_0x8179('0x4'));var Mustache=require(_0x8179('0x5'));var util=require(_0x8179('0x6'));var path=require('path');var sox=require(_0x8179('0x7'));var csv=require(_0x8179('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8179('0x9'));var squel=require(_0x8179('0xa'));var crypto=require('crypto');var jsforce=require(_0x8179('0xb'));var deskjs=require(_0x8179('0xc'));var toCsv=require(_0x8179('0x8'));var querystring=require(_0x8179('0xd'));var Papa=require(_0x8179('0xe'));var Redis=require('ioredis');var authService=require(_0x8179('0xf'));var qs=require(_0x8179('0x10'));var as=require(_0x8179('0x11'));var hardwareService=require(_0x8179('0x12'));var logger=require(_0x8179('0x13'))('api');var utils=require(_0x8179('0x14'));var config=require(_0x8179('0x15'));var licenseUtil=require(_0x8179('0x16'));var db=require(_0x8179('0x17'))['db'];config[_0x8179('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8179('0x19'))(new Redis(config[_0x8179('0x18')]));require('./mailQueue.socket')[_0x8179('0x1a')](socket);function respondWithStatusCode(_0x90b00,_0x17279f){_0x17279f=_0x17279f||0xcc;return function(_0x107583){if(_0x107583){return _0x90b00['sendStatus'](_0x17279f);}return _0x90b00['status'](_0x17279f)['end']();};}function respondWithResult(_0x2ecd53,_0x46da7c){_0x46da7c=_0x46da7c||0xc8;return function(_0xc1c396){if(_0xc1c396){return _0x2ecd53['status'](_0x46da7c)['json'](_0xc1c396);}};}function respondWithFilteredResult(_0x59a92e,_0x498f57){return function(_0x430dcf){if(_0x430dcf){var _0x50084a=typeof _0x498f57[_0x8179('0x1b')]==='undefined'&&typeof _0x498f57[_0x8179('0x1c')]==='undefined';var _0x5e0848=_0x430dcf[_0x8179('0x1d')];var _0x36b7bd=_0x50084a?0x0:_0x498f57[_0x8179('0x1b')];var _0x5f3bc8=_0x50084a?_0x430dcf[_0x8179('0x1d')]:_0x498f57[_0x8179('0x1b')]+_0x498f57[_0x8179('0x1c')];var _0x2531ee;if(_0x5f3bc8>=_0x5e0848){_0x5f3bc8=_0x5e0848;_0x2531ee=0xc8;}else{_0x2531ee=0xce;}_0x59a92e[_0x8179('0x1e')](_0x2531ee);return _0x59a92e[_0x8179('0x1f')](_0x8179('0x20'),_0x36b7bd+'-'+_0x5f3bc8+'/'+_0x5e0848)['json'](_0x430dcf);}return null;};}function patchUpdates(_0x331559){return function(_0x3e2a82){try{jsonpatch['apply'](_0x3e2a82,_0x331559,!![]);}catch(_0x156861){return BPromise[_0x8179('0x21')](_0x156861);}return _0x3e2a82['save']();};}function saveUpdates(_0x2ae65a,_0x587fa1){return function(_0x2ea8bb){if(_0x2ea8bb){return _0x2ea8bb['update'](_0x2ae65a)[_0x8179('0x22')](function(_0x4d1a0b){return _0x4d1a0b;});}return null;};}function removeEntity(_0x2819d7,_0x1ea4db){return function(_0x4cbe64){if(_0x4cbe64){return _0x4cbe64[_0x8179('0x23')]()['then'](function(){var _0x46da77=_0x4cbe64['get']({'plain':!![]});var _0x3e078a=_0x8179('0x24');return db[_0x8179('0x25')][_0x8179('0x23')]({'where':{'type':_0x3e078a,'resourceId':_0x46da77['id']}})[_0x8179('0x22')](function(){return _0x4cbe64;});})[_0x8179('0x22')](function(){_0x2819d7[_0x8179('0x1e')](0xcc)[_0x8179('0x26')]();});}};}function handleEntityNotFound(_0x4b2e1a,_0x2693e4){return function(_0x35a265){if(!_0x35a265){_0x4b2e1a[_0x8179('0x27')](0x194);}return _0x35a265;};}function handleError(_0x4722b1,_0x54993b){_0x54993b=_0x54993b||0x1f4;return function(_0x29e0a7){logger[_0x8179('0x28')](_0x29e0a7[_0x8179('0x29')]);if(_0x29e0a7[_0x8179('0x2a')]){delete _0x29e0a7[_0x8179('0x2a')];}_0x4722b1[_0x8179('0x1e')](_0x54993b)['send'](_0x29e0a7);};}exports[_0x8179('0x2b')]=function(_0x10d6a1,_0x54ef15){var _0x5240a4={},_0x2679ee={},_0x17d6fc={'count':0x0,'rows':[]};var _0x38220e=_[_0x8179('0x2c')](db['MailQueue'][_0x8179('0x2d')],function(_0x1dbc72){return{'name':_0x1dbc72[_0x8179('0x2e')],'type':_0x1dbc72[_0x8179('0x2f')][_0x8179('0x30')]};});_0x2679ee[_0x8179('0x31')]=_[_0x8179('0x2c')](_0x38220e,_0x8179('0x2a'));_0x2679ee['query']=_[_0x8179('0x32')](_0x10d6a1[_0x8179('0x33')]);_0x2679ee[_0x8179('0x34')]=_[_0x8179('0x35')](_0x2679ee[_0x8179('0x31')],_0x2679ee[_0x8179('0x33')]);_0x5240a4[_0x8179('0x36')]=_[_0x8179('0x35')](_0x2679ee[_0x8179('0x31')],qs[_0x8179('0x37')](_0x10d6a1[_0x8179('0x33')]['fields']));_0x5240a4['attributes']=_0x5240a4[_0x8179('0x36')][_0x8179('0x38')]?_0x5240a4['attributes']:_0x2679ee[_0x8179('0x31')];if(!_0x10d6a1[_0x8179('0x33')][_0x8179('0x39')](_0x8179('0x3a'))){_0x5240a4['limit']=qs[_0x8179('0x1c')](_0x10d6a1[_0x8179('0x33')]['limit']);_0x5240a4[_0x8179('0x1b')]=qs[_0x8179('0x1b')](_0x10d6a1[_0x8179('0x33')]['offset']);}_0x5240a4['order']=qs[_0x8179('0x3b')](_0x10d6a1[_0x8179('0x33')][_0x8179('0x3b')]);_0x5240a4[_0x8179('0x3c')]=qs['filters'](_['pick'](_0x10d6a1['query'],_0x2679ee[_0x8179('0x34')]),_0x38220e);if(_0x10d6a1[_0x8179('0x33')]['filter']){_0x5240a4[_0x8179('0x3c')]=_[_0x8179('0x3d')](_0x5240a4[_0x8179('0x3c')],{'$or':_['map'](_0x38220e,function(_0x1995fc){if(_0x1995fc[_0x8179('0x2f')]!=='VIRTUAL'){var _0x16fd3d={};_0x16fd3d[_0x1995fc[_0x8179('0x2a')]]={'$like':'%'+_0x10d6a1[_0x8179('0x33')]['filter']+'%'};return _0x16fd3d;}})});}_0x5240a4=_['merge']({},_0x5240a4,_0x10d6a1[_0x8179('0x3e')]);var _0x30c418={'where':_0x5240a4[_0x8179('0x3c')]};return db[_0x8179('0x3f')]['count'](_0x30c418)[_0x8179('0x22')](function(_0x572dfb){_0x17d6fc[_0x8179('0x1d')]=_0x572dfb;if(_0x10d6a1[_0x8179('0x33')][_0x8179('0x40')]){_0x5240a4[_0x8179('0x41')]=[{'all':!![]}];}return db[_0x8179('0x3f')][_0x8179('0x42')](_0x5240a4);})['then'](function(_0x4371c1){_0x17d6fc[_0x8179('0x43')]=_0x4371c1;return _0x17d6fc;})[_0x8179('0x22')](respondWithFilteredResult(_0x54ef15,_0x5240a4))[_0x8179('0x44')](handleError(_0x54ef15,null));};exports[_0x8179('0x45')]=function(_0x2475d0,_0x252718){var _0x54507c={'raw':!![],'where':{'id':_0x2475d0['params']['id']}},_0x4d39f4={};_0x4d39f4[_0x8179('0x31')]=_[_0x8179('0x32')](db['MailQueue'][_0x8179('0x2d')]);_0x4d39f4[_0x8179('0x33')]=_['keys'](_0x2475d0[_0x8179('0x33')]);_0x4d39f4[_0x8179('0x34')]=_[_0x8179('0x35')](_0x4d39f4[_0x8179('0x31')],_0x4d39f4[_0x8179('0x33')]);_0x54507c[_0x8179('0x36')]=_[_0x8179('0x35')](_0x4d39f4[_0x8179('0x31')],qs[_0x8179('0x37')](_0x2475d0[_0x8179('0x33')]['fields']));_0x54507c[_0x8179('0x36')]=_0x54507c[_0x8179('0x36')]['length']?_0x54507c['attributes']:_0x4d39f4['model'];if(_0x2475d0['query'][_0x8179('0x40')]){_0x54507c['include']=[{'all':!![]}];}_0x54507c=_[_0x8179('0x3d')]({},_0x54507c,_0x2475d0[_0x8179('0x3e')]);return db[_0x8179('0x3f')][_0x8179('0x46')](_0x54507c)[_0x8179('0x22')](handleEntityNotFound(_0x252718,null))['then'](respondWithResult(_0x252718,null))[_0x8179('0x44')](handleError(_0x252718,null));};exports[_0x8179('0x47')]=function(_0x2760dc,_0x5523dc){return db['MailQueue'][_0x8179('0x47')](_0x2760dc[_0x8179('0x48')],{})[_0x8179('0x22')](function(_0x5aa513){var _0x5bd55a=_0x2760dc[_0x8179('0x49')][_0x8179('0x4a')]({'plain':!![]});if(!_0x5bd55a)throw new Error(_0x8179('0x4b'));if(_0x5bd55a[_0x8179('0x4c')]==='user'){var _0x23cb1c=_0x5aa513[_0x8179('0x4a')]({'plain':!![]});var _0xec73b9=_0x8179('0x24');return db['UserProfileSection'][_0x8179('0x46')]({'where':{'name':_0xec73b9,'userProfileId':_0x5bd55a[_0x8179('0x4d')]},'raw':!![]})[_0x8179('0x22')](function(_0x40bfe0){if(_0x40bfe0&&_0x40bfe0[_0x8179('0x4e')]===0x0){return db[_0x8179('0x25')][_0x8179('0x47')]({'name':_0x23cb1c[_0x8179('0x2a')],'resourceId':_0x23cb1c['id'],'type':_0x40bfe0[_0x8179('0x2a')],'sectionId':_0x40bfe0['id']},{})[_0x8179('0x22')](function(){return _0x5aa513;});}else{return _0x5aa513;}})[_0x8179('0x44')](function(_0x132864){logger[_0x8179('0x28')](_0x8179('0x4f'),_0x132864);throw _0x132864;});}return _0x5aa513;})[_0x8179('0x22')](respondWithResult(_0x5523dc,0xc9))[_0x8179('0x44')](handleError(_0x5523dc,null));};exports['update']=function(_0x3cd173,_0x11a8a2){if(_0x3cd173['body']['id']){delete _0x3cd173[_0x8179('0x48')]['id'];}return db[_0x8179('0x3f')][_0x8179('0x46')]({'where':{'id':_0x3cd173[_0x8179('0x50')]['id']}})['then'](handleEntityNotFound(_0x11a8a2,null))[_0x8179('0x22')](saveUpdates(_0x3cd173['body'],null))[_0x8179('0x22')](respondWithResult(_0x11a8a2,null))[_0x8179('0x44')](handleError(_0x11a8a2,null));};exports[_0x8179('0x23')]=function(_0x513d1a,_0x418d12){return db[_0x8179('0x3f')]['find']({'where':{'id':_0x513d1a[_0x8179('0x50')]['id']}})['then'](handleEntityNotFound(_0x418d12,null))[_0x8179('0x22')](removeEntity(_0x418d12,null))[_0x8179('0x44')](handleError(_0x418d12,null));};exports[_0x8179('0x51')]=function(_0xdafabd,_0x298890){return db[_0x8179('0x3f')][_0x8179('0x51')]()[_0x8179('0x22')](respondWithResult(_0x298890,null))['catch'](handleError(_0x298890,null));};exports[_0x8179('0x52')]=function(_0x4a0042,_0x5a2ab0,_0x4d1cfa){var _0x8cebc0={'raw':!![],'where':{}},_0x367929={},_0x3878e7;return db[_0x8179('0x3f')]['findOne']({'where':{'id':_0x4a0042[_0x8179('0x50')]['id']}})[_0x8179('0x22')](handleEntityNotFound(_0x5a2ab0,null))[_0x8179('0x22')](function(_0x32ef3b){if(_0x32ef3b){_0x3878e7=_0x32ef3b[_0x8179('0x4a')]({'plain':!![]});_0x367929[_0x8179('0x31')]=_[_0x8179('0x32')](db[_0x8179('0x53')][_0x8179('0x2d')]);_0x367929[_0x8179('0x33')]=_['keys'](_0x4a0042[_0x8179('0x33')]);_0x367929[_0x8179('0x34')]=_[_0x8179('0x35')](_0x367929[_0x8179('0x31')],_0x367929['query']);_0x8cebc0[_0x8179('0x36')]=_[_0x8179('0x35')](_0x367929[_0x8179('0x31')],qs[_0x8179('0x37')](_0x4a0042[_0x8179('0x33')][_0x8179('0x37')]));_0x8cebc0['attributes']=_0x8cebc0[_0x8179('0x36')][_0x8179('0x38')]?_0x8cebc0[_0x8179('0x36')]:_0x367929[_0x8179('0x31')];if(!_0x4a0042['query'][_0x8179('0x39')](_0x8179('0x3a'))){_0x8cebc0[_0x8179('0x1c')]=qs[_0x8179('0x1c')](_0x4a0042['query'][_0x8179('0x1c')]);_0x8cebc0[_0x8179('0x1b')]=qs['offset'](_0x4a0042[_0x8179('0x33')][_0x8179('0x1b')]);}_0x8cebc0[_0x8179('0x54')]=qs['sort'](_0x4a0042[_0x8179('0x33')]['sort']);_0x8cebc0['where']=qs[_0x8179('0x34')](_[_0x8179('0x55')](_0x4a0042[_0x8179('0x33')],_0x367929[_0x8179('0x34')]));_0x8cebc0['where'][_0x8179('0x56')]=_0x32ef3b['id'];if(_0x4a0042['query'][_0x8179('0x57')]){_0x8cebc0[_0x8179('0x3c')]=_[_0x8179('0x3d')](_0x8cebc0['where'],{'$or':_['map'](_0x8cebc0[_0x8179('0x36')],function(_0x4bcf9d){var _0x5e205c={};_0x5e205c[_0x4bcf9d]={'$like':'%'+_0x4a0042[_0x8179('0x33')]['filter']+'%'};return _0x5e205c;})});}_0x8cebc0=_['merge']({},_0x8cebc0,_0x4a0042[_0x8179('0x3e')]);return db[_0x8179('0x53')]['findAll'](_0x8cebc0);}})[_0x8179('0x22')](function(_0xda77da){if(_0xda77da){return db['User'][_0x8179('0x58')]({'where':{'id':_[_0x8179('0x2c')](_0xda77da,_0x8179('0x59')),'role':_0x8179('0x5a')},'attributes':['id',_0x8179('0x2a'),_0x8179('0x5b'),_0x8179('0x5c'),_0x8179('0x5d')]});}})[_0x8179('0x22')](function(_0x298e21){if(_0x298e21){return{'count':_0x298e21[_0x8179('0x1d')],'rows':_[_0x8179('0x2c')](_0x298e21['rows'],function(_0x26304d){return{'membername':_0x26304d[_0x8179('0x2a')],'UserId':_0x26304d['id'],'queue_name':_0x3878e7['name'],'MailQueueId':_0x3878e7['id'],'interface':util[_0x8179('0x5e')](_0x8179('0x5f'),_0x8179('0x60'),_0x26304d[_0x8179('0x2a')]),'penalty':0x0,'paused':_0x26304d[_0x8179('0x5b')],'createdAt':_0x26304d[_0x8179('0x5d')],'updatedAt':_0x26304d[_0x8179('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8179('0x22')](respondWithFilteredResult(_0x5a2ab0,_0x8cebc0))['catch'](handleError(_0x5a2ab0,null));};exports[_0x8179('0x61')]=function(_0x45094f,_0x5cdb8d,_0x401c97){var _0x11fe69={};var _0x216025={};var _0x13ebd3;var _0x2d9149;return db['MailQueue'][_0x8179('0x62')]({'where':{'id':_0x45094f[_0x8179('0x50')]['id']}})[_0x8179('0x22')](handleEntityNotFound(_0x5cdb8d,null))[_0x8179('0x22')](function(_0xcf54e5){if(_0xcf54e5){_0x13ebd3=_0xcf54e5;_0x216025[_0x8179('0x31')]=_[_0x8179('0x32')](db[_0x8179('0x63')][_0x8179('0x2d')]);_0x216025[_0x8179('0x33')]=_[_0x8179('0x32')](_0x45094f[_0x8179('0x33')]);_0x216025[_0x8179('0x34')]=_['intersection'](_0x216025[_0x8179('0x31')],_0x216025[_0x8179('0x33')]);_0x11fe69[_0x8179('0x36')]=_[_0x8179('0x35')](_0x216025['model'],qs[_0x8179('0x37')](_0x45094f[_0x8179('0x33')][_0x8179('0x37')]));_0x11fe69[_0x8179('0x36')]=_0x11fe69[_0x8179('0x36')][_0x8179('0x38')]?_0x11fe69['attributes']:_0x216025[_0x8179('0x31')];_0x11fe69[_0x8179('0x54')]=qs[_0x8179('0x3b')](_0x45094f[_0x8179('0x33')]['sort']);_0x11fe69['where']=qs['filters'](_[_0x8179('0x55')](_0x45094f[_0x8179('0x33')],_0x216025[_0x8179('0x34')]));if(_0x45094f[_0x8179('0x33')][_0x8179('0x57')]){_0x11fe69[_0x8179('0x3c')]=_['merge'](_0x11fe69[_0x8179('0x3c')],{'$or':_[_0x8179('0x2c')](_0x11fe69[_0x8179('0x36')],function(_0x45c5de){var _0x4ff779={};_0x4ff779[_0x45c5de]={'$like':'%'+_0x45094f[_0x8179('0x33')]['filter']+'%'};return _0x4ff779;})});}_0x11fe69=_['merge']({},_0x11fe69,_0x45094f['options']);return _0x13ebd3[_0x8179('0x61')](_0x11fe69);}})[_0x8179('0x22')](function(_0xb7eae){if(_0xb7eae){_0x2d9149=_0xb7eae[_0x8179('0x38')];if(!_0x45094f['query']['hasOwnProperty'](_0x8179('0x3a'))){_0x11fe69['limit']=qs[_0x8179('0x1c')](_0x45094f['query']['limit']);_0x11fe69['offset']=qs[_0x8179('0x1b')](_0x45094f[_0x8179('0x33')][_0x8179('0x1b')]);}return _0x13ebd3['getTeams'](_0x11fe69);}})[_0x8179('0x22')](function(_0x17b2f9){if(_0x17b2f9){return _0x17b2f9?{'count':_0x2d9149,'rows':_0x17b2f9}:null;}})[_0x8179('0x22')](respondWithResult(_0x5cdb8d,null))[_0x8179('0x44')](handleError(_0x5cdb8d,null));};exports[_0x8179('0x64')]=function(_0x4839bc,_0x4b5368,_0x3fd580){var _0xb10167=_0x4839bc['body']['ids'];return db['Team'][_0x8179('0x42')]({'where':{'id':_0xb10167},'attributes':['id'],'include':[{'model':db[_0x8179('0x65')],'as':_0x8179('0x66'),'attributes':['id',_0x8179('0x2a'),_0x8179('0x67'),_0x8179('0x68'),_0x8179('0x69')],'raw':!![]}]})['then'](function(_0xfb513b){if(_0xfb513b){var _0x2c606a=_['flatMap'](_0xfb513b,function(_0x238131){var _0x459d1d=_0x238131['get']({'plain':!![]});return _0x459d1d[_0x8179('0x66')];});return db[_0x8179('0x3f')][_0x8179('0x46')]({'where':{'id':_0x4839bc[_0x8179('0x50')]['id']}})[_0x8179('0x22')](function(_0x1450d6){return db[_0x8179('0x6a')][_0x8179('0x6b')](function(_0x1029ce){return _0x1450d6[_0x8179('0x64')](_0xb10167,{'transaction':_0x1029ce})['then'](function(){return BPromise[_0x8179('0x6c')](_0x2c606a,function(_0x2cc7e0){return db['UserMailQueue'][_0x8179('0x6d')]({'where':{'UserId':_0x2cc7e0['id'],'MailQueueId':_0x4839bc[_0x8179('0x50')]['id']},'transaction':_0x1029ce});});})[_0x8179('0x22')](function(){_0x2c606a[_0x8179('0x6e')](function(_0x594e7c){socket['emit'](_0x8179('0x6f'),{'UserId':_0x594e7c['id'],'MailQueueId':_0x1450d6['id']});});});});});}})['then'](respondWithStatusCode(_0x4b5368,null))['catch'](handleError(_0x4b5368,null));};exports[_0x8179('0x70')]=function(_0xaed684,_0x4eab6c,_0x2ccf3a){return db[_0x8179('0x63')][_0x8179('0x42')]({'where':{'id':_0xaed684[_0x8179('0x33')][_0x8179('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8179('0x65')],'as':_0x8179('0x66'),'attributes':['id'],'raw':!![]}]})[_0x8179('0x22')](handleEntityNotFound(_0x4eab6c,null))[_0x8179('0x22')](function(_0x474a83){var _0x7ea225=_[_0x8179('0x2c')](_0x474a83,'id');var _0x426f2d=[];var _0x1a60da=[];var _0x426fbe=squel['select']();_0x426fbe['field'](_0x8179('0x72'))['from'](_0x8179('0x73'),'tq')[_0x8179('0x74')](_0x8179('0x75'),'ut',_0x8179('0x76'))[_0x8179('0x3c')](_0x8179('0x77'),_0xaed684[_0x8179('0x50')]['id']);for(var _0x559161=0x0;_0x559161<_0x474a83[_0x8179('0x38')];_0x559161+=0x1){let _0xd31815=_0x474a83[_0x559161];for(var _0x595233=0x0;_0x595233<_0xd31815['Agents'][_0x8179('0x38')];_0x595233+=0x1){let _0x24c059=_0xd31815['Agents'][_0x595233];var _0x479562=_0x426fbe['clone']();_0x479562[_0x8179('0x3c')](_0x8179('0x78'),_0x24c059['id']);_0x1a60da[_0x8179('0x79')](db[_0x8179('0x6a')][_0x8179('0x33')](_0x479562[_0x8179('0x7a')](),{'type':db[_0x8179('0x6a')]['QueryTypes'][_0x8179('0x7b')]})[_0x8179('0x22')](function(_0x57550a){if(_0x57550a[_0x8179('0x38')]===0x1){return _0x24c059['id'];}else{var _0x1e39de=_[_0x8179('0x7c')](_[_0x8179('0x2c')](_0x57550a,_0x8179('0x7d')),function(_0x14adb5){return _['includes'](_0x7ea225,_0x14adb5);});if(_0x1e39de){return _0x24c059['id'];}}}));}}return BPromise[_0x8179('0x7e')](_0x1a60da)['then'](function(_0x3f4eb9){_0x426f2d=_(_0x426f2d)[_0x8179('0x7f')](_0x3f4eb9)['compact']()[_0x8179('0x80')]();return db[_0x8179('0x3f')]['find']({'where':{'id':_0xaed684['params']['id']}})[_0x8179('0x22')](function(_0x448576){return db[_0x8179('0x6a')][_0x8179('0x6b')](function(_0x27b48a){return _0x448576['removeTeams'](_0xaed684[_0x8179('0x33')][_0x8179('0x71')],{'transaction':_0x27b48a})['then'](function(){if(!_[_0x8179('0x81')](_0x426f2d)){return _0x448576[_0x8179('0x82')](_0x426f2d,{'transaction':_0x27b48a});}})[_0x8179('0x22')](function(){_0x426f2d[_0x8179('0x6e')](function(_0x4d1f7f){socket['emit'](_0x8179('0x83'),{'UserId':_0x4d1f7f,'MailQueueId':_0x448576['id']});});});});});});})['then'](respondWithStatusCode(_0x4eab6c,null))[_0x8179('0x44')](handleError(_0x4eab6c,null));};exports[_0x8179('0x84')]=function(_0x104d52,_0x365c3c,_0x3e670c){return db[_0x8179('0x3f')][_0x8179('0x46')]({'where':{'id':_0x104d52[_0x8179('0x50')]['id']}})[_0x8179('0x22')](handleEntityNotFound(_0x365c3c,null))['then'](function(_0x6efb5d){if(_0x6efb5d){return _0x6efb5d[_0x8179('0x84')](_0x104d52[_0x8179('0x48')]['ids'],_['omit'](_0x104d52[_0x8179('0x48')],[_0x8179('0x71'),'id'])||{})[_0x8179('0x85')](function(_0x195165){for(var _0x20d77e=0x0;_0x20d77e<_0x104d52['body']['ids'][_0x8179('0x38')];_0x20d77e+=0x1){socket['emit'](_0x8179('0x6f'),{'UserId':Number(_0x104d52[_0x8179('0x48')][_0x8179('0x71')][_0x20d77e]),'MailQueueId':Number(_0x104d52[_0x8179('0x50')]['id'])});}return _0x195165;});}})[_0x8179('0x22')](respondWithResult(_0x365c3c,null))[_0x8179('0x44')](handleError(_0x365c3c,null));};exports['removeAgents']=function(_0x103fdc,_0x5ea71d,_0x5470cb){return db['MailQueue'][_0x8179('0x46')]({'where':{'id':_0x103fdc['params']['id']}})[_0x8179('0x22')](handleEntityNotFound(_0x5ea71d,null))[_0x8179('0x22')](function(_0x1c2c38){if(_0x1c2c38){return _0x1c2c38[_0x8179('0x82')](_0x103fdc[_0x8179('0x33')][_0x8179('0x71')])[_0x8179('0x22')](function(){if(_[_0x8179('0x86')](_0x103fdc[_0x8179('0x33')][_0x8179('0x71')])){for(var _0x45280f=0x0;_0x45280f<_0x103fdc[_0x8179('0x33')][_0x8179('0x71')][_0x8179('0x38')];_0x45280f+=0x1){socket[_0x8179('0x87')]('userMailQueue:remove',{'UserId':Number(_0x103fdc['query'][_0x8179('0x71')][_0x45280f]),'MailQueueId':Number(_0x103fdc['params']['id'])});}}else{socket[_0x8179('0x87')](_0x8179('0x83'),{'UserId':Number(_0x103fdc[_0x8179('0x33')][_0x8179('0x71')]),'MailQueueId':Number(_0x103fdc[_0x8179('0x50')]['id'])});}});}})[_0x8179('0x22')](respondWithStatusCode(_0x5ea71d,null))[_0x8179('0x44')](handleError(_0x5ea71d,null));};exports[_0x8179('0x88')]=function(_0x31b93e,_0xbf2bd2,_0x74dc35){var _0x5556e5={};var _0x19de3c={};var _0x359dc1;var _0x3ec268;return db[_0x8179('0x3f')][_0x8179('0x62')]({'where':{'id':_0x31b93e['params']['id']}})['then'](handleEntityNotFound(_0xbf2bd2,null))[_0x8179('0x22')](function(_0xa202fa){if(_0xa202fa){_0x359dc1=_0xa202fa;_0x19de3c['model']=_[_0x8179('0x32')](db[_0x8179('0x65')][_0x8179('0x2d')]);_0x19de3c[_0x8179('0x33')]=_[_0x8179('0x32')](_0x31b93e[_0x8179('0x33')]);_0x19de3c[_0x8179('0x34')]=_[_0x8179('0x35')](_0x19de3c[_0x8179('0x31')],_0x19de3c[_0x8179('0x33')]);_0x5556e5[_0x8179('0x36')]=_[_0x8179('0x35')](_0x19de3c[_0x8179('0x31')],qs[_0x8179('0x37')](_0x31b93e[_0x8179('0x33')]['fields']));_0x5556e5['attributes']=_0x5556e5[_0x8179('0x36')][_0x8179('0x38')]?_0x5556e5[_0x8179('0x36')]:_0x19de3c[_0x8179('0x31')];_0x5556e5[_0x8179('0x54')]=qs[_0x8179('0x3b')](_0x31b93e['query'][_0x8179('0x3b')]);_0x5556e5[_0x8179('0x3c')]=qs[_0x8179('0x34')](_['pick'](_0x31b93e['query'],_0x19de3c[_0x8179('0x34')]));if(_0x31b93e[_0x8179('0x33')]['filter']){_0x5556e5[_0x8179('0x3c')]=_[_0x8179('0x3d')](_0x5556e5['where'],{'$or':_[_0x8179('0x2c')](_0x5556e5['attributes'],function(_0x48b929){var _0x2944c6={};_0x2944c6[_0x48b929]={'$like':'%'+_0x31b93e[_0x8179('0x33')][_0x8179('0x57')]+'%'};return _0x2944c6;})});}_0x5556e5=_[_0x8179('0x3d')]({},_0x5556e5,_0x31b93e[_0x8179('0x3e')]);return _0x359dc1['getAgents'](_0x5556e5);}})[_0x8179('0x22')](function(_0x22e53d){if(_0x22e53d){_0x3ec268=_0x22e53d['length'];if(!_0x31b93e['query']['hasOwnProperty'](_0x8179('0x3a'))){_0x5556e5[_0x8179('0x1c')]=qs[_0x8179('0x1c')](_0x31b93e[_0x8179('0x33')][_0x8179('0x1c')]);_0x5556e5[_0x8179('0x1b')]=qs['offset'](_0x31b93e[_0x8179('0x33')][_0x8179('0x1b')]);}return _0x359dc1[_0x8179('0x88')](_0x5556e5);}})['then'](function(_0x314598){if(_0x314598){return _0x314598?{'count':_0x3ec268,'rows':_0x314598}:null;}})[_0x8179('0x22')](respondWithResult(_0xbf2bd2,null))[_0x8179('0x44')](handleError(_0xbf2bd2,null));}; \ No newline at end of file +var _0x7b05=['omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./mailQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','MailQueues','sendStatus','stack','send','MailQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','name','merge','options','includeAll','include','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','pick','findAll','User','findAndCountAll','agent','mailPause','createdAt','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','emit','userMailQueue:remove','addAgents'];(function(_0x18e73a,_0x261ad1){var _0xaef86f=function(_0x3fdb92){while(--_0x3fdb92){_0x18e73a['push'](_0x18e73a['shift']());}};_0xaef86f(++_0x261ad1);}(_0x7b05,0x91));var _0x57b0=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x7b05[_0x22377a];return _0x36f105;};'use strict';var emlformat=require(_0x57b0('0x0'));var rimraf=require(_0x57b0('0x1'));var zipdir=require(_0x57b0('0x2'));var jsonpatch=require(_0x57b0('0x3'));var rp=require('request-promise');var moment=require(_0x57b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57b0('0x5'));var util=require(_0x57b0('0x6'));var path=require(_0x57b0('0x7'));var sox=require(_0x57b0('0x8'));var csv=require(_0x57b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57b0('0xa'));var _=require('lodash');var squel=require(_0x57b0('0xb'));var crypto=require(_0x57b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57b0('0xd'));var Redis=require(_0x57b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b0('0xf'));var logger=require(_0x57b0('0x10'))(_0x57b0('0x11'));var utils=require(_0x57b0('0x12'));var config=require(_0x57b0('0x13'));var licenseUtil=require(_0x57b0('0x14'));var db=require('../../mysqldb')['db'];config[_0x57b0('0x15')]=_[_0x57b0('0x16')](config[_0x57b0('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57b0('0x15')]));require(_0x57b0('0x17'))[_0x57b0('0x18')](socket);function respondWithStatusCode(_0x3b48a3,_0x564b15){_0x564b15=_0x564b15||0xcc;return function(_0x3dca2d){if(_0x3dca2d){return _0x3b48a3['sendStatus'](_0x564b15);}return _0x3b48a3[_0x57b0('0x19')](_0x564b15)[_0x57b0('0x1a')]();};}function respondWithResult(_0x55fd9c,_0x1ad3c9){_0x1ad3c9=_0x1ad3c9||0xc8;return function(_0x3dfc35){if(_0x3dfc35){return _0x55fd9c[_0x57b0('0x19')](_0x1ad3c9)[_0x57b0('0x1b')](_0x3dfc35);}};}function respondWithFilteredResult(_0x3eb198,_0x545c29){return function(_0x37bd5d){if(_0x37bd5d){var _0x4ac304=typeof _0x545c29['offset']===_0x57b0('0x1c')&&typeof _0x545c29[_0x57b0('0x1d')]===_0x57b0('0x1c');var _0x3e14f5=_0x37bd5d[_0x57b0('0x1e')];var _0x28af98=_0x4ac304?0x0:_0x545c29['offset'];var _0x19fafd=_0x4ac304?_0x37bd5d[_0x57b0('0x1e')]:_0x545c29[_0x57b0('0x1f')]+_0x545c29['limit'];var _0x12f2f6;if(_0x19fafd>=_0x3e14f5){_0x19fafd=_0x3e14f5;_0x12f2f6=0xc8;}else{_0x12f2f6=0xce;}_0x3eb198[_0x57b0('0x19')](_0x12f2f6);return _0x3eb198[_0x57b0('0x20')](_0x57b0('0x21'),_0x28af98+'-'+_0x19fafd+'/'+_0x3e14f5)[_0x57b0('0x1b')](_0x37bd5d);}return null;};}function patchUpdates(_0x22b11e){return function(_0x29cf6f){try{jsonpatch[_0x57b0('0x22')](_0x29cf6f,_0x22b11e,!![]);}catch(_0x3497e4){return BPromise['reject'](_0x3497e4);}return _0x29cf6f['save']();};}function saveUpdates(_0x40c279,_0x59bdb8){return function(_0x1f16a8){if(_0x1f16a8){return _0x1f16a8[_0x57b0('0x23')](_0x40c279)[_0x57b0('0x24')](function(_0x38e3a0){return _0x38e3a0;});}return null;};}function removeEntity(_0x3e75e8,_0xbf54ac){return function(_0x1cf6ed){if(_0x1cf6ed){return _0x1cf6ed[_0x57b0('0x25')]()[_0x57b0('0x24')](function(){var _0x109678=_0x1cf6ed[_0x57b0('0x26')]({'plain':!![]});var _0x43b90f=_0x57b0('0x27');return db['UserProfileResource'][_0x57b0('0x25')]({'where':{'type':_0x43b90f,'resourceId':_0x109678['id']}})[_0x57b0('0x24')](function(){return _0x1cf6ed;});})[_0x57b0('0x24')](function(){_0x3e75e8[_0x57b0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552f3e,_0x325e39){return function(_0x3aaf57){if(!_0x3aaf57){_0x552f3e[_0x57b0('0x28')](0x194);}return _0x3aaf57;};}function handleError(_0x5958a8,_0x52d2bc){_0x52d2bc=_0x52d2bc||0x1f4;return function(_0x9d9195){logger['error'](_0x9d9195[_0x57b0('0x29')]);if(_0x9d9195['name']){delete _0x9d9195['name'];}_0x5958a8[_0x57b0('0x19')](_0x52d2bc)[_0x57b0('0x2a')](_0x9d9195);};}exports['index']=function(_0x17ac64,_0x32e03e){var _0x55ca86={},_0x16d6e1={},_0xc7ed11={'count':0x0,'rows':[]};var _0x36526a=_['map'](db[_0x57b0('0x2b')][_0x57b0('0x2c')],function(_0x46ccd7){return{'name':_0x46ccd7[_0x57b0('0x2d')],'type':_0x46ccd7[_0x57b0('0x2e')]['key']};});_0x16d6e1['model']=_['map'](_0x36526a,'name');_0x16d6e1[_0x57b0('0x2f')]=_[_0x57b0('0x30')](_0x17ac64[_0x57b0('0x2f')]);_0x16d6e1[_0x57b0('0x31')]=_[_0x57b0('0x32')](_0x16d6e1['model'],_0x16d6e1[_0x57b0('0x2f')]);_0x55ca86[_0x57b0('0x33')]=_[_0x57b0('0x32')](_0x16d6e1[_0x57b0('0x34')],qs['fields'](_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x35')]));_0x55ca86['attributes']=_0x55ca86[_0x57b0('0x33')][_0x57b0('0x36')]?_0x55ca86['attributes']:_0x16d6e1['model'];if(!_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x37')](_0x57b0('0x38'))){_0x55ca86[_0x57b0('0x1d')]=qs[_0x57b0('0x1d')](_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x1d')]);_0x55ca86[_0x57b0('0x1f')]=qs[_0x57b0('0x1f')](_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x1f')]);}_0x55ca86[_0x57b0('0x39')]=qs['sort'](_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x3a')]);_0x55ca86[_0x57b0('0x3b')]=qs['filters'](_['pick'](_0x17ac64['query'],_0x16d6e1[_0x57b0('0x31')]),_0x36526a);if(_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x3c')]){_0x55ca86[_0x57b0('0x3b')]=_['merge'](_0x55ca86[_0x57b0('0x3b')],{'$or':_[_0x57b0('0x3d')](_0x36526a,function(_0x5e1e9d){if(_0x5e1e9d[_0x57b0('0x2e')]!==_0x57b0('0x3e')){var _0x47241f={};_0x47241f[_0x5e1e9d[_0x57b0('0x3f')]]={'$like':'%'+_0x17ac64[_0x57b0('0x2f')]['filter']+'%'};return _0x47241f;}})});}_0x55ca86=_[_0x57b0('0x40')]({},_0x55ca86,_0x17ac64[_0x57b0('0x41')]);var _0xbf870b={'where':_0x55ca86[_0x57b0('0x3b')]};return db['MailQueue']['count'](_0xbf870b)[_0x57b0('0x24')](function(_0x344bc6){_0xc7ed11['count']=_0x344bc6;if(_0x17ac64[_0x57b0('0x2f')][_0x57b0('0x42')]){_0x55ca86[_0x57b0('0x43')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x55ca86);})[_0x57b0('0x24')](function(_0x3f3b1c){_0xc7ed11[_0x57b0('0x44')]=_0x3f3b1c;return _0xc7ed11;})[_0x57b0('0x24')](respondWithFilteredResult(_0x32e03e,_0x55ca86))[_0x57b0('0x45')](handleError(_0x32e03e,null));};exports['show']=function(_0x116acf,_0x188b7d){var _0x173220={'raw':!![],'where':{'id':_0x116acf[_0x57b0('0x46')]['id']}},_0x308c08={};_0x308c08['model']=_['keys'](db['MailQueue']['rawAttributes']);_0x308c08[_0x57b0('0x2f')]=_[_0x57b0('0x30')](_0x116acf[_0x57b0('0x2f')]);_0x308c08[_0x57b0('0x31')]=_[_0x57b0('0x32')](_0x308c08[_0x57b0('0x34')],_0x308c08[_0x57b0('0x2f')]);_0x173220['attributes']=_[_0x57b0('0x32')](_0x308c08[_0x57b0('0x34')],qs[_0x57b0('0x35')](_0x116acf[_0x57b0('0x2f')][_0x57b0('0x35')]));_0x173220[_0x57b0('0x33')]=_0x173220[_0x57b0('0x33')]['length']?_0x173220[_0x57b0('0x33')]:_0x308c08['model'];if(_0x116acf[_0x57b0('0x2f')]['includeAll']){_0x173220[_0x57b0('0x43')]=[{'all':!![]}];}_0x173220=_['merge']({},_0x173220,_0x116acf[_0x57b0('0x41')]);return db[_0x57b0('0x2b')]['find'](_0x173220)[_0x57b0('0x24')](handleEntityNotFound(_0x188b7d,null))[_0x57b0('0x24')](respondWithResult(_0x188b7d,null))[_0x57b0('0x45')](handleError(_0x188b7d,null));};exports['create']=function(_0x2111e9,_0xb8f21){return db['MailQueue'][_0x57b0('0x47')](_0x2111e9[_0x57b0('0x48')],{})['then'](function(_0x467731){var _0x35ed98=_0x2111e9[_0x57b0('0x49')][_0x57b0('0x26')]({'plain':!![]});if(!_0x35ed98)throw new Error(_0x57b0('0x4a'));if(_0x35ed98['role']==='user'){var _0x3696b5=_0x467731[_0x57b0('0x26')]({'plain':!![]});var _0x22f0ae='MailQueues';return db[_0x57b0('0x4b')][_0x57b0('0x4c')]({'where':{'name':_0x22f0ae,'userProfileId':_0x35ed98[_0x57b0('0x4d')]},'raw':!![]})[_0x57b0('0x24')](function(_0xe3c067){if(_0xe3c067&&_0xe3c067[_0x57b0('0x4e')]===0x0){return db[_0x57b0('0x4f')][_0x57b0('0x47')]({'name':_0x3696b5[_0x57b0('0x3f')],'resourceId':_0x3696b5['id'],'type':_0xe3c067[_0x57b0('0x3f')],'sectionId':_0xe3c067['id']},{})[_0x57b0('0x24')](function(){return _0x467731;});}else{return _0x467731;}})[_0x57b0('0x45')](function(_0xe5499f){logger[_0x57b0('0x50')](_0x57b0('0x51'),_0xe5499f);throw _0xe5499f;});}return _0x467731;})[_0x57b0('0x24')](respondWithResult(_0xb8f21,0xc9))[_0x57b0('0x45')](handleError(_0xb8f21,null));};exports[_0x57b0('0x23')]=function(_0x50c4eb,_0x41f57d){if(_0x50c4eb[_0x57b0('0x48')]['id']){delete _0x50c4eb[_0x57b0('0x48')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x50c4eb[_0x57b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x41f57d,null))['then'](saveUpdates(_0x50c4eb[_0x57b0('0x48')],null))['then'](respondWithResult(_0x41f57d,null))[_0x57b0('0x45')](handleError(_0x41f57d,null));};exports['destroy']=function(_0x1ee98e,_0xa97db6){return db['MailQueue']['find']({'where':{'id':_0x1ee98e[_0x57b0('0x46')]['id']}})[_0x57b0('0x24')](handleEntityNotFound(_0xa97db6,null))['then'](removeEntity(_0xa97db6,null))[_0x57b0('0x45')](handleError(_0xa97db6,null));};exports[_0x57b0('0x52')]=function(_0x1740f5,_0x3f490f){return db['MailQueue'][_0x57b0('0x52')]()[_0x57b0('0x24')](respondWithResult(_0x3f490f,null))['catch'](handleError(_0x3f490f,null));};exports[_0x57b0('0x53')]=function(_0x1d87b1,_0x14f22f,_0x49675d){var _0x1f1fb6={'raw':!![],'where':{}},_0x18655b={},_0x358ded;return db['MailQueue']['findOne']({'where':{'id':_0x1d87b1[_0x57b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x14f22f,null))[_0x57b0('0x24')](function(_0x539568){if(_0x539568){_0x358ded=_0x539568[_0x57b0('0x26')]({'plain':!![]});_0x18655b['model']=_['keys'](db[_0x57b0('0x54')][_0x57b0('0x2c')]);_0x18655b['query']=_['keys'](_0x1d87b1['query']);_0x18655b[_0x57b0('0x31')]=_[_0x57b0('0x32')](_0x18655b[_0x57b0('0x34')],_0x18655b[_0x57b0('0x2f')]);_0x1f1fb6['attributes']=_['intersection'](_0x18655b[_0x57b0('0x34')],qs[_0x57b0('0x35')](_0x1d87b1[_0x57b0('0x2f')][_0x57b0('0x35')]));_0x1f1fb6[_0x57b0('0x33')]=_0x1f1fb6[_0x57b0('0x33')]['length']?_0x1f1fb6[_0x57b0('0x33')]:_0x18655b[_0x57b0('0x34')];if(!_0x1d87b1[_0x57b0('0x2f')][_0x57b0('0x37')](_0x57b0('0x38'))){_0x1f1fb6['limit']=qs[_0x57b0('0x1d')](_0x1d87b1[_0x57b0('0x2f')][_0x57b0('0x1d')]);_0x1f1fb6[_0x57b0('0x1f')]=qs[_0x57b0('0x1f')](_0x1d87b1[_0x57b0('0x2f')]['offset']);}_0x1f1fb6['order']=qs['sort'](_0x1d87b1[_0x57b0('0x2f')][_0x57b0('0x3a')]);_0x1f1fb6['where']=qs[_0x57b0('0x31')](_[_0x57b0('0x55')](_0x1d87b1[_0x57b0('0x2f')],_0x18655b[_0x57b0('0x31')]));_0x1f1fb6['where']['MailQueueId']=_0x539568['id'];if(_0x1d87b1['query'][_0x57b0('0x3c')]){_0x1f1fb6[_0x57b0('0x3b')]=_[_0x57b0('0x40')](_0x1f1fb6['where'],{'$or':_[_0x57b0('0x3d')](_0x1f1fb6['attributes'],function(_0x59b874){var _0x5aa44b={};_0x5aa44b[_0x59b874]={'$like':'%'+_0x1d87b1[_0x57b0('0x2f')]['filter']+'%'};return _0x5aa44b;})});}_0x1f1fb6=_[_0x57b0('0x40')]({},_0x1f1fb6,_0x1d87b1[_0x57b0('0x41')]);return db[_0x57b0('0x54')][_0x57b0('0x56')](_0x1f1fb6);}})[_0x57b0('0x24')](function(_0x2ac799){if(_0x2ac799){return db[_0x57b0('0x57')][_0x57b0('0x58')]({'where':{'id':_[_0x57b0('0x3d')](_0x2ac799,'UserId'),'role':_0x57b0('0x59')},'attributes':['id',_0x57b0('0x3f'),_0x57b0('0x5a'),'updatedAt',_0x57b0('0x5b')]});}})[_0x57b0('0x24')](function(_0x2081d9){if(_0x2081d9){return{'count':_0x2081d9[_0x57b0('0x1e')],'rows':_[_0x57b0('0x3d')](_0x2081d9['rows'],function(_0x53164f){return{'membername':_0x53164f[_0x57b0('0x3f')],'UserId':_0x53164f['id'],'queue_name':_0x358ded[_0x57b0('0x3f')],'MailQueueId':_0x358ded['id'],'interface':util['format'](_0x57b0('0x5c'),_0x57b0('0x5d'),_0x53164f[_0x57b0('0x3f')]),'penalty':0x0,'paused':_0x53164f['mailPause'],'createdAt':_0x53164f['createdAt'],'updatedAt':_0x53164f[_0x57b0('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x14f22f,_0x1f1fb6))[_0x57b0('0x45')](handleError(_0x14f22f,null));};exports[_0x57b0('0x5f')]=function(_0x371cd3,_0x199877,_0x32f519){var _0x44fa33={};var _0x247e35={};var _0x2d0bf4;var _0x5a8c41;return db[_0x57b0('0x2b')][_0x57b0('0x60')]({'where':{'id':_0x371cd3[_0x57b0('0x46')]['id']}})[_0x57b0('0x24')](handleEntityNotFound(_0x199877,null))['then'](function(_0x3e55f6){if(_0x3e55f6){_0x2d0bf4=_0x3e55f6;_0x247e35[_0x57b0('0x34')]=_['keys'](db[_0x57b0('0x61')][_0x57b0('0x2c')]);_0x247e35[_0x57b0('0x2f')]=_[_0x57b0('0x30')](_0x371cd3['query']);_0x247e35['filters']=_[_0x57b0('0x32')](_0x247e35[_0x57b0('0x34')],_0x247e35[_0x57b0('0x2f')]);_0x44fa33[_0x57b0('0x33')]=_[_0x57b0('0x32')](_0x247e35[_0x57b0('0x34')],qs[_0x57b0('0x35')](_0x371cd3[_0x57b0('0x2f')][_0x57b0('0x35')]));_0x44fa33[_0x57b0('0x33')]=_0x44fa33[_0x57b0('0x33')][_0x57b0('0x36')]?_0x44fa33['attributes']:_0x247e35[_0x57b0('0x34')];_0x44fa33['order']=qs[_0x57b0('0x3a')](_0x371cd3[_0x57b0('0x2f')][_0x57b0('0x3a')]);_0x44fa33[_0x57b0('0x3b')]=qs[_0x57b0('0x31')](_[_0x57b0('0x55')](_0x371cd3[_0x57b0('0x2f')],_0x247e35[_0x57b0('0x31')]));if(_0x371cd3['query'][_0x57b0('0x3c')]){_0x44fa33[_0x57b0('0x3b')]=_[_0x57b0('0x40')](_0x44fa33[_0x57b0('0x3b')],{'$or':_['map'](_0x44fa33[_0x57b0('0x33')],function(_0x55f024){var _0x35db52={};_0x35db52[_0x55f024]={'$like':'%'+_0x371cd3[_0x57b0('0x2f')]['filter']+'%'};return _0x35db52;})});}_0x44fa33=_[_0x57b0('0x40')]({},_0x44fa33,_0x371cd3['options']);return _0x2d0bf4['getTeams'](_0x44fa33);}})[_0x57b0('0x24')](function(_0x4fcfad){if(_0x4fcfad){_0x5a8c41=_0x4fcfad['length'];if(!_0x371cd3[_0x57b0('0x2f')][_0x57b0('0x37')](_0x57b0('0x38'))){_0x44fa33['limit']=qs['limit'](_0x371cd3[_0x57b0('0x2f')][_0x57b0('0x1d')]);_0x44fa33[_0x57b0('0x1f')]=qs[_0x57b0('0x1f')](_0x371cd3[_0x57b0('0x2f')][_0x57b0('0x1f')]);}return _0x2d0bf4[_0x57b0('0x5f')](_0x44fa33);}})['then'](function(_0x59bd57){if(_0x59bd57){return _0x59bd57?{'count':_0x5a8c41,'rows':_0x59bd57}:null;}})['then'](respondWithResult(_0x199877,null))['catch'](handleError(_0x199877,null));};exports[_0x57b0('0x62')]=function(_0x3c5008,_0x2e7ad6,_0x20cf7f){var _0x555095=_0x3c5008[_0x57b0('0x48')][_0x57b0('0x63')];return db[_0x57b0('0x61')]['findAll']({'where':{'id':_0x555095},'attributes':['id'],'include':[{'model':db['User'],'as':_0x57b0('0x64'),'attributes':['id','name','online',_0x57b0('0x65'),_0x57b0('0x66')],'raw':!![]}]})[_0x57b0('0x24')](function(_0x1abc06){if(_0x1abc06){var _0x274b34=_[_0x57b0('0x67')](_0x1abc06,function(_0x53e897){var _0x327164=_0x53e897[_0x57b0('0x26')]({'plain':!![]});return _0x327164['Agents'];});return db['MailQueue'][_0x57b0('0x4c')]({'where':{'id':_0x3c5008[_0x57b0('0x46')]['id']}})[_0x57b0('0x24')](function(_0x813b4c){return db[_0x57b0('0x68')][_0x57b0('0x69')](function(_0x13e054){return _0x813b4c[_0x57b0('0x62')](_0x555095,{'transaction':_0x13e054})[_0x57b0('0x24')](function(){return BPromise[_0x57b0('0x6a')](_0x274b34,function(_0x3e546){return db[_0x57b0('0x54')][_0x57b0('0x6b')]({'where':{'UserId':_0x3e546['id'],'MailQueueId':_0x3c5008['params']['id']},'transaction':_0x13e054});});})[_0x57b0('0x24')](function(){_0x274b34[_0x57b0('0x6c')](function(_0x4e15da){socket['emit'](_0x57b0('0x6d'),{'UserId':_0x4e15da['id'],'MailQueueId':_0x813b4c['id']});});});});});}})[_0x57b0('0x24')](respondWithStatusCode(_0x2e7ad6,null))[_0x57b0('0x45')](handleError(_0x2e7ad6,null));};exports[_0x57b0('0x6e')]=function(_0x3e52ce,_0x552ac3,_0x5935fa){return db[_0x57b0('0x61')][_0x57b0('0x56')]({'where':{'id':_0x3e52ce[_0x57b0('0x2f')][_0x57b0('0x63')]},'attributes':['id'],'include':[{'model':db[_0x57b0('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x57b0('0x24')](handleEntityNotFound(_0x552ac3,null))[_0x57b0('0x24')](function(_0x8ef4d6){var _0x4d5d64=_['map'](_0x8ef4d6,'id');var _0x5a7248=[];var _0x50d662=[];var _0x4e7fb3=squel[_0x57b0('0x6f')]();_0x4e7fb3[_0x57b0('0x70')]('tq.TeamId')[_0x57b0('0x71')](_0x57b0('0x72'),'tq')[_0x57b0('0x73')](_0x57b0('0x74'),'ut',_0x57b0('0x75'))['where'](_0x57b0('0x76'),_0x3e52ce[_0x57b0('0x46')]['id']);for(var _0x1ae887=0x0;_0x1ae887<_0x8ef4d6[_0x57b0('0x36')];_0x1ae887+=0x1){let _0x475a06=_0x8ef4d6[_0x1ae887];for(var _0x39cfc4=0x0;_0x39cfc4<_0x475a06[_0x57b0('0x64')]['length'];_0x39cfc4+=0x1){let _0x595e88=_0x475a06['Agents'][_0x39cfc4];var _0x562e8d=_0x4e7fb3[_0x57b0('0x77')]();_0x562e8d['where'](_0x57b0('0x78'),_0x595e88['id']);_0x50d662[_0x57b0('0x79')](db[_0x57b0('0x68')][_0x57b0('0x2f')](_0x562e8d[_0x57b0('0x7a')](),{'type':db['sequelize'][_0x57b0('0x7b')][_0x57b0('0x7c')]})[_0x57b0('0x24')](function(_0x3034f1){if(_0x3034f1[_0x57b0('0x36')]===0x1){return _0x595e88['id'];}else{var _0x21ce86=_[_0x57b0('0x7d')](_[_0x57b0('0x3d')](_0x3034f1,_0x57b0('0x7e')),function(_0x3cbaf1){return _[_0x57b0('0x7f')](_0x4d5d64,_0x3cbaf1);});if(_0x21ce86){return _0x595e88['id'];}}}));}}return BPromise['all'](_0x50d662)[_0x57b0('0x24')](function(_0x5c7d19){_0x5a7248=_(_0x5a7248)[_0x57b0('0x80')](_0x5c7d19)[_0x57b0('0x81')]()[_0x57b0('0x82')]();return db[_0x57b0('0x2b')][_0x57b0('0x4c')]({'where':{'id':_0x3e52ce['params']['id']}})[_0x57b0('0x24')](function(_0x2ade6d){return db[_0x57b0('0x68')]['transaction'](function(_0x70efe0){return _0x2ade6d[_0x57b0('0x6e')](_0x3e52ce['query'][_0x57b0('0x63')],{'transaction':_0x70efe0})[_0x57b0('0x24')](function(){if(!_[_0x57b0('0x83')](_0x5a7248)){return _0x2ade6d['removeAgents'](_0x5a7248,{'transaction':_0x70efe0});}})[_0x57b0('0x24')](function(){_0x5a7248[_0x57b0('0x6c')](function(_0x2e523f){socket[_0x57b0('0x84')](_0x57b0('0x85'),{'UserId':_0x2e523f,'MailQueueId':_0x2ade6d['id']});});});});});});})[_0x57b0('0x24')](respondWithStatusCode(_0x552ac3,null))[_0x57b0('0x45')](handleError(_0x552ac3,null));};exports[_0x57b0('0x86')]=function(_0x1ef61e,_0x5701a8,_0x4fc398){return db[_0x57b0('0x2b')]['find']({'where':{'id':_0x1ef61e[_0x57b0('0x46')]['id']}})[_0x57b0('0x24')](handleEntityNotFound(_0x5701a8,null))['then'](function(_0x3c50d8){if(_0x3c50d8){return _0x3c50d8['addAgents'](_0x1ef61e[_0x57b0('0x48')][_0x57b0('0x63')],_[_0x57b0('0x87')](_0x1ef61e[_0x57b0('0x48')],[_0x57b0('0x63'),'id'])||{})[_0x57b0('0x88')](function(_0x226fc8){for(var _0xacfee9=0x0;_0xacfee9<_0x1ef61e[_0x57b0('0x48')][_0x57b0('0x63')][_0x57b0('0x36')];_0xacfee9+=0x1){socket[_0x57b0('0x84')](_0x57b0('0x6d'),{'UserId':Number(_0x1ef61e[_0x57b0('0x48')][_0x57b0('0x63')][_0xacfee9]),'MailQueueId':Number(_0x1ef61e[_0x57b0('0x46')]['id'])});}return _0x226fc8;});}})['then'](respondWithResult(_0x5701a8,null))['catch'](handleError(_0x5701a8,null));};exports['removeAgents']=function(_0xb69a32,_0x164dd1,_0x4138eb){return db['MailQueue']['find']({'where':{'id':_0xb69a32['params']['id']}})[_0x57b0('0x24')](handleEntityNotFound(_0x164dd1,null))[_0x57b0('0x24')](function(_0xb8e12d){if(_0xb8e12d){return _0xb8e12d[_0x57b0('0x89')](_0xb69a32[_0x57b0('0x2f')][_0x57b0('0x63')])[_0x57b0('0x24')](function(){if(_[_0x57b0('0x8a')](_0xb69a32[_0x57b0('0x2f')]['ids'])){for(var _0x246cf3=0x0;_0x246cf3<_0xb69a32[_0x57b0('0x2f')][_0x57b0('0x63')][_0x57b0('0x36')];_0x246cf3+=0x1){socket[_0x57b0('0x84')]('userMailQueue:remove',{'UserId':Number(_0xb69a32[_0x57b0('0x2f')][_0x57b0('0x63')][_0x246cf3]),'MailQueueId':Number(_0xb69a32[_0x57b0('0x46')]['id'])});}}else{socket[_0x57b0('0x84')](_0x57b0('0x85'),{'UserId':Number(_0xb69a32[_0x57b0('0x2f')]['ids']),'MailQueueId':Number(_0xb69a32[_0x57b0('0x46')]['id'])});}});}})[_0x57b0('0x24')](respondWithStatusCode(_0x164dd1,null))[_0x57b0('0x45')](handleError(_0x164dd1,null));};exports[_0x57b0('0x8b')]=function(_0x3d31d7,_0x1049d7,_0x497d4e){var _0x12cac0={};var _0xdd63dc={};var _0x5014e2;var _0x4f7da0;return db[_0x57b0('0x2b')]['findOne']({'where':{'id':_0x3d31d7['params']['id']}})[_0x57b0('0x24')](handleEntityNotFound(_0x1049d7,null))['then'](function(_0x148898){if(_0x148898){_0x5014e2=_0x148898;_0xdd63dc[_0x57b0('0x34')]=_[_0x57b0('0x30')](db[_0x57b0('0x57')][_0x57b0('0x2c')]);_0xdd63dc[_0x57b0('0x2f')]=_[_0x57b0('0x30')](_0x3d31d7[_0x57b0('0x2f')]);_0xdd63dc[_0x57b0('0x31')]=_['intersection'](_0xdd63dc[_0x57b0('0x34')],_0xdd63dc[_0x57b0('0x2f')]);_0x12cac0[_0x57b0('0x33')]=_[_0x57b0('0x32')](_0xdd63dc['model'],qs[_0x57b0('0x35')](_0x3d31d7[_0x57b0('0x2f')][_0x57b0('0x35')]));_0x12cac0[_0x57b0('0x33')]=_0x12cac0[_0x57b0('0x33')][_0x57b0('0x36')]?_0x12cac0[_0x57b0('0x33')]:_0xdd63dc[_0x57b0('0x34')];_0x12cac0[_0x57b0('0x39')]=qs[_0x57b0('0x3a')](_0x3d31d7[_0x57b0('0x2f')][_0x57b0('0x3a')]);_0x12cac0[_0x57b0('0x3b')]=qs['filters'](_['pick'](_0x3d31d7[_0x57b0('0x2f')],_0xdd63dc[_0x57b0('0x31')]));if(_0x3d31d7['query'][_0x57b0('0x3c')]){_0x12cac0['where']=_[_0x57b0('0x40')](_0x12cac0[_0x57b0('0x3b')],{'$or':_['map'](_0x12cac0[_0x57b0('0x33')],function(_0x3242ea){var _0x575d60={};_0x575d60[_0x3242ea]={'$like':'%'+_0x3d31d7[_0x57b0('0x2f')]['filter']+'%'};return _0x575d60;})});}_0x12cac0=_[_0x57b0('0x40')]({},_0x12cac0,_0x3d31d7[_0x57b0('0x41')]);return _0x5014e2[_0x57b0('0x8b')](_0x12cac0);}})[_0x57b0('0x24')](function(_0x48e8fd){if(_0x48e8fd){_0x4f7da0=_0x48e8fd[_0x57b0('0x36')];if(!_0x3d31d7[_0x57b0('0x2f')]['hasOwnProperty'](_0x57b0('0x38'))){_0x12cac0[_0x57b0('0x1d')]=qs[_0x57b0('0x1d')](_0x3d31d7['query'][_0x57b0('0x1d')]);_0x12cac0[_0x57b0('0x1f')]=qs[_0x57b0('0x1f')](_0x3d31d7[_0x57b0('0x2f')]['offset']);}return _0x5014e2[_0x57b0('0x8b')](_0x12cac0);}})[_0x57b0('0x24')](function(_0x5a8353){if(_0x5a8353){return _0x5a8353?{'count':_0x4f7da0,'rows':_0x5a8353}:null;}})[_0x57b0('0x24')](respondWithResult(_0x1049d7,null))[_0x57b0('0x45')](handleError(_0x1049d7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 1ef0dda..ce96822 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 _0x384b=['hasOwnProperty','hook','events','setMaxListeners','save','emit'];(function(_0x36958,_0x28eaa6){var _0x401eec=function(_0x42e71e){while(--_0x42e71e){_0x36958['push'](_0x36958['shift']());}};_0x401eec(++_0x28eaa6);}(_0x384b,0xc2));var _0xb384=function(_0x8d688d,_0x2f8ac8){_0x8d688d=_0x8d688d-0x0;var _0x4e78f9=_0x384b[_0x8d688d];return _0x4e78f9;};'use strict';var EventEmitter=require(_0xb384('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb384('0x1')](0x0);var events={'afterCreate':_0xb384('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x349689){return function(_0x3b9847,_0x3b125c,_0x512d84){MailQueueEvents[_0xb384('0x3')](_0x349689+':'+_0x3b9847['id'],_0x3b9847);MailQueueEvents[_0xb384('0x3')](_0x349689,_0x3b9847);_0x512d84(null);};}for(var e in events){if(events[_0xb384('0x4')](e)){var event=events[e];MailQueue[_0xb384('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x2562=['remove','emit','hook','events','../../mysqldb','MailQueue','update'];(function(_0x430901,_0x2fe112){var _0x5f2c70=function(_0x5b80d5){while(--_0x5b80d5){_0x430901['push'](_0x430901['shift']());}};_0x5f2c70(++_0x2fe112);}(_0x2562,0x6c));var _0x2256=function(_0x3437fa,_0x61df50){_0x3437fa=_0x3437fa-0x0;var _0x533a22=_0x2562[_0x3437fa];return _0x533a22;};'use strict';var EventEmitter=require(_0x2256('0x0'));var MailQueue=require(_0x2256('0x1'))['db'][_0x2256('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2256('0x3'),'afterDestroy':_0x2256('0x4')};function emitEvent(_0xdc30ca){return function(_0x4d564f,_0x4c085c,_0xe99772){MailQueueEvents['emit'](_0xdc30ca+':'+_0x4d564f['id'],_0x4d564f);MailQueueEvents[_0x2256('0x5')](_0xdc30ca,_0x4d564f);_0xe99772(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x2256('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 73635af..3888dc9 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 _0xa47b=['bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','MailQueue','mail_queues','util','../../config/logger','api','moment'];(function(_0x2f6cb0,_0x3b2b4b){var _0x309bb0=function(_0x34ec9d){while(--_0x34ec9d){_0x2f6cb0['push'](_0x2f6cb0['shift']());}};_0x309bb0(++_0x3b2b4b);}(_0xa47b,0xf8));var _0xba47=function(_0x30b6f0,_0x44e688){_0x30b6f0=_0x30b6f0-0x0;var _0x195cd1=_0xa47b[_0x30b6f0];return _0x195cd1;};'use strict';var _=require('lodash');var util=require(_0xba47('0x0'));var logger=require(_0xba47('0x1'))(_0xba47('0x2'));var moment=require(_0xba47('0x3'));var BPromise=require(_0xba47('0x4'));var rp=require(_0xba47('0x5'));var fs=require('fs');var path=require(_0xba47('0x6'));var rimraf=require(_0xba47('0x7'));var config=require('../../config/environment');var attributes=require(_0xba47('0x8'));module[_0xba47('0x9')]=function(_0x434f2d,_0x269eb6){return _0x434f2d['define'](_0xba47('0xa'),attributes,{'tableName':_0xba47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2aa6=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x2aa6,0x79));var _0x62aa=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0x2aa6[_0x179c4a];return _0x5d1879;};'use strict';var _=require(_0x62aa('0x0'));var util=require(_0x62aa('0x1'));var logger=require(_0x62aa('0x2'))(_0x62aa('0x3'));var moment=require(_0x62aa('0x4'));var BPromise=require(_0x62aa('0x5'));var rp=require(_0x62aa('0x6'));var fs=require('fs');var path=require(_0x62aa('0x7'));var rimraf=require(_0x62aa('0x8'));var config=require(_0x62aa('0x9'));var attributes=require(_0x62aa('0xa'));module[_0x62aa('0xb')]=function(_0x4cd494,_0x454860){return _0x4cd494[_0x62aa('0xc')]('MailQueue',attributes,{'tableName':_0x62aa('0xd'),'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 3c6ed36..0e292f2 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 _0x5f19=['request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','code','error','MailQueue,\x20%s,\x20%s','message','info','result','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetMailQueue','stringify','catch','ShowMailQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x5f19,0x94));var _0x95f1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5f19[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x95f1('0x0'));var util=require('util');var moment=require(_0x95f1('0x1'));var BPromise=require(_0x95f1('0x2'));var rs=require(_0x95f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95f1('0x4'))['db'];var utils=require(_0x95f1('0x5'));var logger=require(_0x95f1('0x6'))(_0x95f1('0x7'));var config=require(_0x95f1('0x8'));var jayson=require(_0x95f1('0x9'));var client=jayson[_0x95f1('0xa')][_0x95f1('0xb')]({'port':0x232a});config[_0x95f1('0xc')]=_[_0x95f1('0xd')](config[_0x95f1('0xc')],{'host':_0x95f1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95f1('0xc')]));require(_0x95f1('0xf'))['register'](socket);function respondWithRpcPromise(_0x2b52bb,_0x3e8def,_0x38fda8){return new BPromise(function(_0x4e0e53,_0x47c5fa){return client[_0x95f1('0x10')](_0x2b52bb,_0x38fda8)[_0x95f1('0x11')](function(_0x4ace5d){logger['info']('MailQueue,\x20%s,\x20%s',_0x3e8def,_0x95f1('0x12'));logger[_0x95f1('0x13')](_0x95f1('0x14'),_0x3e8def,_0x95f1('0x12'),JSON['stringify'](_0x4ace5d));if(_0x4ace5d['error']){if(_0x4ace5d['error'][_0x95f1('0x15')]===0x1f4){logger[_0x95f1('0x16')](_0x95f1('0x17'),_0x3e8def,_0x4ace5d[_0x95f1('0x16')][_0x95f1('0x18')]);return _0x47c5fa(_0x4ace5d['error'][_0x95f1('0x18')]);}logger[_0x95f1('0x16')]('MailQueue,\x20%s,\x20%s',_0x3e8def,_0x4ace5d[_0x95f1('0x16')][_0x95f1('0x18')]);return _0x4e0e53(_0x4ace5d['error']['message']);}else{logger[_0x95f1('0x19')](_0x95f1('0x17'),_0x3e8def,_0x95f1('0x12'));_0x4e0e53(_0x4ace5d[_0x95f1('0x1a')]['message']);}})['catch'](function(_0x194fa2){logger[_0x95f1('0x16')](_0x95f1('0x17'),_0x3e8def,_0x194fa2);_0x47c5fa(_0x194fa2);});});}exports['GetMailQueue']=function(_0x133dff){var _0x26cc3b=this;return new Promise(function(_0x12d56f,_0x3d56d1){return db[_0x95f1('0x1b')][_0x95f1('0x1c')]({'raw':_0x133dff[_0x95f1('0x1d')]?_0x133dff[_0x95f1('0x1d')][_0x95f1('0x1e')]===undefined?!![]:![]:!![],'where':_0x133dff[_0x95f1('0x1d')]?_0x133dff['options'][_0x95f1('0x1f')]||null:null,'attributes':_0x133dff[_0x95f1('0x1d')]?_0x133dff[_0x95f1('0x1d')][_0x95f1('0x20')]||null:null,'limit':_0x133dff[_0x95f1('0x1d')]?_0x133dff[_0x95f1('0x1d')][_0x95f1('0x21')]||null:null,'include':_0x133dff['options']?_0x133dff['options'][_0x95f1('0x22')]?_[_0x95f1('0x23')](_0x133dff[_0x95f1('0x1d')][_0x95f1('0x22')],function(_0x52f428){return{'model':db[_0x52f428[_0x95f1('0x24')]],'as':_0x52f428['as'],'attributes':_0x52f428[_0x95f1('0x20')],'include':_0x52f428['include']?_['map'](_0x52f428['include'],function(_0x369231){return{'model':db[_0x369231[_0x95f1('0x24')]],'as':_0x369231['as'],'attributes':_0x369231[_0x95f1('0x20')],'include':_0x369231[_0x95f1('0x22')]?_[_0x95f1('0x23')](_0x369231[_0x95f1('0x22')],function(_0x34a217){return{'model':db[_0x34a217['model']],'as':_0x34a217['as'],'attributes':_0x34a217[_0x95f1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x95f1('0x11')](function(_0x13fe39){logger['info'](_0x95f1('0x25'),_0x133dff);logger[_0x95f1('0x13')](_0x95f1('0x25'),_0x133dff,JSON[_0x95f1('0x26')](_0x13fe39));_0x12d56f(_0x13fe39);})[_0x95f1('0x27')](function(_0x22afbb){logger[_0x95f1('0x16')](_0x95f1('0x25'),_0x22afbb[_0x95f1('0x18')],_0x133dff);_0x3d56d1(_0x26cc3b['error'](0x1f4,_0x22afbb[_0x95f1('0x18')]));});});};exports[_0x95f1('0x28')]=function(_0x1545bd){var _0xeef047=this;return new Promise(function(_0x4bb68e,_0x23fc6d){return db['MailQueue']['find']({'raw':_0x1545bd[_0x95f1('0x1d')]?_0x1545bd[_0x95f1('0x1d')][_0x95f1('0x1e')]===undefined?!![]:![]:!![],'where':_0x1545bd[_0x95f1('0x1d')]?_0x1545bd[_0x95f1('0x1d')][_0x95f1('0x1f')]||null:null,'attributes':_0x1545bd['options']?_0x1545bd[_0x95f1('0x1d')][_0x95f1('0x20')]||null:null,'include':_0x1545bd[_0x95f1('0x1d')]?_0x1545bd[_0x95f1('0x1d')]['include']?_['map'](_0x1545bd['options'][_0x95f1('0x22')],function(_0x101461){return{'model':db[_0x101461['model']],'as':_0x101461['as'],'attributes':_0x101461[_0x95f1('0x20')],'include':_0x101461[_0x95f1('0x22')]?_[_0x95f1('0x23')](_0x101461[_0x95f1('0x22')],function(_0x1a584a){return{'model':db[_0x1a584a[_0x95f1('0x24')]],'as':_0x1a584a['as'],'attributes':_0x1a584a[_0x95f1('0x20')],'include':_0x1a584a[_0x95f1('0x22')]?_['map'](_0x1a584a['include'],function(_0x4a3b5a){return{'model':db[_0x4a3b5a[_0x95f1('0x24')]],'as':_0x4a3b5a['as'],'attributes':_0x4a3b5a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d3cb5){logger['info'](_0x95f1('0x28'),_0x1545bd);logger['debug'](_0x95f1('0x28'),_0x1545bd,JSON[_0x95f1('0x26')](_0x1d3cb5));_0x4bb68e(_0x1d3cb5);})['catch'](function(_0x2c3056){logger['error'](_0x95f1('0x28'),_0x2c3056[_0x95f1('0x18')],_0x1545bd);_0x23fc6d(_0xeef047['error'](0x1f4,_0x2c3056[_0x95f1('0x18')]));});});}; \ No newline at end of file +var _0xc3a1=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','map','include','model','then','ShowMailQueue','util','moment','ioredis'];(function(_0x4f3f3d,_0x227655){var _0x3f54f4=function(_0x44ba78){while(--_0x44ba78){_0x4f3f3d['push'](_0x4f3f3d['shift']());}};_0x3f54f4(++_0x227655);}(_0xc3a1,0x11d));var _0x1c3a=function(_0xa62215,_0xb51831){_0xa62215=_0xa62215-0x0;var _0x18794a=_0xc3a1[_0xa62215];return _0x18794a;};'use strict';var _=require('lodash');var util=require(_0x1c3a('0x0'));var moment=require(_0x1c3a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3a('0x2'));var db=require(_0x1c3a('0x3'))['db'];var utils=require(_0x1c3a('0x4'));var logger=require('../../config/logger')(_0x1c3a('0x5'));var config=require('../../config/environment');var jayson=require(_0x1c3a('0x6'));var client=jayson[_0x1c3a('0x7')][_0x1c3a('0x8')]({'port':0x232a});config[_0x1c3a('0x9')]=_[_0x1c3a('0xa')](config[_0x1c3a('0x9')],{'host':_0x1c3a('0xb'),'port':0x18eb});var socket=require(_0x1c3a('0xc'))(new Redis(config[_0x1c3a('0x9')]));require(_0x1c3a('0xd'))['register'](socket);function respondWithRpcPromise(_0x5afd33,_0x3a1ddf,_0x28deb0){return new BPromise(function(_0x36b482,_0x246b14){return client[_0x1c3a('0xe')](_0x5afd33,_0x28deb0)['then'](function(_0x1f3b65){logger[_0x1c3a('0xf')](_0x1c3a('0x10'),_0x3a1ddf,_0x1c3a('0x11'));logger[_0x1c3a('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3a1ddf,_0x1c3a('0x11'),JSON[_0x1c3a('0x13')](_0x1f3b65));if(_0x1f3b65['error']){if(_0x1f3b65[_0x1c3a('0x14')][_0x1c3a('0x15')]===0x1f4){logger[_0x1c3a('0x14')](_0x1c3a('0x10'),_0x3a1ddf,_0x1f3b65[_0x1c3a('0x14')][_0x1c3a('0x16')]);return _0x246b14(_0x1f3b65[_0x1c3a('0x14')][_0x1c3a('0x16')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x3a1ddf,_0x1f3b65[_0x1c3a('0x14')][_0x1c3a('0x16')]);return _0x36b482(_0x1f3b65[_0x1c3a('0x14')][_0x1c3a('0x16')]);}else{logger[_0x1c3a('0xf')](_0x1c3a('0x10'),_0x3a1ddf,_0x1c3a('0x11'));_0x36b482(_0x1f3b65['result'][_0x1c3a('0x16')]);}})[_0x1c3a('0x17')](function(_0x17eb84){logger[_0x1c3a('0x14')]('MailQueue,\x20%s,\x20%s',_0x3a1ddf,_0x17eb84);_0x246b14(_0x17eb84);});});}exports[_0x1c3a('0x18')]=function(_0x288312){var _0x1b2e01=this;return new Promise(function(_0x4b3d4f,_0xae29ed){return db[_0x1c3a('0x19')][_0x1c3a('0x1a')]({'raw':_0x288312[_0x1c3a('0x1b')]?_0x288312[_0x1c3a('0x1b')][_0x1c3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x288312['options']?_0x288312['options'][_0x1c3a('0x1d')]||null:null,'attributes':_0x288312[_0x1c3a('0x1b')]?_0x288312[_0x1c3a('0x1b')][_0x1c3a('0x1e')]||null:null,'limit':_0x288312['options']?_0x288312[_0x1c3a('0x1b')]['limit']||null:null,'include':_0x288312[_0x1c3a('0x1b')]?_0x288312['options']['include']?_[_0x1c3a('0x1f')](_0x288312[_0x1c3a('0x1b')][_0x1c3a('0x20')],function(_0x41ddff){return{'model':db[_0x41ddff[_0x1c3a('0x21')]],'as':_0x41ddff['as'],'attributes':_0x41ddff[_0x1c3a('0x1e')],'include':_0x41ddff[_0x1c3a('0x20')]?_[_0x1c3a('0x1f')](_0x41ddff[_0x1c3a('0x20')],function(_0x2f3b0c){return{'model':db[_0x2f3b0c[_0x1c3a('0x21')]],'as':_0x2f3b0c['as'],'attributes':_0x2f3b0c[_0x1c3a('0x1e')],'include':_0x2f3b0c[_0x1c3a('0x20')]?_[_0x1c3a('0x1f')](_0x2f3b0c[_0x1c3a('0x20')],function(_0x5e1df2){return{'model':db[_0x5e1df2[_0x1c3a('0x21')]],'as':_0x5e1df2['as'],'attributes':_0x5e1df2[_0x1c3a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1c3a('0x22')](function(_0x570f98){logger['info'](_0x1c3a('0x18'),_0x288312);logger[_0x1c3a('0x12')](_0x1c3a('0x18'),_0x288312,JSON['stringify'](_0x570f98));_0x4b3d4f(_0x570f98);})[_0x1c3a('0x17')](function(_0x2d5a29){logger[_0x1c3a('0x14')](_0x1c3a('0x18'),_0x2d5a29['message'],_0x288312);_0xae29ed(_0x1b2e01[_0x1c3a('0x14')](0x1f4,_0x2d5a29[_0x1c3a('0x16')]));});});};exports[_0x1c3a('0x23')]=function(_0x526799){var _0x2ef61d=this;return new Promise(function(_0x12c099,_0x40932d){return db[_0x1c3a('0x19')]['find']({'raw':_0x526799[_0x1c3a('0x1b')]?_0x526799[_0x1c3a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x526799[_0x1c3a('0x1b')]?_0x526799[_0x1c3a('0x1b')][_0x1c3a('0x1d')]||null:null,'attributes':_0x526799[_0x1c3a('0x1b')]?_0x526799[_0x1c3a('0x1b')][_0x1c3a('0x1e')]||null:null,'include':_0x526799[_0x1c3a('0x1b')]?_0x526799[_0x1c3a('0x1b')][_0x1c3a('0x20')]?_[_0x1c3a('0x1f')](_0x526799['options']['include'],function(_0xd07b69){return{'model':db[_0xd07b69[_0x1c3a('0x21')]],'as':_0xd07b69['as'],'attributes':_0xd07b69[_0x1c3a('0x1e')],'include':_0xd07b69[_0x1c3a('0x20')]?_[_0x1c3a('0x1f')](_0xd07b69[_0x1c3a('0x20')],function(_0x41984a){return{'model':db[_0x41984a[_0x1c3a('0x21')]],'as':_0x41984a['as'],'attributes':_0x41984a[_0x1c3a('0x1e')],'include':_0x41984a[_0x1c3a('0x20')]?_['map'](_0x41984a[_0x1c3a('0x20')],function(_0xae2403){return{'model':db[_0xae2403['model']],'as':_0xae2403['as'],'attributes':_0xae2403['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c3a('0x22')](function(_0x8f959){logger[_0x1c3a('0xf')]('ShowMailQueue',_0x526799);logger[_0x1c3a('0x12')](_0x1c3a('0x23'),_0x526799,JSON[_0x1c3a('0x13')](_0x8f959));_0x12c099(_0x8f959);})[_0x1c3a('0x17')](function(_0x57eb50){logger[_0x1c3a('0x14')](_0x1c3a('0x23'),_0x57eb50['message'],_0x526799);_0x40932d(_0x2ef61d[_0x1c3a('0x14')](0x1f4,_0x57eb50[_0x1c3a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7887539..a850898 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 _0xb626=['mailQueue:','save','remove','removeListener','length'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xb626,0xbf));var _0x6b62=function(_0x3cadf7,_0x501a36){_0x3cadf7=_0x3cadf7-0x0;var _0x35e7f6=_0xb626[_0x3cadf7];return _0x35e7f6;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6b62('0x0'),_0x6b62('0x1'),'update'];function createListener(_0x16c0bb,_0x5ccfb7){return function(_0x57546b){_0x5ccfb7['emit'](_0x16c0bb,_0x57546b);};}function removeListener(_0x50f023,_0x5dc1e1){return function(){MailQueueEvents[_0x6b62('0x2')](_0x50f023,_0x5dc1e1);};}exports['register']=function(_0x49624a){for(var _0x26f818=0x0,_0x566bdd=events[_0x6b62('0x3')];_0x26f818<_0x566bdd;_0x26f818++){var _0x3a088e=events[_0x26f818];var _0x2a64fe=createListener(_0x6b62('0x4')+_0x3a088e,_0x49624a);MailQueueEvents['on'](_0x3a088e,_0x2a64fe);}}; \ No newline at end of file +var _0x57fa=['mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x35bad0,_0x21927d){var _0x4fe50f=function(_0x1873df){while(--_0x1873df){_0x35bad0['push'](_0x35bad0['shift']());}};_0x4fe50f(++_0x21927d);}(_0x57fa,0x127));var _0xa57f=function(_0x15930b,_0x168ab6){_0x15930b=_0x15930b-0x0;var _0x319fc8=_0x57fa[_0x15930b];return _0x319fc8;};'use strict';var MailQueueEvents=require(_0xa57f('0x0'));var events=[_0xa57f('0x1'),'remove',_0xa57f('0x2')];function createListener(_0x511b96,_0x63a9f8){return function(_0x1f162e){_0x63a9f8[_0xa57f('0x3')](_0x511b96,_0x1f162e);};}function removeListener(_0x7163e2,_0x21e413){return function(){MailQueueEvents[_0xa57f('0x4')](_0x7163e2,_0x21e413);};}exports[_0xa57f('0x5')]=function(_0x5316bc){for(var _0x4ded33=0x0,_0x3d84e9=events['length'];_0x4ded33<_0x3d84e9;_0x4ded33++){var _0x438665=events[_0x4ded33];var _0x871646=createListener(_0xa57f('0x6')+_0x438665,_0x5316bc);MailQueueEvents['on'](_0x438665,_0x871646);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 19fe7d6..a306ad9 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 _0x805c=['../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x22314a,_0x3274e6){var _0x4c758c=function(_0x46d29f){while(--_0x46d29f){_0x22314a['push'](_0x22314a['shift']());}};_0x4c758c(++_0x3274e6);}(_0x805c,0x86));var _0xc805=function(_0x505def,_0x5e27bc){_0x505def=_0x505def-0x0;var _0x483a77=_0x805c[_0x505def];return _0x483a77;};'use strict';var multer=require('multer');var util=require(_0xc805('0x0'));var path=require(_0xc805('0x1'));var timeout=require(_0xc805('0x2'));var express=require(_0xc805('0x3'));var router=express[_0xc805('0x4')]();var fs_extra=require(_0xc805('0x5'));var auth=require(_0xc805('0x6'));var interaction=require(_0xc805('0x7'));var config=require('../../config/environment');var controller=require(_0xc805('0x8'));router[_0xc805('0x9')]('/',auth[_0xc805('0xa')](),controller['index']);router[_0xc805('0x9')](_0xc805('0xb'),auth[_0xc805('0xa')](),controller[_0xc805('0xc')]);router[_0xc805('0x9')]('/:id',auth[_0xc805('0xa')](),controller[_0xc805('0xd')]);router[_0xc805('0xe')]('/',auth[_0xc805('0xa')](),controller['create']);router[_0xc805('0xf')](_0xc805('0x10'),auth[_0xc805('0xa')](),controller['update']);router[_0xc805('0x11')](_0xc805('0x10'),auth[_0xc805('0xa')](),controller[_0xc805('0x12')]);module[_0xc805('0x13')]=router; \ No newline at end of file +var _0xe32e=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe32e,0x1e1));var _0xee32=function(_0x1c96f2,_0x36386f){_0x1c96f2=_0x1c96f2-0x0;var _0x1ad75b=_0xe32e[_0x1c96f2];return _0x1ad75b;};'use strict';var multer=require(_0xee32('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee32('0x1'));var express=require(_0xee32('0x2'));var router=express[_0xee32('0x3')]();var fs_extra=require(_0xee32('0x4'));var auth=require(_0xee32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xee32('0x6'));var controller=require(_0xee32('0x7'));router[_0xee32('0x8')]('/',auth[_0xee32('0x9')](),controller[_0xee32('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xee32('0xb')]);router['get'](_0xee32('0xc'),auth[_0xee32('0x9')](),controller[_0xee32('0xd')]);router[_0xee32('0xe')]('/',auth[_0xee32('0x9')](),controller[_0xee32('0xf')]);router[_0xee32('0x10')]('/:id',auth[_0xee32('0x9')](),controller[_0xee32('0x11')]);router[_0xee32('0x12')](_0xee32('0xc'),auth['isAuthenticated'](),controller[_0xee32('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index a5ed3d7..69a30dd 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 _0xc6e2=['DATE','sequelize','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc6e2,0xa9));var _0x2c6e=function(_0x4d2b07,_0x2ad2b1){_0x4d2b07=_0x4d2b07-0x0;var _0x5126d2=_0xc6e2[_0x4d2b07];return _0x5126d2;};'use strict';var moment=require('moment');var Sequelize=require(_0x2c6e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2c6e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2c6e('0x1')]},'joinAt':{'type':Sequelize[_0x2c6e('0x2')]},'leaveAt':{'type':Sequelize[_0x2c6e('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2c6e('0x2')]},'reason':{'type':Sequelize[_0x2c6e('0x1')]}}; \ No newline at end of file +var _0x8917=['exports','STRING','DATE','moment'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x8917,0x1d7));var _0x7891=function(_0x5be547,_0x16754f){_0x5be547=_0x5be547-0x0;var _0xbfa6a=_0x8917[_0x5be547];return _0xbfa6a;};'use strict';var moment=require(_0x7891('0x0'));var Sequelize=require('sequelize');module[_0x7891('0x1')]={'uniqueid':{'type':Sequelize[_0x7891('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7891('0x2')]},'joinAt':{'type':Sequelize[_0x7891('0x3')]},'leaveAt':{'type':Sequelize[_0x7891('0x3')]},'acceptAt':{'type':Sequelize[_0x7891('0x3')]},'exitAt':{'type':Sequelize[_0x7891('0x3')]},'reason':{'type':Sequelize[_0x7891('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 87df7d0..10c4ff3 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 _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(_0x2a6092,_0x544d7f){var _0x3a2c1f=function(_0x31b092){while(--_0x31b092){_0x2a6092['push'](_0x2a6092['shift']());}};_0x3a2c1f(++_0x544d7f);}(_0x32b6,0x1d1));var _0x632b=function(_0x3d2fd7,_0x41eeaa){_0x3d2fd7=_0x3d2fd7-0x0;var _0x254ef2=_0x32b6[_0x3d2fd7];return _0x254ef2;};'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 +var _0xdb28=['index','MailQueueReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x50a01e,_0x2a5f70){var _0x383853=function(_0x5a163c){while(--_0x5a163c){_0x50a01e['push'](_0x50a01e['shift']());}};_0x383853(++_0x2a5f70);}(_0xdb28,0x106));var _0x8db2=function(_0x2064b0,_0x211882){_0x2064b0=_0x2064b0-0x0;var _0x32e29a=_0xdb28[_0x2064b0];return _0x32e29a;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d3e2f74..7bdda7a 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 _0x6cb6=['report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport'];(function(_0x13834a,_0x4b6d38){var _0x20050c=function(_0x588874){while(--_0x588874){_0x13834a['push'](_0x13834a['shift']());}};_0x20050c(++_0x4b6d38);}(_0x6cb6,0x120));var _0x66cb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6cb6[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x66cb('0x0'));var util=require(_0x66cb('0x1'));var logger=require(_0x66cb('0x2'))('api');var moment=require(_0x66cb('0x3'));var BPromise=require(_0x66cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66cb('0x5'));var rimraf=require(_0x66cb('0x6'));var config=require(_0x66cb('0x7'));var attributes=require(_0x66cb('0x8'));module[_0x66cb('0x9')]=function(_0x3cb408,_0x103ef8){return _0x3cb408['define'](_0x66cb('0xa'),attributes,{'tableName':_0x66cb('0xb'),'paranoid':![],'indexes':[{'name':_0x66cb('0xc'),'fields':[_0x66cb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5484=['bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5484,0x145));var _0x4548=function(_0x43fd89,_0x435325){_0x43fd89=_0x43fd89-0x0;var _0x2b1e86=_0x5484[_0x43fd89];return _0x2b1e86;};'use strict';var _=require(_0x4548('0x0'));var util=require(_0x4548('0x1'));var logger=require(_0x4548('0x2'))(_0x4548('0x3'));var moment=require(_0x4548('0x4'));var BPromise=require(_0x4548('0x5'));var rp=require(_0x4548('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4548('0x7'));var config=require(_0x4548('0x8'));var attributes=require(_0x4548('0x9'));module[_0x4548('0xa')]=function(_0x3b311d,_0x26d984){return _0x3b311d[_0x4548('0xb')](_0x4548('0xc'),attributes,{'tableName':_0x4548('0xd'),'paranoid':![],'indexes':[{'name':_0x4548('0xe'),'fields':[_0x4548('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 6b18c47..5164686 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x20e187,_0x34f8ba){var _0x3b06d3=function(_0x2f14b3){while(--_0x2f14b3){_0x20e187['push'](_0x20e187['shift']());}};_0x3b06d3(++_0x34f8ba);}(_0x7a54,0x106));var _0x47a5=function(_0x371ee2,_0x3bbdba){_0x371ee2=_0x371ee2-0x0;var _0x50f4bf=_0x7a54[_0x371ee2];return _0x50f4bf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x226560,_0x5ac69b){var _0x4ee11d=function(_0x303e51){while(--_0x303e51){_0x226560['push'](_0x226560['shift']());}};_0x4ee11d(++_0x5ac69b);}(_0x7a54,0x106));var _0x47a5=function(_0xa41164,_0x2d85ae){_0xa41164=_0xa41164-0x0;var _0x580700=_0x7a54[_0xa41164];return _0x580700;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index eb0e120..c13fd79 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ccfe3,_0x423a2a){var _0x4cfed0=function(_0x1b0868){while(--_0x1b0868){_0x5ccfe3['push'](_0x5ccfe3['shift']());}};_0x4cfed0(++_0x423a2a);}(_0xe706,0xa3));var _0x6e70=function(_0x2587ca,_0x231303){_0x2587ca=_0x2587ca-0x0;var _0x5aada1=_0xe706[_0x2587ca];return _0x5aada1;};'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(_0x2c03ca,_0xad92ca){var _0xe670b=function(_0x3c673){while(--_0x3c673){_0x2c03ca['push'](_0x2c03ca['shift']());}};_0xe670b(++_0xad92ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 4b73fd8..ef20202 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 _0xf290=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x25cd2c,_0x57498e){var _0x1e364c=function(_0x35ac2e){while(--_0x35ac2e){_0x25cd2c['push'](_0x25cd2c['shift']());}};_0x1e364c(++_0x57498e);}(_0xf290,0xde));var _0x0f29=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xf290[_0x255ac0];return _0x437bf1;};'use strict';var Sequelize=require('sequelize');module[_0x0f29('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0f29('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x0f29('0x1')]},'password':{'type':Sequelize[_0x0f29('0x1')]},'port':{'type':Sequelize[_0x0f29('0x2')]},'tls':{'type':Sequelize[_0x0f29('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0f29('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x0f29('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x0f29('0x1')]}}; \ No newline at end of file +var _0x9354=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x794cdc,_0x59809d){var _0x4a65a6=function(_0x52358b){while(--_0x52358b){_0x794cdc['push'](_0x794cdc['shift']());}};_0x4a65a6(++_0x59809d);}(_0x9354,0x96));var _0x4935=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x9354[_0x1ad901];return _0x3c0249;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'description':{'type':Sequelize[_0x4935('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4935('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4935('0x1')]},'password':{'type':Sequelize[_0x4935('0x1')]},'port':{'type':Sequelize[_0x4935('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4935('0x1')],'defaultValue':_0x4935('0x4')},'connTimeout':{'type':Sequelize[_0x4935('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4935('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4935('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ddf5776..e5be706 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 _0x8b05=['moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8b05,0x8c));var _0x58b0=function(_0x23c305,_0x53d139){_0x23c305=_0x23c305-0x0;var _0x518249=_0x8b05[_0x23c305];return _0x518249;};'use strict';var _=require(_0x58b0('0x0'));var util=require(_0x58b0('0x1'));var logger=require(_0x58b0('0x2'))(_0x58b0('0x3'));var moment=require(_0x58b0('0x4'));var BPromise=require('bluebird');var rp=require(_0x58b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58b0('0x6'));var config=require(_0x58b0('0x7'));var attributes=require(_0x58b0('0x8'));module[_0x58b0('0x9')]=function(_0x56014b,_0x202b61){return _0x56014b[_0x58b0('0xa')]('MailServerIn',attributes,{'tableName':_0x58b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ec2=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x11de32,_0x3eb7de){var _0x1fd191=function(_0xf8451a){while(--_0xf8451a){_0x11de32['push'](_0x11de32['shift']());}};_0x1fd191(++_0x3eb7de);}(_0x8ec2,0xfa));var _0x28ec=function(_0x3cce4c,_0x2ebb5b){_0x3cce4c=_0x3cce4c-0x0;var _0x387d76=_0x8ec2[_0x3cce4c];return _0x387d76;};'use strict';var _=require(_0x28ec('0x0'));var util=require(_0x28ec('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x28ec('0x2'));var rp=require(_0x28ec('0x3'));var fs=require('fs');var path=require(_0x28ec('0x4'));var rimraf=require(_0x28ec('0x5'));var config=require(_0x28ec('0x6'));var attributes=require(_0x28ec('0x7'));module[_0x28ec('0x8')]=function(_0x35af7f,_0x40fb99){return _0x35af7f[_0x28ec('0x9')](_0x28ec('0xa'),attributes,{'tableName':_0x28ec('0xb'),'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 06e283c..0451bec 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 _0x0341=['then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','attributes','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xe6cf65,_0x47dd66){var _0x248487=function(_0x5b8c85){while(--_0x5b8c85){_0xe6cf65['push'](_0xe6cf65['shift']());}};_0x248487(++_0x47dd66);}(_0x0341,0x7f));var _0x1034=function(_0xc882f4,_0x362a9a){_0xc882f4=_0xc882f4-0x0;var _0x4d2ec6=_0x0341[_0xc882f4];return _0x4d2ec6;};'use strict';var _=require(_0x1034('0x0'));var util=require(_0x1034('0x1'));var moment=require(_0x1034('0x2'));var BPromise=require(_0x1034('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1034('0x4'));var db=require(_0x1034('0x5'))['db'];var utils=require(_0x1034('0x6'));var logger=require(_0x1034('0x7'))(_0x1034('0x8'));var config=require(_0x1034('0x9'));var jayson=require(_0x1034('0xa'));var client=jayson[_0x1034('0xb')][_0x1034('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33640a,_0x249d4f,_0x11e9ec){return new BPromise(function(_0x4f3dae,_0x4aa3e9){return client['request'](_0x33640a,_0x11e9ec)[_0x1034('0xd')](function(_0x4ed33b){logger['info'](_0x1034('0xe'),_0x249d4f,_0x1034('0xf'));logger[_0x1034('0x10')](_0x1034('0x11'),_0x249d4f,_0x1034('0xf'),JSON[_0x1034('0x12')](_0x4ed33b));if(_0x4ed33b[_0x1034('0x13')]){if(_0x4ed33b[_0x1034('0x13')][_0x1034('0x14')]===0x1f4){logger[_0x1034('0x13')](_0x1034('0xe'),_0x249d4f,_0x4ed33b[_0x1034('0x13')]['message']);return _0x4aa3e9(_0x4ed33b[_0x1034('0x13')][_0x1034('0x15')]);}logger['error'](_0x1034('0xe'),_0x249d4f,_0x4ed33b[_0x1034('0x13')][_0x1034('0x15')]);return _0x4f3dae(_0x4ed33b[_0x1034('0x13')]['message']);}else{logger[_0x1034('0x16')]('MailServerIn,\x20%s,\x20%s',_0x249d4f,'request\x20sent');_0x4f3dae(_0x4ed33b[_0x1034('0x17')][_0x1034('0x15')]);}})[_0x1034('0x18')](function(_0x2a2547){logger['error'](_0x1034('0xe'),_0x249d4f,_0x2a2547);_0x4aa3e9(_0x2a2547);});});}exports[_0x1034('0x19')]=function(_0x3285a5){var _0x5cb537=this;return new Promise(function(_0x1f9401,_0x387503){return db[_0x1034('0x1a')][_0x1034('0x1b')]({'raw':_0x3285a5['options']?_0x3285a5[_0x1034('0x1c')][_0x1034('0x1d')]===undefined?!![]:![]:!![],'where':_0x3285a5[_0x1034('0x1c')]?_0x3285a5[_0x1034('0x1c')]['where']||null:null,'attributes':_0x3285a5[_0x1034('0x1c')]?_0x3285a5['options']['attributes']||null:null,'limit':_0x3285a5['options']?_0x3285a5[_0x1034('0x1c')][_0x1034('0x1e')]||null:null,'include':_0x3285a5[_0x1034('0x1c')]?_0x3285a5[_0x1034('0x1c')][_0x1034('0x1f')]?_['map'](_0x3285a5[_0x1034('0x1c')][_0x1034('0x1f')],function(_0x4745dc){return{'model':db[_0x4745dc['model']],'as':_0x4745dc['as'],'attributes':_0x4745dc[_0x1034('0x20')],'include':_0x4745dc[_0x1034('0x1f')]?_[_0x1034('0x21')](_0x4745dc[_0x1034('0x1f')],function(_0x2e88b9){return{'model':db[_0x2e88b9['model']],'as':_0x2e88b9['as'],'attributes':_0x2e88b9[_0x1034('0x20')],'include':_0x2e88b9[_0x1034('0x1f')]?_[_0x1034('0x21')](_0x2e88b9[_0x1034('0x1f')],function(_0x878164){return{'model':db[_0x878164[_0x1034('0x22')]],'as':_0x878164['as'],'attributes':_0x878164[_0x1034('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x213917){logger[_0x1034('0x16')](_0x1034('0x19'),_0x3285a5);logger[_0x1034('0x10')]('GetMailServerIn',_0x3285a5,JSON[_0x1034('0x12')](_0x213917));_0x1f9401(_0x213917);})[_0x1034('0x18')](function(_0xa72b63){logger[_0x1034('0x13')](_0x1034('0x19'),_0xa72b63['message'],_0x3285a5);_0x387503(_0x5cb537['error'](0x1f4,_0xa72b63[_0x1034('0x15')]));});});}; \ No newline at end of file +var _0x1123=['GetMailServerIn','findAll','options','raw','attributes','limit','include','model','map','debug','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4dd068,_0xd8a38f){var _0x3ce5fd=function(_0x3317df){while(--_0x3317df){_0x4dd068['push'](_0x4dd068['shift']());}};_0x3ce5fd(++_0xd8a38f);}(_0x1123,0x118));var _0x3112=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1123[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3112('0x0'));var BPromise=require('bluebird');var rs=require(_0x3112('0x1'));var fs=require('fs');var Redis=require(_0x3112('0x2'));var db=require(_0x3112('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3112('0x4'));var config=require(_0x3112('0x5'));var jayson=require(_0x3112('0x6'));var client=jayson[_0x3112('0x7')][_0x3112('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e2b5c,_0x3bee38,_0x3f7ae4){return new BPromise(function(_0x3cd83c,_0x4849f9){return client[_0x3112('0x9')](_0x3e2b5c,_0x3f7ae4)[_0x3112('0xa')](function(_0x39b75b){logger[_0x3112('0xb')](_0x3112('0xc'),_0x3bee38,_0x3112('0xd'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'),JSON[_0x3112('0xe')](_0x39b75b));if(_0x39b75b[_0x3112('0xf')]){if(_0x39b75b[_0x3112('0xf')][_0x3112('0x10')]===0x1f4){logger['error'](_0x3112('0xc'),_0x3bee38,_0x39b75b['error']['message']);return _0x4849f9(_0x39b75b[_0x3112('0xf')][_0x3112('0x11')]);}logger[_0x3112('0xf')]('MailServerIn,\x20%s,\x20%s',_0x3bee38,_0x39b75b['error'][_0x3112('0x11')]);return _0x3cd83c(_0x39b75b['error'][_0x3112('0x11')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'));_0x3cd83c(_0x39b75b[_0x3112('0x12')]['message']);}})[_0x3112('0x13')](function(_0x3f5cfd){logger['error']('MailServerIn,\x20%s,\x20%s',_0x3bee38,_0x3f5cfd);_0x4849f9(_0x3f5cfd);});});}exports[_0x3112('0x14')]=function(_0x5ca7d9){var _0x254ffc=this;return new Promise(function(_0x22925b,_0x5e9262){return db['MailServerIn'][_0x3112('0x15')]({'raw':_0x5ca7d9[_0x3112('0x16')]?_0x5ca7d9[_0x3112('0x16')][_0x3112('0x17')]===undefined?!![]:![]:!![],'where':_0x5ca7d9[_0x3112('0x16')]?_0x5ca7d9[_0x3112('0x16')]['where']||null:null,'attributes':_0x5ca7d9[_0x3112('0x16')]?_0x5ca7d9['options'][_0x3112('0x18')]||null:null,'limit':_0x5ca7d9[_0x3112('0x16')]?_0x5ca7d9[_0x3112('0x16')][_0x3112('0x19')]||null:null,'include':_0x5ca7d9[_0x3112('0x16')]?_0x5ca7d9['options'][_0x3112('0x1a')]?_['map'](_0x5ca7d9[_0x3112('0x16')]['include'],function(_0x537e31){return{'model':db[_0x537e31[_0x3112('0x1b')]],'as':_0x537e31['as'],'attributes':_0x537e31['attributes'],'include':_0x537e31[_0x3112('0x1a')]?_[_0x3112('0x1c')](_0x537e31[_0x3112('0x1a')],function(_0x4d898d){return{'model':db[_0x4d898d[_0x3112('0x1b')]],'as':_0x4d898d['as'],'attributes':_0x4d898d[_0x3112('0x18')],'include':_0x4d898d[_0x3112('0x1a')]?_[_0x3112('0x1c')](_0x4d898d['include'],function(_0x34ca6d){return{'model':db[_0x34ca6d[_0x3112('0x1b')]],'as':_0x34ca6d['as'],'attributes':_0x34ca6d['attributes']};}):[]};}):[]};}):[]:[]})[_0x3112('0xa')](function(_0x58f21f){logger[_0x3112('0xb')](_0x3112('0x14'),_0x5ca7d9);logger[_0x3112('0x1d')](_0x3112('0x14'),_0x5ca7d9,JSON[_0x3112('0xe')](_0x58f21f));_0x22925b(_0x58f21f);})['catch'](function(_0x1d1e4a){logger['error'](_0x3112('0x14'),_0x1d1e4a['message'],_0x5ca7d9);_0x5e9262(_0x254ffc[_0x3112('0xf')](0x1f4,_0x1d1e4a[_0x3112('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0cfa84c..89a4657 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(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x7a54,0x106));var _0x47a5=function(_0x3f85eb,_0x2396b2){_0x3f85eb=_0x3f85eb-0x0;var _0x24d666=_0x7a54[_0x3f85eb];return _0x24d666;};'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 9edbdc9..e2ca4d7 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 _0x5a13=['STRING','INTEGER','exports'];(function(_0xe58ce,_0x231911){var _0x47fdea=function(_0xb5148){while(--_0xb5148){_0xe58ce['push'](_0xe58ce['shift']());}};_0x47fdea(++_0x231911);}(_0x5a13,0x92));var _0x35a1=function(_0x173df5,_0x1e2869){_0x173df5=_0x173df5-0x0;var _0x4a6bac=_0x5a13[_0x173df5];return _0x4a6bac;};'use strict';var Sequelize=require('sequelize');module[_0x35a1('0x0')]={'description':{'type':Sequelize[_0x35a1('0x1')]},'host':{'type':Sequelize[_0x35a1('0x1')]},'user':{'type':Sequelize[_0x35a1('0x1')]},'pass':{'type':Sequelize[_0x35a1('0x1')]},'port':{'type':Sequelize[_0x35a1('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x35a1('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x36b7=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0xfc5c63,_0x487d42){var _0xe463e9=function(_0x56f413){while(--_0x56f413){_0xfc5c63['push'](_0xfc5c63['shift']());}};_0xe463e9(++_0x487d42);}(_0x36b7,0x1a5));var _0x736b=function(_0x3c1012,_0x2ad51e){_0x3c1012=_0x3c1012-0x0;var _0x3c32a3=_0x36b7[_0x3c1012];return _0x3c32a3;};'use strict';var Sequelize=require(_0x736b('0x0'));module[_0x736b('0x1')]={'description':{'type':Sequelize[_0x736b('0x2')]},'host':{'type':Sequelize[_0x736b('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x736b('0x2')]},'port':{'type':Sequelize[_0x736b('0x3')]},'secure':{'type':Sequelize[_0x736b('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x736b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e5fc6ef..d8b4dd5 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 _0xd307=['include','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','MailServerOut','includeAll'];(function(_0x3c76fc,_0x39e116){var _0x4755f5=function(_0x493e01){while(--_0x493e01){_0x3c76fc['push'](_0x3c76fc['shift']());}};_0x4755f5(++_0x39e116);}(_0xd307,0x17c));var _0x7d30=function(_0x26a654,_0x4e9c15){_0x26a654=_0x26a654-0x0;var _0x106b42=_0xd307[_0x26a654];return _0x106b42;};'use strict';var emlformat=require(_0x7d30('0x0'));var rimraf=require(_0x7d30('0x1'));var zipdir=require(_0x7d30('0x2'));var jsonpatch=require(_0x7d30('0x3'));var rp=require('request-promise');var moment=require(_0x7d30('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d30('0x5'));var path=require('path');var sox=require(_0x7d30('0x6'));var csv=require(_0x7d30('0x7'));var ejs=require(_0x7d30('0x8'));var fs=require('fs');var fs_extra=require(_0x7d30('0x9'));var _=require(_0x7d30('0xa'));var squel=require('squel');var crypto=require(_0x7d30('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d30('0x7'));var querystring=require(_0x7d30('0xc'));var Papa=require(_0x7d30('0xd'));var Redis=require(_0x7d30('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7d30('0xf'));var as=require(_0x7d30('0x10'));var hardwareService=require(_0x7d30('0x11'));var logger=require(_0x7d30('0x12'))(_0x7d30('0x13'));var utils=require(_0x7d30('0x14'));var config=require(_0x7d30('0x15'));var licenseUtil=require(_0x7d30('0x16'));var db=require(_0x7d30('0x17'))['db'];function respondWithStatusCode(_0x2f744d,_0x17f991){_0x17f991=_0x17f991||0xcc;return function(_0x217f25){if(_0x217f25){return _0x2f744d[_0x7d30('0x18')](_0x17f991);}return _0x2f744d[_0x7d30('0x19')](_0x17f991)[_0x7d30('0x1a')]();};}function respondWithResult(_0x1bed2b,_0x30774d){_0x30774d=_0x30774d||0xc8;return function(_0x5c3ebb){if(_0x5c3ebb){return _0x1bed2b[_0x7d30('0x19')](_0x30774d)[_0x7d30('0x1b')](_0x5c3ebb);}};}function respondWithFilteredResult(_0x5a1ba7,_0x1c5ed4){return function(_0x2f05b6){if(_0x2f05b6){var _0x2c6bd5=typeof _0x1c5ed4[_0x7d30('0x1c')]==='undefined'&&typeof _0x1c5ed4[_0x7d30('0x1d')]===_0x7d30('0x1e');var _0x4db02a=_0x2f05b6[_0x7d30('0x1f')];var _0x15ca74=_0x2c6bd5?0x0:_0x1c5ed4[_0x7d30('0x1c')];var _0x196ffe=_0x2c6bd5?_0x2f05b6[_0x7d30('0x1f')]:_0x1c5ed4[_0x7d30('0x1c')]+_0x1c5ed4[_0x7d30('0x1d')];var _0x5b1f17;if(_0x196ffe>=_0x4db02a){_0x196ffe=_0x4db02a;_0x5b1f17=0xc8;}else{_0x5b1f17=0xce;}_0x5a1ba7[_0x7d30('0x19')](_0x5b1f17);return _0x5a1ba7[_0x7d30('0x20')]('Content-Range',_0x15ca74+'-'+_0x196ffe+'/'+_0x4db02a)[_0x7d30('0x1b')](_0x2f05b6);}return null;};}function patchUpdates(_0x5c9b6b){return function(_0x4422ea){try{jsonpatch[_0x7d30('0x21')](_0x4422ea,_0x5c9b6b,!![]);}catch(_0x47f02e){return BPromise[_0x7d30('0x22')](_0x47f02e);}return _0x4422ea['save']();};}function saveUpdates(_0x181ae3,_0x36b090){return function(_0x4c134d){if(_0x4c134d){return _0x4c134d['update'](_0x181ae3)[_0x7d30('0x23')](function(_0x4e6132){return _0x4e6132;});}return null;};}function removeEntity(_0x4ba163,_0x12876f){return function(_0x4b05e5){if(_0x4b05e5){return _0x4b05e5[_0x7d30('0x24')]()[_0x7d30('0x23')](function(){_0x4ba163['status'](0xcc)[_0x7d30('0x1a')]();});}};}function handleEntityNotFound(_0x17b45b,_0x561a2b){return function(_0x35e7b5){if(!_0x35e7b5){_0x17b45b['sendStatus'](0x194);}return _0x35e7b5;};}function handleError(_0x162141,_0x53f1ba){_0x53f1ba=_0x53f1ba||0x1f4;return function(_0x73eec8){logger[_0x7d30('0x25')](_0x73eec8[_0x7d30('0x26')]);if(_0x73eec8[_0x7d30('0x27')]){delete _0x73eec8[_0x7d30('0x27')];}_0x162141[_0x7d30('0x19')](_0x53f1ba)[_0x7d30('0x28')](_0x73eec8);};}exports[_0x7d30('0x29')]=function(_0x266acd,_0x826c55){var _0x149062={},_0x1059de={},_0x5077b2={'count':0x0,'rows':[]};var _0x3efdb2=_['map'](db['MailServerOut'][_0x7d30('0x2a')],function(_0x2386b6){return{'name':_0x2386b6['fieldName'],'type':_0x2386b6[_0x7d30('0x2b')][_0x7d30('0x2c')]};});_0x1059de['model']=_[_0x7d30('0x2d')](_0x3efdb2,'name');_0x1059de[_0x7d30('0x2e')]=_[_0x7d30('0x2f')](_0x266acd[_0x7d30('0x2e')]);_0x1059de['filters']=_['intersection'](_0x1059de[_0x7d30('0x30')],_0x1059de['query']);_0x149062[_0x7d30('0x31')]=_[_0x7d30('0x32')](_0x1059de[_0x7d30('0x30')],qs[_0x7d30('0x33')](_0x266acd['query']['fields']));_0x149062['attributes']=_0x149062[_0x7d30('0x31')][_0x7d30('0x34')]?_0x149062[_0x7d30('0x31')]:_0x1059de[_0x7d30('0x30')];if(!_0x266acd[_0x7d30('0x2e')]['hasOwnProperty'](_0x7d30('0x35'))){_0x149062['limit']=qs['limit'](_0x266acd[_0x7d30('0x2e')][_0x7d30('0x1d')]);_0x149062[_0x7d30('0x1c')]=qs[_0x7d30('0x1c')](_0x266acd['query'][_0x7d30('0x1c')]);}_0x149062[_0x7d30('0x36')]=qs[_0x7d30('0x37')](_0x266acd[_0x7d30('0x2e')][_0x7d30('0x37')]);_0x149062[_0x7d30('0x38')]=qs[_0x7d30('0x39')](_['pick'](_0x266acd[_0x7d30('0x2e')],_0x1059de['filters']),_0x3efdb2);if(_0x266acd[_0x7d30('0x2e')][_0x7d30('0x3a')]){_0x149062[_0x7d30('0x38')]=_[_0x7d30('0x3b')](_0x149062['where'],{'$or':_[_0x7d30('0x2d')](_0x3efdb2,function(_0x4bd103){if(_0x4bd103[_0x7d30('0x2b')]!==_0x7d30('0x3c')){var _0x47b90d={};_0x47b90d[_0x4bd103[_0x7d30('0x27')]]={'$like':'%'+_0x266acd[_0x7d30('0x2e')][_0x7d30('0x3a')]+'%'};return _0x47b90d;}})});}_0x149062=_[_0x7d30('0x3b')]({},_0x149062,_0x266acd[_0x7d30('0x3d')]);var _0x2d77db={'where':_0x149062['where']};return db[_0x7d30('0x3e')]['count'](_0x2d77db)[_0x7d30('0x23')](function(_0x2e1ab2){_0x5077b2[_0x7d30('0x1f')]=_0x2e1ab2;if(_0x266acd[_0x7d30('0x2e')][_0x7d30('0x3f')]){_0x149062[_0x7d30('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0x7d30('0x41')](_0x149062);})['then'](function(_0xdf62ca){_0x5077b2[_0x7d30('0x42')]=_0xdf62ca;return _0x5077b2;})[_0x7d30('0x23')](respondWithFilteredResult(_0x826c55,_0x149062))['catch'](handleError(_0x826c55,null));};exports[_0x7d30('0x43')]=function(_0x41f9f7,_0x1fa3a4){var _0x22e233={'raw':!![],'where':{'id':_0x41f9f7[_0x7d30('0x44')]['id']}},_0x426f7a={};_0x426f7a[_0x7d30('0x30')]=_['keys'](db[_0x7d30('0x3e')][_0x7d30('0x2a')]);_0x426f7a[_0x7d30('0x2e')]=_[_0x7d30('0x2f')](_0x41f9f7['query']);_0x426f7a[_0x7d30('0x39')]=_[_0x7d30('0x32')](_0x426f7a[_0x7d30('0x30')],_0x426f7a[_0x7d30('0x2e')]);_0x22e233[_0x7d30('0x31')]=_[_0x7d30('0x32')](_0x426f7a[_0x7d30('0x30')],qs[_0x7d30('0x33')](_0x41f9f7[_0x7d30('0x2e')][_0x7d30('0x33')]));_0x22e233[_0x7d30('0x31')]=_0x22e233[_0x7d30('0x31')]['length']?_0x22e233[_0x7d30('0x31')]:_0x426f7a[_0x7d30('0x30')];if(_0x41f9f7[_0x7d30('0x2e')]['includeAll']){_0x22e233['include']=[{'all':!![]}];}_0x22e233=_[_0x7d30('0x3b')]({},_0x22e233,_0x41f9f7[_0x7d30('0x3d')]);return db['MailServerOut'][_0x7d30('0x45')](_0x22e233)[_0x7d30('0x23')](handleEntityNotFound(_0x1fa3a4,null))[_0x7d30('0x23')](respondWithResult(_0x1fa3a4,null))[_0x7d30('0x46')](handleError(_0x1fa3a4,null));};exports[_0x7d30('0x47')]=function(_0x5775ea,_0x5a5836){return db['MailServerOut']['create'](_0x5775ea[_0x7d30('0x48')],{})['then'](respondWithResult(_0x5a5836,0xc9))[_0x7d30('0x46')](handleError(_0x5a5836,null));};exports[_0x7d30('0x49')]=function(_0x5695d6,_0x5e4cba){if(_0x5695d6['body']['id']){delete _0x5695d6[_0x7d30('0x48')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x5695d6['params']['id']}})[_0x7d30('0x23')](handleEntityNotFound(_0x5e4cba,null))[_0x7d30('0x23')](saveUpdates(_0x5695d6['body'],null))['then'](respondWithResult(_0x5e4cba,null))[_0x7d30('0x46')](handleError(_0x5e4cba,null));};exports[_0x7d30('0x24')]=function(_0x450e7b,_0x2a039e){return db[_0x7d30('0x3e')][_0x7d30('0x45')]({'where':{'id':_0x450e7b[_0x7d30('0x44')]['id']}})[_0x7d30('0x23')](handleEntityNotFound(_0x2a039e,null))[_0x7d30('0x23')](removeEntity(_0x2a039e,null))['catch'](handleError(_0x2a039e,null));}; \ No newline at end of file +var _0xaa4b=['rows','show','params','includeAll','merge','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','where','include','findAll'];(function(_0x29b6e9,_0x3e9ca7){var _0x38587e=function(_0x1efb4c){while(--_0x1efb4c){_0x29b6e9['push'](_0x29b6e9['shift']());}};_0x38587e(++_0x3e9ca7);}(_0xaa4b,0xe7));var _0xbaa4=function(_0x38e90e,_0x382629){_0x38e90e=_0x38e90e-0x0;var _0x1a4486=_0xaa4b[_0x38e90e];return _0x1a4486;};'use strict';var emlformat=require(_0xbaa4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbaa4('0x1'));var jsonpatch=require(_0xbaa4('0x2'));var rp=require(_0xbaa4('0x3'));var moment=require(_0xbaa4('0x4'));var BPromise=require(_0xbaa4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbaa4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbaa4('0x7'));var _=require(_0xbaa4('0x8'));var squel=require('squel');var crypto=require(_0xbaa4('0x9'));var jsforce=require(_0xbaa4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbaa4('0xb'));var querystring=require('querystring');var Papa=require(_0xbaa4('0xc'));var Redis=require(_0xbaa4('0xd'));var authService=require(_0xbaa4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbaa4('0xf'));var hardwareService=require(_0xbaa4('0x10'));var logger=require(_0xbaa4('0x11'))(_0xbaa4('0x12'));var utils=require(_0xbaa4('0x13'));var config=require(_0xbaa4('0x14'));var licenseUtil=require(_0xbaa4('0x15'));var db=require(_0xbaa4('0x16'))['db'];function respondWithStatusCode(_0x350a26,_0x4f68c9){_0x4f68c9=_0x4f68c9||0xcc;return function(_0x38814a){if(_0x38814a){return _0x350a26[_0xbaa4('0x17')](_0x4f68c9);}return _0x350a26[_0xbaa4('0x18')](_0x4f68c9)[_0xbaa4('0x19')]();};}function respondWithResult(_0x37dd87,_0x5f520e){_0x5f520e=_0x5f520e||0xc8;return function(_0x595525){if(_0x595525){return _0x37dd87[_0xbaa4('0x18')](_0x5f520e)[_0xbaa4('0x1a')](_0x595525);}};}function respondWithFilteredResult(_0x2aeed1,_0x239975){return function(_0x4215df){if(_0x4215df){var _0x368c45=typeof _0x239975[_0xbaa4('0x1b')]===_0xbaa4('0x1c')&&typeof _0x239975['limit']===_0xbaa4('0x1c');var _0x3fda6c=_0x4215df[_0xbaa4('0x1d')];var _0x455ca1=_0x368c45?0x0:_0x239975[_0xbaa4('0x1b')];var _0xf1be73=_0x368c45?_0x4215df[_0xbaa4('0x1d')]:_0x239975[_0xbaa4('0x1b')]+_0x239975[_0xbaa4('0x1e')];var _0x35f925;if(_0xf1be73>=_0x3fda6c){_0xf1be73=_0x3fda6c;_0x35f925=0xc8;}else{_0x35f925=0xce;}_0x2aeed1[_0xbaa4('0x18')](_0x35f925);return _0x2aeed1[_0xbaa4('0x1f')](_0xbaa4('0x20'),_0x455ca1+'-'+_0xf1be73+'/'+_0x3fda6c)['json'](_0x4215df);}return null;};}function patchUpdates(_0x444afa){return function(_0x2a34cd){try{jsonpatch[_0xbaa4('0x21')](_0x2a34cd,_0x444afa,!![]);}catch(_0x515060){return BPromise[_0xbaa4('0x22')](_0x515060);}return _0x2a34cd['save']();};}function saveUpdates(_0x59ebd1,_0xceb54){return function(_0x5820ba){if(_0x5820ba){return _0x5820ba[_0xbaa4('0x23')](_0x59ebd1)[_0xbaa4('0x24')](function(_0xe68ece){return _0xe68ece;});}return null;};}function removeEntity(_0xdec06c,_0x38625d){return function(_0x25092c){if(_0x25092c){return _0x25092c[_0xbaa4('0x25')]()[_0xbaa4('0x24')](function(){_0xdec06c[_0xbaa4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x444f1f,_0x1b2527){return function(_0x39ac98){if(!_0x39ac98){_0x444f1f[_0xbaa4('0x17')](0x194);}return _0x39ac98;};}function handleError(_0xe2c13e,_0x35fcfc){_0x35fcfc=_0x35fcfc||0x1f4;return function(_0x3e8515){logger[_0xbaa4('0x26')](_0x3e8515[_0xbaa4('0x27')]);if(_0x3e8515[_0xbaa4('0x28')]){delete _0x3e8515['name'];}_0xe2c13e[_0xbaa4('0x18')](_0x35fcfc)[_0xbaa4('0x29')](_0x3e8515);};}exports[_0xbaa4('0x2a')]=function(_0x5427e3,_0x3547a9){var _0x47a6f4={},_0xa05e0d={},_0x2e8c79={'count':0x0,'rows':[]};var _0x3fd72d=_['map'](db[_0xbaa4('0x2b')][_0xbaa4('0x2c')],function(_0x3fcfe4){return{'name':_0x3fcfe4[_0xbaa4('0x2d')],'type':_0x3fcfe4[_0xbaa4('0x2e')]['key']};});_0xa05e0d['model']=_[_0xbaa4('0x2f')](_0x3fd72d,_0xbaa4('0x28'));_0xa05e0d[_0xbaa4('0x30')]=_[_0xbaa4('0x31')](_0x5427e3[_0xbaa4('0x30')]);_0xa05e0d[_0xbaa4('0x32')]=_['intersection'](_0xa05e0d[_0xbaa4('0x33')],_0xa05e0d[_0xbaa4('0x30')]);_0x47a6f4['attributes']=_[_0xbaa4('0x34')](_0xa05e0d['model'],qs[_0xbaa4('0x35')](_0x5427e3['query'][_0xbaa4('0x35')]));_0x47a6f4[_0xbaa4('0x36')]=_0x47a6f4['attributes'][_0xbaa4('0x37')]?_0x47a6f4[_0xbaa4('0x36')]:_0xa05e0d[_0xbaa4('0x33')];if(!_0x5427e3[_0xbaa4('0x30')][_0xbaa4('0x38')](_0xbaa4('0x39'))){_0x47a6f4[_0xbaa4('0x1e')]=qs[_0xbaa4('0x1e')](_0x5427e3[_0xbaa4('0x30')][_0xbaa4('0x1e')]);_0x47a6f4[_0xbaa4('0x1b')]=qs['offset'](_0x5427e3[_0xbaa4('0x30')][_0xbaa4('0x1b')]);}_0x47a6f4[_0xbaa4('0x3a')]=qs[_0xbaa4('0x3b')](_0x5427e3[_0xbaa4('0x30')][_0xbaa4('0x3b')]);_0x47a6f4['where']=qs[_0xbaa4('0x32')](_['pick'](_0x5427e3[_0xbaa4('0x30')],_0xa05e0d[_0xbaa4('0x32')]),_0x3fd72d);if(_0x5427e3[_0xbaa4('0x30')][_0xbaa4('0x3c')]){_0x47a6f4['where']=_['merge'](_0x47a6f4['where'],{'$or':_[_0xbaa4('0x2f')](_0x3fd72d,function(_0x3e77a6){if(_0x3e77a6[_0xbaa4('0x2e')]!==_0xbaa4('0x3d')){var _0x3a2ab7={};_0x3a2ab7[_0x3e77a6[_0xbaa4('0x28')]]={'$like':'%'+_0x5427e3['query'][_0xbaa4('0x3c')]+'%'};return _0x3a2ab7;}})});}_0x47a6f4=_['merge']({},_0x47a6f4,_0x5427e3['options']);var _0x4e5915={'where':_0x47a6f4[_0xbaa4('0x3e')]};return db[_0xbaa4('0x2b')][_0xbaa4('0x1d')](_0x4e5915)[_0xbaa4('0x24')](function(_0x10310c){_0x2e8c79[_0xbaa4('0x1d')]=_0x10310c;if(_0x5427e3['query']['includeAll']){_0x47a6f4[_0xbaa4('0x3f')]=[{'all':!![]}];}return db[_0xbaa4('0x2b')][_0xbaa4('0x40')](_0x47a6f4);})[_0xbaa4('0x24')](function(_0x5f4a0a){_0x2e8c79[_0xbaa4('0x41')]=_0x5f4a0a;return _0x2e8c79;})[_0xbaa4('0x24')](respondWithFilteredResult(_0x3547a9,_0x47a6f4))['catch'](handleError(_0x3547a9,null));};exports[_0xbaa4('0x42')]=function(_0x4f5d85,_0x13a002){var _0x2cffd1={'raw':!![],'where':{'id':_0x4f5d85[_0xbaa4('0x43')]['id']}},_0x528f12={};_0x528f12[_0xbaa4('0x33')]=_['keys'](db[_0xbaa4('0x2b')][_0xbaa4('0x2c')]);_0x528f12[_0xbaa4('0x30')]=_[_0xbaa4('0x31')](_0x4f5d85[_0xbaa4('0x30')]);_0x528f12[_0xbaa4('0x32')]=_[_0xbaa4('0x34')](_0x528f12[_0xbaa4('0x33')],_0x528f12[_0xbaa4('0x30')]);_0x2cffd1['attributes']=_[_0xbaa4('0x34')](_0x528f12[_0xbaa4('0x33')],qs['fields'](_0x4f5d85[_0xbaa4('0x30')]['fields']));_0x2cffd1[_0xbaa4('0x36')]=_0x2cffd1['attributes'][_0xbaa4('0x37')]?_0x2cffd1[_0xbaa4('0x36')]:_0x528f12[_0xbaa4('0x33')];if(_0x4f5d85[_0xbaa4('0x30')][_0xbaa4('0x44')]){_0x2cffd1[_0xbaa4('0x3f')]=[{'all':!![]}];}_0x2cffd1=_[_0xbaa4('0x45')]({},_0x2cffd1,_0x4f5d85['options']);return db['MailServerOut'][_0xbaa4('0x46')](_0x2cffd1)[_0xbaa4('0x24')](handleEntityNotFound(_0x13a002,null))['then'](respondWithResult(_0x13a002,null))[_0xbaa4('0x47')](handleError(_0x13a002,null));};exports[_0xbaa4('0x48')]=function(_0x213a14,_0x3c00fb){return db['MailServerOut'][_0xbaa4('0x48')](_0x213a14[_0xbaa4('0x49')],{})[_0xbaa4('0x24')](respondWithResult(_0x3c00fb,0xc9))['catch'](handleError(_0x3c00fb,null));};exports['update']=function(_0x288e2a,_0x260a09){if(_0x288e2a[_0xbaa4('0x49')]['id']){delete _0x288e2a[_0xbaa4('0x49')]['id'];}return db[_0xbaa4('0x2b')]['find']({'where':{'id':_0x288e2a[_0xbaa4('0x43')]['id']}})['then'](handleEntityNotFound(_0x260a09,null))['then'](saveUpdates(_0x288e2a[_0xbaa4('0x49')],null))[_0xbaa4('0x24')](respondWithResult(_0x260a09,null))[_0xbaa4('0x47')](handleError(_0x260a09,null));};exports[_0xbaa4('0x25')]=function(_0x297242,_0x1aa7ff){return db[_0xbaa4('0x2b')][_0xbaa4('0x46')]({'where':{'id':_0x297242[_0xbaa4('0x43')]['id']}})['then'](handleEntityNotFound(_0x1aa7ff,null))[_0xbaa4('0x24')](removeEntity(_0x1aa7ff,null))[_0xbaa4('0x47')](handleError(_0x1aa7ff,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ace789b..023b8c6 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 _0x0b2b=['./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3611e0,_0x2c593f){var _0x563979=function(_0x5c616c){while(--_0x5c616c){_0x3611e0['push'](_0x3611e0['shift']());}};_0x563979(++_0x2c593f);}(_0x0b2b,0x1b4));var _0xb0b2=function(_0x12c184,_0x2fcb89){_0x12c184=_0x12c184-0x0;var _0xe3d953=_0x0b2b[_0x12c184];return _0xe3d953;};'use strict';var _=require(_0xb0b2('0x0'));var util=require(_0xb0b2('0x1'));var logger=require(_0xb0b2('0x2'))(_0xb0b2('0x3'));var moment=require(_0xb0b2('0x4'));var BPromise=require('bluebird');var rp=require(_0xb0b2('0x5'));var fs=require('fs');var path=require(_0xb0b2('0x6'));var rimraf=require(_0xb0b2('0x7'));var config=require('../../config/environment');var attributes=require(_0xb0b2('0x8'));module[_0xb0b2('0x9')]=function(_0xc400f1,_0x310854){return _0xc400f1[_0xb0b2('0xa')]('MailServerOut',attributes,{'tableName':_0xb0b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf373=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util','../../config/logger','api','bluebird'];(function(_0x382779,_0x4e6f62){var _0x585906=function(_0xe02d93){while(--_0xe02d93){_0x382779['push'](_0x382779['shift']());}};_0x585906(++_0x4e6f62);}(_0xf373,0x100));var _0x3f37=function(_0x59ff4e,_0x48845a){_0x59ff4e=_0x59ff4e-0x0;var _0x289581=_0xf373[_0x59ff4e];return _0x289581;};'use strict';var _=require('lodash');var util=require(_0x3f37('0x0'));var logger=require(_0x3f37('0x1'))(_0x3f37('0x2'));var moment=require('moment');var BPromise=require(_0x3f37('0x3'));var rp=require(_0x3f37('0x4'));var fs=require('fs');var path=require(_0x3f37('0x5'));var rimraf=require(_0x3f37('0x6'));var config=require(_0x3f37('0x7'));var attributes=require(_0x3f37('0x8'));module[_0x3f37('0x9')]=function(_0x1dc53b,_0x5091b6){return _0x1dc53b[_0x3f37('0xa')](_0x3f37('0xb'),attributes,{'tableName':_0x3f37('0xc'),'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 eaa4d1e..282b64d 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x276f43,_0x374577){var _0x27339a=function(_0x1c75c3){while(--_0x1c75c3){_0x276f43['push'](_0x276f43['shift']());}};_0x27339a(++_0x374577);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0x5f2f[_0x28ad6c];return _0x597de8;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x38c09a,_0x3a46f8){var _0xfbabf2=function(_0x481e9b){while(--_0x481e9b){_0x38c09a['push'](_0x38c09a['shift']());}};_0xfbabf2(++_0x3a46f8);}(_0x1261,0x144));var _0x1126=function(_0x3076ed,_0x23db8a){_0x3076ed=_0x3076ed-0x0;var _0x25a6a9=_0x1261[_0x3076ed];return _0x25a6a9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 62fbd75..7d9ab34 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 _0x8e61=['/describe','describe','get','/:id','post','create','put','update','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index'];(function(_0x30baef,_0x2ec3c4){var _0x28abff=function(_0x2e2048){while(--_0x2e2048){_0x30baef['push'](_0x30baef['shift']());}};_0x28abff(++_0x2ec3c4);}(_0x8e61,0x107));var _0x18e6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8e61[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0x18e6('0x0'));var path=require('path');var timeout=require(_0x18e6('0x1'));var express=require(_0x18e6('0x2'));var router=express[_0x18e6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18e6('0x4'));var config=require(_0x18e6('0x5'));var controller=require(_0x18e6('0x6'));router['get']('/',auth[_0x18e6('0x7')](),controller[_0x18e6('0x8')]);router['get'](_0x18e6('0x9'),auth[_0x18e6('0x7')](),controller[_0x18e6('0xa')]);router[_0x18e6('0xb')](_0x18e6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x18e6('0xd')]('/',auth[_0x18e6('0x7')](),controller[_0x18e6('0xe')]);router[_0x18e6('0xf')](_0x18e6('0xc'),auth[_0x18e6('0x7')](),controller[_0x18e6('0x10')]);router['delete'](_0x18e6('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x296f=['create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','/describe','describe','/:id','isAuthenticated','post'];(function(_0x1fccae,_0x26e89b){var _0x39248f=function(_0xdbca75){while(--_0xdbca75){_0x1fccae['push'](_0x1fccae['shift']());}};_0x39248f(++_0x26e89b);}(_0x296f,0x180));var _0xf296=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x296f[_0x550e29];return _0x3515b6;};'use strict';var multer=require('multer');var util=require(_0xf296('0x0'));var path=require(_0xf296('0x1'));var timeout=require(_0xf296('0x2'));var express=require(_0xf296('0x3'));var router=express[_0xf296('0x4')]();var fs_extra=require(_0xf296('0x5'));var auth=require(_0xf296('0x6'));var interaction=require(_0xf296('0x7'));var config=require('../../config/environment');var controller=require(_0xf296('0x8'));router[_0xf296('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf296('0xa'),auth['isAuthenticated'](),controller[_0xf296('0xb')]);router['get'](_0xf296('0xc'),auth[_0xf296('0xd')](),controller['show']);router[_0xf296('0xe')]('/',auth[_0xf296('0xd')](),controller[_0xf296('0xf')]);router[_0xf296('0x10')](_0xf296('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf296('0x11')](_0xf296('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf296('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 25e07f8..fb67c7a 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 _0xdbb1=['STRING','sequelize'];(function(_0x52151e,_0x3eeeba){var _0x9d0b80=function(_0x374fc4){while(--_0x374fc4){_0x52151e['push'](_0x52151e['shift']());}};_0x9d0b80(++_0x3eeeba);}(_0xdbb1,0x105));var _0x1dbb=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xdbb1[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0x1dbb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1dbb('0x1')]}}; \ No newline at end of file +var _0x4fb4=['name','exports','STRING'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0x4fb4,0x190));var _0x44fb=function(_0x549de,_0x2fe08c){_0x549de=_0x549de-0x0;var _0x4f8cb3=_0x4fb4[_0x549de];return _0x4f8cb3;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')],'unique':_0x44fb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x44fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 35ebc4a..eca4c28 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 _0xcd75=['zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','MailSubstatus','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xcd75,0x132));var _0x5cd7=function(_0x4dc8a4,_0x45cb4c){_0x4dc8a4=_0x4dc8a4-0x0;var _0x20db09=_0xcd75[_0x4dc8a4];return _0x20db09;};'use strict';var emlformat=require(_0x5cd7('0x0'));var rimraf=require(_0x5cd7('0x1'));var zipdir=require(_0x5cd7('0x2'));var jsonpatch=require(_0x5cd7('0x3'));var rp=require(_0x5cd7('0x4'));var moment=require(_0x5cd7('0x5'));var BPromise=require(_0x5cd7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5cd7('0x7'));var sox=require(_0x5cd7('0x8'));var csv=require(_0x5cd7('0x9'));var ejs=require(_0x5cd7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5cd7('0xb'));var crypto=require(_0x5cd7('0xc'));var jsforce=require(_0x5cd7('0xd'));var deskjs=require(_0x5cd7('0xe'));var toCsv=require(_0x5cd7('0x9'));var querystring=require('querystring');var Papa=require(_0x5cd7('0xf'));var Redis=require(_0x5cd7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5cd7('0x11'));var as=require(_0x5cd7('0x12'));var hardwareService=require(_0x5cd7('0x13'));var logger=require('../../config/logger')(_0x5cd7('0x14'));var utils=require(_0x5cd7('0x15'));var config=require(_0x5cd7('0x16'));var licenseUtil=require(_0x5cd7('0x17'));var db=require(_0x5cd7('0x18'))['db'];function respondWithStatusCode(_0x183d2f,_0x4eda3a){_0x4eda3a=_0x4eda3a||0xcc;return function(_0x11cc67){if(_0x11cc67){return _0x183d2f[_0x5cd7('0x19')](_0x4eda3a);}return _0x183d2f[_0x5cd7('0x1a')](_0x4eda3a)[_0x5cd7('0x1b')]();};}function respondWithResult(_0x1bcbac,_0x214bec){_0x214bec=_0x214bec||0xc8;return function(_0x91dc68){if(_0x91dc68){return _0x1bcbac[_0x5cd7('0x1a')](_0x214bec)[_0x5cd7('0x1c')](_0x91dc68);}};}function respondWithFilteredResult(_0x36275e,_0xdd1f8){return function(_0x1a0848){if(_0x1a0848){var _0x5b82a8=typeof _0xdd1f8[_0x5cd7('0x1d')]===_0x5cd7('0x1e')&&typeof _0xdd1f8[_0x5cd7('0x1f')]===_0x5cd7('0x1e');var _0x299bba=_0x1a0848[_0x5cd7('0x20')];var _0x1a5064=_0x5b82a8?0x0:_0xdd1f8['offset'];var _0x50964b=_0x5b82a8?_0x1a0848[_0x5cd7('0x20')]:_0xdd1f8[_0x5cd7('0x1d')]+_0xdd1f8[_0x5cd7('0x1f')];var _0xfa712e;if(_0x50964b>=_0x299bba){_0x50964b=_0x299bba;_0xfa712e=0xc8;}else{_0xfa712e=0xce;}_0x36275e[_0x5cd7('0x1a')](_0xfa712e);return _0x36275e[_0x5cd7('0x21')]('Content-Range',_0x1a5064+'-'+_0x50964b+'/'+_0x299bba)['json'](_0x1a0848);}return null;};}function patchUpdates(_0x3b758a){return function(_0x5f2ab2){try{jsonpatch[_0x5cd7('0x22')](_0x5f2ab2,_0x3b758a,!![]);}catch(_0x5b5b2a){return BPromise[_0x5cd7('0x23')](_0x5b5b2a);}return _0x5f2ab2[_0x5cd7('0x24')]();};}function saveUpdates(_0x12e150,_0x5a4bcd){return function(_0x2d04c5){if(_0x2d04c5){return _0x2d04c5[_0x5cd7('0x25')](_0x12e150)[_0x5cd7('0x26')](function(_0x4d4580){return _0x4d4580;});}return null;};}function removeEntity(_0x38015e,_0x55cc72){return function(_0x111196){if(_0x111196){return _0x111196[_0x5cd7('0x27')]()[_0x5cd7('0x26')](function(){_0x38015e[_0x5cd7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cdc59,_0x380bc5){return function(_0x13d645){if(!_0x13d645){_0x5cdc59['sendStatus'](0x194);}return _0x13d645;};}function handleError(_0x189f71,_0xf0b3e5){_0xf0b3e5=_0xf0b3e5||0x1f4;return function(_0x4d21a5){logger[_0x5cd7('0x28')](_0x4d21a5['stack']);if(_0x4d21a5[_0x5cd7('0x29')]){delete _0x4d21a5[_0x5cd7('0x29')];}_0x189f71[_0x5cd7('0x1a')](_0xf0b3e5)[_0x5cd7('0x2a')](_0x4d21a5);};}exports[_0x5cd7('0x2b')]=function(_0x46bb28,_0x1cd544){var _0x15f976={},_0x2f3552={},_0x5e723c={'count':0x0,'rows':[]};var _0x205813=_['map'](db[_0x5cd7('0x2c')][_0x5cd7('0x2d')],function(_0xaa371f){return{'name':_0xaa371f[_0x5cd7('0x2e')],'type':_0xaa371f[_0x5cd7('0x2f')]['key']};});_0x2f3552[_0x5cd7('0x30')]=_[_0x5cd7('0x31')](_0x205813,_0x5cd7('0x29'));_0x2f3552[_0x5cd7('0x32')]=_[_0x5cd7('0x33')](_0x46bb28['query']);_0x2f3552[_0x5cd7('0x34')]=_['intersection'](_0x2f3552[_0x5cd7('0x30')],_0x2f3552['query']);_0x15f976[_0x5cd7('0x35')]=_[_0x5cd7('0x36')](_0x2f3552[_0x5cd7('0x30')],qs[_0x5cd7('0x37')](_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x37')]));_0x15f976[_0x5cd7('0x35')]=_0x15f976[_0x5cd7('0x35')][_0x5cd7('0x38')]?_0x15f976[_0x5cd7('0x35')]:_0x2f3552[_0x5cd7('0x30')];if(!_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x39')](_0x5cd7('0x3a'))){_0x15f976[_0x5cd7('0x1f')]=qs[_0x5cd7('0x1f')](_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x1f')]);_0x15f976['offset']=qs[_0x5cd7('0x1d')](_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x1d')]);}_0x15f976[_0x5cd7('0x3b')]=qs[_0x5cd7('0x3c')](_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x3c')]);_0x15f976[_0x5cd7('0x3d')]=qs['filters'](_[_0x5cd7('0x3e')](_0x46bb28[_0x5cd7('0x32')],_0x2f3552[_0x5cd7('0x34')]),_0x205813);if(_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x3f')]){_0x15f976[_0x5cd7('0x3d')]=_[_0x5cd7('0x40')](_0x15f976[_0x5cd7('0x3d')],{'$or':_[_0x5cd7('0x31')](_0x205813,function(_0x55378a){if(_0x55378a['type']!==_0x5cd7('0x41')){var _0x49cf3f={};_0x49cf3f[_0x55378a['name']]={'$like':'%'+_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x3f')]+'%'};return _0x49cf3f;}})});}_0x15f976=_[_0x5cd7('0x40')]({},_0x15f976,_0x46bb28[_0x5cd7('0x42')]);var _0x314e49={'where':_0x15f976[_0x5cd7('0x3d')]};return db[_0x5cd7('0x2c')][_0x5cd7('0x20')](_0x314e49)[_0x5cd7('0x26')](function(_0x274760){_0x5e723c[_0x5cd7('0x20')]=_0x274760;if(_0x46bb28[_0x5cd7('0x32')][_0x5cd7('0x43')]){_0x15f976['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x5cd7('0x44')](_0x15f976);})[_0x5cd7('0x26')](function(_0x360513){_0x5e723c[_0x5cd7('0x45')]=_0x360513;return _0x5e723c;})[_0x5cd7('0x26')](respondWithFilteredResult(_0x1cd544,_0x15f976))[_0x5cd7('0x46')](handleError(_0x1cd544,null));};exports[_0x5cd7('0x47')]=function(_0x1ee173,_0x36a2bc){var _0x6d6291={'raw':!![],'where':{'id':_0x1ee173[_0x5cd7('0x48')]['id']}},_0x14600f={};_0x14600f['model']=_['keys'](db[_0x5cd7('0x2c')][_0x5cd7('0x2d')]);_0x14600f[_0x5cd7('0x32')]=_[_0x5cd7('0x33')](_0x1ee173[_0x5cd7('0x32')]);_0x14600f['filters']=_[_0x5cd7('0x36')](_0x14600f[_0x5cd7('0x30')],_0x14600f['query']);_0x6d6291[_0x5cd7('0x35')]=_[_0x5cd7('0x36')](_0x14600f[_0x5cd7('0x30')],qs[_0x5cd7('0x37')](_0x1ee173[_0x5cd7('0x32')][_0x5cd7('0x37')]));_0x6d6291[_0x5cd7('0x35')]=_0x6d6291['attributes'][_0x5cd7('0x38')]?_0x6d6291[_0x5cd7('0x35')]:_0x14600f[_0x5cd7('0x30')];if(_0x1ee173['query'][_0x5cd7('0x43')]){_0x6d6291[_0x5cd7('0x49')]=[{'all':!![]}];}_0x6d6291=_['merge']({},_0x6d6291,_0x1ee173[_0x5cd7('0x42')]);return db['MailSubstatus'][_0x5cd7('0x4a')](_0x6d6291)[_0x5cd7('0x26')](handleEntityNotFound(_0x36a2bc,null))['then'](respondWithResult(_0x36a2bc,null))[_0x5cd7('0x46')](handleError(_0x36a2bc,null));};exports[_0x5cd7('0x4b')]=function(_0x3c78a3,_0x13a0b3){return db[_0x5cd7('0x2c')]['create'](_0x3c78a3[_0x5cd7('0x4c')],{})[_0x5cd7('0x26')](respondWithResult(_0x13a0b3,0xc9))[_0x5cd7('0x46')](handleError(_0x13a0b3,null));};exports[_0x5cd7('0x25')]=function(_0x2e8abc,_0x127ba3){if(_0x2e8abc[_0x5cd7('0x4c')]['id']){delete _0x2e8abc['body']['id'];}return db['MailSubstatus'][_0x5cd7('0x4a')]({'where':{'id':_0x2e8abc['params']['id']}})[_0x5cd7('0x26')](handleEntityNotFound(_0x127ba3,null))[_0x5cd7('0x26')](saveUpdates(_0x2e8abc[_0x5cd7('0x4c')],null))[_0x5cd7('0x26')](respondWithResult(_0x127ba3,null))[_0x5cd7('0x46')](handleError(_0x127ba3,null));};exports[_0x5cd7('0x27')]=function(_0x28a752,_0x4a4ee5){return db[_0x5cd7('0x2c')]['find']({'where':{'id':_0x28a752[_0x5cd7('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a4ee5,null))[_0x5cd7('0x26')](removeEntity(_0x4a4ee5,null))[_0x5cd7('0x46')](handleError(_0x4a4ee5,null));};exports['describe']=function(_0x586bc5,_0x239c94){return db['MailSubstatus']['describe']()[_0x5cd7('0x26')](respondWithResult(_0x239c94,null))[_0x5cd7('0x46')](handleError(_0x239c94,null));}; \ No newline at end of file +var _0xe640=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','MailSubstatus','include','rows','catch','show','rawAttributes','keys','find','create','body','update','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','map','fieldName','key','model','query','filters'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0xe640,0x14f));var _0x0e64=function(_0x343427,_0xa0461a){_0x343427=_0x343427-0x0;var _0x5a3db6=_0xe640[_0x343427];return _0x5a3db6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e64('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e64('0x1'));var rp=require(_0x0e64('0x2'));var moment=require(_0x0e64('0x3'));var BPromise=require(_0x0e64('0x4'));var Mustache=require(_0x0e64('0x5'));var util=require(_0x0e64('0x6'));var path=require(_0x0e64('0x7'));var sox=require(_0x0e64('0x8'));var csv=require(_0x0e64('0x9'));var ejs=require(_0x0e64('0xa'));var fs=require('fs');var fs_extra=require(_0x0e64('0xb'));var _=require('lodash');var squel=require(_0x0e64('0xc'));var crypto=require(_0x0e64('0xd'));var jsforce=require(_0x0e64('0xe'));var deskjs=require(_0x0e64('0xf'));var toCsv=require(_0x0e64('0x9'));var querystring=require(_0x0e64('0x10'));var Papa=require(_0x0e64('0x11'));var Redis=require(_0x0e64('0x12'));var authService=require(_0x0e64('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0e64('0x14'));var hardwareService=require(_0x0e64('0x15'));var logger=require(_0x0e64('0x16'))(_0x0e64('0x17'));var utils=require(_0x0e64('0x18'));var config=require(_0x0e64('0x19'));var licenseUtil=require(_0x0e64('0x1a'));var db=require(_0x0e64('0x1b'))['db'];function respondWithStatusCode(_0x409963,_0x243be7){_0x243be7=_0x243be7||0xcc;return function(_0x45bf01){if(_0x45bf01){return _0x409963['sendStatus'](_0x243be7);}return _0x409963[_0x0e64('0x1c')](_0x243be7)[_0x0e64('0x1d')]();};}function respondWithResult(_0x138d98,_0x4faa0d){_0x4faa0d=_0x4faa0d||0xc8;return function(_0x10113d){if(_0x10113d){return _0x138d98[_0x0e64('0x1c')](_0x4faa0d)[_0x0e64('0x1e')](_0x10113d);}};}function respondWithFilteredResult(_0x3903c4,_0x6042d4){return function(_0x39898b){if(_0x39898b){var _0x2e26e0=typeof _0x6042d4[_0x0e64('0x1f')]===_0x0e64('0x20')&&typeof _0x6042d4[_0x0e64('0x21')]===_0x0e64('0x20');var _0x1f3df1=_0x39898b['count'];var _0x4e1094=_0x2e26e0?0x0:_0x6042d4[_0x0e64('0x1f')];var _0x2ebcba=_0x2e26e0?_0x39898b[_0x0e64('0x22')]:_0x6042d4['offset']+_0x6042d4[_0x0e64('0x21')];var _0x4092b9;if(_0x2ebcba>=_0x1f3df1){_0x2ebcba=_0x1f3df1;_0x4092b9=0xc8;}else{_0x4092b9=0xce;}_0x3903c4[_0x0e64('0x1c')](_0x4092b9);return _0x3903c4[_0x0e64('0x23')]('Content-Range',_0x4e1094+'-'+_0x2ebcba+'/'+_0x1f3df1)[_0x0e64('0x1e')](_0x39898b);}return null;};}function patchUpdates(_0x265f82){return function(_0x16f8b7){try{jsonpatch[_0x0e64('0x24')](_0x16f8b7,_0x265f82,!![]);}catch(_0x5212cc){return BPromise[_0x0e64('0x25')](_0x5212cc);}return _0x16f8b7['save']();};}function saveUpdates(_0x3d04d4,_0x1c77c6){return function(_0x3ca5b8){if(_0x3ca5b8){return _0x3ca5b8['update'](_0x3d04d4)[_0x0e64('0x26')](function(_0x252892){return _0x252892;});}return null;};}function removeEntity(_0x414c39,_0x59b7da){return function(_0x5487b6){if(_0x5487b6){return _0x5487b6[_0x0e64('0x27')]()['then'](function(){_0x414c39[_0x0e64('0x1c')](0xcc)[_0x0e64('0x1d')]();});}};}function handleEntityNotFound(_0x1cf459,_0x38bb4c){return function(_0x3157e3){if(!_0x3157e3){_0x1cf459[_0x0e64('0x28')](0x194);}return _0x3157e3;};}function handleError(_0x9fac0e,_0x245e07){_0x245e07=_0x245e07||0x1f4;return function(_0x5d9816){logger[_0x0e64('0x29')](_0x5d9816[_0x0e64('0x2a')]);if(_0x5d9816['name']){delete _0x5d9816[_0x0e64('0x2b')];}_0x9fac0e[_0x0e64('0x1c')](_0x245e07)['send'](_0x5d9816);};}exports['index']=function(_0x43b978,_0x3b1633){var _0x9d5611={},_0xd0abc={},_0x2399ad={'count':0x0,'rows':[]};var _0x3f8ac5=_[_0x0e64('0x2c')](db['MailSubstatus']['rawAttributes'],function(_0x4eac02){return{'name':_0x4eac02[_0x0e64('0x2d')],'type':_0x4eac02['type'][_0x0e64('0x2e')]};});_0xd0abc[_0x0e64('0x2f')]=_[_0x0e64('0x2c')](_0x3f8ac5,_0x0e64('0x2b'));_0xd0abc[_0x0e64('0x30')]=_['keys'](_0x43b978[_0x0e64('0x30')]);_0xd0abc[_0x0e64('0x31')]=_[_0x0e64('0x32')](_0xd0abc[_0x0e64('0x2f')],_0xd0abc[_0x0e64('0x30')]);_0x9d5611[_0x0e64('0x33')]=_[_0x0e64('0x32')](_0xd0abc[_0x0e64('0x2f')],qs[_0x0e64('0x34')](_0x43b978[_0x0e64('0x30')][_0x0e64('0x34')]));_0x9d5611[_0x0e64('0x33')]=_0x9d5611[_0x0e64('0x33')][_0x0e64('0x35')]?_0x9d5611[_0x0e64('0x33')]:_0xd0abc[_0x0e64('0x2f')];if(!_0x43b978[_0x0e64('0x30')][_0x0e64('0x36')](_0x0e64('0x37'))){_0x9d5611[_0x0e64('0x21')]=qs['limit'](_0x43b978[_0x0e64('0x30')]['limit']);_0x9d5611['offset']=qs[_0x0e64('0x1f')](_0x43b978[_0x0e64('0x30')][_0x0e64('0x1f')]);}_0x9d5611[_0x0e64('0x38')]=qs['sort'](_0x43b978[_0x0e64('0x30')]['sort']);_0x9d5611[_0x0e64('0x39')]=qs['filters'](_[_0x0e64('0x3a')](_0x43b978[_0x0e64('0x30')],_0xd0abc['filters']),_0x3f8ac5);if(_0x43b978[_0x0e64('0x30')][_0x0e64('0x3b')]){_0x9d5611[_0x0e64('0x39')]=_[_0x0e64('0x3c')](_0x9d5611[_0x0e64('0x39')],{'$or':_[_0x0e64('0x2c')](_0x3f8ac5,function(_0x5dd2a7){if(_0x5dd2a7[_0x0e64('0x3d')]!==_0x0e64('0x3e')){var _0x15cb90={};_0x15cb90[_0x5dd2a7['name']]={'$like':'%'+_0x43b978['query'][_0x0e64('0x3b')]+'%'};return _0x15cb90;}})});}_0x9d5611=_[_0x0e64('0x3c')]({},_0x9d5611,_0x43b978[_0x0e64('0x3f')]);var _0x809d14={'where':_0x9d5611[_0x0e64('0x39')]};return db[_0x0e64('0x40')]['count'](_0x809d14)[_0x0e64('0x26')](function(_0x111565){_0x2399ad[_0x0e64('0x22')]=_0x111565;if(_0x43b978[_0x0e64('0x30')]['includeAll']){_0x9d5611[_0x0e64('0x41')]=[{'all':!![]}];}return db[_0x0e64('0x40')]['findAll'](_0x9d5611);})[_0x0e64('0x26')](function(_0x2cafbe){_0x2399ad[_0x0e64('0x42')]=_0x2cafbe;return _0x2399ad;})[_0x0e64('0x26')](respondWithFilteredResult(_0x3b1633,_0x9d5611))[_0x0e64('0x43')](handleError(_0x3b1633,null));};exports[_0x0e64('0x44')]=function(_0x3b2cc4,_0x5904b9){var _0x5e220b={'raw':!![],'where':{'id':_0x3b2cc4['params']['id']}},_0xca0eb8={};_0xca0eb8[_0x0e64('0x2f')]=_['keys'](db[_0x0e64('0x40')][_0x0e64('0x45')]);_0xca0eb8[_0x0e64('0x30')]=_[_0x0e64('0x46')](_0x3b2cc4['query']);_0xca0eb8[_0x0e64('0x31')]=_['intersection'](_0xca0eb8[_0x0e64('0x2f')],_0xca0eb8[_0x0e64('0x30')]);_0x5e220b['attributes']=_[_0x0e64('0x32')](_0xca0eb8['model'],qs[_0x0e64('0x34')](_0x3b2cc4['query'][_0x0e64('0x34')]));_0x5e220b[_0x0e64('0x33')]=_0x5e220b[_0x0e64('0x33')]['length']?_0x5e220b['attributes']:_0xca0eb8[_0x0e64('0x2f')];if(_0x3b2cc4[_0x0e64('0x30')]['includeAll']){_0x5e220b[_0x0e64('0x41')]=[{'all':!![]}];}_0x5e220b=_['merge']({},_0x5e220b,_0x3b2cc4[_0x0e64('0x3f')]);return db[_0x0e64('0x40')][_0x0e64('0x47')](_0x5e220b)[_0x0e64('0x26')](handleEntityNotFound(_0x5904b9,null))[_0x0e64('0x26')](respondWithResult(_0x5904b9,null))[_0x0e64('0x43')](handleError(_0x5904b9,null));};exports[_0x0e64('0x48')]=function(_0x5b2667,_0x4e824b){return db[_0x0e64('0x40')][_0x0e64('0x48')](_0x5b2667[_0x0e64('0x49')],{})[_0x0e64('0x26')](respondWithResult(_0x4e824b,0xc9))[_0x0e64('0x43')](handleError(_0x4e824b,null));};exports[_0x0e64('0x4a')]=function(_0x2b9243,_0x170af5){if(_0x2b9243[_0x0e64('0x49')]['id']){delete _0x2b9243['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x2b9243[_0x0e64('0x4b')]['id']}})[_0x0e64('0x26')](handleEntityNotFound(_0x170af5,null))[_0x0e64('0x26')](saveUpdates(_0x2b9243[_0x0e64('0x49')],null))[_0x0e64('0x26')](respondWithResult(_0x170af5,null))[_0x0e64('0x43')](handleError(_0x170af5,null));};exports['destroy']=function(_0x20b0d6,_0x2c081d){return db['MailSubstatus'][_0x0e64('0x47')]({'where':{'id':_0x20b0d6[_0x0e64('0x4b')]['id']}})[_0x0e64('0x26')](handleEntityNotFound(_0x2c081d,null))[_0x0e64('0x26')](removeEntity(_0x2c081d,null))[_0x0e64('0x43')](handleError(_0x2c081d,null));};exports[_0x0e64('0x4c')]=function(_0x6ee6e8,_0x4d0237){return db[_0x0e64('0x40')][_0x0e64('0x4c')]()[_0x0e64('0x26')](respondWithResult(_0x4d0237,null))[_0x0e64('0x43')](handleError(_0x4d0237,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 24fe2b7..8f93709 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 _0x59f4=['events','../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','exports'];(function(_0x36fa26,_0x512ffd){var _0x1a53c0=function(_0x81ed7c){while(--_0x81ed7c){_0x36fa26['push'](_0x36fa26['shift']());}};_0x1a53c0(++_0x512ffd);}(_0x59f4,0x69));var _0x459f=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x59f4[_0x539533];return _0x3942f3;};'use strict';var EventEmitter=require(_0x459f('0x0'));var MailSubstatus=require(_0x459f('0x1'))['db'][_0x459f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x459f('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x10ebc0){return function(_0x4f66ef,_0x1b8345,_0x59a9b5){MailSubstatusEvents[_0x459f('0x4')](_0x10ebc0+':'+_0x4f66ef['id'],_0x4f66ef);MailSubstatusEvents[_0x459f('0x4')](_0x10ebc0,_0x4f66ef);_0x59a9b5(null);};}for(var e in events){if(events[_0x459f('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x459f('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x95d9=['update','emit','hook','exports','events','../../mysqldb'];(function(_0x1b6851,_0x27d017){var _0x58e98f=function(_0xfa95c3){while(--_0xfa95c3){_0x1b6851['push'](_0x1b6851['shift']());}};_0x58e98f(++_0x27d017);}(_0x95d9,0xa6));var _0x995d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x95d9[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require(_0x995d('0x0'));var MailSubstatus=require(_0x995d('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x995d('0x2')};function emitEvent(_0x416fde){return function(_0x383586,_0x112949,_0x559b1d){MailSubstatusEvents[_0x995d('0x3')](_0x416fde+':'+_0x383586['id'],_0x383586);MailSubstatusEvents['emit'](_0x416fde,_0x383586);_0x559b1d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x995d('0x4')](e,emitEvent(event));}}module[_0x995d('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4594d72..a0e4ed4 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 _0x89f6=['exports','models','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','catch','./mailSubstatus.attributes'];(function(_0x42f985,_0xe3fd79){var _0x28a38f=function(_0x390646){while(--_0x390646){_0x42f985['push'](_0x42f985['shift']());}};_0x28a38f(++_0xe3fd79);}(_0x89f6,0x14c));var _0x689f=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x89f6[_0x334841];return _0x5beb4b;};'use strict';var attributes=require(_0x689f('0x0'));module[_0x689f('0x1')]=function(_0x4b49ac){var _0x3ad9ba=_0x4b49ac[_0x689f('0x2')];return _0x4b49ac['define'](_0x689f('0x3'),attributes,{'tableName':_0x689f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x13e144,_0x32f951,_0x49663c){return _0x3ad9ba[_0x689f('0x5')]['update']({'value':_0x13e144[_0x689f('0x6')]},{'where':{'field':_0x689f('0x7'),'value':_0x13e144['_previousDataValues'][_0x689f('0x6')]}})['then'](function(){_0x49663c();})[_0x689f('0x8')](function(_0x2669d8){_0x49663c(_0x2669d8);});}}});}; \ No newline at end of file +var _0x0f8d=['./mailSubstatus.attributes','models','define','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x24af38,_0x3a89a7){var _0xd61e08=function(_0x5eacea){while(--_0x5eacea){_0x24af38['push'](_0x24af38['shift']());}};_0xd61e08(++_0x3a89a7);}(_0x0f8d,0xa0));var _0xd0f8=function(_0x532b5b,_0xce6ec8){_0x532b5b=_0x532b5b-0x0;var _0x169ff9=_0x0f8d[_0x532b5b];return _0x169ff9;};'use strict';var attributes=require(_0xd0f8('0x0'));module['exports']=function(_0x581ccd){var _0x3f6b97=_0x581ccd[_0xd0f8('0x1')];return _0x581ccd[_0xd0f8('0x2')]('MailSubstatus',attributes,{'tableName':_0xd0f8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x58498b,_0x969a1b,_0x5ee5e5){return _0x3f6b97[_0xd0f8('0x4')][_0xd0f8('0x5')]({'value':_0x58498b[_0xd0f8('0x6')]},{'where':{'field':_0xd0f8('0x7'),'value':_0x58498b[_0xd0f8('0x8')][_0xd0f8('0x6')]}})[_0xd0f8('0x9')](function(){_0x5ee5e5();})['catch'](function(_0x49fa00){_0x5ee5e5(_0x49fa00);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7070776..645936d 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 _0x9cc8=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x2e8ee9,_0x5ed256){var _0x3c15f6=function(_0x5d499d){while(--_0x5d499d){_0x2e8ee9['push'](_0x2e8ee9['shift']());}};_0x3c15f6(++_0x5ed256);}(_0x9cc8,0x193));var _0x89cc=function(_0x39a55e,_0x3dbd9c){_0x39a55e=_0x39a55e-0x0;var _0x418ac9=_0x9cc8[_0x39a55e];return _0x418ac9;};'use strict';var _=require(_0x89cc('0x0'));var util=require(_0x89cc('0x1'));var moment=require('moment');var BPromise=require(_0x89cc('0x2'));var rs=require(_0x89cc('0x3'));var fs=require('fs');var Redis=require(_0x89cc('0x4'));var db=require(_0x89cc('0x5'))['db'];var utils=require(_0x89cc('0x6'));var logger=require('../../config/logger')(_0x89cc('0x7'));var config=require('../../config/environment');var jayson=require(_0x89cc('0x8'));var client=jayson[_0x89cc('0x9')][_0x89cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53cddb,_0x1b2f6e,_0xbb8f15){return new BPromise(function(_0x237da6,_0x484241){return client[_0x89cc('0xb')](_0x53cddb,_0xbb8f15)['then'](function(_0x5104e9){logger[_0x89cc('0xc')](_0x89cc('0xd'),_0x1b2f6e,_0x89cc('0xe'));logger[_0x89cc('0xf')](_0x89cc('0x10'),_0x1b2f6e,_0x89cc('0xe'),JSON[_0x89cc('0x11')](_0x5104e9));if(_0x5104e9[_0x89cc('0x12')]){if(_0x5104e9[_0x89cc('0x12')][_0x89cc('0x13')]===0x1f4){logger[_0x89cc('0x12')](_0x89cc('0xd'),_0x1b2f6e,_0x5104e9['error'][_0x89cc('0x14')]);return _0x484241(_0x5104e9[_0x89cc('0x12')][_0x89cc('0x14')]);}logger[_0x89cc('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x1b2f6e,_0x5104e9[_0x89cc('0x12')][_0x89cc('0x14')]);return _0x237da6(_0x5104e9[_0x89cc('0x12')][_0x89cc('0x14')]);}else{logger['info'](_0x89cc('0xd'),_0x1b2f6e,'request\x20sent');_0x237da6(_0x5104e9['result']['message']);}})[_0x89cc('0x15')](function(_0x584c0b){logger[_0x89cc('0x12')](_0x89cc('0xd'),_0x1b2f6e,_0x584c0b);_0x484241(_0x584c0b);});});} \ No newline at end of file +var _0x77a2=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailSubstatus,\x20%s,\x20%s','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x77a2,0x1c1));var _0x277a=function(_0x36bd7e,_0x49bed5){_0x36bd7e=_0x36bd7e-0x0;var _0x352279=_0x77a2[_0x36bd7e];return _0x352279;};'use strict';var _=require(_0x277a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x277a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x277a('0x2'));var db=require(_0x277a('0x3'))['db'];var utils=require(_0x277a('0x4'));var logger=require(_0x277a('0x5'))(_0x277a('0x6'));var config=require(_0x277a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x277a('0x8')][_0x277a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d73a,_0x3f6a28,_0x5cff2c){return new BPromise(function(_0x3cd00e,_0x14d64c){return client[_0x277a('0xa')](_0x24d73a,_0x5cff2c)[_0x277a('0xb')](function(_0x2c2901){logger[_0x277a('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x3f6a28,'request\x20sent');logger[_0x277a('0xd')](_0x277a('0xe'),_0x3f6a28,_0x277a('0xf'),JSON['stringify'](_0x2c2901));if(_0x2c2901[_0x277a('0x10')]){if(_0x2c2901[_0x277a('0x10')][_0x277a('0x11')]===0x1f4){logger[_0x277a('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3f6a28,_0x2c2901[_0x277a('0x10')][_0x277a('0x12')]);return _0x14d64c(_0x2c2901[_0x277a('0x10')]['message']);}logger[_0x277a('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3f6a28,_0x2c2901[_0x277a('0x10')][_0x277a('0x12')]);return _0x3cd00e(_0x2c2901[_0x277a('0x10')]['message']);}else{logger[_0x277a('0xc')](_0x277a('0x13'),_0x3f6a28,'request\x20sent');_0x3cd00e(_0x2c2901[_0x277a('0x14')]['message']);}})['catch'](function(_0x4d351d){logger[_0x277a('0x10')](_0x277a('0x13'),_0x3f6a28,_0x4d351d);_0x14d64c(_0x4d351d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 7d368c8..81ae6b6 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 _0xfca0=['isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x1e8f1b,_0x5d2b3b){var _0x1cb563=function(_0x1f4bb1){while(--_0x1f4bb1){_0x1e8f1b['push'](_0x1e8f1b['shift']());}};_0x1cb563(++_0x5d2b3b);}(_0xfca0,0x129));var _0x0fca=function(_0xb10818,_0x363991){_0xb10818=_0xb10818-0x0;var _0x139f18=_0xfca0[_0xb10818];return _0x139f18;};'use strict';var multer=require(_0x0fca('0x0'));var util=require(_0x0fca('0x1'));var path=require(_0x0fca('0x2'));var timeout=require(_0x0fca('0x3'));var express=require(_0x0fca('0x4'));var router=express[_0x0fca('0x5')]();var fs_extra=require(_0x0fca('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0fca('0x7'));var config=require(_0x0fca('0x8'));var controller=require(_0x0fca('0x9'));router[_0x0fca('0xa')]('/',auth[_0x0fca('0xb')](),controller[_0x0fca('0xc')]);router[_0x0fca('0xa')](_0x0fca('0xd'),auth[_0x0fca('0xb')](),controller['describe']);router[_0x0fca('0xa')](_0x0fca('0xe'),auth[_0x0fca('0xb')](),controller['show']);router[_0x0fca('0xf')]('/',auth[_0x0fca('0xb')](),controller[_0x0fca('0x10')]);router[_0x0fca('0x11')](_0x0fca('0xe'),auth[_0x0fca('0xb')](),controller[_0x0fca('0x12')]);router[_0x0fca('0x13')]('/:id',auth[_0x0fca('0xb')](),controller[_0x0fca('0x14')]);module[_0x0fca('0x15')]=router; \ No newline at end of file +var _0xa6d2=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','post'];(function(_0x4850ce,_0x268170){var _0x3db2dd=function(_0x29a988){while(--_0x29a988){_0x4850ce['push'](_0x4850ce['shift']());}};_0x3db2dd(++_0x268170);}(_0xa6d2,0x83));var _0x2a6d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa6d2[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x2a6d('0x0'));var util=require(_0x2a6d('0x1'));var path=require(_0x2a6d('0x2'));var timeout=require(_0x2a6d('0x3'));var express=require('express');var router=express[_0x2a6d('0x4')]();var fs_extra=require(_0x2a6d('0x5'));var auth=require(_0x2a6d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a6d('0x7'));var controller=require(_0x2a6d('0x8'));router['get']('/',auth[_0x2a6d('0x9')](),controller[_0x2a6d('0xa')]);router['get'](_0x2a6d('0xb'),auth[_0x2a6d('0x9')](),controller[_0x2a6d('0xc')]);router[_0x2a6d('0xd')](_0x2a6d('0xe'),auth[_0x2a6d('0x9')](),controller['show']);router[_0x2a6d('0xf')]('/',auth[_0x2a6d('0x9')](),controller[_0x2a6d('0x10')]);router[_0x2a6d('0x11')](_0x2a6d('0xe'),auth[_0x2a6d('0x9')](),controller[_0x2a6d('0x12')]);router[_0x2a6d('0x13')](_0x2a6d('0xe'),auth[_0x2a6d('0x9')](),controller[_0x2a6d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5a53618..6738389 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xa466b4,_0x444e01){var _0x2167ad=function(_0x3b5789){while(--_0x3b5789){_0xa466b4['push'](_0xa466b4['shift']());}};_0x2167ad(++_0x444e01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x55a323,_0xe5dcdf){var _0x52f032=function(_0x1cffdd){while(--_0x1cffdd){_0x55a323['push'](_0x55a323['shift']());}};_0x52f032(++_0xe5dcdf);}(_0xf4eb,0xec));var _0xbf4e=function(_0x820a3f,_0x37cd8b){_0x820a3f=_0x820a3f-0x0;var _0x153a23=_0xf4eb[_0x820a3f];return _0x153a23;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index f579eb3..f450677 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 _0x24f0=['params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','catch','show'];(function(_0xc3248d,_0x40996c){var _0x18e9f4=function(_0x86a96f){while(--_0x86a96f){_0xc3248d['push'](_0xc3248d['shift']());}};_0x18e9f4(++_0x40996c);}(_0x24f0,0x9b));var _0x024f=function(_0x59af21,_0x327d30){_0x59af21=_0x59af21-0x0;var _0x4371d5=_0x24f0[_0x59af21];return _0x4371d5;};'use strict';var emlformat=require(_0x024f('0x0'));var rimraf=require(_0x024f('0x1'));var zipdir=require(_0x024f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x024f('0x3'));var BPromise=require(_0x024f('0x4'));var Mustache=require('mustache');var util=require(_0x024f('0x5'));var path=require(_0x024f('0x6'));var sox=require(_0x024f('0x7'));var csv=require(_0x024f('0x8'));var ejs=require(_0x024f('0x9'));var fs=require('fs');var fs_extra=require(_0x024f('0xa'));var _=require('lodash');var squel=require(_0x024f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x024f('0xc'));var Papa=require(_0x024f('0xd'));var Redis=require('ioredis');var authService=require(_0x024f('0xe'));var qs=require(_0x024f('0xf'));var as=require(_0x024f('0x10'));var hardwareService=require(_0x024f('0x11'));var logger=require(_0x024f('0x12'))(_0x024f('0x13'));var utils=require(_0x024f('0x14'));var config=require(_0x024f('0x15'));var licenseUtil=require(_0x024f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5656d7,_0x2b9c8e){_0x2b9c8e=_0x2b9c8e||0xcc;return function(_0x3e9956){if(_0x3e9956){return _0x5656d7[_0x024f('0x17')](_0x2b9c8e);}return _0x5656d7[_0x024f('0x18')](_0x2b9c8e)[_0x024f('0x19')]();};}function respondWithResult(_0x38e801,_0x44cd34){_0x44cd34=_0x44cd34||0xc8;return function(_0x548430){if(_0x548430){return _0x38e801[_0x024f('0x18')](_0x44cd34)[_0x024f('0x1a')](_0x548430);}};}function respondWithFilteredResult(_0x79394b,_0x1b3303){return function(_0x2119c8){if(_0x2119c8){var _0x1ba4ee=typeof _0x1b3303[_0x024f('0x1b')]==='undefined'&&typeof _0x1b3303[_0x024f('0x1c')]==='undefined';var _0x419c9a=_0x2119c8['count'];var _0x1fa146=_0x1ba4ee?0x0:_0x1b3303[_0x024f('0x1b')];var _0x31de29=_0x1ba4ee?_0x2119c8[_0x024f('0x1d')]:_0x1b3303[_0x024f('0x1b')]+_0x1b3303[_0x024f('0x1c')];var _0x51d69a;if(_0x31de29>=_0x419c9a){_0x31de29=_0x419c9a;_0x51d69a=0xc8;}else{_0x51d69a=0xce;}_0x79394b[_0x024f('0x18')](_0x51d69a);return _0x79394b[_0x024f('0x1e')](_0x024f('0x1f'),_0x1fa146+'-'+_0x31de29+'/'+_0x419c9a)['json'](_0x2119c8);}return null;};}function patchUpdates(_0x2f476d){return function(_0x214afa){try{jsonpatch[_0x024f('0x20')](_0x214afa,_0x2f476d,!![]);}catch(_0x13a3c2){return BPromise[_0x024f('0x21')](_0x13a3c2);}return _0x214afa[_0x024f('0x22')]();};}function saveUpdates(_0x5642ff,_0x5e72fa){return function(_0x29efcf){if(_0x29efcf){return _0x29efcf[_0x024f('0x23')](_0x5642ff)[_0x024f('0x24')](function(_0x3196f3){return _0x3196f3;});}return null;};}function removeEntity(_0x3ecaf9,_0x1d14e1){return function(_0x110fb6){if(_0x110fb6){return _0x110fb6[_0x024f('0x25')]()[_0x024f('0x24')](function(){_0x3ecaf9[_0x024f('0x18')](0xcc)[_0x024f('0x19')]();});}};}function handleEntityNotFound(_0x1de604,_0x40e058){return function(_0xe53ae5){if(!_0xe53ae5){_0x1de604[_0x024f('0x17')](0x194);}return _0xe53ae5;};}function handleError(_0x5e11ae,_0xd833e0){_0xd833e0=_0xd833e0||0x1f4;return function(_0x4191fa){logger[_0x024f('0x26')](_0x4191fa[_0x024f('0x27')]);if(_0x4191fa['name']){delete _0x4191fa[_0x024f('0x28')];}_0x5e11ae[_0x024f('0x18')](_0xd833e0)[_0x024f('0x29')](_0x4191fa);};}exports['index']=function(_0xaf786,_0x2f70ff){var _0x11bf28={},_0x524049={},_0x2b4861={'count':0x0,'rows':[]};var _0x4f42e4=_[_0x024f('0x2a')](db[_0x024f('0x2b')][_0x024f('0x2c')],function(_0x13a66b){return{'name':_0x13a66b[_0x024f('0x2d')],'type':_0x13a66b['type'][_0x024f('0x2e')]};});_0x524049[_0x024f('0x2f')]=_[_0x024f('0x2a')](_0x4f42e4,'name');_0x524049[_0x024f('0x30')]=_[_0x024f('0x31')](_0xaf786[_0x024f('0x30')]);_0x524049[_0x024f('0x32')]=_[_0x024f('0x33')](_0x524049['model'],_0x524049[_0x024f('0x30')]);_0x11bf28[_0x024f('0x34')]=_[_0x024f('0x33')](_0x524049[_0x024f('0x2f')],qs[_0x024f('0x35')](_0xaf786[_0x024f('0x30')][_0x024f('0x35')]));_0x11bf28['attributes']=_0x11bf28[_0x024f('0x34')][_0x024f('0x36')]?_0x11bf28[_0x024f('0x34')]:_0x524049[_0x024f('0x2f')];if(!_0xaf786[_0x024f('0x30')][_0x024f('0x37')](_0x024f('0x38'))){_0x11bf28[_0x024f('0x1c')]=qs['limit'](_0xaf786[_0x024f('0x30')][_0x024f('0x1c')]);_0x11bf28[_0x024f('0x1b')]=qs[_0x024f('0x1b')](_0xaf786[_0x024f('0x30')][_0x024f('0x1b')]);}_0x11bf28['order']=qs[_0x024f('0x39')](_0xaf786[_0x024f('0x30')][_0x024f('0x39')]);_0x11bf28[_0x024f('0x3a')]=qs[_0x024f('0x32')](_[_0x024f('0x3b')](_0xaf786[_0x024f('0x30')],_0x524049[_0x024f('0x32')]),_0x4f42e4);if(_0xaf786[_0x024f('0x30')][_0x024f('0x3c')]){_0x11bf28[_0x024f('0x3a')]=_[_0x024f('0x3d')](_0x11bf28[_0x024f('0x3a')],{'$or':_['map'](_0x4f42e4,function(_0x5ca97d){if(_0x5ca97d[_0x024f('0x3e')]!==_0x024f('0x3f')){var _0x39e334={};_0x39e334[_0x5ca97d['name']]={'$like':'%'+_0xaf786['query'][_0x024f('0x3c')]+'%'};return _0x39e334;}})});}_0x11bf28=_[_0x024f('0x3d')]({},_0x11bf28,_0xaf786['options']);var _0xd72971={'where':_0x11bf28[_0x024f('0x3a')]};return db[_0x024f('0x2b')][_0x024f('0x1d')](_0xd72971)['then'](function(_0x53e1dc){_0x2b4861[_0x024f('0x1d')]=_0x53e1dc;if(_0xaf786['query'][_0x024f('0x40')]){_0x11bf28['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x11bf28);})['then'](function(_0x3c9a7e){_0x2b4861['rows']=_0x3c9a7e;return _0x2b4861;})[_0x024f('0x24')](respondWithFilteredResult(_0x2f70ff,_0x11bf28))[_0x024f('0x41')](handleError(_0x2f70ff,null));};exports[_0x024f('0x42')]=function(_0x3dcb8e,_0x570fe5){var _0x64540f={'raw':!![],'where':{'id':_0x3dcb8e[_0x024f('0x43')]['id']}},_0x900e2e={};_0x900e2e[_0x024f('0x2f')]=_['keys'](db['MailTransferReport'][_0x024f('0x2c')]);_0x900e2e['query']=_[_0x024f('0x31')](_0x3dcb8e['query']);_0x900e2e[_0x024f('0x32')]=_[_0x024f('0x33')](_0x900e2e[_0x024f('0x2f')],_0x900e2e['query']);_0x64540f[_0x024f('0x34')]=_[_0x024f('0x33')](_0x900e2e[_0x024f('0x2f')],qs[_0x024f('0x35')](_0x3dcb8e['query']['fields']));_0x64540f['attributes']=_0x64540f[_0x024f('0x34')][_0x024f('0x36')]?_0x64540f['attributes']:_0x900e2e[_0x024f('0x2f')];if(_0x3dcb8e['query'][_0x024f('0x40')]){_0x64540f[_0x024f('0x44')]=[{'all':!![]}];}_0x64540f=_[_0x024f('0x3d')]({},_0x64540f,_0x3dcb8e[_0x024f('0x45')]);return db[_0x024f('0x2b')][_0x024f('0x46')](_0x64540f)[_0x024f('0x24')](handleEntityNotFound(_0x570fe5,null))[_0x024f('0x24')](respondWithResult(_0x570fe5,null))[_0x024f('0x41')](handleError(_0x570fe5,null));};exports[_0x024f('0x47')]=function(_0x15c103,_0x4e6c6b){return db[_0x024f('0x2b')]['create'](_0x15c103[_0x024f('0x48')],{})[_0x024f('0x24')](respondWithResult(_0x4e6c6b,0xc9))[_0x024f('0x41')](handleError(_0x4e6c6b,null));};exports[_0x024f('0x23')]=function(_0x2920ce,_0x461096){if(_0x2920ce[_0x024f('0x48')]['id']){delete _0x2920ce['body']['id'];}return db[_0x024f('0x2b')][_0x024f('0x46')]({'where':{'id':_0x2920ce['params']['id']}})[_0x024f('0x24')](handleEntityNotFound(_0x461096,null))[_0x024f('0x24')](saveUpdates(_0x2920ce[_0x024f('0x48')],null))['then'](respondWithResult(_0x461096,null))[_0x024f('0x41')](handleError(_0x461096,null));};exports['destroy']=function(_0x42c362,_0x58fcfb){return db[_0x024f('0x2b')][_0x024f('0x46')]({'where':{'id':_0x42c362[_0x024f('0x43')]['id']}})[_0x024f('0x24')](handleEntityNotFound(_0x58fcfb,null))[_0x024f('0x24')](removeEntity(_0x58fcfb,null))[_0x024f('0x41')](handleError(_0x58fcfb,null));};exports[_0x024f('0x49')]=function(_0x1fbaf5,_0x120df5){return db[_0x024f('0x2b')][_0x024f('0x49')]()[_0x024f('0x24')](respondWithResult(_0x120df5,null))['catch'](handleError(_0x120df5,null));}; \ No newline at end of file +var _0x1740=['order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','catch','create','body','destroy','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','MailTransferReport','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3ea3f7,_0xec0e25){var _0x25aa5d=function(_0x37c4e3){while(--_0x37c4e3){_0x3ea3f7['push'](_0x3ea3f7['shift']());}};_0x25aa5d(++_0xec0e25);}(_0x1740,0xf4));var _0x0174=function(_0x2be52d,_0xebd7a2){_0x2be52d=_0x2be52d-0x0;var _0x5de62d=_0x1740[_0x2be52d];return _0x5de62d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0174('0x0'));var zipdir=require(_0x0174('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0174('0x2'));var BPromise=require(_0x0174('0x3'));var Mustache=require(_0x0174('0x4'));var util=require(_0x0174('0x5'));var path=require(_0x0174('0x6'));var sox=require(_0x0174('0x7'));var csv=require(_0x0174('0x8'));var ejs=require(_0x0174('0x9'));var fs=require('fs');var fs_extra=require(_0x0174('0xa'));var _=require(_0x0174('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0174('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0174('0xd'));var Papa=require('papaparse');var Redis=require(_0x0174('0xe'));var authService=require(_0x0174('0xf'));var qs=require(_0x0174('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0174('0x11'));var logger=require(_0x0174('0x12'))(_0x0174('0x13'));var utils=require(_0x0174('0x14'));var config=require(_0x0174('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0174('0x16'))['db'];function respondWithStatusCode(_0x213d06,_0x1a5d5c){_0x1a5d5c=_0x1a5d5c||0xcc;return function(_0x58c18d){if(_0x58c18d){return _0x213d06[_0x0174('0x17')](_0x1a5d5c);}return _0x213d06[_0x0174('0x18')](_0x1a5d5c)['end']();};}function respondWithResult(_0x5d60a5,_0x1a0312){_0x1a0312=_0x1a0312||0xc8;return function(_0x3b39c2){if(_0x3b39c2){return _0x5d60a5[_0x0174('0x18')](_0x1a0312)[_0x0174('0x19')](_0x3b39c2);}};}function respondWithFilteredResult(_0x1dc7ae,_0x286e2f){return function(_0x1e1972){if(_0x1e1972){var _0x1e6b9a=typeof _0x286e2f[_0x0174('0x1a')]===_0x0174('0x1b')&&typeof _0x286e2f['limit']==='undefined';var _0x44d061=_0x1e1972['count'];var _0x3ddea9=_0x1e6b9a?0x0:_0x286e2f[_0x0174('0x1a')];var _0x7d49fe=_0x1e6b9a?_0x1e1972['count']:_0x286e2f[_0x0174('0x1a')]+_0x286e2f[_0x0174('0x1c')];var _0x4c5539;if(_0x7d49fe>=_0x44d061){_0x7d49fe=_0x44d061;_0x4c5539=0xc8;}else{_0x4c5539=0xce;}_0x1dc7ae[_0x0174('0x18')](_0x4c5539);return _0x1dc7ae[_0x0174('0x1d')](_0x0174('0x1e'),_0x3ddea9+'-'+_0x7d49fe+'/'+_0x44d061)[_0x0174('0x19')](_0x1e1972);}return null;};}function patchUpdates(_0x24e8f2){return function(_0xf8ede3){try{jsonpatch['apply'](_0xf8ede3,_0x24e8f2,!![]);}catch(_0x4f3e21){return BPromise[_0x0174('0x1f')](_0x4f3e21);}return _0xf8ede3[_0x0174('0x20')]();};}function saveUpdates(_0x3d4e9e,_0x46ce02){return function(_0x394d14){if(_0x394d14){return _0x394d14[_0x0174('0x21')](_0x3d4e9e)[_0x0174('0x22')](function(_0x2e83fd){return _0x2e83fd;});}return null;};}function removeEntity(_0x4e91e7,_0x1fd4f0){return function(_0x2dfb86){if(_0x2dfb86){return _0x2dfb86['destroy']()['then'](function(){_0x4e91e7[_0x0174('0x18')](0xcc)[_0x0174('0x23')]();});}};}function handleEntityNotFound(_0x5ef3e0,_0x5abd29){return function(_0x14ff77){if(!_0x14ff77){_0x5ef3e0[_0x0174('0x17')](0x194);}return _0x14ff77;};}function handleError(_0x150411,_0x340887){_0x340887=_0x340887||0x1f4;return function(_0x4992fe){logger[_0x0174('0x24')](_0x4992fe[_0x0174('0x25')]);if(_0x4992fe[_0x0174('0x26')]){delete _0x4992fe[_0x0174('0x26')];}_0x150411[_0x0174('0x18')](_0x340887)[_0x0174('0x27')](_0x4992fe);};}exports[_0x0174('0x28')]=function(_0xfcc8e6,_0x24e649){var _0x1fe6b4={},_0x351c21={},_0x2050b2={'count':0x0,'rows':[]};var _0x241c63=_[_0x0174('0x29')](db[_0x0174('0x2a')]['rawAttributes'],function(_0x3eaa56){return{'name':_0x3eaa56['fieldName'],'type':_0x3eaa56['type']['key']};});_0x351c21[_0x0174('0x2b')]=_['map'](_0x241c63,_0x0174('0x26'));_0x351c21['query']=_[_0x0174('0x2c')](_0xfcc8e6[_0x0174('0x2d')]);_0x351c21[_0x0174('0x2e')]=_['intersection'](_0x351c21['model'],_0x351c21[_0x0174('0x2d')]);_0x1fe6b4[_0x0174('0x2f')]=_['intersection'](_0x351c21[_0x0174('0x2b')],qs[_0x0174('0x30')](_0xfcc8e6['query'][_0x0174('0x30')]));_0x1fe6b4[_0x0174('0x2f')]=_0x1fe6b4['attributes'][_0x0174('0x31')]?_0x1fe6b4[_0x0174('0x2f')]:_0x351c21[_0x0174('0x2b')];if(!_0xfcc8e6[_0x0174('0x2d')][_0x0174('0x32')](_0x0174('0x33'))){_0x1fe6b4[_0x0174('0x1c')]=qs[_0x0174('0x1c')](_0xfcc8e6['query'][_0x0174('0x1c')]);_0x1fe6b4['offset']=qs[_0x0174('0x1a')](_0xfcc8e6['query'][_0x0174('0x1a')]);}_0x1fe6b4[_0x0174('0x34')]=qs[_0x0174('0x35')](_0xfcc8e6[_0x0174('0x2d')][_0x0174('0x35')]);_0x1fe6b4[_0x0174('0x36')]=qs[_0x0174('0x2e')](_['pick'](_0xfcc8e6[_0x0174('0x2d')],_0x351c21[_0x0174('0x2e')]),_0x241c63);if(_0xfcc8e6['query'][_0x0174('0x37')]){_0x1fe6b4[_0x0174('0x36')]=_[_0x0174('0x38')](_0x1fe6b4[_0x0174('0x36')],{'$or':_['map'](_0x241c63,function(_0x5280fe){if(_0x5280fe['type']!==_0x0174('0x39')){var _0x5b2cf3={};_0x5b2cf3[_0x5280fe[_0x0174('0x26')]]={'$like':'%'+_0xfcc8e6['query'][_0x0174('0x37')]+'%'};return _0x5b2cf3;}})});}_0x1fe6b4=_['merge']({},_0x1fe6b4,_0xfcc8e6[_0x0174('0x3a')]);var _0x162104={'where':_0x1fe6b4['where']};return db['MailTransferReport'][_0x0174('0x3b')](_0x162104)[_0x0174('0x22')](function(_0xd13a33){_0x2050b2['count']=_0xd13a33;if(_0xfcc8e6['query'][_0x0174('0x3c')]){_0x1fe6b4[_0x0174('0x3d')]=[{'all':!![]}];}return db[_0x0174('0x2a')][_0x0174('0x3e')](_0x1fe6b4);})[_0x0174('0x22')](function(_0x2d12d3){_0x2050b2[_0x0174('0x3f')]=_0x2d12d3;return _0x2050b2;})[_0x0174('0x22')](respondWithFilteredResult(_0x24e649,_0x1fe6b4))['catch'](handleError(_0x24e649,null));};exports[_0x0174('0x40')]=function(_0x3dc731,_0x5c8bba){var _0x34ad14={'raw':!![],'where':{'id':_0x3dc731[_0x0174('0x41')]['id']}},_0x379abe={};_0x379abe['model']=_[_0x0174('0x2c')](db[_0x0174('0x2a')][_0x0174('0x42')]);_0x379abe[_0x0174('0x2d')]=_[_0x0174('0x2c')](_0x3dc731[_0x0174('0x2d')]);_0x379abe[_0x0174('0x2e')]=_[_0x0174('0x43')](_0x379abe[_0x0174('0x2b')],_0x379abe[_0x0174('0x2d')]);_0x34ad14[_0x0174('0x2f')]=_[_0x0174('0x43')](_0x379abe[_0x0174('0x2b')],qs['fields'](_0x3dc731[_0x0174('0x2d')]['fields']));_0x34ad14['attributes']=_0x34ad14[_0x0174('0x2f')]['length']?_0x34ad14[_0x0174('0x2f')]:_0x379abe['model'];if(_0x3dc731[_0x0174('0x2d')][_0x0174('0x3c')]){_0x34ad14[_0x0174('0x3d')]=[{'all':!![]}];}_0x34ad14=_[_0x0174('0x38')]({},_0x34ad14,_0x3dc731[_0x0174('0x3a')]);return db[_0x0174('0x2a')][_0x0174('0x44')](_0x34ad14)[_0x0174('0x22')](handleEntityNotFound(_0x5c8bba,null))[_0x0174('0x22')](respondWithResult(_0x5c8bba,null))[_0x0174('0x45')](handleError(_0x5c8bba,null));};exports[_0x0174('0x46')]=function(_0x12028a,_0x1060a5){return db[_0x0174('0x2a')][_0x0174('0x46')](_0x12028a[_0x0174('0x47')],{})[_0x0174('0x22')](respondWithResult(_0x1060a5,0xc9))[_0x0174('0x45')](handleError(_0x1060a5,null));};exports[_0x0174('0x21')]=function(_0x304f38,_0x3df1c3){if(_0x304f38[_0x0174('0x47')]['id']){delete _0x304f38[_0x0174('0x47')]['id'];}return db[_0x0174('0x2a')][_0x0174('0x44')]({'where':{'id':_0x304f38[_0x0174('0x41')]['id']}})[_0x0174('0x22')](handleEntityNotFound(_0x3df1c3,null))[_0x0174('0x22')](saveUpdates(_0x304f38[_0x0174('0x47')],null))[_0x0174('0x22')](respondWithResult(_0x3df1c3,null))[_0x0174('0x45')](handleError(_0x3df1c3,null));};exports[_0x0174('0x48')]=function(_0x39e944,_0xd1d841){return db[_0x0174('0x2a')][_0x0174('0x44')]({'where':{'id':_0x39e944[_0x0174('0x41')]['id']}})[_0x0174('0x22')](handleEntityNotFound(_0xd1d841,null))[_0x0174('0x22')](removeEntity(_0xd1d841,null))[_0x0174('0x45')](handleError(_0xd1d841,null));};exports[_0x0174('0x49')]=function(_0x4d9045,_0x1aec98){return db['MailTransferReport'][_0x0174('0x49')]()[_0x0174('0x22')](respondWithResult(_0x1aec98,null))[_0x0174('0x45')](handleError(_0x1aec98,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fc347d6..180fc04 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 _0xb9c6=['./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb9c6,0x1d8));var _0x6b9c=function(_0x458fc0,_0x3e7a67){_0x458fc0=_0x458fc0-0x0;var _0x3cc021=_0xb9c6[_0x458fc0];return _0x3cc021;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var logger=require(_0x6b9c('0x2'))(_0x6b9c('0x3'));var moment=require(_0x6b9c('0x4'));var BPromise=require(_0x6b9c('0x5'));var rp=require(_0x6b9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b9c('0x7'));var attributes=require(_0x6b9c('0x8'));module['exports']=function(_0x5670f5,_0x4312d4){return _0x5670f5['define'](_0x6b9c('0x9'),attributes,{'tableName':_0x6b9c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6b9c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1501=['rimraf','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x1501,0x126));var _0x1150=function(_0x581264,_0x46e090){_0x581264=_0x581264-0x0;var _0x23425b=_0x1501[_0x581264];return _0x23425b;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[{'name':_0x1150('0xb'),'fields':[_0x1150('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 783d6fb..7823469 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 _0xd9a0=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4db9a3,_0xa3e67a){var _0x3ca5db=function(_0x16ebed){while(--_0x16ebed){_0x4db9a3['push'](_0x4db9a3['shift']());}};_0x3ca5db(++_0xa3e67a);}(_0xd9a0,0xaa));var _0x0d9a=function(_0x56720c,_0x1b817c){_0x56720c=_0x56720c-0x0;var _0x239b00=_0xd9a0[_0x56720c];return _0x239b00;};'use strict';var _=require(_0x0d9a('0x0'));var util=require(_0x0d9a('0x1'));var moment=require(_0x0d9a('0x2'));var BPromise=require(_0x0d9a('0x3'));var rs=require(_0x0d9a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d9a('0x5'))['db'];var utils=require(_0x0d9a('0x6'));var logger=require(_0x0d9a('0x7'))('rpc');var config=require(_0x0d9a('0x8'));var jayson=require(_0x0d9a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58a390,_0x6e41c5,_0x589c88){return new BPromise(function(_0x26f7d7,_0x9871bc){return client[_0x0d9a('0xa')](_0x58a390,_0x589c88)[_0x0d9a('0xb')](function(_0x33d7d4){logger[_0x0d9a('0xc')](_0x0d9a('0xd'),_0x6e41c5,_0x0d9a('0xe'));logger[_0x0d9a('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x6e41c5,_0x0d9a('0xe'),JSON[_0x0d9a('0x10')](_0x33d7d4));if(_0x33d7d4[_0x0d9a('0x11')]){if(_0x33d7d4['error'][_0x0d9a('0x12')]===0x1f4){logger[_0x0d9a('0x11')](_0x0d9a('0xd'),_0x6e41c5,_0x33d7d4[_0x0d9a('0x11')][_0x0d9a('0x13')]);return _0x9871bc(_0x33d7d4[_0x0d9a('0x11')]['message']);}logger[_0x0d9a('0x11')](_0x0d9a('0xd'),_0x6e41c5,_0x33d7d4['error']['message']);return _0x26f7d7(_0x33d7d4[_0x0d9a('0x11')][_0x0d9a('0x13')]);}else{logger[_0x0d9a('0xc')](_0x0d9a('0xd'),_0x6e41c5,_0x0d9a('0xe'));_0x26f7d7(_0x33d7d4['result']['message']);}})[_0x0d9a('0x14')](function(_0x321557){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x6e41c5,_0x321557);_0x9871bc(_0x321557);});});} \ No newline at end of file +var _0x8f93=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x456b57,_0x58691a){var _0x18f49f=function(_0x1dc195){while(--_0x1dc195){_0x456b57['push'](_0x456b57['shift']());}};_0x18f49f(++_0x58691a);}(_0x8f93,0xd4));var _0x38f9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f93[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x38f9('0x0'));var util=require(_0x38f9('0x1'));var moment=require(_0x38f9('0x2'));var BPromise=require(_0x38f9('0x3'));var rs=require(_0x38f9('0x4'));var fs=require('fs');var Redis=require(_0x38f9('0x5'));var db=require(_0x38f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x38f9('0x7'))('rpc');var config=require(_0x38f9('0x8'));var jayson=require(_0x38f9('0x9'));var client=jayson[_0x38f9('0xa')][_0x38f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b9577,_0x1dd6c4,_0x2b3362){return new BPromise(function(_0x2a96ee,_0x2cde8f){return client[_0x38f9('0xc')](_0x5b9577,_0x2b3362)[_0x38f9('0xd')](function(_0x433401){logger[_0x38f9('0xe')](_0x38f9('0xf'),_0x1dd6c4,_0x38f9('0x10'));logger[_0x38f9('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1dd6c4,_0x38f9('0x10'),JSON['stringify'](_0x433401));if(_0x433401[_0x38f9('0x12')]){if(_0x433401[_0x38f9('0x12')]['code']===0x1f4){logger[_0x38f9('0x12')](_0x38f9('0xf'),_0x1dd6c4,_0x433401[_0x38f9('0x12')][_0x38f9('0x13')]);return _0x2cde8f(_0x433401[_0x38f9('0x12')]['message']);}logger[_0x38f9('0x12')](_0x38f9('0xf'),_0x1dd6c4,_0x433401['error'][_0x38f9('0x13')]);return _0x2a96ee(_0x433401['error'][_0x38f9('0x13')]);}else{logger[_0x38f9('0xe')](_0x38f9('0xf'),_0x1dd6c4,_0x38f9('0x10'));_0x2a96ee(_0x433401[_0x38f9('0x14')][_0x38f9('0x13')]);}})['catch'](function(_0x15beb0){logger['error'](_0x38f9('0xf'),_0x1dd6c4,_0x15beb0);_0x2cde8f(_0x15beb0);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a8deb4f..fd68d29 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 _0xc484=['../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xc484,0x19d));var _0x4c48=function(_0x1e878f,_0x3a63e7){_0x1e878f=_0x1e878f-0x0;var _0x442563=_0xc484[_0x1e878f];return _0x442563;};'use strict';var multer=require('multer');var util=require(_0x4c48('0x0'));var path=require(_0x4c48('0x1'));var timeout=require(_0x4c48('0x2'));var express=require(_0x4c48('0x3'));var router=express[_0x4c48('0x4')]();var fs_extra=require(_0x4c48('0x5'));var auth=require(_0x4c48('0x6'));var interaction=require(_0x4c48('0x7'));var config=require('../../config/environment');var controller=require(_0x4c48('0x8'));router[_0x4c48('0x9')]('/',auth[_0x4c48('0xa')](),controller[_0x4c48('0xb')]);router['get'](_0x4c48('0xc'),auth[_0x4c48('0xa')](),controller[_0x4c48('0xd')]);router[_0x4c48('0x9')](_0x4c48('0xe'),auth[_0x4c48('0xa')](),controller['show']);router[_0x4c48('0xf')]('/',auth[_0x4c48('0xa')](),controller[_0x4c48('0x10')]);router[_0x4c48('0x11')](_0x4c48('0xe'),auth[_0x4c48('0xa')](),controller[_0x4c48('0x12')]);router[_0x4c48('0x13')](_0x4c48('0xe'),auth['isAuthenticated'](),controller[_0x4c48('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3837=['Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','show','post','create','put','update','delete','/:id','multer','util','path','connect-timeout','express'];(function(_0x4f7139,_0x500a48){var _0xbfa331=function(_0x502b4f){while(--_0x502b4f){_0x4f7139['push'](_0x4f7139['shift']());}};_0xbfa331(++_0x500a48);}(_0x3837,0x113));var _0x7383=function(_0x158898,_0x5d844f){_0x158898=_0x158898-0x0;var _0x269c8f=_0x3837[_0x158898];return _0x269c8f;};'use strict';var multer=require(_0x7383('0x0'));var util=require(_0x7383('0x1'));var path=require(_0x7383('0x2'));var timeout=require(_0x7383('0x3'));var express=require(_0x7383('0x4'));var router=express[_0x7383('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7383('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7383('0x7'));var controller=require(_0x7383('0x8'));router[_0x7383('0x9')]('/',auth[_0x7383('0xa')](),controller[_0x7383('0xb')]);router['get']('/describe',auth[_0x7383('0xa')](),controller[_0x7383('0xc')]);router['get']('/:id',auth[_0x7383('0xa')](),controller[_0x7383('0xd')]);router[_0x7383('0xe')]('/',auth[_0x7383('0xa')](),controller[_0x7383('0xf')]);router[_0x7383('0x10')]('/:id',auth[_0x7383('0xa')](),controller[_0x7383('0x11')]);router[_0x7383('0x12')](_0x7383('0x13'),auth[_0x7383('0xa')](),controller['destroy']);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 8623593..86366e4 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 _0x5ea7=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING'];(function(_0x2e6d8e,_0x3360a1){var _0x16c0f9=function(_0x589c99){while(--_0x589c99){_0x2e6d8e['push'](_0x2e6d8e['shift']());}};_0x16c0f9(++_0x3360a1);}(_0x5ea7,0x11d));var _0x75ea=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x5ea7[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require(_0x75ea('0x0'));var moment=require('moment');module[_0x75ea('0x1')]={'channel':{'type':Sequelize[_0x75ea('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x75ea('0x2')],'defaultValue':_0x75ea('0x3'),'comment':_0x75ea('0x4')},'duration':{'type':Sequelize[_0x75ea('0x5')]},'enterAt':{'type':Sequelize[_0x75ea('0x6')]},'exitAt':{'type':Sequelize[_0x75ea('0x6')],'set':function(_0x55ac8c){var _0x200f36=moment(_0x55ac8c);var _0x44d5c0=moment(this[_0x75ea('0x7')](_0x75ea('0x8')));var _0x19085b=_0x200f36[_0x75ea('0x9')](_0x44d5c0,_0x75ea('0xa'));this[_0x75ea('0xb')](_0x75ea('0xc'),_0x55ac8c);this['setDataValue']('duration',_0x19085b>=0x0?_0x19085b:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x75ea('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x75ea('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x75ea('0xf')},'data4':{'type':Sequelize[_0x75ea('0x2')],'comment':_0x75ea('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0x75ea('0x11')},'role':{'type':Sequelize[_0x75ea('0x2')]},'internal':{'type':Sequelize[_0x75ea('0x5')]},'uniqueid':{'type':Sequelize[_0x75ea('0x2')]}}; \ No newline at end of file +var _0xfa8d=['talk:[dial\x20string]','talk:[queue]','INTEGER','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xfa8d,0x8a));var _0xdfa8=function(_0x515cbb,_0x220b02){_0x515cbb=_0x515cbb-0x0;var _0x247d0e=_0xfa8d[_0x515cbb];return _0x247d0e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xdfa8('0x0')]={'channel':{'type':Sequelize[_0xdfa8('0x1')]},'membername':{'type':Sequelize[_0xdfa8('0x1')]},'interface':{'type':Sequelize[_0xdfa8('0x1')]},'type':{'type':Sequelize[_0xdfa8('0x1')],'defaultValue':_0xdfa8('0x2'),'comment':_0xdfa8('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdfa8('0x4')],'set':function(_0x36d634){var _0x5d7487=moment(_0x36d634);var _0x360188=moment(this['getDataValue']('enterAt'));var _0x17e656=_0x5d7487[_0xdfa8('0x5')](_0x360188,'seconds');this[_0xdfa8('0x6')](_0xdfa8('0x7'),_0x36d634);this['setDataValue'](_0xdfa8('0x8'),_0x17e656>=0x0?_0x17e656:null);}},'data1':{'type':Sequelize[_0xdfa8('0x1')],'comment':_0xdfa8('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0xdfa8('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0xdfa8('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0xdfa8('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0xdfa8('0xd')},'role':{'type':Sequelize[_0xdfa8('0x1')]},'internal':{'type':Sequelize[_0xdfa8('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 01332eb..82e4d10 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 _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(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x34e8,0x12c));var _0x834e=function(_0x40ca63,_0x168390){_0x40ca63=_0x40ca63-0x0;var _0x478e23=_0x34e8[_0x40ca63];return _0x478e23;};'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 +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x4f4f59,_0x4215c1){var _0x322725=function(_0x4eda03){while(--_0x4eda03){_0x4f4f59['push'](_0x4f4f59['shift']());}};_0x322725(++_0x4215c1);}(_0x008c,0x188));var _0xc008=function(_0x3c0e33,_0x4e9903){_0x3c0e33=_0x3c0e33-0x0;var _0x48d10c=_0x008c[_0x3c0e33];return _0x48d10c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index ef22e11..ed40137 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 _0x535d=['exports','MemberReport','report_member','membername','lodash','util','api','moment','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x35c9f9,_0x3df225){var _0xf3e0f8=function(_0x42c337){while(--_0x42c337){_0x35c9f9['push'](_0x35c9f9['shift']());}};_0xf3e0f8(++_0x3df225);}(_0x535d,0xe8));var _0xd535=function(_0x4af47a,_0x44050f){_0x4af47a=_0x4af47a-0x0;var _0x246eea=_0x535d[_0x4af47a];return _0x246eea;};'use strict';var _=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var logger=require('../../config/logger')(_0xd535('0x2'));var moment=require(_0xd535('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd535('0x4'));var rimraf=require(_0xd535('0x5'));var config=require(_0xd535('0x6'));var attributes=require(_0xd535('0x7'));module[_0xd535('0x8')]=function(_0xa9d48d,_0x4a25fa){return _0xa9d48d['define'](_0xd535('0x9'),attributes,{'tableName':_0xd535('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xd535('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbff5=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x4edc8b,_0x2ff0c9){var _0x3d8d1b=function(_0x1d03a3){while(--_0x1d03a3){_0x4edc8b['push'](_0x4edc8b['shift']());}};_0x3d8d1b(++_0x2ff0c9);}(_0xbff5,0x86));var _0x5bff=function(_0x1821ff,_0x461139){_0x1821ff=_0x1821ff-0x0;var _0x1e93f3=_0xbff5[_0x1821ff];return _0x1e93f3;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))('api');var moment=require(_0x5bff('0x3'));var BPromise=require(_0x5bff('0x4'));var rp=require(_0x5bff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x6'));var config=require(_0x5bff('0x7'));var attributes=require(_0x5bff('0x8'));module[_0x5bff('0x9')]=function(_0x3ff124,_0x4ba471){return _0x3ff124[_0x5bff('0xa')](_0x5bff('0xb'),attributes,{'tableName':_0x5bff('0xc'),'paranoid':![],'indexes':[{'name':_0x5bff('0xd'),'fields':[_0x5bff('0xe'),_0x5bff('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index e925875..bacae70 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 _0x444e=['GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','CreateMemberReport','update','body','UpdateMemberReport','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','MemberReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x551a3e,_0x389b4a){var _0x43161d=function(_0x12878b){while(--_0x12878b){_0x551a3e['push'](_0x551a3e['shift']());}};_0x43161d(++_0x389b4a);}(_0x444e,0xe8));var _0xe444=function(_0x153749,_0x194fd4){_0x153749=_0x153749-0x0;var _0x3359df=_0x444e[_0x153749];return _0x3359df;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4834c7,_0xfbd88b,_0x4b5b7d){return new BPromise(function(_0x29a2b7,_0x482b98){return client[_0xe444('0xa')](_0x4834c7,_0x4b5b7d)[_0xe444('0xb')](function(_0x40a368){logger['info']('MemberReport,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'));logger[_0xe444('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'),JSON['stringify'](_0x40a368));if(_0x40a368['error']){if(_0x40a368[_0xe444('0xe')]['code']===0x1f4){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x482b98(_0x40a368['error']['message']);}logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x29a2b7(_0x40a368['error'][_0xe444('0x10')]);}else{logger[_0xe444('0x11')](_0xe444('0xf'),_0xfbd88b,_0xe444('0xc'));_0x29a2b7(_0x40a368[_0xe444('0x12')][_0xe444('0x10')]);}})[_0xe444('0x13')](function(_0x3e1b57){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x3e1b57);_0x482b98(_0x3e1b57);});});}exports[_0xe444('0x14')]=function(_0x3d9066){var _0x38879b=this;return new Promise(function(_0x4e2711,_0x3407a2){return db[_0xe444('0x15')][_0xe444('0x16')]({'raw':_0x3d9066[_0xe444('0x17')]?_0x3d9066['options'][_0xe444('0x18')]===undefined?!![]:![]:!![],'where':_0x3d9066[_0xe444('0x17')]?_0x3d9066[_0xe444('0x17')][_0xe444('0x19')]||null:null,'attributes':_0x3d9066[_0xe444('0x17')]?_0x3d9066['options'][_0xe444('0x1a')]||null:null,'limit':_0x3d9066[_0xe444('0x17')]?_0x3d9066['options'][_0xe444('0x1b')]||null:null,'include':_0x3d9066['options']?_0x3d9066[_0xe444('0x17')][_0xe444('0x1c')]?_[_0xe444('0x1d')](_0x3d9066[_0xe444('0x17')][_0xe444('0x1c')],function(_0x481762){return{'model':db[_0x481762['model']],'as':_0x481762['as'],'attributes':_0x481762[_0xe444('0x1a')],'include':_0x481762[_0xe444('0x1c')]?_[_0xe444('0x1d')](_0x481762[_0xe444('0x1c')],function(_0x2a03a2){return{'model':db[_0x2a03a2['model']],'as':_0x2a03a2['as'],'attributes':_0x2a03a2[_0xe444('0x1a')],'include':_0x2a03a2[_0xe444('0x1c')]?_['map'](_0x2a03a2[_0xe444('0x1c')],function(_0x4f4412){return{'model':db[_0x4f4412[_0xe444('0x1e')]],'as':_0x4f4412['as'],'attributes':_0x4f4412[_0xe444('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe444('0xb')](function(_0x23072c){logger[_0xe444('0x11')]('GetMemberReport',_0x3d9066);logger[_0xe444('0xd')](_0xe444('0x14'),_0x3d9066,JSON[_0xe444('0x1f')](_0x23072c));_0x4e2711(_0x23072c);})[_0xe444('0x13')](function(_0x5bc063){logger['error'](_0xe444('0x14'),_0x5bc063[_0xe444('0x10')],_0x3d9066);_0x3407a2(_0x38879b[_0xe444('0xe')](0x1f4,_0x5bc063[_0xe444('0x10')]));});});};exports['CreateMemberReport']=function(_0x26e233){var _0x224785=this;return new Promise(function(_0x41eac0,_0x922e16){return db['MemberReport']['create'](_0x26e233['body'],{'raw':_0x26e233[_0xe444('0x17')]?_0x26e233[_0xe444('0x17')][_0xe444('0x18')]===undefined?!![]:![]:!![]})[_0xe444('0xb')](function(_0x937dde){logger['info'](_0xe444('0x20'),_0x26e233);logger[_0xe444('0xd')](_0xe444('0x20'),_0x26e233,JSON['stringify'](_0x937dde));_0x41eac0(_0x937dde);})[_0xe444('0x13')](function(_0x49b708){logger['error'](_0xe444('0x20'),_0x49b708[_0xe444('0x10')],_0x26e233);_0x922e16(_0x224785['error'](0x1f4,_0x49b708[_0xe444('0x10')]));});});};exports['UpdateMemberReport']=function(_0x1bf90b){var _0x5dfd0e=this;return new Promise(function(_0x4b01b9,_0x1ed8b0){return db['MemberReport'][_0xe444('0x21')](_0x1bf90b[_0xe444('0x22')],{'raw':_0x1bf90b[_0xe444('0x17')]?_0x1bf90b[_0xe444('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bf90b[_0xe444('0x17')]?_0x1bf90b[_0xe444('0x17')][_0xe444('0x19')]||null:null,'attributes':_0x1bf90b['options']?_0x1bf90b[_0xe444('0x17')]['attributes']||null:null,'limit':_0x1bf90b[_0xe444('0x17')]?_0x1bf90b[_0xe444('0x17')][_0xe444('0x1b')]||null:null})['then'](function(_0x5cb915){logger[_0xe444('0x11')](_0xe444('0x23'),_0x1bf90b);logger[_0xe444('0xd')](_0xe444('0x23'),_0x1bf90b,JSON[_0xe444('0x1f')](_0x5cb915));_0x4b01b9(_0x5cb915);})[_0xe444('0x13')](function(_0x34cce8){logger['error']('UpdateMemberReport',_0x34cce8[_0xe444('0x10')],_0x1bf90b);_0x1ed8b0(_0x5dfd0e['error'](0x1f4,_0x34cce8[_0xe444('0x10')]));});});}; \ No newline at end of file +var _0xc1c6=['UpdateMemberReport','update','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','MemberReport','create','body','CreateMemberReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x318c27,_0x115f4b){_0x318c27=_0x318c27-0x0;var _0x574708=_0xc1c6[_0x318c27];return _0x574708;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['GetMemberReport']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['MemberReport'][_0x6c1c('0x13')]({'raw':_0x137770['options']?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null,'include':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')],function(_0x12c638){return{'model':db[_0x12c638[_0x6c1c('0x1b')]],'as':_0x12c638['as'],'attributes':_0x12c638[_0x6c1c('0x17')],'include':_0x12c638[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x12c638[_0x6c1c('0x19')],function(_0x7ff10d){return{'model':db[_0x7ff10d[_0x6c1c('0x1b')]],'as':_0x7ff10d['as'],'attributes':_0x7ff10d[_0x6c1c('0x17')],'include':_0x7ff10d[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x7ff10d[_0x6c1c('0x19')],function(_0x5f4568){return{'model':db[_0x5f4568[_0x6c1c('0x1b')]],'as':_0x5f4568['as'],'attributes':_0x5f4568['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0x4c23f8){logger[_0x6c1c('0x11')]('GetMemberReport',_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x1c'),_0x137770,JSON['stringify'](_0x4c23f8));_0x338dc2(_0x4c23f8);})[_0x6c1c('0x12')](function(_0x24da4c){logger['error'](_0x6c1c('0x1c'),_0x24da4c[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x24da4c[_0x6c1c('0x10')]));});});};exports['CreateMemberReport']=function(_0x52c036){var _0x3cba17=this;return new Promise(function(_0x45128c,_0x21acef){return db[_0x6c1c('0x1d')][_0x6c1c('0x1e')](_0x52c036[_0x6c1c('0x1f')],{'raw':_0x52c036['options']?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x1b371d){logger[_0x6c1c('0x11')](_0x6c1c('0x20'),_0x52c036);logger[_0x6c1c('0xc')]('CreateMemberReport',_0x52c036,JSON[_0x6c1c('0xe')](_0x1b371d));_0x45128c(_0x1b371d);})[_0x6c1c('0x12')](function(_0x245433){logger['error'](_0x6c1c('0x20'),_0x245433['message'],_0x52c036);_0x21acef(_0x3cba17[_0x6c1c('0xf')](0x1f4,_0x245433['message']));});});};exports[_0x6c1c('0x21')]=function(_0x24d3e1){var _0x32916f=this;return new Promise(function(_0x54b8d3,_0x4f557a){return db[_0x6c1c('0x1d')][_0x6c1c('0x22')](_0x24d3e1[_0x6c1c('0x1f')],{'raw':_0x24d3e1['options']?_0x24d3e1[_0x6c1c('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d3e1['options']?_0x24d3e1[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x24d3e1[_0x6c1c('0x14')]?_0x24d3e1[_0x6c1c('0x14')]['attributes']||null:null,'limit':_0x24d3e1[_0x6c1c('0x14')]?_0x24d3e1[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null})[_0x6c1c('0x9')](function(_0x173a54){logger[_0x6c1c('0x11')](_0x6c1c('0x21'),_0x24d3e1);logger[_0x6c1c('0xc')](_0x6c1c('0x21'),_0x24d3e1,JSON[_0x6c1c('0xe')](_0x173a54));_0x54b8d3(_0x173a54);})['catch'](function(_0xb05b38){logger[_0x6c1c('0xf')](_0x6c1c('0x21'),_0xb05b38[_0x6c1c('0x10')],_0x24d3e1);_0x4f557a(_0x32916f[_0x6c1c('0xf')](0x1f4,_0xb05b38['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 0f4f9ff..a7504df 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 _0xab86=['path','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab86,0x13e));var _0x6ab8=function(_0x41b77c,_0x35a487){_0x41b77c=_0x41b77c-0x0;var _0xfcea98=_0xab86[_0x41b77c];return _0xfcea98;};'use strict';var multer=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var path=require(_0x6ab8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ab8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ab8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ab8('0x5'));var controller=require(_0x6ab8('0x6'));router[_0x6ab8('0x7')]('/',controller[_0x6ab8('0x8')]);module[_0x6ab8('0x9')]=router; \ No newline at end of file +var _0x2d3a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','multer'];(function(_0x17a146,_0x3c086d){var _0x4125b1=function(_0x229e15){while(--_0x229e15){_0x17a146['push'](_0x17a146['shift']());}};_0x4125b1(++_0x3c086d);}(_0x2d3a,0x196));var _0xa2d3=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0x2d3a[_0x32f05c];return _0x4307ed;};'use strict';var multer=require(_0xa2d3('0x0'));var util=require(_0xa2d3('0x1'));var path=require(_0xa2d3('0x2'));var timeout=require(_0xa2d3('0x3'));var express=require(_0xa2d3('0x4'));var router=express[_0xa2d3('0x5')]();var fs_extra=require(_0xa2d3('0x6'));var auth=require(_0xa2d3('0x7'));var interaction=require(_0xa2d3('0x8'));var config=require(_0xa2d3('0x9'));var controller=require(_0xa2d3('0xa'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 00cb64a..9e6046e 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 _0x29c0=['version','sequelize','exports','STRING'];(function(_0x32326b,_0x40ef01){var _0x15f6a6=function(_0x4aa228){while(--_0x4aa228){_0x32326b['push'](_0x32326b['shift']());}};_0x15f6a6(++_0x40ef01);}(_0x29c0,0xd9));var _0x029c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x29c0[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x029c('0x0'));module[_0x029c('0x1')]={'version':{'type':Sequelize[_0x029c('0x2')],'unique':_0x029c('0x3')}}; \ No newline at end of file +var _0x0eb4=['version','sequelize','exports','STRING'];(function(_0x57b3df,_0x445081){var _0x206656=function(_0x16aeb3){while(--_0x16aeb3){_0x57b3df['push'](_0x57b3df['shift']());}};_0x206656(++_0x445081);}(_0x0eb4,0x75));var _0x40eb=function(_0x15306a,_0x5617d9){_0x15306a=_0x15306a-0x0;var _0x316f0c=_0x0eb4[_0x15306a];return _0x316f0c;};'use strict';var Sequelize=require(_0x40eb('0x0'));module[_0x40eb('0x1')]={'version':{'type':Sequelize[_0x40eb('0x2')],'unique':_0x40eb('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0fbf391..dd65bb6 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 _0x68fc=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','VIRTUAL','merge','options','where','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68fc,0x195));var _0xc68f=function(_0x99a933,_0x43ec68){_0x99a933=_0x99a933-0x0;var _0x1fffab=_0x68fc[_0x99a933];return _0x1fffab;};'use strict';var emlformat=require(_0xc68f('0x0'));var rimraf=require(_0xc68f('0x1'));var zipdir=require(_0xc68f('0x2'));var jsonpatch=require(_0xc68f('0x3'));var rp=require(_0xc68f('0x4'));var moment=require(_0xc68f('0x5'));var BPromise=require(_0xc68f('0x6'));var Mustache=require(_0xc68f('0x7'));var util=require(_0xc68f('0x8'));var path=require(_0xc68f('0x9'));var sox=require(_0xc68f('0xa'));var csv=require(_0xc68f('0xb'));var ejs=require(_0xc68f('0xc'));var fs=require('fs');var fs_extra=require(_0xc68f('0xd'));var _=require(_0xc68f('0xe'));var squel=require(_0xc68f('0xf'));var crypto=require(_0xc68f('0x10'));var jsforce=require(_0xc68f('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xc68f('0xb'));var querystring=require(_0xc68f('0x12'));var Papa=require(_0xc68f('0x13'));var Redis=require(_0xc68f('0x14'));var authService=require(_0xc68f('0x15'));var qs=require(_0xc68f('0x16'));var as=require(_0xc68f('0x17'));var hardwareService=require(_0xc68f('0x18'));var logger=require(_0xc68f('0x19'))('api');var utils=require(_0xc68f('0x1a'));var config=require(_0xc68f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13cc38,_0xc8365f){_0xc8365f=_0xc8365f||0xcc;return function(_0x264f0c){if(_0x264f0c){return _0x13cc38[_0xc68f('0x1c')](_0xc8365f);}return _0x13cc38[_0xc68f('0x1d')](_0xc8365f)[_0xc68f('0x1e')]();};}function respondWithResult(_0x3849e8,_0x82b00b){_0x82b00b=_0x82b00b||0xc8;return function(_0x20a8d3){if(_0x20a8d3){return _0x3849e8[_0xc68f('0x1d')](_0x82b00b)[_0xc68f('0x1f')](_0x20a8d3);}};}function respondWithFilteredResult(_0x6bd97a,_0x3b5dbf){return function(_0x3f1e45){if(_0x3f1e45){var _0x296ab8=typeof _0x3b5dbf[_0xc68f('0x20')]===_0xc68f('0x21')&&typeof _0x3b5dbf[_0xc68f('0x22')]===_0xc68f('0x21');var _0x2fe2c3=_0x3f1e45[_0xc68f('0x23')];var _0x3a8517=_0x296ab8?0x0:_0x3b5dbf['offset'];var _0x1438c0=_0x296ab8?_0x3f1e45[_0xc68f('0x23')]:_0x3b5dbf[_0xc68f('0x20')]+_0x3b5dbf['limit'];var _0x337d75;if(_0x1438c0>=_0x2fe2c3){_0x1438c0=_0x2fe2c3;_0x337d75=0xc8;}else{_0x337d75=0xce;}_0x6bd97a[_0xc68f('0x1d')](_0x337d75);return _0x6bd97a[_0xc68f('0x24')](_0xc68f('0x25'),_0x3a8517+'-'+_0x1438c0+'/'+_0x2fe2c3)[_0xc68f('0x1f')](_0x3f1e45);}return null;};}function patchUpdates(_0x4143dd){return function(_0xec1512){try{jsonpatch[_0xc68f('0x26')](_0xec1512,_0x4143dd,!![]);}catch(_0x5b0ab1){return BPromise['reject'](_0x5b0ab1);}return _0xec1512[_0xc68f('0x27')]();};}function saveUpdates(_0x9da94f,_0x66025){return function(_0x52c446){if(_0x52c446){return _0x52c446['update'](_0x9da94f)[_0xc68f('0x28')](function(_0x14c786){return _0x14c786;});}return null;};}function removeEntity(_0x22ad75,_0x1f5363){return function(_0x1326c9){if(_0x1326c9){return _0x1326c9[_0xc68f('0x29')]()['then'](function(){_0x22ad75['status'](0xcc)[_0xc68f('0x1e')]();});}};}function handleEntityNotFound(_0x2d7feb,_0x1cbb69){return function(_0x120c4f){if(!_0x120c4f){_0x2d7feb[_0xc68f('0x1c')](0x194);}return _0x120c4f;};}function handleError(_0x35cc86,_0x17c771){_0x17c771=_0x17c771||0x1f4;return function(_0x7b3ac8){logger[_0xc68f('0x2a')](_0x7b3ac8['stack']);if(_0x7b3ac8[_0xc68f('0x2b')]){delete _0x7b3ac8[_0xc68f('0x2b')];}_0x35cc86[_0xc68f('0x1d')](_0x17c771)[_0xc68f('0x2c')](_0x7b3ac8);};}exports['index']=function(_0x3acb26,_0x3fa2e6){var _0x4aa02e={},_0x387ff9={},_0x459eb2={'count':0x0,'rows':[]};var _0x2badae=_[_0xc68f('0x2d')](db[_0xc68f('0x2e')][_0xc68f('0x2f')],function(_0x1e2604){return{'name':_0x1e2604[_0xc68f('0x30')],'type':_0x1e2604[_0xc68f('0x31')][_0xc68f('0x32')]};});_0x387ff9['model']=_[_0xc68f('0x2d')](_0x2badae,_0xc68f('0x2b'));_0x387ff9[_0xc68f('0x33')]=_[_0xc68f('0x34')](_0x3acb26[_0xc68f('0x33')]);_0x387ff9[_0xc68f('0x35')]=_[_0xc68f('0x36')](_0x387ff9['model'],_0x387ff9['query']);_0x4aa02e[_0xc68f('0x37')]=_[_0xc68f('0x36')](_0x387ff9['model'],qs[_0xc68f('0x38')](_0x3acb26[_0xc68f('0x33')][_0xc68f('0x38')]));_0x4aa02e['attributes']=_0x4aa02e['attributes'][_0xc68f('0x39')]?_0x4aa02e[_0xc68f('0x37')]:_0x387ff9['model'];if(!_0x3acb26['query']['hasOwnProperty'](_0xc68f('0x3a'))){_0x4aa02e[_0xc68f('0x22')]=qs[_0xc68f('0x22')](_0x3acb26[_0xc68f('0x33')][_0xc68f('0x22')]);_0x4aa02e[_0xc68f('0x20')]=qs['offset'](_0x3acb26['query']['offset']);}_0x4aa02e['order']=qs[_0xc68f('0x3b')](_0x3acb26['query']['sort']);_0x4aa02e['where']=qs[_0xc68f('0x35')](_[_0xc68f('0x3c')](_0x3acb26[_0xc68f('0x33')],_0x387ff9['filters']),_0x2badae);if(_0x3acb26[_0xc68f('0x33')][_0xc68f('0x3d')]){_0x4aa02e['where']=_['merge'](_0x4aa02e['where'],{'$or':_['map'](_0x2badae,function(_0x23dfcc){if(_0x23dfcc[_0xc68f('0x31')]!==_0xc68f('0x3e')){var _0x5626a6={};_0x5626a6[_0x23dfcc[_0xc68f('0x2b')]]={'$like':'%'+_0x3acb26['query'][_0xc68f('0x3d')]+'%'};return _0x5626a6;}})});}_0x4aa02e=_[_0xc68f('0x3f')]({},_0x4aa02e,_0x3acb26[_0xc68f('0x40')]);var _0x413ba2={'where':_0x4aa02e[_0xc68f('0x41')]};return db[_0xc68f('0x2e')][_0xc68f('0x23')](_0x413ba2)[_0xc68f('0x28')](function(_0x4f8256){_0x459eb2[_0xc68f('0x23')]=_0x4f8256;if(_0x3acb26[_0xc68f('0x33')]['includeAll']){_0x4aa02e[_0xc68f('0x42')]=[{'all':!![]}];}return db[_0xc68f('0x2e')][_0xc68f('0x43')](_0x4aa02e);})[_0xc68f('0x28')](function(_0x4ea9cb){_0x459eb2[_0xc68f('0x44')]=_0x4ea9cb;return _0x459eb2;})[_0xc68f('0x28')](respondWithFilteredResult(_0x3fa2e6,_0x4aa02e))[_0xc68f('0x45')](handleError(_0x3fa2e6,null));}; \ No newline at end of file +var _0xbd33=['count','set','apply','reject','then','destroy','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Migration','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x241ada,_0x38127a){var _0x3662b7=function(_0x35e5a0){while(--_0x35e5a0){_0x241ada['push'](_0x241ada['shift']());}};_0x3662b7(++_0x38127a);}(_0xbd33,0x13b));var _0x3bd3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbd33[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3bd3('0x0'));var rimraf=require(_0x3bd3('0x1'));var zipdir=require(_0x3bd3('0x2'));var jsonpatch=require(_0x3bd3('0x3'));var rp=require('request-promise');var moment=require(_0x3bd3('0x4'));var BPromise=require(_0x3bd3('0x5'));var Mustache=require(_0x3bd3('0x6'));var util=require(_0x3bd3('0x7'));var path=require('path');var sox=require(_0x3bd3('0x8'));var csv=require('to-csv');var ejs=require(_0x3bd3('0x9'));var fs=require('fs');var fs_extra=require(_0x3bd3('0xa'));var _=require(_0x3bd3('0xb'));var squel=require(_0x3bd3('0xc'));var crypto=require(_0x3bd3('0xd'));var jsforce=require(_0x3bd3('0xe'));var deskjs=require(_0x3bd3('0xf'));var toCsv=require(_0x3bd3('0x10'));var querystring=require(_0x3bd3('0x11'));var Papa=require(_0x3bd3('0x12'));var Redis=require(_0x3bd3('0x13'));var authService=require(_0x3bd3('0x14'));var qs=require(_0x3bd3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bd3('0x16'));var logger=require('../../config/logger')(_0x3bd3('0x17'));var utils=require(_0x3bd3('0x18'));var config=require(_0x3bd3('0x19'));var licenseUtil=require(_0x3bd3('0x1a'));var db=require(_0x3bd3('0x1b'))['db'];function respondWithStatusCode(_0x2330d0,_0x252372){_0x252372=_0x252372||0xcc;return function(_0x50d458){if(_0x50d458){return _0x2330d0[_0x3bd3('0x1c')](_0x252372);}return _0x2330d0[_0x3bd3('0x1d')](_0x252372)[_0x3bd3('0x1e')]();};}function respondWithResult(_0x3da957,_0x5634ce){_0x5634ce=_0x5634ce||0xc8;return function(_0x3ef9c5){if(_0x3ef9c5){return _0x3da957[_0x3bd3('0x1d')](_0x5634ce)[_0x3bd3('0x1f')](_0x3ef9c5);}};}function respondWithFilteredResult(_0x504bf7,_0x4e33fa){return function(_0x83b347){if(_0x83b347){var _0x3fb916=typeof _0x4e33fa[_0x3bd3('0x20')]==='undefined'&&typeof _0x4e33fa[_0x3bd3('0x21')]===_0x3bd3('0x22');var _0x4d5e0d=_0x83b347['count'];var _0x490982=_0x3fb916?0x0:_0x4e33fa[_0x3bd3('0x20')];var _0x192a6c=_0x3fb916?_0x83b347[_0x3bd3('0x23')]:_0x4e33fa[_0x3bd3('0x20')]+_0x4e33fa[_0x3bd3('0x21')];var _0x1172d9;if(_0x192a6c>=_0x4d5e0d){_0x192a6c=_0x4d5e0d;_0x1172d9=0xc8;}else{_0x1172d9=0xce;}_0x504bf7[_0x3bd3('0x1d')](_0x1172d9);return _0x504bf7[_0x3bd3('0x24')]('Content-Range',_0x490982+'-'+_0x192a6c+'/'+_0x4d5e0d)[_0x3bd3('0x1f')](_0x83b347);}return null;};}function patchUpdates(_0x3cab78){return function(_0x3d84a2){try{jsonpatch[_0x3bd3('0x25')](_0x3d84a2,_0x3cab78,!![]);}catch(_0xb93021){return BPromise[_0x3bd3('0x26')](_0xb93021);}return _0x3d84a2['save']();};}function saveUpdates(_0x48c711,_0x1f6841){return function(_0x44efcf){if(_0x44efcf){return _0x44efcf['update'](_0x48c711)[_0x3bd3('0x27')](function(_0x52f7d2){return _0x52f7d2;});}return null;};}function removeEntity(_0x13a8d3,_0x4664b9){return function(_0x53f289){if(_0x53f289){return _0x53f289[_0x3bd3('0x28')]()['then'](function(){_0x13a8d3['status'](0xcc)[_0x3bd3('0x1e')]();});}};}function handleEntityNotFound(_0x411f91,_0xc80dee){return function(_0x26916f){if(!_0x26916f){_0x411f91['sendStatus'](0x194);}return _0x26916f;};}function handleError(_0xaf0338,_0x27024b){_0x27024b=_0x27024b||0x1f4;return function(_0x409144){logger[_0x3bd3('0x29')](_0x409144[_0x3bd3('0x2a')]);if(_0x409144['name']){delete _0x409144[_0x3bd3('0x2b')];}_0xaf0338['status'](_0x27024b)[_0x3bd3('0x2c')](_0x409144);};}exports['index']=function(_0x1637c4,_0x9f3366){var _0x3c0199={},_0x24d757={},_0x3cef23={'count':0x0,'rows':[]};var _0x4fc91b=_[_0x3bd3('0x2d')](db['Migration']['rawAttributes'],function(_0x13b808){return{'name':_0x13b808[_0x3bd3('0x2e')],'type':_0x13b808[_0x3bd3('0x2f')][_0x3bd3('0x30')]};});_0x24d757['model']=_['map'](_0x4fc91b,_0x3bd3('0x2b'));_0x24d757[_0x3bd3('0x31')]=_[_0x3bd3('0x32')](_0x1637c4['query']);_0x24d757[_0x3bd3('0x33')]=_[_0x3bd3('0x34')](_0x24d757['model'],_0x24d757[_0x3bd3('0x31')]);_0x3c0199['attributes']=_['intersection'](_0x24d757[_0x3bd3('0x35')],qs[_0x3bd3('0x36')](_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x36')]));_0x3c0199[_0x3bd3('0x37')]=_0x3c0199['attributes'][_0x3bd3('0x38')]?_0x3c0199[_0x3bd3('0x37')]:_0x24d757[_0x3bd3('0x35')];if(!_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x39')](_0x3bd3('0x3a'))){_0x3c0199[_0x3bd3('0x21')]=qs[_0x3bd3('0x21')](_0x1637c4['query']['limit']);_0x3c0199['offset']=qs['offset'](_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x20')]);}_0x3c0199[_0x3bd3('0x3b')]=qs[_0x3bd3('0x3c')](_0x1637c4[_0x3bd3('0x31')]['sort']);_0x3c0199[_0x3bd3('0x3d')]=qs[_0x3bd3('0x33')](_['pick'](_0x1637c4[_0x3bd3('0x31')],_0x24d757['filters']),_0x4fc91b);if(_0x1637c4[_0x3bd3('0x31')][_0x3bd3('0x3e')]){_0x3c0199[_0x3bd3('0x3d')]=_['merge'](_0x3c0199[_0x3bd3('0x3d')],{'$or':_[_0x3bd3('0x2d')](_0x4fc91b,function(_0x1540a2){if(_0x1540a2[_0x3bd3('0x2f')]!==_0x3bd3('0x3f')){var _0x37d9a0={};_0x37d9a0[_0x1540a2[_0x3bd3('0x2b')]]={'$like':'%'+_0x1637c4['query'][_0x3bd3('0x3e')]+'%'};return _0x37d9a0;}})});}_0x3c0199=_[_0x3bd3('0x40')]({},_0x3c0199,_0x1637c4[_0x3bd3('0x41')]);var _0x18a622={'where':_0x3c0199[_0x3bd3('0x3d')]};return db[_0x3bd3('0x42')][_0x3bd3('0x23')](_0x18a622)[_0x3bd3('0x27')](function(_0x2f6231){_0x3cef23['count']=_0x2f6231;if(_0x1637c4[_0x3bd3('0x31')]['includeAll']){_0x3c0199[_0x3bd3('0x43')]=[{'all':!![]}];}return db[_0x3bd3('0x42')][_0x3bd3('0x44')](_0x3c0199);})[_0x3bd3('0x27')](function(_0x24a0c6){_0x3cef23['rows']=_0x24a0c6;return _0x3cef23;})[_0x3bd3('0x27')](respondWithFilteredResult(_0x9f3366,_0x3c0199))[_0x3bd3('0x45')](handleError(_0x9f3366,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 646bb75..1697528 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 _0xa149=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','Migration','migrations','lodash'];(function(_0x2eb929,_0x10dc28){var _0x2f19bd=function(_0x3ceb9c){while(--_0x3ceb9c){_0x2eb929['push'](_0x2eb929['shift']());}};_0x2f19bd(++_0x10dc28);}(_0xa149,0x12b));var _0x9a14=function(_0x48a403,_0x3a408a){_0x48a403=_0x48a403-0x0;var _0x22a8b1=_0xa149[_0x48a403];return _0x22a8b1;};'use strict';var _=require(_0x9a14('0x0'));var util=require('util');var logger=require(_0x9a14('0x1'))(_0x9a14('0x2'));var moment=require(_0x9a14('0x3'));var BPromise=require(_0x9a14('0x4'));var rp=require(_0x9a14('0x5'));var fs=require('fs');var path=require(_0x9a14('0x6'));var rimraf=require(_0x9a14('0x7'));var config=require(_0x9a14('0x8'));var attributes=require(_0x9a14('0x9'));module['exports']=function(_0x984737,_0x387257){return _0x984737['define'](_0x9a14('0xa'),attributes,{'tableName':_0x9a14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2942=['migrations','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0xce09a0,_0x255590){var _0x5d6e63=function(_0x1ebf13){while(--_0x1ebf13){_0xce09a0['push'](_0xce09a0['shift']());}};_0x5d6e63(++_0x255590);}(_0x2942,0x1ed));var _0x2294=function(_0x62acd5,_0x4ddb49){_0x62acd5=_0x62acd5-0x0;var _0x227ab4=_0x2942[_0x62acd5];return _0x227ab4;};'use strict';var _=require(_0x2294('0x0'));var util=require('util');var logger=require(_0x2294('0x1'))(_0x2294('0x2'));var moment=require(_0x2294('0x3'));var BPromise=require(_0x2294('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2294('0x5'));var config=require(_0x2294('0x6'));var attributes=require(_0x2294('0x7'));module[_0x2294('0x8')]=function(_0x178e75,_0x331c68){return _0x178e75[_0x2294('0x9')](_0x2294('0xa'),attributes,{'tableName':_0x2294('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 38e9835..18d6710 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 _0x2621=['rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d2a31,_0x4920fb){var _0x577a7e=function(_0x164c39){while(--_0x164c39){_0x5d2a31['push'](_0x5d2a31['shift']());}};_0x577a7e(++_0x4920fb);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var moment=require(_0x1262('0x2'));var BPromise=require(_0x1262('0x3'));var rs=require(_0x1262('0x4'));var fs=require('fs');var Redis=require(_0x1262('0x5'));var db=require(_0x1262('0x6'))['db'];var utils=require(_0x1262('0x7'));var logger=require(_0x1262('0x8'))(_0x1262('0x9'));var config=require(_0x1262('0xa'));var jayson=require(_0x1262('0xb'));var client=jayson[_0x1262('0xc')][_0x1262('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d4535,_0x4ca884,_0x52af34){return new BPromise(function(_0xaa3c86,_0x491949){return client[_0x1262('0xe')](_0x4d4535,_0x52af34)[_0x1262('0xf')](function(_0x40d8c3){logger['info'](_0x1262('0x10'),_0x4ca884,'request\x20sent');logger[_0x1262('0x11')](_0x1262('0x12'),_0x4ca884,'request\x20sent',JSON['stringify'](_0x40d8c3));if(_0x40d8c3[_0x1262('0x13')]){if(_0x40d8c3[_0x1262('0x13')][_0x1262('0x14')]===0x1f4){logger[_0x1262('0x13')](_0x1262('0x10'),_0x4ca884,_0x40d8c3[_0x1262('0x13')]['message']);return _0x491949(_0x40d8c3[_0x1262('0x13')][_0x1262('0x15')]);}logger[_0x1262('0x13')]('Migration,\x20%s,\x20%s',_0x4ca884,_0x40d8c3[_0x1262('0x13')][_0x1262('0x15')]);return _0xaa3c86(_0x40d8c3['error']['message']);}else{logger[_0x1262('0x16')](_0x1262('0x10'),_0x4ca884,'request\x20sent');_0xaa3c86(_0x40d8c3[_0x1262('0x17')]['message']);}})[_0x1262('0x18')](function(_0x169765){logger[_0x1262('0x13')](_0x1262('0x10'),_0x4ca884,_0x169765);_0x491949(_0x169765);});});} \ No newline at end of file +var _0x1c4f=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0xaaf671,_0x76cd05){_0xaaf671=_0xaaf671-0x0;var _0x5e71aa=_0x1c4f[_0xaaf671];return _0x5e71aa;};'use strict';var _=require(_0xf1c4('0x0'));var util=require(_0xf1c4('0x1'));var moment=require(_0xf1c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xf1c4('0x3'));var fs=require('fs');var Redis=require(_0xf1c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1c4('0x5'));var logger=require(_0xf1c4('0x6'))(_0xf1c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xf1c4('0x8'));var client=jayson[_0xf1c4('0x9')][_0xf1c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x79689d,_0x3dadae,_0x2b45c2){return new BPromise(function(_0x5743a6,_0x5b13ce){return client[_0xf1c4('0xb')](_0x79689d,_0x2b45c2)[_0xf1c4('0xc')](function(_0x495df4){logger[_0xf1c4('0xd')](_0xf1c4('0xe'),_0x3dadae,_0xf1c4('0xf'));logger[_0xf1c4('0x10')](_0xf1c4('0x11'),_0x3dadae,_0xf1c4('0xf'),JSON['stringify'](_0x495df4));if(_0x495df4['error']){if(_0x495df4[_0xf1c4('0x12')][_0xf1c4('0x13')]===0x1f4){logger[_0xf1c4('0x12')](_0xf1c4('0xe'),_0x3dadae,_0x495df4[_0xf1c4('0x12')][_0xf1c4('0x14')]);return _0x5b13ce(_0x495df4[_0xf1c4('0x12')]['message']);}logger[_0xf1c4('0x12')]('Migration,\x20%s,\x20%s',_0x3dadae,_0x495df4[_0xf1c4('0x12')][_0xf1c4('0x14')]);return _0x5743a6(_0x495df4[_0xf1c4('0x12')][_0xf1c4('0x14')]);}else{logger[_0xf1c4('0xd')](_0xf1c4('0xe'),_0x3dadae,_0xf1c4('0xf'));_0x5743a6(_0x495df4[_0xf1c4('0x15')][_0xf1c4('0x14')]);}})[_0xf1c4('0x16')](function(_0x25a0dd){logger['error'](_0xf1c4('0xe'),_0x3dadae,_0x25a0dd);_0x5b13ce(_0x25a0dd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b1d33e6..978303b 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 _0x01d9=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'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('0xf')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router[_0x901d('0x13')]('/:id',auth[_0x901d('0xd')](),controller['destroy']);module[_0x901d('0x14')]=router; \ No newline at end of file +var _0x0598=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x39650f,_0x591e64){var _0x529282=function(_0xdcc474){while(--_0xdcc474){_0x39650f['push'](_0x39650f['shift']());}};_0x529282(++_0x591e64);}(_0x0598,0x19e));var _0x8059=function(_0x25cd1b,_0x2a578d){_0x25cd1b=_0x25cd1b-0x0;var _0x22289f=_0x0598[_0x25cd1b];return _0x22289f;};'use strict';var multer=require(_0x8059('0x0'));var util=require('util');var path=require(_0x8059('0x1'));var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8059('0x3'));var interaction=require(_0x8059('0x4'));var config=require(_0x8059('0x5'));var controller=require(_0x8059('0x6'));router[_0x8059('0x7')]('/',auth[_0x8059('0x8')](),controller[_0x8059('0x9')]);router['get'](_0x8059('0xa'),auth[_0x8059('0x8')](),controller[_0x8059('0xb')]);router[_0x8059('0xc')]('/',auth[_0x8059('0x8')](),controller['create']);router[_0x8059('0xd')]('/:id',auth[_0x8059('0x8')](),controller[_0x8059('0xe')]);router[_0x8059('0xf')](_0x8059('0xa'),auth[_0x8059('0x8')](),controller[_0x8059('0x10')]);module[_0x8059('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 98d0344..81cf1fb 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 _0x5467=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0xb26532,_0x3656e2){var _0x1cc503=function(_0x48d638){while(--_0x48d638){_0xb26532['push'](_0xb26532['shift']());}};_0x1cc503(++_0x3656e2);}(_0x5467,0x141));var _0x7546=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x5467[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x7546('0x0'));module[_0x7546('0x1')]={'type':{'type':Sequelize[_0x7546('0x2')](_0x7546('0x3'),_0x7546('0x4'),_0x7546('0x5'),_0x7546('0x6'))},'value':{'type':Sequelize[_0x7546('0x7')]},'username':{'type':Sequelize[_0x7546('0x7')]},'password':{'type':Sequelize[_0x7546('0x7')]}}; \ No newline at end of file +var _0x7f81=['ENUM','localnet','externip','stun','STRING','sequelize','exports'];(function(_0x5be36e,_0x2667c3){var _0x8f908f=function(_0x3baf38){while(--_0x3baf38){_0x5be36e['push'](_0x5be36e['shift']());}};_0x8f908f(++_0x2667c3);}(_0x7f81,0x6e));var _0x17f8=function(_0x580660,_0x556152){_0x580660=_0x580660-0x0;var _0x246b43=_0x7f81[_0x580660];return _0x246b43;};'use strict';var Sequelize=require(_0x17f8('0x0'));module[_0x17f8('0x1')]={'type':{'type':Sequelize[_0x17f8('0x2')](_0x17f8('0x3'),_0x17f8('0x4'),_0x17f8('0x5'),'turn')},'value':{'type':Sequelize[_0x17f8('0x6')]},'username':{'type':Sequelize[_0x17f8('0x6')]},'password':{'type':Sequelize[_0x17f8('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 5adefb0..5815ce2 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 _0x0704=['Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','STUN','toLowerCase','chan_sip.so','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','find','create','sequelize','transaction','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0704,0x1c2));var _0x4070=function(_0x1f334f,_0x109cdb){_0x1f334f=_0x1f334f-0x0;var _0x192af4=_0x0704[_0x1f334f];return _0x192af4;};'use strict';var emlformat=require(_0x4070('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4070('0x1'));var jsonpatch=require(_0x4070('0x2'));var rp=require(_0x4070('0x3'));var moment=require(_0x4070('0x4'));var BPromise=require(_0x4070('0x5'));var Mustache=require(_0x4070('0x6'));var util=require(_0x4070('0x7'));var path=require('path');var sox=require(_0x4070('0x8'));var csv=require(_0x4070('0x9'));var ejs=require(_0x4070('0xa'));var fs=require('fs');var fs_extra=require(_0x4070('0xb'));var _=require(_0x4070('0xc'));var squel=require('squel');var crypto=require(_0x4070('0xd'));var jsforce=require(_0x4070('0xe'));var deskjs=require(_0x4070('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4070('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4070('0x11'));var as=require(_0x4070('0x12'));var hardwareService=require(_0x4070('0x13'));var logger=require('../../config/logger')(_0x4070('0x14'));var utils=require(_0x4070('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4070('0x16'));var db=require(_0x4070('0x17'))['db'];var jayson=require(_0x4070('0x18'));var client=jayson['client'][_0x4070('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1b469b,_0x473a32,_0x3d5db3,_0x5561f5){return new BPromise(function(_0x3dc601,_0x3488f1){var _0x2b8cd4=_0x5561f5||client;return _0x2b8cd4[_0x4070('0x1a')](_0x1b469b,_0x3d5db3)['then'](function(_0x8fc45e){logger[_0x4070('0x1b')](_0x4070('0x1c'),_0x473a32,'request\x20sent');logger[_0x4070('0x1d')](_0x4070('0x1e'),_0x473a32,'request\x20sent',JSON[_0x4070('0x1f')](_0x8fc45e));if(_0x8fc45e[_0x4070('0x20')]){if(_0x8fc45e[_0x4070('0x20')]['code']===0x1f4){logger[_0x4070('0x20')](_0x4070('0x1c'),_0x473a32,_0x8fc45e[_0x4070('0x20')][_0x4070('0x21')]);return _0x3488f1(_0x8fc45e[_0x4070('0x20')][_0x4070('0x21')]);}logger[_0x4070('0x20')]('Network,\x20%s,\x20%s',_0x473a32,_0x8fc45e['error'][_0x4070('0x21')]);return _0x3dc601(_0x8fc45e['error'][_0x4070('0x21')]);}else{logger['info'](_0x4070('0x1c'),_0x473a32,_0x4070('0x22'));_0x3dc601(_0x8fc45e[_0x4070('0x23')][_0x4070('0x21')]);}})[_0x4070('0x24')](function(_0x48c4d3){logger[_0x4070('0x20')](_0x4070('0x1c'),_0x473a32,_0x48c4d3);_0x3488f1(_0x48c4d3);});});}function respondWithStatusCode(_0x31b4aa,_0xa2a41f){_0xa2a41f=_0xa2a41f||0xcc;return function(_0x475144){if(_0x475144){return _0x31b4aa[_0x4070('0x25')](_0xa2a41f);}return _0x31b4aa['status'](_0xa2a41f)[_0x4070('0x26')]();};}function respondWithResult(_0x3daf3a,_0xe4c862){_0xe4c862=_0xe4c862||0xc8;return function(_0x5a8469){if(_0x5a8469){return _0x3daf3a[_0x4070('0x27')](_0xe4c862)[_0x4070('0x28')](_0x5a8469);}};}function respondWithFilteredResult(_0x429d4d,_0x400e13){return function(_0x24911f){if(_0x24911f){var _0x23e9e2=typeof _0x400e13[_0x4070('0x29')]===_0x4070('0x2a')&&typeof _0x400e13[_0x4070('0x2b')]===_0x4070('0x2a');var _0x5c37a7=_0x24911f[_0x4070('0x2c')];var _0x4c2e21=_0x23e9e2?0x0:_0x400e13[_0x4070('0x29')];var _0x454a72=_0x23e9e2?_0x24911f[_0x4070('0x2c')]:_0x400e13[_0x4070('0x29')]+_0x400e13[_0x4070('0x2b')];var _0x3ddb03;if(_0x454a72>=_0x5c37a7){_0x454a72=_0x5c37a7;_0x3ddb03=0xc8;}else{_0x3ddb03=0xce;}_0x429d4d['status'](_0x3ddb03);return _0x429d4d[_0x4070('0x2d')](_0x4070('0x2e'),_0x4c2e21+'-'+_0x454a72+'/'+_0x5c37a7)['json'](_0x24911f);}return null;};}function patchUpdates(_0xdc6a6b){return function(_0x50f7f0){try{jsonpatch[_0x4070('0x2f')](_0x50f7f0,_0xdc6a6b,!![]);}catch(_0x2461c1){return BPromise[_0x4070('0x30')](_0x2461c1);}return _0x50f7f0['save']();};}function saveUpdates(_0x5d264a,_0x38d171){return function(_0x25d141){if(_0x25d141){return _0x25d141[_0x4070('0x31')](_0x5d264a)['then'](function(_0x55b141){return _0x55b141;});}return null;};}function removeEntity(_0x3fc4d9,_0x47b58d){return function(_0x284f5d){if(_0x284f5d){return _0x284f5d[_0x4070('0x32')]()[_0x4070('0x33')](function(){_0x3fc4d9[_0x4070('0x27')](0xcc)[_0x4070('0x26')]();});}};}function handleEntityNotFound(_0x441b7a,_0x125a50){return function(_0x3e28df){if(!_0x3e28df){_0x441b7a[_0x4070('0x25')](0x194);}return _0x3e28df;};}function handleError(_0x404c2a,_0x4ac37e){_0x4ac37e=_0x4ac37e||0x1f4;return function(_0xaa9194){logger[_0x4070('0x20')](_0xaa9194[_0x4070('0x34')]);if(_0xaa9194[_0x4070('0x35')]){delete _0xaa9194[_0x4070('0x35')];}_0x404c2a[_0x4070('0x27')](_0x4ac37e)[_0x4070('0x36')](_0xaa9194);};}exports[_0x4070('0x37')]=function(_0xe87ee9,_0x199b53){var _0x4e4ac0={},_0x84d73c={},_0x4b277e={'count':0x0,'rows':[]};var _0x37118a=_[_0x4070('0x38')](db[_0x4070('0x39')][_0x4070('0x3a')],function(_0x22487e){return{'name':_0x22487e[_0x4070('0x3b')],'type':_0x22487e[_0x4070('0x3c')][_0x4070('0x3d')]};});_0x84d73c[_0x4070('0x3e')]=_['map'](_0x37118a,'name');_0x84d73c[_0x4070('0x3f')]=_[_0x4070('0x40')](_0xe87ee9[_0x4070('0x3f')]);_0x84d73c[_0x4070('0x41')]=_[_0x4070('0x42')](_0x84d73c['model'],_0x84d73c[_0x4070('0x3f')]);_0x4e4ac0[_0x4070('0x43')]=_[_0x4070('0x42')](_0x84d73c['model'],qs[_0x4070('0x44')](_0xe87ee9[_0x4070('0x3f')][_0x4070('0x44')]));_0x4e4ac0[_0x4070('0x43')]=_0x4e4ac0['attributes'][_0x4070('0x45')]?_0x4e4ac0[_0x4070('0x43')]:_0x84d73c[_0x4070('0x3e')];if(!_0xe87ee9['query'][_0x4070('0x46')](_0x4070('0x47'))){_0x4e4ac0[_0x4070('0x2b')]=qs[_0x4070('0x2b')](_0xe87ee9[_0x4070('0x3f')][_0x4070('0x2b')]);_0x4e4ac0[_0x4070('0x29')]=qs['offset'](_0xe87ee9[_0x4070('0x3f')][_0x4070('0x29')]);}_0x4e4ac0[_0x4070('0x48')]=qs[_0x4070('0x49')](_0xe87ee9[_0x4070('0x3f')]['sort']);_0x4e4ac0[_0x4070('0x4a')]=qs[_0x4070('0x41')](_[_0x4070('0x4b')](_0xe87ee9[_0x4070('0x3f')],_0x84d73c['filters']),_0x37118a);if(_0xe87ee9[_0x4070('0x3f')]['filter']){_0x4e4ac0[_0x4070('0x4a')]=_[_0x4070('0x4c')](_0x4e4ac0[_0x4070('0x4a')],{'$or':_['map'](_0x37118a,function(_0x134833){if(_0x134833['type']!==_0x4070('0x4d')){var _0x58b8a8={};_0x58b8a8[_0x134833[_0x4070('0x35')]]={'$like':'%'+_0xe87ee9[_0x4070('0x3f')][_0x4070('0x4e')]+'%'};return _0x58b8a8;}})});}_0x4e4ac0=_[_0x4070('0x4c')]({},_0x4e4ac0,_0xe87ee9[_0x4070('0x4f')]);var _0x33f77a={'where':_0x4e4ac0['where']};return db[_0x4070('0x39')][_0x4070('0x2c')](_0x33f77a)['then'](function(_0x3bf52f){_0x4b277e[_0x4070('0x2c')]=_0x3bf52f;if(_0xe87ee9[_0x4070('0x3f')][_0x4070('0x50')]){_0x4e4ac0['include']=[{'all':!![]}];}return db[_0x4070('0x39')][_0x4070('0x51')](_0x4e4ac0);})['then'](function(_0x5585e2){_0x4b277e['rows']=_0x5585e2;return _0x4b277e;})['then'](respondWithFilteredResult(_0x199b53,_0x4e4ac0))['catch'](handleError(_0x199b53,null));};exports[_0x4070('0x52')]=function(_0x15e19d,_0x50d6aa){var _0x365d81={'raw':!![],'where':{'id':_0x15e19d['params']['id']}},_0x48ee87={};_0x48ee87['model']=_[_0x4070('0x40')](db[_0x4070('0x39')][_0x4070('0x3a')]);_0x48ee87['query']=_[_0x4070('0x40')](_0x15e19d[_0x4070('0x3f')]);_0x48ee87[_0x4070('0x41')]=_[_0x4070('0x42')](_0x48ee87[_0x4070('0x3e')],_0x48ee87[_0x4070('0x3f')]);_0x365d81[_0x4070('0x43')]=_['intersection'](_0x48ee87['model'],qs[_0x4070('0x44')](_0x15e19d['query'][_0x4070('0x44')]));_0x365d81[_0x4070('0x43')]=_0x365d81[_0x4070('0x43')]['length']?_0x365d81[_0x4070('0x43')]:_0x48ee87[_0x4070('0x3e')];if(_0x15e19d[_0x4070('0x3f')][_0x4070('0x50')]){_0x365d81['include']=[{'all':!![]}];}_0x365d81=_[_0x4070('0x4c')]({},_0x365d81,_0x15e19d[_0x4070('0x4f')]);return db['Network'][_0x4070('0x53')](_0x365d81)[_0x4070('0x33')](handleEntityNotFound(_0x50d6aa,null))[_0x4070('0x33')](respondWithResult(_0x50d6aa,null))[_0x4070('0x24')](handleError(_0x50d6aa,null));};exports[_0x4070('0x54')]=function(_0x429179,_0x435278,_0x55b64f){var _0x344197;return db[_0x4070('0x55')][_0x4070('0x56')](function(_0xfb95e2){return db[_0x4070('0x39')][_0x4070('0x54')](_0x429179[_0x4070('0x57')],{'raw':!![]})[_0x4070('0x33')](function(_0x584305){_0x344197=_0x584305;return db['Network'][_0x4070('0x51')]({'where':{'type':_0x429179['body'][_0x4070('0x3c')]},'raw':!![]});})[_0x4070('0x33')](function(_0xba8fde){if(_0x344197[_0x4070('0x3c')][_0x4070('0x58')]()=='STUN'){var _0x439274=fs['readFileSync'](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x5b')),'utf8');var _0x1bfe59=ejs[_0x4070('0x5c')](_0x439274,{'networks':_0xba8fde||[]});fs[_0x4070('0x5d')](_0x4070('0x5e'),_0x1bfe59);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x54'),{'module':_0x4070('0x60')});}else if(_0x344197[_0x4070('0x3c')]['toUpperCase']()==_0x4070('0x61')){var _0x79f654=fs['readFileSync'](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x62')),_0x4070('0x63'));var _0x3afd78=ejs[_0x4070('0x5c')](_0x79f654,{'networks':_0xba8fde||[]});fs['writeFileSync'](_0x4070('0x64'),_0x3afd78);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x54'),{'module':_0x4070('0x60')});}else{var _0x4ab88a=fs[_0x4070('0x65')](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x66')),_0x4070('0x63'));var _0x256d91=ejs[_0x4070('0x5c')](_0x4ab88a,{'networks':_0xba8fde||[]});fs[_0x4070('0x5d')](util[_0x4070('0x67')](_0x4070('0x68'),_0x429179['body'][_0x4070('0x3c')]['toLowerCase']()),_0x256d91);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x54'),{'module':'chan_sip.so'});}return null;})[_0x4070('0x33')](function(){return _0x344197;});})[_0x4070('0x33')](respondWithResult(_0x435278,0xc9))['catch'](handleError(_0x435278,null));};exports[_0x4070('0x31')]=function(_0x32dfda,_0x43b555,_0x4806e5){var _0x109357;return db[_0x4070('0x55')][_0x4070('0x56')](function(_0x589946){return db[_0x4070('0x39')][_0x4070('0x53')]({'where':{'id':_0x32dfda['params']['id']}})[_0x4070('0x33')](handleEntityNotFound(_0x43b555,null))['then'](saveUpdates(_0x32dfda[_0x4070('0x57')],null))['then'](function(_0x383e1c){if(_0x383e1c){_0x109357=_0x383e1c;return db[_0x4070('0x39')]['findAll']({'where':{'type':_0x109357[_0x4070('0x3c')]},'raw':!![]});}return null;})[_0x4070('0x33')](function(_0x3b7d44){if(_0x109357[_0x4070('0x3c')][_0x4070('0x58')]()==_0x4070('0x69')){var _0x31b005=fs[_0x4070('0x65')](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x5b')),'utf8');var _0x1db14c=ejs[_0x4070('0x5c')](_0x31b005,{'networks':_0x3b7d44||[]});fs['writeFileSync'](_0x4070('0x5e'),_0x1db14c);return respondWithRpcPromise('Reload',_0x4070('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x109357['type'][_0x4070('0x58')]()==_0x4070('0x61')){var _0x2c7153=fs[_0x4070('0x65')](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x62')),_0x4070('0x63'));var _0x573a91=ejs['render'](_0x2c7153,{'networks':_0x3b7d44||[]});fs[_0x4070('0x5d')](_0x4070('0x64'),_0x573a91);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x836fb5=fs[_0x4070('0x65')](path[_0x4070('0x59')](config['root'],_0x4070('0x66')),'utf8');var _0x127e53=ejs[_0x4070('0x5c')](_0x836fb5,{'networks':_0x3b7d44||[]});fs[_0x4070('0x5d')](util[_0x4070('0x67')](_0x4070('0x68'),_0x32dfda['body'][_0x4070('0x3c')][_0x4070('0x6a')]()),_0x127e53);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x31'),{'module':_0x4070('0x6b')});}return null;})[_0x4070('0x33')](function(_0xb2310d){if(_0xb2310d){return _0x109357;}return null;});})[_0x4070('0x33')](respondWithResult(_0x43b555,null))[_0x4070('0x24')](handleError(_0x43b555,null));};exports[_0x4070('0x32')]=function(_0x29c054,_0x29ecd4,_0x1cb9bb){var _0x2e8113;return db['Network'][_0x4070('0x53')]({'where':{'id':_0x29c054[_0x4070('0x6c')]['id']}})[_0x4070('0x33')](function(_0x4c654f){_0x2e8113=_0x4c654f;return _0x4c654f;})[_0x4070('0x33')](handleEntityNotFound(_0x29ecd4,null))[_0x4070('0x33')](removeEntity(_0x29ecd4,null))[_0x4070('0x33')](function(){if(_0x2e8113){return db['Network'][_0x4070('0x51')]({'where':{'type':_0x2e8113[_0x4070('0x3c')]},'raw':!![]});}})[_0x4070('0x33')](function(_0x1b073f){if(_0x2e8113[_0x4070('0x3c')][_0x4070('0x58')]()==_0x4070('0x69')){var _0x2435c1=fs[_0x4070('0x65')](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x5b')),_0x4070('0x63'));var _0x2f9166=ejs[_0x4070('0x5c')](_0x2435c1,{'networks':_0x1b073f||[]});fs[_0x4070('0x5d')](_0x4070('0x5e'),_0x2f9166);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x2e8113['type'][_0x4070('0x58')]()==_0x4070('0x61')){var _0x3bc10f=fs['readFileSync'](path[_0x4070('0x59')](config['root'],_0x4070('0x62')),_0x4070('0x63'));var _0x329993=ejs[_0x4070('0x5c')](_0x3bc10f,{'networks':_0x1b073f||[]});fs[_0x4070('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x329993);return respondWithRpcPromise('Reload',_0x4070('0x32'),{'module':_0x4070('0x60')});}else{var _0x36ed1a=fs['readFileSync'](path[_0x4070('0x59')](config[_0x4070('0x5a')],_0x4070('0x66')),_0x4070('0x63'));var _0x1f0110=ejs[_0x4070('0x5c')](_0x36ed1a,{'networks':_0x1b073f||[]});fs[_0x4070('0x5d')](util[_0x4070('0x67')](_0x4070('0x68'),_0x29c054['body']['type'][_0x4070('0x6a')]()),_0x1f0110);return respondWithRpcPromise(_0x4070('0x5f'),_0x4070('0x32'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x29ecd4,null));}; \ No newline at end of file +var _0x8751=['hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','intersection','find','create','sequelize','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','render','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','transaction','STUN','/etc/asterisk/turn_xcally.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','stack','name','send','index','map','Network','rawAttributes','key','query','filters','model','attributes','fields','length'];(function(_0x4723d1,_0x515d2e){var _0x335b7f=function(_0x559134){while(--_0x559134){_0x4723d1['push'](_0x4723d1['shift']());}};_0x335b7f(++_0x515d2e);}(_0x8751,0xf8));var _0x1875=function(_0x54755e,_0x1520f2){_0x54755e=_0x54755e-0x0;var _0x477b9a=_0x8751[_0x54755e];return _0x477b9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1875('0x0'));var zipdir=require(_0x1875('0x1'));var jsonpatch=require(_0x1875('0x2'));var rp=require(_0x1875('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1875('0x4'));var util=require('util');var path=require(_0x1875('0x5'));var sox=require('sox');var csv=require(_0x1875('0x6'));var ejs=require(_0x1875('0x7'));var fs=require('fs');var fs_extra=require(_0x1875('0x8'));var _=require(_0x1875('0x9'));var squel=require(_0x1875('0xa'));var crypto=require(_0x1875('0xb'));var jsforce=require(_0x1875('0xc'));var deskjs=require(_0x1875('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1875('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1875('0xf'));var qs=require(_0x1875('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1875('0x11'));var logger=require('../../config/logger')(_0x1875('0x12'));var utils=require(_0x1875('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x1875('0x14'));var client=jayson[_0x1875('0x15')][_0x1875('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x113c24,_0x108701,_0x10643e,_0x2f7fa3){return new BPromise(function(_0x5033a4,_0x4e9b02){var _0x275e0c=_0x2f7fa3||client;return _0x275e0c['request'](_0x113c24,_0x10643e)[_0x1875('0x17')](function(_0xf652fb){logger[_0x1875('0x18')](_0x1875('0x19'),_0x108701,_0x1875('0x1a'));logger['debug'](_0x1875('0x1b'),_0x108701,_0x1875('0x1a'),JSON[_0x1875('0x1c')](_0xf652fb));if(_0xf652fb[_0x1875('0x1d')]){if(_0xf652fb['error']['code']===0x1f4){logger[_0x1875('0x1d')](_0x1875('0x19'),_0x108701,_0xf652fb[_0x1875('0x1d')][_0x1875('0x1e')]);return _0x4e9b02(_0xf652fb[_0x1875('0x1d')][_0x1875('0x1e')]);}logger['error']('Network,\x20%s,\x20%s',_0x108701,_0xf652fb[_0x1875('0x1d')][_0x1875('0x1e')]);return _0x5033a4(_0xf652fb['error']['message']);}else{logger['info'](_0x1875('0x19'),_0x108701,_0x1875('0x1a'));_0x5033a4(_0xf652fb[_0x1875('0x1f')][_0x1875('0x1e')]);}})[_0x1875('0x20')](function(_0x3bc9c8){logger[_0x1875('0x1d')]('Network,\x20%s,\x20%s',_0x108701,_0x3bc9c8);_0x4e9b02(_0x3bc9c8);});});}function respondWithStatusCode(_0x4dfc83,_0x5db7e2){_0x5db7e2=_0x5db7e2||0xcc;return function(_0x18dc13){if(_0x18dc13){return _0x4dfc83[_0x1875('0x21')](_0x5db7e2);}return _0x4dfc83[_0x1875('0x22')](_0x5db7e2)[_0x1875('0x23')]();};}function respondWithResult(_0x151f62,_0x54cd7b){_0x54cd7b=_0x54cd7b||0xc8;return function(_0x3b306a){if(_0x3b306a){return _0x151f62[_0x1875('0x22')](_0x54cd7b)['json'](_0x3b306a);}};}function respondWithFilteredResult(_0x54c2d6,_0x3f4452){return function(_0x5ae692){if(_0x5ae692){var _0x598005=typeof _0x3f4452[_0x1875('0x24')]===_0x1875('0x25')&&typeof _0x3f4452[_0x1875('0x26')]===_0x1875('0x25');var _0x496597=_0x5ae692[_0x1875('0x27')];var _0x4ac8ae=_0x598005?0x0:_0x3f4452[_0x1875('0x24')];var _0x54d939=_0x598005?_0x5ae692[_0x1875('0x27')]:_0x3f4452['offset']+_0x3f4452[_0x1875('0x26')];var _0x3597f7;if(_0x54d939>=_0x496597){_0x54d939=_0x496597;_0x3597f7=0xc8;}else{_0x3597f7=0xce;}_0x54c2d6[_0x1875('0x22')](_0x3597f7);return _0x54c2d6[_0x1875('0x28')]('Content-Range',_0x4ac8ae+'-'+_0x54d939+'/'+_0x496597)[_0x1875('0x29')](_0x5ae692);}return null;};}function patchUpdates(_0x29e152){return function(_0x4e9d44){try{jsonpatch[_0x1875('0x2a')](_0x4e9d44,_0x29e152,!![]);}catch(_0x25aaf7){return BPromise['reject'](_0x25aaf7);}return _0x4e9d44[_0x1875('0x2b')]();};}function saveUpdates(_0x27faf2,_0x31f646){return function(_0x552197){if(_0x552197){return _0x552197['update'](_0x27faf2)[_0x1875('0x17')](function(_0x44390b){return _0x44390b;});}return null;};}function removeEntity(_0x7d6002,_0x54d4cc){return function(_0x5bee74){if(_0x5bee74){return _0x5bee74['destroy']()[_0x1875('0x17')](function(){_0x7d6002[_0x1875('0x22')](0xcc)[_0x1875('0x23')]();});}};}function handleEntityNotFound(_0x413184,_0x1f37a4){return function(_0x5cec70){if(!_0x5cec70){_0x413184[_0x1875('0x21')](0x194);}return _0x5cec70;};}function handleError(_0x1c09b7,_0x15de07){_0x15de07=_0x15de07||0x1f4;return function(_0xeb4a50){logger['error'](_0xeb4a50[_0x1875('0x2c')]);if(_0xeb4a50[_0x1875('0x2d')]){delete _0xeb4a50['name'];}_0x1c09b7[_0x1875('0x22')](_0x15de07)[_0x1875('0x2e')](_0xeb4a50);};}exports[_0x1875('0x2f')]=function(_0x321e07,_0x491557){var _0x48de39={},_0x171f31={},_0x2f30d9={'count':0x0,'rows':[]};var _0x1f092a=_[_0x1875('0x30')](db[_0x1875('0x31')][_0x1875('0x32')],function(_0x454d7b){return{'name':_0x454d7b['fieldName'],'type':_0x454d7b['type'][_0x1875('0x33')]};});_0x171f31['model']=_[_0x1875('0x30')](_0x1f092a,_0x1875('0x2d'));_0x171f31[_0x1875('0x34')]=_['keys'](_0x321e07[_0x1875('0x34')]);_0x171f31[_0x1875('0x35')]=_['intersection'](_0x171f31[_0x1875('0x36')],_0x171f31[_0x1875('0x34')]);_0x48de39[_0x1875('0x37')]=_['intersection'](_0x171f31[_0x1875('0x36')],qs['fields'](_0x321e07[_0x1875('0x34')][_0x1875('0x38')]));_0x48de39[_0x1875('0x37')]=_0x48de39[_0x1875('0x37')][_0x1875('0x39')]?_0x48de39[_0x1875('0x37')]:_0x171f31[_0x1875('0x36')];if(!_0x321e07['query'][_0x1875('0x3a')](_0x1875('0x3b'))){_0x48de39[_0x1875('0x26')]=qs[_0x1875('0x26')](_0x321e07[_0x1875('0x34')][_0x1875('0x26')]);_0x48de39['offset']=qs[_0x1875('0x24')](_0x321e07['query']['offset']);}_0x48de39[_0x1875('0x3c')]=qs['sort'](_0x321e07[_0x1875('0x34')][_0x1875('0x3d')]);_0x48de39['where']=qs[_0x1875('0x35')](_['pick'](_0x321e07['query'],_0x171f31[_0x1875('0x35')]),_0x1f092a);if(_0x321e07[_0x1875('0x34')][_0x1875('0x3e')]){_0x48de39[_0x1875('0x3f')]=_[_0x1875('0x40')](_0x48de39[_0x1875('0x3f')],{'$or':_[_0x1875('0x30')](_0x1f092a,function(_0x1c2087){if(_0x1c2087[_0x1875('0x41')]!==_0x1875('0x42')){var _0x3e66e8={};_0x3e66e8[_0x1c2087[_0x1875('0x2d')]]={'$like':'%'+_0x321e07[_0x1875('0x34')][_0x1875('0x3e')]+'%'};return _0x3e66e8;}})});}_0x48de39=_['merge']({},_0x48de39,_0x321e07[_0x1875('0x43')]);var _0x1206dc={'where':_0x48de39[_0x1875('0x3f')]};return db[_0x1875('0x31')]['count'](_0x1206dc)[_0x1875('0x17')](function(_0x526e50){_0x2f30d9[_0x1875('0x27')]=_0x526e50;if(_0x321e07[_0x1875('0x34')][_0x1875('0x44')]){_0x48de39[_0x1875('0x45')]=[{'all':!![]}];}return db['Network'][_0x1875('0x46')](_0x48de39);})[_0x1875('0x17')](function(_0x2dada9){_0x2f30d9[_0x1875('0x47')]=_0x2dada9;return _0x2f30d9;})[_0x1875('0x17')](respondWithFilteredResult(_0x491557,_0x48de39))[_0x1875('0x20')](handleError(_0x491557,null));};exports['show']=function(_0x3284e9,_0x4fed7d){var _0x299c2c={'raw':!![],'where':{'id':_0x3284e9[_0x1875('0x48')]['id']}},_0x5cede2={};_0x5cede2[_0x1875('0x36')]=_[_0x1875('0x49')](db[_0x1875('0x31')][_0x1875('0x32')]);_0x5cede2[_0x1875('0x34')]=_['keys'](_0x3284e9['query']);_0x5cede2['filters']=_[_0x1875('0x4a')](_0x5cede2['model'],_0x5cede2['query']);_0x299c2c[_0x1875('0x37')]=_[_0x1875('0x4a')](_0x5cede2[_0x1875('0x36')],qs[_0x1875('0x38')](_0x3284e9[_0x1875('0x34')][_0x1875('0x38')]));_0x299c2c['attributes']=_0x299c2c[_0x1875('0x37')][_0x1875('0x39')]?_0x299c2c[_0x1875('0x37')]:_0x5cede2['model'];if(_0x3284e9[_0x1875('0x34')]['includeAll']){_0x299c2c[_0x1875('0x45')]=[{'all':!![]}];}_0x299c2c=_[_0x1875('0x40')]({},_0x299c2c,_0x3284e9[_0x1875('0x43')]);return db[_0x1875('0x31')][_0x1875('0x4b')](_0x299c2c)[_0x1875('0x17')](handleEntityNotFound(_0x4fed7d,null))[_0x1875('0x17')](respondWithResult(_0x4fed7d,null))['catch'](handleError(_0x4fed7d,null));};exports[_0x1875('0x4c')]=function(_0x402e63,_0x4435c1,_0x5852d3){var _0x58bf94;return db[_0x1875('0x4d')]['transaction'](function(_0x21b9e7){return db[_0x1875('0x31')][_0x1875('0x4c')](_0x402e63['body'],{'raw':!![]})[_0x1875('0x17')](function(_0x34cdca){_0x58bf94=_0x34cdca;return db[_0x1875('0x31')][_0x1875('0x46')]({'where':{'type':_0x402e63[_0x1875('0x4e')][_0x1875('0x41')]},'raw':!![]});})[_0x1875('0x17')](function(_0x30754d){if(_0x58bf94[_0x1875('0x41')]['toUpperCase']()=='STUN'){var _0x1be98f=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x52')),_0x1875('0x53'));var _0x1ac80f=ejs['render'](_0x1be98f,{'networks':_0x30754d||[]});fs[_0x1875('0x54')](_0x1875('0x55'),_0x1ac80f);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x4c'),{'module':_0x1875('0x57')});}else if(_0x58bf94[_0x1875('0x41')][_0x1875('0x58')]()==_0x1875('0x59')){var _0x436e1a=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x5a')),_0x1875('0x53'));var _0xe13358=ejs[_0x1875('0x5b')](_0x436e1a,{'networks':_0x30754d||[]});fs[_0x1875('0x54')]('/etc/asterisk/turn_xcally.conf',_0xe13358);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x4c'),{'module':_0x1875('0x57')});}else{var _0x1ede90=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x5c')),'utf8');var _0x1979d2=ejs['render'](_0x1ede90,{'networks':_0x30754d||[]});fs[_0x1875('0x54')](util[_0x1875('0x5d')](_0x1875('0x5e'),_0x402e63[_0x1875('0x4e')][_0x1875('0x41')][_0x1875('0x5f')]()),_0x1979d2);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x4c'),{'module':_0x1875('0x60')});}return null;})[_0x1875('0x17')](function(){return _0x58bf94;});})[_0x1875('0x17')](respondWithResult(_0x4435c1,0xc9))['catch'](handleError(_0x4435c1,null));};exports[_0x1875('0x61')]=function(_0x5cfab1,_0x4adfa3,_0x11c0a8){var _0x1e8c19;return db[_0x1875('0x4d')][_0x1875('0x62')](function(_0x58c8c7){return db['Network']['find']({'where':{'id':_0x5cfab1[_0x1875('0x48')]['id']}})[_0x1875('0x17')](handleEntityNotFound(_0x4adfa3,null))[_0x1875('0x17')](saveUpdates(_0x5cfab1[_0x1875('0x4e')],null))[_0x1875('0x17')](function(_0xb5ee5b){if(_0xb5ee5b){_0x1e8c19=_0xb5ee5b;return db[_0x1875('0x31')]['findAll']({'where':{'type':_0x1e8c19['type']},'raw':!![]});}return null;})[_0x1875('0x17')](function(_0x4ab7ac){if(_0x1e8c19[_0x1875('0x41')][_0x1875('0x58')]()==_0x1875('0x63')){var _0x952410=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x52')),_0x1875('0x53'));var _0x4e4c8a=ejs[_0x1875('0x5b')](_0x952410,{'networks':_0x4ab7ac||[]});fs[_0x1875('0x54')]('/etc/asterisk/stun_xcally.conf',_0x4e4c8a);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x61'),{'module':_0x1875('0x57')});}else if(_0x1e8c19[_0x1875('0x41')][_0x1875('0x58')]()==_0x1875('0x59')){var _0x542fc0=fs['readFileSync'](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x5a')),_0x1875('0x53'));var _0x43f213=ejs[_0x1875('0x5b')](_0x542fc0,{'networks':_0x4ab7ac||[]});fs[_0x1875('0x54')](_0x1875('0x64'),_0x43f213);return respondWithRpcPromise('Reload',_0x1875('0x61'),{'module':'res_stun_monitor.so'});}else{var _0x3a2c54=fs['readFileSync'](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x5c')),_0x1875('0x53'));var _0x119720=ejs['render'](_0x3a2c54,{'networks':_0x4ab7ac||[]});fs['writeFileSync'](util[_0x1875('0x5d')](_0x1875('0x5e'),_0x5cfab1[_0x1875('0x4e')][_0x1875('0x41')][_0x1875('0x5f')]()),_0x119720);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x61'),{'module':_0x1875('0x60')});}return null;})[_0x1875('0x17')](function(_0x9c11bf){if(_0x9c11bf){return _0x1e8c19;}return null;});})[_0x1875('0x17')](respondWithResult(_0x4adfa3,null))['catch'](handleError(_0x4adfa3,null));};exports[_0x1875('0x65')]=function(_0x562279,_0x5ff996,_0x329f06){var _0x280a4b;return db[_0x1875('0x31')][_0x1875('0x4b')]({'where':{'id':_0x562279['params']['id']}})['then'](function(_0x18fbef){_0x280a4b=_0x18fbef;return _0x18fbef;})['then'](handleEntityNotFound(_0x5ff996,null))['then'](removeEntity(_0x5ff996,null))['then'](function(){if(_0x280a4b){return db['Network'][_0x1875('0x46')]({'where':{'type':_0x280a4b[_0x1875('0x41')]},'raw':!![]});}})['then'](function(_0x51d5fd){if(_0x280a4b[_0x1875('0x41')][_0x1875('0x58')]()==_0x1875('0x63')){var _0x35b9ad=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],_0x1875('0x52')),_0x1875('0x53'));var _0x123a33=ejs[_0x1875('0x5b')](_0x35b9ad,{'networks':_0x51d5fd||[]});fs[_0x1875('0x54')](_0x1875('0x55'),_0x123a33);return respondWithRpcPromise(_0x1875('0x56'),_0x1875('0x65'),{'module':_0x1875('0x57')});}else if(_0x280a4b['type'][_0x1875('0x58')]()=='TURN'){var _0x50e674=fs['readFileSync'](path[_0x1875('0x50')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x1875('0x53'));var _0x185ec2=ejs[_0x1875('0x5b')](_0x50e674,{'networks':_0x51d5fd||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x185ec2);return respondWithRpcPromise(_0x1875('0x56'),'destroy',{'module':_0x1875('0x57')});}else{var _0x368e59=fs[_0x1875('0x4f')](path[_0x1875('0x50')](config[_0x1875('0x51')],'server/files/templates/network.ejs'),_0x1875('0x53'));var _0x246f17=ejs[_0x1875('0x5b')](_0x368e59,{'networks':_0x51d5fd||[]});fs[_0x1875('0x54')](util[_0x1875('0x5d')](_0x1875('0x5e'),_0x562279[_0x1875('0x4e')][_0x1875('0x41')][_0x1875('0x5f')]()),_0x246f17);return respondWithRpcPromise(_0x1875('0x56'),'destroy',{'module':_0x1875('0x60')});}return null;})['catch'](handleError(_0x5ff996,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1a06e89..eb5e667 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 _0x5ec6=['network','lodash','util','../../config/logger','moment','request-promise','rimraf','./network.attributes','Network'];(function(_0x53cc66,_0x5162fc){var _0x6effae=function(_0x2ddb4f){while(--_0x2ddb4f){_0x53cc66['push'](_0x53cc66['shift']());}};_0x6effae(++_0x5162fc);}(_0x5ec6,0x7f));var _0x65ec=function(_0x37ebe7,_0x16012a){_0x37ebe7=_0x37ebe7-0x0;var _0xe6440c=_0x5ec6[_0x37ebe7];return _0xe6440c;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var logger=require(_0x65ec('0x2'))('api');var moment=require(_0x65ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x65ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x65ec('0x6'));module['exports']=function(_0x2fc973,_0xbb2e56){return _0x2fc973['define'](_0x65ec('0x7'),attributes,{'tableName':_0x65ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f3=['api','moment','bluebird','rimraf','../../config/environment','./network.attributes','Network','network','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f3,0x120));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var logger=require(_0x354f('0x1'))(_0x354f('0x2'));var moment=require(_0x354f('0x3'));var BPromise=require(_0x354f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var attributes=require(_0x354f('0x7'));module['exports']=function(_0x5618ac,_0x234ac6){return _0x5618ac['define'](_0x354f('0x8'),attributes,{'tableName':_0x354f('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 2958c2d..c856e06 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x199137,_0x5c633d){var _0x67aa5c=function(_0x185da1){while(--_0x185da1){_0x199137['push'](_0x199137['shift']());}};_0x67aa5c(++_0x5c633d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x213543,_0x4b91e3){var _0x238b2e=function(_0xc42d7){while(--_0xc42d7){_0x213543['push'](_0x213543['shift']());}};_0x238b2e(++_0x4b91e3);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f35b384..c3ccf5f 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 _0x63c6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','/:id','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path'];(function(_0x16e9c4,_0xa57ff){var _0x16b03c=function(_0xda27f0){while(--_0xda27f0){_0x16e9c4['push'](_0x16e9c4['shift']());}};_0x16b03c(++_0xa57ff);}(_0x63c6,0x15c));var _0x663c=function(_0x2dd33d,_0x1cb233){_0x2dd33d=_0x2dd33d-0x0;var _0x25358e=_0x63c6[_0x2dd33d];return _0x25358e;};'use strict';var multer=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var path=require(_0x663c('0x2'));var timeout=require(_0x663c('0x3'));var express=require(_0x663c('0x4'));var router=express[_0x663c('0x5')]();var fs_extra=require(_0x663c('0x6'));var auth=require(_0x663c('0x7'));var interaction=require(_0x663c('0x8'));var config=require(_0x663c('0x9'));var controller=require(_0x663c('0xa'));router[_0x663c('0xb')]('/',auth[_0x663c('0xc')](),controller[_0x663c('0xd')]);router[_0x663c('0xb')](_0x663c('0xe'),auth[_0x663c('0xc')](),controller['describe']);router[_0x663c('0xb')]('/:id',auth[_0x663c('0xc')](),controller['show']);router['get'](_0x663c('0xf'),auth[_0x663c('0xc')](),controller[_0x663c('0x10')]);router['get'](_0x663c('0x11'),auth['isAuthenticated'](),controller[_0x663c('0x12')]);router[_0x663c('0xb')](_0x663c('0x13'),auth[_0x663c('0xc')](),controller[_0x663c('0x14')]);router[_0x663c('0xb')]('/:id/interactions',auth[_0x663c('0xc')](),controller[_0x663c('0x15')]);router[_0x663c('0xb')]('/:id/users',auth[_0x663c('0xc')](),controller[_0x663c('0x16')]);router['post']('/',auth[_0x663c('0xc')](),controller['create']);router[_0x663c('0x17')](_0x663c('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x663c('0x17')](_0x663c('0x11'),auth[_0x663c('0xc')](),controller[_0x663c('0x18')]);router[_0x663c('0x17')](_0x663c('0x19'),controller[_0x663c('0x1a')]);router[_0x663c('0x17')]('/:id/applications',auth[_0x663c('0xc')](),controller[_0x663c('0x1b')]);router[_0x663c('0x17')](_0x663c('0x1c'),auth[_0x663c('0xc')](),controller[_0x663c('0x1d')]);router['post'](_0x663c('0x1e'),auth[_0x663c('0xc')](),controller[_0x663c('0x1f')]);router[_0x663c('0x20')](_0x663c('0x21'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x663c('0x21'),auth[_0x663c('0xc')](),controller[_0x663c('0x22')]);router[_0x663c('0x23')](_0x663c('0xf'),auth[_0x663c('0xc')](),controller[_0x663c('0x24')]);router[_0x663c('0x23')](_0x663c('0x11'),auth['isAuthenticated'](),controller[_0x663c('0x25')]);router['delete'](_0x663c('0x1c'),auth[_0x663c('0xc')](),controller['removeAgents']);module[_0x663c('0x26')]=router; \ No newline at end of file +var _0x3515=['../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3515,0x13f));var _0x5351=function(_0x403c91,_0x4a9750){_0x403c91=_0x403c91-0x0;var _0x1e637a=_0x3515[_0x403c91];return _0x1e637a;};'use strict';var multer=require(_0x5351('0x0'));var util=require(_0x5351('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5351('0x2'));var router=express[_0x5351('0x3')]();var fs_extra=require(_0x5351('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5351('0x5'));var config=require('../../config/environment');var controller=require(_0x5351('0x6'));router['get']('/',auth[_0x5351('0x7')](),controller[_0x5351('0x8')]);router[_0x5351('0x9')]('/describe',auth[_0x5351('0x7')](),controller[_0x5351('0xa')]);router[_0x5351('0x9')](_0x5351('0xb'),auth[_0x5351('0x7')](),controller[_0x5351('0xc')]);router[_0x5351('0x9')](_0x5351('0xd'),auth[_0x5351('0x7')](),controller['getDispositions']);router[_0x5351('0x9')](_0x5351('0xe'),auth[_0x5351('0x7')](),controller['getAnswers']);router[_0x5351('0x9')](_0x5351('0xf'),auth[_0x5351('0x7')](),controller['getApplications']);router['get'](_0x5351('0x10'),auth[_0x5351('0x7')](),controller[_0x5351('0x11')]);router[_0x5351('0x9')](_0x5351('0x12'),auth[_0x5351('0x7')](),controller['getAgents']);router[_0x5351('0x13')]('/',auth[_0x5351('0x7')](),controller['create']);router[_0x5351('0x13')](_0x5351('0xd'),auth[_0x5351('0x7')](),controller[_0x5351('0x14')]);router['post'](_0x5351('0xe'),auth[_0x5351('0x7')](),controller[_0x5351('0x15')]);router['post'](_0x5351('0x16'),controller[_0x5351('0x17')]);router[_0x5351('0x13')](_0x5351('0xf'),auth['isAuthenticated'](),controller[_0x5351('0x18')]);router[_0x5351('0x13')](_0x5351('0x12'),auth[_0x5351('0x7')](),controller[_0x5351('0x19')]);router[_0x5351('0x13')](_0x5351('0x1a'),auth[_0x5351('0x7')](),controller[_0x5351('0x1b')]);router[_0x5351('0x1c')]('/:id',auth[_0x5351('0x7')](),controller[_0x5351('0x1d')]);router[_0x5351('0x1e')]('/:id',auth[_0x5351('0x7')](),controller[_0x5351('0x1f')]);router[_0x5351('0x1e')](_0x5351('0xd'),auth['isAuthenticated'](),controller[_0x5351('0x20')]);router[_0x5351('0x1e')](_0x5351('0xe'),auth[_0x5351('0x7')](),controller[_0x5351('0x21')]);router['delete'](_0x5351('0x12'),auth[_0x5351('0x7')](),controller[_0x5351('0x22')]);module[_0x5351('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 167a598..ac48325 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 _0x1130=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3995ec,_0x55f64b){var _0x123bd0=function(_0x2a9815){while(--_0x2a9815){_0x3995ec['push'](_0x3995ec['shift']());}};_0x123bd0(++_0x55f64b);}(_0x1130,0xf3));var _0x0113=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x1130[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0113('0x0'));module[_0x0113('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0113('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x0113('0x3')]},'token':{'type':Sequelize[_0x0113('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0113('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0113('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0113('0x4')],'defaultValue':function(){return _0x0113('0x5');}},'notificationSound':{'type':Sequelize[_0x0113('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0113('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0113('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0113('0x3')]},'queueTransfer':{'type':Sequelize[_0x0113('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0113('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0113('0x7')],'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[_0x0113('0x6')],'defaultValue':![],'comment':_0x0113('0x8'),'set':function(_0xc5977a){if(!_0xc5977a)this[_0x0113('0x9')](_0x0113('0xa'),null);this[_0x0113('0x9')](_0x0113('0xb'),_0xc5977a);}}}; \ No newline at end of file +var _0x644e=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x644e,0x197));var _0xe644=function(_0x17defc,_0x4abf6c){_0x17defc=_0x17defc-0x0;var _0x3cd67b=_0x644e[_0x17defc];return _0x3cd67b;};'use strict';var Sequelize=require(_0xe644('0x0'));var rs=require(_0xe644('0x1'));module[_0xe644('0x2')]={'name':{'type':Sequelize[_0xe644('0x3')],'unique':_0xe644('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xe644('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe644('0x5')]();}},'replyUri':{'type':Sequelize[_0xe644('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe644('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe644('0x6')],'defaultValue':function(){return _0xe644('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe644('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xe644('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe644('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe644('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe644('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x202fe6){if(!_0x202fe6)this['setDataValue'](_0xe644('0xb'),null);this[_0xe644('0xc')](_0xe644('0xd'),_0x202fe6);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b6df5ce..fee8822 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 _0xc6a4=['pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','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','addDisposition','OpenchannelAccountId','Disposition','getDispositions','CannedAnswer','getAnswers','order','removeAnswers','ids','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','OpenchannelApplication','Applications','List','account','list','applications','orderBy','priority','asc','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','apply','save','update','get','OpenchannelAccounts','destroy','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x36c10d,_0x5be52f){var _0x2bef3b=function(_0x17d57f){while(--_0x17d57f){_0x36c10d['push'](_0x36c10d['shift']());}};_0x2bef3b(++_0x5be52f);}(_0xc6a4,0x131));var _0x4c6a=function(_0x4956e4,_0x9b3ee1){_0x4956e4=_0x4956e4-0x0;var _0x1e2fe7=_0xc6a4[_0x4956e4];return _0x1e2fe7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c6a('0x0'));var zipdir=require(_0x4c6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c6a('0x2'));var moment=require(_0x4c6a('0x3'));var BPromise=require(_0x4c6a('0x4'));var Mustache=require(_0x4c6a('0x5'));var util=require(_0x4c6a('0x6'));var path=require(_0x4c6a('0x7'));var sox=require(_0x4c6a('0x8'));var csv=require(_0x4c6a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c6a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4c6a('0xb'));var deskjs=require(_0x4c6a('0xc'));var toCsv=require(_0x4c6a('0x9'));var querystring=require(_0x4c6a('0xd'));var Papa=require(_0x4c6a('0xe'));var Redis=require(_0x4c6a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c6a('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4c6a('0x11'));var config=require(_0x4c6a('0x12'));var licenseUtil=require(_0x4c6a('0x13'));var db=require(_0x4c6a('0x14'))['db'];config[_0x4c6a('0x15')]=_[_0x4c6a('0x16')](config['redis'],{'host':_0x4c6a('0x17'),'port':0x18eb});var socket=require(_0x4c6a('0x18'))(new Redis(config[_0x4c6a('0x15')]));require('./openchannelAccount.socket')[_0x4c6a('0x19')](socket);var jayson=require(_0x4c6a('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4c6a('0x1b')][_0x4c6a('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1d9135,_0x39c942,_0x1d99c7,_0x56d474){return new BPromise(function(_0x189759,_0x26a504){var _0x1c6991=_0x56d474||client;return _0x1c6991[_0x4c6a('0x1d')](_0x1d9135,_0x1d99c7)[_0x4c6a('0x1e')](function(_0x1bf870){logger[_0x4c6a('0x1f')](_0x4c6a('0x20'),_0x39c942,_0x4c6a('0x21'));logger[_0x4c6a('0x22')](_0x4c6a('0x23'),_0x39c942,_0x4c6a('0x21'),JSON[_0x4c6a('0x24')](_0x1bf870));if(_0x1bf870['error']){if(_0x1bf870[_0x4c6a('0x25')][_0x4c6a('0x26')]===0x1f4){logger[_0x4c6a('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x39c942,_0x1bf870['error'][_0x4c6a('0x27')]);return _0x26a504(_0x1bf870['error'][_0x4c6a('0x27')]);}logger[_0x4c6a('0x25')](_0x4c6a('0x20'),_0x39c942,_0x1bf870[_0x4c6a('0x25')][_0x4c6a('0x27')]);return _0x189759(_0x1bf870[_0x4c6a('0x25')][_0x4c6a('0x27')]);}else{logger[_0x4c6a('0x1f')](_0x4c6a('0x20'),_0x39c942,_0x4c6a('0x21'));_0x189759(_0x1bf870[_0x4c6a('0x28')]['message']);}})[_0x4c6a('0x29')](function(_0x29bf94){logger[_0x4c6a('0x25')](_0x4c6a('0x20'),_0x39c942,_0x29bf94);_0x26a504(_0x29bf94);});});}function respondWithStatusCode(_0x5a2826,_0x5f1bb2){_0x5f1bb2=_0x5f1bb2||0xcc;return function(_0x2f2a63){if(_0x2f2a63){return _0x5a2826['sendStatus'](_0x5f1bb2);}return _0x5a2826[_0x4c6a('0x2a')](_0x5f1bb2)[_0x4c6a('0x2b')]();};}function respondWithResult(_0x32f7b7,_0x59f769){_0x59f769=_0x59f769||0xc8;return function(_0xc7d5d3){if(_0xc7d5d3){return _0x32f7b7[_0x4c6a('0x2a')](_0x59f769)[_0x4c6a('0x2c')](_0xc7d5d3);}};}function respondWithFilteredResult(_0x481584,_0x3a2a4e){return function(_0x2e2b09){if(_0x2e2b09){var _0x4949a4=typeof _0x3a2a4e[_0x4c6a('0x2d')]==='undefined'&&typeof _0x3a2a4e[_0x4c6a('0x2e')]===_0x4c6a('0x2f');var _0x31779b=_0x2e2b09[_0x4c6a('0x30')];var _0x1f3074=_0x4949a4?0x0:_0x3a2a4e[_0x4c6a('0x2d')];var _0x7c4107=_0x4949a4?_0x2e2b09[_0x4c6a('0x30')]:_0x3a2a4e['offset']+_0x3a2a4e['limit'];var _0x5688b8;if(_0x7c4107>=_0x31779b){_0x7c4107=_0x31779b;_0x5688b8=0xc8;}else{_0x5688b8=0xce;}_0x481584[_0x4c6a('0x2a')](_0x5688b8);return _0x481584[_0x4c6a('0x31')]('Content-Range',_0x1f3074+'-'+_0x7c4107+'/'+_0x31779b)['json'](_0x2e2b09);}return null;};}function patchUpdates(_0x5ebbc9){return function(_0x6a411b){try{jsonpatch[_0x4c6a('0x32')](_0x6a411b,_0x5ebbc9,!![]);}catch(_0x22a393){return BPromise['reject'](_0x22a393);}return _0x6a411b[_0x4c6a('0x33')]();};}function saveUpdates(_0x50ec82,_0x29f8dd){return function(_0x1d1dc0){if(_0x1d1dc0){return _0x1d1dc0[_0x4c6a('0x34')](_0x50ec82)['then'](function(_0x263e18){return _0x263e18;});}return null;};}function removeEntity(_0x26a609,_0x2b1b80){return function(_0x133df9){if(_0x133df9){return _0x133df9['destroy']()[_0x4c6a('0x1e')](function(){var _0x26039a=_0x133df9[_0x4c6a('0x35')]({'plain':!![]});var _0x4ebd85=_0x4c6a('0x36');return db['UserProfileResource'][_0x4c6a('0x37')]({'where':{'type':_0x4ebd85,'resourceId':_0x26039a['id']}})[_0x4c6a('0x1e')](function(){return _0x133df9;});})['then'](function(){_0x26a609[_0x4c6a('0x2a')](0xcc)[_0x4c6a('0x2b')]();});}};}function handleEntityNotFound(_0x38de09,_0x31d55c){return function(_0x1f4ba5){if(!_0x1f4ba5){_0x38de09[_0x4c6a('0x38')](0x194);}return _0x1f4ba5;};}function handleError(_0x18c541,_0x13cd30){_0x13cd30=_0x13cd30||0x1f4;return function(_0x3ff738){logger[_0x4c6a('0x25')](_0x3ff738[_0x4c6a('0x39')]);if(_0x3ff738[_0x4c6a('0x3a')]){delete _0x3ff738[_0x4c6a('0x3a')];}_0x18c541[_0x4c6a('0x2a')](_0x13cd30)['send'](_0x3ff738);};}exports[_0x4c6a('0x3b')]=function(_0x5a18ab,_0x5e25df){var _0x470dda={'include':[{'model':db[_0x4c6a('0x3c')],'as':_0x4c6a('0x3d')}]},_0x544f1a={},_0x189797={'count':0x0,'rows':[]};var _0x538ffe=_[_0x4c6a('0x3e')](db[_0x4c6a('0x3f')]['rawAttributes'],function(_0x18e5fa){return{'name':_0x18e5fa[_0x4c6a('0x40')],'type':_0x18e5fa[_0x4c6a('0x41')][_0x4c6a('0x42')]};});_0x544f1a[_0x4c6a('0x43')]=_[_0x4c6a('0x3e')](_0x538ffe,'name');_0x544f1a[_0x4c6a('0x44')]=_[_0x4c6a('0x45')](_0x5a18ab[_0x4c6a('0x44')]);_0x544f1a[_0x4c6a('0x46')]=_['intersection'](_0x544f1a[_0x4c6a('0x43')],_0x544f1a[_0x4c6a('0x44')]);_0x470dda[_0x4c6a('0x47')]=_[_0x4c6a('0x48')](_0x544f1a[_0x4c6a('0x43')],qs[_0x4c6a('0x49')](_0x5a18ab['query'][_0x4c6a('0x49')]));_0x470dda['attributes']=_0x470dda[_0x4c6a('0x47')][_0x4c6a('0x4a')]?_0x470dda['attributes']:_0x544f1a[_0x4c6a('0x43')];if(!_0x5a18ab[_0x4c6a('0x44')][_0x4c6a('0x4b')](_0x4c6a('0x4c'))){_0x470dda['limit']=qs['limit'](_0x5a18ab[_0x4c6a('0x44')]['limit']);_0x470dda[_0x4c6a('0x2d')]=qs['offset'](_0x5a18ab[_0x4c6a('0x44')][_0x4c6a('0x2d')]);}_0x470dda['order']=qs[_0x4c6a('0x4d')](_0x5a18ab['query']['sort']);_0x470dda[_0x4c6a('0x4e')]=qs[_0x4c6a('0x46')](_[_0x4c6a('0x4f')](_0x5a18ab[_0x4c6a('0x44')],_0x544f1a[_0x4c6a('0x46')]),_0x538ffe);if(_0x5a18ab[_0x4c6a('0x44')][_0x4c6a('0x50')]){_0x470dda[_0x4c6a('0x4e')]=_['merge'](_0x470dda[_0x4c6a('0x4e')],{'$or':_[_0x4c6a('0x3e')](_0x538ffe,function(_0x3d8295){if(_0x3d8295['type']!==_0x4c6a('0x51')){var _0x2d7753={};_0x2d7753[_0x3d8295[_0x4c6a('0x3a')]]={'$like':'%'+_0x5a18ab[_0x4c6a('0x44')][_0x4c6a('0x50')]+'%'};return _0x2d7753;}})});}_0x470dda=_[_0x4c6a('0x52')]({},_0x470dda,_0x5a18ab[_0x4c6a('0x53')]);var _0x5d7aea={'where':_0x470dda[_0x4c6a('0x4e')]};return db[_0x4c6a('0x3f')][_0x4c6a('0x30')](_0x5d7aea)[_0x4c6a('0x1e')](function(_0x4dfb5d){_0x189797['count']=_0x4dfb5d;if(_0x5a18ab['query'][_0x4c6a('0x54')]){_0x470dda[_0x4c6a('0x55')]=[{'all':!![]}];}return db[_0x4c6a('0x3f')][_0x4c6a('0x56')](_0x470dda);})[_0x4c6a('0x1e')](function(_0x121c47){_0x189797[_0x4c6a('0x57')]=_0x121c47;return _0x189797;})[_0x4c6a('0x1e')](respondWithFilteredResult(_0x5e25df,_0x470dda))[_0x4c6a('0x29')](handleError(_0x5e25df,null));};exports[_0x4c6a('0x58')]=function(_0xa1ea79,_0x41c560){var _0x28301e={'raw':![],'where':{'id':_0xa1ea79[_0x4c6a('0x59')]['id']},'include':[{'model':db[_0x4c6a('0x3c')],'as':_0x4c6a('0x3d')}]},_0x452593={};_0x452593['model']=_[_0x4c6a('0x45')](db[_0x4c6a('0x3f')][_0x4c6a('0x5a')]);_0x452593[_0x4c6a('0x44')]=_['keys'](_0xa1ea79[_0x4c6a('0x44')]);_0x452593[_0x4c6a('0x46')]=_[_0x4c6a('0x48')](_0x452593['model'],_0x452593['query']);_0x28301e['attributes']=_[_0x4c6a('0x48')](_0x452593[_0x4c6a('0x43')],qs[_0x4c6a('0x49')](_0xa1ea79[_0x4c6a('0x44')][_0x4c6a('0x49')]));_0x28301e['attributes']=_0x28301e[_0x4c6a('0x47')][_0x4c6a('0x4a')]?_0x28301e[_0x4c6a('0x47')]:_0x452593[_0x4c6a('0x43')];if(_0xa1ea79[_0x4c6a('0x44')][_0x4c6a('0x54')]){_0x28301e[_0x4c6a('0x55')]=[{'all':!![]}];}_0x28301e=_[_0x4c6a('0x52')]({},_0x28301e,_0xa1ea79['options']);return db[_0x4c6a('0x3f')][_0x4c6a('0x5b')](_0x28301e)[_0x4c6a('0x1e')](handleEntityNotFound(_0x41c560,null))[_0x4c6a('0x1e')](respondWithResult(_0x41c560,null))[_0x4c6a('0x29')](handleError(_0x41c560,null));};exports[_0x4c6a('0x5c')]=function(_0x3a6b37,_0x2bfb0a){return db[_0x4c6a('0x3f')]['create'](_0x3a6b37[_0x4c6a('0x5d')],{})[_0x4c6a('0x1e')](function(_0x51814f){var _0x4800d5=_0x3a6b37[_0x4c6a('0x5e')][_0x4c6a('0x35')]({'plain':!![]});if(!_0x4800d5)throw new Error(_0x4c6a('0x5f'));if(_0x4800d5[_0x4c6a('0x60')]===_0x4c6a('0x5e')){var _0x2aa428=_0x51814f[_0x4c6a('0x35')]({'plain':!![]});var _0x4afeb5=_0x4c6a('0x36');return db[_0x4c6a('0x61')][_0x4c6a('0x5b')]({'where':{'name':_0x4afeb5,'userProfileId':_0x4800d5[_0x4c6a('0x62')]},'raw':!![]})[_0x4c6a('0x1e')](function(_0x1c7782){if(_0x1c7782&&_0x1c7782['autoAssociation']===0x0){return db['UserProfileResource'][_0x4c6a('0x5c')]({'name':_0x2aa428['name'],'resourceId':_0x2aa428['id'],'type':_0x1c7782[_0x4c6a('0x3a')],'sectionId':_0x1c7782['id']},{})[_0x4c6a('0x1e')](function(){return _0x51814f;});}else{return _0x51814f;}})['catch'](function(_0x463610){logger[_0x4c6a('0x25')](_0x4c6a('0x63'),_0x463610);throw _0x463610;});}return _0x51814f;})[_0x4c6a('0x1e')](respondWithResult(_0x2bfb0a,0xc9))[_0x4c6a('0x29')](handleError(_0x2bfb0a,null));};exports[_0x4c6a('0x34')]=function(_0x4e1049,_0x4b013d){if(_0x4e1049[_0x4c6a('0x5d')]['id']){delete _0x4e1049[_0x4c6a('0x5d')]['id'];}return db[_0x4c6a('0x3f')]['find']({'where':{'id':_0x4e1049[_0x4c6a('0x59')]['id']},'include':[{'model':db[_0x4c6a('0x3c')],'as':_0x4c6a('0x3d')}]})[_0x4c6a('0x1e')](handleEntityNotFound(_0x4b013d,null))[_0x4c6a('0x1e')](saveUpdates(_0x4e1049[_0x4c6a('0x5d')],null))[_0x4c6a('0x1e')](respondWithResult(_0x4b013d,null))['catch'](handleError(_0x4b013d,null));};exports['destroy']=function(_0x5f0aa7,_0x2ba6de){return db[_0x4c6a('0x3f')][_0x4c6a('0x5b')]({'where':{'id':_0x5f0aa7['params']['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x2ba6de,null))[_0x4c6a('0x1e')](removeEntity(_0x2ba6de,null))[_0x4c6a('0x29')](handleError(_0x2ba6de,null));};exports['describe']=function(_0x335260,_0x44602e){return db[_0x4c6a('0x3f')][_0x4c6a('0x64')]()[_0x4c6a('0x1e')](respondWithResult(_0x44602e,null))[_0x4c6a('0x29')](handleError(_0x44602e,null));};exports[_0x4c6a('0x65')]=function(_0x2ecb25,_0x455539,_0x133517){if(_0x2ecb25[_0x4c6a('0x5d')]['id']){delete _0x2ecb25[_0x4c6a('0x5d')]['id'];}return db[_0x4c6a('0x3f')][_0x4c6a('0x5b')]({'where':{'id':_0x2ecb25['params']['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x455539,null))[_0x4c6a('0x1e')](function(_0x17c75b){if(_0x17c75b){_0x2ecb25[_0x4c6a('0x5d')][_0x4c6a('0x66')]=_0x17c75b['id'];return db[_0x4c6a('0x67')][_0x4c6a('0x5c')](_0x2ecb25[_0x4c6a('0x5d')]);}})[_0x4c6a('0x1e')](respondWithResult(_0x455539,null))[_0x4c6a('0x29')](handleError(_0x455539,null));};exports[_0x4c6a('0x68')]=function(_0x57cf58,_0x1b7467,_0x3a55b3){var _0x51941f={'raw':![],'where':{}};var _0x49d905={};var _0x123d53={'count':0x0,'rows':[]};return db[_0x4c6a('0x3f')]['findOne']({'where':{'id':_0x57cf58[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x1b7467,null))[_0x4c6a('0x1e')](function(_0x4b55d5){if(_0x4b55d5){_0x49d905[_0x4c6a('0x43')]=_[_0x4c6a('0x45')](db['Disposition'][_0x4c6a('0x5a')]);_0x49d905[_0x4c6a('0x44')]=_[_0x4c6a('0x45')](_0x57cf58[_0x4c6a('0x44')]);_0x49d905[_0x4c6a('0x46')]=_['intersection'](_0x49d905[_0x4c6a('0x43')],_0x49d905[_0x4c6a('0x44')]);_0x51941f[_0x4c6a('0x47')]=_['intersection'](_0x49d905['model'],qs[_0x4c6a('0x49')](_0x57cf58[_0x4c6a('0x44')][_0x4c6a('0x49')]));_0x51941f[_0x4c6a('0x47')]=_0x51941f[_0x4c6a('0x47')]['length']?_0x51941f[_0x4c6a('0x47')]:_0x49d905[_0x4c6a('0x43')];if(!_0x57cf58[_0x4c6a('0x44')][_0x4c6a('0x4b')]('nolimit')){_0x51941f[_0x4c6a('0x2e')]=qs[_0x4c6a('0x2e')](_0x57cf58['query'][_0x4c6a('0x2e')]);_0x51941f[_0x4c6a('0x2d')]=qs[_0x4c6a('0x2d')](_0x57cf58['query']['offset']);}_0x51941f['order']=qs['sort'](_0x57cf58[_0x4c6a('0x44')][_0x4c6a('0x4d')]);_0x51941f[_0x4c6a('0x4e')]=qs['filters'](_['pick'](_0x57cf58[_0x4c6a('0x44')],_0x49d905['filters']));_0x51941f['where'][_0x4c6a('0x66')]=_0x4b55d5['id'];if(_0x57cf58['query']['filter']){_0x51941f['where']=_['merge'](_0x51941f[_0x4c6a('0x4e')],{'$or':_[_0x4c6a('0x3e')](_0x51941f[_0x4c6a('0x47')],function(_0x6f9e95){var _0x103bdc={};_0x103bdc[_0x6f9e95]={'$like':'%'+_0x57cf58['query'][_0x4c6a('0x50')]+'%'};return _0x103bdc;})});}_0x51941f=_[_0x4c6a('0x52')]({},_0x51941f,_0x57cf58[_0x4c6a('0x53')]);return db[_0x4c6a('0x67')][_0x4c6a('0x30')]({'where':_0x51941f['where']})[_0x4c6a('0x1e')](function(_0x394eb9){_0x123d53[_0x4c6a('0x30')]=_0x394eb9;if(_0x57cf58[_0x4c6a('0x44')][_0x4c6a('0x54')]){_0x51941f[_0x4c6a('0x55')]=[{'all':!![]}];}return db[_0x4c6a('0x67')][_0x4c6a('0x56')](_0x51941f);})[_0x4c6a('0x1e')](function(_0x4f46c1){_0x123d53[_0x4c6a('0x57')]=_0x4f46c1;return _0x123d53;});}})[_0x4c6a('0x1e')](respondWithFilteredResult(_0x1b7467,_0x51941f))[_0x4c6a('0x29')](handleError(_0x1b7467,null));};exports['removeDispositions']=function(_0x3d2067,_0x28661d,_0x4d881f){return db[_0x4c6a('0x3f')]['find']({'where':{'id':_0x3d2067['params']['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x28661d,null))[_0x4c6a('0x1e')](function(_0x3c56bb){if(_0x3c56bb){return _0x3c56bb['removeDispositions'](_0x3d2067[_0x4c6a('0x44')]['ids']);}})[_0x4c6a('0x1e')](respondWithStatusCode(_0x28661d,null))[_0x4c6a('0x29')](handleError(_0x28661d,null));};exports['addAnswer']=function(_0x512023,_0x2e0554,_0x40138a){if(_0x512023[_0x4c6a('0x5d')]['id']){delete _0x512023['body']['id'];}return db['OpenchannelAccount'][_0x4c6a('0x5b')]({'where':{'id':_0x512023['params']['id']}})['then'](handleEntityNotFound(_0x2e0554,null))[_0x4c6a('0x1e')](function(_0x3d94a5){if(_0x3d94a5){_0x512023[_0x4c6a('0x5d')]['OpenchannelAccountId']=_0x3d94a5['id'];return db[_0x4c6a('0x69')][_0x4c6a('0x5c')](_0x512023[_0x4c6a('0x5d')]);}})[_0x4c6a('0x1e')](respondWithResult(_0x2e0554,null))[_0x4c6a('0x29')](handleError(_0x2e0554,null));};exports[_0x4c6a('0x6a')]=function(_0x2e6c75,_0x36f574,_0xd2c45f){var _0x217771={'raw':![],'where':{}};var _0x1c3766={};var _0x2995c7={'count':0x0,'rows':[]};return db[_0x4c6a('0x3f')]['findOne']({'where':{'id':_0x2e6c75[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x36f574,null))['then'](function(_0x326f5c){if(_0x326f5c){_0x1c3766[_0x4c6a('0x43')]=_['keys'](db['CannedAnswer'][_0x4c6a('0x5a')]);_0x1c3766[_0x4c6a('0x44')]=_[_0x4c6a('0x45')](_0x2e6c75[_0x4c6a('0x44')]);_0x1c3766['filters']=_[_0x4c6a('0x48')](_0x1c3766['model'],_0x1c3766[_0x4c6a('0x44')]);_0x217771[_0x4c6a('0x47')]=_[_0x4c6a('0x48')](_0x1c3766[_0x4c6a('0x43')],qs[_0x4c6a('0x49')](_0x2e6c75['query'][_0x4c6a('0x49')]));_0x217771['attributes']=_0x217771[_0x4c6a('0x47')][_0x4c6a('0x4a')]?_0x217771[_0x4c6a('0x47')]:_0x1c3766['model'];if(!_0x2e6c75[_0x4c6a('0x44')]['hasOwnProperty']('nolimit')){_0x217771[_0x4c6a('0x2e')]=qs[_0x4c6a('0x2e')](_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x2e')]);_0x217771[_0x4c6a('0x2d')]=qs[_0x4c6a('0x2d')](_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x2d')]);}_0x217771[_0x4c6a('0x6b')]=qs[_0x4c6a('0x4d')](_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x4d')]);_0x217771[_0x4c6a('0x4e')]=qs[_0x4c6a('0x46')](_['pick'](_0x2e6c75[_0x4c6a('0x44')],_0x1c3766[_0x4c6a('0x46')]));_0x217771[_0x4c6a('0x4e')]['OpenchannelAccountId']=_0x326f5c['id'];if(_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x50')]){_0x217771[_0x4c6a('0x4e')]=_['merge'](_0x217771[_0x4c6a('0x4e')],{'$or':_[_0x4c6a('0x3e')](_0x217771[_0x4c6a('0x47')],function(_0x438880){var _0x50b191={};_0x50b191[_0x438880]={'$like':'%'+_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x50')]+'%'};return _0x50b191;})});}_0x217771=_[_0x4c6a('0x52')]({},_0x217771,_0x2e6c75['options']);return db['CannedAnswer']['count']({'where':_0x217771[_0x4c6a('0x4e')]})[_0x4c6a('0x1e')](function(_0x59e06d){_0x2995c7['count']=_0x59e06d;if(_0x2e6c75[_0x4c6a('0x44')][_0x4c6a('0x54')]){_0x217771[_0x4c6a('0x55')]=[{'all':!![]}];}return db[_0x4c6a('0x69')]['findAll'](_0x217771);})[_0x4c6a('0x1e')](function(_0xe622a1){_0x2995c7[_0x4c6a('0x57')]=_0xe622a1;return _0x2995c7;});}})[_0x4c6a('0x1e')](respondWithFilteredResult(_0x36f574,_0x217771))[_0x4c6a('0x29')](handleError(_0x36f574,null));};exports[_0x4c6a('0x6c')]=function(_0x263403,_0x34256d,_0x356342){return db[_0x4c6a('0x3f')]['find']({'where':{'id':_0x263403['params']['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x34256d,null))['then'](function(_0x1140e6){if(_0x1140e6){return _0x1140e6[_0x4c6a('0x6c')](_0x263403['query'][_0x4c6a('0x6d')]);}})[_0x4c6a('0x1e')](respondWithStatusCode(_0x34256d,null))[_0x4c6a('0x29')](handleError(_0x34256d,null));};exports[_0x4c6a('0x6e')]=function(_0x146184,_0x1a7055,_0x51a79d){var _0x3ef284={'body':_0x146184[_0x4c6a('0x5d')],'channel':_0x4c6a('0x6f')};var _0x3c2120=[];var _0x58721e=[];var _0x53e3c5={};var _0x230217=![];return db['CmContact'][_0x4c6a('0x64')]()[_0x4c6a('0x1e')](function(_0x22747a){if(!_0x22747a){throw new db[(_0x4c6a('0x70'))][(_0x4c6a('0x71'))](_0x4c6a('0x72'));}_0x3c2120=_[_0x4c6a('0x73')](_[_0x4c6a('0x45')](_0x22747a),[_0x4c6a('0x74'),'updatedAt']);_0x58721e=_[_0x4c6a('0x73')](_[_0x4c6a('0x45')](_0x22747a),['createdAt',_0x4c6a('0x75'),'CompanyId','ListId']);if(_0x146184['body']['id']){delete _0x146184[_0x4c6a('0x5d')]['id'];}if(_[_0x4c6a('0x76')](_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x77')])){throw new db[(_0x4c6a('0x70'))]['ValidationError'](_0x4c6a('0x78'));}if(_['isNil'](_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x5d')])||_0x146184['body'][_0x4c6a('0x5d')]===''){throw new db[(_0x4c6a('0x70'))]['ValidationError'](_0x4c6a('0x79'));}if(_[_0x4c6a('0x76')](_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x7a')])){throw new db['Sequelize'][(_0x4c6a('0x71'))](_0x4c6a('0x7b')+_0x58721e);}if(!_['includes'](_0x58721e,_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x7a')])){throw new db[(_0x4c6a('0x70'))][(_0x4c6a('0x71'))](_0x4c6a('0x7c')+_0x58721e);}_0x53e3c5[_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x7a')]]=_0x146184['body'][_0x4c6a('0x77')];})['then'](function(){return db[_0x4c6a('0x3f')][_0x4c6a('0x5b')]({'where':{'id':_0x146184[_0x4c6a('0x59')]['id']},'include':[{'model':db[_0x4c6a('0x7d')],'as':'List','include':[{'model':db[_0x4c6a('0x7e')],'as':_0x4c6a('0x7f'),'where':_0x53e3c5,'limit':0x1,'order':[[_0x4c6a('0x75'),_0x4c6a('0x80')]]}]},{'model':db[_0x4c6a('0x81')],'as':_0x4c6a('0x82')}]});})[_0x4c6a('0x1e')](handleEntityNotFound(_0x1a7055,null))[_0x4c6a('0x1e')](function(_0x99dd3b){if(_0x99dd3b&&_0x99dd3b[_0x4c6a('0x83')]){_0x3ef284[_0x4c6a('0x84')]=_0x99dd3b;_0x3ef284['applications']=_0x99dd3b['Applications'];_0x3ef284[_0x4c6a('0x85')]=_0x99dd3b[_0x4c6a('0x83')];_0x3ef284[_0x4c6a('0x86')]=_[_0x4c6a('0x87')](_0x3ef284['applications'],[_0x4c6a('0x88')],[_0x4c6a('0x89')]);if(_0x3ef284[_0x4c6a('0x84')][_0x4c6a('0x82')]){delete _0x3ef284[_0x4c6a('0x84')][_0x4c6a('0x82')];}if(_0x3ef284[_0x4c6a('0x84')]['List']&&_0x3ef284['account'][_0x4c6a('0x83')][_0x4c6a('0x7f')]['length']){return _0x3ef284[_0x4c6a('0x84')][_0x4c6a('0x83')][_0x4c6a('0x7f')][0x0];}var _0x10a487=_[_0x4c6a('0x16')](_0x146184['body'],{'firstName':_0x146184['body'][_0x4c6a('0x77')],'ListId':_0x99dd3b[_0x4c6a('0x8a')]});_0x10a487[_0x146184['body'][_0x4c6a('0x7a')]]=_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x77')];return db['CmContact'][_0x4c6a('0x5c')](_0x10a487,{'fields':_0x3c2120,'raw':!![]});}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x1a7055,null))[_0x4c6a('0x1e')](function(_0x4c8119){_0x3ef284[_0x4c6a('0x8b')]=_0x4c8119;if(_0x4c8119){var _0x73c3c0={'ContactId':_0x4c8119['id'],'OpenchannelAccountId':_0x146184[_0x4c6a('0x59')]['id'],'from':(_0x4c8119['firstName']||'')+'\x20'+(_0x4c8119[_0x4c6a('0x8c')]||'')};var _0x439c1d={'OpenchannelAccountId':_0x146184[_0x4c6a('0x59')]['id'],'closed':![]};if(_0x146184[_0x4c6a('0x5d')]['threadId']){_0x439c1d[_0x4c6a('0x8d')]=_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x8d')];return db[_0x4c6a('0x8e')]['find']({'where':_0x439c1d})[_0x4c6a('0x1e')](function(_0x30e161){if(_0x30e161){return[_0x30e161,![]];}_0x73c3c0['threadId']=_0x146184['body'][_0x4c6a('0x8d')];_0x73c3c0[_0x4c6a('0x8f')]=_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x8f')];return db[_0x4c6a('0x8e')][_0x4c6a('0x5c')](_0x73c3c0)[_0x4c6a('0x1e')](function(_0xa602af){return[_0xa602af,!![]];});});}else{_0x439c1d['threadId']=null;}_0x439c1d[_0x4c6a('0x90')]=_0x4c8119['id'];return db[_0x4c6a('0x8e')][_0x4c6a('0x5b')]({'where':_0x439c1d})['then'](function(_0x57cbbe){if(_0x57cbbe){return[_0x57cbbe,![]];}return db['OpenchannelInteraction']['create'](_0x73c3c0)[_0x4c6a('0x1e')](function(_0x59f766){return[_0x59f766,!![]];});});}})[_0x4c6a('0x91')](function(_0x4a7e99,_0x2e41ec){if(_0x4a7e99){_0x230217=_0x2e41ec;if(!_0x2e41ec){var _0x5e7236={'from':(_0x3ef284[_0x4c6a('0x8b')][_0x4c6a('0x92')]||'')+'\x20'+(_0x3ef284['contact']['lastName']||'')};if(_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x8d')]&&_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x93')]&&_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x8d')]!=_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x93')]){_0x5e7236[_0x4c6a('0x8d')]=_0x146184[_0x4c6a('0x5d')]['messageId'];}return _0x4a7e99[_0x4c6a('0x34')](_0x5e7236);}else{return _0x4a7e99;}}})[_0x4c6a('0x1e')](function(_0x1aae94){_0x3ef284[_0x4c6a('0x94')]=_0x1aae94[_0x4c6a('0x35')]({'plain':!![]});_0x3ef284['interaction'][_0x4c6a('0x95')]=_0x230217;if(_0x3ef284[_0x4c6a('0x94')][_0x4c6a('0x95')]){if(_0x3ef284[_0x4c6a('0x84')]['autoclose']){_0x3ef284['applications'][_0x4c6a('0x96')]({'id':0x0,'priority':_0x3ef284['applications'][_0x4c6a('0x4a')]+0x1,'app':_0x4c6a('0x97'),'appdata':_0x4c6a('0x98'),'interval':_0x4c6a('0x99')});}}return db[_0x4c6a('0x9a')][_0x4c6a('0x5c')]({'body':_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x5d')],'OpenchannelAccountId':_0x146184[_0x4c6a('0x59')]['id'],'OpenchannelInteractionId':_0x1aae94['id'],'direction':'in','ContactId':_0x3ef284['contact']['id'],'AttachmentId':_0x146184[_0x4c6a('0x5d')][_0x4c6a('0x9b')]});})[_0x4c6a('0x1e')](function(_0x40d1bc){_0x3ef284[_0x4c6a('0x27')]=_0x40d1bc;if(_0x3ef284[_0x4c6a('0x94')][_0x4c6a('0x9c')]){return db[_0x4c6a('0x9d')][_0x4c6a('0x5b')]({'attributes':['id','name'],'where':{'id':_0x3ef284[_0x4c6a('0x94')][_0x4c6a('0x9c')]}})[_0x4c6a('0x1e')](function(_0x2f1574){if(_0x2f1574){_0x3ef284[_0x4c6a('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4c6a('0x9e'),'appdata':_0x2f1574[_0x4c6a('0x3a')]+','+(_0x3ef284[_0x4c6a('0x84')][_0x4c6a('0x9f')]||0xa),'interval':_0x4c6a('0x99')});_0x3ef284[_0x4c6a('0xa0')]=![];}return respondWithRpcPromise(_0x4c6a('0xa1'),_0x4c6a('0xa2'),_0x3ef284);});}return respondWithRpcPromise(_0x4c6a('0xa1'),'startRouting',_0x3ef284);})[_0x4c6a('0x1e')](function(_0x1dc213){respondWithRpcPromise(_0x4c6a('0xa3'),_0x4c6a('0xa3'),{'event':_0x4c6a('0x6e'),'message':_0x1dc213},client9002);return _0x1dc213;})['then'](respondWithResult(_0x1a7055,null))['catch'](handleError(_0x1a7055,null));};exports[_0x4c6a('0xa4')]=function(_0x304d32,_0xcf3337){var _0x29b330=_0x304d32[_0x4c6a('0x59')]['id'];var _0xbce20a=_0x304d32[_0x4c6a('0x5d')];var _0xb2fb2e=0xc8;var _0x530cb6=null;return db['sequelize'][_0x4c6a('0xa5')]({'isolationLevel':db[_0x4c6a('0xa6')][_0x4c6a('0xa7')][_0x4c6a('0xa8')][_0x4c6a('0xa9')]},function(_0x76bdd8){return db[_0x4c6a('0x3f')][_0x4c6a('0xaa')]({'where':{'id':_0x29b330},'transaction':_0x76bdd8})[_0x4c6a('0x1e')](function(_0x2100fa){if(_0x2100fa){return db['OpenchannelApplication'][_0x4c6a('0x37')]({'where':{'OpenchannelAccountId':_0x29b330},'transaction':_0x76bdd8})['then'](function(){var _0x159307=_['map'](_0xbce20a,function(_0x247da4){_0x247da4[_0x4c6a('0x66')]=_0x29b330;return _0x247da4;});return db[_0x4c6a('0x81')][_0x4c6a('0xab')](_0x159307,{'transaction':_0x76bdd8});});}else{_0xb2fb2e=0x194;_0x530cb6=[];}});})[_0x4c6a('0x1e')](function(){if(_0xb2fb2e!==0x194){return db['OpenchannelApplication'][_0x4c6a('0xac')]({'where':{'OpenchannelAccountId':_0x29b330},'order':_0x4c6a('0x88')})[_0x4c6a('0x1e')](function(_0x18495e){_0x530cb6=_0x18495e;});}})[_0x4c6a('0x29')](function(_0x1f6763){_0xb2fb2e=0x1f4;logger['error'](_0x1f6763[_0x4c6a('0x39')]);if(_0x1f6763[_0x4c6a('0x3a')]){delete _0x1f6763[_0x4c6a('0x3a')];}_0x530cb6=_0x1f6763;})[_0x4c6a('0xad')](function(){if(_0x530cb6===null){_0xcf3337[_0x4c6a('0x38')](_0xb2fb2e);}else{if(_0xb2fb2e===0x1f4){_0xcf3337[_0x4c6a('0x2a')](_0xb2fb2e)[_0x4c6a('0xae')](_0x530cb6);}else{_0xcf3337[_0x4c6a('0x2a')](_0xb2fb2e)[_0x4c6a('0x2c')](_0x530cb6);}}});};exports[_0x4c6a('0xaf')]=function(_0x43e158,_0x3c1094,_0x5d8c39){var _0x25b303={};var _0xc5df54={};var _0x4d5259;var _0x28ae4e;return db['OpenchannelAccount'][_0x4c6a('0xaa')]({'where':{'id':_0x43e158[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x3c1094,null))[_0x4c6a('0x1e')](function(_0x31c148){if(_0x31c148){_0x4d5259=_0x31c148;_0xc5df54[_0x4c6a('0x43')]=_[_0x4c6a('0x45')](db[_0x4c6a('0x81')][_0x4c6a('0x5a')]);_0xc5df54[_0x4c6a('0x44')]=_['keys'](_0x43e158[_0x4c6a('0x44')]);_0xc5df54[_0x4c6a('0x46')]=_[_0x4c6a('0x48')](_0xc5df54[_0x4c6a('0x43')],_0xc5df54['query']);_0x25b303[_0x4c6a('0x47')]=_[_0x4c6a('0x48')](_0xc5df54[_0x4c6a('0x43')],qs[_0x4c6a('0x49')](_0x43e158['query'][_0x4c6a('0x49')]));_0x25b303[_0x4c6a('0x47')]=_0x25b303[_0x4c6a('0x47')][_0x4c6a('0x4a')]?_0x25b303[_0x4c6a('0x47')]:_0xc5df54[_0x4c6a('0x43')];_0x25b303[_0x4c6a('0x6b')]=qs[_0x4c6a('0x4d')](_0x43e158['query'][_0x4c6a('0x4d')]);_0x25b303['where']=qs[_0x4c6a('0x46')](_['pick'](_0x43e158[_0x4c6a('0x44')],_0xc5df54['filters']));if(_0x43e158[_0x4c6a('0x44')][_0x4c6a('0x50')]){_0x25b303[_0x4c6a('0x4e')]=_[_0x4c6a('0x52')](_0x25b303[_0x4c6a('0x4e')],{'$or':_[_0x4c6a('0x3e')](_0x25b303['attributes'],function(_0x83fa46){var _0x461e59={};_0x461e59[_0x83fa46]={'$like':'%'+_0x43e158['query']['filter']+'%'};return _0x461e59;})});}_0x25b303=_[_0x4c6a('0x52')]({},_0x25b303,_0x43e158[_0x4c6a('0x53')]);return _0x4d5259[_0x4c6a('0xaf')](_0x25b303);}})['then'](function(_0x260163){if(_0x260163){_0x28ae4e=_0x260163['length'];if(!_0x43e158[_0x4c6a('0x44')][_0x4c6a('0x4b')](_0x4c6a('0x4c'))){_0x25b303[_0x4c6a('0x2e')]=qs['limit'](_0x43e158[_0x4c6a('0x44')]['limit']);_0x25b303[_0x4c6a('0x2d')]=qs[_0x4c6a('0x2d')](_0x43e158[_0x4c6a('0x44')][_0x4c6a('0x2d')]);}return _0x4d5259[_0x4c6a('0xaf')](_0x25b303);}})[_0x4c6a('0x1e')](function(_0x59f70a){if(_0x59f70a){return _0x59f70a?{'count':_0x28ae4e,'rows':_0x59f70a}:null;}})[_0x4c6a('0x1e')](respondWithResult(_0x3c1094,null))[_0x4c6a('0x29')](handleError(_0x3c1094,null));};exports[_0x4c6a('0xb0')]=function(_0x332ce1,_0x2c6e57,_0xc437fa){var _0x1832fa={'raw':![],'where':{}};var _0x513d8b={};var _0x1b6e1f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4c6a('0xaa')]({'where':{'id':_0x332ce1[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x2c6e57,null))[_0x4c6a('0x1e')](function(_0x37c9db){if(_0x37c9db){_0x513d8b[_0x4c6a('0x43')]=_[_0x4c6a('0x45')](db[_0x4c6a('0x8e')][_0x4c6a('0x5a')]);_0x513d8b[_0x4c6a('0x44')]=_[_0x4c6a('0x45')](_0x332ce1['query']);_0x513d8b[_0x4c6a('0x46')]=_[_0x4c6a('0x48')](_0x513d8b['model'],_0x513d8b[_0x4c6a('0x44')]);_0x1832fa[_0x4c6a('0x47')]=_[_0x4c6a('0x48')](_0x513d8b[_0x4c6a('0x43')],qs['fields'](_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0x49')]));_0x1832fa['attributes']=_0x1832fa[_0x4c6a('0x47')][_0x4c6a('0x4a')]?_0x1832fa[_0x4c6a('0x47')]:_0x513d8b['model'];if(!_0x332ce1['query'][_0x4c6a('0x4b')](_0x4c6a('0x4c'))){_0x1832fa[_0x4c6a('0x2e')]=qs[_0x4c6a('0x2e')](_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0x2e')]);_0x1832fa['offset']=qs[_0x4c6a('0x2d')](_0x332ce1[_0x4c6a('0x44')]['offset']);}_0x1832fa[_0x4c6a('0x6b')]=qs[_0x4c6a('0x4d')](_0x332ce1[_0x4c6a('0x44')]['sort']);_0x1832fa['where']=qs[_0x4c6a('0x46')](_[_0x4c6a('0x4f')](_0x332ce1[_0x4c6a('0x44')],_0x513d8b[_0x4c6a('0x46')]));_0x1832fa['where'][_0x4c6a('0x66')]=_0x37c9db['id'];if(_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0x50')]){_0x1832fa[_0x4c6a('0x4e')]=_[_0x4c6a('0x52')](_0x1832fa[_0x4c6a('0x4e')],{'$or':_[_0x4c6a('0x3e')](_0x1832fa[_0x4c6a('0x47')],function(_0x157b2b){var _0x5a6c31={};_0x5a6c31[_0x157b2b]={'$like':'%'+_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0x50')]+'%'};return _0x5a6c31;})});}_0x1832fa=_['merge']({},_0x1832fa,_0x332ce1[_0x4c6a('0x53')]);return db[_0x4c6a('0x8e')][_0x4c6a('0x30')]({'where':_0x1832fa[_0x4c6a('0x4e')]})[_0x4c6a('0x1e')](function(_0x322ebb){_0x1b6e1f[_0x4c6a('0x30')]=_0x322ebb;if(_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0x54')]){_0x1832fa[_0x4c6a('0x55')]=[{'model':db['CmContact'],'as':_0x4c6a('0xb1'),'required':![]},{'model':db['User'],'as':_0x4c6a('0xb2'),'attributes':['name',_0x4c6a('0xb3'),'internal'],'required':![]},{'model':db[_0x4c6a('0xb4')],'as':_0x4c6a('0xb5'),'attributes':['id',_0x4c6a('0x3a'),_0x4c6a('0xb6')],'where':_0x332ce1['query'][_0x4c6a('0xb7')]?{'id':_0x332ce1[_0x4c6a('0x44')][_0x4c6a('0xb7')]}:undefined,'required':_0x332ce1[_0x4c6a('0x44')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x4c6a('0x56')](_0x1832fa);})[_0x4c6a('0x1e')](function(_0x143d44){_0x1b6e1f['rows']=_0x143d44;return _0x1b6e1f;});}})[_0x4c6a('0x1e')](respondWithFilteredResult(_0x2c6e57,_0x1832fa))['catch'](handleError(_0x2c6e57,null));};exports[_0x4c6a('0xb8')]=function(_0x167875,_0x7a8ae,_0x415125){return db['OpenchannelAccount'][_0x4c6a('0x5b')]({'where':{'id':_0x167875[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x7a8ae,null))[_0x4c6a('0x1e')](function(_0x58af3a){if(_0x58af3a){return _0x58af3a[_0x4c6a('0xb8')](_0x167875[_0x4c6a('0x5d')]['ids'],_['omit'](_0x167875[_0x4c6a('0x5d')],[_0x4c6a('0x6d'),'id'])||{})['spread'](function(_0x132070){for(var _0x1cbdc6=0x0;_0x1cbdc6<_0x167875[_0x4c6a('0x5d')][_0x4c6a('0x6d')]['length'];_0x1cbdc6+=0x1){socket[_0x4c6a('0xb9')](_0x4c6a('0xba'),{'UserId':Number(_0x167875[_0x4c6a('0x5d')][_0x4c6a('0x6d')][_0x1cbdc6]),'OpenchannelAccountId':Number(_0x167875[_0x4c6a('0x59')]['id'])});}return _0x132070;});}})[_0x4c6a('0x1e')](respondWithResult(_0x7a8ae,null))['catch'](handleError(_0x7a8ae,null));};exports[_0x4c6a('0xbb')]=function(_0x268ab8,_0x1d2418,_0x4e0adc){return db['OpenchannelAccount'][_0x4c6a('0x5b')]({'where':{'id':_0x268ab8[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x1d2418,null))[_0x4c6a('0x1e')](function(_0x256abf){if(_0x256abf){return _0x256abf[_0x4c6a('0xbb')](_0x268ab8[_0x4c6a('0x44')][_0x4c6a('0x6d')])[_0x4c6a('0x1e')](function(){if(_['isArray'](_0x268ab8['query'][_0x4c6a('0x6d')])){for(var _0x56fcb2=0x0;_0x56fcb2<_0x268ab8[_0x4c6a('0x44')][_0x4c6a('0x6d')][_0x4c6a('0x4a')];_0x56fcb2+=0x1){socket[_0x4c6a('0xb9')](_0x4c6a('0xbc'),{'UserId':Number(_0x268ab8[_0x4c6a('0x44')]['ids'][_0x56fcb2]),'OpenchannelAccountId':Number(_0x268ab8[_0x4c6a('0x59')]['id'])});}}else{socket[_0x4c6a('0xb9')](_0x4c6a('0xbc'),{'UserId':Number(_0x268ab8[_0x4c6a('0x44')]['ids']),'OpenchannelAccountId':Number(_0x268ab8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1d2418,null))['catch'](handleError(_0x1d2418,null));};exports[_0x4c6a('0xbd')]=function(_0x2a1932,_0xdc7434,_0xc1356c){var _0x18ae22={};var _0x3892f9={};var _0x2e91e9;var _0x128e11;return db[_0x4c6a('0x3f')][_0x4c6a('0xaa')]({'where':{'id':_0x2a1932[_0x4c6a('0x59')]['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0xdc7434,null))[_0x4c6a('0x1e')](function(_0x40086f){if(_0x40086f){_0x2e91e9=_0x40086f;_0x3892f9['model']=_[_0x4c6a('0x45')](db[_0x4c6a('0x9d')][_0x4c6a('0x5a')]);_0x3892f9[_0x4c6a('0x44')]=_['keys'](_0x2a1932[_0x4c6a('0x44')]);_0x3892f9[_0x4c6a('0x46')]=_[_0x4c6a('0x48')](_0x3892f9[_0x4c6a('0x43')],_0x3892f9[_0x4c6a('0x44')]);_0x18ae22[_0x4c6a('0x47')]=_[_0x4c6a('0x48')](_0x3892f9[_0x4c6a('0x43')],qs['fields'](_0x2a1932['query'][_0x4c6a('0x49')]));_0x18ae22[_0x4c6a('0x47')]=_0x18ae22[_0x4c6a('0x47')]['length']?_0x18ae22[_0x4c6a('0x47')]:_0x3892f9[_0x4c6a('0x43')];_0x18ae22['order']=qs[_0x4c6a('0x4d')](_0x2a1932[_0x4c6a('0x44')]['sort']);_0x18ae22[_0x4c6a('0x4e')]=qs[_0x4c6a('0x46')](_[_0x4c6a('0x4f')](_0x2a1932[_0x4c6a('0x44')],_0x3892f9[_0x4c6a('0x46')]));if(_0x2a1932[_0x4c6a('0x44')][_0x4c6a('0x50')]){_0x18ae22[_0x4c6a('0x4e')]=_['merge'](_0x18ae22['where'],{'$or':_[_0x4c6a('0x3e')](_0x18ae22[_0x4c6a('0x47')],function(_0x428f96){var _0x202213={};_0x202213[_0x428f96]={'$like':'%'+_0x2a1932[_0x4c6a('0x44')][_0x4c6a('0x50')]+'%'};return _0x202213;})});}_0x18ae22=_[_0x4c6a('0x52')]({},_0x18ae22,_0x2a1932[_0x4c6a('0x53')]);return _0x2e91e9[_0x4c6a('0xbd')](_0x18ae22);}})[_0x4c6a('0x1e')](function(_0x318ae9){if(_0x318ae9){_0x128e11=_0x318ae9[_0x4c6a('0x4a')];if(!_0x2a1932['query'][_0x4c6a('0x4b')](_0x4c6a('0x4c'))){_0x18ae22[_0x4c6a('0x2e')]=qs['limit'](_0x2a1932[_0x4c6a('0x44')][_0x4c6a('0x2e')]);_0x18ae22['offset']=qs[_0x4c6a('0x2d')](_0x2a1932[_0x4c6a('0x44')][_0x4c6a('0x2d')]);}return _0x2e91e9[_0x4c6a('0xbd')](_0x18ae22);}})[_0x4c6a('0x1e')](function(_0xf8716c){if(_0xf8716c){return _0xf8716c?{'count':_0x128e11,'rows':_0xf8716c}:null;}})[_0x4c6a('0x1e')](respondWithResult(_0xdc7434,null))['catch'](handleError(_0xdc7434,null));};exports[_0x4c6a('0xae')]=function(_0x5181f8,_0x4f6d8e,_0x593124){var _0xe9ab38,_0x14f575,_0x3195e1;if(_[_0x4c6a('0x76')](_0x5181f8['body'][_0x4c6a('0x5d')])||_0x5181f8[_0x4c6a('0x5d')][_0x4c6a('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0x4c6a('0x79'));}if(_[_0x4c6a('0x76')](_0x5181f8[_0x4c6a('0x5d')]['to'])){}_0xe9ab38=_0x5181f8[_0x4c6a('0x5d')]['to'];return db[_0x4c6a('0x3f')][_0x4c6a('0xaa')]({'where':{'id':_0x5181f8['params']['id']}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x4f6d8e,null))[_0x4c6a('0x1e')](function(_0x4d25d0){if(_0x4d25d0){return db[_0x4c6a('0x3f')][_0x4c6a('0x5b')]({'where':{'id':_0x4d25d0['id']},'include':[{'model':db[_0x4c6a('0x7d')],'as':_0x4c6a('0x83'),'include':[{'model':db[_0x4c6a('0x7e')],'as':_0x4c6a('0x7f'),'where':{[_0x4d25d0[_0x4c6a('0x7a')]]:_0xe9ab38},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4c6a('0x1e')](handleEntityNotFound(_0x4f6d8e,null))['then'](function(_0x526000){if(_0x526000&&_0x526000[_0x4c6a('0x83')]){_0x14f575=_0x526000[_0x4c6a('0x35')]({'plain':!![]});if(_0x14f575[_0x4c6a('0x83')]&&_0x14f575[_0x4c6a('0x83')][_0x4c6a('0x7f')][_0x4c6a('0x4a')]){return _0x14f575[_0x4c6a('0x83')]['Contacts'][0x0];}return db[_0x4c6a('0x7e')][_0x4c6a('0x5c')](_[_0x4c6a('0x16')](_0x5181f8[_0x4c6a('0x5d')],{'firstName':_0xe9ab38,[_0x526000['mapKey']]:_0xe9ab38,'phone':_0xe9ab38,'ListId':_0x14f575['ListId']}));}})[_0x4c6a('0x1e')](handleEntityNotFound(_0x4f6d8e,null))[_0x4c6a('0x1e')](function(_0x122ff6){if(_0x122ff6){_0x3195e1=_0x122ff6;return db[_0x4c6a('0x8e')][_0x4c6a('0x5b')]({'where':{'ContactId':_0x3195e1['id'],'closed':![],'OpenchannelAccountId':_0x14f575['id']}})[_0x4c6a('0x1e')](function(_0x1bbbb7){if(_0x1bbbb7){return[_0x1bbbb7,![]];}return db['OpenchannelInteraction'][_0x4c6a('0x5c')]({'UserId':_0x5181f8[_0x4c6a('0x5e')]['id'],'ContactId':_0x3195e1['id'],'OpenchannelAccountId':_0x14f575['id'],'lastMsgDirection':'out','Messages':[_[_0x4c6a('0x52')](_0x5181f8[_0x4c6a('0x5d')],{'read':![],'body':_0x5181f8[_0x4c6a('0x5d')][_0x4c6a('0x5d')],'OpenchannelAccountId':_0x14f575['id'],'UserId':_0x5181f8[_0x4c6a('0x5e')]['id'],'ContactId':_0x3195e1['id']})]},{'include':[{'model':db[_0x4c6a('0x9a')],'as':_0x4c6a('0xbe')}]})[_0x4c6a('0x1e')](function(_0x3e2171){return[_0x3e2171,!![]];});});}})['spread'](function(_0x56c1db,_0x33b360){if(_0x33b360){return _0x56c1db;}return db[_0x4c6a('0x9a')]['create'](_[_0x4c6a('0x52')](_0x5181f8['body'],{'read':![],'body':_0x5181f8[_0x4c6a('0x5d')][_0x4c6a('0x5d')],'OpenchannelAccountId':_0x14f575['id'],'OpenchannelInteractionId':_0x56c1db['id'],'UserId':_0x5181f8[_0x4c6a('0x5e')]['id'],'ContactId':_0x3195e1['id']}))[_0x4c6a('0x1e')](function(_0x35b802){_0x56c1db[_0x4c6a('0xbf')][_0x4c6a('0xbe')]=[];_0x56c1db['dataValues'][_0x4c6a('0xbe')][_0x4c6a('0x96')](_0x35b802[_0x4c6a('0xbf')]);return _0x56c1db;});});}})[_0x4c6a('0x1e')](respondWithResult(_0x4f6d8e,null))[_0x4c6a('0x29')](handleError(_0x4f6d8e,null));}; \ No newline at end of file +var _0x373e=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','Contacts','DESC','OpenchannelApplication','List','applications','Applications','priority','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','ListId','Messages','dataValues','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','OpenchannelAccounts','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick'];(function(_0x3da887,_0x536787){var _0x59769a=function(_0x236a34){while(--_0x236a34){_0x3da887['push'](_0x3da887['shift']());}};_0x59769a(++_0x536787);}(_0x373e,0x6a));var _0xe373=function(_0x43d79e,_0x27c29f){_0x43d79e=_0x43d79e-0x0;var _0x33aa8b=_0x373e[_0x43d79e];return _0x33aa8b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe373('0x0'));var jsonpatch=require(_0xe373('0x1'));var rp=require('request-promise');var moment=require(_0xe373('0x2'));var BPromise=require(_0xe373('0x3'));var Mustache=require(_0xe373('0x4'));var util=require(_0xe373('0x5'));var path=require(_0xe373('0x6'));var sox=require('sox');var csv=require(_0xe373('0x7'));var ejs=require(_0xe373('0x8'));var fs=require('fs');var fs_extra=require(_0xe373('0x9'));var _=require('lodash');var squel=require(_0xe373('0xa'));var crypto=require(_0xe373('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe373('0xc'));var toCsv=require(_0xe373('0x7'));var querystring=require(_0xe373('0xd'));var Papa=require(_0xe373('0xe'));var Redis=require(_0xe373('0xf'));var authService=require(_0xe373('0x10'));var qs=require(_0xe373('0x11'));var as=require(_0xe373('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe373('0x13'))('api');var utils=require(_0xe373('0x14'));var config=require(_0xe373('0x15'));var licenseUtil=require(_0xe373('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe373('0x17')](config[_0xe373('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe373('0x19'))(new Redis(config[_0xe373('0x18')]));require(_0xe373('0x1a'))[_0xe373('0x1b')](socket);var jayson=require(_0xe373('0x1c'));var client=jayson[_0xe373('0x1d')][_0xe373('0x1e')]({'port':0x232c});var client9002=jayson[_0xe373('0x1d')][_0xe373('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ddab7,_0x4ec635,_0x2434f5,_0x3890b){return new BPromise(function(_0x23e77f,_0x4ad026){var _0x5f56aa=_0x3890b||client;return _0x5f56aa[_0xe373('0x1f')](_0x5ddab7,_0x2434f5)[_0xe373('0x20')](function(_0x4b7969){logger[_0xe373('0x21')](_0xe373('0x22'),_0x4ec635,_0xe373('0x23'));logger[_0xe373('0x24')](_0xe373('0x25'),_0x4ec635,_0xe373('0x23'),JSON['stringify'](_0x4b7969));if(_0x4b7969[_0xe373('0x26')]){if(_0x4b7969[_0xe373('0x26')][_0xe373('0x27')]===0x1f4){logger[_0xe373('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ec635,_0x4b7969[_0xe373('0x26')][_0xe373('0x28')]);return _0x4ad026(_0x4b7969[_0xe373('0x26')][_0xe373('0x28')]);}logger['error'](_0xe373('0x22'),_0x4ec635,_0x4b7969['error'][_0xe373('0x28')]);return _0x23e77f(_0x4b7969[_0xe373('0x26')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4ec635,_0xe373('0x23'));_0x23e77f(_0x4b7969[_0xe373('0x29')][_0xe373('0x28')]);}})[_0xe373('0x2a')](function(_0xb28e14){logger[_0xe373('0x26')](_0xe373('0x22'),_0x4ec635,_0xb28e14);_0x4ad026(_0xb28e14);});});}function respondWithStatusCode(_0x3874b5,_0xc9cb72){_0xc9cb72=_0xc9cb72||0xcc;return function(_0x36b716){if(_0x36b716){return _0x3874b5[_0xe373('0x2b')](_0xc9cb72);}return _0x3874b5['status'](_0xc9cb72)[_0xe373('0x2c')]();};}function respondWithResult(_0x5c668d,_0x183f5d){_0x183f5d=_0x183f5d||0xc8;return function(_0x420f47){if(_0x420f47){return _0x5c668d[_0xe373('0x2d')](_0x183f5d)[_0xe373('0x2e')](_0x420f47);}};}function respondWithFilteredResult(_0x1fbd2f,_0xff3f27){return function(_0x23bb93){if(_0x23bb93){var _0x2e6ace=typeof _0xff3f27[_0xe373('0x2f')]===_0xe373('0x30')&&typeof _0xff3f27[_0xe373('0x31')]===_0xe373('0x30');var _0x204e12=_0x23bb93[_0xe373('0x32')];var _0x3d9aae=_0x2e6ace?0x0:_0xff3f27[_0xe373('0x2f')];var _0x58a4f2=_0x2e6ace?_0x23bb93[_0xe373('0x32')]:_0xff3f27[_0xe373('0x2f')]+_0xff3f27['limit'];var _0x576f66;if(_0x58a4f2>=_0x204e12){_0x58a4f2=_0x204e12;_0x576f66=0xc8;}else{_0x576f66=0xce;}_0x1fbd2f[_0xe373('0x2d')](_0x576f66);return _0x1fbd2f[_0xe373('0x33')](_0xe373('0x34'),_0x3d9aae+'-'+_0x58a4f2+'/'+_0x204e12)[_0xe373('0x2e')](_0x23bb93);}return null;};}function patchUpdates(_0x405ece){return function(_0x195052){try{jsonpatch[_0xe373('0x35')](_0x195052,_0x405ece,!![]);}catch(_0x549dd0){return BPromise[_0xe373('0x36')](_0x549dd0);}return _0x195052['save']();};}function saveUpdates(_0x8ad23a,_0x259cd5){return function(_0x55bb02){if(_0x55bb02){return _0x55bb02[_0xe373('0x37')](_0x8ad23a)[_0xe373('0x20')](function(_0x1471c6){return _0x1471c6;});}return null;};}function removeEntity(_0x409c41,_0x42954f){return function(_0x270149){if(_0x270149){return _0x270149['destroy']()[_0xe373('0x20')](function(){var _0x8ed2e7=_0x270149[_0xe373('0x38')]({'plain':!![]});var _0x77e0b9=_0xe373('0x39');return db[_0xe373('0x3a')][_0xe373('0x3b')]({'where':{'type':_0x77e0b9,'resourceId':_0x8ed2e7['id']}})[_0xe373('0x20')](function(){return _0x270149;});})['then'](function(){_0x409c41[_0xe373('0x2d')](0xcc)[_0xe373('0x2c')]();});}};}function handleEntityNotFound(_0x3df290,_0x68bebb){return function(_0xb356a){if(!_0xb356a){_0x3df290[_0xe373('0x2b')](0x194);}return _0xb356a;};}function handleError(_0x12b661,_0x3cfbb8){_0x3cfbb8=_0x3cfbb8||0x1f4;return function(_0x2561ed){logger[_0xe373('0x26')](_0x2561ed['stack']);if(_0x2561ed[_0xe373('0x3c')]){delete _0x2561ed[_0xe373('0x3c')];}_0x12b661[_0xe373('0x2d')](_0x3cfbb8)[_0xe373('0x3d')](_0x2561ed);};}exports[_0xe373('0x3e')]=function(_0x262a3f,_0x16315c){var _0x129340={'include':[{'model':db[_0xe373('0x3f')],'as':_0xe373('0x40')}]},_0x316b81={},_0x107714={'count':0x0,'rows':[]};var _0x45743e=_[_0xe373('0x41')](db[_0xe373('0x42')][_0xe373('0x43')],function(_0x53279a){return{'name':_0x53279a[_0xe373('0x44')],'type':_0x53279a[_0xe373('0x45')][_0xe373('0x46')]};});_0x316b81[_0xe373('0x47')]=_[_0xe373('0x41')](_0x45743e,_0xe373('0x3c'));_0x316b81['query']=_[_0xe373('0x48')](_0x262a3f[_0xe373('0x49')]);_0x316b81[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0x316b81[_0xe373('0x47')],_0x316b81[_0xe373('0x49')]);_0x129340['attributes']=_[_0xe373('0x4b')](_0x316b81[_0xe373('0x47')],qs['fields'](_0x262a3f[_0xe373('0x49')][_0xe373('0x4c')]));_0x129340[_0xe373('0x4d')]=_0x129340['attributes']['length']?_0x129340[_0xe373('0x4d')]:_0x316b81['model'];if(!_0x262a3f[_0xe373('0x49')]['hasOwnProperty'](_0xe373('0x4e'))){_0x129340['limit']=qs[_0xe373('0x31')](_0x262a3f[_0xe373('0x49')][_0xe373('0x31')]);_0x129340['offset']=qs['offset'](_0x262a3f[_0xe373('0x49')][_0xe373('0x2f')]);}_0x129340[_0xe373('0x4f')]=qs[_0xe373('0x50')](_0x262a3f[_0xe373('0x49')]['sort']);_0x129340[_0xe373('0x51')]=qs['filters'](_[_0xe373('0x52')](_0x262a3f['query'],_0x316b81[_0xe373('0x4a')]),_0x45743e);if(_0x262a3f[_0xe373('0x49')][_0xe373('0x53')]){_0x129340[_0xe373('0x51')]=_[_0xe373('0x54')](_0x129340[_0xe373('0x51')],{'$or':_[_0xe373('0x41')](_0x45743e,function(_0x3ce2ee){if(_0x3ce2ee[_0xe373('0x45')]!==_0xe373('0x55')){var _0xbd869b={};_0xbd869b[_0x3ce2ee[_0xe373('0x3c')]]={'$like':'%'+_0x262a3f[_0xe373('0x49')][_0xe373('0x53')]+'%'};return _0xbd869b;}})});}_0x129340=_['merge']({},_0x129340,_0x262a3f[_0xe373('0x56')]);var _0x673526={'where':_0x129340[_0xe373('0x51')]};return db[_0xe373('0x42')]['count'](_0x673526)[_0xe373('0x20')](function(_0x31d4a8){_0x107714[_0xe373('0x32')]=_0x31d4a8;if(_0x262a3f[_0xe373('0x49')][_0xe373('0x57')]){_0x129340[_0xe373('0x58')]=[{'all':!![]}];}return db[_0xe373('0x42')][_0xe373('0x59')](_0x129340);})[_0xe373('0x20')](function(_0x3d9e11){_0x107714[_0xe373('0x5a')]=_0x3d9e11;return _0x107714;})['then'](respondWithFilteredResult(_0x16315c,_0x129340))[_0xe373('0x2a')](handleError(_0x16315c,null));};exports['show']=function(_0x2cfe27,_0x558e2a){var _0x1cc529={'raw':![],'where':{'id':_0x2cfe27['params']['id']},'include':[{'model':db[_0xe373('0x3f')],'as':'mandatoryDispositionPause'}]},_0xfe8a7f={};_0xfe8a7f['model']=_[_0xe373('0x48')](db['OpenchannelAccount']['rawAttributes']);_0xfe8a7f[_0xe373('0x49')]=_[_0xe373('0x48')](_0x2cfe27['query']);_0xfe8a7f[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0xfe8a7f['model'],_0xfe8a7f[_0xe373('0x49')]);_0x1cc529[_0xe373('0x4d')]=_[_0xe373('0x4b')](_0xfe8a7f[_0xe373('0x47')],qs[_0xe373('0x4c')](_0x2cfe27['query'][_0xe373('0x4c')]));_0x1cc529[_0xe373('0x4d')]=_0x1cc529['attributes'][_0xe373('0x5b')]?_0x1cc529[_0xe373('0x4d')]:_0xfe8a7f['model'];if(_0x2cfe27['query']['includeAll']){_0x1cc529[_0xe373('0x58')]=[{'all':!![]}];}_0x1cc529=_[_0xe373('0x54')]({},_0x1cc529,_0x2cfe27['options']);return db['OpenchannelAccount'][_0xe373('0x5c')](_0x1cc529)['then'](handleEntityNotFound(_0x558e2a,null))[_0xe373('0x20')](respondWithResult(_0x558e2a,null))[_0xe373('0x2a')](handleError(_0x558e2a,null));};exports[_0xe373('0x5d')]=function(_0x144d54,_0x20ad8e){return db[_0xe373('0x42')]['create'](_0x144d54[_0xe373('0x5e')],{})[_0xe373('0x20')](function(_0x499ed7){var _0xb211a2=_0x144d54[_0xe373('0x5f')]['get']({'plain':!![]});if(!_0xb211a2)throw new Error(_0xe373('0x60'));if(_0xb211a2['role']===_0xe373('0x5f')){var _0x4e8a9a=_0x499ed7[_0xe373('0x38')]({'plain':!![]});var _0x50cf54=_0xe373('0x39');return db[_0xe373('0x61')]['find']({'where':{'name':_0x50cf54,'userProfileId':_0xb211a2[_0xe373('0x62')]},'raw':!![]})[_0xe373('0x20')](function(_0x275e44){if(_0x275e44&&_0x275e44[_0xe373('0x63')]===0x0){return db[_0xe373('0x3a')][_0xe373('0x5d')]({'name':_0x4e8a9a[_0xe373('0x3c')],'resourceId':_0x4e8a9a['id'],'type':_0x275e44['name'],'sectionId':_0x275e44['id']},{})[_0xe373('0x20')](function(){return _0x499ed7;});}else{return _0x499ed7;}})['catch'](function(_0x31f609){logger[_0xe373('0x26')](_0xe373('0x64'),_0x31f609);throw _0x31f609;});}return _0x499ed7;})[_0xe373('0x20')](respondWithResult(_0x20ad8e,0xc9))[_0xe373('0x2a')](handleError(_0x20ad8e,null));};exports[_0xe373('0x37')]=function(_0x4a9d76,_0x463421){if(_0x4a9d76[_0xe373('0x5e')]['id']){delete _0x4a9d76[_0xe373('0x5e')]['id'];}return db[_0xe373('0x42')][_0xe373('0x5c')]({'where':{'id':_0x4a9d76[_0xe373('0x65')]['id']},'include':[{'model':db[_0xe373('0x3f')],'as':_0xe373('0x40')}]})[_0xe373('0x20')](handleEntityNotFound(_0x463421,null))[_0xe373('0x20')](saveUpdates(_0x4a9d76['body'],null))[_0xe373('0x20')](respondWithResult(_0x463421,null))[_0xe373('0x2a')](handleError(_0x463421,null));};exports[_0xe373('0x3b')]=function(_0x3f8596,_0x3a832c){return db[_0xe373('0x42')][_0xe373('0x5c')]({'where':{'id':_0x3f8596[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x3a832c,null))[_0xe373('0x20')](removeEntity(_0x3a832c,null))['catch'](handleError(_0x3a832c,null));};exports[_0xe373('0x66')]=function(_0x8fa674,_0x56bd71){return db[_0xe373('0x42')][_0xe373('0x66')]()[_0xe373('0x20')](respondWithResult(_0x56bd71,null))['catch'](handleError(_0x56bd71,null));};exports[_0xe373('0x67')]=function(_0x50a56d,_0x568448,_0x3156de){if(_0x50a56d[_0xe373('0x5e')]['id']){delete _0x50a56d[_0xe373('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x50a56d[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x568448,null))[_0xe373('0x20')](function(_0x58926e){if(_0x58926e){_0x50a56d[_0xe373('0x5e')][_0xe373('0x68')]=_0x58926e['id'];return db[_0xe373('0x69')][_0xe373('0x5d')](_0x50a56d[_0xe373('0x5e')]);}})[_0xe373('0x20')](respondWithResult(_0x568448,null))[_0xe373('0x2a')](handleError(_0x568448,null));};exports[_0xe373('0x6a')]=function(_0x512277,_0x528f1a,_0x3fae6b){var _0x213e33={'raw':![],'where':{}};var _0x5819c3={};var _0x540205={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe373('0x6b')]({'where':{'id':_0x512277[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x528f1a,null))[_0xe373('0x20')](function(_0x287d4b){if(_0x287d4b){_0x5819c3[_0xe373('0x47')]=_['keys'](db['Disposition'][_0xe373('0x43')]);_0x5819c3[_0xe373('0x49')]=_[_0xe373('0x48')](_0x512277[_0xe373('0x49')]);_0x5819c3[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0x5819c3[_0xe373('0x47')],_0x5819c3[_0xe373('0x49')]);_0x213e33[_0xe373('0x4d')]=_[_0xe373('0x4b')](_0x5819c3[_0xe373('0x47')],qs[_0xe373('0x4c')](_0x512277[_0xe373('0x49')][_0xe373('0x4c')]));_0x213e33[_0xe373('0x4d')]=_0x213e33[_0xe373('0x4d')][_0xe373('0x5b')]?_0x213e33[_0xe373('0x4d')]:_0x5819c3[_0xe373('0x47')];if(!_0x512277[_0xe373('0x49')]['hasOwnProperty']('nolimit')){_0x213e33[_0xe373('0x31')]=qs['limit'](_0x512277[_0xe373('0x49')]['limit']);_0x213e33[_0xe373('0x2f')]=qs[_0xe373('0x2f')](_0x512277[_0xe373('0x49')][_0xe373('0x2f')]);}_0x213e33[_0xe373('0x4f')]=qs[_0xe373('0x50')](_0x512277[_0xe373('0x49')][_0xe373('0x50')]);_0x213e33['where']=qs[_0xe373('0x4a')](_[_0xe373('0x52')](_0x512277[_0xe373('0x49')],_0x5819c3[_0xe373('0x4a')]));_0x213e33[_0xe373('0x51')]['OpenchannelAccountId']=_0x287d4b['id'];if(_0x512277['query']['filter']){_0x213e33[_0xe373('0x51')]=_[_0xe373('0x54')](_0x213e33[_0xe373('0x51')],{'$or':_[_0xe373('0x41')](_0x213e33[_0xe373('0x4d')],function(_0x6826f1){var _0xb4ba6f={};_0xb4ba6f[_0x6826f1]={'$like':'%'+_0x512277[_0xe373('0x49')]['filter']+'%'};return _0xb4ba6f;})});}_0x213e33=_['merge']({},_0x213e33,_0x512277[_0xe373('0x56')]);return db[_0xe373('0x69')]['count']({'where':_0x213e33[_0xe373('0x51')]})[_0xe373('0x20')](function(_0x4e8c86){_0x540205[_0xe373('0x32')]=_0x4e8c86;if(_0x512277[_0xe373('0x49')][_0xe373('0x57')]){_0x213e33[_0xe373('0x58')]=[{'all':!![]}];}return db[_0xe373('0x69')][_0xe373('0x59')](_0x213e33);})[_0xe373('0x20')](function(_0xaabe86){_0x540205[_0xe373('0x5a')]=_0xaabe86;return _0x540205;});}})[_0xe373('0x20')](respondWithFilteredResult(_0x528f1a,_0x213e33))[_0xe373('0x2a')](handleError(_0x528f1a,null));};exports[_0xe373('0x6c')]=function(_0x329ea9,_0x5313c9,_0x503b2d){return db[_0xe373('0x42')][_0xe373('0x5c')]({'where':{'id':_0x329ea9[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x5313c9,null))['then'](function(_0x37c0fa){if(_0x37c0fa){return _0x37c0fa[_0xe373('0x6c')](_0x329ea9['query'][_0xe373('0x6d')]);}})['then'](respondWithStatusCode(_0x5313c9,null))['catch'](handleError(_0x5313c9,null));};exports[_0xe373('0x6e')]=function(_0x388d8b,_0x555de1,_0x473097){if(_0x388d8b[_0xe373('0x5e')]['id']){delete _0x388d8b['body']['id'];}return db['OpenchannelAccount'][_0xe373('0x5c')]({'where':{'id':_0x388d8b[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x555de1,null))[_0xe373('0x20')](function(_0x20dd4e){if(_0x20dd4e){_0x388d8b['body'][_0xe373('0x68')]=_0x20dd4e['id'];return db['CannedAnswer'][_0xe373('0x5d')](_0x388d8b['body']);}})[_0xe373('0x20')](respondWithResult(_0x555de1,null))[_0xe373('0x2a')](handleError(_0x555de1,null));};exports['getAnswers']=function(_0x577cfd,_0x1d8b94,_0xb6a538){var _0x17572a={'raw':![],'where':{}};var _0x2b8624={};var _0x5c1b2a={'count':0x0,'rows':[]};return db[_0xe373('0x42')]['findOne']({'where':{'id':_0x577cfd[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x1d8b94,null))['then'](function(_0x13c070){if(_0x13c070){_0x2b8624['model']=_[_0xe373('0x48')](db[_0xe373('0x6f')][_0xe373('0x43')]);_0x2b8624[_0xe373('0x49')]=_[_0xe373('0x48')](_0x577cfd[_0xe373('0x49')]);_0x2b8624['filters']=_[_0xe373('0x4b')](_0x2b8624[_0xe373('0x47')],_0x2b8624[_0xe373('0x49')]);_0x17572a[_0xe373('0x4d')]=_[_0xe373('0x4b')](_0x2b8624[_0xe373('0x47')],qs['fields'](_0x577cfd['query']['fields']));_0x17572a[_0xe373('0x4d')]=_0x17572a[_0xe373('0x4d')][_0xe373('0x5b')]?_0x17572a['attributes']:_0x2b8624[_0xe373('0x47')];if(!_0x577cfd[_0xe373('0x49')][_0xe373('0x70')](_0xe373('0x4e'))){_0x17572a[_0xe373('0x31')]=qs['limit'](_0x577cfd['query'][_0xe373('0x31')]);_0x17572a[_0xe373('0x2f')]=qs[_0xe373('0x2f')](_0x577cfd[_0xe373('0x49')][_0xe373('0x2f')]);}_0x17572a[_0xe373('0x4f')]=qs[_0xe373('0x50')](_0x577cfd[_0xe373('0x49')][_0xe373('0x50')]);_0x17572a[_0xe373('0x51')]=qs[_0xe373('0x4a')](_[_0xe373('0x52')](_0x577cfd[_0xe373('0x49')],_0x2b8624['filters']));_0x17572a['where']['OpenchannelAccountId']=_0x13c070['id'];if(_0x577cfd[_0xe373('0x49')][_0xe373('0x53')]){_0x17572a[_0xe373('0x51')]=_[_0xe373('0x54')](_0x17572a[_0xe373('0x51')],{'$or':_[_0xe373('0x41')](_0x17572a[_0xe373('0x4d')],function(_0x185a1d){var _0x1ffc1f={};_0x1ffc1f[_0x185a1d]={'$like':'%'+_0x577cfd[_0xe373('0x49')][_0xe373('0x53')]+'%'};return _0x1ffc1f;})});}_0x17572a=_[_0xe373('0x54')]({},_0x17572a,_0x577cfd['options']);return db[_0xe373('0x6f')][_0xe373('0x32')]({'where':_0x17572a[_0xe373('0x51')]})[_0xe373('0x20')](function(_0x5cccce){_0x5c1b2a[_0xe373('0x32')]=_0x5cccce;if(_0x577cfd[_0xe373('0x49')][_0xe373('0x57')]){_0x17572a[_0xe373('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x17572a);})[_0xe373('0x20')](function(_0x4b5a56){_0x5c1b2a['rows']=_0x4b5a56;return _0x5c1b2a;});}})[_0xe373('0x20')](respondWithFilteredResult(_0x1d8b94,_0x17572a))['catch'](handleError(_0x1d8b94,null));};exports[_0xe373('0x71')]=function(_0x1e4b21,_0x4779b1,_0x5f37fb){return db['OpenchannelAccount'][_0xe373('0x5c')]({'where':{'id':_0x1e4b21['params']['id']}})['then'](handleEntityNotFound(_0x4779b1,null))['then'](function(_0x1f8db4){if(_0x1f8db4){return _0x1f8db4[_0xe373('0x71')](_0x1e4b21['query']['ids']);}})[_0xe373('0x20')](respondWithStatusCode(_0x4779b1,null))[_0xe373('0x2a')](handleError(_0x4779b1,null));};exports[_0xe373('0x72')]=function(_0xaff46c,_0x371e75,_0x5b0b1a){var _0x7ccca3={'body':_0xaff46c['body'],'channel':_0xe373('0x73')};var _0xa0afbe=[];var _0x25419b=[];var _0x2d7e3d={};var _0x6483c5=![];return db[_0xe373('0x74')][_0xe373('0x66')]()['then'](function(_0x45b906){if(!_0x45b906){throw new db[(_0xe373('0x75'))][(_0xe373('0x76'))]('no\x20available\x20attributes');}_0xa0afbe=_[_0xe373('0x77')](_[_0xe373('0x48')](_0x45b906),['createdAt','updatedAt']);_0x25419b=_[_0xe373('0x77')](_[_0xe373('0x48')](_0x45b906),['createdAt',_0xe373('0x78'),_0xe373('0x79'),'ListId']);if(_0xaff46c[_0xe373('0x5e')]['id']){delete _0xaff46c[_0xe373('0x5e')]['id'];}if(_['isNil'](_0xaff46c[_0xe373('0x5e')]['from'])){throw new db[(_0xe373('0x75'))][(_0xe373('0x76'))]('from\x20is\x20mandatory');}if(_[_0xe373('0x7a')](_0xaff46c[_0xe373('0x5e')][_0xe373('0x5e')])||_0xaff46c[_0xe373('0x5e')][_0xe373('0x5e')]===''){throw new db[(_0xe373('0x75'))][(_0xe373('0x76'))](_0xe373('0x7b'));}if(_[_0xe373('0x7a')](_0xaff46c['body']['mapKey'])){throw new db['Sequelize'][(_0xe373('0x76'))](_0xe373('0x7c')+_0x25419b);}if(!_['includes'](_0x25419b,_0xaff46c[_0xe373('0x5e')]['mapKey'])){throw new db[(_0xe373('0x75'))]['ValidationError'](_0xe373('0x7d')+_0x25419b);}_0x2d7e3d[_0xaff46c['body'][_0xe373('0x7e')]]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x7f')];})[_0xe373('0x20')](function(){return db[_0xe373('0x42')]['find']({'where':{'id':_0xaff46c[_0xe373('0x65')]['id']},'include':[{'model':db[_0xe373('0x80')],'as':'List','include':[{'model':db[_0xe373('0x74')],'as':_0xe373('0x81'),'where':_0x2d7e3d,'limit':0x1,'order':[[_0xe373('0x78'),_0xe373('0x82')]]}]},{'model':db[_0xe373('0x83')],'as':'Applications'}]});})[_0xe373('0x20')](handleEntityNotFound(_0x371e75,null))[_0xe373('0x20')](function(_0x7b0cc2){if(_0x7b0cc2&&_0x7b0cc2[_0xe373('0x84')]){_0x7ccca3['account']=_0x7b0cc2;_0x7ccca3[_0xe373('0x85')]=_0x7b0cc2[_0xe373('0x86')];_0x7ccca3['list']=_0x7b0cc2['List'];_0x7ccca3['applications']=_['orderBy'](_0x7ccca3[_0xe373('0x85')],[_0xe373('0x87')],[_0xe373('0x88')]);if(_0x7ccca3['account'][_0xe373('0x86')]){delete _0x7ccca3[_0xe373('0x89')][_0xe373('0x86')];}if(_0x7ccca3[_0xe373('0x89')]['List']&&_0x7ccca3[_0xe373('0x89')]['List'][_0xe373('0x81')][_0xe373('0x5b')]){return _0x7ccca3[_0xe373('0x89')][_0xe373('0x84')][_0xe373('0x81')][0x0];}var _0x28f0a8=_[_0xe373('0x17')](_0xaff46c[_0xe373('0x5e')],{'firstName':_0xaff46c[_0xe373('0x5e')][_0xe373('0x7f')],'ListId':_0x7b0cc2['ListId']});_0x28f0a8[_0xaff46c[_0xe373('0x5e')][_0xe373('0x7e')]]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x7f')];return db[_0xe373('0x74')][_0xe373('0x5d')](_0x28f0a8,{'fields':_0xa0afbe,'raw':!![]});}})[_0xe373('0x20')](handleEntityNotFound(_0x371e75,null))[_0xe373('0x20')](function(_0x293cac){_0x7ccca3[_0xe373('0x8a')]=_0x293cac;if(_0x293cac){var _0x32453f={'ContactId':_0x293cac['id'],'OpenchannelAccountId':_0xaff46c[_0xe373('0x65')]['id'],'from':(_0x293cac[_0xe373('0x8b')]||'')+'\x20'+(_0x293cac[_0xe373('0x8c')]||'')};var _0x588739={'OpenchannelAccountId':_0xaff46c[_0xe373('0x65')]['id'],'closed':![]};if(_0xaff46c[_0xe373('0x5e')][_0xe373('0x8d')]){_0x588739[_0xe373('0x8d')]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x8d')];return db['OpenchannelInteraction'][_0xe373('0x5c')]({'where':_0x588739})[_0xe373('0x20')](function(_0x4a86b1){if(_0x4a86b1){return[_0x4a86b1,![]];}_0x32453f[_0xe373('0x8d')]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x8d')];_0x32453f[_0xe373('0x8e')]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x8e')];return db[_0xe373('0x8f')][_0xe373('0x5d')](_0x32453f)[_0xe373('0x20')](function(_0x3150f3){return[_0x3150f3,!![]];});});}else{_0x588739[_0xe373('0x8d')]=null;}_0x588739[_0xe373('0x90')]=_0x293cac['id'];return db['OpenchannelInteraction']['find']({'where':_0x588739})[_0xe373('0x20')](function(_0x518a95){if(_0x518a95){return[_0x518a95,![]];}return db['OpenchannelInteraction'][_0xe373('0x5d')](_0x32453f)[_0xe373('0x20')](function(_0x5296b4){return[_0x5296b4,!![]];});});}})[_0xe373('0x91')](function(_0x27e495,_0x500668){if(_0x27e495){_0x6483c5=_0x500668;if(!_0x500668){var _0x2204c2={'from':(_0x7ccca3[_0xe373('0x8a')][_0xe373('0x8b')]||'')+'\x20'+(_0x7ccca3[_0xe373('0x8a')][_0xe373('0x8c')]||'')};if(_0xaff46c[_0xe373('0x5e')]['threadId']&&_0xaff46c[_0xe373('0x5e')][_0xe373('0x92')]&&_0xaff46c['body'][_0xe373('0x8d')]!=_0xaff46c['body']['messageId']){_0x2204c2[_0xe373('0x8d')]=_0xaff46c[_0xe373('0x5e')][_0xe373('0x92')];}return _0x27e495[_0xe373('0x37')](_0x2204c2);}else{return _0x27e495;}}})['then'](function(_0x2f1d76){_0x7ccca3[_0xe373('0x93')]=_0x2f1d76[_0xe373('0x38')]({'plain':!![]});_0x7ccca3[_0xe373('0x93')][_0xe373('0x94')]=_0x6483c5;if(_0x7ccca3[_0xe373('0x93')][_0xe373('0x94')]){if(_0x7ccca3['account']['autoclose']){_0x7ccca3[_0xe373('0x85')]['push']({'id':0x0,'priority':_0x7ccca3[_0xe373('0x85')][_0xe373('0x5b')]+0x1,'app':_0xe373('0x95'),'appdata':_0xe373('0x96'),'interval':_0xe373('0x97')});}}return db[_0xe373('0x98')]['create']({'body':_0xaff46c[_0xe373('0x5e')][_0xe373('0x5e')],'OpenchannelAccountId':_0xaff46c[_0xe373('0x65')]['id'],'OpenchannelInteractionId':_0x2f1d76['id'],'direction':'in','ContactId':_0x7ccca3[_0xe373('0x8a')]['id'],'AttachmentId':_0xaff46c[_0xe373('0x5e')][_0xe373('0x99')]});})['then'](function(_0xeebdb6){_0x7ccca3[_0xe373('0x28')]=_0xeebdb6;if(_0x7ccca3['interaction'][_0xe373('0x9a')]){return db[_0xe373('0x9b')]['find']({'attributes':['id',_0xe373('0x3c')],'where':{'id':_0x7ccca3[_0xe373('0x93')][_0xe373('0x9a')]}})['then'](function(_0x4c9637){if(_0x4c9637){_0x7ccca3[_0xe373('0x85')][_0xe373('0x9c')]({'id':0x0,'priority':0x0,'app':_0xe373('0x9d'),'appdata':_0x4c9637[_0xe373('0x3c')]+','+(_0x7ccca3[_0xe373('0x89')][_0xe373('0x9e')]||0xa),'interval':'*,*,*,*'});_0x7ccca3[_0xe373('0x9f')]=![];}return respondWithRpcPromise(_0xe373('0xa0'),_0xe373('0xa1'),_0x7ccca3);});}return respondWithRpcPromise(_0xe373('0xa0'),'startRouting',_0x7ccca3);})['then'](function(_0x2a2108){respondWithRpcPromise('EventManager',_0xe373('0xa2'),{'event':_0xe373('0x72'),'message':_0x2a2108},client9002);return _0x2a2108;})[_0xe373('0x20')](respondWithResult(_0x371e75,null))[_0xe373('0x2a')](handleError(_0x371e75,null));};exports['addApplications']=function(_0x366ac5,_0x46e18b){var _0x1ab2a6=_0x366ac5[_0xe373('0x65')]['id'];var _0x47cd85=_0x366ac5[_0xe373('0x5e')];var _0x24adb4=0xc8;var _0x671a06=null;return db[_0xe373('0xa3')][_0xe373('0xa4')]({'isolationLevel':db[_0xe373('0xa3')]['Transaction'][_0xe373('0xa5')][_0xe373('0xa6')]},function(_0x1417e0){return db[_0xe373('0x42')][_0xe373('0x6b')]({'where':{'id':_0x1ab2a6},'transaction':_0x1417e0})[_0xe373('0x20')](function(_0x2aa9ec){if(_0x2aa9ec){return db[_0xe373('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x1ab2a6},'transaction':_0x1417e0})[_0xe373('0x20')](function(){var _0x4f26fe=_[_0xe373('0x41')](_0x47cd85,function(_0x23066d){_0x23066d[_0xe373('0x68')]=_0x1ab2a6;return _0x23066d;});return db[_0xe373('0x83')][_0xe373('0xa7')](_0x4f26fe,{'transaction':_0x1417e0});});}else{_0x24adb4=0x194;_0x671a06=[];}});})[_0xe373('0x20')](function(){if(_0x24adb4!==0x194){return db[_0xe373('0x83')][_0xe373('0xa8')]({'where':{'OpenchannelAccountId':_0x1ab2a6},'order':_0xe373('0x87')})[_0xe373('0x20')](function(_0x1402b2){_0x671a06=_0x1402b2;});}})[_0xe373('0x2a')](function(_0x2718b9){_0x24adb4=0x1f4;logger[_0xe373('0x26')](_0x2718b9['stack']);if(_0x2718b9['name']){delete _0x2718b9[_0xe373('0x3c')];}_0x671a06=_0x2718b9;})[_0xe373('0xa9')](function(){if(_0x671a06===null){_0x46e18b[_0xe373('0x2b')](_0x24adb4);}else{if(_0x24adb4===0x1f4){_0x46e18b[_0xe373('0x2d')](_0x24adb4)[_0xe373('0x3d')](_0x671a06);}else{_0x46e18b['status'](_0x24adb4)[_0xe373('0x2e')](_0x671a06);}}});};exports[_0xe373('0xaa')]=function(_0x31b5bc,_0x23f756,_0x3eab29){var _0x22a422={};var _0x3b4fb0={};var _0x35b733;var _0xd87f3c;return db['OpenchannelAccount'][_0xe373('0x6b')]({'where':{'id':_0x31b5bc['params']['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x23f756,null))['then'](function(_0x132a7d){if(_0x132a7d){_0x35b733=_0x132a7d;_0x3b4fb0[_0xe373('0x47')]=_[_0xe373('0x48')](db[_0xe373('0x83')]['rawAttributes']);_0x3b4fb0['query']=_[_0xe373('0x48')](_0x31b5bc[_0xe373('0x49')]);_0x3b4fb0[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0x3b4fb0[_0xe373('0x47')],_0x3b4fb0[_0xe373('0x49')]);_0x22a422[_0xe373('0x4d')]=_[_0xe373('0x4b')](_0x3b4fb0[_0xe373('0x47')],qs[_0xe373('0x4c')](_0x31b5bc[_0xe373('0x49')][_0xe373('0x4c')]));_0x22a422[_0xe373('0x4d')]=_0x22a422[_0xe373('0x4d')][_0xe373('0x5b')]?_0x22a422['attributes']:_0x3b4fb0[_0xe373('0x47')];_0x22a422[_0xe373('0x4f')]=qs[_0xe373('0x50')](_0x31b5bc[_0xe373('0x49')]['sort']);_0x22a422[_0xe373('0x51')]=qs[_0xe373('0x4a')](_[_0xe373('0x52')](_0x31b5bc['query'],_0x3b4fb0['filters']));if(_0x31b5bc[_0xe373('0x49')][_0xe373('0x53')]){_0x22a422[_0xe373('0x51')]=_[_0xe373('0x54')](_0x22a422[_0xe373('0x51')],{'$or':_['map'](_0x22a422[_0xe373('0x4d')],function(_0x909ac0){var _0x256371={};_0x256371[_0x909ac0]={'$like':'%'+_0x31b5bc[_0xe373('0x49')]['filter']+'%'};return _0x256371;})});}_0x22a422=_[_0xe373('0x54')]({},_0x22a422,_0x31b5bc[_0xe373('0x56')]);return _0x35b733[_0xe373('0xaa')](_0x22a422);}})[_0xe373('0x20')](function(_0x445c5c){if(_0x445c5c){_0xd87f3c=_0x445c5c['length'];if(!_0x31b5bc['query'][_0xe373('0x70')](_0xe373('0x4e'))){_0x22a422[_0xe373('0x31')]=qs['limit'](_0x31b5bc[_0xe373('0x49')][_0xe373('0x31')]);_0x22a422[_0xe373('0x2f')]=qs[_0xe373('0x2f')](_0x31b5bc[_0xe373('0x49')][_0xe373('0x2f')]);}return _0x35b733['getApplications'](_0x22a422);}})[_0xe373('0x20')](function(_0x21a638){if(_0x21a638){return _0x21a638?{'count':_0xd87f3c,'rows':_0x21a638}:null;}})['then'](respondWithResult(_0x23f756,null))[_0xe373('0x2a')](handleError(_0x23f756,null));};exports[_0xe373('0xab')]=function(_0x514fc7,_0x1f6176,_0x5e1ab8){var _0x5a8f64={'raw':![],'where':{}};var _0x3455ed={};var _0x351590={'count':0x0,'rows':[]};return db[_0xe373('0x42')][_0xe373('0x6b')]({'where':{'id':_0x514fc7[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x1f6176,null))['then'](function(_0xa4156d){if(_0xa4156d){_0x3455ed[_0xe373('0x47')]=_['keys'](db[_0xe373('0x8f')][_0xe373('0x43')]);_0x3455ed[_0xe373('0x49')]=_[_0xe373('0x48')](_0x514fc7[_0xe373('0x49')]);_0x3455ed[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0x3455ed[_0xe373('0x47')],_0x3455ed[_0xe373('0x49')]);_0x5a8f64[_0xe373('0x4d')]=_[_0xe373('0x4b')](_0x3455ed['model'],qs['fields'](_0x514fc7['query'][_0xe373('0x4c')]));_0x5a8f64[_0xe373('0x4d')]=_0x5a8f64[_0xe373('0x4d')]['length']?_0x5a8f64[_0xe373('0x4d')]:_0x3455ed[_0xe373('0x47')];if(!_0x514fc7[_0xe373('0x49')]['hasOwnProperty'](_0xe373('0x4e'))){_0x5a8f64[_0xe373('0x31')]=qs[_0xe373('0x31')](_0x514fc7['query'][_0xe373('0x31')]);_0x5a8f64[_0xe373('0x2f')]=qs[_0xe373('0x2f')](_0x514fc7['query'][_0xe373('0x2f')]);}_0x5a8f64[_0xe373('0x4f')]=qs[_0xe373('0x50')](_0x514fc7[_0xe373('0x49')][_0xe373('0x50')]);_0x5a8f64[_0xe373('0x51')]=qs[_0xe373('0x4a')](_[_0xe373('0x52')](_0x514fc7[_0xe373('0x49')],_0x3455ed['filters']));_0x5a8f64[_0xe373('0x51')]['OpenchannelAccountId']=_0xa4156d['id'];if(_0x514fc7[_0xe373('0x49')]['filter']){_0x5a8f64['where']=_['merge'](_0x5a8f64[_0xe373('0x51')],{'$or':_['map'](_0x5a8f64[_0xe373('0x4d')],function(_0x495676){var _0x367f90={};_0x367f90[_0x495676]={'$like':'%'+_0x514fc7[_0xe373('0x49')][_0xe373('0x53')]+'%'};return _0x367f90;})});}_0x5a8f64=_['merge']({},_0x5a8f64,_0x514fc7['options']);return db[_0xe373('0x8f')]['count']({'where':_0x5a8f64[_0xe373('0x51')]})['then'](function(_0x1887fe){_0x351590['count']=_0x1887fe;if(_0x514fc7[_0xe373('0x49')][_0xe373('0x57')]){_0x5a8f64['include']=[{'model':db[_0xe373('0x74')],'as':'Contact','required':![]},{'model':db[_0xe373('0x9b')],'as':_0xe373('0xac'),'attributes':[_0xe373('0x3c'),_0xe373('0xad'),_0xe373('0xae')],'required':![]},{'model':db[_0xe373('0xaf')],'as':_0xe373('0xb0'),'attributes':['id',_0xe373('0x3c'),_0xe373('0xb1')],'where':_0x514fc7[_0xe373('0x49')][_0xe373('0xb2')]?{'id':_0x514fc7[_0xe373('0x49')][_0xe373('0xb2')]}:undefined,'required':_0x514fc7['query'][_0xe373('0xb2')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xe373('0x59')](_0x5a8f64);})[_0xe373('0x20')](function(_0x495cfd){_0x351590['rows']=_0x495cfd;return _0x351590;});}})[_0xe373('0x20')](respondWithFilteredResult(_0x1f6176,_0x5a8f64))[_0xe373('0x2a')](handleError(_0x1f6176,null));};exports[_0xe373('0xb3')]=function(_0xfcbf50,_0x1e0b3d,_0x24ae4c){return db[_0xe373('0x42')]['find']({'where':{'id':_0xfcbf50['params']['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x1e0b3d,null))['then'](function(_0x30985b){if(_0x30985b){return _0x30985b[_0xe373('0xb3')](_0xfcbf50['body'][_0xe373('0x6d')],_[_0xe373('0xb4')](_0xfcbf50[_0xe373('0x5e')],[_0xe373('0x6d'),'id'])||{})[_0xe373('0x91')](function(_0x5250aa){for(var _0x1ce2cc=0x0;_0x1ce2cc<_0xfcbf50[_0xe373('0x5e')][_0xe373('0x6d')][_0xe373('0x5b')];_0x1ce2cc+=0x1){socket[_0xe373('0xb5')](_0xe373('0xb6'),{'UserId':Number(_0xfcbf50[_0xe373('0x5e')][_0xe373('0x6d')][_0x1ce2cc]),'OpenchannelAccountId':Number(_0xfcbf50[_0xe373('0x65')]['id'])});}return _0x5250aa;});}})[_0xe373('0x20')](respondWithResult(_0x1e0b3d,null))['catch'](handleError(_0x1e0b3d,null));};exports[_0xe373('0xb7')]=function(_0x406aea,_0x267ef3,_0x30667f){return db['OpenchannelAccount'][_0xe373('0x5c')]({'where':{'id':_0x406aea[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0x267ef3,null))[_0xe373('0x20')](function(_0x2a3f5f){if(_0x2a3f5f){return _0x2a3f5f[_0xe373('0xb7')](_0x406aea[_0xe373('0x49')][_0xe373('0x6d')])[_0xe373('0x20')](function(){if(_['isArray'](_0x406aea[_0xe373('0x49')][_0xe373('0x6d')])){for(var _0x1fd04a=0x0;_0x1fd04a<_0x406aea['query'][_0xe373('0x6d')]['length'];_0x1fd04a+=0x1){socket[_0xe373('0xb5')](_0xe373('0xb8'),{'UserId':Number(_0x406aea[_0xe373('0x49')][_0xe373('0x6d')][_0x1fd04a]),'OpenchannelAccountId':Number(_0x406aea[_0xe373('0x65')]['id'])});}}else{socket[_0xe373('0xb5')](_0xe373('0xb8'),{'UserId':Number(_0x406aea[_0xe373('0x49')]['ids']),'OpenchannelAccountId':Number(_0x406aea['params']['id'])});}});}})['then'](respondWithStatusCode(_0x267ef3,null))[_0xe373('0x2a')](handleError(_0x267ef3,null));};exports[_0xe373('0xb9')]=function(_0x382a24,_0xd73f97,_0x423ae2){var _0x13f65d={};var _0x3138e0={};var _0x3a1bbe;var _0x2b08b5;return db[_0xe373('0x42')]['findOne']({'where':{'id':_0x382a24[_0xe373('0x65')]['id']}})[_0xe373('0x20')](handleEntityNotFound(_0xd73f97,null))['then'](function(_0x31c140){if(_0x31c140){_0x3a1bbe=_0x31c140;_0x3138e0[_0xe373('0x47')]=_[_0xe373('0x48')](db[_0xe373('0x9b')][_0xe373('0x43')]);_0x3138e0[_0xe373('0x49')]=_['keys'](_0x382a24[_0xe373('0x49')]);_0x3138e0[_0xe373('0x4a')]=_[_0xe373('0x4b')](_0x3138e0[_0xe373('0x47')],_0x3138e0[_0xe373('0x49')]);_0x13f65d[_0xe373('0x4d')]=_['intersection'](_0x3138e0['model'],qs[_0xe373('0x4c')](_0x382a24['query']['fields']));_0x13f65d[_0xe373('0x4d')]=_0x13f65d['attributes']['length']?_0x13f65d[_0xe373('0x4d')]:_0x3138e0[_0xe373('0x47')];_0x13f65d['order']=qs[_0xe373('0x50')](_0x382a24[_0xe373('0x49')][_0xe373('0x50')]);_0x13f65d[_0xe373('0x51')]=qs['filters'](_[_0xe373('0x52')](_0x382a24[_0xe373('0x49')],_0x3138e0['filters']));if(_0x382a24[_0xe373('0x49')][_0xe373('0x53')]){_0x13f65d[_0xe373('0x51')]=_[_0xe373('0x54')](_0x13f65d['where'],{'$or':_['map'](_0x13f65d[_0xe373('0x4d')],function(_0x482372){var _0x1a5a32={};_0x1a5a32[_0x482372]={'$like':'%'+_0x382a24[_0xe373('0x49')]['filter']+'%'};return _0x1a5a32;})});}_0x13f65d=_['merge']({},_0x13f65d,_0x382a24[_0xe373('0x56')]);return _0x3a1bbe[_0xe373('0xb9')](_0x13f65d);}})[_0xe373('0x20')](function(_0x1cdb27){if(_0x1cdb27){_0x2b08b5=_0x1cdb27['length'];if(!_0x382a24['query']['hasOwnProperty'](_0xe373('0x4e'))){_0x13f65d[_0xe373('0x31')]=qs['limit'](_0x382a24[_0xe373('0x49')]['limit']);_0x13f65d[_0xe373('0x2f')]=qs['offset'](_0x382a24[_0xe373('0x49')]['offset']);}return _0x3a1bbe[_0xe373('0xb9')](_0x13f65d);}})[_0xe373('0x20')](function(_0x1b32a5){if(_0x1b32a5){return _0x1b32a5?{'count':_0x2b08b5,'rows':_0x1b32a5}:null;}})['then'](respondWithResult(_0xd73f97,null))[_0xe373('0x2a')](handleError(_0xd73f97,null));};exports[_0xe373('0x3d')]=function(_0xb60b47,_0x2d0201,_0x164711){var _0x2e4ccb,_0x3a82ae,_0x55a1aa;if(_[_0xe373('0x7a')](_0xb60b47[_0xe373('0x5e')][_0xe373('0x5e')])||_0xb60b47[_0xe373('0x5e')]['body']===''){throw new db[(_0xe373('0x75'))][(_0xe373('0x76'))](_0xe373('0x7b'));}if(_[_0xe373('0x7a')](_0xb60b47[_0xe373('0x5e')]['to'])){}_0x2e4ccb=_0xb60b47[_0xe373('0x5e')]['to'];return db[_0xe373('0x42')][_0xe373('0x6b')]({'where':{'id':_0xb60b47[_0xe373('0x65')]['id']}})['then'](handleEntityNotFound(_0x2d0201,null))[_0xe373('0x20')](function(_0x4cf530){if(_0x4cf530){return db[_0xe373('0x42')][_0xe373('0x5c')]({'where':{'id':_0x4cf530['id']},'include':[{'model':db[_0xe373('0x80')],'as':_0xe373('0x84'),'include':[{'model':db[_0xe373('0x74')],'as':_0xe373('0x81'),'where':{[_0x4cf530[_0xe373('0x7e')]]:_0x2e4ccb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xe373('0x20')](handleEntityNotFound(_0x2d0201,null))[_0xe373('0x20')](function(_0x2ae3b6){if(_0x2ae3b6&&_0x2ae3b6['List']){_0x3a82ae=_0x2ae3b6[_0xe373('0x38')]({'plain':!![]});if(_0x3a82ae[_0xe373('0x84')]&&_0x3a82ae[_0xe373('0x84')]['Contacts'][_0xe373('0x5b')]){return _0x3a82ae['List']['Contacts'][0x0];}return db[_0xe373('0x74')]['create'](_[_0xe373('0x17')](_0xb60b47[_0xe373('0x5e')],{'firstName':_0x2e4ccb,[_0x2ae3b6[_0xe373('0x7e')]]:_0x2e4ccb,'phone':_0x2e4ccb,'ListId':_0x3a82ae[_0xe373('0xba')]}));}})[_0xe373('0x20')](handleEntityNotFound(_0x2d0201,null))[_0xe373('0x20')](function(_0x12160f){if(_0x12160f){_0x55a1aa=_0x12160f;return db[_0xe373('0x8f')][_0xe373('0x5c')]({'where':{'ContactId':_0x55a1aa['id'],'closed':![],'OpenchannelAccountId':_0x3a82ae['id']}})['then'](function(_0x5448dd){if(_0x5448dd){return[_0x5448dd,![]];}return db[_0xe373('0x8f')][_0xe373('0x5d')]({'UserId':_0xb60b47[_0xe373('0x5f')]['id'],'ContactId':_0x55a1aa['id'],'OpenchannelAccountId':_0x3a82ae['id'],'lastMsgDirection':'out','Messages':[_[_0xe373('0x54')](_0xb60b47[_0xe373('0x5e')],{'read':![],'body':_0xb60b47[_0xe373('0x5e')]['body'],'OpenchannelAccountId':_0x3a82ae['id'],'UserId':_0xb60b47[_0xe373('0x5f')]['id'],'ContactId':_0x55a1aa['id']})]},{'include':[{'model':db[_0xe373('0x98')],'as':_0xe373('0xbb')}]})[_0xe373('0x20')](function(_0x2b36bb){return[_0x2b36bb,!![]];});});}})[_0xe373('0x91')](function(_0xb7c8cb,_0x5d5a3b){if(_0x5d5a3b){return _0xb7c8cb;}return db[_0xe373('0x98')][_0xe373('0x5d')](_['merge'](_0xb60b47['body'],{'read':![],'body':_0xb60b47[_0xe373('0x5e')]['body'],'OpenchannelAccountId':_0x3a82ae['id'],'OpenchannelInteractionId':_0xb7c8cb['id'],'UserId':_0xb60b47[_0xe373('0x5f')]['id'],'ContactId':_0x55a1aa['id']}))[_0xe373('0x20')](function(_0x2f3aa7){_0xb7c8cb[_0xe373('0xbc')][_0xe373('0xbb')]=[];_0xb7c8cb['dataValues']['Messages']['push'](_0x2f3aa7[_0xe373('0xbc')]);return _0xb7c8cb;});});}})['then'](respondWithResult(_0x2d0201,null))[_0xe373('0x2a')](handleError(_0x2d0201,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c4f4a43..164da67 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 _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4c2af3,_0x22da9e){var _0xa64bbf=function(_0x1855d0){while(--_0x1855d0){_0x4c2af3['push'](_0x4c2af3['shift']());}};_0xa64bbf(++_0x22da9e);}(_0xf109,0xce));var _0x9f10=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf109[_0x101e7b];return _0x4995c0;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb821=['OpenchannelAccount','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x234a92,_0x38e87a){var _0x39b77f=function(_0x54180d){while(--_0x54180d){_0x234a92['push'](_0x234a92['shift']());}};_0x39b77f(++_0x38e87a);}(_0xb821,0xa7));var _0x1b82=function(_0xc71a2,_0x23b0f9){_0xc71a2=_0xc71a2-0x0;var _0x1307b8=_0xb821[_0xc71a2];return _0x1307b8;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x1b82('0x0'))['db'][_0x1b82('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b82('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4b1809){return function(_0x3b1d14,_0x1403ab,_0x3fadf0){OpenchannelAccountEvents[_0x1b82('0x3')](_0x4b1809+':'+_0x3b1d14['id'],_0x3b1d14);OpenchannelAccountEvents['emit'](_0x4b1809,_0x3b1d14);_0x3fadf0(null);};}for(var e in events){if(events[_0x1b82('0x4')](e)){var event=events[e];OpenchannelAccount[_0x1b82('0x5')](e,emitEvent(event));}}module[_0x1b82('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 3e8412e..56400e8 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(_0x36d1a2,_0x98c75d){var _0x50b5fe=function(_0x45ecd6){while(--_0x45ecd6){_0x36d1a2['push'](_0x36d1a2['shift']());}};_0x50b5fe(++_0x98c75d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x3172ad,_0x52336b){var _0x5b91d5=function(_0x4bd6b7){while(--_0x4bd6b7){_0x3172ad['push'](_0x3172ad['shift']());}};_0x5b91d5(++_0x52336b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 6c789e0..81a5182 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 _0x23a3=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x567f40,_0x13292d){var _0x37a941=function(_0x11f2e5){while(--_0x11f2e5){_0x567f40['push'](_0x567f40['shift']());}};_0x37a941(++_0x13292d);}(_0x23a3,0x131));var _0x323a=function(_0x258c13,_0x2680e8){_0x258c13=_0x258c13-0x0;var _0x106325=_0x23a3[_0x258c13];return _0x106325;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x323a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x323a('0x1'));var db=require(_0x323a('0x2'))['db'];var utils=require(_0x323a('0x3'));var logger=require(_0x323a('0x4'))(_0x323a('0x5'));var config=require(_0x323a('0x6'));var jayson=require(_0x323a('0x7'));var client=jayson[_0x323a('0x8')][_0x323a('0x9')]({'port':0x232a});config['redis']=_[_0x323a('0xa')](config[_0x323a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x323a('0xc'))(new Redis(config[_0x323a('0xb')]));require(_0x323a('0xd'))['register'](socket);function respondWithRpcPromise(_0x27d081,_0x11f2e5,_0xbdb43f){return new BPromise(function(_0x3e0e0b,_0x1b3d13){return client[_0x323a('0xe')](_0x27d081,_0xbdb43f)[_0x323a('0xf')](function(_0x2cea45){logger[_0x323a('0x10')](_0x323a('0x11'),_0x11f2e5,_0x323a('0x12'));logger[_0x323a('0x13')](_0x323a('0x14'),_0x11f2e5,_0x323a('0x12'),JSON['stringify'](_0x2cea45));if(_0x2cea45[_0x323a('0x15')]){if(_0x2cea45['error'][_0x323a('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x11f2e5,_0x2cea45[_0x323a('0x15')]['message']);return _0x1b3d13(_0x2cea45[_0x323a('0x15')]['message']);}logger[_0x323a('0x15')](_0x323a('0x11'),_0x11f2e5,_0x2cea45['error'][_0x323a('0x17')]);return _0x3e0e0b(_0x2cea45[_0x323a('0x15')]['message']);}else{logger['info'](_0x323a('0x11'),_0x11f2e5,_0x323a('0x12'));_0x3e0e0b(_0x2cea45[_0x323a('0x18')][_0x323a('0x17')]);}})[_0x323a('0x19')](function(_0x2cad9b){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x11f2e5,_0x2cad9b);_0x1b3d13(_0x2cad9b);});});} \ No newline at end of file +var _0xc901=['info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register'];(function(_0x22dc2c,_0x46751a){var _0x4901ec=function(_0x2bc7ed){while(--_0x2bc7ed){_0x22dc2c['push'](_0x22dc2c['shift']());}};_0x4901ec(++_0x46751a);}(_0xc901,0x142));var _0x1c90=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc901[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});config[_0x1c90('0x9')]=_[_0x1c90('0xa')](config[_0x1c90('0x9')],{'host':_0x1c90('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c90('0x9')]));require(_0x1c90('0xc'))[_0x1c90('0xd')](socket);function respondWithRpcPromise(_0x1f2c61,_0x374852,_0x66c02){return new BPromise(function(_0x616ad0,_0x3890e1){return client['request'](_0x1f2c61,_0x66c02)['then'](function(_0x17d8ae){logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x374852,'request\x20sent');logger['debug'](_0x1c90('0x10'),_0x374852,_0x1c90('0x11'),JSON['stringify'](_0x17d8ae));if(_0x17d8ae[_0x1c90('0x12')]){if(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x13')]===0x1f4){logger['error'](_0x1c90('0xf'),_0x374852,_0x17d8ae['error'][_0x1c90('0x14')]);return _0x3890e1(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}logger[_0x1c90('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x374852,_0x17d8ae[_0x1c90('0x12')]['message']);return _0x616ad0(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}else{logger['info'](_0x1c90('0xf'),_0x374852,'request\x20sent');_0x616ad0(_0x17d8ae['result'][_0x1c90('0x14')]);}})['catch'](function(_0x341228){logger[_0x1c90('0x12')](_0x1c90('0xf'),_0x374852,_0x341228);_0x3890e1(_0x341228);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9d1bf4f..2d6fb6b 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 _0x6324=['./openchannelAccount.events','save','remove','update','emit','register','openchannelAccount:'];(function(_0x324b32,_0x575294){var _0x42d89a=function(_0x59d65c){while(--_0x59d65c){_0x324b32['push'](_0x324b32['shift']());}};_0x42d89a(++_0x575294);}(_0x6324,0x142));var _0x4632=function(_0x778a34,_0xb4f3d3){_0x778a34=_0x778a34-0x0;var _0x4b956f=_0x6324[_0x778a34];return _0x4b956f;};'use strict';var OpenchannelAccountEvents=require(_0x4632('0x0'));var events=[_0x4632('0x1'),_0x4632('0x2'),_0x4632('0x3')];function createListener(_0x551054,_0x1805c5){return function(_0x48e508){_0x1805c5[_0x4632('0x4')](_0x551054,_0x48e508);};}function removeListener(_0x54c200,_0x13b218){return function(){OpenchannelAccountEvents['removeListener'](_0x54c200,_0x13b218);};}exports[_0x4632('0x5')]=function(_0x24aba6){for(var _0x1f3077=0x0,_0x126e9a=events['length'];_0x1f3077<_0x126e9a;_0x1f3077++){var _0x17e860=events[_0x1f3077];var _0x44dd6d=createListener(_0x4632('0x6')+_0x17e860,_0x24aba6);OpenchannelAccountEvents['on'](_0x17e860,_0x44dd6d);}}; \ No newline at end of file +var _0xf81a=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf81a,0x16b));var _0xaf81=function(_0x82b070,_0x1d0040){_0x82b070=_0x82b070-0x0;var _0x437cea=_0xf81a[_0x82b070];return _0x437cea;};'use strict';var OpenchannelAccountEvents=require(_0xaf81('0x0'));var events=[_0xaf81('0x1'),_0xaf81('0x2'),'update'];function createListener(_0x3f40f1,_0x3692c7){return function(_0x285b5b){_0x3692c7['emit'](_0x3f40f1,_0x285b5b);};}function removeListener(_0x4590d4,_0x398bb6){return function(){OpenchannelAccountEvents['removeListener'](_0x4590d4,_0x398bb6);};}exports[_0xaf81('0x3')]=function(_0x3c4f98){for(var _0x1c89dd=0x0,_0x5cfd36=events[_0xaf81('0x4')];_0x1c89dd<_0x5cfd36;_0x1c89dd++){var _0x365b31=events[_0x1c89dd];var _0x4c3052=createListener(_0xaf81('0x5')+_0x365b31,_0x3c4f98);OpenchannelAccountEvents['on'](_0x365b31,_0x4c3052);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 67d45d7..66748f8 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 _0x77ff=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x1fd5eb,_0x235203){var _0x102365=function(_0x54de1f){while(--_0x54de1f){_0x1fd5eb['push'](_0x1fd5eb['shift']());}};_0x102365(++_0x235203);}(_0x77ff,0x169));var _0xf77f=function(_0x526f25,_0x3f15dd){_0x526f25=_0x526f25-0x0;var _0xfbe7de=_0x77ff[_0x526f25];return _0xfbe7de;};'use strict';var multer=require(_0xf77f('0x0'));var util=require(_0xf77f('0x1'));var path=require(_0xf77f('0x2'));var timeout=require(_0xf77f('0x3'));var express=require('express');var router=express[_0xf77f('0x4')]();var fs_extra=require(_0xf77f('0x5'));var auth=require(_0xf77f('0x6'));var interaction=require(_0xf77f('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0xf77f('0x8')](),controller[_0xf77f('0x9')]);router[_0xf77f('0xa')](_0xf77f('0xb'),auth[_0xf77f('0x8')](),controller[_0xf77f('0xc')]);router[_0xf77f('0xd')]('/',auth[_0xf77f('0x8')](),controller[_0xf77f('0xe')]);router[_0xf77f('0xf')](_0xf77f('0xb'),auth[_0xf77f('0x8')](),controller['update']);router[_0xf77f('0x10')](_0xf77f('0xb'),auth['isAuthenticated'](),controller[_0xf77f('0x11')]);module[_0xf77f('0x12')]=router; \ No newline at end of file +var _0x99a7=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x99a7,0x72));var _0x799a=function(_0x2bb0d9,_0x1fa51c){_0x2bb0d9=_0x2bb0d9-0x0;var _0x43fe14=_0x99a7[_0x2bb0d9];return _0x43fe14;};'use strict';var multer=require('multer');var util=require(_0x799a('0x0'));var path=require(_0x799a('0x1'));var timeout=require(_0x799a('0x2'));var express=require(_0x799a('0x3'));var router=express[_0x799a('0x4')]();var fs_extra=require(_0x799a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x799a('0x6'));var config=require(_0x799a('0x7'));var controller=require(_0x799a('0x8'));router[_0x799a('0x9')]('/',auth[_0x799a('0xa')](),controller[_0x799a('0xb')]);router[_0x799a('0x9')]('/:id',auth[_0x799a('0xa')](),controller['show']);router[_0x799a('0xc')]('/',auth[_0x799a('0xa')](),controller[_0x799a('0xd')]);router[_0x799a('0xe')](_0x799a('0xf'),auth[_0x799a('0xa')](),controller[_0x799a('0x10')]);router[_0x799a('0x11')](_0x799a('0xf'),auth[_0x799a('0xa')](),controller[_0x799a('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 cde7999..4e7e4e1 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 _0x47a2=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x42c96b,_0xeba7de){var _0x38e61a=function(_0x4b6582){while(--_0x4b6582){_0x42c96b['push'](_0x42c96b['shift']());}};_0x38e61a(++_0xeba7de);}(_0x47a2,0x169));var _0x247a=function(_0x1819eb,_0x5a3a47){_0x1819eb=_0x1819eb-0x0;var _0x49a985=_0x47a2[_0x1819eb];return _0x49a985;};'use strict';var Sequelize=require(_0x247a('0x0'));module[_0x247a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x247a('0x2')],'allowNull':![],'defaultValue':_0x247a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x247a('0x2')]},'interval':{'type':Sequelize[_0x247a('0x2')],'defaultValue':_0x247a('0x4')}}; \ No newline at end of file +var _0x54ad=['*,*,*,*','exports','noop','TEXT','STRING'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x54ad,0xdd));var _0xd54a=function(_0x5d4b6b,_0xdfd1e9){_0x5d4b6b=_0x5d4b6b-0x0;var _0xc4f9b3=_0x54ad[_0x5d4b6b];return _0xc4f9b3;};'use strict';var Sequelize=require('sequelize');module[_0xd54a('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd54a('0x1')},'appdata':{'type':Sequelize[_0xd54a('0x2')]()},'description':{'type':Sequelize[_0xd54a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd54a('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 7070209..1c87339 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 _0xb33b=['../../config/environment','../../config/license/util','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','OpenchannelApplication','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll','catch','show','params','rawAttributes','options','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xc13030,_0x2fb58d){var _0x1c2dff=function(_0x40c288){while(--_0x40c288){_0xc13030['push'](_0xc13030['shift']());}};_0x1c2dff(++_0x2fb58d);}(_0xb33b,0x77));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbb33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb33('0x1'));var jsonpatch=require(_0xbb33('0x2'));var rp=require(_0xbb33('0x3'));var moment=require('moment');var BPromise=require(_0xbb33('0x4'));var Mustache=require(_0xbb33('0x5'));var util=require(_0xbb33('0x6'));var path=require(_0xbb33('0x7'));var sox=require('sox');var csv=require(_0xbb33('0x8'));var ejs=require(_0xbb33('0x9'));var fs=require('fs');var fs_extra=require(_0xbb33('0xa'));var _=require(_0xbb33('0xb'));var squel=require(_0xbb33('0xc'));var crypto=require('crypto');var jsforce=require(_0xbb33('0xd'));var deskjs=require(_0xbb33('0xe'));var toCsv=require(_0xbb33('0x8'));var querystring=require(_0xbb33('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb33('0x10'));var qs=require(_0xbb33('0x11'));var as=require(_0xbb33('0x12'));var hardwareService=require(_0xbb33('0x13'));var logger=require(_0xbb33('0x14'))(_0xbb33('0x15'));var utils=require(_0xbb33('0x16'));var config=require(_0xbb33('0x17'));var licenseUtil=require(_0xbb33('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dc25d,_0x198f8e){_0x198f8e=_0x198f8e||0xcc;return function(_0x1b730d){if(_0x1b730d){return _0x4dc25d[_0xbb33('0x19')](_0x198f8e);}return _0x4dc25d[_0xbb33('0x1a')](_0x198f8e)['end']();};}function respondWithResult(_0x1ff4aa,_0x3bb9c0){_0x3bb9c0=_0x3bb9c0||0xc8;return function(_0x4cfc32){if(_0x4cfc32){return _0x1ff4aa['status'](_0x3bb9c0)[_0xbb33('0x1b')](_0x4cfc32);}};}function respondWithFilteredResult(_0x215135,_0x2b55ca){return function(_0x100fcc){if(_0x100fcc){var _0x52aee8=typeof _0x2b55ca['offset']===_0xbb33('0x1c')&&typeof _0x2b55ca['limit']==='undefined';var _0x51a9b1=_0x100fcc['count'];var _0x12074a=_0x52aee8?0x0:_0x2b55ca[_0xbb33('0x1d')];var _0x560cb7=_0x52aee8?_0x100fcc['count']:_0x2b55ca[_0xbb33('0x1d')]+_0x2b55ca[_0xbb33('0x1e')];var _0x281067;if(_0x560cb7>=_0x51a9b1){_0x560cb7=_0x51a9b1;_0x281067=0xc8;}else{_0x281067=0xce;}_0x215135['status'](_0x281067);return _0x215135[_0xbb33('0x1f')](_0xbb33('0x20'),_0x12074a+'-'+_0x560cb7+'/'+_0x51a9b1)[_0xbb33('0x1b')](_0x100fcc);}return null;};}function patchUpdates(_0x1bd5be){return function(_0x3be52a){try{jsonpatch[_0xbb33('0x21')](_0x3be52a,_0x1bd5be,!![]);}catch(_0x2f0254){return BPromise[_0xbb33('0x22')](_0x2f0254);}return _0x3be52a['save']();};}function saveUpdates(_0x580636,_0x29636e){return function(_0x1e45f1){if(_0x1e45f1){return _0x1e45f1[_0xbb33('0x23')](_0x580636)['then'](function(_0x530017){return _0x530017;});}return null;};}function removeEntity(_0x11e1f5,_0x2b95df){return function(_0x568897){if(_0x568897){return _0x568897['destroy']()[_0xbb33('0x24')](function(){_0x11e1f5[_0xbb33('0x1a')](0xcc)[_0xbb33('0x25')]();});}};}function handleEntityNotFound(_0x153b13,_0x570909){return function(_0x3af929){if(!_0x3af929){_0x153b13['sendStatus'](0x194);}return _0x3af929;};}function handleError(_0x5e5254,_0x432fd1){_0x432fd1=_0x432fd1||0x1f4;return function(_0xfaf838){logger['error'](_0xfaf838[_0xbb33('0x26')]);if(_0xfaf838[_0xbb33('0x27')]){delete _0xfaf838['name'];}_0x5e5254[_0xbb33('0x1a')](_0x432fd1)[_0xbb33('0x28')](_0xfaf838);};}exports[_0xbb33('0x29')]=function(_0x3ecc3f,_0x2a69ed){var _0x45c781={},_0x3fa8d0={},_0x49dcfd={'count':0x0,'rows':[]};var _0x41dc70=_[_0xbb33('0x2a')](db[_0xbb33('0x2b')]['rawAttributes'],function(_0x3d2146){return{'name':_0x3d2146['fieldName'],'type':_0x3d2146[_0xbb33('0x2c')][_0xbb33('0x2d')]};});_0x3fa8d0['model']=_[_0xbb33('0x2a')](_0x41dc70,'name');_0x3fa8d0[_0xbb33('0x2e')]=_[_0xbb33('0x2f')](_0x3ecc3f[_0xbb33('0x2e')]);_0x3fa8d0[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0x3fa8d0[_0xbb33('0x32')],_0x3fa8d0[_0xbb33('0x2e')]);_0x45c781['attributes']=_[_0xbb33('0x31')](_0x3fa8d0[_0xbb33('0x32')],qs[_0xbb33('0x33')](_0x3ecc3f[_0xbb33('0x2e')][_0xbb33('0x33')]));_0x45c781[_0xbb33('0x34')]=_0x45c781[_0xbb33('0x34')][_0xbb33('0x35')]?_0x45c781[_0xbb33('0x34')]:_0x3fa8d0[_0xbb33('0x32')];if(!_0x3ecc3f['query']['hasOwnProperty'](_0xbb33('0x36'))){_0x45c781['limit']=qs['limit'](_0x3ecc3f[_0xbb33('0x2e')][_0xbb33('0x1e')]);_0x45c781['offset']=qs['offset'](_0x3ecc3f[_0xbb33('0x2e')]['offset']);}_0x45c781['order']=qs['sort'](_0x3ecc3f['query']['sort']);_0x45c781['where']=qs[_0xbb33('0x30')](_[_0xbb33('0x37')](_0x3ecc3f['query'],_0x3fa8d0[_0xbb33('0x30')]),_0x41dc70);if(_0x3ecc3f[_0xbb33('0x2e')][_0xbb33('0x38')]){_0x45c781[_0xbb33('0x39')]=_[_0xbb33('0x3a')](_0x45c781[_0xbb33('0x39')],{'$or':_[_0xbb33('0x2a')](_0x41dc70,function(_0x511348){if(_0x511348['type']!==_0xbb33('0x3b')){var _0x1824ee={};_0x1824ee[_0x511348['name']]={'$like':'%'+_0x3ecc3f[_0xbb33('0x2e')][_0xbb33('0x38')]+'%'};return _0x1824ee;}})});}_0x45c781=_[_0xbb33('0x3a')]({},_0x45c781,_0x3ecc3f['options']);var _0x17e5de={'where':_0x45c781[_0xbb33('0x39')]};return db[_0xbb33('0x2b')]['count'](_0x17e5de)[_0xbb33('0x24')](function(_0x1f6bb0){_0x49dcfd[_0xbb33('0x3c')]=_0x1f6bb0;if(_0x3ecc3f['query'][_0xbb33('0x3d')]){_0x45c781['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xbb33('0x3e')](_0x45c781);})[_0xbb33('0x24')](function(_0x1fe30b){_0x49dcfd['rows']=_0x1fe30b;return _0x49dcfd;})['then'](respondWithFilteredResult(_0x2a69ed,_0x45c781))[_0xbb33('0x3f')](handleError(_0x2a69ed,null));};exports[_0xbb33('0x40')]=function(_0x521f3d,_0xfef003){var _0x2ccf5c={'raw':!![],'where':{'id':_0x521f3d[_0xbb33('0x41')]['id']}},_0x49734b={};_0x49734b['model']=_[_0xbb33('0x2f')](db[_0xbb33('0x2b')][_0xbb33('0x42')]);_0x49734b[_0xbb33('0x2e')]=_['keys'](_0x521f3d[_0xbb33('0x2e')]);_0x49734b[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0x49734b[_0xbb33('0x32')],_0x49734b['query']);_0x2ccf5c['attributes']=_[_0xbb33('0x31')](_0x49734b[_0xbb33('0x32')],qs[_0xbb33('0x33')](_0x521f3d[_0xbb33('0x2e')]['fields']));_0x2ccf5c[_0xbb33('0x34')]=_0x2ccf5c['attributes'][_0xbb33('0x35')]?_0x2ccf5c[_0xbb33('0x34')]:_0x49734b[_0xbb33('0x32')];if(_0x521f3d[_0xbb33('0x2e')]['includeAll']){_0x2ccf5c['include']=[{'all':!![]}];}_0x2ccf5c=_[_0xbb33('0x3a')]({},_0x2ccf5c,_0x521f3d[_0xbb33('0x43')]);return db[_0xbb33('0x2b')]['find'](_0x2ccf5c)[_0xbb33('0x24')](handleEntityNotFound(_0xfef003,null))[_0xbb33('0x24')](respondWithResult(_0xfef003,null))[_0xbb33('0x3f')](handleError(_0xfef003,null));};exports[_0xbb33('0x44')]=function(_0x147077,_0x35958f){return db[_0xbb33('0x2b')][_0xbb33('0x44')](_0x147077['body'],{})[_0xbb33('0x24')](respondWithResult(_0x35958f,0xc9))[_0xbb33('0x3f')](handleError(_0x35958f,null));};exports[_0xbb33('0x23')]=function(_0x10f726,_0x1fd166){if(_0x10f726[_0xbb33('0x45')]['id']){delete _0x10f726[_0xbb33('0x45')]['id'];}return db[_0xbb33('0x2b')][_0xbb33('0x46')]({'where':{'id':_0x10f726['params']['id']}})['then'](handleEntityNotFound(_0x1fd166,null))[_0xbb33('0x24')](saveUpdates(_0x10f726[_0xbb33('0x45')],null))[_0xbb33('0x24')](respondWithResult(_0x1fd166,null))[_0xbb33('0x3f')](handleError(_0x1fd166,null));};exports['destroy']=function(_0x1e2c74,_0x4e0a89){return db['OpenchannelApplication'][_0xbb33('0x46')]({'where':{'id':_0x1e2c74['params']['id']}})[_0xbb33('0x24')](handleEntityNotFound(_0x4e0a89,null))[_0xbb33('0x24')](removeEntity(_0x4e0a89,null))[_0xbb33('0x3f')](handleError(_0x4e0a89,null));}; \ No newline at end of file +var _0x1ca2=['crypto','jsforce','desk.js','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','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x10bee2,_0x52ffae){var _0x55a892=function(_0x437087){while(--_0x437087){_0x10bee2['push'](_0x10bee2['shift']());}};_0x55a892(++_0x52ffae);}(_0x1ca2,0xdb));var _0x21ca=function(_0x5f51d2,_0x4f0133){_0x5f51d2=_0x5f51d2-0x0;var _0x24bf08=_0x1ca2[_0x5f51d2];return _0x24bf08;};'use strict';var emlformat=require(_0x21ca('0x0'));var rimraf=require(_0x21ca('0x1'));var zipdir=require(_0x21ca('0x2'));var jsonpatch=require(_0x21ca('0x3'));var rp=require(_0x21ca('0x4'));var moment=require('moment');var BPromise=require(_0x21ca('0x5'));var Mustache=require(_0x21ca('0x6'));var util=require(_0x21ca('0x7'));var path=require(_0x21ca('0x8'));var sox=require(_0x21ca('0x9'));var csv=require(_0x21ca('0xa'));var ejs=require(_0x21ca('0xb'));var fs=require('fs');var fs_extra=require(_0x21ca('0xc'));var _=require(_0x21ca('0xd'));var squel=require(_0x21ca('0xe'));var crypto=require(_0x21ca('0xf'));var jsforce=require(_0x21ca('0x10'));var deskjs=require(_0x21ca('0x11'));var toCsv=require(_0x21ca('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x21ca('0x12'));var authService=require(_0x21ca('0x13'));var qs=require(_0x21ca('0x14'));var as=require(_0x21ca('0x15'));var hardwareService=require(_0x21ca('0x16'));var logger=require('../../config/logger')(_0x21ca('0x17'));var utils=require('../../config/utils');var config=require(_0x21ca('0x18'));var licenseUtil=require(_0x21ca('0x19'));var db=require(_0x21ca('0x1a'))['db'];function respondWithStatusCode(_0x490515,_0x16f9e7){_0x16f9e7=_0x16f9e7||0xcc;return function(_0x477e95){if(_0x477e95){return _0x490515[_0x21ca('0x1b')](_0x16f9e7);}return _0x490515[_0x21ca('0x1c')](_0x16f9e7)[_0x21ca('0x1d')]();};}function respondWithResult(_0x540b83,_0x52f8f9){_0x52f8f9=_0x52f8f9||0xc8;return function(_0xb4ab32){if(_0xb4ab32){return _0x540b83[_0x21ca('0x1c')](_0x52f8f9)[_0x21ca('0x1e')](_0xb4ab32);}};}function respondWithFilteredResult(_0x3d10d0,_0x44c273){return function(_0x139442){if(_0x139442){var _0x13a5a0=typeof _0x44c273[_0x21ca('0x1f')]===_0x21ca('0x20')&&typeof _0x44c273[_0x21ca('0x21')]===_0x21ca('0x20');var _0x1383d7=_0x139442[_0x21ca('0x22')];var _0x5e675a=_0x13a5a0?0x0:_0x44c273[_0x21ca('0x1f')];var _0x23ea67=_0x13a5a0?_0x139442['count']:_0x44c273[_0x21ca('0x1f')]+_0x44c273['limit'];var _0x4f8448;if(_0x23ea67>=_0x1383d7){_0x23ea67=_0x1383d7;_0x4f8448=0xc8;}else{_0x4f8448=0xce;}_0x3d10d0[_0x21ca('0x1c')](_0x4f8448);return _0x3d10d0[_0x21ca('0x23')]('Content-Range',_0x5e675a+'-'+_0x23ea67+'/'+_0x1383d7)[_0x21ca('0x1e')](_0x139442);}return null;};}function patchUpdates(_0x14d53e){return function(_0x33c3f2){try{jsonpatch[_0x21ca('0x24')](_0x33c3f2,_0x14d53e,!![]);}catch(_0x223afa){return BPromise[_0x21ca('0x25')](_0x223afa);}return _0x33c3f2[_0x21ca('0x26')]();};}function saveUpdates(_0x57253e,_0x222667){return function(_0x3804e8){if(_0x3804e8){return _0x3804e8[_0x21ca('0x27')](_0x57253e)[_0x21ca('0x28')](function(_0x486f69){return _0x486f69;});}return null;};}function removeEntity(_0x2adb0f,_0x5b0298){return function(_0x2c09c4){if(_0x2c09c4){return _0x2c09c4[_0x21ca('0x29')]()[_0x21ca('0x28')](function(){_0x2adb0f[_0x21ca('0x1c')](0xcc)[_0x21ca('0x1d')]();});}};}function handleEntityNotFound(_0x41b1b1,_0xbbb721){return function(_0x217c30){if(!_0x217c30){_0x41b1b1[_0x21ca('0x1b')](0x194);}return _0x217c30;};}function handleError(_0x105c45,_0x1aa3f3){_0x1aa3f3=_0x1aa3f3||0x1f4;return function(_0x2ce959){logger[_0x21ca('0x2a')](_0x2ce959[_0x21ca('0x2b')]);if(_0x2ce959[_0x21ca('0x2c')]){delete _0x2ce959['name'];}_0x105c45['status'](_0x1aa3f3)[_0x21ca('0x2d')](_0x2ce959);};}exports['index']=function(_0x371907,_0x2c74d9){var _0x193bb6={},_0x5d1b41={},_0x301589={'count':0x0,'rows':[]};var _0x3244fb=_[_0x21ca('0x2e')](db[_0x21ca('0x2f')][_0x21ca('0x30')],function(_0x24c01e){return{'name':_0x24c01e[_0x21ca('0x31')],'type':_0x24c01e[_0x21ca('0x32')][_0x21ca('0x33')]};});_0x5d1b41[_0x21ca('0x34')]=_[_0x21ca('0x2e')](_0x3244fb,_0x21ca('0x2c'));_0x5d1b41[_0x21ca('0x35')]=_['keys'](_0x371907[_0x21ca('0x35')]);_0x5d1b41[_0x21ca('0x36')]=_[_0x21ca('0x37')](_0x5d1b41[_0x21ca('0x34')],_0x5d1b41[_0x21ca('0x35')]);_0x193bb6[_0x21ca('0x38')]=_[_0x21ca('0x37')](_0x5d1b41[_0x21ca('0x34')],qs[_0x21ca('0x39')](_0x371907['query']['fields']));_0x193bb6[_0x21ca('0x38')]=_0x193bb6['attributes']['length']?_0x193bb6[_0x21ca('0x38')]:_0x5d1b41[_0x21ca('0x34')];if(!_0x371907['query'][_0x21ca('0x3a')]('nolimit')){_0x193bb6[_0x21ca('0x21')]=qs[_0x21ca('0x21')](_0x371907[_0x21ca('0x35')][_0x21ca('0x21')]);_0x193bb6[_0x21ca('0x1f')]=qs['offset'](_0x371907[_0x21ca('0x35')][_0x21ca('0x1f')]);}_0x193bb6[_0x21ca('0x3b')]=qs[_0x21ca('0x3c')](_0x371907['query'][_0x21ca('0x3c')]);_0x193bb6['where']=qs['filters'](_[_0x21ca('0x3d')](_0x371907['query'],_0x5d1b41[_0x21ca('0x36')]),_0x3244fb);if(_0x371907[_0x21ca('0x35')][_0x21ca('0x3e')]){_0x193bb6[_0x21ca('0x3f')]=_[_0x21ca('0x40')](_0x193bb6[_0x21ca('0x3f')],{'$or':_[_0x21ca('0x2e')](_0x3244fb,function(_0x25ac4f){if(_0x25ac4f['type']!=='VIRTUAL'){var _0x2fb354={};_0x2fb354[_0x25ac4f[_0x21ca('0x2c')]]={'$like':'%'+_0x371907[_0x21ca('0x35')][_0x21ca('0x3e')]+'%'};return _0x2fb354;}})});}_0x193bb6=_[_0x21ca('0x40')]({},_0x193bb6,_0x371907[_0x21ca('0x41')]);var _0x4c9f41={'where':_0x193bb6['where']};return db[_0x21ca('0x2f')][_0x21ca('0x22')](_0x4c9f41)[_0x21ca('0x28')](function(_0x25f379){_0x301589['count']=_0x25f379;if(_0x371907[_0x21ca('0x35')][_0x21ca('0x42')]){_0x193bb6[_0x21ca('0x43')]=[{'all':!![]}];}return db[_0x21ca('0x2f')][_0x21ca('0x44')](_0x193bb6);})[_0x21ca('0x28')](function(_0x4f3c2d){_0x301589[_0x21ca('0x45')]=_0x4f3c2d;return _0x301589;})['then'](respondWithFilteredResult(_0x2c74d9,_0x193bb6))[_0x21ca('0x46')](handleError(_0x2c74d9,null));};exports[_0x21ca('0x47')]=function(_0x2e4961,_0x474b51){var _0x5da55a={'raw':!![],'where':{'id':_0x2e4961[_0x21ca('0x48')]['id']}},_0x40c8ab={};_0x40c8ab[_0x21ca('0x34')]=_[_0x21ca('0x49')](db[_0x21ca('0x2f')]['rawAttributes']);_0x40c8ab['query']=_[_0x21ca('0x49')](_0x2e4961[_0x21ca('0x35')]);_0x40c8ab[_0x21ca('0x36')]=_['intersection'](_0x40c8ab[_0x21ca('0x34')],_0x40c8ab['query']);_0x5da55a[_0x21ca('0x38')]=_[_0x21ca('0x37')](_0x40c8ab['model'],qs[_0x21ca('0x39')](_0x2e4961[_0x21ca('0x35')][_0x21ca('0x39')]));_0x5da55a[_0x21ca('0x38')]=_0x5da55a[_0x21ca('0x38')][_0x21ca('0x4a')]?_0x5da55a['attributes']:_0x40c8ab[_0x21ca('0x34')];if(_0x2e4961[_0x21ca('0x35')]['includeAll']){_0x5da55a[_0x21ca('0x43')]=[{'all':!![]}];}_0x5da55a=_[_0x21ca('0x40')]({},_0x5da55a,_0x2e4961[_0x21ca('0x41')]);return db[_0x21ca('0x2f')][_0x21ca('0x4b')](_0x5da55a)['then'](handleEntityNotFound(_0x474b51,null))[_0x21ca('0x28')](respondWithResult(_0x474b51,null))[_0x21ca('0x46')](handleError(_0x474b51,null));};exports[_0x21ca('0x4c')]=function(_0x5ffa80,_0x348349){return db[_0x21ca('0x2f')]['create'](_0x5ffa80[_0x21ca('0x4d')],{})['then'](respondWithResult(_0x348349,0xc9))[_0x21ca('0x46')](handleError(_0x348349,null));};exports[_0x21ca('0x27')]=function(_0x3c85ae,_0x57aefd){if(_0x3c85ae[_0x21ca('0x4d')]['id']){delete _0x3c85ae[_0x21ca('0x4d')]['id'];}return db[_0x21ca('0x2f')]['find']({'where':{'id':_0x3c85ae[_0x21ca('0x48')]['id']}})[_0x21ca('0x28')](handleEntityNotFound(_0x57aefd,null))[_0x21ca('0x28')](saveUpdates(_0x3c85ae['body'],null))[_0x21ca('0x28')](respondWithResult(_0x57aefd,null))[_0x21ca('0x46')](handleError(_0x57aefd,null));};exports[_0x21ca('0x29')]=function(_0x461e69,_0x3b71d1){return db[_0x21ca('0x2f')][_0x21ca('0x4b')]({'where':{'id':_0x461e69[_0x21ca('0x48')]['id']}})[_0x21ca('0x28')](handleEntityNotFound(_0x3b71d1,null))[_0x21ca('0x28')](removeEntity(_0x3b71d1,null))[_0x21ca('0x46')](handleError(_0x3b71d1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 00f242c..a965a4a 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 _0xf016=['define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0xf016,0x162));var _0x6f01=function(_0x43669f,_0x4a612b){_0x43669f=_0x43669f-0x0;var _0x3fc80c=_0xf016[_0x43669f];return _0x3fc80c;};'use strict';var _=require('lodash');var util=require(_0x6f01('0x0'));var logger=require(_0x6f01('0x1'))(_0x6f01('0x2'));var moment=require(_0x6f01('0x3'));var BPromise=require(_0x6f01('0x4'));var rp=require(_0x6f01('0x5'));var fs=require('fs');var path=require(_0x6f01('0x6'));var rimraf=require(_0x6f01('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f01('0x8'));module[_0x6f01('0x9')]=function(_0x2b3349,_0xdad6a){return _0x2b3349[_0x6f01('0xa')](_0x6f01('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f01('0xc'),'collate':_0x6f01('0xd')});}; \ No newline at end of file +var _0x115e=['define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x290386,_0x411773){var _0x4e65c8=function(_0x2e3746){while(--_0x2e3746){_0x290386['push'](_0x290386['shift']());}};_0x4e65c8(++_0x411773);}(_0x115e,0xd6));var _0xe115=function(_0x16d3c7,_0x82a2c4){_0x16d3c7=_0x16d3c7-0x0;var _0x1f6edc=_0x115e[_0x16d3c7];return _0x1f6edc;};'use strict';var _=require(_0xe115('0x0'));var util=require(_0xe115('0x1'));var logger=require(_0xe115('0x2'))(_0xe115('0x3'));var moment=require(_0xe115('0x4'));var BPromise=require(_0xe115('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe115('0x6'));var rimraf=require('rimraf');var config=require(_0xe115('0x7'));var attributes=require(_0xe115('0x8'));module[_0xe115('0x9')]=function(_0x282da5,_0x1090fd){return _0x282da5[_0xe115('0xa')](_0xe115('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe115('0xc'),'collate':_0xe115('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fb45f64..ed922be 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 _0xe1b9=['then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','OpenchannelApplication','update','body','options','where','limit','UpdateOpenchannelApplication','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1a4805,_0x2ca516){var _0x122bd1=function(_0x1dddf9){while(--_0x1dddf9){_0x1a4805['push'](_0x1a4805['shift']());}};_0x122bd1(++_0x2ca516);}(_0xe1b9,0x68));var _0x9e1b=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xe1b9[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0x9e1b('0x0'));var moment=require(_0x9e1b('0x1'));var BPromise=require(_0x9e1b('0x2'));var rs=require(_0x9e1b('0x3'));var fs=require('fs');var Redis=require(_0x9e1b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e1b('0x5'));var logger=require(_0x9e1b('0x6'))(_0x9e1b('0x7'));var config=require(_0x9e1b('0x8'));var jayson=require(_0x9e1b('0x9'));var client=jayson[_0x9e1b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59a500,_0x3f0e16,_0x17c97b){return new BPromise(function(_0x412a89,_0x4d0973){return client[_0x9e1b('0xb')](_0x59a500,_0x17c97b)[_0x9e1b('0xc')](function(_0x115e9f){logger['info'](_0x9e1b('0xd'),_0x3f0e16,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3f0e16,_0x9e1b('0xe'),JSON[_0x9e1b('0xf')](_0x115e9f));if(_0x115e9f['error']){if(_0x115e9f[_0x9e1b('0x10')][_0x9e1b('0x11')]===0x1f4){logger[_0x9e1b('0x10')](_0x9e1b('0xd'),_0x3f0e16,_0x115e9f[_0x9e1b('0x10')][_0x9e1b('0x12')]);return _0x4d0973(_0x115e9f[_0x9e1b('0x10')][_0x9e1b('0x12')]);}logger[_0x9e1b('0x10')](_0x9e1b('0xd'),_0x3f0e16,_0x115e9f[_0x9e1b('0x10')][_0x9e1b('0x12')]);return _0x412a89(_0x115e9f[_0x9e1b('0x10')][_0x9e1b('0x12')]);}else{logger[_0x9e1b('0x13')](_0x9e1b('0xd'),_0x3f0e16,_0x9e1b('0xe'));_0x412a89(_0x115e9f['result'][_0x9e1b('0x12')]);}})[_0x9e1b('0x14')](function(_0x18ffad){logger[_0x9e1b('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x3f0e16,_0x18ffad);_0x4d0973(_0x18ffad);});});}exports['UpdateOpenchannelApplication']=function(_0x516f94){var _0x4632de=this;return new Promise(function(_0x46691f,_0x2be16b){return db[_0x9e1b('0x15')][_0x9e1b('0x16')](_0x516f94[_0x9e1b('0x17')],{'raw':_0x516f94[_0x9e1b('0x18')]?_0x516f94[_0x9e1b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x516f94[_0x9e1b('0x18')]?_0x516f94[_0x9e1b('0x18')][_0x9e1b('0x19')]||null:null,'attributes':_0x516f94[_0x9e1b('0x18')]?_0x516f94[_0x9e1b('0x18')]['attributes']||null:null,'limit':_0x516f94[_0x9e1b('0x18')]?_0x516f94[_0x9e1b('0x18')][_0x9e1b('0x1a')]||null:null})['then'](function(_0x59b7b0){logger['info'](_0x9e1b('0x1b'),_0x516f94);logger[_0x9e1b('0x1c')](_0x9e1b('0x1b'),_0x516f94,JSON[_0x9e1b('0xf')](_0x59b7b0));_0x46691f(_0x59b7b0);})[_0x9e1b('0x14')](function(_0x2cb2ef){logger['error'](_0x9e1b('0x1b'),_0x2cb2ef['message'],_0x516f94);_0x2be16b(_0x4632de[_0x9e1b('0x10')](0x1f4,_0x2cb2ef['message']));});});}; \ No newline at end of file +var _0x7c0b=['catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result'];(function(_0x2627c5,_0x3a0394){var _0x4f11fd=function(_0x1d33ab){while(--_0x1d33ab){_0x2627c5['push'](_0x2627c5['shift']());}};_0x4f11fd(++_0x3a0394);}(_0x7c0b,0x14a));var _0xb7c0=function(_0x14f126,_0x314f84){_0x14f126=_0x14f126-0x0;var _0x2fe3d3=_0x7c0b[_0x14f126];return _0x2fe3d3;};'use strict';var _=require(_0xb7c0('0x0'));var util=require(_0xb7c0('0x1'));var moment=require(_0xb7c0('0x2'));var BPromise=require(_0xb7c0('0x3'));var rs=require(_0xb7c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7c0('0x5'))['db'];var utils=require(_0xb7c0('0x6'));var logger=require(_0xb7c0('0x7'))(_0xb7c0('0x8'));var config=require('../../config/environment');var jayson=require(_0xb7c0('0x9'));var client=jayson[_0xb7c0('0xa')][_0xb7c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5290bc,_0x25d0ef,_0x39483a){return new BPromise(function(_0x16955d,_0x155956){return client['request'](_0x5290bc,_0x39483a)['then'](function(_0x11438c){logger[_0xb7c0('0xc')](_0xb7c0('0xd'),_0x25d0ef,'request\x20sent');logger[_0xb7c0('0xe')](_0xb7c0('0xf'),_0x25d0ef,_0xb7c0('0x10'),JSON[_0xb7c0('0x11')](_0x11438c));if(_0x11438c['error']){if(_0x11438c['error'][_0xb7c0('0x12')]===0x1f4){logger[_0xb7c0('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x25d0ef,_0x11438c[_0xb7c0('0x13')][_0xb7c0('0x14')]);return _0x155956(_0x11438c[_0xb7c0('0x13')][_0xb7c0('0x14')]);}logger['error'](_0xb7c0('0xd'),_0x25d0ef,_0x11438c['error'][_0xb7c0('0x14')]);return _0x16955d(_0x11438c[_0xb7c0('0x13')][_0xb7c0('0x14')]);}else{logger[_0xb7c0('0xc')](_0xb7c0('0xd'),_0x25d0ef,_0xb7c0('0x10'));_0x16955d(_0x11438c[_0xb7c0('0x15')]['message']);}})[_0xb7c0('0x16')](function(_0x13186b){logger[_0xb7c0('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x25d0ef,_0x13186b);_0x155956(_0x13186b);});});}exports[_0xb7c0('0x17')]=function(_0x41b8f0){var _0x1394e7=this;return new Promise(function(_0x47456b,_0x24f6ef){return db[_0xb7c0('0x18')][_0xb7c0('0x19')](_0x41b8f0[_0xb7c0('0x1a')],{'raw':_0x41b8f0['options']?_0x41b8f0[_0xb7c0('0x1b')][_0xb7c0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41b8f0['options']?_0x41b8f0[_0xb7c0('0x1b')][_0xb7c0('0x1d')]||null:null,'attributes':_0x41b8f0['options']?_0x41b8f0[_0xb7c0('0x1b')][_0xb7c0('0x1e')]||null:null,'limit':_0x41b8f0['options']?_0x41b8f0[_0xb7c0('0x1b')]['limit']||null:null})[_0xb7c0('0x1f')](function(_0x34f039){logger[_0xb7c0('0xc')](_0xb7c0('0x17'),_0x41b8f0);logger[_0xb7c0('0xe')]('UpdateOpenchannelApplication',_0x41b8f0,JSON[_0xb7c0('0x11')](_0x34f039));_0x47456b(_0x34f039);})['catch'](function(_0x4ce769){logger[_0xb7c0('0x13')]('UpdateOpenchannelApplication',_0x4ce769[_0xb7c0('0x14')],_0x41b8f0);_0x24f6ef(_0x1394e7[_0xb7c0('0x13')](0x1f4,_0x4ce769[_0xb7c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 56b1a1d..a9c8a3e 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 _0xb95d=['tracked','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','openchannel','openchannelinteraction:addtags','put'];(function(_0x4f192e,_0x4d1756){var _0x49294d=function(_0x580ab3){while(--_0x580ab3){_0x4f192e['push'](_0x4f192e['shift']());}};_0x49294d(++_0x4d1756);}(_0xb95d,0xca));var _0xdb95=function(_0x123e6f,_0x3a0ccb){_0x123e6f=_0x123e6f-0x0;var _0x2e0627=_0xb95d[_0x123e6f];return _0x2e0627;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb95('0x0'));var timeout=require(_0xdb95('0x1'));var express=require(_0xdb95('0x2'));var router=express[_0xdb95('0x3')]();var fs_extra=require(_0xdb95('0x4'));var auth=require(_0xdb95('0x5'));var interaction=require(_0xdb95('0x6'));var config=require(_0xdb95('0x7'));var controller=require('./openchannelInteraction.controller');router[_0xdb95('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdb95('0x8')]('/describe',auth[_0xdb95('0x9')](),controller[_0xdb95('0xa')]);router[_0xdb95('0x8')](_0xdb95('0xb'),auth[_0xdb95('0x9')](),controller[_0xdb95('0xc')]);router[_0xdb95('0x8')]('/:id/messages',auth[_0xdb95('0x9')](),controller[_0xdb95('0xd')]);router['get'](_0xdb95('0xe'),auth[_0xdb95('0x9')](),controller[_0xdb95('0xf')]);router[_0xdb95('0x10')]('/',auth['isAuthenticated'](),controller[_0xdb95('0x11')]);router[_0xdb95('0x10')]('/:id/messages',auth[_0xdb95('0x9')](),controller[_0xdb95('0x12')]);router[_0xdb95('0x10')]('/:id/tags',auth[_0xdb95('0x9')](),interaction['tracked'](_0xdb95('0x13'),_0xdb95('0x14')),controller['addTags']);router[_0xdb95('0x15')](_0xdb95('0xb'),auth[_0xdb95('0x9')](),interaction[_0xdb95('0x16')](_0xdb95('0x13'),'openchannelinteraction:update'),controller['update']);router[_0xdb95('0x17')](_0xdb95('0xb'),auth[_0xdb95('0x9')](),interaction[_0xdb95('0x16')](_0xdb95('0x13'),_0xdb95('0x18')),controller[_0xdb95('0x19')]);router['delete'](_0xdb95('0x1a'),auth[_0xdb95('0x9')](),controller['removeTags']);module[_0xdb95('0x1b')]=router; \ No newline at end of file +var _0x0d79=['get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller'];(function(_0xb6b285,_0x596e01){var _0x11393c=function(_0x506469){while(--_0x506469){_0xb6b285['push'](_0xb6b285['shift']());}};_0x11393c(++_0x596e01);}(_0x0d79,0x69));var _0x90d7=function(_0x3d784f,_0x100ef1){_0x3d784f=_0x3d784f-0x0;var _0x32340e=_0x0d79[_0x3d784f];return _0x32340e;};'use strict';var multer=require(_0x90d7('0x0'));var util=require(_0x90d7('0x1'));var path=require('path');var timeout=require(_0x90d7('0x2'));var express=require(_0x90d7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x90d7('0x4'));var config=require(_0x90d7('0x5'));var controller=require(_0x90d7('0x6'));router[_0x90d7('0x7')]('/',auth[_0x90d7('0x8')](),controller[_0x90d7('0x9')]);router['get'](_0x90d7('0xa'),auth[_0x90d7('0x8')](),controller[_0x90d7('0xb')]);router[_0x90d7('0x7')](_0x90d7('0xc'),auth[_0x90d7('0x8')](),controller['show']);router['get'](_0x90d7('0xd'),auth['isAuthenticated'](),controller[_0x90d7('0xe')]);router[_0x90d7('0x7')](_0x90d7('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x90d7('0x10')]('/',auth[_0x90d7('0x8')](),controller[_0x90d7('0x11')]);router['post'](_0x90d7('0xd'),auth[_0x90d7('0x8')](),controller['addMessage']);router[_0x90d7('0x10')](_0x90d7('0x12'),auth[_0x90d7('0x8')](),interaction[_0x90d7('0x13')](_0x90d7('0x14'),_0x90d7('0x15')),controller[_0x90d7('0x16')]);router['put'](_0x90d7('0xc'),auth[_0x90d7('0x8')](),interaction['tracked'](_0x90d7('0x14'),_0x90d7('0x17')),controller['update']);router[_0x90d7('0x18')](_0x90d7('0xc'),auth['isAuthenticated'](),interaction[_0x90d7('0x13')]('openchannel',_0x90d7('0x19')),controller[_0x90d7('0x1a')]);router[_0x90d7('0x18')](_0x90d7('0x12'),auth[_0x90d7('0x8')](),controller[_0x90d7('0x1b')]);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 b604556..5e04eee 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 _0x3b75=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3b75,0x144));var _0x53b7=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0x3b75[_0x5eca50];return _0x41fb84;};'use strict';var Sequelize=require(_0x53b7('0x0'));module[_0x53b7('0x1')]={'closed':{'type':Sequelize[_0x53b7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x53b7('0x3')]},'disposition':{'type':Sequelize[_0x53b7('0x4')]},'secondDisposition':{'type':Sequelize[_0x53b7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x53b7('0x4')]},'note':{'type':Sequelize[_0x53b7('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x53b7('0x4')]},'lastMsgAt':{'type':Sequelize[_0x53b7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x53b7('0x5')]('in',_0x53b7('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1294=['STRING','DATE','ENUM','out','sequelize','BOOLEAN'];(function(_0xfde707,_0x197b91){var _0x3f27cb=function(_0x3e388d){while(--_0x3e388d){_0xfde707['push'](_0xfde707['shift']());}};_0x3f27cb(++_0x197b91);}(_0x1294,0xb8));var _0x4129=function(_0x20575d,_0x34ab83){_0x20575d=_0x20575d-0x0;var _0x25a4a3=_0x1294[_0x20575d];return _0x25a4a3;};'use strict';var Sequelize=require(_0x4129('0x0'));module['exports']={'closed':{'type':Sequelize[_0x4129('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4129('0x2')]},'secondDisposition':{'type':Sequelize[_0x4129('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4129('0x2')]},'read1stAt':{'type':Sequelize[_0x4129('0x3')]},'threadId':{'type':Sequelize[_0x4129('0x2')]},'externalUrl':{'type':Sequelize[_0x4129('0x2')]},'lastMsgAt':{'type':Sequelize[_0x4129('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4129('0x4')]('in',_0x4129('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4129('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x4129('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 5404477..4a317d1 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 _0x3cce=['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?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','OpenchannelInteraction','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','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','split','format','include','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','Contact','firstName','attachments','Attachment','createdAt','direction','OpenchannelAccount','Account','Owner','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','lastName','secret','renderFile','views','.pdf','createPdfFromHTML','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','Tags','forEach','TagIds','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0xac5936,_0x49687c){var _0x48999e=function(_0x377cb7){while(--_0x377cb7){_0xac5936['push'](_0xac5936['shift']());}};_0x48999e(++_0x49687c);}(_0x3cce,0x180));var _0xe3cc=function(_0x1da3d6,_0x632b04){_0x1da3d6=_0x1da3d6-0x0;var _0x1c47a3=_0x3cce[_0x1da3d6];return _0x1c47a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3cc('0x0'));var jsonpatch=require(_0xe3cc('0x1'));var rp=require(_0xe3cc('0x2'));var moment=require(_0xe3cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe3cc('0x4'));var util=require(_0xe3cc('0x5'));var path=require(_0xe3cc('0x6'));var sox=require(_0xe3cc('0x7'));var csv=require('to-csv');var ejs=require(_0xe3cc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3cc('0x9'));var squel=require(_0xe3cc('0xa'));var crypto=require(_0xe3cc('0xb'));var jsforce=require(_0xe3cc('0xc'));var deskjs=require(_0xe3cc('0xd'));var toCsv=require(_0xe3cc('0xe'));var querystring=require(_0xe3cc('0xf'));var Papa=require(_0xe3cc('0x10'));var Redis=require('ioredis');var authService=require(_0xe3cc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe3cc('0x12'));var hardwareService=require(_0xe3cc('0x13'));var logger=require(_0xe3cc('0x14'))(_0xe3cc('0x15'));var utils=require(_0xe3cc('0x16'));var config=require(_0xe3cc('0x17'));var licenseUtil=require(_0xe3cc('0x18'));var db=require(_0xe3cc('0x19'))['db'];config[_0xe3cc('0x1a')]=_['defaults'](config[_0xe3cc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3cc('0x1b'))(new Redis(config[_0xe3cc('0x1a')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x544aba,_0x17d77a){_0x17d77a=_0x17d77a||0xcc;return function(_0x4d3bfb){if(_0x4d3bfb){return _0x544aba[_0xe3cc('0x1c')](_0x17d77a);}return _0x544aba[_0xe3cc('0x1d')](_0x17d77a)[_0xe3cc('0x1e')]();};}function respondWithResult(_0x301ce5,_0xdc247){_0xdc247=_0xdc247||0xc8;return function(_0x9835dc){if(_0x9835dc){return _0x301ce5[_0xe3cc('0x1d')](_0xdc247)[_0xe3cc('0x1f')](_0x9835dc);}};}function respondWithFilteredResult(_0x4df8ed,_0x18eeb2){return function(_0x2db294){if(_0x2db294){var _0x4d3179=typeof _0x18eeb2[_0xe3cc('0x20')]===_0xe3cc('0x21')&&typeof _0x18eeb2[_0xe3cc('0x22')]===_0xe3cc('0x21');var _0xef8823=_0x2db294[_0xe3cc('0x23')];var _0x1d0ef6=_0x4d3179?0x0:_0x18eeb2[_0xe3cc('0x20')];var _0x2924f5=_0x4d3179?_0x2db294[_0xe3cc('0x23')]:_0x18eeb2[_0xe3cc('0x20')]+_0x18eeb2[_0xe3cc('0x22')];var _0x35110d;if(_0x2924f5>=_0xef8823){_0x2924f5=_0xef8823;_0x35110d=0xc8;}else{_0x35110d=0xce;}_0x4df8ed[_0xe3cc('0x1d')](_0x35110d);return _0x4df8ed[_0xe3cc('0x24')](_0xe3cc('0x25'),_0x1d0ef6+'-'+_0x2924f5+'/'+_0xef8823)['json'](_0x2db294);}return null;};}function patchUpdates(_0x5bfbbb){return function(_0x39e5a7){try{jsonpatch[_0xe3cc('0x26')](_0x39e5a7,_0x5bfbbb,!![]);}catch(_0x287a75){return BPromise[_0xe3cc('0x27')](_0x287a75);}return _0x39e5a7[_0xe3cc('0x28')]();};}function saveUpdates(_0x148b93,_0x45d0fa){return function(_0x19e535){if(_0x19e535){return _0x19e535[_0xe3cc('0x29')](_0x148b93)['then'](function(_0x1089f6){return _0x1089f6;});}return null;};}function removeEntity(_0x59544b,_0x145dab){return function(_0x1e1e1b){if(_0x1e1e1b){return _0x1e1e1b['destroy']()[_0xe3cc('0x2a')](function(){_0x59544b[_0xe3cc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44ee7e,_0x14a6c3){return function(_0x48b091){if(!_0x48b091){_0x44ee7e[_0xe3cc('0x1c')](0x194);}return _0x48b091;};}function handleError(_0x11b25c,_0x208259){_0x208259=_0x208259||0x1f4;return function(_0x5ae5e5){logger[_0xe3cc('0x2b')](_0x5ae5e5[_0xe3cc('0x2c')]);if(_0x5ae5e5[_0xe3cc('0x2d')]){delete _0x5ae5e5[_0xe3cc('0x2d')];}_0x11b25c[_0xe3cc('0x1d')](_0x208259)[_0xe3cc('0x2e')](_0x5ae5e5);};}function getInteractionUsers(_0x33f105,_0x5cb151){return new BPromise(function(_0x3183cc,_0x1fccac){try{if(_0x5cb151[_0x33f105['id']]){_0x33f105[_0xe3cc('0x2f')]=_[_0xe3cc('0x30')](_0x5cb151[_0x33f105['id']],function(_0xf380bd){return{'id':_0xf380bd['id'],'fullname':_0xf380bd[_0xe3cc('0x31')]};});}}catch(_0x277ba7){_0x1fccac(_0x277ba7);}_0x3183cc(_0x33f105);});}function getInteractionTags(_0x4c9ccb,_0x1d1889){return new BPromise(function(_0x40da01,_0x1d2f35){try{if(_0x4c9ccb['TagIds']){_0x4c9ccb[_0xe3cc('0x32')]=[];_0x4c9ccb['TagIds']['split'](',')[_0xe3cc('0x33')](function(_0x15262c){_0x4c9ccb['Tags']['push'](_0x1d1889[_0x15262c]);});}delete _0x4c9ccb[_0xe3cc('0x34')];}catch(_0x7e8ad4){_0x1d2f35(_0x7e8ad4);}_0x40da01(_0x4c9ccb);});}function updateOpenchannelInteraction(_0x11740b,_0x5ac7bf,_0x32a6b2){return new BPromise(function(_0x3e4ba1,_0x3f1d0a){return getInteractionUsers(_0x11740b,_0x32a6b2)[_0xe3cc('0x2a')](function(_0x4fb318){return getInteractionTags(_0x4fb318,_0x5ac7bf);})['then'](function(_0x5c3024){return getStateInteraction(_0x5c3024);})[_0xe3cc('0x2a')](function(_0x4c74c9){_0x3e4ba1(_0x4c74c9);})[_0xe3cc('0x35')](function(_0x35e702){_0x3f1d0a(_0x35e702);});});}function getStateInteraction(_0x290a39){return new BPromise(function(_0xdc680b){_0x290a39[_0xe3cc('0x36')]=0x0;_0x290a39[_0xe3cc('0x37')]=0x0;_0x290a39[_0xe3cc('0x38')]=0x0;_0x290a39[_0xe3cc('0x39')]=0x0;_0x290a39[_0xe3cc('0x3a')]=0x0;if(!_0x290a39[_0xe3cc('0x3b')]&&!_0x290a39['UserId']){_0x290a39['waiting']+=0x1;}if(!_0x290a39[_0xe3cc('0x3b')]&&_0x290a39[_0xe3cc('0x3c')]){_0x290a39[_0xe3cc('0x37')]+=0x1;ids['push'](_0x290a39['id']);if(_0x290a39[_0xe3cc('0x36')]){_0x290a39['waiting']-=0x1;}}if(_0x290a39[_0xe3cc('0x3b')]&&_0x290a39['UserId']){_0x290a39[_0xe3cc('0x38')]+=0x1;if(_0x290a39[_0xe3cc('0x37')]){_0x290a39[_0xe3cc('0x37')]-=0x1;}}if(_0x290a39[_0xe3cc('0x3b')]&&!_0x290a39['UserId']){_0x290a39[_0xe3cc('0x39')]+=0x1;if(_0x290a39[_0xe3cc('0x36')]){_0x290a39['waiting']-=0x1;}}_0x290a39[_0xe3cc('0x3a')]+=0x1;_0xdc680b(_0x290a39);});}exports[_0xe3cc('0x3d')]=function(_0x35651b,_0x5a2a12){var _0x5bd47f={},_0x4a7ede={},_0x1bbddf={'count':0x0,'rows':[]};var _0x3cc1d7=_[_0xe3cc('0x30')](db['OpenchannelInteraction'][_0xe3cc('0x3e')],function(_0x4d2683){return{'name':_0x4d2683[_0xe3cc('0x3f')],'type':_0x4d2683[_0xe3cc('0x40')][_0xe3cc('0x41')]};});_0x4a7ede['model']=_['map'](_0x3cc1d7,'name');_0x4a7ede['query']=_[_0xe3cc('0x42')](_0x35651b['query']);_0x4a7ede[_0xe3cc('0x43')]=_[_0xe3cc('0x44')](_0x4a7ede[_0xe3cc('0x45')],_0x4a7ede[_0xe3cc('0x46')]);_0x5bd47f[_0xe3cc('0x47')]=_['intersection'](_0x4a7ede[_0xe3cc('0x45')],qs[_0xe3cc('0x48')](_0x35651b[_0xe3cc('0x46')][_0xe3cc('0x48')]));_0x5bd47f[_0xe3cc('0x47')]=_0x5bd47f[_0xe3cc('0x47')][_0xe3cc('0x49')]?_0x5bd47f[_0xe3cc('0x47')]:_0x4a7ede[_0xe3cc('0x45')];if(!_0x35651b['query'][_0xe3cc('0x4a')](_0xe3cc('0x4b'))){_0x5bd47f[_0xe3cc('0x22')]=qs[_0xe3cc('0x22')](_0x35651b[_0xe3cc('0x46')]['limit']);_0x5bd47f[_0xe3cc('0x20')]=qs[_0xe3cc('0x20')](_0x35651b['query']['offset']);}_0x5bd47f[_0xe3cc('0x4c')]=qs[_0xe3cc('0x4d')](_0x35651b[_0xe3cc('0x46')][_0xe3cc('0x4d')]);_0x5bd47f[_0xe3cc('0x4e')]=qs['filters'](_[_0xe3cc('0x4f')](_0x35651b[_0xe3cc('0x46')],_0x4a7ede[_0xe3cc('0x43')]),_0x3cc1d7);var _0x308f86=[];var _0x1e9f0f=squel[_0xe3cc('0x50')]()[_0xe3cc('0x51')]('id')[_0xe3cc('0x51')](_0xe3cc('0x2d'))['field']('color')['from'](_0xe3cc('0x52'));var _0x237138=squel[_0xe3cc('0x50')]()[_0xe3cc('0x51')]('u.id')['field'](_0xe3cc('0x53'))[_0xe3cc('0x51')](_0xe3cc('0x54'))[_0xe3cc('0x55')](_0xe3cc('0x56'),'ui')[_0xe3cc('0x57')](_0xe3cc('0x58'),'u',_0xe3cc('0x59'));var _0x478415=squel[_0xe3cc('0x50')]()[_0xe3cc('0x55')](_0xe3cc('0x5a'),'i')['left_join'](_0xe3cc('0x5b'),'c',_0xe3cc('0x5c'))[_0xe3cc('0x57')](_0xe3cc('0x58'),'o','o.id\x20=\x20i.UserId')[_0xe3cc('0x57')]('openchannel_accounts','a',_0xe3cc('0x5d'))['left_join'](_0xe3cc('0x5e'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xe3cc('0x57')](_0xe3cc('0x5f'),'it',_0xe3cc('0x60'))[_0xe3cc('0x57')](_0xe3cc('0x52'),'t',_0xe3cc('0x61'));var _0x15c0b0=squel[_0xe3cc('0x62')]();var _0x4d1375=[];var _0x807b65=squel[_0xe3cc('0x62')]();var _0x26933c;if(_0x35651b['query'][_0xe3cc('0x63')]){_0x26933c=as[_0xe3cc('0x64')](_0x35651b[_0xe3cc('0x46')]['search']);var _0x5283d1=_0x26933c[_0xe3cc('0x65')];for(var _0x511834=0x0;_0x511834<_0x26933c[_0xe3cc('0x66')][_0xe3cc('0x49')];_0x511834++){var _0x4ef42c=_0x26933c[_0xe3cc('0x66')][_0x511834];var _0x4a2912='i';var _0x282960=_[_0xe3cc('0x67')](_0x3cc1d7,[_0xe3cc('0x2d'),_0x4ef42c['field']]);if(!_0x282960){switch(_0x4ef42c[_0xe3cc('0x51')]){case _0xe3cc('0x68'):if(_0x4ef42c[_0xe3cc('0x69')]==0x1){_0x478415['having']('`'+_0x4ef42c[_0xe3cc('0x51')]+_0xe3cc('0x6a'));}else{_0x478415['having']('`'+_0x4ef42c[_0xe3cc('0x51')]+_0xe3cc('0x6b'));}break;case'Contact':if(_0x4ef42c[_0xe3cc('0x6c')]==='$substring'){if(_0x4ef42c[_0xe3cc('0x69')]['split']('\x20')[_0xe3cc('0x49')]>0x1){_0x15c0b0[_0x5283d1](_0xe3cc('0x6d'),qs['getFullTextValue'](_0x4ef42c[_0xe3cc('0x69')]),null);}else{var _0x235410='%'+_0x4ef42c[_0xe3cc('0x69')]+'%';_0x15c0b0[_0x5283d1](_0xe3cc('0x6e'),_0x235410,_0x235410,_0x235410);}}else{_0x282960=_[_0xe3cc('0x67')](_0x3cc1d7,[_0xe3cc('0x2d'),_0xe3cc('0x6f')]);_0x4ef42c[_0xe3cc('0x51')]='ContactId';_0x327c89=as[_0xe3cc('0x70')](_0x4a2912,_0x282960[_0xe3cc('0x40')],_0x4ef42c);_0x15c0b0[_0x5283d1](_0x327c89[_0xe3cc('0x71')],_0x327c89[_0xe3cc('0x69')][_0xe3cc('0x72')],_0x327c89['value'][_0xe3cc('0x1e')]);}break;case _0xe3cc('0x73'):var _0x42b183=_0x4ef42c[_0xe3cc('0x69')]['split'](',')[_0xe3cc('0x30')](function(_0x251341){return Number(_0x251341);});_0x42b183[_0xe3cc('0x33')](function(_0x4975df){_0x807b65['or'](_0xe3cc('0x74'),'%,'+_0x4975df+',%');});_0x4d1375=_['union'](_0x4d1375,_0x42b183);break;case _0xe3cc('0x75'):if(_0x4ef42c[_0xe3cc('0x6c')]===_0xe3cc('0x76')){_0x15c0b0[_0x5283d1](_0xe3cc('0x77'),'%'+_0x4ef42c[_0xe3cc('0x69')]+'%',null);}else{_0x282960=_[_0xe3cc('0x67')](_0x3cc1d7,['name',_0xe3cc('0x3c')]);_0x4ef42c[_0xe3cc('0x51')]=_0xe3cc('0x3c');_0x327c89=as[_0xe3cc('0x70')](_0x4a2912,_0x282960[_0xe3cc('0x40')],_0x4ef42c);_0x15c0b0[_0x5283d1](_0x327c89[_0xe3cc('0x71')],_0x327c89[_0xe3cc('0x69')]['start'],_0x327c89[_0xe3cc('0x69')][_0xe3cc('0x1e')]);}break;case'body':_0x327c89=as[_0xe3cc('0x70')]('me',null,_0x4ef42c);_0x15c0b0[_0x5283d1](_0x327c89[_0xe3cc('0x71')],_0x327c89[_0xe3cc('0x69')][_0xe3cc('0x72')],_0x327c89[_0xe3cc('0x69')][_0xe3cc('0x1e')]);break;}}else{var _0x327c89=as[_0xe3cc('0x70')](_0x4a2912,_0x282960[_0xe3cc('0x40')],_0x4ef42c);_0x15c0b0[_0x5283d1](_0x327c89[_0xe3cc('0x71')],_0x327c89['value']['start'],_0x327c89[_0xe3cc('0x69')]['end']);}}}else{var _0x2c0f92=_(_0x35651b[_0xe3cc('0x46')])[_0xe3cc('0x42')]()[_0xe3cc('0x30')](function(_0x360b9c){return _[_0xe3cc('0x78')](_0x3cc1d7,[_0xe3cc('0x2d'),_0x360b9c])?_0x360b9c:undefined;})[_0xe3cc('0x79')]()['value']();if(!_[_0xe3cc('0x7a')](_0x2c0f92)){_0x2c0f92[_0xe3cc('0x33')](function(_0x447542){if(_0x447542===_0xe3cc('0x7b')){_0x478415[_0xe3cc('0x4e')](_0xe3cc('0x7c'),[][_0xe3cc('0x7d')](_0x35651b[_0xe3cc('0x46')][_0x447542]));}else if(_0x447542==='createdAt'){var _0x3e21f2=JSON[_0xe3cc('0x7e')](_0x35651b['query'][_0x447542])[_0xe3cc('0x7f')];var _0x268491=JSON[_0xe3cc('0x7e')](_0x35651b[_0xe3cc('0x46')][_0x447542])[_0xe3cc('0x80')];_0x478415[_0xe3cc('0x4e')](_0xe3cc('0x81'),_0x3e21f2,_0x268491);}else{if(_0x35651b[_0xe3cc('0x46')][_0x447542]==='null'){_0x478415[_0xe3cc('0x4e')]('i.'+_0x447542+_0xe3cc('0x82'));}else{_0x478415[_0xe3cc('0x4e')]('i.'+_0x447542+_0xe3cc('0x83'),_0x35651b[_0xe3cc('0x46')][_0x447542]);}}});}if(_0x35651b['query'][_0xe3cc('0x84')]){if(_0x35651b['query'][_0xe3cc('0x84')]==0x1){_0x478415[_0xe3cc('0x85')]('`unreadMessages`\x20=\x200');}else{_0x478415[_0xe3cc('0x85')](_0xe3cc('0x86'));}}if(_0x35651b['query']['tag']){_0x4d1375=_[_0xe3cc('0x87')](_0x35651b['query'][_0xe3cc('0x88')])?_0x35651b[_0xe3cc('0x46')]['tag']:new Array(_0x35651b['query'][_0xe3cc('0x88')]);_0x4d1375[_0xe3cc('0x33')](function(_0x46bece){_0x807b65['or'](_0xe3cc('0x74'),'%,'+_0x46bece+',%');});}if(_0x35651b['query'][_0xe3cc('0x89')]){var _0x17e642=_0x35651b[_0xe3cc('0x46')][_0xe3cc('0x89')]['replace']('\x5c','\x5c\x5c')[_0xe3cc('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x17e642)){_0x15c0b0['or'](_0xe3cc('0x8b'),_0x17e642+'%');}else{_0x15c0b0['or'](_0xe3cc('0x8c'),qs[_0xe3cc('0x8d')](_0x17e642))['or'](_0xe3cc('0x8e'),_0x17e642+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x17e642+'%');}}}_0x478415['where'](_0x15c0b0);_0x478415['group'](_0xe3cc('0x8f'));var _0x2662d2={'type':db[_0xe3cc('0x90')][_0xe3cc('0x91')][_0xe3cc('0x92')],'raw':!![]};var _0x3f5519=_0x478415[_0xe3cc('0x93')]();_0x3f5519['field']('i.id');_0x3f5519[_0xe3cc('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe3cc('0x68'));if(_0x5bd47f[_0xe3cc('0x4c')]){_0x5bd47f[_0xe3cc('0x4c')][_0xe3cc('0x33')](function(_0x4780a4){var _0x159095=_0x4780a4[0x0]===_0xe3cc('0x94')?_0x4780a4[0x0]:'i.'+_0x4780a4[0x0];_0x478415[_0xe3cc('0x4c')](_0x159095,_0x4780a4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe3cc('0x7a')](_0x4d1375)){_0x478415[_0xe3cc('0x85')](_0x807b65);_0x3f5519[_0xe3cc('0x4e')]('t.id\x20IN\x20?',_0x4d1375);}BPromise[_0xe3cc('0x95')]()[_0xe3cc('0x2a')](function(){if(!_0x26933c){if(_0x35651b[_0xe3cc('0x46')]['OpenchannelAccountId'])return;_0x3f5519[_0xe3cc('0x4e')](_0xe3cc('0x96'));_0x478415[_0xe3cc('0x4e')](_0xe3cc('0x96'));return;}if(_0x35651b['user'][_0xe3cc('0x97')]!==_0xe3cc('0x98'))return;return _0x35651b[_0xe3cc('0x99')][_0xe3cc('0x9a')]({'attributes':['id'],'raw':!![]})[_0xe3cc('0x2a')](function(_0x12b628){if(_[_0xe3cc('0x7a')](_0x12b628)){_0x3f5519[_0xe3cc('0x4e')](_0xe3cc('0x9b'));_0x478415['where'](_0xe3cc('0x9b'));}else{_0x3f5519[_0xe3cc('0x4e')](_0xe3cc('0x7c'),_['map'](_0x12b628,'id'));_0x478415[_0xe3cc('0x4e')](_0xe3cc('0x7c'),_[_0xe3cc('0x30')](_0x12b628,'id'));}});})[_0xe3cc('0x2a')](function(){if(_0x35651b[_0xe3cc('0x99')][_0xe3cc('0x97')]===_0xe3cc('0x98')&&!_0x26933c&&!_0x35651b[_0xe3cc('0x46')]['OpenchannelAccountId'])return[];return db[_0xe3cc('0x9c')][_0xe3cc('0x46')](_0x3f5519[_0xe3cc('0x9d')](),_0x2662d2);})[_0xe3cc('0x2a')](function(_0x1bba80){_0x1bbddf[_0xe3cc('0x23')]=_0x1bba80['length'];if(_0x1bbddf[_0xe3cc('0x23')]===0x0)return[];return db[_0xe3cc('0x9c')][_0xe3cc('0x46')](_0x1e9f0f['toString'](),_0x2662d2)[_0xe3cc('0x2a')](function(_0x493592){_0x308f86=_['keyBy'](_0x493592,'id');_0x2662d2=_[_0xe3cc('0x9e')](_0x2662d2,{'model':db[_0xe3cc('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35651b[_0xe3cc('0x46')][_0xe3cc('0x48')]){_0x5bd47f['attributes'][_0xe3cc('0x33')](function(_0x175fad){_0x478415[_0xe3cc('0x51')]('i.'+_0x175fad);});}else{_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa0'),_0xe3cc('0x68'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa1'),_0xe3cc('0xa2'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa3'),'Account.mandatoryDisposition');_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa4'),_0xe3cc('0x94'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa5'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xa6'),_0xe3cc('0xa7'));_0x478415[_0xe3cc('0x51')]('c.lastName',_0xe3cc('0xa8'));_0x478415[_0xe3cc('0x51')]('c.email',_0xe3cc('0xa9'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xaa'),'Contact.phone');_0x478415[_0xe3cc('0x51')](_0xe3cc('0xab'),_0xe3cc('0xac'));_0x478415['field']('c.fax',_0xe3cc('0xad'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xae'),_0xe3cc('0xaf'));_0x478415[_0xe3cc('0x51')](_0xe3cc('0xb0'),'Owner.internal');_0x478415[_0xe3cc('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe3cc('0x34'));}if(_0x5bd47f['limit'])_0x478415[_0xe3cc('0x22')](_0x5bd47f[_0xe3cc('0x22')]);if(_0x5bd47f[_0xe3cc('0x20')])_0x478415[_0xe3cc('0x20')](_0x5bd47f['offset']);return db[_0xe3cc('0x9c')][_0xe3cc('0x46')](_0x478415[_0xe3cc('0x9d')](),_0x2662d2);})[_0xe3cc('0x2a')](function(_0x5e255e){if(_0x5e255e['length']>0x0)_0x237138[_0xe3cc('0x4e')](_0xe3cc('0xb1'),_[_0xe3cc('0x30')](_0x5e255e,'id'));return db['sequelize'][_0xe3cc('0x46')](_0x237138[_0xe3cc('0x9d')](),_0x2662d2)[_0xe3cc('0x2a')](function(_0x21fe4f){var _0x202cf9=_[_0xe3cc('0xb2')](_0x21fe4f,_0xe3cc('0xb3'));var _0x417f91=[];_0x5e255e[_0xe3cc('0x33')](function(_0x12e874){_0x417f91[_0xe3cc('0xb4')](updateOpenchannelInteraction(_0x12e874,_0x308f86,_0x202cf9));});return BPromise[_0xe3cc('0xb5')](_0x417f91);});});})[_0xe3cc('0x2a')](function(_0x4891aa){_0x1bbddf[_0xe3cc('0xb6')]=_0x4891aa;return _0x1bbddf;})['then'](respondWithFilteredResult(_0x5a2a12,_0x5bd47f))[_0xe3cc('0x35')](handleError(_0x5a2a12,null));};exports[_0xe3cc('0xb7')]=function(_0x510ad4,_0x284032){var _0x4f5cc9={};if(_0x510ad4[_0xe3cc('0x46')][_0xe3cc('0x40')]&&_0x510ad4[_0xe3cc('0x46')][_0xe3cc('0x40')]==='from'){_0x4f5cc9[_0xe3cc('0x55')]=_0x510ad4[_0xe3cc('0xb8')]['id'];}else{_0x4f5cc9['id']=_0x510ad4[_0xe3cc('0xb8')]['id'];}var _0x17f875={'raw':![],'where':_0x4f5cc9},_0x41595a={};_0x41595a['model']=_[_0xe3cc('0x42')](db['OpenchannelInteraction'][_0xe3cc('0x3e')]);_0x41595a['query']=_['keys'](_0x510ad4['query']);_0x41595a[_0xe3cc('0x43')]=_[_0xe3cc('0x44')](_0x41595a['model'],_0x41595a[_0xe3cc('0x46')]);_0x17f875[_0xe3cc('0x47')]=_[_0xe3cc('0x44')](_0x41595a['model'],qs['fields'](_0x510ad4[_0xe3cc('0x46')]['fields']));_0x17f875['attributes']=_0x17f875[_0xe3cc('0x47')]['length']?_0x17f875[_0xe3cc('0x47')]:_0x41595a[_0xe3cc('0x45')];if(_0x510ad4[_0xe3cc('0x46')]['includeAll']){_0x17f875['include']=[{'all':!![]}];}_0x17f875=_[_0xe3cc('0x9e')]({},_0x17f875,_0x510ad4[_0xe3cc('0xb9')]);return db[_0xe3cc('0x9f')]['find'](_0x17f875)[_0xe3cc('0x2a')](handleEntityNotFound(_0x284032,null))[_0xe3cc('0x2a')](respondWithResult(_0x284032,null))[_0xe3cc('0x35')](handleError(_0x284032,null));};exports[_0xe3cc('0xba')]=function(_0x6489dc,_0x216c64){return db[_0xe3cc('0x9f')][_0xe3cc('0xba')](_0x6489dc['body'],{})[_0xe3cc('0x2a')](respondWithResult(_0x216c64,0xc9))[_0xe3cc('0x35')](handleError(_0x216c64,null));};exports[_0xe3cc('0x29')]=function(_0x4f9837,_0x534812){if(_0x4f9837[_0xe3cc('0xbb')]['id']){delete _0x4f9837[_0xe3cc('0xbb')]['id'];}return db[_0xe3cc('0x9f')][_0xe3cc('0x67')]({'where':{'id':_0x4f9837[_0xe3cc('0xb8')]['id']}})[_0xe3cc('0x2a')](handleEntityNotFound(_0x534812,null))[_0xe3cc('0x2a')](saveUpdates(_0x4f9837[_0xe3cc('0xbb')],null))['then'](respondWithResult(_0x534812,null))[_0xe3cc('0x35')](handleError(_0x534812,null));};exports[_0xe3cc('0xbc')]=function(_0x273af4,_0x1de7c0){return db[_0xe3cc('0x9f')]['find']({'where':{'id':_0x273af4[_0xe3cc('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1de7c0,null))['then'](removeEntity(_0x1de7c0,null))[_0xe3cc('0x35')](handleError(_0x1de7c0,null));};exports[_0xe3cc('0xbd')]=function(_0x5baf5f,_0x49c582){return db[_0xe3cc('0x9f')][_0xe3cc('0xbd')]()[_0xe3cc('0x2a')](respondWithResult(_0x49c582,null))[_0xe3cc('0x35')](handleError(_0x49c582,null));};exports[_0xe3cc('0xbe')]=function(_0xe99152,_0x1e8547,_0x526351){return db['OpenchannelMessage'][_0xe3cc('0x67')]({'where':{'id':_0xe99152[_0xe3cc('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1e8547,null))[_0xe3cc('0x2a')](function(_0x147579){if(_0x147579){return _0x147579[_0xe3cc('0xbe')](_0xe99152['body'][_0xe3cc('0xbf')],_[_0xe3cc('0xc0')](_0xe99152[_0xe3cc('0xbb')],[_0xe3cc('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x1e8547,null))['catch'](handleError(_0x1e8547,null));};exports[_0xe3cc('0xc1')]=function(_0x39000a,_0x45d8f2,_0x3c6b9b){var _0x5b60c7={'raw':![],'where':{}};var _0x190601={};var _0x2dc227={'count':0x0,'rows':[]};return db[_0xe3cc('0x9f')][_0xe3cc('0xc2')]({'where':{'id':_0x39000a[_0xe3cc('0xb8')]['id']}})[_0xe3cc('0x2a')](handleEntityNotFound(_0x45d8f2,null))[_0xe3cc('0x2a')](function(_0x253081){if(_0x253081){_0x190601[_0xe3cc('0x45')]=_['keys'](db[_0xe3cc('0xc3')][_0xe3cc('0x3e')]);_0x190601[_0xe3cc('0x46')]=_[_0xe3cc('0x42')](_0x39000a['query']);_0x190601['filters']=_[_0xe3cc('0x44')](_0x190601[_0xe3cc('0x45')],_0x190601[_0xe3cc('0x46')]);_0x5b60c7[_0xe3cc('0x47')]=_[_0xe3cc('0x44')](_0x190601[_0xe3cc('0x45')],qs[_0xe3cc('0x48')](_0x39000a['query'][_0xe3cc('0x48')]));_0x5b60c7[_0xe3cc('0x47')]=_0x5b60c7[_0xe3cc('0x47')][_0xe3cc('0x49')]?_0x5b60c7[_0xe3cc('0x47')]:_0x190601[_0xe3cc('0x45')];if(!_0x39000a[_0xe3cc('0x46')][_0xe3cc('0x4a')](_0xe3cc('0x4b'))){_0x5b60c7[_0xe3cc('0x22')]=qs[_0xe3cc('0x22')](_0x39000a[_0xe3cc('0x46')]['limit']);_0x5b60c7[_0xe3cc('0x20')]=qs[_0xe3cc('0x20')](_0x39000a[_0xe3cc('0x46')][_0xe3cc('0x20')]);}_0x5b60c7[_0xe3cc('0x4c')]=qs[_0xe3cc('0x4d')](_0x39000a[_0xe3cc('0x46')][_0xe3cc('0x4d')]);_0x5b60c7[_0xe3cc('0x4e')]=qs[_0xe3cc('0x43')](_['pick'](_0x39000a['query'],_0x190601[_0xe3cc('0x43')]));_0x5b60c7[_0xe3cc('0x4e')]['OpenchannelInteractionId']=_0x253081['id'];if(_0x39000a['query'][_0xe3cc('0x89')]){_0x5b60c7[_0xe3cc('0x4e')]=_[_0xe3cc('0x9e')](_0x5b60c7[_0xe3cc('0x4e')],{'$or':_[_0xe3cc('0x30')](_0x5b60c7[_0xe3cc('0x47')],function(_0x1ea536){var _0x5b25e0={};_0x5b25e0[_0x1ea536]={'$like':'%'+_0x39000a[_0xe3cc('0x46')][_0xe3cc('0x89')]+'%'};return _0x5b25e0;})});}if(_0x39000a[_0xe3cc('0x46')][_0xe3cc('0x7f')]){var _0x595453=_0x39000a[_0xe3cc('0x46')]['$gte'][_0xe3cc('0xc4')](',');var _0x2a825e={};_0x2a825e[_0x595453[0x0]]={'$gte':moment(_0x595453[0x1])[_0xe3cc('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b60c7[_0xe3cc('0x4e')]=_[_0xe3cc('0x9e')](_0x5b60c7[_0xe3cc('0x4e')],_0x2a825e);}_0x5b60c7=_[_0xe3cc('0x9e')]({},_0x5b60c7,_0x39000a[_0xe3cc('0xb9')]);return db[_0xe3cc('0xc3')][_0xe3cc('0x23')]({'where':_0x5b60c7[_0xe3cc('0x4e')]})[_0xe3cc('0x2a')](function(_0x5bb961){_0x2dc227[_0xe3cc('0x23')]=_0x5bb961;if(_0x39000a[_0xe3cc('0x46')]['includeAll']){_0x5b60c7[_0xe3cc('0xc6')]=[{'all':!![]}];}return db[_0xe3cc('0xc3')][_0xe3cc('0xc7')](_0x5b60c7);})[_0xe3cc('0x2a')](function(_0x5bf080){_0x2dc227['rows']=_0x5bf080;return _0x2dc227;});}})['then'](respondWithFilteredResult(_0x45d8f2,_0x5b60c7))[_0xe3cc('0x35')](handleError(_0x45d8f2,null));};exports[_0xe3cc('0xc8')]=function(_0x10820b,_0x200016,_0x462a9e){return db[_0xe3cc('0x9f')][_0xe3cc('0x67')]({'where':{'id':_0x10820b[_0xe3cc('0xb8')]['id']}})[_0xe3cc('0x2a')](handleEntityNotFound(_0x200016,null))[_0xe3cc('0x2a')](function(_0xb658bc){if(_0xb658bc){return _0xb658bc[_0xe3cc('0xc9')](_0x10820b[_0xe3cc('0xbb')][_0xe3cc('0xbf')],_[_0xe3cc('0xc0')](_0x10820b[_0xe3cc('0xbb')],[_0xe3cc('0xbf'),'id'])||{})[_0xe3cc('0xca')](function(){return db[_0xe3cc('0x73')][_0xe3cc('0xc7')]({'attributes':['id',_0xe3cc('0x2d'),_0xe3cc('0xcb')],'where':{'id':_0x10820b[_0xe3cc('0xbb')]['ids']}});})[_0xe3cc('0x2a')](function(_0x48fc3b){socket[_0xe3cc('0xcc')](_0xe3cc('0xcd'),{'id':Number(_0x10820b[_0xe3cc('0xb8')]['id']),'tags':_0x48fc3b||[]});return{'id':Number(_0x10820b[_0xe3cc('0xb8')]['id']),'tags':_0x48fc3b||[]};});}})['then'](respondWithResult(_0x200016,null))[_0xe3cc('0x35')](handleError(_0x200016,null));};exports[_0xe3cc('0xce')]=function(_0x29ad1b,_0x2cdf63,_0x2e9f04){return db[_0xe3cc('0x9f')][_0xe3cc('0x67')]({'where':{'id':_0x29ad1b[_0xe3cc('0xb8')]['id']}})[_0xe3cc('0x2a')](handleEntityNotFound(_0x2cdf63,null))[_0xe3cc('0x2a')](function(_0x374689){if(_0x374689){return _0x374689[_0xe3cc('0xce')](_0x29ad1b['query']['ids']);}})[_0xe3cc('0x2a')](respondWithStatusCode(_0x2cdf63,null))[_0xe3cc('0x35')](handleError(_0x2cdf63,null));};exports[_0xe3cc('0xcf')]=function(_0x969e00,_0x44a9aa){var _0x2e50fc=moment()[_0xe3cc('0xd0')]()[_0xe3cc('0x9d')]();var _0x20d8ca=path[_0xe3cc('0xd1')](config[_0xe3cc('0xd2')],_0xe3cc('0xd3'),_0xe3cc('0xd4'),_0xe3cc('0xd5'));var _0x5f382c=path[_0xe3cc('0xd1')](config['root'],_0xe3cc('0xd3'),'files','attachments');var _0x14bf57=path[_0xe3cc('0xd1')](_0x20d8ca,_0x2e50fc);var _0x4fc5fa=util['format'](_0xe3cc('0xd6'),_0x969e00['params']['id'],_0x2e50fc);var _0x4f6b5a=path[_0xe3cc('0xd1')](_0x20d8ca,_0x4fc5fa);var _0x524ef4=[];_0x524ef4[_0xe3cc('0xb4')]({'model':db[_0xe3cc('0x75')],'as':_0xe3cc('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x524ef4[_0xe3cc('0xb4')]({'model':db[_0xe3cc('0xd7')],'as':_0xe3cc('0xd8'),'attributes':['id',_0xe3cc('0xd9'),'lastName'],'raw':!![]});if(_0x969e00[_0xe3cc('0x46')][_0xe3cc('0xda')]){_0x524ef4[_0xe3cc('0xb4')]({'model':db[_0xe3cc('0xdb')],'as':_0xe3cc('0xdb'),'raw':!![]});}var _0x3149d9=[{'model':db[_0xe3cc('0xc3')],'as':'Messages','attributes':['id',_0xe3cc('0xbb'),_0xe3cc('0xdc'),_0xe3cc('0xdd'),'secret',_0xe3cc('0x84')],'include':_0x524ef4}];_0x3149d9[_0xe3cc('0xb4')]({'model':db[_0xe3cc('0xde')],'as':_0xe3cc('0xdf'),'attributes':['id',_0xe3cc('0x2d')]});_0x3149d9[_0xe3cc('0xb4')]({'model':db['User'],'as':_0xe3cc('0xe0'),'attributes':['id',_0xe3cc('0x31')]});return db[_0xe3cc('0x9f')]['find']({'where':{'id':_0x969e00[_0xe3cc('0xb8')]['id']},'include':_0x3149d9})[_0xe3cc('0x2a')](handleEntityNotFound(_0x44a9aa,null))[_0xe3cc('0x2a')](function(_0x338ab2){if(_0x338ab2){var _0x372a04=_0x338ab2['get']({'plain':!![]});fs['mkdirSync'](_0x14bf57);var _0x54506d={'channel':_0xe3cc('0xe1'),'account':_0x372a04[_0xe3cc('0xdf')][_0xe3cc('0x2d')],'agent':_0x372a04[_0xe3cc('0xe0')]?_0x372a04[_0xe3cc('0xe0')][_0xe3cc('0x31')]:_0xe3cc('0xe2'),'createdAt':moment(_0x372a04[_0xe3cc('0xdc')])['format'](_0xe3cc('0xe3'))[_0xe3cc('0x9d')](),'closedAt':_0x372a04['closed']?moment(_0x372a04['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe3cc('0x9d')]():'','disposition':_0x372a04[_0xe3cc('0xe4')],'visibility':_0x372a04[_0xe3cc('0xe5')]?_0xe3cc('0xe6'):_0xe3cc('0xe7'),'messages':_(_0x372a04[_0xe3cc('0xe8')])[_0xe3cc('0x89')]({'secret':![]})[_0xe3cc('0x30')](function(_0x2e8c51){if(_0x2e8c51['Attachment']){var _0xe21f68=path[_0xe3cc('0xd1')](_0x5f382c,_0x2e8c51[_0xe3cc('0xdb')]['basename']);if(fs[_0xe3cc('0xe9')](_0xe21f68)){fs[_0xe3cc('0xea')](_0xe21f68)[_0xe3cc('0xeb')](fs[_0xe3cc('0xec')](path['join'](_0x14bf57,_0x2e8c51['Attachment'][_0xe3cc('0xed')])));}}return{'date':moment(_0x2e8c51[_0xe3cc('0xdc')])[_0xe3cc('0xc5')](_0xe3cc('0xe3'))[_0xe3cc('0x9d')](),'sender':_0x2e8c51[_0xe3cc('0xdd')]===_0xe3cc('0xee')?_0x2e8c51['User']?_0x2e8c51[_0xe3cc('0x75')][_0xe3cc('0x31')]:_0xe3cc('0xef'):_0x2e8c51[_0xe3cc('0xd8')]['firstName']+(_0x2e8c51[_0xe3cc('0xd8')][_0xe3cc('0xf0')]?'\x20'+_0x2e8c51['Contact']['lastName']:''),'body':_0x2e8c51[_0xe3cc('0xdb')]?_0x2e8c51[_0xe3cc('0xdb')][_0xe3cc('0xed')]:_0x2e8c51['body'],'direction':_0x2e8c51[_0xe3cc('0xdd')]===_0xe3cc('0xee')?'A':'C','secret':_0x2e8c51[_0xe3cc('0xf1')],'read':_0x2e8c51['read'],'attachment':_0x2e8c51[_0xe3cc('0xdb')]};})['value']()};return ejs[_0xe3cc('0xf2')](path['join'](config['root'],_0xe3cc('0xd3'),_0xe3cc('0xf3'),'downloadInteraction.ejs'),{'interaction':_0x54506d})[_0xe3cc('0x2a')](function(_0x3fdbf0){var _0x58a493=path[_0xe3cc('0xd1')](_0x14bf57,'transcript-'+_0x372a04['id']+'-'+_0x2e50fc+_0xe3cc('0xf4'));var _0xdf8df4={'path':_0x58a493,'channel':_0xe3cc('0xe1'),'interactionId':_0x372a04['id']};return pdf[_0xe3cc('0xf5')](_0x3fdbf0,_0xdf8df4);})[_0xe3cc('0x2a')](function(){return new BPromise(function(_0xf32778,_0x3ddcb0){zipdir(_0x14bf57,{'saveTo':_0x4f6b5a},function(_0x33fef1,_0x232541){if(_0x33fef1)return _0x3ddcb0(_0x33fef1);return _0xf32778(_0x232541);});})[_0xe3cc('0x2a')](function(){return new BPromise(function(_0x106266,_0x4a5fb7){rimraf(_0x14bf57,function(_0x585677){if(_0x585677)_0x4a5fb7(_0x585677);return _0x106266();});});})[_0xe3cc('0x2a')](function(){return _0x44a9aa['download'](_0x4f6b5a,_0x4fc5fa,function(_0x35d9a3){if(_0x35d9a3){console['log']('err',_0x35d9a3);}else{fs[_0xe3cc('0xf6')](_0x4f6b5a);}});});});}else{return _0x44a9aa[_0xe3cc('0x1c')](0xc8);}})['catch'](handleError(_0x44a9aa,null));}; \ No newline at end of file +var _0x1ef0=['localhost','./openchannelInteraction.socket','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','then','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','catch','talking','unmanaged','total','closed','UserId','push','waiting','answered','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','select','field','from','tools_tags','ui.OpenchannelInteractionId','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','body','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','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)','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','merge','options','create','destroy','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','format','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','Messages','direction','OpenchannelAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','disposition','Public','Private','existsSync','pipe','createWriteStream','out','lastName','basename','secret','views','downloadInteraction.ejs','transcript-','Openchannel','createPdfFromHTML','log','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x1ef0,0xd6));var _0x01ef=function(_0x27bca8,_0x191f63){_0x27bca8=_0x27bca8-0x0;var _0x370163=_0x1ef0[_0x27bca8];return _0x370163;};'use strict';var emlformat=require(_0x01ef('0x0'));var rimraf=require(_0x01ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ef('0x2'));var rp=require(_0x01ef('0x3'));var moment=require(_0x01ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01ef('0x5'));var util=require(_0x01ef('0x6'));var path=require(_0x01ef('0x7'));var sox=require(_0x01ef('0x8'));var csv=require(_0x01ef('0x9'));var ejs=require(_0x01ef('0xa'));var fs=require('fs');var fs_extra=require(_0x01ef('0xb'));var _=require('lodash');var squel=require(_0x01ef('0xc'));var crypto=require(_0x01ef('0xd'));var jsforce=require(_0x01ef('0xe'));var deskjs=require(_0x01ef('0xf'));var toCsv=require(_0x01ef('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x01ef('0x10'));var authService=require(_0x01ef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x01ef('0x12'));var pdf=require(_0x01ef('0x13'));var hardwareService=require(_0x01ef('0x14'));var logger=require('../../config/logger')(_0x01ef('0x15'));var utils=require(_0x01ef('0x16'));var config=require(_0x01ef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x01ef('0x18'))['db'];config[_0x01ef('0x19')]=_['defaults'](config['redis'],{'host':_0x01ef('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01ef('0x19')]));require(_0x01ef('0x1b'))['register'](socket);function respondWithStatusCode(_0x40bc0b,_0x4a4f86){_0x4a4f86=_0x4a4f86||0xcc;return function(_0x555b27){if(_0x555b27){return _0x40bc0b[_0x01ef('0x1c')](_0x4a4f86);}return _0x40bc0b[_0x01ef('0x1d')](_0x4a4f86)['end']();};}function respondWithResult(_0x3708aa,_0x9caaf){_0x9caaf=_0x9caaf||0xc8;return function(_0x2a107c){if(_0x2a107c){return _0x3708aa[_0x01ef('0x1d')](_0x9caaf)[_0x01ef('0x1e')](_0x2a107c);}};}function respondWithFilteredResult(_0x35eb8f,_0x44f4d1){return function(_0x39a2e5){if(_0x39a2e5){var _0x5686cb=typeof _0x44f4d1['offset']==='undefined'&&typeof _0x44f4d1[_0x01ef('0x1f')]===_0x01ef('0x20');var _0x4d213c=_0x39a2e5['count'];var _0x3e244a=_0x5686cb?0x0:_0x44f4d1['offset'];var _0x2dfbeb=_0x5686cb?_0x39a2e5[_0x01ef('0x21')]:_0x44f4d1[_0x01ef('0x22')]+_0x44f4d1[_0x01ef('0x1f')];var _0x5c492d;if(_0x2dfbeb>=_0x4d213c){_0x2dfbeb=_0x4d213c;_0x5c492d=0xc8;}else{_0x5c492d=0xce;}_0x35eb8f[_0x01ef('0x1d')](_0x5c492d);return _0x35eb8f[_0x01ef('0x23')](_0x01ef('0x24'),_0x3e244a+'-'+_0x2dfbeb+'/'+_0x4d213c)[_0x01ef('0x1e')](_0x39a2e5);}return null;};}function patchUpdates(_0x2a7c02){return function(_0x220cb4){try{jsonpatch[_0x01ef('0x25')](_0x220cb4,_0x2a7c02,!![]);}catch(_0x243f1d){return BPromise['reject'](_0x243f1d);}return _0x220cb4['save']();};}function saveUpdates(_0x4e849f,_0x281b6e){return function(_0xfd8e40){if(_0xfd8e40){return _0xfd8e40['update'](_0x4e849f)['then'](function(_0x49a4ca){return _0x49a4ca;});}return null;};}function removeEntity(_0x2bbc28,_0x1642a5){return function(_0x116854){if(_0x116854){return _0x116854['destroy']()[_0x01ef('0x26')](function(){_0x2bbc28['status'](0xcc)[_0x01ef('0x27')]();});}};}function handleEntityNotFound(_0x13c8db,_0x881bc){return function(_0x8d0e6){if(!_0x8d0e6){_0x13c8db['sendStatus'](0x194);}return _0x8d0e6;};}function handleError(_0x13b1cb,_0x191bb1){_0x191bb1=_0x191bb1||0x1f4;return function(_0x1e1680){logger[_0x01ef('0x28')](_0x1e1680[_0x01ef('0x29')]);if(_0x1e1680[_0x01ef('0x2a')]){delete _0x1e1680['name'];}_0x13b1cb[_0x01ef('0x1d')](_0x191bb1)[_0x01ef('0x2b')](_0x1e1680);};}function getInteractionUsers(_0x27d67b,_0x40573b){return new BPromise(function(_0x166377,_0x4ebcec){try{if(_0x40573b[_0x27d67b['id']]){_0x27d67b[_0x01ef('0x2c')]=_['map'](_0x40573b[_0x27d67b['id']],function(_0x21e59f){return{'id':_0x21e59f['id'],'fullname':_0x21e59f[_0x01ef('0x2d')]};});}}catch(_0x149316){_0x4ebcec(_0x149316);}_0x166377(_0x27d67b);});}function getInteractionTags(_0x11d296,_0x158a1d){return new BPromise(function(_0x132269,_0xf23a0b){try{if(_0x11d296[_0x01ef('0x2e')]){_0x11d296[_0x01ef('0x2f')]=[];_0x11d296[_0x01ef('0x2e')][_0x01ef('0x30')](',')[_0x01ef('0x31')](function(_0x296589){_0x11d296[_0x01ef('0x2f')]['push'](_0x158a1d[_0x296589]);});}delete _0x11d296[_0x01ef('0x2e')];}catch(_0x11a748){_0xf23a0b(_0x11a748);}_0x132269(_0x11d296);});}function updateOpenchannelInteraction(_0x44e0a9,_0x2aec0d,_0x42e27b){return new BPromise(function(_0x44d946,_0x4c3afe){return getInteractionUsers(_0x44e0a9,_0x42e27b)['then'](function(_0x139e70){return getInteractionTags(_0x139e70,_0x2aec0d);})['then'](function(_0x5d7bc2){return getStateInteraction(_0x5d7bc2);})['then'](function(_0x25352d){_0x44d946(_0x25352d);})[_0x01ef('0x32')](function(_0x2fc7e5){_0x4c3afe(_0x2fc7e5);});});}function getStateInteraction(_0x23fafd){return new BPromise(function(_0x23cc03){_0x23fafd['waiting']=0x0;_0x23fafd[_0x01ef('0x33')]=0x0;_0x23fafd['answered']=0x0;_0x23fafd[_0x01ef('0x34')]=0x0;_0x23fafd[_0x01ef('0x35')]=0x0;if(!_0x23fafd[_0x01ef('0x36')]&&!_0x23fafd[_0x01ef('0x37')]){_0x23fafd['waiting']+=0x1;}if(!_0x23fafd[_0x01ef('0x36')]&&_0x23fafd[_0x01ef('0x37')]){_0x23fafd[_0x01ef('0x33')]+=0x1;ids[_0x01ef('0x38')](_0x23fafd['id']);if(_0x23fafd[_0x01ef('0x39')]){_0x23fafd[_0x01ef('0x39')]-=0x1;}}if(_0x23fafd['closed']&&_0x23fafd['UserId']){_0x23fafd[_0x01ef('0x3a')]+=0x1;if(_0x23fafd[_0x01ef('0x33')]){_0x23fafd['talking']-=0x1;}}if(_0x23fafd['closed']&&!_0x23fafd[_0x01ef('0x37')]){_0x23fafd[_0x01ef('0x34')]+=0x1;if(_0x23fafd['waiting']){_0x23fafd[_0x01ef('0x39')]-=0x1;}}_0x23fafd[_0x01ef('0x35')]+=0x1;_0x23cc03(_0x23fafd);});}exports[_0x01ef('0x3b')]=function(_0x269420,_0x1d80d4){var _0x432a4d={},_0x2b64f8={},_0x1e8a1d={'count':0x0,'rows':[]};var _0x2017ad=_['map'](db[_0x01ef('0x3c')][_0x01ef('0x3d')],function(_0x33b746){return{'name':_0x33b746[_0x01ef('0x3e')],'type':_0x33b746[_0x01ef('0x3f')][_0x01ef('0x40')]};});_0x2b64f8[_0x01ef('0x41')]=_[_0x01ef('0x42')](_0x2017ad,'name');_0x2b64f8[_0x01ef('0x43')]=_[_0x01ef('0x44')](_0x269420[_0x01ef('0x43')]);_0x2b64f8['filters']=_['intersection'](_0x2b64f8[_0x01ef('0x41')],_0x2b64f8[_0x01ef('0x43')]);_0x432a4d[_0x01ef('0x45')]=_[_0x01ef('0x46')](_0x2b64f8[_0x01ef('0x41')],qs[_0x01ef('0x47')](_0x269420['query'][_0x01ef('0x47')]));_0x432a4d['attributes']=_0x432a4d[_0x01ef('0x45')][_0x01ef('0x48')]?_0x432a4d[_0x01ef('0x45')]:_0x2b64f8[_0x01ef('0x41')];if(!_0x269420[_0x01ef('0x43')][_0x01ef('0x49')]('nolimit')){_0x432a4d['limit']=qs[_0x01ef('0x1f')](_0x269420['query']['limit']);_0x432a4d[_0x01ef('0x22')]=qs['offset'](_0x269420[_0x01ef('0x43')][_0x01ef('0x22')]);}_0x432a4d[_0x01ef('0x4a')]=qs[_0x01ef('0x4b')](_0x269420[_0x01ef('0x43')][_0x01ef('0x4b')]);_0x432a4d[_0x01ef('0x4c')]=qs['filters'](_[_0x01ef('0x4d')](_0x269420[_0x01ef('0x43')],_0x2b64f8[_0x01ef('0x4e')]),_0x2017ad);var _0x92493a=[];var _0x3e125f=squel[_0x01ef('0x4f')]()['field']('id')[_0x01ef('0x50')]('name')[_0x01ef('0x50')]('color')[_0x01ef('0x51')](_0x01ef('0x52'));var _0x33da9e=squel['select']()[_0x01ef('0x50')]('u.id')[_0x01ef('0x50')]('u.fullname')[_0x01ef('0x50')](_0x01ef('0x53'))[_0x01ef('0x51')](_0x01ef('0x54'),'ui')['left_join']('users','u',_0x01ef('0x55'));var _0x34d407=squel[_0x01ef('0x4f')]()[_0x01ef('0x51')]('openchannel_interactions','i')[_0x01ef('0x56')](_0x01ef('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x01ef('0x56')](_0x01ef('0x58'),'o',_0x01ef('0x59'))[_0x01ef('0x56')]('openchannel_accounts','a',_0x01ef('0x5a'))[_0x01ef('0x56')](_0x01ef('0x5b'),'me',_0x01ef('0x5c'))[_0x01ef('0x56')](_0x01ef('0x5d'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x01ef('0x56')](_0x01ef('0x52'),'t',_0x01ef('0x5e'));var _0x63284d=squel[_0x01ef('0x5f')]();var _0x18c4b6=[];var _0x8dafb4=squel[_0x01ef('0x5f')]();var _0x5ef7a7;if(_0x269420[_0x01ef('0x43')][_0x01ef('0x60')]){_0x5ef7a7=as[_0x01ef('0x61')](_0x269420[_0x01ef('0x43')][_0x01ef('0x60')]);var _0x19b37e=_0x5ef7a7[_0x01ef('0x62')];for(var _0x19e63d=0x0;_0x19e63d<_0x5ef7a7[_0x01ef('0x63')][_0x01ef('0x48')];_0x19e63d++){var _0x2b51b1=_0x5ef7a7['conditions'][_0x19e63d];var _0x5104b1='i';var _0x3ce8c2=_['find'](_0x2017ad,[_0x01ef('0x2a'),_0x2b51b1['field']]);if(!_0x3ce8c2){switch(_0x2b51b1['field']){case _0x01ef('0x64'):if(_0x2b51b1['value']==0x1){_0x34d407['having']('`'+_0x2b51b1['field']+'`\x20=\x200');}else{_0x34d407[_0x01ef('0x65')]('`'+_0x2b51b1[_0x01ef('0x50')]+_0x01ef('0x66'));}break;case _0x01ef('0x67'):if(_0x2b51b1[_0x01ef('0x68')]==='$substring'){if(_0x2b51b1[_0x01ef('0x69')][_0x01ef('0x30')]('\x20')[_0x01ef('0x48')]>0x1){_0x63284d[_0x19b37e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x01ef('0x6a')](_0x2b51b1[_0x01ef('0x69')]),null);}else{var _0x52b3bf='%'+_0x2b51b1[_0x01ef('0x69')]+'%';_0x63284d[_0x19b37e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x52b3bf,_0x52b3bf,_0x52b3bf);}}else{_0x3ce8c2=_[_0x01ef('0x6b')](_0x2017ad,[_0x01ef('0x2a'),_0x01ef('0x6c')]);_0x2b51b1['field']=_0x01ef('0x6c');_0x4ff9d0=as[_0x01ef('0x6d')](_0x5104b1,_0x3ce8c2[_0x01ef('0x3f')],_0x2b51b1);_0x63284d[_0x19b37e](_0x4ff9d0[_0x01ef('0x6e')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x6f')],_0x4ff9d0[_0x01ef('0x69')]['end']);}break;case _0x01ef('0x70'):var _0x12b19b=_0x2b51b1['value'][_0x01ef('0x30')](',')[_0x01ef('0x42')](function(_0x4614b1){return Number(_0x4614b1);});_0x12b19b[_0x01ef('0x31')](function(_0xe2cfb5){_0x8dafb4['or'](_0x01ef('0x71'),'%,'+_0xe2cfb5+',%');});_0x18c4b6=_[_0x01ef('0x72')](_0x18c4b6,_0x12b19b);break;case _0x01ef('0x73'):if(_0x2b51b1['operator']===_0x01ef('0x74')){_0x63284d[_0x19b37e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2b51b1[_0x01ef('0x69')]+'%',null);}else{_0x3ce8c2=_['find'](_0x2017ad,['name',_0x01ef('0x37')]);_0x2b51b1[_0x01ef('0x50')]=_0x01ef('0x37');_0x4ff9d0=as[_0x01ef('0x6d')](_0x5104b1,_0x3ce8c2['type'],_0x2b51b1);_0x63284d[_0x19b37e](_0x4ff9d0[_0x01ef('0x6e')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x6f')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x27')]);}break;case _0x01ef('0x75'):_0x4ff9d0=as[_0x01ef('0x6d')]('me',null,_0x2b51b1);_0x63284d[_0x19b37e](_0x4ff9d0[_0x01ef('0x6e')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x6f')],_0x4ff9d0[_0x01ef('0x69')]['end']);break;}}else{var _0x4ff9d0=as[_0x01ef('0x6d')](_0x5104b1,_0x3ce8c2['type'],_0x2b51b1);_0x63284d[_0x19b37e](_0x4ff9d0[_0x01ef('0x6e')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x6f')],_0x4ff9d0[_0x01ef('0x69')][_0x01ef('0x27')]);}}}else{var _0x47c880=_(_0x269420[_0x01ef('0x43')])[_0x01ef('0x44')]()[_0x01ef('0x42')](function(_0x4814b2){return _[_0x01ef('0x76')](_0x2017ad,['name',_0x4814b2])?_0x4814b2:undefined;})[_0x01ef('0x77')]()['value']();if(!_[_0x01ef('0x78')](_0x47c880)){_0x47c880[_0x01ef('0x31')](function(_0x408cf0){if(_0x408cf0===_0x01ef('0x79')){_0x34d407[_0x01ef('0x4c')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x269420[_0x01ef('0x43')][_0x408cf0]));}else if(_0x408cf0===_0x01ef('0x7a')){var _0x2276f1=JSON[_0x01ef('0x7b')](_0x269420[_0x01ef('0x43')][_0x408cf0])['$gte'];var _0x4da2a4=JSON[_0x01ef('0x7b')](_0x269420[_0x01ef('0x43')][_0x408cf0])[_0x01ef('0x7c')];_0x34d407[_0x01ef('0x4c')](_0x01ef('0x7d'),_0x2276f1,_0x4da2a4);}else{if(_0x269420[_0x01ef('0x43')][_0x408cf0]===_0x01ef('0x7e')){_0x34d407[_0x01ef('0x4c')]('i.'+_0x408cf0+_0x01ef('0x7f'));}else{_0x34d407['where']('i.'+_0x408cf0+_0x01ef('0x80'),_0x269420[_0x01ef('0x43')][_0x408cf0]);}}});}if(_0x269420[_0x01ef('0x43')][_0x01ef('0x81')]){if(_0x269420[_0x01ef('0x43')][_0x01ef('0x81')]==0x1){_0x34d407[_0x01ef('0x65')]('`unreadMessages`\x20=\x200');}else{_0x34d407['having'](_0x01ef('0x82'));}}if(_0x269420[_0x01ef('0x43')]['tag']){_0x18c4b6=_[_0x01ef('0x83')](_0x269420[_0x01ef('0x43')][_0x01ef('0x84')])?_0x269420[_0x01ef('0x43')]['tag']:new Array(_0x269420[_0x01ef('0x43')]['tag']);_0x18c4b6[_0x01ef('0x31')](function(_0x5321eb){_0x8dafb4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5321eb+',%');});}if(_0x269420[_0x01ef('0x43')][_0x01ef('0x85')]){var _0xfae1b1=_0x269420[_0x01ef('0x43')][_0x01ef('0x85')][_0x01ef('0x86')]('\x5c','\x5c\x5c')[_0x01ef('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xfae1b1)){_0x63284d['or'](_0x01ef('0x87'),_0xfae1b1+'%');}else{_0x63284d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x01ef('0x6a')](_0xfae1b1))['or'](_0x01ef('0x88'),_0xfae1b1+'%')['or'](_0x01ef('0x89'),_0xfae1b1+'%');}}}_0x34d407[_0x01ef('0x4c')](_0x63284d);_0x34d407[_0x01ef('0x8a')](_0x01ef('0x8b'));var _0x736f4e={'type':db['Sequelize'][_0x01ef('0x8c')]['SELECT'],'raw':!![]};var _0x551c97=_0x34d407[_0x01ef('0x8d')]();_0x551c97[_0x01ef('0x50')](_0x01ef('0x8b'));_0x551c97['field'](_0x01ef('0x8e'),_0x01ef('0x64'));if(_0x432a4d[_0x01ef('0x4a')]){_0x432a4d[_0x01ef('0x4a')][_0x01ef('0x31')](function(_0xefdd2b){var _0x2ece07=_0xefdd2b[0x0]===_0x01ef('0x8f')?_0xefdd2b[0x0]:'i.'+_0xefdd2b[0x0];_0x34d407[_0x01ef('0x4a')](_0x2ece07,_0xefdd2b[0x1]===_0x01ef('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x18c4b6)){_0x34d407['having'](_0x8dafb4);_0x551c97[_0x01ef('0x4c')](_0x01ef('0x91'),_0x18c4b6);}BPromise['resolve']()[_0x01ef('0x26')](function(){if(!_0x5ef7a7){if(_0x269420['query']['OpenchannelAccountId'])return;_0x551c97[_0x01ef('0x4c')](_0x01ef('0x92'));_0x34d407[_0x01ef('0x4c')](_0x01ef('0x92'));return;}if(_0x269420['user'][_0x01ef('0x93')]!==_0x01ef('0x94'))return;return _0x269420[_0x01ef('0x95')][_0x01ef('0x96')]({'attributes':['id'],'raw':!![]})[_0x01ef('0x26')](function(_0x331adf){if(_[_0x01ef('0x78')](_0x331adf)){_0x551c97['where'](_0x01ef('0x97'));_0x34d407[_0x01ef('0x4c')](_0x01ef('0x97'));}else{_0x551c97['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x01ef('0x42')](_0x331adf,'id'));_0x34d407['where'](_0x01ef('0x98'),_[_0x01ef('0x42')](_0x331adf,'id'));}});})[_0x01ef('0x26')](function(){if(_0x269420[_0x01ef('0x95')]['role']==='agent'&&!_0x5ef7a7&&!_0x269420['query'][_0x01ef('0x79')])return[];return db[_0x01ef('0x99')]['query'](_0x551c97['toString'](),_0x736f4e);})['then'](function(_0x12130a){_0x1e8a1d['count']=_0x12130a[_0x01ef('0x48')];if(_0x1e8a1d[_0x01ef('0x21')]===0x0)return[];return db['sequelize'][_0x01ef('0x43')](_0x3e125f[_0x01ef('0x9a')](),_0x736f4e)['then'](function(_0x1bee4b){_0x92493a=_['keyBy'](_0x1bee4b,'id');_0x736f4e=_['merge'](_0x736f4e,{'model':db[_0x01ef('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x269420[_0x01ef('0x43')][_0x01ef('0x47')]){_0x432a4d[_0x01ef('0x45')][_0x01ef('0x31')](function(_0x329ad4){_0x34d407[_0x01ef('0x50')]('i.'+_0x329ad4);});}else{_0x34d407[_0x01ef('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x01ef('0x64'));_0x34d407['field'](_0x01ef('0x9b'),_0x01ef('0x9c'));_0x34d407[_0x01ef('0x50')](_0x01ef('0x9d'),_0x01ef('0x9e'));_0x34d407['field'](_0x01ef('0x9f'),_0x01ef('0x8f'));_0x34d407[_0x01ef('0x50')](_0x01ef('0xa0'));_0x34d407[_0x01ef('0x50')](_0x01ef('0xa1'),_0x01ef('0xa2'));_0x34d407['field'](_0x01ef('0xa3'),_0x01ef('0xa4'));_0x34d407[_0x01ef('0x50')]('c.email',_0x01ef('0xa5'));_0x34d407['field'](_0x01ef('0xa6'),'Contact.phone');_0x34d407['field'](_0x01ef('0xa7'),_0x01ef('0xa8'));_0x34d407['field'](_0x01ef('0xa9'),_0x01ef('0xaa'));_0x34d407[_0x01ef('0x50')]('o.fullname',_0x01ef('0xab'));_0x34d407[_0x01ef('0x50')](_0x01ef('0xac'),'Owner.internal');_0x34d407['field'](_0x01ef('0xad'),_0x01ef('0x2e'));}if(_0x432a4d['limit'])_0x34d407['limit'](_0x432a4d['limit']);if(_0x432a4d[_0x01ef('0x22')])_0x34d407[_0x01ef('0x22')](_0x432a4d[_0x01ef('0x22')]);return db[_0x01ef('0x99')][_0x01ef('0x43')](_0x34d407['toString'](),_0x736f4e);})['then'](function(_0x31a8e1){if(_0x31a8e1[_0x01ef('0x48')]>0x0)_0x33da9e[_0x01ef('0x4c')](_0x01ef('0xae'),_[_0x01ef('0x42')](_0x31a8e1,'id'));return db[_0x01ef('0x99')][_0x01ef('0x43')](_0x33da9e['toString'](),_0x736f4e)[_0x01ef('0x26')](function(_0x1ffbba){var _0x34bdbd=_[_0x01ef('0xaf')](_0x1ffbba,_0x01ef('0xb0'));var _0x397366=[];_0x31a8e1['forEach'](function(_0x176113){_0x397366[_0x01ef('0x38')](updateOpenchannelInteraction(_0x176113,_0x92493a,_0x34bdbd));});return BPromise[_0x01ef('0xb1')](_0x397366);});});})['then'](function(_0xa5d062){_0x1e8a1d[_0x01ef('0xb2')]=_0xa5d062;return _0x1e8a1d;})[_0x01ef('0x26')](respondWithFilteredResult(_0x1d80d4,_0x432a4d))[_0x01ef('0x32')](handleError(_0x1d80d4,null));};exports[_0x01ef('0xb3')]=function(_0x4f940d,_0x32ec58){var _0x985cd0={};if(_0x4f940d['query'][_0x01ef('0x3f')]&&_0x4f940d[_0x01ef('0x43')][_0x01ef('0x3f')]===_0x01ef('0x51')){_0x985cd0[_0x01ef('0x51')]=_0x4f940d[_0x01ef('0xb4')]['id'];}else{_0x985cd0['id']=_0x4f940d[_0x01ef('0xb4')]['id'];}var _0x3aa46e={'raw':![],'where':_0x985cd0},_0x3a112a={};_0x3a112a['model']=_[_0x01ef('0x44')](db['OpenchannelInteraction'][_0x01ef('0x3d')]);_0x3a112a[_0x01ef('0x43')]=_[_0x01ef('0x44')](_0x4f940d[_0x01ef('0x43')]);_0x3a112a[_0x01ef('0x4e')]=_[_0x01ef('0x46')](_0x3a112a['model'],_0x3a112a[_0x01ef('0x43')]);_0x3aa46e[_0x01ef('0x45')]=_[_0x01ef('0x46')](_0x3a112a['model'],qs[_0x01ef('0x47')](_0x4f940d[_0x01ef('0x43')][_0x01ef('0x47')]));_0x3aa46e[_0x01ef('0x45')]=_0x3aa46e[_0x01ef('0x45')][_0x01ef('0x48')]?_0x3aa46e[_0x01ef('0x45')]:_0x3a112a[_0x01ef('0x41')];if(_0x4f940d[_0x01ef('0x43')][_0x01ef('0xb5')]){_0x3aa46e[_0x01ef('0xb6')]=[{'all':!![]}];}_0x3aa46e=_[_0x01ef('0xb7')]({},_0x3aa46e,_0x4f940d[_0x01ef('0xb8')]);return db[_0x01ef('0x3c')][_0x01ef('0x6b')](_0x3aa46e)[_0x01ef('0x26')](handleEntityNotFound(_0x32ec58,null))['then'](respondWithResult(_0x32ec58,null))[_0x01ef('0x32')](handleError(_0x32ec58,null));};exports['create']=function(_0x189f13,_0x5911db){return db[_0x01ef('0x3c')][_0x01ef('0xb9')](_0x189f13[_0x01ef('0x75')],{})[_0x01ef('0x26')](respondWithResult(_0x5911db,0xc9))[_0x01ef('0x32')](handleError(_0x5911db,null));};exports['update']=function(_0x5e197e,_0x296f27){if(_0x5e197e['body']['id']){delete _0x5e197e[_0x01ef('0x75')]['id'];}return db['OpenchannelInteraction'][_0x01ef('0x6b')]({'where':{'id':_0x5e197e[_0x01ef('0xb4')]['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x296f27,null))['then'](saveUpdates(_0x5e197e[_0x01ef('0x75')],null))[_0x01ef('0x26')](respondWithResult(_0x296f27,null))[_0x01ef('0x32')](handleError(_0x296f27,null));};exports[_0x01ef('0xba')]=function(_0x517708,_0x91a79){return db[_0x01ef('0x3c')][_0x01ef('0x6b')]({'where':{'id':_0x517708[_0x01ef('0xb4')]['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x91a79,null))[_0x01ef('0x26')](removeEntity(_0x91a79,null))[_0x01ef('0x32')](handleError(_0x91a79,null));};exports[_0x01ef('0xbb')]=function(_0x4f8124,_0x525bac){return db[_0x01ef('0x3c')][_0x01ef('0xbb')]()[_0x01ef('0x26')](respondWithResult(_0x525bac,null))[_0x01ef('0x32')](handleError(_0x525bac,null));};exports[_0x01ef('0xbc')]=function(_0x58a679,_0x510e9e,_0x37f57b){return db[_0x01ef('0xbd')][_0x01ef('0x6b')]({'where':{'id':_0x58a679[_0x01ef('0xb4')]['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x510e9e,null))[_0x01ef('0x26')](function(_0x1fce99){if(_0x1fce99){return _0x1fce99[_0x01ef('0xbc')](_0x58a679['body']['ids'],_[_0x01ef('0xbe')](_0x58a679[_0x01ef('0x75')],[_0x01ef('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x510e9e,null))[_0x01ef('0x32')](handleError(_0x510e9e,null));};exports[_0x01ef('0xc0')]=function(_0x40b94f,_0x5558ee,_0x18add9){var _0x2b8bb1={'raw':![],'where':{}};var _0x54ef49={};var _0x28c83f={'count':0x0,'rows':[]};return db[_0x01ef('0x3c')][_0x01ef('0xc1')]({'where':{'id':_0x40b94f[_0x01ef('0xb4')]['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x5558ee,null))[_0x01ef('0x26')](function(_0x305526){if(_0x305526){_0x54ef49[_0x01ef('0x41')]=_[_0x01ef('0x44')](db['OpenchannelMessage'][_0x01ef('0x3d')]);_0x54ef49['query']=_[_0x01ef('0x44')](_0x40b94f[_0x01ef('0x43')]);_0x54ef49['filters']=_[_0x01ef('0x46')](_0x54ef49[_0x01ef('0x41')],_0x54ef49[_0x01ef('0x43')]);_0x2b8bb1['attributes']=_['intersection'](_0x54ef49['model'],qs[_0x01ef('0x47')](_0x40b94f[_0x01ef('0x43')][_0x01ef('0x47')]));_0x2b8bb1['attributes']=_0x2b8bb1[_0x01ef('0x45')][_0x01ef('0x48')]?_0x2b8bb1[_0x01ef('0x45')]:_0x54ef49[_0x01ef('0x41')];if(!_0x40b94f[_0x01ef('0x43')][_0x01ef('0x49')]('nolimit')){_0x2b8bb1[_0x01ef('0x1f')]=qs[_0x01ef('0x1f')](_0x40b94f[_0x01ef('0x43')]['limit']);_0x2b8bb1[_0x01ef('0x22')]=qs[_0x01ef('0x22')](_0x40b94f[_0x01ef('0x43')]['offset']);}_0x2b8bb1[_0x01ef('0x4a')]=qs[_0x01ef('0x4b')](_0x40b94f[_0x01ef('0x43')][_0x01ef('0x4b')]);_0x2b8bb1[_0x01ef('0x4c')]=qs[_0x01ef('0x4e')](_[_0x01ef('0x4d')](_0x40b94f[_0x01ef('0x43')],_0x54ef49['filters']));_0x2b8bb1[_0x01ef('0x4c')][_0x01ef('0xb0')]=_0x305526['id'];if(_0x40b94f[_0x01ef('0x43')][_0x01ef('0x85')]){_0x2b8bb1[_0x01ef('0x4c')]=_[_0x01ef('0xb7')](_0x2b8bb1[_0x01ef('0x4c')],{'$or':_[_0x01ef('0x42')](_0x2b8bb1[_0x01ef('0x45')],function(_0x1344f2){var _0x3d1432={};_0x3d1432[_0x1344f2]={'$like':'%'+_0x40b94f['query']['filter']+'%'};return _0x3d1432;})});}if(_0x40b94f[_0x01ef('0x43')][_0x01ef('0xc2')]){var _0x37bc59=_0x40b94f[_0x01ef('0x43')][_0x01ef('0xc2')][_0x01ef('0x30')](',');var _0x5b9d24={};_0x5b9d24[_0x37bc59[0x0]]={'$gte':moment(_0x37bc59[0x1])['format'](_0x01ef('0xc3'))};_0x2b8bb1[_0x01ef('0x4c')]=_[_0x01ef('0xb7')](_0x2b8bb1[_0x01ef('0x4c')],_0x5b9d24);}_0x2b8bb1=_[_0x01ef('0xb7')]({},_0x2b8bb1,_0x40b94f[_0x01ef('0xb8')]);return db[_0x01ef('0xbd')][_0x01ef('0x21')]({'where':_0x2b8bb1[_0x01ef('0x4c')]})[_0x01ef('0x26')](function(_0x3558f0){_0x28c83f[_0x01ef('0x21')]=_0x3558f0;if(_0x40b94f[_0x01ef('0x43')][_0x01ef('0xb5')]){_0x2b8bb1[_0x01ef('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x01ef('0xc4')](_0x2b8bb1);})['then'](function(_0x303614){_0x28c83f[_0x01ef('0xb2')]=_0x303614;return _0x28c83f;});}})[_0x01ef('0x26')](respondWithFilteredResult(_0x5558ee,_0x2b8bb1))['catch'](handleError(_0x5558ee,null));};exports['addTags']=function(_0x211cb2,_0x475e9,_0x15ed85){return db[_0x01ef('0x3c')][_0x01ef('0x6b')]({'where':{'id':_0x211cb2[_0x01ef('0xb4')]['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x475e9,null))[_0x01ef('0x26')](function(_0x3d3ec3){if(_0x3d3ec3){return _0x3d3ec3[_0x01ef('0xc5')](_0x211cb2[_0x01ef('0x75')][_0x01ef('0xbf')],_['omit'](_0x211cb2[_0x01ef('0x75')],[_0x01ef('0xbf'),'id'])||{})[_0x01ef('0xc6')](function(){return db['Tag'][_0x01ef('0xc4')]({'attributes':['id',_0x01ef('0x2a'),'color'],'where':{'id':_0x211cb2[_0x01ef('0x75')]['ids']}});})['then'](function(_0x1b37e6){socket[_0x01ef('0xc7')](_0x01ef('0xc8'),{'id':Number(_0x211cb2['params']['id']),'tags':_0x1b37e6||[]});return{'id':Number(_0x211cb2['params']['id']),'tags':_0x1b37e6||[]};});}})[_0x01ef('0x26')](respondWithResult(_0x475e9,null))[_0x01ef('0x32')](handleError(_0x475e9,null));};exports[_0x01ef('0xc9')]=function(_0x44f8dd,_0x2d8980,_0x1a7392){return db[_0x01ef('0x3c')]['find']({'where':{'id':_0x44f8dd['params']['id']}})[_0x01ef('0x26')](handleEntityNotFound(_0x2d8980,null))[_0x01ef('0x26')](function(_0x1b2243){if(_0x1b2243){return _0x1b2243[_0x01ef('0xc9')](_0x44f8dd[_0x01ef('0x43')]['ids']);}})[_0x01ef('0x26')](respondWithStatusCode(_0x2d8980,null))[_0x01ef('0x32')](handleError(_0x2d8980,null));};exports[_0x01ef('0xca')]=function(_0x340f29,_0x39a9da){var _0x62c157=moment()[_0x01ef('0xcb')]()[_0x01ef('0x9a')]();var _0x53a6fc=path[_0x01ef('0xcc')](config['root'],_0x01ef('0xcd'),_0x01ef('0xce'),_0x01ef('0xcf'));var _0xeed41d=path[_0x01ef('0xcc')](config[_0x01ef('0xd0')],'server','files','attachments');var _0x46ceff=path[_0x01ef('0xcc')](_0x53a6fc,_0x62c157);var _0x51a06e=util[_0x01ef('0xd1')](_0x01ef('0xd2'),_0x340f29[_0x01ef('0xb4')]['id'],_0x62c157);var _0x2f39b5=path[_0x01ef('0xcc')](_0x53a6fc,_0x51a06e);var _0x5ecaf6=[];_0x5ecaf6[_0x01ef('0x38')]({'model':db['User'],'as':_0x01ef('0x73'),'attributes':['id','fullname'],'raw':!![]});_0x5ecaf6[_0x01ef('0x38')]({'model':db[_0x01ef('0xd3')],'as':_0x01ef('0x67'),'attributes':['id',_0x01ef('0xd4'),'lastName'],'raw':!![]});if(_0x340f29[_0x01ef('0x43')][_0x01ef('0xd5')]){_0x5ecaf6['push']({'model':db[_0x01ef('0xd6')],'as':'Attachment','raw':!![]});}var _0x152e1a=[{'model':db['OpenchannelMessage'],'as':_0x01ef('0xd7'),'attributes':['id',_0x01ef('0x75'),_0x01ef('0x7a'),_0x01ef('0xd8'),'secret',_0x01ef('0x81')],'include':_0x5ecaf6}];_0x152e1a['push']({'model':db[_0x01ef('0xd9')],'as':'Account','attributes':['id',_0x01ef('0x2a')]});_0x152e1a[_0x01ef('0x38')]({'model':db[_0x01ef('0x73')],'as':_0x01ef('0xda'),'attributes':['id',_0x01ef('0x2d')]});return db[_0x01ef('0x3c')][_0x01ef('0x6b')]({'where':{'id':_0x340f29['params']['id']},'include':_0x152e1a})[_0x01ef('0x26')](handleEntityNotFound(_0x39a9da,null))['then'](function(_0x2e7d03){if(_0x2e7d03){var _0x126226=_0x2e7d03[_0x01ef('0xdb')]({'plain':!![]});fs[_0x01ef('0xdc')](_0x46ceff);var _0x5be4be={'channel':'Openchannel','account':_0x126226[_0x01ef('0xdd')][_0x01ef('0x2a')],'agent':_0x126226[_0x01ef('0xda')]?_0x126226[_0x01ef('0xda')][_0x01ef('0x2d')]:_0x01ef('0xde'),'createdAt':moment(_0x126226[_0x01ef('0x7a')])[_0x01ef('0xd1')](_0x01ef('0xc3'))['toString'](),'closedAt':_0x126226[_0x01ef('0x36')]?moment(_0x126226[_0x01ef('0xdf')])[_0x01ef('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x01ef('0x9a')]():'','disposition':_0x126226[_0x01ef('0xe0')],'visibility':_0x126226['threadId']?_0x01ef('0xe1'):_0x01ef('0xe2'),'messages':_(_0x126226[_0x01ef('0xd7')])[_0x01ef('0x85')]({'secret':![]})['map'](function(_0x489de1){if(_0x489de1['Attachment']){var _0x34b3d3=path[_0x01ef('0xcc')](_0xeed41d,_0x489de1[_0x01ef('0xd6')]['basename']);if(fs[_0x01ef('0xe3')](_0x34b3d3)){fs['createReadStream'](_0x34b3d3)[_0x01ef('0xe4')](fs[_0x01ef('0xe5')](path['join'](_0x46ceff,_0x489de1['Attachment']['basename'])));}}return{'date':moment(_0x489de1[_0x01ef('0x7a')])[_0x01ef('0xd1')](_0x01ef('0xc3'))[_0x01ef('0x9a')](),'sender':_0x489de1['direction']===_0x01ef('0xe6')?_0x489de1[_0x01ef('0x73')]?_0x489de1['User'][_0x01ef('0x2d')]:'System':_0x489de1['Contact'][_0x01ef('0xd4')]+(_0x489de1[_0x01ef('0x67')][_0x01ef('0xe7')]?'\x20'+_0x489de1[_0x01ef('0x67')][_0x01ef('0xe7')]:''),'body':_0x489de1['Attachment']?_0x489de1[_0x01ef('0xd6')][_0x01ef('0xe8')]:_0x489de1[_0x01ef('0x75')],'direction':_0x489de1['direction']===_0x01ef('0xe6')?'A':'C','secret':_0x489de1[_0x01ef('0xe9')],'read':_0x489de1[_0x01ef('0x81')],'attachment':_0x489de1[_0x01ef('0xd6')]};})['value']()};return ejs['renderFile'](path[_0x01ef('0xcc')](config[_0x01ef('0xd0')],_0x01ef('0xcd'),_0x01ef('0xea'),_0x01ef('0xeb')),{'interaction':_0x5be4be})['then'](function(_0x31a000){var _0x14c3a7=path[_0x01ef('0xcc')](_0x46ceff,_0x01ef('0xec')+_0x126226['id']+'-'+_0x62c157+'.pdf');var _0x16a5b3={'path':_0x14c3a7,'channel':_0x01ef('0xed'),'interactionId':_0x126226['id']};return pdf[_0x01ef('0xee')](_0x31a000,_0x16a5b3);})[_0x01ef('0x26')](function(){return new BPromise(function(_0x4c2bd3,_0xbe9fdc){zipdir(_0x46ceff,{'saveTo':_0x2f39b5},function(_0x31e921,_0x5aad5c){if(_0x31e921)return _0xbe9fdc(_0x31e921);return _0x4c2bd3(_0x5aad5c);});})['then'](function(){return new BPromise(function(_0x4b1331,_0x1db583){rimraf(_0x46ceff,function(_0x4a8e96){if(_0x4a8e96)_0x1db583(_0x4a8e96);return _0x4b1331();});});})[_0x01ef('0x26')](function(){return _0x39a9da[_0x01ef('0xca')](_0x2f39b5,_0x51a06e,function(_0x465bf6){if(_0x465bf6){console[_0x01ef('0xef')]('err',_0x465bf6);}else{fs['unlinkSync'](_0x2f39b5);}});});});}else{return _0x39a9da[_0x01ef('0x1c')](0xc8);}})['catch'](handleError(_0x39a9da,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f02e0c8..fb26bc9 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 _0xe98a=['OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x20c1f9,_0x58589d){var _0x4ff7df=function(_0x165bb5){while(--_0x165bb5){_0x20c1f9['push'](_0x20c1f9['shift']());}};_0x4ff7df(++_0x58589d);}(_0xe98a,0xc4));var _0xae98=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0xe98a[_0x40b493];return _0x548365;};'use strict';var EventEmitter=require(_0xae98('0x0'));var OpenchannelInteraction=require(_0xae98('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xae98('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xae98('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae98('0x4'),'afterDestroy':_0xae98('0x5')};function emitEvent(_0x44b5c9){return function(_0x279fbb,_0x5687c2,_0x396567){_0x279fbb[_0xae98('0x6')]({'attributes':['id'],'raw':!![]})[_0xae98('0x7')](function(_0x380d8b){_0x279fbb['setDataValue'](_0xae98('0x8'),_0x380d8b[_0xae98('0x9')](function(_0x49ee2d){return{'id':_0x49ee2d['id']};}));return OpenchannelMessage[_0xae98('0xa')]({'where':{'OpenchannelInteractionId':_0x279fbb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4fbc67){_0x279fbb[_0xae98('0xb')](_0xae98('0xc'),_0x4fbc67[_0xae98('0xd')]);OpenchannelInteractionEvents[_0xae98('0xe')](_0x44b5c9+':'+_0x279fbb['id'],_0x279fbb);OpenchannelInteractionEvents[_0xae98('0xe')](_0x44b5c9,_0x279fbb);_0x396567(null);})[_0xae98('0xf')](_0x396567(null));};}for(var e in events){if(events[_0xae98('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xae98('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbb27=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x2932fe,_0x12087d){var _0xec1fd4=function(_0x3b6aba){while(--_0x3b6aba){_0x2932fe['push'](_0x2932fe['shift']());}};_0xec1fd4(++_0x12087d);}(_0xbb27,0x1c0));var _0x7bb2=function(_0x4a7389,_0x5b0e4e){_0x4a7389=_0x4a7389-0x0;var _0x56aea0=_0xbb27[_0x4a7389];return _0x56aea0;};'use strict';var EventEmitter=require(_0x7bb2('0x0'));var OpenchannelInteraction=require(_0x7bb2('0x1'))['db'][_0x7bb2('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7bb2('0x3')](0x0);var events={'afterCreate':_0x7bb2('0x4'),'afterUpdate':_0x7bb2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3be735){return function(_0x501a71,_0x525872,_0x52d427){_0x501a71[_0x7bb2('0x6')]({'attributes':['id'],'raw':!![]})[_0x7bb2('0x7')](function(_0x269462){_0x501a71[_0x7bb2('0x8')](_0x7bb2('0x9'),_0x269462[_0x7bb2('0xa')](function(_0x39ed4e){return{'id':_0x39ed4e['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x501a71['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7bb2('0x7')](function(_0x27f991){_0x501a71[_0x7bb2('0x8')]('unreadMessages',_0x27f991[_0x7bb2('0xb')]);OpenchannelInteractionEvents[_0x7bb2('0xc')](_0x3be735+':'+_0x501a71['id'],_0x501a71);OpenchannelInteractionEvents['emit'](_0x3be735,_0x501a71);_0x52d427(null);})[_0x7bb2('0xd')](_0x52d427(null));};}for(var e in events){if(events[_0x7bb2('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x7bb2('0xf')](e,emitEvent(event));}}module[_0x7bb2('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index c39bff2..ef97954 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 _0xedca=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed'];(function(_0x4d3a1b,_0x3462d1){var _0x2c94f0=function(_0x365bdd){while(--_0x365bdd){_0x4d3a1b['push'](_0x4d3a1b['shift']());}};_0x2c94f0(++_0x3462d1);}(_0xedca,0x15c));var _0xaedc=function(_0x22dfed,_0x28bd78){_0x22dfed=_0x22dfed-0x0;var _0x41623e=_0xedca[_0x22dfed];return _0x41623e;};'use strict';var _=require(_0xaedc('0x0'));var util=require(_0xaedc('0x1'));var logger=require(_0xaedc('0x2'))(_0xaedc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaedc('0x4'));var fs=require('fs');var path=require(_0xaedc('0x5'));var rimraf=require(_0xaedc('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xaedc('0x7')]=function(_0x25babe,_0x4414dc){return _0x25babe['define'](_0xaedc('0x8'),attributes,{'tableName':_0xaedc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xaedc('0xa'),'hooks':{'beforeUpdate':function(_0x14e71a,_0x1eea05,_0x1a1ac4){if(_0x14e71a[_0xaedc('0xb')](_0xaedc('0xc'))){_0x14e71a['closedAt']=moment()[_0xaedc('0xd')](_0xaedc('0xe'));}_0x1a1ac4(null,_0x14e71a);}}});}; \ No newline at end of file +var _0xe9f2=['bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x5bd61b,_0x60f6ca){var _0x1d128f=function(_0x43ed86){while(--_0x43ed86){_0x5bd61b['push'](_0x5bd61b['shift']());}};_0x1d128f(++_0x60f6ca);}(_0xe9f2,0xfb));var _0x2e9f=function(_0x9883cb,_0x569b08){_0x9883cb=_0x9883cb-0x0;var _0x9521e0=_0xe9f2[_0x9883cb];return _0x9521e0;};'use strict';var _=require('lodash');var util=require(_0x2e9f('0x0'));var logger=require(_0x2e9f('0x1'))(_0x2e9f('0x2'));var moment=require(_0x2e9f('0x3'));var BPromise=require(_0x2e9f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e9f('0x5'));var rimraf=require(_0x2e9f('0x6'));var config=require(_0x2e9f('0x7'));var attributes=require(_0x2e9f('0x8'));module[_0x2e9f('0x9')]=function(_0x3c0dc3,_0x1f91ed){return _0x3c0dc3[_0x2e9f('0xa')](_0x2e9f('0xb'),attributes,{'tableName':_0x2e9f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e9f('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x183f1e,_0x552b08,_0x3fdd80){if(_0x183f1e['changed']('closed')){_0x183f1e[_0x2e9f('0xe')]=moment()[_0x2e9f('0xf')](_0x2e9f('0x10'));}_0x3fdd80(null,_0x183f1e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b17b0b7..94c4b87 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 _0xfd87=['limit','then','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes'];(function(_0x38c202,_0x299906){var _0xb66482=function(_0x55374d){while(--_0x55374d){_0x38c202['push'](_0x38c202['shift']());}};_0xb66482(++_0x299906);}(_0xfd87,0x10b));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var rs=require(_0x7fd8('0x4'));var fs=require('fs');var Redis=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];var utils=require(_0x7fd8('0x7'));var logger=require('../../config/logger')(_0x7fd8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7fd8('0x9')]=_[_0x7fd8('0xa')](config['redis'],{'host':_0x7fd8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fd8('0x9')]));require(_0x7fd8('0xc'))['register'](socket);function respondWithRpcPromise(_0x33ea66,_0x524f14,_0x19532){return new BPromise(function(_0x1efe20,_0x4d79a8){return client[_0x7fd8('0xd')](_0x33ea66,_0x19532)['then'](function(_0x38e219){logger[_0x7fd8('0xe')](_0x7fd8('0xf'),_0x524f14,_0x7fd8('0x10'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x524f14,_0x7fd8('0x10'),JSON[_0x7fd8('0x11')](_0x38e219));if(_0x38e219[_0x7fd8('0x12')]){if(_0x38e219[_0x7fd8('0x12')][_0x7fd8('0x13')]===0x1f4){logger[_0x7fd8('0x12')](_0x7fd8('0xf'),_0x524f14,_0x38e219[_0x7fd8('0x12')][_0x7fd8('0x14')]);return _0x4d79a8(_0x38e219[_0x7fd8('0x12')][_0x7fd8('0x14')]);}logger[_0x7fd8('0x12')](_0x7fd8('0xf'),_0x524f14,_0x38e219['error'][_0x7fd8('0x14')]);return _0x1efe20(_0x38e219[_0x7fd8('0x12')][_0x7fd8('0x14')]);}else{logger[_0x7fd8('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x524f14,_0x7fd8('0x10'));_0x1efe20(_0x38e219['result'][_0x7fd8('0x14')]);}})[_0x7fd8('0x15')](function(_0x39412f){logger[_0x7fd8('0x12')](_0x7fd8('0xf'),_0x524f14,_0x39412f);_0x4d79a8(_0x39412f);});});}exports[_0x7fd8('0x16')]=function(_0x40f556){var _0x42072f=this;return new Promise(function(_0x582bca,_0x154e66){return db[_0x7fd8('0x17')][_0x7fd8('0x18')](_0x40f556[_0x7fd8('0x19')],{'raw':_0x40f556[_0x7fd8('0x1a')]?_0x40f556[_0x7fd8('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f556[_0x7fd8('0x1a')]?_0x40f556[_0x7fd8('0x1a')][_0x7fd8('0x1b')]||null:null,'attributes':_0x40f556[_0x7fd8('0x1a')]?_0x40f556['options'][_0x7fd8('0x1c')]||null:null,'limit':_0x40f556[_0x7fd8('0x1a')]?_0x40f556[_0x7fd8('0x1a')][_0x7fd8('0x1d')]||null:null})[_0x7fd8('0x1e')](function(_0x1a1d6c){logger[_0x7fd8('0xe')]('UpdateOpenchannelInteraction',_0x40f556);logger['debug'](_0x7fd8('0x16'),_0x40f556,JSON[_0x7fd8('0x11')](_0x1a1d6c));_0x582bca(_0x1a1d6c);})['catch'](function(_0x4ecfb9){logger['error'](_0x7fd8('0x16'),_0x4ecfb9[_0x7fd8('0x14')],_0x40f556);_0x154e66(_0x42072f['error'](0x1f4,_0x4ecfb9[_0x7fd8('0x14')]));});});};exports[_0x7fd8('0x1f')]=function(_0x30ebb7){return new Promise(function(_0x4bea04,_0x1dea4b){return db[_0x7fd8('0x17')][_0x7fd8('0x20')]({'where':_0x30ebb7[_0x7fd8('0x1a')]?_0x30ebb7[_0x7fd8('0x1a')]['where']||null:null})['then'](function(_0x225bb1){if(_0x225bb1){return _0x225bb1[_0x7fd8('0x21')](_0x30ebb7[_0x7fd8('0x19')]['ids'],_[_0x7fd8('0x22')](_0x30ebb7[_0x7fd8('0x19')],[_0x7fd8('0x23'),'id'])||{});}})['spread'](function(_0x29caa6){logger[_0x7fd8('0xe')](_0x7fd8('0x24'),_0x30ebb7);logger['debug'](_0x7fd8('0x24'),_0x30ebb7,JSON['stringify'](_0x29caa6));_0x4bea04(_0x29caa6);})['catch'](function(_0x4ded69){logger['error'](_0x7fd8('0x24'),_0x4ded69[_0x7fd8('0x14')],_0x30ebb7);_0x1dea4b(_this[_0x7fd8('0x12')](0x1f4,_0x4ded69['message']));});});}; \ No newline at end of file +var _0xb586=['update','body','options','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x484d88,_0x5dbe1c){var _0x4cfcb1=function(_0x29d5ff){while(--_0x29d5ff){_0x484d88['push'](_0x484d88['shift']());}};_0x4cfcb1(++_0x5dbe1c);}(_0xb586,0xb1));var _0x6b58=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xb586[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x6b58('0x0'));var util=require('util');var moment=require(_0x6b58('0x1'));var BPromise=require(_0x6b58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b58('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b58('0x4'));var logger=require(_0x6b58('0x5'))(_0x6b58('0x6'));var config=require(_0x6b58('0x7'));var jayson=require(_0x6b58('0x8'));var client=jayson['client'][_0x6b58('0x9')]({'port':0x232a});config[_0x6b58('0xa')]=_[_0x6b58('0xb')](config['redis'],{'host':_0x6b58('0xc'),'port':0x18eb});var socket=require(_0x6b58('0xd'))(new Redis(config[_0x6b58('0xa')]));require(_0x6b58('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b3850,_0x4109e2,_0x1dcafd){return new BPromise(function(_0x4cd1aa,_0x156230){return client[_0x6b58('0xf')](_0x1b3850,_0x1dcafd)[_0x6b58('0x10')](function(_0x471146){logger[_0x6b58('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4109e2,_0x6b58('0x12'));logger['debug'](_0x6b58('0x13'),_0x4109e2,_0x6b58('0x12'),JSON[_0x6b58('0x14')](_0x471146));if(_0x471146[_0x6b58('0x15')]){if(_0x471146[_0x6b58('0x15')]['code']===0x1f4){logger[_0x6b58('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4109e2,_0x471146['error'][_0x6b58('0x16')]);return _0x156230(_0x471146[_0x6b58('0x15')][_0x6b58('0x16')]);}logger[_0x6b58('0x15')](_0x6b58('0x17'),_0x4109e2,_0x471146[_0x6b58('0x15')][_0x6b58('0x16')]);return _0x4cd1aa(_0x471146[_0x6b58('0x15')][_0x6b58('0x16')]);}else{logger['info'](_0x6b58('0x17'),_0x4109e2,_0x6b58('0x12'));_0x4cd1aa(_0x471146[_0x6b58('0x18')][_0x6b58('0x16')]);}})[_0x6b58('0x19')](function(_0x358634){logger[_0x6b58('0x15')](_0x6b58('0x17'),_0x4109e2,_0x358634);_0x156230(_0x358634);});});}exports[_0x6b58('0x1a')]=function(_0x3ecd86){var _0x31b5c6=this;return new Promise(function(_0xc7c32c,_0x28e414){return db[_0x6b58('0x1b')][_0x6b58('0x1c')](_0x3ecd86[_0x6b58('0x1d')],{'raw':_0x3ecd86[_0x6b58('0x1e')]?_0x3ecd86[_0x6b58('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ecd86['options']?_0x3ecd86[_0x6b58('0x1e')][_0x6b58('0x1f')]||null:null,'attributes':_0x3ecd86[_0x6b58('0x1e')]?_0x3ecd86['options'][_0x6b58('0x20')]||null:null,'limit':_0x3ecd86['options']?_0x3ecd86[_0x6b58('0x1e')][_0x6b58('0x21')]||null:null})['then'](function(_0xc8244e){logger['info']('UpdateOpenchannelInteraction',_0x3ecd86);logger[_0x6b58('0x22')](_0x6b58('0x1a'),_0x3ecd86,JSON[_0x6b58('0x14')](_0xc8244e));_0xc7c32c(_0xc8244e);})[_0x6b58('0x19')](function(_0x5de1c5){logger[_0x6b58('0x15')](_0x6b58('0x1a'),_0x5de1c5['message'],_0x3ecd86);_0x28e414(_0x31b5c6[_0x6b58('0x15')](0x1f4,_0x5de1c5['message']));});});};exports[_0x6b58('0x23')]=function(_0x2d1059){return new Promise(function(_0x11f7bf,_0x4fefd9){return db[_0x6b58('0x1b')]['find']({'where':_0x2d1059[_0x6b58('0x1e')]?_0x2d1059[_0x6b58('0x1e')][_0x6b58('0x1f')]||null:null})[_0x6b58('0x10')](function(_0x5ee26a){if(_0x5ee26a){return _0x5ee26a[_0x6b58('0x24')](_0x2d1059['body'][_0x6b58('0x25')],_[_0x6b58('0x26')](_0x2d1059[_0x6b58('0x1d')],[_0x6b58('0x25'),'id'])||{});}})[_0x6b58('0x27')](function(_0x5ab614){logger[_0x6b58('0x11')](_0x6b58('0x28'),_0x2d1059);logger[_0x6b58('0x22')](_0x6b58('0x28'),_0x2d1059,JSON['stringify'](_0x5ab614));_0x11f7bf(_0x5ab614);})[_0x6b58('0x19')](function(_0x91e0a9){logger[_0x6b58('0x15')]('AddTags',_0x91e0a9[_0x6b58('0x16')],_0x2d1059);_0x4fefd9(_this[_0x6b58('0x15')](0x1f4,_0x91e0a9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0bad357..e55c9be 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 _0x7194=['length','openchannelInteraction:','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7194,0x75));var _0x4719=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7194[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove','update'];function createListener(_0x2f22ed,_0x1635da){return function(_0x433e3c){_0x1635da[_0x4719('0x0')](_0x2f22ed,_0x433e3c);};}function removeListener(_0x472557,_0x73ae19){return function(){OpenchannelInteractionEvents[_0x4719('0x1')](_0x472557,_0x73ae19);};}exports[_0x4719('0x2')]=function(_0x41ee00){for(var _0x4a54d3=0x0,_0x3c5ea6=events[_0x4719('0x3')];_0x4a54d3<_0x3c5ea6;_0x4a54d3++){var _0x217593=events[_0x4a54d3];var _0xb0086e=createListener(_0x4719('0x4')+_0x217593,_0x41ee00);OpenchannelInteractionEvents['on'](_0x217593,_0xb0086e);}}; \ No newline at end of file +var _0x52dd=['openchannelInteraction:','remove','update','emit','removeListener','register','length'];(function(_0x9a4968,_0x159372){var _0x58ec88=function(_0x3ff9d7){while(--_0x3ff9d7){_0x9a4968['push'](_0x9a4968['shift']());}};_0x58ec88(++_0x159372);}(_0x52dd,0x1cf));var _0xd52d=function(_0x22afdc,_0x2ef4e7){_0x22afdc=_0x22afdc-0x0;var _0x5aa1a0=_0x52dd[_0x22afdc];return _0x5aa1a0;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xd52d('0x0'),_0xd52d('0x1')];function createListener(_0x90a4d5,_0x2d9f27){return function(_0x305bf6){_0x2d9f27[_0xd52d('0x2')](_0x90a4d5,_0x305bf6);};}function removeListener(_0x458ff1,_0x5baf75){return function(){OpenchannelInteractionEvents[_0xd52d('0x3')](_0x458ff1,_0x5baf75);};}exports[_0xd52d('0x4')]=function(_0x275cf4){for(var _0x5278ab=0x0,_0xbb8c20=events[_0xd52d('0x5')];_0x5278ab<_0xbb8c20;_0x5278ab++){var _0x279bf4=events[_0x5278ab];var _0x4f01ee=createListener(_0xd52d('0x6')+_0x279bf4,_0x275cf4);OpenchannelInteractionEvents['on'](_0x279bf4,_0x4f01ee);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 5aa6508..78a8cef 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x4597a7,_0x5da925){var _0x52cd16=function(_0x58a526){while(--_0x58a526){_0x4597a7['push'](_0x4597a7['shift']());}};_0x52cd16(++_0x5da925);}(_0xe706,0xa3));var _0x6e70=function(_0x4496c1,_0x103294){_0x4496c1=_0x4496c1-0x0;var _0xa2da11=_0xe706[_0x4496c1];return _0xa2da11;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0xa48a51,_0x2c7ee8){var _0x248cdf=function(_0x5eca12){while(--_0x5eca12){_0xa48a51['push'](_0xa48a51['shift']());}};_0x248cdf(++_0x2c7ee8);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a96a4,_0x17c639){_0x5a96a4=_0x5a96a4-0x0;var _0x15c8b2=_0xedd9[_0x5a96a4];return _0x15c8b2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index db6c690..f5759c0 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 _0xb688=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','exports'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0xb688,0xcf));var _0x8b68=function(_0x58a5b0,_0x333896){_0x58a5b0=_0x58a5b0-0x0;var _0x3357af=_0xb688[_0x58a5b0];return _0x3357af;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'body':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b68('0x4')]('in','out'),'defaultValue':_0x8b68('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8b68('0x6')]},'providerName':{'type':Sequelize[_0x8b68('0x7')]},'providerResponse':{'type':Sequelize[_0x8b68('0x1')]}}; \ No newline at end of file +var _0x5a13=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x2f4d41,_0x525047){var _0x3b0bb2=function(_0x19960d){while(--_0x19960d){_0x2f4d41['push'](_0x2f4d41['shift']());}};_0x3b0bb2(++_0x525047);}(_0x5a13,0x145));var _0x35a1=function(_0x1c834a,_0xf4a70c){_0x1c834a=_0x1c834a-0x0;var _0x2e437f=_0x5a13[_0x1c834a];return _0x2e437f;};'use strict';var Sequelize=require(_0x35a1('0x0'));module[_0x35a1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x35a1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x35a1('0x4')]('in',_0x35a1('0x5')),'defaultValue':_0x35a1('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x35a1('0x6')]},'providerName':{'type':Sequelize[_0x35a1('0x7')]},'providerResponse':{'type':Sequelize[_0x35a1('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 221bc6d..e891a10 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 _0x975f=['SIP/%s','channel','motionChannel','event','EventManager','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','openchannel-interactions','openchannel','read','format','user','agent','UserId','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface'];(function(_0x773c03,_0x4eec4f){var _0x3b3af8=function(_0x461098){while(--_0x461098){_0x773c03['push'](_0x773c03['shift']());}};_0x3b3af8(++_0x4eec4f);}(_0x975f,0x191));var _0xf975=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x975f[_0x16eb11];return _0x3ae7ef;};'use strict';var emlformat=require(_0xf975('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf975('0x1'));var jsonpatch=require(_0xf975('0x2'));var rp=require(_0xf975('0x3'));var moment=require(_0xf975('0x4'));var BPromise=require(_0xf975('0x5'));var Mustache=require(_0xf975('0x6'));var util=require('util');var path=require(_0xf975('0x7'));var sox=require(_0xf975('0x8'));var csv=require('to-csv');var ejs=require(_0xf975('0x9'));var fs=require('fs');var fs_extra=require(_0xf975('0xa'));var _=require(_0xf975('0xb'));var squel=require(_0xf975('0xc'));var crypto=require(_0xf975('0xd'));var jsforce=require(_0xf975('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf975('0xf'));var querystring=require('querystring');var Papa=require(_0xf975('0x10'));var Redis=require('ioredis');var authService=require(_0xf975('0x11'));var qs=require(_0xf975('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf975('0x13'));var logger=require(_0xf975('0x14'))(_0xf975('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf975('0x16'));var db=require(_0xf975('0x17'))['db'];config['redis']=_['defaults'](config[_0xf975('0x18')],{'host':_0xf975('0x19'),'port':0x18eb});var socket=require(_0xf975('0x1a'))(new Redis(config[_0xf975('0x18')]));require(_0xf975('0x1b'))[_0xf975('0x1c')](socket);var jayson=require(_0xf975('0x1d'));var client=jayson[_0xf975('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xf975('0x1e')][_0xf975('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x35ef4b,_0x458132,_0x1705f5,_0x2ac0bd){return new BPromise(function(_0x3e3f9e,_0x1513a8){var _0x298207=_0x2ac0bd||client;return _0x298207[_0xf975('0x20')](_0x35ef4b,_0x1705f5)[_0xf975('0x21')](function(_0xf52469){logger[_0xf975('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x458132,_0xf975('0x23'));logger[_0xf975('0x24')](_0xf975('0x25'),_0x458132,'request\x20sent',JSON[_0xf975('0x26')](_0xf52469));if(_0xf52469['error']){if(_0xf52469['error'][_0xf975('0x27')]===0x1f4){logger[_0xf975('0x28')](_0xf975('0x29'),_0x458132,_0xf52469[_0xf975('0x28')][_0xf975('0x2a')]);return _0x1513a8(_0xf52469[_0xf975('0x28')][_0xf975('0x2a')]);}logger[_0xf975('0x28')](_0xf975('0x29'),_0x458132,_0xf52469[_0xf975('0x28')][_0xf975('0x2a')]);return _0x3e3f9e(_0xf52469[_0xf975('0x28')][_0xf975('0x2a')]);}else{logger[_0xf975('0x22')](_0xf975('0x29'),_0x458132,_0xf975('0x23'));_0x3e3f9e(_0xf52469['result'][_0xf975('0x2a')]);}})[_0xf975('0x2b')](function(_0x14f6c0){logger[_0xf975('0x28')](_0xf975('0x29'),_0x458132,_0x14f6c0);_0x1513a8(_0x14f6c0);});});}function respondWithStatusCode(_0x3b3b59,_0x22241f){_0x22241f=_0x22241f||0xcc;return function(_0x13bb6d){if(_0x13bb6d){return _0x3b3b59[_0xf975('0x2c')](_0x22241f);}return _0x3b3b59[_0xf975('0x2d')](_0x22241f)['end']();};}function respondWithResult(_0x566f58,_0x565e35){_0x565e35=_0x565e35||0xc8;return function(_0x365032){if(_0x365032){return _0x566f58[_0xf975('0x2d')](_0x565e35)[_0xf975('0x2e')](_0x365032);}};}function respondWithFilteredResult(_0x3ddd47,_0x5e5e1){return function(_0x463128){if(_0x463128){var _0x4450b6=typeof _0x5e5e1[_0xf975('0x2f')]===_0xf975('0x30')&&typeof _0x5e5e1[_0xf975('0x31')]===_0xf975('0x30');var _0x2a970b=_0x463128[_0xf975('0x32')];var _0x3bf1c1=_0x4450b6?0x0:_0x5e5e1[_0xf975('0x2f')];var _0x3342a1=_0x4450b6?_0x463128[_0xf975('0x32')]:_0x5e5e1[_0xf975('0x2f')]+_0x5e5e1[_0xf975('0x31')];var _0x2bfe6e;if(_0x3342a1>=_0x2a970b){_0x3342a1=_0x2a970b;_0x2bfe6e=0xc8;}else{_0x2bfe6e=0xce;}_0x3ddd47['status'](_0x2bfe6e);return _0x3ddd47[_0xf975('0x33')]('Content-Range',_0x3bf1c1+'-'+_0x3342a1+'/'+_0x2a970b)[_0xf975('0x2e')](_0x463128);}return null;};}function patchUpdates(_0xcdfb7e){return function(_0xf0dad2){try{jsonpatch[_0xf975('0x34')](_0xf0dad2,_0xcdfb7e,!![]);}catch(_0x1a5f15){return BPromise['reject'](_0x1a5f15);}return _0xf0dad2[_0xf975('0x35')]();};}function saveUpdates(_0x3a7299,_0x4cc2cf){return function(_0x17c104){if(_0x17c104){return _0x17c104[_0xf975('0x36')](_0x3a7299)[_0xf975('0x21')](function(_0x57fbdc){return _0x57fbdc;});}return null;};}function removeEntity(_0x573958,_0x5a01cc){return function(_0x5d7a91){if(_0x5d7a91){return _0x5d7a91[_0xf975('0x37')]()[_0xf975('0x21')](function(){_0x573958[_0xf975('0x2d')](0xcc)[_0xf975('0x38')]();});}};}function handleEntityNotFound(_0x304679,_0xb823c6){return function(_0x10e9e3){if(!_0x10e9e3){_0x304679['sendStatus'](0x194);}return _0x10e9e3;};}function handleError(_0x53fe21,_0x2c78f0){_0x2c78f0=_0x2c78f0||0x1f4;return function(_0x2a3a93){logger[_0xf975('0x28')](_0x2a3a93[_0xf975('0x39')]);if(_0x2a3a93['name']){delete _0x2a3a93[_0xf975('0x3a')];}_0x53fe21['status'](_0x2c78f0)[_0xf975('0x3b')](_0x2a3a93);};}exports['index']=function(_0x5ca61a,_0x4f043f){var _0x5e166e={},_0x41da24={},_0x4e0e54={'count':0x0,'rows':[]};var _0x36bf67=_[_0xf975('0x3c')](db[_0xf975('0x3d')][_0xf975('0x3e')],function(_0x5319eb){return{'name':_0x5319eb[_0xf975('0x3f')],'type':_0x5319eb[_0xf975('0x40')][_0xf975('0x41')]};});_0x41da24[_0xf975('0x42')]=_[_0xf975('0x3c')](_0x36bf67,_0xf975('0x3a'));_0x41da24[_0xf975('0x43')]=_[_0xf975('0x44')](_0x5ca61a[_0xf975('0x43')]);_0x41da24[_0xf975('0x45')]=_[_0xf975('0x46')](_0x41da24[_0xf975('0x42')],_0x41da24['query']);_0x5e166e[_0xf975('0x47')]=_['intersection'](_0x41da24[_0xf975('0x42')],qs[_0xf975('0x48')](_0x5ca61a['query']['fields']));_0x5e166e[_0xf975('0x47')]=_0x5e166e[_0xf975('0x47')][_0xf975('0x49')]?_0x5e166e[_0xf975('0x47')]:_0x41da24[_0xf975('0x42')];if(!_0x5ca61a[_0xf975('0x43')][_0xf975('0x4a')](_0xf975('0x4b'))){_0x5e166e[_0xf975('0x31')]=qs[_0xf975('0x31')](_0x5ca61a[_0xf975('0x43')][_0xf975('0x31')]);_0x5e166e[_0xf975('0x2f')]=qs[_0xf975('0x2f')](_0x5ca61a['query'][_0xf975('0x2f')]);}_0x5e166e['order']=qs[_0xf975('0x4c')](_0x5ca61a['query'][_0xf975('0x4c')]);_0x5e166e[_0xf975('0x4d')]=qs[_0xf975('0x45')](_['pick'](_0x5ca61a[_0xf975('0x43')],_0x41da24[_0xf975('0x45')]),_0x36bf67);if(_0x5ca61a[_0xf975('0x43')][_0xf975('0x4e')]){_0x5e166e['where']=_['merge'](_0x5e166e['where'],{'$or':_[_0xf975('0x3c')](_0x36bf67,function(_0x2eec79){if(_0x2eec79[_0xf975('0x40')]!=='VIRTUAL'){var _0x5821c0={};_0x5821c0[_0x2eec79['name']]={'$like':'%'+_0x5ca61a['query'][_0xf975('0x4e')]+'%'};return _0x5821c0;}})});}_0x5e166e=_[_0xf975('0x4f')]({},_0x5e166e,_0x5ca61a[_0xf975('0x50')]);var _0x2feb26={'where':_0x5e166e[_0xf975('0x4d')]};return db['OpenchannelMessage']['count'](_0x2feb26)['then'](function(_0x4281b8){_0x4e0e54[_0xf975('0x32')]=_0x4281b8;if(_0x5ca61a[_0xf975('0x43')][_0xf975('0x51')]){_0x5e166e[_0xf975('0x52')]=[{'all':!![]}];}return db[_0xf975('0x3d')][_0xf975('0x53')](_0x5e166e);})['then'](function(_0x5d33fd){_0x4e0e54[_0xf975('0x54')]=_0x5d33fd;return _0x4e0e54;})[_0xf975('0x21')](respondWithFilteredResult(_0x4f043f,_0x5e166e))['catch'](handleError(_0x4f043f,null));};exports[_0xf975('0x55')]=function(_0x4f0a33,_0xb2da0f){var _0x38c7b3={'raw':!![],'where':{'id':_0x4f0a33[_0xf975('0x56')]['id']}},_0xafaa67={};_0xafaa67[_0xf975('0x42')]=_[_0xf975('0x44')](db['OpenchannelMessage'][_0xf975('0x3e')]);_0xafaa67['query']=_[_0xf975('0x44')](_0x4f0a33[_0xf975('0x43')]);_0xafaa67[_0xf975('0x45')]=_[_0xf975('0x46')](_0xafaa67[_0xf975('0x42')],_0xafaa67[_0xf975('0x43')]);_0x38c7b3[_0xf975('0x47')]=_['intersection'](_0xafaa67['model'],qs[_0xf975('0x48')](_0x4f0a33[_0xf975('0x43')][_0xf975('0x48')]));_0x38c7b3['attributes']=_0x38c7b3[_0xf975('0x47')][_0xf975('0x49')]?_0x38c7b3[_0xf975('0x47')]:_0xafaa67[_0xf975('0x42')];if(_0x4f0a33[_0xf975('0x43')][_0xf975('0x51')]){_0x38c7b3['include']=[{'all':!![]}];}_0x38c7b3=_[_0xf975('0x4f')]({},_0x38c7b3,_0x4f0a33['options']);return db[_0xf975('0x3d')]['find'](_0x38c7b3)[_0xf975('0x21')](handleEntityNotFound(_0xb2da0f,null))[_0xf975('0x21')](respondWithResult(_0xb2da0f,null))[_0xf975('0x2b')](handleError(_0xb2da0f,null));};exports[_0xf975('0x57')]=function(_0x1251c1,_0x66de43){return db[_0xf975('0x3d')][_0xf975('0x57')](_0x1251c1[_0xf975('0x58')],{})[_0xf975('0x21')](respondWithResult(_0x66de43,0xc9))[_0xf975('0x2b')](handleError(_0x66de43,null));};exports[_0xf975('0x36')]=function(_0x4b2da5,_0x2610bf){if(_0x4b2da5[_0xf975('0x58')]['id']){delete _0x4b2da5['body']['id'];}return db[_0xf975('0x3d')][_0xf975('0x59')]({'where':{'id':_0x4b2da5[_0xf975('0x56')]['id']}})[_0xf975('0x21')](handleEntityNotFound(_0x2610bf,null))[_0xf975('0x21')](saveUpdates(_0x4b2da5[_0xf975('0x58')],null))[_0xf975('0x21')](respondWithResult(_0x2610bf,null))['catch'](handleError(_0x2610bf,null));};exports['destroy']=function(_0x299d74,_0x342bec){return db[_0xf975('0x3d')][_0xf975('0x59')]({'where':{'id':_0x299d74['params']['id']}})[_0xf975('0x21')](handleEntityNotFound(_0x342bec,null))[_0xf975('0x21')](removeEntity(_0x342bec,null))[_0xf975('0x2b')](handleError(_0x342bec,null));};exports['describe']=function(_0x2b6db9,_0x2a270c){return db[_0xf975('0x3d')][_0xf975('0x5a')]()[_0xf975('0x21')](respondWithResult(_0x2a270c,null))[_0xf975('0x2b')](handleError(_0x2a270c,null));};var interaction_log=require(_0xf975('0x14'))(_0xf975('0x5b'));exports['accept']=function(_0xaab926,_0x5c0c7b,_0x9ad75c){var _0x2bcbd8={'agent':{},'channel':_0xf975('0x5c')};if(_0xaab926[_0xf975('0x58')]['id']){delete _0xaab926['body']['id'];}_0xaab926['body'][_0xf975('0x5d')]=!![];_0xaab926[_0xf975('0x58')]['readAt']=moment()[_0xf975('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0xaab926[_0xf975('0x58')]['UserId']=_0xaab926[_0xf975('0x58')]['UserId']||_0xaab926[_0xf975('0x5f')]['id'];_0x2bcbd8[_0xf975('0x60')]['id']=_0xaab926[_0xf975('0x58')][_0xf975('0x61')];return db[_0xf975('0x3d')][_0xf975('0x59')]({'where':{'id':_0xaab926[_0xf975('0x56')]['id'],'UserId':null}})[_0xf975('0x21')](handleEntityNotFound(_0x5c0c7b,null))['then'](saveUpdates(_0xaab926[_0xf975('0x58')],null))[_0xf975('0x21')](function(_0x5403fb){if(_0x5403fb){_0x2bcbd8['message']=_0x5403fb[_0xf975('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf975('0x59')]({'where':{'id':_0x5403fb[_0xf975('0x63')]}});}return null;})[_0xf975('0x21')](handleEntityNotFound(_0x5c0c7b,null))['then'](function(_0x13aa1f){if(_0x13aa1f){return _0x13aa1f[_0xf975('0x36')]({'UserId':_0xaab926['body']['UserId'],'read1stAt':_[_0xf975('0x64')](_0x13aa1f[_0xf975('0x65')])?moment()[_0xf975('0x5e')](_0xf975('0x66')):undefined});}return null;})[_0xf975('0x21')](function(_0x825c3e){if(_0x825c3e){_0x2bcbd8[_0xf975('0x67')]=_0x825c3e['get']({'plain':!![]});interaction_log[_0xf975('0x22')](_0xf975('0x68'),_0xaab926[_0xf975('0x5f')]['id'],_0xaab926['user'][_0xf975('0x3a')],_0xaab926['user'][_0xf975('0x69')],_0x2bcbd8['interaction']['id'],_0xaab926['body']?JSON[_0xf975('0x26')](_0xaab926[_0xf975('0x58')]):'null');return respondWithRpcPromise(_0xf975('0x6a'),_0xf975('0x6b'),_0x2bcbd8);}return null;})[_0xf975('0x21')](function(_0x4256fd){var _0x482bc1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4256fd['message'][_0xf975('0x6c')];return db[_0xf975('0x6d')][_0xf975('0x43')](_0x482bc1,{'type':db[_0xf975('0x6e')]['QueryTypes'][_0xf975('0x6f')],'raw':!![]})[_0xf975('0x21')](function(_0x36ec5b){return _0x36ec5b;});})[_0xf975('0x21')](function(_0x5b6d9b){if(_0x5b6d9b){_0x2bcbd8['message'][_0xf975('0x70')]=_0x5b6d9b[0x0];if(!_0xaab926[_0xf975('0x58')][_0xf975('0x61')])return;return db[_0xf975('0x71')][_0xf975('0x59')]({'where':{'id':_0xaab926[_0xf975('0x58')][_0xf975('0x61')],'role':_0xf975('0x60')},'attributes':['id',_0xf975('0x3a'),_0xf975('0x72'),_0xf975('0x73'),_0xf975('0x74')],'raw':!![]});}return null;})[_0xf975('0x21')](function(_0x3047e7){if(!_0x3047e7)return null;_0x2bcbd8[_0xf975('0x2a')]['agent']=_0x3047e7;return _0x2bcbd8;})['then'](function(_0x28e13e){if(_0x28e13e){if(_0xaab926[_0xf975('0x58')][_0xf975('0x75')]){_0x2bcbd8[_0xf975('0x2a')][_0xf975('0x76')]=util[_0xf975('0x5e')](_0xf975('0x77'),_0xaab926[_0xf975('0x5f')]['name']);_0x2bcbd8['message'][_0xf975('0x78')]=_0x2bcbd8['channel'];_0x2bcbd8['message'][_0xf975('0x79')]=_0x2bcbd8[_0xf975('0x78')];_0x2bcbd8[_0xf975('0x2a')][_0xf975('0x7a')]='accept';return respondWithRpcPromise(_0xf975('0x7b'),_0xf975('0x7b'),{'event':'acceptmessage','message':_0x2bcbd8['message']},client9002)[_0xf975('0x21')](function(){return _0x2bcbd8;});}return _0x2bcbd8;}return null;})['then'](respondWithResult(_0x5c0c7b,null))['catch'](handleError(_0x5c0c7b,null));};var interaction_log=require(_0xf975('0x14'))(_0xf975('0x5b'));exports[_0xf975('0x7c')]=function(_0x499152,_0x3b6b28,_0x2f8e28){var _0x7c3ee9={'agent':{},'channel':_0xf975('0x5c')};if(_0x499152['body']['id']){delete _0x499152['body']['id'];}_0x499152['body'][_0xf975('0x61')]=_0x499152[_0xf975('0x58')][_0xf975('0x61')]||_0x499152[_0xf975('0x5f')]['id'];_0x7c3ee9[_0xf975('0x60')]['id']=_0x499152[_0xf975('0x58')][_0xf975('0x61')];return db[_0xf975('0x3d')]['find']({'where':{'id':_0x499152[_0xf975('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b6b28,null))['then'](function(_0xfe859b){if(_0xfe859b){_0x7c3ee9['message']=_0xfe859b[_0xf975('0x62')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xfe859b[_0xf975('0x63')]}});}return null;})[_0xf975('0x21')](handleEntityNotFound(_0x3b6b28,null))[_0xf975('0x21')](function(_0x3fa915){if(_0x3fa915){_0x7c3ee9[_0xf975('0x67')]=_0x3fa915[_0xf975('0x62')]({'plain':!![]});interaction_log[_0xf975('0x22')](_0xf975('0x7d'),_0x499152[_0xf975('0x5f')]['id'],_0x499152['user'][_0xf975('0x3a')],_0x499152[_0xf975('0x5f')][_0xf975('0x69')],_0x7c3ee9[_0xf975('0x67')]['id'],_0x499152[_0xf975('0x58')]?JSON[_0xf975('0x26')](_0x499152[_0xf975('0x58')]):_0xf975('0x7e'));return respondWithRpcPromise('RejectMessage',_0xf975('0x7f'),_0x7c3ee9);}return null;})[_0xf975('0x21')](function(_0x6b89b6){var _0x1d0464=_0xf975('0x80')+_0x6b89b6[_0xf975('0x2a')]['ContactId'];return db[_0xf975('0x6d')][_0xf975('0x43')](_0x1d0464,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xf975('0x21')](function(_0x10d188){return _0x10d188;});})['then'](function(_0x55d178){if(_0x55d178){_0x7c3ee9[_0xf975('0x2a')][_0xf975('0x70')]=_0x55d178[0x0];if(!_0x499152[_0xf975('0x58')][_0xf975('0x61')])return;return db['User'][_0xf975('0x59')]({'where':{'id':_0x499152[_0xf975('0x58')][_0xf975('0x61')],'role':'agent'},'attributes':['id',_0xf975('0x3a'),_0xf975('0x72'),'email',_0xf975('0x74')],'raw':!![]});}return null;})[_0xf975('0x21')](function(_0xaac191){if(!_0xaac191)return null;_0x7c3ee9[_0xf975('0x2a')][_0xf975('0x60')]=_0xaac191;return _0x7c3ee9;})[_0xf975('0x21')](function(_0x591133){if(_0x591133){_0x591133[_0xf975('0x2a')][_0xf975('0x76')]=util[_0xf975('0x5e')]('SIP/%s',_0x499152['user']['name']);_0x591133[_0xf975('0x2a')][_0xf975('0x78')]=_0x7c3ee9[_0xf975('0x78')];_0x591133['message'][_0xf975('0x79')]=_0x7c3ee9[_0xf975('0x78')];_0x591133[_0xf975('0x2a')]['event']=_0xf975('0x7c');respondWithRpcPromise(_0xf975('0x7b'),'EventManager',{'event':_0xf975('0x81'),'message':_0x591133['message']},client9002);return _0x7c3ee9;}return null;})[_0xf975('0x21')](respondWithResult(_0x3b6b28,null))[_0xf975('0x2b')](handleError(_0x3b6b28,null));}; \ No newline at end of file +var _0xa380=['name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','OpenchannelInteractionId','get','RejectMessage','sequelize','event','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','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','redis','localhost','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','json','undefined','limit','offset','count','set','reject','save','update','destroy','sendStatus','stack'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xa380,0x153));var _0x0a38=function(_0x59c32e,_0x1c6481){_0x59c32e=_0x59c32e-0x0;var _0x12993c=_0xa380[_0x59c32e];return _0x12993c;};'use strict';var emlformat=require(_0x0a38('0x0'));var rimraf=require(_0x0a38('0x1'));var zipdir=require(_0x0a38('0x2'));var jsonpatch=require(_0x0a38('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a38('0x4'));var util=require(_0x0a38('0x5'));var path=require(_0x0a38('0x6'));var sox=require(_0x0a38('0x7'));var csv=require(_0x0a38('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a38('0x9'));var _=require(_0x0a38('0xa'));var squel=require(_0x0a38('0xb'));var crypto=require(_0x0a38('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0a38('0x8'));var querystring=require(_0x0a38('0xd'));var Papa=require(_0x0a38('0xe'));var Redis=require(_0x0a38('0xf'));var authService=require(_0x0a38('0x10'));var qs=require(_0x0a38('0x11'));var as=require(_0x0a38('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a38('0x13'))(_0x0a38('0x14'));var utils=require(_0x0a38('0x15'));var config=require(_0x0a38('0x16'));var licenseUtil=require(_0x0a38('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a38('0x18')],{'host':_0x0a38('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x0a38('0x1a')](socket);var jayson=require(_0x0a38('0x1b'));var client=jayson[_0x0a38('0x1c')][_0x0a38('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x0a38('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x40edf8,_0x37582a,_0x15091a,_0x3cab73){return new BPromise(function(_0x9aa438,_0x3c03a4){var _0x449a3a=_0x3cab73||client;return _0x449a3a[_0x0a38('0x1e')](_0x40edf8,_0x15091a)[_0x0a38('0x1f')](function(_0x209100){logger['info'](_0x0a38('0x20'),_0x37582a,_0x0a38('0x21'));logger[_0x0a38('0x22')](_0x0a38('0x23'),_0x37582a,_0x0a38('0x21'),JSON['stringify'](_0x209100));if(_0x209100['error']){if(_0x209100[_0x0a38('0x24')][_0x0a38('0x25')]===0x1f4){logger[_0x0a38('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x37582a,_0x209100[_0x0a38('0x24')]['message']);return _0x3c03a4(_0x209100[_0x0a38('0x24')][_0x0a38('0x26')]);}logger['error'](_0x0a38('0x20'),_0x37582a,_0x209100[_0x0a38('0x24')][_0x0a38('0x26')]);return _0x9aa438(_0x209100[_0x0a38('0x24')][_0x0a38('0x26')]);}else{logger[_0x0a38('0x27')](_0x0a38('0x20'),_0x37582a,_0x0a38('0x21'));_0x9aa438(_0x209100[_0x0a38('0x28')][_0x0a38('0x26')]);}})['catch'](function(_0x447227){logger[_0x0a38('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x37582a,_0x447227);_0x3c03a4(_0x447227);});});}function respondWithStatusCode(_0x54faa5,_0x2e3aec){_0x2e3aec=_0x2e3aec||0xcc;return function(_0x7d49d4){if(_0x7d49d4){return _0x54faa5['sendStatus'](_0x2e3aec);}return _0x54faa5[_0x0a38('0x29')](_0x2e3aec)['end']();};}function respondWithResult(_0x56b3d0,_0x6eb085){_0x6eb085=_0x6eb085||0xc8;return function(_0x27ff9e){if(_0x27ff9e){return _0x56b3d0[_0x0a38('0x29')](_0x6eb085)[_0x0a38('0x2a')](_0x27ff9e);}};}function respondWithFilteredResult(_0x2c2fef,_0x2cb53a){return function(_0x2d89a6){if(_0x2d89a6){var _0x53b677=typeof _0x2cb53a['offset']===_0x0a38('0x2b')&&typeof _0x2cb53a[_0x0a38('0x2c')]===_0x0a38('0x2b');var _0x36aff4=_0x2d89a6['count'];var _0x47bc28=_0x53b677?0x0:_0x2cb53a[_0x0a38('0x2d')];var _0x504dd6=_0x53b677?_0x2d89a6[_0x0a38('0x2e')]:_0x2cb53a[_0x0a38('0x2d')]+_0x2cb53a[_0x0a38('0x2c')];var _0x40283d;if(_0x504dd6>=_0x36aff4){_0x504dd6=_0x36aff4;_0x40283d=0xc8;}else{_0x40283d=0xce;}_0x2c2fef['status'](_0x40283d);return _0x2c2fef[_0x0a38('0x2f')]('Content-Range',_0x47bc28+'-'+_0x504dd6+'/'+_0x36aff4)[_0x0a38('0x2a')](_0x2d89a6);}return null;};}function patchUpdates(_0x222b5e){return function(_0x1d4502){try{jsonpatch['apply'](_0x1d4502,_0x222b5e,!![]);}catch(_0x3961c1){return BPromise[_0x0a38('0x30')](_0x3961c1);}return _0x1d4502[_0x0a38('0x31')]();};}function saveUpdates(_0x15a66d,_0x354356){return function(_0x46c912){if(_0x46c912){return _0x46c912[_0x0a38('0x32')](_0x15a66d)['then'](function(_0x4aee97){return _0x4aee97;});}return null;};}function removeEntity(_0x309f8b,_0x44cabd){return function(_0x229a87){if(_0x229a87){return _0x229a87[_0x0a38('0x33')]()['then'](function(){_0x309f8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3592fb,_0xd04f4b){return function(_0x4b1162){if(!_0x4b1162){_0x3592fb[_0x0a38('0x34')](0x194);}return _0x4b1162;};}function handleError(_0x317f7a,_0x13827d){_0x13827d=_0x13827d||0x1f4;return function(_0x4a42ab){logger[_0x0a38('0x24')](_0x4a42ab[_0x0a38('0x35')]);if(_0x4a42ab[_0x0a38('0x36')]){delete _0x4a42ab[_0x0a38('0x36')];}_0x317f7a[_0x0a38('0x29')](_0x13827d)['send'](_0x4a42ab);};}exports[_0x0a38('0x37')]=function(_0xed17ed,_0x5bd346){var _0x50601c={},_0x8278ed={},_0x5a4566={'count':0x0,'rows':[]};var _0x103f57=_[_0x0a38('0x38')](db['OpenchannelMessage'][_0x0a38('0x39')],function(_0x4366d2){return{'name':_0x4366d2[_0x0a38('0x3a')],'type':_0x4366d2[_0x0a38('0x3b')][_0x0a38('0x3c')]};});_0x8278ed[_0x0a38('0x3d')]=_[_0x0a38('0x38')](_0x103f57,'name');_0x8278ed[_0x0a38('0x3e')]=_['keys'](_0xed17ed[_0x0a38('0x3e')]);_0x8278ed[_0x0a38('0x3f')]=_[_0x0a38('0x40')](_0x8278ed[_0x0a38('0x3d')],_0x8278ed[_0x0a38('0x3e')]);_0x50601c[_0x0a38('0x41')]=_[_0x0a38('0x40')](_0x8278ed[_0x0a38('0x3d')],qs[_0x0a38('0x42')](_0xed17ed[_0x0a38('0x3e')][_0x0a38('0x42')]));_0x50601c['attributes']=_0x50601c[_0x0a38('0x41')][_0x0a38('0x43')]?_0x50601c[_0x0a38('0x41')]:_0x8278ed[_0x0a38('0x3d')];if(!_0xed17ed[_0x0a38('0x3e')][_0x0a38('0x44')](_0x0a38('0x45'))){_0x50601c[_0x0a38('0x2c')]=qs[_0x0a38('0x2c')](_0xed17ed['query'][_0x0a38('0x2c')]);_0x50601c[_0x0a38('0x2d')]=qs[_0x0a38('0x2d')](_0xed17ed[_0x0a38('0x3e')][_0x0a38('0x2d')]);}_0x50601c[_0x0a38('0x46')]=qs[_0x0a38('0x47')](_0xed17ed[_0x0a38('0x3e')]['sort']);_0x50601c[_0x0a38('0x48')]=qs[_0x0a38('0x3f')](_[_0x0a38('0x49')](_0xed17ed[_0x0a38('0x3e')],_0x8278ed[_0x0a38('0x3f')]),_0x103f57);if(_0xed17ed['query'][_0x0a38('0x4a')]){_0x50601c[_0x0a38('0x48')]=_[_0x0a38('0x4b')](_0x50601c[_0x0a38('0x48')],{'$or':_[_0x0a38('0x38')](_0x103f57,function(_0x104577){if(_0x104577[_0x0a38('0x3b')]!==_0x0a38('0x4c')){var _0xe0e7c={};_0xe0e7c[_0x104577[_0x0a38('0x36')]]={'$like':'%'+_0xed17ed[_0x0a38('0x3e')][_0x0a38('0x4a')]+'%'};return _0xe0e7c;}})});}_0x50601c=_['merge']({},_0x50601c,_0xed17ed[_0x0a38('0x4d')]);var _0x16bfd3={'where':_0x50601c[_0x0a38('0x48')]};return db[_0x0a38('0x4e')][_0x0a38('0x2e')](_0x16bfd3)['then'](function(_0x2583b7){_0x5a4566[_0x0a38('0x2e')]=_0x2583b7;if(_0xed17ed[_0x0a38('0x3e')]['includeAll']){_0x50601c[_0x0a38('0x4f')]=[{'all':!![]}];}return db[_0x0a38('0x4e')][_0x0a38('0x50')](_0x50601c);})['then'](function(_0x1b00b3){_0x5a4566[_0x0a38('0x51')]=_0x1b00b3;return _0x5a4566;})[_0x0a38('0x1f')](respondWithFilteredResult(_0x5bd346,_0x50601c))['catch'](handleError(_0x5bd346,null));};exports[_0x0a38('0x52')]=function(_0x1a350a,_0x101f4d){var _0x10bd01={'raw':!![],'where':{'id':_0x1a350a[_0x0a38('0x53')]['id']}},_0x5e319f={};_0x5e319f['model']=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x5e319f[_0x0a38('0x3e')]=_[_0x0a38('0x54')](_0x1a350a['query']);_0x5e319f[_0x0a38('0x3f')]=_['intersection'](_0x5e319f['model'],_0x5e319f[_0x0a38('0x3e')]);_0x10bd01['attributes']=_[_0x0a38('0x40')](_0x5e319f[_0x0a38('0x3d')],qs[_0x0a38('0x42')](_0x1a350a['query']['fields']));_0x10bd01[_0x0a38('0x41')]=_0x10bd01[_0x0a38('0x41')][_0x0a38('0x43')]?_0x10bd01[_0x0a38('0x41')]:_0x5e319f[_0x0a38('0x3d')];if(_0x1a350a[_0x0a38('0x3e')][_0x0a38('0x55')]){_0x10bd01[_0x0a38('0x4f')]=[{'all':!![]}];}_0x10bd01=_[_0x0a38('0x4b')]({},_0x10bd01,_0x1a350a[_0x0a38('0x4d')]);return db[_0x0a38('0x4e')][_0x0a38('0x56')](_0x10bd01)[_0x0a38('0x1f')](handleEntityNotFound(_0x101f4d,null))['then'](respondWithResult(_0x101f4d,null))[_0x0a38('0x57')](handleError(_0x101f4d,null));};exports['create']=function(_0x46d8b9,_0x193d56){return db[_0x0a38('0x4e')][_0x0a38('0x58')](_0x46d8b9[_0x0a38('0x59')],{})[_0x0a38('0x1f')](respondWithResult(_0x193d56,0xc9))['catch'](handleError(_0x193d56,null));};exports[_0x0a38('0x32')]=function(_0x4b7e1e,_0x4d2c7f){if(_0x4b7e1e[_0x0a38('0x59')]['id']){delete _0x4b7e1e[_0x0a38('0x59')]['id'];}return db[_0x0a38('0x4e')][_0x0a38('0x56')]({'where':{'id':_0x4b7e1e[_0x0a38('0x53')]['id']}})[_0x0a38('0x1f')](handleEntityNotFound(_0x4d2c7f,null))[_0x0a38('0x1f')](saveUpdates(_0x4b7e1e[_0x0a38('0x59')],null))['then'](respondWithResult(_0x4d2c7f,null))[_0x0a38('0x57')](handleError(_0x4d2c7f,null));};exports['destroy']=function(_0x103e84,_0x473198){return db['OpenchannelMessage'][_0x0a38('0x56')]({'where':{'id':_0x103e84['params']['id']}})[_0x0a38('0x1f')](handleEntityNotFound(_0x473198,null))[_0x0a38('0x1f')](removeEntity(_0x473198,null))[_0x0a38('0x57')](handleError(_0x473198,null));};exports['describe']=function(_0x9bfc7c,_0x397880){return db[_0x0a38('0x4e')]['describe']()[_0x0a38('0x1f')](respondWithResult(_0x397880,null))['catch'](handleError(_0x397880,null));};var interaction_log=require(_0x0a38('0x13'))(_0x0a38('0x5a'));exports['accept']=function(_0x2a76e4,_0x340bab,_0x301d96){var _0x362b68={'agent':{},'channel':_0x0a38('0x5b')};if(_0x2a76e4[_0x0a38('0x59')]['id']){delete _0x2a76e4['body']['id'];}_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x5c')]=!![];_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x5d')]=moment()[_0x0a38('0x5e')](_0x0a38('0x5f'));_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x60')]=_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x60')]||_0x2a76e4[_0x0a38('0x61')]['id'];_0x362b68[_0x0a38('0x62')]['id']=_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x60')];return db[_0x0a38('0x4e')][_0x0a38('0x56')]({'where':{'id':_0x2a76e4[_0x0a38('0x53')]['id'],'UserId':null}})[_0x0a38('0x1f')](handleEntityNotFound(_0x340bab,null))[_0x0a38('0x1f')](saveUpdates(_0x2a76e4[_0x0a38('0x59')],null))[_0x0a38('0x1f')](function(_0x44b258){if(_0x44b258){_0x362b68['message']=_0x44b258['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x0a38('0x56')]({'where':{'id':_0x44b258['OpenchannelInteractionId']}});}return null;})[_0x0a38('0x1f')](handleEntityNotFound(_0x340bab,null))[_0x0a38('0x1f')](function(_0x22b1dc){if(_0x22b1dc){return _0x22b1dc[_0x0a38('0x32')]({'UserId':_0x2a76e4[_0x0a38('0x59')]['UserId'],'read1stAt':_[_0x0a38('0x63')](_0x22b1dc[_0x0a38('0x64')])?moment()['format'](_0x0a38('0x5f')):undefined});}return null;})[_0x0a38('0x1f')](function(_0x317018){if(_0x317018){_0x362b68[_0x0a38('0x65')]=_0x317018['get']({'plain':!![]});interaction_log[_0x0a38('0x27')](_0x0a38('0x66'),_0x2a76e4['user']['id'],_0x2a76e4[_0x0a38('0x61')][_0x0a38('0x36')],_0x2a76e4[_0x0a38('0x61')][_0x0a38('0x67')],_0x362b68['interaction']['id'],_0x2a76e4[_0x0a38('0x59')]?JSON[_0x0a38('0x68')](_0x2a76e4['body']):_0x0a38('0x69'));return respondWithRpcPromise(_0x0a38('0x6a'),_0x0a38('0x6b'),_0x362b68);}return null;})['then'](function(_0x19ff60){var _0x4f3f00=_0x0a38('0x6c')+_0x19ff60[_0x0a38('0x26')][_0x0a38('0x6d')];return db['sequelize'][_0x0a38('0x3e')](_0x4f3f00,{'type':db[_0x0a38('0x6e')][_0x0a38('0x6f')][_0x0a38('0x70')],'raw':!![]})[_0x0a38('0x1f')](function(_0x355499){return _0x355499;});})[_0x0a38('0x1f')](function(_0x36acbc){if(_0x36acbc){_0x362b68[_0x0a38('0x26')][_0x0a38('0x71')]=_0x36acbc[0x0];if(!_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x60')])return;return db[_0x0a38('0x72')][_0x0a38('0x56')]({'where':{'id':_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x60')],'role':_0x0a38('0x62')},'attributes':['id',_0x0a38('0x36'),_0x0a38('0x73'),_0x0a38('0x74'),_0x0a38('0x75')],'raw':!![]});}return null;})[_0x0a38('0x1f')](function(_0x1c92d3){if(!_0x1c92d3)return null;_0x362b68[_0x0a38('0x26')][_0x0a38('0x62')]=_0x1c92d3;return _0x362b68;})[_0x0a38('0x1f')](function(_0x55e380){if(_0x55e380){if(_0x2a76e4[_0x0a38('0x59')][_0x0a38('0x76')]){_0x362b68[_0x0a38('0x26')][_0x0a38('0x77')]=util[_0x0a38('0x5e')](_0x0a38('0x78'),_0x2a76e4[_0x0a38('0x61')][_0x0a38('0x36')]);_0x362b68[_0x0a38('0x26')][_0x0a38('0x79')]=_0x362b68[_0x0a38('0x79')];_0x362b68['message'][_0x0a38('0x7a')]=_0x362b68[_0x0a38('0x79')];_0x362b68[_0x0a38('0x26')]['event']=_0x0a38('0x7b');return respondWithRpcPromise('EventManager',_0x0a38('0x7c'),{'event':_0x0a38('0x7d'),'message':_0x362b68[_0x0a38('0x26')]},client9002)[_0x0a38('0x1f')](function(){return _0x362b68;});}return _0x362b68;}return null;})['then'](respondWithResult(_0x340bab,null))['catch'](handleError(_0x340bab,null));};var interaction_log=require(_0x0a38('0x13'))(_0x0a38('0x5a'));exports['reject']=function(_0x2e6b6e,_0xe95fae,_0x31eb2a){var _0x3cfc6c={'agent':{},'channel':_0x0a38('0x5b')};if(_0x2e6b6e['body']['id']){delete _0x2e6b6e[_0x0a38('0x59')]['id'];}_0x2e6b6e[_0x0a38('0x59')][_0x0a38('0x60')]=_0x2e6b6e['body']['UserId']||_0x2e6b6e[_0x0a38('0x61')]['id'];_0x3cfc6c[_0x0a38('0x62')]['id']=_0x2e6b6e['body'][_0x0a38('0x60')];return db['OpenchannelMessage'][_0x0a38('0x56')]({'where':{'id':_0x2e6b6e[_0x0a38('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe95fae,null))[_0x0a38('0x1f')](function(_0xc292d8){if(_0xc292d8){_0x3cfc6c[_0x0a38('0x26')]=_0xc292d8['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x0a38('0x56')]({'where':{'id':_0xc292d8[_0x0a38('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0xe95fae,null))[_0x0a38('0x1f')](function(_0x3eb038){if(_0x3eb038){_0x3cfc6c[_0x0a38('0x65')]=_0x3eb038[_0x0a38('0x7f')]({'plain':!![]});interaction_log[_0x0a38('0x27')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e6b6e['user']['id'],_0x2e6b6e[_0x0a38('0x61')][_0x0a38('0x36')],_0x2e6b6e[_0x0a38('0x61')][_0x0a38('0x67')],_0x3cfc6c[_0x0a38('0x65')]['id'],_0x2e6b6e[_0x0a38('0x59')]?JSON['stringify'](_0x2e6b6e[_0x0a38('0x59')]):_0x0a38('0x69'));return respondWithRpcPromise(_0x0a38('0x80'),'rejectMessage',_0x3cfc6c);}return null;})[_0x0a38('0x1f')](function(_0x3273a7){var _0x2ec540='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3273a7[_0x0a38('0x26')][_0x0a38('0x6d')];return db[_0x0a38('0x81')][_0x0a38('0x3e')](_0x2ec540,{'type':db[_0x0a38('0x6e')][_0x0a38('0x6f')]['SELECT'],'raw':!![]})[_0x0a38('0x1f')](function(_0x12e671){return _0x12e671;});})[_0x0a38('0x1f')](function(_0x2adca0){if(_0x2adca0){_0x3cfc6c[_0x0a38('0x26')][_0x0a38('0x71')]=_0x2adca0[0x0];if(!_0x2e6b6e[_0x0a38('0x59')][_0x0a38('0x60')])return;return db[_0x0a38('0x72')]['find']({'where':{'id':_0x2e6b6e[_0x0a38('0x59')]['UserId'],'role':_0x0a38('0x62')},'attributes':['id',_0x0a38('0x36'),_0x0a38('0x73'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x58121f){if(!_0x58121f)return null;_0x3cfc6c['message'][_0x0a38('0x62')]=_0x58121f;return _0x3cfc6c;})[_0x0a38('0x1f')](function(_0x569bc7){if(_0x569bc7){_0x569bc7[_0x0a38('0x26')][_0x0a38('0x77')]=util['format']('SIP/%s',_0x2e6b6e[_0x0a38('0x61')]['name']);_0x569bc7['message'][_0x0a38('0x79')]=_0x3cfc6c[_0x0a38('0x79')];_0x569bc7[_0x0a38('0x26')]['motionChannel']=_0x3cfc6c['channel'];_0x569bc7[_0x0a38('0x26')][_0x0a38('0x82')]=_0x0a38('0x30');respondWithRpcPromise(_0x0a38('0x7c'),_0x0a38('0x7c'),{'event':'rejectmessage','message':_0x569bc7[_0x0a38('0x26')]},client9002);return _0x3cfc6c;}return null;})['then'](respondWithResult(_0xe95fae,null))['catch'](handleError(_0xe95fae,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index b97dbdf..4a7e229 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 _0xe966=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x541dfd,_0x116c31){var _0x49dd03=function(_0x244215){while(--_0x244215){_0x541dfd['push'](_0x541dfd['shift']());}};_0x49dd03(++_0x116c31);}(_0xe966,0xff));var _0x6e96=function(_0x43f112,_0x51aece){_0x43f112=_0x43f112-0x0;var _0x23f800=_0xe966[_0x43f112];return _0x23f800;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x6e96('0x0'))['db'][_0x6e96('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6e96('0x2')](0x0);var events={'afterCreate':_0x6e96('0x3'),'afterUpdate':_0x6e96('0x4'),'afterDestroy':'remove'};function emitEvent(_0xba5917){return function(_0x560a86,_0x3dc292,_0x55db12){OpenchannelMessageEvents[_0x6e96('0x5')](_0xba5917+':'+_0x560a86['id'],_0x560a86);OpenchannelMessageEvents['emit'](_0xba5917,_0x560a86);_0x55db12(null);};}for(var e in events){if(events[_0x6e96('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x6e96('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe240=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2f2c6c,_0x2c1814){var _0x4d1583=function(_0x4c348d){while(--_0x4c348d){_0x2f2c6c['push'](_0x2f2c6c['shift']());}};_0x4d1583(++_0x2c1814);}(_0xe240,0x197));var _0x0e24=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe240[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0x0e24('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0e24('0x1')](0x0);var events={'afterCreate':_0x0e24('0x2'),'afterUpdate':_0x0e24('0x3'),'afterDestroy':_0x0e24('0x4')};function emitEvent(_0x383514){return function(_0x3e990c,_0x51a22e,_0x35dabd){OpenchannelMessageEvents[_0x0e24('0x5')](_0x383514+':'+_0x3e990c['id'],_0x3e990c);OpenchannelMessageEvents[_0x0e24('0x5')](_0x383514,_0x3e990c);_0x35dabd(null);};}for(var e in events){if(events[_0x0e24('0x6')](e)){var event=events[e];OpenchannelMessage[_0x0e24('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 5b5c7ba..e5fb640 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 _0x9ffd=['OpenchannelAccountId','Interactions','Contact','keys','replyUri','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','threadId','update','error','inspect','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find'];(function(_0x3d846f,_0x1cc810){var _0x308f20=function(_0x2fe922){while(--_0x2fe922){_0x3d846f['push'](_0x3d846f['shift']());}};_0x308f20(++_0x1cc810);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x184144,_0x43381f){_0x184144=_0x184144-0x0;var _0x40fa5b=_0x9ffd[_0x184144];return _0x40fa5b;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ff('0xc'),'fields':[_0xd9ff('0xd')],'type':_0xd9ff('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x977487,_0x58e728,_0x54a555){var _0x567f79=_0x3aa26b['models'];var _0x2355ab=_0x977487[_0xd9ff('0xf')]({'plain':!![]});if(_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()==='in'||_0x2355ab[_0xd9ff('0x10')][_0xd9ff('0x11')]()===_0xd9ff('0x12')&&!_0x2355ab[_0xd9ff('0x13')]&&!_['isNil'](_0x2355ab['UserId'])){_0x567f79[_0xd9ff('0x14')][_0xd9ff('0x15')]({'where':{'id':_0x2355ab[_0xd9ff('0x16')]}})[_0xd9ff('0x17')](function(_0x12c39a){if(_0x12c39a){_0x12c39a['update']({'lastMsgAt':_0x2355ab[_0xd9ff('0x18')],'lastMsgDirection':_0x2355ab[_0xd9ff('0x10')]['toLowerCase']()});}})[_0xd9ff('0x19')](function(_0x5db010){console['error'](_0x5db010);});}if(_0x2355ab['direction']==='out'&&!_0x2355ab[_0xd9ff('0x13')]){var _0x4f9d6d;_0x567f79[_0xd9ff('0x1a')][_0xd9ff('0x1b')]()[_0xd9ff('0x17')](function(_0x3afd19){return _0x567f79[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'where':{'id':_0x2355ab[_0xd9ff('0x1e')]},'include':[{'model':_0x567f79[_0xd9ff('0x14')],'as':_0xd9ff('0x1f'),'where':{'id':_0x2355ab[_0xd9ff('0x16')]},'limit':0x1,'include':[{'model':_0x567f79[_0xd9ff('0x1a')],'as':_0xd9ff('0x20'),'attributes':_[_0xd9ff('0x21')](_0x3afd19)}]}]});})['then'](function(_0x4cf8ec){_0x4f9d6d=_0x4cf8ec[_0xd9ff('0xf')]({'plain':!![]});if(_0x4f9d6d&&_0x4f9d6d[_0xd9ff('0x22')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xd9ff('0x23'),_0x2355ab['id'],_0x4f9d6d['replyUri']));if(_0x4f9d6d[_0xd9ff('0x1f')]&&_0x4f9d6d[_0xd9ff('0x1f')][_0xd9ff('0x24')]){_0x2355ab[_0xd9ff('0x25')]=_[_0xd9ff('0x26')](_0x4f9d6d[_0xd9ff('0x1f')][0x0],'Contact');_0x2355ab['Contact']=_0x4f9d6d[_0xd9ff('0x1f')][0x0]['Contact'];}var _0x58e728={'method':'POST','uri':encodeURI(_0x4f9d6d[_0xd9ff('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x58e728['method']){case _0xd9ff('0x27'):_0x58e728['qs']=_0x2355ab;break;case _0xd9ff('0x28'):_0x58e728[_0xd9ff('0xd')]=_0x2355ab;break;}return rp(_0x58e728)[_0xd9ff('0x17')](function(_0x5d685e){logger[_0xd9ff('0x29')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x2c')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2355ab['id'],_0x4f9d6d[_0xd9ff('0x22')]));if(_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]&&_0x5d685e[_0xd9ff('0xd')][_0xd9ff('0x2d')]!=_0x2355ab[_0xd9ff('0x25')][_0xd9ff('0x2d')]){return _0x567f79[_0xd9ff('0x14')][_0xd9ff('0x2e')]({'threadId':_0x5d685e['body'][_0xd9ff('0x2d')]},{'logging':!![],'where':{'id':_0x2355ab['Interaction']['id']}});}else{return;}})[_0xd9ff('0x17')](function(){return _0x977487[_0xd9ff('0x2e')]({'read':!![]});})[_0xd9ff('0x19')](function(_0x552d08){logger[_0xd9ff('0x2f')](_0xd9ff('0x2a'),_0xd9ff('0x2b'),util[_0xd9ff('0x30')](_0x552d08,{'showHidden':![],'depth':null}));_0x54a555();});}else{_0x54a555();}})['finally'](function(){_0x54a555();});}else{_0x54a555();}}},'charset':_0xd9ff('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3266=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','OpenchannelInteractionId','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','CmContact','Contact','keys','then','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','method','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x454f42,_0x3e7da5){var _0x290975=function(_0x49ea02){while(--_0x49ea02){_0x454f42['push'](_0x454f42['shift']());}};_0x290975(++_0x3e7da5);}(_0x3266,0x6a));var _0x6326=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x3266[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var logger=require(_0x6326('0x2'))(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var BPromise=require(_0x6326('0x5'));var rp=require(_0x6326('0x6'));var fs=require('fs');var path=require(_0x6326('0x7'));var rimraf=require(_0x6326('0x8'));var config=require('../../config/environment');var attributes=require(_0x6326('0x9'));module['exports']=function(_0x25ecd8,_0x44460c){return _0x25ecd8[_0x6326('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x6326('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x6326('0xc')],'type':_0x6326('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x249eca,_0x1aee60,_0x37a23d){var _0x53c3e1=_0x25ecd8[_0x6326('0xe')];var _0x464a36=_0x249eca[_0x6326('0xf')]({'plain':!![]});if(_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()==='in'||_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()===_0x6326('0x12')&&!_0x464a36[_0x6326('0x13')]&&!_[_0x6326('0x14')](_0x464a36['UserId'])){_0x53c3e1['OpenchannelInteraction'][_0x6326('0x15')]({'where':{'id':_0x464a36[_0x6326('0x16')]}})['then'](function(_0x425878){if(_0x425878){_0x425878['update']({'lastMsgAt':_0x464a36[_0x6326('0x17')],'lastMsgDirection':_0x464a36[_0x6326('0x10')][_0x6326('0x11')]()});}})[_0x6326('0x18')](function(_0x1ed3a3){console[_0x6326('0x19')](_0x1ed3a3);});}if(_0x464a36['direction']===_0x6326('0x12')&&!_0x464a36['secret']){var _0x5945ee;_0x53c3e1['CmContact']['describe']()['then'](function(_0x58e960){return _0x53c3e1[_0x6326('0x1a')][_0x6326('0x1b')]({'where':{'id':_0x464a36[_0x6326('0x1c')]},'include':[{'model':_0x53c3e1['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x464a36[_0x6326('0x16')]},'limit':0x1,'include':[{'model':_0x53c3e1[_0x6326('0x1d')],'as':_0x6326('0x1e'),'attributes':_[_0x6326('0x1f')](_0x58e960)}]}]});})[_0x6326('0x20')](function(_0x25957a){_0x5945ee=_0x25957a[_0x6326('0xf')]({'plain':!![]});if(_0x5945ee&&_0x5945ee['replyUri']){logger[_0x6326('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x24'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x5945ee[_0x6326('0x26')]&&_0x5945ee[_0x6326('0x26')][_0x6326('0x27')]){_0x464a36[_0x6326('0x28')]=_[_0x6326('0x29')](_0x5945ee[_0x6326('0x26')][0x0],_0x6326('0x1e'));_0x464a36['Contact']=_0x5945ee[_0x6326('0x26')][0x0][_0x6326('0x1e')];}var _0x1aee60={'method':'POST','uri':encodeURI(_0x5945ee['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1aee60[_0x6326('0x2a')]){case'GET':_0x1aee60['qs']=_0x464a36;break;case _0x6326('0x2b'):_0x1aee60[_0x6326('0xc')]=_0x464a36;break;}return rp(_0x1aee60)['then'](function(_0x15e33d){logger[_0x6326('0x21')](_0x6326('0x2c'),_0x6326('0x22'),util[_0x6326('0x23')](_0x6326('0x2d'),_0x464a36['id'],_0x5945ee[_0x6326('0x25')]));if(_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]&&_0x15e33d[_0x6326('0xc')][_0x6326('0x2e')]!=_0x464a36[_0x6326('0x28')][_0x6326('0x2e')]){return _0x53c3e1[_0x6326('0x2f')][_0x6326('0x30')]({'threadId':_0x15e33d[_0x6326('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x464a36[_0x6326('0x28')]['id']}});}else{return;}})[_0x6326('0x20')](function(){return _0x249eca[_0x6326('0x30')]({'read':!![]});})['catch'](function(_0x1bd9a6){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x6326('0x22'),util[_0x6326('0x31')](_0x1bd9a6,{'showHidden':![],'depth':null}));_0x37a23d();});}else{_0x37a23d();}})[_0x6326('0x32')](function(){_0x37a23d();});}else{_0x37a23d();}}},'charset':_0x6326('0x33'),'collate':_0x6326('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 53e1053..8e3501d 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(_0x555222,_0x45baec){var _0x99f4e4=function(_0x3f3b94){while(--_0x3f3b94){_0x555222['push'](_0x555222['shift']());}};_0x99f4e4(++_0x45baec);}(_0x5f2f,0x73));var _0xf5f2=function(_0x255cb7,_0x382de4){_0x255cb7=_0x255cb7-0x0;var _0x5dc6d6=_0x5f2f[_0x255cb7];return _0x5dc6d6;};'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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x12eeeb,_0xaec6ad){var _0x4bd110=function(_0x1d5320){while(--_0x1d5320){_0x12eeeb['push'](_0x12eeeb['shift']());}};_0x4bd110(++_0xaec6ad);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'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});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b381f37..4e20f54 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 _0x3714=['save','update','emit','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x5a46e8,_0x450dc6){var _0x110daf=function(_0x2ebf61){while(--_0x2ebf61){_0x5a46e8['push'](_0x5a46e8['shift']());}};_0x110daf(++_0x450dc6);}(_0x3714,0x95));var _0x4371=function(_0x4d00a8,_0x4e43ac){_0x4d00a8=_0x4d00a8-0x0;var _0x4c55e1=_0x3714[_0x4d00a8];return _0x4c55e1;};'use strict';var OpenchannelMessageEvents=require(_0x4371('0x0'));var events=[_0x4371('0x1'),'remove',_0x4371('0x2')];function createListener(_0x3f7fa8,_0x301389){return function(_0x497777){_0x301389[_0x4371('0x3')](_0x3f7fa8,_0x497777);};}function removeListener(_0x20929e,_0x2c0435){return function(){OpenchannelMessageEvents['removeListener'](_0x20929e,_0x2c0435);};}exports[_0x4371('0x4')]=function(_0x5650a7){for(var _0x349031=0x0,_0x2280c1=events['length'];_0x349031<_0x2280c1;_0x349031++){var _0x31a32f=events[_0x349031];var _0x37af33=createListener(_0x4371('0x5')+_0x31a32f,_0x5650a7);OpenchannelMessageEvents['on'](_0x31a32f,_0x37af33);}}; \ No newline at end of file +var _0x522b=['removeListener','register','length','./openchannelMessage.events','save','update','emit'];(function(_0xb4c9b,_0xdd2c0c){var _0x12d215=function(_0x532eae){while(--_0x532eae){_0xb4c9b['push'](_0xb4c9b['shift']());}};_0x12d215(++_0xdd2c0c);}(_0x522b,0x1c3));var _0xb522=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x522b[_0x14476b];return _0x24e2e8;};'use strict';var OpenchannelMessageEvents=require(_0xb522('0x0'));var events=[_0xb522('0x1'),'remove',_0xb522('0x2')];function createListener(_0x54310f,_0x4a9709){return function(_0x3519a9){_0x4a9709[_0xb522('0x3')](_0x54310f,_0x3519a9);};}function removeListener(_0x52cd65,_0x335c92){return function(){OpenchannelMessageEvents[_0xb522('0x4')](_0x52cd65,_0x335c92);};}exports[_0xb522('0x5')]=function(_0x2fca5b){for(var _0x47bd53=0x0,_0x55a5f0=events[_0xb522('0x6')];_0x47bd53<_0x55a5f0;_0x47bd53++){var _0x2f289f=events[_0x47bd53];var _0x5a5cd3=createListener('openchannelMessage:'+_0x2f289f,_0x2fca5b);OpenchannelMessageEvents['on'](_0x2f289f,_0x5a5cd3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a0160fe..c7330f3 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 _0x2a54=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','exports'];(function(_0x32bf28,_0x5b698b){var _0x23cc41=function(_0xc02633){while(--_0xc02633){_0x32bf28['push'](_0x32bf28['shift']());}};_0x23cc41(++_0x5b698b);}(_0x2a54,0x17a));var _0x42a5=function(_0x281976,_0xb2be07){_0x281976=_0x281976-0x0;var _0x2c46b9=_0x2a54[_0x281976];return _0x2c46b9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x42a5('0x0'));var express=require('express');var router=express[_0x42a5('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x42a5('0x2'));var interaction=require(_0x42a5('0x3'));var config=require(_0x42a5('0x4'));var controller=require(_0x42a5('0x5'));router[_0x42a5('0x6')]('/',auth[_0x42a5('0x7')](),controller[_0x42a5('0x8')]);router[_0x42a5('0x6')]('/describe',auth[_0x42a5('0x7')](),controller[_0x42a5('0x9')]);router[_0x42a5('0x6')]('/:id',auth[_0x42a5('0x7')](),controller['show']);router[_0x42a5('0x6')](_0x42a5('0xa'),auth[_0x42a5('0x7')](),controller[_0x42a5('0xb')]);router[_0x42a5('0x6')](_0x42a5('0xc'),auth[_0x42a5('0x7')](),controller[_0x42a5('0xd')]);router[_0x42a5('0x6')](_0x42a5('0xe'),auth[_0x42a5('0x7')](),controller[_0x42a5('0xf')]);router['post']('/',auth[_0x42a5('0x7')](),controller[_0x42a5('0x10')]);router[_0x42a5('0x11')](_0x42a5('0xc'),auth[_0x42a5('0x7')](),controller[_0x42a5('0x12')]);router[_0x42a5('0x11')](_0x42a5('0xe'),auth['isAuthenticated'](),controller[_0x42a5('0x13')]);router[_0x42a5('0x14')](_0x42a5('0x15'),auth[_0x42a5('0x7')](),controller[_0x42a5('0x16')]);router[_0x42a5('0x17')](_0x42a5('0x15'),auth[_0x42a5('0x7')](),controller[_0x42a5('0x18')]);router[_0x42a5('0x17')](_0x42a5('0xc'),auth['isAuthenticated'](),controller[_0x42a5('0x19')]);router['delete'](_0x42a5('0xe'),auth[_0x42a5('0x7')](),controller['removeAgents']);module[_0x42a5('0x1a')]=router; \ No newline at end of file +var _0x093d=['/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x093d,0x145));var _0xd093=function(_0x4da462,_0x2aac46){_0x4da462=_0x4da462-0x0;var _0x2a001a=_0x093d[_0x4da462];return _0x2a001a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd093('0x0'));var express=require(_0xd093('0x1'));var router=express[_0xd093('0x2')]();var fs_extra=require(_0xd093('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd093('0x4'));var config=require(_0xd093('0x5'));var controller=require(_0xd093('0x6'));router[_0xd093('0x7')]('/',auth['isAuthenticated'](),controller[_0xd093('0x8')]);router[_0xd093('0x7')]('/describe',auth[_0xd093('0x9')](),controller[_0xd093('0xa')]);router[_0xd093('0x7')](_0xd093('0xb'),auth['isAuthenticated'](),controller[_0xd093('0xc')]);router['get'](_0xd093('0xd'),auth['isAuthenticated'](),controller[_0xd093('0xe')]);router[_0xd093('0x7')]('/:id/teams',auth[_0xd093('0x9')](),controller[_0xd093('0xf')]);router[_0xd093('0x7')](_0xd093('0x10'),auth[_0xd093('0x9')](),controller['getAgents']);router[_0xd093('0x11')]('/',auth[_0xd093('0x9')](),controller[_0xd093('0x12')]);router[_0xd093('0x11')]('/:id/teams',auth[_0xd093('0x9')](),controller[_0xd093('0x13')]);router[_0xd093('0x11')](_0xd093('0x10'),auth[_0xd093('0x9')](),controller[_0xd093('0x14')]);router[_0xd093('0x15')](_0xd093('0xb'),auth[_0xd093('0x9')](),controller[_0xd093('0x16')]);router[_0xd093('0x17')](_0xd093('0xb'),auth[_0xd093('0x9')](),controller[_0xd093('0x18')]);router[_0xd093('0x17')](_0xd093('0x19'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xd093('0x17')]('/:id/users',auth[_0xd093('0x9')](),controller[_0xd093('0x1a')]);module[_0xd093('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c834717..5492f1c 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 _0xe906=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe906,0x13d));var _0x6e90=function(_0x33b54c,_0x50f02d){_0x33b54c=_0x33b54c-0x0;var _0x3b8bf2=_0xe906[_0x33b54c];return _0x3b8bf2;};'use strict';var Sequelize=require(_0x6e90('0x0'));module[_0x6e90('0x1')]={'name':{'type':Sequelize[_0x6e90('0x2')],'unique':_0x6e90('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6e90('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6e90('0x4')](_0x6e90('0x5'),_0x6e90('0x6'),_0x6e90('0x7'))}}; \ No newline at end of file +var _0x2f54=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x24c5dd,_0x4f6595){var _0x3a28b8=function(_0x16550c){while(--_0x16550c){_0x24c5dd['push'](_0x24c5dd['shift']());}};_0x3a28b8(++_0x4f6595);}(_0x2f54,0x1da));var _0x42f5=function(_0x5bd4fc,_0x4fbd8c){_0x5bd4fc=_0x5bd4fc-0x0;var _0x14b56e=_0x2f54[_0x5bd4fc];return _0x14b56e;};'use strict';var Sequelize=require('sequelize');module[_0x42f5('0x0')]={'name':{'type':Sequelize[_0x42f5('0x1')],'unique':_0x42f5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x42f5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x42f5('0x4')](_0x42f5('0x5'),_0x42f5('0x6'),_0x42f5('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c5fff3e..959283d 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 _0xb90a=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','OpenchannelQueues','error','name','send','map','OpenchannelQueue','rawAttributes','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','catch','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','options','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','format','getTeams','findOne','Team','addTeams','ids','User','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Agents','select','field','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3f80b9,_0x5a9025){var _0x1de77d=function(_0x521349){while(--_0x521349){_0x3f80b9['push'](_0x3f80b9['shift']());}};_0x1de77d(++_0x5a9025);}(_0xb90a,0x8a));var _0xab90=function(_0x1aead1,_0x912303){_0x1aead1=_0x1aead1-0x0;var _0x71a736=_0xb90a[_0x1aead1];return _0x71a736;};'use strict';var emlformat=require(_0xab90('0x0'));var rimraf=require(_0xab90('0x1'));var zipdir=require(_0xab90('0x2'));var jsonpatch=require(_0xab90('0x3'));var rp=require(_0xab90('0x4'));var moment=require('moment');var BPromise=require(_0xab90('0x5'));var Mustache=require('mustache');var util=require(_0xab90('0x6'));var path=require(_0xab90('0x7'));var sox=require(_0xab90('0x8'));var csv=require(_0xab90('0x9'));var ejs=require(_0xab90('0xa'));var fs=require('fs');var fs_extra=require(_0xab90('0xb'));var _=require(_0xab90('0xc'));var squel=require(_0xab90('0xd'));var crypto=require(_0xab90('0xe'));var jsforce=require(_0xab90('0xf'));var deskjs=require(_0xab90('0x10'));var toCsv=require('to-csv');var querystring=require(_0xab90('0x11'));var Papa=require('papaparse');var Redis=require(_0xab90('0x12'));var authService=require(_0xab90('0x13'));var qs=require(_0xab90('0x14'));var as=require(_0xab90('0x15'));var hardwareService=require(_0xab90('0x16'));var logger=require('../../config/logger')(_0xab90('0x17'));var utils=require(_0xab90('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xab90('0x19'));var db=require(_0xab90('0x1a'))['db'];config[_0xab90('0x1b')]=_[_0xab90('0x1c')](config['redis'],{'host':_0xab90('0x1d'),'port':0x18eb});var socket=require(_0xab90('0x1e'))(new Redis(config[_0xab90('0x1b')]));require(_0xab90('0x1f'))[_0xab90('0x20')](socket);function respondWithStatusCode(_0xeba620,_0x47fce9){_0x47fce9=_0x47fce9||0xcc;return function(_0x399716){if(_0x399716){return _0xeba620[_0xab90('0x21')](_0x47fce9);}return _0xeba620[_0xab90('0x22')](_0x47fce9)[_0xab90('0x23')]();};}function respondWithResult(_0x5d6154,_0x112376){_0x112376=_0x112376||0xc8;return function(_0x5ed74e){if(_0x5ed74e){return _0x5d6154[_0xab90('0x22')](_0x112376)[_0xab90('0x24')](_0x5ed74e);}};}function respondWithFilteredResult(_0x5a3eaf,_0x49a4f0){return function(_0xaaa653){if(_0xaaa653){var _0x46d4f9=typeof _0x49a4f0[_0xab90('0x25')]===_0xab90('0x26')&&typeof _0x49a4f0[_0xab90('0x27')]==='undefined';var _0x1108f5=_0xaaa653[_0xab90('0x28')];var _0xf95911=_0x46d4f9?0x0:_0x49a4f0[_0xab90('0x25')];var _0x480676=_0x46d4f9?_0xaaa653[_0xab90('0x28')]:_0x49a4f0['offset']+_0x49a4f0['limit'];var _0x574339;if(_0x480676>=_0x1108f5){_0x480676=_0x1108f5;_0x574339=0xc8;}else{_0x574339=0xce;}_0x5a3eaf[_0xab90('0x22')](_0x574339);return _0x5a3eaf[_0xab90('0x29')]('Content-Range',_0xf95911+'-'+_0x480676+'/'+_0x1108f5)['json'](_0xaaa653);}return null;};}function patchUpdates(_0x311d51){return function(_0x3f2395){try{jsonpatch['apply'](_0x3f2395,_0x311d51,!![]);}catch(_0x775514){return BPromise[_0xab90('0x2a')](_0x775514);}return _0x3f2395[_0xab90('0x2b')]();};}function saveUpdates(_0x4402b7,_0x35f6bb){return function(_0xd06479){if(_0xd06479){return _0xd06479['update'](_0x4402b7)[_0xab90('0x2c')](function(_0x41a7a1){return _0x41a7a1;});}return null;};}function removeEntity(_0x4ed617,_0x5b1793){return function(_0x3760f3){if(_0x3760f3){return _0x3760f3[_0xab90('0x2d')]()[_0xab90('0x2c')](function(){var _0x2161dc=_0x3760f3[_0xab90('0x2e')]({'plain':!![]});var _0x3c8d8f=_0xab90('0x2f');return db['UserProfileResource'][_0xab90('0x2d')]({'where':{'type':_0x3c8d8f,'resourceId':_0x2161dc['id']}})[_0xab90('0x2c')](function(){return _0x3760f3;});})[_0xab90('0x2c')](function(){_0x4ed617['status'](0xcc)[_0xab90('0x23')]();});}};}function handleEntityNotFound(_0x279c8a,_0x34ae8b){return function(_0x527cf4){if(!_0x527cf4){_0x279c8a[_0xab90('0x21')](0x194);}return _0x527cf4;};}function handleError(_0x89c0d2,_0x175702){_0x175702=_0x175702||0x1f4;return function(_0xadccd6){logger[_0xab90('0x30')](_0xadccd6['stack']);if(_0xadccd6[_0xab90('0x31')]){delete _0xadccd6[_0xab90('0x31')];}_0x89c0d2[_0xab90('0x22')](_0x175702)[_0xab90('0x32')](_0xadccd6);};}exports['index']=function(_0x3f6c2f,_0x1404bc){var _0xddbee7={},_0x24a3ba={},_0x3e485f={'count':0x0,'rows':[]};var _0x2e3f40=_[_0xab90('0x33')](db[_0xab90('0x34')][_0xab90('0x35')],function(_0x19bf76){return{'name':_0x19bf76['fieldName'],'type':_0x19bf76[_0xab90('0x36')][_0xab90('0x37')]};});_0x24a3ba[_0xab90('0x38')]=_[_0xab90('0x33')](_0x2e3f40,_0xab90('0x31'));_0x24a3ba['query']=_[_0xab90('0x39')](_0x3f6c2f['query']);_0x24a3ba[_0xab90('0x3a')]=_['intersection'](_0x24a3ba[_0xab90('0x38')],_0x24a3ba[_0xab90('0x3b')]);_0xddbee7[_0xab90('0x3c')]=_['intersection'](_0x24a3ba[_0xab90('0x38')],qs['fields'](_0x3f6c2f[_0xab90('0x3b')][_0xab90('0x3d')]));_0xddbee7[_0xab90('0x3c')]=_0xddbee7[_0xab90('0x3c')][_0xab90('0x3e')]?_0xddbee7[_0xab90('0x3c')]:_0x24a3ba[_0xab90('0x38')];if(!_0x3f6c2f[_0xab90('0x3b')][_0xab90('0x3f')](_0xab90('0x40'))){_0xddbee7[_0xab90('0x27')]=qs[_0xab90('0x27')](_0x3f6c2f[_0xab90('0x3b')]['limit']);_0xddbee7[_0xab90('0x25')]=qs[_0xab90('0x25')](_0x3f6c2f[_0xab90('0x3b')][_0xab90('0x25')]);}_0xddbee7[_0xab90('0x41')]=qs[_0xab90('0x42')](_0x3f6c2f['query'][_0xab90('0x42')]);_0xddbee7['where']=qs[_0xab90('0x3a')](_[_0xab90('0x43')](_0x3f6c2f[_0xab90('0x3b')],_0x24a3ba[_0xab90('0x3a')]),_0x2e3f40);if(_0x3f6c2f[_0xab90('0x3b')]['filter']){_0xddbee7[_0xab90('0x44')]=_[_0xab90('0x45')](_0xddbee7['where'],{'$or':_[_0xab90('0x33')](_0x2e3f40,function(_0x12d77c){if(_0x12d77c[_0xab90('0x36')]!==_0xab90('0x46')){var _0x50a49c={};_0x50a49c[_0x12d77c[_0xab90('0x31')]]={'$like':'%'+_0x3f6c2f['query'][_0xab90('0x47')]+'%'};return _0x50a49c;}})});}_0xddbee7=_[_0xab90('0x45')]({},_0xddbee7,_0x3f6c2f['options']);var _0x2ea507={'where':_0xddbee7[_0xab90('0x44')]};return db['OpenchannelQueue']['count'](_0x2ea507)['then'](function(_0x26f002){_0x3e485f[_0xab90('0x28')]=_0x26f002;if(_0x3f6c2f['query']['includeAll']){_0xddbee7[_0xab90('0x48')]=[{'all':!![]}];}return db[_0xab90('0x34')][_0xab90('0x49')](_0xddbee7);})['then'](function(_0x259dc3){_0x3e485f['rows']=_0x259dc3;return _0x3e485f;})[_0xab90('0x2c')](respondWithFilteredResult(_0x1404bc,_0xddbee7))[_0xab90('0x4a')](handleError(_0x1404bc,null));};exports['show']=function(_0x16a539,_0xcc2423){var _0x68d126={'raw':!![],'where':{'id':_0x16a539[_0xab90('0x4b')]['id']}},_0x5c10b8={};_0x5c10b8[_0xab90('0x38')]=_[_0xab90('0x39')](db[_0xab90('0x34')][_0xab90('0x35')]);_0x5c10b8[_0xab90('0x3b')]=_[_0xab90('0x39')](_0x16a539[_0xab90('0x3b')]);_0x5c10b8[_0xab90('0x3a')]=_['intersection'](_0x5c10b8[_0xab90('0x38')],_0x5c10b8[_0xab90('0x3b')]);_0x68d126[_0xab90('0x3c')]=_[_0xab90('0x4c')](_0x5c10b8['model'],qs[_0xab90('0x3d')](_0x16a539['query'][_0xab90('0x3d')]));_0x68d126[_0xab90('0x3c')]=_0x68d126[_0xab90('0x3c')][_0xab90('0x3e')]?_0x68d126[_0xab90('0x3c')]:_0x5c10b8[_0xab90('0x38')];if(_0x16a539[_0xab90('0x3b')][_0xab90('0x4d')]){_0x68d126['include']=[{'all':!![]}];}_0x68d126=_[_0xab90('0x45')]({},_0x68d126,_0x16a539['options']);return db[_0xab90('0x34')][_0xab90('0x4e')](_0x68d126)['then'](handleEntityNotFound(_0xcc2423,null))[_0xab90('0x2c')](respondWithResult(_0xcc2423,null))['catch'](handleError(_0xcc2423,null));};exports[_0xab90('0x4f')]=function(_0x254aa8,_0x12b07a){return db[_0xab90('0x34')][_0xab90('0x4f')](_0x254aa8[_0xab90('0x50')],{})[_0xab90('0x2c')](function(_0x3de35e){var _0x1600cc=_0x254aa8[_0xab90('0x51')][_0xab90('0x2e')]({'plain':!![]});if(!_0x1600cc)throw new Error(_0xab90('0x52'));if(_0x1600cc['role']===_0xab90('0x51')){var _0x4995af=_0x3de35e['get']({'plain':!![]});var _0xf404e3=_0xab90('0x2f');return db[_0xab90('0x53')][_0xab90('0x4e')]({'where':{'name':_0xf404e3,'userProfileId':_0x1600cc[_0xab90('0x54')]},'raw':!![]})[_0xab90('0x2c')](function(_0x13b110){if(_0x13b110&&_0x13b110['autoAssociation']===0x0){return db[_0xab90('0x55')][_0xab90('0x4f')]({'name':_0x4995af[_0xab90('0x31')],'resourceId':_0x4995af['id'],'type':_0x13b110[_0xab90('0x31')],'sectionId':_0x13b110['id']},{})['then'](function(){return _0x3de35e;});}else{return _0x3de35e;}})[_0xab90('0x4a')](function(_0x51184d){logger[_0xab90('0x30')](_0xab90('0x56'),_0x51184d);throw _0x51184d;});}return _0x3de35e;})[_0xab90('0x2c')](respondWithResult(_0x12b07a,0xc9))[_0xab90('0x4a')](handleError(_0x12b07a,null));};exports[_0xab90('0x57')]=function(_0x36f603,_0x354ab4){if(_0x36f603[_0xab90('0x50')]['id']){delete _0x36f603[_0xab90('0x50')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x36f603[_0xab90('0x4b')]['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0x354ab4,null))[_0xab90('0x2c')](saveUpdates(_0x36f603[_0xab90('0x50')],null))[_0xab90('0x2c')](respondWithResult(_0x354ab4,null))[_0xab90('0x4a')](handleError(_0x354ab4,null));};exports[_0xab90('0x2d')]=function(_0x5afc29,_0x81f3c6){return db[_0xab90('0x34')][_0xab90('0x4e')]({'where':{'id':_0x5afc29['params']['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0x81f3c6,null))[_0xab90('0x2c')](removeEntity(_0x81f3c6,null))['catch'](handleError(_0x81f3c6,null));};exports['describe']=function(_0x43344d,_0x490eb3){return db[_0xab90('0x34')][_0xab90('0x58')]()['then'](respondWithResult(_0x490eb3,null))[_0xab90('0x4a')](handleError(_0x490eb3,null));};exports[_0xab90('0x59')]=function(_0x167ba4,_0x59bac4,_0xfb4a91){var _0x57c606={'raw':!![],'where':{}},_0x4f0b8f={},_0x3d363c;return db[_0xab90('0x34')]['findOne']({'where':{'id':_0x167ba4[_0xab90('0x4b')]['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0x59bac4,null))[_0xab90('0x2c')](function(_0x5496b5){if(_0x5496b5){_0x3d363c=_0x5496b5[_0xab90('0x2e')]({'plain':!![]});_0x4f0b8f[_0xab90('0x38')]=_[_0xab90('0x39')](db[_0xab90('0x5a')][_0xab90('0x35')]);_0x4f0b8f[_0xab90('0x3b')]=_['keys'](_0x167ba4['query']);_0x4f0b8f[_0xab90('0x3a')]=_['intersection'](_0x4f0b8f[_0xab90('0x38')],_0x4f0b8f[_0xab90('0x3b')]);_0x57c606[_0xab90('0x3c')]=_[_0xab90('0x4c')](_0x4f0b8f[_0xab90('0x38')],qs[_0xab90('0x3d')](_0x167ba4[_0xab90('0x3b')][_0xab90('0x3d')]));_0x57c606[_0xab90('0x3c')]=_0x57c606[_0xab90('0x3c')][_0xab90('0x3e')]?_0x57c606[_0xab90('0x3c')]:_0x4f0b8f[_0xab90('0x38')];if(!_0x167ba4[_0xab90('0x3b')][_0xab90('0x3f')](_0xab90('0x40'))){_0x57c606['limit']=qs[_0xab90('0x27')](_0x167ba4[_0xab90('0x3b')][_0xab90('0x27')]);_0x57c606[_0xab90('0x25')]=qs[_0xab90('0x25')](_0x167ba4['query'][_0xab90('0x25')]);}_0x57c606['order']=qs[_0xab90('0x42')](_0x167ba4[_0xab90('0x3b')][_0xab90('0x42')]);_0x57c606[_0xab90('0x44')]=qs['filters'](_[_0xab90('0x43')](_0x167ba4[_0xab90('0x3b')],_0x4f0b8f[_0xab90('0x3a')]));_0x57c606[_0xab90('0x44')][_0xab90('0x5b')]=_0x5496b5['id'];if(_0x167ba4['query'][_0xab90('0x47')]){_0x57c606[_0xab90('0x44')]=_[_0xab90('0x45')](_0x57c606[_0xab90('0x44')],{'$or':_[_0xab90('0x33')](_0x57c606[_0xab90('0x3c')],function(_0x5c1718){var _0x40dc39={};_0x40dc39[_0x5c1718]={'$like':'%'+_0x167ba4[_0xab90('0x3b')]['filter']+'%'};return _0x40dc39;})});}_0x57c606=_[_0xab90('0x45')]({},_0x57c606,_0x167ba4[_0xab90('0x5c')]);return db[_0xab90('0x5a')][_0xab90('0x49')](_0x57c606);}})[_0xab90('0x2c')](function(_0x252248){if(_0x252248){return db['User'][_0xab90('0x5d')]({'where':{'id':_['map'](_0x252248,_0xab90('0x5e')),'role':_0xab90('0x5f')},'attributes':['id',_0xab90('0x31'),_0xab90('0x60'),_0xab90('0x61'),_0xab90('0x62')]});}})[_0xab90('0x2c')](function(_0x31dccb){if(_0x31dccb){return{'count':_0x31dccb['count'],'rows':_['map'](_0x31dccb[_0xab90('0x63')],function(_0x1dcf05){return{'membername':_0x1dcf05[_0xab90('0x31')],'UserId':_0x1dcf05['id'],'queue_name':_0x3d363c[_0xab90('0x31')],'OpenchannelQueueId':_0x3d363c['id'],'interface':util[_0xab90('0x64')]('%s/%s','SIP',_0x1dcf05[_0xab90('0x31')]),'penalty':0x0,'paused':_0x1dcf05['openchannelPause'],'createdAt':_0x1dcf05[_0xab90('0x62')],'updatedAt':_0x1dcf05[_0xab90('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xab90('0x2c')](respondWithFilteredResult(_0x59bac4,_0x57c606))['catch'](handleError(_0x59bac4,null));};exports[_0xab90('0x65')]=function(_0x1502cd,_0x40010a,_0x48088a){var _0x263e88={};var _0x25d0d4={};var _0x5f1f32;var _0x4bbc45;return db[_0xab90('0x34')][_0xab90('0x66')]({'where':{'id':_0x1502cd[_0xab90('0x4b')]['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0x40010a,null))[_0xab90('0x2c')](function(_0x3f94d6){if(_0x3f94d6){_0x5f1f32=_0x3f94d6;_0x25d0d4[_0xab90('0x38')]=_[_0xab90('0x39')](db[_0xab90('0x67')][_0xab90('0x35')]);_0x25d0d4['query']=_[_0xab90('0x39')](_0x1502cd['query']);_0x25d0d4[_0xab90('0x3a')]=_[_0xab90('0x4c')](_0x25d0d4[_0xab90('0x38')],_0x25d0d4['query']);_0x263e88[_0xab90('0x3c')]=_['intersection'](_0x25d0d4[_0xab90('0x38')],qs[_0xab90('0x3d')](_0x1502cd[_0xab90('0x3b')]['fields']));_0x263e88[_0xab90('0x3c')]=_0x263e88[_0xab90('0x3c')]['length']?_0x263e88[_0xab90('0x3c')]:_0x25d0d4[_0xab90('0x38')];_0x263e88[_0xab90('0x41')]=qs['sort'](_0x1502cd[_0xab90('0x3b')][_0xab90('0x42')]);_0x263e88[_0xab90('0x44')]=qs[_0xab90('0x3a')](_[_0xab90('0x43')](_0x1502cd[_0xab90('0x3b')],_0x25d0d4['filters']));if(_0x1502cd[_0xab90('0x3b')][_0xab90('0x47')]){_0x263e88['where']=_[_0xab90('0x45')](_0x263e88[_0xab90('0x44')],{'$or':_[_0xab90('0x33')](_0x263e88[_0xab90('0x3c')],function(_0x299972){var _0x239f61={};_0x239f61[_0x299972]={'$like':'%'+_0x1502cd[_0xab90('0x3b')][_0xab90('0x47')]+'%'};return _0x239f61;})});}_0x263e88=_[_0xab90('0x45')]({},_0x263e88,_0x1502cd[_0xab90('0x5c')]);return _0x5f1f32[_0xab90('0x65')](_0x263e88);}})[_0xab90('0x2c')](function(_0x542a52){if(_0x542a52){_0x4bbc45=_0x542a52[_0xab90('0x3e')];if(!_0x1502cd[_0xab90('0x3b')]['hasOwnProperty']('nolimit')){_0x263e88['limit']=qs[_0xab90('0x27')](_0x1502cd[_0xab90('0x3b')][_0xab90('0x27')]);_0x263e88['offset']=qs[_0xab90('0x25')](_0x1502cd[_0xab90('0x3b')][_0xab90('0x25')]);}return _0x5f1f32['getTeams'](_0x263e88);}})['then'](function(_0x5be011){if(_0x5be011){return _0x5be011?{'count':_0x4bbc45,'rows':_0x5be011}:null;}})[_0xab90('0x2c')](respondWithResult(_0x40010a,null))['catch'](handleError(_0x40010a,null));};exports[_0xab90('0x68')]=function(_0x5d22d6,_0x46ea06,_0x35db2b){var _0x719546=_0x5d22d6[_0xab90('0x50')][_0xab90('0x69')];return db[_0xab90('0x67')][_0xab90('0x49')]({'where':{'id':_0x719546},'attributes':['id'],'include':[{'model':db[_0xab90('0x6a')],'as':'Agents','attributes':['id',_0xab90('0x31'),_0xab90('0x6b'),_0xab90('0x6c'),_0xab90('0x6d')],'raw':!![]}]})[_0xab90('0x2c')](function(_0x21d958){if(_0x21d958){var _0x1ba8ed=_[_0xab90('0x6e')](_0x21d958,function(_0x311f0b){var _0x50c787=_0x311f0b['get']({'plain':!![]});return _0x50c787['Agents'];});return db[_0xab90('0x34')][_0xab90('0x4e')]({'where':{'id':_0x5d22d6[_0xab90('0x4b')]['id']}})[_0xab90('0x2c')](function(_0x2e8b8e){return db[_0xab90('0x6f')]['transaction'](function(_0x2ceff1){return _0x2e8b8e[_0xab90('0x68')](_0x719546,{'transaction':_0x2ceff1})[_0xab90('0x2c')](function(){return BPromise[_0xab90('0x70')](_0x1ba8ed,function(_0xd122ea){return db[_0xab90('0x5a')][_0xab90('0x71')]({'where':{'UserId':_0xd122ea['id'],'OpenchannelQueueId':_0x5d22d6[_0xab90('0x4b')]['id']},'transaction':_0x2ceff1});});})[_0xab90('0x2c')](function(){_0x1ba8ed[_0xab90('0x72')](function(_0x561a88){socket[_0xab90('0x73')](_0xab90('0x74'),{'UserId':_0x561a88['id'],'OpenchannelQueueId':_0x2e8b8e['id']});});});});});}})[_0xab90('0x2c')](respondWithStatusCode(_0x46ea06,null))[_0xab90('0x4a')](handleError(_0x46ea06,null));};exports[_0xab90('0x75')]=function(_0x160eb2,_0x46b3c0,_0x5bec46){return db[_0xab90('0x67')]['findAll']({'where':{'id':_0x160eb2['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xab90('0x76'),'attributes':['id'],'raw':!![]}]})[_0xab90('0x2c')](handleEntityNotFound(_0x46b3c0,null))[_0xab90('0x2c')](function(_0x10aeb7){var _0x1ad68f=_['map'](_0x10aeb7,'id');var _0x56d281=[];var _0x305b33=[];var _0x3042ec=squel[_0xab90('0x77')]();_0x3042ec[_0xab90('0x78')]('tq.TeamId')['from'](_0xab90('0x79'),'tq')[_0xab90('0x7a')](_0xab90('0x7b'),'ut',_0xab90('0x7c'))[_0xab90('0x44')](_0xab90('0x7d'),_0x160eb2[_0xab90('0x4b')]['id']);for(var _0x1b2d31=0x0;_0x1b2d31<_0x10aeb7[_0xab90('0x3e')];_0x1b2d31+=0x1){let _0x81511a=_0x10aeb7[_0x1b2d31];for(var _0x1d7ae5=0x0;_0x1d7ae5<_0x81511a[_0xab90('0x76')][_0xab90('0x3e')];_0x1d7ae5+=0x1){let _0xf334c7=_0x81511a[_0xab90('0x76')][_0x1d7ae5];var _0x3109bc=_0x3042ec[_0xab90('0x7e')]();_0x3109bc[_0xab90('0x44')]('ut.UserId\x20=\x20?',_0xf334c7['id']);_0x305b33[_0xab90('0x7f')](db['sequelize']['query'](_0x3109bc[_0xab90('0x80')](),{'type':db['sequelize'][_0xab90('0x81')]['SELECT']})[_0xab90('0x2c')](function(_0xebcf5d){if(_0xebcf5d['length']===0x1){return _0xf334c7['id'];}else{var _0x5b02a8=_[_0xab90('0x82')](_[_0xab90('0x33')](_0xebcf5d,_0xab90('0x83')),function(_0x4c8cbb){return _[_0xab90('0x84')](_0x1ad68f,_0x4c8cbb);});if(_0x5b02a8){return _0xf334c7['id'];}}}));}}return BPromise[_0xab90('0x85')](_0x305b33)[_0xab90('0x2c')](function(_0xb5b5b0){_0x56d281=_(_0x56d281)[_0xab90('0x86')](_0xb5b5b0)[_0xab90('0x87')]()[_0xab90('0x88')]();return db[_0xab90('0x34')][_0xab90('0x4e')]({'where':{'id':_0x160eb2[_0xab90('0x4b')]['id']}})['then'](function(_0x553302){return db[_0xab90('0x6f')]['transaction'](function(_0x7906ec){return _0x553302[_0xab90('0x75')](_0x160eb2['query'][_0xab90('0x69')],{'transaction':_0x7906ec})['then'](function(){if(!_[_0xab90('0x89')](_0x56d281)){return _0x553302[_0xab90('0x8a')](_0x56d281,{'transaction':_0x7906ec});}})[_0xab90('0x2c')](function(){_0x56d281['forEach'](function(_0x2c9d4f){socket[_0xab90('0x73')]('userOpenchannelQueue:remove',{'UserId':_0x2c9d4f,'OpenchannelQueueId':_0x553302['id']});});});});});});})[_0xab90('0x2c')](respondWithStatusCode(_0x46b3c0,null))[_0xab90('0x4a')](handleError(_0x46b3c0,null));};exports[_0xab90('0x8b')]=function(_0x1ad57a,_0x307d8f,_0x50a28a){return db[_0xab90('0x34')][_0xab90('0x4e')]({'where':{'id':_0x1ad57a['params']['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0x307d8f,null))[_0xab90('0x2c')](function(_0x4993f6){if(_0x4993f6){return _0x4993f6[_0xab90('0x8b')](_0x1ad57a[_0xab90('0x50')][_0xab90('0x69')],_[_0xab90('0x8c')](_0x1ad57a[_0xab90('0x50')],[_0xab90('0x69'),'id'])||{})['spread'](function(_0x464e87){for(var _0xff5f19=0x0;_0xff5f19<_0x1ad57a[_0xab90('0x50')][_0xab90('0x69')][_0xab90('0x3e')];_0xff5f19+=0x1){socket['emit'](_0xab90('0x74'),{'UserId':Number(_0x1ad57a[_0xab90('0x50')][_0xab90('0x69')][_0xff5f19]),'OpenchannelQueueId':Number(_0x1ad57a[_0xab90('0x4b')]['id'])});}return _0x464e87;});}})['then'](respondWithResult(_0x307d8f,null))[_0xab90('0x4a')](handleError(_0x307d8f,null));};exports[_0xab90('0x8a')]=function(_0x5cd15d,_0x2a2900,_0x17de3b){return db[_0xab90('0x34')][_0xab90('0x4e')]({'where':{'id':_0x5cd15d[_0xab90('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a2900,null))[_0xab90('0x2c')](function(_0x1409e9){if(_0x1409e9){return _0x1409e9[_0xab90('0x8a')](_0x5cd15d[_0xab90('0x3b')][_0xab90('0x69')])[_0xab90('0x2c')](function(){if(_['isArray'](_0x5cd15d[_0xab90('0x3b')][_0xab90('0x69')])){for(var _0x2b8a8b=0x0;_0x2b8a8b<_0x5cd15d['query'][_0xab90('0x69')][_0xab90('0x3e')];_0x2b8a8b+=0x1){socket[_0xab90('0x73')](_0xab90('0x8d'),{'UserId':Number(_0x5cd15d['query'][_0xab90('0x69')][_0x2b8a8b]),'OpenchannelQueueId':Number(_0x5cd15d[_0xab90('0x4b')]['id'])});}}else{socket[_0xab90('0x73')](_0xab90('0x8d'),{'UserId':Number(_0x5cd15d[_0xab90('0x3b')][_0xab90('0x69')]),'OpenchannelQueueId':Number(_0x5cd15d[_0xab90('0x4b')]['id'])});}});}})[_0xab90('0x2c')](respondWithStatusCode(_0x2a2900,null))['catch'](handleError(_0x2a2900,null));};exports['getAgents']=function(_0x40996f,_0xec2b55,_0x1ac38a){var _0x1b5e0f={};var _0x332a48={};var _0xd30f80;var _0x7714ef;return db[_0xab90('0x34')][_0xab90('0x66')]({'where':{'id':_0x40996f['params']['id']}})[_0xab90('0x2c')](handleEntityNotFound(_0xec2b55,null))[_0xab90('0x2c')](function(_0x120b2f){if(_0x120b2f){_0xd30f80=_0x120b2f;_0x332a48[_0xab90('0x38')]=_['keys'](db[_0xab90('0x6a')][_0xab90('0x35')]);_0x332a48['query']=_[_0xab90('0x39')](_0x40996f[_0xab90('0x3b')]);_0x332a48[_0xab90('0x3a')]=_[_0xab90('0x4c')](_0x332a48[_0xab90('0x38')],_0x332a48['query']);_0x1b5e0f[_0xab90('0x3c')]=_[_0xab90('0x4c')](_0x332a48[_0xab90('0x38')],qs[_0xab90('0x3d')](_0x40996f[_0xab90('0x3b')][_0xab90('0x3d')]));_0x1b5e0f[_0xab90('0x3c')]=_0x1b5e0f['attributes'][_0xab90('0x3e')]?_0x1b5e0f['attributes']:_0x332a48[_0xab90('0x38')];_0x1b5e0f[_0xab90('0x41')]=qs[_0xab90('0x42')](_0x40996f['query'][_0xab90('0x42')]);_0x1b5e0f[_0xab90('0x44')]=qs[_0xab90('0x3a')](_['pick'](_0x40996f[_0xab90('0x3b')],_0x332a48[_0xab90('0x3a')]));if(_0x40996f['query'][_0xab90('0x47')]){_0x1b5e0f[_0xab90('0x44')]=_[_0xab90('0x45')](_0x1b5e0f[_0xab90('0x44')],{'$or':_[_0xab90('0x33')](_0x1b5e0f[_0xab90('0x3c')],function(_0xaac3b6){var _0xacb716={};_0xacb716[_0xaac3b6]={'$like':'%'+_0x40996f['query'][_0xab90('0x47')]+'%'};return _0xacb716;})});}_0x1b5e0f=_[_0xab90('0x45')]({},_0x1b5e0f,_0x40996f[_0xab90('0x5c')]);return _0xd30f80[_0xab90('0x8e')](_0x1b5e0f);}})[_0xab90('0x2c')](function(_0x593893){if(_0x593893){_0x7714ef=_0x593893[_0xab90('0x3e')];if(!_0x40996f[_0xab90('0x3b')][_0xab90('0x3f')](_0xab90('0x40'))){_0x1b5e0f[_0xab90('0x27')]=qs[_0xab90('0x27')](_0x40996f[_0xab90('0x3b')][_0xab90('0x27')]);_0x1b5e0f[_0xab90('0x25')]=qs[_0xab90('0x25')](_0x40996f[_0xab90('0x3b')]['offset']);}return _0xd30f80['getAgents'](_0x1b5e0f);}})[_0xab90('0x2c')](function(_0x2f129f){if(_0x2f129f){return _0x2f129f?{'count':_0x7714ef,'rows':_0x2f129f}:null;}})[_0xab90('0x2c')](respondWithResult(_0xec2b55,null))[_0xab90('0x4a')](handleError(_0xec2b55,null));}; \ No newline at end of file +var _0xcac2=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','length','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAndCountAll','UserId','updatedAt','createdAt','rows','format','SIP','openchannelPause','getTeams','addTeams','ids','Team','online','sequelize','findOrCreate','forEach','emit','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel'];(function(_0x350ac1,_0x3344b1){var _0x2e977f=function(_0x1b58f8){while(--_0x1b58f8){_0x350ac1['push'](_0x350ac1['shift']());}};_0x2e977f(++_0x3344b1);}(_0xcac2,0x80));var _0x2cac=function(_0x3fd726,_0x510299){_0x3fd726=_0x3fd726-0x0;var _0x50cc9b=_0xcac2[_0x3fd726];return _0x50cc9b;};'use strict';var emlformat=require(_0x2cac('0x0'));var rimraf=require(_0x2cac('0x1'));var zipdir=require(_0x2cac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cac('0x3'));var moment=require(_0x2cac('0x4'));var BPromise=require(_0x2cac('0x5'));var Mustache=require(_0x2cac('0x6'));var util=require('util');var path=require(_0x2cac('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cac('0x8'));var _=require(_0x2cac('0x9'));var squel=require(_0x2cac('0xa'));var crypto=require(_0x2cac('0xb'));var jsforce=require(_0x2cac('0xc'));var deskjs=require(_0x2cac('0xd'));var toCsv=require(_0x2cac('0xe'));var querystring=require(_0x2cac('0xf'));var Papa=require(_0x2cac('0x10'));var Redis=require('ioredis');var authService=require(_0x2cac('0x11'));var qs=require(_0x2cac('0x12'));var as=require(_0x2cac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cac('0x14'))(_0x2cac('0x15'));var utils=require(_0x2cac('0x16'));var config=require(_0x2cac('0x17'));var licenseUtil=require(_0x2cac('0x18'));var db=require(_0x2cac('0x19'))['db'];config[_0x2cac('0x1a')]=_['defaults'](config[_0x2cac('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cac('0x1b'))(new Redis(config['redis']));require(_0x2cac('0x1c'))[_0x2cac('0x1d')](socket);function respondWithStatusCode(_0x2611b4,_0x26a113){_0x26a113=_0x26a113||0xcc;return function(_0x335dc0){if(_0x335dc0){return _0x2611b4[_0x2cac('0x1e')](_0x26a113);}return _0x2611b4['status'](_0x26a113)[_0x2cac('0x1f')]();};}function respondWithResult(_0x8ce0f9,_0xc1f157){_0xc1f157=_0xc1f157||0xc8;return function(_0x4f5c2e){if(_0x4f5c2e){return _0x8ce0f9[_0x2cac('0x20')](_0xc1f157)[_0x2cac('0x21')](_0x4f5c2e);}};}function respondWithFilteredResult(_0x191e46,_0x54d969){return function(_0x99af05){if(_0x99af05){var _0x342551=typeof _0x54d969[_0x2cac('0x22')]===_0x2cac('0x23')&&typeof _0x54d969['limit']===_0x2cac('0x23');var _0x86b8d9=_0x99af05[_0x2cac('0x24')];var _0x5eb193=_0x342551?0x0:_0x54d969[_0x2cac('0x22')];var _0x3e59a0=_0x342551?_0x99af05[_0x2cac('0x24')]:_0x54d969['offset']+_0x54d969[_0x2cac('0x25')];var _0x2a5519;if(_0x3e59a0>=_0x86b8d9){_0x3e59a0=_0x86b8d9;_0x2a5519=0xc8;}else{_0x2a5519=0xce;}_0x191e46[_0x2cac('0x20')](_0x2a5519);return _0x191e46[_0x2cac('0x26')](_0x2cac('0x27'),_0x5eb193+'-'+_0x3e59a0+'/'+_0x86b8d9)[_0x2cac('0x21')](_0x99af05);}return null;};}function patchUpdates(_0x1a985f){return function(_0x139fdc){try{jsonpatch[_0x2cac('0x28')](_0x139fdc,_0x1a985f,!![]);}catch(_0x33559b){return BPromise[_0x2cac('0x29')](_0x33559b);}return _0x139fdc['save']();};}function saveUpdates(_0x183869,_0x5bb9bc){return function(_0x4df86e){if(_0x4df86e){return _0x4df86e[_0x2cac('0x2a')](_0x183869)[_0x2cac('0x2b')](function(_0x4bc3f1){return _0x4bc3f1;});}return null;};}function removeEntity(_0x36513a,_0x1429ae){return function(_0x1f2e9a){if(_0x1f2e9a){return _0x1f2e9a[_0x2cac('0x2c')]()['then'](function(){var _0x164473=_0x1f2e9a[_0x2cac('0x2d')]({'plain':!![]});var _0x465002='OpenchannelQueues';return db[_0x2cac('0x2e')]['destroy']({'where':{'type':_0x465002,'resourceId':_0x164473['id']}})['then'](function(){return _0x1f2e9a;});})[_0x2cac('0x2b')](function(){_0x36513a[_0x2cac('0x20')](0xcc)[_0x2cac('0x1f')]();});}};}function handleEntityNotFound(_0x3bc2a8,_0xff4619){return function(_0x3df6b2){if(!_0x3df6b2){_0x3bc2a8[_0x2cac('0x1e')](0x194);}return _0x3df6b2;};}function handleError(_0x367158,_0x1f96c9){_0x1f96c9=_0x1f96c9||0x1f4;return function(_0x4526fa){logger[_0x2cac('0x2f')](_0x4526fa[_0x2cac('0x30')]);if(_0x4526fa[_0x2cac('0x31')]){delete _0x4526fa[_0x2cac('0x31')];}_0x367158['status'](_0x1f96c9)[_0x2cac('0x32')](_0x4526fa);};}exports[_0x2cac('0x33')]=function(_0x365023,_0xea10a1){var _0x390d04={},_0x2b8843={},_0x3de39f={'count':0x0,'rows':[]};var _0x301d4b=_['map'](db[_0x2cac('0x34')][_0x2cac('0x35')],function(_0x1a3579){return{'name':_0x1a3579[_0x2cac('0x36')],'type':_0x1a3579[_0x2cac('0x37')][_0x2cac('0x38')]};});_0x2b8843[_0x2cac('0x39')]=_[_0x2cac('0x3a')](_0x301d4b,_0x2cac('0x31'));_0x2b8843[_0x2cac('0x3b')]=_[_0x2cac('0x3c')](_0x365023['query']);_0x2b8843['filters']=_[_0x2cac('0x3d')](_0x2b8843[_0x2cac('0x39')],_0x2b8843['query']);_0x390d04[_0x2cac('0x3e')]=_[_0x2cac('0x3d')](_0x2b8843[_0x2cac('0x39')],qs[_0x2cac('0x3f')](_0x365023[_0x2cac('0x3b')][_0x2cac('0x3f')]));_0x390d04[_0x2cac('0x3e')]=_0x390d04[_0x2cac('0x3e')]['length']?_0x390d04[_0x2cac('0x3e')]:_0x2b8843[_0x2cac('0x39')];if(!_0x365023[_0x2cac('0x3b')][_0x2cac('0x40')](_0x2cac('0x41'))){_0x390d04[_0x2cac('0x25')]=qs[_0x2cac('0x25')](_0x365023['query'][_0x2cac('0x25')]);_0x390d04[_0x2cac('0x22')]=qs[_0x2cac('0x22')](_0x365023[_0x2cac('0x3b')][_0x2cac('0x22')]);}_0x390d04[_0x2cac('0x42')]=qs[_0x2cac('0x43')](_0x365023['query'][_0x2cac('0x43')]);_0x390d04[_0x2cac('0x44')]=qs[_0x2cac('0x45')](_[_0x2cac('0x46')](_0x365023[_0x2cac('0x3b')],_0x2b8843['filters']),_0x301d4b);if(_0x365023[_0x2cac('0x3b')][_0x2cac('0x47')]){_0x390d04[_0x2cac('0x44')]=_['merge'](_0x390d04[_0x2cac('0x44')],{'$or':_[_0x2cac('0x3a')](_0x301d4b,function(_0x29334d){if(_0x29334d[_0x2cac('0x37')]!==_0x2cac('0x48')){var _0x247ab4={};_0x247ab4[_0x29334d[_0x2cac('0x31')]]={'$like':'%'+_0x365023[_0x2cac('0x3b')]['filter']+'%'};return _0x247ab4;}})});}_0x390d04=_['merge']({},_0x390d04,_0x365023[_0x2cac('0x49')]);var _0x217b3c={'where':_0x390d04[_0x2cac('0x44')]};return db[_0x2cac('0x34')][_0x2cac('0x24')](_0x217b3c)[_0x2cac('0x2b')](function(_0x1aeeed){_0x3de39f['count']=_0x1aeeed;if(_0x365023[_0x2cac('0x3b')][_0x2cac('0x4a')]){_0x390d04['include']=[{'all':!![]}];}return db[_0x2cac('0x34')][_0x2cac('0x4b')](_0x390d04);})[_0x2cac('0x2b')](function(_0x5e55a4){_0x3de39f['rows']=_0x5e55a4;return _0x3de39f;})[_0x2cac('0x2b')](respondWithFilteredResult(_0xea10a1,_0x390d04))[_0x2cac('0x4c')](handleError(_0xea10a1,null));};exports[_0x2cac('0x4d')]=function(_0x107377,_0x14b651){var _0x2ef19b={'raw':!![],'where':{'id':_0x107377[_0x2cac('0x4e')]['id']}},_0x1072fa={};_0x1072fa[_0x2cac('0x39')]=_[_0x2cac('0x3c')](db[_0x2cac('0x34')][_0x2cac('0x35')]);_0x1072fa[_0x2cac('0x3b')]=_[_0x2cac('0x3c')](_0x107377['query']);_0x1072fa[_0x2cac('0x45')]=_[_0x2cac('0x3d')](_0x1072fa[_0x2cac('0x39')],_0x1072fa[_0x2cac('0x3b')]);_0x2ef19b['attributes']=_[_0x2cac('0x3d')](_0x1072fa[_0x2cac('0x39')],qs[_0x2cac('0x3f')](_0x107377[_0x2cac('0x3b')][_0x2cac('0x3f')]));_0x2ef19b[_0x2cac('0x3e')]=_0x2ef19b['attributes'][_0x2cac('0x4f')]?_0x2ef19b[_0x2cac('0x3e')]:_0x1072fa[_0x2cac('0x39')];if(_0x107377[_0x2cac('0x3b')]['includeAll']){_0x2ef19b['include']=[{'all':!![]}];}_0x2ef19b=_[_0x2cac('0x50')]({},_0x2ef19b,_0x107377[_0x2cac('0x49')]);return db[_0x2cac('0x34')][_0x2cac('0x51')](_0x2ef19b)[_0x2cac('0x2b')](handleEntityNotFound(_0x14b651,null))[_0x2cac('0x2b')](respondWithResult(_0x14b651,null))[_0x2cac('0x4c')](handleError(_0x14b651,null));};exports[_0x2cac('0x52')]=function(_0x265b36,_0x5f44cf){return db[_0x2cac('0x34')][_0x2cac('0x52')](_0x265b36['body'],{})[_0x2cac('0x2b')](function(_0x5cfea3){var _0x3cb51b=_0x265b36[_0x2cac('0x53')]['get']({'plain':!![]});if(!_0x3cb51b)throw new Error(_0x2cac('0x54'));if(_0x3cb51b['role']===_0x2cac('0x53')){var _0x59182c=_0x5cfea3['get']({'plain':!![]});var _0x30d271=_0x2cac('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x30d271,'userProfileId':_0x3cb51b[_0x2cac('0x56')]},'raw':!![]})[_0x2cac('0x2b')](function(_0xcc3910){if(_0xcc3910&&_0xcc3910['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x59182c[_0x2cac('0x31')],'resourceId':_0x59182c['id'],'type':_0xcc3910['name'],'sectionId':_0xcc3910['id']},{})['then'](function(){return _0x5cfea3;});}else{return _0x5cfea3;}})[_0x2cac('0x4c')](function(_0x548e98){logger[_0x2cac('0x2f')](_0x2cac('0x57'),_0x548e98);throw _0x548e98;});}return _0x5cfea3;})['then'](respondWithResult(_0x5f44cf,0xc9))[_0x2cac('0x4c')](handleError(_0x5f44cf,null));};exports[_0x2cac('0x2a')]=function(_0x1fd6bc,_0x500986){if(_0x1fd6bc[_0x2cac('0x58')]['id']){delete _0x1fd6bc[_0x2cac('0x58')]['id'];}return db[_0x2cac('0x34')]['find']({'where':{'id':_0x1fd6bc[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](handleEntityNotFound(_0x500986,null))[_0x2cac('0x2b')](saveUpdates(_0x1fd6bc[_0x2cac('0x58')],null))[_0x2cac('0x2b')](respondWithResult(_0x500986,null))[_0x2cac('0x4c')](handleError(_0x500986,null));};exports[_0x2cac('0x2c')]=function(_0x1d12c1,_0x436d81){return db[_0x2cac('0x34')]['find']({'where':{'id':_0x1d12c1[_0x2cac('0x4e')]['id']}})['then'](handleEntityNotFound(_0x436d81,null))[_0x2cac('0x2b')](removeEntity(_0x436d81,null))[_0x2cac('0x4c')](handleError(_0x436d81,null));};exports[_0x2cac('0x59')]=function(_0x3f3e32,_0x3d69cd){return db[_0x2cac('0x34')][_0x2cac('0x59')]()['then'](respondWithResult(_0x3d69cd,null))[_0x2cac('0x4c')](handleError(_0x3d69cd,null));};exports[_0x2cac('0x5a')]=function(_0x391907,_0x30aa58,_0x3567d2){var _0x3f9c6c={'raw':!![],'where':{}},_0xe872c3={},_0x36ca6d;return db[_0x2cac('0x34')][_0x2cac('0x5b')]({'where':{'id':_0x391907[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](handleEntityNotFound(_0x30aa58,null))[_0x2cac('0x2b')](function(_0x5310bb){if(_0x5310bb){_0x36ca6d=_0x5310bb[_0x2cac('0x2d')]({'plain':!![]});_0xe872c3[_0x2cac('0x39')]=_[_0x2cac('0x3c')](db[_0x2cac('0x5c')]['rawAttributes']);_0xe872c3[_0x2cac('0x3b')]=_[_0x2cac('0x3c')](_0x391907[_0x2cac('0x3b')]);_0xe872c3[_0x2cac('0x45')]=_[_0x2cac('0x3d')](_0xe872c3[_0x2cac('0x39')],_0xe872c3[_0x2cac('0x3b')]);_0x3f9c6c[_0x2cac('0x3e')]=_[_0x2cac('0x3d')](_0xe872c3[_0x2cac('0x39')],qs[_0x2cac('0x3f')](_0x391907[_0x2cac('0x3b')]['fields']));_0x3f9c6c['attributes']=_0x3f9c6c['attributes'][_0x2cac('0x4f')]?_0x3f9c6c[_0x2cac('0x3e')]:_0xe872c3[_0x2cac('0x39')];if(!_0x391907[_0x2cac('0x3b')][_0x2cac('0x40')]('nolimit')){_0x3f9c6c[_0x2cac('0x25')]=qs[_0x2cac('0x25')](_0x391907[_0x2cac('0x3b')][_0x2cac('0x25')]);_0x3f9c6c[_0x2cac('0x22')]=qs[_0x2cac('0x22')](_0x391907[_0x2cac('0x3b')][_0x2cac('0x22')]);}_0x3f9c6c[_0x2cac('0x42')]=qs[_0x2cac('0x43')](_0x391907[_0x2cac('0x3b')][_0x2cac('0x43')]);_0x3f9c6c[_0x2cac('0x44')]=qs[_0x2cac('0x45')](_[_0x2cac('0x46')](_0x391907[_0x2cac('0x3b')],_0xe872c3[_0x2cac('0x45')]));_0x3f9c6c[_0x2cac('0x44')][_0x2cac('0x5d')]=_0x5310bb['id'];if(_0x391907[_0x2cac('0x3b')][_0x2cac('0x47')]){_0x3f9c6c['where']=_[_0x2cac('0x50')](_0x3f9c6c[_0x2cac('0x44')],{'$or':_[_0x2cac('0x3a')](_0x3f9c6c[_0x2cac('0x3e')],function(_0x405158){var _0x1cf894={};_0x1cf894[_0x405158]={'$like':'%'+_0x391907[_0x2cac('0x3b')][_0x2cac('0x47')]+'%'};return _0x1cf894;})});}_0x3f9c6c=_[_0x2cac('0x50')]({},_0x3f9c6c,_0x391907['options']);return db[_0x2cac('0x5c')][_0x2cac('0x4b')](_0x3f9c6c);}})[_0x2cac('0x2b')](function(_0x4e73cd){if(_0x4e73cd){return db['User'][_0x2cac('0x5e')]({'where':{'id':_[_0x2cac('0x3a')](_0x4e73cd,_0x2cac('0x5f')),'role':'agent'},'attributes':['id','name','openchannelPause',_0x2cac('0x60'),_0x2cac('0x61')]});}})[_0x2cac('0x2b')](function(_0x520bda){if(_0x520bda){return{'count':_0x520bda['count'],'rows':_[_0x2cac('0x3a')](_0x520bda[_0x2cac('0x62')],function(_0x328b26){return{'membername':_0x328b26[_0x2cac('0x31')],'UserId':_0x328b26['id'],'queue_name':_0x36ca6d[_0x2cac('0x31')],'OpenchannelQueueId':_0x36ca6d['id'],'interface':util[_0x2cac('0x63')]('%s/%s',_0x2cac('0x64'),_0x328b26[_0x2cac('0x31')]),'penalty':0x0,'paused':_0x328b26[_0x2cac('0x65')],'createdAt':_0x328b26['createdAt'],'updatedAt':_0x328b26[_0x2cac('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2cac('0x2b')](respondWithFilteredResult(_0x30aa58,_0x3f9c6c))[_0x2cac('0x4c')](handleError(_0x30aa58,null));};exports[_0x2cac('0x66')]=function(_0x4da03f,_0x2e1a20,_0x548746){var _0x4dac2c={};var _0x425147={};var _0x581feb;var _0x17bc8d;return db[_0x2cac('0x34')][_0x2cac('0x5b')]({'where':{'id':_0x4da03f[_0x2cac('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e1a20,null))['then'](function(_0x591a22){if(_0x591a22){_0x581feb=_0x591a22;_0x425147['model']=_[_0x2cac('0x3c')](db['Team']['rawAttributes']);_0x425147[_0x2cac('0x3b')]=_[_0x2cac('0x3c')](_0x4da03f[_0x2cac('0x3b')]);_0x425147[_0x2cac('0x45')]=_[_0x2cac('0x3d')](_0x425147[_0x2cac('0x39')],_0x425147['query']);_0x4dac2c[_0x2cac('0x3e')]=_[_0x2cac('0x3d')](_0x425147[_0x2cac('0x39')],qs[_0x2cac('0x3f')](_0x4da03f[_0x2cac('0x3b')][_0x2cac('0x3f')]));_0x4dac2c[_0x2cac('0x3e')]=_0x4dac2c[_0x2cac('0x3e')][_0x2cac('0x4f')]?_0x4dac2c[_0x2cac('0x3e')]:_0x425147[_0x2cac('0x39')];_0x4dac2c[_0x2cac('0x42')]=qs[_0x2cac('0x43')](_0x4da03f[_0x2cac('0x3b')][_0x2cac('0x43')]);_0x4dac2c['where']=qs[_0x2cac('0x45')](_[_0x2cac('0x46')](_0x4da03f['query'],_0x425147['filters']));if(_0x4da03f['query'][_0x2cac('0x47')]){_0x4dac2c[_0x2cac('0x44')]=_['merge'](_0x4dac2c[_0x2cac('0x44')],{'$or':_[_0x2cac('0x3a')](_0x4dac2c['attributes'],function(_0x54bc1c){var _0x3cbb47={};_0x3cbb47[_0x54bc1c]={'$like':'%'+_0x4da03f[_0x2cac('0x3b')][_0x2cac('0x47')]+'%'};return _0x3cbb47;})});}_0x4dac2c=_['merge']({},_0x4dac2c,_0x4da03f[_0x2cac('0x49')]);return _0x581feb[_0x2cac('0x66')](_0x4dac2c);}})['then'](function(_0x539890){if(_0x539890){_0x17bc8d=_0x539890[_0x2cac('0x4f')];if(!_0x4da03f[_0x2cac('0x3b')][_0x2cac('0x40')](_0x2cac('0x41'))){_0x4dac2c[_0x2cac('0x25')]=qs[_0x2cac('0x25')](_0x4da03f['query']['limit']);_0x4dac2c[_0x2cac('0x22')]=qs[_0x2cac('0x22')](_0x4da03f[_0x2cac('0x3b')][_0x2cac('0x22')]);}return _0x581feb['getTeams'](_0x4dac2c);}})[_0x2cac('0x2b')](function(_0x2cb51b){if(_0x2cb51b){return _0x2cb51b?{'count':_0x17bc8d,'rows':_0x2cb51b}:null;}})['then'](respondWithResult(_0x2e1a20,null))[_0x2cac('0x4c')](handleError(_0x2e1a20,null));};exports[_0x2cac('0x67')]=function(_0x253efb,_0x4c8d22,_0x271f53){var _0x25012d=_0x253efb[_0x2cac('0x58')][_0x2cac('0x68')];return db[_0x2cac('0x69')][_0x2cac('0x4b')]({'where':{'id':_0x25012d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x2cac('0x31'),_0x2cac('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x2cac('0x2b')](function(_0x5a93f1){if(_0x5a93f1){var _0x23c66f=_['flatMap'](_0x5a93f1,function(_0x23b9af){var _0x259a86=_0x23b9af[_0x2cac('0x2d')]({'plain':!![]});return _0x259a86['Agents'];});return db[_0x2cac('0x34')][_0x2cac('0x51')]({'where':{'id':_0x253efb[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](function(_0x1ca76d){return db[_0x2cac('0x6b')]['transaction'](function(_0xb02c75){return _0x1ca76d[_0x2cac('0x67')](_0x25012d,{'transaction':_0xb02c75})[_0x2cac('0x2b')](function(){return BPromise['each'](_0x23c66f,function(_0x2171b8){return db[_0x2cac('0x5c')][_0x2cac('0x6c')]({'where':{'UserId':_0x2171b8['id'],'OpenchannelQueueId':_0x253efb[_0x2cac('0x4e')]['id']},'transaction':_0xb02c75});});})[_0x2cac('0x2b')](function(){_0x23c66f[_0x2cac('0x6d')](function(_0x451b11){socket[_0x2cac('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x451b11['id'],'OpenchannelQueueId':_0x1ca76d['id']});});});});});}})['then'](respondWithStatusCode(_0x4c8d22,null))[_0x2cac('0x4c')](handleError(_0x4c8d22,null));};exports['removeTeams']=function(_0x155572,_0x225609,_0x241d48){return db[_0x2cac('0x69')][_0x2cac('0x4b')]({'where':{'id':_0x155572[_0x2cac('0x3b')][_0x2cac('0x68')]},'attributes':['id'],'include':[{'model':db[_0x2cac('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x225609,null))[_0x2cac('0x2b')](function(_0x20fa2e){var _0x76b145=_[_0x2cac('0x3a')](_0x20fa2e,'id');var _0x370309=[];var _0x1ccf07=[];var _0x306c8c=squel[_0x2cac('0x70')]();_0x306c8c[_0x2cac('0x71')](_0x2cac('0x72'))[_0x2cac('0x73')](_0x2cac('0x74'),'tq')[_0x2cac('0x75')](_0x2cac('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2cac('0x44')](_0x2cac('0x77'),_0x155572['params']['id']);for(var _0x577517=0x0;_0x577517<_0x20fa2e[_0x2cac('0x4f')];_0x577517+=0x1){let _0x53bb5f=_0x20fa2e[_0x577517];for(var _0x1a4ec2=0x0;_0x1a4ec2<_0x53bb5f[_0x2cac('0x78')][_0x2cac('0x4f')];_0x1a4ec2+=0x1){let _0x36f41b=_0x53bb5f[_0x2cac('0x78')][_0x1a4ec2];var _0x4b418e=_0x306c8c[_0x2cac('0x79')]();_0x4b418e[_0x2cac('0x44')](_0x2cac('0x7a'),_0x36f41b['id']);_0x1ccf07['push'](db['sequelize']['query'](_0x4b418e[_0x2cac('0x7b')](),{'type':db[_0x2cac('0x6b')][_0x2cac('0x7c')]['SELECT']})[_0x2cac('0x2b')](function(_0x2636e7){if(_0x2636e7[_0x2cac('0x4f')]===0x1){return _0x36f41b['id'];}else{var _0x155421=_['every'](_['map'](_0x2636e7,_0x2cac('0x7d')),function(_0x79345d){return _[_0x2cac('0x7e')](_0x76b145,_0x79345d);});if(_0x155421){return _0x36f41b['id'];}}}));}}return BPromise[_0x2cac('0x7f')](_0x1ccf07)[_0x2cac('0x2b')](function(_0x2709f6){_0x370309=_(_0x370309)['union'](_0x2709f6)[_0x2cac('0x80')]()[_0x2cac('0x81')]();return db['OpenchannelQueue'][_0x2cac('0x51')]({'where':{'id':_0x155572[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](function(_0x3efd17){return db[_0x2cac('0x6b')][_0x2cac('0x82')](function(_0x5a7ae1){return _0x3efd17[_0x2cac('0x83')](_0x155572[_0x2cac('0x3b')]['ids'],{'transaction':_0x5a7ae1})[_0x2cac('0x2b')](function(){if(!_[_0x2cac('0x84')](_0x370309)){return _0x3efd17[_0x2cac('0x85')](_0x370309,{'transaction':_0x5a7ae1});}})[_0x2cac('0x2b')](function(){_0x370309[_0x2cac('0x6d')](function(_0x2d781f){socket['emit'](_0x2cac('0x86'),{'UserId':_0x2d781f,'OpenchannelQueueId':_0x3efd17['id']});});});});});});})[_0x2cac('0x2b')](respondWithStatusCode(_0x225609,null))[_0x2cac('0x4c')](handleError(_0x225609,null));};exports[_0x2cac('0x87')]=function(_0x1d072a,_0x54e0ca,_0x3fef9a){return db[_0x2cac('0x34')][_0x2cac('0x51')]({'where':{'id':_0x1d072a[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](handleEntityNotFound(_0x54e0ca,null))[_0x2cac('0x2b')](function(_0x3dc2da){if(_0x3dc2da){return _0x3dc2da[_0x2cac('0x87')](_0x1d072a[_0x2cac('0x58')][_0x2cac('0x68')],_[_0x2cac('0x88')](_0x1d072a[_0x2cac('0x58')],[_0x2cac('0x68'),'id'])||{})['spread'](function(_0x1b5654){for(var _0x5e6b6b=0x0;_0x5e6b6b<_0x1d072a[_0x2cac('0x58')][_0x2cac('0x68')]['length'];_0x5e6b6b+=0x1){socket[_0x2cac('0x6e')](_0x2cac('0x89'),{'UserId':Number(_0x1d072a[_0x2cac('0x58')][_0x2cac('0x68')][_0x5e6b6b]),'OpenchannelQueueId':Number(_0x1d072a['params']['id'])});}return _0x1b5654;});}})[_0x2cac('0x2b')](respondWithResult(_0x54e0ca,null))[_0x2cac('0x4c')](handleError(_0x54e0ca,null));};exports[_0x2cac('0x85')]=function(_0x6d2fc3,_0x30d5d1,_0x240414){return db[_0x2cac('0x34')][_0x2cac('0x51')]({'where':{'id':_0x6d2fc3[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](handleEntityNotFound(_0x30d5d1,null))[_0x2cac('0x2b')](function(_0x3d0c23){if(_0x3d0c23){return _0x3d0c23[_0x2cac('0x85')](_0x6d2fc3[_0x2cac('0x3b')][_0x2cac('0x68')])[_0x2cac('0x2b')](function(){if(_['isArray'](_0x6d2fc3[_0x2cac('0x3b')][_0x2cac('0x68')])){for(var _0x1fe2c8=0x0;_0x1fe2c8<_0x6d2fc3[_0x2cac('0x3b')]['ids'][_0x2cac('0x4f')];_0x1fe2c8+=0x1){socket[_0x2cac('0x6e')](_0x2cac('0x86'),{'UserId':Number(_0x6d2fc3[_0x2cac('0x3b')]['ids'][_0x1fe2c8]),'OpenchannelQueueId':Number(_0x6d2fc3[_0x2cac('0x4e')]['id'])});}}else{socket['emit'](_0x2cac('0x86'),{'UserId':Number(_0x6d2fc3[_0x2cac('0x3b')][_0x2cac('0x68')]),'OpenchannelQueueId':Number(_0x6d2fc3[_0x2cac('0x4e')]['id'])});}});}})[_0x2cac('0x2b')](respondWithStatusCode(_0x30d5d1,null))[_0x2cac('0x4c')](handleError(_0x30d5d1,null));};exports['getAgents']=function(_0x3422f0,_0x5532e7,_0x5f44f4){var _0x1ddfe4={};var _0x3ded57={};var _0xa59677;var _0x3e2d8c;return db[_0x2cac('0x34')][_0x2cac('0x5b')]({'where':{'id':_0x3422f0[_0x2cac('0x4e')]['id']}})[_0x2cac('0x2b')](handleEntityNotFound(_0x5532e7,null))[_0x2cac('0x2b')](function(_0x1212e0){if(_0x1212e0){_0xa59677=_0x1212e0;_0x3ded57[_0x2cac('0x39')]=_[_0x2cac('0x3c')](db['User'][_0x2cac('0x35')]);_0x3ded57[_0x2cac('0x3b')]=_['keys'](_0x3422f0['query']);_0x3ded57['filters']=_[_0x2cac('0x3d')](_0x3ded57[_0x2cac('0x39')],_0x3ded57[_0x2cac('0x3b')]);_0x1ddfe4['attributes']=_[_0x2cac('0x3d')](_0x3ded57[_0x2cac('0x39')],qs[_0x2cac('0x3f')](_0x3422f0['query'][_0x2cac('0x3f')]));_0x1ddfe4[_0x2cac('0x3e')]=_0x1ddfe4['attributes']['length']?_0x1ddfe4[_0x2cac('0x3e')]:_0x3ded57[_0x2cac('0x39')];_0x1ddfe4[_0x2cac('0x42')]=qs[_0x2cac('0x43')](_0x3422f0[_0x2cac('0x3b')]['sort']);_0x1ddfe4[_0x2cac('0x44')]=qs[_0x2cac('0x45')](_[_0x2cac('0x46')](_0x3422f0[_0x2cac('0x3b')],_0x3ded57[_0x2cac('0x45')]));if(_0x3422f0['query'][_0x2cac('0x47')]){_0x1ddfe4['where']=_['merge'](_0x1ddfe4['where'],{'$or':_['map'](_0x1ddfe4[_0x2cac('0x3e')],function(_0x11f03c){var _0x99e848={};_0x99e848[_0x11f03c]={'$like':'%'+_0x3422f0['query'][_0x2cac('0x47')]+'%'};return _0x99e848;})});}_0x1ddfe4=_[_0x2cac('0x50')]({},_0x1ddfe4,_0x3422f0[_0x2cac('0x49')]);return _0xa59677[_0x2cac('0x8a')](_0x1ddfe4);}})[_0x2cac('0x2b')](function(_0x28e400){if(_0x28e400){_0x3e2d8c=_0x28e400[_0x2cac('0x4f')];if(!_0x3422f0[_0x2cac('0x3b')][_0x2cac('0x40')](_0x2cac('0x41'))){_0x1ddfe4['limit']=qs[_0x2cac('0x25')](_0x3422f0[_0x2cac('0x3b')][_0x2cac('0x25')]);_0x1ddfe4['offset']=qs[_0x2cac('0x22')](_0x3422f0[_0x2cac('0x3b')][_0x2cac('0x22')]);}return _0xa59677[_0x2cac('0x8a')](_0x1ddfe4);}})[_0x2cac('0x2b')](function(_0x24e759){if(_0x24e759){return _0x24e759?{'count':_0x3e2d8c,'rows':_0x24e759}:null;}})[_0x2cac('0x2b')](respondWithResult(_0x5532e7,null))[_0x2cac('0x4c')](handleError(_0x5532e7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index ca65cb1..8c7bc6b 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 _0x969c=['emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0x969c,0x123));var _0xc969=function(_0x14acd7,_0x16541d){_0x14acd7=_0x14acd7-0x0;var _0x333a1f=_0x969c[_0x14acd7];return _0x333a1f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xc969('0x0'))['db'][_0xc969('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc969('0x2')](0x0);var events={'afterCreate':_0xc969('0x3'),'afterUpdate':'update','afterDestroy':_0xc969('0x4')};function emitEvent(_0x1c44dd){return function(_0x4c4d10,_0x3aaeda,_0x24b506){OpenchannelQueueEvents[_0xc969('0x5')](_0x1c44dd+':'+_0x4c4d10['id'],_0x4c4d10);OpenchannelQueueEvents[_0xc969('0x5')](_0x1c44dd,_0x4c4d10);_0x24b506(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xc969('0x6')](e,emitEvent(event));}}module[_0xc969('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x8ce8=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x8ce8,0xe8));var _0x88ce=function(_0x6751eb,_0x370b60){_0x6751eb=_0x6751eb-0x0;var _0x519e53=_0x8ce8[_0x6751eb];return _0x519e53;};'use strict';var EventEmitter=require(_0x88ce('0x0'));var OpenchannelQueue=require(_0x88ce('0x1'))['db'][_0x88ce('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x88ce('0x3')](0x0);var events={'afterCreate':_0x88ce('0x4'),'afterUpdate':_0x88ce('0x5'),'afterDestroy':_0x88ce('0x6')};function emitEvent(_0x4e39f9){return function(_0x125c5a,_0x3883f9,_0x1d766d){OpenchannelQueueEvents['emit'](_0x4e39f9+':'+_0x125c5a['id'],_0x125c5a);OpenchannelQueueEvents[_0x88ce('0x7')](_0x4e39f9,_0x125c5a);_0x1d766d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 08b43bf..0322fce 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 _0xa8c7=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa8c7,0x7a));var _0x7a8c=function(_0x59865e,_0x514a69){_0x59865e=_0x59865e-0x0;var _0x3b7228=_0xa8c7[_0x59865e];return _0x3b7228;};'use strict';var _=require(_0x7a8c('0x0'));var util=require(_0x7a8c('0x1'));var logger=require(_0x7a8c('0x2'))(_0x7a8c('0x3'));var moment=require(_0x7a8c('0x4'));var BPromise=require(_0x7a8c('0x5'));var rp=require(_0x7a8c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a8c('0x7'));var attributes=require(_0x7a8c('0x8'));module[_0x7a8c('0x9')]=function(_0x121085,_0x48836b){return _0x121085[_0x7a8c('0xa')](_0x7a8c('0xb'),attributes,{'tableName':_0x7a8c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x529f=['path','rimraf','./openchannelQueue.attributes','define','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x591d18,_0x349e93){var _0x43af67=function(_0x1eef5d){while(--_0x1eef5d){_0x591d18['push'](_0x591d18['shift']());}};_0x43af67(++_0x349e93);}(_0x529f,0x11d));var _0xf529=function(_0xa196d7,_0xee94a8){_0xa196d7=_0xa196d7-0x0;var _0x1f114c=_0x529f[_0xa196d7];return _0x1f114c;};'use strict';var _=require(_0xf529('0x0'));var util=require('util');var logger=require(_0xf529('0x1'))(_0xf529('0x2'));var moment=require(_0xf529('0x3'));var BPromise=require(_0xf529('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf529('0x5'));var rimraf=require(_0xf529('0x6'));var config=require('../../config/environment');var attributes=require(_0xf529('0x7'));module['exports']=function(_0x3640ea,_0xcd66dd){return _0x3640ea[_0xf529('0x8')]('OpenchannelQueue',attributes,{'tableName':_0xf529('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 1ad5ede..7c42e85 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 _0x269c=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','then','GetOpenchannelQueue','debug','stringify','ShowOpenchannelQueue','find','raw','where','lodash','util','randomstring'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x269c,0x1d1));var _0xc269=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x269c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc269('0x0'));var util=require(_0xc269('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc269('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc269('0x3'))['db'];var utils=require(_0xc269('0x4'));var logger=require('../../config/logger')(_0xc269('0x5'));var config=require(_0xc269('0x6'));var jayson=require(_0xc269('0x7'));var client=jayson[_0xc269('0x8')]['http']({'port':0x232a});config[_0xc269('0x9')]=_[_0xc269('0xa')](config[_0xc269('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc269('0xb'))(new Redis(config[_0xc269('0x9')]));require(_0xc269('0xc'))[_0xc269('0xd')](socket);function respondWithRpcPromise(_0x3dcf72,_0x3abacf,_0x3f1bfa){return new BPromise(function(_0x5cfaae,_0x470dee){return client['request'](_0x3dcf72,_0x3f1bfa)['then'](function(_0x3a6315){logger[_0xc269('0xe')](_0xc269('0xf'),_0x3abacf,_0xc269('0x10'));logger['debug'](_0xc269('0x11'),_0x3abacf,_0xc269('0x10'),JSON['stringify'](_0x3a6315));if(_0x3a6315[_0xc269('0x12')]){if(_0x3a6315[_0xc269('0x12')][_0xc269('0x13')]===0x1f4){logger[_0xc269('0x12')](_0xc269('0xf'),_0x3abacf,_0x3a6315[_0xc269('0x12')][_0xc269('0x14')]);return _0x470dee(_0x3a6315[_0xc269('0x12')]['message']);}logger[_0xc269('0x12')](_0xc269('0xf'),_0x3abacf,_0x3a6315[_0xc269('0x12')]['message']);return _0x5cfaae(_0x3a6315[_0xc269('0x12')]['message']);}else{logger['info'](_0xc269('0xf'),_0x3abacf,_0xc269('0x10'));_0x5cfaae(_0x3a6315[_0xc269('0x15')][_0xc269('0x14')]);}})[_0xc269('0x16')](function(_0x454ea0){logger[_0xc269('0x12')](_0xc269('0xf'),_0x3abacf,_0x454ea0);_0x470dee(_0x454ea0);});});}exports['GetOpenchannelQueue']=function(_0x5c2da5){var _0x4498f5=this;return new Promise(function(_0x1d2b1e,_0x465de3){return db[_0xc269('0x17')][_0xc269('0x18')]({'raw':_0x5c2da5[_0xc269('0x19')]?_0x5c2da5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c2da5['options']?_0x5c2da5['options']['where']||null:null,'attributes':_0x5c2da5[_0xc269('0x19')]?_0x5c2da5[_0xc269('0x19')][_0xc269('0x1a')]||null:null,'limit':_0x5c2da5[_0xc269('0x19')]?_0x5c2da5[_0xc269('0x19')][_0xc269('0x1b')]||null:null,'include':_0x5c2da5['options']?_0x5c2da5[_0xc269('0x19')][_0xc269('0x1c')]?_[_0xc269('0x1d')](_0x5c2da5[_0xc269('0x19')][_0xc269('0x1c')],function(_0x8bc575){return{'model':db[_0x8bc575[_0xc269('0x1e')]],'as':_0x8bc575['as'],'attributes':_0x8bc575[_0xc269('0x1a')],'include':_0x8bc575[_0xc269('0x1c')]?_[_0xc269('0x1d')](_0x8bc575[_0xc269('0x1c')],function(_0x67f80f){return{'model':db[_0x67f80f[_0xc269('0x1e')]],'as':_0x67f80f['as'],'attributes':_0x67f80f['attributes'],'include':_0x67f80f[_0xc269('0x1c')]?_['map'](_0x67f80f[_0xc269('0x1c')],function(_0x3921bd){return{'model':db[_0x3921bd[_0xc269('0x1e')]],'as':_0x3921bd['as'],'attributes':_0x3921bd[_0xc269('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc269('0x1f')](function(_0x5ba08e){logger['info'](_0xc269('0x20'),_0x5c2da5);logger[_0xc269('0x21')](_0xc269('0x20'),_0x5c2da5,JSON[_0xc269('0x22')](_0x5ba08e));_0x1d2b1e(_0x5ba08e);})[_0xc269('0x16')](function(_0x3c0764){logger['error'](_0xc269('0x20'),_0x3c0764[_0xc269('0x14')],_0x5c2da5);_0x465de3(_0x4498f5[_0xc269('0x12')](0x1f4,_0x3c0764[_0xc269('0x14')]));});});};exports[_0xc269('0x23')]=function(_0x4638b7){var _0x29537f=this;return new Promise(function(_0x23cc7f,_0x1cf834){return db['OpenchannelQueue'][_0xc269('0x24')]({'raw':_0x4638b7[_0xc269('0x19')]?_0x4638b7[_0xc269('0x19')][_0xc269('0x25')]===undefined?!![]:![]:!![],'where':_0x4638b7[_0xc269('0x19')]?_0x4638b7[_0xc269('0x19')][_0xc269('0x26')]||null:null,'attributes':_0x4638b7[_0xc269('0x19')]?_0x4638b7[_0xc269('0x19')][_0xc269('0x1a')]||null:null,'include':_0x4638b7[_0xc269('0x19')]?_0x4638b7[_0xc269('0x19')]['include']?_[_0xc269('0x1d')](_0x4638b7[_0xc269('0x19')][_0xc269('0x1c')],function(_0x330585){return{'model':db[_0x330585[_0xc269('0x1e')]],'as':_0x330585['as'],'attributes':_0x330585[_0xc269('0x1a')],'include':_0x330585[_0xc269('0x1c')]?_[_0xc269('0x1d')](_0x330585[_0xc269('0x1c')],function(_0x2aac3e){return{'model':db[_0x2aac3e['model']],'as':_0x2aac3e['as'],'attributes':_0x2aac3e[_0xc269('0x1a')],'include':_0x2aac3e[_0xc269('0x1c')]?_['map'](_0x2aac3e['include'],function(_0x2f90a7){return{'model':db[_0x2f90a7[_0xc269('0x1e')]],'as':_0x2f90a7['as'],'attributes':_0x2f90a7[_0xc269('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc269('0x1f')](function(_0x9d748f){logger[_0xc269('0xe')](_0xc269('0x23'),_0x4638b7);logger[_0xc269('0x21')](_0xc269('0x23'),_0x4638b7,JSON[_0xc269('0x22')](_0x9d748f));_0x23cc7f(_0x9d748f);})[_0xc269('0x16')](function(_0x5dc702){logger[_0xc269('0x12')](_0xc269('0x23'),_0x5dc702['message'],_0x4638b7);_0x1cf834(_0x29537f[_0xc269('0x12')](0x1f4,_0x5dc702[_0xc269('0x14')]));});});}; \ No newline at end of file +var _0xe151=['attributes','stringify','find','ShowOpenchannelQueue','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','error','code','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','limit','include','model','map'];(function(_0x122cb8,_0x5a43a7){var _0x37a329=function(_0x28de8d){while(--_0x28de8d){_0x122cb8['push'](_0x122cb8['shift']());}};_0x37a329(++_0x5a43a7);}(_0xe151,0x19c));var _0x1e15=function(_0x9861ff,_0x41fb17){_0x9861ff=_0x9861ff-0x0;var _0x48852b=_0xe151[_0x9861ff];return _0x48852b;};'use strict';var _=require('lodash');var util=require(_0x1e15('0x0'));var moment=require(_0x1e15('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e15('0x3'))['db'];var utils=require(_0x1e15('0x4'));var logger=require(_0x1e15('0x5'))(_0x1e15('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1e15('0x7')]['http']({'port':0x232a});config[_0x1e15('0x8')]=_[_0x1e15('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1e15('0xa'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x1e15('0xb')](socket);function respondWithRpcPromise(_0x5efbf1,_0x5998dc,_0x22f9ee){return new BPromise(function(_0x296917,_0xa33902){return client['request'](_0x5efbf1,_0x22f9ee)[_0x1e15('0xc')](function(_0x3c87ce){logger[_0x1e15('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x5998dc,_0x1e15('0xe'));logger[_0x1e15('0xf')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5998dc,_0x1e15('0xe'),JSON['stringify'](_0x3c87ce));if(_0x3c87ce['error']){if(_0x3c87ce[_0x1e15('0x10')][_0x1e15('0x11')]===0x1f4){logger[_0x1e15('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x5998dc,_0x3c87ce['error']['message']);return _0xa33902(_0x3c87ce[_0x1e15('0x10')][_0x1e15('0x12')]);}logger[_0x1e15('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x5998dc,_0x3c87ce['error'][_0x1e15('0x12')]);return _0x296917(_0x3c87ce['error'][_0x1e15('0x12')]);}else{logger[_0x1e15('0xd')](_0x1e15('0x13'),_0x5998dc,'request\x20sent');_0x296917(_0x3c87ce['result']['message']);}})[_0x1e15('0x14')](function(_0x2e53f){logger[_0x1e15('0x10')](_0x1e15('0x13'),_0x5998dc,_0x2e53f);_0xa33902(_0x2e53f);});});}exports[_0x1e15('0x15')]=function(_0x342f30){var _0x3bd937=this;return new Promise(function(_0x2d0c6e,_0x210c93){return db[_0x1e15('0x16')][_0x1e15('0x17')]({'raw':_0x342f30[_0x1e15('0x18')]?_0x342f30[_0x1e15('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x342f30[_0x1e15('0x18')]?_0x342f30[_0x1e15('0x18')][_0x1e15('0x19')]||null:null,'attributes':_0x342f30[_0x1e15('0x18')]?_0x342f30[_0x1e15('0x18')]['attributes']||null:null,'limit':_0x342f30[_0x1e15('0x18')]?_0x342f30[_0x1e15('0x18')][_0x1e15('0x1a')]||null:null,'include':_0x342f30[_0x1e15('0x18')]?_0x342f30[_0x1e15('0x18')][_0x1e15('0x1b')]?_['map'](_0x342f30[_0x1e15('0x18')][_0x1e15('0x1b')],function(_0x35ff71){return{'model':db[_0x35ff71[_0x1e15('0x1c')]],'as':_0x35ff71['as'],'attributes':_0x35ff71['attributes'],'include':_0x35ff71['include']?_[_0x1e15('0x1d')](_0x35ff71[_0x1e15('0x1b')],function(_0x2f01bc){return{'model':db[_0x2f01bc[_0x1e15('0x1c')]],'as':_0x2f01bc['as'],'attributes':_0x2f01bc[_0x1e15('0x1e')],'include':_0x2f01bc[_0x1e15('0x1b')]?_[_0x1e15('0x1d')](_0x2f01bc[_0x1e15('0x1b')],function(_0x1af0ef){return{'model':db[_0x1af0ef[_0x1e15('0x1c')]],'as':_0x1af0ef['as'],'attributes':_0x1af0ef[_0x1e15('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e15('0xc')](function(_0x37b384){logger['info']('GetOpenchannelQueue',_0x342f30);logger[_0x1e15('0xf')](_0x1e15('0x15'),_0x342f30,JSON[_0x1e15('0x1f')](_0x37b384));_0x2d0c6e(_0x37b384);})[_0x1e15('0x14')](function(_0xc0bcd5){logger[_0x1e15('0x10')](_0x1e15('0x15'),_0xc0bcd5[_0x1e15('0x12')],_0x342f30);_0x210c93(_0x3bd937[_0x1e15('0x10')](0x1f4,_0xc0bcd5[_0x1e15('0x12')]));});});};exports['ShowOpenchannelQueue']=function(_0x29b7be){var _0x42ab83=this;return new Promise(function(_0xd27a49,_0x4cf167){return db['OpenchannelQueue'][_0x1e15('0x20')]({'raw':_0x29b7be[_0x1e15('0x18')]?_0x29b7be[_0x1e15('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x29b7be[_0x1e15('0x18')]?_0x29b7be[_0x1e15('0x18')][_0x1e15('0x19')]||null:null,'attributes':_0x29b7be[_0x1e15('0x18')]?_0x29b7be['options'][_0x1e15('0x1e')]||null:null,'include':_0x29b7be[_0x1e15('0x18')]?_0x29b7be[_0x1e15('0x18')][_0x1e15('0x1b')]?_[_0x1e15('0x1d')](_0x29b7be[_0x1e15('0x18')][_0x1e15('0x1b')],function(_0x44501a){return{'model':db[_0x44501a[_0x1e15('0x1c')]],'as':_0x44501a['as'],'attributes':_0x44501a[_0x1e15('0x1e')],'include':_0x44501a['include']?_[_0x1e15('0x1d')](_0x44501a[_0x1e15('0x1b')],function(_0x4e5f6b){return{'model':db[_0x4e5f6b[_0x1e15('0x1c')]],'as':_0x4e5f6b['as'],'attributes':_0x4e5f6b[_0x1e15('0x1e')],'include':_0x4e5f6b[_0x1e15('0x1b')]?_[_0x1e15('0x1d')](_0x4e5f6b[_0x1e15('0x1b')],function(_0x32bb51){return{'model':db[_0x32bb51['model']],'as':_0x32bb51['as'],'attributes':_0x32bb51[_0x1e15('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ab8e){logger[_0x1e15('0xd')](_0x1e15('0x21'),_0x29b7be);logger[_0x1e15('0xf')](_0x1e15('0x21'),_0x29b7be,JSON[_0x1e15('0x1f')](_0x40ab8e));_0xd27a49(_0x40ab8e);})['catch'](function(_0x629e0c){logger[_0x1e15('0x10')](_0x1e15('0x21'),_0x629e0c[_0x1e15('0x12')],_0x29b7be);_0x4cf167(_0x42ab83['error'](0x1f4,_0x629e0c[_0x1e15('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cab432d..4d4441f 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 _0x562a=['removeListener','openchannelQueue:','./openchannelQueue.events','save','update'];(function(_0x109c9c,_0x34d7ac){var _0x2517d1=function(_0x4d6ecb){while(--_0x4d6ecb){_0x109c9c['push'](_0x109c9c['shift']());}};_0x2517d1(++_0x34d7ac);}(_0x562a,0x124));var _0xa562=function(_0x21dccf,_0x35f498){_0x21dccf=_0x21dccf-0x0;var _0x47e101=_0x562a[_0x21dccf];return _0x47e101;};'use strict';var OpenchannelQueueEvents=require(_0xa562('0x0'));var events=[_0xa562('0x1'),'remove',_0xa562('0x2')];function createListener(_0x1d7b92,_0x36c4b3){return function(_0x30bee0){_0x36c4b3['emit'](_0x1d7b92,_0x30bee0);};}function removeListener(_0x5cb232,_0x2a4879){return function(){OpenchannelQueueEvents[_0xa562('0x3')](_0x5cb232,_0x2a4879);};}exports['register']=function(_0x42d302){for(var _0x3a7618=0x0,_0x57865d=events['length'];_0x3a7618<_0x57865d;_0x3a7618++){var _0x1f5b0f=events[_0x3a7618];var _0x1cdace=createListener(_0xa562('0x4')+_0x1f5b0f,_0x42d302);OpenchannelQueueEvents['on'](_0x1f5b0f,_0x1cdace);}}; \ No newline at end of file +var _0xfb07=['remove','update','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x483109,_0x3003a9){var _0x56abe6=function(_0xe60370){while(--_0xe60370){_0x483109['push'](_0x483109['shift']());}};_0x56abe6(++_0x3003a9);}(_0xfb07,0x197));var _0x7fb0=function(_0x2b422c,_0x54e084){_0x2b422c=_0x2b422c-0x0;var _0x216e0b=_0xfb07[_0x2b422c];return _0x216e0b;};'use strict';var OpenchannelQueueEvents=require(_0x7fb0('0x0'));var events=['save',_0x7fb0('0x1'),_0x7fb0('0x2')];function createListener(_0x2bae98,_0x37547c){return function(_0x5954a7){_0x37547c['emit'](_0x2bae98,_0x5954a7);};}function removeListener(_0x421fcb,_0x46e9f8){return function(){OpenchannelQueueEvents[_0x7fb0('0x3')](_0x421fcb,_0x46e9f8);};}exports['register']=function(_0x3920a7){for(var _0x4975dd=0x0,_0xaf5fd1=events[_0x7fb0('0x4')];_0x4975dd<_0xaf5fd1;_0x4975dd++){var _0x2f8851=events[_0x4975dd];var _0x537337=createListener(_0x7fb0('0x5')+_0x2f8851,_0x3920a7);OpenchannelQueueEvents['on'](_0x2f8851,_0x537337);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ca0487e..e623bcf 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 _0xfc5f=['describe','/:id','show','create','put','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x4b82b4,_0x5a39c8){var _0x10179e=function(_0x241694){while(--_0x241694){_0x4b82b4['push'](_0x4b82b4['shift']());}};_0x10179e(++_0x5a39c8);}(_0xfc5f,0x1e7));var _0xffc5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xfc5f[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xffc5('0x0'));var util=require('util');var path=require(_0xffc5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xffc5('0x2')]();var fs_extra=require(_0xffc5('0x3'));var auth=require(_0xffc5('0x4'));var interaction=require(_0xffc5('0x5'));var config=require('../../config/environment');var controller=require(_0xffc5('0x6'));router[_0xffc5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xffc5('0x7')]('/describe',auth[_0xffc5('0x8')](),controller[_0xffc5('0x9')]);router[_0xffc5('0x7')](_0xffc5('0xa'),auth[_0xffc5('0x8')](),controller[_0xffc5('0xb')]);router['post']('/',auth[_0xffc5('0x8')](),controller[_0xffc5('0xc')]);router[_0xffc5('0xd')](_0xffc5('0xa'),auth[_0xffc5('0x8')](),controller['update']);router[_0xffc5('0xe')]('/:id',auth[_0xffc5('0x8')](),controller['destroy']);module[_0xffc5('0xf')]=router; \ No newline at end of file +var _0xc23d=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports'];(function(_0x166301,_0x5798af){var _0x492147=function(_0xe29040){while(--_0xe29040){_0x166301['push'](_0x166301['shift']());}};_0x492147(++_0x5798af);}(_0xc23d,0x118));var _0xdc23=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0xc23d[_0x9c3c56];return _0x2dd782;};'use strict';var multer=require('multer');var util=require(_0xdc23('0x0'));var path=require(_0xdc23('0x1'));var timeout=require(_0xdc23('0x2'));var express=require(_0xdc23('0x3'));var router=express[_0xdc23('0x4')]();var fs_extra=require(_0xdc23('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdc23('0x6'));var controller=require(_0xdc23('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdc23('0x8')]);router['get'](_0xdc23('0x9'),auth['isAuthenticated'](),controller[_0xdc23('0xa')]);router['get'](_0xdc23('0xb'),auth[_0xdc23('0xc')](),controller[_0xdc23('0xd')]);router[_0xdc23('0xe')]('/',auth[_0xdc23('0xc')](),controller['create']);router[_0xdc23('0xf')](_0xdc23('0xb'),auth[_0xdc23('0xc')](),controller[_0xdc23('0x10')]);router[_0xdc23('0x11')](_0xdc23('0xb'),auth['isAuthenticated'](),controller[_0xdc23('0x12')]);module[_0xdc23('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3fe892e..35edf66 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 _0x8cc2=['STRING','DATE'];(function(_0x141a02,_0x2bca52){var _0x1dc10f=function(_0x5e753c){while(--_0x5e753c){_0x141a02['push'](_0x141a02['shift']());}};_0x1dc10f(++_0x2bca52);}(_0x8cc2,0x148));var _0x28cc=function(_0x377060,_0x739652){_0x377060=_0x377060-0x0;var _0x50b71c=_0x8cc2[_0x377060];return _0x50b71c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x28cc('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x28cc('0x0')]},'joinAt':{'type':Sequelize[_0x28cc('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x28cc('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x28cc('0x0')]}}; \ No newline at end of file +var _0x8d88=['moment','sequelize','exports','STRING','DATE'];(function(_0x4c901c,_0x360625){var _0x5d1275=function(_0x31b967){while(--_0x31b967){_0x4c901c['push'](_0x4c901c['shift']());}};_0x5d1275(++_0x360625);}(_0x8d88,0x7d));var _0x88d8=function(_0x6c0833,_0x59e073){_0x6c0833=_0x6c0833-0x0;var _0x25d75b=_0x8d88[_0x6c0833];return _0x25d75b;};'use strict';var moment=require(_0x88d8('0x0'));var Sequelize=require(_0x88d8('0x1'));module[_0x88d8('0x2')]={'uniqueid':{'type':Sequelize[_0x88d8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x88d8('0x3')]},'joinAt':{'type':Sequelize[_0x88d8('0x4')]},'leaveAt':{'type':Sequelize[_0x88d8('0x4')]},'acceptAt':{'type':Sequelize[_0x88d8('0x4')]},'exitAt':{'type':Sequelize[_0x88d8('0x4')]},'reason':{'type':Sequelize[_0x88d8('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c71bb30..8c7b03d 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 _0x3eae=['key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../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','reject','save','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelQueueReport','fieldName'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x3eae,0x18e));var _0xe3ea=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x3eae[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3ea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ea('0x1'));var rp=require(_0xe3ea('0x2'));var moment=require(_0xe3ea('0x3'));var BPromise=require(_0xe3ea('0x4'));var Mustache=require('mustache');var util=require(_0xe3ea('0x5'));var path=require('path');var sox=require(_0xe3ea('0x6'));var csv=require(_0xe3ea('0x7'));var ejs=require(_0xe3ea('0x8'));var fs=require('fs');var fs_extra=require(_0xe3ea('0x9'));var _=require(_0xe3ea('0xa'));var squel=require(_0xe3ea('0xb'));var crypto=require(_0xe3ea('0xc'));var jsforce=require(_0xe3ea('0xd'));var deskjs=require(_0xe3ea('0xe'));var toCsv=require(_0xe3ea('0x7'));var querystring=require('querystring');var Papa=require(_0xe3ea('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe3ea('0x10'));var hardwareService=require(_0xe3ea('0x11'));var logger=require(_0xe3ea('0x12'))(_0xe3ea('0x13'));var utils=require(_0xe3ea('0x14'));var config=require(_0xe3ea('0x15'));var licenseUtil=require(_0xe3ea('0x16'));var db=require(_0xe3ea('0x17'))['db'];function respondWithStatusCode(_0x30485a,_0x494b7d){_0x494b7d=_0x494b7d||0xcc;return function(_0x2aace1){if(_0x2aace1){return _0x30485a['sendStatus'](_0x494b7d);}return _0x30485a[_0xe3ea('0x18')](_0x494b7d)[_0xe3ea('0x19')]();};}function respondWithResult(_0x20a997,_0x11d69e){_0x11d69e=_0x11d69e||0xc8;return function(_0x33868f){if(_0x33868f){return _0x20a997[_0xe3ea('0x18')](_0x11d69e)[_0xe3ea('0x1a')](_0x33868f);}};}function respondWithFilteredResult(_0xf39a23,_0x43cd55){return function(_0x3a038b){if(_0x3a038b){var _0x9af58=typeof _0x43cd55[_0xe3ea('0x1b')]===_0xe3ea('0x1c')&&typeof _0x43cd55['limit']==='undefined';var _0x424986=_0x3a038b[_0xe3ea('0x1d')];var _0x357c82=_0x9af58?0x0:_0x43cd55[_0xe3ea('0x1b')];var _0x31711e=_0x9af58?_0x3a038b['count']:_0x43cd55[_0xe3ea('0x1b')]+_0x43cd55[_0xe3ea('0x1e')];var _0x382207;if(_0x31711e>=_0x424986){_0x31711e=_0x424986;_0x382207=0xc8;}else{_0x382207=0xce;}_0xf39a23['status'](_0x382207);return _0xf39a23[_0xe3ea('0x1f')](_0xe3ea('0x20'),_0x357c82+'-'+_0x31711e+'/'+_0x424986)[_0xe3ea('0x1a')](_0x3a038b);}return null;};}function patchUpdates(_0x2c9a8e){return function(_0x56bb7c){try{jsonpatch[_0xe3ea('0x21')](_0x56bb7c,_0x2c9a8e,!![]);}catch(_0x54583e){return BPromise[_0xe3ea('0x22')](_0x54583e);}return _0x56bb7c[_0xe3ea('0x23')]();};}function saveUpdates(_0x1ecdf8,_0x39eeb0){return function(_0x181dbe){if(_0x181dbe){return _0x181dbe['update'](_0x1ecdf8)[_0xe3ea('0x24')](function(_0x30bc97){return _0x30bc97;});}return null;};}function removeEntity(_0x38b678,_0x4ff493){return function(_0x15ce01){if(_0x15ce01){return _0x15ce01[_0xe3ea('0x25')]()[_0xe3ea('0x24')](function(){_0x38b678['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x516bbf,_0x2cb158){return function(_0x30ec67){if(!_0x30ec67){_0x516bbf[_0xe3ea('0x26')](0x194);}return _0x30ec67;};}function handleError(_0x10ba6c,_0x387e90){_0x387e90=_0x387e90||0x1f4;return function(_0x5219fe){logger[_0xe3ea('0x27')](_0x5219fe[_0xe3ea('0x28')]);if(_0x5219fe[_0xe3ea('0x29')]){delete _0x5219fe[_0xe3ea('0x29')];}_0x10ba6c[_0xe3ea('0x18')](_0x387e90)[_0xe3ea('0x2a')](_0x5219fe);};}exports[_0xe3ea('0x2b')]=function(_0xb5a253,_0x425b72){var _0x2354fc={},_0xa8ed2e={},_0x242a71={'count':0x0,'rows':[]};var _0x449167=_['map'](db[_0xe3ea('0x2c')]['rawAttributes'],function(_0xc83e60){return{'name':_0xc83e60[_0xe3ea('0x2d')],'type':_0xc83e60['type'][_0xe3ea('0x2e')]};});_0xa8ed2e[_0xe3ea('0x2f')]=_['map'](_0x449167,'name');_0xa8ed2e['query']=_[_0xe3ea('0x30')](_0xb5a253[_0xe3ea('0x31')]);_0xa8ed2e[_0xe3ea('0x32')]=_[_0xe3ea('0x33')](_0xa8ed2e[_0xe3ea('0x2f')],_0xa8ed2e[_0xe3ea('0x31')]);_0x2354fc[_0xe3ea('0x34')]=_[_0xe3ea('0x33')](_0xa8ed2e[_0xe3ea('0x2f')],qs[_0xe3ea('0x35')](_0xb5a253[_0xe3ea('0x31')][_0xe3ea('0x35')]));_0x2354fc[_0xe3ea('0x34')]=_0x2354fc['attributes'][_0xe3ea('0x36')]?_0x2354fc[_0xe3ea('0x34')]:_0xa8ed2e[_0xe3ea('0x2f')];if(!_0xb5a253[_0xe3ea('0x31')]['hasOwnProperty'](_0xe3ea('0x37'))){_0x2354fc[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0xb5a253['query'][_0xe3ea('0x1e')]);_0x2354fc[_0xe3ea('0x1b')]=qs[_0xe3ea('0x1b')](_0xb5a253[_0xe3ea('0x31')]['offset']);}_0x2354fc['order']=qs[_0xe3ea('0x38')](_0xb5a253[_0xe3ea('0x31')]['sort']);_0x2354fc[_0xe3ea('0x39')]=qs[_0xe3ea('0x32')](_['pick'](_0xb5a253[_0xe3ea('0x31')],_0xa8ed2e[_0xe3ea('0x32')]),_0x449167);if(_0xb5a253['query'][_0xe3ea('0x3a')]){_0x2354fc[_0xe3ea('0x39')]=_['merge'](_0x2354fc[_0xe3ea('0x39')],{'$or':_['map'](_0x449167,function(_0x537ec2){if(_0x537ec2[_0xe3ea('0x3b')]!==_0xe3ea('0x3c')){var _0x4ca5ca={};_0x4ca5ca[_0x537ec2[_0xe3ea('0x29')]]={'$like':'%'+_0xb5a253[_0xe3ea('0x31')]['filter']+'%'};return _0x4ca5ca;}})});}_0x2354fc=_[_0xe3ea('0x3d')]({},_0x2354fc,_0xb5a253[_0xe3ea('0x3e')]);var _0x4d5ff3={'where':_0x2354fc[_0xe3ea('0x39')]};return db[_0xe3ea('0x2c')][_0xe3ea('0x1d')](_0x4d5ff3)[_0xe3ea('0x24')](function(_0x4c6d76){_0x242a71['count']=_0x4c6d76;if(_0xb5a253[_0xe3ea('0x31')][_0xe3ea('0x3f')]){_0x2354fc[_0xe3ea('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x2354fc);})[_0xe3ea('0x24')](function(_0x5ab834){_0x242a71[_0xe3ea('0x41')]=_0x5ab834;return _0x242a71;})[_0xe3ea('0x24')](respondWithFilteredResult(_0x425b72,_0x2354fc))[_0xe3ea('0x42')](handleError(_0x425b72,null));};exports[_0xe3ea('0x43')]=function(_0x125b21,_0x589d38){var _0x5e6763={'raw':!![],'where':{'id':_0x125b21[_0xe3ea('0x44')]['id']}},_0x256c5c={};_0x256c5c[_0xe3ea('0x2f')]=_[_0xe3ea('0x30')](db[_0xe3ea('0x2c')][_0xe3ea('0x45')]);_0x256c5c[_0xe3ea('0x31')]=_[_0xe3ea('0x30')](_0x125b21['query']);_0x256c5c[_0xe3ea('0x32')]=_[_0xe3ea('0x33')](_0x256c5c['model'],_0x256c5c['query']);_0x5e6763[_0xe3ea('0x34')]=_[_0xe3ea('0x33')](_0x256c5c[_0xe3ea('0x2f')],qs[_0xe3ea('0x35')](_0x125b21[_0xe3ea('0x31')][_0xe3ea('0x35')]));_0x5e6763[_0xe3ea('0x34')]=_0x5e6763[_0xe3ea('0x34')][_0xe3ea('0x36')]?_0x5e6763['attributes']:_0x256c5c[_0xe3ea('0x2f')];if(_0x125b21[_0xe3ea('0x31')][_0xe3ea('0x3f')]){_0x5e6763[_0xe3ea('0x40')]=[{'all':!![]}];}_0x5e6763=_[_0xe3ea('0x3d')]({},_0x5e6763,_0x125b21[_0xe3ea('0x3e')]);return db[_0xe3ea('0x2c')][_0xe3ea('0x46')](_0x5e6763)[_0xe3ea('0x24')](handleEntityNotFound(_0x589d38,null))[_0xe3ea('0x24')](respondWithResult(_0x589d38,null))[_0xe3ea('0x42')](handleError(_0x589d38,null));};exports[_0xe3ea('0x47')]=function(_0x47b6be,_0x2ae003){return db[_0xe3ea('0x2c')][_0xe3ea('0x47')](_0x47b6be[_0xe3ea('0x48')],{})[_0xe3ea('0x24')](respondWithResult(_0x2ae003,0xc9))['catch'](handleError(_0x2ae003,null));};exports['update']=function(_0x34eee9,_0x161378){if(_0x34eee9[_0xe3ea('0x48')]['id']){delete _0x34eee9[_0xe3ea('0x48')]['id'];}return db['OpenchannelQueueReport'][_0xe3ea('0x46')]({'where':{'id':_0x34eee9['params']['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x161378,null))[_0xe3ea('0x24')](saveUpdates(_0x34eee9[_0xe3ea('0x48')],null))[_0xe3ea('0x24')](respondWithResult(_0x161378,null))[_0xe3ea('0x42')](handleError(_0x161378,null));};exports['destroy']=function(_0x78a252,_0x3e67c2){return db[_0xe3ea('0x2c')][_0xe3ea('0x46')]({'where':{'id':_0x78a252[_0xe3ea('0x44')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x3e67c2,null))[_0xe3ea('0x24')](removeEntity(_0x3e67c2,null))['catch'](handleError(_0x3e67c2,null));};exports[_0xe3ea('0x49')]=function(_0x7f9d2d,_0xfa8e13){return db[_0xe3ea('0x2c')][_0xe3ea('0x49')]()[_0xe3ea('0x24')](respondWithResult(_0xfa8e13,null))['catch'](handleError(_0xfa8e13,null));}; \ No newline at end of file +var _0xc7a7=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','then','error','name','send','index','map','OpenchannelQueueReport','fieldName','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2a2cfd,_0x274d1e){var _0x18c062=function(_0x22a4c0){while(--_0x22a4c0){_0x2a2cfd['push'](_0x2a2cfd['shift']());}};_0x18c062(++_0x274d1e);}(_0xc7a7,0x82));var _0x7c7a=function(_0x3fe1e3,_0x45d70b){_0x3fe1e3=_0x3fe1e3-0x0;var _0x7405c3=_0xc7a7[_0x3fe1e3];return _0x7405c3;};'use strict';var emlformat=require(_0x7c7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c7a('0x1'));var jsonpatch=require(_0x7c7a('0x2'));var rp=require('request-promise');var moment=require(_0x7c7a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c7a('0x4'));var util=require(_0x7c7a('0x5'));var path=require(_0x7c7a('0x6'));var sox=require(_0x7c7a('0x7'));var csv=require(_0x7c7a('0x8'));var ejs=require(_0x7c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x7c7a('0xa'));var _=require(_0x7c7a('0xb'));var squel=require(_0x7c7a('0xc'));var crypto=require(_0x7c7a('0xd'));var jsforce=require(_0x7c7a('0xe'));var deskjs=require(_0x7c7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7c7a('0x10'));var Papa=require(_0x7c7a('0x11'));var Redis=require('ioredis');var authService=require(_0x7c7a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7c7a('0x13'));var hardwareService=require(_0x7c7a('0x14'));var logger=require('../../config/logger')(_0x7c7a('0x15'));var utils=require('../../config/utils');var config=require(_0x7c7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c7a('0x17'))['db'];function respondWithStatusCode(_0x1fa7b7,_0x26690b){_0x26690b=_0x26690b||0xcc;return function(_0x47bc2f){if(_0x47bc2f){return _0x1fa7b7[_0x7c7a('0x18')](_0x26690b);}return _0x1fa7b7['status'](_0x26690b)[_0x7c7a('0x19')]();};}function respondWithResult(_0x377253,_0x179a92){_0x179a92=_0x179a92||0xc8;return function(_0x3b4d03){if(_0x3b4d03){return _0x377253[_0x7c7a('0x1a')](_0x179a92)[_0x7c7a('0x1b')](_0x3b4d03);}};}function respondWithFilteredResult(_0x136de6,_0x5d5edc){return function(_0x219e52){if(_0x219e52){var _0x14b33c=typeof _0x5d5edc[_0x7c7a('0x1c')]===_0x7c7a('0x1d')&&typeof _0x5d5edc['limit']==='undefined';var _0x59c685=_0x219e52[_0x7c7a('0x1e')];var _0x40d05e=_0x14b33c?0x0:_0x5d5edc[_0x7c7a('0x1c')];var _0x3074f8=_0x14b33c?_0x219e52[_0x7c7a('0x1e')]:_0x5d5edc[_0x7c7a('0x1c')]+_0x5d5edc['limit'];var _0x19af10;if(_0x3074f8>=_0x59c685){_0x3074f8=_0x59c685;_0x19af10=0xc8;}else{_0x19af10=0xce;}_0x136de6[_0x7c7a('0x1a')](_0x19af10);return _0x136de6[_0x7c7a('0x1f')](_0x7c7a('0x20'),_0x40d05e+'-'+_0x3074f8+'/'+_0x59c685)[_0x7c7a('0x1b')](_0x219e52);}return null;};}function patchUpdates(_0x43fb6f){return function(_0x50483d){try{jsonpatch[_0x7c7a('0x21')](_0x50483d,_0x43fb6f,!![]);}catch(_0x449fc8){return BPromise['reject'](_0x449fc8);}return _0x50483d[_0x7c7a('0x22')]();};}function saveUpdates(_0x2f02b7,_0x557d9f){return function(_0x392f44){if(_0x392f44){return _0x392f44['update'](_0x2f02b7)['then'](function(_0x483f38){return _0x483f38;});}return null;};}function removeEntity(_0x129d63,_0x422a65){return function(_0x1b6c34){if(_0x1b6c34){return _0x1b6c34['destroy']()[_0x7c7a('0x23')](function(){_0x129d63[_0x7c7a('0x1a')](0xcc)[_0x7c7a('0x19')]();});}};}function handleEntityNotFound(_0x59c523,_0x58575a){return function(_0x43a89f){if(!_0x43a89f){_0x59c523[_0x7c7a('0x18')](0x194);}return _0x43a89f;};}function handleError(_0xee8f81,_0x44022c){_0x44022c=_0x44022c||0x1f4;return function(_0x24c755){logger[_0x7c7a('0x24')](_0x24c755['stack']);if(_0x24c755[_0x7c7a('0x25')]){delete _0x24c755['name'];}_0xee8f81[_0x7c7a('0x1a')](_0x44022c)[_0x7c7a('0x26')](_0x24c755);};}exports[_0x7c7a('0x27')]=function(_0x4eb141,_0x471aff){var _0x177a16={},_0x3ac787={},_0x42cfcc={'count':0x0,'rows':[]};var _0x5685b2=_[_0x7c7a('0x28')](db[_0x7c7a('0x29')]['rawAttributes'],function(_0xb31039){return{'name':_0xb31039[_0x7c7a('0x2a')],'type':_0xb31039['type']['key']};});_0x3ac787['model']=_[_0x7c7a('0x28')](_0x5685b2,_0x7c7a('0x25'));_0x3ac787[_0x7c7a('0x2b')]=_[_0x7c7a('0x2c')](_0x4eb141[_0x7c7a('0x2b')]);_0x3ac787['filters']=_['intersection'](_0x3ac787['model'],_0x3ac787[_0x7c7a('0x2b')]);_0x177a16[_0x7c7a('0x2d')]=_[_0x7c7a('0x2e')](_0x3ac787[_0x7c7a('0x2f')],qs[_0x7c7a('0x30')](_0x4eb141[_0x7c7a('0x2b')][_0x7c7a('0x30')]));_0x177a16[_0x7c7a('0x2d')]=_0x177a16['attributes']['length']?_0x177a16[_0x7c7a('0x2d')]:_0x3ac787['model'];if(!_0x4eb141[_0x7c7a('0x2b')][_0x7c7a('0x31')](_0x7c7a('0x32'))){_0x177a16[_0x7c7a('0x33')]=qs[_0x7c7a('0x33')](_0x4eb141[_0x7c7a('0x2b')][_0x7c7a('0x33')]);_0x177a16[_0x7c7a('0x1c')]=qs[_0x7c7a('0x1c')](_0x4eb141[_0x7c7a('0x2b')]['offset']);}_0x177a16['order']=qs[_0x7c7a('0x34')](_0x4eb141[_0x7c7a('0x2b')][_0x7c7a('0x34')]);_0x177a16[_0x7c7a('0x35')]=qs['filters'](_[_0x7c7a('0x36')](_0x4eb141[_0x7c7a('0x2b')],_0x3ac787[_0x7c7a('0x37')]),_0x5685b2);if(_0x4eb141['query'][_0x7c7a('0x38')]){_0x177a16[_0x7c7a('0x35')]=_['merge'](_0x177a16['where'],{'$or':_[_0x7c7a('0x28')](_0x5685b2,function(_0x2a62c5){if(_0x2a62c5['type']!==_0x7c7a('0x39')){var _0x373714={};_0x373714[_0x2a62c5[_0x7c7a('0x25')]]={'$like':'%'+_0x4eb141[_0x7c7a('0x2b')]['filter']+'%'};return _0x373714;}})});}_0x177a16=_[_0x7c7a('0x3a')]({},_0x177a16,_0x4eb141[_0x7c7a('0x3b')]);var _0x38ac38={'where':_0x177a16[_0x7c7a('0x35')]};return db[_0x7c7a('0x29')][_0x7c7a('0x1e')](_0x38ac38)[_0x7c7a('0x23')](function(_0x1f470e){_0x42cfcc[_0x7c7a('0x1e')]=_0x1f470e;if(_0x4eb141[_0x7c7a('0x2b')]['includeAll']){_0x177a16[_0x7c7a('0x3c')]=[{'all':!![]}];}return db[_0x7c7a('0x29')]['findAll'](_0x177a16);})[_0x7c7a('0x23')](function(_0x4a4fe6){_0x42cfcc[_0x7c7a('0x3d')]=_0x4a4fe6;return _0x42cfcc;})[_0x7c7a('0x23')](respondWithFilteredResult(_0x471aff,_0x177a16))[_0x7c7a('0x3e')](handleError(_0x471aff,null));};exports[_0x7c7a('0x3f')]=function(_0x53152c,_0xf00695){var _0x42d9df={'raw':!![],'where':{'id':_0x53152c[_0x7c7a('0x40')]['id']}},_0x2f21a3={};_0x2f21a3['model']=_[_0x7c7a('0x2c')](db[_0x7c7a('0x29')][_0x7c7a('0x41')]);_0x2f21a3[_0x7c7a('0x2b')]=_[_0x7c7a('0x2c')](_0x53152c[_0x7c7a('0x2b')]);_0x2f21a3[_0x7c7a('0x37')]=_[_0x7c7a('0x2e')](_0x2f21a3[_0x7c7a('0x2f')],_0x2f21a3[_0x7c7a('0x2b')]);_0x42d9df['attributes']=_['intersection'](_0x2f21a3[_0x7c7a('0x2f')],qs[_0x7c7a('0x30')](_0x53152c[_0x7c7a('0x2b')][_0x7c7a('0x30')]));_0x42d9df['attributes']=_0x42d9df['attributes'][_0x7c7a('0x42')]?_0x42d9df[_0x7c7a('0x2d')]:_0x2f21a3[_0x7c7a('0x2f')];if(_0x53152c[_0x7c7a('0x2b')]['includeAll']){_0x42d9df[_0x7c7a('0x3c')]=[{'all':!![]}];}_0x42d9df=_['merge']({},_0x42d9df,_0x53152c[_0x7c7a('0x3b')]);return db['OpenchannelQueueReport'][_0x7c7a('0x43')](_0x42d9df)[_0x7c7a('0x23')](handleEntityNotFound(_0xf00695,null))['then'](respondWithResult(_0xf00695,null))['catch'](handleError(_0xf00695,null));};exports[_0x7c7a('0x44')]=function(_0x2ef73a,_0x47992a){return db['OpenchannelQueueReport'][_0x7c7a('0x44')](_0x2ef73a[_0x7c7a('0x45')],{})['then'](respondWithResult(_0x47992a,0xc9))[_0x7c7a('0x3e')](handleError(_0x47992a,null));};exports['update']=function(_0x503ee1,_0x1206b9){if(_0x503ee1['body']['id']){delete _0x503ee1[_0x7c7a('0x45')]['id'];}return db[_0x7c7a('0x29')]['find']({'where':{'id':_0x503ee1[_0x7c7a('0x40')]['id']}})[_0x7c7a('0x23')](handleEntityNotFound(_0x1206b9,null))[_0x7c7a('0x23')](saveUpdates(_0x503ee1[_0x7c7a('0x45')],null))['then'](respondWithResult(_0x1206b9,null))[_0x7c7a('0x3e')](handleError(_0x1206b9,null));};exports[_0x7c7a('0x46')]=function(_0x203eea,_0x91dae){return db['OpenchannelQueueReport'][_0x7c7a('0x43')]({'where':{'id':_0x203eea[_0x7c7a('0x40')]['id']}})[_0x7c7a('0x23')](handleEntityNotFound(_0x91dae,null))['then'](removeEntity(_0x91dae,null))[_0x7c7a('0x3e')](handleError(_0x91dae,null));};exports[_0x7c7a('0x47')]=function(_0x2a2ae3,_0x763092){return db[_0x7c7a('0x29')]['describe']()[_0x7c7a('0x23')](respondWithResult(_0x763092,null))[_0x7c7a('0x3e')](handleError(_0x763092,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 1a22082..6409a27 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0xfe1a95,_0x4e0e82){var _0x490260=function(_0x3bbb3d){while(--_0x3bbb3d){_0xfe1a95['push'](_0xfe1a95['shift']());}};_0x490260(++_0x4e0e82);}(_0x326f,0xd1));var _0xf326=function(_0x52f306,_0x29232c){_0x52f306=_0x52f306-0x0;var _0x391d34=_0x326f[_0x52f306];return _0x391d34;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x4c5caa,_0x2cb2d7){var _0x16a784=function(_0x86e67a){while(--_0x86e67a){_0x4c5caa['push'](_0x4c5caa['shift']());}};_0x16a784(++_0x2cb2d7);}(_0x7a54,0x106));var _0x47a5=function(_0x3019df,_0x540987){_0x3019df=_0x3019df-0x0;var _0x14f545=_0x7a54[_0x3019df];return _0x14f545;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f4a1b08..d858e30 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 _0xf108=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body'];(function(_0x481a77,_0x48d439){var _0x52c093=function(_0x462323){while(--_0x462323){_0x481a77['push'](_0x481a77['shift']());}};_0x52c093(++_0x48d439);}(_0xf108,0x1d9));var _0x8f10=function(_0x17d56f,_0x5cc1d4){_0x17d56f=_0x17d56f-0x0;var _0x530f06=_0xf108[_0x17d56f];return _0x530f06;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});}exports['CreateOpenchannelQueueReport']=function(_0xdfd335){var _0x468bf3=this;return new Promise(function(_0x255e75,_0x3003ea){return db['OpenchannelQueueReport']['create'](_0xdfd335[_0x8f10('0x16')],{'raw':_0xdfd335[_0x8f10('0x17')]?_0xdfd335[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![]})[_0x8f10('0xa')](function(_0xfdb66e){logger[_0x8f10('0xb')](_0x8f10('0x19'),_0xdfd335);logger[_0x8f10('0xe')](_0x8f10('0x19'),_0xdfd335,JSON[_0x8f10('0x10')](_0xfdb66e));_0x255e75(_0xfdb66e);})['catch'](function(_0x2550e1){logger['error']('CreateOpenchannelQueueReport',_0x2550e1['message'],_0xdfd335);_0x3003ea(_0x468bf3[_0x8f10('0x11')](0x1f4,_0x2550e1['message']));});});};exports[_0x8f10('0x1a')]=function(_0xdaa7dd){var _0x2cbbf4=this;return new Promise(function(_0x39178d,_0x419cd7){return db[_0x8f10('0x1b')][_0x8f10('0x1c')](_0xdaa7dd[_0x8f10('0x16')],{'raw':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1d')]||null:null,'attributes':_0xdaa7dd['options']?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1e')]||null:null,'limit':_0xdaa7dd['options']?_0xdaa7dd['options']['limit']||null:null})[_0x8f10('0xa')](function(_0x11db52){logger[_0x8f10('0xb')](_0x8f10('0x1a'),_0xdaa7dd);logger[_0x8f10('0xe')]('UpdateOpenchannelQueueReport',_0xdaa7dd,JSON[_0x8f10('0x10')](_0x11db52));_0x39178d(_0x11db52);})['catch'](function(_0x2f1ee1){logger[_0x8f10('0x11')](_0x8f10('0x1a'),_0x2f1ee1['message'],_0xdaa7dd);_0x419cd7(_0x2cbbf4[_0x8f10('0x11')](0x1f4,_0x2f1ee1['message']));});});}; \ No newline at end of file +var _0x777d=['CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','UpdateOpenchannelQueueReport','body','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x491051,_0x41e03a){var _0x100277=function(_0x54e7f0){while(--_0x54e7f0){_0x491051['push'](_0x491051['shift']());}};_0x100277(++_0x41e03a);}(_0x777d,0xe9));var _0xd777=function(_0x10d341,_0x57ff35){_0x10d341=_0x10d341-0x0;var _0xddc36d=_0x777d[_0x10d341];return _0xddc36d;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});}exports[_0xd777('0x13')]=function(_0x386f1a){var _0x2dd8ec=this;return new Promise(function(_0x13b63b,_0x2c6114){return db[_0xd777('0x14')]['create'](_0x386f1a['body'],{'raw':_0x386f1a[_0xd777('0x15')]?_0x386f1a['options'][_0xd777('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x58a079){logger['info'](_0xd777('0x13'),_0x386f1a);logger['debug']('CreateOpenchannelQueueReport',_0x386f1a,JSON['stringify'](_0x58a079));_0x13b63b(_0x58a079);})['catch'](function(_0x55b975){logger[_0xd777('0xf')](_0xd777('0x13'),_0x55b975[_0xd777('0x10')],_0x386f1a);_0x2c6114(_0x2dd8ec[_0xd777('0xf')](0x1f4,_0x55b975[_0xd777('0x10')]));});});};exports[_0xd777('0x17')]=function(_0x2ff8d3){var _0x87b828=this;return new Promise(function(_0x188a3a,_0x3e637a){return db[_0xd777('0x14')]['update'](_0x2ff8d3[_0xd777('0x18')],{'raw':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3['options'][_0xd777('0x19')]||null:null,'attributes':_0x2ff8d3['options']?_0x2ff8d3['options'][_0xd777('0x1a')]||null:null,'limit':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x1b')]||null:null})['then'](function(_0x453b45){logger[_0xd777('0x9')](_0xd777('0x17'),_0x2ff8d3);logger[_0xd777('0xc')](_0xd777('0x17'),_0x2ff8d3,JSON[_0xd777('0xe')](_0x453b45));_0x188a3a(_0x453b45);})[_0xd777('0x12')](function(_0x3ebb94){logger['error'](_0xd777('0x17'),_0x3ebb94['message'],_0x2ff8d3);_0x3e637a(_0x87b828['error'](0x1f4,_0x3ebb94[_0xd777('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 33a1217..c17576f 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 _0x9a33=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1b09f5,_0x52d403){var _0x3974bf=function(_0x24bb98){while(--_0x24bb98){_0x1b09f5['push'](_0x1b09f5['shift']());}};_0x3974bf(++_0x52d403);}(_0x9a33,0x8d));var _0x39a3=function(_0x44ed28,_0xe6ea1d){_0x44ed28=_0x44ed28-0x0;var _0x3090ad=_0x9a33[_0x44ed28];return _0x3090ad;};'use strict';var multer=require(_0x39a3('0x0'));var util=require(_0x39a3('0x1'));var path=require('path');var timeout=require(_0x39a3('0x2'));var express=require('express');var router=express[_0x39a3('0x3')]();var fs_extra=require(_0x39a3('0x4'));var auth=require(_0x39a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x39a3('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x39a3('0x7')]('/',auth[_0x39a3('0x8')](),controller['index']);router['get'](_0x39a3('0x9'),auth[_0x39a3('0x8')](),controller[_0x39a3('0xa')]);router[_0x39a3('0x7')](_0x39a3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x39a3('0xc')]('/',auth[_0x39a3('0x8')](),controller[_0x39a3('0xd')]);router[_0x39a3('0xe')]('/:id',auth[_0x39a3('0x8')](),controller['update']);router[_0x39a3('0xf')](_0x39a3('0xb'),auth[_0x39a3('0x8')](),controller[_0x39a3('0x10')]);module[_0x39a3('0x11')]=router; \ No newline at end of file +var _0x352b=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','update','/:id','multer'];(function(_0x1467e3,_0x28c46b){var _0x4d26ab=function(_0x163fae){while(--_0x163fae){_0x1467e3['push'](_0x1467e3['shift']());}};_0x4d26ab(++_0x28c46b);}(_0x352b,0x1f3));var _0xb352=function(_0x2d3e84,_0x24e09a){_0x2d3e84=_0x2d3e84-0x0;var _0x104438=_0x352b[_0x2d3e84];return _0x104438;};'use strict';var multer=require(_0xb352('0x0'));var util=require(_0xb352('0x1'));var path=require(_0xb352('0x2'));var timeout=require('connect-timeout');var express=require(_0xb352('0x3'));var router=express[_0xb352('0x4')]();var fs_extra=require(_0xb352('0x5'));var auth=require(_0xb352('0x6'));var interaction=require(_0xb352('0x7'));var config=require(_0xb352('0x8'));var controller=require(_0xb352('0x9'));router[_0xb352('0xa')]('/',auth[_0xb352('0xb')](),controller[_0xb352('0xc')]);router[_0xb352('0xa')](_0xb352('0xd'),auth[_0xb352('0xb')](),controller[_0xb352('0xe')]);router[_0xb352('0xa')]('/:id',auth[_0xb352('0xb')](),controller['show']);router[_0xb352('0xf')]('/',auth[_0xb352('0xb')](),controller[_0xb352('0x10')]);router[_0xb352('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb352('0x12')]);router['delete'](_0xb352('0x13'),auth[_0xb352('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8af8631..10420d0 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x14a554,_0x58bcbd){var _0x1dd100=function(_0x30074e){while(--_0x30074e){_0x14a554['push'](_0x14a554['shift']());}};_0x1dd100(++_0x58bcbd);}(_0x70e0,0x17b));var _0x070e=function(_0x4f0d37,_0x562de6){_0x4f0d37=_0x4f0d37-0x0;var _0x57d71f=_0x70e0[_0x4f0d37];return _0x57d71f;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x5a905e,_0x31aa4a){var _0x4124d6=function(_0x37c28a){while(--_0x37c28a){_0x5a905e['push'](_0x5a905e['shift']());}};_0x4124d6(++_0x31aa4a);}(_0x34e8,0x12c));var _0x834e=function(_0x512151,_0x418f43){_0x512151=_0x512151-0x0;var _0x42334a=_0x34e8[_0x512151];return _0x42334a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 63ab0d4..a72a110 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 _0x6f4e=['request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x59f1e6,_0xda13c5){var _0x2aada5=function(_0x5bf12c){while(--_0x5bf12c){_0x59f1e6['push'](_0x59f1e6['shift']());}};_0x2aada5(++_0xda13c5);}(_0x6f4e,0x120));var _0xe6f4=function(_0x3573f9,_0x9b0b75){_0x3573f9=_0x3573f9-0x0;var _0x16e2c4=_0x6f4e[_0x3573f9];return _0x16e2c4;};'use strict';var emlformat=require(_0xe6f4('0x0'));var rimraf=require(_0xe6f4('0x1'));var zipdir=require(_0xe6f4('0x2'));var jsonpatch=require(_0xe6f4('0x3'));var rp=require(_0xe6f4('0x4'));var moment=require(_0xe6f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe6f4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe6f4('0x7'));var csv=require(_0xe6f4('0x8'));var ejs=require(_0xe6f4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6f4('0xa'));var squel=require(_0xe6f4('0xb'));var crypto=require(_0xe6f4('0xc'));var jsforce=require(_0xe6f4('0xd'));var deskjs=require(_0xe6f4('0xe'));var toCsv=require(_0xe6f4('0x8'));var querystring=require(_0xe6f4('0xf'));var Papa=require('papaparse');var Redis=require(_0xe6f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe6f4('0x11'));var as=require(_0xe6f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6f4('0x13'))(_0xe6f4('0x14'));var utils=require(_0xe6f4('0x15'));var config=require(_0xe6f4('0x16'));var licenseUtil=require(_0xe6f4('0x17'));var db=require(_0xe6f4('0x18'))['db'];function respondWithStatusCode(_0x4d78fc,_0x25e22f){_0x25e22f=_0x25e22f||0xcc;return function(_0x58312d){if(_0x58312d){return _0x4d78fc[_0xe6f4('0x19')](_0x25e22f);}return _0x4d78fc[_0xe6f4('0x1a')](_0x25e22f)[_0xe6f4('0x1b')]();};}function respondWithResult(_0x52a095,_0x3d3bb3){_0x3d3bb3=_0x3d3bb3||0xc8;return function(_0x4159a1){if(_0x4159a1){return _0x52a095[_0xe6f4('0x1a')](_0x3d3bb3)[_0xe6f4('0x1c')](_0x4159a1);}};}function respondWithFilteredResult(_0x1915bf,_0x5ddc1a){return function(_0x1095f8){if(_0x1095f8){var _0x5a93d9=typeof _0x5ddc1a[_0xe6f4('0x1d')]===_0xe6f4('0x1e')&&typeof _0x5ddc1a[_0xe6f4('0x1f')]==='undefined';var _0x5cc6c3=_0x1095f8[_0xe6f4('0x20')];var _0x49d089=_0x5a93d9?0x0:_0x5ddc1a[_0xe6f4('0x1d')];var _0x13a6d5=_0x5a93d9?_0x1095f8[_0xe6f4('0x20')]:_0x5ddc1a['offset']+_0x5ddc1a['limit'];var _0x3eb224;if(_0x13a6d5>=_0x5cc6c3){_0x13a6d5=_0x5cc6c3;_0x3eb224=0xc8;}else{_0x3eb224=0xce;}_0x1915bf[_0xe6f4('0x1a')](_0x3eb224);return _0x1915bf['set'](_0xe6f4('0x21'),_0x49d089+'-'+_0x13a6d5+'/'+_0x5cc6c3)[_0xe6f4('0x1c')](_0x1095f8);}return null;};}function patchUpdates(_0x2c9632){return function(_0x477509){try{jsonpatch[_0xe6f4('0x22')](_0x477509,_0x2c9632,!![]);}catch(_0x42522b){return BPromise[_0xe6f4('0x23')](_0x42522b);}return _0x477509[_0xe6f4('0x24')]();};}function saveUpdates(_0x267332,_0x507144){return function(_0xc6fe53){if(_0xc6fe53){return _0xc6fe53[_0xe6f4('0x25')](_0x267332)[_0xe6f4('0x26')](function(_0x559550){return _0x559550;});}return null;};}function removeEntity(_0x39cce4,_0x14d825){return function(_0x307117){if(_0x307117){return _0x307117[_0xe6f4('0x27')]()[_0xe6f4('0x26')](function(){_0x39cce4['status'](0xcc)[_0xe6f4('0x1b')]();});}};}function handleEntityNotFound(_0x4fb44e,_0x48f68d){return function(_0x573ad3){if(!_0x573ad3){_0x4fb44e['sendStatus'](0x194);}return _0x573ad3;};}function handleError(_0x575c78,_0x412300){_0x412300=_0x412300||0x1f4;return function(_0x5ad9f5){logger['error'](_0x5ad9f5[_0xe6f4('0x28')]);if(_0x5ad9f5[_0xe6f4('0x29')]){delete _0x5ad9f5[_0xe6f4('0x29')];}_0x575c78['status'](_0x412300)[_0xe6f4('0x2a')](_0x5ad9f5);};}exports[_0xe6f4('0x2b')]=function(_0x59a1b0,_0x4e9962){var _0x18ec76={},_0x237092={},_0x56711b={'count':0x0,'rows':[]};var _0x364bb3=_[_0xe6f4('0x2c')](db[_0xe6f4('0x2d')][_0xe6f4('0x2e')],function(_0x32bdd4){return{'name':_0x32bdd4['fieldName'],'type':_0x32bdd4[_0xe6f4('0x2f')]['key']};});_0x237092['model']=_['map'](_0x364bb3,_0xe6f4('0x29'));_0x237092[_0xe6f4('0x30')]=_[_0xe6f4('0x31')](_0x59a1b0[_0xe6f4('0x30')]);_0x237092['filters']=_[_0xe6f4('0x32')](_0x237092[_0xe6f4('0x33')],_0x237092['query']);_0x18ec76[_0xe6f4('0x34')]=_[_0xe6f4('0x32')](_0x237092[_0xe6f4('0x33')],qs[_0xe6f4('0x35')](_0x59a1b0[_0xe6f4('0x30')][_0xe6f4('0x35')]));_0x18ec76[_0xe6f4('0x34')]=_0x18ec76[_0xe6f4('0x34')]['length']?_0x18ec76[_0xe6f4('0x34')]:_0x237092[_0xe6f4('0x33')];if(!_0x59a1b0['query'][_0xe6f4('0x36')](_0xe6f4('0x37'))){_0x18ec76[_0xe6f4('0x1f')]=qs[_0xe6f4('0x1f')](_0x59a1b0[_0xe6f4('0x30')][_0xe6f4('0x1f')]);_0x18ec76[_0xe6f4('0x1d')]=qs['offset'](_0x59a1b0['query']['offset']);}_0x18ec76[_0xe6f4('0x38')]=qs[_0xe6f4('0x39')](_0x59a1b0['query']['sort']);_0x18ec76[_0xe6f4('0x3a')]=qs['filters'](_['pick'](_0x59a1b0[_0xe6f4('0x30')],_0x237092[_0xe6f4('0x3b')]),_0x364bb3);if(_0x59a1b0[_0xe6f4('0x30')][_0xe6f4('0x3c')]){_0x18ec76[_0xe6f4('0x3a')]=_[_0xe6f4('0x3d')](_0x18ec76['where'],{'$or':_[_0xe6f4('0x2c')](_0x364bb3,function(_0x373b2f){if(_0x373b2f['type']!==_0xe6f4('0x3e')){var _0x33b131={};_0x33b131[_0x373b2f[_0xe6f4('0x29')]]={'$like':'%'+_0x59a1b0[_0xe6f4('0x30')][_0xe6f4('0x3c')]+'%'};return _0x33b131;}})});}_0x18ec76=_[_0xe6f4('0x3d')]({},_0x18ec76,_0x59a1b0[_0xe6f4('0x3f')]);var _0x3ccf00={'where':_0x18ec76[_0xe6f4('0x3a')]};return db['OpenchannelTransferReport'][_0xe6f4('0x20')](_0x3ccf00)['then'](function(_0x4d868a){_0x56711b[_0xe6f4('0x20')]=_0x4d868a;if(_0x59a1b0[_0xe6f4('0x30')][_0xe6f4('0x40')]){_0x18ec76[_0xe6f4('0x41')]=[{'all':!![]}];}return db[_0xe6f4('0x2d')][_0xe6f4('0x42')](_0x18ec76);})['then'](function(_0x1c23bf){_0x56711b['rows']=_0x1c23bf;return _0x56711b;})[_0xe6f4('0x26')](respondWithFilteredResult(_0x4e9962,_0x18ec76))['catch'](handleError(_0x4e9962,null));};exports[_0xe6f4('0x43')]=function(_0x853751,_0xa1c706){var _0x2e592b={'raw':!![],'where':{'id':_0x853751[_0xe6f4('0x44')]['id']}},_0x5a2db0={};_0x5a2db0['model']=_[_0xe6f4('0x31')](db['OpenchannelTransferReport']['rawAttributes']);_0x5a2db0[_0xe6f4('0x30')]=_['keys'](_0x853751['query']);_0x5a2db0['filters']=_[_0xe6f4('0x32')](_0x5a2db0[_0xe6f4('0x33')],_0x5a2db0[_0xe6f4('0x30')]);_0x2e592b['attributes']=_[_0xe6f4('0x32')](_0x5a2db0['model'],qs[_0xe6f4('0x35')](_0x853751[_0xe6f4('0x30')][_0xe6f4('0x35')]));_0x2e592b[_0xe6f4('0x34')]=_0x2e592b[_0xe6f4('0x34')]['length']?_0x2e592b[_0xe6f4('0x34')]:_0x5a2db0[_0xe6f4('0x33')];if(_0x853751[_0xe6f4('0x30')][_0xe6f4('0x40')]){_0x2e592b[_0xe6f4('0x41')]=[{'all':!![]}];}_0x2e592b=_[_0xe6f4('0x3d')]({},_0x2e592b,_0x853751['options']);return db['OpenchannelTransferReport'][_0xe6f4('0x45')](_0x2e592b)[_0xe6f4('0x26')](handleEntityNotFound(_0xa1c706,null))[_0xe6f4('0x26')](respondWithResult(_0xa1c706,null))[_0xe6f4('0x46')](handleError(_0xa1c706,null));};exports[_0xe6f4('0x47')]=function(_0xe8c073,_0x2491fe){return db[_0xe6f4('0x2d')]['create'](_0xe8c073[_0xe6f4('0x48')],{})[_0xe6f4('0x26')](respondWithResult(_0x2491fe,0xc9))[_0xe6f4('0x46')](handleError(_0x2491fe,null));};exports['update']=function(_0x130ae1,_0x1513ec){if(_0x130ae1[_0xe6f4('0x48')]['id']){delete _0x130ae1[_0xe6f4('0x48')]['id'];}return db[_0xe6f4('0x2d')][_0xe6f4('0x45')]({'where':{'id':_0x130ae1[_0xe6f4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1513ec,null))[_0xe6f4('0x26')](saveUpdates(_0x130ae1[_0xe6f4('0x48')],null))[_0xe6f4('0x26')](respondWithResult(_0x1513ec,null))[_0xe6f4('0x46')](handleError(_0x1513ec,null));};exports['destroy']=function(_0x3ccfdf,_0x312a77){return db[_0xe6f4('0x2d')]['find']({'where':{'id':_0x3ccfdf['params']['id']}})['then'](handleEntityNotFound(_0x312a77,null))[_0xe6f4('0x26')](removeEntity(_0x312a77,null))[_0xe6f4('0x46')](handleError(_0x312a77,null));};exports['describe']=function(_0x5a4880,_0x28fa91){return db[_0xe6f4('0x2d')]['describe']()[_0xe6f4('0x26')](respondWithResult(_0x28fa91,null))['catch'](handleError(_0x28fa91,null));}; \ No newline at end of file +var _0xeb3d=['then','destroy','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','save','update'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xeb3d,0x102));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xdeb3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeb3('0x1'));var jsonpatch=require(_0xdeb3('0x2'));var rp=require(_0xdeb3('0x3'));var moment=require(_0xdeb3('0x4'));var BPromise=require(_0xdeb3('0x5'));var Mustache=require('mustache');var util=require(_0xdeb3('0x6'));var path=require(_0xdeb3('0x7'));var sox=require(_0xdeb3('0x8'));var csv=require(_0xdeb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdeb3('0xa'));var _=require(_0xdeb3('0xb'));var squel=require(_0xdeb3('0xc'));var crypto=require(_0xdeb3('0xd'));var jsforce=require(_0xdeb3('0xe'));var deskjs=require(_0xdeb3('0xf'));var toCsv=require(_0xdeb3('0x9'));var querystring=require(_0xdeb3('0x10'));var Papa=require(_0xdeb3('0x11'));var Redis=require('ioredis');var authService=require(_0xdeb3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdeb3('0x13'));var hardwareService=require(_0xdeb3('0x14'));var logger=require(_0xdeb3('0x15'))('api');var utils=require(_0xdeb3('0x16'));var config=require(_0xdeb3('0x17'));var licenseUtil=require(_0xdeb3('0x18'));var db=require(_0xdeb3('0x19'))['db'];function respondWithStatusCode(_0x527362,_0x485561){_0x485561=_0x485561||0xcc;return function(_0x38779a){if(_0x38779a){return _0x527362[_0xdeb3('0x1a')](_0x485561);}return _0x527362['status'](_0x485561)[_0xdeb3('0x1b')]();};}function respondWithResult(_0x1019b0,_0x459633){_0x459633=_0x459633||0xc8;return function(_0x58f88c){if(_0x58f88c){return _0x1019b0[_0xdeb3('0x1c')](_0x459633)[_0xdeb3('0x1d')](_0x58f88c);}};}function respondWithFilteredResult(_0x2321c9,_0x1c739f){return function(_0xb3e8f3){if(_0xb3e8f3){var _0x5a2baa=typeof _0x1c739f['offset']===_0xdeb3('0x1e')&&typeof _0x1c739f[_0xdeb3('0x1f')]===_0xdeb3('0x1e');var _0xde4e5d=_0xb3e8f3['count'];var _0xaf05d8=_0x5a2baa?0x0:_0x1c739f[_0xdeb3('0x20')];var _0x2d6440=_0x5a2baa?_0xb3e8f3[_0xdeb3('0x21')]:_0x1c739f['offset']+_0x1c739f['limit'];var _0x100202;if(_0x2d6440>=_0xde4e5d){_0x2d6440=_0xde4e5d;_0x100202=0xc8;}else{_0x100202=0xce;}_0x2321c9[_0xdeb3('0x1c')](_0x100202);return _0x2321c9[_0xdeb3('0x22')]('Content-Range',_0xaf05d8+'-'+_0x2d6440+'/'+_0xde4e5d)['json'](_0xb3e8f3);}return null;};}function patchUpdates(_0x2df509){return function(_0x20fb58){try{jsonpatch[_0xdeb3('0x23')](_0x20fb58,_0x2df509,!![]);}catch(_0x197bb3){return BPromise['reject'](_0x197bb3);}return _0x20fb58[_0xdeb3('0x24')]();};}function saveUpdates(_0x4b53fe,_0x72e125){return function(_0x3dc470){if(_0x3dc470){return _0x3dc470[_0xdeb3('0x25')](_0x4b53fe)[_0xdeb3('0x26')](function(_0x48e04d){return _0x48e04d;});}return null;};}function removeEntity(_0x1f355d,_0x242dca){return function(_0x2d6921){if(_0x2d6921){return _0x2d6921[_0xdeb3('0x27')]()[_0xdeb3('0x26')](function(){_0x1f355d['status'](0xcc)[_0xdeb3('0x1b')]();});}};}function handleEntityNotFound(_0x36af25,_0x504631){return function(_0x58e9ff){if(!_0x58e9ff){_0x36af25[_0xdeb3('0x1a')](0x194);}return _0x58e9ff;};}function handleError(_0x5c4e4d,_0x3ab826){_0x3ab826=_0x3ab826||0x1f4;return function(_0x5d6083){logger['error'](_0x5d6083[_0xdeb3('0x28')]);if(_0x5d6083[_0xdeb3('0x29')]){delete _0x5d6083[_0xdeb3('0x29')];}_0x5c4e4d[_0xdeb3('0x1c')](_0x3ab826)['send'](_0x5d6083);};}exports[_0xdeb3('0x2a')]=function(_0x88e1bf,_0x18afb1){var _0x52cbd2={},_0x589f1e={},_0x3cad24={'count':0x0,'rows':[]};var _0x3fb247=_[_0xdeb3('0x2b')](db[_0xdeb3('0x2c')][_0xdeb3('0x2d')],function(_0x2ba8e2){return{'name':_0x2ba8e2[_0xdeb3('0x2e')],'type':_0x2ba8e2[_0xdeb3('0x2f')]['key']};});_0x589f1e[_0xdeb3('0x30')]=_[_0xdeb3('0x2b')](_0x3fb247,_0xdeb3('0x29'));_0x589f1e['query']=_[_0xdeb3('0x31')](_0x88e1bf[_0xdeb3('0x32')]);_0x589f1e[_0xdeb3('0x33')]=_[_0xdeb3('0x34')](_0x589f1e[_0xdeb3('0x30')],_0x589f1e['query']);_0x52cbd2[_0xdeb3('0x35')]=_[_0xdeb3('0x34')](_0x589f1e[_0xdeb3('0x30')],qs[_0xdeb3('0x36')](_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x36')]));_0x52cbd2[_0xdeb3('0x35')]=_0x52cbd2[_0xdeb3('0x35')][_0xdeb3('0x37')]?_0x52cbd2[_0xdeb3('0x35')]:_0x589f1e['model'];if(!_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x38')](_0xdeb3('0x39'))){_0x52cbd2[_0xdeb3('0x1f')]=qs['limit'](_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x1f')]);_0x52cbd2[_0xdeb3('0x20')]=qs[_0xdeb3('0x20')](_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x20')]);}_0x52cbd2[_0xdeb3('0x3a')]=qs[_0xdeb3('0x3b')](_0x88e1bf['query'][_0xdeb3('0x3b')]);_0x52cbd2[_0xdeb3('0x3c')]=qs['filters'](_[_0xdeb3('0x3d')](_0x88e1bf['query'],_0x589f1e[_0xdeb3('0x33')]),_0x3fb247);if(_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x3e')]){_0x52cbd2[_0xdeb3('0x3c')]=_[_0xdeb3('0x3f')](_0x52cbd2[_0xdeb3('0x3c')],{'$or':_[_0xdeb3('0x2b')](_0x3fb247,function(_0x28e0ed){if(_0x28e0ed[_0xdeb3('0x2f')]!==_0xdeb3('0x40')){var _0x2e34f3={};_0x2e34f3[_0x28e0ed[_0xdeb3('0x29')]]={'$like':'%'+_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x3e')]+'%'};return _0x2e34f3;}})});}_0x52cbd2=_[_0xdeb3('0x3f')]({},_0x52cbd2,_0x88e1bf['options']);var _0x341252={'where':_0x52cbd2[_0xdeb3('0x3c')]};return db[_0xdeb3('0x2c')]['count'](_0x341252)['then'](function(_0x4f23e){_0x3cad24['count']=_0x4f23e;if(_0x88e1bf[_0xdeb3('0x32')][_0xdeb3('0x41')]){_0x52cbd2['include']=[{'all':!![]}];}return db[_0xdeb3('0x2c')]['findAll'](_0x52cbd2);})[_0xdeb3('0x26')](function(_0x191a5f){_0x3cad24['rows']=_0x191a5f;return _0x3cad24;})['then'](respondWithFilteredResult(_0x18afb1,_0x52cbd2))[_0xdeb3('0x42')](handleError(_0x18afb1,null));};exports[_0xdeb3('0x43')]=function(_0x1962d7,_0x2fa7b7){var _0x14bc6b={'raw':!![],'where':{'id':_0x1962d7[_0xdeb3('0x44')]['id']}},_0x4b5399={};_0x4b5399[_0xdeb3('0x30')]=_[_0xdeb3('0x31')](db[_0xdeb3('0x2c')][_0xdeb3('0x2d')]);_0x4b5399[_0xdeb3('0x32')]=_[_0xdeb3('0x31')](_0x1962d7[_0xdeb3('0x32')]);_0x4b5399[_0xdeb3('0x33')]=_['intersection'](_0x4b5399[_0xdeb3('0x30')],_0x4b5399['query']);_0x14bc6b[_0xdeb3('0x35')]=_[_0xdeb3('0x34')](_0x4b5399[_0xdeb3('0x30')],qs[_0xdeb3('0x36')](_0x1962d7[_0xdeb3('0x32')][_0xdeb3('0x36')]));_0x14bc6b[_0xdeb3('0x35')]=_0x14bc6b[_0xdeb3('0x35')][_0xdeb3('0x37')]?_0x14bc6b[_0xdeb3('0x35')]:_0x4b5399[_0xdeb3('0x30')];if(_0x1962d7['query'][_0xdeb3('0x41')]){_0x14bc6b[_0xdeb3('0x45')]=[{'all':!![]}];}_0x14bc6b=_[_0xdeb3('0x3f')]({},_0x14bc6b,_0x1962d7['options']);return db[_0xdeb3('0x2c')][_0xdeb3('0x46')](_0x14bc6b)[_0xdeb3('0x26')](handleEntityNotFound(_0x2fa7b7,null))[_0xdeb3('0x26')](respondWithResult(_0x2fa7b7,null))['catch'](handleError(_0x2fa7b7,null));};exports[_0xdeb3('0x47')]=function(_0x4a3d2d,_0x2f2e3a){return db[_0xdeb3('0x2c')][_0xdeb3('0x47')](_0x4a3d2d[_0xdeb3('0x48')],{})[_0xdeb3('0x26')](respondWithResult(_0x2f2e3a,0xc9))['catch'](handleError(_0x2f2e3a,null));};exports['update']=function(_0x738089,_0x38a159){if(_0x738089[_0xdeb3('0x48')]['id']){delete _0x738089['body']['id'];}return db[_0xdeb3('0x2c')][_0xdeb3('0x46')]({'where':{'id':_0x738089[_0xdeb3('0x44')]['id']}})[_0xdeb3('0x26')](handleEntityNotFound(_0x38a159,null))[_0xdeb3('0x26')](saveUpdates(_0x738089[_0xdeb3('0x48')],null))[_0xdeb3('0x26')](respondWithResult(_0x38a159,null))[_0xdeb3('0x42')](handleError(_0x38a159,null));};exports[_0xdeb3('0x27')]=function(_0x2b0bcc,_0x544b68){return db[_0xdeb3('0x2c')][_0xdeb3('0x46')]({'where':{'id':_0x2b0bcc[_0xdeb3('0x44')]['id']}})[_0xdeb3('0x26')](handleEntityNotFound(_0x544b68,null))['then'](removeEntity(_0x544b68,null))['catch'](handleError(_0x544b68,null));};exports['describe']=function(_0x2a108c,_0x4385c5){return db['OpenchannelTransferReport'][_0xdeb3('0x49')]()[_0xdeb3('0x26')](respondWithResult(_0x4385c5,null))[_0xdeb3('0x42')](handleError(_0x4385c5,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a29e98e..fa9dc52 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 _0xbb02=['bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x4e93fd,_0xff394d){var _0x421e88=function(_0x473972){while(--_0x473972){_0x4e93fd['push'](_0x4e93fd['shift']());}};_0x421e88(++_0xff394d);}(_0xbb02,0x1c3));var _0x2bb0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb02[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x2bb0('0x0'));var util=require('util');var logger=require(_0x2bb0('0x1'))(_0x2bb0('0x2'));var moment=require(_0x2bb0('0x3'));var BPromise=require(_0x2bb0('0x4'));var rp=require(_0x2bb0('0x5'));var fs=require('fs');var path=require(_0x2bb0('0x6'));var rimraf=require(_0x2bb0('0x7'));var config=require('../../config/environment');var attributes=require(_0x2bb0('0x8'));module[_0x2bb0('0x9')]=function(_0x426893,_0x4a9676){return _0x426893[_0x2bb0('0xa')](_0x2bb0('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x2bb0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe157=['bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe157,0x1c1));var _0x7e15=function(_0x4dc108,_0x181445){_0x4dc108=_0x4dc108-0x0;var _0x533a51=_0xe157[_0x4dc108];return _0x533a51;};'use strict';var _=require(_0x7e15('0x0'));var util=require(_0x7e15('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7e15('0x2'));var rp=require(_0x7e15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e15('0x4'));var config=require(_0x7e15('0x5'));var attributes=require(_0x7e15('0x6'));module[_0x7e15('0x7')]=function(_0x4c00e4,_0x2ec8d0){return _0x4c00e4[_0x7e15('0x8')](_0x7e15('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x7e15('0xa'),'fields':[_0x7e15('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0c6941b..d66af78 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 _0xecb2=['stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0xecb2,0xf6));var _0x2ecb=function(_0x14bce5,_0x438129){_0x14bce5=_0x14bce5-0x0;var _0x332418=_0xecb2[_0x14bce5];return _0x332418;};'use strict';var _=require(_0x2ecb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ecb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ecb('0x2'))['db'];var utils=require(_0x2ecb('0x3'));var logger=require(_0x2ecb('0x4'))(_0x2ecb('0x5'));var config=require(_0x2ecb('0x6'));var jayson=require(_0x2ecb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49de99,_0x8f9105,_0x3df4a0){return new BPromise(function(_0x15a959,_0x3bd683){return client[_0x2ecb('0x8')](_0x49de99,_0x3df4a0)['then'](function(_0x19652e){logger[_0x2ecb('0x9')](_0x2ecb('0xa'),_0x8f9105,'request\x20sent');logger[_0x2ecb('0xb')](_0x2ecb('0xc'),_0x8f9105,_0x2ecb('0xd'),JSON[_0x2ecb('0xe')](_0x19652e));if(_0x19652e[_0x2ecb('0xf')]){if(_0x19652e['error'][_0x2ecb('0x10')]===0x1f4){logger[_0x2ecb('0xf')](_0x2ecb('0xa'),_0x8f9105,_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);return _0x3bd683(_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);}logger['error'](_0x2ecb('0xa'),_0x8f9105,_0x19652e[_0x2ecb('0xf')]['message']);return _0x15a959(_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);}else{logger[_0x2ecb('0x9')](_0x2ecb('0xa'),_0x8f9105,_0x2ecb('0xd'));_0x15a959(_0x19652e[_0x2ecb('0x12')][_0x2ecb('0x11')]);}})[_0x2ecb('0x13')](function(_0x662ef2){logger['error'](_0x2ecb('0xa'),_0x8f9105,_0x662ef2);_0x3bd683(_0x662ef2);});});} \ No newline at end of file +var _0x04de=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x59c28c,_0x338813){var _0x48b63f=function(_0x516dde){while(--_0x516dde){_0x59c28c['push'](_0x59c28c['shift']());}};_0x48b63f(++_0x338813);}(_0x04de,0x107));var _0xe04d=function(_0x265578,_0x1a0e26){_0x265578=_0x265578-0x0;var _0x34bc0f=_0x04de[_0x265578];return _0x34bc0f;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ea15711..666a52c 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 _0xaee2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports'];(function(_0x12f389,_0x1b222f){var _0x321a94=function(_0x21f717){while(--_0x21f717){_0x12f389['push'](_0x12f389['shift']());}};_0x321a94(++_0x1b222f);}(_0xaee2,0x150));var _0x2aee=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xaee2[_0x3fb9dd];return _0x20136a;};'use strict';var multer=require(_0x2aee('0x0'));var util=require(_0x2aee('0x1'));var path=require(_0x2aee('0x2'));var timeout=require(_0x2aee('0x3'));var express=require(_0x2aee('0x4'));var router=express[_0x2aee('0x5')]();var fs_extra=require(_0x2aee('0x6'));var auth=require(_0x2aee('0x7'));var interaction=require(_0x2aee('0x8'));var config=require(_0x2aee('0x9'));var controller=require(_0x2aee('0xa'));router[_0x2aee('0xb')]('/',auth[_0x2aee('0xc')](),controller[_0x2aee('0xd')]);router[_0x2aee('0xb')](_0x2aee('0xe'),auth['isAuthenticated'](),controller[_0x2aee('0xf')]);router['post']('/',auth[_0x2aee('0xc')](),controller['create']);router[_0x2aee('0x10')](_0x2aee('0xe'),auth[_0x2aee('0xc')](),controller[_0x2aee('0x11')]);router[_0x2aee('0x12')](_0x2aee('0xe'),auth['isAuthenticated'](),controller[_0x2aee('0x13')]);module[_0x2aee('0x14')]=router; \ No newline at end of file +var _0x1166=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put'];(function(_0x5b8880,_0x1c8329){var _0x24ab57=function(_0x598fe2){while(--_0x598fe2){_0x5b8880['push'](_0x5b8880['shift']());}};_0x24ab57(++_0x1c8329);}(_0x1166,0x1a8));var _0x6116=function(_0x5b55dc,_0x28719a){_0x5b55dc=_0x5b55dc-0x0;var _0x3615fe=_0x1166[_0x5b55dc];return _0x3615fe;};'use strict';var multer=require(_0x6116('0x0'));var util=require('util');var path=require(_0x6116('0x1'));var timeout=require(_0x6116('0x2'));var express=require(_0x6116('0x3'));var router=express[_0x6116('0x4')]();var fs_extra=require(_0x6116('0x5'));var auth=require(_0x6116('0x6'));var interaction=require(_0x6116('0x7'));var config=require(_0x6116('0x8'));var controller=require('./pause.controller');router[_0x6116('0x9')]('/',auth['isAuthenticated'](),controller[_0x6116('0xa')]);router['get'](_0x6116('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6116('0xc')]('/',auth[_0x6116('0xd')](),controller[_0x6116('0xe')]);router[_0x6116('0xf')](_0x6116('0xb'),auth[_0x6116('0xd')](),controller[_0x6116('0x10')]);router[_0x6116('0x11')](_0x6116('0xb'),auth[_0x6116('0xd')](),controller[_0x6116('0x12')]);module[_0x6116('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 267231c..0670937 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 _0x607d=['exports','STRING','name'];(function(_0x3c0c9e,_0x3ecdee){var _0x5ba5fe=function(_0x1f4a60){while(--_0x1f4a60){_0x3c0c9e['push'](_0x3c0c9e['shift']());}};_0x5ba5fe(++_0x3ecdee);}(_0x607d,0x90));var _0xd607=function(_0x5de099,_0x469214){_0x5de099=_0x5de099-0x0;var _0x128417=_0x607d[_0x5de099];return _0x128417;};'use strict';var Sequelize=require('sequelize');module[_0xd607('0x0')]={'name':{'type':Sequelize[_0xd607('0x1')],'unique':_0xd607('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb746=['exports','name','STRING'];(function(_0x4e57a3,_0x49600d){var _0x30d278=function(_0x14a917){while(--_0x14a917){_0x4e57a3['push'](_0x4e57a3['shift']());}};_0x30d278(++_0x49600d);}(_0xb746,0x10e));var _0x6b74=function(_0x4f8a7b,_0x4f9ea9){_0x4f8a7b=_0x4f8a7b-0x0;var _0x525fd3=_0xb746[_0x4f8a7b];return _0x525fd3;};'use strict';var Sequelize=require('sequelize');module[_0x6b74('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6b74('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x6b74('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index adc714e..70b4061 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 _0x0fdd=['attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','Pause','includeAll','include','findAll','catch','show','params','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','map','rawAttributes','type','key','model','keys','query','filters'];(function(_0x324bb2,_0x5bc53e){var _0x218350=function(_0x5c569c){while(--_0x5c569c){_0x324bb2['push'](_0x324bb2['shift']());}};_0x218350(++_0x5bc53e);}(_0x0fdd,0x1d9));var _0xd0fd=function(_0x2da406,_0x379c62){_0x2da406=_0x2da406-0x0;var _0x860c6=_0x0fdd[_0x2da406];return _0x860c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0fd('0x0'));var zipdir=require(_0xd0fd('0x1'));var jsonpatch=require(_0xd0fd('0x2'));var rp=require(_0xd0fd('0x3'));var moment=require('moment');var BPromise=require(_0xd0fd('0x4'));var Mustache=require(_0xd0fd('0x5'));var util=require(_0xd0fd('0x6'));var path=require('path');var sox=require(_0xd0fd('0x7'));var csv=require(_0xd0fd('0x8'));var ejs=require(_0xd0fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0fd('0xa'));var squel=require(_0xd0fd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0fd('0xc'));var toCsv=require(_0xd0fd('0x8'));var querystring=require('querystring');var Papa=require(_0xd0fd('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd0fd('0xe'));var as=require(_0xd0fd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0fd('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xd0fd('0x11'));var licenseUtil=require(_0xd0fd('0x12'));var db=require(_0xd0fd('0x13'))['db'];function respondWithStatusCode(_0x13f3ef,_0x2f77b0){_0x2f77b0=_0x2f77b0||0xcc;return function(_0x51bbf3){if(_0x51bbf3){return _0x13f3ef['sendStatus'](_0x2f77b0);}return _0x13f3ef['status'](_0x2f77b0)['end']();};}function respondWithResult(_0x107063,_0x5eb128){_0x5eb128=_0x5eb128||0xc8;return function(_0x37b5c2){if(_0x37b5c2){return _0x107063[_0xd0fd('0x14')](_0x5eb128)[_0xd0fd('0x15')](_0x37b5c2);}};}function respondWithFilteredResult(_0x550214,_0x4d39f8){return function(_0x138e03){if(_0x138e03){var _0x1c63d4=typeof _0x4d39f8['offset']===_0xd0fd('0x16')&&typeof _0x4d39f8[_0xd0fd('0x17')]===_0xd0fd('0x16');var _0x599584=_0x138e03['count'];var _0x1a997f=_0x1c63d4?0x0:_0x4d39f8['offset'];var _0x5af274=_0x1c63d4?_0x138e03['count']:_0x4d39f8[_0xd0fd('0x18')]+_0x4d39f8[_0xd0fd('0x17')];var _0x59ffec;if(_0x5af274>=_0x599584){_0x5af274=_0x599584;_0x59ffec=0xc8;}else{_0x59ffec=0xce;}_0x550214[_0xd0fd('0x14')](_0x59ffec);return _0x550214[_0xd0fd('0x19')](_0xd0fd('0x1a'),_0x1a997f+'-'+_0x5af274+'/'+_0x599584)[_0xd0fd('0x15')](_0x138e03);}return null;};}function patchUpdates(_0x242838){return function(_0xbaed76){try{jsonpatch['apply'](_0xbaed76,_0x242838,!![]);}catch(_0x32c449){return BPromise[_0xd0fd('0x1b')](_0x32c449);}return _0xbaed76[_0xd0fd('0x1c')]();};}function saveUpdates(_0x2a959d,_0x2fa7a0){return function(_0x53315f){if(_0x53315f){return _0x53315f[_0xd0fd('0x1d')](_0x2a959d)[_0xd0fd('0x1e')](function(_0x3bc5c3){return _0x3bc5c3;});}return null;};}function removeEntity(_0x1a3120,_0x305cdd){return function(_0x4e536e){if(_0x4e536e){return _0x4e536e[_0xd0fd('0x1f')]()[_0xd0fd('0x1e')](function(){var _0x232c67=_0x4e536e['get']({'plain':!![]});var _0xefdcc7=_0xd0fd('0x20');return db[_0xd0fd('0x21')][_0xd0fd('0x1f')]({'where':{'type':_0xefdcc7,'resourceId':_0x232c67['id']}})[_0xd0fd('0x1e')](function(){return _0x4e536e;});})[_0xd0fd('0x1e')](function(){_0x1a3120[_0xd0fd('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52db0c,_0x7364d5){return function(_0x1040b2){if(!_0x1040b2){_0x52db0c[_0xd0fd('0x22')](0x194);}return _0x1040b2;};}function handleError(_0xe3061e,_0x408ff2){_0x408ff2=_0x408ff2||0x1f4;return function(_0x3cd0d6){logger['error'](_0x3cd0d6[_0xd0fd('0x23')]);if(_0x3cd0d6[_0xd0fd('0x24')]){delete _0x3cd0d6['name'];}_0xe3061e[_0xd0fd('0x14')](_0x408ff2)['send'](_0x3cd0d6);};}exports['index']=function(_0xc24561,_0x1ab269){var _0x55ffc0={},_0x5284b8={},_0x2e164b={'count':0x0,'rows':[]};var _0x1948a9=_[_0xd0fd('0x25')](db['Pause'][_0xd0fd('0x26')],function(_0x184948){return{'name':_0x184948['fieldName'],'type':_0x184948[_0xd0fd('0x27')][_0xd0fd('0x28')]};});_0x5284b8[_0xd0fd('0x29')]=_[_0xd0fd('0x25')](_0x1948a9,'name');_0x5284b8['query']=_[_0xd0fd('0x2a')](_0xc24561[_0xd0fd('0x2b')]);_0x5284b8[_0xd0fd('0x2c')]=_['intersection'](_0x5284b8[_0xd0fd('0x29')],_0x5284b8[_0xd0fd('0x2b')]);_0x55ffc0[_0xd0fd('0x2d')]=_[_0xd0fd('0x2e')](_0x5284b8[_0xd0fd('0x29')],qs[_0xd0fd('0x2f')](_0xc24561['query'][_0xd0fd('0x2f')]));_0x55ffc0[_0xd0fd('0x2d')]=_0x55ffc0[_0xd0fd('0x2d')]['length']?_0x55ffc0['attributes']:_0x5284b8[_0xd0fd('0x29')];if(!_0xc24561[_0xd0fd('0x2b')][_0xd0fd('0x30')]('nolimit')){_0x55ffc0[_0xd0fd('0x17')]=qs[_0xd0fd('0x17')](_0xc24561['query'][_0xd0fd('0x17')]);_0x55ffc0['offset']=qs[_0xd0fd('0x18')](_0xc24561[_0xd0fd('0x2b')][_0xd0fd('0x18')]);}_0x55ffc0[_0xd0fd('0x31')]=qs[_0xd0fd('0x32')](_0xc24561[_0xd0fd('0x2b')][_0xd0fd('0x32')]);_0x55ffc0[_0xd0fd('0x33')]=qs[_0xd0fd('0x2c')](_[_0xd0fd('0x34')](_0xc24561['query'],_0x5284b8[_0xd0fd('0x2c')]),_0x1948a9);if(_0xc24561['query']['filter']){_0x55ffc0[_0xd0fd('0x33')]=_[_0xd0fd('0x35')](_0x55ffc0['where'],{'$or':_[_0xd0fd('0x25')](_0x1948a9,function(_0x4fe478){if(_0x4fe478[_0xd0fd('0x27')]!==_0xd0fd('0x36')){var _0x397388={};_0x397388[_0x4fe478[_0xd0fd('0x24')]]={'$like':'%'+_0xc24561[_0xd0fd('0x2b')][_0xd0fd('0x37')]+'%'};return _0x397388;}})});}_0x55ffc0=_[_0xd0fd('0x35')]({},_0x55ffc0,_0xc24561['options']);var _0x45ee5e={'where':_0x55ffc0[_0xd0fd('0x33')]};return db[_0xd0fd('0x38')]['count'](_0x45ee5e)[_0xd0fd('0x1e')](function(_0x585bfc){_0x2e164b['count']=_0x585bfc;if(_0xc24561['query'][_0xd0fd('0x39')]){_0x55ffc0[_0xd0fd('0x3a')]=[{'all':!![]}];}return db[_0xd0fd('0x38')][_0xd0fd('0x3b')](_0x55ffc0);})['then'](function(_0xad2f1d){_0x2e164b['rows']=_0xad2f1d;return _0x2e164b;})[_0xd0fd('0x1e')](respondWithFilteredResult(_0x1ab269,_0x55ffc0))[_0xd0fd('0x3c')](handleError(_0x1ab269,null));};exports[_0xd0fd('0x3d')]=function(_0x56fabb,_0x1187ca){var _0x1bd1c0={'raw':!![],'where':{'id':_0x56fabb[_0xd0fd('0x3e')]['id']}},_0x578833={};_0x578833['model']=_['keys'](db['Pause'][_0xd0fd('0x26')]);_0x578833[_0xd0fd('0x2b')]=_[_0xd0fd('0x2a')](_0x56fabb[_0xd0fd('0x2b')]);_0x578833['filters']=_['intersection'](_0x578833[_0xd0fd('0x29')],_0x578833['query']);_0x1bd1c0[_0xd0fd('0x2d')]=_[_0xd0fd('0x2e')](_0x578833[_0xd0fd('0x29')],qs[_0xd0fd('0x2f')](_0x56fabb[_0xd0fd('0x2b')]['fields']));_0x1bd1c0[_0xd0fd('0x2d')]=_0x1bd1c0[_0xd0fd('0x2d')][_0xd0fd('0x3f')]?_0x1bd1c0[_0xd0fd('0x2d')]:_0x578833[_0xd0fd('0x29')];if(_0x56fabb[_0xd0fd('0x2b')]['includeAll']){_0x1bd1c0[_0xd0fd('0x3a')]=[{'all':!![]}];}_0x1bd1c0=_[_0xd0fd('0x35')]({},_0x1bd1c0,_0x56fabb['options']);return db[_0xd0fd('0x38')]['find'](_0x1bd1c0)[_0xd0fd('0x1e')](handleEntityNotFound(_0x1187ca,null))['then'](respondWithResult(_0x1187ca,null))[_0xd0fd('0x3c')](handleError(_0x1187ca,null));};exports[_0xd0fd('0x40')]=function(_0x2bb739,_0x148c08){return db['Pause'][_0xd0fd('0x40')](_0x2bb739[_0xd0fd('0x41')],{})[_0xd0fd('0x1e')](function(_0x35aa41){var _0x554d7c=_0x2bb739['user'][_0xd0fd('0x42')]({'plain':!![]});if(!_0x554d7c)throw new Error(_0xd0fd('0x43'));if(_0x554d7c[_0xd0fd('0x44')]===_0xd0fd('0x45')){var _0x5d6648=_0x35aa41[_0xd0fd('0x42')]({'plain':!![]});var _0x1af06f='Pauses';return db[_0xd0fd('0x46')][_0xd0fd('0x47')]({'where':{'name':_0x1af06f,'userProfileId':_0x554d7c[_0xd0fd('0x48')]},'raw':!![]})[_0xd0fd('0x1e')](function(_0x48414c){if(_0x48414c&&_0x48414c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5d6648[_0xd0fd('0x24')],'resourceId':_0x5d6648['id'],'type':_0x48414c[_0xd0fd('0x24')],'sectionId':_0x48414c['id']},{})[_0xd0fd('0x1e')](function(){return _0x35aa41;});}else{return _0x35aa41;}})[_0xd0fd('0x3c')](function(_0x513325){logger['error'](_0xd0fd('0x49'),_0x513325);throw _0x513325;});}return _0x35aa41;})[_0xd0fd('0x1e')](respondWithResult(_0x148c08,0xc9))[_0xd0fd('0x3c')](handleError(_0x148c08,null));};exports[_0xd0fd('0x1d')]=function(_0x7f7722,_0x1fb6ec){if(_0x7f7722[_0xd0fd('0x41')]['id']){delete _0x7f7722['body']['id'];}return db[_0xd0fd('0x38')][_0xd0fd('0x47')]({'where':{'id':_0x7f7722[_0xd0fd('0x3e')]['id']}})[_0xd0fd('0x1e')](handleEntityNotFound(_0x1fb6ec,null))['then'](saveUpdates(_0x7f7722[_0xd0fd('0x41')],null))[_0xd0fd('0x1e')](respondWithResult(_0x1fb6ec,null))[_0xd0fd('0x3c')](handleError(_0x1fb6ec,null));};exports[_0xd0fd('0x1f')]=function(_0x46b236,_0x22a132){return db[_0xd0fd('0x38')][_0xd0fd('0x47')]({'where':{'id':_0x46b236[_0xd0fd('0x3e')]['id']}})[_0xd0fd('0x1e')](handleEntityNotFound(_0x22a132,null))[_0xd0fd('0x1e')](removeEntity(_0x22a132,null))['catch'](handleError(_0x22a132,null));}; \ No newline at end of file +var _0x81be=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','Pause','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x114e72,_0x3c1aaf){var _0x3e767e=function(_0x348f02){while(--_0x348f02){_0x114e72['push'](_0x114e72['shift']());}};_0x3e767e(++_0x3c1aaf);}(_0x81be,0xc1));var _0xe81b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x81be[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xe81b('0x0'));var rimraf=require(_0xe81b('0x1'));var zipdir=require(_0xe81b('0x2'));var jsonpatch=require(_0xe81b('0x3'));var rp=require(_0xe81b('0x4'));var moment=require(_0xe81b('0x5'));var BPromise=require(_0xe81b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe81b('0x7'));var sox=require(_0xe81b('0x8'));var csv=require(_0xe81b('0x9'));var ejs=require(_0xe81b('0xa'));var fs=require('fs');var fs_extra=require(_0xe81b('0xb'));var _=require(_0xe81b('0xc'));var squel=require(_0xe81b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe81b('0xe'));var deskjs=require(_0xe81b('0xf'));var toCsv=require(_0xe81b('0x9'));var querystring=require(_0xe81b('0x10'));var Papa=require('papaparse');var Redis=require(_0xe81b('0x11'));var authService=require(_0xe81b('0x12'));var qs=require(_0xe81b('0x13'));var as=require(_0xe81b('0x14'));var hardwareService=require(_0xe81b('0x15'));var logger=require(_0xe81b('0x16'))(_0xe81b('0x17'));var utils=require(_0xe81b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe81b('0x19'));var db=require(_0xe81b('0x1a'))['db'];function respondWithStatusCode(_0x3ad63a,_0x5b0deb){_0x5b0deb=_0x5b0deb||0xcc;return function(_0x3cbc8a){if(_0x3cbc8a){return _0x3ad63a[_0xe81b('0x1b')](_0x5b0deb);}return _0x3ad63a[_0xe81b('0x1c')](_0x5b0deb)['end']();};}function respondWithResult(_0x4df431,_0x1f45ae){_0x1f45ae=_0x1f45ae||0xc8;return function(_0x5b3b86){if(_0x5b3b86){return _0x4df431[_0xe81b('0x1c')](_0x1f45ae)['json'](_0x5b3b86);}};}function respondWithFilteredResult(_0x4445b6,_0x942623){return function(_0x268610){if(_0x268610){var _0x577f70=typeof _0x942623['offset']===_0xe81b('0x1d')&&typeof _0x942623['limit']===_0xe81b('0x1d');var _0x4ca78b=_0x268610[_0xe81b('0x1e')];var _0x5b4f06=_0x577f70?0x0:_0x942623[_0xe81b('0x1f')];var _0x9166fe=_0x577f70?_0x268610['count']:_0x942623[_0xe81b('0x1f')]+_0x942623[_0xe81b('0x20')];var _0x330dbb;if(_0x9166fe>=_0x4ca78b){_0x9166fe=_0x4ca78b;_0x330dbb=0xc8;}else{_0x330dbb=0xce;}_0x4445b6[_0xe81b('0x1c')](_0x330dbb);return _0x4445b6[_0xe81b('0x21')](_0xe81b('0x22'),_0x5b4f06+'-'+_0x9166fe+'/'+_0x4ca78b)[_0xe81b('0x23')](_0x268610);}return null;};}function patchUpdates(_0x19406e){return function(_0x5cdd55){try{jsonpatch['apply'](_0x5cdd55,_0x19406e,!![]);}catch(_0x47ed74){return BPromise['reject'](_0x47ed74);}return _0x5cdd55[_0xe81b('0x24')]();};}function saveUpdates(_0x56a1fc,_0x5cbc42){return function(_0x30c4e2){if(_0x30c4e2){return _0x30c4e2[_0xe81b('0x25')](_0x56a1fc)[_0xe81b('0x26')](function(_0x293f99){return _0x293f99;});}return null;};}function removeEntity(_0x510a52,_0x38788a){return function(_0xa5b0ce){if(_0xa5b0ce){return _0xa5b0ce[_0xe81b('0x27')]()[_0xe81b('0x26')](function(){var _0x5abd4e=_0xa5b0ce[_0xe81b('0x28')]({'plain':!![]});var _0x3ec21d=_0xe81b('0x29');return db[_0xe81b('0x2a')][_0xe81b('0x27')]({'where':{'type':_0x3ec21d,'resourceId':_0x5abd4e['id']}})[_0xe81b('0x26')](function(){return _0xa5b0ce;});})['then'](function(){_0x510a52[_0xe81b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4639e6,_0x5bc0b3){return function(_0x850d5f){if(!_0x850d5f){_0x4639e6[_0xe81b('0x1b')](0x194);}return _0x850d5f;};}function handleError(_0x2f2594,_0x1e8920){_0x1e8920=_0x1e8920||0x1f4;return function(_0x100ca5){logger[_0xe81b('0x2b')](_0x100ca5[_0xe81b('0x2c')]);if(_0x100ca5[_0xe81b('0x2d')]){delete _0x100ca5[_0xe81b('0x2d')];}_0x2f2594['status'](_0x1e8920)[_0xe81b('0x2e')](_0x100ca5);};}exports['index']=function(_0x502b2d,_0x43b279){var _0x4c618d={},_0x1f5a3d={},_0x46d40c={'count':0x0,'rows':[]};var _0x504b7b=_[_0xe81b('0x2f')](db[_0xe81b('0x30')][_0xe81b('0x31')],function(_0x686a44){return{'name':_0x686a44['fieldName'],'type':_0x686a44[_0xe81b('0x32')][_0xe81b('0x33')]};});_0x1f5a3d[_0xe81b('0x34')]=_[_0xe81b('0x2f')](_0x504b7b,_0xe81b('0x2d'));_0x1f5a3d[_0xe81b('0x35')]=_['keys'](_0x502b2d[_0xe81b('0x35')]);_0x1f5a3d[_0xe81b('0x36')]=_[_0xe81b('0x37')](_0x1f5a3d['model'],_0x1f5a3d[_0xe81b('0x35')]);_0x4c618d['attributes']=_[_0xe81b('0x37')](_0x1f5a3d[_0xe81b('0x34')],qs['fields'](_0x502b2d[_0xe81b('0x35')][_0xe81b('0x38')]));_0x4c618d[_0xe81b('0x39')]=_0x4c618d[_0xe81b('0x39')][_0xe81b('0x3a')]?_0x4c618d['attributes']:_0x1f5a3d[_0xe81b('0x34')];if(!_0x502b2d['query'][_0xe81b('0x3b')](_0xe81b('0x3c'))){_0x4c618d[_0xe81b('0x20')]=qs[_0xe81b('0x20')](_0x502b2d[_0xe81b('0x35')][_0xe81b('0x20')]);_0x4c618d[_0xe81b('0x1f')]=qs[_0xe81b('0x1f')](_0x502b2d[_0xe81b('0x35')][_0xe81b('0x1f')]);}_0x4c618d[_0xe81b('0x3d')]=qs['sort'](_0x502b2d[_0xe81b('0x35')][_0xe81b('0x3e')]);_0x4c618d[_0xe81b('0x3f')]=qs[_0xe81b('0x36')](_[_0xe81b('0x40')](_0x502b2d[_0xe81b('0x35')],_0x1f5a3d[_0xe81b('0x36')]),_0x504b7b);if(_0x502b2d[_0xe81b('0x35')][_0xe81b('0x41')]){_0x4c618d[_0xe81b('0x3f')]=_[_0xe81b('0x42')](_0x4c618d['where'],{'$or':_['map'](_0x504b7b,function(_0x4098cb){if(_0x4098cb[_0xe81b('0x32')]!=='VIRTUAL'){var _0x9ea4e2={};_0x9ea4e2[_0x4098cb['name']]={'$like':'%'+_0x502b2d[_0xe81b('0x35')][_0xe81b('0x41')]+'%'};return _0x9ea4e2;}})});}_0x4c618d=_[_0xe81b('0x42')]({},_0x4c618d,_0x502b2d[_0xe81b('0x43')]);var _0x1709ae={'where':_0x4c618d[_0xe81b('0x3f')]};return db[_0xe81b('0x30')][_0xe81b('0x1e')](_0x1709ae)[_0xe81b('0x26')](function(_0x3a02d0){_0x46d40c[_0xe81b('0x1e')]=_0x3a02d0;if(_0x502b2d[_0xe81b('0x35')][_0xe81b('0x44')]){_0x4c618d['include']=[{'all':!![]}];}return db[_0xe81b('0x30')]['findAll'](_0x4c618d);})['then'](function(_0x15f8c4){_0x46d40c[_0xe81b('0x45')]=_0x15f8c4;return _0x46d40c;})['then'](respondWithFilteredResult(_0x43b279,_0x4c618d))[_0xe81b('0x46')](handleError(_0x43b279,null));};exports[_0xe81b('0x47')]=function(_0x4872ed,_0x4eebd9){var _0x570c06={'raw':!![],'where':{'id':_0x4872ed[_0xe81b('0x48')]['id']}},_0x124d6a={};_0x124d6a[_0xe81b('0x34')]=_[_0xe81b('0x49')](db[_0xe81b('0x30')][_0xe81b('0x31')]);_0x124d6a['query']=_[_0xe81b('0x49')](_0x4872ed['query']);_0x124d6a[_0xe81b('0x36')]=_[_0xe81b('0x37')](_0x124d6a[_0xe81b('0x34')],_0x124d6a[_0xe81b('0x35')]);_0x570c06[_0xe81b('0x39')]=_[_0xe81b('0x37')](_0x124d6a[_0xe81b('0x34')],qs[_0xe81b('0x38')](_0x4872ed[_0xe81b('0x35')]['fields']));_0x570c06[_0xe81b('0x39')]=_0x570c06[_0xe81b('0x39')]['length']?_0x570c06[_0xe81b('0x39')]:_0x124d6a['model'];if(_0x4872ed[_0xe81b('0x35')][_0xe81b('0x44')]){_0x570c06[_0xe81b('0x4a')]=[{'all':!![]}];}_0x570c06=_[_0xe81b('0x42')]({},_0x570c06,_0x4872ed['options']);return db[_0xe81b('0x30')]['find'](_0x570c06)['then'](handleEntityNotFound(_0x4eebd9,null))[_0xe81b('0x26')](respondWithResult(_0x4eebd9,null))['catch'](handleError(_0x4eebd9,null));};exports[_0xe81b('0x4b')]=function(_0x1aba23,_0x51fbce){return db[_0xe81b('0x30')][_0xe81b('0x4b')](_0x1aba23[_0xe81b('0x4c')],{})[_0xe81b('0x26')](function(_0x14e3f1){var _0x477029=_0x1aba23[_0xe81b('0x4d')][_0xe81b('0x28')]({'plain':!![]});if(!_0x477029)throw new Error(_0xe81b('0x4e'));if(_0x477029['role']==='user'){var _0x36d787=_0x14e3f1[_0xe81b('0x28')]({'plain':!![]});var _0x2d60b9=_0xe81b('0x29');return db[_0xe81b('0x4f')]['find']({'where':{'name':_0x2d60b9,'userProfileId':_0x477029[_0xe81b('0x50')]},'raw':!![]})[_0xe81b('0x26')](function(_0x561686){if(_0x561686&&_0x561686[_0xe81b('0x51')]===0x0){return db['UserProfileResource'][_0xe81b('0x4b')]({'name':_0x36d787[_0xe81b('0x2d')],'resourceId':_0x36d787['id'],'type':_0x561686[_0xe81b('0x2d')],'sectionId':_0x561686['id']},{})['then'](function(){return _0x14e3f1;});}else{return _0x14e3f1;}})[_0xe81b('0x46')](function(_0x3ee59c){logger['error'](_0xe81b('0x52'),_0x3ee59c);throw _0x3ee59c;});}return _0x14e3f1;})['then'](respondWithResult(_0x51fbce,0xc9))[_0xe81b('0x46')](handleError(_0x51fbce,null));};exports[_0xe81b('0x25')]=function(_0xdd2fba,_0x29a4bd){if(_0xdd2fba['body']['id']){delete _0xdd2fba[_0xe81b('0x4c')]['id'];}return db[_0xe81b('0x30')][_0xe81b('0x53')]({'where':{'id':_0xdd2fba['params']['id']}})['then'](handleEntityNotFound(_0x29a4bd,null))[_0xe81b('0x26')](saveUpdates(_0xdd2fba['body'],null))['then'](respondWithResult(_0x29a4bd,null))[_0xe81b('0x46')](handleError(_0x29a4bd,null));};exports[_0xe81b('0x27')]=function(_0xdf8494,_0x2ef10c){return db['Pause']['find']({'where':{'id':_0xdf8494['params']['id']}})['then'](handleEntityNotFound(_0x2ef10c,null))['then'](removeEntity(_0x2ef10c,null))[_0xe81b('0x46')](handleError(_0x2ef10c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 73e4d16..7412cdd 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x3192f2,_0x48a13c){var _0x5e208d=function(_0x177c2d){while(--_0x177c2d){_0x3192f2['push'](_0x3192f2['shift']());}};_0x5e208d(++_0x48a13c);}(_0xabce,0x103));var _0xeabc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xabce[_0x3bf83f];return _0x22c4a9;};'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('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 3d6fc98..1471b62 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x13c239,_0x571e56){var _0x23bf2c=function(_0x7f17df){while(--_0x7f17df){_0x13c239['push'](_0x13c239['shift']());}};_0x23bf2c(++_0x571e56);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f1a2,_0x1f7b1c){_0x34f1a2=_0x34f1a2-0x0;var _0x2572b9=_0xb10b[_0x34f1a2];return _0x2572b9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x17daf9,_0x1f01de){var _0x264e3b=function(_0x421a2e){while(--_0x421a2e){_0x17daf9['push'](_0x17daf9['shift']());}};_0x264e3b(++_0x1f01de);}(_0xb10b,0x12a));var _0xbb10=function(_0x580f33,_0x4d524d){_0x580f33=_0x580f33-0x0;var _0x4f9e76=_0xb10b[_0x580f33];return _0x4f9e76;};'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 47a8e1b..3adbf9d 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 _0xf72b=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','join','root','server/files/plugins','originalname','replace','%s-%s%s','now','extname','post','single','upload','webhookPost','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf72b,0x1d9));var _0xbf72=function(_0x1c7f40,_0xd566bc){_0x1c7f40=_0x1c7f40-0x0;var _0x2f2890=_0xf72b[_0x1c7f40];return _0x2f2890;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller['show']);router[_0xbf72('0x8')]('/:id/download',auth[_0xbf72('0x9')](),controller[_0xbf72('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xaec095,_0x1c3453,_0x1853eb){_0x1853eb(null,path[_0xbf72('0xe')](config[_0xbf72('0xf')],_0xbf72('0x10')));},'filename':function(_0x14f6e6,_0x5eb4cc,_0x5967f5){_0x5eb4cc[_0xbf72('0x11')]=_0x5eb4cc[_0xbf72('0x11')][_0xbf72('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5967f5(null,util['format'](_0xbf72('0x13'),path['basename'](_0x5eb4cc['originalname'],path['extname'](_0x5eb4cc[_0xbf72('0x11')])),Date[_0xbf72('0x14')](),path[_0xbf72('0x15')](_0x5eb4cc[_0xbf72('0x11')])));}})});router[_0xbf72('0x16')]('/',upload[_0xbf72('0x17')]('file'),controller[_0xbf72('0x18')]);router[_0xbf72('0x16')](_0xbf72('0xa'),controller[_0xbf72('0x19')]);router[_0xbf72('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xbf72('0x1b')]);router[_0xbf72('0x1c')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1c')]);module[_0xbf72('0x1d')]=router; \ No newline at end of file +var _0xed1f=['basename','originalname','now','extname','single','upload','post','webhookPost','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','diskStorage','server/files/plugins','replace','format'];(function(_0x441fef,_0x1fb659){var _0x381681=function(_0x10a60c){while(--_0x10a60c){_0x441fef['push'](_0x441fef['shift']());}};_0x381681(++_0x1fb659);}(_0xed1f,0x6a));var _0xfed1=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xed1f[_0x5a9c0c];return _0x53c77d;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),controller[_0xfed1('0xf')]);router[_0xfed1('0xb')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x10')]);router['get'](_0xfed1('0x11'),auth[_0xfed1('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xfed1('0x12')]({'destination':function(_0x48c338,_0x1c3f40,_0x234f4e){_0x234f4e(null,path['join'](config['root'],_0xfed1('0x13')));},'filename':function(_0xe84ba6,_0x569a6e,_0x17f4fe){_0x569a6e['originalname']=_0x569a6e['originalname'][_0xfed1('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17f4fe(null,util[_0xfed1('0x15')]('%s-%s%s',path[_0xfed1('0x16')](_0x569a6e['originalname'],path['extname'](_0x569a6e[_0xfed1('0x17')])),Date[_0xfed1('0x18')](),path[_0xfed1('0x19')](_0x569a6e[_0xfed1('0x17')])));}})});router['post']('/',upload[_0xfed1('0x1a')]('file'),controller[_0xfed1('0x1b')]);router[_0xfed1('0x1c')]('/webhook',controller[_0xfed1('0x1d')]);router[_0xfed1('0x1e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfed1('0x1f')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e11d837..3c657e7 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 _0x6b2e=['sequelize','exports','STRING','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x4d1cf3,_0x29734c){var _0x560ac1=function(_0x57c88b){while(--_0x57c88b){_0x4d1cf3['push'](_0x4d1cf3['shift']());}};_0x560ac1(++_0x29734c);}(_0x6b2e,0xe4));var _0xe6b2=function(_0x2bdcfd,_0x3c120d){_0x2bdcfd=_0x2bdcfd-0x0;var _0xbc061b=_0x6b2e[_0x2bdcfd];return _0xbc061b;};'use strict';var Sequelize=require(_0xe6b2('0x0'));module[_0xe6b2('0x1')]={'name':{'type':Sequelize[_0xe6b2('0x2')]},'type':{'type':Sequelize['ENUM'](_0xe6b2('0x3'),'script')},'description':{'type':Sequelize[_0xe6b2('0x4')]},'version':{'type':Sequelize[_0xe6b2('0x4')]},'path':{'type':Sequelize[_0xe6b2('0x2')],'comment':_0xe6b2('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe6b2('0x6')},'sidebar':{'type':Sequelize[_0xe6b2('0x7')]('adminOnly',_0xe6b2('0x8'),_0xe6b2('0x9'),_0xe6b2('0xa')),'defaultValue':'always','comment':_0xe6b2('0xb')},'icon':{'type':Sequelize[_0xe6b2('0x2')]},'adminUrl':{'type':Sequelize[_0xe6b2('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xe6b2('0x2')]},'scriptPath':{'type':Sequelize[_0xe6b2('0x2')]}}; \ No newline at end of file +var _0x7a4e=['sequelize','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always'];(function(_0x37b82c,_0x4e2526){var _0x31dbb9=function(_0x4b9fb7){while(--_0x4b9fb7){_0x37b82c['push'](_0x37b82c['shift']());}};_0x31dbb9(++_0x4e2526);}(_0x7a4e,0x15e));var _0xe7a4=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x7a4e[_0x40b2ed];return _0x18397d;};'use strict';var Sequelize=require(_0xe7a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe7a4('0x1')]},'type':{'type':Sequelize[_0xe7a4('0x2')]('html',_0xe7a4('0x3'))},'description':{'type':Sequelize[_0xe7a4('0x4')]},'version':{'type':Sequelize[_0xe7a4('0x4')]},'path':{'type':Sequelize[_0xe7a4('0x1')],'comment':_0xe7a4('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe7a4('0x6')},'sidebar':{'type':Sequelize[_0xe7a4('0x2')](_0xe7a4('0x7'),_0xe7a4('0x8'),_0xe7a4('0x9'),'never'),'defaultValue':_0xe7a4('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xe7a4('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xe7a4('0x1')]},'scriptName':{'type':Sequelize[_0xe7a4('0x1')]},'scriptPath':{'type':Sequelize[_0xe7a4('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 12a1d8b..29ca544 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 _0xa120=['Warning:\x20admin\x20view\x20not\x20specified','plugins','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','delete','resolve','port','hostname','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','%s%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','includeAll','find','catch','download','path','join','root','server/files/plugins','format','basename','createWriteStream','zip','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','unlinkSync','info','Download\x20completed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','version','test'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa120,0x174));var _0x0a12=function(_0x2126d2,_0x5fc437){_0x2126d2=_0x2126d2-0x0;var _0x2d7bbd=_0xa120[_0x2126d2];return _0x2d7bbd;};'use strict';var emlformat=require(_0x0a12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a12('0x1'));var jsonpatch=require(_0x0a12('0x2'));var rp=require('request-promise');var moment=require(_0x0a12('0x3'));var BPromise=require(_0x0a12('0x4'));var Mustache=require(_0x0a12('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0a12('0x6'));var csv=require('to-csv');var ejs=require(_0x0a12('0x7'));var fs=require('fs');var fs_extra=require(_0x0a12('0x8'));var _=require('lodash');var squel=require(_0x0a12('0x9'));var crypto=require('crypto');var jsforce=require(_0x0a12('0xa'));var deskjs=require(_0x0a12('0xb'));var toCsv=require(_0x0a12('0xc'));var querystring=require('querystring');var Papa=require(_0x0a12('0xd'));var extract=require(_0x0a12('0xe'));var rimraf=require(_0x0a12('0xf'));var archiver=require(_0x0a12('0x10'));var Redis=require('ioredis');var authService=require(_0x0a12('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0a12('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0a12('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0a12('0x14'))['db'];config['redis']=_[_0x0a12('0x15')](config[_0x0a12('0x16')],{'host':_0x0a12('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a12('0x18'))[_0x0a12('0x19')](socket);function respondWithStatusCode(_0x480659,_0x85bffc){_0x85bffc=_0x85bffc||0xcc;return function(_0x447daf){if(_0x447daf){return _0x480659[_0x0a12('0x1a')](_0x85bffc);}return _0x480659[_0x0a12('0x1b')](_0x85bffc)[_0x0a12('0x1c')]();};}function respondWithResult(_0x3ccc2b,_0x2bd561){_0x2bd561=_0x2bd561||0xc8;return function(_0x80ff51){if(_0x80ff51){return _0x3ccc2b[_0x0a12('0x1b')](_0x2bd561)['json'](_0x80ff51);}};}function respondWithFilteredResult(_0x3c122b,_0x194738){return function(_0xa7c50b){if(_0xa7c50b){var _0x3c728e=typeof _0x194738[_0x0a12('0x1d')]===_0x0a12('0x1e')&&typeof _0x194738[_0x0a12('0x1f')]==='undefined';var _0x551172=_0xa7c50b[_0x0a12('0x20')];var _0x25ea44=_0x3c728e?0x0:_0x194738['offset'];var _0xef5be0=_0x3c728e?_0xa7c50b['count']:_0x194738[_0x0a12('0x1d')]+_0x194738[_0x0a12('0x1f')];var _0x10119c;if(_0xef5be0>=_0x551172){_0xef5be0=_0x551172;_0x10119c=0xc8;}else{_0x10119c=0xce;}_0x3c122b[_0x0a12('0x1b')](_0x10119c);return _0x3c122b[_0x0a12('0x21')]('Content-Range',_0x25ea44+'-'+_0xef5be0+'/'+_0x551172)[_0x0a12('0x22')](_0xa7c50b);}return null;};}function patchUpdates(_0x57b662){return function(_0x35d707){try{jsonpatch[_0x0a12('0x23')](_0x35d707,_0x57b662,!![]);}catch(_0x3043f4){return BPromise[_0x0a12('0x24')](_0x3043f4);}return _0x35d707[_0x0a12('0x25')]();};}function saveUpdates(_0x5a032f,_0x2013fa){return function(_0x403b46){if(_0x403b46){return _0x403b46[_0x0a12('0x26')](_0x5a032f)[_0x0a12('0x27')](function(_0x330364){return _0x330364;});}return null;};}function removeEntity(_0x2b876e,_0x9b9807){return function(_0x158d22){if(_0x158d22){return _0x158d22['destroy']()[_0x0a12('0x27')](function(){var _0x2ff965=_0x158d22[_0x0a12('0x28')]({'plain':!![]});var _0x5b5716='Plugins';return db[_0x0a12('0x29')][_0x0a12('0x2a')]({'where':{'type':_0x5b5716,'resourceId':_0x2ff965['id']}})['then'](function(){return _0x158d22;});})[_0x0a12('0x27')](function(){_0x2b876e[_0x0a12('0x1b')](0xcc)[_0x0a12('0x1c')]();});}};}function handleEntityNotFound(_0x268b99,_0x520ff2){return function(_0x553552){if(!_0x553552){_0x268b99[_0x0a12('0x1a')](0x194);}return _0x553552;};}function handleError(_0x391b3e,_0x4ed0c5){_0x4ed0c5=_0x4ed0c5||0x1f4;return function(_0x1eef77){logger[_0x0a12('0x2b')](_0x1eef77[_0x0a12('0x2c')]);if(_0x1eef77[_0x0a12('0x2d')]){delete _0x1eef77[_0x0a12('0x2d')];}_0x391b3e[_0x0a12('0x1b')](_0x4ed0c5)['send'](_0x1eef77);};}exports[_0x0a12('0x2e')]=function(_0x3b664d,_0x15d545){var _0x3954ad={},_0x3b3d52={},_0x5919a2={'count':0x0,'rows':[]};var _0xc14c86=_[_0x0a12('0x2f')](db[_0x0a12('0x30')][_0x0a12('0x31')],function(_0x5ec439){return{'name':_0x5ec439[_0x0a12('0x32')],'type':_0x5ec439[_0x0a12('0x33')][_0x0a12('0x34')]};});_0x3b3d52[_0x0a12('0x35')]=_[_0x0a12('0x2f')](_0xc14c86,'name');_0x3b3d52['query']=_[_0x0a12('0x36')](_0x3b664d[_0x0a12('0x37')]);_0x3b3d52['filters']=_['intersection'](_0x3b3d52['model'],_0x3b3d52[_0x0a12('0x37')]);_0x3954ad[_0x0a12('0x38')]=_[_0x0a12('0x39')](_0x3b3d52[_0x0a12('0x35')],qs[_0x0a12('0x3a')](_0x3b664d[_0x0a12('0x37')]['fields']));_0x3954ad['attributes']=_0x3954ad[_0x0a12('0x38')][_0x0a12('0x3b')]?_0x3954ad[_0x0a12('0x38')]:_0x3b3d52[_0x0a12('0x35')];if(!_0x3b664d['query'][_0x0a12('0x3c')]('nolimit')){_0x3954ad[_0x0a12('0x1f')]=qs[_0x0a12('0x1f')](_0x3b664d[_0x0a12('0x37')]['limit']);_0x3954ad[_0x0a12('0x1d')]=qs[_0x0a12('0x1d')](_0x3b664d[_0x0a12('0x37')]['offset']);}_0x3954ad[_0x0a12('0x3d')]=qs[_0x0a12('0x3e')](_0x3b664d[_0x0a12('0x37')][_0x0a12('0x3e')]);_0x3954ad[_0x0a12('0x3f')]=qs[_0x0a12('0x40')](_[_0x0a12('0x41')](_0x3b664d[_0x0a12('0x37')],_0x3b3d52[_0x0a12('0x40')]),_0xc14c86);if(_0x3b664d[_0x0a12('0x37')]['filter']){_0x3954ad[_0x0a12('0x3f')]=_['merge'](_0x3954ad[_0x0a12('0x3f')],{'$or':_[_0x0a12('0x2f')](_0xc14c86,function(_0x35bb02){if(_0x35bb02['type']!==_0x0a12('0x42')){var _0x1cae04={};_0x1cae04[_0x35bb02[_0x0a12('0x2d')]]={'$like':'%'+_0x3b664d[_0x0a12('0x37')][_0x0a12('0x43')]+'%'};return _0x1cae04;}})});}_0x3954ad=_[_0x0a12('0x44')]({},_0x3954ad,_0x3b664d[_0x0a12('0x45')]);var _0x1efa3d={'where':_0x3954ad['where']};return db[_0x0a12('0x30')][_0x0a12('0x20')](_0x1efa3d)[_0x0a12('0x27')](function(_0x1680d5){_0x5919a2['count']=_0x1680d5;if(_0x3b664d[_0x0a12('0x37')]['includeAll']){_0x3954ad[_0x0a12('0x46')]=[{'all':!![]}];}return db['Plugin'][_0x0a12('0x47')](_0x3954ad);})[_0x0a12('0x27')](function(_0xf57f90){_0x5919a2[_0x0a12('0x48')]=_0xf57f90;return _0x5919a2;})[_0x0a12('0x27')](respondWithFilteredResult(_0x15d545,_0x3954ad))['catch'](handleError(_0x15d545,null));};exports[_0x0a12('0x49')]=function(_0x17e0aa,_0x6b4e93){var _0x2a3b18={'raw':!![],'where':{'id':_0x17e0aa[_0x0a12('0x4a')]['id']}},_0x534ebf={};_0x534ebf[_0x0a12('0x35')]=_[_0x0a12('0x36')](db[_0x0a12('0x30')][_0x0a12('0x31')]);_0x534ebf[_0x0a12('0x37')]=_[_0x0a12('0x36')](_0x17e0aa[_0x0a12('0x37')]);_0x534ebf['filters']=_[_0x0a12('0x39')](_0x534ebf[_0x0a12('0x35')],_0x534ebf[_0x0a12('0x37')]);_0x2a3b18[_0x0a12('0x38')]=_[_0x0a12('0x39')](_0x534ebf['model'],qs[_0x0a12('0x3a')](_0x17e0aa[_0x0a12('0x37')][_0x0a12('0x3a')]));_0x2a3b18[_0x0a12('0x38')]=_0x2a3b18['attributes']['length']?_0x2a3b18['attributes']:_0x534ebf[_0x0a12('0x35')];if(_0x17e0aa[_0x0a12('0x37')][_0x0a12('0x4b')]){_0x2a3b18[_0x0a12('0x46')]=[{'all':!![]}];}_0x2a3b18=_[_0x0a12('0x44')]({},_0x2a3b18,_0x17e0aa['options']);return db[_0x0a12('0x30')][_0x0a12('0x4c')](_0x2a3b18)['then'](handleEntityNotFound(_0x6b4e93,null))[_0x0a12('0x27')](respondWithResult(_0x6b4e93,null))[_0x0a12('0x4d')](handleError(_0x6b4e93,null));};exports[_0x0a12('0x4e')]=function(_0x1286fa,_0x568dc6,_0x3c5a1b){return db[_0x0a12('0x30')][_0x0a12('0x4c')]({'where':{'id':_0x1286fa[_0x0a12('0x4a')]['id']},'attributes':[_0x0a12('0x2d'),_0x0a12('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x568dc6,null))[_0x0a12('0x27')](function(_0x91aa44){if(_0x91aa44){var _0x78d293=path[_0x0a12('0x50')](config[_0x0a12('0x51')],_0x0a12('0x52'),util[_0x0a12('0x53')]('%s.zip',path[_0x0a12('0x54')](_0x91aa44['path'])));var _0x2bb426=fs[_0x0a12('0x55')](_0x78d293);var _0x3de697=archiver(_0x0a12('0x56'),{'zlib':{'level':0x9}});_0x3de697['on']('warning',function(_0x32f5f8){if(_0x32f5f8[_0x0a12('0x57')]==='ENOENT'){logger['error'](_0x32f5f8);}else{throw new db['Sequelize'][(_0x0a12('0x58'))](_0x0a12('0x59'));}});_0x3de697['on'](_0x0a12('0x2b'),function(_0x3164a0){throw new db[(_0x0a12('0x5a'))][(_0x0a12('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3de697[_0x0a12('0x5b')](_0x2bb426);_0x3de697[_0x0a12('0x5c')](_0x0a12('0x5d'),{'cwd':path[_0x0a12('0x50')](config[_0x0a12('0x51')],'server/files/plugins',path[_0x0a12('0x5e')](_0x91aa44[_0x0a12('0x4f')])),'ignore':[path['join'](path['basename'](_0x91aa44[_0x0a12('0x4f')]),_0x0a12('0x5f')),path[_0x0a12('0x50')](path['basename'](_0x91aa44[_0x0a12('0x4f')]),_0x0a12('0x60'))],'nodir':!![]})[_0x0a12('0x61')]();_0x2bb426['on'](_0x0a12('0x62'),function(){if(!fs[_0x0a12('0x63')](_0x78d293)){throw new db[(_0x0a12('0x5a'))][(_0x0a12('0x58'))]('Plugin\x20not\x20found');}return _0x568dc6[_0x0a12('0x4e')](_0x78d293,util[_0x0a12('0x53')](_0x0a12('0x64'),path['basename'](_0x91aa44[_0x0a12('0x4f')])),function(_0x310978){if(_0x310978){throw new db['Sequelize'][(_0x0a12('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x0a12('0x65')](_0x78d293);logger[_0x0a12('0x66')](_0x0a12('0x67'));logger[_0x0a12('0x66')]('Temporary\x20file\x20removed');});});}return null;})[_0x0a12('0x4d')](handleError(_0x568dc6,null));};exports[_0x0a12('0x68')]=function(_0x404d06,_0x3559d8,_0x55743a){var _0x47f0ef=path[_0x0a12('0x54')](_0x404d06[_0x0a12('0x69')]['filename'],path[_0x0a12('0x6a')](_0x404d06[_0x0a12('0x69')][_0x0a12('0x6b')]));var _0x511ff2=path[_0x0a12('0x50')](config[_0x0a12('0x51')],_0x0a12('0x52'),_0x404d06['file'][_0x0a12('0x6b')]);var _0x41a9f2=path['join'](config[_0x0a12('0x51')],_0x0a12('0x52'),_0x47f0ef);logger[_0x0a12('0x66')](_0x0a12('0x6c'),_0x511ff2);logger[_0x0a12('0x66')](_0x0a12('0x6d'),_0x41a9f2);try{fs[_0x0a12('0x6e')](_0x511ff2,parseInt('0777',0x8));extract(_0x511ff2,{'dir':_0x41a9f2},function(_0x422862){if(_0x422862){logger[_0x0a12('0x2b')](_0x422862);handleError(_0x422862,!![]);};var _0x588388=fs[_0x0a12('0x6f')](_0x41a9f2);if(_0x588388[_0x0a12('0x3b')]>0x1){removeReferences(_0x511ff2,_0x41a9f2);logger['error'](_0x0a12('0x70'));return _0x55743a(new Error('Invalid\x20plugin\x20structure'));}var _0x4e3cea=fs['lstatSync'](path['join'](_0x41a9f2,_0x588388[0x0]));if(_0x4e3cea['isFile']()){removeReferences(_0x511ff2,_0x41a9f2);logger[_0x0a12('0x2b')](_0x0a12('0x70'));return _0x55743a(new Error('Invalid\x20plugin\x20structure'));}if(_0x4e3cea[_0x0a12('0x71')]()){var _0x120fd1=fs[_0x0a12('0x6f')](path[_0x0a12('0x50')](_0x41a9f2,_0x588388[0x0]));if(_0x120fd1['length']===0x0){removeReferences(_0x511ff2,_0x41a9f2);logger['error'](_0x0a12('0x70'));return _0x55743a(new Error('Invalid\x20plugin\x20structure'));}var _0x21882f=_0x120fd1[_0x0a12('0x72')](function(_0x465d48){return _0x465d48===_0x0a12('0x73');});if(!_0x21882f){return _0x55743a(new Error('Plugin\x20manifest\x20missing'));}var _0x27abe0=fs[_0x0a12('0x74')](path['join'](_0x41a9f2,_0x588388[0x0],_0x0a12('0x73')));var _0x3acb73=JSON[_0x0a12('0x75')](_0x27abe0);if('undefined'==typeof _0x3acb73['name']){return _0x55743a(new Error(_0x0a12('0x76')));}if(_0x0a12('0x1e')==typeof _0x3acb73[_0x0a12('0x33')]){return _0x55743a(new Error(_0x0a12('0x77')));}if(_0x0a12('0x1e')==typeof _0x3acb73['version']){return _0x55743a(new Error(_0x0a12('0x78')));}if(_0x0a12('0x1e')==typeof _0x3acb73[_0x0a12('0x79')]){return _0x55743a(new Error(_0x0a12('0x7a')));}if(_0x3acb73['type']===_0x0a12('0x7b')){if('undefined'==typeof _0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')]){return _0x55743a(new Error(_0x0a12('0x7d')));}if(_0x0a12('0x1e')==typeof _0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')][_0x0a12('0x7e')]&&_0x0a12('0x1e')==typeof _0x3acb73['parameters']['views'][_0x0a12('0x7f')]){return _0x55743a(new Error(_0x0a12('0x80')));}}else if(_0x3acb73[_0x0a12('0x33')]===_0x0a12('0x81')){if(_0x0a12('0x1e')==typeof _0x3acb73['parameters'][_0x0a12('0x82')]){return _0x55743a(new Error(_0x0a12('0x83')));}if(_0x0a12('0x1e')==typeof _0x3acb73['parameters'][_0x0a12('0x84')]){return _0x55743a(new Error(_0x0a12('0x85')));}}else{return _0x55743a(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2e4c60=_0x3acb73[_0x0a12('0x2d')];var _0x1ab2b9=_0x3acb73[_0x0a12('0x86')];var _0x5bc75b=_0x3acb73[_0x0a12('0x33')];var _0xefac4c=_0x3acb73[_0x0a12('0x87')]?_0x3acb73[_0x0a12('0x87')]:_0x0a12('0x88');var _0x3b6f5a=_0x3acb73[_0x0a12('0x89')]?_0x3acb73[_0x0a12('0x89')]:_0x0a12('0x8a');var _0x22fb90='';var _0x63bc14='';var _0x5f46e2='';var _0x1f57ea='';var _0x1ae1db=_0x3acb73[_0x0a12('0x8b')];if(_0x5bc75b===_0x0a12('0x7b')){if(_0x0a12('0x1e')!=typeof _0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')][_0x0a12('0x7e')]){var _0x468c96=_0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')][_0x0a12('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x0a12('0x8c')](_0x468c96)){_0x22fb90=path['join']('plugins',_0x47f0ef,_0x588388[0x0],_0x468c96);}else{_0x22fb90=_0x468c96;}}else{logger[_0x0a12('0x66')](_0x0a12('0x8d'));}if(_0x0a12('0x1e')!=typeof _0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')]['agent']){var _0x49b7d3=_0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0a12('0x8c')](_0x49b7d3)){_0x63bc14=path[_0x0a12('0x50')](_0x0a12('0x8e'),_0x47f0ef,_0x588388[0x0],_0x49b7d3);}else{_0x63bc14=_0x49b7d3;}}else{logger[_0x0a12('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5bc75b==='script'){_0x5f46e2=_0x3acb73[_0x0a12('0x79')][_0x0a12('0x82')];_0x1f57ea=_0x3acb73[_0x0a12('0x79')][_0x0a12('0x84')];if('undefined'!=typeof _0x3acb73['parameters'][_0x0a12('0x7c')]){if(_0x0a12('0x1e')!=typeof _0x3acb73['parameters'][_0x0a12('0x7c')][_0x0a12('0x7e')]){var _0x468c96=_0x3acb73[_0x0a12('0x79')]['views'][_0x0a12('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x468c96)){_0x22fb90=path[_0x0a12('0x50')](_0x0a12('0x8e'),_0x47f0ef,_0x588388[0x0],_0x468c96);}else{_0x22fb90=_0x468c96;}}if(_0x0a12('0x1e')!=typeof _0x3acb73[_0x0a12('0x79')][_0x0a12('0x7c')][_0x0a12('0x7f')]){var _0x49b7d3=_0x3acb73[_0x0a12('0x79')]['views'][_0x0a12('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x0a12('0x8c')](_0x49b7d3)){_0x63bc14=path[_0x0a12('0x50')](_0x0a12('0x8e'),_0x47f0ef,_0x588388[0x0],_0x49b7d3);}else{_0x63bc14=_0x49b7d3;}}}}var _0x482385={'name':_0x2e4c60,'description':_0x1ab2b9,'path':path['join'](_0x47f0ef,_0x588388[0x0]),'type':_0x5bc75b,'sidebar':_0xefac4c,'icon':_0x3b6f5a,'adminUrl':_0x22fb90,'agentUrl':_0x63bc14,'scriptName':_0x5f46e2,'scriptPath':_0x1f57ea,'version':_0x1ae1db};removeReferences(_0x511ff2,null);return db[_0x0a12('0x30')][_0x0a12('0x8f')](_0x482385)['then'](function(_0x19fb46){var _0x3bcad8={'role':_0x404d06[_0x0a12('0x90')][_0x0a12('0x91')],'userProfileId':_0x404d06['body']['userProfileId']};if(!_0x3bcad8)throw new Error(_0x0a12('0x92'));if(_0x3bcad8['role']===_0x0a12('0x93')){var _0x3c1604=_0x19fb46[_0x0a12('0x28')]({'plain':!![]});return db[_0x0a12('0x94')]['find']({'where':{'name':_0x0a12('0x95'),'userProfileId':_0x3bcad8[_0x0a12('0x96')]},'raw':!![]})['then'](function(_0x583535){if(_0x583535&&_0x583535[_0x0a12('0x97')]===0x0){return db[_0x0a12('0x29')][_0x0a12('0x8f')]({'name':_0x3c1604[_0x0a12('0x2d')],'resourceId':_0x3c1604['id'],'type':_0x583535[_0x0a12('0x2d')],'sectionId':_0x583535['id']},{})[_0x0a12('0x27')](function(){return _0x19fb46;});}else{return _0x19fb46;}})['catch'](function(_0x49dc17){logger[_0x0a12('0x2b')](_0x0a12('0x98'),_0x49dc17);throw _0x49dc17;});}return _0x19fb46;})['then'](respondWithResult(_0x3559d8,null))[_0x0a12('0x4d')](handleError(_0x3559d8,null));}});}catch(_0x2f3fb1){_0x3559d8['status'](0x1f4)[_0x0a12('0x99')](_0x2f3fb1);}};function removeReferences(_0x365578,_0x26bf23){try{if(_0x365578){fs[_0x0a12('0x65')](_0x365578);logger[_0x0a12('0x66')](_0x0a12('0x9a'));}if(_0x26bf23){rimraf(_0x26bf23,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x460c78){logger[_0x0a12('0x2b')](_0x460c78);}}exports[_0x0a12('0x26')]=function(_0x11fcab,_0x519702,_0x5c09d8){return db[_0x0a12('0x30')][_0x0a12('0x4c')]({'where':{'id':_0x11fcab[_0x0a12('0x4a')]['id']}})[_0x0a12('0x27')](handleEntityNotFound(_0x519702,null))['then'](saveUpdates(_0x11fcab[_0x0a12('0x90')],null))[_0x0a12('0x27')](respondWithResult(_0x519702,null))[_0x0a12('0x4d')](handleError(_0x519702,null));};exports[_0x0a12('0x9b')]=function(_0x31581c,_0x2cb525,_0x55816a){return db[_0x0a12('0x30')][_0x0a12('0x4c')]({'where':{'id':_0x31581c[_0x0a12('0x4a')]['id']}})[_0x0a12('0x27')](function(_0x42286c){if(_0x42286c){return _0x42286c[_0x0a12('0x2a')]();}})[_0x0a12('0x27')](function(_0x2a1683){rimraf(path['join'](config[_0x0a12('0x51')],_0x0a12('0x52'),path[_0x0a12('0x5e')](_0x2a1683[_0x0a12('0x4f')])),function(){});return _0x2a1683;})['then'](handleEntityNotFound(_0x2cb525,null))['then'](respondWithStatusCode(_0x2cb525,null))['catch'](handleError(_0x2cb525,null));};exports['webhookGet']=function(_0x21f0ba,_0x5479e2,_0x49e52b){return BPromise[_0x0a12('0x9c')]()[_0x0a12('0x27')](function(){if(!_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x21f0ba['query'][_0x0a12('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x51d3ce=_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x9e')]?_0x21f0ba[_0x0a12('0x37')]['hostname']+':'+_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x9d')]:'http://localhost:'+_0x21f0ba['query'][_0x0a12('0x9d')];var _0x135963=_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x22')]?_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x22')]:!![];var _0xc61fde=_0x21f0ba[_0x0a12('0x37')]['encoding']?_0x21f0ba['query'][_0x0a12('0x9f')]:null;var _0x31cccb={'method':_0x21f0ba[_0x0a12('0xa0')],'uri':util[_0x0a12('0x53')]('%s%s',_0x51d3ce,_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x4f')]),'json':_0x135963,'resolveWithFullResponse':!![],'encoding':_0xc61fde,'qs':_0x21f0ba[_0x0a12('0x37')]};if(_0x21f0ba[_0x0a12('0xa1')]){_0x31cccb['headers']=_0x21f0ba['headers'];if(_0x31cccb[_0x0a12('0xa1')][_0x0a12('0xa2')]){delete _0x31cccb[_0x0a12('0xa1')][_0x0a12('0xa2')];}}if(_0x31cccb[_0x0a12('0xa1')][_0x0a12('0xa3')]){delete _0x31cccb[_0x0a12('0xa1')][_0x0a12('0xa3')];}return rp(_0x31cccb);})[_0x0a12('0x27')](function(_0x311611){if(_0x311611){_0x5479e2['set'](_0x311611[_0x0a12('0xa1')]);logger[_0x0a12('0x66')](_0x311611[_0x0a12('0x90')]);if(_[_0x0a12('0xa4')](_0x21f0ba[_0x0a12('0x37')][_0x0a12('0x4f')],_0x0a12('0x4e'))&&_0x311611[_0x0a12('0xa5')]==0x1f4){return _0x5479e2['sendStatus'](_0x311611[_0x0a12('0xa5')]);}else{return _0x5479e2[_0x0a12('0x1b')](_0x311611[_0x0a12('0xa5')])['send'](_0x311611[_0x0a12('0x90')]);}}else{return _0x5479e2['sendStatus'](0xc8);}})['catch'](handleError(_0x5479e2,null));};exports[_0x0a12('0xa6')]=function(_0x15721b,_0x2e885d,_0x2a1ba2){return BPromise[_0x0a12('0x9c')]()['then'](function(){if(!_0x15721b[_0x0a12('0x37')][_0x0a12('0x4f')]){throw new Error(_0x0a12('0xa7'));}if(!_0x15721b['query'][_0x0a12('0x9d')]){throw new Error(_0x0a12('0xa8'));}var _0x1d754e=_0x15721b[_0x0a12('0x37')]['hostname']?_0x15721b[_0x0a12('0x37')][_0x0a12('0x9e')]+':'+_0x15721b[_0x0a12('0x37')][_0x0a12('0x9d')]:_0x0a12('0xa9')+_0x15721b['query'][_0x0a12('0x9d')];var _0x27e18f=_0x15721b[_0x0a12('0x37')][_0x0a12('0x22')]?_0x15721b[_0x0a12('0x37')][_0x0a12('0x22')]:!![];var _0x17136e=_0x15721b[_0x0a12('0x37')][_0x0a12('0x9f')]?_0x15721b[_0x0a12('0x37')][_0x0a12('0x9f')]:null;var _0x149ee3={'method':_0x15721b[_0x0a12('0xa0')],'uri':util[_0x0a12('0x53')](_0x0a12('0xaa'),_0x1d754e,_0x15721b[_0x0a12('0x37')][_0x0a12('0x4f')]),'json':_0x27e18f,'resolveWithFullResponse':!![],'encoding':_0x17136e,'body':_0x15721b['body']};if(_0x15721b[_0x0a12('0xa1')]){_0x149ee3['headers']=_0x15721b['headers'];if(_0x149ee3['headers'][_0x0a12('0xa2')]){delete _0x149ee3[_0x0a12('0xa1')][_0x0a12('0xa2')];}}if(_0x149ee3[_0x0a12('0xa1')][_0x0a12('0xa3')]){delete _0x149ee3[_0x0a12('0xa1')][_0x0a12('0xa3')];}return rp(_0x149ee3);})[_0x0a12('0x27')](function(_0x195f94){if(_0x195f94){_0x2e885d[_0x0a12('0x21')](_0x195f94[_0x0a12('0xa1')]);logger[_0x0a12('0x66')](_0x195f94[_0x0a12('0x90')]);return _0x2e885d[_0x0a12('0x1b')](_0x195f94[_0x0a12('0xa5')])[_0x0a12('0x99')](_0x195f94[_0x0a12('0x90')]);}else{return _0x2e885d['sendStatus'](0xc8);}})[_0x0a12('0x4d')](handleError(_0x2e885d,null));}; \ No newline at end of file +var _0xbe26=['destroy','then','end','error','name','send','index','map','Plugin','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','show','params','rawAttributes','find','catch','download','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','join','basename','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','dirname','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','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','papaparse','extract-zip','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','get','Plugins','UserProfileResource'];(function(_0x3442f3,_0x404385){var _0x2b3075=function(_0x4d8129){while(--_0x4d8129){_0x3442f3['push'](_0x3442f3['shift']());}};_0x2b3075(++_0x404385);}(_0xbe26,0x1c3));var _0x6be2=function(_0x411c3f,_0x38980c){_0x411c3f=_0x411c3f-0x0;var _0x27e9e6=_0xbe26[_0x411c3f];return _0x27e9e6;};'use strict';var emlformat=require(_0x6be2('0x0'));var rimraf=require(_0x6be2('0x1'));var zipdir=require(_0x6be2('0x2'));var jsonpatch=require(_0x6be2('0x3'));var rp=require(_0x6be2('0x4'));var moment=require(_0x6be2('0x5'));var BPromise=require(_0x6be2('0x6'));var Mustache=require(_0x6be2('0x7'));var util=require(_0x6be2('0x8'));var path=require(_0x6be2('0x9'));var sox=require(_0x6be2('0xa'));var csv=require(_0x6be2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6be2('0xc'));var _=require(_0x6be2('0xd'));var squel=require(_0x6be2('0xe'));var crypto=require(_0x6be2('0xf'));var jsforce=require(_0x6be2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6be2('0xb'));var querystring=require(_0x6be2('0x11'));var Papa=require(_0x6be2('0x12'));var extract=require(_0x6be2('0x13'));var rimraf=require(_0x6be2('0x1'));var archiver=require('archiver');var Redis=require(_0x6be2('0x14'));var authService=require(_0x6be2('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6be2('0x16'));var logger=require(_0x6be2('0x17'))(_0x6be2('0x18'));var utils=require(_0x6be2('0x19'));var config=require(_0x6be2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6be2('0x1b')]=_[_0x6be2('0x1c')](config[_0x6be2('0x1b')],{'host':_0x6be2('0x1d'),'port':0x18eb});var socket=require(_0x6be2('0x1e'))(new Redis(config[_0x6be2('0x1b')]));require(_0x6be2('0x1f'))[_0x6be2('0x20')](socket);function respondWithStatusCode(_0xd346c6,_0x284e86){_0x284e86=_0x284e86||0xcc;return function(_0x261632){if(_0x261632){return _0xd346c6[_0x6be2('0x21')](_0x284e86);}return _0xd346c6[_0x6be2('0x22')](_0x284e86)['end']();};}function respondWithResult(_0x336e16,_0x1a0e92){_0x1a0e92=_0x1a0e92||0xc8;return function(_0x2553ee){if(_0x2553ee){return _0x336e16[_0x6be2('0x22')](_0x1a0e92)[_0x6be2('0x23')](_0x2553ee);}};}function respondWithFilteredResult(_0x242032,_0x3d3476){return function(_0x436bba){if(_0x436bba){var _0x288702=typeof _0x3d3476[_0x6be2('0x24')]===_0x6be2('0x25')&&typeof _0x3d3476[_0x6be2('0x26')]===_0x6be2('0x25');var _0x36a52d=_0x436bba[_0x6be2('0x27')];var _0x195ebc=_0x288702?0x0:_0x3d3476[_0x6be2('0x24')];var _0x669d58=_0x288702?_0x436bba[_0x6be2('0x27')]:_0x3d3476[_0x6be2('0x24')]+_0x3d3476['limit'];var _0x4b9eb4;if(_0x669d58>=_0x36a52d){_0x669d58=_0x36a52d;_0x4b9eb4=0xc8;}else{_0x4b9eb4=0xce;}_0x242032[_0x6be2('0x22')](_0x4b9eb4);return _0x242032[_0x6be2('0x28')]('Content-Range',_0x195ebc+'-'+_0x669d58+'/'+_0x36a52d)[_0x6be2('0x23')](_0x436bba);}return null;};}function patchUpdates(_0x2a416d){return function(_0x551b6f){try{jsonpatch[_0x6be2('0x29')](_0x551b6f,_0x2a416d,!![]);}catch(_0x4d177b){return BPromise['reject'](_0x4d177b);}return _0x551b6f[_0x6be2('0x2a')]();};}function saveUpdates(_0x36bd61,_0x2a5114){return function(_0x1487b7){if(_0x1487b7){return _0x1487b7[_0x6be2('0x2b')](_0x36bd61)['then'](function(_0x1280ba){return _0x1280ba;});}return null;};}function removeEntity(_0x2dabb2,_0x1c9060){return function(_0x261ae6){if(_0x261ae6){return _0x261ae6['destroy']()['then'](function(){var _0x176e23=_0x261ae6[_0x6be2('0x2c')]({'plain':!![]});var _0x9e29e0=_0x6be2('0x2d');return db[_0x6be2('0x2e')][_0x6be2('0x2f')]({'where':{'type':_0x9e29e0,'resourceId':_0x176e23['id']}})[_0x6be2('0x30')](function(){return _0x261ae6;});})[_0x6be2('0x30')](function(){_0x2dabb2[_0x6be2('0x22')](0xcc)[_0x6be2('0x31')]();});}};}function handleEntityNotFound(_0x3c2b69,_0x43bc34){return function(_0x4b56ea){if(!_0x4b56ea){_0x3c2b69[_0x6be2('0x21')](0x194);}return _0x4b56ea;};}function handleError(_0x2bfc70,_0x42d03b){_0x42d03b=_0x42d03b||0x1f4;return function(_0x343386){logger[_0x6be2('0x32')](_0x343386['stack']);if(_0x343386['name']){delete _0x343386[_0x6be2('0x33')];}_0x2bfc70[_0x6be2('0x22')](_0x42d03b)[_0x6be2('0x34')](_0x343386);};}exports[_0x6be2('0x35')]=function(_0x1d0783,_0x2d8555){var _0x2a4700={},_0x5b0ec0={},_0x43f027={'count':0x0,'rows':[]};var _0x1fe5c1=_[_0x6be2('0x36')](db[_0x6be2('0x37')]['rawAttributes'],function(_0x36333e){return{'name':_0x36333e[_0x6be2('0x38')],'type':_0x36333e[_0x6be2('0x39')]['key']};});_0x5b0ec0[_0x6be2('0x3a')]=_[_0x6be2('0x36')](_0x1fe5c1,_0x6be2('0x33'));_0x5b0ec0[_0x6be2('0x3b')]=_[_0x6be2('0x3c')](_0x1d0783['query']);_0x5b0ec0[_0x6be2('0x3d')]=_[_0x6be2('0x3e')](_0x5b0ec0[_0x6be2('0x3a')],_0x5b0ec0[_0x6be2('0x3b')]);_0x2a4700['attributes']=_[_0x6be2('0x3e')](_0x5b0ec0[_0x6be2('0x3a')],qs[_0x6be2('0x3f')](_0x1d0783[_0x6be2('0x3b')]['fields']));_0x2a4700[_0x6be2('0x40')]=_0x2a4700[_0x6be2('0x40')][_0x6be2('0x41')]?_0x2a4700[_0x6be2('0x40')]:_0x5b0ec0[_0x6be2('0x3a')];if(!_0x1d0783[_0x6be2('0x3b')][_0x6be2('0x42')]('nolimit')){_0x2a4700[_0x6be2('0x26')]=qs['limit'](_0x1d0783[_0x6be2('0x3b')][_0x6be2('0x26')]);_0x2a4700[_0x6be2('0x24')]=qs[_0x6be2('0x24')](_0x1d0783['query'][_0x6be2('0x24')]);}_0x2a4700[_0x6be2('0x43')]=qs[_0x6be2('0x44')](_0x1d0783[_0x6be2('0x3b')][_0x6be2('0x44')]);_0x2a4700['where']=qs[_0x6be2('0x3d')](_['pick'](_0x1d0783[_0x6be2('0x3b')],_0x5b0ec0['filters']),_0x1fe5c1);if(_0x1d0783['query'][_0x6be2('0x45')]){_0x2a4700[_0x6be2('0x46')]=_[_0x6be2('0x47')](_0x2a4700[_0x6be2('0x46')],{'$or':_[_0x6be2('0x36')](_0x1fe5c1,function(_0x86d00f){if(_0x86d00f['type']!=='VIRTUAL'){var _0x1715a2={};_0x1715a2[_0x86d00f[_0x6be2('0x33')]]={'$like':'%'+_0x1d0783[_0x6be2('0x3b')][_0x6be2('0x45')]+'%'};return _0x1715a2;}})});}_0x2a4700=_[_0x6be2('0x47')]({},_0x2a4700,_0x1d0783[_0x6be2('0x48')]);var _0x521e36={'where':_0x2a4700[_0x6be2('0x46')]};return db[_0x6be2('0x37')]['count'](_0x521e36)[_0x6be2('0x30')](function(_0x4e0a36){_0x43f027['count']=_0x4e0a36;if(_0x1d0783[_0x6be2('0x3b')][_0x6be2('0x49')]){_0x2a4700[_0x6be2('0x4a')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x2a4700);})[_0x6be2('0x30')](function(_0x294455){_0x43f027['rows']=_0x294455;return _0x43f027;})[_0x6be2('0x30')](respondWithFilteredResult(_0x2d8555,_0x2a4700))['catch'](handleError(_0x2d8555,null));};exports[_0x6be2('0x4b')]=function(_0x8876d2,_0x5422fd){var _0x269749={'raw':!![],'where':{'id':_0x8876d2[_0x6be2('0x4c')]['id']}},_0x26c355={};_0x26c355[_0x6be2('0x3a')]=_[_0x6be2('0x3c')](db[_0x6be2('0x37')][_0x6be2('0x4d')]);_0x26c355['query']=_[_0x6be2('0x3c')](_0x8876d2[_0x6be2('0x3b')]);_0x26c355[_0x6be2('0x3d')]=_[_0x6be2('0x3e')](_0x26c355[_0x6be2('0x3a')],_0x26c355[_0x6be2('0x3b')]);_0x269749[_0x6be2('0x40')]=_[_0x6be2('0x3e')](_0x26c355[_0x6be2('0x3a')],qs[_0x6be2('0x3f')](_0x8876d2[_0x6be2('0x3b')][_0x6be2('0x3f')]));_0x269749[_0x6be2('0x40')]=_0x269749[_0x6be2('0x40')]['length']?_0x269749['attributes']:_0x26c355[_0x6be2('0x3a')];if(_0x8876d2[_0x6be2('0x3b')][_0x6be2('0x49')]){_0x269749[_0x6be2('0x4a')]=[{'all':!![]}];}_0x269749=_[_0x6be2('0x47')]({},_0x269749,_0x8876d2[_0x6be2('0x48')]);return db[_0x6be2('0x37')][_0x6be2('0x4e')](_0x269749)[_0x6be2('0x30')](handleEntityNotFound(_0x5422fd,null))[_0x6be2('0x30')](respondWithResult(_0x5422fd,null))[_0x6be2('0x4f')](handleError(_0x5422fd,null));};exports[_0x6be2('0x50')]=function(_0x40e8dc,_0x218940,_0x371eb0){return db[_0x6be2('0x37')][_0x6be2('0x4e')]({'where':{'id':_0x40e8dc[_0x6be2('0x4c')]['id']},'attributes':['name',_0x6be2('0x9')],'raw':!![]})[_0x6be2('0x30')](handleEntityNotFound(_0x218940,null))[_0x6be2('0x30')](function(_0x56b3b7){if(_0x56b3b7){var _0x1b4fdd=path['join'](config['root'],_0x6be2('0x51'),util[_0x6be2('0x52')](_0x6be2('0x53'),path['basename'](_0x56b3b7[_0x6be2('0x9')])));var _0x130ca1=fs[_0x6be2('0x54')](_0x1b4fdd);var _0x3ffeab=archiver(_0x6be2('0x55'),{'zlib':{'level':0x9}});_0x3ffeab['on'](_0x6be2('0x56'),function(_0x5ea5ed){if(_0x5ea5ed[_0x6be2('0x57')]===_0x6be2('0x58')){logger[_0x6be2('0x32')](_0x5ea5ed);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3ffeab['on'](_0x6be2('0x32'),function(_0x4f4dbc){throw new db[(_0x6be2('0x59'))][(_0x6be2('0x5a'))](_0x6be2('0x5b'));});_0x3ffeab[_0x6be2('0x5c')](_0x130ca1);_0x3ffeab[_0x6be2('0x5d')]('**/*',{'cwd':path['join'](config[_0x6be2('0x5e')],_0x6be2('0x51'),path['dirname'](_0x56b3b7['path'])),'ignore':[path[_0x6be2('0x5f')](path[_0x6be2('0x60')](_0x56b3b7[_0x6be2('0x9')]),_0x6be2('0x61')),path[_0x6be2('0x5f')](path[_0x6be2('0x60')](_0x56b3b7['path']),_0x6be2('0x62'))],'nodir':!![]})['finalize']();_0x130ca1['on'](_0x6be2('0x63'),function(){if(!fs[_0x6be2('0x64')](_0x1b4fdd)){throw new db[(_0x6be2('0x59'))][(_0x6be2('0x5a'))](_0x6be2('0x65'));}return _0x218940['download'](_0x1b4fdd,util[_0x6be2('0x52')](_0x6be2('0x53'),path[_0x6be2('0x60')](_0x56b3b7[_0x6be2('0x9')])),function(_0x57121f){if(_0x57121f){throw new db[(_0x6be2('0x59'))][(_0x6be2('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6be2('0x66')](_0x1b4fdd);logger[_0x6be2('0x67')](_0x6be2('0x68'));logger[_0x6be2('0x67')](_0x6be2('0x69'));});});}return null;})[_0x6be2('0x4f')](handleError(_0x218940,null));};exports[_0x6be2('0x6a')]=function(_0x54aa9e,_0x69635a,_0x3a22e8){var _0x3decbc=path['basename'](_0x54aa9e[_0x6be2('0x6b')][_0x6be2('0x6c')],path['extname'](_0x54aa9e[_0x6be2('0x6b')][_0x6be2('0x6c')]));var _0x37123a=path[_0x6be2('0x5f')](config[_0x6be2('0x5e')],_0x6be2('0x51'),_0x54aa9e[_0x6be2('0x6b')][_0x6be2('0x6c')]);var _0x5acfc1=path[_0x6be2('0x5f')](config['root'],_0x6be2('0x51'),_0x3decbc);logger[_0x6be2('0x67')](_0x6be2('0x6d'),_0x37123a);logger['info'](_0x6be2('0x6e'),_0x5acfc1);try{fs['chmodSync'](_0x37123a,parseInt(_0x6be2('0x6f'),0x8));extract(_0x37123a,{'dir':_0x5acfc1},function(_0x492b33){if(_0x492b33){logger[_0x6be2('0x32')](_0x492b33);handleError(_0x492b33,!![]);};var _0x1613be=fs[_0x6be2('0x70')](_0x5acfc1);if(_0x1613be[_0x6be2('0x41')]>0x1){removeReferences(_0x37123a,_0x5acfc1);logger['error'](_0x6be2('0x71'));return _0x3a22e8(new Error(_0x6be2('0x71')));}var _0x4d1572=fs[_0x6be2('0x72')](path['join'](_0x5acfc1,_0x1613be[0x0]));if(_0x4d1572[_0x6be2('0x73')]()){removeReferences(_0x37123a,_0x5acfc1);logger[_0x6be2('0x32')]('Invalid\x20plugin\x20structure');return _0x3a22e8(new Error(_0x6be2('0x71')));}if(_0x4d1572[_0x6be2('0x74')]()){var _0x3585fa=fs['readdirSync'](path['join'](_0x5acfc1,_0x1613be[0x0]));if(_0x3585fa['length']===0x0){removeReferences(_0x37123a,_0x5acfc1);logger[_0x6be2('0x32')](_0x6be2('0x71'));return _0x3a22e8(new Error(_0x6be2('0x71')));}var _0x351d09=_0x3585fa['some'](function(_0x57a048){return _0x57a048===_0x6be2('0x75');});if(!_0x351d09){return _0x3a22e8(new Error(_0x6be2('0x76')));}var _0x599f44=fs[_0x6be2('0x77')](path[_0x6be2('0x5f')](_0x5acfc1,_0x1613be[0x0],_0x6be2('0x75')));var _0x40c16d=JSON['parse'](_0x599f44);if(_0x6be2('0x25')==typeof _0x40c16d[_0x6be2('0x33')]){return _0x3a22e8(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6be2('0x25')==typeof _0x40c16d[_0x6be2('0x39')]){return _0x3a22e8(new Error(_0x6be2('0x78')));}if(_0x6be2('0x25')==typeof _0x40c16d['version']){return _0x3a22e8(new Error(_0x6be2('0x79')));}if('undefined'==typeof _0x40c16d[_0x6be2('0x7a')]){return _0x3a22e8(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x40c16d[_0x6be2('0x39')]==='html'){if(_0x6be2('0x25')==typeof _0x40c16d['parameters']['views']){return _0x3a22e8(new Error(_0x6be2('0x7b')));}if(_0x6be2('0x25')==typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7d')]&&'undefined'==typeof _0x40c16d['parameters']['views'][_0x6be2('0x7e')]){return _0x3a22e8(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x40c16d[_0x6be2('0x39')]===_0x6be2('0x7f')){if(_0x6be2('0x25')==typeof _0x40c16d['parameters'][_0x6be2('0x80')]){return _0x3a22e8(new Error(_0x6be2('0x81')));}if(_0x6be2('0x25')==typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x82')]){return _0x3a22e8(new Error(_0x6be2('0x83')));}}else{return _0x3a22e8(new Error(_0x6be2('0x84')));}var _0x9cfb1e=_0x40c16d[_0x6be2('0x33')];var _0xfce79c=_0x40c16d[_0x6be2('0x85')];var _0x1a0231=_0x40c16d[_0x6be2('0x39')];var _0x4cb7b4=_0x40c16d[_0x6be2('0x86')]?_0x40c16d[_0x6be2('0x86')]:'always';var _0x3dff8f=_0x40c16d[_0x6be2('0x87')]?_0x40c16d[_0x6be2('0x87')]:_0x6be2('0x88');var _0x477a35='';var _0x16ea14='';var _0x3ca2fe='';var _0x23391e='';var _0x1eec4c=_0x40c16d['version'];if(_0x1a0231===_0x6be2('0x89')){if(_0x6be2('0x25')!=typeof _0x40c16d['parameters'][_0x6be2('0x7c')][_0x6be2('0x7d')]){var _0x351f86=_0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x6be2('0x8a')](_0x351f86)){_0x477a35=path[_0x6be2('0x5f')](_0x6be2('0x8b'),_0x3decbc,_0x1613be[0x0],_0x351f86);}else{_0x477a35=_0x351f86;}}else{logger[_0x6be2('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x6be2('0x25')!=typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7e')]){var _0x374d26=_0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x6be2('0x8a')](_0x374d26)){_0x16ea14=path[_0x6be2('0x5f')](_0x6be2('0x8b'),_0x3decbc,_0x1613be[0x0],_0x374d26);}else{_0x16ea14=_0x374d26;}}else{logger[_0x6be2('0x67')](_0x6be2('0x8c'));}}else if(_0x1a0231==='script'){_0x3ca2fe=_0x40c16d[_0x6be2('0x7a')][_0x6be2('0x80')];_0x23391e=_0x40c16d[_0x6be2('0x7a')][_0x6be2('0x82')];if(_0x6be2('0x25')!=typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')]){if('undefined'!=typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7d')]){var _0x351f86=_0x40c16d['parameters'][_0x6be2('0x7c')][_0x6be2('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x6be2('0x8a')](_0x351f86)){_0x477a35=path[_0x6be2('0x5f')]('plugins',_0x3decbc,_0x1613be[0x0],_0x351f86);}else{_0x477a35=_0x351f86;}}if(_0x6be2('0x25')!=typeof _0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')][_0x6be2('0x7e')]){var _0x374d26=_0x40c16d[_0x6be2('0x7a')][_0x6be2('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6be2('0x8a')](_0x374d26)){_0x16ea14=path['join'](_0x6be2('0x8b'),_0x3decbc,_0x1613be[0x0],_0x374d26);}else{_0x16ea14=_0x374d26;}}}}var _0x39c295={'name':_0x9cfb1e,'description':_0xfce79c,'path':path['join'](_0x3decbc,_0x1613be[0x0]),'type':_0x1a0231,'sidebar':_0x4cb7b4,'icon':_0x3dff8f,'adminUrl':_0x477a35,'agentUrl':_0x16ea14,'scriptName':_0x3ca2fe,'scriptPath':_0x23391e,'version':_0x1eec4c};removeReferences(_0x37123a,null);return db[_0x6be2('0x37')][_0x6be2('0x8d')](_0x39c295)[_0x6be2('0x30')](function(_0x8856ec){var _0x4c8d83={'role':_0x54aa9e[_0x6be2('0x8e')][_0x6be2('0x8f')],'userProfileId':_0x54aa9e[_0x6be2('0x8e')][_0x6be2('0x90')]};if(!_0x4c8d83)throw new Error(_0x6be2('0x91'));if(_0x4c8d83[_0x6be2('0x8f')]===_0x6be2('0x92')){var _0x2442e3=_0x8856ec['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x6be2('0x2d'),'userProfileId':_0x4c8d83[_0x6be2('0x90')]},'raw':!![]})[_0x6be2('0x30')](function(_0x3da99a){if(_0x3da99a&&_0x3da99a[_0x6be2('0x93')]===0x0){return db[_0x6be2('0x2e')][_0x6be2('0x8d')]({'name':_0x2442e3['name'],'resourceId':_0x2442e3['id'],'type':_0x3da99a[_0x6be2('0x33')],'sectionId':_0x3da99a['id']},{})[_0x6be2('0x30')](function(){return _0x8856ec;});}else{return _0x8856ec;}})[_0x6be2('0x4f')](function(_0x53c549){logger['error'](_0x6be2('0x94'),_0x53c549);throw _0x53c549;});}return _0x8856ec;})[_0x6be2('0x30')](respondWithResult(_0x69635a,null))[_0x6be2('0x4f')](handleError(_0x69635a,null));}});}catch(_0xbff42f){_0x69635a[_0x6be2('0x22')](0x1f4)[_0x6be2('0x34')](_0xbff42f);}};function removeReferences(_0x1479f7,_0x559a24){try{if(_0x1479f7){fs[_0x6be2('0x66')](_0x1479f7);logger[_0x6be2('0x67')](_0x6be2('0x95'));}if(_0x559a24){rimraf(_0x559a24,function(){});logger[_0x6be2('0x67')]('Extracted\x20folder\x20removed');}}catch(_0x303bca){logger[_0x6be2('0x32')](_0x303bca);}}exports[_0x6be2('0x2b')]=function(_0x4061e6,_0x1103cf,_0xd68922){return db[_0x6be2('0x37')][_0x6be2('0x4e')]({'where':{'id':_0x4061e6[_0x6be2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1103cf,null))[_0x6be2('0x30')](saveUpdates(_0x4061e6['body'],null))[_0x6be2('0x30')](respondWithResult(_0x1103cf,null))[_0x6be2('0x4f')](handleError(_0x1103cf,null));};exports[_0x6be2('0x96')]=function(_0x2c8c67,_0xbeb87c,_0x30b799){return db[_0x6be2('0x37')]['find']({'where':{'id':_0x2c8c67[_0x6be2('0x4c')]['id']}})[_0x6be2('0x30')](function(_0x41f1ab){if(_0x41f1ab){return _0x41f1ab[_0x6be2('0x2f')]();}})[_0x6be2('0x30')](function(_0x1dedbb){rimraf(path[_0x6be2('0x5f')](config[_0x6be2('0x5e')],'server/files/plugins',path[_0x6be2('0x97')](_0x1dedbb[_0x6be2('0x9')])),function(){});return _0x1dedbb;})[_0x6be2('0x30')](handleEntityNotFound(_0xbeb87c,null))[_0x6be2('0x30')](respondWithStatusCode(_0xbeb87c,null))[_0x6be2('0x4f')](handleError(_0xbeb87c,null));};exports['webhookGet']=function(_0x43365d,_0x22c764,_0x6becc5){return BPromise[_0x6be2('0x98')]()[_0x6be2('0x30')](function(){if(!_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x43365d['query']['port']){throw new Error(_0x6be2('0x99'));}var _0x475d28=_0x43365d['query']['hostname']?_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9a')]+':'+_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9b')]:_0x6be2('0x9c')+_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9b')];var _0x1ba316=_0x43365d[_0x6be2('0x3b')][_0x6be2('0x23')]?_0x43365d[_0x6be2('0x3b')][_0x6be2('0x23')]:!![];var _0x58d4a1=_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9d')]?_0x43365d['query'][_0x6be2('0x9d')]:null;var _0x144a25={'method':_0x43365d[_0x6be2('0x9e')],'uri':util['format'](_0x6be2('0x9f'),_0x475d28,_0x43365d[_0x6be2('0x3b')]['path']),'json':_0x1ba316,'resolveWithFullResponse':!![],'encoding':_0x58d4a1,'qs':_0x43365d['query']};if(_0x43365d[_0x6be2('0xa0')]){_0x144a25[_0x6be2('0xa0')]=_0x43365d[_0x6be2('0xa0')];if(_0x144a25[_0x6be2('0xa0')][_0x6be2('0xa1')]){delete _0x144a25['headers'][_0x6be2('0xa1')];}}if(_0x144a25['headers'][_0x6be2('0xa2')]){delete _0x144a25[_0x6be2('0xa0')][_0x6be2('0xa2')];}return rp(_0x144a25);})[_0x6be2('0x30')](function(_0x1c5027){if(_0x1c5027){_0x22c764[_0x6be2('0x28')](_0x1c5027[_0x6be2('0xa0')]);logger[_0x6be2('0x67')](_0x1c5027['body']);if(_['endsWith'](_0x43365d[_0x6be2('0x3b')][_0x6be2('0x9')],'download')&&_0x1c5027[_0x6be2('0xa3')]==0x1f4){return _0x22c764[_0x6be2('0x21')](_0x1c5027['statusCode']);}else{return _0x22c764[_0x6be2('0x22')](_0x1c5027['statusCode'])[_0x6be2('0x34')](_0x1c5027['body']);}}else{return _0x22c764[_0x6be2('0x21')](0xc8);}})[_0x6be2('0x4f')](handleError(_0x22c764,null));};exports[_0x6be2('0xa4')]=function(_0x2d9fd3,_0xaad87e,_0x4e242b){return BPromise[_0x6be2('0x98')]()[_0x6be2('0x30')](function(){if(!_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x9')]){throw new Error(_0x6be2('0xa5'));}if(!_0x2d9fd3[_0x6be2('0x3b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1f1454=_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x9a')]?_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x9a')]+':'+_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x9b')]:_0x6be2('0x9c')+_0x2d9fd3['query'][_0x6be2('0x9b')];var _0x159626=_0x2d9fd3[_0x6be2('0x3b')]['json']?_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x23')]:!![];var _0x153d96=_0x2d9fd3[_0x6be2('0x3b')]['encoding']?_0x2d9fd3[_0x6be2('0x3b')][_0x6be2('0x9d')]:null;var _0x9cdad8={'method':_0x2d9fd3[_0x6be2('0x9e')],'uri':util[_0x6be2('0x52')](_0x6be2('0x9f'),_0x1f1454,_0x2d9fd3['query']['path']),'json':_0x159626,'resolveWithFullResponse':!![],'encoding':_0x153d96,'body':_0x2d9fd3[_0x6be2('0x8e')]};if(_0x2d9fd3[_0x6be2('0xa0')]){_0x9cdad8[_0x6be2('0xa0')]=_0x2d9fd3['headers'];if(_0x9cdad8[_0x6be2('0xa0')][_0x6be2('0xa1')]){delete _0x9cdad8['headers']['content-length'];}}if(_0x9cdad8[_0x6be2('0xa0')]['content-type']){delete _0x9cdad8[_0x6be2('0xa0')][_0x6be2('0xa2')];}return rp(_0x9cdad8);})[_0x6be2('0x30')](function(_0x1eef76){if(_0x1eef76){_0xaad87e[_0x6be2('0x28')](_0x1eef76[_0x6be2('0xa0')]);logger[_0x6be2('0x67')](_0x1eef76[_0x6be2('0x8e')]);return _0xaad87e[_0x6be2('0x22')](_0x1eef76[_0x6be2('0xa3')])[_0x6be2('0x34')](_0x1eef76[_0x6be2('0x8e')]);}else{return _0xaad87e[_0x6be2('0x21')](0xc8);}})[_0x6be2('0x4f')](handleError(_0xaad87e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 251d335..d0c56a8 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 _0xbba1=['setMaxListeners','save','hasOwnProperty','hook','exports','events'];(function(_0x38abdc,_0x5381a7){var _0x20e1b8=function(_0x5bfb8d){while(--_0x5bfb8d){_0x38abdc['push'](_0x38abdc['shift']());}};_0x20e1b8(++_0x5381a7);}(_0xbba1,0x17f));var _0x1bba=function(_0x49127a,_0x264b90){_0x49127a=_0x49127a-0x0;var _0x3e60f1=_0xbba1[_0x49127a];return _0x3e60f1;};'use strict';var EventEmitter=require(_0x1bba('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x1bba('0x1')](0x0);var events={'afterCreate':_0x1bba('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x41cdbc){return function(_0x599f9f,_0x505c67,_0x2cf721){PluginEvents['emit'](_0x41cdbc+':'+_0x599f9f['id'],_0x599f9f);PluginEvents['emit'](_0x41cdbc,_0x599f9f);_0x2cf721(null);};}for(var e in events){if(events[_0x1bba('0x3')](e)){var event=events[e];Plugin[_0x1bba('0x4')](e,emitEvent(event));}}module[_0x1bba('0x5')]=PluginEvents; \ No newline at end of file +var _0x06f4=['setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x06f4,0x136));var _0x406f=function(_0x2390cf,_0x5a71a8){_0x2390cf=_0x2390cf-0x0;var _0x4815bf=_0x06f4[_0x2390cf];return _0x4815bf;};'use strict';var EventEmitter=require(_0x406f('0x0'));var Plugin=require(_0x406f('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x406f('0x2')](0x0);var events={'afterCreate':_0x406f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a4ff0){return function(_0x5ed32f,_0x32abfd,_0x275c63){PluginEvents[_0x406f('0x4')](_0x3a4ff0+':'+_0x5ed32f['id'],_0x5ed32f);PluginEvents[_0x406f('0x4')](_0x3a4ff0,_0x5ed32f);_0x275c63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x406f('0x5')](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 e496205..869000a 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 _0x1e14=['api','path','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x2496a9,_0x44e889){var _0x4f9601=function(_0x5ac214){while(--_0x5ac214){_0x2496a9['push'](_0x2496a9['shift']());}};_0x4f9601(++_0x44e889);}(_0x1e14,0xef));var _0x41e1=function(_0x38eb19,_0x385490){_0x38eb19=_0x38eb19-0x0;var _0x4170a7=_0x1e14[_0x38eb19];return _0x4170a7;};'use strict';var _=require(_0x41e1('0x0'));var util=require(_0x41e1('0x1'));var logger=require(_0x41e1('0x2'))(_0x41e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41e1('0x4'));var rimraf=require('rimraf');var config=require(_0x41e1('0x5'));var attributes=require(_0x41e1('0x6'));module[_0x41e1('0x7')]=function(_0xd3a2bf,_0x362862){return _0xd3a2bf[_0x41e1('0x8')](_0x41e1('0x9'),attributes,{'tableName':_0x41e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bee=['exports','define','Plugin','plugins','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x50bdb2,_0x518133){var _0x1eac37=function(_0x4c2846){while(--_0x4c2846){_0x50bdb2['push'](_0x50bdb2['shift']());}};_0x1eac37(++_0x518133);}(_0x9bee,0xf4));var _0xe9be=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0x9bee[_0x55677b];return _0x104b88;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'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 88cf5f8..c69c9e6 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 _0xb90a=['result','catch','CreatePlugin','Plugin','create','options','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0xfee56c,_0x449cbd){var _0xdf0da7=function(_0x547b9f){while(--_0x547b9f){_0xfee56c['push'](_0xfee56c['shift']());}};_0xdf0da7(++_0x449cbd);}(_0xb90a,0x1c0));var _0xab90=function(_0x138e5c,_0x3bead3){_0x138e5c=_0x138e5c-0x0;var _0xe23dd1=_0xb90a[_0x138e5c];return _0xe23dd1;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var moment=require(_0xab90('0x2'));var BPromise=require(_0xab90('0x3'));var rs=require(_0xab90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab90('0x5'));var logger=require(_0xab90('0x6'))(_0xab90('0x7'));var config=require(_0xab90('0x8'));var jayson=require(_0xab90('0x9'));var client=jayson[_0xab90('0xa')][_0xab90('0xb')]({'port':0x232a});config[_0xab90('0xc')]=_[_0xab90('0xd')](config[_0xab90('0xc')],{'host':_0xab90('0xe'),'port':0x18eb});var socket=require(_0xab90('0xf'))(new Redis(config[_0xab90('0xc')]));require('./plugin.socket')[_0xab90('0x10')](socket);function respondWithRpcPromise(_0x52f58d,_0x3df29a,_0x48c516){return new BPromise(function(_0x226505,_0x5b2f65){return client[_0xab90('0x11')](_0x52f58d,_0x48c516)[_0xab90('0x12')](function(_0x2e8e54){logger['info'](_0xab90('0x13'),_0x3df29a,'request\x20sent');logger[_0xab90('0x14')](_0xab90('0x15'),_0x3df29a,_0xab90('0x16'),JSON[_0xab90('0x17')](_0x2e8e54));if(_0x2e8e54[_0xab90('0x18')]){if(_0x2e8e54[_0xab90('0x18')][_0xab90('0x19')]===0x1f4){logger[_0xab90('0x18')](_0xab90('0x13'),_0x3df29a,_0x2e8e54[_0xab90('0x18')]['message']);return _0x5b2f65(_0x2e8e54['error']['message']);}logger['error'](_0xab90('0x13'),_0x3df29a,_0x2e8e54['error'][_0xab90('0x1a')]);return _0x226505(_0x2e8e54['error'][_0xab90('0x1a')]);}else{logger[_0xab90('0x1b')](_0xab90('0x13'),_0x3df29a,_0xab90('0x16'));_0x226505(_0x2e8e54[_0xab90('0x1c')][_0xab90('0x1a')]);}})[_0xab90('0x1d')](function(_0x5d6771){logger['error'](_0xab90('0x13'),_0x3df29a,_0x5d6771);_0x5b2f65(_0x5d6771);});});}exports[_0xab90('0x1e')]=function(_0x55c4ae){var _0x4dc7f9=this;return new Promise(function(_0x132d24,_0x288b63){return db[_0xab90('0x1f')][_0xab90('0x20')](_0x55c4ae['body'],{'raw':_0x55c4ae[_0xab90('0x21')]?_0x55c4ae[_0xab90('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xab90('0x12')](function(_0x11c5ac){logger[_0xab90('0x1b')](_0xab90('0x1e'),_0x55c4ae);logger[_0xab90('0x14')](_0xab90('0x1e'),_0x55c4ae,JSON[_0xab90('0x17')](_0x11c5ac));_0x132d24(_0x11c5ac);})[_0xab90('0x1d')](function(_0xd46174){logger[_0xab90('0x18')](_0xab90('0x1e'),_0xd46174['message'],_0x55c4ae);_0x288b63(_0x4dc7f9[_0xab90('0x18')](0x1f4,_0xd46174[_0xab90('0x1a')]));});});}; \ No newline at end of file +var _0x79d6=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','create','options','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','debug'];(function(_0x163bfe,_0x310c36){var _0x2b831f=function(_0x2ec8d1){while(--_0x2ec8d1){_0x163bfe['push'](_0x163bfe['shift']());}};_0x2b831f(++_0x310c36);}(_0x79d6,0x82));var _0x679d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79d6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x679d('0x0'));var moment=require(_0x679d('0x1'));var BPromise=require(_0x679d('0x2'));var rs=require(_0x679d('0x3'));var fs=require('fs');var Redis=require(_0x679d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x679d('0x5'));var logger=require(_0x679d('0x6'))('rpc');var config=require(_0x679d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x679d('0x8')][_0x679d('0x9')]({'port':0x232a});config[_0x679d('0xa')]=_[_0x679d('0xb')](config[_0x679d('0xa')],{'host':_0x679d('0xc'),'port':0x18eb});var socket=require(_0x679d('0xd'))(new Redis(config[_0x679d('0xa')]));require(_0x679d('0xe'))['register'](socket);function respondWithRpcPromise(_0x2a3bb1,_0x1fb866,_0x1513a0){return new BPromise(function(_0x5395f4,_0x16a792){return client[_0x679d('0xf')](_0x2a3bb1,_0x1513a0)[_0x679d('0x10')](function(_0x2c7b9d){logger[_0x679d('0x11')]('Plugin,\x20%s,\x20%s',_0x1fb866,_0x679d('0x12'));logger[_0x679d('0x13')](_0x679d('0x14'),_0x1fb866,_0x679d('0x12'),JSON[_0x679d('0x15')](_0x2c7b9d));if(_0x2c7b9d[_0x679d('0x16')]){if(_0x2c7b9d['error']['code']===0x1f4){logger[_0x679d('0x16')](_0x679d('0x17'),_0x1fb866,_0x2c7b9d['error'][_0x679d('0x18')]);return _0x16a792(_0x2c7b9d['error'][_0x679d('0x18')]);}logger[_0x679d('0x16')](_0x679d('0x17'),_0x1fb866,_0x2c7b9d[_0x679d('0x16')][_0x679d('0x18')]);return _0x5395f4(_0x2c7b9d[_0x679d('0x16')][_0x679d('0x18')]);}else{logger[_0x679d('0x11')](_0x679d('0x17'),_0x1fb866,_0x679d('0x12'));_0x5395f4(_0x2c7b9d['result'][_0x679d('0x18')]);}})[_0x679d('0x19')](function(_0x50eb4d){logger['error'](_0x679d('0x17'),_0x1fb866,_0x50eb4d);_0x16a792(_0x50eb4d);});});}exports[_0x679d('0x1a')]=function(_0x1fb2e0){var _0x135c47=this;return new Promise(function(_0x51d05a,_0x1709bd){return db[_0x679d('0x1b')][_0x679d('0x1c')](_0x1fb2e0['body'],{'raw':_0x1fb2e0['options']?_0x1fb2e0[_0x679d('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x679d('0x10')](function(_0x310d8b){logger[_0x679d('0x11')](_0x679d('0x1a'),_0x1fb2e0);logger[_0x679d('0x13')](_0x679d('0x1a'),_0x1fb2e0,JSON['stringify'](_0x310d8b));_0x51d05a(_0x310d8b);})['catch'](function(_0x2a7fcf){logger[_0x679d('0x16')](_0x679d('0x1a'),_0x2a7fcf[_0x679d('0x18')],_0x1fb2e0);_0x1709bd(_0x135c47[_0x679d('0x16')](0x1f4,_0x2a7fcf[_0x679d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index dbfcdc6..e7962e6 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 _0xe8e9=['remove','update','emit','removeListener','register','plugin:','save'];(function(_0x20cf8c,_0x1880e9){var _0x401921=function(_0x1dcffb){while(--_0x1dcffb){_0x20cf8c['push'](_0x20cf8c['shift']());}};_0x401921(++_0x1880e9);}(_0xe8e9,0x1d4));var _0x9e8e=function(_0x4583db,_0xa49ea1){_0x4583db=_0x4583db-0x0;var _0x5b905d=_0xe8e9[_0x4583db];return _0x5b905d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x9e8e('0x0'),_0x9e8e('0x1'),_0x9e8e('0x2')];function createListener(_0x1c14b5,_0x5a7210){return function(_0x191f6b){_0x5a7210[_0x9e8e('0x3')](_0x1c14b5,_0x191f6b);};}function removeListener(_0x4efcd8,_0x42622b){return function(){PluginEvents[_0x9e8e('0x4')](_0x4efcd8,_0x42622b);};}exports[_0x9e8e('0x5')]=function(_0x70dbf2){for(var _0xa9f707=0x0,_0x3a9096=events['length'];_0xa9f707<_0x3a9096;_0xa9f707++){var _0x1dabeb=events[_0xa9f707];var _0x94c887=createListener(_0x9e8e('0x6')+_0x1dabeb,_0x70dbf2);PluginEvents['on'](_0x1dabeb,_0x94c887);}}; \ No newline at end of file +var _0x2d58=['./plugin.events','save','remove','emit','removeListener','length','plugin:'];(function(_0x5076e9,_0x22454a){var _0x2a0de1=function(_0x5b6895){while(--_0x5b6895){_0x5076e9['push'](_0x5076e9['shift']());}};_0x2a0de1(++_0x22454a);}(_0x2d58,0x111));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var PluginEvents=require(_0x82d5('0x0'));var events=[_0x82d5('0x1'),_0x82d5('0x2'),'update'];function createListener(_0x72ef7a,_0x2ebfd5){return function(_0x23ee8d){_0x2ebfd5[_0x82d5('0x3')](_0x72ef7a,_0x23ee8d);};}function removeListener(_0x43cc02,_0x882e25){return function(){PluginEvents[_0x82d5('0x4')](_0x43cc02,_0x882e25);};}exports['register']=function(_0x2b1009){for(var _0x28cd0c=0x0,_0x341ddc=events[_0x82d5('0x5')];_0x28cd0c<_0x341ddc;_0x28cd0c++){var _0x24fde9=events[_0x28cd0c];var _0x243a71=createListener(_0x82d5('0x6')+_0x24fde9,_0x2b1009);PluginEvents['on'](_0x24fde9,_0x243a71);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9c26710..79b2e99 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(_0x59fd2f,_0x3c5d11){var _0x1fca52=function(_0x5a5db4){while(--_0x5a5db4){_0x59fd2f['push'](_0x59fd2f['shift']());}};_0x1fca52(++_0x3c5d11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x4b80a7,_0x27f9d4){var _0x3b01a7=function(_0x3ef269){while(--_0x3ef269){_0x4b80a7['push'](_0x4b80a7['shift']());}};_0x3b01a7(++_0x27f9d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 fe9c600..4c85776 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 _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(_0x3399bb,_0x5e7c53){var _0x1afd51=function(_0x463f5f){while(--_0x463f5f){_0x3399bb['push'](_0x3399bb['shift']());}};_0x1afd51(++_0x5e7c53);}(_0x34e5,0x172));var _0x534e=function(_0xb16dde,_0x112979){_0xb16dde=_0xb16dde-0x0;var _0x22cbc5=_0x34e5[_0xb16dde];return _0x22cbc5;};'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 +var _0xeffd=['dump','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','then','reject','express','motion2','length','params','catch','create','body','script','cwd','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty'];(function(_0x48b213,_0x17ac49){var _0x588ceb=function(_0x4f3c73){while(--_0x4f3c73){_0x48b213['push'](_0x48b213['shift']());}};_0x588ceb(++_0x17ac49);}(_0xeffd,0x6b));var _0xdeff=function(_0x55946f,_0x50f039){_0x55946f=_0x55946f-0x0;var _0x1e631b=_0xeffd[_0x55946f];return _0x1e631b;};'use strict';var _=require(_0xdeff('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xdeff('0x1'))(_0xdeff('0x2'));var path=require(_0xdeff('0x3'));var exec=require(_0xdeff('0x4'))[_0xdeff('0x5')];var BPromise=require(_0xdeff('0x6'));function handleEntityNotFound(_0x298274,_0x2881fd){return function(_0x8315d4){if(!_0x8315d4){_0x298274[_0xdeff('0x7')](0x194);;}return _0x8315d4;};}function respondWithResult(_0x1ed641,_0x132631){_0x132631=_0x132631||0xc8;return function(_0x281ad7){if(_0x281ad7){return _0x1ed641[_0xdeff('0x8')](_0x132631)[_0xdeff('0x9')](_0x281ad7);}return null;};}function handleError(_0x12e953,_0x24897a){_0x24897a=_0x24897a||0x1f4;return function(_0x540ae6){logger[_0xdeff('0xa')](_0x540ae6[_0xdeff('0xb')]);if(_0x540ae6[_0xdeff('0xc')]){delete _0x540ae6['name'];}_0x12e953[_0xdeff('0x8')](_0x24897a)[_0xdeff('0xd')](_0x540ae6);};}function execChildProcess(){return new BPromise(function(_0x3c1482,_0x192195){exec(_0xdeff('0xe'),function(_0x256b73,_0x2e9783,_0x402075){logger['info'](_0x2e9783);logger[_0xdeff('0xf')](_0x402075);if(_0x256b73){logger[_0xdeff('0xa')](_0x256b73);return _0x192195(_0x256b73);}return _0x3c1482(_0x2e9783);});});}exports['index']=function(_0x2e614c,_0x4e7526){return pm2['list']()[_0xdeff('0x10')](function(_0x47410f){if(_0x47410f){var _0x1585e8=_[_0xdeff('0x11')](_0x47410f,function(_0x48f0e8){return _0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x12')||_0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x13');});return{'rows':_0x1585e8,'count':_0x1585e8[_0xdeff('0x14')]};}return null;})[_0xdeff('0x10')](respondWithResult(_0x4e7526,null))['catch'](handleError(_0x4e7526,null));};exports['show']=function(_0x7440af,_0x4cf724){return pm2['describe'](_0x7440af[_0xdeff('0x15')]['id'])[_0xdeff('0x10')](respondWithResult(_0x4cf724,null))['then'](handleEntityNotFound(_0x4cf724,null))[_0xdeff('0x16')](handleError(_0x4cf724,null));};exports[_0xdeff('0x17')]=function(_0x1ab1fa,_0x3a677a){if(_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')]&&_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0x19')]){var _0x488faa=path['join'](__dirname,'../../files/plugins',_0x1ab1fa[_0xdeff('0x18')]['script']);var _0x189627=process[_0xdeff('0x1a')]();process['chdir'](path[_0xdeff('0x1b')](_0x488faa));return execChildProcess()[_0xdeff('0x10')](function(_0x4eb2a8){process['chdir'](_0x189627);return pm2[_0xdeff('0x1c')]({'name':_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')],'script':_0x488faa});})[_0xdeff('0x10')](function(_0x32add9){pm2['dump']();return _0x32add9[0x0];})[_0xdeff('0x10')](respondWithResult(_0x3a677a,0xc9))[_0xdeff('0x16')](handleError(_0x3a677a,null));}else{return _0x3a677a[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':_0xdeff('0x1d')});}};exports[_0xdeff('0x1e')]=function(_0x3d0111,_0x52ea5d){if(_0x3d0111[_0xdeff('0x18')]['id']){delete _0x3d0111[_0xdeff('0x18')]['id'];}var _0x53b168={'online':'restart','stopped':_0xdeff('0x1f')};if(_0x53b168[_0xdeff('0x20')](_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')])){return pm2[_0x53b168[_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')]]](_0x3d0111[_0xdeff('0x15')]['id'])['then'](respondWithResult(_0x52ea5d,0xc8))[_0xdeff('0x16')](handleError(_0x52ea5d,null));}else{return _0x52ea5d[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x346743,_0x505e3f){if(_0x346743[_0xdeff('0x18')]['id']){delete _0x346743[_0xdeff('0x18')]['id'];}if(_0x346743[_0xdeff('0x15')]['id']){return pm2['delete'](_0x346743[_0xdeff('0x15')]['id'])['then'](function(_0x4ba2b2){pm2[_0xdeff('0x21')]();return _0x4ba2b2[0x0];})[_0xdeff('0x10')](respondWithResult(_0x505e3f,null))[_0xdeff('0x16')](handleError(_0x505e3f,null));}else{return _0x505e3f[_0xdeff('0x8')](0x1f4)['send']({'message':_0xdeff('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index b07e115..b78a0f9 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 _0x7586=['../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router'];(function(_0x498839,_0x3a390b){var _0x2ceb81=function(_0xd76f47){while(--_0xd76f47){_0x498839['push'](_0x498839['shift']());}};_0x2ceb81(++_0x3a390b);}(_0x7586,0x102));var _0x6758=function(_0x215863,_0x44609a){_0x215863=_0x215863-0x0;var _0x4d5f5c=_0x7586[_0x215863];return _0x4d5f5c;};'use strict';var express=require(_0x6758('0x0'));var router=express[_0x6758('0x1')]();var auth=require(_0x6758('0x2'));var controller=require('./realtime.controller');router[_0x6758('0x3')](_0x6758('0x4'),auth[_0x6758('0x5')](),controller[_0x6758('0x6')]);router['get'](_0x6758('0x7'),auth[_0x6758('0x5')](),controller[_0x6758('0x8')]);module[_0x6758('0x9')]=router; \ No newline at end of file +var _0xed1c=['/queues','getQueues','exports','express','Router','./realtime.controller','get','/agents','isAuthenticated','getAgents'];(function(_0x2142f7,_0x8aadc5){var _0x2db793=function(_0x53af8c){while(--_0x53af8c){_0x2142f7['push'](_0x2142f7['shift']());}};_0x2db793(++_0x8aadc5);}(_0xed1c,0x7b));var _0xced1=function(_0x41b463,_0x223cb0){_0x41b463=_0x41b463-0x0;var _0x566854=_0xed1c[_0x41b463];return _0x566854;};'use strict';var express=require(_0xced1('0x0'));var router=express[_0xced1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xced1('0x2'));router[_0xced1('0x3')](_0xced1('0x4'),auth[_0xced1('0x5')](),controller[_0xced1('0x6')]);router['get'](_0xced1('0x7'),auth['isAuthenticated'](),controller[_0xced1('0x8')]);module[_0xced1('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 0e69b89..5db1ac7 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 _0x8edf=['faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','resolve','map','User','rawAttributes','fieldName','type','key','query','role','agent','raw','user','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','globalStatus','getQueues','mail','chat','sms','fax','includes','channel','Invalid\x20channel','toLowerCase','getOptions','QueueCampaigns','Queues','all','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','Content-Range','json','stack','name','send','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','voice','startCase','then','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','outbound','originated','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','get','paused','loggedInDb','loggedIn','busy','find','pick','filter','queue','length','internal','getMembers','UserId','online','voiceStatus','agents','push','Queue','Pause','QueueId','idle','unknown','isNil','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','chatPause','mailPause','chatCapacity','mailCapacity','smsCapacity'];(function(_0x7bbd7f,_0x393806){var _0x48f73e=function(_0xe26938){while(--_0xe26938){_0x7bbd7f['push'](_0x7bbd7f['shift']());}};_0x48f73e(++_0x393806);}(_0x8edf,0x154));var _0xf8ed=function(_0x5ea7e0,_0x2f46f2){_0x5ea7e0=_0x5ea7e0-0x0;var _0x1c49c7=_0x8edf[_0x5ea7e0];return _0x1c49c7;};'use strict';var util=require(_0xf8ed('0x0'));var _=require('lodash');var jayson=require(_0xf8ed('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xf8ed('0x2'))(_0xf8ed('0x3'));var db=require(_0xf8ed('0x4'))['db'];var amiClient=jayson[_0xf8ed('0x5')][_0xf8ed('0x6')]({'port':0x232a});var routingClient=jayson[_0xf8ed('0x5')][_0xf8ed('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x40772b,_0x5a23c1){return function(_0x87e16e){if(_0x87e16e){var _0x15c6cf=typeof _0x5a23c1['offset']===_0xf8ed('0x7')&&typeof _0x5a23c1[_0xf8ed('0x8')]===_0xf8ed('0x7');var _0x4d1fa1=_0x87e16e[_0xf8ed('0x9')];var _0x5d96e2=_0x15c6cf?0x0:_0x5a23c1['offset'];var _0xc3eadd=_0x15c6cf?_0x87e16e[_0xf8ed('0x9')]:_0x5a23c1[_0xf8ed('0xa')]+_0x5a23c1[_0xf8ed('0x8')];var _0x44add3;if(_0xc3eadd>=_0x4d1fa1){_0xc3eadd=_0x4d1fa1;_0x44add3=0xc8;}else{_0x44add3=0xce;}_0x40772b[_0xf8ed('0xb')](_0x44add3);return _0x40772b['set'](_0xf8ed('0xc'),_0x5d96e2+'-'+_0xc3eadd+'/'+_0x4d1fa1)[_0xf8ed('0xd')](_0x87e16e);}return null;};}function handleError(_0x1367ca,_0x5df6bd){_0x5df6bd=_0x5df6bd||0x1f4;return function(_0x216244){logger['error'](_0x216244[_0xf8ed('0xe')]);if(_0x216244[_0xf8ed('0xf')]){delete _0x216244[_0xf8ed('0xf')];}_0x1367ca['status'](_0x5df6bd)[_0xf8ed('0x10')](_0x216244);};}function getRealtimeAgents(){return new Promise(function(_0x3f3d53,_0x2db5cb){return amiClient[_0xf8ed('0x11')](_0xf8ed('0x12'),{})['then'](function(_0x333629){if(_0x333629[_0xf8ed('0x13')])throw new Error(_0xf8ed('0x14'));var _0x5c9f0c=_0x333629['result'];return routingClient['request'](_0xf8ed('0x12'),{})['then'](function(_0x578934){if(_0x578934[_0xf8ed('0x13')])throw new Error(_0xf8ed('0x15'));var _0x33494a=_0x578934[_0xf8ed('0x16')];return _0x3f3d53(_[_0xf8ed('0x17')]({},_0x5c9f0c,_0x33494a));});})['catch'](function(_0x51a4a3){_0x2db5cb(_0x51a4a3);});});}function getRealtimeQueues(_0x3bb347,_0x4b0b9e){return new Promise(function(_0x340b04,_0x44546a){var _0x113364=_0x4b0b9e===_0xf8ed('0x18')?amiClient:routingClient;return _0x113364[_0xf8ed('0x11')](_[_0xf8ed('0x19')](_0x4b0b9e)+'Queues',_0x3bb347)[_0xf8ed('0x1a')](function(_0x3d277a){if(_0x3d277a['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4b0b9e));return _0x340b04(_0x3d277a[_0xf8ed('0x16')]);})[_0xf8ed('0x1b')](function(_0x5e7f16){_0x44546a(_0x5e7f16);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x123340,_0x111086){return amiClient[_0xf8ed('0x11')](_0xf8ed('0x1c'),{})[_0xf8ed('0x1a')](function(_0x4ffc9a){if(_0x4ffc9a['error'])throw new Error(_0xf8ed('0x1d'));return _0x123340(_0x4ffc9a[_0xf8ed('0x16')]);})['catch'](function(_0x44f75b){_0x111086(_0x44f75b);});});}function initializeQueues(_0x81a1e7,_0x3c6759,_0x53d2aa,_0x1c1121){var _0x1cbea2=['loggedIn',_0xf8ed('0x1e'),_0xf8ed('0x1f'),_0xf8ed('0x20'),'paused'];if(_0x53d2aa==='voice'&&_0x1c1121===_0xf8ed('0x21')){_0x1cbea2['push']('pTalking',_0xf8ed('0x22'),'message','dialActive',_0xf8ed('0x23'),_0xf8ed('0x24'),_0xf8ed('0x25'),'startProgressive',_0xf8ed('0x26'),_0xf8ed('0x27'),'erlangAbandonmentRate',_0xf8ed('0x28'),_0xf8ed('0x29'),_0xf8ed('0x2a'),_0xf8ed('0x2b'),'predictiveIntervalAvailable',_0xf8ed('0x2c'),_0xf8ed('0x2d'),_0xf8ed('0x2e'),_0xf8ed('0x2f'),_0xf8ed('0x30'),'predictiveIntervalAvgTalktime');}return _0x81a1e7['map'](function(_0x257a96){var _0x1eb7c5=_0x257a96[_0xf8ed('0x31')]({'plain':!![]});_0x1eb7c5['agents']=[];_0x1eb7c5[_0xf8ed('0x32')]=0x0;_0x1eb7c5[_0xf8ed('0x33')]=0x0;_0x1eb7c5[_0xf8ed('0x34')]=0x0;_0x1eb7c5[_0xf8ed('0x1e')]=0x0;_0x1eb7c5['waiting']=0x0;if(_0x53d2aa===_0xf8ed('0x18')){_0x1eb7c5[_0xf8ed('0x20')]=0x0;_0x1eb7c5[_0xf8ed('0x35')]=0x0;if(_0x1c1121===_0xf8ed('0x21')){_0x1eb7c5['pTalking']=0x0;_0x1eb7c5[_0xf8ed('0x22')]=0x0;}}var _0x536c52=_[_0xf8ed('0x36')](_0x3c6759,['id',_0x1eb7c5['id']]);if(_0x536c52)_[_0xf8ed('0x17')](_0x1eb7c5,_[_0xf8ed('0x37')](_0x536c52,_0x1cbea2));return _0x1eb7c5;});}function updateAgentVoiceStatus(_0x11b2e9,_0x568c5d,_0x5c5ea2){var _0x453b22=_[_0xf8ed('0x38')](_0x5c5ea2,[_0xf8ed('0x39'),_0x568c5d[_0xf8ed('0xf')]]);if(_0x453b22[_0xf8ed('0x3a')]===0x0)return _0x11b2e9[_0xf8ed('0x35')]=!![];if(_['some'](_0x453b22,['connectedlinenum',_0x11b2e9[_0xf8ed('0x3b')]['toString']()]))return _0x11b2e9[_0xf8ed('0x20')]=!![];if(!_0x11b2e9[_0xf8ed('0x20')])return _0x11b2e9['busy']=!![];}function getVoiceQueueAgents(_0x17ba04,_0x12ce00,_0x5f3c60,_0x4f7b59){var _0x3714f8=_[_0xf8ed('0x36')](_0x12ce00,['id',_0x17ba04['id']]);if(!_0x3714f8)return _0x17ba04;return _0x3714f8[_0xf8ed('0x3c')]({'raw':!![]})['then'](function(_0x54f867){for(var _0x28f140=0x0;_0x28f140<_0x54f867['length'];_0x28f140++){var _0x79358c=_[_0xf8ed('0x36')](_0x5f3c60,['id',_0x54f867[_0x28f140]['UserId']]);if(!_0x79358c){_0x79358c={'id':_0x54f867[_0x28f140]['UserId'],'name':_0x54f867[_0x28f140][_0xf8ed('0x3d')],'accountcode':'','online':![]};}var _0x9e4cfc={'id':_0x79358c['id'],'name':_0x79358c[_0xf8ed('0xf')],'internal':_0x79358c['accountcode'],'online':Boolean(_0x79358c[_0xf8ed('0x3e')]),'paused':Boolean(_0x54f867[_0x28f140][_0xf8ed('0x32')])};if(_0x79358c[_0xf8ed('0x3f')]===_0xf8ed('0x20'))updateAgentVoiceStatus(_0x9e4cfc,_0x17ba04,_0x4f7b59);if(_0x9e4cfc[_0xf8ed('0x3e')])_0x17ba04[_0xf8ed('0x33')]++;if(_0x9e4cfc[_0xf8ed('0x35')])_0x17ba04['busy']++;if(_0x9e4cfc['paused']&&!_0x9e4cfc[_0xf8ed('0x35')]&&!_0x9e4cfc[_0xf8ed('0x20')])_0x17ba04[_0xf8ed('0x32')]++;_0x17ba04[_0xf8ed('0x40')][_0xf8ed('0x41')](_0x9e4cfc);}return _0x17ba04;});}function getQueueAgents(_0x26f747,_0x15ecef,_0x59c4e7){var _0xc50793='User'+_['startCase'](_0x59c4e7)+_0xf8ed('0x42');var _0x1140ba=_0x59c4e7+_0xf8ed('0x43');return db[_0xc50793]['findAll']({'where':{[_[_0xf8ed('0x19')](_0x59c4e7)+_0xf8ed('0x44')]:_0x26f747['id']},'raw':!![]})[_0xf8ed('0x1a')](function(_0x1c9ac3){for(var _0x410fff=0x0;_0x410fff<_0x1c9ac3[_0xf8ed('0x3a')];_0x410fff++){var _0x599b74=_[_0xf8ed('0x36')](_0x15ecef,['id',_0x1c9ac3[_0x410fff][_0xf8ed('0x3d')]]);if(!_0x599b74){_0x599b74={'id':_0x1c9ac3[_0x410fff][_0xf8ed('0x3d')],'name':_0x1c9ac3[_0x410fff][_0xf8ed('0x3d')],'online':![],['pauseField']:![]};}var _0x39d82a={'id':_0x599b74['id'],'name':_0x599b74[_0xf8ed('0xf')],'online':Boolean(_0x599b74[_0xf8ed('0x3e')]),'paused':Boolean(_0x599b74[_0x1140ba])};if(_0x39d82a[_0xf8ed('0x3e')])_0x26f747['loggedInDb']++;_0x26f747['agents'][_0xf8ed('0x41')](_0x39d82a);}return _0x26f747;});}function isIdle(_0xdb0549){return _0xdb0549===_0xf8ed('0x45')||_0xdb0549===_0xf8ed('0x46')||_0xdb0549==='unavailable'||_0xdb0549==='ringing'||_[_0xf8ed('0x47')](_0xdb0549);}function isAgentPaused(_0x579827,_0x5add2f){var _0x206af6=[_0x579827['chatPause'],_0x579827[_0xf8ed('0x48')],_0x579827['mailPause'],_0x579827[_0xf8ed('0x49')],_0x579827[_0xf8ed('0x4a')],_0x579827[_0xf8ed('0x4b')],_0x579827[_0xf8ed('0x4c')]];if(!_0x5add2f)return _[_0xf8ed('0x4d')](_0x206af6);var _0x3e3976=_['filter'](_0x206af6);return _0x3e3976[_0xf8ed('0x3a')]>0x0&&_0x3e3976['length']<_0x206af6[_0xf8ed('0x3a')]?!![]:![];}function isAgentIdle(_0x70e104){if(_0x70e104['voiceStatus']!==_0xf8ed('0x45')&&_0x70e104['voicePause']){_0x70e104[_0xf8ed('0x3f')]=_0xf8ed('0x4e');return![];}return _['every']([_0x70e104[_0xf8ed('0x4f')],_0x70e104['faxStatus'],_0x70e104['mailStatus'],_0x70e104[_0xf8ed('0x50')],_0x70e104[_0xf8ed('0x51')],_0x70e104[_0xf8ed('0x3f')],_0x70e104[_0xf8ed('0x52')]],isIdle);}function getAgentStatus(_0x30d453){var _0x4a601d=_0xf8ed('0x46');if(isAgentPaused(_0x30d453))_0x4a601d='pause';else if(isAgentPaused(_0x30d453,!![]))_0x4a601d=_0xf8ed('0x53');else if(isAgentIdle(_0x30d453))_0x4a601d=_0xf8ed('0x45');else _0x4a601d=_0xf8ed('0x35');return _0x4a601d;}exports[_0xf8ed('0x54')]=function(_0x1fd1a7,_0x4843e5){var _0x4a7e49={'count':0x0,'rows':[]},_0x3fca40={},_0x5e585b,_0x387340,_0x40175f=[_0xf8ed('0x55'),_0xf8ed('0x3e'),_0xf8ed('0x56'),_0xf8ed('0x57'),_0xf8ed('0x58'),_0xf8ed('0x57'),_0xf8ed('0x3b'),_0xf8ed('0x59'),_0xf8ed('0x5a'),_0xf8ed('0x49'),_0xf8ed('0x5b'),_0xf8ed('0x4a'),_0xf8ed('0x4c'),'faxPause',_0xf8ed('0x4b'),_0xf8ed('0x5c'),'openchannelCapacity',_0xf8ed('0x5d'),_0xf8ed('0x5e'),'whatsappCapacity',_0xf8ed('0x5f'),_0xf8ed('0x60'),_0xf8ed('0x61'),'mailCurrentCapacity',_0xf8ed('0x62'),'whatsappCurrentCapacity',_0xf8ed('0x63'),'chatStatus','openchannelStatus','mailStatus',_0xf8ed('0x51'),_0xf8ed('0x52'),_0xf8ed('0x64'),_0xf8ed('0x3f'),_0xf8ed('0x65'),_0xf8ed('0x66'),_0xf8ed('0x67'),_0xf8ed('0x68'),_0xf8ed('0x69'),_0xf8ed('0x6a'),_0xf8ed('0x6b'),_0xf8ed('0x39'),_0xf8ed('0x6c'),'screenrecording',_0xf8ed('0x6d'),'phoneBarEnableAutomaticScreenRecording',_0xf8ed('0x6e')],_0x1df4b2=[_0xf8ed('0x5a'),_0xf8ed('0x49'),_0xf8ed('0x5b'),_0xf8ed('0x4a'),_0xf8ed('0x4c'),_0xf8ed('0x48'),'voicePause',_0xf8ed('0x3e')];Promise[_0xf8ed('0x6f')]()[_0xf8ed('0x1a')](function(){var _0x24fc79=_[_0xf8ed('0x70')](db[_0xf8ed('0x71')][_0xf8ed('0x72')],function(_0x4bac39){return{'name':_0x4bac39[_0xf8ed('0x73')],'type':_0x4bac39[_0xf8ed('0x74')][_0xf8ed('0x75')]};});_0x1fd1a7[_0xf8ed('0x76')][_0xf8ed('0x77')]=_0xf8ed('0x78');_0x1fd1a7[_0xf8ed('0x76')][_0xf8ed('0x3e')]=!![];_0x3fca40=qs['getOptions'](_0x24fc79,_0x1fd1a7);_0x3fca40[_0xf8ed('0x79')]=!![];if(_0x1fd1a7[_0xf8ed('0x7a')][_0xf8ed('0x77')]==='user'){var _0x4e7358={'params':{'id':_0x1fd1a7[_0xf8ed('0x7a')]['userProfileId']},'query':{'section':'Agents','role':_0xf8ed('0x78'),'online':!![],'nolimit':_0x1fd1a7['query'][_0xf8ed('0x7b')],'sort':_0x1fd1a7[_0xf8ed('0x76')][_0xf8ed('0x7c')],'filter':_0x1fd1a7['query'][_0xf8ed('0x38')]},'raw':!![]};return db[_0xf8ed('0x7d')][_0xf8ed('0x7e')](_0x4e7358);}return db[_0xf8ed('0x71')][_0xf8ed('0x7f')](_0x3fca40);})[_0xf8ed('0x1a')](function(_0xea9ff7){_0x4a7e49[_0xf8ed('0x9')]=_0xea9ff7[_0xf8ed('0x9')];_0x5e585b=_0xea9ff7['rows'];return getRealtimeAgents();})['then'](function(_0x128a15){_0x387340=_0x128a15[_0xf8ed('0x80')];return _0x5e585b['map'](function(_0x4d2788){var _0x1edbdb=_[_0xf8ed('0x36')](_0x387340,['id',_0x4d2788['id']]);if(_0x1edbdb)_[_0xf8ed('0x17')](_0x4d2788,_[_0xf8ed('0x37')](_[_0xf8ed('0x81')](_0x1edbdb,_0x1df4b2),_0x40175f));_0x4d2788['globalStatus']=getAgentStatus(_0x4d2788);return _0x4d2788;});})[_0xf8ed('0x1a')](function(_0x5618bb){if(_0x1fd1a7[_0xf8ed('0x76')][_0xf8ed('0x82')]){var _0x2ce085=_['filter'](_0x5618bb,[_0xf8ed('0x83'),_0x1fd1a7['query'][_0xf8ed('0x82')]]);if(_0x1fd1a7[_0xf8ed('0x76')]['pauseTypeFilter']){_0x2ce085=_[_0xf8ed('0x38')](_0x2ce085,[_0xf8ed('0x58'),_0x1fd1a7[_0xf8ed('0x76')]['pauseTypeFilter']]);}}_0x4a7e49[_0xf8ed('0x80')]=_0x2ce085||_0x5618bb;return _0x4a7e49;})[_0xf8ed('0x1a')](respondWithFilteredResult(_0x4843e5,_0x3fca40))[_0xf8ed('0x1b')](handleError(_0x4843e5,null));};exports[_0xf8ed('0x84')]=function(_0x527011,_0x3856fb){var _0x2804e7=[_0xf8ed('0x85'),_0xf8ed('0x86'),_0xf8ed('0x87'),'openchannel',_0xf8ed('0x88'),'whatsapp',_0xf8ed('0x18')];var _0x14b482={'count':0x0,'rows':[]},_0x5528f7={},_0x1b78f0,_0x32a70a,_0x51b204,_0x124927,_0x45752a;Promise[_0xf8ed('0x6f')]()[_0xf8ed('0x1a')](function(){if(_0x527011[_0xf8ed('0x76')]['channel']){if(!_[_0xf8ed('0x89')](_0x2804e7,_0x527011[_0xf8ed('0x76')][_0xf8ed('0x8a')]['toLowerCase']()))throw new Error(_0xf8ed('0x8b'));_0x1b78f0=_0x527011[_0xf8ed('0x76')][_0xf8ed('0x8a')][_0xf8ed('0x8c')]();}var _0x18d077=_[_0xf8ed('0x19')](_0x1b78f0)+_0xf8ed('0x42');var _0x7dd90f=_[_0xf8ed('0x70')](db[_0x18d077][_0xf8ed('0x72')],function(_0x450129){return{'name':_0x450129[_0xf8ed('0x73')],'type':_0x450129[_0xf8ed('0x74')][_0xf8ed('0x75')]};});_0x5528f7=qs[_0xf8ed('0x8d')](_0x7dd90f,_0x527011);if(_0x527011[_0xf8ed('0x7a')][_0xf8ed('0x77')]===_0xf8ed('0x7a')){var _0x183069={'params':{'id':_0x527011[_0xf8ed('0x7a')]['userProfileId']},'query':{'section':_0x1b78f0==='voice'&&_0x527011[_0xf8ed('0x76')][_0xf8ed('0x74')]===_0xf8ed('0x21')?_0xf8ed('0x8e'):_[_0xf8ed('0x19')](_0x1b78f0)+_0xf8ed('0x8f'),'type':_0x527011[_0xf8ed('0x76')][_0xf8ed('0x74')],'nolimit':!![],'sort':_0xf8ed('0xf'),'filter':_0x527011[_0xf8ed('0x76')]['filter']}};return db[_0xf8ed('0x7d')][_0xf8ed('0x7e')](_0x183069);}return db[_0x18d077]['findAndCountAll'](_0x5528f7);})[_0xf8ed('0x1a')](function(_0x53478a){_0x14b482[_0xf8ed('0x9')]=_0x53478a[_0xf8ed('0x9')];_0x32a70a=_0x53478a['rows'];return getRealtimeQueues(_0x527011,_0x1b78f0);})[_0xf8ed('0x1a')](function(_0x159363){_0x124927=_0x159363[_0xf8ed('0x80')];return getRealtimeAgents();})[_0xf8ed('0x1a')](function(_0x2950b4){_0x51b204=_0x2950b4[_0xf8ed('0x80')];if(_0x1b78f0!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xf8ed('0x1a')](function(_0x42b561){_0x45752a=_0x42b561?_0x42b561[_0xf8ed('0x80')]:[];return initializeQueues(_0x32a70a,_0x124927,_0x1b78f0,_0x527011[_0xf8ed('0x76')]['type']);})['then'](function(_0x3e0745){var _0x1ff797=_0x3e0745['map'](function(_0x5e3c9e){if(_0x1b78f0===_0xf8ed('0x18'))return getVoiceQueueAgents(_0x5e3c9e,_0x32a70a,_0x51b204,_0x45752a);else return getQueueAgents(_0x5e3c9e,_0x51b204,_0x1b78f0);});return Promise[_0xf8ed('0x90')](_0x1ff797);})[_0xf8ed('0x1a')](function(_0x578c1e){_0x14b482[_0xf8ed('0x80')]=_0x578c1e;return _0x14b482;})[_0xf8ed('0x1a')](respondWithFilteredResult(_0x3856fb,_0x5528f7))[_0xf8ed('0x1b')](handleError(_0x3856fb,null));}; \ No newline at end of file +var _0xf3b1=['key','query','role','agent','getOptions','raw','user','userProfileId','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','globalStatusFilter','pauseTypeFilter','chat','sms','includes','channel','toLowerCase','type','QueueCampaigns','all','util','lodash','../../config/logger','../../mysqldb','client','http','offset','limit','undefined','count','status','set','json','stack','name','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','available','paused','originated','dialActive','dialMethod','Trunk','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','busy','outbound','pTalking','pick','filter','queue','length','some','connectedlinenum','internal','toString','talking','find','getMembers','UserId','accountcode','voiceStatus','Queue','Pause','findAll','QueueId','online','push','unknown','unavailable','ringing','isNil','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','voicePause','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','idle','getAgents','lastLoginAt','lastPauseAt','pauseType','address','chatPause','openchannelCapacity','smsCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','User','rawAttributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf3b1,0xab));var _0x1f3b=function(_0x5ceb1d,_0x457055){_0x5ceb1d=_0x5ceb1d-0x0;var _0x346f66=_0xf3b1[_0x5ceb1d];return _0x346f66;};'use strict';var util=require(_0x1f3b('0x0'));var _=require(_0x1f3b('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x1f3b('0x2'))('api');var db=require(_0x1f3b('0x3'))['db'];var amiClient=jayson[_0x1f3b('0x4')][_0x1f3b('0x5')]({'port':0x232a});var routingClient=jayson[_0x1f3b('0x4')][_0x1f3b('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x136f39,_0x11c734){return function(_0x498454){if(_0x498454){var _0x103b24=typeof _0x11c734[_0x1f3b('0x6')]==='undefined'&&typeof _0x11c734[_0x1f3b('0x7')]===_0x1f3b('0x8');var _0x44e830=_0x498454['count'];var _0x114946=_0x103b24?0x0:_0x11c734[_0x1f3b('0x6')];var _0xc7bcb9=_0x103b24?_0x498454[_0x1f3b('0x9')]:_0x11c734[_0x1f3b('0x6')]+_0x11c734[_0x1f3b('0x7')];var _0x3bb80c;if(_0xc7bcb9>=_0x44e830){_0xc7bcb9=_0x44e830;_0x3bb80c=0xc8;}else{_0x3bb80c=0xce;}_0x136f39[_0x1f3b('0xa')](_0x3bb80c);return _0x136f39[_0x1f3b('0xb')]('Content-Range',_0x114946+'-'+_0xc7bcb9+'/'+_0x44e830)[_0x1f3b('0xc')](_0x498454);}return null;};}function handleError(_0x494d44,_0x35a223){_0x35a223=_0x35a223||0x1f4;return function(_0x13a5cf){logger['error'](_0x13a5cf[_0x1f3b('0xd')]);if(_0x13a5cf[_0x1f3b('0xe')]){delete _0x13a5cf[_0x1f3b('0xe')];}_0x494d44[_0x1f3b('0xa')](_0x35a223)['send'](_0x13a5cf);};}function getRealtimeAgents(){return new Promise(function(_0x38e72d,_0x3a3e58){return amiClient[_0x1f3b('0xf')](_0x1f3b('0x10'),{})[_0x1f3b('0x11')](function(_0x1713a0){if(_0x1713a0[_0x1f3b('0x12')])throw new Error(_0x1f3b('0x13'));var _0xa09b4=_0x1713a0[_0x1f3b('0x14')];return routingClient['request']('Agents',{})[_0x1f3b('0x11')](function(_0xf233d1){if(_0xf233d1[_0x1f3b('0x12')])throw new Error(_0x1f3b('0x15'));var _0x8db5a0=_0xf233d1[_0x1f3b('0x14')];return _0x38e72d(_[_0x1f3b('0x16')]({},_0xa09b4,_0x8db5a0));});})['catch'](function(_0x3b7d4f){_0x3a3e58(_0x3b7d4f);});});}function getRealtimeQueues(_0x169799,_0x2d44a3){return new Promise(function(_0x58b267,_0x2a57d9){var _0x40e36f=_0x2d44a3===_0x1f3b('0x17')?amiClient:routingClient;return _0x40e36f['request'](_[_0x1f3b('0x18')](_0x2d44a3)+_0x1f3b('0x19'),_0x169799)[_0x1f3b('0x11')](function(_0x502e54){if(_0x502e54[_0x1f3b('0x12')])throw new Error(util[_0x1f3b('0x1a')](_0x1f3b('0x1b'),_0x2d44a3));return _0x58b267(_0x502e54[_0x1f3b('0x14')]);})['catch'](function(_0x173c7d){_0x2a57d9(_0x173c7d);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x306b80,_0x527726){return amiClient['request']('VoiceQueuesChannels',{})[_0x1f3b('0x11')](function(_0x2a61f4){if(_0x2a61f4[_0x1f3b('0x12')])throw new Error(_0x1f3b('0x1c'));return _0x306b80(_0x2a61f4[_0x1f3b('0x14')]);})[_0x1f3b('0x1d')](function(_0x5141c7){_0x527726(_0x5141c7);});});}function initializeQueues(_0xe348cb,_0x3f84da,_0x5d3430,_0x518941){var _0x2590b4=['loggedIn',_0x1f3b('0x1e'),'waiting','talking',_0x1f3b('0x1f')];if(_0x5d3430===_0x1f3b('0x17')&&_0x518941==='outbound'){_0x2590b4['push']('pTalking',_0x1f3b('0x20'),'message',_0x1f3b('0x21'),_0x1f3b('0x22'),_0x1f3b('0x23'),'startPredictive','startProgressive','erlangCalls',_0x1f3b('0x24'),_0x1f3b('0x25'),_0x1f3b('0x26'),_0x1f3b('0x27'),_0x1f3b('0x28'),_0x1f3b('0x29'),_0x1f3b('0x2a'),_0x1f3b('0x2b'),_0x1f3b('0x2c'),_0x1f3b('0x2d'),_0x1f3b('0x2e'),_0x1f3b('0x2f'),_0x1f3b('0x30'));}return _0xe348cb[_0x1f3b('0x31')](function(_0x139708){var _0x3110f3=_0x139708['get']({'plain':!![]});_0x3110f3[_0x1f3b('0x32')]=[];_0x3110f3[_0x1f3b('0x1f')]=0x0;_0x3110f3[_0x1f3b('0x33')]=0x0;_0x3110f3[_0x1f3b('0x34')]=0x0;_0x3110f3[_0x1f3b('0x1e')]=0x0;_0x3110f3['waiting']=0x0;if(_0x5d3430===_0x1f3b('0x17')){_0x3110f3['talking']=0x0;_0x3110f3[_0x1f3b('0x35')]=0x0;if(_0x518941===_0x1f3b('0x36')){_0x3110f3[_0x1f3b('0x37')]=0x0;_0x3110f3[_0x1f3b('0x20')]=0x0;}}var _0x8cba34=_['find'](_0x3f84da,['id',_0x3110f3['id']]);if(_0x8cba34)_['merge'](_0x3110f3,_[_0x1f3b('0x38')](_0x8cba34,_0x2590b4));return _0x3110f3;});}function updateAgentVoiceStatus(_0x14cb08,_0x28f60f,_0x56a3c8){var _0x470c47=_[_0x1f3b('0x39')](_0x56a3c8,[_0x1f3b('0x3a'),_0x28f60f[_0x1f3b('0xe')]]);if(_0x470c47[_0x1f3b('0x3b')]===0x0)return _0x14cb08[_0x1f3b('0x35')]=!![];if(_[_0x1f3b('0x3c')](_0x470c47,[_0x1f3b('0x3d'),_0x14cb08[_0x1f3b('0x3e')][_0x1f3b('0x3f')]()]))return _0x14cb08['talking']=!![];if(!_0x14cb08[_0x1f3b('0x40')])return _0x14cb08[_0x1f3b('0x35')]=!![];}function getVoiceQueueAgents(_0x2de55a,_0x4ec5e3,_0x37fa91,_0x47eff5){var _0x34e526=_[_0x1f3b('0x41')](_0x4ec5e3,['id',_0x2de55a['id']]);if(!_0x34e526)return _0x2de55a;return _0x34e526[_0x1f3b('0x42')]({'raw':!![]})[_0x1f3b('0x11')](function(_0x2e98cb){for(var _0x197fa4=0x0;_0x197fa4<_0x2e98cb[_0x1f3b('0x3b')];_0x197fa4++){var _0x1b5c72=_['find'](_0x37fa91,['id',_0x2e98cb[_0x197fa4][_0x1f3b('0x43')]]);if(!_0x1b5c72){_0x1b5c72={'id':_0x2e98cb[_0x197fa4][_0x1f3b('0x43')],'name':_0x2e98cb[_0x197fa4][_0x1f3b('0x43')],'accountcode':'','online':![]};}var _0x65b137={'id':_0x1b5c72['id'],'name':_0x1b5c72[_0x1f3b('0xe')],'internal':_0x1b5c72[_0x1f3b('0x44')],'online':Boolean(_0x1b5c72['online']),'paused':Boolean(_0x2e98cb[_0x197fa4][_0x1f3b('0x1f')])};if(_0x1b5c72[_0x1f3b('0x45')]==='talking')updateAgentVoiceStatus(_0x65b137,_0x2de55a,_0x47eff5);if(_0x65b137['online'])_0x2de55a[_0x1f3b('0x33')]++;if(_0x65b137[_0x1f3b('0x35')])_0x2de55a[_0x1f3b('0x35')]++;if(_0x65b137[_0x1f3b('0x1f')]&&!_0x65b137['busy']&&!_0x65b137['talking'])_0x2de55a['paused']++;_0x2de55a[_0x1f3b('0x32')]['push'](_0x65b137);}return _0x2de55a;});}function getQueueAgents(_0x1924f3,_0x309173,_0x2a4c3c){var _0x5e9220='User'+_[_0x1f3b('0x18')](_0x2a4c3c)+_0x1f3b('0x46');var _0x2b6013=_0x2a4c3c+_0x1f3b('0x47');return db[_0x5e9220][_0x1f3b('0x48')]({'where':{[_[_0x1f3b('0x18')](_0x2a4c3c)+_0x1f3b('0x49')]:_0x1924f3['id']},'raw':!![]})[_0x1f3b('0x11')](function(_0x7efde5){for(var _0x55851a=0x0;_0x55851a<_0x7efde5[_0x1f3b('0x3b')];_0x55851a++){var _0x8732a5=_[_0x1f3b('0x41')](_0x309173,['id',_0x7efde5[_0x55851a][_0x1f3b('0x43')]]);if(!_0x8732a5){_0x8732a5={'id':_0x7efde5[_0x55851a][_0x1f3b('0x43')],'name':_0x7efde5[_0x55851a][_0x1f3b('0x43')],'online':![],['pauseField']:![]};}var _0x3c90a5={'id':_0x8732a5['id'],'name':_0x8732a5[_0x1f3b('0xe')],'online':Boolean(_0x8732a5[_0x1f3b('0x4a')]),'paused':Boolean(_0x8732a5[_0x2b6013])};if(_0x3c90a5['online'])_0x1924f3[_0x1f3b('0x33')]++;_0x1924f3[_0x1f3b('0x32')][_0x1f3b('0x4b')](_0x3c90a5);}return _0x1924f3;});}function isIdle(_0x5ad0c2){return _0x5ad0c2==='idle'||_0x5ad0c2===_0x1f3b('0x4c')||_0x5ad0c2===_0x1f3b('0x4d')||_0x5ad0c2===_0x1f3b('0x4e')||_[_0x1f3b('0x4f')](_0x5ad0c2);}function isAgentPaused(_0x475187,_0x4d5453){var _0x5d8db5=[_0x475187['chatPause'],_0x475187[_0x1f3b('0x50')],_0x475187[_0x1f3b('0x51')],_0x475187[_0x1f3b('0x52')],_0x475187[_0x1f3b('0x53')],_0x475187['voicePause'],_0x475187[_0x1f3b('0x54')]];if(!_0x4d5453)return _[_0x1f3b('0x55')](_0x5d8db5);var _0x3b404f=_['filter'](_0x5d8db5);return _0x3b404f['length']>0x0&&_0x3b404f['length']<_0x5d8db5[_0x1f3b('0x3b')]?!![]:![];}function isAgentIdle(_0x27a791){if(_0x27a791[_0x1f3b('0x45')]!=='idle'&&_0x27a791[_0x1f3b('0x56')]){_0x27a791['voiceStatus']='pause';return![];}return _['every']([_0x27a791['chatStatus'],_0x27a791['faxStatus'],_0x27a791[_0x1f3b('0x57')],_0x27a791[_0x1f3b('0x58')],_0x27a791[_0x1f3b('0x59')],_0x27a791[_0x1f3b('0x45')],_0x27a791[_0x1f3b('0x5a')]],isIdle);}function getAgentStatus(_0x2e6404){var _0x513fc8='unknown';if(isAgentPaused(_0x2e6404))_0x513fc8='pause';else if(isAgentPaused(_0x2e6404,!![]))_0x513fc8=_0x1f3b('0x5b');else if(isAgentIdle(_0x2e6404))_0x513fc8=_0x1f3b('0x5c');else _0x513fc8=_0x1f3b('0x35');return _0x513fc8;}exports[_0x1f3b('0x5d')]=function(_0xc28612,_0x4f4482){var _0x534596={'count':0x0,'rows':[]},_0x50a825={},_0x158f5c,_0x23c31e,_0x1912f8=['userpic',_0x1f3b('0x4a'),_0x1f3b('0x5e'),_0x1f3b('0x5f'),_0x1f3b('0x60'),'lastPauseAt','internal',_0x1f3b('0x61'),_0x1f3b('0x62'),_0x1f3b('0x52'),_0x1f3b('0x51'),_0x1f3b('0x53'),'whatsappPause',_0x1f3b('0x50'),_0x1f3b('0x56'),'chatCapacity',_0x1f3b('0x63'),'mailCapacity',_0x1f3b('0x64'),'whatsappCapacity',_0x1f3b('0x65'),'chatCurrentCapacity',_0x1f3b('0x66'),_0x1f3b('0x67'),_0x1f3b('0x68'),_0x1f3b('0x69'),_0x1f3b('0x6a'),'chatStatus',_0x1f3b('0x58'),_0x1f3b('0x57'),_0x1f3b('0x59'),_0x1f3b('0x5a'),_0x1f3b('0x6b'),_0x1f3b('0x45'),_0x1f3b('0x6c'),_0x1f3b('0x6d'),_0x1f3b('0x6e'),_0x1f3b('0x6f'),_0x1f3b('0x70'),_0x1f3b('0x71'),_0x1f3b('0x72'),_0x1f3b('0x3a'),_0x1f3b('0x73'),_0x1f3b('0x74'),_0x1f3b('0x75'),_0x1f3b('0x76'),_0x1f3b('0x77')],_0x38bbb5=['chatPause',_0x1f3b('0x52'),'mailPause','smsPause',_0x1f3b('0x54'),_0x1f3b('0x50'),_0x1f3b('0x56'),'online'];Promise[_0x1f3b('0x78')]()[_0x1f3b('0x11')](function(){var _0x210e10=_['map'](db[_0x1f3b('0x79')][_0x1f3b('0x7a')],function(_0x472973){return{'name':_0x472973['fieldName'],'type':_0x472973['type'][_0x1f3b('0x7b')]};});_0xc28612[_0x1f3b('0x7c')][_0x1f3b('0x7d')]=_0x1f3b('0x7e');_0xc28612['query'][_0x1f3b('0x4a')]=!![];_0x50a825=qs[_0x1f3b('0x7f')](_0x210e10,_0xc28612);_0x50a825[_0x1f3b('0x80')]=!![];if(_0xc28612[_0x1f3b('0x81')][_0x1f3b('0x7d')]===_0x1f3b('0x81')){var _0x3af342={'params':{'id':_0xc28612[_0x1f3b('0x81')][_0x1f3b('0x82')]},'query':{'section':'Agents','role':_0x1f3b('0x7e'),'online':!![],'nolimit':_0xc28612[_0x1f3b('0x7c')][_0x1f3b('0x83')],'sort':_0xc28612['query'][_0x1f3b('0x84')],'filter':_0xc28612[_0x1f3b('0x7c')][_0x1f3b('0x39')]},'raw':!![]};return db[_0x1f3b('0x85')][_0x1f3b('0x86')](_0x3af342);}return db['User'][_0x1f3b('0x87')](_0x50a825);})['then'](function(_0x501cfc){_0x534596[_0x1f3b('0x9')]=_0x501cfc[_0x1f3b('0x9')];_0x158f5c=_0x501cfc[_0x1f3b('0x88')];return getRealtimeAgents();})['then'](function(_0x417c50){_0x23c31e=_0x417c50[_0x1f3b('0x88')];return _0x158f5c[_0x1f3b('0x31')](function(_0x48520f){var _0x5c8018=_['find'](_0x23c31e,['id',_0x48520f['id']]);if(_0x5c8018)_[_0x1f3b('0x16')](_0x48520f,_[_0x1f3b('0x38')](_['omit'](_0x5c8018,_0x38bbb5),_0x1912f8));_0x48520f['globalStatus']=getAgentStatus(_0x48520f);return _0x48520f;});})['then'](function(_0x476433){if(_0xc28612[_0x1f3b('0x7c')][_0x1f3b('0x89')]){var _0x59b156=_[_0x1f3b('0x39')](_0x476433,['globalStatus',_0xc28612['query']['globalStatusFilter']]);if(_0xc28612[_0x1f3b('0x7c')][_0x1f3b('0x8a')]){_0x59b156=_['filter'](_0x59b156,[_0x1f3b('0x60'),_0xc28612['query']['pauseTypeFilter']]);}}_0x534596[_0x1f3b('0x88')]=_0x59b156||_0x476433;return _0x534596;})[_0x1f3b('0x11')](respondWithFilteredResult(_0x4f4482,_0x50a825))[_0x1f3b('0x1d')](handleError(_0x4f4482,null));};exports['getQueues']=function(_0x3ada46,_0x29f011){var _0x1360a2=['mail',_0x1f3b('0x8b'),_0x1f3b('0x8c'),'openchannel','fax','whatsapp',_0x1f3b('0x17')];var _0x3b0776={'count':0x0,'rows':[]},_0x1fdeff={},_0xc37ef2,_0x1e63f8,_0x3c5fde,_0x10cd76,_0x49b685;Promise['resolve']()[_0x1f3b('0x11')](function(){if(_0x3ada46[_0x1f3b('0x7c')]['channel']){if(!_[_0x1f3b('0x8d')](_0x1360a2,_0x3ada46['query'][_0x1f3b('0x8e')]['toLowerCase']()))throw new Error('Invalid\x20channel');_0xc37ef2=_0x3ada46['query'][_0x1f3b('0x8e')][_0x1f3b('0x8f')]();}var _0x3900ca=_[_0x1f3b('0x18')](_0xc37ef2)+_0x1f3b('0x46');var _0x3b65bd=_['map'](db[_0x3900ca]['rawAttributes'],function(_0x5be451){return{'name':_0x5be451['fieldName'],'type':_0x5be451[_0x1f3b('0x90')][_0x1f3b('0x7b')]};});_0x1fdeff=qs[_0x1f3b('0x7f')](_0x3b65bd,_0x3ada46);if(_0x3ada46[_0x1f3b('0x81')][_0x1f3b('0x7d')]===_0x1f3b('0x81')){var _0x16d456={'params':{'id':_0x3ada46[_0x1f3b('0x81')]['userProfileId']},'query':{'section':_0xc37ef2===_0x1f3b('0x17')&&_0x3ada46[_0x1f3b('0x7c')][_0x1f3b('0x90')]===_0x1f3b('0x36')?_0x1f3b('0x91'):_[_0x1f3b('0x18')](_0xc37ef2)+_0x1f3b('0x19'),'type':_0x3ada46[_0x1f3b('0x7c')][_0x1f3b('0x90')],'nolimit':!![],'sort':'name','filter':_0x3ada46['query'][_0x1f3b('0x39')]}};return db[_0x1f3b('0x85')]['getResources'](_0x16d456);}return db[_0x3900ca][_0x1f3b('0x87')](_0x1fdeff);})[_0x1f3b('0x11')](function(_0x1c293e){_0x3b0776['count']=_0x1c293e[_0x1f3b('0x9')];_0x1e63f8=_0x1c293e[_0x1f3b('0x88')];return getRealtimeQueues(_0x3ada46,_0xc37ef2);})[_0x1f3b('0x11')](function(_0x595922){_0x10cd76=_0x595922[_0x1f3b('0x88')];return getRealtimeAgents();})[_0x1f3b('0x11')](function(_0x42c934){_0x3c5fde=_0x42c934[_0x1f3b('0x88')];if(_0xc37ef2!=_0x1f3b('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x6448d1){_0x49b685=_0x6448d1?_0x6448d1[_0x1f3b('0x88')]:[];return initializeQueues(_0x1e63f8,_0x10cd76,_0xc37ef2,_0x3ada46[_0x1f3b('0x7c')][_0x1f3b('0x90')]);})['then'](function(_0x3601e8){var _0x2e2a02=_0x3601e8[_0x1f3b('0x31')](function(_0x3816f1){if(_0xc37ef2===_0x1f3b('0x17'))return getVoiceQueueAgents(_0x3816f1,_0x1e63f8,_0x3c5fde,_0x49b685);else return getQueueAgents(_0x3816f1,_0x3c5fde,_0xc37ef2);});return Promise[_0x1f3b('0x92')](_0x2e2a02);})['then'](function(_0xc1de44){_0x3b0776[_0x1f3b('0x88')]=_0xc1de44;return _0x3b0776;})['then'](respondWithFilteredResult(_0x29f011,_0x1fdeff))[_0x1f3b('0x1d')](handleError(_0x29f011,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index dfec1ea..3bec93e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x251a14,_0x18c9dd){var _0x340a75=function(_0x4dcdd6){while(--_0x4dcdd6){_0x251a14['push'](_0x251a14['shift']());}};_0x340a75(++_0x18c9dd);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xb87d55,_0x578ce1){var _0x1c31c8=function(_0x2c0c64){while(--_0x2c0c64){_0xb87d55['push'](_0xb87d55['shift']());}};_0x1c31c8(++_0x578ce1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b04884e..f6577b6 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 _0xf9d5=['DATE','STRING','exports','INTEGER'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf9d5,0x122));var _0x5f9d=function(_0x49c008,_0x15dfd1){_0x49c008=_0x49c008-0x0;var _0x2626e4=_0xf9d5[_0x49c008];return _0x2626e4;};'use strict';var Sequelize=require('sequelize');module[_0x5f9d('0x0')]={'state':{'type':Sequelize[_0x5f9d('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5f9d('0x2')]},'uniqueid':{'type':Sequelize[_0x5f9d('0x3')]},'starttime':{'type':Sequelize[_0x5f9d('0x2')]},'responsetime':{'type':Sequelize[_0x5f9d('0x2')]},'ringtime':{'type':Sequelize[_0x5f9d('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5f9d('0x3')]},'campaigntype':{'type':Sequelize[_0x5f9d('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x446c=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x52d8bc,_0x28c927){var _0x4fc805=function(_0x146d63){while(--_0x146d63){_0x52d8bc['push'](_0x52d8bc['shift']());}};_0x4fc805(++_0x28c927);}(_0x446c,0x156));var _0xc446=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x446c[_0x315aea];return _0x4a4bdb;};'use strict';var Sequelize=require(_0xc446('0x0'));module[_0xc446('0x1')]={'state':{'type':Sequelize[_0xc446('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc446('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc446('0x3')]},'starttime':{'type':Sequelize[_0xc446('0x4')]},'responsetime':{'type':Sequelize[_0xc446('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc446('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 7641895..5327856 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 _0xe16c=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ReportAgentPreview'];(function(_0x1b00d6,_0x1631a5){var _0xa44c49=function(_0x4fdc22){while(--_0x4fdc22){_0x1b00d6['push'](_0x1b00d6['shift']());}};_0xa44c49(++_0x1631a5);}(_0xe16c,0x1b1));var _0xce16=function(_0x155ee9,_0x21ba66){_0x155ee9=_0x155ee9-0x0;var _0x3a0c3f=_0xe16c[_0x155ee9];return _0x3a0c3f;};'use strict';var _=require(_0xce16('0x0'));var util=require(_0xce16('0x1'));var logger=require(_0xce16('0x2'))(_0xce16('0x3'));var moment=require(_0xce16('0x4'));var BPromise=require(_0xce16('0x5'));var rp=require(_0xce16('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce16('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xce16('0x8')]=function(_0x47c987,_0x962e0e){return _0x47c987[_0xce16('0x9')](_0xce16('0xa'),attributes,{'tableName':_0xce16('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64b4=['path','rimraf','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa9fd37,_0x330fcb){var _0x6a05d5=function(_0x22f0e2){while(--_0x22f0e2){_0xa9fd37['push'](_0xa9fd37['shift']());}};_0x6a05d5(++_0x330fcb);}(_0x64b4,0x18c));var _0x464b=function(_0x12e537,_0x4cdd95){_0x12e537=_0x12e537-0x0;var _0x150d7b=_0x64b4[_0x12e537];return _0x150d7b;};'use strict';var _=require(_0x464b('0x0'));var util=require(_0x464b('0x1'));var logger=require(_0x464b('0x2'))(_0x464b('0x3'));var moment=require(_0x464b('0x4'));var BPromise=require(_0x464b('0x5'));var rp=require(_0x464b('0x6'));var fs=require('fs');var path=require(_0x464b('0x7'));var rimraf=require(_0x464b('0x8'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x464b('0x9')]=function(_0x1d6b16,_0x37b06d){return _0x1d6b16[_0x464b('0xa')](_0x464b('0xb'),attributes,{'tableName':_0x464b('0xc'),'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 700c45e..148b110 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 _0x2564=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ccac1,_0x5cc7ea){var _0x10b20b=function(_0x4ed4f5){while(--_0x4ed4f5){_0x3ccac1['push'](_0x3ccac1['shift']());}};_0x10b20b(++_0x5cc7ea);}(_0x2564,0x106));var _0x4256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2564[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4256('0x0'));var BPromise=require(_0x4256('0x1'));var rs=require(_0x4256('0x2'));var fs=require('fs');var Redis=require(_0x4256('0x3'));var db=require(_0x4256('0x4'))['db'];var utils=require(_0x4256('0x5'));var logger=require(_0x4256('0x6'))(_0x4256('0x7'));var config=require(_0x4256('0x8'));var jayson=require(_0x4256('0x9'));var client=jayson[_0x4256('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aaa02,_0x5d4489,_0x17cab8){return new BPromise(function(_0x549b4a,_0xfa9533){return client[_0x4256('0xb')](_0x2aaa02,_0x17cab8)[_0x4256('0xc')](function(_0x524a61){logger[_0x4256('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d4489,_0x4256('0xe'));logger[_0x4256('0xf')](_0x4256('0x10'),_0x5d4489,_0x4256('0xe'),JSON[_0x4256('0x11')](_0x524a61));if(_0x524a61[_0x4256('0x12')]){if(_0x524a61['error']['code']===0x1f4){logger[_0x4256('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d4489,_0x524a61['error'][_0x4256('0x13')]);return _0xfa9533(_0x524a61['error'][_0x4256('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x5d4489,_0x524a61[_0x4256('0x12')][_0x4256('0x13')]);return _0x549b4a(_0x524a61[_0x4256('0x12')][_0x4256('0x13')]);}else{logger['info'](_0x4256('0x14'),_0x5d4489,_0x4256('0xe'));_0x549b4a(_0x524a61[_0x4256('0x15')][_0x4256('0x13')]);}})[_0x4256('0x16')](function(_0x35d4e1){logger[_0x4256('0x12')](_0x4256('0x14'),_0x5d4489,_0x35d4e1);_0xfa9533(_0x35d4e1);});});}exports[_0x4256('0x17')]=function(_0x3a74c0){var _0x353b21=this;return new Promise(function(_0x1dcb4f,_0x1a37d3){return db[_0x4256('0x18')][_0x4256('0x19')](_0x3a74c0['body'],{'raw':_0x3a74c0['options']?_0x3a74c0[_0x4256('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4256('0xc')](function(_0x149252){logger[_0x4256('0xd')](_0x4256('0x17'),_0x3a74c0);logger[_0x4256('0xf')](_0x4256('0x17'),_0x3a74c0,JSON[_0x4256('0x11')](_0x149252));_0x1dcb4f(_0x149252);})[_0x4256('0x16')](function(_0x128045){logger[_0x4256('0x12')](_0x4256('0x17'),_0x128045[_0x4256('0x13')],_0x3a74c0);_0x1a37d3(_0x353b21[_0x4256('0x12')](0x1f4,_0x128045[_0x4256('0x13')]));});});}; \ No newline at end of file +var _0x8eb1=['ReportAgentPreview,\x20%s,\x20%s','message','catch','ReportAgentPreview','body','options','raw','then','CreateReportAgentPreview','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x3f38df,_0x34e56b){var _0x7a6bc1=function(_0x3ee561){while(--_0x3ee561){_0x3f38df['push'](_0x3f38df['shift']());}};_0x7a6bc1(++_0x34e56b);}(_0x8eb1,0x1a9));var _0x18eb=function(_0x550b20,_0x58ce9e){_0x550b20=_0x550b20-0x0;var _0x19fb0a=_0x8eb1[_0x550b20];return _0x19fb0a;};'use strict';var _=require(_0x18eb('0x0'));var util=require(_0x18eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x18eb('0x2'));var fs=require('fs');var Redis=require(_0x18eb('0x3'));var db=require(_0x18eb('0x4'))['db'];var utils=require(_0x18eb('0x5'));var logger=require('../../config/logger')(_0x18eb('0x6'));var config=require(_0x18eb('0x7'));var jayson=require(_0x18eb('0x8'));var client=jayson['client'][_0x18eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3347c6,_0x42845c,_0x56cb79){return new BPromise(function(_0x42659a,_0x407ed0){return client[_0x18eb('0xa')](_0x3347c6,_0x56cb79)['then'](function(_0x2f8ee4){logger[_0x18eb('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x42845c,_0x18eb('0xc'));logger[_0x18eb('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x42845c,_0x18eb('0xc'),JSON[_0x18eb('0xe')](_0x2f8ee4));if(_0x2f8ee4[_0x18eb('0xf')]){if(_0x2f8ee4[_0x18eb('0xf')][_0x18eb('0x10')]===0x1f4){logger[_0x18eb('0xf')](_0x18eb('0x11'),_0x42845c,_0x2f8ee4[_0x18eb('0xf')][_0x18eb('0x12')]);return _0x407ed0(_0x2f8ee4[_0x18eb('0xf')][_0x18eb('0x12')]);}logger[_0x18eb('0xf')](_0x18eb('0x11'),_0x42845c,_0x2f8ee4[_0x18eb('0xf')][_0x18eb('0x12')]);return _0x42659a(_0x2f8ee4[_0x18eb('0xf')][_0x18eb('0x12')]);}else{logger[_0x18eb('0xb')](_0x18eb('0x11'),_0x42845c,_0x18eb('0xc'));_0x42659a(_0x2f8ee4['result'][_0x18eb('0x12')]);}})[_0x18eb('0x13')](function(_0x59e61a){logger['error'](_0x18eb('0x11'),_0x42845c,_0x59e61a);_0x407ed0(_0x59e61a);});});}exports['CreateReportAgentPreview']=function(_0x3bfd5c){var _0x1af973=this;return new Promise(function(_0x177a85,_0x1f2895){return db[_0x18eb('0x14')]['create'](_0x3bfd5c[_0x18eb('0x15')],{'raw':_0x3bfd5c[_0x18eb('0x16')]?_0x3bfd5c[_0x18eb('0x16')][_0x18eb('0x17')]===undefined?!![]:![]:!![]})[_0x18eb('0x18')](function(_0xd063fd){logger[_0x18eb('0xb')](_0x18eb('0x19'),_0x3bfd5c);logger[_0x18eb('0xd')]('CreateReportAgentPreview',_0x3bfd5c,JSON[_0x18eb('0xe')](_0xd063fd));_0x177a85(_0xd063fd);})[_0x18eb('0x13')](function(_0x504f63){logger['error'](_0x18eb('0x19'),_0x504f63[_0x18eb('0x12')],_0x3bfd5c);_0x1f2895(_0x1af973[_0x18eb('0xf')](0x1f4,_0x504f63[_0x18eb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 6460626..1474ea9 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 _0x3bd0=['/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','showMailQueues','queueNotify','/chat/queues/:id','showChatQueues'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x3bd0,0xfa));var _0x03bd=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x3bd0[_0x3c4062];return _0x3f5bf3;};'use strict';var multer=require(_0x03bd('0x0'));var util=require(_0x03bd('0x1'));var path=require(_0x03bd('0x2'));var express=require(_0x03bd('0x3'));var router=express[_0x03bd('0x4')]();var auth=require(_0x03bd('0x5'));var controller=require(_0x03bd('0x6'));router[_0x03bd('0x7')](_0x03bd('0x8'),auth[_0x03bd('0x9')](),controller[_0x03bd('0xa')]);router[_0x03bd('0x7')](_0x03bd('0xb'),auth[_0x03bd('0x9')](),controller[_0x03bd('0xc')]);router[_0x03bd('0x7')](_0x03bd('0xd'),auth[_0x03bd('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x03bd('0x7')]('/voice/queues',auth[_0x03bd('0x9')](),controller[_0x03bd('0xe')]);router[_0x03bd('0x7')](_0x03bd('0xf'),auth['isAuthenticated'](),controller[_0x03bd('0x10')]);router[_0x03bd('0x7')](_0x03bd('0x11'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x12')]);router[_0x03bd('0x7')](_0x03bd('0x13'),auth['isAuthenticated'](),controller[_0x03bd('0x14')]);router[_0x03bd('0x7')]('/openchannel/queues',auth[_0x03bd('0x9')](),controller['openchannelQueues']);router[_0x03bd('0x7')]('/sms/queues',auth[_0x03bd('0x9')](),controller[_0x03bd('0x15')]);router[_0x03bd('0x7')](_0x03bd('0x16'),auth[_0x03bd('0x9')](),controller['whatsappQueues']);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x03bd('0x17')]);router[_0x03bd('0x7')](_0x03bd('0x18'),auth['isAuthenticated'](),controller[_0x03bd('0x19')]);router[_0x03bd('0x7')]('/voice/queues/channels',auth[_0x03bd('0x9')](),controller[_0x03bd('0x1a')]);router[_0x03bd('0x7')](_0x03bd('0x1b'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x1c')]);router[_0x03bd('0x7')](_0x03bd('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x03bd('0x7')](_0x03bd('0x1e'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x1f')]);router[_0x03bd('0x7')](_0x03bd('0x20'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x03bd('0x21')](_0x03bd('0x20'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x22')]);router[_0x03bd('0x7')](_0x03bd('0x23'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x24')]);router[_0x03bd('0x7')]('/outbound/channels',auth[_0x03bd('0x9')](),controller[_0x03bd('0x25')]);router[_0x03bd('0x7')](_0x03bd('0x26'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x27')]);router[_0x03bd('0x21')]('/agents/:id/capacity',auth[_0x03bd('0x9')](),controller[_0x03bd('0x28')]);router['get']('/telephones',auth[_0x03bd('0x9')](),controller['telephones']);router[_0x03bd('0x7')](_0x03bd('0x29'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x2a')]);router[_0x03bd('0x7')](_0x03bd('0x2b'),auth['isAuthenticated'](),controller[_0x03bd('0x2c')]);router[_0x03bd('0x7')](_0x03bd('0x2d'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x2e')]);router[_0x03bd('0x7')](_0x03bd('0x2f'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x30')]);router[_0x03bd('0x7')]('/mail/queues/waitinginteractions',auth[_0x03bd('0x9')](),controller[_0x03bd('0x31')]);router[_0x03bd('0x7')](_0x03bd('0x32'),auth[_0x03bd('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0x03bd('0x7')](_0x03bd('0x33'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x34')]);router[_0x03bd('0x7')](_0x03bd('0x35'),auth[_0x03bd('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x03bd('0x7')](_0x03bd('0x36'),auth['isAuthenticated'](),controller[_0x03bd('0x37')]);router[_0x03bd('0x7')]('/fax/queues/waitinginteractions',auth[_0x03bd('0x9')](),controller[_0x03bd('0x38')]);router[_0x03bd('0x39')]('/mail/queues/:id/notify',auth[_0x03bd('0x9')](),controller['queueNotify']('mail'));router[_0x03bd('0x7')]('/mail/queues/:id',auth[_0x03bd('0x9')](),controller[_0x03bd('0x3a')]);router[_0x03bd('0x39')]('/chat/queues/:id/notify',auth[_0x03bd('0x9')](),controller[_0x03bd('0x3b')]('chat'));router[_0x03bd('0x7')](_0x03bd('0x3c'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x3d')]);router[_0x03bd('0x39')](_0x03bd('0x3e'),auth['isAuthenticated'](),controller[_0x03bd('0x3b')](_0x03bd('0x3f')));router[_0x03bd('0x7')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x03bd('0x40')]);router['post'](_0x03bd('0x41'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x3b')](_0x03bd('0x42')));router[_0x03bd('0x7')](_0x03bd('0x43'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x44')]);router[_0x03bd('0x39')](_0x03bd('0x45'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x3b')]('sms'));router['post'](_0x03bd('0x46'),auth['isAuthenticated'](),controller[_0x03bd('0x3b')](_0x03bd('0x47')));router[_0x03bd('0x7')](_0x03bd('0x48'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x49')]);router[_0x03bd('0x7')](_0x03bd('0x4a'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x4b')]);router[_0x03bd('0x39')](_0x03bd('0x4c'),auth[_0x03bd('0x9')](),controller[_0x03bd('0x4d')]);module['exports']=router; \ No newline at end of file +var _0xd406=['showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id'];(function(_0x427d38,_0xd37cd3){var _0x42cadf=function(_0x49f0bd){while(--_0x49f0bd){_0x427d38['push'](_0x427d38['shift']());}};_0x42cadf(++_0xd37cd3);}(_0xd406,0xe4));var _0x6d40=function(_0x1c3bad,_0x41ec83){_0x1c3bad=_0x1c3bad-0x0;var _0x3f68ea=_0xd406[_0x1c3bad];return _0x3f68ea;};'use strict';var multer=require(_0x6d40('0x0'));var util=require(_0x6d40('0x1'));var path=require('path');var express=require(_0x6d40('0x2'));var router=express[_0x6d40('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x6d40('0x4')](_0x6d40('0x5'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x7')]);router[_0x6d40('0x4')](_0x6d40('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x6d40('0x4')](_0x6d40('0x9'),auth[_0x6d40('0x6')](),controller[_0x6d40('0xa')]);router[_0x6d40('0x4')]('/voice/queues',auth[_0x6d40('0x6')](),controller[_0x6d40('0xb')]);router[_0x6d40('0x4')]('/chat/queues',auth[_0x6d40('0x6')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0x6d40('0x6')](),controller['mailQueues']);router[_0x6d40('0x4')](_0x6d40('0xc'),auth[_0x6d40('0x6')](),controller[_0x6d40('0xd')]);router[_0x6d40('0x4')]('/openchannel/queues',auth[_0x6d40('0x6')](),controller[_0x6d40('0xe')]);router['get'](_0x6d40('0xf'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x10')]);router[_0x6d40('0x4')](_0x6d40('0x11'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x12')]);router['get']('/fax/queues',auth[_0x6d40('0x6')](),controller['faxQueues']);router[_0x6d40('0x4')](_0x6d40('0x13'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x14')]);router[_0x6d40('0x4')](_0x6d40('0x15'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x16')]);router[_0x6d40('0x4')](_0x6d40('0x17'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x18')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x6d40('0x6')](),controller[_0x6d40('0x19')]);router[_0x6d40('0x4')](_0x6d40('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x6d40('0x4')]('/voice/queues/:id',auth[_0x6d40('0x6')](),controller[_0x6d40('0x1b')]);router['put'](_0x6d40('0x1c'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x1d')]);router[_0x6d40('0x4')]('/outbound',auth[_0x6d40('0x6')](),controller[_0x6d40('0x1e')]);router[_0x6d40('0x4')](_0x6d40('0x1f'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x20')]);router[_0x6d40('0x4')](_0x6d40('0x21'),auth[_0x6d40('0x6')](),controller['agents']);router['put'](_0x6d40('0x22'),auth[_0x6d40('0x6')](),controller['agentCapacity']);router[_0x6d40('0x4')]('/telephones',auth[_0x6d40('0x6')](),controller[_0x6d40('0x23')]);router[_0x6d40('0x4')]('/trunks',auth['isAuthenticated'](),controller[_0x6d40('0x24')]);router['get'](_0x6d40('0x25'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x26')]);router[_0x6d40('0x4')](_0x6d40('0x27'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x28')]);router[_0x6d40('0x4')](_0x6d40('0x29'),auth['isAuthenticated'](),controller[_0x6d40('0x2a')]);router[_0x6d40('0x4')](_0x6d40('0x2b'),auth[_0x6d40('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x6d40('0x4')](_0x6d40('0x2c'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x2d')]);router[_0x6d40('0x4')](_0x6d40('0x2e'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x6d40('0x2f'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x30')]);router[_0x6d40('0x4')](_0x6d40('0x31'),auth['isAuthenticated'](),controller[_0x6d40('0x32')]);router[_0x6d40('0x4')](_0x6d40('0x33'),auth['isAuthenticated'](),controller[_0x6d40('0x34')]);router[_0x6d40('0x35')]('/mail/queues/:id/notify',auth[_0x6d40('0x6')](),controller[_0x6d40('0x36')]('mail'));router[_0x6d40('0x4')](_0x6d40('0x37'),auth['isAuthenticated'](),controller[_0x6d40('0x38')]);router[_0x6d40('0x35')](_0x6d40('0x39'),auth['isAuthenticated'](),controller['queueNotify'](_0x6d40('0x3a')));router[_0x6d40('0x4')](_0x6d40('0x3b'),auth['isAuthenticated'](),controller[_0x6d40('0x3c')]);router[_0x6d40('0x35')](_0x6d40('0x3d'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x36')]('fax'));router[_0x6d40('0x4')]('/fax/queues/:id',auth[_0x6d40('0x6')](),controller[_0x6d40('0x3e')]);router['post'](_0x6d40('0x3f'),auth['isAuthenticated'](),controller[_0x6d40('0x36')](_0x6d40('0x40')));router[_0x6d40('0x4')]('/openchannel/queues/:id',auth[_0x6d40('0x6')](),controller[_0x6d40('0x41')]);router[_0x6d40('0x35')](_0x6d40('0x42'),auth[_0x6d40('0x6')](),controller['queueNotify'](_0x6d40('0x43')));router[_0x6d40('0x35')](_0x6d40('0x44'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x36')]('whatsapp'));router[_0x6d40('0x4')](_0x6d40('0x45'),auth['isAuthenticated'](),controller[_0x6d40('0x46')]);router['get'](_0x6d40('0x47'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x48')]);router['post'](_0x6d40('0x49'),auth[_0x6d40('0x6')](),controller[_0x6d40('0x4a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index da46806..e16b2ae 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','SIP/%s','interface'];(function(_0x441b88,_0x25f140){var _0x5e8e25=function(_0x3aee0f){while(--_0x3aee0f){_0x441b88['push'](_0x441b88['shift']());}};_0x5e8e25(++_0x25f140);}(_0xeec6,0x1c2));var _0x6eec=function(_0xdb4e73,_0x30b446){_0xdb4e73=_0xdb4e73-0x0;var _0x4578b4=_0xeec6[_0xdb4e73];return _0x4578b4;};'use strict';var BPromise=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var _=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var jayson=require(_0x6eec('0x6'));var amiClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232a});var mailClient=jayson[_0x6eec('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){var _0x56e849=_0x1c810e?_0x1c810e:amiClient;return _0x56e849[_0x6eec('0x9')](_0x48064a,_0x5a5e47)[_0x6eec('0xa')](function(_0x1c774d){if(_0x1c774d['error']){if(_0x1c774d['error']['code']===0x1f4){return _0x834c2(_0x1c774d[_0x6eec('0xb')][_0x6eec('0xc')]);}return _0x3443c2(_0x1c774d['error']['message']);}else{_0x3443c2(_0x1c774d[_0x6eec('0xd')]);}})['catch'](function(_0x3091d0){_0x834c2(_0x3091d0);});});}function respondWithResult(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xc8;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0xe')](_0x162db1)['json'](_0x3fe94b);}return _0x3387c2[_0x6eec('0xf')](0x194);};}function handleError(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0x1f4;return function(_0xc35914){logger[_0x6eec('0xb')](_0xc35914[_0x6eec('0x10')]);if(_0xc35914[_0x6eec('0x11')]){delete _0xc35914[_0x6eec('0x11')];}_0x3b2972[_0x6eec('0xe')](_0x462dbb)[_0x6eec('0x12')](_0xc35914);};}function findById(_0x5e2a9b){return function(_0x3c0c1b){if(!_['isNil'](_0x5e2a9b)&&!_[_0x6eec('0x13')](_0x3c0c1b)&&!_[_0x6eec('0x13')](_0x3c0c1b['rows'])){return _[_0x6eec('0x14')](_0x3c0c1b[_0x6eec('0x15')],function(_0xb1eab7){return _0xb1eab7['id']==_0x5e2a9b;});}return null;};}exports['voiceChannels']=function(_0x87f3be,_0x1ed94c){return respondWithRpcPromise(_0x6eec('0x16'),_0x87f3be[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1ed94c,null))[_0x6eec('0x18')](handleError(_0x1ed94c,null));};exports['voiceChannelMixMonitor']=function(_0x328693,_0x2f843e){return respondWithRpcPromise(_0x6eec('0x19'),_[_0x6eec('0x1a')](_0x328693[_0x6eec('0x17')],_0x328693[_0x6eec('0x1b')]))['then'](respondWithResult(_0x2f843e,null))[_0x6eec('0x18')](handleError(_0x2f843e,null));};exports[_0x6eec('0x1c')]=function(_0x285d41,_0x27785a){return respondWithRpcPromise(_0x6eec('0x1d'),_[_0x6eec('0x1a')](_0x285d41['query'],_0x285d41[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x27785a,null))[_0x6eec('0x18')](handleError(_0x27785a,null));};exports[_0x6eec('0x1e')]=function(_0x1d2be9,_0x1f386c){return respondWithRpcPromise(_0x6eec('0x1f'),_0x1d2be9[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1f386c,null))['catch'](handleError(_0x1f386c,null));};exports[_0x6eec('0x20')]=function(_0x44b31c,_0x30eb98){return respondWithRpcPromise(_0x6eec('0x1f'),_0x44b31c['query'])[_0x6eec('0xa')](findById(_0x44b31c[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0x30eb98,null))['catch'](handleError(_0x30eb98,null));};exports[_0x6eec('0x21')]=function(_0x47ed95,_0x20a130){return respondWithRpcPromise(_0x6eec('0x22'),_[_0x6eec('0x1a')](_0x47ed95[_0x6eec('0x23')],_0x47ed95[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x20a130,null))[_0x6eec('0x18')](handleError(_0x20a130,null));};exports[_0x6eec('0x24')]=function(_0x1abd19,_0x414f5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6eec('0x1a')](_0x1abd19['query'],_0x1abd19[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x414f5b,null))[_0x6eec('0x18')](handleError(_0x414f5b,null));};exports['voiceQueuesChannels']=function(_0x57b40b,_0x508735){return respondWithRpcPromise(_0x6eec('0x25'),_0x57b40b[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x508735,null))[_0x6eec('0x18')](handleError(_0x508735,null));};exports[_0x6eec('0x26')]=function(_0x23547d,_0x22e0cb){return respondWithRpcPromise(_0x6eec('0x27'),_[_0x6eec('0x1a')](_0x23547d[_0x6eec('0x17')],_0x23547d[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x22e0cb,null))['catch'](handleError(_0x22e0cb,null));};exports[_0x6eec('0x28')]=function(_0x361ab7,_0x2c83d1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x6eec('0x1a')](_0x361ab7[_0x6eec('0x17')],_0x361ab7[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x2c83d1,null))[_0x6eec('0x18')](handleError(_0x2c83d1,null));};exports[_0x6eec('0x29')]=function(_0x4a7699,_0x45cfb6){return respondWithRpcPromise(_0x6eec('0x2a'),_[_0x6eec('0x1a')](_0x4a7699['query'],_0x4a7699['params']))[_0x6eec('0xa')](respondWithResult(_0x45cfb6,null))[_0x6eec('0x18')](handleError(_0x45cfb6,null));};exports[_0x6eec('0x2b')]=function(_0x3f79d1,_0x402bac){return respondWithRpcPromise('Outbound',_0x3f79d1[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x402bac,null))[_0x6eec('0x18')](handleError(_0x402bac,null));};exports[_0x6eec('0x2c')]=function(_0x15918c,_0x2be999){return respondWithRpcPromise(_0x6eec('0x2d'),_0x15918c[_0x6eec('0x17')])['then'](respondWithResult(_0x2be999,null))[_0x6eec('0x18')](handleError(_0x2be999,null));};exports[_0x6eec('0x2e')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0;return respondWithRpcPromise(_0x6eec('0x2f'),_0x4d30c9[_0x6eec('0x17')])[_0x6eec('0xa')](function(_0x4cb50e){_0x160fc0=_0x4cb50e;return respondWithRpcPromise('Agents',_0x4d30c9[_0x6eec('0x17')],routingClient);})['then'](function(_0x5ac8b2){return _[_0x6eec('0x1a')]({},_0x5ac8b2,_0x160fc0);})[_0x6eec('0xa')](respondWithResult(_0x5b3283,null))[_0x6eec('0x18')](handleError(_0x5b3283,null));};exports[_0x6eec('0x30')]=function(_0x25d3f3,_0x58dfe7){if(_0x25d3f3[_0x6eec('0x23')]&&_0x25d3f3[_0x6eec('0x23')]['interaction']&&_0x25d3f3[_0x6eec('0x31')]&&_0x25d3f3[_0x6eec('0x31')]['name']){for(var _0x2d39bf in _0x25d3f3[_0x6eec('0x23')]['interaction']){if(_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x6eec('0x33')](_0x2d39bf)){db[_0x6eec('0x34')]['findAll']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'type':_0x6eec('0x35'),'exitAt':null,'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]&&_0x25d3f3['body']['interaction'][_0x2d39bf][_0x6eec('0x36')]?{'$notIn':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]}:{'$ne':null}}})[_0x6eec('0xa')](function(_0x44c7b8){var _0x59d7a7=moment()[_0x6eec('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20524a=0x0,_0x408295=_0x44c7b8[_0x6eec('0x36')];_0x20524a<_0x408295;_0x20524a+=0x1){_0x44c7b8[_0x20524a]['updateAttributes']({'exitAt':_0x59d7a7});}});for(var _0x2b83f2=0x0;_0x2b83f2<_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x6eec('0x36')];_0x2b83f2+=0x1){db[_0x6eec('0x34')]['findOrCreate']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')]['name'],'type':'INTERACTION','uniqueid':_0x25d3f3[_0x6eec('0x23')]['interaction'][_0x2d39bf][_0x2b83f2],'exitAt':null},'defaults':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'interface':_[_0x6eec('0x13')](_0x25d3f3['user']['interface'])?util[_0x6eec('0x37')](_0x6eec('0x38'),_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')]):_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x39')],'type':_0x6eec('0x35'),'enterAt':moment()[_0x6eec('0x37')](_0x6eec('0x3a')),'role':_0x6eec('0x3b'),'internal':_0x25d3f3['user']['internal'],'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x2b83f2]}});}}}}return respondWithRpcPromise(_0x6eec('0x3c'),{'id':_0x25d3f3['params']['id'],'capacity':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x3d')]},routingClient)[_0x6eec('0xa')](respondWithResult(_0x58dfe7,null))[_0x6eec('0x18')](handleError(_0x58dfe7,null));};exports[_0x6eec('0x3e')]=function(_0x43f77a,_0x10c10a){return respondWithRpcPromise(_0x6eec('0x3f'),_0x43f77a['query'])[_0x6eec('0xa')](respondWithResult(_0x10c10a,null))[_0x6eec('0x18')](handleError(_0x10c10a,null));};exports[_0x6eec('0x40')]=function(_0x3e77f3,_0x490d27){return respondWithRpcPromise('Trunks',_0x3e77f3['query'])[_0x6eec('0xa')](respondWithResult(_0x490d27,null))[_0x6eec('0x18')](handleError(_0x490d27,null));};exports[_0x6eec('0x41')]=function(_0x1de626,_0x5178f5){return respondWithRpcPromise('Campaigns',_0x1de626[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x5178f5,null))[_0x6eec('0x18')](handleError(_0x5178f5,null));};exports['chatQueues']=function(_0x238605,_0x35f411){return respondWithRpcPromise(_0x6eec('0x42'),_0x238605[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x35f411,null))[_0x6eec('0x18')](handleError(_0x35f411,null));};exports[_0x6eec('0x43')]=function(_0x19fe55,_0x45fed3){return respondWithRpcPromise('ChatQueues',_0x19fe55[_0x6eec('0x17')],routingClient)['then'](findById(_0x19fe55[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x45fed3,null))[_0x6eec('0x18')](handleError(_0x45fed3,null));};exports[_0x6eec('0x44')]=function(_0x248d76,_0x360176){return respondWithRpcPromise(_0x6eec('0x45'),_0x248d76['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x360176,null))['catch'](handleError(_0x360176,null));};exports[_0x6eec('0x46')]=function(_0x5c905f,_0x237324){return respondWithRpcPromise(_0x6eec('0x45'),_0x5c905f[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5c905f[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x237324,null))[_0x6eec('0x18')](handleError(_0x237324,null));};exports[_0x6eec('0x47')]=function(_0x130002,_0x4114d1){return respondWithRpcPromise('MailAccounts',_0x130002['query'],mailClient)[_0x6eec('0xa')](respondWithResult(_0x4114d1,null))[_0x6eec('0x18')](handleError(_0x4114d1,null));};exports[_0x6eec('0x48')]=function(_0x2c0644,_0x20b040){return respondWithRpcPromise('OpenchannelQueues',_0x2c0644[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x20b040,null))['catch'](handleError(_0x20b040,null));};exports['showOpenchannelQueues']=function(_0x5dc8b3,_0xaa2a15){return respondWithRpcPromise(_0x6eec('0x49'),_0x5dc8b3['query'],routingClient)[_0x6eec('0xa')](findById(_0x5dc8b3[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0xaa2a15,null))[_0x6eec('0x18')](handleError(_0xaa2a15,null));};exports[_0x6eec('0x4a')]=function(_0xc852b3,_0x3c1f77){return respondWithRpcPromise('SmsQueues',_0xc852b3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x3c1f77,null))[_0x6eec('0x18')](handleError(_0x3c1f77,null));};exports[_0x6eec('0x4b')]=function(_0x19ca46,_0x34c4b4){return respondWithRpcPromise(_0x6eec('0x4c'),_0x19ca46[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x19ca46[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x34c4b4,null))[_0x6eec('0x18')](handleError(_0x34c4b4,null));};exports[_0x6eec('0x4d')]=function(_0x2799ca,_0x386a67){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2799ca[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x386a67,null))['catch'](handleError(_0x386a67,null));};exports[_0x6eec('0x4f')]=function(_0x2236f7,_0x48bb52){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2236f7[_0x6eec('0x17')],routingClient)['then'](findById(_0x2236f7[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x48bb52,null))[_0x6eec('0x18')](handleError(_0x48bb52,null));};exports[_0x6eec('0x50')]=function(_0x4c73f2,_0x40a81a){return respondWithRpcPromise(_0x6eec('0x51'),_0x4c73f2[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x40a81a,null))[_0x6eec('0x18')](handleError(_0x40a81a,null));};exports[_0x6eec('0x52')]=function(_0x5ae0a0,_0x1ed47e){return respondWithRpcPromise('FaxQueues',_0x5ae0a0[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5ae0a0[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x1ed47e,null))[_0x6eec('0x18')](handleError(_0x1ed47e,null));};exports[_0x6eec('0x53')]=function(_0x404b64,_0x2ea7fe){return respondWithRpcPromise(_0x6eec('0x54'),_0x404b64['query'])[_0x6eec('0xa')](respondWithResult(_0x2ea7fe,null))[_0x6eec('0x18')](handleError(_0x2ea7fe,null));};exports[_0x6eec('0x55')]=function(_0x4eef6e,_0x19f8e2){return respondWithRpcPromise(_0x6eec('0x56'),_0x4eef6e['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x19f8e2,null))[_0x6eec('0x18')](handleError(_0x19f8e2,null));};exports[_0x6eec('0x57')]=function(_0x18e62b,_0x266689){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18e62b[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x266689,null))[_0x6eec('0x18')](handleError(_0x266689,null));};exports[_0x6eec('0x58')]=function(_0x3894dc,_0x56483b){return respondWithRpcPromise(_0x6eec('0x59'),_0x3894dc[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x56483b,null))[_0x6eec('0x18')](handleError(_0x56483b,null));};exports[_0x6eec('0x5a')]=function(_0x232b3a,_0x7dd5d1){return respondWithRpcPromise(_0x6eec('0x59'),_0x232b3a['query'],routingClient)[_0x6eec('0xa')](function(_0x59341a){if(_0x232b3a[_0x6eec('0x17')][_0x6eec('0x5b')]!==undefined){var _0x7a7288=_(_0x59341a[_0x6eec('0x15')])['filter']([_0x232b3a[_0x6eec('0x17')]['type'],_0x232b3a[_0x6eec('0x1b')]['id']])[_0x6eec('0x5c')](_0x6eec('0x5d'))[_0x6eec('0x5e')]()['value']();return _0x59341a['rows']['filter'](function(_0x1158b1){return _0x7a7288[_0x6eec('0x5f')](_0x1158b1[_0x6eec('0x5d')])>-0x1;});}else{return _0x59341a[_0x6eec('0x15')]['filter'](function(_0x44302a){return _0x44302a['queue_id']===parseInt(_0x232b3a[_0x6eec('0x1b')]['id']);});}})[_0x6eec('0xa')](respondWithResult(_0x7dd5d1,null))['catch'](handleError(_0x7dd5d1,null));};exports[_0x6eec('0x60')]=function(_0x2f9e8a,_0x333280){return respondWithRpcPromise(_0x6eec('0x61'),_0x2f9e8a[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x333280,null))['catch'](handleError(_0x333280,null));};exports[_0x6eec('0x62')]=function(_0x5aa2f3,_0x64c2ef){return respondWithRpcPromise(_0x6eec('0x63'),_0x5aa2f3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x64c2ef,null))['catch'](handleError(_0x64c2ef,null));};exports[_0x6eec('0x64')]=function(_0x1d1683,_0x8a4166){return respondWithRpcPromise(_0x6eec('0x65'),_0x1d1683['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x8a4166,null))['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x66')]=function(_0x2c0a85){return function(_0x51560c,_0x3dcf9d){var _0x435562,_0x3a90cd;var _0x328f28=_[_0x6eec('0x67')](_0x2c0a85);var _0x514e15=_0x2c0a85===_0x6eec('0x68')?_0x6eec('0x69'):_0x6eec('0x6a');return db[_0x328f28+_0x6eec('0x6b')][_0x6eec('0x6c')]({'raw':!![],'where':{'id':_0x51560c[_0x6eec('0x1b')]['id']}})['then'](function(_0x4a3af3){if(_[_0x6eec('0x13')](_0x4a3af3)){throw new Error(_0x328f28+_0x6eec('0x6d'));}_0x435562=_0x4a3af3;return db[_0x328f28+'Message']['findOne']({'where':{'id':_0x51560c[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0x328f28+'Interaction'],'as':_0x6eec('0x6f')},{'model':db[_0x328f28+_0x514e15],'as':_0x6eec('0x6a')}]});})[_0x6eec('0xa')](function(_0x5042a0){if(_[_0x6eec('0x13')](_0x5042a0)){throw new Error(_0x328f28+'\x20Message\x20not\x20found');}_0x3a90cd=_0x5042a0;return _0x5042a0[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6eec('0xa')](function(){var _0x585432={'uniqueid':_0x2c0a85+'.'+_0x3a90cd['id']+'.'+_0x3a90cd[_0x6eec('0x6f')]['id'],'FromUserId':_0x51560c[_0x6eec('0x31')]['id'],'type':_0x6eec('0x71')};_0x585432[_0x328f28+'MessageId']=_0x3a90cd['id'];_0x585432[_0x328f28+_0x6eec('0x72')]=_0x3a90cd[_0x6eec('0x6f')]['id'];_0x585432[_0x6eec('0x73')+_0x328f28+_0x514e15+'Id']=_0x3a90cd[_0x6eec('0x6a')]['id'];_0x585432['To'+_0x328f28+_0x6eec('0x74')]=_0x435562['id'];return db[_0x328f28+_0x6eec('0x75')]['create'](_0x585432);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0x2c0a85,'interaction':_0x3a90cd[_0x6eec('0x6f')],'message':_0x3a90cd,'account':_0x3a90cd[_0x6eec('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6eec('0x71'),'appdata':_0x435562[_0x6eec('0x11')]+','+(_0x3a90cd[_0x6eec('0x6a')][_0x6eec('0x77')]||0x12c),'interval':_0x6eec('0x78')}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x3dcf9d,null))[_0x6eec('0x18')](handleError(_0x3dcf9d,null));};};exports[_0x6eec('0x79')]=function(_0x56043a,_0x1419e0){var _0x1d6604,_0x10fad1;if(_[_0x6eec('0x13')](_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')])){throw new Error(_0x6eec('0x7b'));}var _0xa94ada=_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')];var _0xaddba4=_[_0x6eec('0x67')](_0xa94ada);var _0x89aace=_0xa94ada===_0x6eec('0x68')?_0x6eec('0x69'):'Account';return db[_0x6eec('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x56043a[_0x6eec('0x1b')]['id'],'role':_0x6eec('0x3b')}})[_0x6eec('0xa')](function(_0x2607ca){if(_['isNil'](_0x2607ca)){throw new Error(_0x6eec('0x7d'));}_0x1d6604=_0x2607ca;return db[_0xaddba4+'Message'][_0x6eec('0x6c')]({'where':{'id':_0x56043a[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0xaddba4+_0x6eec('0x6f')],'as':_0x6eec('0x6f')},{'model':db[_0xaddba4+_0x89aace],'as':_0x6eec('0x6a')}]});})['then'](function(_0x2888f4){if(_[_0x6eec('0x13')](_0x2888f4)){throw new Error(_0xaddba4+_0x6eec('0x7e'));}_0x10fad1=_0x2888f4;return _0x2888f4[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5229db={'uniqueid':_0xa94ada+'.'+_0x10fad1['id']+'.'+_0x10fad1[_0x6eec('0x6f')]['id'],'FromUserId':_0x56043a[_0x6eec('0x31')]['id'],'type':'queue','ToUserId':_0x1d6604['id']};_0x5229db[_0xaddba4+'MessageId']=_0x10fad1['id'];_0x5229db[_0xaddba4+_0x6eec('0x72')]=_0x10fad1[_0x6eec('0x6f')]['id'];_0x5229db['From'+_0xaddba4+_0x89aace+'Id']=_0x10fad1[_0x6eec('0x6a')]['id'];return db[_0xaddba4+_0x6eec('0x75')]['create'](_0x5229db);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0xa94ada,'interaction':_0x10fad1[_0x6eec('0x6f')],'message':_0x10fad1,'account':_0x10fad1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1d6604['name']+','+(_0x10fad1[_0x6eec('0x6a')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x1419e0,null))['catch'](handleError(_0x1419e0,null));}; \ No newline at end of file +var _0x3eea=['whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4571db,_0x11843c){_0x4571db=_0x4571db-0x0;var _0x418362=_0x3eea[_0x4571db];return _0x418362;};'use strict';var BPromise=require(_0xa3ee('0x0'));var moment=require('moment');var _=require(_0xa3ee('0x1'));var util=require(_0xa3ee('0x2'));var db=require(_0xa3ee('0x3'))['db'];var logger=require(_0xa3ee('0x4'))(_0xa3ee('0x5'));var jayson=require(_0xa3ee('0x6'));var amiClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232a});var mailClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232b});var routingClient=jayson[_0xa3ee('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){var _0x1eeb5b=_0x4e4588?_0x4e4588:amiClient;return _0x1eeb5b['request'](_0x538bf9,_0x4183ee)[_0xa3ee('0x9')](function(_0x5ef236){if(_0x5ef236[_0xa3ee('0xa')]){if(_0x5ef236[_0xa3ee('0xa')][_0xa3ee('0xb')]===0x1f4){return _0x56f37b(_0x5ef236['error'][_0xa3ee('0xc')]);}return _0x37a3f0(_0x5ef236[_0xa3ee('0xa')]['message']);}else{_0x37a3f0(_0x5ef236['result']);}})[_0xa3ee('0xd')](function(_0x30e652){_0x56f37b(_0x30e652);});});}function respondWithResult(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xc8;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0xe')](_0x4363d1)['json'](_0x594c88);}return _0x403518[_0xa3ee('0xf')](0x194);};}function handleError(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0x1f4;return function(_0x150e20){logger['error'](_0x150e20[_0xa3ee('0x10')]);if(_0x150e20[_0xa3ee('0x11')]){delete _0x150e20['name'];}_0x20535f['status'](_0x2c34cf)['send'](_0x150e20);};}function findById(_0x40decb){return function(_0x7277cd){if(!_[_0xa3ee('0x12')](_0x40decb)&&!_[_0xa3ee('0x12')](_0x7277cd)&&!_['isNil'](_0x7277cd[_0xa3ee('0x13')])){return _[_0xa3ee('0x14')](_0x7277cd[_0xa3ee('0x13')],function(_0x299b1e){return _0x299b1e['id']==_0x40decb;});}return null;};}exports[_0xa3ee('0x15')]=function(_0x4aac0e,_0x377b9d){return respondWithRpcPromise(_0xa3ee('0x16'),_0x4aac0e[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x377b9d,null))[_0xa3ee('0xd')](handleError(_0x377b9d,null));};exports[_0xa3ee('0x18')]=function(_0x4f8c56,_0x3f5d70){return respondWithRpcPromise(_0xa3ee('0x19'),_['merge'](_0x4f8c56[_0xa3ee('0x17')],_0x4f8c56['params']))[_0xa3ee('0x9')](respondWithResult(_0x3f5d70,null))[_0xa3ee('0xd')](handleError(_0x3f5d70,null));};exports[_0xa3ee('0x1a')]=function(_0x1bd196,_0x60b899){return respondWithRpcPromise(_0xa3ee('0x1b'),_[_0xa3ee('0x1c')](_0x1bd196[_0xa3ee('0x17')],_0x1bd196[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x60b899,null))['catch'](handleError(_0x60b899,null));};exports[_0xa3ee('0x1e')]=function(_0x1dca29,_0x157071){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x1dca29[_0xa3ee('0x17')])['then'](respondWithResult(_0x157071,null))[_0xa3ee('0xd')](handleError(_0x157071,null));};exports[_0xa3ee('0x20')]=function(_0x146493,_0xd9a7f8){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x146493[_0xa3ee('0x17')])[_0xa3ee('0x9')](findById(_0x146493[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0xd9a7f8,null))[_0xa3ee('0xd')](handleError(_0xd9a7f8,null));};exports['updateVoiceQueue']=function(_0x5ba571,_0x4abf49){return respondWithRpcPromise(_0xa3ee('0x21'),_['merge'](_0x5ba571[_0xa3ee('0x22')],_0x5ba571[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x4abf49,null))[_0xa3ee('0xd')](handleError(_0x4abf49,null));};exports[_0xa3ee('0x23')]=function(_0x14547d,_0x30ba4e){return respondWithRpcPromise(_0xa3ee('0x24'),_[_0xa3ee('0x1c')](_0x14547d[_0xa3ee('0x17')],_0x14547d['params']))[_0xa3ee('0x9')](respondWithResult(_0x30ba4e,null))['catch'](handleError(_0x30ba4e,null));};exports[_0xa3ee('0x25')]=function(_0x332d61,_0x496839){return respondWithRpcPromise(_0xa3ee('0x26'),_0x332d61['query'])[_0xa3ee('0x9')](respondWithResult(_0x496839,null))['catch'](handleError(_0x496839,null));};exports[_0xa3ee('0x27')]=function(_0x299099,_0x2f803c){return respondWithRpcPromise(_0xa3ee('0x28'),_[_0xa3ee('0x1c')](_0x299099['query'],_0x299099[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x2f803c,null))[_0xa3ee('0xd')](handleError(_0x2f803c,null));};exports['voiceQueuesChannelHangup']=function(_0x1599e4,_0x531f58){return respondWithRpcPromise(_0xa3ee('0x29'),_['merge'](_0x1599e4[_0xa3ee('0x17')],_0x1599e4['params']))[_0xa3ee('0x9')](respondWithResult(_0x531f58,null))[_0xa3ee('0xd')](handleError(_0x531f58,null));};exports[_0xa3ee('0x2a')]=function(_0x45be9b,_0x1717ba){return respondWithRpcPromise(_0xa3ee('0x2b'),_[_0xa3ee('0x1c')](_0x45be9b[_0xa3ee('0x17')],_0x45be9b[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x1717ba,null))[_0xa3ee('0xd')](handleError(_0x1717ba,null));};exports[_0xa3ee('0x2c')]=function(_0x447efd,_0x595b55){return respondWithRpcPromise(_0xa3ee('0x2d'),_0x447efd[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x595b55,null))[_0xa3ee('0xd')](handleError(_0x595b55,null));};exports['outboundChannels']=function(_0x257627,_0x11a721){return respondWithRpcPromise(_0xa3ee('0x2e'),_0x257627['query'])[_0xa3ee('0x9')](respondWithResult(_0x11a721,null))[_0xa3ee('0xd')](handleError(_0x11a721,null));};exports['agents']=function(_0x319c26,_0x3ecbe6){var _0x4ef99a;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')])[_0xa3ee('0x9')](function(_0x2c8873){_0x4ef99a=_0x2c8873;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')],routingClient);})[_0xa3ee('0x9')](function(_0x3e0eec){return _[_0xa3ee('0x1c')]({},_0x3e0eec,_0x4ef99a);})[_0xa3ee('0x9')](respondWithResult(_0x3ecbe6,null))[_0xa3ee('0xd')](handleError(_0x3ecbe6,null));};exports['agentCapacity']=function(_0x5aa4b3,_0x548534){if(_0x5aa4b3[_0xa3ee('0x22')]&&_0x5aa4b3[_0xa3ee('0x22')]['interaction']&&_0x5aa4b3[_0xa3ee('0x30')]&&_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]){for(var _0x55f47f in _0x5aa4b3[_0xa3ee('0x22')]['interaction']){if(_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0xa3ee('0x32')](_0x55f47f)){db[_0xa3ee('0x33')][_0xa3ee('0x34')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'exitAt':null,'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]&&_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')]?{'$notIn':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]}:{'$ne':null}}})[_0xa3ee('0x9')](function(_0x25e0fe){var _0x4594e1=moment()['format'](_0xa3ee('0x37'));for(var _0xdca412=0x0,_0x112e80=_0x25e0fe[_0xa3ee('0x36')];_0xdca412<_0x112e80;_0xdca412+=0x1){_0x25e0fe[_0xdca412]['updateAttributes']({'exitAt':_0x4594e1});}});for(var _0x30fcf1=0x0;_0x30fcf1<_0x5aa4b3['body'][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')];_0x30fcf1+=0x1){db[_0xa3ee('0x33')][_0xa3ee('0x38')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1],'exitAt':null},'defaults':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')]['name'],'interface':_[_0xa3ee('0x12')](_0x5aa4b3['user']['interface'])?util[_0xa3ee('0x39')](_0xa3ee('0x3a'),_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]):_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x3b')],'type':_0xa3ee('0x35'),'enterAt':moment()['format'](_0xa3ee('0x37')),'role':_0xa3ee('0x3c'),'internal':_0x5aa4b3['user'][_0xa3ee('0x3d')],'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5aa4b3['params']['id'],'capacity':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x3e')]},routingClient)[_0xa3ee('0x9')](respondWithResult(_0x548534,null))[_0xa3ee('0xd')](handleError(_0x548534,null));};exports[_0xa3ee('0x3f')]=function(_0x57e654,_0x55678e){return respondWithRpcPromise(_0xa3ee('0x40'),_0x57e654[_0xa3ee('0x17')])['then'](respondWithResult(_0x55678e,null))[_0xa3ee('0xd')](handleError(_0x55678e,null));};exports[_0xa3ee('0x41')]=function(_0x13cd8b,_0x579ec8){return respondWithRpcPromise('Trunks',_0x13cd8b[_0xa3ee('0x17')])['then'](respondWithResult(_0x579ec8,null))[_0xa3ee('0xd')](handleError(_0x579ec8,null));};exports[_0xa3ee('0x42')]=function(_0x5b8e79,_0x4232e0){return respondWithRpcPromise(_0xa3ee('0x43'),_0x5b8e79[_0xa3ee('0x17')])['then'](respondWithResult(_0x4232e0,null))[_0xa3ee('0xd')](handleError(_0x4232e0,null));};exports[_0xa3ee('0x44')]=function(_0x594034,_0x1d832c){return respondWithRpcPromise(_0xa3ee('0x45'),_0x594034[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x1d832c,null))['catch'](handleError(_0x1d832c,null));};exports[_0xa3ee('0x46')]=function(_0x17ac07,_0x4a1a2f){return respondWithRpcPromise(_0xa3ee('0x45'),_0x17ac07[_0xa3ee('0x17')],routingClient)['then'](findById(_0x17ac07['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x4a1a2f,null))[_0xa3ee('0xd')](handleError(_0x4a1a2f,null));};exports[_0xa3ee('0x47')]=function(_0x52b824,_0x11fb6e){return respondWithRpcPromise(_0xa3ee('0x48'),_0x52b824[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x11fb6e,null))[_0xa3ee('0xd')](handleError(_0x11fb6e,null));};exports[_0xa3ee('0x49')]=function(_0x497be4,_0x10f508){return respondWithRpcPromise(_0xa3ee('0x48'),_0x497be4['query'],routingClient)[_0xa3ee('0x9')](findById(_0x497be4[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x10f508,null))[_0xa3ee('0xd')](handleError(_0x10f508,null));};exports[_0xa3ee('0x4a')]=function(_0x330778,_0x4a2255){return respondWithRpcPromise(_0xa3ee('0x4b'),_0x330778[_0xa3ee('0x17')],mailClient)[_0xa3ee('0x9')](respondWithResult(_0x4a2255,null))['catch'](handleError(_0x4a2255,null));};exports[_0xa3ee('0x4c')]=function(_0x13b81b,_0x519f10){return respondWithRpcPromise('OpenchannelQueues',_0x13b81b['query'],routingClient)['then'](respondWithResult(_0x519f10,null))[_0xa3ee('0xd')](handleError(_0x519f10,null));};exports[_0xa3ee('0x4d')]=function(_0x3adafb,_0x2f0424){return respondWithRpcPromise(_0xa3ee('0x4e'),_0x3adafb[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x3adafb['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x2f0424,null))[_0xa3ee('0xd')](handleError(_0x2f0424,null));};exports[_0xa3ee('0x4f')]=function(_0xaff641,_0x147024){return respondWithRpcPromise('SmsQueues',_0xaff641['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x147024,null))[_0xa3ee('0xd')](handleError(_0x147024,null));};exports[_0xa3ee('0x50')]=function(_0x24613d,_0x16aabe){return respondWithRpcPromise(_0xa3ee('0x51'),_0x24613d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x24613d[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x16aabe,null))[_0xa3ee('0xd')](handleError(_0x16aabe,null));};exports[_0xa3ee('0x52')]=function(_0x64f353,_0x224790){return respondWithRpcPromise(_0xa3ee('0x53'),_0x64f353['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x224790,null))['catch'](handleError(_0x224790,null));};exports['showWhatsappQueues']=function(_0x2b1c6e,_0x49daf9){return respondWithRpcPromise(_0xa3ee('0x53'),_0x2b1c6e[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x2b1c6e[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x49daf9,null))[_0xa3ee('0xd')](handleError(_0x49daf9,null));};exports[_0xa3ee('0x54')]=function(_0x179ae2,_0x370e3e){return respondWithRpcPromise('FaxQueues',_0x179ae2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x370e3e,null))['catch'](handleError(_0x370e3e,null));};exports[_0xa3ee('0x55')]=function(_0x52a066,_0x4f3aac){return respondWithRpcPromise(_0xa3ee('0x56'),_0x52a066['query'],routingClient)['then'](findById(_0x52a066[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x4f3aac,null))['catch'](handleError(_0x4f3aac,null));};exports[_0xa3ee('0x57')]=function(_0xf8689f,_0x538a9b){return respondWithRpcPromise('FaxAccounts',_0xf8689f['query'])[_0xa3ee('0x9')](respondWithResult(_0x538a9b,null))[_0xa3ee('0xd')](handleError(_0x538a9b,null));};exports[_0xa3ee('0x58')]=function(_0x7844ae,_0x389547){return respondWithRpcPromise(_0xa3ee('0x59'),_0x7844ae['query'],routingClient)['then'](respondWithResult(_0x389547,null))[_0xa3ee('0xd')](handleError(_0x389547,null));};exports[_0xa3ee('0x5a')]=function(_0x42a79e,_0x5675fb){return respondWithRpcPromise(_0xa3ee('0x5b'),_0x42a79e[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x5675fb,null))[_0xa3ee('0xd')](handleError(_0x5675fb,null));};exports[_0xa3ee('0x5c')]=function(_0x3be877,_0x2ad745){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x3be877['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2ad745,null))[_0xa3ee('0xd')](handleError(_0x2ad745,null));};exports[_0xa3ee('0x5e')]=function(_0x37e1c2,_0xbfb429){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x37e1c2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](function(_0x448f14){if(_0x37e1c2['query']['type']!==undefined){var _0x228671=_(_0x448f14['rows'])[_0xa3ee('0x5f')]([_0x37e1c2[_0xa3ee('0x17')][_0xa3ee('0x60')],_0x37e1c2[_0xa3ee('0x1d')]['id']])['map'](_0xa3ee('0x61'))[_0xa3ee('0x62')]()[_0xa3ee('0x63')]();return _0x448f14[_0xa3ee('0x13')][_0xa3ee('0x5f')](function(_0x4e9473){return _0x228671[_0xa3ee('0x64')](_0x4e9473[_0xa3ee('0x61')])>-0x1;});}else{return _0x448f14[_0xa3ee('0x13')]['filter'](function(_0x3ca523){return _0x3ca523['queue_id']===parseInt(_0x37e1c2[_0xa3ee('0x1d')]['id']);});}})['then'](respondWithResult(_0xbfb429,null))[_0xa3ee('0xd')](handleError(_0xbfb429,null));};exports[_0xa3ee('0x65')]=function(_0x119c3d,_0x140ee0){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x119c3d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x140ee0,null))['catch'](handleError(_0x140ee0,null));};exports[_0xa3ee('0x66')]=function(_0xa82482,_0x44b084){return respondWithRpcPromise(_0xa3ee('0x67'),_0xa82482[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x44b084,null))[_0xa3ee('0xd')](handleError(_0x44b084,null));};exports[_0xa3ee('0x68')]=function(_0x55a6b7,_0x2535ef){return respondWithRpcPromise(_0xa3ee('0x69'),_0x55a6b7[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2535ef,null))[_0xa3ee('0xd')](handleError(_0x2535ef,null));};exports[_0xa3ee('0x6a')]=function(_0x31d3ca){return function(_0x329e32,_0x37bde3){var _0x25334c,_0x4f7ace;var _0x21fd56=_[_0xa3ee('0x6b')](_0x31d3ca);var _0x26a124=_0x31d3ca==='chat'?_0xa3ee('0x6c'):'Account';return db[_0x21fd56+_0xa3ee('0x6d')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x329e32['params']['id']}})[_0xa3ee('0x9')](function(_0x44f27b){if(_['isNil'](_0x44f27b)){throw new Error(_0x21fd56+_0xa3ee('0x6f'));}_0x25334c=_0x44f27b;return db[_0x21fd56+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x329e32[_0xa3ee('0x22')][_0xa3ee('0x71')]},'include':[{'model':db[_0x21fd56+_0xa3ee('0x72')],'as':'Interaction'},{'model':db[_0x21fd56+_0x26a124],'as':'Account'}]});})['then'](function(_0x27454a){if(_['isNil'](_0x27454a)){throw new Error(_0x21fd56+_0xa3ee('0x73'));}_0x4f7ace=_0x27454a;return _0x27454a[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x312ad8={'uniqueid':_0x31d3ca+'.'+_0x4f7ace['id']+'.'+_0x4f7ace[_0xa3ee('0x72')]['id'],'FromUserId':_0x329e32[_0xa3ee('0x30')]['id'],'type':_0xa3ee('0x75')};_0x312ad8[_0x21fd56+_0xa3ee('0x76')]=_0x4f7ace['id'];_0x312ad8[_0x21fd56+_0xa3ee('0x77')]=_0x4f7ace[_0xa3ee('0x72')]['id'];_0x312ad8[_0xa3ee('0x78')+_0x21fd56+_0x26a124+'Id']=_0x4f7ace[_0xa3ee('0x79')]['id'];_0x312ad8['To'+_0x21fd56+_0xa3ee('0x7a')]=_0x25334c['id'];return db[_0x21fd56+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x312ad8);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x31d3ca,'interaction':_0x4f7ace[_0xa3ee('0x72')],'message':_0x4f7ace,'account':_0x4f7ace[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x25334c[_0xa3ee('0x11')]+','+(_0x4f7ace[_0xa3ee('0x79')][_0xa3ee('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x37bde3,null))[_0xa3ee('0xd')](handleError(_0x37bde3,null));};};exports[_0xa3ee('0x7f')]=function(_0x591bfa,_0x5b53f1){var _0x24cbc9,_0x157436;if(_[_0xa3ee('0x12')](_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')])){throw new Error(_0xa3ee('0x81'));}var _0x18a74b=_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')];var _0x3e6657=_[_0xa3ee('0x6b')](_0x18a74b);var _0x3236b3=_0x18a74b===_0xa3ee('0x82')?'Website':_0xa3ee('0x79');return db[_0xa3ee('0x83')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x591bfa[_0xa3ee('0x1d')]['id'],'role':_0xa3ee('0x3c')}})[_0xa3ee('0x9')](function(_0x4cc5e5){if(_['isNil'](_0x4cc5e5)){throw new Error(_0xa3ee('0x84'));}_0x24cbc9=_0x4cc5e5;return db[_0x3e6657+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x591bfa['body'][_0xa3ee('0x71')]},'include':[{'model':db[_0x3e6657+'Interaction'],'as':_0xa3ee('0x72')},{'model':db[_0x3e6657+_0x3236b3],'as':_0xa3ee('0x79')}]});})[_0xa3ee('0x9')](function(_0x10ec99){if(_[_0xa3ee('0x12')](_0x10ec99)){throw new Error(_0x3e6657+_0xa3ee('0x73'));}_0x157436=_0x10ec99;return _0x10ec99[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x116de1={'uniqueid':_0x18a74b+'.'+_0x157436['id']+'.'+_0x157436[_0xa3ee('0x72')]['id'],'FromUserId':_0x591bfa['user']['id'],'type':'queue','ToUserId':_0x24cbc9['id']};_0x116de1[_0x3e6657+'MessageId']=_0x157436['id'];_0x116de1[_0x3e6657+_0xa3ee('0x77')]=_0x157436['Interaction']['id'];_0x116de1[_0xa3ee('0x78')+_0x3e6657+_0x3236b3+'Id']=_0x157436[_0xa3ee('0x79')]['id'];return db[_0x3e6657+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x116de1);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x18a74b,'interaction':_0x157436[_0xa3ee('0x72')],'message':_0x157436,'account':_0x157436[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa3ee('0x3c'),'appdata':_0x24cbc9['name']+','+(_0x157436['Account'][_0xa3ee('0x85')]||0x12c),'interval':_0xa3ee('0x86')}]},routingClient);})[_0xa3ee('0x9')](respondWithResult(_0x5b53f1,null))[_0xa3ee('0xd')](handleError(_0x5b53f1,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a395eec..a18d485 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 _0xf323=['/:id','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','show','/:id/run','post','create','put','update','delete'];(function(_0x43d2c6,_0x3ccdf4){var _0xb4cfa2=function(_0x26842d){while(--_0x26842d){_0x43d2c6['push'](_0x43d2c6['shift']());}};_0xb4cfa2(++_0x3ccdf4);}(_0xf323,0x87));var _0x3f32=function(_0x3a9026,_0xf6b1cf){_0x3a9026=_0x3a9026-0x0;var _0x21eab6=_0xf323[_0x3a9026];return _0x21eab6;};'use strict';var multer=require('multer');var util=require(_0x3f32('0x0'));var path=require(_0x3f32('0x1'));var timeout=require(_0x3f32('0x2'));var express=require('express');var router=express[_0x3f32('0x3')]();var fs_extra=require(_0x3f32('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3f32('0x5'));var config=require('../../config/environment');var controller=require(_0x3f32('0x6'));router[_0x3f32('0x7')]('/',auth[_0x3f32('0x8')](),controller[_0x3f32('0x9')]);router[_0x3f32('0x7')]('/:id',auth[_0x3f32('0x8')](),controller[_0x3f32('0xa')]);router[_0x3f32('0x7')](_0x3f32('0xb'),auth[_0x3f32('0x8')](),controller['run']);router[_0x3f32('0xc')]('/',auth['isAuthenticated'](),controller[_0x3f32('0xd')]);router[_0x3f32('0xe')]('/:id',auth[_0x3f32('0x8')](),controller[_0x3f32('0xf')]);router[_0x3f32('0x10')](_0x3f32('0x11'),auth[_0x3f32('0x8')](),controller[_0x3f32('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6665=['show','/:id/run','run','create','update','/:id','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6665,0x14c));var _0x5666=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x6665[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x5666('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5666('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5666('0x2'));var auth=require(_0x5666('0x3'));var interaction=require(_0x5666('0x4'));var config=require(_0x5666('0x5'));var controller=require(_0x5666('0x6'));router['get']('/',auth[_0x5666('0x7')](),controller[_0x5666('0x8')]);router[_0x5666('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5666('0xa')]);router[_0x5666('0x9')](_0x5666('0xb'),auth[_0x5666('0x7')](),controller[_0x5666('0xc')]);router['post']('/',auth[_0x5666('0x7')](),controller[_0x5666('0xd')]);router['put']('/:id',auth[_0x5666('0x7')](),controller[_0x5666('0xe')]);router['delete'](_0x5666('0xf'),auth[_0x5666('0x7')](),controller[_0x5666('0x10')]);module[_0x5666('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6710b8a..f1fba54 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 _0x5241=['csv','pdf','xlsx','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','days','hours','minutes'];(function(_0x13c9ec,_0x507aaf){var _0x281aa3=function(_0x24dfcf){while(--_0x24dfcf){_0x13c9ec['push'](_0x13c9ec['shift']());}};_0x281aa3(++_0x507aaf);}(_0x5241,0x16e));var _0x1524=function(_0x513d1f,_0x539d0b){_0x513d1f=_0x513d1f-0x0;var _0x20d802=_0x5241[_0x513d1f];return _0x20d802;};'use strict';var Sequelize=require(_0x1524('0x0'));module[_0x1524('0x1')]={'name':{'type':Sequelize[_0x1524('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1524('0x2')]},'active':{'type':Sequelize[_0x1524('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1524('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x1524('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x1524('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1524('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1524('0x6')](_0x1524('0x7'),_0x1524('0x8'),'months','weeks',_0x1524('0x9'),_0x1524('0xa'),_0x1524('0xb')),'allowNull':![],'defaultValue':_0x1524('0x9')},'output':{'type':Sequelize[_0x1524('0x6')](_0x1524('0xc'),_0x1524('0xd'),_0x1524('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x1524('0x6')]('custom',_0x1524('0xf')),'allowNull':![],'defaultValue':_0x1524('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x1524('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x1524('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x1524('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xad9c=['xlsx','csv','custom','default','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','minutes','days'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xad9c,0x138));var _0xcad9=function(_0x27df6a,_0x59e43c){_0x27df6a=_0x27df6a-0x0;var _0x25e655=_0xad9c[_0x27df6a];return _0x25e655;};'use strict';var Sequelize=require(_0xcad9('0x0'));module['exports']={'name':{'type':Sequelize[_0xcad9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcad9('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcad9('0x2')},'startAt':{'type':Sequelize[_0xcad9('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcad9('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcad9('0x5')](_0xcad9('0x6'),'quarters',_0xcad9('0x7'),_0xcad9('0x8'),'days','hours',_0xcad9('0x9')),'allowNull':![],'defaultValue':_0xcad9('0xa')},'output':{'type':Sequelize[_0xcad9('0x5')]('csv','pdf',_0xcad9('0xb')),'allowNull':![],'defaultValue':_0xcad9('0xc')},'type':{'type':Sequelize[_0xcad9('0x5')](_0xcad9('0xd'),_0xcad9('0xe')),'allowNull':![],'defaultValue':_0xcad9('0xd')},'sendMail':{'type':Sequelize[_0xcad9('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xcad9('0x1')]},'cc':{'type':Sequelize[_0xcad9('0x10')]},'bcc':{'type':Sequelize[_0xcad9('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xcad9('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 703a61d..bec2be2 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 _0x29ed=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','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','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','reject','save','update','then','destroy','get','error','name','send','index','map','Schedule','rawAttributes','type','key','model'];(function(_0x4d0e47,_0xbc2522){var _0x54886f=function(_0x4c3bb5){while(--_0x4c3bb5){_0x4d0e47['push'](_0x4d0e47['shift']());}};_0x54886f(++_0xbc2522);}(_0x29ed,0x173));var _0xd29e=function(_0xc94941,_0x5a9cf2){_0xc94941=_0xc94941-0x0;var _0x4bcf9c=_0x29ed[_0xc94941];return _0x4bcf9c;};'use strict';var emlformat=require(_0xd29e('0x0'));var rimraf=require(_0xd29e('0x1'));var zipdir=require(_0xd29e('0x2'));var jsonpatch=require(_0xd29e('0x3'));var rp=require(_0xd29e('0x4'));var moment=require(_0xd29e('0x5'));var BPromise=require(_0xd29e('0x6'));var Mustache=require('mustache');var util=require(_0xd29e('0x7'));var path=require(_0xd29e('0x8'));var sox=require(_0xd29e('0x9'));var csv=require(_0xd29e('0xa'));var ejs=require(_0xd29e('0xb'));var fs=require('fs');var fs_extra=require(_0xd29e('0xc'));var _=require(_0xd29e('0xd'));var squel=require('squel');var crypto=require(_0xd29e('0xe'));var jsforce=require(_0xd29e('0xf'));var deskjs=require(_0xd29e('0x10'));var toCsv=require(_0xd29e('0xa'));var querystring=require(_0xd29e('0x11'));var Papa=require(_0xd29e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd29e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd29e('0x14'));var utils=require(_0xd29e('0x15'));var config=require(_0xd29e('0x16'));var licenseUtil=require(_0xd29e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c03b7,_0x1f2640){_0x1f2640=_0x1f2640||0xcc;return function(_0x5ca772){if(_0x5ca772){return _0x1c03b7[_0xd29e('0x18')](_0x1f2640);}return _0x1c03b7[_0xd29e('0x19')](_0x1f2640)[_0xd29e('0x1a')]();};}function respondWithResult(_0x3c9ba4,_0x367a24){_0x367a24=_0x367a24||0xc8;return function(_0x27d8c2){if(_0x27d8c2){return _0x3c9ba4[_0xd29e('0x19')](_0x367a24)[_0xd29e('0x1b')](_0x27d8c2);}};}function respondWithFilteredResult(_0x4d28fc,_0x20a25f){return function(_0x2c36be){if(_0x2c36be){var _0x4fa740=typeof _0x20a25f['offset']==='undefined'&&typeof _0x20a25f[_0xd29e('0x1c')]===_0xd29e('0x1d');var _0xcec912=_0x2c36be[_0xd29e('0x1e')];var _0x1b0e69=_0x4fa740?0x0:_0x20a25f[_0xd29e('0x1f')];var _0x1b8f40=_0x4fa740?_0x2c36be[_0xd29e('0x1e')]:_0x20a25f['offset']+_0x20a25f['limit'];var _0x431323;if(_0x1b8f40>=_0xcec912){_0x1b8f40=_0xcec912;_0x431323=0xc8;}else{_0x431323=0xce;}_0x4d28fc[_0xd29e('0x19')](_0x431323);return _0x4d28fc[_0xd29e('0x20')]('Content-Range',_0x1b0e69+'-'+_0x1b8f40+'/'+_0xcec912)['json'](_0x2c36be);}return null;};}function patchUpdates(_0x154842){return function(_0x271907){try{jsonpatch['apply'](_0x271907,_0x154842,!![]);}catch(_0x5a7615){return BPromise[_0xd29e('0x21')](_0x5a7615);}return _0x271907[_0xd29e('0x22')]();};}function saveUpdates(_0x13c506,_0x6f9165){return function(_0x2c2f67){if(_0x2c2f67){return _0x2c2f67[_0xd29e('0x23')](_0x13c506)[_0xd29e('0x24')](function(_0x1efa06){return _0x1efa06;});}return null;};}function removeEntity(_0xd06832,_0x12efbc){return function(_0x215cbe){if(_0x215cbe){return _0x215cbe[_0xd29e('0x25')]()[_0xd29e('0x24')](function(){var _0x26d50e=_0x215cbe[_0xd29e('0x26')]({'plain':!![]});var _0x362381='Scheduler';return db['UserProfileResource'][_0xd29e('0x25')]({'where':{'type':_0x362381,'resourceId':_0x26d50e['id']}})[_0xd29e('0x24')](function(){return _0x215cbe;});})[_0xd29e('0x24')](function(){_0xd06832[_0xd29e('0x19')](0xcc)[_0xd29e('0x1a')]();});}};}function handleEntityNotFound(_0xa61e4f,_0x5850f4){return function(_0x123fca){if(!_0x123fca){_0xa61e4f[_0xd29e('0x18')](0x194);}return _0x123fca;};}function handleError(_0xbee67b,_0x513ca5){_0x513ca5=_0x513ca5||0x1f4;return function(_0x252bbd){logger[_0xd29e('0x27')](_0x252bbd['stack']);if(_0x252bbd[_0xd29e('0x28')]){delete _0x252bbd[_0xd29e('0x28')];}_0xbee67b['status'](_0x513ca5)[_0xd29e('0x29')](_0x252bbd);};}exports[_0xd29e('0x2a')]=function(_0x2ab93d,_0x2bd7ea){var _0x50144e={},_0x409a71={},_0x401f47={'count':0x0,'rows':[]};var _0x1bd681=_[_0xd29e('0x2b')](db[_0xd29e('0x2c')][_0xd29e('0x2d')],function(_0x105dd1){return{'name':_0x105dd1['fieldName'],'type':_0x105dd1[_0xd29e('0x2e')][_0xd29e('0x2f')]};});_0x409a71[_0xd29e('0x30')]=_[_0xd29e('0x2b')](_0x1bd681,_0xd29e('0x28'));_0x409a71[_0xd29e('0x31')]=_[_0xd29e('0x32')](_0x2ab93d[_0xd29e('0x31')]);_0x409a71['filters']=_[_0xd29e('0x33')](_0x409a71[_0xd29e('0x30')],_0x409a71[_0xd29e('0x31')]);_0x50144e['attributes']=_[_0xd29e('0x33')](_0x409a71[_0xd29e('0x30')],qs[_0xd29e('0x34')](_0x2ab93d['query']['fields']));_0x50144e['attributes']=_0x50144e[_0xd29e('0x35')][_0xd29e('0x36')]?_0x50144e[_0xd29e('0x35')]:_0x409a71[_0xd29e('0x30')];if(!_0x2ab93d[_0xd29e('0x31')][_0xd29e('0x37')](_0xd29e('0x38'))){_0x50144e[_0xd29e('0x1c')]=qs[_0xd29e('0x1c')](_0x2ab93d['query']['limit']);_0x50144e['offset']=qs[_0xd29e('0x1f')](_0x2ab93d[_0xd29e('0x31')]['offset']);}_0x50144e[_0xd29e('0x39')]=qs[_0xd29e('0x3a')](_0x2ab93d[_0xd29e('0x31')]['sort']);_0x50144e[_0xd29e('0x3b')]=qs[_0xd29e('0x3c')](_[_0xd29e('0x3d')](_0x2ab93d[_0xd29e('0x31')],_0x409a71[_0xd29e('0x3c')]),_0x1bd681);if(_0x2ab93d['query'][_0xd29e('0x3e')]){_0x50144e['where']=_['merge'](_0x50144e['where'],{'$or':_[_0xd29e('0x2b')](_0x1bd681,function(_0x503268){if(_0x503268['type']!==_0xd29e('0x3f')){var _0x3792b9={};_0x3792b9[_0x503268['name']]={'$like':'%'+_0x2ab93d[_0xd29e('0x31')][_0xd29e('0x3e')]+'%'};return _0x3792b9;}})});}_0x50144e=_['merge']({},_0x50144e,_0x2ab93d[_0xd29e('0x40')]);var _0x3e781d={'where':_0x50144e[_0xd29e('0x3b')]};return db[_0xd29e('0x2c')]['count'](_0x3e781d)[_0xd29e('0x24')](function(_0x5170a9){_0x401f47['count']=_0x5170a9;if(_0x2ab93d[_0xd29e('0x31')][_0xd29e('0x41')]){_0x50144e[_0xd29e('0x42')]=[{'all':!![]}];}return db[_0xd29e('0x2c')]['findAll'](_0x50144e);})[_0xd29e('0x24')](function(_0x2b5811){_0x401f47[_0xd29e('0x43')]=_0x2b5811;return _0x401f47;})[_0xd29e('0x24')](respondWithFilteredResult(_0x2bd7ea,_0x50144e))[_0xd29e('0x44')](handleError(_0x2bd7ea,null));};exports[_0xd29e('0x45')]=function(_0x518af5,_0x4d741f){var _0x2f4609={'raw':![],'where':{'id':_0x518af5[_0xd29e('0x46')]['id']}},_0x3bf075={};_0x3bf075[_0xd29e('0x30')]=_[_0xd29e('0x32')](db[_0xd29e('0x2c')][_0xd29e('0x2d')]);_0x3bf075[_0xd29e('0x31')]=_[_0xd29e('0x32')](_0x518af5['query']);_0x3bf075['filters']=_[_0xd29e('0x33')](_0x3bf075[_0xd29e('0x30')],_0x3bf075['query']);_0x2f4609['attributes']=_[_0xd29e('0x33')](_0x3bf075['model'],qs[_0xd29e('0x34')](_0x518af5[_0xd29e('0x31')][_0xd29e('0x34')]));_0x2f4609[_0xd29e('0x35')]=_0x2f4609[_0xd29e('0x35')][_0xd29e('0x36')]?_0x2f4609[_0xd29e('0x35')]:_0x3bf075[_0xd29e('0x30')];if(_0x518af5[_0xd29e('0x31')][_0xd29e('0x41')]){_0x2f4609[_0xd29e('0x42')]=[{'all':!![]}];}_0x2f4609=_[_0xd29e('0x47')]({},_0x2f4609,_0x518af5['options']);return db['Schedule']['find'](_0x2f4609)[_0xd29e('0x24')](handleEntityNotFound(_0x4d741f,null))['then'](respondWithResult(_0x4d741f,null))[_0xd29e('0x44')](handleError(_0x4d741f,null));};exports['create']=function(_0x22f3c5,_0x4fb7c2){return db[_0xd29e('0x2c')][_0xd29e('0x48')](_0x22f3c5[_0xd29e('0x49')],{})[_0xd29e('0x24')](function(_0x4de905){var _0x49e71f=_0x22f3c5[_0xd29e('0x4a')][_0xd29e('0x26')]({'plain':!![]});if(!_0x49e71f)throw new Error(_0xd29e('0x4b'));if(_0x49e71f['role']===_0xd29e('0x4a')){var _0x5dad82=_0x4de905[_0xd29e('0x26')]({'plain':!![]});var _0x4cbec8='Scheduler';return db[_0xd29e('0x4c')][_0xd29e('0x4d')]({'where':{'name':_0x4cbec8,'userProfileId':_0x49e71f[_0xd29e('0x4e')]},'raw':!![]})[_0xd29e('0x24')](function(_0x4f9ee3){if(_0x4f9ee3&&_0x4f9ee3[_0xd29e('0x4f')]===0x0){return db[_0xd29e('0x50')][_0xd29e('0x48')]({'name':_0x5dad82[_0xd29e('0x28')],'resourceId':_0x5dad82['id'],'type':_0x4f9ee3[_0xd29e('0x28')],'sectionId':_0x4f9ee3['id']},{})[_0xd29e('0x24')](function(){return _0x4de905;});}else{return _0x4de905;}})[_0xd29e('0x44')](function(_0x3f6cea){logger[_0xd29e('0x27')](_0xd29e('0x51'),_0x3f6cea);throw _0x3f6cea;});}return _0x4de905;})[_0xd29e('0x24')](respondWithResult(_0x4fb7c2,0xc9))[_0xd29e('0x44')](handleError(_0x4fb7c2,null));};exports[_0xd29e('0x23')]=function(_0x1237e0,_0x274601){if(_0x1237e0[_0xd29e('0x49')]['id']){delete _0x1237e0[_0xd29e('0x49')]['id'];}return db[_0xd29e('0x2c')]['find']({'where':{'id':_0x1237e0[_0xd29e('0x46')]['id']}})[_0xd29e('0x24')](handleEntityNotFound(_0x274601,null))['then'](saveUpdates(_0x1237e0[_0xd29e('0x49')],null))['then'](respondWithResult(_0x274601,null))[_0xd29e('0x44')](handleError(_0x274601,null));};exports[_0xd29e('0x25')]=function(_0x3e8b04,_0x535c3a){return db['Schedule']['find']({'where':{'id':_0x3e8b04['params']['id']}})[_0xd29e('0x24')](handleEntityNotFound(_0x535c3a,null))[_0xd29e('0x24')](removeEntity(_0x535c3a,null))[_0xd29e('0x44')](handleError(_0x535c3a,null));};exports[_0xd29e('0x52')]=function(_0x2757c6,_0x42db51,_0x1b2358){var _0x24cdb4=require(_0xd29e('0x53'));return db[_0xd29e('0x2c')][_0xd29e('0x4d')]({'where':{'id':_0x2757c6[_0xd29e('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x42db51,null))[_0xd29e('0x24')](function(){_0x24cdb4[_0xd29e('0x52')](_0x2757c6[_0xd29e('0x46')]['id']);})['then'](respondWithStatusCode(_0x42db51,null))[_0xd29e('0x44')](handleError(_0x42db51,null));}; \ No newline at end of file +var _0x9cad=['api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','map','Schedule','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1bcd54,_0x19f631){var _0x170e4f=function(_0x4b33f0){while(--_0x4b33f0){_0x1bcd54['push'](_0x1bcd54['shift']());}};_0x170e4f(++_0x19f631);}(_0x9cad,0x1e8));var _0xd9ca=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x9cad[_0x16ea87];return _0x6e7b1c;};'use strict';var emlformat=require(_0xd9ca('0x0'));var rimraf=require(_0xd9ca('0x1'));var zipdir=require(_0xd9ca('0x2'));var jsonpatch=require(_0xd9ca('0x3'));var rp=require(_0xd9ca('0x4'));var moment=require(_0xd9ca('0x5'));var BPromise=require(_0xd9ca('0x6'));var Mustache=require(_0xd9ca('0x7'));var util=require(_0xd9ca('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd9ca('0x9'));var ejs=require(_0xd9ca('0xa'));var fs=require('fs');var fs_extra=require(_0xd9ca('0xb'));var _=require(_0xd9ca('0xc'));var squel=require('squel');var crypto=require(_0xd9ca('0xd'));var jsforce=require(_0xd9ca('0xe'));var deskjs=require(_0xd9ca('0xf'));var toCsv=require(_0xd9ca('0x9'));var querystring=require('querystring');var Papa=require(_0xd9ca('0x10'));var Redis=require(_0xd9ca('0x11'));var authService=require(_0xd9ca('0x12'));var qs=require(_0xd9ca('0x13'));var as=require(_0xd9ca('0x14'));var hardwareService=require(_0xd9ca('0x15'));var logger=require('../../config/logger')(_0xd9ca('0x16'));var utils=require(_0xd9ca('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd9ca('0x18'))['db'];function respondWithStatusCode(_0xb8d3c7,_0x33c211){_0x33c211=_0x33c211||0xcc;return function(_0x15e5c8){if(_0x15e5c8){return _0xb8d3c7['sendStatus'](_0x33c211);}return _0xb8d3c7[_0xd9ca('0x19')](_0x33c211)['end']();};}function respondWithResult(_0x17efca,_0x2f9734){_0x2f9734=_0x2f9734||0xc8;return function(_0x4c5ee0){if(_0x4c5ee0){return _0x17efca[_0xd9ca('0x19')](_0x2f9734)[_0xd9ca('0x1a')](_0x4c5ee0);}};}function respondWithFilteredResult(_0x1f80b8,_0x1fdaf8){return function(_0x3975f6){if(_0x3975f6){var _0x3b6dc8=typeof _0x1fdaf8[_0xd9ca('0x1b')]===_0xd9ca('0x1c')&&typeof _0x1fdaf8[_0xd9ca('0x1d')]===_0xd9ca('0x1c');var _0x30d36c=_0x3975f6[_0xd9ca('0x1e')];var _0x566fc5=_0x3b6dc8?0x0:_0x1fdaf8[_0xd9ca('0x1b')];var _0x4cc852=_0x3b6dc8?_0x3975f6['count']:_0x1fdaf8[_0xd9ca('0x1b')]+_0x1fdaf8[_0xd9ca('0x1d')];var _0x4609e1;if(_0x4cc852>=_0x30d36c){_0x4cc852=_0x30d36c;_0x4609e1=0xc8;}else{_0x4609e1=0xce;}_0x1f80b8[_0xd9ca('0x19')](_0x4609e1);return _0x1f80b8['set']('Content-Range',_0x566fc5+'-'+_0x4cc852+'/'+_0x30d36c)[_0xd9ca('0x1a')](_0x3975f6);}return null;};}function patchUpdates(_0x81298){return function(_0x4649de){try{jsonpatch['apply'](_0x4649de,_0x81298,!![]);}catch(_0x25f177){return BPromise[_0xd9ca('0x1f')](_0x25f177);}return _0x4649de[_0xd9ca('0x20')]();};}function saveUpdates(_0x1e40f6,_0x190a9c){return function(_0x46ad4c){if(_0x46ad4c){return _0x46ad4c[_0xd9ca('0x21')](_0x1e40f6)[_0xd9ca('0x22')](function(_0x138113){return _0x138113;});}return null;};}function removeEntity(_0x4db3e6,_0x3723f2){return function(_0x45664c){if(_0x45664c){return _0x45664c[_0xd9ca('0x23')]()['then'](function(){var _0x29e245=_0x45664c[_0xd9ca('0x24')]({'plain':!![]});var _0x368353='Scheduler';return db[_0xd9ca('0x25')][_0xd9ca('0x23')]({'where':{'type':_0x368353,'resourceId':_0x29e245['id']}})[_0xd9ca('0x22')](function(){return _0x45664c;});})[_0xd9ca('0x22')](function(){_0x4db3e6[_0xd9ca('0x19')](0xcc)[_0xd9ca('0x26')]();});}};}function handleEntityNotFound(_0x3b7e12,_0x35139e){return function(_0x79f3a2){if(!_0x79f3a2){_0x3b7e12[_0xd9ca('0x27')](0x194);}return _0x79f3a2;};}function handleError(_0x27956a,_0x2fd2f3){_0x2fd2f3=_0x2fd2f3||0x1f4;return function(_0x14c5f5){logger[_0xd9ca('0x28')](_0x14c5f5[_0xd9ca('0x29')]);if(_0x14c5f5[_0xd9ca('0x2a')]){delete _0x14c5f5[_0xd9ca('0x2a')];}_0x27956a[_0xd9ca('0x19')](_0x2fd2f3)[_0xd9ca('0x2b')](_0x14c5f5);};}exports['index']=function(_0x5c56e9,_0x439d51){var _0x50a196={},_0x21e46a={},_0x16184e={'count':0x0,'rows':[]};var _0x37a79b=_[_0xd9ca('0x2c')](db[_0xd9ca('0x2d')]['rawAttributes'],function(_0x41361c){return{'name':_0x41361c['fieldName'],'type':_0x41361c[_0xd9ca('0x2e')][_0xd9ca('0x2f')]};});_0x21e46a[_0xd9ca('0x30')]=_['map'](_0x37a79b,_0xd9ca('0x2a'));_0x21e46a[_0xd9ca('0x31')]=_[_0xd9ca('0x32')](_0x5c56e9['query']);_0x21e46a[_0xd9ca('0x33')]=_['intersection'](_0x21e46a[_0xd9ca('0x30')],_0x21e46a['query']);_0x50a196[_0xd9ca('0x34')]=_[_0xd9ca('0x35')](_0x21e46a[_0xd9ca('0x30')],qs['fields'](_0x5c56e9[_0xd9ca('0x31')][_0xd9ca('0x36')]));_0x50a196[_0xd9ca('0x34')]=_0x50a196['attributes'][_0xd9ca('0x37')]?_0x50a196[_0xd9ca('0x34')]:_0x21e46a[_0xd9ca('0x30')];if(!_0x5c56e9[_0xd9ca('0x31')]['hasOwnProperty'](_0xd9ca('0x38'))){_0x50a196[_0xd9ca('0x1d')]=qs[_0xd9ca('0x1d')](_0x5c56e9['query'][_0xd9ca('0x1d')]);_0x50a196[_0xd9ca('0x1b')]=qs[_0xd9ca('0x1b')](_0x5c56e9[_0xd9ca('0x31')][_0xd9ca('0x1b')]);}_0x50a196[_0xd9ca('0x39')]=qs[_0xd9ca('0x3a')](_0x5c56e9['query'][_0xd9ca('0x3a')]);_0x50a196[_0xd9ca('0x3b')]=qs[_0xd9ca('0x33')](_[_0xd9ca('0x3c')](_0x5c56e9[_0xd9ca('0x31')],_0x21e46a['filters']),_0x37a79b);if(_0x5c56e9[_0xd9ca('0x31')][_0xd9ca('0x3d')]){_0x50a196[_0xd9ca('0x3b')]=_[_0xd9ca('0x3e')](_0x50a196['where'],{'$or':_['map'](_0x37a79b,function(_0xae06fe){if(_0xae06fe[_0xd9ca('0x2e')]!==_0xd9ca('0x3f')){var _0x219de2={};_0x219de2[_0xae06fe[_0xd9ca('0x2a')]]={'$like':'%'+_0x5c56e9['query'][_0xd9ca('0x3d')]+'%'};return _0x219de2;}})});}_0x50a196=_['merge']({},_0x50a196,_0x5c56e9[_0xd9ca('0x40')]);var _0x24d42d={'where':_0x50a196[_0xd9ca('0x3b')]};return db['Schedule'][_0xd9ca('0x1e')](_0x24d42d)[_0xd9ca('0x22')](function(_0x393001){_0x16184e[_0xd9ca('0x1e')]=_0x393001;if(_0x5c56e9[_0xd9ca('0x31')][_0xd9ca('0x41')]){_0x50a196[_0xd9ca('0x42')]=[{'all':!![]}];}return db[_0xd9ca('0x2d')][_0xd9ca('0x43')](_0x50a196);})[_0xd9ca('0x22')](function(_0x33d2df){_0x16184e[_0xd9ca('0x44')]=_0x33d2df;return _0x16184e;})[_0xd9ca('0x22')](respondWithFilteredResult(_0x439d51,_0x50a196))[_0xd9ca('0x45')](handleError(_0x439d51,null));};exports['show']=function(_0x2aca80,_0x2b2520){var _0x45ef0b={'raw':![],'where':{'id':_0x2aca80[_0xd9ca('0x46')]['id']}},_0x584ca8={};_0x584ca8[_0xd9ca('0x30')]=_[_0xd9ca('0x32')](db[_0xd9ca('0x2d')][_0xd9ca('0x47')]);_0x584ca8['query']=_[_0xd9ca('0x32')](_0x2aca80['query']);_0x584ca8[_0xd9ca('0x33')]=_[_0xd9ca('0x35')](_0x584ca8[_0xd9ca('0x30')],_0x584ca8[_0xd9ca('0x31')]);_0x45ef0b['attributes']=_['intersection'](_0x584ca8['model'],qs[_0xd9ca('0x36')](_0x2aca80[_0xd9ca('0x31')][_0xd9ca('0x36')]));_0x45ef0b[_0xd9ca('0x34')]=_0x45ef0b[_0xd9ca('0x34')][_0xd9ca('0x37')]?_0x45ef0b['attributes']:_0x584ca8[_0xd9ca('0x30')];if(_0x2aca80[_0xd9ca('0x31')][_0xd9ca('0x41')]){_0x45ef0b[_0xd9ca('0x42')]=[{'all':!![]}];}_0x45ef0b=_['merge']({},_0x45ef0b,_0x2aca80['options']);return db[_0xd9ca('0x2d')]['find'](_0x45ef0b)[_0xd9ca('0x22')](handleEntityNotFound(_0x2b2520,null))[_0xd9ca('0x22')](respondWithResult(_0x2b2520,null))[_0xd9ca('0x45')](handleError(_0x2b2520,null));};exports[_0xd9ca('0x48')]=function(_0x573dad,_0x4b9e55){return db[_0xd9ca('0x2d')][_0xd9ca('0x48')](_0x573dad[_0xd9ca('0x49')],{})['then'](function(_0xaf1d81){var _0x3e8d65=_0x573dad[_0xd9ca('0x4a')][_0xd9ca('0x24')]({'plain':!![]});if(!_0x3e8d65)throw new Error(_0xd9ca('0x4b'));if(_0x3e8d65[_0xd9ca('0x4c')]==='user'){var _0x14fecf=_0xaf1d81[_0xd9ca('0x24')]({'plain':!![]});var _0x95a855=_0xd9ca('0x4d');return db[_0xd9ca('0x4e')][_0xd9ca('0x4f')]({'where':{'name':_0x95a855,'userProfileId':_0x3e8d65[_0xd9ca('0x50')]},'raw':!![]})['then'](function(_0x1aa541){if(_0x1aa541&&_0x1aa541[_0xd9ca('0x51')]===0x0){return db['UserProfileResource'][_0xd9ca('0x48')]({'name':_0x14fecf[_0xd9ca('0x2a')],'resourceId':_0x14fecf['id'],'type':_0x1aa541[_0xd9ca('0x2a')],'sectionId':_0x1aa541['id']},{})[_0xd9ca('0x22')](function(){return _0xaf1d81;});}else{return _0xaf1d81;}})[_0xd9ca('0x45')](function(_0x2e9fac){logger[_0xd9ca('0x28')](_0xd9ca('0x52'),_0x2e9fac);throw _0x2e9fac;});}return _0xaf1d81;})[_0xd9ca('0x22')](respondWithResult(_0x4b9e55,0xc9))[_0xd9ca('0x45')](handleError(_0x4b9e55,null));};exports[_0xd9ca('0x21')]=function(_0x201867,_0x1bf45c){if(_0x201867[_0xd9ca('0x49')]['id']){delete _0x201867['body']['id'];}return db[_0xd9ca('0x2d')][_0xd9ca('0x4f')]({'where':{'id':_0x201867['params']['id']}})[_0xd9ca('0x22')](handleEntityNotFound(_0x1bf45c,null))['then'](saveUpdates(_0x201867[_0xd9ca('0x49')],null))[_0xd9ca('0x22')](respondWithResult(_0x1bf45c,null))['catch'](handleError(_0x1bf45c,null));};exports[_0xd9ca('0x23')]=function(_0x18a21d,_0xd29735){return db[_0xd9ca('0x2d')][_0xd9ca('0x4f')]({'where':{'id':_0x18a21d[_0xd9ca('0x46')]['id']}})[_0xd9ca('0x22')](handleEntityNotFound(_0xd29735,null))[_0xd9ca('0x22')](removeEntity(_0xd29735,null))[_0xd9ca('0x45')](handleError(_0xd29735,null));};exports[_0xd9ca('0x53')]=function(_0x232e84,_0x508079,_0x8b1484){var _0xdb7bd3=require(_0xd9ca('0x54'));return db[_0xd9ca('0x2d')]['find']({'where':{'id':_0x232e84[_0xd9ca('0x46')]['id']},'raw':!![]})[_0xd9ca('0x22')](handleEntityNotFound(_0x508079,null))['then'](function(){_0xdb7bd3[_0xd9ca('0x53')](_0x232e84[_0xd9ca('0x46')]['id']);})[_0xd9ca('0x22')](respondWithStatusCode(_0x508079,null))[_0xd9ca('0x45')](handleError(_0x508079,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 79cc497..82810ef 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 _0xe006=['tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x1bd23f,_0x20e2c0){var _0x25edbd=function(_0x527c40){while(--_0x527c40){_0x1bd23f['push'](_0x1bd23f['shift']());}};_0x25edbd(++_0x20e2c0);}(_0xe006,0x112));var _0x6e00=function(_0x2a7c2a,_0x37cc9e){_0x2a7c2a=_0x2a7c2a-0x0;var _0x195732=_0xe006[_0x2a7c2a];return _0x195732;};'use strict';var _=require(_0x6e00('0x0'));var util=require(_0x6e00('0x1'));var logger=require(_0x6e00('0x2'))('api');var moment=require(_0x6e00('0x3'));var BPromise=require(_0x6e00('0x4'));var rp=require(_0x6e00('0x5'));var fs=require('fs');var path=require(_0x6e00('0x6'));var rimraf=require(_0x6e00('0x7'));var config=require(_0x6e00('0x8'));var attributes=require('./schedule.attributes');module[_0x6e00('0x9')]=function(_0x2ebf9f,_0x3b7774){return _0x2ebf9f[_0x6e00('0xa')](_0x6e00('0xb'),attributes,{'tableName':_0x6e00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['moment','request-promise','path','rimraf','../../config/environment','exports','define','Schedule','lodash','util','../../config/logger','api'];(function(_0x157e91,_0xd5644c){var _0x2d45c3=function(_0x1bc547){while(--_0x1bc547){_0x157e91['push'](_0x157e91['shift']());}};_0x2d45c3(++_0xd5644c);}(_0x687b,0x1f4));var _0xb687=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x687b[_0x1075b8];return _0x5d047f;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require(_0xb687('0x4'));var BPromise=require('bluebird');var rp=require(_0xb687('0x5'));var fs=require('fs');var path=require(_0xb687('0x6'));var rimraf=require(_0xb687('0x7'));var config=require(_0xb687('0x8'));var attributes=require('./schedule.attributes');module[_0xb687('0x9')]=function(_0x3378e6,_0x4c5ffd){return _0x3378e6[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index c94fcee..0092842 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 _0x1431=['rpc','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1431,0x124));var _0x1143=function(_0x20f15c,_0x2ff7a7){_0x20f15c=_0x20f15c-0x0;var _0x28a815=_0x1431[_0x20f15c];return _0x28a815;};'use strict';var _=require('lodash');var util=require(_0x1143('0x0'));var moment=require(_0x1143('0x1'));var BPromise=require(_0x1143('0x2'));var rs=require(_0x1143('0x3'));var fs=require('fs');var Redis=require(_0x1143('0x4'));var db=require(_0x1143('0x5'))['db'];var utils=require(_0x1143('0x6'));var logger=require('../../config/logger')(_0x1143('0x7'));var config=require(_0x1143('0x8'));var jayson=require(_0x1143('0x9'));var client=jayson[_0x1143('0xa')][_0x1143('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5d7c,_0x34073a,_0x4829be){return new BPromise(function(_0x2cf597,_0x1f98d1){return client[_0x1143('0xc')](_0x3d5d7c,_0x4829be)[_0x1143('0xd')](function(_0xa35237){logger['info'](_0x1143('0xe'),_0x34073a,_0x1143('0xf'));logger['debug'](_0x1143('0x10'),_0x34073a,_0x1143('0xf'),JSON[_0x1143('0x11')](_0xa35237));if(_0xa35237[_0x1143('0x12')]){if(_0xa35237[_0x1143('0x12')][_0x1143('0x13')]===0x1f4){logger['error'](_0x1143('0xe'),_0x34073a,_0xa35237[_0x1143('0x12')]['message']);return _0x1f98d1(_0xa35237[_0x1143('0x12')][_0x1143('0x14')]);}logger[_0x1143('0x12')](_0x1143('0xe'),_0x34073a,_0xa35237[_0x1143('0x12')]['message']);return _0x2cf597(_0xa35237[_0x1143('0x12')][_0x1143('0x14')]);}else{logger[_0x1143('0x15')](_0x1143('0xe'),_0x34073a,_0x1143('0xf'));_0x2cf597(_0xa35237[_0x1143('0x16')][_0x1143('0x14')]);}})['catch'](function(_0x389a8c){logger[_0x1143('0x12')](_0x1143('0xe'),_0x34073a,_0x389a8c);_0x1f98d1(_0x389a8c);});});} \ No newline at end of file +var _0x93d8=['../../config/logger','rpc','../../config/environment','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x34a167,_0x33f078){var _0x2e05a8=function(_0x15a8a3){while(--_0x15a8a3){_0x34a167['push'](_0x34a167['shift']());}};_0x2e05a8(++_0x33f078);}(_0x93d8,0x1f4));var _0x893d=function(_0x369bde,_0x115fd4){_0x369bde=_0x369bde-0x0;var _0x453bc9=_0x93d8[_0x369bde];return _0x453bc9;};'use strict';var _=require(_0x893d('0x0'));var util=require(_0x893d('0x1'));var moment=require(_0x893d('0x2'));var BPromise=require(_0x893d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x893d('0x4'));var db=require(_0x893d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x893d('0x6'))(_0x893d('0x7'));var config=require(_0x893d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x893d('0x9')][_0x893d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201993,_0xf1e997,_0x1014c1){return new BPromise(function(_0x58f3ef,_0x29e354){return client[_0x893d('0xb')](_0x201993,_0x1014c1)['then'](function(_0xa6a8f7){logger[_0x893d('0xc')](_0x893d('0xd'),_0xf1e997,_0x893d('0xe'));logger[_0x893d('0xf')](_0x893d('0x10'),_0xf1e997,'request\x20sent',JSON[_0x893d('0x11')](_0xa6a8f7));if(_0xa6a8f7[_0x893d('0x12')]){if(_0xa6a8f7[_0x893d('0x12')][_0x893d('0x13')]===0x1f4){logger[_0x893d('0x12')](_0x893d('0xd'),_0xf1e997,_0xa6a8f7['error'][_0x893d('0x14')]);return _0x29e354(_0xa6a8f7[_0x893d('0x12')][_0x893d('0x14')]);}logger[_0x893d('0x12')](_0x893d('0xd'),_0xf1e997,_0xa6a8f7[_0x893d('0x12')][_0x893d('0x14')]);return _0x58f3ef(_0xa6a8f7[_0x893d('0x12')][_0x893d('0x14')]);}else{logger[_0x893d('0xc')](_0x893d('0xd'),_0xf1e997,_0x893d('0xe'));_0x58f3ef(_0xa6a8f7[_0x893d('0x15')][_0x893d('0x14')]);}})[_0x893d('0x16')](function(_0x7dd245){logger['error'](_0x893d('0xd'),_0xf1e997,_0x7dd245);_0x29e354(_0x7dd245);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f18550b..0a9a1c5 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 _0xfb4e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','download','post','create','put','update','delete','destroy','exports'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xfb4e,0x12c));var _0xefb4=function(_0x44feaf,_0x46068f){_0x44feaf=_0x44feaf-0x0;var _0x19ea54=_0xfb4e[_0x44feaf];return _0x19ea54;};'use strict';var multer=require(_0xefb4('0x0'));var util=require(_0xefb4('0x1'));var path=require(_0xefb4('0x2'));var timeout=require('connect-timeout');var express=require(_0xefb4('0x3'));var router=express[_0xefb4('0x4')]();var fs_extra=require(_0xefb4('0x5'));var auth=require(_0xefb4('0x6'));var interaction=require(_0xefb4('0x7'));var config=require(_0xefb4('0x8'));var controller=require(_0xefb4('0x9'));router[_0xefb4('0xa')]('/',auth['isAuthenticated'](),controller[_0xefb4('0xb')]);router[_0xefb4('0xa')](_0xefb4('0xc'),auth[_0xefb4('0xd')](),controller[_0xefb4('0xe')]);router[_0xefb4('0xa')](_0xefb4('0xf'),auth[_0xefb4('0xd')](),controller[_0xefb4('0x10')]);router[_0xefb4('0xa')]('/:id/download',auth[_0xefb4('0xd')](),controller[_0xefb4('0x11')]);router[_0xefb4('0x12')]('/',auth[_0xefb4('0xd')](),controller[_0xefb4('0x13')]);router[_0xefb4('0x14')](_0xefb4('0xf'),auth['isAuthenticated'](),controller[_0xefb4('0x15')]);router[_0xefb4('0x16')](_0xefb4('0xf'),auth[_0xefb4('0xd')](),controller[_0xefb4('0x17')]);module[_0xefb4('0x18')]=router; \ No newline at end of file +var _0x1d97=['create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/download','post'];(function(_0x445377,_0x17dbb0){var _0x50627e=function(_0x543b04){while(--_0x543b04){_0x445377['push'](_0x445377['shift']());}};_0x50627e(++_0x17dbb0);}(_0x1d97,0xf7));var _0x71d9=function(_0x38ba7b,_0x4727ca){_0x38ba7b=_0x38ba7b-0x0;var _0x24d039=_0x1d97[_0x38ba7b];return _0x24d039;};'use strict';var multer=require(_0x71d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x71d9('0x1'));var express=require('express');var router=express[_0x71d9('0x2')]();var fs_extra=require(_0x71d9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x71d9('0x4'));var config=require(_0x71d9('0x5'));var controller=require('./screenRecording.controller');router[_0x71d9('0x6')]('/',auth[_0x71d9('0x7')](),controller[_0x71d9('0x8')]);router[_0x71d9('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x71d9('0x9')]);router['get']('/:id',auth[_0x71d9('0x7')](),controller[_0x71d9('0xa')]);router[_0x71d9('0x6')](_0x71d9('0xb'),auth[_0x71d9('0x7')](),controller['download']);router[_0x71d9('0xc')]('/',auth[_0x71d9('0x7')](),controller[_0x71d9('0xd')]);router[_0x71d9('0xe')](_0x71d9('0xf'),auth[_0x71d9('0x7')](),controller[_0x71d9('0x10')]);router[_0x71d9('0x11')](_0x71d9('0xf'),auth[_0x71d9('0x7')](),controller[_0x71d9('0x12')]);module[_0x71d9('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 8783e1a..6f1eeb3 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 _0xed03=['setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','../../config/environment','getDataValue','extname','value','STRING','replace'];(function(_0x1494a3,_0x1e2a9b){var _0x262530=function(_0x187653){while(--_0x187653){_0x1494a3['push'](_0x1494a3['shift']());}};_0x262530(++_0x1e2a9b);}(_0xed03,0xdc));var _0x3ed0=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xed03[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x3ed0('0x0'));var moment=require(_0x3ed0('0x1'));var path=require('path');var config=require(_0x3ed0('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3ed0('0x3')]('value')?path[_0x3ed0('0x4')](this['getDataValue'](_0x3ed0('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x3ed0('0x6')]},'channel':{'type':Sequelize[_0x3ed0('0x6')]},'value':{'type':Sequelize[_0x3ed0('0x6')],'set':function(_0x8470b7){var _0x3f1277=_0x8470b7[_0x3ed0('0x7')](/\\/g,'/');this[_0x3ed0('0x8')](_0x3ed0('0x5'),_0x3f1277);}},'rating':{'type':Sequelize[_0x3ed0('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3ed0('0x9')],'set':function(_0x34950c){this[_0x3ed0('0x8')](_0x3ed0('0xa'),moment()['subtract'](_0x34950c,'ms'));this[_0x3ed0('0x8')]('closedAt',moment());this[_0x3ed0('0x8')](_0x3ed0('0xb'),_0x34950c);}},'startedAt':{'type':Sequelize[_0x3ed0('0xc')],'get':function(){return moment(this['getDataValue'](_0x3ed0('0xa')))[_0x3ed0('0xd')](_0x3ed0('0xe'))[_0x3ed0('0xf')]();}},'closedAt':{'type':Sequelize[_0x3ed0('0xc')],'get':function(){return moment(this['getDataValue'](_0x3ed0('0x10')))[_0x3ed0('0xd')](_0x3ed0('0xe'))[_0x3ed0('0xf')]();}},'createdAt':{'type':Sequelize[_0x3ed0('0xc')],'get':function(){return moment(this['getDataValue'](_0x3ed0('0x11')))[_0x3ed0('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x3ed0('0xf')]();}},'updatedAt':{'type':Sequelize[_0x3ed0('0xc')],'get':function(){return moment(this[_0x3ed0('0x3')](_0x3ed0('0x12')))[_0x3ed0('0xd')](_0x3ed0('0xe'))['toString']();}}}; \ No newline at end of file +var _0xd2f5=['closedAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x2721fd,_0x271e27){var _0x124063=function(_0x13046d){while(--_0x13046d){_0x2721fd['push'](_0x2721fd['shift']());}};_0x124063(++_0x271e27);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x416dce,_0x53ebd9){_0x416dce=_0x416dce-0x0;var _0x323677=_0xd2f5[_0x416dce];return _0x323677;};'use strict';var Sequelize=require(_0x5d2f('0x0'));var moment=require(_0x5d2f('0x1'));var path=require(_0x5d2f('0x2'));var config=require(_0x5d2f('0x3'));module['exports']={'format':{'type':Sequelize[_0x5d2f('0x4')],'get':function(){return this['getDataValue']('value')?path[_0x5d2f('0x5')](this[_0x5d2f('0x6')](_0x5d2f('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5d2f('0x8')]},'value':{'type':Sequelize[_0x5d2f('0x8')],'set':function(_0xbf53b){var _0x57673f=_0xbf53b[_0x5d2f('0x9')](/\\/g,'/');this[_0x5d2f('0xa')](_0x5d2f('0x7'),_0x57673f);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x43293d){this[_0x5d2f('0xa')]('startedAt',moment()[_0x5d2f('0xb')](_0x43293d,'ms'));this[_0x5d2f('0xa')]('closedAt',moment());this['setDataValue'](_0x5d2f('0xc'),_0x43293d);}},'startedAt':{'type':Sequelize[_0x5d2f('0xd')],'get':function(){return moment(this['getDataValue'](_0x5d2f('0xe')))[_0x5d2f('0xf')](_0x5d2f('0x10'))[_0x5d2f('0x11')]();}},'closedAt':{'type':Sequelize[_0x5d2f('0xd')],'get':function(){return moment(this[_0x5d2f('0x6')](_0x5d2f('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x5d2f('0x6')]('createdAt'))[_0x5d2f('0xf')](_0x5d2f('0x10'))[_0x5d2f('0x11')]();}},'updatedAt':{'type':Sequelize[_0x5d2f('0xd')],'get':function(){return moment(this['getDataValue'](_0x5d2f('0x13')))[_0x5d2f('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x5d2f('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8ef607e..be83ead 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x20c2f4,_0x470117){var _0x2c4823=function(_0x581e46){while(--_0x581e46){_0x20c2f4['push'](_0x20c2f4['shift']());}};_0x2c4823(++_0x470117);}(_0x5fd1,0x155));var _0x15fd=function(_0x5abf16,_0x5dfcbc){_0x5abf16=_0x5abf16-0x0;var _0x4c6b22=_0x5fd1[_0x5abf16];return _0x4c6b22;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file +var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x272a46,_0x12b300){var _0x2bfd12=function(_0x4a3d5f){while(--_0x4a3d5f){_0x272a46['push'](_0x272a46['shift']());}};_0x2bfd12(++_0x12b300);}(_0xb138,0x1dd));var _0x8b13=function(_0x3318f9,_0x555a3e){_0x3318f9=_0x3318f9-0x0;var _0xb4261d=_0xb138[_0x3318f9];return _0xb4261d;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index b688d81..b5ad520 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 _0x0a38=['path','../../config/environment','define','ScreenRecording','screen_recordings','interactionid','util','moment','bluebird'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x0a38,0x7b));var _0x80a3=function(_0x3fddae,_0x47ac64){_0x3fddae=_0x3fddae-0x0;var _0x2658a9=_0x0a38[_0x3fddae];return _0x2658a9;};'use strict';var _=require('lodash');var util=require(_0x80a3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x80a3('0x1'));var BPromise=require(_0x80a3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80a3('0x3'));var rimraf=require('rimraf');var config=require(_0x80a3('0x4'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2b9737,_0x2b4030){return _0x2b9737[_0x80a3('0x5')](_0x80a3('0x6'),attributes,{'tableName':_0x80a3('0x7'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x80a3('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8376=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x62f4ae,_0x57f42a){var _0x4b48a5=function(_0x4fe8a9){while(--_0x4fe8a9){_0x62f4ae['push'](_0x62f4ae['shift']());}};_0x4b48a5(++_0x57f42a);}(_0x8376,0x17c));var _0x6837=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8376[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6837('0x0'));var util=require(_0x6837('0x1'));var logger=require('../../config/logger')(_0x6837('0x2'));var moment=require(_0x6837('0x3'));var BPromise=require(_0x6837('0x4'));var rp=require(_0x6837('0x5'));var fs=require('fs');var path=require(_0x6837('0x6'));var rimraf=require(_0x6837('0x7'));var config=require(_0x6837('0x8'));var attributes=require(_0x6837('0x9'));module[_0x6837('0xa')]=function(_0x3dfeed,_0x424567){return _0x3dfeed[_0x6837('0xb')](_0x6837('0xc'),attributes,{'tableName':_0x6837('0xd'),'paranoid':![],'indexes':[{'name':_0x6837('0xe'),'fields':[_0x6837('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index c0ed55d..1edb541 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 _0xbbbd=['client','http','then','info','request\x20sent','debug','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59a4fa,_0x5f0014){var _0x4552e0=function(_0x45bae9){while(--_0x45bae9){_0x59a4fa['push'](_0x59a4fa['shift']());}};_0x4552e0(++_0x5f0014);}(_0xbbbd,0xe8));var _0xdbbb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbbbd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdbbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbbb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbbb('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbbb('0x3'));var logger=require(_0xdbbb('0x4'))(_0xdbbb('0x5'));var config=require(_0xdbbb('0x6'));var jayson=require(_0xdbbb('0x7'));var client=jayson[_0xdbbb('0x8')][_0xdbbb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eacd4,_0x24be76,_0x4cbc07){return new BPromise(function(_0x1d4781,_0x236b06){return client['request'](_0x5eacd4,_0x4cbc07)[_0xdbbb('0xa')](function(_0x33a261){logger[_0xdbbb('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x24be76,_0xdbbb('0xc'));logger[_0xdbbb('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x24be76,'request\x20sent',JSON[_0xdbbb('0xe')](_0x33a261));if(_0x33a261[_0xdbbb('0xf')]){if(_0x33a261['error'][_0xdbbb('0x10')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x24be76,_0x33a261[_0xdbbb('0xf')][_0xdbbb('0x11')]);return _0x236b06(_0x33a261[_0xdbbb('0xf')][_0xdbbb('0x11')]);}logger['error'](_0xdbbb('0x12'),_0x24be76,_0x33a261[_0xdbbb('0xf')][_0xdbbb('0x11')]);return _0x1d4781(_0x33a261['error'][_0xdbbb('0x11')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x24be76,_0xdbbb('0xc'));_0x1d4781(_0x33a261['result'][_0xdbbb('0x11')]);}})[_0xdbbb('0x13')](function(_0x572103){logger[_0xdbbb('0xf')](_0xdbbb('0x12'),_0x24be76,_0x572103);_0x236b06(_0x572103);});});} \ No newline at end of file +var _0xb956=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x491ac6,_0x126527){var _0x2f8426=function(_0x381df4){while(--_0x381df4){_0x491ac6['push'](_0x491ac6['shift']());}};_0x2f8426(++_0x126527);}(_0xb956,0x1ef));var _0x6b95=function(_0x29c768,_0x56446f){_0x29c768=_0x29c768-0x0;var _0x19fcdb=_0xb956[_0x29c768];return _0x19fcdb;};'use strict';var _=require(_0x6b95('0x0'));var util=require(_0x6b95('0x1'));var moment=require('moment');var BPromise=require(_0x6b95('0x2'));var rs=require(_0x6b95('0x3'));var fs=require('fs');var Redis=require(_0x6b95('0x4'));var db=require(_0x6b95('0x5'))['db'];var utils=require(_0x6b95('0x6'));var logger=require(_0x6b95('0x7'))(_0x6b95('0x8'));var config=require(_0x6b95('0x9'));var jayson=require(_0x6b95('0xa'));var client=jayson[_0x6b95('0xb')][_0x6b95('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2868a2,_0x48a9e5,_0x2758d8){return new BPromise(function(_0xf71476,_0x35372d){return client[_0x6b95('0xd')](_0x2868a2,_0x2758d8)['then'](function(_0x1de97c){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x48a9e5,_0x6b95('0xe'));logger[_0x6b95('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x48a9e5,_0x6b95('0xe'),JSON[_0x6b95('0x10')](_0x1de97c));if(_0x1de97c[_0x6b95('0x11')]){if(_0x1de97c[_0x6b95('0x11')][_0x6b95('0x12')]===0x1f4){logger[_0x6b95('0x11')](_0x6b95('0x13'),_0x48a9e5,_0x1de97c[_0x6b95('0x11')][_0x6b95('0x14')]);return _0x35372d(_0x1de97c[_0x6b95('0x11')][_0x6b95('0x14')]);}logger[_0x6b95('0x11')](_0x6b95('0x13'),_0x48a9e5,_0x1de97c[_0x6b95('0x11')][_0x6b95('0x14')]);return _0xf71476(_0x1de97c[_0x6b95('0x11')][_0x6b95('0x14')]);}else{logger[_0x6b95('0x15')]('ScreenRecording,\x20%s,\x20%s',_0x48a9e5,_0x6b95('0xe'));_0xf71476(_0x1de97c[_0x6b95('0x16')][_0x6b95('0x14')]);}})[_0x6b95('0x17')](function(_0x501cdb){logger[_0x6b95('0x11')](_0x6b95('0x13'),_0x48a9e5,_0x501cdb);_0x35372d(_0x501cdb);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 02c7b31..3a3cd41 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 _0x8ee0=['logo','extname','originalname','file','addLogo','server/files/images/logos/','logologin','post','preferred','single','addPreferred','addFavicon','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','get','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x8ee0,0xfe));var _0x08ee=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x8ee0[_0xf35bc1];return _0xa6b162;};'use strict';var multer=require(_0x08ee('0x0'));var util=require(_0x08ee('0x1'));var path=require(_0x08ee('0x2'));var timeout=require(_0x08ee('0x3'));var express=require(_0x08ee('0x4'));var router=express['Router']();var fs_extra=require(_0x08ee('0x5'));var auth=require(_0x08ee('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08ee('0x7'));router['get']('/',auth[_0x08ee('0x8')](),controller['index']);router[_0x08ee('0x9')](_0x08ee('0xa'),controller[_0x08ee('0xb')]);router['get'](_0x08ee('0xc'),controller[_0x08ee('0xd')]);router['get'](_0x08ee('0xe'),controller['getLogo']);router[_0x08ee('0x9')](_0x08ee('0xf'),controller['getLogoLogin']);router[_0x08ee('0x9')](_0x08ee('0x10'),controller['gdpr']);router[_0x08ee('0x9')](_0x08ee('0x11'),controller[_0x08ee('0x12')]);router['get'](_0x08ee('0x13'),controller[_0x08ee('0x14')]);var upload=multer({'storage':multer[_0x08ee('0x15')]({'destination':function(_0x568bd0,_0x5a50dd,_0x4e7cb5){_0x4e7cb5(null,path[_0x08ee('0x16')](config[_0x08ee('0x17')],'server/files/images/logos/'));},'filename':function(_0x37b59c,_0x1d9dff,_0x43983a){_0x43983a(null,util[_0x08ee('0x18')](_0x08ee('0x19'),_0x08ee('0x1a'),path[_0x08ee('0x1b')](_0x1d9dff[_0x08ee('0x1c')])));}})});router['post'](_0x08ee('0xe'),upload['single'](_0x08ee('0x1d')),controller[_0x08ee('0x1e')]);var upload=multer({'storage':multer[_0x08ee('0x15')]({'destination':function(_0x5b671e,_0x17648f,_0x490304){_0x490304(null,path[_0x08ee('0x16')](config[_0x08ee('0x17')],_0x08ee('0x1f')));},'filename':function(_0x59cb42,_0x28ea2d,_0x224341){_0x224341(null,util[_0x08ee('0x18')](_0x08ee('0x19'),_0x08ee('0x20'),path['extname'](_0x28ea2d[_0x08ee('0x1c')])));}})});router[_0x08ee('0x21')](_0x08ee('0xf'),upload['single'](_0x08ee('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x634c09,_0x3e943f,_0x3d5bda){_0x3d5bda(null,path['join'](config[_0x08ee('0x17')],_0x08ee('0x1f')));},'filename':function(_0x4fc32d,_0x199111,_0x2a12c7){_0x2a12c7(null,util[_0x08ee('0x18')](_0x08ee('0x19'),_0x08ee('0x22'),path['extname'](_0x199111[_0x08ee('0x1c')])));}})});router[_0x08ee('0x21')]('/:id/preferred',upload[_0x08ee('0x23')](_0x08ee('0x1d')),controller[_0x08ee('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4188a2,_0x6d2a94,_0x2a7c9f){_0x2a7c9f(null,path[_0x08ee('0x16')](config[_0x08ee('0x17')],_0x08ee('0x1f')));},'filename':function(_0x1e98bb,_0x8bd75a,_0x290833){_0x290833(null,util[_0x08ee('0x18')](_0x08ee('0x19'),'favicon',path['extname'](_0x8bd75a['originalname'])));}})});router[_0x08ee('0x21')]('/:id/favicon',upload[_0x08ee('0x23')](_0x08ee('0x1d')),controller[_0x08ee('0x25')]);router[_0x08ee('0x26')](_0x08ee('0xc'),auth[_0x08ee('0x8')](),controller[_0x08ee('0x27')]);module['exports']=router; \ No newline at end of file +var _0x2b6b=['/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','getLogo','/:id/logo_login','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','file','addLogo','logologin','single','addLogoLogin','preferred','originalname','/:id/preferred','favicon'];(function(_0x4f2326,_0x54b517){var _0x3f1a9f=function(_0x25cece){while(--_0x25cece){_0x4f2326['push'](_0x4f2326['shift']());}};_0x3f1a9f(++_0x54b517);}(_0x2b6b,0x86));var _0xb2b6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b6b[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xb2b6('0x0'));var util=require(_0xb2b6('0x1'));var path=require(_0xb2b6('0x2'));var timeout=require(_0xb2b6('0x3'));var express=require('express');var router=express[_0xb2b6('0x4')]();var fs_extra=require(_0xb2b6('0x5'));var auth=require(_0xb2b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2b6('0x7'));var controller=require(_0xb2b6('0x8'));router['get']('/',auth[_0xb2b6('0x9')](),controller[_0xb2b6('0xa')]);router[_0xb2b6('0xb')](_0xb2b6('0xc'),controller[_0xb2b6('0xd')]);router['get'](_0xb2b6('0xe'),controller[_0xb2b6('0xf')]);router[_0xb2b6('0xb')]('/:id/logo',controller[_0xb2b6('0x10')]);router[_0xb2b6('0xb')](_0xb2b6('0x11'),controller['getLogoLogin']);router[_0xb2b6('0xb')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0xb2b6('0x12')]);router[_0xb2b6('0xb')]('/:id/favicon',controller[_0xb2b6('0x13')]);var upload=multer({'storage':multer[_0xb2b6('0x14')]({'destination':function(_0x162fb2,_0x182e1b,_0x24fd49){_0x24fd49(null,path[_0xb2b6('0x15')](config[_0xb2b6('0x16')],_0xb2b6('0x17')));},'filename':function(_0x40c5f5,_0xb9bf7c,_0x531bbd){_0x531bbd(null,util[_0xb2b6('0x18')](_0xb2b6('0x19'),_0xb2b6('0x1a'),path[_0xb2b6('0x1b')](_0xb9bf7c['originalname'])));}})});router[_0xb2b6('0x1c')]('/:id/logo',upload['single'](_0xb2b6('0x1d')),controller[_0xb2b6('0x1e')]);var upload=multer({'storage':multer[_0xb2b6('0x14')]({'destination':function(_0x1d3bac,_0xb77d,_0x1ae7f4){_0x1ae7f4(null,path['join'](config[_0xb2b6('0x16')],_0xb2b6('0x17')));},'filename':function(_0x42a2d9,_0x5c16a5,_0x1e8b51){_0x1e8b51(null,util[_0xb2b6('0x18')](_0xb2b6('0x19'),_0xb2b6('0x1f'),path[_0xb2b6('0x1b')](_0x5c16a5['originalname'])));}})});router[_0xb2b6('0x1c')]('/:id/logo_login',upload[_0xb2b6('0x20')](_0xb2b6('0x1d')),controller[_0xb2b6('0x21')]);var upload=multer({'storage':multer[_0xb2b6('0x14')]({'destination':function(_0x576caf,_0x17f2ad,_0x111ea1){_0x111ea1(null,path[_0xb2b6('0x15')](config[_0xb2b6('0x16')],'server/files/images/logos/'));},'filename':function(_0x52a2b8,_0x162c77,_0x10bb98){_0x10bb98(null,util[_0xb2b6('0x18')](_0xb2b6('0x19'),_0xb2b6('0x22'),path[_0xb2b6('0x1b')](_0x162c77[_0xb2b6('0x23')])));}})});router[_0xb2b6('0x1c')](_0xb2b6('0x24'),upload[_0xb2b6('0x20')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xb2b6('0x14')]({'destination':function(_0x48e9dc,_0xabfcb2,_0x145f71){_0x145f71(null,path['join'](config['root'],_0xb2b6('0x17')));},'filename':function(_0x3cb5a3,_0x27dab1,_0x1bee8a){_0x1bee8a(null,util[_0xb2b6('0x18')](_0xb2b6('0x19'),_0xb2b6('0x25'),path[_0xb2b6('0x1b')](_0x27dab1['originalname'])));}})});router[_0xb2b6('0x1c')](_0xb2b6('0x26'),upload['single'](_0xb2b6('0x1d')),controller[_0xb2b6('0x27')]);router[_0xb2b6('0x28')](_0xb2b6('0xe'),auth['isAuthenticated'](),controller[_0xb2b6('0x29')]);module[_0xb2b6('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 6c2addb..a3b9e76 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 _0x34e8=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x5087b7,_0x117485){var _0x3b4c2b=function(_0x3d25db){while(--_0x3d25db){_0x5087b7['push'](_0x5087b7['shift']());}};_0x3b4c2b(++_0x117485);}(_0x34e8,0x12c));var _0x834e=function(_0x2ffe6c,_0x198b09){_0x2ffe6c=_0x2ffe6c-0x0;var _0x2b03f4=_0x34e8[_0x2ffe6c];return _0x2b03f4;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'min_internal':{'type':Sequelize[_0x834e('0x2')](0xb),'unique':_0x834e('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x834e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x6')},'logo':{'type':Sequelize[_0x834e('0x5')]},'defaultLogo':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x834e('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x834e('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x834e('0x5')]},'turnaddr':{'type':Sequelize[_0x834e('0x5')]},'turnusername':{'type':Sequelize[_0x834e('0x5')]},'turnpassword':{'type':Sequelize[_0x834e('0x5')]},'pageTitle':{'type':Sequelize[_0x834e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x8')},'enableEmailPreview':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x834e('0x5')]},'defaultPreferred':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x834e('0x5')]},'sentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x834e('0x5')]},'language':{'type':Sequelize[_0x834e('0x5')]},'bucket':{'type':Sequelize[_0x834e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x834e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x834e('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x34e8=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x5f1de4,_0x47c201){var _0x1aeaf0=function(_0x489f7a){while(--_0x489f7a){_0x5f1de4['push'](_0x5f1de4['shift']());}};_0x1aeaf0(++_0x47c201);}(_0x34e8,0x12c));var _0x834e=function(_0x4dfd85,_0x2a623d){_0x4dfd85=_0x4dfd85-0x0;var _0x29e744=_0x34e8[_0x4dfd85];return _0x29e744;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'min_internal':{'type':Sequelize[_0x834e('0x2')](0xb),'unique':_0x834e('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x834e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x6')},'logo':{'type':Sequelize[_0x834e('0x5')]},'defaultLogo':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x834e('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x834e('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x834e('0x5')]},'turnaddr':{'type':Sequelize[_0x834e('0x5')]},'turnusername':{'type':Sequelize[_0x834e('0x5')]},'turnpassword':{'type':Sequelize[_0x834e('0x5')]},'pageTitle':{'type':Sequelize[_0x834e('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x834e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x8')},'enableEmailPreview':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x834e('0x5')],'defaultValue':_0x834e('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x834e('0x5')]},'defaultPreferred':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x834e('0x5')]},'sentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x834e('0x5')]},'language':{'type':Sequelize[_0x834e('0x5')]},'bucket':{'type':Sequelize[_0x834e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x834e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x834e('0x2')](0x2)[_0x834e('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x834e('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x834e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x834e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 37694cd..9fedd2b 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 _0x1b2b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','stack','name','map','Setting','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','length','body','find','params','addLogo','file','filename','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','favicon','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x1b2b,0x69));var _0xb1b2=function(_0x643b2,_0x14e495){_0x643b2=_0x643b2-0x0;var _0x2e5346=_0x1b2b[_0x643b2];return _0x2e5346;};'use strict';var emlformat=require(_0xb1b2('0x0'));var rimraf=require(_0xb1b2('0x1'));var zipdir=require(_0xb1b2('0x2'));var jsonpatch=require(_0xb1b2('0x3'));var rp=require('request-promise');var moment=require(_0xb1b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1b2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb1b2('0x6'));var csv=require('to-csv');var ejs=require(_0xb1b2('0x7'));var fs=require('fs');var fs_extra=require(_0xb1b2('0x8'));var _=require(_0xb1b2('0x9'));var squel=require('squel');var crypto=require(_0xb1b2('0xa'));var jsforce=require(_0xb1b2('0xb'));var deskjs=require(_0xb1b2('0xc'));var toCsv=require(_0xb1b2('0xd'));var querystring=require(_0xb1b2('0xe'));var Papa=require(_0xb1b2('0xf'));var Redis=require(_0xb1b2('0x10'));var authService=require(_0xb1b2('0x11'));var qs=require(_0xb1b2('0x12'));var as=require(_0xb1b2('0x13'));var hardwareService=require(_0xb1b2('0x14'));var logger=require(_0xb1b2('0x15'))('api');var utils=require(_0xb1b2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb1b2('0x17'));var db=require(_0xb1b2('0x18'))['db'];var jayson=require(_0xb1b2('0x19'));var client=jayson[_0xb1b2('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4844,_0xa9b40c,_0x5325fa,_0x59d3d5){return new BPromise(function(_0x2fe2e6,_0x59df50){var _0x5d8588=_0x59d3d5||client;return _0x5d8588[_0xb1b2('0x1b')](_0x4c4844,_0x5325fa)[_0xb1b2('0x1c')](function(_0x5eec95){logger[_0xb1b2('0x1d')]('Setting,\x20%s,\x20%s',_0xa9b40c,'request\x20sent');logger[_0xb1b2('0x1e')](_0xb1b2('0x1f'),_0xa9b40c,_0xb1b2('0x20'),JSON['stringify'](_0x5eec95));if(_0x5eec95[_0xb1b2('0x21')]){if(_0x5eec95[_0xb1b2('0x21')]['code']===0x1f4){logger[_0xb1b2('0x21')](_0xb1b2('0x22'),_0xa9b40c,_0x5eec95[_0xb1b2('0x21')][_0xb1b2('0x23')]);return _0x59df50(_0x5eec95[_0xb1b2('0x21')]['message']);}logger[_0xb1b2('0x21')](_0xb1b2('0x22'),_0xa9b40c,_0x5eec95['error']['message']);return _0x2fe2e6(_0x5eec95[_0xb1b2('0x21')][_0xb1b2('0x23')]);}else{logger['info'](_0xb1b2('0x22'),_0xa9b40c,_0xb1b2('0x20'));_0x2fe2e6(_0x5eec95[_0xb1b2('0x24')][_0xb1b2('0x23')]);}})[_0xb1b2('0x25')](function(_0x8776bd){logger['error']('Setting,\x20%s,\x20%s',_0xa9b40c,_0x8776bd);_0x59df50(_0x8776bd);});});}function respondWithStatusCode(_0x535d7b,_0x5912dc){_0x5912dc=_0x5912dc||0xcc;return function(_0x3c6c5c){if(_0x3c6c5c){return _0x535d7b[_0xb1b2('0x26')](_0x5912dc);}return _0x535d7b[_0xb1b2('0x27')](_0x5912dc)[_0xb1b2('0x28')]();};}function respondWithResult(_0x546793,_0x1fc0a9){_0x1fc0a9=_0x1fc0a9||0xc8;return function(_0xc3f1a0){if(_0xc3f1a0){return _0x546793[_0xb1b2('0x27')](_0x1fc0a9)['json'](_0xc3f1a0);}};}function respondWithFilteredResult(_0x2735a1,_0x5bed8b){return function(_0x2e1f31){if(_0x2e1f31){var _0x237cc3=typeof _0x5bed8b[_0xb1b2('0x29')]===_0xb1b2('0x2a')&&typeof _0x5bed8b[_0xb1b2('0x2b')]==='undefined';var _0x58b106=_0x2e1f31[_0xb1b2('0x2c')];var _0x3d125b=_0x237cc3?0x0:_0x5bed8b[_0xb1b2('0x29')];var _0x1dacc8=_0x237cc3?_0x2e1f31[_0xb1b2('0x2c')]:_0x5bed8b['offset']+_0x5bed8b[_0xb1b2('0x2b')];var _0x419a54;if(_0x1dacc8>=_0x58b106){_0x1dacc8=_0x58b106;_0x419a54=0xc8;}else{_0x419a54=0xce;}_0x2735a1[_0xb1b2('0x27')](_0x419a54);return _0x2735a1[_0xb1b2('0x2d')](_0xb1b2('0x2e'),_0x3d125b+'-'+_0x1dacc8+'/'+_0x58b106)[_0xb1b2('0x2f')](_0x2e1f31);}return null;};}function patchUpdates(_0x501b50){return function(_0xa22e6d){try{jsonpatch['apply'](_0xa22e6d,_0x501b50,!![]);}catch(_0x389684){return BPromise[_0xb1b2('0x30')](_0x389684);}return _0xa22e6d['save']();};}function saveUpdates(_0x46df1a,_0x3d31f9){return function(_0x5b9da8){if(_0x5b9da8){return _0x5b9da8[_0xb1b2('0x31')](_0x46df1a)[_0xb1b2('0x1c')](function(_0x591718){return _0x591718;});}return null;};}function removeEntity(_0x4284f7,_0x377f35){return function(_0x1ecb7e){if(_0x1ecb7e){return _0x1ecb7e[_0xb1b2('0x32')]()[_0xb1b2('0x1c')](function(){_0x4284f7[_0xb1b2('0x27')](0xcc)[_0xb1b2('0x28')]();});}};}function handleEntityNotFound(_0x555a69,_0x5b7b15){return function(_0x383621){if(!_0x383621){_0x555a69[_0xb1b2('0x26')](0x194);}return _0x383621;};}function handleError(_0x1c6826,_0x289773){_0x289773=_0x289773||0x1f4;return function(_0xae67ad){logger[_0xb1b2('0x21')](_0xae67ad[_0xb1b2('0x33')]);if(_0xae67ad[_0xb1b2('0x34')]){delete _0xae67ad[_0xb1b2('0x34')];}_0x1c6826[_0xb1b2('0x27')](_0x289773)['send'](_0xae67ad);};}exports['index']=function(_0x1969f3,_0x23e0b0){var _0x17a6ba={},_0x4dc09c={},_0x176b7e={'count':0x0,'rows':[]};var _0x44e409=_[_0xb1b2('0x35')](db[_0xb1b2('0x36')]['rawAttributes'],function(_0x17b815){return{'name':_0x17b815[_0xb1b2('0x37')],'type':_0x17b815[_0xb1b2('0x38')]['key']};});_0x4dc09c['model']=_[_0xb1b2('0x35')](_0x44e409,_0xb1b2('0x34'));_0x4dc09c[_0xb1b2('0x39')]=_[_0xb1b2('0x3a')](_0x1969f3['query']);_0x4dc09c[_0xb1b2('0x3b')]=_[_0xb1b2('0x3c')](_0x4dc09c[_0xb1b2('0x3d')],_0x4dc09c[_0xb1b2('0x39')]);_0x17a6ba[_0xb1b2('0x3e')]=_[_0xb1b2('0x3c')](_0x4dc09c[_0xb1b2('0x3d')],qs[_0xb1b2('0x3f')](_0x1969f3['query']['fields']));_0x17a6ba[_0xb1b2('0x3e')]=_0x17a6ba[_0xb1b2('0x3e')]['length']?_0x17a6ba[_0xb1b2('0x3e')]:_0x4dc09c[_0xb1b2('0x3d')];if(!_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x40')]('nolimit')){_0x17a6ba[_0xb1b2('0x2b')]=qs[_0xb1b2('0x2b')](_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x2b')]);_0x17a6ba[_0xb1b2('0x29')]=qs[_0xb1b2('0x29')](_0x1969f3['query'][_0xb1b2('0x29')]);}_0x17a6ba['order']=qs[_0xb1b2('0x41')](_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x41')]);_0x17a6ba[_0xb1b2('0x42')]=qs[_0xb1b2('0x3b')](_[_0xb1b2('0x43')](_0x1969f3['query'],_0x4dc09c[_0xb1b2('0x3b')]),_0x44e409);if(_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x44')]){_0x17a6ba[_0xb1b2('0x42')]=_[_0xb1b2('0x45')](_0x17a6ba[_0xb1b2('0x42')],{'$or':_[_0xb1b2('0x35')](_0x44e409,function(_0x365ac9){if(_0x365ac9['type']!=='VIRTUAL'){var _0x536c25={};_0x536c25[_0x365ac9[_0xb1b2('0x34')]]={'$like':'%'+_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x44')]+'%'};return _0x536c25;}})});}_0x17a6ba=_[_0xb1b2('0x45')]({},_0x17a6ba,_0x1969f3[_0xb1b2('0x46')]);var _0x3f0c40={'where':_0x17a6ba['where']};return db[_0xb1b2('0x36')][_0xb1b2('0x2c')](_0x3f0c40)[_0xb1b2('0x1c')](function(_0x354175){_0x176b7e[_0xb1b2('0x2c')]=_0x354175;if(_0x1969f3[_0xb1b2('0x39')][_0xb1b2('0x47')]){_0x17a6ba[_0xb1b2('0x48')]=[{'all':!![]}];}return db[_0xb1b2('0x36')][_0xb1b2('0x49')](_0x17a6ba);})[_0xb1b2('0x1c')](function(_0x3c78af){_0x176b7e[_0xb1b2('0x4a')]=_0x3c78af;return _0x176b7e;})[_0xb1b2('0x1c')](respondWithFilteredResult(_0x23e0b0,_0x17a6ba))[_0xb1b2('0x25')](handleError(_0x23e0b0,null));};exports['show']=function(_0x333c9f,_0x2a3386){var _0x2f9e6b={'raw':![],'where':{'id':_0x333c9f['params']['id']}},_0x48eaa0={};_0x48eaa0[_0xb1b2('0x3d')]=_[_0xb1b2('0x3a')](db[_0xb1b2('0x36')]['rawAttributes']);_0x48eaa0['query']=_[_0xb1b2('0x3a')](_0x333c9f[_0xb1b2('0x39')]);_0x48eaa0[_0xb1b2('0x3b')]=_[_0xb1b2('0x3c')](_0x48eaa0[_0xb1b2('0x3d')],_0x48eaa0[_0xb1b2('0x39')]);_0x2f9e6b['attributes']=_[_0xb1b2('0x3c')](_0x48eaa0[_0xb1b2('0x3d')],qs[_0xb1b2('0x3f')](_0x333c9f[_0xb1b2('0x39')][_0xb1b2('0x3f')]));_0x2f9e6b[_0xb1b2('0x3e')]=_0x2f9e6b[_0xb1b2('0x3e')][_0xb1b2('0x4b')]?_0x2f9e6b['attributes']:_0x48eaa0[_0xb1b2('0x3d')];if(_0x333c9f[_0xb1b2('0x39')][_0xb1b2('0x47')]){_0x2f9e6b['include']=[{'all':!![]}];}_0x2f9e6b=_[_0xb1b2('0x45')]({},_0x2f9e6b,_0x333c9f[_0xb1b2('0x46')]);return db['Setting']['find'](_0x2f9e6b)[_0xb1b2('0x1c')](handleEntityNotFound(_0x2a3386,null))[_0xb1b2('0x1c')](respondWithResult(_0x2a3386,null))[_0xb1b2('0x25')](handleError(_0x2a3386,null));};exports[_0xb1b2('0x31')]=function(_0x6be7b2,_0x2d9c5b){if(_0x6be7b2[_0xb1b2('0x4c')]['id']){delete _0x6be7b2['body']['id'];}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x6be7b2[_0xb1b2('0x4e')]['id']}})[_0xb1b2('0x1c')](handleEntityNotFound(_0x2d9c5b,null))[_0xb1b2('0x1c')](saveUpdates(_0x6be7b2[_0xb1b2('0x4c')],null))[_0xb1b2('0x1c')](respondWithResult(_0x2d9c5b,null))[_0xb1b2('0x25')](handleError(_0x2d9c5b,null));};exports[_0xb1b2('0x4f')]=function(_0x120947,_0x5cd236,_0x530881){if(_0x120947[_0xb1b2('0x50')]&&_0x120947[_0xb1b2('0x50')]['filename']){_0x120947[_0xb1b2('0x4c')]['logo']=_0x120947[_0xb1b2('0x50')][_0xb1b2('0x51')];}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x120947[_0xb1b2('0x4e')]['id']}})[_0xb1b2('0x1c')](handleEntityNotFound(_0x5cd236,null))[_0xb1b2('0x1c')](saveUpdates(_0x120947[_0xb1b2('0x4c')],null))[_0xb1b2('0x1c')](respondWithResult(_0x5cd236,null))[_0xb1b2('0x25')](handleError(_0x5cd236,null));};exports['addLogoLogin']=function(_0x13ccfa,_0x149143,_0x4dedcc){if(_0x13ccfa[_0xb1b2('0x50')]&&_0x13ccfa[_0xb1b2('0x50')][_0xb1b2('0x51')]){_0x13ccfa[_0xb1b2('0x4c')][_0xb1b2('0x52')]=_0x13ccfa['file'][_0xb1b2('0x51')];}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x13ccfa[_0xb1b2('0x4e')]['id']}})[_0xb1b2('0x1c')](handleEntityNotFound(_0x149143,null))[_0xb1b2('0x1c')](saveUpdates(_0x13ccfa[_0xb1b2('0x4c')],null))[_0xb1b2('0x1c')](respondWithResult(_0x149143,null))[_0xb1b2('0x25')](handleError(_0x149143,null));};var utilLicense=require(_0xb1b2('0x17'));exports[_0xb1b2('0x53')]=function(_0x444c17,_0x351a3c,_0x22edc9){var _0x2c6e08=_0xb1b2('0x54');var _0x364f00={'custom':![]};return utilLicense[_0xb1b2('0x55')]()[_0xb1b2('0x1c')](function(_0x4f2335){if(_0x4f2335){_0x364f00=_0x4f2335;}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x444c17[_0xb1b2('0x4e')]['id']},'attributes':[_0xb1b2('0x56'),_0xb1b2('0x52'),_0xb1b2('0x57'),'favicon',_0xb1b2('0x58'),_0xb1b2('0x59'),_0xb1b2('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xb1b2('0x1c')](handleEntityNotFound(_0x351a3c,null))[_0xb1b2('0x1c')](function(_0x3058ba){if(_0x3058ba){var _0x30d3ac=_0x3058ba[_0xb1b2('0x56')]&&fs[_0xb1b2('0x5b')](path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x2c6e08,_[_0xb1b2('0x5e')](_0x3058ba[_0xb1b2('0x56')])))?path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x2c6e08,_['toLower'](_0x3058ba['logo'])):path[_0xb1b2('0x5c')](config['root'],_0x2c6e08,_['toLower']('default_logo.svg'));var _0x1341a8=_0xb1b2('0x5f')+_[_0xb1b2('0x60')]('logo');if(_0x3058ba[_0x1341a8]||!_0x364f00[_0xb1b2('0x61')]){_0x30d3ac=path[_0xb1b2('0x5c')](config['root'],_0x2c6e08,_[_0xb1b2('0x5e')]('default_logo.svg'));}if(!fs[_0xb1b2('0x5b')](_0x30d3ac)){throw new db[(_0xb1b2('0x62'))][(_0xb1b2('0x63'))](_[_0xb1b2('0x60')](_0xb1b2('0x56'))+_0xb1b2('0x64'));}return _0x351a3c[_0xb1b2('0x65')](_0x30d3ac);}})[_0xb1b2('0x25')](handleError(_0x351a3c,null));};var utilLicense=require(_0xb1b2('0x17'));exports[_0xb1b2('0x66')]=function(_0x256e62,_0x5c1f96,_0x5e26bf){var _0x46b8a4=_0xb1b2('0x54');var _0x5bd403={'custom':![]};return utilLicense[_0xb1b2('0x55')]()[_0xb1b2('0x1c')](function(_0x21d6f9){if(_0x21d6f9){_0x5bd403=_0x21d6f9;}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x256e62[_0xb1b2('0x4e')]['id']},'attributes':[_0xb1b2('0x56'),_0xb1b2('0x52'),'preferred',_0xb1b2('0x67'),_0xb1b2('0x58'),_0xb1b2('0x59'),'defaultPreferred',_0xb1b2('0x68')],'raw':!![]});})[_0xb1b2('0x1c')](handleEntityNotFound(_0x5c1f96,null))[_0xb1b2('0x1c')](function(_0x33f98d){if(_0x33f98d){var _0x3a8cd4=_0x33f98d[_0xb1b2('0x52')]&&fs['existsSync'](path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x46b8a4,_['toLower'](_0x33f98d['loginLogo'])))?path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x46b8a4,_[_0xb1b2('0x5e')](_0x33f98d[_0xb1b2('0x52')])):path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x46b8a4,_[_0xb1b2('0x5e')](_0xb1b2('0x69')));var _0x18a45f=_0xb1b2('0x5f')+_[_0xb1b2('0x60')](_0xb1b2('0x52'));if(_0x33f98d[_0x18a45f]||!_0x5bd403[_0xb1b2('0x61')]){_0x3a8cd4=path[_0xb1b2('0x5c')](config['root'],_0x46b8a4,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xb1b2('0x5b')](_0x3a8cd4)){throw new db[(_0xb1b2('0x62'))][(_0xb1b2('0x63'))](_[_0xb1b2('0x60')](_0xb1b2('0x52'))+'\x20not\x20found');}return _0x5c1f96[_0xb1b2('0x65')](_0x3a8cd4);}})[_0xb1b2('0x25')](handleError(_0x5c1f96,null));};exports[_0xb1b2('0x6a')]=function(_0x78d77f,_0x134a8d){return db['Setting'][_0xb1b2('0x4d')]({'where':{'id':_0x78d77f[_0xb1b2('0x4e')]['id']},'attributes':[_0xb1b2('0x6b')]})['then'](respondWithResult(_0x134a8d,null))['catch'](handleError(_0x134a8d,null));};exports['addPreferred']=function(_0x2826dd,_0x4db75d,_0x1a9e65){if(_0x2826dd['file']&&_0x2826dd[_0xb1b2('0x50')]['filename']){_0x2826dd[_0xb1b2('0x4c')]['preferred']=_0x2826dd['file'][_0xb1b2('0x51')];}return db['Setting'][_0xb1b2('0x4d')]({'where':{'id':_0x2826dd[_0xb1b2('0x4e')]['id']}})[_0xb1b2('0x1c')](handleEntityNotFound(_0x4db75d,null))[_0xb1b2('0x1c')](saveUpdates(_0x2826dd[_0xb1b2('0x4c')],null))[_0xb1b2('0x1c')](respondWithResult(_0x4db75d,null))['catch'](handleError(_0x4db75d,null));};var utilLicense=require('../../config/license/util');exports[_0xb1b2('0x6c')]=function(_0x50cfd5,_0x215cbf,_0x2ba641){var _0x5aafae='server/files/images/logos';var _0x3aa39c={'custom':![]};return utilLicense[_0xb1b2('0x55')]()[_0xb1b2('0x1c')](function(_0x2e6964){if(_0x2e6964){_0x3aa39c=_0x2e6964;}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x50cfd5[_0xb1b2('0x4e')]['id']},'attributes':[_0xb1b2('0x56'),_0xb1b2('0x52'),_0xb1b2('0x57'),_0xb1b2('0x67'),_0xb1b2('0x58'),_0xb1b2('0x59'),_0xb1b2('0x5a'),_0xb1b2('0x68')],'raw':!![]});})[_0xb1b2('0x1c')](handleEntityNotFound(_0x215cbf,null))['then'](function(_0x5760bd){if(_0x5760bd){var _0x5a620c=_0x5760bd[_0xb1b2('0x57')]&&fs[_0xb1b2('0x5b')](path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x5aafae,_[_0xb1b2('0x5e')](_0x5760bd[_0xb1b2('0x57')])))?path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x5aafae,_[_0xb1b2('0x5e')](_0x5760bd[_0xb1b2('0x57')])):path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x5aafae,_['toLower'](_0xb1b2('0x6d')));var _0x40563f=_0xb1b2('0x5f')+_[_0xb1b2('0x60')](_0xb1b2('0x57'));if(_0x5760bd[_0x40563f]||!_0x3aa39c[_0xb1b2('0x61')]||!_0x3aa39c[_0xb1b2('0x57')]){_0x5a620c=path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x5aafae,_[_0xb1b2('0x5e')]('default_preferred.png'));}if(!fs[_0xb1b2('0x5b')](_0x5a620c)){throw new db['Sequelize'][(_0xb1b2('0x63'))](_[_0xb1b2('0x60')](_0xb1b2('0x57'))+_0xb1b2('0x64'));}return _0x215cbf['download'](_0x5a620c);}})[_0xb1b2('0x25')](handleError(_0x215cbf,null));};exports[_0xb1b2('0x6e')]=function(_0x14a279,_0x173773,_0x566f52){if(_0x14a279[_0xb1b2('0x50')]&&_0x14a279[_0xb1b2('0x50')]['filename']){_0x14a279[_0xb1b2('0x4c')][_0xb1b2('0x67')]=_0x14a279['file'][_0xb1b2('0x51')];}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x14a279[_0xb1b2('0x4e')]['id']}})[_0xb1b2('0x1c')](handleEntityNotFound(_0x173773,null))[_0xb1b2('0x1c')](saveUpdates(_0x14a279[_0xb1b2('0x4c')],null))[_0xb1b2('0x1c')](respondWithResult(_0x173773,null))[_0xb1b2('0x25')](handleError(_0x173773,null));};var utilLicense=require(_0xb1b2('0x17'));exports[_0xb1b2('0x6f')]=function(_0x2aef8c,_0xb9162f,_0x1991e2){var _0x22407f='server/files/images/logos';var _0x259e5a={'custom':![]};return utilLicense[_0xb1b2('0x55')]()[_0xb1b2('0x1c')](function(_0x262a10){if(_0x262a10){_0x259e5a=_0x262a10;}return db[_0xb1b2('0x36')][_0xb1b2('0x4d')]({'where':{'id':_0x2aef8c[_0xb1b2('0x4e')]['id']},'attributes':['logo',_0xb1b2('0x52'),_0xb1b2('0x57'),'favicon',_0xb1b2('0x58'),_0xb1b2('0x59'),_0xb1b2('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xb1b2('0x1c')](handleEntityNotFound(_0xb9162f,null))[_0xb1b2('0x1c')](function(_0x4db0f8){if(_0x4db0f8){var _0x4538e3=_0x4db0f8[_0xb1b2('0x67')]&&fs[_0xb1b2('0x5b')](path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x22407f,_[_0xb1b2('0x5e')](_0x4db0f8[_0xb1b2('0x67')])))?path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x22407f,_[_0xb1b2('0x5e')](_0x4db0f8[_0xb1b2('0x67')])):path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x22407f,_[_0xb1b2('0x5e')]('default_favicon.ico'));var _0xe33195=_0xb1b2('0x5f')+_['upperFirst'](_0xb1b2('0x67'));if(_0x4db0f8[_0xe33195]||!_0x259e5a[_0xb1b2('0x61')]){_0x4538e3=path[_0xb1b2('0x5c')](config[_0xb1b2('0x5d')],_0x22407f,_[_0xb1b2('0x5e')](_0xb1b2('0x70')));}if(!fs[_0xb1b2('0x5b')](_0x4538e3)){throw new db['Sequelize'][(_0xb1b2('0x63'))](_[_0xb1b2('0x60')](_0xb1b2('0x67'))+_0xb1b2('0x64'));}return _0xb9162f[_0xb1b2('0x65')](_0x4538e3);}})[_0xb1b2('0x25')](handleError(_0xb9162f,null));};exports[_0xb1b2('0x71')]=function(_0x365a28,_0x3bee03){var _0x490694={'offset':moment()['utcOffset']()};_0x490694[_0xb1b2('0x72')]=moment()[_0xb1b2('0x73')](_0x490694[_0xb1b2('0x29')])[_0xb1b2('0x74')](_0xb1b2('0x75'));return _0x3bee03[_0xb1b2('0x27')](0xc8)[_0xb1b2('0x76')](_0x490694);}; \ No newline at end of file +var _0xf7a8=['../../config/license/util','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','keys','include','body','find','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','getLogoLogin','default_loginLogo.svg','default','\x20not\x20found','gdpr','addPreferred','getPreferred','default_preferred.png','download','addFavicon','getFavicon','default_favicon.ico','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0xf7a8,0x157));var _0x8f7a=function(_0x5dad13,_0x563dc6){_0x5dad13=_0x5dad13-0x0;var _0x444281=_0xf7a8[_0x5dad13];return _0x444281;};'use strict';var emlformat=require(_0x8f7a('0x0'));var rimraf=require(_0x8f7a('0x1'));var zipdir=require(_0x8f7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f7a('0x3'));var moment=require(_0x8f7a('0x4'));var BPromise=require(_0x8f7a('0x5'));var Mustache=require(_0x8f7a('0x6'));var util=require(_0x8f7a('0x7'));var path=require(_0x8f7a('0x8'));var sox=require(_0x8f7a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f7a('0xa'));var _=require(_0x8f7a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f7a('0xc'));var toCsv=require(_0x8f7a('0xd'));var querystring=require('querystring');var Papa=require(_0x8f7a('0xe'));var Redis=require(_0x8f7a('0xf'));var authService=require(_0x8f7a('0x10'));var qs=require(_0x8f7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f7a('0x12'));var logger=require(_0x8f7a('0x13'))(_0x8f7a('0x14'));var utils=require(_0x8f7a('0x15'));var config=require(_0x8f7a('0x16'));var licenseUtil=require(_0x8f7a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8f7a('0x18'));var client=jayson[_0x8f7a('0x19')][_0x8f7a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x149055,_0x5f089e,_0x4031ae,_0xb1cc96){return new BPromise(function(_0x3d2e18,_0x106157){var _0x40a4b2=_0xb1cc96||client;return _0x40a4b2[_0x8f7a('0x1b')](_0x149055,_0x4031ae)['then'](function(_0x5bbb44){logger[_0x8f7a('0x1c')]('Setting,\x20%s,\x20%s',_0x5f089e,_0x8f7a('0x1d'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x5f089e,_0x8f7a('0x1d'),JSON[_0x8f7a('0x1e')](_0x5bbb44));if(_0x5bbb44[_0x8f7a('0x1f')]){if(_0x5bbb44[_0x8f7a('0x1f')][_0x8f7a('0x20')]===0x1f4){logger[_0x8f7a('0x1f')](_0x8f7a('0x21'),_0x5f089e,_0x5bbb44[_0x8f7a('0x1f')][_0x8f7a('0x22')]);return _0x106157(_0x5bbb44['error'][_0x8f7a('0x22')]);}logger['error'](_0x8f7a('0x21'),_0x5f089e,_0x5bbb44[_0x8f7a('0x1f')][_0x8f7a('0x22')]);return _0x3d2e18(_0x5bbb44[_0x8f7a('0x1f')][_0x8f7a('0x22')]);}else{logger[_0x8f7a('0x1c')](_0x8f7a('0x21'),_0x5f089e,_0x8f7a('0x1d'));_0x3d2e18(_0x5bbb44[_0x8f7a('0x23')][_0x8f7a('0x22')]);}})[_0x8f7a('0x24')](function(_0x289a62){logger[_0x8f7a('0x1f')](_0x8f7a('0x21'),_0x5f089e,_0x289a62);_0x106157(_0x289a62);});});}function respondWithStatusCode(_0x382e57,_0x84b660){_0x84b660=_0x84b660||0xcc;return function(_0x4a1918){if(_0x4a1918){return _0x382e57[_0x8f7a('0x25')](_0x84b660);}return _0x382e57[_0x8f7a('0x26')](_0x84b660)[_0x8f7a('0x27')]();};}function respondWithResult(_0x326e83,_0x39e190){_0x39e190=_0x39e190||0xc8;return function(_0x4a195a){if(_0x4a195a){return _0x326e83[_0x8f7a('0x26')](_0x39e190)['json'](_0x4a195a);}};}function respondWithFilteredResult(_0x1a1b3b,_0x835bc3){return function(_0x1faa03){if(_0x1faa03){var _0x2deb04=typeof _0x835bc3[_0x8f7a('0x28')]===_0x8f7a('0x29')&&typeof _0x835bc3[_0x8f7a('0x2a')]===_0x8f7a('0x29');var _0x1f9109=_0x1faa03[_0x8f7a('0x2b')];var _0xf56dfc=_0x2deb04?0x0:_0x835bc3['offset'];var _0x582f4e=_0x2deb04?_0x1faa03['count']:_0x835bc3[_0x8f7a('0x28')]+_0x835bc3[_0x8f7a('0x2a')];var _0xa3cda;if(_0x582f4e>=_0x1f9109){_0x582f4e=_0x1f9109;_0xa3cda=0xc8;}else{_0xa3cda=0xce;}_0x1a1b3b['status'](_0xa3cda);return _0x1a1b3b['set'](_0x8f7a('0x2c'),_0xf56dfc+'-'+_0x582f4e+'/'+_0x1f9109)[_0x8f7a('0x2d')](_0x1faa03);}return null;};}function patchUpdates(_0x37bf2a){return function(_0x1aa45d){try{jsonpatch[_0x8f7a('0x2e')](_0x1aa45d,_0x37bf2a,!![]);}catch(_0x313e36){return BPromise[_0x8f7a('0x2f')](_0x313e36);}return _0x1aa45d[_0x8f7a('0x30')]();};}function saveUpdates(_0x5db797,_0x2e1c50){return function(_0x39fc9a){if(_0x39fc9a){return _0x39fc9a[_0x8f7a('0x31')](_0x5db797)[_0x8f7a('0x32')](function(_0x92a946){return _0x92a946;});}return null;};}function removeEntity(_0x243ecf,_0x3e7e17){return function(_0x33204d){if(_0x33204d){return _0x33204d['destroy']()[_0x8f7a('0x32')](function(){_0x243ecf[_0x8f7a('0x26')](0xcc)[_0x8f7a('0x27')]();});}};}function handleEntityNotFound(_0x558254,_0x138b3a){return function(_0x79ff5a){if(!_0x79ff5a){_0x558254[_0x8f7a('0x25')](0x194);}return _0x79ff5a;};}function handleError(_0x27578b,_0x3ee3e6){_0x3ee3e6=_0x3ee3e6||0x1f4;return function(_0x338f50){logger[_0x8f7a('0x1f')](_0x338f50[_0x8f7a('0x33')]);if(_0x338f50[_0x8f7a('0x34')]){delete _0x338f50[_0x8f7a('0x34')];}_0x27578b[_0x8f7a('0x26')](_0x3ee3e6)[_0x8f7a('0x35')](_0x338f50);};}exports[_0x8f7a('0x36')]=function(_0x26823f,_0x3c802d){var _0x343a65={},_0x2192d6={},_0x1dd424={'count':0x0,'rows':[]};var _0x308e42=_[_0x8f7a('0x37')](db[_0x8f7a('0x38')][_0x8f7a('0x39')],function(_0x4a4b4d){return{'name':_0x4a4b4d[_0x8f7a('0x3a')],'type':_0x4a4b4d[_0x8f7a('0x3b')][_0x8f7a('0x3c')]};});_0x2192d6[_0x8f7a('0x3d')]=_[_0x8f7a('0x37')](_0x308e42,_0x8f7a('0x34'));_0x2192d6[_0x8f7a('0x3e')]=_['keys'](_0x26823f[_0x8f7a('0x3e')]);_0x2192d6[_0x8f7a('0x3f')]=_[_0x8f7a('0x40')](_0x2192d6[_0x8f7a('0x3d')],_0x2192d6[_0x8f7a('0x3e')]);_0x343a65[_0x8f7a('0x41')]=_['intersection'](_0x2192d6['model'],qs['fields'](_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x42')]));_0x343a65[_0x8f7a('0x41')]=_0x343a65['attributes'][_0x8f7a('0x43')]?_0x343a65[_0x8f7a('0x41')]:_0x2192d6[_0x8f7a('0x3d')];if(!_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x44')]('nolimit')){_0x343a65[_0x8f7a('0x2a')]=qs[_0x8f7a('0x2a')](_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x2a')]);_0x343a65[_0x8f7a('0x28')]=qs[_0x8f7a('0x28')](_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x28')]);}_0x343a65[_0x8f7a('0x45')]=qs['sort'](_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x46')]);_0x343a65[_0x8f7a('0x47')]=qs[_0x8f7a('0x3f')](_[_0x8f7a('0x48')](_0x26823f[_0x8f7a('0x3e')],_0x2192d6[_0x8f7a('0x3f')]),_0x308e42);if(_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x49')]){_0x343a65['where']=_[_0x8f7a('0x4a')](_0x343a65['where'],{'$or':_[_0x8f7a('0x37')](_0x308e42,function(_0x2db14d){if(_0x2db14d[_0x8f7a('0x3b')]!==_0x8f7a('0x4b')){var _0x1c45d0={};_0x1c45d0[_0x2db14d[_0x8f7a('0x34')]]={'$like':'%'+_0x26823f[_0x8f7a('0x3e')]['filter']+'%'};return _0x1c45d0;}})});}_0x343a65=_[_0x8f7a('0x4a')]({},_0x343a65,_0x26823f[_0x8f7a('0x4c')]);var _0x5e2e4f={'where':_0x343a65['where']};return db[_0x8f7a('0x38')][_0x8f7a('0x2b')](_0x5e2e4f)[_0x8f7a('0x32')](function(_0x3576de){_0x1dd424['count']=_0x3576de;if(_0x26823f[_0x8f7a('0x3e')][_0x8f7a('0x4d')]){_0x343a65['include']=[{'all':!![]}];}return db[_0x8f7a('0x38')][_0x8f7a('0x4e')](_0x343a65);})[_0x8f7a('0x32')](function(_0x188168){_0x1dd424['rows']=_0x188168;return _0x1dd424;})[_0x8f7a('0x32')](respondWithFilteredResult(_0x3c802d,_0x343a65))['catch'](handleError(_0x3c802d,null));};exports['show']=function(_0x1ba2d6,_0x3db0ef){var _0x578685={'raw':![],'where':{'id':_0x1ba2d6[_0x8f7a('0x4f')]['id']}},_0x33feec={};_0x33feec['model']=_[_0x8f7a('0x50')](db[_0x8f7a('0x38')]['rawAttributes']);_0x33feec[_0x8f7a('0x3e')]=_[_0x8f7a('0x50')](_0x1ba2d6[_0x8f7a('0x3e')]);_0x33feec[_0x8f7a('0x3f')]=_[_0x8f7a('0x40')](_0x33feec[_0x8f7a('0x3d')],_0x33feec[_0x8f7a('0x3e')]);_0x578685[_0x8f7a('0x41')]=_[_0x8f7a('0x40')](_0x33feec[_0x8f7a('0x3d')],qs[_0x8f7a('0x42')](_0x1ba2d6[_0x8f7a('0x3e')][_0x8f7a('0x42')]));_0x578685[_0x8f7a('0x41')]=_0x578685[_0x8f7a('0x41')][_0x8f7a('0x43')]?_0x578685[_0x8f7a('0x41')]:_0x33feec[_0x8f7a('0x3d')];if(_0x1ba2d6[_0x8f7a('0x3e')][_0x8f7a('0x4d')]){_0x578685[_0x8f7a('0x51')]=[{'all':!![]}];}_0x578685=_[_0x8f7a('0x4a')]({},_0x578685,_0x1ba2d6[_0x8f7a('0x4c')]);return db['Setting']['find'](_0x578685)[_0x8f7a('0x32')](handleEntityNotFound(_0x3db0ef,null))[_0x8f7a('0x32')](respondWithResult(_0x3db0ef,null))[_0x8f7a('0x24')](handleError(_0x3db0ef,null));};exports[_0x8f7a('0x31')]=function(_0x4a0e12,_0xd3b303){if(_0x4a0e12[_0x8f7a('0x52')]['id']){delete _0x4a0e12['body']['id'];}return db[_0x8f7a('0x38')][_0x8f7a('0x53')]({'where':{'id':_0x4a0e12['params']['id']}})[_0x8f7a('0x32')](handleEntityNotFound(_0xd3b303,null))[_0x8f7a('0x32')](saveUpdates(_0x4a0e12[_0x8f7a('0x52')],null))[_0x8f7a('0x32')](respondWithResult(_0xd3b303,null))[_0x8f7a('0x24')](handleError(_0xd3b303,null));};exports['addLogo']=function(_0x38e656,_0x5329df,_0x330083){if(_0x38e656[_0x8f7a('0x54')]&&_0x38e656[_0x8f7a('0x54')][_0x8f7a('0x55')]){_0x38e656[_0x8f7a('0x52')][_0x8f7a('0x56')]=_0x38e656[_0x8f7a('0x54')]['filename'];}return db['Setting'][_0x8f7a('0x53')]({'where':{'id':_0x38e656[_0x8f7a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5329df,null))['then'](saveUpdates(_0x38e656[_0x8f7a('0x52')],null))[_0x8f7a('0x32')](respondWithResult(_0x5329df,null))[_0x8f7a('0x24')](handleError(_0x5329df,null));};exports[_0x8f7a('0x57')]=function(_0x591486,_0x475885,_0x2f0795){if(_0x591486[_0x8f7a('0x54')]&&_0x591486['file']['filename']){_0x591486[_0x8f7a('0x52')][_0x8f7a('0x58')]=_0x591486[_0x8f7a('0x54')][_0x8f7a('0x55')];}return db['Setting'][_0x8f7a('0x53')]({'where':{'id':_0x591486[_0x8f7a('0x4f')]['id']}})[_0x8f7a('0x32')](handleEntityNotFound(_0x475885,null))[_0x8f7a('0x32')](saveUpdates(_0x591486['body'],null))[_0x8f7a('0x32')](respondWithResult(_0x475885,null))['catch'](handleError(_0x475885,null));};var utilLicense=require(_0x8f7a('0x17'));exports[_0x8f7a('0x59')]=function(_0x522a9c,_0x5f47db,_0x15f0e5){var _0x111a6c=_0x8f7a('0x5a');var _0x1aa287={'custom':![]};return utilLicense[_0x8f7a('0x5b')]()['then'](function(_0x571a5d){if(_0x571a5d){_0x1aa287=_0x571a5d;}return db[_0x8f7a('0x38')]['find']({'where':{'id':_0x522a9c[_0x8f7a('0x4f')]['id']},'attributes':['logo',_0x8f7a('0x58'),_0x8f7a('0x5c'),_0x8f7a('0x5d'),_0x8f7a('0x5e'),_0x8f7a('0x5f'),_0x8f7a('0x60'),_0x8f7a('0x61')],'raw':!![]});})[_0x8f7a('0x32')](handleEntityNotFound(_0x5f47db,null))[_0x8f7a('0x32')](function(_0x5a1fc6){if(_0x5a1fc6){var _0x387566=_0x5a1fc6['logo']&&fs[_0x8f7a('0x62')](path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0x111a6c,_[_0x8f7a('0x65')](_0x5a1fc6[_0x8f7a('0x56')])))?path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0x111a6c,_[_0x8f7a('0x65')](_0x5a1fc6[_0x8f7a('0x56')])):path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0x111a6c,_[_0x8f7a('0x65')](_0x8f7a('0x66')));var _0x49a162='default'+_[_0x8f7a('0x67')](_0x8f7a('0x56'));if(_0x5a1fc6[_0x49a162]||!_0x1aa287[_0x8f7a('0x68')]){_0x387566=path[_0x8f7a('0x63')](config['root'],_0x111a6c,_[_0x8f7a('0x65')](_0x8f7a('0x66')));}if(!fs['existsSync'](_0x387566)){throw new db[(_0x8f7a('0x69'))][(_0x8f7a('0x6a'))](_[_0x8f7a('0x67')](_0x8f7a('0x56'))+'\x20not\x20found');}return _0x5f47db['download'](_0x387566);}})[_0x8f7a('0x24')](handleError(_0x5f47db,null));};var utilLicense=require(_0x8f7a('0x17'));exports[_0x8f7a('0x6b')]=function(_0x2a7fa4,_0x3f6adf,_0x20f214){var _0x14baca='server/files/images/logos';var _0x4dd382={'custom':![]};return utilLicense[_0x8f7a('0x5b')]()[_0x8f7a('0x32')](function(_0x596084){if(_0x596084){_0x4dd382=_0x596084;}return db[_0x8f7a('0x38')][_0x8f7a('0x53')]({'where':{'id':_0x2a7fa4[_0x8f7a('0x4f')]['id']},'attributes':[_0x8f7a('0x56'),'loginLogo',_0x8f7a('0x5c'),_0x8f7a('0x5d'),_0x8f7a('0x5e'),'defaultLoginLogo',_0x8f7a('0x60'),_0x8f7a('0x61')],'raw':!![]});})[_0x8f7a('0x32')](handleEntityNotFound(_0x3f6adf,null))[_0x8f7a('0x32')](function(_0x56eaa1){if(_0x56eaa1){var _0x4e55e8=_0x56eaa1[_0x8f7a('0x58')]&&fs['existsSync'](path['join'](config[_0x8f7a('0x64')],_0x14baca,_[_0x8f7a('0x65')](_0x56eaa1[_0x8f7a('0x58')])))?path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0x14baca,_['toLower'](_0x56eaa1[_0x8f7a('0x58')])):path['join'](config['root'],_0x14baca,_[_0x8f7a('0x65')](_0x8f7a('0x6c')));var _0x2af7bb=_0x8f7a('0x6d')+_[_0x8f7a('0x67')](_0x8f7a('0x58'));if(_0x56eaa1[_0x2af7bb]||!_0x4dd382[_0x8f7a('0x68')]){_0x4e55e8=path[_0x8f7a('0x63')](config['root'],_0x14baca,_[_0x8f7a('0x65')]('default_loginLogo.svg'));}if(!fs[_0x8f7a('0x62')](_0x4e55e8)){throw new db[(_0x8f7a('0x69'))][(_0x8f7a('0x6a'))](_[_0x8f7a('0x67')]('loginLogo')+_0x8f7a('0x6e'));}return _0x3f6adf['download'](_0x4e55e8);}})[_0x8f7a('0x24')](handleError(_0x3f6adf,null));};exports[_0x8f7a('0x6f')]=function(_0x50f724,_0x20afb0){return db[_0x8f7a('0x38')][_0x8f7a('0x53')]({'where':{'id':_0x50f724[_0x8f7a('0x4f')]['id']},'attributes':['securePassword']})[_0x8f7a('0x32')](respondWithResult(_0x20afb0,null))[_0x8f7a('0x24')](handleError(_0x20afb0,null));};exports[_0x8f7a('0x70')]=function(_0x2ad7a8,_0x552bde,_0x4f3afb){if(_0x2ad7a8['file']&&_0x2ad7a8['file'][_0x8f7a('0x55')]){_0x2ad7a8[_0x8f7a('0x52')][_0x8f7a('0x5c')]=_0x2ad7a8['file'][_0x8f7a('0x55')];}return db['Setting'][_0x8f7a('0x53')]({'where':{'id':_0x2ad7a8[_0x8f7a('0x4f')]['id']}})[_0x8f7a('0x32')](handleEntityNotFound(_0x552bde,null))[_0x8f7a('0x32')](saveUpdates(_0x2ad7a8[_0x8f7a('0x52')],null))[_0x8f7a('0x32')](respondWithResult(_0x552bde,null))['catch'](handleError(_0x552bde,null));};var utilLicense=require('../../config/license/util');exports[_0x8f7a('0x71')]=function(_0x224eee,_0x9da84,_0x3df0e6){var _0xc2dfc8='server/files/images/logos';var _0x1e7b74={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x11a5e0){if(_0x11a5e0){_0x1e7b74=_0x11a5e0;}return db[_0x8f7a('0x38')]['find']({'where':{'id':_0x224eee[_0x8f7a('0x4f')]['id']},'attributes':[_0x8f7a('0x56'),_0x8f7a('0x58'),_0x8f7a('0x5c'),_0x8f7a('0x5d'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x8f7a('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x9da84,null))[_0x8f7a('0x32')](function(_0x184d7d){if(_0x184d7d){var _0x3362a9=_0x184d7d[_0x8f7a('0x5c')]&&fs[_0x8f7a('0x62')](path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0xc2dfc8,_[_0x8f7a('0x65')](_0x184d7d[_0x8f7a('0x5c')])))?path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0xc2dfc8,_[_0x8f7a('0x65')](_0x184d7d[_0x8f7a('0x5c')])):path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0xc2dfc8,_[_0x8f7a('0x65')](_0x8f7a('0x72')));var _0x260498=_0x8f7a('0x6d')+_['upperFirst'](_0x8f7a('0x5c'));if(_0x184d7d[_0x260498]||!_0x1e7b74['custom']||!_0x1e7b74['preferred']){_0x3362a9=path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0xc2dfc8,_[_0x8f7a('0x65')](_0x8f7a('0x72')));}if(!fs[_0x8f7a('0x62')](_0x3362a9)){throw new db[(_0x8f7a('0x69'))][(_0x8f7a('0x6a'))](_[_0x8f7a('0x67')]('preferred')+_0x8f7a('0x6e'));}return _0x9da84[_0x8f7a('0x73')](_0x3362a9);}})['catch'](handleError(_0x9da84,null));};exports[_0x8f7a('0x74')]=function(_0x3f8846,_0x451624,_0x160bb9){if(_0x3f8846[_0x8f7a('0x54')]&&_0x3f8846['file'][_0x8f7a('0x55')]){_0x3f8846[_0x8f7a('0x52')][_0x8f7a('0x5d')]=_0x3f8846[_0x8f7a('0x54')][_0x8f7a('0x55')];}return db[_0x8f7a('0x38')][_0x8f7a('0x53')]({'where':{'id':_0x3f8846[_0x8f7a('0x4f')]['id']}})[_0x8f7a('0x32')](handleEntityNotFound(_0x451624,null))['then'](saveUpdates(_0x3f8846[_0x8f7a('0x52')],null))['then'](respondWithResult(_0x451624,null))[_0x8f7a('0x24')](handleError(_0x451624,null));};var utilLicense=require(_0x8f7a('0x17'));exports[_0x8f7a('0x75')]=function(_0x226047,_0x2b441a,_0x4b9802){var _0x30144a=_0x8f7a('0x5a');var _0x4bda01={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4bbbf4){if(_0x4bbbf4){_0x4bda01=_0x4bbbf4;}return db['Setting'][_0x8f7a('0x53')]({'where':{'id':_0x226047['params']['id']},'attributes':[_0x8f7a('0x56'),'loginLogo',_0x8f7a('0x5c'),_0x8f7a('0x5d'),'defaultLogo',_0x8f7a('0x5f'),_0x8f7a('0x60'),_0x8f7a('0x61')],'raw':!![]});})[_0x8f7a('0x32')](handleEntityNotFound(_0x2b441a,null))['then'](function(_0x321ffd){if(_0x321ffd){var _0x4bb3f0=_0x321ffd[_0x8f7a('0x5d')]&&fs[_0x8f7a('0x62')](path[_0x8f7a('0x63')](config['root'],_0x30144a,_[_0x8f7a('0x65')](_0x321ffd['favicon'])))?path[_0x8f7a('0x63')](config['root'],_0x30144a,_['toLower'](_0x321ffd[_0x8f7a('0x5d')])):path[_0x8f7a('0x63')](config['root'],_0x30144a,_[_0x8f7a('0x65')](_0x8f7a('0x76')));var _0x2fbd3b=_0x8f7a('0x6d')+_[_0x8f7a('0x67')](_0x8f7a('0x5d'));if(_0x321ffd[_0x2fbd3b]||!_0x4bda01['custom']){_0x4bb3f0=path[_0x8f7a('0x63')](config[_0x8f7a('0x64')],_0x30144a,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x4bb3f0)){throw new db[(_0x8f7a('0x69'))][(_0x8f7a('0x6a'))](_[_0x8f7a('0x67')](_0x8f7a('0x5d'))+'\x20not\x20found');}return _0x2b441a[_0x8f7a('0x73')](_0x4bb3f0);}})[_0x8f7a('0x24')](handleError(_0x2b441a,null));};exports['getDate']=function(_0x1daa49,_0x37b3c0){var _0x257efc={'offset':moment()['utcOffset']()};_0x257efc[_0x8f7a('0x77')]=moment()['utcOffset'](_0x257efc['offset'])[_0x8f7a('0x78')](_0x8f7a('0x79'));return _0x37b3c0['status'](0xc8)['send'](_0x257efc);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8059bce..f4afcad 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x55ca,0x126));var _0xa55c=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x55ca[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0x55ca,0x126));var _0xa55c=function(_0x209511,_0x231622){_0x209511=_0x209511-0x0;var _0x39b937=_0x55ca[_0x209511];return _0x39b937;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'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 1de50c4..8fe8984 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 _0xa05c=['include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','find','options','where','attributes'];(function(_0x1783dd,_0x347363){var _0x2b874b=function(_0x4b3cc9){while(--_0x4b3cc9){_0x1783dd['push'](_0x1783dd['shift']());}};_0x2b874b(++_0x347363);}(_0xa05c,0x123));var _0xca05=function(_0x5bf1ad,_0x194327){_0x5bf1ad=_0x5bf1ad-0x0;var _0x2708c4=_0xa05c[_0x5bf1ad];return _0x2708c4;};'use strict';var _=require(_0xca05('0x0'));var util=require(_0xca05('0x1'));var moment=require('moment');var BPromise=require(_0xca05('0x2'));var rs=require(_0xca05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca05('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca05('0x5'));var config=require(_0xca05('0x6'));var jayson=require(_0xca05('0x7'));var client=jayson[_0xca05('0x8')][_0xca05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80d8cf,_0x3be9c7,_0xbad7e9){return new BPromise(function(_0x1caf7e,_0x244a26){return client[_0xca05('0xa')](_0x80d8cf,_0xbad7e9)[_0xca05('0xb')](function(_0xd8936a){logger['info'](_0xca05('0xc'),_0x3be9c7,_0xca05('0xd'));logger[_0xca05('0xe')](_0xca05('0xf'),_0x3be9c7,_0xca05('0xd'),JSON[_0xca05('0x10')](_0xd8936a));if(_0xd8936a[_0xca05('0x11')]){if(_0xd8936a['error'][_0xca05('0x12')]===0x1f4){logger[_0xca05('0x11')](_0xca05('0xc'),_0x3be9c7,_0xd8936a[_0xca05('0x11')][_0xca05('0x13')]);return _0x244a26(_0xd8936a[_0xca05('0x11')][_0xca05('0x13')]);}logger[_0xca05('0x11')](_0xca05('0xc'),_0x3be9c7,_0xd8936a[_0xca05('0x11')]['message']);return _0x1caf7e(_0xd8936a[_0xca05('0x11')][_0xca05('0x13')]);}else{logger[_0xca05('0x14')](_0xca05('0xc'),_0x3be9c7,_0xca05('0xd'));_0x1caf7e(_0xd8936a[_0xca05('0x15')][_0xca05('0x13')]);}})[_0xca05('0x16')](function(_0xab6b4f){logger[_0xca05('0x11')](_0xca05('0xc'),_0x3be9c7,_0xab6b4f);_0x244a26(_0xab6b4f);});});}exports[_0xca05('0x17')]=function(_0x52d3bc){var _0xf69b07=this;return new Promise(function(_0x5937bd,_0x138d07){return db[_0xca05('0x18')][_0xca05('0x19')]({'raw':_0x52d3bc['options']?_0x52d3bc[_0xca05('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x52d3bc[_0xca05('0x1a')]?_0x52d3bc['options'][_0xca05('0x1b')]||null:null,'attributes':_0x52d3bc[_0xca05('0x1a')]?_0x52d3bc[_0xca05('0x1a')][_0xca05('0x1c')]||null:null,'include':_0x52d3bc['options']?_0x52d3bc['options'][_0xca05('0x1d')]?_[_0xca05('0x1e')](_0x52d3bc[_0xca05('0x1a')][_0xca05('0x1d')],function(_0x135555){return{'model':db[_0x135555[_0xca05('0x1f')]],'as':_0x135555['as'],'attributes':_0x135555['attributes'],'include':_0x135555[_0xca05('0x1d')]?_[_0xca05('0x1e')](_0x135555[_0xca05('0x1d')],function(_0x407c08){return{'model':db[_0x407c08['model']],'as':_0x407c08['as'],'attributes':_0x407c08[_0xca05('0x1c')],'include':_0x407c08['include']?_[_0xca05('0x1e')](_0x407c08['include'],function(_0x3e3294){return{'model':db[_0x3e3294['model']],'as':_0x3e3294['as'],'attributes':_0x3e3294['attributes']};}):[]};}):[]};}):[]:[]})[_0xca05('0xb')](function(_0x12eb72){logger[_0xca05('0x14')](_0xca05('0x17'),_0x52d3bc);logger['debug']('ShowSetting',_0x52d3bc,JSON[_0xca05('0x10')](_0x12eb72));_0x5937bd(_0x12eb72);})[_0xca05('0x16')](function(_0x2fc4e4){logger[_0xca05('0x11')](_0xca05('0x17'),_0x2fc4e4[_0xca05('0x13')],_0x52d3bc);_0x138d07(_0xf69b07[_0xca05('0x11')](0x1f4,_0x2fc4e4['message']));});});}; \ No newline at end of file +var _0x288d=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x46ccbc,_0x5f5bdd){var _0x101095=function(_0x4fdaa3){while(--_0x4fdaa3){_0x46ccbc['push'](_0x46ccbc['shift']());}};_0x101095(++_0x5f5bdd);}(_0x288d,0x102));var _0xd288=function(_0x231100,_0x5e521a){_0x231100=_0x231100-0x0;var _0x450cfd=_0x288d[_0x231100];return _0x450cfd;};'use strict';var _=require(_0xd288('0x0'));var util=require(_0xd288('0x1'));var moment=require(_0xd288('0x2'));var BPromise=require(_0xd288('0x3'));var rs=require(_0xd288('0x4'));var fs=require('fs');var Redis=require(_0xd288('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd288('0x6'))(_0xd288('0x7'));var config=require(_0xd288('0x8'));var jayson=require(_0xd288('0x9'));var client=jayson[_0xd288('0xa')][_0xd288('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464767,_0x2f2e4a,_0x1d540f){return new BPromise(function(_0x4fccbe,_0x51949e){return client[_0xd288('0xc')](_0x464767,_0x1d540f)['then'](function(_0x48950a){logger[_0xd288('0xd')](_0xd288('0xe'),_0x2f2e4a,_0xd288('0xf'));logger[_0xd288('0x10')](_0xd288('0x11'),_0x2f2e4a,_0xd288('0xf'),JSON['stringify'](_0x48950a));if(_0x48950a[_0xd288('0x12')]){if(_0x48950a[_0xd288('0x12')][_0xd288('0x13')]===0x1f4){logger[_0xd288('0x12')](_0xd288('0xe'),_0x2f2e4a,_0x48950a['error']['message']);return _0x51949e(_0x48950a['error']['message']);}logger['error'](_0xd288('0xe'),_0x2f2e4a,_0x48950a[_0xd288('0x12')][_0xd288('0x14')]);return _0x4fccbe(_0x48950a[_0xd288('0x12')]['message']);}else{logger[_0xd288('0xd')](_0xd288('0xe'),_0x2f2e4a,_0xd288('0xf'));_0x4fccbe(_0x48950a[_0xd288('0x15')][_0xd288('0x14')]);}})[_0xd288('0x16')](function(_0x461dc3){logger[_0xd288('0x12')](_0xd288('0xe'),_0x2f2e4a,_0x461dc3);_0x51949e(_0x461dc3);});});}exports[_0xd288('0x17')]=function(_0x28acb0){var _0x357370=this;return new Promise(function(_0x38af9b,_0x417c33){return db[_0xd288('0x18')][_0xd288('0x19')]({'raw':_0x28acb0[_0xd288('0x1a')]?_0x28acb0[_0xd288('0x1a')][_0xd288('0x1b')]===undefined?!![]:![]:!![],'where':_0x28acb0['options']?_0x28acb0['options'][_0xd288('0x1c')]||null:null,'attributes':_0x28acb0[_0xd288('0x1a')]?_0x28acb0[_0xd288('0x1a')][_0xd288('0x1d')]||null:null,'include':_0x28acb0[_0xd288('0x1a')]?_0x28acb0['options']['include']?_[_0xd288('0x1e')](_0x28acb0[_0xd288('0x1a')][_0xd288('0x1f')],function(_0x5032b1){return{'model':db[_0x5032b1[_0xd288('0x20')]],'as':_0x5032b1['as'],'attributes':_0x5032b1[_0xd288('0x1d')],'include':_0x5032b1[_0xd288('0x1f')]?_[_0xd288('0x1e')](_0x5032b1[_0xd288('0x1f')],function(_0x3d7b07){return{'model':db[_0x3d7b07[_0xd288('0x20')]],'as':_0x3d7b07['as'],'attributes':_0x3d7b07['attributes'],'include':_0x3d7b07[_0xd288('0x1f')]?_[_0xd288('0x1e')](_0x3d7b07[_0xd288('0x1f')],function(_0x1582ad){return{'model':db[_0x1582ad[_0xd288('0x20')]],'as':_0x1582ad['as'],'attributes':_0x1582ad['attributes']};}):[]};}):[]};}):[]:[]})[_0xd288('0x21')](function(_0x57b2ee){logger['info'](_0xd288('0x17'),_0x28acb0);logger['debug'](_0xd288('0x17'),_0x28acb0,JSON['stringify'](_0x57b2ee));_0x38af9b(_0x57b2ee);})[_0xd288('0x16')](function(_0x20f1ec){logger[_0xd288('0x12')]('ShowSetting',_0x20f1ec['message'],_0x28acb0);_0x417c33(_0x357370['error'](0x1f4,_0x20f1ec[_0xd288('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index fa7871e..bc541f5 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(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x1209ba,_0x4d6233){var _0x5be53d=function(_0x1c6819){while(--_0x1c6819){_0x1209ba['push'](_0x1209ba['shift']());}};_0x5be53d(++_0x4d6233);}(_0x6aa7,0x178));var _0x76aa=function(_0x2b1c57,_0x1b4106){_0x2b1c57=_0x2b1c57-0x0;var _0x13c93d=_0x6aa7[_0x2b1c57];return _0x13c93d;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 41df045..82d1d2d 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 _0x44d2=['name','generate','ENUM','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x221d12,_0x29a4b7){var _0x45a09f=function(_0x31a460){while(--_0x31a460){_0x221d12['push'](_0x221d12['shift']());}};_0x45a09f(++_0x29a4b7);}(_0x44d2,0x10d));var _0x244d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x44d2[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x244d('0x0'));var rs=require(_0x244d('0x1'));module[_0x244d('0x2')]={'name':{'type':Sequelize[_0x244d('0x3')],'unique':_0x244d('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x244d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x244d('0x3')],'defaultValue':function(){return rs[_0x244d('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x244d('0x6')]('twilio',_0x244d('0x7'),_0x244d('0x8'),_0x244d('0x9'),_0x244d('0xa'),'clickatell',_0x244d('0xb'),_0x244d('0xc'),_0x244d('0xd'),_0x244d('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x244d('0x3')]},'authToken':{'type':Sequelize[_0x244d('0x3')]},'smsMethod':{'type':Sequelize[_0x244d('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x244d('0x3')]},'password':{'type':Sequelize[_0x244d('0x3')]},'apiKey':{'type':Sequelize[_0x244d('0x3')]},'applicationId':{'type':Sequelize[_0x244d('0x3')]},'accountId':{'type':Sequelize[_0x244d('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x244d('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x244d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x244d('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x244d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x244d('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x244d('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x244d('0x10')],'comment':_0x244d('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x244d('0x12'),'set':function(_0x268e86){if(!_0x268e86)this[_0x244d('0x13')]('mandatoryDispositionPauseId',null);this[_0x244d('0x13')](_0x244d('0x14'),_0x268e86);}}}; \ No newline at end of file +var _0x0bc5=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer'];(function(_0x4b56bc,_0xd50e2){var _0x3c7cc9=function(_0x5d6101){while(--_0x5d6101){_0x4b56bc['push'](_0x4b56bc['shift']());}};_0x3c7cc9(++_0xd50e2);}(_0x0bc5,0x11e));var _0x50bc=function(_0x14bb92,_0x1a100c){_0x14bb92=_0x14bb92-0x0;var _0x27992c=_0x0bc5[_0x14bb92];return _0x27992c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x50bc('0x0'));module[_0x50bc('0x1')]={'name':{'type':Sequelize[_0x50bc('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x50bc('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x50bc('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x50bc('0x4')](_0x50bc('0x5'),_0x50bc('0x6'),_0x50bc('0x7'),_0x50bc('0x8'),_0x50bc('0x9'),_0x50bc('0xa'),_0x50bc('0xb'),'csc',_0x50bc('0xc'),_0x50bc('0xd'))},'accountSid':{'type':Sequelize[_0x50bc('0x2')]},'authId':{'type':Sequelize[_0x50bc('0x2')]},'authToken':{'type':Sequelize[_0x50bc('0x2')]},'smsMethod':{'type':Sequelize[_0x50bc('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x50bc('0x2')]},'password':{'type':Sequelize[_0x50bc('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x50bc('0x2')]},'accountId':{'type':Sequelize[_0x50bc('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x50bc('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[_0x50bc('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bc('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x50bc('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x50bc('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bc('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x50bc('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bc('0xf')],'comment':_0x50bc('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x50bc('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x20217f){if(!_0x20217f)this[_0x50bc('0x11')](_0x50bc('0x12'),null);this[_0x50bc('0x11')](_0x50bc('0x13'),_0x20217f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 329c18b..cb3c1d0 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 _0x351d=['socket.io-emitter','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','get','SmsAccounts','UserProfileResource','destroy','name','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','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','describe','addDisposition','params','SmsAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','applications','orderBy','Applications','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','clickatell','fromNumber','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','UserId','User','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','send','\x0a','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','Owner','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','status_code','infobip','DELIVERED','groupName','intelepeer','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','defaults','redis','localhost'];(function(_0x4b1a63,_0x175b1d){var _0x394882=function(_0x36f02e){while(--_0x36f02e){_0x4b1a63['push'](_0x4b1a63['shift']());}};_0x394882(++_0x175b1d);}(_0x351d,0x1a0));var _0xd351=function(_0x3b32f1,_0x201db3){_0x3b32f1=_0x3b32f1-0x0;var _0x2a2640=_0x351d[_0x3b32f1];return _0x2a2640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd351('0x0'));var jsonpatch=require(_0xd351('0x1'));var rp=require(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd351('0x4'));var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require(_0xd351('0x7'));var csv=require(_0xd351('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require(_0xd351('0xa'));var squel=require(_0xd351('0xb'));var crypto=require('crypto');var jsforce=require(_0xd351('0xc'));var deskjs=require(_0xd351('0xd'));var toCsv=require(_0xd351('0x8'));var querystring=require('querystring');var Papa=require(_0xd351('0xe'));var Redis=require(_0xd351('0xf'));var authService=require(_0xd351('0x10'));var qs=require(_0xd351('0x11'));var as=require(_0xd351('0x12'));var hardwareService=require(_0xd351('0x13'));var logger=require('../../config/logger')(_0xd351('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd351('0x15')](config[_0xd351('0x16')],{'host':_0xd351('0x17'),'port':0x18eb});var socket=require(_0xd351('0x18'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xd351('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd351('0x1a')][_0xd351('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x44405a,_0xf27745,_0x33e6da,_0x12c0d4){return new BPromise(function(_0x741960,_0x57931b){var _0x4c188d=_0x12c0d4||client;return _0x4c188d[_0xd351('0x1c')](_0x44405a,_0x33e6da)[_0xd351('0x1d')](function(_0x2c216f){logger[_0xd351('0x1e')](_0xd351('0x1f'),_0xf27745,'request\x20sent');logger[_0xd351('0x20')](_0xd351('0x21'),_0xf27745,'request\x20sent',JSON[_0xd351('0x22')](_0x2c216f));if(_0x2c216f[_0xd351('0x23')]){if(_0x2c216f[_0xd351('0x23')][_0xd351('0x24')]===0x1f4){logger[_0xd351('0x23')](_0xd351('0x1f'),_0xf27745,_0x2c216f['error'][_0xd351('0x25')]);return _0x57931b(_0x2c216f[_0xd351('0x23')][_0xd351('0x25')]);}logger['error'](_0xd351('0x1f'),_0xf27745,_0x2c216f[_0xd351('0x23')][_0xd351('0x25')]);return _0x741960(_0x2c216f['error']['message']);}else{logger[_0xd351('0x1e')](_0xd351('0x1f'),_0xf27745,'request\x20sent');_0x741960(_0x2c216f['result'][_0xd351('0x25')]);}})[_0xd351('0x26')](function(_0x2f70aa){logger[_0xd351('0x23')](_0xd351('0x1f'),_0xf27745,_0x2f70aa);_0x57931b(_0x2f70aa);});});}function respondWithStatusCode(_0x51619e,_0x3d6ed6){_0x3d6ed6=_0x3d6ed6||0xcc;return function(_0x321aa0){if(_0x321aa0){return _0x51619e[_0xd351('0x27')](_0x3d6ed6);}return _0x51619e[_0xd351('0x28')](_0x3d6ed6)[_0xd351('0x29')]();};}function respondWithResult(_0x3fa9b7,_0xe16213){_0xe16213=_0xe16213||0xc8;return function(_0x2bad54){if(_0x2bad54){return _0x3fa9b7[_0xd351('0x28')](_0xe16213)[_0xd351('0x2a')](_0x2bad54);}};}function respondWithFilteredResult(_0x448374,_0x3981f7){return function(_0x351f71){if(_0x351f71){var _0x47e19d=typeof _0x3981f7['offset']===_0xd351('0x2b')&&typeof _0x3981f7[_0xd351('0x2c')]===_0xd351('0x2b');var _0x50710e=_0x351f71[_0xd351('0x2d')];var _0x56530e=_0x47e19d?0x0:_0x3981f7['offset'];var _0xb93fbc=_0x47e19d?_0x351f71['count']:_0x3981f7[_0xd351('0x2e')]+_0x3981f7[_0xd351('0x2c')];var _0x2b0d38;if(_0xb93fbc>=_0x50710e){_0xb93fbc=_0x50710e;_0x2b0d38=0xc8;}else{_0x2b0d38=0xce;}_0x448374[_0xd351('0x28')](_0x2b0d38);return _0x448374[_0xd351('0x2f')](_0xd351('0x30'),_0x56530e+'-'+_0xb93fbc+'/'+_0x50710e)[_0xd351('0x2a')](_0x351f71);}return null;};}function patchUpdates(_0x27c19c){return function(_0x3e3180){try{jsonpatch['apply'](_0x3e3180,_0x27c19c,!![]);}catch(_0x10ab8f){return BPromise['reject'](_0x10ab8f);}return _0x3e3180[_0xd351('0x31')]();};}function saveUpdates(_0x6d5bca,_0x3876f6){return function(_0x4b0a86){if(_0x4b0a86){return _0x4b0a86['update'](_0x6d5bca)[_0xd351('0x1d')](function(_0x3653a5){return _0x3653a5;});}return null;};}function removeEntity(_0x60094,_0x328fdc){return function(_0x328739){if(_0x328739){return _0x328739['destroy']()['then'](function(){var _0x452937=_0x328739[_0xd351('0x32')]({'plain':!![]});var _0x598447=_0xd351('0x33');return db[_0xd351('0x34')][_0xd351('0x35')]({'where':{'type':_0x598447,'resourceId':_0x452937['id']}})['then'](function(){return _0x328739;});})[_0xd351('0x1d')](function(){_0x60094[_0xd351('0x28')](0xcc)[_0xd351('0x29')]();});}};}function handleEntityNotFound(_0x3e24af,_0x546c6b){return function(_0x2d5623){if(!_0x2d5623){_0x3e24af[_0xd351('0x27')](0x194);}return _0x2d5623;};}function handleError(_0x2e2b29,_0x31ff48){_0x31ff48=_0x31ff48||0x1f4;return function(_0x45cb81){logger['error'](_0x45cb81['stack']);if(_0x45cb81['name']){delete _0x45cb81[_0xd351('0x36')];}_0x2e2b29['status'](_0x31ff48)['send'](_0x45cb81);};}exports['index']=function(_0x45611e,_0x2f1d86){var _0x143293={'include':[{'model':db[_0xd351('0x37')],'as':_0xd351('0x38')}]},_0x5ad439={},_0xa01171={'count':0x0,'rows':[]};var _0x45fb13=_[_0xd351('0x39')](db[_0xd351('0x3a')][_0xd351('0x3b')],function(_0x3bdbd5){return{'name':_0x3bdbd5[_0xd351('0x3c')],'type':_0x3bdbd5[_0xd351('0x3d')]['key']};});_0x5ad439[_0xd351('0x3e')]=_['map'](_0x45fb13,_0xd351('0x36'));_0x5ad439[_0xd351('0x3f')]=_[_0xd351('0x40')](_0x45611e[_0xd351('0x3f')]);_0x5ad439[_0xd351('0x41')]=_[_0xd351('0x42')](_0x5ad439[_0xd351('0x3e')],_0x5ad439['query']);_0x143293[_0xd351('0x43')]=_[_0xd351('0x42')](_0x5ad439[_0xd351('0x3e')],qs[_0xd351('0x44')](_0x45611e['query']['fields']));_0x143293[_0xd351('0x43')]=_0x143293[_0xd351('0x43')][_0xd351('0x45')]?_0x143293[_0xd351('0x43')]:_0x5ad439[_0xd351('0x3e')];if(!_0x45611e['query'][_0xd351('0x46')](_0xd351('0x47'))){_0x143293[_0xd351('0x2c')]=qs['limit'](_0x45611e[_0xd351('0x3f')][_0xd351('0x2c')]);_0x143293[_0xd351('0x2e')]=qs['offset'](_0x45611e[_0xd351('0x3f')][_0xd351('0x2e')]);}_0x143293['order']=qs[_0xd351('0x48')](_0x45611e[_0xd351('0x3f')][_0xd351('0x48')]);_0x143293[_0xd351('0x49')]=qs[_0xd351('0x41')](_[_0xd351('0x4a')](_0x45611e[_0xd351('0x3f')],_0x5ad439[_0xd351('0x41')]),_0x45fb13);if(_0x45611e[_0xd351('0x3f')][_0xd351('0x4b')]){_0x143293[_0xd351('0x49')]=_[_0xd351('0x4c')](_0x143293[_0xd351('0x49')],{'$or':_[_0xd351('0x39')](_0x45fb13,function(_0x535caa){if(_0x535caa[_0xd351('0x3d')]!=='VIRTUAL'){var _0x351ccb={};_0x351ccb[_0x535caa[_0xd351('0x36')]]={'$like':'%'+_0x45611e['query']['filter']+'%'};return _0x351ccb;}})});}_0x143293=_[_0xd351('0x4c')]({},_0x143293,_0x45611e[_0xd351('0x4d')]);var _0x4e07c6={'where':_0x143293[_0xd351('0x49')]};return db[_0xd351('0x3a')][_0xd351('0x2d')](_0x4e07c6)[_0xd351('0x1d')](function(_0x1200e5){_0xa01171[_0xd351('0x2d')]=_0x1200e5;if(_0x45611e[_0xd351('0x3f')][_0xd351('0x4e')]){_0x143293[_0xd351('0x4f')]=[{'all':!![]}];}return db[_0xd351('0x3a')][_0xd351('0x50')](_0x143293);})[_0xd351('0x1d')](function(_0x18a88f){_0xa01171[_0xd351('0x51')]=_0x18a88f;return _0xa01171;})[_0xd351('0x1d')](respondWithFilteredResult(_0x2f1d86,_0x143293))[_0xd351('0x26')](handleError(_0x2f1d86,null));};exports[_0xd351('0x52')]=function(_0x54b7d6,_0x4bc26b){var _0x43b3a6={'raw':![],'where':{'id':_0x54b7d6['params']['id']},'include':[{'model':db[_0xd351('0x37')],'as':_0xd351('0x38')}]},_0x60bb62={};_0x60bb62['model']=_[_0xd351('0x40')](db[_0xd351('0x3a')]['rawAttributes']);_0x60bb62['query']=_[_0xd351('0x40')](_0x54b7d6[_0xd351('0x3f')]);_0x60bb62[_0xd351('0x41')]=_['intersection'](_0x60bb62[_0xd351('0x3e')],_0x60bb62[_0xd351('0x3f')]);_0x43b3a6[_0xd351('0x43')]=_[_0xd351('0x42')](_0x60bb62[_0xd351('0x3e')],qs[_0xd351('0x44')](_0x54b7d6['query'][_0xd351('0x44')]));_0x43b3a6[_0xd351('0x43')]=_0x43b3a6['attributes'][_0xd351('0x45')]?_0x43b3a6[_0xd351('0x43')]:_0x60bb62[_0xd351('0x3e')];if(_0x54b7d6['query'][_0xd351('0x4e')]){_0x43b3a6[_0xd351('0x4f')]=[{'all':!![]}];}_0x43b3a6=_[_0xd351('0x4c')]({},_0x43b3a6,_0x54b7d6['options']);return db[_0xd351('0x3a')][_0xd351('0x53')](_0x43b3a6)['then'](handleEntityNotFound(_0x4bc26b,null))['then'](respondWithResult(_0x4bc26b,null))[_0xd351('0x26')](handleError(_0x4bc26b,null));};exports[_0xd351('0x54')]=function(_0x46a8de,_0x35189a){return db[_0xd351('0x3a')][_0xd351('0x54')](_0x46a8de['body'],{})[_0xd351('0x1d')](function(_0x18b16c){var _0x47b141=_0x46a8de['user']['get']({'plain':!![]});if(!_0x47b141)throw new Error(_0xd351('0x55'));if(_0x47b141[_0xd351('0x56')]===_0xd351('0x57')){var _0x1505c4=_0x18b16c[_0xd351('0x32')]({'plain':!![]});var _0x579187=_0xd351('0x33');return db[_0xd351('0x58')][_0xd351('0x53')]({'where':{'name':_0x579187,'userProfileId':_0x47b141[_0xd351('0x59')]},'raw':!![]})[_0xd351('0x1d')](function(_0x356e27){if(_0x356e27&&_0x356e27[_0xd351('0x5a')]===0x0){return db['UserProfileResource'][_0xd351('0x54')]({'name':_0x1505c4[_0xd351('0x36')],'resourceId':_0x1505c4['id'],'type':_0x356e27[_0xd351('0x36')],'sectionId':_0x356e27['id']},{})['then'](function(){return _0x18b16c;});}else{return _0x18b16c;}})[_0xd351('0x26')](function(_0x573dc7){logger[_0xd351('0x23')](_0xd351('0x5b'),_0x573dc7);throw _0x573dc7;});}return _0x18b16c;})[_0xd351('0x1d')](respondWithResult(_0x35189a,0xc9))['catch'](handleError(_0x35189a,null));};exports[_0xd351('0x5c')]=function(_0x3bf8fd,_0x3d6106){if(_0x3bf8fd[_0xd351('0x5d')]['id']){delete _0x3bf8fd[_0xd351('0x5d')]['id'];}return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x3bf8fd['params']['id']},'include':[{'model':db[_0xd351('0x37')],'as':'mandatoryDispositionPause'}]})[_0xd351('0x1d')](handleEntityNotFound(_0x3d6106,null))['then'](saveUpdates(_0x3bf8fd[_0xd351('0x5d')],null))[_0xd351('0x1d')](respondWithResult(_0x3d6106,null))[_0xd351('0x26')](handleError(_0x3d6106,null));};exports[_0xd351('0x35')]=function(_0x2f334f,_0x45c3d6){return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x2f334f['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x45c3d6,null))[_0xd351('0x1d')](removeEntity(_0x45c3d6,null))[_0xd351('0x26')](handleError(_0x45c3d6,null));};exports[_0xd351('0x5e')]=function(_0x438e2f,_0x6c3a99){return db['SmsAccount'][_0xd351('0x5e')]()['then'](respondWithResult(_0x6c3a99,null))[_0xd351('0x26')](handleError(_0x6c3a99,null));};exports[_0xd351('0x5f')]=function(_0x21e836,_0x2fa92c,_0x5b0aa4){if(_0x21e836[_0xd351('0x5d')]['id']){delete _0x21e836[_0xd351('0x5d')]['id'];}return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x21e836[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x2fa92c,null))[_0xd351('0x1d')](function(_0x377c4c){if(_0x377c4c){_0x21e836[_0xd351('0x5d')][_0xd351('0x61')]=_0x377c4c['id'];return db[_0xd351('0x62')][_0xd351('0x54')](_0x21e836[_0xd351('0x5d')]);}})['then'](respondWithResult(_0x2fa92c,null))[_0xd351('0x26')](handleError(_0x2fa92c,null));};exports['getDispositions']=function(_0x1c842f,_0x31e9d0,_0xb733cd){var _0x4535a1={'raw':![],'where':{}};var _0x5b93b5={};var _0x1525ce={'count':0x0,'rows':[]};return db[_0xd351('0x3a')][_0xd351('0x63')]({'where':{'id':_0x1c842f[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x31e9d0,null))[_0xd351('0x1d')](function(_0x5219f5){if(_0x5219f5){_0x5b93b5['model']=_[_0xd351('0x40')](db[_0xd351('0x62')][_0xd351('0x3b')]);_0x5b93b5['query']=_[_0xd351('0x40')](_0x1c842f['query']);_0x5b93b5[_0xd351('0x41')]=_[_0xd351('0x42')](_0x5b93b5[_0xd351('0x3e')],_0x5b93b5[_0xd351('0x3f')]);_0x4535a1[_0xd351('0x43')]=_['intersection'](_0x5b93b5[_0xd351('0x3e')],qs[_0xd351('0x44')](_0x1c842f[_0xd351('0x3f')][_0xd351('0x44')]));_0x4535a1[_0xd351('0x43')]=_0x4535a1[_0xd351('0x43')][_0xd351('0x45')]?_0x4535a1[_0xd351('0x43')]:_0x5b93b5[_0xd351('0x3e')];if(!_0x1c842f[_0xd351('0x3f')][_0xd351('0x46')](_0xd351('0x47'))){_0x4535a1[_0xd351('0x2c')]=qs[_0xd351('0x2c')](_0x1c842f[_0xd351('0x3f')]['limit']);_0x4535a1[_0xd351('0x2e')]=qs[_0xd351('0x2e')](_0x1c842f[_0xd351('0x3f')]['offset']);}_0x4535a1[_0xd351('0x64')]=qs['sort'](_0x1c842f[_0xd351('0x3f')][_0xd351('0x48')]);_0x4535a1[_0xd351('0x49')]=qs[_0xd351('0x41')](_[_0xd351('0x4a')](_0x1c842f['query'],_0x5b93b5[_0xd351('0x41')]));_0x4535a1[_0xd351('0x49')][_0xd351('0x61')]=_0x5219f5['id'];if(_0x1c842f[_0xd351('0x3f')]['filter']){_0x4535a1[_0xd351('0x49')]=_[_0xd351('0x4c')](_0x4535a1[_0xd351('0x49')],{'$or':_[_0xd351('0x39')](_0x4535a1['attributes'],function(_0x5958d9){var _0x46ada0={};_0x46ada0[_0x5958d9]={'$like':'%'+_0x1c842f[_0xd351('0x3f')][_0xd351('0x4b')]+'%'};return _0x46ada0;})});}_0x4535a1=_[_0xd351('0x4c')]({},_0x4535a1,_0x1c842f[_0xd351('0x4d')]);return db[_0xd351('0x62')][_0xd351('0x2d')]({'where':_0x4535a1['where']})['then'](function(_0x5a2b81){_0x1525ce[_0xd351('0x2d')]=_0x5a2b81;if(_0x1c842f[_0xd351('0x3f')][_0xd351('0x4e')]){_0x4535a1[_0xd351('0x4f')]=[{'all':!![]}];}return db[_0xd351('0x62')][_0xd351('0x50')](_0x4535a1);})[_0xd351('0x1d')](function(_0x4b2867){_0x1525ce[_0xd351('0x51')]=_0x4b2867;return _0x1525ce;});}})[_0xd351('0x1d')](respondWithFilteredResult(_0x31e9d0,_0x4535a1))[_0xd351('0x26')](handleError(_0x31e9d0,null));};exports[_0xd351('0x65')]=function(_0x2b82f3,_0x1afb1a,_0x578b19){return db[_0xd351('0x3a')]['find']({'where':{'id':_0x2b82f3[_0xd351('0x60')]['id']}})['then'](handleEntityNotFound(_0x1afb1a,null))[_0xd351('0x1d')](function(_0x2eabd3){if(_0x2eabd3){return _0x2eabd3['removeDispositions'](_0x2b82f3[_0xd351('0x3f')][_0xd351('0x66')]);}})[_0xd351('0x1d')](respondWithStatusCode(_0x1afb1a,null))[_0xd351('0x26')](handleError(_0x1afb1a,null));};exports[_0xd351('0x67')]=function(_0x3e0f3c,_0x3da805,_0x332130){if(_0x3e0f3c[_0xd351('0x5d')]['id']){delete _0x3e0f3c[_0xd351('0x5d')]['id'];}return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x3e0f3c[_0xd351('0x60')]['id']}})['then'](handleEntityNotFound(_0x3da805,null))[_0xd351('0x1d')](function(_0xa0719d){if(_0xa0719d){_0x3e0f3c[_0xd351('0x5d')][_0xd351('0x61')]=_0xa0719d['id'];return db[_0xd351('0x68')][_0xd351('0x54')](_0x3e0f3c[_0xd351('0x5d')]);}})[_0xd351('0x1d')](respondWithResult(_0x3da805,null))[_0xd351('0x26')](handleError(_0x3da805,null));};exports[_0xd351('0x69')]=function(_0x272f82,_0x59d8ce,_0xd7016e){var _0x9de136={'raw':![],'where':{}};var _0x99e29c={};var _0x154375={'count':0x0,'rows':[]};return db[_0xd351('0x3a')]['findOne']({'where':{'id':_0x272f82[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x59d8ce,null))[_0xd351('0x1d')](function(_0x534ceb){if(_0x534ceb){_0x99e29c['model']=_[_0xd351('0x40')](db[_0xd351('0x68')][_0xd351('0x3b')]);_0x99e29c['query']=_[_0xd351('0x40')](_0x272f82[_0xd351('0x3f')]);_0x99e29c[_0xd351('0x41')]=_[_0xd351('0x42')](_0x99e29c[_0xd351('0x3e')],_0x99e29c[_0xd351('0x3f')]);_0x9de136[_0xd351('0x43')]=_[_0xd351('0x42')](_0x99e29c[_0xd351('0x3e')],qs[_0xd351('0x44')](_0x272f82['query']['fields']));_0x9de136['attributes']=_0x9de136[_0xd351('0x43')][_0xd351('0x45')]?_0x9de136[_0xd351('0x43')]:_0x99e29c[_0xd351('0x3e')];if(!_0x272f82[_0xd351('0x3f')][_0xd351('0x46')]('nolimit')){_0x9de136[_0xd351('0x2c')]=qs[_0xd351('0x2c')](_0x272f82[_0xd351('0x3f')][_0xd351('0x2c')]);_0x9de136[_0xd351('0x2e')]=qs['offset'](_0x272f82[_0xd351('0x3f')][_0xd351('0x2e')]);}_0x9de136[_0xd351('0x64')]=qs['sort'](_0x272f82[_0xd351('0x3f')][_0xd351('0x48')]);_0x9de136[_0xd351('0x49')]=qs[_0xd351('0x41')](_['pick'](_0x272f82[_0xd351('0x3f')],_0x99e29c[_0xd351('0x41')]));_0x9de136[_0xd351('0x49')][_0xd351('0x61')]=_0x534ceb['id'];if(_0x272f82[_0xd351('0x3f')][_0xd351('0x4b')]){_0x9de136[_0xd351('0x49')]=_[_0xd351('0x4c')](_0x9de136['where'],{'$or':_['map'](_0x9de136[_0xd351('0x43')],function(_0x40d87b){var _0x586b8c={};_0x586b8c[_0x40d87b]={'$like':'%'+_0x272f82[_0xd351('0x3f')]['filter']+'%'};return _0x586b8c;})});}_0x9de136=_[_0xd351('0x4c')]({},_0x9de136,_0x272f82['options']);return db[_0xd351('0x68')][_0xd351('0x2d')]({'where':_0x9de136[_0xd351('0x49')]})[_0xd351('0x1d')](function(_0x332370){_0x154375[_0xd351('0x2d')]=_0x332370;if(_0x272f82['query'][_0xd351('0x4e')]){_0x9de136[_0xd351('0x4f')]=[{'all':!![]}];}return db[_0xd351('0x68')]['findAll'](_0x9de136);})[_0xd351('0x1d')](function(_0x2090b4){_0x154375[_0xd351('0x51')]=_0x2090b4;return _0x154375;});}})[_0xd351('0x1d')](respondWithFilteredResult(_0x59d8ce,_0x9de136))[_0xd351('0x26')](handleError(_0x59d8ce,null));};exports[_0xd351('0x6a')]=function(_0x7005ee,_0xd33025,_0x31bdfa){return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x7005ee[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xd33025,null))[_0xd351('0x1d')](function(_0x2b2d4d){if(_0x2b2d4d){return _0x2b2d4d[_0xd351('0x6a')](_0x7005ee[_0xd351('0x3f')][_0xd351('0x66')]);}})[_0xd351('0x1d')](respondWithStatusCode(_0xd33025,null))['catch'](handleError(_0xd33025,null));};exports[_0xd351('0x6b')]=function(_0x559d2e,_0x141c37,_0x364faf){var _0x42b3a5={'channel':_0xd351('0x6c')};var _0x2cb589=[];var _0x2e53fd=[];var _0x268d6b={};return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x559d2e['params']['id']},'include':[{'model':db[_0xd351('0x6d')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x141c37,null))[_0xd351('0x1d')](function(_0x39fe7f){_0x42b3a5['account']=_0x39fe7f;_0x42b3a5[_0xd351('0x6e')]=_[_0xd351('0x6f')](_0x39fe7f[_0xd351('0x70')],['priority'],[_0xd351('0x71')]);if(_0x42b3a5[_0xd351('0x72')][_0xd351('0x70')]){delete _0x42b3a5[_0xd351('0x72')]['Applications'];}return db[_0xd351('0x73')][_0xd351('0x5e')]();})[_0xd351('0x1d')](function(_0x4534a1){if(!_0x4534a1){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))](_0xd351('0x76'));}_0x2cb589=_[_0xd351('0x77')](_[_0xd351('0x40')](_0x4534a1),[_0xd351('0x78'),'updatedAt']);_0x2e53fd=_[_0xd351('0x77')](_[_0xd351('0x40')](_0x4534a1),[_0xd351('0x78'),_0xd351('0x79'),_0xd351('0x7a'),_0xd351('0x7b')]);_0x42b3a5[_0xd351('0x5d')]={'mapKey':'mobile'};if(_0x42b3a5[_0xd351('0x72')][_0xd351('0x3d')]){switch(_0x42b3a5['account']['type']){case'twilio':_0x42b3a5[_0xd351('0x5d')]['from']=_0x559d2e[_0xd351('0x5d')][_0xd351('0x7c')];_0x42b3a5[_0xd351('0x5d')]['body']=_0x559d2e['body'][_0xd351('0x7d')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x7f')];break;case _0xd351('0x80'):_0x42b3a5['body'][_0xd351('0x81')]='+'+_0x559d2e['body'][_0xd351('0x82')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x83')];break;case _0xd351('0x84'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x81')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x25')];break;case _0xd351('0x85'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x81')];_0x42b3a5[_0xd351('0x5d')]['body']=_0x559d2e[_0xd351('0x5d')]['body'];_0x42b3a5[_0xd351('0x5d')]['messageId']=_0x559d2e[_0xd351('0x5d')][_0xd351('0x86')];break;case _0xd351('0x87'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e['body'][_0xd351('0x7c')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x88')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x89')];break;case'infobip':_0x42b3a5['body'][_0xd351('0x81')]='+'+_0x559d2e['body'][_0xd351('0x8a')][0x0][_0xd351('0x81')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x8a')][0x0]['text'];_0x42b3a5[_0xd351('0x5d')]['messageId']=_0x559d2e['body'][_0xd351('0x8a')][0x0][_0xd351('0x7e')];break;case _0xd351('0x8b'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e[_0xd351('0x5d')]['originatingAddress'];_0x42b3a5['body'][_0xd351('0x5d')]=_0x559d2e['body']['segmentedMessage']['message'];break;case _0xd351('0x8c'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x8d')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e['body'][_0xd351('0x83')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')]=_0x559d2e[_0xd351('0x5d')]['replyMessageId'];break;case _0xd351('0x8e'):_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')]=_0x559d2e[_0xd351('0x5d')][0x0]['message']['id'];_0x42b3a5[_0xd351('0x5d')]['from']=_0x559d2e[_0xd351('0x5d')][0x0][_0xd351('0x25')][_0xd351('0x81')];_0x42b3a5[_0xd351('0x5d')]['body']=_0x559d2e['body'][0x0][_0xd351('0x25')][_0xd351('0x83')];break;case'intelepeer':_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')]=_0x559d2e[_0xd351('0x5d')]['from'];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x25')];_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')]=_0x559d2e[_0xd351('0x5d')][_0xd351('0x8f')];break;}}if(_0x42b3a5['body']['id']){delete _0x42b3a5[_0xd351('0x5d')]['id'];}if(_[_0xd351('0x90')](_0x42b3a5['body']['from'])){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))](_0xd351('0x91'));}if(_['isNil'](_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')])||_0x42b3a5[_0xd351('0x5d')][_0xd351('0x5d')]===''){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))](_0xd351('0x92'));}if(_['isNil'](_0x42b3a5['body'][_0xd351('0x93')])){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e53fd);}if(!_['includes'](_0x2e53fd,_0x42b3a5[_0xd351('0x5d')][_0xd351('0x93')])){throw new db[(_0xd351('0x74'))]['ValidationError'](_0xd351('0x94')+_0x2e53fd);}_0x268d6b[_0x42b3a5[_0xd351('0x5d')][_0xd351('0x93')]]=_0x42b3a5['body'][_0xd351('0x81')];return db[_0xd351('0x95')][_0xd351('0x53')]({'where':{'id':_0x42b3a5[_0xd351('0x72')][_0xd351('0x7b')]},'include':[{'model':db[_0xd351('0x73')],'as':'Contacts','where':_0x268d6b,'limit':0x1,'order':[[_0xd351('0x79'),_0xd351('0x96')]]}]});})[_0xd351('0x1d')](handleEntityNotFound(_0x141c37,null))[_0xd351('0x1d')](function(_0x256709){if(_0x256709){_0x42b3a5[_0xd351('0x97')]=_[_0xd351('0x98')](_0x256709,[_0xd351('0x99')]);if(_0x256709[_0xd351('0x99')][_0xd351('0x45')]){return _0x256709[_0xd351('0x99')][0x0];}var _0x35e0f5=_[_0xd351('0x15')](_0x42b3a5[_0xd351('0x5d')],{'firstName':_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')],'ListId':_0x256709['id']});_0x35e0f5[_0x42b3a5[_0xd351('0x5d')][_0xd351('0x93')]]=_0x42b3a5['body'][_0xd351('0x81')];return db[_0xd351('0x73')][_0xd351('0x54')](_0x35e0f5,{'fields':_0x2cb589,'raw':!![]});}})[_0xd351('0x1d')](handleEntityNotFound(_0x141c37,null))[_0xd351('0x1d')](function(_0x752dcf){if(_0x752dcf){_0x42b3a5['contact']=_0x752dcf;var _0x1b4665={'ContactId':_0x752dcf['id'],'phone':_0x42b3a5[_0xd351('0x5d')][_0xd351('0x81')],'SmsAccountId':_0x559d2e[_0xd351('0x60')]['id']};var _0x2b9cde={'ContactId':_0x752dcf['id'],'SmsAccountId':_0x559d2e['params']['id'],'closed':![]};return db[_0xd351('0x9a')][_0xd351('0x53')]({'where':_0x2b9cde})[_0xd351('0x1d')](function(_0x57bb2b){if(_0x57bb2b){return[_0x57bb2b,![]];}return db[_0xd351('0x9a')][_0xd351('0x54')](_0x1b4665)[_0xd351('0x1d')](function(_0xd4240b){return[_0xd4240b,!![]];});});}})[_0xd351('0x9b')](function(_0x13c0ba,_0x3a67be){_0x42b3a5[_0xd351('0x9c')]=_0x13c0ba[_0xd351('0x32')]({'plain':!![]});_0x42b3a5['interaction'][_0xd351('0x9d')]=![];if(_0x3a67be){if(_0x42b3a5[_0xd351('0x72')][_0xd351('0x9e')]){_0x42b3a5[_0xd351('0x6e')][_0xd351('0x9f')]({'id':0x0,'priority':_0x42b3a5[_0xd351('0x6e')][_0xd351('0x45')]+0x1,'app':'close','appdata':_0xd351('0xa0'),'interval':_0xd351('0xa1')});}_0x42b3a5[_0xd351('0x9c')]['created']=!![];}return db[_0xd351('0xa2')][_0xd351('0x54')]({'phone':_0x42b3a5[_0xd351('0x5d')]['from'],'messageId':_0x42b3a5[_0xd351('0x5d')][_0xd351('0x7e')],'body':_0x42b3a5['body'][_0xd351('0x5d')],'SmsAccountId':_0x559d2e['params']['id'],'SmsInteractionId':_0x13c0ba['id'],'direction':'in','ContactId':_0x13c0ba['ContactId'],'AttachmentId':_0x42b3a5[_0xd351('0x5d')]['AttachmentId']});})[_0xd351('0x1d')](function(_0x530b79){_0x42b3a5['message']=_0x530b79;if(_0x42b3a5[_0xd351('0x9c')][_0xd351('0xa3')]){return db[_0xd351('0xa4')]['find']({'attributes':['id',_0xd351('0x36')],'where':{'id':_0x42b3a5[_0xd351('0x9c')][_0xd351('0xa3')]}})[_0xd351('0x1d')](function(_0x5ca42e){if(_0x5ca42e){_0x42b3a5[_0xd351('0x6e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd351('0xa5'),'appdata':_0x5ca42e[_0xd351('0x36')]+','+(_0x42b3a5[_0xd351('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0xd351('0xa1')});}return respondWithRpcPromise(_0xd351('0xa6'),_0xd351('0xa7'),_0x42b3a5);});}return respondWithRpcPromise('Start','startRouting',_0x42b3a5);})[_0xd351('0x1d')](function(_0x1e45ba){if(_0x1e45ba){var _0x4a9faa=0xc8;var _0x459dee=_0xd351('0xa8');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x459dee,_0x4a9faa,_0xd351('0xa9'));logger['debug'](_0xd351('0xaa'),_0x459dee,_0x4a9faa,'entity\x20found',JSON['stringify'](_0x1e45ba));if(_0x42b3a5[_0xd351('0x72')][_0xd351('0x3d')]===_0xd351('0xab')){return _0x141c37['status'](_0x4a9faa)[_0xd351('0x2f')]('Content-Type',_0xd351('0xac'))[_0xd351('0xad')](_0xd351('0xae'));}else{return _0x141c37[_0xd351('0x28')](_0x4a9faa)[_0xd351('0x2a')](_0x1e45ba);}}})[_0xd351('0x26')](handleError(_0x141c37,null));};exports[_0xd351('0xaf')]=function(_0x2d75bc,_0x29e3d4){var _0x1d7040=_0x2d75bc[_0xd351('0x60')]['id'];var _0x2182db=_0x2d75bc[_0xd351('0x5d')];var _0x5d3c7a=0xc8;var _0x2dd826=null;return db['sequelize'][_0xd351('0xb0')]({'isolationLevel':db['sequelize']['Transaction'][_0xd351('0xb1')][_0xd351('0xb2')]},function(_0x12be07){return db['SmsAccount'][_0xd351('0x63')]({'where':{'id':_0x1d7040},'transaction':_0x12be07})[_0xd351('0x1d')](function(_0x5dcbd9){if(_0x5dcbd9){return db[_0xd351('0x6d')][_0xd351('0x35')]({'where':{'SmsAccountId':_0x1d7040},'transaction':_0x12be07})[_0xd351('0x1d')](function(){var _0x509796=_[_0xd351('0x39')](_0x2182db,function(_0x4076b8){_0x4076b8[_0xd351('0x61')]=_0x1d7040;return _0x4076b8;});return db[_0xd351('0x6d')][_0xd351('0xb3')](_0x509796,{'transaction':_0x12be07});});}else{_0x5d3c7a=0x194;_0x2dd826=[];}});})[_0xd351('0x1d')](function(){if(_0x5d3c7a!==0x194){return db[_0xd351('0x6d')][_0xd351('0xb4')]({'where':{'SmsAccountId':_0x1d7040},'order':_0xd351('0xb5')})[_0xd351('0x1d')](function(_0x200662){_0x2dd826=_0x200662;});}})[_0xd351('0x26')](function(_0x5e1fea){_0x5d3c7a=0x1f4;logger[_0xd351('0x23')](_0x5e1fea[_0xd351('0xb6')]);if(_0x5e1fea['name']){delete _0x5e1fea[_0xd351('0x36')];}_0x2dd826=_0x5e1fea;})[_0xd351('0xb7')](function(){if(_0x2dd826===null){_0x29e3d4[_0xd351('0x27')](_0x5d3c7a);}else{if(_0x5d3c7a===0x1f4){_0x29e3d4[_0xd351('0x28')](_0x5d3c7a)[_0xd351('0xad')](_0x2dd826);}else{_0x29e3d4[_0xd351('0x28')](_0x5d3c7a)[_0xd351('0x2a')](_0x2dd826);}}});};exports['getApplications']=function(_0xe009cb,_0x3e2c31,_0x2b4178){var _0x2b73ac={};var _0x46b9b9={};var _0x463dc2;var _0x3b34e7;return db['SmsAccount']['findOne']({'where':{'id':_0xe009cb[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x3e2c31,null))[_0xd351('0x1d')](function(_0x241973){if(_0x241973){_0x463dc2=_0x241973;_0x46b9b9[_0xd351('0x3e')]=_[_0xd351('0x40')](db[_0xd351('0x6d')][_0xd351('0x3b')]);_0x46b9b9[_0xd351('0x3f')]=_[_0xd351('0x40')](_0xe009cb[_0xd351('0x3f')]);_0x46b9b9['filters']=_[_0xd351('0x42')](_0x46b9b9[_0xd351('0x3e')],_0x46b9b9[_0xd351('0x3f')]);_0x2b73ac[_0xd351('0x43')]=_['intersection'](_0x46b9b9['model'],qs[_0xd351('0x44')](_0xe009cb[_0xd351('0x3f')][_0xd351('0x44')]));_0x2b73ac[_0xd351('0x43')]=_0x2b73ac['attributes']['length']?_0x2b73ac['attributes']:_0x46b9b9[_0xd351('0x3e')];_0x2b73ac[_0xd351('0x64')]=qs[_0xd351('0x48')](_0xe009cb[_0xd351('0x3f')]['sort']);_0x2b73ac[_0xd351('0x49')]=qs[_0xd351('0x41')](_[_0xd351('0x4a')](_0xe009cb[_0xd351('0x3f')],_0x46b9b9[_0xd351('0x41')]));if(_0xe009cb['query']['filter']){_0x2b73ac[_0xd351('0x49')]=_[_0xd351('0x4c')](_0x2b73ac['where'],{'$or':_[_0xd351('0x39')](_0x2b73ac[_0xd351('0x43')],function(_0x29f958){var _0x11bf2a={};_0x11bf2a[_0x29f958]={'$like':'%'+_0xe009cb['query'][_0xd351('0x4b')]+'%'};return _0x11bf2a;})});}_0x2b73ac=_[_0xd351('0x4c')]({},_0x2b73ac,_0xe009cb['options']);return _0x463dc2['getApplications'](_0x2b73ac);}})[_0xd351('0x1d')](function(_0x1c7595){if(_0x1c7595){_0x3b34e7=_0x1c7595['length'];if(!_0xe009cb['query'][_0xd351('0x46')](_0xd351('0x47'))){_0x2b73ac[_0xd351('0x2c')]=qs['limit'](_0xe009cb['query'][_0xd351('0x2c')]);_0x2b73ac[_0xd351('0x2e')]=qs[_0xd351('0x2e')](_0xe009cb[_0xd351('0x3f')][_0xd351('0x2e')]);}return _0x463dc2[_0xd351('0xb8')](_0x2b73ac);}})[_0xd351('0x1d')](function(_0x323fde){if(_0x323fde){return _0x323fde?{'count':_0x3b34e7,'rows':_0x323fde}:null;}})['then'](respondWithResult(_0x3e2c31,null))['catch'](handleError(_0x3e2c31,null));};exports[_0xd351('0xb9')]=function(_0x31d2d3,_0x555688,_0x29ff91){var _0x38d6a5={'raw':![],'where':{}};var _0x494369={};var _0x2dcf2e={'count':0x0,'rows':[]};return db[_0xd351('0x3a')][_0xd351('0x63')]({'where':{'id':_0x31d2d3['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x555688,null))[_0xd351('0x1d')](function(_0x22e69a){if(_0x22e69a){_0x494369[_0xd351('0x3e')]=_['keys'](db[_0xd351('0x9a')]['rawAttributes']);_0x494369[_0xd351('0x3f')]=_[_0xd351('0x40')](_0x31d2d3[_0xd351('0x3f')]);_0x494369[_0xd351('0x41')]=_[_0xd351('0x42')](_0x494369[_0xd351('0x3e')],_0x494369['query']);_0x38d6a5[_0xd351('0x43')]=_['intersection'](_0x494369['model'],qs[_0xd351('0x44')](_0x31d2d3[_0xd351('0x3f')][_0xd351('0x44')]));_0x38d6a5[_0xd351('0x43')]=_0x38d6a5[_0xd351('0x43')]['length']?_0x38d6a5[_0xd351('0x43')]:_0x494369['model'];if(!_0x31d2d3[_0xd351('0x3f')]['hasOwnProperty'](_0xd351('0x47'))){_0x38d6a5['limit']=qs['limit'](_0x31d2d3[_0xd351('0x3f')]['limit']);_0x38d6a5[_0xd351('0x2e')]=qs[_0xd351('0x2e')](_0x31d2d3[_0xd351('0x3f')][_0xd351('0x2e')]);}_0x38d6a5[_0xd351('0x64')]=qs[_0xd351('0x48')](_0x31d2d3[_0xd351('0x3f')][_0xd351('0x48')]);_0x38d6a5[_0xd351('0x49')]=qs['filters'](_[_0xd351('0x4a')](_0x31d2d3[_0xd351('0x3f')],_0x494369['filters']));_0x38d6a5[_0xd351('0x49')][_0xd351('0x61')]=_0x22e69a['id'];if(_0x31d2d3[_0xd351('0x3f')]['filter']){_0x38d6a5[_0xd351('0x49')]=_[_0xd351('0x4c')](_0x38d6a5[_0xd351('0x49')],{'$or':_[_0xd351('0x39')](_0x38d6a5[_0xd351('0x43')],function(_0x557d29){var _0x325217={};_0x325217[_0x557d29]={'$like':'%'+_0x31d2d3[_0xd351('0x3f')][_0xd351('0x4b')]+'%'};return _0x325217;})});}_0x38d6a5=_['merge']({},_0x38d6a5,_0x31d2d3[_0xd351('0x4d')]);return db[_0xd351('0x9a')][_0xd351('0x2d')]({'where':_0x38d6a5['where']})['then'](function(_0x33308c){_0x2dcf2e[_0xd351('0x2d')]=_0x33308c;if(_0x31d2d3[_0xd351('0x3f')][_0xd351('0x4e')]){_0x38d6a5['include']=[{'model':db[_0xd351('0x73')],'as':_0xd351('0xba'),'required':![]},{'model':db[_0xd351('0xa4')],'as':_0xd351('0xbb'),'attributes':[_0xd351('0x36'),'fullname',_0xd351('0xbc')],'required':![]},{'model':db['Tag'],'as':_0xd351('0xbd'),'attributes':['id','name',_0xd351('0xbe')],'where':_0x31d2d3['query'][_0xd351('0xbf')]?{'id':_0x31d2d3[_0xd351('0x3f')][_0xd351('0xbf')]}:undefined,'required':_0x31d2d3['query'][_0xd351('0xbf')]?!![]:![]}];}return db[_0xd351('0x9a')][_0xd351('0x50')](_0x38d6a5);})[_0xd351('0x1d')](function(_0x302d55){_0x2dcf2e[_0xd351('0x51')]=_0x302d55;return _0x2dcf2e;});}})[_0xd351('0x1d')](respondWithFilteredResult(_0x555688,_0x38d6a5))[_0xd351('0x26')](handleError(_0x555688,null));};exports[_0xd351('0xad')]=function(_0x1ac863,_0x5baa0f,_0x5549c1){var _0x58eda2,_0x87f31d,_0x409f78;if(_[_0xd351('0x90')](_0x1ac863['body'][_0xd351('0x5d')])||_0x1ac863[_0xd351('0x5d')][_0xd351('0x5d')]===''){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))](_0xd351('0x92'));}if(_[_0xd351('0x90')](_0x1ac863[_0xd351('0x5d')]['to'])){throw new db[(_0xd351('0x74'))][(_0xd351('0x75'))](_0xd351('0xc0'));}_0x58eda2=_0x1ac863[_0xd351('0x5d')]['to'];return db['SmsAccount'][_0xd351('0x53')]({'where':{'id':_0x1ac863[_0xd351('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xd351('0xc1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x58eda2},'limit':0x1,'order':[[_0xd351('0x79'),_0xd351('0x96')]]}]}]})[_0xd351('0x1d')](handleEntityNotFound(_0x5baa0f,null))['then'](function(_0x295b1f){if(_0x295b1f&&_0x295b1f['List']){_0x87f31d=_0x295b1f['get']({'plain':!![]});if(_0x87f31d[_0xd351('0xc1')]&&_0x87f31d[_0xd351('0xc1')][_0xd351('0x99')][_0xd351('0x45')]){return _0x87f31d['List'][_0xd351('0x99')][0x0];}return db[_0xd351('0x73')][_0xd351('0x54')](_[_0xd351('0x15')](_0x1ac863[_0xd351('0x5d')],{'firstName':_0x58eda2,'mobile':_0x58eda2,'phone':_0x58eda2,'ListId':_0x87f31d[_0xd351('0x7b')]}));}})[_0xd351('0x1d')](handleEntityNotFound(_0x5baa0f,null))[_0xd351('0x1d')](function(_0x5cd800){if(_0x5cd800){_0x409f78=_0x5cd800;return db[_0xd351('0x9a')]['find']({'where':{'ContactId':_0x409f78['id'],'closed':![],'SmsAccountId':_0x87f31d['id']}})[_0xd351('0x1d')](function(_0x48f56d){if(_0x48f56d){return[_0x48f56d,![]];}return db[_0xd351('0x9a')][_0xd351('0x54')]({'UserId':_0x1ac863['user']['id'],'ContactId':_0x409f78['id'],'SmsAccountId':_0x87f31d['id'],'phone':_0x58eda2,'firstMsgDirection':_0xd351('0xc2'),'Messages':[_[_0xd351('0x4c')](_0x1ac863[_0xd351('0x5d')],{'read':![],'body':_0x1ac863[_0xd351('0x5d')][_0xd351('0x5d')],'phone':_0x58eda2,'SmsAccountId':_0x87f31d['id'],'UserId':_0x1ac863[_0xd351('0x57')]['id'],'ContactId':_0x409f78['id']})]},{'include':[{'model':db[_0xd351('0xa2')],'as':_0xd351('0xc3')}]})[_0xd351('0x1d')](function(_0x815dfe){return[_0x815dfe,!![]];});});}})[_0xd351('0x9b')](function(_0x124052,_0x411623){if(_0x411623){return _0x124052;}return db[_0xd351('0xa2')][_0xd351('0x54')](_[_0xd351('0x4c')](_0x1ac863[_0xd351('0x5d')],{'read':![],'body':_0x1ac863[_0xd351('0x5d')]['body'],'phone':_0x58eda2,'SmsAccountId':_0x87f31d['id'],'SmsInteractionId':_0x124052['id'],'UserId':_0x1ac863[_0xd351('0x57')]['id'],'ContactId':_0x409f78['id']}))[_0xd351('0x1d')](function(_0x45320a){_0x124052['dataValues'][_0xd351('0xc3')]=[];_0x124052[_0xd351('0xc4')][_0xd351('0xc3')][_0xd351('0x9f')](_0x45320a[_0xd351('0xc4')]);return _0x124052;});})[_0xd351('0x1d')](respondWithResult(_0x5baa0f,null))[_0xd351('0x26')](handleError(_0x5baa0f,null));};exports[_0xd351('0x28')]=function(_0x27ac35,_0x180ec7,_0x5b96f3){if(_0x27ac35['body']['id']){delete _0x27ac35[_0xd351('0x5d')]['id'];}var _0x1cbbff,_0x3e1235,_0x9e9ba0;return db['SmsAccount'][_0xd351('0x53')]({'where':{'id':_0x27ac35[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x180ec7,null))[_0xd351('0x1d')](function(_0x5e1da1){if(_0x5e1da1){_0x9e9ba0=_0x5e1da1;logger[_0xd351('0x20')](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0xc5'),_0x5e1da1[_0xd351('0x3d')],util[_0xd351('0xc6')](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5e1da1[_0xd351('0x3d')]){case _0xd351('0x80'):if(_0x27ac35['body'][_0xd351('0xc7')]&&_0x27ac35[_0xd351('0x5d')][_0xd351('0x28')]){_0x3e1235=_0x27ac35[_0xd351('0x5d')][_0xd351('0x28')];return db[_0xd351('0xa2')][_0xd351('0x53')]({'where':{'messageId':_0x27ac35[_0xd351('0x5d')][_0xd351('0xc7')]}});}break;case _0xd351('0x84'):if(_0x27ac35[_0xd351('0x5d')]['requestid']&&_0x27ac35[_0xd351('0x5d')][_0xd351('0xc8')]){_0x3e1235=_0x27ac35[_0xd351('0x5d')][_0xd351('0xc8')];return db[_0xd351('0xa2')][_0xd351('0x53')]({'where':{'messageId':_0x27ac35[_0xd351('0x5d')]['requestid']}});}break;case'clicksend':if(_0x27ac35[_0xd351('0x5d')]['message_id']&&_0x27ac35[_0xd351('0x5d')][_0xd351('0xc9')]){_0x3e1235=_0x27ac35[_0xd351('0x5d')]['status_code'];return db[_0xd351('0xa2')][_0xd351('0x53')]({'where':{'messageId':_0x27ac35[_0xd351('0x5d')]['message_id']}});}break;case _0xd351('0xca'):var _0x1e916b=_0x27ac35[_0xd351('0x5d')][_0xd351('0x8a')][0x0];if(_0x1e916b[_0xd351('0x7e')]&&_0x1e916b['status']['groupName']===_0xd351('0xcb')){_0x3e1235=_0x1e916b[_0xd351('0x28')][_0xd351('0xcc')];return db[_0xd351('0xa2')]['find']({'where':{'messageId':_0x1e916b[_0xd351('0x7e')]}});}break;case _0xd351('0x8c'):if(_0x27ac35['body']['messageId']&&_0x27ac35['body'][_0xd351('0x28')]){_0x3e1235=_0x27ac35[_0xd351('0x5d')][_0xd351('0x28')];return db['SmsMessage'][_0xd351('0x53')]({'where':{'messageId':_0x27ac35['body'][_0xd351('0x7e')]}});}break;case'bandwidth':if(_0x27ac35[_0xd351('0x5d')][0x0][_0xd351('0x25')]['id']){_0x3e1235=_0x27ac35['body'][0x0][_0xd351('0x3d')];return db[_0xd351('0xa2')]['find']({'where':{'messageId':_0x27ac35[_0xd351('0x5d')][0x0][_0xd351('0x25')]['id']}});}break;case _0xd351('0xcd'):if(_0x27ac35[_0xd351('0x5d')][_0xd351('0xce')]&&_0x27ac35[_0xd351('0x5d')]['status']){_0x3e1235=_0x27ac35[_0xd351('0x5d')]['status'];return db[_0xd351('0xa2')][_0xd351('0x53')]({'where':{'messageId':_0x27ac35[_0xd351('0x5d')]['redif']}});}break;}}})[_0xd351('0x1d')](handleEntityNotFound(_0x180ec7,null))[_0xd351('0x1d')](function(_0x448cd6){if(_0x448cd6){_0x1cbbff=_0x448cd6;switch(_0x9e9ba0[_0xd351('0x3d')]){case'skebby':if(_0x3e1235===_0xd351('0xcb')){return _0x1cbbff[_0xd351('0x5c')]({'read':!![]});}else{logger[_0xd351('0x23')](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0x80'),util[_0xd351('0xc6')](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3e1235==='1'){return _0x1cbbff[_0xd351('0x5c')]({'read':!![]});}else{logger[_0xd351('0x23')](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0x80'),util['inspect'](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd351('0x85'):if(!_0x27ac35[_0xd351('0x5d')]['error_code']&&_0x3e1235>=0xc8&&_0x3e1235<=0xce){return _0x1cbbff['update']({'read':!![]});}else{logger[_0xd351('0x23')](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0x85'),util[_0xd351('0xc6')](_0x27ac35['body'],{'showHidden':![],'depth':null}));}break;case _0xd351('0xca'):var _0x1c1eeb=_0x27ac35[_0xd351('0x5d')][_0xd351('0x8a')][0x0];if(_0x1c1eeb[_0xd351('0x28')][_0xd351('0xcc')]===_0xd351('0xcb')){return _0x1cbbff['update']({'read':!![]});}else{logger['error'](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0xca'),util[_0xd351('0xc6')](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd351('0x8c'):if(_0x3e1235==_0xd351('0xcf')||_0x3e1235==_0xd351('0xd0')){return _0x1cbbff[_0xd351('0x5c')]({'read':!![]});}else{logger[_0xd351('0x23')](_0xd351('0x21'),_0xd351('0x28'),'clickatell',util['inspect'](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd351('0x8e'):if(_0x3e1235=='message-delivered'){return _0x1cbbff[_0xd351('0x5c')]({'read':!![]});}else{logger[_0xd351('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd351('0x28'),_0xd351('0x8e'),util[_0xd351('0xc6')](_0x27ac35['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3e1235===_0xd351('0xd1')||_0x3e1235===_0xd351('0xd2')){return _0x1cbbff['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd351('0x28'),_0xd351('0xcd'),util[_0xd351('0xc6')](_0x27ac35[_0xd351('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x1cbbff;}})[_0xd351('0x1d')](respondWithResult(_0x180ec7,null))[_0xd351('0x26')](handleError(_0x180ec7,null));};exports['statusGet']=function(_0xed5aea,_0x3ab8c1,_0x5e0401){var _0x56d9e1,_0x4706d9,_0x4da67f;return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0xed5aea[_0xd351('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ab8c1,null))[_0xd351('0x1d')](function(_0x5b5469){if(_0x5b5469){_0x4da67f=_0x5b5469;logger[_0xd351('0x20')](_0xd351('0x21'),_0xd351('0x28'),_0xd351('0xc5'),_0x5b5469[_0xd351('0x3d')],util['inspect'](_0xed5aea['query'],{'showHidden':![],'depth':null}));switch(_0x5b5469[_0xd351('0x3d')]){case _0xd351('0x8b'):if(_0xed5aea[_0xd351('0x3f')][_0xd351('0xd3')]&&_0xed5aea[_0xd351('0x3f')][_0xd351('0xd4')]){_0x4706d9=_0xed5aea[_0xd351('0x3f')][_0xd351('0xd4')];return db[_0xd351('0xa2')]['find']({'where':{'messageId':_0xed5aea[_0xd351('0x3f')][_0xd351('0xd3')]}});}break;}}})['then'](handleEntityNotFound(_0x3ab8c1,null))[_0xd351('0x1d')](function(_0x22340a){if(_0x22340a){_0x56d9e1=_0x22340a;switch(_0x4da67f['type']){case _0xd351('0x8b'):if(_0x4706d9==='2'||_0x4706d9==='6'){return _0x56d9e1[_0xd351('0x5c')]({'read':!![]});}else{logger[_0xd351('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd351('0x28'),_0xd351('0x8b'),util[_0xd351('0xc6')](_0xed5aea[_0xd351('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x56d9e1;}})['then'](respondWithResult(_0x3ab8c1,null))[_0xd351('0x26')](handleError(_0x3ab8c1,null));};exports['addAgents']=function(_0x26b0ff,_0x362037,_0x499e62){return db[_0xd351('0x3a')]['find']({'where':{'id':_0x26b0ff[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x362037,null))['then'](function(_0x50f39a){if(_0x50f39a){return _0x50f39a[_0xd351('0xd5')](_0x26b0ff[_0xd351('0x5d')][_0xd351('0x66')],_[_0xd351('0x98')](_0x26b0ff[_0xd351('0x5d')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x9b')](function(_0x5ec45f){for(var _0x289aba=0x0;_0x289aba<_0x26b0ff[_0xd351('0x5d')][_0xd351('0x66')][_0xd351('0x45')];_0x289aba+=0x1){socket[_0xd351('0xd6')](_0xd351('0xd7'),{'UserId':Number(_0x26b0ff[_0xd351('0x5d')][_0xd351('0x66')][_0x289aba]),'SmsAccountId':Number(_0x26b0ff[_0xd351('0x60')]['id'])});}return _0x5ec45f;});}})['then'](respondWithResult(_0x362037,null))[_0xd351('0x26')](handleError(_0x362037,null));};exports['removeAgents']=function(_0x4a9292,_0x11d988,_0x18ecbc){return db[_0xd351('0x3a')][_0xd351('0x53')]({'where':{'id':_0x4a9292[_0xd351('0x60')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x11d988,null))[_0xd351('0x1d')](function(_0x1a58f8){if(_0x1a58f8){return _0x1a58f8[_0xd351('0xd8')](_0x4a9292[_0xd351('0x3f')][_0xd351('0x66')])[_0xd351('0x1d')](function(){if(_[_0xd351('0xd9')](_0x4a9292[_0xd351('0x3f')][_0xd351('0x66')])){for(var _0x3dcb24=0x0;_0x3dcb24<_0x4a9292[_0xd351('0x3f')]['ids'][_0xd351('0x45')];_0x3dcb24+=0x1){socket[_0xd351('0xd6')](_0xd351('0xda'),{'UserId':Number(_0x4a9292[_0xd351('0x3f')][_0xd351('0x66')][_0x3dcb24]),'SmsAccountId':Number(_0x4a9292[_0xd351('0x60')]['id'])});}}else{socket['emit'](_0xd351('0xda'),{'UserId':Number(_0x4a9292[_0xd351('0x3f')][_0xd351('0x66')]),'SmsAccountId':Number(_0x4a9292['params']['id'])});}});}})[_0xd351('0x1d')](respondWithStatusCode(_0x11d988,null))[_0xd351('0x26')](handleError(_0x11d988,null));};exports[_0xd351('0xdb')]=function(_0x4e28e9,_0x24cd8a,_0x1fb961){var _0x588208={};var _0x16d736={};var _0x27888e;var _0x287040;return db['SmsAccount'][_0xd351('0x63')]({'where':{'id':_0x4e28e9[_0xd351('0x60')]['id']}})['then'](handleEntityNotFound(_0x24cd8a,null))[_0xd351('0x1d')](function(_0x3801d3){if(_0x3801d3){_0x27888e=_0x3801d3;_0x16d736['model']=_[_0xd351('0x40')](db[_0xd351('0xa4')][_0xd351('0x3b')]);_0x16d736[_0xd351('0x3f')]=_[_0xd351('0x40')](_0x4e28e9[_0xd351('0x3f')]);_0x16d736[_0xd351('0x41')]=_[_0xd351('0x42')](_0x16d736['model'],_0x16d736[_0xd351('0x3f')]);_0x588208[_0xd351('0x43')]=_['intersection'](_0x16d736['model'],qs[_0xd351('0x44')](_0x4e28e9[_0xd351('0x3f')][_0xd351('0x44')]));_0x588208['attributes']=_0x588208[_0xd351('0x43')][_0xd351('0x45')]?_0x588208['attributes']:_0x16d736[_0xd351('0x3e')];_0x588208['order']=qs['sort'](_0x4e28e9[_0xd351('0x3f')][_0xd351('0x48')]);_0x588208[_0xd351('0x49')]=qs[_0xd351('0x41')](_[_0xd351('0x4a')](_0x4e28e9['query'],_0x16d736[_0xd351('0x41')]));if(_0x4e28e9[_0xd351('0x3f')][_0xd351('0x4b')]){_0x588208[_0xd351('0x49')]=_['merge'](_0x588208[_0xd351('0x49')],{'$or':_[_0xd351('0x39')](_0x588208['attributes'],function(_0x5d95ad){var _0x152785={};_0x152785[_0x5d95ad]={'$like':'%'+_0x4e28e9[_0xd351('0x3f')][_0xd351('0x4b')]+'%'};return _0x152785;})});}_0x588208=_[_0xd351('0x4c')]({},_0x588208,_0x4e28e9[_0xd351('0x4d')]);return _0x27888e['getAgents'](_0x588208);}})['then'](function(_0x4e0168){if(_0x4e0168){_0x287040=_0x4e0168['length'];if(!_0x4e28e9['query'][_0xd351('0x46')](_0xd351('0x47'))){_0x588208[_0xd351('0x2c')]=qs['limit'](_0x4e28e9['query'][_0xd351('0x2c')]);_0x588208[_0xd351('0x2e')]=qs[_0xd351('0x2e')](_0x4e28e9[_0xd351('0x3f')][_0xd351('0x2e')]);}return _0x27888e['getAgents'](_0x588208);}})[_0xd351('0x1d')](function(_0xe020f2){if(_0xe020f2){return _0xe020f2?{'count':_0x287040,'rows':_0xe020f2}:null;}})[_0xd351('0x1d')](respondWithResult(_0x24cd8a,null))[_0xd351('0x26')](handleError(_0x24cd8a,null));}; \ No newline at end of file +var _0x5771=['Start','startRouting','receiveMessage','info','entity\x20found','stringify','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','bandwidth','redif','error_code','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','spread','emit','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','code','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','sms','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','Body','messageId','skebby','sender','connectel','clicksend','message_id','plivo','Text','MessageUUID','text','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','SmsInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','unshift','agent'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x5771,0x128));var _0x1577=function(_0x2c719b,_0xc2d23e){_0x2c719b=_0x2c719b-0x0;var _0x4feda5=_0x5771[_0x2c719b];return _0x4feda5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1577('0x0'));var zipdir=require(_0x1577('0x1'));var jsonpatch=require(_0x1577('0x2'));var rp=require(_0x1577('0x3'));var moment=require(_0x1577('0x4'));var BPromise=require(_0x1577('0x5'));var Mustache=require(_0x1577('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1577('0x7'));var ejs=require(_0x1577('0x8'));var fs=require('fs');var fs_extra=require(_0x1577('0x9'));var _=require(_0x1577('0xa'));var squel=require(_0x1577('0xb'));var crypto=require('crypto');var jsforce=require(_0x1577('0xc'));var deskjs=require(_0x1577('0xd'));var toCsv=require(_0x1577('0x7'));var querystring=require(_0x1577('0xe'));var Papa=require(_0x1577('0xf'));var Redis=require(_0x1577('0x10'));var authService=require(_0x1577('0x11'));var qs=require(_0x1577('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1577('0x13'));var logger=require(_0x1577('0x14'))(_0x1577('0x15'));var utils=require(_0x1577('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1577('0x17'));var db=require('../../mysqldb')['db'];config[_0x1577('0x18')]=_[_0x1577('0x19')](config[_0x1577('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1577('0x1a'))(new Redis(config[_0x1577('0x18')]));require(_0x1577('0x1b'))[_0x1577('0x1c')](socket);var jayson=require(_0x1577('0x1d'));var client=jayson[_0x1577('0x1e')][_0x1577('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2cf2b7,_0x26fd83,_0x2e833f,_0xf2ed5f){return new BPromise(function(_0x4af21d,_0x557691){var _0xe34888=_0xf2ed5f||client;return _0xe34888[_0x1577('0x20')](_0x2cf2b7,_0x2e833f)[_0x1577('0x21')](function(_0x45e6de){logger['info']('SmsAccount,\x20%s,\x20%s',_0x26fd83,_0x1577('0x22'));logger[_0x1577('0x23')](_0x1577('0x24'),_0x26fd83,_0x1577('0x22'),JSON['stringify'](_0x45e6de));if(_0x45e6de['error']){if(_0x45e6de['error'][_0x1577('0x25')]===0x1f4){logger[_0x1577('0x26')](_0x1577('0x27'),_0x26fd83,_0x45e6de['error'][_0x1577('0x28')]);return _0x557691(_0x45e6de['error'][_0x1577('0x28')]);}logger[_0x1577('0x26')](_0x1577('0x27'),_0x26fd83,_0x45e6de[_0x1577('0x26')]['message']);return _0x4af21d(_0x45e6de[_0x1577('0x26')][_0x1577('0x28')]);}else{logger['info'](_0x1577('0x27'),_0x26fd83,_0x1577('0x22'));_0x4af21d(_0x45e6de[_0x1577('0x29')]['message']);}})[_0x1577('0x2a')](function(_0x383db8){logger['error'](_0x1577('0x27'),_0x26fd83,_0x383db8);_0x557691(_0x383db8);});});}function respondWithStatusCode(_0x2ba0ea,_0x47b729){_0x47b729=_0x47b729||0xcc;return function(_0x18fd03){if(_0x18fd03){return _0x2ba0ea[_0x1577('0x2b')](_0x47b729);}return _0x2ba0ea[_0x1577('0x2c')](_0x47b729)[_0x1577('0x2d')]();};}function respondWithResult(_0x2cb5bd,_0x3a2e09){_0x3a2e09=_0x3a2e09||0xc8;return function(_0x3f3f2d){if(_0x3f3f2d){return _0x2cb5bd[_0x1577('0x2c')](_0x3a2e09)[_0x1577('0x2e')](_0x3f3f2d);}};}function respondWithFilteredResult(_0x112088,_0x58b178){return function(_0x24de11){if(_0x24de11){var _0x32295a=typeof _0x58b178[_0x1577('0x2f')]===_0x1577('0x30')&&typeof _0x58b178[_0x1577('0x31')]===_0x1577('0x30');var _0x2b7973=_0x24de11['count'];var _0x5c57bd=_0x32295a?0x0:_0x58b178['offset'];var _0x1c6900=_0x32295a?_0x24de11[_0x1577('0x32')]:_0x58b178[_0x1577('0x2f')]+_0x58b178['limit'];var _0x2f16ad;if(_0x1c6900>=_0x2b7973){_0x1c6900=_0x2b7973;_0x2f16ad=0xc8;}else{_0x2f16ad=0xce;}_0x112088[_0x1577('0x2c')](_0x2f16ad);return _0x112088[_0x1577('0x33')](_0x1577('0x34'),_0x5c57bd+'-'+_0x1c6900+'/'+_0x2b7973)[_0x1577('0x2e')](_0x24de11);}return null;};}function patchUpdates(_0x2e1d98){return function(_0x6a2dd2){try{jsonpatch[_0x1577('0x35')](_0x6a2dd2,_0x2e1d98,!![]);}catch(_0x537c87){return BPromise[_0x1577('0x36')](_0x537c87);}return _0x6a2dd2[_0x1577('0x37')]();};}function saveUpdates(_0x4aa378,_0x433bb7){return function(_0x3bd53b){if(_0x3bd53b){return _0x3bd53b['update'](_0x4aa378)[_0x1577('0x21')](function(_0x25d090){return _0x25d090;});}return null;};}function removeEntity(_0x3a54c8,_0x1e7e3a){return function(_0x385862){if(_0x385862){return _0x385862[_0x1577('0x38')]()[_0x1577('0x21')](function(){var _0x12b4fd=_0x385862[_0x1577('0x39')]({'plain':!![]});var _0x1f8e0c=_0x1577('0x3a');return db['UserProfileResource'][_0x1577('0x38')]({'where':{'type':_0x1f8e0c,'resourceId':_0x12b4fd['id']}})[_0x1577('0x21')](function(){return _0x385862;});})['then'](function(){_0x3a54c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16bcd7,_0x1bd26c){return function(_0x1a60ed){if(!_0x1a60ed){_0x16bcd7['sendStatus'](0x194);}return _0x1a60ed;};}function handleError(_0x5a2ddc,_0x2ed700){_0x2ed700=_0x2ed700||0x1f4;return function(_0x39c730){logger[_0x1577('0x26')](_0x39c730['stack']);if(_0x39c730[_0x1577('0x3b')]){delete _0x39c730[_0x1577('0x3b')];}_0x5a2ddc[_0x1577('0x2c')](_0x2ed700)[_0x1577('0x3c')](_0x39c730);};}exports[_0x1577('0x3d')]=function(_0x392220,_0x257799){var _0x201c32={'include':[{'model':db[_0x1577('0x3e')],'as':_0x1577('0x3f')}]},_0x3dfd8f={},_0x33791b={'count':0x0,'rows':[]};var _0x512eb7=_[_0x1577('0x40')](db[_0x1577('0x41')][_0x1577('0x42')],function(_0x1346a2){return{'name':_0x1346a2[_0x1577('0x43')],'type':_0x1346a2['type'][_0x1577('0x44')]};});_0x3dfd8f['model']=_[_0x1577('0x40')](_0x512eb7,_0x1577('0x3b'));_0x3dfd8f['query']=_[_0x1577('0x45')](_0x392220['query']);_0x3dfd8f[_0x1577('0x46')]=_[_0x1577('0x47')](_0x3dfd8f[_0x1577('0x48')],_0x3dfd8f[_0x1577('0x49')]);_0x201c32[_0x1577('0x4a')]=_[_0x1577('0x47')](_0x3dfd8f[_0x1577('0x48')],qs[_0x1577('0x4b')](_0x392220[_0x1577('0x49')]['fields']));_0x201c32[_0x1577('0x4a')]=_0x201c32[_0x1577('0x4a')][_0x1577('0x4c')]?_0x201c32['attributes']:_0x3dfd8f[_0x1577('0x48')];if(!_0x392220[_0x1577('0x49')][_0x1577('0x4d')](_0x1577('0x4e'))){_0x201c32[_0x1577('0x31')]=qs[_0x1577('0x31')](_0x392220['query']['limit']);_0x201c32['offset']=qs[_0x1577('0x2f')](_0x392220[_0x1577('0x49')]['offset']);}_0x201c32[_0x1577('0x4f')]=qs[_0x1577('0x50')](_0x392220[_0x1577('0x49')]['sort']);_0x201c32[_0x1577('0x51')]=qs['filters'](_[_0x1577('0x52')](_0x392220[_0x1577('0x49')],_0x3dfd8f[_0x1577('0x46')]),_0x512eb7);if(_0x392220[_0x1577('0x49')][_0x1577('0x53')]){_0x201c32[_0x1577('0x51')]=_[_0x1577('0x54')](_0x201c32[_0x1577('0x51')],{'$or':_[_0x1577('0x40')](_0x512eb7,function(_0x19e49b){if(_0x19e49b[_0x1577('0x55')]!==_0x1577('0x56')){var _0x4a638a={};_0x4a638a[_0x19e49b[_0x1577('0x3b')]]={'$like':'%'+_0x392220[_0x1577('0x49')][_0x1577('0x53')]+'%'};return _0x4a638a;}})});}_0x201c32=_['merge']({},_0x201c32,_0x392220[_0x1577('0x57')]);var _0x419b5e={'where':_0x201c32[_0x1577('0x51')]};return db[_0x1577('0x41')][_0x1577('0x32')](_0x419b5e)[_0x1577('0x21')](function(_0x4e0655){_0x33791b[_0x1577('0x32')]=_0x4e0655;if(_0x392220[_0x1577('0x49')][_0x1577('0x58')]){_0x201c32[_0x1577('0x59')]=[{'all':!![]}];}return db[_0x1577('0x41')]['findAll'](_0x201c32);})['then'](function(_0x2303e8){_0x33791b[_0x1577('0x5a')]=_0x2303e8;return _0x33791b;})[_0x1577('0x21')](respondWithFilteredResult(_0x257799,_0x201c32))[_0x1577('0x2a')](handleError(_0x257799,null));};exports[_0x1577('0x5b')]=function(_0x193593,_0x38c470){var _0x124438={'raw':![],'where':{'id':_0x193593[_0x1577('0x5c')]['id']},'include':[{'model':db[_0x1577('0x3e')],'as':_0x1577('0x3f')}]},_0x50fd84={};_0x50fd84['model']=_['keys'](db[_0x1577('0x41')][_0x1577('0x42')]);_0x50fd84[_0x1577('0x49')]=_[_0x1577('0x45')](_0x193593[_0x1577('0x49')]);_0x50fd84[_0x1577('0x46')]=_[_0x1577('0x47')](_0x50fd84[_0x1577('0x48')],_0x50fd84[_0x1577('0x49')]);_0x124438[_0x1577('0x4a')]=_[_0x1577('0x47')](_0x50fd84[_0x1577('0x48')],qs['fields'](_0x193593[_0x1577('0x49')][_0x1577('0x4b')]));_0x124438[_0x1577('0x4a')]=_0x124438[_0x1577('0x4a')][_0x1577('0x4c')]?_0x124438[_0x1577('0x4a')]:_0x50fd84['model'];if(_0x193593[_0x1577('0x49')][_0x1577('0x58')]){_0x124438[_0x1577('0x59')]=[{'all':!![]}];}_0x124438=_[_0x1577('0x54')]({},_0x124438,_0x193593[_0x1577('0x57')]);return db[_0x1577('0x41')][_0x1577('0x5d')](_0x124438)[_0x1577('0x21')](handleEntityNotFound(_0x38c470,null))[_0x1577('0x21')](respondWithResult(_0x38c470,null))[_0x1577('0x2a')](handleError(_0x38c470,null));};exports[_0x1577('0x5e')]=function(_0x16a545,_0x135b12){return db[_0x1577('0x41')][_0x1577('0x5e')](_0x16a545['body'],{})[_0x1577('0x21')](function(_0x519da1){var _0x465586=_0x16a545[_0x1577('0x5f')][_0x1577('0x39')]({'plain':!![]});if(!_0x465586)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x465586[_0x1577('0x60')]===_0x1577('0x5f')){var _0xf3f3b6=_0x519da1['get']({'plain':!![]});var _0x4f8d22='SmsAccounts';return db['UserProfileSection'][_0x1577('0x5d')]({'where':{'name':_0x4f8d22,'userProfileId':_0x465586[_0x1577('0x61')]},'raw':!![]})[_0x1577('0x21')](function(_0x4c0afc){if(_0x4c0afc&&_0x4c0afc[_0x1577('0x62')]===0x0){return db[_0x1577('0x63')][_0x1577('0x5e')]({'name':_0xf3f3b6[_0x1577('0x3b')],'resourceId':_0xf3f3b6['id'],'type':_0x4c0afc['name'],'sectionId':_0x4c0afc['id']},{})['then'](function(){return _0x519da1;});}else{return _0x519da1;}})[_0x1577('0x2a')](function(_0x25f5f1){logger[_0x1577('0x26')](_0x1577('0x64'),_0x25f5f1);throw _0x25f5f1;});}return _0x519da1;})['then'](respondWithResult(_0x135b12,0xc9))[_0x1577('0x2a')](handleError(_0x135b12,null));};exports[_0x1577('0x65')]=function(_0x182e00,_0x379b4e){if(_0x182e00[_0x1577('0x66')]['id']){delete _0x182e00[_0x1577('0x66')]['id'];}return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x182e00[_0x1577('0x5c')]['id']},'include':[{'model':db[_0x1577('0x3e')],'as':_0x1577('0x3f')}]})[_0x1577('0x21')](handleEntityNotFound(_0x379b4e,null))['then'](saveUpdates(_0x182e00[_0x1577('0x66')],null))[_0x1577('0x21')](respondWithResult(_0x379b4e,null))[_0x1577('0x2a')](handleError(_0x379b4e,null));};exports[_0x1577('0x38')]=function(_0x5e0f18,_0x333c35){return db['SmsAccount']['find']({'where':{'id':_0x5e0f18[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x333c35,null))['then'](removeEntity(_0x333c35,null))[_0x1577('0x2a')](handleError(_0x333c35,null));};exports['describe']=function(_0x2089cd,_0x365d3a){return db['SmsAccount'][_0x1577('0x67')]()[_0x1577('0x21')](respondWithResult(_0x365d3a,null))[_0x1577('0x2a')](handleError(_0x365d3a,null));};exports[_0x1577('0x68')]=function(_0x4de91c,_0x59a8e7,_0x1e0fef){if(_0x4de91c['body']['id']){delete _0x4de91c['body']['id'];}return db[_0x1577('0x41')]['find']({'where':{'id':_0x4de91c[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x59a8e7,null))['then'](function(_0xbddcd8){if(_0xbddcd8){_0x4de91c[_0x1577('0x66')][_0x1577('0x69')]=_0xbddcd8['id'];return db[_0x1577('0x6a')][_0x1577('0x5e')](_0x4de91c[_0x1577('0x66')]);}})[_0x1577('0x21')](respondWithResult(_0x59a8e7,null))['catch'](handleError(_0x59a8e7,null));};exports[_0x1577('0x6b')]=function(_0x47c74d,_0x280b7b,_0x55bfe1){var _0x32622b={'raw':![],'where':{}};var _0x513c48={};var _0x2d317e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1577('0x6c')]({'where':{'id':_0x47c74d[_0x1577('0x5c')]['id']}})['then'](handleEntityNotFound(_0x280b7b,null))['then'](function(_0x407f13){if(_0x407f13){_0x513c48['model']=_[_0x1577('0x45')](db[_0x1577('0x6a')][_0x1577('0x42')]);_0x513c48[_0x1577('0x49')]=_[_0x1577('0x45')](_0x47c74d[_0x1577('0x49')]);_0x513c48[_0x1577('0x46')]=_[_0x1577('0x47')](_0x513c48[_0x1577('0x48')],_0x513c48[_0x1577('0x49')]);_0x32622b['attributes']=_['intersection'](_0x513c48[_0x1577('0x48')],qs['fields'](_0x47c74d[_0x1577('0x49')][_0x1577('0x4b')]));_0x32622b['attributes']=_0x32622b[_0x1577('0x4a')]['length']?_0x32622b[_0x1577('0x4a')]:_0x513c48[_0x1577('0x48')];if(!_0x47c74d[_0x1577('0x49')]['hasOwnProperty'](_0x1577('0x4e'))){_0x32622b['limit']=qs[_0x1577('0x31')](_0x47c74d['query'][_0x1577('0x31')]);_0x32622b[_0x1577('0x2f')]=qs[_0x1577('0x2f')](_0x47c74d[_0x1577('0x49')][_0x1577('0x2f')]);}_0x32622b['order']=qs[_0x1577('0x50')](_0x47c74d[_0x1577('0x49')][_0x1577('0x50')]);_0x32622b[_0x1577('0x51')]=qs[_0x1577('0x46')](_[_0x1577('0x52')](_0x47c74d[_0x1577('0x49')],_0x513c48['filters']));_0x32622b[_0x1577('0x51')][_0x1577('0x69')]=_0x407f13['id'];if(_0x47c74d[_0x1577('0x49')][_0x1577('0x53')]){_0x32622b[_0x1577('0x51')]=_[_0x1577('0x54')](_0x32622b['where'],{'$or':_[_0x1577('0x40')](_0x32622b['attributes'],function(_0x5191f7){var _0x496670={};_0x496670[_0x5191f7]={'$like':'%'+_0x47c74d[_0x1577('0x49')][_0x1577('0x53')]+'%'};return _0x496670;})});}_0x32622b=_[_0x1577('0x54')]({},_0x32622b,_0x47c74d['options']);return db[_0x1577('0x6a')][_0x1577('0x32')]({'where':_0x32622b[_0x1577('0x51')]})[_0x1577('0x21')](function(_0x5857c1){_0x2d317e[_0x1577('0x32')]=_0x5857c1;if(_0x47c74d['query'][_0x1577('0x58')]){_0x32622b[_0x1577('0x59')]=[{'all':!![]}];}return db[_0x1577('0x6a')][_0x1577('0x6d')](_0x32622b);})[_0x1577('0x21')](function(_0x1d0a0d){_0x2d317e[_0x1577('0x5a')]=_0x1d0a0d;return _0x2d317e;});}})['then'](respondWithFilteredResult(_0x280b7b,_0x32622b))[_0x1577('0x2a')](handleError(_0x280b7b,null));};exports[_0x1577('0x6e')]=function(_0x92c260,_0x5bb3ca,_0x2a53a0){return db['SmsAccount'][_0x1577('0x5d')]({'where':{'id':_0x92c260[_0x1577('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5bb3ca,null))[_0x1577('0x21')](function(_0x3a6eb9){if(_0x3a6eb9){return _0x3a6eb9[_0x1577('0x6e')](_0x92c260[_0x1577('0x49')]['ids']);}})[_0x1577('0x21')](respondWithStatusCode(_0x5bb3ca,null))['catch'](handleError(_0x5bb3ca,null));};exports['addAnswer']=function(_0x501650,_0x1d857c,_0x38b410){if(_0x501650[_0x1577('0x66')]['id']){delete _0x501650[_0x1577('0x66')]['id'];}return db['SmsAccount'][_0x1577('0x5d')]({'where':{'id':_0x501650[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x1d857c,null))['then'](function(_0x263ad4){if(_0x263ad4){_0x501650[_0x1577('0x66')][_0x1577('0x69')]=_0x263ad4['id'];return db[_0x1577('0x6f')][_0x1577('0x5e')](_0x501650['body']);}})[_0x1577('0x21')](respondWithResult(_0x1d857c,null))[_0x1577('0x2a')](handleError(_0x1d857c,null));};exports[_0x1577('0x70')]=function(_0xf74c7f,_0x119f03,_0x11262e){var _0x5b8126={'raw':![],'where':{}};var _0x2cc64e={};var _0x4ffc5b={'count':0x0,'rows':[]};return db[_0x1577('0x41')][_0x1577('0x6c')]({'where':{'id':_0xf74c7f[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x119f03,null))[_0x1577('0x21')](function(_0x29a46a){if(_0x29a46a){_0x2cc64e['model']=_[_0x1577('0x45')](db[_0x1577('0x6f')][_0x1577('0x42')]);_0x2cc64e[_0x1577('0x49')]=_[_0x1577('0x45')](_0xf74c7f[_0x1577('0x49')]);_0x2cc64e[_0x1577('0x46')]=_[_0x1577('0x47')](_0x2cc64e[_0x1577('0x48')],_0x2cc64e[_0x1577('0x49')]);_0x5b8126[_0x1577('0x4a')]=_['intersection'](_0x2cc64e['model'],qs['fields'](_0xf74c7f[_0x1577('0x49')][_0x1577('0x4b')]));_0x5b8126[_0x1577('0x4a')]=_0x5b8126[_0x1577('0x4a')]['length']?_0x5b8126['attributes']:_0x2cc64e[_0x1577('0x48')];if(!_0xf74c7f[_0x1577('0x49')]['hasOwnProperty']('nolimit')){_0x5b8126[_0x1577('0x31')]=qs[_0x1577('0x31')](_0xf74c7f[_0x1577('0x49')][_0x1577('0x31')]);_0x5b8126['offset']=qs['offset'](_0xf74c7f['query'][_0x1577('0x2f')]);}_0x5b8126['order']=qs[_0x1577('0x50')](_0xf74c7f['query'][_0x1577('0x50')]);_0x5b8126[_0x1577('0x51')]=qs[_0x1577('0x46')](_[_0x1577('0x52')](_0xf74c7f[_0x1577('0x49')],_0x2cc64e['filters']));_0x5b8126[_0x1577('0x51')][_0x1577('0x69')]=_0x29a46a['id'];if(_0xf74c7f[_0x1577('0x49')]['filter']){_0x5b8126[_0x1577('0x51')]=_['merge'](_0x5b8126['where'],{'$or':_[_0x1577('0x40')](_0x5b8126[_0x1577('0x4a')],function(_0x494c88){var _0x2d956e={};_0x2d956e[_0x494c88]={'$like':'%'+_0xf74c7f['query'][_0x1577('0x53')]+'%'};return _0x2d956e;})});}_0x5b8126=_[_0x1577('0x54')]({},_0x5b8126,_0xf74c7f[_0x1577('0x57')]);return db['CannedAnswer'][_0x1577('0x32')]({'where':_0x5b8126[_0x1577('0x51')]})['then'](function(_0x101cf5){_0x4ffc5b[_0x1577('0x32')]=_0x101cf5;if(_0xf74c7f[_0x1577('0x49')][_0x1577('0x58')]){_0x5b8126['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1577('0x6d')](_0x5b8126);})[_0x1577('0x21')](function(_0x287d88){_0x4ffc5b[_0x1577('0x5a')]=_0x287d88;return _0x4ffc5b;});}})[_0x1577('0x21')](respondWithFilteredResult(_0x119f03,_0x5b8126))[_0x1577('0x2a')](handleError(_0x119f03,null));};exports[_0x1577('0x71')]=function(_0x5c4724,_0x1f537f,_0x5a25cb){return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x5c4724['params']['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x1f537f,null))[_0x1577('0x21')](function(_0x23ca28){if(_0x23ca28){return _0x23ca28['removeAnswers'](_0x5c4724['query'][_0x1577('0x72')]);}})['then'](respondWithStatusCode(_0x1f537f,null))[_0x1577('0x2a')](handleError(_0x1f537f,null));};exports['notify']=function(_0x48cc59,_0xa4555b,_0x2f1c4f){var _0x1226c1={'channel':_0x1577('0x73')};var _0x457469=[];var _0xb36a03=[];var _0x86fa71={};return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x48cc59[_0x1577('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x1577('0x74')}]})[_0x1577('0x21')](handleEntityNotFound(_0xa4555b,null))['then'](function(_0x363c38){_0x1226c1[_0x1577('0x75')]=_0x363c38;_0x1226c1['applications']=_[_0x1577('0x76')](_0x363c38[_0x1577('0x74')],[_0x1577('0x77')],[_0x1577('0x78')]);if(_0x1226c1['account'][_0x1577('0x74')]){delete _0x1226c1[_0x1577('0x75')][_0x1577('0x74')];}return db[_0x1577('0x79')][_0x1577('0x67')]();})[_0x1577('0x21')](function(_0x5e3ca1){if(!_0x5e3ca1){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x7c'));}_0x457469=_[_0x1577('0x7d')](_[_0x1577('0x45')](_0x5e3ca1),['createdAt',_0x1577('0x7e')]);_0xb36a03=_[_0x1577('0x7d')](_[_0x1577('0x45')](_0x5e3ca1),[_0x1577('0x7f'),_0x1577('0x7e'),_0x1577('0x80'),_0x1577('0x81')]);_0x1226c1[_0x1577('0x66')]={'mapKey':_0x1577('0x82')};if(_0x1226c1[_0x1577('0x75')][_0x1577('0x55')]){switch(_0x1226c1[_0x1577('0x75')]['type']){case'twilio':_0x1226c1['body'][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x84')];_0x1226c1[_0x1577('0x66')]['body']=_0x48cc59[_0x1577('0x66')][_0x1577('0x85')];_0x1226c1[_0x1577('0x66')][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')]['MessageSid'];break;case _0x1577('0x87'):_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]='+'+_0x48cc59[_0x1577('0x66')][_0x1577('0x88')];_0x1226c1[_0x1577('0x66')]['body']=_0x48cc59['body']['text'];break;case _0x1577('0x89'):_0x1226c1[_0x1577('0x66')]['from']=_0x48cc59[_0x1577('0x66')]['from'];_0x1226c1[_0x1577('0x66')][_0x1577('0x66')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x28')];break;case _0x1577('0x8a'):_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x83')];_0x1226c1['body'][_0x1577('0x66')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x66')];_0x1226c1['body'][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x8b')];break;case _0x1577('0x8c'):_0x1226c1['body'][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x84')];_0x1226c1[_0x1577('0x66')][_0x1577('0x66')]=_0x48cc59['body'][_0x1577('0x8d')];_0x1226c1['body'][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x8e')];break;case'infobip':_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]='+'+_0x48cc59['body']['results'][0x0][_0x1577('0x83')];_0x1226c1[_0x1577('0x66')][_0x1577('0x66')]=_0x48cc59[_0x1577('0x66')]['results'][0x0][_0x1577('0x8f')];_0x1226c1[_0x1577('0x66')][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x90')][0x0][_0x1577('0x86')];break;case _0x1577('0x91'):_0x1226c1[_0x1577('0x66')]['from']=_0x48cc59[_0x1577('0x66')][_0x1577('0x92')];_0x1226c1['body'][_0x1577('0x66')]=_0x48cc59['body'][_0x1577('0x93')]['message'];break;case _0x1577('0x94'):_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x95')];_0x1226c1['body'][_0x1577('0x66')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x8f')];_0x1226c1['body'][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x96')];break;case'bandwidth':_0x1226c1[_0x1577('0x66')][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][0x0][_0x1577('0x28')]['id'];_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')][0x0]['message'][_0x1577('0x83')];_0x1226c1[_0x1577('0x66')][_0x1577('0x66')]=_0x48cc59['body'][0x0]['message'][_0x1577('0x8f')];break;case _0x1577('0x97'):_0x1226c1[_0x1577('0x66')][_0x1577('0x83')]=_0x48cc59[_0x1577('0x66')]['from'];_0x1226c1[_0x1577('0x66')][_0x1577('0x66')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x28')];_0x1226c1['body'][_0x1577('0x86')]=_0x48cc59[_0x1577('0x66')][_0x1577('0x98')];break;}}if(_0x1226c1[_0x1577('0x66')]['id']){delete _0x1226c1['body']['id'];}if(_[_0x1577('0x99')](_0x1226c1['body']['from'])){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x9a'));}if(_[_0x1577('0x99')](_0x1226c1[_0x1577('0x66')][_0x1577('0x66')])||_0x1226c1[_0x1577('0x66')]['body']===''){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x9b'));}if(_[_0x1577('0x99')](_0x1226c1[_0x1577('0x66')]['mapKey'])){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x9c')+_0xb36a03);}if(!_[_0x1577('0x9d')](_0xb36a03,_0x1226c1[_0x1577('0x66')][_0x1577('0x9e')])){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x9f')+_0xb36a03);}_0x86fa71[_0x1226c1['body'][_0x1577('0x9e')]]=_0x1226c1[_0x1577('0x66')][_0x1577('0x83')];return db[_0x1577('0xa0')][_0x1577('0x5d')]({'where':{'id':_0x1226c1[_0x1577('0x75')]['ListId']},'include':[{'model':db[_0x1577('0x79')],'as':_0x1577('0xa1'),'where':_0x86fa71,'limit':0x1,'order':[[_0x1577('0x7e'),'DESC']]}]});})[_0x1577('0x21')](handleEntityNotFound(_0xa4555b,null))[_0x1577('0x21')](function(_0x3d30aa){if(_0x3d30aa){_0x1226c1['list']=_[_0x1577('0xa2')](_0x3d30aa,[_0x1577('0xa1')]);if(_0x3d30aa[_0x1577('0xa1')]['length']){return _0x3d30aa['Contacts'][0x0];}var _0x2726c1=_[_0x1577('0x19')](_0x1226c1[_0x1577('0x66')],{'firstName':_0x1226c1[_0x1577('0x66')][_0x1577('0x83')],'ListId':_0x3d30aa['id']});_0x2726c1[_0x1226c1[_0x1577('0x66')][_0x1577('0x9e')]]=_0x1226c1['body']['from'];return db['CmContact'][_0x1577('0x5e')](_0x2726c1,{'fields':_0x457469,'raw':!![]});}})[_0x1577('0x21')](handleEntityNotFound(_0xa4555b,null))['then'](function(_0x421962){if(_0x421962){_0x1226c1['contact']=_0x421962;var _0x5d58af={'ContactId':_0x421962['id'],'phone':_0x1226c1[_0x1577('0x66')][_0x1577('0x83')],'SmsAccountId':_0x48cc59['params']['id']};var _0xa3086b={'ContactId':_0x421962['id'],'SmsAccountId':_0x48cc59[_0x1577('0x5c')]['id'],'closed':![]};return db[_0x1577('0xa3')][_0x1577('0x5d')]({'where':_0xa3086b})[_0x1577('0x21')](function(_0x7d63df){if(_0x7d63df){return[_0x7d63df,![]];}return db[_0x1577('0xa3')][_0x1577('0x5e')](_0x5d58af)[_0x1577('0x21')](function(_0x3f38f7){return[_0x3f38f7,!![]];});});}})['spread'](function(_0x31110c,_0x48cdc3){_0x1226c1['interaction']=_0x31110c[_0x1577('0x39')]({'plain':!![]});_0x1226c1[_0x1577('0xa4')][_0x1577('0xa5')]=![];if(_0x48cdc3){if(_0x1226c1[_0x1577('0x75')]['autoclose']){_0x1226c1[_0x1577('0xa6')]['push']({'id':0x0,'priority':_0x1226c1['applications']['length']+0x1,'app':_0x1577('0xa7'),'appdata':_0x1577('0xa8'),'interval':_0x1577('0xa9')});}_0x1226c1[_0x1577('0xa4')][_0x1577('0xa5')]=!![];}return db[_0x1577('0xaa')][_0x1577('0x5e')]({'phone':_0x1226c1[_0x1577('0x66')][_0x1577('0x83')],'messageId':_0x1226c1[_0x1577('0x66')]['messageId'],'body':_0x1226c1[_0x1577('0x66')][_0x1577('0x66')],'SmsAccountId':_0x48cc59[_0x1577('0x5c')]['id'],'SmsInteractionId':_0x31110c['id'],'direction':'in','ContactId':_0x31110c[_0x1577('0xab')],'AttachmentId':_0x1226c1[_0x1577('0x66')][_0x1577('0xac')]});})[_0x1577('0x21')](function(_0x37d7b0){_0x1226c1[_0x1577('0x28')]=_0x37d7b0;if(_0x1226c1[_0x1577('0xa4')]['UserId']){return db[_0x1577('0xad')][_0x1577('0x5d')]({'attributes':['id',_0x1577('0x3b')],'where':{'id':_0x1226c1['interaction']['UserId']}})[_0x1577('0x21')](function(_0x10fcb2){if(_0x10fcb2){_0x1226c1['applications'][_0x1577('0xae')]({'id':0x0,'priority':0x0,'app':_0x1577('0xaf'),'appdata':_0x10fcb2['name']+','+(_0x1226c1[_0x1577('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x1577('0xa9')});}return respondWithRpcPromise(_0x1577('0xb0'),'startRouting',_0x1226c1);});}return respondWithRpcPromise('Start',_0x1577('0xb1'),_0x1226c1);})['then'](function(_0x13975b){if(_0x13975b){var _0x24310f=0xc8;var _0x56049b=_0x1577('0xb2');logger[_0x1577('0xb3')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x56049b,_0x24310f,_0x1577('0xb4'));logger[_0x1577('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x56049b,_0x24310f,_0x1577('0xb4'),JSON[_0x1577('0xb5')](_0x13975b));if(_0x1226c1[_0x1577('0x75')][_0x1577('0x55')]===_0x1577('0xb6')){return _0xa4555b[_0x1577('0x2c')](_0x24310f)['set'](_0x1577('0xb7'),_0x1577('0xb8'))['send'](_0x1577('0xb9'));}else{return _0xa4555b[_0x1577('0x2c')](_0x24310f)['json'](_0x13975b);}}})[_0x1577('0x2a')](handleError(_0xa4555b,null));};exports[_0x1577('0xba')]=function(_0x4a7c60,_0x5297d8){var _0x356841=_0x4a7c60[_0x1577('0x5c')]['id'];var _0x5d88aa=_0x4a7c60[_0x1577('0x66')];var _0x57cf3c=0xc8;var _0x2fe454=null;return db[_0x1577('0xbb')][_0x1577('0xbc')]({'isolationLevel':db[_0x1577('0xbb')][_0x1577('0xbd')][_0x1577('0xbe')][_0x1577('0xbf')]},function(_0x59ce47){return db['SmsAccount'][_0x1577('0x6c')]({'where':{'id':_0x356841},'transaction':_0x59ce47})['then'](function(_0x413895){if(_0x413895){return db[_0x1577('0xc0')][_0x1577('0x38')]({'where':{'SmsAccountId':_0x356841},'transaction':_0x59ce47})[_0x1577('0x21')](function(){var _0x387a7d=_['map'](_0x5d88aa,function(_0x37ead8){_0x37ead8[_0x1577('0x69')]=_0x356841;return _0x37ead8;});return db[_0x1577('0xc0')][_0x1577('0xc1')](_0x387a7d,{'transaction':_0x59ce47});});}else{_0x57cf3c=0x194;_0x2fe454=[];}});})[_0x1577('0x21')](function(){if(_0x57cf3c!==0x194){return db[_0x1577('0xc0')][_0x1577('0xc2')]({'where':{'SmsAccountId':_0x356841},'order':_0x1577('0x77')})[_0x1577('0x21')](function(_0x2c6f4a){_0x2fe454=_0x2c6f4a;});}})['catch'](function(_0x14d4f6){_0x57cf3c=0x1f4;logger[_0x1577('0x26')](_0x14d4f6[_0x1577('0xc3')]);if(_0x14d4f6[_0x1577('0x3b')]){delete _0x14d4f6['name'];}_0x2fe454=_0x14d4f6;})[_0x1577('0xc4')](function(){if(_0x2fe454===null){_0x5297d8[_0x1577('0x2b')](_0x57cf3c);}else{if(_0x57cf3c===0x1f4){_0x5297d8[_0x1577('0x2c')](_0x57cf3c)[_0x1577('0x3c')](_0x2fe454);}else{_0x5297d8[_0x1577('0x2c')](_0x57cf3c)[_0x1577('0x2e')](_0x2fe454);}}});};exports[_0x1577('0xc5')]=function(_0x51ab6f,_0x320654,_0xac1a00){var _0x945fc6={};var _0x5103ae={};var _0x253108;var _0x3013ed;return db[_0x1577('0x41')][_0x1577('0x6c')]({'where':{'id':_0x51ab6f[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x320654,null))[_0x1577('0x21')](function(_0x373a25){if(_0x373a25){_0x253108=_0x373a25;_0x5103ae[_0x1577('0x48')]=_[_0x1577('0x45')](db['SmsApplication']['rawAttributes']);_0x5103ae['query']=_[_0x1577('0x45')](_0x51ab6f[_0x1577('0x49')]);_0x5103ae['filters']=_[_0x1577('0x47')](_0x5103ae['model'],_0x5103ae[_0x1577('0x49')]);_0x945fc6[_0x1577('0x4a')]=_['intersection'](_0x5103ae[_0x1577('0x48')],qs[_0x1577('0x4b')](_0x51ab6f[_0x1577('0x49')]['fields']));_0x945fc6[_0x1577('0x4a')]=_0x945fc6[_0x1577('0x4a')][_0x1577('0x4c')]?_0x945fc6[_0x1577('0x4a')]:_0x5103ae['model'];_0x945fc6[_0x1577('0x4f')]=qs[_0x1577('0x50')](_0x51ab6f[_0x1577('0x49')][_0x1577('0x50')]);_0x945fc6[_0x1577('0x51')]=qs['filters'](_[_0x1577('0x52')](_0x51ab6f['query'],_0x5103ae[_0x1577('0x46')]));if(_0x51ab6f['query']['filter']){_0x945fc6['where']=_[_0x1577('0x54')](_0x945fc6[_0x1577('0x51')],{'$or':_[_0x1577('0x40')](_0x945fc6['attributes'],function(_0x340134){var _0x521494={};_0x521494[_0x340134]={'$like':'%'+_0x51ab6f[_0x1577('0x49')]['filter']+'%'};return _0x521494;})});}_0x945fc6=_['merge']({},_0x945fc6,_0x51ab6f['options']);return _0x253108[_0x1577('0xc5')](_0x945fc6);}})[_0x1577('0x21')](function(_0x3fd19e){if(_0x3fd19e){_0x3013ed=_0x3fd19e[_0x1577('0x4c')];if(!_0x51ab6f[_0x1577('0x49')][_0x1577('0x4d')](_0x1577('0x4e'))){_0x945fc6[_0x1577('0x31')]=qs[_0x1577('0x31')](_0x51ab6f[_0x1577('0x49')][_0x1577('0x31')]);_0x945fc6[_0x1577('0x2f')]=qs['offset'](_0x51ab6f[_0x1577('0x49')][_0x1577('0x2f')]);}return _0x253108['getApplications'](_0x945fc6);}})['then'](function(_0x5e499e){if(_0x5e499e){return _0x5e499e?{'count':_0x3013ed,'rows':_0x5e499e}:null;}})[_0x1577('0x21')](respondWithResult(_0x320654,null))['catch'](handleError(_0x320654,null));};exports[_0x1577('0xc6')]=function(_0x1d2c83,_0x3b000b,_0x5721e5){var _0x170d50={'raw':![],'where':{}};var _0x5cfa45={};var _0x50a128={'count':0x0,'rows':[]};return db[_0x1577('0x41')]['findOne']({'where':{'id':_0x1d2c83[_0x1577('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3b000b,null))[_0x1577('0x21')](function(_0x4cba55){if(_0x4cba55){_0x5cfa45['model']=_[_0x1577('0x45')](db[_0x1577('0xa3')][_0x1577('0x42')]);_0x5cfa45[_0x1577('0x49')]=_[_0x1577('0x45')](_0x1d2c83[_0x1577('0x49')]);_0x5cfa45['filters']=_[_0x1577('0x47')](_0x5cfa45[_0x1577('0x48')],_0x5cfa45[_0x1577('0x49')]);_0x170d50['attributes']=_[_0x1577('0x47')](_0x5cfa45[_0x1577('0x48')],qs['fields'](_0x1d2c83[_0x1577('0x49')][_0x1577('0x4b')]));_0x170d50['attributes']=_0x170d50[_0x1577('0x4a')][_0x1577('0x4c')]?_0x170d50[_0x1577('0x4a')]:_0x5cfa45[_0x1577('0x48')];if(!_0x1d2c83[_0x1577('0x49')][_0x1577('0x4d')]('nolimit')){_0x170d50['limit']=qs['limit'](_0x1d2c83[_0x1577('0x49')][_0x1577('0x31')]);_0x170d50['offset']=qs[_0x1577('0x2f')](_0x1d2c83[_0x1577('0x49')][_0x1577('0x2f')]);}_0x170d50[_0x1577('0x4f')]=qs[_0x1577('0x50')](_0x1d2c83[_0x1577('0x49')][_0x1577('0x50')]);_0x170d50['where']=qs[_0x1577('0x46')](_[_0x1577('0x52')](_0x1d2c83[_0x1577('0x49')],_0x5cfa45[_0x1577('0x46')]));_0x170d50['where'][_0x1577('0x69')]=_0x4cba55['id'];if(_0x1d2c83[_0x1577('0x49')]['filter']){_0x170d50[_0x1577('0x51')]=_[_0x1577('0x54')](_0x170d50[_0x1577('0x51')],{'$or':_[_0x1577('0x40')](_0x170d50[_0x1577('0x4a')],function(_0x5c4e86){var _0x4cdace={};_0x4cdace[_0x5c4e86]={'$like':'%'+_0x1d2c83['query'][_0x1577('0x53')]+'%'};return _0x4cdace;})});}_0x170d50=_[_0x1577('0x54')]({},_0x170d50,_0x1d2c83[_0x1577('0x57')]);return db[_0x1577('0xa3')][_0x1577('0x32')]({'where':_0x170d50[_0x1577('0x51')]})['then'](function(_0x24f644){_0x50a128[_0x1577('0x32')]=_0x24f644;if(_0x1d2c83[_0x1577('0x49')][_0x1577('0x58')]){_0x170d50[_0x1577('0x59')]=[{'model':db['CmContact'],'as':_0x1577('0xc7'),'required':![]},{'model':db[_0x1577('0xad')],'as':_0x1577('0xc8'),'attributes':[_0x1577('0x3b'),_0x1577('0xc9'),_0x1577('0xca')],'required':![]},{'model':db[_0x1577('0xcb')],'as':_0x1577('0xcc'),'attributes':['id',_0x1577('0x3b'),_0x1577('0xcd')],'where':_0x1d2c83[_0x1577('0x49')]['tag']?{'id':_0x1d2c83[_0x1577('0x49')][_0x1577('0xce')]}:undefined,'required':_0x1d2c83[_0x1577('0x49')][_0x1577('0xce')]?!![]:![]}];}return db['SmsInteraction'][_0x1577('0x6d')](_0x170d50);})['then'](function(_0x5a89f6){_0x50a128[_0x1577('0x5a')]=_0x5a89f6;return _0x50a128;});}})['then'](respondWithFilteredResult(_0x3b000b,_0x170d50))[_0x1577('0x2a')](handleError(_0x3b000b,null));};exports[_0x1577('0x3c')]=function(_0x5ecbea,_0x69c0eb,_0x2d8ddb){var _0x5b42a8,_0x188d47,_0x4519e9;if(_['isNil'](_0x5ecbea[_0x1577('0x66')][_0x1577('0x66')])||_0x5ecbea['body']['body']===''){throw new db[(_0x1577('0x7a'))][(_0x1577('0x7b'))](_0x1577('0x9b'));}if(_[_0x1577('0x99')](_0x5ecbea[_0x1577('0x66')]['to'])){throw new db[(_0x1577('0x7a'))]['ValidationError'](_0x1577('0xcf'));}_0x5b42a8=_0x5ecbea[_0x1577('0x66')]['to'];return db['SmsAccount'][_0x1577('0x5d')]({'where':{'id':_0x5ecbea[_0x1577('0x5c')]['id']},'include':[{'model':db[_0x1577('0xa0')],'as':_0x1577('0xd0'),'include':[{'model':db[_0x1577('0x79')],'as':'Contacts','where':{'mobile':_0x5b42a8},'limit':0x1,'order':[[_0x1577('0x7e'),'DESC']]}]}]})[_0x1577('0x21')](handleEntityNotFound(_0x69c0eb,null))[_0x1577('0x21')](function(_0x2552d6){if(_0x2552d6&&_0x2552d6[_0x1577('0xd0')]){_0x188d47=_0x2552d6[_0x1577('0x39')]({'plain':!![]});if(_0x188d47[_0x1577('0xd0')]&&_0x188d47[_0x1577('0xd0')][_0x1577('0xa1')][_0x1577('0x4c')]){return _0x188d47['List'][_0x1577('0xa1')][0x0];}return db['CmContact'][_0x1577('0x5e')](_['defaults'](_0x5ecbea[_0x1577('0x66')],{'firstName':_0x5b42a8,'mobile':_0x5b42a8,'phone':_0x5b42a8,'ListId':_0x188d47[_0x1577('0x81')]}));}})['then'](handleEntityNotFound(_0x69c0eb,null))[_0x1577('0x21')](function(_0x9427b8){if(_0x9427b8){_0x4519e9=_0x9427b8;return db[_0x1577('0xa3')]['find']({'where':{'ContactId':_0x4519e9['id'],'closed':![],'SmsAccountId':_0x188d47['id']}})[_0x1577('0x21')](function(_0x543442){if(_0x543442){return[_0x543442,![]];}return db[_0x1577('0xa3')][_0x1577('0x5e')]({'UserId':_0x5ecbea[_0x1577('0x5f')]['id'],'ContactId':_0x4519e9['id'],'SmsAccountId':_0x188d47['id'],'phone':_0x5b42a8,'firstMsgDirection':'out','Messages':[_[_0x1577('0x54')](_0x5ecbea['body'],{'read':![],'body':_0x5ecbea[_0x1577('0x66')][_0x1577('0x66')],'phone':_0x5b42a8,'SmsAccountId':_0x188d47['id'],'UserId':_0x5ecbea['user']['id'],'ContactId':_0x4519e9['id']})]},{'include':[{'model':db[_0x1577('0xaa')],'as':'Messages'}]})[_0x1577('0x21')](function(_0x21416a){return[_0x21416a,!![]];});});}})['spread'](function(_0x59ceee,_0x2c1c6a){if(_0x2c1c6a){return _0x59ceee;}return db['SmsMessage'][_0x1577('0x5e')](_[_0x1577('0x54')](_0x5ecbea[_0x1577('0x66')],{'read':![],'body':_0x5ecbea[_0x1577('0x66')][_0x1577('0x66')],'phone':_0x5b42a8,'SmsAccountId':_0x188d47['id'],'SmsInteractionId':_0x59ceee['id'],'UserId':_0x5ecbea['user']['id'],'ContactId':_0x4519e9['id']}))[_0x1577('0x21')](function(_0x3eef3f){_0x59ceee[_0x1577('0xd1')]['Messages']=[];_0x59ceee['dataValues']['Messages'][_0x1577('0xd2')](_0x3eef3f['dataValues']);return _0x59ceee;});})['then'](respondWithResult(_0x69c0eb,null))[_0x1577('0x2a')](handleError(_0x69c0eb,null));};exports[_0x1577('0x2c')]=function(_0x217646,_0x1a76e7,_0x21b89a){if(_0x217646[_0x1577('0x66')]['id']){delete _0x217646['body']['id'];}var _0x4bde0d,_0x3ad516,_0x122e33;return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x217646[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x1a76e7,null))['then'](function(_0x3459af){if(_0x3459af){_0x122e33=_0x3459af;logger['debug'](_0x1577('0x24'),'status',_0x1577('0xd3'),_0x3459af[_0x1577('0x55')],util[_0x1577('0xd4')](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));switch(_0x3459af[_0x1577('0x55')]){case'skebby':if(_0x217646[_0x1577('0x66')]['skebby_dispatch_id']&&_0x217646[_0x1577('0x66')]['status']){_0x3ad516=_0x217646[_0x1577('0x66')][_0x1577('0x2c')];return db[_0x1577('0xaa')]['find']({'where':{'messageId':_0x217646[_0x1577('0x66')][_0x1577('0xd5')]}});}break;case'connectel':if(_0x217646[_0x1577('0x66')]['requestid']&&_0x217646['body'][_0x1577('0xd6')]){_0x3ad516=_0x217646[_0x1577('0x66')][_0x1577('0xd6')];return db['SmsMessage'][_0x1577('0x5d')]({'where':{'messageId':_0x217646[_0x1577('0x66')][_0x1577('0xd7')]}});}break;case _0x1577('0x8a'):if(_0x217646[_0x1577('0x66')][_0x1577('0x8b')]&&_0x217646['body'][_0x1577('0xd8')]){_0x3ad516=_0x217646['body'][_0x1577('0xd8')];return db[_0x1577('0xaa')]['find']({'where':{'messageId':_0x217646['body'][_0x1577('0x8b')]}});}break;case'infobip':var _0x4877b4=_0x217646[_0x1577('0x66')][_0x1577('0x90')][0x0];if(_0x4877b4['messageId']&&_0x4877b4[_0x1577('0x2c')][_0x1577('0xd9')]===_0x1577('0xda')){_0x3ad516=_0x4877b4['status']['groupName'];return db[_0x1577('0xaa')]['find']({'where':{'messageId':_0x4877b4[_0x1577('0x86')]}});}break;case _0x1577('0x94'):if(_0x217646['body'][_0x1577('0x86')]&&_0x217646[_0x1577('0x66')][_0x1577('0x2c')]){_0x3ad516=_0x217646[_0x1577('0x66')][_0x1577('0x2c')];return db[_0x1577('0xaa')][_0x1577('0x5d')]({'where':{'messageId':_0x217646[_0x1577('0x66')][_0x1577('0x86')]}});}break;case _0x1577('0xdb'):if(_0x217646['body'][0x0]['message']['id']){_0x3ad516=_0x217646[_0x1577('0x66')][0x0]['type'];return db[_0x1577('0xaa')][_0x1577('0x5d')]({'where':{'messageId':_0x217646[_0x1577('0x66')][0x0][_0x1577('0x28')]['id']}});}break;case _0x1577('0x97'):if(_0x217646['body'][_0x1577('0xdc')]&&_0x217646[_0x1577('0x66')][_0x1577('0x2c')]){_0x3ad516=_0x217646[_0x1577('0x66')][_0x1577('0x2c')];return db[_0x1577('0xaa')]['find']({'where':{'messageId':_0x217646[_0x1577('0x66')][_0x1577('0xdc')]}});}break;}}})[_0x1577('0x21')](handleEntityNotFound(_0x1a76e7,null))[_0x1577('0x21')](function(_0x520ac4){if(_0x520ac4){_0x4bde0d=_0x520ac4;switch(_0x122e33['type']){case _0x1577('0x87'):if(_0x3ad516===_0x1577('0xda')){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger[_0x1577('0x26')](_0x1577('0x24'),'status',_0x1577('0x87'),util['inspect'](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;case _0x1577('0x89'):if(_0x3ad516==='1'){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger['error'](_0x1577('0x24'),_0x1577('0x2c'),_0x1577('0x87'),util[_0x1577('0xd4')](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;case _0x1577('0x8a'):if(!_0x217646[_0x1577('0x66')][_0x1577('0xdd')]&&_0x3ad516>=0xc8&&_0x3ad516<=0xce){return _0x4bde0d['update']({'read':!![]});}else{logger['error'](_0x1577('0x24'),_0x1577('0x2c'),_0x1577('0x8a'),util[_0x1577('0xd4')](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;case _0x1577('0xde'):var _0x5d2a66=_0x217646['body'][_0x1577('0x90')][0x0];if(_0x5d2a66[_0x1577('0x2c')]['groupName']===_0x1577('0xda')){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger[_0x1577('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1577('0x2c'),_0x1577('0xde'),util[_0x1577('0xd4')](_0x217646['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3ad516==_0x1577('0xdf')||_0x3ad516=='RECEIVED_BY_RECIPIENT'){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger['error'](_0x1577('0x24'),_0x1577('0x2c'),'clickatell',util[_0x1577('0xd4')](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;case _0x1577('0xdb'):if(_0x3ad516==_0x1577('0xe0')){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger[_0x1577('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1577('0x2c'),_0x1577('0xdb'),util[_0x1577('0xd4')](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3ad516===_0x1577('0xe1')||_0x3ad516===_0x1577('0xe2')){return _0x4bde0d[_0x1577('0x65')]({'read':!![]});}else{logger[_0x1577('0x26')](_0x1577('0x24'),_0x1577('0x2c'),_0x1577('0x97'),util['inspect'](_0x217646[_0x1577('0x66')],{'showHidden':![],'depth':null}));}break;}return _0x4bde0d;}})[_0x1577('0x21')](respondWithResult(_0x1a76e7,null))[_0x1577('0x2a')](handleError(_0x1a76e7,null));};exports[_0x1577('0xe3')]=function(_0xea6f07,_0x23ea33,_0x251c84){var _0x12677b,_0x444808,_0x9ea32;return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0xea6f07[_0x1577('0x5c')]['id']}})['then'](handleEntityNotFound(_0x23ea33,null))[_0x1577('0x21')](function(_0x5a8343){if(_0x5a8343){_0x9ea32=_0x5a8343;logger[_0x1577('0x23')](_0x1577('0x24'),_0x1577('0x2c'),'received\x20delivery\x20report\x20from',_0x5a8343[_0x1577('0x55')],util[_0x1577('0xd4')](_0xea6f07['query'],{'showHidden':![],'depth':null}));switch(_0x5a8343['type']){case _0x1577('0x91'):if(_0xea6f07['query'][_0x1577('0xe4')]&&_0xea6f07['query'][_0x1577('0xe5')]){_0x444808=_0xea6f07['query'][_0x1577('0xe5')];return db[_0x1577('0xaa')][_0x1577('0x5d')]({'where':{'messageId':_0xea6f07[_0x1577('0x49')][_0x1577('0xe4')]}});}break;}}})[_0x1577('0x21')](handleEntityNotFound(_0x23ea33,null))[_0x1577('0x21')](function(_0xa4672a){if(_0xa4672a){_0x12677b=_0xa4672a;switch(_0x9ea32[_0x1577('0x55')]){case'csc':if(_0x444808==='2'||_0x444808==='6'){return _0x12677b['update']({'read':!![]});}else{logger[_0x1577('0x26')](_0x1577('0x24'),_0x1577('0x2c'),'csc',util[_0x1577('0xd4')](_0xea6f07[_0x1577('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x12677b;}})[_0x1577('0x21')](respondWithResult(_0x23ea33,null))['catch'](handleError(_0x23ea33,null));};exports[_0x1577('0xe6')]=function(_0x1ddcc5,_0x3008ae,_0x53500f){return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x1ddcc5[_0x1577('0x5c')]['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x3008ae,null))[_0x1577('0x21')](function(_0x50466f){if(_0x50466f){return _0x50466f[_0x1577('0xe6')](_0x1ddcc5[_0x1577('0x66')][_0x1577('0x72')],_[_0x1577('0xa2')](_0x1ddcc5['body'],[_0x1577('0x72'),'id'])||{})[_0x1577('0xe7')](function(_0x3f4c37){for(var _0x296be0=0x0;_0x296be0<_0x1ddcc5[_0x1577('0x66')][_0x1577('0x72')][_0x1577('0x4c')];_0x296be0+=0x1){socket[_0x1577('0xe8')]('userSmsAccount:save',{'UserId':Number(_0x1ddcc5[_0x1577('0x66')][_0x1577('0x72')][_0x296be0]),'SmsAccountId':Number(_0x1ddcc5[_0x1577('0x5c')]['id'])});}return _0x3f4c37;});}})[_0x1577('0x21')](respondWithResult(_0x3008ae,null))[_0x1577('0x2a')](handleError(_0x3008ae,null));};exports[_0x1577('0xe9')]=function(_0x2146e8,_0x5c8ada,_0xc50823){return db[_0x1577('0x41')][_0x1577('0x5d')]({'where':{'id':_0x2146e8['params']['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x5c8ada,null))[_0x1577('0x21')](function(_0xac5395){if(_0xac5395){return _0xac5395['removeAgents'](_0x2146e8[_0x1577('0x49')]['ids'])[_0x1577('0x21')](function(){if(_['isArray'](_0x2146e8[_0x1577('0x49')][_0x1577('0x72')])){for(var _0x1d64e2=0x0;_0x1d64e2<_0x2146e8['query']['ids']['length'];_0x1d64e2+=0x1){socket[_0x1577('0xe8')](_0x1577('0xea'),{'UserId':Number(_0x2146e8[_0x1577('0x49')][_0x1577('0x72')][_0x1d64e2]),'SmsAccountId':Number(_0x2146e8[_0x1577('0x5c')]['id'])});}}else{socket[_0x1577('0xe8')](_0x1577('0xea'),{'UserId':Number(_0x2146e8[_0x1577('0x49')][_0x1577('0x72')]),'SmsAccountId':Number(_0x2146e8['params']['id'])});}});}})[_0x1577('0x21')](respondWithStatusCode(_0x5c8ada,null))['catch'](handleError(_0x5c8ada,null));};exports[_0x1577('0xeb')]=function(_0x1c3b38,_0x4c82b5,_0x1ae225){var _0x18c65b={};var _0x1668ab={};var _0x4b7735;var _0x10595d;return db['SmsAccount'][_0x1577('0x6c')]({'where':{'id':_0x1c3b38['params']['id']}})[_0x1577('0x21')](handleEntityNotFound(_0x4c82b5,null))[_0x1577('0x21')](function(_0x5f5cc2){if(_0x5f5cc2){_0x4b7735=_0x5f5cc2;_0x1668ab['model']=_[_0x1577('0x45')](db[_0x1577('0xad')][_0x1577('0x42')]);_0x1668ab[_0x1577('0x49')]=_[_0x1577('0x45')](_0x1c3b38[_0x1577('0x49')]);_0x1668ab['filters']=_['intersection'](_0x1668ab[_0x1577('0x48')],_0x1668ab[_0x1577('0x49')]);_0x18c65b[_0x1577('0x4a')]=_[_0x1577('0x47')](_0x1668ab[_0x1577('0x48')],qs['fields'](_0x1c3b38[_0x1577('0x49')][_0x1577('0x4b')]));_0x18c65b[_0x1577('0x4a')]=_0x18c65b[_0x1577('0x4a')][_0x1577('0x4c')]?_0x18c65b['attributes']:_0x1668ab[_0x1577('0x48')];_0x18c65b['order']=qs[_0x1577('0x50')](_0x1c3b38[_0x1577('0x49')][_0x1577('0x50')]);_0x18c65b['where']=qs[_0x1577('0x46')](_[_0x1577('0x52')](_0x1c3b38[_0x1577('0x49')],_0x1668ab[_0x1577('0x46')]));if(_0x1c3b38[_0x1577('0x49')][_0x1577('0x53')]){_0x18c65b[_0x1577('0x51')]=_['merge'](_0x18c65b[_0x1577('0x51')],{'$or':_[_0x1577('0x40')](_0x18c65b[_0x1577('0x4a')],function(_0x36d313){var _0x2993c1={};_0x2993c1[_0x36d313]={'$like':'%'+_0x1c3b38[_0x1577('0x49')][_0x1577('0x53')]+'%'};return _0x2993c1;})});}_0x18c65b=_[_0x1577('0x54')]({},_0x18c65b,_0x1c3b38[_0x1577('0x57')]);return _0x4b7735[_0x1577('0xeb')](_0x18c65b);}})[_0x1577('0x21')](function(_0x2e93d1){if(_0x2e93d1){_0x10595d=_0x2e93d1[_0x1577('0x4c')];if(!_0x1c3b38['query'][_0x1577('0x4d')]('nolimit')){_0x18c65b[_0x1577('0x31')]=qs[_0x1577('0x31')](_0x1c3b38[_0x1577('0x49')]['limit']);_0x18c65b[_0x1577('0x2f')]=qs[_0x1577('0x2f')](_0x1c3b38['query'][_0x1577('0x2f')]);}return _0x4b7735[_0x1577('0xeb')](_0x18c65b);}})[_0x1577('0x21')](function(_0x241455){if(_0x241455){return _0x241455?{'count':_0x10595d,'rows':_0x241455}:null;}})[_0x1577('0x21')](respondWithResult(_0x4c82b5,null))[_0x1577('0x2a')](handleError(_0x4c82b5,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a40cc9c..e8a6f30 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 _0xe12d=['emit','hook','exports','events','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x5ee7c7,_0x5fc067){var _0x3334ed=function(_0x554be2){while(--_0x554be2){_0x5ee7c7['push'](_0x5ee7c7['shift']());}};_0x3334ed(++_0x5fc067);}(_0xe12d,0x6f));var _0xde12=function(_0x28c6f1,_0x5b0cd9){_0x28c6f1=_0x28c6f1-0x0;var _0x45d430=_0xe12d[_0x28c6f1];return _0x45d430;};'use strict';var EventEmitter=require(_0xde12('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xde12('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xde12('0x2')](0x0);var events={'afterCreate':_0xde12('0x3'),'afterUpdate':_0xde12('0x4'),'afterDestroy':_0xde12('0x5')};function emitEvent(_0x57d06f){return function(_0x15880f,_0x80eb40,_0x51bfb6){SmsAccountEvents[_0xde12('0x6')](_0x57d06f+':'+_0x15880f['id'],_0x15880f);SmsAccountEvents[_0xde12('0x6')](_0x57d06f,_0x15880f);_0x51bfb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xde12('0x7')](e,emitEvent(event));}}module[_0xde12('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x41ac=['setMaxListeners','remove','emit','hook','exports','events','SmsAccount'];(function(_0x5c59e9,_0x253541){var _0x56b0b3=function(_0xeb6ad2){while(--_0xeb6ad2){_0x5c59e9['push'](_0x5c59e9['shift']());}};_0x56b0b3(++_0x253541);}(_0x41ac,0x12b));var _0xc41a=function(_0x5c5d11,_0x6f054d){_0x5c5d11=_0x5c5d11-0x0;var _0x3bd1de=_0x41ac[_0x5c5d11];return _0x3bd1de;};'use strict';var EventEmitter=require(_0xc41a('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xc41a('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc41a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc41a('0x3')};function emitEvent(_0x2811e2){return function(_0x597b81,_0x4af57e,_0x2af275){SmsAccountEvents[_0xc41a('0x4')](_0x2811e2+':'+_0x597b81['id'],_0x597b81);SmsAccountEvents['emit'](_0x2811e2,_0x597b81);_0x2af275(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xc41a('0x5')](e,emitEvent(event));}}module[_0xc41a('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index c43856d..2c78f42 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 _0xb558=['exports','define','util','api','moment','bluebird','path','../../config/environment','./smsAccount.attributes'];(function(_0x26fec1,_0xb36ba5){var _0x578339=function(_0x2f3163){while(--_0x2f3163){_0x26fec1['push'](_0x26fec1['shift']());}};_0x578339(++_0xb36ba5);}(_0xb558,0x1a0));var _0x8b55=function(_0x206923,_0x29fd28){_0x206923=_0x206923-0x0;var _0x5e16a9=_0xb558[_0x206923];return _0x5e16a9;};'use strict';var _=require('lodash');var util=require(_0x8b55('0x0'));var logger=require('../../config/logger')(_0x8b55('0x1'));var moment=require(_0x8b55('0x2'));var BPromise=require(_0x8b55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b55('0x4'));var rimraf=require('rimraf');var config=require(_0x8b55('0x5'));var attributes=require(_0x8b55('0x6'));module[_0x8b55('0x7')]=function(_0x29aa0a,_0x3d865b){return _0x29aa0a[_0x8b55('0x8')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x177b=['bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2e7ae9,_0x1f13f6){var _0x5a51a2=function(_0x1064e3){while(--_0x1064e3){_0x2e7ae9['push'](_0x2e7ae9['shift']());}};_0x5a51a2(++_0x1f13f6);}(_0x177b,0xb1));var _0xb177=function(_0x28bef9,_0x28e8d6){_0x28bef9=_0x28bef9-0x0;var _0x45db81=_0x177b[_0x28bef9];return _0x45db81;};'use strict';var _=require(_0xb177('0x0'));var util=require(_0xb177('0x1'));var logger=require(_0xb177('0x2'))(_0xb177('0x3'));var moment=require(_0xb177('0x4'));var BPromise=require(_0xb177('0x5'));var rp=require(_0xb177('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb177('0x7'));var config=require(_0xb177('0x8'));var attributes=require(_0xb177('0x9'));module[_0xb177('0xa')]=function(_0x10d532,_0x2c7f6c){return _0x10d532[_0xb177('0xb')](_0xb177('0xc'),attributes,{'tableName':_0xb177('0xd'),'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 f614713..e6b6eb1 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 _0x7c69=['SmsAccount','find','options','raw','attributes','include','model','ShowSmsAccount','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','defaults','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x33a542,_0x4909a2){var _0x5cf982=function(_0x385104){while(--_0x385104){_0x33a542['push'](_0x33a542['shift']());}};_0x5cf982(++_0x4909a2);}(_0x7c69,0x195));var _0x97c6=function(_0x574d9b,_0x2063da){_0x574d9b=_0x574d9b-0x0;var _0x31d2a5=_0x7c69[_0x574d9b];return _0x31d2a5;};'use strict';var _=require(_0x97c6('0x0'));var util=require('util');var moment=require(_0x97c6('0x1'));var BPromise=require(_0x97c6('0x2'));var rs=require(_0x97c6('0x3'));var fs=require('fs');var Redis=require(_0x97c6('0x4'));var db=require(_0x97c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97c6('0x6'))(_0x97c6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x97c6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x97c6('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x97c6('0xa'))(new Redis(config[_0x97c6('0xb')]));require(_0x97c6('0xc'))[_0x97c6('0xd')](socket);function respondWithRpcPromise(_0x3d860a,_0x448b67,_0x57ac02){return new BPromise(function(_0x13706e,_0x404237){return client[_0x97c6('0xe')](_0x3d860a,_0x57ac02)[_0x97c6('0xf')](function(_0x213497){logger[_0x97c6('0x10')](_0x97c6('0x11'),_0x448b67,_0x97c6('0x12'));logger[_0x97c6('0x13')](_0x97c6('0x14'),_0x448b67,_0x97c6('0x12'),JSON['stringify'](_0x213497));if(_0x213497[_0x97c6('0x15')]){if(_0x213497[_0x97c6('0x15')]['code']===0x1f4){logger[_0x97c6('0x15')](_0x97c6('0x11'),_0x448b67,_0x213497[_0x97c6('0x15')][_0x97c6('0x16')]);return _0x404237(_0x213497['error'][_0x97c6('0x16')]);}logger[_0x97c6('0x15')](_0x97c6('0x11'),_0x448b67,_0x213497[_0x97c6('0x15')]['message']);return _0x13706e(_0x213497[_0x97c6('0x15')][_0x97c6('0x16')]);}else{logger[_0x97c6('0x10')](_0x97c6('0x11'),_0x448b67,'request\x20sent');_0x13706e(_0x213497['result']['message']);}})[_0x97c6('0x17')](function(_0x459c91){logger[_0x97c6('0x15')](_0x97c6('0x11'),_0x448b67,_0x459c91);_0x404237(_0x459c91);});});}exports['ShowSmsAccount']=function(_0x555e13){var _0x1e4681=this;return new Promise(function(_0x44f41d,_0x33a0f8){return db[_0x97c6('0x18')][_0x97c6('0x19')]({'raw':_0x555e13[_0x97c6('0x1a')]?_0x555e13[_0x97c6('0x1a')][_0x97c6('0x1b')]===undefined?!![]:![]:!![],'where':_0x555e13[_0x97c6('0x1a')]?_0x555e13[_0x97c6('0x1a')]['where']||null:null,'attributes':_0x555e13[_0x97c6('0x1a')]?_0x555e13[_0x97c6('0x1a')][_0x97c6('0x1c')]||null:null,'include':_0x555e13['options']?_0x555e13[_0x97c6('0x1a')][_0x97c6('0x1d')]?_['map'](_0x555e13[_0x97c6('0x1a')][_0x97c6('0x1d')],function(_0x1cba48){return{'model':db[_0x1cba48[_0x97c6('0x1e')]],'as':_0x1cba48['as'],'attributes':_0x1cba48[_0x97c6('0x1c')],'include':_0x1cba48[_0x97c6('0x1d')]?_['map'](_0x1cba48[_0x97c6('0x1d')],function(_0x6c8a25){return{'model':db[_0x6c8a25[_0x97c6('0x1e')]],'as':_0x6c8a25['as'],'attributes':_0x6c8a25[_0x97c6('0x1c')],'include':_0x6c8a25[_0x97c6('0x1d')]?_['map'](_0x6c8a25[_0x97c6('0x1d')],function(_0x1d6ae7){return{'model':db[_0x1d6ae7['model']],'as':_0x1d6ae7['as'],'attributes':_0x1d6ae7[_0x97c6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c6('0xf')](function(_0x12b47c){logger[_0x97c6('0x10')](_0x97c6('0x1f'),_0x555e13);logger[_0x97c6('0x13')](_0x97c6('0x1f'),_0x555e13,JSON[_0x97c6('0x20')](_0x12b47c));_0x44f41d(_0x12b47c);})[_0x97c6('0x17')](function(_0x57282f){logger[_0x97c6('0x15')]('ShowSmsAccount',_0x57282f['message'],_0x555e13);_0x33a0f8(_0x1e4681['error'](0x1f4,_0x57282f[_0x97c6('0x16')]));});});}; \ No newline at end of file +var _0x70b6=['ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4f0dea,_0x30dbe){var _0x220cc8=function(_0x5c3bfa){while(--_0x5c3bfa){_0x4f0dea['push'](_0x4f0dea['shift']());}};_0x220cc8(++_0x30dbe);}(_0x70b6,0x1c6));var _0x670b=function(_0x100443,_0x18748a){_0x100443=_0x100443-0x0;var _0x5369e7=_0x70b6[_0x100443];return _0x5369e7;};'use strict';var _=require(_0x670b('0x0'));var util=require(_0x670b('0x1'));var moment=require(_0x670b('0x2'));var BPromise=require(_0x670b('0x3'));var rs=require(_0x670b('0x4'));var fs=require('fs');var Redis=require(_0x670b('0x5'));var db=require(_0x670b('0x6'))['db'];var utils=require(_0x670b('0x7'));var logger=require('../../config/logger')(_0x670b('0x8'));var config=require(_0x670b('0x9'));var jayson=require(_0x670b('0xa'));var client=jayson[_0x670b('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x670b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x670b('0xd'))(new Redis(config[_0x670b('0xc')]));require(_0x670b('0xe'))[_0x670b('0xf')](socket);function respondWithRpcPromise(_0x443293,_0x3d08f5,_0x4a5445){return new BPromise(function(_0x20678d,_0x41813d){return client['request'](_0x443293,_0x4a5445)[_0x670b('0x10')](function(_0x206166){logger[_0x670b('0x11')](_0x670b('0x12'),_0x3d08f5,'request\x20sent');logger[_0x670b('0x13')](_0x670b('0x14'),_0x3d08f5,'request\x20sent',JSON[_0x670b('0x15')](_0x206166));if(_0x206166[_0x670b('0x16')]){if(_0x206166[_0x670b('0x16')][_0x670b('0x17')]===0x1f4){logger[_0x670b('0x16')](_0x670b('0x12'),_0x3d08f5,_0x206166[_0x670b('0x16')][_0x670b('0x18')]);return _0x41813d(_0x206166[_0x670b('0x16')][_0x670b('0x18')]);}logger[_0x670b('0x16')](_0x670b('0x12'),_0x3d08f5,_0x206166[_0x670b('0x16')]['message']);return _0x20678d(_0x206166[_0x670b('0x16')][_0x670b('0x18')]);}else{logger[_0x670b('0x11')](_0x670b('0x12'),_0x3d08f5,'request\x20sent');_0x20678d(_0x206166[_0x670b('0x19')]['message']);}})[_0x670b('0x1a')](function(_0xb216e){logger[_0x670b('0x16')](_0x670b('0x12'),_0x3d08f5,_0xb216e);_0x41813d(_0xb216e);});});}exports[_0x670b('0x1b')]=function(_0x22ec26){var _0x542405=this;return new Promise(function(_0x1feb39,_0x194d27){return db[_0x670b('0x1c')][_0x670b('0x1d')]({'raw':_0x22ec26['options']?_0x22ec26['options'][_0x670b('0x1e')]===undefined?!![]:![]:!![],'where':_0x22ec26[_0x670b('0x1f')]?_0x22ec26[_0x670b('0x1f')][_0x670b('0x20')]||null:null,'attributes':_0x22ec26[_0x670b('0x1f')]?_0x22ec26[_0x670b('0x1f')][_0x670b('0x21')]||null:null,'include':_0x22ec26[_0x670b('0x1f')]?_0x22ec26[_0x670b('0x1f')][_0x670b('0x22')]?_['map'](_0x22ec26['options'][_0x670b('0x22')],function(_0x436dc0){return{'model':db[_0x436dc0[_0x670b('0x23')]],'as':_0x436dc0['as'],'attributes':_0x436dc0[_0x670b('0x21')],'include':_0x436dc0[_0x670b('0x22')]?_[_0x670b('0x24')](_0x436dc0[_0x670b('0x22')],function(_0x13ff3c){return{'model':db[_0x13ff3c[_0x670b('0x23')]],'as':_0x13ff3c['as'],'attributes':_0x13ff3c[_0x670b('0x21')],'include':_0x13ff3c[_0x670b('0x22')]?_[_0x670b('0x24')](_0x13ff3c[_0x670b('0x22')],function(_0xa4aa95){return{'model':db[_0xa4aa95[_0x670b('0x23')]],'as':_0xa4aa95['as'],'attributes':_0xa4aa95['attributes']};}):[]};}):[]};}):[]:[]})[_0x670b('0x10')](function(_0x111466){logger[_0x670b('0x11')](_0x670b('0x1b'),_0x22ec26);logger[_0x670b('0x13')]('ShowSmsAccount',_0x22ec26,JSON[_0x670b('0x15')](_0x111466));_0x1feb39(_0x111466);})[_0x670b('0x1a')](function(_0x35d1d8){logger[_0x670b('0x16')](_0x670b('0x1b'),_0x35d1d8['message'],_0x22ec26);_0x194d27(_0x542405[_0x670b('0x16')](0x1f4,_0x35d1d8[_0x670b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 703cdf2..b2f6de4 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 c76d229..9e55348 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2fe752,_0x575537){var _0x235803=function(_0x50939b){while(--_0x50939b){_0x2fe752['push'](_0x2fe752['shift']());}};_0x235803(++_0x575537);}(_0xedd9,0xfc));var _0x9edd=function(_0x5ef12e,_0x59a72a){_0x5ef12e=_0x5ef12e-0x0;var _0xd8607=_0xedd9[_0x5ef12e];return _0xd8607;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4a1446,_0x170e92){var _0xc1876e=function(_0x53c9de){while(--_0x53c9de){_0x4a1446['push'](_0x4a1446['shift']());}};_0xc1876e(++_0x170e92);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ffa9ffa..661d799 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 _0x57e9=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x20b21f,_0x1985e2){var _0x3abd26=function(_0x56fe71){while(--_0x56fe71){_0x20b21f['push'](_0x20b21f['shift']());}};_0x3abd26(++_0x1985e2);}(_0x57e9,0x12b));var _0x957e=function(_0x49c063,_0x3464d4){_0x49c063=_0x49c063-0x0;var _0x5ad47b=_0x57e9[_0x49c063];return _0x5ad47b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x957e('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x957e('0x1')],'allowNull':![],'defaultValue':_0x957e('0x2')},'appdata':{'type':Sequelize[_0x957e('0x3')]()},'description':{'type':Sequelize[_0x957e('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x957e('0x4')}}; \ No newline at end of file +var _0xa0ba=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x19595d,_0x54355d){var _0x496d40=function(_0x84adb1){while(--_0x84adb1){_0x19595d['push'](_0x19595d['shift']());}};_0x496d40(++_0x54355d);}(_0xa0ba,0x8f));var _0xaa0b=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0xa0ba[_0x52b24f];return _0x46ea6b;};'use strict';var Sequelize=require(_0xaa0b('0x0'));module[_0xaa0b('0x1')]={'priority':{'type':Sequelize[_0xaa0b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaa0b('0x3')],'allowNull':![],'defaultValue':_0xaa0b('0x4')},'appdata':{'type':Sequelize[_0xaa0b('0x5')]()},'description':{'type':Sequelize[_0xaa0b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 11bceea..44dc9d9 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 _0x739b=['name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack'];(function(_0x1c011c,_0x384710){var _0x277506=function(_0x92ca26){while(--_0x92ca26){_0x1c011c['push'](_0x1c011c['shift']());}};_0x277506(++_0x384710);}(_0x739b,0x105));var _0xb739=function(_0x1f6ca8,_0x46ab98){_0x1f6ca8=_0x1f6ca8-0x0;var _0x43e289=_0x739b[_0x1f6ca8];return _0x43e289;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb739('0x0'));var jsonpatch=require(_0xb739('0x1'));var rp=require(_0xb739('0x2'));var moment=require(_0xb739('0x3'));var BPromise=require(_0xb739('0x4'));var Mustache=require(_0xb739('0x5'));var util=require(_0xb739('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb739('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb739('0x8'));var _=require(_0xb739('0x9'));var squel=require(_0xb739('0xa'));var crypto=require(_0xb739('0xb'));var jsforce=require(_0xb739('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb739('0x7'));var querystring=require(_0xb739('0xd'));var Papa=require(_0xb739('0xe'));var Redis=require(_0xb739('0xf'));var authService=require(_0xb739('0x10'));var qs=require(_0xb739('0x11'));var as=require(_0xb739('0x12'));var hardwareService=require(_0xb739('0x13'));var logger=require('../../config/logger')(_0xb739('0x14'));var utils=require('../../config/utils');var config=require(_0xb739('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e5d8,_0x4179e9){_0x4179e9=_0x4179e9||0xcc;return function(_0x52b51b){if(_0x52b51b){return _0x23e5d8[_0xb739('0x16')](_0x4179e9);}return _0x23e5d8[_0xb739('0x17')](_0x4179e9)['end']();};}function respondWithResult(_0x465242,_0x224f3f){_0x224f3f=_0x224f3f||0xc8;return function(_0x34ba93){if(_0x34ba93){return _0x465242['status'](_0x224f3f)[_0xb739('0x18')](_0x34ba93);}};}function respondWithFilteredResult(_0x4a54e6,_0x54cdb6){return function(_0x494b32){if(_0x494b32){var _0x458e4d=typeof _0x54cdb6['offset']===_0xb739('0x19')&&typeof _0x54cdb6['limit']===_0xb739('0x19');var _0x3f3f2c=_0x494b32[_0xb739('0x1a')];var _0x10b1a2=_0x458e4d?0x0:_0x54cdb6['offset'];var _0x55d10d=_0x458e4d?_0x494b32[_0xb739('0x1a')]:_0x54cdb6['offset']+_0x54cdb6[_0xb739('0x1b')];var _0x5f1328;if(_0x55d10d>=_0x3f3f2c){_0x55d10d=_0x3f3f2c;_0x5f1328=0xc8;}else{_0x5f1328=0xce;}_0x4a54e6[_0xb739('0x17')](_0x5f1328);return _0x4a54e6[_0xb739('0x1c')](_0xb739('0x1d'),_0x10b1a2+'-'+_0x55d10d+'/'+_0x3f3f2c)[_0xb739('0x18')](_0x494b32);}return null;};}function patchUpdates(_0xa1cef9){return function(_0x454f13){try{jsonpatch[_0xb739('0x1e')](_0x454f13,_0xa1cef9,!![]);}catch(_0xbe0183){return BPromise[_0xb739('0x1f')](_0xbe0183);}return _0x454f13[_0xb739('0x20')]();};}function saveUpdates(_0x48bf51,_0x2fa34c){return function(_0x27e7b8){if(_0x27e7b8){return _0x27e7b8[_0xb739('0x21')](_0x48bf51)['then'](function(_0xd1ca67){return _0xd1ca67;});}return null;};}function removeEntity(_0xd82676,_0x508b3c){return function(_0x5d4d1b){if(_0x5d4d1b){return _0x5d4d1b[_0xb739('0x22')]()[_0xb739('0x23')](function(){_0xd82676['status'](0xcc)[_0xb739('0x24')]();});}};}function handleEntityNotFound(_0x167a63,_0x53c367){return function(_0x31bd3f){if(!_0x31bd3f){_0x167a63[_0xb739('0x16')](0x194);}return _0x31bd3f;};}function handleError(_0xf0bb0c,_0x457e7d){_0x457e7d=_0x457e7d||0x1f4;return function(_0x207517){logger[_0xb739('0x25')](_0x207517[_0xb739('0x26')]);if(_0x207517[_0xb739('0x27')]){delete _0x207517[_0xb739('0x27')];}_0xf0bb0c['status'](_0x457e7d)[_0xb739('0x28')](_0x207517);};}exports[_0xb739('0x29')]=function(_0x4faa30,_0x3039ca){var _0x4440be={},_0xbe7854={},_0x10dd6d={'count':0x0,'rows':[]};var _0x1848f9=_[_0xb739('0x2a')](db[_0xb739('0x2b')][_0xb739('0x2c')],function(_0xbfcf7c){return{'name':_0xbfcf7c[_0xb739('0x2d')],'type':_0xbfcf7c[_0xb739('0x2e')]['key']};});_0xbe7854[_0xb739('0x2f')]=_[_0xb739('0x2a')](_0x1848f9,_0xb739('0x27'));_0xbe7854[_0xb739('0x30')]=_[_0xb739('0x31')](_0x4faa30[_0xb739('0x30')]);_0xbe7854[_0xb739('0x32')]=_[_0xb739('0x33')](_0xbe7854[_0xb739('0x2f')],_0xbe7854['query']);_0x4440be[_0xb739('0x34')]=_[_0xb739('0x33')](_0xbe7854['model'],qs[_0xb739('0x35')](_0x4faa30[_0xb739('0x30')]['fields']));_0x4440be[_0xb739('0x34')]=_0x4440be[_0xb739('0x34')][_0xb739('0x36')]?_0x4440be[_0xb739('0x34')]:_0xbe7854['model'];if(!_0x4faa30['query'][_0xb739('0x37')](_0xb739('0x38'))){_0x4440be[_0xb739('0x1b')]=qs[_0xb739('0x1b')](_0x4faa30[_0xb739('0x30')][_0xb739('0x1b')]);_0x4440be[_0xb739('0x39')]=qs['offset'](_0x4faa30[_0xb739('0x30')][_0xb739('0x39')]);}_0x4440be['order']=qs['sort'](_0x4faa30[_0xb739('0x30')][_0xb739('0x3a')]);_0x4440be['where']=qs[_0xb739('0x32')](_[_0xb739('0x3b')](_0x4faa30['query'],_0xbe7854[_0xb739('0x32')]),_0x1848f9);if(_0x4faa30[_0xb739('0x30')][_0xb739('0x3c')]){_0x4440be[_0xb739('0x3d')]=_[_0xb739('0x3e')](_0x4440be[_0xb739('0x3d')],{'$or':_[_0xb739('0x2a')](_0x1848f9,function(_0x500904){if(_0x500904[_0xb739('0x2e')]!==_0xb739('0x3f')){var _0x2233b9={};_0x2233b9[_0x500904[_0xb739('0x27')]]={'$like':'%'+_0x4faa30[_0xb739('0x30')][_0xb739('0x3c')]+'%'};return _0x2233b9;}})});}_0x4440be=_[_0xb739('0x3e')]({},_0x4440be,_0x4faa30[_0xb739('0x40')]);var _0x14ccae={'where':_0x4440be[_0xb739('0x3d')]};return db[_0xb739('0x2b')][_0xb739('0x1a')](_0x14ccae)[_0xb739('0x23')](function(_0x1e11c2){_0x10dd6d[_0xb739('0x1a')]=_0x1e11c2;if(_0x4faa30['query'][_0xb739('0x41')]){_0x4440be[_0xb739('0x42')]=[{'all':!![]}];}return db[_0xb739('0x2b')][_0xb739('0x43')](_0x4440be);})[_0xb739('0x23')](function(_0x4776ec){_0x10dd6d[_0xb739('0x44')]=_0x4776ec;return _0x10dd6d;})[_0xb739('0x23')](respondWithFilteredResult(_0x3039ca,_0x4440be))[_0xb739('0x45')](handleError(_0x3039ca,null));};exports[_0xb739('0x46')]=function(_0x32c007,_0x6497b5){var _0x4b5152={'raw':!![],'where':{'id':_0x32c007[_0xb739('0x47')]['id']}},_0x179e21={};_0x179e21[_0xb739('0x2f')]=_['keys'](db[_0xb739('0x2b')][_0xb739('0x2c')]);_0x179e21[_0xb739('0x30')]=_[_0xb739('0x31')](_0x32c007[_0xb739('0x30')]);_0x179e21['filters']=_[_0xb739('0x33')](_0x179e21['model'],_0x179e21[_0xb739('0x30')]);_0x4b5152[_0xb739('0x34')]=_[_0xb739('0x33')](_0x179e21['model'],qs[_0xb739('0x35')](_0x32c007[_0xb739('0x30')][_0xb739('0x35')]));_0x4b5152[_0xb739('0x34')]=_0x4b5152[_0xb739('0x34')]['length']?_0x4b5152['attributes']:_0x179e21[_0xb739('0x2f')];if(_0x32c007[_0xb739('0x30')][_0xb739('0x41')]){_0x4b5152[_0xb739('0x42')]=[{'all':!![]}];}_0x4b5152=_[_0xb739('0x3e')]({},_0x4b5152,_0x32c007[_0xb739('0x40')]);return db['SmsApplication'][_0xb739('0x48')](_0x4b5152)['then'](handleEntityNotFound(_0x6497b5,null))[_0xb739('0x23')](respondWithResult(_0x6497b5,null))[_0xb739('0x45')](handleError(_0x6497b5,null));};exports[_0xb739('0x49')]=function(_0x4d3d90,_0x3a8895){return db[_0xb739('0x2b')]['create'](_0x4d3d90[_0xb739('0x4a')],{})[_0xb739('0x23')](respondWithResult(_0x3a8895,0xc9))['catch'](handleError(_0x3a8895,null));};exports[_0xb739('0x21')]=function(_0x13ba19,_0x3ae5a1){if(_0x13ba19['body']['id']){delete _0x13ba19[_0xb739('0x4a')]['id'];}return db[_0xb739('0x2b')][_0xb739('0x48')]({'where':{'id':_0x13ba19[_0xb739('0x47')]['id']}})[_0xb739('0x23')](handleEntityNotFound(_0x3ae5a1,null))[_0xb739('0x23')](saveUpdates(_0x13ba19[_0xb739('0x4a')],null))[_0xb739('0x23')](respondWithResult(_0x3ae5a1,null))['catch'](handleError(_0x3ae5a1,null));};exports[_0xb739('0x22')]=function(_0xedcf41,_0x257e2f){return db['SmsApplication']['find']({'where':{'id':_0xedcf41[_0xb739('0x47')]['id']}})[_0xb739('0x23')](handleEntityNotFound(_0x257e2f,null))[_0xb739('0x23')](removeEntity(_0x257e2f,null))['catch'](handleError(_0x257e2f,null));}; \ No newline at end of file +var _0xd13c=['update','eml-format','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','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','SmsApplication','includeAll','include','rows','catch','params','options','find','create','body'];(function(_0x556796,_0x347940){var _0x395e85=function(_0x339817){while(--_0x339817){_0x556796['push'](_0x556796['shift']());}};_0x395e85(++_0x347940);}(_0xd13c,0x91));var _0xcd13=function(_0x3a05fb,_0x4de616){_0x3a05fb=_0x3a05fb-0x0;var _0x2c805b=_0xd13c[_0x3a05fb];return _0x2c805b;};'use strict';var emlformat=require(_0xcd13('0x0'));var rimraf=require(_0xcd13('0x1'));var zipdir=require(_0xcd13('0x2'));var jsonpatch=require(_0xcd13('0x3'));var rp=require(_0xcd13('0x4'));var moment=require(_0xcd13('0x5'));var BPromise=require(_0xcd13('0x6'));var Mustache=require(_0xcd13('0x7'));var util=require(_0xcd13('0x8'));var path=require(_0xcd13('0x9'));var sox=require(_0xcd13('0xa'));var csv=require(_0xcd13('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd13('0xc'));var _=require('lodash');var squel=require(_0xcd13('0xd'));var crypto=require(_0xcd13('0xe'));var jsforce=require(_0xcd13('0xf'));var deskjs=require(_0xcd13('0x10'));var toCsv=require(_0xcd13('0xb'));var querystring=require('querystring');var Papa=require(_0xcd13('0x11'));var Redis=require(_0xcd13('0x12'));var authService=require(_0xcd13('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd13('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcd13('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18d102,_0x5c09f5){_0x5c09f5=_0x5c09f5||0xcc;return function(_0x4c55fe){if(_0x4c55fe){return _0x18d102[_0xcd13('0x16')](_0x5c09f5);}return _0x18d102[_0xcd13('0x17')](_0x5c09f5)['end']();};}function respondWithResult(_0x23076a,_0x4a7423){_0x4a7423=_0x4a7423||0xc8;return function(_0x44ef17){if(_0x44ef17){return _0x23076a[_0xcd13('0x17')](_0x4a7423)[_0xcd13('0x18')](_0x44ef17);}};}function respondWithFilteredResult(_0x2f94af,_0x469beb){return function(_0x4ec00f){if(_0x4ec00f){var _0xe7c9a3=typeof _0x469beb[_0xcd13('0x19')]===_0xcd13('0x1a')&&typeof _0x469beb['limit']==='undefined';var _0x31f1be=_0x4ec00f[_0xcd13('0x1b')];var _0x39724f=_0xe7c9a3?0x0:_0x469beb[_0xcd13('0x19')];var _0x25f754=_0xe7c9a3?_0x4ec00f[_0xcd13('0x1b')]:_0x469beb[_0xcd13('0x19')]+_0x469beb[_0xcd13('0x1c')];var _0x122b62;if(_0x25f754>=_0x31f1be){_0x25f754=_0x31f1be;_0x122b62=0xc8;}else{_0x122b62=0xce;}_0x2f94af[_0xcd13('0x17')](_0x122b62);return _0x2f94af[_0xcd13('0x1d')](_0xcd13('0x1e'),_0x39724f+'-'+_0x25f754+'/'+_0x31f1be)[_0xcd13('0x18')](_0x4ec00f);}return null;};}function patchUpdates(_0x35decc){return function(_0x34c6e9){try{jsonpatch[_0xcd13('0x1f')](_0x34c6e9,_0x35decc,!![]);}catch(_0x3e832c){return BPromise[_0xcd13('0x20')](_0x3e832c);}return _0x34c6e9[_0xcd13('0x21')]();};}function saveUpdates(_0x5e93f8,_0x459bc2){return function(_0x2734e2){if(_0x2734e2){return _0x2734e2['update'](_0x5e93f8)[_0xcd13('0x22')](function(_0x4d0396){return _0x4d0396;});}return null;};}function removeEntity(_0xd7da61,_0x5eb84d){return function(_0x480dd4){if(_0x480dd4){return _0x480dd4[_0xcd13('0x23')]()[_0xcd13('0x22')](function(){_0xd7da61[_0xcd13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509363,_0x2e364d){return function(_0x12be21){if(!_0x12be21){_0x509363[_0xcd13('0x16')](0x194);}return _0x12be21;};}function handleError(_0xc1e092,_0x4b7153){_0x4b7153=_0x4b7153||0x1f4;return function(_0x171852){logger['error'](_0x171852[_0xcd13('0x24')]);if(_0x171852[_0xcd13('0x25')]){delete _0x171852[_0xcd13('0x25')];}_0xc1e092[_0xcd13('0x17')](_0x4b7153)[_0xcd13('0x26')](_0x171852);};}exports[_0xcd13('0x27')]=function(_0x336598,_0x2ae3a1){var _0x20b028={},_0x248030={},_0x159c24={'count':0x0,'rows':[]};var _0x33f597=_[_0xcd13('0x28')](db['SmsApplication'][_0xcd13('0x29')],function(_0x509360){return{'name':_0x509360[_0xcd13('0x2a')],'type':_0x509360[_0xcd13('0x2b')][_0xcd13('0x2c')]};});_0x248030[_0xcd13('0x2d')]=_[_0xcd13('0x28')](_0x33f597,_0xcd13('0x25'));_0x248030[_0xcd13('0x2e')]=_[_0xcd13('0x2f')](_0x336598[_0xcd13('0x2e')]);_0x248030['filters']=_[_0xcd13('0x30')](_0x248030[_0xcd13('0x2d')],_0x248030[_0xcd13('0x2e')]);_0x20b028['attributes']=_[_0xcd13('0x30')](_0x248030['model'],qs[_0xcd13('0x31')](_0x336598[_0xcd13('0x2e')]['fields']));_0x20b028['attributes']=_0x20b028['attributes'][_0xcd13('0x32')]?_0x20b028[_0xcd13('0x33')]:_0x248030['model'];if(!_0x336598[_0xcd13('0x2e')][_0xcd13('0x34')]('nolimit')){_0x20b028[_0xcd13('0x1c')]=qs[_0xcd13('0x1c')](_0x336598[_0xcd13('0x2e')]['limit']);_0x20b028[_0xcd13('0x19')]=qs[_0xcd13('0x19')](_0x336598[_0xcd13('0x2e')][_0xcd13('0x19')]);}_0x20b028[_0xcd13('0x35')]=qs[_0xcd13('0x36')](_0x336598['query'][_0xcd13('0x36')]);_0x20b028[_0xcd13('0x37')]=qs[_0xcd13('0x38')](_[_0xcd13('0x39')](_0x336598[_0xcd13('0x2e')],_0x248030[_0xcd13('0x38')]),_0x33f597);if(_0x336598[_0xcd13('0x2e')][_0xcd13('0x3a')]){_0x20b028[_0xcd13('0x37')]=_[_0xcd13('0x3b')](_0x20b028[_0xcd13('0x37')],{'$or':_['map'](_0x33f597,function(_0xbd8739){if(_0xbd8739[_0xcd13('0x2b')]!==_0xcd13('0x3c')){var _0x42d200={};_0x42d200[_0xbd8739[_0xcd13('0x25')]]={'$like':'%'+_0x336598['query'][_0xcd13('0x3a')]+'%'};return _0x42d200;}})});}_0x20b028=_[_0xcd13('0x3b')]({},_0x20b028,_0x336598['options']);var _0x537a4e={'where':_0x20b028[_0xcd13('0x37')]};return db[_0xcd13('0x3d')][_0xcd13('0x1b')](_0x537a4e)['then'](function(_0xe69e72){_0x159c24[_0xcd13('0x1b')]=_0xe69e72;if(_0x336598[_0xcd13('0x2e')][_0xcd13('0x3e')]){_0x20b028[_0xcd13('0x3f')]=[{'all':!![]}];}return db[_0xcd13('0x3d')]['findAll'](_0x20b028);})[_0xcd13('0x22')](function(_0x205abc){_0x159c24[_0xcd13('0x40')]=_0x205abc;return _0x159c24;})['then'](respondWithFilteredResult(_0x2ae3a1,_0x20b028))[_0xcd13('0x41')](handleError(_0x2ae3a1,null));};exports['show']=function(_0x3845af,_0x1dd76e){var _0xeb0442={'raw':!![],'where':{'id':_0x3845af[_0xcd13('0x42')]['id']}},_0x544be6={};_0x544be6[_0xcd13('0x2d')]=_[_0xcd13('0x2f')](db['SmsApplication']['rawAttributes']);_0x544be6[_0xcd13('0x2e')]=_[_0xcd13('0x2f')](_0x3845af[_0xcd13('0x2e')]);_0x544be6[_0xcd13('0x38')]=_[_0xcd13('0x30')](_0x544be6['model'],_0x544be6['query']);_0xeb0442['attributes']=_[_0xcd13('0x30')](_0x544be6[_0xcd13('0x2d')],qs[_0xcd13('0x31')](_0x3845af[_0xcd13('0x2e')]['fields']));_0xeb0442['attributes']=_0xeb0442[_0xcd13('0x33')][_0xcd13('0x32')]?_0xeb0442[_0xcd13('0x33')]:_0x544be6[_0xcd13('0x2d')];if(_0x3845af[_0xcd13('0x2e')][_0xcd13('0x3e')]){_0xeb0442[_0xcd13('0x3f')]=[{'all':!![]}];}_0xeb0442=_[_0xcd13('0x3b')]({},_0xeb0442,_0x3845af[_0xcd13('0x43')]);return db['SmsApplication'][_0xcd13('0x44')](_0xeb0442)[_0xcd13('0x22')](handleEntityNotFound(_0x1dd76e,null))[_0xcd13('0x22')](respondWithResult(_0x1dd76e,null))['catch'](handleError(_0x1dd76e,null));};exports['create']=function(_0x3c13b3,_0x339e3c){return db[_0xcd13('0x3d')][_0xcd13('0x45')](_0x3c13b3[_0xcd13('0x46')],{})[_0xcd13('0x22')](respondWithResult(_0x339e3c,0xc9))[_0xcd13('0x41')](handleError(_0x339e3c,null));};exports[_0xcd13('0x47')]=function(_0x326888,_0x3e7f40){if(_0x326888['body']['id']){delete _0x326888[_0xcd13('0x46')]['id'];}return db[_0xcd13('0x3d')][_0xcd13('0x44')]({'where':{'id':_0x326888[_0xcd13('0x42')]['id']}})[_0xcd13('0x22')](handleEntityNotFound(_0x3e7f40,null))[_0xcd13('0x22')](saveUpdates(_0x326888['body'],null))[_0xcd13('0x22')](respondWithResult(_0x3e7f40,null))[_0xcd13('0x41')](handleError(_0x3e7f40,null));};exports[_0xcd13('0x23')]=function(_0x9d5696,_0x179eb3){return db[_0xcd13('0x3d')][_0xcd13('0x44')]({'where':{'id':_0x9d5696[_0xcd13('0x42')]['id']}})['then'](handleEntityNotFound(_0x179eb3,null))[_0xcd13('0x22')](removeEntity(_0x179eb3,null))[_0xcd13('0x41')](handleError(_0x179eb3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7598a71..018216d 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 _0x6882=['SmsApplication','utf8mb4','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x6882,0x84));var _0x2688=function(_0x1fc9d7,_0x1bcf36){_0x1fc9d7=_0x1fc9d7-0x0;var _0x4a5e20=_0x6882[_0x1fc9d7];return _0x4a5e20;};'use strict';var _=require(_0x2688('0x0'));var util=require(_0x2688('0x1'));var logger=require(_0x2688('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2688('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2688('0x4'));var rimraf=require(_0x2688('0x5'));var config=require(_0x2688('0x6'));var attributes=require(_0x2688('0x7'));module['exports']=function(_0x4f8881,_0x5cb8a8){return _0x4f8881['define'](_0x2688('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2688('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb4ce=['../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0xb4ce,0x166));var _0xeb4c=function(_0x4577e3,_0x3ec7a8){_0x4577e3=_0x4577e3-0x0;var _0x46f087=_0xb4ce[_0x4577e3];return _0x46f087;};'use strict';var _=require(_0xeb4c('0x0'));var util=require('util');var logger=require(_0xeb4c('0x1'))(_0xeb4c('0x2'));var moment=require(_0xeb4c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb4c('0x4'));var rimraf=require('rimraf');var config=require(_0xeb4c('0x5'));var attributes=require('./smsApplication.attributes');module[_0xeb4c('0x6')]=function(_0x504668,_0x29aa30){return _0x504668[_0xeb4c('0x7')](_0xeb4c('0x8'),attributes,{'tableName':_0xeb4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb4c('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 01fbce0..1c99ebf 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 _0x4f2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','ioredis'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x4f2f[_0x710815];return _0x5b3b89;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf4f2('0x0'));var BPromise=require(_0xf4f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f2('0x2'));var db=require(_0xf4f2('0x3'))['db'];var utils=require(_0xf4f2('0x4'));var logger=require(_0xf4f2('0x5'))(_0xf4f2('0x6'));var config=require(_0xf4f2('0x7'));var jayson=require(_0xf4f2('0x8'));var client=jayson[_0xf4f2('0x9')][_0xf4f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cc7c0,_0x478723,_0x5d14a9){return new BPromise(function(_0x7c1660,_0xe39952){return client['request'](_0x5cc7c0,_0x5d14a9)[_0xf4f2('0xb')](function(_0x53dc4e){logger[_0xf4f2('0xc')](_0xf4f2('0xd'),_0x478723,'request\x20sent');logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x478723,'request\x20sent',JSON[_0xf4f2('0xe')](_0x53dc4e));if(_0x53dc4e[_0xf4f2('0xf')]){if(_0x53dc4e['error'][_0xf4f2('0x10')]===0x1f4){logger[_0xf4f2('0xf')]('SmsApplication,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')]['message']);return _0xe39952(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}logger[_0xf4f2('0xf')]('SmsApplication,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);return _0x7c1660(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}else{logger['info'](_0xf4f2('0xd'),_0x478723,_0xf4f2('0x12'));_0x7c1660(_0x53dc4e[_0xf4f2('0x13')][_0xf4f2('0x11')]);}})[_0xf4f2('0x14')](function(_0x545b43){logger[_0xf4f2('0xf')]('SmsApplication,\x20%s,\x20%s',_0x478723,_0x545b43);_0xe39952(_0x545b43);});});} \ No newline at end of file +var _0x6b47=['client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a28ca,_0xedd450){var _0x1156eb=function(_0x39064b){while(--_0x39064b){_0x1a28ca['push'](_0x1a28ca['shift']());}};_0x1156eb(++_0xedd450);}(_0x6b47,0xe9));var _0x76b4=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x6b47[_0x99ff94];return _0x1b5bc0;};'use strict';var _=require('lodash');var util=require(_0x76b4('0x0'));var moment=require('moment');var BPromise=require(_0x76b4('0x1'));var rs=require(_0x76b4('0x2'));var fs=require('fs');var Redis=require(_0x76b4('0x3'));var db=require(_0x76b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x76b4('0x5'))(_0x76b4('0x6'));var config=require(_0x76b4('0x7'));var jayson=require(_0x76b4('0x8'));var client=jayson[_0x76b4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461190,_0x2a0690,_0x6b3a2e){return new BPromise(function(_0x14e933,_0x220044){return client[_0x76b4('0xa')](_0x461190,_0x6b3a2e)[_0x76b4('0xb')](function(_0x127be2){logger[_0x76b4('0xc')](_0x76b4('0xd'),_0x2a0690,_0x76b4('0xe'));logger[_0x76b4('0xf')](_0x76b4('0x10'),_0x2a0690,'request\x20sent',JSON[_0x76b4('0x11')](_0x127be2));if(_0x127be2[_0x76b4('0x12')]){if(_0x127be2['error'][_0x76b4('0x13')]===0x1f4){logger[_0x76b4('0x12')](_0x76b4('0xd'),_0x2a0690,_0x127be2['error']['message']);return _0x220044(_0x127be2[_0x76b4('0x12')][_0x76b4('0x14')]);}logger[_0x76b4('0x12')](_0x76b4('0xd'),_0x2a0690,_0x127be2[_0x76b4('0x12')][_0x76b4('0x14')]);return _0x14e933(_0x127be2[_0x76b4('0x12')][_0x76b4('0x14')]);}else{logger[_0x76b4('0xc')](_0x76b4('0xd'),_0x2a0690,'request\x20sent');_0x14e933(_0x127be2['result'][_0x76b4('0x14')]);}})[_0x76b4('0x15')](function(_0x5f39fc){logger['error'](_0x76b4('0xd'),_0x2a0690,_0x5f39fc);_0x220044(_0x5f39fc);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 3e4d5fa..f584f2d 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 _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x292fad,_0x1d6137){var _0xd9c5e4=function(_0x73b81b){while(--_0x73b81b){_0x292fad['push'](_0x292fad['shift']());}};_0xd9c5e4(++_0x1d6137);}(_0x3c81,0x102));var _0x13c8=function(_0x5261c3,_0x26cbad){_0x5261c3=_0x5261c3-0x0;var _0x4fa8fa=_0x3c81[_0x5261c3];return _0x4fa8fa;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('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(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file +var _0xed3c=['sms','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x69c7e3,_0x1bf0bf){var _0x39f03a=function(_0x2f48d6){while(--_0x2f48d6){_0x69c7e3['push'](_0x69c7e3['shift']());}};_0x39f03a(++_0x1bf0bf);}(_0xed3c,0x1a6));var _0xced3=function(_0x2d5a8e,_0x333734){_0x2d5a8e=_0x2d5a8e-0x0;var _0x3d97f8=_0xed3c[_0x2d5a8e];return _0x3d97f8;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xc')]);router[_0xced3('0x8')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router['get'](_0xced3('0xf'),auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);router['post']('/',auth[_0xced3('0x9')](),controller[_0xced3('0x11')]);router[_0xced3('0x12')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0x13')]);router[_0xced3('0x12')]('/:id/tags',auth[_0xced3('0x9')](),interaction['tracked'](_0xced3('0x14'),_0xced3('0x15')),controller[_0xced3('0x16')]);router[_0xced3('0x17')]('/:id',auth[_0xced3('0x9')](),interaction[_0xced3('0x18')]('sms',_0xced3('0x19')),controller[_0xced3('0x1a')]);router[_0xced3('0x1b')](_0xced3('0x1c'),auth['isAuthenticated'](),interaction[_0xced3('0x18')]('sms',_0xced3('0x1d')),controller[_0xced3('0x1e')]);router[_0xced3('0x1b')](_0xced3('0x1f'),auth[_0xced3('0x9')](),controller[_0xced3('0x20')]);module[_0xced3('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 9dc7441..6621459 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 _0x482d=['BOOLEAN','DATE','STRING','ENUM','exports'];(function(_0x39eca7,_0x233844){var _0x1ff97e=function(_0x2b0933){while(--_0x2b0933){_0x39eca7['push'](_0x39eca7['shift']());}};_0x1ff97e(++_0x233844);}(_0x482d,0x16c));var _0xd482=function(_0x45f228,_0x148f80){_0x45f228=_0x45f228-0x0;var _0x329fa7=_0x482d[_0x45f228];return _0x329fa7;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd482('0x0')]={'closed':{'type':Sequelize[_0xd482('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd482('0x2')]},'disposition':{'type':Sequelize[_0xd482('0x3')]},'secondDisposition':{'type':Sequelize[_0xd482('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd482('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd482('0x3')]},'read1stAt':{'type':Sequelize[_0xd482('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd482('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd482('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbe3b=['exports','DATE','STRING','ENUM','out','BOOLEAN','moment'];(function(_0x4efe69,_0x4f3b80){var _0x1c3ae1=function(_0x5c4838){while(--_0x5c4838){_0x4efe69['push'](_0x4efe69['shift']());}};_0x1c3ae1(++_0x4f3b80);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0xbe3b[_0x4c16c4];return _0x2d2ddf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbbe3('0x0'));module[_0xbbe3('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbbe3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbbe3('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbbe3('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbbe3('0x4')]('in',_0xbbe3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbbe3('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbbe3('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbbe3('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3a83cad..7b03cc1 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 _0xfb09=['nolimit','offset','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','start','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','keyBy','merge','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','toString','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','pick','format','addTags','setTags','findAll','emit','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Owner','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','renderFile','views','downloadInteraction.ejs','.pdf','Sms','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsInteraction.socket','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','SmsInteraction','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0x5ddfd0,_0x69ab90){var _0x3d66f4=function(_0x4a233c){while(--_0x4a233c){_0x5ddfd0['push'](_0x5ddfd0['shift']());}};_0x3d66f4(++_0x69ab90);}(_0xfb09,0xa3));var _0x9fb0=function(_0x28b7ce,_0x28082f){_0x28b7ce=_0x28b7ce-0x0;var _0x533680=_0xfb09[_0x28b7ce];return _0x533680;};'use strict';var emlformat=require(_0x9fb0('0x0'));var rimraf=require(_0x9fb0('0x1'));var zipdir=require(_0x9fb0('0x2'));var jsonpatch=require(_0x9fb0('0x3'));var rp=require(_0x9fb0('0x4'));var moment=require(_0x9fb0('0x5'));var BPromise=require(_0x9fb0('0x6'));var Mustache=require(_0x9fb0('0x7'));var util=require(_0x9fb0('0x8'));var path=require(_0x9fb0('0x9'));var sox=require(_0x9fb0('0xa'));var csv=require(_0x9fb0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fb0('0xc'));var _=require(_0x9fb0('0xd'));var squel=require('squel');var crypto=require(_0x9fb0('0xe'));var jsforce=require(_0x9fb0('0xf'));var deskjs=require(_0x9fb0('0x10'));var toCsv=require(_0x9fb0('0xb'));var querystring=require(_0x9fb0('0x11'));var Papa=require(_0x9fb0('0x12'));var Redis=require(_0x9fb0('0x13'));var authService=require(_0x9fb0('0x14'));var qs=require(_0x9fb0('0x15'));var as=require(_0x9fb0('0x16'));var pdf=require(_0x9fb0('0x17'));var hardwareService=require(_0x9fb0('0x18'));var logger=require(_0x9fb0('0x19'))('api');var utils=require(_0x9fb0('0x1a'));var config=require(_0x9fb0('0x1b'));var licenseUtil=require(_0x9fb0('0x1c'));var db=require(_0x9fb0('0x1d'))['db'];config[_0x9fb0('0x1e')]=_['defaults'](config[_0x9fb0('0x1e')],{'host':_0x9fb0('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fb0('0x1e')]));require(_0x9fb0('0x20'))['register'](socket);function respondWithStatusCode(_0x3b160d,_0x454ed4){_0x454ed4=_0x454ed4||0xcc;return function(_0x41c707){if(_0x41c707){return _0x3b160d[_0x9fb0('0x21')](_0x454ed4);}return _0x3b160d[_0x9fb0('0x22')](_0x454ed4)['end']();};}function respondWithResult(_0x16121e,_0x28547c){_0x28547c=_0x28547c||0xc8;return function(_0x36ce6a){if(_0x36ce6a){return _0x16121e[_0x9fb0('0x22')](_0x28547c)[_0x9fb0('0x23')](_0x36ce6a);}};}function respondWithFilteredResult(_0x27e266,_0x2a3aa0){return function(_0x341d92){if(_0x341d92){var _0x1a52a8=typeof _0x2a3aa0['offset']===_0x9fb0('0x24')&&typeof _0x2a3aa0['limit']===_0x9fb0('0x24');var _0x5c329b=_0x341d92[_0x9fb0('0x25')];var _0x58f061=_0x1a52a8?0x0:_0x2a3aa0['offset'];var _0x379c73=_0x1a52a8?_0x341d92[_0x9fb0('0x25')]:_0x2a3aa0['offset']+_0x2a3aa0[_0x9fb0('0x26')];var _0x3e9f03;if(_0x379c73>=_0x5c329b){_0x379c73=_0x5c329b;_0x3e9f03=0xc8;}else{_0x3e9f03=0xce;}_0x27e266[_0x9fb0('0x22')](_0x3e9f03);return _0x27e266[_0x9fb0('0x27')](_0x9fb0('0x28'),_0x58f061+'-'+_0x379c73+'/'+_0x5c329b)['json'](_0x341d92);}return null;};}function patchUpdates(_0x2684d0){return function(_0x493df){try{jsonpatch[_0x9fb0('0x29')](_0x493df,_0x2684d0,!![]);}catch(_0x5f010e){return BPromise[_0x9fb0('0x2a')](_0x5f010e);}return _0x493df[_0x9fb0('0x2b')]();};}function saveUpdates(_0xe9e8d6,_0x32af33){return function(_0x55194f){if(_0x55194f){return _0x55194f[_0x9fb0('0x2c')](_0xe9e8d6)[_0x9fb0('0x2d')](function(_0x1397e3){return _0x1397e3;});}return null;};}function removeEntity(_0x35e907,_0x37aa9f){return function(_0x17cff4){if(_0x17cff4){return _0x17cff4['destroy']()['then'](function(){_0x35e907[_0x9fb0('0x22')](0xcc)[_0x9fb0('0x2e')]();});}};}function handleEntityNotFound(_0x47ebb1,_0x18363f){return function(_0x32f0cb){if(!_0x32f0cb){_0x47ebb1['sendStatus'](0x194);}return _0x32f0cb;};}function handleError(_0x1c0416,_0x454cea){_0x454cea=_0x454cea||0x1f4;return function(_0x110fac){logger['error'](_0x110fac['stack']);if(_0x110fac[_0x9fb0('0x2f')]){delete _0x110fac[_0x9fb0('0x2f')];}_0x1c0416['status'](_0x454cea)[_0x9fb0('0x30')](_0x110fac);};}function getInteractionUsers(_0x303f33,_0xeb7a37){return new BPromise(function(_0xc495ae,_0x4216bb){try{if(_0xeb7a37[_0x303f33['id']]){_0x303f33[_0x9fb0('0x31')]=_[_0x9fb0('0x32')](_0xeb7a37[_0x303f33['id']],function(_0xe6d03f){return{'id':_0xe6d03f['id'],'fullname':_0xe6d03f[_0x9fb0('0x33')]};});}}catch(_0x196571){_0x4216bb(_0x196571);}_0xc495ae(_0x303f33);});}function getInteractionTags(_0x491f92,_0x518dd1){return new BPromise(function(_0x1e567b,_0x19ca99){try{if(_0x491f92[_0x9fb0('0x34')]){_0x491f92[_0x9fb0('0x35')]=[];_0x491f92[_0x9fb0('0x34')][_0x9fb0('0x36')](',')[_0x9fb0('0x37')](function(_0x936552){_0x491f92[_0x9fb0('0x35')][_0x9fb0('0x38')](_0x518dd1[_0x936552]);});}delete _0x491f92['TagIds'];}catch(_0x312f37){_0x19ca99(_0x312f37);}_0x1e567b(_0x491f92);});}function updateSmsInteraction(_0x17ee0e,_0x2562cf,_0x48a442){return new BPromise(function(_0x4be4bc,_0x690e19){return getInteractionUsers(_0x17ee0e,_0x48a442)['then'](function(_0x12c9dd){return getInteractionTags(_0x12c9dd,_0x2562cf);})['then'](function(_0x3daac0){return getStateInteraction(_0x3daac0);})[_0x9fb0('0x2d')](function(_0x219f91){_0x4be4bc(_0x219f91);})[_0x9fb0('0x39')](function(_0xd42ea3){_0x690e19(_0xd42ea3);});});}function getStateInteraction(_0x5345ca){return new BPromise(function(_0x3f5b6a){_0x5345ca[_0x9fb0('0x3a')]=0x0;_0x5345ca[_0x9fb0('0x3b')]=0x0;_0x5345ca['answered']=0x0;_0x5345ca[_0x9fb0('0x3c')]=0x0;_0x5345ca[_0x9fb0('0x3d')]=0x0;if(!_0x5345ca[_0x9fb0('0x3e')]&&!_0x5345ca[_0x9fb0('0x3f')]){_0x5345ca[_0x9fb0('0x3a')]+=0x1;}if(!_0x5345ca[_0x9fb0('0x3e')]&&_0x5345ca['UserId']){_0x5345ca['talking']+=0x1;if(_0x5345ca[_0x9fb0('0x3a')]){_0x5345ca[_0x9fb0('0x3a')]-=0x1;}}if(_0x5345ca['closed']&&_0x5345ca[_0x9fb0('0x3f')]){_0x5345ca[_0x9fb0('0x40')]+=0x1;if(_0x5345ca[_0x9fb0('0x3b')]){_0x5345ca[_0x9fb0('0x3b')]-=0x1;}}if(_0x5345ca[_0x9fb0('0x3e')]&&!_0x5345ca[_0x9fb0('0x3f')]){_0x5345ca[_0x9fb0('0x3c')]+=0x1;if(_0x5345ca[_0x9fb0('0x3a')]){_0x5345ca['waiting']-=0x1;}}_0x5345ca['total']+=0x1;_0x3f5b6a(_0x5345ca);});}exports[_0x9fb0('0x41')]=function(_0x19fa28,_0x4658f4){var _0x40d2e8={},_0x27ef87={},_0x4fd3bb={'count':0x0,'rows':[]};var _0x51eb17=_['map'](db[_0x9fb0('0x42')]['rawAttributes'],function(_0x5cbc42){return{'name':_0x5cbc42['fieldName'],'type':_0x5cbc42[_0x9fb0('0x43')][_0x9fb0('0x44')]};});_0x27ef87[_0x9fb0('0x45')]=_[_0x9fb0('0x32')](_0x51eb17,_0x9fb0('0x2f'));_0x27ef87[_0x9fb0('0x46')]=_[_0x9fb0('0x47')](_0x19fa28[_0x9fb0('0x46')]);_0x27ef87[_0x9fb0('0x48')]=_['intersection'](_0x27ef87[_0x9fb0('0x45')],_0x27ef87[_0x9fb0('0x46')]);_0x40d2e8[_0x9fb0('0x49')]=_[_0x9fb0('0x4a')](_0x27ef87[_0x9fb0('0x45')],qs[_0x9fb0('0x4b')](_0x19fa28[_0x9fb0('0x46')]['fields']));_0x40d2e8['attributes']=_0x40d2e8['attributes']['length']?_0x40d2e8[_0x9fb0('0x49')]:_0x27ef87['model'];if(!_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x4c')](_0x9fb0('0x4d'))){_0x40d2e8['limit']=qs[_0x9fb0('0x26')](_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x26')]);_0x40d2e8['offset']=qs['offset'](_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x4e')]);}_0x40d2e8[_0x9fb0('0x4f')]=qs[_0x9fb0('0x50')](_0x19fa28[_0x9fb0('0x46')]['sort']);_0x40d2e8[_0x9fb0('0x51')]=qs[_0x9fb0('0x48')](_['pick'](_0x19fa28[_0x9fb0('0x46')],_0x27ef87['filters']),_0x51eb17);var _0x133ee9=[];var _0x3e4a67=squel[_0x9fb0('0x52')]()[_0x9fb0('0x53')]('id')['field']('name')[_0x9fb0('0x53')](_0x9fb0('0x54'))[_0x9fb0('0x55')](_0x9fb0('0x56'));var _0x501733=squel['select']()[_0x9fb0('0x53')](_0x9fb0('0x57'))[_0x9fb0('0x53')](_0x9fb0('0x58'))[_0x9fb0('0x53')](_0x9fb0('0x59'))['from'](_0x9fb0('0x5a'),'ui')[_0x9fb0('0x5b')]('users','u',_0x9fb0('0x5c'));var _0x5622a1=squel[_0x9fb0('0x52')]()['from']('sms_interactions','i')['left_join'](_0x9fb0('0x5d'),'c',_0x9fb0('0x5e'))['left_join'](_0x9fb0('0x5f'),'o',_0x9fb0('0x60'))['left_join']('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x9fb0('0x5b')](_0x9fb0('0x61'),'me',_0x9fb0('0x62'))['left_join'](_0x9fb0('0x63'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x9fb0('0x56'),'t','t.id\x20=\x20it.TagId');var _0x50c9cd=squel[_0x9fb0('0x64')]();var _0x3e30c2=[];var _0x4e3142=squel[_0x9fb0('0x64')]();var _0x45a02a;if(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x65')]){_0x45a02a=as[_0x9fb0('0x66')](_0x19fa28['query']['search']);var _0x22edf0=_0x45a02a[_0x9fb0('0x67')];for(var _0x2924ac=0x0;_0x2924ac<_0x45a02a[_0x9fb0('0x68')][_0x9fb0('0x69')];_0x2924ac++){var _0x40fc9d=_0x45a02a['conditions'][_0x2924ac];var _0x1c177d='i';var _0xb19cbd=_[_0x9fb0('0x6a')](_0x51eb17,[_0x9fb0('0x2f'),_0x40fc9d['field']]);if(!_0xb19cbd){switch(_0x40fc9d[_0x9fb0('0x53')]){case'unreadMessages':if(_0x40fc9d['value']==0x1){_0x5622a1['having']('`'+_0x40fc9d[_0x9fb0('0x53')]+_0x9fb0('0x6b'));}else{_0x5622a1[_0x9fb0('0x6c')]('`'+_0x40fc9d[_0x9fb0('0x53')]+_0x9fb0('0x6d'));}break;case _0x9fb0('0x6e'):if(_0x40fc9d[_0x9fb0('0x6f')]===_0x9fb0('0x70')){if(_0x40fc9d[_0x9fb0('0x71')]['split']('\x20')[_0x9fb0('0x69')]>0x1){_0x50c9cd[_0x22edf0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9fb0('0x72')](_0x40fc9d[_0x9fb0('0x71')]),null);}else{var _0x4c7aab='%'+_0x40fc9d[_0x9fb0('0x71')]+'%';_0x50c9cd[_0x22edf0](_0x9fb0('0x73'),_0x4c7aab,_0x4c7aab,_0x4c7aab);}}else{_0xb19cbd=_[_0x9fb0('0x6a')](_0x51eb17,[_0x9fb0('0x2f'),_0x9fb0('0x74')]);_0x40fc9d[_0x9fb0('0x53')]=_0x9fb0('0x74');_0x1de1a6=as[_0x9fb0('0x75')](_0x1c177d,_0xb19cbd[_0x9fb0('0x43')],_0x40fc9d);_0x50c9cd[_0x22edf0](_0x1de1a6['text'],_0x1de1a6['value']['start'],_0x1de1a6['value'][_0x9fb0('0x2e')]);}break;case _0x9fb0('0x76'):var _0x5b1fca=_0x40fc9d[_0x9fb0('0x71')]['split'](',')['map'](function(_0x15e3b8){return Number(_0x15e3b8);});_0x5b1fca[_0x9fb0('0x37')](function(_0x4849eb){_0x4e3142['or'](_0x9fb0('0x77'),'%,'+_0x4849eb+',%');});_0x3e30c2=_[_0x9fb0('0x78')](_0x3e30c2,_0x5b1fca);break;case _0x9fb0('0x79'):if(_0x40fc9d[_0x9fb0('0x6f')]===_0x9fb0('0x70')){_0x50c9cd[_0x22edf0](_0x9fb0('0x7a'),'%'+_0x40fc9d[_0x9fb0('0x71')]+'%',null);}else{_0xb19cbd=_[_0x9fb0('0x6a')](_0x51eb17,[_0x9fb0('0x2f'),_0x9fb0('0x3f')]);_0x40fc9d[_0x9fb0('0x53')]=_0x9fb0('0x3f');_0x1de1a6=as[_0x9fb0('0x75')](_0x1c177d,_0xb19cbd['type'],_0x40fc9d);_0x50c9cd[_0x22edf0](_0x1de1a6[_0x9fb0('0x7b')],_0x1de1a6[_0x9fb0('0x71')]['start'],_0x1de1a6[_0x9fb0('0x71')][_0x9fb0('0x2e')]);}break;case _0x9fb0('0x7c'):_0x1de1a6=as[_0x9fb0('0x75')]('me',null,_0x40fc9d);_0x50c9cd[_0x22edf0](_0x1de1a6[_0x9fb0('0x7b')],_0x1de1a6[_0x9fb0('0x71')][_0x9fb0('0x7d')],_0x1de1a6[_0x9fb0('0x71')]['end']);break;}}else{var _0x1de1a6=as[_0x9fb0('0x75')](_0x1c177d,_0xb19cbd[_0x9fb0('0x43')],_0x40fc9d);_0x50c9cd[_0x22edf0](_0x1de1a6[_0x9fb0('0x7b')],_0x1de1a6[_0x9fb0('0x71')][_0x9fb0('0x7d')],_0x1de1a6[_0x9fb0('0x71')]['end']);}}}else{var _0x3b6148=_(_0x19fa28['query'])['keys']()['map'](function(_0x2b60a0){return _['some'](_0x51eb17,[_0x9fb0('0x2f'),_0x2b60a0])?_0x2b60a0:undefined;})[_0x9fb0('0x7e')]()[_0x9fb0('0x71')]();if(!_[_0x9fb0('0x7f')](_0x3b6148)){_0x3b6148['forEach'](function(_0x4bea51){if(_0x4bea51===_0x9fb0('0x80')){_0x5622a1[_0x9fb0('0x51')](_0x9fb0('0x81'),[][_0x9fb0('0x82')](_0x19fa28['query'][_0x4bea51]));}else if(_0x4bea51==='createdAt'){var _0x28c489=JSON[_0x9fb0('0x83')](_0x19fa28['query'][_0x4bea51])[_0x9fb0('0x84')];var _0x5a6e45=JSON['parse'](_0x19fa28[_0x9fb0('0x46')][_0x4bea51])[_0x9fb0('0x85')];_0x5622a1[_0x9fb0('0x51')](_0x9fb0('0x86'),_0x28c489,_0x5a6e45);}else{if(_0x19fa28['query'][_0x4bea51]===_0x9fb0('0x87')){_0x5622a1['where']('i.'+_0x4bea51+'\x20IS\x20NULL');}else{_0x5622a1[_0x9fb0('0x51')]('i.'+_0x4bea51+_0x9fb0('0x88'),_0x19fa28[_0x9fb0('0x46')][_0x4bea51]);}}});}if(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x89')]){if(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x89')]==0x1){_0x5622a1[_0x9fb0('0x6c')](_0x9fb0('0x8a'));}else{_0x5622a1[_0x9fb0('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x19fa28[_0x9fb0('0x46')]['tag']){_0x3e30c2=_[_0x9fb0('0x8b')](_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x8c')])?_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x8c')]:new Array(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x8c')]);_0x3e30c2['forEach'](function(_0x4ea299){_0x4e3142['or'](_0x9fb0('0x77'),'%,'+_0x4ea299+',%');});}if(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x8d')]){var _0x56cb99=_0x19fa28[_0x9fb0('0x46')]['filter'][_0x9fb0('0x8e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9fb0('0x8f')](_0x56cb99)){_0x50c9cd['or'](_0x9fb0('0x90'),_0x56cb99+'%')['or'](_0x9fb0('0x91'),_0x56cb99+'%');}else{_0x50c9cd['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9fb0('0x72')](_0x56cb99))['or'](_0x9fb0('0x92'),_0x56cb99+'%');}}}_0x5622a1['where'](_0x50c9cd);_0x5622a1[_0x9fb0('0x93')]('i.id');var _0xd9bc6b={'type':db[_0x9fb0('0x94')]['QueryTypes'][_0x9fb0('0x95')],'raw':!![]};var _0x4110ed=_0x5622a1[_0x9fb0('0x96')]();_0x4110ed[_0x9fb0('0x53')](_0x9fb0('0x97'));_0x4110ed['field'](_0x9fb0('0x98'),_0x9fb0('0x99'));if(_0x40d2e8[_0x9fb0('0x4f')]){_0x40d2e8[_0x9fb0('0x4f')][_0x9fb0('0x37')](function(_0x177cd6){var _0x1d1df5=_0x177cd6[0x0]===_0x9fb0('0x9a')?_0x177cd6[0x0]:'i.'+_0x177cd6[0x0];_0x5622a1[_0x9fb0('0x4f')](_0x1d1df5,_0x177cd6[0x1]===_0x9fb0('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x3e30c2)){_0x5622a1[_0x9fb0('0x6c')](_0x4e3142);_0x4110ed['where'](_0x9fb0('0x9c'),_0x3e30c2);}BPromise[_0x9fb0('0x9d')]()[_0x9fb0('0x2d')](function(){if(!_0x45a02a){if(_0x19fa28[_0x9fb0('0x46')]['SmsAccountId'])return;_0x4110ed[_0x9fb0('0x51')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5622a1[_0x9fb0('0x51')](_0x9fb0('0x9e'));return;}if(_0x19fa28[_0x9fb0('0x9f')][_0x9fb0('0xa0')]!=='agent')return;return _0x19fa28['user'][_0x9fb0('0xa1')]({'attributes':['id'],'raw':!![]})[_0x9fb0('0x2d')](function(_0x34689f){if(_[_0x9fb0('0x7f')](_0x34689f)){_0x4110ed[_0x9fb0('0x51')](_0x9fb0('0xa2'));_0x5622a1[_0x9fb0('0x51')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x4110ed[_0x9fb0('0x51')](_0x9fb0('0x81'),_['map'](_0x34689f,'id'));_0x5622a1[_0x9fb0('0x51')](_0x9fb0('0x81'),_[_0x9fb0('0x32')](_0x34689f,'id'));}});})['then'](function(){if(_0x19fa28['user'][_0x9fb0('0xa0')]==='agent'&&!_0x45a02a&&!_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x80')])return[];return db['sequelize']['query'](_0x4110ed['toString'](),_0xd9bc6b);})[_0x9fb0('0x2d')](function(_0x5581b2){_0x4fd3bb[_0x9fb0('0x25')]=_0x5581b2[_0x9fb0('0x69')];if(_0x4fd3bb[_0x9fb0('0x25')]===0x0)return[];return db[_0x9fb0('0xa3')]['query'](_0x3e4a67['toString'](),_0xd9bc6b)[_0x9fb0('0x2d')](function(_0x2e02da){_0x133ee9=_[_0x9fb0('0xa4')](_0x2e02da,'id');_0xd9bc6b=_[_0x9fb0('0xa5')](_0xd9bc6b,{'model':db[_0x9fb0('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fa28[_0x9fb0('0x46')][_0x9fb0('0x4b')]){_0x40d2e8['attributes'][_0x9fb0('0x37')](function(_0xcd8580){_0x5622a1['field']('i.'+_0xcd8580);});}else{_0x5622a1[_0x9fb0('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9fb0('0x99'));_0x5622a1[_0x9fb0('0x53')]('a.key',_0x9fb0('0xa6'));_0x5622a1[_0x9fb0('0x53')]('a.mandatoryDisposition',_0x9fb0('0xa7'));_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xa8'),'contactName');_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xa9'));_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xaa'),_0x9fb0('0xab'));_0x5622a1[_0x9fb0('0x53')]('c.lastName',_0x9fb0('0xac'));_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xad'),_0x9fb0('0xae'));_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xaf'),'Contact.phone');_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xb0'),_0x9fb0('0xb1'));_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xb2'),_0x9fb0('0xb3'));_0x5622a1[_0x9fb0('0x53')]('o.fullname','Owner.fullname');_0x5622a1[_0x9fb0('0x53')](_0x9fb0('0xb4'),_0x9fb0('0xb5'));_0x5622a1['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9fb0('0x34'));}if(_0x40d2e8['limit'])_0x5622a1[_0x9fb0('0x26')](_0x40d2e8[_0x9fb0('0x26')]);if(_0x40d2e8[_0x9fb0('0x4e')])_0x5622a1[_0x9fb0('0x4e')](_0x40d2e8[_0x9fb0('0x4e')]);return db['sequelize'][_0x9fb0('0x46')](_0x5622a1[_0x9fb0('0xb6')](),_0xd9bc6b);})[_0x9fb0('0x2d')](function(_0x57b617){if(_0x57b617['length']>0x0)_0x501733[_0x9fb0('0x51')](_0x9fb0('0xb7'),_['map'](_0x57b617,'id'));return db[_0x9fb0('0xa3')][_0x9fb0('0x46')](_0x501733[_0x9fb0('0xb6')](),_0xd9bc6b)[_0x9fb0('0x2d')](function(_0x34b303){var _0x2543af=_['groupBy'](_0x34b303,_0x9fb0('0xb8'));var _0x1bb131=[];_0x57b617['forEach'](function(_0x246ebf){_0x1bb131['push'](updateSmsInteraction(_0x246ebf,_0x133ee9,_0x2543af));});return BPromise[_0x9fb0('0xb9')](_0x1bb131);});});})[_0x9fb0('0x2d')](function(_0x4f109d){_0x4fd3bb[_0x9fb0('0xba')]=_0x4f109d;return _0x4fd3bb;})['then'](respondWithFilteredResult(_0x4658f4,_0x40d2e8))[_0x9fb0('0x39')](handleError(_0x4658f4,null));};exports[_0x9fb0('0xbb')]=function(_0x23a20f,_0x592b07){var _0x3a5483={'raw':![],'where':{'id':_0x23a20f[_0x9fb0('0xbc')]['id']}},_0x303662={};_0x303662[_0x9fb0('0x45')]=_[_0x9fb0('0x47')](db[_0x9fb0('0x42')][_0x9fb0('0xbd')]);_0x303662['query']=_[_0x9fb0('0x47')](_0x23a20f[_0x9fb0('0x46')]);_0x303662[_0x9fb0('0x48')]=_[_0x9fb0('0x4a')](_0x303662[_0x9fb0('0x45')],_0x303662['query']);_0x3a5483[_0x9fb0('0x49')]=_[_0x9fb0('0x4a')](_0x303662[_0x9fb0('0x45')],qs[_0x9fb0('0x4b')](_0x23a20f['query'][_0x9fb0('0x4b')]));_0x3a5483['attributes']=_0x3a5483[_0x9fb0('0x49')]['length']?_0x3a5483[_0x9fb0('0x49')]:_0x303662[_0x9fb0('0x45')];if(_0x23a20f[_0x9fb0('0x46')][_0x9fb0('0xbe')]){_0x3a5483[_0x9fb0('0xbf')]=[{'all':!![]}];}_0x3a5483=_['merge']({},_0x3a5483,_0x23a20f[_0x9fb0('0xc0')]);return db[_0x9fb0('0x42')]['find'](_0x3a5483)[_0x9fb0('0x2d')](handleEntityNotFound(_0x592b07,null))['then'](respondWithResult(_0x592b07,null))[_0x9fb0('0x39')](handleError(_0x592b07,null));};exports[_0x9fb0('0xc1')]=function(_0x3baf1b,_0x31e11f){return db[_0x9fb0('0x42')][_0x9fb0('0xc1')](_0x3baf1b['body'],{})[_0x9fb0('0x2d')](respondWithResult(_0x31e11f,0xc9))[_0x9fb0('0x39')](handleError(_0x31e11f,null));};exports[_0x9fb0('0x2c')]=function(_0x2783cb,_0x382a30){if(_0x2783cb[_0x9fb0('0x7c')]['id']){delete _0x2783cb['body']['id'];}return db['SmsInteraction'][_0x9fb0('0x6a')]({'where':{'id':_0x2783cb[_0x9fb0('0xbc')]['id']}})[_0x9fb0('0x2d')](handleEntityNotFound(_0x382a30,null))[_0x9fb0('0x2d')](saveUpdates(_0x2783cb[_0x9fb0('0x7c')],null))[_0x9fb0('0x2d')](respondWithResult(_0x382a30,null))['catch'](handleError(_0x382a30,null));};exports['destroy']=function(_0x214b4e,_0x58c842){return db[_0x9fb0('0x42')]['find']({'where':{'id':_0x214b4e['params']['id']}})[_0x9fb0('0x2d')](handleEntityNotFound(_0x58c842,null))[_0x9fb0('0x2d')](removeEntity(_0x58c842,null))[_0x9fb0('0x39')](handleError(_0x58c842,null));};exports[_0x9fb0('0xc2')]=function(_0x9c2fb4,_0x5c9d30){return db[_0x9fb0('0x42')][_0x9fb0('0xc2')]()[_0x9fb0('0x2d')](respondWithResult(_0x5c9d30,null))[_0x9fb0('0x39')](handleError(_0x5c9d30,null));};exports[_0x9fb0('0xc3')]=function(_0x18d4d6,_0x8bdb9b,_0x396516){return db[_0x9fb0('0xc4')]['find']({'where':{'id':_0x18d4d6['params']['id']}})['then'](handleEntityNotFound(_0x8bdb9b,null))[_0x9fb0('0x2d')](function(_0x4a1ea8){if(_0x4a1ea8){return _0x4a1ea8[_0x9fb0('0xc3')](_0x18d4d6[_0x9fb0('0x7c')]['ids'],_[_0x9fb0('0xc5')](_0x18d4d6['body'],[_0x9fb0('0xc6'),'id'])||{});}})[_0x9fb0('0x2d')](respondWithResult(_0x8bdb9b,null))[_0x9fb0('0x39')](handleError(_0x8bdb9b,null));};exports[_0x9fb0('0xc7')]=function(_0x276667,_0x3d504b,_0x24b92a){var _0x183638={'raw':![],'where':{}};var _0x3a0e18={};var _0x3ebfa5={'count':0x0,'rows':[]};return db[_0x9fb0('0x42')][_0x9fb0('0xc8')]({'where':{'id':_0x276667['params']['id']}})[_0x9fb0('0x2d')](handleEntityNotFound(_0x3d504b,null))[_0x9fb0('0x2d')](function(_0x5a498c){if(_0x5a498c){_0x3a0e18['model']=_[_0x9fb0('0x47')](db['SmsMessage'][_0x9fb0('0xbd')]);_0x3a0e18[_0x9fb0('0x46')]=_['keys'](_0x276667[_0x9fb0('0x46')]);_0x3a0e18[_0x9fb0('0x48')]=_[_0x9fb0('0x4a')](_0x3a0e18['model'],_0x3a0e18[_0x9fb0('0x46')]);_0x183638[_0x9fb0('0x49')]=_[_0x9fb0('0x4a')](_0x3a0e18[_0x9fb0('0x45')],qs[_0x9fb0('0x4b')](_0x276667[_0x9fb0('0x46')]['fields']));_0x183638[_0x9fb0('0x49')]=_0x183638['attributes'][_0x9fb0('0x69')]?_0x183638[_0x9fb0('0x49')]:_0x3a0e18['model'];if(!_0x276667['query'][_0x9fb0('0x4c')](_0x9fb0('0x4d'))){_0x183638['limit']=qs[_0x9fb0('0x26')](_0x276667[_0x9fb0('0x46')]['limit']);_0x183638['offset']=qs[_0x9fb0('0x4e')](_0x276667['query'][_0x9fb0('0x4e')]);}_0x183638['order']=qs[_0x9fb0('0x50')](_0x276667[_0x9fb0('0x46')][_0x9fb0('0x50')]);_0x183638[_0x9fb0('0x51')]=qs[_0x9fb0('0x48')](_[_0x9fb0('0xc9')](_0x276667[_0x9fb0('0x46')],_0x3a0e18[_0x9fb0('0x48')]));_0x183638[_0x9fb0('0x51')][_0x9fb0('0xb8')]=_0x5a498c['id'];if(_0x276667[_0x9fb0('0x46')][_0x9fb0('0x8d')]){_0x183638[_0x9fb0('0x51')]=_['merge'](_0x183638[_0x9fb0('0x51')],{'$or':_['map'](_0x183638[_0x9fb0('0x49')],function(_0x3dc3c1){var _0x2556ac={};_0x2556ac[_0x3dc3c1]={'$like':'%'+_0x276667[_0x9fb0('0x46')][_0x9fb0('0x8d')]+'%'};return _0x2556ac;})});}if(_0x276667[_0x9fb0('0x46')][_0x9fb0('0x84')]){var _0x2a64ec=_0x276667[_0x9fb0('0x46')]['$gte'][_0x9fb0('0x36')](',');var _0x48e1c3={};_0x48e1c3[_0x2a64ec[0x0]]={'$gte':moment(_0x2a64ec[0x1])[_0x9fb0('0xca')]('YYYY-MM-DD\x20HH:mm:ss')};_0x183638[_0x9fb0('0x51')]=_[_0x9fb0('0xa5')](_0x183638[_0x9fb0('0x51')],_0x48e1c3);}_0x183638=_[_0x9fb0('0xa5')]({},_0x183638,_0x276667[_0x9fb0('0xc0')]);return db[_0x9fb0('0xc4')]['count']({'where':_0x183638[_0x9fb0('0x51')]})[_0x9fb0('0x2d')](function(_0x47df17){_0x3ebfa5['count']=_0x47df17;if(_0x276667[_0x9fb0('0x46')][_0x9fb0('0xbe')]){_0x183638[_0x9fb0('0xbf')]=[{'all':!![]}];}return db[_0x9fb0('0xc4')]['findAll'](_0x183638);})[_0x9fb0('0x2d')](function(_0x4ea9e8){_0x3ebfa5[_0x9fb0('0xba')]=_0x4ea9e8;return _0x3ebfa5;});}})['then'](respondWithFilteredResult(_0x3d504b,_0x183638))[_0x9fb0('0x39')](handleError(_0x3d504b,null));};exports[_0x9fb0('0xcb')]=function(_0x54e1a2,_0x2be52d,_0x5786b8){return db[_0x9fb0('0x42')][_0x9fb0('0x6a')]({'where':{'id':_0x54e1a2['params']['id']}})[_0x9fb0('0x2d')](handleEntityNotFound(_0x2be52d,null))['then'](function(_0x135d7b){if(_0x135d7b){return _0x135d7b[_0x9fb0('0xcc')](_0x54e1a2[_0x9fb0('0x7c')][_0x9fb0('0xc6')],_['omit'](_0x54e1a2['body'],[_0x9fb0('0xc6'),'id'])||{})['spread'](function(){return db[_0x9fb0('0x76')][_0x9fb0('0xcd')]({'attributes':['id',_0x9fb0('0x2f'),_0x9fb0('0x54')],'where':{'id':_0x54e1a2['body'][_0x9fb0('0xc6')]}});})[_0x9fb0('0x2d')](function(_0x168612){socket[_0x9fb0('0xce')](_0x9fb0('0xcf'),{'id':Number(_0x54e1a2[_0x9fb0('0xbc')]['id']),'tags':_0x168612||[]});return{'id':Number(_0x54e1a2[_0x9fb0('0xbc')]['id']),'tags':_0x168612||[]};});}})['then'](respondWithResult(_0x2be52d,null))['catch'](handleError(_0x2be52d,null));};exports['removeTags']=function(_0xea513f,_0x42db31,_0x3744e1){return db['SmsInteraction']['find']({'where':{'id':_0xea513f[_0x9fb0('0xbc')]['id']}})[_0x9fb0('0x2d')](handleEntityNotFound(_0x42db31,null))['then'](function(_0xe1a4b7){if(_0xe1a4b7){return _0xe1a4b7[_0x9fb0('0xd0')](_0xea513f[_0x9fb0('0x46')][_0x9fb0('0xc6')]);}})['then'](respondWithStatusCode(_0x42db31,null))[_0x9fb0('0x39')](handleError(_0x42db31,null));};exports['download']=function(_0x3165db,_0x3e9857){var _0x1ee6ec=moment()[_0x9fb0('0xd1')]()[_0x9fb0('0xb6')]();var _0x119df6=path[_0x9fb0('0xd2')](config[_0x9fb0('0xd3')],_0x9fb0('0xd4'),_0x9fb0('0xd5'),_0x9fb0('0xd6'));var _0x451cf0=path[_0x9fb0('0xd2')](config[_0x9fb0('0xd3')],_0x9fb0('0xd4'),_0x9fb0('0xd5'),'attachments');var _0x67f5c7=path[_0x9fb0('0xd2')](_0x119df6,_0x1ee6ec);var _0x430255=util[_0x9fb0('0xca')](_0x9fb0('0xd7'),_0x3165db[_0x9fb0('0xbc')]['id'],_0x1ee6ec);var _0x2239db=path[_0x9fb0('0xd2')](_0x119df6,_0x430255);var _0x11423f=[];_0x11423f[_0x9fb0('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x11423f[_0x9fb0('0x38')]({'model':db[_0x9fb0('0xd8')],'as':_0x9fb0('0x6e'),'attributes':['id',_0x9fb0('0xd9'),_0x9fb0('0xda')],'raw':!![]});var _0x208f1f=[{'model':db['SmsMessage'],'as':_0x9fb0('0xdb'),'attributes':['id',_0x9fb0('0x7c'),'createdAt',_0x9fb0('0xdc'),_0x9fb0('0xdd'),_0x9fb0('0x89')],'include':_0x11423f}];_0x208f1f[_0x9fb0('0x38')]({'model':db[_0x9fb0('0xde')],'as':_0x9fb0('0xdf'),'attributes':['id',_0x9fb0('0x2f')]});_0x208f1f['push']({'model':db[_0x9fb0('0x79')],'as':'Owner','attributes':['id',_0x9fb0('0x33')]});return db['SmsInteraction']['find']({'where':{'id':_0x3165db[_0x9fb0('0xbc')]['id']},'include':_0x208f1f})['then'](handleEntityNotFound(_0x3e9857,null))['then'](function(_0xad6f9){if(_0xad6f9){var _0xd11487=_0xad6f9[_0x9fb0('0xe0')]({'plain':!![]});fs[_0x9fb0('0xe1')](_0x67f5c7);var _0x3847b1={'channel':'Sms','account':_0xd11487[_0x9fb0('0xdf')][_0x9fb0('0x2f')],'agent':_0xd11487[_0x9fb0('0xe2')]?_0xd11487['Owner'][_0x9fb0('0x33')]:_0x9fb0('0xe3'),'createdAt':moment(_0xd11487[_0x9fb0('0xe4')])[_0x9fb0('0xca')](_0x9fb0('0xe5'))['toString'](),'closedAt':_0xd11487[_0x9fb0('0x3e')]?moment(_0xd11487[_0x9fb0('0xe6')])['format'](_0x9fb0('0xe5'))[_0x9fb0('0xb6')]():'','disposition':_0xd11487['disposition'],'messages':_(_0xd11487[_0x9fb0('0xdb')])[_0x9fb0('0x8d')]({'secret':![]})['map'](function(_0x176fa6){return{'date':moment(_0x176fa6[_0x9fb0('0xe4')])[_0x9fb0('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9fb0('0xb6')](),'sender':_0x176fa6[_0x9fb0('0xdc')]===_0x9fb0('0xe7')?_0x176fa6[_0x9fb0('0x79')]?_0x176fa6[_0x9fb0('0x79')][_0x9fb0('0x33')]:'System':_0x176fa6['Contact'][_0x9fb0('0xd9')]+(_0x176fa6['Contact'][_0x9fb0('0xda')]?'\x20'+_0x176fa6[_0x9fb0('0x6e')][_0x9fb0('0xda')]:''),'body':_0x176fa6[_0x9fb0('0x7c')],'direction':_0x176fa6[_0x9fb0('0xdc')]===_0x9fb0('0xe7')?'A':'C','secret':_0x176fa6[_0x9fb0('0xdd')],'read':_0x176fa6[_0x9fb0('0x89')]};})['value']()};return ejs[_0x9fb0('0xe8')](path[_0x9fb0('0xd2')](config[_0x9fb0('0xd3')],_0x9fb0('0xd4'),_0x9fb0('0xe9'),_0x9fb0('0xea')),{'interaction':_0x3847b1})['then'](function(_0x2fd26e){var _0x49d916=path['join'](_0x67f5c7,'transcript-'+_0xd11487['id']+'-'+_0x1ee6ec+_0x9fb0('0xeb'));var _0x243166={'path':_0x49d916,'channel':_0x9fb0('0xec'),'interactionId':_0xd11487['id']};return pdf['createPdfFromHTML'](_0x2fd26e,_0x243166);})[_0x9fb0('0x2d')](function(){return new BPromise(function(_0x332f1d,_0x279744){zipdir(_0x67f5c7,{'saveTo':_0x2239db},function(_0x1812fa,_0x3eec6e){if(_0x1812fa)return _0x279744(_0x1812fa);return _0x332f1d(_0x3eec6e);});})[_0x9fb0('0x2d')](function(){return new BPromise(function(_0x4db225,_0x3fcf27){rimraf(_0x67f5c7,function(_0x449289){if(_0x449289)_0x3fcf27(_0x449289);return _0x4db225();});});})[_0x9fb0('0x2d')](function(){return _0x3e9857[_0x9fb0('0xed')](_0x2239db,_0x430255,function(_0x48fb9e){if(_0x48fb9e){console['log'](_0x9fb0('0xee'),_0x48fb9e);}else{fs[_0x9fb0('0xef')](_0x2239db);}});});});}else{return _0x3e9857[_0x9fb0('0x21')](0xc8);}})[_0x9fb0('0x39')](handleError(_0x3e9857,null));}; \ No newline at end of file +var _0x4a9c=['System','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','TagIds','Tags','forEach','catch','waiting','unmanaged','total','UserId','talking','closed','answered','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','limit','order','sort','pick','field','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','compact','isEmpty','SmsAccountId','where','parse','$gte','$lte','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','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','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','params','includeAll','include','options','create','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','SmsInteractionId','format','findAll','addTags','spread','Tag','color','emit','removeTags','download','root','server','files','tmp','join','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','direction','secret','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','createdAt','out'];(function(_0x7aa744,_0x450c0d){var _0x3ef3cb=function(_0x44cc93){while(--_0x44cc93){_0x7aa744['push'](_0x7aa744['shift']());}};_0x3ef3cb(++_0x450c0d);}(_0x4a9c,0x1e4));var _0xc4a9=function(_0x5e2d96,_0x505dac){_0x5e2d96=_0x5e2d96-0x0;var _0x25e895=_0x4a9c[_0x5e2d96];return _0x25e895;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4a9('0x0'));var zipdir=require(_0xc4a9('0x1'));var jsonpatch=require(_0xc4a9('0x2'));var rp=require(_0xc4a9('0x3'));var moment=require(_0xc4a9('0x4'));var BPromise=require(_0xc4a9('0x5'));var Mustache=require('mustache');var util=require(_0xc4a9('0x6'));var path=require(_0xc4a9('0x7'));var sox=require(_0xc4a9('0x8'));var csv=require(_0xc4a9('0x9'));var ejs=require(_0xc4a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc4a9('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4a9('0xc'));var jsforce=require(_0xc4a9('0xd'));var deskjs=require(_0xc4a9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc4a9('0xf'));var authService=require(_0xc4a9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc4a9('0x11'));var pdf=require(_0xc4a9('0x12'));var hardwareService=require(_0xc4a9('0x13'));var logger=require(_0xc4a9('0x14'))(_0xc4a9('0x15'));var utils=require(_0xc4a9('0x16'));var config=require(_0xc4a9('0x17'));var licenseUtil=require(_0xc4a9('0x18'));var db=require(_0xc4a9('0x19'))['db'];config[_0xc4a9('0x1a')]=_['defaults'](config[_0xc4a9('0x1a')],{'host':_0xc4a9('0x1b'),'port':0x18eb});var socket=require(_0xc4a9('0x1c'))(new Redis(config[_0xc4a9('0x1a')]));require(_0xc4a9('0x1d'))[_0xc4a9('0x1e')](socket);function respondWithStatusCode(_0x4a55e2,_0x3bbadf){_0x3bbadf=_0x3bbadf||0xcc;return function(_0x51cbbf){if(_0x51cbbf){return _0x4a55e2[_0xc4a9('0x1f')](_0x3bbadf);}return _0x4a55e2[_0xc4a9('0x20')](_0x3bbadf)['end']();};}function respondWithResult(_0x25f9c3,_0x1a79b0){_0x1a79b0=_0x1a79b0||0xc8;return function(_0x140864){if(_0x140864){return _0x25f9c3[_0xc4a9('0x20')](_0x1a79b0)[_0xc4a9('0x21')](_0x140864);}};}function respondWithFilteredResult(_0x15bac2,_0x17a0a0){return function(_0x3837c8){if(_0x3837c8){var _0xc1de51=typeof _0x17a0a0[_0xc4a9('0x22')]===_0xc4a9('0x23')&&typeof _0x17a0a0['limit']===_0xc4a9('0x23');var _0x514256=_0x3837c8[_0xc4a9('0x24')];var _0x3203c2=_0xc1de51?0x0:_0x17a0a0[_0xc4a9('0x22')];var _0xc14afd=_0xc1de51?_0x3837c8[_0xc4a9('0x24')]:_0x17a0a0[_0xc4a9('0x22')]+_0x17a0a0['limit'];var _0x4d6129;if(_0xc14afd>=_0x514256){_0xc14afd=_0x514256;_0x4d6129=0xc8;}else{_0x4d6129=0xce;}_0x15bac2['status'](_0x4d6129);return _0x15bac2[_0xc4a9('0x25')](_0xc4a9('0x26'),_0x3203c2+'-'+_0xc14afd+'/'+_0x514256)[_0xc4a9('0x21')](_0x3837c8);}return null;};}function patchUpdates(_0x57c00f){return function(_0x30628f){try{jsonpatch['apply'](_0x30628f,_0x57c00f,!![]);}catch(_0x48a569){return BPromise[_0xc4a9('0x27')](_0x48a569);}return _0x30628f[_0xc4a9('0x28')]();};}function saveUpdates(_0x580dc6,_0x55d2d7){return function(_0x3ec7ee){if(_0x3ec7ee){return _0x3ec7ee[_0xc4a9('0x29')](_0x580dc6)[_0xc4a9('0x2a')](function(_0x2211fe){return _0x2211fe;});}return null;};}function removeEntity(_0x1afccb,_0x592a40){return function(_0x2b700e){if(_0x2b700e){return _0x2b700e[_0xc4a9('0x2b')]()[_0xc4a9('0x2a')](function(){_0x1afccb[_0xc4a9('0x20')](0xcc)[_0xc4a9('0x2c')]();});}};}function handleEntityNotFound(_0x32193a,_0x4c3411){return function(_0x27c9ff){if(!_0x27c9ff){_0x32193a[_0xc4a9('0x1f')](0x194);}return _0x27c9ff;};}function handleError(_0x30570c,_0x4dc808){_0x4dc808=_0x4dc808||0x1f4;return function(_0x5c354c){logger[_0xc4a9('0x2d')](_0x5c354c['stack']);if(_0x5c354c[_0xc4a9('0x2e')]){delete _0x5c354c['name'];}_0x30570c[_0xc4a9('0x20')](_0x4dc808)[_0xc4a9('0x2f')](_0x5c354c);};}function getInteractionUsers(_0x48be1e,_0x1c9152){return new BPromise(function(_0xeb66fa,_0x35218c){try{if(_0x1c9152[_0x48be1e['id']]){_0x48be1e['Users']=_['map'](_0x1c9152[_0x48be1e['id']],function(_0x1d0de2){return{'id':_0x1d0de2['id'],'fullname':_0x1d0de2['fullname']};});}}catch(_0x5481){_0x35218c(_0x5481);}_0xeb66fa(_0x48be1e);});}function getInteractionTags(_0x36f63e,_0x1bc169){return new BPromise(function(_0xa51087,_0x46590e){try{if(_0x36f63e[_0xc4a9('0x30')]){_0x36f63e[_0xc4a9('0x31')]=[];_0x36f63e['TagIds']['split'](',')[_0xc4a9('0x32')](function(_0x3889fe){_0x36f63e[_0xc4a9('0x31')]['push'](_0x1bc169[_0x3889fe]);});}delete _0x36f63e[_0xc4a9('0x30')];}catch(_0x54d4e8){_0x46590e(_0x54d4e8);}_0xa51087(_0x36f63e);});}function updateSmsInteraction(_0x22731b,_0x49420e,_0x578a6d){return new BPromise(function(_0x40f280,_0x4cb743){return getInteractionUsers(_0x22731b,_0x578a6d)[_0xc4a9('0x2a')](function(_0x146e07){return getInteractionTags(_0x146e07,_0x49420e);})[_0xc4a9('0x2a')](function(_0x4389f4){return getStateInteraction(_0x4389f4);})[_0xc4a9('0x2a')](function(_0x47a35e){_0x40f280(_0x47a35e);})[_0xc4a9('0x33')](function(_0x5b015c){_0x4cb743(_0x5b015c);});});}function getStateInteraction(_0x4a6bb2){return new BPromise(function(_0x561341){_0x4a6bb2[_0xc4a9('0x34')]=0x0;_0x4a6bb2['talking']=0x0;_0x4a6bb2['answered']=0x0;_0x4a6bb2[_0xc4a9('0x35')]=0x0;_0x4a6bb2[_0xc4a9('0x36')]=0x0;if(!_0x4a6bb2['closed']&&!_0x4a6bb2['UserId']){_0x4a6bb2[_0xc4a9('0x34')]+=0x1;}if(!_0x4a6bb2['closed']&&_0x4a6bb2[_0xc4a9('0x37')]){_0x4a6bb2[_0xc4a9('0x38')]+=0x1;if(_0x4a6bb2[_0xc4a9('0x34')]){_0x4a6bb2['waiting']-=0x1;}}if(_0x4a6bb2[_0xc4a9('0x39')]&&_0x4a6bb2[_0xc4a9('0x37')]){_0x4a6bb2[_0xc4a9('0x3a')]+=0x1;if(_0x4a6bb2['talking']){_0x4a6bb2[_0xc4a9('0x38')]-=0x1;}}if(_0x4a6bb2[_0xc4a9('0x39')]&&!_0x4a6bb2[_0xc4a9('0x37')]){_0x4a6bb2[_0xc4a9('0x35')]+=0x1;if(_0x4a6bb2[_0xc4a9('0x34')]){_0x4a6bb2['waiting']-=0x1;}}_0x4a6bb2[_0xc4a9('0x36')]+=0x1;_0x561341(_0x4a6bb2);});}exports['index']=function(_0x1fb4ad,_0x415d13){var _0x258ffb={},_0x4f6a82={},_0xf5e77b={'count':0x0,'rows':[]};var _0x593c00=_[_0xc4a9('0x3b')](db['SmsInteraction'][_0xc4a9('0x3c')],function(_0x1e813d){return{'name':_0x1e813d['fieldName'],'type':_0x1e813d[_0xc4a9('0x3d')]['key']};});_0x4f6a82[_0xc4a9('0x3e')]=_[_0xc4a9('0x3b')](_0x593c00,_0xc4a9('0x2e'));_0x4f6a82[_0xc4a9('0x3f')]=_['keys'](_0x1fb4ad[_0xc4a9('0x3f')]);_0x4f6a82[_0xc4a9('0x40')]=_[_0xc4a9('0x41')](_0x4f6a82[_0xc4a9('0x3e')],_0x4f6a82[_0xc4a9('0x3f')]);_0x258ffb[_0xc4a9('0x42')]=_['intersection'](_0x4f6a82[_0xc4a9('0x3e')],qs[_0xc4a9('0x43')](_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x43')]));_0x258ffb['attributes']=_0x258ffb[_0xc4a9('0x42')][_0xc4a9('0x44')]?_0x258ffb[_0xc4a9('0x42')]:_0x4f6a82[_0xc4a9('0x3e')];if(!_0x1fb4ad[_0xc4a9('0x3f')]['hasOwnProperty']('nolimit')){_0x258ffb[_0xc4a9('0x45')]=qs['limit'](_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x45')]);_0x258ffb[_0xc4a9('0x22')]=qs['offset'](_0x1fb4ad['query']['offset']);}_0x258ffb[_0xc4a9('0x46')]=qs[_0xc4a9('0x47')](_0x1fb4ad['query'][_0xc4a9('0x47')]);_0x258ffb['where']=qs[_0xc4a9('0x40')](_[_0xc4a9('0x48')](_0x1fb4ad[_0xc4a9('0x3f')],_0x4f6a82['filters']),_0x593c00);var _0x56cf9a=[];var _0x29b31e=squel['select']()[_0xc4a9('0x49')]('id')[_0xc4a9('0x49')](_0xc4a9('0x2e'))['field']('color')[_0xc4a9('0x4a')](_0xc4a9('0x4b'));var _0x708f64=squel[_0xc4a9('0x4c')]()['field'](_0xc4a9('0x4d'))['field'](_0xc4a9('0x4e'))[_0xc4a9('0x49')](_0xc4a9('0x4f'))[_0xc4a9('0x4a')](_0xc4a9('0x50'),'ui')['left_join'](_0xc4a9('0x51'),'u',_0xc4a9('0x52'));var _0x5e79d5=squel[_0xc4a9('0x4c')]()[_0xc4a9('0x4a')]('sms_interactions','i')[_0xc4a9('0x53')](_0xc4a9('0x54'),'c',_0xc4a9('0x55'))[_0xc4a9('0x53')]('users','o','o.id\x20=\x20i.UserId')[_0xc4a9('0x53')]('sms_accounts','a',_0xc4a9('0x56'))['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0xc4a9('0x53')](_0xc4a9('0x57'),'it',_0xc4a9('0x58'))[_0xc4a9('0x53')](_0xc4a9('0x4b'),'t',_0xc4a9('0x59'));var _0x210aeb=squel[_0xc4a9('0x5a')]();var _0x3451d6=[];var _0x32e0a0=squel[_0xc4a9('0x5a')]();var _0x4cbff2;if(_0x1fb4ad['query']['search']){_0x4cbff2=as[_0xc4a9('0x5b')](_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x5c')]);var _0x55d811=_0x4cbff2['sqlOperator'];for(var _0x8877fd=0x0;_0x8877fd<_0x4cbff2[_0xc4a9('0x5d')][_0xc4a9('0x44')];_0x8877fd++){var _0x4fad83=_0x4cbff2[_0xc4a9('0x5d')][_0x8877fd];var _0xe7711a='i';var _0x42b0d0=_[_0xc4a9('0x5e')](_0x593c00,[_0xc4a9('0x2e'),_0x4fad83[_0xc4a9('0x49')]]);if(!_0x42b0d0){switch(_0x4fad83['field']){case _0xc4a9('0x5f'):if(_0x4fad83[_0xc4a9('0x60')]==0x1){_0x5e79d5[_0xc4a9('0x61')]('`'+_0x4fad83[_0xc4a9('0x49')]+_0xc4a9('0x62'));}else{_0x5e79d5[_0xc4a9('0x61')]('`'+_0x4fad83['field']+_0xc4a9('0x63'));}break;case'Contact':if(_0x4fad83[_0xc4a9('0x64')]===_0xc4a9('0x65')){if(_0x4fad83[_0xc4a9('0x60')][_0xc4a9('0x66')]('\x20')['length']>0x1){_0x210aeb[_0x55d811](_0xc4a9('0x67'),qs[_0xc4a9('0x68')](_0x4fad83[_0xc4a9('0x60')]),null);}else{var _0x3276bb='%'+_0x4fad83[_0xc4a9('0x60')]+'%';_0x210aeb[_0x55d811](_0xc4a9('0x69'),_0x3276bb,_0x3276bb,_0x3276bb);}}else{_0x42b0d0=_[_0xc4a9('0x5e')](_0x593c00,[_0xc4a9('0x2e'),'ContactId']);_0x4fad83[_0xc4a9('0x49')]=_0xc4a9('0x6a');_0x13f3ba=as[_0xc4a9('0x6b')](_0xe7711a,_0x42b0d0[_0xc4a9('0x3d')],_0x4fad83);_0x210aeb[_0x55d811](_0x13f3ba[_0xc4a9('0x6c')],_0x13f3ba[_0xc4a9('0x60')][_0xc4a9('0x6d')],_0x13f3ba['value']['end']);}break;case'Tag':var _0x228610=_0x4fad83[_0xc4a9('0x60')]['split'](',')[_0xc4a9('0x3b')](function(_0x20c818){return Number(_0x20c818);});_0x228610[_0xc4a9('0x32')](function(_0x1c44ac){_0x32e0a0['or'](_0xc4a9('0x6e'),'%,'+_0x1c44ac+',%');});_0x3451d6=_[_0xc4a9('0x6f')](_0x3451d6,_0x228610);break;case _0xc4a9('0x70'):if(_0x4fad83[_0xc4a9('0x64')]===_0xc4a9('0x65')){_0x210aeb[_0x55d811](_0xc4a9('0x71'),'%'+_0x4fad83[_0xc4a9('0x60')]+'%',null);}else{_0x42b0d0=_[_0xc4a9('0x5e')](_0x593c00,['name',_0xc4a9('0x37')]);_0x4fad83['field']=_0xc4a9('0x37');_0x13f3ba=as[_0xc4a9('0x6b')](_0xe7711a,_0x42b0d0[_0xc4a9('0x3d')],_0x4fad83);_0x210aeb[_0x55d811](_0x13f3ba[_0xc4a9('0x6c')],_0x13f3ba[_0xc4a9('0x60')][_0xc4a9('0x6d')],_0x13f3ba[_0xc4a9('0x60')][_0xc4a9('0x2c')]);}break;case _0xc4a9('0x72'):_0x13f3ba=as['buildExpression']('me',null,_0x4fad83);_0x210aeb[_0x55d811](_0x13f3ba[_0xc4a9('0x6c')],_0x13f3ba['value']['start'],_0x13f3ba['value'][_0xc4a9('0x2c')]);break;}}else{var _0x13f3ba=as['buildExpression'](_0xe7711a,_0x42b0d0[_0xc4a9('0x3d')],_0x4fad83);_0x210aeb[_0x55d811](_0x13f3ba['text'],_0x13f3ba['value']['start'],_0x13f3ba[_0xc4a9('0x60')]['end']);}}}else{var _0x32989c=_(_0x1fb4ad[_0xc4a9('0x3f')])[_0xc4a9('0x73')]()['map'](function(_0x1b1e1e){return _['some'](_0x593c00,[_0xc4a9('0x2e'),_0x1b1e1e])?_0x1b1e1e:undefined;})[_0xc4a9('0x74')]()[_0xc4a9('0x60')]();if(!_[_0xc4a9('0x75')](_0x32989c)){_0x32989c[_0xc4a9('0x32')](function(_0x3204b4){if(_0x3204b4===_0xc4a9('0x76')){_0x5e79d5[_0xc4a9('0x77')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x1fb4ad['query'][_0x3204b4]));}else if(_0x3204b4==='createdAt'){var _0x650862=JSON[_0xc4a9('0x78')](_0x1fb4ad[_0xc4a9('0x3f')][_0x3204b4])[_0xc4a9('0x79')];var _0x2aa1c4=JSON[_0xc4a9('0x78')](_0x1fb4ad[_0xc4a9('0x3f')][_0x3204b4])[_0xc4a9('0x7a')];_0x5e79d5[_0xc4a9('0x77')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x650862,_0x2aa1c4);}else{if(_0x1fb4ad[_0xc4a9('0x3f')][_0x3204b4]==='null'){_0x5e79d5[_0xc4a9('0x77')]('i.'+_0x3204b4+'\x20IS\x20NULL');}else{_0x5e79d5[_0xc4a9('0x77')]('i.'+_0x3204b4+_0xc4a9('0x7b'),_0x1fb4ad['query'][_0x3204b4]);}}});}if(_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x7c')]){if(_0x1fb4ad['query']['read']==0x1){_0x5e79d5[_0xc4a9('0x61')](_0xc4a9('0x7d'));}else{_0x5e79d5[_0xc4a9('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x7e')]){_0x3451d6=_[_0xc4a9('0x7f')](_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x7e')])?_0x1fb4ad['query'][_0xc4a9('0x7e')]:new Array(_0x1fb4ad['query'][_0xc4a9('0x7e')]);_0x3451d6[_0xc4a9('0x32')](function(_0x5ab05e){_0x32e0a0['or'](_0xc4a9('0x6e'),'%,'+_0x5ab05e+',%');});}if(_0x1fb4ad['query'][_0xc4a9('0x80')]){var _0x3f8cc8=_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x80')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc4a9('0x81')](_0x3f8cc8)){_0x210aeb['or'](_0xc4a9('0x82'),_0x3f8cc8+'%')['or'](_0xc4a9('0x83'),_0x3f8cc8+'%');}else{_0x210aeb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc4a9('0x68')](_0x3f8cc8))['or'](_0xc4a9('0x84'),_0x3f8cc8+'%');}}}_0x5e79d5[_0xc4a9('0x77')](_0x210aeb);_0x5e79d5[_0xc4a9('0x85')](_0xc4a9('0x86'));var _0x57c776={'type':db[_0xc4a9('0x87')][_0xc4a9('0x88')][_0xc4a9('0x89')],'raw':!![]};var _0x59ced4=_0x5e79d5[_0xc4a9('0x8a')]();_0x59ced4[_0xc4a9('0x49')](_0xc4a9('0x86'));_0x59ced4['field'](_0xc4a9('0x8b'),_0xc4a9('0x5f'));if(_0x258ffb['order']){_0x258ffb[_0xc4a9('0x46')][_0xc4a9('0x32')](function(_0x1e7914){var _0x212a6d=_0x1e7914[0x0]===_0xc4a9('0x8c')?_0x1e7914[0x0]:'i.'+_0x1e7914[0x0];_0x5e79d5['order'](_0x212a6d,_0x1e7914[0x1]===_0xc4a9('0x8d')?![]:!![]);});}if(!_[_0xc4a9('0x75')](_0x3451d6)){_0x5e79d5['having'](_0x32e0a0);_0x59ced4[_0xc4a9('0x77')](_0xc4a9('0x8e'),_0x3451d6);}BPromise[_0xc4a9('0x8f')]()['then'](function(){if(!_0x4cbff2){if(_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x76')])return;_0x59ced4['where'](_0xc4a9('0x90'));_0x5e79d5[_0xc4a9('0x77')](_0xc4a9('0x90'));return;}if(_0x1fb4ad[_0xc4a9('0x91')][_0xc4a9('0x92')]!==_0xc4a9('0x93'))return;return _0x1fb4ad['user'][_0xc4a9('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x34a2f8){if(_['isEmpty'](_0x34a2f8)){_0x59ced4[_0xc4a9('0x77')]('i.SmsAccountId\x20IS\x20NULL');_0x5e79d5[_0xc4a9('0x77')](_0xc4a9('0x95'));}else{_0x59ced4['where'](_0xc4a9('0x96'),_[_0xc4a9('0x3b')](_0x34a2f8,'id'));_0x5e79d5[_0xc4a9('0x77')](_0xc4a9('0x96'),_['map'](_0x34a2f8,'id'));}});})['then'](function(){if(_0x1fb4ad[_0xc4a9('0x91')][_0xc4a9('0x92')]===_0xc4a9('0x93')&&!_0x4cbff2&&!_0x1fb4ad[_0xc4a9('0x3f')][_0xc4a9('0x76')])return[];return db[_0xc4a9('0x97')][_0xc4a9('0x3f')](_0x59ced4[_0xc4a9('0x98')](),_0x57c776);})[_0xc4a9('0x2a')](function(_0x4896b4){_0xf5e77b[_0xc4a9('0x24')]=_0x4896b4['length'];if(_0xf5e77b[_0xc4a9('0x24')]===0x0)return[];return db[_0xc4a9('0x97')][_0xc4a9('0x3f')](_0x29b31e['toString'](),_0x57c776)[_0xc4a9('0x2a')](function(_0x26071e){_0x56cf9a=_[_0xc4a9('0x99')](_0x26071e,'id');_0x57c776=_[_0xc4a9('0x9a')](_0x57c776,{'model':db[_0xc4a9('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1fb4ad[_0xc4a9('0x3f')]['fields']){_0x258ffb[_0xc4a9('0x42')][_0xc4a9('0x32')](function(_0x45bce7){_0x5e79d5[_0xc4a9('0x49')]('i.'+_0x45bce7);});}else{_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0x8b'),_0xc4a9('0x5f'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0x9c'),_0xc4a9('0x9d'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0x9e'),_0xc4a9('0x9f'));_0x5e79d5['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',_0xc4a9('0x8c'));_0x5e79d5[_0xc4a9('0x49')]('i.*');_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xa0'),_0xc4a9('0xa1'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xa2'),_0xc4a9('0xa3'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xa4'),_0xc4a9('0xa5'));_0x5e79d5['field'](_0xc4a9('0xa6'),_0xc4a9('0xa7'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xa8'),'Contact.mobile');_0x5e79d5[_0xc4a9('0x49')]('c.fax',_0xc4a9('0xa9'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xaa'),_0xc4a9('0xab'));_0x5e79d5['field'](_0xc4a9('0xac'),_0xc4a9('0xad'));_0x5e79d5[_0xc4a9('0x49')](_0xc4a9('0xae'),'TagIds');}if(_0x258ffb['limit'])_0x5e79d5[_0xc4a9('0x45')](_0x258ffb[_0xc4a9('0x45')]);if(_0x258ffb[_0xc4a9('0x22')])_0x5e79d5[_0xc4a9('0x22')](_0x258ffb[_0xc4a9('0x22')]);return db[_0xc4a9('0x97')][_0xc4a9('0x3f')](_0x5e79d5[_0xc4a9('0x98')](),_0x57c776);})[_0xc4a9('0x2a')](function(_0x3d737c){if(_0x3d737c[_0xc4a9('0x44')]>0x0)_0x708f64[_0xc4a9('0x77')](_0xc4a9('0xaf'),_[_0xc4a9('0x3b')](_0x3d737c,'id'));return db[_0xc4a9('0x97')]['query'](_0x708f64['toString'](),_0x57c776)[_0xc4a9('0x2a')](function(_0x4a62d0){var _0xc3c816=_[_0xc4a9('0xb0')](_0x4a62d0,'SmsInteractionId');var _0x294bd4=[];_0x3d737c[_0xc4a9('0x32')](function(_0x38c0b4){_0x294bd4[_0xc4a9('0xb1')](updateSmsInteraction(_0x38c0b4,_0x56cf9a,_0xc3c816));});return BPromise[_0xc4a9('0xb2')](_0x294bd4);});});})[_0xc4a9('0x2a')](function(_0x3bb926){_0xf5e77b[_0xc4a9('0xb3')]=_0x3bb926;return _0xf5e77b;})[_0xc4a9('0x2a')](respondWithFilteredResult(_0x415d13,_0x258ffb))[_0xc4a9('0x33')](handleError(_0x415d13,null));};exports['show']=function(_0x5d42ff,_0x245b94){var _0x2cbc97={'raw':![],'where':{'id':_0x5d42ff[_0xc4a9('0xb4')]['id']}},_0xdf9e30={};_0xdf9e30[_0xc4a9('0x3e')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0xdf9e30[_0xc4a9('0x3f')]=_[_0xc4a9('0x73')](_0x5d42ff[_0xc4a9('0x3f')]);_0xdf9e30[_0xc4a9('0x40')]=_[_0xc4a9('0x41')](_0xdf9e30['model'],_0xdf9e30[_0xc4a9('0x3f')]);_0x2cbc97[_0xc4a9('0x42')]=_[_0xc4a9('0x41')](_0xdf9e30['model'],qs[_0xc4a9('0x43')](_0x5d42ff['query'][_0xc4a9('0x43')]));_0x2cbc97[_0xc4a9('0x42')]=_0x2cbc97[_0xc4a9('0x42')][_0xc4a9('0x44')]?_0x2cbc97['attributes']:_0xdf9e30['model'];if(_0x5d42ff['query'][_0xc4a9('0xb5')]){_0x2cbc97[_0xc4a9('0xb6')]=[{'all':!![]}];}_0x2cbc97=_[_0xc4a9('0x9a')]({},_0x2cbc97,_0x5d42ff[_0xc4a9('0xb7')]);return db[_0xc4a9('0x9b')][_0xc4a9('0x5e')](_0x2cbc97)[_0xc4a9('0x2a')](handleEntityNotFound(_0x245b94,null))[_0xc4a9('0x2a')](respondWithResult(_0x245b94,null))[_0xc4a9('0x33')](handleError(_0x245b94,null));};exports[_0xc4a9('0xb8')]=function(_0x541277,_0x534daa){return db[_0xc4a9('0x9b')][_0xc4a9('0xb8')](_0x541277[_0xc4a9('0x72')],{})[_0xc4a9('0x2a')](respondWithResult(_0x534daa,0xc9))[_0xc4a9('0x33')](handleError(_0x534daa,null));};exports[_0xc4a9('0x29')]=function(_0x8bdb74,_0x500058){if(_0x8bdb74[_0xc4a9('0x72')]['id']){delete _0x8bdb74[_0xc4a9('0x72')]['id'];}return db[_0xc4a9('0x9b')]['find']({'where':{'id':_0x8bdb74['params']['id']}})[_0xc4a9('0x2a')](handleEntityNotFound(_0x500058,null))['then'](saveUpdates(_0x8bdb74['body'],null))[_0xc4a9('0x2a')](respondWithResult(_0x500058,null))[_0xc4a9('0x33')](handleError(_0x500058,null));};exports[_0xc4a9('0x2b')]=function(_0x39a728,_0x2deeef){return db['SmsInteraction']['find']({'where':{'id':_0x39a728['params']['id']}})[_0xc4a9('0x2a')](handleEntityNotFound(_0x2deeef,null))['then'](removeEntity(_0x2deeef,null))[_0xc4a9('0x33')](handleError(_0x2deeef,null));};exports[_0xc4a9('0xb9')]=function(_0x2da722,_0x1f81c9){return db[_0xc4a9('0x9b')][_0xc4a9('0xb9')]()[_0xc4a9('0x2a')](respondWithResult(_0x1f81c9,null))[_0xc4a9('0x33')](handleError(_0x1f81c9,null));};exports['addMessage']=function(_0xf9be7a,_0x500a14,_0x2ff491){return db[_0xc4a9('0xba')][_0xc4a9('0x5e')]({'where':{'id':_0xf9be7a[_0xc4a9('0xb4')]['id']}})[_0xc4a9('0x2a')](handleEntityNotFound(_0x500a14,null))[_0xc4a9('0x2a')](function(_0x28b2ad){if(_0x28b2ad){return _0x28b2ad[_0xc4a9('0xbb')](_0xf9be7a[_0xc4a9('0x72')][_0xc4a9('0xbc')],_[_0xc4a9('0xbd')](_0xf9be7a[_0xc4a9('0x72')],[_0xc4a9('0xbc'),'id'])||{});}})[_0xc4a9('0x2a')](respondWithResult(_0x500a14,null))[_0xc4a9('0x33')](handleError(_0x500a14,null));};exports[_0xc4a9('0xbe')]=function(_0x1137f1,_0x9556ae,_0x1b0644){var _0x5eb1aa={'raw':![],'where':{}};var _0x8ec73a={};var _0x1a08ea={'count':0x0,'rows':[]};return db[_0xc4a9('0x9b')][_0xc4a9('0xbf')]({'where':{'id':_0x1137f1[_0xc4a9('0xb4')]['id']}})['then'](handleEntityNotFound(_0x9556ae,null))['then'](function(_0x3a941c){if(_0x3a941c){_0x8ec73a[_0xc4a9('0x3e')]=_[_0xc4a9('0x73')](db[_0xc4a9('0xba')][_0xc4a9('0x3c')]);_0x8ec73a[_0xc4a9('0x3f')]=_[_0xc4a9('0x73')](_0x1137f1[_0xc4a9('0x3f')]);_0x8ec73a[_0xc4a9('0x40')]=_['intersection'](_0x8ec73a[_0xc4a9('0x3e')],_0x8ec73a['query']);_0x5eb1aa[_0xc4a9('0x42')]=_[_0xc4a9('0x41')](_0x8ec73a[_0xc4a9('0x3e')],qs[_0xc4a9('0x43')](_0x1137f1[_0xc4a9('0x3f')][_0xc4a9('0x43')]));_0x5eb1aa[_0xc4a9('0x42')]=_0x5eb1aa['attributes'][_0xc4a9('0x44')]?_0x5eb1aa['attributes']:_0x8ec73a[_0xc4a9('0x3e')];if(!_0x1137f1[_0xc4a9('0x3f')][_0xc4a9('0xc0')](_0xc4a9('0xc1'))){_0x5eb1aa[_0xc4a9('0x45')]=qs[_0xc4a9('0x45')](_0x1137f1[_0xc4a9('0x3f')]['limit']);_0x5eb1aa[_0xc4a9('0x22')]=qs['offset'](_0x1137f1[_0xc4a9('0x3f')]['offset']);}_0x5eb1aa[_0xc4a9('0x46')]=qs[_0xc4a9('0x47')](_0x1137f1[_0xc4a9('0x3f')][_0xc4a9('0x47')]);_0x5eb1aa[_0xc4a9('0x77')]=qs['filters'](_['pick'](_0x1137f1[_0xc4a9('0x3f')],_0x8ec73a[_0xc4a9('0x40')]));_0x5eb1aa['where'][_0xc4a9('0xc2')]=_0x3a941c['id'];if(_0x1137f1['query'][_0xc4a9('0x80')]){_0x5eb1aa[_0xc4a9('0x77')]=_[_0xc4a9('0x9a')](_0x5eb1aa[_0xc4a9('0x77')],{'$or':_['map'](_0x5eb1aa[_0xc4a9('0x42')],function(_0x528981){var _0x15799a={};_0x15799a[_0x528981]={'$like':'%'+_0x1137f1[_0xc4a9('0x3f')]['filter']+'%'};return _0x15799a;})});}if(_0x1137f1[_0xc4a9('0x3f')][_0xc4a9('0x79')]){var _0xd84993=_0x1137f1['query']['$gte']['split'](',');var _0x1cd7a0={};_0x1cd7a0[_0xd84993[0x0]]={'$gte':moment(_0xd84993[0x1])[_0xc4a9('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5eb1aa[_0xc4a9('0x77')]=_['merge'](_0x5eb1aa['where'],_0x1cd7a0);}_0x5eb1aa=_[_0xc4a9('0x9a')]({},_0x5eb1aa,_0x1137f1[_0xc4a9('0xb7')]);return db[_0xc4a9('0xba')][_0xc4a9('0x24')]({'where':_0x5eb1aa[_0xc4a9('0x77')]})[_0xc4a9('0x2a')](function(_0xaec2da){_0x1a08ea['count']=_0xaec2da;if(_0x1137f1['query']['includeAll']){_0x5eb1aa['include']=[{'all':!![]}];}return db[_0xc4a9('0xba')][_0xc4a9('0xc4')](_0x5eb1aa);})[_0xc4a9('0x2a')](function(_0x75b355){_0x1a08ea['rows']=_0x75b355;return _0x1a08ea;});}})[_0xc4a9('0x2a')](respondWithFilteredResult(_0x9556ae,_0x5eb1aa))[_0xc4a9('0x33')](handleError(_0x9556ae,null));};exports[_0xc4a9('0xc5')]=function(_0x2a53b4,_0x368168,_0x3c821d){return db[_0xc4a9('0x9b')]['find']({'where':{'id':_0x2a53b4[_0xc4a9('0xb4')]['id']}})['then'](handleEntityNotFound(_0x368168,null))['then'](function(_0x338187){if(_0x338187){return _0x338187['setTags'](_0x2a53b4['body'][_0xc4a9('0xbc')],_[_0xc4a9('0xbd')](_0x2a53b4['body'],[_0xc4a9('0xbc'),'id'])||{})[_0xc4a9('0xc6')](function(){return db[_0xc4a9('0xc7')][_0xc4a9('0xc4')]({'attributes':['id',_0xc4a9('0x2e'),_0xc4a9('0xc8')],'where':{'id':_0x2a53b4['body']['ids']}});})[_0xc4a9('0x2a')](function(_0x4b5cb3){socket[_0xc4a9('0xc9')]('smsInteractionTags:save',{'id':Number(_0x2a53b4[_0xc4a9('0xb4')]['id']),'tags':_0x4b5cb3||[]});return{'id':Number(_0x2a53b4[_0xc4a9('0xb4')]['id']),'tags':_0x4b5cb3||[]};});}})['then'](respondWithResult(_0x368168,null))[_0xc4a9('0x33')](handleError(_0x368168,null));};exports[_0xc4a9('0xca')]=function(_0x1eecfd,_0x4eb681,_0x140d36){return db[_0xc4a9('0x9b')][_0xc4a9('0x5e')]({'where':{'id':_0x1eecfd['params']['id']}})[_0xc4a9('0x2a')](handleEntityNotFound(_0x4eb681,null))['then'](function(_0x3d7484){if(_0x3d7484){return _0x3d7484[_0xc4a9('0xca')](_0x1eecfd['query'][_0xc4a9('0xbc')]);}})[_0xc4a9('0x2a')](respondWithStatusCode(_0x4eb681,null))['catch'](handleError(_0x4eb681,null));};exports[_0xc4a9('0xcb')]=function(_0x2391a1,_0x24e836){var _0x167e0c=moment()['unix']()[_0xc4a9('0x98')]();var _0x265046=path['join'](config[_0xc4a9('0xcc')],_0xc4a9('0xcd'),_0xc4a9('0xce'),_0xc4a9('0xcf'));var _0x280374=path[_0xc4a9('0xd0')](config['root'],_0xc4a9('0xcd'),'files','attachments');var _0x3d2d3c=path['join'](_0x265046,_0x167e0c);var _0x5ce15e=util['format'](_0xc4a9('0xd1'),_0x2391a1['params']['id'],_0x167e0c);var _0x2fc2b8=path[_0xc4a9('0xd0')](_0x265046,_0x5ce15e);var _0x50f61b=[];_0x50f61b[_0xc4a9('0xb1')]({'model':db[_0xc4a9('0x70')],'as':_0xc4a9('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x50f61b['push']({'model':db[_0xc4a9('0xd2')],'as':_0xc4a9('0xd3'),'attributes':['id',_0xc4a9('0xd4'),_0xc4a9('0xd5')],'raw':!![]});var _0x30e190=[{'model':db[_0xc4a9('0xba')],'as':'Messages','attributes':['id',_0xc4a9('0x72'),'createdAt',_0xc4a9('0xd6'),_0xc4a9('0xd7'),'read'],'include':_0x50f61b}];_0x30e190['push']({'model':db[_0xc4a9('0xd8')],'as':_0xc4a9('0xd9'),'attributes':['id',_0xc4a9('0x2e')]});_0x30e190[_0xc4a9('0xb1')]({'model':db[_0xc4a9('0x70')],'as':'Owner','attributes':['id',_0xc4a9('0xda')]});return db[_0xc4a9('0x9b')][_0xc4a9('0x5e')]({'where':{'id':_0x2391a1[_0xc4a9('0xb4')]['id']},'include':_0x30e190})[_0xc4a9('0x2a')](handleEntityNotFound(_0x24e836,null))[_0xc4a9('0x2a')](function(_0x175a8d){if(_0x175a8d){var _0x35ae96=_0x175a8d[_0xc4a9('0xdb')]({'plain':!![]});fs[_0xc4a9('0xdc')](_0x3d2d3c);var _0x12dca3={'channel':_0xc4a9('0xdd'),'account':_0x35ae96['Account'][_0xc4a9('0x2e')],'agent':_0x35ae96['Owner']?_0x35ae96[_0xc4a9('0xde')][_0xc4a9('0xda')]:_0xc4a9('0xdf'),'createdAt':moment(_0x35ae96['createdAt'])[_0xc4a9('0xc3')](_0xc4a9('0xe0'))[_0xc4a9('0x98')](),'closedAt':_0x35ae96['closed']?moment(_0x35ae96[_0xc4a9('0xe1')])[_0xc4a9('0xc3')](_0xc4a9('0xe0'))['toString']():'','disposition':_0x35ae96[_0xc4a9('0xe2')],'messages':_(_0x35ae96[_0xc4a9('0xe3')])[_0xc4a9('0x80')]({'secret':![]})[_0xc4a9('0x3b')](function(_0x1820ef){return{'date':moment(_0x1820ef[_0xc4a9('0xe4')])['format'](_0xc4a9('0xe0'))[_0xc4a9('0x98')](),'sender':_0x1820ef[_0xc4a9('0xd6')]===_0xc4a9('0xe5')?_0x1820ef[_0xc4a9('0x70')]?_0x1820ef[_0xc4a9('0x70')][_0xc4a9('0xda')]:_0xc4a9('0xe6'):_0x1820ef[_0xc4a9('0xd3')][_0xc4a9('0xd4')]+(_0x1820ef[_0xc4a9('0xd3')][_0xc4a9('0xd5')]?'\x20'+_0x1820ef[_0xc4a9('0xd3')]['lastName']:''),'body':_0x1820ef['body'],'direction':_0x1820ef['direction']===_0xc4a9('0xe5')?'A':'C','secret':_0x1820ef[_0xc4a9('0xd7')],'read':_0x1820ef[_0xc4a9('0x7c')]};})['value']()};return ejs['renderFile'](path[_0xc4a9('0xd0')](config[_0xc4a9('0xcc')],_0xc4a9('0xcd'),_0xc4a9('0xe7'),_0xc4a9('0xe8')),{'interaction':_0x12dca3})['then'](function(_0xdc5b2e){var _0x28dc49=path[_0xc4a9('0xd0')](_0x3d2d3c,'transcript-'+_0x35ae96['id']+'-'+_0x167e0c+_0xc4a9('0xe9'));var _0xef6d08={'path':_0x28dc49,'channel':'Sms','interactionId':_0x35ae96['id']};return pdf[_0xc4a9('0xea')](_0xdc5b2e,_0xef6d08);})[_0xc4a9('0x2a')](function(){return new BPromise(function(_0x19e7ee,_0x50b67a){zipdir(_0x3d2d3c,{'saveTo':_0x2fc2b8},function(_0x68b510,_0x2a8bb8){if(_0x68b510)return _0x50b67a(_0x68b510);return _0x19e7ee(_0x2a8bb8);});})[_0xc4a9('0x2a')](function(){return new BPromise(function(_0x3b1577,_0x11eccf){rimraf(_0x3d2d3c,function(_0x5e82fe){if(_0x5e82fe)_0x11eccf(_0x5e82fe);return _0x3b1577();});});})[_0xc4a9('0x2a')](function(){return _0x24e836[_0xc4a9('0xcb')](_0x2fc2b8,_0x5ce15e,function(_0x44ce4e){if(_0x44ce4e){console[_0xc4a9('0xeb')](_0xc4a9('0xec'),_0x44ce4e);}else{fs[_0xc4a9('0xed')](_0x2fc2b8);}});});});}else{return _0x24e836[_0xc4a9('0x1f')](0xc8);}})['catch'](handleError(_0x24e836,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 6aebf2a..8c380b3 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 _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x320333,_0xc3e0d5){var _0x5f02d3=function(_0x5dc5f2){while(--_0x5dc5f2){_0x320333['push'](_0x320333['shift']());}};_0x5f02d3(++_0xc3e0d5);}(_0x4888,0x198));var _0x8488=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x4888[_0x1d7300];return _0x46ee98;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0xb10b=['remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hook','events','SmsInteraction','../../mysqldb','SmsMessage','save','update'];(function(_0x5e234d,_0x588d25){var _0x5af138=function(_0x4f3d2f){while(--_0x4f3d2f){_0x5e234d['push'](_0x5e234d['shift']());}};_0x5af138(++_0x588d25);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f8be8,_0x46cff7){_0x2f8be8=_0x2f8be8-0x0;var _0x58b0d7=_0xb10b[_0x2f8be8];return _0x58b0d7;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xbb10('0x1')];var SmsMessage=require(_0xbb10('0x2'))['db'][_0xbb10('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb10('0x4'),'afterUpdate':_0xbb10('0x5'),'afterDestroy':_0xbb10('0x6')};function emitEvent(_0x22320e){return function(_0x49baf4,_0x312b72,_0x481979){_0x49baf4[_0xbb10('0x7')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x8')](function(_0x513741){_0x49baf4[_0xbb10('0x9')](_0xbb10('0xa'),_0x513741[_0xbb10('0xb')](function(_0x1c3ee5){return{'id':_0x1c3ee5['id']};}));return SmsMessage[_0xbb10('0xc')]({'where':{'SmsInteractionId':_0x49baf4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb10('0x8')](function(_0x229887){_0x49baf4[_0xbb10('0x9')]('unreadMessages',_0x229887['length']);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e+':'+_0x49baf4['id'],_0x49baf4);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e,_0x49baf4);_0x481979(null);})[_0xbb10('0xe')](_0x481979(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xbb10('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0f170a9..aea8b14 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 _0x2441=['api','moment','bluebird','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x40956e,_0x26a380){var _0x167445=function(_0x1e47a9){while(--_0x1e47a9){_0x40956e['push'](_0x40956e['shift']());}};_0x167445(++_0x26a380);}(_0x2441,0x1cd));var _0x1244=function(_0x15af62,_0x204ca3){_0x15af62=_0x15af62-0x0;var _0xefcbd2=_0x2441[_0x15af62];return _0xefcbd2;};'use strict';var _=require(_0x1244('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1244('0x1'));var moment=require(_0x1244('0x2'));var BPromise=require(_0x1244('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1244('0x4'));module[_0x1244('0x5')]=function(_0x1db5fe,_0x1e143c){return _0x1db5fe[_0x1244('0x6')](_0x1244('0x7'),attributes,{'tableName':_0x1244('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x314f7c,_0x45977a,_0x470218){if(_0x314f7c[_0x1244('0x9')](_0x1244('0xa'))){_0x314f7c[_0x1244('0xb')]=moment()[_0x1244('0xc')](_0x1244('0xd'));}_0x470218(null,_0x314f7c);}}});}; \ No newline at end of file +var _0xe06e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3d552b,_0x25899e){var _0x55a744=function(_0x56168e){while(--_0x56168e){_0x3d552b['push'](_0x3d552b['shift']());}};_0x55a744(++_0x25899e);}(_0xe06e,0x80));var _0xee06=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xe06e[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xee06('0x0'));var util=require(_0xee06('0x1'));var logger=require('../../config/logger')(_0xee06('0x2'));var moment=require(_0xee06('0x3'));var BPromise=require(_0xee06('0x4'));var rp=require(_0xee06('0x5'));var fs=require('fs');var path=require(_0xee06('0x6'));var rimraf=require(_0xee06('0x7'));var config=require(_0xee06('0x8'));var attributes=require(_0xee06('0x9'));module['exports']=function(_0x1b1aa0,_0x5b4394){return _0x1b1aa0[_0xee06('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1131ae,_0x17e132,_0x285de4){if(_0x1131ae[_0xee06('0xb')](_0xee06('0xc'))){_0x1131ae[_0xee06('0xd')]=moment()[_0xee06('0xe')](_0xee06('0xf'));}_0x285de4(null,_0x1131ae);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 42ac870..a15e0dc 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 _0xdf1c=['find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','then','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','attributes','limit','AddTagsToSmsInteraction'];(function(_0x367ce7,_0x5e8cee){var _0x1d0195=function(_0x4dad65){while(--_0x4dad65){_0x367ce7['push'](_0x367ce7['shift']());}};_0x1d0195(++_0x5e8cee);}(_0xdf1c,0x137));var _0xcdf1=function(_0x395e72,_0x12ec47){_0x395e72=_0x395e72-0x0;var _0x49c4be=_0xdf1c[_0x395e72];return _0x49c4be;};'use strict';var _=require('lodash');var util=require(_0xcdf1('0x0'));var moment=require(_0xcdf1('0x1'));var BPromise=require(_0xcdf1('0x2'));var rs=require(_0xcdf1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcdf1('0x4'));var logger=require('../../config/logger')(_0xcdf1('0x5'));var config=require('../../config/environment');var jayson=require(_0xcdf1('0x6'));var client=jayson[_0xcdf1('0x7')][_0xcdf1('0x8')]({'port':0x232a});config[_0xcdf1('0x9')]=_['defaults'](config[_0xcdf1('0x9')],{'host':_0xcdf1('0xa'),'port':0x18eb});var socket=require(_0xcdf1('0xb'))(new Redis(config[_0xcdf1('0x9')]));require(_0xcdf1('0xc'))['register'](socket);function respondWithRpcPromise(_0x217dc8,_0x1391ed,_0x9201e2){return new BPromise(function(_0x3b8a3c,_0x52bb13){return client['request'](_0x217dc8,_0x9201e2)[_0xcdf1('0xd')](function(_0x4f6e0b){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1391ed,'request\x20sent');logger[_0xcdf1('0xe')](_0xcdf1('0xf'),_0x1391ed,_0xcdf1('0x10'),JSON[_0xcdf1('0x11')](_0x4f6e0b));if(_0x4f6e0b[_0xcdf1('0x12')]){if(_0x4f6e0b[_0xcdf1('0x12')]['code']===0x1f4){logger[_0xcdf1('0x12')](_0xcdf1('0x13'),_0x1391ed,_0x4f6e0b[_0xcdf1('0x12')][_0xcdf1('0x14')]);return _0x52bb13(_0x4f6e0b[_0xcdf1('0x12')]['message']);}logger[_0xcdf1('0x12')](_0xcdf1('0x13'),_0x1391ed,_0x4f6e0b[_0xcdf1('0x12')][_0xcdf1('0x14')]);return _0x3b8a3c(_0x4f6e0b[_0xcdf1('0x12')]['message']);}else{logger[_0xcdf1('0x15')](_0xcdf1('0x13'),_0x1391ed,'request\x20sent');_0x3b8a3c(_0x4f6e0b[_0xcdf1('0x16')][_0xcdf1('0x14')]);}})[_0xcdf1('0x17')](function(_0x4ce47a){logger[_0xcdf1('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x1391ed,_0x4ce47a);_0x52bb13(_0x4ce47a);});});}exports[_0xcdf1('0x18')]=function(_0x151601){var _0x566dbc=this;return new Promise(function(_0x30b4d8,_0x35d4a6){return db[_0xcdf1('0x19')]['update'](_0x151601[_0xcdf1('0x1a')],{'raw':_0x151601[_0xcdf1('0x1b')]?_0x151601[_0xcdf1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151601['options']?_0x151601[_0xcdf1('0x1b')]['where']||null:null,'attributes':_0x151601['options']?_0x151601[_0xcdf1('0x1b')][_0xcdf1('0x1c')]||null:null,'limit':_0x151601['options']?_0x151601[_0xcdf1('0x1b')][_0xcdf1('0x1d')]||null:null})[_0xcdf1('0xd')](function(_0x2aff16){logger[_0xcdf1('0x15')](_0xcdf1('0x18'),_0x151601);logger[_0xcdf1('0xe')](_0xcdf1('0x18'),_0x151601,JSON[_0xcdf1('0x11')](_0x2aff16));_0x30b4d8(_0x2aff16);})[_0xcdf1('0x17')](function(_0x4b98a5){logger['error']('UpdateSmsInteraction',_0x4b98a5[_0xcdf1('0x14')],_0x151601);_0x35d4a6(_0x566dbc[_0xcdf1('0x12')](0x1f4,_0x4b98a5['message']));});});};exports[_0xcdf1('0x1e')]=function(_0x44b2cf){return new Promise(function(_0x22361a,_0xaaaba1){return db[_0xcdf1('0x19')][_0xcdf1('0x1f')]({'where':_0x44b2cf[_0xcdf1('0x1b')]?_0x44b2cf[_0xcdf1('0x1b')][_0xcdf1('0x20')]||null:null})[_0xcdf1('0xd')](function(_0x5e55d4){if(_0x5e55d4){return _0x5e55d4[_0xcdf1('0x21')](_0x44b2cf[_0xcdf1('0x1a')][_0xcdf1('0x22')],_[_0xcdf1('0x23')](_0x44b2cf[_0xcdf1('0x1a')],[_0xcdf1('0x22'),'id'])||{});}})[_0xcdf1('0x24')](function(_0x110d1c){logger[_0xcdf1('0x15')]('AddTags',_0x44b2cf);logger[_0xcdf1('0xe')]('AddTags',_0x44b2cf,JSON[_0xcdf1('0x11')](_0x110d1c));_0x22361a(_0x110d1c);})['catch'](function(_0x5e70cb){logger[_0xcdf1('0x12')](_0xcdf1('0x25'),_0x5e70cb[_0xcdf1('0x14')],_0x44b2cf);_0xaaaba1(_this[_0xcdf1('0x12')](0x1f4,_0x5e70cb[_0xcdf1('0x14')]));});});}; \ No newline at end of file +var _0x5542=['rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1ebb33,_0x36672e){var _0x3a6c0d=function(_0x122630){while(--_0x122630){_0x1ebb33['push'](_0x1ebb33['shift']());}};_0x3a6c0d(++_0x36672e);}(_0x5542,0x142));var _0x2554=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x5542[_0x270a54];return _0x4d07d0;};'use strict';var _=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var moment=require(_0x2554('0x2'));var BPromise=require(_0x2554('0x3'));var rs=require(_0x2554('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2554('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2554('0x6'));var config=require('../../config/environment');var jayson=require(_0x2554('0x7'));var client=jayson['client'][_0x2554('0x8')]({'port':0x232a});config[_0x2554('0x9')]=_[_0x2554('0xa')](config[_0x2554('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2554('0xb'))(new Redis(config[_0x2554('0x9')]));require('./smsInteraction.socket')[_0x2554('0xc')](socket);function respondWithRpcPromise(_0x2b9378,_0x3c2092,_0x3a1a42){return new BPromise(function(_0x2bdf47,_0x50af5b){return client[_0x2554('0xd')](_0x2b9378,_0x3a1a42)[_0x2554('0xe')](function(_0x47a4cf){logger['info'](_0x2554('0xf'),_0x3c2092,_0x2554('0x10'));logger[_0x2554('0x11')](_0x2554('0x12'),_0x3c2092,_0x2554('0x10'),JSON[_0x2554('0x13')](_0x47a4cf));if(_0x47a4cf[_0x2554('0x14')]){if(_0x47a4cf[_0x2554('0x14')][_0x2554('0x15')]===0x1f4){logger[_0x2554('0x14')](_0x2554('0xf'),_0x3c2092,_0x47a4cf[_0x2554('0x14')][_0x2554('0x16')]);return _0x50af5b(_0x47a4cf[_0x2554('0x14')]['message']);}logger['error'](_0x2554('0xf'),_0x3c2092,_0x47a4cf[_0x2554('0x14')]['message']);return _0x2bdf47(_0x47a4cf[_0x2554('0x14')]['message']);}else{logger[_0x2554('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x3c2092,_0x2554('0x10'));_0x2bdf47(_0x47a4cf[_0x2554('0x18')]['message']);}})[_0x2554('0x19')](function(_0x51e394){logger[_0x2554('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x3c2092,_0x51e394);_0x50af5b(_0x51e394);});});}exports[_0x2554('0x1a')]=function(_0x4761cd){var _0x5f1de4=this;return new Promise(function(_0xd0ee31,_0x499b5f){return db[_0x2554('0x1b')][_0x2554('0x1c')](_0x4761cd[_0x2554('0x1d')],{'raw':_0x4761cd['options']?_0x4761cd[_0x2554('0x1e')][_0x2554('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4761cd['options']?_0x4761cd['options']['where']||null:null,'attributes':_0x4761cd[_0x2554('0x1e')]?_0x4761cd[_0x2554('0x1e')][_0x2554('0x20')]||null:null,'limit':_0x4761cd[_0x2554('0x1e')]?_0x4761cd[_0x2554('0x1e')][_0x2554('0x21')]||null:null})[_0x2554('0xe')](function(_0x97b645){logger['info'](_0x2554('0x1a'),_0x4761cd);logger['debug'](_0x2554('0x1a'),_0x4761cd,JSON[_0x2554('0x13')](_0x97b645));_0xd0ee31(_0x97b645);})['catch'](function(_0x3586fc){logger[_0x2554('0x14')](_0x2554('0x1a'),_0x3586fc[_0x2554('0x16')],_0x4761cd);_0x499b5f(_0x5f1de4[_0x2554('0x14')](0x1f4,_0x3586fc[_0x2554('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x57db47){return new Promise(function(_0x1c6d74,_0x1ce9ff){return db[_0x2554('0x1b')][_0x2554('0x22')]({'where':_0x57db47[_0x2554('0x1e')]?_0x57db47[_0x2554('0x1e')][_0x2554('0x23')]||null:null})['then'](function(_0xb4d91a){if(_0xb4d91a){return _0xb4d91a[_0x2554('0x24')](_0x57db47[_0x2554('0x1d')][_0x2554('0x25')],_[_0x2554('0x26')](_0x57db47[_0x2554('0x1d')],[_0x2554('0x25'),'id'])||{});}})[_0x2554('0x27')](function(_0x22b8eb){logger[_0x2554('0x17')](_0x2554('0x28'),_0x57db47);logger[_0x2554('0x11')](_0x2554('0x28'),_0x57db47,JSON[_0x2554('0x13')](_0x22b8eb));_0x1c6d74(_0x22b8eb);})[_0x2554('0x19')](function(_0x967a24){logger[_0x2554('0x14')]('AddTags',_0x967a24['message'],_0x57db47);_0x1ce9ff(_this[_0x2554('0x14')](0x1f4,_0x967a24['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1c3aaa0..d97a6e1 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 _0xbc9c=['removeListener','smsInteraction:','save','remove','update','emit'];(function(_0x29abf7,_0x1f3cb0){var _0x22a76d=function(_0x4a1a90){while(--_0x4a1a90){_0x29abf7['push'](_0x29abf7['shift']());}};_0x22a76d(++_0x1f3cb0);}(_0xbc9c,0x9e));var _0xcbc9=function(_0x9732c4,_0x31a757){_0x9732c4=_0x9732c4-0x0;var _0x367dc4=_0xbc9c[_0x9732c4];return _0x367dc4;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xcbc9('0x0'),_0xcbc9('0x1'),_0xcbc9('0x2')];function createListener(_0x37409b,_0x390177){return function(_0x367b19){_0x390177[_0xcbc9('0x3')](_0x37409b,_0x367b19);};}function removeListener(_0x158470,_0x3b18db){return function(){SmsInteractionEvents[_0xcbc9('0x4')](_0x158470,_0x3b18db);};}exports['register']=function(_0x552b06){for(var _0x281a16=0x0,_0x1f034d=events['length'];_0x281a16<_0x1f034d;_0x281a16++){var _0x42ffad=events[_0x281a16];var _0x19915a=createListener(_0xcbc9('0x5')+_0x42ffad,_0x552b06);SmsInteractionEvents['on'](_0x42ffad,_0x19915a);}}; \ No newline at end of file +var _0xba35=['length','save','update','emit'];(function(_0x54c778,_0x4a859f){var _0x2c4be9=function(_0x569f46){while(--_0x569f46){_0x54c778['push'](_0x54c778['shift']());}};_0x2c4be9(++_0x4a859f);}(_0xba35,0xe9));var _0x5ba3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba35[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x5ba3('0x0'),'remove',_0x5ba3('0x1')];function createListener(_0xc27ad5,_0x1949a4){return function(_0x62a0b8){_0x1949a4[_0x5ba3('0x2')](_0xc27ad5,_0x62a0b8);};}function removeListener(_0x3394e2,_0x515e55){return function(){SmsInteractionEvents['removeListener'](_0x3394e2,_0x515e55);};}exports['register']=function(_0x4655ba){for(var _0x5d82f4=0x0,_0x3aa6f1=events[_0x5ba3('0x3')];_0x5d82f4<_0x3aa6f1;_0x5d82f4++){var _0x243474=events[_0x5d82f4];var _0xcb588d=createListener('smsInteraction:'+_0x243474,_0x4655ba);SmsInteractionEvents['on'](_0x243474,_0xcb588d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 500ff66..994c712 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 _0x4255=['describe','show','smsmessage:create','post','/:id/status','put','update','reject','delete','/:id','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4255,0x1bb));var _0x5425=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x4255[_0x1e6db3];return _0x1de886;};'use strict';var multer=require(_0x5425('0x0'));var util=require('util');var path=require(_0x5425('0x1'));var timeout=require(_0x5425('0x2'));var express=require(_0x5425('0x3'));var router=express[_0x5425('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5425('0x5'));var interaction=require(_0x5425('0x6'));var config=require(_0x5425('0x7'));var controller=require(_0x5425('0x8'));router[_0x5425('0x9')]('/',auth[_0x5425('0xa')](),controller[_0x5425('0xb')]);router[_0x5425('0x9')](_0x5425('0xc'),auth[_0x5425('0xa')](),controller[_0x5425('0xd')]);router[_0x5425('0x9')]('/:id',auth[_0x5425('0xa')](),controller[_0x5425('0xe')]);router['post']('/',auth[_0x5425('0xa')](),interaction['tracked']('sms',_0x5425('0xf')),controller['create']);router[_0x5425('0x10')](_0x5425('0x11'),controller['status']);router[_0x5425('0x12')]('/:id',auth[_0x5425('0xa')](),controller[_0x5425('0x13')]);router[_0x5425('0x12')]('/:id/accept',auth[_0x5425('0xa')](),controller['accept']);router[_0x5425('0x12')]('/:id/reject',auth[_0x5425('0xa')](),controller[_0x5425('0x14')]);router[_0x5425('0x15')](_0x5425('0x16'),auth[_0x5425('0xa')](),controller[_0x5425('0x17')]);module['exports']=router; \ No newline at end of file +var _0x33b4=['/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','sms','smsmessage:create','create'];(function(_0x32e33c,_0x2c4cf7){var _0x1805a2=function(_0x34ec7e){while(--_0x34ec7e){_0x32e33c['push'](_0x32e33c['shift']());}};_0x1805a2(++_0x2c4cf7);}(_0x33b4,0x160));var _0x433b=function(_0x4e2964,_0x1bf262){_0x4e2964=_0x4e2964-0x0;var _0x57d48f=_0x33b4[_0x4e2964];return _0x57d48f;};'use strict';var multer=require('multer');var util=require(_0x433b('0x0'));var path=require('path');var timeout=require(_0x433b('0x1'));var express=require(_0x433b('0x2'));var router=express[_0x433b('0x3')]();var fs_extra=require(_0x433b('0x4'));var auth=require(_0x433b('0x5'));var interaction=require(_0x433b('0x6'));var config=require(_0x433b('0x7'));var controller=require(_0x433b('0x8'));router[_0x433b('0x9')]('/',auth[_0x433b('0xa')](),controller[_0x433b('0xb')]);router[_0x433b('0x9')]('/describe',auth[_0x433b('0xa')](),controller[_0x433b('0xc')]);router['get'](_0x433b('0xd'),auth['isAuthenticated'](),controller[_0x433b('0xe')]);router[_0x433b('0xf')]('/',auth[_0x433b('0xa')](),interaction[_0x433b('0x10')](_0x433b('0x11'),_0x433b('0x12')),controller[_0x433b('0x13')]);router[_0x433b('0xf')](_0x433b('0x14'),controller[_0x433b('0x15')]);router[_0x433b('0x16')]('/:id',auth[_0x433b('0xa')](),controller[_0x433b('0x17')]);router['put'](_0x433b('0x18'),auth[_0x433b('0xa')](),controller[_0x433b('0x19')]);router[_0x433b('0x16')](_0x433b('0x1a'),auth[_0x433b('0xa')](),controller[_0x433b('0x1b')]);router[_0x433b('0x1c')](_0x433b('0xd'),auth['isAuthenticated'](),controller[_0x433b('0x1d')]);module[_0x433b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a1bf332..88352a6 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 _0x917e=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x917e,0x155));var _0xe917=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x917e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe917('0x0'));module[_0xe917('0x1')]={'body':{'type':Sequelize[_0xe917('0x2')](_0xe917('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe917('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe917('0x5')]('in',_0xe917('0x6')),'defaultValue':_0xe917('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe917('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe917('0x8')]},'secret':{'type':Sequelize[_0xe917('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe917('0x7')]},'providerResponse':{'type':Sequelize[_0xe917('0x2')]}}; \ No newline at end of file +var _0x18a3=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x51fc7d,_0x47b22b){var _0x536408=function(_0xd613f4){while(--_0xd613f4){_0x51fc7d['push'](_0x51fc7d['shift']());}};_0x536408(++_0x47b22b);}(_0x18a3,0xb3));var _0x318a=function(_0x35b76e,_0x2bebee){_0x35b76e=_0x35b76e-0x0;var _0x19f208=_0x18a3[_0x35b76e];return _0x19f208;};'use strict';var Sequelize=require(_0x318a('0x0'));module[_0x318a('0x1')]={'body':{'type':Sequelize[_0x318a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x318a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x318a('0x4')]('in',_0x318a('0x5')),'defaultValue':_0x318a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x318a('0x6')]},'readAt':{'type':Sequelize[_0x318a('0x7')]},'secret':{'type':Sequelize[_0x318a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x318a('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 4a3435f..67de30f 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 _0x3646=['VIRTUAL','merge','includeAll','include','findAll','catch','show','fields','find','body','params','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','stringify','RejectMessage','rejectMessage','email','rejectmessage','SmsAccount','SmsAccountId','type','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','info','sendStatus','end','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','index','map','SmsMessage','rawAttributes','fieldName','key','name','keys','query','filters','intersection','attributes','length','model','limit','sort','where','pick','filter'];(function(_0x14a94e,_0x1fc2d0){var _0x3d9238=function(_0x1867b0){while(--_0x1867b0){_0x14a94e['push'](_0x14a94e['shift']());}};_0x3d9238(++_0x1fc2d0);}(_0x3646,0x15f));var _0x6364=function(_0x10dcc5,_0x3d9728){_0x10dcc5=_0x10dcc5-0x0;var _0x2cc2e9=_0x3646[_0x10dcc5];return _0x2cc2e9;};'use strict';var emlformat=require(_0x6364('0x0'));var rimraf=require(_0x6364('0x1'));var zipdir=require(_0x6364('0x2'));var jsonpatch=require(_0x6364('0x3'));var rp=require('request-promise');var moment=require(_0x6364('0x4'));var BPromise=require(_0x6364('0x5'));var Mustache=require(_0x6364('0x6'));var util=require(_0x6364('0x7'));var path=require(_0x6364('0x8'));var sox=require(_0x6364('0x9'));var csv=require(_0x6364('0xa'));var ejs=require(_0x6364('0xb'));var fs=require('fs');var fs_extra=require(_0x6364('0xc'));var _=require(_0x6364('0xd'));var squel=require(_0x6364('0xe'));var crypto=require('crypto');var jsforce=require(_0x6364('0xf'));var deskjs=require(_0x6364('0x10'));var toCsv=require(_0x6364('0xa'));var querystring=require(_0x6364('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6364('0x12'));var as=require(_0x6364('0x13'));var hardwareService=require(_0x6364('0x14'));var logger=require(_0x6364('0x15'))(_0x6364('0x16'));var utils=require(_0x6364('0x17'));var config=require(_0x6364('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6364('0x19'))['db'];config[_0x6364('0x1a')]=_[_0x6364('0x1b')](config['redis'],{'host':_0x6364('0x1c'),'port':0x18eb});var socket=require(_0x6364('0x1d'))(new Redis(config[_0x6364('0x1a')]));require(_0x6364('0x1e'))['register'](socket);var jayson=require(_0x6364('0x1f'));var client=jayson['client'][_0x6364('0x20')]({'port':0x232c});var client9002=jayson[_0x6364('0x21')][_0x6364('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x56ca03,_0x2cfaa8,_0x7a9076,_0x2a017f){return new BPromise(function(_0x363fd7,_0xea0464){var _0x1ce965=_0x2a017f||client;return _0x1ce965[_0x6364('0x22')](_0x56ca03,_0x7a9076)['then'](function(_0xfb0fbb){logger['info'](_0x6364('0x23'),_0x2cfaa8,_0x6364('0x24'));logger[_0x6364('0x25')](_0x6364('0x26'),_0x2cfaa8,_0x6364('0x24'),JSON['stringify'](_0xfb0fbb));if(_0xfb0fbb[_0x6364('0x27')]){if(_0xfb0fbb[_0x6364('0x27')]['code']===0x1f4){logger[_0x6364('0x27')]('SmsMessage,\x20%s,\x20%s',_0x2cfaa8,_0xfb0fbb[_0x6364('0x27')][_0x6364('0x28')]);return _0xea0464(_0xfb0fbb[_0x6364('0x27')][_0x6364('0x28')]);}logger[_0x6364('0x27')](_0x6364('0x23'),_0x2cfaa8,_0xfb0fbb[_0x6364('0x27')]['message']);return _0x363fd7(_0xfb0fbb[_0x6364('0x27')]['message']);}else{logger[_0x6364('0x29')](_0x6364('0x23'),_0x2cfaa8,_0x6364('0x24'));_0x363fd7(_0xfb0fbb['result'][_0x6364('0x28')]);}})['catch'](function(_0x32c3e8){logger[_0x6364('0x27')](_0x6364('0x23'),_0x2cfaa8,_0x32c3e8);_0xea0464(_0x32c3e8);});});}function respondWithStatusCode(_0x5173f3,_0x1d9530){_0x1d9530=_0x1d9530||0xcc;return function(_0x548ef2){if(_0x548ef2){return _0x5173f3[_0x6364('0x2a')](_0x1d9530);}return _0x5173f3['status'](_0x1d9530)[_0x6364('0x2b')]();};}function respondWithResult(_0x54fc0e,_0x47581a){_0x47581a=_0x47581a||0xc8;return function(_0x1f5a9f){if(_0x1f5a9f){return _0x54fc0e[_0x6364('0x2c')](_0x47581a)['json'](_0x1f5a9f);}};}function respondWithFilteredResult(_0xd879a7,_0x1e40ff){return function(_0x265106){if(_0x265106){var _0x487945=typeof _0x1e40ff[_0x6364('0x2d')]===_0x6364('0x2e')&&typeof _0x1e40ff['limit']===_0x6364('0x2e');var _0x34b612=_0x265106[_0x6364('0x2f')];var _0x1b5da6=_0x487945?0x0:_0x1e40ff[_0x6364('0x2d')];var _0x3b9163=_0x487945?_0x265106[_0x6364('0x2f')]:_0x1e40ff[_0x6364('0x2d')]+_0x1e40ff['limit'];var _0x6479ac;if(_0x3b9163>=_0x34b612){_0x3b9163=_0x34b612;_0x6479ac=0xc8;}else{_0x6479ac=0xce;}_0xd879a7[_0x6364('0x2c')](_0x6479ac);return _0xd879a7[_0x6364('0x30')](_0x6364('0x31'),_0x1b5da6+'-'+_0x3b9163+'/'+_0x34b612)['json'](_0x265106);}return null;};}function patchUpdates(_0x45c3f7){return function(_0x3dd648){try{jsonpatch[_0x6364('0x32')](_0x3dd648,_0x45c3f7,!![]);}catch(_0x3aef91){return BPromise[_0x6364('0x33')](_0x3aef91);}return _0x3dd648[_0x6364('0x34')]();};}function saveUpdates(_0xa612ba,_0x5753bf){return function(_0x3064e5){if(_0x3064e5){return _0x3064e5[_0x6364('0x35')](_0xa612ba)[_0x6364('0x36')](function(_0x1e8262){return _0x1e8262;});}return null;};}function removeEntity(_0xd8ed3e,_0x82eb55){return function(_0x5f0be9){if(_0x5f0be9){return _0x5f0be9[_0x6364('0x37')]()[_0x6364('0x36')](function(){_0xd8ed3e['status'](0xcc)[_0x6364('0x2b')]();});}};}function handleEntityNotFound(_0x54b09d,_0x6ad014){return function(_0x4d8a23){if(!_0x4d8a23){_0x54b09d[_0x6364('0x2a')](0x194);}return _0x4d8a23;};}function handleError(_0x3047b9,_0x19292d){_0x19292d=_0x19292d||0x1f4;return function(_0x41ef37){logger[_0x6364('0x27')](_0x41ef37['stack']);if(_0x41ef37['name']){delete _0x41ef37['name'];}_0x3047b9['status'](_0x19292d)['send'](_0x41ef37);};}exports[_0x6364('0x38')]=function(_0x784b32,_0x20f551){var _0x484f54={},_0x5cd36d={},_0x58dc80={'count':0x0,'rows':[]};var _0x2c02c4=_[_0x6364('0x39')](db[_0x6364('0x3a')][_0x6364('0x3b')],function(_0x268211){return{'name':_0x268211[_0x6364('0x3c')],'type':_0x268211['type'][_0x6364('0x3d')]};});_0x5cd36d['model']=_[_0x6364('0x39')](_0x2c02c4,_0x6364('0x3e'));_0x5cd36d['query']=_[_0x6364('0x3f')](_0x784b32[_0x6364('0x40')]);_0x5cd36d[_0x6364('0x41')]=_[_0x6364('0x42')](_0x5cd36d['model'],_0x5cd36d[_0x6364('0x40')]);_0x484f54[_0x6364('0x43')]=_[_0x6364('0x42')](_0x5cd36d['model'],qs['fields'](_0x784b32['query']['fields']));_0x484f54[_0x6364('0x43')]=_0x484f54['attributes'][_0x6364('0x44')]?_0x484f54[_0x6364('0x43')]:_0x5cd36d[_0x6364('0x45')];if(!_0x784b32[_0x6364('0x40')]['hasOwnProperty']('nolimit')){_0x484f54[_0x6364('0x46')]=qs[_0x6364('0x46')](_0x784b32[_0x6364('0x40')][_0x6364('0x46')]);_0x484f54['offset']=qs[_0x6364('0x2d')](_0x784b32['query']['offset']);}_0x484f54['order']=qs[_0x6364('0x47')](_0x784b32[_0x6364('0x40')][_0x6364('0x47')]);_0x484f54[_0x6364('0x48')]=qs[_0x6364('0x41')](_[_0x6364('0x49')](_0x784b32[_0x6364('0x40')],_0x5cd36d[_0x6364('0x41')]),_0x2c02c4);if(_0x784b32[_0x6364('0x40')][_0x6364('0x4a')]){_0x484f54['where']=_['merge'](_0x484f54[_0x6364('0x48')],{'$or':_[_0x6364('0x39')](_0x2c02c4,function(_0x2668f6){if(_0x2668f6['type']!==_0x6364('0x4b')){var _0x3fd05b={};_0x3fd05b[_0x2668f6['name']]={'$like':'%'+_0x784b32[_0x6364('0x40')]['filter']+'%'};return _0x3fd05b;}})});}_0x484f54=_[_0x6364('0x4c')]({},_0x484f54,_0x784b32['options']);var _0x5ddc35={'where':_0x484f54['where']};return db[_0x6364('0x3a')][_0x6364('0x2f')](_0x5ddc35)[_0x6364('0x36')](function(_0x38074a){_0x58dc80[_0x6364('0x2f')]=_0x38074a;if(_0x784b32['query'][_0x6364('0x4d')]){_0x484f54[_0x6364('0x4e')]=[{'all':!![]}];}return db[_0x6364('0x3a')][_0x6364('0x4f')](_0x484f54);})[_0x6364('0x36')](function(_0x9d3e69){_0x58dc80['rows']=_0x9d3e69;return _0x58dc80;})['then'](respondWithFilteredResult(_0x20f551,_0x484f54))[_0x6364('0x50')](handleError(_0x20f551,null));};exports[_0x6364('0x51')]=function(_0x34ee28,_0x40a7e3){var _0x372471={'raw':!![],'where':{'id':_0x34ee28['params']['id']}},_0x21aa29={};_0x21aa29[_0x6364('0x45')]=_['keys'](db[_0x6364('0x3a')]['rawAttributes']);_0x21aa29[_0x6364('0x40')]=_[_0x6364('0x3f')](_0x34ee28['query']);_0x21aa29[_0x6364('0x41')]=_[_0x6364('0x42')](_0x21aa29[_0x6364('0x45')],_0x21aa29[_0x6364('0x40')]);_0x372471[_0x6364('0x43')]=_[_0x6364('0x42')](_0x21aa29[_0x6364('0x45')],qs[_0x6364('0x52')](_0x34ee28[_0x6364('0x40')][_0x6364('0x52')]));_0x372471[_0x6364('0x43')]=_0x372471['attributes'][_0x6364('0x44')]?_0x372471[_0x6364('0x43')]:_0x21aa29[_0x6364('0x45')];if(_0x34ee28[_0x6364('0x40')][_0x6364('0x4d')]){_0x372471[_0x6364('0x4e')]=[{'all':!![]}];}_0x372471=_[_0x6364('0x4c')]({},_0x372471,_0x34ee28['options']);return db[_0x6364('0x3a')][_0x6364('0x53')](_0x372471)[_0x6364('0x36')](handleEntityNotFound(_0x40a7e3,null))[_0x6364('0x36')](respondWithResult(_0x40a7e3,null))[_0x6364('0x50')](handleError(_0x40a7e3,null));};exports['create']=function(_0x38276a,_0x580c30){return db[_0x6364('0x3a')]['create'](_0x38276a[_0x6364('0x54')],{})[_0x6364('0x36')](respondWithResult(_0x580c30,0xc9))[_0x6364('0x50')](handleError(_0x580c30,null));};exports[_0x6364('0x35')]=function(_0x4b1ea6,_0x4c077c){if(_0x4b1ea6['body']['id']){delete _0x4b1ea6[_0x6364('0x54')]['id'];}return db[_0x6364('0x3a')][_0x6364('0x53')]({'where':{'id':_0x4b1ea6[_0x6364('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c077c,null))['then'](saveUpdates(_0x4b1ea6[_0x6364('0x54')],null))['then'](respondWithResult(_0x4c077c,null))[_0x6364('0x50')](handleError(_0x4c077c,null));};exports[_0x6364('0x37')]=function(_0x2bd2b5,_0x4909f5){return db[_0x6364('0x3a')][_0x6364('0x53')]({'where':{'id':_0x2bd2b5['params']['id']}})[_0x6364('0x36')](handleEntityNotFound(_0x4909f5,null))[_0x6364('0x36')](removeEntity(_0x4909f5,null))['catch'](handleError(_0x4909f5,null));};exports[_0x6364('0x56')]=function(_0x40deec,_0xa698ac){return db[_0x6364('0x3a')]['describe']()['then'](respondWithResult(_0xa698ac,null))[_0x6364('0x50')](handleError(_0xa698ac,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x6364('0x57')]=function(_0x1613a3,_0x2f535d,_0x44f066){var _0x5c8766={'agent':{},'channel':'sms'};if(_0x1613a3[_0x6364('0x54')]['id']){delete _0x1613a3[_0x6364('0x54')]['id'];}_0x1613a3['body'][_0x6364('0x58')]=!![];_0x1613a3[_0x6364('0x54')]['readAt']=moment()[_0x6364('0x59')](_0x6364('0x5a'));_0x1613a3['body'][_0x6364('0x5b')]=_0x1613a3['body'][_0x6364('0x5b')]||_0x1613a3['user']['id'];_0x5c8766[_0x6364('0x5c')]['id']=_0x1613a3[_0x6364('0x54')][_0x6364('0x5b')];return db['SmsMessage'][_0x6364('0x53')]({'where':{'id':_0x1613a3['params']['id'],'UserId':null}})[_0x6364('0x36')](handleEntityNotFound(_0x2f535d,null))[_0x6364('0x36')](saveUpdates(_0x1613a3[_0x6364('0x54')],null))[_0x6364('0x36')](function(_0x2babdc){if(_0x2babdc){_0x5c8766['message']=_0x2babdc[_0x6364('0x5d')]({'plain':!![]});return db[_0x6364('0x5e')][_0x6364('0x53')]({'where':{'id':_0x2babdc[_0x6364('0x5f')]}});}return null;})[_0x6364('0x36')](handleEntityNotFound(_0x2f535d,null))[_0x6364('0x36')](function(_0x5d78ad){if(_0x5d78ad){return _0x5d78ad[_0x6364('0x35')]({'UserId':_0x1613a3[_0x6364('0x54')]['UserId'],'read1stAt':_[_0x6364('0x60')](_0x5d78ad['read1stAt'])?moment()[_0x6364('0x59')](_0x6364('0x5a')):undefined});}return null;})[_0x6364('0x36')](function(_0x2530ea){if(_0x2530ea){_0x5c8766['interaction']=_0x2530ea[_0x6364('0x5d')]({'plain':!![]});interaction_log[_0x6364('0x29')](_0x6364('0x61'),_0x1613a3[_0x6364('0x62')]['id'],_0x1613a3[_0x6364('0x62')][_0x6364('0x3e')],_0x1613a3['user'][_0x6364('0x63')],_0x5c8766[_0x6364('0x64')]['id'],_0x1613a3['body']?JSON['stringify'](_0x1613a3[_0x6364('0x54')]):_0x6364('0x65'));return respondWithRpcPromise(_0x6364('0x66'),'acceptMessage',_0x5c8766);}return null;})[_0x6364('0x36')](function(_0x337d9d){var _0x399e96=_0x6364('0x67')+_0x337d9d[_0x6364('0x28')][_0x6364('0x68')];return db[_0x6364('0x69')][_0x6364('0x40')](_0x399e96,{'type':db[_0x6364('0x6a')][_0x6364('0x6b')][_0x6364('0x6c')],'raw':!![]})[_0x6364('0x36')](function(_0x5d6e36){return _0x5d6e36;});})['then'](function(_0x3fe599){if(_0x3fe599){_0x5c8766[_0x6364('0x28')][_0x6364('0x6d')]=_0x3fe599[0x0];if(!_0x1613a3[_0x6364('0x54')][_0x6364('0x5b')])return;return db[_0x6364('0x6e')]['find']({'where':{'id':_0x1613a3[_0x6364('0x54')][_0x6364('0x5b')],'role':_0x6364('0x5c')},'attributes':['id',_0x6364('0x3e'),_0x6364('0x6f'),'email',_0x6364('0x70')],'raw':!![]});}return null;})[_0x6364('0x36')](function(_0x457844){if(!_0x457844)return null;_0x5c8766[_0x6364('0x28')]['agent']=_0x457844;return _0x5c8766;})[_0x6364('0x36')](function(_0x20de3d){if(_0x20de3d){if(_0x1613a3[_0x6364('0x54')][_0x6364('0x71')]){_0x5c8766[_0x6364('0x28')][_0x6364('0x72')]=util[_0x6364('0x59')](_0x6364('0x73'),_0x1613a3[_0x6364('0x62')][_0x6364('0x3e')]);_0x5c8766[_0x6364('0x28')][_0x6364('0x74')]=_0x5c8766[_0x6364('0x74')];_0x5c8766['message'][_0x6364('0x75')]=_0x5c8766[_0x6364('0x74')];_0x5c8766[_0x6364('0x28')][_0x6364('0x76')]=_0x6364('0x57');return respondWithRpcPromise(_0x6364('0x77'),_0x6364('0x77'),{'event':_0x6364('0x78'),'message':_0x5c8766[_0x6364('0x28')]},client9002)[_0x6364('0x36')](function(){return _0x5c8766;});}return _0x5c8766;}return null;})[_0x6364('0x36')](respondWithResult(_0x2f535d,null))[_0x6364('0x50')](handleError(_0x2f535d,null));};var interaction_log=require(_0x6364('0x15'))('sms-interactions');exports['reject']=function(_0x3ae44f,_0xb6983,_0x20800f){var _0x225b0f={'agent':{},'channel':_0x6364('0x79')};if(_0x3ae44f['body']['id']){delete _0x3ae44f[_0x6364('0x54')]['id'];}_0x3ae44f[_0x6364('0x54')][_0x6364('0x5b')]=_0x3ae44f[_0x6364('0x54')][_0x6364('0x5b')]||_0x3ae44f[_0x6364('0x62')]['id'];_0x225b0f['agent']['id']=_0x3ae44f[_0x6364('0x54')][_0x6364('0x5b')];return db[_0x6364('0x3a')]['find']({'where':{'id':_0x3ae44f[_0x6364('0x55')]['id'],'UserId':null}})[_0x6364('0x36')](handleEntityNotFound(_0xb6983,null))[_0x6364('0x36')](function(_0x188025){if(_0x188025){_0x225b0f[_0x6364('0x28')]=_0x188025[_0x6364('0x5d')]({'plain':!![]});return db[_0x6364('0x5e')][_0x6364('0x53')]({'where':{'id':_0x188025[_0x6364('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xb6983,null))[_0x6364('0x36')](function(_0x2441a7){if(_0x2441a7){_0x225b0f[_0x6364('0x64')]=_0x2441a7['get']({'plain':!![]});interaction_log[_0x6364('0x29')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ae44f[_0x6364('0x62')]['id'],_0x3ae44f['user'][_0x6364('0x3e')],_0x3ae44f['user']['role'],_0x225b0f[_0x6364('0x64')]['id'],_0x3ae44f[_0x6364('0x54')]?JSON[_0x6364('0x7a')](_0x3ae44f['body']):_0x6364('0x65'));return respondWithRpcPromise(_0x6364('0x7b'),_0x6364('0x7c'),_0x225b0f);}return null;})['then'](function(_0x12d56c){var _0x2e76d5=_0x6364('0x67')+_0x12d56c[_0x6364('0x28')][_0x6364('0x68')];return db['sequelize'][_0x6364('0x40')](_0x2e76d5,{'type':db[_0x6364('0x6a')][_0x6364('0x6b')][_0x6364('0x6c')],'raw':!![]})['then'](function(_0x4f6802){return _0x4f6802;});})['then'](function(_0x59af64){if(_0x59af64){_0x225b0f[_0x6364('0x28')][_0x6364('0x6d')]=_0x59af64[0x0];if(!_0x3ae44f['body'][_0x6364('0x5b')])return;return db[_0x6364('0x6e')][_0x6364('0x53')]({'where':{'id':_0x3ae44f['body']['UserId'],'role':_0x6364('0x5c')},'attributes':['id',_0x6364('0x3e'),_0x6364('0x6f'),_0x6364('0x7d'),_0x6364('0x70')],'raw':!![]});}return null;})[_0x6364('0x36')](function(_0xb1b61c){if(!_0xb1b61c)return null;_0x225b0f['message'][_0x6364('0x5c')]=_0xb1b61c;return _0x225b0f;})[_0x6364('0x36')](function(_0x46156c){if(_0x46156c){_0x46156c['message'][_0x6364('0x72')]=util['format'](_0x6364('0x73'),_0x3ae44f[_0x6364('0x62')][_0x6364('0x3e')]);_0x46156c[_0x6364('0x28')][_0x6364('0x74')]=_0x225b0f[_0x6364('0x74')];_0x46156c[_0x6364('0x28')][_0x6364('0x75')]=_0x225b0f[_0x6364('0x74')];_0x46156c[_0x6364('0x28')][_0x6364('0x76')]=_0x6364('0x33');respondWithRpcPromise(_0x6364('0x77'),_0x6364('0x77'),{'event':_0x6364('0x7e'),'message':_0x46156c[_0x6364('0x28')]},client9002);return _0x225b0f;}return null;})['then'](respondWithResult(_0xb6983,null))['catch'](handleError(_0xb6983,null));};exports[_0x6364('0x2c')]=function(_0x4044fd,_0x3790f2,_0xf63135){if(_0x4044fd[_0x6364('0x54')]['id']){delete _0x4044fd[_0x6364('0x54')]['id'];}var _0xb4f0a;return db['SmsMessage'][_0x6364('0x53')]({'where':{'id':_0x4044fd[_0x6364('0x55')]['id']}})['then'](handleEntityNotFound(_0x3790f2,null))['then'](function(_0x30878b){if(_0x30878b){_0xb4f0a=_0x30878b;return db[_0x6364('0x7f')][_0x6364('0x53')]({'where':{'id':_0x30878b[_0x6364('0x80')]}});}})[_0x6364('0x36')](handleEntityNotFound(_0x3790f2,null))[_0x6364('0x36')](function(_0x13367f){if(_0x13367f){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6364('0x2c'),'received\x20delivery\x20report\x20from',_0x13367f[_0x6364('0x81')],util['inspect'](_0x4044fd['body'],{'showHidden':![],'depth':null}));switch(_0x13367f[_0x6364('0x81')]){case _0x6364('0x82'):if(_0x4044fd['body'][_0x6364('0x83')]&&_0x4044fd['body'][_0x6364('0x83')]===_0xb4f0a['messageId']){return _0xb4f0a[_0x6364('0x35')]({'read':!![]});}else{logger[_0x6364('0x27')](_0x6364('0x84'),'status',_0x6364('0x82'),util[_0x6364('0x85')](_0x4044fd[_0x6364('0x54')],{'showHidden':![],'depth':null}));}break;case _0x6364('0x86'):if(_0x4044fd[_0x6364('0x54')][_0x6364('0x87')]&&_0x4044fd[_0x6364('0x54')][_0x6364('0x87')]===_0xb4f0a[_0x6364('0x88')]&&_[_0x6364('0x89')]([_0x6364('0x8a'),'delivered'],_0x4044fd[_0x6364('0x54')]['Status'])>=0x0){return _0xb4f0a[_0x6364('0x35')]({'read':!![]});}else{logger['error'](_0x6364('0x84'),_0x6364('0x2c'),'plivio',util[_0x6364('0x85')](_0x4044fd[_0x6364('0x54')],{'showHidden':![],'depth':null}));}break;case _0x6364('0x8b'):var _0x21fcb3=_0x4044fd['body']['results'][0x0];if(_0x21fcb3[_0x6364('0x2c')][_0x6364('0x8c')]===_0x6364('0x8d')){return _0xb4f0a[_0x6364('0x35')]({'read':!![]});}else{logger[_0x6364('0x27')](_0x6364('0x84'),_0x6364('0x2c'),'infobip',util[_0x6364('0x85')](_0x4044fd[_0x6364('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xb4f0a;}})[_0x6364('0x36')](respondWithResult(_0x3790f2,null))[_0x6364('0x50')](handleError(_0x3790f2,null));}; \ No newline at end of file +var _0xd3c8=['agent','get','SmsInteraction','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE: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','sequelize','Sequelize','QueryTypes','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SELECT','contact','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','indexOf','sent','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','query','sort','filters','pick','filter','where','merge','SmsMessage','include','findAll','rows','show','params','includeAll','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user'];(function(_0x7bd7dd,_0x4d09c5){var _0x3aa7fe=function(_0x4c2c8a){while(--_0x4c2c8a){_0x7bd7dd['push'](_0x7bd7dd['shift']());}};_0x3aa7fe(++_0x4d09c5);}(_0xd3c8,0x161));var _0x8d3c=function(_0x45ee86,_0x5a732e){_0x45ee86=_0x45ee86-0x0;var _0x36e1e0=_0xd3c8[_0x45ee86];return _0x36e1e0;};'use strict';var emlformat=require(_0x8d3c('0x0'));var rimraf=require(_0x8d3c('0x1'));var zipdir=require(_0x8d3c('0x2'));var jsonpatch=require(_0x8d3c('0x3'));var rp=require(_0x8d3c('0x4'));var moment=require('moment');var BPromise=require(_0x8d3c('0x5'));var Mustache=require(_0x8d3c('0x6'));var util=require(_0x8d3c('0x7'));var path=require(_0x8d3c('0x8'));var sox=require('sox');var csv=require(_0x8d3c('0x9'));var ejs=require(_0x8d3c('0xa'));var fs=require('fs');var fs_extra=require(_0x8d3c('0xb'));var _=require(_0x8d3c('0xc'));var squel=require(_0x8d3c('0xd'));var crypto=require(_0x8d3c('0xe'));var jsforce=require(_0x8d3c('0xf'));var deskjs=require(_0x8d3c('0x10'));var toCsv=require(_0x8d3c('0x9'));var querystring=require(_0x8d3c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8d3c('0x12'));var as=require(_0x8d3c('0x13'));var hardwareService=require(_0x8d3c('0x14'));var logger=require(_0x8d3c('0x15'))(_0x8d3c('0x16'));var utils=require(_0x8d3c('0x17'));var config=require(_0x8d3c('0x18'));var licenseUtil=require(_0x8d3c('0x19'));var db=require(_0x8d3c('0x1a'))['db'];config[_0x8d3c('0x1b')]=_[_0x8d3c('0x1c')](config[_0x8d3c('0x1b')],{'host':_0x8d3c('0x1d'),'port':0x18eb});var socket=require(_0x8d3c('0x1e'))(new Redis(config[_0x8d3c('0x1b')]));require(_0x8d3c('0x1f'))[_0x8d3c('0x20')](socket);var jayson=require(_0x8d3c('0x21'));var client=jayson[_0x8d3c('0x22')][_0x8d3c('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x8d3c('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x19afa6,_0x16575f,_0x3f6719,_0x12337b){return new BPromise(function(_0x370949,_0x1c082c){var _0x39bd16=_0x12337b||client;return _0x39bd16[_0x8d3c('0x24')](_0x19afa6,_0x3f6719)[_0x8d3c('0x25')](function(_0x17db0f){logger[_0x8d3c('0x26')]('SmsMessage,\x20%s,\x20%s',_0x16575f,_0x8d3c('0x27'));logger[_0x8d3c('0x28')](_0x8d3c('0x29'),_0x16575f,_0x8d3c('0x27'),JSON[_0x8d3c('0x2a')](_0x17db0f));if(_0x17db0f[_0x8d3c('0x2b')]){if(_0x17db0f[_0x8d3c('0x2b')]['code']===0x1f4){logger[_0x8d3c('0x2b')](_0x8d3c('0x2c'),_0x16575f,_0x17db0f[_0x8d3c('0x2b')]['message']);return _0x1c082c(_0x17db0f[_0x8d3c('0x2b')][_0x8d3c('0x2d')]);}logger[_0x8d3c('0x2b')](_0x8d3c('0x2c'),_0x16575f,_0x17db0f[_0x8d3c('0x2b')][_0x8d3c('0x2d')]);return _0x370949(_0x17db0f['error'][_0x8d3c('0x2d')]);}else{logger[_0x8d3c('0x26')](_0x8d3c('0x2c'),_0x16575f,_0x8d3c('0x27'));_0x370949(_0x17db0f['result']['message']);}})[_0x8d3c('0x2e')](function(_0x9ac68d){logger[_0x8d3c('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x16575f,_0x9ac68d);_0x1c082c(_0x9ac68d);});});}function respondWithStatusCode(_0x51cbd0,_0x12a3d2){_0x12a3d2=_0x12a3d2||0xcc;return function(_0x40cdf8){if(_0x40cdf8){return _0x51cbd0['sendStatus'](_0x12a3d2);}return _0x51cbd0[_0x8d3c('0x2f')](_0x12a3d2)['end']();};}function respondWithResult(_0x382852,_0x120da7){_0x120da7=_0x120da7||0xc8;return function(_0x2e60e0){if(_0x2e60e0){return _0x382852['status'](_0x120da7)[_0x8d3c('0x30')](_0x2e60e0);}};}function respondWithFilteredResult(_0x180e26,_0x556055){return function(_0x4de6c5){if(_0x4de6c5){var _0x2775b7=typeof _0x556055[_0x8d3c('0x31')]===_0x8d3c('0x32')&&typeof _0x556055['limit']==='undefined';var _0x7c2920=_0x4de6c5[_0x8d3c('0x33')];var _0x6353b2=_0x2775b7?0x0:_0x556055[_0x8d3c('0x31')];var _0xa3ce14=_0x2775b7?_0x4de6c5['count']:_0x556055[_0x8d3c('0x31')]+_0x556055[_0x8d3c('0x34')];var _0x242a88;if(_0xa3ce14>=_0x7c2920){_0xa3ce14=_0x7c2920;_0x242a88=0xc8;}else{_0x242a88=0xce;}_0x180e26[_0x8d3c('0x2f')](_0x242a88);return _0x180e26[_0x8d3c('0x35')](_0x8d3c('0x36'),_0x6353b2+'-'+_0xa3ce14+'/'+_0x7c2920)[_0x8d3c('0x30')](_0x4de6c5);}return null;};}function patchUpdates(_0x1842ed){return function(_0x4b7489){try{jsonpatch['apply'](_0x4b7489,_0x1842ed,!![]);}catch(_0x290157){return BPromise['reject'](_0x290157);}return _0x4b7489[_0x8d3c('0x37')]();};}function saveUpdates(_0x1db0f1,_0x8f8180){return function(_0x220f37){if(_0x220f37){return _0x220f37[_0x8d3c('0x38')](_0x1db0f1)[_0x8d3c('0x25')](function(_0x5d2031){return _0x5d2031;});}return null;};}function removeEntity(_0x523608,_0x2d0566){return function(_0x490a90){if(_0x490a90){return _0x490a90[_0x8d3c('0x39')]()[_0x8d3c('0x25')](function(){_0x523608[_0x8d3c('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf99231,_0x55dbd8){return function(_0x354fd7){if(!_0x354fd7){_0xf99231[_0x8d3c('0x3a')](0x194);}return _0x354fd7;};}function handleError(_0xf697b6,_0x517da7){_0x517da7=_0x517da7||0x1f4;return function(_0x19ab08){logger[_0x8d3c('0x2b')](_0x19ab08[_0x8d3c('0x3b')]);if(_0x19ab08[_0x8d3c('0x3c')]){delete _0x19ab08['name'];}_0xf697b6['status'](_0x517da7)[_0x8d3c('0x3d')](_0x19ab08);};}exports[_0x8d3c('0x3e')]=function(_0x211dfb,_0x3ea862){var _0x49ebf7={},_0x3f9237={},_0x55f0cb={'count':0x0,'rows':[]};var _0x2b68c8=_['map'](db['SmsMessage'][_0x8d3c('0x3f')],function(_0x49836b){return{'name':_0x49836b[_0x8d3c('0x40')],'type':_0x49836b[_0x8d3c('0x41')][_0x8d3c('0x42')]};});_0x3f9237[_0x8d3c('0x43')]=_[_0x8d3c('0x44')](_0x2b68c8,_0x8d3c('0x3c'));_0x3f9237['query']=_[_0x8d3c('0x45')](_0x211dfb['query']);_0x3f9237['filters']=_['intersection'](_0x3f9237[_0x8d3c('0x43')],_0x3f9237['query']);_0x49ebf7['attributes']=_[_0x8d3c('0x46')](_0x3f9237['model'],qs[_0x8d3c('0x47')](_0x211dfb['query'][_0x8d3c('0x47')]));_0x49ebf7[_0x8d3c('0x48')]=_0x49ebf7['attributes'][_0x8d3c('0x49')]?_0x49ebf7[_0x8d3c('0x48')]:_0x3f9237[_0x8d3c('0x43')];if(!_0x211dfb['query'][_0x8d3c('0x4a')](_0x8d3c('0x4b'))){_0x49ebf7['limit']=qs[_0x8d3c('0x34')](_0x211dfb['query']['limit']);_0x49ebf7[_0x8d3c('0x31')]=qs[_0x8d3c('0x31')](_0x211dfb[_0x8d3c('0x4c')][_0x8d3c('0x31')]);}_0x49ebf7['order']=qs[_0x8d3c('0x4d')](_0x211dfb[_0x8d3c('0x4c')][_0x8d3c('0x4d')]);_0x49ebf7['where']=qs[_0x8d3c('0x4e')](_[_0x8d3c('0x4f')](_0x211dfb[_0x8d3c('0x4c')],_0x3f9237[_0x8d3c('0x4e')]),_0x2b68c8);if(_0x211dfb[_0x8d3c('0x4c')][_0x8d3c('0x50')]){_0x49ebf7[_0x8d3c('0x51')]=_[_0x8d3c('0x52')](_0x49ebf7[_0x8d3c('0x51')],{'$or':_[_0x8d3c('0x44')](_0x2b68c8,function(_0x2828c0){if(_0x2828c0['type']!=='VIRTUAL'){var _0x2d4413={};_0x2d4413[_0x2828c0['name']]={'$like':'%'+_0x211dfb['query'][_0x8d3c('0x50')]+'%'};return _0x2d4413;}})});}_0x49ebf7=_[_0x8d3c('0x52')]({},_0x49ebf7,_0x211dfb['options']);var _0x2f5b66={'where':_0x49ebf7[_0x8d3c('0x51')]};return db[_0x8d3c('0x53')][_0x8d3c('0x33')](_0x2f5b66)[_0x8d3c('0x25')](function(_0x1926df){_0x55f0cb[_0x8d3c('0x33')]=_0x1926df;if(_0x211dfb[_0x8d3c('0x4c')]['includeAll']){_0x49ebf7[_0x8d3c('0x54')]=[{'all':!![]}];}return db[_0x8d3c('0x53')][_0x8d3c('0x55')](_0x49ebf7);})[_0x8d3c('0x25')](function(_0x7b02b9){_0x55f0cb[_0x8d3c('0x56')]=_0x7b02b9;return _0x55f0cb;})['then'](respondWithFilteredResult(_0x3ea862,_0x49ebf7))[_0x8d3c('0x2e')](handleError(_0x3ea862,null));};exports[_0x8d3c('0x57')]=function(_0x30e03f,_0x3f82f5){var _0x398808={'raw':!![],'where':{'id':_0x30e03f[_0x8d3c('0x58')]['id']}},_0x5476f5={};_0x5476f5[_0x8d3c('0x43')]=_['keys'](db[_0x8d3c('0x53')][_0x8d3c('0x3f')]);_0x5476f5[_0x8d3c('0x4c')]=_[_0x8d3c('0x45')](_0x30e03f['query']);_0x5476f5[_0x8d3c('0x4e')]=_[_0x8d3c('0x46')](_0x5476f5[_0x8d3c('0x43')],_0x5476f5[_0x8d3c('0x4c')]);_0x398808[_0x8d3c('0x48')]=_[_0x8d3c('0x46')](_0x5476f5['model'],qs[_0x8d3c('0x47')](_0x30e03f[_0x8d3c('0x4c')][_0x8d3c('0x47')]));_0x398808[_0x8d3c('0x48')]=_0x398808[_0x8d3c('0x48')]['length']?_0x398808[_0x8d3c('0x48')]:_0x5476f5['model'];if(_0x30e03f[_0x8d3c('0x4c')][_0x8d3c('0x59')]){_0x398808[_0x8d3c('0x54')]=[{'all':!![]}];}_0x398808=_[_0x8d3c('0x52')]({},_0x398808,_0x30e03f[_0x8d3c('0x5a')]);return db[_0x8d3c('0x53')][_0x8d3c('0x5b')](_0x398808)['then'](handleEntityNotFound(_0x3f82f5,null))[_0x8d3c('0x25')](respondWithResult(_0x3f82f5,null))[_0x8d3c('0x2e')](handleError(_0x3f82f5,null));};exports[_0x8d3c('0x5c')]=function(_0xd3a026,_0x50bb67){return db[_0x8d3c('0x53')][_0x8d3c('0x5c')](_0xd3a026[_0x8d3c('0x5d')],{})['then'](respondWithResult(_0x50bb67,0xc9))['catch'](handleError(_0x50bb67,null));};exports[_0x8d3c('0x38')]=function(_0x5243f2,_0x4368eb){if(_0x5243f2['body']['id']){delete _0x5243f2[_0x8d3c('0x5d')]['id'];}return db[_0x8d3c('0x53')][_0x8d3c('0x5b')]({'where':{'id':_0x5243f2[_0x8d3c('0x58')]['id']}})[_0x8d3c('0x25')](handleEntityNotFound(_0x4368eb,null))['then'](saveUpdates(_0x5243f2[_0x8d3c('0x5d')],null))[_0x8d3c('0x25')](respondWithResult(_0x4368eb,null))[_0x8d3c('0x2e')](handleError(_0x4368eb,null));};exports['destroy']=function(_0x2580e8,_0x47225a){return db[_0x8d3c('0x53')]['find']({'where':{'id':_0x2580e8['params']['id']}})[_0x8d3c('0x25')](handleEntityNotFound(_0x47225a,null))[_0x8d3c('0x25')](removeEntity(_0x47225a,null))[_0x8d3c('0x2e')](handleError(_0x47225a,null));};exports[_0x8d3c('0x5e')]=function(_0x53cb03,_0x11abe5){return db[_0x8d3c('0x53')]['describe']()[_0x8d3c('0x25')](respondWithResult(_0x11abe5,null))[_0x8d3c('0x2e')](handleError(_0x11abe5,null));};var interaction_log=require(_0x8d3c('0x15'))(_0x8d3c('0x5f'));exports[_0x8d3c('0x60')]=function(_0x3e6c9b,_0x5cb242,_0x622222){var _0x205f5a={'agent':{},'channel':_0x8d3c('0x61')};if(_0x3e6c9b[_0x8d3c('0x5d')]['id']){delete _0x3e6c9b[_0x8d3c('0x5d')]['id'];}_0x3e6c9b[_0x8d3c('0x5d')][_0x8d3c('0x62')]=!![];_0x3e6c9b[_0x8d3c('0x5d')][_0x8d3c('0x63')]=moment()[_0x8d3c('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e6c9b[_0x8d3c('0x5d')]['UserId']=_0x3e6c9b[_0x8d3c('0x5d')][_0x8d3c('0x65')]||_0x3e6c9b[_0x8d3c('0x66')]['id'];_0x205f5a[_0x8d3c('0x67')]['id']=_0x3e6c9b['body'][_0x8d3c('0x65')];return db['SmsMessage']['find']({'where':{'id':_0x3e6c9b[_0x8d3c('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5cb242,null))['then'](saveUpdates(_0x3e6c9b[_0x8d3c('0x5d')],null))[_0x8d3c('0x25')](function(_0x2f3514){if(_0x2f3514){_0x205f5a['message']=_0x2f3514[_0x8d3c('0x68')]({'plain':!![]});return db[_0x8d3c('0x69')][_0x8d3c('0x5b')]({'where':{'id':_0x2f3514[_0x8d3c('0x6a')]}});}return null;})[_0x8d3c('0x25')](handleEntityNotFound(_0x5cb242,null))[_0x8d3c('0x25')](function(_0x3da998){if(_0x3da998){return _0x3da998[_0x8d3c('0x38')]({'UserId':_0x3e6c9b[_0x8d3c('0x5d')]['UserId'],'read1stAt':_[_0x8d3c('0x6b')](_0x3da998['read1stAt'])?moment()['format'](_0x8d3c('0x6c')):undefined});}return null;})[_0x8d3c('0x25')](function(_0x5c93f0){if(_0x5c93f0){_0x205f5a['interaction']=_0x5c93f0['get']({'plain':!![]});interaction_log['info'](_0x8d3c('0x6d'),_0x3e6c9b[_0x8d3c('0x66')]['id'],_0x3e6c9b[_0x8d3c('0x66')][_0x8d3c('0x3c')],_0x3e6c9b[_0x8d3c('0x66')][_0x8d3c('0x6e')],_0x205f5a[_0x8d3c('0x6f')]['id'],_0x3e6c9b['body']?JSON[_0x8d3c('0x2a')](_0x3e6c9b['body']):_0x8d3c('0x70'));return respondWithRpcPromise(_0x8d3c('0x71'),'acceptMessage',_0x205f5a);}return null;})[_0x8d3c('0x25')](function(_0x47ef33){var _0x5e1870=_0x8d3c('0x72')+_0x47ef33[_0x8d3c('0x2d')][_0x8d3c('0x73')];return db[_0x8d3c('0x74')]['query'](_0x5e1870,{'type':db[_0x8d3c('0x75')][_0x8d3c('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x222fce){return _0x222fce;});})[_0x8d3c('0x25')](function(_0x4a5fd4){if(_0x4a5fd4){_0x205f5a[_0x8d3c('0x2d')]['contact']=_0x4a5fd4[0x0];if(!_0x3e6c9b[_0x8d3c('0x5d')][_0x8d3c('0x65')])return;return db[_0x8d3c('0x77')][_0x8d3c('0x5b')]({'where':{'id':_0x3e6c9b[_0x8d3c('0x5d')][_0x8d3c('0x65')],'role':_0x8d3c('0x67')},'attributes':['id','name',_0x8d3c('0x78'),'email',_0x8d3c('0x79')],'raw':!![]});}return null;})[_0x8d3c('0x25')](function(_0x5937b7){if(!_0x5937b7)return null;_0x205f5a[_0x8d3c('0x2d')][_0x8d3c('0x67')]=_0x5937b7;return _0x205f5a;})[_0x8d3c('0x25')](function(_0x44ced9){if(_0x44ced9){if(_0x3e6c9b['body'][_0x8d3c('0x7a')]){_0x205f5a[_0x8d3c('0x2d')][_0x8d3c('0x7b')]=util[_0x8d3c('0x64')](_0x8d3c('0x7c'),_0x3e6c9b['user'][_0x8d3c('0x3c')]);_0x205f5a[_0x8d3c('0x2d')][_0x8d3c('0x7d')]=_0x205f5a['channel'];_0x205f5a[_0x8d3c('0x2d')][_0x8d3c('0x7e')]=_0x205f5a[_0x8d3c('0x7d')];_0x205f5a[_0x8d3c('0x2d')]['event']=_0x8d3c('0x60');return respondWithRpcPromise(_0x8d3c('0x7f'),'EventManager',{'event':_0x8d3c('0x80'),'message':_0x205f5a[_0x8d3c('0x2d')]},client9002)[_0x8d3c('0x25')](function(){return _0x205f5a;});}return _0x205f5a;}return null;})['then'](respondWithResult(_0x5cb242,null))[_0x8d3c('0x2e')](handleError(_0x5cb242,null));};var interaction_log=require(_0x8d3c('0x15'))(_0x8d3c('0x5f'));exports[_0x8d3c('0x81')]=function(_0x100a01,_0x262070,_0x2679a8){var _0x178b6d={'agent':{},'channel':'sms'};if(_0x100a01[_0x8d3c('0x5d')]['id']){delete _0x100a01[_0x8d3c('0x5d')]['id'];}_0x100a01[_0x8d3c('0x5d')][_0x8d3c('0x65')]=_0x100a01[_0x8d3c('0x5d')]['UserId']||_0x100a01[_0x8d3c('0x66')]['id'];_0x178b6d['agent']['id']=_0x100a01['body'][_0x8d3c('0x65')];return db[_0x8d3c('0x53')][_0x8d3c('0x5b')]({'where':{'id':_0x100a01['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x262070,null))[_0x8d3c('0x25')](function(_0x27471b){if(_0x27471b){_0x178b6d[_0x8d3c('0x2d')]=_0x27471b[_0x8d3c('0x68')]({'plain':!![]});return db[_0x8d3c('0x69')]['find']({'where':{'id':_0x27471b[_0x8d3c('0x6a')]}});}return null;})[_0x8d3c('0x25')](handleEntityNotFound(_0x262070,null))[_0x8d3c('0x25')](function(_0x56d5a8){if(_0x56d5a8){_0x178b6d['interaction']=_0x56d5a8[_0x8d3c('0x68')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x100a01[_0x8d3c('0x66')]['id'],_0x100a01['user']['name'],_0x100a01[_0x8d3c('0x66')][_0x8d3c('0x6e')],_0x178b6d[_0x8d3c('0x6f')]['id'],_0x100a01['body']?JSON[_0x8d3c('0x2a')](_0x100a01[_0x8d3c('0x5d')]):_0x8d3c('0x70'));return respondWithRpcPromise(_0x8d3c('0x82'),_0x8d3c('0x83'),_0x178b6d);}return null;})[_0x8d3c('0x25')](function(_0x2d475b){var _0x1810d2=_0x8d3c('0x72')+_0x2d475b[_0x8d3c('0x2d')][_0x8d3c('0x73')];return db[_0x8d3c('0x74')]['query'](_0x1810d2,{'type':db[_0x8d3c('0x75')][_0x8d3c('0x76')][_0x8d3c('0x84')],'raw':!![]})[_0x8d3c('0x25')](function(_0x5d7bb6){return _0x5d7bb6;});})['then'](function(_0x54d0a7){if(_0x54d0a7){_0x178b6d[_0x8d3c('0x2d')][_0x8d3c('0x85')]=_0x54d0a7[0x0];if(!_0x100a01[_0x8d3c('0x5d')]['UserId'])return;return db[_0x8d3c('0x77')][_0x8d3c('0x5b')]({'where':{'id':_0x100a01['body'][_0x8d3c('0x65')],'role':_0x8d3c('0x67')},'attributes':['id',_0x8d3c('0x3c'),_0x8d3c('0x78'),'email',_0x8d3c('0x79')],'raw':!![]});}return null;})[_0x8d3c('0x25')](function(_0x401177){if(!_0x401177)return null;_0x178b6d['message']['agent']=_0x401177;return _0x178b6d;})[_0x8d3c('0x25')](function(_0x20838a){if(_0x20838a){_0x20838a[_0x8d3c('0x2d')][_0x8d3c('0x7b')]=util['format'](_0x8d3c('0x7c'),_0x100a01[_0x8d3c('0x66')]['name']);_0x20838a[_0x8d3c('0x2d')][_0x8d3c('0x7d')]=_0x178b6d[_0x8d3c('0x7d')];_0x20838a[_0x8d3c('0x2d')][_0x8d3c('0x7e')]=_0x178b6d[_0x8d3c('0x7d')];_0x20838a['message'][_0x8d3c('0x86')]='reject';respondWithRpcPromise(_0x8d3c('0x7f'),_0x8d3c('0x7f'),{'event':_0x8d3c('0x87'),'message':_0x20838a[_0x8d3c('0x2d')]},client9002);return _0x178b6d;}return null;})[_0x8d3c('0x25')](respondWithResult(_0x262070,null))[_0x8d3c('0x2e')](handleError(_0x262070,null));};exports[_0x8d3c('0x2f')]=function(_0x138b76,_0x417c32,_0x51a33c){if(_0x138b76[_0x8d3c('0x5d')]['id']){delete _0x138b76[_0x8d3c('0x5d')]['id'];}var _0x57217f;return db[_0x8d3c('0x53')]['find']({'where':{'id':_0x138b76['params']['id']}})['then'](handleEntityNotFound(_0x417c32,null))['then'](function(_0xf0da73){if(_0xf0da73){_0x57217f=_0xf0da73;return db[_0x8d3c('0x88')][_0x8d3c('0x5b')]({'where':{'id':_0xf0da73[_0x8d3c('0x89')]}});}})[_0x8d3c('0x25')](handleEntityNotFound(_0x417c32,null))[_0x8d3c('0x25')](function(_0x58edba){if(_0x58edba){logger[_0x8d3c('0x28')](_0x8d3c('0x29'),_0x8d3c('0x2f'),_0x8d3c('0x8a'),_0x58edba[_0x8d3c('0x41')],util[_0x8d3c('0x8b')](_0x138b76[_0x8d3c('0x5d')],{'showHidden':![],'depth':null}));switch(_0x58edba[_0x8d3c('0x41')]){case _0x8d3c('0x8c'):if(_0x138b76[_0x8d3c('0x5d')]['MessageSid']&&_0x138b76['body'][_0x8d3c('0x8d')]===_0x57217f[_0x8d3c('0x8e')]){return _0x57217f['update']({'read':!![]});}else{logger[_0x8d3c('0x2b')](_0x8d3c('0x8f'),_0x8d3c('0x2f'),_0x8d3c('0x8c'),util['inspect'](_0x138b76['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x138b76[_0x8d3c('0x5d')]['MessageUUID']&&_0x138b76[_0x8d3c('0x5d')]['MessageUUID']===_0x57217f[_0x8d3c('0x8e')]&&_[_0x8d3c('0x90')]([_0x8d3c('0x91'),_0x8d3c('0x92')],_0x138b76[_0x8d3c('0x5d')][_0x8d3c('0x93')])>=0x0){return _0x57217f[_0x8d3c('0x38')]({'read':!![]});}else{logger[_0x8d3c('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8d3c('0x2f'),'plivio',util[_0x8d3c('0x8b')](_0x138b76['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x26fc6a=_0x138b76[_0x8d3c('0x5d')][_0x8d3c('0x94')][0x0];if(_0x26fc6a['status'][_0x8d3c('0x95')]===_0x8d3c('0x96')){return _0x57217f['update']({'read':!![]});}else{logger[_0x8d3c('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8d3c('0x2f'),_0x8d3c('0x97'),util[_0x8d3c('0x8b')](_0x138b76[_0x8d3c('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x57217f;}})['then'](respondWithResult(_0x417c32,null))[_0x8d3c('0x2e')](handleError(_0x417c32,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 9683f33..c80eeb6 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 _0x85dc=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x363913,_0x1657ac){var _0x103a47=function(_0x5b572a){while(--_0x5b572a){_0x363913['push'](_0x363913['shift']());}};_0x103a47(++_0x1657ac);}(_0x85dc,0x10f));var _0xc85d=function(_0x4d0667,_0x2faa4d){_0x4d0667=_0x4d0667-0x0;var _0x339a8d=_0x85dc[_0x4d0667];return _0x339a8d;};'use strict';var EventEmitter=require(_0xc85d('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc85d('0x1')](0x0);var events={'afterCreate':_0xc85d('0x2'),'afterUpdate':'update','afterDestroy':_0xc85d('0x3')};function emitEvent(_0x144a24){return function(_0x320d92,_0x4d3312,_0x30f7d4){SmsMessageEvents[_0xc85d('0x4')](_0x144a24+':'+_0x320d92['id'],_0x320d92);SmsMessageEvents[_0xc85d('0x4')](_0x144a24,_0x320d92);_0x30f7d4(null);};}for(var e in events){if(events[_0xc85d('0x5')](e)){var event=events[e];SmsMessage[_0xc85d('0x6')](e,emitEvent(event));}}module[_0xc85d('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x427b=['events','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x424506,_0x4dad53){var _0x5202ec=function(_0x16dd8b){while(--_0x16dd8b){_0x424506['push'](_0x424506['shift']());}};_0x5202ec(++_0x4dad53);}(_0x427b,0xd2));var _0xb427=function(_0x48cc79,_0x458a5a){_0x48cc79=_0x48cc79-0x0;var _0x2cd672=_0x427b[_0x48cc79];return _0x2cd672;};'use strict';var EventEmitter=require(_0xb427('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb427('0x1')](0x0);var events={'afterCreate':_0xb427('0x2'),'afterUpdate':'update','afterDestroy':_0xb427('0x3')};function emitEvent(_0x5ccce7){return function(_0x16f68f,_0x3fadfb,_0x37bf70){SmsMessageEvents['emit'](_0x5ccce7+':'+_0x16f68f['id'],_0x16f68f);SmsMessageEvents[_0xb427('0x4')](_0x5ccce7,_0x16f68f);_0x37bf70(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xb427('0x5')](e,emitEvent(event));}}module[_0xb427('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 8c5090d..8575b56 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 _0x35c2=['signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','intelepeer','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','POST','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','message_id','clickSend','authId','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','deliveryReport','crypto','apiKey','login','sender','text','keys','hex'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x35c2,0x93));var _0x235c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x35c2[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x235c('0x0'));var util=require(_0x235c('0x1'));var logger=require('../../config/logger')(_0x235c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x235c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x235c('0x4'));var config=require(_0x235c('0x5'));var attributes=require(_0x235c('0x6'));module[_0x235c('0x7')]=function(_0x3b35fa,_0x572c70){return _0x3b35fa['define'](_0x235c('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x235c('0x9'),'fields':[_0x235c('0x9')]},{'name':_0x235c('0xa'),'fields':[_0x235c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d346a,_0xad5634,_0x23cd58){var _0x180b3c=_0x3b35fa[_0x235c('0xc')];var _0x26041e=_0x2d346a[_0x235c('0xd')]({'plain':!![]});if(_0x26041e[_0x235c('0xe')][_0x235c('0xf')]()==='in'||_0x26041e[_0x235c('0xe')][_0x235c('0xf')]()===_0x235c('0x10')&&!_0x26041e[_0x235c('0x11')]&&!_[_0x235c('0x12')](_0x26041e[_0x235c('0x13')])&&!_[_0x235c('0x12')](_0x26041e[_0x235c('0x14')])){_0x180b3c['SmsInteraction'][_0x235c('0x15')]({'where':{'id':_0x26041e['SmsInteractionId']}})[_0x235c('0x16')](function(_0x158ea4){if(_0x158ea4){_0x158ea4[_0x235c('0x17')]({'lastMsgAt':_0x26041e[_0x235c('0x18')],'lastMsgDirection':_0x26041e['direction']['toLowerCase']()});}})[_0x235c('0x19')](function(_0x1328be){console['error'](_0x1328be);});}if(_0x26041e[_0x235c('0xe')]===_0x235c('0x10')&&!_0x26041e[_0x235c('0x11')]){var _0x50ba25;_0x180b3c[_0x235c('0x1a')][_0x235c('0x1b')]({'where':{'id':_0x26041e[_0x235c('0x1c')]},'raw':!![]})[_0x235c('0x16')](function(_0xa6718d){_0x50ba25=_0xa6718d;if(_0x50ba25&&_0x50ba25['type']){switch(_0x50ba25[_0x235c('0x1d')]){case _0x235c('0x1e'):var _0x14e7fd=require(_0x235c('0x1e'));if(_0x50ba25[_0x235c('0x1f')]&&_0x50ba25[_0x235c('0x20')]&&_0x50ba25[_0x235c('0x21')]){var _0x560b19=new _0x14e7fd(_0x50ba25[_0x235c('0x1f')],_0x50ba25[_0x235c('0x20')]);_0x560b19[_0x235c('0x22')][_0x235c('0x23')]({'body':_0x26041e[_0x235c('0xb')],'to':_0x26041e[_0x235c('0x21')],'from':_0x50ba25[_0x235c('0x21')],'statusCallback':_0x50ba25[_0x235c('0x24')]+'/api/sms/messages/'+_0x26041e['id']+_0x235c('0x25')+_0x50ba25['token']})[_0x235c('0x16')](function(_0x2873f4){if(_0x2873f4['sid']){return _0x2d346a[_0x235c('0x17')]({'messageId':_0x2873f4[_0x235c('0x26')]});}})[_0x235c('0x19')](function(_0x849df7){logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x1e'),util[_0x235c('0x2a')](_0x849df7,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x235c('0x1e'),_0x235c('0x2b'));}break;case'skebby':var _0x30b228=_0x235c('0x2c');if(_0x50ba25[_0x235c('0x2d')]&&_0x50ba25[_0x235c('0x2e')]){var _0x31513a={'recipient':[_0x26041e[_0x235c('0x21')]],'message':_0x26041e[_0x235c('0xb')],'message_type':_0x50ba25['smsMethod']};if(_0x50ba25[_0x235c('0x2f')]&&_0x50ba25['smsMethod']!=='SI'){_0x31513a['sender']=_0x50ba25[_0x235c('0x21')];}var _0x5e9074={'url':_0x30b228+_0x235c('0x30')+_0x50ba25[_0x235c('0x2d')]+'&password='+_0x50ba25[_0x235c('0x2e')],'method':_0x235c('0x31')};rp(_0x5e9074)[_0x235c('0x16')](function(_0x1749e4){var _0x44ed5f=_0x1749e4[_0x235c('0x32')](';');var _0x315f60={'user_key':_0x44ed5f[0x0],'session_key':_0x44ed5f[0x1]};_0x5e9074={'url':_0x30b228+_0x235c('0x33'),'method':'POST','headers':{'user_key':_0x315f60[_0x235c('0x34')],'Session_key':_0x315f60[_0x235c('0x35')]},'json':!![],'body':_0x31513a};return rp(_0x5e9074);})['then'](function(_0x1326ef){if(_0x1326ef[_0x235c('0x36')]>=0x1){var _0x2c8d1d={'messageId':_0x1326ef[_0x235c('0x37')]};if(_0x50ba25[_0x235c('0x2f')]!=='GP'||!_0x50ba25['deliveryReport']){_0x2c8d1d['read']=!![];}return _0x2d346a[_0x235c('0x17')](_0x2c8d1d);}else{return logger['error'](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x38'),util['inspect'](_0x1326ef,{'showHidden':![],'depth':null}));}})[_0x235c('0x19')](function(_0x48292d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x235c('0x38'),util[_0x235c('0x2a')](_0x48292d,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x38'),_0x235c('0x39'));}break;case _0x235c('0x3a'):if(_0x50ba25[_0x235c('0x20')]){var _0x9f00bf={'recipient':_0x26041e[_0x235c('0x21')],'message':_0x26041e['body'],'sender':_0x50ba25[_0x235c('0x3b')]||_0x50ba25[_0x235c('0x21')],'authorization':_0x50ba25[_0x235c('0x20')]};var _0xad5634={'method':'POST','uri':_0x235c('0x3c'),'body':_0x9f00bf,'json':!![]};rp(_0xad5634)[_0x235c('0x16')](function(_0x2f5944){var _0x21baeb={'messageId':_0x2f5944[_0x235c('0x3d')]};if(!_0x50ba25['deliveryReport']){_0x21baeb[_0x235c('0x3e')]=!![];}return _0x2d346a[_0x235c('0x17')](_0x21baeb);})['catch'](function(_0x4c0cc1){logger['error'](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x3a'),util[_0x235c('0x2a')](_0x4c0cc1,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),'afterCreate',_0x235c('0x3a'),_0x235c('0x3f'));}break;case _0x235c('0x40'):if(_0x50ba25[_0x235c('0x2d')]&&_0x50ba25[_0x235c('0x2e')]){var _0x9f00bf={'messages':[{'source':'xCALLY\x20Motion','to':_0x26041e[_0x235c('0x21')],'body':_0x26041e['body'],'from':_0x50ba25['senderString']||_0x50ba25[_0x235c('0x21')]}]};var _0x23c27a=util['format']('%s:%s',_0x50ba25['username'],_0x50ba25[_0x235c('0x2e')]);var _0xad5634={'method':_0x235c('0x41'),'uri':_0x235c('0x42'),'body':_0x9f00bf,'headers':{'Authorization':util[_0x235c('0x43')](_0x235c('0x44'),new Buffer(_0x23c27a)[_0x235c('0x45')]('base64'))},'json':!![]};rp(_0xad5634)[_0x235c('0x16')](function(_0x4e84af){if(_0x4e84af[_0x235c('0x46')]>=0xc8&&_0x4e84af[_0x235c('0x46')]<=0xce){if(_0x4e84af[_0x235c('0x47')]&&_0x4e84af[_0x235c('0x47')]['queued_count']>0x0){var _0x3b1176=_['head'](_0x4e84af[_0x235c('0x47')][_0x235c('0x22')]);var _0x9ed038={'messageId':_0x3b1176[_0x235c('0x48')]};if(!_0x50ba25['deliveryReport']){_0x9ed038[_0x235c('0x3e')]=!![];}return _0x2d346a[_0x235c('0x17')](_0x9ed038);}else{logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x49'),util[_0x235c('0x2a')](_0x4e84af,{'showHidden':![],'depth':null}));}}else{logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x235c('0x49'),util[_0x235c('0x2a')](_0x4e84af,{'showHidden':![],'depth':null}));}})[_0x235c('0x19')](function(_0x6a6f51){logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x49'),util[_0x235c('0x2a')](_0x6a6f51,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x235c('0x29'),'clickSend',_0x235c('0x39'));}break;case'plivo':if(_0x50ba25[_0x235c('0x4a')]&&_0x50ba25['authToken']){var _0x9f00bf={'dst':_0x26041e['phone'],'text':_0x26041e[_0x235c('0xb')],'src':_0x50ba25[_0x235c('0x3b')]||_0x50ba25[_0x235c('0x21')],'url':_0x50ba25['remote']+_0x235c('0x4b')+_0x26041e['id']+_0x235c('0x25')+_0x50ba25[_0x235c('0x4c')]};var _0x23c27a=util[_0x235c('0x43')]('%s:%s',_0x50ba25[_0x235c('0x4a')],_0x50ba25['authToken']);var _0xad5634={'method':_0x235c('0x41'),'uri':util[_0x235c('0x43')](_0x235c('0x4d'),_0x50ba25[_0x235c('0x4a')]),'body':_0x9f00bf,'headers':{'Authorization':util[_0x235c('0x43')](_0x235c('0x44'),new Buffer(_0x23c27a)[_0x235c('0x45')](_0x235c('0x4e')))},'json':!![]};rp(_0xad5634)[_0x235c('0x16')](function(_0xe0ae47){var _0x3d15fe={'messageId':_0xe0ae47[_0x235c('0x4f')][0x0]};return _0x2d346a[_0x235c('0x17')](_0x3d15fe);})[_0x235c('0x19')](function(_0x4160ef){logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x235c('0x50'),util[_0x235c('0x2a')](_0x4160ef,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x50'),_0x235c('0x51'));}break;case _0x235c('0x52'):if(_0x50ba25[_0x235c('0x2d')]&&_0x50ba25[_0x235c('0x2e')]){if(_0x50ba25[_0x235c('0x53')]){var _0x2225d0={'method':_0x235c('0x41'),'uri':_0x50ba25[_0x235c('0x53')]+_0x235c('0x54'),'body':{'username':_0x50ba25[_0x235c('0x2d')],'password':_0x50ba25[_0x235c('0x2e')]},'json':!![]};return rp(_0x2225d0)[_0x235c('0x16')](function(_0x107c83){var _0x27a63f={'method':'POST','uri':_0x50ba25[_0x235c('0x53')]+_0x235c('0x55'),'body':{'messages':[{'from':_0x50ba25[_0x235c('0x21')],'destinations':[{'to':_0x26041e[_0x235c('0x21')]}],'text':_0x26041e[_0x235c('0xb')],'notifyUrl':_0x50ba25[_0x235c('0x24')]+'/api/sms/messages/'+_0x26041e['id']+_0x235c('0x25')+_0x50ba25[_0x235c('0x4c')],'notifyContentType':'application/json','callbackData':_0x50ba25[_0x235c('0x21')]+';'+_0x26041e['body']}]},'headers':{'Authorization':_0x235c('0x56')+_0x107c83['token']},'json':!![]};return rp(_0x27a63f)[_0x235c('0x16')](function(_0x45000e){if(_0x45000e[_0x235c('0x22')]){var _0x144fee={'messageId':_0x45000e[_0x235c('0x22')][0x0][_0x235c('0x9')]};if(!_0x50ba25[_0x235c('0x57')]){_0x144fee[_0x235c('0x3e')]=!![];}return _0x2d346a[_0x235c('0x17')](_0x144fee);}else{return logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x235c('0x29'),_0x235c('0x52'),util['inspect'](_0x45000e,{'showHidden':![],'depth':null}));}});})[_0x235c('0x19')](function(_0x10c8fb){return logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x235c('0x52'),util[_0x235c('0x2a')](_0x10c8fb,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5250dc=require(_0x235c('0x58'));if(_0x50ba25[_0x235c('0x59')]){var _0x1c8f13={};_0x1c8f13[_0x235c('0x5a')]=_0x50ba25[_0x235c('0x2d')];_0x1c8f13[_0x235c('0x21')]=_0x26041e[_0x235c('0x21')];_0x1c8f13[_0x235c('0x5b')]=_0x50ba25['phone'];_0x1c8f13[_0x235c('0x5c')]=_0x26041e['body'];_0x1c8f13['timestamp']=+new Date();var _0x161a66='';var _0x10bced='';var _0x52383c=Object[_0x235c('0x5d')](_0x1c8f13);_0x52383c['sort']();for(var _0x4cf7f6=0x0;_0x4cf7f6<_0x52383c['length'];_0x4cf7f6++){if(_0x161a66!=''){_0x161a66+='&';}_0x161a66+=_0x52383c[_0x4cf7f6]+'='+encodeURIComponent(_0x1c8f13[_0x52383c[_0x4cf7f6]]);_0x10bced+=_0x1c8f13[_0x52383c[_0x4cf7f6]];}_0x10bced+=_0x50ba25['apiKey'];_0x10bced=_0x5250dc['createHash']('md5')[_0x235c('0x17')](_0x10bced)['digest'](_0x235c('0x5e'));if(_0x161a66!==''){_0x161a66+='&';}_0x161a66+=_0x235c('0x5f')+_0x10bced;var _0x5e9074={'method':_0x235c('0x31'),'uri':_0x50ba25[_0x235c('0x53')]+_0x235c('0x60')+_0x161a66,'json':!![]};return rp(_0x5e9074)['then'](function(_0x44bc4f){var _0x1faa0c=Object[_0x235c('0x5d')](_0x44bc4f);if(_0x44bc4f[_0x1faa0c[0x0]]['error']&&parseInt(_0x44bc4f[_0x1faa0c[0x0]][_0x235c('0x27')])===0x0){var _0x42038d={'messageId':_0x44bc4f[_0x1faa0c[0x0]][_0x235c('0x61')]};if(!_0x50ba25[_0x235c('0x57')]){_0x42038d[_0x235c('0x3e')]=!![];}return _0x2d346a['update'](_0x42038d);}else{return logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x62'),util['inspect'](_0x44bc4f[_0x235c('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x5d3389){return logger[_0x235c('0x27')](_0x235c('0x28'),'afterCreate',_0x235c('0x62'),util['inspect'](_0x5d3389,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),'afterCreate','csc',_0x235c('0x63'));}break;case _0x235c('0x64'):if(_0x50ba25[_0x235c('0x59')]){var _0x1be0f4={'method':_0x235c('0x41'),'uri':_0x235c('0x65'),'headers':{'Authorization':_0x50ba25[_0x235c('0x59')]},'body':{'content':_0x26041e[_0x235c('0xb')],'to':[_0x26041e[_0x235c('0x21')]],'from':_0x50ba25[_0x235c('0x21')],'binary':![],'clientMessageId':_0x235c('0x66'),'charset':_0x235c('0x67')},'json':!![]};rp(_0x1be0f4)[_0x235c('0x16')](function(_0x123bf){if(!_0x123bf[_0x235c('0x27')]){var _0x4ada28={'messageId':_0x123bf['messages'][0x0][_0x235c('0x68')]};if(!_0x50ba25[_0x235c('0x57')]){_0x4ada28[_0x235c('0x3e')]=!![];}return _0x2d346a[_0x235c('0x17')](_0x4ada28);}else{return logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),'clickatell',util['inspect'](_0x123bf[_0x235c('0x27')],{'showHidden':![],'depth':null}));}})[_0x235c('0x19')](function(_0x45f852){return logger[_0x235c('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x235c('0x29'),'clickatell',util[_0x235c('0x2a')](_0x45f852,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x64'),_0x235c('0x63'));}break;case _0x235c('0x69'):if(_0x50ba25[_0x235c('0x2d')]&&_0x50ba25[_0x235c('0x2e')]){var _0x23c27a=util['format'](_0x235c('0x6a'),_0x50ba25['username'],_0x50ba25['password']);var _0xad5634={'method':_0x235c('0x41'),'uri':_0x235c('0x6b')+_0x50ba25[_0x235c('0x6c')]+_0x235c('0x6d'),'body':{'to':[_0x26041e[_0x235c('0x21')]],'text':_0x26041e[_0x235c('0xb')],'from':_0x50ba25[_0x235c('0x21')],'applicationId':_0x50ba25[_0x235c('0x6e')]},'headers':{'Authorization':util[_0x235c('0x43')](_0x235c('0x44'),new Buffer(_0x23c27a)[_0x235c('0x45')](_0x235c('0x4e')))},'json':!![]};rp(_0xad5634)['then'](function(_0x1e5b68){if(_0x1e5b68['id']){var _0x3bb731={'messageId':_0x1e5b68['id']};return _0x2d346a[_0x235c('0x17')](_0x3bb731);}else{logger[_0x235c('0x27')](_0x235c('0x28'),'afterCreate',_0x235c('0x69'),util['inspect'](_0x1e5b68,{'showHidden':![],'depth':null}));}})[_0x235c('0x19')](function(_0x28ceea){logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),'bandwidth',util[_0x235c('0x2a')](_0x28ceea,{'showHidden':![],'depth':null}));});}else{logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),'bandwidth',_0x235c('0x39'));}break;case'intelepeer':if(_0x50ba25['apiKey']){var _0x5aeba5={};var _0x5e9074={'method':'POST','uri':_0x235c('0x6f'),'headers':{'Authorization':_0x235c('0x70')+_0x50ba25[_0x235c('0x59')],'Content-Type':'application/json'},'body':{'from':_0x50ba25[_0x235c('0x21')],'to':_0x26041e[_0x235c('0x21')],'text':_0x26041e[_0x235c('0xb')]},'json':!![]};return rp(_0x5e9074)[_0x235c('0x16')](function(_0xed5ffc){if(_0xed5ffc[_0x235c('0x71')]==0xca){_0x5aeba5[_0x235c('0x72')]=_0xed5ffc;var _0x41fb3f={'method':'POST','uri':_0x235c('0x73'),'headers':{'Authorization':_0x235c('0x70')+_0x50ba25[_0x235c('0x59')],'Content-Type':_0x235c('0x74')},'body':{'refid':_0x5aeba5[_0x235c('0x72')][_0x235c('0x75')]},'json':!![]};return rp(_0x41fb3f)[_0x235c('0x16')](function(_0x15182c){_0x5aeba5['status']=_0x15182c;var _0x4504a7={'messageId':_0x5aeba5[_0x235c('0x72')][_0x235c('0x75')],'read':!![]};return _0x2d346a['update'](_0x4504a7);});}else{return logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x76'),util[_0x235c('0x2a')](_0xed5ffc,{'showHidden':![],'depth':null}));}})[_0x235c('0x19')](function(_0x5bbaeb){return logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x76'),util[_0x235c('0x2a')](_0x5bbaeb,{'showHidden':![],'depth':null}));});}else{return logger[_0x235c('0x27')](_0x235c('0x28'),_0x235c('0x29'),_0x235c('0x76'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x23cd58();});}else{_0x23cd58();}}},'charset':_0x235c('0x77'),'collate':_0x235c('0x78')});}; \ No newline at end of file +var _0xeb88=['id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','apiKey','uuid','UTF-8','clickatell','bandwidth','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','SmsInteractionId','SmsInteraction','update','createdAt','catch','error','secret','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','username','smsMethod','login?username=','&password=','GET','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','clicksend','password','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','clickSend','plivo','authId','/status?token=','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','text','timestamp','sort','length','createHash','md5','hex','signature='];(function(_0x39d8d1,_0x24c4ce){var _0x32e06c=function(_0x827139){while(--_0x827139){_0x39d8d1['push'](_0x39d8d1['shift']());}};_0x32e06c(++_0x24c4ce);}(_0xeb88,0xf9));var _0x8eb8=function(_0x2d0205,_0xe54764){_0x2d0205=_0x2d0205-0x0;var _0x486980=_0xeb88[_0x2d0205];return _0x486980;};'use strict';var _=require(_0x8eb8('0x0'));var util=require(_0x8eb8('0x1'));var logger=require(_0x8eb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8eb8('0x3'));var rp=require(_0x8eb8('0x4'));var fs=require('fs');var path=require(_0x8eb8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x8eb8('0x6')]=function(_0x5e7646,_0x384e76){return _0x5e7646['define'](_0x8eb8('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x8eb8('0x8'),'fields':[_0x8eb8('0x8')]},{'name':_0x8eb8('0x9'),'fields':[_0x8eb8('0xa')],'type':_0x8eb8('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29fc8d,_0x1e62c2,_0x226afc){var _0x2b1e09=_0x5e7646[_0x8eb8('0xc')];var _0x38432b=_0x29fc8d[_0x8eb8('0xd')]({'plain':!![]});if(_0x38432b[_0x8eb8('0xe')]['toLowerCase']()==='in'||_0x38432b[_0x8eb8('0xe')][_0x8eb8('0xf')]()==='out'&&!_0x38432b['secret']&&!_[_0x8eb8('0x10')](_0x38432b['UserId'])&&!_['isNil'](_0x38432b[_0x8eb8('0x11')])){_0x2b1e09[_0x8eb8('0x12')]['findOne']({'where':{'id':_0x38432b[_0x8eb8('0x11')]}})['then'](function(_0x3f3f52){if(_0x3f3f52){_0x3f3f52[_0x8eb8('0x13')]({'lastMsgAt':_0x38432b[_0x8eb8('0x14')],'lastMsgDirection':_0x38432b['direction'][_0x8eb8('0xf')]()});}})[_0x8eb8('0x15')](function(_0x351f66){console[_0x8eb8('0x16')](_0x351f66);});}if(_0x38432b[_0x8eb8('0xe')]==='out'&&!_0x38432b[_0x8eb8('0x17')]){var _0x53bd71;_0x2b1e09['SmsAccount']['find']({'where':{'id':_0x38432b[_0x8eb8('0x18')]},'raw':!![]})['then'](function(_0x33c381){_0x53bd71=_0x33c381;if(_0x53bd71&&_0x53bd71[_0x8eb8('0x19')]){switch(_0x53bd71['type']){case _0x8eb8('0x1a'):var _0x3a0400=require(_0x8eb8('0x1a'));if(_0x53bd71[_0x8eb8('0x1b')]&&_0x53bd71[_0x8eb8('0x1c')]&&_0x53bd71[_0x8eb8('0x1d')]){var _0x38614e=new _0x3a0400(_0x53bd71['accountSid'],_0x53bd71[_0x8eb8('0x1c')]);_0x38614e[_0x8eb8('0x1e')][_0x8eb8('0x1f')]({'body':_0x38432b[_0x8eb8('0xa')],'to':_0x38432b['phone'],'from':_0x53bd71['phone'],'statusCallback':_0x53bd71[_0x8eb8('0x20')]+_0x8eb8('0x21')+_0x38432b['id']+'/status?token='+_0x53bd71[_0x8eb8('0x22')]})[_0x8eb8('0x23')](function(_0x1f531a){if(_0x1f531a[_0x8eb8('0x24')]){return _0x29fc8d[_0x8eb8('0x13')]({'messageId':_0x1f531a[_0x8eb8('0x24')]});}})['catch'](function(_0xbc01d8){logger['error'](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x1a'),util[_0x8eb8('0x27')](_0xbc01d8,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x1a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8eb8('0x28'):var _0x20a486='https://api.skebby.it/API/v1.0/REST/';if(_0x53bd71[_0x8eb8('0x29')]&&_0x53bd71['password']){var _0x4509d5={'recipient':[_0x38432b[_0x8eb8('0x1d')]],'message':_0x38432b[_0x8eb8('0xa')],'message_type':_0x53bd71[_0x8eb8('0x2a')]};if(_0x53bd71[_0x8eb8('0x2a')]&&_0x53bd71[_0x8eb8('0x2a')]!=='SI'){_0x4509d5['sender']=_0x53bd71[_0x8eb8('0x1d')];}var _0x50cb4f={'url':_0x20a486+_0x8eb8('0x2b')+_0x53bd71[_0x8eb8('0x29')]+_0x8eb8('0x2c')+_0x53bd71['password'],'method':_0x8eb8('0x2d')};rp(_0x50cb4f)['then'](function(_0x2cfdd7){var _0x51152f=_0x2cfdd7['split'](';');var _0xd1af07={'user_key':_0x51152f[0x0],'session_key':_0x51152f[0x1]};_0x50cb4f={'url':_0x20a486+'sms','method':_0x8eb8('0x2e'),'headers':{'user_key':_0xd1af07[_0x8eb8('0x2f')],'Session_key':_0xd1af07[_0x8eb8('0x30')]},'json':!![],'body':_0x4509d5};return rp(_0x50cb4f);})[_0x8eb8('0x23')](function(_0x550c51){if(_0x550c51[_0x8eb8('0x31')]>=0x1){var _0x297d67={'messageId':_0x550c51[_0x8eb8('0x32')]};if(_0x53bd71[_0x8eb8('0x2a')]!=='GP'||!_0x53bd71['deliveryReport']){_0x297d67[_0x8eb8('0x33')]=!![];}return _0x29fc8d[_0x8eb8('0x13')](_0x297d67);}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x28'),util['inspect'](_0x550c51,{'showHidden':![],'depth':null}));}})['catch'](function(_0x514379){return logger[_0x8eb8('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8eb8('0x26'),'skebby',util[_0x8eb8('0x27')](_0x514379,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x28'),_0x8eb8('0x34'));}break;case'connectel':if(_0x53bd71['authToken']){var _0x48f8f7={'recipient':_0x38432b[_0x8eb8('0x1d')],'message':_0x38432b[_0x8eb8('0xa')],'sender':_0x53bd71[_0x8eb8('0x35')]||_0x53bd71['phone'],'authorization':_0x53bd71[_0x8eb8('0x1c')]};var _0x1e62c2={'method':_0x8eb8('0x2e'),'uri':_0x8eb8('0x36'),'body':_0x48f8f7,'json':!![]};rp(_0x1e62c2)[_0x8eb8('0x23')](function(_0x5701ba){var _0x38d847={'messageId':_0x5701ba[_0x8eb8('0x37')]};if(!_0x53bd71[_0x8eb8('0x38')]){_0x38d847[_0x8eb8('0x33')]=!![];}return _0x29fc8d[_0x8eb8('0x13')](_0x38d847);})[_0x8eb8('0x15')](function(_0x4767e9){logger[_0x8eb8('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8eb8('0x26'),_0x8eb8('0x39'),util[_0x8eb8('0x27')](_0x4767e9,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8eb8('0x26'),_0x8eb8('0x39'),'Missing\x20parameters:\x20authToken');}break;case _0x8eb8('0x3a'):if(_0x53bd71[_0x8eb8('0x29')]&&_0x53bd71[_0x8eb8('0x3b')]){var _0x48f8f7={'messages':[{'source':_0x8eb8('0x3c'),'to':_0x38432b[_0x8eb8('0x1d')],'body':_0x38432b['body'],'from':_0x53bd71['senderString']||_0x53bd71['phone']}]};var _0x4cf747=util[_0x8eb8('0x3d')](_0x8eb8('0x3e'),_0x53bd71[_0x8eb8('0x29')],_0x53bd71['password']);var _0x1e62c2={'method':'POST','uri':_0x8eb8('0x3f'),'body':_0x48f8f7,'headers':{'Authorization':util[_0x8eb8('0x3d')](_0x8eb8('0x40'),new Buffer(_0x4cf747)[_0x8eb8('0x41')](_0x8eb8('0x42')))},'json':!![]};rp(_0x1e62c2)[_0x8eb8('0x23')](function(_0x4247c1){if(_0x4247c1[_0x8eb8('0x43')]>=0xc8&&_0x4247c1[_0x8eb8('0x43')]<=0xce){if(_0x4247c1[_0x8eb8('0x44')]&&_0x4247c1[_0x8eb8('0x44')]['queued_count']>0x0){var _0x5790cd=_[_0x8eb8('0x45')](_0x4247c1[_0x8eb8('0x44')][_0x8eb8('0x1e')]);var _0x4cff75={'messageId':_0x5790cd['message_id']};if(!_0x53bd71['deliveryReport']){_0x4cff75['read']=!![];}return _0x29fc8d['update'](_0x4cff75);}else{logger['error'](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x46'),util[_0x8eb8('0x27')](_0x4247c1,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x46'),util['inspect'](_0x4247c1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4b1d10){logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x46'),util[_0x8eb8('0x27')](_0x4b1d10,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x46'),_0x8eb8('0x34'));}break;case _0x8eb8('0x47'):if(_0x53bd71[_0x8eb8('0x48')]&&_0x53bd71[_0x8eb8('0x1c')]){var _0x48f8f7={'dst':_0x38432b[_0x8eb8('0x1d')],'text':_0x38432b[_0x8eb8('0xa')],'src':_0x53bd71[_0x8eb8('0x35')]||_0x53bd71['phone'],'url':_0x53bd71['remote']+_0x8eb8('0x21')+_0x38432b['id']+_0x8eb8('0x49')+_0x53bd71[_0x8eb8('0x22')]};var _0x4cf747=util['format']('%s:%s',_0x53bd71[_0x8eb8('0x48')],_0x53bd71[_0x8eb8('0x1c')]);var _0x1e62c2={'method':_0x8eb8('0x2e'),'uri':util[_0x8eb8('0x3d')]('https://api.plivo.com/v1/Account/%s/Message/',_0x53bd71['authId']),'body':_0x48f8f7,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x4cf747)[_0x8eb8('0x41')](_0x8eb8('0x42')))},'json':!![]};rp(_0x1e62c2)['then'](function(_0x41a8d6){var _0x523161={'messageId':_0x41a8d6['message_uuid'][0x0]};return _0x29fc8d[_0x8eb8('0x13')](_0x523161);})['catch'](function(_0x55713e){logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x47'),util[_0x8eb8('0x27')](_0x55713e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8eb8('0x26'),_0x8eb8('0x47'),_0x8eb8('0x4a'));}break;case _0x8eb8('0x4b'):if(_0x53bd71[_0x8eb8('0x29')]&&_0x53bd71[_0x8eb8('0x3b')]){if(_0x53bd71[_0x8eb8('0x4c')]){var _0x3e7fc2={'method':'POST','uri':_0x53bd71[_0x8eb8('0x4c')]+_0x8eb8('0x4d'),'body':{'username':_0x53bd71[_0x8eb8('0x29')],'password':_0x53bd71['password']},'json':!![]};return rp(_0x3e7fc2)[_0x8eb8('0x23')](function(_0x1e0faf){var _0x15bfe4={'method':_0x8eb8('0x2e'),'uri':_0x53bd71['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x53bd71[_0x8eb8('0x1d')],'destinations':[{'to':_0x38432b[_0x8eb8('0x1d')]}],'text':_0x38432b[_0x8eb8('0xa')],'notifyUrl':_0x53bd71[_0x8eb8('0x20')]+_0x8eb8('0x21')+_0x38432b['id']+'/status?token='+_0x53bd71[_0x8eb8('0x22')],'notifyContentType':'application/json','callbackData':_0x53bd71[_0x8eb8('0x1d')]+';'+_0x38432b[_0x8eb8('0xa')]}]},'headers':{'Authorization':_0x8eb8('0x4e')+_0x1e0faf['token']},'json':!![]};return rp(_0x15bfe4)[_0x8eb8('0x23')](function(_0x3975d8){if(_0x3975d8[_0x8eb8('0x1e')]){var _0xc4706={'messageId':_0x3975d8[_0x8eb8('0x1e')][0x0][_0x8eb8('0x8')]};if(!_0x53bd71[_0x8eb8('0x38')]){_0xc4706[_0x8eb8('0x33')]=!![];}return _0x29fc8d['update'](_0xc4706);}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x4b'),util[_0x8eb8('0x27')](_0x3975d8,{'showHidden':![],'depth':null}));}});})[_0x8eb8('0x15')](function(_0x11b3e0){return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x4b'),util['inspect'](_0x11b3e0,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),'infobip',_0x8eb8('0x4f'));}}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate','infobip',_0x8eb8('0x34'));}break;case _0x8eb8('0x50'):var _0x3b01b0=require(_0x8eb8('0x51'));if(_0x53bd71['apiKey']){var _0x5a4249={};_0x5a4249['login']=_0x53bd71[_0x8eb8('0x29')];_0x5a4249[_0x8eb8('0x1d')]=_0x38432b[_0x8eb8('0x1d')];_0x5a4249['sender']=_0x53bd71['phone'];_0x5a4249[_0x8eb8('0x52')]=_0x38432b[_0x8eb8('0xa')];_0x5a4249[_0x8eb8('0x53')]=+new Date();var _0x24a0ce='';var _0x346337='';var _0x2ef014=Object['keys'](_0x5a4249);_0x2ef014[_0x8eb8('0x54')]();for(var _0x47790c=0x0;_0x47790c<_0x2ef014[_0x8eb8('0x55')];_0x47790c++){if(_0x24a0ce!=''){_0x24a0ce+='&';}_0x24a0ce+=_0x2ef014[_0x47790c]+'='+encodeURIComponent(_0x5a4249[_0x2ef014[_0x47790c]]);_0x346337+=_0x5a4249[_0x2ef014[_0x47790c]];}_0x346337+=_0x53bd71['apiKey'];_0x346337=_0x3b01b0[_0x8eb8('0x56')](_0x8eb8('0x57'))['update'](_0x346337)['digest'](_0x8eb8('0x58'));if(_0x24a0ce!==''){_0x24a0ce+='&';}_0x24a0ce+=_0x8eb8('0x59')+_0x346337;var _0x50cb4f={'method':_0x8eb8('0x2d'),'uri':_0x53bd71[_0x8eb8('0x4c')]+'/external/get/send.php?'+_0x24a0ce,'json':!![]};return rp(_0x50cb4f)['then'](function(_0x58dd6e){var _0x5381df=Object['keys'](_0x58dd6e);if(_0x58dd6e[_0x5381df[0x0]][_0x8eb8('0x16')]&&parseInt(_0x58dd6e[_0x5381df[0x0]][_0x8eb8('0x16')])===0x0){var _0x23db23={'messageId':_0x58dd6e[_0x5381df[0x0]][_0x8eb8('0x5a')]};if(!_0x53bd71[_0x8eb8('0x38')]){_0x23db23[_0x8eb8('0x33')]=!![];}return _0x29fc8d['update'](_0x23db23);}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),'csc',util['inspect'](_0x58dd6e[_0x8eb8('0x16')],{'showHidden':![],'depth':null}));}})[_0x8eb8('0x15')](function(_0x5bc78a){return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x50'),util[_0x8eb8('0x27')](_0x5bc78a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x50'),_0x8eb8('0x5b'));}break;case'clickatell':if(_0x53bd71['apiKey']){var _0x4a5436={'method':_0x8eb8('0x2e'),'uri':_0x8eb8('0x5c'),'headers':{'Authorization':_0x53bd71[_0x8eb8('0x5d')]},'body':{'content':_0x38432b[_0x8eb8('0xa')],'to':[_0x38432b[_0x8eb8('0x1d')]],'from':_0x53bd71[_0x8eb8('0x1d')],'binary':![],'clientMessageId':_0x8eb8('0x5e'),'charset':_0x8eb8('0x5f')},'json':!![]};rp(_0x4a5436)[_0x8eb8('0x23')](function(_0xc416c8){if(!_0xc416c8['error']){var _0x2bdaf6={'messageId':_0xc416c8[_0x8eb8('0x1e')][0x0]['apiMessageId']};if(!_0x53bd71[_0x8eb8('0x38')]){_0x2bdaf6[_0x8eb8('0x33')]=!![];}return _0x29fc8d[_0x8eb8('0x13')](_0x2bdaf6);}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x60'),util[_0x8eb8('0x27')](_0xc416c8['error'],{'showHidden':![],'depth':null}));}})[_0x8eb8('0x15')](function(_0x11d36a){return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x60'),util[_0x8eb8('0x27')](_0x11d36a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x60'),_0x8eb8('0x5b'));}break;case _0x8eb8('0x61'):if(_0x53bd71[_0x8eb8('0x29')]&&_0x53bd71['password']){var _0x4cf747=util[_0x8eb8('0x3d')](_0x8eb8('0x3e'),_0x53bd71[_0x8eb8('0x29')],_0x53bd71[_0x8eb8('0x3b')]);var _0x1e62c2={'method':_0x8eb8('0x2e'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x53bd71[_0x8eb8('0x62')]+_0x8eb8('0x63'),'body':{'to':[_0x38432b[_0x8eb8('0x1d')]],'text':_0x38432b[_0x8eb8('0xa')],'from':_0x53bd71['phone'],'applicationId':_0x53bd71[_0x8eb8('0x64')]},'headers':{'Authorization':util[_0x8eb8('0x3d')]('Basic\x20%s',new Buffer(_0x4cf747)[_0x8eb8('0x41')](_0x8eb8('0x42')))},'json':!![]};rp(_0x1e62c2)[_0x8eb8('0x23')](function(_0x4bdfd0){if(_0x4bdfd0['id']){var _0x4f5c55={'messageId':_0x4bdfd0['id']};return _0x29fc8d[_0x8eb8('0x13')](_0x4f5c55);}else{logger[_0x8eb8('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8eb8('0x61'),util[_0x8eb8('0x27')](_0x4bdfd0,{'showHidden':![],'depth':null}));}})[_0x8eb8('0x15')](function(_0x21737b){logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x61'),util['inspect'](_0x21737b,{'showHidden':![],'depth':null}));});}else{logger[_0x8eb8('0x16')](_0x8eb8('0x25'),_0x8eb8('0x26'),_0x8eb8('0x61'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x53bd71[_0x8eb8('0x5d')]){var _0x6f9a86={};var _0x50cb4f={'method':'POST','uri':_0x8eb8('0x65'),'headers':{'Authorization':_0x8eb8('0x66')+_0x53bd71['apiKey'],'Content-Type':_0x8eb8('0x67')},'body':{'from':_0x53bd71[_0x8eb8('0x1d')],'to':_0x38432b['phone'],'text':_0x38432b['body']},'json':!![]};return rp(_0x50cb4f)[_0x8eb8('0x23')](function(_0x57df93){if(_0x57df93[_0x8eb8('0x68')]==0xca){_0x6f9a86[_0x8eb8('0x69')]=_0x57df93;var _0xa81341={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x53bd71[_0x8eb8('0x5d')],'Content-Type':_0x8eb8('0x67')},'body':{'refid':_0x6f9a86[_0x8eb8('0x69')][_0x8eb8('0x6a')]},'json':!![]};return rp(_0xa81341)['then'](function(_0x5703f0){_0x6f9a86[_0x8eb8('0x6b')]=_0x5703f0;var _0xd832a5={'messageId':_0x6f9a86['message']['refid'],'read':!![]};return _0x29fc8d[_0x8eb8('0x13')](_0xd832a5);});}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate','intelepeer',util['inspect'](_0x57df93,{'showHidden':![],'depth':null}));}})[_0x8eb8('0x15')](function(_0x53b1b3){return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate',_0x8eb8('0x6c'),util['inspect'](_0x53b1b3,{'showHidden':![],'depth':null}));});}else{return logger[_0x8eb8('0x16')](_0x8eb8('0x25'),'afterCreate','intelepeer',_0x8eb8('0x6d'));}break;}}})[_0x8eb8('0x6e')](function(){_0x226afc();});}else{_0x226afc();}}},'charset':_0x8eb8('0x6f'),'collate':_0x8eb8('0x70')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3a4dfcc..69fdde2 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 _0x0130=['SmsMessage','options','raw','CreateSmsMessage','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x0130,0xaa));var _0x0013=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x0130[_0x4a96ca];return _0x2aed48;};'use strict';var _=require(_0x0013('0x0'));var util=require(_0x0013('0x1'));var moment=require(_0x0013('0x2'));var BPromise=require(_0x0013('0x3'));var rs=require(_0x0013('0x4'));var fs=require('fs');var Redis=require(_0x0013('0x5'));var db=require(_0x0013('0x6'))['db'];var utils=require(_0x0013('0x7'));var logger=require(_0x0013('0x8'))('rpc');var config=require(_0x0013('0x9'));var jayson=require(_0x0013('0xa'));var client=jayson['client'][_0x0013('0xb')]({'port':0x232a});config[_0x0013('0xc')]=_[_0x0013('0xd')](config[_0x0013('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0013('0xe'))[_0x0013('0xf')](socket);function respondWithRpcPromise(_0x5a8417,_0x536c65,_0x102729){return new BPromise(function(_0x419f16,_0x3820ff){return client[_0x0013('0x10')](_0x5a8417,_0x102729)[_0x0013('0x11')](function(_0x1401d6){logger[_0x0013('0x12')]('SmsMessage,\x20%s,\x20%s',_0x536c65,'request\x20sent');logger['debug'](_0x0013('0x13'),_0x536c65,_0x0013('0x14'),JSON[_0x0013('0x15')](_0x1401d6));if(_0x1401d6[_0x0013('0x16')]){if(_0x1401d6[_0x0013('0x16')][_0x0013('0x17')]===0x1f4){logger[_0x0013('0x16')]('SmsMessage,\x20%s,\x20%s',_0x536c65,_0x1401d6[_0x0013('0x16')][_0x0013('0x18')]);return _0x3820ff(_0x1401d6[_0x0013('0x16')]['message']);}logger[_0x0013('0x16')](_0x0013('0x19'),_0x536c65,_0x1401d6['error'][_0x0013('0x18')]);return _0x419f16(_0x1401d6[_0x0013('0x16')][_0x0013('0x18')]);}else{logger[_0x0013('0x12')]('SmsMessage,\x20%s,\x20%s',_0x536c65,_0x0013('0x14'));_0x419f16(_0x1401d6[_0x0013('0x1a')][_0x0013('0x18')]);}})[_0x0013('0x1b')](function(_0x3a12df){logger['error']('SmsMessage,\x20%s,\x20%s',_0x536c65,_0x3a12df);_0x3820ff(_0x3a12df);});});}exports['CreateSmsMessage']=function(_0x18a632){var _0x161def=this;return new Promise(function(_0x5851f7,_0x2a0fc8){return db[_0x0013('0x1c')]['create'](_0x18a632['body'],{'raw':_0x18a632[_0x0013('0x1d')]?_0x18a632[_0x0013('0x1d')][_0x0013('0x1e')]===undefined?!![]:![]:!![]})[_0x0013('0x11')](function(_0x184986){logger['info'](_0x0013('0x1f'),_0x18a632);logger[_0x0013('0x20')](_0x0013('0x1f'),_0x18a632,JSON[_0x0013('0x15')](_0x184986));_0x5851f7(_0x184986);})[_0x0013('0x1b')](function(_0x37a56b){logger[_0x0013('0x16')]('CreateSmsMessage',_0x37a56b[_0x0013('0x18')],_0x18a632);_0x2a0fc8(_0x161def['error'](0x1f4,_0x37a56b[_0x0013('0x18')]));});});}; \ No newline at end of file +var _0x5217=['request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','create','body','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x5217,0x1ed));var _0x7521=function(_0x5bf5e5,_0x10f1df){_0x5bf5e5=_0x5bf5e5-0x0;var _0x3ed4c2=_0x5217[_0x5bf5e5];return _0x3ed4c2;};'use strict';var _=require(_0x7521('0x0'));var util=require(_0x7521('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7521('0x2'));var fs=require('fs');var Redis=require(_0x7521('0x3'));var db=require(_0x7521('0x4'))['db'];var utils=require(_0x7521('0x5'));var logger=require(_0x7521('0x6'))(_0x7521('0x7'));var config=require(_0x7521('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7521('0x9')]['http']({'port':0x232a});config[_0x7521('0xa')]=_[_0x7521('0xb')](config[_0x7521('0xa')],{'host':_0x7521('0xc'),'port':0x18eb});var socket=require(_0x7521('0xd'))(new Redis(config[_0x7521('0xa')]));require(_0x7521('0xe'))[_0x7521('0xf')](socket);function respondWithRpcPromise(_0x46fc14,_0x4339fb,_0x529b21){return new BPromise(function(_0x61b66e,_0x198df2){return client[_0x7521('0x10')](_0x46fc14,_0x529b21)[_0x7521('0x11')](function(_0x444c1d){logger[_0x7521('0x12')]('SmsMessage,\x20%s,\x20%s',_0x4339fb,_0x7521('0x13'));logger[_0x7521('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4339fb,'request\x20sent',JSON[_0x7521('0x15')](_0x444c1d));if(_0x444c1d[_0x7521('0x16')]){if(_0x444c1d[_0x7521('0x16')][_0x7521('0x17')]===0x1f4){logger[_0x7521('0x16')]('SmsMessage,\x20%s,\x20%s',_0x4339fb,_0x444c1d['error'][_0x7521('0x18')]);return _0x198df2(_0x444c1d[_0x7521('0x16')][_0x7521('0x18')]);}logger[_0x7521('0x16')](_0x7521('0x19'),_0x4339fb,_0x444c1d[_0x7521('0x16')][_0x7521('0x18')]);return _0x61b66e(_0x444c1d['error'][_0x7521('0x18')]);}else{logger[_0x7521('0x12')](_0x7521('0x19'),_0x4339fb,_0x7521('0x13'));_0x61b66e(_0x444c1d[_0x7521('0x1a')][_0x7521('0x18')]);}})[_0x7521('0x1b')](function(_0x2a1747){logger[_0x7521('0x16')](_0x7521('0x19'),_0x4339fb,_0x2a1747);_0x198df2(_0x2a1747);});});}exports[_0x7521('0x1c')]=function(_0x2b2901){var _0x4415f4=this;return new Promise(function(_0x2014ca,_0x536f93){return db['SmsMessage'][_0x7521('0x1d')](_0x2b2901[_0x7521('0x1e')],{'raw':_0x2b2901['options']?_0x2b2901['options'][_0x7521('0x1f')]===undefined?!![]:![]:!![]})[_0x7521('0x11')](function(_0xa541e1){logger[_0x7521('0x12')](_0x7521('0x1c'),_0x2b2901);logger[_0x7521('0x14')]('CreateSmsMessage',_0x2b2901,JSON[_0x7521('0x15')](_0xa541e1));_0x2014ca(_0xa541e1);})[_0x7521('0x1b')](function(_0x5449b0){logger['error'](_0x7521('0x1c'),_0x5449b0[_0x7521('0x18')],_0x2b2901);_0x536f93(_0x4415f4[_0x7521('0x16')](0x1f4,_0x5449b0['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 852265e..94ecdb6 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 _0x98a1=['./smsMessage.events','save','update','emit','removeListener','register','length','smsMessage:'];(function(_0x5290ed,_0x5d3f76){var _0x146749=function(_0x3fca4a){while(--_0x3fca4a){_0x5290ed['push'](_0x5290ed['shift']());}};_0x146749(++_0x5d3f76);}(_0x98a1,0x1c8));var _0x198a=function(_0x28bb6e,_0x40a130){_0x28bb6e=_0x28bb6e-0x0;var _0x57e913=_0x98a1[_0x28bb6e];return _0x57e913;};'use strict';var SmsMessageEvents=require(_0x198a('0x0'));var events=[_0x198a('0x1'),'remove',_0x198a('0x2')];function createListener(_0x2f8a7f,_0x1ff473){return function(_0xc6dd67){_0x1ff473[_0x198a('0x3')](_0x2f8a7f,_0xc6dd67);};}function removeListener(_0x4818d5,_0x39f102){return function(){SmsMessageEvents[_0x198a('0x4')](_0x4818d5,_0x39f102);};}exports[_0x198a('0x5')]=function(_0x25aa9c){for(var _0x16815d=0x0,_0x1cec30=events[_0x198a('0x6')];_0x16815d<_0x1cec30;_0x16815d++){var _0x55f3ff=events[_0x16815d];var _0x19aa4b=createListener(_0x198a('0x7')+_0x55f3ff,_0x25aa9c);SmsMessageEvents['on'](_0x55f3ff,_0x19aa4b);}}; \ No newline at end of file +var _0xefb4=['smsMessage:','./smsMessage.events','save','update','emit','register','length'];(function(_0x512324,_0x279184){var _0x5812a8=function(_0x15220a){while(--_0x15220a){_0x512324['push'](_0x512324['shift']());}};_0x5812a8(++_0x279184);}(_0xefb4,0x1e4));var _0x4efb=function(_0x216eb9,_0x35321f){_0x216eb9=_0x216eb9-0x0;var _0x2382a6=_0xefb4[_0x216eb9];return _0x2382a6;};'use strict';var SmsMessageEvents=require(_0x4efb('0x0'));var events=[_0x4efb('0x1'),'remove',_0x4efb('0x2')];function createListener(_0x22292c,_0x4bd9eb){return function(_0x5e39b9){_0x4bd9eb[_0x4efb('0x3')](_0x22292c,_0x5e39b9);};}function removeListener(_0xc25f04,_0xe6b487){return function(){SmsMessageEvents['removeListener'](_0xc25f04,_0xe6b487);};}exports[_0x4efb('0x4')]=function(_0x4f3e71){for(var _0x21fa60=0x0,_0x384dd2=events[_0x4efb('0x5')];_0x21fa60<_0x384dd2;_0x21fa60++){var _0x5b23a9=events[_0x21fa60];var _0x458976=createListener(_0x4efb('0x6')+_0x5b23a9,_0x4f3e71);SmsMessageEvents['on'](_0x5b23a9,_0x458976);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5c47efd..9045e70 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 _0x510e=['index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','update','delete','destroy','removeAgents','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0x510e,0xc0));var _0xe510=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x510e[_0x51020b];return _0x371e47;};'use strict';var multer=require('multer');var util=require(_0xe510('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe510('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xe510('0x2'));var interaction=require(_0xe510('0x3'));var config=require(_0xe510('0x4'));var controller=require(_0xe510('0x5'));router[_0xe510('0x6')]('/',auth[_0xe510('0x7')](),controller[_0xe510('0x8')]);router[_0xe510('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xe510('0x9')]);router['get'](_0xe510('0xa'),auth[_0xe510('0x7')](),controller[_0xe510('0xb')]);router[_0xe510('0x6')](_0xe510('0xc'),auth[_0xe510('0x7')](),controller[_0xe510('0xd')]);router[_0xe510('0x6')](_0xe510('0xe'),auth[_0xe510('0x7')](),controller[_0xe510('0xf')]);router[_0xe510('0x6')](_0xe510('0x10'),auth[_0xe510('0x7')](),controller[_0xe510('0x11')]);router[_0xe510('0x12')]('/',auth[_0xe510('0x7')](),controller[_0xe510('0x13')]);router[_0xe510('0x12')](_0xe510('0xe'),auth[_0xe510('0x7')](),controller['addTeams']);router[_0xe510('0x12')](_0xe510('0x10'),auth[_0xe510('0x7')](),controller['addAgents']);router['put'](_0xe510('0xa'),auth['isAuthenticated'](),controller[_0xe510('0x14')]);router[_0xe510('0x15')](_0xe510('0xa'),auth[_0xe510('0x7')](),controller[_0xe510('0x16')]);router[_0xe510('0x15')](_0xe510('0xe'),auth[_0xe510('0x7')](),controller['removeTeams']);router['delete'](_0xe510('0x10'),auth[_0xe510('0x7')](),controller[_0xe510('0x17')]);module[_0xe510('0x18')]=router; \ No newline at end of file +var _0x3253=['index','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','update','destroy','delete','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller'];(function(_0x856142,_0x4b39fd){var _0x50bed3=function(_0x2ab27b){while(--_0x2ab27b){_0x856142['push'](_0x856142['shift']());}};_0x50bed3(++_0x4b39fd);}(_0x3253,0x170));var _0x3325=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0x3253[_0x53f608];return _0x495b7d;};'use strict';var multer=require('multer');var util=require(_0x3325('0x0'));var path=require(_0x3325('0x1'));var timeout=require(_0x3325('0x2'));var express=require(_0x3325('0x3'));var router=express[_0x3325('0x4')]();var fs_extra=require(_0x3325('0x5'));var auth=require(_0x3325('0x6'));var interaction=require(_0x3325('0x7'));var config=require('../../config/environment');var controller=require(_0x3325('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3325('0x9')]);router[_0x3325('0xa')]('/describe',auth[_0x3325('0xb')](),controller[_0x3325('0xc')]);router['get'](_0x3325('0xd'),auth['isAuthenticated'](),controller[_0x3325('0xe')]);router[_0x3325('0xa')](_0x3325('0xf'),auth['isAuthenticated'](),controller[_0x3325('0x10')]);router['get']('/:id/teams',auth[_0x3325('0xb')](),controller[_0x3325('0x11')]);router[_0x3325('0xa')](_0x3325('0x12'),auth[_0x3325('0xb')](),controller[_0x3325('0x13')]);router[_0x3325('0x14')]('/',auth[_0x3325('0xb')](),controller[_0x3325('0x15')]);router[_0x3325('0x14')](_0x3325('0x16'),auth['isAuthenticated'](),controller[_0x3325('0x17')]);router[_0x3325('0x14')](_0x3325('0x12'),auth[_0x3325('0xb')](),controller['addAgents']);router['put'](_0x3325('0xd'),auth[_0x3325('0xb')](),controller[_0x3325('0x18')]);router['delete']('/:id',auth[_0x3325('0xb')](),controller[_0x3325('0x19')]);router[_0x3325('0x1a')](_0x3325('0x16'),auth[_0x3325('0xb')](),controller[_0x3325('0x1b')]);router[_0x3325('0x1a')](_0x3325('0x12'),auth[_0x3325('0xb')](),controller['removeAgents']);module[_0x3325('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index be96261..b8885e2 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 _0xfb34=['roundrobin','STRING','name','INTEGER','ENUM'];(function(_0x39479f,_0x822ae4){var _0x4a6d96=function(_0x55bfba){while(--_0x55bfba){_0x39479f['push'](_0x39479f['shift']());}};_0x4a6d96(++_0x822ae4);}(_0xfb34,0x83));var _0x4fb3=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0xfb34[_0x4480b9];return _0x3f0f02;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4fb3('0x0')],'unique':_0x4fb3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4fb3('0x0')]},'timeout':{'type':Sequelize[_0x4fb3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4fb3('0x3')]('rrmemory','beepall',_0x4fb3('0x4'))}}; \ No newline at end of file +var _0xb428=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x25f686,_0x199629){var _0x54ad10=function(_0x1f9083){while(--_0x1f9083){_0x25f686['push'](_0x25f686['shift']());}};_0x54ad10(++_0x199629);}(_0xb428,0x19a));var _0x8b42=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0xb428[_0x2405bc];return _0x5272d4;};'use strict';var Sequelize=require(_0x8b42('0x0'));module[_0x8b42('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b42('0x2')]},'timeout':{'type':Sequelize[_0x8b42('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b42('0x4')](_0x8b42('0x5'),_0x8b42('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index edd0dda..67d8b20 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 _0xd630=['../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','SmsQueues','UserProfileResource','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsQueue','include','findAll','rows','catch','show','params','keys','intersection','includeAll','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','destroy','describe','getMembers','findOne','get','SmsQueueId','UserSmsQueue','User','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x228b46,_0x6268b6){var _0x472296=function(_0x30f64){while(--_0x30f64){_0x228b46['push'](_0x228b46['shift']());}};_0x472296(++_0x6268b6);}(_0xd630,0x102));var _0x0d63=function(_0x2394df,_0x19c4b7){_0x2394df=_0x2394df-0x0;var _0x584c7d=_0xd630[_0x2394df];return _0x584c7d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d63('0x0'));var jsonpatch=require(_0x0d63('0x1'));var rp=require(_0x0d63('0x2'));var moment=require(_0x0d63('0x3'));var BPromise=require(_0x0d63('0x4'));var Mustache=require('mustache');var util=require(_0x0d63('0x5'));var path=require('path');var sox=require(_0x0d63('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d63('0x7'));var _=require(_0x0d63('0x8'));var squel=require(_0x0d63('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d63('0xa'));var toCsv=require(_0x0d63('0xb'));var querystring=require(_0x0d63('0xc'));var Papa=require(_0x0d63('0xd'));var Redis=require('ioredis');var authService=require(_0x0d63('0xe'));var qs=require(_0x0d63('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d63('0x10'));var logger=require('../../config/logger')(_0x0d63('0x11'));var utils=require(_0x0d63('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0d63('0x13'));var db=require(_0x0d63('0x14'))['db'];config[_0x0d63('0x15')]=_[_0x0d63('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d63('0x17'))(new Redis(config[_0x0d63('0x15')]));require(_0x0d63('0x18'))[_0x0d63('0x19')](socket);function respondWithStatusCode(_0x122751,_0x4cf831){_0x4cf831=_0x4cf831||0xcc;return function(_0x4228d9){if(_0x4228d9){return _0x122751['sendStatus'](_0x4cf831);}return _0x122751['status'](_0x4cf831)[_0x0d63('0x1a')]();};}function respondWithResult(_0x74e654,_0x550bfe){_0x550bfe=_0x550bfe||0xc8;return function(_0x4b7579){if(_0x4b7579){return _0x74e654['status'](_0x550bfe)['json'](_0x4b7579);}};}function respondWithFilteredResult(_0x1c4833,_0x2aac2c){return function(_0x3bb634){if(_0x3bb634){var _0xda3343=typeof _0x2aac2c['offset']===_0x0d63('0x1b')&&typeof _0x2aac2c[_0x0d63('0x1c')]==='undefined';var _0x1a39ae=_0x3bb634[_0x0d63('0x1d')];var _0x44c099=_0xda3343?0x0:_0x2aac2c[_0x0d63('0x1e')];var _0x35bf76=_0xda3343?_0x3bb634['count']:_0x2aac2c[_0x0d63('0x1e')]+_0x2aac2c[_0x0d63('0x1c')];var _0xdf7a6e;if(_0x35bf76>=_0x1a39ae){_0x35bf76=_0x1a39ae;_0xdf7a6e=0xc8;}else{_0xdf7a6e=0xce;}_0x1c4833[_0x0d63('0x1f')](_0xdf7a6e);return _0x1c4833[_0x0d63('0x20')](_0x0d63('0x21'),_0x44c099+'-'+_0x35bf76+'/'+_0x1a39ae)[_0x0d63('0x22')](_0x3bb634);}return null;};}function patchUpdates(_0xd6d184){return function(_0x2eef66){try{jsonpatch[_0x0d63('0x23')](_0x2eef66,_0xd6d184,!![]);}catch(_0x638de6){return BPromise[_0x0d63('0x24')](_0x638de6);}return _0x2eef66[_0x0d63('0x25')]();};}function saveUpdates(_0x5b92a0,_0x34c86a){return function(_0x27c8cf){if(_0x27c8cf){return _0x27c8cf['update'](_0x5b92a0)['then'](function(_0x10821b){return _0x10821b;});}return null;};}function removeEntity(_0x55d75f,_0x1e3880){return function(_0x431228){if(_0x431228){return _0x431228['destroy']()['then'](function(){var _0x344b09=_0x431228['get']({'plain':!![]});var _0x3168e9=_0x0d63('0x26');return db[_0x0d63('0x27')]['destroy']({'where':{'type':_0x3168e9,'resourceId':_0x344b09['id']}})['then'](function(){return _0x431228;});})[_0x0d63('0x28')](function(){_0x55d75f[_0x0d63('0x1f')](0xcc)[_0x0d63('0x1a')]();});}};}function handleEntityNotFound(_0x1cf0e0,_0x466d3f){return function(_0xd29856){if(!_0xd29856){_0x1cf0e0[_0x0d63('0x29')](0x194);}return _0xd29856;};}function handleError(_0x1d1436,_0xed6724){_0xed6724=_0xed6724||0x1f4;return function(_0x25b7df){logger[_0x0d63('0x2a')](_0x25b7df['stack']);if(_0x25b7df[_0x0d63('0x2b')]){delete _0x25b7df[_0x0d63('0x2b')];}_0x1d1436[_0x0d63('0x1f')](_0xed6724)[_0x0d63('0x2c')](_0x25b7df);};}exports[_0x0d63('0x2d')]=function(_0x11fc0b,_0x348faf){var _0x2f6107={},_0x38aefe={},_0x19681b={'count':0x0,'rows':[]};var _0x58e41d=_[_0x0d63('0x2e')](db['SmsQueue'][_0x0d63('0x2f')],function(_0x3cee0c){return{'name':_0x3cee0c[_0x0d63('0x30')],'type':_0x3cee0c['type'][_0x0d63('0x31')]};});_0x38aefe[_0x0d63('0x32')]=_[_0x0d63('0x2e')](_0x58e41d,_0x0d63('0x2b'));_0x38aefe[_0x0d63('0x33')]=_['keys'](_0x11fc0b[_0x0d63('0x33')]);_0x38aefe['filters']=_['intersection'](_0x38aefe[_0x0d63('0x32')],_0x38aefe[_0x0d63('0x33')]);_0x2f6107[_0x0d63('0x34')]=_['intersection'](_0x38aefe[_0x0d63('0x32')],qs['fields'](_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x35')]));_0x2f6107[_0x0d63('0x34')]=_0x2f6107[_0x0d63('0x34')][_0x0d63('0x36')]?_0x2f6107[_0x0d63('0x34')]:_0x38aefe[_0x0d63('0x32')];if(!_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x37')](_0x0d63('0x38'))){_0x2f6107[_0x0d63('0x1c')]=qs[_0x0d63('0x1c')](_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x1c')]);_0x2f6107[_0x0d63('0x1e')]=qs[_0x0d63('0x1e')](_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x1e')]);}_0x2f6107[_0x0d63('0x39')]=qs[_0x0d63('0x3a')](_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x3a')]);_0x2f6107[_0x0d63('0x3b')]=qs[_0x0d63('0x3c')](_[_0x0d63('0x3d')](_0x11fc0b['query'],_0x38aefe['filters']),_0x58e41d);if(_0x11fc0b[_0x0d63('0x33')][_0x0d63('0x3e')]){_0x2f6107[_0x0d63('0x3b')]=_[_0x0d63('0x3f')](_0x2f6107['where'],{'$or':_[_0x0d63('0x2e')](_0x58e41d,function(_0x2ee7fe){if(_0x2ee7fe['type']!==_0x0d63('0x40')){var _0xae0b97={};_0xae0b97[_0x2ee7fe[_0x0d63('0x2b')]]={'$like':'%'+_0x11fc0b['query'][_0x0d63('0x3e')]+'%'};return _0xae0b97;}})});}_0x2f6107=_[_0x0d63('0x3f')]({},_0x2f6107,_0x11fc0b[_0x0d63('0x41')]);var _0x65fd2={'where':_0x2f6107['where']};return db[_0x0d63('0x42')]['count'](_0x65fd2)[_0x0d63('0x28')](function(_0x30bb30){_0x19681b['count']=_0x30bb30;if(_0x11fc0b['query']['includeAll']){_0x2f6107[_0x0d63('0x43')]=[{'all':!![]}];}return db['SmsQueue'][_0x0d63('0x44')](_0x2f6107);})['then'](function(_0x200777){_0x19681b[_0x0d63('0x45')]=_0x200777;return _0x19681b;})[_0x0d63('0x28')](respondWithFilteredResult(_0x348faf,_0x2f6107))[_0x0d63('0x46')](handleError(_0x348faf,null));};exports[_0x0d63('0x47')]=function(_0x41dbba,_0x1df68){var _0x59a8cf={'raw':!![],'where':{'id':_0x41dbba[_0x0d63('0x48')]['id']}},_0x2aa19e={};_0x2aa19e[_0x0d63('0x32')]=_[_0x0d63('0x49')](db[_0x0d63('0x42')][_0x0d63('0x2f')]);_0x2aa19e[_0x0d63('0x33')]=_[_0x0d63('0x49')](_0x41dbba['query']);_0x2aa19e[_0x0d63('0x3c')]=_[_0x0d63('0x4a')](_0x2aa19e[_0x0d63('0x32')],_0x2aa19e[_0x0d63('0x33')]);_0x59a8cf[_0x0d63('0x34')]=_['intersection'](_0x2aa19e[_0x0d63('0x32')],qs['fields'](_0x41dbba[_0x0d63('0x33')][_0x0d63('0x35')]));_0x59a8cf[_0x0d63('0x34')]=_0x59a8cf[_0x0d63('0x34')][_0x0d63('0x36')]?_0x59a8cf['attributes']:_0x2aa19e['model'];if(_0x41dbba[_0x0d63('0x33')][_0x0d63('0x4b')]){_0x59a8cf[_0x0d63('0x43')]=[{'all':!![]}];}_0x59a8cf=_[_0x0d63('0x3f')]({},_0x59a8cf,_0x41dbba[_0x0d63('0x41')]);return db[_0x0d63('0x42')][_0x0d63('0x4c')](_0x59a8cf)[_0x0d63('0x28')](handleEntityNotFound(_0x1df68,null))[_0x0d63('0x28')](respondWithResult(_0x1df68,null))[_0x0d63('0x46')](handleError(_0x1df68,null));};exports[_0x0d63('0x4d')]=function(_0x1e3a2f,_0xf8ac25){return db[_0x0d63('0x42')][_0x0d63('0x4d')](_0x1e3a2f[_0x0d63('0x4e')],{})['then'](function(_0x55f27a){var _0x48b0c9=_0x1e3a2f['user']['get']({'plain':!![]});if(!_0x48b0c9)throw new Error(_0x0d63('0x4f'));if(_0x48b0c9[_0x0d63('0x50')]===_0x0d63('0x51')){var _0x3e0b75=_0x55f27a['get']({'plain':!![]});var _0x3d893c=_0x0d63('0x26');return db[_0x0d63('0x52')][_0x0d63('0x4c')]({'where':{'name':_0x3d893c,'userProfileId':_0x48b0c9[_0x0d63('0x53')]},'raw':!![]})['then'](function(_0x43ec8a){if(_0x43ec8a&&_0x43ec8a[_0x0d63('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e0b75[_0x0d63('0x2b')],'resourceId':_0x3e0b75['id'],'type':_0x43ec8a[_0x0d63('0x2b')],'sectionId':_0x43ec8a['id']},{})[_0x0d63('0x28')](function(){return _0x55f27a;});}else{return _0x55f27a;}})[_0x0d63('0x46')](function(_0x108793){logger[_0x0d63('0x2a')](_0x0d63('0x55'),_0x108793);throw _0x108793;});}return _0x55f27a;})[_0x0d63('0x28')](respondWithResult(_0xf8ac25,0xc9))[_0x0d63('0x46')](handleError(_0xf8ac25,null));};exports['update']=function(_0x9f8854,_0x532dbc){if(_0x9f8854[_0x0d63('0x4e')]['id']){delete _0x9f8854['body']['id'];}return db[_0x0d63('0x42')][_0x0d63('0x4c')]({'where':{'id':_0x9f8854[_0x0d63('0x48')]['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x532dbc,null))[_0x0d63('0x28')](saveUpdates(_0x9f8854[_0x0d63('0x4e')],null))[_0x0d63('0x28')](respondWithResult(_0x532dbc,null))[_0x0d63('0x46')](handleError(_0x532dbc,null));};exports[_0x0d63('0x56')]=function(_0x10a488,_0x192b43){return db['SmsQueue'][_0x0d63('0x4c')]({'where':{'id':_0x10a488[_0x0d63('0x48')]['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x192b43,null))[_0x0d63('0x28')](removeEntity(_0x192b43,null))['catch'](handleError(_0x192b43,null));};exports[_0x0d63('0x57')]=function(_0x68fc03,_0x295861){return db[_0x0d63('0x42')][_0x0d63('0x57')]()[_0x0d63('0x28')](respondWithResult(_0x295861,null))['catch'](handleError(_0x295861,null));};exports[_0x0d63('0x58')]=function(_0x68b966,_0x3e96b3,_0x374862){var _0x3df172={'raw':!![],'where':{}},_0x33f29f={},_0xfe170e;return db['SmsQueue'][_0x0d63('0x59')]({'where':{'id':_0x68b966[_0x0d63('0x48')]['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x3e96b3,null))['then'](function(_0x9540){if(_0x9540){_0xfe170e=_0x9540[_0x0d63('0x5a')]({'plain':!![]});_0x33f29f[_0x0d63('0x32')]=_[_0x0d63('0x49')](db['UserSmsQueue'][_0x0d63('0x2f')]);_0x33f29f[_0x0d63('0x33')]=_[_0x0d63('0x49')](_0x68b966[_0x0d63('0x33')]);_0x33f29f[_0x0d63('0x3c')]=_[_0x0d63('0x4a')](_0x33f29f[_0x0d63('0x32')],_0x33f29f[_0x0d63('0x33')]);_0x3df172['attributes']=_[_0x0d63('0x4a')](_0x33f29f[_0x0d63('0x32')],qs['fields'](_0x68b966[_0x0d63('0x33')][_0x0d63('0x35')]));_0x3df172[_0x0d63('0x34')]=_0x3df172[_0x0d63('0x34')]['length']?_0x3df172[_0x0d63('0x34')]:_0x33f29f[_0x0d63('0x32')];if(!_0x68b966[_0x0d63('0x33')][_0x0d63('0x37')](_0x0d63('0x38'))){_0x3df172['limit']=qs[_0x0d63('0x1c')](_0x68b966['query'][_0x0d63('0x1c')]);_0x3df172['offset']=qs[_0x0d63('0x1e')](_0x68b966['query'][_0x0d63('0x1e')]);}_0x3df172[_0x0d63('0x39')]=qs['sort'](_0x68b966[_0x0d63('0x33')][_0x0d63('0x3a')]);_0x3df172['where']=qs[_0x0d63('0x3c')](_[_0x0d63('0x3d')](_0x68b966[_0x0d63('0x33')],_0x33f29f['filters']));_0x3df172[_0x0d63('0x3b')][_0x0d63('0x5b')]=_0x9540['id'];if(_0x68b966[_0x0d63('0x33')]['filter']){_0x3df172[_0x0d63('0x3b')]=_['merge'](_0x3df172[_0x0d63('0x3b')],{'$or':_[_0x0d63('0x2e')](_0x3df172[_0x0d63('0x34')],function(_0x48e9a5){var _0x1806df={};_0x1806df[_0x48e9a5]={'$like':'%'+_0x68b966['query'][_0x0d63('0x3e')]+'%'};return _0x1806df;})});}_0x3df172=_['merge']({},_0x3df172,_0x68b966[_0x0d63('0x41')]);return db[_0x0d63('0x5c')][_0x0d63('0x44')](_0x3df172);}})['then'](function(_0x6c43a){if(_0x6c43a){return db[_0x0d63('0x5d')]['findAndCountAll']({'where':{'id':_[_0x0d63('0x2e')](_0x6c43a,_0x0d63('0x5e')),'role':'agent'},'attributes':['id','name',_0x0d63('0x5f'),_0x0d63('0x60'),_0x0d63('0x61')]});}})[_0x0d63('0x28')](function(_0xd46b4){if(_0xd46b4){return{'count':_0xd46b4['count'],'rows':_['map'](_0xd46b4[_0x0d63('0x45')],function(_0x3a0b10){return{'membername':_0x3a0b10['name'],'UserId':_0x3a0b10['id'],'queue_name':_0xfe170e[_0x0d63('0x2b')],'SmsQueueId':_0xfe170e['id'],'interface':util[_0x0d63('0x62')](_0x0d63('0x63'),_0x0d63('0x64'),_0x3a0b10['name']),'penalty':0x0,'paused':_0x3a0b10[_0x0d63('0x5f')],'createdAt':_0x3a0b10[_0x0d63('0x61')],'updatedAt':_0x3a0b10[_0x0d63('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d63('0x28')](respondWithFilteredResult(_0x3e96b3,_0x3df172))['catch'](handleError(_0x3e96b3,null));};exports[_0x0d63('0x65')]=function(_0x298884,_0x2ff108,_0x377abb){var _0x424242={};var _0x5b5c8c={};var _0x565cb5;var _0x37f7a7;return db['SmsQueue'][_0x0d63('0x59')]({'where':{'id':_0x298884['params']['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x2ff108,null))[_0x0d63('0x28')](function(_0x4ba8ed){if(_0x4ba8ed){_0x565cb5=_0x4ba8ed;_0x5b5c8c['model']=_[_0x0d63('0x49')](db[_0x0d63('0x66')][_0x0d63('0x2f')]);_0x5b5c8c[_0x0d63('0x33')]=_[_0x0d63('0x49')](_0x298884[_0x0d63('0x33')]);_0x5b5c8c[_0x0d63('0x3c')]=_[_0x0d63('0x4a')](_0x5b5c8c['model'],_0x5b5c8c[_0x0d63('0x33')]);_0x424242['attributes']=_[_0x0d63('0x4a')](_0x5b5c8c[_0x0d63('0x32')],qs[_0x0d63('0x35')](_0x298884[_0x0d63('0x33')][_0x0d63('0x35')]));_0x424242['attributes']=_0x424242[_0x0d63('0x34')][_0x0d63('0x36')]?_0x424242[_0x0d63('0x34')]:_0x5b5c8c[_0x0d63('0x32')];_0x424242[_0x0d63('0x39')]=qs[_0x0d63('0x3a')](_0x298884['query'][_0x0d63('0x3a')]);_0x424242[_0x0d63('0x3b')]=qs['filters'](_[_0x0d63('0x3d')](_0x298884[_0x0d63('0x33')],_0x5b5c8c['filters']));if(_0x298884[_0x0d63('0x33')][_0x0d63('0x3e')]){_0x424242[_0x0d63('0x3b')]=_[_0x0d63('0x3f')](_0x424242[_0x0d63('0x3b')],{'$or':_[_0x0d63('0x2e')](_0x424242[_0x0d63('0x34')],function(_0x15dcb9){var _0x4a30d4={};_0x4a30d4[_0x15dcb9]={'$like':'%'+_0x298884[_0x0d63('0x33')][_0x0d63('0x3e')]+'%'};return _0x4a30d4;})});}_0x424242=_[_0x0d63('0x3f')]({},_0x424242,_0x298884['options']);return _0x565cb5[_0x0d63('0x65')](_0x424242);}})['then'](function(_0x913ad7){if(_0x913ad7){_0x37f7a7=_0x913ad7[_0x0d63('0x36')];if(!_0x298884[_0x0d63('0x33')][_0x0d63('0x37')](_0x0d63('0x38'))){_0x424242[_0x0d63('0x1c')]=qs[_0x0d63('0x1c')](_0x298884[_0x0d63('0x33')][_0x0d63('0x1c')]);_0x424242[_0x0d63('0x1e')]=qs[_0x0d63('0x1e')](_0x298884[_0x0d63('0x33')][_0x0d63('0x1e')]);}return _0x565cb5[_0x0d63('0x65')](_0x424242);}})[_0x0d63('0x28')](function(_0x52e067){if(_0x52e067){return _0x52e067?{'count':_0x37f7a7,'rows':_0x52e067}:null;}})[_0x0d63('0x28')](respondWithResult(_0x2ff108,null))[_0x0d63('0x46')](handleError(_0x2ff108,null));};exports[_0x0d63('0x67')]=function(_0x179357,_0x4670e3,_0x17835){var _0x56dc05=_0x179357[_0x0d63('0x4e')][_0x0d63('0x68')];return db[_0x0d63('0x66')][_0x0d63('0x44')]({'where':{'id':_0x56dc05},'attributes':['id'],'include':[{'model':db[_0x0d63('0x5d')],'as':_0x0d63('0x69'),'attributes':['id',_0x0d63('0x2b'),_0x0d63('0x6a'),_0x0d63('0x6b'),_0x0d63('0x6c')],'raw':!![]}]})[_0x0d63('0x28')](function(_0x5cec75){if(_0x5cec75){var _0x11c7f8=_[_0x0d63('0x6d')](_0x5cec75,function(_0x3f61fe){var _0xc09576=_0x3f61fe['get']({'plain':!![]});return _0xc09576[_0x0d63('0x69')];});return db[_0x0d63('0x42')][_0x0d63('0x4c')]({'where':{'id':_0x179357['params']['id']}})[_0x0d63('0x28')](function(_0x23cc5f){return db[_0x0d63('0x6e')]['transaction'](function(_0x41e764){return _0x23cc5f[_0x0d63('0x67')](_0x56dc05,{'transaction':_0x41e764})[_0x0d63('0x28')](function(){return BPromise['each'](_0x11c7f8,function(_0x4742df){return db[_0x0d63('0x5c')]['findOrCreate']({'where':{'UserId':_0x4742df['id'],'SmsQueueId':_0x179357[_0x0d63('0x48')]['id']},'transaction':_0x41e764});});})[_0x0d63('0x28')](function(){_0x11c7f8[_0x0d63('0x6f')](function(_0xea5e7d){socket[_0x0d63('0x70')](_0x0d63('0x71'),{'UserId':_0xea5e7d['id'],'SmsQueueId':_0x23cc5f['id']});});});});});}})['then'](respondWithStatusCode(_0x4670e3,null))[_0x0d63('0x46')](handleError(_0x4670e3,null));};exports['removeTeams']=function(_0x1459b7,_0xffda79,_0xa9a94f){return db['Team']['findAll']({'where':{'id':_0x1459b7[_0x0d63('0x33')][_0x0d63('0x68')]},'attributes':['id'],'include':[{'model':db[_0x0d63('0x5d')],'as':_0x0d63('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xffda79,null))[_0x0d63('0x28')](function(_0x129559){var _0x3b0a94=_[_0x0d63('0x2e')](_0x129559,'id');var _0x594f54=[];var _0x392178=[];var _0x4fe07e=squel[_0x0d63('0x72')]();_0x4fe07e[_0x0d63('0x73')](_0x0d63('0x74'))[_0x0d63('0x75')](_0x0d63('0x76'),'tq')[_0x0d63('0x77')](_0x0d63('0x78'),'ut',_0x0d63('0x79'))[_0x0d63('0x3b')]('SmsQueueId\x20=\x20?',_0x1459b7[_0x0d63('0x48')]['id']);for(var _0x2ef50a=0x0;_0x2ef50a<_0x129559[_0x0d63('0x36')];_0x2ef50a+=0x1){let _0x48636d=_0x129559[_0x2ef50a];for(var _0x5a57c8=0x0;_0x5a57c8<_0x48636d[_0x0d63('0x69')][_0x0d63('0x36')];_0x5a57c8+=0x1){let _0x101e7a=_0x48636d['Agents'][_0x5a57c8];var _0xfbb3=_0x4fe07e[_0x0d63('0x7a')]();_0xfbb3[_0x0d63('0x3b')](_0x0d63('0x7b'),_0x101e7a['id']);_0x392178[_0x0d63('0x7c')](db['sequelize'][_0x0d63('0x33')](_0xfbb3[_0x0d63('0x7d')](),{'type':db[_0x0d63('0x6e')][_0x0d63('0x7e')][_0x0d63('0x7f')]})[_0x0d63('0x28')](function(_0x189473){if(_0x189473['length']===0x1){return _0x101e7a['id'];}else{var _0x58b0df=_['every'](_[_0x0d63('0x2e')](_0x189473,'TeamId'),function(_0x197f85){return _['includes'](_0x3b0a94,_0x197f85);});if(_0x58b0df){return _0x101e7a['id'];}}}));}}return BPromise[_0x0d63('0x80')](_0x392178)[_0x0d63('0x28')](function(_0x3593bd){_0x594f54=_(_0x594f54)['union'](_0x3593bd)[_0x0d63('0x81')]()[_0x0d63('0x82')]();return db[_0x0d63('0x42')][_0x0d63('0x4c')]({'where':{'id':_0x1459b7['params']['id']}})['then'](function(_0x132a45){return db[_0x0d63('0x6e')][_0x0d63('0x83')](function(_0x195f2d){return _0x132a45[_0x0d63('0x84')](_0x1459b7[_0x0d63('0x33')][_0x0d63('0x68')],{'transaction':_0x195f2d})[_0x0d63('0x28')](function(){if(!_[_0x0d63('0x85')](_0x594f54)){return _0x132a45[_0x0d63('0x86')](_0x594f54,{'transaction':_0x195f2d});}})[_0x0d63('0x28')](function(){_0x594f54[_0x0d63('0x6f')](function(_0xeb17fc){socket['emit'](_0x0d63('0x87'),{'UserId':_0xeb17fc,'SmsQueueId':_0x132a45['id']});});});});});});})[_0x0d63('0x28')](respondWithStatusCode(_0xffda79,null))[_0x0d63('0x46')](handleError(_0xffda79,null));};exports[_0x0d63('0x88')]=function(_0x5782b2,_0x293be9,_0x4a4298){return db[_0x0d63('0x42')][_0x0d63('0x4c')]({'where':{'id':_0x5782b2[_0x0d63('0x48')]['id']}})['then'](handleEntityNotFound(_0x293be9,null))[_0x0d63('0x28')](function(_0x1a23a4){if(_0x1a23a4){return _0x1a23a4[_0x0d63('0x88')](_0x5782b2['body']['ids'],_['omit'](_0x5782b2[_0x0d63('0x4e')],[_0x0d63('0x68'),'id'])||{})['spread'](function(_0x8fc3a8){for(var _0x1c8e03=0x0;_0x1c8e03<_0x5782b2['body'][_0x0d63('0x68')][_0x0d63('0x36')];_0x1c8e03+=0x1){socket[_0x0d63('0x70')](_0x0d63('0x71'),{'UserId':Number(_0x5782b2[_0x0d63('0x4e')]['ids'][_0x1c8e03]),'SmsQueueId':Number(_0x5782b2['params']['id'])});}return _0x8fc3a8;});}})[_0x0d63('0x28')](respondWithResult(_0x293be9,null))[_0x0d63('0x46')](handleError(_0x293be9,null));};exports[_0x0d63('0x86')]=function(_0x164f6f,_0x69179d,_0x1b8cda){return db[_0x0d63('0x42')][_0x0d63('0x4c')]({'where':{'id':_0x164f6f[_0x0d63('0x48')]['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x69179d,null))['then'](function(_0x5a606a){if(_0x5a606a){return _0x5a606a['removeAgents'](_0x164f6f[_0x0d63('0x33')][_0x0d63('0x68')])[_0x0d63('0x28')](function(){if(_[_0x0d63('0x89')](_0x164f6f[_0x0d63('0x33')][_0x0d63('0x68')])){for(var _0xc25d62=0x0;_0xc25d62<_0x164f6f['query'][_0x0d63('0x68')][_0x0d63('0x36')];_0xc25d62+=0x1){socket['emit'](_0x0d63('0x87'),{'UserId':Number(_0x164f6f['query']['ids'][_0xc25d62]),'SmsQueueId':Number(_0x164f6f[_0x0d63('0x48')]['id'])});}}else{socket[_0x0d63('0x70')](_0x0d63('0x87'),{'UserId':Number(_0x164f6f['query'][_0x0d63('0x68')]),'SmsQueueId':Number(_0x164f6f[_0x0d63('0x48')]['id'])});}});}})[_0x0d63('0x28')](respondWithStatusCode(_0x69179d,null))[_0x0d63('0x46')](handleError(_0x69179d,null));};exports[_0x0d63('0x8a')]=function(_0x10d6a0,_0x31d059,_0x200a3e){var _0x121ddb={};var _0x179a85={};var _0x76a8fa;var _0x13e920;return db[_0x0d63('0x42')]['findOne']({'where':{'id':_0x10d6a0[_0x0d63('0x48')]['id']}})[_0x0d63('0x28')](handleEntityNotFound(_0x31d059,null))[_0x0d63('0x28')](function(_0xa2a5b1){if(_0xa2a5b1){_0x76a8fa=_0xa2a5b1;_0x179a85['model']=_[_0x0d63('0x49')](db['User'][_0x0d63('0x2f')]);_0x179a85[_0x0d63('0x33')]=_[_0x0d63('0x49')](_0x10d6a0[_0x0d63('0x33')]);_0x179a85[_0x0d63('0x3c')]=_[_0x0d63('0x4a')](_0x179a85[_0x0d63('0x32')],_0x179a85['query']);_0x121ddb[_0x0d63('0x34')]=_[_0x0d63('0x4a')](_0x179a85[_0x0d63('0x32')],qs['fields'](_0x10d6a0[_0x0d63('0x33')][_0x0d63('0x35')]));_0x121ddb['attributes']=_0x121ddb[_0x0d63('0x34')][_0x0d63('0x36')]?_0x121ddb['attributes']:_0x179a85[_0x0d63('0x32')];_0x121ddb['order']=qs[_0x0d63('0x3a')](_0x10d6a0[_0x0d63('0x33')][_0x0d63('0x3a')]);_0x121ddb['where']=qs[_0x0d63('0x3c')](_[_0x0d63('0x3d')](_0x10d6a0['query'],_0x179a85[_0x0d63('0x3c')]));if(_0x10d6a0['query']['filter']){_0x121ddb[_0x0d63('0x3b')]=_[_0x0d63('0x3f')](_0x121ddb[_0x0d63('0x3b')],{'$or':_[_0x0d63('0x2e')](_0x121ddb[_0x0d63('0x34')],function(_0x46e87c){var _0x2f3e10={};_0x2f3e10[_0x46e87c]={'$like':'%'+_0x10d6a0[_0x0d63('0x33')]['filter']+'%'};return _0x2f3e10;})});}_0x121ddb=_[_0x0d63('0x3f')]({},_0x121ddb,_0x10d6a0[_0x0d63('0x41')]);return _0x76a8fa[_0x0d63('0x8a')](_0x121ddb);}})['then'](function(_0x3be0c0){if(_0x3be0c0){_0x13e920=_0x3be0c0[_0x0d63('0x36')];if(!_0x10d6a0[_0x0d63('0x33')][_0x0d63('0x37')](_0x0d63('0x38'))){_0x121ddb[_0x0d63('0x1c')]=qs[_0x0d63('0x1c')](_0x10d6a0['query'][_0x0d63('0x1c')]);_0x121ddb[_0x0d63('0x1e')]=qs[_0x0d63('0x1e')](_0x10d6a0['query']['offset']);}return _0x76a8fa[_0x0d63('0x8a')](_0x121ddb);}})['then'](function(_0x2915dd){if(_0x2915dd){return _0x2915dd?{'count':_0x13e920,'rows':_0x2915dd}:null;}})[_0x0d63('0x28')](respondWithResult(_0x31d059,null))[_0x0d63('0x46')](handleError(_0x31d059,null));}; \ No newline at end of file +var _0xf1d4=['order','sort','where','filters','pick','filter','type','VIRTUAL','options','SmsQueue','include','findAll','rows','show','params','keys','fields','includeAll','merge','catch','create','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userSmsQueue:save','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','emit','userSmsQueue:remove','addAgents','ids','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','attributes','intersection','length','hasOwnProperty'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xf1d4,0x158));var _0x4f1d=function(_0x2cda64,_0x2e7d29){_0x2cda64=_0x2cda64-0x0;var _0x23a7c2=_0xf1d4[_0x2cda64];return _0x23a7c2;};'use strict';var emlformat=require(_0x4f1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f1d('0x2'));var moment=require(_0x4f1d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f1d('0x4'));var util=require(_0x4f1d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4f1d('0x6'));var ejs=require(_0x4f1d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f1d('0x8'));var squel=require(_0x4f1d('0x9'));var crypto=require(_0x4f1d('0xa'));var jsforce=require(_0x4f1d('0xb'));var deskjs=require(_0x4f1d('0xc'));var toCsv=require(_0x4f1d('0x6'));var querystring=require(_0x4f1d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f1d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4f1d('0xf'));var hardwareService=require(_0x4f1d('0x10'));var logger=require('../../config/logger')(_0x4f1d('0x11'));var utils=require(_0x4f1d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f1d('0x13'))['db'];config['redis']=_[_0x4f1d('0x14')](config[_0x4f1d('0x15')],{'host':_0x4f1d('0x16'),'port':0x18eb});var socket=require(_0x4f1d('0x17'))(new Redis(config[_0x4f1d('0x15')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x17bc89,_0x535f61){_0x535f61=_0x535f61||0xcc;return function(_0x5728ba){if(_0x5728ba){return _0x17bc89['sendStatus'](_0x535f61);}return _0x17bc89[_0x4f1d('0x18')](_0x535f61)['end']();};}function respondWithResult(_0x46aa61,_0x590ba4){_0x590ba4=_0x590ba4||0xc8;return function(_0x3e9e79){if(_0x3e9e79){return _0x46aa61['status'](_0x590ba4)[_0x4f1d('0x19')](_0x3e9e79);}};}function respondWithFilteredResult(_0x85a4b5,_0x46c2f2){return function(_0x58ebbf){if(_0x58ebbf){var _0x1d418b=typeof _0x46c2f2[_0x4f1d('0x1a')]===_0x4f1d('0x1b')&&typeof _0x46c2f2['limit']===_0x4f1d('0x1b');var _0x57bee9=_0x58ebbf[_0x4f1d('0x1c')];var _0x56634c=_0x1d418b?0x0:_0x46c2f2[_0x4f1d('0x1a')];var _0x49eb2b=_0x1d418b?_0x58ebbf[_0x4f1d('0x1c')]:_0x46c2f2[_0x4f1d('0x1a')]+_0x46c2f2[_0x4f1d('0x1d')];var _0x2775b7;if(_0x49eb2b>=_0x57bee9){_0x49eb2b=_0x57bee9;_0x2775b7=0xc8;}else{_0x2775b7=0xce;}_0x85a4b5[_0x4f1d('0x18')](_0x2775b7);return _0x85a4b5[_0x4f1d('0x1e')]('Content-Range',_0x56634c+'-'+_0x49eb2b+'/'+_0x57bee9)[_0x4f1d('0x19')](_0x58ebbf);}return null;};}function patchUpdates(_0x185d7a){return function(_0x26add2){try{jsonpatch[_0x4f1d('0x1f')](_0x26add2,_0x185d7a,!![]);}catch(_0x53ead6){return BPromise[_0x4f1d('0x20')](_0x53ead6);}return _0x26add2[_0x4f1d('0x21')]();};}function saveUpdates(_0x561148,_0x2d04e6){return function(_0x2e421f){if(_0x2e421f){return _0x2e421f[_0x4f1d('0x22')](_0x561148)[_0x4f1d('0x23')](function(_0x3fd3dc){return _0x3fd3dc;});}return null;};}function removeEntity(_0xc1305a,_0x5d0d25){return function(_0x21bdad){if(_0x21bdad){return _0x21bdad[_0x4f1d('0x24')]()['then'](function(){var _0x5451a6=_0x21bdad[_0x4f1d('0x25')]({'plain':!![]});var _0x308de8=_0x4f1d('0x26');return db[_0x4f1d('0x27')]['destroy']({'where':{'type':_0x308de8,'resourceId':_0x5451a6['id']}})[_0x4f1d('0x23')](function(){return _0x21bdad;});})['then'](function(){_0xc1305a['status'](0xcc)[_0x4f1d('0x28')]();});}};}function handleEntityNotFound(_0xce9adf,_0x4eabb0){return function(_0x5d9d26){if(!_0x5d9d26){_0xce9adf['sendStatus'](0x194);}return _0x5d9d26;};}function handleError(_0x55190d,_0x16ba23){_0x16ba23=_0x16ba23||0x1f4;return function(_0x7894a6){logger[_0x4f1d('0x29')](_0x7894a6[_0x4f1d('0x2a')]);if(_0x7894a6[_0x4f1d('0x2b')]){delete _0x7894a6[_0x4f1d('0x2b')];}_0x55190d[_0x4f1d('0x18')](_0x16ba23)[_0x4f1d('0x2c')](_0x7894a6);};}exports['index']=function(_0x2505ae,_0x228753){var _0x2a1784={},_0x57851e={},_0x443852={'count':0x0,'rows':[]};var _0x2614b2=_['map'](db['SmsQueue'][_0x4f1d('0x2d')],function(_0x223084){return{'name':_0x223084[_0x4f1d('0x2e')],'type':_0x223084['type'][_0x4f1d('0x2f')]};});_0x57851e[_0x4f1d('0x30')]=_[_0x4f1d('0x31')](_0x2614b2,_0x4f1d('0x2b'));_0x57851e[_0x4f1d('0x32')]=_['keys'](_0x2505ae[_0x4f1d('0x32')]);_0x57851e['filters']=_['intersection'](_0x57851e[_0x4f1d('0x30')],_0x57851e[_0x4f1d('0x32')]);_0x2a1784[_0x4f1d('0x33')]=_[_0x4f1d('0x34')](_0x57851e[_0x4f1d('0x30')],qs['fields'](_0x2505ae[_0x4f1d('0x32')]['fields']));_0x2a1784[_0x4f1d('0x33')]=_0x2a1784[_0x4f1d('0x33')][_0x4f1d('0x35')]?_0x2a1784[_0x4f1d('0x33')]:_0x57851e[_0x4f1d('0x30')];if(!_0x2505ae[_0x4f1d('0x32')][_0x4f1d('0x36')]('nolimit')){_0x2a1784['limit']=qs['limit'](_0x2505ae[_0x4f1d('0x32')][_0x4f1d('0x1d')]);_0x2a1784[_0x4f1d('0x1a')]=qs[_0x4f1d('0x1a')](_0x2505ae['query'][_0x4f1d('0x1a')]);}_0x2a1784[_0x4f1d('0x37')]=qs[_0x4f1d('0x38')](_0x2505ae['query'][_0x4f1d('0x38')]);_0x2a1784[_0x4f1d('0x39')]=qs[_0x4f1d('0x3a')](_[_0x4f1d('0x3b')](_0x2505ae['query'],_0x57851e['filters']),_0x2614b2);if(_0x2505ae['query'][_0x4f1d('0x3c')]){_0x2a1784[_0x4f1d('0x39')]=_['merge'](_0x2a1784['where'],{'$or':_[_0x4f1d('0x31')](_0x2614b2,function(_0x421fc2){if(_0x421fc2[_0x4f1d('0x3d')]!==_0x4f1d('0x3e')){var _0xd0d1e0={};_0xd0d1e0[_0x421fc2['name']]={'$like':'%'+_0x2505ae[_0x4f1d('0x32')]['filter']+'%'};return _0xd0d1e0;}})});}_0x2a1784=_['merge']({},_0x2a1784,_0x2505ae[_0x4f1d('0x3f')]);var _0x4c4c36={'where':_0x2a1784[_0x4f1d('0x39')]};return db[_0x4f1d('0x40')][_0x4f1d('0x1c')](_0x4c4c36)[_0x4f1d('0x23')](function(_0x2edb4a){_0x443852[_0x4f1d('0x1c')]=_0x2edb4a;if(_0x2505ae['query']['includeAll']){_0x2a1784[_0x4f1d('0x41')]=[{'all':!![]}];}return db[_0x4f1d('0x40')][_0x4f1d('0x42')](_0x2a1784);})[_0x4f1d('0x23')](function(_0x1e75e7){_0x443852[_0x4f1d('0x43')]=_0x1e75e7;return _0x443852;})[_0x4f1d('0x23')](respondWithFilteredResult(_0x228753,_0x2a1784))['catch'](handleError(_0x228753,null));};exports[_0x4f1d('0x44')]=function(_0x3f6974,_0x104c77){var _0x3ebd53={'raw':!![],'where':{'id':_0x3f6974[_0x4f1d('0x45')]['id']}},_0x3889e5={};_0x3889e5[_0x4f1d('0x30')]=_['keys'](db[_0x4f1d('0x40')][_0x4f1d('0x2d')]);_0x3889e5[_0x4f1d('0x32')]=_[_0x4f1d('0x46')](_0x3f6974[_0x4f1d('0x32')]);_0x3889e5[_0x4f1d('0x3a')]=_['intersection'](_0x3889e5[_0x4f1d('0x30')],_0x3889e5['query']);_0x3ebd53[_0x4f1d('0x33')]=_['intersection'](_0x3889e5['model'],qs[_0x4f1d('0x47')](_0x3f6974[_0x4f1d('0x32')][_0x4f1d('0x47')]));_0x3ebd53[_0x4f1d('0x33')]=_0x3ebd53[_0x4f1d('0x33')][_0x4f1d('0x35')]?_0x3ebd53[_0x4f1d('0x33')]:_0x3889e5[_0x4f1d('0x30')];if(_0x3f6974[_0x4f1d('0x32')][_0x4f1d('0x48')]){_0x3ebd53[_0x4f1d('0x41')]=[{'all':!![]}];}_0x3ebd53=_[_0x4f1d('0x49')]({},_0x3ebd53,_0x3f6974[_0x4f1d('0x3f')]);return db['SmsQueue']['find'](_0x3ebd53)[_0x4f1d('0x23')](handleEntityNotFound(_0x104c77,null))[_0x4f1d('0x23')](respondWithResult(_0x104c77,null))[_0x4f1d('0x4a')](handleError(_0x104c77,null));};exports['create']=function(_0x6a5568,_0x2ab294){return db[_0x4f1d('0x40')][_0x4f1d('0x4b')](_0x6a5568['body'],{})[_0x4f1d('0x23')](function(_0x1b7692){var _0x431063=_0x6a5568[_0x4f1d('0x4c')][_0x4f1d('0x25')]({'plain':!![]});if(!_0x431063)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x431063[_0x4f1d('0x4d')]===_0x4f1d('0x4c')){var _0x43525d=_0x1b7692[_0x4f1d('0x25')]({'plain':!![]});var _0x5ad561=_0x4f1d('0x26');return db['UserProfileSection'][_0x4f1d('0x4e')]({'where':{'name':_0x5ad561,'userProfileId':_0x431063[_0x4f1d('0x4f')]},'raw':!![]})[_0x4f1d('0x23')](function(_0x25b797){if(_0x25b797&&_0x25b797['autoAssociation']===0x0){return db[_0x4f1d('0x27')][_0x4f1d('0x4b')]({'name':_0x43525d[_0x4f1d('0x2b')],'resourceId':_0x43525d['id'],'type':_0x25b797[_0x4f1d('0x2b')],'sectionId':_0x25b797['id']},{})['then'](function(){return _0x1b7692;});}else{return _0x1b7692;}})[_0x4f1d('0x4a')](function(_0x18eb59){logger[_0x4f1d('0x29')](_0x4f1d('0x50'),_0x18eb59);throw _0x18eb59;});}return _0x1b7692;})[_0x4f1d('0x23')](respondWithResult(_0x2ab294,0xc9))[_0x4f1d('0x4a')](handleError(_0x2ab294,null));};exports[_0x4f1d('0x22')]=function(_0x3553a5,_0x47a618){if(_0x3553a5[_0x4f1d('0x51')]['id']){delete _0x3553a5[_0x4f1d('0x51')]['id'];}return db['SmsQueue'][_0x4f1d('0x4e')]({'where':{'id':_0x3553a5[_0x4f1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x47a618,null))[_0x4f1d('0x23')](saveUpdates(_0x3553a5[_0x4f1d('0x51')],null))[_0x4f1d('0x23')](respondWithResult(_0x47a618,null))['catch'](handleError(_0x47a618,null));};exports[_0x4f1d('0x24')]=function(_0xf4246f,_0xc0271b){return db[_0x4f1d('0x40')][_0x4f1d('0x4e')]({'where':{'id':_0xf4246f[_0x4f1d('0x45')]['id']}})['then'](handleEntityNotFound(_0xc0271b,null))['then'](removeEntity(_0xc0271b,null))[_0x4f1d('0x4a')](handleError(_0xc0271b,null));};exports['describe']=function(_0x1252a4,_0x349399){return db['SmsQueue'][_0x4f1d('0x52')]()['then'](respondWithResult(_0x349399,null))[_0x4f1d('0x4a')](handleError(_0x349399,null));};exports['getMembers']=function(_0x4fee5a,_0x3bd4cf,_0x19382f){var _0x7cc7f1={'raw':!![],'where':{}},_0x3453d3={},_0x24bf61;return db[_0x4f1d('0x40')]['findOne']({'where':{'id':_0x4fee5a['params']['id']}})[_0x4f1d('0x23')](handleEntityNotFound(_0x3bd4cf,null))[_0x4f1d('0x23')](function(_0x4c8594){if(_0x4c8594){_0x24bf61=_0x4c8594['get']({'plain':!![]});_0x3453d3['model']=_[_0x4f1d('0x46')](db[_0x4f1d('0x53')]['rawAttributes']);_0x3453d3['query']=_[_0x4f1d('0x46')](_0x4fee5a[_0x4f1d('0x32')]);_0x3453d3['filters']=_['intersection'](_0x3453d3[_0x4f1d('0x30')],_0x3453d3[_0x4f1d('0x32')]);_0x7cc7f1[_0x4f1d('0x33')]=_['intersection'](_0x3453d3['model'],qs[_0x4f1d('0x47')](_0x4fee5a[_0x4f1d('0x32')]['fields']));_0x7cc7f1['attributes']=_0x7cc7f1[_0x4f1d('0x33')][_0x4f1d('0x35')]?_0x7cc7f1[_0x4f1d('0x33')]:_0x3453d3[_0x4f1d('0x30')];if(!_0x4fee5a['query'][_0x4f1d('0x36')](_0x4f1d('0x54'))){_0x7cc7f1['limit']=qs[_0x4f1d('0x1d')](_0x4fee5a[_0x4f1d('0x32')][_0x4f1d('0x1d')]);_0x7cc7f1['offset']=qs[_0x4f1d('0x1a')](_0x4fee5a[_0x4f1d('0x32')]['offset']);}_0x7cc7f1[_0x4f1d('0x37')]=qs[_0x4f1d('0x38')](_0x4fee5a[_0x4f1d('0x32')][_0x4f1d('0x38')]);_0x7cc7f1['where']=qs[_0x4f1d('0x3a')](_[_0x4f1d('0x3b')](_0x4fee5a[_0x4f1d('0x32')],_0x3453d3[_0x4f1d('0x3a')]));_0x7cc7f1[_0x4f1d('0x39')][_0x4f1d('0x55')]=_0x4c8594['id'];if(_0x4fee5a[_0x4f1d('0x32')]['filter']){_0x7cc7f1[_0x4f1d('0x39')]=_[_0x4f1d('0x49')](_0x7cc7f1[_0x4f1d('0x39')],{'$or':_[_0x4f1d('0x31')](_0x7cc7f1[_0x4f1d('0x33')],function(_0x4e6755){var _0x21de50={};_0x21de50[_0x4e6755]={'$like':'%'+_0x4fee5a['query'][_0x4f1d('0x3c')]+'%'};return _0x21de50;})});}_0x7cc7f1=_[_0x4f1d('0x49')]({},_0x7cc7f1,_0x4fee5a[_0x4f1d('0x3f')]);return db[_0x4f1d('0x53')][_0x4f1d('0x42')](_0x7cc7f1);}})[_0x4f1d('0x23')](function(_0x365e0f){if(_0x365e0f){return db[_0x4f1d('0x56')][_0x4f1d('0x57')]({'where':{'id':_[_0x4f1d('0x31')](_0x365e0f,_0x4f1d('0x58')),'role':_0x4f1d('0x59')},'attributes':['id',_0x4f1d('0x2b'),_0x4f1d('0x5a'),_0x4f1d('0x5b'),_0x4f1d('0x5c')]});}})['then'](function(_0x9753d2){if(_0x9753d2){return{'count':_0x9753d2['count'],'rows':_[_0x4f1d('0x31')](_0x9753d2['rows'],function(_0x4a57df){return{'membername':_0x4a57df[_0x4f1d('0x2b')],'UserId':_0x4a57df['id'],'queue_name':_0x24bf61[_0x4f1d('0x2b')],'SmsQueueId':_0x24bf61['id'],'interface':util['format'](_0x4f1d('0x5d'),_0x4f1d('0x5e'),_0x4a57df['name']),'penalty':0x0,'paused':_0x4a57df[_0x4f1d('0x5a')],'createdAt':_0x4a57df['createdAt'],'updatedAt':_0x4a57df[_0x4f1d('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4f1d('0x23')](respondWithFilteredResult(_0x3bd4cf,_0x7cc7f1))[_0x4f1d('0x4a')](handleError(_0x3bd4cf,null));};exports[_0x4f1d('0x5f')]=function(_0x1658cf,_0x2596a4,_0x6c540c){var _0x3c7d8a={};var _0x2a065c={};var _0x1496bb;var _0x16cf9c;return db[_0x4f1d('0x40')][_0x4f1d('0x60')]({'where':{'id':_0x1658cf[_0x4f1d('0x45')]['id']}})[_0x4f1d('0x23')](handleEntityNotFound(_0x2596a4,null))[_0x4f1d('0x23')](function(_0x586f0b){if(_0x586f0b){_0x1496bb=_0x586f0b;_0x2a065c[_0x4f1d('0x30')]=_[_0x4f1d('0x46')](db[_0x4f1d('0x61')][_0x4f1d('0x2d')]);_0x2a065c['query']=_['keys'](_0x1658cf[_0x4f1d('0x32')]);_0x2a065c['filters']=_[_0x4f1d('0x34')](_0x2a065c[_0x4f1d('0x30')],_0x2a065c['query']);_0x3c7d8a['attributes']=_[_0x4f1d('0x34')](_0x2a065c[_0x4f1d('0x30')],qs['fields'](_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x47')]));_0x3c7d8a[_0x4f1d('0x33')]=_0x3c7d8a[_0x4f1d('0x33')]['length']?_0x3c7d8a[_0x4f1d('0x33')]:_0x2a065c['model'];_0x3c7d8a[_0x4f1d('0x37')]=qs[_0x4f1d('0x38')](_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x38')]);_0x3c7d8a[_0x4f1d('0x39')]=qs[_0x4f1d('0x3a')](_[_0x4f1d('0x3b')](_0x1658cf[_0x4f1d('0x32')],_0x2a065c[_0x4f1d('0x3a')]));if(_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x3c')]){_0x3c7d8a[_0x4f1d('0x39')]=_['merge'](_0x3c7d8a[_0x4f1d('0x39')],{'$or':_[_0x4f1d('0x31')](_0x3c7d8a['attributes'],function(_0x58eddf){var _0x32bd16={};_0x32bd16[_0x58eddf]={'$like':'%'+_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x3c')]+'%'};return _0x32bd16;})});}_0x3c7d8a=_[_0x4f1d('0x49')]({},_0x3c7d8a,_0x1658cf[_0x4f1d('0x3f')]);return _0x1496bb[_0x4f1d('0x5f')](_0x3c7d8a);}})['then'](function(_0xb45d20){if(_0xb45d20){_0x16cf9c=_0xb45d20[_0x4f1d('0x35')];if(!_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x36')](_0x4f1d('0x54'))){_0x3c7d8a[_0x4f1d('0x1d')]=qs[_0x4f1d('0x1d')](_0x1658cf[_0x4f1d('0x32')][_0x4f1d('0x1d')]);_0x3c7d8a[_0x4f1d('0x1a')]=qs[_0x4f1d('0x1a')](_0x1658cf[_0x4f1d('0x32')]['offset']);}return _0x1496bb[_0x4f1d('0x5f')](_0x3c7d8a);}})[_0x4f1d('0x23')](function(_0x4aeeb3){if(_0x4aeeb3){return _0x4aeeb3?{'count':_0x16cf9c,'rows':_0x4aeeb3}:null;}})[_0x4f1d('0x23')](respondWithResult(_0x2596a4,null))[_0x4f1d('0x4a')](handleError(_0x2596a4,null));};exports['addTeams']=function(_0x2716f6,_0x2c0076,_0x1399eb){var _0x55aac4=_0x2716f6[_0x4f1d('0x51')]['ids'];return db[_0x4f1d('0x61')][_0x4f1d('0x42')]({'where':{'id':_0x55aac4},'attributes':['id'],'include':[{'model':db[_0x4f1d('0x56')],'as':_0x4f1d('0x62'),'attributes':['id',_0x4f1d('0x2b'),_0x4f1d('0x63'),'voicePause',_0x4f1d('0x64')],'raw':!![]}]})[_0x4f1d('0x23')](function(_0x9f97c){if(_0x9f97c){var _0x4d0b05=_[_0x4f1d('0x65')](_0x9f97c,function(_0x9ac5ae){var _0x20a15e=_0x9ac5ae['get']({'plain':!![]});return _0x20a15e['Agents'];});return db[_0x4f1d('0x40')][_0x4f1d('0x4e')]({'where':{'id':_0x2716f6['params']['id']}})[_0x4f1d('0x23')](function(_0x1570cd){return db[_0x4f1d('0x66')][_0x4f1d('0x67')](function(_0x26f6fa){return _0x1570cd[_0x4f1d('0x68')](_0x55aac4,{'transaction':_0x26f6fa})[_0x4f1d('0x23')](function(){return BPromise['each'](_0x4d0b05,function(_0x1a426b){return db[_0x4f1d('0x53')][_0x4f1d('0x69')]({'where':{'UserId':_0x1a426b['id'],'SmsQueueId':_0x2716f6[_0x4f1d('0x45')]['id']},'transaction':_0x26f6fa});});})[_0x4f1d('0x23')](function(){_0x4d0b05[_0x4f1d('0x6a')](function(_0xbf079f){socket['emit'](_0x4f1d('0x6b'),{'UserId':_0xbf079f['id'],'SmsQueueId':_0x1570cd['id']});});});});});}})[_0x4f1d('0x23')](respondWithStatusCode(_0x2c0076,null))['catch'](handleError(_0x2c0076,null));};exports['removeTeams']=function(_0x445927,_0x496b23,_0x8d39da){return db[_0x4f1d('0x61')]['findAll']({'where':{'id':_0x445927[_0x4f1d('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4f1d('0x56')],'as':_0x4f1d('0x62'),'attributes':['id'],'raw':!![]}]})[_0x4f1d('0x23')](handleEntityNotFound(_0x496b23,null))['then'](function(_0x35bd6c){var _0xf00fcd=_[_0x4f1d('0x31')](_0x35bd6c,'id');var _0x11eae1=[];var _0x3516c4=[];var _0x37031a=squel[_0x4f1d('0x6c')]();_0x37031a[_0x4f1d('0x6d')]('tq.TeamId')[_0x4f1d('0x6e')](_0x4f1d('0x6f'),'tq')[_0x4f1d('0x70')](_0x4f1d('0x71'),'ut',_0x4f1d('0x72'))['where']('SmsQueueId\x20=\x20?',_0x445927[_0x4f1d('0x45')]['id']);for(var _0x5c3f42=0x0;_0x5c3f42<_0x35bd6c[_0x4f1d('0x35')];_0x5c3f42+=0x1){let _0xc68a3c=_0x35bd6c[_0x5c3f42];for(var _0x37dd3a=0x0;_0x37dd3a<_0xc68a3c['Agents'][_0x4f1d('0x35')];_0x37dd3a+=0x1){let _0x539f46=_0xc68a3c[_0x4f1d('0x62')][_0x37dd3a];var _0x1a8a51=_0x37031a[_0x4f1d('0x73')]();_0x1a8a51['where']('ut.UserId\x20=\x20?',_0x539f46['id']);_0x3516c4['push'](db[_0x4f1d('0x66')]['query'](_0x1a8a51[_0x4f1d('0x74')](),{'type':db[_0x4f1d('0x66')][_0x4f1d('0x75')]['SELECT']})[_0x4f1d('0x23')](function(_0x296bf8){if(_0x296bf8[_0x4f1d('0x35')]===0x1){return _0x539f46['id'];}else{var _0x3da46b=_['every'](_[_0x4f1d('0x31')](_0x296bf8,_0x4f1d('0x76')),function(_0x22b687){return _[_0x4f1d('0x77')](_0xf00fcd,_0x22b687);});if(_0x3da46b){return _0x539f46['id'];}}}));}}return BPromise[_0x4f1d('0x78')](_0x3516c4)[_0x4f1d('0x23')](function(_0x2515d4){_0x11eae1=_(_0x11eae1)[_0x4f1d('0x79')](_0x2515d4)[_0x4f1d('0x7a')]()[_0x4f1d('0x7b')]();return db[_0x4f1d('0x40')][_0x4f1d('0x4e')]({'where':{'id':_0x445927['params']['id']}})[_0x4f1d('0x23')](function(_0x15585e){return db[_0x4f1d('0x66')][_0x4f1d('0x67')](function(_0x507f10){return _0x15585e[_0x4f1d('0x7c')](_0x445927[_0x4f1d('0x32')]['ids'],{'transaction':_0x507f10})[_0x4f1d('0x23')](function(){if(!_['isEmpty'](_0x11eae1)){return _0x15585e[_0x4f1d('0x7d')](_0x11eae1,{'transaction':_0x507f10});}})[_0x4f1d('0x23')](function(){_0x11eae1[_0x4f1d('0x6a')](function(_0x3b7c83){socket[_0x4f1d('0x7e')](_0x4f1d('0x7f'),{'UserId':_0x3b7c83,'SmsQueueId':_0x15585e['id']});});});});});});})['then'](respondWithStatusCode(_0x496b23,null))[_0x4f1d('0x4a')](handleError(_0x496b23,null));};exports[_0x4f1d('0x80')]=function(_0xbc9e3c,_0x3d5dc5,_0x58c062){return db[_0x4f1d('0x40')]['find']({'where':{'id':_0xbc9e3c[_0x4f1d('0x45')]['id']}})[_0x4f1d('0x23')](handleEntityNotFound(_0x3d5dc5,null))[_0x4f1d('0x23')](function(_0x1b3075){if(_0x1b3075){return _0x1b3075[_0x4f1d('0x80')](_0xbc9e3c['body'][_0x4f1d('0x81')],_['omit'](_0xbc9e3c[_0x4f1d('0x51')],[_0x4f1d('0x81'),'id'])||{})[_0x4f1d('0x82')](function(_0x1cc344){for(var _0x209d78=0x0;_0x209d78<_0xbc9e3c[_0x4f1d('0x51')]['ids']['length'];_0x209d78+=0x1){socket[_0x4f1d('0x7e')](_0x4f1d('0x6b'),{'UserId':Number(_0xbc9e3c['body'][_0x4f1d('0x81')][_0x209d78]),'SmsQueueId':Number(_0xbc9e3c[_0x4f1d('0x45')]['id'])});}return _0x1cc344;});}})[_0x4f1d('0x23')](respondWithResult(_0x3d5dc5,null))['catch'](handleError(_0x3d5dc5,null));};exports[_0x4f1d('0x7d')]=function(_0x14118c,_0x254e41,_0x15f130){return db[_0x4f1d('0x40')]['find']({'where':{'id':_0x14118c[_0x4f1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x254e41,null))[_0x4f1d('0x23')](function(_0x3aa69a){if(_0x3aa69a){return _0x3aa69a[_0x4f1d('0x7d')](_0x14118c[_0x4f1d('0x32')][_0x4f1d('0x81')])[_0x4f1d('0x23')](function(){if(_[_0x4f1d('0x83')](_0x14118c[_0x4f1d('0x32')]['ids'])){for(var _0xdf31d9=0x0;_0xdf31d9<_0x14118c['query'][_0x4f1d('0x81')][_0x4f1d('0x35')];_0xdf31d9+=0x1){socket['emit'](_0x4f1d('0x7f'),{'UserId':Number(_0x14118c[_0x4f1d('0x32')][_0x4f1d('0x81')][_0xdf31d9]),'SmsQueueId':Number(_0x14118c['params']['id'])});}}else{socket[_0x4f1d('0x7e')](_0x4f1d('0x7f'),{'UserId':Number(_0x14118c[_0x4f1d('0x32')][_0x4f1d('0x81')]),'SmsQueueId':Number(_0x14118c[_0x4f1d('0x45')]['id'])});}});}})[_0x4f1d('0x23')](respondWithStatusCode(_0x254e41,null))[_0x4f1d('0x4a')](handleError(_0x254e41,null));};exports['getAgents']=function(_0x59bd01,_0x50efb9,_0x299030){var _0x49a5e7={};var _0x3df083={};var _0xd09e2c;var _0x2188de;return db[_0x4f1d('0x40')][_0x4f1d('0x60')]({'where':{'id':_0x59bd01[_0x4f1d('0x45')]['id']}})[_0x4f1d('0x23')](handleEntityNotFound(_0x50efb9,null))[_0x4f1d('0x23')](function(_0x18bd10){if(_0x18bd10){_0xd09e2c=_0x18bd10;_0x3df083[_0x4f1d('0x30')]=_[_0x4f1d('0x46')](db[_0x4f1d('0x56')]['rawAttributes']);_0x3df083[_0x4f1d('0x32')]=_[_0x4f1d('0x46')](_0x59bd01[_0x4f1d('0x32')]);_0x3df083[_0x4f1d('0x3a')]=_[_0x4f1d('0x34')](_0x3df083[_0x4f1d('0x30')],_0x3df083[_0x4f1d('0x32')]);_0x49a5e7[_0x4f1d('0x33')]=_[_0x4f1d('0x34')](_0x3df083['model'],qs[_0x4f1d('0x47')](_0x59bd01[_0x4f1d('0x32')]['fields']));_0x49a5e7[_0x4f1d('0x33')]=_0x49a5e7[_0x4f1d('0x33')]['length']?_0x49a5e7[_0x4f1d('0x33')]:_0x3df083[_0x4f1d('0x30')];_0x49a5e7[_0x4f1d('0x37')]=qs[_0x4f1d('0x38')](_0x59bd01[_0x4f1d('0x32')][_0x4f1d('0x38')]);_0x49a5e7['where']=qs['filters'](_['pick'](_0x59bd01[_0x4f1d('0x32')],_0x3df083[_0x4f1d('0x3a')]));if(_0x59bd01['query']['filter']){_0x49a5e7[_0x4f1d('0x39')]=_['merge'](_0x49a5e7[_0x4f1d('0x39')],{'$or':_[_0x4f1d('0x31')](_0x49a5e7[_0x4f1d('0x33')],function(_0x130ae8){var _0x164669={};_0x164669[_0x130ae8]={'$like':'%'+_0x59bd01[_0x4f1d('0x32')]['filter']+'%'};return _0x164669;})});}_0x49a5e7=_['merge']({},_0x49a5e7,_0x59bd01[_0x4f1d('0x3f')]);return _0xd09e2c['getAgents'](_0x49a5e7);}})[_0x4f1d('0x23')](function(_0x3f001d){if(_0x3f001d){_0x2188de=_0x3f001d['length'];if(!_0x59bd01[_0x4f1d('0x32')][_0x4f1d('0x36')](_0x4f1d('0x54'))){_0x49a5e7[_0x4f1d('0x1d')]=qs[_0x4f1d('0x1d')](_0x59bd01[_0x4f1d('0x32')][_0x4f1d('0x1d')]);_0x49a5e7[_0x4f1d('0x1a')]=qs[_0x4f1d('0x1a')](_0x59bd01[_0x4f1d('0x32')][_0x4f1d('0x1a')]);}return _0xd09e2c[_0x4f1d('0x84')](_0x49a5e7);}})[_0x4f1d('0x23')](function(_0x2518a8){if(_0x2518a8){return _0x2518a8?{'count':_0x2188de,'rows':_0x2518a8}:null;}})['then'](respondWithResult(_0x50efb9,null))[_0x4f1d('0x4a')](handleError(_0x50efb9,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9021527..bdcc12e 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 _0x36b9=['setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb','SmsQueue'];(function(_0x2b06b8,_0x364df3){var _0x38cdda=function(_0x13665c){while(--_0x13665c){_0x2b06b8['push'](_0x2b06b8['shift']());}};_0x38cdda(++_0x364df3);}(_0x36b9,0x95));var _0x936b=function(_0x445afa,_0x86fb12){_0x445afa=_0x445afa-0x0;var _0x50e081=_0x36b9[_0x445afa];return _0x50e081;};'use strict';var EventEmitter=require(_0x936b('0x0'));var SmsQueue=require(_0x936b('0x1'))['db'][_0x936b('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x936b('0x3')](0x0);var events={'afterCreate':_0x936b('0x4'),'afterUpdate':_0x936b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d8e99){return function(_0x1ceb4d,_0x2df20b,_0x1a79cf){SmsQueueEvents[_0x936b('0x6')](_0x4d8e99+':'+_0x1ceb4d['id'],_0x1ceb4d);SmsQueueEvents['emit'](_0x4d8e99,_0x1ceb4d);_0x1a79cf(null);};}for(var e in events){if(events[_0x936b('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xae41=['hook','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x209150,_0x448e12){var _0x3290d3=function(_0x353fab){while(--_0x353fab){_0x209150['push'](_0x209150['shift']());}};_0x3290d3(++_0x448e12);}(_0xae41,0x129));var _0x1ae4=function(_0x2aa73b,_0x381a41){_0x2aa73b=_0x2aa73b-0x0;var _0x57d9d0=_0xae41[_0x2aa73b];return _0x57d9d0;};'use strict';var EventEmitter=require(_0x1ae4('0x0'));var SmsQueue=require(_0x1ae4('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1ae4('0x2')](0x0);var events={'afterCreate':_0x1ae4('0x3'),'afterUpdate':_0x1ae4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x586968){return function(_0x9e6158,_0xb70359,_0xd21a6f){SmsQueueEvents[_0x1ae4('0x5')](_0x586968+':'+_0x9e6158['id'],_0x9e6158);SmsQueueEvents[_0x1ae4('0x5')](_0x586968,_0x9e6158);_0xd21a6f(null);};}for(var e in events){if(events[_0x1ae4('0x6')](e)){var event=events[e];SmsQueue[_0x1ae4('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b0ff624..b307328 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 _0x1291=['exports','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x1291,0xc2));var _0x1129=function(_0xb16caf,_0x1f1559){_0xb16caf=_0xb16caf-0x0;var _0x27b6b6=_0x1291[_0xb16caf];return _0x27b6b6;};'use strict';var _=require(_0x1129('0x0'));var util=require(_0x1129('0x1'));var logger=require(_0x1129('0x2'))(_0x1129('0x3'));var moment=require(_0x1129('0x4'));var BPromise=require(_0x1129('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1129('0x6'));var rimraf=require(_0x1129('0x7'));var config=require(_0x1129('0x8'));var attributes=require(_0x1129('0x9'));module[_0x1129('0xa')]=function(_0x4543bb,_0x8a4fb4){return _0x4543bb['define'](_0x1129('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00c7=['bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','util','../../config/logger','api'];(function(_0x3dee1e,_0x421c00){var _0x53c826=function(_0x1c31d3){while(--_0x1c31d3){_0x3dee1e['push'](_0x3dee1e['shift']());}};_0x53c826(++_0x421c00);}(_0x00c7,0x6b));var _0x700c=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x00c7[_0x3b150c];return _0x5cd414;};'use strict';var _=require('lodash');var util=require(_0x700c('0x0'));var logger=require(_0x700c('0x1'))(_0x700c('0x2'));var moment=require('moment');var BPromise=require(_0x700c('0x3'));var rp=require(_0x700c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x700c('0x5'));var config=require(_0x700c('0x6'));var attributes=require(_0x700c('0x7'));module[_0x700c('0x8')]=function(_0x1507a2,_0x4352a6){return _0x1507a2['define'](_0x700c('0x9'),attributes,{'tableName':_0x700c('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 5f61201..8838697 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 _0x01d7=['code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','findAll','raw','options','limit','include','attributes','map','model','SmsQueue','where','ShowSmsQueue','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x01d7,0x1be));var _0x701d=function(_0x4208e7,_0x59d268){_0x4208e7=_0x4208e7-0x0;var _0xfb6f5b=_0x01d7[_0x4208e7];return _0xfb6f5b;};'use strict';var _=require(_0x701d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x701d('0x1'));var db=require(_0x701d('0x2'))['db'];var utils=require(_0x701d('0x3'));var logger=require(_0x701d('0x4'))(_0x701d('0x5'));var config=require(_0x701d('0x6'));var jayson=require(_0x701d('0x7'));var client=jayson['client'][_0x701d('0x8')]({'port':0x232a});config[_0x701d('0x9')]=_[_0x701d('0xa')](config['redis'],{'host':_0x701d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x701d('0x9')]));require(_0x701d('0xc'))[_0x701d('0xd')](socket);function respondWithRpcPromise(_0x117c93,_0x1b51a4,_0x3ff37c){return new BPromise(function(_0x30c788,_0x14902b){return client[_0x701d('0xe')](_0x117c93,_0x3ff37c)[_0x701d('0xf')](function(_0x5923c6){logger[_0x701d('0x10')]('SmsQueue,\x20%s,\x20%s',_0x1b51a4,'request\x20sent');logger[_0x701d('0x11')](_0x701d('0x12'),_0x1b51a4,_0x701d('0x13'),JSON[_0x701d('0x14')](_0x5923c6));if(_0x5923c6['error']){if(_0x5923c6[_0x701d('0x15')][_0x701d('0x16')]===0x1f4){logger[_0x701d('0x15')](_0x701d('0x17'),_0x1b51a4,_0x5923c6['error'][_0x701d('0x18')]);return _0x14902b(_0x5923c6[_0x701d('0x15')][_0x701d('0x18')]);}logger[_0x701d('0x15')](_0x701d('0x17'),_0x1b51a4,_0x5923c6[_0x701d('0x15')][_0x701d('0x18')]);return _0x30c788(_0x5923c6[_0x701d('0x15')][_0x701d('0x18')]);}else{logger[_0x701d('0x10')](_0x701d('0x17'),_0x1b51a4,_0x701d('0x13'));_0x30c788(_0x5923c6[_0x701d('0x19')][_0x701d('0x18')]);}})[_0x701d('0x1a')](function(_0x4a1eab){logger[_0x701d('0x15')](_0x701d('0x17'),_0x1b51a4,_0x4a1eab);_0x14902b(_0x4a1eab);});});}exports[_0x701d('0x1b')]=function(_0x322dfb){var _0x24a0f7=this;return new Promise(function(_0x4fa486,_0xc8e1db){return db['SmsQueue'][_0x701d('0x1c')]({'raw':_0x322dfb['options']?_0x322dfb['options'][_0x701d('0x1d')]===undefined?!![]:![]:!![],'where':_0x322dfb[_0x701d('0x1e')]?_0x322dfb[_0x701d('0x1e')]['where']||null:null,'attributes':_0x322dfb['options']?_0x322dfb['options']['attributes']||null:null,'limit':_0x322dfb[_0x701d('0x1e')]?_0x322dfb[_0x701d('0x1e')][_0x701d('0x1f')]||null:null,'include':_0x322dfb[_0x701d('0x1e')]?_0x322dfb[_0x701d('0x1e')][_0x701d('0x20')]?_['map'](_0x322dfb['options'][_0x701d('0x20')],function(_0x213e87){return{'model':db[_0x213e87['model']],'as':_0x213e87['as'],'attributes':_0x213e87[_0x701d('0x21')],'include':_0x213e87[_0x701d('0x20')]?_[_0x701d('0x22')](_0x213e87['include'],function(_0x3d5d9e){return{'model':db[_0x3d5d9e[_0x701d('0x23')]],'as':_0x3d5d9e['as'],'attributes':_0x3d5d9e[_0x701d('0x21')],'include':_0x3d5d9e[_0x701d('0x20')]?_['map'](_0x3d5d9e[_0x701d('0x20')],function(_0x694095){return{'model':db[_0x694095['model']],'as':_0x694095['as'],'attributes':_0x694095[_0x701d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x701d('0xf')](function(_0x836778){logger[_0x701d('0x10')](_0x701d('0x1b'),_0x322dfb);logger[_0x701d('0x11')]('GetSmsQueue',_0x322dfb,JSON[_0x701d('0x14')](_0x836778));_0x4fa486(_0x836778);})[_0x701d('0x1a')](function(_0x468b85){logger['error'](_0x701d('0x1b'),_0x468b85[_0x701d('0x18')],_0x322dfb);_0xc8e1db(_0x24a0f7[_0x701d('0x15')](0x1f4,_0x468b85['message']));});});};exports['ShowSmsQueue']=function(_0x20fc81){var _0x4e3366=this;return new Promise(function(_0x218ff2,_0x26b4ff){return db[_0x701d('0x24')]['find']({'raw':_0x20fc81[_0x701d('0x1e')]?_0x20fc81['options'][_0x701d('0x1d')]===undefined?!![]:![]:!![],'where':_0x20fc81[_0x701d('0x1e')]?_0x20fc81[_0x701d('0x1e')][_0x701d('0x25')]||null:null,'attributes':_0x20fc81['options']?_0x20fc81[_0x701d('0x1e')][_0x701d('0x21')]||null:null,'include':_0x20fc81[_0x701d('0x1e')]?_0x20fc81['options'][_0x701d('0x20')]?_[_0x701d('0x22')](_0x20fc81[_0x701d('0x1e')][_0x701d('0x20')],function(_0x4f2d01){return{'model':db[_0x4f2d01['model']],'as':_0x4f2d01['as'],'attributes':_0x4f2d01[_0x701d('0x21')],'include':_0x4f2d01['include']?_['map'](_0x4f2d01[_0x701d('0x20')],function(_0xcf1421){return{'model':db[_0xcf1421['model']],'as':_0xcf1421['as'],'attributes':_0xcf1421['attributes'],'include':_0xcf1421[_0x701d('0x20')]?_['map'](_0xcf1421['include'],function(_0x4f423a){return{'model':db[_0x4f423a['model']],'as':_0x4f423a['as'],'attributes':_0x4f423a[_0x701d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x701d('0xf')](function(_0x50dca7){logger[_0x701d('0x10')]('ShowSmsQueue',_0x20fc81);logger['debug']('ShowSmsQueue',_0x20fc81,JSON[_0x701d('0x14')](_0x50dca7));_0x218ff2(_0x50dca7);})[_0x701d('0x1a')](function(_0x46af17){logger[_0x701d('0x15')](_0x701d('0x26'),_0x46af17[_0x701d('0x18')],_0x20fc81);_0x26b4ff(_0x4e3366[_0x701d('0x15')](0x1f4,_0x46af17[_0x701d('0x18')]));});});}; \ No newline at end of file +var _0xdae6=['catch','findAll','options','where','limit','include','attributes','map','model','then','GetSmsQueue','ShowSmsQueue','find','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2ed4c9,_0x243771){var _0x237f0a=function(_0x7f100b){while(--_0x7f100b){_0x2ed4c9['push'](_0x2ed4c9['shift']());}};_0x237f0a(++_0x243771);}(_0xdae6,0x1a8));var _0x6dae=function(_0x2940eb,_0x426a48){_0x2940eb=_0x2940eb-0x0;var _0x5f7621=_0xdae6[_0x2940eb];return _0x5f7621;};'use strict';var _=require('lodash');var util=require(_0x6dae('0x0'));var moment=require(_0x6dae('0x1'));var BPromise=require(_0x6dae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dae('0x3'));var db=require(_0x6dae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dae('0x5'))(_0x6dae('0x6'));var config=require(_0x6dae('0x7'));var jayson=require(_0x6dae('0x8'));var client=jayson[_0x6dae('0x9')][_0x6dae('0xa')]({'port':0x232a});config['redis']=_[_0x6dae('0xb')](config['redis'],{'host':_0x6dae('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dae('0xd')]));require(_0x6dae('0xe'))[_0x6dae('0xf')](socket);function respondWithRpcPromise(_0x52cf33,_0x1b93b2,_0x190126){return new BPromise(function(_0x33d3ad,_0x23a528){return client[_0x6dae('0x10')](_0x52cf33,_0x190126)['then'](function(_0x306587){logger[_0x6dae('0x11')](_0x6dae('0x12'),_0x1b93b2,_0x6dae('0x13'));logger[_0x6dae('0x14')](_0x6dae('0x15'),_0x1b93b2,_0x6dae('0x13'),JSON[_0x6dae('0x16')](_0x306587));if(_0x306587[_0x6dae('0x17')]){if(_0x306587[_0x6dae('0x17')][_0x6dae('0x18')]===0x1f4){logger[_0x6dae('0x17')](_0x6dae('0x12'),_0x1b93b2,_0x306587[_0x6dae('0x17')]['message']);return _0x23a528(_0x306587[_0x6dae('0x17')][_0x6dae('0x19')]);}logger[_0x6dae('0x17')]('SmsQueue,\x20%s,\x20%s',_0x1b93b2,_0x306587[_0x6dae('0x17')][_0x6dae('0x19')]);return _0x33d3ad(_0x306587[_0x6dae('0x17')][_0x6dae('0x19')]);}else{logger[_0x6dae('0x11')](_0x6dae('0x12'),_0x1b93b2,'request\x20sent');_0x33d3ad(_0x306587[_0x6dae('0x1a')][_0x6dae('0x19')]);}})[_0x6dae('0x1b')](function(_0x2751b4){logger[_0x6dae('0x17')](_0x6dae('0x12'),_0x1b93b2,_0x2751b4);_0x23a528(_0x2751b4);});});}exports['GetSmsQueue']=function(_0x172fd3){var _0xd33a28=this;return new Promise(function(_0x1796fc,_0x1120d0){return db['SmsQueue'][_0x6dae('0x1c')]({'raw':_0x172fd3[_0x6dae('0x1d')]?_0x172fd3[_0x6dae('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x172fd3['options']?_0x172fd3[_0x6dae('0x1d')][_0x6dae('0x1e')]||null:null,'attributes':_0x172fd3['options']?_0x172fd3['options']['attributes']||null:null,'limit':_0x172fd3['options']?_0x172fd3[_0x6dae('0x1d')][_0x6dae('0x1f')]||null:null,'include':_0x172fd3[_0x6dae('0x1d')]?_0x172fd3[_0x6dae('0x1d')][_0x6dae('0x20')]?_['map'](_0x172fd3['options'][_0x6dae('0x20')],function(_0x282caf){return{'model':db[_0x282caf['model']],'as':_0x282caf['as'],'attributes':_0x282caf[_0x6dae('0x21')],'include':_0x282caf[_0x6dae('0x20')]?_[_0x6dae('0x22')](_0x282caf[_0x6dae('0x20')],function(_0x11c91c){return{'model':db[_0x11c91c[_0x6dae('0x23')]],'as':_0x11c91c['as'],'attributes':_0x11c91c[_0x6dae('0x21')],'include':_0x11c91c['include']?_[_0x6dae('0x22')](_0x11c91c[_0x6dae('0x20')],function(_0x47db6f){return{'model':db[_0x47db6f['model']],'as':_0x47db6f['as'],'attributes':_0x47db6f[_0x6dae('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6dae('0x24')](function(_0x2d60e0){logger[_0x6dae('0x11')]('GetSmsQueue',_0x172fd3);logger[_0x6dae('0x14')](_0x6dae('0x25'),_0x172fd3,JSON[_0x6dae('0x16')](_0x2d60e0));_0x1796fc(_0x2d60e0);})[_0x6dae('0x1b')](function(_0xe273d4){logger[_0x6dae('0x17')](_0x6dae('0x25'),_0xe273d4[_0x6dae('0x19')],_0x172fd3);_0x1120d0(_0xd33a28[_0x6dae('0x17')](0x1f4,_0xe273d4[_0x6dae('0x19')]));});});};exports[_0x6dae('0x26')]=function(_0x523990){var _0x4febec=this;return new Promise(function(_0x339662,_0x3733ff){return db['SmsQueue'][_0x6dae('0x27')]({'raw':_0x523990[_0x6dae('0x1d')]?_0x523990['options'][_0x6dae('0x28')]===undefined?!![]:![]:!![],'where':_0x523990[_0x6dae('0x1d')]?_0x523990[_0x6dae('0x1d')][_0x6dae('0x1e')]||null:null,'attributes':_0x523990[_0x6dae('0x1d')]?_0x523990[_0x6dae('0x1d')]['attributes']||null:null,'include':_0x523990['options']?_0x523990['options']['include']?_['map'](_0x523990[_0x6dae('0x1d')][_0x6dae('0x20')],function(_0x462139){return{'model':db[_0x462139[_0x6dae('0x23')]],'as':_0x462139['as'],'attributes':_0x462139[_0x6dae('0x21')],'include':_0x462139[_0x6dae('0x20')]?_['map'](_0x462139[_0x6dae('0x20')],function(_0x2a7eb9){return{'model':db[_0x2a7eb9['model']],'as':_0x2a7eb9['as'],'attributes':_0x2a7eb9[_0x6dae('0x21')],'include':_0x2a7eb9['include']?_[_0x6dae('0x22')](_0x2a7eb9[_0x6dae('0x20')],function(_0x591ec8){return{'model':db[_0x591ec8['model']],'as':_0x591ec8['as'],'attributes':_0x591ec8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe8d371){logger[_0x6dae('0x11')](_0x6dae('0x26'),_0x523990);logger[_0x6dae('0x14')](_0x6dae('0x26'),_0x523990,JSON[_0x6dae('0x16')](_0xe8d371));_0x339662(_0xe8d371);})[_0x6dae('0x1b')](function(_0xd7371e){logger[_0x6dae('0x17')](_0x6dae('0x26'),_0xd7371e[_0x6dae('0x19')],_0x523990);_0x3733ff(_0x4febec['error'](0x1f4,_0xd7371e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0899d7a..57e8624 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 _0xc200=['update','emit','removeListener','register'];(function(_0x50499c,_0x188984){var _0xd422b3=function(_0x35e6cf){while(--_0x35e6cf){_0x50499c['push'](_0x50499c['shift']());}};_0xd422b3(++_0x188984);}(_0xc200,0x168));var _0x0c20=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xc200[_0x243b59];return _0x3e1676;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save','remove',_0x0c20('0x0')];function createListener(_0x2f0752,_0x4593ef){return function(_0x5e842d){_0x4593ef[_0x0c20('0x1')](_0x2f0752,_0x5e842d);};}function removeListener(_0x4464d0,_0x45e09c){return function(){SmsQueueEvents[_0x0c20('0x2')](_0x4464d0,_0x45e09c);};}exports[_0x0c20('0x3')]=function(_0x2e229d){for(var _0x102154=0x0,_0x5eb3c1=events['length'];_0x102154<_0x5eb3c1;_0x102154++){var _0x313f9=events[_0x102154];var _0xf12790=createListener('smsQueue:'+_0x313f9,_0x2e229d);SmsQueueEvents['on'](_0x313f9,_0xf12790);}}; \ No newline at end of file +var _0x8cce=['length','smsQueue:','save','remove','update','register'];(function(_0x420809,_0x54cc1e){var _0x3b2787=function(_0x2b3614){while(--_0x2b3614){_0x420809['push'](_0x420809['shift']());}};_0x3b2787(++_0x54cc1e);}(_0x8cce,0x98));var _0xe8cc=function(_0x515919,_0xd4a0c6){_0x515919=_0x515919-0x0;var _0x475d27=_0x8cce[_0x515919];return _0x475d27;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe8cc('0x0'),_0xe8cc('0x1'),_0xe8cc('0x2')];function createListener(_0x146494,_0x3d8f6c){return function(_0x41bf43){_0x3d8f6c['emit'](_0x146494,_0x41bf43);};}function removeListener(_0x1d6cee,_0x356d85){return function(){SmsQueueEvents['removeListener'](_0x1d6cee,_0x356d85);};}exports[_0xe8cc('0x3')]=function(_0x4a4dc0){for(var _0x3d6064=0x0,_0x5865d1=events[_0xe8cc('0x4')];_0x3d6064<_0x5865d1;_0x3d6064++){var _0x245405=events[_0x3d6064];var _0x3bed92=createListener(_0xe8cc('0x5')+_0x245405,_0x4a4dc0);SmsQueueEvents['on'](_0x245405,_0x3bed92);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b620273..ae10a8d 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 _0xaddb=['post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x41189e,_0x3d55da){var _0x96756e=function(_0x58398c){while(--_0x58398c){_0x41189e['push'](_0x41189e['shift']());}};_0x96756e(++_0x3d55da);}(_0xaddb,0x83));var _0xbadd=function(_0xcc3fe9,_0x5df74b){_0xcc3fe9=_0xcc3fe9-0x0;var _0x2957a1=_0xaddb[_0xcc3fe9];return _0x2957a1;};'use strict';var multer=require(_0xbadd('0x0'));var util=require(_0xbadd('0x1'));var path=require(_0xbadd('0x2'));var timeout=require('connect-timeout');var express=require(_0xbadd('0x3'));var router=express[_0xbadd('0x4')]();var fs_extra=require(_0xbadd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbadd('0x6'));var config=require(_0xbadd('0x7'));var controller=require(_0xbadd('0x8'));router['get']('/',auth[_0xbadd('0x9')](),controller[_0xbadd('0xa')]);router[_0xbadd('0xb')](_0xbadd('0xc'),auth[_0xbadd('0x9')](),controller[_0xbadd('0xd')]);router[_0xbadd('0xb')](_0xbadd('0xe'),auth['isAuthenticated'](),controller[_0xbadd('0xf')]);router[_0xbadd('0x10')]('/',auth['isAuthenticated'](),controller[_0xbadd('0x11')]);router[_0xbadd('0x12')](_0xbadd('0xe'),auth[_0xbadd('0x9')](),controller[_0xbadd('0x13')]);router[_0xbadd('0x14')](_0xbadd('0xe'),auth[_0xbadd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbb1a=['./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x23f065,_0x4a4f01){var _0x2c428a=function(_0x323fa8){while(--_0x323fa8){_0x23f065['push'](_0x23f065['shift']());}};_0x2c428a(++_0x4a4f01);}(_0xbb1a,0x14c));var _0xabb1=function(_0x2d6c6e,_0x1b0081){_0x2d6c6e=_0x2d6c6e-0x0;var _0x35ac05=_0xbb1a[_0x2d6c6e];return _0x35ac05;};'use strict';var multer=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var path=require(_0xabb1('0x2'));var timeout=require(_0xabb1('0x3'));var express=require('express');var router=express[_0xabb1('0x4')]();var fs_extra=require(_0xabb1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xabb1('0x6'));var config=require(_0xabb1('0x7'));var controller=require(_0xabb1('0x8'));router['get']('/',auth[_0xabb1('0x9')](),controller[_0xabb1('0xa')]);router[_0xabb1('0xb')](_0xabb1('0xc'),auth[_0xabb1('0x9')](),controller['describe']);router[_0xabb1('0xb')](_0xabb1('0xd'),auth[_0xabb1('0x9')](),controller[_0xabb1('0xe')]);router['post']('/',auth[_0xabb1('0x9')](),controller[_0xabb1('0xf')]);router[_0xabb1('0x10')]('/:id',auth[_0xabb1('0x9')](),controller[_0xabb1('0x11')]);router[_0xabb1('0x12')](_0xabb1('0xd'),auth[_0xabb1('0x9')](),controller[_0xabb1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 96b4639..310a9f8 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 _0xa808=['sequelize','STRING','DATE','moment'];(function(_0x266717,_0xff44e8){var _0x2429d0=function(_0x21edb3){while(--_0x21edb3){_0x266717['push'](_0x266717['shift']());}};_0x2429d0(++_0xff44e8);}(_0xa808,0x12b));var _0x8a80=function(_0x38c972,_0x4cc2db){_0x38c972=_0x38c972-0x0;var _0x377f91=_0xa808[_0x38c972];return _0x377f91;};'use strict';var moment=require(_0x8a80('0x0'));var Sequelize=require(_0x8a80('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8a80('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8a80('0x3')]},'leaveAt':{'type':Sequelize[_0x8a80('0x3')]},'acceptAt':{'type':Sequelize[_0x8a80('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8a80('0x2')]}}; \ No newline at end of file +var _0xa5d5=['DATE','moment','sequelize','exports','STRING'];(function(_0x442677,_0x4cd01c){var _0x1b7e4c=function(_0x5e8988){while(--_0x5e8988){_0x442677['push'](_0x442677['shift']());}};_0x1b7e4c(++_0x4cd01c);}(_0xa5d5,0x100));var _0x5a5d=function(_0x4be607,_0x6334eb){_0x4be607=_0x4be607-0x0;var _0x4a771c=_0xa5d5[_0x4be607];return _0x4a771c;};'use strict';var moment=require(_0x5a5d('0x0'));var Sequelize=require(_0x5a5d('0x1'));module[_0x5a5d('0x2')]={'uniqueid':{'type':Sequelize[_0x5a5d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5a5d('0x4')]},'leaveAt':{'type':Sequelize[_0x5a5d('0x4')]},'acceptAt':{'type':Sequelize[_0x5a5d('0x4')]},'exitAt':{'type':Sequelize[_0x5a5d('0x4')]},'reason':{'type':Sequelize[_0x5a5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 27c2dcc..d0f4ed6 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 _0x70e7=['find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','SmsQueueReport','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options'];(function(_0x40634e,_0x793f17){var _0x8d50c5=function(_0xde0fdc){while(--_0xde0fdc){_0x40634e['push'](_0x40634e['shift']());}};_0x8d50c5(++_0x793f17);}(_0x70e7,0xdc));var _0x770e=function(_0x220cf7,_0xe88424){_0x220cf7=_0x220cf7-0x0;var _0x18ca81=_0x70e7[_0x220cf7];return _0x18ca81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x770e('0x0'));var zipdir=require(_0x770e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x770e('0x2'));var moment=require(_0x770e('0x3'));var BPromise=require(_0x770e('0x4'));var Mustache=require('mustache');var util=require(_0x770e('0x5'));var path=require('path');var sox=require(_0x770e('0x6'));var csv=require('to-csv');var ejs=require(_0x770e('0x7'));var fs=require('fs');var fs_extra=require(_0x770e('0x8'));var _=require(_0x770e('0x9'));var squel=require('squel');var crypto=require(_0x770e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x770e('0xb'));var toCsv=require(_0x770e('0xc'));var querystring=require(_0x770e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x770e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x770e('0xf'));var hardwareService=require(_0x770e('0x10'));var logger=require(_0x770e('0x11'))('api');var utils=require(_0x770e('0x12'));var config=require(_0x770e('0x13'));var licenseUtil=require(_0x770e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30e9e0,_0x1096b0){_0x1096b0=_0x1096b0||0xcc;return function(_0x5abb7a){if(_0x5abb7a){return _0x30e9e0[_0x770e('0x15')](_0x1096b0);}return _0x30e9e0['status'](_0x1096b0)[_0x770e('0x16')]();};}function respondWithResult(_0x1048db,_0x22631c){_0x22631c=_0x22631c||0xc8;return function(_0x41091a){if(_0x41091a){return _0x1048db[_0x770e('0x17')](_0x22631c)[_0x770e('0x18')](_0x41091a);}};}function respondWithFilteredResult(_0x558d4f,_0x17a5fb){return function(_0x6a54cb){if(_0x6a54cb){var _0x1a7cac=typeof _0x17a5fb['offset']===_0x770e('0x19')&&typeof _0x17a5fb[_0x770e('0x1a')]===_0x770e('0x19');var _0x3bc92e=_0x6a54cb['count'];var _0x217f5d=_0x1a7cac?0x0:_0x17a5fb[_0x770e('0x1b')];var _0x52c376=_0x1a7cac?_0x6a54cb[_0x770e('0x1c')]:_0x17a5fb[_0x770e('0x1b')]+_0x17a5fb['limit'];var _0x3a6844;if(_0x52c376>=_0x3bc92e){_0x52c376=_0x3bc92e;_0x3a6844=0xc8;}else{_0x3a6844=0xce;}_0x558d4f[_0x770e('0x17')](_0x3a6844);return _0x558d4f[_0x770e('0x1d')]('Content-Range',_0x217f5d+'-'+_0x52c376+'/'+_0x3bc92e)[_0x770e('0x18')](_0x6a54cb);}return null;};}function patchUpdates(_0x57b820){return function(_0x47609d){try{jsonpatch[_0x770e('0x1e')](_0x47609d,_0x57b820,!![]);}catch(_0x23b013){return BPromise[_0x770e('0x1f')](_0x23b013);}return _0x47609d[_0x770e('0x20')]();};}function saveUpdates(_0x3631a4,_0x524b1e){return function(_0x156c2b){if(_0x156c2b){return _0x156c2b[_0x770e('0x21')](_0x3631a4)[_0x770e('0x22')](function(_0xc9bd2a){return _0xc9bd2a;});}return null;};}function removeEntity(_0x1778f4,_0x3901f9){return function(_0x40565c){if(_0x40565c){return _0x40565c[_0x770e('0x23')]()[_0x770e('0x22')](function(){_0x1778f4[_0x770e('0x17')](0xcc)[_0x770e('0x16')]();});}};}function handleEntityNotFound(_0x23a16e,_0x1a8655){return function(_0x3d4c33){if(!_0x3d4c33){_0x23a16e[_0x770e('0x15')](0x194);}return _0x3d4c33;};}function handleError(_0x4290f2,_0x9f71f5){_0x9f71f5=_0x9f71f5||0x1f4;return function(_0x3b8949){logger[_0x770e('0x24')](_0x3b8949[_0x770e('0x25')]);if(_0x3b8949[_0x770e('0x26')]){delete _0x3b8949[_0x770e('0x26')];}_0x4290f2[_0x770e('0x17')](_0x9f71f5)['send'](_0x3b8949);};}exports['index']=function(_0xcd47c4,_0x1c3ced){var _0x2ef78f={},_0x1f878f={},_0x4647c4={'count':0x0,'rows':[]};var _0x27a66b=_['map'](db[_0x770e('0x27')]['rawAttributes'],function(_0xa60f42){return{'name':_0xa60f42['fieldName'],'type':_0xa60f42[_0x770e('0x28')][_0x770e('0x29')]};});_0x1f878f[_0x770e('0x2a')]=_[_0x770e('0x2b')](_0x27a66b,_0x770e('0x26'));_0x1f878f[_0x770e('0x2c')]=_['keys'](_0xcd47c4[_0x770e('0x2c')]);_0x1f878f[_0x770e('0x2d')]=_[_0x770e('0x2e')](_0x1f878f['model'],_0x1f878f['query']);_0x2ef78f[_0x770e('0x2f')]=_[_0x770e('0x2e')](_0x1f878f[_0x770e('0x2a')],qs[_0x770e('0x30')](_0xcd47c4['query']['fields']));_0x2ef78f[_0x770e('0x2f')]=_0x2ef78f[_0x770e('0x2f')]['length']?_0x2ef78f[_0x770e('0x2f')]:_0x1f878f[_0x770e('0x2a')];if(!_0xcd47c4[_0x770e('0x2c')][_0x770e('0x31')](_0x770e('0x32'))){_0x2ef78f['limit']=qs[_0x770e('0x1a')](_0xcd47c4[_0x770e('0x2c')][_0x770e('0x1a')]);_0x2ef78f[_0x770e('0x1b')]=qs[_0x770e('0x1b')](_0xcd47c4['query'][_0x770e('0x1b')]);}_0x2ef78f[_0x770e('0x33')]=qs[_0x770e('0x34')](_0xcd47c4[_0x770e('0x2c')][_0x770e('0x34')]);_0x2ef78f[_0x770e('0x35')]=qs[_0x770e('0x2d')](_[_0x770e('0x36')](_0xcd47c4[_0x770e('0x2c')],_0x1f878f['filters']),_0x27a66b);if(_0xcd47c4[_0x770e('0x2c')][_0x770e('0x37')]){_0x2ef78f[_0x770e('0x35')]=_[_0x770e('0x38')](_0x2ef78f[_0x770e('0x35')],{'$or':_[_0x770e('0x2b')](_0x27a66b,function(_0x11c57a){if(_0x11c57a['type']!==_0x770e('0x39')){var _0x5d37df={};_0x5d37df[_0x11c57a['name']]={'$like':'%'+_0xcd47c4[_0x770e('0x2c')][_0x770e('0x37')]+'%'};return _0x5d37df;}})});}_0x2ef78f=_[_0x770e('0x38')]({},_0x2ef78f,_0xcd47c4['options']);var _0xe8184b={'where':_0x2ef78f[_0x770e('0x35')]};return db[_0x770e('0x27')][_0x770e('0x1c')](_0xe8184b)[_0x770e('0x22')](function(_0x4b28ac){_0x4647c4[_0x770e('0x1c')]=_0x4b28ac;if(_0xcd47c4[_0x770e('0x2c')][_0x770e('0x3a')]){_0x2ef78f[_0x770e('0x3b')]=[{'all':!![]}];}return db[_0x770e('0x27')][_0x770e('0x3c')](_0x2ef78f);})[_0x770e('0x22')](function(_0xb3153d){_0x4647c4[_0x770e('0x3d')]=_0xb3153d;return _0x4647c4;})['then'](respondWithFilteredResult(_0x1c3ced,_0x2ef78f))[_0x770e('0x3e')](handleError(_0x1c3ced,null));};exports['show']=function(_0x5bc698,_0x2664c7){var _0x230f76={'raw':!![],'where':{'id':_0x5bc698[_0x770e('0x3f')]['id']}},_0x22b88b={};_0x22b88b[_0x770e('0x2a')]=_[_0x770e('0x40')](db[_0x770e('0x27')][_0x770e('0x41')]);_0x22b88b[_0x770e('0x2c')]=_['keys'](_0x5bc698[_0x770e('0x2c')]);_0x22b88b[_0x770e('0x2d')]=_[_0x770e('0x2e')](_0x22b88b[_0x770e('0x2a')],_0x22b88b[_0x770e('0x2c')]);_0x230f76[_0x770e('0x2f')]=_[_0x770e('0x2e')](_0x22b88b[_0x770e('0x2a')],qs[_0x770e('0x30')](_0x5bc698[_0x770e('0x2c')][_0x770e('0x30')]));_0x230f76[_0x770e('0x2f')]=_0x230f76[_0x770e('0x2f')][_0x770e('0x42')]?_0x230f76[_0x770e('0x2f')]:_0x22b88b['model'];if(_0x5bc698['query'][_0x770e('0x3a')]){_0x230f76[_0x770e('0x3b')]=[{'all':!![]}];}_0x230f76=_['merge']({},_0x230f76,_0x5bc698[_0x770e('0x43')]);return db[_0x770e('0x27')][_0x770e('0x44')](_0x230f76)[_0x770e('0x22')](handleEntityNotFound(_0x2664c7,null))[_0x770e('0x22')](respondWithResult(_0x2664c7,null))[_0x770e('0x3e')](handleError(_0x2664c7,null));};exports[_0x770e('0x45')]=function(_0x2f63fa,_0x539fcc){return db[_0x770e('0x27')][_0x770e('0x45')](_0x2f63fa[_0x770e('0x46')],{})[_0x770e('0x22')](respondWithResult(_0x539fcc,0xc9))[_0x770e('0x3e')](handleError(_0x539fcc,null));};exports[_0x770e('0x21')]=function(_0x233291,_0x1f1998){if(_0x233291[_0x770e('0x46')]['id']){delete _0x233291['body']['id'];}return db[_0x770e('0x27')][_0x770e('0x44')]({'where':{'id':_0x233291[_0x770e('0x3f')]['id']}})[_0x770e('0x22')](handleEntityNotFound(_0x1f1998,null))[_0x770e('0x22')](saveUpdates(_0x233291[_0x770e('0x46')],null))[_0x770e('0x22')](respondWithResult(_0x1f1998,null))['catch'](handleError(_0x1f1998,null));};exports['destroy']=function(_0x44ef20,_0x4b9291){return db[_0x770e('0x27')][_0x770e('0x44')]({'where':{'id':_0x44ef20[_0x770e('0x3f')]['id']}})[_0x770e('0x22')](handleEntityNotFound(_0x4b9291,null))[_0x770e('0x22')](removeEntity(_0x4b9291,null))['catch'](handleError(_0x4b9291,null));};exports[_0x770e('0x47')]=function(_0x482ebf,_0x129ac0){return db[_0x770e('0x27')]['describe']()[_0x770e('0x22')](respondWithResult(_0x129ac0,null))['catch'](handleError(_0x129ac0,null));}; \ No newline at end of file +var _0x19d0=['create','body','destroy','describe','eml-format','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x559e51,_0x2836f7){var _0x3d228c=function(_0x1f2a44){while(--_0x1f2a44){_0x559e51['push'](_0x559e51['shift']());}};_0x3d228c(++_0x2836f7);}(_0x19d0,0xe5));var _0x019d=function(_0x1e05d9,_0x5bd1a8){_0x1e05d9=_0x1e05d9-0x0;var _0x48a2e9=_0x19d0[_0x1e05d9];return _0x48a2e9;};'use strict';var emlformat=require(_0x019d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x019d('0x1'));var Mustache=require(_0x019d('0x2'));var util=require(_0x019d('0x3'));var path=require(_0x019d('0x4'));var sox=require(_0x019d('0x5'));var csv=require(_0x019d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x019d('0x7'));var _=require(_0x019d('0x8'));var squel=require(_0x019d('0x9'));var crypto=require('crypto');var jsforce=require(_0x019d('0xa'));var deskjs=require(_0x019d('0xb'));var toCsv=require(_0x019d('0x6'));var querystring=require('querystring');var Papa=require(_0x019d('0xc'));var Redis=require(_0x019d('0xd'));var authService=require(_0x019d('0xe'));var qs=require(_0x019d('0xf'));var as=require(_0x019d('0x10'));var hardwareService=require(_0x019d('0x11'));var logger=require(_0x019d('0x12'))('api');var utils=require(_0x019d('0x13'));var config=require(_0x019d('0x14'));var licenseUtil=require(_0x019d('0x15'));var db=require(_0x019d('0x16'))['db'];function respondWithStatusCode(_0x1b79f3,_0x1eeb94){_0x1eeb94=_0x1eeb94||0xcc;return function(_0x544a08){if(_0x544a08){return _0x1b79f3[_0x019d('0x17')](_0x1eeb94);}return _0x1b79f3[_0x019d('0x18')](_0x1eeb94)[_0x019d('0x19')]();};}function respondWithResult(_0x21fefa,_0x35368b){_0x35368b=_0x35368b||0xc8;return function(_0x16cc4a){if(_0x16cc4a){return _0x21fefa['status'](_0x35368b)['json'](_0x16cc4a);}};}function respondWithFilteredResult(_0x3a744e,_0x4390e3){return function(_0x51acab){if(_0x51acab){var _0x554ce7=typeof _0x4390e3[_0x019d('0x1a')]===_0x019d('0x1b')&&typeof _0x4390e3[_0x019d('0x1c')]===_0x019d('0x1b');var _0x5ba948=_0x51acab['count'];var _0x2bd6fd=_0x554ce7?0x0:_0x4390e3[_0x019d('0x1a')];var _0x41cc81=_0x554ce7?_0x51acab['count']:_0x4390e3[_0x019d('0x1a')]+_0x4390e3[_0x019d('0x1c')];var _0x4858ab;if(_0x41cc81>=_0x5ba948){_0x41cc81=_0x5ba948;_0x4858ab=0xc8;}else{_0x4858ab=0xce;}_0x3a744e[_0x019d('0x18')](_0x4858ab);return _0x3a744e[_0x019d('0x1d')](_0x019d('0x1e'),_0x2bd6fd+'-'+_0x41cc81+'/'+_0x5ba948)['json'](_0x51acab);}return null;};}function patchUpdates(_0xde85a4){return function(_0x11fa06){try{jsonpatch[_0x019d('0x1f')](_0x11fa06,_0xde85a4,!![]);}catch(_0x1181a3){return BPromise[_0x019d('0x20')](_0x1181a3);}return _0x11fa06[_0x019d('0x21')]();};}function saveUpdates(_0x42f77e,_0xb1f20d){return function(_0x538afc){if(_0x538afc){return _0x538afc[_0x019d('0x22')](_0x42f77e)[_0x019d('0x23')](function(_0x264285){return _0x264285;});}return null;};}function removeEntity(_0x3eb2ae,_0x17aea8){return function(_0x282517){if(_0x282517){return _0x282517['destroy']()['then'](function(){_0x3eb2ae[_0x019d('0x18')](0xcc)[_0x019d('0x19')]();});}};}function handleEntityNotFound(_0x246a8e,_0x42c85e){return function(_0xdc3dd3){if(!_0xdc3dd3){_0x246a8e[_0x019d('0x17')](0x194);}return _0xdc3dd3;};}function handleError(_0x418039,_0x47e548){_0x47e548=_0x47e548||0x1f4;return function(_0x3a36dc){logger[_0x019d('0x24')](_0x3a36dc['stack']);if(_0x3a36dc[_0x019d('0x25')]){delete _0x3a36dc[_0x019d('0x25')];}_0x418039[_0x019d('0x18')](_0x47e548)[_0x019d('0x26')](_0x3a36dc);};}exports['index']=function(_0x2c2de7,_0x1e19be){var _0x317a69={},_0x1c1e03={},_0x5b026e={'count':0x0,'rows':[]};var _0x571d73=_[_0x019d('0x27')](db[_0x019d('0x28')][_0x019d('0x29')],function(_0x16c1ae){return{'name':_0x16c1ae[_0x019d('0x2a')],'type':_0x16c1ae[_0x019d('0x2b')]['key']};});_0x1c1e03[_0x019d('0x2c')]=_[_0x019d('0x27')](_0x571d73,_0x019d('0x25'));_0x1c1e03[_0x019d('0x2d')]=_[_0x019d('0x2e')](_0x2c2de7[_0x019d('0x2d')]);_0x1c1e03['filters']=_[_0x019d('0x2f')](_0x1c1e03[_0x019d('0x2c')],_0x1c1e03[_0x019d('0x2d')]);_0x317a69[_0x019d('0x30')]=_[_0x019d('0x2f')](_0x1c1e03[_0x019d('0x2c')],qs[_0x019d('0x31')](_0x2c2de7[_0x019d('0x2d')][_0x019d('0x31')]));_0x317a69['attributes']=_0x317a69[_0x019d('0x30')][_0x019d('0x32')]?_0x317a69[_0x019d('0x30')]:_0x1c1e03[_0x019d('0x2c')];if(!_0x2c2de7[_0x019d('0x2d')][_0x019d('0x33')](_0x019d('0x34'))){_0x317a69['limit']=qs['limit'](_0x2c2de7[_0x019d('0x2d')][_0x019d('0x1c')]);_0x317a69[_0x019d('0x1a')]=qs[_0x019d('0x1a')](_0x2c2de7['query'][_0x019d('0x1a')]);}_0x317a69[_0x019d('0x35')]=qs[_0x019d('0x36')](_0x2c2de7[_0x019d('0x2d')]['sort']);_0x317a69['where']=qs[_0x019d('0x37')](_[_0x019d('0x38')](_0x2c2de7[_0x019d('0x2d')],_0x1c1e03['filters']),_0x571d73);if(_0x2c2de7[_0x019d('0x2d')][_0x019d('0x39')]){_0x317a69[_0x019d('0x3a')]=_[_0x019d('0x3b')](_0x317a69[_0x019d('0x3a')],{'$or':_['map'](_0x571d73,function(_0x143ae8){if(_0x143ae8['type']!==_0x019d('0x3c')){var _0x5bb524={};_0x5bb524[_0x143ae8[_0x019d('0x25')]]={'$like':'%'+_0x2c2de7['query'][_0x019d('0x39')]+'%'};return _0x5bb524;}})});}_0x317a69=_['merge']({},_0x317a69,_0x2c2de7[_0x019d('0x3d')]);var _0x56e0c8={'where':_0x317a69['where']};return db['SmsQueueReport'][_0x019d('0x3e')](_0x56e0c8)[_0x019d('0x23')](function(_0x4988d9){_0x5b026e[_0x019d('0x3e')]=_0x4988d9;if(_0x2c2de7['query'][_0x019d('0x3f')]){_0x317a69[_0x019d('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x019d('0x41')](_0x317a69);})[_0x019d('0x23')](function(_0x40d5b3){_0x5b026e[_0x019d('0x42')]=_0x40d5b3;return _0x5b026e;})[_0x019d('0x23')](respondWithFilteredResult(_0x1e19be,_0x317a69))[_0x019d('0x43')](handleError(_0x1e19be,null));};exports[_0x019d('0x44')]=function(_0xa1aad2,_0x4e5855){var _0x295cc7={'raw':!![],'where':{'id':_0xa1aad2[_0x019d('0x45')]['id']}},_0x1381ac={};_0x1381ac[_0x019d('0x2c')]=_[_0x019d('0x2e')](db[_0x019d('0x28')][_0x019d('0x29')]);_0x1381ac[_0x019d('0x2d')]=_['keys'](_0xa1aad2[_0x019d('0x2d')]);_0x1381ac[_0x019d('0x37')]=_[_0x019d('0x2f')](_0x1381ac['model'],_0x1381ac['query']);_0x295cc7[_0x019d('0x30')]=_[_0x019d('0x2f')](_0x1381ac[_0x019d('0x2c')],qs[_0x019d('0x31')](_0xa1aad2[_0x019d('0x2d')][_0x019d('0x31')]));_0x295cc7[_0x019d('0x30')]=_0x295cc7[_0x019d('0x30')]['length']?_0x295cc7[_0x019d('0x30')]:_0x1381ac[_0x019d('0x2c')];if(_0xa1aad2[_0x019d('0x2d')][_0x019d('0x3f')]){_0x295cc7[_0x019d('0x40')]=[{'all':!![]}];}_0x295cc7=_[_0x019d('0x3b')]({},_0x295cc7,_0xa1aad2[_0x019d('0x3d')]);return db['SmsQueueReport'][_0x019d('0x46')](_0x295cc7)[_0x019d('0x23')](handleEntityNotFound(_0x4e5855,null))[_0x019d('0x23')](respondWithResult(_0x4e5855,null))[_0x019d('0x43')](handleError(_0x4e5855,null));};exports['create']=function(_0x50a1ab,_0x6c57c5){return db[_0x019d('0x28')][_0x019d('0x47')](_0x50a1ab['body'],{})[_0x019d('0x23')](respondWithResult(_0x6c57c5,0xc9))[_0x019d('0x43')](handleError(_0x6c57c5,null));};exports[_0x019d('0x22')]=function(_0xe5c865,_0x52dbe3){if(_0xe5c865[_0x019d('0x48')]['id']){delete _0xe5c865[_0x019d('0x48')]['id'];}return db[_0x019d('0x28')][_0x019d('0x46')]({'where':{'id':_0xe5c865[_0x019d('0x45')]['id']}})[_0x019d('0x23')](handleEntityNotFound(_0x52dbe3,null))[_0x019d('0x23')](saveUpdates(_0xe5c865[_0x019d('0x48')],null))['then'](respondWithResult(_0x52dbe3,null))[_0x019d('0x43')](handleError(_0x52dbe3,null));};exports[_0x019d('0x49')]=function(_0xd65191,_0x5ed89b){return db[_0x019d('0x28')][_0x019d('0x46')]({'where':{'id':_0xd65191['params']['id']}})['then'](handleEntityNotFound(_0x5ed89b,null))[_0x019d('0x23')](removeEntity(_0x5ed89b,null))[_0x019d('0x43')](handleError(_0x5ed89b,null));};exports[_0x019d('0x4a')]=function(_0x1a3bbb,_0x13cd82){return db['SmsQueueReport']['describe']()[_0x019d('0x23')](respondWithResult(_0x13cd82,null))[_0x019d('0x43')](handleError(_0x13cd82,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 26aadec..4d10b44 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x496d33,_0x2f8cdc){var _0x518d18=function(_0x205731){while(--_0x205731){_0x496d33['push'](_0x496d33['shift']());}};_0x518d18(++_0x2f8cdc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xcb91[_0x3ad7ad];return _0x225a60;};'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')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'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(_0x3d30d3,_0x279633){var _0x4eb58c=function(_0x1e5b1a){while(--_0x1e5b1a){_0x3d30d3['push'](_0x3d30d3['shift']());}};_0x4eb58c(++_0x279633);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'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 cc895be..d1feec7 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 _0x4acf=['moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsQueueReport','body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','util'];(function(_0x35e969,_0x5b2c1b){var _0x5f8044=function(_0x5e177c){while(--_0x5e177c){_0x35e969['push'](_0x35e969['shift']());}};_0x5f8044(++_0x5b2c1b);}(_0x4acf,0xdf));var _0xf4ac=function(_0x36f2c0,_0x1220b4){_0x36f2c0=_0x36f2c0-0x0;var _0x2725af=_0x4acf[_0x36f2c0];return _0x2725af;};'use strict';var _=require('lodash');var util=require(_0xf4ac('0x0'));var moment=require(_0xf4ac('0x1'));var BPromise=require(_0xf4ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4ac('0x3'));var db=require(_0xf4ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf4ac('0x5'));var config=require('../../config/environment');var jayson=require(_0xf4ac('0x6'));var client=jayson[_0xf4ac('0x7')][_0xf4ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33ccec,_0x4ffc87,_0x478a29){return new BPromise(function(_0x5ac100,_0x4380d3){return client[_0xf4ac('0x9')](_0x33ccec,_0x478a29)['then'](function(_0x230b49){logger['info'](_0xf4ac('0xa'),_0x4ffc87,_0xf4ac('0xb'));logger[_0xf4ac('0xc')](_0xf4ac('0xd'),_0x4ffc87,_0xf4ac('0xb'),JSON[_0xf4ac('0xe')](_0x230b49));if(_0x230b49[_0xf4ac('0xf')]){if(_0x230b49['error'][_0xf4ac('0x10')]===0x1f4){logger['error'](_0xf4ac('0xa'),_0x4ffc87,_0x230b49['error'][_0xf4ac('0x11')]);return _0x4380d3(_0x230b49[_0xf4ac('0xf')][_0xf4ac('0x11')]);}logger[_0xf4ac('0xf')](_0xf4ac('0xa'),_0x4ffc87,_0x230b49['error'][_0xf4ac('0x11')]);return _0x5ac100(_0x230b49['error'][_0xf4ac('0x11')]);}else{logger[_0xf4ac('0x12')](_0xf4ac('0xa'),_0x4ffc87,_0xf4ac('0xb'));_0x5ac100(_0x230b49[_0xf4ac('0x13')][_0xf4ac('0x11')]);}})[_0xf4ac('0x14')](function(_0x39b398){logger[_0xf4ac('0xf')](_0xf4ac('0xa'),_0x4ffc87,_0x39b398);_0x4380d3(_0x39b398);});});}exports['CreateSmsQueueReport']=function(_0x4a44d2){var _0x484d6d=this;return new Promise(function(_0x26d802,_0x583bac){return db[_0xf4ac('0x15')]['create'](_0x4a44d2[_0xf4ac('0x16')],{'raw':_0x4a44d2['options']?_0x4a44d2[_0xf4ac('0x17')][_0xf4ac('0x18')]===undefined?!![]:![]:!![]})[_0xf4ac('0x19')](function(_0x218bb3){logger['info'](_0xf4ac('0x1a'),_0x4a44d2);logger[_0xf4ac('0xc')](_0xf4ac('0x1a'),_0x4a44d2,JSON[_0xf4ac('0xe')](_0x218bb3));_0x26d802(_0x218bb3);})[_0xf4ac('0x14')](function(_0x5ecb98){logger[_0xf4ac('0xf')](_0xf4ac('0x1a'),_0x5ecb98['message'],_0x4a44d2);_0x583bac(_0x484d6d['error'](0x1f4,_0x5ecb98[_0xf4ac('0x11')]));});});};exports[_0xf4ac('0x1b')]=function(_0x77b649){var _0x2173c2=this;return new Promise(function(_0x56da6b,_0x2fd59a){return db['SmsQueueReport'][_0xf4ac('0x1c')](_0x77b649['body'],{'raw':_0x77b649['options']?_0x77b649['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x77b649[_0xf4ac('0x17')]?_0x77b649[_0xf4ac('0x17')][_0xf4ac('0x1d')]||null:null,'attributes':_0x77b649[_0xf4ac('0x17')]?_0x77b649[_0xf4ac('0x17')][_0xf4ac('0x1e')]||null:null,'limit':_0x77b649[_0xf4ac('0x17')]?_0x77b649[_0xf4ac('0x17')][_0xf4ac('0x1f')]||null:null})[_0xf4ac('0x19')](function(_0x2cd3de){logger[_0xf4ac('0x12')](_0xf4ac('0x1b'),_0x77b649);logger[_0xf4ac('0xc')](_0xf4ac('0x1b'),_0x77b649,JSON[_0xf4ac('0xe')](_0x2cd3de));_0x56da6b(_0x2cd3de);})['catch'](function(_0x2e6871){logger[_0xf4ac('0xf')](_0xf4ac('0x1b'),_0x2e6871[_0xf4ac('0x11')],_0x77b649);_0x2fd59a(_0x2173c2[_0xf4ac('0xf')](0x1f4,_0x2e6871[_0xf4ac('0x11')]));});});}; \ No newline at end of file +var _0x6010=['SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','where','attributes','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4dd660,_0x3faa5c){var _0x2314fe=function(_0x4862ea){while(--_0x4862ea){_0x4dd660['push'](_0x4dd660['shift']());}};_0x2314fe(++_0x3faa5c);}(_0x6010,0x190));var _0x0601=function(_0x27acb7,_0x261ad9){_0x27acb7=_0x27acb7-0x0;var _0x2edb13=_0x6010[_0x27acb7];return _0x2edb13;};'use strict';var _=require(_0x0601('0x0'));var util=require(_0x0601('0x1'));var moment=require(_0x0601('0x2'));var BPromise=require('bluebird');var rs=require(_0x0601('0x3'));var fs=require('fs');var Redis=require(_0x0601('0x4'));var db=require(_0x0601('0x5'))['db'];var utils=require(_0x0601('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0601('0x7'));var jayson=require(_0x0601('0x8'));var client=jayson['client'][_0x0601('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100249,_0x1b06f5,_0x226bce){return new BPromise(function(_0x1139a1,_0xccbb75){return client[_0x0601('0xa')](_0x100249,_0x226bce)[_0x0601('0xb')](function(_0x11c2b6){logger[_0x0601('0xc')](_0x0601('0xd'),_0x1b06f5,_0x0601('0xe'));logger[_0x0601('0xf')](_0x0601('0x10'),_0x1b06f5,_0x0601('0xe'),JSON[_0x0601('0x11')](_0x11c2b6));if(_0x11c2b6['error']){if(_0x11c2b6['error'][_0x0601('0x12')]===0x1f4){logger[_0x0601('0x13')](_0x0601('0xd'),_0x1b06f5,_0x11c2b6[_0x0601('0x13')][_0x0601('0x14')]);return _0xccbb75(_0x11c2b6['error'][_0x0601('0x14')]);}logger['error'](_0x0601('0xd'),_0x1b06f5,_0x11c2b6['error'][_0x0601('0x14')]);return _0x1139a1(_0x11c2b6[_0x0601('0x13')][_0x0601('0x14')]);}else{logger[_0x0601('0xc')](_0x0601('0xd'),_0x1b06f5,_0x0601('0xe'));_0x1139a1(_0x11c2b6[_0x0601('0x15')]['message']);}})['catch'](function(_0x4de79c){logger[_0x0601('0x13')](_0x0601('0xd'),_0x1b06f5,_0x4de79c);_0xccbb75(_0x4de79c);});});}exports[_0x0601('0x16')]=function(_0x549b84){var _0x3f9e4f=this;return new Promise(function(_0x4b0e4e,_0x1e1d94){return db[_0x0601('0x17')]['create'](_0x549b84[_0x0601('0x18')],{'raw':_0x549b84[_0x0601('0x19')]?_0x549b84[_0x0601('0x19')][_0x0601('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1607cd){logger[_0x0601('0xc')](_0x0601('0x16'),_0x549b84);logger['debug'](_0x0601('0x16'),_0x549b84,JSON[_0x0601('0x11')](_0x1607cd));_0x4b0e4e(_0x1607cd);})['catch'](function(_0xa54c3e){logger[_0x0601('0x13')](_0x0601('0x16'),_0xa54c3e[_0x0601('0x14')],_0x549b84);_0x1e1d94(_0x3f9e4f[_0x0601('0x13')](0x1f4,_0xa54c3e['message']));});});};exports[_0x0601('0x1b')]=function(_0x46f7e0){var _0x285b4b=this;return new Promise(function(_0xfd0590,_0xead25a){return db[_0x0601('0x17')][_0x0601('0x1c')](_0x46f7e0['body'],{'raw':_0x46f7e0[_0x0601('0x19')]?_0x46f7e0[_0x0601('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46f7e0[_0x0601('0x19')]?_0x46f7e0[_0x0601('0x19')][_0x0601('0x1d')]||null:null,'attributes':_0x46f7e0[_0x0601('0x19')]?_0x46f7e0[_0x0601('0x19')][_0x0601('0x1e')]||null:null,'limit':_0x46f7e0[_0x0601('0x19')]?_0x46f7e0[_0x0601('0x19')]['limit']||null:null})[_0x0601('0xb')](function(_0xc9a9b8){logger[_0x0601('0xc')](_0x0601('0x1b'),_0x46f7e0);logger[_0x0601('0xf')](_0x0601('0x1b'),_0x46f7e0,JSON['stringify'](_0xc9a9b8));_0xfd0590(_0xc9a9b8);})[_0x0601('0x1f')](function(_0x1caee2){logger['error'](_0x0601('0x1b'),_0x1caee2['message'],_0x46f7e0);_0xead25a(_0x285b4b['error'](0x1f4,_0x1caee2[_0x0601('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1de31a0..67ca458 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 _0x8ce1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5b13f3,_0x355657){var _0x36e13b=function(_0x363473){while(--_0x363473){_0x5b13f3['push'](_0x5b13f3['shift']());}};_0x36e13b(++_0x355657);}(_0x8ce1,0x183));var _0x18ce=function(_0xc6a87f,_0x2e0c27){_0xc6a87f=_0xc6a87f-0x0;var _0x7a3290=_0x8ce1[_0xc6a87f];return _0x7a3290;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0xb')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller['show']);router[_0x18ce('0x11')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);module['exports']=router; \ No newline at end of file +var _0x57d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x57d4,0x78));var _0x457d=function(_0x25ac8a,_0x15a9c9){_0x25ac8a=_0x25ac8a-0x0;var _0x153021=_0x57d4[_0x25ac8a];return _0x153021;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),auth[_0x457d('0xb')](),controller['describe']);router['get'](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x457d('0x10')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x11')]);router[_0x457d('0x12')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x13')]);module[_0x457d('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 976edd5..3d502a9 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(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x40d282,_0x271587){_0x40d282=_0x40d282-0x0;var _0x3f63c5=_0x9bde[_0x40d282];return _0x3f63c5;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2b86e3,_0x2c3234){_0x2b86e3=_0x2b86e3-0x0;var _0xaab232=_0xb43b[_0x2b86e3];return _0xaab232;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 129d466..43a1400 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 _0x1265=['fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','describe','eml-format','rimraf'];(function(_0xf87c0f,_0x2e543b){var _0x238cef=function(_0x525e92){while(--_0x525e92){_0xf87c0f['push'](_0xf87c0f['shift']());}};_0x238cef(++_0x2e543b);}(_0x1265,0x1cc));var _0x5126=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1265[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x5126('0x0'));var rimraf=require(_0x5126('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5126('0x2'));var rp=require(_0x5126('0x3'));var moment=require(_0x5126('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5126('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5126('0x6'));var csv=require(_0x5126('0x7'));var ejs=require(_0x5126('0x8'));var fs=require('fs');var fs_extra=require(_0x5126('0x9'));var _=require(_0x5126('0xa'));var squel=require(_0x5126('0xb'));var crypto=require(_0x5126('0xc'));var jsforce=require(_0x5126('0xd'));var deskjs=require(_0x5126('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5126('0xf'));var Papa=require('papaparse');var Redis=require(_0x5126('0x10'));var authService=require(_0x5126('0x11'));var qs=require(_0x5126('0x12'));var as=require(_0x5126('0x13'));var hardwareService=require(_0x5126('0x14'));var logger=require('../../config/logger')(_0x5126('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5126('0x16'));var db=require(_0x5126('0x17'))['db'];function respondWithStatusCode(_0x18b67b,_0x57c3d8){_0x57c3d8=_0x57c3d8||0xcc;return function(_0x1c58d6){if(_0x1c58d6){return _0x18b67b[_0x5126('0x18')](_0x57c3d8);}return _0x18b67b[_0x5126('0x19')](_0x57c3d8)[_0x5126('0x1a')]();};}function respondWithResult(_0x1a2153,_0x166962){_0x166962=_0x166962||0xc8;return function(_0x1d35be){if(_0x1d35be){return _0x1a2153[_0x5126('0x19')](_0x166962)[_0x5126('0x1b')](_0x1d35be);}};}function respondWithFilteredResult(_0x11d0ba,_0x3676e8){return function(_0x1c3bee){if(_0x1c3bee){var _0x4e7aa5=typeof _0x3676e8[_0x5126('0x1c')]===_0x5126('0x1d')&&typeof _0x3676e8[_0x5126('0x1e')]===_0x5126('0x1d');var _0x98f3ee=_0x1c3bee[_0x5126('0x1f')];var _0x38f184=_0x4e7aa5?0x0:_0x3676e8['offset'];var _0x5a3273=_0x4e7aa5?_0x1c3bee[_0x5126('0x1f')]:_0x3676e8[_0x5126('0x1c')]+_0x3676e8[_0x5126('0x1e')];var _0x106bc2;if(_0x5a3273>=_0x98f3ee){_0x5a3273=_0x98f3ee;_0x106bc2=0xc8;}else{_0x106bc2=0xce;}_0x11d0ba[_0x5126('0x19')](_0x106bc2);return _0x11d0ba[_0x5126('0x20')](_0x5126('0x21'),_0x38f184+'-'+_0x5a3273+'/'+_0x98f3ee)[_0x5126('0x1b')](_0x1c3bee);}return null;};}function patchUpdates(_0x209256){return function(_0x4fa3b1){try{jsonpatch[_0x5126('0x22')](_0x4fa3b1,_0x209256,!![]);}catch(_0x16da46){return BPromise[_0x5126('0x23')](_0x16da46);}return _0x4fa3b1[_0x5126('0x24')]();};}function saveUpdates(_0x3ff9c0,_0x504d69){return function(_0x247094){if(_0x247094){return _0x247094[_0x5126('0x25')](_0x3ff9c0)[_0x5126('0x26')](function(_0x52b3cd){return _0x52b3cd;});}return null;};}function removeEntity(_0x5ad258,_0x399e67){return function(_0x5f2896){if(_0x5f2896){return _0x5f2896[_0x5126('0x27')]()[_0x5126('0x26')](function(){_0x5ad258[_0x5126('0x19')](0xcc)[_0x5126('0x1a')]();});}};}function handleEntityNotFound(_0x1f1d26,_0x208d59){return function(_0x123572){if(!_0x123572){_0x1f1d26[_0x5126('0x18')](0x194);}return _0x123572;};}function handleError(_0x20714d,_0x1919f0){_0x1919f0=_0x1919f0||0x1f4;return function(_0x421f42){logger['error'](_0x421f42[_0x5126('0x28')]);if(_0x421f42[_0x5126('0x29')]){delete _0x421f42[_0x5126('0x29')];}_0x20714d[_0x5126('0x19')](_0x1919f0)[_0x5126('0x2a')](_0x421f42);};}exports[_0x5126('0x2b')]=function(_0x3c4452,_0xba664b){var _0x125ef1={},_0xc0099d={},_0x50a88e={'count':0x0,'rows':[]};var _0x4f7bd3=_[_0x5126('0x2c')](db[_0x5126('0x2d')][_0x5126('0x2e')],function(_0x28d53a){return{'name':_0x28d53a[_0x5126('0x2f')],'type':_0x28d53a[_0x5126('0x30')][_0x5126('0x31')]};});_0xc0099d[_0x5126('0x32')]=_[_0x5126('0x2c')](_0x4f7bd3,_0x5126('0x29'));_0xc0099d['query']=_[_0x5126('0x33')](_0x3c4452[_0x5126('0x34')]);_0xc0099d[_0x5126('0x35')]=_['intersection'](_0xc0099d[_0x5126('0x32')],_0xc0099d[_0x5126('0x34')]);_0x125ef1[_0x5126('0x36')]=_['intersection'](_0xc0099d[_0x5126('0x32')],qs[_0x5126('0x37')](_0x3c4452['query']['fields']));_0x125ef1[_0x5126('0x36')]=_0x125ef1['attributes'][_0x5126('0x38')]?_0x125ef1[_0x5126('0x36')]:_0xc0099d[_0x5126('0x32')];if(!_0x3c4452[_0x5126('0x34')]['hasOwnProperty']('nolimit')){_0x125ef1[_0x5126('0x1e')]=qs[_0x5126('0x1e')](_0x3c4452[_0x5126('0x34')][_0x5126('0x1e')]);_0x125ef1[_0x5126('0x1c')]=qs[_0x5126('0x1c')](_0x3c4452['query']['offset']);}_0x125ef1[_0x5126('0x39')]=qs[_0x5126('0x3a')](_0x3c4452['query'][_0x5126('0x3a')]);_0x125ef1[_0x5126('0x3b')]=qs[_0x5126('0x35')](_[_0x5126('0x3c')](_0x3c4452[_0x5126('0x34')],_0xc0099d[_0x5126('0x35')]),_0x4f7bd3);if(_0x3c4452[_0x5126('0x34')][_0x5126('0x3d')]){_0x125ef1[_0x5126('0x3b')]=_[_0x5126('0x3e')](_0x125ef1[_0x5126('0x3b')],{'$or':_['map'](_0x4f7bd3,function(_0x205abc){if(_0x205abc['type']!==_0x5126('0x3f')){var _0x1d6836={};_0x1d6836[_0x205abc[_0x5126('0x29')]]={'$like':'%'+_0x3c4452['query']['filter']+'%'};return _0x1d6836;}})});}_0x125ef1=_[_0x5126('0x3e')]({},_0x125ef1,_0x3c4452[_0x5126('0x40')]);var _0x4fb5f5={'where':_0x125ef1[_0x5126('0x3b')]};return db[_0x5126('0x2d')]['count'](_0x4fb5f5)['then'](function(_0xf58749){_0x50a88e[_0x5126('0x1f')]=_0xf58749;if(_0x3c4452[_0x5126('0x34')]['includeAll']){_0x125ef1['include']=[{'all':!![]}];}return db[_0x5126('0x2d')][_0x5126('0x41')](_0x125ef1);})['then'](function(_0x344df1){_0x50a88e[_0x5126('0x42')]=_0x344df1;return _0x50a88e;})[_0x5126('0x26')](respondWithFilteredResult(_0xba664b,_0x125ef1))[_0x5126('0x43')](handleError(_0xba664b,null));};exports[_0x5126('0x44')]=function(_0x30c728,_0x418fbb){var _0x1e0716={'raw':!![],'where':{'id':_0x30c728[_0x5126('0x45')]['id']}},_0x13df3f={};_0x13df3f['model']=_[_0x5126('0x33')](db[_0x5126('0x2d')]['rawAttributes']);_0x13df3f[_0x5126('0x34')]=_[_0x5126('0x33')](_0x30c728[_0x5126('0x34')]);_0x13df3f[_0x5126('0x35')]=_[_0x5126('0x46')](_0x13df3f[_0x5126('0x32')],_0x13df3f[_0x5126('0x34')]);_0x1e0716[_0x5126('0x36')]=_[_0x5126('0x46')](_0x13df3f[_0x5126('0x32')],qs[_0x5126('0x37')](_0x30c728['query'][_0x5126('0x37')]));_0x1e0716[_0x5126('0x36')]=_0x1e0716[_0x5126('0x36')]['length']?_0x1e0716[_0x5126('0x36')]:_0x13df3f['model'];if(_0x30c728[_0x5126('0x34')][_0x5126('0x47')]){_0x1e0716[_0x5126('0x48')]=[{'all':!![]}];}_0x1e0716=_[_0x5126('0x3e')]({},_0x1e0716,_0x30c728[_0x5126('0x40')]);return db[_0x5126('0x2d')][_0x5126('0x49')](_0x1e0716)[_0x5126('0x26')](handleEntityNotFound(_0x418fbb,null))[_0x5126('0x26')](respondWithResult(_0x418fbb,null))['catch'](handleError(_0x418fbb,null));};exports['create']=function(_0x2130ff,_0x3d0244){return db['SmsTransferReport'][_0x5126('0x4a')](_0x2130ff[_0x5126('0x4b')],{})[_0x5126('0x26')](respondWithResult(_0x3d0244,0xc9))[_0x5126('0x43')](handleError(_0x3d0244,null));};exports[_0x5126('0x25')]=function(_0x31d3e3,_0x4171aa){if(_0x31d3e3[_0x5126('0x4b')]['id']){delete _0x31d3e3[_0x5126('0x4b')]['id'];}return db['SmsTransferReport'][_0x5126('0x49')]({'where':{'id':_0x31d3e3[_0x5126('0x45')]['id']}})[_0x5126('0x26')](handleEntityNotFound(_0x4171aa,null))[_0x5126('0x26')](saveUpdates(_0x31d3e3['body'],null))[_0x5126('0x26')](respondWithResult(_0x4171aa,null))[_0x5126('0x43')](handleError(_0x4171aa,null));};exports[_0x5126('0x27')]=function(_0xef6595,_0x1b09c2){return db[_0x5126('0x2d')][_0x5126('0x49')]({'where':{'id':_0xef6595[_0x5126('0x45')]['id']}})[_0x5126('0x26')](handleEntityNotFound(_0x1b09c2,null))[_0x5126('0x26')](removeEntity(_0x1b09c2,null))[_0x5126('0x43')](handleError(_0x1b09c2,null));};exports[_0x5126('0x4c')]=function(_0x5e40f4,_0x418734){return db[_0x5126('0x2d')][_0x5126('0x4c')]()['then'](respondWithResult(_0x418734,null))[_0x5126('0x43')](handleError(_0x418734,null));}; \ No newline at end of file +var _0xf65e=['order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','show','params','keys','length','include','options','find','create','body','update','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','end','stack','name','send','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xf65e,0xf5));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef65('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef65('0x1'));var rp=require('request-promise');var moment=require(_0xef65('0x2'));var BPromise=require(_0xef65('0x3'));var Mustache=require(_0xef65('0x4'));var util=require('util');var path=require(_0xef65('0x5'));var sox=require(_0xef65('0x6'));var csv=require(_0xef65('0x7'));var ejs=require(_0xef65('0x8'));var fs=require('fs');var fs_extra=require(_0xef65('0x9'));var _=require('lodash');var squel=require(_0xef65('0xa'));var crypto=require(_0xef65('0xb'));var jsforce=require(_0xef65('0xc'));var deskjs=require(_0xef65('0xd'));var toCsv=require(_0xef65('0x7'));var querystring=require(_0xef65('0xe'));var Papa=require('papaparse');var Redis=require(_0xef65('0xf'));var authService=require(_0xef65('0x10'));var qs=require(_0xef65('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef65('0x12'))(_0xef65('0x13'));var utils=require(_0xef65('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xef65('0x15'));var db=require(_0xef65('0x16'))['db'];function respondWithStatusCode(_0x1f024a,_0x2b03d5){_0x2b03d5=_0x2b03d5||0xcc;return function(_0xcec125){if(_0xcec125){return _0x1f024a[_0xef65('0x17')](_0x2b03d5);}return _0x1f024a[_0xef65('0x18')](_0x2b03d5)['end']();};}function respondWithResult(_0xe66cc7,_0xfa9aed){_0xfa9aed=_0xfa9aed||0xc8;return function(_0x3d4f9f){if(_0x3d4f9f){return _0xe66cc7[_0xef65('0x18')](_0xfa9aed)[_0xef65('0x19')](_0x3d4f9f);}};}function respondWithFilteredResult(_0x329be5,_0x30a7ba){return function(_0x435fdd){if(_0x435fdd){var _0x40af25=typeof _0x30a7ba['offset']===_0xef65('0x1a')&&typeof _0x30a7ba[_0xef65('0x1b')]===_0xef65('0x1a');var _0x524e84=_0x435fdd[_0xef65('0x1c')];var _0x51c214=_0x40af25?0x0:_0x30a7ba[_0xef65('0x1d')];var _0x4d0bdb=_0x40af25?_0x435fdd[_0xef65('0x1c')]:_0x30a7ba[_0xef65('0x1d')]+_0x30a7ba['limit'];var _0x1bf02f;if(_0x4d0bdb>=_0x524e84){_0x4d0bdb=_0x524e84;_0x1bf02f=0xc8;}else{_0x1bf02f=0xce;}_0x329be5[_0xef65('0x18')](_0x1bf02f);return _0x329be5[_0xef65('0x1e')](_0xef65('0x1f'),_0x51c214+'-'+_0x4d0bdb+'/'+_0x524e84)[_0xef65('0x19')](_0x435fdd);}return null;};}function patchUpdates(_0x8a036f){return function(_0xbaa2ab){try{jsonpatch[_0xef65('0x20')](_0xbaa2ab,_0x8a036f,!![]);}catch(_0x284ee7){return BPromise[_0xef65('0x21')](_0x284ee7);}return _0xbaa2ab[_0xef65('0x22')]();};}function saveUpdates(_0x5b649f,_0x5e36f9){return function(_0x1a7e9e){if(_0x1a7e9e){return _0x1a7e9e['update'](_0x5b649f)[_0xef65('0x23')](function(_0x3cb193){return _0x3cb193;});}return null;};}function removeEntity(_0x298291,_0x5c7034){return function(_0x37fcac){if(_0x37fcac){return _0x37fcac['destroy']()['then'](function(){_0x298291[_0xef65('0x18')](0xcc)[_0xef65('0x24')]();});}};}function handleEntityNotFound(_0x4b86a3,_0x3df44d){return function(_0x230094){if(!_0x230094){_0x4b86a3[_0xef65('0x17')](0x194);}return _0x230094;};}function handleError(_0x29f001,_0x50094f){_0x50094f=_0x50094f||0x1f4;return function(_0x503ec9){logger['error'](_0x503ec9[_0xef65('0x25')]);if(_0x503ec9[_0xef65('0x26')]){delete _0x503ec9[_0xef65('0x26')];}_0x29f001[_0xef65('0x18')](_0x50094f)[_0xef65('0x27')](_0x503ec9);};}exports['index']=function(_0x22c300,_0x3f7183){var _0x328150={},_0x401970={},_0x3c3ed4={'count':0x0,'rows':[]};var _0x44a053=_['map'](db[_0xef65('0x28')][_0xef65('0x29')],function(_0x3858af){return{'name':_0x3858af[_0xef65('0x2a')],'type':_0x3858af[_0xef65('0x2b')][_0xef65('0x2c')]};});_0x401970[_0xef65('0x2d')]=_[_0xef65('0x2e')](_0x44a053,_0xef65('0x26'));_0x401970[_0xef65('0x2f')]=_['keys'](_0x22c300[_0xef65('0x2f')]);_0x401970['filters']=_[_0xef65('0x30')](_0x401970[_0xef65('0x2d')],_0x401970[_0xef65('0x2f')]);_0x328150[_0xef65('0x31')]=_['intersection'](_0x401970[_0xef65('0x2d')],qs[_0xef65('0x32')](_0x22c300['query'][_0xef65('0x32')]));_0x328150['attributes']=_0x328150[_0xef65('0x31')]['length']?_0x328150[_0xef65('0x31')]:_0x401970['model'];if(!_0x22c300[_0xef65('0x2f')]['hasOwnProperty']('nolimit')){_0x328150[_0xef65('0x1b')]=qs[_0xef65('0x1b')](_0x22c300[_0xef65('0x2f')][_0xef65('0x1b')]);_0x328150[_0xef65('0x1d')]=qs[_0xef65('0x1d')](_0x22c300[_0xef65('0x2f')][_0xef65('0x1d')]);}_0x328150[_0xef65('0x33')]=qs[_0xef65('0x34')](_0x22c300['query'][_0xef65('0x34')]);_0x328150[_0xef65('0x35')]=qs[_0xef65('0x36')](_[_0xef65('0x37')](_0x22c300['query'],_0x401970[_0xef65('0x36')]),_0x44a053);if(_0x22c300[_0xef65('0x2f')][_0xef65('0x38')]){_0x328150[_0xef65('0x35')]=_['merge'](_0x328150[_0xef65('0x35')],{'$or':_['map'](_0x44a053,function(_0xd892f1){if(_0xd892f1[_0xef65('0x2b')]!==_0xef65('0x39')){var _0x46f829={};_0x46f829[_0xd892f1[_0xef65('0x26')]]={'$like':'%'+_0x22c300[_0xef65('0x2f')][_0xef65('0x38')]+'%'};return _0x46f829;}})});}_0x328150=_[_0xef65('0x3a')]({},_0x328150,_0x22c300['options']);var _0x3ec497={'where':_0x328150[_0xef65('0x35')]};return db[_0xef65('0x28')][_0xef65('0x1c')](_0x3ec497)['then'](function(_0x4e7743){_0x3c3ed4['count']=_0x4e7743;if(_0x22c300[_0xef65('0x2f')][_0xef65('0x3b')]){_0x328150['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xef65('0x3c')](_0x328150);})[_0xef65('0x23')](function(_0x1f8f2b){_0x3c3ed4['rows']=_0x1f8f2b;return _0x3c3ed4;})[_0xef65('0x23')](respondWithFilteredResult(_0x3f7183,_0x328150))[_0xef65('0x3d')](handleError(_0x3f7183,null));};exports[_0xef65('0x3e')]=function(_0x23a25f,_0x44471d){var _0x14c594={'raw':!![],'where':{'id':_0x23a25f[_0xef65('0x3f')]['id']}},_0x2b0968={};_0x2b0968[_0xef65('0x2d')]=_['keys'](db[_0xef65('0x28')][_0xef65('0x29')]);_0x2b0968['query']=_[_0xef65('0x40')](_0x23a25f[_0xef65('0x2f')]);_0x2b0968['filters']=_[_0xef65('0x30')](_0x2b0968[_0xef65('0x2d')],_0x2b0968[_0xef65('0x2f')]);_0x14c594['attributes']=_[_0xef65('0x30')](_0x2b0968[_0xef65('0x2d')],qs[_0xef65('0x32')](_0x23a25f[_0xef65('0x2f')][_0xef65('0x32')]));_0x14c594[_0xef65('0x31')]=_0x14c594[_0xef65('0x31')][_0xef65('0x41')]?_0x14c594['attributes']:_0x2b0968[_0xef65('0x2d')];if(_0x23a25f[_0xef65('0x2f')][_0xef65('0x3b')]){_0x14c594[_0xef65('0x42')]=[{'all':!![]}];}_0x14c594=_[_0xef65('0x3a')]({},_0x14c594,_0x23a25f[_0xef65('0x43')]);return db[_0xef65('0x28')][_0xef65('0x44')](_0x14c594)[_0xef65('0x23')](handleEntityNotFound(_0x44471d,null))['then'](respondWithResult(_0x44471d,null))[_0xef65('0x3d')](handleError(_0x44471d,null));};exports[_0xef65('0x45')]=function(_0x1c9f89,_0x47d45e){return db['SmsTransferReport'][_0xef65('0x45')](_0x1c9f89[_0xef65('0x46')],{})[_0xef65('0x23')](respondWithResult(_0x47d45e,0xc9))['catch'](handleError(_0x47d45e,null));};exports[_0xef65('0x47')]=function(_0x29bd5a,_0x3fe315){if(_0x29bd5a[_0xef65('0x46')]['id']){delete _0x29bd5a['body']['id'];}return db[_0xef65('0x28')][_0xef65('0x44')]({'where':{'id':_0x29bd5a[_0xef65('0x3f')]['id']}})[_0xef65('0x23')](handleEntityNotFound(_0x3fe315,null))[_0xef65('0x23')](saveUpdates(_0x29bd5a['body'],null))[_0xef65('0x23')](respondWithResult(_0x3fe315,null))[_0xef65('0x3d')](handleError(_0x3fe315,null));};exports[_0xef65('0x48')]=function(_0x21a4aa,_0x248502){return db['SmsTransferReport'][_0xef65('0x44')]({'where':{'id':_0x21a4aa[_0xef65('0x3f')]['id']}})[_0xef65('0x23')](handleEntityNotFound(_0x248502,null))[_0xef65('0x23')](removeEntity(_0x248502,null))[_0xef65('0x3d')](handleError(_0x248502,null));};exports[_0xef65('0x49')]=function(_0x5a93a0,_0x18be10){return db['SmsTransferReport'][_0xef65('0x49')]()['then'](respondWithResult(_0x18be10,null))[_0xef65('0x3d')](handleError(_0x18be10,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2f1da89..48bb3c1 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 _0x8d6f=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x216a8d,_0x5473bb){var _0xb21f7b=function(_0x3cf6e9){while(--_0x3cf6e9){_0x216a8d['push'](_0x216a8d['shift']());}};_0xb21f7b(++_0x5473bb);}(_0x8d6f,0x1bb));var _0xf8d6=function(_0x1983d0,_0x33d6a6){_0x1983d0=_0x1983d0-0x0;var _0x5056a0=_0x8d6f[_0x1983d0];return _0x5056a0;};'use strict';var _=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var logger=require(_0xf8d6('0x2'))(_0xf8d6('0x3'));var moment=require(_0xf8d6('0x4'));var BPromise=require(_0xf8d6('0x5'));var rp=require(_0xf8d6('0x6'));var fs=require('fs');var path=require(_0xf8d6('0x7'));var rimraf=require(_0xf8d6('0x8'));var config=require(_0xf8d6('0x9'));var attributes=require(_0xf8d6('0xa'));module[_0xf8d6('0xb')]=function(_0x54da05,_0x4b55fa){return _0x54da05[_0xf8d6('0xc')]('SmsTransferReport',attributes,{'tableName':_0xf8d6('0xd'),'paranoid':![],'indexes':[{'name':_0xf8d6('0xe'),'fields':[_0xf8d6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7dbc=['path','rimraf','../../config/environment','./smsTransferReport.attributes','define','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7dbc,0xe2));var _0xc7db=function(_0x551475,_0x160cfb){_0x551475=_0x551475-0x0;var _0x392b48=_0x7dbc[_0x551475];return _0x392b48;};'use strict';var _=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var logger=require('../../config/logger')(_0xc7db('0x2'));var moment=require(_0xc7db('0x3'));var BPromise=require(_0xc7db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7db('0x5'));var rimraf=require(_0xc7db('0x6'));var config=require(_0xc7db('0x7'));var attributes=require(_0xc7db('0x8'));module['exports']=function(_0x4ee443,_0x1aef6b){return _0x4ee443[_0xc7db('0x9')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc7db('0xa'),'fields':[_0xc7db('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 f783cbe..bc8cf77 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 _0x7c1f=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x7c1f,0x194));var _0xf7c1=function(_0x4a5c80,_0x4e4439){_0x4a5c80=_0x4a5c80-0x0;var _0x5a41e6=_0x7c1f[_0x4a5c80];return _0x5a41e6;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require(_0xf7c1('0x3'));var rs=require(_0xf7c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7c1('0x5'))['db'];var utils=require(_0xf7c1('0x6'));var logger=require(_0xf7c1('0x7'))('rpc');var config=require(_0xf7c1('0x8'));var jayson=require(_0xf7c1('0x9'));var client=jayson[_0xf7c1('0xa')][_0xf7c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5423bf,_0x1ad808,_0x1a342b){return new BPromise(function(_0x329050,_0x418f9a){return client[_0xf7c1('0xc')](_0x5423bf,_0x1a342b)[_0xf7c1('0xd')](function(_0x4279ea){logger[_0xf7c1('0xe')](_0xf7c1('0xf'),_0x1ad808,_0xf7c1('0x10'));logger[_0xf7c1('0x11')](_0xf7c1('0x12'),_0x1ad808,'request\x20sent',JSON[_0xf7c1('0x13')](_0x4279ea));if(_0x4279ea[_0xf7c1('0x14')]){if(_0x4279ea[_0xf7c1('0x14')][_0xf7c1('0x15')]===0x1f4){logger[_0xf7c1('0x14')](_0xf7c1('0xf'),_0x1ad808,_0x4279ea['error']['message']);return _0x418f9a(_0x4279ea[_0xf7c1('0x14')]['message']);}logger[_0xf7c1('0x14')](_0xf7c1('0xf'),_0x1ad808,_0x4279ea['error'][_0xf7c1('0x16')]);return _0x329050(_0x4279ea['error'][_0xf7c1('0x16')]);}else{logger[_0xf7c1('0xe')](_0xf7c1('0xf'),_0x1ad808,_0xf7c1('0x10'));_0x329050(_0x4279ea[_0xf7c1('0x17')]['message']);}})[_0xf7c1('0x18')](function(_0x5b5786){logger[_0xf7c1('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x1ad808,_0x5b5786);_0x418f9a(_0x5b5786);});});} \ No newline at end of file +var _0x5455=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x698909,_0x24bb44){var _0x2a2e14=function(_0x5c6df1){while(--_0x5c6df1){_0x698909['push'](_0x698909['shift']());}};_0x2a2e14(++_0x24bb44);}(_0x5455,0x197));var _0x5545=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5455[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var moment=require(_0x5545('0x1'));var BPromise=require(_0x5545('0x2'));var rs=require(_0x5545('0x3'));var fs=require('fs');var Redis=require(_0x5545('0x4'));var db=require(_0x5545('0x5'))['db'];var utils=require(_0x5545('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5545('0x7'));var jayson=require(_0x5545('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea57f,_0x5d69d3,_0x5c2476){return new BPromise(function(_0x9cbb0d,_0x36f3b9){return client['request'](_0x2ea57f,_0x5c2476)[_0x5545('0x9')](function(_0xbf37f){logger[_0x5545('0xa')](_0x5545('0xb'),_0x5d69d3,_0x5545('0xc'));logger[_0x5545('0xd')](_0x5545('0xe'),_0x5d69d3,_0x5545('0xc'),JSON[_0x5545('0xf')](_0xbf37f));if(_0xbf37f['error']){if(_0xbf37f['error'][_0x5545('0x10')]===0x1f4){logger[_0x5545('0x11')](_0x5545('0xb'),_0x5d69d3,_0xbf37f[_0x5545('0x11')]['message']);return _0x36f3b9(_0xbf37f[_0x5545('0x11')][_0x5545('0x12')]);}logger['error'](_0x5545('0xb'),_0x5d69d3,_0xbf37f[_0x5545('0x11')][_0x5545('0x12')]);return _0x9cbb0d(_0xbf37f[_0x5545('0x11')]['message']);}else{logger[_0x5545('0xa')](_0x5545('0xb'),_0x5d69d3,_0x5545('0xc'));_0x9cbb0d(_0xbf37f[_0x5545('0x13')][_0x5545('0x12')]);}})[_0x5545('0x14')](function(_0xf9256c){logger[_0x5545('0x11')](_0x5545('0xb'),_0x5d69d3,_0xf9256c);_0x36f3b9(_0xf9256c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0124a0b..ca7d4b3 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 _0x8542=['delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','file','create','put','/:id','update'];(function(_0x11d830,_0x116d43){var _0x4868e7=function(_0x2eaa4a){while(--_0x2eaa4a){_0x11d830['push'](_0x11d830['shift']());}};_0x4868e7(++_0x116d43);}(_0x8542,0x1a6));var _0x2854=function(_0x2dca91,_0x310677){_0x2dca91=_0x2dca91-0x0;var _0x454b6e=_0x8542[_0x2dca91];return _0x454b6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2854('0x0'));var timeout=require(_0x2854('0x1'));var express=require(_0x2854('0x2'));var router=express[_0x2854('0x3')]();var fs_extra=require(_0x2854('0x4'));var auth=require(_0x2854('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2854('0x6'));var controller=require(_0x2854('0x7'));router[_0x2854('0x8')]('/',auth[_0x2854('0x9')](),controller['index']);router[_0x2854('0x8')]('/:id',auth[_0x2854('0x9')](),controller[_0x2854('0xa')]);router[_0x2854('0x8')](_0x2854('0xb'),auth['isAuthenticated'](),controller[_0x2854('0xc')]);var upload=multer({'storage':multer[_0x2854('0xd')]({'destination':function(_0x14a839,_0x30c5bd,_0x5376a3){_0x5376a3(null,path[_0x2854('0xe')](config['root'],_0x2854('0xf')));},'filename':function(_0x1b9f8a,_0x2a504f,_0x5365b1){_0x2a504f[_0x2854('0x10')]=_0x2a504f[_0x2854('0x10')][_0x2854('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5365b1(null,util['format'](_0x2854('0x12'),path[_0x2854('0x13')](_0x2a504f[_0x2854('0x10')],path[_0x2854('0x14')](_0x2a504f[_0x2854('0x10')])),Date[_0x2854('0x15')](),path['extname'](_0x2a504f[_0x2854('0x10')])));}})});router[_0x2854('0x16')]('/',upload['single'](_0x2854('0x17')),controller[_0x2854('0x18')]);router[_0x2854('0x19')](_0x2854('0x1a'),auth[_0x2854('0x9')](),controller[_0x2854('0x1b')]);router[_0x2854('0x1c')]('/:id',auth[_0x2854('0x9')](),controller[_0x2854('0x1c')]);module[_0x2854('0x1d')]=router; \ No newline at end of file +var _0x73ed=['replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','isAuthenticated','index','get','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname'];(function(_0x6c5964,_0x5c9039){var _0x5338d9=function(_0x5a3d95){while(--_0x5a3d95){_0x6c5964['push'](_0x6c5964['shift']());}};_0x5338d9(++_0x5c9039);}(_0x73ed,0x86));var _0xd73e=function(_0x28e327,_0x53f2cb){_0x28e327=_0x28e327-0x0;var _0x58a4bf=_0x73ed[_0x28e327];return _0x58a4bf;};'use strict';var multer=require('multer');var util=require(_0xd73e('0x0'));var path=require('path');var timeout=require(_0xd73e('0x1'));var express=require('express');var router=express[_0xd73e('0x2')]();var fs_extra=require(_0xd73e('0x3'));var auth=require(_0xd73e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd73e('0x5'));var controller=require(_0xd73e('0x6'));router['get']('/',auth[_0xd73e('0x7')](),controller[_0xd73e('0x8')]);router[_0xd73e('0x9')]('/:id',auth[_0xd73e('0x7')](),controller[_0xd73e('0xa')]);router['get'](_0xd73e('0xb'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xd73e('0xc')]({'destination':function(_0xfc673d,_0x3e9ca9,_0x4c1b71){_0x4c1b71(null,path[_0xd73e('0xd')](config['root'],_0xd73e('0xe')));},'filename':function(_0x388a03,_0xd8e277,_0x11ddf6){_0xd8e277[_0xd73e('0xf')]=_0xd8e277[_0xd73e('0xf')][_0xd73e('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11ddf6(null,util[_0xd73e('0x11')](_0xd73e('0x12'),path[_0xd73e('0x13')](_0xd8e277['originalname'],path[_0xd73e('0x14')](_0xd8e277['originalname'])),Date[_0xd73e('0x15')](),path[_0xd73e('0x14')](_0xd8e277[_0xd73e('0xf')])));}})});router[_0xd73e('0x16')]('/',upload[_0xd73e('0x17')](_0xd73e('0x18')),controller[_0xd73e('0x19')]);router[_0xd73e('0x1a')](_0xd73e('0x1b'),auth['isAuthenticated'](),controller['update']);router[_0xd73e('0x1c')]('/:id',auth[_0xd73e('0x7')](),controller[_0xd73e('0x1c')]);module[_0xd73e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 05b1b22..84f673a 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 _0x143c=['INTEGER','exports','name','STRING','FLOAT','BIGINT'];(function(_0x2630b6,_0x3b8f6f){var _0x461efd=function(_0x24cced){while(--_0x24cced){_0x2630b6['push'](_0x2630b6['shift']());}};_0x461efd(++_0x3b8f6f);}(_0x143c,0x6d));var _0xc143=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x143c[_0x4b2b03];return _0x1bf0ed;};'use strict';var Sequelize=require('sequelize');module[_0xc143('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc143('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc143('0x2')]},'display_name':{'type':Sequelize[_0xc143('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xc143('0x2')]},'original_duration':{'type':Sequelize[_0xc143('0x3')]},'original_sampleCount':{'type':Sequelize[_0xc143('0x4')]},'original_channelCount':{'type':Sequelize[_0xc143('0x5')]},'original_bitRate':{'type':Sequelize[_0xc143('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc143('0x5')]},'converted_format':{'type':Sequelize[_0xc143('0x2')]},'converted_duration':{'type':Sequelize[_0xc143('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc143('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xc143('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9b07=['BIGINT','INTEGER','sequelize','STRING','FLOAT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9b07,0xa2));var _0x79b0=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9b07[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x79b0('0x0'));module['exports']={'name':{'type':Sequelize[_0x79b0('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x79b0('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x79b0('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x79b0('0x2')]},'original_sampleCount':{'type':Sequelize[_0x79b0('0x3')]},'original_channelCount':{'type':Sequelize[_0x79b0('0x4')]},'original_bitRate':{'type':Sequelize[_0x79b0('0x3')]},'original_sampleRate':{'type':Sequelize[_0x79b0('0x4')]},'converted_format':{'type':Sequelize[_0x79b0('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x79b0('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x79b0('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x79b0('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6e2c01c..b5e1608 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 _0xe13f=['Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Sounds','destroy','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter','merge','includeAll','include','findAll','find','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','download','format','%s.%s','catch','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s'];(function(_0x27141c,_0x25ff8d){var _0x5a9b58=function(_0x2b5d51){while(--_0x2b5d51){_0x27141c['push'](_0x27141c['shift']());}};_0x5a9b58(++_0x25ff8d);}(_0xe13f,0x18e));var _0xfe13=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe13f[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0xfe13('0x0'));var rimraf=require(_0xfe13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe13('0x2'));var rp=require('request-promise');var moment=require(_0xfe13('0x3'));var BPromise=require(_0xfe13('0x4'));var Mustache=require(_0xfe13('0x5'));var util=require('util');var path=require(_0xfe13('0x6'));var sox=require(_0xfe13('0x7'));var csv=require(_0xfe13('0x8'));var ejs=require(_0xfe13('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe13('0xa'));var squel=require('squel');var crypto=require(_0xfe13('0xb'));var jsforce=require(_0xfe13('0xc'));var deskjs=require(_0xfe13('0xd'));var toCsv=require(_0xfe13('0x8'));var querystring=require(_0xfe13('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe13('0xf'));var qs=require(_0xfe13('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe13('0x11'));var logger=require(_0xfe13('0x12'))('api');var utils=require(_0xfe13('0x13'));var config=require(_0xfe13('0x14'));var licenseUtil=require(_0xfe13('0x15'));var db=require(_0xfe13('0x16'))['db'];function respondWithStatusCode(_0x3839b1,_0x4063b1){_0x4063b1=_0x4063b1||0xcc;return function(_0x16458f){if(_0x16458f){return _0x3839b1[_0xfe13('0x17')](_0x4063b1);}return _0x3839b1[_0xfe13('0x18')](_0x4063b1)[_0xfe13('0x19')]();};}function respondWithResult(_0x634975,_0x45a376){_0x45a376=_0x45a376||0xc8;return function(_0x11f6ef){if(_0x11f6ef){return _0x634975[_0xfe13('0x18')](_0x45a376)[_0xfe13('0x1a')](_0x11f6ef);}};}function respondWithFilteredResult(_0x30f3af,_0x38e632){return function(_0x5f15c4){if(_0x5f15c4){var _0x200ade=typeof _0x38e632[_0xfe13('0x1b')]===_0xfe13('0x1c')&&typeof _0x38e632[_0xfe13('0x1d')]==='undefined';var _0x596469=_0x5f15c4[_0xfe13('0x1e')];var _0x420b91=_0x200ade?0x0:_0x38e632[_0xfe13('0x1b')];var _0x1a1f2b=_0x200ade?_0x5f15c4['count']:_0x38e632[_0xfe13('0x1b')]+_0x38e632['limit'];var _0x4a65a8;if(_0x1a1f2b>=_0x596469){_0x1a1f2b=_0x596469;_0x4a65a8=0xc8;}else{_0x4a65a8=0xce;}_0x30f3af[_0xfe13('0x18')](_0x4a65a8);return _0x30f3af[_0xfe13('0x1f')](_0xfe13('0x20'),_0x420b91+'-'+_0x1a1f2b+'/'+_0x596469)[_0xfe13('0x1a')](_0x5f15c4);}return null;};}function patchUpdates(_0xb2a330){return function(_0x21e990){try{jsonpatch[_0xfe13('0x21')](_0x21e990,_0xb2a330,!![]);}catch(_0x39a48d){return BPromise[_0xfe13('0x22')](_0x39a48d);}return _0x21e990[_0xfe13('0x23')]();};}function saveUpdates(_0x1e458c,_0xe810d7){return function(_0x3048b4){if(_0x3048b4){return _0x3048b4[_0xfe13('0x24')](_0x1e458c)[_0xfe13('0x25')](function(_0x7ef2a3){return _0x7ef2a3;});}return null;};}function removeEntity(_0x2d52ee,_0x252731){return function(_0x3b8bb3){if(_0x3b8bb3){return _0x3b8bb3['destroy']()[_0xfe13('0x25')](function(){var _0x50df4e=_0x3b8bb3[_0xfe13('0x26')]({'plain':!![]});var _0x201a66=_0xfe13('0x27');return db['UserProfileResource'][_0xfe13('0x28')]({'where':{'type':_0x201a66,'resourceId':_0x50df4e['id']}})[_0xfe13('0x25')](function(){return _0x3b8bb3;});})[_0xfe13('0x25')](function(){_0x2d52ee[_0xfe13('0x18')](0xcc)[_0xfe13('0x19')]();});}};}function handleEntityNotFound(_0x2abd58,_0x211fa2){return function(_0x556225){if(!_0x556225){_0x2abd58[_0xfe13('0x17')](0x194);}return _0x556225;};}function handleError(_0x6c920b,_0x1f99b7){_0x1f99b7=_0x1f99b7||0x1f4;return function(_0x477a93){logger[_0xfe13('0x29')](_0x477a93[_0xfe13('0x2a')]);if(_0x477a93[_0xfe13('0x2b')]){delete _0x477a93[_0xfe13('0x2b')];}_0x6c920b[_0xfe13('0x18')](_0x1f99b7)[_0xfe13('0x2c')](_0x477a93);};}exports[_0xfe13('0x2d')]=function(_0x2ad2f6,_0x10f11c){var _0x474d62={},_0x46335c={},_0x472250={'count':0x0,'rows':[]};var _0x25a976=_[_0xfe13('0x2e')](db[_0xfe13('0x2f')][_0xfe13('0x30')],function(_0x113e55){return{'name':_0x113e55[_0xfe13('0x31')],'type':_0x113e55[_0xfe13('0x32')][_0xfe13('0x33')]};});_0x46335c[_0xfe13('0x34')]=_[_0xfe13('0x2e')](_0x25a976,_0xfe13('0x2b'));_0x46335c['query']=_[_0xfe13('0x35')](_0x2ad2f6['query']);_0x46335c['filters']=_[_0xfe13('0x36')](_0x46335c[_0xfe13('0x34')],_0x46335c['query']);_0x474d62[_0xfe13('0x37')]=_[_0xfe13('0x36')](_0x46335c['model'],qs[_0xfe13('0x38')](_0x2ad2f6['query'][_0xfe13('0x38')]));_0x474d62[_0xfe13('0x37')]=_0x474d62[_0xfe13('0x37')][_0xfe13('0x39')]?_0x474d62[_0xfe13('0x37')]:_0x46335c['model'];if(!_0x2ad2f6[_0xfe13('0x3a')][_0xfe13('0x3b')](_0xfe13('0x3c'))){_0x474d62['limit']=qs[_0xfe13('0x1d')](_0x2ad2f6[_0xfe13('0x3a')][_0xfe13('0x1d')]);_0x474d62[_0xfe13('0x1b')]=qs[_0xfe13('0x1b')](_0x2ad2f6[_0xfe13('0x3a')][_0xfe13('0x1b')]);}_0x474d62['order']=qs[_0xfe13('0x3d')](_0x2ad2f6[_0xfe13('0x3a')]['sort']);_0x474d62[_0xfe13('0x3e')]=qs[_0xfe13('0x3f')](_['pick'](_0x2ad2f6[_0xfe13('0x3a')],_0x46335c[_0xfe13('0x3f')]),_0x25a976);if(_0x2ad2f6[_0xfe13('0x3a')]['filter']){_0x474d62[_0xfe13('0x3e')]=_['merge'](_0x474d62[_0xfe13('0x3e')],{'$or':_['map'](_0x25a976,function(_0x3c5853){if(_0x3c5853[_0xfe13('0x32')]!==_0xfe13('0x40')){var _0x42baa3={};_0x42baa3[_0x3c5853[_0xfe13('0x2b')]]={'$like':'%'+_0x2ad2f6['query'][_0xfe13('0x41')]+'%'};return _0x42baa3;}})});}_0x474d62=_[_0xfe13('0x42')]({},_0x474d62,_0x2ad2f6['options']);var _0x51ed30={'where':_0x474d62[_0xfe13('0x3e')]};return db[_0xfe13('0x2f')][_0xfe13('0x1e')](_0x51ed30)[_0xfe13('0x25')](function(_0x18d7b9){_0x472250[_0xfe13('0x1e')]=_0x18d7b9;if(_0x2ad2f6['query'][_0xfe13('0x43')]){_0x474d62[_0xfe13('0x44')]=[{'all':!![]}];}return db[_0xfe13('0x2f')][_0xfe13('0x45')](_0x474d62);})[_0xfe13('0x25')](function(_0x10fd65){_0x472250['rows']=_0x10fd65;return _0x472250;})[_0xfe13('0x25')](respondWithFilteredResult(_0x10f11c,_0x474d62))['catch'](handleError(_0x10f11c,null));};exports['show']=function(_0x5b540e,_0x3908ba){var _0x298584={'raw':!![],'where':{'id':_0x5b540e['params']['id']}},_0x5823ac={};_0x5823ac[_0xfe13('0x34')]=_[_0xfe13('0x35')](db[_0xfe13('0x2f')][_0xfe13('0x30')]);_0x5823ac['query']=_[_0xfe13('0x35')](_0x5b540e[_0xfe13('0x3a')]);_0x5823ac[_0xfe13('0x3f')]=_['intersection'](_0x5823ac[_0xfe13('0x34')],_0x5823ac['query']);_0x298584['attributes']=_[_0xfe13('0x36')](_0x5823ac[_0xfe13('0x34')],qs[_0xfe13('0x38')](_0x5b540e[_0xfe13('0x3a')][_0xfe13('0x38')]));_0x298584[_0xfe13('0x37')]=_0x298584['attributes']['length']?_0x298584['attributes']:_0x5823ac[_0xfe13('0x34')];if(_0x5b540e[_0xfe13('0x3a')][_0xfe13('0x43')]){_0x298584['include']=[{'all':!![]}];}_0x298584=_[_0xfe13('0x42')]({},_0x298584,_0x5b540e['options']);return db[_0xfe13('0x2f')][_0xfe13('0x46')](_0x298584)['then'](handleEntityNotFound(_0x3908ba,null))[_0xfe13('0x25')](respondWithResult(_0x3908ba,null))['catch'](handleError(_0x3908ba,null));};exports['download']=function(_0x534ab3,_0x530c13,_0x327ade){return db[_0xfe13('0x2f')][_0xfe13('0x46')]({'where':{'id':_0x534ab3[_0xfe13('0x47')]['id']},'attributes':[_0xfe13('0x2b'),_0xfe13('0x48'),_0xfe13('0x49')],'raw':!![]})[_0xfe13('0x25')](handleEntityNotFound(_0x530c13,null))[_0xfe13('0x25')](function(_0x1f0a5e){if(_0x1f0a5e){if(!fs[_0xfe13('0x4a')](path[_0xfe13('0x4b')](config[_0xfe13('0x4c')],_0xfe13('0x4d'),_0x1f0a5e[_0xfe13('0x48')]+'.'+_0x1f0a5e['converted_format']))){throw new db[(_0xfe13('0x4e'))][(_0xfe13('0x4f'))]('Sound\x20not\x20found');}return _0x530c13[_0xfe13('0x50')](path['join'](config[_0xfe13('0x4c')],'server/files/sounds/converted',util[_0xfe13('0x51')](_0xfe13('0x52'),_0x1f0a5e['save_name'],_0x1f0a5e[_0xfe13('0x49')])),util[_0xfe13('0x51')](_0xfe13('0x52'),_0x1f0a5e[_0xfe13('0x2b')],_0x1f0a5e[_0xfe13('0x49')]));}return null;})[_0xfe13('0x53')](handleError(_0x530c13,null));};exports[_0xfe13('0x54')]=function(_0x4d9ae7,_0x5db066,_0x1948d3){var _0x1e9f6a={'name':path[_0xfe13('0x55')](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x57')],path[_0xfe13('0x58')](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x57')])),'save_name':path[_0xfe13('0x55')](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x59')],path['extname'](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x59')])),'original_format':path[_0xfe13('0x58')](_0x4d9ae7['file'][_0xfe13('0x57')])['substring'](0x1),'converted_format':_0xfe13('0x5a')};var _0x74e8e=path['join'](config[_0xfe13('0x4c')],_0xfe13('0x5b'),_0x4d9ae7[_0xfe13('0x56')]['filename']);var _0xed54ac=path[_0xfe13('0x4b')](config['root'],_0xfe13('0x4d'),util[_0xfe13('0x51')](_0xfe13('0x52'),path[_0xfe13('0x55')](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x59')],path[_0xfe13('0x58')](_0x4d9ae7[_0xfe13('0x56')][_0xfe13('0x59')])),_0x1e9f6a[_0xfe13('0x49')]));logger[_0xfe13('0x5c')](_0xfe13('0x5d'),_0x74e8e);logger['info'](_0xfe13('0x5e'),_0xed54ac);try{fs[_0xfe13('0x5f')](_0x74e8e,parseInt(_0xfe13('0x60'),0x8));var _0x2c0543=sox['transcode'](_0x74e8e,_0xed54ac,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2c0543['on'](_0xfe13('0x29'),function(_0x2cd8de){fs[_0xfe13('0x61')](_0x74e8e);_0x5db066[_0xfe13('0x18')](0x1f4)['send'](_0x2cd8de);});_0x2c0543['on'](_0xfe13('0x62'),function(_0x4c51d5){_0x1e9f6a['original_duration']=isNaN(_0x4c51d5[_0xfe13('0x63')])?null:_0x4c51d5['duration']*0x3e8;_0x1e9f6a[_0xfe13('0x64')]=isNaN(_0x4c51d5[_0xfe13('0x65')])?null:_0x4c51d5[_0xfe13('0x65')];_0x1e9f6a[_0xfe13('0x66')]=isNaN(_0x4c51d5[_0xfe13('0x67')])?null:_0x4c51d5[_0xfe13('0x67')];_0x1e9f6a[_0xfe13('0x68')]=isNaN(_0x4c51d5[_0xfe13('0x69')])?null:_0x4c51d5[_0xfe13('0x69')];_0x1e9f6a[_0xfe13('0x6a')]=isNaN(_0x4c51d5[_0xfe13('0x6b')])?null:_0x4c51d5[_0xfe13('0x6b')];});_0x2c0543['on'](_0xfe13('0x6c'),function(_0xa6a5f6){_0x1e9f6a['converted_duration']=isNaN(_0xa6a5f6[_0xfe13('0x63')])?null:_0xa6a5f6['duration']*0x3e8;_0x1e9f6a[_0xfe13('0x6d')]=isNaN(_0xa6a5f6[_0xfe13('0x65')])?null:_0xa6a5f6[_0xfe13('0x65')];_0x1e9f6a[_0xfe13('0x6e')]=isNaN(_0xa6a5f6[_0xfe13('0x67')])?null:_0xa6a5f6[_0xfe13('0x67')];_0x1e9f6a[_0xfe13('0x6f')]=isNaN(_0xa6a5f6['bitRate'])?null:_0xa6a5f6[_0xfe13('0x69')];_0x1e9f6a[_0xfe13('0x70')]=isNaN(_0xa6a5f6[_0xfe13('0x6b')])?null:_0xa6a5f6[_0xfe13('0x6b')];});_0x2c0543['on'](_0xfe13('0x19'),function(){fs[_0xfe13('0x5f')](_0xed54ac,parseInt(_0xfe13('0x60'),0x8));return db[_0xfe13('0x2f')][_0xfe13('0x54')](_0x1e9f6a)[_0xfe13('0x25')](function(_0x4b30a1){var _0x42e0f0={'role':_0x4d9ae7[_0xfe13('0x71')][_0xfe13('0x72')],'userProfileId':_0x4d9ae7[_0xfe13('0x71')]['userProfileId']};if(!_0x42e0f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42e0f0[_0xfe13('0x72')]==='user'){var _0x790c44=_0x4b30a1['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Sounds','userProfileId':_0x42e0f0[_0xfe13('0x73')]},'raw':!![]})['then'](function(_0x18d3a9){if(_0x18d3a9&&_0x18d3a9[_0xfe13('0x74')]===0x0){return db[_0xfe13('0x75')]['create']({'name':_0x790c44['name'],'resourceId':_0x790c44['id'],'type':_0x18d3a9[_0xfe13('0x2b')],'sectionId':_0x18d3a9['id']},{})['then'](function(){return _0x4b30a1;});}else{return _0x4b30a1;}})[_0xfe13('0x53')](function(_0x561598){logger['error'](_0xfe13('0x76'),_0x561598);throw _0x561598;});}return _0x4b30a1;})[_0xfe13('0x25')](respondWithResult(_0x5db066,null))[_0xfe13('0x53')](handleError(_0x5db066,null));});_0x2c0543[_0xfe13('0x77')]();}catch(_0x3bc775){_0x5db066[_0xfe13('0x18')](0x1f4)['send'](_0x3bc775);}};exports[_0xfe13('0x24')]=function(_0x2e521a,_0x2c9b3c,_0x3847c7){return db[_0xfe13('0x2f')]['find']({'where':{'id':_0x2e521a['params']['id']}})[_0xfe13('0x25')](handleEntityNotFound(_0x2c9b3c,null))[_0xfe13('0x25')](saveUpdates(_['pick'](_0x2e521a[_0xfe13('0x71')],['name',_0xfe13('0x78')]),null))[_0xfe13('0x25')](respondWithResult(_0x2c9b3c,null))[_0xfe13('0x53')](handleError(_0x2c9b3c,null));};exports[_0xfe13('0x79')]=function(_0x1797a3,_0x33403b,_0x3d6a30){return db['Sound'][_0xfe13('0x46')]({'where':{'id':_0x1797a3[_0xfe13('0x47')]['id']}})[_0xfe13('0x25')](function(_0x147e4b){if(_0x147e4b){return _0x147e4b[_0xfe13('0x28')]();}})['then'](function(_0x2f3355){var _0x55b2b0=path['join'](config[_0xfe13('0x4c')],_0xfe13('0x5b'),util[_0xfe13('0x51')](_0xfe13('0x52'),_0x2f3355['save_name'],_0x2f3355[_0xfe13('0x7a')]));var _0x5b4256=path[_0xfe13('0x4b')](config[_0xfe13('0x4c')],_0xfe13('0x4d'),util[_0xfe13('0x51')](_0xfe13('0x52'),_0x2f3355[_0xfe13('0x48')],_0x2f3355['converted_format']));fs['unlinkSync'](_0x55b2b0);fs[_0xfe13('0x61')](_0x5b4256);return _0x2f3355;})[_0xfe13('0x25')](function(_0x6c4839){if(_0x6c4839){return _0x33403b['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x33403b,null))[_0xfe13('0x53')](handleError(_0x33403b,null));}; \ No newline at end of file +var _0xeab5=['basename','file','extname','originalname','filename','substring','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','wav','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','bitRate','converted_sampleRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','sort','merge','where','filter','options','includeAll','include','findAll','rows','catch','show','params','Sound','find','download','save_name','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','converted_format','create'];(function(_0x40b75f,_0x4b7ad8){var _0x27dec0=function(_0xe77c63){while(--_0xe77c63){_0x40b75f['push'](_0x40b75f['shift']());}};_0x27dec0(++_0x4b7ad8);}(_0xeab5,0x1a4));var _0x5eab=function(_0x279796,_0x4ac7b7){_0x279796=_0x279796-0x0;var _0x2637ea=_0xeab5[_0x279796];return _0x2637ea;};'use strict';var emlformat=require(_0x5eab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5eab('0x1'));var jsonpatch=require(_0x5eab('0x2'));var rp=require(_0x5eab('0x3'));var moment=require(_0x5eab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5eab('0x5'));var util=require(_0x5eab('0x6'));var path=require(_0x5eab('0x7'));var sox=require(_0x5eab('0x8'));var csv=require(_0x5eab('0x9'));var ejs=require(_0x5eab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5eab('0xb'));var crypto=require(_0x5eab('0xc'));var jsforce=require(_0x5eab('0xd'));var deskjs=require(_0x5eab('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5eab('0xf'));var Papa=require(_0x5eab('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5eab('0x11'));var as=require(_0x5eab('0x12'));var hardwareService=require(_0x5eab('0x13'));var logger=require(_0x5eab('0x14'))(_0x5eab('0x15'));var utils=require(_0x5eab('0x16'));var config=require(_0x5eab('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5eab('0x18'))['db'];function respondWithStatusCode(_0x1da878,_0x10cebf){_0x10cebf=_0x10cebf||0xcc;return function(_0x9a7e8d){if(_0x9a7e8d){return _0x1da878[_0x5eab('0x19')](_0x10cebf);}return _0x1da878['status'](_0x10cebf)[_0x5eab('0x1a')]();};}function respondWithResult(_0x23708f,_0x581a4b){_0x581a4b=_0x581a4b||0xc8;return function(_0x3a6b26){if(_0x3a6b26){return _0x23708f[_0x5eab('0x1b')](_0x581a4b)[_0x5eab('0x1c')](_0x3a6b26);}};}function respondWithFilteredResult(_0x222305,_0x2be683){return function(_0x4acc32){if(_0x4acc32){var _0xd7418a=typeof _0x2be683[_0x5eab('0x1d')]===_0x5eab('0x1e')&&typeof _0x2be683[_0x5eab('0x1f')]===_0x5eab('0x1e');var _0x8838bb=_0x4acc32[_0x5eab('0x20')];var _0x479598=_0xd7418a?0x0:_0x2be683['offset'];var _0x243f24=_0xd7418a?_0x4acc32[_0x5eab('0x20')]:_0x2be683[_0x5eab('0x1d')]+_0x2be683['limit'];var _0x36cbb6;if(_0x243f24>=_0x8838bb){_0x243f24=_0x8838bb;_0x36cbb6=0xc8;}else{_0x36cbb6=0xce;}_0x222305[_0x5eab('0x1b')](_0x36cbb6);return _0x222305[_0x5eab('0x21')](_0x5eab('0x22'),_0x479598+'-'+_0x243f24+'/'+_0x8838bb)[_0x5eab('0x1c')](_0x4acc32);}return null;};}function patchUpdates(_0x526a28){return function(_0x18e915){try{jsonpatch[_0x5eab('0x23')](_0x18e915,_0x526a28,!![]);}catch(_0x447463){return BPromise[_0x5eab('0x24')](_0x447463);}return _0x18e915['save']();};}function saveUpdates(_0x550e7a,_0x4a60bf){return function(_0x571910){if(_0x571910){return _0x571910[_0x5eab('0x25')](_0x550e7a)[_0x5eab('0x26')](function(_0x109420){return _0x109420;});}return null;};}function removeEntity(_0x2b3dc5,_0x3033d4){return function(_0x26e53b){if(_0x26e53b){return _0x26e53b[_0x5eab('0x27')]()[_0x5eab('0x26')](function(){var _0x53fd68=_0x26e53b[_0x5eab('0x28')]({'plain':!![]});var _0xfe57c6=_0x5eab('0x29');return db[_0x5eab('0x2a')][_0x5eab('0x27')]({'where':{'type':_0xfe57c6,'resourceId':_0x53fd68['id']}})[_0x5eab('0x26')](function(){return _0x26e53b;});})['then'](function(){_0x2b3dc5[_0x5eab('0x1b')](0xcc)[_0x5eab('0x1a')]();});}};}function handleEntityNotFound(_0x50e3ff,_0x4da781){return function(_0x5ea9d3){if(!_0x5ea9d3){_0x50e3ff['sendStatus'](0x194);}return _0x5ea9d3;};}function handleError(_0x32ad53,_0x26b938){_0x26b938=_0x26b938||0x1f4;return function(_0x58f409){logger['error'](_0x58f409['stack']);if(_0x58f409['name']){delete _0x58f409[_0x5eab('0x2b')];}_0x32ad53[_0x5eab('0x1b')](_0x26b938)[_0x5eab('0x2c')](_0x58f409);};}exports[_0x5eab('0x2d')]=function(_0x40519c,_0x23aee3){var _0x1bb9f6={},_0x32fa5a={},_0x584824={'count':0x0,'rows':[]};var _0x1fb7be=_[_0x5eab('0x2e')](db['Sound'][_0x5eab('0x2f')],function(_0xb656f3){return{'name':_0xb656f3[_0x5eab('0x30')],'type':_0xb656f3['type'][_0x5eab('0x31')]};});_0x32fa5a['model']=_['map'](_0x1fb7be,'name');_0x32fa5a[_0x5eab('0x32')]=_[_0x5eab('0x33')](_0x40519c[_0x5eab('0x32')]);_0x32fa5a[_0x5eab('0x34')]=_['intersection'](_0x32fa5a['model'],_0x32fa5a[_0x5eab('0x32')]);_0x1bb9f6[_0x5eab('0x35')]=_[_0x5eab('0x36')](_0x32fa5a[_0x5eab('0x37')],qs[_0x5eab('0x38')](_0x40519c[_0x5eab('0x32')][_0x5eab('0x38')]));_0x1bb9f6['attributes']=_0x1bb9f6[_0x5eab('0x35')][_0x5eab('0x39')]?_0x1bb9f6[_0x5eab('0x35')]:_0x32fa5a['model'];if(!_0x40519c[_0x5eab('0x32')][_0x5eab('0x3a')]('nolimit')){_0x1bb9f6[_0x5eab('0x1f')]=qs['limit'](_0x40519c[_0x5eab('0x32')][_0x5eab('0x1f')]);_0x1bb9f6['offset']=qs[_0x5eab('0x1d')](_0x40519c[_0x5eab('0x32')]['offset']);}_0x1bb9f6['order']=qs[_0x5eab('0x3b')](_0x40519c[_0x5eab('0x32')][_0x5eab('0x3b')]);_0x1bb9f6['where']=qs[_0x5eab('0x34')](_['pick'](_0x40519c[_0x5eab('0x32')],_0x32fa5a[_0x5eab('0x34')]),_0x1fb7be);if(_0x40519c[_0x5eab('0x32')]['filter']){_0x1bb9f6['where']=_[_0x5eab('0x3c')](_0x1bb9f6[_0x5eab('0x3d')],{'$or':_[_0x5eab('0x2e')](_0x1fb7be,function(_0x3e5ad2){if(_0x3e5ad2['type']!=='VIRTUAL'){var _0x149b25={};_0x149b25[_0x3e5ad2[_0x5eab('0x2b')]]={'$like':'%'+_0x40519c[_0x5eab('0x32')][_0x5eab('0x3e')]+'%'};return _0x149b25;}})});}_0x1bb9f6=_['merge']({},_0x1bb9f6,_0x40519c[_0x5eab('0x3f')]);var _0x18306c={'where':_0x1bb9f6[_0x5eab('0x3d')]};return db['Sound'][_0x5eab('0x20')](_0x18306c)[_0x5eab('0x26')](function(_0xf276a7){_0x584824[_0x5eab('0x20')]=_0xf276a7;if(_0x40519c[_0x5eab('0x32')][_0x5eab('0x40')]){_0x1bb9f6[_0x5eab('0x41')]=[{'all':!![]}];}return db['Sound'][_0x5eab('0x42')](_0x1bb9f6);})['then'](function(_0x25a024){_0x584824[_0x5eab('0x43')]=_0x25a024;return _0x584824;})[_0x5eab('0x26')](respondWithFilteredResult(_0x23aee3,_0x1bb9f6))[_0x5eab('0x44')](handleError(_0x23aee3,null));};exports[_0x5eab('0x45')]=function(_0x1be40a,_0x2c1778){var _0x421078={'raw':!![],'where':{'id':_0x1be40a[_0x5eab('0x46')]['id']}},_0x301b55={};_0x301b55[_0x5eab('0x37')]=_[_0x5eab('0x33')](db[_0x5eab('0x47')][_0x5eab('0x2f')]);_0x301b55['query']=_[_0x5eab('0x33')](_0x1be40a['query']);_0x301b55[_0x5eab('0x34')]=_[_0x5eab('0x36')](_0x301b55[_0x5eab('0x37')],_0x301b55[_0x5eab('0x32')]);_0x421078[_0x5eab('0x35')]=_[_0x5eab('0x36')](_0x301b55[_0x5eab('0x37')],qs[_0x5eab('0x38')](_0x1be40a['query'][_0x5eab('0x38')]));_0x421078['attributes']=_0x421078['attributes'][_0x5eab('0x39')]?_0x421078[_0x5eab('0x35')]:_0x301b55[_0x5eab('0x37')];if(_0x1be40a[_0x5eab('0x32')][_0x5eab('0x40')]){_0x421078[_0x5eab('0x41')]=[{'all':!![]}];}_0x421078=_[_0x5eab('0x3c')]({},_0x421078,_0x1be40a[_0x5eab('0x3f')]);return db[_0x5eab('0x47')][_0x5eab('0x48')](_0x421078)['then'](handleEntityNotFound(_0x2c1778,null))['then'](respondWithResult(_0x2c1778,null))[_0x5eab('0x44')](handleError(_0x2c1778,null));};exports[_0x5eab('0x49')]=function(_0x1f3d04,_0xa9b114,_0x252233){return db[_0x5eab('0x47')][_0x5eab('0x48')]({'where':{'id':_0x1f3d04['params']['id']},'attributes':[_0x5eab('0x2b'),_0x5eab('0x4a'),'converted_format'],'raw':!![]})[_0x5eab('0x26')](handleEntityNotFound(_0xa9b114,null))[_0x5eab('0x26')](function(_0x367055){if(_0x367055){if(!fs['existsSync'](path[_0x5eab('0x4b')](config[_0x5eab('0x4c')],_0x5eab('0x4d'),_0x367055['save_name']+'.'+_0x367055['converted_format']))){throw new db[(_0x5eab('0x4e'))][(_0x5eab('0x4f'))](_0x5eab('0x50'));}return _0xa9b114[_0x5eab('0x49')](path['join'](config[_0x5eab('0x4c')],_0x5eab('0x4d'),util[_0x5eab('0x51')]('%s.%s',_0x367055[_0x5eab('0x4a')],_0x367055[_0x5eab('0x52')])),util[_0x5eab('0x51')]('%s.%s',_0x367055[_0x5eab('0x2b')],_0x367055[_0x5eab('0x52')]));}return null;})[_0x5eab('0x44')](handleError(_0xa9b114,null));};exports[_0x5eab('0x53')]=function(_0x18a943,_0x453623,_0x1c77b6){var _0x497a6d={'name':path[_0x5eab('0x54')](_0x18a943[_0x5eab('0x55')]['originalname'],path[_0x5eab('0x56')](_0x18a943[_0x5eab('0x55')][_0x5eab('0x57')])),'save_name':path[_0x5eab('0x54')](_0x18a943[_0x5eab('0x55')][_0x5eab('0x58')],path[_0x5eab('0x56')](_0x18a943[_0x5eab('0x55')][_0x5eab('0x58')])),'original_format':path[_0x5eab('0x56')](_0x18a943['file'][_0x5eab('0x57')])[_0x5eab('0x59')](0x1),'converted_format':'wav'};var _0x4945a5=path[_0x5eab('0x4b')](config['root'],_0x5eab('0x5a'),_0x18a943['file'][_0x5eab('0x58')]);var _0x32b27c=path['join'](config[_0x5eab('0x4c')],_0x5eab('0x4d'),util['format'](_0x5eab('0x5b'),path['basename'](_0x18a943[_0x5eab('0x55')][_0x5eab('0x58')],path[_0x5eab('0x56')](_0x18a943[_0x5eab('0x55')][_0x5eab('0x58')])),_0x497a6d['converted_format']));logger[_0x5eab('0x5c')](_0x5eab('0x5d'),_0x4945a5);logger[_0x5eab('0x5c')](_0x5eab('0x5e'),_0x32b27c);try{fs['chmodSync'](_0x4945a5,parseInt(_0x5eab('0x5f'),0x8));var _0xd2a78c=sox['transcode'](_0x4945a5,_0x32b27c,{'sampleRate':0x1f40,'format':_0x5eab('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xd2a78c['on'](_0x5eab('0x61'),function(_0x569840){fs[_0x5eab('0x62')](_0x4945a5);_0x453623[_0x5eab('0x1b')](0x1f4)['send'](_0x569840);});_0xd2a78c['on'](_0x5eab('0x63'),function(_0x536fe1){_0x497a6d[_0x5eab('0x64')]=isNaN(_0x536fe1['duration'])?null:_0x536fe1[_0x5eab('0x65')]*0x3e8;_0x497a6d[_0x5eab('0x66')]=isNaN(_0x536fe1[_0x5eab('0x67')])?null:_0x536fe1['sampleCount'];_0x497a6d[_0x5eab('0x68')]=isNaN(_0x536fe1[_0x5eab('0x69')])?null:_0x536fe1[_0x5eab('0x69')];_0x497a6d[_0x5eab('0x6a')]=isNaN(_0x536fe1['bitRate'])?null:_0x536fe1['bitRate'];_0x497a6d[_0x5eab('0x6b')]=isNaN(_0x536fe1[_0x5eab('0x6c')])?null:_0x536fe1[_0x5eab('0x6c')];});_0xd2a78c['on'](_0x5eab('0x6d'),function(_0x5ff0a6){_0x497a6d[_0x5eab('0x6e')]=isNaN(_0x5ff0a6['duration'])?null:_0x5ff0a6[_0x5eab('0x65')]*0x3e8;_0x497a6d[_0x5eab('0x6f')]=isNaN(_0x5ff0a6[_0x5eab('0x67')])?null:_0x5ff0a6[_0x5eab('0x67')];_0x497a6d['converted_channelCount']=isNaN(_0x5ff0a6[_0x5eab('0x69')])?null:_0x5ff0a6[_0x5eab('0x69')];_0x497a6d[_0x5eab('0x70')]=isNaN(_0x5ff0a6[_0x5eab('0x71')])?null:_0x5ff0a6[_0x5eab('0x71')];_0x497a6d[_0x5eab('0x72')]=isNaN(_0x5ff0a6[_0x5eab('0x6c')])?null:_0x5ff0a6[_0x5eab('0x6c')];});_0xd2a78c['on'](_0x5eab('0x1a'),function(){fs[_0x5eab('0x73')](_0x32b27c,parseInt('0777',0x8));return db['Sound'][_0x5eab('0x53')](_0x497a6d)[_0x5eab('0x26')](function(_0x441f03){var _0x4fbc14={'role':_0x18a943[_0x5eab('0x74')][_0x5eab('0x75')],'userProfileId':_0x18a943[_0x5eab('0x74')]['userProfileId']};if(!_0x4fbc14)throw new Error(_0x5eab('0x76'));if(_0x4fbc14[_0x5eab('0x75')]===_0x5eab('0x77')){var _0x4af606=_0x441f03[_0x5eab('0x28')]({'plain':!![]});return db[_0x5eab('0x78')][_0x5eab('0x48')]({'where':{'name':_0x5eab('0x29'),'userProfileId':_0x4fbc14['userProfileId']},'raw':!![]})[_0x5eab('0x26')](function(_0x2639bb){if(_0x2639bb&&_0x2639bb[_0x5eab('0x79')]===0x0){return db[_0x5eab('0x2a')][_0x5eab('0x53')]({'name':_0x4af606[_0x5eab('0x2b')],'resourceId':_0x4af606['id'],'type':_0x2639bb[_0x5eab('0x2b')],'sectionId':_0x2639bb['id']},{})[_0x5eab('0x26')](function(){return _0x441f03;});}else{return _0x441f03;}})[_0x5eab('0x44')](function(_0x1f1f78){logger[_0x5eab('0x61')](_0x5eab('0x7a'),_0x1f1f78);throw _0x1f1f78;});}return _0x441f03;})[_0x5eab('0x26')](respondWithResult(_0x453623,null))[_0x5eab('0x44')](handleError(_0x453623,null));});_0xd2a78c[_0x5eab('0x7b')]();}catch(_0x1c90de){_0x453623[_0x5eab('0x1b')](0x1f4)[_0x5eab('0x2c')](_0x1c90de);}};exports[_0x5eab('0x25')]=function(_0x58cf66,_0x323ab3,_0x42c17b){return db[_0x5eab('0x47')][_0x5eab('0x48')]({'where':{'id':_0x58cf66['params']['id']}})[_0x5eab('0x26')](handleEntityNotFound(_0x323ab3,null))[_0x5eab('0x26')](saveUpdates(_['pick'](_0x58cf66[_0x5eab('0x74')],[_0x5eab('0x2b'),_0x5eab('0x7c')]),null))['then'](respondWithResult(_0x323ab3,null))['catch'](handleError(_0x323ab3,null));};exports['delete']=function(_0x8258e3,_0x378ae6,_0x3e14ca){return db[_0x5eab('0x47')]['find']({'where':{'id':_0x8258e3[_0x5eab('0x46')]['id']}})[_0x5eab('0x26')](function(_0x11141a){if(_0x11141a){return _0x11141a[_0x5eab('0x27')]();}})['then'](function(_0x2d826f){var _0x4d9f13=path[_0x5eab('0x4b')](config['root'],_0x5eab('0x5a'),util[_0x5eab('0x51')]('%s.%s',_0x2d826f[_0x5eab('0x4a')],_0x2d826f[_0x5eab('0x7d')]));var _0x203d84=path[_0x5eab('0x4b')](config[_0x5eab('0x4c')],'server/files/sounds/converted',util[_0x5eab('0x51')](_0x5eab('0x5b'),_0x2d826f['save_name'],_0x2d826f[_0x5eab('0x52')]));fs[_0x5eab('0x62')](_0x4d9f13);fs['unlinkSync'](_0x203d84);return _0x2d826f;})[_0x5eab('0x26')](function(_0xf925e5){if(_0xf925e5){return _0x378ae6[_0x5eab('0x1b')](0xcc)['end']();}})[_0x5eab('0x26')](handleEntityNotFound(_0x378ae6,null))[_0x5eab('0x44')](handleError(_0x378ae6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1ea9438..a8adf48 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 _0x82e8=['tools_sounds','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound'];(function(_0x147f10,_0x237f43){var _0x3783c4=function(_0xd738c4){while(--_0xd738c4){_0x147f10['push'](_0x147f10['shift']());}};_0x3783c4(++_0x237f43);}(_0x82e8,0x69));var _0x882e=function(_0x3c8679,_0x2faea3){_0x3c8679=_0x3c8679-0x0;var _0x2791f8=_0x82e8[_0x3c8679];return _0x2791f8;};'use strict';var _=require(_0x882e('0x0'));var util=require(_0x882e('0x1'));var logger=require('../../config/logger')(_0x882e('0x2'));var moment=require(_0x882e('0x3'));var BPromise=require(_0x882e('0x4'));var rp=require(_0x882e('0x5'));var fs=require('fs');var path=require(_0x882e('0x6'));var rimraf=require(_0x882e('0x7'));var config=require(_0x882e('0x8'));var attributes=require(_0x882e('0x9'));module['exports']=function(_0x16502f,_0x45e43d){return _0x16502f[_0x882e('0xa')](_0x882e('0xb'),attributes,{'tableName':_0x882e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe18=['rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2c3b8e,_0x3d8128){var _0x1b783d=function(_0x593b2f){while(--_0x593b2f){_0x2c3b8e['push'](_0x2c3b8e['shift']());}};_0x1b783d(++_0x3d8128);}(_0xfe18,0x1bf));var _0x8fe1=function(_0x23e2bb,_0xd82b6d){_0x23e2bb=_0x23e2bb-0x0;var _0x2dd8ed=_0xfe18[_0x23e2bb];return _0x2dd8ed;};'use strict';var _=require(_0x8fe1('0x0'));var util=require(_0x8fe1('0x1'));var logger=require(_0x8fe1('0x2'))(_0x8fe1('0x3'));var moment=require(_0x8fe1('0x4'));var BPromise=require(_0x8fe1('0x5'));var rp=require(_0x8fe1('0x6'));var fs=require('fs');var path=require(_0x8fe1('0x7'));var rimraf=require(_0x8fe1('0x8'));var config=require('../../config/environment');var attributes=require(_0x8fe1('0x9'));module['exports']=function(_0x2aff9c,_0x369fcd){return _0x2aff9c[_0x8fe1('0xa')](_0x8fe1('0xb'),attributes,{'tableName':_0x8fe1('0xc'),'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 617eba2..73470c6 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 _0xd5aa=['Sound','find','options','where','attributes','include','model','map','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSound'];(function(_0xdcd0dc,_0x443331){var _0x4e5db7=function(_0x249cf6){while(--_0x249cf6){_0xdcd0dc['push'](_0xdcd0dc['shift']());}};_0x4e5db7(++_0x443331);}(_0xd5aa,0x120));var _0xad5a=function(_0x542f08,_0x4a09bb){_0x542f08=_0x542f08-0x0;var _0x35ce2b=_0xd5aa[_0x542f08];return _0x35ce2b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad5a('0x0'));var BPromise=require(_0xad5a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad5a('0x2'));var db=require(_0xad5a('0x3'))['db'];var utils=require(_0xad5a('0x4'));var logger=require(_0xad5a('0x5'))(_0xad5a('0x6'));var config=require(_0xad5a('0x7'));var jayson=require(_0xad5a('0x8'));var client=jayson[_0xad5a('0x9')][_0xad5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10506f,_0x1e15ad,_0xa05784){return new BPromise(function(_0x2cd3ae,_0x36cb16){return client[_0xad5a('0xb')](_0x10506f,_0xa05784)['then'](function(_0x2ec088){logger[_0xad5a('0xc')](_0xad5a('0xd'),_0x1e15ad,_0xad5a('0xe'));logger[_0xad5a('0xf')](_0xad5a('0x10'),_0x1e15ad,_0xad5a('0xe'),JSON[_0xad5a('0x11')](_0x2ec088));if(_0x2ec088['error']){if(_0x2ec088[_0xad5a('0x12')][_0xad5a('0x13')]===0x1f4){logger[_0xad5a('0x12')]('Sound,\x20%s,\x20%s',_0x1e15ad,_0x2ec088['error'][_0xad5a('0x14')]);return _0x36cb16(_0x2ec088[_0xad5a('0x12')][_0xad5a('0x14')]);}logger[_0xad5a('0x12')]('Sound,\x20%s,\x20%s',_0x1e15ad,_0x2ec088[_0xad5a('0x12')]['message']);return _0x2cd3ae(_0x2ec088[_0xad5a('0x12')]['message']);}else{logger[_0xad5a('0xc')]('Sound,\x20%s,\x20%s',_0x1e15ad,_0xad5a('0xe'));_0x2cd3ae(_0x2ec088['result'][_0xad5a('0x14')]);}})['catch'](function(_0x3bc4d4){logger[_0xad5a('0x12')](_0xad5a('0xd'),_0x1e15ad,_0x3bc4d4);_0x36cb16(_0x3bc4d4);});});}exports[_0xad5a('0x15')]=function(_0x73ce76){var _0x330459=this;return new Promise(function(_0x51a5ca,_0x316451){return db[_0xad5a('0x16')][_0xad5a('0x17')]({'raw':_0x73ce76[_0xad5a('0x18')]?_0x73ce76[_0xad5a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x73ce76[_0xad5a('0x18')]?_0x73ce76[_0xad5a('0x18')][_0xad5a('0x19')]||null:null,'attributes':_0x73ce76[_0xad5a('0x18')]?_0x73ce76[_0xad5a('0x18')][_0xad5a('0x1a')]||null:null,'include':_0x73ce76[_0xad5a('0x18')]?_0x73ce76[_0xad5a('0x18')][_0xad5a('0x1b')]?_['map'](_0x73ce76[_0xad5a('0x18')][_0xad5a('0x1b')],function(_0x2559cd){return{'model':db[_0x2559cd[_0xad5a('0x1c')]],'as':_0x2559cd['as'],'attributes':_0x2559cd[_0xad5a('0x1a')],'include':_0x2559cd[_0xad5a('0x1b')]?_[_0xad5a('0x1d')](_0x2559cd[_0xad5a('0x1b')],function(_0x1775c3){return{'model':db[_0x1775c3[_0xad5a('0x1c')]],'as':_0x1775c3['as'],'attributes':_0x1775c3[_0xad5a('0x1a')],'include':_0x1775c3[_0xad5a('0x1b')]?_[_0xad5a('0x1d')](_0x1775c3[_0xad5a('0x1b')],function(_0x1e9a35){return{'model':db[_0x1e9a35[_0xad5a('0x1c')]],'as':_0x1e9a35['as'],'attributes':_0x1e9a35['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x388e15){logger[_0xad5a('0xc')]('ShowSound',_0x73ce76);logger[_0xad5a('0xf')](_0xad5a('0x15'),_0x73ce76,JSON[_0xad5a('0x11')](_0x388e15));_0x51a5ca(_0x388e15);})[_0xad5a('0x1e')](function(_0x149771){logger[_0xad5a('0x12')](_0xad5a('0x15'),_0x149771[_0xad5a('0x14')],_0x73ce76);_0x316451(_0x330459['error'](0x1f4,_0x149771[_0xad5a('0x14')]));});});}; \ No newline at end of file +var _0xa800=['error','message','info','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11c909,_0x5ed704){var _0x2c78bc=function(_0x13704a){while(--_0x13704a){_0x11c909['push'](_0x11c909['shift']());}};_0x2c78bc(++_0x5ed704);}(_0xa800,0x1ef));var _0x0a80=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0xa800[_0x2d892a];return _0x367765;};'use strict';var _=require(_0x0a80('0x0'));var util=require(_0x0a80('0x1'));var moment=require(_0x0a80('0x2'));var BPromise=require(_0x0a80('0x3'));var rs=require(_0x0a80('0x4'));var fs=require('fs');var Redis=require(_0x0a80('0x5'));var db=require(_0x0a80('0x6'))['db'];var utils=require(_0x0a80('0x7'));var logger=require('../../config/logger')(_0x0a80('0x8'));var config=require(_0x0a80('0x9'));var jayson=require(_0x0a80('0xa'));var client=jayson[_0x0a80('0xb')][_0x0a80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57490f,_0x11057d,_0x32ce3){return new BPromise(function(_0x523531,_0xca0407){return client['request'](_0x57490f,_0x32ce3)['then'](function(_0x207805){logger['info'](_0x0a80('0xd'),_0x11057d,_0x0a80('0xe'));logger['debug'](_0x0a80('0xf'),_0x11057d,_0x0a80('0xe'),JSON[_0x0a80('0x10')](_0x207805));if(_0x207805[_0x0a80('0x11')]){if(_0x207805[_0x0a80('0x11')]['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x11057d,_0x207805[_0x0a80('0x11')][_0x0a80('0x12')]);return _0xca0407(_0x207805['error'][_0x0a80('0x12')]);}logger['error'](_0x0a80('0xd'),_0x11057d,_0x207805[_0x0a80('0x11')]['message']);return _0x523531(_0x207805['error'][_0x0a80('0x12')]);}else{logger[_0x0a80('0x13')](_0x0a80('0xd'),_0x11057d,_0x0a80('0xe'));_0x523531(_0x207805['result'][_0x0a80('0x12')]);}})[_0x0a80('0x14')](function(_0x50cd7c){logger[_0x0a80('0x11')](_0x0a80('0xd'),_0x11057d,_0x50cd7c);_0xca0407(_0x50cd7c);});});}exports[_0x0a80('0x15')]=function(_0x2807ec){var _0x2162a6=this;return new Promise(function(_0x3f80e5,_0x146bf5){return db[_0x0a80('0x16')][_0x0a80('0x17')]({'raw':_0x2807ec[_0x0a80('0x18')]?_0x2807ec[_0x0a80('0x18')][_0x0a80('0x19')]===undefined?!![]:![]:!![],'where':_0x2807ec[_0x0a80('0x18')]?_0x2807ec[_0x0a80('0x18')][_0x0a80('0x1a')]||null:null,'attributes':_0x2807ec[_0x0a80('0x18')]?_0x2807ec[_0x0a80('0x18')][_0x0a80('0x1b')]||null:null,'include':_0x2807ec[_0x0a80('0x18')]?_0x2807ec[_0x0a80('0x18')]['include']?_[_0x0a80('0x1c')](_0x2807ec['options'][_0x0a80('0x1d')],function(_0xee525d){return{'model':db[_0xee525d[_0x0a80('0x1e')]],'as':_0xee525d['as'],'attributes':_0xee525d[_0x0a80('0x1b')],'include':_0xee525d[_0x0a80('0x1d')]?_[_0x0a80('0x1c')](_0xee525d[_0x0a80('0x1d')],function(_0x400131){return{'model':db[_0x400131[_0x0a80('0x1e')]],'as':_0x400131['as'],'attributes':_0x400131[_0x0a80('0x1b')],'include':_0x400131[_0x0a80('0x1d')]?_[_0x0a80('0x1c')](_0x400131['include'],function(_0x54bdf1){return{'model':db[_0x54bdf1[_0x0a80('0x1e')]],'as':_0x54bdf1['as'],'attributes':_0x54bdf1[_0x0a80('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0a80('0x1f')](function(_0x13f9a0){logger[_0x0a80('0x13')](_0x0a80('0x15'),_0x2807ec);logger['debug']('ShowSound',_0x2807ec,JSON[_0x0a80('0x10')](_0x13f9a0));_0x3f80e5(_0x13f9a0);})['catch'](function(_0x28417d){logger[_0x0a80('0x11')](_0x0a80('0x15'),_0x28417d[_0x0a80('0x12')],_0x2807ec);_0x146bf5(_0x2162a6[_0x0a80('0x11')](0x1f4,_0x28417d[_0x0a80('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 7cf0097..c69405b 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x4fc2,0x111));var _0x24fc=function(_0x1d0d2b,_0x41539b){_0x1d0d2b=_0x1d0d2b-0x0;var _0x32f442=_0x4fc2[_0x1d0d2b];return _0x32f442;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b6f17,_0xab42e1){_0x5b6f17=_0x5b6f17-0x0;var _0x828ce=_0x9ffd[_0x5b6f17];return _0x828ce;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index bb52807..f0b4a7b 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 _0xb7df=['exports','STRING','TEXT','medium','ENUM','out'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb7df,0x66));var _0xfb7d=function(_0x46b6ec,_0x19e3f9){_0x46b6ec=_0x46b6ec-0x0;var _0x14cf34=_0xb7df[_0x46b6ec];return _0x14cf34;};'use strict';var Sequelize=require('sequelize');module[_0xfb7d('0x0')]={'uniqueid':{'type':Sequelize[_0xfb7d('0x1')]},'body':{'type':Sequelize[_0xfb7d('0x2')](_0xfb7d('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xfb7d('0x4')]('in',_0xfb7d('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xfb7d('0x1')]},'providerResponse':{'type':Sequelize[_0xfb7d('0x2')]}}; \ No newline at end of file +var _0xf77a=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x45bfe2,_0x1fe210){var _0xae9450=function(_0x1615bd){while(--_0x1615bd){_0x45bfe2['push'](_0x45bfe2['shift']());}};_0xae9450(++_0x1fe210);}(_0xf77a,0x112));var _0xaf77=function(_0x18ef1d,_0x290527){_0x18ef1d=_0x18ef1d-0x0;var _0x416e96=_0xf77a[_0x18ef1d];return _0x416e96;};'use strict';var Sequelize=require(_0xaf77('0x0'));module[_0xaf77('0x1')]={'uniqueid':{'type':Sequelize[_0xaf77('0x2')]},'body':{'type':Sequelize[_0xaf77('0x3')](_0xaf77('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xaf77('0x5')]('in',_0xaf77('0x6')),'defaultValue':_0xaf77('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xaf77('0x2')]},'providerResponse':{'type':Sequelize[_0xaf77('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index dcb2777..8950e9f 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 _0xafa7=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','json','apply','save','update','then','error','stack','name','index','SquareMessage','rawAttributes','type','key','model','map','keys','intersection','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x2cbdbf,_0x3ea795){var _0x50ddf8=function(_0x1b4839){while(--_0x1b4839){_0x2cbdbf['push'](_0x2cbdbf['shift']());}};_0x50ddf8(++_0x3ea795);}(_0xafa7,0x122));var _0x7afa=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xafa7[_0x13843f];return _0x1063ae;};'use strict';var emlformat=require(_0x7afa('0x0'));var rimraf=require(_0x7afa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7afa('0x2'));var rp=require('request-promise');var moment=require(_0x7afa('0x3'));var BPromise=require(_0x7afa('0x4'));var Mustache=require(_0x7afa('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7afa('0x6'));var csv=require(_0x7afa('0x7'));var ejs=require(_0x7afa('0x8'));var fs=require('fs');var fs_extra=require(_0x7afa('0x9'));var _=require(_0x7afa('0xa'));var squel=require(_0x7afa('0xb'));var crypto=require('crypto');var jsforce=require(_0x7afa('0xc'));var deskjs=require(_0x7afa('0xd'));var toCsv=require(_0x7afa('0x7'));var querystring=require(_0x7afa('0xe'));var Papa=require(_0x7afa('0xf'));var Redis=require(_0x7afa('0x10'));var authService=require(_0x7afa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7afa('0x12'));var hardwareService=require(_0x7afa('0x13'));var logger=require(_0x7afa('0x14'))(_0x7afa('0x15'));var utils=require(_0x7afa('0x16'));var config=require(_0x7afa('0x17'));var licenseUtil=require(_0x7afa('0x18'));var db=require(_0x7afa('0x19'))['db'];function respondWithStatusCode(_0x55c39e,_0x4b4c40){_0x4b4c40=_0x4b4c40||0xcc;return function(_0x4ee7bc){if(_0x4ee7bc){return _0x55c39e[_0x7afa('0x1a')](_0x4b4c40);}return _0x55c39e[_0x7afa('0x1b')](_0x4b4c40)[_0x7afa('0x1c')]();};}function respondWithResult(_0x5413ba,_0x371cfa){_0x371cfa=_0x371cfa||0xc8;return function(_0xdc8cbc){if(_0xdc8cbc){return _0x5413ba[_0x7afa('0x1b')](_0x371cfa)['json'](_0xdc8cbc);}};}function respondWithFilteredResult(_0x5557b7,_0x20f69c){return function(_0x4bcef2){if(_0x4bcef2){var _0x1bfb56=typeof _0x20f69c['offset']==='undefined'&&typeof _0x20f69c[_0x7afa('0x1d')]===_0x7afa('0x1e');var _0x295eff=_0x4bcef2[_0x7afa('0x1f')];var _0x482654=_0x1bfb56?0x0:_0x20f69c[_0x7afa('0x20')];var _0x402c41=_0x1bfb56?_0x4bcef2[_0x7afa('0x1f')]:_0x20f69c['offset']+_0x20f69c['limit'];var _0x2421c3;if(_0x402c41>=_0x295eff){_0x402c41=_0x295eff;_0x2421c3=0xc8;}else{_0x2421c3=0xce;}_0x5557b7[_0x7afa('0x1b')](_0x2421c3);return _0x5557b7['set']('Content-Range',_0x482654+'-'+_0x402c41+'/'+_0x295eff)[_0x7afa('0x21')](_0x4bcef2);}return null;};}function patchUpdates(_0x30aa81){return function(_0x277ada){try{jsonpatch[_0x7afa('0x22')](_0x277ada,_0x30aa81,!![]);}catch(_0xbd08be){return BPromise['reject'](_0xbd08be);}return _0x277ada[_0x7afa('0x23')]();};}function saveUpdates(_0x2e21f0,_0xdf72bb){return function(_0x27181a){if(_0x27181a){return _0x27181a[_0x7afa('0x24')](_0x2e21f0)[_0x7afa('0x25')](function(_0x5a2d3c){return _0x5a2d3c;});}return null;};}function removeEntity(_0x14f327,_0x10e207){return function(_0x557f59){if(_0x557f59){return _0x557f59['destroy']()['then'](function(){_0x14f327['status'](0xcc)[_0x7afa('0x1c')]();});}};}function handleEntityNotFound(_0x377a8e,_0x399a06){return function(_0x26d0e0){if(!_0x26d0e0){_0x377a8e[_0x7afa('0x1a')](0x194);}return _0x26d0e0;};}function handleError(_0x169123,_0x28017c){_0x28017c=_0x28017c||0x1f4;return function(_0x2810ee){logger[_0x7afa('0x26')](_0x2810ee[_0x7afa('0x27')]);if(_0x2810ee[_0x7afa('0x28')]){delete _0x2810ee[_0x7afa('0x28')];}_0x169123[_0x7afa('0x1b')](_0x28017c)['send'](_0x2810ee);};}exports[_0x7afa('0x29')]=function(_0xbb3dff,_0x4604c6){var _0x4af79a={},_0x37517a={},_0x24e0c={'count':0x0,'rows':[]};var _0xc5f677=_['map'](db[_0x7afa('0x2a')][_0x7afa('0x2b')],function(_0x3268b9){return{'name':_0x3268b9['fieldName'],'type':_0x3268b9[_0x7afa('0x2c')][_0x7afa('0x2d')]};});_0x37517a[_0x7afa('0x2e')]=_[_0x7afa('0x2f')](_0xc5f677,_0x7afa('0x28'));_0x37517a['query']=_[_0x7afa('0x30')](_0xbb3dff['query']);_0x37517a['filters']=_[_0x7afa('0x31')](_0x37517a[_0x7afa('0x2e')],_0x37517a[_0x7afa('0x32')]);_0x4af79a[_0x7afa('0x33')]=_[_0x7afa('0x31')](_0x37517a['model'],qs[_0x7afa('0x34')](_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x34')]));_0x4af79a[_0x7afa('0x33')]=_0x4af79a[_0x7afa('0x33')][_0x7afa('0x35')]?_0x4af79a[_0x7afa('0x33')]:_0x37517a[_0x7afa('0x2e')];if(!_0xbb3dff[_0x7afa('0x32')]['hasOwnProperty'](_0x7afa('0x36'))){_0x4af79a[_0x7afa('0x1d')]=qs['limit'](_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x1d')]);_0x4af79a[_0x7afa('0x20')]=qs[_0x7afa('0x20')](_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x20')]);}_0x4af79a[_0x7afa('0x37')]=qs[_0x7afa('0x38')](_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x38')]);_0x4af79a['where']=qs[_0x7afa('0x39')](_[_0x7afa('0x3a')](_0xbb3dff[_0x7afa('0x32')],_0x37517a['filters']),_0xc5f677);if(_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x3b')]){_0x4af79a[_0x7afa('0x3c')]=_['merge'](_0x4af79a['where'],{'$or':_[_0x7afa('0x2f')](_0xc5f677,function(_0xb9a41){if(_0xb9a41[_0x7afa('0x2c')]!=='VIRTUAL'){var _0x5265b5={};_0x5265b5[_0xb9a41[_0x7afa('0x28')]]={'$like':'%'+_0xbb3dff[_0x7afa('0x32')]['filter']+'%'};return _0x5265b5;}})});}_0x4af79a=_[_0x7afa('0x3d')]({},_0x4af79a,_0xbb3dff[_0x7afa('0x3e')]);var _0x22aebe={'where':_0x4af79a[_0x7afa('0x3c')]};return db[_0x7afa('0x2a')][_0x7afa('0x1f')](_0x22aebe)[_0x7afa('0x25')](function(_0x1ae20c){_0x24e0c['count']=_0x1ae20c;if(_0xbb3dff[_0x7afa('0x32')][_0x7afa('0x3f')]){_0x4af79a[_0x7afa('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0x7afa('0x41')](_0x4af79a);})['then'](function(_0x505a41){_0x24e0c[_0x7afa('0x42')]=_0x505a41;return _0x24e0c;})['then'](respondWithFilteredResult(_0x4604c6,_0x4af79a))[_0x7afa('0x43')](handleError(_0x4604c6,null));};exports[_0x7afa('0x44')]=function(_0x5c4bc6,_0x27d8da){var _0xb8f47d={'raw':!![],'where':{'id':_0x5c4bc6[_0x7afa('0x45')]['id']}},_0x4cf36e={};_0x4cf36e['model']=_[_0x7afa('0x30')](db[_0x7afa('0x2a')][_0x7afa('0x2b')]);_0x4cf36e[_0x7afa('0x32')]=_[_0x7afa('0x30')](_0x5c4bc6[_0x7afa('0x32')]);_0x4cf36e[_0x7afa('0x39')]=_['intersection'](_0x4cf36e[_0x7afa('0x2e')],_0x4cf36e[_0x7afa('0x32')]);_0xb8f47d[_0x7afa('0x33')]=_[_0x7afa('0x31')](_0x4cf36e[_0x7afa('0x2e')],qs[_0x7afa('0x34')](_0x5c4bc6[_0x7afa('0x32')][_0x7afa('0x34')]));_0xb8f47d[_0x7afa('0x33')]=_0xb8f47d[_0x7afa('0x33')][_0x7afa('0x35')]?_0xb8f47d[_0x7afa('0x33')]:_0x4cf36e['model'];if(_0x5c4bc6['query'][_0x7afa('0x3f')]){_0xb8f47d[_0x7afa('0x40')]=[{'all':!![]}];}_0xb8f47d=_[_0x7afa('0x3d')]({},_0xb8f47d,_0x5c4bc6[_0x7afa('0x3e')]);return db[_0x7afa('0x2a')][_0x7afa('0x46')](_0xb8f47d)[_0x7afa('0x25')](handleEntityNotFound(_0x27d8da,null))[_0x7afa('0x25')](respondWithResult(_0x27d8da,null))[_0x7afa('0x43')](handleError(_0x27d8da,null));};exports[_0x7afa('0x47')]=function(_0x40dcac,_0x551ad8){return db[_0x7afa('0x2a')]['create'](_0x40dcac[_0x7afa('0x48')],{})[_0x7afa('0x25')](respondWithResult(_0x551ad8,0xc9))['catch'](handleError(_0x551ad8,null));};exports[_0x7afa('0x24')]=function(_0x1b4ef1,_0x17748c){if(_0x1b4ef1[_0x7afa('0x48')]['id']){delete _0x1b4ef1[_0x7afa('0x48')]['id'];}return db[_0x7afa('0x2a')][_0x7afa('0x46')]({'where':{'id':_0x1b4ef1[_0x7afa('0x45')]['id']}})['then'](handleEntityNotFound(_0x17748c,null))[_0x7afa('0x25')](saveUpdates(_0x1b4ef1['body'],null))[_0x7afa('0x25')](respondWithResult(_0x17748c,null))['catch'](handleError(_0x17748c,null));};exports[_0x7afa('0x49')]=function(_0x2b4e71,_0x2ba00e){return db['SquareMessage'][_0x7afa('0x46')]({'where':{'id':_0x2b4e71[_0x7afa('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ba00e,null))['then'](removeEntity(_0x2ba00e,null))[_0x7afa('0x43')](handleError(_0x2ba00e,null));}; \ No newline at end of file +var _0x18c9=['where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','map','SquareMessage','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x259e96,_0x40dada){var _0xb83c5e=function(_0x2408ae){while(--_0x2408ae){_0x259e96['push'](_0x259e96['shift']());}};_0xb83c5e(++_0x40dada);}(_0x18c9,0x13c));var _0x918c=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x18c9[_0x2a56ad];return _0x425175;};'use strict';var emlformat=require(_0x918c('0x0'));var rimraf=require(_0x918c('0x1'));var zipdir=require(_0x918c('0x2'));var jsonpatch=require(_0x918c('0x3'));var rp=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x918c('0x6'));var util=require(_0x918c('0x7'));var path=require('path');var sox=require(_0x918c('0x8'));var csv=require('to-csv');var ejs=require(_0x918c('0x9'));var fs=require('fs');var fs_extra=require(_0x918c('0xa'));var _=require(_0x918c('0xb'));var squel=require(_0x918c('0xc'));var crypto=require(_0x918c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x918c('0xf'));var Redis=require(_0x918c('0x10'));var authService=require(_0x918c('0x11'));var qs=require(_0x918c('0x12'));var as=require(_0x918c('0x13'));var hardwareService=require(_0x918c('0x14'));var logger=require(_0x918c('0x15'))(_0x918c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x918c('0x17'));var db=require(_0x918c('0x18'))['db'];function respondWithStatusCode(_0x1684e0,_0x18abb5){_0x18abb5=_0x18abb5||0xcc;return function(_0x3c8716){if(_0x3c8716){return _0x1684e0['sendStatus'](_0x18abb5);}return _0x1684e0[_0x918c('0x19')](_0x18abb5)[_0x918c('0x1a')]();};}function respondWithResult(_0xe5ba1e,_0x1204b3){_0x1204b3=_0x1204b3||0xc8;return function(_0x1bd619){if(_0x1bd619){return _0xe5ba1e[_0x918c('0x19')](_0x1204b3)[_0x918c('0x1b')](_0x1bd619);}};}function respondWithFilteredResult(_0x32729f,_0x38f3b5){return function(_0x50d54d){if(_0x50d54d){var _0x51b1bd=typeof _0x38f3b5['offset']==='undefined'&&typeof _0x38f3b5['limit']===_0x918c('0x1c');var _0x54f9fa=_0x50d54d[_0x918c('0x1d')];var _0x1cad82=_0x51b1bd?0x0:_0x38f3b5[_0x918c('0x1e')];var _0x53ac3c=_0x51b1bd?_0x50d54d['count']:_0x38f3b5[_0x918c('0x1e')]+_0x38f3b5[_0x918c('0x1f')];var _0x570482;if(_0x53ac3c>=_0x54f9fa){_0x53ac3c=_0x54f9fa;_0x570482=0xc8;}else{_0x570482=0xce;}_0x32729f[_0x918c('0x19')](_0x570482);return _0x32729f[_0x918c('0x20')](_0x918c('0x21'),_0x1cad82+'-'+_0x53ac3c+'/'+_0x54f9fa)[_0x918c('0x1b')](_0x50d54d);}return null;};}function patchUpdates(_0x5b7526){return function(_0xcfd3e6){try{jsonpatch[_0x918c('0x22')](_0xcfd3e6,_0x5b7526,!![]);}catch(_0x515cd6){return BPromise['reject'](_0x515cd6);}return _0xcfd3e6[_0x918c('0x23')]();};}function saveUpdates(_0x50cf49,_0x5c27d1){return function(_0x33d952){if(_0x33d952){return _0x33d952['update'](_0x50cf49)[_0x918c('0x24')](function(_0xf3252){return _0xf3252;});}return null;};}function removeEntity(_0x4f97be,_0x3780db){return function(_0x30fd1b){if(_0x30fd1b){return _0x30fd1b[_0x918c('0x25')]()[_0x918c('0x24')](function(){_0x4f97be['status'](0xcc)[_0x918c('0x1a')]();});}};}function handleEntityNotFound(_0x8577fe,_0x2f22f5){return function(_0x1b7f9c){if(!_0x1b7f9c){_0x8577fe[_0x918c('0x26')](0x194);}return _0x1b7f9c;};}function handleError(_0xebf958,_0x4cf95c){_0x4cf95c=_0x4cf95c||0x1f4;return function(_0xed8db9){logger[_0x918c('0x27')](_0xed8db9[_0x918c('0x28')]);if(_0xed8db9[_0x918c('0x29')]){delete _0xed8db9['name'];}_0xebf958[_0x918c('0x19')](_0x4cf95c)[_0x918c('0x2a')](_0xed8db9);};}exports['index']=function(_0x2af472,_0x2ffb5f){var _0x1f4f17={},_0x146579={},_0x1f1932={'count':0x0,'rows':[]};var _0x2a1a7e=_[_0x918c('0x2b')](db[_0x918c('0x2c')][_0x918c('0x2d')],function(_0x344bbb){return{'name':_0x344bbb['fieldName'],'type':_0x344bbb[_0x918c('0x2e')][_0x918c('0x2f')]};});_0x146579['model']=_['map'](_0x2a1a7e,_0x918c('0x29'));_0x146579[_0x918c('0x30')]=_[_0x918c('0x31')](_0x2af472['query']);_0x146579[_0x918c('0x32')]=_['intersection'](_0x146579[_0x918c('0x33')],_0x146579[_0x918c('0x30')]);_0x1f4f17[_0x918c('0x34')]=_[_0x918c('0x35')](_0x146579[_0x918c('0x33')],qs['fields'](_0x2af472[_0x918c('0x30')][_0x918c('0x36')]));_0x1f4f17[_0x918c('0x34')]=_0x1f4f17[_0x918c('0x34')][_0x918c('0x37')]?_0x1f4f17[_0x918c('0x34')]:_0x146579['model'];if(!_0x2af472['query'][_0x918c('0x38')]('nolimit')){_0x1f4f17[_0x918c('0x1f')]=qs['limit'](_0x2af472['query'][_0x918c('0x1f')]);_0x1f4f17[_0x918c('0x1e')]=qs[_0x918c('0x1e')](_0x2af472['query']['offset']);}_0x1f4f17[_0x918c('0x39')]=qs[_0x918c('0x3a')](_0x2af472['query'][_0x918c('0x3a')]);_0x1f4f17[_0x918c('0x3b')]=qs[_0x918c('0x32')](_[_0x918c('0x3c')](_0x2af472[_0x918c('0x30')],_0x146579['filters']),_0x2a1a7e);if(_0x2af472[_0x918c('0x30')][_0x918c('0x3d')]){_0x1f4f17['where']=_[_0x918c('0x3e')](_0x1f4f17['where'],{'$or':_[_0x918c('0x2b')](_0x2a1a7e,function(_0x5fc703){if(_0x5fc703['type']!==_0x918c('0x3f')){var _0x459caa={};_0x459caa[_0x5fc703[_0x918c('0x29')]]={'$like':'%'+_0x2af472[_0x918c('0x30')][_0x918c('0x3d')]+'%'};return _0x459caa;}})});}_0x1f4f17=_[_0x918c('0x3e')]({},_0x1f4f17,_0x2af472[_0x918c('0x40')]);var _0x1df3e6={'where':_0x1f4f17[_0x918c('0x3b')]};return db[_0x918c('0x2c')]['count'](_0x1df3e6)[_0x918c('0x24')](function(_0x3feb85){_0x1f1932[_0x918c('0x1d')]=_0x3feb85;if(_0x2af472[_0x918c('0x30')][_0x918c('0x41')]){_0x1f4f17['include']=[{'all':!![]}];}return db[_0x918c('0x2c')][_0x918c('0x42')](_0x1f4f17);})[_0x918c('0x24')](function(_0x944087){_0x1f1932[_0x918c('0x43')]=_0x944087;return _0x1f1932;})['then'](respondWithFilteredResult(_0x2ffb5f,_0x1f4f17))[_0x918c('0x44')](handleError(_0x2ffb5f,null));};exports[_0x918c('0x45')]=function(_0x12b4cd,_0x56b795){var _0x275adf={'raw':!![],'where':{'id':_0x12b4cd[_0x918c('0x46')]['id']}},_0x598f3d={};_0x598f3d[_0x918c('0x33')]=_[_0x918c('0x31')](db[_0x918c('0x2c')]['rawAttributes']);_0x598f3d[_0x918c('0x30')]=_[_0x918c('0x31')](_0x12b4cd[_0x918c('0x30')]);_0x598f3d[_0x918c('0x32')]=_['intersection'](_0x598f3d[_0x918c('0x33')],_0x598f3d[_0x918c('0x30')]);_0x275adf[_0x918c('0x34')]=_['intersection'](_0x598f3d[_0x918c('0x33')],qs['fields'](_0x12b4cd[_0x918c('0x30')][_0x918c('0x36')]));_0x275adf[_0x918c('0x34')]=_0x275adf[_0x918c('0x34')][_0x918c('0x37')]?_0x275adf[_0x918c('0x34')]:_0x598f3d[_0x918c('0x33')];if(_0x12b4cd[_0x918c('0x30')][_0x918c('0x41')]){_0x275adf['include']=[{'all':!![]}];}_0x275adf=_[_0x918c('0x3e')]({},_0x275adf,_0x12b4cd[_0x918c('0x40')]);return db[_0x918c('0x2c')][_0x918c('0x47')](_0x275adf)[_0x918c('0x24')](handleEntityNotFound(_0x56b795,null))[_0x918c('0x24')](respondWithResult(_0x56b795,null))['catch'](handleError(_0x56b795,null));};exports[_0x918c('0x48')]=function(_0x53fbde,_0x459505){return db[_0x918c('0x2c')][_0x918c('0x48')](_0x53fbde[_0x918c('0x49')],{})[_0x918c('0x24')](respondWithResult(_0x459505,0xc9))[_0x918c('0x44')](handleError(_0x459505,null));};exports[_0x918c('0x4a')]=function(_0x23bc40,_0xb637b4){if(_0x23bc40[_0x918c('0x49')]['id']){delete _0x23bc40['body']['id'];}return db[_0x918c('0x2c')][_0x918c('0x47')]({'where':{'id':_0x23bc40['params']['id']}})[_0x918c('0x24')](handleEntityNotFound(_0xb637b4,null))[_0x918c('0x24')](saveUpdates(_0x23bc40[_0x918c('0x49')],null))[_0x918c('0x24')](respondWithResult(_0xb637b4,null))[_0x918c('0x44')](handleError(_0xb637b4,null));};exports['destroy']=function(_0x4d9c76,_0x23d7f7){return db[_0x918c('0x2c')][_0x918c('0x47')]({'where':{'id':_0x4d9c76[_0x918c('0x46')]['id']}})['then'](handleEntityNotFound(_0x23d7f7,null))[_0x918c('0x24')](removeEntity(_0x23d7f7,null))[_0x918c('0x44')](handleError(_0x23d7f7,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3cc2532..7357436 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 _0x0556=['define','SquareMessage','lodash','util','../../config/logger','api','request-promise','path','rimraf','exports'];(function(_0x745eb0,_0xa9731f){var _0x2945ba=function(_0x199c26){while(--_0x199c26){_0x745eb0['push'](_0x745eb0['shift']());}};_0x2945ba(++_0xa9731f);}(_0x0556,0xd4));var _0x6055=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x0556[_0x48a96f];return _0x3ff3ef;};'use strict';var _=require(_0x6055('0x0'));var util=require(_0x6055('0x1'));var logger=require(_0x6055('0x2'))(_0x6055('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6055('0x4'));var fs=require('fs');var path=require(_0x6055('0x5'));var rimraf=require(_0x6055('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x6055('0x7')]=function(_0x899db7,_0x462654){return _0x899db7[_0x6055('0x8')](_0x6055('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2db=['api','moment','bluebird','path','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util'];(function(_0x3df2f8,_0x953861){var _0x3c8d6b=function(_0x293b64){while(--_0x293b64){_0x3df2f8['push'](_0x3df2f8['shift']());}};_0x3c8d6b(++_0x953861);}(_0xd2db,0x82));var _0xbd2d=function(_0x51c0ff,_0x5a0360){_0x51c0ff=_0x51c0ff-0x0;var _0x108321=_0xd2db[_0x51c0ff];return _0x108321;};'use strict';var _=require(_0xbd2d('0x0'));var util=require(_0xbd2d('0x1'));var logger=require('../../config/logger')(_0xbd2d('0x2'));var moment=require(_0xbd2d('0x3'));var BPromise=require(_0xbd2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd2d('0x5'));var rimraf=require('rimraf');var config=require(_0xbd2d('0x6'));var attributes=require(_0xbd2d('0x7'));module[_0xbd2d('0x8')]=function(_0x4b95e0,_0x3235b7){return _0x4b95e0[_0xbd2d('0x9')]('SquareMessage',attributes,{'tableName':_0xbd2d('0xa'),'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 42f807c..55241a1 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 _0x7d82=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','create','body','options','raw','then','CreateSquareMessage','moment','bluebird','randomstring'];(function(_0x57cb93,_0x103241){var _0x4c7f12=function(_0x293337){while(--_0x293337){_0x57cb93['push'](_0x57cb93['shift']());}};_0x4c7f12(++_0x103241);}(_0x7d82,0xed));var _0x27d8=function(_0x58ca9d,_0x2a62aa){_0x58ca9d=_0x58ca9d-0x0;var _0x4a4ce5=_0x7d82[_0x58ca9d];return _0x4a4ce5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27d8('0x0'));var BPromise=require(_0x27d8('0x1'));var rs=require(_0x27d8('0x2'));var fs=require('fs');var Redis=require(_0x27d8('0x3'));var db=require(_0x27d8('0x4'))['db'];var utils=require(_0x27d8('0x5'));var logger=require(_0x27d8('0x6'))(_0x27d8('0x7'));var config=require(_0x27d8('0x8'));var jayson=require(_0x27d8('0x9'));var client=jayson[_0x27d8('0xa')][_0x27d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a22e9,_0x365f17,_0x106711){return new BPromise(function(_0x181c0f,_0x4917cc){return client[_0x27d8('0xc')](_0x1a22e9,_0x106711)['then'](function(_0x413b6b){logger[_0x27d8('0xd')](_0x27d8('0xe'),_0x365f17,_0x27d8('0xf'));logger[_0x27d8('0x10')](_0x27d8('0x11'),_0x365f17,_0x27d8('0xf'),JSON[_0x27d8('0x12')](_0x413b6b));if(_0x413b6b['error']){if(_0x413b6b['error'][_0x27d8('0x13')]===0x1f4){logger[_0x27d8('0x14')]('SquareMessage,\x20%s,\x20%s',_0x365f17,_0x413b6b[_0x27d8('0x14')][_0x27d8('0x15')]);return _0x4917cc(_0x413b6b['error'][_0x27d8('0x15')]);}logger[_0x27d8('0x14')]('SquareMessage,\x20%s,\x20%s',_0x365f17,_0x413b6b[_0x27d8('0x14')][_0x27d8('0x15')]);return _0x181c0f(_0x413b6b[_0x27d8('0x14')]['message']);}else{logger['info'](_0x27d8('0xe'),_0x365f17,_0x27d8('0xf'));_0x181c0f(_0x413b6b[_0x27d8('0x16')]['message']);}})[_0x27d8('0x17')](function(_0x3a2b06){logger[_0x27d8('0x14')](_0x27d8('0xe'),_0x365f17,_0x3a2b06);_0x4917cc(_0x3a2b06);});});}exports['CreateSquareMessage']=function(_0x4ec817){var _0x10cbe3=this;return new Promise(function(_0x3951d3,_0x5d9a4e){return db['SquareMessage'][_0x27d8('0x18')](_0x4ec817[_0x27d8('0x19')],{'raw':_0x4ec817[_0x27d8('0x1a')]?_0x4ec817['options'][_0x27d8('0x1b')]===undefined?!![]:![]:!![]})[_0x27d8('0x1c')](function(_0x4457da){logger[_0x27d8('0xd')](_0x27d8('0x1d'),_0x4ec817);logger['debug'](_0x27d8('0x1d'),_0x4ec817,JSON[_0x27d8('0x12')](_0x4457da));_0x3951d3(_0x4457da);})[_0x27d8('0x17')](function(_0x619e8c){logger['error'](_0x27d8('0x1d'),_0x619e8c[_0x27d8('0x15')],_0x4ec817);_0x5d9a4e(_0x10cbe3[_0x27d8('0x14')](0x1f4,_0x619e8c[_0x27d8('0x15')]));});});}; \ No newline at end of file +var _0xd3c4=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','SquareMessage','body','options','CreateSquareMessage','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','SquareMessage,\x20%s,\x20%s'];(function(_0x4aec45,_0x399662){var _0x7a6365=function(_0x301ef0){while(--_0x301ef0){_0x4aec45['push'](_0x4aec45['shift']());}};_0x7a6365(++_0x399662);}(_0xd3c4,0x19e));var _0x4d3c=function(_0x43eb87,_0x11586e){_0x43eb87=_0x43eb87-0x0;var _0x3d7b97=_0xd3c4[_0x43eb87];return _0x3d7b97;};'use strict';var _=require(_0x4d3c('0x0'));var util=require(_0x4d3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d3c('0x2'));var fs=require('fs');var Redis=require(_0x4d3c('0x3'));var db=require(_0x4d3c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d3c('0x5'))('rpc');var config=require(_0x4d3c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4d3c('0x7')][_0x4d3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337651,_0x1fac37,_0x10b4f6){return new BPromise(function(_0x28f23c,_0x3b0d37){return client['request'](_0x337651,_0x10b4f6)[_0x4d3c('0x9')](function(_0x3b5037){logger['info'](_0x4d3c('0xa'),_0x1fac37,'request\x20sent');logger[_0x4d3c('0xb')](_0x4d3c('0xc'),_0x1fac37,'request\x20sent',JSON[_0x4d3c('0xd')](_0x3b5037));if(_0x3b5037[_0x4d3c('0xe')]){if(_0x3b5037[_0x4d3c('0xe')][_0x4d3c('0xf')]===0x1f4){logger[_0x4d3c('0xe')](_0x4d3c('0xa'),_0x1fac37,_0x3b5037[_0x4d3c('0xe')][_0x4d3c('0x10')]);return _0x3b0d37(_0x3b5037[_0x4d3c('0xe')][_0x4d3c('0x10')]);}logger[_0x4d3c('0xe')](_0x4d3c('0xa'),_0x1fac37,_0x3b5037[_0x4d3c('0xe')][_0x4d3c('0x10')]);return _0x28f23c(_0x3b5037['error'][_0x4d3c('0x10')]);}else{logger[_0x4d3c('0x11')](_0x4d3c('0xa'),_0x1fac37,_0x4d3c('0x12'));_0x28f23c(_0x3b5037[_0x4d3c('0x13')]['message']);}})[_0x4d3c('0x14')](function(_0x3afe15){logger[_0x4d3c('0xe')](_0x4d3c('0xa'),_0x1fac37,_0x3afe15);_0x3b0d37(_0x3afe15);});});}exports['CreateSquareMessage']=function(_0x1d7a14){var _0x3e6fbe=this;return new Promise(function(_0x2f5f0d,_0x3f591f){return db[_0x4d3c('0x15')]['create'](_0x1d7a14[_0x4d3c('0x16')],{'raw':_0x1d7a14[_0x4d3c('0x17')]?_0x1d7a14[_0x4d3c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x4d3c('0x9')](function(_0x420f03){logger[_0x4d3c('0x11')](_0x4d3c('0x18'),_0x1d7a14);logger[_0x4d3c('0xb')]('CreateSquareMessage',_0x1d7a14,JSON[_0x4d3c('0xd')](_0x420f03));_0x2f5f0d(_0x420f03);})[_0x4d3c('0x14')](function(_0x189fef){logger[_0x4d3c('0xe')]('CreateSquareMessage',_0x189fef[_0x4d3c('0x10')],_0x1d7a14);_0x3f591f(_0x3e6fbe['error'](0x1f4,_0x189fef[_0x4d3c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index cf314b5..06fb813 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 _0x589a=['multer','path','express','Router','../../components/interaction/service','./squareOdbc.controller','isAuthenticated','/:id','show','get','15s','post','put','update','destroy'];(function(_0x855fcf,_0x1134b3){var _0x478066=function(_0x2a9a90){while(--_0x2a9a90){_0x855fcf['push'](_0x855fcf['shift']());}};_0x478066(++_0x1134b3);}(_0x589a,0x195));var _0xa589=function(_0x363af4,_0x3f057d){_0x363af4=_0x363af4-0x0;var _0x24bbf2=_0x589a[_0x363af4];return _0x24bbf2;};'use strict';var multer=require(_0xa589('0x0'));var util=require('util');var path=require(_0xa589('0x1'));var timeout=require('connect-timeout');var express=require(_0xa589('0x2'));var router=express[_0xa589('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa589('0x4'));var config=require('../../config/environment');var controller=require(_0xa589('0x5'));router['get']('/',auth[_0xa589('0x6')](),controller['index']);router['get'](_0xa589('0x7'),auth['isAuthenticated'](),controller[_0xa589('0x8')]);router[_0xa589('0x9')]('/:id/test',auth[_0xa589('0x6')](),timeout(_0xa589('0xa')),controller['test']);router[_0xa589('0xb')]('/',auth[_0xa589('0x6')](),controller['create']);router[_0xa589('0xc')](_0xa589('0x7'),auth[_0xa589('0x6')](),controller[_0xa589('0xd')]);router['delete'](_0xa589('0x7'),auth[_0xa589('0x6')](),controller[_0xa589('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe205=['Router','fs-extra','./squareOdbc.controller','get','isAuthenticated','/:id','/:id/test','15s','test','post','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xe205,0xf8));var _0x5e20=function(_0x3d8243,_0x431106){_0x3d8243=_0x3d8243-0x0;var _0x140fb4=_0xe205[_0x3d8243];return _0x140fb4;};'use strict';var multer=require(_0x5e20('0x0'));var util=require('util');var path=require(_0x5e20('0x1'));var timeout=require(_0x5e20('0x2'));var express=require(_0x5e20('0x3'));var router=express[_0x5e20('0x4')]();var fs_extra=require(_0x5e20('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5e20('0x6'));router[_0x5e20('0x7')]('/',auth[_0x5e20('0x8')](),controller['index']);router[_0x5e20('0x7')](_0x5e20('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5e20('0x7')](_0x5e20('0xa'),auth[_0x5e20('0x8')](),timeout(_0x5e20('0xb')),controller[_0x5e20('0xc')]);router[_0x5e20('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5e20('0xe')]('/:id',auth[_0x5e20('0x8')](),controller[_0x5e20('0xf')]);router[_0x5e20('0x10')](_0x5e20('0x9'),auth[_0x5e20('0x8')](),controller['destroy']);module[_0x5e20('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c902f61..1053cf4 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 _0x414b=['exports','STRING'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x414b,0x1c4));var _0xb414=function(_0x47f345,_0xb20c7e){_0x47f345=_0x47f345-0x0;var _0x1d9cf5=_0x414b[_0x47f345];return _0x1d9cf5;};'use strict';var Sequelize=require('sequelize');module[_0xb414('0x0')]={'name':{'type':Sequelize[_0xb414('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xb414('0x1')]},'description':{'type':Sequelize[_0xb414('0x1')]}}; \ No newline at end of file +var _0x8652=['exports','STRING','name','sequelize'];(function(_0x27f377,_0x538d21){var _0x5d31a5=function(_0x2d30df){while(--_0x2d30df){_0x27f377['push'](_0x27f377['shift']());}};_0x5d31a5(++_0x538d21);}(_0x8652,0x177));var _0x2865=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x8652[_0x2678d6];return _0x475503;};'use strict';var Sequelize=require(_0x2865('0x0'));module[_0x2865('0x1')]={'name':{'type':Sequelize[_0x2865('0x2')],'unique':_0x2865('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2865('0x2')]},'description':{'type':Sequelize[_0x2865('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8d5b200..8fc72d1 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 _0x46ff=['name','send','index','SquareOdbc','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','include','findAll','catch','show','params','includeAll','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','stack'];(function(_0x4fd524,_0x3ca2dd){var _0x1f81b0=function(_0x4be4eb){while(--_0x4be4eb){_0x4fd524['push'](_0x4fd524['shift']());}};_0x1f81b0(++_0x3ca2dd);}(_0x46ff,0x187));var _0xf46f=function(_0x6609fb,_0x2d26b7){_0x6609fb=_0x6609fb-0x0;var _0x354e59=_0x46ff[_0x6609fb];return _0x354e59;};'use strict';var emlformat=require(_0xf46f('0x0'));var rimraf=require(_0xf46f('0x1'));var zipdir=require(_0xf46f('0x2'));var jsonpatch=require(_0xf46f('0x3'));var rp=require('request-promise');var moment=require(_0xf46f('0x4'));var BPromise=require(_0xf46f('0x5'));var Mustache=require(_0xf46f('0x6'));var util=require(_0xf46f('0x7'));var path=require(_0xf46f('0x8'));var sox=require('sox');var csv=require(_0xf46f('0x9'));var ejs=require(_0xf46f('0xa'));var fs=require('fs');var fs_extra=require(_0xf46f('0xb'));var _=require('lodash');var squel=require(_0xf46f('0xc'));var crypto=require(_0xf46f('0xd'));var jsforce=require(_0xf46f('0xe'));var deskjs=require(_0xf46f('0xf'));var toCsv=require(_0xf46f('0x9'));var querystring=require(_0xf46f('0x10'));var Papa=require(_0xf46f('0x11'));var Redis=require('ioredis');var authService=require(_0xf46f('0x12'));var qs=require(_0xf46f('0x13'));var as=require(_0xf46f('0x14'));var hardwareService=require(_0xf46f('0x15'));var logger=require('../../config/logger')(_0xf46f('0x16'));var utils=require(_0xf46f('0x17'));var config=require(_0xf46f('0x18'));var licenseUtil=require(_0xf46f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x437565,_0x23eb78){_0x23eb78=_0x23eb78||0xcc;return function(_0x1158a1){if(_0x1158a1){return _0x437565[_0xf46f('0x1a')](_0x23eb78);}return _0x437565[_0xf46f('0x1b')](_0x23eb78)['end']();};}function respondWithResult(_0x5a20cd,_0x34b88c){_0x34b88c=_0x34b88c||0xc8;return function(_0x220fee){if(_0x220fee){return _0x5a20cd[_0xf46f('0x1b')](_0x34b88c)[_0xf46f('0x1c')](_0x220fee);}};}function respondWithFilteredResult(_0x578cf1,_0x543141){return function(_0x3aedc4){if(_0x3aedc4){var _0x18c49e=typeof _0x543141[_0xf46f('0x1d')]===_0xf46f('0x1e')&&typeof _0x543141[_0xf46f('0x1f')]===_0xf46f('0x1e');var _0x149973=_0x3aedc4[_0xf46f('0x20')];var _0x45d64e=_0x18c49e?0x0:_0x543141[_0xf46f('0x1d')];var _0xa746ab=_0x18c49e?_0x3aedc4[_0xf46f('0x20')]:_0x543141[_0xf46f('0x1d')]+_0x543141[_0xf46f('0x1f')];var _0x25cf38;if(_0xa746ab>=_0x149973){_0xa746ab=_0x149973;_0x25cf38=0xc8;}else{_0x25cf38=0xce;}_0x578cf1['status'](_0x25cf38);return _0x578cf1['set'](_0xf46f('0x21'),_0x45d64e+'-'+_0xa746ab+'/'+_0x149973)[_0xf46f('0x1c')](_0x3aedc4);}return null;};}function patchUpdates(_0x223d44){return function(_0x1ce49){try{jsonpatch['apply'](_0x1ce49,_0x223d44,!![]);}catch(_0x494e44){return BPromise[_0xf46f('0x22')](_0x494e44);}return _0x1ce49[_0xf46f('0x23')]();};}function saveUpdates(_0x191bfd,_0x583fcf){return function(_0x3f9ce3){if(_0x3f9ce3){return _0x3f9ce3[_0xf46f('0x24')](_0x191bfd)[_0xf46f('0x25')](function(_0x2bcc6d){return _0x2bcc6d;});}return null;};}function removeEntity(_0x48c887,_0x349926){return function(_0x400aab){if(_0x400aab){return _0x400aab[_0xf46f('0x26')]()[_0xf46f('0x25')](function(){var _0x632805=_0x400aab[_0xf46f('0x27')]({'plain':!![]});var _0x26eebf=_0xf46f('0x28');return db[_0xf46f('0x29')][_0xf46f('0x26')]({'where':{'type':_0x26eebf,'resourceId':_0x632805['id']}})['then'](function(){return _0x400aab;});})['then'](function(){_0x48c887[_0xf46f('0x1b')](0xcc)[_0xf46f('0x2a')]();});}};}function handleEntityNotFound(_0x161374,_0x5f509e){return function(_0x161508){if(!_0x161508){_0x161374[_0xf46f('0x1a')](0x194);}return _0x161508;};}function handleError(_0x495583,_0x32986b){_0x32986b=_0x32986b||0x1f4;return function(_0x21a8a3){logger['error'](_0x21a8a3[_0xf46f('0x2b')]);if(_0x21a8a3['name']){delete _0x21a8a3[_0xf46f('0x2c')];}_0x495583[_0xf46f('0x1b')](_0x32986b)[_0xf46f('0x2d')](_0x21a8a3);};}exports[_0xf46f('0x2e')]=function(_0x4f41ca,_0x4a7312){var _0x5ab561={},_0x616c0e={},_0x787464={'count':0x0,'rows':[]};var _0x14f1fa=_['map'](db[_0xf46f('0x2f')][_0xf46f('0x30')],function(_0x126a77){return{'name':_0x126a77[_0xf46f('0x31')],'type':_0x126a77['type'][_0xf46f('0x32')]};});_0x616c0e[_0xf46f('0x33')]=_[_0xf46f('0x34')](_0x14f1fa,_0xf46f('0x2c'));_0x616c0e[_0xf46f('0x35')]=_[_0xf46f('0x36')](_0x4f41ca[_0xf46f('0x35')]);_0x616c0e[_0xf46f('0x37')]=_['intersection'](_0x616c0e[_0xf46f('0x33')],_0x616c0e[_0xf46f('0x35')]);_0x5ab561[_0xf46f('0x38')]=_[_0xf46f('0x39')](_0x616c0e['model'],qs[_0xf46f('0x3a')](_0x4f41ca[_0xf46f('0x35')][_0xf46f('0x3a')]));_0x5ab561['attributes']=_0x5ab561[_0xf46f('0x38')][_0xf46f('0x3b')]?_0x5ab561[_0xf46f('0x38')]:_0x616c0e[_0xf46f('0x33')];if(!_0x4f41ca['query'][_0xf46f('0x3c')](_0xf46f('0x3d'))){_0x5ab561[_0xf46f('0x1f')]=qs[_0xf46f('0x1f')](_0x4f41ca[_0xf46f('0x35')][_0xf46f('0x1f')]);_0x5ab561['offset']=qs['offset'](_0x4f41ca[_0xf46f('0x35')][_0xf46f('0x1d')]);}_0x5ab561['order']=qs[_0xf46f('0x3e')](_0x4f41ca[_0xf46f('0x35')]['sort']);_0x5ab561['where']=qs[_0xf46f('0x37')](_[_0xf46f('0x3f')](_0x4f41ca['query'],_0x616c0e[_0xf46f('0x37')]),_0x14f1fa);if(_0x4f41ca[_0xf46f('0x35')][_0xf46f('0x40')]){_0x5ab561[_0xf46f('0x41')]=_[_0xf46f('0x42')](_0x5ab561[_0xf46f('0x41')],{'$or':_[_0xf46f('0x34')](_0x14f1fa,function(_0x21f0a8){if(_0x21f0a8[_0xf46f('0x43')]!=='VIRTUAL'){var _0x26bcbf={};_0x26bcbf[_0x21f0a8[_0xf46f('0x2c')]]={'$like':'%'+_0x4f41ca['query'][_0xf46f('0x40')]+'%'};return _0x26bcbf;}})});}_0x5ab561=_[_0xf46f('0x42')]({},_0x5ab561,_0x4f41ca['options']);var _0x35f4ab={'where':_0x5ab561[_0xf46f('0x41')]};return db[_0xf46f('0x2f')][_0xf46f('0x20')](_0x35f4ab)[_0xf46f('0x25')](function(_0xb6a671){_0x787464[_0xf46f('0x20')]=_0xb6a671;if(_0x4f41ca[_0xf46f('0x35')]['includeAll']){_0x5ab561[_0xf46f('0x44')]=[{'all':!![]}];}return db[_0xf46f('0x2f')][_0xf46f('0x45')](_0x5ab561);})[_0xf46f('0x25')](function(_0x16b965){_0x787464['rows']=_0x16b965;return _0x787464;})[_0xf46f('0x25')](respondWithFilteredResult(_0x4a7312,_0x5ab561))[_0xf46f('0x46')](handleError(_0x4a7312,null));};exports[_0xf46f('0x47')]=function(_0x273ad0,_0x463167){var _0x49c5c={'raw':!![],'where':{'id':_0x273ad0[_0xf46f('0x48')]['id']}},_0xda2100={};_0xda2100[_0xf46f('0x33')]=_['keys'](db['SquareOdbc'][_0xf46f('0x30')]);_0xda2100[_0xf46f('0x35')]=_[_0xf46f('0x36')](_0x273ad0[_0xf46f('0x35')]);_0xda2100[_0xf46f('0x37')]=_['intersection'](_0xda2100['model'],_0xda2100[_0xf46f('0x35')]);_0x49c5c[_0xf46f('0x38')]=_['intersection'](_0xda2100[_0xf46f('0x33')],qs[_0xf46f('0x3a')](_0x273ad0[_0xf46f('0x35')]['fields']));_0x49c5c[_0xf46f('0x38')]=_0x49c5c['attributes'][_0xf46f('0x3b')]?_0x49c5c[_0xf46f('0x38')]:_0xda2100[_0xf46f('0x33')];if(_0x273ad0[_0xf46f('0x35')][_0xf46f('0x49')]){_0x49c5c[_0xf46f('0x44')]=[{'all':!![]}];}_0x49c5c=_[_0xf46f('0x42')]({},_0x49c5c,_0x273ad0[_0xf46f('0x4a')]);return db[_0xf46f('0x2f')][_0xf46f('0x4b')](_0x49c5c)[_0xf46f('0x25')](handleEntityNotFound(_0x463167,null))[_0xf46f('0x25')](respondWithResult(_0x463167,null))['catch'](handleError(_0x463167,null));};exports[_0xf46f('0x4c')]=function(_0x46c2ba,_0x42e03c){return db[_0xf46f('0x2f')][_0xf46f('0x4c')](_0x46c2ba[_0xf46f('0x4d')],{})[_0xf46f('0x25')](function(_0x35747c){var _0x5a1c2d=_0x46c2ba[_0xf46f('0x4e')][_0xf46f('0x27')]({'plain':!![]});if(!_0x5a1c2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a1c2d[_0xf46f('0x4f')]===_0xf46f('0x4e')){var _0x4ecd4c=_0x35747c[_0xf46f('0x27')]({'plain':!![]});var _0x1318ee='ODBC';return db['UserProfileSection'][_0xf46f('0x4b')]({'where':{'name':_0x1318ee,'userProfileId':_0x5a1c2d[_0xf46f('0x50')]},'raw':!![]})[_0xf46f('0x25')](function(_0x4f07de){if(_0x4f07de&&_0x4f07de[_0xf46f('0x51')]===0x0){return db[_0xf46f('0x29')][_0xf46f('0x4c')]({'name':_0x4ecd4c[_0xf46f('0x2c')],'resourceId':_0x4ecd4c['id'],'type':_0x4f07de[_0xf46f('0x2c')],'sectionId':_0x4f07de['id']},{})[_0xf46f('0x25')](function(){return _0x35747c;});}else{return _0x35747c;}})[_0xf46f('0x46')](function(_0x3a7810){logger['error'](_0xf46f('0x52'),_0x3a7810);throw _0x3a7810;});}return _0x35747c;})[_0xf46f('0x25')](respondWithResult(_0x42e03c,0xc9))['catch'](handleError(_0x42e03c,null));};exports['update']=function(_0x220a71,_0x22a58e){if(_0x220a71['body']['id']){delete _0x220a71[_0xf46f('0x4d')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x220a71['params']['id']}})[_0xf46f('0x25')](handleEntityNotFound(_0x22a58e,null))['then'](saveUpdates(_0x220a71[_0xf46f('0x4d')],null))['then'](respondWithResult(_0x22a58e,null))[_0xf46f('0x46')](handleError(_0x22a58e,null));};exports[_0xf46f('0x26')]=function(_0x3cb363,_0x5eed97){return db[_0xf46f('0x2f')][_0xf46f('0x4b')]({'where':{'id':_0x3cb363[_0xf46f('0x48')]['id']}})[_0xf46f('0x25')](handleEntityNotFound(_0x5eed97,null))[_0xf46f('0x25')](removeEntity(_0x5eed97,null))['catch'](handleError(_0x5eed97,null));};exports[_0xf46f('0x53')]=function(_0x6a71,_0x32385a,_0x53a6a4){var _0x5e6584;return db['SquareOdbc'][_0xf46f('0x4b')]({'where':{'id':_0x6a71[_0xf46f('0x48')]['id']},'attributes':['id',_0xf46f('0x54')]})['then'](handleEntityNotFound(_0x32385a,null))[_0xf46f('0x25')](function(_0x39b082){if(_0x39b082){var _0x8ae68=require(_0xf46f('0x55'))();_0x8ae68[_0xf46f('0x56')](_0x39b082[_0xf46f('0x54')]);_0x8ae68['closeSync']();return _0x39b082;}})[_0xf46f('0x25')](respondWithResult(_0x32385a,null))['catch'](handleError(_0x32385a,null));}; \ No newline at end of file +var _0x6c9a=['then','destroy','get','ODBC','end','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x6c9a,0x1f1));var _0xa6c9=function(_0x891ea2,_0x519698){_0x891ea2=_0x891ea2-0x0;var _0x367736=_0x6c9a[_0x891ea2];return _0x367736;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6c9('0x0'));var zipdir=require(_0xa6c9('0x1'));var jsonpatch=require(_0xa6c9('0x2'));var rp=require(_0xa6c9('0x3'));var moment=require(_0xa6c9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6c9('0x5'));var path=require(_0xa6c9('0x6'));var sox=require(_0xa6c9('0x7'));var csv=require(_0xa6c9('0x8'));var ejs=require(_0xa6c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa6c9('0xa'));var _=require(_0xa6c9('0xb'));var squel=require(_0xa6c9('0xc'));var crypto=require(_0xa6c9('0xd'));var jsforce=require(_0xa6c9('0xe'));var deskjs=require(_0xa6c9('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6c9('0x10'));var Redis=require(_0xa6c9('0x11'));var authService=require(_0xa6c9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa6c9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6c9('0x14'))(_0xa6c9('0x15'));var utils=require(_0xa6c9('0x16'));var config=require(_0xa6c9('0x17'));var licenseUtil=require(_0xa6c9('0x18'));var db=require(_0xa6c9('0x19'))['db'];function respondWithStatusCode(_0xbfa639,_0x49cd7e){_0x49cd7e=_0x49cd7e||0xcc;return function(_0x23e46c){if(_0x23e46c){return _0xbfa639['sendStatus'](_0x49cd7e);}return _0xbfa639[_0xa6c9('0x1a')](_0x49cd7e)['end']();};}function respondWithResult(_0x210e65,_0x37fb13){_0x37fb13=_0x37fb13||0xc8;return function(_0x38f874){if(_0x38f874){return _0x210e65[_0xa6c9('0x1a')](_0x37fb13)['json'](_0x38f874);}};}function respondWithFilteredResult(_0x5c627c,_0x33ca1a){return function(_0x155806){if(_0x155806){var _0x3374d0=typeof _0x33ca1a[_0xa6c9('0x1b')]===_0xa6c9('0x1c')&&typeof _0x33ca1a['limit']===_0xa6c9('0x1c');var _0x1ca8e3=_0x155806['count'];var _0x331647=_0x3374d0?0x0:_0x33ca1a[_0xa6c9('0x1b')];var _0x123e93=_0x3374d0?_0x155806[_0xa6c9('0x1d')]:_0x33ca1a['offset']+_0x33ca1a[_0xa6c9('0x1e')];var _0x4411fc;if(_0x123e93>=_0x1ca8e3){_0x123e93=_0x1ca8e3;_0x4411fc=0xc8;}else{_0x4411fc=0xce;}_0x5c627c[_0xa6c9('0x1a')](_0x4411fc);return _0x5c627c[_0xa6c9('0x1f')](_0xa6c9('0x20'),_0x331647+'-'+_0x123e93+'/'+_0x1ca8e3)[_0xa6c9('0x21')](_0x155806);}return null;};}function patchUpdates(_0x4043c2){return function(_0x53339){try{jsonpatch[_0xa6c9('0x22')](_0x53339,_0x4043c2,!![]);}catch(_0x3e07e6){return BPromise['reject'](_0x3e07e6);}return _0x53339[_0xa6c9('0x23')]();};}function saveUpdates(_0x4f20ea,_0xd5dbd0){return function(_0x3a8763){if(_0x3a8763){return _0x3a8763[_0xa6c9('0x24')](_0x4f20ea)[_0xa6c9('0x25')](function(_0x3112c6){return _0x3112c6;});}return null;};}function removeEntity(_0x5efdd3,_0xd7643a){return function(_0x565cb){if(_0x565cb){return _0x565cb[_0xa6c9('0x26')]()['then'](function(){var _0xc65af0=_0x565cb[_0xa6c9('0x27')]({'plain':!![]});var _0x1543c6=_0xa6c9('0x28');return db['UserProfileResource'][_0xa6c9('0x26')]({'where':{'type':_0x1543c6,'resourceId':_0xc65af0['id']}})[_0xa6c9('0x25')](function(){return _0x565cb;});})[_0xa6c9('0x25')](function(){_0x5efdd3[_0xa6c9('0x1a')](0xcc)[_0xa6c9('0x29')]();});}};}function handleEntityNotFound(_0x3628ae,_0x4d7de9){return function(_0x191105){if(!_0x191105){_0x3628ae[_0xa6c9('0x2a')](0x194);}return _0x191105;};}function handleError(_0x158f49,_0x5193a9){_0x5193a9=_0x5193a9||0x1f4;return function(_0x5db620){logger[_0xa6c9('0x2b')](_0x5db620[_0xa6c9('0x2c')]);if(_0x5db620[_0xa6c9('0x2d')]){delete _0x5db620['name'];}_0x158f49['status'](_0x5193a9)[_0xa6c9('0x2e')](_0x5db620);};}exports[_0xa6c9('0x2f')]=function(_0x1e29cd,_0x398621){var _0x1b3da0={},_0x10c4fd={},_0x37d793={'count':0x0,'rows':[]};var _0x6128de=_[_0xa6c9('0x30')](db[_0xa6c9('0x31')][_0xa6c9('0x32')],function(_0x4f8563){return{'name':_0x4f8563['fieldName'],'type':_0x4f8563[_0xa6c9('0x33')][_0xa6c9('0x34')]};});_0x10c4fd[_0xa6c9('0x35')]=_[_0xa6c9('0x30')](_0x6128de,_0xa6c9('0x2d'));_0x10c4fd[_0xa6c9('0x36')]=_[_0xa6c9('0x37')](_0x1e29cd[_0xa6c9('0x36')]);_0x10c4fd[_0xa6c9('0x38')]=_['intersection'](_0x10c4fd[_0xa6c9('0x35')],_0x10c4fd[_0xa6c9('0x36')]);_0x1b3da0[_0xa6c9('0x39')]=_[_0xa6c9('0x3a')](_0x10c4fd[_0xa6c9('0x35')],qs['fields'](_0x1e29cd[_0xa6c9('0x36')][_0xa6c9('0x3b')]));_0x1b3da0[_0xa6c9('0x39')]=_0x1b3da0['attributes'][_0xa6c9('0x3c')]?_0x1b3da0[_0xa6c9('0x39')]:_0x10c4fd[_0xa6c9('0x35')];if(!_0x1e29cd['query']['hasOwnProperty'](_0xa6c9('0x3d'))){_0x1b3da0[_0xa6c9('0x1e')]=qs['limit'](_0x1e29cd[_0xa6c9('0x36')][_0xa6c9('0x1e')]);_0x1b3da0[_0xa6c9('0x1b')]=qs['offset'](_0x1e29cd[_0xa6c9('0x36')]['offset']);}_0x1b3da0['order']=qs[_0xa6c9('0x3e')](_0x1e29cd[_0xa6c9('0x36')][_0xa6c9('0x3e')]);_0x1b3da0['where']=qs[_0xa6c9('0x38')](_[_0xa6c9('0x3f')](_0x1e29cd[_0xa6c9('0x36')],_0x10c4fd['filters']),_0x6128de);if(_0x1e29cd[_0xa6c9('0x36')]['filter']){_0x1b3da0[_0xa6c9('0x40')]=_[_0xa6c9('0x41')](_0x1b3da0[_0xa6c9('0x40')],{'$or':_[_0xa6c9('0x30')](_0x6128de,function(_0x36af51){if(_0x36af51[_0xa6c9('0x33')]!=='VIRTUAL'){var _0x303cca={};_0x303cca[_0x36af51[_0xa6c9('0x2d')]]={'$like':'%'+_0x1e29cd[_0xa6c9('0x36')][_0xa6c9('0x42')]+'%'};return _0x303cca;}})});}_0x1b3da0=_[_0xa6c9('0x41')]({},_0x1b3da0,_0x1e29cd[_0xa6c9('0x43')]);var _0x1e0836={'where':_0x1b3da0[_0xa6c9('0x40')]};return db[_0xa6c9('0x31')][_0xa6c9('0x1d')](_0x1e0836)['then'](function(_0x1ded48){_0x37d793[_0xa6c9('0x1d')]=_0x1ded48;if(_0x1e29cd[_0xa6c9('0x36')][_0xa6c9('0x44')]){_0x1b3da0[_0xa6c9('0x45')]=[{'all':!![]}];}return db[_0xa6c9('0x31')][_0xa6c9('0x46')](_0x1b3da0);})[_0xa6c9('0x25')](function(_0x233754){_0x37d793[_0xa6c9('0x47')]=_0x233754;return _0x37d793;})[_0xa6c9('0x25')](respondWithFilteredResult(_0x398621,_0x1b3da0))[_0xa6c9('0x48')](handleError(_0x398621,null));};exports['show']=function(_0x449125,_0x577631){var _0x164705={'raw':!![],'where':{'id':_0x449125[_0xa6c9('0x49')]['id']}},_0x48322e={};_0x48322e[_0xa6c9('0x35')]=_[_0xa6c9('0x37')](db[_0xa6c9('0x31')][_0xa6c9('0x32')]);_0x48322e['query']=_[_0xa6c9('0x37')](_0x449125[_0xa6c9('0x36')]);_0x48322e[_0xa6c9('0x38')]=_[_0xa6c9('0x3a')](_0x48322e[_0xa6c9('0x35')],_0x48322e[_0xa6c9('0x36')]);_0x164705[_0xa6c9('0x39')]=_[_0xa6c9('0x3a')](_0x48322e[_0xa6c9('0x35')],qs['fields'](_0x449125[_0xa6c9('0x36')][_0xa6c9('0x3b')]));_0x164705[_0xa6c9('0x39')]=_0x164705['attributes']['length']?_0x164705[_0xa6c9('0x39')]:_0x48322e[_0xa6c9('0x35')];if(_0x449125[_0xa6c9('0x36')][_0xa6c9('0x44')]){_0x164705[_0xa6c9('0x45')]=[{'all':!![]}];}_0x164705=_[_0xa6c9('0x41')]({},_0x164705,_0x449125[_0xa6c9('0x43')]);return db[_0xa6c9('0x31')][_0xa6c9('0x4a')](_0x164705)[_0xa6c9('0x25')](handleEntityNotFound(_0x577631,null))[_0xa6c9('0x25')](respondWithResult(_0x577631,null))[_0xa6c9('0x48')](handleError(_0x577631,null));};exports['create']=function(_0x4fd239,_0x4cd4e7){return db['SquareOdbc']['create'](_0x4fd239[_0xa6c9('0x4b')],{})[_0xa6c9('0x25')](function(_0x54ec0a){var _0x4f6130=_0x4fd239[_0xa6c9('0x4c')][_0xa6c9('0x27')]({'plain':!![]});if(!_0x4f6130)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f6130[_0xa6c9('0x4d')]==='user'){var _0x3d19b7=_0x54ec0a['get']({'plain':!![]});var _0x255aea='ODBC';return db[_0xa6c9('0x4e')][_0xa6c9('0x4a')]({'where':{'name':_0x255aea,'userProfileId':_0x4f6130[_0xa6c9('0x4f')]},'raw':!![]})['then'](function(_0x58841e){if(_0x58841e&&_0x58841e[_0xa6c9('0x50')]===0x0){return db[_0xa6c9('0x51')][_0xa6c9('0x52')]({'name':_0x3d19b7[_0xa6c9('0x2d')],'resourceId':_0x3d19b7['id'],'type':_0x58841e['name'],'sectionId':_0x58841e['id']},{})[_0xa6c9('0x25')](function(){return _0x54ec0a;});}else{return _0x54ec0a;}})[_0xa6c9('0x48')](function(_0x197d83){logger['error'](_0xa6c9('0x53'),_0x197d83);throw _0x197d83;});}return _0x54ec0a;})[_0xa6c9('0x25')](respondWithResult(_0x4cd4e7,0xc9))[_0xa6c9('0x48')](handleError(_0x4cd4e7,null));};exports[_0xa6c9('0x24')]=function(_0x3aece9,_0x44230e){if(_0x3aece9[_0xa6c9('0x4b')]['id']){delete _0x3aece9[_0xa6c9('0x4b')]['id'];}return db[_0xa6c9('0x31')][_0xa6c9('0x4a')]({'where':{'id':_0x3aece9[_0xa6c9('0x49')]['id']}})[_0xa6c9('0x25')](handleEntityNotFound(_0x44230e,null))['then'](saveUpdates(_0x3aece9[_0xa6c9('0x4b')],null))[_0xa6c9('0x25')](respondWithResult(_0x44230e,null))[_0xa6c9('0x48')](handleError(_0x44230e,null));};exports[_0xa6c9('0x26')]=function(_0x23b667,_0x2b70fb){return db[_0xa6c9('0x31')][_0xa6c9('0x4a')]({'where':{'id':_0x23b667[_0xa6c9('0x49')]['id']}})[_0xa6c9('0x25')](handleEntityNotFound(_0x2b70fb,null))['then'](removeEntity(_0x2b70fb,null))[_0xa6c9('0x48')](handleError(_0x2b70fb,null));};exports[_0xa6c9('0x54')]=function(_0x34dea8,_0x232267,_0x565289){var _0x312ea2;return db['SquareOdbc'][_0xa6c9('0x4a')]({'where':{'id':_0x34dea8[_0xa6c9('0x49')]['id']},'attributes':['id',_0xa6c9('0x55')]})['then'](handleEntityNotFound(_0x232267,null))[_0xa6c9('0x25')](function(_0x151346){if(_0x151346){var _0xf1eec=require(_0xa6c9('0x56'))();_0xf1eec[_0xa6c9('0x57')](_0x151346[_0xa6c9('0x55')]);_0xf1eec[_0xa6c9('0x58')]();return _0x151346;}})[_0xa6c9('0x25')](respondWithResult(_0x232267,null))[_0xa6c9('0x48')](handleError(_0x232267,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e1e4cae..0fb0f00 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 _0x0bf5=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0x2c1136,_0x5bdc39){var _0x4e3732=function(_0x55d953){while(--_0x55d953){_0x2c1136['push'](_0x2c1136['shift']());}};_0x4e3732(++_0x5bdc39);}(_0x0bf5,0x111));var _0x50bf=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0bf5[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x50bf('0x0'));var util=require(_0x50bf('0x1'));var logger=require(_0x50bf('0x2'))(_0x50bf('0x3'));var moment=require(_0x50bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x50bf('0x5'));var fs=require('fs');var path=require(_0x50bf('0x6'));var rimraf=require(_0x50bf('0x7'));var config=require(_0x50bf('0x8'));var attributes=require(_0x50bf('0x9'));module[_0x50bf('0xa')]=function(_0x17a59b,_0x126da1){return _0x17a59b['define'](_0x50bf('0xb'),attributes,{'tableName':_0x50bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cfa=['square_odbc','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x1c73ef,_0xbd6e2b){var _0x18b1b2=function(_0x40fbd9){while(--_0x40fbd9){_0x1c73ef['push'](_0x1c73ef['shift']());}};_0x18b1b2(++_0xbd6e2b);}(_0x3cfa,0x1b1));var _0xa3cf=function(_0x177860,_0xa5e960){_0x177860=_0x177860-0x0;var _0x3a92cf=_0x3cfa[_0x177860];return _0x3a92cf;};'use strict';var _=require(_0xa3cf('0x0'));var util=require('util');var logger=require(_0xa3cf('0x1'))(_0xa3cf('0x2'));var moment=require(_0xa3cf('0x3'));var BPromise=require(_0xa3cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3cf('0x5'));var rimraf=require(_0xa3cf('0x6'));var config=require(_0xa3cf('0x7'));var attributes=require(_0xa3cf('0x8'));module[_0xa3cf('0x9')]=function(_0x5e585c,_0x20fe75){return _0x5e585c[_0xa3cf('0xa')]('SquareOdbc',attributes,{'tableName':_0xa3cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 7942dd0..03b7e65 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 _0x79d5=['SquareOdbc','find','options','attributes','include','map','model','then','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowSquareOdbc'];(function(_0x5c07ff,_0x51e15e){var _0x11c18e=function(_0x56a725){while(--_0x56a725){_0x5c07ff['push'](_0x5c07ff['shift']());}};_0x11c18e(++_0x51e15e);}(_0x79d5,0x175));var _0x579d=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x79d5[_0x4bfcbe];return _0x5b65e6;};'use strict';var _=require(_0x579d('0x0'));var util=require(_0x579d('0x1'));var moment=require('moment');var BPromise=require(_0x579d('0x2'));var rs=require(_0x579d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x579d('0x4'))['db'];var utils=require(_0x579d('0x5'));var logger=require('../../config/logger')(_0x579d('0x6'));var config=require(_0x579d('0x7'));var jayson=require(_0x579d('0x8'));var client=jayson['client'][_0x579d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9cfb37,_0x40784e,_0x6f691b){return new BPromise(function(_0x2c5609,_0x544bf2){return client['request'](_0x9cfb37,_0x6f691b)['then'](function(_0x522372){logger['info'](_0x579d('0xa'),_0x40784e,_0x579d('0xb'));logger['debug'](_0x579d('0xc'),_0x40784e,_0x579d('0xb'),JSON['stringify'](_0x522372));if(_0x522372[_0x579d('0xd')]){if(_0x522372[_0x579d('0xd')][_0x579d('0xe')]===0x1f4){logger['error'](_0x579d('0xa'),_0x40784e,_0x522372[_0x579d('0xd')]['message']);return _0x544bf2(_0x522372['error'][_0x579d('0xf')]);}logger[_0x579d('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x40784e,_0x522372[_0x579d('0xd')][_0x579d('0xf')]);return _0x2c5609(_0x522372['error'][_0x579d('0xf')]);}else{logger[_0x579d('0x10')](_0x579d('0xa'),_0x40784e,_0x579d('0xb'));_0x2c5609(_0x522372['result'][_0x579d('0xf')]);}})[_0x579d('0x11')](function(_0x2ef616){logger[_0x579d('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x40784e,_0x2ef616);_0x544bf2(_0x2ef616);});});}exports[_0x579d('0x12')]=function(_0x374a85){var _0x2fd793=this;return new Promise(function(_0x78acee,_0x42a624){return db[_0x579d('0x13')][_0x579d('0x14')]({'raw':_0x374a85[_0x579d('0x15')]?_0x374a85['options']['raw']===undefined?!![]:![]:!![],'where':_0x374a85[_0x579d('0x15')]?_0x374a85['options']['where']||null:null,'attributes':_0x374a85[_0x579d('0x15')]?_0x374a85[_0x579d('0x15')][_0x579d('0x16')]||null:null,'include':_0x374a85[_0x579d('0x15')]?_0x374a85[_0x579d('0x15')][_0x579d('0x17')]?_[_0x579d('0x18')](_0x374a85[_0x579d('0x15')][_0x579d('0x17')],function(_0x2a6921){return{'model':db[_0x2a6921[_0x579d('0x19')]],'as':_0x2a6921['as'],'attributes':_0x2a6921[_0x579d('0x16')],'include':_0x2a6921[_0x579d('0x17')]?_[_0x579d('0x18')](_0x2a6921[_0x579d('0x17')],function(_0x23f263){return{'model':db[_0x23f263[_0x579d('0x19')]],'as':_0x23f263['as'],'attributes':_0x23f263['attributes'],'include':_0x23f263[_0x579d('0x17')]?_[_0x579d('0x18')](_0x23f263['include'],function(_0x2806c3){return{'model':db[_0x2806c3[_0x579d('0x19')]],'as':_0x2806c3['as'],'attributes':_0x2806c3[_0x579d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x579d('0x1a')](function(_0x1051ea){logger[_0x579d('0x10')](_0x579d('0x12'),_0x374a85);logger['debug']('ShowSquareOdbc',_0x374a85,JSON[_0x579d('0x1b')](_0x1051ea));_0x78acee(_0x1051ea);})[_0x579d('0x11')](function(_0x2fee78){logger[_0x579d('0xd')](_0x579d('0x12'),_0x2fee78['message'],_0x374a85);_0x42a624(_0x2fd793[_0x579d('0xd')](0x1f4,_0x2fee78[_0x579d('0xf')]));});});}; \ No newline at end of file +var _0x6866=['map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include'];(function(_0xffd9b9,_0x5626ae){var _0x240f22=function(_0x58bc30){while(--_0x58bc30){_0xffd9b9['push'](_0xffd9b9['shift']());}};_0x240f22(++_0x5626ae);}(_0x6866,0x65));var _0x6686=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6866[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x6686('0x0'));var moment=require(_0x6686('0x1'));var BPromise=require(_0x6686('0x2'));var rs=require(_0x6686('0x3'));var fs=require('fs');var Redis=require(_0x6686('0x4'));var db=require(_0x6686('0x5'))['db'];var utils=require(_0x6686('0x6'));var logger=require(_0x6686('0x7'))(_0x6686('0x8'));var config=require(_0x6686('0x9'));var jayson=require(_0x6686('0xa'));var client=jayson[_0x6686('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bacc3,_0x4a9af2,_0x5585c4){return new BPromise(function(_0x5863c3,_0x38c46b){return client[_0x6686('0xc')](_0x3bacc3,_0x5585c4)[_0x6686('0xd')](function(_0x3a0b48){logger[_0x6686('0xe')](_0x6686('0xf'),_0x4a9af2,_0x6686('0x10'));logger[_0x6686('0x11')](_0x6686('0x12'),_0x4a9af2,_0x6686('0x10'),JSON[_0x6686('0x13')](_0x3a0b48));if(_0x3a0b48['error']){if(_0x3a0b48[_0x6686('0x14')][_0x6686('0x15')]===0x1f4){logger['error'](_0x6686('0xf'),_0x4a9af2,_0x3a0b48['error'][_0x6686('0x16')]);return _0x38c46b(_0x3a0b48['error']['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4a9af2,_0x3a0b48[_0x6686('0x14')][_0x6686('0x16')]);return _0x5863c3(_0x3a0b48[_0x6686('0x14')][_0x6686('0x16')]);}else{logger['info'](_0x6686('0xf'),_0x4a9af2,_0x6686('0x10'));_0x5863c3(_0x3a0b48[_0x6686('0x17')]['message']);}})['catch'](function(_0x229bab){logger[_0x6686('0x14')](_0x6686('0xf'),_0x4a9af2,_0x229bab);_0x38c46b(_0x229bab);});});}exports[_0x6686('0x18')]=function(_0x19feb4){var _0x475a2a=this;return new Promise(function(_0x174552,_0x51a99f){return db[_0x6686('0x19')][_0x6686('0x1a')]({'raw':_0x19feb4[_0x6686('0x1b')]?_0x19feb4[_0x6686('0x1b')][_0x6686('0x1c')]===undefined?!![]:![]:!![],'where':_0x19feb4[_0x6686('0x1b')]?_0x19feb4[_0x6686('0x1b')]['where']||null:null,'attributes':_0x19feb4[_0x6686('0x1b')]?_0x19feb4[_0x6686('0x1b')][_0x6686('0x1d')]||null:null,'include':_0x19feb4[_0x6686('0x1b')]?_0x19feb4['options'][_0x6686('0x1e')]?_[_0x6686('0x1f')](_0x19feb4['options'][_0x6686('0x1e')],function(_0x197020){return{'model':db[_0x197020[_0x6686('0x20')]],'as':_0x197020['as'],'attributes':_0x197020[_0x6686('0x1d')],'include':_0x197020[_0x6686('0x1e')]?_[_0x6686('0x1f')](_0x197020[_0x6686('0x1e')],function(_0x4c91db){return{'model':db[_0x4c91db[_0x6686('0x20')]],'as':_0x4c91db['as'],'attributes':_0x4c91db[_0x6686('0x1d')],'include':_0x4c91db[_0x6686('0x1e')]?_['map'](_0x4c91db[_0x6686('0x1e')],function(_0x4d7181){return{'model':db[_0x4d7181[_0x6686('0x20')]],'as':_0x4d7181['as'],'attributes':_0x4d7181[_0x6686('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6686('0xd')](function(_0x2bb727){logger[_0x6686('0xe')](_0x6686('0x18'),_0x19feb4);logger[_0x6686('0x11')](_0x6686('0x18'),_0x19feb4,JSON['stringify'](_0x2bb727));_0x174552(_0x2bb727);})['catch'](function(_0x43d51e){logger[_0x6686('0x14')]('ShowSquareOdbc',_0x43d51e[_0x6686('0x16')],_0x19feb4);_0x51a99f(_0x475a2a['error'](0x1f4,_0x43d51e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 2f773ed..6e9e01f 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 _0xd878=['Router','fs-extra','./squareProject.controller','index','get','/:id','isAuthenticated','show','/:id/users','getUsers','addUsers','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x53085e,_0x543093){var _0x522767=function(_0x185060){while(--_0x185060){_0x53085e['push'](_0x53085e['shift']());}};_0x522767(++_0x543093);}(_0xd878,0x118));var _0x8d87=function(_0x57d074,_0xb5a37b){_0x57d074=_0x57d074-0x0;var _0x29fa69=_0xd878[_0x57d074];return _0x29fa69;};'use strict';var multer=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var path=require(_0x8d87('0x2'));var timeout=require(_0x8d87('0x3'));var express=require(_0x8d87('0x4'));var router=express[_0x8d87('0x5')]();var fs_extra=require(_0x8d87('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8d87('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8d87('0x8')]);router[_0x8d87('0x9')](_0x8d87('0xa'),auth[_0x8d87('0xb')](),controller[_0x8d87('0xc')]);router[_0x8d87('0x9')](_0x8d87('0xd'),auth[_0x8d87('0xb')](),controller[_0x8d87('0xe')]);router['post']('/',auth[_0x8d87('0xb')](),controller['create']);router['post'](_0x8d87('0xd'),auth[_0x8d87('0xb')](),controller[_0x8d87('0xf')]);router[_0x8d87('0x10')](_0x8d87('0xa'),auth[_0x8d87('0xb')](),controller['update']);router[_0x8d87('0x11')]('/:id',auth[_0x8d87('0xb')](),controller['destroy']);router[_0x8d87('0x11')](_0x8d87('0xd'),auth[_0x8d87('0xb')](),controller['removeUsers']);module[_0x8d87('0x12')]=router; \ No newline at end of file +var _0xccde=['post','addUsers','put','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers'];(function(_0x2bced3,_0x59c962){var _0x5d9a81=function(_0x3a0741){while(--_0x3a0741){_0x2bced3['push'](_0x2bced3['shift']());}};_0x5d9a81(++_0x59c962);}(_0xccde,0x1e1));var _0xeccd=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0xccde[_0x3a3758];return _0x1a9234;};'use strict';var multer=require(_0xeccd('0x0'));var util=require('util');var path=require(_0xeccd('0x1'));var timeout=require('connect-timeout');var express=require(_0xeccd('0x2'));var router=express[_0xeccd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeccd('0x4'));var config=require(_0xeccd('0x5'));var controller=require(_0xeccd('0x6'));router[_0xeccd('0x7')]('/',auth[_0xeccd('0x8')](),controller['index']);router[_0xeccd('0x7')](_0xeccd('0x9'),auth[_0xeccd('0x8')](),controller[_0xeccd('0xa')]);router['get'](_0xeccd('0xb'),auth[_0xeccd('0x8')](),controller[_0xeccd('0xc')]);router[_0xeccd('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/users',auth[_0xeccd('0x8')](),controller[_0xeccd('0xe')]);router[_0xeccd('0xf')](_0xeccd('0x9'),auth[_0xeccd('0x8')](),controller['update']);router[_0xeccd('0x10')](_0xeccd('0x9'),auth[_0xeccd('0x8')](),controller[_0xeccd('0x11')]);router[_0xeccd('0x10')](_0xeccd('0xb'),auth['isAuthenticated'](),controller['removeUsers']);module[_0xeccd('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5c7b57d..baf7c6e 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 _0x534b=['STRING','TEXT','long','preproduction','getDataValue','toString','utf8','production','DATE','sequelize','exports','name'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x534b,0xbd));var _0xb534=function(_0x3c9652,_0x36d09e){_0x3c9652=_0x3c9652-0x0;var _0x16b821=_0x534b[_0x3c9652];return _0x16b821;};'use strict';var Sequelize=require(_0xb534('0x0'));module[_0xb534('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb534('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb534('0x3')]},'notes':{'type':Sequelize[_0xb534('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xb534('0x5')),'get':function(){if(this['getDataValue'](_0xb534('0x6'))){return this[_0xb534('0x7')](_0xb534('0x6'))[_0xb534('0x8')](_0xb534('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0xb534('0x5')),'get':function(){if(this[_0xb534('0x7')](_0xb534('0xa'))){return this[_0xb534('0x7')](_0xb534('0xa'))[_0xb534('0x8')](_0xb534('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xb534('0xb')]}}; \ No newline at end of file +var _0xee8f=['STRING','TEXT','BLOB','getDataValue','preproduction','toString','long','production','DATE','exports','name'];(function(_0x5d85ec,_0x4f6f1c){var _0xa01f0d=function(_0x2686fd){while(--_0x2686fd){_0x5d85ec['push'](_0x5d85ec['shift']());}};_0xa01f0d(++_0x4f6f1c);}(_0xee8f,0x1ed));var _0xfee8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xee8f[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xfee8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xfee8('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xfee8('0x2')]},'notes':{'type':Sequelize[_0xfee8('0x3')]},'preproduction':{'type':Sequelize[_0xfee8('0x4')]('long'),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xfee8('0x5')](_0xfee8('0x6'))[_0xfee8('0x7')]('utf8');}}},'production':{'type':Sequelize[_0xfee8('0x4')](_0xfee8('0x8')),'get':function(){if(this['getDataValue']('production')){return this[_0xfee8('0x5')](_0xfee8('0x9'))[_0xfee8('0x7')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xfee8('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 17ed14f..553bc16 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 _0x8ace=['role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','removeUsers','ids','isArray','emit','userSquareProject:remove','findOne','User','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','end','sendStatus','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','SquareProject','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8ace,0x1db));var _0xe8ac=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x8ace[_0x1c1fba];return _0x37e346;};'use strict';var emlformat=require(_0xe8ac('0x0'));var rimraf=require(_0xe8ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8ac('0x2'));var rp=require(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var Mustache=require(_0xe8ac('0x6'));var util=require(_0xe8ac('0x7'));var path=require(_0xe8ac('0x8'));var sox=require(_0xe8ac('0x9'));var csv=require(_0xe8ac('0xa'));var ejs=require(_0xe8ac('0xb'));var fs=require('fs');var fs_extra=require(_0xe8ac('0xc'));var _=require(_0xe8ac('0xd'));var squel=require(_0xe8ac('0xe'));var crypto=require(_0xe8ac('0xf'));var jsforce=require(_0xe8ac('0x10'));var deskjs=require(_0xe8ac('0x11'));var toCsv=require(_0xe8ac('0xa'));var querystring=require(_0xe8ac('0x12'));var Papa=require('papaparse');var Redis=require(_0xe8ac('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8ac('0x14'));var logger=require(_0xe8ac('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe8ac('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe8ac('0x17')]=_['defaults'](config[_0xe8ac('0x17')],{'host':_0xe8ac('0x18'),'port':0x18eb});var socket=require(_0xe8ac('0x19'))(new Redis(config[_0xe8ac('0x17')]));require('./squareProject.socket')[_0xe8ac('0x1a')](socket);function respondWithStatusCode(_0x6c1ae9,_0x3d7d55){_0x3d7d55=_0x3d7d55||0xcc;return function(_0x396514){if(_0x396514){return _0x6c1ae9['sendStatus'](_0x3d7d55);}return _0x6c1ae9[_0xe8ac('0x1b')](_0x3d7d55)['end']();};}function respondWithResult(_0x1633ac,_0x118e18){_0x118e18=_0x118e18||0xc8;return function(_0x34a641){if(_0x34a641){return _0x1633ac[_0xe8ac('0x1b')](_0x118e18)[_0xe8ac('0x1c')](_0x34a641);}};}function respondWithFilteredResult(_0x1c16ec,_0x2166a5){return function(_0x437179){if(_0x437179){var _0x515eda=typeof _0x2166a5[_0xe8ac('0x1d')]==='undefined'&&typeof _0x2166a5[_0xe8ac('0x1e')]==='undefined';var _0x582316=_0x437179[_0xe8ac('0x1f')];var _0x52a776=_0x515eda?0x0:_0x2166a5[_0xe8ac('0x1d')];var _0x104c0b=_0x515eda?_0x437179[_0xe8ac('0x1f')]:_0x2166a5[_0xe8ac('0x1d')]+_0x2166a5[_0xe8ac('0x1e')];var _0x2a9d69;if(_0x104c0b>=_0x582316){_0x104c0b=_0x582316;_0x2a9d69=0xc8;}else{_0x2a9d69=0xce;}_0x1c16ec['status'](_0x2a9d69);return _0x1c16ec['set'](_0xe8ac('0x20'),_0x52a776+'-'+_0x104c0b+'/'+_0x582316)[_0xe8ac('0x1c')](_0x437179);}return null;};}function patchUpdates(_0x152367){return function(_0x31073d){try{jsonpatch[_0xe8ac('0x21')](_0x31073d,_0x152367,!![]);}catch(_0x8db248){return BPromise[_0xe8ac('0x22')](_0x8db248);}return _0x31073d[_0xe8ac('0x23')]();};}function saveUpdates(_0x246571,_0x257cdc){return function(_0x147208){if(_0x147208){return _0x147208[_0xe8ac('0x24')](_0x246571)[_0xe8ac('0x25')](function(_0x469bfc){return _0x469bfc;});}return null;};}function removeEntity(_0x4ffc40,_0x281a3c){return function(_0x482791){if(_0x482791){return _0x482791[_0xe8ac('0x26')]()[_0xe8ac('0x25')](function(){var _0x40352f=_0x482791[_0xe8ac('0x27')]({'plain':!![]});var _0x453c79=_0xe8ac('0x28');return db['UserProfileResource'][_0xe8ac('0x26')]({'where':{'type':_0x453c79,'resourceId':_0x40352f['id']}})['then'](function(){return _0x482791;});})[_0xe8ac('0x25')](function(){_0x4ffc40[_0xe8ac('0x1b')](0xcc)[_0xe8ac('0x29')]();});}};}function handleEntityNotFound(_0x1e7a11,_0xf4a960){return function(_0x2bdc2f){if(!_0x2bdc2f){_0x1e7a11[_0xe8ac('0x2a')](0x194);}return _0x2bdc2f;};}function handleError(_0x22db29,_0x289a0f){_0x289a0f=_0x289a0f||0x1f4;return function(_0x20e185){logger['error'](_0x20e185['stack']);if(_0x20e185[_0xe8ac('0x2b')]){delete _0x20e185[_0xe8ac('0x2b')];}_0x22db29[_0xe8ac('0x1b')](_0x289a0f)['send'](_0x20e185);};}exports[_0xe8ac('0x2c')]=function(_0x4aaf2b,_0x5ef9d3){var _0x1e087d={},_0x5a7add={},_0x42e26c={'count':0x0,'rows':[]};var _0x22d467=_[_0xe8ac('0x2d')](db['SquareProject'][_0xe8ac('0x2e')],function(_0x58d05e){return{'name':_0x58d05e[_0xe8ac('0x2f')],'type':_0x58d05e['type'][_0xe8ac('0x30')]};});_0x5a7add[_0xe8ac('0x31')]=_[_0xe8ac('0x2d')](_0x22d467,_0xe8ac('0x2b'));_0x5a7add[_0xe8ac('0x32')]=_[_0xe8ac('0x33')](_0x4aaf2b[_0xe8ac('0x32')]);_0x5a7add[_0xe8ac('0x34')]=_[_0xe8ac('0x35')](_0x5a7add[_0xe8ac('0x31')],_0x5a7add[_0xe8ac('0x32')]);_0x1e087d['attributes']=_[_0xe8ac('0x35')](_0x5a7add[_0xe8ac('0x31')],qs[_0xe8ac('0x36')](_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x36')]));_0x1e087d[_0xe8ac('0x37')]=_0x1e087d[_0xe8ac('0x37')][_0xe8ac('0x38')]?_0x1e087d['attributes']:_0x5a7add['model'];if(!_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x39')](_0xe8ac('0x3a'))){_0x1e087d[_0xe8ac('0x1e')]=qs['limit'](_0x4aaf2b[_0xe8ac('0x32')]['limit']);_0x1e087d['offset']=qs[_0xe8ac('0x1d')](_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x1d')]);}_0x1e087d['order']=qs[_0xe8ac('0x3b')](_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x3b')]);_0x1e087d[_0xe8ac('0x3c')]=qs[_0xe8ac('0x34')](_[_0xe8ac('0x3d')](_0x4aaf2b[_0xe8ac('0x32')],_0x5a7add['filters']),_0x22d467);if(_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x3e')]){_0x1e087d[_0xe8ac('0x3c')]=_[_0xe8ac('0x3f')](_0x1e087d[_0xe8ac('0x3c')],{'$or':_[_0xe8ac('0x2d')](_0x22d467,function(_0x437723){if(_0x437723[_0xe8ac('0x40')]!=='VIRTUAL'){var _0x324f85={};_0x324f85[_0x437723['name']]={'$like':'%'+_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x3e')]+'%'};return _0x324f85;}})});}_0x1e087d=_[_0xe8ac('0x3f')]({},_0x1e087d,_0x4aaf2b[_0xe8ac('0x41')]);var _0x5d6528={'where':_0x1e087d['where']};return db[_0xe8ac('0x42')]['count'](_0x5d6528)['then'](function(_0x53e213){_0x42e26c['count']=_0x53e213;if(_0x4aaf2b[_0xe8ac('0x32')][_0xe8ac('0x43')]){_0x1e087d[_0xe8ac('0x44')]=[{'all':!![]}];}return db[_0xe8ac('0x42')]['findAll'](_0x1e087d);})[_0xe8ac('0x25')](function(_0x106cdf){_0x42e26c[_0xe8ac('0x45')]=_0x106cdf;return _0x42e26c;})[_0xe8ac('0x25')](respondWithFilteredResult(_0x5ef9d3,_0x1e087d))[_0xe8ac('0x46')](handleError(_0x5ef9d3,null));};exports['show']=function(_0x4ebeb0,_0x4b2c2c){var _0x5cf33d={'raw':![],'where':{'id':_0x4ebeb0[_0xe8ac('0x47')]['id']}},_0x53f8e5={};_0x53f8e5[_0xe8ac('0x31')]=_[_0xe8ac('0x33')](db[_0xe8ac('0x42')][_0xe8ac('0x2e')]);_0x53f8e5[_0xe8ac('0x32')]=_[_0xe8ac('0x33')](_0x4ebeb0[_0xe8ac('0x32')]);_0x53f8e5[_0xe8ac('0x34')]=_[_0xe8ac('0x35')](_0x53f8e5[_0xe8ac('0x31')],_0x53f8e5[_0xe8ac('0x32')]);_0x5cf33d[_0xe8ac('0x37')]=_[_0xe8ac('0x35')](_0x53f8e5['model'],qs[_0xe8ac('0x36')](_0x4ebeb0['query'][_0xe8ac('0x36')]));_0x5cf33d[_0xe8ac('0x37')]=_0x5cf33d[_0xe8ac('0x37')][_0xe8ac('0x38')]?_0x5cf33d[_0xe8ac('0x37')]:_0x53f8e5[_0xe8ac('0x31')];if(_0x4ebeb0['query'][_0xe8ac('0x43')]){_0x5cf33d[_0xe8ac('0x44')]=[{'all':!![]}];}_0x5cf33d=_[_0xe8ac('0x3f')]({},_0x5cf33d,_0x4ebeb0[_0xe8ac('0x41')]);return db['SquareProject'][_0xe8ac('0x48')](_0x5cf33d)['then'](handleEntityNotFound(_0x4b2c2c,null))[_0xe8ac('0x25')](respondWithResult(_0x4b2c2c,null))[_0xe8ac('0x46')](handleError(_0x4b2c2c,null));};exports[_0xe8ac('0x49')]=function(_0x5f1848,_0x22c66d){return db[_0xe8ac('0x42')][_0xe8ac('0x49')](_0x5f1848[_0xe8ac('0x4a')],{})[_0xe8ac('0x25')](function(_0x4996a6){var _0x48c202=_0x5f1848[_0xe8ac('0x4b')][_0xe8ac('0x27')]({'plain':!![]});if(!_0x48c202)throw new Error(_0xe8ac('0x4c'));if(_0x48c202[_0xe8ac('0x4d')]===_0xe8ac('0x4b')){var _0x22aeba=_0x4996a6[_0xe8ac('0x27')]({'plain':!![]});var _0x1f5602='SquareProjects';return db['UserProfileSection'][_0xe8ac('0x48')]({'where':{'name':_0x1f5602,'userProfileId':_0x48c202[_0xe8ac('0x4e')]},'raw':!![]})[_0xe8ac('0x25')](function(_0x26f127){if(_0x26f127&&_0x26f127[_0xe8ac('0x4f')]===0x0){return db[_0xe8ac('0x50')][_0xe8ac('0x49')]({'name':_0x22aeba[_0xe8ac('0x2b')],'resourceId':_0x22aeba['id'],'type':_0x26f127['name'],'sectionId':_0x26f127['id']},{})[_0xe8ac('0x25')](function(){return _0x4996a6;});}else{return _0x4996a6;}})[_0xe8ac('0x46')](function(_0x5ebbd9){logger[_0xe8ac('0x51')](_0xe8ac('0x52'),_0x5ebbd9);throw _0x5ebbd9;});}return _0x4996a6;})['then'](respondWithResult(_0x22c66d,0xc9))[_0xe8ac('0x46')](handleError(_0x22c66d,null));};exports[_0xe8ac('0x24')]=function(_0x31cf9b,_0x7d77ff){if(_0x31cf9b[_0xe8ac('0x4a')]['id']){delete _0x31cf9b[_0xe8ac('0x4a')]['id'];}return db[_0xe8ac('0x42')]['find']({'where':{'id':_0x31cf9b[_0xe8ac('0x47')]['id']}})[_0xe8ac('0x25')](handleEntityNotFound(_0x7d77ff,null))[_0xe8ac('0x25')](saveUpdates(_0x31cf9b[_0xe8ac('0x4a')],null))[_0xe8ac('0x25')](respondWithResult(_0x7d77ff,null))[_0xe8ac('0x46')](handleError(_0x7d77ff,null));};exports[_0xe8ac('0x26')]=function(_0x575a9d,_0x2b4fe4){return db['SquareProject'][_0xe8ac('0x48')]({'where':{'id':_0x575a9d[_0xe8ac('0x47')]['id']}})[_0xe8ac('0x25')](handleEntityNotFound(_0x2b4fe4,null))['then'](removeEntity(_0x2b4fe4,null))[_0xe8ac('0x46')](handleError(_0x2b4fe4,null));};exports[_0xe8ac('0x53')]=function(_0x188dd2,_0x4c10a2,_0xbeb253){return db[_0xe8ac('0x42')]['find']({'where':{'id':_0x188dd2[_0xe8ac('0x47')]['id']}})[_0xe8ac('0x25')](handleEntityNotFound(_0x4c10a2,null))['then'](function(_0x274f39){if(_0x274f39){return _0x274f39[_0xe8ac('0x53')](_0x188dd2[_0xe8ac('0x4a')]['ids'],_['omit'](_0x188dd2[_0xe8ac('0x4a')],['ids','id'])||{});}})[_0xe8ac('0x25')](respondWithResult(_0x4c10a2,null))[_0xe8ac('0x46')](handleError(_0x4c10a2,null));};exports[_0xe8ac('0x54')]=function(_0x4c1907,_0x13f93f,_0x5e38b7){return db[_0xe8ac('0x42')]['find']({'where':{'id':_0x4c1907['params']['id']}})[_0xe8ac('0x25')](handleEntityNotFound(_0x13f93f,null))[_0xe8ac('0x25')](function(_0x35bed8){if(_0x35bed8){return _0x35bed8[_0xe8ac('0x54')](_0x4c1907['query'][_0xe8ac('0x55')])[_0xe8ac('0x25')](function(){if(_[_0xe8ac('0x56')](_0x4c1907[_0xe8ac('0x32')]['ids'])){for(var _0x2450da=0x0;_0x2450da<_0x4c1907[_0xe8ac('0x32')]['ids'][_0xe8ac('0x38')];_0x2450da+=0x1){socket[_0xe8ac('0x57')](_0xe8ac('0x58'),{'UserId':Number(_0x4c1907['query'][_0xe8ac('0x55')][_0x2450da]),'SquareProjectId':Number(_0x4c1907[_0xe8ac('0x47')]['id'])});}}else{socket[_0xe8ac('0x57')](_0xe8ac('0x58'),{'UserId':Number(_0x4c1907[_0xe8ac('0x32')][_0xe8ac('0x55')]),'SquareProjectId':Number(_0x4c1907[_0xe8ac('0x47')]['id'])});}});}})[_0xe8ac('0x25')](respondWithStatusCode(_0x13f93f,null))[_0xe8ac('0x46')](handleError(_0x13f93f,null));};exports['getUsers']=function(_0x550588,_0x570040,_0x529072){var _0x440f7c={};var _0x3cf3b0={};var _0x55c7e9;var _0xea1e43;return db[_0xe8ac('0x42')][_0xe8ac('0x59')]({'where':{'id':_0x550588['params']['id']}})[_0xe8ac('0x25')](handleEntityNotFound(_0x570040,null))['then'](function(_0x4c24f8){if(_0x4c24f8){_0x55c7e9=_0x4c24f8;_0x3cf3b0[_0xe8ac('0x31')]=_[_0xe8ac('0x33')](db[_0xe8ac('0x5a')][_0xe8ac('0x2e')]);_0x3cf3b0[_0xe8ac('0x32')]=_[_0xe8ac('0x33')](_0x550588[_0xe8ac('0x32')]);_0x3cf3b0['filters']=_[_0xe8ac('0x35')](_0x3cf3b0['model'],_0x3cf3b0[_0xe8ac('0x32')]);_0x440f7c[_0xe8ac('0x37')]=_[_0xe8ac('0x35')](_0x3cf3b0[_0xe8ac('0x31')],qs['fields'](_0x550588[_0xe8ac('0x32')][_0xe8ac('0x36')]));_0x440f7c['attributes']=_0x440f7c['attributes'][_0xe8ac('0x38')]?_0x440f7c[_0xe8ac('0x37')]:_0x3cf3b0[_0xe8ac('0x31')];_0x440f7c[_0xe8ac('0x5b')]=qs[_0xe8ac('0x3b')](_0x550588[_0xe8ac('0x32')][_0xe8ac('0x3b')]);_0x440f7c[_0xe8ac('0x3c')]=qs['filters'](_['pick'](_0x550588[_0xe8ac('0x32')],_0x3cf3b0[_0xe8ac('0x34')]));if(_0x550588[_0xe8ac('0x32')][_0xe8ac('0x3e')]){_0x440f7c[_0xe8ac('0x3c')]=_['merge'](_0x440f7c[_0xe8ac('0x3c')],{'$or':_[_0xe8ac('0x2d')](_0x440f7c[_0xe8ac('0x37')],function(_0x2e5063){var _0x4f6259={};_0x4f6259[_0x2e5063]={'$like':'%'+_0x550588[_0xe8ac('0x32')]['filter']+'%'};return _0x4f6259;})});}_0x440f7c=_['merge']({},_0x440f7c,_0x550588[_0xe8ac('0x41')]);return _0x55c7e9['getUsers'](_0x440f7c);}})['then'](function(_0x416213){if(_0x416213){_0xea1e43=_0x416213[_0xe8ac('0x38')];if(!_0x550588[_0xe8ac('0x32')][_0xe8ac('0x39')](_0xe8ac('0x3a'))){_0x440f7c['limit']=qs['limit'](_0x550588[_0xe8ac('0x32')][_0xe8ac('0x1e')]);_0x440f7c['offset']=qs[_0xe8ac('0x1d')](_0x550588['query'][_0xe8ac('0x1d')]);}return _0x55c7e9['getUsers'](_0x440f7c);}})[_0xe8ac('0x25')](function(_0x255139){if(_0x255139){return _0x255139?{'count':_0xea1e43,'rows':_0x255139}:null;}})['then'](respondWithResult(_0x570040,null))[_0xe8ac('0x46')](handleError(_0x570040,null));}; \ No newline at end of file +var _0x9af3=['destroy','then','get','SquareProjects','UserProfileResource','end','sendStatus','error','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','SquareProject','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','pick','options','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','offset','undefined','limit','set','Content-Range','apply','save'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x9af3,0xf6));var _0x39af=function(_0x3cdeaa,_0x52d7b7){_0x3cdeaa=_0x3cdeaa-0x0;var _0x26f47a=_0x9af3[_0x3cdeaa];return _0x26f47a;};'use strict';var emlformat=require(_0x39af('0x0'));var rimraf=require(_0x39af('0x1'));var zipdir=require(_0x39af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x39af('0x3'));var BPromise=require(_0x39af('0x4'));var Mustache=require(_0x39af('0x5'));var util=require(_0x39af('0x6'));var path=require(_0x39af('0x7'));var sox=require(_0x39af('0x8'));var csv=require(_0x39af('0x9'));var ejs=require(_0x39af('0xa'));var fs=require('fs');var fs_extra=require(_0x39af('0xb'));var _=require(_0x39af('0xc'));var squel=require(_0x39af('0xd'));var crypto=require(_0x39af('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x39af('0xf'));var toCsv=require(_0x39af('0x9'));var querystring=require(_0x39af('0x10'));var Papa=require(_0x39af('0x11'));var Redis=require('ioredis');var authService=require(_0x39af('0x12'));var qs=require(_0x39af('0x13'));var as=require(_0x39af('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39af('0x15'))('api');var utils=require(_0x39af('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x39af('0x17'));var db=require(_0x39af('0x18'))['db'];config['redis']=_['defaults'](config[_0x39af('0x19')],{'host':_0x39af('0x1a'),'port':0x18eb});var socket=require(_0x39af('0x1b'))(new Redis(config[_0x39af('0x19')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x2b03f2,_0x330dd6){_0x330dd6=_0x330dd6||0xcc;return function(_0x5ec3dc){if(_0x5ec3dc){return _0x2b03f2['sendStatus'](_0x330dd6);}return _0x2b03f2[_0x39af('0x1c')](_0x330dd6)['end']();};}function respondWithResult(_0x4696bc,_0x3418a1){_0x3418a1=_0x3418a1||0xc8;return function(_0x598304){if(_0x598304){return _0x4696bc[_0x39af('0x1c')](_0x3418a1)['json'](_0x598304);}};}function respondWithFilteredResult(_0x287524,_0x6ac487){return function(_0x317877){if(_0x317877){var _0x155738=typeof _0x6ac487[_0x39af('0x1d')]===_0x39af('0x1e')&&typeof _0x6ac487[_0x39af('0x1f')]===_0x39af('0x1e');var _0x5478f4=_0x317877['count'];var _0x494937=_0x155738?0x0:_0x6ac487[_0x39af('0x1d')];var _0x2953c4=_0x155738?_0x317877['count']:_0x6ac487['offset']+_0x6ac487[_0x39af('0x1f')];var _0x8c0ef;if(_0x2953c4>=_0x5478f4){_0x2953c4=_0x5478f4;_0x8c0ef=0xc8;}else{_0x8c0ef=0xce;}_0x287524[_0x39af('0x1c')](_0x8c0ef);return _0x287524[_0x39af('0x20')](_0x39af('0x21'),_0x494937+'-'+_0x2953c4+'/'+_0x5478f4)['json'](_0x317877);}return null;};}function patchUpdates(_0x57c060){return function(_0x4f2533){try{jsonpatch[_0x39af('0x22')](_0x4f2533,_0x57c060,!![]);}catch(_0x57d91d){return BPromise['reject'](_0x57d91d);}return _0x4f2533[_0x39af('0x23')]();};}function saveUpdates(_0x2ab1a8,_0x1cb4ec){return function(_0x40fa0c){if(_0x40fa0c){return _0x40fa0c['update'](_0x2ab1a8)['then'](function(_0x3f46e3){return _0x3f46e3;});}return null;};}function removeEntity(_0xe8fb7c,_0x2ddc8c){return function(_0x1dbd6b){if(_0x1dbd6b){return _0x1dbd6b[_0x39af('0x24')]()[_0x39af('0x25')](function(){var _0x589b32=_0x1dbd6b[_0x39af('0x26')]({'plain':!![]});var _0x2a4191=_0x39af('0x27');return db[_0x39af('0x28')]['destroy']({'where':{'type':_0x2a4191,'resourceId':_0x589b32['id']}})[_0x39af('0x25')](function(){return _0x1dbd6b;});})[_0x39af('0x25')](function(){_0xe8fb7c[_0x39af('0x1c')](0xcc)[_0x39af('0x29')]();});}};}function handleEntityNotFound(_0x1cfca8,_0x1280d3){return function(_0x5b4c17){if(!_0x5b4c17){_0x1cfca8[_0x39af('0x2a')](0x194);}return _0x5b4c17;};}function handleError(_0x35470a,_0x290ea5){_0x290ea5=_0x290ea5||0x1f4;return function(_0x4f7c93){logger[_0x39af('0x2b')](_0x4f7c93['stack']);if(_0x4f7c93[_0x39af('0x2c')]){delete _0x4f7c93[_0x39af('0x2c')];}_0x35470a['status'](_0x290ea5)['send'](_0x4f7c93);};}exports['index']=function(_0x1b4192,_0x151a1a){var _0x33b9f3={},_0x5dff8b={},_0x555b3c={'count':0x0,'rows':[]};var _0x55d927=_[_0x39af('0x2d')](db['SquareProject'][_0x39af('0x2e')],function(_0x3e8fb2){return{'name':_0x3e8fb2[_0x39af('0x2f')],'type':_0x3e8fb2[_0x39af('0x30')][_0x39af('0x31')]};});_0x5dff8b[_0x39af('0x32')]=_['map'](_0x55d927,_0x39af('0x2c'));_0x5dff8b['query']=_[_0x39af('0x33')](_0x1b4192[_0x39af('0x34')]);_0x5dff8b[_0x39af('0x35')]=_[_0x39af('0x36')](_0x5dff8b[_0x39af('0x32')],_0x5dff8b[_0x39af('0x34')]);_0x33b9f3[_0x39af('0x37')]=_[_0x39af('0x36')](_0x5dff8b[_0x39af('0x32')],qs['fields'](_0x1b4192[_0x39af('0x34')][_0x39af('0x38')]));_0x33b9f3[_0x39af('0x37')]=_0x33b9f3['attributes'][_0x39af('0x39')]?_0x33b9f3[_0x39af('0x37')]:_0x5dff8b[_0x39af('0x32')];if(!_0x1b4192[_0x39af('0x34')][_0x39af('0x3a')](_0x39af('0x3b'))){_0x33b9f3[_0x39af('0x1f')]=qs[_0x39af('0x1f')](_0x1b4192[_0x39af('0x34')]['limit']);_0x33b9f3[_0x39af('0x1d')]=qs['offset'](_0x1b4192['query'][_0x39af('0x1d')]);}_0x33b9f3[_0x39af('0x3c')]=qs[_0x39af('0x3d')](_0x1b4192['query'][_0x39af('0x3d')]);_0x33b9f3[_0x39af('0x3e')]=qs['filters'](_['pick'](_0x1b4192['query'],_0x5dff8b[_0x39af('0x35')]),_0x55d927);if(_0x1b4192['query'][_0x39af('0x3f')]){_0x33b9f3['where']=_[_0x39af('0x40')](_0x33b9f3[_0x39af('0x3e')],{'$or':_[_0x39af('0x2d')](_0x55d927,function(_0xdbff47){if(_0xdbff47[_0x39af('0x30')]!==_0x39af('0x41')){var _0xd3a715={};_0xd3a715[_0xdbff47[_0x39af('0x2c')]]={'$like':'%'+_0x1b4192[_0x39af('0x34')]['filter']+'%'};return _0xd3a715;}})});}_0x33b9f3=_[_0x39af('0x40')]({},_0x33b9f3,_0x1b4192['options']);var _0x182ef4={'where':_0x33b9f3[_0x39af('0x3e')]};return db[_0x39af('0x42')][_0x39af('0x43')](_0x182ef4)[_0x39af('0x25')](function(_0x301514){_0x555b3c[_0x39af('0x43')]=_0x301514;if(_0x1b4192[_0x39af('0x34')][_0x39af('0x44')]){_0x33b9f3[_0x39af('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x39af('0x46')](_0x33b9f3);})['then'](function(_0x3fac86){_0x555b3c[_0x39af('0x47')]=_0x3fac86;return _0x555b3c;})[_0x39af('0x25')](respondWithFilteredResult(_0x151a1a,_0x33b9f3))[_0x39af('0x48')](handleError(_0x151a1a,null));};exports[_0x39af('0x49')]=function(_0x1f0249,_0x3abb97){var _0x3c2630={'raw':![],'where':{'id':_0x1f0249[_0x39af('0x4a')]['id']}},_0xca4619={};_0xca4619[_0x39af('0x32')]=_['keys'](db[_0x39af('0x42')]['rawAttributes']);_0xca4619[_0x39af('0x34')]=_['keys'](_0x1f0249[_0x39af('0x34')]);_0xca4619[_0x39af('0x35')]=_[_0x39af('0x36')](_0xca4619[_0x39af('0x32')],_0xca4619[_0x39af('0x34')]);_0x3c2630['attributes']=_[_0x39af('0x36')](_0xca4619[_0x39af('0x32')],qs[_0x39af('0x38')](_0x1f0249[_0x39af('0x34')][_0x39af('0x38')]));_0x3c2630[_0x39af('0x37')]=_0x3c2630['attributes'][_0x39af('0x39')]?_0x3c2630['attributes']:_0xca4619[_0x39af('0x32')];if(_0x1f0249[_0x39af('0x34')][_0x39af('0x44')]){_0x3c2630[_0x39af('0x45')]=[{'all':!![]}];}_0x3c2630=_[_0x39af('0x40')]({},_0x3c2630,_0x1f0249['options']);return db[_0x39af('0x42')][_0x39af('0x4b')](_0x3c2630)[_0x39af('0x25')](handleEntityNotFound(_0x3abb97,null))[_0x39af('0x25')](respondWithResult(_0x3abb97,null))[_0x39af('0x48')](handleError(_0x3abb97,null));};exports['create']=function(_0x44fd98,_0xbfdcfe){return db[_0x39af('0x42')][_0x39af('0x4c')](_0x44fd98[_0x39af('0x4d')],{})[_0x39af('0x25')](function(_0x4b00c6){var _0x4b686a=_0x44fd98[_0x39af('0x4e')][_0x39af('0x26')]({'plain':!![]});if(!_0x4b686a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b686a[_0x39af('0x4f')]===_0x39af('0x4e')){var _0x57004c=_0x4b00c6['get']({'plain':!![]});var _0x73b451=_0x39af('0x27');return db[_0x39af('0x50')][_0x39af('0x4b')]({'where':{'name':_0x73b451,'userProfileId':_0x4b686a[_0x39af('0x51')]},'raw':!![]})[_0x39af('0x25')](function(_0x570213){if(_0x570213&&_0x570213[_0x39af('0x52')]===0x0){return db[_0x39af('0x28')][_0x39af('0x4c')]({'name':_0x57004c[_0x39af('0x2c')],'resourceId':_0x57004c['id'],'type':_0x570213[_0x39af('0x2c')],'sectionId':_0x570213['id']},{})[_0x39af('0x25')](function(){return _0x4b00c6;});}else{return _0x4b00c6;}})['catch'](function(_0x6f5f1a){logger['error'](_0x39af('0x53'),_0x6f5f1a);throw _0x6f5f1a;});}return _0x4b00c6;})[_0x39af('0x25')](respondWithResult(_0xbfdcfe,0xc9))[_0x39af('0x48')](handleError(_0xbfdcfe,null));};exports[_0x39af('0x54')]=function(_0x5dba96,_0xce40ed){if(_0x5dba96[_0x39af('0x4d')]['id']){delete _0x5dba96[_0x39af('0x4d')]['id'];}return db[_0x39af('0x42')]['find']({'where':{'id':_0x5dba96[_0x39af('0x4a')]['id']}})[_0x39af('0x25')](handleEntityNotFound(_0xce40ed,null))['then'](saveUpdates(_0x5dba96['body'],null))['then'](respondWithResult(_0xce40ed,null))[_0x39af('0x48')](handleError(_0xce40ed,null));};exports['destroy']=function(_0x5725ea,_0x56c15e){return db['SquareProject'][_0x39af('0x4b')]({'where':{'id':_0x5725ea[_0x39af('0x4a')]['id']}})[_0x39af('0x25')](handleEntityNotFound(_0x56c15e,null))[_0x39af('0x25')](removeEntity(_0x56c15e,null))[_0x39af('0x48')](handleError(_0x56c15e,null));};exports['addUsers']=function(_0x279a39,_0x576f2c,_0x5186d2){return db[_0x39af('0x42')][_0x39af('0x4b')]({'where':{'id':_0x279a39['params']['id']}})[_0x39af('0x25')](handleEntityNotFound(_0x576f2c,null))['then'](function(_0x567c1d){if(_0x567c1d){return _0x567c1d['addUsers'](_0x279a39[_0x39af('0x4d')][_0x39af('0x55')],_[_0x39af('0x56')](_0x279a39[_0x39af('0x4d')],[_0x39af('0x55'),'id'])||{});}})['then'](respondWithResult(_0x576f2c,null))['catch'](handleError(_0x576f2c,null));};exports[_0x39af('0x57')]=function(_0x4cd4b2,_0x4ccd1a,_0x307443){return db[_0x39af('0x42')][_0x39af('0x4b')]({'where':{'id':_0x4cd4b2[_0x39af('0x4a')]['id']}})[_0x39af('0x25')](handleEntityNotFound(_0x4ccd1a,null))[_0x39af('0x25')](function(_0x235ac6){if(_0x235ac6){return _0x235ac6[_0x39af('0x57')](_0x4cd4b2[_0x39af('0x34')][_0x39af('0x55')])['then'](function(){if(_['isArray'](_0x4cd4b2['query'][_0x39af('0x55')])){for(var _0xc67da1=0x0;_0xc67da1<_0x4cd4b2[_0x39af('0x34')]['ids'][_0x39af('0x39')];_0xc67da1+=0x1){socket[_0x39af('0x58')](_0x39af('0x59'),{'UserId':Number(_0x4cd4b2[_0x39af('0x34')][_0x39af('0x55')][_0xc67da1]),'SquareProjectId':Number(_0x4cd4b2[_0x39af('0x4a')]['id'])});}}else{socket[_0x39af('0x58')](_0x39af('0x59'),{'UserId':Number(_0x4cd4b2[_0x39af('0x34')]['ids']),'SquareProjectId':Number(_0x4cd4b2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4ccd1a,null))['catch'](handleError(_0x4ccd1a,null));};exports[_0x39af('0x5a')]=function(_0x47d035,_0x58123d,_0x46ee36){var _0x350990={};var _0x4e1ce5={};var _0x4206eb;var _0x5e70cc;return db[_0x39af('0x42')][_0x39af('0x5b')]({'where':{'id':_0x47d035[_0x39af('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58123d,null))[_0x39af('0x25')](function(_0x380129){if(_0x380129){_0x4206eb=_0x380129;_0x4e1ce5['model']=_[_0x39af('0x33')](db['User'][_0x39af('0x2e')]);_0x4e1ce5['query']=_[_0x39af('0x33')](_0x47d035[_0x39af('0x34')]);_0x4e1ce5['filters']=_[_0x39af('0x36')](_0x4e1ce5[_0x39af('0x32')],_0x4e1ce5[_0x39af('0x34')]);_0x350990[_0x39af('0x37')]=_[_0x39af('0x36')](_0x4e1ce5[_0x39af('0x32')],qs[_0x39af('0x38')](_0x47d035[_0x39af('0x34')][_0x39af('0x38')]));_0x350990['attributes']=_0x350990[_0x39af('0x37')][_0x39af('0x39')]?_0x350990[_0x39af('0x37')]:_0x4e1ce5[_0x39af('0x32')];_0x350990[_0x39af('0x3c')]=qs['sort'](_0x47d035[_0x39af('0x34')]['sort']);_0x350990[_0x39af('0x3e')]=qs[_0x39af('0x35')](_[_0x39af('0x5c')](_0x47d035[_0x39af('0x34')],_0x4e1ce5['filters']));if(_0x47d035[_0x39af('0x34')]['filter']){_0x350990[_0x39af('0x3e')]=_['merge'](_0x350990['where'],{'$or':_[_0x39af('0x2d')](_0x350990[_0x39af('0x37')],function(_0x447d0c){var _0xdfb674={};_0xdfb674[_0x447d0c]={'$like':'%'+_0x47d035['query'][_0x39af('0x3f')]+'%'};return _0xdfb674;})});}_0x350990=_['merge']({},_0x350990,_0x47d035[_0x39af('0x5d')]);return _0x4206eb['getUsers'](_0x350990);}})[_0x39af('0x25')](function(_0x321d57){if(_0x321d57){_0x5e70cc=_0x321d57[_0x39af('0x39')];if(!_0x47d035[_0x39af('0x34')]['hasOwnProperty']('nolimit')){_0x350990[_0x39af('0x1f')]=qs[_0x39af('0x1f')](_0x47d035[_0x39af('0x34')][_0x39af('0x1f')]);_0x350990[_0x39af('0x1d')]=qs['offset'](_0x47d035[_0x39af('0x34')][_0x39af('0x1d')]);}return _0x4206eb[_0x39af('0x5a')](_0x350990);}})[_0x39af('0x25')](function(_0x47c89d){if(_0x47c89d){return _0x47c89d?{'count':_0x5e70cc,'rows':_0x47c89d}:null;}})['then'](respondWithResult(_0x58123d,null))[_0x39af('0x48')](handleError(_0x58123d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index ce5ff92..b35ab48 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 _0x1854=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x338f35,_0x3e820e){var _0x3685bb=function(_0x3eb8f3){while(--_0x3eb8f3){_0x338f35['push'](_0x338f35['shift']());}};_0x3685bb(++_0x3e820e);}(_0x1854,0x179));var _0x4185=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x1854[_0x111e94];return _0x3de107;};'use strict';var EventEmitter=require(_0x4185('0x0'));var SquareProject=require(_0x4185('0x1'))['db'][_0x4185('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x4185('0x3')](0x0);var events={'afterCreate':_0x4185('0x4'),'afterUpdate':_0x4185('0x5'),'afterDestroy':_0x4185('0x6')};function emitEvent(_0x497146){return function(_0x592880,_0x5c4ccf,_0x21ce24){SquareProjectEvents[_0x4185('0x7')](_0x497146+':'+_0x592880['id'],_0x592880);SquareProjectEvents[_0x4185('0x7')](_0x497146,_0x592880);_0x21ce24(null);};}for(var e in events){if(events[_0x4185('0x8')](e)){var event=events[e];SquareProject[_0x4185('0x9')](e,emitEvent(event));}}module[_0x4185('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0xddb2=['exports','SquareProject','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1c2ea4,_0x16ac04){var _0x575866=function(_0x47272b){while(--_0x47272b){_0x1c2ea4['push'](_0x1c2ea4['shift']());}};_0x575866(++_0x16ac04);}(_0xddb2,0x159));var _0x2ddb=function(_0x15efc6,_0x35d870){_0x15efc6=_0x15efc6-0x0;var _0x376bc7=_0xddb2[_0x15efc6];return _0x376bc7;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x2ddb('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2ddb('0x1')](0x0);var events={'afterCreate':_0x2ddb('0x2'),'afterUpdate':_0x2ddb('0x3'),'afterDestroy':_0x2ddb('0x4')};function emitEvent(_0x41371e){return function(_0x51821f,_0x2a18dc,_0x944128){SquareProjectEvents[_0x2ddb('0x5')](_0x41371e+':'+_0x51821f['id'],_0x51821f);SquareProjectEvents[_0x2ddb('0x5')](_0x41371e,_0x51821f);_0x944128(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x2ddb('0x6')](e,emitEvent(event));}}module[_0x2ddb('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6bcca63..2a6b982 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 _0xb28c=['changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x1692b1,_0x39a711){var _0x5e590c=function(_0xe6d8f6){while(--_0xe6d8f6){_0x1692b1['push'](_0x1692b1['shift']());}};_0x5e590c(++_0x39a711);}(_0xb28c,0xf6));var _0xcb28=function(_0x5f37f8,_0x15f16e){_0x5f37f8=_0x5f37f8-0x0;var _0x259ccb=_0xb28c[_0x5f37f8];return _0x259ccb;};'use strict';var _=require(_0xcb28('0x0'));var util=require(_0xcb28('0x1'));var logger=require(_0xcb28('0x2'))('api');var moment=require(_0xcb28('0x3'));var BPromise=require(_0xcb28('0x4'));var rp=require(_0xcb28('0x5'));var fs=require('fs');var path=require(_0xcb28('0x6'));var rimraf=require(_0xcb28('0x7'));var config=require(_0xcb28('0x8'));var attributes=require(_0xcb28('0x9'));module[_0xcb28('0xa')]=function(_0x30baa8,_0x5e9283){return _0x30baa8[_0xcb28('0xb')](_0xcb28('0xc'),attributes,{'tableName':_0xcb28('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc54eee,_0x49f216,_0x63f2d3){if(_0xc54eee[_0xcb28('0xe')](_0xcb28('0xf'))){_0xc54eee[_0xcb28('0x10')]=moment()['format'](_0xcb28('0x11'));}if(_0xc54eee[_0xcb28('0xe')](_0xcb28('0x12'))){_0xc54eee[_0xcb28('0x13')]=moment()['format'](_0xcb28('0x11'));}_0x63f2d3(null,_0xc54eee);}}});}; \ No newline at end of file +var _0x69f1=['path','rimraf','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x69f1,0xea));var _0x169f=function(_0x2f3114,_0x3d4ff9){_0x2f3114=_0x2f3114-0x0;var _0x3940ef=_0x69f1[_0x2f3114];return _0x3940ef;};'use strict';var _=require(_0x169f('0x0'));var util=require('util');var logger=require(_0x169f('0x1'))(_0x169f('0x2'));var moment=require(_0x169f('0x3'));var BPromise=require(_0x169f('0x4'));var rp=require(_0x169f('0x5'));var fs=require('fs');var path=require(_0x169f('0x6'));var rimraf=require(_0x169f('0x7'));var config=require('../../config/environment');var attributes=require(_0x169f('0x8'));module[_0x169f('0x9')]=function(_0x50df92,_0x41c9bd){return _0x50df92['define']('SquareProject',attributes,{'tableName':_0x169f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c9b4c,_0x3c90a8,_0x3272b0){if(_0x1c9b4c[_0x169f('0xb')](_0x169f('0xc'))){_0x1c9b4c[_0x169f('0xd')]=moment()[_0x169f('0xe')](_0x169f('0xf'));}if(_0x1c9b4c[_0x169f('0xb')]('production')){_0x1c9b4c['publishedAt']=moment()[_0x169f('0xe')](_0x169f('0xf'));}_0x3272b0(null,_0x1c9b4c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c7830f8..c24f710 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 _0xd085=['SquareProject','find','options','raw','where','attributes','include','model','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd085,0x129));var _0x5d08=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xd085[_0xa79977];return _0x109f10;};'use strict';var _=require(_0x5d08('0x0'));var util=require(_0x5d08('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d08('0x2'));var db=require(_0x5d08('0x3'))['db'];var utils=require(_0x5d08('0x4'));var logger=require(_0x5d08('0x5'))(_0x5d08('0x6'));var config=require('../../config/environment');var jayson=require(_0x5d08('0x7'));var client=jayson[_0x5d08('0x8')]['http']({'port':0x232a});config[_0x5d08('0x9')]=_['defaults'](config[_0x5d08('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0x5d08('0xa')](socket);function respondWithRpcPromise(_0x246659,_0x576aa4,_0x6290c8){return new BPromise(function(_0x5dada8,_0xed5d07){return client[_0x5d08('0xb')](_0x246659,_0x6290c8)[_0x5d08('0xc')](function(_0x549252){logger[_0x5d08('0xd')](_0x5d08('0xe'),_0x576aa4,_0x5d08('0xf'));logger[_0x5d08('0x10')](_0x5d08('0x11'),_0x576aa4,_0x5d08('0xf'),JSON[_0x5d08('0x12')](_0x549252));if(_0x549252[_0x5d08('0x13')]){if(_0x549252[_0x5d08('0x13')]['code']===0x1f4){logger['error'](_0x5d08('0xe'),_0x576aa4,_0x549252[_0x5d08('0x13')][_0x5d08('0x14')]);return _0xed5d07(_0x549252[_0x5d08('0x13')][_0x5d08('0x14')]);}logger['error'](_0x5d08('0xe'),_0x576aa4,_0x549252[_0x5d08('0x13')][_0x5d08('0x14')]);return _0x5dada8(_0x549252[_0x5d08('0x13')][_0x5d08('0x14')]);}else{logger[_0x5d08('0xd')](_0x5d08('0xe'),_0x576aa4,_0x5d08('0xf'));_0x5dada8(_0x549252['result'][_0x5d08('0x14')]);}})[_0x5d08('0x15')](function(_0xfb572f){logger[_0x5d08('0x13')]('SquareProject,\x20%s,\x20%s',_0x576aa4,_0xfb572f);_0xed5d07(_0xfb572f);});});}exports[_0x5d08('0x16')]=function(_0x25b847){var _0x476c48=this;return new Promise(function(_0x1f6200,_0x212c0b){return db[_0x5d08('0x17')][_0x5d08('0x18')]({'raw':_0x25b847[_0x5d08('0x19')]?_0x25b847[_0x5d08('0x19')][_0x5d08('0x1a')]===undefined?!![]:![]:!![],'where':_0x25b847[_0x5d08('0x19')]?_0x25b847[_0x5d08('0x19')][_0x5d08('0x1b')]||null:null,'attributes':_0x25b847['options']?_0x25b847[_0x5d08('0x19')][_0x5d08('0x1c')]||null:null,'include':_0x25b847[_0x5d08('0x19')]?_0x25b847[_0x5d08('0x19')][_0x5d08('0x1d')]?_['map'](_0x25b847[_0x5d08('0x19')]['include'],function(_0x301821){return{'model':db[_0x301821[_0x5d08('0x1e')]],'as':_0x301821['as'],'attributes':_0x301821[_0x5d08('0x1c')],'include':_0x301821[_0x5d08('0x1d')]?_[_0x5d08('0x1f')](_0x301821[_0x5d08('0x1d')],function(_0x146117){return{'model':db[_0x146117['model']],'as':_0x146117['as'],'attributes':_0x146117[_0x5d08('0x1c')],'include':_0x146117[_0x5d08('0x1d')]?_['map'](_0x146117[_0x5d08('0x1d')],function(_0x13c531){return{'model':db[_0x13c531['model']],'as':_0x13c531['as'],'attributes':_0x13c531[_0x5d08('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5d08('0xc')](function(_0x514698){logger[_0x5d08('0xd')](_0x5d08('0x16'),_0x25b847);logger[_0x5d08('0x10')](_0x5d08('0x16'),_0x25b847,JSON['stringify'](_0x514698));_0x1f6200(_0x514698);})[_0x5d08('0x15')](function(_0x2d3214){logger[_0x5d08('0x13')](_0x5d08('0x16'),_0x2d3214[_0x5d08('0x14')],_0x25b847);_0x212c0b(_0x476c48[_0x5d08('0x13')](0x1f4,_0x2d3214[_0x5d08('0x14')]));});});}; \ No newline at end of file +var _0xcbf7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','model','map','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2ef609,_0x32a343){var _0x32ff26=function(_0x54427e){while(--_0x54427e){_0x2ef609['push'](_0x2ef609['shift']());}};_0x32ff26(++_0x32a343);}(_0xcbf7,0x93));var _0x7cbf=function(_0x1b6c22,_0x38bc9c){_0x1b6c22=_0x1b6c22-0x0;var _0x4c5714=_0xcbf7[_0x1b6c22];return _0x4c5714;};'use strict';var _=require(_0x7cbf('0x0'));var util=require('util');var moment=require(_0x7cbf('0x1'));var BPromise=require(_0x7cbf('0x2'));var rs=require(_0x7cbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cbf('0x4'))['db'];var utils=require(_0x7cbf('0x5'));var logger=require(_0x7cbf('0x6'))(_0x7cbf('0x7'));var config=require(_0x7cbf('0x8'));var jayson=require(_0x7cbf('0x9'));var client=jayson[_0x7cbf('0xa')][_0x7cbf('0xb')]({'port':0x232a});config[_0x7cbf('0xc')]=_[_0x7cbf('0xd')](config[_0x7cbf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7cbf('0xe'))(new Redis(config[_0x7cbf('0xc')]));require('./squareProject.socket')[_0x7cbf('0xf')](socket);function respondWithRpcPromise(_0x57fade,_0x16a7b0,_0x55693a){return new BPromise(function(_0x25875e,_0x436774){return client[_0x7cbf('0x10')](_0x57fade,_0x55693a)[_0x7cbf('0x11')](function(_0x4c7e10){logger[_0x7cbf('0x12')]('SquareProject,\x20%s,\x20%s',_0x16a7b0,_0x7cbf('0x13'));logger[_0x7cbf('0x14')](_0x7cbf('0x15'),_0x16a7b0,_0x7cbf('0x13'),JSON[_0x7cbf('0x16')](_0x4c7e10));if(_0x4c7e10[_0x7cbf('0x17')]){if(_0x4c7e10[_0x7cbf('0x17')][_0x7cbf('0x18')]===0x1f4){logger[_0x7cbf('0x17')](_0x7cbf('0x19'),_0x16a7b0,_0x4c7e10[_0x7cbf('0x17')][_0x7cbf('0x1a')]);return _0x436774(_0x4c7e10[_0x7cbf('0x17')]['message']);}logger[_0x7cbf('0x17')](_0x7cbf('0x19'),_0x16a7b0,_0x4c7e10['error'][_0x7cbf('0x1a')]);return _0x25875e(_0x4c7e10[_0x7cbf('0x17')][_0x7cbf('0x1a')]);}else{logger[_0x7cbf('0x12')](_0x7cbf('0x19'),_0x16a7b0,_0x7cbf('0x13'));_0x25875e(_0x4c7e10[_0x7cbf('0x1b')][_0x7cbf('0x1a')]);}})[_0x7cbf('0x1c')](function(_0x12a3f7){logger[_0x7cbf('0x17')](_0x7cbf('0x19'),_0x16a7b0,_0x12a3f7);_0x436774(_0x12a3f7);});});}exports[_0x7cbf('0x1d')]=function(_0x38a5bc){var _0xae3448=this;return new Promise(function(_0x564199,_0x50dd6d){return db[_0x7cbf('0x1e')][_0x7cbf('0x1f')]({'raw':_0x38a5bc[_0x7cbf('0x20')]?_0x38a5bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x38a5bc['options']?_0x38a5bc[_0x7cbf('0x20')][_0x7cbf('0x21')]||null:null,'attributes':_0x38a5bc[_0x7cbf('0x20')]?_0x38a5bc['options'][_0x7cbf('0x22')]||null:null,'include':_0x38a5bc['options']?_0x38a5bc[_0x7cbf('0x20')]['include']?_['map'](_0x38a5bc['options'][_0x7cbf('0x23')],function(_0x47a655){return{'model':db[_0x47a655[_0x7cbf('0x24')]],'as':_0x47a655['as'],'attributes':_0x47a655[_0x7cbf('0x22')],'include':_0x47a655[_0x7cbf('0x23')]?_[_0x7cbf('0x25')](_0x47a655[_0x7cbf('0x23')],function(_0x1ba630){return{'model':db[_0x1ba630['model']],'as':_0x1ba630['as'],'attributes':_0x1ba630[_0x7cbf('0x22')],'include':_0x1ba630['include']?_[_0x7cbf('0x25')](_0x1ba630['include'],function(_0xf2766){return{'model':db[_0xf2766[_0x7cbf('0x24')]],'as':_0xf2766['as'],'attributes':_0xf2766[_0x7cbf('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7cbf('0x11')](function(_0x33c5a2){logger[_0x7cbf('0x12')](_0x7cbf('0x1d'),_0x38a5bc);logger[_0x7cbf('0x14')]('ShowSquareProject',_0x38a5bc,JSON[_0x7cbf('0x16')](_0x33c5a2));_0x564199(_0x33c5a2);})['catch'](function(_0x5e3e9a){logger['error'](_0x7cbf('0x1d'),_0x5e3e9a['message'],_0x38a5bc);_0x50dd6d(_0xae3448[_0x7cbf('0x17')](0x1f4,_0x5e3e9a[_0x7cbf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8480f4a..7da0341 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 _0xccbc=['removeListener','register','length','save','remove','update','emit'];(function(_0x3e0e7d,_0x1b8729){var _0x4d21a7=function(_0x1282fa){while(--_0x1282fa){_0x3e0e7d['push'](_0x3e0e7d['shift']());}};_0x4d21a7(++_0x1b8729);}(_0xccbc,0xb2));var _0xcccb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xccbc[_0x40a045];return _0x1a687c;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xcccb('0x0'),_0xcccb('0x1'),_0xcccb('0x2')];function createListener(_0x24114a,_0xc3fe50){return function(_0xd052b0){_0xc3fe50[_0xcccb('0x3')](_0x24114a,_0xd052b0);};}function removeListener(_0x5e7482,_0x3cc42b){return function(){SquareProjectEvents[_0xcccb('0x4')](_0x5e7482,_0x3cc42b);};}exports[_0xcccb('0x5')]=function(_0x5ed3fb){for(var _0x27e91c=0x0,_0x4c3811=events[_0xcccb('0x6')];_0x27e91c<_0x4c3811;_0x27e91c++){var _0x1683b9=events[_0x27e91c];var _0x1b542b=createListener('squareProject:'+_0x1683b9,_0x5ed3fb);SquareProjectEvents['on'](_0x1683b9,_0x1b542b);}}; \ No newline at end of file +var _0x0324=['register','squareProject:','save','remove','emit'];(function(_0x44f630,_0xcdd7f8){var _0x3633ef=function(_0x19d9d4){while(--_0x19d9d4){_0x44f630['push'](_0x44f630['shift']());}};_0x3633ef(++_0xcdd7f8);}(_0x0324,0x197));var _0x4032=function(_0x270c10,_0x3f3124){_0x270c10=_0x270c10-0x0;var _0x29e44f=_0x0324[_0x270c10];return _0x29e44f;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4032('0x0'),_0x4032('0x1'),'update'];function createListener(_0xd26d29,_0x268ac8){return function(_0xe08a59){_0x268ac8[_0x4032('0x2')](_0xd26d29,_0xe08a59);};}function removeListener(_0x4d5edf,_0x6d6859){return function(){SquareProjectEvents['removeListener'](_0x4d5edf,_0x6d6859);};}exports[_0x4032('0x3')]=function(_0x192ad5){for(var _0x53f866=0x0,_0x2d68ab=events['length'];_0x53f866<_0x2d68ab;_0x53f866++){var _0x754d87=events[_0x53f866];var _0x384160=createListener(_0x4032('0x4')+_0x754d87,_0x192ad5);SquareProjectEvents['on'](_0x754d87,_0x384160);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 59a9d80..7c091b1 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x167811,_0x327343){var _0x4b0c7e=function(_0xe93972){while(--_0xe93972){_0x167811['push'](_0x167811['shift']());}};_0x4b0c7e(++_0x327343);}(_0x1cb9,0x14e));var _0x91cb=function(_0x56e8a3,_0x38c4ac){_0x56e8a3=_0x56e8a3-0x0;var _0x3feb09=_0x1cb9[_0x56e8a3];return _0x3feb09;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +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(_0x222e11,_0x183816){var _0x18b781=function(_0x1ddcbf){while(--_0x1ddcbf){_0x222e11['push'](_0x222e11['shift']());}};_0x18b781(++_0x183816);}(_0x5fab,0x177));var _0xb5fa=function(_0x5ecbbc,_0x2541f5){_0x5ecbbc=_0x5ecbbc-0x0;var _0x219a19=_0x5fab[_0x5ecbbc];return _0x219a19;};'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 ccdb8ed..49b7fdc 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 _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x5f41e6,_0x31790c){_0x5f41e6=_0x5f41e6-0x0;var _0x1a1be1=_0x2d17[_0x5f41e6];return _0x1a1be1;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file +var _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x2bd8,0x130));var _0x82bd=function(_0x371a4b,_0x3dca5d){_0x371a4b=_0x371a4b-0x0;var _0x402348=_0x2bd8[_0x371a4b];return _0x402348;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index b90a5c4..72a874e 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 _0xec47=['../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../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','save','then','error','name','index','map','SquareRecording','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','length','includeAll','find','create','body','update','params','download'];(function(_0x43bc45,_0x4e6b42){var _0x341ecd=function(_0x331be5){while(--_0x331be5){_0x43bc45['push'](_0x43bc45['shift']());}};_0x341ecd(++_0x4e6b42);}(_0xec47,0x1eb));var _0x7ec4=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xec47[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x7ec4('0x0'));var rimraf=require(_0x7ec4('0x1'));var zipdir=require(_0x7ec4('0x2'));var jsonpatch=require(_0x7ec4('0x3'));var rp=require(_0x7ec4('0x4'));var moment=require(_0x7ec4('0x5'));var BPromise=require(_0x7ec4('0x6'));var Mustache=require(_0x7ec4('0x7'));var util=require(_0x7ec4('0x8'));var path=require('path');var sox=require(_0x7ec4('0x9'));var csv=require(_0x7ec4('0xa'));var ejs=require(_0x7ec4('0xb'));var fs=require('fs');var fs_extra=require(_0x7ec4('0xc'));var _=require(_0x7ec4('0xd'));var squel=require(_0x7ec4('0xe'));var crypto=require(_0x7ec4('0xf'));var jsforce=require(_0x7ec4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7ec4('0xa'));var querystring=require('querystring');var Papa=require(_0x7ec4('0x11'));var Redis=require(_0x7ec4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7ec4('0x13'));var hardwareService=require(_0x7ec4('0x14'));var logger=require(_0x7ec4('0x15'))(_0x7ec4('0x16'));var utils=require(_0x7ec4('0x17'));var config=require(_0x7ec4('0x18'));var licenseUtil=require(_0x7ec4('0x19'));var db=require(_0x7ec4('0x1a'))['db'];function respondWithStatusCode(_0x17ee1d,_0x34155f){_0x34155f=_0x34155f||0xcc;return function(_0x4ed821){if(_0x4ed821){return _0x17ee1d[_0x7ec4('0x1b')](_0x34155f);}return _0x17ee1d[_0x7ec4('0x1c')](_0x34155f)[_0x7ec4('0x1d')]();};}function respondWithResult(_0x335b69,_0x55f03b){_0x55f03b=_0x55f03b||0xc8;return function(_0x3af089){if(_0x3af089){return _0x335b69[_0x7ec4('0x1c')](_0x55f03b)[_0x7ec4('0x1e')](_0x3af089);}};}function respondWithFilteredResult(_0x59adb3,_0x1c5223){return function(_0x1259be){if(_0x1259be){var _0x155a3a=typeof _0x1c5223['offset']===_0x7ec4('0x1f')&&typeof _0x1c5223[_0x7ec4('0x20')]==='undefined';var _0x139a61=_0x1259be[_0x7ec4('0x21')];var _0x35bdec=_0x155a3a?0x0:_0x1c5223[_0x7ec4('0x22')];var _0x2fbf67=_0x155a3a?_0x1259be['count']:_0x1c5223[_0x7ec4('0x22')]+_0x1c5223[_0x7ec4('0x20')];var _0x227902;if(_0x2fbf67>=_0x139a61){_0x2fbf67=_0x139a61;_0x227902=0xc8;}else{_0x227902=0xce;}_0x59adb3['status'](_0x227902);return _0x59adb3[_0x7ec4('0x23')](_0x7ec4('0x24'),_0x35bdec+'-'+_0x2fbf67+'/'+_0x139a61)[_0x7ec4('0x1e')](_0x1259be);}return null;};}function patchUpdates(_0x45e69c){return function(_0x1037f5){try{jsonpatch[_0x7ec4('0x25')](_0x1037f5,_0x45e69c,!![]);}catch(_0x2ab0d8){return BPromise['reject'](_0x2ab0d8);}return _0x1037f5[_0x7ec4('0x26')]();};}function saveUpdates(_0x157e1c,_0x193066){return function(_0x1b844a){if(_0x1b844a){return _0x1b844a['update'](_0x157e1c)[_0x7ec4('0x27')](function(_0x419655){return _0x419655;});}return null;};}function removeEntity(_0x36b6b3,_0x5dcec7){return function(_0x2a5b4f){if(_0x2a5b4f){return _0x2a5b4f['destroy']()['then'](function(){_0x36b6b3[_0x7ec4('0x1c')](0xcc)[_0x7ec4('0x1d')]();});}};}function handleEntityNotFound(_0x1296f0,_0xd6d33b){return function(_0x19065c){if(!_0x19065c){_0x1296f0['sendStatus'](0x194);}return _0x19065c;};}function handleError(_0x370404,_0x35f364){_0x35f364=_0x35f364||0x1f4;return function(_0x4aac19){logger[_0x7ec4('0x28')](_0x4aac19['stack']);if(_0x4aac19['name']){delete _0x4aac19[_0x7ec4('0x29')];}_0x370404[_0x7ec4('0x1c')](_0x35f364)['send'](_0x4aac19);};}exports[_0x7ec4('0x2a')]=function(_0x51c87f,_0x3ee074){var _0x3283e4={},_0x39c488={},_0x5463c4={'count':0x0,'rows':[]};var _0x525aea=_[_0x7ec4('0x2b')](db[_0x7ec4('0x2c')][_0x7ec4('0x2d')],function(_0x4da1bd){return{'name':_0x4da1bd['fieldName'],'type':_0x4da1bd['type']['key']};});_0x39c488[_0x7ec4('0x2e')]=_[_0x7ec4('0x2b')](_0x525aea,_0x7ec4('0x29'));_0x39c488[_0x7ec4('0x2f')]=_[_0x7ec4('0x30')](_0x51c87f[_0x7ec4('0x2f')]);_0x39c488[_0x7ec4('0x31')]=_[_0x7ec4('0x32')](_0x39c488[_0x7ec4('0x2e')],_0x39c488['query']);_0x3283e4[_0x7ec4('0x33')]=_['intersection'](_0x39c488[_0x7ec4('0x2e')],qs[_0x7ec4('0x34')](_0x51c87f[_0x7ec4('0x2f')][_0x7ec4('0x34')]));_0x3283e4['attributes']=_0x3283e4[_0x7ec4('0x33')]['length']?_0x3283e4[_0x7ec4('0x33')]:_0x39c488[_0x7ec4('0x2e')];if(!_0x51c87f[_0x7ec4('0x2f')]['hasOwnProperty'](_0x7ec4('0x35'))){_0x3283e4['limit']=qs[_0x7ec4('0x20')](_0x51c87f['query']['limit']);_0x3283e4[_0x7ec4('0x22')]=qs[_0x7ec4('0x22')](_0x51c87f['query'][_0x7ec4('0x22')]);}_0x3283e4['order']=qs[_0x7ec4('0x36')](_0x51c87f[_0x7ec4('0x2f')][_0x7ec4('0x36')]);_0x3283e4[_0x7ec4('0x37')]=qs[_0x7ec4('0x31')](_[_0x7ec4('0x38')](_0x51c87f[_0x7ec4('0x2f')],_0x39c488['filters']),_0x525aea);if(_0x51c87f['query']['filter']){_0x3283e4[_0x7ec4('0x37')]=_[_0x7ec4('0x39')](_0x3283e4['where'],{'$or':_[_0x7ec4('0x2b')](_0x525aea,function(_0x3d37c8){if(_0x3d37c8[_0x7ec4('0x3a')]!==_0x7ec4('0x3b')){var _0x1a9e86={};_0x1a9e86[_0x3d37c8[_0x7ec4('0x29')]]={'$like':'%'+_0x51c87f[_0x7ec4('0x2f')][_0x7ec4('0x3c')]+'%'};return _0x1a9e86;}})});}_0x3283e4=_[_0x7ec4('0x39')]({},_0x3283e4,_0x51c87f[_0x7ec4('0x3d')]);var _0x48f276={'where':_0x3283e4[_0x7ec4('0x37')]};return db[_0x7ec4('0x2c')]['count'](_0x48f276)[_0x7ec4('0x27')](function(_0x502643){_0x5463c4['count']=_0x502643;if(_0x51c87f[_0x7ec4('0x2f')]['includeAll']){_0x3283e4[_0x7ec4('0x3e')]=[{'all':!![]}];}return db[_0x7ec4('0x2c')][_0x7ec4('0x3f')](_0x3283e4);})['then'](function(_0xc27af9){_0x5463c4['rows']=_0xc27af9;return _0x5463c4;})[_0x7ec4('0x27')](respondWithFilteredResult(_0x3ee074,_0x3283e4))[_0x7ec4('0x40')](handleError(_0x3ee074,null));};exports['show']=function(_0x105d3a,_0x85d9ed){var _0x21678c={'raw':!![],'where':{'id':_0x105d3a['params']['id']}},_0x25e1d2={};_0x25e1d2['model']=_[_0x7ec4('0x30')](db[_0x7ec4('0x2c')][_0x7ec4('0x2d')]);_0x25e1d2['query']=_[_0x7ec4('0x30')](_0x105d3a[_0x7ec4('0x2f')]);_0x25e1d2[_0x7ec4('0x31')]=_[_0x7ec4('0x32')](_0x25e1d2[_0x7ec4('0x2e')],_0x25e1d2[_0x7ec4('0x2f')]);_0x21678c[_0x7ec4('0x33')]=_[_0x7ec4('0x32')](_0x25e1d2[_0x7ec4('0x2e')],qs[_0x7ec4('0x34')](_0x105d3a[_0x7ec4('0x2f')][_0x7ec4('0x34')]));_0x21678c[_0x7ec4('0x33')]=_0x21678c['attributes'][_0x7ec4('0x41')]?_0x21678c[_0x7ec4('0x33')]:_0x25e1d2[_0x7ec4('0x2e')];if(_0x105d3a[_0x7ec4('0x2f')][_0x7ec4('0x42')]){_0x21678c[_0x7ec4('0x3e')]=[{'all':!![]}];}_0x21678c=_[_0x7ec4('0x39')]({},_0x21678c,_0x105d3a[_0x7ec4('0x3d')]);return db['SquareRecording'][_0x7ec4('0x43')](_0x21678c)[_0x7ec4('0x27')](handleEntityNotFound(_0x85d9ed,null))[_0x7ec4('0x27')](respondWithResult(_0x85d9ed,null))[_0x7ec4('0x40')](handleError(_0x85d9ed,null));};exports[_0x7ec4('0x44')]=function(_0xabfd1c,_0x312495){return db[_0x7ec4('0x2c')]['create'](_0xabfd1c[_0x7ec4('0x45')],{})[_0x7ec4('0x27')](respondWithResult(_0x312495,0xc9))['catch'](handleError(_0x312495,null));};exports[_0x7ec4('0x46')]=function(_0x1794d7,_0x17a073){if(_0x1794d7[_0x7ec4('0x45')]['id']){delete _0x1794d7[_0x7ec4('0x45')]['id'];}return db[_0x7ec4('0x2c')][_0x7ec4('0x43')]({'where':{'id':_0x1794d7[_0x7ec4('0x47')]['id']}})[_0x7ec4('0x27')](handleEntityNotFound(_0x17a073,null))[_0x7ec4('0x27')](saveUpdates(_0x1794d7[_0x7ec4('0x45')],null))['then'](respondWithResult(_0x17a073,null))[_0x7ec4('0x40')](handleError(_0x17a073,null));};exports[_0x7ec4('0x48')]=function(_0x2229b8,_0x39d1d3,_0x212b23){var _0x199f1d=require(_0x7ec4('0x49'));var _0x38fab0=![];var _0x19946d={};if(_0x2229b8['query'][_0x7ec4('0x3a')]&&_0x2229b8['query'][_0x7ec4('0x3a')]==='uniqueid'){_0x19946d[_0x7ec4('0x4a')]=_0x2229b8[_0x7ec4('0x47')]['id'];}else{_0x19946d['id']=_0x2229b8[_0x7ec4('0x47')]['id'];}return db[_0x7ec4('0x2c')][_0x7ec4('0x43')]({'where':_0x19946d,'attributes':['id',_0x7ec4('0x4b'),_0x7ec4('0x4c')],'raw':!![]})[_0x7ec4('0x27')](handleEntityNotFound(_0x39d1d3,null))[_0x7ec4('0x27')](function(_0x1bf18f){if(_0x1bf18f){var _0x539f50=_0x1bf18f[_0x7ec4('0x4b')];var _0x2a8848=util[_0x7ec4('0x4d')](_0x7ec4('0x4e'),_0x539f50);if(fs[_0x7ec4('0x4f')](_0x2a8848)){_0x38fab0=!![];return _0x199f1d['decryptFile'](_0x2a8848,_0x539f50,config[_0x7ec4('0x50')]['recording'])['then'](function(){return _0x1bf18f;});}return _0x1bf18f;}})[_0x7ec4('0x27')](function(_0x15160b){if(_0x15160b){var _0x3bedc5=_0x15160b[_0x7ec4('0x4b')];if(!fs['existsSync'](_0x3bedc5)){throw new db['Sequelize'][(_0x7ec4('0x51'))](_0x7ec4('0x52'));}if(_0x15160b[_0x7ec4('0x4c')]){return _0x39d1d3[_0x7ec4('0x48')](_0x3bedc5,_0x15160b[_0x7ec4('0x4c')]+path[_0x7ec4('0x53')](_0x3bedc5),function(){if(_0x38fab0){fs[_0x7ec4('0x54')](_0x3bedc5);}});}else{return _0x39d1d3[_0x7ec4('0x48')](_0x3bedc5,function(_0x2f906f){if(_0x38fab0){fs[_0x7ec4('0x54')](_0x3bedc5);}});}}})[_0x7ec4('0x40')](function(_0x51939d){if(_0x51939d[_0x7ec4('0x55')]===_0x7ec4('0x52')){_0x39d1d3[_0x7ec4('0x1c')](0x194)[_0x7ec4('0x56')](_0x7ec4('0x57'));}else{return handleError(_0x39d1d3,null);}});};exports['destroy']=function(_0x50960d,_0x438a59){return db[_0x7ec4('0x2c')][_0x7ec4('0x43')]({'where':{'id':_0x50960d[_0x7ec4('0x47')]['id']}})[_0x7ec4('0x27')](function(_0xaa3e17){if(_[_0x7ec4('0x58')](_0xaa3e17)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaa3e17;})[_0x7ec4('0x27')](function(_0x150472){var _0x286ae7=_0x150472[_0x7ec4('0x4b')];logger[_0x7ec4('0x59')](_0x7ec4('0x5a'),_0x286ae7);if(!_['isNil'](_0x150472[_0x7ec4('0x4b')])&&fs[_0x7ec4('0x4f')](_0x286ae7)){logger['info']('File:\x20\x22'+_0x286ae7+_0x7ec4('0x5b'));fs['unlinkSync'](_0x286ae7);}_0x286ae7=_0x286ae7+_0x7ec4('0x5c');if(!_[_0x7ec4('0x58')](_0x150472['savePath'])&&fs[_0x7ec4('0x4f')](_0x286ae7)){logger[_0x7ec4('0x59')]('File:\x20\x22'+_0x286ae7+_0x7ec4('0x5b'));fs['unlinkSync'](_0x286ae7);}return _0x150472;})[_0x7ec4('0x27')](function(_0x4a6827){if(!_0x4a6827)throw new InternalError();return _0x4a6827[_0x7ec4('0x5d')]();})['then'](function(){_0x438a59[_0x7ec4('0x1c')](0xcc)[_0x7ec4('0x1d')]();})[_0x7ec4('0x40')](handleError(_0x438a59,null));}; \ No newline at end of file +var _0xcd91=['attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','SquareRecording','intersection','find','create','body','params','../../components/encryptor','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','update','destroy','error','stack','name','map','rawAttributes','fieldName','type','keys','query','filters','model'];(function(_0x302fdd,_0x51ce01){var _0x4b5dbf=function(_0x24101c){while(--_0x24101c){_0x302fdd['push'](_0x302fdd['shift']());}};_0x4b5dbf(++_0x51ce01);}(_0xcd91,0x8b));var _0x1cd9=function(_0x2dd569,_0x4205c4){_0x2dd569=_0x2dd569-0x0;var _0x9fd232=_0xcd91[_0x2dd569];return _0x9fd232;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cd9('0x0'));var zipdir=require(_0x1cd9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1cd9('0x2'));var BPromise=require(_0x1cd9('0x3'));var Mustache=require(_0x1cd9('0x4'));var util=require(_0x1cd9('0x5'));var path=require(_0x1cd9('0x6'));var sox=require('sox');var csv=require(_0x1cd9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1cd9('0x8'));var crypto=require(_0x1cd9('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1cd9('0x7'));var querystring=require(_0x1cd9('0xa'));var Papa=require('papaparse');var Redis=require(_0x1cd9('0xb'));var authService=require(_0x1cd9('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x1cd9('0xd'));var hardwareService=require(_0x1cd9('0xe'));var logger=require(_0x1cd9('0xf'))(_0x1cd9('0x10'));var utils=require(_0x1cd9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1cd9('0x12'));var db=require(_0x1cd9('0x13'))['db'];function respondWithStatusCode(_0x89933b,_0x47f0b9){_0x47f0b9=_0x47f0b9||0xcc;return function(_0xea6dac){if(_0xea6dac){return _0x89933b[_0x1cd9('0x14')](_0x47f0b9);}return _0x89933b['status'](_0x47f0b9)[_0x1cd9('0x15')]();};}function respondWithResult(_0x3e3a0a,_0x4dba81){_0x4dba81=_0x4dba81||0xc8;return function(_0x4b9358){if(_0x4b9358){return _0x3e3a0a['status'](_0x4dba81)['json'](_0x4b9358);}};}function respondWithFilteredResult(_0x1fe59c,_0x30fe98){return function(_0x107cd2){if(_0x107cd2){var _0x13db44=typeof _0x30fe98[_0x1cd9('0x16')]==='undefined'&&typeof _0x30fe98[_0x1cd9('0x17')]===_0x1cd9('0x18');var _0x347756=_0x107cd2[_0x1cd9('0x19')];var _0x263804=_0x13db44?0x0:_0x30fe98['offset'];var _0x4ead8a=_0x13db44?_0x107cd2[_0x1cd9('0x19')]:_0x30fe98['offset']+_0x30fe98[_0x1cd9('0x17')];var _0x370104;if(_0x4ead8a>=_0x347756){_0x4ead8a=_0x347756;_0x370104=0xc8;}else{_0x370104=0xce;}_0x1fe59c[_0x1cd9('0x1a')](_0x370104);return _0x1fe59c[_0x1cd9('0x1b')](_0x1cd9('0x1c'),_0x263804+'-'+_0x4ead8a+'/'+_0x347756)[_0x1cd9('0x1d')](_0x107cd2);}return null;};}function patchUpdates(_0xc2cb9b){return function(_0x334845){try{jsonpatch[_0x1cd9('0x1e')](_0x334845,_0xc2cb9b,!![]);}catch(_0x1f377c){return BPromise[_0x1cd9('0x1f')](_0x1f377c);}return _0x334845['save']();};}function saveUpdates(_0x7a9eff,_0x44d583){return function(_0x57c90e){if(_0x57c90e){return _0x57c90e[_0x1cd9('0x20')](_0x7a9eff)['then'](function(_0x13edba){return _0x13edba;});}return null;};}function removeEntity(_0x192ed7,_0x1d7046){return function(_0x3d80af){if(_0x3d80af){return _0x3d80af[_0x1cd9('0x21')]()['then'](function(){_0x192ed7[_0x1cd9('0x1a')](0xcc)[_0x1cd9('0x15')]();});}};}function handleEntityNotFound(_0x11df2b,_0x21b085){return function(_0x110664){if(!_0x110664){_0x11df2b[_0x1cd9('0x14')](0x194);}return _0x110664;};}function handleError(_0xd8978e,_0x2d3e9a){_0x2d3e9a=_0x2d3e9a||0x1f4;return function(_0x3f80cb){logger[_0x1cd9('0x22')](_0x3f80cb[_0x1cd9('0x23')]);if(_0x3f80cb[_0x1cd9('0x24')]){delete _0x3f80cb[_0x1cd9('0x24')];}_0xd8978e[_0x1cd9('0x1a')](_0x2d3e9a)['send'](_0x3f80cb);};}exports['index']=function(_0x14f9fd,_0x586ca1){var _0x2de285={},_0x5ac09e={},_0x50c39d={'count':0x0,'rows':[]};var _0x1ffa66=_[_0x1cd9('0x25')](db['SquareRecording'][_0x1cd9('0x26')],function(_0x29477a){return{'name':_0x29477a[_0x1cd9('0x27')],'type':_0x29477a[_0x1cd9('0x28')]['key']};});_0x5ac09e['model']=_[_0x1cd9('0x25')](_0x1ffa66,'name');_0x5ac09e['query']=_[_0x1cd9('0x29')](_0x14f9fd[_0x1cd9('0x2a')]);_0x5ac09e[_0x1cd9('0x2b')]=_['intersection'](_0x5ac09e[_0x1cd9('0x2c')],_0x5ac09e[_0x1cd9('0x2a')]);_0x2de285[_0x1cd9('0x2d')]=_['intersection'](_0x5ac09e['model'],qs[_0x1cd9('0x2e')](_0x14f9fd['query'][_0x1cd9('0x2e')]));_0x2de285[_0x1cd9('0x2d')]=_0x2de285[_0x1cd9('0x2d')]['length']?_0x2de285[_0x1cd9('0x2d')]:_0x5ac09e[_0x1cd9('0x2c')];if(!_0x14f9fd[_0x1cd9('0x2a')]['hasOwnProperty'](_0x1cd9('0x2f'))){_0x2de285[_0x1cd9('0x17')]=qs['limit'](_0x14f9fd[_0x1cd9('0x2a')][_0x1cd9('0x17')]);_0x2de285[_0x1cd9('0x16')]=qs[_0x1cd9('0x16')](_0x14f9fd[_0x1cd9('0x2a')][_0x1cd9('0x16')]);}_0x2de285[_0x1cd9('0x30')]=qs[_0x1cd9('0x31')](_0x14f9fd[_0x1cd9('0x2a')][_0x1cd9('0x31')]);_0x2de285[_0x1cd9('0x32')]=qs['filters'](_[_0x1cd9('0x33')](_0x14f9fd[_0x1cd9('0x2a')],_0x5ac09e[_0x1cd9('0x2b')]),_0x1ffa66);if(_0x14f9fd[_0x1cd9('0x2a')][_0x1cd9('0x34')]){_0x2de285[_0x1cd9('0x32')]=_[_0x1cd9('0x35')](_0x2de285[_0x1cd9('0x32')],{'$or':_[_0x1cd9('0x25')](_0x1ffa66,function(_0x54754d){if(_0x54754d[_0x1cd9('0x28')]!==_0x1cd9('0x36')){var _0x5abb08={};_0x5abb08[_0x54754d[_0x1cd9('0x24')]]={'$like':'%'+_0x14f9fd[_0x1cd9('0x2a')][_0x1cd9('0x34')]+'%'};return _0x5abb08;}})});}_0x2de285=_[_0x1cd9('0x35')]({},_0x2de285,_0x14f9fd[_0x1cd9('0x37')]);var _0x5a5393={'where':_0x2de285['where']};return db['SquareRecording'][_0x1cd9('0x19')](_0x5a5393)[_0x1cd9('0x38')](function(_0x1dbb5d){_0x50c39d[_0x1cd9('0x19')]=_0x1dbb5d;if(_0x14f9fd['query'][_0x1cd9('0x39')]){_0x2de285[_0x1cd9('0x3a')]=[{'all':!![]}];}return db['SquareRecording'][_0x1cd9('0x3b')](_0x2de285);})[_0x1cd9('0x38')](function(_0x38d286){_0x50c39d[_0x1cd9('0x3c')]=_0x38d286;return _0x50c39d;})[_0x1cd9('0x38')](respondWithFilteredResult(_0x586ca1,_0x2de285))[_0x1cd9('0x3d')](handleError(_0x586ca1,null));};exports['show']=function(_0x27c58a,_0x177cbb){var _0x480bc4={'raw':!![],'where':{'id':_0x27c58a['params']['id']}},_0x1d1f48={};_0x1d1f48[_0x1cd9('0x2c')]=_[_0x1cd9('0x29')](db[_0x1cd9('0x3e')][_0x1cd9('0x26')]);_0x1d1f48[_0x1cd9('0x2a')]=_['keys'](_0x27c58a[_0x1cd9('0x2a')]);_0x1d1f48[_0x1cd9('0x2b')]=_[_0x1cd9('0x3f')](_0x1d1f48[_0x1cd9('0x2c')],_0x1d1f48[_0x1cd9('0x2a')]);_0x480bc4[_0x1cd9('0x2d')]=_[_0x1cd9('0x3f')](_0x1d1f48[_0x1cd9('0x2c')],qs[_0x1cd9('0x2e')](_0x27c58a['query'][_0x1cd9('0x2e')]));_0x480bc4['attributes']=_0x480bc4[_0x1cd9('0x2d')]['length']?_0x480bc4[_0x1cd9('0x2d')]:_0x1d1f48[_0x1cd9('0x2c')];if(_0x27c58a[_0x1cd9('0x2a')]['includeAll']){_0x480bc4['include']=[{'all':!![]}];}_0x480bc4=_[_0x1cd9('0x35')]({},_0x480bc4,_0x27c58a[_0x1cd9('0x37')]);return db[_0x1cd9('0x3e')][_0x1cd9('0x40')](_0x480bc4)[_0x1cd9('0x38')](handleEntityNotFound(_0x177cbb,null))[_0x1cd9('0x38')](respondWithResult(_0x177cbb,null))['catch'](handleError(_0x177cbb,null));};exports[_0x1cd9('0x41')]=function(_0x38b043,_0x31e09d){return db[_0x1cd9('0x3e')][_0x1cd9('0x41')](_0x38b043['body'],{})['then'](respondWithResult(_0x31e09d,0xc9))[_0x1cd9('0x3d')](handleError(_0x31e09d,null));};exports['update']=function(_0x347bf7,_0x234db9){if(_0x347bf7[_0x1cd9('0x42')]['id']){delete _0x347bf7['body']['id'];}return db[_0x1cd9('0x3e')][_0x1cd9('0x40')]({'where':{'id':_0x347bf7[_0x1cd9('0x43')]['id']}})[_0x1cd9('0x38')](handleEntityNotFound(_0x234db9,null))['then'](saveUpdates(_0x347bf7[_0x1cd9('0x42')],null))[_0x1cd9('0x38')](respondWithResult(_0x234db9,null))[_0x1cd9('0x3d')](handleError(_0x234db9,null));};exports['download']=function(_0x5cc9fc,_0x4edb8d,_0x22fbd2){var _0x37d0f0=require(_0x1cd9('0x44'));var _0x514fbb=![];var _0x431e9d={};if(_0x5cc9fc[_0x1cd9('0x2a')]['type']&&_0x5cc9fc[_0x1cd9('0x2a')]['type']==='uniqueid'){_0x431e9d['uniqueid']=_0x5cc9fc[_0x1cd9('0x43')]['id'];}else{_0x431e9d['id']=_0x5cc9fc[_0x1cd9('0x43')]['id'];}return db[_0x1cd9('0x3e')][_0x1cd9('0x40')]({'where':_0x431e9d,'attributes':['id',_0x1cd9('0x45'),'filename'],'raw':!![]})[_0x1cd9('0x38')](handleEntityNotFound(_0x4edb8d,null))[_0x1cd9('0x38')](function(_0x597b73){if(_0x597b73){var _0x201832=_0x597b73['savePath'];var _0x32db2f=util[_0x1cd9('0x46')](_0x1cd9('0x47'),_0x201832);if(fs[_0x1cd9('0x48')](_0x32db2f)){_0x514fbb=!![];return _0x37d0f0['decryptFile'](_0x32db2f,_0x201832,config[_0x1cd9('0x49')][_0x1cd9('0x4a')])[_0x1cd9('0x38')](function(){return _0x597b73;});}return _0x597b73;}})[_0x1cd9('0x38')](function(_0x31d320){if(_0x31d320){var _0x52b0dc=_0x31d320[_0x1cd9('0x45')];if(!fs[_0x1cd9('0x48')](_0x52b0dc)){throw new db[(_0x1cd9('0x4b'))][(_0x1cd9('0x4c'))](_0x1cd9('0x4d'));}if(_0x31d320[_0x1cd9('0x4e')]){return _0x4edb8d[_0x1cd9('0x4f')](_0x52b0dc,_0x31d320['filename']+path[_0x1cd9('0x50')](_0x52b0dc),function(){if(_0x514fbb){fs['unlink'](_0x52b0dc);}});}else{return _0x4edb8d[_0x1cd9('0x4f')](_0x52b0dc,function(_0x2535a3){if(_0x514fbb){fs[_0x1cd9('0x51')](_0x52b0dc);}});}}})[_0x1cd9('0x3d')](function(_0x27eaaa){if(_0x27eaaa[_0x1cd9('0x52')]==='SquareRecording\x20not\x20found'){_0x4edb8d[_0x1cd9('0x1a')](0x194)[_0x1cd9('0x53')](_0x1cd9('0x54'));}else{return handleError(_0x4edb8d,null);}});};exports[_0x1cd9('0x21')]=function(_0x5e6644,_0x2e0e82){return db[_0x1cd9('0x3e')][_0x1cd9('0x40')]({'where':{'id':_0x5e6644['params']['id']}})['then'](function(_0x3008cc){if(_[_0x1cd9('0x55')](_0x3008cc)){throw new ReferenceError(_0x1cd9('0x56'));}return _0x3008cc;})[_0x1cd9('0x38')](function(_0x44f9c1){var _0x4ea11e=_0x44f9c1[_0x1cd9('0x45')];logger['info'](_0x1cd9('0x57'),_0x4ea11e);if(!_[_0x1cd9('0x55')](_0x44f9c1[_0x1cd9('0x45')])&&fs[_0x1cd9('0x48')](_0x4ea11e)){logger[_0x1cd9('0x58')](_0x1cd9('0x59')+_0x4ea11e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1cd9('0x5a')](_0x4ea11e);}_0x4ea11e=_0x4ea11e+'.cypher';if(!_[_0x1cd9('0x55')](_0x44f9c1['savePath'])&&fs[_0x1cd9('0x48')](_0x4ea11e)){logger['info'](_0x1cd9('0x59')+_0x4ea11e+_0x1cd9('0x5b'));fs['unlinkSync'](_0x4ea11e);}return _0x44f9c1;})[_0x1cd9('0x38')](function(_0x23bced){if(!_0x23bced)throw new InternalError();return _0x23bced['destroy']();})[_0x1cd9('0x38')](function(){_0x2e0e82[_0x1cd9('0x1a')](0xcc)[_0x1cd9('0x15')]();})[_0x1cd9('0x3d')](handleError(_0x2e0e82,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e155986..fc54cc3 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 _0xf435=['api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','define','square_recordings','util','../../config/logger'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0xf435,0x174));var _0x5f43=function(_0x412a64,_0x4cd8f5){_0x412a64=_0x412a64-0x0;var _0x19cd28=_0xf435[_0x412a64];return _0x19cd28;};'use strict';var _=require('lodash');var util=require(_0x5f43('0x0'));var logger=require(_0x5f43('0x1'))(_0x5f43('0x2'));var moment=require(_0x5f43('0x3'));var BPromise=require(_0x5f43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f43('0x5'));var rimraf=require(_0x5f43('0x6'));var config=require(_0x5f43('0x7'));var attributes=require(_0x5f43('0x8'));module['exports']=function(_0x15e341,_0xfcd787){return _0x15e341[_0x5f43('0x9')]('SquareRecording',attributes,{'tableName':_0x5f43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c75=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','moment','bluebird'];(function(_0x244f98,_0x194da6){var _0x3eee57=function(_0x216721){while(--_0x216721){_0x244f98['push'](_0x244f98['shift']());}};_0x3eee57(++_0x194da6);}(_0x1c75,0xce));var _0x51c7=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x1c75[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0x51c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x51c7('0x1'));var BPromise=require(_0x51c7('0x2'));var rp=require(_0x51c7('0x3'));var fs=require('fs');var path=require(_0x51c7('0x4'));var rimraf=require(_0x51c7('0x5'));var config=require(_0x51c7('0x6'));var attributes=require(_0x51c7('0x7'));module[_0x51c7('0x8')]=function(_0x3209ef,_0x19f2d6){return _0x3209ef[_0x51c7('0x9')]('SquareRecording',attributes,{'tableName':_0x51c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 7096634..cad6a5c 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 _0x71ae=['rpc','../../config/environment','jayson/promise','client','http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareRecording','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x34363a,_0x3a829b){var _0xe6ce57=function(_0x22eeba){while(--_0x22eeba){_0x34363a['push'](_0x34363a['shift']());}};_0xe6ce57(++_0x3a829b);}(_0x71ae,0x1e8));var _0xe71a=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x71ae[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0xe71a('0x0'));var util=require(_0xe71a('0x1'));var moment=require('moment');var BPromise=require(_0xe71a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe71a('0x3'));var db=require(_0xe71a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe71a('0x5'))(_0xe71a('0x6'));var config=require(_0xe71a('0x7'));var jayson=require(_0xe71a('0x8'));var client=jayson[_0xe71a('0x9')][_0xe71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb6855d,_0x4e7da1,_0x149f18){return new BPromise(function(_0x90436e,_0xcd9036){return client['request'](_0xb6855d,_0x149f18)[_0xe71a('0xb')](function(_0x1faa52){logger['info'](_0xe71a('0xc'),_0x4e7da1,_0xe71a('0xd'));logger['debug'](_0xe71a('0xe'),_0x4e7da1,_0xe71a('0xd'),JSON['stringify'](_0x1faa52));if(_0x1faa52[_0xe71a('0xf')]){if(_0x1faa52[_0xe71a('0xf')][_0xe71a('0x10')]===0x1f4){logger['error'](_0xe71a('0xc'),_0x4e7da1,_0x1faa52['error']['message']);return _0xcd9036(_0x1faa52[_0xe71a('0xf')][_0xe71a('0x11')]);}logger[_0xe71a('0xf')](_0xe71a('0xc'),_0x4e7da1,_0x1faa52[_0xe71a('0xf')][_0xe71a('0x11')]);return _0x90436e(_0x1faa52[_0xe71a('0xf')]['message']);}else{logger[_0xe71a('0x12')](_0xe71a('0xc'),_0x4e7da1,_0xe71a('0xd'));_0x90436e(_0x1faa52[_0xe71a('0x13')][_0xe71a('0x11')]);}})[_0xe71a('0x14')](function(_0x32b658){logger[_0xe71a('0xf')](_0xe71a('0xc'),_0x4e7da1,_0x32b658);_0xcd9036(_0x32b658);});});}exports[_0xe71a('0x15')]=function(_0x4c6f16){var _0x5990ea=this;return new Promise(function(_0x221ca2,_0x2329ae){return db['SquareRecording'][_0xe71a('0x16')](_0x4c6f16[_0xe71a('0x17')],{'raw':_0x4c6f16[_0xe71a('0x18')]?_0x4c6f16[_0xe71a('0x18')][_0xe71a('0x19')]===undefined?!![]:![]:!![]})[_0xe71a('0xb')](function(_0x185159){logger[_0xe71a('0x12')](_0xe71a('0x15'),_0x4c6f16);logger['debug'](_0xe71a('0x15'),_0x4c6f16,JSON['stringify'](_0x185159));_0x221ca2(_0x185159);})[_0xe71a('0x14')](function(_0x3ded1e){logger[_0xe71a('0xf')](_0xe71a('0x15'),_0x3ded1e[_0xe71a('0x11')],_0x4c6f16);_0x2329ae(_0x5990ea[_0xe71a('0xf')](0x1f4,_0x3ded1e[_0xe71a('0x11')]));});});}; \ No newline at end of file +var _0x2476=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1dd27f,_0x2e3429){var _0x38ddf6=function(_0x290dee){while(--_0x290dee){_0x1dd27f['push'](_0x1dd27f['shift']());}};_0x38ddf6(++_0x2e3429);}(_0x2476,0x182));var _0x6247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2476[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6247('0x0'));var util=require('util');var moment=require(_0x6247('0x1'));var BPromise=require(_0x6247('0x2'));var rs=require(_0x6247('0x3'));var fs=require('fs');var Redis=require(_0x6247('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6247('0x5'));var logger=require(_0x6247('0x6'))(_0x6247('0x7'));var config=require(_0x6247('0x8'));var jayson=require(_0x6247('0x9'));var client=jayson[_0x6247('0xa')][_0x6247('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb819,_0x1fdf84,_0x2b2b6d){return new BPromise(function(_0x3ac189,_0x2626c6){return client[_0x6247('0xc')](_0x2cb819,_0x2b2b6d)[_0x6247('0xd')](function(_0x328d39){logger[_0x6247('0xe')](_0x6247('0xf'),_0x1fdf84,_0x6247('0x10'));logger[_0x6247('0x11')](_0x6247('0x12'),_0x1fdf84,_0x6247('0x10'),JSON[_0x6247('0x13')](_0x328d39));if(_0x328d39[_0x6247('0x14')]){if(_0x328d39['error'][_0x6247('0x15')]===0x1f4){logger[_0x6247('0x14')]('SquareRecording,\x20%s,\x20%s',_0x1fdf84,_0x328d39[_0x6247('0x14')]['message']);return _0x2626c6(_0x328d39[_0x6247('0x14')][_0x6247('0x16')]);}logger[_0x6247('0x14')]('SquareRecording,\x20%s,\x20%s',_0x1fdf84,_0x328d39[_0x6247('0x14')][_0x6247('0x16')]);return _0x3ac189(_0x328d39[_0x6247('0x14')]['message']);}else{logger[_0x6247('0xe')]('SquareRecording,\x20%s,\x20%s',_0x1fdf84,_0x6247('0x10'));_0x3ac189(_0x328d39[_0x6247('0x17')][_0x6247('0x16')]);}})['catch'](function(_0x236025){logger[_0x6247('0x14')](_0x6247('0xf'),_0x1fdf84,_0x236025);_0x2626c6(_0x236025);});});}exports[_0x6247('0x18')]=function(_0x8b19e9){var _0x96cf81=this;return new Promise(function(_0x8a22da,_0x4f2250){return db['SquareRecording'][_0x6247('0x19')](_0x8b19e9['body'],{'raw':_0x8b19e9[_0x6247('0x1a')]?_0x8b19e9[_0x6247('0x1a')][_0x6247('0x1b')]===undefined?!![]:![]:!![]})[_0x6247('0xd')](function(_0x5c07b1){logger[_0x6247('0xe')](_0x6247('0x18'),_0x8b19e9);logger[_0x6247('0x11')]('CreateSquareRecording',_0x8b19e9,JSON[_0x6247('0x13')](_0x5c07b1));_0x8a22da(_0x5c07b1);})['catch'](function(_0x3e8d97){logger[_0x6247('0x14')](_0x6247('0x18'),_0x3e8d97[_0x6247('0x16')],_0x8b19e9);_0x4f2250(_0x96cf81[_0x6247('0x14')](0x1f4,_0x3e8d97[_0x6247('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index a0d84ef..b6cfcb3 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(_0x53314e,_0x58b0c4){var _0x1a7635=function(_0x15e5e5){while(--_0x15e5e5){_0x53314e['push'](_0x53314e['shift']());}};_0x1a7635(++_0x58b0c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 _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(_0x758ccb,_0x14d5d9){var _0x12b9a7=function(_0x1b8b66){while(--_0x1b8b66){_0x758ccb['push'](_0x758ccb['shift']());}};_0x12b9a7(++_0x14d5d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 2a85777..8f65503 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 _0x6fae=['STRING','DATE','BOOLEAN','exports'];(function(_0x525541,_0x227736){var _0x4f54d0=function(_0x2c45a8){while(--_0x2c45a8){_0x525541['push'](_0x525541['shift']());}};_0x4f54d0(++_0x227736);}(_0x6fae,0x15b));var _0xe6fa=function(_0xebbda3,_0x5cd5e6){_0xebbda3=_0xebbda3-0x0;var _0x133d5f=_0x6fae[_0xebbda3];return _0x133d5f;};'use strict';var Sequelize=require('sequelize');module[_0xe6fa('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xe6fa('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe6fa('0x1')]},'uniqueid':{'type':Sequelize[_0xe6fa('0x1')]},'version':{'type':Sequelize[_0xe6fa('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe6fa('0x1')]},'callingpres':{'type':Sequelize[_0xe6fa('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xe6fa('0x1')]},'callingtns':{'type':Sequelize[_0xe6fa('0x1')]},'dnid':{'type':Sequelize[_0xe6fa('0x1')]},'rdnis':{'type':Sequelize[_0xe6fa('0x1')]},'context':{'type':Sequelize[_0xe6fa('0x1')]},'extension':{'type':Sequelize[_0xe6fa('0x1')]},'priority':{'type':Sequelize[_0xe6fa('0x1')]},'enhanced':{'type':Sequelize[_0xe6fa('0x1')]},'accountcode':{'type':Sequelize[_0xe6fa('0x1')]},'threadid':{'type':Sequelize[_0xe6fa('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe6fa('0x2')]},'leaveAt':{'type':Sequelize[_0xe6fa('0x2')]},'bot':{'type':Sequelize[_0xe6fa('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x521e=['exports','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x521e,0xd3));var _0xe521=function(_0x453146,_0x491e39){_0x453146=_0x453146-0x0;var _0x127509=_0x521e[_0x453146];return _0x127509;};'use strict';var Sequelize=require(_0xe521('0x0'));module[_0xe521('0x1')]={'network':{'type':Sequelize[_0xe521('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xe521('0x2')]},'channel':{'type':Sequelize[_0xe521('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe521('0x2')]},'version':{'type':Sequelize[_0xe521('0x2')]},'callerid':{'type':Sequelize[_0xe521('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xe521('0x2')]},'callingani2':{'type':Sequelize[_0xe521('0x2')]},'callington':{'type':Sequelize[_0xe521('0x2')]},'callingtns':{'type':Sequelize[_0xe521('0x2')]},'dnid':{'type':Sequelize[_0xe521('0x2')]},'rdnis':{'type':Sequelize[_0xe521('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe521('0x2')]},'priority':{'type':Sequelize[_0xe521('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe521('0x2')]},'threadid':{'type':Sequelize[_0xe521('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe521('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'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 29d5bd0..2bd2418 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 _0x9c7c=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','describe','rimraf','zip-dir'];(function(_0x28c641,_0x2f5f9e){var _0x226576=function(_0x106223){while(--_0x106223){_0x28c641['push'](_0x28c641['shift']());}};_0x226576(++_0x2f5f9e);}(_0x9c7c,0x1c0));var _0xc9c7=function(_0x42658b,_0x2f6199){_0x42658b=_0x42658b-0x0;var _0xad0f95=_0x9c7c[_0x42658b];return _0xad0f95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9c7('0x0'));var zipdir=require(_0xc9c7('0x1'));var jsonpatch=require(_0xc9c7('0x2'));var rp=require(_0xc9c7('0x3'));var moment=require(_0xc9c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9c7('0x5'));var util=require(_0xc9c7('0x6'));var path=require(_0xc9c7('0x7'));var sox=require(_0xc9c7('0x8'));var csv=require(_0xc9c7('0x9'));var ejs=require(_0xc9c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9c7('0xb'));var squel=require(_0xc9c7('0xc'));var crypto=require('crypto');var jsforce=require(_0xc9c7('0xd'));var deskjs=require(_0xc9c7('0xe'));var toCsv=require(_0xc9c7('0x9'));var querystring=require(_0xc9c7('0xf'));var Papa=require(_0xc9c7('0x10'));var Redis=require(_0xc9c7('0x11'));var authService=require(_0xc9c7('0x12'));var qs=require(_0xc9c7('0x13'));var as=require(_0xc9c7('0x14'));var hardwareService=require(_0xc9c7('0x15'));var logger=require(_0xc9c7('0x16'))('api');var utils=require(_0xc9c7('0x17'));var config=require(_0xc9c7('0x18'));var licenseUtil=require(_0xc9c7('0x19'));var db=require(_0xc9c7('0x1a'))['db'];function respondWithStatusCode(_0x1c514d,_0x5d1dd2){_0x5d1dd2=_0x5d1dd2||0xcc;return function(_0x5c123f){if(_0x5c123f){return _0x1c514d[_0xc9c7('0x1b')](_0x5d1dd2);}return _0x1c514d[_0xc9c7('0x1c')](_0x5d1dd2)['end']();};}function respondWithResult(_0x1165a8,_0x479d74){_0x479d74=_0x479d74||0xc8;return function(_0x26b6a8){if(_0x26b6a8){return _0x1165a8[_0xc9c7('0x1c')](_0x479d74)['json'](_0x26b6a8);}};}function respondWithFilteredResult(_0x497e13,_0x561420){return function(_0xa702f0){if(_0xa702f0){var _0x4d0a1d=typeof _0x561420[_0xc9c7('0x1d')]===_0xc9c7('0x1e')&&typeof _0x561420[_0xc9c7('0x1f')]==='undefined';var _0x84e039=_0xa702f0[_0xc9c7('0x20')];var _0x4965df=_0x4d0a1d?0x0:_0x561420['offset'];var _0x5f0ce7=_0x4d0a1d?_0xa702f0[_0xc9c7('0x20')]:_0x561420['offset']+_0x561420['limit'];var _0x3ec0e0;if(_0x5f0ce7>=_0x84e039){_0x5f0ce7=_0x84e039;_0x3ec0e0=0xc8;}else{_0x3ec0e0=0xce;}_0x497e13[_0xc9c7('0x1c')](_0x3ec0e0);return _0x497e13[_0xc9c7('0x21')](_0xc9c7('0x22'),_0x4965df+'-'+_0x5f0ce7+'/'+_0x84e039)['json'](_0xa702f0);}return null;};}function patchUpdates(_0xc9c11e){return function(_0x3b566a){try{jsonpatch[_0xc9c7('0x23')](_0x3b566a,_0xc9c11e,!![]);}catch(_0x3db4ad){return BPromise[_0xc9c7('0x24')](_0x3db4ad);}return _0x3b566a[_0xc9c7('0x25')]();};}function saveUpdates(_0x4d415f,_0x4d5272){return function(_0x38f917){if(_0x38f917){return _0x38f917['update'](_0x4d415f)[_0xc9c7('0x26')](function(_0xad996b){return _0xad996b;});}return null;};}function removeEntity(_0x223562,_0x516f33){return function(_0x309893){if(_0x309893){return _0x309893[_0xc9c7('0x27')]()[_0xc9c7('0x26')](function(){_0x223562[_0xc9c7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8d3b,_0x3fbbda){return function(_0x17c98f){if(!_0x17c98f){_0x2d8d3b[_0xc9c7('0x1b')](0x194);}return _0x17c98f;};}function handleError(_0x57843a,_0x420eca){_0x420eca=_0x420eca||0x1f4;return function(_0x34176d){logger[_0xc9c7('0x28')](_0x34176d['stack']);if(_0x34176d[_0xc9c7('0x29')]){delete _0x34176d['name'];}_0x57843a[_0xc9c7('0x1c')](_0x420eca)[_0xc9c7('0x2a')](_0x34176d);};}exports[_0xc9c7('0x2b')]=function(_0x1d17c0,_0x4ddd35){var _0x40f0ba={},_0x44845c={},_0x3acb63={'count':0x0,'rows':[]};var _0x23aef9=_[_0xc9c7('0x2c')](db[_0xc9c7('0x2d')][_0xc9c7('0x2e')],function(_0x45ccaf){return{'name':_0x45ccaf[_0xc9c7('0x2f')],'type':_0x45ccaf[_0xc9c7('0x30')][_0xc9c7('0x31')]};});_0x44845c[_0xc9c7('0x32')]=_[_0xc9c7('0x2c')](_0x23aef9,_0xc9c7('0x29'));_0x44845c[_0xc9c7('0x33')]=_['keys'](_0x1d17c0[_0xc9c7('0x33')]);_0x44845c['filters']=_[_0xc9c7('0x34')](_0x44845c['model'],_0x44845c[_0xc9c7('0x33')]);_0x40f0ba[_0xc9c7('0x35')]=_[_0xc9c7('0x34')](_0x44845c[_0xc9c7('0x32')],qs[_0xc9c7('0x36')](_0x1d17c0[_0xc9c7('0x33')][_0xc9c7('0x36')]));_0x40f0ba[_0xc9c7('0x35')]=_0x40f0ba[_0xc9c7('0x35')][_0xc9c7('0x37')]?_0x40f0ba[_0xc9c7('0x35')]:_0x44845c[_0xc9c7('0x32')];if(!_0x1d17c0[_0xc9c7('0x33')]['hasOwnProperty'](_0xc9c7('0x38'))){_0x40f0ba[_0xc9c7('0x1f')]=qs[_0xc9c7('0x1f')](_0x1d17c0[_0xc9c7('0x33')][_0xc9c7('0x1f')]);_0x40f0ba[_0xc9c7('0x1d')]=qs[_0xc9c7('0x1d')](_0x1d17c0['query'][_0xc9c7('0x1d')]);}_0x40f0ba[_0xc9c7('0x39')]=qs['sort'](_0x1d17c0[_0xc9c7('0x33')]['sort']);_0x40f0ba[_0xc9c7('0x3a')]=qs['filters'](_['pick'](_0x1d17c0['query'],_0x44845c[_0xc9c7('0x3b')]),_0x23aef9);if(_0x1d17c0['query']['filter']){_0x40f0ba[_0xc9c7('0x3a')]=_['merge'](_0x40f0ba[_0xc9c7('0x3a')],{'$or':_[_0xc9c7('0x2c')](_0x23aef9,function(_0x3f97f0){if(_0x3f97f0[_0xc9c7('0x30')]!==_0xc9c7('0x3c')){var _0x712610={};_0x712610[_0x3f97f0[_0xc9c7('0x29')]]={'$like':'%'+_0x1d17c0['query']['filter']+'%'};return _0x712610;}})});}_0x40f0ba=_[_0xc9c7('0x3d')]({},_0x40f0ba,_0x1d17c0[_0xc9c7('0x3e')]);var _0x211cdf={'where':_0x40f0ba[_0xc9c7('0x3a')]};return db[_0xc9c7('0x2d')][_0xc9c7('0x20')](_0x211cdf)['then'](function(_0x406b4a){_0x3acb63[_0xc9c7('0x20')]=_0x406b4a;if(_0x1d17c0[_0xc9c7('0x33')][_0xc9c7('0x3f')]){_0x40f0ba[_0xc9c7('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0xc9c7('0x41')](_0x40f0ba);})[_0xc9c7('0x26')](function(_0x3d0362){_0x3acb63[_0xc9c7('0x42')]=_0x3d0362;return _0x3acb63;})[_0xc9c7('0x26')](respondWithFilteredResult(_0x4ddd35,_0x40f0ba))[_0xc9c7('0x43')](handleError(_0x4ddd35,null));};exports['show']=function(_0x8436b6,_0x47164e){var _0x23d4b2={'raw':!![],'where':{'id':_0x8436b6[_0xc9c7('0x44')]['id']}},_0x39605b={};_0x39605b[_0xc9c7('0x32')]=_[_0xc9c7('0x45')](db[_0xc9c7('0x2d')][_0xc9c7('0x2e')]);_0x39605b[_0xc9c7('0x33')]=_['keys'](_0x8436b6['query']);_0x39605b[_0xc9c7('0x3b')]=_[_0xc9c7('0x34')](_0x39605b['model'],_0x39605b['query']);_0x23d4b2[_0xc9c7('0x35')]=_['intersection'](_0x39605b['model'],qs['fields'](_0x8436b6[_0xc9c7('0x33')][_0xc9c7('0x36')]));_0x23d4b2[_0xc9c7('0x35')]=_0x23d4b2['attributes'][_0xc9c7('0x37')]?_0x23d4b2[_0xc9c7('0x35')]:_0x39605b[_0xc9c7('0x32')];if(_0x8436b6[_0xc9c7('0x33')][_0xc9c7('0x3f')]){_0x23d4b2['include']=[{'all':!![]}];}_0x23d4b2=_[_0xc9c7('0x3d')]({},_0x23d4b2,_0x8436b6[_0xc9c7('0x3e')]);return db[_0xc9c7('0x2d')][_0xc9c7('0x46')](_0x23d4b2)[_0xc9c7('0x26')](handleEntityNotFound(_0x47164e,null))[_0xc9c7('0x26')](respondWithResult(_0x47164e,null))[_0xc9c7('0x43')](handleError(_0x47164e,null));};exports[_0xc9c7('0x47')]=function(_0x45b5dc,_0x13b7bf){return db['SquareReport'][_0xc9c7('0x47')](_0x45b5dc[_0xc9c7('0x48')],{})[_0xc9c7('0x26')](respondWithResult(_0x13b7bf,0xc9))[_0xc9c7('0x43')](handleError(_0x13b7bf,null));};exports[_0xc9c7('0x49')]=function(_0xca76c4,_0x3ceb76){if(_0xca76c4[_0xc9c7('0x48')]['id']){delete _0xca76c4[_0xc9c7('0x48')]['id'];}return db[_0xc9c7('0x2d')][_0xc9c7('0x46')]({'where':{'id':_0xca76c4[_0xc9c7('0x44')]['id']}})[_0xc9c7('0x26')](handleEntityNotFound(_0x3ceb76,null))[_0xc9c7('0x26')](saveUpdates(_0xca76c4[_0xc9c7('0x48')],null))[_0xc9c7('0x26')](respondWithResult(_0x3ceb76,null))[_0xc9c7('0x43')](handleError(_0x3ceb76,null));};exports['destroy']=function(_0x148277,_0x471ef8){return db[_0xc9c7('0x2d')][_0xc9c7('0x46')]({'where':{'id':_0x148277['params']['id']}})[_0xc9c7('0x26')](handleEntityNotFound(_0x471ef8,null))[_0xc9c7('0x26')](removeEntity(_0x471ef8,null))[_0xc9c7('0x43')](handleError(_0x471ef8,null));};exports[_0xc9c7('0x4a')]=function(_0x990d5d,_0x314c26){return db[_0xc9c7('0x2d')]['describe']()[_0xc9c7('0x26')](respondWithResult(_0x314c26,null))['catch'](handleError(_0x314c26,null));}; \ No newline at end of file +var _0xf399=['keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','type','model','map','query'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xf399,0x18c));var _0x9f39=function(_0x1005a6,_0x3fe767){_0x1005a6=_0x1005a6-0x0;var _0x5459d7=_0xf399[_0x1005a6];return _0x5459d7;};'use strict';var emlformat=require(_0x9f39('0x0'));var rimraf=require(_0x9f39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f39('0x2'));var moment=require(_0x9f39('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9f39('0x4'));var util=require(_0x9f39('0x5'));var path=require(_0x9f39('0x6'));var sox=require(_0x9f39('0x7'));var csv=require(_0x9f39('0x8'));var ejs=require(_0x9f39('0x9'));var fs=require('fs');var fs_extra=require(_0x9f39('0xa'));var _=require(_0x9f39('0xb'));var squel=require(_0x9f39('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f39('0xd'));var toCsv=require(_0x9f39('0x8'));var querystring=require(_0x9f39('0xe'));var Papa=require('papaparse');var Redis=require(_0x9f39('0xf'));var authService=require(_0x9f39('0x10'));var qs=require(_0x9f39('0x11'));var as=require(_0x9f39('0x12'));var hardwareService=require(_0x9f39('0x13'));var logger=require(_0x9f39('0x14'))('api');var utils=require(_0x9f39('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f39('0x16'))['db'];function respondWithStatusCode(_0x416a93,_0x5777f1){_0x5777f1=_0x5777f1||0xcc;return function(_0x146bdb){if(_0x146bdb){return _0x416a93[_0x9f39('0x17')](_0x5777f1);}return _0x416a93['status'](_0x5777f1)[_0x9f39('0x18')]();};}function respondWithResult(_0x4b4cd4,_0x786fbd){_0x786fbd=_0x786fbd||0xc8;return function(_0x18ba02){if(_0x18ba02){return _0x4b4cd4['status'](_0x786fbd)[_0x9f39('0x19')](_0x18ba02);}};}function respondWithFilteredResult(_0x8bb7b5,_0xcd554f){return function(_0x1eede2){if(_0x1eede2){var _0x18c65d=typeof _0xcd554f[_0x9f39('0x1a')]===_0x9f39('0x1b')&&typeof _0xcd554f['limit']===_0x9f39('0x1b');var _0x411d48=_0x1eede2[_0x9f39('0x1c')];var _0x325692=_0x18c65d?0x0:_0xcd554f['offset'];var _0x5a1273=_0x18c65d?_0x1eede2[_0x9f39('0x1c')]:_0xcd554f[_0x9f39('0x1a')]+_0xcd554f[_0x9f39('0x1d')];var _0x185c22;if(_0x5a1273>=_0x411d48){_0x5a1273=_0x411d48;_0x185c22=0xc8;}else{_0x185c22=0xce;}_0x8bb7b5[_0x9f39('0x1e')](_0x185c22);return _0x8bb7b5[_0x9f39('0x1f')](_0x9f39('0x20'),_0x325692+'-'+_0x5a1273+'/'+_0x411d48)[_0x9f39('0x19')](_0x1eede2);}return null;};}function patchUpdates(_0x58659e){return function(_0x4f9c3b){try{jsonpatch[_0x9f39('0x21')](_0x4f9c3b,_0x58659e,!![]);}catch(_0x5ae58b){return BPromise[_0x9f39('0x22')](_0x5ae58b);}return _0x4f9c3b[_0x9f39('0x23')]();};}function saveUpdates(_0x39e2f2,_0x4d54cc){return function(_0x5d530b){if(_0x5d530b){return _0x5d530b[_0x9f39('0x24')](_0x39e2f2)[_0x9f39('0x25')](function(_0x3c83d5){return _0x3c83d5;});}return null;};}function removeEntity(_0x10c124,_0x4d381f){return function(_0x194b24){if(_0x194b24){return _0x194b24['destroy']()[_0x9f39('0x25')](function(){_0x10c124[_0x9f39('0x1e')](0xcc)[_0x9f39('0x18')]();});}};}function handleEntityNotFound(_0x3d1f7e,_0x2a2d1a){return function(_0x3634df){if(!_0x3634df){_0x3d1f7e[_0x9f39('0x17')](0x194);}return _0x3634df;};}function handleError(_0xd7df23,_0x28c0fb){_0x28c0fb=_0x28c0fb||0x1f4;return function(_0x47af53){logger['error'](_0x47af53[_0x9f39('0x26')]);if(_0x47af53['name']){delete _0x47af53[_0x9f39('0x27')];}_0xd7df23['status'](_0x28c0fb)[_0x9f39('0x28')](_0x47af53);};}exports[_0x9f39('0x29')]=function(_0x3ad8cf,_0x52038c){var _0x4f59a6={},_0x5a5ccd={},_0x4c47c7={'count':0x0,'rows':[]};var _0x20cce8=_['map'](db['SquareReport'][_0x9f39('0x2a')],function(_0x386341){return{'name':_0x386341[_0x9f39('0x2b')],'type':_0x386341[_0x9f39('0x2c')]['key']};});_0x5a5ccd[_0x9f39('0x2d')]=_[_0x9f39('0x2e')](_0x20cce8,'name');_0x5a5ccd[_0x9f39('0x2f')]=_[_0x9f39('0x30')](_0x3ad8cf[_0x9f39('0x2f')]);_0x5a5ccd[_0x9f39('0x31')]=_[_0x9f39('0x32')](_0x5a5ccd[_0x9f39('0x2d')],_0x5a5ccd['query']);_0x4f59a6[_0x9f39('0x33')]=_[_0x9f39('0x32')](_0x5a5ccd[_0x9f39('0x2d')],qs[_0x9f39('0x34')](_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x34')]));_0x4f59a6[_0x9f39('0x33')]=_0x4f59a6[_0x9f39('0x33')]['length']?_0x4f59a6[_0x9f39('0x33')]:_0x5a5ccd['model'];if(!_0x3ad8cf['query'][_0x9f39('0x35')](_0x9f39('0x36'))){_0x4f59a6['limit']=qs[_0x9f39('0x1d')](_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x1d')]);_0x4f59a6[_0x9f39('0x1a')]=qs[_0x9f39('0x1a')](_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x1a')]);}_0x4f59a6['order']=qs[_0x9f39('0x37')](_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x37')]);_0x4f59a6[_0x9f39('0x38')]=qs[_0x9f39('0x31')](_['pick'](_0x3ad8cf[_0x9f39('0x2f')],_0x5a5ccd[_0x9f39('0x31')]),_0x20cce8);if(_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x39')]){_0x4f59a6[_0x9f39('0x38')]=_['merge'](_0x4f59a6[_0x9f39('0x38')],{'$or':_[_0x9f39('0x2e')](_0x20cce8,function(_0x240ea1){if(_0x240ea1['type']!==_0x9f39('0x3a')){var _0x675f91={};_0x675f91[_0x240ea1[_0x9f39('0x27')]]={'$like':'%'+_0x3ad8cf['query']['filter']+'%'};return _0x675f91;}})});}_0x4f59a6=_[_0x9f39('0x3b')]({},_0x4f59a6,_0x3ad8cf[_0x9f39('0x3c')]);var _0x22164e={'where':_0x4f59a6['where']};return db[_0x9f39('0x3d')]['count'](_0x22164e)[_0x9f39('0x25')](function(_0xddb570){_0x4c47c7[_0x9f39('0x1c')]=_0xddb570;if(_0x3ad8cf[_0x9f39('0x2f')][_0x9f39('0x3e')]){_0x4f59a6[_0x9f39('0x3f')]=[{'all':!![]}];}return db[_0x9f39('0x3d')][_0x9f39('0x40')](_0x4f59a6);})[_0x9f39('0x25')](function(_0x469696){_0x4c47c7[_0x9f39('0x41')]=_0x469696;return _0x4c47c7;})[_0x9f39('0x25')](respondWithFilteredResult(_0x52038c,_0x4f59a6))[_0x9f39('0x42')](handleError(_0x52038c,null));};exports[_0x9f39('0x43')]=function(_0xbb4288,_0x13bfe9){var _0x2bb99d={'raw':!![],'where':{'id':_0xbb4288['params']['id']}},_0x6c982c={};_0x6c982c[_0x9f39('0x2d')]=_[_0x9f39('0x30')](db[_0x9f39('0x3d')][_0x9f39('0x2a')]);_0x6c982c[_0x9f39('0x2f')]=_[_0x9f39('0x30')](_0xbb4288['query']);_0x6c982c['filters']=_[_0x9f39('0x32')](_0x6c982c[_0x9f39('0x2d')],_0x6c982c[_0x9f39('0x2f')]);_0x2bb99d[_0x9f39('0x33')]=_[_0x9f39('0x32')](_0x6c982c[_0x9f39('0x2d')],qs[_0x9f39('0x34')](_0xbb4288[_0x9f39('0x2f')]['fields']));_0x2bb99d['attributes']=_0x2bb99d[_0x9f39('0x33')][_0x9f39('0x44')]?_0x2bb99d[_0x9f39('0x33')]:_0x6c982c['model'];if(_0xbb4288[_0x9f39('0x2f')][_0x9f39('0x3e')]){_0x2bb99d[_0x9f39('0x3f')]=[{'all':!![]}];}_0x2bb99d=_[_0x9f39('0x3b')]({},_0x2bb99d,_0xbb4288[_0x9f39('0x3c')]);return db[_0x9f39('0x3d')][_0x9f39('0x45')](_0x2bb99d)[_0x9f39('0x25')](handleEntityNotFound(_0x13bfe9,null))[_0x9f39('0x25')](respondWithResult(_0x13bfe9,null))['catch'](handleError(_0x13bfe9,null));};exports[_0x9f39('0x46')]=function(_0x2ef168,_0x2156c7){return db[_0x9f39('0x3d')]['create'](_0x2ef168[_0x9f39('0x47')],{})[_0x9f39('0x25')](respondWithResult(_0x2156c7,0xc9))[_0x9f39('0x42')](handleError(_0x2156c7,null));};exports[_0x9f39('0x24')]=function(_0x34c985,_0x2d2ee4){if(_0x34c985[_0x9f39('0x47')]['id']){delete _0x34c985[_0x9f39('0x47')]['id'];}return db[_0x9f39('0x3d')][_0x9f39('0x45')]({'where':{'id':_0x34c985[_0x9f39('0x48')]['id']}})[_0x9f39('0x25')](handleEntityNotFound(_0x2d2ee4,null))[_0x9f39('0x25')](saveUpdates(_0x34c985[_0x9f39('0x47')],null))[_0x9f39('0x25')](respondWithResult(_0x2d2ee4,null))['catch'](handleError(_0x2d2ee4,null));};exports['destroy']=function(_0xa0bed9,_0x289675){return db[_0x9f39('0x3d')]['find']({'where':{'id':_0xa0bed9[_0x9f39('0x48')]['id']}})[_0x9f39('0x25')](handleEntityNotFound(_0x289675,null))['then'](removeEntity(_0x289675,null))[_0x9f39('0x42')](handleError(_0x289675,null));};exports['describe']=function(_0x948767,_0x15cb0c){return db[_0x9f39('0x3d')][_0x9f39('0x49')]()['then'](respondWithResult(_0x15cb0c,null))[_0x9f39('0x42')](handleError(_0x15cb0c,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index d43aa13..f2ed036 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 _0xb7ef=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x4f8629,_0x4ca74d){var _0x4f10fd=function(_0x1fa10a){while(--_0x1fa10a){_0x4f8629['push'](_0x4f8629['shift']());}};_0x4f10fd(++_0x4ca74d);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x184e23,_0x5d3b15){_0x184e23=_0x184e23-0x0;var _0x2aa77e=_0xb7ef[_0x184e23];return _0x2aa77e;};'use strict';var _=require(_0xfb7e('0x0'));var util=require(_0xfb7e('0x1'));var logger=require(_0xfb7e('0x2'))(_0xfb7e('0x3'));var moment=require(_0xfb7e('0x4'));var BPromise=require(_0xfb7e('0x5'));var rp=require(_0xfb7e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb7e('0x7'));var config=require(_0xfb7e('0x8'));var attributes=require('./squareReport.attributes');module[_0xfb7e('0x9')]=function(_0x298dd2,_0x26427f){return _0x298dd2[_0xfb7e('0xa')](_0xfb7e('0xb'),attributes,{'tableName':_0xfb7e('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xfb7e('0xd'),_0xfb7e('0xe')]},{'name':_0xfb7e('0xf'),'fields':[_0xfb7e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a7b=['report_square','uniqueid','project_name','leaveAt','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x26be88,_0x17c20d){var _0x48c7e2=function(_0x31da6a){while(--_0x31da6a){_0x26be88['push'](_0x26be88['shift']());}};_0x48c7e2(++_0x17c20d);}(_0x7a7b,0x18c));var _0xb7a7=function(_0xe6038f,_0x217c6c){_0xe6038f=_0xe6038f-0x0;var _0x289e40=_0x7a7b[_0xe6038f];return _0x289e40;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb7a7('0x0'));var moment=require(_0xb7a7('0x1'));var BPromise=require(_0xb7a7('0x2'));var rp=require(_0xb7a7('0x3'));var fs=require('fs');var path=require(_0xb7a7('0x4'));var rimraf=require(_0xb7a7('0x5'));var config=require(_0xb7a7('0x6'));var attributes=require(_0xb7a7('0x7'));module[_0xb7a7('0x8')]=function(_0x120be1,_0x53f6d5){return _0x120be1[_0xb7a7('0x9')]('SquareReport',attributes,{'tableName':_0xb7a7('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xb7a7('0xb'),_0xb7a7('0xc')]},{'name':'leaveAt','fields':[_0xb7a7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2453453..6237437 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 _0xdefc=['code','message','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','options','raw','stringify','UpdateSquareReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3da3cb,_0x128daa){var _0x5f1471=function(_0x567579){while(--_0x567579){_0x3da3cb['push'](_0x3da3cb['shift']());}};_0x5f1471(++_0x128daa);}(_0xdefc,0x117));var _0xcdef=function(_0x4ab9a7,_0x291df1){_0x4ab9a7=_0x4ab9a7-0x0;var _0xd08799=_0xdefc[_0x4ab9a7];return _0xd08799;};'use strict';var _=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var moment=require(_0xcdef('0x2'));var BPromise=require(_0xcdef('0x3'));var rs=require(_0xcdef('0x4'));var fs=require('fs');var Redis=require(_0xcdef('0x5'));var db=require(_0xcdef('0x6'))['db'];var utils=require(_0xcdef('0x7'));var logger=require(_0xcdef('0x8'))(_0xcdef('0x9'));var config=require('../../config/environment');var jayson=require(_0xcdef('0xa'));var client=jayson[_0xcdef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xafe166,_0x122a1f,_0x749e3b){return new BPromise(function(_0x447738,_0x23f7d1){return client['request'](_0xafe166,_0x749e3b)[_0xcdef('0xc')](function(_0x5c75e9){logger[_0xcdef('0xd')]('SquareReport,\x20%s,\x20%s',_0x122a1f,_0xcdef('0xe'));logger[_0xcdef('0xf')](_0xcdef('0x10'),_0x122a1f,_0xcdef('0xe'),JSON['stringify'](_0x5c75e9));if(_0x5c75e9[_0xcdef('0x11')]){if(_0x5c75e9['error'][_0xcdef('0x12')]===0x1f4){logger[_0xcdef('0x11')]('SquareReport,\x20%s,\x20%s',_0x122a1f,_0x5c75e9[_0xcdef('0x11')][_0xcdef('0x13')]);return _0x23f7d1(_0x5c75e9[_0xcdef('0x11')][_0xcdef('0x13')]);}logger[_0xcdef('0x11')](_0xcdef('0x14'),_0x122a1f,_0x5c75e9[_0xcdef('0x11')]['message']);return _0x447738(_0x5c75e9['error'][_0xcdef('0x13')]);}else{logger[_0xcdef('0xd')](_0xcdef('0x14'),_0x122a1f,_0xcdef('0xe'));_0x447738(_0x5c75e9[_0xcdef('0x15')][_0xcdef('0x13')]);}})[_0xcdef('0x16')](function(_0xcf1d0b){logger[_0xcdef('0x11')](_0xcdef('0x14'),_0x122a1f,_0xcf1d0b);_0x23f7d1(_0xcf1d0b);});});}exports[_0xcdef('0x17')]=function(_0x42a589){var _0x441fe7=this;return new Promise(function(_0x2bf631,_0x393bce){return db[_0xcdef('0x18')][_0xcdef('0x19')](_0x42a589['body'],{'raw':_0x42a589[_0xcdef('0x1a')]?_0x42a589['options'][_0xcdef('0x1b')]===undefined?!![]:![]:!![]})[_0xcdef('0xc')](function(_0x4a33f1){logger[_0xcdef('0xd')](_0xcdef('0x17'),_0x42a589);logger[_0xcdef('0xf')](_0xcdef('0x17'),_0x42a589,JSON[_0xcdef('0x1c')](_0x4a33f1));_0x2bf631(_0x4a33f1);})[_0xcdef('0x16')](function(_0x20f7f1){logger[_0xcdef('0x11')](_0xcdef('0x17'),_0x20f7f1['message'],_0x42a589);_0x393bce(_0x441fe7[_0xcdef('0x11')](0x1f4,_0x20f7f1['message']));});});};exports[_0xcdef('0x1d')]=function(_0x626d23){var _0x32c616=this;return new Promise(function(_0x17e7aa,_0x2fbdac){return db[_0xcdef('0x18')]['update'](_0x626d23['body'],{'raw':_0x626d23[_0xcdef('0x1a')]?_0x626d23[_0xcdef('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x626d23['options']?_0x626d23[_0xcdef('0x1a')][_0xcdef('0x1e')]||null:null,'attributes':_0x626d23[_0xcdef('0x1a')]?_0x626d23[_0xcdef('0x1a')][_0xcdef('0x1f')]||null:null,'limit':_0x626d23[_0xcdef('0x1a')]?_0x626d23[_0xcdef('0x1a')][_0xcdef('0x20')]||null:null})[_0xcdef('0xc')](function(_0x7b942e){logger[_0xcdef('0xd')](_0xcdef('0x1d'),_0x626d23);logger[_0xcdef('0xf')](_0xcdef('0x1d'),_0x626d23,JSON[_0xcdef('0x1c')](_0x7b942e));_0x17e7aa(_0x7b942e);})['catch'](function(_0x9aa1a){logger[_0xcdef('0x11')](_0xcdef('0x1d'),_0x9aa1a[_0xcdef('0x13')],_0x626d23);_0x2fbdac(_0x32c616[_0xcdef('0x11')](0x1f4,_0x9aa1a[_0xcdef('0x13')]));});});}; \ No newline at end of file +var _0xe8ec=['then','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareReport','body','options','raw','UpdateSquareReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x10aa42,_0x230a38){var _0x24090c=function(_0xc884bb){while(--_0xc884bb){_0x10aa42['push'](_0x10aa42['shift']());}};_0x24090c(++_0x230a38);}(_0xe8ec,0xeb));var _0xce8e=function(_0x40d79f,_0x324312){_0x40d79f=_0x40d79f-0x0;var _0x52eebe=_0xe8ec[_0x40d79f];return _0x52eebe;};'use strict';var _=require(_0xce8e('0x0'));var util=require(_0xce8e('0x1'));var moment=require(_0xce8e('0x2'));var BPromise=require(_0xce8e('0x3'));var rs=require(_0xce8e('0x4'));var fs=require('fs');var Redis=require(_0xce8e('0x5'));var db=require(_0xce8e('0x6'))['db'];var utils=require(_0xce8e('0x7'));var logger=require(_0xce8e('0x8'))('rpc');var config=require(_0xce8e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xce8e('0xa')][_0xce8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c680a,_0x120007,_0x1015dd){return new BPromise(function(_0x39e305,_0x3a3aa8){return client[_0xce8e('0xc')](_0x4c680a,_0x1015dd)[_0xce8e('0xd')](function(_0x448dc){logger['info'](_0xce8e('0xe'),_0x120007,_0xce8e('0xf'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x120007,_0xce8e('0xf'),JSON[_0xce8e('0x10')](_0x448dc));if(_0x448dc[_0xce8e('0x11')]){if(_0x448dc['error'][_0xce8e('0x12')]===0x1f4){logger[_0xce8e('0x11')](_0xce8e('0xe'),_0x120007,_0x448dc[_0xce8e('0x11')][_0xce8e('0x13')]);return _0x3a3aa8(_0x448dc[_0xce8e('0x11')]['message']);}logger[_0xce8e('0x11')](_0xce8e('0xe'),_0x120007,_0x448dc[_0xce8e('0x11')][_0xce8e('0x13')]);return _0x39e305(_0x448dc[_0xce8e('0x11')][_0xce8e('0x13')]);}else{logger[_0xce8e('0x14')](_0xce8e('0xe'),_0x120007,'request\x20sent');_0x39e305(_0x448dc[_0xce8e('0x15')][_0xce8e('0x13')]);}})[_0xce8e('0x16')](function(_0x36e89a){logger[_0xce8e('0x11')](_0xce8e('0xe'),_0x120007,_0x36e89a);_0x3a3aa8(_0x36e89a);});});}exports[_0xce8e('0x17')]=function(_0x2e772d){var _0x546425=this;return new Promise(function(_0x247c18,_0x491ec8){return db['SquareReport']['create'](_0x2e772d[_0xce8e('0x18')],{'raw':_0x2e772d[_0xce8e('0x19')]?_0x2e772d[_0xce8e('0x19')][_0xce8e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4b95bd){logger['info'](_0xce8e('0x17'),_0x2e772d);logger['debug']('CreateSquareReport',_0x2e772d,JSON[_0xce8e('0x10')](_0x4b95bd));_0x247c18(_0x4b95bd);})['catch'](function(_0x3be70d){logger[_0xce8e('0x11')]('CreateSquareReport',_0x3be70d[_0xce8e('0x13')],_0x2e772d);_0x491ec8(_0x546425[_0xce8e('0x11')](0x1f4,_0x3be70d[_0xce8e('0x13')]));});});};exports[_0xce8e('0x1b')]=function(_0x102efe){var _0x1b3125=this;return new Promise(function(_0x11a098,_0x2e4089){return db['SquareReport']['update'](_0x102efe['body'],{'raw':_0x102efe[_0xce8e('0x19')]?_0x102efe[_0xce8e('0x19')][_0xce8e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102efe[_0xce8e('0x19')]?_0x102efe[_0xce8e('0x19')][_0xce8e('0x1c')]||null:null,'attributes':_0x102efe[_0xce8e('0x19')]?_0x102efe['options'][_0xce8e('0x1d')]||null:null,'limit':_0x102efe[_0xce8e('0x19')]?_0x102efe['options'][_0xce8e('0x1e')]||null:null})[_0xce8e('0xd')](function(_0x178840){logger[_0xce8e('0x14')](_0xce8e('0x1b'),_0x102efe);logger['debug'](_0xce8e('0x1b'),_0x102efe,JSON[_0xce8e('0x10')](_0x178840));_0x11a098(_0x178840);})[_0xce8e('0x16')](function(_0x461d39){logger[_0xce8e('0x11')](_0xce8e('0x1b'),_0x461d39[_0xce8e('0x13')],_0x102efe);_0x2e4089(_0x1b3125[_0xce8e('0x11')](0x1f4,_0x461d39[_0xce8e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f089092..1f10eae 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 _0x2fd5=['destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete'];(function(_0x33b986,_0x40da5f){var _0x4ddaca=function(_0x27cd7a){while(--_0x27cd7a){_0x33b986['push'](_0x33b986['shift']());}};_0x4ddaca(++_0x40da5f);}(_0x2fd5,0xd9));var _0x52fd=function(_0x3c49e4,_0x4c191e){_0x3c49e4=_0x3c49e4-0x0;var _0x567b07=_0x2fd5[_0x3c49e4];return _0x567b07;};'use strict';var multer=require('multer');var util=require(_0x52fd('0x0'));var path=require(_0x52fd('0x1'));var timeout=require(_0x52fd('0x2'));var express=require('express');var router=express[_0x52fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x52fd('0x4'));var interaction=require(_0x52fd('0x5'));var config=require(_0x52fd('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0x52fd('0x7')](),controller[_0x52fd('0x8')]);router[_0x52fd('0x9')]('/describe',auth[_0x52fd('0x7')](),controller[_0x52fd('0xa')]);router[_0x52fd('0x9')](_0x52fd('0xb'),auth[_0x52fd('0x7')](),controller[_0x52fd('0xc')]);router[_0x52fd('0xd')]('/',auth[_0x52fd('0x7')](),controller[_0x52fd('0xe')]);router['put'](_0x52fd('0xb'),auth['isAuthenticated'](),controller[_0x52fd('0xf')]);router[_0x52fd('0x10')](_0x52fd('0xb'),auth[_0x52fd('0x7')](),controller[_0x52fd('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcb76=['destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete'];(function(_0x156317,_0x5e1e78){var _0x4ecf92=function(_0x2bbeb4){while(--_0x2bbeb4){_0x156317['push'](_0x156317['shift']());}};_0x4ecf92(++_0x5e1e78);}(_0xcb76,0x156));var _0x6cb7=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcb76[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require(_0x6cb7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6cb7('0x1'));var router=express[_0x6cb7('0x2')]();var fs_extra=require(_0x6cb7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6cb7('0x4'));var config=require(_0x6cb7('0x5'));var controller=require(_0x6cb7('0x6'));router[_0x6cb7('0x7')]('/',auth[_0x6cb7('0x8')](),controller[_0x6cb7('0x9')]);router[_0x6cb7('0x7')](_0x6cb7('0xa'),auth['isAuthenticated'](),controller[_0x6cb7('0xb')]);router[_0x6cb7('0x7')](_0x6cb7('0xc'),auth[_0x6cb7('0x8')](),controller[_0x6cb7('0xd')]);router[_0x6cb7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6cb7('0xf')](_0x6cb7('0xc'),auth[_0x6cb7('0x8')](),controller[_0x6cb7('0x10')]);router[_0x6cb7('0x11')](_0x6cb7('0xc'),auth['isAuthenticated'](),controller[_0x6cb7('0x12')]);module[_0x6cb7('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index bf77ca9..65c7186 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 _0x7104=['STRING','TEXT','exports'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7104,0x191));var _0x4710=function(_0x2f3d2e,_0x5650c8){_0x2f3d2e=_0x2f3d2e-0x0;var _0x5af34c=_0x7104[_0x2f3d2e];return _0x5af34c;};'use strict';var Sequelize=require('sequelize');module[_0x4710('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x4710('0x1')]},'application':{'type':Sequelize[_0x4710('0x1')]},'data':{'type':Sequelize[_0x4710('0x2')]},'project_name':{'type':Sequelize[_0x4710('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb1f=['TEXT','sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xeb1f,0x1a1));var _0xfeb1=function(_0x3d842c,_0x36728b){_0x3d842c=_0x3d842c-0x0;var _0x48404c=_0xeb1f[_0x3d842c];return _0x48404c;};'use strict';var Sequelize=require(_0xfeb1('0x0'));module[_0xfeb1('0x1')]={'uniqueid':{'type':Sequelize[_0xfeb1('0x2')]},'node':{'type':Sequelize[_0xfeb1('0x2')]},'application':{'type':Sequelize[_0xfeb1('0x2')]},'data':{'type':Sequelize[_0xfeb1('0x3')]},'project_name':{'type':Sequelize[_0xfeb1('0x2')]},'callerid':{'type':Sequelize[_0xfeb1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d7160cd..c583535 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 _0xd0fa=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','catch','include','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','send','SquareDetailsReport','rawAttributes','type','key','model','map','name','query'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd0fa,0x13f));var _0xad0f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xd0fa[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0xad0f('0x0'));var rimraf=require(_0xad0f('0x1'));var zipdir=require(_0xad0f('0x2'));var jsonpatch=require(_0xad0f('0x3'));var rp=require(_0xad0f('0x4'));var moment=require(_0xad0f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad0f('0x6'));var util=require(_0xad0f('0x7'));var path=require(_0xad0f('0x8'));var sox=require(_0xad0f('0x9'));var csv=require(_0xad0f('0xa'));var ejs=require(_0xad0f('0xb'));var fs=require('fs');var fs_extra=require(_0xad0f('0xc'));var _=require(_0xad0f('0xd'));var squel=require(_0xad0f('0xe'));var crypto=require(_0xad0f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xad0f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xad0f('0x11'));var Papa=require(_0xad0f('0x12'));var Redis=require(_0xad0f('0x13'));var authService=require(_0xad0f('0x14'));var qs=require(_0xad0f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad0f('0x16'));var logger=require('../../config/logger')(_0xad0f('0x17'));var utils=require(_0xad0f('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad0f('0x19'))['db'];function respondWithStatusCode(_0x30073f,_0x45822b){_0x45822b=_0x45822b||0xcc;return function(_0x528d06){if(_0x528d06){return _0x30073f['sendStatus'](_0x45822b);}return _0x30073f[_0xad0f('0x1a')](_0x45822b)['end']();};}function respondWithResult(_0x11757f,_0x319b34){_0x319b34=_0x319b34||0xc8;return function(_0x5eea7f){if(_0x5eea7f){return _0x11757f[_0xad0f('0x1a')](_0x319b34)[_0xad0f('0x1b')](_0x5eea7f);}};}function respondWithFilteredResult(_0x28634f,_0x55c520){return function(_0xadabb2){if(_0xadabb2){var _0x254dcb=typeof _0x55c520[_0xad0f('0x1c')]===_0xad0f('0x1d')&&typeof _0x55c520[_0xad0f('0x1e')]===_0xad0f('0x1d');var _0xb2a850=_0xadabb2[_0xad0f('0x1f')];var _0x3377a=_0x254dcb?0x0:_0x55c520[_0xad0f('0x1c')];var _0x3dd16a=_0x254dcb?_0xadabb2[_0xad0f('0x1f')]:_0x55c520[_0xad0f('0x1c')]+_0x55c520[_0xad0f('0x1e')];var _0x18f505;if(_0x3dd16a>=_0xb2a850){_0x3dd16a=_0xb2a850;_0x18f505=0xc8;}else{_0x18f505=0xce;}_0x28634f['status'](_0x18f505);return _0x28634f[_0xad0f('0x20')](_0xad0f('0x21'),_0x3377a+'-'+_0x3dd16a+'/'+_0xb2a850)['json'](_0xadabb2);}return null;};}function patchUpdates(_0xed1cd4){return function(_0x219ca4){try{jsonpatch['apply'](_0x219ca4,_0xed1cd4,!![]);}catch(_0x27e5bb){return BPromise[_0xad0f('0x22')](_0x27e5bb);}return _0x219ca4[_0xad0f('0x23')]();};}function saveUpdates(_0x3a261f,_0x1c6c61){return function(_0x1218d5){if(_0x1218d5){return _0x1218d5[_0xad0f('0x24')](_0x3a261f)[_0xad0f('0x25')](function(_0x467cb8){return _0x467cb8;});}return null;};}function removeEntity(_0x4afcec,_0xd3ab93){return function(_0x8746f6){if(_0x8746f6){return _0x8746f6[_0xad0f('0x26')]()['then'](function(){_0x4afcec[_0xad0f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490713,_0x288670){return function(_0x437df9){if(!_0x437df9){_0x490713[_0xad0f('0x27')](0x194);}return _0x437df9;};}function handleError(_0x5318ea,_0x48ca38){_0x48ca38=_0x48ca38||0x1f4;return function(_0x386a78){logger[_0xad0f('0x28')](_0x386a78[_0xad0f('0x29')]);if(_0x386a78['name']){delete _0x386a78['name'];}_0x5318ea[_0xad0f('0x1a')](_0x48ca38)[_0xad0f('0x2a')](_0x386a78);};}exports['index']=function(_0x28bee5,_0x321e8a){var _0x47ebde={},_0x2af163={},_0x5205ec={'count':0x0,'rows':[]};var _0x8ae35=_['map'](db[_0xad0f('0x2b')][_0xad0f('0x2c')],function(_0x3f9bfb){return{'name':_0x3f9bfb['fieldName'],'type':_0x3f9bfb[_0xad0f('0x2d')][_0xad0f('0x2e')]};});_0x2af163[_0xad0f('0x2f')]=_[_0xad0f('0x30')](_0x8ae35,_0xad0f('0x31'));_0x2af163[_0xad0f('0x32')]=_[_0xad0f('0x33')](_0x28bee5['query']);_0x2af163[_0xad0f('0x34')]=_[_0xad0f('0x35')](_0x2af163[_0xad0f('0x2f')],_0x2af163['query']);_0x47ebde['attributes']=_['intersection'](_0x2af163[_0xad0f('0x2f')],qs[_0xad0f('0x36')](_0x28bee5['query'][_0xad0f('0x36')]));_0x47ebde[_0xad0f('0x37')]=_0x47ebde[_0xad0f('0x37')][_0xad0f('0x38')]?_0x47ebde['attributes']:_0x2af163[_0xad0f('0x2f')];if(!_0x28bee5[_0xad0f('0x32')][_0xad0f('0x39')](_0xad0f('0x3a'))){_0x47ebde[_0xad0f('0x1e')]=qs['limit'](_0x28bee5[_0xad0f('0x32')][_0xad0f('0x1e')]);_0x47ebde[_0xad0f('0x1c')]=qs[_0xad0f('0x1c')](_0x28bee5[_0xad0f('0x32')][_0xad0f('0x1c')]);}_0x47ebde['order']=qs[_0xad0f('0x3b')](_0x28bee5[_0xad0f('0x32')]['sort']);_0x47ebde[_0xad0f('0x3c')]=qs[_0xad0f('0x34')](_[_0xad0f('0x3d')](_0x28bee5['query'],_0x2af163[_0xad0f('0x34')]),_0x8ae35);if(_0x28bee5[_0xad0f('0x32')][_0xad0f('0x3e')]){_0x47ebde[_0xad0f('0x3c')]=_[_0xad0f('0x3f')](_0x47ebde[_0xad0f('0x3c')],{'$or':_[_0xad0f('0x30')](_0x8ae35,function(_0x350fc9){if(_0x350fc9['type']!=='VIRTUAL'){var _0x2b0628={};_0x2b0628[_0x350fc9[_0xad0f('0x31')]]={'$like':'%'+_0x28bee5[_0xad0f('0x32')][_0xad0f('0x3e')]+'%'};return _0x2b0628;}})});}_0x47ebde=_[_0xad0f('0x3f')]({},_0x47ebde,_0x28bee5['options']);var _0x30ba9b={'where':_0x47ebde['where']};return db[_0xad0f('0x2b')][_0xad0f('0x1f')](_0x30ba9b)[_0xad0f('0x25')](function(_0x54179f){_0x5205ec[_0xad0f('0x1f')]=_0x54179f;if(_0x28bee5[_0xad0f('0x32')][_0xad0f('0x40')]){_0x47ebde['include']=[{'all':!![]}];}return db[_0xad0f('0x2b')][_0xad0f('0x41')](_0x47ebde);})[_0xad0f('0x25')](function(_0x31f184){_0x5205ec['rows']=_0x31f184;return _0x5205ec;})['then'](respondWithFilteredResult(_0x321e8a,_0x47ebde))[_0xad0f('0x42')](handleError(_0x321e8a,null));};exports['show']=function(_0x2484dd,_0x47b7e5){var _0x459dd4={'raw':!![],'where':{'id':_0x2484dd['params']['id']}},_0x454b11={};_0x454b11['model']=_['keys'](db[_0xad0f('0x2b')][_0xad0f('0x2c')]);_0x454b11[_0xad0f('0x32')]=_[_0xad0f('0x33')](_0x2484dd[_0xad0f('0x32')]);_0x454b11['filters']=_[_0xad0f('0x35')](_0x454b11[_0xad0f('0x2f')],_0x454b11['query']);_0x459dd4[_0xad0f('0x37')]=_[_0xad0f('0x35')](_0x454b11[_0xad0f('0x2f')],qs[_0xad0f('0x36')](_0x2484dd[_0xad0f('0x32')]['fields']));_0x459dd4[_0xad0f('0x37')]=_0x459dd4[_0xad0f('0x37')]['length']?_0x459dd4['attributes']:_0x454b11['model'];if(_0x2484dd['query'][_0xad0f('0x40')]){_0x459dd4[_0xad0f('0x43')]=[{'all':!![]}];}_0x459dd4=_[_0xad0f('0x3f')]({},_0x459dd4,_0x2484dd[_0xad0f('0x44')]);return db[_0xad0f('0x2b')]['find'](_0x459dd4)[_0xad0f('0x25')](handleEntityNotFound(_0x47b7e5,null))[_0xad0f('0x25')](respondWithResult(_0x47b7e5,null))[_0xad0f('0x42')](handleError(_0x47b7e5,null));};exports['create']=function(_0x351425,_0x542094){return db[_0xad0f('0x2b')][_0xad0f('0x45')](_0x351425[_0xad0f('0x46')],{})[_0xad0f('0x25')](respondWithResult(_0x542094,0xc9))[_0xad0f('0x42')](handleError(_0x542094,null));};exports[_0xad0f('0x24')]=function(_0x2995f5,_0x9ca48b){if(_0x2995f5[_0xad0f('0x46')]['id']){delete _0x2995f5[_0xad0f('0x46')]['id'];}return db['SquareDetailsReport'][_0xad0f('0x47')]({'where':{'id':_0x2995f5[_0xad0f('0x48')]['id']}})[_0xad0f('0x25')](handleEntityNotFound(_0x9ca48b,null))[_0xad0f('0x25')](saveUpdates(_0x2995f5['body'],null))[_0xad0f('0x25')](respondWithResult(_0x9ca48b,null))['catch'](handleError(_0x9ca48b,null));};exports[_0xad0f('0x26')]=function(_0x29d6e1,_0x5d4c45){return db[_0xad0f('0x2b')][_0xad0f('0x47')]({'where':{'id':_0x29d6e1[_0xad0f('0x48')]['id']}})[_0xad0f('0x25')](handleEntityNotFound(_0x5d4c45,null))[_0xad0f('0x25')](removeEntity(_0x5d4c45,null))['catch'](handleError(_0x5d4c45,null));};exports[_0xad0f('0x49')]=function(_0x2eb3a1,_0x40af54){return db['SquareDetailsReport'][_0xad0f('0x49')]()[_0xad0f('0x25')](respondWithResult(_0x40af54,null))['catch'](handleError(_0x40af54,null));}; \ No newline at end of file +var _0x26e9=['offset','limit','set','reject','save','update','then','destroy','end','error','name','send','index','SquareDetailsReport','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count'];(function(_0x3c52cb,_0x3822cb){var _0xc6f33=function(_0x3cbfbc){while(--_0x3cbfbc){_0x3c52cb['push'](_0x3c52cb['shift']());}};_0xc6f33(++_0x3822cb);}(_0x26e9,0x1a8));var _0x926e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x26e9[_0x386c3e];return _0x4b8e13;};'use strict';var emlformat=require(_0x926e('0x0'));var rimraf=require(_0x926e('0x1'));var zipdir=require(_0x926e('0x2'));var jsonpatch=require(_0x926e('0x3'));var rp=require(_0x926e('0x4'));var moment=require(_0x926e('0x5'));var BPromise=require(_0x926e('0x6'));var Mustache=require(_0x926e('0x7'));var util=require('util');var path=require(_0x926e('0x8'));var sox=require(_0x926e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x926e('0xa'));var _=require('lodash');var squel=require(_0x926e('0xb'));var crypto=require(_0x926e('0xc'));var jsforce=require(_0x926e('0xd'));var deskjs=require(_0x926e('0xe'));var toCsv=require(_0x926e('0xf'));var querystring=require(_0x926e('0x10'));var Papa=require(_0x926e('0x11'));var Redis=require(_0x926e('0x12'));var authService=require(_0x926e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x926e('0x14'));var logger=require(_0x926e('0x15'))(_0x926e('0x16'));var utils=require(_0x926e('0x17'));var config=require(_0x926e('0x18'));var licenseUtil=require(_0x926e('0x19'));var db=require(_0x926e('0x1a'))['db'];function respondWithStatusCode(_0x3b93a3,_0x19b6c0){_0x19b6c0=_0x19b6c0||0xcc;return function(_0x4804fc){if(_0x4804fc){return _0x3b93a3[_0x926e('0x1b')](_0x19b6c0);}return _0x3b93a3['status'](_0x19b6c0)['end']();};}function respondWithResult(_0x599f0c,_0x445de9){_0x445de9=_0x445de9||0xc8;return function(_0x956dc1){if(_0x956dc1){return _0x599f0c[_0x926e('0x1c')](_0x445de9)[_0x926e('0x1d')](_0x956dc1);}};}function respondWithFilteredResult(_0x403063,_0x173933){return function(_0x3f44fd){if(_0x3f44fd){var _0x75415d=typeof _0x173933['offset']===_0x926e('0x1e')&&typeof _0x173933['limit']===_0x926e('0x1e');var _0x492778=_0x3f44fd[_0x926e('0x1f')];var _0x5446a3=_0x75415d?0x0:_0x173933[_0x926e('0x20')];var _0x58a91c=_0x75415d?_0x3f44fd['count']:_0x173933[_0x926e('0x20')]+_0x173933[_0x926e('0x21')];var _0x4ed1a6;if(_0x58a91c>=_0x492778){_0x58a91c=_0x492778;_0x4ed1a6=0xc8;}else{_0x4ed1a6=0xce;}_0x403063[_0x926e('0x1c')](_0x4ed1a6);return _0x403063[_0x926e('0x22')]('Content-Range',_0x5446a3+'-'+_0x58a91c+'/'+_0x492778)[_0x926e('0x1d')](_0x3f44fd);}return null;};}function patchUpdates(_0x4fbf07){return function(_0x2094eb){try{jsonpatch['apply'](_0x2094eb,_0x4fbf07,!![]);}catch(_0x492c9e){return BPromise[_0x926e('0x23')](_0x492c9e);}return _0x2094eb[_0x926e('0x24')]();};}function saveUpdates(_0x816303,_0x443cf5){return function(_0x3f7b63){if(_0x3f7b63){return _0x3f7b63[_0x926e('0x25')](_0x816303)[_0x926e('0x26')](function(_0x3d37ff){return _0x3d37ff;});}return null;};}function removeEntity(_0x51a795,_0x3d00e2){return function(_0x2b85f8){if(_0x2b85f8){return _0x2b85f8[_0x926e('0x27')]()[_0x926e('0x26')](function(){_0x51a795[_0x926e('0x1c')](0xcc)[_0x926e('0x28')]();});}};}function handleEntityNotFound(_0x561cb0,_0x713575){return function(_0x580b64){if(!_0x580b64){_0x561cb0[_0x926e('0x1b')](0x194);}return _0x580b64;};}function handleError(_0x46fbbb,_0x6e2b21){_0x6e2b21=_0x6e2b21||0x1f4;return function(_0x530469){logger[_0x926e('0x29')](_0x530469['stack']);if(_0x530469[_0x926e('0x2a')]){delete _0x530469[_0x926e('0x2a')];}_0x46fbbb[_0x926e('0x1c')](_0x6e2b21)[_0x926e('0x2b')](_0x530469);};}exports[_0x926e('0x2c')]=function(_0x16b911,_0x5dfbfc){var _0x2db583={},_0x495686={},_0x3d6a9a={'count':0x0,'rows':[]};var _0x3268cf=_['map'](db[_0x926e('0x2d')][_0x926e('0x2e')],function(_0x3c9d76){return{'name':_0x3c9d76['fieldName'],'type':_0x3c9d76[_0x926e('0x2f')]['key']};});_0x495686[_0x926e('0x30')]=_[_0x926e('0x31')](_0x3268cf,'name');_0x495686[_0x926e('0x32')]=_[_0x926e('0x33')](_0x16b911[_0x926e('0x32')]);_0x495686[_0x926e('0x34')]=_[_0x926e('0x35')](_0x495686['model'],_0x495686[_0x926e('0x32')]);_0x2db583[_0x926e('0x36')]=_[_0x926e('0x35')](_0x495686[_0x926e('0x30')],qs[_0x926e('0x37')](_0x16b911[_0x926e('0x32')][_0x926e('0x37')]));_0x2db583['attributes']=_0x2db583[_0x926e('0x36')][_0x926e('0x38')]?_0x2db583[_0x926e('0x36')]:_0x495686[_0x926e('0x30')];if(!_0x16b911['query'][_0x926e('0x39')](_0x926e('0x3a'))){_0x2db583['limit']=qs[_0x926e('0x21')](_0x16b911['query'][_0x926e('0x21')]);_0x2db583[_0x926e('0x20')]=qs[_0x926e('0x20')](_0x16b911[_0x926e('0x32')][_0x926e('0x20')]);}_0x2db583[_0x926e('0x3b')]=qs[_0x926e('0x3c')](_0x16b911['query'][_0x926e('0x3c')]);_0x2db583[_0x926e('0x3d')]=qs[_0x926e('0x34')](_[_0x926e('0x3e')](_0x16b911[_0x926e('0x32')],_0x495686['filters']),_0x3268cf);if(_0x16b911['query']['filter']){_0x2db583[_0x926e('0x3d')]=_[_0x926e('0x3f')](_0x2db583[_0x926e('0x3d')],{'$or':_['map'](_0x3268cf,function(_0x2fe350){if(_0x2fe350[_0x926e('0x2f')]!==_0x926e('0x40')){var _0x51671b={};_0x51671b[_0x2fe350[_0x926e('0x2a')]]={'$like':'%'+_0x16b911['query']['filter']+'%'};return _0x51671b;}})});}_0x2db583=_[_0x926e('0x3f')]({},_0x2db583,_0x16b911[_0x926e('0x41')]);var _0x190e61={'where':_0x2db583[_0x926e('0x3d')]};return db[_0x926e('0x2d')][_0x926e('0x1f')](_0x190e61)[_0x926e('0x26')](function(_0x105393){_0x3d6a9a[_0x926e('0x1f')]=_0x105393;if(_0x16b911['query'][_0x926e('0x42')]){_0x2db583[_0x926e('0x43')]=[{'all':!![]}];}return db[_0x926e('0x2d')]['findAll'](_0x2db583);})[_0x926e('0x26')](function(_0x2e9219){_0x3d6a9a[_0x926e('0x44')]=_0x2e9219;return _0x3d6a9a;})[_0x926e('0x26')](respondWithFilteredResult(_0x5dfbfc,_0x2db583))[_0x926e('0x45')](handleError(_0x5dfbfc,null));};exports[_0x926e('0x46')]=function(_0x463d70,_0x52a8e1){var _0x19e542={'raw':!![],'where':{'id':_0x463d70[_0x926e('0x47')]['id']}},_0x13696f={};_0x13696f[_0x926e('0x30')]=_[_0x926e('0x33')](db['SquareDetailsReport'][_0x926e('0x2e')]);_0x13696f[_0x926e('0x32')]=_['keys'](_0x463d70[_0x926e('0x32')]);_0x13696f[_0x926e('0x34')]=_[_0x926e('0x35')](_0x13696f[_0x926e('0x30')],_0x13696f[_0x926e('0x32')]);_0x19e542[_0x926e('0x36')]=_['intersection'](_0x13696f['model'],qs['fields'](_0x463d70[_0x926e('0x32')][_0x926e('0x37')]));_0x19e542[_0x926e('0x36')]=_0x19e542['attributes']['length']?_0x19e542[_0x926e('0x36')]:_0x13696f[_0x926e('0x30')];if(_0x463d70[_0x926e('0x32')][_0x926e('0x42')]){_0x19e542[_0x926e('0x43')]=[{'all':!![]}];}_0x19e542=_['merge']({},_0x19e542,_0x463d70[_0x926e('0x41')]);return db[_0x926e('0x2d')][_0x926e('0x48')](_0x19e542)[_0x926e('0x26')](handleEntityNotFound(_0x52a8e1,null))[_0x926e('0x26')](respondWithResult(_0x52a8e1,null))[_0x926e('0x45')](handleError(_0x52a8e1,null));};exports['create']=function(_0x4921fb,_0x78174){return db[_0x926e('0x2d')][_0x926e('0x49')](_0x4921fb['body'],{})[_0x926e('0x26')](respondWithResult(_0x78174,0xc9))['catch'](handleError(_0x78174,null));};exports['update']=function(_0x48fdb0,_0x41a81f){if(_0x48fdb0[_0x926e('0x4a')]['id']){delete _0x48fdb0[_0x926e('0x4a')]['id'];}return db[_0x926e('0x2d')][_0x926e('0x48')]({'where':{'id':_0x48fdb0[_0x926e('0x47')]['id']}})[_0x926e('0x26')](handleEntityNotFound(_0x41a81f,null))[_0x926e('0x26')](saveUpdates(_0x48fdb0['body'],null))[_0x926e('0x26')](respondWithResult(_0x41a81f,null))[_0x926e('0x45')](handleError(_0x41a81f,null));};exports['destroy']=function(_0x8f0edd,_0x91c178){return db[_0x926e('0x2d')][_0x926e('0x48')]({'where':{'id':_0x8f0edd['params']['id']}})[_0x926e('0x26')](handleEntityNotFound(_0x91c178,null))['then'](removeEntity(_0x91c178,null))[_0x926e('0x45')](handleError(_0x91c178,null));};exports[_0x926e('0x4b')]=function(_0x4addf3,_0x3da391){return db['SquareDetailsReport'][_0x926e('0x4b')]()[_0x926e('0x26')](respondWithResult(_0x3da391,null))[_0x926e('0x45')](handleError(_0x3da391,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5a2b24d..97dda31 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 _0x9599=['define','SquareDetailsReport','report_square_details','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0xb04448,_0x4b803c){var _0x41e47a=function(_0x34831b){while(--_0x34831b){_0xb04448['push'](_0xb04448['shift']());}};_0x41e47a(++_0x4b803c);}(_0x9599,0x92));var _0x9959=function(_0x2a0e45,_0x370c5d){_0x2a0e45=_0x2a0e45-0x0;var _0x3595b8=_0x9599[_0x2a0e45];return _0x3595b8;};'use strict';var _=require(_0x9959('0x0'));var util=require(_0x9959('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9959('0x2'));var BPromise=require('bluebird');var rp=require(_0x9959('0x3'));var fs=require('fs');var path=require(_0x9959('0x4'));var rimraf=require(_0x9959('0x5'));var config=require(_0x9959('0x6'));var attributes=require(_0x9959('0x7'));module['exports']=function(_0x58de39,_0x324dfe){return _0x58de39[_0x9959('0x8')](_0x9959('0x9'),attributes,{'tableName':_0x9959('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3324=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details'];(function(_0x186bd9,_0x4ff353){var _0x282a1e=function(_0x1a08a8){while(--_0x1a08a8){_0x186bd9['push'](_0x186bd9['shift']());}};_0x282a1e(++_0x4ff353);}(_0x3324,0xc3));var _0x4332=function(_0x30aafb,_0x15166d){_0x30aafb=_0x30aafb-0x0;var _0x25f84f=_0x3324[_0x30aafb];return _0x25f84f;};'use strict';var _=require(_0x4332('0x0'));var util=require(_0x4332('0x1'));var logger=require(_0x4332('0x2'))(_0x4332('0x3'));var moment=require(_0x4332('0x4'));var BPromise=require(_0x4332('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4332('0x6'));var rimraf=require(_0x4332('0x7'));var config=require(_0x4332('0x8'));var attributes=require(_0x4332('0x9'));module['exports']=function(_0x324176,_0x1f1068){return _0x324176[_0x4332('0xa')](_0x4332('0xb'),attributes,{'tableName':_0x4332('0xc'),'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 aafda7a..fae5ff1 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 _0xd070=['code','message','result','catch','create','options','CreateSquareDetailsReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x30c93d,_0x1e3bb7){var _0x4d9f45=function(_0xe268eb){while(--_0xe268eb){_0x30c93d['push'](_0x30c93d['shift']());}};_0x4d9f45(++_0x1e3bb7);}(_0xd070,0x8e));var _0x0d07=function(_0x564e69,_0xe9b154){_0x564e69=_0x564e69-0x0;var _0x31f926=_0xd070[_0x564e69];return _0x31f926;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['CreateSquareDetailsReport']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['SquareDetailsReport'][_0x0d07('0x18')](_0x187df2['body'],{'raw':_0x187df2['options']?_0x187df2[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d07('0xd')](function(_0x54790f){logger[_0x0d07('0xe')]('CreateSquareDetailsReport',_0x187df2);logger['debug'](_0x0d07('0x1a'),_0x187df2,JSON[_0x0d07('0x12')](_0x54790f));_0x52cb4b(_0x54790f);})[_0x0d07('0x17')](function(_0x57e997){logger[_0x0d07('0x13')]('CreateSquareDetailsReport',_0x57e997['message'],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x57e997[_0x0d07('0x15')]));});});}; \ No newline at end of file +var _0x1b0e=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','create','options','raw','stringify','lodash','util'];(function(_0x53ff8d,_0x53b3f8){var _0x36ae29=function(_0x31e1f6){while(--_0x31e1f6){_0x53ff8d['push'](_0x53ff8d['shift']());}};_0x36ae29(++_0x53b3f8);}(_0x1b0e,0x132));var _0xe1b0=function(_0x55c94b,_0x599362){_0x55c94b=_0x55c94b-0x0;var _0x557468=_0x1b0e[_0x55c94b];return _0x557468;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});}exports[_0xe1b0('0x17')]=function(_0x2928b6){var _0x349f90=this;return new Promise(function(_0x5c195f,_0x5b300e){return db['SquareDetailsReport'][_0xe1b0('0x18')](_0x2928b6['body'],{'raw':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6[_0xe1b0('0x19')][_0xe1b0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3e0a89){logger[_0xe1b0('0xd')]('CreateSquareDetailsReport',_0x2928b6);logger[_0xe1b0('0x10')](_0xe1b0('0x17'),_0x2928b6,JSON[_0xe1b0('0x1b')](_0x3e0a89));_0x5c195f(_0x3e0a89);})['catch'](function(_0x3c0824){logger['error']('CreateSquareDetailsReport',_0x3c0824['message'],_0x2928b6);_0x5b300e(_0x349f90['error'](0x1f4,_0x3c0824[_0xe1b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 43344ac..aea8b33 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 _0x6533=['express','Router','../../components/auth/service','./system.controller','isAuthenticated','get','/process/:pid/kill','exports'];(function(_0x585fa9,_0x85f5da){var _0x180a03=function(_0x3e4335){while(--_0x3e4335){_0x585fa9['push'](_0x585fa9['shift']());}};_0x180a03(++_0x85f5da);}(_0x6533,0xd0));var _0x3653=function(_0x5ed9a6,_0x2ff6d4){_0x5ed9a6=_0x5ed9a6-0x0;var _0x15b6c2=_0x6533[_0x5ed9a6];return _0x15b6c2;};'use strict';var express=require(_0x3653('0x0'));var router=express[_0x3653('0x1')]();var auth=require(_0x3653('0x2'));var controller=require(_0x3653('0x3'));router['get']('/',auth[_0x3653('0x4')](),controller['index']);router[_0x3653('0x5')](_0x3653('0x6'),auth[_0x3653('0x4')](),controller['killProcess']);module[_0x3653('0x7')]=router; \ No newline at end of file +var _0x6dc0=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x6dc0,0x192));var _0x06dc=function(_0x1a663e,_0x357c47){_0x1a663e=_0x1a663e-0x0;var _0x4055ab=_0x6dc0[_0x1a663e];return _0x4055ab;};'use strict';var express=require(_0x06dc('0x0'));var router=express[_0x06dc('0x1')]();var auth=require(_0x06dc('0x2'));var controller=require(_0x06dc('0x3'));router[_0x06dc('0x4')]('/',auth[_0x06dc('0x5')](),controller['index']);router[_0x06dc('0x4')](_0x06dc('0x6'),auth[_0x06dc('0x5')](),controller[_0x06dc('0x7')]);module[_0x06dc('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 016d914..a42bf89 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 _0xc030=['then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index'];(function(_0x449607,_0x287561){var _0x972d5=function(_0x222241){while(--_0x222241){_0x449607['push'](_0x449607['shift']());}};_0x972d5(++_0x287561);}(_0xc030,0x188));var _0x0c03=function(_0x412ca3,_0x43e333){_0x412ca3=_0x412ca3-0x0;var _0x22cd49=_0xc030[_0x412ca3];return _0x22cd49;};'use strict';var info=require(_0x0c03('0x0'));var exec=require(_0x0c03('0x1'))[_0x0c03('0x2')];var logger=require('../../config/logger')(_0x0c03('0x3'));var util=require(_0x0c03('0x4'));var BPromise=require(_0x0c03('0x5'));var _=require(_0x0c03('0x6'));function handleError(_0x342157,_0x47f9f3,_0x110c1d){_0x47f9f3=_0x47f9f3||0x1f4;return function(_0x13a464){logger[_0x0c03('0x7')](_0x0c03('0x8'),_0x110c1d,_0x47f9f3,util[_0x0c03('0x9')](_0x13a464,{'showHidden':![],'depth':null}));delete _0x13a464[_0x0c03('0xa')];_0x342157[_0x0c03('0xb')](_0x47f9f3)[_0x0c03('0xc')](_0x13a464);};}exports[_0x0c03('0xd')]=function(_0x5b2988,_0x39a291){return info['getAllData']()[_0x0c03('0xe')](function(_0xcf13f3){return _0x39a291[_0x0c03('0xb')](0xc8)['json'](_0xcf13f3);})[_0x0c03('0xf')](function(_0x2e0b82){return _0x39a291[_0x0c03('0xb')](0x1f4)[_0x0c03('0x10')](_0x2e0b82);});};exports[_0x0c03('0x11')]=function(_0x31f7e2,_0x4753cd){var _0x4a9d7c=[_0x0c03('0x12')];return new BPromise(function(_0x2cbb42,_0xac6ed7){return exec(util[_0x0c03('0x13')](_0x0c03('0x14'),_0x31f7e2[_0x0c03('0x15')][_0x0c03('0x16')]),function(_0x365844,_0x2156fd,_0x257a5b){if(_0x365844){return _0xac6ed7(_0x365844);}return _0x2cbb42(_0x2156fd);});})[_0x0c03('0xe')](function(_0x1c83ef){var _0x226573=![];var _0xa8725=_0x1c83ef[_0x0c03('0x17')](/\n/);for(var _0x532484=0x0,_0xf1876d=_0x4a9d7c['length'];_0x532484<_0xf1876d,_0x226573===![];_0x532484+=0x1){if(_0x1c83ef[_0x0c03('0x18')](_0x4a9d7c[_0x532484])>=0x0){_0x226573=!![];}}if(!_0x226573){throw new Error(util[_0x0c03('0x13')](_0x0c03('0x19'),_0x31f7e2[_0x0c03('0x15')][_0x0c03('0x16')]));}process[_0x0c03('0x1a')](_0x31f7e2[_0x0c03('0x15')][_0x0c03('0x16')],_0x0c03('0x1b'));return _0x4753cd['status'](0xc8)[_0x0c03('0x10')]({'message':util[_0x0c03('0x13')](_0x0c03('0x1c'),_0x31f7e2[_0x0c03('0x15')]['pid'])});})[_0x0c03('0xf')](handleError(_0x4753cd,null,'killProcess'));}; \ No newline at end of file +var _0xd653=['format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','catch','json','killProcess','params','pid','then','split','length','indexOf'];(function(_0x21e920,_0x296dc3){var _0x47f9c5=function(_0x33b9c0){while(--_0x33b9c0){_0x21e920['push'](_0x21e920['shift']());}};_0x47f9c5(++_0x296dc3);}(_0xd653,0x163));var _0x3d65=function(_0x2040c4,_0xed7d3a){_0x2040c4=_0x2040c4-0x0;var _0x52e940=_0xd653[_0x2040c4];return _0x52e940;};'use strict';var info=require(_0x3d65('0x0'));var exec=require(_0x3d65('0x1'))['exec'];var logger=require(_0x3d65('0x2'))(_0x3d65('0x3'));var util=require(_0x3d65('0x4'));var BPromise=require(_0x3d65('0x5'));var _=require('lodash');function handleError(_0xe8df2,_0x1b9ad6,_0x335f45){_0x1b9ad6=_0x1b9ad6||0x1f4;return function(_0x2259a4){logger[_0x3d65('0x6')](_0x3d65('0x7'),_0x335f45,_0x1b9ad6,util[_0x3d65('0x8')](_0x2259a4,{'showHidden':![],'depth':null}));delete _0x2259a4[_0x3d65('0x9')];_0xe8df2[_0x3d65('0xa')](_0x1b9ad6)[_0x3d65('0xb')](_0x2259a4);};}exports[_0x3d65('0xc')]=function(_0x266420,_0x1f3c14){return info[_0x3d65('0xd')]()['then'](function(_0x569e9c){return _0x1f3c14[_0x3d65('0xa')](0xc8)['json'](_0x569e9c);})[_0x3d65('0xe')](function(_0x59e89a){return _0x1f3c14[_0x3d65('0xa')](0x1f4)[_0x3d65('0xf')](_0x59e89a);});};exports[_0x3d65('0x10')]=function(_0x5dd9c4,_0x515fed){var _0x175659=['components/import/cm'];return new BPromise(function(_0x8c583d,_0x1e680d){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5dd9c4[_0x3d65('0x11')][_0x3d65('0x12')]),function(_0x387ff5,_0x5a5ba9,_0x10d3de){if(_0x387ff5){return _0x1e680d(_0x387ff5);}return _0x8c583d(_0x5a5ba9);});})[_0x3d65('0x13')](function(_0x5929d9){var _0x1bf377=![];var _0xff5856=_0x5929d9[_0x3d65('0x14')](/\n/);for(var _0x52b57a=0x0,_0x45d9bc=_0x175659[_0x3d65('0x15')];_0x52b57a<_0x45d9bc,_0x1bf377===![];_0x52b57a+=0x1){if(_0x5929d9[_0x3d65('0x16')](_0x175659[_0x52b57a])>=0x0){_0x1bf377=!![];}}if(!_0x1bf377){throw new Error(util[_0x3d65('0x17')](_0x3d65('0x18'),_0x5dd9c4[_0x3d65('0x11')][_0x3d65('0x12')]));}process[_0x3d65('0x19')](_0x5dd9c4[_0x3d65('0x11')][_0x3d65('0x12')],'SIGINT');return _0x515fed['status'](0xc8)[_0x3d65('0xf')]({'message':util['format'](_0x3d65('0x1a'),_0x5dd9c4['params']['pid'])});})[_0x3d65('0xe')](handleError(_0x515fed,null,_0x3d65('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 0192591..d977b8a 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 _0x1f8e=['../../components/interaction/service','./tag.controller','index','get','/:id','isAuthenticated','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xe93311,_0x43399a){var _0x1f6182=function(_0x5b78ef){while(--_0x5b78ef){_0xe93311['push'](_0xe93311['shift']());}};_0x1f6182(++_0x43399a);}(_0x1f8e,0xa4));var _0xe1f8=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x1f8e[_0x35b18a];return _0x4db1bd;};'use strict';var multer=require(_0xe1f8('0x0'));var util=require(_0xe1f8('0x1'));var path=require(_0xe1f8('0x2'));var timeout=require(_0xe1f8('0x3'));var express=require(_0xe1f8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe1f8('0x5'));var interaction=require(_0xe1f8('0x6'));var config=require('../../config/environment');var controller=require(_0xe1f8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe1f8('0x8')]);router[_0xe1f8('0x9')](_0xe1f8('0xa'),auth[_0xe1f8('0xb')](),controller['show']);router[_0xe1f8('0xc')]('/',auth[_0xe1f8('0xb')](),controller[_0xe1f8('0xd')]);router['put'](_0xe1f8('0xa'),auth[_0xe1f8('0xb')](),controller[_0xe1f8('0xe')]);router[_0xe1f8('0xf')](_0xe1f8('0xa'),auth['isAuthenticated'](),controller[_0xe1f8('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5e11=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','put'];(function(_0x23c02b,_0x411b4d){var _0x25efc5=function(_0x50e9e4){while(--_0x50e9e4){_0x23c02b['push'](_0x23c02b['shift']());}};_0x25efc5(++_0x411b4d);}(_0x5e11,0x1a6));var _0x15e1=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x5e11[_0x547e20];return _0x359171;};'use strict';var multer=require(_0x15e1('0x0'));var util=require('util');var path=require(_0x15e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x15e1('0x2'));var router=express[_0x15e1('0x3')]();var fs_extra=require(_0x15e1('0x4'));var auth=require(_0x15e1('0x5'));var interaction=require(_0x15e1('0x6'));var config=require(_0x15e1('0x7'));var controller=require(_0x15e1('0x8'));router['get']('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0xa')]);router[_0x15e1('0xb')]('/:id',auth[_0x15e1('0x9')](),controller[_0x15e1('0xc')]);router[_0x15e1('0xd')]('/',auth[_0x15e1('0x9')](),controller['create']);router[_0x15e1('0xe')]('/:id',auth[_0x15e1('0x9')](),controller[_0x15e1('0xf')]);router[_0x15e1('0x10')]('/:id',auth[_0x15e1('0x9')](),controller[_0x15e1('0x11')]);module[_0x15e1('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 56c1b03..ccf3c93 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 _0x68b7=['STRING','name','sequelize'];(function(_0x377278,_0x91237){var _0x1df123=function(_0x173e0d){while(--_0x173e0d){_0x377278['push'](_0x377278['shift']());}};_0x1df123(++_0x91237);}(_0x68b7,0x8c));var _0x768b=function(_0x45ea24,_0x3e0208){_0x45ea24=_0x45ea24-0x0;var _0x1d55d9=_0x68b7[_0x45ea24];return _0x1d55d9;};'use strict';var Sequelize=require(_0x768b('0x0'));module['exports']={'name':{'type':Sequelize[_0x768b('0x1')],'unique':_0x768b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x768b('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x768b('0x1')]}}; \ No newline at end of file +var _0xcecc=['sequelize','STRING','#0091EA'];(function(_0x302cd9,_0x374d0f){var _0x2b69a7=function(_0x3eb925){while(--_0x3eb925){_0x302cd9['push'](_0x302cd9['shift']());}};_0x2b69a7(++_0x374d0f);}(_0xcecc,0x186));var _0xccec=function(_0x53ba0e,_0x538d59){_0x53ba0e=_0x53ba0e-0x0;var _0x3a1f8d=_0xcecc[_0x53ba0e];return _0x3a1f8d;};'use strict';var Sequelize=require(_0xccec('0x0'));module['exports']={'name':{'type':Sequelize[_0xccec('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xccec('0x2')},'description':{'type':Sequelize[_0xccec('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a704734..fc96b25 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 _0x61a5=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x38f377,_0x461aed){var _0x4779f0=function(_0x103725){while(--_0x103725){_0x38f377['push'](_0x38f377['shift']());}};_0x4779f0(++_0x461aed);}(_0x61a5,0xf0));var _0x561a=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x61a5[_0xa30766];return _0x24e780;};'use strict';var emlformat=require(_0x561a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x561a('0x1'));var jsonpatch=require(_0x561a('0x2'));var rp=require(_0x561a('0x3'));var moment=require(_0x561a('0x4'));var BPromise=require(_0x561a('0x5'));var Mustache=require('mustache');var util=require(_0x561a('0x6'));var path=require(_0x561a('0x7'));var sox=require('sox');var csv=require(_0x561a('0x8'));var ejs=require(_0x561a('0x9'));var fs=require('fs');var fs_extra=require(_0x561a('0xa'));var _=require(_0x561a('0xb'));var squel=require(_0x561a('0xc'));var crypto=require(_0x561a('0xd'));var jsforce=require(_0x561a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x561a('0x8'));var querystring=require('querystring');var Papa=require(_0x561a('0xf'));var Redis=require(_0x561a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x561a('0x11'));var as=require(_0x561a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x561a('0x13'))('api');var utils=require(_0x561a('0x14'));var config=require(_0x561a('0x15'));var licenseUtil=require(_0x561a('0x16'));var db=require(_0x561a('0x17'))['db'];function respondWithStatusCode(_0x2777c6,_0x3dfa9f){_0x3dfa9f=_0x3dfa9f||0xcc;return function(_0x136465){if(_0x136465){return _0x2777c6[_0x561a('0x18')](_0x3dfa9f);}return _0x2777c6[_0x561a('0x19')](_0x3dfa9f)[_0x561a('0x1a')]();};}function respondWithResult(_0x2a332e,_0x28638b){_0x28638b=_0x28638b||0xc8;return function(_0x5696b9){if(_0x5696b9){return _0x2a332e[_0x561a('0x19')](_0x28638b)[_0x561a('0x1b')](_0x5696b9);}};}function respondWithFilteredResult(_0x1ab5ae,_0xecbcc4){return function(_0xd7f0fb){if(_0xd7f0fb){var _0x28ad8b=typeof _0xecbcc4[_0x561a('0x1c')]===_0x561a('0x1d')&&typeof _0xecbcc4[_0x561a('0x1e')]===_0x561a('0x1d');var _0x19870a=_0xd7f0fb['count'];var _0x43c5aa=_0x28ad8b?0x0:_0xecbcc4[_0x561a('0x1c')];var _0x533d95=_0x28ad8b?_0xd7f0fb[_0x561a('0x1f')]:_0xecbcc4[_0x561a('0x1c')]+_0xecbcc4['limit'];var _0x22c72a;if(_0x533d95>=_0x19870a){_0x533d95=_0x19870a;_0x22c72a=0xc8;}else{_0x22c72a=0xce;}_0x1ab5ae['status'](_0x22c72a);return _0x1ab5ae['set'](_0x561a('0x20'),_0x43c5aa+'-'+_0x533d95+'/'+_0x19870a)[_0x561a('0x1b')](_0xd7f0fb);}return null;};}function patchUpdates(_0x5ca8e9){return function(_0x432b33){try{jsonpatch[_0x561a('0x21')](_0x432b33,_0x5ca8e9,!![]);}catch(_0x1367e2){return BPromise[_0x561a('0x22')](_0x1367e2);}return _0x432b33[_0x561a('0x23')]();};}function saveUpdates(_0x1bb8df,_0x4f9c3a){return function(_0x3e5509){if(_0x3e5509){return _0x3e5509[_0x561a('0x24')](_0x1bb8df)[_0x561a('0x25')](function(_0x527207){return _0x527207;});}return null;};}function removeEntity(_0x58c32f,_0x25b53c){return function(_0x1d29d6){if(_0x1d29d6){return _0x1d29d6[_0x561a('0x26')]()[_0x561a('0x25')](function(){var _0x234771=_0x1d29d6[_0x561a('0x27')]({'plain':!![]});var _0x259963=_0x561a('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x259963,'resourceId':_0x234771['id']}})[_0x561a('0x25')](function(){return _0x1d29d6;});})[_0x561a('0x25')](function(){_0x58c32f[_0x561a('0x19')](0xcc)[_0x561a('0x1a')]();});}};}function handleEntityNotFound(_0x5a0acd,_0x186862){return function(_0x3f0789){if(!_0x3f0789){_0x5a0acd[_0x561a('0x18')](0x194);}return _0x3f0789;};}function handleError(_0x23b489,_0x3bdfa9){_0x3bdfa9=_0x3bdfa9||0x1f4;return function(_0x47f93a){logger[_0x561a('0x29')](_0x47f93a[_0x561a('0x2a')]);if(_0x47f93a['name']){delete _0x47f93a[_0x561a('0x2b')];}_0x23b489[_0x561a('0x19')](_0x3bdfa9)['send'](_0x47f93a);};}exports[_0x561a('0x2c')]=function(_0x591737,_0x54a47a){var _0x3633d2={},_0x3d3cc8={},_0x4e0042={'count':0x0,'rows':[]};var _0x10c24b=_[_0x561a('0x2d')](db[_0x561a('0x2e')][_0x561a('0x2f')],function(_0x169243){return{'name':_0x169243[_0x561a('0x30')],'type':_0x169243[_0x561a('0x31')][_0x561a('0x32')]};});_0x3d3cc8['model']=_[_0x561a('0x2d')](_0x10c24b,_0x561a('0x2b'));_0x3d3cc8[_0x561a('0x33')]=_[_0x561a('0x34')](_0x591737[_0x561a('0x33')]);_0x3d3cc8['filters']=_[_0x561a('0x35')](_0x3d3cc8[_0x561a('0x36')],_0x3d3cc8[_0x561a('0x33')]);_0x3633d2[_0x561a('0x37')]=_['intersection'](_0x3d3cc8[_0x561a('0x36')],qs[_0x561a('0x38')](_0x591737[_0x561a('0x33')]['fields']));_0x3633d2['attributes']=_0x3633d2[_0x561a('0x37')]['length']?_0x3633d2['attributes']:_0x3d3cc8['model'];if(!_0x591737[_0x561a('0x33')][_0x561a('0x39')](_0x561a('0x3a'))){_0x3633d2[_0x561a('0x1e')]=qs[_0x561a('0x1e')](_0x591737[_0x561a('0x33')]['limit']);_0x3633d2['offset']=qs[_0x561a('0x1c')](_0x591737[_0x561a('0x33')][_0x561a('0x1c')]);}_0x3633d2[_0x561a('0x3b')]=qs[_0x561a('0x3c')](_0x591737[_0x561a('0x33')][_0x561a('0x3c')]);_0x3633d2[_0x561a('0x3d')]=qs['filters'](_[_0x561a('0x3e')](_0x591737[_0x561a('0x33')],_0x3d3cc8[_0x561a('0x3f')]),_0x10c24b);if(_0x591737[_0x561a('0x33')]['filter']){_0x3633d2[_0x561a('0x3d')]=_[_0x561a('0x40')](_0x3633d2[_0x561a('0x3d')],{'$or':_['map'](_0x10c24b,function(_0x3ebf2b){if(_0x3ebf2b[_0x561a('0x31')]!==_0x561a('0x41')){var _0x16779d={};_0x16779d[_0x3ebf2b[_0x561a('0x2b')]]={'$like':'%'+_0x591737[_0x561a('0x33')][_0x561a('0x42')]+'%'};return _0x16779d;}})});}_0x3633d2=_['merge']({},_0x3633d2,_0x591737[_0x561a('0x43')]);var _0x2cdad6={'where':_0x3633d2[_0x561a('0x3d')]};return db[_0x561a('0x2e')][_0x561a('0x1f')](_0x2cdad6)[_0x561a('0x25')](function(_0x51e29e){_0x4e0042[_0x561a('0x1f')]=_0x51e29e;if(_0x591737[_0x561a('0x33')][_0x561a('0x44')]){_0x3633d2[_0x561a('0x45')]=[{'all':!![]}];}return db[_0x561a('0x2e')][_0x561a('0x46')](_0x3633d2);})[_0x561a('0x25')](function(_0x32f8bd){_0x4e0042[_0x561a('0x47')]=_0x32f8bd;return _0x4e0042;})['then'](respondWithFilteredResult(_0x54a47a,_0x3633d2))[_0x561a('0x48')](handleError(_0x54a47a,null));};exports[_0x561a('0x49')]=function(_0x5197b1,_0x2eda67){var _0x4b8a16={'raw':!![],'where':{'id':_0x5197b1[_0x561a('0x4a')]['id']}},_0x141971={};_0x141971[_0x561a('0x36')]=_[_0x561a('0x34')](db[_0x561a('0x2e')]['rawAttributes']);_0x141971[_0x561a('0x33')]=_[_0x561a('0x34')](_0x5197b1[_0x561a('0x33')]);_0x141971[_0x561a('0x3f')]=_[_0x561a('0x35')](_0x141971[_0x561a('0x36')],_0x141971['query']);_0x4b8a16['attributes']=_[_0x561a('0x35')](_0x141971['model'],qs['fields'](_0x5197b1['query']['fields']));_0x4b8a16['attributes']=_0x4b8a16[_0x561a('0x37')][_0x561a('0x4b')]?_0x4b8a16[_0x561a('0x37')]:_0x141971['model'];if(_0x5197b1[_0x561a('0x33')]['includeAll']){_0x4b8a16['include']=[{'all':!![]}];}_0x4b8a16=_[_0x561a('0x40')]({},_0x4b8a16,_0x5197b1[_0x561a('0x43')]);return db[_0x561a('0x2e')]['find'](_0x4b8a16)[_0x561a('0x25')](handleEntityNotFound(_0x2eda67,null))['then'](respondWithResult(_0x2eda67,null))[_0x561a('0x48')](handleError(_0x2eda67,null));};exports['create']=function(_0x1bd3df,_0x43d557){return db[_0x561a('0x2e')][_0x561a('0x4c')](_0x1bd3df[_0x561a('0x4d')],{})[_0x561a('0x25')](function(_0x355d4f){var _0x25aaf6=_0x1bd3df[_0x561a('0x4e')]['get']({'plain':!![]});if(!_0x25aaf6)throw new Error(_0x561a('0x4f'));if(_0x25aaf6[_0x561a('0x50')]===_0x561a('0x4e')){var _0x48ed34=_0x355d4f[_0x561a('0x27')]({'plain':!![]});var _0x4583b1='Tags';return db[_0x561a('0x51')][_0x561a('0x52')]({'where':{'name':_0x4583b1,'userProfileId':_0x25aaf6[_0x561a('0x53')]},'raw':!![]})['then'](function(_0x1161e3){if(_0x1161e3&&_0x1161e3[_0x561a('0x54')]===0x0){return db[_0x561a('0x55')][_0x561a('0x4c')]({'name':_0x48ed34[_0x561a('0x2b')],'resourceId':_0x48ed34['id'],'type':_0x1161e3[_0x561a('0x2b')],'sectionId':_0x1161e3['id']},{})[_0x561a('0x25')](function(){return _0x355d4f;});}else{return _0x355d4f;}})['catch'](function(_0x14c7bd){logger[_0x561a('0x29')](_0x561a('0x56'),_0x14c7bd);throw _0x14c7bd;});}return _0x355d4f;})[_0x561a('0x25')](respondWithResult(_0x43d557,0xc9))[_0x561a('0x48')](handleError(_0x43d557,null));};exports[_0x561a('0x24')]=function(_0x3b0a93,_0x5783af){if(_0x3b0a93[_0x561a('0x4d')]['id']){delete _0x3b0a93[_0x561a('0x4d')]['id'];}return db[_0x561a('0x2e')]['find']({'where':{'id':_0x3b0a93[_0x561a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5783af,null))[_0x561a('0x25')](saveUpdates(_0x3b0a93[_0x561a('0x4d')],null))[_0x561a('0x25')](respondWithResult(_0x5783af,null))[_0x561a('0x48')](handleError(_0x5783af,null));};exports[_0x561a('0x26')]=function(_0x27b10c,_0x29d981){return db['Tag']['find']({'where':{'id':_0x27b10c[_0x561a('0x4a')]['id']}})[_0x561a('0x25')](handleEntityNotFound(_0x29d981,null))[_0x561a('0x25')](removeEntity(_0x29d981,null))[_0x561a('0x48')](handleError(_0x29d981,null));}; \ No newline at end of file +var _0x22fb=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','Tag','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x22fb,0x192));var _0xb22f=function(_0x9736ce,_0x122611){_0x9736ce=_0x9736ce-0x0;var _0x158644=_0x22fb[_0x9736ce];return _0x158644;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb22f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb22f('0x1'));var moment=require(_0xb22f('0x2'));var BPromise=require(_0xb22f('0x3'));var Mustache=require(_0xb22f('0x4'));var util=require(_0xb22f('0x5'));var path=require('path');var sox=require(_0xb22f('0x6'));var csv=require(_0xb22f('0x7'));var ejs=require(_0xb22f('0x8'));var fs=require('fs');var fs_extra=require(_0xb22f('0x9'));var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x7'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb22f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bb02a,_0x5bf0b9){_0x5bf0b9=_0x5bf0b9||0xcc;return function(_0x45e426){if(_0x45e426){return _0x4bb02a[_0xb22f('0x17')](_0x5bf0b9);}return _0x4bb02a[_0xb22f('0x18')](_0x5bf0b9)[_0xb22f('0x19')]();};}function respondWithResult(_0x390c53,_0x32d796){_0x32d796=_0x32d796||0xc8;return function(_0x5c6ccf){if(_0x5c6ccf){return _0x390c53[_0xb22f('0x18')](_0x32d796)['json'](_0x5c6ccf);}};}function respondWithFilteredResult(_0x36e2a8,_0x4f9108){return function(_0x2187fc){if(_0x2187fc){var _0x514a8f=typeof _0x4f9108[_0xb22f('0x1a')]===_0xb22f('0x1b')&&typeof _0x4f9108[_0xb22f('0x1c')]==='undefined';var _0x1530f7=_0x2187fc['count'];var _0x252742=_0x514a8f?0x0:_0x4f9108[_0xb22f('0x1a')];var _0x2aaec4=_0x514a8f?_0x2187fc[_0xb22f('0x1d')]:_0x4f9108[_0xb22f('0x1a')]+_0x4f9108[_0xb22f('0x1c')];var _0x5c843b;if(_0x2aaec4>=_0x1530f7){_0x2aaec4=_0x1530f7;_0x5c843b=0xc8;}else{_0x5c843b=0xce;}_0x36e2a8[_0xb22f('0x18')](_0x5c843b);return _0x36e2a8['set'](_0xb22f('0x1e'),_0x252742+'-'+_0x2aaec4+'/'+_0x1530f7)[_0xb22f('0x1f')](_0x2187fc);}return null;};}function patchUpdates(_0x316f11){return function(_0x2239b8){try{jsonpatch[_0xb22f('0x20')](_0x2239b8,_0x316f11,!![]);}catch(_0x4bbb12){return BPromise['reject'](_0x4bbb12);}return _0x2239b8[_0xb22f('0x21')]();};}function saveUpdates(_0x19e480,_0xf34e0d){return function(_0x16e465){if(_0x16e465){return _0x16e465[_0xb22f('0x22')](_0x19e480)[_0xb22f('0x23')](function(_0x201764){return _0x201764;});}return null;};}function removeEntity(_0x286465,_0x583fbe){return function(_0x482b3a){if(_0x482b3a){return _0x482b3a[_0xb22f('0x24')]()[_0xb22f('0x23')](function(){var _0x5e1b8c=_0x482b3a[_0xb22f('0x25')]({'plain':!![]});var _0x4364f5='Tags';return db[_0xb22f('0x26')][_0xb22f('0x24')]({'where':{'type':_0x4364f5,'resourceId':_0x5e1b8c['id']}})['then'](function(){return _0x482b3a;});})[_0xb22f('0x23')](function(){_0x286465[_0xb22f('0x18')](0xcc)[_0xb22f('0x19')]();});}};}function handleEntityNotFound(_0xec047c,_0x3bf205){return function(_0x246a0c){if(!_0x246a0c){_0xec047c[_0xb22f('0x17')](0x194);}return _0x246a0c;};}function handleError(_0x2ae6d4,_0x4ce9af){_0x4ce9af=_0x4ce9af||0x1f4;return function(_0x483cc3){logger['error'](_0x483cc3[_0xb22f('0x27')]);if(_0x483cc3['name']){delete _0x483cc3[_0xb22f('0x28')];}_0x2ae6d4[_0xb22f('0x18')](_0x4ce9af)[_0xb22f('0x29')](_0x483cc3);};}exports[_0xb22f('0x2a')]=function(_0x3bf636,_0x5b2a42){var _0x519034={},_0x435690={},_0x12c042={'count':0x0,'rows':[]};var _0x319e56=_[_0xb22f('0x2b')](db['Tag'][_0xb22f('0x2c')],function(_0x29ad43){return{'name':_0x29ad43['fieldName'],'type':_0x29ad43[_0xb22f('0x2d')][_0xb22f('0x2e')]};});_0x435690[_0xb22f('0x2f')]=_[_0xb22f('0x2b')](_0x319e56,_0xb22f('0x28'));_0x435690['query']=_['keys'](_0x3bf636[_0xb22f('0x30')]);_0x435690[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x435690[_0xb22f('0x2f')],_0x435690[_0xb22f('0x30')]);_0x519034[_0xb22f('0x33')]=_[_0xb22f('0x32')](_0x435690[_0xb22f('0x2f')],qs[_0xb22f('0x34')](_0x3bf636['query'][_0xb22f('0x34')]));_0x519034['attributes']=_0x519034['attributes'][_0xb22f('0x35')]?_0x519034[_0xb22f('0x33')]:_0x435690[_0xb22f('0x2f')];if(!_0x3bf636[_0xb22f('0x30')][_0xb22f('0x36')](_0xb22f('0x37'))){_0x519034[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x3bf636[_0xb22f('0x30')][_0xb22f('0x1c')]);_0x519034[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x3bf636[_0xb22f('0x30')]['offset']);}_0x519034['order']=qs[_0xb22f('0x38')](_0x3bf636[_0xb22f('0x30')][_0xb22f('0x38')]);_0x519034['where']=qs[_0xb22f('0x31')](_[_0xb22f('0x39')](_0x3bf636['query'],_0x435690['filters']),_0x319e56);if(_0x3bf636[_0xb22f('0x30')]['filter']){_0x519034[_0xb22f('0x3a')]=_['merge'](_0x519034[_0xb22f('0x3a')],{'$or':_[_0xb22f('0x2b')](_0x319e56,function(_0x27e081){if(_0x27e081['type']!==_0xb22f('0x3b')){var _0x2d265c={};_0x2d265c[_0x27e081[_0xb22f('0x28')]]={'$like':'%'+_0x3bf636['query'][_0xb22f('0x3c')]+'%'};return _0x2d265c;}})});}_0x519034=_[_0xb22f('0x3d')]({},_0x519034,_0x3bf636[_0xb22f('0x3e')]);var _0x476ff6={'where':_0x519034[_0xb22f('0x3a')]};return db[_0xb22f('0x3f')][_0xb22f('0x1d')](_0x476ff6)[_0xb22f('0x23')](function(_0xcb55d3){_0x12c042[_0xb22f('0x1d')]=_0xcb55d3;if(_0x3bf636['query'][_0xb22f('0x40')]){_0x519034[_0xb22f('0x41')]=[{'all':!![]}];}return db['Tag'][_0xb22f('0x42')](_0x519034);})['then'](function(_0x58ba40){_0x12c042[_0xb22f('0x43')]=_0x58ba40;return _0x12c042;})[_0xb22f('0x23')](respondWithFilteredResult(_0x5b2a42,_0x519034))[_0xb22f('0x44')](handleError(_0x5b2a42,null));};exports[_0xb22f('0x45')]=function(_0x563740,_0x1475d1){var _0x572a0c={'raw':!![],'where':{'id':_0x563740[_0xb22f('0x46')]['id']}},_0xddfda6={};_0xddfda6[_0xb22f('0x2f')]=_[_0xb22f('0x47')](db[_0xb22f('0x3f')][_0xb22f('0x2c')]);_0xddfda6['query']=_[_0xb22f('0x47')](_0x563740['query']);_0xddfda6[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0xddfda6['model'],_0xddfda6[_0xb22f('0x30')]);_0x572a0c[_0xb22f('0x33')]=_['intersection'](_0xddfda6['model'],qs[_0xb22f('0x34')](_0x563740['query'][_0xb22f('0x34')]));_0x572a0c[_0xb22f('0x33')]=_0x572a0c[_0xb22f('0x33')][_0xb22f('0x35')]?_0x572a0c['attributes']:_0xddfda6[_0xb22f('0x2f')];if(_0x563740[_0xb22f('0x30')]['includeAll']){_0x572a0c[_0xb22f('0x41')]=[{'all':!![]}];}_0x572a0c=_[_0xb22f('0x3d')]({},_0x572a0c,_0x563740[_0xb22f('0x3e')]);return db[_0xb22f('0x3f')][_0xb22f('0x48')](_0x572a0c)['then'](handleEntityNotFound(_0x1475d1,null))[_0xb22f('0x23')](respondWithResult(_0x1475d1,null))['catch'](handleError(_0x1475d1,null));};exports['create']=function(_0x3fb0ac,_0x90eef9){return db[_0xb22f('0x3f')][_0xb22f('0x49')](_0x3fb0ac[_0xb22f('0x4a')],{})['then'](function(_0x275ca5){var _0x504511=_0x3fb0ac[_0xb22f('0x4b')]['get']({'plain':!![]});if(!_0x504511)throw new Error(_0xb22f('0x4c'));if(_0x504511[_0xb22f('0x4d')]===_0xb22f('0x4b')){var _0x58cd19=_0x275ca5[_0xb22f('0x25')]({'plain':!![]});var _0x436425='Tags';return db[_0xb22f('0x4e')][_0xb22f('0x48')]({'where':{'name':_0x436425,'userProfileId':_0x504511['userProfileId']},'raw':!![]})['then'](function(_0x261bc0){if(_0x261bc0&&_0x261bc0[_0xb22f('0x4f')]===0x0){return db['UserProfileResource'][_0xb22f('0x49')]({'name':_0x58cd19[_0xb22f('0x28')],'resourceId':_0x58cd19['id'],'type':_0x261bc0['name'],'sectionId':_0x261bc0['id']},{})['then'](function(){return _0x275ca5;});}else{return _0x275ca5;}})[_0xb22f('0x44')](function(_0x3759ef){logger['error'](_0xb22f('0x50'),_0x3759ef);throw _0x3759ef;});}return _0x275ca5;})[_0xb22f('0x23')](respondWithResult(_0x90eef9,0xc9))[_0xb22f('0x44')](handleError(_0x90eef9,null));};exports[_0xb22f('0x22')]=function(_0x518e28,_0x30039a){if(_0x518e28[_0xb22f('0x4a')]['id']){delete _0x518e28['body']['id'];}return db['Tag'][_0xb22f('0x48')]({'where':{'id':_0x518e28[_0xb22f('0x46')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x30039a,null))[_0xb22f('0x23')](saveUpdates(_0x518e28['body'],null))[_0xb22f('0x23')](respondWithResult(_0x30039a,null))[_0xb22f('0x44')](handleError(_0x30039a,null));};exports['destroy']=function(_0x1e1390,_0x34e0f0){return db[_0xb22f('0x3f')][_0xb22f('0x48')]({'where':{'id':_0x1e1390[_0xb22f('0x46')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x34e0f0,null))[_0xb22f('0x23')](removeEntity(_0x34e0f0,null))['catch'](handleError(_0x34e0f0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 36f3fd9..43f74de 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 _0xd867=['tools_tags','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x1eaf1d,_0x520f66){var _0xa427ed=function(_0x1cf165){while(--_0x1cf165){_0x1eaf1d['push'](_0x1eaf1d['shift']());}};_0xa427ed(++_0x520f66);}(_0xd867,0x1e1));var _0x7d86=function(_0x3a11f6,_0x320b5e){_0x3a11f6=_0x3a11f6-0x0;var _0x1265ef=_0xd867[_0x3a11f6];return _0x1265ef;};'use strict';var _=require(_0x7d86('0x0'));var util=require('util');var logger=require(_0x7d86('0x1'))('api');var moment=require(_0x7d86('0x2'));var BPromise=require('bluebird');var rp=require(_0x7d86('0x3'));var fs=require('fs');var path=require(_0x7d86('0x4'));var rimraf=require(_0x7d86('0x5'));var config=require(_0x7d86('0x6'));var attributes=require(_0x7d86('0x7'));module[_0x7d86('0x8')]=function(_0x41f1a6,_0x555080){return _0x41f1a6[_0x7d86('0x9')](_0x7d86('0xa'),attributes,{'tableName':_0x7d86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd540=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0xd540,0x7d));var _0x0d54=function(_0x5475b6,_0x32e77b){_0x5475b6=_0x5475b6-0x0;var _0x4b43ea=_0xd540[_0x5475b6];return _0x4b43ea;};'use strict';var _=require(_0x0d54('0x0'));var util=require(_0x0d54('0x1'));var logger=require(_0x0d54('0x2'))(_0x0d54('0x3'));var moment=require(_0x0d54('0x4'));var BPromise=require(_0x0d54('0x5'));var rp=require(_0x0d54('0x6'));var fs=require('fs');var path=require(_0x0d54('0x7'));var rimraf=require(_0x0d54('0x8'));var config=require(_0x0d54('0x9'));var attributes=require(_0x0d54('0xa'));module[_0x0d54('0xb')]=function(_0x1f81a3,_0x1eb62d){return _0x1f81a3[_0x0d54('0xc')]('Tag',attributes,{'tableName':_0x0d54('0xd'),'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 f060314..009c97d 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 _0xaf80=['result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x440cc4,_0x1e7efa){var _0x2f4587=function(_0x2e0574){while(--_0x2e0574){_0x440cc4['push'](_0x440cc4['shift']());}};_0x2f4587(++_0x1e7efa);}(_0xaf80,0x1ef));var _0x0af8=function(_0xd96ada,_0x35010f){_0xd96ada=_0xd96ada-0x0;var _0x2533a5=_0xaf80[_0xd96ada];return _0x2533a5;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Tag,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});} \ No newline at end of file +var _0x202c=['message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b21c9,_0x4352ef){var _0x241785=function(_0x407bc2){while(--_0x407bc2){_0x5b21c9['push'](_0x5b21c9['shift']());}};_0x241785(++_0x4352ef);}(_0x202c,0x178));var _0xc202=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0x202c[_0x49aab7];return _0x587b6f;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Tag,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b72a5f3..f7718da 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_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('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 d144fec..fae4e1c 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 _0x2032=['name','exports','STRING'];(function(_0x4ec82a,_0x38ad89){var _0x1db6a1=function(_0x156f3e){while(--_0x156f3e){_0x4ec82a['push'](_0x4ec82a['shift']());}};_0x1db6a1(++_0x38ad89);}(_0x2032,0xd9));var _0x2203=function(_0x44f032,_0x5b113e){_0x44f032=_0x44f032-0x0;var _0x52c420=_0x2032[_0x44f032];return _0x52c420;};'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 _0x0713=['STRING','name'];(function(_0x312371,_0x168bca){var _0x11e3d1=function(_0x68c10e){while(--_0x68c10e){_0x312371['push'](_0x312371['shift']());}};_0x11e3d1(++_0x168bca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 22789fa..1fd1182 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 _0x5825=['register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','channel','ValidationError','toLowerCase','Queue','pick','capitalize','Queues','addQueues','findOne','isValidChannel','Unknown\x20channel','add','ids','remove','addAgents','isArray','Chat','Fax','Openchannel','Whatsapp','Voice','through','penalty','TeamVoiceQueue','User','emit','QueueId','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','spread','Mail','Sms','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','./team.socket'];(function(_0x3f96cd,_0x3070a9){var _0x5bc24a=function(_0x48c8cb){while(--_0x48c8cb){_0x3f96cd['push'](_0x3f96cd['shift']());}};_0x5bc24a(++_0x3070a9);}(_0x5825,0x7f));var _0x5582=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5825[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5582('0x0'));var zipdir=require(_0x5582('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5582('0x2'));var BPromise=require(_0x5582('0x3'));var Mustache=require(_0x5582('0x4'));var util=require(_0x5582('0x5'));var path=require('path');var sox=require(_0x5582('0x6'));var csv=require('to-csv');var ejs=require(_0x5582('0x7'));var fs=require('fs');var fs_extra=require(_0x5582('0x8'));var _=require(_0x5582('0x9'));var squel=require(_0x5582('0xa'));var crypto=require(_0x5582('0xb'));var jsforce=require(_0x5582('0xc'));var deskjs=require(_0x5582('0xd'));var toCsv=require(_0x5582('0xe'));var querystring=require(_0x5582('0xf'));var Papa=require('papaparse');var Redis=require(_0x5582('0x10'));var authService=require(_0x5582('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5582('0x12'));var logger=require('../../config/logger')(_0x5582('0x13'));var utils=require('../../config/utils');var config=require(_0x5582('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5582('0x15'))['db'];config[_0x5582('0x16')]=_['defaults'](config['redis'],{'host':_0x5582('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5582('0x18'))[_0x5582('0x19')](socket);function respondWithStatusCode(_0x5883e0,_0x293411){_0x293411=_0x293411||0xcc;return function(_0x2d48ba){if(_0x2d48ba){return _0x5883e0[_0x5582('0x1a')](_0x293411);}return _0x5883e0[_0x5582('0x1b')](_0x293411)[_0x5582('0x1c')]();};}function respondWithResult(_0x2d787a,_0x2a8922){_0x2a8922=_0x2a8922||0xc8;return function(_0x347bc3){if(_0x347bc3){return _0x2d787a[_0x5582('0x1b')](_0x2a8922)[_0x5582('0x1d')](_0x347bc3);}};}function respondWithFilteredResult(_0x27ef86,_0x12be89){return function(_0x8e4f3e){if(_0x8e4f3e){var _0x412979=typeof _0x12be89[_0x5582('0x1e')]===_0x5582('0x1f')&&typeof _0x12be89[_0x5582('0x20')]==='undefined';var _0x5a9a06=_0x8e4f3e[_0x5582('0x21')];var _0x286d68=_0x412979?0x0:_0x12be89[_0x5582('0x1e')];var _0x249bce=_0x412979?_0x8e4f3e[_0x5582('0x21')]:_0x12be89[_0x5582('0x1e')]+_0x12be89['limit'];var _0x53e57f;if(_0x249bce>=_0x5a9a06){_0x249bce=_0x5a9a06;_0x53e57f=0xc8;}else{_0x53e57f=0xce;}_0x27ef86['status'](_0x53e57f);return _0x27ef86['set'](_0x5582('0x22'),_0x286d68+'-'+_0x249bce+'/'+_0x5a9a06)[_0x5582('0x1d')](_0x8e4f3e);}return null;};}function patchUpdates(_0x8c803){return function(_0x27d5fd){try{jsonpatch[_0x5582('0x23')](_0x27d5fd,_0x8c803,!![]);}catch(_0x1b3243){return BPromise[_0x5582('0x24')](_0x1b3243);}return _0x27d5fd[_0x5582('0x25')]();};}function saveUpdates(_0x1bace9,_0x4eb0c2){return function(_0x3efb5e){if(_0x3efb5e){return _0x3efb5e['update'](_0x1bace9)[_0x5582('0x26')](function(_0x1b6f85){return _0x1b6f85;});}return null;};}function handleEntityNotFound(_0x114dbd,_0x40a214){return function(_0x3d5037){if(!_0x3d5037){_0x114dbd[_0x5582('0x1a')](0x194);}return _0x3d5037;};}function handleError(_0x387458,_0x89d308){_0x89d308=_0x89d308||0x1f4;return function(_0x29362a){logger['error'](_0x29362a[_0x5582('0x27')]);if(_0x29362a[_0x5582('0x28')]){delete _0x29362a[_0x5582('0x28')];}_0x387458[_0x5582('0x1b')](_0x89d308)[_0x5582('0x29')](_0x29362a);};}exports[_0x5582('0x2a')]=function(_0x114d67,_0x21f64c){var _0xbbe0f4={},_0x3d16bb={},_0x4c962d={'count':0x0,'rows':[]};var _0x5c0504=_[_0x5582('0x2b')](db[_0x5582('0x2c')][_0x5582('0x2d')],function(_0x42c908){return{'name':_0x42c908[_0x5582('0x2e')],'type':_0x42c908[_0x5582('0x2f')][_0x5582('0x30')]};});_0x3d16bb[_0x5582('0x31')]=_[_0x5582('0x2b')](_0x5c0504,_0x5582('0x28'));_0x3d16bb['query']=_[_0x5582('0x32')](_0x114d67[_0x5582('0x33')]);_0x3d16bb[_0x5582('0x34')]=_[_0x5582('0x35')](_0x3d16bb[_0x5582('0x31')],_0x3d16bb['query']);_0xbbe0f4[_0x5582('0x36')]=_[_0x5582('0x35')](_0x3d16bb[_0x5582('0x31')],qs[_0x5582('0x37')](_0x114d67[_0x5582('0x33')][_0x5582('0x37')]));_0xbbe0f4[_0x5582('0x36')]=_0xbbe0f4[_0x5582('0x36')][_0x5582('0x38')]?_0xbbe0f4[_0x5582('0x36')]:_0x3d16bb['model'];if(!_0x114d67['query'][_0x5582('0x39')]('nolimit')){_0xbbe0f4[_0x5582('0x20')]=qs[_0x5582('0x20')](_0x114d67[_0x5582('0x33')][_0x5582('0x20')]);_0xbbe0f4[_0x5582('0x1e')]=qs[_0x5582('0x1e')](_0x114d67['query'][_0x5582('0x1e')]);}_0xbbe0f4[_0x5582('0x3a')]=qs[_0x5582('0x3b')](_0x114d67[_0x5582('0x33')][_0x5582('0x3b')]);_0xbbe0f4[_0x5582('0x3c')]=qs[_0x5582('0x34')](_['pick'](_0x114d67[_0x5582('0x33')],_0x3d16bb[_0x5582('0x34')]),_0x5c0504);if(_0x114d67[_0x5582('0x33')][_0x5582('0x3d')]){_0xbbe0f4[_0x5582('0x3c')]=_['merge'](_0xbbe0f4[_0x5582('0x3c')],{'$or':_['map'](_0x5c0504,function(_0x57f743){if(_0x57f743[_0x5582('0x2f')]!==_0x5582('0x3e')){var _0x52e231={};_0x52e231[_0x57f743[_0x5582('0x28')]]={'$like':'%'+_0x114d67[_0x5582('0x33')][_0x5582('0x3d')]+'%'};return _0x52e231;}})});}_0xbbe0f4=_[_0x5582('0x3f')]({},_0xbbe0f4,_0x114d67[_0x5582('0x40')]);var _0x196302={'where':_0xbbe0f4[_0x5582('0x3c')]};return db[_0x5582('0x2c')]['count'](_0x196302)[_0x5582('0x26')](function(_0x4d34b5){_0x4c962d[_0x5582('0x21')]=_0x4d34b5;if(_0x114d67[_0x5582('0x33')][_0x5582('0x41')]){_0xbbe0f4[_0x5582('0x42')]=[{'all':!![]}];}return db[_0x5582('0x2c')]['findAll'](_0xbbe0f4);})[_0x5582('0x26')](function(_0x48c7a2){_0x4c962d[_0x5582('0x43')]=_0x48c7a2;return _0x4c962d;})[_0x5582('0x26')](respondWithFilteredResult(_0x21f64c,_0xbbe0f4))[_0x5582('0x44')](handleError(_0x21f64c,null));};exports['show']=function(_0x4b0295,_0x4273c5){var _0x1e25fb={'raw':![],'where':{'id':_0x4b0295[_0x5582('0x45')]['id']}},_0x36f05b={};_0x36f05b[_0x5582('0x31')]=_[_0x5582('0x32')](db[_0x5582('0x2c')][_0x5582('0x2d')]);_0x36f05b['query']=_[_0x5582('0x32')](_0x4b0295[_0x5582('0x33')]);_0x36f05b[_0x5582('0x34')]=_['intersection'](_0x36f05b[_0x5582('0x31')],_0x36f05b[_0x5582('0x33')]);_0x1e25fb[_0x5582('0x36')]=_[_0x5582('0x35')](_0x36f05b['model'],qs[_0x5582('0x37')](_0x4b0295[_0x5582('0x33')][_0x5582('0x37')]));_0x1e25fb['attributes']=_0x1e25fb[_0x5582('0x36')][_0x5582('0x38')]?_0x1e25fb[_0x5582('0x36')]:_0x36f05b[_0x5582('0x31')];if(_0x4b0295[_0x5582('0x33')]['includeAll']){_0x1e25fb['include']=[{'all':!![]}];}_0x1e25fb=_[_0x5582('0x3f')]({},_0x1e25fb,_0x4b0295[_0x5582('0x40')]);return db[_0x5582('0x2c')][_0x5582('0x46')](_0x1e25fb)[_0x5582('0x26')](handleEntityNotFound(_0x4273c5,null))[_0x5582('0x26')](respondWithResult(_0x4273c5,null))[_0x5582('0x44')](handleError(_0x4273c5,null));};exports[_0x5582('0x47')]=function(_0x3be748,_0x208e8a){return db['Team'][_0x5582('0x47')](_0x3be748[_0x5582('0x48')],{})[_0x5582('0x26')](function(_0x48e745){var _0x3e93d8=_0x3be748[_0x5582('0x49')][_0x5582('0x4a')]({'plain':!![]});if(!_0x3e93d8)throw new Error(_0x5582('0x4b'));if(_0x3e93d8[_0x5582('0x4c')]===_0x5582('0x49')){var _0x13db7f=_0x48e745['get']({'plain':!![]});var _0x1a2e35=_0x5582('0x4d');return db[_0x5582('0x4e')][_0x5582('0x46')]({'where':{'name':_0x1a2e35,'userProfileId':_0x3e93d8[_0x5582('0x4f')]},'raw':!![]})[_0x5582('0x26')](function(_0x543e44){if(_0x543e44&&_0x543e44[_0x5582('0x50')]===0x0){return db[_0x5582('0x51')][_0x5582('0x47')]({'name':_0x13db7f[_0x5582('0x28')],'resourceId':_0x13db7f['id'],'type':_0x543e44[_0x5582('0x28')],'sectionId':_0x543e44['id']},{})['then'](function(){return _0x48e745;});}else{return _0x48e745;}})['catch'](function(_0x10f4a9){logger[_0x5582('0x52')](_0x5582('0x53'),_0x10f4a9);throw _0x10f4a9;});}return _0x48e745;})[_0x5582('0x26')](respondWithResult(_0x208e8a,0xc9))['catch'](handleError(_0x208e8a,null));};exports[_0x5582('0x54')]=function(_0x2265b2,_0x42459e){if(_0x2265b2['body']['id']){delete _0x2265b2[_0x5582('0x48')]['id'];}return db[_0x5582('0x2c')][_0x5582('0x46')]({'where':{'id':_0x2265b2[_0x5582('0x45')]['id']}})['then'](handleEntityNotFound(_0x42459e,null))[_0x5582('0x26')](saveUpdates(_0x2265b2[_0x5582('0x48')],null))[_0x5582('0x26')](respondWithResult(_0x42459e,null))[_0x5582('0x44')](handleError(_0x42459e,null));};exports[_0x5582('0x55')]=function(_0x196000,_0x5c3b1b){var _0x4ad69b=_0x196000[_0x5582('0x45')]['id'];var _0x35071d=[];return db[_0x5582('0x56')][_0x5582('0x57')](function(_0x4e126c){var _0x4acaf1=_0x5582('0x58')+_0x4ad69b;return db['sequelize']['query'](_0x4acaf1,{'type':db[_0x5582('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4e126c})[_0x5582('0x26')](function(_0x4fb1b4){_0x35071d=_[_0x5582('0x2b')](_0x4fb1b4,function(_0x43d567){return Number(_0x43d567['UserId']);});})['then'](function(){var _0x1ab15e=_0x5582('0x5a')+_0x4ad69b;return db[_0x5582('0x56')][_0x5582('0x33')](_0x1ab15e,{'type':db[_0x5582('0x59')]['QueryTypes'][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})[_0x5582('0x26')](function(_0x11db6e){var _0x543ace=_['map'](_0x11db6e,function(_0x5102bf){return Number(_0x5102bf['VoiceQueueId']);});return db[_0x5582('0x5c')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'VoiceQueueId':{'$in':_0x543ace}},'transaction':_0x4e126c});})['then'](function(){var _0xe37f2a=_0x5582('0x5d')+_0x4ad69b;return db[_0x5582('0x56')][_0x5582('0x33')](_0xe37f2a,{'type':db['Sequelize']['QueryTypes'][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})['then'](function(_0x31f44){var _0x25e12e=_[_0x5582('0x2b')](_0x31f44,function(_0x376d4b){return Number(_0x376d4b[_0x5582('0x5e')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x35071d},'MailQueueId':{'$in':_0x25e12e}},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){var _0x11df29=_0x5582('0x5f')+_0x4ad69b;return db['sequelize'][_0x5582('0x33')](_0x11df29,{'type':db['Sequelize'][_0x5582('0x60')][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})['then'](function(_0x872df3){var _0x41689c=_['map'](_0x872df3,function(_0x48bd42){return Number(_0x48bd42[_0x5582('0x61')]);});return db[_0x5582('0x62')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'SmsQueueId':{'$in':_0x41689c}},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){var _0x3302b5='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ad69b;return db[_0x5582('0x56')][_0x5582('0x33')](_0x3302b5,{'type':db[_0x5582('0x59')][_0x5582('0x60')][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})['then'](function(_0x1ee80f){var _0x143638=_['map'](_0x1ee80f,function(_0x25abf3){return Number(_0x25abf3[_0x5582('0x63')]);});return db[_0x5582('0x64')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'ChatQueueId':{'$in':_0x143638}},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){var _0x3c28ce=_0x5582('0x65')+_0x4ad69b;return db[_0x5582('0x56')][_0x5582('0x33')](_0x3c28ce,{'type':db[_0x5582('0x59')][_0x5582('0x60')][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})[_0x5582('0x26')](function(_0x50a61e){var _0x245f24=_[_0x5582('0x2b')](_0x50a61e,function(_0x5ab7fd){return Number(_0x5ab7fd[_0x5582('0x66')]);});return db[_0x5582('0x67')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'FaxQueueId':{'$in':_0x245f24}},'transaction':_0x4e126c});})['then'](function(){var _0x287201='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ad69b;return db['sequelize'][_0x5582('0x33')](_0x287201,{'type':db[_0x5582('0x59')][_0x5582('0x60')][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})[_0x5582('0x26')](function(_0x54f280){var _0x39e718=_[_0x5582('0x2b')](_0x54f280,function(_0x3c19ee){return Number(_0x3c19ee['OpenchannelQueueId']);});return db[_0x5582('0x68')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'OpenchannelQueueId':{'$in':_0x39e718}},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){var _0x27fc8e=_0x5582('0x69')+_0x4ad69b;return db[_0x5582('0x56')]['query'](_0x27fc8e,{'type':db['Sequelize'][_0x5582('0x60')][_0x5582('0x5b')],'raw':!![],'transaction':_0x4e126c});})['then'](function(_0x5df189){var _0x532332=_[_0x5582('0x2b')](_0x5df189,function(_0x290782){return Number(_0x290782[_0x5582('0x6a')]);});return db[_0x5582('0x6b')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'WhatsappQueueId':{'$in':_0x532332}},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){return db[_0x5582('0x6c')][_0x5582('0x46')]({'where':{'TeamId':_0x4ad69b}});})[_0x5582('0x26')](function(_0xbc257f){if(_0xbc257f===null){return;}return db[_0x5582('0x6d')][_0x5582('0x55')]({'where':{'UserId':{'$in':_0x35071d},'VoicePrefixId':_0xbc257f[_0x5582('0x6e')]},'transaction':_0x4e126c});})[_0x5582('0x26')](function(){return db[_0x5582('0x2c')][_0x5582('0x55')]({'where':{'id':_0x4ad69b},'cascade':!![],'transaction':_0x4e126c});})[_0x5582('0x26')](function(_0x173758){if(_0x173758===0x0){_0x5c3b1b[_0x5582('0x1a')](0x194);}else{return db['UserProfileResource'][_0x5582('0x55')]({'where':{'type':'Teams','resourceId':_0x4ad69b},'cascade':!![],'transaction':_0x4e126c})['then'](function(){_0x5c3b1b[_0x5582('0x1b')](0xcc)['end']();});}})[_0x5582('0x44')](function(_0x155e06){_0x5c3b1b[_0x5582('0x1b')](0x1f4)[_0x5582('0x29')](_0x155e06);});});};exports[_0x5582('0x6f')]=function(_0x5f543f,_0x3207a7,_0xcc4f36){return db['Team']['findOne']({'where':{'id':_0x5f543f[_0x5582('0x45')]['id']}})[_0x5582('0x26')](handleEntityNotFound(_0x3207a7,null))['then'](function(_0x5a3e42){if(!_0x5f543f[_0x5582('0x33')][_0x5582('0x70')]||!utils['isValidChannel'](_0x5f543f[_0x5582('0x33')][_0x5582('0x70')])){throw new db[(_0x5582('0x59'))][(_0x5582('0x71'))]('Unknown\x20channel');}var _0x27c021={};var _0x4bb307={};_0x4bb307[_0x5582('0x31')]=_[_0x5582('0x32')](db[_['capitalize'](_0x5f543f[_0x5582('0x33')][_0x5582('0x70')][_0x5582('0x72')]())+_0x5582('0x73')][_0x5582('0x2d')]);_0x4bb307[_0x5582('0x33')]=_[_0x5582('0x32')](_0x5f543f['query']);_0x4bb307[_0x5582('0x34')]=_['intersection'](_0x4bb307[_0x5582('0x31')],_0x4bb307[_0x5582('0x33')]);_0x27c021[_0x5582('0x36')]=_['intersection'](_0x4bb307[_0x5582('0x31')],qs[_0x5582('0x37')](_0x5f543f[_0x5582('0x33')][_0x5582('0x37')]));_0x27c021['attributes']=_0x27c021[_0x5582('0x36')][_0x5582('0x38')]?_0x27c021[_0x5582('0x36')]:_0x4bb307[_0x5582('0x31')];_0x27c021[_0x5582('0x20')]=qs[_0x5582('0x20')](_0x5f543f[_0x5582('0x33')]['limit']);_0x27c021[_0x5582('0x1e')]=qs[_0x5582('0x1e')](_0x5f543f[_0x5582('0x33')][_0x5582('0x1e')]);_0x27c021[_0x5582('0x3a')]=qs['sort'](_0x5f543f[_0x5582('0x33')][_0x5582('0x3b')]);_0x27c021[_0x5582('0x3c')]=qs[_0x5582('0x34')](_[_0x5582('0x74')](_0x5f543f[_0x5582('0x33')],_0x4bb307[_0x5582('0x34')]));_0x27c021=_[_0x5582('0x3f')]({},_0x27c021,_0x5f543f[_0x5582('0x40')]);return _0x5a3e42[_0x5582('0x4a')+_[_0x5582('0x75')](_0x5f543f[_0x5582('0x33')]['channel'][_0x5582('0x72')]())+_0x5582('0x76')](_0x27c021);})[_0x5582('0x26')](respondWithResult(_0x3207a7,null))[_0x5582('0x44')](handleError(_0x3207a7,null));};exports[_0x5582('0x77')]=function(_0x276a4e,_0x362633,_0x3e5fad){return db['Team'][_0x5582('0x78')]({'where':{'id':_0x276a4e[_0x5582('0x45')]['id']}})[_0x5582('0x26')](function(_0x4c5c41){if(_0x4c5c41){if(!_0x276a4e[_0x5582('0x48')][_0x5582('0x70')]||!utils[_0x5582('0x79')](_0x276a4e[_0x5582('0x48')][_0x5582('0x70')])){throw new db[(_0x5582('0x59'))][(_0x5582('0x71'))](_0x5582('0x7a'));}return _0x4c5c41[_0x5582('0x7b')+_[_0x5582('0x75')](_0x276a4e[_0x5582('0x48')][_0x5582('0x70')]['toLowerCase']())+_0x5582('0x76')](_0x276a4e['body'][_0x5582('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x362633,null))[_0x5582('0x26')](respondWithStatusCode(_0x362633,null))['catch'](handleError(_0x362633,null));};exports['removeQueues']=function(_0x1e43d4,_0x286c08,_0x1a6428){return db[_0x5582('0x2c')][_0x5582('0x78')]({'where':{'id':_0x1e43d4['params']['id']}})[_0x5582('0x26')](function(_0x459465){if(_0x459465){if(!_0x1e43d4[_0x5582('0x33')][_0x5582('0x70')]||!utils[_0x5582('0x79')](_0x1e43d4[_0x5582('0x33')][_0x5582('0x70')])){throw new db[(_0x5582('0x59'))][(_0x5582('0x71'))]('Unknown\x20channel');}return _0x459465[_0x5582('0x7d')+_[_0x5582('0x75')](_0x1e43d4[_0x5582('0x33')][_0x5582('0x70')][_0x5582('0x72')]())+'Queues'](_0x1e43d4[_0x5582('0x33')]['ids']);}return null;})[_0x5582('0x26')](handleEntityNotFound(_0x286c08,null))['then'](respondWithStatusCode(_0x286c08,null))['catch'](handleError(_0x286c08,null));};exports[_0x5582('0x7e')]=function(_0xd3f8,_0x50ab27){var _0x23eefe=_[_0x5582('0x7f')](_0xd3f8[_0x5582('0x48')][_0x5582('0x7c')])?_0xd3f8[_0x5582('0x48')][_0x5582('0x7c')]:[_0xd3f8[_0x5582('0x48')][_0x5582('0x7c')]];var _0x565a85=_0xd3f8[_0x5582('0x45')]['id'];return db[_0x5582('0x2c')]['find']({'where':{'id':_0x565a85}})[_0x5582('0x26')](handleEntityNotFound(_0x50ab27,null))['then'](function(_0x3ee48e){if(_0x3ee48e){var _0x58d90a=['Voice',_0x5582('0x80'),'Mail','Sms',_0x5582('0x81'),_0x5582('0x82'),_0x5582('0x83')];return db[_0x5582('0x56')][_0x5582('0x57')](function(_0x3596f9){var _0xb17ce4=_[_0x5582('0x2b')](_0x58d90a,function(_0x78c68b){var _0x686d80={'attributes':['id',_0x5582('0x28')]};if(_0x78c68b===_0x5582('0x84')){_0x686d80[_0x5582('0x85')]={'attributes':[_0x5582('0x86')]};}return _0x3ee48e[_0x5582('0x4a')+_0x78c68b+_0x5582('0x76')](_0x686d80)[_0x5582('0x26')](function(_0x371c03){var _0x5fb059=_[_0x5582('0x2b')](_0x371c03,function(_0xd15af7){var _0x758989=_[_0x5582('0x2b')](_0x23eefe,function(_0x136347){var _0x3b2e4b={'where':{'UserId':_0x136347,[_0x78c68b+'QueueId']:_0xd15af7['id']},'transaction':_0x3596f9};if(_0x78c68b===_0x5582('0x84')){_0x3b2e4b['defaults']={'penalty':_0xd15af7[_0x5582('0x87')][_0x5582('0x86')]};}return db[_0x5582('0x88')+_0x78c68b+_0x5582('0x73')]['findOrCreate'](_0x3b2e4b)[_0x5582('0x26')](function(){socket[_0x5582('0x89')](_0x5582('0x49')+_0x78c68b+'Queue:save',{'UserId':_0x136347,[_0x78c68b+_0x5582('0x8a')]:_0xd15af7['id']});if(_0x78c68b!=='Voice'){return;}return db['User'][_0x5582('0x8b')]({'where':{'id':_0x23eefe,'online':0x1},'attributes':['id','name',_0x5582('0x8c'),_0x5582('0x8d'),_0x5582('0x8e')],'raw':!![]})['then'](function(_0x25ec46){var _0x52e5c6=_[_0x5582('0x2b')](_0x25ec46,function(_0x57c99f){return db[_0x5582('0x8f')][_0x5582('0x90')]({'membername':_0x57c99f[_0x5582('0x28')],'UserId':_0x57c99f['id'],'queue_name':_0xd15af7['name'],'VoiceQueueId':_0xd15af7['id'],'interface':_[_0x5582('0x91')](_0x57c99f[_0x5582('0x8e')])?util[_0x5582('0x92')]('SIP/%s',_0x57c99f[_0x5582('0x28')]):_0x57c99f['interface'],'paused':_0x57c99f[_0x5582('0x8d')]||![],'penalty':_0xd15af7[_0x5582('0x87')][_0x5582('0x86')]},{'transaction':_0x3596f9});});return Promise[_0x5582('0x93')](_0x52e5c6);});});});return Promise[_0x5582('0x93')](_0x758989);});return Promise[_0x5582('0x93')](_0x5fb059);})[_0x5582('0x26')](function(){return db[_0x5582('0x6c')][_0x5582('0x78')]({'where':{'teamId':_0x565a85}})[_0x5582('0x26')](function(_0x596ea6){if(_0x596ea6){var _0x3e8b1c=_['map'](_0x23eefe,function(_0xa7c2d5){db['UserVoicePrefix'][_0x5582('0x90')]({'UserId':_0xa7c2d5,'VoicePrefixId':_0x596ea6[_0x5582('0x6e')]});});return Promise[_0x5582('0x93')](_0x3e8b1c);}});});});return Promise[_0x5582('0x93')](_0xb17ce4)[_0x5582('0x26')](function(){return _0x3ee48e[_0x5582('0x7e')](_0x23eefe,{'transaction':_0x3596f9})[_0x5582('0x94')](function(_0x12d3c2){return _0x12d3c2;});});});}})[_0x5582('0x26')](respondWithResult(_0x50ab27,null))[_0x5582('0x44')](handleError(_0x50ab27,null));};exports['removeAgents']=function(_0x25708e,_0x486858){var _0x419436=_['isArray'](_0x25708e[_0x5582('0x33')][_0x5582('0x7c')])?_0x25708e['query']['ids']:[_0x25708e[_0x5582('0x33')][_0x5582('0x7c')]];var _0x4106b0=_0x25708e[_0x5582('0x45')]['id'];return db['Team']['find']({'where':{'id':_0x4106b0}})[_0x5582('0x26')](handleEntityNotFound(_0x486858,null))[_0x5582('0x26')](function(_0x74f5e8){if(_0x74f5e8){var _0x4a679f=['Voice','Chat',_0x5582('0x95'),_0x5582('0x96'),_0x5582('0x81'),_0x5582('0x82'),_0x5582('0x83')];return db[_0x5582('0x56')]['transaction'](function(_0x6a2fd3){var _0x30b79c=_[_0x5582('0x2b')](_0x4a679f,function(_0x154d5c){var _0x485fa2={'attributes':['id',_0x5582('0x28')]};return _0x74f5e8[_0x5582('0x4a')+_0x154d5c+_0x5582('0x76')](_0x485fa2)[_0x5582('0x26')](function(_0x226b1c){var _0x625383=_[_0x5582('0x2b')](_0x226b1c,function(_0x33dde5){return _0x33dde5['removeAgents'](_0x419436,{'transaction':_0x6a2fd3})[_0x5582('0x26')](function(){var _0x42c9e9=_[_0x5582('0x2b')](_0x419436,function(_0x294ca4){socket[_0x5582('0x89')](_0x5582('0x49')+_0x154d5c+'Queue:remove',{'UserId':Number(_0x294ca4),[_0x154d5c+'QueueId']:_0x33dde5['id']});if(_0x154d5c!==_0x5582('0x84')){return;}return db[_0x5582('0x8f')][_0x5582('0x55')]({'where':{'VoiceQueueId':_0x33dde5['id'],'UserId':_0x294ca4},'transaction':_0x6a2fd3});});return Promise[_0x5582('0x93')](_0x42c9e9);});});return Promise[_0x5582('0x93')](_0x625383);});});return Promise[_0x5582('0x93')](_0x30b79c)['then'](function(){return _0x74f5e8['removeAgents'](_0x419436,{'transaction':_0x6a2fd3});})[_0x5582('0x26')](function(){return db['TeamVoicePrefix'][_0x5582('0x78')]({'where':{'teamId':_0x4106b0}})[_0x5582('0x26')](function(_0x4f1aba){if(_0x4f1aba){var _0x4f38e5=_['map'](_0x419436,function(_0xf4e6bf){db['UserVoicePrefix'][_0x5582('0x55')]({'where':{'UserId':_0xf4e6bf,'VoicePrefixId':_0x4f1aba[_0x5582('0x6e')]}});});return Promise[_0x5582('0x93')](_0x4f38e5);}});});});}})[_0x5582('0x26')](respondWithStatusCode(_0x486858,null))[_0x5582('0x44')](handleError(_0x486858,null));};exports['getAgents']=function(_0x46c8b7,_0x5688e9,_0xb20570){var _0x50a360={};var _0x4fd313={};var _0x262175;var _0x40a724;return db['Team']['findOne']({'where':{'id':_0x46c8b7[_0x5582('0x45')]['id']}})[_0x5582('0x26')](handleEntityNotFound(_0x5688e9,null))[_0x5582('0x26')](function(_0x11b00e){if(_0x11b00e){_0x262175=_0x11b00e;_0x4fd313[_0x5582('0x31')]=_[_0x5582('0x32')](db[_0x5582('0x88')][_0x5582('0x2d')]);_0x4fd313['query']=_[_0x5582('0x32')](_0x46c8b7['query']);_0x4fd313[_0x5582('0x34')]=_[_0x5582('0x35')](_0x4fd313[_0x5582('0x31')],_0x4fd313[_0x5582('0x33')]);_0x50a360[_0x5582('0x36')]=_[_0x5582('0x35')](_0x4fd313['model'],qs[_0x5582('0x37')](_0x46c8b7[_0x5582('0x33')][_0x5582('0x37')]));_0x50a360['attributes']=_0x50a360[_0x5582('0x36')][_0x5582('0x38')]?_0x50a360['attributes']:_0x4fd313[_0x5582('0x31')];_0x50a360[_0x5582('0x3a')]=qs['sort'](_0x46c8b7['query'][_0x5582('0x3b')]);_0x50a360['where']=qs[_0x5582('0x34')](_[_0x5582('0x74')](_0x46c8b7[_0x5582('0x33')],_0x4fd313['filters']));if(_0x46c8b7['query']['filter']){_0x50a360[_0x5582('0x3c')]=_[_0x5582('0x3f')](_0x50a360[_0x5582('0x3c')],{'$or':_[_0x5582('0x2b')](_0x50a360['attributes'],function(_0x56d970){var _0x35a6e8={};_0x35a6e8[_0x56d970]={'$like':'%'+_0x46c8b7['query']['filter']+'%'};return _0x35a6e8;})});}_0x50a360=_['merge']({},_0x50a360,_0x46c8b7[_0x5582('0x40')]);return _0x262175[_0x5582('0x97')](_0x50a360);}})[_0x5582('0x26')](function(_0x25f358){if(_0x25f358){_0x40a724=_0x25f358['length'];if(!_0x46c8b7[_0x5582('0x33')][_0x5582('0x39')]('nolimit')){_0x50a360[_0x5582('0x20')]=qs[_0x5582('0x20')](_0x46c8b7[_0x5582('0x33')][_0x5582('0x20')]);_0x50a360[_0x5582('0x1e')]=qs['offset'](_0x46c8b7['query'][_0x5582('0x1e')]);}return _0x262175[_0x5582('0x97')](_0x50a360);}})[_0x5582('0x26')](function(_0x2a58a6){if(_0x2a58a6){return _0x2a58a6?{'count':_0x40a724,'rows':_0x2a58a6}:null;}})[_0x5582('0x26')](respondWithResult(_0x5688e9,null))[_0x5582('0x44')](handleError(_0x5688e9,null));}; \ No newline at end of file +var _0x5e3a=['path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Team','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','body','user','get','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','removeQueues','remove','ids','addAgents','isArray','Chat','Sms','Fax','Whatsapp','through','penalty','QueueId','Voice','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','findOne','upsert','VoicePrefixId','spread','Mail','removeAgents','Queue:remove','getAgents','pick','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x5e3a,0x1c5));var _0xa5e3=function(_0x40460c,_0x54d846){_0x40460c=_0x40460c-0x0;var _0x4b224a=_0x5e3a[_0x40460c];return _0x4b224a;};'use strict';var emlformat=require(_0xa5e3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5e3('0x1'));var rp=require(_0xa5e3('0x2'));var moment=require(_0xa5e3('0x3'));var BPromise=require(_0xa5e3('0x4'));var Mustache=require(_0xa5e3('0x5'));var util=require('util');var path=require(_0xa5e3('0x6'));var sox=require(_0xa5e3('0x7'));var csv=require(_0xa5e3('0x8'));var ejs=require(_0xa5e3('0x9'));var fs=require('fs');var fs_extra=require(_0xa5e3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa5e3('0xb'));var jsforce=require(_0xa5e3('0xc'));var deskjs=require(_0xa5e3('0xd'));var toCsv=require(_0xa5e3('0x8'));var querystring=require(_0xa5e3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa5e3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa5e3('0x10'));var hardwareService=require(_0xa5e3('0x11'));var logger=require(_0xa5e3('0x12'))(_0xa5e3('0x13'));var utils=require(_0xa5e3('0x14'));var config=require(_0xa5e3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa5e3('0x16')]=_[_0xa5e3('0x17')](config[_0xa5e3('0x16')],{'host':_0xa5e3('0x18'),'port':0x18eb});var socket=require(_0xa5e3('0x19'))(new Redis(config['redis']));require(_0xa5e3('0x1a'))[_0xa5e3('0x1b')](socket);function respondWithStatusCode(_0x2bf187,_0x637295){_0x637295=_0x637295||0xcc;return function(_0x42bc1b){if(_0x42bc1b){return _0x2bf187['sendStatus'](_0x637295);}return _0x2bf187[_0xa5e3('0x1c')](_0x637295)[_0xa5e3('0x1d')]();};}function respondWithResult(_0x239293,_0x147a6d){_0x147a6d=_0x147a6d||0xc8;return function(_0x4baf01){if(_0x4baf01){return _0x239293[_0xa5e3('0x1c')](_0x147a6d)['json'](_0x4baf01);}};}function respondWithFilteredResult(_0x3ccb08,_0xf83d88){return function(_0x5cd192){if(_0x5cd192){var _0x17cb00=typeof _0xf83d88[_0xa5e3('0x1e')]===_0xa5e3('0x1f')&&typeof _0xf83d88[_0xa5e3('0x20')]===_0xa5e3('0x1f');var _0x183ea0=_0x5cd192[_0xa5e3('0x21')];var _0x54ad8b=_0x17cb00?0x0:_0xf83d88['offset'];var _0x4f2f79=_0x17cb00?_0x5cd192['count']:_0xf83d88[_0xa5e3('0x1e')]+_0xf83d88[_0xa5e3('0x20')];var _0x56501c;if(_0x4f2f79>=_0x183ea0){_0x4f2f79=_0x183ea0;_0x56501c=0xc8;}else{_0x56501c=0xce;}_0x3ccb08[_0xa5e3('0x1c')](_0x56501c);return _0x3ccb08[_0xa5e3('0x22')](_0xa5e3('0x23'),_0x54ad8b+'-'+_0x4f2f79+'/'+_0x183ea0)['json'](_0x5cd192);}return null;};}function patchUpdates(_0x262c85){return function(_0x50e2d1){try{jsonpatch[_0xa5e3('0x24')](_0x50e2d1,_0x262c85,!![]);}catch(_0x411722){return BPromise[_0xa5e3('0x25')](_0x411722);}return _0x50e2d1[_0xa5e3('0x26')]();};}function saveUpdates(_0x1bf9d0,_0x2eabb5){return function(_0x5894f8){if(_0x5894f8){return _0x5894f8[_0xa5e3('0x27')](_0x1bf9d0)[_0xa5e3('0x28')](function(_0x3b7403){return _0x3b7403;});}return null;};}function handleEntityNotFound(_0xc00d79,_0x44ee1e){return function(_0x13c74a){if(!_0x13c74a){_0xc00d79[_0xa5e3('0x29')](0x194);}return _0x13c74a;};}function handleError(_0x30ed6c,_0x3f8cfe){_0x3f8cfe=_0x3f8cfe||0x1f4;return function(_0x431fde){logger[_0xa5e3('0x2a')](_0x431fde[_0xa5e3('0x2b')]);if(_0x431fde[_0xa5e3('0x2c')]){delete _0x431fde[_0xa5e3('0x2c')];}_0x30ed6c[_0xa5e3('0x1c')](_0x3f8cfe)[_0xa5e3('0x2d')](_0x431fde);};}exports['index']=function(_0x3b8be5,_0xafa66c){var _0x28469e={},_0x4664bb={},_0x2dc551={'count':0x0,'rows':[]};var _0x2118fb=_['map'](db[_0xa5e3('0x2e')]['rawAttributes'],function(_0x25165b){return{'name':_0x25165b[_0xa5e3('0x2f')],'type':_0x25165b['type'][_0xa5e3('0x30')]};});_0x4664bb[_0xa5e3('0x31')]=_[_0xa5e3('0x32')](_0x2118fb,_0xa5e3('0x2c'));_0x4664bb[_0xa5e3('0x33')]=_[_0xa5e3('0x34')](_0x3b8be5[_0xa5e3('0x33')]);_0x4664bb[_0xa5e3('0x35')]=_[_0xa5e3('0x36')](_0x4664bb[_0xa5e3('0x31')],_0x4664bb['query']);_0x28469e[_0xa5e3('0x37')]=_[_0xa5e3('0x36')](_0x4664bb[_0xa5e3('0x31')],qs['fields'](_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x38')]));_0x28469e[_0xa5e3('0x37')]=_0x28469e['attributes']['length']?_0x28469e['attributes']:_0x4664bb[_0xa5e3('0x31')];if(!_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x39')](_0xa5e3('0x3a'))){_0x28469e[_0xa5e3('0x20')]=qs[_0xa5e3('0x20')](_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x20')]);_0x28469e['offset']=qs[_0xa5e3('0x1e')](_0x3b8be5['query'][_0xa5e3('0x1e')]);}_0x28469e['order']=qs[_0xa5e3('0x3b')](_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x3b')]);_0x28469e[_0xa5e3('0x3c')]=qs[_0xa5e3('0x35')](_['pick'](_0x3b8be5[_0xa5e3('0x33')],_0x4664bb['filters']),_0x2118fb);if(_0x3b8be5[_0xa5e3('0x33')]['filter']){_0x28469e[_0xa5e3('0x3c')]=_[_0xa5e3('0x3d')](_0x28469e['where'],{'$or':_[_0xa5e3('0x32')](_0x2118fb,function(_0x9944cd){if(_0x9944cd['type']!==_0xa5e3('0x3e')){var _0x36947f={};_0x36947f[_0x9944cd[_0xa5e3('0x2c')]]={'$like':'%'+_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x3f')]+'%'};return _0x36947f;}})});}_0x28469e=_[_0xa5e3('0x3d')]({},_0x28469e,_0x3b8be5[_0xa5e3('0x40')]);var _0x36626b={'where':_0x28469e['where']};return db[_0xa5e3('0x2e')][_0xa5e3('0x21')](_0x36626b)[_0xa5e3('0x28')](function(_0x1a93d8){_0x2dc551[_0xa5e3('0x21')]=_0x1a93d8;if(_0x3b8be5[_0xa5e3('0x33')][_0xa5e3('0x41')]){_0x28469e[_0xa5e3('0x42')]=[{'all':!![]}];}return db[_0xa5e3('0x2e')][_0xa5e3('0x43')](_0x28469e);})[_0xa5e3('0x28')](function(_0x46e906){_0x2dc551[_0xa5e3('0x44')]=_0x46e906;return _0x2dc551;})['then'](respondWithFilteredResult(_0xafa66c,_0x28469e))['catch'](handleError(_0xafa66c,null));};exports[_0xa5e3('0x45')]=function(_0x1f2d0d,_0x59f979){var _0x28ce59={'raw':![],'where':{'id':_0x1f2d0d[_0xa5e3('0x46')]['id']}},_0x583d84={};_0x583d84[_0xa5e3('0x31')]=_[_0xa5e3('0x34')](db['Team'][_0xa5e3('0x47')]);_0x583d84[_0xa5e3('0x33')]=_[_0xa5e3('0x34')](_0x1f2d0d[_0xa5e3('0x33')]);_0x583d84['filters']=_[_0xa5e3('0x36')](_0x583d84[_0xa5e3('0x31')],_0x583d84[_0xa5e3('0x33')]);_0x28ce59[_0xa5e3('0x37')]=_['intersection'](_0x583d84[_0xa5e3('0x31')],qs['fields'](_0x1f2d0d[_0xa5e3('0x33')]['fields']));_0x28ce59[_0xa5e3('0x37')]=_0x28ce59[_0xa5e3('0x37')][_0xa5e3('0x48')]?_0x28ce59[_0xa5e3('0x37')]:_0x583d84['model'];if(_0x1f2d0d[_0xa5e3('0x33')][_0xa5e3('0x41')]){_0x28ce59[_0xa5e3('0x42')]=[{'all':!![]}];}_0x28ce59=_[_0xa5e3('0x3d')]({},_0x28ce59,_0x1f2d0d[_0xa5e3('0x40')]);return db['Team']['find'](_0x28ce59)[_0xa5e3('0x28')](handleEntityNotFound(_0x59f979,null))['then'](respondWithResult(_0x59f979,null))['catch'](handleError(_0x59f979,null));};exports[_0xa5e3('0x49')]=function(_0x3e2c56,_0x284d10){return db[_0xa5e3('0x2e')]['create'](_0x3e2c56[_0xa5e3('0x4a')],{})[_0xa5e3('0x28')](function(_0x22362b){var _0x2296b4=_0x3e2c56[_0xa5e3('0x4b')][_0xa5e3('0x4c')]({'plain':!![]});if(!_0x2296b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2296b4[_0xa5e3('0x4d')]===_0xa5e3('0x4b')){var _0x2550be=_0x22362b['get']({'plain':!![]});var _0x573126=_0xa5e3('0x4e');return db[_0xa5e3('0x4f')][_0xa5e3('0x50')]({'where':{'name':_0x573126,'userProfileId':_0x2296b4[_0xa5e3('0x51')]},'raw':!![]})[_0xa5e3('0x28')](function(_0x2e0c2f){if(_0x2e0c2f&&_0x2e0c2f[_0xa5e3('0x52')]===0x0){return db['UserProfileResource'][_0xa5e3('0x49')]({'name':_0x2550be['name'],'resourceId':_0x2550be['id'],'type':_0x2e0c2f['name'],'sectionId':_0x2e0c2f['id']},{})['then'](function(){return _0x22362b;});}else{return _0x22362b;}})[_0xa5e3('0x53')](function(_0x3a5364){logger[_0xa5e3('0x2a')](_0xa5e3('0x54'),_0x3a5364);throw _0x3a5364;});}return _0x22362b;})[_0xa5e3('0x28')](respondWithResult(_0x284d10,0xc9))[_0xa5e3('0x53')](handleError(_0x284d10,null));};exports[_0xa5e3('0x27')]=function(_0x282c3,_0x48f7cb){if(_0x282c3['body']['id']){delete _0x282c3['body']['id'];}return db[_0xa5e3('0x2e')][_0xa5e3('0x50')]({'where':{'id':_0x282c3[_0xa5e3('0x46')]['id']}})[_0xa5e3('0x28')](handleEntityNotFound(_0x48f7cb,null))[_0xa5e3('0x28')](saveUpdates(_0x282c3[_0xa5e3('0x4a')],null))[_0xa5e3('0x28')](respondWithResult(_0x48f7cb,null))['catch'](handleError(_0x48f7cb,null));};exports[_0xa5e3('0x55')]=function(_0x500ea0,_0x464ff8){var _0x41fc03=_0x500ea0[_0xa5e3('0x46')]['id'];var _0xefe659=[];return db[_0xa5e3('0x56')][_0xa5e3('0x57')](function(_0x376300){var _0x32ea4d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x32ea4d,{'type':db[_0xa5e3('0x58')][_0xa5e3('0x59')]['SELECT'],'raw':!![],'transaction':_0x376300})['then'](function(_0x8e82f3){_0xefe659=_[_0xa5e3('0x32')](_0x8e82f3,function(_0x3f1e09){return Number(_0x3f1e09[_0xa5e3('0x5a')]);});})[_0xa5e3('0x28')](function(){var _0x73fb1b=_0xa5e3('0x5b')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x73fb1b,{'type':db[_0xa5e3('0x58')]['QueryTypes'][_0xa5e3('0x5c')],'raw':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x1a1da1){var _0x1a90de=_['map'](_0x1a1da1,function(_0x547b22){return Number(_0x547b22[_0xa5e3('0x5d')]);});return db['UserVoiceQueue'][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'VoiceQueueId':{'$in':_0x1a90de}},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){var _0x30a4b9=_0xa5e3('0x5e')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x30a4b9,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x376300});})['then'](function(_0x4ea705){var _0x29920a=_['map'](_0x4ea705,function(_0x48fd7d){return Number(_0x48fd7d[_0xa5e3('0x5f')]);});return db['UserMailQueue'][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'MailQueueId':{'$in':_0x29920a}},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){var _0x3b36c7=_0xa5e3('0x60')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x3b36c7,{'type':db[_0xa5e3('0x58')][_0xa5e3('0x59')][_0xa5e3('0x5c')],'raw':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x3f3914){var _0x23086c=_[_0xa5e3('0x32')](_0x3f3914,function(_0x2f446a){return Number(_0x2f446a[_0xa5e3('0x61')]);});return db['UserSmsQueue'][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'SmsQueueId':{'$in':_0x23086c}},'transaction':_0x376300});})['then'](function(){var _0x8ea188=_0xa5e3('0x62')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x8ea188,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x4fcb45){var _0x57dac2=_['map'](_0x4fcb45,function(_0x19d443){return Number(_0x19d443[_0xa5e3('0x63')]);});return db[_0xa5e3('0x64')]['destroy']({'where':{'UserId':{'$in':_0xefe659},'ChatQueueId':{'$in':_0x57dac2}},'transaction':_0x376300});})['then'](function(){var _0x4c8845=_0xa5e3('0x65')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x4c8845,{'type':db[_0xa5e3('0x58')][_0xa5e3('0x59')][_0xa5e3('0x5c')],'raw':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x2481b1){var _0x627561=_[_0xa5e3('0x32')](_0x2481b1,function(_0x581d6b){return Number(_0x581d6b[_0xa5e3('0x66')]);});return db['UserFaxQueue'][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'FaxQueueId':{'$in':_0x627561}},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){var _0x32e5be='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x32e5be,{'type':db[_0xa5e3('0x58')][_0xa5e3('0x59')]['SELECT'],'raw':!![],'transaction':_0x376300});})['then'](function(_0x587803){var _0x33fada=_['map'](_0x587803,function(_0x499eeb){return Number(_0x499eeb[_0xa5e3('0x67')]);});return db[_0xa5e3('0x68')][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'OpenchannelQueueId':{'$in':_0x33fada}},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){var _0x19f015=_0xa5e3('0x69')+_0x41fc03;return db[_0xa5e3('0x56')][_0xa5e3('0x33')](_0x19f015,{'type':db[_0xa5e3('0x58')][_0xa5e3('0x59')][_0xa5e3('0x5c')],'raw':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x34d758){var _0x33cb5a=_['map'](_0x34d758,function(_0xa1eef){return Number(_0xa1eef[_0xa5e3('0x6a')]);});return db[_0xa5e3('0x6b')]['destroy']({'where':{'UserId':{'$in':_0xefe659},'WhatsappQueueId':{'$in':_0x33cb5a}},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){return db[_0xa5e3('0x6c')][_0xa5e3('0x50')]({'where':{'TeamId':_0x41fc03}});})['then'](function(_0x369cb5){if(_0x369cb5===null){return;}return db[_0xa5e3('0x6d')][_0xa5e3('0x55')]({'where':{'UserId':{'$in':_0xefe659},'VoicePrefixId':_0x369cb5['VoicePrefixId']},'transaction':_0x376300});})[_0xa5e3('0x28')](function(){return db[_0xa5e3('0x2e')][_0xa5e3('0x55')]({'where':{'id':_0x41fc03},'cascade':!![],'transaction':_0x376300});})[_0xa5e3('0x28')](function(_0x40cee4){if(_0x40cee4===0x0){_0x464ff8['sendStatus'](0x194);}else{return db['UserProfileResource'][_0xa5e3('0x55')]({'where':{'type':_0xa5e3('0x4e'),'resourceId':_0x41fc03},'cascade':!![],'transaction':_0x376300})[_0xa5e3('0x28')](function(){_0x464ff8['status'](0xcc)['end']();});}})[_0xa5e3('0x53')](function(_0x3c3d1){_0x464ff8['status'](0x1f4)[_0xa5e3('0x2d')](_0x3c3d1);});});};exports[_0xa5e3('0x6e')]=function(_0x56f701,_0x4ae496,_0x50a44b){return db[_0xa5e3('0x2e')]['findOne']({'where':{'id':_0x56f701['params']['id']}})['then'](handleEntityNotFound(_0x4ae496,null))[_0xa5e3('0x28')](function(_0x5cc71e){if(!_0x56f701['query'][_0xa5e3('0x6f')]||!utils[_0xa5e3('0x70')](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x6f')])){throw new db[(_0xa5e3('0x58'))]['ValidationError'](_0xa5e3('0x71'));}var _0x2d1aab={};var _0x44f7e7={};_0x44f7e7['model']=_[_0xa5e3('0x34')](db[_[_0xa5e3('0x72')](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x6f')][_0xa5e3('0x73')]())+_0xa5e3('0x74')]['rawAttributes']);_0x44f7e7['query']=_[_0xa5e3('0x34')](_0x56f701[_0xa5e3('0x33')]);_0x44f7e7[_0xa5e3('0x35')]=_['intersection'](_0x44f7e7[_0xa5e3('0x31')],_0x44f7e7[_0xa5e3('0x33')]);_0x2d1aab[_0xa5e3('0x37')]=_['intersection'](_0x44f7e7[_0xa5e3('0x31')],qs[_0xa5e3('0x38')](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x38')]));_0x2d1aab['attributes']=_0x2d1aab[_0xa5e3('0x37')][_0xa5e3('0x48')]?_0x2d1aab[_0xa5e3('0x37')]:_0x44f7e7[_0xa5e3('0x31')];_0x2d1aab[_0xa5e3('0x20')]=qs['limit'](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x20')]);_0x2d1aab[_0xa5e3('0x1e')]=qs['offset'](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x1e')]);_0x2d1aab['order']=qs[_0xa5e3('0x3b')](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x3b')]);_0x2d1aab['where']=qs[_0xa5e3('0x35')](_['pick'](_0x56f701[_0xa5e3('0x33')],_0x44f7e7[_0xa5e3('0x35')]));_0x2d1aab=_[_0xa5e3('0x3d')]({},_0x2d1aab,_0x56f701[_0xa5e3('0x40')]);return _0x5cc71e[_0xa5e3('0x4c')+_[_0xa5e3('0x72')](_0x56f701[_0xa5e3('0x33')][_0xa5e3('0x6f')][_0xa5e3('0x73')]())+_0xa5e3('0x75')](_0x2d1aab);})[_0xa5e3('0x28')](respondWithResult(_0x4ae496,null))[_0xa5e3('0x53')](handleError(_0x4ae496,null));};exports[_0xa5e3('0x76')]=function(_0x598da6,_0x1f9ed0,_0x3e73f8){return db[_0xa5e3('0x2e')]['findOne']({'where':{'id':_0x598da6[_0xa5e3('0x46')]['id']}})[_0xa5e3('0x28')](function(_0x494a5b){if(_0x494a5b){if(!_0x598da6[_0xa5e3('0x4a')][_0xa5e3('0x6f')]||!utils[_0xa5e3('0x70')](_0x598da6[_0xa5e3('0x4a')][_0xa5e3('0x6f')])){throw new db[(_0xa5e3('0x58'))]['ValidationError'](_0xa5e3('0x71'));}return _0x494a5b['add'+_[_0xa5e3('0x72')](_0x598da6[_0xa5e3('0x4a')][_0xa5e3('0x6f')][_0xa5e3('0x73')]())+'Queues'](_0x598da6[_0xa5e3('0x4a')]['ids']);}return null;})[_0xa5e3('0x28')](handleEntityNotFound(_0x1f9ed0,null))[_0xa5e3('0x28')](respondWithStatusCode(_0x1f9ed0,null))[_0xa5e3('0x53')](handleError(_0x1f9ed0,null));};exports[_0xa5e3('0x77')]=function(_0xde8b75,_0x58f8d6,_0x10f636){return db[_0xa5e3('0x2e')]['findOne']({'where':{'id':_0xde8b75[_0xa5e3('0x46')]['id']}})[_0xa5e3('0x28')](function(_0x48a096){if(_0x48a096){if(!_0xde8b75['query'][_0xa5e3('0x6f')]||!utils[_0xa5e3('0x70')](_0xde8b75[_0xa5e3('0x33')][_0xa5e3('0x6f')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x48a096[_0xa5e3('0x78')+_['capitalize'](_0xde8b75[_0xa5e3('0x33')][_0xa5e3('0x6f')][_0xa5e3('0x73')]())+'Queues'](_0xde8b75[_0xa5e3('0x33')][_0xa5e3('0x79')]);}return null;})[_0xa5e3('0x28')](handleEntityNotFound(_0x58f8d6,null))[_0xa5e3('0x28')](respondWithStatusCode(_0x58f8d6,null))[_0xa5e3('0x53')](handleError(_0x58f8d6,null));};exports[_0xa5e3('0x7a')]=function(_0x3fbec2,_0x52b7ee){var _0x6cfc5b=_[_0xa5e3('0x7b')](_0x3fbec2['body'][_0xa5e3('0x79')])?_0x3fbec2[_0xa5e3('0x4a')]['ids']:[_0x3fbec2[_0xa5e3('0x4a')]['ids']];var _0x5eb983=_0x3fbec2[_0xa5e3('0x46')]['id'];return db[_0xa5e3('0x2e')][_0xa5e3('0x50')]({'where':{'id':_0x5eb983}})[_0xa5e3('0x28')](handleEntityNotFound(_0x52b7ee,null))['then'](function(_0x86ba32){if(_0x86ba32){var _0x3500b8=['Voice',_0xa5e3('0x7c'),'Mail',_0xa5e3('0x7d'),_0xa5e3('0x7e'),'Openchannel',_0xa5e3('0x7f')];return db[_0xa5e3('0x56')][_0xa5e3('0x57')](function(_0x2d8ccd){var _0x158d66=_[_0xa5e3('0x32')](_0x3500b8,function(_0x307bf0){var _0x311b6b={'attributes':['id',_0xa5e3('0x2c')]};if(_0x307bf0==='Voice'){_0x311b6b[_0xa5e3('0x80')]={'attributes':[_0xa5e3('0x81')]};}return _0x86ba32[_0xa5e3('0x4c')+_0x307bf0+_0xa5e3('0x75')](_0x311b6b)[_0xa5e3('0x28')](function(_0x5a67ac){var _0x368693=_[_0xa5e3('0x32')](_0x5a67ac,function(_0x47fdb3){var _0x53180e=_[_0xa5e3('0x32')](_0x6cfc5b,function(_0x17cff1){var _0x5441fe={'where':{'UserId':_0x17cff1,[_0x307bf0+_0xa5e3('0x82')]:_0x47fdb3['id']},'transaction':_0x2d8ccd};if(_0x307bf0===_0xa5e3('0x83')){_0x5441fe[_0xa5e3('0x17')]={'penalty':_0x47fdb3[_0xa5e3('0x84')][_0xa5e3('0x81')]};}return db[_0xa5e3('0x85')+_0x307bf0+_0xa5e3('0x74')]['findOrCreate'](_0x5441fe)[_0xa5e3('0x28')](function(){socket[_0xa5e3('0x86')]('user'+_0x307bf0+_0xa5e3('0x87'),{'UserId':_0x17cff1,[_0x307bf0+_0xa5e3('0x82')]:_0x47fdb3['id']});if(_0x307bf0!==_0xa5e3('0x83')){return;}return db[_0xa5e3('0x85')]['findAll']({'where':{'id':_0x6cfc5b,'online':0x1},'attributes':['id',_0xa5e3('0x2c'),_0xa5e3('0x88'),_0xa5e3('0x89'),_0xa5e3('0x8a')],'raw':!![]})[_0xa5e3('0x28')](function(_0x2f6186){var _0x19636d=_[_0xa5e3('0x32')](_0x2f6186,function(_0x30b208){return db[_0xa5e3('0x8b')]['upsert']({'membername':_0x30b208[_0xa5e3('0x2c')],'UserId':_0x30b208['id'],'queue_name':_0x47fdb3[_0xa5e3('0x2c')],'VoiceQueueId':_0x47fdb3['id'],'interface':_[_0xa5e3('0x8c')](_0x30b208[_0xa5e3('0x8a')])?util[_0xa5e3('0x8d')](_0xa5e3('0x8e'),_0x30b208[_0xa5e3('0x2c')]):_0x30b208['interface'],'paused':_0x30b208[_0xa5e3('0x89')]||![],'penalty':_0x47fdb3[_0xa5e3('0x84')][_0xa5e3('0x81')]},{'transaction':_0x2d8ccd});});return Promise['all'](_0x19636d);});});});return Promise['all'](_0x53180e);});return Promise[_0xa5e3('0x8f')](_0x368693);})[_0xa5e3('0x28')](function(){return db[_0xa5e3('0x6c')][_0xa5e3('0x90')]({'where':{'teamId':_0x5eb983}})['then'](function(_0x14c492){if(_0x14c492){var _0x2b85bc=_[_0xa5e3('0x32')](_0x6cfc5b,function(_0x270f50){db[_0xa5e3('0x6d')][_0xa5e3('0x91')]({'UserId':_0x270f50,'VoicePrefixId':_0x14c492[_0xa5e3('0x92')]});});return Promise['all'](_0x2b85bc);}});});});return Promise[_0xa5e3('0x8f')](_0x158d66)[_0xa5e3('0x28')](function(){return _0x86ba32['addAgents'](_0x6cfc5b,{'transaction':_0x2d8ccd})[_0xa5e3('0x93')](function(_0x568827){return _0x568827;});});});}})[_0xa5e3('0x28')](respondWithResult(_0x52b7ee,null))['catch'](handleError(_0x52b7ee,null));};exports['removeAgents']=function(_0x400aaf,_0x544b05){var _0x3c4844=_[_0xa5e3('0x7b')](_0x400aaf['query'][_0xa5e3('0x79')])?_0x400aaf[_0xa5e3('0x33')][_0xa5e3('0x79')]:[_0x400aaf[_0xa5e3('0x33')][_0xa5e3('0x79')]];var _0x311be7=_0x400aaf['params']['id'];return db[_0xa5e3('0x2e')]['find']({'where':{'id':_0x311be7}})[_0xa5e3('0x28')](handleEntityNotFound(_0x544b05,null))['then'](function(_0x4c7dcb){if(_0x4c7dcb){var _0x28177a=[_0xa5e3('0x83'),_0xa5e3('0x7c'),_0xa5e3('0x94'),_0xa5e3('0x7d'),_0xa5e3('0x7e'),'Openchannel',_0xa5e3('0x7f')];return db['sequelize'][_0xa5e3('0x57')](function(_0x1353b3){var _0x5c7a13=_[_0xa5e3('0x32')](_0x28177a,function(_0xec1b08){var _0x261b3a={'attributes':['id',_0xa5e3('0x2c')]};return _0x4c7dcb[_0xa5e3('0x4c')+_0xec1b08+'Queues'](_0x261b3a)['then'](function(_0x423a93){var _0x19eb52=_[_0xa5e3('0x32')](_0x423a93,function(_0x306af9){return _0x306af9[_0xa5e3('0x95')](_0x3c4844,{'transaction':_0x1353b3})['then'](function(){var _0x57cd17=_['map'](_0x3c4844,function(_0x3fb3d2){socket[_0xa5e3('0x86')](_0xa5e3('0x4b')+_0xec1b08+_0xa5e3('0x96'),{'UserId':Number(_0x3fb3d2),[_0xec1b08+_0xa5e3('0x82')]:_0x306af9['id']});if(_0xec1b08!==_0xa5e3('0x83')){return;}return db[_0xa5e3('0x8b')][_0xa5e3('0x55')]({'where':{'VoiceQueueId':_0x306af9['id'],'UserId':_0x3fb3d2},'transaction':_0x1353b3});});return Promise[_0xa5e3('0x8f')](_0x57cd17);});});return Promise[_0xa5e3('0x8f')](_0x19eb52);});});return Promise[_0xa5e3('0x8f')](_0x5c7a13)['then'](function(){return _0x4c7dcb[_0xa5e3('0x95')](_0x3c4844,{'transaction':_0x1353b3});})[_0xa5e3('0x28')](function(){return db[_0xa5e3('0x6c')]['findOne']({'where':{'teamId':_0x311be7}})['then'](function(_0x36098a){if(_0x36098a){var _0x4764e4=_[_0xa5e3('0x32')](_0x3c4844,function(_0x5637f5){db[_0xa5e3('0x6d')]['destroy']({'where':{'UserId':_0x5637f5,'VoicePrefixId':_0x36098a['VoicePrefixId']}});});return Promise['all'](_0x4764e4);}});});});}})[_0xa5e3('0x28')](respondWithStatusCode(_0x544b05,null))[_0xa5e3('0x53')](handleError(_0x544b05,null));};exports[_0xa5e3('0x97')]=function(_0xf2cc9b,_0x2e3761,_0x15fe0a){var _0x426010={};var _0x4b72b3={};var _0x443e61;var _0x298357;return db[_0xa5e3('0x2e')][_0xa5e3('0x90')]({'where':{'id':_0xf2cc9b['params']['id']}})['then'](handleEntityNotFound(_0x2e3761,null))['then'](function(_0x559443){if(_0x559443){_0x443e61=_0x559443;_0x4b72b3[_0xa5e3('0x31')]=_['keys'](db['User'][_0xa5e3('0x47')]);_0x4b72b3['query']=_['keys'](_0xf2cc9b[_0xa5e3('0x33')]);_0x4b72b3['filters']=_[_0xa5e3('0x36')](_0x4b72b3['model'],_0x4b72b3[_0xa5e3('0x33')]);_0x426010['attributes']=_[_0xa5e3('0x36')](_0x4b72b3['model'],qs[_0xa5e3('0x38')](_0xf2cc9b[_0xa5e3('0x33')]['fields']));_0x426010[_0xa5e3('0x37')]=_0x426010[_0xa5e3('0x37')][_0xa5e3('0x48')]?_0x426010[_0xa5e3('0x37')]:_0x4b72b3[_0xa5e3('0x31')];_0x426010['order']=qs['sort'](_0xf2cc9b[_0xa5e3('0x33')]['sort']);_0x426010['where']=qs[_0xa5e3('0x35')](_[_0xa5e3('0x98')](_0xf2cc9b[_0xa5e3('0x33')],_0x4b72b3[_0xa5e3('0x35')]));if(_0xf2cc9b['query'][_0xa5e3('0x3f')]){_0x426010[_0xa5e3('0x3c')]=_[_0xa5e3('0x3d')](_0x426010[_0xa5e3('0x3c')],{'$or':_[_0xa5e3('0x32')](_0x426010[_0xa5e3('0x37')],function(_0x558c63){var _0x309686={};_0x309686[_0x558c63]={'$like':'%'+_0xf2cc9b[_0xa5e3('0x33')][_0xa5e3('0x3f')]+'%'};return _0x309686;})});}_0x426010=_[_0xa5e3('0x3d')]({},_0x426010,_0xf2cc9b[_0xa5e3('0x40')]);return _0x443e61[_0xa5e3('0x97')](_0x426010);}})['then'](function(_0xfd72e4){if(_0xfd72e4){_0x298357=_0xfd72e4[_0xa5e3('0x48')];if(!_0xf2cc9b[_0xa5e3('0x33')][_0xa5e3('0x39')]('nolimit')){_0x426010[_0xa5e3('0x20')]=qs[_0xa5e3('0x20')](_0xf2cc9b['query'][_0xa5e3('0x20')]);_0x426010['offset']=qs['offset'](_0xf2cc9b[_0xa5e3('0x33')][_0xa5e3('0x1e')]);}return _0x443e61[_0xa5e3('0x97')](_0x426010);}})[_0xa5e3('0x28')](function(_0x119dc4){if(_0x119dc4){return _0x119dc4?{'count':_0x298357,'rows':_0x119dc4}:null;}})['then'](respondWithResult(_0x2e3761,null))[_0xa5e3('0x53')](handleError(_0x2e3761,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d6b1d83..ec10dfd 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 _0x0825=['exports','../../mysqldb','Team','save','emit','hasOwnProperty','hook'];(function(_0x51a8ce,_0x2ce0f5){var _0xc784fc=function(_0x234e63){while(--_0x234e63){_0x51a8ce['push'](_0x51a8ce['shift']());}};_0xc784fc(++_0x2ce0f5);}(_0x0825,0xb0));var _0x5082=function(_0x327bca,_0x39987d){_0x327bca=_0x327bca-0x0;var _0x33a85b=_0x0825[_0x327bca];return _0x33a85b;};'use strict';var EventEmitter=require('events');var Team=require(_0x5082('0x0'))['db'][_0x5082('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5082('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x47625a){return function(_0x280020,_0x3afcf9,_0x1571ff){TeamEvents[_0x5082('0x3')](_0x47625a+':'+_0x280020['id'],_0x280020);TeamEvents[_0x5082('0x3')](_0x47625a,_0x280020);_0x1571ff(null);};}for(var e in events){if(events[_0x5082('0x4')](e)){var event=events[e];Team[_0x5082('0x5')](e,emitEvent(event));}}module[_0x5082('0x6')]=TeamEvents; \ No newline at end of file +var _0x0203=['hook','Team','remove','emit','hasOwnProperty'];(function(_0x17f657,_0x3b6f23){var _0x2ac480=function(_0x12f59c){while(--_0x12f59c){_0x17f657['push'](_0x17f657['shift']());}};_0x2ac480(++_0x3b6f23);}(_0x0203,0x74));var _0x3020=function(_0xff292d,_0x24dc1e){_0xff292d=_0xff292d-0x0;var _0x50f32d=_0x0203[_0xff292d];return _0x50f32d;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x3020('0x0')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3020('0x1')};function emitEvent(_0x9c1b11){return function(_0x561e54,_0x32191a,_0x24dcc7){TeamEvents['emit'](_0x9c1b11+':'+_0x561e54['id'],_0x561e54);TeamEvents[_0x3020('0x2')](_0x9c1b11,_0x561e54);_0x24dcc7(null);};}for(var e in events){if(events[_0x3020('0x3')](e)){var event=events[e];Team[_0x3020('0x4')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 38c90fb..46d8e3c 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 _0x7057=['define','teams','util','bluebird','request-promise','path','../../config/environment','./team.attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7057,0x17a));var _0x7705=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x7057[_0x513545];return _0x18b7c5;};'use strict';var _=require('lodash');var util=require(_0x7705('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7705('0x1'));var rp=require(_0x7705('0x2'));var fs=require('fs');var path=require(_0x7705('0x3'));var rimraf=require('rimraf');var config=require(_0x7705('0x4'));var attributes=require(_0x7705('0x5'));module['exports']=function(_0x41d3a1,_0x1a1a1b){return _0x41d3a1[_0x7705('0x6')]('Team',attributes,{'tableName':_0x7705('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc45=['request-promise','path','rimraf','define','Team','teams','lodash','util','moment','bluebird'];(function(_0x5713f,_0x4cafff){var _0x19095b=function(_0x42d730){while(--_0x42d730){_0x5713f['push'](_0x5713f['shift']());}};_0x19095b(++_0x4cafff);}(_0xfc45,0x74));var _0x5fc4=function(_0x546a0f,_0xdf6d36){_0x546a0f=_0x546a0f-0x0;var _0x45b85c=_0xfc45[_0x546a0f];return _0x45b85c;};'use strict';var _=require(_0x5fc4('0x0'));var util=require(_0x5fc4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5fc4('0x2'));var BPromise=require(_0x5fc4('0x3'));var rp=require(_0x5fc4('0x4'));var fs=require('fs');var path=require(_0x5fc4('0x5'));var rimraf=require(_0x5fc4('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module['exports']=function(_0xd6d729,_0x37d7f9){return _0xd6d729[_0x5fc4('0x7')](_0x5fc4('0x8'),attributes,{'tableName':_0x5fc4('0x9'),'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 2738c91..2cb13b0 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 _0xb133=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','register','then','debug','request\x20sent','error','message','Team,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x5b5d2b,_0x2a7b7a){var _0x4a436d=function(_0x375a34){while(--_0x375a34){_0x5b5d2b['push'](_0x5b5d2b['shift']());}};_0x4a436d(++_0x2a7b7a);}(_0xb133,0x19c));var _0x3b13=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb133[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3b13('0x0'));var util=require(_0x3b13('0x1'));var moment=require(_0x3b13('0x2'));var BPromise=require(_0x3b13('0x3'));var rs=require(_0x3b13('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b13('0x5'));var logger=require('../../config/logger')(_0x3b13('0x6'));var config=require('../../config/environment');var jayson=require(_0x3b13('0x7'));var client=jayson[_0x3b13('0x8')][_0x3b13('0x9')]({'port':0x232a});config[_0x3b13('0xa')]=_[_0x3b13('0xb')](config[_0x3b13('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b13('0xc'))(new Redis(config[_0x3b13('0xa')]));require(_0x3b13('0xd'))[_0x3b13('0xe')](socket);function respondWithRpcPromise(_0x363ef7,_0x12f07a,_0x42b15b){return new BPromise(function(_0x2f84cb,_0x5104d7){return client['request'](_0x363ef7,_0x42b15b)[_0x3b13('0xf')](function(_0x13a28e){logger['info']('Team,\x20%s,\x20%s',_0x12f07a,'request\x20sent');logger[_0x3b13('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x12f07a,_0x3b13('0x11'),JSON['stringify'](_0x13a28e));if(_0x13a28e['error']){if(_0x13a28e[_0x3b13('0x12')]['code']===0x1f4){logger[_0x3b13('0x12')]('Team,\x20%s,\x20%s',_0x12f07a,_0x13a28e['error']['message']);return _0x5104d7(_0x13a28e[_0x3b13('0x12')][_0x3b13('0x13')]);}logger[_0x3b13('0x12')](_0x3b13('0x14'),_0x12f07a,_0x13a28e['error'][_0x3b13('0x13')]);return _0x2f84cb(_0x13a28e[_0x3b13('0x12')][_0x3b13('0x13')]);}else{logger['info'](_0x3b13('0x14'),_0x12f07a,'request\x20sent');_0x2f84cb(_0x13a28e[_0x3b13('0x15')]['message']);}})['catch'](function(_0x49465d){logger[_0x3b13('0x12')](_0x3b13('0x14'),_0x12f07a,_0x49465d);_0x5104d7(_0x49465d);});});} \ No newline at end of file +var _0xeb4b=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0xacd405,_0x2217bb){var _0x57611c=function(_0x10db85){while(--_0x10db85){_0xacd405['push'](_0xacd405['shift']());}};_0x57611c(++_0x2217bb);}(_0xeb4b,0x1c6));var _0xbeb4=function(_0x570488,_0x10a22e){_0x570488=_0x570488-0x0;var _0x1b0243=_0xeb4b[_0x570488];return _0x1b0243;};'use strict';var _=require(_0xbeb4('0x0'));var util=require(_0xbeb4('0x1'));var moment=require(_0xbeb4('0x2'));var BPromise=require(_0xbeb4('0x3'));var rs=require(_0xbeb4('0x4'));var fs=require('fs');var Redis=require(_0xbeb4('0x5'));var db=require(_0xbeb4('0x6'))['db'];var utils=require(_0xbeb4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbeb4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbeb4('0x9')][_0xbeb4('0xa')]({'port':0x232a});config[_0xbeb4('0xb')]=_['defaults'](config['redis'],{'host':_0xbeb4('0xc'),'port':0x18eb});var socket=require(_0xbeb4('0xd'))(new Redis(config[_0xbeb4('0xb')]));require(_0xbeb4('0xe'))[_0xbeb4('0xf')](socket);function respondWithRpcPromise(_0x517711,_0x15bc3b,_0x1e6374){return new BPromise(function(_0x46861b,_0x424b83){return client[_0xbeb4('0x10')](_0x517711,_0x1e6374)['then'](function(_0x3a05a6){logger[_0xbeb4('0x11')](_0xbeb4('0x12'),_0x15bc3b,_0xbeb4('0x13'));logger[_0xbeb4('0x14')](_0xbeb4('0x15'),_0x15bc3b,_0xbeb4('0x13'),JSON[_0xbeb4('0x16')](_0x3a05a6));if(_0x3a05a6[_0xbeb4('0x17')]){if(_0x3a05a6[_0xbeb4('0x17')][_0xbeb4('0x18')]===0x1f4){logger[_0xbeb4('0x17')](_0xbeb4('0x12'),_0x15bc3b,_0x3a05a6['error'][_0xbeb4('0x19')]);return _0x424b83(_0x3a05a6[_0xbeb4('0x17')][_0xbeb4('0x19')]);}logger[_0xbeb4('0x17')](_0xbeb4('0x12'),_0x15bc3b,_0x3a05a6[_0xbeb4('0x17')][_0xbeb4('0x19')]);return _0x46861b(_0x3a05a6[_0xbeb4('0x17')][_0xbeb4('0x19')]);}else{logger[_0xbeb4('0x11')](_0xbeb4('0x12'),_0x15bc3b,_0xbeb4('0x13'));_0x46861b(_0x3a05a6[_0xbeb4('0x1a')][_0xbeb4('0x19')]);}})[_0xbeb4('0x1b')](function(_0x48a048){logger[_0xbeb4('0x17')](_0xbeb4('0x12'),_0x15bc3b,_0x48a048);_0x424b83(_0x48a048);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 557cf1c..1cb0f42 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 _0xa847=['register','team:','./team.events','save','remove','emit','removeListener'];(function(_0x161769,_0xf75b11){var _0x3239b1=function(_0x2a347e){while(--_0x2a347e){_0x161769['push'](_0x161769['shift']());}};_0x3239b1(++_0xf75b11);}(_0xa847,0x191));var _0x7a84=function(_0xdfa6fd,_0x164127){_0xdfa6fd=_0xdfa6fd-0x0;var _0x3753c9=_0xa847[_0xdfa6fd];return _0x3753c9;};'use strict';var TeamEvents=require(_0x7a84('0x0'));var events=[_0x7a84('0x1'),_0x7a84('0x2'),'update'];function createListener(_0x54405a,_0x412760){return function(_0x3b04a4){_0x412760[_0x7a84('0x3')](_0x54405a,_0x3b04a4);};}function removeListener(_0x3a301a,_0x35d89f){return function(){TeamEvents[_0x7a84('0x4')](_0x3a301a,_0x35d89f);};}exports[_0x7a84('0x5')]=function(_0x542479){for(var _0x20db1f=0x0,_0x1e2090=events['length'];_0x20db1f<_0x1e2090;_0x20db1f++){var _0x6277bf=events[_0x20db1f];var _0x5966bc=createListener(_0x7a84('0x6')+_0x6277bf,_0x542479);TeamEvents['on'](_0x6277bf,_0x5966bc);}}; \ No newline at end of file +var _0xd38f=['length','./team.events','save','emit','removeListener','register'];(function(_0x3fa26a,_0x2d1cf0){var _0x40c1d1=function(_0x112cc1){while(--_0x112cc1){_0x3fa26a['push'](_0x3fa26a['shift']());}};_0x40c1d1(++_0x2d1cf0);}(_0xd38f,0xa3));var _0xfd38=function(_0x278606,_0x3c907e){_0x278606=_0x278606-0x0;var _0x1d2e17=_0xd38f[_0x278606];return _0x1d2e17;};'use strict';var TeamEvents=require(_0xfd38('0x0'));var events=[_0xfd38('0x1'),'remove','update'];function createListener(_0x4a1676,_0x197eb8){return function(_0x365421){_0x197eb8[_0xfd38('0x2')](_0x4a1676,_0x365421);};}function removeListener(_0x27fc53,_0x19fc62){return function(){TeamEvents[_0xfd38('0x3')](_0x27fc53,_0x19fc62);};}exports[_0xfd38('0x4')]=function(_0x121417){for(var _0x56d5a9=0x0,_0x318785=events[_0xfd38('0x5')];_0x56d5a9<_0x318785;_0x56d5a9++){var _0x433783=events[_0x56d5a9];var _0xd0d6d8=createListener('team:'+_0x433783,_0x121417);TeamEvents['on'](_0x433783,_0xd0d6d8);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 4009ce0..22aa399 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 _0x4be8=['exports','INTEGER','sequelize'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x4be8,0x17f));var _0x84be=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4be8[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x84be('0x0'));module[_0x84be('0x1')]={'TeamId':{'type':Sequelize[_0x84be('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x84be('0x2')]}}; \ No newline at end of file +var _0x515d=['exports','INTEGER'];(function(_0x194788,_0x3744ac){var _0x3efbe7=function(_0xbf4559){while(--_0xbf4559){_0x194788['push'](_0x194788['shift']());}};_0x3efbe7(++_0x3744ac);}(_0x515d,0x104));var _0xd515=function(_0x54440b,_0x4fcb9a){_0x54440b=_0x54440b-0x0;var _0x5c2246=_0x515d[_0x54440b];return _0x5c2246;};'use strict';var Sequelize=require('sequelize');module[_0xd515('0x0')]={'TeamId':{'type':Sequelize[_0xd515('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xd515('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2cd2f2c..885abaa 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 _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','TeamVoicePrefix','lodash','util','api','moment'];(function(_0x3d267f,_0x194a93){var _0x5d08f0=function(_0x205f16){while(--_0x205f16){_0x3d267f['push'](_0x3d267f['shift']());}};_0x5d08f0(++_0x194a93);}(_0x5423,0xe3));var _0x3542=function(_0x305ed7,_0x18ed40){_0x305ed7=_0x305ed7-0x0;var _0x2685ba=_0x5423[_0x305ed7];return _0x2685ba;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d98=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x21e11d,_0x12d81){var _0x5aebfe=function(_0xf447bb){while(--_0xf447bb){_0x21e11d['push'](_0x21e11d['shift']());}};_0x5aebfe(++_0x12d81);}(_0x7d98,0xe7));var _0x87d9=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x7d98[_0x469a3c];return _0x968f4;};'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(_0x87d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87d9('0x5'));var rimraf=require(_0x87d9('0x6'));var config=require('../../config/environment');var attributes=require(_0x87d9('0x7'));module['exports']=function(_0x5ed6d2,_0x510ba4){return _0x5ed6d2[_0x87d9('0x8')](_0x87d9('0x9'),attributes,{'tableName':_0x87d9('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 0d19ec5..8a122e5 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x198d30,_0x135288){var _0x3c9743=function(_0x3d2831){while(--_0x3d2831){_0x198d30['push'](_0x198d30['shift']());}};_0x3c9743(++_0x135288);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xcb91[_0x2ed8f3];return _0x525a55;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2110bd,_0x1343fa){var _0x453f4b=function(_0x428b54){while(--_0x428b54){_0x2110bd['push'](_0x2110bd['shift']());}};_0x453f4b(++_0x1343fa);}(_0x70e0,0x17b));var _0x070e=function(_0x1b165f,_0x30243a){_0x1b165f=_0x1b165f-0x0;var _0x144ef5=_0x70e0[_0x1b165f];return _0x144ef5;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index f6ae2d9..3a5453a 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 _0xe187=['INTEGER','sequelize','exports'];(function(_0x408fc6,_0x236ad9){var _0x3fbe0c=function(_0x4be8d8){while(--_0x4be8d8){_0x408fc6['push'](_0x408fc6['shift']());}};_0x3fbe0c(++_0x236ad9);}(_0xe187,0x19c));var _0x7e18=function(_0xc7496f,_0x198920){_0xc7496f=_0xc7496f-0x0;var _0x16a05a=_0xe187[_0xc7496f];return _0x16a05a;};'use strict';var Sequelize=require(_0x7e18('0x0'));module[_0x7e18('0x1')]={'penalty':{'type':Sequelize[_0x7e18('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0899=['sequelize','exports','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0899,0x183));var _0x9089=function(_0x22656e,_0x1163dc){_0x22656e=_0x22656e-0x0;var _0x3e4255=_0x0899[_0x22656e];return _0x3e4255;};'use strict';var Sequelize=require(_0x9089('0x0'));module[_0x9089('0x1')]={'penalty':{'type':Sequelize[_0x9089('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 50f049d..4f3bff9 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 _0xc298=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xc298,0x143));var _0x8c29=function(_0x1b08b9,_0x3e33a8){_0x1b08b9=_0x1b08b9-0x0;var _0x5522ee=_0xc298[_0x1b08b9];return _0x5522ee;};'use strict';var _=require('lodash');var util=require(_0x8c29('0x0'));var logger=require(_0x8c29('0x1'))(_0x8c29('0x2'));var moment=require(_0x8c29('0x3'));var BPromise=require(_0x8c29('0x4'));var rp=require(_0x8c29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var attributes=require(_0x8c29('0x8'));module[_0x8c29('0x9')]=function(_0x6cac5d,_0x50a81c){return _0x6cac5d[_0x8c29('0xa')](_0x8c29('0xb'),attributes,{'tableName':_0x8c29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae53=['rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x425255,_0x47d75a){var _0x3b4f5a=function(_0x2d17e5){while(--_0x2d17e5){_0x425255['push'](_0x425255['shift']());}};_0x3b4f5a(++_0x47d75a);}(_0xae53,0x16e));var _0x3ae5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xae53[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x3ae5('0x0'));var util=require('util');var logger=require(_0x3ae5('0x1'))(_0x3ae5('0x2'));var moment=require(_0x3ae5('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ae5('0x4'));var fs=require('fs');var path=require(_0x3ae5('0x5'));var rimraf=require(_0x3ae5('0x6'));var config=require(_0x3ae5('0x7'));var attributes=require(_0x3ae5('0x8'));module['exports']=function(_0x1ca6ea,_0x51e31e){return _0x1ca6ea[_0x3ae5('0x9')](_0x3ae5('0xa'),attributes,{'tableName':_0x3ae5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 53a90ca..a9fb52b 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 _0x28c8=['error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa9d145,_0xa0c2de){var _0x5b08c2=function(_0x31cf37){while(--_0x31cf37){_0xa9d145['push'](_0xa9d145['shift']());}};_0x5b08c2(++_0xa0c2de);}(_0x28c8,0x119));var _0x828c=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x28c8[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x828c('0x0'));var BPromise=require(_0x828c('0x1'));var rs=require(_0x828c('0x2'));var fs=require('fs');var Redis=require(_0x828c('0x3'));var db=require(_0x828c('0x4'))['db'];var utils=require(_0x828c('0x5'));var logger=require(_0x828c('0x6'))(_0x828c('0x7'));var config=require(_0x828c('0x8'));var jayson=require(_0x828c('0x9'));var client=jayson[_0x828c('0xa')][_0x828c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a049f,_0xeaefa5,_0x4da02b){return new BPromise(function(_0x27dbcb,_0x3fa5a9){return client[_0x828c('0xc')](_0x1a049f,_0x4da02b)[_0x828c('0xd')](function(_0x39af04){logger['info'](_0x828c('0xe'),_0xeaefa5,_0x828c('0xf'));logger[_0x828c('0x10')](_0x828c('0x11'),_0xeaefa5,'request\x20sent',JSON[_0x828c('0x12')](_0x39af04));if(_0x39af04[_0x828c('0x13')]){if(_0x39af04[_0x828c('0x13')][_0x828c('0x14')]===0x1f4){logger[_0x828c('0x13')](_0x828c('0xe'),_0xeaefa5,_0x39af04['error'][_0x828c('0x15')]);return _0x3fa5a9(_0x39af04[_0x828c('0x13')][_0x828c('0x15')]);}logger[_0x828c('0x13')](_0x828c('0xe'),_0xeaefa5,_0x39af04['error'][_0x828c('0x15')]);return _0x27dbcb(_0x39af04[_0x828c('0x13')][_0x828c('0x15')]);}else{logger[_0x828c('0x16')](_0x828c('0xe'),_0xeaefa5,_0x828c('0xf'));_0x27dbcb(_0x39af04[_0x828c('0x17')]['message']);}})[_0x828c('0x18')](function(_0x6ce9e4){logger[_0x828c('0x13')](_0x828c('0xe'),_0xeaefa5,_0x6ce9e4);_0x3fa5a9(_0x6ce9e4);});});} \ No newline at end of file +var _0x55da=['rpc','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x10af42,_0x1ac925){var _0x5480b0=function(_0x324fef){while(--_0x324fef){_0x10af42['push'](_0x10af42['shift']());}};_0x5480b0(++_0x1ac925);}(_0x55da,0x16f));var _0xa55d=function(_0x7c3b3,_0x4144d6){_0x7c3b3=_0x7c3b3-0x0;var _0x224cc2=_0x55da[_0x7c3b3];return _0x224cc2;};'use strict';var _=require('lodash');var util=require(_0xa55d('0x0'));var moment=require(_0xa55d('0x1'));var BPromise=require(_0xa55d('0x2'));var rs=require(_0xa55d('0x3'));var fs=require('fs');var Redis=require(_0xa55d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa55d('0x5'));var logger=require(_0xa55d('0x6'))(_0xa55d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa55d('0x8'));var client=jayson[_0xa55d('0x9')][_0xa55d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eb0a1,_0x2b15fb,_0x1f516d){return new BPromise(function(_0x18c1fb,_0x1751a5){return client[_0xa55d('0xb')](_0x1eb0a1,_0x1f516d)['then'](function(_0x2de9b0){logger[_0xa55d('0xc')](_0xa55d('0xd'),_0x2b15fb,_0xa55d('0xe'));logger['debug'](_0xa55d('0xf'),_0x2b15fb,_0xa55d('0xe'),JSON[_0xa55d('0x10')](_0x2de9b0));if(_0x2de9b0[_0xa55d('0x11')]){if(_0x2de9b0[_0xa55d('0x11')][_0xa55d('0x12')]===0x1f4){logger['error'](_0xa55d('0xd'),_0x2b15fb,_0x2de9b0[_0xa55d('0x11')][_0xa55d('0x13')]);return _0x1751a5(_0x2de9b0[_0xa55d('0x11')][_0xa55d('0x13')]);}logger[_0xa55d('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2b15fb,_0x2de9b0['error'][_0xa55d('0x13')]);return _0x18c1fb(_0x2de9b0['error'][_0xa55d('0x13')]);}else{logger[_0xa55d('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2b15fb,_0xa55d('0xe'));_0x18c1fb(_0x2de9b0[_0xa55d('0x14')][_0xa55d('0x13')]);}})[_0xa55d('0x15')](function(_0x5311eb){logger[_0xa55d('0x11')](_0xa55d('0xd'),_0x2b15fb,_0x5311eb);_0x1751a5(_0x5311eb);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ed9651b..ad6fd4e 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 _0x937d=['/:id','post','create','put','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x195a7f,_0x53a57c){var _0x1905fb=function(_0x229254){while(--_0x229254){_0x195a7f['push'](_0x195a7f['shift']());}};_0x1905fb(++_0x53a57c);}(_0x937d,0x1f4));var _0xd937=function(_0x3690b0,_0x111808){_0x3690b0=_0x3690b0-0x0;var _0x38ce71=_0x937d[_0x3690b0];return _0x38ce71;};'use strict';var multer=require(_0xd937('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd937('0x1'));var router=express[_0xd937('0x2')]();var fs_extra=require(_0xd937('0x3'));var auth=require(_0xd937('0x4'));var interaction=require(_0xd937('0x5'));var config=require(_0xd937('0x6'));var controller=require('./template.controller');router[_0xd937('0x7')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0x9')]);router['get'](_0xd937('0xa'),auth[_0xd937('0x8')](),controller['show']);router[_0xd937('0xb')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0xc')]);router[_0xd937('0xd')](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xe')]);router['delete'](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xf')]);module[_0xd937('0x10')]=router; \ No newline at end of file +var _0x8fd4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x8fd4,0x178));var _0x48fd=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x8fd4[_0x725b8e];return _0x43ac45;};'use strict';var multer=require('multer');var util=require(_0x48fd('0x0'));var path=require(_0x48fd('0x1'));var timeout=require(_0x48fd('0x2'));var express=require(_0x48fd('0x3'));var router=express[_0x48fd('0x4')]();var fs_extra=require(_0x48fd('0x5'));var auth=require(_0x48fd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x48fd('0x7'));var controller=require(_0x48fd('0x8'));router['get']('/',auth[_0x48fd('0x9')](),controller[_0x48fd('0xa')]);router[_0x48fd('0xb')](_0x48fd('0xc'),auth[_0x48fd('0x9')](),controller[_0x48fd('0xd')]);router[_0x48fd('0xe')]('/',auth[_0x48fd('0x9')](),controller[_0x48fd('0xf')]);router[_0x48fd('0x10')](_0x48fd('0xc'),auth['isAuthenticated'](),controller[_0x48fd('0x11')]);router[_0x48fd('0x12')](_0x48fd('0xc'),auth[_0x48fd('0x9')](),controller[_0x48fd('0x13')]);module[_0x48fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b0b7ba7..bcc37a2 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 _0x3e59=['exports','STRING','TEXT'];(function(_0x148dbd,_0x58faf2){var _0x25a674=function(_0x4cc75d){while(--_0x4cc75d){_0x148dbd['push'](_0x148dbd['shift']());}};_0x25a674(++_0x58faf2);}(_0x3e59,0x135));var _0x93e5=function(_0x3cc81e,_0x435f44){_0x3cc81e=_0x3cc81e-0x0;var _0x5b15e3=_0x3e59[_0x3cc81e];return _0x5b15e3;};'use strict';var Sequelize=require('sequelize');module[_0x93e5('0x0')]={'name':{'type':Sequelize[_0x93e5('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x93e5('0x2')]}}; \ No newline at end of file +var _0x3a3d=['exports','STRING','TEXT','sequelize'];(function(_0x2f9b19,_0x367de7){var _0x17e5af=function(_0x5a6d05){while(--_0x5a6d05){_0x2f9b19['push'](_0x2f9b19['shift']());}};_0x17e5af(++_0x367de7);}(_0x3a3d,0x1af));var _0xd3a3=function(_0x21b0c1,_0x579532){_0x21b0c1=_0x21b0c1-0x0;var _0x13d8a3=_0x3a3d[_0x21b0c1];return _0x13d8a3;};'use strict';var Sequelize=require(_0xd3a3('0x0'));module[_0xd3a3('0x1')]={'name':{'type':Sequelize[_0xd3a3('0x2')]},'description':{'type':Sequelize[_0xd3a3('0x2')]},'html':{'type':Sequelize[_0xd3a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 03e1140..53ba6a4 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 _0x2180=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','index','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','order','sort','filters','pick','where','merge','VIRTUAL','filter','Template','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x93b675,_0x9f4d81){var _0x53d795=function(_0x2e1337){while(--_0x2e1337){_0x93b675['push'](_0x93b675['shift']());}};_0x53d795(++_0x9f4d81);}(_0x2180,0xe5));var _0x0218=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x2180[_0x246f0c];return _0x30fe50;};'use strict';var emlformat=require(_0x0218('0x0'));var rimraf=require(_0x0218('0x1'));var zipdir=require(_0x0218('0x2'));var jsonpatch=require(_0x0218('0x3'));var rp=require(_0x0218('0x4'));var moment=require(_0x0218('0x5'));var BPromise=require(_0x0218('0x6'));var Mustache=require(_0x0218('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0218('0x8'));var ejs=require(_0x0218('0x9'));var fs=require('fs');var fs_extra=require(_0x0218('0xa'));var _=require('lodash');var squel=require(_0x0218('0xb'));var crypto=require(_0x0218('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0218('0x8'));var querystring=require(_0x0218('0xd'));var Papa=require(_0x0218('0xe'));var Redis=require(_0x0218('0xf'));var authService=require(_0x0218('0x10'));var qs=require(_0x0218('0x11'));var as=require(_0x0218('0x12'));var hardwareService=require(_0x0218('0x13'));var logger=require(_0x0218('0x14'))('api');var utils=require(_0x0218('0x15'));var config=require(_0x0218('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0218('0x17'))['db'];function respondWithStatusCode(_0x2d7788,_0x4cc97d){_0x4cc97d=_0x4cc97d||0xcc;return function(_0x5f5352){if(_0x5f5352){return _0x2d7788[_0x0218('0x18')](_0x4cc97d);}return _0x2d7788[_0x0218('0x19')](_0x4cc97d)[_0x0218('0x1a')]();};}function respondWithResult(_0x25905e,_0x5aea9f){_0x5aea9f=_0x5aea9f||0xc8;return function(_0x503f7e){if(_0x503f7e){return _0x25905e[_0x0218('0x19')](_0x5aea9f)[_0x0218('0x1b')](_0x503f7e);}};}function respondWithFilteredResult(_0x2116c7,_0x27d16a){return function(_0x4d9f05){if(_0x4d9f05){var _0x3ffc80=typeof _0x27d16a['offset']===_0x0218('0x1c')&&typeof _0x27d16a[_0x0218('0x1d')]==='undefined';var _0x2df704=_0x4d9f05['count'];var _0x30b8a7=_0x3ffc80?0x0:_0x27d16a[_0x0218('0x1e')];var _0x267c90=_0x3ffc80?_0x4d9f05[_0x0218('0x1f')]:_0x27d16a['offset']+_0x27d16a[_0x0218('0x1d')];var _0x51290a;if(_0x267c90>=_0x2df704){_0x267c90=_0x2df704;_0x51290a=0xc8;}else{_0x51290a=0xce;}_0x2116c7['status'](_0x51290a);return _0x2116c7['set']('Content-Range',_0x30b8a7+'-'+_0x267c90+'/'+_0x2df704)['json'](_0x4d9f05);}return null;};}function patchUpdates(_0x37aaaf){return function(_0x298633){try{jsonpatch[_0x0218('0x20')](_0x298633,_0x37aaaf,!![]);}catch(_0x50585a){return BPromise[_0x0218('0x21')](_0x50585a);}return _0x298633['save']();};}function saveUpdates(_0x1005fe,_0x55103f){return function(_0x16cef5){if(_0x16cef5){return _0x16cef5[_0x0218('0x22')](_0x1005fe)[_0x0218('0x23')](function(_0x34c434){return _0x34c434;});}return null;};}function removeEntity(_0x543f1b,_0x394864){return function(_0x11fce3){if(_0x11fce3){return _0x11fce3[_0x0218('0x24')]()['then'](function(){var _0x2e9a70=_0x11fce3[_0x0218('0x25')]({'plain':!![]});var _0x4dfc98='Templates';return db[_0x0218('0x26')][_0x0218('0x24')]({'where':{'type':_0x4dfc98,'resourceId':_0x2e9a70['id']}})[_0x0218('0x23')](function(){return _0x11fce3;});})[_0x0218('0x23')](function(){_0x543f1b['status'](0xcc)[_0x0218('0x1a')]();});}};}function handleEntityNotFound(_0x427131,_0x5d21ec){return function(_0x1924d4){if(!_0x1924d4){_0x427131['sendStatus'](0x194);}return _0x1924d4;};}function handleError(_0x1fa8cf,_0x7cb4c){_0x7cb4c=_0x7cb4c||0x1f4;return function(_0x9ef5a){logger[_0x0218('0x27')](_0x9ef5a['stack']);if(_0x9ef5a[_0x0218('0x28')]){delete _0x9ef5a['name'];}_0x1fa8cf['status'](_0x7cb4c)[_0x0218('0x29')](_0x9ef5a);};}exports[_0x0218('0x2a')]=function(_0x428a75,_0xd7dbc6){var _0x2edecd={},_0x3d85a9={},_0x5bb2e1={'count':0x0,'rows':[]};var _0x9e16d4=_['map'](db['Template']['rawAttributes'],function(_0x232889){return{'name':_0x232889[_0x0218('0x2b')],'type':_0x232889[_0x0218('0x2c')][_0x0218('0x2d')]};});_0x3d85a9[_0x0218('0x2e')]=_[_0x0218('0x2f')](_0x9e16d4,'name');_0x3d85a9[_0x0218('0x30')]=_[_0x0218('0x31')](_0x428a75[_0x0218('0x30')]);_0x3d85a9['filters']=_['intersection'](_0x3d85a9[_0x0218('0x2e')],_0x3d85a9[_0x0218('0x30')]);_0x2edecd[_0x0218('0x32')]=_[_0x0218('0x33')](_0x3d85a9['model'],qs['fields'](_0x428a75[_0x0218('0x30')][_0x0218('0x34')]));_0x2edecd[_0x0218('0x32')]=_0x2edecd[_0x0218('0x32')][_0x0218('0x35')]?_0x2edecd[_0x0218('0x32')]:_0x3d85a9[_0x0218('0x2e')];if(!_0x428a75['query']['hasOwnProperty']('nolimit')){_0x2edecd[_0x0218('0x1d')]=qs[_0x0218('0x1d')](_0x428a75[_0x0218('0x30')][_0x0218('0x1d')]);_0x2edecd['offset']=qs[_0x0218('0x1e')](_0x428a75[_0x0218('0x30')][_0x0218('0x1e')]);}_0x2edecd[_0x0218('0x36')]=qs['sort'](_0x428a75[_0x0218('0x30')][_0x0218('0x37')]);_0x2edecd['where']=qs[_0x0218('0x38')](_[_0x0218('0x39')](_0x428a75[_0x0218('0x30')],_0x3d85a9[_0x0218('0x38')]),_0x9e16d4);if(_0x428a75['query']['filter']){_0x2edecd[_0x0218('0x3a')]=_[_0x0218('0x3b')](_0x2edecd[_0x0218('0x3a')],{'$or':_[_0x0218('0x2f')](_0x9e16d4,function(_0x2237e0){if(_0x2237e0[_0x0218('0x2c')]!==_0x0218('0x3c')){var _0x4fd0fb={};_0x4fd0fb[_0x2237e0[_0x0218('0x28')]]={'$like':'%'+_0x428a75['query'][_0x0218('0x3d')]+'%'};return _0x4fd0fb;}})});}_0x2edecd=_[_0x0218('0x3b')]({},_0x2edecd,_0x428a75['options']);var _0x1a0e92={'where':_0x2edecd[_0x0218('0x3a')]};return db[_0x0218('0x3e')][_0x0218('0x1f')](_0x1a0e92)[_0x0218('0x23')](function(_0x38a671){_0x5bb2e1[_0x0218('0x1f')]=_0x38a671;if(_0x428a75[_0x0218('0x30')][_0x0218('0x3f')]){_0x2edecd[_0x0218('0x40')]=[{'all':!![]}];}return db['Template'][_0x0218('0x41')](_0x2edecd);})[_0x0218('0x23')](function(_0x277923){_0x5bb2e1[_0x0218('0x42')]=_0x277923;return _0x5bb2e1;})['then'](respondWithFilteredResult(_0xd7dbc6,_0x2edecd))['catch'](handleError(_0xd7dbc6,null));};exports[_0x0218('0x43')]=function(_0x52a330,_0x205eb0){var _0xdf7f24={'raw':!![],'where':{'id':_0x52a330[_0x0218('0x44')]['id']}},_0x13a6dd={};_0x13a6dd[_0x0218('0x2e')]=_[_0x0218('0x31')](db['Template'][_0x0218('0x45')]);_0x13a6dd[_0x0218('0x30')]=_[_0x0218('0x31')](_0x52a330[_0x0218('0x30')]);_0x13a6dd[_0x0218('0x38')]=_[_0x0218('0x33')](_0x13a6dd[_0x0218('0x2e')],_0x13a6dd['query']);_0xdf7f24[_0x0218('0x32')]=_['intersection'](_0x13a6dd['model'],qs['fields'](_0x52a330[_0x0218('0x30')]['fields']));_0xdf7f24[_0x0218('0x32')]=_0xdf7f24[_0x0218('0x32')][_0x0218('0x35')]?_0xdf7f24[_0x0218('0x32')]:_0x13a6dd[_0x0218('0x2e')];if(_0x52a330[_0x0218('0x30')]['includeAll']){_0xdf7f24[_0x0218('0x40')]=[{'all':!![]}];}_0xdf7f24=_[_0x0218('0x3b')]({},_0xdf7f24,_0x52a330[_0x0218('0x46')]);return db[_0x0218('0x3e')][_0x0218('0x47')](_0xdf7f24)[_0x0218('0x23')](handleEntityNotFound(_0x205eb0,null))[_0x0218('0x23')](respondWithResult(_0x205eb0,null))[_0x0218('0x48')](handleError(_0x205eb0,null));};exports[_0x0218('0x49')]=function(_0x4aec29,_0x6a7e03){return db[_0x0218('0x3e')][_0x0218('0x49')](_0x4aec29['body'],{})[_0x0218('0x23')](function(_0xcb0bfd){var _0x5978f0=_0x4aec29['user']['get']({'plain':!![]});if(!_0x5978f0)throw new Error(_0x0218('0x4a'));if(_0x5978f0[_0x0218('0x4b')]===_0x0218('0x4c')){var _0x53a896=_0xcb0bfd['get']({'plain':!![]});var _0x15d1cc=_0x0218('0x4d');return db[_0x0218('0x4e')][_0x0218('0x47')]({'where':{'name':_0x15d1cc,'userProfileId':_0x5978f0[_0x0218('0x4f')]},'raw':!![]})[_0x0218('0x23')](function(_0x1a6433){if(_0x1a6433&&_0x1a6433[_0x0218('0x50')]===0x0){return db[_0x0218('0x26')][_0x0218('0x49')]({'name':_0x53a896['name'],'resourceId':_0x53a896['id'],'type':_0x1a6433['name'],'sectionId':_0x1a6433['id']},{})[_0x0218('0x23')](function(){return _0xcb0bfd;});}else{return _0xcb0bfd;}})['catch'](function(_0x2a6c05){logger[_0x0218('0x27')](_0x0218('0x51'),_0x2a6c05);throw _0x2a6c05;});}return _0xcb0bfd;})['then'](respondWithResult(_0x6a7e03,0xc9))[_0x0218('0x48')](handleError(_0x6a7e03,null));};exports[_0x0218('0x22')]=function(_0x8a82d0,_0x19ed4f){if(_0x8a82d0['body']['id']){delete _0x8a82d0['body']['id'];}return db['Template'][_0x0218('0x47')]({'where':{'id':_0x8a82d0[_0x0218('0x44')]['id']}})[_0x0218('0x23')](handleEntityNotFound(_0x19ed4f,null))['then'](saveUpdates(_0x8a82d0[_0x0218('0x52')],null))[_0x0218('0x23')](respondWithResult(_0x19ed4f,null))[_0x0218('0x48')](handleError(_0x19ed4f,null));};exports[_0x0218('0x24')]=function(_0x326c43,_0x4df8f6){return db['Template'][_0x0218('0x47')]({'where':{'id':_0x326c43[_0x0218('0x44')]['id']}})[_0x0218('0x23')](handleEntityNotFound(_0x4df8f6,null))[_0x0218('0x23')](removeEntity(_0x4df8f6,null))['catch'](handleError(_0x4df8f6,null));}; \ No newline at end of file +var _0x579b=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x579b,0xaf));var _0xb579=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x579b[_0x602ca8];return _0x26e8ab;};'use strict';var emlformat=require(_0xb579('0x0'));var rimraf=require(_0xb579('0x1'));var zipdir=require(_0xb579('0x2'));var jsonpatch=require(_0xb579('0x3'));var rp=require(_0xb579('0x4'));var moment=require(_0xb579('0x5'));var BPromise=require(_0xb579('0x6'));var Mustache=require(_0xb579('0x7'));var util=require(_0xb579('0x8'));var path=require(_0xb579('0x9'));var sox=require(_0xb579('0xa'));var csv=require('to-csv');var ejs=require(_0xb579('0xb'));var fs=require('fs');var fs_extra=require(_0xb579('0xc'));var _=require(_0xb579('0xd'));var squel=require('squel');var crypto=require(_0xb579('0xe'));var jsforce=require(_0xb579('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb579('0x10'));var Papa=require('papaparse');var Redis=require(_0xb579('0x11'));var authService=require(_0xb579('0x12'));var qs=require(_0xb579('0x13'));var as=require(_0xb579('0x14'));var hardwareService=require(_0xb579('0x15'));var logger=require(_0xb579('0x16'))(_0xb579('0x17'));var utils=require(_0xb579('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb579('0x19'))['db'];function respondWithStatusCode(_0x5c656e,_0x3167eb){_0x3167eb=_0x3167eb||0xcc;return function(_0x3c36e3){if(_0x3c36e3){return _0x5c656e[_0xb579('0x1a')](_0x3167eb);}return _0x5c656e[_0xb579('0x1b')](_0x3167eb)[_0xb579('0x1c')]();};}function respondWithResult(_0x12e50c,_0x7dceb7){_0x7dceb7=_0x7dceb7||0xc8;return function(_0x5cd293){if(_0x5cd293){return _0x12e50c[_0xb579('0x1b')](_0x7dceb7)[_0xb579('0x1d')](_0x5cd293);}};}function respondWithFilteredResult(_0x1a961f,_0x19b7e3){return function(_0x4687ec){if(_0x4687ec){var _0x4ec6a8=typeof _0x19b7e3[_0xb579('0x1e')]===_0xb579('0x1f')&&typeof _0x19b7e3['limit']==='undefined';var _0x503826=_0x4687ec[_0xb579('0x20')];var _0x47cc2e=_0x4ec6a8?0x0:_0x19b7e3['offset'];var _0xd75ee6=_0x4ec6a8?_0x4687ec[_0xb579('0x20')]:_0x19b7e3[_0xb579('0x1e')]+_0x19b7e3[_0xb579('0x21')];var _0x350dad;if(_0xd75ee6>=_0x503826){_0xd75ee6=_0x503826;_0x350dad=0xc8;}else{_0x350dad=0xce;}_0x1a961f[_0xb579('0x1b')](_0x350dad);return _0x1a961f[_0xb579('0x22')](_0xb579('0x23'),_0x47cc2e+'-'+_0xd75ee6+'/'+_0x503826)[_0xb579('0x1d')](_0x4687ec);}return null;};}function patchUpdates(_0x2824aa){return function(_0x41f8fb){try{jsonpatch[_0xb579('0x24')](_0x41f8fb,_0x2824aa,!![]);}catch(_0x571295){return BPromise[_0xb579('0x25')](_0x571295);}return _0x41f8fb[_0xb579('0x26')]();};}function saveUpdates(_0xa26388,_0x157712){return function(_0x32ce80){if(_0x32ce80){return _0x32ce80[_0xb579('0x27')](_0xa26388)[_0xb579('0x28')](function(_0x33535f){return _0x33535f;});}return null;};}function removeEntity(_0x230475,_0x3cde2c){return function(_0x5ec79f){if(_0x5ec79f){return _0x5ec79f[_0xb579('0x29')]()[_0xb579('0x28')](function(){var _0x151501=_0x5ec79f[_0xb579('0x2a')]({'plain':!![]});var _0x2992de=_0xb579('0x2b');return db[_0xb579('0x2c')][_0xb579('0x29')]({'where':{'type':_0x2992de,'resourceId':_0x151501['id']}})[_0xb579('0x28')](function(){return _0x5ec79f;});})[_0xb579('0x28')](function(){_0x230475[_0xb579('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f141,_0x5a2fb4){return function(_0x22f009){if(!_0x22f009){_0x17f141[_0xb579('0x1a')](0x194);}return _0x22f009;};}function handleError(_0x41b152,_0x16f2d0){_0x16f2d0=_0x16f2d0||0x1f4;return function(_0x113d83){logger[_0xb579('0x2d')](_0x113d83[_0xb579('0x2e')]);if(_0x113d83[_0xb579('0x2f')]){delete _0x113d83[_0xb579('0x2f')];}_0x41b152[_0xb579('0x1b')](_0x16f2d0)[_0xb579('0x30')](_0x113d83);};}exports[_0xb579('0x31')]=function(_0x3d34a2,_0x1e64cd){var _0x193dea={},_0x2c0795={},_0x9a8199={'count':0x0,'rows':[]};var _0x5e2d73=_[_0xb579('0x32')](db['Template'][_0xb579('0x33')],function(_0x19dd53){return{'name':_0x19dd53['fieldName'],'type':_0x19dd53['type'][_0xb579('0x34')]};});_0x2c0795[_0xb579('0x35')]=_[_0xb579('0x32')](_0x5e2d73,_0xb579('0x2f'));_0x2c0795[_0xb579('0x36')]=_['keys'](_0x3d34a2['query']);_0x2c0795['filters']=_[_0xb579('0x37')](_0x2c0795[_0xb579('0x35')],_0x2c0795[_0xb579('0x36')]);_0x193dea['attributes']=_[_0xb579('0x37')](_0x2c0795[_0xb579('0x35')],qs[_0xb579('0x38')](_0x3d34a2[_0xb579('0x36')][_0xb579('0x38')]));_0x193dea[_0xb579('0x39')]=_0x193dea['attributes'][_0xb579('0x3a')]?_0x193dea[_0xb579('0x39')]:_0x2c0795[_0xb579('0x35')];if(!_0x3d34a2['query'][_0xb579('0x3b')](_0xb579('0x3c'))){_0x193dea[_0xb579('0x21')]=qs[_0xb579('0x21')](_0x3d34a2['query']['limit']);_0x193dea['offset']=qs['offset'](_0x3d34a2['query']['offset']);}_0x193dea[_0xb579('0x3d')]=qs['sort'](_0x3d34a2[_0xb579('0x36')][_0xb579('0x3e')]);_0x193dea[_0xb579('0x3f')]=qs['filters'](_[_0xb579('0x40')](_0x3d34a2['query'],_0x2c0795[_0xb579('0x41')]),_0x5e2d73);if(_0x3d34a2[_0xb579('0x36')][_0xb579('0x42')]){_0x193dea[_0xb579('0x3f')]=_[_0xb579('0x43')](_0x193dea[_0xb579('0x3f')],{'$or':_['map'](_0x5e2d73,function(_0xb2eadd){if(_0xb2eadd['type']!==_0xb579('0x44')){var _0x53f887={};_0x53f887[_0xb2eadd[_0xb579('0x2f')]]={'$like':'%'+_0x3d34a2['query'][_0xb579('0x42')]+'%'};return _0x53f887;}})});}_0x193dea=_['merge']({},_0x193dea,_0x3d34a2[_0xb579('0x45')]);var _0x561599={'where':_0x193dea[_0xb579('0x3f')]};return db[_0xb579('0x46')]['count'](_0x561599)['then'](function(_0x1e3d3f){_0x9a8199[_0xb579('0x20')]=_0x1e3d3f;if(_0x3d34a2['query'][_0xb579('0x47')]){_0x193dea[_0xb579('0x48')]=[{'all':!![]}];}return db[_0xb579('0x46')][_0xb579('0x49')](_0x193dea);})[_0xb579('0x28')](function(_0x349a34){_0x9a8199[_0xb579('0x4a')]=_0x349a34;return _0x9a8199;})[_0xb579('0x28')](respondWithFilteredResult(_0x1e64cd,_0x193dea))[_0xb579('0x4b')](handleError(_0x1e64cd,null));};exports[_0xb579('0x4c')]=function(_0x24ea30,_0x3f53e3){var _0x15518b={'raw':!![],'where':{'id':_0x24ea30['params']['id']}},_0xbc71b3={};_0xbc71b3[_0xb579('0x35')]=_[_0xb579('0x4d')](db['Template'][_0xb579('0x33')]);_0xbc71b3['query']=_[_0xb579('0x4d')](_0x24ea30[_0xb579('0x36')]);_0xbc71b3[_0xb579('0x41')]=_[_0xb579('0x37')](_0xbc71b3[_0xb579('0x35')],_0xbc71b3[_0xb579('0x36')]);_0x15518b['attributes']=_['intersection'](_0xbc71b3[_0xb579('0x35')],qs[_0xb579('0x38')](_0x24ea30[_0xb579('0x36')][_0xb579('0x38')]));_0x15518b[_0xb579('0x39')]=_0x15518b[_0xb579('0x39')]['length']?_0x15518b['attributes']:_0xbc71b3['model'];if(_0x24ea30[_0xb579('0x36')][_0xb579('0x47')]){_0x15518b['include']=[{'all':!![]}];}_0x15518b=_[_0xb579('0x43')]({},_0x15518b,_0x24ea30['options']);return db[_0xb579('0x46')][_0xb579('0x4e')](_0x15518b)[_0xb579('0x28')](handleEntityNotFound(_0x3f53e3,null))[_0xb579('0x28')](respondWithResult(_0x3f53e3,null))[_0xb579('0x4b')](handleError(_0x3f53e3,null));};exports[_0xb579('0x4f')]=function(_0x45dce5,_0x55a230){return db[_0xb579('0x46')][_0xb579('0x4f')](_0x45dce5[_0xb579('0x50')],{})[_0xb579('0x28')](function(_0x3ccd10){var _0x3d6679=_0x45dce5[_0xb579('0x51')]['get']({'plain':!![]});if(!_0x3d6679)throw new Error(_0xb579('0x52'));if(_0x3d6679[_0xb579('0x53')]===_0xb579('0x51')){var _0x5bcfa2=_0x3ccd10[_0xb579('0x2a')]({'plain':!![]});var _0x833426='Templates';return db[_0xb579('0x54')]['find']({'where':{'name':_0x833426,'userProfileId':_0x3d6679[_0xb579('0x55')]},'raw':!![]})['then'](function(_0x2b9196){if(_0x2b9196&&_0x2b9196[_0xb579('0x56')]===0x0){return db[_0xb579('0x2c')]['create']({'name':_0x5bcfa2['name'],'resourceId':_0x5bcfa2['id'],'type':_0x2b9196['name'],'sectionId':_0x2b9196['id']},{})[_0xb579('0x28')](function(){return _0x3ccd10;});}else{return _0x3ccd10;}})[_0xb579('0x4b')](function(_0x492762){logger[_0xb579('0x2d')](_0xb579('0x57'),_0x492762);throw _0x492762;});}return _0x3ccd10;})[_0xb579('0x28')](respondWithResult(_0x55a230,0xc9))[_0xb579('0x4b')](handleError(_0x55a230,null));};exports[_0xb579('0x27')]=function(_0x3d45d7,_0x658d02){if(_0x3d45d7['body']['id']){delete _0x3d45d7['body']['id'];}return db[_0xb579('0x46')][_0xb579('0x4e')]({'where':{'id':_0x3d45d7[_0xb579('0x58')]['id']}})[_0xb579('0x28')](handleEntityNotFound(_0x658d02,null))['then'](saveUpdates(_0x3d45d7[_0xb579('0x50')],null))[_0xb579('0x28')](respondWithResult(_0x658d02,null))[_0xb579('0x4b')](handleError(_0x658d02,null));};exports[_0xb579('0x29')]=function(_0x45ca3f,_0x5468c3){return db[_0xb579('0x46')][_0xb579('0x4e')]({'where':{'id':_0x45ca3f['params']['id']}})[_0xb579('0x28')](handleEntityNotFound(_0x5468c3,null))[_0xb579('0x28')](removeEntity(_0x5468c3,null))['catch'](handleError(_0x5468c3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index bee4303..3e5d6af 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 _0xf195=['rimraf','../../config/environment','./template.attributes','define','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x153459,_0x3d8b17){var _0xfe0fe7=function(_0x431ddf){while(--_0x431ddf){_0x153459['push'](_0x153459['shift']());}};_0xfe0fe7(++_0x3d8b17);}(_0xf195,0xfc));var _0x5f19=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf195[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x5f19('0x0'));var util=require(_0x5f19('0x1'));var logger=require(_0x5f19('0x2'))(_0x5f19('0x3'));var moment=require(_0x5f19('0x4'));var BPromise=require(_0x5f19('0x5'));var rp=require(_0x5f19('0x6'));var fs=require('fs');var path=require(_0x5f19('0x7'));var rimraf=require(_0x5f19('0x8'));var config=require(_0x5f19('0x9'));var attributes=require(_0x5f19('0xa'));module['exports']=function(_0x411ccf,_0x598bd8){return _0x411ccf[_0x5f19('0xb')]('Template',attributes,{'tableName':_0x5f19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x938e=['rimraf','./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x458fd8,_0x2a1085){var _0x157c0c=function(_0x41d8e3){while(--_0x41d8e3){_0x458fd8['push'](_0x458fd8['shift']());}};_0x157c0c(++_0x2a1085);}(_0x938e,0x1e5));var _0xe938=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x938e[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0xe938('0x0'));var util=require(_0xe938('0x1'));var logger=require(_0xe938('0x2'))(_0xe938('0x3'));var moment=require(_0xe938('0x4'));var BPromise=require(_0xe938('0x5'));var rp=require(_0xe938('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe938('0x7'));var config=require('../../config/environment');var attributes=require(_0xe938('0x8'));module[_0xe938('0x9')]=function(_0x1d6be2,_0x36b2f7){return _0x1d6be2[_0xe938('0xa')](_0xe938('0xb'),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 05e06d1..1224575 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 _0x639a=['http','request','then','info','Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetTemplate','options','raw','where','limit','map','model','attributes','include','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2d5c91,_0x10c255){var _0x24c8f4=function(_0x307b11){while(--_0x307b11){_0x2d5c91['push'](_0x2d5c91['shift']());}};_0x24c8f4(++_0x10c255);}(_0x639a,0x73));var _0xa639=function(_0x11944d,_0x3648ff){_0x11944d=_0x11944d-0x0;var _0x576a27=_0x639a[_0x11944d];return _0x576a27;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var moment=require(_0xa639('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa639('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa639('0x3'));var logger=require(_0xa639('0x4'))(_0xa639('0x5'));var config=require(_0xa639('0x6'));var jayson=require(_0xa639('0x7'));var client=jayson[_0xa639('0x8')][_0xa639('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3362c9,_0xa99e1b,_0x258c31){return new BPromise(function(_0x17efb2,_0x381f7a){return client[_0xa639('0xa')](_0x3362c9,_0x258c31)[_0xa639('0xb')](function(_0x4a372f){logger[_0xa639('0xc')](_0xa639('0xd'),_0xa99e1b,'request\x20sent');logger[_0xa639('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0xa99e1b,_0xa639('0xf'),JSON[_0xa639('0x10')](_0x4a372f));if(_0x4a372f[_0xa639('0x11')]){if(_0x4a372f[_0xa639('0x11')][_0xa639('0x12')]===0x1f4){logger[_0xa639('0x11')](_0xa639('0xd'),_0xa99e1b,_0x4a372f['error']['message']);return _0x381f7a(_0x4a372f[_0xa639('0x11')][_0xa639('0x13')]);}logger[_0xa639('0x11')]('Template,\x20%s,\x20%s',_0xa99e1b,_0x4a372f[_0xa639('0x11')]['message']);return _0x17efb2(_0x4a372f[_0xa639('0x11')][_0xa639('0x13')]);}else{logger[_0xa639('0xc')](_0xa639('0xd'),_0xa99e1b,_0xa639('0xf'));_0x17efb2(_0x4a372f[_0xa639('0x14')][_0xa639('0x13')]);}})['catch'](function(_0xc916ba){logger[_0xa639('0x11')](_0xa639('0xd'),_0xa99e1b,_0xc916ba);_0x381f7a(_0xc916ba);});});}exports[_0xa639('0x15')]=function(_0x5d2b1e){var _0xe6947c=this;return new Promise(function(_0x264b4e,_0x1cdd59){return db['Template']['findAll']({'raw':_0x5d2b1e[_0xa639('0x16')]?_0x5d2b1e['options'][_0xa639('0x17')]===undefined?!![]:![]:!![],'where':_0x5d2b1e['options']?_0x5d2b1e['options'][_0xa639('0x18')]||null:null,'attributes':_0x5d2b1e[_0xa639('0x16')]?_0x5d2b1e['options']['attributes']||null:null,'limit':_0x5d2b1e[_0xa639('0x16')]?_0x5d2b1e[_0xa639('0x16')][_0xa639('0x19')]||null:null,'include':_0x5d2b1e['options']?_0x5d2b1e[_0xa639('0x16')]['include']?_[_0xa639('0x1a')](_0x5d2b1e['options']['include'],function(_0x4b7462){return{'model':db[_0x4b7462[_0xa639('0x1b')]],'as':_0x4b7462['as'],'attributes':_0x4b7462[_0xa639('0x1c')],'include':_0x4b7462[_0xa639('0x1d')]?_[_0xa639('0x1a')](_0x4b7462[_0xa639('0x1d')],function(_0x293b9a){return{'model':db[_0x293b9a[_0xa639('0x1b')]],'as':_0x293b9a['as'],'attributes':_0x293b9a['attributes'],'include':_0x293b9a[_0xa639('0x1d')]?_[_0xa639('0x1a')](_0x293b9a['include'],function(_0x13500e){return{'model':db[_0x13500e['model']],'as':_0x13500e['as'],'attributes':_0x13500e[_0xa639('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa639('0xb')](function(_0x378e85){logger[_0xa639('0xc')](_0xa639('0x15'),_0x5d2b1e);logger['debug'](_0xa639('0x15'),_0x5d2b1e,JSON[_0xa639('0x10')](_0x378e85));_0x264b4e(_0x378e85);})[_0xa639('0x1e')](function(_0x41e6c1){logger['error'](_0xa639('0x15'),_0x41e6c1['message'],_0x5d2b1e);_0x1cdd59(_0xe6947c[_0xa639('0x11')](0x1f4,_0x41e6c1['message']));});});}; \ No newline at end of file +var _0x4f5b=['jayson/promise','client','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','attributes','limit','model','include','map','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x263e41,_0x2d5de9){var _0x2729cb=function(_0x4d18d3){while(--_0x4d18d3){_0x263e41['push'](_0x263e41['shift']());}};_0x2729cb(++_0x2d5de9);}(_0x4f5b,0x158));var _0xb4f5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4f5b[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xb4f5('0x0'));var moment=require('moment');var BPromise=require(_0xb4f5('0x1'));var rs=require(_0xb4f5('0x2'));var fs=require('fs');var Redis=require(_0xb4f5('0x3'));var db=require(_0xb4f5('0x4'))['db'];var utils=require(_0xb4f5('0x5'));var logger=require(_0xb4f5('0x6'))(_0xb4f5('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4f5('0x8'));var client=jayson[_0xb4f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1954e2,_0x5db506,_0x2fe178){return new BPromise(function(_0x29a241,_0x120e42){return client[_0xb4f5('0xa')](_0x1954e2,_0x2fe178)[_0xb4f5('0xb')](function(_0x3a0b0a){logger[_0xb4f5('0xc')]('Template,\x20%s,\x20%s',_0x5db506,_0xb4f5('0xd'));logger[_0xb4f5('0xe')](_0xb4f5('0xf'),_0x5db506,_0xb4f5('0xd'),JSON['stringify'](_0x3a0b0a));if(_0x3a0b0a[_0xb4f5('0x10')]){if(_0x3a0b0a[_0xb4f5('0x10')][_0xb4f5('0x11')]===0x1f4){logger[_0xb4f5('0x10')](_0xb4f5('0x12'),_0x5db506,_0x3a0b0a['error'][_0xb4f5('0x13')]);return _0x120e42(_0x3a0b0a[_0xb4f5('0x10')][_0xb4f5('0x13')]);}logger['error'](_0xb4f5('0x12'),_0x5db506,_0x3a0b0a[_0xb4f5('0x10')][_0xb4f5('0x13')]);return _0x29a241(_0x3a0b0a[_0xb4f5('0x10')][_0xb4f5('0x13')]);}else{logger[_0xb4f5('0xc')]('Template,\x20%s,\x20%s',_0x5db506,'request\x20sent');_0x29a241(_0x3a0b0a[_0xb4f5('0x14')][_0xb4f5('0x13')]);}})[_0xb4f5('0x15')](function(_0x4c69ef){logger['error'](_0xb4f5('0x12'),_0x5db506,_0x4c69ef);_0x120e42(_0x4c69ef);});});}exports[_0xb4f5('0x16')]=function(_0x118ba4){var _0xc97b0=this;return new Promise(function(_0x48bdae,_0x5f196f){return db[_0xb4f5('0x17')][_0xb4f5('0x18')]({'raw':_0x118ba4[_0xb4f5('0x19')]?_0x118ba4[_0xb4f5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x118ba4[_0xb4f5('0x19')]?_0x118ba4[_0xb4f5('0x19')]['where']||null:null,'attributes':_0x118ba4['options']?_0x118ba4[_0xb4f5('0x19')][_0xb4f5('0x1a')]||null:null,'limit':_0x118ba4[_0xb4f5('0x19')]?_0x118ba4[_0xb4f5('0x19')][_0xb4f5('0x1b')]||null:null,'include':_0x118ba4['options']?_0x118ba4[_0xb4f5('0x19')]['include']?_['map'](_0x118ba4[_0xb4f5('0x19')]['include'],function(_0x5ea45c){return{'model':db[_0x5ea45c[_0xb4f5('0x1c')]],'as':_0x5ea45c['as'],'attributes':_0x5ea45c['attributes'],'include':_0x5ea45c[_0xb4f5('0x1d')]?_[_0xb4f5('0x1e')](_0x5ea45c[_0xb4f5('0x1d')],function(_0xf5f5dd){return{'model':db[_0xf5f5dd[_0xb4f5('0x1c')]],'as':_0xf5f5dd['as'],'attributes':_0xf5f5dd[_0xb4f5('0x1a')],'include':_0xf5f5dd[_0xb4f5('0x1d')]?_[_0xb4f5('0x1e')](_0xf5f5dd[_0xb4f5('0x1d')],function(_0x116eeb){return{'model':db[_0x116eeb['model']],'as':_0x116eeb['as'],'attributes':_0x116eeb[_0xb4f5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x277727){logger[_0xb4f5('0xc')](_0xb4f5('0x16'),_0x118ba4);logger[_0xb4f5('0xe')](_0xb4f5('0x16'),_0x118ba4,JSON[_0xb4f5('0x1f')](_0x277727));_0x48bdae(_0x277727);})['catch'](function(_0x1fb0b8){logger[_0xb4f5('0x10')](_0xb4f5('0x16'),_0x1fb0b8[_0xb4f5('0x13')],_0x118ba4);_0x5f196f(_0xc97b0[_0xb4f5('0x10')](0x1f4,_0x1fb0b8[_0xb4f5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e35b58b..5c4b013 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 _0x20d3=['getActions','post','create','addAllCondition','addAction','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x4de5b6,_0x5cd845){var _0xc24eb1=function(_0x5bfa42){while(--_0x5bfa42){_0x4de5b6['push'](_0x4de5b6['shift']());}};_0xc24eb1(++_0x5cd845);}(_0x20d3,0xb9));var _0x320d=function(_0x548f0c,_0x17824d){_0x548f0c=_0x548f0c-0x0;var _0x64baa4=_0x20d3[_0x548f0c];return _0x64baa4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x320d('0x0'));var express=require(_0x320d('0x1'));var router=express[_0x320d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x320d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x320d('0x4'));router[_0x320d('0x5')]('/',auth[_0x320d('0x6')](),controller[_0x320d('0x7')]);router['get'](_0x320d('0x8'),auth[_0x320d('0x6')](),controller[_0x320d('0x9')]);router[_0x320d('0x5')](_0x320d('0xa'),auth[_0x320d('0x6')](),controller[_0x320d('0xb')]);router['get'](_0x320d('0xc'),auth[_0x320d('0x6')](),controller[_0x320d('0xd')]);router['get'](_0x320d('0xe'),auth[_0x320d('0x6')](),controller[_0x320d('0xf')]);router[_0x320d('0x10')]('/',auth[_0x320d('0x6')](),controller[_0x320d('0x11')]);router[_0x320d('0x10')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x320d('0x12')]);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x320d('0x10')](_0x320d('0xe'),auth[_0x320d('0x6')](),controller[_0x320d('0x13')]);router[_0x320d('0x14')](_0x320d('0x8'),auth[_0x320d('0x6')](),controller[_0x320d('0x15')]);router[_0x320d('0x16')](_0x320d('0x8'),auth['isAuthenticated'](),controller[_0x320d('0x17')]);module[_0x320d('0x18')]=router; \ No newline at end of file +var _0xd448=['../../config/environment','./trigger.controller','isAuthenticated','/:id','show','get','getAllConditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54c828,_0x2d13c1){var _0x4aadf7=function(_0xc9d787){while(--_0xc9d787){_0x54c828['push'](_0x54c828['shift']());}};_0x4aadf7(++_0x2d13c1);}(_0xd448,0x172));var _0x8d44=function(_0x17cd47,_0x4af8d0){_0x17cd47=_0x17cd47-0x0;var _0x171b91=_0xd448[_0x17cd47];return _0x171b91;};'use strict';var multer=require('multer');var util=require(_0x8d44('0x0'));var path=require(_0x8d44('0x1'));var timeout=require(_0x8d44('0x2'));var express=require(_0x8d44('0x3'));var router=express[_0x8d44('0x4')]();var fs_extra=require(_0x8d44('0x5'));var auth=require(_0x8d44('0x6'));var interaction=require(_0x8d44('0x7'));var config=require(_0x8d44('0x8'));var controller=require(_0x8d44('0x9'));router['get']('/',auth[_0x8d44('0xa')](),controller['index']);router['get'](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0xc')]);router[_0x8d44('0xd')]('/:id/all_conditions',auth[_0x8d44('0xa')](),controller[_0x8d44('0xe')]);router['get']('/:id/any_conditions',auth[_0x8d44('0xa')](),controller[_0x8d44('0xf')]);router[_0x8d44('0xd')]('/:id/actions',auth[_0x8d44('0xa')](),controller[_0x8d44('0x10')]);router[_0x8d44('0x11')]('/',auth[_0x8d44('0xa')](),controller['create']);router[_0x8d44('0x11')](_0x8d44('0x12'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x13')]);router[_0x8d44('0x11')]('/:id/any_conditions',auth[_0x8d44('0xa')](),controller[_0x8d44('0x14')]);router[_0x8d44('0x11')](_0x8d44('0x15'),auth[_0x8d44('0xa')](),controller['addAction']);router[_0x8d44('0x16')](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x17')]);router[_0x8d44('0x18')](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x19')]);module[_0x8d44('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 481f9b1..3712e34 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 _0x3e58=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x3e58,0x16a));var _0x83e5=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x3e58[_0x4c2f17];return _0x20919e;};'use strict';var Sequelize=require(_0x83e5('0x0'));module[_0x83e5('0x1')]={'name':{'type':Sequelize[_0x83e5('0x2')]},'channel':{'type':Sequelize[_0x83e5('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x83e5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd2e6=['BOOLEAN','exports','STRING'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd2e6,0x70));var _0x6d2e=function(_0x1fe082,_0xc5fc6d){_0x1fe082=_0x1fe082-0x0;var _0x11aabf=_0xd2e6[_0x1fe082];return _0x11aabf;};'use strict';var Sequelize=require('sequelize');module[_0x6d2e('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d2e('0x1')]},'status':{'type':Sequelize[_0x6d2e('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index dd7ace2..6cc7ac5 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 _0x39a3=['reject','save','update','then','destroy','get','Triggers','error','name','send','index','map','Trigger','fieldName','key','query','filters','intersection','fields','length','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','addAllCondition','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x1e2524,_0x2eab41){var _0x5b0f62=function(_0x48b007){while(--_0x48b007){_0x1e2524['push'](_0x1e2524['shift']());}};_0x5b0f62(++_0x2eab41);}(_0x39a3,0x1ac));var _0x339a=function(_0x551b1c,_0x3584f9){_0x551b1c=_0x551b1c-0x0;var _0x131273=_0x39a3[_0x551b1c];return _0x131273;};'use strict';var emlformat=require(_0x339a('0x0'));var rimraf=require(_0x339a('0x1'));var zipdir=require(_0x339a('0x2'));var jsonpatch=require(_0x339a('0x3'));var rp=require('request-promise');var moment=require(_0x339a('0x4'));var BPromise=require(_0x339a('0x5'));var Mustache=require('mustache');var util=require(_0x339a('0x6'));var path=require('path');var sox=require(_0x339a('0x7'));var csv=require(_0x339a('0x8'));var ejs=require(_0x339a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x339a('0xa'));var squel=require('squel');var crypto=require(_0x339a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x339a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x339a('0xd'));var Papa=require('papaparse');var Redis=require(_0x339a('0xe'));var authService=require(_0x339a('0xf'));var qs=require(_0x339a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x339a('0x11'));var logger=require(_0x339a('0x12'))(_0x339a('0x13'));var utils=require(_0x339a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x339a('0x15'));var db=require(_0x339a('0x16'))['db'];function respondWithStatusCode(_0x32185a,_0x5051e4){_0x5051e4=_0x5051e4||0xcc;return function(_0x25f98e){if(_0x25f98e){return _0x32185a[_0x339a('0x17')](_0x5051e4);}return _0x32185a['status'](_0x5051e4)['end']();};}function respondWithResult(_0x48d743,_0x3666b2){_0x3666b2=_0x3666b2||0xc8;return function(_0x1cb343){if(_0x1cb343){return _0x48d743[_0x339a('0x18')](_0x3666b2)[_0x339a('0x19')](_0x1cb343);}};}function respondWithFilteredResult(_0x2305a9,_0xb7c328){return function(_0x386121){if(_0x386121){var _0x51c218=typeof _0xb7c328[_0x339a('0x1a')]===_0x339a('0x1b')&&typeof _0xb7c328[_0x339a('0x1c')]===_0x339a('0x1b');var _0x25db65=_0x386121[_0x339a('0x1d')];var _0x4eaa62=_0x51c218?0x0:_0xb7c328['offset'];var _0x3c0ded=_0x51c218?_0x386121[_0x339a('0x1d')]:_0xb7c328[_0x339a('0x1a')]+_0xb7c328[_0x339a('0x1c')];var _0x367f9a;if(_0x3c0ded>=_0x25db65){_0x3c0ded=_0x25db65;_0x367f9a=0xc8;}else{_0x367f9a=0xce;}_0x2305a9['status'](_0x367f9a);return _0x2305a9[_0x339a('0x1e')](_0x339a('0x1f'),_0x4eaa62+'-'+_0x3c0ded+'/'+_0x25db65)['json'](_0x386121);}return null;};}function patchUpdates(_0xf543e9){return function(_0xca6b57){try{jsonpatch['apply'](_0xca6b57,_0xf543e9,!![]);}catch(_0x7992ba){return BPromise[_0x339a('0x20')](_0x7992ba);}return _0xca6b57[_0x339a('0x21')]();};}function saveUpdates(_0x3d2759,_0x595395){return function(_0xca2a6d){if(_0xca2a6d){return _0xca2a6d[_0x339a('0x22')](_0x3d2759)[_0x339a('0x23')](function(_0xb29a15){return _0xb29a15;});}return null;};}function removeEntity(_0x3b156c,_0x3ed3bd){return function(_0x5594b5){if(_0x5594b5){return _0x5594b5[_0x339a('0x24')]()[_0x339a('0x23')](function(){var _0x2acba8=_0x5594b5[_0x339a('0x25')]({'plain':!![]});var _0x1cc9e9=_0x339a('0x26');return db['UserProfileResource'][_0x339a('0x24')]({'where':{'type':_0x1cc9e9,'resourceId':_0x2acba8['id']}})['then'](function(){return _0x5594b5;});})[_0x339a('0x23')](function(){_0x3b156c[_0x339a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbb78,_0x141c8b){return function(_0x5d8f3e){if(!_0x5d8f3e){_0x1dbb78[_0x339a('0x17')](0x194);}return _0x5d8f3e;};}function handleError(_0x2725c6,_0x4984ca){_0x4984ca=_0x4984ca||0x1f4;return function(_0x5e00ad){logger[_0x339a('0x27')](_0x5e00ad['stack']);if(_0x5e00ad['name']){delete _0x5e00ad[_0x339a('0x28')];}_0x2725c6[_0x339a('0x18')](_0x4984ca)[_0x339a('0x29')](_0x5e00ad);};}exports[_0x339a('0x2a')]=function(_0x21ed8a,_0x29d6ff){var _0x4e845a={},_0x1d4e3c={},_0x4511aa={'count':0x0,'rows':[]};var _0x1de42f=_[_0x339a('0x2b')](db[_0x339a('0x2c')]['rawAttributes'],function(_0x58f3aa){return{'name':_0x58f3aa[_0x339a('0x2d')],'type':_0x58f3aa['type'][_0x339a('0x2e')]};});_0x1d4e3c['model']=_[_0x339a('0x2b')](_0x1de42f,_0x339a('0x28'));_0x1d4e3c[_0x339a('0x2f')]=_['keys'](_0x21ed8a[_0x339a('0x2f')]);_0x1d4e3c[_0x339a('0x30')]=_[_0x339a('0x31')](_0x1d4e3c['model'],_0x1d4e3c[_0x339a('0x2f')]);_0x4e845a['attributes']=_[_0x339a('0x31')](_0x1d4e3c['model'],qs[_0x339a('0x32')](_0x21ed8a[_0x339a('0x2f')][_0x339a('0x32')]));_0x4e845a['attributes']=_0x4e845a['attributes'][_0x339a('0x33')]?_0x4e845a[_0x339a('0x34')]:_0x1d4e3c[_0x339a('0x35')];if(!_0x21ed8a['query'][_0x339a('0x36')](_0x339a('0x37'))){_0x4e845a[_0x339a('0x1c')]=qs[_0x339a('0x1c')](_0x21ed8a['query'][_0x339a('0x1c')]);_0x4e845a[_0x339a('0x1a')]=qs['offset'](_0x21ed8a['query'][_0x339a('0x1a')]);}_0x4e845a[_0x339a('0x38')]=qs[_0x339a('0x39')](_0x21ed8a[_0x339a('0x2f')]['sort']);_0x4e845a[_0x339a('0x3a')]=qs['filters'](_[_0x339a('0x3b')](_0x21ed8a['query'],_0x1d4e3c[_0x339a('0x30')]),_0x1de42f);if(_0x21ed8a[_0x339a('0x2f')]['filter']){_0x4e845a[_0x339a('0x3a')]=_[_0x339a('0x3c')](_0x4e845a[_0x339a('0x3a')],{'$or':_[_0x339a('0x2b')](_0x1de42f,function(_0x237e0e){if(_0x237e0e['type']!==_0x339a('0x3d')){var _0x2ff296={};_0x2ff296[_0x237e0e[_0x339a('0x28')]]={'$like':'%'+_0x21ed8a[_0x339a('0x2f')][_0x339a('0x3e')]+'%'};return _0x2ff296;}})});}_0x4e845a=_['merge']({},_0x4e845a,_0x21ed8a[_0x339a('0x3f')]);var _0x482074={'where':_0x4e845a[_0x339a('0x3a')]};return db[_0x339a('0x2c')][_0x339a('0x1d')](_0x482074)[_0x339a('0x23')](function(_0x5dfdea){_0x4511aa['count']=_0x5dfdea;if(_0x21ed8a['query']['includeAll']){_0x4e845a[_0x339a('0x40')]=[{'all':!![]}];}return db[_0x339a('0x2c')][_0x339a('0x41')](_0x4e845a);})[_0x339a('0x23')](function(_0x18b57c){_0x4511aa[_0x339a('0x42')]=_0x18b57c;return _0x4511aa;})[_0x339a('0x23')](respondWithFilteredResult(_0x29d6ff,_0x4e845a))[_0x339a('0x43')](handleError(_0x29d6ff,null));};exports[_0x339a('0x44')]=function(_0x36540e,_0x9b7d76){var _0x2feeab={'raw':![],'where':{'id':_0x36540e[_0x339a('0x45')]['id']}},_0x5e05c5={};_0x5e05c5[_0x339a('0x35')]=_[_0x339a('0x46')](db[_0x339a('0x2c')]['rawAttributes']);_0x5e05c5['query']=_['keys'](_0x36540e[_0x339a('0x2f')]);_0x5e05c5['filters']=_[_0x339a('0x31')](_0x5e05c5[_0x339a('0x35')],_0x5e05c5['query']);_0x2feeab['attributes']=_[_0x339a('0x31')](_0x5e05c5[_0x339a('0x35')],qs[_0x339a('0x32')](_0x36540e[_0x339a('0x2f')][_0x339a('0x32')]));_0x2feeab[_0x339a('0x34')]=_0x2feeab[_0x339a('0x34')][_0x339a('0x33')]?_0x2feeab[_0x339a('0x34')]:_0x5e05c5[_0x339a('0x35')];if(_0x36540e['query'][_0x339a('0x47')]){_0x2feeab['include']=[{'all':!![]}];}_0x2feeab=_['merge']({},_0x2feeab,_0x36540e[_0x339a('0x3f')]);return db[_0x339a('0x2c')]['find'](_0x2feeab)[_0x339a('0x23')](handleEntityNotFound(_0x9b7d76,null))[_0x339a('0x23')](respondWithResult(_0x9b7d76,null))[_0x339a('0x43')](handleError(_0x9b7d76,null));};exports[_0x339a('0x48')]=function(_0x3be260,_0x44556e){return db[_0x339a('0x2c')][_0x339a('0x48')](_0x3be260[_0x339a('0x49')],{})[_0x339a('0x23')](function(_0x427cf2){var _0x15dee8=_0x3be260[_0x339a('0x4a')]['get']({'plain':!![]});if(!_0x15dee8)throw new Error(_0x339a('0x4b'));if(_0x15dee8[_0x339a('0x4c')]===_0x339a('0x4a')){var _0xd00d7f=_0x427cf2[_0x339a('0x25')]({'plain':!![]});var _0x379892=_0x339a('0x26');return db[_0x339a('0x4d')][_0x339a('0x4e')]({'where':{'name':_0x379892,'userProfileId':_0x15dee8[_0x339a('0x4f')]},'raw':!![]})[_0x339a('0x23')](function(_0x464d71){if(_0x464d71&&_0x464d71[_0x339a('0x50')]===0x0){return db[_0x339a('0x51')][_0x339a('0x48')]({'name':_0xd00d7f['name'],'resourceId':_0xd00d7f['id'],'type':_0x464d71['name'],'sectionId':_0x464d71['id']},{})[_0x339a('0x23')](function(){return _0x427cf2;});}else{return _0x427cf2;}})['catch'](function(_0x2b5739){logger[_0x339a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b5739);throw _0x2b5739;});}return _0x427cf2;})[_0x339a('0x23')](respondWithResult(_0x44556e,0xc9))['catch'](handleError(_0x44556e,null));};exports['update']=function(_0x477a06,_0x26d5a5){if(_0x477a06[_0x339a('0x49')]['id']){delete _0x477a06[_0x339a('0x49')]['id'];}return db[_0x339a('0x2c')][_0x339a('0x4e')]({'where':{'id':_0x477a06[_0x339a('0x45')]['id']}})['then'](handleEntityNotFound(_0x26d5a5,null))[_0x339a('0x23')](saveUpdates(_0x477a06[_0x339a('0x49')],null))[_0x339a('0x23')](respondWithResult(_0x26d5a5,null))['catch'](handleError(_0x26d5a5,null));};exports['destroy']=function(_0x4377f2,_0xabe7b8){return db[_0x339a('0x2c')][_0x339a('0x4e')]({'where':{'id':_0x4377f2[_0x339a('0x45')]['id']}})[_0x339a('0x23')](handleEntityNotFound(_0xabe7b8,null))[_0x339a('0x23')](removeEntity(_0xabe7b8,null))[_0x339a('0x43')](handleError(_0xabe7b8,null));};exports[_0x339a('0x52')]=function(_0x48730f,_0x507306,_0x214671){if(_0x48730f[_0x339a('0x49')]['id']){delete _0x48730f[_0x339a('0x49')]['id'];}return db[_0x339a('0x2c')][_0x339a('0x4e')]({'where':{'id':_0x48730f[_0x339a('0x45')]['id']}})[_0x339a('0x23')](handleEntityNotFound(_0x507306,null))[_0x339a('0x23')](function(_0xea2f6){if(_0xea2f6){_0x48730f[_0x339a('0x49')]['TriggerAllId']=_0xea2f6['id'];return db[_0x339a('0x53')][_0x339a('0x48')](_0x48730f[_0x339a('0x49')]);}})[_0x339a('0x23')](respondWithResult(_0x507306,null))[_0x339a('0x43')](handleError(_0x507306,null));};exports['addAnyCondition']=function(_0x2786e0,_0x45f10f,_0x9abe6c){if(_0x2786e0[_0x339a('0x49')]['id']){delete _0x2786e0[_0x339a('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2786e0[_0x339a('0x45')]['id']}})[_0x339a('0x23')](handleEntityNotFound(_0x45f10f,null))[_0x339a('0x23')](function(_0x513922){if(_0x513922){_0x2786e0[_0x339a('0x49')]['TriggerAnyId']=_0x513922['id'];return db['Condition'][_0x339a('0x48')](_0x2786e0['body']);}})[_0x339a('0x23')](respondWithResult(_0x45f10f,null))[_0x339a('0x43')](handleError(_0x45f10f,null));};exports[_0x339a('0x54')]=function(_0x589e42,_0x4d8cf8,_0xa7cae1){var _0x2c79d4={};var _0x5a6cab={};var _0x101a59;var _0x22b49f;return db[_0x339a('0x2c')][_0x339a('0x55')]({'where':{'id':_0x589e42[_0x339a('0x45')]['id']}})[_0x339a('0x23')](handleEntityNotFound(_0x4d8cf8,null))[_0x339a('0x23')](function(_0x37118d){if(_0x37118d){_0x101a59=_0x37118d;_0x5a6cab[_0x339a('0x35')]=_[_0x339a('0x46')](db[_0x339a('0x53')]['rawAttributes']);_0x5a6cab['query']=_[_0x339a('0x46')](_0x589e42['query']);_0x5a6cab['filters']=_[_0x339a('0x31')](_0x5a6cab[_0x339a('0x35')],_0x5a6cab[_0x339a('0x2f')]);_0x2c79d4[_0x339a('0x34')]=_['intersection'](_0x5a6cab[_0x339a('0x35')],qs['fields'](_0x589e42['query'][_0x339a('0x32')]));_0x2c79d4['attributes']=_0x2c79d4['attributes']['length']?_0x2c79d4[_0x339a('0x34')]:_0x5a6cab[_0x339a('0x35')];_0x2c79d4[_0x339a('0x38')]=qs[_0x339a('0x39')](_0x589e42['query'][_0x339a('0x39')]);_0x2c79d4[_0x339a('0x3a')]=qs[_0x339a('0x30')](_[_0x339a('0x3b')](_0x589e42[_0x339a('0x2f')],_0x5a6cab[_0x339a('0x30')]));if(_0x589e42['query'][_0x339a('0x3e')]){_0x2c79d4[_0x339a('0x3a')]=_[_0x339a('0x3c')](_0x2c79d4[_0x339a('0x3a')],{'$or':_[_0x339a('0x2b')](_0x2c79d4[_0x339a('0x34')],function(_0x11b779){var _0x4bfc25={};_0x4bfc25[_0x11b779]={'$like':'%'+_0x589e42[_0x339a('0x2f')][_0x339a('0x3e')]+'%'};return _0x4bfc25;})});}_0x2c79d4=_[_0x339a('0x3c')]({},_0x2c79d4,_0x589e42[_0x339a('0x3f')]);return _0x101a59['getAllConditions'](_0x2c79d4);}})[_0x339a('0x23')](function(_0x152aa6){if(_0x152aa6){_0x22b49f=_0x152aa6[_0x339a('0x33')];if(!_0x589e42[_0x339a('0x2f')]['hasOwnProperty'](_0x339a('0x37'))){_0x2c79d4['limit']=qs[_0x339a('0x1c')](_0x589e42[_0x339a('0x2f')][_0x339a('0x1c')]);_0x2c79d4['offset']=qs[_0x339a('0x1a')](_0x589e42['query'][_0x339a('0x1a')]);}return _0x101a59[_0x339a('0x54')](_0x2c79d4);}})[_0x339a('0x23')](function(_0x28ad8b){if(_0x28ad8b){return _0x28ad8b?{'count':_0x22b49f,'rows':_0x28ad8b}:null;}})[_0x339a('0x23')](respondWithResult(_0x4d8cf8,null))['catch'](handleError(_0x4d8cf8,null));};exports[_0x339a('0x56')]=function(_0x4ace47,_0x4fa079,_0x51e242){var _0x256e41={};var _0x55b5a8={};var _0x29615b;var _0x3abc4d;return db['Trigger'][_0x339a('0x55')]({'where':{'id':_0x4ace47[_0x339a('0x45')]['id']}})[_0x339a('0x23')](handleEntityNotFound(_0x4fa079,null))[_0x339a('0x23')](function(_0x341d81){if(_0x341d81){_0x29615b=_0x341d81;_0x55b5a8['model']=_[_0x339a('0x46')](db[_0x339a('0x53')]['rawAttributes']);_0x55b5a8[_0x339a('0x2f')]=_[_0x339a('0x46')](_0x4ace47[_0x339a('0x2f')]);_0x55b5a8[_0x339a('0x30')]=_['intersection'](_0x55b5a8[_0x339a('0x35')],_0x55b5a8[_0x339a('0x2f')]);_0x256e41['attributes']=_[_0x339a('0x31')](_0x55b5a8[_0x339a('0x35')],qs[_0x339a('0x32')](_0x4ace47[_0x339a('0x2f')][_0x339a('0x32')]));_0x256e41[_0x339a('0x34')]=_0x256e41[_0x339a('0x34')]['length']?_0x256e41[_0x339a('0x34')]:_0x55b5a8[_0x339a('0x35')];_0x256e41[_0x339a('0x38')]=qs[_0x339a('0x39')](_0x4ace47[_0x339a('0x2f')][_0x339a('0x39')]);_0x256e41[_0x339a('0x3a')]=qs['filters'](_[_0x339a('0x3b')](_0x4ace47[_0x339a('0x2f')],_0x55b5a8[_0x339a('0x30')]));if(_0x4ace47[_0x339a('0x2f')][_0x339a('0x3e')]){_0x256e41[_0x339a('0x3a')]=_[_0x339a('0x3c')](_0x256e41[_0x339a('0x3a')],{'$or':_[_0x339a('0x2b')](_0x256e41[_0x339a('0x34')],function(_0x569482){var _0x260d36={};_0x260d36[_0x569482]={'$like':'%'+_0x4ace47[_0x339a('0x2f')][_0x339a('0x3e')]+'%'};return _0x260d36;})});}_0x256e41=_[_0x339a('0x3c')]({},_0x256e41,_0x4ace47['options']);return _0x29615b[_0x339a('0x56')](_0x256e41);}})[_0x339a('0x23')](function(_0xa5b47d){if(_0xa5b47d){_0x3abc4d=_0xa5b47d[_0x339a('0x33')];if(!_0x4ace47[_0x339a('0x2f')][_0x339a('0x36')](_0x339a('0x37'))){_0x256e41[_0x339a('0x1c')]=qs[_0x339a('0x1c')](_0x4ace47[_0x339a('0x2f')]['limit']);_0x256e41[_0x339a('0x1a')]=qs[_0x339a('0x1a')](_0x4ace47[_0x339a('0x2f')][_0x339a('0x1a')]);}return _0x29615b[_0x339a('0x56')](_0x256e41);}})[_0x339a('0x23')](function(_0x35c48f){if(_0x35c48f){return _0x35c48f?{'count':_0x3abc4d,'rows':_0x35c48f}:null;}})[_0x339a('0x23')](respondWithResult(_0x4fa079,null))[_0x339a('0x43')](handleError(_0x4fa079,null));};exports[_0x339a('0x57')]=function(_0x29d59f,_0x14c5ec,_0x293352){if(_0x29d59f[_0x339a('0x49')]['id']){delete _0x29d59f['body']['id'];}return db[_0x339a('0x2c')]['find']({'where':{'id':_0x29d59f[_0x339a('0x45')]['id']}})['then'](handleEntityNotFound(_0x14c5ec,null))[_0x339a('0x23')](function(_0x12c675){if(_0x12c675){_0x29d59f[_0x339a('0x49')][_0x339a('0x58')]=_0x12c675['id'];return db[_0x339a('0x59')][_0x339a('0x48')](_0x29d59f[_0x339a('0x49')]);}})[_0x339a('0x23')](respondWithResult(_0x14c5ec,null))[_0x339a('0x43')](handleError(_0x14c5ec,null));};exports[_0x339a('0x5a')]=function(_0x31397d,_0x979b33,_0x296182){var _0x50a5fa={};var _0x30eb72={};var _0xba3706;var _0x1e1979;return db[_0x339a('0x2c')][_0x339a('0x55')]({'where':{'id':_0x31397d['params']['id']}})[_0x339a('0x23')](handleEntityNotFound(_0x979b33,null))[_0x339a('0x23')](function(_0x53f0a2){if(_0x53f0a2){_0xba3706=_0x53f0a2;_0x30eb72[_0x339a('0x35')]=_[_0x339a('0x46')](db[_0x339a('0x59')][_0x339a('0x5b')]);_0x30eb72['query']=_['keys'](_0x31397d[_0x339a('0x2f')]);_0x30eb72[_0x339a('0x30')]=_[_0x339a('0x31')](_0x30eb72['model'],_0x30eb72[_0x339a('0x2f')]);_0x50a5fa[_0x339a('0x34')]=_['intersection'](_0x30eb72['model'],qs[_0x339a('0x32')](_0x31397d[_0x339a('0x2f')][_0x339a('0x32')]));_0x50a5fa[_0x339a('0x34')]=_0x50a5fa[_0x339a('0x34')]['length']?_0x50a5fa[_0x339a('0x34')]:_0x30eb72[_0x339a('0x35')];_0x50a5fa['order']=qs['sort'](_0x31397d[_0x339a('0x2f')]['sort']);_0x50a5fa[_0x339a('0x3a')]=qs[_0x339a('0x30')](_[_0x339a('0x3b')](_0x31397d[_0x339a('0x2f')],_0x30eb72[_0x339a('0x30')]));if(_0x31397d[_0x339a('0x2f')][_0x339a('0x3e')]){_0x50a5fa['where']=_[_0x339a('0x3c')](_0x50a5fa[_0x339a('0x3a')],{'$or':_[_0x339a('0x2b')](_0x50a5fa[_0x339a('0x34')],function(_0x46de74){var _0x4508dd={};_0x4508dd[_0x46de74]={'$like':'%'+_0x31397d[_0x339a('0x2f')][_0x339a('0x3e')]+'%'};return _0x4508dd;})});}_0x50a5fa=_[_0x339a('0x3c')]({},_0x50a5fa,_0x31397d[_0x339a('0x3f')]);return _0xba3706[_0x339a('0x5a')](_0x50a5fa);}})['then'](function(_0x16e2ab){if(_0x16e2ab){_0x1e1979=_0x16e2ab['length'];if(!_0x31397d[_0x339a('0x2f')]['hasOwnProperty'](_0x339a('0x37'))){_0x50a5fa[_0x339a('0x1c')]=qs[_0x339a('0x1c')](_0x31397d['query']['limit']);_0x50a5fa[_0x339a('0x1a')]=qs[_0x339a('0x1a')](_0x31397d[_0x339a('0x2f')][_0x339a('0x1a')]);}return _0xba3706[_0x339a('0x5a')](_0x50a5fa);}})['then'](function(_0x7af421){if(_0x7af421){return _0x7af421?{'count':_0x1e1979,'rows':_0x7af421}:null;}})['then'](respondWithResult(_0x979b33,null))['catch'](handleError(_0x979b33,null));}; \ No newline at end of file +var _0x580d=['../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','then','get','UserProfileResource','error','name','map','Trigger','fieldName','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','UserProfileSection','userProfileId','autoAssociation','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4a9d05,_0x9bcd13){var _0x38a549=function(_0x1e3e63){while(--_0x1e3e63){_0x4a9d05['push'](_0x4a9d05['shift']());}};_0x38a549(++_0x9bcd13);}(_0x580d,0x1ba));var _0xd580=function(_0x731ce3,_0x46ecda){_0x731ce3=_0x731ce3-0x0;var _0x3ee6be=_0x580d[_0x731ce3];return _0x3ee6be;};'use strict';var emlformat=require(_0xd580('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd580('0x1'));var jsonpatch=require(_0xd580('0x2'));var rp=require('request-promise');var moment=require(_0xd580('0x3'));var BPromise=require(_0xd580('0x4'));var Mustache=require(_0xd580('0x5'));var util=require(_0xd580('0x6'));var path=require(_0xd580('0x7'));var sox=require(_0xd580('0x8'));var csv=require(_0xd580('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd580('0xa'));var squel=require(_0xd580('0xb'));var crypto=require('crypto');var jsforce=require(_0xd580('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd580('0xd'));var Papa=require(_0xd580('0xe'));var Redis=require(_0xd580('0xf'));var authService=require(_0xd580('0x10'));var qs=require(_0xd580('0x11'));var as=require(_0xd580('0x12'));var hardwareService=require(_0xd580('0x13'));var logger=require(_0xd580('0x14'))(_0xd580('0x15'));var utils=require(_0xd580('0x16'));var config=require(_0xd580('0x17'));var licenseUtil=require(_0xd580('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f0b67,_0x24b94e){_0x24b94e=_0x24b94e||0xcc;return function(_0x4b92e5){if(_0x4b92e5){return _0x4f0b67['sendStatus'](_0x24b94e);}return _0x4f0b67[_0xd580('0x19')](_0x24b94e)[_0xd580('0x1a')]();};}function respondWithResult(_0x5b80ea,_0x1fb484){_0x1fb484=_0x1fb484||0xc8;return function(_0x537f6a){if(_0x537f6a){return _0x5b80ea['status'](_0x1fb484)['json'](_0x537f6a);}};}function respondWithFilteredResult(_0x76335f,_0x22eb1c){return function(_0x30f1d9){if(_0x30f1d9){var _0x4fbee3=typeof _0x22eb1c[_0xd580('0x1b')]==='undefined'&&typeof _0x22eb1c[_0xd580('0x1c')]===_0xd580('0x1d');var _0x36583d=_0x30f1d9[_0xd580('0x1e')];var _0x591736=_0x4fbee3?0x0:_0x22eb1c[_0xd580('0x1b')];var _0x4b5c7d=_0x4fbee3?_0x30f1d9[_0xd580('0x1e')]:_0x22eb1c['offset']+_0x22eb1c[_0xd580('0x1c')];var _0x13ee27;if(_0x4b5c7d>=_0x36583d){_0x4b5c7d=_0x36583d;_0x13ee27=0xc8;}else{_0x13ee27=0xce;}_0x76335f[_0xd580('0x19')](_0x13ee27);return _0x76335f[_0xd580('0x1f')](_0xd580('0x20'),_0x591736+'-'+_0x4b5c7d+'/'+_0x36583d)[_0xd580('0x21')](_0x30f1d9);}return null;};}function patchUpdates(_0xe1671c){return function(_0x2906c8){try{jsonpatch['apply'](_0x2906c8,_0xe1671c,!![]);}catch(_0x435db7){return BPromise[_0xd580('0x22')](_0x435db7);}return _0x2906c8[_0xd580('0x23')]();};}function saveUpdates(_0x42ef74,_0x4ca6ed){return function(_0x172bea){if(_0x172bea){return _0x172bea[_0xd580('0x24')](_0x42ef74)['then'](function(_0x28b553){return _0x28b553;});}return null;};}function removeEntity(_0x45c240,_0xb199ff){return function(_0x33dd56){if(_0x33dd56){return _0x33dd56[_0xd580('0x25')]()[_0xd580('0x26')](function(){var _0x5f5300=_0x33dd56[_0xd580('0x27')]({'plain':!![]});var _0x57e113='Triggers';return db[_0xd580('0x28')][_0xd580('0x25')]({'where':{'type':_0x57e113,'resourceId':_0x5f5300['id']}})[_0xd580('0x26')](function(){return _0x33dd56;});})[_0xd580('0x26')](function(){_0x45c240[_0xd580('0x19')](0xcc)[_0xd580('0x1a')]();});}};}function handleEntityNotFound(_0x6ccc2b,_0x33085c){return function(_0x3e25e7){if(!_0x3e25e7){_0x6ccc2b['sendStatus'](0x194);}return _0x3e25e7;};}function handleError(_0x5caac1,_0x2f2ae3){_0x2f2ae3=_0x2f2ae3||0x1f4;return function(_0x577d90){logger[_0xd580('0x29')](_0x577d90['stack']);if(_0x577d90[_0xd580('0x2a')]){delete _0x577d90['name'];}_0x5caac1[_0xd580('0x19')](_0x2f2ae3)['send'](_0x577d90);};}exports['index']=function(_0x5f1e86,_0x59dc20){var _0x4e7984={},_0x2d397f={},_0x2df1a={'count':0x0,'rows':[]};var _0x5ea1c6=_[_0xd580('0x2b')](db[_0xd580('0x2c')]['rawAttributes'],function(_0x17b09f){return{'name':_0x17b09f[_0xd580('0x2d')],'type':_0x17b09f[_0xd580('0x2e')]['key']};});_0x2d397f[_0xd580('0x2f')]=_[_0xd580('0x2b')](_0x5ea1c6,_0xd580('0x2a'));_0x2d397f['query']=_[_0xd580('0x30')](_0x5f1e86[_0xd580('0x31')]);_0x2d397f[_0xd580('0x32')]=_['intersection'](_0x2d397f[_0xd580('0x2f')],_0x2d397f['query']);_0x4e7984['attributes']=_[_0xd580('0x33')](_0x2d397f['model'],qs['fields'](_0x5f1e86['query']['fields']));_0x4e7984['attributes']=_0x4e7984[_0xd580('0x34')][_0xd580('0x35')]?_0x4e7984['attributes']:_0x2d397f[_0xd580('0x2f')];if(!_0x5f1e86[_0xd580('0x31')][_0xd580('0x36')](_0xd580('0x37'))){_0x4e7984[_0xd580('0x1c')]=qs[_0xd580('0x1c')](_0x5f1e86['query'][_0xd580('0x1c')]);_0x4e7984[_0xd580('0x1b')]=qs[_0xd580('0x1b')](_0x5f1e86[_0xd580('0x31')][_0xd580('0x1b')]);}_0x4e7984[_0xd580('0x38')]=qs['sort'](_0x5f1e86[_0xd580('0x31')][_0xd580('0x39')]);_0x4e7984[_0xd580('0x3a')]=qs[_0xd580('0x32')](_['pick'](_0x5f1e86[_0xd580('0x31')],_0x2d397f[_0xd580('0x32')]),_0x5ea1c6);if(_0x5f1e86['query'][_0xd580('0x3b')]){_0x4e7984['where']=_[_0xd580('0x3c')](_0x4e7984[_0xd580('0x3a')],{'$or':_['map'](_0x5ea1c6,function(_0x2a085f){if(_0x2a085f[_0xd580('0x2e')]!==_0xd580('0x3d')){var _0x16f57d={};_0x16f57d[_0x2a085f[_0xd580('0x2a')]]={'$like':'%'+_0x5f1e86[_0xd580('0x31')]['filter']+'%'};return _0x16f57d;}})});}_0x4e7984=_[_0xd580('0x3c')]({},_0x4e7984,_0x5f1e86[_0xd580('0x3e')]);var _0x5f08b8={'where':_0x4e7984[_0xd580('0x3a')]};return db[_0xd580('0x2c')]['count'](_0x5f08b8)['then'](function(_0x26b844){_0x2df1a['count']=_0x26b844;if(_0x5f1e86[_0xd580('0x31')][_0xd580('0x3f')]){_0x4e7984[_0xd580('0x40')]=[{'all':!![]}];}return db[_0xd580('0x2c')][_0xd580('0x41')](_0x4e7984);})[_0xd580('0x26')](function(_0x31ec7c){_0x2df1a['rows']=_0x31ec7c;return _0x2df1a;})[_0xd580('0x26')](respondWithFilteredResult(_0x59dc20,_0x4e7984))[_0xd580('0x42')](handleError(_0x59dc20,null));};exports[_0xd580('0x43')]=function(_0x3fbbf1,_0x4367b8){var _0x2c6fbc={'raw':![],'where':{'id':_0x3fbbf1['params']['id']}},_0x461733={};_0x461733[_0xd580('0x2f')]=_[_0xd580('0x30')](db[_0xd580('0x2c')][_0xd580('0x44')]);_0x461733['query']=_[_0xd580('0x30')](_0x3fbbf1[_0xd580('0x31')]);_0x461733[_0xd580('0x32')]=_[_0xd580('0x33')](_0x461733[_0xd580('0x2f')],_0x461733[_0xd580('0x31')]);_0x2c6fbc[_0xd580('0x34')]=_[_0xd580('0x33')](_0x461733[_0xd580('0x2f')],qs['fields'](_0x3fbbf1[_0xd580('0x31')][_0xd580('0x45')]));_0x2c6fbc['attributes']=_0x2c6fbc['attributes'][_0xd580('0x35')]?_0x2c6fbc[_0xd580('0x34')]:_0x461733[_0xd580('0x2f')];if(_0x3fbbf1[_0xd580('0x31')][_0xd580('0x3f')]){_0x2c6fbc[_0xd580('0x40')]=[{'all':!![]}];}_0x2c6fbc=_['merge']({},_0x2c6fbc,_0x3fbbf1[_0xd580('0x3e')]);return db[_0xd580('0x2c')][_0xd580('0x46')](_0x2c6fbc)['then'](handleEntityNotFound(_0x4367b8,null))[_0xd580('0x26')](respondWithResult(_0x4367b8,null))[_0xd580('0x42')](handleError(_0x4367b8,null));};exports[_0xd580('0x47')]=function(_0x305179,_0x3d82f0){return db['Trigger'][_0xd580('0x47')](_0x305179[_0xd580('0x48')],{})['then'](function(_0x353c0c){var _0x46f0dd=_0x305179['user'][_0xd580('0x27')]({'plain':!![]});if(!_0x46f0dd)throw new Error(_0xd580('0x49'));if(_0x46f0dd[_0xd580('0x4a')]===_0xd580('0x4b')){var _0x7404a7=_0x353c0c[_0xd580('0x27')]({'plain':!![]});var _0x12f78d=_0xd580('0x4c');return db[_0xd580('0x4d')][_0xd580('0x46')]({'where':{'name':_0x12f78d,'userProfileId':_0x46f0dd[_0xd580('0x4e')]},'raw':!![]})['then'](function(_0x51508d){if(_0x51508d&&_0x51508d[_0xd580('0x4f')]===0x0){return db[_0xd580('0x28')]['create']({'name':_0x7404a7[_0xd580('0x2a')],'resourceId':_0x7404a7['id'],'type':_0x51508d[_0xd580('0x2a')],'sectionId':_0x51508d['id']},{})['then'](function(){return _0x353c0c;});}else{return _0x353c0c;}})[_0xd580('0x42')](function(_0x5ae141){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ae141);throw _0x5ae141;});}return _0x353c0c;})['then'](respondWithResult(_0x3d82f0,0xc9))['catch'](handleError(_0x3d82f0,null));};exports['update']=function(_0x1b75af,_0x304b5b){if(_0x1b75af[_0xd580('0x48')]['id']){delete _0x1b75af[_0xd580('0x48')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1b75af[_0xd580('0x50')]['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x304b5b,null))[_0xd580('0x26')](saveUpdates(_0x1b75af[_0xd580('0x48')],null))[_0xd580('0x26')](respondWithResult(_0x304b5b,null))[_0xd580('0x42')](handleError(_0x304b5b,null));};exports[_0xd580('0x25')]=function(_0x46c14b,_0x3ee519){return db[_0xd580('0x2c')][_0xd580('0x46')]({'where':{'id':_0x46c14b['params']['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x3ee519,null))[_0xd580('0x26')](removeEntity(_0x3ee519,null))[_0xd580('0x42')](handleError(_0x3ee519,null));};exports['addAllCondition']=function(_0x576023,_0x3c2a86,_0x2f5158){if(_0x576023[_0xd580('0x48')]['id']){delete _0x576023[_0xd580('0x48')]['id'];}return db[_0xd580('0x2c')][_0xd580('0x46')]({'where':{'id':_0x576023[_0xd580('0x50')]['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x3c2a86,null))[_0xd580('0x26')](function(_0x33b9bb){if(_0x33b9bb){_0x576023[_0xd580('0x48')][_0xd580('0x51')]=_0x33b9bb['id'];return db[_0xd580('0x52')][_0xd580('0x47')](_0x576023['body']);}})[_0xd580('0x26')](respondWithResult(_0x3c2a86,null))[_0xd580('0x42')](handleError(_0x3c2a86,null));};exports[_0xd580('0x53')]=function(_0x42c894,_0x2397f8,_0x36fe33){if(_0x42c894[_0xd580('0x48')]['id']){delete _0x42c894[_0xd580('0x48')]['id'];}return db['Trigger']['find']({'where':{'id':_0x42c894['params']['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x2397f8,null))[_0xd580('0x26')](function(_0x1aea65){if(_0x1aea65){_0x42c894['body'][_0xd580('0x54')]=_0x1aea65['id'];return db['Condition']['create'](_0x42c894[_0xd580('0x48')]);}})['then'](respondWithResult(_0x2397f8,null))[_0xd580('0x42')](handleError(_0x2397f8,null));};exports[_0xd580('0x55')]=function(_0x152210,_0x5899e5,_0x2c6064){var _0x43fc95={};var _0x38c418={};var _0x10660b;var _0x1657cb;return db[_0xd580('0x2c')][_0xd580('0x56')]({'where':{'id':_0x152210[_0xd580('0x50')]['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x5899e5,null))[_0xd580('0x26')](function(_0x3fa8d4){if(_0x3fa8d4){_0x10660b=_0x3fa8d4;_0x38c418['model']=_['keys'](db[_0xd580('0x52')]['rawAttributes']);_0x38c418[_0xd580('0x31')]=_[_0xd580('0x30')](_0x152210[_0xd580('0x31')]);_0x38c418[_0xd580('0x32')]=_[_0xd580('0x33')](_0x38c418['model'],_0x38c418[_0xd580('0x31')]);_0x43fc95['attributes']=_[_0xd580('0x33')](_0x38c418[_0xd580('0x2f')],qs['fields'](_0x152210[_0xd580('0x31')][_0xd580('0x45')]));_0x43fc95[_0xd580('0x34')]=_0x43fc95[_0xd580('0x34')]['length']?_0x43fc95['attributes']:_0x38c418[_0xd580('0x2f')];_0x43fc95[_0xd580('0x38')]=qs['sort'](_0x152210[_0xd580('0x31')][_0xd580('0x39')]);_0x43fc95[_0xd580('0x3a')]=qs[_0xd580('0x32')](_[_0xd580('0x57')](_0x152210['query'],_0x38c418[_0xd580('0x32')]));if(_0x152210[_0xd580('0x31')][_0xd580('0x3b')]){_0x43fc95[_0xd580('0x3a')]=_[_0xd580('0x3c')](_0x43fc95[_0xd580('0x3a')],{'$or':_[_0xd580('0x2b')](_0x43fc95[_0xd580('0x34')],function(_0x406cdf){var _0x147e52={};_0x147e52[_0x406cdf]={'$like':'%'+_0x152210['query'][_0xd580('0x3b')]+'%'};return _0x147e52;})});}_0x43fc95=_[_0xd580('0x3c')]({},_0x43fc95,_0x152210[_0xd580('0x3e')]);return _0x10660b['getAllConditions'](_0x43fc95);}})[_0xd580('0x26')](function(_0x38c403){if(_0x38c403){_0x1657cb=_0x38c403[_0xd580('0x35')];if(!_0x152210[_0xd580('0x31')]['hasOwnProperty'](_0xd580('0x37'))){_0x43fc95[_0xd580('0x1c')]=qs[_0xd580('0x1c')](_0x152210[_0xd580('0x31')]['limit']);_0x43fc95[_0xd580('0x1b')]=qs['offset'](_0x152210[_0xd580('0x31')][_0xd580('0x1b')]);}return _0x10660b[_0xd580('0x55')](_0x43fc95);}})[_0xd580('0x26')](function(_0x1ec3ed){if(_0x1ec3ed){return _0x1ec3ed?{'count':_0x1657cb,'rows':_0x1ec3ed}:null;}})[_0xd580('0x26')](respondWithResult(_0x5899e5,null))[_0xd580('0x42')](handleError(_0x5899e5,null));};exports[_0xd580('0x58')]=function(_0x569872,_0x2715a6,_0x48d5ff){var _0x5925d5={};var _0x53a766={};var _0xe67dfb;var _0x435307;return db['Trigger'][_0xd580('0x56')]({'where':{'id':_0x569872[_0xd580('0x50')]['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x2715a6,null))[_0xd580('0x26')](function(_0x45090d){if(_0x45090d){_0xe67dfb=_0x45090d;_0x53a766[_0xd580('0x2f')]=_[_0xd580('0x30')](db[_0xd580('0x52')][_0xd580('0x44')]);_0x53a766[_0xd580('0x31')]=_[_0xd580('0x30')](_0x569872['query']);_0x53a766[_0xd580('0x32')]=_[_0xd580('0x33')](_0x53a766[_0xd580('0x2f')],_0x53a766[_0xd580('0x31')]);_0x5925d5[_0xd580('0x34')]=_[_0xd580('0x33')](_0x53a766[_0xd580('0x2f')],qs['fields'](_0x569872[_0xd580('0x31')][_0xd580('0x45')]));_0x5925d5['attributes']=_0x5925d5['attributes'][_0xd580('0x35')]?_0x5925d5[_0xd580('0x34')]:_0x53a766[_0xd580('0x2f')];_0x5925d5['order']=qs['sort'](_0x569872[_0xd580('0x31')][_0xd580('0x39')]);_0x5925d5[_0xd580('0x3a')]=qs[_0xd580('0x32')](_[_0xd580('0x57')](_0x569872[_0xd580('0x31')],_0x53a766[_0xd580('0x32')]));if(_0x569872[_0xd580('0x31')][_0xd580('0x3b')]){_0x5925d5[_0xd580('0x3a')]=_[_0xd580('0x3c')](_0x5925d5[_0xd580('0x3a')],{'$or':_[_0xd580('0x2b')](_0x5925d5[_0xd580('0x34')],function(_0x3eeb55){var _0x2e3861={};_0x2e3861[_0x3eeb55]={'$like':'%'+_0x569872[_0xd580('0x31')][_0xd580('0x3b')]+'%'};return _0x2e3861;})});}_0x5925d5=_['merge']({},_0x5925d5,_0x569872[_0xd580('0x3e')]);return _0xe67dfb[_0xd580('0x58')](_0x5925d5);}})[_0xd580('0x26')](function(_0x154deb){if(_0x154deb){_0x435307=_0x154deb[_0xd580('0x35')];if(!_0x569872['query'][_0xd580('0x36')]('nolimit')){_0x5925d5[_0xd580('0x1c')]=qs[_0xd580('0x1c')](_0x569872[_0xd580('0x31')][_0xd580('0x1c')]);_0x5925d5[_0xd580('0x1b')]=qs[_0xd580('0x1b')](_0x569872[_0xd580('0x31')]['offset']);}return _0xe67dfb[_0xd580('0x58')](_0x5925d5);}})[_0xd580('0x26')](function(_0x48da7c){if(_0x48da7c){return _0x48da7c?{'count':_0x435307,'rows':_0x48da7c}:null;}})[_0xd580('0x26')](respondWithResult(_0x2715a6,null))[_0xd580('0x42')](handleError(_0x2715a6,null));};exports[_0xd580('0x59')]=function(_0x2d87ef,_0x148fa6,_0x219f9b){if(_0x2d87ef[_0xd580('0x48')]['id']){delete _0x2d87ef[_0xd580('0x48')]['id'];}return db['Trigger'][_0xd580('0x46')]({'where':{'id':_0x2d87ef[_0xd580('0x50')]['id']}})[_0xd580('0x26')](handleEntityNotFound(_0x148fa6,null))['then'](function(_0x5bf7bf){if(_0x5bf7bf){_0x2d87ef['body'][_0xd580('0x5a')]=_0x5bf7bf['id'];return db[_0xd580('0x5b')][_0xd580('0x47')](_0x2d87ef[_0xd580('0x48')]);}})[_0xd580('0x26')](respondWithResult(_0x148fa6,null))[_0xd580('0x42')](handleError(_0x148fa6,null));};exports[_0xd580('0x5c')]=function(_0x486fb9,_0x3bfea3,_0x327c8c){var _0x3a8efb={};var _0x3a068e={};var _0x3a0138;var _0x569664;return db['Trigger'][_0xd580('0x56')]({'where':{'id':_0x486fb9['params']['id']}})['then'](handleEntityNotFound(_0x3bfea3,null))['then'](function(_0xd9df56){if(_0xd9df56){_0x3a0138=_0xd9df56;_0x3a068e[_0xd580('0x2f')]=_[_0xd580('0x30')](db['Action'][_0xd580('0x44')]);_0x3a068e[_0xd580('0x31')]=_[_0xd580('0x30')](_0x486fb9['query']);_0x3a068e[_0xd580('0x32')]=_['intersection'](_0x3a068e[_0xd580('0x2f')],_0x3a068e[_0xd580('0x31')]);_0x3a8efb['attributes']=_[_0xd580('0x33')](_0x3a068e['model'],qs[_0xd580('0x45')](_0x486fb9[_0xd580('0x31')][_0xd580('0x45')]));_0x3a8efb[_0xd580('0x34')]=_0x3a8efb['attributes'][_0xd580('0x35')]?_0x3a8efb[_0xd580('0x34')]:_0x3a068e['model'];_0x3a8efb['order']=qs[_0xd580('0x39')](_0x486fb9[_0xd580('0x31')][_0xd580('0x39')]);_0x3a8efb[_0xd580('0x3a')]=qs[_0xd580('0x32')](_[_0xd580('0x57')](_0x486fb9[_0xd580('0x31')],_0x3a068e['filters']));if(_0x486fb9[_0xd580('0x31')][_0xd580('0x3b')]){_0x3a8efb[_0xd580('0x3a')]=_[_0xd580('0x3c')](_0x3a8efb[_0xd580('0x3a')],{'$or':_[_0xd580('0x2b')](_0x3a8efb['attributes'],function(_0x1537ee){var _0x801a11={};_0x801a11[_0x1537ee]={'$like':'%'+_0x486fb9[_0xd580('0x31')][_0xd580('0x3b')]+'%'};return _0x801a11;})});}_0x3a8efb=_[_0xd580('0x3c')]({},_0x3a8efb,_0x486fb9['options']);return _0x3a0138['getActions'](_0x3a8efb);}})[_0xd580('0x26')](function(_0x3925b9){if(_0x3925b9){_0x569664=_0x3925b9[_0xd580('0x35')];if(!_0x486fb9[_0xd580('0x31')][_0xd580('0x36')](_0xd580('0x37'))){_0x3a8efb[_0xd580('0x1c')]=qs[_0xd580('0x1c')](_0x486fb9['query'][_0xd580('0x1c')]);_0x3a8efb[_0xd580('0x1b')]=qs[_0xd580('0x1b')](_0x486fb9[_0xd580('0x31')][_0xd580('0x1b')]);}return _0x3a0138['getActions'](_0x3a8efb);}})[_0xd580('0x26')](function(_0x3e3145){if(_0x3e3145){return _0x3e3145?{'count':_0x569664,'rows':_0x3e3145}:null;}})[_0xd580('0x26')](respondWithResult(_0x3bfea3,null))['catch'](handleError(_0x3bfea3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 070d44e..5cd49d0 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 _0xe4b8=['./trigger.attributes','exports','Trigger','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x24322e,_0x37fbfb){var _0x455029=function(_0x2d42b4){while(--_0x2d42b4){_0x24322e['push'](_0x24322e['shift']());}};_0x455029(++_0x37fbfb);}(_0xe4b8,0x179));var _0x8e4b=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe4b8[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var logger=require(_0x8e4b('0x2'))(_0x8e4b('0x3'));var moment=require(_0x8e4b('0x4'));var BPromise=require(_0x8e4b('0x5'));var rp=require(_0x8e4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e4b('0x7'));var attributes=require(_0x8e4b('0x8'));module[_0x8e4b('0x9')]=function(_0x47e630,_0x2796f8){return _0x47e630['define'](_0x8e4b('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe009=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x4168ef,_0x1d0494){var _0xc1eeeb=function(_0x590150){while(--_0x590150){_0x4168ef['push'](_0x4168ef['shift']());}};_0xc1eeeb(++_0x1d0494);}(_0xe009,0x122));var _0x9e00=function(_0x3ce7cf,_0x49705d){_0x3ce7cf=_0x3ce7cf-0x0;var _0x87335d=_0xe009[_0x3ce7cf];return _0x87335d;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var logger=require(_0x9e00('0x2'))(_0x9e00('0x3'));var moment=require('moment');var BPromise=require(_0x9e00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e00('0x5'));var rimraf=require(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var attributes=require(_0x9e00('0x8'));module[_0x9e00('0x9')]=function(_0x467e35,_0x32b4ee){return _0x467e35[_0x9e00('0xa')](_0x9e00('0xb'),attributes,{'tableName':_0x9e00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index e751a6a..36a5a91 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 _0xc608=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','GetTrigger','options','where','limit','include','map','model','attributes','debug','ShowTrigger','find','raw','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc608,0xb6));var _0x8c60=function(_0x2be8bb,_0x49cf2f){_0x2be8bb=_0x2be8bb-0x0;var _0x2479d7=_0xc608[_0x2be8bb];return _0x2479d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c60('0x0'));var BPromise=require(_0x8c60('0x1'));var rs=require(_0x8c60('0x2'));var fs=require('fs');var Redis=require(_0x8c60('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c60('0x4'));var logger=require(_0x8c60('0x5'))(_0x8c60('0x6'));var config=require(_0x8c60('0x7'));var jayson=require(_0x8c60('0x8'));var client=jayson[_0x8c60('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f1f4,_0x45b779,_0x19f5b7){return new BPromise(function(_0x45e064,_0x42abea){return client['request'](_0x20f1f4,_0x19f5b7)[_0x8c60('0xa')](function(_0x58f133){logger[_0x8c60('0xb')]('Trigger,\x20%s,\x20%s',_0x45b779,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x45b779,_0x8c60('0xc'),JSON[_0x8c60('0xd')](_0x58f133));if(_0x58f133[_0x8c60('0xe')]){if(_0x58f133[_0x8c60('0xe')][_0x8c60('0xf')]===0x1f4){logger[_0x8c60('0xe')](_0x8c60('0x10'),_0x45b779,_0x58f133[_0x8c60('0xe')][_0x8c60('0x11')]);return _0x42abea(_0x58f133[_0x8c60('0xe')][_0x8c60('0x11')]);}logger[_0x8c60('0xe')](_0x8c60('0x10'),_0x45b779,_0x58f133[_0x8c60('0xe')][_0x8c60('0x11')]);return _0x45e064(_0x58f133[_0x8c60('0xe')][_0x8c60('0x11')]);}else{logger[_0x8c60('0xb')](_0x8c60('0x10'),_0x45b779,_0x8c60('0xc'));_0x45e064(_0x58f133['result'][_0x8c60('0x11')]);}})[_0x8c60('0x12')](function(_0x482359){logger[_0x8c60('0xe')](_0x8c60('0x10'),_0x45b779,_0x482359);_0x42abea(_0x482359);});});}exports[_0x8c60('0x13')]=function(_0x512358){var _0x2ab549=this;return new Promise(function(_0x2f1241,_0x100500){return db['Trigger']['findAll']({'raw':_0x512358[_0x8c60('0x14')]?_0x512358['options']['raw']===undefined?!![]:![]:!![],'where':_0x512358['options']?_0x512358['options'][_0x8c60('0x15')]||null:null,'attributes':_0x512358[_0x8c60('0x14')]?_0x512358['options']['attributes']||null:null,'limit':_0x512358[_0x8c60('0x14')]?_0x512358[_0x8c60('0x14')][_0x8c60('0x16')]||null:null,'include':_0x512358[_0x8c60('0x14')]?_0x512358['options'][_0x8c60('0x17')]?_[_0x8c60('0x18')](_0x512358[_0x8c60('0x14')]['include'],function(_0x3690d4){return{'model':db[_0x3690d4[_0x8c60('0x19')]],'as':_0x3690d4['as'],'attributes':_0x3690d4[_0x8c60('0x1a')],'include':_0x3690d4['include']?_[_0x8c60('0x18')](_0x3690d4['include'],function(_0x17271){return{'model':db[_0x17271['model']],'as':_0x17271['as'],'attributes':_0x17271[_0x8c60('0x1a')],'include':_0x17271['include']?_[_0x8c60('0x18')](_0x17271['include'],function(_0x1dadd3){return{'model':db[_0x1dadd3[_0x8c60('0x19')]],'as':_0x1dadd3['as'],'attributes':_0x1dadd3[_0x8c60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8c60('0xa')](function(_0x30b5c8){logger[_0x8c60('0xb')](_0x8c60('0x13'),_0x512358);logger[_0x8c60('0x1b')](_0x8c60('0x13'),_0x512358,JSON['stringify'](_0x30b5c8));_0x2f1241(_0x30b5c8);})[_0x8c60('0x12')](function(_0x2c3784){logger['error'](_0x8c60('0x13'),_0x2c3784[_0x8c60('0x11')],_0x512358);_0x100500(_0x2ab549[_0x8c60('0xe')](0x1f4,_0x2c3784['message']));});});};exports[_0x8c60('0x1c')]=function(_0x3df180){var _0x2e52f6=this;return new Promise(function(_0x552ac5,_0x8a2510){return db['Trigger'][_0x8c60('0x1d')]({'raw':_0x3df180[_0x8c60('0x14')]?_0x3df180['options'][_0x8c60('0x1e')]===undefined?!![]:![]:!![],'where':_0x3df180[_0x8c60('0x14')]?_0x3df180[_0x8c60('0x14')][_0x8c60('0x15')]||null:null,'attributes':_0x3df180[_0x8c60('0x14')]?_0x3df180[_0x8c60('0x14')][_0x8c60('0x1a')]||null:null,'include':_0x3df180[_0x8c60('0x14')]?_0x3df180[_0x8c60('0x14')]['include']?_[_0x8c60('0x18')](_0x3df180['options'][_0x8c60('0x17')],function(_0x1d057e){return{'model':db[_0x1d057e[_0x8c60('0x19')]],'as':_0x1d057e['as'],'attributes':_0x1d057e['attributes'],'include':_0x1d057e[_0x8c60('0x17')]?_[_0x8c60('0x18')](_0x1d057e[_0x8c60('0x17')],function(_0x377e20){return{'model':db[_0x377e20['model']],'as':_0x377e20['as'],'attributes':_0x377e20['attributes'],'include':_0x377e20[_0x8c60('0x17')]?_['map'](_0x377e20[_0x8c60('0x17')],function(_0x48909f){return{'model':db[_0x48909f[_0x8c60('0x19')]],'as':_0x48909f['as'],'attributes':_0x48909f[_0x8c60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8c60('0xa')](function(_0x238c25){logger[_0x8c60('0xb')](_0x8c60('0x1c'),_0x3df180);logger[_0x8c60('0x1b')](_0x8c60('0x1c'),_0x3df180,JSON[_0x8c60('0xd')](_0x238c25));_0x552ac5(_0x238c25);})[_0x8c60('0x12')](function(_0x40d309){logger[_0x8c60('0xe')](_0x8c60('0x1c'),_0x40d309['message'],_0x3df180);_0x8a2510(_0x2e52f6[_0x8c60('0xe')](0x1f4,_0x40d309[_0x8c60('0x11')]));});});}; \ No newline at end of file +var _0x0954=['catch','findAll','options','attributes','limit','include','model','GetTrigger','stringify','ShowTrigger','Trigger','find','raw','where','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','Trigger,\x20%s,\x20%s','result'];(function(_0xf81782,_0x14129c){var _0x12f217=function(_0x56df1d){while(--_0x56df1d){_0xf81782['push'](_0xf81782['shift']());}};_0x12f217(++_0x14129c);}(_0x0954,0x1bf));var _0x4095=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x0954[_0x32b993];return _0x482780;};'use strict';var _=require(_0x4095('0x0'));var util=require(_0x4095('0x1'));var moment=require('moment');var BPromise=require(_0x4095('0x2'));var rs=require(_0x4095('0x3'));var fs=require('fs');var Redis=require(_0x4095('0x4'));var db=require(_0x4095('0x5'))['db'];var utils=require(_0x4095('0x6'));var logger=require(_0x4095('0x7'))(_0x4095('0x8'));var config=require(_0x4095('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4095('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a4c4b,_0x65f3b4,_0x34cdbe){return new BPromise(function(_0x5b7125,_0x1d03e0){return client[_0x4095('0xb')](_0x4a4c4b,_0x34cdbe)[_0x4095('0xc')](function(_0x1750b2){logger[_0x4095('0xd')]('Trigger,\x20%s,\x20%s',_0x65f3b4,_0x4095('0xe'));logger[_0x4095('0xf')](_0x4095('0x10'),_0x65f3b4,'request\x20sent',JSON['stringify'](_0x1750b2));if(_0x1750b2[_0x4095('0x11')]){if(_0x1750b2[_0x4095('0x11')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x65f3b4,_0x1750b2[_0x4095('0x11')]['message']);return _0x1d03e0(_0x1750b2['error'][_0x4095('0x12')]);}logger['error'](_0x4095('0x13'),_0x65f3b4,_0x1750b2[_0x4095('0x11')][_0x4095('0x12')]);return _0x5b7125(_0x1750b2['error'][_0x4095('0x12')]);}else{logger[_0x4095('0xd')](_0x4095('0x13'),_0x65f3b4,_0x4095('0xe'));_0x5b7125(_0x1750b2[_0x4095('0x14')][_0x4095('0x12')]);}})[_0x4095('0x15')](function(_0x753a9){logger[_0x4095('0x11')](_0x4095('0x13'),_0x65f3b4,_0x753a9);_0x1d03e0(_0x753a9);});});}exports['GetTrigger']=function(_0x5639d0){var _0x276ce2=this;return new Promise(function(_0x391fca,_0x3ba3ed){return db['Trigger'][_0x4095('0x16')]({'raw':_0x5639d0['options']?_0x5639d0[_0x4095('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5639d0['options']?_0x5639d0[_0x4095('0x17')]['where']||null:null,'attributes':_0x5639d0[_0x4095('0x17')]?_0x5639d0[_0x4095('0x17')][_0x4095('0x18')]||null:null,'limit':_0x5639d0[_0x4095('0x17')]?_0x5639d0[_0x4095('0x17')][_0x4095('0x19')]||null:null,'include':_0x5639d0[_0x4095('0x17')]?_0x5639d0['options'][_0x4095('0x1a')]?_['map'](_0x5639d0[_0x4095('0x17')][_0x4095('0x1a')],function(_0x21798a){return{'model':db[_0x21798a[_0x4095('0x1b')]],'as':_0x21798a['as'],'attributes':_0x21798a[_0x4095('0x18')],'include':_0x21798a[_0x4095('0x1a')]?_['map'](_0x21798a['include'],function(_0xc31a60){return{'model':db[_0xc31a60[_0x4095('0x1b')]],'as':_0xc31a60['as'],'attributes':_0xc31a60[_0x4095('0x18')],'include':_0xc31a60[_0x4095('0x1a')]?_['map'](_0xc31a60[_0x4095('0x1a')],function(_0x395a14){return{'model':db[_0x395a14[_0x4095('0x1b')]],'as':_0x395a14['as'],'attributes':_0x395a14[_0x4095('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x126b44){logger['info'](_0x4095('0x1c'),_0x5639d0);logger[_0x4095('0xf')](_0x4095('0x1c'),_0x5639d0,JSON[_0x4095('0x1d')](_0x126b44));_0x391fca(_0x126b44);})[_0x4095('0x15')](function(_0xf14148){logger[_0x4095('0x11')](_0x4095('0x1c'),_0xf14148[_0x4095('0x12')],_0x5639d0);_0x3ba3ed(_0x276ce2['error'](0x1f4,_0xf14148[_0x4095('0x12')]));});});};exports[_0x4095('0x1e')]=function(_0x261b5a){var _0x1e7ffa=this;return new Promise(function(_0x41190a,_0xfb6626){return db[_0x4095('0x1f')][_0x4095('0x20')]({'raw':_0x261b5a[_0x4095('0x17')]?_0x261b5a[_0x4095('0x17')][_0x4095('0x21')]===undefined?!![]:![]:!![],'where':_0x261b5a[_0x4095('0x17')]?_0x261b5a[_0x4095('0x17')][_0x4095('0x22')]||null:null,'attributes':_0x261b5a[_0x4095('0x17')]?_0x261b5a['options'][_0x4095('0x18')]||null:null,'include':_0x261b5a[_0x4095('0x17')]?_0x261b5a[_0x4095('0x17')][_0x4095('0x1a')]?_[_0x4095('0x23')](_0x261b5a[_0x4095('0x17')][_0x4095('0x1a')],function(_0x5ee2e1){return{'model':db[_0x5ee2e1[_0x4095('0x1b')]],'as':_0x5ee2e1['as'],'attributes':_0x5ee2e1['attributes'],'include':_0x5ee2e1[_0x4095('0x1a')]?_['map'](_0x5ee2e1[_0x4095('0x1a')],function(_0x36248c){return{'model':db[_0x36248c[_0x4095('0x1b')]],'as':_0x36248c['as'],'attributes':_0x36248c[_0x4095('0x18')],'include':_0x36248c['include']?_[_0x4095('0x23')](_0x36248c[_0x4095('0x1a')],function(_0x59497c){return{'model':db[_0x59497c[_0x4095('0x1b')]],'as':_0x59497c['as'],'attributes':_0x59497c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1847c6){logger[_0x4095('0xd')](_0x4095('0x1e'),_0x261b5a);logger['debug'](_0x4095('0x1e'),_0x261b5a,JSON[_0x4095('0x1d')](_0x1847c6));_0x41190a(_0x1847c6);})[_0x4095('0x15')](function(_0x4c8064){logger[_0x4095('0x11')](_0x4095('0x1e'),_0x4c8064[_0x4095('0x12')],_0x261b5a);_0xfb6626(_0x1e7ffa[_0x4095('0x11')](0x1f4,_0x4c8064[_0x4095('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 940de66..9a3a4cf 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 _0xbb0c=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','destroy','exports','multer','util'];(function(_0x89542e,_0x4feb16){var _0xc8273b=function(_0x1174ef){while(--_0x1174ef){_0x89542e['push'](_0x89542e['shift']());}};_0xc8273b(++_0x4feb16);}(_0xbb0c,0x18a));var _0xcbb0=function(_0x44ea58,_0x5020fc){_0x44ea58=_0x44ea58-0x0;var _0x276d2a=_0xbb0c[_0x44ea58];return _0x276d2a;};'use strict';var multer=require(_0xcbb0('0x0'));var util=require(_0xcbb0('0x1'));var path=require(_0xcbb0('0x2'));var timeout=require(_0xcbb0('0x3'));var express=require(_0xcbb0('0x4'));var router=express['Router']();var fs_extra=require(_0xcbb0('0x5'));var auth=require(_0xcbb0('0x6'));var interaction=require(_0xcbb0('0x7'));var config=require(_0xcbb0('0x8'));var controller=require(_0xcbb0('0x9'));router[_0xcbb0('0xa')]('/',auth[_0xcbb0('0xb')](),controller[_0xcbb0('0xc')]);router[_0xcbb0('0xa')](_0xcbb0('0xd'),auth['isAuthenticated'](),controller[_0xcbb0('0xe')]);router[_0xcbb0('0xf')](_0xcbb0('0x10'),auth[_0xcbb0('0xb')](),controller[_0xcbb0('0x11')]);router[_0xcbb0('0xf')]('/',auth['isAuthenticated'](),controller[_0xcbb0('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcbb0('0x13')]);router['delete']('/:id',auth[_0xcbb0('0xb')](),controller[_0xcbb0('0x14')]);module[_0xcbb0('0x15')]=router; \ No newline at end of file +var _0x22ae=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','/:id/clone','clone','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x22ae,0x163));var _0xe22a=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x22ae[_0x179e11];return _0x549f04;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe22a('0x0'));var timeout=require(_0xe22a('0x1'));var express=require(_0xe22a('0x2'));var router=express[_0xe22a('0x3')]();var fs_extra=require(_0xe22a('0x4'));var auth=require(_0xe22a('0x5'));var interaction=require(_0xe22a('0x6'));var config=require(_0xe22a('0x7'));var controller=require(_0xe22a('0x8'));router[_0xe22a('0x9')]('/',auth['isAuthenticated'](),controller[_0xe22a('0xa')]);router[_0xe22a('0x9')](_0xe22a('0xb'),auth[_0xe22a('0xc')](),controller[_0xe22a('0xd')]);router['post'](_0xe22a('0xe'),auth[_0xe22a('0xc')](),controller[_0xe22a('0xf')]);router['post']('/',auth[_0xe22a('0xc')](),controller['create']);router[_0xe22a('0x10')](_0xe22a('0xb'),auth[_0xe22a('0xc')](),controller[_0xe22a('0x11')]);router[_0xe22a('0x12')](_0xe22a('0xb'),auth[_0xe22a('0xc')](),controller[_0xe22a('0x13')]);module[_0xe22a('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 4730c07..c461e30 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 _0xbe96=['inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','accept','refuse','uac','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','name','ENUM','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x2adabb,_0x4c9c62){var _0xeb44ee=function(_0x2ba25f){while(--_0x2ba25f){_0x2adabb['push'](_0x2adabb['shift']());}};_0xeb44ee(++_0x4c9c62);}(_0xbe96,0x106));var _0x6be9=function(_0x528efd,_0x24f4b0){_0x528efd=_0x528efd-0x0;var _0x433973=_0xbe96[_0x528efd];return _0x433973;};'use strict';var Sequelize=require('sequelize');module[_0x6be9('0x0')]={'name':{'type':Sequelize[_0x6be9('0x1')],'allowNull':![],'unique':_0x6be9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6be9('0x3')]('friend','user',_0x6be9('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x5'),_0x6be9('0x6'),'ALLOWED_FAILED_SCREEN',_0x6be9('0x7'),_0x6be9('0x8'),_0x6be9('0x9'),'PROHIB_FAILED_SCREEN',_0x6be9('0xa'))},'deny':{'type':Sequelize[_0x6be9('0x1')]},'permit':{'type':Sequelize[_0x6be9('0x1')]},'secret':{'type':Sequelize[_0x6be9('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x6be9('0x1')]},'transport':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':_0x6be9('0xb'),'set':function(_0x573ee5){this[_0x6be9('0xc')]('transport',_0x573ee5?_0x573ee5[_0x6be9('0xd')](','):null);},'get':function(){return this[_0x6be9('0xe')](_0x6be9('0xf'))?this[_0x6be9('0xe')](_0x6be9('0xf'))[_0x6be9('0x10')](','):null;},'comment':_0x6be9('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x6be9('0x12'),_0x6be9('0x13'),'shortinfo',_0x6be9('0x14'),_0x6be9('0x15')),'defaultValue':_0x6be9('0x12')},'directmedia':{'type':Sequelize[_0x6be9('0x3')]('yes','no',_0x6be9('0x16'),_0x6be9('0x17'),_0x6be9('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6be9('0x1')]},'directmediadeny':{'type':Sequelize[_0x6be9('0x1')]},'nat':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':_0x6be9('0x1a'),'set':function(_0x1622a8){this['setDataValue'](_0x6be9('0x1b'),_0x1622a8?_0x1622a8[_0x6be9('0xd')](','):null);},'get':function(){return this[_0x6be9('0xe')](_0x6be9('0x1b'))?this[_0x6be9('0xe')](_0x6be9('0x1b'))[_0x6be9('0x10')](','):null;},'comment':_0x6be9('0x1c')},'callgroup':{'type':Sequelize[_0x6be9('0x1')]},'namedcallgroup':{'type':Sequelize[_0x6be9('0x1')]},'pickupgroup':{'type':Sequelize[_0x6be9('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x6be9('0x1')]},'language':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':_0x6be9('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6be9('0x1e'),'set':function(_0x6c196c){this[_0x6be9('0xc')]('allow',_0x6c196c?_0x6c196c[_0x6be9('0xd')](';'):_0x6be9('0x1e'));},'get':function(){return this['getDataValue'](_0x6be9('0x1f'))?this[_0x6be9('0xe')](_0x6be9('0x1f'))[_0x6be9('0x10')](';'):null;},'comment':_0x6be9('0x20')},'autoframing':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x6be9('0x21'),'set':function(_0x16b650){this[_0x6be9('0xc')](_0x6be9('0x22'),_0x16b650?_0x16b650['join'](','):null);},'get':function(){return this[_0x6be9('0xe')](_0x6be9('0x22'))?this[_0x6be9('0xe')](_0x6be9('0x22'))[_0x6be9('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no',_0x6be9('0x23'))},'promiscredir':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'accountcode':{'type':Sequelize[_0x6be9('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x6be9('0x1')]},'callcounter':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':_0x6be9('0x19')},'busylevel':{'type':Sequelize[_0x6be9('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x6be9('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6be9('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x6be9('0x1')]},'template':{'type':Sequelize[_0x6be9('0x1')]},'videosupport':{'type':Sequelize[_0x6be9('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6be9('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x25'),_0x6be9('0x26'),'originate')},'session_expires':{'type':Sequelize[_0x6be9('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x27'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x6be9('0x1')]},'regexten':{'type':Sequelize[_0x6be9('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x6be9('0x1')]},'port':{'type':Sequelize[_0x6be9('0x24')](0x5)},'qualify':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6be9('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6be9('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6be9('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x6be9('0x3')]('yes','no',_0x6be9('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6be9('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6be9('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x6be9('0x1')]},'contactacl':{'type':Sequelize[_0x6be9('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x6be9('0x1')]},'use_q850_reason':{'type':Sequelize[_0x6be9('0x1')]},'maxforwards':{'type':Sequelize[_0x6be9('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x6be9('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6be9('0x3')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x6be9('0x19'),'no')},'icesupport':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x6be9('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no',_0x6be9('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x6be9('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x6be9('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x6be9('0x1')]},'dtlssetup':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x2a'),_0x6be9('0x2b'),_0x6be9('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6be9('0x1')]},'usereqphone':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x6be9('0x1')]},'call_limit':{'type':Sequelize[_0x6be9('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x6be9('0x1')]},'mohsuggest':{'type':Sequelize[_0x6be9('0x1')]},'parkinglot':{'type':Sequelize[_0x6be9('0x1')]},'description':{'type':Sequelize[_0x6be9('0x1')]},'host':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':_0x6be9('0x2d')},'canreinvite':{'type':Sequelize[_0x6be9('0x3')](_0x6be9('0x19'),'no',_0x6be9('0x16'),_0x6be9('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6be9('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6be9('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6be9('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1928=['ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','pai','fingerprint','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name'];(function(_0x33adcb,_0x3fa10b){var _0x2a3d1b=function(_0x425418){while(--_0x425418){_0x33adcb['push'](_0x33adcb['shift']());}};_0x2a3d1b(++_0x3fa10b);}(_0x1928,0xb9));var _0x8192=function(_0x2ad276,_0x270f28){_0x2ad276=_0x2ad276-0x0;var _0x1b410a=_0x1928[_0x2ad276];return _0x1b410a;};'use strict';var Sequelize=require(_0x8192('0x0'));module['exports']={'name':{'type':Sequelize[_0x8192('0x1')],'allowNull':![],'unique':_0x8192('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8192('0x3')]('friend','user','peer'),'allowNull':![],'defaultValue':_0x8192('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x5'),_0x8192('0x6'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x8192('0x7'),_0x8192('0x8'),_0x8192('0x9'),_0x8192('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x8192('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0xd83f25){this['setDataValue'](_0x8192('0xb'),_0xd83f25?_0xd83f25[_0x8192('0xc')](','):null);},'get':function(){return this['getDataValue'](_0x8192('0xb'))?this[_0x8192('0xd')](_0x8192('0xb'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x8192('0x3')](_0x8192('0xe'),'info',_0x8192('0xf'),_0x8192('0x10'),'auto'),'defaultValue':_0x8192('0xe')},'directmedia':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no',_0x8192('0x12'),_0x8192('0x13'),_0x8192('0x14')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8192('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x8192('0x1')]},'nat':{'type':Sequelize[_0x8192('0x1')],'defaultValue':_0x8192('0x15'),'set':function(_0x320864){this[_0x8192('0x16')](_0x8192('0x17'),_0x320864?_0x320864[_0x8192('0xc')](','):null);},'get':function(){return this[_0x8192('0xd')](_0x8192('0x17'))?this['getDataValue'](_0x8192('0x17'))[_0x8192('0x18')](','):null;},'comment':_0x8192('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x8192('0x1')]},'pickupgroup':{'type':Sequelize[_0x8192('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x8192('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8192('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8192('0x1')],'defaultValue':_0x8192('0x1a')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8192('0x1b'),'set':function(_0x52476e){this[_0x8192('0x16')](_0x8192('0x1c'),_0x52476e?_0x52476e[_0x8192('0xc')](';'):_0x8192('0x1b'));},'get':function(){return this[_0x8192('0xd')](_0x8192('0x1c'))?this[_0x8192('0xd')](_0x8192('0x1c'))[_0x8192('0x18')](';'):null;},'comment':_0x8192('0x1d')},'autoframing':{'type':Sequelize['ENUM'](_0x8192('0x11'),'no')},'insecure':{'type':Sequelize[_0x8192('0x1')],'defaultValue':_0x8192('0x1e'),'set':function(_0x53ae45){this[_0x8192('0x16')](_0x8192('0x1f'),_0x53ae45?_0x53ae45[_0x8192('0xc')](','):null);},'get':function(){return this[_0x8192('0xd')](_0x8192('0x1f'))?this[_0x8192('0xd')](_0x8192('0x1f'))[_0x8192('0x18')](','):null;},'comment':_0x8192('0x20')},'trustrpid':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8192('0x3')]('yes','no',_0x8192('0x21'))},'promiscredir':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'useclientcode':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'accountcode':{'type':Sequelize[_0x8192('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8192('0x1')],'defaultValue':_0x8192('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no'),'defaultValue':_0x8192('0x11')},'busylevel':{'type':Sequelize[_0x8192('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x8192('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x8192('0x11'),'no')},'allowtransfer':{'type':Sequelize[_0x8192('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'subscribecontext':{'type':Sequelize[_0x8192('0x1')]},'template':{'type':Sequelize[_0x8192('0x1')]},'videosupport':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no',_0x8192('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8192('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'mailbox':{'type':Sequelize[_0x8192('0x1')]},'session_timers':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x25'),'refuse',_0x8192('0x26'))},'session_expires':{'type':Sequelize[_0x8192('0x22')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x27'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x8192('0x1')]},'regexten':{'type':Sequelize[_0x8192('0x1')]},'fromdomain':{'type':Sequelize[_0x8192('0x1')]},'fromuser':{'type':Sequelize[_0x8192('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x8192('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x8192('0x1')]},'defaultuser':{'type':Sequelize[_0x8192('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8192('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8192('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x8192('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x8192('0x1')]},'timert1':{'type':Sequelize[_0x8192('0x22')](0xb)},'timerb':{'type':Sequelize[_0x8192('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8192('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x8192('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x8192('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x8192('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x8192('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x8192('0x11'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'force_avp':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'icesupport':{'type':Sequelize[_0x8192('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'dtlsverify':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no',_0x8192('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x8192('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x8192('0x1')]},'dtlscipher':{'type':Sequelize[_0x8192('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x8192('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x8192('0x2a'),_0x8192('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8192('0x1')]},'usereqphone':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8192('0x1')]},'recordofffeature':{'type':Sequelize[_0x8192('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'subscribemwi':{'type':Sequelize[_0x8192('0x3')](_0x8192('0x11'),'no')},'vmexten':{'type':Sequelize[_0x8192('0x1')]},'mohinterpret':{'type':Sequelize[_0x8192('0x1')]},'mohsuggest':{'type':Sequelize[_0x8192('0x1')]},'parkinglot':{'type':Sequelize[_0x8192('0x1')]},'description':{'type':Sequelize[_0x8192('0x1')]},'host':{'type':Sequelize[_0x8192('0x1')],'defaultValue':_0x8192('0x2c')},'canreinvite':{'type':Sequelize['ENUM'](_0x8192('0x11'),'no',_0x8192('0x12'),_0x8192('0x13'),_0x8192('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8192('0x1')]},'otherFields':{'type':Sequelize[_0x8192('0x1')]},'active':{'type':Sequelize[_0x8192('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 56e4018..fc9c0a6 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 _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x81bd,0x7c));var _0xd81b=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x81bd[_0x316b13];return _0x29ab59;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file +var _0x6f0d=['server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Trunks','UserProfileResource','end','stack','name','send','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','join'];(function(_0x7e4867,_0x215328){var _0x196e64=function(_0x166854){while(--_0x166854){_0x7e4867['push'](_0x7e4867['shift']());}};_0x196e64(++_0x215328);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1a734e,_0x47088b){_0x1a734e=_0x1a734e-0x0;var _0x1a146d=_0x6f0d[_0x1a734e];return _0x1a146d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];var jayson=require(_0xd6f0('0x19'));var client=jayson[_0xd6f0('0x1a')][_0xd6f0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x409549,_0x2bf5b8,_0x250999,_0x246dad){return new BPromise(function(_0x4ab979,_0x2b3f32){var _0x354846=_0x246dad||client;return _0x354846['request'](_0x409549,_0x250999)[_0xd6f0('0x1c')](function(_0x593abe){logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,_0xd6f0('0x1f'));logger[_0xd6f0('0x20')](_0xd6f0('0x21'),_0x2bf5b8,_0xd6f0('0x1f'),JSON[_0xd6f0('0x22')](_0x593abe));if(_0x593abe[_0xd6f0('0x23')]){if(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x24')]===0x1f4){logger[_0xd6f0('0x23')](_0xd6f0('0x1e'),_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x2b3f32(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x4ab979(_0x593abe[_0xd6f0('0x23')]['message']);}else{logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,'request\x20sent');_0x4ab979(_0x593abe[_0xd6f0('0x26')]['message']);}})[_0xd6f0('0x27')](function(_0x1c9d90){logger['error'](_0xd6f0('0x1e'),_0x2bf5b8,_0x1c9d90);_0x2b3f32(_0x1c9d90);});});}function respondWithStatusCode(_0x45e99c,_0x5ea2dd){_0x5ea2dd=_0x5ea2dd||0xcc;return function(_0x3dbdc3){if(_0x3dbdc3){return _0x45e99c[_0xd6f0('0x28')](_0x5ea2dd);}return _0x45e99c[_0xd6f0('0x29')](_0x5ea2dd)['end']();};}function respondWithResult(_0x2ca8bb,_0x3dc166){_0x3dc166=_0x3dc166||0xc8;return function(_0x5ecb16){if(_0x5ecb16){return _0x2ca8bb[_0xd6f0('0x29')](_0x3dc166)['json'](_0x5ecb16);}};}function respondWithFilteredResult(_0x2042d5,_0x3fb5c3){return function(_0x1630dc){if(_0x1630dc){var _0x3c1bff=typeof _0x3fb5c3[_0xd6f0('0x2a')]===_0xd6f0('0x2b')&&typeof _0x3fb5c3[_0xd6f0('0x2c')]===_0xd6f0('0x2b');var _0x48975d=_0x1630dc[_0xd6f0('0x2d')];var _0x1982d3=_0x3c1bff?0x0:_0x3fb5c3['offset'];var _0x38a3e9=_0x3c1bff?_0x1630dc[_0xd6f0('0x2d')]:_0x3fb5c3[_0xd6f0('0x2a')]+_0x3fb5c3[_0xd6f0('0x2c')];var _0x1a3967;if(_0x38a3e9>=_0x48975d){_0x38a3e9=_0x48975d;_0x1a3967=0xc8;}else{_0x1a3967=0xce;}_0x2042d5[_0xd6f0('0x29')](_0x1a3967);return _0x2042d5[_0xd6f0('0x2e')](_0xd6f0('0x2f'),_0x1982d3+'-'+_0x38a3e9+'/'+_0x48975d)[_0xd6f0('0x30')](_0x1630dc);}return null;};}function patchUpdates(_0x43f72f){return function(_0x1dff9b){try{jsonpatch[_0xd6f0('0x31')](_0x1dff9b,_0x43f72f,!![]);}catch(_0x348529){return BPromise[_0xd6f0('0x32')](_0x348529);}return _0x1dff9b[_0xd6f0('0x33')]();};}function saveUpdates(_0x2d7c90,_0x31c493){return function(_0x376890){if(_0x376890){return _0x376890[_0xd6f0('0x34')](_0x2d7c90)[_0xd6f0('0x1c')](function(_0x3906ca){return _0x3906ca;});}return null;};}function removeEntity(_0x26ab29,_0x4a8ebe){return function(_0x11124c){if(_0x11124c){return _0x11124c['destroy']()['then'](function(){var _0x43d588=_0x11124c[_0xd6f0('0x35')]({'plain':!![]});var _0x12a6fa=_0xd6f0('0x36');return db[_0xd6f0('0x37')]['destroy']({'where':{'type':_0x12a6fa,'resourceId':_0x43d588['id']}})[_0xd6f0('0x1c')](function(){return _0x11124c;});})['then'](function(){_0x26ab29[_0xd6f0('0x29')](0xcc)[_0xd6f0('0x38')]();});}};}function handleEntityNotFound(_0x42c01a,_0x1eecf0){return function(_0x518751){if(!_0x518751){_0x42c01a['sendStatus'](0x194);}return _0x518751;};}function handleError(_0x47b33d,_0x3b6463){_0x3b6463=_0x3b6463||0x1f4;return function(_0xe2958d){logger['error'](_0xe2958d[_0xd6f0('0x39')]);if(_0xe2958d['name']){delete _0xe2958d[_0xd6f0('0x3a')];}_0x47b33d[_0xd6f0('0x29')](_0x3b6463)[_0xd6f0('0x3b')](_0xe2958d);};}exports[_0xd6f0('0x3c')]=function(_0x451834,_0x3d1280){var _0x6b44fa={},_0x4fd4db={},_0x52203d={'count':0x0,'rows':[]};var _0x162537=_[_0xd6f0('0x3d')](db[_0xd6f0('0x3e')]['rawAttributes'],function(_0x59f905){return{'name':_0x59f905[_0xd6f0('0x3f')],'type':_0x59f905[_0xd6f0('0x40')][_0xd6f0('0x41')]};});_0x4fd4db[_0xd6f0('0x42')]=_[_0xd6f0('0x3d')](_0x162537,_0xd6f0('0x3a'));_0x4fd4db[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x451834['query']);_0x4fd4db[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],_0x4fd4db[_0xd6f0('0x43')]);_0x6b44fa['attributes']=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x6b44fa['attributes']=_0x6b44fa[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x6b44fa[_0xd6f0('0x48')]:_0x4fd4db['model'];if(!_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4a')]('nolimit')){_0x6b44fa['limit']=qs[_0xd6f0('0x2c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x2c')]);_0x6b44fa['offset']=qs[_0xd6f0('0x2a')](_0x451834[_0xd6f0('0x43')]['offset']);}_0x6b44fa[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4c')]);_0x6b44fa['where']=qs[_0xd6f0('0x45')](_[_0xd6f0('0x4d')](_0x451834[_0xd6f0('0x43')],_0x4fd4db[_0xd6f0('0x45')]),_0x162537);if(_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4e')]){_0x6b44fa[_0xd6f0('0x4f')]=_[_0xd6f0('0x50')](_0x6b44fa['where'],{'$or':_[_0xd6f0('0x3d')](_0x162537,function(_0x3d42ca){if(_0x3d42ca['type']!==_0xd6f0('0x51')){var _0x39ca69={};_0x39ca69[_0x3d42ca[_0xd6f0('0x3a')]]={'$like':'%'+_0x451834[_0xd6f0('0x43')]['filter']+'%'};return _0x39ca69;}})});}_0x6b44fa=_[_0xd6f0('0x50')]({},_0x6b44fa,_0x451834[_0xd6f0('0x52')]);var _0x494542={'where':_0x6b44fa['where']};return db[_0xd6f0('0x3e')]['count'](_0x494542)[_0xd6f0('0x1c')](function(_0x61b354){_0x52203d[_0xd6f0('0x2d')]=_0x61b354;if(_0x451834['query'][_0xd6f0('0x53')]){_0x6b44fa[_0xd6f0('0x54')]=[{'all':!![]}];}return db[_0xd6f0('0x3e')][_0xd6f0('0x55')](_0x6b44fa);})[_0xd6f0('0x1c')](function(_0x4c42ce){_0x52203d[_0xd6f0('0x56')]=_0x4c42ce;return _0x52203d;})['then'](respondWithFilteredResult(_0x3d1280,_0x6b44fa))[_0xd6f0('0x27')](handleError(_0x3d1280,null));};exports[_0xd6f0('0x57')]=function(_0x2eb338,_0x1dc320){var _0x554e37={'raw':![],'where':{'id':_0x2eb338[_0xd6f0('0x58')]['id']}},_0x5ceb6b={};_0x5ceb6b[_0xd6f0('0x42')]=_['keys'](db[_0xd6f0('0x3e')]['rawAttributes']);_0x5ceb6b[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x2eb338[_0xd6f0('0x43')]);_0x5ceb6b[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x5ceb6b['model'],_0x5ceb6b[_0xd6f0('0x43')]);_0x554e37[_0xd6f0('0x48')]=_[_0xd6f0('0x46')](_0x5ceb6b[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x554e37[_0xd6f0('0x48')]=_0x554e37['attributes'][_0xd6f0('0x49')]?_0x554e37[_0xd6f0('0x48')]:_0x5ceb6b[_0xd6f0('0x42')];if(_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x53')]){_0x554e37[_0xd6f0('0x54')]=[{'all':!![]}];}_0x554e37=_[_0xd6f0('0x50')]({},_0x554e37,_0x2eb338[_0xd6f0('0x52')]);return db[_0xd6f0('0x3e')]['find'](_0x554e37)[_0xd6f0('0x1c')](handleEntityNotFound(_0x1dc320,null))['then'](respondWithResult(_0x1dc320,null))['catch'](handleError(_0x1dc320,null));};exports[_0xd6f0('0x59')]=function(_0x55fd25,_0x539ef1){var _0x28c3c4={'where':{'id':_0x55fd25[_0xd6f0('0x58')]['id']}},_0x2d39a2={};_0x2d39a2['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x3e')][_0xd6f0('0x5a')]);_0x28c3c4['attributes']=_[_0xd6f0('0x46')](_0x2d39a2[_0xd6f0('0x42')],qs['fields'](_0x55fd25[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x28c3c4['attributes']=_0x28c3c4[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x28c3c4[_0xd6f0('0x48')]:_0x2d39a2[_0xd6f0('0x42')];if(_0x55fd25[_0xd6f0('0x43')]['includeAll']){_0x28c3c4[_0xd6f0('0x54')]=[{'all':!![]}];}_0x28c3c4=_[_0xd6f0('0x50')]({},_0x28c3c4,_0x55fd25['options']);return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')](_0x28c3c4)[_0xd6f0('0x1c')](handleEntityNotFound(_0x539ef1,null))['then'](function(_0x229f19){if(_0x229f19){var _0x5d75fa=_0x229f19['get']({'plain':!![]});_0x5d75fa=qs['omit'](_0x5d75fa,['id','createdAt',_0xd6f0('0x5c')]);_0x55fd25[_0xd6f0('0x5d')]=_[_0xd6f0('0x5e')](_0x55fd25[_0xd6f0('0x5d')],['id','createdAt',_0xd6f0('0x5c')]);return db['Trunk'][_0xd6f0('0x5f')](_[_0xd6f0('0x50')](_0x5d75fa,_0x55fd25[_0xd6f0('0x5d')]),{'include':_0x55fd25['query'][_0xd6f0('0x53')]?[{'all':!![]}]:undefined})[_0xd6f0('0x1c')](function(_0x269dd7){var _0x705eb=_0x55fd25['user'][_0xd6f0('0x35')]({'plain':!![]});if(!_0x705eb)throw new Error(_0xd6f0('0x60'));if(_0x705eb[_0xd6f0('0x61')]==='user'){var _0x5bc4e7=_0x269dd7[_0xd6f0('0x35')]({'plain':!![]});var _0x1fee47=_0xd6f0('0x36');return db['UserProfileSection'][_0xd6f0('0x5b')]({'where':{'name':_0x1fee47,'userProfileId':_0x705eb[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x282e9b){if(_0x282e9b&&_0x282e9b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5bc4e7['name'],'resourceId':_0x5bc4e7['id'],'type':_0x282e9b[_0xd6f0('0x3a')],'sectionId':_0x282e9b['id']},{})[_0xd6f0('0x1c')](function(){return _0x269dd7;});}else{return _0x269dd7;}})[_0xd6f0('0x27')](function(_0x30cd81){logger[_0xd6f0('0x23')](_0xd6f0('0x63'),_0x30cd81);throw _0x30cd81;});}return _0x269dd7;});}})[_0xd6f0('0x1c')](respondWithResult(_0x539ef1,0xc9))[_0xd6f0('0x27')](handleError(_0x539ef1,null));};exports[_0xd6f0('0x5f')]=function(_0x5ad146,_0x55f96e,_0x1b9728){var _0x5af4f6;return db[_0xd6f0('0x3e')][_0xd6f0('0x5f')](_0x5ad146[_0xd6f0('0x5d')],{'raw':!![]})[_0xd6f0('0x1c')](function(_0x14384f){_0x5af4f6=_0x14384f;return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})['then'](function(_0x3c8a3e){var _0x318a68=fs[_0xd6f0('0x64')](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x66')),'utf8');var _0xad50ac=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x1c6140=ejs[_0xd6f0('0x6a')](_0x318a68,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c6140);if(_0x5af4f6[_0xd6f0('0x6c')]){var _0x205b6a=ejs[_0xd6f0('0x6a')](_0xad50ac,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x205b6a);}})[_0xd6f0('0x1c')](function(){return respondWithRpcPromise(_0xd6f0('0x6d'),_0xd6f0('0x5f'),{'module':_0xd6f0('0x6e')});})[_0xd6f0('0x1c')](function(){var _0x12e0e5=_0x5ad146[_0xd6f0('0x6f')][_0xd6f0('0x35')]({'plain':!![]});if(!_0x12e0e5)throw new Error(_0xd6f0('0x60'));if(_0x12e0e5[_0xd6f0('0x61')]==='user'){var _0x440d5c=_0x5af4f6[_0xd6f0('0x35')]({'plain':!![]});return db[_0xd6f0('0x70')]['find']({'where':{'name':_0xd6f0('0x36'),'userProfileId':_0x12e0e5[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x406bc7){if(_0x406bc7&&_0x406bc7[_0xd6f0('0x71')]===0x0){return db[_0xd6f0('0x37')][_0xd6f0('0x5f')]({'name':_0x440d5c[_0xd6f0('0x3a')],'resourceId':_0x440d5c['id'],'type':_0x406bc7[_0xd6f0('0x3a')],'sectionId':_0x406bc7['id']},{})[_0xd6f0('0x1c')](function(){return _0x5af4f6;});}else{return _0x5af4f6;}})[_0xd6f0('0x27')](function(_0x5b3155){logger['error'](_0xd6f0('0x63'),_0x5b3155);throw _0x5b3155;});}return _0x5af4f6;})[_0xd6f0('0x1c')](respondWithResult(_0x55f96e,0xc9))[_0xd6f0('0x27')](handleError(_0x55f96e,null));};exports[_0xd6f0('0x34')]=function(_0x1da442,_0x5a781b,_0x15143a){var _0x2d38e6;return db['Trunk'][_0xd6f0('0x5b')]({'where':{'id':_0x1da442['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0x5a781b,null))[_0xd6f0('0x1c')](saveUpdates(_0x1da442[_0xd6f0('0x5d')],null))[_0xd6f0('0x1c')](function(_0x391c2a){if(_0x391c2a){_0x2d38e6=_0x391c2a;return db['Trunk']['findAll']({'raw':!![]});}})[_0xd6f0('0x1c')](function(_0x17b320){if(_0x17b320){var _0x484124=fs[_0xd6f0('0x64')](path['join'](config['root'],_0xd6f0('0x66')),'utf8');var _0x5dc1c7=fs['readFileSync'](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0xcfed18=ejs[_0xd6f0('0x6a')](_0x484124,{'trunks':_0x17b320||[]});fs[_0xd6f0('0x6b')](_0xd6f0('0x72'),_0xcfed18);var _0x381f88=ejs[_0xd6f0('0x6a')](_0x5dc1c7,{'trunks':_0x17b320||[]});fs['writeFileSync'](_0xd6f0('0x73'),_0x381f88);return respondWithRpcPromise('Reload','update',{'module':_0xd6f0('0x6e')});}return null;})[_0xd6f0('0x1c')](function(_0x397f2c){if(_0x397f2c){return _0x2d38e6;}})['then'](respondWithResult(_0x5a781b,null))[_0xd6f0('0x27')](handleError(_0x5a781b,null));};exports[_0xd6f0('0x74')]=function(_0xc0585c,_0xf7ade1,_0x41e738){var _0x202e37;return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')]({'where':{'id':_0xc0585c['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0xf7ade1,null))[_0xd6f0('0x1c')](removeEntity(_0xf7ade1,null))['then'](function(){return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})[_0xd6f0('0x1c')](function(_0x175ba6){var _0x403698=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config['root'],_0xd6f0('0x66')),_0xd6f0('0x69'));var _0x5c3659=fs['readFileSync'](path['join'](config['root'],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x2fdd59=ejs[_0xd6f0('0x6a')](_0x403698,{'trunks':_0x175ba6});var _0x427b95=ejs[_0xd6f0('0x6a')](_0x5c3659,{'trunks':_0x175ba6});fs['writeFileSync'](_0xd6f0('0x72'),_0x2fdd59);fs[_0xd6f0('0x6b')](_0xd6f0('0x73'),_0x427b95);return respondWithRpcPromise(_0xd6f0('0x6d'),'destroy',{'module':_0xd6f0('0x6e')});})['catch'](handleError(_0xf7ade1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 1e86d32..bfadead 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 _0x14aa=['request-promise','path','../../config/environment','exports','define','tools_trunks','util','../../config/logger','api','moment','bluebird'];(function(_0xc7f8f6,_0x533440){var _0x1f98da=function(_0x4194bc){while(--_0x4194bc){_0xc7f8f6['push'](_0xc7f8f6['shift']());}};_0x1f98da(++_0x533440);}(_0x14aa,0x1a8));var _0xa14a=function(_0x5028c4,_0x22a94c){_0x5028c4=_0x5028c4-0x0;var _0x58b62c=_0x14aa[_0x5028c4];return _0x58b62c;};'use strict';var _=require('lodash');var util=require(_0xa14a('0x0'));var logger=require(_0xa14a('0x1'))(_0xa14a('0x2'));var moment=require(_0xa14a('0x3'));var BPromise=require(_0xa14a('0x4'));var rp=require(_0xa14a('0x5'));var fs=require('fs');var path=require(_0xa14a('0x6'));var rimraf=require('rimraf');var config=require(_0xa14a('0x7'));var attributes=require('./trunk.attributes');module[_0xa14a('0x8')]=function(_0x5eade6,_0x1dec8c){return _0x5eade6[_0xa14a('0x9')]('Trunk',attributes,{'tableName':_0xa14a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf941=['Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./trunk.attributes','exports'];(function(_0x57f8bf,_0x157e3d){var _0x1432f9=function(_0x44c611){while(--_0x44c611){_0x57f8bf['push'](_0x57f8bf['shift']());}};_0x1432f9(++_0x157e3d);}(_0xf941,0x178));var _0x1f94=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf941[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x1f94('0x0'));var util=require(_0x1f94('0x1'));var logger=require(_0x1f94('0x2'))('api');var moment=require(_0x1f94('0x3'));var BPromise=require(_0x1f94('0x4'));var rp=require(_0x1f94('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f94('0x6'));var attributes=require(_0x1f94('0x7'));module[_0x1f94('0x8')]=function(_0x46d243,_0x26990a){return _0x46d243['define'](_0x1f94('0x9'),attributes,{'tableName':_0x1f94('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 0928750..816b68c 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 _0xf8e4=['Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetTrunk','findAll','options','where','attributes','map','include','model','ShowTrunk','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x53f05d,_0x8b6dca){var _0x39715b=function(_0x5908ee){while(--_0x5908ee){_0x53f05d['push'](_0x53f05d['shift']());}};_0x39715b(++_0x8b6dca);}(_0xf8e4,0x1ac));var _0x4f8e=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0xf8e4[_0x500785];return _0x1f8bcc;};'use strict';var _=require(_0x4f8e('0x0'));var util=require(_0x4f8e('0x1'));var moment=require(_0x4f8e('0x2'));var BPromise=require(_0x4f8e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f8e('0x4'));var db=require(_0x4f8e('0x5'))['db'];var utils=require(_0x4f8e('0x6'));var logger=require(_0x4f8e('0x7'))(_0x4f8e('0x8'));var config=require(_0x4f8e('0x9'));var jayson=require(_0x4f8e('0xa'));var client=jayson[_0x4f8e('0xb')][_0x4f8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x86f5ee,_0x13600a,_0x1e8843){return new BPromise(function(_0x5400f2,_0x36937f){return client[_0x4f8e('0xd')](_0x86f5ee,_0x1e8843)[_0x4f8e('0xe')](function(_0x4dfe8a){logger[_0x4f8e('0xf')](_0x4f8e('0x10'),_0x13600a,_0x4f8e('0x11'));logger[_0x4f8e('0x12')](_0x4f8e('0x13'),_0x13600a,'request\x20sent',JSON[_0x4f8e('0x14')](_0x4dfe8a));if(_0x4dfe8a['error']){if(_0x4dfe8a['error'][_0x4f8e('0x15')]===0x1f4){logger['error'](_0x4f8e('0x10'),_0x13600a,_0x4dfe8a[_0x4f8e('0x16')]['message']);return _0x36937f(_0x4dfe8a[_0x4f8e('0x16')][_0x4f8e('0x17')]);}logger[_0x4f8e('0x16')](_0x4f8e('0x10'),_0x13600a,_0x4dfe8a[_0x4f8e('0x16')][_0x4f8e('0x17')]);return _0x5400f2(_0x4dfe8a[_0x4f8e('0x16')][_0x4f8e('0x17')]);}else{logger[_0x4f8e('0xf')](_0x4f8e('0x10'),_0x13600a,_0x4f8e('0x11'));_0x5400f2(_0x4dfe8a[_0x4f8e('0x18')][_0x4f8e('0x17')]);}})[_0x4f8e('0x19')](function(_0x91a10f){logger[_0x4f8e('0x16')](_0x4f8e('0x10'),_0x13600a,_0x91a10f);_0x36937f(_0x91a10f);});});}exports[_0x4f8e('0x1a')]=function(_0x3b6317){var _0x273782=this;return new Promise(function(_0x4dc23c,_0x7734c1){return db['Trunk'][_0x4f8e('0x1b')]({'raw':_0x3b6317[_0x4f8e('0x1c')]?_0x3b6317[_0x4f8e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b6317[_0x4f8e('0x1c')]?_0x3b6317[_0x4f8e('0x1c')][_0x4f8e('0x1d')]||null:null,'attributes':_0x3b6317[_0x4f8e('0x1c')]?_0x3b6317['options'][_0x4f8e('0x1e')]||null:null,'limit':_0x3b6317['options']?_0x3b6317[_0x4f8e('0x1c')]['limit']||null:null,'include':_0x3b6317[_0x4f8e('0x1c')]?_0x3b6317[_0x4f8e('0x1c')]['include']?_[_0x4f8e('0x1f')](_0x3b6317['options'][_0x4f8e('0x20')],function(_0xcec670){return{'model':db[_0xcec670[_0x4f8e('0x21')]],'as':_0xcec670['as'],'attributes':_0xcec670[_0x4f8e('0x1e')],'include':_0xcec670[_0x4f8e('0x20')]?_[_0x4f8e('0x1f')](_0xcec670[_0x4f8e('0x20')],function(_0x3c9a16){return{'model':db[_0x3c9a16[_0x4f8e('0x21')]],'as':_0x3c9a16['as'],'attributes':_0x3c9a16[_0x4f8e('0x1e')],'include':_0x3c9a16['include']?_[_0x4f8e('0x1f')](_0x3c9a16['include'],function(_0x2ce74f){return{'model':db[_0x2ce74f[_0x4f8e('0x21')]],'as':_0x2ce74f['as'],'attributes':_0x2ce74f[_0x4f8e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x586694){logger['info'](_0x4f8e('0x1a'),_0x3b6317);logger['debug']('GetTrunk',_0x3b6317,JSON['stringify'](_0x586694));_0x4dc23c(_0x586694);})[_0x4f8e('0x19')](function(_0x3ab8c2){logger[_0x4f8e('0x16')](_0x4f8e('0x1a'),_0x3ab8c2[_0x4f8e('0x17')],_0x3b6317);_0x7734c1(_0x273782['error'](0x1f4,_0x3ab8c2[_0x4f8e('0x17')]));});});};exports[_0x4f8e('0x22')]=function(_0x2582af){var _0x575970=this;return new Promise(function(_0x5f4efa,_0x377a7b){return db['Trunk'][_0x4f8e('0x23')]({'raw':_0x2582af[_0x4f8e('0x1c')]?_0x2582af[_0x4f8e('0x1c')][_0x4f8e('0x24')]===undefined?!![]:![]:!![],'where':_0x2582af['options']?_0x2582af[_0x4f8e('0x1c')][_0x4f8e('0x1d')]||null:null,'attributes':_0x2582af[_0x4f8e('0x1c')]?_0x2582af[_0x4f8e('0x1c')][_0x4f8e('0x1e')]||null:null,'include':_0x2582af[_0x4f8e('0x1c')]?_0x2582af[_0x4f8e('0x1c')][_0x4f8e('0x20')]?_[_0x4f8e('0x1f')](_0x2582af[_0x4f8e('0x1c')][_0x4f8e('0x20')],function(_0x215a25){return{'model':db[_0x215a25[_0x4f8e('0x21')]],'as':_0x215a25['as'],'attributes':_0x215a25['attributes'],'include':_0x215a25[_0x4f8e('0x20')]?_['map'](_0x215a25[_0x4f8e('0x20')],function(_0xd1c5ae){return{'model':db[_0xd1c5ae[_0x4f8e('0x21')]],'as':_0xd1c5ae['as'],'attributes':_0xd1c5ae[_0x4f8e('0x1e')],'include':_0xd1c5ae['include']?_['map'](_0xd1c5ae[_0x4f8e('0x20')],function(_0x1c237c){return{'model':db[_0x1c237c[_0x4f8e('0x21')]],'as':_0x1c237c['as'],'attributes':_0x1c237c[_0x4f8e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4f8e('0xe')](function(_0x219652){logger[_0x4f8e('0xf')](_0x4f8e('0x22'),_0x2582af);logger[_0x4f8e('0x12')](_0x4f8e('0x22'),_0x2582af,JSON[_0x4f8e('0x14')](_0x219652));_0x5f4efa(_0x219652);})[_0x4f8e('0x19')](function(_0x22de0a){logger['error'](_0x4f8e('0x22'),_0x22de0a[_0x4f8e('0x17')],_0x2582af);_0x377a7b(_0x575970[_0x4f8e('0x16')](0x1f4,_0x22de0a[_0x4f8e('0x17')]));});});}; \ No newline at end of file +var _0xb33e=['attributes','limit','map','include','model','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xb33e,0x14b));var _0xeb33=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb33e[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xeb33('0x0'));var moment=require(_0xeb33('0x1'));var BPromise=require(_0xeb33('0x2'));var rs=require(_0xeb33('0x3'));var fs=require('fs');var Redis=require(_0xeb33('0x4'));var db=require(_0xeb33('0x5'))['db'];var utils=require(_0xeb33('0x6'));var logger=require(_0xeb33('0x7'))(_0xeb33('0x8'));var config=require(_0xeb33('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xef874e,_0x200fe8,_0x37f5e9){return new BPromise(function(_0x2146be,_0x4b6d25){return client[_0xeb33('0xb')](_0xef874e,_0x37f5e9)[_0xeb33('0xc')](function(_0x165417){logger['info']('Trunk,\x20%s,\x20%s',_0x200fe8,_0xeb33('0xd'));logger[_0xeb33('0xe')](_0xeb33('0xf'),_0x200fe8,'request\x20sent',JSON[_0xeb33('0x10')](_0x165417));if(_0x165417[_0xeb33('0x11')]){if(_0x165417[_0xeb33('0x11')]['code']===0x1f4){logger[_0xeb33('0x11')](_0xeb33('0x12'),_0x200fe8,_0x165417[_0xeb33('0x11')][_0xeb33('0x13')]);return _0x4b6d25(_0x165417[_0xeb33('0x11')]['message']);}logger[_0xeb33('0x11')](_0xeb33('0x12'),_0x200fe8,_0x165417[_0xeb33('0x11')][_0xeb33('0x13')]);return _0x2146be(_0x165417[_0xeb33('0x11')][_0xeb33('0x13')]);}else{logger[_0xeb33('0x14')](_0xeb33('0x12'),_0x200fe8,_0xeb33('0xd'));_0x2146be(_0x165417[_0xeb33('0x15')][_0xeb33('0x13')]);}})[_0xeb33('0x16')](function(_0x5c1248){logger[_0xeb33('0x11')]('Trunk,\x20%s,\x20%s',_0x200fe8,_0x5c1248);_0x4b6d25(_0x5c1248);});});}exports[_0xeb33('0x17')]=function(_0x59a626){var _0x23724b=this;return new Promise(function(_0x508946,_0x187781){return db[_0xeb33('0x18')][_0xeb33('0x19')]({'raw':_0x59a626['options']?_0x59a626[_0xeb33('0x1a')][_0xeb33('0x1b')]===undefined?!![]:![]:!![],'where':_0x59a626[_0xeb33('0x1a')]?_0x59a626[_0xeb33('0x1a')][_0xeb33('0x1c')]||null:null,'attributes':_0x59a626['options']?_0x59a626[_0xeb33('0x1a')][_0xeb33('0x1d')]||null:null,'limit':_0x59a626[_0xeb33('0x1a')]?_0x59a626[_0xeb33('0x1a')][_0xeb33('0x1e')]||null:null,'include':_0x59a626[_0xeb33('0x1a')]?_0x59a626[_0xeb33('0x1a')]['include']?_[_0xeb33('0x1f')](_0x59a626[_0xeb33('0x1a')][_0xeb33('0x20')],function(_0x43d817){return{'model':db[_0x43d817['model']],'as':_0x43d817['as'],'attributes':_0x43d817[_0xeb33('0x1d')],'include':_0x43d817[_0xeb33('0x20')]?_[_0xeb33('0x1f')](_0x43d817['include'],function(_0x4c66b4){return{'model':db[_0x4c66b4[_0xeb33('0x21')]],'as':_0x4c66b4['as'],'attributes':_0x4c66b4['attributes'],'include':_0x4c66b4[_0xeb33('0x20')]?_[_0xeb33('0x1f')](_0x4c66b4[_0xeb33('0x20')],function(_0x34bc33){return{'model':db[_0x34bc33[_0xeb33('0x21')]],'as':_0x34bc33['as'],'attributes':_0x34bc33[_0xeb33('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf7b1){logger[_0xeb33('0x14')](_0xeb33('0x17'),_0x59a626);logger['debug'](_0xeb33('0x17'),_0x59a626,JSON[_0xeb33('0x10')](_0x4cf7b1));_0x508946(_0x4cf7b1);})['catch'](function(_0x157651){logger['error'](_0xeb33('0x17'),_0x157651[_0xeb33('0x13')],_0x59a626);_0x187781(_0x23724b[_0xeb33('0x11')](0x1f4,_0x157651[_0xeb33('0x13')]));});});};exports[_0xeb33('0x22')]=function(_0x1d96ff){var _0x4baf04=this;return new Promise(function(_0x240cee,_0x8c4e38){return db['Trunk'][_0xeb33('0x23')]({'raw':_0x1d96ff[_0xeb33('0x1a')]?_0x1d96ff[_0xeb33('0x1a')][_0xeb33('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d96ff['options']?_0x1d96ff['options']['where']||null:null,'attributes':_0x1d96ff['options']?_0x1d96ff[_0xeb33('0x1a')][_0xeb33('0x1d')]||null:null,'include':_0x1d96ff[_0xeb33('0x1a')]?_0x1d96ff[_0xeb33('0x1a')][_0xeb33('0x20')]?_[_0xeb33('0x1f')](_0x1d96ff['options'][_0xeb33('0x20')],function(_0x4fa8e5){return{'model':db[_0x4fa8e5[_0xeb33('0x21')]],'as':_0x4fa8e5['as'],'attributes':_0x4fa8e5[_0xeb33('0x1d')],'include':_0x4fa8e5['include']?_[_0xeb33('0x1f')](_0x4fa8e5[_0xeb33('0x20')],function(_0x33e192){return{'model':db[_0x33e192[_0xeb33('0x21')]],'as':_0x33e192['as'],'attributes':_0x33e192['attributes'],'include':_0x33e192[_0xeb33('0x20')]?_['map'](_0x33e192[_0xeb33('0x20')],function(_0x50c088){return{'model':db[_0x50c088[_0xeb33('0x21')]],'as':_0x50c088['as'],'attributes':_0x50c088[_0xeb33('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb33('0xc')](function(_0x408824){logger[_0xeb33('0x14')](_0xeb33('0x22'),_0x1d96ff);logger[_0xeb33('0xe')](_0xeb33('0x22'),_0x1d96ff,JSON[_0xeb33('0x10')](_0x408824));_0x240cee(_0x408824);})[_0xeb33('0x16')](function(_0x53ad79){logger[_0xeb33('0x11')](_0xeb33('0x22'),_0x53ad79[_0xeb33('0x13')],_0x1d96ff);_0x8c4e38(_0x4baf04[_0xeb33('0x11')](0x1f4,_0x53ad79[_0xeb33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 478b926..d24d0cf 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 _0x706f=['getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','create','post','/create_many','bulkCreate','addQueues','diskStorage','join','%s-%s','now','originalname','single','addAvatar','/:id/logout','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/square_projects','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/api_key','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./user.controller','get','index','isAuthenticated','/whoami','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x706f,0x1a2));var _0xf706=function(_0x35d3c8,_0x491e3a){_0x35d3c8=_0x35d3c8-0x0;var _0x40751e=_0x706f[_0x35d3c8];return _0x40751e;};'use strict';var multer=require('multer');var util=require(_0xf706('0x0'));var path=require(_0xf706('0x1'));var timeout=require(_0xf706('0x2'));var express=require(_0xf706('0x3'));var router=express[_0xf706('0x4')]();var fs_extra=require(_0xf706('0x5'));var auth=require(_0xf706('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf706('0x7'));router[_0xf706('0x8')]('/',auth['isAuthenticated'](),controller[_0xf706('0x9')]);router[_0xf706('0x8')]('/describe',auth[_0xf706('0xa')](),controller['describe']);router['get'](_0xf706('0xb'),auth[_0xf706('0xa')](),controller[_0xf706('0xc')]);router[_0xf706('0x8')](_0xf706('0xd'),auth[_0xf706('0xa')](),controller['getPresence']);router[_0xf706('0x8')](_0xf706('0xe'),auth[_0xf706('0xa')](),controller[_0xf706('0xf')]);router[_0xf706('0x8')](_0xf706('0x10'),controller[_0xf706('0x11')]);router[_0xf706('0x8')](_0xf706('0x12'),auth[_0xf706('0xa')](),controller[_0xf706('0x13')]);router[_0xf706('0x8')](_0xf706('0x14'),auth[_0xf706('0xa')](),controller[_0xf706('0x15')]);router[_0xf706('0x8')]('/:id/queues',auth[_0xf706('0xa')](),controller[_0xf706('0x16')]);router[_0xf706('0x8')](_0xf706('0x17'),auth[_0xf706('0xa')](),controller[_0xf706('0x18')]);router[_0xf706('0x8')]('/:id/groups',auth[_0xf706('0xa')](),controller[_0xf706('0x19')]);router[_0xf706('0x8')](_0xf706('0x1a'),auth['isAuthenticated'](),controller[_0xf706('0x1b')]);router[_0xf706('0x8')]('/:id/screen_recordings',auth[_0xf706('0xa')](),controller[_0xf706('0x1c')]);router[_0xf706('0x8')](_0xf706('0x1d'),auth[_0xf706('0xa')](),controller[_0xf706('0x1e')]);router['get'](_0xf706('0x1f'),auth[_0xf706('0xa')](),controller[_0xf706('0x20')]);router[_0xf706('0x8')](_0xf706('0x21'),auth[_0xf706('0xa')](),controller['getMailInteractions']);router[_0xf706('0x8')]('/:id/sms/interactions',auth[_0xf706('0xa')](),controller[_0xf706('0x22')]);router['get'](_0xf706('0x23'),auth[_0xf706('0xa')](),controller[_0xf706('0x24')]);router[_0xf706('0x8')](_0xf706('0x25'),auth[_0xf706('0xa')](),controller[_0xf706('0x26')]);router['get'](_0xf706('0x27'),auth['isAuthenticated'](),controller['getTeams']);router[_0xf706('0x8')](_0xf706('0x28'),auth['isAuthenticated'](),controller[_0xf706('0x29')]);router[_0xf706('0x8')]('/:id/agents',auth['isAuthenticated'](),controller[_0xf706('0x2a')]);router[_0xf706('0x8')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0xf706('0x2b')]);router[_0xf706('0x8')](_0xf706('0x2c'),auth[_0xf706('0xa')](),controller[_0xf706('0x2d')]);router[_0xf706('0x8')](_0xf706('0x2e'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xf706('0x8')](_0xf706('0x2f'),auth[_0xf706('0xa')](),controller[_0xf706('0x30')]);router['get'](_0xf706('0x31'),auth[_0xf706('0xa')](),controller[_0xf706('0x32')]);router[_0xf706('0x8')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xf706('0x33')]);router[_0xf706('0x8')](_0xf706('0x34'),auth[_0xf706('0xa')](),controller['getWhatsappAccounts']);router[_0xf706('0x8')]('/:id/square_projects',auth[_0xf706('0xa')](),controller[_0xf706('0x35')]);router[_0xf706('0x8')](_0xf706('0x36'),auth[_0xf706('0xa')](),controller[_0xf706('0x37')]);router[_0xf706('0x8')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xf706('0x38')]);router['post'](_0xf706('0x14'),auth[_0xf706('0xa')](),controller[_0xf706('0x39')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf706('0x3a')]);router[_0xf706('0x3b')](_0xf706('0x3c'),auth[_0xf706('0xa')](),controller[_0xf706('0x3d')]);router[_0xf706('0x3b')]('/:id/queues',auth[_0xf706('0xa')](),controller[_0xf706('0x3e')]);var upload=multer({'storage':multer[_0xf706('0x3f')]({'destination':function(_0x12854d,_0x349577,_0x1354de){_0x1354de(null,path[_0xf706('0x40')](config['root'],'server/files/images/'));},'filename':function(_0x3da6d2,_0x4e897c,_0x9ffecb){_0x9ffecb(null,util['format'](_0xf706('0x41'),Date[_0xf706('0x42')](),_0x4e897c[_0xf706('0x43')]));}})});router[_0xf706('0x3b')](_0xf706('0x10'),upload[_0xf706('0x44')]('file'),controller[_0xf706('0x45')]);router[_0xf706('0x3b')]('/:id/login',auth[_0xf706('0xa')](),controller['login']);router[_0xf706('0x3b')](_0xf706('0x46'),auth[_0xf706('0xa')](),controller[_0xf706('0x47')]);router[_0xf706('0x3b')](_0xf706('0x48'),auth[_0xf706('0xa')](),controller[_0xf706('0x49')]);router[_0xf706('0x3b')]('/:id/unpause',auth[_0xf706('0xa')](),controller[_0xf706('0x4a')]);router[_0xf706('0x3b')](_0xf706('0x27'),auth['isAuthenticated'](),controller['addTeams']);router[_0xf706('0x3b')](_0xf706('0x4b'),auth[_0xf706('0xa')](),controller['addChatInteractions']);router[_0xf706('0x3b')]('/:id/mail_interactions',auth[_0xf706('0xa')](),controller[_0xf706('0x4c')]);router[_0xf706('0x3b')](_0xf706('0x4d'),auth['isAuthenticated'](),controller[_0xf706('0x4e')]);router[_0xf706('0x3b')]('/:id/sms_interactions',auth[_0xf706('0xa')](),controller[_0xf706('0x4f')]);router[_0xf706('0x3b')](_0xf706('0x50'),auth['isAuthenticated'](),controller[_0xf706('0x51')]);router['post'](_0xf706('0x52'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xf706('0x3b')]('/:id/fax_accounts',auth[_0xf706('0xa')](),controller[_0xf706('0x53')]);router[_0xf706('0x3b')](_0xf706('0x2e'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xf706('0x3b')]('/:id/openchannel_accounts',auth[_0xf706('0xa')](),controller[_0xf706('0x54')]);router[_0xf706('0x3b')](_0xf706('0x31'),auth[_0xf706('0xa')](),controller[_0xf706('0x55')]);router[_0xf706('0x3b')](_0xf706('0x56'),auth['isAuthenticated'](),controller[_0xf706('0x57')]);router[_0xf706('0x3b')](_0xf706('0x34'),auth[_0xf706('0xa')](),controller['addWhatsappAccounts']);router['post'](_0xf706('0x58'),auth[_0xf706('0xa')](),controller[_0xf706('0x59')]);router[_0xf706('0x3b')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xf706('0x5a')]);router[_0xf706('0x5b')](_0xf706('0xe'),auth['isAuthenticated'](),controller[_0xf706('0x5c')]);router[_0xf706('0x5b')](_0xf706('0x5d'),auth[_0xf706('0xa')](),controller[_0xf706('0x5e')]);router[_0xf706('0x5f')](_0xf706('0x60'),auth[_0xf706('0xa')](),controller[_0xf706('0x61')]);router[_0xf706('0x5f')](_0xf706('0x27'),auth[_0xf706('0xa')](),controller[_0xf706('0x62')]);router[_0xf706('0x5f')](_0xf706('0xe'),auth[_0xf706('0xa')](),controller[_0xf706('0x63')]);router[_0xf706('0x5f')](_0xf706('0x4b'),auth[_0xf706('0xa')](),controller[_0xf706('0x64')]);router[_0xf706('0x5f')](_0xf706('0x65'),auth['isAuthenticated'](),controller[_0xf706('0x66')]);router[_0xf706('0x5f')](_0xf706('0x4d'),auth[_0xf706('0xa')](),controller[_0xf706('0x67')]);router[_0xf706('0x5f')](_0xf706('0x68'),auth['isAuthenticated'](),controller[_0xf706('0x69')]);router[_0xf706('0x5f')](_0xf706('0x50'),auth['isAuthenticated'](),controller[_0xf706('0x6a')]);router[_0xf706('0x5f')](_0xf706('0x52'),auth[_0xf706('0xa')](),controller['removeWhatsappInteractions']);router['delete'](_0xf706('0x2c'),auth['isAuthenticated'](),controller[_0xf706('0x6b')]);router[_0xf706('0x5f')]('/:id/mail_accounts',auth[_0xf706('0xa')](),controller[_0xf706('0x6c')]);router['delete'](_0xf706('0x2f'),auth['isAuthenticated'](),controller[_0xf706('0x6d')]);router[_0xf706('0x5f')](_0xf706('0x31'),auth['isAuthenticated'](),controller[_0xf706('0x6e')]);router[_0xf706('0x5f')](_0xf706('0x56'),auth['isAuthenticated'](),controller[_0xf706('0x6f')]);router[_0xf706('0x5f')](_0xf706('0x34'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xf706('0x5f')]('/:id/square_projects',auth[_0xf706('0xa')](),controller['removeSquareProjects']);router[_0xf706('0x5f')](_0xf706('0x70'),auth[_0xf706('0xa')](),controller[_0xf706('0x71')]);module[_0xf706('0x72')]=router; \ No newline at end of file +var _0xafd3=['/:id/chat/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','single','file','addAvatar','/:id/login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','Router','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getRecordings','getScreenRecordings'];(function(_0x13f6ad,_0x1c6a11){var _0x50ddcf=function(_0x2d0934){while(--_0x2d0934){_0x13f6ad['push'](_0x13f6ad['shift']());}};_0x50ddcf(++_0x1c6a11);}(_0xafd3,0x1ac));var _0x3afd=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xafd3[_0x330414];return _0x99dbff;};'use strict';var multer=require(_0x3afd('0x0'));var util=require(_0x3afd('0x1'));var path=require(_0x3afd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3afd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3afd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3afd('0x5'));var controller=require(_0x3afd('0x6'));router[_0x3afd('0x7')]('/',auth[_0x3afd('0x8')](),controller['index']);router[_0x3afd('0x7')](_0x3afd('0x9'),auth[_0x3afd('0x8')](),controller[_0x3afd('0xa')]);router[_0x3afd('0x7')](_0x3afd('0xb'),auth[_0x3afd('0x8')](),controller[_0x3afd('0xc')]);router[_0x3afd('0x7')](_0x3afd('0xd'),auth['isAuthenticated'](),controller[_0x3afd('0xe')]);router[_0x3afd('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3afd('0xf')]);router[_0x3afd('0x7')](_0x3afd('0x10'),controller[_0x3afd('0x11')]);router[_0x3afd('0x7')](_0x3afd('0x12'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x13')]);router[_0x3afd('0x7')](_0x3afd('0x14'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x15')]);router[_0x3afd('0x7')](_0x3afd('0x16'),auth['isAuthenticated'](),controller[_0x3afd('0x17')]);router[_0x3afd('0x7')](_0x3afd('0x18'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x19')]);router[_0x3afd('0x7')]('/:id/groups',auth[_0x3afd('0x8')](),controller['getGroups']);router[_0x3afd('0x7')]('/:id/recordings',auth[_0x3afd('0x8')](),controller[_0x3afd('0x1a')]);router[_0x3afd('0x7')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x3afd('0x1b')]);router[_0x3afd('0x7')](_0x3afd('0x1c'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x3afd('0x7')]('/:id/openchannel/interactions',auth[_0x3afd('0x8')](),controller['getOpenchannelInteractions']);router[_0x3afd('0x7')]('/:id/mail/interactions',auth[_0x3afd('0x8')](),controller[_0x3afd('0x1d')]);router[_0x3afd('0x7')]('/:id/sms/interactions',auth[_0x3afd('0x8')](),controller['getSmsInteractions']);router[_0x3afd('0x7')](_0x3afd('0x1e'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x1f')]);router['get']('/:id/whatsapp/interactions',auth[_0x3afd('0x8')](),controller['getWhatsappInteractions']);router[_0x3afd('0x7')](_0x3afd('0x20'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x21')]);router[_0x3afd('0x7')]('/:id/lists',auth[_0x3afd('0x8')](),controller[_0x3afd('0x22')]);router[_0x3afd('0x7')](_0x3afd('0x23'),auth[_0x3afd('0x8')](),controller['getAgents']);router[_0x3afd('0x7')](_0x3afd('0x24'),auth['isAuthenticated'](),controller[_0x3afd('0x25')]);router[_0x3afd('0x7')](_0x3afd('0x26'),auth['isAuthenticated'](),controller[_0x3afd('0x27')]);router[_0x3afd('0x7')](_0x3afd('0x28'),auth['isAuthenticated'](),controller[_0x3afd('0x29')]);router[_0x3afd('0x7')](_0x3afd('0x2a'),auth['isAuthenticated'](),controller[_0x3afd('0x2b')]);router[_0x3afd('0x7')]('/:id/sms_accounts',auth[_0x3afd('0x8')](),controller[_0x3afd('0x2c')]);router['get'](_0x3afd('0x2d'),auth['isAuthenticated'](),controller[_0x3afd('0x2e')]);router[_0x3afd('0x7')]('/:id/whatsapp_accounts',auth[_0x3afd('0x8')](),controller[_0x3afd('0x2f')]);router[_0x3afd('0x7')](_0x3afd('0x30'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x31')]);router[_0x3afd('0x7')](_0x3afd('0x32'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x33')]);router[_0x3afd('0x7')](_0x3afd('0x34'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x35')]);router[_0x3afd('0x36')]('/:id/contacts',auth[_0x3afd('0x8')](),controller['addContacts']);router[_0x3afd('0x36')]('/',auth['isAuthenticated'](),controller[_0x3afd('0x37')]);router[_0x3afd('0x36')]('/create_many',auth[_0x3afd('0x8')](),controller['bulkCreate']);router[_0x3afd('0x36')]('/:id/queues',auth[_0x3afd('0x8')](),controller[_0x3afd('0x38')]);var upload=multer({'storage':multer[_0x3afd('0x39')]({'destination':function(_0xccf70a,_0x269a61,_0x43da94){_0x43da94(null,path[_0x3afd('0x3a')](config[_0x3afd('0x3b')],_0x3afd('0x3c')));},'filename':function(_0x1f8042,_0x179c93,_0xaae9e4){_0xaae9e4(null,util[_0x3afd('0x3d')](_0x3afd('0x3e'),Date['now'](),_0x179c93['originalname']));}})});router[_0x3afd('0x36')](_0x3afd('0x10'),upload[_0x3afd('0x3f')](_0x3afd('0x40')),controller[_0x3afd('0x41')]);router['post'](_0x3afd('0x42'),auth['isAuthenticated'](),controller['login']);router[_0x3afd('0x36')]('/:id/logout',auth[_0x3afd('0x8')](),controller[_0x3afd('0x43')]);router[_0x3afd('0x36')](_0x3afd('0x44'),auth[_0x3afd('0x8')](),controller['pause']);router[_0x3afd('0x36')](_0x3afd('0x45'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x46')]);router[_0x3afd('0x36')](_0x3afd('0x20'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x47')]);router[_0x3afd('0x36')](_0x3afd('0x48'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x49')]);router[_0x3afd('0x36')]('/:id/mail_interactions',auth[_0x3afd('0x8')](),controller[_0x3afd('0x4a')]);router[_0x3afd('0x36')](_0x3afd('0x4b'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x4c')]);router[_0x3afd('0x36')]('/:id/sms_interactions',auth[_0x3afd('0x8')](),controller[_0x3afd('0x4d')]);router[_0x3afd('0x36')](_0x3afd('0x4e'),auth['isAuthenticated'](),controller[_0x3afd('0x4f')]);router[_0x3afd('0x36')](_0x3afd('0x50'),auth['isAuthenticated'](),controller[_0x3afd('0x51')]);router[_0x3afd('0x36')]('/:id/fax_accounts',auth[_0x3afd('0x8')](),controller[_0x3afd('0x52')]);router['post'](_0x3afd('0x28'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x53')]);router[_0x3afd('0x36')](_0x3afd('0x2a'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x54')]);router[_0x3afd('0x36')](_0x3afd('0x55'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x56')]);router[_0x3afd('0x36')](_0x3afd('0x2d'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x57')]);router[_0x3afd('0x36')](_0x3afd('0x58'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x59')]);router['post'](_0x3afd('0x30'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x5a')]);router[_0x3afd('0x36')](_0x3afd('0x34'),auth[_0x3afd('0x8')](),controller['createApiKey']);router[_0x3afd('0x5b')](_0x3afd('0x5c'),auth['isAuthenticated'](),controller[_0x3afd('0x5d')]);router[_0x3afd('0x5b')](_0x3afd('0x5e'),auth['isAuthenticated'](),controller[_0x3afd('0x5f')]);router[_0x3afd('0x60')]('/:id/queues',auth[_0x3afd('0x8')](),controller[_0x3afd('0x61')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x3afd('0x62')]);router['delete'](_0x3afd('0x5c'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x63')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x3afd('0x64')]);router[_0x3afd('0x60')](_0x3afd('0x65'),auth['isAuthenticated'](),controller[_0x3afd('0x66')]);router[_0x3afd('0x60')](_0x3afd('0x4b'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x67')]);router[_0x3afd('0x60')](_0x3afd('0x68'),auth['isAuthenticated'](),controller[_0x3afd('0x69')]);router[_0x3afd('0x60')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x3afd('0x6a')]);router[_0x3afd('0x60')](_0x3afd('0x50'),auth['isAuthenticated'](),controller[_0x3afd('0x6b')]);router[_0x3afd('0x60')](_0x3afd('0x26'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x6c')]);router[_0x3afd('0x60')](_0x3afd('0x28'),auth[_0x3afd('0x8')](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x3afd('0x8')](),controller[_0x3afd('0x6d')]);router['delete']('/:id/sms_accounts',auth[_0x3afd('0x8')](),controller['removeSmsAccounts']);router[_0x3afd('0x60')](_0x3afd('0x2d'),auth['isAuthenticated'](),controller[_0x3afd('0x6e')]);router[_0x3afd('0x60')](_0x3afd('0x58'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x6f')]);router[_0x3afd('0x60')](_0x3afd('0x30'),auth['isAuthenticated'](),controller[_0x3afd('0x70')]);router['delete'](_0x3afd('0x34'),auth[_0x3afd('0x8')](),controller[_0x3afd('0x71')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8291402..f4dd59f 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 _0x4ffe=['true','false','screenrecording','blocked','UNSIGNED','moment','util','lodash','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','format','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','nat','all','allow','insecure','never','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','TEXT','showWebBar','isArray','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','/etc/pki/tls/certs/motion.crt','permissions','phoneBarEnableScreenRecordingByAgent','string'];(function(_0x5a439e,_0x335b9a){var _0x251870=function(_0x511d59){while(--_0x511d59){_0x5a439e['push'](_0x5a439e['shift']());}};_0x251870(++_0x335b9a);}(_0x4ffe,0x110));var _0xe4ff=function(_0x567312,_0x33020e){_0x567312=_0x567312-0x0;var _0xea4df1=_0x4ffe[_0x567312];return _0xea4df1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe4ff('0x0'));var util=require(_0xe4ff('0x1'));var _=require(_0xe4ff('0x2'));module[_0xe4ff('0x3')]={'name':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x146e06){this[_0xe4ff('0x5')](_0xe4ff('0x6'),_0x146e06);this[_0xe4ff('0x5')](_0xe4ff('0x7'),_0x146e06);},'comment':_0xe4ff('0x8')},'fullname':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':![],'set':function(_0x565361){this[_0xe4ff('0x5')](_0xe4ff('0x9'),_0x565361);this['setDataValue'](_0xe4ff('0xa'),util['format']('\x22%s\x22\x20<%s>',_0x565361,this[_0xe4ff('0xb')](_0xe4ff('0xc'))));}},'alias':{'type':Sequelize[_0xe4ff('0x4')]},'email':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3abac1){if(_0x3abac1){this['setDataValue'](_0xe4ff('0xd'),_0x3abac1[_0xe4ff('0xe')]());}}},'role':{'type':Sequelize[_0xe4ff('0xf')]('admin',_0xe4ff('0x10'),_0xe4ff('0x11'),_0xe4ff('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xe4ff('0x13')},'internal':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x5b2891){this[_0xe4ff('0x5')](_0xe4ff('0xc'),_0x5b2891);this['setDataValue']('accountcode',_0x5b2891);this[_0xe4ff('0x5')](_0xe4ff('0xa'),util[_0xe4ff('0x15')](_0xe4ff('0x16'),this[_0xe4ff('0xb')](_0xe4ff('0x9')),_0x5b2891));}},'salt':{'type':Sequelize[_0xe4ff('0x4')]},'phone':{'type':Sequelize[_0xe4ff('0x4')]},'mobile':{'type':Sequelize[_0xe4ff('0x4')]},'address':{'type':Sequelize[_0xe4ff('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe4ff('0x4')]},'country':{'type':Sequelize[_0xe4ff('0x4')]},'online':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xe4ff('0x4')],'defaultValue':_0xe4ff('0x18')},'lastPauseAt':{'type':Sequelize[_0xe4ff('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe4ff('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe4ff('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![],'defaultValue':_0xe4ff('0x1a')},'ipaddr':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xe4ff('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe4ff('0xf')]('friend',_0xe4ff('0x10'),_0xe4ff('0x1b')),'allowNull':!![],'defaultValue':_0xe4ff('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe4ff('0x1d')},'callingpres':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x1e'),_0xe4ff('0x1f'),_0xe4ff('0x20'),'ALLOWED',_0xe4ff('0x21'),_0xe4ff('0x22'),_0xe4ff('0x23'),_0xe4ff('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![],'defaultValue':_0xe4ff('0x25'),'set':function(_0x39dea6){this[_0xe4ff('0x5')](_0xe4ff('0x26'),_0x39dea6?_0x39dea6[_0xe4ff('0x27')](','):null);},'get':function(){return this[_0xe4ff('0xb')](_0xe4ff('0x26'))?this[_0xe4ff('0xb')](_0xe4ff('0x26'))[_0xe4ff('0x28')](','):null;},'comment':_0xe4ff('0x29')},'dtmfmode':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x2a'),_0xe4ff('0x2b'),_0xe4ff('0x2c'),_0xe4ff('0x2d'),_0xe4ff('0x2e')),'allowNull':!![],'defaultValue':_0xe4ff('0x2a')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xe4ff('0x2f'),_0xe4ff('0x30'),_0xe4ff('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x5b0da5){this[_0xe4ff('0x5')](_0xe4ff('0x33'),_0x5b0da5?_0x5b0da5[_0xe4ff('0x27')](','):null);},'get':function(){return this['getDataValue'](_0xe4ff('0x33'))?this[_0xe4ff('0xb')](_0xe4ff('0x33'))[_0xe4ff('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xe4ff('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe4ff('0x34')},'allow':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x36592b){this[_0xe4ff('0x5')](_0xe4ff('0x35'),_0x36592b?_0x36592b[_0xe4ff('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe4ff('0xb')](_0xe4ff('0x35'))?this['getDataValue'](_0xe4ff('0x35'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![],'set':function(_0x925554){this[_0xe4ff('0x5')](_0xe4ff('0x36'),_0x925554?_0x925554['join'](','):null);},'get':function(){return this[_0xe4ff('0xb')](_0xe4ff('0x36'))?this[_0xe4ff('0xb')](_0xe4ff('0x36'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xe4ff('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![],'defaultValue':_0xe4ff('0x38')},'amaflags':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':_0xe4ff('0x32')},'busylevel':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xe4ff('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x39'),_0xe4ff('0x3a'),_0xe4ff('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x3c'),_0xe4ff('0x3d')),'allowNull':!![],'defaultValue':_0xe4ff('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':_0xe4ff('0x32')},'keepalive':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no',_0xe4ff('0x3e'),_0xe4ff('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe4ff('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xe4ff('0x40'),_0xe4ff('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe4ff('0xf')](_0xe4ff('0x32'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no',_0xe4ff('0x2f'),_0xe4ff('0x30'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe4ff('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xe4ff('0x19')]},'passwordResetAt':{'type':Sequelize[_0xe4ff('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xe4ff('0x42')]},'showWebBar':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x0,'set':function(_0x4f079d){this[_0xe4ff('0x5')](_0xe4ff('0x43'),_0x4f079d);var _0x516278=this['get']({'plain':!![]});switch(_0x4f079d){case 0x0:case 0x1:var _0x557576=_0x516278[_0xe4ff('0x26')]?_[_0xe4ff('0x44')](_0x516278[_0xe4ff('0x26')])?_0x516278[_0xe4ff('0x26')][_0xe4ff('0x27')]():_0x516278[_0xe4ff('0x26')]:_0xe4ff('0x25');if(_0x557576===_0xe4ff('0x45')){_0x557576=_0xe4ff('0x25');}this['setDataValue'](_0xe4ff('0x26'),_0x557576);this[_0xe4ff('0x5')](_0xe4ff('0x46'),'no');this[_0xe4ff('0x5')](_0xe4ff('0x47'),null);this[_0xe4ff('0x5')]('force_avp',null);this[_0xe4ff('0x5')](_0xe4ff('0x48'),null);this['setDataValue'](_0xe4ff('0x49'),null);this['setDataValue'](_0xe4ff('0x4a'),null);this[_0xe4ff('0x5')](_0xe4ff('0x4b'),null);this['setDataValue'](_0xe4ff('0x4c'),null);this[_0xe4ff('0x5')](_0xe4ff('0x4d'),null);this['setDataValue'](_0xe4ff('0x4e'),'no');break;case 0x2:this['setDataValue'](_0xe4ff('0x26'),_0xe4ff('0x45'));this[_0xe4ff('0x5')](_0xe4ff('0x46'),_0xe4ff('0x32'));this['setDataValue'](_0xe4ff('0x47'),_0xe4ff('0x32'));this[_0xe4ff('0x5')](_0xe4ff('0x4f'),'yes');this[_0xe4ff('0x5')](_0xe4ff('0x48'),_0xe4ff('0x32'));this['setDataValue'](_0xe4ff('0x49'),_0xe4ff('0x32'));this[_0xe4ff('0x5')](_0xe4ff('0x4a'),'no');this['setDataValue']('dtlssetup',_0xe4ff('0x41'));this[_0xe4ff('0x5')]('dtlscertfile',_0x516278[_0xe4ff('0x4c')]||_0xe4ff('0x50'));this['setDataValue'](_0xe4ff('0x4d'),_0x516278['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xe4ff('0x5')](_0xe4ff('0x4e'),_0xe4ff('0x32'));break;default:}}},'permissions':{'type':Sequelize[_0xe4ff('0x42')],'set':function(_0x353a3f){this[_0xe4ff('0x5')](_0xe4ff('0x51'),_0x353a3f?_0x353a3f[_0xe4ff('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0xe4ff('0x51'))?_['map'](this[_0xe4ff('0xb')]('permissions')[_0xe4ff('0x28')](','),function(_0x57c06d){return parseInt(_0x57c06d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe4ff('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xe4ff('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xe4ff('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xe4ff('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xe4ff('0x32'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe4ff('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe4ff('0xb')](_0xe4ff('0x52'))?this[_0xe4ff('0xb')](_0xe4ff('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe4ff('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe4ff('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x41861d){if(typeof _0x41861d===_0xe4ff('0x53')){var _0x331e7f=_0x41861d==='1'?!![]:_0x41861d==='0'?![]:_0x41861d===_0xe4ff('0x54')?!![]:_0x41861d===_0xe4ff('0x55')?![]:![];this[_0xe4ff('0x5')](_0xe4ff('0x56'),_0x331e7f);}else{this[_0xe4ff('0x5')](_0xe4ff('0x56'),_0x41861d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x495d2d){this[_0xe4ff('0x5')](_0xe4ff('0x57'),_0x495d2d);if(_0x495d2d===!![]){this[_0xe4ff('0x5')]('blockedAt',moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe4ff('0x14')](0x5)[_0xe4ff('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xe4ff('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x7651=['\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','getDataValue','split','inband','auto','rfc2833','yes','nonat','update','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','originate','uac','uas','fingerprint','certificate','active','actpass','TEXT','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','name','setDataValue','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','internal','toLowerCase','ENUM','admin','user','agent','local','INTEGER','accountcode'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x7651,0x134));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var _=require(_0x1765('0x2'));module[_0x1765('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1765('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x171cac){this['setDataValue'](_0x1765('0x4'),_0x171cac);this[_0x1765('0x5')]('defaultuser',_0x171cac);},'comment':_0x1765('0x6')},'fullname':{'type':Sequelize[_0x1765('0x7')],'allowNull':![],'set':function(_0x3babdb){this['setDataValue'](_0x1765('0x8'),_0x3babdb);this[_0x1765('0x5')](_0x1765('0x9'),util[_0x1765('0xa')]('\x22%s\x22\x20<%s>',_0x3babdb,this['getDataValue'](_0x1765('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1765('0x7')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x2cf939){if(_0x2cf939){this[_0x1765('0x5')]('email',_0x2cf939[_0x1765('0xc')]());}}},'role':{'type':Sequelize[_0x1765('0xd')](_0x1765('0xe'),_0x1765('0xf'),_0x1765('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x1765('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1765('0x7')],'defaultValue':_0x1765('0x11')},'internal':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':![],'unique':_0x1765('0xb'),'set':function(_0x466377){this[_0x1765('0x5')](_0x1765('0xb'),_0x466377);this[_0x1765('0x5')](_0x1765('0x13'),_0x466377);this['setDataValue'](_0x1765('0x9'),util[_0x1765('0xa')](_0x1765('0x14'),this['getDataValue']('fullname'),_0x466377));}},'salt':{'type':Sequelize[_0x1765('0x7')]},'phone':{'type':Sequelize[_0x1765('0x7')]},'mobile':{'type':Sequelize[_0x1765('0x7')]},'address':{'type':Sequelize[_0x1765('0x7')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1765('0x7')]},'country':{'type':Sequelize[_0x1765('0x7')]},'online':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1765('0x16')]},'voicePause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1765('0x7')],'defaultValue':_0x1765('0x17')},'lastPauseAt':{'type':Sequelize[_0x1765('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x1765('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x18'),_0x1765('0xf'),'peer'),'allowNull':!![],'defaultValue':_0x1765('0x18')},'context':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![],'defaultValue':_0x1765('0x19')},'callingpres':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x1a'),_0x1765('0x1b'),_0x1765('0x1c'),_0x1765('0x1d'),'PROHIB_NOT_SCREENED',_0x1765('0x1e'),'PROHIB_FAILED_SCREEN',_0x1765('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1765('0x20'),'set':function(_0x3fa8ad){this[_0x1765('0x5')](_0x1765('0x21'),_0x3fa8ad?_0x3fa8ad['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x1765('0x22')](_0x1765('0x21'))[_0x1765('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x1765('0xd')]('rfc2833','info','shortinfo',_0x1765('0x24'),_0x1765('0x25')),'allowNull':!![],'defaultValue':_0x1765('0x26')},'directmedia':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no',_0x1765('0x28'),_0x1765('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x58e034){this['setDataValue'](_0x1765('0x2a'),_0x58e034?_0x58e034[_0x1765('0x2b')](','):null);},'get':function(){return this[_0x1765('0x22')](_0x1765('0x2a'))?this[_0x1765('0x22')](_0x1765('0x2a'))['split'](','):null;},'comment':_0x1765('0x2c')},'callgroup':{'type':Sequelize[_0x1765('0x7')]},'namedcallgroup':{'type':Sequelize[_0x1765('0x7')]},'pickupgroup':{'type':Sequelize[_0x1765('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x1765('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x1765('0x7')],'allowNull':![],'defaultValue':_0x1765('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1765('0x2e'),'set':function(_0x3637cb){this[_0x1765('0x5')](_0x1765('0x2f'),_0x3637cb?_0x3637cb[_0x1765('0x2b')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1765('0x22')]('allow')?this[_0x1765('0x22')](_0x1765('0x2f'))[_0x1765('0x23')](';'):null;},'comment':_0x1765('0x30')},'autoframing':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3f142b){this['setDataValue']('insecure',_0x3f142b?_0x3f142b[_0x1765('0x2b')](','):null);},'get':function(){return this[_0x1765('0x22')](_0x1765('0x31'))?this[_0x1765('0x22')]('insecure')['split'](','):null;},'comment':_0x1765('0x32')},'trustrpid':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1765('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x1765('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1765('0x33')},'amaflags':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x1765('0x27')},'busylevel':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no',_0x1765('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1765('0xd')]('accept','refuse',_0x1765('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x1765('0x36'),_0x1765('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1765('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1765('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no',_0x1765('0x38'),_0x1765('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x3a'),'passive',_0x1765('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1765('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no',_0x1765('0x28'),_0x1765('0x29'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1765('0x7')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1765('0x3c')]},'showWebBar':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0,'set':function(_0x1a800f){this['setDataValue']('showWebBar',_0x1a800f);var _0x614889=this['get']({'plain':!![]});switch(_0x1a800f){case 0x0:case 0x1:var _0x536fc8=_0x614889[_0x1765('0x21')]?_[_0x1765('0x3d')](_0x614889[_0x1765('0x21')])?_0x614889[_0x1765('0x21')][_0x1765('0x2b')]():_0x614889[_0x1765('0x21')]:_0x1765('0x20');if(_0x536fc8===_0x1765('0x3e')){_0x536fc8='udp';}this['setDataValue'](_0x1765('0x21'),_0x536fc8);this[_0x1765('0x5')](_0x1765('0x3f'),'no');this[_0x1765('0x5')](_0x1765('0x40'),null);this[_0x1765('0x5')](_0x1765('0x41'),null);this['setDataValue']('icesupport',null);this[_0x1765('0x5')](_0x1765('0x42'),null);this[_0x1765('0x5')](_0x1765('0x43'),null);this[_0x1765('0x5')]('dtlssetup',null);this[_0x1765('0x5')](_0x1765('0x44'),null);this[_0x1765('0x5')](_0x1765('0x45'),null);this[_0x1765('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x1765('0x5')](_0x1765('0x21'),_0x1765('0x3e'));this[_0x1765('0x5')]('encryption',_0x1765('0x27'));this[_0x1765('0x5')](_0x1765('0x40'),_0x1765('0x27'));this[_0x1765('0x5')](_0x1765('0x41'),_0x1765('0x27'));this['setDataValue'](_0x1765('0x46'),'yes');this['setDataValue'](_0x1765('0x42'),_0x1765('0x27'));this[_0x1765('0x5')](_0x1765('0x43'),'no');this[_0x1765('0x5')]('dtlssetup',_0x1765('0x3b'));this[_0x1765('0x5')](_0x1765('0x44'),_0x614889[_0x1765('0x44')]||'/etc/pki/tls/certs/motion.crt');this[_0x1765('0x5')]('dtlsprivatekey',_0x614889[_0x1765('0x45')]||_0x1765('0x47'));this[_0x1765('0x5')](_0x1765('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x1765('0x3c')],'set':function(_0x366a3c){this[_0x1765('0x5')](_0x1765('0x49'),_0x366a3c?_0x366a3c['join'](','):[]);},'get':function(){return this[_0x1765('0x22')](_0x1765('0x49'))?_[_0x1765('0x4a')](this['getDataValue']('permissions')[_0x1765('0x23')](','),function(_0x33c817){return parseInt(_0x33c817,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1765('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1765('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1765('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1765('0xd')](_0x1765('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1765('0x7')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1765('0x4b')],'get':function(){return this[_0x1765('0x22')](_0x1765('0x4c'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x1765('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1765('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![],'set':function(_0xcac561){if(typeof _0xcac561==='string'){var _0x3576b4=_0xcac561==='1'?!![]:_0xcac561==='0'?![]:_0xcac561==='true'?!![]:_0xcac561==='false'?![]:![];this[_0x1765('0x5')](_0x1765('0x4d'),_0x3576b4);}else{this['setDataValue'](_0x1765('0x4d'),_0xcac561);}}},'blocked':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![],'set':function(_0x40d2f0){this[_0x1765('0x5')](_0x1765('0x4e'),_0x40d2f0);if(_0x40d2f0===!![]){this[_0x1765('0x5')](_0x1765('0x4f'),moment());this[_0x1765('0x5')](_0x1765('0x50'),0x0);}else{this[_0x1765('0x5')](_0x1765('0x4f'),null);}}},'blockedAt':{'type':Sequelize[_0x1765('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1765('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1765('0x12')](0x5)[_0x1765('0x51')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1765('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1765('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 06319a1..4b4d990 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 _0xc4aa=['dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','queues','isEmpty','teams','col','toString','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','offline','pause','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','field','ui.','InteractionId','OpenTabs','moment','bluebird','util','path','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','register','redis','defaults','localhost','client','http','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','get','role','admin','user','agent','telephone','filter','ignore','map','value','includes','find','name','destroy','then','sendStatus','stack','send','index','User','rawAttributes','fieldName','password','salt','getOptions','where','include','attributes','push','findAll','rows','openTabs','true','chat','dataValues','sms','fax','mail','show','params','differenceBy','keys','query','filters','intersection','model','fields','length','includeAll','merge','openchannel','whatsapp','all','update','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','permissions','102','110','105','108','109','100','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','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','Agents','autoAssociation','compact','UserProfileResource','changePassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','emit','VoiceQueue','format','each','upsert','remove','isArray','QueueId','Queue:remove','voice','UserVoiceQueueRt','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','order','sort','pick','options','hasOwnProperty','List','Tag','Tags','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','SIP/%s','intrf','user:%s','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','logout','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','Whatsapp','getOpenchannelQueues','flatten','addAgent','getDataValue','Queue:save','TeamVoicePrefix','UserVoicePrefix','getWhatsappQueues','getFaxQueues','Fax','Openchannel','transaction','VoicePrefixId','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$overlap','$any','lastName'];(function(_0x3526e8,_0xa99704){var _0x235a9c=function(_0x4ffb2c){while(--_0x4ffb2c){_0x3526e8['push'](_0x3526e8['shift']());}};_0x235a9c(++_0xa99704);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var moment=require(_0xac4a('0x0'));var BPromise=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var path=require(_0xac4a('0x3'));var fs=require('fs');var _=require(_0xac4a('0x4'));var squel=require(_0xac4a('0x5'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac4a('0x6'));var logger=require(_0xac4a('0x7'))(_0xac4a('0x8'));var utils=require(_0xac4a('0x9'));var config=require(_0xac4a('0xa'));var licenseUtil=require(_0xac4a('0xb'));var db=require(_0xac4a('0xc'))['db'];var socket=require(_0xac4a('0xd'))(new Redis(config['redis']));require('./user.socket')[_0xac4a('0xe')](socket);config[_0xac4a('0xf')]=_[_0xac4a('0x10')](config['redis'],{'host':_0xac4a('0x11'),'port':0x18eb});var client=jayson[_0xac4a('0x12')][_0xac4a('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4d4acc,_0x30135d,_0x488e3c,_0x2f062c){return new BPromise(function(_0x4855b6,_0x333ca5){var _0x2a0776=_0x2f062c||client;return _0x2a0776[_0xac4a('0x14')](_0x4d4acc,_0x488e3c)['then'](function(_0x21a79){logger[_0xac4a('0x15')](_0xac4a('0x16'),_0x30135d,_0xac4a('0x17'));logger[_0xac4a('0x18')](_0xac4a('0x19'),_0x30135d,_0xac4a('0x17'),JSON[_0xac4a('0x1a')](_0x21a79));if(_0x21a79[_0xac4a('0x1b')]){if(_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1c')]===0x1f4){logger[_0xac4a('0x1b')]('User,\x20%s,\x20%s',_0x30135d,_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);return _0x333ca5(_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);}logger[_0xac4a('0x1b')](_0xac4a('0x16'),_0x30135d,_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);return _0x4855b6(_0x21a79['error']['message']);}else{logger[_0xac4a('0x15')](_0xac4a('0x16'),_0x30135d,_0xac4a('0x17'));_0x4855b6(_0x21a79['result'][_0xac4a('0x1d')]);}})[_0xac4a('0x1e')](function(_0x3752e4){logger[_0xac4a('0x1b')](_0xac4a('0x16'),_0x30135d,_0x3752e4);_0x333ca5(_0x3752e4);});});}function respondWithStatusCode(_0x3e829c,_0xe38996){_0xe38996=_0xe38996||0xcc;return function(_0x3ca790){if(_0x3ca790){return _0x3e829c['sendStatus'](_0xe38996);}return _0x3e829c[_0xac4a('0x1f')](_0xe38996)[_0xac4a('0x20')]();};}function respondWithResult(_0x599787,_0x3d7ce0){_0x3d7ce0=_0x3d7ce0||0xc8;return function(_0x4169c0){if(_0x4169c0){return _0x599787[_0xac4a('0x1f')](_0x3d7ce0)[_0xac4a('0x21')](_0x4169c0);}};}function respondWithFilteredResult(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){var _0x15435c=typeof _0x1b7998[_0xac4a('0x22')]===_0xac4a('0x23')&&typeof _0x1b7998[_0xac4a('0x24')]===_0xac4a('0x23');var _0x36054a=_0x2503d8[_0xac4a('0x25')];var _0x3bc318=_0x15435c?0x0:_0x1b7998[_0xac4a('0x22')];var _0x215a31=_0x15435c?_0x2503d8[_0xac4a('0x25')]:_0x1b7998[_0xac4a('0x22')]+_0x1b7998[_0xac4a('0x24')];var _0x20202c;if(_0x215a31>=_0x36054a){_0x215a31=_0x36054a;_0x20202c=0xc8;}else{_0x20202c=0xce;}_0x4d2d6c['status'](_0x20202c);return _0x4d2d6c[_0xac4a('0x26')](_0xac4a('0x27'),_0x3bc318+'-'+_0x215a31+'/'+_0x36054a)[_0xac4a('0x21')](_0x2503d8);}return null;};}function saveUpdates(_0x2772fe){return function(_0x116700){if(_0x116700){return _0x116700['update'](_0x2772fe)['then'](function(_0xdb7e){return _0xdb7e;});}return null;};}function removeEntity(_0x7a948b){return function(_0x1f12d5){if(_0x1f12d5){return _0x1f12d5['destroy']()['then'](function(){var _0x355755=_0x1f12d5[_0xac4a('0x28')]({'plain':!![]});if(_0x355755[_0xac4a('0x29')]===_0xac4a('0x2a'))return;var _0x17118e=[{'name':'Users','value':_0xac4a('0x2b'),'ignore':!![]},{'name':'Agents','value':_0xac4a('0x2c'),'ignore':![]},{'name':'Telephones','value':_0xac4a('0x2d'),'ignore':![]}];var _0xfbe355=_(_0x17118e)[_0xac4a('0x2e')](_0xac4a('0x2f'))[_0xac4a('0x30')](_0xac4a('0x31'))[_0xac4a('0x31')]();if(_[_0xac4a('0x32')](_0xfbe355,_0x355755[_0xac4a('0x29')])){return;}var _0xfd7c16=_[_0xac4a('0x33')](_0x17118e,[_0xac4a('0x31'),_0x355755[_0xac4a('0x29')]])[_0xac4a('0x34')];return db['UserProfileResource'][_0xac4a('0x35')]({'where':{'type':_0xfd7c16,'resourceId':_0x355755['id']}})[_0xac4a('0x36')](function(){return _0x1f12d5;});})['then'](function(){_0x7a948b[_0xac4a('0x1f')](0xcc)[_0xac4a('0x20')]();});}};}function handleEntityNotFound(_0x565164){return function(_0x58804b){if(!_0x58804b){_0x565164[_0xac4a('0x37')](0x194);}return _0x58804b;};}function handleError(_0x1ba096,_0x1b42b6){_0x1b42b6=_0x1b42b6||0x1f4;return function(_0x3de9e2){logger['error'](_0x3de9e2[_0xac4a('0x38')]);if(_0x3de9e2[_0xac4a('0x34')]){delete _0x3de9e2['name'];}_0x1ba096[_0xac4a('0x1f')](_0x1b42b6)[_0xac4a('0x39')](_0x3de9e2);};}exports[_0xac4a('0x3a')]=function(_0x5f0eb8,_0x121328){var _0x357f06={},_0x1b5427={'count':0x0,'rows':[]};var _0x4e0445=_(db[_0xac4a('0x3b')][_0xac4a('0x3c')])['map'](function(_0x59bebf){return{'name':_0x59bebf[_0xac4a('0x3d')],'type':_0x59bebf['type']['key']};})['filter'](function(_0x4fee3a){return!_[_0xac4a('0x32')]([_0xac4a('0x3e'),_0xac4a('0x3f')],_0x4fee3a[_0xac4a('0x34')]);})[_0xac4a('0x31')]();_0x357f06=qs[_0xac4a('0x40')](_0x4e0445,_0x5f0eb8);var _0x4220e2={'where':_0x357f06[_0xac4a('0x41')]};return db[_0xac4a('0x3b')][_0xac4a('0x25')](_0x4220e2)[_0xac4a('0x36')](function(_0x1c2a87){_0x1b5427['count']=_0x1c2a87;if(_0x5f0eb8['query']['includeAll']){_0x357f06[_0xac4a('0x42')]=[{'all':!![]}];}if(!_[_0xac4a('0x32')](_0x357f06[_0xac4a('0x43')],'id')){_0x357f06[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db[_0xac4a('0x3b')][_0xac4a('0x45')](_0x357f06);})[_0xac4a('0x36')](function(_0x3e9973){_0x1b5427[_0xac4a('0x46')]=_0x3e9973;if(_0x5f0eb8['query'][_0xac4a('0x47')]===_0xac4a('0x48')){var _0x3d9595=[];for(var _0x3f24a1=0x0;_0x3f24a1<_0x1b5427[_0xac4a('0x46')]['length'];_0x3f24a1++){_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x49'),_0x1b5427['rows'][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595['push'](get_open_tabs(_0xac4a('0x4b'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('openchannel',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('whatsapp',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));}return BPromise['all'](_0x3d9595)[_0xac4a('0x36')](function(_0x5a7f6e){return _0x1b5427;});}else{return _0x1b5427;}})[_0xac4a('0x36')](respondWithFilteredResult(_0x121328,_0x357f06))[_0xac4a('0x1e')](handleError(_0x121328,null));};exports[_0xac4a('0x4e')]=function(_0x5e3581,_0x588374){var _0x42fd9d={'raw':![],'where':{'id':_0x5e3581[_0xac4a('0x4f')]['id']}},_0x4aaeff={};_0x4aaeff['model']=_[_0xac4a('0x50')](_['keys'](db[_0xac4a('0x3b')][_0xac4a('0x3c')]),[_0xac4a('0x3e'),_0xac4a('0x3f')]);_0x4aaeff['query']=_[_0xac4a('0x51')](_0x5e3581[_0xac4a('0x52')]);_0x4aaeff[_0xac4a('0x53')]=_[_0xac4a('0x54')](_0x4aaeff[_0xac4a('0x55')],_0x4aaeff[_0xac4a('0x52')]);_0x42fd9d[_0xac4a('0x43')]=_['intersection'](_0x4aaeff[_0xac4a('0x55')],qs[_0xac4a('0x56')](_0x5e3581['query'][_0xac4a('0x56')]));_0x42fd9d[_0xac4a('0x43')]=_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x57')]?_0x42fd9d['attributes']:_0x4aaeff[_0xac4a('0x55')];if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x58')]){_0x42fd9d[_0xac4a('0x42')]=[{'all':!![]}];}_0x42fd9d=_[_0xac4a('0x59')]({},_0x42fd9d,_0x5e3581['options']);if(!_[_0xac4a('0x32')](_0x42fd9d['attributes'],'id')){_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db['User']['find'](_0x42fd9d)[_0xac4a('0x36')](handleEntityNotFound(_0x588374,null))[_0xac4a('0x36')](function(_0x4d448f){var _0x18d29c=[];values=_0x4d448f;if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x47')]===_0xac4a('0x48')){_0x18d29c['push'](get_open_tabs(_0xac4a('0x49'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x4d448f['dataValues']));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x4d448f[_0xac4a('0x4a')]));return BPromise[_0xac4a('0x5c')](_0x18d29c);}else{return values;}})[_0xac4a('0x36')](function(_0x38dd4f){return values;})[_0xac4a('0x36')](respondWithResult(_0x588374,null))[_0xac4a('0x1e')](handleError(_0x588374,null));};exports[_0xac4a('0x5d')]=function(_0x11c753,_0x492aae){if(_0x11c753[_0xac4a('0x5e')]['id']){delete _0x11c753['body']['id'];}delete _0x11c753[_0xac4a('0x5e')]['role'];return db[_0xac4a('0x3b')]['find']({'where':{'id':_0x11c753[_0xac4a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x492aae,null))['then'](saveUpdates(_0x11c753[_0xac4a('0x5e')],null))[_0xac4a('0x36')](respondWithResult(_0x492aae,null))[_0xac4a('0x1e')](handleError(_0x492aae,null));};exports[_0xac4a('0x5f')]=function(_0x2f9940,_0xb7b884){return db['User'][_0xac4a('0x5f')]()['then'](respondWithResult(_0xb7b884,null))[_0xac4a('0x1e')](handleError(_0xb7b884,null));};exports['addContacts']=function(_0x347880,_0x19ce2c){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x347880[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x19ce2c,null))[_0xac4a('0x36')](function(_0xe3e375){if(_0xe3e375){return _0xe3e375[_0xac4a('0x60')](_0x347880[_0xac4a('0x5e')][_0xac4a('0x61')],_[_0xac4a('0x62')](_0x347880[_0xac4a('0x5e')],[_0xac4a('0x61'),'id'])||{});}})[_0xac4a('0x36')](respondWithResult(_0x19ce2c,null))[_0xac4a('0x1e')](handleError(_0x19ce2c,null));};function validateUser(_0x38cb4f){return new BPromise(function(_0x4a0156,_0xa90d71){if(_0x38cb4f[_0xac4a('0x63')])return _0x4a0156(_0x38cb4f);return db['Setting'][_0xac4a('0x64')](0x1)[_0xac4a('0x36')](function(_0x2d24c7){if(_0x2d24c7[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x38cb4f['password']);db['User'][_0xac4a('0x67')](_0xac4a('0x63'))[_0xac4a('0x36')](function(_0x148288){if(_[_0xac4a('0x68')](_0x148288)){_0x38cb4f[_0xac4a('0x63')]=_0x2d24c7[_0xac4a('0x69')]||0x1;return;}if(_[_0xac4a('0x68')](_0x2d24c7[_0xac4a('0x69')])||_0x2d24c7[_0xac4a('0x69')]===_0x148288){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;return;}if(_0x2d24c7['min_internal']>_0x148288){_0x38cb4f['internal']=_0x2d24c7[_0xac4a('0x69')];return;}return db[_0xac4a('0x6a')][_0xac4a('0x52')](_0xac4a('0x6b'),{'type':db[_0xac4a('0x6a')][_0xac4a('0x6c')][_0xac4a('0x6d')]})[_0xac4a('0x36')](function(_0x453d62){if(_0x453d62&&_0x453d62[_0xac4a('0x57')]){for(var _0xb09b89=0x0,_0xb12cc5=_0x453d62['length'];_0xb09b89<_0xb12cc5&&_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')]);_0xb09b89++){if(_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89][_0xac4a('0x6e')]){_0x38cb4f['internal']=_0x453d62[_0xb09b89][_0xac4a('0x6e')];}else if(_0x2d24c7['min_internal']>_0x453d62[_0xb09b89][_0xac4a('0x6e')]&&_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89]['to']){_0x38cb4f['internal']=_0x2d24c7['min_internal'];}}}if(_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')])){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;}return _0x4a0156(_0x38cb4f);});});})['catch'](function(_0x3a0cf8){_0xa90d71(_0x3a0cf8);});});}function updateUser(_0x4d067d){return new BPromise(function(_0x114b11,_0x4a88c7){try{if(_0x4d067d['voicemail']){_0x4d067d[_0xac4a('0x6f')]=_0x4d067d['internal'];_0x4d067d[_0xac4a('0x70')]={'mailbox':_0x4d067d['internal'],'password':_0x4d067d[_0xac4a('0x3e')],'fullname':_0x4d067d[_0xac4a('0x71')],'email':_0x4d067d['email']};}if(_0x4d067d[_0xac4a('0x29')]==='agent'){if(!_0x4d067d[_0xac4a('0x72')])_0x4d067d[_0xac4a('0x72')]=['101',_0xac4a('0x73'),'103','113',_0xac4a('0x74'),'104',_0xac4a('0x75'),'106','107',_0xac4a('0x76'),_0xac4a('0x77'),_0xac4a('0x78'),'111','114',_0xac4a('0x79')];}_0x114b11(_0x4d067d);}catch(_0x9c0fa1){_0x4a88c7(_0x9c0fa1);}});}exports['create']=function(_0x4e93f5,_0x3824a2){if(_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2c'))throw new Error(_0xac4a('0x7a'));if(_0x4e93f5[_0xac4a('0x5e')][_0xac4a('0x29')]===_0xac4a('0x2b')&&_0x4e93f5[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_0x4e93f5[_0xac4a('0x5e')]['role']===_0xac4a('0x2a')&&_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7c'));}return licenseUtil['checkUserLimits']([_0x4e93f5[_0xac4a('0x5e')]])[_0xac4a('0x36')](function(){return validateUser(_0x4e93f5[_0xac4a('0x5e')]);})[_0xac4a('0x36')](function(_0x72c90c){return updateUser(_0x72c90c)[_0xac4a('0x36')](function(_0xd7bdd6){if(_0xd7bdd6['role']===_0xac4a('0x2a')){_0xd7bdd6[_0xac4a('0x7d')]=_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7d')];delete _0xd7bdd6[_0xac4a('0x7e')];}return _0xd7bdd6;});})[_0xac4a('0x36')](function(_0x547eec){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x547eec,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]});})['then'](function(_0x21a384){if(_0x4e93f5['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x21a384;if(_0x4e93f5['user']['role']!==_0xac4a('0x2b'))return _0x21a384;return db[_0xac4a('0x80')][_0xac4a('0x33')]({'where':{'name':_0x21a384['role']===_0xac4a('0x2c')?'Agents':_0xac4a('0x81'),'userProfileId':_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x2e2c92){if(!_0x2e2c92||_0x2e2c92['autoAssociation']!=0x0)return _0x21a384;return db['UserProfileResource'][_0xac4a('0x7f')]({'name':_0x21a384[_0xac4a('0x34')],'resourceId':_0x21a384['id'],'type':_0x2e2c92[_0xac4a('0x34')],'sectionId':_0x2e2c92['id']},{})[_0xac4a('0x36')](function(){return _0x21a384;});})[_0xac4a('0x1e')](function(_0x3c5bbc){logger[_0xac4a('0x1b')](_0xac4a('0x82'),_0x3c5bbc);throw _0x3c5bbc;});})['then'](respondWithResult(_0x3824a2,0xc9))['catch'](handleError(_0x3824a2,null));};exports[_0xac4a('0x83')]=function(_0x31cc9a,_0x247eee){var _0x950e60=_0x31cc9a[_0xac4a('0x5e')];var _0x2ea4a4=[];if(_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]==='agent')throw new Error('Unauthorized');if(_[_0xac4a('0x84')](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2b')])&&_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_['some'](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2a')])&&_0x31cc9a[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x85'));}return licenseUtil[_0xac4a('0x86')](_0x950e60)[_0xac4a('0x36')](function(){return validateUser(_0x950e60[0x0]);})[_0xac4a('0x36')](function(){for(var _0x27d023=0x1;_0x27d023<_0x950e60[_0xac4a('0x57')];_0x27d023++){var _0x2ef42a=_0x950e60[_0x27d023-0x1][_0xac4a('0x63')];if(!_0x950e60[_0x27d023]['internal'])_0x950e60[_0x27d023][_0xac4a('0x63')]=_0x2ef42a+0x1;_0x2ea4a4['push'](validateUser(_0x950e60[_0x27d023]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){_0x2ea4a4=[];for(var _0x3184b3=0x0;_0x3184b3<_0x950e60[_0xac4a('0x57')];_0x3184b3++){_0x2ea4a4[_0xac4a('0x44')](updateUser(_0x950e60[_0x3184b3]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){return BPromise['each'](_0x950e60,function(_0x2b883a){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x2b883a,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]})['then'](function(_0x1b37d9){_0x2b883a['id']=_0x1b37d9['id'];return _0x2b883a;});});})[_0xac4a('0x36')](function(_0x4f2b19){if(_0x31cc9a['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x4f2b19;if(_0x31cc9a['user'][_0xac4a('0x29')]!==_0xac4a('0x2b'))return _0x4f2b19;var _0x6afaba=_[_0xac4a('0x84')](_0x4f2b19,function(_0x31df2d){return _0x31df2d[_0xac4a('0x29')]==='agent'||_0x31df2d[_0xac4a('0x29')]===_0xac4a('0x2d');});if(!_0x6afaba)return _0x4f2b19;return db[_0xac4a('0x80')]['findAll']({'where':{'name':{'$or':[_0xac4a('0x87'),_0xac4a('0x81')]},'userProfileId':_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x23d635){if(_['isEmpty'](_0x23d635)||!_[_0xac4a('0x84')](_0x23d635,[_0xac4a('0x88'),0x0]))return _0x4f2b19;_0x2ea4a4=[];var _0x5ab83b=_(_0x23d635)[_0xac4a('0x30')](function(_0x55054a){if(_0x55054a[_0xac4a('0x88')]===0x1)return;return _0x55054a[_0xac4a('0x34')]==='Agents'?_0xac4a('0x2c'):'telephone';})[_0xac4a('0x89')]()['value']();for(var _0x3c601e=0x0;_0x3c601e<_0x4f2b19[_0xac4a('0x57')];_0x3c601e++){if(!_[_0xac4a('0x32')](_0x5ab83b,_0x4f2b19[_0x3c601e][_0xac4a('0x29')]))return;var _0xc38492=_0x4f2b19[_0x3c601e][_0xac4a('0x29')]===_0xac4a('0x2c')?_0xac4a('0x87'):_0xac4a('0x81');_0x2ea4a4[_0xac4a('0x44')](db[_0xac4a('0x8a')][_0xac4a('0x7f')]({'name':_0x4f2b19[_0x3c601e][_0xac4a('0x34')],'resourceId':_0x4f2b19[_0x3c601e]['id'],'type':_0xc38492,'sectionId':_[_0xac4a('0x33')](_0x23d635,['name',_0xc38492])['id']},{}));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);});})[_0xac4a('0x36')](respondWithResult(_0x247eee,0xc9))['catch'](handleError(_0x247eee,null));};exports[_0xac4a('0x8b')]=function(_0x31d190,_0x1b10ad){if(_0x31d190[_0xac4a('0x5e')]['id']){delete _0x31d190[_0xac4a('0x5e')]['id'];}return db['User'][_0xac4a('0x33')]({'where':{'id':_0x31d190['params']['id']}})[_0xac4a('0x36')](function(_0x28ae76){if(!_0x28ae76)return null;if(_0x28ae76['id']===_0x31d190[_0xac4a('0x2b')]['id']){if(!_0x31d190[_0xac4a('0x5e')]['oldPassword']||!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x8e'));}if(!_0x28ae76['authenticate'](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')])){throw new db[(_0xac4a('0x8c'))]['ValidationError'](_0xac4a('0x90'));}if(_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')]===_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')]){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x92'));}}else if(_0x31d190['user'][_0xac4a('0x29')]==='admin'){if(!_0x31d190['body']['newPassword']){throw new db['Sequelize']['ValidationError'](_0xac4a('0x93'));}}else if(_0x31d190[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2b')){if(!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x93'));}if(_0x28ae76[_0xac4a('0x29')]!==_0xac4a('0x2c')){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}}else{throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}return _0x28ae76;})[_0xac4a('0x36')](handleEntityNotFound(_0x1b10ad,null))[_0xac4a('0x36')](function(_0x303d5d){return db[_0xac4a('0x94')][_0xac4a('0x95')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xac4a('0x96')]})[_0xac4a('0x36')](function(_0x51993a){if(_0x51993a[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x31d190['body']['newPassword']);if(!_0x51993a[_0xac4a('0x97')]||!_0x303d5d[_0xac4a('0x98')])return _0x303d5d;authService[_0xac4a('0x99')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d['previousPasswords'],_0x51993a[_0xac4a('0x96')]);return _0x303d5d;})['then'](saveUpdates({'password':_0x31d190['body']['newPassword'],'passwordResetAt':_0x31d190[_0xac4a('0x2b')]['id']==_0x31d190[_0xac4a('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xac4a('0x9a')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d[_0xac4a('0x98')])},null));})[_0xac4a('0x36')](respondWithResult(_0x1b10ad,null))[_0xac4a('0x1e')](handleError(_0x1b10ad,null));};exports['addQueues']=function(_0x5e1662,_0x53bcbc){var _0x3305a5=_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x9b')];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5e1662[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29'),_0xac4a('0x9c'),_0xac4a('0x9d'),_0xac4a('0x9e'),_0xac4a('0x9f')]})[_0xac4a('0x36')](handleEntityNotFound(_0x53bcbc,null))[_0xac4a('0x36')](function(_0x356a6b){if(_0x356a6b){if(!utils[_0xac4a('0xa0')](_0x3305a5)){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x356a6b[_0xac4a('0xa2')+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+_0xac4a('0xa5')](_0x5e1662['body'][_0xac4a('0x61')],{'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0})[_0xac4a('0xa7')](function(_0x237312){for(var _0x31afd2=0x0;_0x31afd2<_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]['length'];_0x31afd2+=0x1){var _0x5127ea={'UserId':Number(_0x5e1662[_0xac4a('0x4f')]['id'])};_0x5127ea[_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'QueueId']=Number(_0x5e1662['body']['ids'][_0x31afd2]);socket[_0xac4a('0xa8')]('user'+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'Queue:save',_0x5127ea);}return _0x237312;})[_0xac4a('0x36')](function(){if(_0x3305a5==='voice'){return db[_0xac4a('0xa9')][_0xac4a('0x45')]({'where':{'id':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]||[]},'raw':!![],'attributes':['id',_0xac4a('0x34')]});}})[_0xac4a('0x36')](function(_0x5e0602){var _0x25bf23=_0x356a6b[_0xac4a('0x28')]({'plain':!![]});var _0x2c03a1=[];if(_0x3305a5==='voice'&&_0x25bf23[_0xac4a('0x29')]===_0xac4a('0x2c')&&_0x25bf23[_0xac4a('0x9c')]){for(var _0x247856=0x0;_0x247856<_0x5e0602['length'];_0x247856+=0x1){_0x2c03a1[_0xac4a('0x44')]({'membername':_0x25bf23[_0xac4a('0x34')],'UserId':_0x25bf23['id'],'queue_name':_0x5e0602[_0x247856][_0xac4a('0x34')],'VoiceQueueId':_0x5e0602[_0x247856]['id'],'interface':_[_0xac4a('0x68')](_0x25bf23[_0xac4a('0x9f')])?util[_0xac4a('0xaa')]('SIP/%s',_0x25bf23['name']):_0x25bf23[_0xac4a('0x9f')],'paused':_0x25bf23[_0xac4a('0x9e')]||![],'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0});}return BPromise[_0xac4a('0xab')](_0x2c03a1,function(_0x1a12a2){return db['UserVoiceQueueRt'][_0xac4a('0xac')](_0x1a12a2);});}return _0x356a6b;});}})['then'](respondWithStatusCode(_0x53bcbc,null))[_0xac4a('0x1e')](handleError(_0x53bcbc,null));};exports['removeQueues']=function(_0xa1df14,_0x13b938){var _0x15f35a;return db[_0xac4a('0x3b')]['find']({'where':{'id':_0xa1df14[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29')]})[_0xac4a('0x36')](handleEntityNotFound(_0x13b938,null))[_0xac4a('0x36')](function(_0x520001){if(_0x520001){_0x15f35a=_0x520001;if(!_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')]||!utils[_0xac4a('0xa0')](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')])){throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x520001[_0xac4a('0xad')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+'Queues'](_0xa1df14['query'][_0xac4a('0x61')]);}})[_0xac4a('0x36')](function(_0x17f815){if(_[_0xac4a('0xae')](_0xa1df14[_0xac4a('0x52')]['ids'])){for(var _0x293d49=0x0;_0x293d49<_0xa1df14[_0xac4a('0x52')]['ids'][_0xac4a('0x57')];_0x293d49+=0x1){var _0x11faad={'UserId':Number(_0xa1df14[_0xac4a('0x4f')]['id'])};_0x11faad[_['capitalize'](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')][_0x293d49]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14['query'][_0xac4a('0x9b')][_0xac4a('0xa4')]())+'Queue:remove',_0x11faad);}}else{var _0x11faad={'UserId':Number(_0xa1df14['params']['id'])};_0x11faad[_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel'][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+_0xac4a('0xb0'),_0x11faad);}return _0x17f815;})['then'](function(){if(_0xa1df14['query'][_0xac4a('0x9b')]===_0xac4a('0xb1')){return db[_0xac4a('0xb2')]['destroy']({'where':{'UserId':_0xa1df14[_0xac4a('0x4f')]['id'],'VoiceQueueId':_0xa1df14[_0xac4a('0x52')]['ids']},'individualHooks':!![]})['then'](function(){return _0x15f35a;});}return _0x15f35a;})[_0xac4a('0x36')](respondWithStatusCode(_0x13b938,null))[_0xac4a('0x1e')](handleError(_0x13b938,null));};exports[_0xac4a('0xb3')]=function(_0x368546,_0x4fadd1){_0x368546[_0xac4a('0x5e')][_0xac4a('0xb4')]=_0x368546[_0xac4a('0xb5')]['filename'];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x368546[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x4fadd1,null))[_0xac4a('0x36')](saveUpdates(_0x368546['body'],null))['then'](respondWithResult(_0x4fadd1,null))[_0xac4a('0x1e')](handleError(_0x4fadd1,null));};exports[_0xac4a('0xb6')]=function(_0x1774e5,_0x110e16){var _0x14ca03=path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xb9'));return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x1774e5[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0xb4')],'raw':!![]})[_0xac4a('0x36')](handleEntityNotFound(_0x110e16,null))['then'](function(_0x3ef9b2){if(_0x3ef9b2){if(_['isNil'](_0x3ef9b2['userpic'])){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}else{if(!fs[_0xac4a('0xbb')](path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]))){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}return _0x110e16[_0xac4a('0xba')](path[_0xac4a('0xb7')](config['root'],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]));}}})[_0xac4a('0x1e')](handleError(_0x110e16,null));};exports[_0xac4a('0xbd')]=function(_0x5c0bb8,_0x5b1934){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5c0bb8[_0xac4a('0x4f')]['id']},'attributes':['id']})[_0xac4a('0x36')](handleEntityNotFound(_0x5b1934,null))[_0xac4a('0x36')](function(_0x254de8){var _0x1c7ea7=[];values=_0x254de8[_0xac4a('0x4a')];_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('chat',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x254de8['dataValues']));_0x1c7ea7['push'](get_open_tabs('whatsapp',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('fax',_0x254de8['dataValues']));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('mail',_0x254de8[_0xac4a('0x4a')]));return BPromise['all'](_0x1c7ea7);})[_0xac4a('0x36')](function(_0x2abd82){var _0x1888c3=[];if(_0x2abd82){for(var _0x27e640=0x0;_0x27e640=_0x562952){_0x3233d7=_0x562952;_0x1d0d3f=0xc8;}else{_0x1d0d3f=0xce;}_0x54a8b0[_0x04c6('0x1c')](_0x1d0d3f);return _0x54a8b0['set'](_0x04c6('0x22'),_0x2ab1d2+'-'+_0x3233d7+'/'+_0x562952)[_0x04c6('0x23')](_0x348ea3);}return null;};}function saveUpdates(_0x5f1331){return function(_0x5c9003){if(_0x5c9003){return _0x5c9003[_0x04c6('0x24')](_0x5f1331)[_0x04c6('0x25')](function(_0x2a191f){return _0x2a191f;});}return null;};}function removeEntity(_0xbb9e81){return function(_0x23c500){if(_0x23c500){return _0x23c500[_0x04c6('0x26')]()['then'](function(){var _0x5d8c88=_0x23c500['get']({'plain':!![]});if(_0x5d8c88[_0x04c6('0x27')]==='admin')return;var _0x1e76e2=[{'name':_0x04c6('0x28'),'value':'user','ignore':!![]},{'name':_0x04c6('0x29'),'value':_0x04c6('0x2a'),'ignore':![]},{'name':_0x04c6('0x2b'),'value':_0x04c6('0x2c'),'ignore':![]}];var _0x5b2056=_(_0x1e76e2)[_0x04c6('0x2d')](_0x04c6('0x2e'))[_0x04c6('0x2f')](_0x04c6('0x30'))[_0x04c6('0x30')]();if(_[_0x04c6('0x31')](_0x5b2056,_0x5d8c88[_0x04c6('0x27')])){return;}var _0x46380e=_[_0x04c6('0x32')](_0x1e76e2,[_0x04c6('0x30'),_0x5d8c88[_0x04c6('0x27')]])[_0x04c6('0x33')];return db[_0x04c6('0x34')][_0x04c6('0x26')]({'where':{'type':_0x46380e,'resourceId':_0x5d8c88['id']}})[_0x04c6('0x25')](function(){return _0x23c500;});})['then'](function(){_0xbb9e81[_0x04c6('0x1c')](0xcc)[_0x04c6('0x1d')]();});}};}function handleEntityNotFound(_0x332811){return function(_0x206e32){if(!_0x206e32){_0x332811['sendStatus'](0x194);}return _0x206e32;};}function handleError(_0x181736,_0x31de0f){_0x31de0f=_0x31de0f||0x1f4;return function(_0x4e1cfa){logger['error'](_0x4e1cfa['stack']);if(_0x4e1cfa[_0x04c6('0x33')]){delete _0x4e1cfa[_0x04c6('0x33')];}_0x181736['status'](_0x31de0f)[_0x04c6('0x35')](_0x4e1cfa);};}exports['index']=function(_0x15c270,_0x1373ca){var _0x3806ea={},_0x2b28cd={'count':0x0,'rows':[]};var _0x5144f5=_(db['User'][_0x04c6('0x36')])[_0x04c6('0x2f')](function(_0x50041f){return{'name':_0x50041f[_0x04c6('0x37')],'type':_0x50041f['type']['key']};})[_0x04c6('0x2d')](function(_0x5aede6){return!_[_0x04c6('0x31')]([_0x04c6('0x38'),'salt'],_0x5aede6[_0x04c6('0x33')]);})['value']();_0x3806ea=qs[_0x04c6('0x39')](_0x5144f5,_0x15c270);var _0x39513d={'where':_0x3806ea[_0x04c6('0x3a')]};return db[_0x04c6('0x3b')][_0x04c6('0x21')](_0x39513d)['then'](function(_0x297b25){_0x2b28cd['count']=_0x297b25;if(_0x15c270[_0x04c6('0x3c')]['includeAll']){_0x3806ea[_0x04c6('0x3d')]=[{'all':!![]}];}if(!_[_0x04c6('0x31')](_0x3806ea[_0x04c6('0x3e')],'id')){_0x3806ea[_0x04c6('0x3e')][_0x04c6('0x3f')]('id');}return db[_0x04c6('0x3b')][_0x04c6('0x40')](_0x3806ea);})['then'](function(_0xdfdc34){_0x2b28cd['rows']=_0xdfdc34;if(_0x15c270[_0x04c6('0x3c')]['openTabs']==='true'){var _0x463222=[];for(var _0x58a9ad=0x0;_0x58a9ad<_0x2b28cd[_0x04c6('0x41')][_0x04c6('0x42')];_0x58a9ad++){_0x463222[_0x04c6('0x3f')](get_open_tabs('chat',_0x2b28cd[_0x04c6('0x41')][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x44'),_0x2b28cd[_0x04c6('0x41')][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs('fax',_0x2b28cd['rows'][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x45'),_0x2b28cd['rows'][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x46'),_0x2b28cd['rows'][_0x58a9ad]['dataValues']));_0x463222['push'](get_open_tabs(_0x04c6('0x47'),_0x2b28cd[_0x04c6('0x41')][_0x58a9ad]['dataValues']));}return BPromise[_0x04c6('0x48')](_0x463222)[_0x04c6('0x25')](function(_0x2bd045){return _0x2b28cd;});}else{return _0x2b28cd;}})['then'](respondWithFilteredResult(_0x1373ca,_0x3806ea))[_0x04c6('0x1b')](handleError(_0x1373ca,null));};exports[_0x04c6('0x49')]=function(_0x5e68e0,_0x25a6fc){var _0x203943={'raw':![],'where':{'id':_0x5e68e0[_0x04c6('0x4a')]['id']}},_0x2472ed={};_0x2472ed['model']=_[_0x04c6('0x4b')](_[_0x04c6('0x4c')](db[_0x04c6('0x3b')][_0x04c6('0x36')]),['password',_0x04c6('0x4d')]);_0x2472ed[_0x04c6('0x3c')]=_[_0x04c6('0x4c')](_0x5e68e0[_0x04c6('0x3c')]);_0x2472ed['filters']=_[_0x04c6('0x4e')](_0x2472ed[_0x04c6('0x4f')],_0x2472ed[_0x04c6('0x3c')]);_0x203943['attributes']=_[_0x04c6('0x4e')](_0x2472ed[_0x04c6('0x4f')],qs[_0x04c6('0x50')](_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x50')]));_0x203943[_0x04c6('0x3e')]=_0x203943[_0x04c6('0x3e')][_0x04c6('0x42')]?_0x203943[_0x04c6('0x3e')]:_0x2472ed[_0x04c6('0x4f')];if(_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x51')]){_0x203943[_0x04c6('0x3d')]=[{'all':!![]}];}_0x203943=_['merge']({},_0x203943,_0x5e68e0[_0x04c6('0x52')]);if(!_[_0x04c6('0x31')](_0x203943[_0x04c6('0x3e')],'id')){_0x203943[_0x04c6('0x3e')][_0x04c6('0x3f')]('id');}return db['User'][_0x04c6('0x32')](_0x203943)[_0x04c6('0x25')](handleEntityNotFound(_0x25a6fc,null))[_0x04c6('0x25')](function(_0x32d5e8){var _0x28dfd0=[];values=_0x32d5e8;if(_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x53')]===_0x04c6('0x54')){_0x28dfd0[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x55'),_0x32d5e8['dataValues']));_0x28dfd0['push'](get_open_tabs('sms',_0x32d5e8['dataValues']));_0x28dfd0[_0x04c6('0x3f')](get_open_tabs('openchannel',_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0['push'](get_open_tabs(_0x04c6('0x47'),_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0['push'](get_open_tabs('fax',_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x45'),_0x32d5e8[_0x04c6('0x43')]));return BPromise['all'](_0x28dfd0);}else{return values;}})[_0x04c6('0x25')](function(_0xf4e9d6){return values;})[_0x04c6('0x25')](respondWithResult(_0x25a6fc,null))[_0x04c6('0x1b')](handleError(_0x25a6fc,null));};exports[_0x04c6('0x24')]=function(_0x29c72f,_0x145854){if(_0x29c72f['body']['id']){delete _0x29c72f[_0x04c6('0x56')]['id'];}delete _0x29c72f['body'][_0x04c6('0x27')];return db[_0x04c6('0x3b')]['find']({'where':{'id':_0x29c72f[_0x04c6('0x4a')]['id']}})[_0x04c6('0x25')](handleEntityNotFound(_0x145854,null))[_0x04c6('0x25')](saveUpdates(_0x29c72f[_0x04c6('0x56')],null))[_0x04c6('0x25')](respondWithResult(_0x145854,null))[_0x04c6('0x1b')](handleError(_0x145854,null));};exports[_0x04c6('0x57')]=function(_0x3333a4,_0x5c51dc){return db[_0x04c6('0x3b')]['describe']()[_0x04c6('0x25')](respondWithResult(_0x5c51dc,null))[_0x04c6('0x1b')](handleError(_0x5c51dc,null));};exports['addContacts']=function(_0x503426,_0x2e649d){return db['User'][_0x04c6('0x32')]({'where':{'id':_0x503426[_0x04c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e649d,null))[_0x04c6('0x25')](function(_0x4520f0){if(_0x4520f0){return _0x4520f0[_0x04c6('0x58')](_0x503426[_0x04c6('0x56')][_0x04c6('0x59')],_[_0x04c6('0x5a')](_0x503426[_0x04c6('0x56')],[_0x04c6('0x59'),'id'])||{});}})[_0x04c6('0x25')](respondWithResult(_0x2e649d,null))[_0x04c6('0x1b')](handleError(_0x2e649d,null));};function validateUser(_0x2c9c36){return new BPromise(function(_0x52413f,_0x3aaa1e){if(_0x2c9c36[_0x04c6('0x5b')])return _0x52413f(_0x2c9c36);return db[_0x04c6('0x5c')][_0x04c6('0x5d')](0x1)['then'](function(_0x1598f0){if(_0x1598f0[_0x04c6('0x5e')])authService[_0x04c6('0x5f')](_0x2c9c36['password']);db['User'][_0x04c6('0x60')](_0x04c6('0x5b'))[_0x04c6('0x25')](function(_0x396f79){if(_[_0x04c6('0x61')](_0x396f79)){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0['min_internal']||0x1;return;}if(_[_0x04c6('0x61')](_0x1598f0[_0x04c6('0x62')])||_0x1598f0[_0x04c6('0x62')]===_0x396f79){_0x2c9c36['internal']=_0x396f79+0x1;return;}if(_0x1598f0['min_internal']>_0x396f79){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0[_0x04c6('0x62')];return;}return db[_0x04c6('0x63')][_0x04c6('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[_0x04c6('0x63')]['QueryTypes']['SELECT']})[_0x04c6('0x25')](function(_0xe178dd){if(_0xe178dd&&_0xe178dd[_0x04c6('0x42')]){for(var _0x1904d4=0x0,_0x43260e=_0xe178dd[_0x04c6('0x42')];_0x1904d4<_0x43260e&&_[_0x04c6('0x61')](_0x2c9c36['internal']);_0x1904d4++){if(_0x1598f0[_0x04c6('0x62')]<=_0xe178dd[_0x1904d4][_0x04c6('0x64')]){_0x2c9c36[_0x04c6('0x5b')]=_0xe178dd[_0x1904d4][_0x04c6('0x64')];}else if(_0x1598f0[_0x04c6('0x62')]>_0xe178dd[_0x1904d4]['from']&&_0x1598f0['min_internal']<=_0xe178dd[_0x1904d4]['to']){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0[_0x04c6('0x62')];}}}if(_[_0x04c6('0x61')](_0x2c9c36['internal'])){_0x2c9c36[_0x04c6('0x5b')]=_0x396f79+0x1;}return _0x52413f(_0x2c9c36);});});})[_0x04c6('0x1b')](function(_0x4c9507){_0x3aaa1e(_0x4c9507);});});}function updateUser(_0x12d92e){return new BPromise(function(_0x866829,_0x152a00){try{if(_0x12d92e[_0x04c6('0x65')]){_0x12d92e[_0x04c6('0x66')]=_0x12d92e[_0x04c6('0x5b')];_0x12d92e[_0x04c6('0x67')]={'mailbox':_0x12d92e[_0x04c6('0x5b')],'password':_0x12d92e[_0x04c6('0x38')],'fullname':_0x12d92e[_0x04c6('0x68')],'email':_0x12d92e[_0x04c6('0x69')]};}if(_0x12d92e[_0x04c6('0x27')]===_0x04c6('0x2a')){if(!_0x12d92e['permissions'])_0x12d92e[_0x04c6('0x6a')]=[_0x04c6('0x6b'),'102',_0x04c6('0x6c'),_0x04c6('0x6d'),_0x04c6('0x6e'),_0x04c6('0x6f'),_0x04c6('0x70'),'106',_0x04c6('0x71'),'108',_0x04c6('0x72'),'100',_0x04c6('0x73'),_0x04c6('0x74'),_0x04c6('0x75')];}_0x866829(_0x12d92e);}catch(_0x23ce75){_0x152a00(_0x23ce75);}});}exports[_0x04c6('0x76')]=function(_0x150639,_0x34f7a6){if(_0x150639[_0x04c6('0x77')][_0x04c6('0x27')]==='agent')throw new Error(_0x04c6('0x78'));if(_0x150639[_0x04c6('0x56')]['role']===_0x04c6('0x77')&&_0x150639['user'][_0x04c6('0x27')]!==_0x04c6('0x79')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x150639[_0x04c6('0x56')][_0x04c6('0x27')]==='admin'&&_0x150639[_0x04c6('0x77')][_0x04c6('0x27')]!=='admin'){throw new Error(_0x04c6('0x7a'));}return licenseUtil[_0x04c6('0x7b')]([_0x150639['body']])[_0x04c6('0x25')](function(){return validateUser(_0x150639[_0x04c6('0x56')]);})['then'](function(_0x5314ee){return updateUser(_0x5314ee)['then'](function(_0x37d3e0){if(_0x37d3e0[_0x04c6('0x27')]===_0x04c6('0x79')){_0x37d3e0[_0x04c6('0x7c')]=_0x150639[_0x04c6('0x77')]['settingsEnabled'];delete _0x37d3e0[_0x04c6('0x7d')];}return _0x37d3e0;});})[_0x04c6('0x25')](function(_0x1a5356){return db[_0x04c6('0x3b')][_0x04c6('0x76')](_0x1a5356,{'include':[{'model':db[_0x04c6('0x67')],'as':_0x04c6('0x67')}]});})['then'](function(_0x22e182){if(_0x150639['body'][_0x04c6('0x27')]==='user')return _0x22e182;if(_0x150639['user'][_0x04c6('0x27')]!=='user')return _0x22e182;return db[_0x04c6('0x7e')][_0x04c6('0x32')]({'where':{'name':_0x22e182[_0x04c6('0x27')]===_0x04c6('0x2a')?_0x04c6('0x29'):'Telephones','userProfileId':_0x150639['user'][_0x04c6('0x7d')]},'raw':!![]})[_0x04c6('0x25')](function(_0x38d8b2){if(!_0x38d8b2||_0x38d8b2[_0x04c6('0x7f')]!=0x0)return _0x22e182;return db[_0x04c6('0x34')][_0x04c6('0x76')]({'name':_0x22e182['name'],'resourceId':_0x22e182['id'],'type':_0x38d8b2[_0x04c6('0x33')],'sectionId':_0x38d8b2['id']},{})['then'](function(){return _0x22e182;});})['catch'](function(_0x866f47){logger[_0x04c6('0x18')](_0x04c6('0x80'),_0x866f47);throw _0x866f47;});})[_0x04c6('0x25')](respondWithResult(_0x34f7a6,0xc9))[_0x04c6('0x1b')](handleError(_0x34f7a6,null));};exports[_0x04c6('0x81')]=function(_0x2e65f0,_0x243553){var _0x338e58=_0x2e65f0[_0x04c6('0x56')];var _0x21dc7c=[];if(_0x2e65f0['user'][_0x04c6('0x27')]==='agent')throw new Error('Unauthorized');if(_[_0x04c6('0x82')](_0x338e58,[_0x04c6('0x27'),_0x04c6('0x77')])&&_0x2e65f0[_0x04c6('0x77')][_0x04c6('0x27')]!==_0x04c6('0x79')){throw new Error(_0x04c6('0x83'));}if(_[_0x04c6('0x82')](_0x338e58,[_0x04c6('0x27'),_0x04c6('0x79')])&&_0x2e65f0[_0x04c6('0x77')]['role']!=='admin'){throw new Error(_0x04c6('0x84'));}return licenseUtil[_0x04c6('0x7b')](_0x338e58)['then'](function(){return validateUser(_0x338e58[0x0]);})[_0x04c6('0x25')](function(){for(var _0x3addb1=0x1;_0x3addb1<_0x338e58['length'];_0x3addb1++){var _0x4504fc=_0x338e58[_0x3addb1-0x1][_0x04c6('0x5b')];if(!_0x338e58[_0x3addb1][_0x04c6('0x5b')])_0x338e58[_0x3addb1][_0x04c6('0x5b')]=_0x4504fc+0x1;_0x21dc7c[_0x04c6('0x3f')](validateUser(_0x338e58[_0x3addb1]));}return BPromise[_0x04c6('0x48')](_0x21dc7c);})[_0x04c6('0x25')](function(){_0x21dc7c=[];for(var _0x5efcc8=0x0;_0x5efcc8<_0x338e58['length'];_0x5efcc8++){_0x21dc7c[_0x04c6('0x3f')](updateUser(_0x338e58[_0x5efcc8]));}return BPromise['all'](_0x21dc7c);})[_0x04c6('0x25')](function(){return BPromise[_0x04c6('0x85')](_0x338e58,function(_0x23b79a){return db[_0x04c6('0x3b')][_0x04c6('0x76')](_0x23b79a,{'include':[{'model':db[_0x04c6('0x67')],'as':'VoiceMail'}]})[_0x04c6('0x25')](function(_0x1b7cec){_0x23b79a['id']=_0x1b7cec['id'];return _0x23b79a;});});})[_0x04c6('0x25')](function(_0x54fe47){if(_0x2e65f0['body']['role']===_0x04c6('0x77'))return _0x54fe47;if(_0x2e65f0[_0x04c6('0x77')]['role']!==_0x04c6('0x77'))return _0x54fe47;var _0x29461e=_[_0x04c6('0x82')](_0x54fe47,function(_0x5c47a4){return _0x5c47a4[_0x04c6('0x27')]==='agent'||_0x5c47a4[_0x04c6('0x27')]===_0x04c6('0x2c');});if(!_0x29461e)return _0x54fe47;return db[_0x04c6('0x7e')]['findAll']({'where':{'name':{'$or':['Agents',_0x04c6('0x2b')]},'userProfileId':_0x2e65f0[_0x04c6('0x77')][_0x04c6('0x7d')]},'raw':!![]})[_0x04c6('0x25')](function(_0x546f5d){if(_['isEmpty'](_0x546f5d)||!_[_0x04c6('0x82')](_0x546f5d,[_0x04c6('0x7f'),0x0]))return _0x54fe47;_0x21dc7c=[];var _0x91f883=_(_0x546f5d)['map'](function(_0x2c1536){if(_0x2c1536[_0x04c6('0x7f')]===0x1)return;return _0x2c1536[_0x04c6('0x33')]===_0x04c6('0x29')?_0x04c6('0x2a'):_0x04c6('0x2c');})[_0x04c6('0x86')]()[_0x04c6('0x30')]();for(var _0x2192ff=0x0;_0x2192ff<_0x54fe47[_0x04c6('0x42')];_0x2192ff++){if(!_['includes'](_0x91f883,_0x54fe47[_0x2192ff][_0x04c6('0x27')]))return;var _0x388811=_0x54fe47[_0x2192ff][_0x04c6('0x27')]===_0x04c6('0x2a')?_0x04c6('0x29'):_0x04c6('0x2b');_0x21dc7c[_0x04c6('0x3f')](db['UserProfileResource'][_0x04c6('0x76')]({'name':_0x54fe47[_0x2192ff][_0x04c6('0x33')],'resourceId':_0x54fe47[_0x2192ff]['id'],'type':_0x388811,'sectionId':_[_0x04c6('0x32')](_0x546f5d,[_0x04c6('0x33'),_0x388811])['id']},{}));}return BPromise[_0x04c6('0x48')](_0x21dc7c);});})[_0x04c6('0x25')](respondWithResult(_0x243553,0xc9))[_0x04c6('0x1b')](handleError(_0x243553,null));};exports[_0x04c6('0x87')]=function(_0x4bfb6c,_0x203630){if(_0x4bfb6c[_0x04c6('0x56')]['id']){delete _0x4bfb6c['body']['id'];}return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x4bfb6c[_0x04c6('0x4a')]['id']}})[_0x04c6('0x25')](function(_0x29b5f2){if(!_0x29b5f2)return null;if(_0x29b5f2['id']===_0x4bfb6c['user']['id']){if(!_0x4bfb6c['body'][_0x04c6('0x88')]||!_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')]){throw new db['Sequelize'][(_0x04c6('0x8a'))](_0x04c6('0x8b'));}if(!_0x29b5f2['authenticate'](_0x4bfb6c['body'][_0x04c6('0x88')])){throw new db[(_0x04c6('0x8c'))]['ValidationError'](_0x04c6('0x8d'));}if(_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x88')]===_0x4bfb6c[_0x04c6('0x56')]['newPassword']){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x8e'));}}else if(_0x4bfb6c[_0x04c6('0x77')][_0x04c6('0x27')]===_0x04c6('0x79')){if(!_0x4bfb6c['body'][_0x04c6('0x89')]){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x8f'));}}else if(_0x4bfb6c[_0x04c6('0x77')][_0x04c6('0x27')]===_0x04c6('0x77')){if(!_0x4bfb6c[_0x04c6('0x56')]['newPassword']){throw new db['Sequelize'][(_0x04c6('0x8a'))](_0x04c6('0x8f'));}if(_0x29b5f2[_0x04c6('0x27')]!=='agent'){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x78'));}}else{throw new db['Sequelize']['ValidationError'](_0x04c6('0x78'));}return _0x29b5f2;})[_0x04c6('0x25')](handleEntityNotFound(_0x203630,null))[_0x04c6('0x25')](function(_0x414e80){return db[_0x04c6('0x5c')][_0x04c6('0x90')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x04c6('0x25')](function(_0x531c75){if(_0x531c75['securePassword'])authService[_0x04c6('0x5f')](_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')]);if(!_0x531c75['enforcePasswordHistory']||!_0x414e80[_0x04c6('0x91')])return _0x414e80;authService[_0x04c6('0x92')](_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')],_0x414e80['previousPasswords'],_0x531c75['passwordHistoryLimit']);return _0x414e80;})['then'](saveUpdates({'password':_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')],'passwordResetAt':_0x4bfb6c['user']['id']==_0x4bfb6c['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4bfb6c[_0x04c6('0x56')]['newPassword'],_0x414e80[_0x04c6('0x91')])},null));})[_0x04c6('0x25')](respondWithResult(_0x203630,null))[_0x04c6('0x1b')](handleError(_0x203630,null));};exports[_0x04c6('0x93')]=function(_0x3906b2,_0x410bc2){var _0x59a97f=_0x3906b2[_0x04c6('0x56')][_0x04c6('0x94')];return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x3906b2[_0x04c6('0x4a')]['id']},'attributes':['id','name',_0x04c6('0x27'),_0x04c6('0x95'),_0x04c6('0x96'),'voicePause',_0x04c6('0x97')]})[_0x04c6('0x25')](handleEntityNotFound(_0x410bc2,null))[_0x04c6('0x25')](function(_0x5ee1d3){if(_0x5ee1d3){if(!utils[_0x04c6('0x98')](_0x59a97f)){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x99'));}return _0x5ee1d3[_0x04c6('0x9a')+_[_0x04c6('0x9b')](_0x59a97f[_0x04c6('0x9c')]())+_0x04c6('0x9d')](_0x3906b2['body'][_0x04c6('0x59')],{'penalty':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x9e')]||0x0})['spread'](function(_0x55f0b9){for(var _0x4dfaa4=0x0;_0x4dfaa4<_0x3906b2[_0x04c6('0x56')][_0x04c6('0x59')][_0x04c6('0x42')];_0x4dfaa4+=0x1){var _0x579168={'UserId':Number(_0x3906b2[_0x04c6('0x4a')]['id'])};_0x579168[_[_0x04c6('0x9b')](_0x59a97f[_0x04c6('0x9c')]())+_0x04c6('0x9f')]=Number(_0x3906b2['body'][_0x04c6('0x59')][_0x4dfaa4]);socket[_0x04c6('0xa0')](_0x04c6('0x77')+_[_0x04c6('0x9b')](_0x59a97f['toLowerCase']())+_0x04c6('0xa1'),_0x579168);}return _0x55f0b9;})['then'](function(){if(_0x59a97f===_0x04c6('0xa2')){return db[_0x04c6('0xa3')]['findAll']({'where':{'id':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x59')]||[]},'raw':!![],'attributes':['id',_0x04c6('0x33')]});}})['then'](function(_0x39985f){var _0x2e71fa=_0x5ee1d3[_0x04c6('0xa4')]({'plain':!![]});var _0x4fb402=[];if(_0x59a97f===_0x04c6('0xa2')&&_0x2e71fa[_0x04c6('0x27')]==='agent'&&_0x2e71fa['online']){for(var _0x487c2a=0x0;_0x487c2a<_0x39985f['length'];_0x487c2a+=0x1){_0x4fb402[_0x04c6('0x3f')]({'membername':_0x2e71fa[_0x04c6('0x33')],'UserId':_0x2e71fa['id'],'queue_name':_0x39985f[_0x487c2a]['name'],'VoiceQueueId':_0x39985f[_0x487c2a]['id'],'interface':_[_0x04c6('0x61')](_0x2e71fa[_0x04c6('0x97')])?util['format'](_0x04c6('0xa5'),_0x2e71fa[_0x04c6('0x33')]):_0x2e71fa['interface'],'paused':_0x2e71fa[_0x04c6('0xa6')]||![],'penalty':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x9e')]||0x0});}return BPromise['each'](_0x4fb402,function(_0x4c616d){return db['UserVoiceQueueRt'][_0x04c6('0xa7')](_0x4c616d);});}return _0x5ee1d3;});}})[_0x04c6('0x25')](respondWithStatusCode(_0x410bc2,null))[_0x04c6('0x1b')](handleError(_0x410bc2,null));};exports['removeQueues']=function(_0x4ed0a4,_0x55c939){var _0x29e5b4;return db['User']['find']({'where':{'id':_0x4ed0a4[_0x04c6('0x4a')]['id']},'attributes':['id','name',_0x04c6('0x27')]})[_0x04c6('0x25')](handleEntityNotFound(_0x55c939,null))[_0x04c6('0x25')](function(_0x287fa8){if(_0x287fa8){_0x29e5b4=_0x287fa8;if(!_0x4ed0a4[_0x04c6('0x3c')]['channel']||!utils['isValidChannel'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')])){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x99'));}return _0x287fa8[_0x04c6('0xa8')+_['capitalize'](_0x4ed0a4['query'][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queues'](_0x4ed0a4[_0x04c6('0x3c')]['ids']);}})['then'](function(_0x3a9b88){if(_[_0x04c6('0xa9')](_0x4ed0a4['query'][_0x04c6('0x59')])){for(var _0x314e68=0x0;_0x314e68<_0x4ed0a4[_0x04c6('0x3c')]['ids'][_0x04c6('0x42')];_0x314e68+=0x1){var _0x7b32e6={'UserId':Number(_0x4ed0a4[_0x04c6('0x4a')]['id'])};_0x7b32e6[_[_0x04c6('0x9b')](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+_0x04c6('0x9f')]=Number(_0x4ed0a4['query'][_0x04c6('0x59')][_0x314e68]);socket['emit'](_0x04c6('0x77')+_[_0x04c6('0x9b')](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queue:remove',_0x7b32e6);}}else{var _0x7b32e6={'UserId':Number(_0x4ed0a4[_0x04c6('0x4a')]['id'])};_0x7b32e6[_['capitalize'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'QueueId']=Number(_0x4ed0a4[_0x04c6('0x3c')]['ids']);socket['emit'](_0x04c6('0x77')+_['capitalize'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queue:remove',_0x7b32e6);}return _0x3a9b88;})[_0x04c6('0x25')](function(){if(_0x4ed0a4['query'][_0x04c6('0x94')]==='voice'){return db['UserVoiceQueueRt'][_0x04c6('0x26')]({'where':{'UserId':_0x4ed0a4['params']['id'],'VoiceQueueId':_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x59')]},'individualHooks':!![]})[_0x04c6('0x25')](function(){return _0x29e5b4;});}return _0x29e5b4;})[_0x04c6('0x25')](respondWithStatusCode(_0x55c939,null))[_0x04c6('0x1b')](handleError(_0x55c939,null));};exports[_0x04c6('0xaa')]=function(_0x257524,_0x81e27b){_0x257524[_0x04c6('0x56')][_0x04c6('0xab')]=_0x257524['file']['filename'];return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x257524[_0x04c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x81e27b,null))[_0x04c6('0x25')](saveUpdates(_0x257524['body'],null))['then'](respondWithResult(_0x81e27b,null))[_0x04c6('0x1b')](handleError(_0x81e27b,null));};exports[_0x04c6('0xac')]=function(_0x3a3d48,_0xeca2d9){var _0x4bf86a=path['join'](config[_0x04c6('0xad')],_0x04c6('0xae'));return db['User'][_0x04c6('0x32')]({'where':{'id':_0x3a3d48[_0x04c6('0x4a')]['id']},'attributes':['id',_0x04c6('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0xeca2d9,null))['then'](function(_0x37fbde){if(_0x37fbde){if(_[_0x04c6('0x61')](_0x37fbde[_0x04c6('0xab')])){return _0xeca2d9[_0x04c6('0xaf')](_0x4bf86a);}else{if(!fs[_0x04c6('0xb0')](path[_0x04c6('0xb1')](config[_0x04c6('0xad')],_0x04c6('0xb2'),_0x37fbde['userpic']))){return _0xeca2d9['download'](_0x4bf86a);}return _0xeca2d9['download'](path[_0x04c6('0xb1')](config[_0x04c6('0xad')],_0x04c6('0xb2'),_0x37fbde[_0x04c6('0xab')]));}}})[_0x04c6('0x1b')](handleError(_0xeca2d9,null));};exports[_0x04c6('0xb3')]=function(_0xc7dfe5,_0x53982d){return db[_0x04c6('0x3b')]['find']({'where':{'id':_0xc7dfe5['params']['id']},'attributes':['id']})[_0x04c6('0x25')](handleEntityNotFound(_0x53982d,null))[_0x04c6('0x25')](function(_0x3eac1f){var _0x10a9ae=[];values=_0x3eac1f[_0x04c6('0x43')];_0x10a9ae[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x55'),_0x3eac1f['dataValues']));_0x10a9ae['push'](get_open_tabs(_0x04c6('0x44'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs('openchannel',_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x47'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae['push'](get_open_tabs(_0x04c6('0xb4'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs('mail',_0x3eac1f[_0x04c6('0x43')]));return BPromise[_0x04c6('0x48')](_0x10a9ae);})[_0x04c6('0x25')](function(_0x2cc0d2){var _0x3d6281=[];if(_0x2cc0d2){for(var _0x24e786=0x0;_0x24e786=_0x51fe17[_0x7086('0x4a')]){throw new Error(_0x7086('0x4b'));}})[_0x7086('0xf')](function(){if(_0x530482){return db[_0x7086('0x28')]['destroy']({'where':{'membername':_0x530482[_0x7086('0x25')]},'individualHooks':!![]});}})[_0x7086('0xf')](function(){if(_0x530482){return _0x530482[_0x7086('0x4c')]({'raw':!![]});}})[_0x7086('0xf')](function(_0x33c080){if(_0x530482){if(_0x33c080){var _0x58288a=[];_0x3111d9=_0x33c080;if(_0x3111d9[_0x7086('0x2b')]){for(var _0x5c1125=0x0;_0x5c1125<_0x3111d9['length'];_0x5c1125++){_0x58288a[_0x7086('0x2f')](db[_0x7086('0x28')]['upsert']({'membername':_0x530482[_0x7086('0x25')],'UserId':_0x530482['id'],'queue_name':_0x3111d9[_0x5c1125][_0x7086('0x25')],'VoiceQueueId':_0x3111d9[_0x5c1125]['id'],'interface':_0x3cc856,'paused':_0x530482[_0x7086('0x47')]||![],'penalty':_0x3111d9[_0x5c1125]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x58288a);}}}})[_0x7086('0xf')](function(){if(_0x530482){return db['MemberReport'][_0x7086('0x19')]({'where':{'membername':_0x530482[_0x7086('0x25')],'exitAt':null}});}})['then'](function(_0x327c77){if(_0x530482){if(_0x327c77&&_0x327c77[_0x7086('0x2b')]){var _0x1e5268=[];_0x327c77[_0x7086('0x44')](function(_0x326c42){_0x1e5268['push'](_0x326c42[_0x7086('0x29')]({'exitAt':moment()[_0x7086('0x2c')](_0x7086('0x33'))}));});return BPromise[_0x7086('0x45')](_0x1e5268);}}})[_0x7086('0xf')](function(_0x4a2157){if(_0x530482){var _0x472208=[];var _0x25e52a=[];var _0x109c28=utils[_0x7086('0x2e')]();var _0x2854b2={'membername':_0x530482[_0x7086('0x25')],'interface':_0x3cc856,'enterAt':moment()[_0x7086('0x2c')](_0x7086('0x33')),'role':_0x530482[_0x7086('0x26')],'internal':_0x530482[_0x7086('0x27')]};_0x109c28[_0x7086('0x44')](function(_0x32ebae){_0x472208[_0x7086('0x2f')](_[_0x7086('0x4d')]({'channel':_0x32ebae,'type':_0x7086('0x4e'),'data1':_0x7086('0x4f'),'data2':_0x3cc856},_0x2854b2));if(_0x530482['loginInPause']){_0x25e52a['push'](_[_0x7086('0x4d')]({'channel':_0x32ebae,'type':_0x7086('0x32'),'data1':_0x7086('0x50')},_0x2854b2));}});return db[_0x7086('0x2a')][_0x7086('0x37')](_0x472208[_0x7086('0x51')](_0x25e52a),{'individualHooks':!![]});}})['then'](function(){if(_0x530482){return _0x530482[_0x7086('0x29')]({'online':!![],'lastLoginAt':moment()[_0x7086('0x2c')](_0x7086('0x33')),'voicePause':_0x530482[_0x7086('0x47')]||![],'mailPause':_0x530482[_0x7086('0x47')]||![],'chatPause':_0x530482[_0x7086('0x47')]||![],'faxPause':_0x530482['loginInPause']||![],'smsPause':_0x530482[_0x7086('0x47')]||![],'openchannelPause':_0x530482[_0x7086('0x47')]||![],'pauseType':_0x530482['loginInPause']?_0x7086('0x50'):null,'lastPauseAt':moment()['format'](_0x7086('0x33')),'interface':_0x3cc856});}})['then'](function(_0x383009){_0x13c037(_0x383009);})['catch'](function(_0x3eb303){_0x2f5d86(_0x297574[_0x7086('0x15')](0x1f4,_0x3eb303['message']));});});}; \ No newline at end of file +var _0xcdb9=['limit','include','map','model','then','GetUser','debug','ShowUser','PauseUser','where','name','role','internal','interface','UserVoiceQueueRt','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','update','UnpauseUser','findOne','channel','isValidChannel','voice','MemberReport','find','system','chat','openchannel','whatsapp','set','Pause','push','all','LogoutUser','destroy','LoginUser','mobile','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./user.socket','register','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','User','findAll','options','raw','attributes'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xcdb9,0xf4));var _0x9cdb=function(_0xd3280c,_0x4c61b9){_0xd3280c=_0xd3280c-0x0;var _0x48f660=_0xcdb9[_0xd3280c];return _0x48f660;};'use strict';var _=require(_0x9cdb('0x0'));var util=require('util');var moment=require(_0x9cdb('0x1'));var BPromise=require(_0x9cdb('0x2'));var rs=require(_0x9cdb('0x3'));var fs=require('fs');var Redis=require(_0x9cdb('0x4'));var db=require(_0x9cdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9cdb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9cdb('0x7'));var client=jayson[_0x9cdb('0x8')][_0x9cdb('0x9')]({'port':0x232a});config['redis']=_[_0x9cdb('0xa')](config[_0x9cdb('0xb')],{'host':_0x9cdb('0xc'),'port':0x18eb});var socket=require(_0x9cdb('0xd'))(new Redis(config[_0x9cdb('0xb')]));require(_0x9cdb('0xe'))[_0x9cdb('0xf')](socket);function respondWithRpcPromise(_0x40dd63,_0x59f9ca,_0x2cba15){return new BPromise(function(_0x354624,_0x5c348e){return client['request'](_0x40dd63,_0x2cba15)['then'](function(_0x35fcad){logger['info'](_0x9cdb('0x10'),_0x59f9ca,_0x9cdb('0x11'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x59f9ca,_0x9cdb('0x11'),JSON[_0x9cdb('0x12')](_0x35fcad));if(_0x35fcad[_0x9cdb('0x13')]){if(_0x35fcad[_0x9cdb('0x13')][_0x9cdb('0x14')]===0x1f4){logger[_0x9cdb('0x13')](_0x9cdb('0x10'),_0x59f9ca,_0x35fcad['error'][_0x9cdb('0x15')]);return _0x5c348e(_0x35fcad[_0x9cdb('0x13')]['message']);}logger['error'](_0x9cdb('0x10'),_0x59f9ca,_0x35fcad[_0x9cdb('0x13')][_0x9cdb('0x15')]);return _0x354624(_0x35fcad[_0x9cdb('0x13')][_0x9cdb('0x15')]);}else{logger[_0x9cdb('0x16')](_0x9cdb('0x10'),_0x59f9ca,_0x9cdb('0x11'));_0x354624(_0x35fcad['result'][_0x9cdb('0x15')]);}})[_0x9cdb('0x17')](function(_0x269a5a){logger[_0x9cdb('0x13')](_0x9cdb('0x10'),_0x59f9ca,_0x269a5a);_0x5c348e(_0x269a5a);});});}exports['GetUser']=function(_0x5863fa){var _0x25f410=this;return new Promise(function(_0x5d5588,_0x36c75f){return db[_0x9cdb('0x18')][_0x9cdb('0x19')]({'raw':_0x5863fa[_0x9cdb('0x1a')]?_0x5863fa[_0x9cdb('0x1a')][_0x9cdb('0x1b')]===undefined?!![]:![]:!![],'where':_0x5863fa[_0x9cdb('0x1a')]?_0x5863fa[_0x9cdb('0x1a')]['where']||null:null,'attributes':_0x5863fa[_0x9cdb('0x1a')]?_0x5863fa['options'][_0x9cdb('0x1c')]||null:null,'limit':_0x5863fa[_0x9cdb('0x1a')]?_0x5863fa['options'][_0x9cdb('0x1d')]||null:null,'include':_0x5863fa[_0x9cdb('0x1a')]?_0x5863fa[_0x9cdb('0x1a')][_0x9cdb('0x1e')]?_[_0x9cdb('0x1f')](_0x5863fa[_0x9cdb('0x1a')][_0x9cdb('0x1e')],function(_0x5cffb1){return{'model':db[_0x5cffb1[_0x9cdb('0x20')]],'as':_0x5cffb1['as'],'attributes':_0x5cffb1[_0x9cdb('0x1c')],'include':_0x5cffb1[_0x9cdb('0x1e')]?_['map'](_0x5cffb1['include'],function(_0x2a39dc){return{'model':db[_0x2a39dc[_0x9cdb('0x20')]],'as':_0x2a39dc['as'],'attributes':_0x2a39dc[_0x9cdb('0x1c')],'include':_0x2a39dc[_0x9cdb('0x1e')]?_['map'](_0x2a39dc[_0x9cdb('0x1e')],function(_0xe765f5){return{'model':db[_0xe765f5[_0x9cdb('0x20')]],'as':_0xe765f5['as'],'attributes':_0xe765f5[_0x9cdb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9cdb('0x21')](function(_0x232a5c){logger[_0x9cdb('0x16')](_0x9cdb('0x22'),_0x5863fa);logger[_0x9cdb('0x23')](_0x9cdb('0x22'),_0x5863fa,JSON[_0x9cdb('0x12')](_0x232a5c));_0x5d5588(_0x232a5c);})['catch'](function(_0x5c3d86){logger[_0x9cdb('0x13')](_0x9cdb('0x22'),_0x5c3d86[_0x9cdb('0x15')],_0x5863fa);_0x36c75f(_0x25f410['error'](0x1f4,_0x5c3d86['message']));});});};exports['ShowUser']=function(_0x3a8ad7){var _0x438df9=this;return new Promise(function(_0x33f6b3,_0xe7b690){return db['User']['find']({'raw':_0x3a8ad7[_0x9cdb('0x1a')]?_0x3a8ad7['options'][_0x9cdb('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a8ad7[_0x9cdb('0x1a')]?_0x3a8ad7['options']['where']||null:null,'attributes':_0x3a8ad7['options']?_0x3a8ad7[_0x9cdb('0x1a')]['attributes']||null:null,'include':_0x3a8ad7[_0x9cdb('0x1a')]?_0x3a8ad7[_0x9cdb('0x1a')][_0x9cdb('0x1e')]?_[_0x9cdb('0x1f')](_0x3a8ad7[_0x9cdb('0x1a')]['include'],function(_0x2e7ed4){return{'model':db[_0x2e7ed4['model']],'as':_0x2e7ed4['as'],'attributes':_0x2e7ed4[_0x9cdb('0x1c')],'include':_0x2e7ed4[_0x9cdb('0x1e')]?_[_0x9cdb('0x1f')](_0x2e7ed4[_0x9cdb('0x1e')],function(_0xae9bcd){return{'model':db[_0xae9bcd[_0x9cdb('0x20')]],'as':_0xae9bcd['as'],'attributes':_0xae9bcd[_0x9cdb('0x1c')],'include':_0xae9bcd[_0x9cdb('0x1e')]?_[_0x9cdb('0x1f')](_0xae9bcd[_0x9cdb('0x1e')],function(_0x594324){return{'model':db[_0x594324['model']],'as':_0x594324['as'],'attributes':_0x594324[_0x9cdb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9cdb('0x21')](function(_0x1d88bf){logger[_0x9cdb('0x16')]('ShowUser',_0x3a8ad7);logger[_0x9cdb('0x23')](_0x9cdb('0x24'),_0x3a8ad7,JSON[_0x9cdb('0x12')](_0x1d88bf));_0x33f6b3(_0x1d88bf);})[_0x9cdb('0x17')](function(_0x28bb6b){logger['error'](_0x9cdb('0x24'),_0x28bb6b[_0x9cdb('0x15')],_0x3a8ad7);_0xe7b690(_0x438df9[_0x9cdb('0x13')](0x1f4,_0x28bb6b[_0x9cdb('0x15')]));});});};exports[_0x9cdb('0x25')]=function(_0x542ebd){var _0x2190aa=this;return new Promise(function(_0x4f5444,_0x219e38){var _0x57f7b3;return db['User']['find']({'where':_0x542ebd[_0x9cdb('0x1a')][_0x9cdb('0x26')]||{},'attributes':['id',_0x9cdb('0x27'),_0x9cdb('0x28'),_0x9cdb('0x29'),_0x9cdb('0x2a')]})[_0x9cdb('0x21')](function(_0x5ad819){if(_0x5ad819){_0x57f7b3=_0x5ad819;return db[_0x9cdb('0x2b')]['update']({'paused':0x1},{'where':{'UserId':_0x57f7b3['id']},'individualHooks':!![]});}})[_0x9cdb('0x21')](function(){if(_0x57f7b3){return db['MemberReport'][_0x9cdb('0x19')]({'where':{'membername':_0x57f7b3[_0x9cdb('0x27')],'type':'PAUSE','exitAt':null}});}})[_0x9cdb('0x21')](function(_0x485bf7){if(_0x57f7b3){if(_0x485bf7&&_0x485bf7['length']){var _0x2554e3=moment()[_0x9cdb('0x2c')](_0x9cdb('0x2d'));for(var _0x56123b=0x0,_0x355520=_0x485bf7[_0x9cdb('0x2e')];_0x56123b<_0x355520;_0x56123b++){_0x485bf7[_0x56123b][_0x9cdb('0x2f')]({'exitAt':_0x2554e3});}}}})['then'](function(){if(_0x57f7b3){var _0xac19a1=[];var _0x11189a=utils[_0x9cdb('0x30')]();_0x11189a[_0x9cdb('0x31')](function(_0x202f2e){_0xac19a1['push']({'channel':_0x202f2e,'membername':_0x57f7b3[_0x9cdb('0x27')],'interface':_[_0x9cdb('0x32')](_0x57f7b3[_0x9cdb('0x2a')])?util[_0x9cdb('0x2c')](_0x9cdb('0x33'),_0x57f7b3[_0x9cdb('0x27')]):_0x57f7b3[_0x9cdb('0x2a')],'type':_0x9cdb('0x34'),'enterAt':moment()[_0x9cdb('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x542ebd[_0x9cdb('0x35')][_0x9cdb('0x36')]||_0x9cdb('0x37'),'role':_0x57f7b3['role'],'internal':_0x57f7b3[_0x9cdb('0x29')],'uniqueid':_0x542ebd[_0x9cdb('0x35')][_0x9cdb('0x38')]||null});});return db['MemberReport']['bulkCreate'](_0xac19a1,{'individualHooks':!![]});}})[_0x9cdb('0x21')](function(){if(_0x57f7b3){return _0x57f7b3[_0x9cdb('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x542ebd[_0x9cdb('0x35')]['type']||_0x9cdb('0x37'),'lastPauseAt':moment()[_0x9cdb('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9cdb('0x21')](function(_0x4bc7f9){_0x4f5444(_0x4bc7f9);})[_0x9cdb('0x17')](function(_0x241d73){_0x219e38(_0x2190aa['error'](0x1f4,_0x241d73['message']));});});};exports[_0x9cdb('0x3a')]=function(_0x36d875){var _0x29c364=this;return new Promise(function(_0x5864f0,_0x272765){var _0x3bf68d;return db[_0x9cdb('0x18')][_0x9cdb('0x3b')]({'where':_0x36d875['options'][_0x9cdb('0x26')]||{},'attributes':['id',_0x9cdb('0x27')]})[_0x9cdb('0x21')](function(_0x364ec4){if(_0x364ec4){_0x3bf68d=_0x364ec4;if(_0x36d875['body'][_0x9cdb('0x3c')]&&!utils[_0x9cdb('0x3d')](_0x36d875[_0x9cdb('0x35')][_0x9cdb('0x3c')])){throw new Error('Unknown\x20channel');}switch(_0x36d875['body'][_0x9cdb('0x3c')]){case _0x9cdb('0x3e'):return db[_0x9cdb('0x2b')][_0x9cdb('0x39')]({'paused':0x0},{'where':{'UserId':_0x3bf68d['id']}})[_0x9cdb('0x21')](function(){return db[_0x9cdb('0x3f')][_0x9cdb('0x40')]({'where':{'channel':_0x36d875[_0x9cdb('0x35')][_0x9cdb('0x3c')],'membername':_0x3bf68d[_0x9cdb('0x27')],'type':_0x9cdb('0x34'),'exitAt':null}});})[_0x9cdb('0x21')](function(_0xa21da1){if(_0xa21da1){return _0xa21da1[_0x9cdb('0x39')]({'exitAt':moment()['format'](_0x9cdb('0x2d')),'data2':_0x9cdb('0x41')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3bf68d[_0x9cdb('0x39')]({'voicePause':![]});});case'mail':case _0x9cdb('0x42'):case'fax':case'sms':case _0x9cdb('0x43'):case _0x9cdb('0x44'):return db[_0x9cdb('0x3f')]['find']({'where':{'channel':_0x36d875[_0x9cdb('0x35')]['channel'],'membername':_0x3bf68d['name'],'type':_0x9cdb('0x34'),'exitAt':null}})['then'](function(_0x594d6f){return _0x594d6f[_0x9cdb('0x39')]({'exitAt':moment()['format'](_0x9cdb('0x2d')),'data2':_0x9cdb('0x41')},{'individualHooks':!![]});})['then'](function(){var _0x41edda={};_[_0x9cdb('0x45')](_0x41edda,util[_0x9cdb('0x2c')]('%s%s',_0x36d875['body'][_0x9cdb('0x3c')],_0x9cdb('0x46')),![]);return _0x3bf68d['update'](_0x41edda);});default:return db[_0x9cdb('0x2b')][_0x9cdb('0x39')]({'paused':0x0},{'where':{'UserId':_0x3bf68d['id']}})['then'](function(){return db[_0x9cdb('0x3f')][_0x9cdb('0x19')]({'where':{'membername':_0x3bf68d[_0x9cdb('0x27')],'type':_0x9cdb('0x34'),'exitAt':null}});})[_0x9cdb('0x21')](function(_0x249c07){var _0x1b2c62=[];_0x249c07[_0x9cdb('0x31')](function(_0x408592){_0x1b2c62[_0x9cdb('0x47')](_0x408592[_0x9cdb('0x39')]({'exitAt':moment()[_0x9cdb('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9cdb('0x41')}));});return BPromise[_0x9cdb('0x48')](_0x1b2c62);})[_0x9cdb('0x21')](function(){return _0x3bf68d['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x90077b){_0x5864f0(_0x90077b);})[_0x9cdb('0x17')](function(_0x4f727d){_0x272765(_0x29c364[_0x9cdb('0x13')](0x1f4,_0x4f727d[_0x9cdb('0x15')]));});});};exports[_0x9cdb('0x49')]=function(_0x20c151){var _0x13cd42=this;return new Promise(function(_0xf9d83d,_0x34511e){var _0x4e096e;return db['User'][_0x9cdb('0x3b')]({'where':_0x20c151['options'][_0x9cdb('0x26')]||{},'attributes':['id',_0x9cdb('0x27')]})[_0x9cdb('0x21')](function(_0x42368b){if(_0x42368b){_0x4e096e=_0x42368b;return db['UserVoiceQueueRt'][_0x9cdb('0x4a')]({'where':{'membername':_0x4e096e['name']},'individualHooks':!![]});}})[_0x9cdb('0x21')](function(){if(_0x4e096e){return db[_0x9cdb('0x3f')][_0x9cdb('0x19')]({'where':{'membername':_0x4e096e[_0x9cdb('0x27')],'exitAt':null}});}})[_0x9cdb('0x21')](function(_0x359afd){if(_0x4e096e){if(_0x359afd&&_0x359afd[_0x9cdb('0x2e')]){var _0x19ea9e=[];_0x359afd[_0x9cdb('0x31')](function(_0x317929){_0x19ea9e[_0x9cdb('0x47')](_0x317929['update']({'exitAt':moment()['format'](_0x9cdb('0x2d'))}));});return BPromise[_0x9cdb('0x48')](_0x19ea9e);}}})[_0x9cdb('0x21')](function(){if(_0x4e096e){return _0x4e096e[_0x9cdb('0x39')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9cdb('0x21')](function(_0x395079){_0xf9d83d(_0x395079);})[_0x9cdb('0x17')](function(_0x154a42){_0x34511e(_0x13cd42[_0x9cdb('0x13')](0x1f4,_0x154a42['message']));});});};exports[_0x9cdb('0x4b')]=function(_0x422d51){var _0x5b1a77=this;return new Promise(function(_0x5b792b,_0x18db1e){var _0x503aa6;var _0x175b13;var _0x121e47;var _0xeeed00;return db[_0x9cdb('0x18')][_0x9cdb('0x3b')]({'where':_0x422d51[_0x9cdb('0x1a')][_0x9cdb('0x26')]||{},'attributes':['id',_0x9cdb('0x27'),_0x9cdb('0x28'),_0x9cdb('0x4c'),'phone','internal',_0x9cdb('0x4d'),'interface']})['then'](function(_0x24076f){if(_0x24076f){_0x503aa6=_0x24076f;_0xeeed00=_0x422d51[_0x9cdb('0x35')][_0x9cdb('0x2a')]?_0x422d51['body'][_0x9cdb('0x2a')]:util[_0x9cdb('0x2c')](_0x9cdb('0x33'),_0x503aa6[_0x9cdb('0x27')]);return db['User'][_0x9cdb('0x4e')]({'where':{'role':_0x9cdb('0x4f'),'online':!![],'id':{'$ne':_0x503aa6['id']}}});}})[_0x9cdb('0x21')](function(_0x5182ee){if(_0x5182ee){_0x121e47=_0x5182ee;return require(_0x9cdb('0x50'))[_0x9cdb('0x51')]();}})[_0x9cdb('0x21')](function(_0x52f7b4){if(_0x52f7b4&&_0x52f7b4[_0x9cdb('0x52')]&&_0x121e47>=_0x52f7b4['agents']){throw new Error(_0x9cdb('0x53'));}})['then'](function(){if(_0x503aa6){return db['UserVoiceQueueRt'][_0x9cdb('0x4a')]({'where':{'membername':_0x503aa6[_0x9cdb('0x27')]},'individualHooks':!![]});}})[_0x9cdb('0x21')](function(){if(_0x503aa6){return _0x503aa6['getVoiceQueues']({'raw':!![]});}})[_0x9cdb('0x21')](function(_0x4d6a30){if(_0x503aa6){if(_0x4d6a30){var _0x3e6167=[];_0x175b13=_0x4d6a30;if(_0x175b13[_0x9cdb('0x2e')]){for(var _0x153adc=0x0;_0x153adc<_0x175b13[_0x9cdb('0x2e')];_0x153adc++){_0x3e6167[_0x9cdb('0x47')](db['UserVoiceQueueRt'][_0x9cdb('0x54')]({'membername':_0x503aa6[_0x9cdb('0x27')],'UserId':_0x503aa6['id'],'queue_name':_0x175b13[_0x153adc][_0x9cdb('0x27')],'VoiceQueueId':_0x175b13[_0x153adc]['id'],'interface':_0xeeed00,'paused':_0x503aa6[_0x9cdb('0x4d')]||![],'penalty':_0x175b13[_0x153adc]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9cdb('0x48')](_0x3e6167);}}}})['then'](function(){if(_0x503aa6){return db['MemberReport'][_0x9cdb('0x19')]({'where':{'membername':_0x503aa6[_0x9cdb('0x27')],'exitAt':null}});}})[_0x9cdb('0x21')](function(_0xf7f196){if(_0x503aa6){if(_0xf7f196&&_0xf7f196['length']){var _0x37b7ca=[];_0xf7f196[_0x9cdb('0x31')](function(_0x48c67d){_0x37b7ca[_0x9cdb('0x47')](_0x48c67d[_0x9cdb('0x39')]({'exitAt':moment()[_0x9cdb('0x2c')](_0x9cdb('0x2d'))}));});return BPromise['all'](_0x37b7ca);}}})['then'](function(_0x1438c2){if(_0x503aa6){var _0x2a94c8=[];var _0x386423=[];var _0x2f2253=utils[_0x9cdb('0x30')]();var _0x422332={'membername':_0x503aa6[_0x9cdb('0x27')],'interface':_0xeeed00,'enterAt':moment()['format'](_0x9cdb('0x2d')),'role':_0x503aa6['role'],'internal':_0x503aa6[_0x9cdb('0x29')]};_0x2f2253[_0x9cdb('0x31')](function(_0x5f32ea){_0x2a94c8[_0x9cdb('0x47')](_[_0x9cdb('0x55')]({'channel':_0x5f32ea,'type':_0x9cdb('0x56'),'data1':_0x9cdb('0x57'),'data2':_0xeeed00},_0x422332));if(_0x503aa6[_0x9cdb('0x4d')]){_0x386423[_0x9cdb('0x47')](_[_0x9cdb('0x55')]({'channel':_0x5f32ea,'type':_0x9cdb('0x34'),'data1':_0x9cdb('0x58')},_0x422332));}});return db['MemberReport'][_0x9cdb('0x59')](_0x2a94c8[_0x9cdb('0x5a')](_0x386423),{'individualHooks':!![]});}})[_0x9cdb('0x21')](function(){if(_0x503aa6){return _0x503aa6[_0x9cdb('0x39')]({'online':!![],'lastLoginAt':moment()['format'](_0x9cdb('0x2d')),'voicePause':_0x503aa6[_0x9cdb('0x4d')]||![],'mailPause':_0x503aa6[_0x9cdb('0x4d')]||![],'chatPause':_0x503aa6[_0x9cdb('0x4d')]||![],'faxPause':_0x503aa6['loginInPause']||![],'smsPause':_0x503aa6[_0x9cdb('0x4d')]||![],'openchannelPause':_0x503aa6[_0x9cdb('0x4d')]||![],'pauseType':_0x503aa6['loginInPause']?_0x9cdb('0x58'):null,'lastPauseAt':moment()['format'](_0x9cdb('0x2d')),'interface':_0xeeed00});}})[_0x9cdb('0x21')](function(_0x3520f8){_0x5b792b(_0x3520f8);})[_0x9cdb('0x17')](function(_0x46318a){_0x18db1e(_0x5b1a77['error'](0x1f4,_0x46318a[_0x9cdb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7d06d95..98811c0 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 _0x198c=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x12541a,_0x596279){var _0x3eb7b2=function(_0x48455f){while(--_0x48455f){_0x12541a['push'](_0x12541a['shift']());}};_0x3eb7b2(++_0x596279);}(_0x198c,0x183));var _0xc198=function(_0x452cec,_0x4de549){_0x452cec=_0x452cec-0x0;var _0x51a103=_0x198c[_0x452cec];return _0x51a103;};'use strict';var UserEvents=require(_0xc198('0x0'));var events=[_0xc198('0x1'),_0xc198('0x2'),_0xc198('0x3')];function createListener(_0x35d562,_0x2b6f89){return function(_0x348f8c){_0x2b6f89[_0xc198('0x4')](_0x35d562,_0x348f8c);};}function removeListener(_0x12d30f,_0xddc594){return function(){UserEvents[_0xc198('0x5')](_0x12d30f,_0xddc594);};}exports[_0xc198('0x6')]=function(_0x6bc78a){for(var _0x2f37ef=0x0,_0x4c6d65=events[_0xc198('0x7')];_0x2f37ef<_0x4c6d65;_0x2f37ef++){var _0x444907=events[_0x2f37ef];var _0x2a7e3f=createListener(_0xc198('0x8')+_0x444907,_0x6bc78a);UserEvents['on'](_0x444907,_0x2a7e3f);}}; \ No newline at end of file +var _0x3baa=['remove','update','removeListener','register','length','user:','save'];(function(_0x3400b9,_0x505544){var _0x2b1e03=function(_0x2fc590){while(--_0x2fc590){_0x3400b9['push'](_0x3400b9['shift']());}};_0x2b1e03(++_0x505544);}(_0x3baa,0x19c));var _0xa3ba=function(_0x2e8e93,_0x1b289f){_0x2e8e93=_0x2e8e93-0x0;var _0x33030c=_0x3baa[_0x2e8e93];return _0x33030c;};'use strict';var UserEvents=require('./user.events');var events=[_0xa3ba('0x0'),_0xa3ba('0x1'),_0xa3ba('0x2')];function createListener(_0x1a58cd,_0x32f45f){return function(_0x378185){_0x32f45f['emit'](_0x1a58cd,_0x378185);};}function removeListener(_0x185a11,_0x1728c7){return function(){UserEvents[_0xa3ba('0x3')](_0x185a11,_0x1728c7);};}exports[_0xa3ba('0x4')]=function(_0xba7993){for(var _0x305928=0x0,_0x1fa1b8=events[_0xa3ba('0x5')];_0x305928<_0x1fa1b8;_0x305928++){var _0x42a72b=events[_0x305928];var _0x1778c9=createListener(_0xa3ba('0x6')+_0x42a72b,_0xba7993);UserEvents['on'](_0x42a72b,_0x1778c9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e3eb52a..ae2a856 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x12ead1,_0x1dd6d3){var _0xb8e16b=function(_0x3479d8){while(--_0x3479d8){_0x12ead1['push'](_0x12ead1['shift']());}};_0xb8e16b(++_0x1dd6d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3dba231..4adbeb6 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 _0xd542=['sequelize','exports'];(function(_0x2eddb9,_0x41e214){var _0x541be9=function(_0x34ace7){while(--_0x34ace7){_0x2eddb9['push'](_0x2eddb9['shift']());}};_0x541be9(++_0x41e214);}(_0xd542,0x1a4));var _0x2d54=function(_0x5e16b9,_0x58182d){_0x5e16b9=_0x5e16b9-0x0;var _0x173e11=_0xd542[_0x5e16b9];return _0x173e11;};'use strict';var Sequelize=require(_0x2d54('0x0'));module[_0x2d54('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb54e=['exports'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0xb54e,0x1e0));var _0xeb54=function(_0x4fa2b4,_0x36d544){_0x4fa2b4=_0x4fa2b4-0x0;var _0x1e71ef=_0xb54e[_0x4fa2b4];return _0x1e71ef;};'use strict';var Sequelize=require('sequelize');module[_0xeb54('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 1ee6f32..27f7493 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 _0xb015=['api','bluebird','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger'];(function(_0x2237ae,_0xf392b6){var _0x57543d=function(_0x2fbdc3){while(--_0x2fbdc3){_0x2237ae['push'](_0x2237ae['shift']());}};_0x57543d(++_0xf392b6);}(_0xb015,0x132));var _0x5b01=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb015[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x5b01('0x0'));var util=require('util');var logger=require(_0x5b01('0x1'))(_0x5b01('0x2'));var moment=require('moment');var BPromise=require(_0x5b01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b01('0x4'));var rimraf=require(_0x5b01('0x5'));var config=require('../../config/environment');var attributes=require(_0x5b01('0x6'));module[_0x5b01('0x7')]=function(_0xae9252,_0xb4aa69){return _0xae9252[_0x5b01('0x8')](_0x5b01('0x9'),attributes,{'tableName':_0x5b01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec4b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','lodash','util'];(function(_0xe7dea0,_0x521b42){var _0x517a02=function(_0x304243){while(--_0x304243){_0xe7dea0['push'](_0xe7dea0['shift']());}};_0x517a02(++_0x521b42);}(_0xec4b,0x177));var _0xbec4=function(_0x2a0ec5,_0x118005){_0x2a0ec5=_0x2a0ec5-0x0;var _0x58b9e0=_0xec4b[_0x2a0ec5];return _0x58b9e0;};'use strict';var _=require(_0xbec4('0x0'));var util=require(_0xbec4('0x1'));var logger=require(_0xbec4('0x2'))(_0xbec4('0x3'));var moment=require(_0xbec4('0x4'));var BPromise=require(_0xbec4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbec4('0x6'));var rimraf=require(_0xbec4('0x7'));var config=require(_0xbec4('0x8'));var attributes=require(_0xbec4('0x9'));module[_0xbec4('0xa')]=function(_0x472498,_0x47b694){return _0x472498[_0xbec4('0xb')](_0xbec4('0xc'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 7a594d9..441760d 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 _0x7e82=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30e25c,_0x355276){var _0x47959b=function(_0x2f9417){while(--_0x2f9417){_0x30e25c['push'](_0x30e25c['shift']());}};_0x47959b(++_0x355276);}(_0x7e82,0xad));var _0x27e8=function(_0x374a7b,_0x20ff6a){_0x374a7b=_0x374a7b-0x0;var _0x86abc7=_0x7e82[_0x374a7b];return _0x86abc7;};'use strict';var _=require(_0x27e8('0x0'));var util=require(_0x27e8('0x1'));var moment=require(_0x27e8('0x2'));var BPromise=require('bluebird');var rs=require(_0x27e8('0x3'));var fs=require('fs');var Redis=require(_0x27e8('0x4'));var db=require(_0x27e8('0x5'))['db'];var utils=require(_0x27e8('0x6'));var logger=require(_0x27e8('0x7'))(_0x27e8('0x8'));var config=require(_0x27e8('0x9'));var jayson=require(_0x27e8('0xa'));var client=jayson[_0x27e8('0xb')][_0x27e8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x568748,_0x247323,_0x57a13c){return new BPromise(function(_0x42f175,_0x49517d){return client[_0x27e8('0xd')](_0x568748,_0x57a13c)[_0x27e8('0xe')](function(_0x22ef9f){logger[_0x27e8('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x247323,_0x27e8('0x10'));logger[_0x27e8('0x11')](_0x27e8('0x12'),_0x247323,'request\x20sent',JSON[_0x27e8('0x13')](_0x22ef9f));if(_0x22ef9f[_0x27e8('0x14')]){if(_0x22ef9f[_0x27e8('0x14')][_0x27e8('0x15')]===0x1f4){logger['error'](_0x27e8('0x16'),_0x247323,_0x22ef9f[_0x27e8('0x14')][_0x27e8('0x17')]);return _0x49517d(_0x22ef9f[_0x27e8('0x14')][_0x27e8('0x17')]);}logger[_0x27e8('0x14')](_0x27e8('0x16'),_0x247323,_0x22ef9f['error'][_0x27e8('0x17')]);return _0x42f175(_0x22ef9f[_0x27e8('0x14')][_0x27e8('0x17')]);}else{logger[_0x27e8('0xf')](_0x27e8('0x16'),_0x247323,_0x27e8('0x10'));_0x42f175(_0x22ef9f[_0x27e8('0x18')][_0x27e8('0x17')]);}})[_0x27e8('0x19')](function(_0x3dcbe3){logger[_0x27e8('0x14')](_0x27e8('0x16'),_0x247323,_0x3dcbe3);_0x49517d(_0x3dcbe3);});});} \ No newline at end of file +var _0x58fd=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x58fd,0xc4));var _0xd58f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x58fd[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xd58f('0x0'));var util=require(_0xd58f('0x1'));var moment=require(_0xd58f('0x2'));var BPromise=require(_0xd58f('0x3'));var rs=require(_0xd58f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd58f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd58f('0x6'))(_0xd58f('0x7'));var config=require(_0xd58f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd58f('0x9')][_0xd58f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d7b98,_0x5c7805,_0x299097){return new BPromise(function(_0x5c56b4,_0x5b0b51){return client[_0xd58f('0xb')](_0x5d7b98,_0x299097)[_0xd58f('0xc')](function(_0x192c72){logger[_0xd58f('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x5c7805,_0xd58f('0xe'));logger[_0xd58f('0xf')](_0xd58f('0x10'),_0x5c7805,_0xd58f('0xe'),JSON[_0xd58f('0x11')](_0x192c72));if(_0x192c72[_0xd58f('0x12')]){if(_0x192c72[_0xd58f('0x12')]['code']===0x1f4){logger[_0xd58f('0x12')](_0xd58f('0x13'),_0x5c7805,_0x192c72[_0xd58f('0x12')][_0xd58f('0x14')]);return _0x5b0b51(_0x192c72[_0xd58f('0x12')][_0xd58f('0x14')]);}logger['error'](_0xd58f('0x13'),_0x5c7805,_0x192c72[_0xd58f('0x12')][_0xd58f('0x14')]);return _0x5c56b4(_0x192c72[_0xd58f('0x12')][_0xd58f('0x14')]);}else{logger[_0xd58f('0xd')](_0xd58f('0x13'),_0x5c7805,_0xd58f('0xe'));_0x5c56b4(_0x192c72[_0xd58f('0x15')]['message']);}})['catch'](function(_0x46507d){logger[_0xd58f('0x12')](_0xd58f('0x13'),_0x5c7805,_0x46507d);_0x5b0b51(_0x46507d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d655112..9b75f23 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c5a3d,_0x1ac583){var _0x13ffe6=function(_0x65d658){while(--_0x65d658){_0x1c5a3d['push'](_0x1c5a3d['shift']());}};_0x13ffe6(++_0x1ac583);}(_0x70e0,0x17b));var _0x070e=function(_0x468091,_0x51ebbd){_0x468091=_0x468091-0x0;var _0x1e7277=_0x70e0[_0x468091];return _0x1e7277;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d04709c..534b35f 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 _0x7967=['exports','INTEGER','STRING'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x7967,0x1e6));var _0x7796=function(_0x5ed71b,_0x1fe393){_0x5ed71b=_0x5ed71b-0x0;var _0xb4a445=_0x7967[_0x5ed71b];return _0xb4a445;};'use strict';var Sequelize=require('sequelize');module[_0x7796('0x0')]={'penalty':{'type':Sequelize[_0x7796('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7796('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7796('0x2')]}}; \ No newline at end of file +var _0xdb90=['sequelize','exports','INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb90,0x130));var _0x0db9=function(_0x3d05f1,_0x10fab4){_0x3d05f1=_0x3d05f1-0x0;var _0x38cafd=_0xdb90[_0x3d05f1];return _0x38cafd;};'use strict';var Sequelize=require(_0x0db9('0x0'));module[_0x0db9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0db9('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0db9('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index fc7aab8..59c41ab 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 _0x8fca=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x18c339,_0x57f2f5){var _0x1c8d69=function(_0x1fb307){while(--_0x1fb307){_0x18c339['push'](_0x18c339['shift']());}};_0x1c8d69(++_0x57f2f5);}(_0x8fca,0x12b));var _0xa8fc=function(_0x16622d,_0x52bfcc){_0x16622d=_0x16622d-0x0;var _0x57c890=_0x8fca[_0x16622d];return _0x57c890;};'use strict';var _=require(_0xa8fc('0x0'));var util=require('util');var logger=require(_0xa8fc('0x1'))(_0xa8fc('0x2'));var moment=require(_0xa8fc('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8fc('0x4'));var fs=require('fs');var path=require(_0xa8fc('0x5'));var rimraf=require(_0xa8fc('0x6'));var config=require(_0xa8fc('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xa8fc('0x8')]=function(_0x175c53,_0x4876d6){return _0x175c53[_0xa8fc('0x9')](_0xa8fc('0xa'),attributes,{'tableName':_0xa8fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd99c=['./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x47e93d,_0x26bbdd){var _0xe86c46=function(_0x10e072){while(--_0x10e072){_0x47e93d['push'](_0x47e93d['shift']());}};_0xe86c46(++_0x26bbdd);}(_0xd99c,0x1dd));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd99('0x0'));var util=require(_0xcd99('0x1'));var logger=require(_0xcd99('0x2'))(_0xcd99('0x3'));var moment=require('moment');var BPromise=require(_0xcd99('0x4'));var rp=require(_0xcd99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcd99('0x6'));var attributes=require(_0xcd99('0x7'));module[_0xcd99('0x8')]=function(_0x1fab7e,_0x56df9c){return _0x1fab7e[_0xcd99('0x9')](_0xcd99('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index b0b85f1..452b29e 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 _0x303f=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x303f,0xbe));var _0xf303=function(_0x1d2b89,_0x40e588){_0x1d2b89=_0x1d2b89-0x0;var _0x5e4b3a=_0x303f[_0x1d2b89];return _0x5e4b3a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf303('0x0'));var BPromise=require('bluebird');var rs=require(_0xf303('0x1'));var fs=require('fs');var Redis=require(_0xf303('0x2'));var db=require(_0xf303('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf303('0x4'))('rpc');var config=require(_0xf303('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf303('0x6')][_0xf303('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x554710,_0x322d54,_0x4c1434){return new BPromise(function(_0x35eef0,_0x37fce8){return client['request'](_0x554710,_0x4c1434)[_0xf303('0x8')](function(_0x35ac00){logger[_0xf303('0x9')](_0xf303('0xa'),_0x322d54,'request\x20sent');logger[_0xf303('0xb')](_0xf303('0xc'),_0x322d54,'request\x20sent',JSON[_0xf303('0xd')](_0x35ac00));if(_0x35ac00[_0xf303('0xe')]){if(_0x35ac00[_0xf303('0xe')][_0xf303('0xf')]===0x1f4){logger[_0xf303('0xe')](_0xf303('0xa'),_0x322d54,_0x35ac00[_0xf303('0xe')][_0xf303('0x10')]);return _0x37fce8(_0x35ac00[_0xf303('0xe')][_0xf303('0x10')]);}logger[_0xf303('0xe')](_0xf303('0xa'),_0x322d54,_0x35ac00['error'][_0xf303('0x10')]);return _0x35eef0(_0x35ac00[_0xf303('0xe')][_0xf303('0x10')]);}else{logger[_0xf303('0x9')]('UserFaxQueue,\x20%s,\x20%s',_0x322d54,'request\x20sent');_0x35eef0(_0x35ac00[_0xf303('0x11')][_0xf303('0x10')]);}})[_0xf303('0x12')](function(_0x7b47a2){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x322d54,_0x7b47a2);_0x37fce8(_0x7b47a2);});});} \ No newline at end of file +var _0xee08=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xee08,0x15d));var _0x8ee0=function(_0x4bf156,_0x36d300){_0x4bf156=_0x4bf156-0x0;var _0x2e2e62=_0xee08[_0x4bf156];return _0x2e2e62;};'use strict';var _=require(_0x8ee0('0x0'));var util=require(_0x8ee0('0x1'));var moment=require('moment');var BPromise=require(_0x8ee0('0x2'));var rs=require(_0x8ee0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8ee0('0x4'));var logger=require(_0x8ee0('0x5'))(_0x8ee0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8ee0('0x7')][_0x8ee0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1dd015,_0x30a620,_0x4b09af){return new BPromise(function(_0x8b98a7,_0x193533){return client['request'](_0x1dd015,_0x4b09af)[_0x8ee0('0x9')](function(_0x4e9a81){logger[_0x8ee0('0xa')](_0x8ee0('0xb'),_0x30a620,_0x8ee0('0xc'));logger[_0x8ee0('0xd')](_0x8ee0('0xe'),_0x30a620,'request\x20sent',JSON['stringify'](_0x4e9a81));if(_0x4e9a81['error']){if(_0x4e9a81[_0x8ee0('0xf')][_0x8ee0('0x10')]===0x1f4){logger['error'](_0x8ee0('0xb'),_0x30a620,_0x4e9a81[_0x8ee0('0xf')]['message']);return _0x193533(_0x4e9a81[_0x8ee0('0xf')][_0x8ee0('0x11')]);}logger[_0x8ee0('0xf')](_0x8ee0('0xb'),_0x30a620,_0x4e9a81[_0x8ee0('0xf')][_0x8ee0('0x11')]);return _0x8b98a7(_0x4e9a81[_0x8ee0('0xf')][_0x8ee0('0x11')]);}else{logger[_0x8ee0('0xa')](_0x8ee0('0xb'),_0x30a620,'request\x20sent');_0x8b98a7(_0x4e9a81[_0x8ee0('0x12')][_0x8ee0('0x11')]);}})[_0x8ee0('0x13')](function(_0x19852b){logger[_0x8ee0('0xf')](_0x8ee0('0xb'),_0x30a620,_0x19852b);_0x193533(_0x19852b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 333afcc..87d8ade 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x197cb5,_0x56250b){var _0x301ace=function(_0x1b60b6){while(--_0x1b60b6){_0x197cb5['push'](_0x197cb5['shift']());}};_0x301ace(++_0x56250b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1805bd,_0x1c1e7d){_0x1805bd=_0x1805bd-0x0;var _0x56b6f1=_0xedd9[_0x1805bd];return _0x56b6f1;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2d7238,_0x1233bb){var _0x29a67b=function(_0x53ef71){while(--_0x53ef71){_0x2d7238['push'](_0x2d7238['shift']());}};_0x29a67b(++_0x1233bb);}(_0xedd9,0xfc));var _0x9edd=function(_0x42b861,_0x248606){_0x42b861=_0x42b861-0x0;var _0x2f18f9=_0xedd9[_0x42b861];return _0x2f18f9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 40794aa..613b5c4 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 _0xde4e=['sequelize','exports','INTEGER'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0xde4e,0x1ec));var _0xede4=function(_0x272aa6,_0x32a745){_0x272aa6=_0x272aa6-0x0;var _0x2cdf98=_0xde4e[_0x272aa6];return _0x2cdf98;};'use strict';var Sequelize=require(_0xede4('0x0'));module[_0xede4('0x1')]={'penalty':{'type':Sequelize[_0xede4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x584c=['exports','INTEGER','sequelize'];(function(_0x4abd58,_0x523c62){var _0x3608a8=function(_0xa5878){while(--_0xa5878){_0x4abd58['push'](_0x4abd58['shift']());}};_0x3608a8(++_0x523c62);}(_0x584c,0xe6));var _0xc584=function(_0x5d9c08,_0x68d66e){_0x5d9c08=_0x5d9c08-0x0;var _0x3d07ae=_0x584c[_0x5d9c08];return _0x3d07ae;};'use strict';var Sequelize=require(_0xc584('0x0'));module[_0xc584('0x1')]={'penalty':{'type':Sequelize[_0xc584('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 011093d..ef230f2 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 _0xeb3b=['moment','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x1f3f7c,_0x3b1814){var _0x1907ab=function(_0x149e5e){while(--_0x149e5e){_0x1f3f7c['push'](_0x1f3f7c['shift']());}};_0x1907ab(++_0x3b1814);}(_0xeb3b,0xd4));var _0xbeb3=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xeb3b[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var logger=require(_0xbeb3('0x2'))(_0xbeb3('0x3'));var moment=require(_0xbeb3('0x4'));var BPromise=require('bluebird');var rp=require(_0xbeb3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbeb3('0x6'));var config=require(_0xbeb3('0x7'));var attributes=require(_0xbeb3('0x8'));module[_0xbeb3('0x9')]=function(_0x500904,_0xf05199){return _0x500904[_0xbeb3('0xa')]('UserMailQueue',attributes,{'tableName':_0xbeb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0d4=['UserMailQueue','lodash','util','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x245801,_0x3d8556){var _0xbbe558=function(_0x112791){while(--_0x112791){_0x245801['push'](_0x245801['shift']());}};_0xbbe558(++_0x3d8556);}(_0xe0d4,0x151));var _0x4e0d=function(_0x2d2569,_0x4df95e){_0x2d2569=_0x2d2569-0x0;var _0xffdbe5=_0xe0d4[_0x2d2569];return _0xffdbe5;};'use strict';var _=require(_0x4e0d('0x0'));var util=require(_0x4e0d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e0d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e0d('0x3'));var config=require(_0x4e0d('0x4'));var attributes=require(_0x4e0d('0x5'));module[_0x4e0d('0x6')]=function(_0x2c6756,_0x48cce5){return _0x2c6756['define'](_0x4e0d('0x7'),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 e5e417a..2cc1ac8 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x258f88,_0x1840e1){var _0x159bb6=function(_0x300261){while(--_0x300261){_0x258f88['push'](_0x258f88['shift']());}};_0x159bb6(++_0x1840e1);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x4b84[_0x2f4c1c];return _0x25e0f2;};'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});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x008c,0x188));var _0xc008=function(_0x52b016,_0x33ec6e){_0x52b016=_0x52b016-0x0;var _0x13e797=_0x008c[_0x52b016];return _0x13e797;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index b4e2c10..b2f7cfc 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 _0xd0aa=['fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xd0aa,0x193));var _0xad0a=function(_0x1afae2,_0x1931b1){_0x1afae2=_0x1afae2-0x0;var _0x329fbf=_0xd0aa[_0x1afae2];return _0x329fbf;};'use strict';var multer=require(_0xad0a('0x0'));var util=require(_0xad0a('0x1'));var path=require(_0xad0a('0x2'));var timeout=require(_0xad0a('0x3'));var express=require(_0xad0a('0x4'));var router=express['Router']();var fs_extra=require(_0xad0a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad0a('0x6'));var config=require(_0xad0a('0x7'));var controller=require(_0xad0a('0x8'));router[_0xad0a('0x9')]('/',auth['isAuthenticated'](),controller[_0xad0a('0xa')]);module[_0xad0a('0xb')]=router; \ No newline at end of file +var _0x959e=['./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x19ec0d,_0x1f402b){var _0x26d80a=function(_0x3ec1bb){while(--_0x3ec1bb){_0x19ec0d['push'](_0x19ec0d['shift']());}};_0x26d80a(++_0x1f402b);}(_0x959e,0x1e1));var _0xe959=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x959e[_0x4cbf20];return _0x582ae4;};'use strict';var multer=require(_0xe959('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe959('0x1'));var express=require('express');var router=express[_0xe959('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe959('0x3'));var interaction=require(_0xe959('0x4'));var config=require('../../config/environment');var controller=require(_0xe959('0x5'));router['post']('/',auth[_0xe959('0x6')](),controller[_0xe959('0x7')]);module[_0xe959('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 a16a5c9..6946c9a 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 _0x1df9=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x122024,_0x4223f0){var _0xf7d758=function(_0x4cde13){while(--_0x4cde13){_0x122024['push'](_0x122024['shift']());}};_0xf7d758(++_0x4223f0);}(_0x1df9,0xd6));var _0x91df=function(_0x5dc665,_0x36905e){_0x5dc665=_0x5dc665-0x0;var _0x38bd5b=_0x1df9[_0x5dc665];return _0x38bd5b;};'use strict';var Sequelize=require(_0x91df('0x0'));module[_0x91df('0x1')]={'body':{'type':Sequelize[_0x91df('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x91df('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x91df('0x3')]}}; \ No newline at end of file +var _0x9739=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x5c4746,_0x36add6){var _0x25adf0=function(_0x44a9a9){while(--_0x44a9a9){_0x5c4746['push'](_0x5c4746['shift']());}};_0x25adf0(++_0x36add6);}(_0x9739,0xc6));var _0x9973=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0x9739[_0x1df473];return _0x1bdd49;};'use strict';var Sequelize=require(_0x9973('0x0'));module[_0x9973('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x9973('0x2')]},'recipientsId':{'type':Sequelize[_0x9973('0x3')]},'recipientsDescription':{'type':Sequelize[_0x9973('0x2')]},'beep':{'type':Sequelize[_0x9973('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 69517de..eea9db7 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 _0xc921=['Content-Range','reject','save','update','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','transaction','create','forEach','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./userNotification.socket','register','sendStatus','status','end','json','limit','undefined','count','offset'];(function(_0x1b82c2,_0x1996b7){var _0x2c2419=function(_0x4e9d3c){while(--_0x4e9d3c){_0x1b82c2['push'](_0x1b82c2['shift']());}};_0x2c2419(++_0x1996b7);}(_0xc921,0x1b7));var _0x1c92=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0xc921[_0x2b152a];return _0x2ad4c7;};'use strict';var emlformat=require(_0x1c92('0x0'));var rimraf=require(_0x1c92('0x1'));var zipdir=require(_0x1c92('0x2'));var jsonpatch=require(_0x1c92('0x3'));var rp=require('request-promise');var moment=require(_0x1c92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c92('0x5'));var util=require(_0x1c92('0x6'));var path=require(_0x1c92('0x7'));var sox=require(_0x1c92('0x8'));var csv=require(_0x1c92('0x9'));var ejs=require(_0x1c92('0xa'));var fs=require('fs');var fs_extra=require(_0x1c92('0xb'));var _=require(_0x1c92('0xc'));var squel=require(_0x1c92('0xd'));var crypto=require(_0x1c92('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1c92('0x9'));var querystring=require(_0x1c92('0xf'));var Papa=require(_0x1c92('0x10'));var Redis=require(_0x1c92('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1c92('0x12'));var as=require(_0x1c92('0x13'));var hardwareService=require(_0x1c92('0x14'));var logger=require(_0x1c92('0x15'))('api');var utils=require(_0x1c92('0x16'));var config=require(_0x1c92('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c92('0x18'))['db'];config[_0x1c92('0x19')]=_['defaults'](config[_0x1c92('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c92('0x19')]));require(_0x1c92('0x1a'))[_0x1c92('0x1b')](socket);function respondWithStatusCode(_0x353343,_0x191597){_0x191597=_0x191597||0xcc;return function(_0x24e686){if(_0x24e686){return _0x353343[_0x1c92('0x1c')](_0x191597);}return _0x353343[_0x1c92('0x1d')](_0x191597)[_0x1c92('0x1e')]();};}function respondWithResult(_0x5863cc,_0x254e3c){_0x254e3c=_0x254e3c||0xc8;return function(_0x324061){if(_0x324061){return _0x5863cc[_0x1c92('0x1d')](_0x254e3c)[_0x1c92('0x1f')](_0x324061);}};}function respondWithFilteredResult(_0x5985ae,_0x3998cb){return function(_0x4ce419){if(_0x4ce419){var _0x263992=typeof _0x3998cb['offset']==='undefined'&&typeof _0x3998cb[_0x1c92('0x20')]===_0x1c92('0x21');var _0x19c087=_0x4ce419[_0x1c92('0x22')];var _0x2f5684=_0x263992?0x0:_0x3998cb[_0x1c92('0x23')];var _0x184e54=_0x263992?_0x4ce419[_0x1c92('0x22')]:_0x3998cb[_0x1c92('0x23')]+_0x3998cb[_0x1c92('0x20')];var _0x3a49b8;if(_0x184e54>=_0x19c087){_0x184e54=_0x19c087;_0x3a49b8=0xc8;}else{_0x3a49b8=0xce;}_0x5985ae[_0x1c92('0x1d')](_0x3a49b8);return _0x5985ae['set'](_0x1c92('0x24'),_0x2f5684+'-'+_0x184e54+'/'+_0x19c087)['json'](_0x4ce419);}return null;};}function patchUpdates(_0x1de2ae){return function(_0x20646b){try{jsonpatch['apply'](_0x20646b,_0x1de2ae,!![]);}catch(_0x9ba63){return BPromise[_0x1c92('0x25')](_0x9ba63);}return _0x20646b[_0x1c92('0x26')]();};}function saveUpdates(_0x5dd3af,_0x3b947b){return function(_0x16996a){if(_0x16996a){return _0x16996a[_0x1c92('0x27')](_0x5dd3af)[_0x1c92('0x28')](function(_0x34c270){return _0x34c270;});}return null;};}function removeEntity(_0x3d4cce,_0x2f21a8){return function(_0x54cf4e){if(_0x54cf4e){return _0x54cf4e[_0x1c92('0x29')]()[_0x1c92('0x28')](function(){_0x3d4cce[_0x1c92('0x1d')](0xcc)[_0x1c92('0x1e')]();});}};}function handleEntityNotFound(_0x1b4ee4,_0x364a77){return function(_0x5728ce){if(!_0x5728ce){_0x1b4ee4[_0x1c92('0x1c')](0x194);}return _0x5728ce;};}function handleError(_0x54cbfa,_0x2c856b){_0x2c856b=_0x2c856b||0x1f4;return function(_0x408ea6){logger[_0x1c92('0x2a')](_0x408ea6['stack']);if(_0x408ea6[_0x1c92('0x2b')]){delete _0x408ea6[_0x1c92('0x2b')];}_0x54cbfa['status'](_0x2c856b)['send'](_0x408ea6);};}exports[_0x1c92('0x2c')]=function(_0x4bab65,_0x63324c,_0x1ad6f2){if(!_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x2e')](_0x1c92('0x2f'))&&!_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x2e')](_0x1c92('0x30'))){throw new db['Sequelize']['ValidationError'](_0x1c92('0x31'));}else{if(_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x2e')](_0x1c92('0x30'))&&!_0x4bab65['body']['hasOwnProperty']('view')){throw new db[(_0x1c92('0x32'))][(_0x1c92('0x33'))](_0x1c92('0x34'));}if(!_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x2e')](_0x1c92('0x35'))){throw new db[(_0x1c92('0x32'))][(_0x1c92('0x33'))](_0x1c92('0x36'));}else{try{var _0x160f81=JSON[_0x1c92('0x37')](_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x35')]);}catch(_0x46fe75){logger[_0x1c92('0x2a')](_0x46fe75);throw new db[(_0x1c92('0x32'))][(_0x1c92('0x33'))](_0x1c92('0x38'));}var _0x2a250a=[_0x1c92('0x39'),_0x1c92('0x3a'),_0x1c92('0x3b'),_0x1c92('0x3c'),_0x1c92('0x3d'),'voicequeue','whatsappqueue','team','user'];if(_[_0x1c92('0x3e')](_0x160f81,function(_0xaa5d97){return!_[_0x1c92('0x3f')](_0x2a250a,_0xaa5d97[_0x1c92('0x40')]['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x1c92('0x41'));}}}var _0x49347e={};_0x49347e[_0x1c92('0x42')]=_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x2e')](_0x1c92('0x42'))?_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x42')]:_0x4bab65[_0x1c92('0x43')]['fullname'];_0x49347e[_0x1c92('0x44')]=_[_0x1c92('0x45')](_0x4bab65[_0x1c92('0x2d')][_0x1c92('0x44')])?null:_0x4bab65[_0x1c92('0x2d')]['recipientsDescription'];_0x49347e[_0x1c92('0x46')]=_0x4bab65[_0x1c92('0x2d')]['beep']||![];_0x49347e[_0x1c92('0x47')]=_0x4bab65['user']['id'];return getContent(_0x4bab65[_0x1c92('0x2d')])[_0x1c92('0x28')](function(_0x5cfffe){_0x49347e[_0x1c92('0x2d')]=_0x5cfffe;return getRecipients(_0x160f81);})['then'](function(_0x30baf1){_0x49347e['recipientsId']=_[_0x1c92('0x48')](_0x30baf1)[_0x1c92('0x49')](',');return db['sequelize'][_0x1c92('0x4a')](function(_0xc9864e){return db['UserNotification'][_0x1c92('0x4b')](_0x49347e,{'raw':!![],'transaction':_0xc9864e})[_0x1c92('0x28')](function(_0x14ed8f){var _0x50ec97={'sender':_0x49347e[_0x1c92('0x42')],'description':_0x49347e[_0x1c92('0x44')],'content':_0x49347e['body'],'beep':_0x49347e[_0x1c92('0x46')]};_0x30baf1[_0x1c92('0x4c')](function(_0x1d1cc0){_0x50ec97['recipient']=_0x1d1cc0;socket[_0x1c92('0x4d')]('userNotification:send',_0x50ec97);});return _0x14ed8f;});});})[_0x1c92('0x28')](respondWithResult(_0x63324c,0xc9))[_0x1c92('0x4e')](handleError(_0x63324c,null));};function getContent(_0x181be){return new BPromise(function(_0x537fd3,_0x503513){if(_0x181be['text']){_0x537fd3(_0x181be[_0x1c92('0x2f')]);return;}return db[_0x1c92('0x4f')][_0x1c92('0x50')]({'attributes':[_0x1c92('0x51')],'where':{'id':_0x181be['TemplateId']},'raw':!![]})['then'](function(_0x3f1338){if(!_0x3f1338)throw new db[(_0x1c92('0x32'))]['ValidationError'](_0x1c92('0x52'));var _0x3d556f=Mustache['render'](_0x3f1338[_0x1c92('0x51')],_0x181be[_0x1c92('0x53')]);_0x537fd3(_0x3d556f);})['catch'](function(_0x34f0b7){_0x503513(_0x34f0b7);});});}function getRecipients(_0x596535){return new BPromise(function(_0x367b5b,_0x38cd7f){var _0x1132a0=[];var _0x200383=[];_0x596535[_0x1c92('0x4c')](function(_0x504d6e){var _0x2e83ef=_[_0x1c92('0x54')](_0x504d6e['model']['toLowerCase']());if(_0x2e83ef===_0x1c92('0x55')){_0x1132a0=_[_0x1c92('0x56')](_0x1132a0,_0x504d6e[_0x1c92('0x57')]);}else{if(_['includes'](_0x2e83ef,_0x1c92('0x58')))_0x2e83ef=_0x2e83ef['replace'](_0x1c92('0x58'),_0x1c92('0x59'));_0x504d6e[_0x1c92('0x57')][_0x1c92('0x4c')](function(_0x514488){_0x200383[_0x1c92('0x5a')](getAgents(_0x2e83ef,_0x514488));});}});return BPromise[_0x1c92('0x5b')](_0x200383)[_0x1c92('0x28')](function(_0x4e4cb9){_0x1132a0=_[_0x1c92('0x56')](_0x1132a0,_[_0x1c92('0x5c')](_0x4e4cb9));_0x367b5b(_0x1132a0);})['catch'](function(_0x27351c){_0x38cd7f(_0x27351c);});});}function getAgents(_0xa7316d,_0x50bcc6){return new BPromise(function(_0x2382c1,_0x4a1d12){return db[_0xa7316d][_0x1c92('0x50')]({'where':{'id':_0x50bcc6}})['then'](function(_0x32b98f){return _0x32b98f[_0x1c92('0x5d')]({'attributes':['id'],'raw':!![]})[_0x1c92('0x28')](function(_0x32f900){var _0x71ecaa=_[_0x1c92('0x5e')](_0x32f900,'id');_0x2382c1(_0x71ecaa);});})['catch'](function(_0x5d0a96){_0x4a1d12(_0x5d0a96);});});} \ No newline at end of file +var _0x06bb=['model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','create','recipient','emit','userNotification:send','Template','findOne','html','render','catch','forEach','startCase','User','includes','queue','Queue','ids','push','all','flatten','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','sendUserNotification','text','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some'];(function(_0x324acd,_0x8b088e){var _0x38d043=function(_0x13b010){while(--_0x13b010){_0x324acd['push'](_0x324acd['shift']());}};_0x38d043(++_0x8b088e);}(_0x06bb,0x87));var _0xb06b=function(_0x3dedd3,_0x9634cb){_0x3dedd3=_0x3dedd3-0x0;var _0x27ddd0=_0x06bb[_0x3dedd3];return _0x27ddd0;};'use strict';var emlformat=require(_0xb06b('0x0'));var rimraf=require(_0xb06b('0x1'));var zipdir=require(_0xb06b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb06b('0x3'));var BPromise=require(_0xb06b('0x4'));var Mustache=require(_0xb06b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb06b('0x6'));var csv=require(_0xb06b('0x7'));var ejs=require(_0xb06b('0x8'));var fs=require('fs');var fs_extra=require(_0xb06b('0x9'));var _=require(_0xb06b('0xa'));var squel=require(_0xb06b('0xb'));var crypto=require('crypto');var jsforce=require(_0xb06b('0xc'));var deskjs=require(_0xb06b('0xd'));var toCsv=require(_0xb06b('0x7'));var querystring=require(_0xb06b('0xe'));var Papa=require('papaparse');var Redis=require(_0xb06b('0xf'));var authService=require(_0xb06b('0x10'));var qs=require(_0xb06b('0x11'));var as=require(_0xb06b('0x12'));var hardwareService=require(_0xb06b('0x13'));var logger=require(_0xb06b('0x14'))(_0xb06b('0x15'));var utils=require('../../config/utils');var config=require(_0xb06b('0x16'));var licenseUtil=require(_0xb06b('0x17'));var db=require('../../mysqldb')['db'];config[_0xb06b('0x18')]=_[_0xb06b('0x19')](config[_0xb06b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb06b('0x1a'))(new Redis(config[_0xb06b('0x18')]));require(_0xb06b('0x1b'))[_0xb06b('0x1c')](socket);function respondWithStatusCode(_0x4ca2fc,_0x505fb6){_0x505fb6=_0x505fb6||0xcc;return function(_0x3519e6){if(_0x3519e6){return _0x4ca2fc['sendStatus'](_0x505fb6);}return _0x4ca2fc[_0xb06b('0x1d')](_0x505fb6)[_0xb06b('0x1e')]();};}function respondWithResult(_0x3209cc,_0x1562e0){_0x1562e0=_0x1562e0||0xc8;return function(_0x138a5b){if(_0x138a5b){return _0x3209cc[_0xb06b('0x1d')](_0x1562e0)[_0xb06b('0x1f')](_0x138a5b);}};}function respondWithFilteredResult(_0x544802,_0x3f5d0c){return function(_0xbb4813){if(_0xbb4813){var _0x228aa1=typeof _0x3f5d0c[_0xb06b('0x20')]===_0xb06b('0x21')&&typeof _0x3f5d0c['limit']==='undefined';var _0x4c1420=_0xbb4813[_0xb06b('0x22')];var _0x4ec9fa=_0x228aa1?0x0:_0x3f5d0c[_0xb06b('0x20')];var _0x388e24=_0x228aa1?_0xbb4813[_0xb06b('0x22')]:_0x3f5d0c['offset']+_0x3f5d0c['limit'];var _0x2e8f62;if(_0x388e24>=_0x4c1420){_0x388e24=_0x4c1420;_0x2e8f62=0xc8;}else{_0x2e8f62=0xce;}_0x544802['status'](_0x2e8f62);return _0x544802[_0xb06b('0x23')](_0xb06b('0x24'),_0x4ec9fa+'-'+_0x388e24+'/'+_0x4c1420)[_0xb06b('0x1f')](_0xbb4813);}return null;};}function patchUpdates(_0x24afc3){return function(_0xd3e217){try{jsonpatch[_0xb06b('0x25')](_0xd3e217,_0x24afc3,!![]);}catch(_0x143912){return BPromise[_0xb06b('0x26')](_0x143912);}return _0xd3e217[_0xb06b('0x27')]();};}function saveUpdates(_0x5281f3,_0x48932d){return function(_0x164bde){if(_0x164bde){return _0x164bde[_0xb06b('0x28')](_0x5281f3)[_0xb06b('0x29')](function(_0x322836){return _0x322836;});}return null;};}function removeEntity(_0x12d6c0,_0x362c8c){return function(_0x474fe1){if(_0x474fe1){return _0x474fe1[_0xb06b('0x2a')]()[_0xb06b('0x29')](function(){_0x12d6c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30b2ee,_0x250ae5){return function(_0x4760db){if(!_0x4760db){_0x30b2ee[_0xb06b('0x2b')](0x194);}return _0x4760db;};}function handleError(_0x592bd3,_0x3c0d79){_0x3c0d79=_0x3c0d79||0x1f4;return function(_0x5b7b84){logger['error'](_0x5b7b84[_0xb06b('0x2c')]);if(_0x5b7b84['name']){delete _0x5b7b84[_0xb06b('0x2d')];}_0x592bd3[_0xb06b('0x1d')](_0x3c0d79)[_0xb06b('0x2e')](_0x5b7b84);};}exports[_0xb06b('0x2f')]=function(_0x20b5fd,_0x115b23,_0x458393){if(!_0x20b5fd['body']['hasOwnProperty'](_0xb06b('0x30'))&&!_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x32')](_0xb06b('0x33'))){throw new db[(_0xb06b('0x34'))][(_0xb06b('0x35'))](_0xb06b('0x36'));}else{if(_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x32')]('TemplateId')&&!_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x32')](_0xb06b('0x37'))){throw new db[(_0xb06b('0x34'))]['ValidationError'](_0xb06b('0x38'));}if(!_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x32')](_0xb06b('0x39'))){throw new db['Sequelize'][(_0xb06b('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x296edb=JSON[_0xb06b('0x3a')](_0x20b5fd['body'][_0xb06b('0x39')]);}catch(_0x2e3135){logger[_0xb06b('0x3b')](_0x2e3135);throw new db[(_0xb06b('0x34'))][(_0xb06b('0x35'))](_0xb06b('0x3c'));}var _0x1be7f4=[_0xb06b('0x3d'),'faxqueue',_0xb06b('0x3e'),_0xb06b('0x3f'),_0xb06b('0x40'),'voicequeue',_0xb06b('0x41'),_0xb06b('0x42'),_0xb06b('0x43')];if(_[_0xb06b('0x44')](_0x296edb,function(_0x1b6b37){return!_['includes'](_0x1be7f4,_0x1b6b37[_0xb06b('0x45')][_0xb06b('0x46')]());})){throw new db[(_0xb06b('0x34'))][(_0xb06b('0x35'))](_0xb06b('0x47'));}}}var _0x5bc12e={};_0x5bc12e[_0xb06b('0x48')]=_0x20b5fd[_0xb06b('0x31')]['hasOwnProperty'](_0xb06b('0x48'))?_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x48')]:_0x20b5fd[_0xb06b('0x43')][_0xb06b('0x49')];_0x5bc12e['recipientsDescription']=_[_0xb06b('0x4a')](_0x20b5fd['body']['recipientsDescription'])?null:_0x20b5fd[_0xb06b('0x31')][_0xb06b('0x4b')];_0x5bc12e['beep']=_0x20b5fd['body'][_0xb06b('0x4c')]||![];_0x5bc12e[_0xb06b('0x4d')]=_0x20b5fd[_0xb06b('0x43')]['id'];return getContent(_0x20b5fd['body'])[_0xb06b('0x29')](function(_0x257d41){_0x5bc12e[_0xb06b('0x31')]=_0x257d41;return getRecipients(_0x296edb);})[_0xb06b('0x29')](function(_0x1b0aee){_0x5bc12e['recipientsId']=_[_0xb06b('0x4e')](_0x1b0aee)[_0xb06b('0x4f')](',');return db[_0xb06b('0x50')][_0xb06b('0x51')](function(_0x2425ba){return db['UserNotification'][_0xb06b('0x52')](_0x5bc12e,{'raw':!![],'transaction':_0x2425ba})[_0xb06b('0x29')](function(_0x3943a1){var _0x4c5dc9={'sender':_0x5bc12e[_0xb06b('0x48')],'description':_0x5bc12e['recipientsDescription'],'content':_0x5bc12e[_0xb06b('0x31')],'beep':_0x5bc12e[_0xb06b('0x4c')]};_0x1b0aee['forEach'](function(_0x18bd32){_0x4c5dc9[_0xb06b('0x53')]=_0x18bd32;socket[_0xb06b('0x54')](_0xb06b('0x55'),_0x4c5dc9);});return _0x3943a1;});});})[_0xb06b('0x29')](respondWithResult(_0x115b23,0xc9))['catch'](handleError(_0x115b23,null));};function getContent(_0x4ef40a){return new BPromise(function(_0x4df64e,_0x2ce0a4){if(_0x4ef40a['text']){_0x4df64e(_0x4ef40a[_0xb06b('0x30')]);return;}return db[_0xb06b('0x56')][_0xb06b('0x57')]({'attributes':[_0xb06b('0x58')],'where':{'id':_0x4ef40a['TemplateId']},'raw':!![]})['then'](function(_0x21366d){if(!_0x21366d)throw new db[(_0xb06b('0x34'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x33faaa=Mustache[_0xb06b('0x59')](_0x21366d[_0xb06b('0x58')],_0x4ef40a[_0xb06b('0x37')]);_0x4df64e(_0x33faaa);})[_0xb06b('0x5a')](function(_0x197b4a){_0x2ce0a4(_0x197b4a);});});}function getRecipients(_0x5e4cc1){return new BPromise(function(_0x58852d,_0x42cd8d){var _0x5276e4=[];var _0x138aae=[];_0x5e4cc1[_0xb06b('0x5b')](function(_0x2492d8){var _0x22f1a2=_[_0xb06b('0x5c')](_0x2492d8[_0xb06b('0x45')]['toLowerCase']());if(_0x22f1a2===_0xb06b('0x5d')){_0x5276e4=_['union'](_0x5276e4,_0x2492d8['ids']);}else{if(_[_0xb06b('0x5e')](_0x22f1a2,_0xb06b('0x5f')))_0x22f1a2=_0x22f1a2['replace']('queue',_0xb06b('0x60'));_0x2492d8[_0xb06b('0x61')][_0xb06b('0x5b')](function(_0x458e6c){_0x138aae[_0xb06b('0x62')](getAgents(_0x22f1a2,_0x458e6c));});}});return BPromise[_0xb06b('0x63')](_0x138aae)[_0xb06b('0x29')](function(_0x379971){_0x5276e4=_['union'](_0x5276e4,_[_0xb06b('0x64')](_0x379971));_0x58852d(_0x5276e4);})[_0xb06b('0x5a')](function(_0x2acd19){_0x42cd8d(_0x2acd19);});});}function getAgents(_0x4fc39c,_0x5f027a){return new BPromise(function(_0x2ab67c,_0x1aa7ee){return db[_0x4fc39c]['findOne']({'where':{'id':_0x5f027a}})[_0xb06b('0x29')](function(_0x1e28c3){return _0x1e28c3[_0xb06b('0x65')]({'attributes':['id'],'raw':!![]})['then'](function(_0x256f5f){var _0x21c29b=_['map'](_0x256f5f,'id');_0x2ab67c(_0x21c29b);});})['catch'](function(_0x34cc32){_0x1aa7ee(_0x34cc32);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 7ef1de3..cd422f0 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 _0x86e0=['../../mysqldb','emit','hasOwnProperty','events'];(function(_0x3c7fae,_0x1f6d6f){var _0x2ae9e6=function(_0x2615c2){while(--_0x2615c2){_0x3c7fae['push'](_0x3c7fae['shift']());}};_0x2ae9e6(++_0x1f6d6f);}(_0x86e0,0x1b7));var _0x086e=function(_0x4fa8cf,_0x4c20f8){_0x4fa8cf=_0x4fa8cf-0x0;var _0x1b7830=_0x86e0[_0x4fa8cf];return _0x1b7830;};'use strict';var EventEmitter=require(_0x086e('0x0'));var UserNotification=require(_0x086e('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d8dfb){return function(_0x397892,_0x2df199,_0x3685a4){UserNotificationEvents[_0x086e('0x2')](_0x3d8dfb+':'+_0x397892['id'],_0x397892);UserNotificationEvents['emit'](_0x3d8dfb,_0x397892);_0x3685a4(null);};}for(var e in events){if(events[_0x086e('0x3')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xf1a5=['remove','hasOwnProperty','hook','events','../../mysqldb','UserNotification'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf1a5,0x1c5));var _0x5f1a=function(_0xe807e5,_0xaecc3e){_0xe807e5=_0xe807e5-0x0;var _0x522e42=_0xf1a5[_0xe807e5];return _0x522e42;};'use strict';var EventEmitter=require(_0x5f1a('0x0'));var UserNotification=require(_0x5f1a('0x1'))['db'][_0x5f1a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5f1a('0x3')};function emitEvent(_0x5a7074){return function(_0x32b474,_0x30f694,_0x22d1a2){UserNotificationEvents['emit'](_0x5a7074+':'+_0x32b474['id'],_0x32b474);UserNotificationEvents['emit'](_0x5a7074,_0x32b474);_0x22d1a2(null);};}for(var e in events){if(events[_0x5f1a('0x4')](e)){var event=events[e];UserNotification[_0x5f1a('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 73b3a45..1913eaf 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 _0x8fdb=['path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8fdb,0xe9));var _0xb8fd=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x8fdb[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0xb8fd('0x0'));var util=require(_0xb8fd('0x1'));var logger=require(_0xb8fd('0x2'))(_0xb8fd('0x3'));var moment=require(_0xb8fd('0x4'));var BPromise=require(_0xb8fd('0x5'));var rp=require(_0xb8fd('0x6'));var fs=require('fs');var path=require(_0xb8fd('0x7'));var rimraf=require(_0xb8fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb8fd('0x9'));module[_0xb8fd('0xa')]=function(_0x1de637,_0x1b27f6){return _0x1de637['define'](_0xb8fd('0xb'),attributes,{'tableName':_0xb8fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb8fd('0xd'),'collate':_0xb8fd('0xe')});}; \ No newline at end of file +var _0x6692=['rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25e265,_0x3000df){var _0x2f1519=function(_0x4c7a5f){while(--_0x4c7a5f){_0x25e265['push'](_0x25e265['shift']());}};_0x2f1519(++_0x3000df);}(_0x6692,0x69));var _0x2669=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0x6692[_0xed5f9c];return _0x3a1c43;};'use strict';var _=require(_0x2669('0x0'));var util=require('util');var logger=require(_0x2669('0x1'))(_0x2669('0x2'));var moment=require(_0x2669('0x3'));var BPromise=require(_0x2669('0x4'));var rp=require(_0x2669('0x5'));var fs=require('fs');var path=require(_0x2669('0x6'));var rimraf=require(_0x2669('0x7'));var config=require(_0x2669('0x8'));var attributes=require(_0x2669('0x9'));module[_0x2669('0xa')]=function(_0x238ae7,_0x109677){return _0x238ae7[_0x2669('0xb')](_0x2669('0xc'),attributes,{'tableName':_0x2669('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2669('0xe'),'collate':_0x2669('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 55a3655..f95e863 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 _0x865c=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x583b67,_0x232b31){var _0x449294=function(_0x3b1cc4){while(--_0x3b1cc4){_0x583b67['push'](_0x583b67['shift']());}};_0x449294(++_0x232b31);}(_0x865c,0x12d));var _0xc865=function(_0x307d40,_0x5bd6b2){_0x307d40=_0x307d40-0x0;var _0x4e80a5=_0x865c[_0x307d40];return _0x4e80a5;};'use strict';var _=require(_0xc865('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc865('0x1'));var rs=require(_0xc865('0x2'));var fs=require('fs');var Redis=require(_0xc865('0x3'));var db=require(_0xc865('0x4'))['db'];var utils=require(_0xc865('0x5'));var logger=require(_0xc865('0x6'))(_0xc865('0x7'));var config=require(_0xc865('0x8'));var jayson=require(_0xc865('0x9'));var client=jayson[_0xc865('0xa')][_0xc865('0xb')]({'port':0x232a});config[_0xc865('0xc')]=_[_0xc865('0xd')](config[_0xc865('0xc')],{'host':_0xc865('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc865('0xc')]));require(_0xc865('0xf'))['register'](socket);function respondWithRpcPromise(_0x1c069c,_0x1d24ae,_0x197874){return new BPromise(function(_0x12f4a4,_0x54a79c){return client[_0xc865('0x10')](_0x1c069c,_0x197874)[_0xc865('0x11')](function(_0x3c3b5e){logger['info'](_0xc865('0x12'),_0x1d24ae,_0xc865('0x13'));logger[_0xc865('0x14')](_0xc865('0x15'),_0x1d24ae,'request\x20sent',JSON[_0xc865('0x16')](_0x3c3b5e));if(_0x3c3b5e[_0xc865('0x17')]){if(_0x3c3b5e[_0xc865('0x17')][_0xc865('0x18')]===0x1f4){logger[_0xc865('0x17')]('UserNotification,\x20%s,\x20%s',_0x1d24ae,_0x3c3b5e[_0xc865('0x17')]['message']);return _0x54a79c(_0x3c3b5e[_0xc865('0x17')][_0xc865('0x19')]);}logger[_0xc865('0x17')]('UserNotification,\x20%s,\x20%s',_0x1d24ae,_0x3c3b5e[_0xc865('0x17')]['message']);return _0x12f4a4(_0x3c3b5e[_0xc865('0x17')]['message']);}else{logger[_0xc865('0x1a')](_0xc865('0x12'),_0x1d24ae,_0xc865('0x13'));_0x12f4a4(_0x3c3b5e['result'][_0xc865('0x19')]);}})[_0xc865('0x1b')](function(_0x4e8f41){logger['error'](_0xc865('0x12'),_0x1d24ae,_0x4e8f41);_0x54a79c(_0x4e8f41);});});} \ No newline at end of file +var _0x63d8=['jayson/promise','redis','defaults','localhost','./userNotification.socket','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36a029,_0x3163b9){var _0x41f0d0=function(_0x402635){while(--_0x402635){_0x36a029['push'](_0x36a029['shift']());}};_0x41f0d0(++_0x3163b9);}(_0x63d8,0x123));var _0x863d=function(_0x3f16d5,_0x4e1c00){_0x3f16d5=_0x3f16d5-0x0;var _0x1641f1=_0x63d8[_0x3f16d5];return _0x1641f1;};'use strict';var _=require(_0x863d('0x0'));var util=require('util');var moment=require(_0x863d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x863d('0x2'));var db=require(_0x863d('0x3'))['db'];var utils=require(_0x863d('0x4'));var logger=require(_0x863d('0x5'))(_0x863d('0x6'));var config=require(_0x863d('0x7'));var jayson=require(_0x863d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x863d('0x9')]=_[_0x863d('0xa')](config[_0x863d('0x9')],{'host':_0x863d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x863d('0x9')]));require(_0x863d('0xc'))['register'](socket);function respondWithRpcPromise(_0x46c3f4,_0x1ac35f,_0x729cab){return new BPromise(function(_0x4286d9,_0x4f60f4){return client['request'](_0x46c3f4,_0x729cab)['then'](function(_0x5e83a4){logger['info'](_0x863d('0xd'),_0x1ac35f,_0x863d('0xe'));logger[_0x863d('0xf')](_0x863d('0x10'),_0x1ac35f,_0x863d('0xe'),JSON[_0x863d('0x11')](_0x5e83a4));if(_0x5e83a4[_0x863d('0x12')]){if(_0x5e83a4[_0x863d('0x12')][_0x863d('0x13')]===0x1f4){logger[_0x863d('0x12')](_0x863d('0xd'),_0x1ac35f,_0x5e83a4[_0x863d('0x12')]['message']);return _0x4f60f4(_0x5e83a4[_0x863d('0x12')][_0x863d('0x14')]);}logger[_0x863d('0x12')]('UserNotification,\x20%s,\x20%s',_0x1ac35f,_0x5e83a4[_0x863d('0x12')][_0x863d('0x14')]);return _0x4286d9(_0x5e83a4['error'][_0x863d('0x14')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x1ac35f,_0x863d('0xe'));_0x4286d9(_0x5e83a4[_0x863d('0x15')][_0x863d('0x14')]);}})[_0x863d('0x16')](function(_0x210123){logger[_0x863d('0x12')](_0x863d('0xd'),_0x1ac35f,_0x210123);_0x4f60f4(_0x210123);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 5040e2c..491d751 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 _0xba75=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x5a2b73,_0x17fd76){var _0x492b1c=function(_0x33539f){while(--_0x33539f){_0x5a2b73['push'](_0x5a2b73['shift']());}};_0x492b1c(++_0x17fd76);}(_0xba75,0xad));var _0x5ba7=function(_0x2abe9a,_0x426745){_0x2abe9a=_0x2abe9a-0x0;var _0xdd91ac=_0xba75[_0x2abe9a];return _0xdd91ac;};'use strict';var UserNotificationEvents=require(_0x5ba7('0x0'));var events=[_0x5ba7('0x1'),'remove',_0x5ba7('0x2')];function createListener(_0xee9e76,_0x4eb18c){return function(_0x52f1a3){_0x4eb18c[_0x5ba7('0x3')](_0xee9e76,_0x52f1a3);};}function removeListener(_0x22510d,_0x4689d8){return function(){UserNotificationEvents[_0x5ba7('0x4')](_0x22510d,_0x4689d8);};}exports[_0x5ba7('0x5')]=function(_0xd726de){for(var _0x574451=0x0,_0x31eb72=events[_0x5ba7('0x6')];_0x574451<_0x31eb72;_0x574451++){var _0x15ed11=events[_0x574451];var _0x2fe0ed=createListener(_0x5ba7('0x7')+_0x15ed11,_0xd726de);UserNotificationEvents['on'](_0x15ed11,_0x2fe0ed);}}; \ No newline at end of file +var _0xcef1=['removeListener','register','length','userNotification:','save'];(function(_0x4d1279,_0x38bfbd){var _0x4f606e=function(_0x20a843){while(--_0x20a843){_0x4d1279['push'](_0x4d1279['shift']());}};_0x4f606e(++_0x38bfbd);}(_0xcef1,0x171));var _0x1cef=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcef1[_0x502c7d];return _0x30b7ed;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1cef('0x0'),'remove','update'];function createListener(_0x57e130,_0x3cebb4){return function(_0x3a82d8){_0x3cebb4['emit'](_0x57e130,_0x3a82d8);};}function removeListener(_0x5712e2,_0xa36ee3){return function(){UserNotificationEvents[_0x1cef('0x1')](_0x5712e2,_0xa36ee3);};}exports[_0x1cef('0x2')]=function(_0xf0459b){for(var _0x5e8460=0x0,_0x2c6324=events[_0x1cef('0x3')];_0x5e8460<_0x2c6324;_0x5e8460++){var _0xf02149=events[_0x5e8460];var _0x3d7bb6=createListener(_0x1cef('0x4')+_0xf02149,_0xf0459b);UserNotificationEvents['on'](_0xf02149,_0x3d7bb6);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3915901..9824830 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20c451,_0x1897b0){var _0xdd63b3=function(_0x1de55e){while(--_0x1de55e){_0x20c451['push'](_0x20c451['shift']());}};_0xdd63b3(++_0x1897b0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x40c8cc,_0x2eae97){var _0x5bb9e8=function(_0x526307){while(--_0x526307){_0x40c8cc['push'](_0x40c8cc['shift']());}};_0x5bb9e8(++_0x2eae97);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 d989830..fa6ad8f 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 _0xb87c=['INTEGER','exports'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xb87c,0x1d7));var _0xcb87=function(_0x1b1223,_0x44c10d){_0x1b1223=_0x1b1223-0x0;var _0x3d8c10=_0xb87c[_0x1b1223];return _0x3d8c10;};'use strict';var Sequelize=require('sequelize');module[_0xcb87('0x0')]={'penalty':{'type':Sequelize[_0xcb87('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8169=['sequelize','exports','INTEGER'];(function(_0x1b6a55,_0x24404d){var _0x58aa58=function(_0x4cc9fb){while(--_0x4cc9fb){_0x1b6a55['push'](_0x1b6a55['shift']());}};_0x58aa58(++_0x24404d);}(_0x8169,0x1b0));var _0x9816=function(_0x18919a,_0x9f8c7d){_0x18919a=_0x18919a-0x0;var _0x21fbcf=_0x8169[_0x18919a];return _0x21fbcf;};'use strict';var Sequelize=require(_0x9816('0x0'));module[_0x9816('0x1')]={'penalty':{'type':Sequelize[_0x9816('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 e55c00e..47581cf 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 _0xb532=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api','request-promise'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xb532,0xac));var _0x2b53=function(_0x4250b4,_0x3fd543){_0x4250b4=_0x4250b4-0x0;var _0x8a4807=_0xb532[_0x4250b4];return _0x8a4807;};'use strict';var _=require(_0x2b53('0x0'));var util=require('util');var logger=require(_0x2b53('0x1'))(_0x2b53('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2b53('0x3'));var fs=require('fs');var path=require(_0x2b53('0x4'));var rimraf=require(_0x2b53('0x5'));var config=require(_0x2b53('0x6'));var attributes=require(_0x2b53('0x7'));module[_0x2b53('0x8')]=function(_0x9c4e11,_0x1dc104){return _0x9c4e11[_0x2b53('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x2b53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc647=['request-promise','rimraf','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment'];(function(_0x24dfd2,_0x504fac){var _0x3abda1=function(_0x55bc85){while(--_0x55bc85){_0x24dfd2['push'](_0x24dfd2['shift']());}};_0x3abda1(++_0x504fac);}(_0xc647,0xd4));var _0x7c64=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0xc647[_0x1e2080];return _0x260111;};'use strict';var _=require(_0x7c64('0x0'));var util=require(_0x7c64('0x1'));var logger=require('../../config/logger')(_0x7c64('0x2'));var moment=require(_0x7c64('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c64('0x5'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x7c64('0x6')]=function(_0x444973,_0x48aa20){return _0x444973['define'](_0x7c64('0x7'),attributes,{'tableName':_0x7c64('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index fb5e5f6..4718518 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 _0x5c21=['http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x15c2('0x0'));var moment=require(_0x15c2('0x1'));var BPromise=require(_0x15c2('0x2'));var rs=require(_0x15c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15c2('0x4'))['db'];var utils=require(_0x15c2('0x5'));var logger=require(_0x15c2('0x6'))(_0x15c2('0x7'));var config=require(_0x15c2('0x8'));var jayson=require(_0x15c2('0x9'));var client=jayson['client'][_0x15c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e1e25,_0xf7dd99,_0x1a78e6){return new BPromise(function(_0x3fc8ac,_0x4f6891){return client[_0x15c2('0xb')](_0x5e1e25,_0x1a78e6)['then'](function(_0x336780){logger[_0x15c2('0xc')](_0x15c2('0xd'),_0xf7dd99,_0x15c2('0xe'));logger['debug'](_0x15c2('0xf'),_0xf7dd99,'request\x20sent',JSON[_0x15c2('0x10')](_0x336780));if(_0x336780[_0x15c2('0x11')]){if(_0x336780[_0x15c2('0x11')][_0x15c2('0x12')]===0x1f4){logger[_0x15c2('0x11')](_0x15c2('0xd'),_0xf7dd99,_0x336780[_0x15c2('0x11')][_0x15c2('0x13')]);return _0x4f6891(_0x336780[_0x15c2('0x11')][_0x15c2('0x13')]);}logger['error'](_0x15c2('0xd'),_0xf7dd99,_0x336780['error'][_0x15c2('0x13')]);return _0x3fc8ac(_0x336780[_0x15c2('0x11')][_0x15c2('0x13')]);}else{logger[_0x15c2('0xc')](_0x15c2('0xd'),_0xf7dd99,_0x15c2('0xe'));_0x3fc8ac(_0x336780[_0x15c2('0x14')][_0x15c2('0x13')]);}})[_0x15c2('0x15')](function(_0x7a9f15){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xf7dd99,_0x7a9f15);_0x4f6891(_0x7a9f15);});});} \ No newline at end of file +var _0x5917=['request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x5d2655,_0x97535d){var _0x5a5cac=function(_0x35325e){while(--_0x35325e){_0x5d2655['push'](_0x5d2655['shift']());}};_0x5a5cac(++_0x97535d);}(_0x5917,0x1aa));var _0x7591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5917[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7591('0x0'));var BPromise=require(_0x7591('0x1'));var rs=require(_0x7591('0x2'));var fs=require('fs');var Redis=require(_0x7591('0x3'));var db=require(_0x7591('0x4'))['db'];var utils=require(_0x7591('0x5'));var logger=require(_0x7591('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7591('0x7'));var client=jayson[_0x7591('0x8')][_0x7591('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b02e7,_0x206cc0,_0x3bd8bd){return new BPromise(function(_0x3aac30,_0x240144){return client[_0x7591('0xa')](_0x1b02e7,_0x3bd8bd)[_0x7591('0xb')](function(_0x44dfca){logger[_0x7591('0xc')](_0x7591('0xd'),_0x206cc0,'request\x20sent');logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x206cc0,_0x7591('0xe'),JSON[_0x7591('0xf')](_0x44dfca));if(_0x44dfca[_0x7591('0x10')]){if(_0x44dfca[_0x7591('0x10')][_0x7591('0x11')]===0x1f4){logger['error'](_0x7591('0xd'),_0x206cc0,_0x44dfca[_0x7591('0x10')][_0x7591('0x12')]);return _0x240144(_0x44dfca['error'][_0x7591('0x12')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x206cc0,_0x44dfca['error']['message']);return _0x3aac30(_0x44dfca[_0x7591('0x10')][_0x7591('0x12')]);}else{logger['info'](_0x7591('0xd'),_0x206cc0,_0x7591('0xe'));_0x3aac30(_0x44dfca[_0x7591('0x13')][_0x7591('0x12')]);}})['catch'](function(_0x3033db){logger['error'](_0x7591('0xd'),_0x206cc0,_0x3033db);_0x240144(_0x3033db);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index cf0a689..8328045 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 _0x45aa=['create','clone','addResources','put','delete','destroy','removeResources','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id','/:id/sections','getSections','getResources','post'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x45aa,0xdf));var _0xa45a=function(_0x540bc9,_0x3aebf4){_0x540bc9=_0x540bc9-0x0;var _0x415b7e=_0x45aa[_0x540bc9];return _0x415b7e;};'use strict';var multer=require('multer');var util=require(_0xa45a('0x0'));var path=require(_0xa45a('0x1'));var timeout=require(_0xa45a('0x2'));var express=require(_0xa45a('0x3'));var router=express['Router']();var fs_extra=require(_0xa45a('0x4'));var auth=require(_0xa45a('0x5'));var interaction=require(_0xa45a('0x6'));var config=require(_0xa45a('0x7'));var controller=require(_0xa45a('0x8'));router[_0xa45a('0x9')]('/',auth[_0xa45a('0xa')](),controller['index']);router[_0xa45a('0x9')](_0xa45a('0xb'),auth[_0xa45a('0xa')](),controller['describe']);router[_0xa45a('0x9')](_0xa45a('0xc'),auth[_0xa45a('0xa')](),controller['show']);router[_0xa45a('0x9')](_0xa45a('0xd'),auth[_0xa45a('0xa')](),controller[_0xa45a('0xe')]);router['get']('/:id/resources',auth[_0xa45a('0xa')](),controller[_0xa45a('0xf')]);router[_0xa45a('0x10')]('/',auth[_0xa45a('0xa')](),controller[_0xa45a('0x11')]);router[_0xa45a('0x10')]('/:id/clone',auth[_0xa45a('0xa')](),controller[_0xa45a('0x12')]);router[_0xa45a('0x10')]('/:id/sections',auth[_0xa45a('0xa')](),controller['addSections']);router[_0xa45a('0x10')]('/:id/resources',auth[_0xa45a('0xa')](),controller[_0xa45a('0x13')]);router[_0xa45a('0x14')]('/:id',auth[_0xa45a('0xa')](),controller['update']);router[_0xa45a('0x15')]('/:id',auth[_0xa45a('0xa')](),controller[_0xa45a('0x16')]);router[_0xa45a('0x15')](_0xa45a('0xd'),auth[_0xa45a('0xa')](),controller['removeSections']);router[_0xa45a('0x15')]('/:id/resources',auth[_0xa45a('0xa')](),controller[_0xa45a('0x17')]);module['exports']=router; \ No newline at end of file +var _0x1cb1=['put','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/sections','post','create','addSections','/:id/resources','addResources'];(function(_0x178552,_0x47724f){var _0x597c97=function(_0x400a3f){while(--_0x400a3f){_0x178552['push'](_0x178552['shift']());}};_0x597c97(++_0x47724f);}(_0x1cb1,0x149));var _0x11cb=function(_0x2006bf,_0x4c4649){_0x2006bf=_0x2006bf-0x0;var _0x151fae=_0x1cb1[_0x2006bf];return _0x151fae;};'use strict';var multer=require(_0x11cb('0x0'));var util=require(_0x11cb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x11cb('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x11cb('0x3'));var controller=require('./userProfile.controller');router[_0x11cb('0x4')]('/',auth[_0x11cb('0x5')](),controller[_0x11cb('0x6')]);router[_0x11cb('0x4')](_0x11cb('0x7'),auth[_0x11cb('0x5')](),controller[_0x11cb('0x8')]);router[_0x11cb('0x4')]('/:id',auth[_0x11cb('0x5')](),controller[_0x11cb('0x9')]);router[_0x11cb('0x4')](_0x11cb('0xa'),auth[_0x11cb('0x5')](),controller['getSections']);router[_0x11cb('0x4')]('/:id/resources',auth[_0x11cb('0x5')](),controller['getResources']);router[_0x11cb('0xb')]('/',auth[_0x11cb('0x5')](),controller[_0x11cb('0xc')]);router[_0x11cb('0xb')]('/:id/clone',auth[_0x11cb('0x5')](),controller['clone']);router[_0x11cb('0xb')]('/:id/sections',auth['isAuthenticated'](),controller[_0x11cb('0xd')]);router[_0x11cb('0xb')](_0x11cb('0xe'),auth['isAuthenticated'](),controller[_0x11cb('0xf')]);router[_0x11cb('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x11cb('0x11')](_0x11cb('0x12'),auth['isAuthenticated'](),controller[_0x11cb('0x13')]);router['delete'](_0x11cb('0xa'),auth['isAuthenticated'](),controller[_0x11cb('0x14')]);router[_0x11cb('0x11')](_0x11cb('0xe'),auth[_0x11cb('0x5')](),controller[_0x11cb('0x15')]);module[_0x11cb('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a3fadee..97bf201 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 _0x6ec2=['getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions','join'];(function(_0xbb8ad2,_0x20b225){var _0x56b00b=function(_0x1e0363){while(--_0x1e0363){_0xbb8ad2['push'](_0xbb8ad2['shift']());}};_0x56b00b(++_0x20b225);}(_0x6ec2,0x13b));var _0x26ec=function(_0x2f78cc,_0x56d09d){_0x2f78cc=_0x2f78cc-0x0;var _0x5f54ad=_0x6ec2[_0x2f78cc];return _0x5f54ad;};'use strict';var Sequelize=require(_0x26ec('0x0'));module['exports']={'name':{'type':Sequelize[_0x26ec('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x26ec('0x1')],'set':function(_0x30a0d6){this[_0x26ec('0x2')](_0x26ec('0x3'),_0x30a0d6?_0x30a0d6[_0x26ec('0x4')](''):[]);},'get':function(){return this[_0x26ec('0x5')](_0x26ec('0x3'))?this[_0x26ec('0x5')]('crudPermissions')[_0x26ec('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x26ec('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x26ec('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfde7=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xfde7,0x109));var _0x7fde=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xfde7[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0x7fde('0x0'));module[_0x7fde('0x1')]={'name':{'type':Sequelize[_0x7fde('0x2')],'allowNull':![],'unique':_0x7fde('0x3')},'crudPermissions':{'type':Sequelize[_0x7fde('0x2')],'set':function(_0x32bfe7){this[_0x7fde('0x4')](_0x7fde('0x5'),_0x32bfe7?_0x32bfe7[_0x7fde('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x7fde('0x5'))?this[_0x7fde('0x7')](_0x7fde('0x5'))[_0x7fde('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7fde('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 05e9771..07d1763 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 _0xc2a2=['addSections','userProfileId','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','Dashboard','forEach','push','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','get','crudPermissions','body','omit','updatedAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','sectionId','Resources','UserProfileResource','destroy','describe'];(function(_0x548491,_0x15f1e3){var _0x5e8d43=function(_0x4f2738){while(--_0x4f2738){_0x548491['push'](_0x548491['shift']());}};_0x5e8d43(++_0x15f1e3);}(_0xc2a2,0x84));var _0x2c2a=function(_0x4891b8,_0xc24723){_0x4891b8=_0x4891b8-0x0;var _0x47c42b=_0xc2a2[_0x4891b8];return _0x47c42b;};'use strict';var emlformat=require(_0x2c2a('0x0'));var rimraf=require(_0x2c2a('0x1'));var zipdir=require(_0x2c2a('0x2'));var jsonpatch=require(_0x2c2a('0x3'));var rp=require('request-promise');var moment=require(_0x2c2a('0x4'));var BPromise=require(_0x2c2a('0x5'));var Mustache=require(_0x2c2a('0x6'));var util=require('util');var path=require(_0x2c2a('0x7'));var sox=require(_0x2c2a('0x8'));var csv=require(_0x2c2a('0x9'));var ejs=require(_0x2c2a('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(_0x2c2a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c2a('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c2a('0xd'));var authService=require(_0x2c2a('0xe'));var qs=require(_0x2c2a('0xf'));var as=require(_0x2c2a('0x10'));var hardwareService=require(_0x2c2a('0x11'));var logger=require(_0x2c2a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2c2a('0x13'));var licenseUtil=require(_0x2c2a('0x14'));var db=require(_0x2c2a('0x15'))['db'];config[_0x2c2a('0x16')]=_[_0x2c2a('0x17')](config[_0x2c2a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c2a('0x18'))(new Redis(config[_0x2c2a('0x16')]));require('./userProfile.socket')[_0x2c2a('0x19')](socket);function respondWithStatusCode(_0x4caf5f,_0xbf1a60){_0xbf1a60=_0xbf1a60||0xcc;return function(_0x4c5faa){if(_0x4c5faa){return _0x4caf5f[_0x2c2a('0x1a')](_0xbf1a60);}return _0x4caf5f[_0x2c2a('0x1b')](_0xbf1a60)['end']();};}function respondWithResult(_0x10b98e,_0x1c9a04){_0x1c9a04=_0x1c9a04||0xc8;return function(_0x250d08){if(_0x250d08){return _0x10b98e[_0x2c2a('0x1b')](_0x1c9a04)[_0x2c2a('0x1c')](_0x250d08);}};}function respondWithFilteredResult(_0x14486f,_0x4b5724){return function(_0x53fe55){if(_0x53fe55){var _0x4149e2=typeof _0x4b5724['offset']===_0x2c2a('0x1d')&&typeof _0x4b5724[_0x2c2a('0x1e')]===_0x2c2a('0x1d');var _0x2120ab=_0x53fe55[_0x2c2a('0x1f')];var _0x3d7068=_0x4149e2?0x0:_0x4b5724[_0x2c2a('0x20')];var _0x33d849=_0x4149e2?_0x53fe55[_0x2c2a('0x1f')]:_0x4b5724[_0x2c2a('0x20')]+_0x4b5724['limit'];var _0x1896f2;if(_0x33d849>=_0x2120ab){_0x33d849=_0x2120ab;_0x1896f2=0xc8;}else{_0x1896f2=0xce;}_0x14486f['status'](_0x1896f2);return _0x14486f[_0x2c2a('0x21')](_0x2c2a('0x22'),_0x3d7068+'-'+_0x33d849+'/'+_0x2120ab)['json'](_0x53fe55);}return null;};}function patchUpdates(_0x36927b){return function(_0xaeda84){try{jsonpatch[_0x2c2a('0x23')](_0xaeda84,_0x36927b,!![]);}catch(_0x5a8ad3){return BPromise[_0x2c2a('0x24')](_0x5a8ad3);}return _0xaeda84[_0x2c2a('0x25')]();};}function saveUpdates(_0x385266,_0x1a59ff){return function(_0x10e915){if(_0x10e915){return _0x10e915[_0x2c2a('0x26')](_0x385266)[_0x2c2a('0x27')](function(_0x459aee){return _0x459aee;});}return null;};}function removeEntity(_0x4d80ce,_0x5d6597){return function(_0x5afa5f){if(_0x5afa5f){return _0x5afa5f['destroy']()[_0x2c2a('0x27')](function(){_0x4d80ce[_0x2c2a('0x1b')](0xcc)[_0x2c2a('0x28')]();});}};}function handleEntityNotFound(_0x41f10b,_0x39e3d6){return function(_0x43239d){if(!_0x43239d){_0x41f10b['sendStatus'](0x194);}return _0x43239d;};}function handleError(_0x585540,_0x1cc380){_0x1cc380=_0x1cc380||0x1f4;return function(_0x1d907f){logger[_0x2c2a('0x29')](_0x1d907f[_0x2c2a('0x2a')]);if(_0x1d907f['name']){delete _0x1d907f[_0x2c2a('0x2b')];}_0x585540[_0x2c2a('0x1b')](_0x1cc380)[_0x2c2a('0x2c')](_0x1d907f);};}exports[_0x2c2a('0x2d')]=function(_0x278f9b,_0x2fcd8b){var _0x49e451={},_0x3be2b0={},_0x5059b9={'count':0x0,'rows':[]};var _0x261320=_[_0x2c2a('0x2e')](db[_0x2c2a('0x2f')][_0x2c2a('0x30')],function(_0x16d981){return{'name':_0x16d981['fieldName'],'type':_0x16d981[_0x2c2a('0x31')][_0x2c2a('0x32')]};});_0x3be2b0[_0x2c2a('0x33')]=_[_0x2c2a('0x2e')](_0x261320,_0x2c2a('0x2b'));_0x3be2b0['query']=_[_0x2c2a('0x34')](_0x278f9b[_0x2c2a('0x35')]);_0x3be2b0['filters']=_[_0x2c2a('0x36')](_0x3be2b0['model'],_0x3be2b0[_0x2c2a('0x35')]);_0x49e451[_0x2c2a('0x37')]=_[_0x2c2a('0x36')](_0x3be2b0[_0x2c2a('0x33')],qs[_0x2c2a('0x38')](_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x38')]));_0x49e451['attributes']=_0x49e451[_0x2c2a('0x37')][_0x2c2a('0x39')]?_0x49e451[_0x2c2a('0x37')]:_0x3be2b0['model'];if(!_0x278f9b['query'][_0x2c2a('0x3a')]('nolimit')){_0x49e451[_0x2c2a('0x1e')]=qs[_0x2c2a('0x1e')](_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x1e')]);_0x49e451[_0x2c2a('0x20')]=qs['offset'](_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x20')]);}_0x49e451[_0x2c2a('0x3b')]=qs[_0x2c2a('0x3c')](_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x3c')]);_0x49e451[_0x2c2a('0x3d')]=qs[_0x2c2a('0x3e')](_[_0x2c2a('0x3f')](_0x278f9b[_0x2c2a('0x35')],_0x3be2b0['filters']),_0x261320);if(_0x278f9b['query'][_0x2c2a('0x40')]){_0x49e451[_0x2c2a('0x3d')]=_[_0x2c2a('0x41')](_0x49e451[_0x2c2a('0x3d')],{'$or':_[_0x2c2a('0x2e')](_0x261320,function(_0x2fd22f){if(_0x2fd22f['type']!=='VIRTUAL'){var _0x46928={};_0x46928[_0x2fd22f[_0x2c2a('0x2b')]]={'$like':'%'+_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x40')]+'%'};return _0x46928;}})});}_0x49e451=_[_0x2c2a('0x41')]({},_0x49e451,_0x278f9b[_0x2c2a('0x42')]);var _0x6b69c3={'where':_0x49e451[_0x2c2a('0x3d')]};return db[_0x2c2a('0x2f')][_0x2c2a('0x1f')](_0x6b69c3)['then'](function(_0x87a74){_0x5059b9['count']=_0x87a74;if(_0x278f9b[_0x2c2a('0x35')][_0x2c2a('0x43')]){_0x49e451[_0x2c2a('0x44')]=[{'all':!![]}];}return db[_0x2c2a('0x2f')]['findAll'](_0x49e451);})[_0x2c2a('0x27')](function(_0x1321b0){_0x5059b9['rows']=_0x1321b0;return _0x5059b9;})[_0x2c2a('0x27')](respondWithFilteredResult(_0x2fcd8b,_0x49e451))[_0x2c2a('0x45')](handleError(_0x2fcd8b,null));};exports[_0x2c2a('0x46')]=function(_0x2a3190,_0x18a0e7){var _0x3d3bed={'raw':![],'where':{'id':_0x2a3190[_0x2c2a('0x47')]['id']}},_0x22676a={};_0x22676a['model']=_['keys'](db[_0x2c2a('0x2f')]['rawAttributes']);_0x22676a[_0x2c2a('0x35')]=_['keys'](_0x2a3190[_0x2c2a('0x35')]);_0x22676a['filters']=_[_0x2c2a('0x36')](_0x22676a[_0x2c2a('0x33')],_0x22676a[_0x2c2a('0x35')]);_0x3d3bed[_0x2c2a('0x37')]=_['intersection'](_0x22676a['model'],qs[_0x2c2a('0x38')](_0x2a3190['query'][_0x2c2a('0x38')]));_0x3d3bed['attributes']=_0x3d3bed[_0x2c2a('0x37')][_0x2c2a('0x39')]?_0x3d3bed['attributes']:_0x22676a[_0x2c2a('0x33')];if(_0x2a3190[_0x2c2a('0x35')]['includeAll']){_0x3d3bed['include']=[{'all':!![]}];}_0x3d3bed=_[_0x2c2a('0x41')]({},_0x3d3bed,_0x2a3190['options']);return db[_0x2c2a('0x2f')][_0x2c2a('0x48')](_0x3d3bed)[_0x2c2a('0x27')](handleEntityNotFound(_0x18a0e7,null))[_0x2c2a('0x27')](respondWithResult(_0x18a0e7,null))['catch'](handleError(_0x18a0e7,null));};exports['create']=function(_0xbe97dc,_0xac03d9){return db[_0x2c2a('0x2f')][_0x2c2a('0x49')](_0xbe97dc['body'],{})['then'](respondWithResult(_0xac03d9,0xc9))[_0x2c2a('0x45')](handleError(_0xac03d9,null));};exports['clone']=function(_0x33368e,_0x5c9566){var _0x3df8e2={'where':{'id':_0x33368e['params']['id']}},_0x143d17={};_0x143d17['model']=_[_0x2c2a('0x34')](db[_0x2c2a('0x2f')][_0x2c2a('0x30')]);_0x3df8e2[_0x2c2a('0x37')]=_['intersection'](_0x143d17[_0x2c2a('0x33')],qs['fields'](_0x33368e[_0x2c2a('0x35')][_0x2c2a('0x38')]));_0x3df8e2['attributes']=_0x3df8e2['attributes'][_0x2c2a('0x39')]?_0x3df8e2[_0x2c2a('0x37')]:_0x143d17[_0x2c2a('0x33')];if(_0x33368e[_0x2c2a('0x35')][_0x2c2a('0x43')]){_0x3df8e2[_0x2c2a('0x44')]=[{'all':!![]}];}_0x3df8e2=_[_0x2c2a('0x41')]({},_0x3df8e2,_0x33368e[_0x2c2a('0x42')]);return db['UserProfile'][_0x2c2a('0x48')](_0x3df8e2)[_0x2c2a('0x27')](handleEntityNotFound(_0x5c9566,null))['then'](function(_0x4ce25b){if(_0x4ce25b){var _0x22f360=_0x4ce25b[_0x2c2a('0x4a')]({'plain':!![]});_0x22f360=qs['omit'](_0x22f360,['id','createdAt','updatedAt',_0x2c2a('0x4b')]);_0x33368e[_0x2c2a('0x4c')]=_[_0x2c2a('0x4d')](_0x33368e[_0x2c2a('0x4c')],['id','createdAt',_0x2c2a('0x4e')]);return db[_0x2c2a('0x4f')][_0x2c2a('0x50')](function(_0x4f1bed){return db[_0x2c2a('0x2f')]['create'](_['merge'](_0x22f360,_0x33368e[_0x2c2a('0x4c')]),{'include':_0x33368e[_0x2c2a('0x35')][_0x2c2a('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x4f1bed})[_0x2c2a('0x27')](function(_0x157967){var _0x1392a1=_0x157967['get']({'plain':!![]});return db[_0x2c2a('0x51')][_0x2c2a('0x52')]({'where':{'userProfileId':_0x33368e[_0x2c2a('0x47')]['id']},'raw':!![]})[_0x2c2a('0x27')](function(_0x3b243f){if(_0x3b243f){return BPromise[_0x2c2a('0x53')](_0x3b243f,function(_0x5279a7){return new BPromise(function(_0x43eec0,_0x199706){if(_0x5279a7[_0x2c2a('0x54')]===null||_0x5279a7[_0x2c2a('0x54')]===0x1)_0x43eec0(null);return db['UserProfileResource'][_0x2c2a('0x52')]({'where':{'sectionId':_0x5279a7['id']},'raw':!![]})['then'](function(_0x45f225){var _0x251681=_[_0x2c2a('0x2e')](_0x45f225,function(_0x59a1d2){return qs['omit'](_0x59a1d2,['id','createdAt',_0x2c2a('0x4e'),_0x2c2a('0x55')]);});_0x43eec0(_0x251681);})['catch'](function(_0x71ab){_0x199706(_0x71ab);});})[_0x2c2a('0x27')](function(_0x4a9123){var _0x48f90f=qs[_0x2c2a('0x4d')](_0x5279a7,['id','createdAt','updatedAt']);_0x48f90f['userProfileId']=_0x1392a1['id'];if(_0x4a9123)_0x48f90f[_0x2c2a('0x56')]=_0x4a9123;return _0x48f90f;})[_0x2c2a('0x27')](function(_0x5d683b){return db[_0x2c2a('0x51')][_0x2c2a('0x49')](_0x5d683b,{'include':[{'model':db[_0x2c2a('0x57')],'as':_0x2c2a('0x56')}],'raw':!![],'transaction':_0x4f1bed});});})['then'](function(){return _0x1392a1;});}});});});}})[_0x2c2a('0x27')](respondWithResult(_0x5c9566,0xc9))['catch'](handleError(_0x5c9566,null));};exports['update']=function(_0x2bb772,_0x503821){if(_0x2bb772[_0x2c2a('0x4c')]['id']){delete _0x2bb772[_0x2c2a('0x4c')]['id'];}return db[_0x2c2a('0x2f')][_0x2c2a('0x48')]({'where':{'id':_0x2bb772[_0x2c2a('0x47')]['id']}})[_0x2c2a('0x27')](handleEntityNotFound(_0x503821,null))['then'](saveUpdates(_0x2bb772[_0x2c2a('0x4c')],null))[_0x2c2a('0x27')](respondWithResult(_0x503821,null))['catch'](handleError(_0x503821,null));};exports[_0x2c2a('0x58')]=function(_0x18ac7b,_0x3b77ce){return db[_0x2c2a('0x2f')][_0x2c2a('0x48')]({'where':{'id':_0x18ac7b[_0x2c2a('0x47')]['id']}})[_0x2c2a('0x27')](handleEntityNotFound(_0x3b77ce,null))['then'](removeEntity(_0x3b77ce,null))[_0x2c2a('0x45')](handleError(_0x3b77ce,null));};exports[_0x2c2a('0x59')]=function(_0x4e0006,_0x478c0a){return db[_0x2c2a('0x2f')][_0x2c2a('0x59')]()[_0x2c2a('0x27')](respondWithResult(_0x478c0a,null))[_0x2c2a('0x45')](handleError(_0x478c0a,null));};exports[_0x2c2a('0x5a')]=function(_0x50e6a6,_0x1bbb77){var _0x1a1187=_0x50e6a6['body'];return db[_0x2c2a('0x2f')][_0x2c2a('0x48')]({'where':{'id':_0x50e6a6[_0x2c2a('0x47')]['id']}})[_0x2c2a('0x27')](handleEntityNotFound(_0x1bbb77,null))['then'](function(_0x2badec){if(_0x2badec){return db[_0x2c2a('0x4f')]['transaction'](function(_0x2b4cb3){return db[_0x2c2a('0x51')]['destroy']({'where':{'userProfileId':_0x50e6a6[_0x2c2a('0x47')]['id'],'sectionId':_[_0x2c2a('0x2e')](_0x1a1187,function(_0x484165){return _0x484165['sectionId'];})},'transaction':_0x2b4cb3})[_0x2c2a('0x27')](function(){var _0x3c53a9=_[_0x2c2a('0x2e')](_0x1a1187,function(_0x453bab){_0x453bab[_0x2c2a('0x5b')]=_0x50e6a6[_0x2c2a('0x47')]['id'];return _0x453bab;});var _0x4ff0ef=[];return BPromise['each'](_0x3c53a9,function(_0x57a5bc){return db['UserProfileSection']['create'](_0x57a5bc,{'include':[{'model':db[_0x2c2a('0x57')],'as':_0x2c2a('0x56')}],'raw':!![],'transaction':_0x2b4cb3})[_0x2c2a('0x27')](function(_0x1c5c21){_0x4ff0ef['push'](_0x1c5c21[_0x2c2a('0x4a')]({'plain':!![]}));});})[_0x2c2a('0x27')](function(){return _0x4ff0ef;});});});}})[_0x2c2a('0x27')](function(_0x2d6929){return _0x2d6929;})[_0x2c2a('0x27')](respondWithResult(_0x1bbb77,null))[_0x2c2a('0x45')](handleError(_0x1bbb77,null));};exports[_0x2c2a('0x5c')]=function(_0x406857,_0x36993d){var _0x512e41;return db['UserProfile'][_0x2c2a('0x48')]({'where':{'id':_0x406857[_0x2c2a('0x47')]['id']},'attributes':['id',_0x2c2a('0x2b')]})[_0x2c2a('0x27')](handleEntityNotFound(_0x36993d,null))[_0x2c2a('0x27')](function(_0x416e61){if(_0x416e61){_0x512e41=_0x416e61;return db[_0x2c2a('0x51')][_0x2c2a('0x58')]({'where':{'userProfileId':_0x406857[_0x2c2a('0x47')]['id'],'sectionId':_0x406857[_0x2c2a('0x35')][_0x2c2a('0x5d')]}});}})[_0x2c2a('0x27')](function(){return _0x512e41;})['then'](respondWithStatusCode(_0x36993d,null))[_0x2c2a('0x45')](handleError(_0x36993d,null));};exports[_0x2c2a('0x5e')]=function(_0x36f33c,_0x6aa2ed){var _0x50ab35=[];var _0x3ee98e=[];return db[_0x2c2a('0x51')][_0x2c2a('0x52')]({'where':{'userProfileId':_0x36f33c[_0x2c2a('0x47')]['id']},'raw':!![]})[_0x2c2a('0x27')](function(_0x1eff78){_0x50ab35=_[_0x2c2a('0x40')](_0x1eff78,function(_0x4bb49b){return _0x4bb49b[_0x2c2a('0x5f')]===0x1||_['includes']([0x3eb,0x709],_0x4bb49b[_0x2c2a('0x55')]);});if(!_[_0x2c2a('0x60')](_0x50ab35)){return _['map'](_0x50ab35,function(_0x19ae6c){return _0x19ae6c[_0x2c2a('0x55')];});}else{return;}})['then'](function(_0x25c03b){if(_0x25c03b)_0x3ee98e=_0x25c03b;if(_['includes'](_0x3ee98e,0x64)){var _0x3f3a0f=_[_0x2c2a('0x48')](_0x50ab35,{'sectionId':0x64});return hasDefaultDashboard(_0x3f3a0f)[_0x2c2a('0x27')](function(_0x200cc1){return _['map'](_0x50ab35,function(_0x135250){if(_0x135250[_0x2c2a('0x55')]===0x64){_0x135250['subsections']=_0x200cc1;}return _0x135250;});});}else{return;}})['then'](function(_0x17ecc1){if(_0x17ecc1)_0x50ab35=_0x17ecc1;if(_[_0x2c2a('0x61')](_0x3ee98e,0x3eb)){var _0x477de1=_['find'](_0x50ab35,{'sectionId':0x3eb});return getCustomDashboards(_0x477de1)[_0x2c2a('0x27')](function(_0x23d674){return _[_0x2c2a('0x2e')](_0x50ab35,function(_0x56cc77){if(_0x477de1[_0x2c2a('0x5f')]){if(_0x56cc77[_0x2c2a('0x55')]===0x3eb){_0x56cc77[_0x2c2a('0x62')]=_0x23d674;}}else{if(_0x56cc77[_0x2c2a('0x55')]===0x64){_0x56cc77['subsections']=_0x23d674;}}return _0x56cc77;});});}else{return;}})[_0x2c2a('0x27')](function(_0x738644){if(_0x738644)_0x50ab35=_0x738644;if(_[_0x2c2a('0x61')](_0x3ee98e,0x709)){var _0x2a95fe=_[_0x2c2a('0x48')](_0x50ab35,{'sectionId':0x709});return getPlugins(_0x2a95fe)[_0x2c2a('0x27')](function(_0x7be6d){if(_0x2a95fe[_0x2c2a('0x5f')]){return _[_0x2c2a('0x2e')](_0x50ab35,function(_0x1f1d24){if(_0x1f1d24['sectionId']===0x709){_0x1f1d24[_0x2c2a('0x62')]=_0x7be6d;}return _0x1f1d24;});}else{var _0x5ef786={'sectionId':0x76c,'enabled':0x1,'subsections':_0x7be6d};var _0x3404e0=_['map'](_0x50ab35);_0x3404e0['push'](_0x5ef786);return _0x3404e0;}});}else{return;}})[_0x2c2a('0x27')](function(_0x1916e4){if(_0x1916e4)_0x50ab35=_0x1916e4;return _[_0x2c2a('0x40')](_0x50ab35,['enabled',0x1]);})[_0x2c2a('0x27')](respondWithResult(_0x6aa2ed,null))[_0x2c2a('0x45')](handleError(_0x6aa2ed,null));};function hasDefaultDashboard(_0x3b52a2){var _0x3f4a55=[0x65];return new BPromise(function(_0x348680,_0x2b7899){try{if(_0x3b52a2[_0x2c2a('0x54')]){_0x348680(_0x3f4a55);}else{return db[_0x2c2a('0x57')]['findOne']({'where':{'sectionId':_0x3b52a2['id']},'raw':!![]})[_0x2c2a('0x27')](function(_0x25d080){_0x25d080?_0x348680(_0x3f4a55):_0x348680();});}}catch(_0x257557){_0x2b7899(_0x257557);}});}function getCustomDashboards(_0x3e746e){var _0x3be5b3=[];return new BPromise(function(_0x458002,_0x2c7e58){try{if(_0x3e746e[_0x2c2a('0x54')]){return db[_0x2c2a('0x63')]['findAll']({'raw':!![]})[_0x2c2a('0x27')](function(_0x2d63c2){_0x2d63c2[_0x2c2a('0x64')](function(_0x43a258){_0x3be5b3[_0x2c2a('0x65')](_0x43a258['id']+0x1869f);});_0x458002(_0x3be5b3);});}else{return db[_0x2c2a('0x57')][_0x2c2a('0x52')]({'where':{'sectionId':_0x3e746e['id']},'raw':!![]})[_0x2c2a('0x27')](function(_0x5612cc){_0x5612cc[_0x2c2a('0x64')](function(_0x126730){_0x3be5b3['push'](_0x126730[_0x2c2a('0x66')]+0x1869f);});_0x458002(_0x3be5b3);});}}catch(_0x30ec49){_0x2c7e58(_0x30ec49);}});}function getPlugins(_0xefcac7){var _0x3bf7b5=[];return new BPromise(function(_0x35018b,_0x3c23e6){try{if(_0xefcac7[_0x2c2a('0x54')]){return db['Plugin'][_0x2c2a('0x52')]({'raw':!![]})[_0x2c2a('0x27')](function(_0x204bbb){_0x204bbb[_0x2c2a('0x64')](function(_0x445392){_0x3bf7b5[_0x2c2a('0x65')](_0x445392['id']+0x15b38);});_0x35018b(_0x3bf7b5);});}else{return db['UserProfileResource'][_0x2c2a('0x52')]({'where':{'sectionId':_0xefcac7['id']},'raw':!![]})[_0x2c2a('0x27')](function(_0x120a64){_0x120a64[_0x2c2a('0x64')](function(_0x1c13f9){_0x3bf7b5[_0x2c2a('0x65')](_0x1c13f9['resourceId']+0x15b38);});_0x35018b(_0x3bf7b5);});}}catch(_0xf7d016){_0x3c23e6(_0xf7d016);}});}exports[_0x2c2a('0x67')]=function(_0x4354d1,_0x3bac52){return db[_0x2c2a('0x2f')][_0x2c2a('0x48')]({'where':{'id':_0x4354d1[_0x2c2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bac52,null))[_0x2c2a('0x27')](function(_0x5adf30){if(_0x5adf30){return db['sequelize']['transaction'](function(_0x2d0a36){return db[_0x2c2a('0x51')][_0x2c2a('0x52')]({'where':{'userProfileId':_0x4354d1[_0x2c2a('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x2c2a('0x27')](function(_0x22c58f){if(_0x22c58f){return db[_0x2c2a('0x51')][_0x2c2a('0x58')]({'where':{'userProfileId':_0x4354d1[_0x2c2a('0x47')]['id'],'id':_[_0x2c2a('0x2e')](_0x22c58f,function(_0x161a0b){return _0x161a0b['id'];})},'transaction':_0x2d0a36});}})[_0x2c2a('0x27')](function(_0x1f286d){var _0x2031df=_[_0x2c2a('0x2e')](_0x4354d1[_0x2c2a('0x4c')],function(_0x30cac8){_0x30cac8[_0x2c2a('0x5b')]=_0x4354d1[_0x2c2a('0x47')]['id'];return _0x30cac8;});return db['UserProfileSection'][_0x2c2a('0x68')](_0x2031df,{'raw':!![],'transaction':_0x2d0a36});})[_0x2c2a('0x27')](function(_0x4c9aa6){var _0x40d182=_[_0x2c2a('0x40')](_['map'](_0x4c9aa6,function(_0x494ba7){return _0x494ba7[_0x2c2a('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x40d182){return db['UserProfileSection'][_0x2c2a('0x52')]({'where':{'userProfileId':_0x4354d1[_0x2c2a('0x47')]['id'],'sectionId':_['map'](_0x40d182,function(_0x51560b){return _0x51560b['sectionId'];})},'attributes':['id',_0x2c2a('0x55')],'raw':!![]})['then'](function(_0x281c59){var _0x34514f=_[_0x2c2a('0x2e')](_0x4354d1['body'],function(_0x1d45d5){_0x1d45d5['userProfileId']=_0x4354d1[_0x2c2a('0x47')]['id'];return _0x1d45d5;});return db[_0x2c2a('0x57')][_0x2c2a('0x68')](_0x34514f,{'raw':!![],'transaction':_0x2d0a36});});}})[_0x2c2a('0x45')](handleError(_0x3bac52,null));});}})['then'](function(_0x3d6f59){var _0x3c6617=_['map'](_0x3d6f59,function(_0x49698d){return _0x49698d['get']({'plain':!![]});});})['then'](respondWithResult(_0x3bac52,null))[_0x2c2a('0x45')](handleError(_0x3bac52,null));};exports[_0x2c2a('0x69')]=function(_0x684485,_0x3d3610,_0xe24228){return db[_0x2c2a('0x2f')][_0x2c2a('0x48')]({'where':{'id':_0x684485[_0x2c2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d3610,null))[_0x2c2a('0x27')](function(_0x2a4568){if(_0x2a4568){return _0x2a4568[_0x2c2a('0x69')](_0x684485[_0x2c2a('0x35')][_0x2c2a('0x5d')]);}})[_0x2c2a('0x27')](respondWithStatusCode(_0x3d3610,null))[_0x2c2a('0x45')](handleError(_0x3d3610,null));};exports[_0x2c2a('0x6a')]=function(_0x111ff3,_0x17f630){var _0x53ed2b={};if(!_0x111ff3['query'][_0x2c2a('0x6b')])throw new Error(_0x2c2a('0x6c'));if(!_0x111ff3['query'][_0x2c2a('0x3a')](_0x2c2a('0x6d'))){_0x53ed2b['limit']=qs[_0x2c2a('0x1e')](_0x111ff3[_0x2c2a('0x35')][_0x2c2a('0x1e')]);_0x53ed2b[_0x2c2a('0x20')]=qs[_0x2c2a('0x20')](_0x111ff3[_0x2c2a('0x35')][_0x2c2a('0x20')]);}return db['UserProfile'][_0x2c2a('0x48')]({'where':{'id':_0x111ff3[_0x2c2a('0x47')]['id']}})[_0x2c2a('0x27')](function(_0x50627a){if(!_0x50627a)throw new Error(_0x2c2a('0x6e')+_0x111ff3['params']['id']);return db[_0x2c2a('0x2f')]['getResources'](_0x111ff3);})[_0x2c2a('0x27')](respondWithFilteredResult(_0x17f630,_0x53ed2b))[_0x2c2a('0x45')](handleError(_0x17f630,null));}; \ No newline at end of file +var _0x2542=['clone','get','omit','createdAt','updatedAt','transaction','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','destroy','describe','removeSections','ids','filter','includes','subsections','push','enabled','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','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','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','json','undefined','count','offset','limit','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body'];(function(_0x1c44f7,_0x382b75){var _0x5f5611=function(_0x4ef50a){while(--_0x4ef50a){_0x1c44f7['push'](_0x1c44f7['shift']());}};_0x5f5611(++_0x382b75);}(_0x2542,0x169));var _0x2254=function(_0x9ad8e,_0x5b2ee6){_0x9ad8e=_0x9ad8e-0x0;var _0x1351ce=_0x2542[_0x9ad8e];return _0x1351ce;};'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'];config[_0x2254('0x1a')]=_[_0x2254('0x1b')](config[_0x2254('0x1a')],{'host':_0x2254('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2254('0x1a')]));require(_0x2254('0x1d'))['register'](socket);function respondWithStatusCode(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xcc;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1e')](_0x1e582d);}return _0x2f4de[_0x2254('0x1f')](_0x1e582d)[_0x2254('0x20')]();};}function respondWithResult(_0x50f137,_0x18baf4){_0x18baf4=_0x18baf4||0xc8;return function(_0x57247a){if(_0x57247a){return _0x50f137[_0x2254('0x1f')](_0x18baf4)[_0x2254('0x21')](_0x57247a);}};}function respondWithFilteredResult(_0x170ffa,_0x25f8b2){return function(_0x1ae11e){if(_0x1ae11e){var _0x34f90e=typeof _0x25f8b2['offset']==='undefined'&&typeof _0x25f8b2['limit']===_0x2254('0x22');var _0x3a79f8=_0x1ae11e[_0x2254('0x23')];var _0x1f1163=_0x34f90e?0x0:_0x25f8b2[_0x2254('0x24')];var _0x2339bc=_0x34f90e?_0x1ae11e['count']:_0x25f8b2[_0x2254('0x24')]+_0x25f8b2[_0x2254('0x25')];var _0x906cde;if(_0x2339bc>=_0x3a79f8){_0x2339bc=_0x3a79f8;_0x906cde=0xc8;}else{_0x906cde=0xce;}_0x170ffa['status'](_0x906cde);return _0x170ffa['set']('Content-Range',_0x1f1163+'-'+_0x2339bc+'/'+_0x3a79f8)[_0x2254('0x21')](_0x1ae11e);}return null;};}function patchUpdates(_0x559af4){return function(_0xf88b56){try{jsonpatch['apply'](_0xf88b56,_0x559af4,!![]);}catch(_0x5713e4){return BPromise['reject'](_0x5713e4);}return _0xf88b56['save']();};}function saveUpdates(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x26')](_0x5e5edb)[_0x2254('0x27')](function(_0x265467){return _0x265467;});}return null;};}function removeEntity(_0x13522d,_0x1349c9){return function(_0x51b578){if(_0x51b578){return _0x51b578['destroy']()[_0x2254('0x27')](function(){_0x13522d['status'](0xcc)[_0x2254('0x20')]();});}};}function handleEntityNotFound(_0x141dc5,_0x31a543){return function(_0x3aa0bd){if(!_0x3aa0bd){_0x141dc5[_0x2254('0x1e')](0x194);}return _0x3aa0bd;};}function handleError(_0x482688,_0x1a8a0d){_0x1a8a0d=_0x1a8a0d||0x1f4;return function(_0x2a789b){logger[_0x2254('0x28')](_0x2a789b[_0x2254('0x29')]);if(_0x2a789b[_0x2254('0x2a')]){delete _0x2a789b[_0x2254('0x2a')];}_0x482688[_0x2254('0x1f')](_0x1a8a0d)[_0x2254('0x2b')](_0x2a789b);};}exports[_0x2254('0x2c')]=function(_0x221db9,_0x21c641){var _0xad7774={},_0x220f2a={},_0x27d30a={'count':0x0,'rows':[]};var _0x4577f4=_[_0x2254('0x2d')](db[_0x2254('0x2e')][_0x2254('0x2f')],function(_0x2f32f8){return{'name':_0x2f32f8['fieldName'],'type':_0x2f32f8[_0x2254('0x30')][_0x2254('0x31')]};});_0x220f2a[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x4577f4,_0x2254('0x2a'));_0x220f2a[_0x2254('0x33')]=_[_0x2254('0x34')](_0x221db9[_0x2254('0x33')]);_0x220f2a[_0x2254('0x35')]=_['intersection'](_0x220f2a[_0x2254('0x32')],_0x220f2a[_0x2254('0x33')]);_0xad7774['attributes']=_[_0x2254('0x36')](_0x220f2a[_0x2254('0x32')],qs[_0x2254('0x37')](_0x221db9[_0x2254('0x33')]['fields']));_0xad7774['attributes']=_0xad7774[_0x2254('0x38')]['length']?_0xad7774[_0x2254('0x38')]:_0x220f2a[_0x2254('0x32')];if(!_0x221db9[_0x2254('0x33')][_0x2254('0x39')](_0x2254('0x3a'))){_0xad7774[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x221db9['query'][_0x2254('0x25')]);_0xad7774[_0x2254('0x24')]=qs[_0x2254('0x24')](_0x221db9[_0x2254('0x33')][_0x2254('0x24')]);}_0xad7774[_0x2254('0x3b')]=qs[_0x2254('0x3c')](_0x221db9[_0x2254('0x33')][_0x2254('0x3c')]);_0xad7774[_0x2254('0x3d')]=qs['filters'](_[_0x2254('0x3e')](_0x221db9[_0x2254('0x33')],_0x220f2a[_0x2254('0x35')]),_0x4577f4);if(_0x221db9[_0x2254('0x33')]['filter']){_0xad7774[_0x2254('0x3d')]=_[_0x2254('0x3f')](_0xad7774[_0x2254('0x3d')],{'$or':_[_0x2254('0x2d')](_0x4577f4,function(_0x216199){if(_0x216199[_0x2254('0x30')]!==_0x2254('0x40')){var _0x1d285b={};_0x1d285b[_0x216199['name']]={'$like':'%'+_0x221db9[_0x2254('0x33')]['filter']+'%'};return _0x1d285b;}})});}_0xad7774=_[_0x2254('0x3f')]({},_0xad7774,_0x221db9[_0x2254('0x41')]);var _0x10a7ac={'where':_0xad7774[_0x2254('0x3d')]};return db[_0x2254('0x2e')][_0x2254('0x23')](_0x10a7ac)[_0x2254('0x27')](function(_0x568ec9){_0x27d30a[_0x2254('0x23')]=_0x568ec9;if(_0x221db9[_0x2254('0x33')][_0x2254('0x42')]){_0xad7774[_0x2254('0x43')]=[{'all':!![]}];}return db[_0x2254('0x2e')]['findAll'](_0xad7774);})[_0x2254('0x27')](function(_0x1dec43){_0x27d30a[_0x2254('0x44')]=_0x1dec43;return _0x27d30a;})[_0x2254('0x27')](respondWithFilteredResult(_0x21c641,_0xad7774))[_0x2254('0x45')](handleError(_0x21c641,null));};exports['show']=function(_0x12a227,_0x47c933){var _0x91e091={'raw':![],'where':{'id':_0x12a227[_0x2254('0x46')]['id']}},_0x1ded9a={};_0x1ded9a[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x2f')]);_0x1ded9a[_0x2254('0x33')]=_[_0x2254('0x34')](_0x12a227[_0x2254('0x33')]);_0x1ded9a[_0x2254('0x35')]=_[_0x2254('0x36')](_0x1ded9a[_0x2254('0x32')],_0x1ded9a['query']);_0x91e091[_0x2254('0x38')]=_[_0x2254('0x36')](_0x1ded9a[_0x2254('0x32')],qs['fields'](_0x12a227[_0x2254('0x33')][_0x2254('0x37')]));_0x91e091[_0x2254('0x38')]=_0x91e091[_0x2254('0x38')][_0x2254('0x47')]?_0x91e091[_0x2254('0x38')]:_0x1ded9a[_0x2254('0x32')];if(_0x12a227[_0x2254('0x33')][_0x2254('0x42')]){_0x91e091['include']=[{'all':!![]}];}_0x91e091=_[_0x2254('0x3f')]({},_0x91e091,_0x12a227[_0x2254('0x41')]);return db[_0x2254('0x2e')][_0x2254('0x48')](_0x91e091)[_0x2254('0x27')](handleEntityNotFound(_0x47c933,null))[_0x2254('0x27')](respondWithResult(_0x47c933,null))[_0x2254('0x45')](handleError(_0x47c933,null));};exports[_0x2254('0x49')]=function(_0x3ac691,_0xa103ea){return db['UserProfile'][_0x2254('0x49')](_0x3ac691[_0x2254('0x4a')],{})['then'](respondWithResult(_0xa103ea,0xc9))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4b')]=function(_0x12e2ff,_0x4331a9){var _0x5debf6={'where':{'id':_0x12e2ff[_0x2254('0x46')]['id']}},_0x102e4b={};_0x102e4b['model']=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x2f')]);_0x5debf6[_0x2254('0x38')]=_['intersection'](_0x102e4b[_0x2254('0x32')],qs[_0x2254('0x37')](_0x12e2ff[_0x2254('0x33')]['fields']));_0x5debf6['attributes']=_0x5debf6[_0x2254('0x38')][_0x2254('0x47')]?_0x5debf6['attributes']:_0x102e4b[_0x2254('0x32')];if(_0x12e2ff['query']['includeAll']){_0x5debf6[_0x2254('0x43')]=[{'all':!![]}];}_0x5debf6=_[_0x2254('0x3f')]({},_0x5debf6,_0x12e2ff[_0x2254('0x41')]);return db[_0x2254('0x2e')][_0x2254('0x48')](_0x5debf6)['then'](handleEntityNotFound(_0x4331a9,null))['then'](function(_0x1bd988){if(_0x1bd988){var _0x5e3fbc=_0x1bd988[_0x2254('0x4c')]({'plain':!![]});_0x5e3fbc=qs[_0x2254('0x4d')](_0x5e3fbc,['id',_0x2254('0x4e'),_0x2254('0x4f'),'crudPermissions']);_0x12e2ff[_0x2254('0x4a')]=_[_0x2254('0x4d')](_0x12e2ff['body'],['id','createdAt',_0x2254('0x4f')]);return db['sequelize'][_0x2254('0x50')](function(_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x49')](_[_0x2254('0x3f')](_0x5e3fbc,_0x12e2ff['body']),{'include':_0x12e2ff['query'][_0x2254('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x305ace})['then'](function(_0x335c66){var _0x510fe0=_0x335c66['get']({'plain':!![]});return db['UserProfileSection'][_0x2254('0x51')]({'where':{'userProfileId':_0x12e2ff[_0x2254('0x46')]['id']},'raw':!![]})[_0x2254('0x27')](function(_0x3ea2d9){if(_0x3ea2d9){return BPromise[_0x2254('0x52')](_0x3ea2d9,function(_0x1cf757){return new BPromise(function(_0x14b1ba,_0x25137c){if(_0x1cf757[_0x2254('0x53')]===null||_0x1cf757[_0x2254('0x53')]===0x1)_0x14b1ba(null);return db[_0x2254('0x54')][_0x2254('0x51')]({'where':{'sectionId':_0x1cf757['id']},'raw':!![]})[_0x2254('0x27')](function(_0x24e57a){var _0x2f391d=_[_0x2254('0x2d')](_0x24e57a,function(_0x4659fc){return qs[_0x2254('0x4d')](_0x4659fc,['id',_0x2254('0x4e'),'updatedAt',_0x2254('0x55')]);});_0x14b1ba(_0x2f391d);})[_0x2254('0x45')](function(_0x3b1aae){_0x25137c(_0x3b1aae);});})[_0x2254('0x27')](function(_0x4c966a){var _0x494347=qs[_0x2254('0x4d')](_0x1cf757,['id',_0x2254('0x4e'),_0x2254('0x4f')]);_0x494347[_0x2254('0x56')]=_0x510fe0['id'];if(_0x4c966a)_0x494347[_0x2254('0x57')]=_0x4c966a;return _0x494347;})['then'](function(_0x45b7bd){return db[_0x2254('0x58')][_0x2254('0x49')](_0x45b7bd,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x305ace});});})[_0x2254('0x27')](function(){return _0x510fe0;});}});});});}})['then'](respondWithResult(_0x4331a9,0xc9))[_0x2254('0x45')](handleError(_0x4331a9,null));};exports[_0x2254('0x26')]=function(_0x5b269d,_0x3c091e){if(_0x5b269d[_0x2254('0x4a')]['id']){delete _0x5b269d['body']['id'];}return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x5b269d['params']['id']}})['then'](handleEntityNotFound(_0x3c091e,null))[_0x2254('0x27')](saveUpdates(_0x5b269d[_0x2254('0x4a')],null))['then'](respondWithResult(_0x3c091e,null))['catch'](handleError(_0x3c091e,null));};exports[_0x2254('0x59')]=function(_0x53fca8,_0x1d880f){return db['UserProfile'][_0x2254('0x48')]({'where':{'id':_0x53fca8[_0x2254('0x46')]['id']}})[_0x2254('0x27')](handleEntityNotFound(_0x1d880f,null))[_0x2254('0x27')](removeEntity(_0x1d880f,null))['catch'](handleError(_0x1d880f,null));};exports[_0x2254('0x5a')]=function(_0x5ecf82,_0x1c2158){return db[_0x2254('0x2e')]['describe']()[_0x2254('0x27')](respondWithResult(_0x1c2158,null))[_0x2254('0x45')](handleError(_0x1c2158,null));};exports['addSections']=function(_0x32614f,_0x3b3b20){var _0x28ef48=_0x32614f[_0x2254('0x4a')];return db['UserProfile'][_0x2254('0x48')]({'where':{'id':_0x32614f[_0x2254('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b3b20,null))[_0x2254('0x27')](function(_0x4469c7){if(_0x4469c7){return db['sequelize'][_0x2254('0x50')](function(_0x566805){return db[_0x2254('0x58')]['destroy']({'where':{'userProfileId':_0x32614f[_0x2254('0x46')]['id'],'sectionId':_[_0x2254('0x2d')](_0x28ef48,function(_0x5e86d3){return _0x5e86d3[_0x2254('0x55')];})},'transaction':_0x566805})['then'](function(){var _0x2ad17c=_[_0x2254('0x2d')](_0x28ef48,function(_0x38294d){_0x38294d['userProfileId']=_0x32614f[_0x2254('0x46')]['id'];return _0x38294d;});var _0x5afa65=[];return BPromise[_0x2254('0x52')](_0x2ad17c,function(_0x33f29b){return db['UserProfileSection']['create'](_0x33f29b,{'include':[{'model':db[_0x2254('0x54')],'as':_0x2254('0x57')}],'raw':!![],'transaction':_0x566805})[_0x2254('0x27')](function(_0x2861d0){_0x5afa65['push'](_0x2861d0[_0x2254('0x4c')]({'plain':!![]}));});})[_0x2254('0x27')](function(){return _0x5afa65;});});});}})[_0x2254('0x27')](function(_0x403a4b){return _0x403a4b;})['then'](respondWithResult(_0x3b3b20,null))[_0x2254('0x45')](handleError(_0x3b3b20,null));};exports[_0x2254('0x5b')]=function(_0x5cddb0,_0x38e393){var _0x5cbdb0;return db[_0x2254('0x2e')]['find']({'where':{'id':_0x5cddb0['params']['id']},'attributes':['id','name']})[_0x2254('0x27')](handleEntityNotFound(_0x38e393,null))['then'](function(_0x20c5ef){if(_0x20c5ef){_0x5cbdb0=_0x20c5ef;return db[_0x2254('0x58')]['destroy']({'where':{'userProfileId':_0x5cddb0[_0x2254('0x46')]['id'],'sectionId':_0x5cddb0[_0x2254('0x33')][_0x2254('0x5c')]}});}})[_0x2254('0x27')](function(){return _0x5cbdb0;})[_0x2254('0x27')](respondWithStatusCode(_0x38e393,null))[_0x2254('0x45')](handleError(_0x38e393,null));};exports['getSections']=function(_0x553ac5,_0xeb4273){var _0xfaa537=[];var _0x148735=[];return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x553ac5[_0x2254('0x46')]['id']},'raw':!![]})[_0x2254('0x27')](function(_0xf1a252){_0xfaa537=_[_0x2254('0x5d')](_0xf1a252,function(_0x39b95b){return _0x39b95b['enabled']===0x1||_[_0x2254('0x5e')]([0x3eb,0x709],_0x39b95b[_0x2254('0x55')]);});if(!_['isEmpty'](_0xfaa537)){return _[_0x2254('0x2d')](_0xfaa537,function(_0x57fb43){return _0x57fb43[_0x2254('0x55')];});}else{return;}})[_0x2254('0x27')](function(_0x4dfcb4){if(_0x4dfcb4)_0x148735=_0x4dfcb4;if(_[_0x2254('0x5e')](_0x148735,0x64)){var _0x4e699c=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x64});return hasDefaultDashboard(_0x4e699c)[_0x2254('0x27')](function(_0x30f2c9){return _[_0x2254('0x2d')](_0xfaa537,function(_0x5044a9){if(_0x5044a9[_0x2254('0x55')]===0x64){_0x5044a9[_0x2254('0x5f')]=_0x30f2c9;}return _0x5044a9;});});}else{return;}})[_0x2254('0x27')](function(_0x3a8d4f){if(_0x3a8d4f)_0xfaa537=_0x3a8d4f;if(_['includes'](_0x148735,0x3eb)){var _0x177f00=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x3eb});return getCustomDashboards(_0x177f00)['then'](function(_0x23f9ca){return _[_0x2254('0x2d')](_0xfaa537,function(_0x54a384){if(_0x177f00['enabled']){if(_0x54a384[_0x2254('0x55')]===0x3eb){_0x54a384[_0x2254('0x5f')]=_0x23f9ca;}}else{if(_0x54a384[_0x2254('0x55')]===0x64){_0x54a384[_0x2254('0x5f')]=_0x23f9ca;}}return _0x54a384;});});}else{return;}})[_0x2254('0x27')](function(_0x335c69){if(_0x335c69)_0xfaa537=_0x335c69;if(_[_0x2254('0x5e')](_0x148735,0x709)){var _0x251d70=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x709});return getPlugins(_0x251d70)['then'](function(_0x10c44){if(_0x251d70['enabled']){return _[_0x2254('0x2d')](_0xfaa537,function(_0x555f0e){if(_0x555f0e[_0x2254('0x55')]===0x709){_0x555f0e[_0x2254('0x5f')]=_0x10c44;}return _0x555f0e;});}else{var _0x2b0a45={'sectionId':0x76c,'enabled':0x1,'subsections':_0x10c44};var _0x53ef4e=_[_0x2254('0x2d')](_0xfaa537);_0x53ef4e[_0x2254('0x60')](_0x2b0a45);return _0x53ef4e;}});}else{return;}})[_0x2254('0x27')](function(_0x472758){if(_0x472758)_0xfaa537=_0x472758;return _[_0x2254('0x5d')](_0xfaa537,[_0x2254('0x61'),0x1]);})[_0x2254('0x27')](respondWithResult(_0xeb4273,null))[_0x2254('0x45')](handleError(_0xeb4273,null));};function hasDefaultDashboard(_0x203d05){var _0x146b52=[0x65];return new BPromise(function(_0x25a0aa,_0x46f6bc){try{if(_0x203d05[_0x2254('0x53')]){_0x25a0aa(_0x146b52);}else{return db['UserProfileResource'][_0x2254('0x62')]({'where':{'sectionId':_0x203d05['id']},'raw':!![]})['then'](function(_0x64c4f5){_0x64c4f5?_0x25a0aa(_0x146b52):_0x25a0aa();});}}catch(_0xb98b40){_0x46f6bc(_0xb98b40);}});}function getCustomDashboards(_0x3b1d5c){var _0x2c907a=[];return new BPromise(function(_0x23b78c,_0x2b5dba){try{if(_0x3b1d5c[_0x2254('0x53')]){return db['Dashboard'][_0x2254('0x51')]({'raw':!![]})['then'](function(_0x16aa33){_0x16aa33['forEach'](function(_0xa761ee){_0x2c907a[_0x2254('0x60')](_0xa761ee['id']+0x1869f);});_0x23b78c(_0x2c907a);});}else{return db[_0x2254('0x54')]['findAll']({'where':{'sectionId':_0x3b1d5c['id']},'raw':!![]})[_0x2254('0x27')](function(_0x160412){_0x160412[_0x2254('0x63')](function(_0x14f121){_0x2c907a[_0x2254('0x60')](_0x14f121[_0x2254('0x64')]+0x1869f);});_0x23b78c(_0x2c907a);});}}catch(_0x34185c){_0x2b5dba(_0x34185c);}});}function getPlugins(_0x13a4f6){var _0x5e94b6=[];return new BPromise(function(_0x56239e,_0x437d5b){try{if(_0x13a4f6['autoAssociation']){return db[_0x2254('0x65')][_0x2254('0x51')]({'raw':!![]})[_0x2254('0x27')](function(_0x438c95){_0x438c95[_0x2254('0x63')](function(_0x477a62){_0x5e94b6[_0x2254('0x60')](_0x477a62['id']+0x15b38);});_0x56239e(_0x5e94b6);});}else{return db['UserProfileResource'][_0x2254('0x51')]({'where':{'sectionId':_0x13a4f6['id']},'raw':!![]})[_0x2254('0x27')](function(_0x158e14){_0x158e14['forEach'](function(_0x3bbb35){_0x5e94b6[_0x2254('0x60')](_0x3bbb35[_0x2254('0x64')]+0x15b38);});_0x56239e(_0x5e94b6);});}}catch(_0x1426d6){_0x437d5b(_0x1426d6);}});}exports[_0x2254('0x66')]=function(_0x37ddcc,_0x461017){return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x37ddcc['params']['id']}})[_0x2254('0x27')](handleEntityNotFound(_0x461017,null))[_0x2254('0x27')](function(_0x590b46){if(_0x590b46){return db['sequelize'][_0x2254('0x50')](function(_0x54339e){return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x37ddcc[_0x2254('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x2254('0x27')](function(_0x3a1d7c){if(_0x3a1d7c){return db[_0x2254('0x58')][_0x2254('0x59')]({'where':{'userProfileId':_0x37ddcc[_0x2254('0x46')]['id'],'id':_['map'](_0x3a1d7c,function(_0x59e759){return _0x59e759['id'];})},'transaction':_0x54339e});}})[_0x2254('0x27')](function(_0x1cfb9c){var _0x1e8617=_[_0x2254('0x2d')](_0x37ddcc[_0x2254('0x4a')],function(_0x4fac52){_0x4fac52['userProfileId']=_0x37ddcc[_0x2254('0x46')]['id'];return _0x4fac52;});return db['UserProfileSection'][_0x2254('0x67')](_0x1e8617,{'raw':!![],'transaction':_0x54339e});})[_0x2254('0x27')](function(_0x97117c){var _0x14b9a4=_[_0x2254('0x5d')](_[_0x2254('0x2d')](_0x97117c,function(_0x23e2a8){return _0x23e2a8['get']({'plain':!![]});}),{'includeAll':![]});if(_0x14b9a4){return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x37ddcc['params']['id'],'sectionId':_[_0x2254('0x2d')](_0x14b9a4,function(_0x9cb479){return _0x9cb479[_0x2254('0x55')];})},'attributes':['id',_0x2254('0x55')],'raw':!![]})[_0x2254('0x27')](function(_0xa49145){var _0x121e7a=_[_0x2254('0x2d')](_0x37ddcc[_0x2254('0x4a')],function(_0xb24f9b){_0xb24f9b[_0x2254('0x56')]=_0x37ddcc['params']['id'];return _0xb24f9b;});return db[_0x2254('0x54')][_0x2254('0x67')](_0x121e7a,{'raw':!![],'transaction':_0x54339e});});}})[_0x2254('0x45')](handleError(_0x461017,null));});}})[_0x2254('0x27')](function(_0x346400){var _0x540c94=_[_0x2254('0x2d')](_0x346400,function(_0x5d579c){return _0x5d579c[_0x2254('0x4c')]({'plain':!![]});});})[_0x2254('0x27')](respondWithResult(_0x461017,null))[_0x2254('0x45')](handleError(_0x461017,null));};exports['removeResources']=function(_0x60f5ac,_0x2d2180,_0x45a011){return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x60f5ac[_0x2254('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d2180,null))[_0x2254('0x27')](function(_0xf19a87){if(_0xf19a87){return _0xf19a87[_0x2254('0x68')](_0x60f5ac[_0x2254('0x33')][_0x2254('0x5c')]);}})['then'](respondWithStatusCode(_0x2d2180,null))['catch'](handleError(_0x2d2180,null));};exports[_0x2254('0x69')]=function(_0x4ca0b2,_0x25492b){var _0x3bea23={};if(!_0x4ca0b2[_0x2254('0x33')][_0x2254('0x6a')])throw new Error(_0x2254('0x6b'));if(!_0x4ca0b2[_0x2254('0x33')]['hasOwnProperty']('nolimit')){_0x3bea23[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x4ca0b2[_0x2254('0x33')][_0x2254('0x25')]);_0x3bea23['offset']=qs[_0x2254('0x24')](_0x4ca0b2[_0x2254('0x33')][_0x2254('0x24')]);}return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x4ca0b2[_0x2254('0x46')]['id']}})[_0x2254('0x27')](function(_0x20414d){if(!_0x20414d)throw new Error(_0x2254('0x6c')+_0x4ca0b2['params']['id']);return db[_0x2254('0x2e')][_0x2254('0x69')](_0x4ca0b2);})[_0x2254('0x27')](respondWithFilteredResult(_0x25492b,_0x3bea23))['catch'](handleError(_0x25492b,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a60a983..a40dfc7 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 _0x323f=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x56ab92,_0x53efe2){var _0x5ef960=function(_0x3096cf){while(--_0x3096cf){_0x56ab92['push'](_0x56ab92['shift']());}};_0x5ef960(++_0x53efe2);}(_0x323f,0x1ee));var _0xf323=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x323f[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf323('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf323('0x1')](0x0);var events={'afterCreate':_0xf323('0x2'),'afterUpdate':_0xf323('0x3'),'afterDestroy':_0xf323('0x4')};function emitEvent(_0x111042){return function(_0x2c9d35,_0xb4caa8,_0x2d4750){UserProfileEvents[_0xf323('0x5')](_0x111042+':'+_0x2c9d35['id'],_0x2c9d35);UserProfileEvents[_0xf323('0x5')](_0x111042,_0x2c9d35);_0x2d4750(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xf323('0x6')](e,emitEvent(event));}}module[_0xf323('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xd943=['../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','events'];(function(_0x273f1a,_0x58ec58){var _0x597652=function(_0x2c1c0a){while(--_0x2c1c0a){_0x273f1a['push'](_0x273f1a['shift']());}};_0x597652(++_0x58ec58);}(_0xd943,0x15d));var _0x3d94=function(_0x545736,_0x37a8e9){_0x545736=_0x545736-0x0;var _0x5ba8e5=_0xd943[_0x545736];return _0x5ba8e5;};'use strict';var EventEmitter=require(_0x3d94('0x0'));var UserProfile=require(_0x3d94('0x1'))['db'][_0x3d94('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3d94('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d94('0x4'),'afterDestroy':_0x3d94('0x5')};function emitEvent(_0x38b5ca){return function(_0xc13b61,_0xaf8962,_0x5751f6){UserProfileEvents['emit'](_0x38b5ca+':'+_0xc13b61['id'],_0xc13b61);UserProfileEvents[_0x3d94('0x6')](_0x38b5ca,_0xc13b61);_0x5751f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 4aa8e2a..bd041b6 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 _0xb145=['name','resourceId','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','role','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','agents','telephones','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','zohoaccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','toUpperCase','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','query','toString','OpenTabs','UserProfile','user_profiles','Invalid\x20section\x20\x27','length','push','UserProfileSection','params','all','ignore','find','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','key','VIRTUAL','foreignKey','forEach','merge','options','AnalyticExtractedReport','include','reportType','DefaultReports','reportId','CustomReports','count','includeAll','color','ThroughTags','tag','rows','Agents','chat','dataValues','sms','fax','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','catch','model','then','map'];(function(_0x272700,_0x344cd5){var _0xb03f5=function(_0x176215){while(--_0x176215){_0x272700['push'](_0x272700['shift']());}};_0xb03f5(++_0x344cd5);}(_0xb145,0xa3));var _0x5b14=function(_0x59817,_0x427d95){_0x59817=_0x59817-0x0;var _0xe8cfa8=_0xb145[_0x59817];return _0xe8cfa8;};'use strict';var _=require('lodash');var attributes=require(_0x5b14('0x0'));var qs=require(_0x5b14('0x1'));var squel=require(_0x5b14('0x2'));module[_0x5b14('0x3')]=function(_0x40609d){var _0x3defa8=_0x40609d[_0x5b14('0x4')];function _0x34b4cd(_0x5111cd,_0x1e0b5b){return new Promise(function(_0x15490e,_0x392425){if(!_0x1e0b5b)return _0x15490e(null);var _0x4d82ad=_0x1e0b5b['filter']?{[_0x1e0b5b[_0x5b14('0x5')][_0x5b14('0x6')]]:_0x1e0b5b[_0x5b14('0x5')][_0x5b14('0x7')]}:undefined;return _0x3defa8[_0x5111cd][_0x5b14('0x8')]({'where':_0x4d82ad,'raw':!![]})['then'](function(_0x32d729){_0x1e0b5b[_0x5b14('0x9')]=_['map'](_0x32d729,'id');_0x15490e(_0x1e0b5b);})[_0x5b14('0xa')](function(_0x17047f){_0x392425(_0x17047f);});});}function _0x1ecffb(_0xe146e8,_0x2102f0){return new Promise(function(_0x4fb6da,_0x265df3){var _0x50997e=_0xe146e8[_0x5b14('0x5')]?{[_0xe146e8[_0x5b14('0x5')][_0x5b14('0x6')]]:_0xe146e8[_0x5b14('0x5')][_0x5b14('0x7')]}:undefined;return _0x3defa8[_0xe146e8[_0x5b14('0xb')]]['findAll']({'where':_0x50997e,'raw':!![]})[_0x5b14('0xc')](function(_0x16f2a1){_0x2102f0[_0x5b14('0x9')]=_[_0x5b14('0xd')](_0x16f2a1,function(_0xba7e13){return _0xba7e13[_0x5b14('0xe')];});_0x4fb6da(_0x2102f0);})[_0x5b14('0xa')](function(_0xe5af75){_0x265df3(_0xe5af75);});});}function _0x183b0a(_0x287bb7,_0x221344,_0x2c3efb){if(!_0x221344)return Promise['resolve'](null);return new Promise(function(_0x24cfd0,_0x50866a){return _0x3defa8['UserProfileResource']['findAll']({'where':{'sectionId':_0x221344['id']},'raw':!![]})[_0x5b14('0xc')](function(_0x3035b5){if(_0x287bb7[_0x5b14('0x6')]&&_0x287bb7[_0x5b14('0x6')]!=='id'){_0x221344[_0x5b14('0x9')]=_[_0x5b14('0xd')](_0x3035b5,function(_0x19e6f8){return _0x19e6f8[_0x287bb7['field']];});}else{if(_0x2c3efb==='AnalyticExtractedReport'){_0x221344['associatedResources']=_[_0x5b14('0xd')](_0x3035b5,function(_0x2afa17){return{'id':_0x2afa17[_0x5b14('0xf')],'type':_0x2afa17[_0x5b14('0x10')]};});}else{_0x221344['associatedResources']=_[_0x5b14('0xd')](_0x3035b5,function(_0x1577f7){return _0x1577f7['resourceId'];});}}_0x24cfd0(_0x221344);})[_0x5b14('0xa')](function(_0x30734f){_0x50866a(_0x30734f);});});}function _0x50951f(_0x33a293,_0x54073f){var _0x59282c={'parentSections':[]};switch(_0x33a293['toLowerCase']()){case'squareprojects':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x12');break;case _0x5b14('0x13'):_0x59282c['childModel']=_0x5b14('0x14');break;case _0x5b14('0x15'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x16');_0x59282c[_0x5b14('0x17')]=[{'name':_0x5b14('0x18'),'field':_0x5b14('0xe'),'foreignKey':_0x5b14('0x19')}];break;case _0x5b14('0x1a'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x1b');break;case _0x5b14('0x1c'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x1d');_0x59282c['parentSections']=[{'name':_0x5b14('0x1e'),'field':'id','foreignKey':_0x5b14('0x1f')}];break;case'lists':_0x59282c['childModel']=_0x5b14('0x20');break;case _0x5b14('0x21'):_0x59282c['childModel']='CmCompany';break;case _0x5b14('0x22'):_0x59282c['childModel']=_0x5b14('0x23');break;case _0x5b14('0x24'):_0x59282c['childModel']='ChatQueue';break;case _0x5b14('0x25'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x26');break;case'faxqueues':_0x59282c[_0x5b14('0x11')]='FaxQueue';break;case _0x5b14('0x27'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x28');break;case _0x5b14('0x29'):case'internalroutes':case _0x5b14('0x2a'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x2b');break;case _0x5b14('0x2c'):_0x59282c['childModel']=_0x5b14('0x2d');break;case _0x5b14('0x2e'):_0x59282c[_0x5b14('0x11')]='VoiceMail';break;case _0x5b14('0x2f'):_0x59282c['childModel']=_0x5b14('0x30');_0x59282c[_0x5b14('0x17')]=[{'name':'Agents','field':_0x5b14('0xe'),'foreignKey':_0x5b14('0x31'),'model':'User','filter':{'field':_0x5b14('0x32'),'value':['agent']}},{'name':_0x5b14('0x33'),'field':_0x5b14('0xe'),'foreignKey':_0x5b14('0x31'),'model':_0x5b14('0x34'),'filter':{'field':'role','value':[_0x5b14('0x35')]}},{'name':_0x5b14('0x36'),'field':_0x5b14('0xe'),'foreignKey':_0x5b14('0x37'),'model':_0x5b14('0x38'),'filter':{'field':_0x5b14('0x10'),'value':[_0x5b14('0x39')]}},{'name':_0x5b14('0x3a'),'field':_0x5b14('0xe'),'foreignKey':_0x5b14('0x37'),'model':_0x5b14('0x38'),'filter':{'field':_0x5b14('0x10'),'value':[_0x5b14('0x3b')]}}];break;case _0x5b14('0x3c'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x3d');break;case'chanspies':_0x59282c[_0x5b14('0x11')]='VoiceChanSpy';break;case _0x5b14('0x3e'):_0x59282c[_0x5b14('0x11')]='VoicePrefix';break;case'ivrcampaigns':_0x59282c['childModel']=_0x5b14('0x3f');break;case _0x5b14('0x40'):_0x59282c['childModel']=_0x5b14('0x41');break;case _0x5b14('0x42'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x43');break;case _0x5b14('0x44'):_0x59282c['childModel']=_0x5b14('0x45');break;case _0x5b14('0x46'):_0x59282c['childModel']=_0x5b14('0x47');break;case _0x5b14('0x48'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x49');break;case'smsqueues':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x4a');break;case _0x5b14('0x4b'):_0x59282c[_0x5b14('0x11')]='SmsAccount';break;case _0x5b14('0x4c'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x4d');break;case _0x5b14('0x4e'):_0x59282c['childModel']='WhatsappAccount';break;case _0x5b14('0x4f'):_0x59282c[_0x5b14('0x11')]='Team';break;case _0x5b14('0x50'):case'queuecampaigns':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x38');if(_0x54073f){_0x59282c[_0x5b14('0x17')]=[{'name':_0x5b14('0x36')},{'name':_0x5b14('0x3a')}];}break;case'users':case _0x5b14('0x51'):case _0x5b14('0x52'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x34');if(_0x54073f){_0x59282c[_0x5b14('0x17')]=[{'name':'Users','filter':{'field':'role','value':[_0x5b14('0x53'),'user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x5b14('0x54'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x55');break;case _0x5b14('0x56'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x57');break;case _0x5b14('0x58'):_0x59282c['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x59282c['childModel']='SugarcrmAccount';break;case _0x5b14('0x59'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x5a');break;case _0x5b14('0x5b'):_0x59282c[_0x5b14('0x11')]='ZohoAccount';break;case'vtigeraccounts':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x34');break;case'cannedanswers':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x5c');break;case'dispositions':_0x59282c['childModel']=_0x5b14('0x5d');break;case _0x5b14('0x5e'):_0x59282c[_0x5b14('0x11')]='Dashboard';break;case _0x5b14('0x5f'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x60');break;case _0x5b14('0x61'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x62');break;case _0x5b14('0x63'):_0x59282c['childModel']=_0x5b14('0x64');break;case'sounds':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x65');break;case _0x5b14('0x66'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x67');break;case _0x5b14('0x68'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x69');break;case _0x5b14('0x6a'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x6b');break;case _0x5b14('0x6c'):_0x59282c['childModel']='Trunk';break;case'variables':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x6d');break;case _0x5b14('0x6e'):_0x59282c[_0x5b14('0x11')]=_0x5b14('0x6f');break;case _0x5b14('0x70'):_0x59282c[_0x5b14('0x11')]='AnalyticExtractedReport';_0x59282c[_0x5b14('0x17')]=[{'name':_0x5b14('0x71'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x59282c[_0x5b14('0x11')]=_0x5b14('0x72');break;}return _0x59282c;}function _0x414f79(_0x16c74e,_0x32629d){var _0x1009e5=_0x16c74e['charAt'](0x0)[_0x5b14('0x73')]()+_0x16c74e['slice'](0x1);var _0x426c27={'type':_0x3defa8['Sequelize'][_0x5b14('0x74')][_0x5b14('0x75')],'raw':!![]};return new Promise(function(_0x3f7786,_0x49f348){var _0x2084c9=squel['select']()[_0x5b14('0x6')](_0x5b14('0x76')+_0x1009e5+_0x5b14('0x77'),'id')['field'](_0x5b14('0x78'))[_0x5b14('0x79')](_0x5b14('0x7a')+_0x16c74e+_0x5b14('0x7b'),'ui')['where'](_0x5b14('0x7c'),_0x32629d['id']);return _0x3defa8['sequelize'][_0x5b14('0x7d')](_0x2084c9[_0x5b14('0x7e')](),_0x426c27)['then'](function(_0x4a506a){_0x32629d[_0x1009e5+_0x5b14('0x7f')]=_0x4a506a;_0x3f7786(_0x4a506a);})[_0x5b14('0xa')](function(_0xb50187){_0x49f348(_0xb50187);});});}return _0x40609d['define'](_0x5b14('0x80'),attributes,{'tableName':_0x5b14('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5c9afe){var _0x4b9720={'raw':![],'where':{}};var _0x3f4e96={};var _0x18ae4f={'count':0x0,'rows':[]};var _0x23db69=_0x5c9afe[_0x5b14('0x7d')]['section'];var _0x25b569=_0x5c9afe[_0x5b14('0x7d')]['mergeResources']||![];var _0x5e950d=_0x50951f(_0x23db69,_0x25b569);if(!_0x5e950d[_0x5b14('0x11')])throw new Error(_0x5b14('0x82')+_0x23db69+'\x27');var _0x4d3667=[{'name':_0x23db69}];if(!_['isEmpty'](_0x5e950d[_0x5b14('0x17')]))_0x4d3667=_0x5e950d[_0x5b14('0x17')];var _0x327b7e=[];for(var _0x5b4831=0x0;_0x5b4831<_0x4d3667[_0x5b14('0x83')];_0x5b4831++){_0x327b7e[_0x5b14('0x84')](_0x3defa8[_0x5b14('0x85')]['find']({'where':{'userProfileId':_0x5c9afe[_0x5b14('0x86')]['id'],'name':_0x4d3667[_0x5b4831][_0x5b14('0xe')]},'raw':!![]}));}return Promise[_0x5b14('0x87')](_0x327b7e)['then'](function(_0x439817){var _0x404adb=_[_0x5b14('0x5')](_0x439817,function(_0x2ca6dd){return _0x2ca6dd?_0x2ca6dd:undefined;});var _0x1c0fa2=_[_0x5b14('0x5')](_0x4d3667,[_0x5b14('0x88'),!![]]);var _0x51c15d=_['isEmpty'](_0x404adb)&&_['isEmpty'](_0x1c0fa2)?null:_['union'](_0x1c0fa2,_0x404adb);if(!_0x51c15d)return null;var _0x34e049=[];for(var _0x1f0867=0x0;_0x1f0867<_0x51c15d[_0x5b14('0x83')];_0x1f0867++){var _0x2d93a=_[_0x5b14('0x89')](_0x4d3667,function(_0x58f544){return _0x51c15d[_0x1f0867]?_0x58f544['name']===_0x51c15d[_0x1f0867][_0x5b14('0xe')]:null;});if(_0x2d93a){if(_0x51c15d[_0x1f0867][_0x5b14('0x88')]){_0x34e049[_0x5b14('0x84')](_0x34b4cd(_0x5e950d[_0x5b14('0x11')],_0x51c15d[_0x1f0867]));}else{if(!_0x51c15d[_0x1f0867][_0x5b14('0x8a')]){_0x34e049['push'](_0x183b0a(_0x2d93a,_0x51c15d[_0x1f0867],_0x5e950d['childModel']));}else{if(_0x2d93a[_0x5b14('0xb')]){_0x34e049[_0x5b14('0x84')](_0x1ecffb(_0x2d93a,_0x51c15d[_0x1f0867]));}}}}}return Promise[_0x5b14('0x87')](_0x34e049);})[_0x5b14('0xc')](function(_0x18de83){var _0x1c464f=_0x18de83;var _0x221759=null;if(_0x1c464f){_0x221759=_0x1c464f[_0x5b14('0x83')]===0x1?_0x1c464f[0x0]:null;}if(!_0x221759&&!_0x1c464f)return _0x18ae4f;var _0x334792=_0x3defa8[_0x5e950d['childModel']][_0x5b14('0x8b')];_0x3f4e96['model']=_[_0x5b14('0x8c')](_0x334792);_0x3f4e96[_0x5b14('0x7d')]=_[_0x5b14('0x8c')](_0x5c9afe[_0x5b14('0x7d')]);_0x3f4e96[_0x5b14('0x8d')]=_[_0x5b14('0x8e')](_0x3f4e96[_0x5b14('0xb')],_0x3f4e96['query']);_0x4b9720['attributes']=_[_0x5b14('0x8e')](_0x3f4e96[_0x5b14('0xb')],qs[_0x5b14('0x8f')](_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0x8f')]));_0x4b9720['attributes']=_0x4b9720[_0x5b14('0x90')][_0x5b14('0x83')]?_0x4b9720[_0x5b14('0x90')]:_0x3f4e96[_0x5b14('0xb')];if(!_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0x91')](_0x5b14('0x92'))){_0x4b9720[_0x5b14('0x93')]=qs[_0x5b14('0x93')](_0x5c9afe[_0x5b14('0x7d')]['limit']);_0x4b9720['offset']=qs[_0x5b14('0x94')](_0x5c9afe[_0x5b14('0x7d')]['offset']);}_0x4b9720[_0x5b14('0x95')]=qs[_0x5b14('0x96')](_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0x96')]);_0x4b9720['where']=qs[_0x5b14('0x8d')](_[_0x5b14('0x97')](_0x5c9afe[_0x5b14('0x7d')],_0x3f4e96[_0x5b14('0x8d')]));if(_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0x5')]){_0x4b9720[_0x5b14('0x98')]=_['merge'](_0x4b9720['where'],{'$or':_['map'](_0x334792,function(_0x12a1dd){if(_0x12a1dd[_0x5b14('0x10')][_0x5b14('0x99')]!==_0x5b14('0x9a')){var _0x3449df={};_0x3449df[_0x12a1dd[_0x5b14('0x6')]]={'$like':'%'+_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0x5')]+'%'};return _0x3449df;}})});}var _0x2364bc=[];var _0x18d88b=null;var _0x29d158={};if(_0x221759){_0x18d88b=_['find'](_0x4d3667,[_0x5b14('0xe'),_0x221759[_0x5b14('0xe')]]);if(_0x18d88b[_0x5b14('0x6')]){_0x29d158={};if(_0x5e950d[_0x5b14('0x11')]==='AnalyticExtractedReport'){_0x29d158[_0x18d88b[_0x5b14('0x9b')]]=_[_0x5b14('0xd')](_0x221759[_0x5b14('0x9')],'id');}else{_0x29d158[_0x18d88b[_0x5b14('0x9b')]]=_0x221759[_0x5b14('0x9')];}_0x2364bc[_0x5b14('0x84')](_0x29d158);}else{_0x4b9720[_0x5b14('0x98')]['id']=_0x221759[_0x5b14('0x9')];}}else{for(var _0x189368=0x0;_0x189368<_0x1c464f[_0x5b14('0x83')];_0x189368++){_0x18d88b=_[_0x5b14('0x89')](_0x4d3667,[_0x5b14('0xe'),_0x1c464f[_0x189368][_0x5b14('0xe')]]);if(_0x18d88b[_0x5b14('0x6')]){_0x29d158={};_0x29d158[_0x18d88b[_0x5b14('0x9b')]]=_0x1c464f[_0x189368]['associatedResources'];_0x2364bc[_0x5b14('0x84')](_0x29d158);}else{if(!_0x4b9720[_0x5b14('0x98')]['id'])_0x4b9720[_0x5b14('0x98')]['id']=[];_0x1c464f[_0x189368][_0x5b14('0x9')][_0x5b14('0x9c')](function(_0x5939ae){_0x4b9720['where']['id'][_0x5b14('0x84')](_0x5939ae);});}}}if(!_['isEmpty'](_0x2364bc)){_0x4b9720[_0x5b14('0x98')]=_[_0x5b14('0x9d')](_0x4b9720[_0x5b14('0x98')],{'$and':{'$or':_0x2364bc}});}_0x4b9720=_[_0x5b14('0x9d')]({},_0x4b9720,_0x5c9afe[_0x5b14('0x9e')]);if(_0x221759&&!_0x221759[_0x5b14('0x8a')]&&_0x5e950d['childModel']===_0x5b14('0x9f')){if(_0x5c9afe['query']['includeAll']){_0x4b9720[_0x5b14('0xa0')]=[{'all':!![]}];}return _0x3defa8[_0x5e950d[_0x5b14('0x11')]][_0x5b14('0x8')](_0x4b9720)['then'](function(_0x5b8e11){var _0x5c9aa0=[];_0x5b8e11['forEach'](function(_0x1f2d2e){var _0x1f7304;switch(_0x1f2d2e[_0x5b14('0xa1')]){case'default':_0x1f7304=_['find'](_0x221759[_0x5b14('0x9')],function(_0x317f33){return _0x317f33['id']===_0x1f2d2e['reportId']&&_0x317f33[_0x5b14('0x10')]===_0x5b14('0xa2');});break;case'custom':_0x1f7304=_['find'](_0x221759['associatedResources'],function(_0x522cc5){return _0x522cc5['id']===_0x1f2d2e[_0x5b14('0xa3')]&&_0x522cc5['type']===_0x5b14('0xa4');});break;}if(_0x1f7304)_0x5c9aa0[_0x5b14('0x84')](_0x1f2d2e);});_0x18ae4f['count']=_0x5c9aa0[_0x5b14('0x83')];_0x18ae4f['rows']=_0x5c9aa0;return _0x18ae4f;});}else{return _0x3defa8[_0x5e950d[_0x5b14('0x11')]]['count']({'where':_0x4b9720[_0x5b14('0x98')]})[_0x5b14('0xc')](function(_0x52df2d){_0x18ae4f[_0x5b14('0xa5')]=_0x52df2d;if(_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0xa6')]){if(_0x5e950d[_0x5b14('0x11')]==='CmContact'){_0x4b9720[_0x5b14('0xa0')]=[{'model':_0x3defa8[_0x5b14('0x67')],'as':'Tags','attributes':['id',_0x5b14('0xe'),_0x5b14('0xa7')],'required':_0x5c9afe[_0x5b14('0x7d')]['tag']?!![]:![]},{'model':_0x3defa8[_0x5b14('0x67')],'as':_0x5b14('0xa8'),'attributes':['id',_0x5b14('0xe'),'color'],'through':_0x5c9afe[_0x5b14('0x7d')]['tag']?{'attributes':[],'where':{'TagId':_0x5c9afe[_0x5b14('0x7d')]['tag']||undefined}}:{},'required':_0x5c9afe[_0x5b14('0x7d')][_0x5b14('0xa9')]?!![]:![]}];}else{_0x4b9720['include']=[{'all':!![]}];}}return _0x3defa8[_0x5e950d[_0x5b14('0x11')]]['findAll'](_0x4b9720);})[_0x5b14('0xc')](function(_0x891dee){_0x18ae4f[_0x5b14('0xaa')]=_0x891dee;if(_0x23db69===_0x5b14('0xab')&&_0x5c9afe[_0x5b14('0x7d')]['openTabs']==='true'){var _0x343fe3=[];for(var _0x5c5f1c=0x0;_0x5c5f1c<_0x18ae4f[_0x5b14('0xaa')][_0x5b14('0x83')];_0x5c5f1c++){_0x343fe3[_0x5b14('0x84')](_0x414f79(_0x5b14('0xac'),_0x18ae4f['rows'][_0x5c5f1c][_0x5b14('0xad')]));_0x343fe3[_0x5b14('0x84')](_0x414f79(_0x5b14('0xae'),_0x18ae4f[_0x5b14('0xaa')][_0x5c5f1c][_0x5b14('0xad')]));_0x343fe3[_0x5b14('0x84')](_0x414f79(_0x5b14('0xaf'),_0x18ae4f[_0x5b14('0xaa')][_0x5c5f1c][_0x5b14('0xad')]));_0x343fe3[_0x5b14('0x84')](_0x414f79('mail',_0x18ae4f['rows'][_0x5c5f1c]['dataValues']));_0x343fe3['push'](_0x414f79('openchannel',_0x18ae4f[_0x5b14('0xaa')][_0x5c5f1c][_0x5b14('0xad')]));_0x343fe3[_0x5b14('0x84')](_0x414f79(_0x5b14('0xb0'),_0x18ae4f['rows'][_0x5c5f1c][_0x5b14('0xad')]));}return Promise[_0x5b14('0x87')](_0x343fe3)[_0x5b14('0xc')](function(){return _0x18ae4f;});}return _0x18ae4f;});}});}}});}; \ No newline at end of file +var _0x7880=['VoiceMail','VoiceRecording','parentSections','Agents','membername','role','Telephones','User','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','sequelize','query','toString','define','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','params','all','ignore','union','find','push','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','include','forEach','reportType','default','DefaultReports','CustomReports','count','rows','includeAll','CmContact','Tags','color','tag','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','findAll','map','catch','model','then','name','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','voicemails'];(function(_0x352061,_0x176667){var _0x2cae8d=function(_0x5e37cb){while(--_0x5e37cb){_0x352061['push'](_0x352061['shift']());}};_0x2cae8d(++_0x176667);}(_0x7880,0x1f4));var _0x0788=function(_0x5c0ff6,_0x22cdd2){_0x5c0ff6=_0x5c0ff6-0x0;var _0x1135cd=_0x7880[_0x5c0ff6];return _0x1135cd;};'use strict';var _=require('lodash');var attributes=require(_0x0788('0x0'));var qs=require(_0x0788('0x1'));var squel=require(_0x0788('0x2'));module[_0x0788('0x3')]=function(_0x47dc20){var _0x446ded=_0x47dc20['models'];function _0x3925a6(_0x1e0814,_0x317885){return new Promise(function(_0xd53e7d,_0x262f5c){if(!_0x317885)return _0xd53e7d(null);var _0x775629=_0x317885[_0x0788('0x4')]?{[_0x317885[_0x0788('0x4')][_0x0788('0x5')]]:_0x317885[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x1e0814][_0x0788('0x6')]({'where':_0x775629,'raw':!![]})['then'](function(_0xabaf81){_0x317885['associatedResources']=_[_0x0788('0x7')](_0xabaf81,'id');_0xd53e7d(_0x317885);})[_0x0788('0x8')](function(_0x1f9ff6){_0x262f5c(_0x1f9ff6);});});}function _0xee8670(_0x469ebe,_0x5d747c){return new Promise(function(_0x1920b3,_0x37560d){var _0x21c303=_0x469ebe[_0x0788('0x4')]?{[_0x469ebe[_0x0788('0x4')][_0x0788('0x5')]]:_0x469ebe[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x469ebe[_0x0788('0x9')]][_0x0788('0x6')]({'where':_0x21c303,'raw':!![]})[_0x0788('0xa')](function(_0x13cf07){_0x5d747c['associatedResources']=_[_0x0788('0x7')](_0x13cf07,function(_0x4ed024){return _0x4ed024[_0x0788('0xb')];});_0x1920b3(_0x5d747c);})[_0x0788('0x8')](function(_0x3fd1e4){_0x37560d(_0x3fd1e4);});});}function _0xb406fb(_0x2ddd1a,_0x430e34,_0x5e1a29){if(!_0x430e34)return Promise['resolve'](null);return new Promise(function(_0x17d805,_0x461d9d){return _0x446ded['UserProfileResource'][_0x0788('0x6')]({'where':{'sectionId':_0x430e34['id']},'raw':!![]})[_0x0788('0xa')](function(_0x17ae59){if(_0x2ddd1a['field']&&_0x2ddd1a[_0x0788('0x5')]!=='id'){_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x11ea01){return _0x11ea01[_0x2ddd1a['field']];});}else{if(_0x5e1a29===_0x0788('0xd')){_0x430e34['associatedResources']=_[_0x0788('0x7')](_0x17ae59,function(_0x3c37ca){return{'id':_0x3c37ca[_0x0788('0xe')],'type':_0x3c37ca[_0x0788('0xf')]};});}else{_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x48ec43){return _0x48ec43[_0x0788('0xe')];});}}_0x17d805(_0x430e34);})[_0x0788('0x8')](function(_0x645320){_0x461d9d(_0x645320);});});}function _0x7a99a1(_0x5ba1da,_0x4d5c93){var _0x79204e={'parentSections':[]};switch(_0x5ba1da[_0x0788('0x10')]()){case _0x0788('0x11'):_0x79204e['childModel']='SquareProject';break;case _0x0788('0x12'):_0x79204e[_0x0788('0x13')]='SquareOdbc';break;case'squarerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x14');_0x79204e['parentSections']=[{'name':_0x0788('0x15'),'field':_0x0788('0xb'),'foreignKey':_0x0788('0x16')}];break;case _0x0788('0x17'):_0x79204e[_0x0788('0x13')]=_0x0788('0x18');break;case _0x0788('0x19'):_0x79204e[_0x0788('0x13')]='CmContact';_0x79204e['parentSections']=[{'name':_0x0788('0x1a'),'field':'id','foreignKey':_0x0788('0x1b')}];break;case'lists':_0x79204e['childModel']=_0x0788('0x1c');break;case _0x0788('0x1d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x1e');break;case _0x0788('0x1f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x20');break;case _0x0788('0x21'):_0x79204e[_0x0788('0x13')]=_0x0788('0x22');break;case'chatwebsites':_0x79204e[_0x0788('0x13')]=_0x0788('0x23');break;case _0x0788('0x24'):_0x79204e[_0x0788('0x13')]=_0x0788('0x25');break;case _0x0788('0x26'):_0x79204e[_0x0788('0x13')]=_0x0788('0x27');break;case _0x0788('0x28'):case _0x0788('0x29'):case'outboundroutes':_0x79204e['childModel']='VoiceExtension';break;case'contexts':_0x79204e['childModel']='VoiceContext';break;case _0x0788('0x2a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x2b');break;case'voicerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x2c');_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x2e'),'field':'name','foreignKey':_0x0788('0x2f'),'model':'User','filter':{'field':_0x0788('0x30'),'value':['agent']}},{'name':_0x0788('0x31'),'field':_0x0788('0xb'),'foreignKey':'membername','model':_0x0788('0x32'),'filter':{'field':_0x0788('0x30'),'value':['telephone']}},{'name':_0x0788('0x33'),'field':'name','foreignKey':_0x0788('0x34'),'model':'VoiceQueue','filter':{'field':_0x0788('0xf'),'value':['inbound']}},{'name':_0x0788('0x35'),'field':'name','foreignKey':'queue','model':_0x0788('0x36'),'filter':{'field':_0x0788('0xf'),'value':[_0x0788('0x37')]}}];break;case _0x0788('0x38'):_0x79204e[_0x0788('0x13')]='VoiceMusicOnHold';break;case'chanspies':_0x79204e['childModel']='VoiceChanSpy';break;case _0x0788('0x39'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3a');break;case _0x0788('0x3b'):_0x79204e[_0x0788('0x13')]='Campaign';break;case'mailqueues':_0x79204e[_0x0788('0x13')]=_0x0788('0x3c');break;case _0x0788('0x3d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3e');break;case _0x0788('0x3f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x40');break;case _0x0788('0x41'):_0x79204e['childModel']='OpenchannelQueue';break;case _0x0788('0x42'):_0x79204e[_0x0788('0x13')]=_0x0788('0x43');break;case'smsqueues':_0x79204e['childModel']='SmsQueue';break;case _0x0788('0x44'):_0x79204e[_0x0788('0x13')]=_0x0788('0x45');break;case _0x0788('0x46'):_0x79204e[_0x0788('0x13')]=_0x0788('0x47');break;case _0x0788('0x48'):_0x79204e[_0x0788('0x13')]='WhatsappAccount';break;case _0x0788('0x49'):_0x79204e[_0x0788('0x13')]=_0x0788('0x4a');break;case _0x0788('0x4b'):case'queuecampaigns':_0x79204e[_0x0788('0x13')]=_0x0788('0x36');if(_0x4d5c93){_0x79204e['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x0788('0x4c'):case'agents':case _0x0788('0x4d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');if(_0x4d5c93){_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x4e'),'filter':{'field':_0x0788('0x30'),'value':[_0x0788('0x4f'),_0x0788('0x50')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x0788('0x51'):_0x79204e[_0x0788('0x13')]=_0x0788('0x52');break;case'salesforceaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x53');break;case _0x0788('0x54'):_0x79204e[_0x0788('0x13')]=_0x0788('0x55');break;case'sugarcrmaccounts':_0x79204e['childModel']=_0x0788('0x56');break;case _0x0788('0x57'):_0x79204e['childModel']=_0x0788('0x58');break;case'zohoaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x59');break;case _0x0788('0x5a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');break;case _0x0788('0x5b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x5c');break;case'dispositions':_0x79204e[_0x0788('0x13')]=_0x0788('0x5d');break;case _0x0788('0x5e'):_0x79204e['childModel']=_0x0788('0x5f');break;case _0x0788('0x60'):_0x79204e['childModel']=_0x0788('0x61');break;case _0x0788('0x62'):_0x79204e[_0x0788('0x13')]=_0x0788('0x63');break;case _0x0788('0x64'):_0x79204e[_0x0788('0x13')]='Schedule';break;case'sounds':_0x79204e[_0x0788('0x13')]=_0x0788('0x65');break;case'tags':_0x79204e[_0x0788('0x13')]=_0x0788('0x66');break;case _0x0788('0x67'):_0x79204e[_0x0788('0x13')]=_0x0788('0x68');break;case _0x0788('0x69'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6a');break;case _0x0788('0x6b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6c');break;case _0x0788('0x6d'):_0x79204e['childModel']=_0x0788('0x6e');break;case _0x0788('0x6f'):_0x79204e[_0x0788('0x13')]='Plugin';break;case _0x0788('0x70'):_0x79204e[_0x0788('0x13')]='AnalyticExtractedReport';_0x79204e['parentSections']=[{'name':_0x0788('0x71'),'field':'id','foreignKey':_0x0788('0x72')}];break;case _0x0788('0x73'):_0x79204e[_0x0788('0x13')]=_0x0788('0x74');break;}return _0x79204e;}function _0x4c08f9(_0x535648,_0x336d30){var _0x3be076=_0x535648[_0x0788('0x75')](0x0)['toUpperCase']()+_0x535648['slice'](0x1);var _0x3a25d3={'type':_0x446ded['Sequelize'][_0x0788('0x76')][_0x0788('0x77')],'raw':!![]};return new Promise(function(_0x223767,_0x13a021){var _0x101e8b=squel[_0x0788('0x78')]()[_0x0788('0x5')](_0x0788('0x79')+_0x3be076+_0x0788('0x7a'),'id')[_0x0788('0x5')]('ui.createdAt')[_0x0788('0x7b')](_0x0788('0x7c')+_0x535648+_0x0788('0x7d'),'ui')[_0x0788('0x7e')]('ui.UserId\x20=\x20?',_0x336d30['id']);return _0x446ded[_0x0788('0x7f')][_0x0788('0x80')](_0x101e8b[_0x0788('0x81')](),_0x3a25d3)[_0x0788('0xa')](function(_0x5a353f){_0x336d30[_0x3be076+'OpenTabs']=_0x5a353f;_0x223767(_0x5a353f);})[_0x0788('0x8')](function(_0x4aa3af){_0x13a021(_0x4aa3af);});});}return _0x47dc20[_0x0788('0x82')](_0x0788('0x83'),attributes,{'tableName':_0x0788('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x47f22c){var _0x3baf23={'raw':![],'where':{}};var _0x348cbf={};var _0xdc7103={'count':0x0,'rows':[]};var _0x150403=_0x47f22c[_0x0788('0x80')]['section'];var _0x25201f=_0x47f22c[_0x0788('0x80')][_0x0788('0x85')]||![];var _0x59a436=_0x7a99a1(_0x150403,_0x25201f);if(!_0x59a436['childModel'])throw new Error(_0x0788('0x86')+_0x150403+'\x27');var _0x1bb234=[{'name':_0x150403}];if(!_[_0x0788('0x87')](_0x59a436['parentSections']))_0x1bb234=_0x59a436[_0x0788('0x2d')];var _0x23f7d1=[];for(var _0x1eb4c9=0x0;_0x1eb4c9<_0x1bb234[_0x0788('0x88')];_0x1eb4c9++){_0x23f7d1['push'](_0x446ded['UserProfileSection']['find']({'where':{'userProfileId':_0x47f22c[_0x0788('0x89')]['id'],'name':_0x1bb234[_0x1eb4c9][_0x0788('0xb')]},'raw':!![]}));}return Promise[_0x0788('0x8a')](_0x23f7d1)['then'](function(_0x59b296){var _0xaa2d4d=_['filter'](_0x59b296,function(_0x955bfa){return _0x955bfa?_0x955bfa:undefined;});var _0x3d1181=_[_0x0788('0x4')](_0x1bb234,[_0x0788('0x8b'),!![]]);var _0x1834fb=_[_0x0788('0x87')](_0xaa2d4d)&&_[_0x0788('0x87')](_0x3d1181)?null:_[_0x0788('0x8c')](_0x3d1181,_0xaa2d4d);if(!_0x1834fb)return null;var _0x433c05=[];for(var _0x137a7a=0x0;_0x137a7a<_0x1834fb['length'];_0x137a7a++){var _0x240210=_[_0x0788('0x8d')](_0x1bb234,function(_0x52926f){return _0x1834fb[_0x137a7a]?_0x52926f['name']===_0x1834fb[_0x137a7a][_0x0788('0xb')]:null;});if(_0x240210){if(_0x1834fb[_0x137a7a][_0x0788('0x8b')]){_0x433c05[_0x0788('0x8e')](_0x3925a6(_0x59a436[_0x0788('0x13')],_0x1834fb[_0x137a7a]));}else{if(!_0x1834fb[_0x137a7a][_0x0788('0x8f')]){_0x433c05[_0x0788('0x8e')](_0xb406fb(_0x240210,_0x1834fb[_0x137a7a],_0x59a436['childModel']));}else{if(_0x240210[_0x0788('0x9')]){_0x433c05[_0x0788('0x8e')](_0xee8670(_0x240210,_0x1834fb[_0x137a7a]));}}}}}return Promise[_0x0788('0x8a')](_0x433c05);})[_0x0788('0xa')](function(_0x4e0282){var _0x35c612=_0x4e0282;var _0x2272e2=null;if(_0x35c612){_0x2272e2=_0x35c612[_0x0788('0x88')]===0x1?_0x35c612[0x0]:null;}if(!_0x2272e2&&!_0x35c612)return _0xdc7103;var _0x360476=_0x446ded[_0x59a436['childModel']]['rawAttributes'];_0x348cbf[_0x0788('0x9')]=_[_0x0788('0x90')](_0x360476);_0x348cbf[_0x0788('0x80')]=_[_0x0788('0x90')](_0x47f22c[_0x0788('0x80')]);_0x348cbf[_0x0788('0x91')]=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],_0x348cbf[_0x0788('0x80')]);_0x3baf23['attributes']=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],qs[_0x0788('0x93')](_0x47f22c['query']['fields']));_0x3baf23[_0x0788('0x94')]=_0x3baf23['attributes'][_0x0788('0x88')]?_0x3baf23[_0x0788('0x94')]:_0x348cbf[_0x0788('0x9')];if(!_0x47f22c[_0x0788('0x80')][_0x0788('0x95')](_0x0788('0x96'))){_0x3baf23[_0x0788('0x97')]=qs[_0x0788('0x97')](_0x47f22c[_0x0788('0x80')]['limit']);_0x3baf23[_0x0788('0x98')]=qs[_0x0788('0x98')](_0x47f22c[_0x0788('0x80')]['offset']);}_0x3baf23[_0x0788('0x99')]=qs[_0x0788('0x9a')](_0x47f22c[_0x0788('0x80')]['sort']);_0x3baf23[_0x0788('0x7e')]=qs[_0x0788('0x91')](_[_0x0788('0x9b')](_0x47f22c[_0x0788('0x80')],_0x348cbf[_0x0788('0x91')]));if(_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]){_0x3baf23[_0x0788('0x7e')]=_[_0x0788('0x9c')](_0x3baf23['where'],{'$or':_[_0x0788('0x7')](_0x360476,function(_0x623d29){if(_0x623d29[_0x0788('0xf')][_0x0788('0x9d')]!==_0x0788('0x9e')){var _0x5749fc={};_0x5749fc[_0x623d29[_0x0788('0x5')]]={'$like':'%'+_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]+'%'};return _0x5749fc;}})});}var _0x4fb7f7=[];var _0x1788d1=null;var _0x17430c={};if(_0x2272e2){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,[_0x0788('0xb'),_0x2272e2[_0x0788('0xb')]]);if(_0x1788d1['field']){_0x17430c={};if(_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){_0x17430c[_0x1788d1['foreignKey']]=_[_0x0788('0x7')](_0x2272e2[_0x0788('0xc')],'id');}else{_0x17430c[_0x1788d1['foreignKey']]=_0x2272e2[_0x0788('0xc')];}_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{_0x3baf23[_0x0788('0x7e')]['id']=_0x2272e2['associatedResources'];}}else{for(var _0x28ad96=0x0;_0x28ad96<_0x35c612[_0x0788('0x88')];_0x28ad96++){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,['name',_0x35c612[_0x28ad96][_0x0788('0xb')]]);if(_0x1788d1[_0x0788('0x5')]){_0x17430c={};_0x17430c[_0x1788d1[_0x0788('0x9f')]]=_0x35c612[_0x28ad96][_0x0788('0xc')];_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{if(!_0x3baf23[_0x0788('0x7e')]['id'])_0x3baf23[_0x0788('0x7e')]['id']=[];_0x35c612[_0x28ad96][_0x0788('0xc')]['forEach'](function(_0x36ebc1){_0x3baf23[_0x0788('0x7e')]['id'][_0x0788('0x8e')](_0x36ebc1);});}}}if(!_[_0x0788('0x87')](_0x4fb7f7)){_0x3baf23['where']=_['merge'](_0x3baf23[_0x0788('0x7e')],{'$and':{'$or':_0x4fb7f7}});}_0x3baf23=_[_0x0788('0x9c')]({},_0x3baf23,_0x47f22c['options']);if(_0x2272e2&&!_0x2272e2[_0x0788('0x8f')]&&_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){if(_0x47f22c['query']['includeAll']){_0x3baf23[_0x0788('0xa0')]=[{'all':!![]}];}return _0x446ded[_0x59a436[_0x0788('0x13')]]['findAll'](_0x3baf23)['then'](function(_0x4ace43){var _0x17ea6a=[];_0x4ace43[_0x0788('0xa1')](function(_0x59260c){var _0x1827e4;switch(_0x59260c[_0x0788('0xa2')]){case _0x0788('0xa3'):_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0x4864f5){return _0x4864f5['id']===_0x59260c[_0x0788('0x72')]&&_0x4864f5['type']===_0x0788('0xa4');});break;case'custom':_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0xbf1276){return _0xbf1276['id']===_0x59260c[_0x0788('0x72')]&&_0xbf1276[_0x0788('0xf')]===_0x0788('0xa5');});break;}if(_0x1827e4)_0x17ea6a[_0x0788('0x8e')](_0x59260c);});_0xdc7103[_0x0788('0xa6')]=_0x17ea6a[_0x0788('0x88')];_0xdc7103[_0x0788('0xa7')]=_0x17ea6a;return _0xdc7103;});}else{return _0x446ded[_0x59a436[_0x0788('0x13')]][_0x0788('0xa6')]({'where':_0x3baf23[_0x0788('0x7e')]})['then'](function(_0x55fe55){_0xdc7103['count']=_0x55fe55;if(_0x47f22c[_0x0788('0x80')][_0x0788('0xa8')]){if(_0x59a436[_0x0788('0x13')]===_0x0788('0xa9')){_0x3baf23[_0x0788('0xa0')]=[{'model':_0x446ded[_0x0788('0x66')],'as':_0x0788('0xaa'),'attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]},{'model':_0x446ded['Tag'],'as':'ThroughTags','attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'through':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?{'attributes':[],'where':{'TagId':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]||undefined}}:{},'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]}];}else{_0x3baf23['include']=[{'all':!![]}];}}return _0x446ded[_0x59a436['childModel']][_0x0788('0x6')](_0x3baf23);})[_0x0788('0xa')](function(_0x285972){_0xdc7103[_0x0788('0xa7')]=_0x285972;if(_0x150403===_0x0788('0x2e')&&_0x47f22c[_0x0788('0x80')]['openTabs']===_0x0788('0xad')){var _0x1311d7=[];for(var _0x3ca412=0x0;_0x3ca412<_0xdc7103[_0x0788('0xa7')][_0x0788('0x88')];_0x3ca412++){_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xae'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7['push'](_0x4c08f9(_0x0788('0xb0'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb1'),_0xdc7103[_0x0788('0xa7')][_0x3ca412]['dataValues']));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb2'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb3'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb4'),_0xdc7103['rows'][_0x3ca412][_0x0788('0xaf')]));}return Promise['all'](_0x1311d7)[_0x0788('0xa')](function(){return _0xdc7103;});}return _0xdc7103;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6780a2e..0fda673 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 _0x4cc7=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x1ebe2e,_0x18b57a){_0x1ebe2e=_0x1ebe2e-0x0;var _0x4c883b=_0x4cc7[_0x1ebe2e];return _0x4c883b;};'use strict';var _=require(_0x74cc('0x0'));var util=require(_0x74cc('0x1'));var moment=require(_0x74cc('0x2'));var BPromise=require(_0x74cc('0x3'));var rs=require(_0x74cc('0x4'));var fs=require('fs');var Redis=require(_0x74cc('0x5'));var db=require(_0x74cc('0x6'))['db'];var utils=require(_0x74cc('0x7'));var logger=require('../../config/logger')(_0x74cc('0x8'));var config=require(_0x74cc('0x9'));var jayson=require(_0x74cc('0xa'));var client=jayson[_0x74cc('0xb')][_0x74cc('0xc')]({'port':0x232a});config[_0x74cc('0xd')]=_[_0x74cc('0xe')](config[_0x74cc('0xd')],{'host':_0x74cc('0xf'),'port':0x18eb});var socket=require(_0x74cc('0x10'))(new Redis(config[_0x74cc('0xd')]));require(_0x74cc('0x11'))[_0x74cc('0x12')](socket);function respondWithRpcPromise(_0x493be4,_0x2b10f5,_0x19d928){return new BPromise(function(_0x21e3a5,_0x20fb78){return client[_0x74cc('0x13')](_0x493be4,_0x19d928)[_0x74cc('0x14')](function(_0x2d2d17){logger[_0x74cc('0x15')](_0x74cc('0x16'),_0x2b10f5,_0x74cc('0x17'));logger[_0x74cc('0x18')](_0x74cc('0x19'),_0x2b10f5,'request\x20sent',JSON[_0x74cc('0x1a')](_0x2d2d17));if(_0x2d2d17[_0x74cc('0x1b')]){if(_0x2d2d17[_0x74cc('0x1b')]['code']===0x1f4){logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x2d2d17[_0x74cc('0x1b')][_0x74cc('0x1c')]);return _0x20fb78(_0x2d2d17[_0x74cc('0x1b')][_0x74cc('0x1c')]);}logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x2d2d17[_0x74cc('0x1b')]['message']);return _0x21e3a5(_0x2d2d17['error'][_0x74cc('0x1c')]);}else{logger[_0x74cc('0x15')](_0x74cc('0x16'),_0x2b10f5,_0x74cc('0x17'));_0x21e3a5(_0x2d2d17[_0x74cc('0x1d')]['message']);}})[_0x74cc('0x1e')](function(_0x1bd301){logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x1bd301);_0x20fb78(_0x1bd301);});});} \ No newline at end of file +var _0x36c3=['defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x329aff,_0x4dfb12){var _0x41e7bc=function(_0x363447){while(--_0x363447){_0x329aff['push'](_0x329aff['shift']());}};_0x41e7bc(++_0x4dfb12);}(_0x36c3,0x1a6));var _0x336c=function(_0x946779,_0x31cd75){_0x946779=_0x946779-0x0;var _0x40292f=_0x36c3[_0x946779];return _0x40292f;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var moment=require('moment');var BPromise=require(_0x336c('0x2'));var rs=require(_0x336c('0x3'));var fs=require('fs');var Redis=require(_0x336c('0x4'));var db=require(_0x336c('0x5'))['db'];var utils=require(_0x336c('0x6'));var logger=require(_0x336c('0x7'))(_0x336c('0x8'));var config=require('../../config/environment');var jayson=require(_0x336c('0x9'));var client=jayson[_0x336c('0xa')][_0x336c('0xb')]({'port':0x232a});config[_0x336c('0xc')]=_[_0x336c('0xd')](config['redis'],{'host':_0x336c('0xe'),'port':0x18eb});var socket=require(_0x336c('0xf'))(new Redis(config[_0x336c('0xc')]));require(_0x336c('0x10'))[_0x336c('0x11')](socket);function respondWithRpcPromise(_0x243984,_0x33ced0,_0x1a4503){return new BPromise(function(_0x179247,_0x31cee7){return client[_0x336c('0x12')](_0x243984,_0x1a4503)[_0x336c('0x13')](function(_0x1d896b){logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,_0x336c('0x16'));logger[_0x336c('0x17')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x33ced0,'request\x20sent',JSON[_0x336c('0x18')](_0x1d896b));if(_0x1d896b['error']){if(_0x1d896b[_0x336c('0x19')][_0x336c('0x1a')]===0x1f4){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d896b['error'][_0x336c('0x1b')]);return _0x31cee7(_0x1d896b[_0x336c('0x19')]['message']);}logger[_0x336c('0x19')]('UserProfile,\x20%s,\x20%s',_0x33ced0,_0x1d896b[_0x336c('0x19')]['message']);return _0x179247(_0x1d896b[_0x336c('0x19')]['message']);}else{logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,'request\x20sent');_0x179247(_0x1d896b['result'][_0x336c('0x1b')]);}})[_0x336c('0x1c')](function(_0x1d306c){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d306c);_0x31cee7(_0x1d306c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a1a4f4f..2aa9af1 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 _0xeccc=['userProfile:','save','remove','update','emit','removeListener','length'];(function(_0x5d6270,_0x83b57a){var _0x168f26=function(_0x258a27){while(--_0x258a27){_0x5d6270['push'](_0x5d6270['shift']());}};_0x168f26(++_0x83b57a);}(_0xeccc,0xbe));var _0xcecc=function(_0x4dd71c,_0x23a24e){_0x4dd71c=_0x4dd71c-0x0;var _0x8e4e36=_0xeccc[_0x4dd71c];return _0x8e4e36;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xcecc('0x0'),_0xcecc('0x1'),_0xcecc('0x2')];function createListener(_0x43536f,_0x2d896a){return function(_0x3cb5a1){_0x2d896a[_0xcecc('0x3')](_0x43536f,_0x3cb5a1);};}function removeListener(_0x49e2eb,_0x454e59){return function(){UserProfileEvents[_0xcecc('0x4')](_0x49e2eb,_0x454e59);};}exports['register']=function(_0x38e679){for(var _0x34d05e=0x0,_0x1c6c91=events[_0xcecc('0x5')];_0x34d05e<_0x1c6c91;_0x34d05e++){var _0x13cc31=events[_0x34d05e];var _0x1bc701=createListener(_0xcecc('0x6')+_0x13cc31,_0x38e679);UserProfileEvents['on'](_0x13cc31,_0x1bc701);}}; \ No newline at end of file +var _0xdeb5=['save','remove','update','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x163457,_0x1f58d5){var _0x26b498=function(_0x4150d0){while(--_0x4150d0){_0x163457['push'](_0x163457['shift']());}};_0x26b498(++_0x1f58d5);}(_0xdeb5,0x9f));var _0x5deb=function(_0x4a360f,_0x25c5ff){_0x4a360f=_0x4a360f-0x0;var _0x25b34e=_0xdeb5[_0x4a360f];return _0x25b34e;};'use strict';var UserProfileEvents=require(_0x5deb('0x0'));var events=[_0x5deb('0x1'),_0x5deb('0x2'),_0x5deb('0x3')];function createListener(_0x42b02f,_0x2bcbc2){return function(_0x2eae7c){_0x2bcbc2['emit'](_0x42b02f,_0x2eae7c);};}function removeListener(_0xb5c4d8,_0x4553d1){return function(){UserProfileEvents[_0x5deb('0x4')](_0xb5c4d8,_0x4553d1);};}exports[_0x5deb('0x5')]=function(_0x5708c4){for(var _0x2f5014=0x0,_0x1d66b5=events[_0x5deb('0x6')];_0x2f5014<_0x1d66b5;_0x2f5014++){var _0x722d85=events[_0x2f5014];var _0x5c6cda=createListener(_0x5deb('0x7')+_0x722d85,_0x5708c4);UserProfileEvents['on'](_0x722d85,_0x5c6cda);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a125a7f..a82302c 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 _0x02d5=['./userProfileResource.controller','index','get','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x12614c,_0x1799fa){var _0x5d0e2d=function(_0x3de707){while(--_0x3de707){_0x12614c['push'](_0x12614c['shift']());}};_0x5d0e2d(++_0x1799fa);}(_0x02d5,0xb0));var _0x502d=function(_0x4af3b7,_0x30c116){_0x4af3b7=_0x4af3b7-0x0;var _0x24727c=_0x02d5[_0x4af3b7];return _0x24727c;};'use strict';var multer=require(_0x502d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x502d('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x502d('0x2'));var config=require(_0x502d('0x3'));var controller=require(_0x502d('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x502d('0x5')]);router[_0x502d('0x6')]('/describe',auth[_0x502d('0x7')](),controller[_0x502d('0x8')]);router[_0x502d('0x6')](_0x502d('0x9'),auth[_0x502d('0x7')](),controller[_0x502d('0xa')]);router[_0x502d('0xb')]('/',auth[_0x502d('0x7')](),controller['create']);router[_0x502d('0xc')](_0x502d('0x9'),auth[_0x502d('0x7')](),controller[_0x502d('0xd')]);router[_0x502d('0xe')](_0x502d('0x9'),auth[_0x502d('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf5ed=['destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','index','isAuthenticated','describe','get','/:id','show','create','put','update'];(function(_0x38adfc,_0x286f9){var _0x1b3c64=function(_0x5d8eca){while(--_0x5d8eca){_0x38adfc['push'](_0x38adfc['shift']());}};_0x1b3c64(++_0x286f9);}(_0xf5ed,0x110));var _0xdf5e=function(_0x3e9584,_0x358170){_0x3e9584=_0x3e9584-0x0;var _0xe11de9=_0xf5ed[_0x3e9584];return _0xe11de9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf5e('0x0'));var timeout=require(_0xdf5e('0x1'));var express=require('express');var router=express[_0xdf5e('0x2')]();var fs_extra=require(_0xdf5e('0x3'));var auth=require(_0xdf5e('0x4'));var interaction=require(_0xdf5e('0x5'));var config=require('../../config/environment');var controller=require(_0xdf5e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf5e('0x7')]);router['get']('/describe',auth[_0xdf5e('0x8')](),controller[_0xdf5e('0x9')]);router[_0xdf5e('0xa')](_0xdf5e('0xb'),auth[_0xdf5e('0x8')](),controller[_0xdf5e('0xc')]);router['post']('/',auth[_0xdf5e('0x8')](),controller[_0xdf5e('0xd')]);router[_0xdf5e('0xe')]('/:id',auth[_0xdf5e('0x8')](),controller[_0xdf5e('0xf')]);router['delete'](_0xdf5e('0xb'),auth['isAuthenticated'](),controller[_0xdf5e('0x10')]);module[_0xdf5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 36020c5..73d2239 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 _0xb030=['STRING','sequelize'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0xb030,0x81));var _0x0b03=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0xb030[_0x3a0863];return _0x85c557;};'use strict';var Sequelize=require(_0x0b03('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b03('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x0b03('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa0a3=['STRING','sequelize','INTEGER'];(function(_0x39b165,_0x57dc3b){var _0x2b9f5d=function(_0x24e3e1){while(--_0x24e3e1){_0x39b165['push'](_0x39b165['shift']());}};_0x2b9f5d(++_0x57dc3b);}(_0xa0a3,0x199));var _0x3a0a=function(_0x239c65,_0x43c807){_0x239c65=_0x239c65-0x0;var _0x5d9676=_0xa0a3[_0x239c65];return _0x5d9676;};'use strict';var Sequelize=require(_0x3a0a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3a0a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3a0a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3fa51a2..4b39a3c 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 _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9536,0x179));var _0x6953=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x9536[_0x454165];return _0x56db53;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file +var _0x66fa=['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','UserProfileResource','findAll','rows','catch','merge','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x66fa,0x117));var _0xa66f=function(_0x152396,_0x17fc0f){_0x152396=_0x152396-0x0;var _0x18cc7b=_0x66fa[_0x152396];return _0x18cc7b;};'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['UserProfileResource'][_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['UserProfileResource'][_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['UserProfileResource'][_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['UserProfileResource'][_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));};exports[_0xa66f('0x4a')]=function(_0x5d77d1,_0x389b9a){return db['UserProfileResource'][_0xa66f('0x4a')]()['then'](respondWithResult(_0x389b9a,null))['catch'](handleError(_0x389b9a,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4df54c1..b157189 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 _0xed8a=['util','moment','bluebird','path','rimraf','exports','UserProfileResource','user_profile_has_resources','resourceId','sectionId'];(function(_0x14c62b,_0x2d2fde){var _0x1b8642=function(_0xb2ae78){while(--_0xb2ae78){_0x14c62b['push'](_0x14c62b['shift']());}};_0x1b8642(++_0x2d2fde);}(_0xed8a,0x140));var _0xaed8=function(_0x2affd1,_0x40dea2){_0x2affd1=_0x2affd1-0x0;var _0xb3311=_0xed8a[_0x2affd1];return _0xb3311;};'use strict';var _=require('lodash');var util=require(_0xaed8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xaed8('0x1'));var BPromise=require(_0xaed8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaed8('0x3'));var rimraf=require(_0xaed8('0x4'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xaed8('0x5')]=function(_0x34d8c1,_0x6c4e4c){return _0x34d8c1['define'](_0xaed8('0x6'),attributes,{'tableName':_0xaed8('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xaed8('0x8'),_0xaed8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d2d=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources'];(function(_0x1dad38,_0x3acb19){var _0xaad7e4=function(_0x1f512d){while(--_0x1f512d){_0x1dad38['push'](_0x1dad38['shift']());}};_0xaad7e4(++_0x3acb19);}(_0x8d2d,0x153));var _0xd8d2=function(_0x592b5f,_0x58337b){_0x592b5f=_0x592b5f-0x0;var _0x374a2a=_0x8d2d[_0x592b5f];return _0x374a2a;};'use strict';var _=require(_0xd8d2('0x0'));var util=require(_0xd8d2('0x1'));var logger=require(_0xd8d2('0x2'))('api');var moment=require(_0xd8d2('0x3'));var BPromise=require(_0xd8d2('0x4'));var rp=require(_0xd8d2('0x5'));var fs=require('fs');var path=require(_0xd8d2('0x6'));var rimraf=require(_0xd8d2('0x7'));var config=require(_0xd8d2('0x8'));var attributes=require(_0xd8d2('0x9'));module[_0xd8d2('0xa')]=function(_0x4b2119,_0x34993a){return _0x4b2119[_0xd8d2('0xb')]('UserProfileResource',attributes,{'tableName':_0xd8d2('0xc'),'paranoid':![],'indexes':[{'name':_0xd8d2('0xd'),'fields':[_0xd8d2('0xe'),_0xd8d2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6800975..d432299 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 _0x95f9=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x95f9,0xc4));var _0x995f=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x95f9[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x995f('0x0'));var util=require('util');var moment=require(_0x995f('0x1'));var BPromise=require(_0x995f('0x2'));var rs=require(_0x995f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x995f('0x4'));var logger=require(_0x995f('0x5'))('rpc');var config=require(_0x995f('0x6'));var jayson=require(_0x995f('0x7'));var client=jayson['client'][_0x995f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50e165,_0x171463,_0x241d28){return new BPromise(function(_0x4b2816,_0x650da){return client['request'](_0x50e165,_0x241d28)['then'](function(_0x1c2bb9){logger[_0x995f('0x9')](_0x995f('0xa'),_0x171463,_0x995f('0xb'));logger[_0x995f('0xc')](_0x995f('0xd'),_0x171463,_0x995f('0xb'),JSON[_0x995f('0xe')](_0x1c2bb9));if(_0x1c2bb9['error']){if(_0x1c2bb9[_0x995f('0xf')][_0x995f('0x10')]===0x1f4){logger['error'](_0x995f('0xa'),_0x171463,_0x1c2bb9[_0x995f('0xf')][_0x995f('0x11')]);return _0x650da(_0x1c2bb9[_0x995f('0xf')]['message']);}logger['error'](_0x995f('0xa'),_0x171463,_0x1c2bb9[_0x995f('0xf')]['message']);return _0x4b2816(_0x1c2bb9[_0x995f('0xf')]['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x171463,'request\x20sent');_0x4b2816(_0x1c2bb9['result'][_0x995f('0x11')]);}})['catch'](function(_0x51226c){logger[_0x995f('0xf')](_0x995f('0xa'),_0x171463,_0x51226c);_0x650da(_0x51226c);});});} \ No newline at end of file +var _0x0b6f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x3146da,_0x277a70){var _0x1070de=function(_0x43a1b1){while(--_0x43a1b1){_0x3146da['push'](_0x3146da['shift']());}};_0x1070de(++_0x277a70);}(_0x0b6f,0x134));var _0xf0b6=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0x0b6f[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0xf0b6('0x0'));var util=require(_0xf0b6('0x1'));var moment=require(_0xf0b6('0x2'));var BPromise=require(_0xf0b6('0x3'));var rs=require(_0xf0b6('0x4'));var fs=require('fs');var Redis=require(_0xf0b6('0x5'));var db=require(_0xf0b6('0x6'))['db'];var utils=require(_0xf0b6('0x7'));var logger=require(_0xf0b6('0x8'))(_0xf0b6('0x9'));var config=require(_0xf0b6('0xa'));var jayson=require(_0xf0b6('0xb'));var client=jayson[_0xf0b6('0xc')][_0xf0b6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53657b,_0x1fd6f0,_0x303333){return new BPromise(function(_0x107647,_0x3b9b22){return client[_0xf0b6('0xe')](_0x53657b,_0x303333)[_0xf0b6('0xf')](function(_0x5f1976){logger['info'](_0xf0b6('0x10'),_0x1fd6f0,_0xf0b6('0x11'));logger[_0xf0b6('0x12')](_0xf0b6('0x13'),_0x1fd6f0,_0xf0b6('0x11'),JSON[_0xf0b6('0x14')](_0x5f1976));if(_0x5f1976[_0xf0b6('0x15')]){if(_0x5f1976[_0xf0b6('0x15')]['code']===0x1f4){logger[_0xf0b6('0x15')](_0xf0b6('0x10'),_0x1fd6f0,_0x5f1976[_0xf0b6('0x15')]['message']);return _0x3b9b22(_0x5f1976[_0xf0b6('0x15')][_0xf0b6('0x16')]);}logger[_0xf0b6('0x15')](_0xf0b6('0x10'),_0x1fd6f0,_0x5f1976[_0xf0b6('0x15')]['message']);return _0x107647(_0x5f1976[_0xf0b6('0x15')][_0xf0b6('0x16')]);}else{logger[_0xf0b6('0x17')](_0xf0b6('0x10'),_0x1fd6f0,_0xf0b6('0x11'));_0x107647(_0x5f1976[_0xf0b6('0x18')][_0xf0b6('0x16')]);}})[_0xf0b6('0x19')](function(_0x52e136){logger[_0xf0b6('0x15')](_0xf0b6('0x10'),_0x1fd6f0,_0x52e136);_0x3b9b22(_0x52e136);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8e9614c..9d78e09 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 _0x5c5e=['index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x469253,_0x51d61a){var _0x1c0796=function(_0x568edb){while(--_0x568edb){_0x469253['push'](_0x469253['shift']());}};_0x1c0796(++_0x51d61a);}(_0x5c5e,0xd2));var _0xe5c5=function(_0x116475,_0x635836){_0x116475=_0x116475-0x0;var _0x4fa3f3=_0x5c5e[_0x116475];return _0x4fa3f3;};'use strict';var multer=require(_0xe5c5('0x0'));var util=require(_0xe5c5('0x1'));var path=require(_0xe5c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5c5('0x3'));var router=express[_0xe5c5('0x4')]();var fs_extra=require(_0xe5c5('0x5'));var auth=require(_0xe5c5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5c5('0x7'));var controller=require(_0xe5c5('0x8'));router[_0xe5c5('0x9')]('/',auth['isAuthenticated'](),controller[_0xe5c5('0xa')]);router[_0xe5c5('0x9')](_0xe5c5('0xb'),auth[_0xe5c5('0xc')](),controller[_0xe5c5('0xd')]);router[_0xe5c5('0x9')](_0xe5c5('0xe'),auth[_0xe5c5('0xc')](),controller[_0xe5c5('0xf')]);router['post']('/',auth[_0xe5c5('0xc')](),controller[_0xe5c5('0x10')]);router[_0xe5c5('0x11')](_0xe5c5('0xe'),auth[_0xe5c5('0xc')](),controller[_0xe5c5('0x12')]);router[_0xe5c5('0x13')]('/:id',auth[_0xe5c5('0xc')](),controller[_0xe5c5('0x14')]);module[_0xe5c5('0x15')]=router; \ No newline at end of file +var _0x7712=['exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7712,0x6d));var _0x2771=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7712[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x2771('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2771('0x1'));var express=require('express');var router=express[_0x2771('0x2')]();var fs_extra=require(_0x2771('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2771('0x4'));var config=require(_0x2771('0x5'));var controller=require('./userProfileSection.controller');router[_0x2771('0x6')]('/',auth[_0x2771('0x7')](),controller['index']);router[_0x2771('0x6')](_0x2771('0x8'),auth[_0x2771('0x7')](),controller[_0x2771('0x9')]);router[_0x2771('0x6')](_0x2771('0xa'),auth[_0x2771('0x7')](),controller[_0x2771('0xb')]);router[_0x2771('0xc')]('/',auth[_0x2771('0x7')](),controller[_0x2771('0xd')]);router[_0x2771('0xe')](_0x2771('0xa'),auth[_0x2771('0x7')](),controller[_0x2771('0xf')]);router['delete']('/:id',auth[_0x2771('0x7')](),controller[_0x2771('0x10')]);module[_0x2771('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index c885777..6faab0d 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 _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0972,0x64));var _0x2097=function(_0xd48ed9,_0x4aa193){_0xd48ed9=_0xd48ed9-0x0;var _0x6cf52a=_0x0972[_0xd48ed9];return _0x6cf52a;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}}; \ No newline at end of file +var _0x1399=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x6a196c,_0x29e235){var _0x200181=function(_0x38d8b8){while(--_0x38d8b8){_0x6a196c['push'](_0x6a196c['shift']());}};_0x200181(++_0x29e235);}(_0x1399,0x16c));var _0x9139=function(_0x16f4cd,_0x125cb3){_0x16f4cd=_0x16f4cd-0x0;var _0x3bb8fa=_0x1399[_0x16f4cd];return _0x3bb8fa;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9139('0x2')],'set':function(_0x28f155){this[_0x9139('0x4')](_0x9139('0x5'),_0x28f155?_0x28f155['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9139('0x5'))?this[_0x9139('0x6')](_0x9139('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6a7c5d3..294544b 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 _0x2a4b=['nolimit','limit','order','sort','where','merge','VIRTUAL','includeAll','include','rows','catch','params','rawAttributes','intersection','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','json','apply','reject','update','then','end','error','stack','name','send','index','map','UserProfileSection','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x2a4b,0x167));var _0xb2a4=function(_0x3e944a,_0x338e8c){_0x3e944a=_0x3e944a-0x0;var _0x370e21=_0x2a4b[_0x3e944a];return _0x370e21;};'use strict';var emlformat=require(_0xb2a4('0x0'));var rimraf=require(_0xb2a4('0x1'));var zipdir=require(_0xb2a4('0x2'));var jsonpatch=require(_0xb2a4('0x3'));var rp=require(_0xb2a4('0x4'));var moment=require('moment');var BPromise=require(_0xb2a4('0x5'));var Mustache=require(_0xb2a4('0x6'));var util=require(_0xb2a4('0x7'));var path=require(_0xb2a4('0x8'));var sox=require('sox');var csv=require(_0xb2a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2a4('0xa'));var _=require(_0xb2a4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb2a4('0xc'));var deskjs=require(_0xb2a4('0xd'));var toCsv=require(_0xb2a4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb2a4('0xe'));var authService=require(_0xb2a4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb2a4('0x10'));var hardwareService=require(_0xb2a4('0x11'));var logger=require(_0xb2a4('0x12'))(_0xb2a4('0x13'));var utils=require(_0xb2a4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb2a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e071f,_0x5a3ad8){_0x5a3ad8=_0x5a3ad8||0xcc;return function(_0x254090){if(_0x254090){return _0x5e071f[_0xb2a4('0x16')](_0x5a3ad8);}return _0x5e071f[_0xb2a4('0x17')](_0x5a3ad8)['end']();};}function respondWithResult(_0x4b5ddc,_0x4c11aa){_0x4c11aa=_0x4c11aa||0xc8;return function(_0x315d71){if(_0x315d71){return _0x4b5ddc['status'](_0x4c11aa)['json'](_0x315d71);}};}function respondWithFilteredResult(_0x279255,_0x14ea73){return function(_0x2a9701){if(_0x2a9701){var _0x680637=typeof _0x14ea73[_0xb2a4('0x18')]===_0xb2a4('0x19')&&typeof _0x14ea73['limit']===_0xb2a4('0x19');var _0x2044a8=_0x2a9701['count'];var _0x3de9f6=_0x680637?0x0:_0x14ea73[_0xb2a4('0x18')];var _0x334e0e=_0x680637?_0x2a9701[_0xb2a4('0x1a')]:_0x14ea73[_0xb2a4('0x18')]+_0x14ea73['limit'];var _0x1225cc;if(_0x334e0e>=_0x2044a8){_0x334e0e=_0x2044a8;_0x1225cc=0xc8;}else{_0x1225cc=0xce;}_0x279255[_0xb2a4('0x17')](_0x1225cc);return _0x279255['set']('Content-Range',_0x3de9f6+'-'+_0x334e0e+'/'+_0x2044a8)[_0xb2a4('0x1b')](_0x2a9701);}return null;};}function patchUpdates(_0x3c6344){return function(_0x441854){try{jsonpatch[_0xb2a4('0x1c')](_0x441854,_0x3c6344,!![]);}catch(_0x48ba44){return BPromise[_0xb2a4('0x1d')](_0x48ba44);}return _0x441854['save']();};}function saveUpdates(_0x25e5cb,_0x4720b3){return function(_0x342525){if(_0x342525){return _0x342525[_0xb2a4('0x1e')](_0x25e5cb)[_0xb2a4('0x1f')](function(_0x1f8f52){return _0x1f8f52;});}return null;};}function removeEntity(_0x20ecf,_0x36e674){return function(_0x579a32){if(_0x579a32){return _0x579a32['destroy']()[_0xb2a4('0x1f')](function(){_0x20ecf[_0xb2a4('0x17')](0xcc)[_0xb2a4('0x20')]();});}};}function handleEntityNotFound(_0x4628d6,_0x181d1f){return function(_0x276020){if(!_0x276020){_0x4628d6['sendStatus'](0x194);}return _0x276020;};}function handleError(_0x195dd9,_0x1b0262){_0x1b0262=_0x1b0262||0x1f4;return function(_0x1c879e){logger[_0xb2a4('0x21')](_0x1c879e[_0xb2a4('0x22')]);if(_0x1c879e[_0xb2a4('0x23')]){delete _0x1c879e[_0xb2a4('0x23')];}_0x195dd9[_0xb2a4('0x17')](_0x1b0262)[_0xb2a4('0x24')](_0x1c879e);};}exports[_0xb2a4('0x25')]=function(_0x5793ee,_0x42d3cf){var _0x4b69a1={},_0x5ad7c4={},_0x1bdd79={'count':0x0,'rows':[]};var _0x5070b=_[_0xb2a4('0x26')](db[_0xb2a4('0x27')]['rawAttributes'],function(_0x53f898){return{'name':_0x53f898['fieldName'],'type':_0x53f898[_0xb2a4('0x28')][_0xb2a4('0x29')]};});_0x5ad7c4['model']=_[_0xb2a4('0x26')](_0x5070b,_0xb2a4('0x23'));_0x5ad7c4[_0xb2a4('0x2a')]=_[_0xb2a4('0x2b')](_0x5793ee[_0xb2a4('0x2a')]);_0x5ad7c4[_0xb2a4('0x2c')]=_['intersection'](_0x5ad7c4[_0xb2a4('0x2d')],_0x5ad7c4[_0xb2a4('0x2a')]);_0x4b69a1[_0xb2a4('0x2e')]=_['intersection'](_0x5ad7c4[_0xb2a4('0x2d')],qs['fields'](_0x5793ee[_0xb2a4('0x2a')][_0xb2a4('0x2f')]));_0x4b69a1[_0xb2a4('0x2e')]=_0x4b69a1[_0xb2a4('0x2e')]['length']?_0x4b69a1['attributes']:_0x5ad7c4['model'];if(!_0x5793ee['query'][_0xb2a4('0x30')](_0xb2a4('0x31'))){_0x4b69a1['limit']=qs[_0xb2a4('0x32')](_0x5793ee[_0xb2a4('0x2a')]['limit']);_0x4b69a1['offset']=qs[_0xb2a4('0x18')](_0x5793ee['query'][_0xb2a4('0x18')]);}_0x4b69a1[_0xb2a4('0x33')]=qs['sort'](_0x5793ee[_0xb2a4('0x2a')][_0xb2a4('0x34')]);_0x4b69a1[_0xb2a4('0x35')]=qs['filters'](_['pick'](_0x5793ee[_0xb2a4('0x2a')],_0x5ad7c4[_0xb2a4('0x2c')]),_0x5070b);if(_0x5793ee['query']['filter']){_0x4b69a1[_0xb2a4('0x35')]=_[_0xb2a4('0x36')](_0x4b69a1[_0xb2a4('0x35')],{'$or':_[_0xb2a4('0x26')](_0x5070b,function(_0x5dc10d){if(_0x5dc10d[_0xb2a4('0x28')]!==_0xb2a4('0x37')){var _0x2e63ca={};_0x2e63ca[_0x5dc10d[_0xb2a4('0x23')]]={'$like':'%'+_0x5793ee['query']['filter']+'%'};return _0x2e63ca;}})});}_0x4b69a1=_[_0xb2a4('0x36')]({},_0x4b69a1,_0x5793ee['options']);var _0x2089c0={'where':_0x4b69a1['where']};return db[_0xb2a4('0x27')][_0xb2a4('0x1a')](_0x2089c0)[_0xb2a4('0x1f')](function(_0x30da64){_0x1bdd79[_0xb2a4('0x1a')]=_0x30da64;if(_0x5793ee[_0xb2a4('0x2a')][_0xb2a4('0x38')]){_0x4b69a1[_0xb2a4('0x39')]=[{'all':!![]}];}return db[_0xb2a4('0x27')]['findAll'](_0x4b69a1);})[_0xb2a4('0x1f')](function(_0x426a3c){_0x1bdd79[_0xb2a4('0x3a')]=_0x426a3c;return _0x1bdd79;})[_0xb2a4('0x1f')](respondWithFilteredResult(_0x42d3cf,_0x4b69a1))[_0xb2a4('0x3b')](handleError(_0x42d3cf,null));};exports['show']=function(_0x298c86,_0x4af655){var _0x708f5c={'raw':![],'where':{'id':_0x298c86[_0xb2a4('0x3c')]['id']}},_0x3d0ddf={};_0x3d0ddf[_0xb2a4('0x2d')]=_[_0xb2a4('0x2b')](db[_0xb2a4('0x27')][_0xb2a4('0x3d')]);_0x3d0ddf[_0xb2a4('0x2a')]=_['keys'](_0x298c86[_0xb2a4('0x2a')]);_0x3d0ddf['filters']=_[_0xb2a4('0x3e')](_0x3d0ddf[_0xb2a4('0x2d')],_0x3d0ddf[_0xb2a4('0x2a')]);_0x708f5c[_0xb2a4('0x2e')]=_[_0xb2a4('0x3e')](_0x3d0ddf['model'],qs[_0xb2a4('0x2f')](_0x298c86['query'][_0xb2a4('0x2f')]));_0x708f5c['attributes']=_0x708f5c[_0xb2a4('0x2e')]['length']?_0x708f5c['attributes']:_0x3d0ddf[_0xb2a4('0x2d')];if(_0x298c86[_0xb2a4('0x2a')][_0xb2a4('0x38')]){_0x708f5c['include']=[{'all':!![]}];}_0x708f5c=_['merge']({},_0x708f5c,_0x298c86['options']);return db['UserProfileSection'][_0xb2a4('0x3f')](_0x708f5c)[_0xb2a4('0x1f')](handleEntityNotFound(_0x4af655,null))[_0xb2a4('0x1f')](respondWithResult(_0x4af655,null))[_0xb2a4('0x3b')](handleError(_0x4af655,null));};exports['create']=function(_0xb440cd,_0x2a6c94){return db[_0xb2a4('0x27')][_0xb2a4('0x40')](_0xb440cd[_0xb2a4('0x41')],{})[_0xb2a4('0x1f')](respondWithResult(_0x2a6c94,0xc9))['catch'](handleError(_0x2a6c94,null));};exports[_0xb2a4('0x1e')]=function(_0x51b599,_0xb304a4){if(_0x51b599[_0xb2a4('0x41')]['id']){delete _0x51b599[_0xb2a4('0x41')]['id'];}return db['UserProfileSection'][_0xb2a4('0x3f')]({'where':{'id':_0x51b599[_0xb2a4('0x3c')]['id']}})[_0xb2a4('0x1f')](handleEntityNotFound(_0xb304a4,null))['then'](saveUpdates(_0x51b599[_0xb2a4('0x41')],null))['then'](respondWithResult(_0xb304a4,null))[_0xb2a4('0x3b')](handleError(_0xb304a4,null));};exports[_0xb2a4('0x42')]=function(_0x14e3cd,_0x4d4ff4){return db[_0xb2a4('0x27')]['find']({'where':{'id':_0x14e3cd['params']['id']}})[_0xb2a4('0x1f')](handleEntityNotFound(_0x4d4ff4,null))[_0xb2a4('0x1f')](removeEntity(_0x4d4ff4,null))[_0xb2a4('0x3b')](handleError(_0x4d4ff4,null));};exports[_0xb2a4('0x43')]=function(_0x5d4657,_0x2622ba){return db[_0xb2a4('0x27')][_0xb2a4('0x43')]()['then'](respondWithResult(_0x2622ba,null))[_0xb2a4('0x3b')](handleError(_0x2622ba,null));}; \ No newline at end of file +var _0xf00f=['catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','sendStatus','stack','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include'];(function(_0x4b3572,_0x3412d6){var _0x19b068=function(_0x3b3c10){while(--_0x3b3c10){_0x4b3572['push'](_0x4b3572['shift']());}};_0x19b068(++_0x3412d6);}(_0xf00f,0x9d));var _0xff00=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0xf00f[_0x9b7a64];return _0x33fd98;};'use strict';var emlformat=require(_0xff00('0x0'));var rimraf=require(_0xff00('0x1'));var zipdir=require(_0xff00('0x2'));var jsonpatch=require(_0xff00('0x3'));var rp=require('request-promise');var moment=require(_0xff00('0x4'));var BPromise=require(_0xff00('0x5'));var Mustache=require(_0xff00('0x6'));var util=require('util');var path=require(_0xff00('0x7'));var sox=require(_0xff00('0x8'));var csv=require(_0xff00('0x9'));var ejs=require(_0xff00('0xa'));var fs=require('fs');var fs_extra=require(_0xff00('0xb'));var _=require(_0xff00('0xc'));var squel=require(_0xff00('0xd'));var crypto=require(_0xff00('0xe'));var jsforce=require(_0xff00('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xff00('0x9'));var querystring=require(_0xff00('0x10'));var Papa=require(_0xff00('0x11'));var Redis=require('ioredis');var authService=require(_0xff00('0x12'));var qs=require(_0xff00('0x13'));var as=require(_0xff00('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff00('0x15'))(_0xff00('0x16'));var utils=require(_0xff00('0x17'));var config=require(_0xff00('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xff00('0x19'))['db'];function respondWithStatusCode(_0x37d0d2,_0x12c075){_0x12c075=_0x12c075||0xcc;return function(_0x224447){if(_0x224447){return _0x37d0d2['sendStatus'](_0x12c075);}return _0x37d0d2[_0xff00('0x1a')](_0x12c075)[_0xff00('0x1b')]();};}function respondWithResult(_0x204870,_0x48a9fe){_0x48a9fe=_0x48a9fe||0xc8;return function(_0x4a96e5){if(_0x4a96e5){return _0x204870[_0xff00('0x1a')](_0x48a9fe)[_0xff00('0x1c')](_0x4a96e5);}};}function respondWithFilteredResult(_0x9a94f7,_0x3ddbb3){return function(_0x47ed19){if(_0x47ed19){var _0x53f65c=typeof _0x3ddbb3[_0xff00('0x1d')]===_0xff00('0x1e')&&typeof _0x3ddbb3[_0xff00('0x1f')]===_0xff00('0x1e');var _0xe12402=_0x47ed19[_0xff00('0x20')];var _0x435374=_0x53f65c?0x0:_0x3ddbb3[_0xff00('0x1d')];var _0x332d55=_0x53f65c?_0x47ed19['count']:_0x3ddbb3[_0xff00('0x1d')]+_0x3ddbb3['limit'];var _0x24730f;if(_0x332d55>=_0xe12402){_0x332d55=_0xe12402;_0x24730f=0xc8;}else{_0x24730f=0xce;}_0x9a94f7['status'](_0x24730f);return _0x9a94f7['set'](_0xff00('0x21'),_0x435374+'-'+_0x332d55+'/'+_0xe12402)['json'](_0x47ed19);}return null;};}function patchUpdates(_0x4a3780){return function(_0x2284a4){try{jsonpatch[_0xff00('0x22')](_0x2284a4,_0x4a3780,!![]);}catch(_0xc0246f){return BPromise['reject'](_0xc0246f);}return _0x2284a4['save']();};}function saveUpdates(_0x17d5a6,_0x5b0571){return function(_0x4e25a7){if(_0x4e25a7){return _0x4e25a7[_0xff00('0x23')](_0x17d5a6)[_0xff00('0x24')](function(_0xc9cb0e){return _0xc9cb0e;});}return null;};}function removeEntity(_0x236ffe,_0x3a1483){return function(_0x435d46){if(_0x435d46){return _0x435d46['destroy']()['then'](function(){_0x236ffe['status'](0xcc)[_0xff00('0x1b')]();});}};}function handleEntityNotFound(_0x22eadb,_0xed1aaa){return function(_0x2286a1){if(!_0x2286a1){_0x22eadb[_0xff00('0x25')](0x194);}return _0x2286a1;};}function handleError(_0x3834eb,_0x2ec6a8){_0x2ec6a8=_0x2ec6a8||0x1f4;return function(_0x211695){logger['error'](_0x211695[_0xff00('0x26')]);if(_0x211695['name']){delete _0x211695['name'];}_0x3834eb[_0xff00('0x1a')](_0x2ec6a8)[_0xff00('0x27')](_0x211695);};}exports['index']=function(_0x345cb2,_0x3d3089){var _0x1e9f8b={},_0x521196={},_0x3d0e58={'count':0x0,'rows':[]};var _0xe2340e=_[_0xff00('0x28')](db[_0xff00('0x29')][_0xff00('0x2a')],function(_0x7eb71b){return{'name':_0x7eb71b[_0xff00('0x2b')],'type':_0x7eb71b[_0xff00('0x2c')][_0xff00('0x2d')]};});_0x521196[_0xff00('0x2e')]=_[_0xff00('0x28')](_0xe2340e,'name');_0x521196[_0xff00('0x2f')]=_['keys'](_0x345cb2['query']);_0x521196[_0xff00('0x30')]=_[_0xff00('0x31')](_0x521196[_0xff00('0x2e')],_0x521196[_0xff00('0x2f')]);_0x1e9f8b[_0xff00('0x32')]=_[_0xff00('0x31')](_0x521196[_0xff00('0x2e')],qs[_0xff00('0x33')](_0x345cb2[_0xff00('0x2f')][_0xff00('0x33')]));_0x1e9f8b[_0xff00('0x32')]=_0x1e9f8b[_0xff00('0x32')][_0xff00('0x34')]?_0x1e9f8b[_0xff00('0x32')]:_0x521196[_0xff00('0x2e')];if(!_0x345cb2[_0xff00('0x2f')][_0xff00('0x35')]('nolimit')){_0x1e9f8b[_0xff00('0x1f')]=qs[_0xff00('0x1f')](_0x345cb2['query'][_0xff00('0x1f')]);_0x1e9f8b['offset']=qs[_0xff00('0x1d')](_0x345cb2[_0xff00('0x2f')][_0xff00('0x1d')]);}_0x1e9f8b[_0xff00('0x36')]=qs[_0xff00('0x37')](_0x345cb2['query'][_0xff00('0x37')]);_0x1e9f8b[_0xff00('0x38')]=qs['filters'](_[_0xff00('0x39')](_0x345cb2[_0xff00('0x2f')],_0x521196['filters']),_0xe2340e);if(_0x345cb2['query'][_0xff00('0x3a')]){_0x1e9f8b['where']=_[_0xff00('0x3b')](_0x1e9f8b[_0xff00('0x38')],{'$or':_['map'](_0xe2340e,function(_0x1d2585){if(_0x1d2585[_0xff00('0x2c')]!==_0xff00('0x3c')){var _0x4c35c3={};_0x4c35c3[_0x1d2585[_0xff00('0x3d')]]={'$like':'%'+_0x345cb2[_0xff00('0x2f')][_0xff00('0x3a')]+'%'};return _0x4c35c3;}})});}_0x1e9f8b=_[_0xff00('0x3b')]({},_0x1e9f8b,_0x345cb2[_0xff00('0x3e')]);var _0x24433f={'where':_0x1e9f8b[_0xff00('0x38')]};return db[_0xff00('0x29')][_0xff00('0x20')](_0x24433f)[_0xff00('0x24')](function(_0x373f4e){_0x3d0e58['count']=_0x373f4e;if(_0x345cb2[_0xff00('0x2f')][_0xff00('0x3f')]){_0x1e9f8b[_0xff00('0x40')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1e9f8b);})[_0xff00('0x24')](function(_0x43817c){_0x3d0e58['rows']=_0x43817c;return _0x3d0e58;})[_0xff00('0x24')](respondWithFilteredResult(_0x3d3089,_0x1e9f8b))[_0xff00('0x41')](handleError(_0x3d3089,null));};exports[_0xff00('0x42')]=function(_0xfc5511,_0x237b95){var _0x33dde7={'raw':![],'where':{'id':_0xfc5511[_0xff00('0x43')]['id']}},_0x300947={};_0x300947[_0xff00('0x2e')]=_['keys'](db[_0xff00('0x29')][_0xff00('0x2a')]);_0x300947[_0xff00('0x2f')]=_[_0xff00('0x44')](_0xfc5511[_0xff00('0x2f')]);_0x300947[_0xff00('0x30')]=_[_0xff00('0x31')](_0x300947[_0xff00('0x2e')],_0x300947['query']);_0x33dde7[_0xff00('0x32')]=_[_0xff00('0x31')](_0x300947[_0xff00('0x2e')],qs[_0xff00('0x33')](_0xfc5511[_0xff00('0x2f')]['fields']));_0x33dde7[_0xff00('0x32')]=_0x33dde7[_0xff00('0x32')][_0xff00('0x34')]?_0x33dde7[_0xff00('0x32')]:_0x300947[_0xff00('0x2e')];if(_0xfc5511[_0xff00('0x2f')][_0xff00('0x3f')]){_0x33dde7[_0xff00('0x40')]=[{'all':!![]}];}_0x33dde7=_['merge']({},_0x33dde7,_0xfc5511[_0xff00('0x3e')]);return db['UserProfileSection'][_0xff00('0x45')](_0x33dde7)['then'](handleEntityNotFound(_0x237b95,null))['then'](respondWithResult(_0x237b95,null))['catch'](handleError(_0x237b95,null));};exports['create']=function(_0x4a8fcb,_0x3a6672){return db['UserProfileSection'][_0xff00('0x46')](_0x4a8fcb[_0xff00('0x47')],{})[_0xff00('0x24')](respondWithResult(_0x3a6672,0xc9))['catch'](handleError(_0x3a6672,null));};exports[_0xff00('0x23')]=function(_0x1c869d,_0x4a7eee){if(_0x1c869d[_0xff00('0x47')]['id']){delete _0x1c869d[_0xff00('0x47')]['id'];}return db[_0xff00('0x29')][_0xff00('0x45')]({'where':{'id':_0x1c869d['params']['id']}})[_0xff00('0x24')](handleEntityNotFound(_0x4a7eee,null))[_0xff00('0x24')](saveUpdates(_0x1c869d['body'],null))[_0xff00('0x24')](respondWithResult(_0x4a7eee,null))['catch'](handleError(_0x4a7eee,null));};exports[_0xff00('0x48')]=function(_0x5016c1,_0x348b57){return db[_0xff00('0x29')][_0xff00('0x45')]({'where':{'id':_0x5016c1[_0xff00('0x43')]['id']}})[_0xff00('0x24')](handleEntityNotFound(_0x348b57,null))[_0xff00('0x24')](removeEntity(_0x348b57,null))['catch'](handleError(_0x348b57,null));};exports['describe']=function(_0x2218b5,_0x3b8d70){return db[_0xff00('0x29')][_0xff00('0x49')]()[_0xff00('0x24')](respondWithResult(_0x3b8d70,null))[_0xff00('0x41')](handleError(_0x3b8d70,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 2d10a54..28bd74b 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 _0xbeec=['userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x13ab7f,_0x47efaf){var _0x151cb9=function(_0x19aabe){while(--_0x19aabe){_0x13ab7f['push'](_0x13ab7f['shift']());}};_0x151cb9(++_0x47efaf);}(_0xbeec,0xa6));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var logger=require(_0xcbee('0x2'))(_0xcbee('0x3'));var moment=require('moment');var BPromise=require(_0xcbee('0x4'));var rp=require(_0xcbee('0x5'));var fs=require('fs');var path=require(_0xcbee('0x6'));var rimraf=require(_0xcbee('0x7'));var config=require(_0xcbee('0x8'));var attributes=require(_0xcbee('0x9'));module['exports']=function(_0x3496f1,_0x300082){return _0x3496f1[_0xcbee('0xa')](_0xcbee('0xb'),attributes,{'tableName':_0xcbee('0xc'),'paranoid':![],'indexes':[{'name':_0xcbee('0xd'),'fields':['sectionId',_0xcbee('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbf04=['compositeIndex','sectionId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x2556a0,_0x1d8dcf){var _0x5b84af=function(_0x17aa90){while(--_0x17aa90){_0x2556a0['push'](_0x2556a0['shift']());}};_0x5b84af(++_0x1d8dcf);}(_0xbf04,0x1a2));var _0x4bf0=function(_0x5e3dd2,_0x26430e){_0x5e3dd2=_0x5e3dd2-0x0;var _0x2cab42=_0xbf04[_0x5e3dd2];return _0x2cab42;};'use strict';var _=require(_0x4bf0('0x0'));var util=require(_0x4bf0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4bf0('0x2'));var BPromise=require('bluebird');var rp=require(_0x4bf0('0x3'));var fs=require('fs');var path=require(_0x4bf0('0x4'));var rimraf=require(_0x4bf0('0x5'));var config=require(_0x4bf0('0x6'));var attributes=require(_0x4bf0('0x7'));module[_0x4bf0('0x8')]=function(_0x5082ca,_0x21b332){return _0x5082ca['define'](_0x4bf0('0x9'),attributes,{'tableName':_0x4bf0('0xa'),'paranoid':![],'indexes':[{'name':_0x4bf0('0xb'),'fields':[_0x4bf0('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 2367c90..7ac1652 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 _0x3468=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x3468,0x8d));var _0x8346=function(_0x478d43,_0xe8951e){_0x478d43=_0x478d43-0x0;var _0x100acb=_0x3468[_0x478d43];return _0x100acb;};'use strict';var _=require(_0x8346('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8346('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8346('0x2'))['db'];var utils=require(_0x8346('0x3'));var logger=require(_0x8346('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8346('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d86e,_0x35d758,_0xb88b69){return new BPromise(function(_0x2a3029,_0x2d7dc6){return client[_0x8346('0x6')](_0x25d86e,_0xb88b69)[_0x8346('0x7')](function(_0x2b36ae){logger[_0x8346('0x8')](_0x8346('0x9'),_0x35d758,_0x8346('0xa'));logger[_0x8346('0xb')](_0x8346('0xc'),_0x35d758,'request\x20sent',JSON[_0x8346('0xd')](_0x2b36ae));if(_0x2b36ae[_0x8346('0xe')]){if(_0x2b36ae[_0x8346('0xe')][_0x8346('0xf')]===0x1f4){logger[_0x8346('0xe')](_0x8346('0x9'),_0x35d758,_0x2b36ae['error'][_0x8346('0x10')]);return _0x2d7dc6(_0x2b36ae[_0x8346('0xe')][_0x8346('0x10')]);}logger[_0x8346('0xe')](_0x8346('0x9'),_0x35d758,_0x2b36ae[_0x8346('0xe')][_0x8346('0x10')]);return _0x2a3029(_0x2b36ae['error'][_0x8346('0x10')]);}else{logger['info'](_0x8346('0x9'),_0x35d758,'request\x20sent');_0x2a3029(_0x2b36ae[_0x8346('0x11')]['message']);}})[_0x8346('0x12')](function(_0x4c6aee){logger['error'](_0x8346('0x9'),_0x35d758,_0x4c6aee);_0x2d7dc6(_0x4c6aee);});});} \ No newline at end of file +var _0xdb26=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4846f1,_0x737016){var _0x480808=function(_0x61b59a){while(--_0x61b59a){_0x4846f1['push'](_0x4846f1['shift']());}};_0x480808(++_0x737016);}(_0xdb26,0x86));var _0x6db2=function(_0x19a7f6,_0x3abadc){_0x19a7f6=_0x19a7f6-0x0;var _0x5831b8=_0xdb26[_0x19a7f6];return _0x5831b8;};'use strict';var _=require('lodash');var util=require(_0x6db2('0x0'));var moment=require(_0x6db2('0x1'));var BPromise=require('bluebird');var rs=require(_0x6db2('0x2'));var fs=require('fs');var Redis=require(_0x6db2('0x3'));var db=require(_0x6db2('0x4'))['db'];var utils=require(_0x6db2('0x5'));var logger=require(_0x6db2('0x6'))(_0x6db2('0x7'));var config=require(_0x6db2('0x8'));var jayson=require(_0x6db2('0x9'));var client=jayson[_0x6db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51597d,_0x4b2d38,_0x10ba55){return new BPromise(function(_0xf18615,_0x5f5637){return client['request'](_0x51597d,_0x10ba55)['then'](function(_0x4f5381){logger['info'](_0x6db2('0xb'),_0x4b2d38,_0x6db2('0xc'));logger[_0x6db2('0xd')](_0x6db2('0xe'),_0x4b2d38,_0x6db2('0xc'),JSON[_0x6db2('0xf')](_0x4f5381));if(_0x4f5381[_0x6db2('0x10')]){if(_0x4f5381[_0x6db2('0x10')][_0x6db2('0x11')]===0x1f4){logger[_0x6db2('0x10')](_0x6db2('0xb'),_0x4b2d38,_0x4f5381[_0x6db2('0x10')][_0x6db2('0x12')]);return _0x5f5637(_0x4f5381[_0x6db2('0x10')][_0x6db2('0x12')]);}logger[_0x6db2('0x10')](_0x6db2('0xb'),_0x4b2d38,_0x4f5381['error'][_0x6db2('0x12')]);return _0xf18615(_0x4f5381[_0x6db2('0x10')][_0x6db2('0x12')]);}else{logger[_0x6db2('0x13')](_0x6db2('0xb'),_0x4b2d38,_0x6db2('0xc'));_0xf18615(_0x4f5381[_0x6db2('0x14')][_0x6db2('0x12')]);}})[_0x6db2('0x15')](function(_0x44d723){logger[_0x6db2('0x10')](_0x6db2('0xb'),_0x4b2d38,_0x44d723);_0x5f5637(_0x44d723);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e5da36b..09cc20f 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3fad5a,_0x2d3b02){var _0x4ca713=function(_0x2abe58){while(--_0x2abe58){_0x3fad5a['push'](_0x3fad5a['shift']());}};_0x4ca713(++_0x2d3b02);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x28e57e,_0x191f6c){var _0x4fa475=function(_0x286433){while(--_0x286433){_0x28e57e['push'](_0x28e57e['shift']());}};_0x4fa475(++_0x191f6c);}(_0x70e0,0x17b));var _0x070e=function(_0x23128b,_0x2dae42){_0x23128b=_0x23128b-0x0;var _0x18d094=_0x70e0[_0x23128b];return _0x18d094;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index fc7773a..02920a5 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 _0x4579=['sequelize','INTEGER'];(function(_0x4e1c4c,_0x59297d){var _0x124c48=function(_0x269aa7){while(--_0x269aa7){_0x4e1c4c['push'](_0x4e1c4c['shift']());}};_0x124c48(++_0x59297d);}(_0x4579,0x164));var _0x9457=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4579[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9457('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9457('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2376=['INTEGER','exports'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x2376,0x1d7));var _0x6237=function(_0x4efa29,_0x44fb10){_0x4efa29=_0x4efa29-0x0;var _0x47c49d=_0x2376[_0x4efa29];return _0x47c49d;};'use strict';var Sequelize=require('sequelize');module[_0x6237('0x0')]={'penalty':{'type':Sequelize[_0x6237('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 3bd7f6d..3a8fa3c 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 _0x7880=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2ba7d2,_0x4af112){var _0x27b80a=function(_0x108e97){while(--_0x108e97){_0x2ba7d2['push'](_0x2ba7d2['shift']());}};_0x27b80a(++_0x4af112);}(_0x7880,0x1f4));var _0x0788=function(_0x543bf6,_0x763bd7){_0x543bf6=_0x543bf6-0x0;var _0x4187b3=_0x7880[_0x543bf6];return _0x4187b3;};'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 +var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9206,0x176));var _0x6920=function(_0x13f1a6,_0xa9a69d){_0x13f1a6=_0x13f1a6-0x0;var _0x5b93a5=_0x9206[_0x13f1a6];return _0x5b93a5;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'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 2e8d542..0b78e9c 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 _0x2802=['request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x380c7f,_0x234003){var _0x57f3c2=function(_0x5b0848){while(--_0x5b0848){_0x380c7f['push'](_0x380c7f['shift']());}};_0x57f3c2(++_0x234003);}(_0x2802,0x1c4));var _0x2280=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x2802[_0x174a72];return _0x32cecd;};'use strict';var _=require(_0x2280('0x0'));var util=require('util');var moment=require(_0x2280('0x1'));var BPromise=require('bluebird');var rs=require(_0x2280('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2280('0x3'))['db'];var utils=require(_0x2280('0x4'));var logger=require(_0x2280('0x5'))(_0x2280('0x6'));var config=require('../../config/environment');var jayson=require(_0x2280('0x7'));var client=jayson[_0x2280('0x8')][_0x2280('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420e79,_0xc0de78,_0x12b357){return new BPromise(function(_0x51d420,_0x300fb6){return client[_0x2280('0xa')](_0x420e79,_0x12b357)[_0x2280('0xb')](function(_0xd2b030){logger[_0x2280('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0xc0de78,'request\x20sent');logger[_0x2280('0xd')](_0x2280('0xe'),_0xc0de78,_0x2280('0xf'),JSON[_0x2280('0x10')](_0xd2b030));if(_0xd2b030['error']){if(_0xd2b030[_0x2280('0x11')]['code']===0x1f4){logger[_0x2280('0x11')](_0x2280('0x12'),_0xc0de78,_0xd2b030[_0x2280('0x11')]['message']);return _0x300fb6(_0xd2b030['error'][_0x2280('0x13')]);}logger['error'](_0x2280('0x12'),_0xc0de78,_0xd2b030[_0x2280('0x11')][_0x2280('0x13')]);return _0x51d420(_0xd2b030[_0x2280('0x11')]['message']);}else{logger['info'](_0x2280('0x12'),_0xc0de78,'request\x20sent');_0x51d420(_0xd2b030[_0x2280('0x14')]['message']);}})[_0x2280('0x15')](function(_0x2680e9){logger[_0x2280('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xc0de78,_0x2680e9);_0x300fb6(_0x2680e9);});});} \ No newline at end of file +var _0x69ca=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent'];(function(_0x2688da,_0x479d9d){var _0x424021=function(_0x459c30){while(--_0x459c30){_0x2688da['push'](_0x2688da['shift']());}};_0x424021(++_0x479d9d);}(_0x69ca,0x93));var _0xa69c=function(_0x2ec3aa,_0x29bd65){_0x2ec3aa=_0x2ec3aa-0x0;var _0x284ab2=_0x69ca[_0x2ec3aa];return _0x284ab2;};'use strict';var _=require(_0xa69c('0x0'));var util=require(_0xa69c('0x1'));var moment=require('moment');var BPromise=require(_0xa69c('0x2'));var rs=require(_0xa69c('0x3'));var fs=require('fs');var Redis=require(_0xa69c('0x4'));var db=require(_0xa69c('0x5'))['db'];var utils=require(_0xa69c('0x6'));var logger=require(_0xa69c('0x7'))(_0xa69c('0x8'));var config=require(_0xa69c('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x264532,_0x10dbf2,_0x5b2795){return new BPromise(function(_0x2ec84a,_0x3aa26d){return client[_0xa69c('0xa')](_0x264532,_0x5b2795)[_0xa69c('0xb')](function(_0x56b374){logger[_0xa69c('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x10dbf2,_0xa69c('0xd'));logger[_0xa69c('0xe')](_0xa69c('0xf'),_0x10dbf2,_0xa69c('0xd'),JSON[_0xa69c('0x10')](_0x56b374));if(_0x56b374['error']){if(_0x56b374[_0xa69c('0x11')][_0xa69c('0x12')]===0x1f4){logger['error'](_0xa69c('0x13'),_0x10dbf2,_0x56b374[_0xa69c('0x11')]['message']);return _0x3aa26d(_0x56b374[_0xa69c('0x11')][_0xa69c('0x14')]);}logger[_0xa69c('0x11')](_0xa69c('0x13'),_0x10dbf2,_0x56b374['error'][_0xa69c('0x14')]);return _0x2ec84a(_0x56b374[_0xa69c('0x11')]['message']);}else{logger['info'](_0xa69c('0x13'),_0x10dbf2,_0xa69c('0xd'));_0x2ec84a(_0x56b374[_0xa69c('0x15')][_0xa69c('0x14')]);}})[_0xa69c('0x16')](function(_0x103a2c){logger[_0xa69c('0x11')](_0xa69c('0x13'),_0x10dbf2,_0x103a2c);_0x3aa26d(_0x103a2c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f7f45bd..f08cd6c 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 _0xc35f=['sequelize','exports','INTEGER'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xc35f,0xf3));var _0xfc35=function(_0x246233,_0x322137){_0x246233=_0x246233-0x0;var _0x48f431=_0xc35f[_0x246233];return _0x48f431;};'use strict';var Sequelize=require(_0xfc35('0x0'));module[_0xfc35('0x1')]={'UserId':{'type':Sequelize[_0xfc35('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xfc35('0x2')]}}; \ No newline at end of file +var _0xef9f=['sequelize','exports','INTEGER'];(function(_0x5aaf95,_0x5e8f9b){var _0x1eb0c5=function(_0x593d43){while(--_0x593d43){_0x5aaf95['push'](_0x5aaf95['shift']());}};_0x1eb0c5(++_0x5e8f9b);}(_0xef9f,0x1c2));var _0xfef9=function(_0x42f219,_0x48657a){_0x42f219=_0x42f219-0x0;var _0x9ddeb8=_0xef9f[_0x42f219];return _0x9ddeb8;};'use strict';var Sequelize=require(_0xfef9('0x0'));module[_0xfef9('0x1')]={'UserId':{'type':Sequelize[_0xfef9('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xfef9('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 41eef79..ac0bfed 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(_0x9f5940,_0x57d8d7){var _0x2030ac=function(_0xd26540){while(--_0xd26540){_0x9f5940['push'](_0x9f5940['shift']());}};_0x2030ac(++_0x57d8d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x4bf681,_0x782174){var _0x2dd359=function(_0x6f38ec){while(--_0x6f38ec){_0x4bf681['push'](_0x4bf681['shift']());}};_0x2dd359(++_0x782174);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 a22b0e0..ae8fc4c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x6a672d,_0x19be8c){var _0x59ba35=function(_0xa4dd44){while(--_0xa4dd44){_0x6a672d['push'](_0x6a672d['shift']());}};_0x59ba35(++_0x19be8c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xcb91[_0x36bf88];return _0x332914;};'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(_0x1839fa,_0x2d18ba){var _0x599af0=function(_0x4b1afe){while(--_0x4b1afe){_0x1839fa['push'](_0x1839fa['shift']());}};_0x599af0(++_0x2d18ba);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0a3bf14..fd39773 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 _0x8c5a=['sequelize','exports','INTEGER'];(function(_0x2dd577,_0x27cdcf){var _0x1370f4=function(_0x53259a){while(--_0x53259a){_0x2dd577['push'](_0x2dd577['shift']());}};_0x1370f4(++_0x27cdcf);}(_0x8c5a,0x1b6));var _0xa8c5=function(_0x5dbecc,_0x2ee3b2){_0x5dbecc=_0x5dbecc-0x0;var _0x30351f=_0x8c5a[_0x5dbecc];return _0x30351f;};'use strict';var Sequelize=require(_0xa8c5('0x0'));module[_0xa8c5('0x1')]={'penalty':{'type':Sequelize[_0xa8c5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x92bb=['INTEGER','sequelize','exports'];(function(_0x4ee817,_0x1e77a0){var _0x377955=function(_0x502588){while(--_0x502588){_0x4ee817['push'](_0x4ee817['shift']());}};_0x377955(++_0x1e77a0);}(_0x92bb,0x1bd));var _0xb92b=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x92bb[_0x5517c0];return _0x33803b;};'use strict';var Sequelize=require(_0xb92b('0x0'));module[_0xb92b('0x1')]={'penalty':{'type':Sequelize[_0xb92b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index a4e03ba..76c7ba6 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 _0x6720=['UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x141e5f,_0x216927){var _0x5bea96=function(_0x538c07){while(--_0x538c07){_0x141e5f['push'](_0x141e5f['shift']());}};_0x5bea96(++_0x216927);}(_0x6720,0x86));var _0x0672=function(_0x4d02b6,_0x2d66ee){_0x4d02b6=_0x4d02b6-0x0;var _0x4ea978=_0x6720[_0x4d02b6];return _0x4ea978;};'use strict';var _=require(_0x0672('0x0'));var util=require('util');var logger=require(_0x0672('0x1'))('api');var moment=require(_0x0672('0x2'));var BPromise=require(_0x0672('0x3'));var rp=require(_0x0672('0x4'));var fs=require('fs');var path=require(_0x0672('0x5'));var rimraf=require(_0x0672('0x6'));var config=require(_0x0672('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x0672('0x8')]=function(_0x54f2bb,_0x5f176e){return _0x54f2bb[_0x0672('0x9')](_0x0672('0xa'),attributes,{'tableName':_0x0672('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d4c=['exports','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x5d572c,_0x53581f){var _0x5797cf=function(_0x5dcdd4){while(--_0x5dcdd4){_0x5d572c['push'](_0x5d572c['shift']());}};_0x5797cf(++_0x53581f);}(_0x1d4c,0x193));var _0xc1d4=function(_0xf98111,_0x5d8927){_0xf98111=_0xf98111-0x0;var _0x4c3e5a=_0x1d4c[_0xf98111];return _0x4c3e5a;};'use strict';var _=require('lodash');var util=require(_0xc1d4('0x0'));var logger=require(_0xc1d4('0x1'))(_0xc1d4('0x2'));var moment=require('moment');var BPromise=require(_0xc1d4('0x3'));var rp=require(_0xc1d4('0x4'));var fs=require('fs');var path=require(_0xc1d4('0x5'));var rimraf=require('rimraf');var config=require(_0xc1d4('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xc1d4('0x7')]=function(_0x54fa33,_0x5b320b){return _0x54fa33['define'](_0xc1d4('0x8'),attributes,{'tableName':_0xc1d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index dafde52..35359b1 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 _0xd961=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x453b59,_0x33b079){var _0x26cdf5=function(_0xe7ed80){while(--_0xe7ed80){_0x453b59['push'](_0x453b59['shift']());}};_0x26cdf5(++_0x33b079);}(_0xd961,0xaa));var _0x1d96=function(_0x471f8f,_0x2eaaf8){_0x471f8f=_0x471f8f-0x0;var _0x31da61=_0xd961[_0x471f8f];return _0x31da61;};'use strict';var _=require(_0x1d96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1d96('0x1'));var rs=require(_0x1d96('0x2'));var fs=require('fs');var Redis=require(_0x1d96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d96('0x4'));var logger=require(_0x1d96('0x5'))(_0x1d96('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d96('0x7'));var client=jayson[_0x1d96('0x8')][_0x1d96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x494b48,_0x4944d3,_0x3f17be){return new BPromise(function(_0x3b64f5,_0x42d816){return client[_0x1d96('0xa')](_0x494b48,_0x3f17be)[_0x1d96('0xb')](function(_0x1f0108){logger['info'](_0x1d96('0xc'),_0x4944d3,'request\x20sent');logger[_0x1d96('0xd')](_0x1d96('0xe'),_0x4944d3,_0x1d96('0xf'),JSON[_0x1d96('0x10')](_0x1f0108));if(_0x1f0108[_0x1d96('0x11')]){if(_0x1f0108['error'][_0x1d96('0x12')]===0x1f4){logger['error'](_0x1d96('0xc'),_0x4944d3,_0x1f0108[_0x1d96('0x11')][_0x1d96('0x13')]);return _0x42d816(_0x1f0108[_0x1d96('0x11')][_0x1d96('0x13')]);}logger[_0x1d96('0x11')](_0x1d96('0xc'),_0x4944d3,_0x1f0108[_0x1d96('0x11')][_0x1d96('0x13')]);return _0x3b64f5(_0x1f0108[_0x1d96('0x11')]['message']);}else{logger[_0x1d96('0x14')](_0x1d96('0xc'),_0x4944d3,_0x1d96('0xf'));_0x3b64f5(_0x1f0108[_0x1d96('0x15')]['message']);}})[_0x1d96('0x16')](function(_0x540105){logger[_0x1d96('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x4944d3,_0x540105);_0x42d816(_0x540105);});});} \ No newline at end of file +var _0xcf72=['request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0xcf72,0x199));var _0x2cf7=function(_0x1efb79,_0x32a6a2){_0x1efb79=_0x1efb79-0x0;var _0x294322=_0xcf72[_0x1efb79];return _0x294322;};'use strict';var _=require(_0x2cf7('0x0'));var util=require(_0x2cf7('0x1'));var moment=require(_0x2cf7('0x2'));var BPromise=require(_0x2cf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cf7('0x4'));var db=require(_0x2cf7('0x5'))['db'];var utils=require(_0x2cf7('0x6'));var logger=require('../../config/logger')(_0x2cf7('0x7'));var config=require('../../config/environment');var jayson=require(_0x2cf7('0x8'));var client=jayson[_0x2cf7('0x9')][_0x2cf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1563b1,_0x286ef0,_0x352a31){return new BPromise(function(_0x12ff58,_0x1751e8){return client[_0x2cf7('0xb')](_0x1563b1,_0x352a31)[_0x2cf7('0xc')](function(_0x562ae6){logger['info'](_0x2cf7('0xd'),_0x286ef0,_0x2cf7('0xe'));logger['debug'](_0x2cf7('0xf'),_0x286ef0,_0x2cf7('0xe'),JSON['stringify'](_0x562ae6));if(_0x562ae6[_0x2cf7('0x10')]){if(_0x562ae6[_0x2cf7('0x10')]['code']===0x1f4){logger[_0x2cf7('0x10')](_0x2cf7('0xd'),_0x286ef0,_0x562ae6[_0x2cf7('0x10')][_0x2cf7('0x11')]);return _0x1751e8(_0x562ae6[_0x2cf7('0x10')]['message']);}logger['error'](_0x2cf7('0xd'),_0x286ef0,_0x562ae6[_0x2cf7('0x10')][_0x2cf7('0x11')]);return _0x12ff58(_0x562ae6['error']['message']);}else{logger['info'](_0x2cf7('0xd'),_0x286ef0,_0x2cf7('0xe'));_0x12ff58(_0x562ae6[_0x2cf7('0x12')][_0x2cf7('0x11')]);}})[_0x2cf7('0x13')](function(_0xd4bcac){logger[_0x2cf7('0x10')](_0x2cf7('0xd'),_0x286ef0,_0xd4bcac);_0x1751e8(_0xd4bcac);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index aadeb98..3a84142 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x34422e,_0xbb6048){var _0x51a754=function(_0x3b3ce1){while(--_0x3b3ce1){_0x34422e['push'](_0x34422e['shift']());}};_0x51a754(++_0xbb6048);}(_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(_0xf170f5,_0x5a09ed){var _0x55baa8=function(_0x38cece){while(--_0x38cece){_0xf170f5['push'](_0xf170f5['shift']());}};_0x55baa8(++_0x5a09ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0xcb91[_0x4b7b69];return _0x173b4c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 2485aea..01a0ccd 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 _0x4767=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x31004c,_0x503c2e){var _0x399a98=function(_0x402a98){while(--_0x402a98){_0x31004c['push'](_0x31004c['shift']());}};_0x399a98(++_0x503c2e);}(_0x4767,0x178));var _0x7476=function(_0x4c197c,_0x586152){_0x4c197c=_0x4c197c-0x0;var _0x49d42c=_0x4767[_0x4c197c];return _0x49d42c;};'use strict';var Sequelize=require(_0x7476('0x0'));module[_0x7476('0x1')]={'uniqueid':{'type':Sequelize[_0x7476('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7476('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x7476('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7476('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x7476('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7476('0x5'),'comment':_0x7476('0x3')},'penalty':{'type':Sequelize[_0x7476('0x2')](0xb),'defaultValue':0x0,'comment':_0x7476('0x3')},'paused':{'type':Sequelize[_0x7476('0x2')](0xb),'defaultValue':0x0,'comment':_0x7476('0x3')}}; \ No newline at end of file +var _0xa6d1=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa6d1,0xcc));var _0x1a6d=function(_0x1374bd,_0xb36574){_0x1374bd=_0x1374bd-0x0;var _0x3c0f54=_0xa6d1[_0x1374bd];return _0x3c0f54;};'use strict';var Sequelize=require(_0x1a6d('0x0'));module[_0x1a6d('0x1')]={'uniqueid':{'type':Sequelize[_0x1a6d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1a6d('0x3')},'membername':{'type':Sequelize[_0x1a6d('0x4')],'allowNull':![],'comment':_0x1a6d('0x3')},'UserId':{'type':Sequelize[_0x1a6d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a6d('0x5'),'comment':_0x1a6d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x1a6d('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a6d('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x1a6d('0x2')](0xb),'defaultValue':0x0,'comment':_0x1a6d('0x3')},'paused':{'type':Sequelize[_0x1a6d('0x2')](0xb),'defaultValue':0x0,'comment':_0x1a6d('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 644f955..a23b3f3 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 _0x8f9c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x8f9c,0x7c));var _0xc8f9=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8f9c[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0xc8f9('0x0'));var UserVoiceQueueRt=require(_0xc8f9('0x1'))['db'][_0xc8f9('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc8f9('0x3')](0x0);var events={'afterCreate':_0xc8f9('0x4'),'afterUpdate':_0xc8f9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x39942b){return function(_0xec0c16,_0xd6dff2,_0x55a2ed){UserVoiceQueueRtEvents[_0xc8f9('0x6')](_0x39942b+':'+_0xec0c16['id'],_0xec0c16);UserVoiceQueueRtEvents[_0xc8f9('0x6')](_0x39942b,_0xec0c16);_0x55a2ed(null);};}for(var e in events){if(events[_0xc8f9('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xc8f9('0x8')](e,emitEvent(event));}}module[_0xc8f9('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x9ed5=['emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','save','remove'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x9ed5,0x12b));var _0x59ed=function(_0x4c8c4d,_0x170fc3){_0x4c8c4d=_0x4c8c4d-0x0;var _0x7c72d2=_0x9ed5[_0x4c8c4d];return _0x7c72d2;};'use strict';var EventEmitter=require(_0x59ed('0x0'));var UserVoiceQueueRt=require(_0x59ed('0x1'))['db'][_0x59ed('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59ed('0x3'),'afterUpdate':'update','afterDestroy':_0x59ed('0x4')};function emitEvent(_0x5e3ae5){return function(_0x32005c,_0x384240,_0x36ad0b){UserVoiceQueueRtEvents[_0x59ed('0x5')](_0x5e3ae5+':'+_0x32005c['id'],_0x32005c);UserVoiceQueueRtEvents[_0x59ed('0x5')](_0x5e3ae5,_0x32005c);_0x36ad0b(null);};}for(var e in events){if(events[_0x59ed('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x59ed('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 61d2843..a23be77 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 _0xcca0=['../../config/logger','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x3e51ac,_0x3cb021){var _0x34e459=function(_0x140458){while(--_0x140458){_0x3e51ac['push'](_0x3e51ac['shift']());}};_0x34e459(++_0x3cb021);}(_0xcca0,0x13d));var _0x0cca=function(_0x48cc03,_0x462c39){_0x48cc03=_0x48cc03-0x0;var _0x461211=_0xcca0[_0x48cc03];return _0x461211;};'use strict';var _=require(_0x0cca('0x0'));var util=require(_0x0cca('0x1'));var logger=require(_0x0cca('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0cca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cca('0x4'));var rimraf=require('rimraf');var config=require(_0x0cca('0x5'));var attributes=require(_0x0cca('0x6'));module[_0x0cca('0x7')]=function(_0x1d5f59,_0x4f2373){return _0x1d5f59[_0x0cca('0x8')](_0x0cca('0x9'),attributes,{'tableName':_0x0cca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50d7=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3056d0,_0x3ce8a0){var _0x3e29d8=function(_0x497953){while(--_0x497953){_0x3056d0['push'](_0x3056d0['shift']());}};_0x3e29d8(++_0x3ce8a0);}(_0x50d7,0x85));var _0x750d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x50d7[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x750d('0x0'));var logger=require(_0x750d('0x1'))(_0x750d('0x2'));var moment=require(_0x750d('0x3'));var BPromise=require(_0x750d('0x4'));var rp=require(_0x750d('0x5'));var fs=require('fs');var path=require(_0x750d('0x6'));var rimraf=require(_0x750d('0x7'));var config=require(_0x750d('0x8'));var attributes=require(_0x750d('0x9'));module[_0x750d('0xa')]=function(_0x16a64c,_0x28a99a){return _0x16a64c[_0x750d('0xb')](_0x750d('0xc'),attributes,{'tableName':_0x750d('0xd'),'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 f9912ff..db4adc6 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 _0x5224=['sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueRtPauses','findAll','options','where'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x5224,0x191));var _0x4522=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0x5224[_0x483ab9];return _0x35043b;};'use strict';var _=require(_0x4522('0x0'));var util=require(_0x4522('0x1'));var moment=require('moment');var BPromise=require(_0x4522('0x2'));var rs=require(_0x4522('0x3'));var fs=require('fs');var Redis=require(_0x4522('0x4'));var db=require(_0x4522('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4522('0x6'));var config=require('../../config/environment');var jayson=require(_0x4522('0x7'));var client=jayson[_0x4522('0x8')][_0x4522('0x9')]({'port':0x232a});config[_0x4522('0xa')]=_['defaults'](config[_0x4522('0xa')],{'host':_0x4522('0xb'),'port':0x18eb});var socket=require(_0x4522('0xc'))(new Redis(config[_0x4522('0xa')]));require('./userVoiceQueueRt.socket')[_0x4522('0xd')](socket);function respondWithRpcPromise(_0xfcad7e,_0x417e2e,_0x28f0b2){return new BPromise(function(_0x2f25ea,_0x290000){return client['request'](_0xfcad7e,_0x28f0b2)[_0x4522('0xe')](function(_0x5c223e){logger[_0x4522('0xf')](_0x4522('0x10'),_0x417e2e,'request\x20sent');logger['debug'](_0x4522('0x11'),_0x417e2e,_0x4522('0x12'),JSON[_0x4522('0x13')](_0x5c223e));if(_0x5c223e[_0x4522('0x14')]){if(_0x5c223e[_0x4522('0x14')]['code']===0x1f4){logger['error'](_0x4522('0x10'),_0x417e2e,_0x5c223e[_0x4522('0x14')][_0x4522('0x15')]);return _0x290000(_0x5c223e[_0x4522('0x14')][_0x4522('0x15')]);}logger[_0x4522('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x417e2e,_0x5c223e['error'][_0x4522('0x15')]);return _0x2f25ea(_0x5c223e['error'][_0x4522('0x15')]);}else{logger[_0x4522('0xf')](_0x4522('0x10'),_0x417e2e,'request\x20sent');_0x2f25ea(_0x5c223e[_0x4522('0x16')][_0x4522('0x15')]);}})[_0x4522('0x17')](function(_0x17dc0d){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x417e2e,_0x17dc0d);_0x290000(_0x17dc0d);});});}exports[_0x4522('0x18')]=function(_0x3c2cc0){var _0x4ca8fa=this;return new Promise(function(_0x2c58d8,_0x2450ad){return db['UserVoiceQueueRt'][_0x4522('0x19')]({'raw':_0x3c2cc0['options']?_0x3c2cc0[_0x4522('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3c2cc0['options']?_0x3c2cc0[_0x4522('0x1a')][_0x4522('0x1b')]||null:null,'attributes':[[db[_0x4522('0x1c')]['fn'](_0x4522('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4522('0x1e')))),_0x4522('0x1f')]]})[_0x4522('0xe')](function(_0x1b0ce9){logger['info'](_0x4522('0x18'),_0x3c2cc0);logger[_0x4522('0x20')]('GetVoiceQueueRtPauses',_0x3c2cc0,JSON[_0x4522('0x13')](_0x1b0ce9));_0x2c58d8(_0x1b0ce9);})['catch'](function(_0x39da0b){logger['error']('GetVoiceQueueRtPauses',_0x39da0b['message'],_0x3c2cc0);_0x2450ad(_0x4ca8fa['error'](0x1f4,_0x39da0b[_0x4522('0x15')]));});});}; \ No newline at end of file +var _0x932a=['outboundQueuePauses','GetVoiceQueueRtPauses','stringify','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','message','catch','UserVoiceQueueRt','options','raw','COUNT','sequelize','literal'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x932a,0xa3));var _0xa932=function(_0x1dcfd,_0x408a2e){_0x1dcfd=_0x1dcfd-0x0;var _0x30374c=_0x932a[_0x1dcfd];return _0x30374c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa932('0x0'));var BPromise=require(_0xa932('0x1'));var rs=require(_0xa932('0x2'));var fs=require('fs');var Redis=require(_0xa932('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa932('0x4'));var logger=require(_0xa932('0x5'))(_0xa932('0x6'));var config=require(_0xa932('0x7'));var jayson=require(_0xa932('0x8'));var client=jayson[_0xa932('0x9')][_0xa932('0xa')]({'port':0x232a});config[_0xa932('0xb')]=_[_0xa932('0xc')](config[_0xa932('0xb')],{'host':_0xa932('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa932('0xb')]));require(_0xa932('0xe'))[_0xa932('0xf')](socket);function respondWithRpcPromise(_0x58af57,_0x429d02,_0x2b656e){return new BPromise(function(_0x22671c,_0x5b9c94){return client['request'](_0x58af57,_0x2b656e)[_0xa932('0x10')](function(_0x35ede0){logger[_0xa932('0x11')](_0xa932('0x12'),_0x429d02,_0xa932('0x13'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x429d02,_0xa932('0x13'),JSON['stringify'](_0x35ede0));if(_0x35ede0[_0xa932('0x14')]){if(_0x35ede0[_0xa932('0x14')]['code']===0x1f4){logger[_0xa932('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x429d02,_0x35ede0['error'][_0xa932('0x15')]);return _0x5b9c94(_0x35ede0['error'][_0xa932('0x15')]);}logger['error'](_0xa932('0x12'),_0x429d02,_0x35ede0[_0xa932('0x14')][_0xa932('0x15')]);return _0x22671c(_0x35ede0[_0xa932('0x14')][_0xa932('0x15')]);}else{logger[_0xa932('0x11')](_0xa932('0x12'),_0x429d02,_0xa932('0x13'));_0x22671c(_0x35ede0['result'][_0xa932('0x15')]);}})[_0xa932('0x16')](function(_0x3fbb39){logger['error'](_0xa932('0x12'),_0x429d02,_0x3fbb39);_0x5b9c94(_0x3fbb39);});});}exports['GetVoiceQueueRtPauses']=function(_0x67d86b){var _0x5743d6=this;return new Promise(function(_0x24a635,_0x5027ed){return db[_0xa932('0x17')]['findAll']({'raw':_0x67d86b[_0xa932('0x18')]?_0x67d86b[_0xa932('0x18')][_0xa932('0x19')]===undefined?!![]:![]:!![],'where':_0x67d86b['options']?_0x67d86b[_0xa932('0x18')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xa932('0x1a'),db[_0xa932('0x1b')]['fn']('IF',db[_0xa932('0x1b')][_0xa932('0x1c')]('`paused`\x20=\x201,\x201,\x20null'))),_0xa932('0x1d')]]})['then'](function(_0x5a0bb2){logger[_0xa932('0x11')](_0xa932('0x1e'),_0x67d86b);logger['debug'](_0xa932('0x1e'),_0x67d86b,JSON[_0xa932('0x1f')](_0x5a0bb2));_0x24a635(_0x5a0bb2);})[_0xa932('0x16')](function(_0x5aae0a){logger[_0xa932('0x14')](_0xa932('0x1e'),_0x5aae0a['message'],_0x67d86b);_0x5027ed(_0x5743d6[_0xa932('0x14')](0x1f4,_0x5aae0a[_0xa932('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b280e05..6baf9e6 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 _0x5a4f=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','emit','removeListener'];(function(_0x18a1f0,_0x1bb307){var _0x2adb90=function(_0x35c494){while(--_0x35c494){_0x18a1f0['push'](_0x18a1f0['shift']());}};_0x2adb90(++_0x1bb307);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x5a4f[_0x34bf97];return _0x292719;};'use strict';var UserVoiceQueueRtEvents=require(_0xf5a4('0x0'));var events=['save',_0xf5a4('0x1'),'update'];function createListener(_0x22548a,_0x582a25){return function(_0x35d241){_0x582a25[_0xf5a4('0x2')](_0x22548a,_0x35d241);};}function removeListener(_0x28a5e3,_0x2b45a3){return function(){UserVoiceQueueRtEvents[_0xf5a4('0x3')](_0x28a5e3,_0x2b45a3);};}exports[_0xf5a4('0x4')]=function(_0x431162){for(var _0x5d2a8c=0x0,_0x354c7d=events[_0xf5a4('0x5')];_0x5d2a8c<_0x354c7d;_0x5d2a8c++){var _0x3ef3da=events[_0x5d2a8c];var _0x1e7821=createListener(_0xf5a4('0x6')+_0x3ef3da,_0x431162);UserVoiceQueueRtEvents['on'](_0x3ef3da,_0x1e7821);}}; \ No newline at end of file +var _0x4d49=['update','emit','removeListener','register','length','userVoiceQueueRt:','save'];(function(_0x136f00,_0x173425){var _0x1fadb0=function(_0x34121a){while(--_0x34121a){_0x136f00['push'](_0x136f00['shift']());}};_0x1fadb0(++_0x173425);}(_0x4d49,0x141));var _0x94d4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d49[_0x5b644e];return _0x49c6bf;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x94d4('0x0'),'remove',_0x94d4('0x1')];function createListener(_0x370da5,_0x25a976){return function(_0x478610){_0x25a976[_0x94d4('0x2')](_0x370da5,_0x478610);};}function removeListener(_0x95b780,_0x422546){return function(){UserVoiceQueueRtEvents[_0x94d4('0x3')](_0x95b780,_0x422546);};}exports[_0x94d4('0x4')]=function(_0x4dd133){for(var _0x2b3127=0x0,_0x44b1c9=events[_0x94d4('0x5')];_0x2b3127<_0x44b1c9;_0x2b3127++){var _0x3fc91a=events[_0x2b3127];var _0x2d44c7=createListener(_0x94d4('0x6')+_0x3fc91a,_0x4dd133);UserVoiceQueueRtEvents['on'](_0x3fc91a,_0x2d44c7);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 913e9f1..ce1aecc 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1444a3,_0x3fdfe3){var _0x454275=function(_0x578e0e){while(--_0x578e0e){_0x1444a3['push'](_0x1444a3['shift']());}};_0x454275(++_0x3fdfe3);}(_0x70e0,0x17b));var _0x070e=function(_0x3dd39f,_0x229d54){_0x3dd39f=_0x3dd39f-0x0;var _0x393ee3=_0x70e0[_0x3dd39f];return _0x393ee3;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1dbb707..30b1292 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 _0x88f8=['sequelize','INTEGER'];(function(_0x5bb2e9,_0x2d3666){var _0xd073e8=function(_0x1796e5){while(--_0x1796e5){_0x5bb2e9['push'](_0x5bb2e9['shift']());}};_0xd073e8(++_0x2d3666);}(_0x88f8,0x13c));var _0x888f=function(_0xeddc0f,_0xe60df4){_0xeddc0f=_0xeddc0f-0x0;var _0x34b1e5=_0x88f8[_0xeddc0f];return _0x34b1e5;};'use strict';var Sequelize=require(_0x888f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x888f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8db9=['exports','INTEGER','sequelize'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8db9,0x1a0));var _0x98db=function(_0x67cfa6,_0x528438){_0x67cfa6=_0x67cfa6-0x0;var _0x529112=_0x8db9[_0x67cfa6];return _0x529112;};'use strict';var Sequelize=require(_0x98db('0x0'));module[_0x98db('0x1')]={'penalty':{'type':Sequelize[_0x98db('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 6ebc1a9..dc271ad 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 _0x7bef=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x4af827,_0x1313b7){var _0x3f11db=function(_0x3a18f4){while(--_0x3a18f4){_0x4af827['push'](_0x4af827['shift']());}};_0x3f11db(++_0x1313b7);}(_0x7bef,0xfe));var _0xf7be=function(_0x28a245,_0x1d817a){_0x28a245=_0x28a245-0x0;var _0x1bfce6=_0x7bef[_0x28a245];return _0x1bfce6;};'use strict';var _=require(_0xf7be('0x0'));var util=require(_0xf7be('0x1'));var logger=require(_0xf7be('0x2'))(_0xf7be('0x3'));var moment=require(_0xf7be('0x4'));var BPromise=require(_0xf7be('0x5'));var rp=require(_0xf7be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7be('0x7'));var config=require(_0xf7be('0x8'));var attributes=require(_0xf7be('0x9'));module['exports']=function(_0xeb0749,_0x5e1232){return _0xeb0749['define'](_0xf7be('0xa'),attributes,{'tableName':_0xf7be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d58=['user_has_whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue'];(function(_0x2e28fb,_0x1fb11d){var _0x3419f0=function(_0x59e0df){while(--_0x59e0df){_0x2e28fb['push'](_0x2e28fb['shift']());}};_0x3419f0(++_0x1fb11d);}(_0x6d58,0x115));var _0x86d5=function(_0x412167,_0x3cb06b){_0x412167=_0x412167-0x0;var _0x56a181=_0x6d58[_0x412167];return _0x56a181;};'use strict';var _=require('lodash');var util=require(_0x86d5('0x0'));var logger=require(_0x86d5('0x1'))(_0x86d5('0x2'));var moment=require(_0x86d5('0x3'));var BPromise=require(_0x86d5('0x4'));var rp=require(_0x86d5('0x5'));var fs=require('fs');var path=require(_0x86d5('0x6'));var rimraf=require(_0x86d5('0x7'));var config=require(_0x86d5('0x8'));var attributes=require(_0x86d5('0x9'));module['exports']=function(_0x53a859,_0x69606d){return _0x53a859['define'](_0x86d5('0xa'),attributes,{'tableName':_0x86d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index af96875..6c9d261 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 _0xa949=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0xa949,0x1c5));var _0x9a94=function(_0x2a16f5,_0x1888d2){_0x2a16f5=_0x2a16f5-0x0;var _0x21e612=_0xa949[_0x2a16f5];return _0x21e612;};'use strict';var _=require(_0x9a94('0x0'));var util=require(_0x9a94('0x1'));var moment=require(_0x9a94('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a94('0x3'));var fs=require('fs');var Redis=require(_0x9a94('0x4'));var db=require(_0x9a94('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a94('0x6'))(_0x9a94('0x7'));var config=require(_0x9a94('0x8'));var jayson=require(_0x9a94('0x9'));var client=jayson[_0x9a94('0xa')][_0x9a94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1477c4,_0x12bef9,_0x5aabf2){return new BPromise(function(_0x6ee21d,_0x498242){return client[_0x9a94('0xc')](_0x1477c4,_0x5aabf2)[_0x9a94('0xd')](function(_0x89d31b){logger[_0x9a94('0xe')](_0x9a94('0xf'),_0x12bef9,'request\x20sent');logger[_0x9a94('0x10')](_0x9a94('0x11'),_0x12bef9,_0x9a94('0x12'),JSON[_0x9a94('0x13')](_0x89d31b));if(_0x89d31b['error']){if(_0x89d31b[_0x9a94('0x14')][_0x9a94('0x15')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x12bef9,_0x89d31b[_0x9a94('0x14')]['message']);return _0x498242(_0x89d31b[_0x9a94('0x14')][_0x9a94('0x16')]);}logger[_0x9a94('0x14')](_0x9a94('0xf'),_0x12bef9,_0x89d31b[_0x9a94('0x14')]['message']);return _0x6ee21d(_0x89d31b[_0x9a94('0x14')][_0x9a94('0x16')]);}else{logger['info'](_0x9a94('0xf'),_0x12bef9,_0x9a94('0x12'));_0x6ee21d(_0x89d31b[_0x9a94('0x17')][_0x9a94('0x16')]);}})['catch'](function(_0x4f3619){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x12bef9,_0x4f3619);_0x498242(_0x4f3619);});});} \ No newline at end of file +var _0x5409=['error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5b4daa,_0xc385e4){var _0x9b569c=function(_0x76fdb6){while(--_0x76fdb6){_0x5b4daa['push'](_0x5b4daa['shift']());}};_0x9b569c(++_0xc385e4);}(_0x5409,0x13f));var _0x9540=function(_0x37f300,_0x4558a7){_0x37f300=_0x37f300-0x0;var _0x1c8a7c=_0x5409[_0x37f300];return _0x1c8a7c;};'use strict';var _=require(_0x9540('0x0'));var util=require(_0x9540('0x1'));var moment=require('moment');var BPromise=require(_0x9540('0x2'));var rs=require(_0x9540('0x3'));var fs=require('fs');var Redis=require(_0x9540('0x4'));var db=require(_0x9540('0x5'))['db'];var utils=require(_0x9540('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9540('0x7'));var jayson=require(_0x9540('0x8'));var client=jayson[_0x9540('0x9')][_0x9540('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b8ce,_0x8eb266,_0x39cab8){return new BPromise(function(_0x45e98f,_0x4487ca){return client[_0x9540('0xb')](_0x38b8ce,_0x39cab8)[_0x9540('0xc')](function(_0x451f6c){logger[_0x9540('0xd')](_0x9540('0xe'),_0x8eb266,_0x9540('0xf'));logger[_0x9540('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x8eb266,_0x9540('0xf'),JSON['stringify'](_0x451f6c));if(_0x451f6c[_0x9540('0x11')]){if(_0x451f6c[_0x9540('0x11')][_0x9540('0x12')]===0x1f4){logger[_0x9540('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x8eb266,_0x451f6c[_0x9540('0x11')][_0x9540('0x13')]);return _0x4487ca(_0x451f6c[_0x9540('0x11')][_0x9540('0x13')]);}logger[_0x9540('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x8eb266,_0x451f6c['error']['message']);return _0x45e98f(_0x451f6c[_0x9540('0x11')][_0x9540('0x13')]);}else{logger[_0x9540('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x8eb266,_0x9540('0xf'));_0x45e98f(_0x451f6c[_0x9540('0x14')][_0x9540('0x13')]);}})['catch'](function(_0x42ca29){logger[_0x9540('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x8eb266,_0x42ca29);_0x4487ca(_0x42ca29);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 46851a4..e73b0da 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 _0x5a52=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','express'];(function(_0x1fd344,_0x572281){var _0x397c9f=function(_0xb27059){while(--_0xb27059){_0x1fd344['push'](_0x1fd344['shift']());}};_0x397c9f(++_0x572281);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x25a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x25a5('0x1'));var router=express[_0x25a5('0x2')]();var fs_extra=require(_0x25a5('0x3'));var auth=require(_0x25a5('0x4'));var interaction=require(_0x25a5('0x5'));var config=require(_0x25a5('0x6'));var controller=require(_0x25a5('0x7'));router[_0x25a5('0x8')]('/',auth['isAuthenticated'](),controller[_0x25a5('0x9')]);router['get'](_0x25a5('0xa'),auth[_0x25a5('0xb')](),controller[_0x25a5('0xc')]);router[_0x25a5('0xd')]('/',auth[_0x25a5('0xb')](),controller[_0x25a5('0xe')]);router['put']('/:id',auth[_0x25a5('0xb')](),controller[_0x25a5('0xf')]);router[_0x25a5('0x10')](_0x25a5('0xa'),auth[_0x25a5('0xb')](),controller[_0x25a5('0x11')]);module[_0x25a5('0x12')]=router; \ No newline at end of file +var _0xfcbd=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x25c9ce,_0x10152a){var _0xcc7ac0=function(_0x363263){while(--_0x363263){_0x25c9ce['push'](_0x25c9ce['shift']());}};_0xcc7ac0(++_0x10152a);}(_0xfcbd,0x160));var _0xdfcb=function(_0x339783,_0x3e0255){_0x339783=_0x339783-0x0;var _0x8c4d86=_0xfcbd[_0x339783];return _0x8c4d86;};'use strict';var multer=require(_0xdfcb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdfcb('0x1'));var express=require(_0xdfcb('0x2'));var router=express[_0xdfcb('0x3')]();var fs_extra=require(_0xdfcb('0x4'));var auth=require(_0xdfcb('0x5'));var interaction=require(_0xdfcb('0x6'));var config=require(_0xdfcb('0x7'));var controller=require(_0xdfcb('0x8'));router[_0xdfcb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdfcb('0x9')](_0xdfcb('0xa'),auth[_0xdfcb('0xb')](),controller[_0xdfcb('0xc')]);router[_0xdfcb('0xd')]('/',auth[_0xdfcb('0xb')](),controller[_0xdfcb('0xe')]);router['put'](_0xdfcb('0xa'),auth[_0xdfcb('0xb')](),controller[_0xdfcb('0xf')]);router[_0xdfcb('0x10')](_0xdfcb('0xa'),auth[_0xdfcb('0xb')](),controller[_0xdfcb('0x11')]);module[_0xdfcb('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index d1c8143..5db3ff4 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 _0x4b47=['name','sequelize','STRING'];(function(_0x5e0b0b,_0x31ed6d){var _0x1b09f8=function(_0x1e9e1a){while(--_0x1e9e1a){_0x5e0b0b['push'](_0x5e0b0b['shift']());}};_0x1b09f8(++_0x31ed6d);}(_0x4b47,0x1b4));var _0x74b4=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x4b47[_0x2ade6c];return _0x2cb372;};'use strict';var Sequelize=require(_0x74b4('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b4('0x1')],'unique':_0x74b4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x74b4('0x1')]}}; \ No newline at end of file +var _0xe559=['STRING','name','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe559,0x176));var _0x9e55=function(_0x772621,_0x1ae51e){_0x772621=_0x772621-0x0;var _0xfb0a03=_0xe559[_0x772621];return _0xfb0a03;};'use strict';var Sequelize=require('sequelize');module[_0x9e55('0x0')]={'name':{'type':Sequelize[_0x9e55('0x1')],'unique':_0x9e55('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9e55('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9508c29..de61cd0 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 _0xe122=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','get','UserProfileResource','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','options','find','create','user','role','UserProfileSection','autoAssociation'];(function(_0x5e749d,_0x303e38){var _0x2f202d=function(_0x573659){while(--_0x573659){_0x5e749d['push'](_0x5e749d['shift']());}};_0x2f202d(++_0x303e38);}(_0xe122,0x18f));var _0x2e12=function(_0x1cee2a,_0x4a9d9e){_0x1cee2a=_0x1cee2a-0x0;var _0x433ba4=_0xe122[_0x1cee2a];return _0x433ba4;};'use strict';var emlformat=require(_0x2e12('0x0'));var rimraf=require(_0x2e12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e12('0x2'));var rp=require(_0x2e12('0x3'));var moment=require(_0x2e12('0x4'));var BPromise=require(_0x2e12('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2e12('0x6'));var sox=require('sox');var csv=require(_0x2e12('0x7'));var ejs=require(_0x2e12('0x8'));var fs=require('fs');var fs_extra=require(_0x2e12('0x9'));var _=require('lodash');var squel=require(_0x2e12('0xa'));var crypto=require(_0x2e12('0xb'));var jsforce=require(_0x2e12('0xc'));var deskjs=require(_0x2e12('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2e12('0xe'));var Papa=require(_0x2e12('0xf'));var Redis=require(_0x2e12('0x10'));var authService=require(_0x2e12('0x11'));var qs=require(_0x2e12('0x12'));var as=require(_0x2e12('0x13'));var hardwareService=require(_0x2e12('0x14'));var logger=require(_0x2e12('0x15'))(_0x2e12('0x16'));var utils=require('../../config/utils');var config=require(_0x2e12('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cddd9,_0x581b69){_0x581b69=_0x581b69||0xcc;return function(_0x36026c){if(_0x36026c){return _0x3cddd9[_0x2e12('0x18')](_0x581b69);}return _0x3cddd9[_0x2e12('0x19')](_0x581b69)[_0x2e12('0x1a')]();};}function respondWithResult(_0x504ae8,_0x420cc9){_0x420cc9=_0x420cc9||0xc8;return function(_0x389361){if(_0x389361){return _0x504ae8['status'](_0x420cc9)['json'](_0x389361);}};}function respondWithFilteredResult(_0x48c331,_0x5e912f){return function(_0x4774ca){if(_0x4774ca){var _0x59a91a=typeof _0x5e912f[_0x2e12('0x1b')]===_0x2e12('0x1c')&&typeof _0x5e912f[_0x2e12('0x1d')]===_0x2e12('0x1c');var _0x22fe74=_0x4774ca[_0x2e12('0x1e')];var _0x1d95f3=_0x59a91a?0x0:_0x5e912f[_0x2e12('0x1b')];var _0x2a8e77=_0x59a91a?_0x4774ca[_0x2e12('0x1e')]:_0x5e912f['offset']+_0x5e912f['limit'];var _0x269bab;if(_0x2a8e77>=_0x22fe74){_0x2a8e77=_0x22fe74;_0x269bab=0xc8;}else{_0x269bab=0xce;}_0x48c331[_0x2e12('0x19')](_0x269bab);return _0x48c331['set'](_0x2e12('0x1f'),_0x1d95f3+'-'+_0x2a8e77+'/'+_0x22fe74)['json'](_0x4774ca);}return null;};}function patchUpdates(_0x5d42c3){return function(_0x4375e7){try{jsonpatch[_0x2e12('0x20')](_0x4375e7,_0x5d42c3,!![]);}catch(_0x2cc4c9){return BPromise['reject'](_0x2cc4c9);}return _0x4375e7[_0x2e12('0x21')]();};}function saveUpdates(_0x2a4837,_0x83011){return function(_0x2a3c2e){if(_0x2a3c2e){return _0x2a3c2e['update'](_0x2a4837)['then'](function(_0x110f27){return _0x110f27;});}return null;};}function removeEntity(_0x139aa8,_0x1846b9){return function(_0xfe36eb){if(_0xfe36eb){return _0xfe36eb[_0x2e12('0x22')]()[_0x2e12('0x23')](function(){var _0x2504a1=_0xfe36eb[_0x2e12('0x24')]({'plain':!![]});var _0x32dac3='Variables';return db[_0x2e12('0x25')]['destroy']({'where':{'type':_0x32dac3,'resourceId':_0x2504a1['id']}})[_0x2e12('0x23')](function(){return _0xfe36eb;});})[_0x2e12('0x23')](function(){_0x139aa8['status'](0xcc)[_0x2e12('0x1a')]();});}};}function handleEntityNotFound(_0x354a66,_0x4e182a){return function(_0x52969b){if(!_0x52969b){_0x354a66[_0x2e12('0x18')](0x194);}return _0x52969b;};}function handleError(_0x14225e,_0xe98543){_0xe98543=_0xe98543||0x1f4;return function(_0x3b872e){logger['error'](_0x3b872e[_0x2e12('0x26')]);if(_0x3b872e[_0x2e12('0x27')]){delete _0x3b872e[_0x2e12('0x27')];}_0x14225e[_0x2e12('0x19')](_0xe98543)[_0x2e12('0x28')](_0x3b872e);};}exports[_0x2e12('0x29')]=function(_0x1fd77f,_0x38e309){var _0x46a50e={},_0x7724fb={},_0x4a785a={'count':0x0,'rows':[]};var _0x334b2e=_[_0x2e12('0x2a')](db[_0x2e12('0x2b')][_0x2e12('0x2c')],function(_0x4e3c00){return{'name':_0x4e3c00[_0x2e12('0x2d')],'type':_0x4e3c00[_0x2e12('0x2e')][_0x2e12('0x2f')]};});_0x7724fb[_0x2e12('0x30')]=_[_0x2e12('0x2a')](_0x334b2e,_0x2e12('0x27'));_0x7724fb[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0x1fd77f[_0x2e12('0x31')]);_0x7724fb[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x7724fb['model'],_0x7724fb['query']);_0x46a50e['attributes']=_[_0x2e12('0x34')](_0x7724fb['model'],qs['fields'](_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x35')]));_0x46a50e['attributes']=_0x46a50e[_0x2e12('0x36')][_0x2e12('0x37')]?_0x46a50e[_0x2e12('0x36')]:_0x7724fb[_0x2e12('0x30')];if(!_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x38')](_0x2e12('0x39'))){_0x46a50e['limit']=qs[_0x2e12('0x1d')](_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x1d')]);_0x46a50e[_0x2e12('0x1b')]=qs[_0x2e12('0x1b')](_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x1b')]);}_0x46a50e['order']=qs[_0x2e12('0x3a')](_0x1fd77f[_0x2e12('0x31')]['sort']);_0x46a50e['where']=qs['filters'](_['pick'](_0x1fd77f['query'],_0x7724fb[_0x2e12('0x33')]),_0x334b2e);if(_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x3b')]){_0x46a50e[_0x2e12('0x3c')]=_[_0x2e12('0x3d')](_0x46a50e[_0x2e12('0x3c')],{'$or':_[_0x2e12('0x2a')](_0x334b2e,function(_0xfcce9){if(_0xfcce9[_0x2e12('0x2e')]!=='VIRTUAL'){var _0x2633af={};_0x2633af[_0xfcce9[_0x2e12('0x27')]]={'$like':'%'+_0x1fd77f['query'][_0x2e12('0x3b')]+'%'};return _0x2633af;}})});}_0x46a50e=_['merge']({},_0x46a50e,_0x1fd77f['options']);var _0x202def={'where':_0x46a50e[_0x2e12('0x3c')]};return db[_0x2e12('0x2b')]['count'](_0x202def)['then'](function(_0x1ab9fb){_0x4a785a[_0x2e12('0x1e')]=_0x1ab9fb;if(_0x1fd77f[_0x2e12('0x31')][_0x2e12('0x3e')]){_0x46a50e[_0x2e12('0x3f')]=[{'all':!![]}];}return db['Variable'][_0x2e12('0x40')](_0x46a50e);})['then'](function(_0x354166){_0x4a785a[_0x2e12('0x41')]=_0x354166;return _0x4a785a;})[_0x2e12('0x23')](respondWithFilteredResult(_0x38e309,_0x46a50e))[_0x2e12('0x42')](handleError(_0x38e309,null));};exports[_0x2e12('0x43')]=function(_0x2c7413,_0x758004){var _0x5cbf24={'raw':!![],'where':{'id':_0x2c7413['params']['id']}},_0x495704={};_0x495704[_0x2e12('0x30')]=_[_0x2e12('0x32')](db[_0x2e12('0x2b')][_0x2e12('0x2c')]);_0x495704[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0x2c7413[_0x2e12('0x31')]);_0x495704[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x495704[_0x2e12('0x30')],_0x495704[_0x2e12('0x31')]);_0x5cbf24['attributes']=_[_0x2e12('0x34')](_0x495704[_0x2e12('0x30')],qs[_0x2e12('0x35')](_0x2c7413[_0x2e12('0x31')][_0x2e12('0x35')]));_0x5cbf24[_0x2e12('0x36')]=_0x5cbf24[_0x2e12('0x36')][_0x2e12('0x37')]?_0x5cbf24[_0x2e12('0x36')]:_0x495704['model'];if(_0x2c7413[_0x2e12('0x31')]['includeAll']){_0x5cbf24[_0x2e12('0x3f')]=[{'all':!![]}];}_0x5cbf24=_[_0x2e12('0x3d')]({},_0x5cbf24,_0x2c7413[_0x2e12('0x44')]);return db[_0x2e12('0x2b')][_0x2e12('0x45')](_0x5cbf24)['then'](handleEntityNotFound(_0x758004,null))[_0x2e12('0x23')](respondWithResult(_0x758004,null))[_0x2e12('0x42')](handleError(_0x758004,null));};exports[_0x2e12('0x46')]=function(_0x2feceb,_0x10f5e3){return db[_0x2e12('0x2b')]['create'](_0x2feceb['body'],{})['then'](function(_0x10967b){var _0xa6555b=_0x2feceb[_0x2e12('0x47')][_0x2e12('0x24')]({'plain':!![]});if(!_0xa6555b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa6555b[_0x2e12('0x48')]===_0x2e12('0x47')){var _0x2fdd1b=_0x10967b[_0x2e12('0x24')]({'plain':!![]});var _0x297f89='Variables';return db[_0x2e12('0x49')][_0x2e12('0x45')]({'where':{'name':_0x297f89,'userProfileId':_0xa6555b['userProfileId']},'raw':!![]})[_0x2e12('0x23')](function(_0x153a38){if(_0x153a38&&_0x153a38[_0x2e12('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x2fdd1b[_0x2e12('0x27')],'resourceId':_0x2fdd1b['id'],'type':_0x153a38['name'],'sectionId':_0x153a38['id']},{})[_0x2e12('0x23')](function(){return _0x10967b;});}else{return _0x10967b;}})[_0x2e12('0x42')](function(_0x202a5d){logger['error'](_0x2e12('0x4b'),_0x202a5d);throw _0x202a5d;});}return _0x10967b;})[_0x2e12('0x23')](respondWithResult(_0x10f5e3,0xc9))[_0x2e12('0x42')](handleError(_0x10f5e3,null));};exports[_0x2e12('0x4c')]=function(_0x46cd5e,_0x6bc410){if(_0x46cd5e['body']['id']){delete _0x46cd5e[_0x2e12('0x4d')]['id'];}return db[_0x2e12('0x2b')]['find']({'where':{'id':_0x46cd5e[_0x2e12('0x4e')]['id']}})['then'](handleEntityNotFound(_0x6bc410,null))['then'](saveUpdates(_0x46cd5e['body'],null))[_0x2e12('0x23')](respondWithResult(_0x6bc410,null))['catch'](handleError(_0x6bc410,null));};exports[_0x2e12('0x22')]=function(_0x460f0e,_0x57dcc6){return db[_0x2e12('0x2b')]['find']({'where':{'id':_0x460f0e[_0x2e12('0x4e')]['id']}})[_0x2e12('0x23')](handleEntityNotFound(_0x57dcc6,null))[_0x2e12('0x23')](removeEntity(_0x57dcc6,null))[_0x2e12('0x42')](handleError(_0x57dcc6,null));}; \ No newline at end of file +var _0x138a=['UserProfileResource','end','error','name','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Variable','includeAll','include','rows','catch','show','params','options','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Variables'];(function(_0x3743a9,_0x23d081){var _0x1648ac=function(_0x3e8abe){while(--_0x3e8abe){_0x3743a9['push'](_0x3743a9['shift']());}};_0x1648ac(++_0x23d081);}(_0x138a,0xd0));var _0xa138=function(_0x5967c0,_0x452377){_0x5967c0=_0x5967c0-0x0;var _0x2ad249=_0x138a[_0x5967c0];return _0x2ad249;};'use strict';var emlformat=require(_0xa138('0x0'));var rimraf=require(_0xa138('0x1'));var zipdir=require(_0xa138('0x2'));var jsonpatch=require(_0xa138('0x3'));var rp=require(_0xa138('0x4'));var moment=require(_0xa138('0x5'));var BPromise=require(_0xa138('0x6'));var Mustache=require('mustache');var util=require(_0xa138('0x7'));var path=require(_0xa138('0x8'));var sox=require(_0xa138('0x9'));var csv=require(_0xa138('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa138('0xb'));var _=require(_0xa138('0xc'));var squel=require(_0xa138('0xd'));var crypto=require('crypto');var jsforce=require(_0xa138('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa138('0xa'));var querystring=require(_0xa138('0xf'));var Papa=require(_0xa138('0x10'));var Redis=require(_0xa138('0x11'));var authService=require(_0xa138('0x12'));var qs=require(_0xa138('0x13'));var as=require(_0xa138('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa138('0x15'))(_0xa138('0x16'));var utils=require(_0xa138('0x17'));var config=require(_0xa138('0x18'));var licenseUtil=require(_0xa138('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16f80d,_0x263a0a){_0x263a0a=_0x263a0a||0xcc;return function(_0x478f1e){if(_0x478f1e){return _0x16f80d[_0xa138('0x1a')](_0x263a0a);}return _0x16f80d[_0xa138('0x1b')](_0x263a0a)['end']();};}function respondWithResult(_0x211469,_0x325c5c){_0x325c5c=_0x325c5c||0xc8;return function(_0x51c7df){if(_0x51c7df){return _0x211469[_0xa138('0x1b')](_0x325c5c)[_0xa138('0x1c')](_0x51c7df);}};}function respondWithFilteredResult(_0x23785c,_0x38149b){return function(_0x4eb2c8){if(_0x4eb2c8){var _0x5e31dc=typeof _0x38149b[_0xa138('0x1d')]===_0xa138('0x1e')&&typeof _0x38149b[_0xa138('0x1f')]==='undefined';var _0x4ea265=_0x4eb2c8[_0xa138('0x20')];var _0x1f79e6=_0x5e31dc?0x0:_0x38149b[_0xa138('0x1d')];var _0x21e609=_0x5e31dc?_0x4eb2c8[_0xa138('0x20')]:_0x38149b['offset']+_0x38149b[_0xa138('0x1f')];var _0x5effa7;if(_0x21e609>=_0x4ea265){_0x21e609=_0x4ea265;_0x5effa7=0xc8;}else{_0x5effa7=0xce;}_0x23785c[_0xa138('0x1b')](_0x5effa7);return _0x23785c[_0xa138('0x21')](_0xa138('0x22'),_0x1f79e6+'-'+_0x21e609+'/'+_0x4ea265)['json'](_0x4eb2c8);}return null;};}function patchUpdates(_0xc3e9ee){return function(_0x489132){try{jsonpatch[_0xa138('0x23')](_0x489132,_0xc3e9ee,!![]);}catch(_0x4a3038){return BPromise[_0xa138('0x24')](_0x4a3038);}return _0x489132[_0xa138('0x25')]();};}function saveUpdates(_0x573936,_0x3be0e2){return function(_0x40e695){if(_0x40e695){return _0x40e695['update'](_0x573936)[_0xa138('0x26')](function(_0x979296){return _0x979296;});}return null;};}function removeEntity(_0x41d1eb,_0x1f9346){return function(_0x45cee5){if(_0x45cee5){return _0x45cee5[_0xa138('0x27')]()['then'](function(){var _0x23b787=_0x45cee5['get']({'plain':!![]});var _0x9f172a=_0xa138('0x28');return db[_0xa138('0x29')][_0xa138('0x27')]({'where':{'type':_0x9f172a,'resourceId':_0x23b787['id']}})['then'](function(){return _0x45cee5;});})[_0xa138('0x26')](function(){_0x41d1eb[_0xa138('0x1b')](0xcc)[_0xa138('0x2a')]();});}};}function handleEntityNotFound(_0x3fec18,_0x1b78d4){return function(_0x27a065){if(!_0x27a065){_0x3fec18[_0xa138('0x1a')](0x194);}return _0x27a065;};}function handleError(_0x30c85b,_0x24806d){_0x24806d=_0x24806d||0x1f4;return function(_0x3c83be){logger[_0xa138('0x2b')](_0x3c83be['stack']);if(_0x3c83be[_0xa138('0x2c')]){delete _0x3c83be['name'];}_0x30c85b[_0xa138('0x1b')](_0x24806d)['send'](_0x3c83be);};}exports['index']=function(_0x1253e2,_0x13c564){var _0x365544={},_0x13fc36={},_0x53eeb6={'count':0x0,'rows':[]};var _0x5d27b1=_[_0xa138('0x2d')](db['Variable'][_0xa138('0x2e')],function(_0x1630f8){return{'name':_0x1630f8['fieldName'],'type':_0x1630f8[_0xa138('0x2f')][_0xa138('0x30')]};});_0x13fc36['model']=_['map'](_0x5d27b1,_0xa138('0x2c'));_0x13fc36[_0xa138('0x31')]=_[_0xa138('0x32')](_0x1253e2['query']);_0x13fc36[_0xa138('0x33')]=_[_0xa138('0x34')](_0x13fc36[_0xa138('0x35')],_0x13fc36[_0xa138('0x31')]);_0x365544[_0xa138('0x36')]=_[_0xa138('0x34')](_0x13fc36[_0xa138('0x35')],qs[_0xa138('0x37')](_0x1253e2[_0xa138('0x31')]['fields']));_0x365544[_0xa138('0x36')]=_0x365544[_0xa138('0x36')][_0xa138('0x38')]?_0x365544[_0xa138('0x36')]:_0x13fc36[_0xa138('0x35')];if(!_0x1253e2[_0xa138('0x31')][_0xa138('0x39')](_0xa138('0x3a'))){_0x365544[_0xa138('0x1f')]=qs[_0xa138('0x1f')](_0x1253e2[_0xa138('0x31')][_0xa138('0x1f')]);_0x365544[_0xa138('0x1d')]=qs['offset'](_0x1253e2['query']['offset']);}_0x365544['order']=qs[_0xa138('0x3b')](_0x1253e2[_0xa138('0x31')][_0xa138('0x3b')]);_0x365544[_0xa138('0x3c')]=qs['filters'](_[_0xa138('0x3d')](_0x1253e2[_0xa138('0x31')],_0x13fc36['filters']),_0x5d27b1);if(_0x1253e2[_0xa138('0x31')][_0xa138('0x3e')]){_0x365544[_0xa138('0x3c')]=_[_0xa138('0x3f')](_0x365544[_0xa138('0x3c')],{'$or':_['map'](_0x5d27b1,function(_0x2dde47){if(_0x2dde47['type']!==_0xa138('0x40')){var _0x569cda={};_0x569cda[_0x2dde47[_0xa138('0x2c')]]={'$like':'%'+_0x1253e2['query'][_0xa138('0x3e')]+'%'};return _0x569cda;}})});}_0x365544=_[_0xa138('0x3f')]({},_0x365544,_0x1253e2['options']);var _0x415e7f={'where':_0x365544[_0xa138('0x3c')]};return db[_0xa138('0x41')][_0xa138('0x20')](_0x415e7f)['then'](function(_0x4bc113){_0x53eeb6['count']=_0x4bc113;if(_0x1253e2['query'][_0xa138('0x42')]){_0x365544[_0xa138('0x43')]=[{'all':!![]}];}return db[_0xa138('0x41')]['findAll'](_0x365544);})[_0xa138('0x26')](function(_0x173781){_0x53eeb6[_0xa138('0x44')]=_0x173781;return _0x53eeb6;})[_0xa138('0x26')](respondWithFilteredResult(_0x13c564,_0x365544))[_0xa138('0x45')](handleError(_0x13c564,null));};exports[_0xa138('0x46')]=function(_0x20f443,_0x2d0ff0){var _0x149872={'raw':!![],'where':{'id':_0x20f443[_0xa138('0x47')]['id']}},_0x26c2f4={};_0x26c2f4[_0xa138('0x35')]=_[_0xa138('0x32')](db['Variable'][_0xa138('0x2e')]);_0x26c2f4[_0xa138('0x31')]=_[_0xa138('0x32')](_0x20f443['query']);_0x26c2f4[_0xa138('0x33')]=_[_0xa138('0x34')](_0x26c2f4['model'],_0x26c2f4['query']);_0x149872[_0xa138('0x36')]=_[_0xa138('0x34')](_0x26c2f4['model'],qs[_0xa138('0x37')](_0x20f443[_0xa138('0x31')][_0xa138('0x37')]));_0x149872[_0xa138('0x36')]=_0x149872[_0xa138('0x36')][_0xa138('0x38')]?_0x149872['attributes']:_0x26c2f4[_0xa138('0x35')];if(_0x20f443[_0xa138('0x31')][_0xa138('0x42')]){_0x149872[_0xa138('0x43')]=[{'all':!![]}];}_0x149872=_[_0xa138('0x3f')]({},_0x149872,_0x20f443[_0xa138('0x48')]);return db['Variable']['find'](_0x149872)[_0xa138('0x26')](handleEntityNotFound(_0x2d0ff0,null))[_0xa138('0x26')](respondWithResult(_0x2d0ff0,null))[_0xa138('0x45')](handleError(_0x2d0ff0,null));};exports[_0xa138('0x49')]=function(_0x5939db,_0x60abbe){return db['Variable'][_0xa138('0x49')](_0x5939db[_0xa138('0x4a')],{})[_0xa138('0x26')](function(_0x2ebe6e){var _0x5a188a=_0x5939db[_0xa138('0x4b')]['get']({'plain':!![]});if(!_0x5a188a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a188a[_0xa138('0x4c')]===_0xa138('0x4b')){var _0x5e0e95=_0x2ebe6e['get']({'plain':!![]});var _0x292f6b=_0xa138('0x28');return db[_0xa138('0x4d')][_0xa138('0x4e')]({'where':{'name':_0x292f6b,'userProfileId':_0x5a188a[_0xa138('0x4f')]},'raw':!![]})[_0xa138('0x26')](function(_0x1226b7){if(_0x1226b7&&_0x1226b7[_0xa138('0x50')]===0x0){return db[_0xa138('0x29')][_0xa138('0x49')]({'name':_0x5e0e95['name'],'resourceId':_0x5e0e95['id'],'type':_0x1226b7[_0xa138('0x2c')],'sectionId':_0x1226b7['id']},{})[_0xa138('0x26')](function(){return _0x2ebe6e;});}else{return _0x2ebe6e;}})[_0xa138('0x45')](function(_0x40b56b){logger['error'](_0xa138('0x51'),_0x40b56b);throw _0x40b56b;});}return _0x2ebe6e;})[_0xa138('0x26')](respondWithResult(_0x60abbe,0xc9))[_0xa138('0x45')](handleError(_0x60abbe,null));};exports[_0xa138('0x52')]=function(_0x155bfc,_0x50fec5){if(_0x155bfc['body']['id']){delete _0x155bfc[_0xa138('0x4a')]['id'];}return db['Variable']['find']({'where':{'id':_0x155bfc[_0xa138('0x47')]['id']}})[_0xa138('0x26')](handleEntityNotFound(_0x50fec5,null))[_0xa138('0x26')](saveUpdates(_0x155bfc[_0xa138('0x4a')],null))[_0xa138('0x26')](respondWithResult(_0x50fec5,null))[_0xa138('0x45')](handleError(_0x50fec5,null));};exports[_0xa138('0x27')]=function(_0x56340e,_0x54cdba){return db[_0xa138('0x41')][_0xa138('0x4e')]({'where':{'id':_0x56340e[_0xa138('0x47')]['id']}})['then'](handleEntityNotFound(_0x54cdba,null))[_0xa138('0x26')](removeEntity(_0x54cdba,null))[_0xa138('0x45')](handleError(_0x54cdba,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index dd1325e..d1af9aa 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 _0x9628=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash'];(function(_0x1e899d,_0x43d3a2){var _0xdda502=function(_0x32230b){while(--_0x32230b){_0x1e899d['push'](_0x1e899d['shift']());}};_0xdda502(++_0x43d3a2);}(_0x9628,0xfb));var _0x8962=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x9628[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x8962('0x0'));var util=require(_0x8962('0x1'));var logger=require(_0x8962('0x2'))(_0x8962('0x3'));var moment=require(_0x8962('0x4'));var BPromise=require(_0x8962('0x5'));var rp=require(_0x8962('0x6'));var fs=require('fs');var path=require(_0x8962('0x7'));var rimraf=require(_0x8962('0x8'));var config=require(_0x8962('0x9'));var attributes=require(_0x8962('0xa'));module['exports']=function(_0x18f3e5,_0x4c7ba){return _0x18f3e5[_0x8962('0xb')](_0x8962('0xc'),attributes,{'tableName':_0x8962('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc578=['bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','../../config/logger','api','moment'];(function(_0x4871a5,_0x581e6f){var _0x55daf5=function(_0x42396b){while(--_0x42396b){_0x4871a5['push'](_0x4871a5['shift']());}};_0x55daf5(++_0x581e6f);}(_0xc578,0x189));var _0x8c57=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc578[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c57('0x0'))(_0x8c57('0x1'));var moment=require(_0x8c57('0x2'));var BPromise=require(_0x8c57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c57('0x4'));var rimraf=require(_0x8c57('0x5'));var config=require(_0x8c57('0x6'));var attributes=require(_0x8c57('0x7'));module[_0x8c57('0x8')]=function(_0x5836f0,_0xabf300){return _0x5836f0[_0x8c57('0x9')]('Variable',attributes,{'tableName':_0x8c57('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 08f877e..74e7758 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2cac50,_0x320bb5){var _0x1b7d73=function(_0x1bca86){while(--_0x1bca86){_0x2cac50['push'](_0x2cac50['shift']());}};_0x1b7d73(++_0x320bb5);}(_0x8ef6,0xf2));var _0x68ef=function(_0xb7603,_0x4a898d){_0xb7603=_0xb7603-0x0;var _0x2d83a5=_0x8ef6[_0xb7603];return _0x2d83a5;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ 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(_0x5e5eeb,_0x478e2f){var _0x4bf915=function(_0x47e34c){while(--_0x47e34c){_0x5e5eeb['push'](_0x5e5eeb['shift']());}};_0x4bf915(++_0x478e2f);}(_0xf494,0x1c6));var _0x4f49=function(_0x2ffddd,_0x138985){_0x2ffddd=_0x2ffddd-0x0;var _0x53b8af=_0xf494[_0x2ffddd];return _0x53b8af;};'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 c67c583..5fbc350 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 _0x7bc7=['isAuthenticated','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','/fetch','canUpdate','fetch','get','/reset','reset','pull'];(function(_0x5596c5,_0x5cbc3e){var _0x2d8b08=function(_0x176006){while(--_0x176006){_0x5596c5['push'](_0x5596c5['shift']());}};_0x2d8b08(++_0x5cbc3e);}(_0x7bc7,0x1a8));var _0x77bc=function(_0x1c559a,_0x5a1566){_0x1c559a=_0x1c559a-0x0;var _0x46be8e=_0x7bc7[_0x1c559a];return _0x46be8e;};'use strict';var express=require(_0x77bc('0x0'));var router=express[_0x77bc('0x1')]();var auth=require(_0x77bc('0x2'));var controller=require(_0x77bc('0x3'));router['get']('/',controller['index']);router['get'](_0x77bc('0x4'),auth['isAuthenticated'](),auth[_0x77bc('0x5')](),controller[_0x77bc('0x6')]);router[_0x77bc('0x7')](_0x77bc('0x8'),auth['isAuthenticated'](),auth[_0x77bc('0x5')](),controller[_0x77bc('0x9')]);router['get']('/pull',auth['isAuthenticated'](),auth[_0x77bc('0x5')](),controller[_0x77bc('0xa')]);router[_0x77bc('0x7')]('/restart',auth[_0x77bc('0xb')](),controller[_0x77bc('0xc')]);router[_0x77bc('0x7')](_0x77bc('0xd'),controller['migrations']);module[_0x77bc('0xe')]=router; \ No newline at end of file +var _0x00b5=['/migrations','exports','Router','./version.controller','index','get','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart'];(function(_0x3a9ce7,_0xb6c653){var _0x30d294=function(_0x29806e){while(--_0x29806e){_0x3a9ce7['push'](_0x3a9ce7['shift']());}};_0x30d294(++_0xb6c653);}(_0x00b5,0x198));var _0x500b=function(_0x63eeb1,_0x8098b3){_0x63eeb1=_0x63eeb1-0x0;var _0x27e078=_0x00b5[_0x63eeb1];return _0x27e078;};'use strict';var express=require('express');var router=express[_0x500b('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x500b('0x1'));router['get']('/',controller[_0x500b('0x2')]);router[_0x500b('0x3')]('/fetch',auth[_0x500b('0x4')](),auth[_0x500b('0x5')](),controller[_0x500b('0x6')]);router[_0x500b('0x3')]('/reset',auth['isAuthenticated'](),auth[_0x500b('0x5')](),controller[_0x500b('0x7')]);router[_0x500b('0x3')](_0x500b('0x8'),auth['isAuthenticated'](),auth[_0x500b('0x5')](),controller[_0x500b('0x9')]);router['get'](_0x500b('0xa'),auth[_0x500b('0x4')](),controller[_0x500b('0xb')]);router[_0x500b('0x3')](_0x500b('0xc'),controller['migrations']);module[_0x500b('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ff80740..25bdd4e 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 _0x7efb=['catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','child_process','../../mysqldb','../../config/pm2','simple-git','root','index','exports','query','latest','fetch','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last'];(function(_0x3cb0b7,_0x253c30){var _0x3c13e8=function(_0xf87db0){while(--_0xf87db0){_0x3cb0b7['push'](_0x3cb0b7['shift']());}};_0x3c13e8(++_0x253c30);}(_0x7efb,0x19b));var _0xb7ef=function(_0x2290a8,_0x4163ed){_0x2290a8=_0x2290a8-0x0;var _0x40e837=_0x7efb[_0x2290a8];return _0x40e837;};'use strict';var Umzug=require(_0xb7ef('0x0'));var path=require(_0xb7ef('0x1'));var fs=require('fs');var _=require(_0xb7ef('0x2'));var pkginfo=require('pkginfo')(module,_0xb7ef('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xb7ef('0x4'))['exec'];var db=require(_0xb7ef('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0xb7ef('0x6'));var logger=require('../../config/logger')('update');var git=require(_0xb7ef('0x7'))(config[_0xb7ef('0x8')]);exports[_0xb7ef('0x9')]=function(_0xb59168,_0x1ab0f2){var _0x709f1f={'current':module[_0xb7ef('0xa')][_0xb7ef('0x3')],'phonebar':0x2};if(_0xb59168[_0xb7ef('0xb')]&&_0xb59168[_0xb7ef('0xb')][_0xb7ef('0xc')]){return git[_0xb7ef('0xd')]()['tags'](function(_0x5f0d7e,_0x59469e){_0x709f1f[_0xb7ef('0xc')]=(_0x5f0d7e?module[_0xb7ef('0xa')][_0xb7ef('0x3')]:_0x59469e[_0xb7ef('0xc')])||'2.0.0';return _0x1ab0f2[_0xb7ef('0xe')](0xc8)[_0xb7ef('0xf')](_0x709f1f);});}else{return _0x1ab0f2['status'](0xc8)[_0xb7ef('0xf')](_0x709f1f);}};exports['fetch']=function(_0x5b4131,_0x2d783e){return git[_0xb7ef('0xd')]([_0xb7ef('0x10'),_0xb7ef('0x11')],function(_0x105634){if(_0x105634){logger[_0xb7ef('0x12')](_0x105634);return _0x2d783e[_0xb7ef('0xe')](0x1f4)[_0xb7ef('0xf')](_0x105634);}logger['info'](_0xb7ef('0x13'));return _0x2d783e[_0xb7ef('0xe')](0xc8)[_0xb7ef('0xf')]({'output':_0xb7ef('0x14')});});};exports[_0xb7ef('0x15')]=function(_0x26af37,_0x3c1211){return git[_0xb7ef('0x15')]([_0xb7ef('0x16'),_0xb7ef('0x17')],function(_0x273c88){if(_0x273c88){logger[_0xb7ef('0x12')](_0x273c88);return _0x3c1211[_0xb7ef('0xe')](0x1f4)[_0xb7ef('0xf')](_0x273c88);}logger[_0xb7ef('0x18')](_0xb7ef('0x19'));return _0x3c1211['status'](0xc8)[_0xb7ef('0xf')]({'output':_0xb7ef('0x1a')});});};exports[_0xb7ef('0x1b')]=function(_0x2ad3f5,_0x429b56){exec(_0xb7ef('0x1c'),function(_0x3236d8,_0x3087f0,_0x5c4ec9){logger['info'](_0x3087f0);logger[_0xb7ef('0x18')](_0x5c4ec9);if(_0x3236d8){logger[_0xb7ef('0x12')](_0x3236d8);return _0x429b56['status'](0x1f4)[_0xb7ef('0xf')](_0x3236d8);}return _0x429b56[_0xb7ef('0xe')](0xc8)[_0xb7ef('0xf')]({'output':_0x3087f0});});};exports[_0xb7ef('0x1d')]=function(_0x26fec2,_0x25b268){return pm2['restart'](_0xb7ef('0x1e'))[_0xb7ef('0x1f')](function(_0x4c13d6){logger[_0xb7ef('0x18')]('pm2\x20restart\x20motion\x20%s',_0x4c13d6);return _0x25b268['status'](0xc8)['json']({'output':_0xb7ef('0x20')});})['catch'](function(_0x105ed7){logger[_0xb7ef('0x12')](_0x105ed7);return _0x25b268['status'](0x1f4)[_0xb7ef('0xf')](_0x105ed7);});};exports[_0xb7ef('0x21')]=function(_0x430786,_0x81bd25){var _0x2e76b2=fs[_0xb7ef('0x22')](path[_0xb7ef('0x23')](config[_0xb7ef('0x8')],_0xb7ef('0x24'),_0xb7ef('0x21')));var _0x3b2138=[];for(var _0x5178c0=0x0;_0x5178c0<_0x2e76b2[_0xb7ef('0x25')];_0x5178c0++){var _0x224b04=_0x2e76b2[_0x5178c0][_0xb7ef('0x26')](_0xb7ef('0x27'),'');if(compareVersions(module[_0xb7ef('0xa')]['version'],_0x224b04)===-0x1){_0x3b2138[_0xb7ef('0x28')](_0x224b04);}}if(_0x3b2138[_0xb7ef('0x25')]){var _0x339fb5=_0x3b2138['sort'](compareVersions);var _0x3a3805=new Umzug({'storage':_0xb7ef('0x29'),'storageOptions':{'model':db[_0xb7ef('0x2a')],'modelName':'Migration','columnName':_0xb7ef('0x3')},'migrations':{'params':[db[_0xb7ef('0x29')][_0xb7ef('0x2b')](),db['sequelize']['constructor'],function(){throw new Error(_0xb7ef('0x2c'));}],'path':path['join'](config['root'],_0xb7ef('0x24'),_0xb7ef('0x21')),'pattern':/\.js$/}});_0x3a3805['up']({'migrations':_[_0xb7ef('0x2d')](_0x339fb5,function(_0x5ab0fc){return _0x5ab0fc+_0xb7ef('0x27');})})[_0xb7ef('0x1f')](function(){return _0x81bd25[_0xb7ef('0xe')](0xc8)[_0xb7ef('0xf')]({'output':_0xb7ef('0x2e')+module[_0xb7ef('0xa')][_0xb7ef('0x3')]+'\x20to\x20'+_[_0xb7ef('0x2f')](_0x339fb5),'migrations':_[_0xb7ef('0x23')](_0x339fb5)});})[_0xb7ef('0x30')](function(_0x525c14){if(_0x525c14 instanceof db[_0xb7ef('0x29')][_0xb7ef('0x31')]){return _0x81bd25[_0xb7ef('0xe')](0xc8)['json']({'output':_0xb7ef('0x32')});}else{return _0x81bd25[_0xb7ef('0xe')](0x1f4)[_0xb7ef('0xf')](_0x525c14);}});}else{return _0x81bd25[_0xb7ef('0xe')](0xc8)[_0xb7ef('0xf')]({'output':_0xb7ef('0x32')});}}; \ No newline at end of file +var _0xa5ed=['length','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/logger','update','simple-git','root','index','exports','latest','fetch','tags','status','origin','master','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','migrations','join','server','replace','push'];(function(_0x19681e,_0x539496){var _0x284bee=function(_0x42b825){while(--_0x42b825){_0x19681e['push'](_0x19681e['shift']());}};_0x284bee(++_0x539496);}(_0xa5ed,0x14c));var _0xda5e=function(_0x2dcd63,_0x2b9edd){_0x2dcd63=_0x2dcd63-0x0;var _0x4f9dbf=_0xa5ed[_0x2dcd63];return _0x4f9dbf;};'use strict';var Umzug=require(_0xda5e('0x0'));var path=require(_0xda5e('0x1'));var fs=require('fs');var _=require(_0xda5e('0x2'));var pkginfo=require(_0xda5e('0x3'))(module,_0xda5e('0x4'));var compareVersions=require(_0xda5e('0x5'));var exec=require(_0xda5e('0x6'))[_0xda5e('0x7')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xda5e('0x8'))(_0xda5e('0x9'));var git=require(_0xda5e('0xa'))(config[_0xda5e('0xb')]);exports[_0xda5e('0xc')]=function(_0x56e980,_0x316ec9){var _0x468daf={'current':module[_0xda5e('0xd')][_0xda5e('0x4')],'phonebar':0x2};if(_0x56e980['query']&&_0x56e980['query'][_0xda5e('0xe')]){return git[_0xda5e('0xf')]()[_0xda5e('0x10')](function(_0x250d5d,_0x832baa){_0x468daf[_0xda5e('0xe')]=(_0x250d5d?module[_0xda5e('0xd')][_0xda5e('0x4')]:_0x832baa[_0xda5e('0xe')])||'2.0.0';return _0x316ec9[_0xda5e('0x11')](0xc8)['json'](_0x468daf);});}else{return _0x316ec9[_0xda5e('0x11')](0xc8)['json'](_0x468daf);}};exports[_0xda5e('0xf')]=function(_0x303428,_0xbe8bc0){return git['fetch']([_0xda5e('0x12'),_0xda5e('0x13')],function(_0x48260f){if(_0x48260f){logger['error'](_0x48260f);return _0xbe8bc0[_0xda5e('0x11')](0x1f4)[_0xda5e('0x14')](_0x48260f);}logger[_0xda5e('0x15')](_0xda5e('0x16'));return _0xbe8bc0['status'](0xc8)[_0xda5e('0x14')]({'output':_0xda5e('0x17')});});};exports[_0xda5e('0x18')]=function(_0x587a80,_0x38620d){return git['reset']([_0xda5e('0x19'),_0xda5e('0x1a')],function(_0x60b814){if(_0x60b814){logger[_0xda5e('0x1b')](_0x60b814);return _0x38620d[_0xda5e('0x11')](0x1f4)[_0xda5e('0x14')](_0x60b814);}logger[_0xda5e('0x15')](_0xda5e('0x1c'));return _0x38620d[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':_0xda5e('0x1d')});});};exports[_0xda5e('0x1e')]=function(_0x22c374,_0x35eca6){exec(_0xda5e('0x1f'),function(_0x15a842,_0x44f62b,_0x154d36){logger['info'](_0x44f62b);logger[_0xda5e('0x15')](_0x154d36);if(_0x15a842){logger[_0xda5e('0x1b')](_0x15a842);return _0x35eca6[_0xda5e('0x11')](0x1f4)[_0xda5e('0x14')](_0x15a842);}return _0x35eca6[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':_0x44f62b});});};exports[_0xda5e('0x20')]=function(_0x51aa77,_0x418888){return pm2[_0xda5e('0x20')](_0xda5e('0x21'))['then'](function(_0x51234a){logger[_0xda5e('0x15')]('pm2\x20restart\x20motion\x20%s',_0x51234a);return _0x418888[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x49bf9e){logger[_0xda5e('0x1b')](_0x49bf9e);return _0x418888[_0xda5e('0x11')](0x1f4)[_0xda5e('0x14')](_0x49bf9e);});};exports[_0xda5e('0x22')]=function(_0x30e6a6,_0x52624f){var _0x590d01=fs['readdirSync'](path[_0xda5e('0x23')](config[_0xda5e('0xb')],_0xda5e('0x24'),_0xda5e('0x22')));var _0x131639=[];for(var _0x485543=0x0;_0x485543<_0x590d01['length'];_0x485543++){var _0x1ee1e2=_0x590d01[_0x485543][_0xda5e('0x25')]('.js','');if(compareVersions(module['exports'][_0xda5e('0x4')],_0x1ee1e2)===-0x1){_0x131639[_0xda5e('0x26')](_0x1ee1e2);}}if(_0x131639[_0xda5e('0x27')]){var _0x512881=_0x131639[_0xda5e('0x28')](compareVersions);var _0x53b13d=new Umzug({'storage':_0xda5e('0x29'),'storageOptions':{'model':db[_0xda5e('0x2a')],'modelName':_0xda5e('0x2a'),'columnName':_0xda5e('0x4')},'migrations':{'params':[db[_0xda5e('0x29')]['getQueryInterface'](),db['sequelize'][_0xda5e('0x2b')],function(){throw new Error(_0xda5e('0x2c'));}],'path':path[_0xda5e('0x23')](config[_0xda5e('0xb')],'server',_0xda5e('0x22')),'pattern':/\.js$/}});_0x53b13d['up']({'migrations':_['map'](_0x512881,function(_0x182c13){return _0x182c13+_0xda5e('0x2d');})})[_0xda5e('0x2e')](function(){return _0x52624f[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':_0xda5e('0x2f')+module[_0xda5e('0xd')][_0xda5e('0x4')]+_0xda5e('0x30')+_[_0xda5e('0x31')](_0x512881),'migrations':_[_0xda5e('0x23')](_0x512881)});})[_0xda5e('0x32')](function(_0x387edc){if(_0x387edc instanceof db['sequelize'][_0xda5e('0x33')]){return _0x52624f[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':_0xda5e('0x34')});}else{return _0x52624f[_0xda5e('0x11')](0x1f4)[_0xda5e('0x14')](_0x387edc);}});}else{return _0x52624f[_0xda5e('0x11')](0xc8)[_0xda5e('0x14')]({'output':_0xda5e('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 382a6bf..386ddbc 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 _0x9a6e=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','create','update','destroy','exports','util'];(function(_0x41e1ce,_0x276056){var _0x941516=function(_0x2fb06e){while(--_0x2fb06e){_0x41e1ce['push'](_0x41e1ce['shift']());}};_0x941516(++_0x276056);}(_0x9a6e,0x6b));var _0xe9a6=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0x9a6e[_0x39a04c];return _0x580cb0;};'use strict';var multer=require('multer');var util=require(_0xe9a6('0x0'));var path=require(_0xe9a6('0x1'));var timeout=require(_0xe9a6('0x2'));var express=require(_0xe9a6('0x3'));var router=express[_0xe9a6('0x4')]();var fs_extra=require(_0xe9a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe9a6('0x6'));var config=require(_0xe9a6('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xe9a6('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9a6('0x9')]);router['get'](_0xe9a6('0xa'),auth[_0xe9a6('0xb')](),controller[_0xe9a6('0xc')]);router[_0xe9a6('0x8')](_0xe9a6('0xd'),auth[_0xe9a6('0xb')](),controller['show']);router['post']('/',auth[_0xe9a6('0xb')](),controller[_0xe9a6('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe9a6('0xf')]);router['delete']('/:id',auth[_0xe9a6('0xb')](),controller[_0xe9a6('0x10')]);module[_0xe9a6('0x11')]=router; \ No newline at end of file +var _0x6ec2=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x29e0da,_0x38167a){var _0x3dcc82=function(_0x1748fb){while(--_0x1748fb){_0x29e0da['push'](_0x29e0da['shift']());}};_0x3dcc82(++_0x38167a);}(_0x6ec2,0xe7));var _0x26ec=function(_0x39a1db,_0x344ebb){_0x39a1db=_0x39a1db-0x0;var _0x57fb58=_0x6ec2[_0x39a1db];return _0x57fb58;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x26ec('0x3'));var router=express[_0x26ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x5'));var interaction=require(_0x26ec('0x6'));var config=require(_0x26ec('0x7'));var controller=require(_0x26ec('0x8'));router['get']('/',auth[_0x26ec('0x9')](),controller[_0x26ec('0xa')]);router[_0x26ec('0xb')]('/describe',auth[_0x26ec('0x9')](),controller[_0x26ec('0xc')]);router[_0x26ec('0xb')](_0x26ec('0xd'),auth['isAuthenticated'](),controller[_0x26ec('0xe')]);router[_0x26ec('0xf')]('/',auth[_0x26ec('0x9')](),controller[_0x26ec('0x10')]);router[_0x26ec('0x11')](_0x26ec('0xd'),auth[_0x26ec('0x9')](),controller[_0x26ec('0x12')]);router[_0x26ec('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x26ec('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 385d071..101e4ca 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 _0xdfb1=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x5e4f42,_0x296563){var _0x24a54e=function(_0x3e2b49){while(--_0x3e2b49){_0x5e4f42['push'](_0x5e4f42['shift']());}};_0x24a54e(++_0x296563);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2aaf2d,_0x23d9e7){_0x2aaf2d=_0x2aaf2d-0x0;var _0x43cb37=_0xdfb1[_0x2aaf2d];return _0x43cb37;};'use strict';var Sequelize=require(_0x1dfb('0x0'));module[_0x1dfb('0x1')]={'type':{'type':Sequelize[_0x1dfb('0x2')]},'uniqueid':{'type':Sequelize[_0x1dfb('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1dfb('0x2')]},'queue':{'type':Sequelize[_0x1dfb('0x2')]},'interface':{'type':Sequelize[_0x1dfb('0x2')]},'membername':{'type':Sequelize[_0x1dfb('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x1dfb('0x3')]},'agentdumpAt':{'type':Sequelize[_0x1dfb('0x3')]},'holdtime':{'type':Sequelize[_0x1dfb('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1dfb('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1dfb('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1dfb('0x4')]},'agentacw':{'type':Sequelize[_0x1dfb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1dfb('0x2')]},'lastevent':{'type':Sequelize[_0x1dfb('0x2')]},'channel':{'type':Sequelize[_0x1dfb('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1dfb('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1dfb('0x2')]},'connectedlinename':{'type':Sequelize[_0x1dfb('0x2')]},'language':{'type':Sequelize[_0x1dfb('0x2')]},'accountcode':{'type':Sequelize[_0x1dfb('0x2')]},'context':{'type':Sequelize[_0x1dfb('0x2')]},'exten':{'type':Sequelize[_0x1dfb('0x2')]},'priority':{'type':Sequelize[_0x1dfb('0x2')]},'destchannel':{'type':Sequelize[_0x1dfb('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x1dfb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1dfb('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x1dfb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1dfb('0x2')]},'destlanguage':{'type':Sequelize[_0x1dfb('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x1dfb('0x2')]},'destexten':{'type':Sequelize[_0x1dfb('0x2')]},'destpriority':{'type':Sequelize[_0x1dfb('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1dfb('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x1dfb('0x2')]},'transfer':{'type':Sequelize[_0x1dfb('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1dfb('0x6')},'transferexten':{'type':Sequelize[_0x1dfb('0x2')]},'transferuniqueid':{'type':Sequelize[_0x1dfb('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4cf8=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x59081b,_0x9d7590){var _0x1517cd=function(_0x501fa1){while(--_0x501fa1){_0x59081b['push'](_0x59081b['shift']());}};_0x1517cd(++_0x9d7590);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x4cf8[_0x3e32a8];return _0x2997b0;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'type':{'type':Sequelize[_0x84cf('0x2')]},'uniqueid':{'type':Sequelize[_0x84cf('0x2')]},'calleridnum':{'type':Sequelize[_0x84cf('0x2')]},'calleridname':{'type':Sequelize[_0x84cf('0x2')]},'queue':{'type':Sequelize[_0x84cf('0x2')]},'interface':{'type':Sequelize[_0x84cf('0x2')]},'membername':{'type':Sequelize[_0x84cf('0x2')]},'agentcalledAt':{'type':Sequelize[_0x84cf('0x3')]},'agentconnectAt':{'type':Sequelize[_0x84cf('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x84cf('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x84cf('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x84cf('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x84cf('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x84cf('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x84cf('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x84cf('0x2')]},'channel':{'type':Sequelize[_0x84cf('0x2')]},'channelstate':{'type':Sequelize[_0x84cf('0x4')]},'channelstatedesc':{'type':Sequelize[_0x84cf('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x84cf('0x2')]},'language':{'type':Sequelize[_0x84cf('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x84cf('0x2')]},'priority':{'type':Sequelize[_0x84cf('0x2')]},'destchannel':{'type':Sequelize[_0x84cf('0x2')]},'destchannelstate':{'type':Sequelize[_0x84cf('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x84cf('0x2')]},'destcalleridnum':{'type':Sequelize[_0x84cf('0x2')]},'destcalleridname':{'type':Sequelize[_0x84cf('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x84cf('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x84cf('0x2')]},'destlanguage':{'type':Sequelize[_0x84cf('0x2')]},'destaccountcode':{'type':Sequelize[_0x84cf('0x2')]},'destcontext':{'type':Sequelize[_0x84cf('0x2')]},'destexten':{'type':Sequelize[_0x84cf('0x2')]},'destpriority':{'type':Sequelize[_0x84cf('0x2')]},'destuniqueid':{'type':Sequelize[_0x84cf('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x84cf('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x84cf('0x2')]},'transfer':{'type':Sequelize[_0x84cf('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x84cf('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x84cf('0x2')]},'transferuniqueid':{'type':Sequelize[_0x84cf('0x2')]},'agententerreason':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index d8640b3..fa0d8c6 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 33aa35a..0c5e69d 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 _0x83d3=['report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceAgentReport'];(function(_0xef2dad,_0x303142){var _0x5e93e4=function(_0x1b9649){while(--_0x1b9649){_0xef2dad['push'](_0xef2dad['shift']());}};_0x5e93e4(++_0x303142);}(_0x83d3,0x17c));var _0x383d=function(_0x2c4ca7,_0x5abe87){_0x2c4ca7=_0x2c4ca7-0x0;var _0xc82d75=_0x83d3[_0x2c4ca7];return _0xc82d75;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var logger=require(_0x383d('0x2'))(_0x383d('0x3'));var moment=require(_0x383d('0x4'));var BPromise=require('bluebird');var rp=require(_0x383d('0x5'));var fs=require('fs');var path=require(_0x383d('0x6'));var rimraf=require(_0x383d('0x7'));var config=require(_0x383d('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0x383d('0x9')]=function(_0x4f3c10,_0x50eaff){return _0x4f3c10[_0x383d('0xa')](_0x383d('0xb'),attributes,{'tableName':_0x383d('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x383d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99c9=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x112db5,_0x38a06d){var _0x1d7d06=function(_0x44571e){while(--_0x44571e){_0x112db5['push'](_0x112db5['shift']());}};_0x1d7d06(++_0x38a06d);}(_0x99c9,0x13c));var _0x999c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x99c9[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[{'fields':[_0x999c('0xe'),_0x999c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 47ec64d..2b594df 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 _0xf7fe=['http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xf7fe,0x198));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef7f('0x0'));var util=require(_0xef7f('0x1'));var moment=require(_0xef7f('0x2'));var BPromise=require(_0xef7f('0x3'));var rs=require(_0xef7f('0x4'));var fs=require('fs');var Redis=require(_0xef7f('0x5'));var db=require(_0xef7f('0x6'))['db'];var utils=require(_0xef7f('0x7'));var logger=require(_0xef7f('0x8'))(_0xef7f('0x9'));var config=require(_0xef7f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xef7f('0xb')][_0xef7f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13dfbd,_0x2c9eff,_0x144f5c){return new BPromise(function(_0xc9f21f,_0x3438b9){return client['request'](_0x13dfbd,_0x144f5c)['then'](function(_0x4cdff){logger[_0xef7f('0xd')](_0xef7f('0xe'),_0x2c9eff,_0xef7f('0xf'));logger[_0xef7f('0x10')](_0xef7f('0x11'),_0x2c9eff,'request\x20sent',JSON[_0xef7f('0x12')](_0x4cdff));if(_0x4cdff[_0xef7f('0x13')]){if(_0x4cdff[_0xef7f('0x13')][_0xef7f('0x14')]===0x1f4){logger[_0xef7f('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2c9eff,_0x4cdff[_0xef7f('0x13')][_0xef7f('0x15')]);return _0x3438b9(_0x4cdff['error'][_0xef7f('0x15')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x2c9eff,_0x4cdff[_0xef7f('0x13')][_0xef7f('0x15')]);return _0xc9f21f(_0x4cdff[_0xef7f('0x13')][_0xef7f('0x15')]);}else{logger['info'](_0xef7f('0xe'),_0x2c9eff,_0xef7f('0xf'));_0xc9f21f(_0x4cdff[_0xef7f('0x16')][_0xef7f('0x15')]);}})[_0xef7f('0x17')](function(_0x21fb61){logger['error'](_0xef7f('0xe'),_0x2c9eff,_0x21fb61);_0x3438b9(_0x21fb61);});});}exports['CreateVoiceAgentReport']=function(_0x2da5a7){var _0x7d7e74=this;return new Promise(function(_0x2c317d,_0x37d43b){return db[_0xef7f('0x18')][_0xef7f('0x19')](_0x2da5a7['body'],{'raw':_0x2da5a7[_0xef7f('0x1a')]?_0x2da5a7[_0xef7f('0x1a')][_0xef7f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x449674){logger[_0xef7f('0xd')](_0xef7f('0x1c'),_0x2da5a7);logger[_0xef7f('0x10')](_0xef7f('0x1c'),_0x2da5a7,JSON[_0xef7f('0x12')](_0x449674));_0x2c317d(_0x449674);})[_0xef7f('0x17')](function(_0x1da829){logger['error'](_0xef7f('0x1c'),_0x1da829[_0xef7f('0x15')],_0x2da5a7);_0x37d43b(_0x7d7e74[_0xef7f('0x13')](0x1f4,_0x1da829[_0xef7f('0x15')]));});});};exports[_0xef7f('0x1d')]=function(_0x40c3f3){var _0x48d032=this;return new Promise(function(_0x2f4a29,_0x401811){return db[_0xef7f('0x18')][_0xef7f('0x1e')](_0x40c3f3['body'],{'raw':_0x40c3f3[_0xef7f('0x1a')]?_0x40c3f3[_0xef7f('0x1a')][_0xef7f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c3f3[_0xef7f('0x1a')]?_0x40c3f3[_0xef7f('0x1a')][_0xef7f('0x1f')]||null:null,'attributes':_0x40c3f3['options']?_0x40c3f3[_0xef7f('0x1a')][_0xef7f('0x20')]||null:null,'limit':_0x40c3f3[_0xef7f('0x1a')]?_0x40c3f3['options'][_0xef7f('0x21')]||null:null})[_0xef7f('0x22')](function(_0x273474){logger['info'](_0xef7f('0x1d'),_0x40c3f3);logger[_0xef7f('0x10')](_0xef7f('0x1d'),_0x40c3f3,JSON[_0xef7f('0x12')](_0x273474));_0x2f4a29(_0x273474);})[_0xef7f('0x17')](function(_0x132771){logger['error'](_0xef7f('0x1d'),_0x132771[_0xef7f('0x15')],_0x40c3f3);_0x401811(_0x48d032[_0xef7f('0x13')](0x1f4,_0x132771[_0xef7f('0x15')]));});});}; \ No newline at end of file +var _0xc103=['VoiceAgentReport','create','body','options','raw','debug','catch','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc103,0x19e));var _0x3c10=function(_0x143ebb,_0xcfcb5f){_0x143ebb=_0x143ebb-0x0;var _0x59ac72=_0xc103[_0x143ebb];return _0x59ac72;};'use strict';var _=require(_0x3c10('0x0'));var util=require(_0x3c10('0x1'));var moment=require('moment');var BPromise=require(_0x3c10('0x2'));var rs=require(_0x3c10('0x3'));var fs=require('fs');var Redis=require(_0x3c10('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c10('0x5'))(_0x3c10('0x6'));var config=require('../../config/environment');var jayson=require(_0x3c10('0x7'));var client=jayson[_0x3c10('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a80c3,_0xb2969d,_0xa703f6){return new BPromise(function(_0x37a1f0,_0x474f63){return client[_0x3c10('0x9')](_0x3a80c3,_0xa703f6)[_0x3c10('0xa')](function(_0x255fca){logger[_0x3c10('0xb')](_0x3c10('0xc'),_0xb2969d,_0x3c10('0xd'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0xb2969d,_0x3c10('0xd'),JSON[_0x3c10('0xe')](_0x255fca));if(_0x255fca[_0x3c10('0xf')]){if(_0x255fca[_0x3c10('0xf')][_0x3c10('0x10')]===0x1f4){logger[_0x3c10('0xf')](_0x3c10('0xc'),_0xb2969d,_0x255fca[_0x3c10('0xf')][_0x3c10('0x11')]);return _0x474f63(_0x255fca[_0x3c10('0xf')][_0x3c10('0x11')]);}logger[_0x3c10('0xf')](_0x3c10('0xc'),_0xb2969d,_0x255fca['error'][_0x3c10('0x11')]);return _0x37a1f0(_0x255fca[_0x3c10('0xf')][_0x3c10('0x11')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0xb2969d,_0x3c10('0xd'));_0x37a1f0(_0x255fca[_0x3c10('0x12')][_0x3c10('0x11')]);}})['catch'](function(_0x5f8631){logger[_0x3c10('0xf')](_0x3c10('0xc'),_0xb2969d,_0x5f8631);_0x474f63(_0x5f8631);});});}exports[_0x3c10('0x13')]=function(_0x44f8c7){var _0x21a5db=this;return new Promise(function(_0x1c5a94,_0x41986b){return db[_0x3c10('0x14')][_0x3c10('0x15')](_0x44f8c7[_0x3c10('0x16')],{'raw':_0x44f8c7[_0x3c10('0x17')]?_0x44f8c7[_0x3c10('0x17')][_0x3c10('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xcf252b){logger[_0x3c10('0xb')](_0x3c10('0x13'),_0x44f8c7);logger[_0x3c10('0x19')](_0x3c10('0x13'),_0x44f8c7,JSON[_0x3c10('0xe')](_0xcf252b));_0x1c5a94(_0xcf252b);})[_0x3c10('0x1a')](function(_0x16661e){logger[_0x3c10('0xf')](_0x3c10('0x13'),_0x16661e['message'],_0x44f8c7);_0x41986b(_0x21a5db['error'](0x1f4,_0x16661e[_0x3c10('0x11')]));});});};exports[_0x3c10('0x1b')]=function(_0x375772){var _0x5e6469=this;return new Promise(function(_0x4334a2,_0x5c033c){return db[_0x3c10('0x14')][_0x3c10('0x1c')](_0x375772['body'],{'raw':_0x375772[_0x3c10('0x17')]?_0x375772[_0x3c10('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x375772[_0x3c10('0x17')]?_0x375772['options']['where']||null:null,'attributes':_0x375772[_0x3c10('0x17')]?_0x375772[_0x3c10('0x17')][_0x3c10('0x1d')]||null:null,'limit':_0x375772[_0x3c10('0x17')]?_0x375772[_0x3c10('0x17')][_0x3c10('0x1e')]||null:null})[_0x3c10('0xa')](function(_0xdb5b15){logger[_0x3c10('0xb')](_0x3c10('0x1b'),_0x375772);logger[_0x3c10('0x19')]('UpdateVoiceAgentReport',_0x375772,JSON['stringify'](_0xdb5b15));_0x4334a2(_0xdb5b15);})[_0x3c10('0x1a')](function(_0x4115cf){logger['error']('UpdateVoiceAgentReport',_0x4115cf[_0x3c10('0x11')],_0x375772);_0x5c033c(_0x5e6469['error'](0x1f4,_0x4115cf['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 031c7df..f030a19 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 _0x72b1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x8bee69,_0x3c9bcb){var _0x32068f=function(_0x27da71){while(--_0x27da71){_0x8bee69['push'](_0x8bee69['shift']());}};_0x32068f(++_0x3c9bcb);}(_0x72b1,0x16e));var _0x172b=function(_0x3fe882,_0xfb7a90){_0x3fe882=_0x3fe882-0x0;var _0x40b447=_0x72b1[_0x3fe882];return _0x40b447;};'use strict';var multer=require(_0x172b('0x0'));var util=require('util');var path=require(_0x172b('0x1'));var timeout=require(_0x172b('0x2'));var express=require(_0x172b('0x3'));var router=express[_0x172b('0x4')]();var fs_extra=require(_0x172b('0x5'));var auth=require(_0x172b('0x6'));var interaction=require(_0x172b('0x7'));var config=require('../../config/environment');var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth[_0x172b('0xa')](),controller[_0x172b('0xb')]);router['get'](_0x172b('0xc'),auth['isAuthenticated'](),controller[_0x172b('0xd')]);router['get'](_0x172b('0xe'),auth[_0x172b('0xa')](),controller[_0x172b('0xf')]);router[_0x172b('0x10')]('/',auth['isAuthenticated'](),controller[_0x172b('0x11')]);router[_0x172b('0x12')](_0x172b('0xe'),auth[_0x172b('0xa')](),controller[_0x172b('0x13')]);router[_0x172b('0x14')](_0x172b('0xe'),auth['isAuthenticated'](),controller[_0x172b('0x15')]);module[_0x172b('0x16')]=router; \ No newline at end of file +var _0x950a=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','index','describe'];(function(_0x3261c1,_0x1c3afa){var _0x3ea809=function(_0x279e2c){while(--_0x279e2c){_0x3261c1['push'](_0x3261c1['shift']());}};_0x3ea809(++_0x1c3afa);}(_0x950a,0x111));var _0xa950=function(_0xd053f3,_0x225403){_0xd053f3=_0xd053f3-0x0;var _0x314b96=_0x950a[_0xd053f3];return _0x314b96;};'use strict';var multer=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var path=require(_0xa950('0x2'));var timeout=require(_0xa950('0x3'));var express=require('express');var router=express[_0xa950('0x4')]();var fs_extra=require(_0xa950('0x5'));var auth=require(_0xa950('0x6'));var interaction=require(_0xa950('0x7'));var config=require('../../config/environment');var controller=require(_0xa950('0x8'));router[_0xa950('0x9')]('/',auth['isAuthenticated'](),controller[_0xa950('0xa')]);router[_0xa950('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa950('0xb')]);router[_0xa950('0x9')](_0xa950('0xc'),auth[_0xa950('0xd')](),controller[_0xa950('0xe')]);router[_0xa950('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x10')]);router[_0xa950('0x11')](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x12')]);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 776140f..59e202e 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 _0x5a03=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0xe33eca,_0x332ee5){var _0x2184d6=function(_0x49d39a){while(--_0x49d39a){_0xe33eca['push'](_0xe33eca['shift']());}};_0x2184d6(++_0x332ee5);}(_0x5a03,0x1a8));var _0x35a0=function(_0x5409f9,_0x521329){_0x5409f9=_0x5409f9-0x0;var _0x4f42db=_0x5a03[_0x5409f9];return _0x4f42db;};'use strict';var Sequelize=require(_0x35a0('0x0'));module[_0x35a0('0x1')]={'uniqueid':{'type':Sequelize[_0x35a0('0x2')]},'type':{'type':Sequelize[_0x35a0('0x3')](_0x35a0('0x4'),_0x35a0('0x5'),'outbound',_0x35a0('0x6'),_0x35a0('0x7'),_0x35a0('0x8'))},'tag':{'type':Sequelize[_0x35a0('0x2')]},'accountcode':{'type':Sequelize[_0x35a0('0x2')]},'source':{'type':Sequelize[_0x35a0('0x2')]},'destination':{'type':Sequelize[_0x35a0('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x35a0('0x2')]},'channel':{'type':Sequelize[_0x35a0('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x35a0('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x35a0('0xa')]},'answertime':{'type':Sequelize[_0x35a0('0xa')]},'endtime':{'type':Sequelize[_0x35a0('0xa')]},'duration':{'type':Sequelize[_0x35a0('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x35a0('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x35a0('0x2')]},'amaflags':{'type':Sequelize[_0x35a0('0x2')]},'userfield':{'type':Sequelize[_0x35a0('0x2')]},'userDisposition':{'type':Sequelize[_0x35a0('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x35a0('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x35a0('0x2')]},'note':{'type':Sequelize[_0x35a0('0x2')]},'prefix':{'type':Sequelize[_0x35a0('0x2')]},'routeid':{'type':Sequelize[_0x35a0('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x831b=['outbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax'];(function(_0xbacf50,_0x293f21){var _0x1b224c=function(_0x1a5019){while(--_0x1a5019){_0xbacf50['push'](_0xbacf50['shift']());}};_0x1b224c(++_0x293f21);}(_0x831b,0x160));var _0xb831=function(_0x23bdfd,_0x3eb1ab){_0x23bdfd=_0x23bdfd-0x0;var _0x34340c=_0x831b[_0x23bdfd];return _0x34340c;};'use strict';var Sequelize=require(_0xb831('0x0'));module[_0xb831('0x1')]={'uniqueid':{'type':Sequelize[_0xb831('0x2')]},'type':{'type':Sequelize[_0xb831('0x3')](_0xb831('0x4'),_0xb831('0x5'),_0xb831('0x6'),_0xb831('0x7'),_0xb831('0x8'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb831('0x2')]},'source':{'type':Sequelize[_0xb831('0x2')]},'destination':{'type':Sequelize[_0xb831('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb831('0x2')]},'channel':{'type':Sequelize[_0xb831('0x2')]},'destinationchannel':{'type':Sequelize[_0xb831('0x2')]},'lastapplication':{'type':Sequelize[_0xb831('0x2')]},'lastdata':{'type':Sequelize[_0xb831('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb831('0xa')]},'answertime':{'type':Sequelize[_0xb831('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xb831('0xb')]},'billableseconds':{'type':Sequelize[_0xb831('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb831('0x2')]},'userfield':{'type':Sequelize[_0xb831('0x2')]},'userDisposition':{'type':Sequelize[_0xb831('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xb831('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb831('0x2')]},'note':{'type':Sequelize[_0xb831('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xb831('0xb')]},'sipcallid':{'type':Sequelize[_0xb831('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5e8318e..55eac69 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x550a33,_0xc14e7){var _0x4ee06a=function(_0x347b2d){while(--_0x347b2d){_0x550a33['push'](_0x550a33['shift']());}};_0x4ee06a(++_0xc14e7);}(_0xdb28,0x106));var _0x8db2=function(_0x452741,_0x2354af){_0x452741=_0x452741-0x0;var _0x3910c1=_0xdb28[_0x452741];return _0x3910c1;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a972d,_0x4ca213){_0x2a972d=_0x2a972d-0x0;var _0x2c9446=_0x5f2f[_0x2a972d];return _0x2c9446;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 74ba622..2a3bf5d 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 _0x2b72=['moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','uniqueid','lodash','../../config/logger','api'];(function(_0x2bae44,_0x33f37a){var _0x1e111b=function(_0x4f4cfa){while(--_0x4f4cfa){_0x2bae44['push'](_0x2bae44['shift']());}};_0x1e111b(++_0x33f37a);}(_0x2b72,0x1d1));var _0x22b7=function(_0x4f47d5,_0x14bac5){_0x4f47d5=_0x4f47d5-0x0;var _0x507cc5=_0x2b72[_0x4f47d5];return _0x507cc5;};'use strict';var _=require(_0x22b7('0x0'));var util=require('util');var logger=require(_0x22b7('0x1'))(_0x22b7('0x2'));var moment=require(_0x22b7('0x3'));var BPromise=require(_0x22b7('0x4'));var rp=require(_0x22b7('0x5'));var fs=require('fs');var path=require(_0x22b7('0x6'));var rimraf=require('rimraf');var config=require(_0x22b7('0x7'));var attributes=require(_0x22b7('0x8'));module[_0x22b7('0x9')]=function(_0x38e556,_0x40299c){return _0x38e556['define'](_0x22b7('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x22b7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x521c=['bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','util','../../config/logger','api'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x521c,0x6b));var _0xc521=function(_0x4eab77,_0xec6083){_0x4eab77=_0x4eab77-0x0;var _0xe492b4=_0x521c[_0x4eab77];return _0xe492b4;};'use strict';var _=require('lodash');var util=require(_0xc521('0x0'));var logger=require(_0xc521('0x1'))(_0xc521('0x2'));var moment=require('moment');var BPromise=require(_0xc521('0x3'));var rp=require(_0xc521('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc521('0x5'));var attributes=require(_0xc521('0x6'));module[_0xc521('0x7')]=function(_0x1450a5,_0x356666){return _0x1450a5[_0xc521('0x8')](_0xc521('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xc521('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index cdac81f..5f4b38f 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 _0xb4d5=['info','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','debug','catch','create','CreateVoiceCallReport','UpdateVoiceCallReport','update','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify','code','error','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x110647,_0x2cc892){var _0x9a4928=function(_0x3bd111){while(--_0x3bd111){_0x110647['push'](_0x110647['shift']());}};_0x9a4928(++_0x2cc892);}(_0xb4d5,0x18e));var _0x5b4d=function(_0x84c0ad,_0x5cb972){_0x84c0ad=_0x84c0ad-0x0;var _0x5a023c=_0xb4d5[_0x84c0ad];return _0x5a023c;};'use strict';var _=require(_0x5b4d('0x0'));var util=require(_0x5b4d('0x1'));var moment=require(_0x5b4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b4d('0x3'));var fs=require('fs');var Redis=require(_0x5b4d('0x4'));var db=require(_0x5b4d('0x5'))['db'];var utils=require(_0x5b4d('0x6'));var logger=require(_0x5b4d('0x7'))(_0x5b4d('0x8'));var config=require(_0x5b4d('0x9'));var jayson=require(_0x5b4d('0xa'));var client=jayson['client'][_0x5b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x432f2c,_0x2933ab,_0x1f7084){return new BPromise(function(_0x11afa1,_0x3c0543){return client[_0x5b4d('0xc')](_0x432f2c,_0x1f7084)[_0x5b4d('0xd')](function(_0x1ffe3d){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x2933ab,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2933ab,_0x5b4d('0xe'),JSON[_0x5b4d('0xf')](_0x1ffe3d));if(_0x1ffe3d['error']){if(_0x1ffe3d['error'][_0x5b4d('0x10')]===0x1f4){logger[_0x5b4d('0x11')](_0x5b4d('0x12'),_0x2933ab,_0x1ffe3d[_0x5b4d('0x11')]['message']);return _0x3c0543(_0x1ffe3d[_0x5b4d('0x11')][_0x5b4d('0x13')]);}logger[_0x5b4d('0x11')](_0x5b4d('0x12'),_0x2933ab,_0x1ffe3d[_0x5b4d('0x11')]['message']);return _0x11afa1(_0x1ffe3d[_0x5b4d('0x11')]['message']);}else{logger[_0x5b4d('0x14')](_0x5b4d('0x12'),_0x2933ab,_0x5b4d('0xe'));_0x11afa1(_0x1ffe3d[_0x5b4d('0x15')]['message']);}})['catch'](function(_0x5de922){logger['error'](_0x5b4d('0x12'),_0x2933ab,_0x5de922);_0x3c0543(_0x5de922);});});}exports[_0x5b4d('0x16')]=function(_0x77b592){var _0x3f8f1a=this;return new Promise(function(_0x240c7b,_0x3ec358){return db[_0x5b4d('0x17')][_0x5b4d('0x18')]({'raw':_0x77b592['options']?_0x77b592[_0x5b4d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x77b592[_0x5b4d('0x19')]?_0x77b592['options'][_0x5b4d('0x1a')]||null:null,'attributes':_0x77b592[_0x5b4d('0x19')]?_0x77b592[_0x5b4d('0x19')][_0x5b4d('0x1b')]||null:null,'limit':_0x77b592[_0x5b4d('0x19')]?_0x77b592['options'][_0x5b4d('0x1c')]||null:null,'include':_0x77b592[_0x5b4d('0x19')]?_0x77b592[_0x5b4d('0x19')][_0x5b4d('0x1d')]?_[_0x5b4d('0x1e')](_0x77b592['options'][_0x5b4d('0x1d')],function(_0xf23ae4){return{'model':db[_0xf23ae4['model']],'as':_0xf23ae4['as'],'attributes':_0xf23ae4[_0x5b4d('0x1b')],'include':_0xf23ae4['include']?_[_0x5b4d('0x1e')](_0xf23ae4['include'],function(_0x1162b4){return{'model':db[_0x1162b4['model']],'as':_0x1162b4['as'],'attributes':_0x1162b4['attributes'],'include':_0x1162b4['include']?_[_0x5b4d('0x1e')](_0x1162b4[_0x5b4d('0x1d')],function(_0x1d389f){return{'model':db[_0x1d389f['model']],'as':_0x1d389f['as'],'attributes':_0x1d389f[_0x5b4d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b4d('0xd')](function(_0x4d260a){logger[_0x5b4d('0x14')]('GetVoiceCallReport',_0x77b592);logger[_0x5b4d('0x1f')](_0x5b4d('0x16'),_0x77b592,JSON[_0x5b4d('0xf')](_0x4d260a));_0x240c7b(_0x4d260a);})[_0x5b4d('0x20')](function(_0x398291){logger[_0x5b4d('0x11')](_0x5b4d('0x16'),_0x398291[_0x5b4d('0x13')],_0x77b592);_0x3ec358(_0x3f8f1a[_0x5b4d('0x11')](0x1f4,_0x398291[_0x5b4d('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x482058){var _0x357116=this;return new Promise(function(_0x3d8abf,_0x434cc9){return db[_0x5b4d('0x17')][_0x5b4d('0x21')](_0x482058['body'],{'raw':_0x482058[_0x5b4d('0x19')]?_0x482058[_0x5b4d('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3666a7){logger[_0x5b4d('0x14')]('CreateVoiceCallReport',_0x482058);logger['debug'](_0x5b4d('0x22'),_0x482058,JSON[_0x5b4d('0xf')](_0x3666a7));_0x3d8abf(_0x3666a7);})['catch'](function(_0x20c8f0){logger[_0x5b4d('0x11')](_0x5b4d('0x22'),_0x20c8f0[_0x5b4d('0x13')],_0x482058);_0x434cc9(_0x357116[_0x5b4d('0x11')](0x1f4,_0x20c8f0[_0x5b4d('0x13')]));});});};exports[_0x5b4d('0x23')]=function(_0x568b10){var _0x48d9f8=this;return new Promise(function(_0x451399,_0x42ae0f){return db[_0x5b4d('0x17')][_0x5b4d('0x24')](_0x568b10['body'],{'raw':_0x568b10['options']?_0x568b10[_0x5b4d('0x19')][_0x5b4d('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x568b10[_0x5b4d('0x19')]?_0x568b10[_0x5b4d('0x19')]['where']||null:null,'attributes':_0x568b10[_0x5b4d('0x19')]?_0x568b10[_0x5b4d('0x19')][_0x5b4d('0x1b')]||null:null,'limit':_0x568b10[_0x5b4d('0x19')]?_0x568b10['options'][_0x5b4d('0x1c')]||null:null})['then'](function(_0x354a39){logger[_0x5b4d('0x14')]('UpdateVoiceCallReport',_0x568b10);logger['debug'](_0x5b4d('0x23'),_0x568b10,JSON[_0x5b4d('0xf')](_0x354a39));_0x451399(_0x354a39);})[_0x5b4d('0x20')](function(_0x103a6e){logger[_0x5b4d('0x11')](_0x5b4d('0x23'),_0x103a6e[_0x5b4d('0x13')],_0x568b10);_0x42ae0f(_0x48d9f8['error'](0x1f4,_0x103a6e['message']));});});}; \ No newline at end of file +var _0x9a2c=['limit','include','model','info','body','CreateVoiceCallReport','catch','update','where','UpdateVoiceCallReport','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','options','raw','attributes'];(function(_0x52f242,_0x4765f4){var _0x1be4ad=function(_0xb90d36){while(--_0xb90d36){_0x52f242['push'](_0x52f242['shift']());}};_0x1be4ad(++_0x4765f4);}(_0x9a2c,0xb4));var _0xc9a2=function(_0x51d237,_0x7d1b13){_0x51d237=_0x51d237-0x0;var _0x2eddf5=_0x9a2c[_0x51d237];return _0x2eddf5;};'use strict';var _=require('lodash');var util=require(_0xc9a2('0x0'));var moment=require(_0xc9a2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc9a2('0x2'));var fs=require('fs');var Redis=require(_0xc9a2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9a2('0x4'));var logger=require('../../config/logger')(_0xc9a2('0x5'));var config=require(_0xc9a2('0x6'));var jayson=require(_0xc9a2('0x7'));var client=jayson['client'][_0xc9a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x444a74,_0x2fadcc,_0x503738){return new BPromise(function(_0x15ee96,_0x1c01e0){return client[_0xc9a2('0x9')](_0x444a74,_0x503738)[_0xc9a2('0xa')](function(_0x21e677){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x2fadcc,_0xc9a2('0xb'));logger[_0xc9a2('0xc')](_0xc9a2('0xd'),_0x2fadcc,_0xc9a2('0xb'),JSON[_0xc9a2('0xe')](_0x21e677));if(_0x21e677[_0xc9a2('0xf')]){if(_0x21e677[_0xc9a2('0xf')][_0xc9a2('0x10')]===0x1f4){logger['error'](_0xc9a2('0x11'),_0x2fadcc,_0x21e677['error'][_0xc9a2('0x12')]);return _0x1c01e0(_0x21e677[_0xc9a2('0xf')][_0xc9a2('0x12')]);}logger[_0xc9a2('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2fadcc,_0x21e677['error'][_0xc9a2('0x12')]);return _0x15ee96(_0x21e677[_0xc9a2('0xf')][_0xc9a2('0x12')]);}else{logger['info'](_0xc9a2('0x11'),_0x2fadcc,_0xc9a2('0xb'));_0x15ee96(_0x21e677['result'][_0xc9a2('0x12')]);}})['catch'](function(_0x202a71){logger[_0xc9a2('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2fadcc,_0x202a71);_0x1c01e0(_0x202a71);});});}exports[_0xc9a2('0x13')]=function(_0x214317){var _0x500e69=this;return new Promise(function(_0x4c9524,_0x345a82){return db[_0xc9a2('0x14')]['findAll']({'raw':_0x214317[_0xc9a2('0x15')]?_0x214317[_0xc9a2('0x15')][_0xc9a2('0x16')]===undefined?!![]:![]:!![],'where':_0x214317[_0xc9a2('0x15')]?_0x214317[_0xc9a2('0x15')]['where']||null:null,'attributes':_0x214317[_0xc9a2('0x15')]?_0x214317[_0xc9a2('0x15')][_0xc9a2('0x17')]||null:null,'limit':_0x214317[_0xc9a2('0x15')]?_0x214317['options'][_0xc9a2('0x18')]||null:null,'include':_0x214317[_0xc9a2('0x15')]?_0x214317['options']['include']?_['map'](_0x214317['options'][_0xc9a2('0x19')],function(_0x55f7bb){return{'model':db[_0x55f7bb['model']],'as':_0x55f7bb['as'],'attributes':_0x55f7bb['attributes'],'include':_0x55f7bb[_0xc9a2('0x19')]?_['map'](_0x55f7bb['include'],function(_0x2a9c80){return{'model':db[_0x2a9c80['model']],'as':_0x2a9c80['as'],'attributes':_0x2a9c80[_0xc9a2('0x17')],'include':_0x2a9c80[_0xc9a2('0x19')]?_['map'](_0x2a9c80[_0xc9a2('0x19')],function(_0x808f33){return{'model':db[_0x808f33[_0xc9a2('0x1a')]],'as':_0x808f33['as'],'attributes':_0x808f33[_0xc9a2('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc9a2('0xa')](function(_0x39d82d){logger[_0xc9a2('0x1b')]('GetVoiceCallReport',_0x214317);logger['debug']('GetVoiceCallReport',_0x214317,JSON[_0xc9a2('0xe')](_0x39d82d));_0x4c9524(_0x39d82d);})['catch'](function(_0x1de4e6){logger[_0xc9a2('0xf')](_0xc9a2('0x13'),_0x1de4e6[_0xc9a2('0x12')],_0x214317);_0x345a82(_0x500e69[_0xc9a2('0xf')](0x1f4,_0x1de4e6['message']));});});};exports['CreateVoiceCallReport']=function(_0x40a177){var _0x32524b=this;return new Promise(function(_0x22b9eb,_0x4afb2e){return db[_0xc9a2('0x14')]['create'](_0x40a177[_0xc9a2('0x1c')],{'raw':_0x40a177[_0xc9a2('0x15')]?_0x40a177['options'][_0xc9a2('0x16')]===undefined?!![]:![]:!![]})[_0xc9a2('0xa')](function(_0xcb6b2e){logger['info'](_0xc9a2('0x1d'),_0x40a177);logger['debug'](_0xc9a2('0x1d'),_0x40a177,JSON['stringify'](_0xcb6b2e));_0x22b9eb(_0xcb6b2e);})[_0xc9a2('0x1e')](function(_0x5266ce){logger['error']('CreateVoiceCallReport',_0x5266ce['message'],_0x40a177);_0x4afb2e(_0x32524b['error'](0x1f4,_0x5266ce[_0xc9a2('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x5b2366){var _0x5c94cf=this;return new Promise(function(_0x1bc57c,_0x58ca78){return db[_0xc9a2('0x14')][_0xc9a2('0x1f')](_0x5b2366[_0xc9a2('0x1c')],{'raw':_0x5b2366[_0xc9a2('0x15')]?_0x5b2366[_0xc9a2('0x15')][_0xc9a2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2366['options']?_0x5b2366[_0xc9a2('0x15')][_0xc9a2('0x20')]||null:null,'attributes':_0x5b2366[_0xc9a2('0x15')]?_0x5b2366['options'][_0xc9a2('0x17')]||null:null,'limit':_0x5b2366[_0xc9a2('0x15')]?_0x5b2366[_0xc9a2('0x15')]['limit']||null:null})[_0xc9a2('0xa')](function(_0x8318f5){logger[_0xc9a2('0x1b')](_0xc9a2('0x21'),_0x5b2366);logger[_0xc9a2('0xc')]('UpdateVoiceCallReport',_0x5b2366,JSON[_0xc9a2('0xe')](_0x8318f5));_0x1bc57c(_0x8318f5);})[_0xc9a2('0x1e')](function(_0x1f9934){logger[_0xc9a2('0xf')](_0xc9a2('0x21'),_0x1f9934[_0xc9a2('0x12')],_0x5b2366);_0x58ca78(_0x5c94cf[_0xc9a2('0xf')](0x1f4,_0x1f9934['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7361fc0..c1a4735 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 _0xfac9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x564851,_0x39e8ae){var _0x5bc632=function(_0x5ccde3){while(--_0x5ccde3){_0x564851['push'](_0x564851['shift']());}};_0x5bc632(++_0x39e8ae);}(_0xfac9,0x1d0));var _0x9fac=function(_0x5680af,_0x3396ea){_0x5680af=_0x5680af-0x0;var _0x11cb0e=_0xfac9[_0x5680af];return _0x11cb0e;};'use strict';var multer=require(_0x9fac('0x0'));var util=require('util');var path=require(_0x9fac('0x1'));var timeout=require(_0x9fac('0x2'));var express=require('express');var router=express[_0x9fac('0x3')]();var fs_extra=require(_0x9fac('0x4'));var auth=require(_0x9fac('0x5'));var interaction=require(_0x9fac('0x6'));var config=require(_0x9fac('0x7'));var controller=require(_0x9fac('0x8'));router[_0x9fac('0x9')]('/',auth[_0x9fac('0xa')](),controller[_0x9fac('0xb')]);router[_0x9fac('0x9')](_0x9fac('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9fac('0xa')](),controller[_0x9fac('0xd')]);router[_0x9fac('0xe')](_0x9fac('0xc'),auth['isAuthenticated'](),controller[_0x9fac('0xf')]);router[_0x9fac('0x10')](_0x9fac('0xc'),auth[_0x9fac('0xa')](),controller[_0x9fac('0x11')]);module['exports']=router; \ No newline at end of file +var _0x492b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x492b,0x1c7));var _0xb492=function(_0x548985,_0x8c7fd0){_0x548985=_0x548985-0x0;var _0x2cc3d0=_0x492b[_0x548985];return _0x2cc3d0;};'use strict';var multer=require(_0xb492('0x0'));var util=require(_0xb492('0x1'));var path=require(_0xb492('0x2'));var timeout=require('connect-timeout');var express=require(_0xb492('0x3'));var router=express[_0xb492('0x4')]();var fs_extra=require(_0xb492('0x5'));var auth=require(_0xb492('0x6'));var interaction=require(_0xb492('0x7'));var config=require(_0xb492('0x8'));var controller=require(_0xb492('0x9'));router[_0xb492('0xa')]('/',auth[_0xb492('0xb')](),controller['index']);router[_0xb492('0xa')](_0xb492('0xc'),auth[_0xb492('0xb')](),controller[_0xb492('0xd')]);router[_0xb492('0xe')]('/',auth[_0xb492('0xb')](),controller['create']);router[_0xb492('0xf')](_0xb492('0xc'),auth[_0xb492('0xb')](),controller[_0xb492('0x10')]);router[_0xb492('0x11')](_0xb492('0xc'),auth[_0xb492('0xb')](),controller[_0xb492('0x12')]);module[_0xb492('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index e2cd7ad..471b792 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 _0x9d22=['STRING','name','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x9d22,0x11f));var _0x29d2=function(_0x597c16,_0x2292fe){_0x597c16=_0x597c16-0x0;var _0x30cc2c=_0x9d22[_0x597c16];return _0x30cc2c;};'use strict';var Sequelize=require(_0x29d2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x29d2('0x1')],'unique':_0x29d2('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1f3618){this['setDataValue'](_0x29d2('0x3'),_0x1f3618?_0x1f3618[_0x29d2('0x4')](''):[]);},'get':function(){return this[_0x29d2('0x5')](_0x29d2('0x3'))?this[_0x29d2('0x5')](_0x29d2('0x3'))[_0x29d2('0x6')](''):[];}},'auth':{'type':Sequelize[_0x29d2('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x29d2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x29d2('0x1')]},'description':{'type':Sequelize[_0x29d2('0x1')]}}; \ No newline at end of file +var _0x1afa=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x593e1b,_0xfce3a7){var _0x564eff=function(_0x13cc51){while(--_0x13cc51){_0x593e1b['push'](_0x593e1b['shift']());}};_0x564eff(++_0xfce3a7);}(_0x1afa,0xb9));var _0xa1af=function(_0x5426f4,_0x21217c){_0x5426f4=_0x5426f4-0x0;var _0x486b18=_0x1afa[_0x5426f4];return _0x486b18;};'use strict';var Sequelize=require(_0xa1af('0x0'));module[_0xa1af('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa1af('0x2')],'unique':_0xa1af('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5856e2){this['setDataValue'](_0xa1af('0x4'),_0x5856e2?_0x5856e2[_0xa1af('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xa1af('0x4'))?this[_0xa1af('0x6')](_0xa1af('0x4'))[_0xa1af('0x7')](''):[];}},'auth':{'type':Sequelize[_0xa1af('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xa1af('0x2')]},'record':{'type':Sequelize[_0xa1af('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa1af('0x2')]},'description':{'type':Sequelize[_0xa1af('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2311ea3..ea1ae69 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 _0xf197=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','get','ChanSpies','UserProfileResource','destroy','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','find','create','body','user','role','UserProfileSection','autoAssociation','error','update','params','eml-format','rimraf','zip-dir','moment','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf197,0x130));var _0x7f19=function(_0x4bb8e7,_0x4cf170){_0x4bb8e7=_0x4bb8e7-0x0;var _0x36cf9c=_0xf197[_0x4bb8e7];return _0x36cf9c;};'use strict';var emlformat=require(_0x7f19('0x0'));var rimraf=require(_0x7f19('0x1'));var zipdir=require(_0x7f19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f19('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f19('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f19('0x5'));var fs=require('fs');var fs_extra=require(_0x7f19('0x6'));var _=require(_0x7f19('0x7'));var squel=require(_0x7f19('0x8'));var crypto=require(_0x7f19('0x9'));var jsforce=require(_0x7f19('0xa'));var deskjs=require(_0x7f19('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7f19('0xc'));var Papa=require(_0x7f19('0xd'));var Redis=require(_0x7f19('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7f19('0xf'));var as=require(_0x7f19('0x10'));var hardwareService=require(_0x7f19('0x11'));var logger=require(_0x7f19('0x12'))('api');var utils=require(_0x7f19('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f19('0x14'));var db=require(_0x7f19('0x15'))['db'];function respondWithStatusCode(_0x3715f3,_0x580372){_0x580372=_0x580372||0xcc;return function(_0x540723){if(_0x540723){return _0x3715f3[_0x7f19('0x16')](_0x580372);}return _0x3715f3[_0x7f19('0x17')](_0x580372)[_0x7f19('0x18')]();};}function respondWithResult(_0x5b71ec,_0x446f5f){_0x446f5f=_0x446f5f||0xc8;return function(_0x20fe84){if(_0x20fe84){return _0x5b71ec['status'](_0x446f5f)[_0x7f19('0x19')](_0x20fe84);}};}function respondWithFilteredResult(_0x37f5a5,_0x11acd8){return function(_0x5c0b64){if(_0x5c0b64){var _0x3d81d1=typeof _0x11acd8['offset']===_0x7f19('0x1a')&&typeof _0x11acd8[_0x7f19('0x1b')]===_0x7f19('0x1a');var _0x2e2295=_0x5c0b64[_0x7f19('0x1c')];var _0x5c56a1=_0x3d81d1?0x0:_0x11acd8[_0x7f19('0x1d')];var _0x3b38d7=_0x3d81d1?_0x5c0b64[_0x7f19('0x1c')]:_0x11acd8['offset']+_0x11acd8[_0x7f19('0x1b')];var _0x52bcf;if(_0x3b38d7>=_0x2e2295){_0x3b38d7=_0x2e2295;_0x52bcf=0xc8;}else{_0x52bcf=0xce;}_0x37f5a5[_0x7f19('0x17')](_0x52bcf);return _0x37f5a5[_0x7f19('0x1e')]('Content-Range',_0x5c56a1+'-'+_0x3b38d7+'/'+_0x2e2295)[_0x7f19('0x19')](_0x5c0b64);}return null;};}function patchUpdates(_0xb8a760){return function(_0x277000){try{jsonpatch[_0x7f19('0x1f')](_0x277000,_0xb8a760,!![]);}catch(_0x4c3d6c){return BPromise[_0x7f19('0x20')](_0x4c3d6c);}return _0x277000[_0x7f19('0x21')]();};}function saveUpdates(_0x18ea37,_0x5168be){return function(_0x211fe4){if(_0x211fe4){return _0x211fe4['update'](_0x18ea37)[_0x7f19('0x22')](function(_0x33ac16){return _0x33ac16;});}return null;};}function removeEntity(_0x37eecd,_0x34c4fb){return function(_0x1f0ea6){if(_0x1f0ea6){return _0x1f0ea6['destroy']()['then'](function(){var _0x3d852b=_0x1f0ea6[_0x7f19('0x23')]({'plain':!![]});var _0x4b3649=_0x7f19('0x24');return db[_0x7f19('0x25')][_0x7f19('0x26')]({'where':{'type':_0x4b3649,'resourceId':_0x3d852b['id']}})[_0x7f19('0x22')](function(){return _0x1f0ea6;});})[_0x7f19('0x22')](function(){_0x37eecd[_0x7f19('0x17')](0xcc)[_0x7f19('0x18')]();});}};}function handleEntityNotFound(_0x4ae0d2,_0x3d7a24){return function(_0xb8b519){if(!_0xb8b519){_0x4ae0d2['sendStatus'](0x194);}return _0xb8b519;};}function handleError(_0x460ec5,_0x588aad){_0x588aad=_0x588aad||0x1f4;return function(_0x1f5aa9){logger['error'](_0x1f5aa9['stack']);if(_0x1f5aa9[_0x7f19('0x27')]){delete _0x1f5aa9['name'];}_0x460ec5[_0x7f19('0x17')](_0x588aad)[_0x7f19('0x28')](_0x1f5aa9);};}exports[_0x7f19('0x29')]=function(_0x5bb2a5,_0x3d15e7){var _0x4951d0={},_0x368022={},_0x511640={'count':0x0,'rows':[]};var _0x19b03d=_[_0x7f19('0x2a')](db[_0x7f19('0x2b')]['rawAttributes'],function(_0x5bbbd8){return{'name':_0x5bbbd8[_0x7f19('0x2c')],'type':_0x5bbbd8[_0x7f19('0x2d')][_0x7f19('0x2e')]};});_0x368022[_0x7f19('0x2f')]=_[_0x7f19('0x2a')](_0x19b03d,'name');_0x368022['query']=_['keys'](_0x5bb2a5[_0x7f19('0x30')]);_0x368022[_0x7f19('0x31')]=_['intersection'](_0x368022[_0x7f19('0x2f')],_0x368022[_0x7f19('0x30')]);_0x4951d0[_0x7f19('0x32')]=_[_0x7f19('0x33')](_0x368022[_0x7f19('0x2f')],qs[_0x7f19('0x34')](_0x5bb2a5[_0x7f19('0x30')][_0x7f19('0x34')]));_0x4951d0['attributes']=_0x4951d0['attributes'][_0x7f19('0x35')]?_0x4951d0[_0x7f19('0x32')]:_0x368022[_0x7f19('0x2f')];if(!_0x5bb2a5[_0x7f19('0x30')][_0x7f19('0x36')](_0x7f19('0x37'))){_0x4951d0[_0x7f19('0x1b')]=qs[_0x7f19('0x1b')](_0x5bb2a5[_0x7f19('0x30')]['limit']);_0x4951d0[_0x7f19('0x1d')]=qs[_0x7f19('0x1d')](_0x5bb2a5[_0x7f19('0x30')][_0x7f19('0x1d')]);}_0x4951d0['order']=qs[_0x7f19('0x38')](_0x5bb2a5[_0x7f19('0x30')][_0x7f19('0x38')]);_0x4951d0[_0x7f19('0x39')]=qs['filters'](_[_0x7f19('0x3a')](_0x5bb2a5['query'],_0x368022[_0x7f19('0x31')]),_0x19b03d);if(_0x5bb2a5[_0x7f19('0x30')]['filter']){_0x4951d0['where']=_[_0x7f19('0x3b')](_0x4951d0[_0x7f19('0x39')],{'$or':_['map'](_0x19b03d,function(_0x58e396){if(_0x58e396['type']!=='VIRTUAL'){var _0x5ac3bf={};_0x5ac3bf[_0x58e396['name']]={'$like':'%'+_0x5bb2a5[_0x7f19('0x30')][_0x7f19('0x3c')]+'%'};return _0x5ac3bf;}})});}_0x4951d0=_[_0x7f19('0x3b')]({},_0x4951d0,_0x5bb2a5['options']);var _0x38e989={'where':_0x4951d0[_0x7f19('0x39')]};return db[_0x7f19('0x2b')][_0x7f19('0x1c')](_0x38e989)[_0x7f19('0x22')](function(_0x29e758){_0x511640['count']=_0x29e758;if(_0x5bb2a5[_0x7f19('0x30')]['includeAll']){_0x4951d0[_0x7f19('0x3d')]=[{'all':!![]}];}return db[_0x7f19('0x2b')][_0x7f19('0x3e')](_0x4951d0);})['then'](function(_0x3e3445){_0x511640[_0x7f19('0x3f')]=_0x3e3445;return _0x511640;})[_0x7f19('0x22')](respondWithFilteredResult(_0x3d15e7,_0x4951d0))[_0x7f19('0x40')](handleError(_0x3d15e7,null));};exports[_0x7f19('0x41')]=function(_0x4630b3,_0x474a84){var _0x5671e6={'raw':![],'where':{'id':_0x4630b3['params']['id']}},_0x3b438c={};_0x3b438c[_0x7f19('0x2f')]=_[_0x7f19('0x42')](db[_0x7f19('0x2b')][_0x7f19('0x43')]);_0x3b438c[_0x7f19('0x30')]=_[_0x7f19('0x42')](_0x4630b3[_0x7f19('0x30')]);_0x3b438c[_0x7f19('0x31')]=_[_0x7f19('0x33')](_0x3b438c[_0x7f19('0x2f')],_0x3b438c['query']);_0x5671e6[_0x7f19('0x32')]=_[_0x7f19('0x33')](_0x3b438c['model'],qs[_0x7f19('0x34')](_0x4630b3[_0x7f19('0x30')][_0x7f19('0x34')]));_0x5671e6[_0x7f19('0x32')]=_0x5671e6[_0x7f19('0x32')][_0x7f19('0x35')]?_0x5671e6[_0x7f19('0x32')]:_0x3b438c[_0x7f19('0x2f')];if(_0x4630b3[_0x7f19('0x30')][_0x7f19('0x44')]){_0x5671e6[_0x7f19('0x3d')]=[{'all':!![]}];}_0x5671e6=_[_0x7f19('0x3b')]({},_0x5671e6,_0x4630b3[_0x7f19('0x45')]);return db[_0x7f19('0x2b')][_0x7f19('0x46')](_0x5671e6)[_0x7f19('0x22')](handleEntityNotFound(_0x474a84,null))[_0x7f19('0x22')](respondWithResult(_0x474a84,null))[_0x7f19('0x40')](handleError(_0x474a84,null));};exports[_0x7f19('0x47')]=function(_0x49766c,_0x247234){return db[_0x7f19('0x2b')][_0x7f19('0x47')](_0x49766c[_0x7f19('0x48')],{})['then'](function(_0x505eac){var _0xdc5d2=_0x49766c[_0x7f19('0x49')]['get']({'plain':!![]});if(!_0xdc5d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdc5d2[_0x7f19('0x4a')]===_0x7f19('0x49')){var _0x49c18b=_0x505eac[_0x7f19('0x23')]({'plain':!![]});var _0x34e2e1=_0x7f19('0x24');return db[_0x7f19('0x4b')]['find']({'where':{'name':_0x34e2e1,'userProfileId':_0xdc5d2['userProfileId']},'raw':!![]})[_0x7f19('0x22')](function(_0x33d791){if(_0x33d791&&_0x33d791[_0x7f19('0x4c')]===0x0){return db[_0x7f19('0x25')][_0x7f19('0x47')]({'name':_0x49c18b[_0x7f19('0x27')],'resourceId':_0x49c18b['id'],'type':_0x33d791[_0x7f19('0x27')],'sectionId':_0x33d791['id']},{})[_0x7f19('0x22')](function(){return _0x505eac;});}else{return _0x505eac;}})[_0x7f19('0x40')](function(_0x2689fc){logger[_0x7f19('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2689fc);throw _0x2689fc;});}return _0x505eac;})[_0x7f19('0x22')](respondWithResult(_0x247234,0xc9))['catch'](handleError(_0x247234,null));};exports[_0x7f19('0x4e')]=function(_0x40c46f,_0xf5f09e){if(_0x40c46f[_0x7f19('0x48')]['id']){delete _0x40c46f[_0x7f19('0x48')]['id'];}return db['VoiceChanSpy'][_0x7f19('0x46')]({'where':{'id':_0x40c46f['params']['id']}})['then'](handleEntityNotFound(_0xf5f09e,null))[_0x7f19('0x22')](saveUpdates(_0x40c46f[_0x7f19('0x48')],null))[_0x7f19('0x22')](respondWithResult(_0xf5f09e,null))[_0x7f19('0x40')](handleError(_0xf5f09e,null));};exports[_0x7f19('0x26')]=function(_0x3d83b9,_0x2e1481){return db[_0x7f19('0x2b')][_0x7f19('0x46')]({'where':{'id':_0x3d83b9[_0x7f19('0x4f')]['id']}})[_0x7f19('0x22')](handleEntityNotFound(_0x2e1481,null))[_0x7f19('0x22')](removeEntity(_0x2e1481,null))[_0x7f19('0x40')](handleError(_0x2e1481,null));}; \ No newline at end of file +var _0xbf5c=['pick','filter','where','merge','options','VoiceChanSpy','include','rows','catch','show','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x5d2ee6,_0x172461){_0x5d2ee6=_0x5d2ee6-0x0;var _0x148dc1=_0xbf5c[_0x5d2ee6];return _0x148dc1;};'use strict';var emlformat=require(_0xcbf5('0x0'));var rimraf=require(_0xcbf5('0x1'));var zipdir=require(_0xcbf5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf5('0x3'));var moment=require(_0xcbf5('0x4'));var BPromise=require(_0xcbf5('0x5'));var Mustache=require('mustache');var util=require(_0xcbf5('0x6'));var path=require(_0xcbf5('0x7'));var sox=require('sox');var csv=require(_0xcbf5('0x8'));var ejs=require(_0xcbf5('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf5('0xa'));var _=require('lodash');var squel=require(_0xcbf5('0xb'));var crypto=require(_0xcbf5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbf5('0x8'));var querystring=require(_0xcbf5('0xd'));var Papa=require(_0xcbf5('0xe'));var Redis=require('ioredis');var authService=require(_0xcbf5('0xf'));var qs=require(_0xcbf5('0x10'));var as=require(_0xcbf5('0x11'));var hardwareService=require(_0xcbf5('0x12'));var logger=require(_0xcbf5('0x13'))(_0xcbf5('0x14'));var utils=require('../../config/utils');var config=require(_0xcbf5('0x15'));var licenseUtil=require(_0xcbf5('0x16'));var db=require(_0xcbf5('0x17'))['db'];function respondWithStatusCode(_0x4a894b,_0x5e5307){_0x5e5307=_0x5e5307||0xcc;return function(_0x18c2fe){if(_0x18c2fe){return _0x4a894b['sendStatus'](_0x5e5307);}return _0x4a894b[_0xcbf5('0x18')](_0x5e5307)[_0xcbf5('0x19')]();};}function respondWithResult(_0x5cbcf6,_0x2e7536){_0x2e7536=_0x2e7536||0xc8;return function(_0x51b1d2){if(_0x51b1d2){return _0x5cbcf6['status'](_0x2e7536)[_0xcbf5('0x1a')](_0x51b1d2);}};}function respondWithFilteredResult(_0x550e21,_0x2c58ba){return function(_0x5348ce){if(_0x5348ce){var _0x4fc535=typeof _0x2c58ba[_0xcbf5('0x1b')]===_0xcbf5('0x1c')&&typeof _0x2c58ba[_0xcbf5('0x1d')]===_0xcbf5('0x1c');var _0x7f2153=_0x5348ce[_0xcbf5('0x1e')];var _0x462d46=_0x4fc535?0x0:_0x2c58ba['offset'];var _0xcf3d18=_0x4fc535?_0x5348ce[_0xcbf5('0x1e')]:_0x2c58ba[_0xcbf5('0x1b')]+_0x2c58ba[_0xcbf5('0x1d')];var _0x269b01;if(_0xcf3d18>=_0x7f2153){_0xcf3d18=_0x7f2153;_0x269b01=0xc8;}else{_0x269b01=0xce;}_0x550e21[_0xcbf5('0x18')](_0x269b01);return _0x550e21[_0xcbf5('0x1f')](_0xcbf5('0x20'),_0x462d46+'-'+_0xcf3d18+'/'+_0x7f2153)['json'](_0x5348ce);}return null;};}function patchUpdates(_0x155147){return function(_0x4e8874){try{jsonpatch[_0xcbf5('0x21')](_0x4e8874,_0x155147,!![]);}catch(_0x4c7b1e){return BPromise[_0xcbf5('0x22')](_0x4c7b1e);}return _0x4e8874[_0xcbf5('0x23')]();};}function saveUpdates(_0x2334f1,_0xf2360){return function(_0x3e9548){if(_0x3e9548){return _0x3e9548[_0xcbf5('0x24')](_0x2334f1)['then'](function(_0x17bbc8){return _0x17bbc8;});}return null;};}function removeEntity(_0x5602fd,_0x965482){return function(_0x1b59d4){if(_0x1b59d4){return _0x1b59d4[_0xcbf5('0x25')]()[_0xcbf5('0x26')](function(){var _0x4c8d12=_0x1b59d4[_0xcbf5('0x27')]({'plain':!![]});var _0x43e9af=_0xcbf5('0x28');return db[_0xcbf5('0x29')][_0xcbf5('0x25')]({'where':{'type':_0x43e9af,'resourceId':_0x4c8d12['id']}})[_0xcbf5('0x26')](function(){return _0x1b59d4;});})[_0xcbf5('0x26')](function(){_0x5602fd[_0xcbf5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d56a,_0x1a84f8){return function(_0xd3a7f4){if(!_0xd3a7f4){_0x22d56a[_0xcbf5('0x2a')](0x194);}return _0xd3a7f4;};}function handleError(_0x38ab04,_0x57e453){_0x57e453=_0x57e453||0x1f4;return function(_0x1293ab){logger[_0xcbf5('0x2b')](_0x1293ab[_0xcbf5('0x2c')]);if(_0x1293ab[_0xcbf5('0x2d')]){delete _0x1293ab[_0xcbf5('0x2d')];}_0x38ab04[_0xcbf5('0x18')](_0x57e453)['send'](_0x1293ab);};}exports[_0xcbf5('0x2e')]=function(_0x399f50,_0x2d7c92){var _0xa56ec3={},_0x381145={},_0x200ff2={'count':0x0,'rows':[]};var _0x14656f=_['map'](db['VoiceChanSpy'][_0xcbf5('0x2f')],function(_0x482104){return{'name':_0x482104[_0xcbf5('0x30')],'type':_0x482104[_0xcbf5('0x31')][_0xcbf5('0x32')]};});_0x381145[_0xcbf5('0x33')]=_[_0xcbf5('0x34')](_0x14656f,'name');_0x381145['query']=_[_0xcbf5('0x35')](_0x399f50[_0xcbf5('0x36')]);_0x381145[_0xcbf5('0x37')]=_[_0xcbf5('0x38')](_0x381145[_0xcbf5('0x33')],_0x381145[_0xcbf5('0x36')]);_0xa56ec3[_0xcbf5('0x39')]=_['intersection'](_0x381145[_0xcbf5('0x33')],qs[_0xcbf5('0x3a')](_0x399f50[_0xcbf5('0x36')][_0xcbf5('0x3a')]));_0xa56ec3['attributes']=_0xa56ec3[_0xcbf5('0x39')][_0xcbf5('0x3b')]?_0xa56ec3['attributes']:_0x381145[_0xcbf5('0x33')];if(!_0x399f50[_0xcbf5('0x36')]['hasOwnProperty']('nolimit')){_0xa56ec3[_0xcbf5('0x1d')]=qs[_0xcbf5('0x1d')](_0x399f50[_0xcbf5('0x36')][_0xcbf5('0x1d')]);_0xa56ec3['offset']=qs[_0xcbf5('0x1b')](_0x399f50[_0xcbf5('0x36')][_0xcbf5('0x1b')]);}_0xa56ec3[_0xcbf5('0x3c')]=qs['sort'](_0x399f50[_0xcbf5('0x36')][_0xcbf5('0x3d')]);_0xa56ec3['where']=qs['filters'](_[_0xcbf5('0x3e')](_0x399f50[_0xcbf5('0x36')],_0x381145['filters']),_0x14656f);if(_0x399f50[_0xcbf5('0x36')][_0xcbf5('0x3f')]){_0xa56ec3[_0xcbf5('0x40')]=_[_0xcbf5('0x41')](_0xa56ec3[_0xcbf5('0x40')],{'$or':_['map'](_0x14656f,function(_0x33959b){if(_0x33959b[_0xcbf5('0x31')]!=='VIRTUAL'){var _0x2fb0fc={};_0x2fb0fc[_0x33959b['name']]={'$like':'%'+_0x399f50[_0xcbf5('0x36')]['filter']+'%'};return _0x2fb0fc;}})});}_0xa56ec3=_[_0xcbf5('0x41')]({},_0xa56ec3,_0x399f50[_0xcbf5('0x42')]);var _0x2e537f={'where':_0xa56ec3['where']};return db[_0xcbf5('0x43')]['count'](_0x2e537f)['then'](function(_0x540e62){_0x200ff2[_0xcbf5('0x1e')]=_0x540e62;if(_0x399f50['query']['includeAll']){_0xa56ec3[_0xcbf5('0x44')]=[{'all':!![]}];}return db[_0xcbf5('0x43')]['findAll'](_0xa56ec3);})[_0xcbf5('0x26')](function(_0x4df47d){_0x200ff2[_0xcbf5('0x45')]=_0x4df47d;return _0x200ff2;})[_0xcbf5('0x26')](respondWithFilteredResult(_0x2d7c92,_0xa56ec3))[_0xcbf5('0x46')](handleError(_0x2d7c92,null));};exports[_0xcbf5('0x47')]=function(_0x38299c,_0x3d71b9){var _0x166202={'raw':![],'where':{'id':_0x38299c['params']['id']}},_0x54d555={};_0x54d555['model']=_[_0xcbf5('0x35')](db['VoiceChanSpy'][_0xcbf5('0x2f')]);_0x54d555[_0xcbf5('0x36')]=_[_0xcbf5('0x35')](_0x38299c[_0xcbf5('0x36')]);_0x54d555[_0xcbf5('0x37')]=_[_0xcbf5('0x38')](_0x54d555[_0xcbf5('0x33')],_0x54d555[_0xcbf5('0x36')]);_0x166202[_0xcbf5('0x39')]=_[_0xcbf5('0x38')](_0x54d555[_0xcbf5('0x33')],qs[_0xcbf5('0x3a')](_0x38299c[_0xcbf5('0x36')][_0xcbf5('0x3a')]));_0x166202['attributes']=_0x166202[_0xcbf5('0x39')]['length']?_0x166202[_0xcbf5('0x39')]:_0x54d555[_0xcbf5('0x33')];if(_0x38299c[_0xcbf5('0x36')][_0xcbf5('0x48')]){_0x166202[_0xcbf5('0x44')]=[{'all':!![]}];}_0x166202=_[_0xcbf5('0x41')]({},_0x166202,_0x38299c[_0xcbf5('0x42')]);return db[_0xcbf5('0x43')]['find'](_0x166202)['then'](handleEntityNotFound(_0x3d71b9,null))[_0xcbf5('0x26')](respondWithResult(_0x3d71b9,null))['catch'](handleError(_0x3d71b9,null));};exports['create']=function(_0x305f93,_0xddb159){return db[_0xcbf5('0x43')]['create'](_0x305f93[_0xcbf5('0x49')],{})['then'](function(_0x429087){var _0x511633=_0x305f93[_0xcbf5('0x4a')][_0xcbf5('0x27')]({'plain':!![]});if(!_0x511633)throw new Error(_0xcbf5('0x4b'));if(_0x511633[_0xcbf5('0x4c')]===_0xcbf5('0x4a')){var _0x490830=_0x429087[_0xcbf5('0x27')]({'plain':!![]});var _0xeac2e5=_0xcbf5('0x28');return db[_0xcbf5('0x4d')]['find']({'where':{'name':_0xeac2e5,'userProfileId':_0x511633[_0xcbf5('0x4e')]},'raw':!![]})['then'](function(_0x52a3df){if(_0x52a3df&&_0x52a3df['autoAssociation']===0x0){return db['UserProfileResource'][_0xcbf5('0x4f')]({'name':_0x490830['name'],'resourceId':_0x490830['id'],'type':_0x52a3df[_0xcbf5('0x2d')],'sectionId':_0x52a3df['id']},{})[_0xcbf5('0x26')](function(){return _0x429087;});}else{return _0x429087;}})['catch'](function(_0x6c7c11){logger[_0xcbf5('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6c7c11);throw _0x6c7c11;});}return _0x429087;})[_0xcbf5('0x26')](respondWithResult(_0xddb159,0xc9))[_0xcbf5('0x46')](handleError(_0xddb159,null));};exports[_0xcbf5('0x24')]=function(_0x5322a6,_0x342c23){if(_0x5322a6[_0xcbf5('0x49')]['id']){delete _0x5322a6[_0xcbf5('0x49')]['id'];}return db['VoiceChanSpy'][_0xcbf5('0x50')]({'where':{'id':_0x5322a6[_0xcbf5('0x51')]['id']}})['then'](handleEntityNotFound(_0x342c23,null))[_0xcbf5('0x26')](saveUpdates(_0x5322a6[_0xcbf5('0x49')],null))[_0xcbf5('0x26')](respondWithResult(_0x342c23,null))[_0xcbf5('0x46')](handleError(_0x342c23,null));};exports[_0xcbf5('0x25')]=function(_0x4c00f2,_0x5678db){return db[_0xcbf5('0x43')]['find']({'where':{'id':_0x4c00f2[_0xcbf5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5678db,null))[_0xcbf5('0x26')](removeEntity(_0x5678db,null))[_0xcbf5('0x46')](handleError(_0x5678db,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 16779f6..6890b35 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 _0xdebe=['VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','StopMixMonitor','length','internal','concat','User','agent','then','exports','models','define'];(function(_0xf3a73,_0x2b3d10){var _0x3ddfd5=function(_0x55dd6f){while(--_0x55dd6f){_0xf3a73['push'](_0xf3a73['shift']());}};_0x3ddfd5(++_0x2b3d10);}(_0xdebe,0x77));var _0xedeb=function(_0x2a3d2d,_0x16e56c){_0x2a3d2d=_0x2a3d2d-0x0;var _0x22b6a4=_0xdebe[_0x2a3d2d];return _0x22b6a4;};'use strict';var _=require(_0xedeb('0x0'));var util=require(_0xedeb('0x1'));var BPromise=require(_0xedeb('0x2'));var attributes=require(_0xedeb('0x3'));var getUserApplications=function(_0x5e91f8,_0x5aef08,_0x5aa483){var _0x142440=0x1;var _0x433a62=[];var _0x25909e={'context':_0x5aef08[_0xedeb('0x4')]||_0xedeb('0x5'),'exten':util[_0xedeb('0x6')](_0xedeb('0x7'),_0x5e91f8['prefix'],_0x5aa483),'type':_0xedeb('0x8'),'isApp':![],'ChanSpyId':_0x5e91f8['id'],'UserId':_0x5aef08['id']};_0x433a62[_0xedeb('0x9')](_[_0xedeb('0xa')]({'app':'Set','appdata':util[_0xedeb('0x6')](_0xedeb('0xb'),_0xedeb('0xc')),'priority':_0x142440++},_0x25909e));if(_0x5e91f8[_0xedeb('0xd')]){_0x433a62[_0xedeb('0x9')](_[_0xedeb('0xa')]({'app':'MixMonitor','appdata':util[_0xedeb('0x6')](_0xedeb('0xe'),_0x5e91f8[_0xedeb('0xf')]),'priority':_0x142440++},_0x25909e));}if(_0x5e91f8[_0xedeb('0x10')]){_0x433a62[_0xedeb('0x9')](_[_0xedeb('0xa')]({'app':_0xedeb('0x11'),'appdata':_0x5e91f8[_0xedeb('0x12')],'priority':_0x142440++},_0x25909e));}_0x433a62[_0xedeb('0x9')](_['merge']({'app':_0xedeb('0x13'),'appdata':util[_0xedeb('0x6')]('SIP/%s,%s',_0x5aef08[_0xedeb('0x14')],_0x5e91f8[_0xedeb('0x15')]?_0x5e91f8['options'][_0xedeb('0x16')](''):''),'priority':_0x142440++},_0x25909e));if(_0x5e91f8[_0xedeb('0xd')]){_0x433a62[_0xedeb('0x9')](_[_0xedeb('0xa')]({'app':_0xedeb('0x17'),'priority':_0x142440++},_0x25909e));}return _0x433a62;};var getChanSpyApplications=function(_0x1d2fe9,_0x282db6){var _0xad29d5=[];for(var _0xc0f3a1=0x0,_0x4ef95a=0x1;_0xc0f3a1<_0x282db6[_0xedeb('0x18')];_0xc0f3a1++,_0x4ef95a=0x1){_0xad29d5=_0xad29d5['concat'](getUserApplications(_0x1d2fe9,_0x282db6[_0xc0f3a1],_0x282db6[_0xc0f3a1][_0xedeb('0x19')]));if(_0x282db6[_0xc0f3a1][_0xedeb('0x19')]!=_0x282db6[_0xc0f3a1][_0xedeb('0x14')]){_0xad29d5=_0xad29d5[_0xedeb('0x1a')](getUserApplications(_0x1d2fe9,_0x282db6[_0xc0f3a1],_0x282db6[_0xc0f3a1]['name']));}}return _0xad29d5;};var getChanSpyPromise=function(_0x3dd74f,_0x59f343){return new BPromise(function(_0x107de6,_0x1c22a6){return _0x3dd74f[_0xedeb('0x1b')]['findAll']({'attributes':['id',_0xedeb('0x14'),_0xedeb('0x19')],'where':{'role':_0xedeb('0x1c'),'chanspy':!![]},'raw':!![]})[_0xedeb('0x1d')](function(_0xec99cd){if(_0xec99cd){return _0x107de6(getChanSpyApplications(_0x59f343,_0xec99cd));}return _0x107de6([]);})['catch'](function(_0x375c55){_0x1c22a6(_0x375c55);});});};module[_0xedeb('0x1e')]=function(_0x8b4a07,_0x26af3a){var _0x37552c=_0x8b4a07[_0xedeb('0x1f')];return _0x8b4a07[_0xedeb('0x20')](_0xedeb('0x21'),attributes,{'tableName':_0xedeb('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c4ade,_0x4442ef,_0x580347){return getChanSpyPromise(_0x37552c,_0x5c4ade)[_0xedeb('0x1d')](function(_0x46e5ff){if(_0x46e5ff&&_0x46e5ff[_0xedeb('0x18')]){return _0x37552c[_0xedeb('0x23')][_0xedeb('0x24')](_0x46e5ff);}})[_0xedeb('0x1d')](function(){_0x580347();})['catch'](function(_0x38e4e6){_0x580347(_0x38e4e6);});},'afterUpdate':function(_0x2a945b,_0xde675f,_0x68b82e){return _0x37552c[_0xedeb('0x23')]['destroy']({'where':{'ChanSpyId':_0x2a945b['id']}})[_0xedeb('0x1d')](function(){return getChanSpyPromise(_0x37552c,_0x2a945b);})[_0xedeb('0x1d')](function(_0x5c4795){if(_0x5c4795&&_0x5c4795[_0xedeb('0x18')]){return _0x37552c[_0xedeb('0x23')]['bulkCreate'](_0x5c4795);}})[_0xedeb('0x1d')](function(){_0x68b82e();})[_0xedeb('0x25')](function(_0x4bdf55){_0x68b82e(_0x4bdf55);});},'afterDestroy':function(_0x40dbf5,_0x50b5a9,_0x3dfc80){return _0x37552c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x40dbf5['id']}})['then'](function(){_0x3dfc80();})[_0xedeb('0x25')](function(_0x501b6e){_0x3dfc80(_0x501b6e);});}}});}; \ No newline at end of file +var _0x3277=['push','merge','Set','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','name','options','join','record','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','models','define','voice_chanspy','length','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','prefix','system'];(function(_0x202438,_0x21f696){var _0x43a7f1=function(_0x4359bb){while(--_0x4359bb){_0x202438['push'](_0x202438['shift']());}};_0x43a7f1(++_0x21f696);}(_0x3277,0x161));var _0x7327=function(_0x992c73,_0x3f312d){_0x992c73=_0x992c73-0x0;var _0x30ffb5=_0x3277[_0x992c73];return _0x30ffb5;};'use strict';var _=require(_0x7327('0x0'));var util=require('util');var BPromise=require(_0x7327('0x1'));var attributes=require(_0x7327('0x2'));var getUserApplications=function(_0x46d9ca,_0x3be470,_0x59a340){var _0x535b9b=0x1;var _0x3bdf6d=[];var _0x4e7556={'context':_0x3be470[_0x7327('0x3')]||'from-sip','exten':util[_0x7327('0x4')]('%s%s',_0x46d9ca[_0x7327('0x5')],_0x59a340),'type':_0x7327('0x6'),'isApp':![],'ChanSpyId':_0x46d9ca['id'],'UserId':_0x3be470['id']};_0x3bdf6d[_0x7327('0x7')](_[_0x7327('0x8')]({'app':_0x7327('0x9'),'appdata':util[_0x7327('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x535b9b++},_0x4e7556));if(_0x46d9ca['record']){_0x3bdf6d[_0x7327('0x7')](_[_0x7327('0x8')]({'app':_0x7327('0xa'),'appdata':util['format'](_0x7327('0xb'),_0x46d9ca['recordingFormat']),'priority':_0x535b9b++},_0x4e7556));}if(_0x46d9ca[_0x7327('0xc')]){_0x3bdf6d[_0x7327('0x7')](_[_0x7327('0x8')]({'app':_0x7327('0xd'),'appdata':_0x46d9ca[_0x7327('0xe')],'priority':_0x535b9b++},_0x4e7556));}_0x3bdf6d[_0x7327('0x7')](_[_0x7327('0x8')]({'app':_0x7327('0xf'),'appdata':util[_0x7327('0x4')]('SIP/%s,%s',_0x3be470[_0x7327('0x10')],_0x46d9ca[_0x7327('0x11')]?_0x46d9ca[_0x7327('0x11')][_0x7327('0x12')](''):''),'priority':_0x535b9b++},_0x4e7556));if(_0x46d9ca[_0x7327('0x13')]){_0x3bdf6d['push'](_['merge']({'app':_0x7327('0x14'),'priority':_0x535b9b++},_0x4e7556));}return _0x3bdf6d;};var getChanSpyApplications=function(_0x1be050,_0x330b6a){var _0x48d218=[];for(var _0x53b201=0x0,_0x283a73=0x1;_0x53b201<_0x330b6a['length'];_0x53b201++,_0x283a73=0x1){_0x48d218=_0x48d218[_0x7327('0x15')](getUserApplications(_0x1be050,_0x330b6a[_0x53b201],_0x330b6a[_0x53b201][_0x7327('0x16')]));if(_0x330b6a[_0x53b201][_0x7327('0x16')]!=_0x330b6a[_0x53b201][_0x7327('0x10')]){_0x48d218=_0x48d218['concat'](getUserApplications(_0x1be050,_0x330b6a[_0x53b201],_0x330b6a[_0x53b201][_0x7327('0x10')]));}}return _0x48d218;};var getChanSpyPromise=function(_0x195647,_0x4c7ddc){return new BPromise(function(_0x3d2021,_0x11e324){return _0x195647[_0x7327('0x17')][_0x7327('0x18')]({'attributes':['id',_0x7327('0x10'),_0x7327('0x16')],'where':{'role':_0x7327('0x19'),'chanspy':!![]},'raw':!![]})[_0x7327('0x1a')](function(_0x51a87c){if(_0x51a87c){return _0x3d2021(getChanSpyApplications(_0x4c7ddc,_0x51a87c));}return _0x3d2021([]);})['catch'](function(_0x4afb8e){_0x11e324(_0x4afb8e);});});};module[_0x7327('0x1b')]=function(_0x52521e,_0x6c98b){var _0x535d97=_0x52521e[_0x7327('0x1c')];return _0x52521e[_0x7327('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x7327('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58ed55,_0x111f0e,_0xa2d8d9){return getChanSpyPromise(_0x535d97,_0x58ed55)[_0x7327('0x1a')](function(_0x548b0e){if(_0x548b0e&&_0x548b0e[_0x7327('0x1f')]){return _0x535d97[_0x7327('0x20')][_0x7327('0x21')](_0x548b0e);}})[_0x7327('0x1a')](function(){_0xa2d8d9();})[_0x7327('0x22')](function(_0x14ac13){_0xa2d8d9(_0x14ac13);});},'afterUpdate':function(_0x4f2b72,_0x222243,_0x525864){return _0x535d97['VoiceExtension'][_0x7327('0x23')]({'where':{'ChanSpyId':_0x4f2b72['id']}})['then'](function(){return getChanSpyPromise(_0x535d97,_0x4f2b72);})[_0x7327('0x1a')](function(_0xa1b37e){if(_0xa1b37e&&_0xa1b37e[_0x7327('0x1f')]){return _0x535d97[_0x7327('0x20')]['bulkCreate'](_0xa1b37e);}})[_0x7327('0x1a')](function(){_0x525864();})['catch'](function(_0x29ee71){_0x525864(_0x29ee71);});},'afterDestroy':function(_0x59c947,_0x1accfe,_0x407eae){return _0x535d97[_0x7327('0x20')]['destroy']({'where':{'ChanSpyId':_0x59c947['id']}})[_0x7327('0x1a')](function(){_0x407eae();})[_0x7327('0x22')](function(_0x2cb9c7){_0x407eae(_0x2cb9c7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 93104ec..e78e47b 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 _0xf4eb=['VoiceChanSpy,\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(_0x5a778b,_0x717daa){var _0x32f0da=function(_0x546db4){while(--_0x546db4){_0x5a778b['push'](_0x5a778b['shift']());}};_0x32f0da(++_0x717daa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3caa61,_0x53d5f9){_0x3caa61=_0x3caa61-0x0;var _0x25aed5=_0xf4eb[_0x3caa61];return _0x25aed5;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xaaa2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x4f4168,_0x4f2030){var _0x54239f=function(_0x1cacd9){while(--_0x1cacd9){_0x4f4168['push'](_0x4f4168['shift']());}};_0x54239f(++_0x4f2030);}(_0xaaa2,0xac));var _0x2aaa=function(_0x22dc1b,_0x24c882){_0x22dc1b=_0x22dc1b-0x0;var _0xb939cd=_0xaaa2[_0x22dc1b];return _0xb939cd;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5aa75cc..f3be006 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 _0x6126=['post','create','put','/:id','update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x6126,0x104));var _0x6612=function(_0x47c0a5,_0x21fb53){_0x47c0a5=_0x47c0a5-0x0;var _0x50878c=_0x6126[_0x47c0a5];return _0x50878c;};'use strict';var multer=require('multer');var util=require(_0x6612('0x0'));var path=require(_0x6612('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6612('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6612('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6612('0x4'));var controller=require(_0x6612('0x5'));router[_0x6612('0x6')]('/',auth[_0x6612('0x7')](),controller[_0x6612('0x8')]);router[_0x6612('0x6')]('/:id',auth[_0x6612('0x7')](),controller[_0x6612('0x9')]);router[_0x6612('0xa')]('/',auth['isAuthenticated'](),controller[_0x6612('0xb')]);router[_0x6612('0xc')](_0x6612('0xd'),auth['isAuthenticated'](),controller[_0x6612('0xe')]);router[_0x6612('0xf')](_0x6612('0xd'),auth[_0x6612('0x7')](),controller[_0x6612('0x10')]);module[_0x6612('0x11')]=router; \ No newline at end of file +var _0xcacf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5a08f9,_0x3655b3){var _0x345060=function(_0x4dd4f7){while(--_0x4dd4f7){_0x5a08f9['push'](_0x5a08f9['shift']());}};_0x345060(++_0x3655b3);}(_0xcacf,0x179));var _0xfcac=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xcacf[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xfcac('0x0'));var util=require(_0xfcac('0x1'));var path=require(_0xfcac('0x2'));var timeout=require(_0xfcac('0x3'));var express=require(_0xfcac('0x4'));var router=express[_0xfcac('0x5')]();var fs_extra=require(_0xfcac('0x6'));var auth=require(_0xfcac('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfcac('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0xfcac('0x9')](),controller[_0xfcac('0xa')]);router[_0xfcac('0xb')](_0xfcac('0xc'),auth[_0xfcac('0x9')](),controller['show']);router[_0xfcac('0xd')]('/',auth[_0xfcac('0x9')](),controller[_0xfcac('0xe')]);router[_0xfcac('0xf')](_0xfcac('0xc'),auth[_0xfcac('0x9')](),controller[_0xfcac('0x10')]);router[_0xfcac('0x11')](_0xfcac('0xc'),auth[_0xfcac('0x9')](),controller[_0xfcac('0x12')]);module[_0xfcac('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 401510f..45f61a2 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 _0x5019=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x5019,0x168));var _0x9501=function(_0x4b9f4d,_0x5058af){_0x4b9f4d=_0x4b9f4d-0x0;var _0x350239=_0x5019[_0x4b9f4d];return _0x350239;};'use strict';var Sequelize=require(_0x9501('0x0'));module[_0x9501('0x1')]={'name':{'type':Sequelize[_0x9501('0x2')],'unique':_0x9501('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9501('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2dc1=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x4acda5,_0x2ed31f){var _0x2b3d50=function(_0x135126){while(--_0x135126){_0x4acda5['push'](_0x4acda5['shift']());}};_0x2b3d50(++_0x2ed31f);}(_0x2dc1,0x119));var _0x12dc=function(_0x1dbff,_0x4b46e0){_0x1dbff=_0x1dbff-0x0;var _0x37d34e=_0x2dc1[_0x1dbff];return _0x37d34e;};'use strict';var Sequelize=require(_0x12dc('0x0'));module[_0x12dc('0x1')]={'name':{'type':Sequelize[_0x12dc('0x2')],'unique':_0x12dc('0x3')},'description':{'type':Sequelize[_0x12dc('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x12dc('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 3534b94..b09fab5 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 _0x3c14=['jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','get','Contexts','UserProfileResource','end','stack','name','VoiceContext','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','params','keys','length','find','create','body','join','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','destroy','root','writeFileSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../mysqldb'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x3c14,0x122));var _0x43c1=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x3c14[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require(_0x43c1('0x0'));var rimraf=require(_0x43c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x43c1('0x2'));var rp=require(_0x43c1('0x3'));var moment=require(_0x43c1('0x4'));var BPromise=require(_0x43c1('0x5'));var Mustache=require('mustache');var util=require(_0x43c1('0x6'));var path=require('path');var sox=require(_0x43c1('0x7'));var csv=require(_0x43c1('0x8'));var ejs=require(_0x43c1('0x9'));var fs=require('fs');var fs_extra=require(_0x43c1('0xa'));var _=require(_0x43c1('0xb'));var squel=require(_0x43c1('0xc'));var crypto=require('crypto');var jsforce=require(_0x43c1('0xd'));var deskjs=require(_0x43c1('0xe'));var toCsv=require(_0x43c1('0x8'));var querystring=require(_0x43c1('0xf'));var Papa=require(_0x43c1('0x10'));var Redis=require('ioredis');var authService=require(_0x43c1('0x11'));var qs=require(_0x43c1('0x12'));var as=require(_0x43c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43c1('0x14'))(_0x43c1('0x15'));var utils=require(_0x43c1('0x16'));var config=require(_0x43c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x43c1('0x18'))['db'];var jayson=require(_0x43c1('0x19'));var client=jayson[_0x43c1('0x1a')][_0x43c1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x57eb75,_0xa5e0ac,_0x32cb72,_0x37b80d){return new BPromise(function(_0x3b4108,_0x18596f){var _0x195be4=_0x37b80d||client;return _0x195be4['request'](_0x57eb75,_0x32cb72)[_0x43c1('0x1c')](function(_0x193650){logger[_0x43c1('0x1d')](_0x43c1('0x1e'),_0xa5e0ac,_0x43c1('0x1f'));logger[_0x43c1('0x20')](_0x43c1('0x21'),_0xa5e0ac,_0x43c1('0x1f'),JSON[_0x43c1('0x22')](_0x193650));if(_0x193650[_0x43c1('0x23')]){if(_0x193650[_0x43c1('0x23')][_0x43c1('0x24')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0xa5e0ac,_0x193650[_0x43c1('0x23')][_0x43c1('0x25')]);return _0x18596f(_0x193650[_0x43c1('0x23')][_0x43c1('0x25')]);}logger[_0x43c1('0x23')](_0x43c1('0x1e'),_0xa5e0ac,_0x193650[_0x43c1('0x23')][_0x43c1('0x25')]);return _0x3b4108(_0x193650[_0x43c1('0x23')]['message']);}else{logger['info'](_0x43c1('0x1e'),_0xa5e0ac,_0x43c1('0x1f'));_0x3b4108(_0x193650[_0x43c1('0x26')][_0x43c1('0x25')]);}})[_0x43c1('0x27')](function(_0x167a85){logger[_0x43c1('0x23')]('VoiceContext,\x20%s,\x20%s',_0xa5e0ac,_0x167a85);_0x18596f(_0x167a85);});});}function respondWithStatusCode(_0x3d7560,_0x594c39){_0x594c39=_0x594c39||0xcc;return function(_0x12515d){if(_0x12515d){return _0x3d7560[_0x43c1('0x28')](_0x594c39);}return _0x3d7560['status'](_0x594c39)['end']();};}function respondWithResult(_0x5b5762,_0x46f075){_0x46f075=_0x46f075||0xc8;return function(_0xc2fa07){if(_0xc2fa07){return _0x5b5762['status'](_0x46f075)[_0x43c1('0x29')](_0xc2fa07);}};}function respondWithFilteredResult(_0x51e2fb,_0xe952bd){return function(_0x453650){if(_0x453650){var _0x351177=typeof _0xe952bd['offset']===_0x43c1('0x2a')&&typeof _0xe952bd[_0x43c1('0x2b')]===_0x43c1('0x2a');var _0x5f1ada=_0x453650[_0x43c1('0x2c')];var _0x57ff43=_0x351177?0x0:_0xe952bd[_0x43c1('0x2d')];var _0x37410c=_0x351177?_0x453650[_0x43c1('0x2c')]:_0xe952bd['offset']+_0xe952bd[_0x43c1('0x2b')];var _0x4ead72;if(_0x37410c>=_0x5f1ada){_0x37410c=_0x5f1ada;_0x4ead72=0xc8;}else{_0x4ead72=0xce;}_0x51e2fb[_0x43c1('0x2e')](_0x4ead72);return _0x51e2fb[_0x43c1('0x2f')](_0x43c1('0x30'),_0x57ff43+'-'+_0x37410c+'/'+_0x5f1ada)[_0x43c1('0x29')](_0x453650);}return null;};}function patchUpdates(_0x2601d3){return function(_0x2805f3){try{jsonpatch['apply'](_0x2805f3,_0x2601d3,!![]);}catch(_0x225b4c){return BPromise[_0x43c1('0x31')](_0x225b4c);}return _0x2805f3[_0x43c1('0x32')]();};}function saveUpdates(_0x43836e,_0x5767d4){return function(_0x11df01){if(_0x11df01){return _0x11df01[_0x43c1('0x33')](_0x43836e)[_0x43c1('0x1c')](function(_0x93eadf){return _0x93eadf;});}return null;};}function removeEntity(_0x43b5df,_0x547633){return function(_0x370ca0){if(_0x370ca0){return _0x370ca0['destroy']()[_0x43c1('0x1c')](function(){var _0x5529f6=_0x370ca0[_0x43c1('0x34')]({'plain':!![]});var _0x10fed4=_0x43c1('0x35');return db[_0x43c1('0x36')]['destroy']({'where':{'type':_0x10fed4,'resourceId':_0x5529f6['id']}})[_0x43c1('0x1c')](function(){return _0x370ca0;});})[_0x43c1('0x1c')](function(){_0x43b5df[_0x43c1('0x2e')](0xcc)[_0x43c1('0x37')]();});}};}function handleEntityNotFound(_0x134a4f,_0x13cbc2){return function(_0x202751){if(!_0x202751){_0x134a4f['sendStatus'](0x194);}return _0x202751;};}function handleError(_0x4ee5a8,_0x4be881){_0x4be881=_0x4be881||0x1f4;return function(_0x483914){logger['error'](_0x483914[_0x43c1('0x38')]);if(_0x483914['name']){delete _0x483914[_0x43c1('0x39')];}_0x4ee5a8[_0x43c1('0x2e')](_0x4be881)['send'](_0x483914);};}exports['index']=function(_0x5b70e3,_0x19c6d4){var _0x1dcbbf={},_0x16fd54={},_0x5f56cd={'count':0x0,'rows':[]};var _0x4ba2fb=_['map'](db[_0x43c1('0x3a')][_0x43c1('0x3b')],function(_0x73f8a1){return{'name':_0x73f8a1[_0x43c1('0x3c')],'type':_0x73f8a1[_0x43c1('0x3d')][_0x43c1('0x3e')]};});_0x16fd54[_0x43c1('0x3f')]=_['map'](_0x4ba2fb,'name');_0x16fd54[_0x43c1('0x40')]=_['keys'](_0x5b70e3[_0x43c1('0x40')]);_0x16fd54[_0x43c1('0x41')]=_[_0x43c1('0x42')](_0x16fd54[_0x43c1('0x3f')],_0x16fd54['query']);_0x1dcbbf[_0x43c1('0x43')]=_[_0x43c1('0x42')](_0x16fd54[_0x43c1('0x3f')],qs[_0x43c1('0x44')](_0x5b70e3['query'][_0x43c1('0x44')]));_0x1dcbbf[_0x43c1('0x43')]=_0x1dcbbf['attributes']['length']?_0x1dcbbf[_0x43c1('0x43')]:_0x16fd54[_0x43c1('0x3f')];if(!_0x5b70e3[_0x43c1('0x40')][_0x43c1('0x45')](_0x43c1('0x46'))){_0x1dcbbf[_0x43c1('0x2b')]=qs[_0x43c1('0x2b')](_0x5b70e3['query'][_0x43c1('0x2b')]);_0x1dcbbf['offset']=qs['offset'](_0x5b70e3[_0x43c1('0x40')][_0x43c1('0x2d')]);}_0x1dcbbf[_0x43c1('0x47')]=qs[_0x43c1('0x48')](_0x5b70e3['query'][_0x43c1('0x48')]);_0x1dcbbf[_0x43c1('0x49')]=qs[_0x43c1('0x41')](_['pick'](_0x5b70e3[_0x43c1('0x40')],_0x16fd54['filters']),_0x4ba2fb);if(_0x5b70e3[_0x43c1('0x40')][_0x43c1('0x4a')]){_0x1dcbbf['where']=_[_0x43c1('0x4b')](_0x1dcbbf[_0x43c1('0x49')],{'$or':_['map'](_0x4ba2fb,function(_0xcf4c36){if(_0xcf4c36[_0x43c1('0x3d')]!==_0x43c1('0x4c')){var _0x3b2427={};_0x3b2427[_0xcf4c36[_0x43c1('0x39')]]={'$like':'%'+_0x5b70e3[_0x43c1('0x40')][_0x43c1('0x4a')]+'%'};return _0x3b2427;}})});}_0x1dcbbf=_[_0x43c1('0x4b')]({},_0x1dcbbf,_0x5b70e3[_0x43c1('0x4d')]);var _0x2518a4={'where':_0x1dcbbf['where']};return db['VoiceContext']['count'](_0x2518a4)['then'](function(_0x29e9fc){_0x5f56cd[_0x43c1('0x2c')]=_0x29e9fc;if(_0x5b70e3[_0x43c1('0x40')][_0x43c1('0x4e')]){_0x1dcbbf[_0x43c1('0x4f')]=[{'all':!![]}];}return db[_0x43c1('0x3a')]['findAll'](_0x1dcbbf);})[_0x43c1('0x1c')](function(_0x28bc65){_0x5f56cd['rows']=_0x28bc65;return _0x5f56cd;})[_0x43c1('0x1c')](respondWithFilteredResult(_0x19c6d4,_0x1dcbbf))[_0x43c1('0x27')](handleError(_0x19c6d4,null));};exports['show']=function(_0x400beb,_0x2aef1e){var _0x5da7d8={'raw':![],'where':{'id':_0x400beb[_0x43c1('0x50')]['id']}},_0x394090={};_0x394090[_0x43c1('0x3f')]=_[_0x43c1('0x51')](db['VoiceContext'][_0x43c1('0x3b')]);_0x394090[_0x43c1('0x40')]=_[_0x43c1('0x51')](_0x400beb[_0x43c1('0x40')]);_0x394090['filters']=_[_0x43c1('0x42')](_0x394090[_0x43c1('0x3f')],_0x394090[_0x43c1('0x40')]);_0x5da7d8[_0x43c1('0x43')]=_['intersection'](_0x394090[_0x43c1('0x3f')],qs[_0x43c1('0x44')](_0x400beb[_0x43c1('0x40')][_0x43c1('0x44')]));_0x5da7d8['attributes']=_0x5da7d8[_0x43c1('0x43')][_0x43c1('0x52')]?_0x5da7d8[_0x43c1('0x43')]:_0x394090[_0x43c1('0x3f')];if(_0x400beb[_0x43c1('0x40')][_0x43c1('0x4e')]){_0x5da7d8[_0x43c1('0x4f')]=[{'all':!![]}];}_0x5da7d8=_[_0x43c1('0x4b')]({},_0x5da7d8,_0x400beb[_0x43c1('0x4d')]);return db['VoiceContext'][_0x43c1('0x53')](_0x5da7d8)['then'](handleEntityNotFound(_0x2aef1e,null))[_0x43c1('0x1c')](respondWithResult(_0x2aef1e,null))[_0x43c1('0x27')](handleError(_0x2aef1e,null));};exports[_0x43c1('0x54')]=function(_0x2d1d83,_0x2dbcf2,_0x269c29){var _0x829fc8;return db[_0x43c1('0x3a')][_0x43c1('0x54')](_0x2d1d83[_0x43c1('0x55')],{'raw':!![]})[_0x43c1('0x1c')](function(_0x508439){_0x829fc8=_0x508439;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x43c1('0x1c')](function(_0x2a91f2){var _0x2dc1a0=fs['readFileSync'](path[_0x43c1('0x56')](config['root'],_0x43c1('0x57')),'utf8');var _0x35ccf1=ejs[_0x43c1('0x58')](_0x2dc1a0,{'contexts':_0x2a91f2||[]});fs['writeFileSync'](_0x43c1('0x59'),_0x35ccf1);})[_0x43c1('0x1c')](function(){return respondWithRpcPromise(_0x43c1('0x5a'),'create',{'module':_0x43c1('0x5b')});})[_0x43c1('0x1c')](function(){var _0x58e2a2=_0x2d1d83[_0x43c1('0x5c')][_0x43c1('0x34')]({'plain':!![]});if(!_0x58e2a2)throw new Error(_0x43c1('0x5d'));if(_0x58e2a2[_0x43c1('0x5e')]===_0x43c1('0x5c')){var _0x4457cc=_0x829fc8[_0x43c1('0x34')]({'plain':!![]});return db[_0x43c1('0x5f')][_0x43c1('0x53')]({'where':{'name':_0x43c1('0x35'),'userProfileId':_0x58e2a2[_0x43c1('0x60')]},'raw':!![]})['then'](function(_0x2b3c42){if(_0x2b3c42&&_0x2b3c42[_0x43c1('0x61')]===0x0){return db[_0x43c1('0x36')][_0x43c1('0x54')]({'name':_0x4457cc[_0x43c1('0x39')],'resourceId':_0x4457cc['id'],'type':_0x2b3c42['name'],'sectionId':_0x2b3c42['id']},{})['then'](function(){return _0x829fc8;});}else{return _0x829fc8;}})[_0x43c1('0x27')](function(_0x559eb0){logger[_0x43c1('0x23')](_0x43c1('0x62'),_0x559eb0);throw _0x559eb0;});}return _0x829fc8;})['then'](respondWithResult(_0x2dbcf2,0xc9))[_0x43c1('0x27')](handleError(_0x2dbcf2,null));};exports[_0x43c1('0x33')]=function(_0x52fa49,_0x26bb8e,_0x4fe0d3){var _0x2ee4f3;return db[_0x43c1('0x3a')][_0x43c1('0x53')]({'where':{'id':_0x52fa49[_0x43c1('0x50')]['id']}})[_0x43c1('0x1c')](handleEntityNotFound(_0x26bb8e,null))['then'](saveUpdates(_0x52fa49[_0x43c1('0x55')],null))[_0x43c1('0x1c')](function(_0x5994e0){if(_0x5994e0){_0x2ee4f3=_0x5994e0;return db['VoiceContext'][_0x43c1('0x63')]({'raw':!![]});}})[_0x43c1('0x1c')](function(_0x195382){var _0x2faed7=fs[_0x43c1('0x64')](path[_0x43c1('0x56')](config['root'],_0x43c1('0x57')),_0x43c1('0x65'));var _0x137408=ejs[_0x43c1('0x58')](_0x2faed7,{'contexts':_0x195382||[]});fs['writeFileSync'](_0x43c1('0x59'),_0x137408);})[_0x43c1('0x1c')](function(){return respondWithRpcPromise(_0x43c1('0x5a'),_0x43c1('0x33'),{'module':_0x43c1('0x5b')});})[_0x43c1('0x1c')](function(){return _0x2ee4f3;})[_0x43c1('0x1c')](respondWithResult(_0x26bb8e,null))[_0x43c1('0x27')](handleError(_0x26bb8e,null));};exports[_0x43c1('0x66')]=function(_0x46094d,_0x2ccee6,_0x1e2726){var _0x3717ce;return db[_0x43c1('0x3a')][_0x43c1('0x53')]({'where':{'id':_0x46094d[_0x43c1('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ccee6,null))['then'](removeEntity(_0x2ccee6,null))[_0x43c1('0x1c')](function(){return db[_0x43c1('0x3a')]['findAll']({'raw':!![]});})[_0x43c1('0x1c')](function(_0x1eb49e){var _0x2146af=fs[_0x43c1('0x64')](path['join'](config[_0x43c1('0x67')],_0x43c1('0x57')),'utf8');var _0x27e398=ejs[_0x43c1('0x58')](_0x2146af,{'contexts':_0x1eb49e});fs[_0x43c1('0x68')](_0x43c1('0x59'),_0x27e398);return respondWithRpcPromise(_0x43c1('0x5a'),_0x43c1('0x66'),{'module':_0x43c1('0x5b')});})[_0x43c1('0x27')](handleError(_0x2ccee6,null));}; \ No newline at end of file +var _0x8bb4=['stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','map','VoiceContext','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8bb4,0x10b));var _0x48bb=function(_0x478f7c,_0xf81ea1){_0x478f7c=_0x478f7c-0x0;var _0x2fb711=_0x8bb4[_0x478f7c];return _0x2fb711;};'use strict';var emlformat=require(_0x48bb('0x0'));var rimraf=require(_0x48bb('0x1'));var zipdir=require(_0x48bb('0x2'));var jsonpatch=require(_0x48bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x48bb('0x4'));var Mustache=require(_0x48bb('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x48bb('0x6'));var ejs=require(_0x48bb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x48bb('0x8'));var crypto=require(_0x48bb('0x9'));var jsforce=require(_0x48bb('0xa'));var deskjs=require(_0x48bb('0xb'));var toCsv=require(_0x48bb('0x6'));var querystring=require(_0x48bb('0xc'));var Papa=require(_0x48bb('0xd'));var Redis=require(_0x48bb('0xe'));var authService=require(_0x48bb('0xf'));var qs=require(_0x48bb('0x10'));var as=require(_0x48bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48bb('0x12'))('api');var utils=require(_0x48bb('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x48bb('0x14'));var client=jayson[_0x48bb('0x15')][_0x48bb('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2464e2,_0x28cb68,_0x5d2c24,_0x522008){return new BPromise(function(_0x5122cc,_0x3e6a98){var _0x2bfe33=_0x522008||client;return _0x2bfe33[_0x48bb('0x17')](_0x2464e2,_0x5d2c24)[_0x48bb('0x18')](function(_0x1fd539){logger[_0x48bb('0x19')](_0x48bb('0x1a'),_0x28cb68,_0x48bb('0x1b'));logger[_0x48bb('0x1c')](_0x48bb('0x1d'),_0x28cb68,'request\x20sent',JSON[_0x48bb('0x1e')](_0x1fd539));if(_0x1fd539[_0x48bb('0x1f')]){if(_0x1fd539[_0x48bb('0x1f')][_0x48bb('0x20')]===0x1f4){logger[_0x48bb('0x1f')](_0x48bb('0x1a'),_0x28cb68,_0x1fd539[_0x48bb('0x1f')][_0x48bb('0x21')]);return _0x3e6a98(_0x1fd539[_0x48bb('0x1f')]['message']);}logger[_0x48bb('0x1f')](_0x48bb('0x1a'),_0x28cb68,_0x1fd539[_0x48bb('0x1f')][_0x48bb('0x21')]);return _0x5122cc(_0x1fd539[_0x48bb('0x1f')][_0x48bb('0x21')]);}else{logger[_0x48bb('0x19')]('VoiceContext,\x20%s,\x20%s',_0x28cb68,_0x48bb('0x1b'));_0x5122cc(_0x1fd539[_0x48bb('0x22')][_0x48bb('0x21')]);}})['catch'](function(_0x574a16){logger[_0x48bb('0x1f')](_0x48bb('0x1a'),_0x28cb68,_0x574a16);_0x3e6a98(_0x574a16);});});}function respondWithStatusCode(_0x472554,_0x4750d9){_0x4750d9=_0x4750d9||0xcc;return function(_0x18438d){if(_0x18438d){return _0x472554[_0x48bb('0x23')](_0x4750d9);}return _0x472554[_0x48bb('0x24')](_0x4750d9)[_0x48bb('0x25')]();};}function respondWithResult(_0x60ca23,_0x1e73fc){_0x1e73fc=_0x1e73fc||0xc8;return function(_0x29d63b){if(_0x29d63b){return _0x60ca23[_0x48bb('0x24')](_0x1e73fc)[_0x48bb('0x26')](_0x29d63b);}};}function respondWithFilteredResult(_0x40d158,_0x455a63){return function(_0xefd81d){if(_0xefd81d){var _0x5a680a=typeof _0x455a63['offset']===_0x48bb('0x27')&&typeof _0x455a63['limit']===_0x48bb('0x27');var _0x3f6905=_0xefd81d[_0x48bb('0x28')];var _0x4919a7=_0x5a680a?0x0:_0x455a63[_0x48bb('0x29')];var _0x31b9a0=_0x5a680a?_0xefd81d[_0x48bb('0x28')]:_0x455a63['offset']+_0x455a63[_0x48bb('0x2a')];var _0x56a93a;if(_0x31b9a0>=_0x3f6905){_0x31b9a0=_0x3f6905;_0x56a93a=0xc8;}else{_0x56a93a=0xce;}_0x40d158[_0x48bb('0x24')](_0x56a93a);return _0x40d158[_0x48bb('0x2b')]('Content-Range',_0x4919a7+'-'+_0x31b9a0+'/'+_0x3f6905)[_0x48bb('0x26')](_0xefd81d);}return null;};}function patchUpdates(_0x5c2b20){return function(_0xfd142f){try{jsonpatch[_0x48bb('0x2c')](_0xfd142f,_0x5c2b20,!![]);}catch(_0x419382){return BPromise[_0x48bb('0x2d')](_0x419382);}return _0xfd142f[_0x48bb('0x2e')]();};}function saveUpdates(_0x346675,_0x5b4898){return function(_0x381bfb){if(_0x381bfb){return _0x381bfb[_0x48bb('0x2f')](_0x346675)[_0x48bb('0x18')](function(_0x2715c5){return _0x2715c5;});}return null;};}function removeEntity(_0x4e354a,_0x463b64){return function(_0x442b30){if(_0x442b30){return _0x442b30[_0x48bb('0x30')]()['then'](function(){var _0x29b57c=_0x442b30['get']({'plain':!![]});var _0x57c40f=_0x48bb('0x31');return db[_0x48bb('0x32')][_0x48bb('0x30')]({'where':{'type':_0x57c40f,'resourceId':_0x29b57c['id']}})[_0x48bb('0x18')](function(){return _0x442b30;});})[_0x48bb('0x18')](function(){_0x4e354a[_0x48bb('0x24')](0xcc)[_0x48bb('0x25')]();});}};}function handleEntityNotFound(_0x33e67a,_0x28bff3){return function(_0x23dfa9){if(!_0x23dfa9){_0x33e67a[_0x48bb('0x23')](0x194);}return _0x23dfa9;};}function handleError(_0x2f2541,_0x1e5bf4){_0x1e5bf4=_0x1e5bf4||0x1f4;return function(_0x1bbaa0){logger['error'](_0x1bbaa0[_0x48bb('0x33')]);if(_0x1bbaa0[_0x48bb('0x34')]){delete _0x1bbaa0['name'];}_0x2f2541['status'](_0x1e5bf4)['send'](_0x1bbaa0);};}exports['index']=function(_0x48833e,_0x2a4633){var _0x5efc8d={},_0x1c6e16={},_0x1f0655={'count':0x0,'rows':[]};var _0xea1884=_[_0x48bb('0x35')](db[_0x48bb('0x36')]['rawAttributes'],function(_0x35728e){return{'name':_0x35728e['fieldName'],'type':_0x35728e[_0x48bb('0x37')][_0x48bb('0x38')]};});_0x1c6e16[_0x48bb('0x39')]=_[_0x48bb('0x35')](_0xea1884,_0x48bb('0x34'));_0x1c6e16[_0x48bb('0x3a')]=_[_0x48bb('0x3b')](_0x48833e['query']);_0x1c6e16['filters']=_[_0x48bb('0x3c')](_0x1c6e16[_0x48bb('0x39')],_0x1c6e16['query']);_0x5efc8d[_0x48bb('0x3d')]=_[_0x48bb('0x3c')](_0x1c6e16[_0x48bb('0x39')],qs[_0x48bb('0x3e')](_0x48833e[_0x48bb('0x3a')]['fields']));_0x5efc8d[_0x48bb('0x3d')]=_0x5efc8d[_0x48bb('0x3d')]['length']?_0x5efc8d['attributes']:_0x1c6e16[_0x48bb('0x39')];if(!_0x48833e['query'][_0x48bb('0x3f')]('nolimit')){_0x5efc8d['limit']=qs[_0x48bb('0x2a')](_0x48833e['query'][_0x48bb('0x2a')]);_0x5efc8d[_0x48bb('0x29')]=qs[_0x48bb('0x29')](_0x48833e[_0x48bb('0x3a')]['offset']);}_0x5efc8d['order']=qs['sort'](_0x48833e['query'][_0x48bb('0x40')]);_0x5efc8d[_0x48bb('0x41')]=qs[_0x48bb('0x42')](_[_0x48bb('0x43')](_0x48833e['query'],_0x1c6e16['filters']),_0xea1884);if(_0x48833e['query'][_0x48bb('0x44')]){_0x5efc8d['where']=_['merge'](_0x5efc8d[_0x48bb('0x41')],{'$or':_[_0x48bb('0x35')](_0xea1884,function(_0x5a5646){if(_0x5a5646[_0x48bb('0x37')]!==_0x48bb('0x45')){var _0x5536e8={};_0x5536e8[_0x5a5646[_0x48bb('0x34')]]={'$like':'%'+_0x48833e[_0x48bb('0x3a')][_0x48bb('0x44')]+'%'};return _0x5536e8;}})});}_0x5efc8d=_[_0x48bb('0x46')]({},_0x5efc8d,_0x48833e['options']);var _0x90f62a={'where':_0x5efc8d[_0x48bb('0x41')]};return db['VoiceContext'][_0x48bb('0x28')](_0x90f62a)[_0x48bb('0x18')](function(_0x5eac9b){_0x1f0655[_0x48bb('0x28')]=_0x5eac9b;if(_0x48833e[_0x48bb('0x3a')][_0x48bb('0x47')]){_0x5efc8d[_0x48bb('0x48')]=[{'all':!![]}];}return db[_0x48bb('0x36')][_0x48bb('0x49')](_0x5efc8d);})[_0x48bb('0x18')](function(_0x1dfb0d){_0x1f0655[_0x48bb('0x4a')]=_0x1dfb0d;return _0x1f0655;})[_0x48bb('0x18')](respondWithFilteredResult(_0x2a4633,_0x5efc8d))[_0x48bb('0x4b')](handleError(_0x2a4633,null));};exports['show']=function(_0x142368,_0x340495){var _0x4ae798={'raw':![],'where':{'id':_0x142368[_0x48bb('0x4c')]['id']}},_0xfe6f60={};_0xfe6f60['model']=_['keys'](db[_0x48bb('0x36')][_0x48bb('0x4d')]);_0xfe6f60[_0x48bb('0x3a')]=_[_0x48bb('0x3b')](_0x142368[_0x48bb('0x3a')]);_0xfe6f60[_0x48bb('0x42')]=_[_0x48bb('0x3c')](_0xfe6f60[_0x48bb('0x39')],_0xfe6f60[_0x48bb('0x3a')]);_0x4ae798[_0x48bb('0x3d')]=_[_0x48bb('0x3c')](_0xfe6f60[_0x48bb('0x39')],qs[_0x48bb('0x3e')](_0x142368[_0x48bb('0x3a')][_0x48bb('0x3e')]));_0x4ae798['attributes']=_0x4ae798[_0x48bb('0x3d')][_0x48bb('0x4e')]?_0x4ae798[_0x48bb('0x3d')]:_0xfe6f60[_0x48bb('0x39')];if(_0x142368['query'][_0x48bb('0x47')]){_0x4ae798[_0x48bb('0x48')]=[{'all':!![]}];}_0x4ae798=_[_0x48bb('0x46')]({},_0x4ae798,_0x142368[_0x48bb('0x4f')]);return db[_0x48bb('0x36')]['find'](_0x4ae798)['then'](handleEntityNotFound(_0x340495,null))[_0x48bb('0x18')](respondWithResult(_0x340495,null))['catch'](handleError(_0x340495,null));};exports[_0x48bb('0x50')]=function(_0x5f2c8c,_0x52328d,_0xbefcd7){var _0x1ea5b6;return db[_0x48bb('0x36')][_0x48bb('0x50')](_0x5f2c8c[_0x48bb('0x51')],{'raw':!![]})[_0x48bb('0x18')](function(_0x12725f){_0x1ea5b6=_0x12725f;return db[_0x48bb('0x36')]['findAll']({'raw':!![]});})[_0x48bb('0x18')](function(_0x3e6840){var _0x427887=fs[_0x48bb('0x52')](path[_0x48bb('0x53')](config[_0x48bb('0x54')],_0x48bb('0x55')),_0x48bb('0x56'));var _0x121370=ejs[_0x48bb('0x57')](_0x427887,{'contexts':_0x3e6840||[]});fs[_0x48bb('0x58')](_0x48bb('0x59'),_0x121370);})[_0x48bb('0x18')](function(){return respondWithRpcPromise(_0x48bb('0x5a'),'create',{'module':_0x48bb('0x5b')});})['then'](function(){var _0x23c776=_0x5f2c8c['user'][_0x48bb('0x5c')]({'plain':!![]});if(!_0x23c776)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23c776[_0x48bb('0x5d')]===_0x48bb('0x5e')){var _0x4abb57=_0x1ea5b6[_0x48bb('0x5c')]({'plain':!![]});return db[_0x48bb('0x5f')][_0x48bb('0x60')]({'where':{'name':_0x48bb('0x31'),'userProfileId':_0x23c776[_0x48bb('0x61')]},'raw':!![]})[_0x48bb('0x18')](function(_0x19979a){if(_0x19979a&&_0x19979a[_0x48bb('0x62')]===0x0){return db[_0x48bb('0x32')][_0x48bb('0x50')]({'name':_0x4abb57[_0x48bb('0x34')],'resourceId':_0x4abb57['id'],'type':_0x19979a[_0x48bb('0x34')],'sectionId':_0x19979a['id']},{})[_0x48bb('0x18')](function(){return _0x1ea5b6;});}else{return _0x1ea5b6;}})[_0x48bb('0x4b')](function(_0x30c361){logger[_0x48bb('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30c361);throw _0x30c361;});}return _0x1ea5b6;})[_0x48bb('0x18')](respondWithResult(_0x52328d,0xc9))[_0x48bb('0x4b')](handleError(_0x52328d,null));};exports[_0x48bb('0x2f')]=function(_0x5774f0,_0x1ded3c,_0x2c55ac){var _0x4b5e57;return db[_0x48bb('0x36')][_0x48bb('0x60')]({'where':{'id':_0x5774f0[_0x48bb('0x4c')]['id']}})[_0x48bb('0x18')](handleEntityNotFound(_0x1ded3c,null))[_0x48bb('0x18')](saveUpdates(_0x5774f0[_0x48bb('0x51')],null))[_0x48bb('0x18')](function(_0x2d0e41){if(_0x2d0e41){_0x4b5e57=_0x2d0e41;return db[_0x48bb('0x36')][_0x48bb('0x49')]({'raw':!![]});}})[_0x48bb('0x18')](function(_0x2e2d04){var _0x25e21a=fs[_0x48bb('0x52')](path['join'](config[_0x48bb('0x54')],_0x48bb('0x55')),'utf8');var _0x4af52e=ejs['render'](_0x25e21a,{'contexts':_0x2e2d04||[]});fs['writeFileSync'](_0x48bb('0x59'),_0x4af52e);})[_0x48bb('0x18')](function(){return respondWithRpcPromise('Reload',_0x48bb('0x2f'),{'module':_0x48bb('0x5b')});})[_0x48bb('0x18')](function(){return _0x4b5e57;})[_0x48bb('0x18')](respondWithResult(_0x1ded3c,null))[_0x48bb('0x4b')](handleError(_0x1ded3c,null));};exports[_0x48bb('0x30')]=function(_0x1fc38a,_0xb3c580,_0x57b5ee){var _0x3cf49f;return db['VoiceContext'][_0x48bb('0x60')]({'where':{'id':_0x1fc38a[_0x48bb('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb3c580,null))['then'](removeEntity(_0xb3c580,null))[_0x48bb('0x18')](function(){return db[_0x48bb('0x36')][_0x48bb('0x49')]({'raw':!![]});})[_0x48bb('0x18')](function(_0x108b6f){var _0x385ac2=fs[_0x48bb('0x52')](path[_0x48bb('0x53')](config['root'],_0x48bb('0x55')),_0x48bb('0x56'));var _0x26edb8=ejs[_0x48bb('0x57')](_0x385ac2,{'contexts':_0x108b6f});fs[_0x48bb('0x58')](_0x48bb('0x59'),_0x26edb8);return respondWithRpcPromise(_0x48bb('0x5a'),_0x48bb('0x30'),{'module':_0x48bb('0x5b')});})['catch'](handleError(_0xb3c580,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7f66137..4d4c741 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 _0xf674=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf674,0x18c));var _0x4f67=function(_0x22d72b,_0x112e6d){_0x22d72b=_0x22d72b-0x0;var _0x35f65f=_0xf674[_0x22d72b];return _0x35f65f;};'use strict';var _=require('lodash');var util=require(_0x4f67('0x0'));var logger=require(_0x4f67('0x1'))('api');var moment=require(_0x4f67('0x2'));var BPromise=require(_0x4f67('0x3'));var rp=require(_0x4f67('0x4'));var fs=require('fs');var path=require(_0x4f67('0x5'));var rimraf=require('rimraf');var config=require(_0x4f67('0x6'));var attributes=require(_0x4f67('0x7'));module[_0x4f67('0x8')]=function(_0x26d24c,_0x9dea95){return _0x26d24c['define'](_0x4f67('0x9'),attributes,{'tableName':_0x4f67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce17=['moment','bluebird','../../config/environment','./voiceContext.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0xce17,0x88));var _0x7ce1=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xce17[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x7ce1('0x0'));var util=require(_0x7ce1('0x1'));var logger=require(_0x7ce1('0x2'))(_0x7ce1('0x3'));var moment=require(_0x7ce1('0x4'));var BPromise=require(_0x7ce1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ce1('0x6'));var attributes=require(_0x7ce1('0x7'));module[_0x7ce1('0x8')]=function(_0x65ca18,_0x1b91ae){return _0x65ca18[_0x7ce1('0x9')]('VoiceContext',attributes,{'tableName':'voice_contexts','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 204451c..96002e3 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 _0x4e52=['client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x7132a9,_0x52cbdf){var _0x2de197=function(_0x394396){while(--_0x394396){_0x7132a9['push'](_0x7132a9['shift']());}};_0x2de197(++_0x52cbdf);}(_0x4e52,0x6e));var _0x24e5=function(_0x5e03ef,_0x573cf0){_0x5e03ef=_0x5e03ef-0x0;var _0x3162c5=_0x4e52[_0x5e03ef];return _0x3162c5;};'use strict';var _=require(_0x24e5('0x0'));var util=require(_0x24e5('0x1'));var moment=require(_0x24e5('0x2'));var BPromise=require(_0x24e5('0x3'));var rs=require(_0x24e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24e5('0x5'))['db'];var utils=require(_0x24e5('0x6'));var logger=require(_0x24e5('0x7'))(_0x24e5('0x8'));var config=require('../../config/environment');var jayson=require(_0x24e5('0x9'));var client=jayson[_0x24e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43d53a,_0x246d35,_0x2acfae){return new BPromise(function(_0x172210,_0x38c993){return client['request'](_0x43d53a,_0x2acfae)[_0x24e5('0xb')](function(_0x29ffdd){logger[_0x24e5('0xc')](_0x24e5('0xd'),_0x246d35,_0x24e5('0xe'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x246d35,_0x24e5('0xe'),JSON[_0x24e5('0xf')](_0x29ffdd));if(_0x29ffdd[_0x24e5('0x10')]){if(_0x29ffdd[_0x24e5('0x10')][_0x24e5('0x11')]===0x1f4){logger[_0x24e5('0x10')](_0x24e5('0xd'),_0x246d35,_0x29ffdd[_0x24e5('0x10')]['message']);return _0x38c993(_0x29ffdd[_0x24e5('0x10')][_0x24e5('0x12')]);}logger[_0x24e5('0x10')]('VoiceContext,\x20%s,\x20%s',_0x246d35,_0x29ffdd[_0x24e5('0x10')]['message']);return _0x172210(_0x29ffdd[_0x24e5('0x10')][_0x24e5('0x12')]);}else{logger[_0x24e5('0xc')](_0x24e5('0xd'),_0x246d35,_0x24e5('0xe'));_0x172210(_0x29ffdd['result']['message']);}})[_0x24e5('0x13')](function(_0x508174){logger[_0x24e5('0x10')](_0x24e5('0xd'),_0x246d35,_0x508174);_0x38c993(_0x508174);});});} \ No newline at end of file +var _0x4ad3=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x57ff3d,_0x551fbd){_0x57ff3d=_0x57ff3d-0x0;var _0xf4ab01=_0x4ad3[_0x57ff3d];return _0xf4ab01;};'use strict';var _=require(_0x34ad('0x0'));var util=require(_0x34ad('0x1'));var moment=require(_0x34ad('0x2'));var BPromise=require(_0x34ad('0x3'));var rs=require(_0x34ad('0x4'));var fs=require('fs');var Redis=require(_0x34ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ad('0x6'));var logger=require(_0x34ad('0x7'))(_0x34ad('0x8'));var config=require(_0x34ad('0x9'));var jayson=require(_0x34ad('0xa'));var client=jayson[_0x34ad('0xb')][_0x34ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b927b,_0x674cc7,_0x10d356){return new BPromise(function(_0x4b6c38,_0x582178){return client[_0x34ad('0xd')](_0x3b927b,_0x10d356)[_0x34ad('0xe')](function(_0xb6c4f5){logger[_0x34ad('0xf')]('VoiceContext,\x20%s,\x20%s',_0x674cc7,_0x34ad('0x10'));logger[_0x34ad('0x11')](_0x34ad('0x12'),_0x674cc7,_0x34ad('0x10'),JSON[_0x34ad('0x13')](_0xb6c4f5));if(_0xb6c4f5[_0x34ad('0x14')]){if(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x15')]===0x1f4){logger[_0x34ad('0x14')](_0x34ad('0x16'),_0x674cc7,_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);return _0x582178(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);}logger[_0x34ad('0x14')](_0x34ad('0x16'),_0x674cc7,_0xb6c4f5['error'][_0x34ad('0x17')]);return _0x4b6c38(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);}else{logger['info'](_0x34ad('0x16'),_0x674cc7,_0x34ad('0x10'));_0x4b6c38(_0xb6c4f5[_0x34ad('0x18')][_0x34ad('0x17')]);}})[_0x34ad('0x19')](function(_0x48e90a){logger[_0x34ad('0x14')]('VoiceContext,\x20%s,\x20%s',_0x674cc7,_0x48e90a);_0x582178(_0x48e90a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c43ce3b..17a131c 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 _0x0a35=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x29e347,_0x1cdc20){var _0x3c0063=function(_0x145476){while(--_0x145476){_0x29e347['push'](_0x29e347['shift']());}};_0x3c0063(++_0x1cdc20);}(_0x0a35,0xe1));var _0x50a3=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x0a35[_0x5ebc04];return _0x17845c;};'use strict';var multer=require(_0x50a3('0x0'));var util=require(_0x50a3('0x1'));var path=require(_0x50a3('0x2'));var timeout=require(_0x50a3('0x3'));var express=require(_0x50a3('0x4'));var router=express[_0x50a3('0x5')]();var fs_extra=require(_0x50a3('0x6'));var auth=require(_0x50a3('0x7'));var interaction=require(_0x50a3('0x8'));var config=require('../../config/environment');var controller=require(_0x50a3('0x9'));router[_0x50a3('0xa')]('/',auth[_0x50a3('0xb')](),controller[_0x50a3('0xc')]);router['get'](_0x50a3('0xd'),auth[_0x50a3('0xb')](),controller['describe']);router[_0x50a3('0xa')](_0x50a3('0xe'),auth[_0x50a3('0xb')](),controller[_0x50a3('0xf')]);router[_0x50a3('0x10')]('/',auth['isAuthenticated'](),controller[_0x50a3('0x11')]);router[_0x50a3('0x12')](_0x50a3('0xe'),auth[_0x50a3('0xb')](),controller['update']);router['delete'](_0x50a3('0xe'),auth['isAuthenticated'](),controller[_0x50a3('0x13')]);module[_0x50a3('0x14')]=router; \ No newline at end of file +var _0xe85c=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete'];(function(_0x972b32,_0x56ea80){var _0x6e8e75=function(_0x488ed9){while(--_0x488ed9){_0x972b32['push'](_0x972b32['shift']());}};_0x6e8e75(++_0x56ea80);}(_0xe85c,0x1a6));var _0xce85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe85c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xce85('0x0'));var util=require('util');var path=require(_0xce85('0x1'));var timeout=require(_0xce85('0x2'));var express=require(_0xce85('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xce85('0x4'));var interaction=require(_0xce85('0x5'));var config=require(_0xce85('0x6'));var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xce85('0x7')]);router[_0xce85('0x8')](_0xce85('0x9'),auth[_0xce85('0xa')](),controller[_0xce85('0xb')]);router[_0xce85('0x8')](_0xce85('0xc'),auth['isAuthenticated'](),controller[_0xce85('0xd')]);router['post']('/',auth[_0xce85('0xa')](),controller[_0xce85('0xe')]);router[_0xce85('0xf')](_0xce85('0xc'),auth['isAuthenticated'](),controller[_0xce85('0x10')]);router[_0xce85('0x11')](_0xce85('0xc'),auth['isAuthenticated'](),controller[_0xce85('0x12')]);module[_0xce85('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8d7781b..65c2d4d 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 _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4bf232,_0x111448){var _0x35404e=function(_0x12c4d5){while(--_0x12c4d5){_0x4bf232['push'](_0x4bf232['shift']());}};_0x35404e(++_0x111448);}(_0x9bde,0xe1));var _0xe9bd=function(_0x7e3c6a,_0x185dd1){_0x7e3c6a=_0x7e3c6a-0x0;var _0x11cefe=_0x9bde[_0x7e3c6a];return _0x11cefe;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file +var _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x23a8ba,_0xab5848){var _0x468389=function(_0x5ea5f4){while(--_0x5ea5f4){_0x23a8ba['push'](_0x23a8ba['shift']());}};_0x468389(++_0xab5848);}(_0xe14d,0x1ee));var _0xde14=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe14d[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index b3963f7..d50559b 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 _0xb85b=['count','offset','set','Content-Range','apply','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x3ca4ac,_0x345a43){var _0x10e44b=function(_0x98b6c3){while(--_0x98b6c3){_0x3ca4ac['push'](_0x3ca4ac['shift']());}};_0x10e44b(++_0x345a43);}(_0xb85b,0x16a));var _0xbb85=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb85b[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0xbb85('0x0'));var rimraf=require(_0xbb85('0x1'));var zipdir=require(_0xbb85('0x2'));var jsonpatch=require(_0xbb85('0x3'));var rp=require(_0xbb85('0x4'));var moment=require('moment');var BPromise=require(_0xbb85('0x5'));var Mustache=require(_0xbb85('0x6'));var util=require(_0xbb85('0x7'));var path=require(_0xbb85('0x8'));var sox=require(_0xbb85('0x9'));var csv=require(_0xbb85('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb85('0xb'));var _=require(_0xbb85('0xc'));var squel=require(_0xbb85('0xd'));var crypto=require(_0xbb85('0xe'));var jsforce=require(_0xbb85('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbb85('0xa'));var querystring=require(_0xbb85('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb85('0x11'));var qs=require(_0xbb85('0x12'));var as=require(_0xbb85('0x13'));var hardwareService=require(_0xbb85('0x14'));var logger=require(_0xbb85('0x15'))(_0xbb85('0x16'));var utils=require(_0xbb85('0x17'));var config=require(_0xbb85('0x18'));var licenseUtil=require(_0xbb85('0x19'));var db=require(_0xbb85('0x1a'))['db'];function respondWithStatusCode(_0x2e5129,_0x4ef369){_0x4ef369=_0x4ef369||0xcc;return function(_0x19e206){if(_0x19e206){return _0x2e5129[_0xbb85('0x1b')](_0x4ef369);}return _0x2e5129['status'](_0x4ef369)[_0xbb85('0x1c')]();};}function respondWithResult(_0x38b244,_0x19d2da){_0x19d2da=_0x19d2da||0xc8;return function(_0x4b9d72){if(_0x4b9d72){return _0x38b244[_0xbb85('0x1d')](_0x19d2da)[_0xbb85('0x1e')](_0x4b9d72);}};}function respondWithFilteredResult(_0x2bccd7,_0x2f9579){return function(_0x3b86a3){if(_0x3b86a3){var _0x5704f0=typeof _0x2f9579['offset']===_0xbb85('0x1f')&&typeof _0x2f9579[_0xbb85('0x20')]===_0xbb85('0x1f');var _0x5aeb23=_0x3b86a3[_0xbb85('0x21')];var _0x436624=_0x5704f0?0x0:_0x2f9579[_0xbb85('0x22')];var _0x24dfa1=_0x5704f0?_0x3b86a3[_0xbb85('0x21')]:_0x2f9579[_0xbb85('0x22')]+_0x2f9579[_0xbb85('0x20')];var _0x57dc49;if(_0x24dfa1>=_0x5aeb23){_0x24dfa1=_0x5aeb23;_0x57dc49=0xc8;}else{_0x57dc49=0xce;}_0x2bccd7[_0xbb85('0x1d')](_0x57dc49);return _0x2bccd7[_0xbb85('0x23')](_0xbb85('0x24'),_0x436624+'-'+_0x24dfa1+'/'+_0x5aeb23)[_0xbb85('0x1e')](_0x3b86a3);}return null;};}function patchUpdates(_0x2b655d){return function(_0xe17bd3){try{jsonpatch[_0xbb85('0x25')](_0xe17bd3,_0x2b655d,!![]);}catch(_0x38a0fa){return BPromise['reject'](_0x38a0fa);}return _0xe17bd3['save']();};}function saveUpdates(_0x1087c9,_0x3cf1dd){return function(_0x38bb61){if(_0x38bb61){return _0x38bb61['update'](_0x1087c9)[_0xbb85('0x26')](function(_0x48d977){return _0x48d977;});}return null;};}function removeEntity(_0xd22137,_0x4e2553){return function(_0x3ab404){if(_0x3ab404){return _0x3ab404['destroy']()[_0xbb85('0x26')](function(){_0xd22137[_0xbb85('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x235bd4,_0x452375){return function(_0x345793){if(!_0x345793){_0x235bd4[_0xbb85('0x1b')](0x194);}return _0x345793;};}function handleError(_0x546cfe,_0x3f4b19){_0x3f4b19=_0x3f4b19||0x1f4;return function(_0x5a30bb){logger[_0xbb85('0x27')](_0x5a30bb[_0xbb85('0x28')]);if(_0x5a30bb[_0xbb85('0x29')]){delete _0x5a30bb[_0xbb85('0x29')];}_0x546cfe[_0xbb85('0x1d')](_0x3f4b19)[_0xbb85('0x2a')](_0x5a30bb);};}exports[_0xbb85('0x2b')]=function(_0x17ed66,_0x537378){var _0x1c9907={},_0x2faac7={},_0x141617={'count':0x0,'rows':[]};var _0x46083c=_[_0xbb85('0x2c')](db['VoiceDialReport'][_0xbb85('0x2d')],function(_0x1f2e58){return{'name':_0x1f2e58[_0xbb85('0x2e')],'type':_0x1f2e58[_0xbb85('0x2f')]['key']};});_0x2faac7[_0xbb85('0x30')]=_['map'](_0x46083c,_0xbb85('0x29'));_0x2faac7[_0xbb85('0x31')]=_['keys'](_0x17ed66['query']);_0x2faac7[_0xbb85('0x32')]=_[_0xbb85('0x33')](_0x2faac7[_0xbb85('0x30')],_0x2faac7[_0xbb85('0x31')]);_0x1c9907[_0xbb85('0x34')]=_['intersection'](_0x2faac7[_0xbb85('0x30')],qs[_0xbb85('0x35')](_0x17ed66[_0xbb85('0x31')][_0xbb85('0x35')]));_0x1c9907[_0xbb85('0x34')]=_0x1c9907[_0xbb85('0x34')][_0xbb85('0x36')]?_0x1c9907[_0xbb85('0x34')]:_0x2faac7['model'];if(!_0x17ed66[_0xbb85('0x31')][_0xbb85('0x37')](_0xbb85('0x38'))){_0x1c9907[_0xbb85('0x20')]=qs[_0xbb85('0x20')](_0x17ed66[_0xbb85('0x31')][_0xbb85('0x20')]);_0x1c9907[_0xbb85('0x22')]=qs[_0xbb85('0x22')](_0x17ed66[_0xbb85('0x31')][_0xbb85('0x22')]);}_0x1c9907[_0xbb85('0x39')]=qs[_0xbb85('0x3a')](_0x17ed66[_0xbb85('0x31')][_0xbb85('0x3a')]);_0x1c9907['where']=qs[_0xbb85('0x32')](_['pick'](_0x17ed66[_0xbb85('0x31')],_0x2faac7['filters']),_0x46083c);if(_0x17ed66['query'][_0xbb85('0x3b')]){_0x1c9907[_0xbb85('0x3c')]=_[_0xbb85('0x3d')](_0x1c9907[_0xbb85('0x3c')],{'$or':_[_0xbb85('0x2c')](_0x46083c,function(_0x5b4a93){if(_0x5b4a93[_0xbb85('0x2f')]!==_0xbb85('0x3e')){var _0x12e496={};_0x12e496[_0x5b4a93[_0xbb85('0x29')]]={'$like':'%'+_0x17ed66[_0xbb85('0x31')][_0xbb85('0x3b')]+'%'};return _0x12e496;}})});}_0x1c9907=_[_0xbb85('0x3d')]({},_0x1c9907,_0x17ed66[_0xbb85('0x3f')]);var _0x4649b8={'where':_0x1c9907[_0xbb85('0x3c')]};return db[_0xbb85('0x40')]['count'](_0x4649b8)[_0xbb85('0x26')](function(_0x3b7881){_0x141617[_0xbb85('0x21')]=_0x3b7881;if(_0x17ed66[_0xbb85('0x31')][_0xbb85('0x41')]){_0x1c9907[_0xbb85('0x42')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xbb85('0x43')](_0x1c9907);})[_0xbb85('0x26')](function(_0x31203e){_0x141617[_0xbb85('0x44')]=_0x31203e;return _0x141617;})['then'](respondWithFilteredResult(_0x537378,_0x1c9907))[_0xbb85('0x45')](handleError(_0x537378,null));};exports[_0xbb85('0x46')]=function(_0x50d232,_0x57b7d7){var _0x256d33={'raw':!![],'where':{'id':_0x50d232[_0xbb85('0x47')]['id']}},_0x1d890f={};_0x1d890f[_0xbb85('0x30')]=_['keys'](db[_0xbb85('0x40')]['rawAttributes']);_0x1d890f[_0xbb85('0x31')]=_[_0xbb85('0x48')](_0x50d232[_0xbb85('0x31')]);_0x1d890f[_0xbb85('0x32')]=_[_0xbb85('0x33')](_0x1d890f[_0xbb85('0x30')],_0x1d890f[_0xbb85('0x31')]);_0x256d33[_0xbb85('0x34')]=_[_0xbb85('0x33')](_0x1d890f[_0xbb85('0x30')],qs['fields'](_0x50d232['query'][_0xbb85('0x35')]));_0x256d33[_0xbb85('0x34')]=_0x256d33[_0xbb85('0x34')][_0xbb85('0x36')]?_0x256d33[_0xbb85('0x34')]:_0x1d890f[_0xbb85('0x30')];if(_0x50d232[_0xbb85('0x31')][_0xbb85('0x41')]){_0x256d33['include']=[{'all':!![]}];}_0x256d33=_[_0xbb85('0x3d')]({},_0x256d33,_0x50d232[_0xbb85('0x3f')]);return db['VoiceDialReport'][_0xbb85('0x49')](_0x256d33)[_0xbb85('0x26')](handleEntityNotFound(_0x57b7d7,null))['then'](respondWithResult(_0x57b7d7,null))[_0xbb85('0x45')](handleError(_0x57b7d7,null));};exports[_0xbb85('0x4a')]=function(_0x5ef45c,_0x1d32ed){return db['VoiceDialReport'][_0xbb85('0x4a')](_0x5ef45c[_0xbb85('0x4b')],{})['then'](respondWithResult(_0x1d32ed,0xc9))[_0xbb85('0x45')](handleError(_0x1d32ed,null));};exports[_0xbb85('0x4c')]=function(_0x50ce29,_0x27feb2){if(_0x50ce29[_0xbb85('0x4b')]['id']){delete _0x50ce29[_0xbb85('0x4b')]['id'];}return db[_0xbb85('0x40')][_0xbb85('0x49')]({'where':{'id':_0x50ce29['params']['id']}})[_0xbb85('0x26')](handleEntityNotFound(_0x27feb2,null))[_0xbb85('0x26')](saveUpdates(_0x50ce29[_0xbb85('0x4b')],null))[_0xbb85('0x26')](respondWithResult(_0x27feb2,null))[_0xbb85('0x45')](handleError(_0x27feb2,null));};exports[_0xbb85('0x4d')]=function(_0x236ffc,_0x2bbd94){return db[_0xbb85('0x40')][_0xbb85('0x49')]({'where':{'id':_0x236ffc[_0xbb85('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bbd94,null))[_0xbb85('0x26')](removeEntity(_0x2bbd94,null))[_0xbb85('0x45')](handleError(_0x2bbd94,null));};exports[_0xbb85('0x4e')]=function(_0x276235,_0x59301e){return db[_0xbb85('0x40')]['describe']()['then'](respondWithResult(_0x59301e,null))[_0xbb85('0x45')](handleError(_0x59301e,null));}; \ No newline at end of file +var _0xf776=['count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','model','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','merge','options','find','catch','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x5a529b,_0x555ba9){var _0x3a1ab5=function(_0x32d72b){while(--_0x32d72b){_0x5a529b['push'](_0x5a529b['shift']());}};_0x3a1ab5(++_0x555ba9);}(_0xf776,0x1a7));var _0x6f77=function(_0x113562,_0x527d2b){_0x113562=_0x113562-0x0;var _0x3c0b74=_0xf776[_0x113562];return _0x3c0b74;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f77('0x0'));var jsonpatch=require(_0x6f77('0x1'));var rp=require(_0x6f77('0x2'));var moment=require(_0x6f77('0x3'));var BPromise=require(_0x6f77('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f77('0x5'));var sox=require('sox');var csv=require(_0x6f77('0x6'));var ejs=require(_0x6f77('0x7'));var fs=require('fs');var fs_extra=require(_0x6f77('0x8'));var _=require(_0x6f77('0x9'));var squel=require(_0x6f77('0xa'));var crypto=require(_0x6f77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6f77('0xc'));var toCsv=require(_0x6f77('0x6'));var querystring=require(_0x6f77('0xd'));var Papa=require(_0x6f77('0xe'));var Redis=require('ioredis');var authService=require(_0x6f77('0xf'));var qs=require(_0x6f77('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f77('0x11'));var logger=require(_0x6f77('0x12'))(_0x6f77('0x13'));var utils=require('../../config/utils');var config=require(_0x6f77('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f77('0x15'))['db'];function respondWithStatusCode(_0x4e211d,_0x5d5177){_0x5d5177=_0x5d5177||0xcc;return function(_0x8c8de2){if(_0x8c8de2){return _0x4e211d[_0x6f77('0x16')](_0x5d5177);}return _0x4e211d[_0x6f77('0x17')](_0x5d5177)[_0x6f77('0x18')]();};}function respondWithResult(_0xbde09a,_0x2b2589){_0x2b2589=_0x2b2589||0xc8;return function(_0x96d7fe){if(_0x96d7fe){return _0xbde09a[_0x6f77('0x17')](_0x2b2589)['json'](_0x96d7fe);}};}function respondWithFilteredResult(_0x5a80e4,_0x24f097){return function(_0x4f8505){if(_0x4f8505){var _0x13c058=typeof _0x24f097[_0x6f77('0x19')]===_0x6f77('0x1a')&&typeof _0x24f097['limit']==='undefined';var _0x3ea09e=_0x4f8505['count'];var _0x3d3085=_0x13c058?0x0:_0x24f097[_0x6f77('0x19')];var _0x43389d=_0x13c058?_0x4f8505[_0x6f77('0x1b')]:_0x24f097[_0x6f77('0x19')]+_0x24f097[_0x6f77('0x1c')];var _0x3adbc4;if(_0x43389d>=_0x3ea09e){_0x43389d=_0x3ea09e;_0x3adbc4=0xc8;}else{_0x3adbc4=0xce;}_0x5a80e4[_0x6f77('0x17')](_0x3adbc4);return _0x5a80e4[_0x6f77('0x1d')](_0x6f77('0x1e'),_0x3d3085+'-'+_0x43389d+'/'+_0x3ea09e)[_0x6f77('0x1f')](_0x4f8505);}return null;};}function patchUpdates(_0x17c0c4){return function(_0x5427ea){try{jsonpatch[_0x6f77('0x20')](_0x5427ea,_0x17c0c4,!![]);}catch(_0x505230){return BPromise[_0x6f77('0x21')](_0x505230);}return _0x5427ea[_0x6f77('0x22')]();};}function saveUpdates(_0x41e15,_0x156f14){return function(_0x522c37){if(_0x522c37){return _0x522c37[_0x6f77('0x23')](_0x41e15)[_0x6f77('0x24')](function(_0x363cf2){return _0x363cf2;});}return null;};}function removeEntity(_0x3d7c22,_0x12734d){return function(_0x457d57){if(_0x457d57){return _0x457d57['destroy']()[_0x6f77('0x24')](function(){_0x3d7c22[_0x6f77('0x17')](0xcc)[_0x6f77('0x18')]();});}};}function handleEntityNotFound(_0x330bb5,_0x3bddd4){return function(_0x265611){if(!_0x265611){_0x330bb5[_0x6f77('0x16')](0x194);}return _0x265611;};}function handleError(_0x4ecaf0,_0xb361d4){_0xb361d4=_0xb361d4||0x1f4;return function(_0x59cb5b){logger[_0x6f77('0x25')](_0x59cb5b[_0x6f77('0x26')]);if(_0x59cb5b[_0x6f77('0x27')]){delete _0x59cb5b['name'];}_0x4ecaf0['status'](_0xb361d4)[_0x6f77('0x28')](_0x59cb5b);};}exports['index']=function(_0x3ac770,_0x38a9f8){var _0x57596d={},_0x13f0b4={},_0x3709ac={'count':0x0,'rows':[]};var _0x2bd43f=_[_0x6f77('0x29')](db[_0x6f77('0x2a')][_0x6f77('0x2b')],function(_0x7f5eaf){return{'name':_0x7f5eaf[_0x6f77('0x2c')],'type':_0x7f5eaf[_0x6f77('0x2d')]['key']};});_0x13f0b4[_0x6f77('0x2e')]=_[_0x6f77('0x29')](_0x2bd43f,_0x6f77('0x27'));_0x13f0b4['query']=_['keys'](_0x3ac770['query']);_0x13f0b4[_0x6f77('0x2f')]=_['intersection'](_0x13f0b4['model'],_0x13f0b4[_0x6f77('0x30')]);_0x57596d['attributes']=_[_0x6f77('0x31')](_0x13f0b4[_0x6f77('0x2e')],qs[_0x6f77('0x32')](_0x3ac770[_0x6f77('0x30')][_0x6f77('0x32')]));_0x57596d[_0x6f77('0x33')]=_0x57596d[_0x6f77('0x33')]['length']?_0x57596d[_0x6f77('0x33')]:_0x13f0b4[_0x6f77('0x2e')];if(!_0x3ac770[_0x6f77('0x30')][_0x6f77('0x34')](_0x6f77('0x35'))){_0x57596d[_0x6f77('0x1c')]=qs[_0x6f77('0x1c')](_0x3ac770[_0x6f77('0x30')][_0x6f77('0x1c')]);_0x57596d['offset']=qs[_0x6f77('0x19')](_0x3ac770[_0x6f77('0x30')][_0x6f77('0x19')]);}_0x57596d[_0x6f77('0x36')]=qs[_0x6f77('0x37')](_0x3ac770[_0x6f77('0x30')]['sort']);_0x57596d[_0x6f77('0x38')]=qs[_0x6f77('0x2f')](_[_0x6f77('0x39')](_0x3ac770['query'],_0x13f0b4[_0x6f77('0x2f')]),_0x2bd43f);if(_0x3ac770[_0x6f77('0x30')][_0x6f77('0x3a')]){_0x57596d[_0x6f77('0x38')]=_['merge'](_0x57596d[_0x6f77('0x38')],{'$or':_[_0x6f77('0x29')](_0x2bd43f,function(_0x544b6c){if(_0x544b6c[_0x6f77('0x2d')]!==_0x6f77('0x3b')){var _0x46601a={};_0x46601a[_0x544b6c[_0x6f77('0x27')]]={'$like':'%'+_0x3ac770[_0x6f77('0x30')][_0x6f77('0x3a')]+'%'};return _0x46601a;}})});}_0x57596d=_['merge']({},_0x57596d,_0x3ac770['options']);var _0x123e20={'where':_0x57596d[_0x6f77('0x38')]};return db[_0x6f77('0x2a')]['count'](_0x123e20)[_0x6f77('0x24')](function(_0x2ad131){_0x3709ac[_0x6f77('0x1b')]=_0x2ad131;if(_0x3ac770[_0x6f77('0x30')][_0x6f77('0x3c')]){_0x57596d[_0x6f77('0x3d')]=[{'all':!![]}];}return db[_0x6f77('0x2a')][_0x6f77('0x3e')](_0x57596d);})[_0x6f77('0x24')](function(_0x3422c8){_0x3709ac[_0x6f77('0x3f')]=_0x3422c8;return _0x3709ac;})[_0x6f77('0x24')](respondWithFilteredResult(_0x38a9f8,_0x57596d))['catch'](handleError(_0x38a9f8,null));};exports[_0x6f77('0x40')]=function(_0x1c76b5,_0xd0c1fe){var _0x50349e={'raw':!![],'where':{'id':_0x1c76b5[_0x6f77('0x41')]['id']}},_0x1c0e59={};_0x1c0e59[_0x6f77('0x2e')]=_[_0x6f77('0x42')](db['VoiceDialReport'][_0x6f77('0x2b')]);_0x1c0e59[_0x6f77('0x30')]=_[_0x6f77('0x42')](_0x1c76b5[_0x6f77('0x30')]);_0x1c0e59[_0x6f77('0x2f')]=_[_0x6f77('0x31')](_0x1c0e59[_0x6f77('0x2e')],_0x1c0e59['query']);_0x50349e['attributes']=_['intersection'](_0x1c0e59['model'],qs[_0x6f77('0x32')](_0x1c76b5['query']['fields']));_0x50349e[_0x6f77('0x33')]=_0x50349e[_0x6f77('0x33')][_0x6f77('0x43')]?_0x50349e[_0x6f77('0x33')]:_0x1c0e59[_0x6f77('0x2e')];if(_0x1c76b5[_0x6f77('0x30')][_0x6f77('0x3c')]){_0x50349e[_0x6f77('0x3d')]=[{'all':!![]}];}_0x50349e=_[_0x6f77('0x44')]({},_0x50349e,_0x1c76b5[_0x6f77('0x45')]);return db[_0x6f77('0x2a')][_0x6f77('0x46')](_0x50349e)['then'](handleEntityNotFound(_0xd0c1fe,null))[_0x6f77('0x24')](respondWithResult(_0xd0c1fe,null))[_0x6f77('0x47')](handleError(_0xd0c1fe,null));};exports['create']=function(_0xa71c27,_0x1e17b4){return db['VoiceDialReport']['create'](_0xa71c27['body'],{})[_0x6f77('0x24')](respondWithResult(_0x1e17b4,0xc9))['catch'](handleError(_0x1e17b4,null));};exports[_0x6f77('0x23')]=function(_0x2770f1,_0x5c8de6){if(_0x2770f1[_0x6f77('0x48')]['id']){delete _0x2770f1[_0x6f77('0x48')]['id'];}return db['VoiceDialReport'][_0x6f77('0x46')]({'where':{'id':_0x2770f1[_0x6f77('0x41')]['id']}})[_0x6f77('0x24')](handleEntityNotFound(_0x5c8de6,null))[_0x6f77('0x24')](saveUpdates(_0x2770f1[_0x6f77('0x48')],null))[_0x6f77('0x24')](respondWithResult(_0x5c8de6,null))[_0x6f77('0x47')](handleError(_0x5c8de6,null));};exports[_0x6f77('0x49')]=function(_0x5c672a,_0x4535f9){return db[_0x6f77('0x2a')][_0x6f77('0x46')]({'where':{'id':_0x5c672a[_0x6f77('0x41')]['id']}})[_0x6f77('0x24')](handleEntityNotFound(_0x4535f9,null))[_0x6f77('0x24')](removeEntity(_0x4535f9,null))[_0x6f77('0x47')](handleError(_0x4535f9,null));};exports['describe']=function(_0x132447,_0x3152b0){return db['VoiceDialReport'][_0x6f77('0x4a')]()[_0x6f77('0x24')](respondWithResult(_0x3152b0,null))[_0x6f77('0x47')](handleError(_0x3152b0,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 89d9708..6f1ca2b 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 _0x7c05=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','VoiceDialReport'];(function(_0xa6531e,_0x30d655){var _0x3c80b4=function(_0x2cc00c){while(--_0x2cc00c){_0xa6531e['push'](_0xa6531e['shift']());}};_0x3c80b4(++_0x30d655);}(_0x7c05,0x154));var _0x57c0=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x7c05[_0x115621];return _0x5ef5ce;};'use strict';var _=require(_0x57c0('0x0'));var util=require(_0x57c0('0x1'));var logger=require('../../config/logger')(_0x57c0('0x2'));var moment=require(_0x57c0('0x3'));var BPromise=require(_0x57c0('0x4'));var rp=require(_0x57c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57c0('0x6'));var config=require(_0x57c0('0x7'));var attributes=require(_0x57c0('0x8'));module['exports']=function(_0xf2b5e3,_0x4917dc){return _0xf2b5e3['define'](_0x57c0('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x190a=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x286314,_0x199345){var _0x713f9b=function(_0xa4325){while(--_0xa4325){_0x286314['push'](_0x286314['shift']());}};_0x713f9b(++_0x199345);}(_0x190a,0x1ea));var _0xa190=function(_0x17c0ce,_0x2e1332){_0x17c0ce=_0x17c0ce-0x0;var _0x369fe3=_0x190a[_0x17c0ce];return _0x369fe3;};'use strict';var _=require(_0xa190('0x0'));var util=require(_0xa190('0x1'));var logger=require(_0xa190('0x2'))(_0xa190('0x3'));var moment=require(_0xa190('0x4'));var BPromise=require(_0xa190('0x5'));var rp=require(_0xa190('0x6'));var fs=require('fs');var path=require(_0xa190('0x7'));var rimraf=require(_0xa190('0x8'));var config=require('../../config/environment');var attributes=require(_0xa190('0x9'));module['exports']=function(_0x230098,_0x2207f2){return _0x230098['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xa190('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 87f7584..10153fb 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 _0xc43e=['ioredis','../../mysqldb','../../config/logger','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','VoiceDialReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0xc43e,0x15b));var _0xec43=function(_0x575cc0,_0x542e2f){_0x575cc0=_0x575cc0-0x0;var _0x4dc16f=_0xc43e[_0x575cc0];return _0x4dc16f;};'use strict';var _=require(_0xec43('0x0'));var util=require(_0xec43('0x1'));var moment=require(_0xec43('0x2'));var BPromise=require(_0xec43('0x3'));var rs=require(_0xec43('0x4'));var fs=require('fs');var Redis=require(_0xec43('0x5'));var db=require(_0xec43('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xec43('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec43('0x8')][_0xec43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122c92,_0x1aab24,_0x14838d){return new BPromise(function(_0x3ca02b,_0x238388){return client['request'](_0x122c92,_0x14838d)[_0xec43('0xa')](function(_0x474592){logger[_0xec43('0xb')](_0xec43('0xc'),_0x1aab24,_0xec43('0xd'));logger[_0xec43('0xe')](_0xec43('0xf'),_0x1aab24,_0xec43('0xd'),JSON[_0xec43('0x10')](_0x474592));if(_0x474592[_0xec43('0x11')]){if(_0x474592[_0xec43('0x11')]['code']===0x1f4){logger[_0xec43('0x11')](_0xec43('0xc'),_0x1aab24,_0x474592[_0xec43('0x11')][_0xec43('0x12')]);return _0x238388(_0x474592['error'][_0xec43('0x12')]);}logger[_0xec43('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1aab24,_0x474592[_0xec43('0x11')]['message']);return _0x3ca02b(_0x474592[_0xec43('0x11')]['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x1aab24,'request\x20sent');_0x3ca02b(_0x474592[_0xec43('0x13')][_0xec43('0x12')]);}})['catch'](function(_0x4f3d8d){logger[_0xec43('0x11')](_0xec43('0xc'),_0x1aab24,_0x4f3d8d);_0x238388(_0x4f3d8d);});});}exports['CreateVoiceDialReport']=function(_0x24cb48){var _0x115e3f=this;return new Promise(function(_0x27ef5b,_0x384362){return db['VoiceDialReport'][_0xec43('0x14')](_0x24cb48['body'],{'raw':_0x24cb48[_0xec43('0x15')]?_0x24cb48[_0xec43('0x15')][_0xec43('0x16')]===undefined?!![]:![]:!![]})[_0xec43('0xa')](function(_0x485685){logger[_0xec43('0xb')](_0xec43('0x17'),_0x24cb48);logger[_0xec43('0xe')]('CreateVoiceDialReport',_0x24cb48,JSON['stringify'](_0x485685));_0x27ef5b(_0x485685);})[_0xec43('0x18')](function(_0x183652){logger[_0xec43('0x11')](_0xec43('0x17'),_0x183652[_0xec43('0x12')],_0x24cb48);_0x384362(_0x115e3f[_0xec43('0x11')](0x1f4,_0x183652[_0xec43('0x12')]));});});};exports[_0xec43('0x19')]=function(_0xa8f6a1){var _0x5373b4=this;return new Promise(function(_0x12324d,_0x4c08cb){return db[_0xec43('0x1a')][_0xec43('0x1b')](_0xa8f6a1[_0xec43('0x1c')],{'raw':_0xa8f6a1[_0xec43('0x15')]?_0xa8f6a1[_0xec43('0x15')][_0xec43('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa8f6a1[_0xec43('0x15')]?_0xa8f6a1[_0xec43('0x15')][_0xec43('0x1d')]||null:null,'attributes':_0xa8f6a1[_0xec43('0x15')]?_0xa8f6a1[_0xec43('0x15')][_0xec43('0x1e')]||null:null,'limit':_0xa8f6a1[_0xec43('0x15')]?_0xa8f6a1[_0xec43('0x15')][_0xec43('0x1f')]||null:null})[_0xec43('0xa')](function(_0x3558c2){logger[_0xec43('0xb')](_0xec43('0x19'),_0xa8f6a1);logger[_0xec43('0xe')](_0xec43('0x19'),_0xa8f6a1,JSON[_0xec43('0x10')](_0x3558c2));_0x12324d(_0x3558c2);})[_0xec43('0x18')](function(_0x1c589b){logger[_0xec43('0x11')](_0xec43('0x19'),_0x1c589b['message'],_0xa8f6a1);_0x4c08cb(_0x5373b4[_0xec43('0x11')](0x1f4,_0x1c589b[_0xec43('0x12')]));});});}; \ No newline at end of file +var _0x25db=['client','http','request','info','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','catch','VoiceDialReport','create','body','options','raw','then','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x6b1915,_0x2e6dff){var _0x33befb=function(_0x2a0948){while(--_0x2a0948){_0x6b1915['push'](_0x6b1915['shift']());}};_0x33befb(++_0x2e6dff);}(_0x25db,0x120));var _0xb25d=function(_0x2d3fe5,_0x452127){_0x2d3fe5=_0x2d3fe5-0x0;var _0xdc99e1=_0x25db[_0x2d3fe5];return _0xdc99e1;};'use strict';var _=require(_0xb25d('0x0'));var util=require(_0xb25d('0x1'));var moment=require(_0xb25d('0x2'));var BPromise=require(_0xb25d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb25d('0x4'));var db=require(_0xb25d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb25d('0x6'))('rpc');var config=require(_0xb25d('0x7'));var jayson=require(_0xb25d('0x8'));var client=jayson[_0xb25d('0x9')][_0xb25d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ec059,_0x3060a5,_0x5c59b8){return new BPromise(function(_0x220610,_0x171b5f){return client[_0xb25d('0xb')](_0x3ec059,_0x5c59b8)['then'](function(_0x4324ea){logger[_0xb25d('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x3060a5,_0xb25d('0xd'));logger['debug'](_0xb25d('0xe'),_0x3060a5,_0xb25d('0xd'),JSON[_0xb25d('0xf')](_0x4324ea));if(_0x4324ea[_0xb25d('0x10')]){if(_0x4324ea[_0xb25d('0x10')][_0xb25d('0x11')]===0x1f4){logger[_0xb25d('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3060a5,_0x4324ea['error'][_0xb25d('0x12')]);return _0x171b5f(_0x4324ea['error'][_0xb25d('0x12')]);}logger['error'](_0xb25d('0x13'),_0x3060a5,_0x4324ea[_0xb25d('0x10')][_0xb25d('0x12')]);return _0x220610(_0x4324ea[_0xb25d('0x10')][_0xb25d('0x12')]);}else{logger[_0xb25d('0xc')](_0xb25d('0x13'),_0x3060a5,_0xb25d('0xd'));_0x220610(_0x4324ea['result'][_0xb25d('0x12')]);}})[_0xb25d('0x14')](function(_0xe7701d){logger[_0xb25d('0x10')](_0xb25d('0x13'),_0x3060a5,_0xe7701d);_0x171b5f(_0xe7701d);});});}exports['CreateVoiceDialReport']=function(_0x4b1c92){var _0x30885d=this;return new Promise(function(_0x12667d,_0x2148f7){return db[_0xb25d('0x15')][_0xb25d('0x16')](_0x4b1c92[_0xb25d('0x17')],{'raw':_0x4b1c92[_0xb25d('0x18')]?_0x4b1c92[_0xb25d('0x18')][_0xb25d('0x19')]===undefined?!![]:![]:!![]})[_0xb25d('0x1a')](function(_0x22be5c){logger[_0xb25d('0xc')](_0xb25d('0x1b'),_0x4b1c92);logger['debug'](_0xb25d('0x1b'),_0x4b1c92,JSON[_0xb25d('0xf')](_0x22be5c));_0x12667d(_0x22be5c);})['catch'](function(_0x2cea75){logger[_0xb25d('0x10')](_0xb25d('0x1b'),_0x2cea75[_0xb25d('0x12')],_0x4b1c92);_0x2148f7(_0x30885d[_0xb25d('0x10')](0x1f4,_0x2cea75[_0xb25d('0x12')]));});});};exports[_0xb25d('0x1c')]=function(_0x54de6c){var _0x5e41a4=this;return new Promise(function(_0xeb4556,_0x916a1a){return db[_0xb25d('0x15')][_0xb25d('0x1d')](_0x54de6c[_0xb25d('0x17')],{'raw':_0x54de6c['options']?_0x54de6c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54de6c[_0xb25d('0x18')]?_0x54de6c[_0xb25d('0x18')][_0xb25d('0x1e')]||null:null,'attributes':_0x54de6c[_0xb25d('0x18')]?_0x54de6c[_0xb25d('0x18')][_0xb25d('0x1f')]||null:null,'limit':_0x54de6c['options']?_0x54de6c[_0xb25d('0x18')][_0xb25d('0x20')]||null:null})['then'](function(_0xa9626d){logger[_0xb25d('0xc')](_0xb25d('0x1c'),_0x54de6c);logger['debug'](_0xb25d('0x1c'),_0x54de6c,JSON['stringify'](_0xa9626d));_0xeb4556(_0xa9626d);})['catch'](function(_0x2c65e9){logger[_0xb25d('0x10')](_0xb25d('0x1c'),_0x2c65e9[_0xb25d('0x12')],_0x54de6c);_0x916a1a(_0x5e41a4[_0xb25d('0x10')](0x1f4,_0x2c65e9[_0xb25d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a896a35..dae2645 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 _0x152a=['connect-timeout','express','fs-extra','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','create','/:id/applications','put','update','delete','exports','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x152a,0x97));var _0xa152=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0x152a[_0x541a67];return _0x45da2a;};'use strict';var multer=require('multer');var util=require(_0xa152('0x0'));var path=require(_0xa152('0x1'));var timeout=require(_0xa152('0x2'));var express=require(_0xa152('0x3'));var router=express['Router']();var fs_extra=require(_0xa152('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa152('0x5'));var controller=require(_0xa152('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa152('0x7')](_0xa152('0x8'),auth[_0xa152('0x9')](),controller[_0xa152('0xa')]);router['post']('/',auth[_0xa152('0x9')](),controller[_0xa152('0xb')]);router['post'](_0xa152('0xc'),auth[_0xa152('0x9')](),controller['addApplications']);router[_0xa152('0xd')](_0xa152('0x8'),auth['isAuthenticated'](),controller[_0xa152('0xe')]);router[_0xa152('0xf')](_0xa152('0x8'),auth[_0xa152('0x9')](),controller['destroy']);module[_0xa152('0x10')]=router; \ No newline at end of file +var _0xe130=['post','create','/:id/applications','addApplications','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show'];(function(_0x47d7ec,_0x17f197){var _0x98674a=function(_0x4f7db3){while(--_0x4f7db3){_0x47d7ec['push'](_0x47d7ec['shift']());}};_0x98674a(++_0x17f197);}(_0xe130,0x1bf));var _0x0e13=function(_0x1b9318,_0x92fd9d){_0x1b9318=_0x1b9318-0x0;var _0x3d5cf6=_0xe130[_0x1b9318];return _0x3d5cf6;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require(_0x0e13('0x2'));var timeout=require(_0x0e13('0x3'));var express=require(_0x0e13('0x4'));var router=express[_0x0e13('0x5')]();var fs_extra=require(_0x0e13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var controller=require(_0x0e13('0x9'));router[_0x0e13('0xa')]('/',auth['isAuthenticated'](),controller[_0x0e13('0xb')]);router[_0x0e13('0xa')](_0x0e13('0xc'),auth[_0x0e13('0xd')](),controller[_0x0e13('0xe')]);router[_0x0e13('0xf')]('/',auth[_0x0e13('0xd')](),controller[_0x0e13('0x10')]);router[_0x0e13('0xf')](_0x0e13('0x11'),auth[_0x0e13('0xd')](),controller[_0x0e13('0x12')]);router['put'](_0x0e13('0xc'),auth[_0x0e13('0xd')](),controller['update']);router[_0x0e13('0x13')](_0x0e13('0xc'),auth['isAuthenticated'](),controller[_0x0e13('0x14')]);module[_0x0e13('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 736e7a1..30afaa1 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 _0x2621=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2621,0x1a8));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1262('0x0'));module[_0x1262('0x1')]={'context':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'unique':_0x1262('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x1262('0x3')},'tag':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1262('0x2')],'allowNull':![],'defaultValue':_0x1262('0x4')},'appdata':{'type':Sequelize[_0x1262('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1262('0x5')](_0x1262('0x6'),_0x1262('0x7'),_0x1262('0x8'),_0x1262('0x9'),_0x1262('0xa'),_0x1262('0xb'),_0x1262('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x1262('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1262('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1262('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1262('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x1262('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1262('0xf')]},'recordingFormat':{'type':Sequelize[_0x1262('0x2')],'defaultValue':_0x1262('0x10')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x1262('0x11')],'get':function(_0x2a4b0f){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x1262('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x4414=['internal','outbound-fax','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','outbound'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4414,0xfe));var _0x4441=function(_0x16e1d5,_0x26b53b){_0x16e1d5=_0x16e1d5-0x0;var _0x534f2c=_0x4414[_0x16e1d5];return _0x534f2c;};'use strict';var Sequelize=require('sequelize');module[_0x4441('0x0')]={'context':{'type':Sequelize[_0x4441('0x1')],'allowNull':![],'unique':_0x4441('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4441('0x1')],'allowNull':![],'unique':_0x4441('0x2')},'priority':{'type':Sequelize[_0x4441('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x4441('0x2')},'tag':{'type':Sequelize[_0x4441('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4441('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4441('0x4')]('inbound',_0x4441('0x5'),_0x4441('0x6'),'inbound-fax',_0x4441('0x7'),'system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4441('0x1')],'allowNull':![],'defaultValue':_0x4441('0x8')},'IntervalId':{'type':Sequelize[_0x4441('0x9')]},'isApp':{'type':Sequelize[_0x4441('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x4441('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x4441('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4441('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4441('0xb')],'get':function(_0x4b768f){return this[_0x4441('0xc')]('exten');}},'alias':{'type':Sequelize[_0x4441('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 94e7c0f..0f8e075 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 _0xddc4=['redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','destroy','sendStatus','error','stack','send','index','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch','show','VoiceExtension','rawAttributes','length','params','create','startsWith','exten','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x4b0ebd,_0x589e2f){var _0x30f640=function(_0xc3ea66){while(--_0xc3ea66){_0x4b0ebd['push'](_0x4b0ebd['shift']());}};_0x30f640(++_0x589e2f);}(_0xddc4,0x17b));var _0x4ddc=function(_0xdee463,_0x4941a6){_0xdee463=_0xdee463-0x0;var _0x4541c0=_0xddc4[_0xdee463];return _0x4541c0;};'use strict';var _=require('lodash');var Redis=require(_0x4ddc('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x4ddc('0x1'))(_0x4ddc('0x2'));var config=require(_0x4ddc('0x3'));var db=require(_0x4ddc('0x4'))['db'];config[_0x4ddc('0x5')]=_[_0x4ddc('0x6')](config[_0x4ddc('0x5')],{'host':_0x4ddc('0x7'),'port':0x18eb});var socket=require(_0x4ddc('0x8'))(new Redis(config[_0x4ddc('0x5')]));require(_0x4ddc('0x9'))[_0x4ddc('0xa')](socket);function respondWithStatusCode(_0x3dc318,_0x2f441a){_0x2f441a=_0x2f441a||0xcc;return function(_0x2e11f8){if(_0x2e11f8){return _0x3dc318['sendStatus'](_0x2f441a);}return _0x3dc318[_0x4ddc('0xb')](_0x2f441a)[_0x4ddc('0xc')]();};}function respondWithResult(_0x46d90c,_0x2bac1a){_0x2bac1a=_0x2bac1a||0xc8;return function(_0x5f06d0){if(_0x5f06d0){return _0x46d90c[_0x4ddc('0xb')](_0x2bac1a)[_0x4ddc('0xd')](_0x5f06d0);}};}function respondWithFilteredResult(_0x176226,_0x20c227){return function(_0x459519){if(_0x459519){var _0x24a6fa=typeof _0x20c227[_0x4ddc('0xe')]==='undefined'&&typeof _0x20c227[_0x4ddc('0xf')]===_0x4ddc('0x10');var _0x515232=_0x459519[_0x4ddc('0x11')];var _0x323a81=_0x24a6fa?0x0:_0x20c227[_0x4ddc('0xe')];var _0x405d00=_0x24a6fa?_0x459519[_0x4ddc('0x11')]:_0x20c227[_0x4ddc('0xe')]+_0x20c227['limit'];var _0x32041d;if(_0x405d00>=_0x515232){_0x405d00=_0x515232;_0x32041d=0xc8;}else{_0x32041d=0xce;}_0x176226[_0x4ddc('0xb')](_0x32041d);return _0x176226['set'](_0x4ddc('0x12'),_0x323a81+'-'+_0x405d00+'/'+_0x515232)[_0x4ddc('0xd')](_0x459519);}return null;};}function removeEntity(_0x382b75){return function(_0x54a446){if(_0x54a446){return _0x54a446['destroy']()[_0x4ddc('0x13')](function(){var _0x183dea=_0x54a446[_0x4ddc('0x14')]({'plain':!![]});var _0x3fa911=[{'name':_0x4ddc('0x15'),'value':_0x4ddc('0x16'),'ignore':![]},{'name':_0x4ddc('0x17'),'value':_0x4ddc('0x18'),'ignore':![]},{'name':_0x4ddc('0x19'),'value':_0x4ddc('0x1a'),'ignore':![]}];var _0x209f8f=_(_0x3fa911)[_0x4ddc('0x1b')](_0x4ddc('0x1c'))[_0x4ddc('0x1d')](_0x4ddc('0x1e'))['value']();if(_[_0x4ddc('0x1f')](_0x209f8f,_0x183dea['type'])){return;}var _0x56927e=_[_0x4ddc('0x20')](_0x3fa911,[_0x4ddc('0x1e'),_0x183dea[_0x4ddc('0x21')]])[_0x4ddc('0x22')];return db['UserProfileResource'][_0x4ddc('0x23')]({'where':{'type':_0x56927e,'resourceId':_0x183dea['id']}})[_0x4ddc('0x13')](function(){return _0x54a446;});})[_0x4ddc('0x13')](function(){_0x382b75[_0x4ddc('0xb')](0xcc)[_0x4ddc('0xc')]();});}};}function handleEntityNotFound(_0x136f8e){return function(_0xd752a){if(!_0xd752a){_0x136f8e[_0x4ddc('0x24')](0x194);}return _0xd752a;};}function handleError(_0x3d80d9,_0x369c6a){_0x369c6a=_0x369c6a||0x1f4;return function(_0x4c4cf0){logger[_0x4ddc('0x25')](_0x4c4cf0[_0x4ddc('0x26')]);if(_0x4c4cf0['name']){delete _0x4c4cf0['name'];}_0x3d80d9['status'](_0x369c6a)[_0x4ddc('0x27')](_0x4c4cf0);};}exports[_0x4ddc('0x28')]=function(_0x3e9cb1,_0xf3631a){var _0x1baf61={},_0x43e290={},_0x4ff2bd={'count':0x0,'rows':[]};var _0x25b6e2=_[_0x4ddc('0x1d')](db['VoiceExtension']['rawAttributes'],function(_0x1c87f4){return{'name':_0x1c87f4[_0x4ddc('0x29')],'type':_0x1c87f4[_0x4ddc('0x21')][_0x4ddc('0x2a')]};});_0x43e290[_0x4ddc('0x2b')]=_[_0x4ddc('0x1d')](_0x25b6e2,_0x4ddc('0x22'));_0x43e290['query']=_[_0x4ddc('0x2c')](_0x3e9cb1[_0x4ddc('0x2d')]);_0x43e290[_0x4ddc('0x2e')]=_[_0x4ddc('0x2f')](_0x43e290[_0x4ddc('0x2b')],_0x43e290['query']);_0x1baf61['attributes']=_[_0x4ddc('0x2f')](_0x43e290['model'],qs[_0x4ddc('0x30')](_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x30')]));_0x1baf61[_0x4ddc('0x31')]=_0x1baf61[_0x4ddc('0x31')]['length']?_0x1baf61[_0x4ddc('0x31')]:_0x43e290[_0x4ddc('0x2b')];if(!_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x32')](_0x4ddc('0x33'))){_0x1baf61[_0x4ddc('0xf')]=qs[_0x4ddc('0xf')](_0x3e9cb1[_0x4ddc('0x2d')]['limit']);_0x1baf61[_0x4ddc('0xe')]=qs['offset'](_0x3e9cb1['query'][_0x4ddc('0xe')]);}_0x1baf61[_0x4ddc('0x34')]=qs['sort'](_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x35')]);_0x1baf61[_0x4ddc('0x36')]=qs[_0x4ddc('0x2e')](_[_0x4ddc('0x37')](_0x3e9cb1[_0x4ddc('0x2d')],_0x43e290['filters']),_0x25b6e2);if(_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x1b')]){_0x1baf61[_0x4ddc('0x36')]=_['merge'](_0x1baf61[_0x4ddc('0x36')],{'$or':_[_0x4ddc('0x1d')](_0x25b6e2,function(_0x266472){if(_0x266472[_0x4ddc('0x21')]!=='VIRTUAL'){var _0x2c465c={};_0x2c465c[_0x266472[_0x4ddc('0x22')]]={'$like':'%'+_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x1b')]+'%'};return _0x2c465c;}})});}_0x1baf61=_[_0x4ddc('0x38')]({},_0x1baf61,_0x3e9cb1[_0x4ddc('0x39')]);var _0x555689={'where':_0x1baf61['where']};return db['VoiceExtension'][_0x4ddc('0x11')](_0x555689)[_0x4ddc('0x13')](function(_0x1a7ebb){_0x4ff2bd[_0x4ddc('0x11')]=_0x1a7ebb;if(_0x3e9cb1[_0x4ddc('0x2d')][_0x4ddc('0x3a')]){_0x1baf61[_0x4ddc('0x3b')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x1baf61);})['then'](function(_0x3d5d90){_0x4ff2bd[_0x4ddc('0x3c')]=_0x3d5d90;return _0x4ff2bd;})[_0x4ddc('0x13')](respondWithFilteredResult(_0xf3631a,_0x1baf61))[_0x4ddc('0x3d')](handleError(_0xf3631a,null));};exports[_0x4ddc('0x3e')]=function(_0x3f4d84,_0x3e5a51){var _0x44359c={'raw':![],'where':{'id':_0x3f4d84['params']['id']}},_0x471e03={};_0x471e03['model']=_[_0x4ddc('0x2c')](db[_0x4ddc('0x3f')][_0x4ddc('0x40')]);_0x471e03['query']=_[_0x4ddc('0x2c')](_0x3f4d84[_0x4ddc('0x2d')]);_0x471e03[_0x4ddc('0x2e')]=_['intersection'](_0x471e03['model'],_0x471e03[_0x4ddc('0x2d')]);_0x44359c[_0x4ddc('0x31')]=_['intersection'](_0x471e03[_0x4ddc('0x2b')],qs['fields'](_0x3f4d84[_0x4ddc('0x2d')][_0x4ddc('0x30')]));_0x44359c['attributes']=_0x44359c[_0x4ddc('0x31')][_0x4ddc('0x41')]?_0x44359c[_0x4ddc('0x31')]:_0x471e03[_0x4ddc('0x2b')];if(_0x3f4d84[_0x4ddc('0x2d')][_0x4ddc('0x3a')]){_0x44359c[_0x4ddc('0x3b')]=[{'all':!![]}];}_0x44359c=_[_0x4ddc('0x38')]({},_0x44359c,_0x3f4d84[_0x4ddc('0x39')]);return db['VoiceExtension'][_0x4ddc('0x20')](_0x44359c)[_0x4ddc('0x13')](handleEntityNotFound(_0x3e5a51,null))['then'](respondWithResult(_0x3e5a51,null))[_0x4ddc('0x3d')](handleError(_0x3e5a51,null));};exports[_0x4ddc('0x23')]=function(_0x27875a,_0x42a7e7){return db['VoiceExtension']['find']({'where':{'id':_0x27875a[_0x4ddc('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a7e7,null))['then'](removeEntity(_0x42a7e7,null))['catch'](handleError(_0x42a7e7,null));};exports[_0x4ddc('0x43')]=function(_0x1fd9db,_0x557cf9){if(_0x1fd9db['body']['type']===_0x4ddc('0x18')&&!_[_0x4ddc('0x44')](_0x1fd9db['body'][_0x4ddc('0x45')],'_')){_0x1fd9db['body'][_0x4ddc('0x45')]='_'['concat'](_0x1fd9db[_0x4ddc('0x46')][_0x4ddc('0x45')]);}return db['VoiceExtension']['create'](_0x1fd9db[_0x4ddc('0x46')],{'raw':![]})[_0x4ddc('0x13')](function(_0x276373){var _0x14f32e=_0x1fd9db['user'][_0x4ddc('0x14')]({'plain':!![]});if(!_0x14f32e)throw new Error(_0x4ddc('0x47'));if(_0x14f32e[_0x4ddc('0x48')]===_0x4ddc('0x49')){var _0x4e50fd=_0x276373[_0x4ddc('0x14')]({'plain':!![]});var _0x183dd6=[{'name':_0x4ddc('0x15'),'value':_0x4ddc('0x16')},{'name':_0x4ddc('0x17'),'value':'outbound'},{'name':_0x4ddc('0x19'),'value':_0x4ddc('0x1a')}];var _0x196e48=_[_0x4ddc('0x20')](_0x183dd6,['value',_0x4e50fd['type']])[_0x4ddc('0x22')];return db[_0x4ddc('0x4a')][_0x4ddc('0x20')]({'where':{'name':_0x196e48,'userProfileId':_0x14f32e['userProfileId']},'raw':!![]})['then'](function(_0x3fd5aa){if(_0x3fd5aa&&_0x3fd5aa[_0x4ddc('0x4b')]===0x0){return db[_0x4ddc('0x4c')]['create']({'name':_0x4e50fd[_0x4ddc('0x22')],'resourceId':_0x4e50fd['id'],'type':_0x3fd5aa['name'],'sectionId':_0x3fd5aa['id']},{})[_0x4ddc('0x13')](function(){return _0x276373;});}else{return _0x276373;}})[_0x4ddc('0x3d')](function(_0x1d106c){logger['error'](_0x4ddc('0x4d'),_0x1d106c);throw _0x1d106c;});}return _0x276373;})[_0x4ddc('0x13')](respondWithResult(_0x557cf9,0xc9))[_0x4ddc('0x3d')](handleError(_0x557cf9,null));};exports[_0x4ddc('0x4e')]=function(_0x58096b,_0x42fde9){if(_0x58096b[_0x4ddc('0x46')]['id']){delete _0x58096b[_0x4ddc('0x46')]['id'];}return db['VoiceExtension'][_0x4ddc('0x20')]({'where':{'id':_0x58096b[_0x4ddc('0x42')]['id']}})[_0x4ddc('0x13')](handleEntityNotFound(_0x42fde9,null))[_0x4ddc('0x13')](function(_0x5bdead){if(_0x5bdead){return db[_0x4ddc('0x3f')][_0x4ddc('0x4e')](_[_0x4ddc('0x37')](_0x58096b['body'],[_0x4ddc('0x45'),_0x4ddc('0x4f'),_0x4ddc('0x50'),_0x4ddc('0x51'),_0x4ddc('0x52'),_0x4ddc('0x53'),'alias']),{'where':{'context':_0x5bdead[_0x4ddc('0x4f')],'exten':_0x5bdead[_0x4ddc('0x45')]},'individualHooks':!![]})[_0x4ddc('0x13')](function(_0x5695b2){return _0x5695b2;});}return null;})[_0x4ddc('0x13')](respondWithStatusCode(_0x42fde9,null))[_0x4ddc('0x3d')](handleError(_0x42fde9,null));};exports[_0x4ddc('0x54')]=function(_0x5244ed,_0xf69867){var _0xce0716=_0x5244ed[_0x4ddc('0x42')]['id'];var _0x528ab0=_0x5244ed[_0x4ddc('0x46')];var _0x4a61d8=0xc8;var _0x30d084=null;return db[_0x4ddc('0x55')][_0x4ddc('0x56')]({'isolationLevel':db[_0x4ddc('0x55')][_0x4ddc('0x57')][_0x4ddc('0x58')]['READ_COMMITTED']},function(_0x4b3ad2){return db[_0x4ddc('0x3f')][_0x4ddc('0x59')]({'where':{'id':_0xce0716},'transaction':_0x4b3ad2})[_0x4ddc('0x13')](function(_0x8d7f1){if(_0x8d7f1){return db['VoiceExtension'][_0x4ddc('0x23')]({'where':{'VoiceExtensionId':_0xce0716},'transaction':_0x4b3ad2})['then'](function(){var _0x26266a=_[_0x4ddc('0x1d')](_0x528ab0,function(_0x26a02a){_0x26a02a[_0x4ddc('0x5a')]=_0xce0716;_0x26a02a[_0x4ddc('0x5b')]=!![];return _0x26a02a;});return _0x8d7f1[_0x4ddc('0x5c')](_0x26266a);})[_0x4ddc('0x13')](function(_0x49052e){return db[_0x4ddc('0x3f')][_0x4ddc('0x5d')](_0x49052e,{'transaction':_0x4b3ad2});});}else{_0x4a61d8=0x194;_0x30d084=[];}});})[_0x4ddc('0x13')](function(){if(_0x4a61d8!==0x194){return db[_0x4ddc('0x3f')][_0x4ddc('0x5e')]({'where':{'isApp':!![],'VoiceExtensionId':_0xce0716},'order':'priority'})['then'](function(_0x213432){_0x30d084=_0x213432;});}})[_0x4ddc('0x3d')](function(_0x3c1f50){_0x4a61d8=0x1f4;logger[_0x4ddc('0x25')](_0x3c1f50[_0x4ddc('0x26')]);if(_0x3c1f50[_0x4ddc('0x22')]){delete _0x3c1f50[_0x4ddc('0x22')];}_0x30d084=_0x3c1f50;})[_0x4ddc('0x5f')](function(){if(_0x30d084===null){_0xf69867['sendStatus'](_0x4a61d8);}else{if(_0x4a61d8===0x1f4){_0xf69867[_0x4ddc('0xb')](_0x4a61d8)['send'](_0x30d084);}else{_0xf69867[_0x4ddc('0xb')](_0x4a61d8)[_0x4ddc('0xd')](_0x30d084);}}});}; \ No newline at end of file +var _0xb67e=['options','include','findAll','rows','catch','show','params','body','outbound','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','sequelize','transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','priority','finally','send','ioredis','../../config/logger','../../config/environment','redis','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','destroy','get','InboundRoutes','OutboundRoutes','InternalRoutes','filter','ignore','map','value','includes','type','find','name','UserProfileResource','then','end','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb67e,0xd5));var _0xeb67=function(_0x1ceea5,_0x1cbf66){_0x1ceea5=_0x1ceea5-0x0;var _0x381cac=_0xb67e[_0x1ceea5];return _0x381cac;};'use strict';var _=require('lodash');var Redis=require(_0xeb67('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xeb67('0x1'))('api');var config=require(_0xeb67('0x2'));var db=require('../../mysqldb')['db'];config[_0xeb67('0x3')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb67('0x4'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xeb67('0x5')](socket);function respondWithStatusCode(_0x334f25,_0x257dad){_0x257dad=_0x257dad||0xcc;return function(_0x5e2004){if(_0x5e2004){return _0x334f25[_0xeb67('0x6')](_0x257dad);}return _0x334f25['status'](_0x257dad)['end']();};}function respondWithResult(_0x2af891,_0x3faeaf){_0x3faeaf=_0x3faeaf||0xc8;return function(_0x10284a){if(_0x10284a){return _0x2af891[_0xeb67('0x7')](_0x3faeaf)['json'](_0x10284a);}};}function respondWithFilteredResult(_0x4e22af,_0x12761a){return function(_0x30f2e6){if(_0x30f2e6){var _0x4218fb=typeof _0x12761a[_0xeb67('0x8')]==='undefined'&&typeof _0x12761a[_0xeb67('0x9')]===_0xeb67('0xa');var _0x541717=_0x30f2e6[_0xeb67('0xb')];var _0x26ca04=_0x4218fb?0x0:_0x12761a['offset'];var _0x1890e0=_0x4218fb?_0x30f2e6[_0xeb67('0xb')]:_0x12761a[_0xeb67('0x8')]+_0x12761a['limit'];var _0x309a67;if(_0x1890e0>=_0x541717){_0x1890e0=_0x541717;_0x309a67=0xc8;}else{_0x309a67=0xce;}_0x4e22af[_0xeb67('0x7')](_0x309a67);return _0x4e22af[_0xeb67('0xc')](_0xeb67('0xd'),_0x26ca04+'-'+_0x1890e0+'/'+_0x541717)[_0xeb67('0xe')](_0x30f2e6);}return null;};}function removeEntity(_0x6eca44){return function(_0x555a5e){if(_0x555a5e){return _0x555a5e[_0xeb67('0xf')]()['then'](function(){var _0x38c0ce=_0x555a5e[_0xeb67('0x10')]({'plain':!![]});var _0x245970=[{'name':_0xeb67('0x11'),'value':'inbound','ignore':![]},{'name':_0xeb67('0x12'),'value':'outbound','ignore':![]},{'name':_0xeb67('0x13'),'value':'internal','ignore':![]}];var _0x5e7ec9=_(_0x245970)[_0xeb67('0x14')](_0xeb67('0x15'))[_0xeb67('0x16')](_0xeb67('0x17'))[_0xeb67('0x17')]();if(_[_0xeb67('0x18')](_0x5e7ec9,_0x38c0ce[_0xeb67('0x19')])){return;}var _0x4ccc52=_[_0xeb67('0x1a')](_0x245970,['value',_0x38c0ce['type']])[_0xeb67('0x1b')];return db[_0xeb67('0x1c')][_0xeb67('0xf')]({'where':{'type':_0x4ccc52,'resourceId':_0x38c0ce['id']}})[_0xeb67('0x1d')](function(){return _0x555a5e;});})[_0xeb67('0x1d')](function(){_0x6eca44[_0xeb67('0x7')](0xcc)[_0xeb67('0x1e')]();});}};}function handleEntityNotFound(_0x4cf92a){return function(_0x2e9726){if(!_0x2e9726){_0x4cf92a[_0xeb67('0x6')](0x194);}return _0x2e9726;};}function handleError(_0x19cb91,_0x19ac5f){_0x19ac5f=_0x19ac5f||0x1f4;return function(_0x310fc9){logger[_0xeb67('0x1f')](_0x310fc9[_0xeb67('0x20')]);if(_0x310fc9['name']){delete _0x310fc9[_0xeb67('0x1b')];}_0x19cb91['status'](_0x19ac5f)['send'](_0x310fc9);};}exports[_0xeb67('0x21')]=function(_0x33ab5c,_0x2ffb34){var _0x39c4d0={},_0x5f4bf4={},_0x1c8cb7={'count':0x0,'rows':[]};var _0x38dbe3=_[_0xeb67('0x16')](db[_0xeb67('0x22')][_0xeb67('0x23')],function(_0xeb2249){return{'name':_0xeb2249[_0xeb67('0x24')],'type':_0xeb2249['type'][_0xeb67('0x25')]};});_0x5f4bf4[_0xeb67('0x26')]=_[_0xeb67('0x16')](_0x38dbe3,'name');_0x5f4bf4[_0xeb67('0x27')]=_[_0xeb67('0x28')](_0x33ab5c['query']);_0x5f4bf4[_0xeb67('0x29')]=_[_0xeb67('0x2a')](_0x5f4bf4[_0xeb67('0x26')],_0x5f4bf4['query']);_0x39c4d0['attributes']=_['intersection'](_0x5f4bf4[_0xeb67('0x26')],qs['fields'](_0x33ab5c['query'][_0xeb67('0x2b')]));_0x39c4d0[_0xeb67('0x2c')]=_0x39c4d0[_0xeb67('0x2c')][_0xeb67('0x2d')]?_0x39c4d0[_0xeb67('0x2c')]:_0x5f4bf4[_0xeb67('0x26')];if(!_0x33ab5c[_0xeb67('0x27')][_0xeb67('0x2e')](_0xeb67('0x2f'))){_0x39c4d0['limit']=qs[_0xeb67('0x9')](_0x33ab5c[_0xeb67('0x27')]['limit']);_0x39c4d0['offset']=qs['offset'](_0x33ab5c[_0xeb67('0x27')][_0xeb67('0x8')]);}_0x39c4d0['order']=qs['sort'](_0x33ab5c['query']['sort']);_0x39c4d0[_0xeb67('0x30')]=qs['filters'](_[_0xeb67('0x31')](_0x33ab5c[_0xeb67('0x27')],_0x5f4bf4[_0xeb67('0x29')]),_0x38dbe3);if(_0x33ab5c[_0xeb67('0x27')][_0xeb67('0x14')]){_0x39c4d0[_0xeb67('0x30')]=_['merge'](_0x39c4d0['where'],{'$or':_[_0xeb67('0x16')](_0x38dbe3,function(_0x32591c){if(_0x32591c[_0xeb67('0x19')]!=='VIRTUAL'){var _0x2d9dbb={};_0x2d9dbb[_0x32591c[_0xeb67('0x1b')]]={'$like':'%'+_0x33ab5c[_0xeb67('0x27')][_0xeb67('0x14')]+'%'};return _0x2d9dbb;}})});}_0x39c4d0=_[_0xeb67('0x32')]({},_0x39c4d0,_0x33ab5c[_0xeb67('0x33')]);var _0x3581fc={'where':_0x39c4d0['where']};return db[_0xeb67('0x22')][_0xeb67('0xb')](_0x3581fc)[_0xeb67('0x1d')](function(_0xde9073){_0x1c8cb7[_0xeb67('0xb')]=_0xde9073;if(_0x33ab5c[_0xeb67('0x27')]['includeAll']){_0x39c4d0[_0xeb67('0x34')]=[{'all':!![]}];}return db[_0xeb67('0x22')][_0xeb67('0x35')](_0x39c4d0);})[_0xeb67('0x1d')](function(_0x10f830){_0x1c8cb7[_0xeb67('0x36')]=_0x10f830;return _0x1c8cb7;})[_0xeb67('0x1d')](respondWithFilteredResult(_0x2ffb34,_0x39c4d0))[_0xeb67('0x37')](handleError(_0x2ffb34,null));};exports[_0xeb67('0x38')]=function(_0x3a23b1,_0x1ce0d6){var _0x5e79c8={'raw':![],'where':{'id':_0x3a23b1[_0xeb67('0x39')]['id']}},_0x93e056={};_0x93e056['model']=_[_0xeb67('0x28')](db['VoiceExtension'][_0xeb67('0x23')]);_0x93e056[_0xeb67('0x27')]=_[_0xeb67('0x28')](_0x3a23b1['query']);_0x93e056[_0xeb67('0x29')]=_[_0xeb67('0x2a')](_0x93e056['model'],_0x93e056['query']);_0x5e79c8[_0xeb67('0x2c')]=_['intersection'](_0x93e056['model'],qs['fields'](_0x3a23b1[_0xeb67('0x27')]['fields']));_0x5e79c8[_0xeb67('0x2c')]=_0x5e79c8[_0xeb67('0x2c')][_0xeb67('0x2d')]?_0x5e79c8[_0xeb67('0x2c')]:_0x93e056[_0xeb67('0x26')];if(_0x3a23b1[_0xeb67('0x27')]['includeAll']){_0x5e79c8[_0xeb67('0x34')]=[{'all':!![]}];}_0x5e79c8=_[_0xeb67('0x32')]({},_0x5e79c8,_0x3a23b1[_0xeb67('0x33')]);return db[_0xeb67('0x22')][_0xeb67('0x1a')](_0x5e79c8)[_0xeb67('0x1d')](handleEntityNotFound(_0x1ce0d6,null))[_0xeb67('0x1d')](respondWithResult(_0x1ce0d6,null))[_0xeb67('0x37')](handleError(_0x1ce0d6,null));};exports[_0xeb67('0xf')]=function(_0x24c4bf,_0x255b00){return db['VoiceExtension']['find']({'where':{'id':_0x24c4bf[_0xeb67('0x39')]['id']}})['then'](handleEntityNotFound(_0x255b00,null))[_0xeb67('0x1d')](removeEntity(_0x255b00,null))[_0xeb67('0x37')](handleError(_0x255b00,null));};exports['create']=function(_0x2841b7,_0x4dea43){if(_0x2841b7[_0xeb67('0x3a')]['type']===_0xeb67('0x3b')&&!_[_0xeb67('0x3c')](_0x2841b7[_0xeb67('0x3a')][_0xeb67('0x3d')],'_')){_0x2841b7['body'][_0xeb67('0x3d')]='_'['concat'](_0x2841b7[_0xeb67('0x3a')][_0xeb67('0x3d')]);}return db[_0xeb67('0x22')][_0xeb67('0x3e')](_0x2841b7[_0xeb67('0x3a')],{'raw':![]})[_0xeb67('0x1d')](function(_0x216885){var _0x57885b=_0x2841b7[_0xeb67('0x3f')][_0xeb67('0x10')]({'plain':!![]});if(!_0x57885b)throw new Error(_0xeb67('0x40'));if(_0x57885b[_0xeb67('0x41')]===_0xeb67('0x3f')){var _0x373103=_0x216885[_0xeb67('0x10')]({'plain':!![]});var _0x1db4d5=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xeb67('0x12'),'value':_0xeb67('0x3b')},{'name':_0xeb67('0x13'),'value':_0xeb67('0x42')}];var _0x1f7e2b=_[_0xeb67('0x1a')](_0x1db4d5,[_0xeb67('0x17'),_0x373103[_0xeb67('0x19')]])[_0xeb67('0x1b')];return db[_0xeb67('0x43')]['find']({'where':{'name':_0x1f7e2b,'userProfileId':_0x57885b[_0xeb67('0x44')]},'raw':!![]})[_0xeb67('0x1d')](function(_0x3f0dec){if(_0x3f0dec&&_0x3f0dec[_0xeb67('0x45')]===0x0){return db[_0xeb67('0x1c')][_0xeb67('0x3e')]({'name':_0x373103[_0xeb67('0x1b')],'resourceId':_0x373103['id'],'type':_0x3f0dec['name'],'sectionId':_0x3f0dec['id']},{})[_0xeb67('0x1d')](function(){return _0x216885;});}else{return _0x216885;}})[_0xeb67('0x37')](function(_0x3756d1){logger['error'](_0xeb67('0x46'),_0x3756d1);throw _0x3756d1;});}return _0x216885;})[_0xeb67('0x1d')](respondWithResult(_0x4dea43,0xc9))[_0xeb67('0x37')](handleError(_0x4dea43,null));};exports['update']=function(_0x4c0bb7,_0x13241f){if(_0x4c0bb7[_0xeb67('0x3a')]['id']){delete _0x4c0bb7[_0xeb67('0x3a')]['id'];}return db[_0xeb67('0x22')]['find']({'where':{'id':_0x4c0bb7[_0xeb67('0x39')]['id']}})[_0xeb67('0x1d')](handleEntityNotFound(_0x13241f,null))[_0xeb67('0x1d')](function(_0x51791c){if(_0x51791c){return db[_0xeb67('0x22')][_0xeb67('0x47')](_['pick'](_0x4c0bb7[_0xeb67('0x3a')],[_0xeb67('0x3d'),_0xeb67('0x48'),'description',_0xeb67('0x49'),_0xeb67('0x4a'),'mandatoryDisposition',_0xeb67('0x4b')]),{'where':{'context':_0x51791c[_0xeb67('0x48')],'exten':_0x51791c[_0xeb67('0x3d')]},'individualHooks':!![]})['then'](function(_0x2e4a59){return _0x2e4a59;});}return null;})[_0xeb67('0x1d')](respondWithStatusCode(_0x13241f,null))[_0xeb67('0x37')](handleError(_0x13241f,null));};exports['addApplications']=function(_0x46cad1,_0x98d081){var _0x502577=_0x46cad1['params']['id'];var _0x567fa9=_0x46cad1[_0xeb67('0x3a')];var _0x209d49=0xc8;var _0xc183e2=null;return db[_0xeb67('0x4c')][_0xeb67('0x4d')]({'isolationLevel':db[_0xeb67('0x4c')]['Transaction']['ISOLATION_LEVELS'][_0xeb67('0x4e')]},function(_0x57d230){return db[_0xeb67('0x22')][_0xeb67('0x4f')]({'where':{'id':_0x502577},'transaction':_0x57d230})[_0xeb67('0x1d')](function(_0x49888d){if(_0x49888d){return db[_0xeb67('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x502577},'transaction':_0x57d230})[_0xeb67('0x1d')](function(){var _0x39457d=_[_0xeb67('0x16')](_0x567fa9,function(_0x34a1c3){_0x34a1c3[_0xeb67('0x50')]=_0x502577;_0x34a1c3[_0xeb67('0x51')]=!![];return _0x34a1c3;});return _0x49888d[_0xeb67('0x52')](_0x39457d);})[_0xeb67('0x1d')](function(_0x11d38f){return db[_0xeb67('0x22')][_0xeb67('0x53')](_0x11d38f,{'transaction':_0x57d230});});}else{_0x209d49=0x194;_0xc183e2=[];}});})[_0xeb67('0x1d')](function(){if(_0x209d49!==0x194){return db[_0xeb67('0x22')][_0xeb67('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x502577},'order':_0xeb67('0x55')})[_0xeb67('0x1d')](function(_0x443162){_0xc183e2=_0x443162;});}})[_0xeb67('0x37')](function(_0x55f3ae){_0x209d49=0x1f4;logger[_0xeb67('0x1f')](_0x55f3ae[_0xeb67('0x20')]);if(_0x55f3ae[_0xeb67('0x1b')]){delete _0x55f3ae[_0xeb67('0x1b')];}_0xc183e2=_0x55f3ae;})[_0xeb67('0x56')](function(){if(_0xc183e2===null){_0x98d081[_0xeb67('0x6')](_0x209d49);}else{if(_0x209d49===0x1f4){_0x98d081[_0xeb67('0x7')](_0x209d49)[_0xeb67('0x57')](_0xc183e2);}else{_0x98d081[_0xeb67('0x7')](_0x209d49)['json'](_0xc183e2);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 1cb15fc..04083dc 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 _0x3f5c=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','exports'];(function(_0x287af7,_0x3a508c){var _0x5d10f7=function(_0x1cfd03){while(--_0x1cfd03){_0x287af7['push'](_0x287af7['shift']());}};_0x5d10f7(++_0x3a508c);}(_0x3f5c,0x1e8));var _0xc3f5=function(_0x4ef54c,_0xab21f6){_0x4ef54c=_0x4ef54c-0x0;var _0x2e176e=_0x3f5c[_0x4ef54c];return _0x2e176e;};'use strict';var EventEmitter=require(_0xc3f5('0x0'));var VoiceExtension=require(_0xc3f5('0x1'))['db'][_0xc3f5('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc3f5('0x3')](0x0);var events={'afterCreate':_0xc3f5('0x4'),'afterUpdate':_0xc3f5('0x5'),'afterDestroy':_0xc3f5('0x6')};function emitEvent(_0x3f41d4){return function(_0x71c370,_0x57afe2,_0x12f383){VoiceExtensionEvents['emit'](_0x3f41d4+':'+_0x71c370['id'],_0x71c370);VoiceExtensionEvents['emit'](_0x3f41d4,_0x71c370);_0x12f383(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc3f5('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x8b9a=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8b9a,0xbf));var _0xa8b9=function(_0xb66224,_0x3a3f2f){_0xb66224=_0xb66224-0x0;var _0x346365=_0x8b9a[_0xb66224];return _0x346365;};'use strict';var EventEmitter=require(_0xa8b9('0x0'));var VoiceExtension=require(_0xa8b9('0x1'))['db'][_0xa8b9('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa8b9('0x3')](0x0);var events={'afterCreate':_0xa8b9('0x4'),'afterUpdate':'update','afterDestroy':_0xa8b9('0x5')};function emitEvent(_0x45ec8a){return function(_0x5c407c,_0x16a501,_0x3538e9){VoiceExtensionEvents['emit'](_0x45ec8a+':'+_0x5c407c['id'],_0x5c407c);VoiceExtensionEvents[_0xa8b9('0x6')](_0x45ec8a,_0x5c407c);_0x3538e9(null);};}for(var e in events){if(events[_0xa8b9('0x7')](e)){var event=events[e];VoiceExtension[_0xa8b9('0x8')](e,emitEvent(event));}}module[_0xa8b9('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f7743ec..c6cb3ef 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 _0x0a9f=['queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','define','VoiceExtension','voice_extensions','get','last','then','Hangup','./voiceExtension.attributes','exports','models','CDR(type)=','type','exten','alias','Set','CDR(routeAlias)=','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','name','trunk','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','length','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)'];(function(_0x356c85,_0x22b9c7){var _0x4d6fa1=function(_0x41277b){while(--_0x41277b){_0x356c85['push'](_0x356c85['shift']());}};_0x4d6fa1(++_0x22b9c7);}(_0x0a9f,0x64));var _0xf0a9=function(_0x283f1a,_0x271f9a){_0x283f1a=_0x283f1a-0x0;var _0x3eeb4c=_0x0a9f[_0x283f1a];return _0x3eeb4c;};'use strict';var _=require('lodash');var attributes=require(_0xf0a9('0x0'));module[_0xf0a9('0x1')]=function(_0x4e646b){var _0x5ed2ce=_0x4e646b[_0xf0a9('0x2')];function _0x48e2ea(_0x417523){var _0x5db4cc=0x2;var _0x5f203f=[{'type':_0x417523['type'],'app':'Set','appdata':_0xf0a9('0x3')+_0x417523[_0xf0a9('0x4')],'context':_0x417523['context'],'exten':_0x417523[_0xf0a9('0x5')],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']},{'type':_0x417523['type'],'app':_0x417523[_0xf0a9('0x6')]?_0xf0a9('0x7'):'NoOp','appdata':_0x417523[_0xf0a9('0x6')]?_0xf0a9('0x8')+_0x417523[_0xf0a9('0x6')]:'No\x20alias\x20set','context':_0x417523[_0xf0a9('0x9')],'exten':_0x417523['exten'],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']}];if(_0x417523[_0xf0a9('0x4')]===_0xf0a9('0xa')){_0x5f203f[_0xf0a9('0xb')]({'type':_0xf0a9('0xa'),'app':'Set','appdata':_0xf0a9('0xc')+_0x417523['id'],'context':_0x417523[_0xf0a9('0x9')],'exten':_0x417523[_0xf0a9('0x5')],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']});}_0x5f203f[_0xf0a9('0xb')]({'type':_0x417523['type'],'app':'Set','appdata':_0xf0a9('0xd'),'context':_0x417523[_0xf0a9('0x9')],'exten':_0x417523[_0xf0a9('0x5')],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']},{'type':_0x417523[_0xf0a9('0x4')],'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0xe'),'context':_0x417523[_0xf0a9('0x9')],'exten':_0x417523['exten'],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']},{'type':_0x417523[_0xf0a9('0x4')],'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0xf'),'context':_0x417523['context'],'exten':_0x417523[_0xf0a9('0x5')],'priority':_0x5db4cc++,'VoiceExtensionId':_0x417523['id']});return _0x5f203f;}function _0x5ea7ad(_0x21061d){var _0x43b7f3=0x2;var _0x321d1c=[{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0x11'),'context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0x21061d['alias']?_0xf0a9('0x7'):_0xf0a9('0x12'),'appdata':_0x21061d[_0xf0a9('0x6')]?'CDR(routeAlias)='+_0x21061d[_0xf0a9('0x6')]:'No\x20alias\x20set','context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':'outbound','app':_0xf0a9('0x7'),'appdata':_0xf0a9('0x13')+(_0x21061d[_0xf0a9('0x14')]?'${EXTEN:'+_0x21061d[_0xf0a9('0x14')]+'}':_0xf0a9('0x15')),'context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0xc')+_0x21061d['id'],'context':_0x21061d['context'],'exten':_0x21061d['exten'],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':'outbound','app':_0xf0a9('0x16'),'appdata':_0xf0a9('0x17')+(_0x43b7f3+0x2)+_0xf0a9('0x18')+(_0x43b7f3+0x1)+')','context':_0x21061d['context'],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':_0x21061d[_0xf0a9('0x14')]?_0xf0a9('0x19')+_0x21061d[_0xf0a9('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0xd'),'context':_0x21061d['context'],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x21061d['context'],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':'MONITOR_OPTIONS=ab','context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d['exten'],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':'outboundrouteid='+_0x21061d['id'],'context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']}];if(_0x21061d[_0xf0a9('0x1a')](_0xf0a9('0x1b'))&&_0x21061d[_0xf0a9('0x1b')]!==_0xf0a9('0x1c')){_0x321d1c['push']({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x21061d[_0xf0a9('0x9')],'exten':_0x21061d['exten'],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']},{'type':_0xf0a9('0x10'),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0x1d')+_0x21061d[_0xf0a9('0x1b')]||_0xf0a9('0x1e'),'context':_0x21061d['context'],'exten':_0x21061d[_0xf0a9('0x5')],'priority':_0x43b7f3++,'VoiceExtensionId':_0x21061d['id']});}return _0x321d1c;}function _0x3ab90c(_0x420fee,_0x573d27){var _0x19e297=[{'name':'trunk','param':0x0},{'name':_0xf0a9('0x1f'),'param':0x1},{'name':_0xf0a9('0x20'),'param':0x2},{'name':_0xf0a9('0x21'),'param':0x3}];var _0x402de8={};var _0x7fcf77=_0x573d27[_0xf0a9('0x22')](',');var _0x538ebe=[];for(var _0x966774=0x0;_0x966774<_0x19e297['length'];_0x966774++){switch(_0x19e297[_0x966774][_0xf0a9('0x23')]){case _0xf0a9('0x24'):_0x402de8[_0xf0a9('0x24')]=_0x7fcf77[_0x19e297[_0x966774][_0xf0a9('0x25')]][_0xf0a9('0x22')]('/')[0x1];_0x402de8[_0xf0a9('0x26')]=_0x7fcf77[_0x19e297[_0x966774][_0xf0a9('0x25')]][_0xf0a9('0x22')]('/')[0x2];_0x402de8['prefix']=_0x402de8['phone']?_0x402de8[_0xf0a9('0x26')]['split']('$')[0x0]:undefined;_0x402de8[_0xf0a9('0x26')]=_0x420fee[_0xf0a9('0x14')]?(_0x402de8[_0xf0a9('0x27')]||'')+'${EXTEN:'+_0x420fee[_0xf0a9('0x14')]+'}':(_0x402de8[_0xf0a9('0x27')]||'')+_0xf0a9('0x15');_0x538ebe[_0x19e297[_0x966774][_0xf0a9('0x25')]]=[_0xf0a9('0x28'),_0x402de8['trunk'],_0x402de8['phone']][_0xf0a9('0x29')]('/');break;case'options':_0x402de8[_0xf0a9('0x20')]=_0x7fcf77[_0x19e297[_0x966774][_0xf0a9('0x25')]];if(_0x420fee[_0xf0a9('0x1b')]!==_0xf0a9('0x1c')){if(_0x402de8['options'][_0xf0a9('0x2a')](_0xf0a9('0x2b'))<0x0){_0x402de8[_0xf0a9('0x20')]+=_0xf0a9('0x2b');}}else{_0x402de8[_0xf0a9('0x20')]=_0x402de8[_0xf0a9('0x20')][_0xf0a9('0x2c')](_0xf0a9('0x2b'),'');}_0x538ebe[_0x19e297[_0x966774][_0xf0a9('0x25')]]=_0x402de8[_0xf0a9('0x20')];break;default:_0x538ebe[_0x19e297[_0x966774]['param']]=_0x7fcf77[_0x19e297[_0x966774]['param']];}}return _0x538ebe['join'](',');}function _0x2e8f76(_0xe2c0ba,_0x24c148,_0x1549fb){return new Promise(function(_0x25294c,_0x201255){var _0xa81194=[];if(_[_0xf0a9('0x2d')](_0x24c148))return _0x25294c(_0xa81194);_0x5ed2ce[_0xf0a9('0x2e')][_0xf0a9('0x2f')]({'attributes':['id',_0xf0a9('0x30'),_0xf0a9('0x31')],'raw':!![]})['then'](function(_0x57a8d7){for(var _0x2cd881=0x0,_0x3a01d2=0x0;_0x2cd881<_0x24c148[_0xf0a9('0x32')];_0x2cd881++,_0x3a01d2=0x0){var _0x34920a=_0x24c148[_0x2cd881];var _0x542498=[];var _0x2afaad=[];delete _0x34920a['id'];if(_0x34920a[_0xf0a9('0x30')]!==_0xf0a9('0x33')){_0x34920a[_0xf0a9('0x34')]=[_0x34920a[_0xf0a9('0x30')]];}else{_0x34920a[_0xf0a9('0x34')]=_0x34920a[_0xf0a9('0x31')]?_[_0xf0a9('0x35')](_['filter'](_0x57a8d7,{'IntervalId':_0x34920a['IntervalId']}),_0xf0a9('0x30')):[];}_0x34920a[_0xf0a9('0x9')]=_0xe2c0ba[_0xf0a9('0x9')];_0x34920a[_0xf0a9('0x5')]=_0xe2c0ba[_0xf0a9('0x5')];if(_0x34920a['type'])_0x34920a['type']=_0x34920a[_0xf0a9('0x4')][_0xf0a9('0x36')]();if(_0xe2c0ba[_0xf0a9('0x4')]===_0xf0a9('0x10')){if(_0x34920a[_0xf0a9('0x1a')](_0xf0a9('0x37'))&&_0x34920a[_0xf0a9('0x37')]&&_0x34920a['tag']!=='--'){_0x542498[_0xf0a9('0xb')]({'type':_0x34920a[_0xf0a9('0x4')][_0xf0a9('0x36')](),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0x38')+_0x34920a['tag'],'context':_0xe2c0ba[_0xf0a9('0x9')],'exten':_0xe2c0ba[_0xf0a9('0x5')],'priority':_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')]+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});}_0x542498[_0xf0a9('0xb')]({'type':_0x34920a[_0xf0a9('0x4')]['toLowerCase'](),'app':_0xf0a9('0x16'),'appdata':_0xf0a9('0x39')+(_0x34920a['callerID']?'Set(CALLERID(all)='+_0x34920a[_0xf0a9('0x3a')]+')':_0xf0a9('0x3b')),'context':_0xe2c0ba['context'],'exten':_0xe2c0ba[_0xf0a9('0x5')],'priority':_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')]+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});}else{if(_0x34920a[_0xf0a9('0x1a')]('answer')){if([_0xf0a9('0x3c'),_0xf0a9('0x3d')][_0xf0a9('0x3e')](_0x34920a[_0xf0a9('0x3f')][_0xf0a9('0x36')]())&&_0x34920a[_0xf0a9('0x40')]!=='custom'){if(_0x34920a['answer']){_0x542498[_0xf0a9('0xb')]({'type':_0x34920a[_0xf0a9('0x4')][_0xf0a9('0x36')](),'app':'ExecIf','appdata':_0xf0a9('0x41'),'context':_0xe2c0ba[_0xf0a9('0x9')],'exten':_0xe2c0ba[_0xf0a9('0x5')],'priority':_0x34920a['intervals']['length']+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});_0x542498[_0xf0a9('0xb')]({'type':_0x34920a['type'][_0xf0a9('0x36')](),'app':_0xf0a9('0x7'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0xe2c0ba['context'],'exten':_0xe2c0ba[_0xf0a9('0x5')],'priority':_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')]+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});}else{_0x542498[_0xf0a9('0xb')]({'type':_0x34920a[_0xf0a9('0x4')][_0xf0a9('0x36')](),'app':_0xf0a9('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xe2c0ba[_0xf0a9('0x9')],'exten':_0xe2c0ba['exten'],'priority':_0x34920a['intervals'][_0xf0a9('0x32')]+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});_0x542498[_0xf0a9('0xb')]({'type':_0x34920a['type'][_0xf0a9('0x36')](),'app':_0xf0a9('0x7'),'appdata':_0xf0a9('0x42'),'context':_0xe2c0ba[_0xf0a9('0x9')],'exten':_0xe2c0ba[_0xf0a9('0x5')],'priority':_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')]+_0x1549fb+_0x3a01d2++,'VoiceExtensionId':_0xe2c0ba['id']});}}}}for(var _0x5c9a95=0x0;_0x5c9a95<_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')];_0x5c9a95++){var _0x3c3c9e=_0x1549fb+_0x34920a[_0xf0a9('0x34')][_0xf0a9('0x32')];var _0x2ccbbd=_0x5c9a95===_0x34920a['intervals'][_0xf0a9('0x32')]-0x1?_0x1549fb+_0x542498[_0xf0a9('0x32')]+_0x2afaad[_0xf0a9('0x32')]+0x2:_0x1549fb+_0x5c9a95+0x1;_0x542498['splice'](_0x5c9a95,0x0,{'type':_0xe2c0ba[_0xf0a9('0x4')],'app':_0xf0a9('0x43'),'appdata':_0x34920a[_0xf0a9('0x34')][_0x5c9a95]+'?'+_0xe2c0ba[_0xf0a9('0x9')]+_0xf0a9('0x44')+_0x3c3c9e+':'+_0xe2c0ba['context']+',${EXTEN},'+_0x2ccbbd,'exten':_0xe2c0ba[_0xf0a9('0x5')],'context':_0xe2c0ba[_0xf0a9('0x9')],'priority':_0x1549fb+_0x5c9a95,'VoiceExtensionId':_0xe2c0ba['id']});}if(_0x34920a[_0xf0a9('0x40')]===_0xf0a9('0x45'))_0x34920a[_0xf0a9('0x46')]=_0x3ab90c(_0xe2c0ba,_0x34920a[_0xf0a9('0x46')]);_0x34920a[_0xf0a9('0x47')]=_0x542498[_0xf0a9('0x32')]?_['last'](_0x542498)[_0xf0a9('0x47')]+0x1:_0x1549fb;_0xa81194=_[_0xf0a9('0x48')](_0xa81194,_0x542498,[_0x34920a],_0x2afaad);_0x1549fb=_['last'](_0xa81194)[_0xf0a9('0x47')]+0x1;}return _0x25294c(_0xa81194);})['catch'](function(_0x20e023){_0x201255(_0x20e023);});});}return _0x4e646b[_0xf0a9('0x49')](_0xf0a9('0x4a'),attributes,{'tableName':_0xf0a9('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x513768){var _0x3304d6=this[_0xf0a9('0x4c')]({'plain':!![]});var _0x329c50=_0x3304d6[_0xf0a9('0x4')]===_0xf0a9('0x10')?_0x5ea7ad(_0x3304d6):_0x48e2ea(_0x3304d6);return _0x2e8f76(_0x3304d6,_0x513768,_[_0xf0a9('0x4d')](_0x329c50)[_0xf0a9('0x47')]+0x1)[_0xf0a9('0x4e')](function(_0x42d4b0){var _0x16832b=_[_0xf0a9('0x48')](_0x329c50,_0x42d4b0);_0x16832b[_0xf0a9('0xb')]({'type':_0x3304d6['type'],'app':_0xf0a9('0x4f'),'exten':_0x3304d6[_0xf0a9('0x5')],'context':_0x3304d6[_0xf0a9('0x9')],'priority':_['last'](_0x16832b)['priority']+0x1,'VoiceExtensionId':_0x3304d6['id']});return _0x16832b;});}}});}; \ No newline at end of file +var _0x7118=['${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','prefix','phone'];(function(_0x246faa,_0x25f00b){var _0x5b5b5b=function(_0x5912cd){while(--_0x5912cd){_0x246faa['push'](_0x246faa['shift']());}};_0x5b5b5b(++_0x25f00b);}(_0x7118,0x159));var _0x8711=function(_0x5acb2b,_0xfa2d75){_0x5acb2b=_0x5acb2b-0x0;var _0x8bbbdb=_0x7118[_0x5acb2b];return _0x8bbbdb;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x8711('0x0')]=function(_0xf50b2e){var _0x5c64d4=_0xf50b2e[_0x8711('0x1')];function _0x3ea36f(_0x348e88){var _0x259c36=0x2;var _0x12496b=[{'type':_0x348e88[_0x8711('0x2')],'app':_0x8711('0x3'),'appdata':'CDR(type)='+_0x348e88[_0x8711('0x2')],'context':_0x348e88[_0x8711('0x4')],'exten':_0x348e88[_0x8711('0x5')],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']},{'type':_0x348e88[_0x8711('0x2')],'app':_0x348e88[_0x8711('0x6')]?_0x8711('0x3'):_0x8711('0x7'),'appdata':_0x348e88[_0x8711('0x6')]?_0x8711('0x8')+_0x348e88[_0x8711('0x6')]:_0x8711('0x9'),'context':_0x348e88['context'],'exten':_0x348e88['exten'],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']}];if(_0x348e88[_0x8711('0x2')]===_0x8711('0xa')){_0x12496b[_0x8711('0xb')]({'type':'inbound','app':'Set','appdata':_0x8711('0xc')+_0x348e88['id'],'context':_0x348e88[_0x8711('0x4')],'exten':_0x348e88['exten'],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']});}_0x12496b['push']({'type':_0x348e88[_0x8711('0x2')],'app':_0x8711('0x3'),'appdata':_0x8711('0xd'),'context':_0x348e88[_0x8711('0x4')],'exten':_0x348e88[_0x8711('0x5')],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']},{'type':_0x348e88[_0x8711('0x2')],'app':_0x8711('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x348e88[_0x8711('0x4')],'exten':_0x348e88[_0x8711('0x5')],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']},{'type':_0x348e88[_0x8711('0x2')],'app':_0x8711('0x3'),'appdata':_0x8711('0xe'),'context':_0x348e88[_0x8711('0x4')],'exten':_0x348e88['exten'],'priority':_0x259c36++,'VoiceExtensionId':_0x348e88['id']});return _0x12496b;}function _0x2f96a0(_0x2e6f18){var _0x1c2cb5=0x2;var _0xe1e9b3=[{'type':_0x8711('0xf'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x2e6f18['context'],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':_0x2e6f18[_0x8711('0x6')]?'Set':'NoOp','appdata':_0x2e6f18[_0x8711('0x6')]?_0x8711('0x8')+_0x2e6f18[_0x8711('0x6')]:_0x8711('0x9'),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':_0x8711('0x3'),'appdata':_0x8711('0x10')+(_0x2e6f18[_0x8711('0x11')]?'${EXTEN:'+_0x2e6f18[_0x8711('0x11')]+'}':_0x8711('0x12')),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':'outbound','app':_0x8711('0x3'),'appdata':_0x8711('0xc')+_0x2e6f18['id'],'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18['exten'],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':_0x8711('0x13'),'appdata':_0x8711('0x14')+(_0x1c2cb5+0x2)+_0x8711('0x15')+(_0x1c2cb5+0x1)+')','context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18['exten'],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':'outbound','app':'Set','appdata':_0x2e6f18[_0x8711('0x11')]?_0x8711('0x16')+_0x2e6f18[_0x8711('0x11')]+'}':_0x8711('0x17'),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':_0x8711('0x3'),'appdata':_0x8711('0xd'),'context':_0x2e6f18['context'],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':'outbound','app':_0x8711('0x3'),'appdata':_0x8711('0x18'),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18['exten'],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':'Set','appdata':_0x8711('0xe'),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':'outbound','app':'Set','appdata':_0x8711('0x19')+_0x2e6f18['id'],'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']}];if(_0x2e6f18[_0x8711('0x1a')](_0x8711('0x1b'))&&_0x2e6f18[_0x8711('0x1b')]!==_0x8711('0x1c')){_0xe1e9b3[_0x8711('0xb')]({'type':_0x8711('0xf'),'app':_0x8711('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']},{'type':_0x8711('0xf'),'app':_0x8711('0x3'),'appdata':_0x8711('0x1d')+_0x2e6f18[_0x8711('0x1b')]||_0x8711('0x1e'),'context':_0x2e6f18[_0x8711('0x4')],'exten':_0x2e6f18[_0x8711('0x5')],'priority':_0x1c2cb5++,'VoiceExtensionId':_0x2e6f18['id']});}return _0xe1e9b3;}function _0x2c90f0(_0x58f5a2,_0x18643f){var _0x318e5d=[{'name':_0x8711('0x1f'),'param':0x0},{'name':_0x8711('0x20'),'param':0x1},{'name':_0x8711('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0xe54c38={};var _0xc4fe93=_0x18643f[_0x8711('0x22')](',');var _0x59486c=[];for(var _0xee57e=0x0;_0xee57e<_0x318e5d[_0x8711('0x23')];_0xee57e++){switch(_0x318e5d[_0xee57e][_0x8711('0x24')]){case _0x8711('0x1f'):_0xe54c38[_0x8711('0x1f')]=_0xc4fe93[_0x318e5d[_0xee57e][_0x8711('0x25')]][_0x8711('0x22')]('/')[0x1];_0xe54c38['phone']=_0xc4fe93[_0x318e5d[_0xee57e][_0x8711('0x25')]][_0x8711('0x22')]('/')[0x2];_0xe54c38[_0x8711('0x26')]=_0xe54c38[_0x8711('0x27')]?_0xe54c38['phone']['split']('$')[0x0]:undefined;_0xe54c38[_0x8711('0x27')]=_0x58f5a2[_0x8711('0x11')]?(_0xe54c38[_0x8711('0x26')]||'')+_0x8711('0x28')+_0x58f5a2[_0x8711('0x11')]+'}':(_0xe54c38[_0x8711('0x26')]||'')+_0x8711('0x12');_0x59486c[_0x318e5d[_0xee57e][_0x8711('0x25')]]=[_0x8711('0x29'),_0xe54c38[_0x8711('0x1f')],_0xe54c38[_0x8711('0x27')]][_0x8711('0x2a')]('/');break;case _0x8711('0x21'):_0xe54c38[_0x8711('0x21')]=_0xc4fe93[_0x318e5d[_0xee57e][_0x8711('0x25')]];if(_0x58f5a2[_0x8711('0x1b')]!==_0x8711('0x1c')){if(_0xe54c38[_0x8711('0x21')][_0x8711('0x2b')](_0x8711('0x2c'))<0x0){_0xe54c38[_0x8711('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0xe54c38[_0x8711('0x21')]=_0xe54c38['options'][_0x8711('0x2d')](_0x8711('0x2c'),'');}_0x59486c[_0x318e5d[_0xee57e][_0x8711('0x25')]]=_0xe54c38[_0x8711('0x21')];break;default:_0x59486c[_0x318e5d[_0xee57e]['param']]=_0xc4fe93[_0x318e5d[_0xee57e][_0x8711('0x25')]];}}return _0x59486c[_0x8711('0x2a')](',');}function _0x47867d(_0x2f3cc1,_0x10ea42,_0x9d3e3a){return new Promise(function(_0x523c31,_0x2f9f46){var _0x3b9459=[];if(_[_0x8711('0x2e')](_0x10ea42))return _0x523c31(_0x3b9459);_0x5c64d4[_0x8711('0x2f')]['findAll']({'attributes':['id',_0x8711('0x30'),_0x8711('0x31')],'raw':!![]})[_0x8711('0x32')](function(_0x3e47d9){for(var _0x304781=0x0,_0x572285=0x0;_0x304781<_0x10ea42['length'];_0x304781++,_0x572285=0x0){var _0x29ce7d=_0x10ea42[_0x304781];var _0x291d0e=[];var _0x5579a6=[];delete _0x29ce7d['id'];if(_0x29ce7d[_0x8711('0x30')]!==_0x8711('0x33')){_0x29ce7d[_0x8711('0x34')]=[_0x29ce7d[_0x8711('0x30')]];}else{_0x29ce7d['intervals']=_0x29ce7d[_0x8711('0x31')]?_[_0x8711('0x35')](_[_0x8711('0x36')](_0x3e47d9,{'IntervalId':_0x29ce7d['IntervalId']}),_0x8711('0x30')):[];}_0x29ce7d[_0x8711('0x4')]=_0x2f3cc1['context'];_0x29ce7d[_0x8711('0x5')]=_0x2f3cc1[_0x8711('0x5')];if(_0x29ce7d['type'])_0x29ce7d[_0x8711('0x2')]=_0x29ce7d[_0x8711('0x2')]['toLowerCase']();if(_0x2f3cc1[_0x8711('0x2')]===_0x8711('0xf')){if(_0x29ce7d[_0x8711('0x1a')](_0x8711('0x37'))&&_0x29ce7d['tag']&&_0x29ce7d[_0x8711('0x37')]!=='--'){_0x291d0e[_0x8711('0xb')]({'type':_0x29ce7d['type'][_0x8711('0x38')](),'app':_0x8711('0x3'),'appdata':'CDR(tag)='+_0x29ce7d['tag'],'context':_0x2f3cc1['context'],'exten':_0x2f3cc1['exten'],'priority':_0x29ce7d[_0x8711('0x34')][_0x8711('0x23')]+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});}_0x291d0e[_0x8711('0xb')]({'type':_0x29ce7d[_0x8711('0x2')][_0x8711('0x38')](),'app':_0x8711('0x13'),'appdata':_0x8711('0x39')+(_0x29ce7d['callerID']?'Set(CALLERID(all)='+_0x29ce7d['callerID']+')':_0x8711('0x3a')),'context':_0x2f3cc1[_0x8711('0x4')],'exten':_0x2f3cc1[_0x8711('0x5')],'priority':_0x29ce7d[_0x8711('0x34')][_0x8711('0x23')]+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});}else{if(_0x29ce7d[_0x8711('0x1a')]('answer')){if([_0x8711('0x3b'),_0x8711('0x3c')][_0x8711('0x3d')](_0x29ce7d['app'][_0x8711('0x38')]())&&_0x29ce7d[_0x8711('0x3e')]!==_0x8711('0x3f')){if(_0x29ce7d[_0x8711('0x40')]){_0x291d0e[_0x8711('0xb')]({'type':_0x29ce7d[_0x8711('0x2')][_0x8711('0x38')](),'app':_0x8711('0x13'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2f3cc1[_0x8711('0x4')],'exten':_0x2f3cc1['exten'],'priority':_0x29ce7d[_0x8711('0x34')]['length']+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});_0x291d0e['push']({'type':_0x29ce7d['type'][_0x8711('0x38')](),'app':_0x8711('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2f3cc1[_0x8711('0x4')],'exten':_0x2f3cc1['exten'],'priority':_0x29ce7d[_0x8711('0x34')][_0x8711('0x23')]+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});}else{_0x291d0e['push']({'type':_0x29ce7d[_0x8711('0x2')]['toLowerCase'](),'app':_0x8711('0x13'),'appdata':_0x8711('0x41'),'context':_0x2f3cc1['context'],'exten':_0x2f3cc1['exten'],'priority':_0x29ce7d[_0x8711('0x34')]['length']+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});_0x291d0e[_0x8711('0xb')]({'type':_0x29ce7d[_0x8711('0x2')][_0x8711('0x38')](),'app':_0x8711('0x3'),'appdata':_0x8711('0x42'),'context':_0x2f3cc1['context'],'exten':_0x2f3cc1[_0x8711('0x5')],'priority':_0x29ce7d[_0x8711('0x34')][_0x8711('0x23')]+_0x9d3e3a+_0x572285++,'VoiceExtensionId':_0x2f3cc1['id']});}}}}for(var _0x42111c=0x0;_0x42111c<_0x29ce7d[_0x8711('0x34')]['length'];_0x42111c++){var _0x19a481=_0x9d3e3a+_0x29ce7d[_0x8711('0x34')][_0x8711('0x23')];var _0x5d9978=_0x42111c===_0x29ce7d['intervals'][_0x8711('0x23')]-0x1?_0x9d3e3a+_0x291d0e[_0x8711('0x23')]+_0x5579a6['length']+0x2:_0x9d3e3a+_0x42111c+0x1;_0x291d0e['splice'](_0x42111c,0x0,{'type':_0x2f3cc1['type'],'app':_0x8711('0x43'),'appdata':_0x29ce7d[_0x8711('0x34')][_0x42111c]+'?'+_0x2f3cc1[_0x8711('0x4')]+_0x8711('0x44')+_0x19a481+':'+_0x2f3cc1[_0x8711('0x4')]+_0x8711('0x44')+_0x5d9978,'exten':_0x2f3cc1[_0x8711('0x5')],'context':_0x2f3cc1[_0x8711('0x4')],'priority':_0x9d3e3a+_0x42111c,'VoiceExtensionId':_0x2f3cc1['id']});}if(_0x29ce7d[_0x8711('0x3e')]===_0x8711('0x45'))_0x29ce7d[_0x8711('0x46')]=_0x2c90f0(_0x2f3cc1,_0x29ce7d['appdata']);_0x29ce7d[_0x8711('0x47')]=_0x291d0e[_0x8711('0x23')]?_[_0x8711('0x48')](_0x291d0e)[_0x8711('0x47')]+0x1:_0x9d3e3a;_0x3b9459=_[_0x8711('0x49')](_0x3b9459,_0x291d0e,[_0x29ce7d],_0x5579a6);_0x9d3e3a=_[_0x8711('0x48')](_0x3b9459)[_0x8711('0x47')]+0x1;}return _0x523c31(_0x3b9459);})[_0x8711('0x4a')](function(_0x35d13d){_0x2f9f46(_0x35d13d);});});}return _0xf50b2e[_0x8711('0x4b')]('VoiceExtension',attributes,{'tableName':_0x8711('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x334308){var _0x46f6b7=this['get']({'plain':!![]});var _0x1ef017=_0x46f6b7[_0x8711('0x2')]===_0x8711('0xf')?_0x2f96a0(_0x46f6b7):_0x3ea36f(_0x46f6b7);return _0x47867d(_0x46f6b7,_0x334308,_['last'](_0x1ef017)['priority']+0x1)['then'](function(_0x3662c7){var _0x35478b=_['concat'](_0x1ef017,_0x3662c7);_0x35478b[_0x8711('0xb')]({'type':_0x46f6b7[_0x8711('0x2')],'app':'Hangup','exten':_0x46f6b7[_0x8711('0x5')],'context':_0x46f6b7[_0x8711('0x4')],'priority':_[_0x8711('0x48')](_0x35478b)[_0x8711('0x47')]+0x1,'VoiceExtensionId':_0x46f6b7['id']});return _0x35478b;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 97d32f7..8a97651 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 _0x27a0=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','result','catch','GetVoiceExtension','options','raw','where','attributes','include','map','model','stringify','message','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x29c4e0,_0x51e390){var _0x55afc1=function(_0xa5fca){while(--_0xa5fca){_0x29c4e0['push'](_0x29c4e0['shift']());}};_0x55afc1(++_0x51e390);}(_0x27a0,0xbf));var _0x027a=function(_0x11e637,_0x52c6bd){_0x11e637=_0x11e637-0x0;var _0x2d44c4=_0x27a0[_0x11e637];return _0x2d44c4;};'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('./voiceExtension.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')]('VoiceExtension,\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']('VoiceExtension,\x20%s,\x20%s',_0x2d13a2,_0x2fccf6);_0xe5df59(_0x2fccf6);});});}exports[_0x027a('0x19')]=function(_0x57cf67){var _0x1d4a7a=this;return new Promise(function(_0x5b8fae,_0x59511c){return db['VoiceExtension']['findAll']({'raw':_0x57cf67[_0x027a('0x1a')]?_0x57cf67[_0x027a('0x1a')][_0x027a('0x1b')]===undefined?!![]:![]:!![],'where':_0x57cf67[_0x027a('0x1a')]?_0x57cf67['options'][_0x027a('0x1c')]||null:null,'attributes':_0x57cf67[_0x027a('0x1a')]?_0x57cf67[_0x027a('0x1a')][_0x027a('0x1d')]||null:null,'limit':_0x57cf67[_0x027a('0x1a')]?_0x57cf67[_0x027a('0x1a')]['limit']||null:null,'include':_0x57cf67[_0x027a('0x1a')]?_0x57cf67['options'][_0x027a('0x1e')]?_[_0x027a('0x1f')](_0x57cf67[_0x027a('0x1a')][_0x027a('0x1e')],function(_0x582943){return{'model':db[_0x582943['model']],'as':_0x582943['as'],'attributes':_0x582943[_0x027a('0x1d')],'include':_0x582943[_0x027a('0x1e')]?_[_0x027a('0x1f')](_0x582943[_0x027a('0x1e')],function(_0x511c7a){return{'model':db[_0x511c7a[_0x027a('0x20')]],'as':_0x511c7a['as'],'attributes':_0x511c7a['attributes'],'include':_0x511c7a[_0x027a('0x1e')]?_['map'](_0x511c7a[_0x027a('0x1e')],function(_0x4d5a25){return{'model':db[_0x4d5a25['model']],'as':_0x4d5a25['as'],'attributes':_0x4d5a25[_0x027a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47a365){logger[_0x027a('0x10')]('GetVoiceExtension',_0x57cf67);logger[_0x027a('0x13')]('GetVoiceExtension',_0x57cf67,JSON[_0x027a('0x21')](_0x47a365));_0x5b8fae(_0x47a365);})[_0x027a('0x18')](function(_0x4d9a29){logger[_0x027a('0x15')]('GetVoiceExtension',_0x4d9a29[_0x027a('0x22')],_0x57cf67);_0x59511c(_0x1d4a7a[_0x027a('0x15')](0x1f4,_0x4d9a29[_0x027a('0x22')]));});});}; \ No newline at end of file +var _0xce68=['model','map','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x2305a9,_0x4f016b){var _0x3783e0=function(_0x2b9844){while(--_0x2b9844){_0x2305a9['push'](_0x2305a9['shift']());}};_0x3783e0(++_0x4f016b);}(_0xce68,0x10c));var _0x8ce6=function(_0x2d777e,_0xdd813c){_0x2d777e=_0x2d777e-0x0;var _0x3eb364=_0xce68[_0x2d777e];return _0x3eb364;};'use strict';var _=require(_0x8ce6('0x0'));var util=require('util');var moment=require(_0x8ce6('0x1'));var BPromise=require(_0x8ce6('0x2'));var rs=require(_0x8ce6('0x3'));var fs=require('fs');var Redis=require(_0x8ce6('0x4'));var db=require(_0x8ce6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ce6('0x6'))(_0x8ce6('0x7'));var config=require(_0x8ce6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ce6('0x9')][_0x8ce6('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8ce6('0xb')],{'host':_0x8ce6('0xc'),'port':0x18eb});var socket=require(_0x8ce6('0xd'))(new Redis(config[_0x8ce6('0xb')]));require('./voiceExtension.socket')[_0x8ce6('0xe')](socket);function respondWithRpcPromise(_0x188e3c,_0x41618c,_0x3ef3d6){return new BPromise(function(_0x385973,_0xce7cb8){return client[_0x8ce6('0xf')](_0x188e3c,_0x3ef3d6)[_0x8ce6('0x10')](function(_0x442f4e){logger[_0x8ce6('0x11')](_0x8ce6('0x12'),_0x41618c,_0x8ce6('0x13'));logger[_0x8ce6('0x14')](_0x8ce6('0x15'),_0x41618c,_0x8ce6('0x13'),JSON[_0x8ce6('0x16')](_0x442f4e));if(_0x442f4e[_0x8ce6('0x17')]){if(_0x442f4e[_0x8ce6('0x17')]['code']===0x1f4){logger[_0x8ce6('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x41618c,_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);return _0xce7cb8(_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);}logger[_0x8ce6('0x17')](_0x8ce6('0x12'),_0x41618c,_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);return _0x385973(_0x442f4e[_0x8ce6('0x17')][_0x8ce6('0x18')]);}else{logger['info'](_0x8ce6('0x12'),_0x41618c,'request\x20sent');_0x385973(_0x442f4e[_0x8ce6('0x19')][_0x8ce6('0x18')]);}})[_0x8ce6('0x1a')](function(_0x50e2f7){logger['error'](_0x8ce6('0x12'),_0x41618c,_0x50e2f7);_0xce7cb8(_0x50e2f7);});});}exports[_0x8ce6('0x1b')]=function(_0x4eb0df){var _0x1876eb=this;return new Promise(function(_0x1b2602,_0x444cba){return db[_0x8ce6('0x1c')][_0x8ce6('0x1d')]({'raw':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x1f')]===undefined?!![]:![]:!![],'where':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x20')]||null:null,'attributes':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df['options'][_0x8ce6('0x21')]||null:null,'limit':_0x4eb0df['options']?_0x4eb0df[_0x8ce6('0x1e')][_0x8ce6('0x22')]||null:null,'include':_0x4eb0df[_0x8ce6('0x1e')]?_0x4eb0df['options']['include']?_['map'](_0x4eb0df['options'][_0x8ce6('0x23')],function(_0x1e95cb){return{'model':db[_0x1e95cb[_0x8ce6('0x24')]],'as':_0x1e95cb['as'],'attributes':_0x1e95cb[_0x8ce6('0x21')],'include':_0x1e95cb[_0x8ce6('0x23')]?_[_0x8ce6('0x25')](_0x1e95cb['include'],function(_0x5656ab){return{'model':db[_0x5656ab[_0x8ce6('0x24')]],'as':_0x5656ab['as'],'attributes':_0x5656ab[_0x8ce6('0x21')],'include':_0x5656ab[_0x8ce6('0x23')]?_[_0x8ce6('0x25')](_0x5656ab[_0x8ce6('0x23')],function(_0x10a3f9){return{'model':db[_0x10a3f9['model']],'as':_0x10a3f9['as'],'attributes':_0x10a3f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ce6('0x10')](function(_0xb35316){logger[_0x8ce6('0x11')]('GetVoiceExtension',_0x4eb0df);logger[_0x8ce6('0x14')](_0x8ce6('0x1b'),_0x4eb0df,JSON[_0x8ce6('0x16')](_0xb35316));_0x1b2602(_0xb35316);})[_0x8ce6('0x1a')](function(_0x4ae8a2){logger[_0x8ce6('0x17')](_0x8ce6('0x1b'),_0x4ae8a2['message'],_0x4eb0df);_0x444cba(_0x1876eb['error'](0x1f4,_0x4ae8a2[_0x8ce6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c70bab1..8174347 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x3903ad,_0x5c1f8c){var _0x403436=function(_0x5ebaa2){while(--_0x5ebaa2){_0x3903ad['push'](_0x3903ad['shift']());}};_0x403436(++_0x5c1f8c);}(_0x0295,0x1f0));var _0x5029=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x0295[_0x4d9bb2];return _0x3179fe;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0xf9dc02,_0x219521){var _0x5afba1=function(_0x14b12c){while(--_0x14b12c){_0xf9dc02['push'](_0xf9dc02['shift']());}};_0x5afba1(++_0x219521);}(_0x53ec,0x192));var _0xc53e=function(_0x5412c2,_0x2f3149){_0x5412c2=_0x5412c2-0x0;var _0x5766d0=_0x53ec[_0x5412c2];return _0x5766d0;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8c02822..164c363 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x0295,0x1f0));var _0x5029=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x0295[_0x7ad6cb];return _0x22a0ba;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/messages',auth[_0x5029('0x8')](),controller['getMessages']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0xb016,0x159));var _0x6b01=function(_0x121d0a,_0x5daa5b){_0x121d0a=_0x121d0a-0x0;var _0x5c9da0=_0xb016[_0x121d0a];return _0x5c9da0;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 2402f31..fcda3a2 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 _0xda23=['yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','trim','ENUM'];(function(_0x576626,_0x54e4f5){var _0x2284b9=function(_0x46c7e9){while(--_0x46c7e9){_0x576626['push'](_0x576626['shift']());}};_0x2284b9(++_0x54e4f5);}(_0xda23,0x165));var _0x3da2=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0xda23[_0x3f3bad];return _0x4f0801;};'use strict';var Sequelize=require(_0x3da2('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x3da2('0x1')]},'context':{'type':Sequelize[_0x3da2('0x1')],'defaultValue':_0x3da2('0x2'),'unique':_0x3da2('0x3')},'mailbox':{'type':Sequelize[_0x3da2('0x1')],'defaultValue':'','allowNull':![],'unique':_0x3da2('0x3')},'password':{'type':Sequelize[_0x3da2('0x1')]},'fullname':{'type':Sequelize[_0x3da2('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xb7a14){this['setDataValue'](_0x3da2('0x4'),typeof _0xb7a14==='string'&&_0xb7a14[_0x3da2('0x5')]()?_0xb7a14[_0x3da2('0x5')]():null);}},'pager':{'type':Sequelize[_0x3da2('0x1')]},'tz':{'type':Sequelize[_0x3da2('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x3da2('0x6')]('yes','no'),'defaultValue':_0x3da2('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':_0x3da2('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3da2('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3da2('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3da2('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3da2('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':_0x3da2('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3da2('0x6')](_0x3da2('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3da2('0x9')},'emailsubject':{'type':Sequelize[_0x3da2('0x1')]},'emailbody':{'type':Sequelize[_0x3da2('0x1')]},'maxsecs':{'type':Sequelize[_0x3da2('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3da2('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3da2('0xb')](_0x3da2('0xc'))+'\x20-\x20'+this['getDataValue'](_0x3da2('0xd'));}}}; \ No newline at end of file +var _0xeaaa=['trim','central','ENUM','yes','TINYINT(4)','getDataValue','fullname','exports','STRING','contest_mailbox','setDataValue','email','string'];(function(_0x9e64f1,_0x3d87d8){var _0x2069e7=function(_0x2d0e5a){while(--_0x2d0e5a){_0x9e64f1['push'](_0x9e64f1['shift']());}};_0x2069e7(++_0x3d87d8);}(_0xeaaa,0x1ce));var _0xaeaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeaaa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xaeaa('0x0')]={'customer_id':{'type':Sequelize[_0xaeaa('0x1')]},'context':{'type':Sequelize[_0xaeaa('0x1')],'defaultValue':'from-voicemail','unique':_0xaeaa('0x2')},'mailbox':{'type':Sequelize[_0xaeaa('0x1')],'defaultValue':'','allowNull':![],'unique':_0xaeaa('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xaeaa('0x1')]},'email':{'type':Sequelize[_0xaeaa('0x1')],'validate':{'isEmail':!![]},'set':function(_0x59257d){this[_0xaeaa('0x3')](_0xaeaa('0x4'),typeof _0x59257d===_0xaeaa('0x5')&&_0x59257d[_0xaeaa('0x6')]()?_0x59257d[_0xaeaa('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xaeaa('0x1')],'defaultValue':_0xaeaa('0x7')},'attach':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':_0xaeaa('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':_0xaeaa('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xaeaa('0x1')]},'callback':{'type':Sequelize[_0xaeaa('0x1')]},'review':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xaeaa('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xaeaa('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':_0xaeaa('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xaeaa('0x8')](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xaeaa('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xaeaa('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xaeaa('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xaeaa('0xb')](_0xaeaa('0xc'))+'\x20-\x20'+this[_0xaeaa('0xb')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 0bbba40..7f1a897 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 _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4c245f,_0x2bb619){var _0x4a2b5a=function(_0x5b1279){while(--_0x5b1279){_0x4c245f['push'](_0x4c245f['shift']());}};_0x4a2b5a(++_0x2bb619);}(_0x4024,0x89));var _0x4402=function(_0x4c637b,_0x326ee8){_0x4c637b=_0x4c637b-0x0;var _0x5c2e10=_0x4024[_0x4c637b];return _0x5c2e10;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file +var _0xd8b0=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','findOne','VoiceMailMessage','rawAttributes','nolimit','order','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','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','count','set','Content-Range','apply','save','update','then','destroy','Voicemails','error','name','index','VoiceMail','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options'];(function(_0x57670a,_0x111b40){var _0x2558fa=function(_0x5ba13d){while(--_0x5ba13d){_0x57670a['push'](_0x57670a['shift']());}};_0x2558fa(++_0x111b40);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x26');return db['UserProfileResource'][_0x0d8b('0x25')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)[_0x0d8b('0x1a')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x18')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x27')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x28')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x19')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x29')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=_['map'](db[_0x0d8b('0x2a')]['rawAttributes'],function(_0x3cdf3c){return{'name':_0x3cdf3c['fieldName'],'type':_0x3cdf3c['type'][_0x0d8b('0x2b')]};});_0x2c058d[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0x4c80a2,_0x0d8b('0x28'));_0x2c058d[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x544735[_0x0d8b('0x2e')]);_0x2c058d[_0x0d8b('0x30')]=_['intersection'](_0x2c058d[_0x0d8b('0x2c')],_0x2c058d[_0x0d8b('0x2e')]);_0x106e4c['attributes']=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x2c')],qs[_0x0d8b('0x32')](_0x544735['query'][_0x0d8b('0x32')]));_0x106e4c[_0x0d8b('0x33')]=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x34')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x35')]('nolimit')){_0x106e4c[_0x0d8b('0x36')]=qs[_0x0d8b('0x36')](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x106e4c[_0x0d8b('0x1c')]=qs['offset'](_0x544735['query'][_0x0d8b('0x1c')]);}_0x106e4c['order']=qs['sort'](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x30')](_[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2e')],_0x2c058d['filters']),_0x4c80a2);if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x106e4c[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x4c80a2,function(_0xf1680e){if(_0xf1680e['type']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0xf1680e[_0x0d8b('0x28')]]={'$like':'%'+_0x544735[_0x0d8b('0x2e')]['filter']+'%'};return _0x34acb5;}})});}_0x106e4c=_[_0x0d8b('0x3b')]({},_0x106e4c,_0x544735['options']);var _0x37b26c={'where':_0x106e4c[_0x0d8b('0x38')]};return db[_0x0d8b('0x2a')][_0x0d8b('0x1e')](_0x37b26c)[_0x0d8b('0x24')](function(_0x3e632e){_0x56120a[_0x0d8b('0x1e')]=_0x3e632e;if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x106e4c[_0x0d8b('0x3e')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x106e4c);})['then'](function(_0x4d0811){_0x56120a['rows']=_0x4d0811;return _0x56120a;})[_0x0d8b('0x24')](respondWithFilteredResult(_0x3c8887,_0x106e4c))[_0x0d8b('0x3f')](handleError(_0x3c8887,null));};exports[_0x0d8b('0x40')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x41')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x2f')](db[_0x0d8b('0x2a')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x2f')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x30')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x2e')]);_0x1b216d[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x32')]));_0x1b216d[_0x0d8b('0x33')]=_0x1b216d[_0x0d8b('0x33')]['length']?_0x1b216d[_0x0d8b('0x33')]:_0x192de1[_0x0d8b('0x2c')];if(_0x5100cf[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x1b216d[_0x0d8b('0x3e')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x3b')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x42')]);return db[_0x0d8b('0x2a')][_0x0d8b('0x43')](_0x1b216d)[_0x0d8b('0x24')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x24')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x3f')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x2a')][_0x0d8b('0x44')](_0x3e569b[_0x0d8b('0x45')],{})[_0x0d8b('0x24')](function(_0x574b90){var _0x371fa0=_0x3e569b['user']['get']({'plain':!![]});if(!_0x371fa0)throw new Error(_0x0d8b('0x46'));if(_0x371fa0[_0x0d8b('0x47')]===_0x0d8b('0x48')){var _0x4396b5=_0x574b90['get']({'plain':!![]});var _0x131579=_0x0d8b('0x26');return db[_0x0d8b('0x49')][_0x0d8b('0x43')]({'where':{'name':_0x131579,'userProfileId':_0x371fa0[_0x0d8b('0x4a')]},'raw':!![]})['then'](function(_0x5c0824){if(_0x5c0824&&_0x5c0824['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d8b('0x44')]({'name':_0x4396b5[_0x0d8b('0x28')],'resourceId':_0x4396b5['id'],'type':_0x5c0824['name'],'sectionId':_0x5c0824['id']},{})['then'](function(){return _0x574b90;});}else{return _0x574b90;}})[_0x0d8b('0x3f')](function(_0x3d3cb6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3cb6);throw _0x3d3cb6;});}return _0x574b90;})[_0x0d8b('0x24')](respondWithResult(_0x570af8,0xc9))[_0x0d8b('0x3f')](handleError(_0x570af8,null));};exports[_0x0d8b('0x23')]=function(_0x346c0d,_0x2d5519){if(_0x346c0d['body']['id']){delete _0x346c0d[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x2a')]['find']({'where':{'id':_0x346c0d['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x2d5519,null))[_0x0d8b('0x24')](saveUpdates(_0x346c0d['body'],null))['then'](respondWithResult(_0x2d5519,null))[_0x0d8b('0x3f')](handleError(_0x2d5519,null));};exports[_0x0d8b('0x25')]=function(_0x377027,_0xb58818){return db['VoiceMail'][_0x0d8b('0x43')]({'where':{'id':_0x377027['params']['id']}})['then'](handleEntityNotFound(_0xb58818,null))[_0x0d8b('0x24')](removeEntity(_0xb58818,null))[_0x0d8b('0x3f')](handleError(_0xb58818,null));};exports['getMessages']=function(_0x4a8f33,_0x44ed23,_0x3d7161){return db[_0x0d8b('0x2a')][_0x0d8b('0x4b')]({'where':{'id':_0x4a8f33[_0x0d8b('0x41')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x44ed23,null))[_0x0d8b('0x24')](function(_0x3bead7){var _0x5418d8;var _0x24a859={},_0x37dc9f={};_0x37dc9f[_0x0d8b('0x2c')]=_[_0x0d8b('0x2f')](db[_0x0d8b('0x4c')][_0x0d8b('0x4d')]);_0x37dc9f[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x4a8f33[_0x0d8b('0x2e')]);_0x37dc9f['filters']=_[_0x0d8b('0x31')](_0x37dc9f[_0x0d8b('0x2c')],_0x37dc9f[_0x0d8b('0x2e')]);_0x24a859[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x37dc9f['model'],qs[_0x0d8b('0x32')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x32')]));_0x24a859[_0x0d8b('0x33')]=_0x24a859[_0x0d8b('0x33')]['length']?_0x24a859['attributes']:_0x37dc9f[_0x0d8b('0x2c')];if(!_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x35')](_0x0d8b('0x4e'))){_0x24a859['limit']=qs[_0x0d8b('0x36')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x24a859['offset']=qs[_0x0d8b('0x1c')](_0x4a8f33['query'][_0x0d8b('0x1c')]);}_0x24a859[_0x0d8b('0x4f')]=qs[_0x0d8b('0x37')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x24a859[_0x0d8b('0x38')]=qs['filters'](_[_0x0d8b('0x39')](_0x4a8f33['query'],_0x37dc9f[_0x0d8b('0x30')]));if(_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x24a859[_0x0d8b('0x38')]=_['merge'](_0x24a859[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x24a859[_0x0d8b('0x33')],function(_0x2332fc){var _0x2ccdae={};_0x2ccdae[_0x2332fc]={'$like':'%'+_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]+'%'};return _0x2ccdae;})});}_0x24a859[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x24a859[_0x0d8b('0x38')],{'mailboxuser':_0x3bead7['mailbox']});_0x24a859=_['merge']({},_0x24a859,_0x4a8f33[_0x0d8b('0x42')]);return db[_0x0d8b('0x4c')]['findAndCountAll'](_0x24a859)[_0x0d8b('0x24')](respondWithFilteredResult(_0x44ed23,_0x24a859));})['catch'](handleError(_0x44ed23,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index d45809d..9e98d6b 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 _0x6add=['voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x210aa4,_0x53b6c6){var _0x13b370=function(_0xc9af6){while(--_0xc9af6){_0x210aa4['push'](_0x210aa4['shift']());}};_0x13b370(++_0x53b6c6);}(_0x6add,0x112));var _0xd6ad=function(_0x10cdfa,_0x15e2f7){_0x10cdfa=_0x10cdfa-0x0;var _0x2ab367=_0x6add[_0x10cdfa];return _0x2ab367;};'use strict';var _=require(_0xd6ad('0x0'));var util=require(_0xd6ad('0x1'));var logger=require(_0xd6ad('0x2'))(_0xd6ad('0x3'));var moment=require(_0xd6ad('0x4'));var BPromise=require(_0xd6ad('0x5'));var rp=require(_0xd6ad('0x6'));var fs=require('fs');var path=require(_0xd6ad('0x7'));var rimraf=require(_0xd6ad('0x8'));var config=require(_0xd6ad('0x9'));var attributes=require(_0xd6ad('0xa'));module[_0xd6ad('0xb')]=function(_0x303b69,_0xa159c2){return _0x303b69[_0xd6ad('0xc')](_0xd6ad('0xd'),attributes,{'tableName':_0xd6ad('0xe'),'paranoid':![],'indexes':[{'name':_0xd6ad('0xf'),'fields':[_0xd6ad('0x10'),_0xd6ad('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe73b=['define','VoiceMail','voice_voicemail','context','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports'];(function(_0x104225,_0x942b38){var _0x5dad24=function(_0x120d04){while(--_0x120d04){_0x104225['push'](_0x104225['shift']());}};_0x5dad24(++_0x942b38);}(_0xe73b,0x1be));var _0xbe73=function(_0x12a06b,_0x417b51){_0x12a06b=_0x12a06b-0x0;var _0x5d0bb8=_0xe73b[_0x12a06b];return _0x5d0bb8;};'use strict';var _=require('lodash');var util=require(_0xbe73('0x0'));var logger=require(_0xbe73('0x1'))('api');var moment=require(_0xbe73('0x2'));var BPromise=require('bluebird');var rp=require(_0xbe73('0x3'));var fs=require('fs');var path=require(_0xbe73('0x4'));var rimraf=require(_0xbe73('0x5'));var config=require(_0xbe73('0x6'));var attributes=require(_0xbe73('0x7'));module[_0xbe73('0x8')]=function(_0x325c25,_0x7f0c73){return _0x325c25[_0xbe73('0x9')](_0xbe73('0xa'),attributes,{'tableName':_0xbe73('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xbe73('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 2e27cc1..4ff678b 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 _0xb479=['request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x4ead20,_0x17f2d5){var _0x23665f=function(_0x2e09cf){while(--_0x2e09cf){_0x4ead20['push'](_0x4ead20['shift']());}};_0x23665f(++_0x17f2d5);}(_0xb479,0x132));var _0x9b47=function(_0x328f25,_0x1ec1fe){_0x328f25=_0x328f25-0x0;var _0x37fbbb=_0xb479[_0x328f25];return _0x37fbbb;};'use strict';var _=require('lodash');var util=require(_0x9b47('0x0'));var moment=require('moment');var BPromise=require(_0x9b47('0x1'));var rs=require(_0x9b47('0x2'));var fs=require('fs');var Redis=require(_0x9b47('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b47('0x4'))(_0x9b47('0x5'));var config=require(_0x9b47('0x6'));var jayson=require(_0x9b47('0x7'));var client=jayson['client'][_0x9b47('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0e42,_0x3037b0,_0x33eb11){return new BPromise(function(_0x386974,_0x306166){return client[_0x9b47('0x9')](_0x3f0e42,_0x33eb11)[_0x9b47('0xa')](function(_0x3fd7fd){logger[_0x9b47('0xb')](_0x9b47('0xc'),_0x3037b0,'request\x20sent');logger['debug'](_0x9b47('0xd'),_0x3037b0,_0x9b47('0xe'),JSON[_0x9b47('0xf')](_0x3fd7fd));if(_0x3fd7fd[_0x9b47('0x10')]){if(_0x3fd7fd[_0x9b47('0x10')]['code']===0x1f4){logger['error'](_0x9b47('0xc'),_0x3037b0,_0x3fd7fd[_0x9b47('0x10')][_0x9b47('0x11')]);return _0x306166(_0x3fd7fd['error'][_0x9b47('0x11')]);}logger[_0x9b47('0x10')](_0x9b47('0xc'),_0x3037b0,_0x3fd7fd['error'][_0x9b47('0x11')]);return _0x386974(_0x3fd7fd['error'][_0x9b47('0x11')]);}else{logger[_0x9b47('0xb')](_0x9b47('0xc'),_0x3037b0,_0x9b47('0xe'));_0x386974(_0x3fd7fd[_0x9b47('0x12')][_0x9b47('0x11')]);}})[_0x9b47('0x13')](function(_0x2b9003){logger['error'](_0x9b47('0xc'),_0x3037b0,_0x2b9003);_0x306166(_0x2b9003);});});} \ No newline at end of file +var _0x9f05=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x4dfa20,_0x35afb5){var _0x146afc=function(_0x5a4344){while(--_0x5a4344){_0x4dfa20['push'](_0x4dfa20['shift']());}};_0x146afc(++_0x35afb5);}(_0x9f05,0x9c));var _0x59f0=function(_0x514165,_0x4086ef){_0x514165=_0x514165-0x0;var _0x2fb596=_0x9f05[_0x514165];return _0x2fb596;};'use strict';var _=require(_0x59f0('0x0'));var util=require(_0x59f0('0x1'));var moment=require(_0x59f0('0x2'));var BPromise=require(_0x59f0('0x3'));var rs=require(_0x59f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x59f0('0x6'))('rpc');var config=require(_0x59f0('0x7'));var jayson=require(_0x59f0('0x8'));var client=jayson['client'][_0x59f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ea241,_0x25aea2,_0x1def5f){return new BPromise(function(_0x7166e1,_0x3ac095){return client[_0x59f0('0xa')](_0x5ea241,_0x1def5f)[_0x59f0('0xb')](function(_0x4d17c9){logger['info'](_0x59f0('0xc'),_0x25aea2,'request\x20sent');logger[_0x59f0('0xd')](_0x59f0('0xe'),_0x25aea2,'request\x20sent',JSON['stringify'](_0x4d17c9));if(_0x4d17c9[_0x59f0('0xf')]){if(_0x4d17c9[_0x59f0('0xf')][_0x59f0('0x10')]===0x1f4){logger['error'](_0x59f0('0xc'),_0x25aea2,_0x4d17c9[_0x59f0('0xf')][_0x59f0('0x11')]);return _0x3ac095(_0x4d17c9[_0x59f0('0xf')][_0x59f0('0x11')]);}logger[_0x59f0('0xf')](_0x59f0('0xc'),_0x25aea2,_0x4d17c9[_0x59f0('0xf')][_0x59f0('0x11')]);return _0x7166e1(_0x4d17c9[_0x59f0('0xf')][_0x59f0('0x11')]);}else{logger[_0x59f0('0x12')](_0x59f0('0xc'),_0x25aea2,'request\x20sent');_0x7166e1(_0x4d17c9['result'][_0x59f0('0x11')]);}})[_0x59f0('0x13')](function(_0x35638e){logger['error']('VoiceMail,\x20%s,\x20%s',_0x25aea2,_0x35638e);_0x3ac095(_0x35638e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 663bbc6..26b5a09 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 _0x77a5=['./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4de0df,_0x43771c){var _0x5f3c45=function(_0x470069){while(--_0x470069){_0x4de0df['push'](_0x4de0df['shift']());}};_0x5f3c45(++_0x43771c);}(_0x77a5,0x138));var _0x577a=function(_0x3c3a03,_0x3c0da1){_0x3c3a03=_0x3c3a03-0x0;var _0x57ff53=_0x77a5[_0x3c3a03];return _0x57ff53;};'use strict';var multer=require(_0x577a('0x0'));var util=require(_0x577a('0x1'));var path=require(_0x577a('0x2'));var timeout=require(_0x577a('0x3'));var express=require(_0x577a('0x4'));var router=express['Router']();var fs_extra=require(_0x577a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x577a('0x6'));var config=require(_0x577a('0x7'));var controller=require(_0x577a('0x8'));router[_0x577a('0x9')]('/',auth[_0x577a('0xa')](),controller['index']);router[_0x577a('0x9')](_0x577a('0xb'),auth[_0x577a('0xa')](),controller[_0x577a('0xc')]);router['get'](_0x577a('0xd'),auth[_0x577a('0xa')](),controller[_0x577a('0xe')]);router[_0x577a('0xf')]('/',auth[_0x577a('0xa')](),controller['create']);router[_0x577a('0x10')](_0x577a('0xb'),auth[_0x577a('0xa')](),controller[_0x577a('0x11')]);router['delete'](_0x577a('0xb'),auth[_0x577a('0xa')](),controller[_0x577a('0x12')]);module[_0x577a('0x13')]=router; \ No newline at end of file +var _0xa4c8=['download','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x1967a7,_0x314978){var _0x57564d=function(_0x45dd39){while(--_0x45dd39){_0x1967a7['push'](_0x1967a7['shift']());}};_0x57564d(++_0x314978);}(_0xa4c8,0x115));var _0x8a4c=function(_0x4e2090,_0x274895){_0x4e2090=_0x4e2090-0x0;var _0x59149a=_0xa4c8[_0x4e2090];return _0x59149a;};'use strict';var multer=require(_0x8a4c('0x0'));var util=require(_0x8a4c('0x1'));var path=require(_0x8a4c('0x2'));var timeout=require(_0x8a4c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a4c('0x4'));var auth=require(_0x8a4c('0x5'));var interaction=require(_0x8a4c('0x6'));var config=require(_0x8a4c('0x7'));var controller=require(_0x8a4c('0x8'));router[_0x8a4c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x8a4c('0xa')](),controller['show']);router[_0x8a4c('0x9')]('/:id/download',auth[_0x8a4c('0xa')](),controller[_0x8a4c('0xb')]);router['post']('/',auth[_0x8a4c('0xa')](),controller[_0x8a4c('0xc')]);router[_0x8a4c('0xd')](_0x8a4c('0xe'),auth[_0x8a4c('0xa')](),controller[_0x8a4c('0xf')]);router[_0x8a4c('0x10')](_0x8a4c('0xe'),auth[_0x8a4c('0xa')](),controller[_0x8a4c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d768965..cc39b13 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 _0xb4a1=['BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue','INTEGER','STRING'];(function(_0x494570,_0x14070f){var _0x1e0ae9=function(_0x54667a){while(--_0x54667a){_0x494570['push'](_0x494570['shift']());}};_0x1e0ae9(++_0x14070f);}(_0xb4a1,0x1cc));var _0x1b4a=function(_0x1427ab,_0x4978fb){_0x1427ab=_0x1427ab-0x0;var _0x426299=_0xb4a1[_0x1427ab];return _0x426299;};'use strict';var Sequelize=require('sequelize');module[_0x1b4a('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x43587e){return this[_0x1b4a('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x1b4a('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x1b4a('0x4')](_0x1b4a('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x1b4a('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x1b4a('0x6')](_0x1b4a('0x7'))}}; \ No newline at end of file +var _0x5173=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','INTEGER','STRING','BLOB','long'];(function(_0x2ea08a,_0x240f73){var _0x5401ad=function(_0x194c90){while(--_0x194c90){_0x2ea08a['push'](_0x2ea08a['shift']());}};_0x5401ad(++_0x240f73);}(_0x5173,0x162));var _0x3517=function(_0x3fd670,_0x5ad596){_0x3fd670=_0x3fd670-0x0;var _0x57c4e8=_0x5173[_0x3fd670];return _0x57c4e8;};'use strict';var Sequelize=require(_0x3517('0x0'));module[_0x3517('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x129a2e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x3517('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3517('0x4')](_0x3517('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3517('0x3')],'defaultValue':''},'stamp':{'type':_0x3517('0x6'),'defaultValue':Sequelize['literal'](_0x3517('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9e3dc36..5bd9cd9 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 _0x00d2=['limit','offset','count','apply','save','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','filter','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0x55c63d,_0x35f697){var _0x3dcfba=function(_0x4606ac){while(--_0x4606ac){_0x55c63d['push'](_0x55c63d['shift']());}};_0x3dcfba(++_0x35f697);}(_0x00d2,0x17d));var _0x200d=function(_0x6a2228,_0x4a1d8b){_0x6a2228=_0x6a2228-0x0;var _0x2d7c81=_0x00d2[_0x6a2228];return _0x2d7c81;};'use strict';var emlformat=require(_0x200d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x200d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x200d('0x2'));var moment=require(_0x200d('0x3'));var BPromise=require(_0x200d('0x4'));var Mustache=require(_0x200d('0x5'));var util=require(_0x200d('0x6'));var path=require('path');var sox=require(_0x200d('0x7'));var csv=require('to-csv');var ejs=require(_0x200d('0x8'));var fs=require('fs');var fs_extra=require(_0x200d('0x9'));var _=require(_0x200d('0xa'));var squel=require(_0x200d('0xb'));var crypto=require('crypto');var jsforce=require(_0x200d('0xc'));var deskjs=require(_0x200d('0xd'));var toCsv=require(_0x200d('0xe'));var querystring=require(_0x200d('0xf'));var Papa=require(_0x200d('0x10'));var Redis=require(_0x200d('0x11'));var authService=require(_0x200d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x200d('0x13'));var logger=require('../../config/logger')(_0x200d('0x14'));var utils=require(_0x200d('0x15'));var config=require(_0x200d('0x16'));var licenseUtil=require(_0x200d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3619e7,_0x26d7d1){_0x26d7d1=_0x26d7d1||0xcc;return function(_0x4ed75e){if(_0x4ed75e){return _0x3619e7[_0x200d('0x18')](_0x26d7d1);}return _0x3619e7[_0x200d('0x19')](_0x26d7d1)[_0x200d('0x1a')]();};}function respondWithResult(_0x488de2,_0x172c4e){_0x172c4e=_0x172c4e||0xc8;return function(_0x2f082e){if(_0x2f082e){return _0x488de2[_0x200d('0x19')](_0x172c4e)[_0x200d('0x1b')](_0x2f082e);}};}function respondWithFilteredResult(_0x518cdb,_0x47a923){return function(_0x5aa572){if(_0x5aa572){var _0x2ac701=typeof _0x47a923['offset']===_0x200d('0x1c')&&typeof _0x47a923[_0x200d('0x1d')]===_0x200d('0x1c');var _0x3ff484=_0x5aa572['count'];var _0xfc5031=_0x2ac701?0x0:_0x47a923[_0x200d('0x1e')];var _0x58d39b=_0x2ac701?_0x5aa572[_0x200d('0x1f')]:_0x47a923['offset']+_0x47a923[_0x200d('0x1d')];var _0xaa3c50;if(_0x58d39b>=_0x3ff484){_0x58d39b=_0x3ff484;_0xaa3c50=0xc8;}else{_0xaa3c50=0xce;}_0x518cdb[_0x200d('0x19')](_0xaa3c50);return _0x518cdb['set']('Content-Range',_0xfc5031+'-'+_0x58d39b+'/'+_0x3ff484)[_0x200d('0x1b')](_0x5aa572);}return null;};}function patchUpdates(_0x2bac49){return function(_0x37328a){try{jsonpatch[_0x200d('0x20')](_0x37328a,_0x2bac49,!![]);}catch(_0x297ffd){return BPromise['reject'](_0x297ffd);}return _0x37328a[_0x200d('0x21')]();};}function saveUpdates(_0x2c6f9a,_0x471530){return function(_0x34dc77){if(_0x34dc77){return _0x34dc77[_0x200d('0x22')](_0x2c6f9a)[_0x200d('0x23')](function(_0x48c364){return _0x48c364;});}return null;};}function removeEntity(_0x20b073,_0xa3c151){return function(_0x54c1){if(_0x54c1){return _0x54c1[_0x200d('0x24')]()[_0x200d('0x23')](function(){_0x20b073['status'](0xcc)[_0x200d('0x1a')]();});}};}function handleEntityNotFound(_0x555794,_0x403e09){return function(_0x245cb3){if(!_0x245cb3){_0x555794['sendStatus'](0x194);}return _0x245cb3;};}function handleError(_0x4ea244,_0x559558){_0x559558=_0x559558||0x1f4;return function(_0x30b8e2){logger[_0x200d('0x25')](_0x30b8e2[_0x200d('0x26')]);if(_0x30b8e2['name']){delete _0x30b8e2[_0x200d('0x27')];}_0x4ea244[_0x200d('0x19')](_0x559558)[_0x200d('0x28')](_0x30b8e2);};}exports[_0x200d('0x29')]=function(_0x49fccb,_0x5d990e){var _0x27efea={},_0x3800ba={},_0x2f6af9={'count':0x0,'rows':[]};var _0x4eb994=_['map'](db[_0x200d('0x2a')][_0x200d('0x2b')],function(_0x23fabb){return{'name':_0x23fabb['fieldName'],'type':_0x23fabb['type'][_0x200d('0x2c')]};});_0x3800ba[_0x200d('0x2d')]=_['differenceBy'](_['map'](_0x4eb994,_0x200d('0x27')),[_0x200d('0x27')]);_0x3800ba[_0x200d('0x2e')]=_['keys'](_0x49fccb[_0x200d('0x2e')]);_0x3800ba[_0x200d('0x2f')]=_[_0x200d('0x30')](_0x3800ba['model'],_0x3800ba[_0x200d('0x2e')]);_0x27efea[_0x200d('0x31')]=_[_0x200d('0x30')](_0x3800ba['model'],qs[_0x200d('0x32')](_0x49fccb[_0x200d('0x2e')][_0x200d('0x32')]));_0x27efea[_0x200d('0x31')]=_0x27efea[_0x200d('0x31')][_0x200d('0x33')]?_0x27efea[_0x200d('0x31')]:_0x3800ba[_0x200d('0x2d')];if(!_0x49fccb[_0x200d('0x2e')][_0x200d('0x34')](_0x200d('0x35'))){_0x27efea[_0x200d('0x1d')]=qs['limit'](_0x49fccb[_0x200d('0x2e')][_0x200d('0x1d')]);_0x27efea[_0x200d('0x1e')]=qs[_0x200d('0x1e')](_0x49fccb['query'][_0x200d('0x1e')]);}_0x27efea[_0x200d('0x36')]=qs['sort'](_0x49fccb[_0x200d('0x2e')][_0x200d('0x37')]);_0x27efea[_0x200d('0x38')]=qs[_0x200d('0x2f')](_[_0x200d('0x39')](_0x49fccb[_0x200d('0x2e')],_0x3800ba[_0x200d('0x2f')]),_0x4eb994);if(_0x49fccb[_0x200d('0x2e')]['filter']){_0x27efea[_0x200d('0x38')]=_['merge'](_0x27efea[_0x200d('0x38')],{'$or':_[_0x200d('0x3a')](_0x4eb994,function(_0x39632c){if(_0x39632c[_0x200d('0x3b')]!=='VIRTUAL'){var _0x18e354={};_0x18e354[_0x39632c[_0x200d('0x27')]]={'$like':'%'+_0x49fccb['query'][_0x200d('0x3c')]+'%'};return _0x18e354;}})});}_0x27efea=_[_0x200d('0x3d')]({},_0x27efea,_0x49fccb[_0x200d('0x3e')]);var _0x1ad574={'where':_0x27efea[_0x200d('0x38')]};return db[_0x200d('0x2a')][_0x200d('0x1f')](_0x1ad574)['then'](function(_0x50c888){_0x2f6af9[_0x200d('0x1f')]=_0x50c888;if(_0x49fccb[_0x200d('0x2e')][_0x200d('0x3f')]){_0x27efea[_0x200d('0x40')]=[{'all':!![]}];}return db[_0x200d('0x2a')]['findAll'](_0x27efea);})[_0x200d('0x23')](function(_0x753543){_0x2f6af9[_0x200d('0x41')]=_0x753543;return _0x2f6af9;})[_0x200d('0x23')](respondWithFilteredResult(_0x5d990e,_0x27efea))[_0x200d('0x42')](handleError(_0x5d990e,null));};exports['show']=function(_0x3f3acf,_0x3211bb){var _0x2f79e0={'raw':!![],'where':{'id':_0x3f3acf[_0x200d('0x43')]['id']}},_0x5ba287={};_0x5ba287[_0x200d('0x2d')]=_[_0x200d('0x44')](db['VoiceMailMessage']['rawAttributes']);_0x5ba287[_0x200d('0x2e')]=_[_0x200d('0x44')](_0x3f3acf['query']);_0x5ba287[_0x200d('0x2f')]=_[_0x200d('0x30')](_0x5ba287[_0x200d('0x2d')],_0x5ba287['query']);_0x2f79e0[_0x200d('0x31')]=_[_0x200d('0x30')](_0x5ba287[_0x200d('0x2d')],qs[_0x200d('0x32')](_0x3f3acf['query'][_0x200d('0x32')]));_0x2f79e0['attributes']=_0x2f79e0[_0x200d('0x31')]['length']?_0x2f79e0[_0x200d('0x31')]:_0x5ba287[_0x200d('0x2d')];if(_0x3f3acf['query'][_0x200d('0x3f')]){_0x2f79e0[_0x200d('0x40')]=[{'all':!![]}];}_0x2f79e0=_[_0x200d('0x3d')]({},_0x2f79e0,_0x3f3acf[_0x200d('0x3e')]);return db[_0x200d('0x2a')][_0x200d('0x45')](_0x2f79e0)[_0x200d('0x23')](handleEntityNotFound(_0x3211bb,null))[_0x200d('0x23')](respondWithResult(_0x3211bb,null))[_0x200d('0x42')](handleError(_0x3211bb,null));};exports[_0x200d('0x46')]=function(_0x228897,_0x4aceae){return db[_0x200d('0x2a')][_0x200d('0x46')](_0x228897[_0x200d('0x47')],{})['then'](respondWithResult(_0x4aceae,0xc9))[_0x200d('0x42')](handleError(_0x4aceae,null));};exports[_0x200d('0x22')]=function(_0x1cb148,_0x433ac6){if(_0x1cb148[_0x200d('0x47')]['id']){delete _0x1cb148[_0x200d('0x47')]['id'];}return db['VoiceMailMessage'][_0x200d('0x45')]({'where':{'id':_0x1cb148[_0x200d('0x43')]['id']}})['then'](handleEntityNotFound(_0x433ac6,null))[_0x200d('0x23')](saveUpdates(_0x1cb148[_0x200d('0x47')],null))[_0x200d('0x23')](respondWithResult(_0x433ac6,null))[_0x200d('0x42')](handleError(_0x433ac6,null));};exports['destroy']=function(_0x31a466,_0x8eb9b7){return db[_0x200d('0x2a')][_0x200d('0x45')]({'where':{'id':_0x31a466['params']['id']}})['then'](handleEntityNotFound(_0x8eb9b7,null))[_0x200d('0x23')](removeEntity(_0x8eb9b7,null))[_0x200d('0x42')](handleError(_0x8eb9b7,null));};exports[_0x200d('0x48')]=function(_0x1aace7,_0x1bf67e,_0x466fee){return db['VoiceMailMessage'][_0x200d('0x45')]({'where':{'id':_0x1aace7['params']['id']},'attributes':['id',_0x200d('0x49'),_0x200d('0x4a')]})[_0x200d('0x23')](handleEntityNotFound(_0x1bf67e,null))[_0x200d('0x23')](function(_0x4d0a08){if(_0x4d0a08){if(!_0x4d0a08[_0x200d('0x49')]){throw new db[(_0x200d('0x4b'))][(_0x200d('0x4c'))](_0x200d('0x4d'));}var _0x218630={'Content-Type':'audio/wav','Content-Disposition':_0x200d('0x4e')};if(_0x4d0a08[_0x200d('0x4a')]){_0x218630[_0x200d('0x4f')]=_0x200d('0x50')+_0x4d0a08[_0x200d('0x4a')]+_0x200d('0x51');}_0x1bf67e['set'](_0x218630);return _0x1bf67e[_0x200d('0x28')](new Buffer(_0x4d0a08['recording']));}})[_0x200d('0x42')](handleError(_0x1bf67e,null));}; \ No newline at end of file +var _0x9113=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1ddaae,_0x335d10){var _0x51796b=function(_0x3d8f7d){while(--_0x3d8f7d){_0x1ddaae['push'](_0x1ddaae['shift']());}};_0x51796b(++_0x335d10);}(_0x9113,0xa9));var _0x3911=function(_0x1dacad,_0x24a879){_0x1dacad=_0x1dacad-0x0;var _0x5dd420=_0x9113[_0x1dacad];return _0x5dd420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3911('0x0'));var zipdir=require(_0x3911('0x1'));var jsonpatch=require(_0x3911('0x2'));var rp=require(_0x3911('0x3'));var moment=require(_0x3911('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3911('0x5'));var util=require(_0x3911('0x6'));var path=require(_0x3911('0x7'));var sox=require(_0x3911('0x8'));var csv=require(_0x3911('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3911('0xa'));var _=require(_0x3911('0xb'));var squel=require(_0x3911('0xc'));var crypto=require(_0x3911('0xd'));var jsforce=require(_0x3911('0xe'));var deskjs=require(_0x3911('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3911('0x10'));var Papa=require('papaparse');var Redis=require(_0x3911('0x11'));var authService=require(_0x3911('0x12'));var qs=require(_0x3911('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3911('0x14'));var logger=require(_0x3911('0x15'))(_0x3911('0x16'));var utils=require(_0x3911('0x17'));var config=require(_0x3911('0x18'));var licenseUtil=require(_0x3911('0x19'));var db=require(_0x3911('0x1a'))['db'];function respondWithStatusCode(_0x3b64b5,_0x5c8ad9){_0x5c8ad9=_0x5c8ad9||0xcc;return function(_0x13257e){if(_0x13257e){return _0x3b64b5[_0x3911('0x1b')](_0x5c8ad9);}return _0x3b64b5[_0x3911('0x1c')](_0x5c8ad9)[_0x3911('0x1d')]();};}function respondWithResult(_0x533a2e,_0x347489){_0x347489=_0x347489||0xc8;return function(_0x1d1951){if(_0x1d1951){return _0x533a2e[_0x3911('0x1c')](_0x347489)[_0x3911('0x1e')](_0x1d1951);}};}function respondWithFilteredResult(_0x335748,_0x2f9a69){return function(_0x16b572){if(_0x16b572){var _0x35fcc1=typeof _0x2f9a69['offset']===_0x3911('0x1f')&&typeof _0x2f9a69[_0x3911('0x20')]===_0x3911('0x1f');var _0x447df5=_0x16b572[_0x3911('0x21')];var _0x3972f5=_0x35fcc1?0x0:_0x2f9a69['offset'];var _0x43d417=_0x35fcc1?_0x16b572[_0x3911('0x21')]:_0x2f9a69[_0x3911('0x22')]+_0x2f9a69[_0x3911('0x20')];var _0x278762;if(_0x43d417>=_0x447df5){_0x43d417=_0x447df5;_0x278762=0xc8;}else{_0x278762=0xce;}_0x335748[_0x3911('0x1c')](_0x278762);return _0x335748[_0x3911('0x23')](_0x3911('0x24'),_0x3972f5+'-'+_0x43d417+'/'+_0x447df5)[_0x3911('0x1e')](_0x16b572);}return null;};}function patchUpdates(_0x280a72){return function(_0x1af208){try{jsonpatch[_0x3911('0x25')](_0x1af208,_0x280a72,!![]);}catch(_0x5402d4){return BPromise[_0x3911('0x26')](_0x5402d4);}return _0x1af208['save']();};}function saveUpdates(_0x73cce,_0x388a89){return function(_0x5bd21c){if(_0x5bd21c){return _0x5bd21c[_0x3911('0x27')](_0x73cce)[_0x3911('0x28')](function(_0x5a279b){return _0x5a279b;});}return null;};}function removeEntity(_0x1fb6d7,_0xc880d2){return function(_0x2adc24){if(_0x2adc24){return _0x2adc24[_0x3911('0x29')]()[_0x3911('0x28')](function(){_0x1fb6d7[_0x3911('0x1c')](0xcc)[_0x3911('0x1d')]();});}};}function handleEntityNotFound(_0x2633ba,_0x375963){return function(_0x5ac9a0){if(!_0x5ac9a0){_0x2633ba[_0x3911('0x1b')](0x194);}return _0x5ac9a0;};}function handleError(_0x5c34c7,_0x509d4c){_0x509d4c=_0x509d4c||0x1f4;return function(_0x26b1f7){logger[_0x3911('0x2a')](_0x26b1f7[_0x3911('0x2b')]);if(_0x26b1f7[_0x3911('0x2c')]){delete _0x26b1f7[_0x3911('0x2c')];}_0x5c34c7[_0x3911('0x1c')](_0x509d4c)[_0x3911('0x2d')](_0x26b1f7);};}exports[_0x3911('0x2e')]=function(_0x41fc00,_0x43b52e){var _0x507616={},_0x5e3876={},_0x3b7be4={'count':0x0,'rows':[]};var _0x4d3243=_[_0x3911('0x2f')](db[_0x3911('0x30')][_0x3911('0x31')],function(_0x32d946){return{'name':_0x32d946[_0x3911('0x32')],'type':_0x32d946[_0x3911('0x33')][_0x3911('0x34')]};});_0x5e3876[_0x3911('0x35')]=_[_0x3911('0x36')](_[_0x3911('0x2f')](_0x4d3243,_0x3911('0x2c')),[_0x3911('0x2c')]);_0x5e3876[_0x3911('0x37')]=_[_0x3911('0x38')](_0x41fc00[_0x3911('0x37')]);_0x5e3876['filters']=_[_0x3911('0x39')](_0x5e3876[_0x3911('0x35')],_0x5e3876['query']);_0x507616['attributes']=_['intersection'](_0x5e3876[_0x3911('0x35')],qs[_0x3911('0x3a')](_0x41fc00[_0x3911('0x37')][_0x3911('0x3a')]));_0x507616[_0x3911('0x3b')]=_0x507616[_0x3911('0x3b')]['length']?_0x507616[_0x3911('0x3b')]:_0x5e3876[_0x3911('0x35')];if(!_0x41fc00[_0x3911('0x37')][_0x3911('0x3c')](_0x3911('0x3d'))){_0x507616['limit']=qs['limit'](_0x41fc00['query'][_0x3911('0x20')]);_0x507616[_0x3911('0x22')]=qs[_0x3911('0x22')](_0x41fc00[_0x3911('0x37')][_0x3911('0x22')]);}_0x507616[_0x3911('0x3e')]=qs[_0x3911('0x3f')](_0x41fc00[_0x3911('0x37')][_0x3911('0x3f')]);_0x507616[_0x3911('0x40')]=qs[_0x3911('0x41')](_['pick'](_0x41fc00[_0x3911('0x37')],_0x5e3876[_0x3911('0x41')]),_0x4d3243);if(_0x41fc00['query'][_0x3911('0x42')]){_0x507616['where']=_[_0x3911('0x43')](_0x507616[_0x3911('0x40')],{'$or':_[_0x3911('0x2f')](_0x4d3243,function(_0x16a206){if(_0x16a206[_0x3911('0x33')]!=='VIRTUAL'){var _0x1d1adc={};_0x1d1adc[_0x16a206[_0x3911('0x2c')]]={'$like':'%'+_0x41fc00[_0x3911('0x37')][_0x3911('0x42')]+'%'};return _0x1d1adc;}})});}_0x507616=_[_0x3911('0x43')]({},_0x507616,_0x41fc00['options']);var _0x28317a={'where':_0x507616[_0x3911('0x40')]};return db['VoiceMailMessage'][_0x3911('0x21')](_0x28317a)[_0x3911('0x28')](function(_0x292235){_0x3b7be4[_0x3911('0x21')]=_0x292235;if(_0x41fc00['query'][_0x3911('0x44')]){_0x507616[_0x3911('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x3911('0x46')](_0x507616);})[_0x3911('0x28')](function(_0x3cfea3){_0x3b7be4[_0x3911('0x47')]=_0x3cfea3;return _0x3b7be4;})[_0x3911('0x28')](respondWithFilteredResult(_0x43b52e,_0x507616))[_0x3911('0x48')](handleError(_0x43b52e,null));};exports[_0x3911('0x49')]=function(_0x445e2f,_0x4f67b3){var _0x4c545a={'raw':!![],'where':{'id':_0x445e2f['params']['id']}},_0x36e75b={};_0x36e75b['model']=_[_0x3911('0x38')](db[_0x3911('0x30')][_0x3911('0x31')]);_0x36e75b[_0x3911('0x37')]=_['keys'](_0x445e2f[_0x3911('0x37')]);_0x36e75b[_0x3911('0x41')]=_[_0x3911('0x39')](_0x36e75b[_0x3911('0x35')],_0x36e75b[_0x3911('0x37')]);_0x4c545a[_0x3911('0x3b')]=_[_0x3911('0x39')](_0x36e75b[_0x3911('0x35')],qs['fields'](_0x445e2f['query']['fields']));_0x4c545a[_0x3911('0x3b')]=_0x4c545a[_0x3911('0x3b')]['length']?_0x4c545a[_0x3911('0x3b')]:_0x36e75b[_0x3911('0x35')];if(_0x445e2f[_0x3911('0x37')][_0x3911('0x44')]){_0x4c545a[_0x3911('0x45')]=[{'all':!![]}];}_0x4c545a=_[_0x3911('0x43')]({},_0x4c545a,_0x445e2f[_0x3911('0x4a')]);return db[_0x3911('0x30')][_0x3911('0x4b')](_0x4c545a)[_0x3911('0x28')](handleEntityNotFound(_0x4f67b3,null))[_0x3911('0x28')](respondWithResult(_0x4f67b3,null))['catch'](handleError(_0x4f67b3,null));};exports['create']=function(_0x3abf0b,_0x17dfbe){return db[_0x3911('0x30')]['create'](_0x3abf0b[_0x3911('0x4c')],{})[_0x3911('0x28')](respondWithResult(_0x17dfbe,0xc9))[_0x3911('0x48')](handleError(_0x17dfbe,null));};exports[_0x3911('0x27')]=function(_0x40af34,_0x252c57){if(_0x40af34[_0x3911('0x4c')]['id']){delete _0x40af34[_0x3911('0x4c')]['id'];}return db[_0x3911('0x30')][_0x3911('0x4b')]({'where':{'id':_0x40af34['params']['id']}})[_0x3911('0x28')](handleEntityNotFound(_0x252c57,null))[_0x3911('0x28')](saveUpdates(_0x40af34[_0x3911('0x4c')],null))[_0x3911('0x28')](respondWithResult(_0x252c57,null))[_0x3911('0x48')](handleError(_0x252c57,null));};exports[_0x3911('0x29')]=function(_0x1afc16,_0x43d75b){return db['VoiceMailMessage'][_0x3911('0x4b')]({'where':{'id':_0x1afc16[_0x3911('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43d75b,null))[_0x3911('0x28')](removeEntity(_0x43d75b,null))[_0x3911('0x48')](handleError(_0x43d75b,null));};exports[_0x3911('0x4e')]=function(_0x3ff403,_0x5a703d,_0xd0124f){return db[_0x3911('0x30')][_0x3911('0x4b')]({'where':{'id':_0x3ff403[_0x3911('0x4d')]['id']},'attributes':['id',_0x3911('0x4f'),_0x3911('0x50')]})[_0x3911('0x28')](handleEntityNotFound(_0x5a703d,null))['then'](function(_0x325f83){if(_0x325f83){if(!_0x325f83['recording']){throw new db[(_0x3911('0x51'))][(_0x3911('0x52'))](_0x3911('0x53'));}var _0x31ea50={'Content-Type':_0x3911('0x54'),'Content-Disposition':'attachment'};if(_0x325f83[_0x3911('0x50')]){_0x31ea50[_0x3911('0x55')]=_0x3911('0x56')+_0x325f83[_0x3911('0x50')]+_0x3911('0x57');}_0x5a703d['set'](_0x31ea50);return _0x5a703d[_0x3911('0x2d')](new Buffer(_0x325f83['recording']));}})['catch'](handleError(_0x5a703d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index d1522a1..d0ae4f6 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 _0x4cf2=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x50c722,_0x5a57af){var _0x39edf5=function(_0x26d06a){while(--_0x26d06a){_0x50c722['push'](_0x50c722['shift']());}};_0x39edf5(++_0x5a57af);}(_0x4cf2,0xbc));var _0x24cf=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x4cf2[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0x24cf('0x0'));var util=require(_0x24cf('0x1'));var logger=require(_0x24cf('0x2'))(_0x24cf('0x3'));var moment=require('moment');var BPromise=require(_0x24cf('0x4'));var rp=require(_0x24cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24cf('0x6'));var config=require(_0x24cf('0x7'));var attributes=require(_0x24cf('0x8'));module[_0x24cf('0x9')]=function(_0x45e5bd,_0x29e60c){return _0x45e5bd[_0x24cf('0xa')](_0x24cf('0xb'),attributes,{'tableName':_0x24cf('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x24cf('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5ec8=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define'];(function(_0xac317b,_0x36faa7){var _0x3277ed=function(_0x1a6b59){while(--_0x1a6b59){_0xac317b['push'](_0xac317b['shift']());}};_0x3277ed(++_0x36faa7);}(_0x5ec8,0xab));var _0x85ec=function(_0x2ada6a,_0x49cece){_0x2ada6a=_0x2ada6a-0x0;var _0x42b8fa=_0x5ec8[_0x2ada6a];return _0x42b8fa;};'use strict';var _=require(_0x85ec('0x0'));var util=require(_0x85ec('0x1'));var logger=require(_0x85ec('0x2'))(_0x85ec('0x3'));var moment=require(_0x85ec('0x4'));var BPromise=require(_0x85ec('0x5'));var rp=require(_0x85ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85ec('0x7'));var config=require(_0x85ec('0x8'));var attributes=require(_0x85ec('0x9'));module['exports']=function(_0x169a9a,_0x5db880){return _0x169a9a[_0x85ec('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x85ec('0xb'),'paranoid':![],'indexes':[{'name':_0x85ec('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e4ea2fe..14f9fdd 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 _0x1367=['client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x43c8e2,_0x97e53e){var _0x577301=function(_0x57a38d){while(--_0x57a38d){_0x43c8e2['push'](_0x43c8e2['shift']());}};_0x577301(++_0x97e53e);}(_0x1367,0xb3));var _0x7136=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x1367[_0x35a140];return _0x30ab82;};'use strict';var _=require('lodash');var util=require(_0x7136('0x0'));var moment=require(_0x7136('0x1'));var BPromise=require('bluebird');var rs=require(_0x7136('0x2'));var fs=require('fs');var Redis=require(_0x7136('0x3'));var db=require(_0x7136('0x4'))['db'];var utils=require(_0x7136('0x5'));var logger=require(_0x7136('0x6'))(_0x7136('0x7'));var config=require(_0x7136('0x8'));var jayson=require(_0x7136('0x9'));var client=jayson[_0x7136('0xa')][_0x7136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x179224,_0x2da9ce,_0x136f76){return new BPromise(function(_0x3e6e42,_0x151d57){return client[_0x7136('0xc')](_0x179224,_0x136f76)[_0x7136('0xd')](function(_0x2491b5){logger['info'](_0x7136('0xe'),_0x2da9ce,'request\x20sent');logger['debug'](_0x7136('0xf'),_0x2da9ce,'request\x20sent',JSON['stringify'](_0x2491b5));if(_0x2491b5[_0x7136('0x10')]){if(_0x2491b5[_0x7136('0x10')][_0x7136('0x11')]===0x1f4){logger['error'](_0x7136('0xe'),_0x2da9ce,_0x2491b5[_0x7136('0x10')][_0x7136('0x12')]);return _0x151d57(_0x2491b5[_0x7136('0x10')][_0x7136('0x12')]);}logger[_0x7136('0x10')](_0x7136('0xe'),_0x2da9ce,_0x2491b5['error']['message']);return _0x3e6e42(_0x2491b5['error']['message']);}else{logger['info'](_0x7136('0xe'),_0x2da9ce,'request\x20sent');_0x3e6e42(_0x2491b5[_0x7136('0x13')][_0x7136('0x12')]);}})[_0x7136('0x14')](function(_0x204e38){logger[_0x7136('0x10')](_0x7136('0xe'),_0x2da9ce,_0x204e38);_0x151d57(_0x204e38);});});} \ No newline at end of file +var _0x742b=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2a4a15,_0x1c2bdb){var _0xdbccd2=function(_0x267623){while(--_0x267623){_0x2a4a15['push'](_0x2a4a15['shift']());}};_0xdbccd2(++_0x1c2bdb);}(_0x742b,0x83));var _0xb742=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x742b[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xb742('0x0'));var moment=require(_0xb742('0x1'));var BPromise=require(_0xb742('0x2'));var rs=require(_0xb742('0x3'));var fs=require('fs');var Redis=require(_0xb742('0x4'));var db=require(_0xb742('0x5'))['db'];var utils=require(_0xb742('0x6'));var logger=require(_0xb742('0x7'))(_0xb742('0x8'));var config=require(_0xb742('0x9'));var jayson=require(_0xb742('0xa'));var client=jayson[_0xb742('0xb')][_0xb742('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd7d2f8,_0x1238a6,_0x4b31de){return new BPromise(function(_0x44cdad,_0x33588f){return client['request'](_0xd7d2f8,_0x4b31de)['then'](function(_0x48d1a6){logger[_0xb742('0xd')](_0xb742('0xe'),_0x1238a6,_0xb742('0xf'));logger[_0xb742('0x10')](_0xb742('0x11'),_0x1238a6,_0xb742('0xf'),JSON[_0xb742('0x12')](_0x48d1a6));if(_0x48d1a6[_0xb742('0x13')]){if(_0x48d1a6['error'][_0xb742('0x14')]===0x1f4){logger[_0xb742('0x13')](_0xb742('0xe'),_0x1238a6,_0x48d1a6[_0xb742('0x13')]['message']);return _0x33588f(_0x48d1a6['error'][_0xb742('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1238a6,_0x48d1a6[_0xb742('0x13')][_0xb742('0x15')]);return _0x44cdad(_0x48d1a6[_0xb742('0x13')][_0xb742('0x15')]);}else{logger[_0xb742('0xd')](_0xb742('0xe'),_0x1238a6,_0xb742('0xf'));_0x44cdad(_0x48d1a6[_0xb742('0x16')]['message']);}})[_0xb742('0x17')](function(_0x256926){logger[_0xb742('0x13')](_0xb742('0xe'),_0x1238a6,_0x256926);_0x33588f(_0x256926);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2766b96..dca2cb7 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 _0x96dc=['create','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','getSounds','post'];(function(_0x30f014,_0x9dc886){var _0x511584=function(_0x5bf027){while(--_0x5bf027){_0x30f014['push'](_0x30f014['shift']());}};_0x511584(++_0x9dc886);}(_0x96dc,0x81));var _0xc96d=function(_0x3a0c75,_0x41c861){_0x3a0c75=_0x3a0c75-0x0;var _0x396a87=_0x96dc[_0x3a0c75];return _0x396a87;};'use strict';var multer=require(_0xc96d('0x0'));var util=require(_0xc96d('0x1'));var path=require(_0xc96d('0x2'));var timeout=require(_0xc96d('0x3'));var express=require(_0xc96d('0x4'));var router=express[_0xc96d('0x5')]();var fs_extra=require(_0xc96d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc96d('0x7'));var config=require(_0xc96d('0x8'));var controller=require(_0xc96d('0x9'));router[_0xc96d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc96d('0xa')](_0xc96d('0xb'),auth[_0xc96d('0xc')](),controller['show']);router[_0xc96d('0xa')]('/:id/sounds',auth['isAuthenticated'](),controller[_0xc96d('0xd')]);router[_0xc96d('0xe')]('/',auth['isAuthenticated'](),controller[_0xc96d('0xf')]);router[_0xc96d('0xe')](_0xc96d('0x10'),auth[_0xc96d('0xc')](),controller[_0xc96d('0x11')]);router[_0xc96d('0x12')](_0xc96d('0xb'),auth[_0xc96d('0xc')](),controller[_0xc96d('0x13')]);router[_0xc96d('0x14')](_0xc96d('0xb'),auth['isAuthenticated'](),controller[_0xc96d('0x15')]);router[_0xc96d('0x14')](_0xc96d('0x16'),auth[_0xc96d('0xc')](),controller['removeSound']);module[_0xc96d('0x17')]=router; \ No newline at end of file +var _0xe2ae=['get','show','/:id/sounds','getSounds','post','addSound','put','update','delete','/:id','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x3b9cde,_0x4b9f41){var _0x13be2f=function(_0x1ec6b4){while(--_0x1ec6b4){_0x3b9cde['push'](_0x3b9cde['shift']());}};_0x13be2f(++_0x4b9f41);}(_0xe2ae,0xd3));var _0xee2a=function(_0x7a1d71,_0x50f262){_0x7a1d71=_0x7a1d71-0x0;var _0x3682fe=_0xe2ae[_0x7a1d71];return _0x3682fe;};'use strict';var multer=require(_0xee2a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2a('0x1'));var express=require(_0xee2a('0x2'));var router=express['Router']();var fs_extra=require(_0xee2a('0x3'));var auth=require(_0xee2a('0x4'));var interaction=require(_0xee2a('0x5'));var config=require(_0xee2a('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xee2a('0x7')](),controller[_0xee2a('0x8')]);router[_0xee2a('0x9')]('/:id',auth[_0xee2a('0x7')](),controller[_0xee2a('0xa')]);router[_0xee2a('0x9')](_0xee2a('0xb'),auth[_0xee2a('0x7')](),controller[_0xee2a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xee2a('0xd')]('/:id/sounds',auth[_0xee2a('0x7')](),controller[_0xee2a('0xe')]);router[_0xee2a('0xf')]('/:id',auth[_0xee2a('0x7')](),controller[_0xee2a('0x10')]);router[_0xee2a('0x11')](_0xee2a('0x12'),auth[_0xee2a('0x7')](),controller['destroy']);router[_0xee2a('0x11')](_0xee2a('0x13'),auth['isAuthenticated'](),controller[_0xee2a('0x14')]);module[_0xee2a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8875247..26f96ad 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 _0x63b0=['alpha','TIMESTAMP','sequelize','exports','STRING','ENUM','custom','files','quietmp3nb','quietmp3'];(function(_0x42db3e,_0x4e0e33){var _0x1c86e2=function(_0xf701de){while(--_0xf701de){_0x42db3e['push'](_0x42db3e['shift']());}};_0x1c86e2(++_0x4e0e33);}(_0x63b0,0x70));var _0x063b=function(_0x3f2c0c,_0x35e1cb){_0x3f2c0c=_0x3f2c0c-0x0;var _0x4d557e=_0x63b0[_0x3f2c0c];return _0x4d557e;};'use strict';var Sequelize=require(_0x063b('0x0'));module[_0x063b('0x1')]={'name':{'type':Sequelize[_0x063b('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x063b('0x3')](_0x063b('0x4'),_0x063b('0x5'),'mp3nb',_0x063b('0x6'),_0x063b('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x063b('0x5')},'directory':{'type':Sequelize[_0x063b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x063b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x063b('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x063b('0x2')],'allowNull':!![],'defaultValue':_0x063b('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x063b('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdeee=['STRING','name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdeee,0xc1));var _0xedee=function(_0x5702da,_0x4aba34){_0x5702da=_0x5702da-0x0;var _0x12a534=_0xdeee[_0x5702da];return _0x12a534;};'use strict';var Sequelize=require(_0xedee('0x0'));module[_0xedee('0x1')]={'name':{'type':Sequelize[_0xedee('0x2')],'allowNull':![],'unique':_0xedee('0x3')},'mode':{'type':Sequelize[_0xedee('0x4')](_0xedee('0x5'),'files',_0xedee('0x6'),_0xedee('0x7'),_0xedee('0x8'),_0xedee('0x9')),'allowNull':!![],'defaultValue':_0xedee('0xa')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xedee('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xedee('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xedee('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xedee('0x2')],'allowNull':!![]},'stamp':{'type':_0xedee('0xb')},'defaultEntry':{'type':Sequelize[_0xedee('0xc')],'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 aa6dfed..22bd95d 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 _0xb19c=['options','includeAll','include','findAll','catch','params','intersection','update','body','find','create','sequelize','mode','directory','join','root','server/files/moh','files','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','Sound','findOne','converted_format','server/files/sounds/converted','%s.%s','basename','save_name','extname','format','symlinkSync','removeSound','id2','createdAt','getSounds','merge','hasOwnProperty','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','MusicOnHolds','destroy','end','error','name','send','index','VoiceMusicOnHold','rawAttributes','type','key','query','keys','filters','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL'];(function(_0x491c1d,_0x391499){var _0x8af4ed=function(_0x273a40){while(--_0x273a40){_0x491c1d['push'](_0x491c1d['shift']());}};_0x8af4ed(++_0x391499);}(_0xb19c,0x1e1));var _0xcb19=function(_0x23255e,_0x3155b9){_0x23255e=_0x23255e-0x0;var _0x1c60ae=_0xb19c[_0x23255e];return _0x1c60ae;};'use strict';var emlformat=require(_0xcb19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb19('0x2'));var moment=require(_0xcb19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcb19('0x4'));var util=require('util');var path=require(_0xcb19('0x5'));var sox=require('sox');var csv=require(_0xcb19('0x6'));var ejs=require(_0xcb19('0x7'));var fs=require('fs');var fs_extra=require(_0xcb19('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcb19('0x9'));var deskjs=require(_0xcb19('0xa'));var toCsv=require(_0xcb19('0x6'));var querystring=require(_0xcb19('0xb'));var Papa=require('papaparse');var Redis=require(_0xcb19('0xc'));var authService=require(_0xcb19('0xd'));var qs=require(_0xcb19('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb19('0xf'));var logger=require(_0xcb19('0x10'))(_0xcb19('0x11'));var utils=require(_0xcb19('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcb19('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a811c,_0x5028d8){_0x5028d8=_0x5028d8||0xcc;return function(_0x2c2e27){if(_0x2c2e27){return _0x3a811c[_0xcb19('0x14')](_0x5028d8);}return _0x3a811c['status'](_0x5028d8)['end']();};}function respondWithResult(_0x32e214,_0x267c8c){_0x267c8c=_0x267c8c||0xc8;return function(_0x48252a){if(_0x48252a){return _0x32e214[_0xcb19('0x15')](_0x267c8c)[_0xcb19('0x16')](_0x48252a);}};}function respondWithFilteredResult(_0x1c21aa,_0x34428b){return function(_0x2ee46a){if(_0x2ee46a){var _0x42083d=typeof _0x34428b[_0xcb19('0x17')]===_0xcb19('0x18')&&typeof _0x34428b[_0xcb19('0x19')]===_0xcb19('0x18');var _0x14f3fa=_0x2ee46a[_0xcb19('0x1a')];var _0x11fcb5=_0x42083d?0x0:_0x34428b[_0xcb19('0x17')];var _0x5110d9=_0x42083d?_0x2ee46a[_0xcb19('0x1a')]:_0x34428b[_0xcb19('0x17')]+_0x34428b[_0xcb19('0x19')];var _0x5cb79e;if(_0x5110d9>=_0x14f3fa){_0x5110d9=_0x14f3fa;_0x5cb79e=0xc8;}else{_0x5cb79e=0xce;}_0x1c21aa[_0xcb19('0x15')](_0x5cb79e);return _0x1c21aa[_0xcb19('0x1b')](_0xcb19('0x1c'),_0x11fcb5+'-'+_0x5110d9+'/'+_0x14f3fa)[_0xcb19('0x16')](_0x2ee46a);}return null;};}function patchUpdates(_0x269e80){return function(_0x384340){try{jsonpatch[_0xcb19('0x1d')](_0x384340,_0x269e80,!![]);}catch(_0x4f22f9){return BPromise[_0xcb19('0x1e')](_0x4f22f9);}return _0x384340[_0xcb19('0x1f')]();};}function saveUpdates(_0x61c9d1,_0x3c0e4f){return function(_0x45a18e){if(_0x45a18e){return _0x45a18e['update'](_0x61c9d1)['then'](function(_0x588668){return _0x588668;});}return null;};}function removeEntity(_0x23549f,_0x565d83){return function(_0x4e7bef){if(_0x4e7bef){return _0x4e7bef['destroy']()[_0xcb19('0x20')](function(){var _0xea6b4d=_0x4e7bef['get']({'plain':!![]});var _0x12d05a=_0xcb19('0x21');return db['UserProfileResource'][_0xcb19('0x22')]({'where':{'type':_0x12d05a,'resourceId':_0xea6b4d['id']}})[_0xcb19('0x20')](function(){return _0x4e7bef;});})['then'](function(){_0x23549f[_0xcb19('0x15')](0xcc)[_0xcb19('0x23')]();});}};}function handleEntityNotFound(_0x11897b,_0xc60a2d){return function(_0x5391de){if(!_0x5391de){_0x11897b['sendStatus'](0x194);}return _0x5391de;};}function handleError(_0x299769,_0x106c9b){_0x106c9b=_0x106c9b||0x1f4;return function(_0x4ce6c4){logger[_0xcb19('0x24')](_0x4ce6c4['stack']);if(_0x4ce6c4[_0xcb19('0x25')]){delete _0x4ce6c4[_0xcb19('0x25')];}_0x299769[_0xcb19('0x15')](_0x106c9b)[_0xcb19('0x26')](_0x4ce6c4);};}exports[_0xcb19('0x27')]=function(_0x3f02d3,_0xaa1be1){var _0x5e3372={},_0x1142ff={},_0xf8407f={'count':0x0,'rows':[]};var _0x28d053=_['map'](db[_0xcb19('0x28')][_0xcb19('0x29')],function(_0x7f9bc1){return{'name':_0x7f9bc1['fieldName'],'type':_0x7f9bc1[_0xcb19('0x2a')][_0xcb19('0x2b')]};});_0x1142ff['model']=_['map'](_0x28d053,_0xcb19('0x25'));_0x1142ff[_0xcb19('0x2c')]=_[_0xcb19('0x2d')](_0x3f02d3[_0xcb19('0x2c')]);_0x1142ff[_0xcb19('0x2e')]=_['intersection'](_0x1142ff['model'],_0x1142ff[_0xcb19('0x2c')]);_0x5e3372[_0xcb19('0x2f')]=_['intersection'](_0x1142ff[_0xcb19('0x30')],qs[_0xcb19('0x31')](_0x3f02d3['query'][_0xcb19('0x31')]));_0x5e3372[_0xcb19('0x2f')]=_0x5e3372[_0xcb19('0x2f')][_0xcb19('0x32')]?_0x5e3372[_0xcb19('0x2f')]:_0x1142ff[_0xcb19('0x30')];if(!_0x3f02d3[_0xcb19('0x2c')]['hasOwnProperty'](_0xcb19('0x33'))){_0x5e3372[_0xcb19('0x19')]=qs['limit'](_0x3f02d3[_0xcb19('0x2c')][_0xcb19('0x19')]);_0x5e3372[_0xcb19('0x17')]=qs[_0xcb19('0x17')](_0x3f02d3[_0xcb19('0x2c')][_0xcb19('0x17')]);}_0x5e3372[_0xcb19('0x34')]=qs[_0xcb19('0x35')](_0x3f02d3[_0xcb19('0x2c')][_0xcb19('0x35')]);delete _0x3f02d3['query'][_0xcb19('0x35')];_0x5e3372[_0xcb19('0x36')]=qs[_0xcb19('0x2e')](_[_0xcb19('0x37')](_0x3f02d3[_0xcb19('0x2c')],_0x1142ff['filters']),_0x28d053);if(_0x3f02d3['query'][_0xcb19('0x38')]){_0x5e3372[_0xcb19('0x36')]=_['merge'](_0x5e3372[_0xcb19('0x36')],{'$or':_[_0xcb19('0x39')](_0x28d053,function(_0x48c03c){if(_0x48c03c[_0xcb19('0x2a')]!==_0xcb19('0x3a')){var _0x528ef5={};_0x528ef5[_0x48c03c[_0xcb19('0x25')]]={'$like':'%'+_0x3f02d3[_0xcb19('0x2c')]['filter']+'%'};return _0x528ef5;}})});}_0x5e3372=_['merge']({},_0x5e3372,_0x3f02d3[_0xcb19('0x3b')]);var _0x97fd3a={'where':_0x5e3372[_0xcb19('0x36')]};return db[_0xcb19('0x28')]['count'](_0x97fd3a)[_0xcb19('0x20')](function(_0x98e734){_0xf8407f[_0xcb19('0x1a')]=_0x98e734;if(_0x3f02d3[_0xcb19('0x2c')][_0xcb19('0x3c')]){_0x5e3372[_0xcb19('0x3d')]=[{'all':!![]}];}return db[_0xcb19('0x28')][_0xcb19('0x3e')](_0x5e3372);})['then'](function(_0x3bcce4){_0xf8407f['rows']=_0x3bcce4;return _0xf8407f;})[_0xcb19('0x20')](respondWithFilteredResult(_0xaa1be1,_0x5e3372))[_0xcb19('0x3f')](handleError(_0xaa1be1,null));};exports['show']=function(_0x136587,_0x19d34a){var _0xd4481f={'raw':![],'where':{'id':_0x136587[_0xcb19('0x40')]['id']}},_0x6c3146={};_0x6c3146['model']=_[_0xcb19('0x2d')](db['VoiceMusicOnHold'][_0xcb19('0x29')]);_0x6c3146[_0xcb19('0x2c')]=_[_0xcb19('0x2d')](_0x136587[_0xcb19('0x2c')]);_0x6c3146['filters']=_[_0xcb19('0x41')](_0x6c3146[_0xcb19('0x30')],_0x6c3146[_0xcb19('0x2c')]);_0xd4481f['attributes']=_['intersection'](_0x6c3146[_0xcb19('0x30')],qs['fields'](_0x136587[_0xcb19('0x2c')][_0xcb19('0x31')]));_0xd4481f[_0xcb19('0x2f')]=_0xd4481f[_0xcb19('0x2f')][_0xcb19('0x32')]?_0xd4481f[_0xcb19('0x2f')]:_0x6c3146[_0xcb19('0x30')];if(_0x136587[_0xcb19('0x2c')]['includeAll']){_0xd4481f[_0xcb19('0x3d')]=[{'all':!![]}];}_0xd4481f=_['merge']({},_0xd4481f,_0x136587[_0xcb19('0x3b')]);return db[_0xcb19('0x28')]['find'](_0xd4481f)['then'](handleEntityNotFound(_0x19d34a,null))['then'](respondWithResult(_0x19d34a,null))['catch'](handleError(_0x19d34a,null));};exports[_0xcb19('0x42')]=function(_0x1abc71,_0xa91499){if(_0x1abc71[_0xcb19('0x43')]['id']){delete _0x1abc71[_0xcb19('0x43')]['id'];}return db[_0xcb19('0x28')][_0xcb19('0x44')]({'where':{'id':_0x1abc71[_0xcb19('0x40')]['id']}})[_0xcb19('0x20')](handleEntityNotFound(_0xa91499,null))[_0xcb19('0x20')](saveUpdates(_0x1abc71[_0xcb19('0x43')],null))[_0xcb19('0x20')](respondWithResult(_0xa91499,null))[_0xcb19('0x3f')](handleError(_0xa91499,null));};exports[_0xcb19('0x45')]=function(_0x1f1b88,_0x299d25,_0x49a6d6){return db[_0xcb19('0x46')]['transaction'](function(_0x8eb8b3){if(_0x1f1b88[_0xcb19('0x43')][_0xcb19('0x47')]==='files'){_0x1f1b88['body'][_0xcb19('0x48')]=path[_0xcb19('0x49')](config[_0xcb19('0x4a')],_0xcb19('0x4b'),_0x1f1b88[_0xcb19('0x43')][_0xcb19('0x25')]);}return db[_0xcb19('0x28')][_0xcb19('0x45')](_0x1f1b88[_0xcb19('0x43')],{'transaction':_0x8eb8b3})[_0xcb19('0x20')](function(_0x2dbc0e){if(_0x1f1b88[_0xcb19('0x43')][_0xcb19('0x47')]===_0xcb19('0x4c')){fs['mkdirSync'](_0x2dbc0e[_0xcb19('0x48')],parseInt(_0xcb19('0x4d'),0x8));}var _0x1bdb7b=_0x1f1b88[_0xcb19('0x4e')][_0xcb19('0x4f')]({'plain':!![]});if(!_0x1bdb7b)throw new Error(_0xcb19('0x50'));if(_0x1bdb7b[_0xcb19('0x51')]===_0xcb19('0x4e')){var _0x2d8e63=_0x2dbc0e['get']({'plain':!![]});return db['UserProfileSection'][_0xcb19('0x44')]({'where':{'name':'MusicOnHolds','userProfileId':_0x1bdb7b[_0xcb19('0x52')]},'raw':!![]})[_0xcb19('0x20')](function(_0x492172){if(_0x492172&&_0x492172[_0xcb19('0x53')]===0x0){return db['UserProfileResource'][_0xcb19('0x45')]({'name':_0x2d8e63['name'],'resourceId':_0x2d8e63['id'],'type':_0x492172[_0xcb19('0x25')],'sectionId':_0x492172['id']},{})[_0xcb19('0x20')](function(){return _0x2dbc0e;});}else{return _0x2dbc0e;}})['catch'](function(_0x2431d7){logger['error'](_0xcb19('0x54'),_0x2431d7);});}return _0x2dbc0e;});})[_0xcb19('0x20')](respondWithResult(_0x299d25,0xc9))['catch'](handleError(_0x299d25,null));};exports['destroy']=function(_0x26a2a4,_0x338d11,_0x3b129c){var _0x38eb17;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x26a2a4[_0xcb19('0x40')]['id']}})['then'](function(_0x501202){if(_0x501202){return db[_0xcb19('0x46')]['transaction'](function(_0x5eec6d){return _0x501202['destroy']({'transaction':_0x5eec6d,'raw':!![]})['then'](function(_0x3d2bae){if(_0x3d2bae[_0xcb19('0x48')]){fs['readdirSync'](_0x3d2bae['directory'])['forEach'](function(_0x56c594){fs[_0xcb19('0x55')](path['join'](_0x3d2bae[_0xcb19('0x48')],_0x56c594));});fs[_0xcb19('0x56')](_0x3d2bae[_0xcb19('0x48')]);}return _0x3d2bae;});})[_0xcb19('0x3f')](function(_0x5c976){throw new db[(_0xcb19('0x57'))][(_0xcb19('0x58'))](_0x5c976[_0xcb19('0x59')]);});}})[_0xcb19('0x20')](handleEntityNotFound(_0x338d11,null))['then'](removeEntity(_0x338d11,null))[_0xcb19('0x3f')](handleError(_0x338d11,null));};exports[_0xcb19('0x5a')]=function(_0x5b1373,_0x2a7bf7,_0x191ca2){return db[_0xcb19('0x46')][_0xcb19('0x5b')](function(_0x239ffa){var _0x55809d;return db['VoiceMusicOnHold'][_0xcb19('0x44')]({'where':{'id':_0x5b1373[_0xcb19('0x40')]['id']}})[_0xcb19('0x20')](function(_0x521b5e){if(_0x521b5e){_0x55809d=_0x521b5e;return _0x521b5e[_0xcb19('0x5a')](_0x5b1373[_0xcb19('0x43')]['id'],{'transaction':_0x239ffa});}})[_0xcb19('0x20')](function(_0x502712){if(_0x502712){return db[_0xcb19('0x5c')][_0xcb19('0x5d')]({'where':{'id':_0x5b1373['body']['id']},'attributes':['id',_0xcb19('0x25'),'save_name',_0xcb19('0x5e'),'createdAt'],'raw':!![]});}})[_0xcb19('0x20')](function(_0x10138b){if(_0x10138b){var _0x158939=path[_0xcb19('0x49')](config[_0xcb19('0x4a')],_0xcb19('0x5f'),util['format'](_0xcb19('0x60'),path[_0xcb19('0x61')](_0x10138b[_0xcb19('0x62')],path[_0xcb19('0x63')](_0x10138b['save_name'])),_0x10138b[_0xcb19('0x5e')]));var _0xf3b2d1=path['join'](config[_0xcb19('0x4a')],_0xcb19('0x4b'),_0x55809d[_0xcb19('0x25')],util[_0xcb19('0x64')]('%s.%s',_0x10138b[_0xcb19('0x25')],_0x10138b[_0xcb19('0x5e')]));fs[_0xcb19('0x65')](_0x158939,_0xf3b2d1);return _0x10138b;}})[_0xcb19('0x3f')](function(_0x46359d){throw new db[(_0xcb19('0x57'))][(_0xcb19('0x58'))](_0x46359d['message']);});})[_0xcb19('0x20')](handleEntityNotFound(_0x2a7bf7,null))[_0xcb19('0x20')](respondWithResult(_0x2a7bf7,0xc9))[_0xcb19('0x3f')](handleError(_0x2a7bf7,null));};exports[_0xcb19('0x66')]=function(_0x4547d6,_0x194927,_0x35819f){return db['sequelize']['transaction'](function(_0x3ddd66){var _0x4b913a;return db[_0xcb19('0x28')][_0xcb19('0x5d')]({'where':{'id':_0x4547d6[_0xcb19('0x40')]['id']}})[_0xcb19('0x20')](handleEntityNotFound(_0x194927,null))[_0xcb19('0x20')](function(_0x1a6681){if(_0x1a6681){_0x4b913a=_0x1a6681;return _0x1a6681[_0xcb19('0x66')](_0x4547d6['params'][_0xcb19('0x67')]);}})[_0xcb19('0x20')](function(_0x58f624){if(_0x58f624){return db[_0xcb19('0x5c')][_0xcb19('0x5d')]({'where':{'id':_0x4547d6[_0xcb19('0x40')][_0xcb19('0x67')]},'attributes':['id',_0xcb19('0x25'),_0xcb19('0x62'),_0xcb19('0x5e'),_0xcb19('0x68')],'raw':!![]});}})[_0xcb19('0x20')](function(_0x62c709){if(_0x62c709){fs['unlinkSync'](path[_0xcb19('0x49')](_0x4b913a[_0xcb19('0x48')],util['format'](_0xcb19('0x60'),_0x62c709['name'],_0x62c709[_0xcb19('0x5e')])));return _0x62c709;}})[_0xcb19('0x3f')](function(_0x5892f4){throw new db[(_0xcb19('0x57'))][(_0xcb19('0x58'))](_0x5892f4[_0xcb19('0x59')]);});})[_0xcb19('0x20')](handleEntityNotFound(_0x194927,null))[_0xcb19('0x20')](respondWithStatusCode(_0x194927,0xcc))[_0xcb19('0x3f')](handleError(_0x194927,null));};exports[_0xcb19('0x69')]=function(_0x3c9952,_0x5c35c0,_0x14330b){var _0x401bdf={};var _0x39e6d4={};var _0x115ce2;var _0x2d84c7;return db['VoiceMusicOnHold'][_0xcb19('0x5d')]({'where':{'id':_0x3c9952['params']['id']}})['then'](handleEntityNotFound(_0x5c35c0,null))['then'](function(_0x38f06a){if(_0x38f06a){_0x115ce2=_0x38f06a;_0x39e6d4[_0xcb19('0x30')]=_['keys'](db[_0xcb19('0x5c')][_0xcb19('0x29')]);_0x39e6d4[_0xcb19('0x2c')]=_['keys'](_0x3c9952['query']);_0x39e6d4['filters']=_[_0xcb19('0x41')](_0x39e6d4[_0xcb19('0x30')],_0x39e6d4[_0xcb19('0x2c')]);_0x401bdf['attributes']=_[_0xcb19('0x41')](_0x39e6d4[_0xcb19('0x30')],qs[_0xcb19('0x31')](_0x3c9952[_0xcb19('0x2c')][_0xcb19('0x31')]));_0x401bdf[_0xcb19('0x2f')]=_0x401bdf[_0xcb19('0x2f')][_0xcb19('0x32')]?_0x401bdf[_0xcb19('0x2f')]:_0x39e6d4[_0xcb19('0x30')];_0x401bdf[_0xcb19('0x34')]=qs[_0xcb19('0x35')](_0x3c9952[_0xcb19('0x2c')]['sort']);_0x401bdf[_0xcb19('0x36')]=qs['filters'](_[_0xcb19('0x37')](_0x3c9952[_0xcb19('0x2c')],_0x39e6d4[_0xcb19('0x2e')]));if(_0x3c9952[_0xcb19('0x2c')][_0xcb19('0x38')]){_0x401bdf[_0xcb19('0x36')]=_[_0xcb19('0x6a')](_0x401bdf[_0xcb19('0x36')],{'$or':_['map'](_0x401bdf[_0xcb19('0x2f')],function(_0x51050a){var _0x76259a={};_0x76259a[_0x51050a]={'$like':'%'+_0x3c9952[_0xcb19('0x2c')][_0xcb19('0x38')]+'%'};return _0x76259a;})});}_0x401bdf=_['merge']({},_0x401bdf,_0x3c9952[_0xcb19('0x3b')]);return _0x115ce2[_0xcb19('0x69')](_0x401bdf);}})[_0xcb19('0x20')](function(_0x1507af){if(_0x1507af){_0x2d84c7=_0x1507af[_0xcb19('0x32')];if(!_0x3c9952[_0xcb19('0x2c')][_0xcb19('0x6b')](_0xcb19('0x33'))){_0x401bdf['limit']=qs['limit'](_0x3c9952[_0xcb19('0x2c')][_0xcb19('0x19')]);_0x401bdf['offset']=qs[_0xcb19('0x17')](_0x3c9952[_0xcb19('0x2c')]['offset']);}return _0x115ce2[_0xcb19('0x69')](_0x401bdf);}})['then'](function(_0x4823dc){if(_0x4823dc){return _0x4823dc?{'count':_0x2d84c7,'rows':_0x4823dc}:null;}})['then'](respondWithResult(_0x5c35c0,null))['catch'](handleError(_0x5c35c0,null));}; \ No newline at end of file +var _0xa4b6=['id2','unlinkSync','order','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','error','stack','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','autoAssociation','UserProfileResource','readdirSync','forEach','rmdirSync','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','save_name','extname','symlinkSync','Sequelize','removeSound'];(function(_0x5dd35a,_0x543f8d){var _0x6a3f73=function(_0x20c369){while(--_0x20c369){_0x5dd35a['push'](_0x5dd35a['shift']());}};_0x6a3f73(++_0x543f8d);}(_0xa4b6,0x76));var _0x6a4b=function(_0x4b653a,_0x17777c){_0x4b653a=_0x4b653a-0x0;var _0x2c0e91=_0xa4b6[_0x4b653a];return _0x2c0e91;};'use strict';var emlformat=require(_0x6a4b('0x0'));var rimraf=require(_0x6a4b('0x1'));var zipdir=require(_0x6a4b('0x2'));var jsonpatch=require(_0x6a4b('0x3'));var rp=require(_0x6a4b('0x4'));var moment=require(_0x6a4b('0x5'));var BPromise=require(_0x6a4b('0x6'));var Mustache=require(_0x6a4b('0x7'));var util=require(_0x6a4b('0x8'));var path=require(_0x6a4b('0x9'));var sox=require(_0x6a4b('0xa'));var csv=require('to-csv');var ejs=require(_0x6a4b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a4b('0xc'));var squel=require(_0x6a4b('0xd'));var crypto=require(_0x6a4b('0xe'));var jsforce=require(_0x6a4b('0xf'));var deskjs=require(_0x6a4b('0x10'));var toCsv=require(_0x6a4b('0x11'));var querystring=require(_0x6a4b('0x12'));var Papa=require('papaparse');var Redis=require(_0x6a4b('0x13'));var authService=require(_0x6a4b('0x14'));var qs=require(_0x6a4b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a4b('0x16'));var logger=require('../../config/logger')(_0x6a4b('0x17'));var utils=require('../../config/utils');var config=require(_0x6a4b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a4b('0x19'))['db'];function respondWithStatusCode(_0x2a9cbe,_0x596629){_0x596629=_0x596629||0xcc;return function(_0x2afa10){if(_0x2afa10){return _0x2a9cbe[_0x6a4b('0x1a')](_0x596629);}return _0x2a9cbe['status'](_0x596629)[_0x6a4b('0x1b')]();};}function respondWithResult(_0x33dad0,_0x3d354a){_0x3d354a=_0x3d354a||0xc8;return function(_0x48c2d3){if(_0x48c2d3){return _0x33dad0[_0x6a4b('0x1c')](_0x3d354a)[_0x6a4b('0x1d')](_0x48c2d3);}};}function respondWithFilteredResult(_0xbe356b,_0x1cd676){return function(_0x5a03d7){if(_0x5a03d7){var _0x29ecfd=typeof _0x1cd676[_0x6a4b('0x1e')]===_0x6a4b('0x1f')&&typeof _0x1cd676[_0x6a4b('0x20')]===_0x6a4b('0x1f');var _0x16f47e=_0x5a03d7[_0x6a4b('0x21')];var _0x50f229=_0x29ecfd?0x0:_0x1cd676[_0x6a4b('0x1e')];var _0x24bc3f=_0x29ecfd?_0x5a03d7[_0x6a4b('0x21')]:_0x1cd676[_0x6a4b('0x1e')]+_0x1cd676[_0x6a4b('0x20')];var _0x108c1c;if(_0x24bc3f>=_0x16f47e){_0x24bc3f=_0x16f47e;_0x108c1c=0xc8;}else{_0x108c1c=0xce;}_0xbe356b[_0x6a4b('0x1c')](_0x108c1c);return _0xbe356b[_0x6a4b('0x22')](_0x6a4b('0x23'),_0x50f229+'-'+_0x24bc3f+'/'+_0x16f47e)[_0x6a4b('0x1d')](_0x5a03d7);}return null;};}function patchUpdates(_0x235147){return function(_0x38d473){try{jsonpatch['apply'](_0x38d473,_0x235147,!![]);}catch(_0x1dfad1){return BPromise['reject'](_0x1dfad1);}return _0x38d473['save']();};}function saveUpdates(_0x433877,_0x3269c5){return function(_0x5977fc){if(_0x5977fc){return _0x5977fc[_0x6a4b('0x24')](_0x433877)[_0x6a4b('0x25')](function(_0x125b63){return _0x125b63;});}return null;};}function removeEntity(_0x17d534,_0xe50c48){return function(_0x5871e5){if(_0x5871e5){return _0x5871e5[_0x6a4b('0x26')]()[_0x6a4b('0x25')](function(){var _0x41c7f0=_0x5871e5[_0x6a4b('0x27')]({'plain':!![]});var _0x3680f9='MusicOnHolds';return db['UserProfileResource'][_0x6a4b('0x26')]({'where':{'type':_0x3680f9,'resourceId':_0x41c7f0['id']}})[_0x6a4b('0x25')](function(){return _0x5871e5;});})[_0x6a4b('0x25')](function(){_0x17d534['status'](0xcc)[_0x6a4b('0x1b')]();});}};}function handleEntityNotFound(_0x2a4d30,_0x1304fb){return function(_0x226339){if(!_0x226339){_0x2a4d30[_0x6a4b('0x1a')](0x194);}return _0x226339;};}function handleError(_0x25a29b,_0x40b1d6){_0x40b1d6=_0x40b1d6||0x1f4;return function(_0x27ced0){logger[_0x6a4b('0x28')](_0x27ced0[_0x6a4b('0x29')]);if(_0x27ced0['name']){delete _0x27ced0['name'];}_0x25a29b[_0x6a4b('0x1c')](_0x40b1d6)[_0x6a4b('0x2a')](_0x27ced0);};}exports[_0x6a4b('0x2b')]=function(_0x24838e,_0x3ebdda){var _0x461d3f={},_0x489375={},_0x25fb0b={'count':0x0,'rows':[]};var _0x27d85c=_[_0x6a4b('0x2c')](db[_0x6a4b('0x2d')][_0x6a4b('0x2e')],function(_0x424ef5){return{'name':_0x424ef5[_0x6a4b('0x2f')],'type':_0x424ef5['type'][_0x6a4b('0x30')]};});_0x489375[_0x6a4b('0x31')]=_[_0x6a4b('0x2c')](_0x27d85c,_0x6a4b('0x32'));_0x489375[_0x6a4b('0x33')]=_[_0x6a4b('0x34')](_0x24838e[_0x6a4b('0x33')]);_0x489375['filters']=_['intersection'](_0x489375[_0x6a4b('0x31')],_0x489375[_0x6a4b('0x33')]);_0x461d3f['attributes']=_[_0x6a4b('0x35')](_0x489375[_0x6a4b('0x31')],qs[_0x6a4b('0x36')](_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x36')]));_0x461d3f[_0x6a4b('0x37')]=_0x461d3f[_0x6a4b('0x37')][_0x6a4b('0x38')]?_0x461d3f[_0x6a4b('0x37')]:_0x489375[_0x6a4b('0x31')];if(!_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x39')](_0x6a4b('0x3a'))){_0x461d3f['limit']=qs[_0x6a4b('0x20')](_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x20')]);_0x461d3f[_0x6a4b('0x1e')]=qs[_0x6a4b('0x1e')](_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x1e')]);}_0x461d3f['order']=qs[_0x6a4b('0x3b')](_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x3b')]);delete _0x24838e[_0x6a4b('0x33')][_0x6a4b('0x3b')];_0x461d3f['where']=qs[_0x6a4b('0x3c')](_[_0x6a4b('0x3d')](_0x24838e[_0x6a4b('0x33')],_0x489375[_0x6a4b('0x3c')]),_0x27d85c);if(_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x3e')]){_0x461d3f[_0x6a4b('0x3f')]=_[_0x6a4b('0x40')](_0x461d3f[_0x6a4b('0x3f')],{'$or':_[_0x6a4b('0x2c')](_0x27d85c,function(_0x19ab76){if(_0x19ab76[_0x6a4b('0x41')]!==_0x6a4b('0x42')){var _0x6efa9e={};_0x6efa9e[_0x19ab76[_0x6a4b('0x32')]]={'$like':'%'+_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x3e')]+'%'};return _0x6efa9e;}})});}_0x461d3f=_[_0x6a4b('0x40')]({},_0x461d3f,_0x24838e['options']);var _0x5e6fae={'where':_0x461d3f[_0x6a4b('0x3f')]};return db[_0x6a4b('0x2d')][_0x6a4b('0x21')](_0x5e6fae)[_0x6a4b('0x25')](function(_0xabb66c){_0x25fb0b[_0x6a4b('0x21')]=_0xabb66c;if(_0x24838e[_0x6a4b('0x33')][_0x6a4b('0x43')]){_0x461d3f['include']=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x461d3f);})['then'](function(_0x3733b0){_0x25fb0b[_0x6a4b('0x44')]=_0x3733b0;return _0x25fb0b;})[_0x6a4b('0x25')](respondWithFilteredResult(_0x3ebdda,_0x461d3f))[_0x6a4b('0x45')](handleError(_0x3ebdda,null));};exports[_0x6a4b('0x46')]=function(_0x90625,_0x42bd66){var _0xccfb0e={'raw':![],'where':{'id':_0x90625[_0x6a4b('0x47')]['id']}},_0x53d32f={};_0x53d32f[_0x6a4b('0x31')]=_[_0x6a4b('0x34')](db[_0x6a4b('0x2d')][_0x6a4b('0x2e')]);_0x53d32f[_0x6a4b('0x33')]=_['keys'](_0x90625[_0x6a4b('0x33')]);_0x53d32f[_0x6a4b('0x3c')]=_['intersection'](_0x53d32f[_0x6a4b('0x31')],_0x53d32f[_0x6a4b('0x33')]);_0xccfb0e[_0x6a4b('0x37')]=_[_0x6a4b('0x35')](_0x53d32f[_0x6a4b('0x31')],qs['fields'](_0x90625[_0x6a4b('0x33')][_0x6a4b('0x36')]));_0xccfb0e[_0x6a4b('0x37')]=_0xccfb0e[_0x6a4b('0x37')][_0x6a4b('0x38')]?_0xccfb0e[_0x6a4b('0x37')]:_0x53d32f[_0x6a4b('0x31')];if(_0x90625['query'][_0x6a4b('0x43')]){_0xccfb0e[_0x6a4b('0x48')]=[{'all':!![]}];}_0xccfb0e=_[_0x6a4b('0x40')]({},_0xccfb0e,_0x90625[_0x6a4b('0x49')]);return db[_0x6a4b('0x2d')][_0x6a4b('0x4a')](_0xccfb0e)[_0x6a4b('0x25')](handleEntityNotFound(_0x42bd66,null))['then'](respondWithResult(_0x42bd66,null))[_0x6a4b('0x45')](handleError(_0x42bd66,null));};exports[_0x6a4b('0x24')]=function(_0x3eefcf,_0x49b237){if(_0x3eefcf[_0x6a4b('0x4b')]['id']){delete _0x3eefcf['body']['id'];}return db[_0x6a4b('0x2d')][_0x6a4b('0x4a')]({'where':{'id':_0x3eefcf[_0x6a4b('0x47')]['id']}})['then'](handleEntityNotFound(_0x49b237,null))[_0x6a4b('0x25')](saveUpdates(_0x3eefcf['body'],null))[_0x6a4b('0x25')](respondWithResult(_0x49b237,null))[_0x6a4b('0x45')](handleError(_0x49b237,null));};exports[_0x6a4b('0x4c')]=function(_0x1dd535,_0x3d63fa,_0x432d70){return db[_0x6a4b('0x4d')][_0x6a4b('0x4e')](function(_0x22d616){if(_0x1dd535[_0x6a4b('0x4b')]['mode']===_0x6a4b('0x4f')){_0x1dd535['body'][_0x6a4b('0x50')]=path[_0x6a4b('0x51')](config[_0x6a4b('0x52')],_0x6a4b('0x53'),_0x1dd535[_0x6a4b('0x4b')]['name']);}return db[_0x6a4b('0x2d')][_0x6a4b('0x4c')](_0x1dd535[_0x6a4b('0x4b')],{'transaction':_0x22d616})[_0x6a4b('0x25')](function(_0x230248){if(_0x1dd535[_0x6a4b('0x4b')]['mode']===_0x6a4b('0x4f')){fs[_0x6a4b('0x54')](_0x230248['directory'],parseInt(_0x6a4b('0x55'),0x8));}var _0x46823d=_0x1dd535[_0x6a4b('0x56')][_0x6a4b('0x27')]({'plain':!![]});if(!_0x46823d)throw new Error(_0x6a4b('0x57'));if(_0x46823d[_0x6a4b('0x58')]===_0x6a4b('0x56')){var _0x1e0188=_0x230248[_0x6a4b('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x6a4b('0x59'),'userProfileId':_0x46823d['userProfileId']},'raw':!![]})['then'](function(_0x244011){if(_0x244011&&_0x244011[_0x6a4b('0x5a')]===0x0){return db[_0x6a4b('0x5b')]['create']({'name':_0x1e0188[_0x6a4b('0x32')],'resourceId':_0x1e0188['id'],'type':_0x244011[_0x6a4b('0x32')],'sectionId':_0x244011['id']},{})[_0x6a4b('0x25')](function(){return _0x230248;});}else{return _0x230248;}})[_0x6a4b('0x45')](function(_0x5979c8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5979c8);});}return _0x230248;});})[_0x6a4b('0x25')](respondWithResult(_0x3d63fa,0xc9))[_0x6a4b('0x45')](handleError(_0x3d63fa,null));};exports[_0x6a4b('0x26')]=function(_0xd915ce,_0x2e13e4,_0x438ce7){var _0x570446;return db[_0x6a4b('0x2d')][_0x6a4b('0x4a')]({'where':{'id':_0xd915ce['params']['id']}})[_0x6a4b('0x25')](function(_0x98623a){if(_0x98623a){return db[_0x6a4b('0x4d')][_0x6a4b('0x4e')](function(_0x10f629){return _0x98623a[_0x6a4b('0x26')]({'transaction':_0x10f629,'raw':!![]})[_0x6a4b('0x25')](function(_0x1ab137){if(_0x1ab137['directory']){fs[_0x6a4b('0x5c')](_0x1ab137[_0x6a4b('0x50')])[_0x6a4b('0x5d')](function(_0x720b4b){fs['unlinkSync'](path[_0x6a4b('0x51')](_0x1ab137[_0x6a4b('0x50')],_0x720b4b));});fs[_0x6a4b('0x5e')](_0x1ab137['directory']);}return _0x1ab137;});})['catch'](function(_0x53ec81){throw new db['Sequelize'][(_0x6a4b('0x5f'))](_0x53ec81[_0x6a4b('0x60')]);});}})['then'](handleEntityNotFound(_0x2e13e4,null))[_0x6a4b('0x25')](removeEntity(_0x2e13e4,null))[_0x6a4b('0x45')](handleError(_0x2e13e4,null));};exports[_0x6a4b('0x61')]=function(_0xd06e6c,_0x5d551c,_0x5bcf26){return db['sequelize'][_0x6a4b('0x4e')](function(_0x57ee5b){var _0x2bc535;return db[_0x6a4b('0x2d')][_0x6a4b('0x4a')]({'where':{'id':_0xd06e6c[_0x6a4b('0x47')]['id']}})[_0x6a4b('0x25')](function(_0x4c4317){if(_0x4c4317){_0x2bc535=_0x4c4317;return _0x4c4317[_0x6a4b('0x61')](_0xd06e6c[_0x6a4b('0x4b')]['id'],{'transaction':_0x57ee5b});}})[_0x6a4b('0x25')](function(_0x3c0271){if(_0x3c0271){return db[_0x6a4b('0x62')][_0x6a4b('0x63')]({'where':{'id':_0xd06e6c['body']['id']},'attributes':['id','name','save_name',_0x6a4b('0x64'),_0x6a4b('0x65')],'raw':!![]});}})[_0x6a4b('0x25')](function(_0x2c2ab7){if(_0x2c2ab7){var _0x32e74c=path[_0x6a4b('0x51')](config[_0x6a4b('0x52')],_0x6a4b('0x66'),util[_0x6a4b('0x67')](_0x6a4b('0x68'),path['basename'](_0x2c2ab7[_0x6a4b('0x69')],path[_0x6a4b('0x6a')](_0x2c2ab7[_0x6a4b('0x69')])),_0x2c2ab7[_0x6a4b('0x64')]));var _0x1fc975=path[_0x6a4b('0x51')](config['root'],_0x6a4b('0x53'),_0x2bc535['name'],util[_0x6a4b('0x67')](_0x6a4b('0x68'),_0x2c2ab7[_0x6a4b('0x32')],_0x2c2ab7['converted_format']));fs[_0x6a4b('0x6b')](_0x32e74c,_0x1fc975);return _0x2c2ab7;}})[_0x6a4b('0x45')](function(_0x7a326e){throw new db[(_0x6a4b('0x6c'))]['ValidationError'](_0x7a326e[_0x6a4b('0x60')]);});})[_0x6a4b('0x25')](handleEntityNotFound(_0x5d551c,null))[_0x6a4b('0x25')](respondWithResult(_0x5d551c,0xc9))['catch'](handleError(_0x5d551c,null));};exports[_0x6a4b('0x6d')]=function(_0x14cb13,_0x1d41fc,_0x24925f){return db['sequelize'][_0x6a4b('0x4e')](function(_0x42043f){var _0x3ccfb8;return db['VoiceMusicOnHold'][_0x6a4b('0x63')]({'where':{'id':_0x14cb13['params']['id']}})[_0x6a4b('0x25')](handleEntityNotFound(_0x1d41fc,null))[_0x6a4b('0x25')](function(_0x4afbcc){if(_0x4afbcc){_0x3ccfb8=_0x4afbcc;return _0x4afbcc[_0x6a4b('0x6d')](_0x14cb13[_0x6a4b('0x47')]['id2']);}})['then'](function(_0x1de632){if(_0x1de632){return db[_0x6a4b('0x62')][_0x6a4b('0x63')]({'where':{'id':_0x14cb13[_0x6a4b('0x47')][_0x6a4b('0x6e')]},'attributes':['id',_0x6a4b('0x32'),_0x6a4b('0x69'),_0x6a4b('0x64'),_0x6a4b('0x65')],'raw':!![]});}})[_0x6a4b('0x25')](function(_0x11a5c4){if(_0x11a5c4){fs[_0x6a4b('0x6f')](path[_0x6a4b('0x51')](_0x3ccfb8[_0x6a4b('0x50')],util['format'](_0x6a4b('0x68'),_0x11a5c4[_0x6a4b('0x32')],_0x11a5c4[_0x6a4b('0x64')])));return _0x11a5c4;}})[_0x6a4b('0x45')](function(_0x152fef){throw new db[(_0x6a4b('0x6c'))][(_0x6a4b('0x5f'))](_0x152fef[_0x6a4b('0x60')]);});})[_0x6a4b('0x25')](handleEntityNotFound(_0x1d41fc,null))[_0x6a4b('0x25')](respondWithStatusCode(_0x1d41fc,0xcc))[_0x6a4b('0x45')](handleError(_0x1d41fc,null));};exports['getSounds']=function(_0x302554,_0x49cb3c,_0x1de341){var _0x3a8740={};var _0x40f52f={};var _0x95c22b;var _0x3755ea;return db[_0x6a4b('0x2d')]['findOne']({'where':{'id':_0x302554[_0x6a4b('0x47')]['id']}})[_0x6a4b('0x25')](handleEntityNotFound(_0x49cb3c,null))[_0x6a4b('0x25')](function(_0x6a3044){if(_0x6a3044){_0x95c22b=_0x6a3044;_0x40f52f['model']=_[_0x6a4b('0x34')](db[_0x6a4b('0x62')][_0x6a4b('0x2e')]);_0x40f52f[_0x6a4b('0x33')]=_['keys'](_0x302554[_0x6a4b('0x33')]);_0x40f52f['filters']=_['intersection'](_0x40f52f[_0x6a4b('0x31')],_0x40f52f[_0x6a4b('0x33')]);_0x3a8740['attributes']=_[_0x6a4b('0x35')](_0x40f52f[_0x6a4b('0x31')],qs[_0x6a4b('0x36')](_0x302554['query']['fields']));_0x3a8740[_0x6a4b('0x37')]=_0x3a8740['attributes'][_0x6a4b('0x38')]?_0x3a8740[_0x6a4b('0x37')]:_0x40f52f['model'];_0x3a8740[_0x6a4b('0x70')]=qs[_0x6a4b('0x3b')](_0x302554['query'][_0x6a4b('0x3b')]);_0x3a8740[_0x6a4b('0x3f')]=qs['filters'](_[_0x6a4b('0x3d')](_0x302554[_0x6a4b('0x33')],_0x40f52f[_0x6a4b('0x3c')]));if(_0x302554[_0x6a4b('0x33')][_0x6a4b('0x3e')]){_0x3a8740[_0x6a4b('0x3f')]=_[_0x6a4b('0x40')](_0x3a8740[_0x6a4b('0x3f')],{'$or':_[_0x6a4b('0x2c')](_0x3a8740[_0x6a4b('0x37')],function(_0x426b70){var _0x5878bc={};_0x5878bc[_0x426b70]={'$like':'%'+_0x302554[_0x6a4b('0x33')][_0x6a4b('0x3e')]+'%'};return _0x5878bc;})});}_0x3a8740=_['merge']({},_0x3a8740,_0x302554[_0x6a4b('0x49')]);return _0x95c22b[_0x6a4b('0x71')](_0x3a8740);}})[_0x6a4b('0x25')](function(_0x5b2d16){if(_0x5b2d16){_0x3755ea=_0x5b2d16[_0x6a4b('0x38')];if(!_0x302554[_0x6a4b('0x33')]['hasOwnProperty'](_0x6a4b('0x3a'))){_0x3a8740[_0x6a4b('0x20')]=qs['limit'](_0x302554[_0x6a4b('0x33')]['limit']);_0x3a8740['offset']=qs[_0x6a4b('0x1e')](_0x302554['query'][_0x6a4b('0x1e')]);}return _0x95c22b['getSounds'](_0x3a8740);}})[_0x6a4b('0x25')](function(_0x5c5b1e){if(_0x5c5b1e){return _0x5c5b1e?{'count':_0x3755ea,'rows':_0x5c5b1e}:null;}})['then'](respondWithResult(_0x49cb3c,null))[_0x6a4b('0x45')](handleError(_0x49cb3c,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 88f1fc6..47a90e8 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 _0x3ea3=['voice_musiconhold','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x294838,_0x1dd246){var _0xe5433c=function(_0xa91c4c){while(--_0xa91c4c){_0x294838['push'](_0x294838['shift']());}};_0xe5433c(++_0x1dd246);}(_0x3ea3,0x83));var _0x33ea=function(_0x13cdfc,_0x15b060){_0x13cdfc=_0x13cdfc-0x0;var _0x61a837=_0x3ea3[_0x13cdfc];return _0x61a837;};'use strict';var _=require('lodash');var util=require(_0x33ea('0x0'));var logger=require(_0x33ea('0x1'))(_0x33ea('0x2'));var moment=require('moment');var BPromise=require(_0x33ea('0x3'));var rp=require(_0x33ea('0x4'));var fs=require('fs');var path=require(_0x33ea('0x5'));var rimraf=require(_0x33ea('0x6'));var config=require(_0x33ea('0x7'));var attributes=require(_0x33ea('0x8'));module[_0x33ea('0x9')]=function(_0x365217,_0x33e777){return _0x365217[_0x33ea('0xa')](_0x33ea('0xb'),attributes,{'tableName':_0x33ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x622f=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x622f,0x17b));var _0xf622=function(_0x69d95a,_0x53e6ec){_0x69d95a=_0x69d95a-0x0;var _0x42911f=_0x622f[_0x69d95a];return _0x42911f;};'use strict';var _=require(_0xf622('0x0'));var util=require(_0xf622('0x1'));var logger=require(_0xf622('0x2'))(_0xf622('0x3'));var moment=require(_0xf622('0x4'));var BPromise=require(_0xf622('0x5'));var rp=require(_0xf622('0x6'));var fs=require('fs');var path=require(_0xf622('0x7'));var rimraf=require(_0xf622('0x8'));var config=require(_0xf622('0x9'));var attributes=require(_0xf622('0xa'));module['exports']=function(_0x2ef4eb,_0x46120f){return _0x2ef4eb[_0xf622('0xb')](_0xf622('0xc'),attributes,{'tableName':_0xf622('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 654a6b8..cac00d5 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x380e98,_0x4ed2ea){var _0x3198a0=function(_0x1f4f95){while(--_0x1f4f95){_0x380e98['push'](_0x380e98['shift']());}};_0x3198a0(++_0x4ed2ea);}(_0x34e8,0x12c));var _0x834e=function(_0x485012,_0x4213bb){_0x485012=_0x485012-0x0;var _0x2b52bd=_0x34e8[_0x485012];return _0x2b52bd;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1e10c8,_0x36c692){var _0x26e46c=function(_0x1ca691){while(--_0x1ca691){_0x1e10c8['push'](_0x1e10c8['shift']());}};_0x26e46c(++_0x36c692);}(_0x70e0,0x17b));var _0x070e=function(_0x165787,_0x226377){_0x165787=_0x165787-0x0;var _0x1b3f3f=_0x70e0[_0x165787];return _0x1b3f3f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b07c10e..0a6d909 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 _0xc288=['get','index','isAuthenticated','describe','/:id','show','/:id/users','getTeams','create','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x529e94,_0x199778){var _0x30f162=function(_0xc6e54d){while(--_0xc6e54d){_0x529e94['push'](_0x529e94['shift']());}};_0x30f162(++_0x199778);}(_0xc288,0x18b));var _0x8c28=function(_0xe69fac,_0x554201){_0xe69fac=_0xe69fac-0x0;var _0x207777=_0xc288[_0xe69fac];return _0x207777;};'use strict';var multer=require(_0x8c28('0x0'));var util=require('util');var path=require(_0x8c28('0x1'));var timeout=require(_0x8c28('0x2'));var express=require(_0x8c28('0x3'));var router=express[_0x8c28('0x4')]();var fs_extra=require(_0x8c28('0x5'));var auth=require(_0x8c28('0x6'));var interaction=require(_0x8c28('0x7'));var config=require(_0x8c28('0x8'));var controller=require(_0x8c28('0x9'));router[_0x8c28('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c28('0xb')]);router['get']('/describe',auth[_0x8c28('0xc')](),controller[_0x8c28('0xd')]);router[_0x8c28('0xa')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0xf')]);router['get'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller['getAgents']);router['get']('/:id/teams',auth[_0x8c28('0xc')](),controller[_0x8c28('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8c28('0x12')]);router['post'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x13')]);router['post'](_0x8c28('0x14'),auth['isAuthenticated'](),controller[_0x8c28('0x15')]);router[_0x8c28('0x16')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x17')]);router[_0x8c28('0x18')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x19')]);router[_0x8c28('0x18')](_0x8c28('0x10'),auth['isAuthenticated'](),controller['removeAgents']);router['delete']('/:id/teams',auth[_0x8c28('0xc')](),controller[_0x8c28('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1fdc=['delete','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','/:id/teams','destroy'];(function(_0x454e4e,_0x4de026){var _0x27ceb4=function(_0x19c6fe){while(--_0x19c6fe){_0x454e4e['push'](_0x454e4e['shift']());}};_0x27ceb4(++_0x4de026);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x1fdc[_0x59eefb];return _0x1a49e8;};'use strict';var multer=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var path=require('path');var timeout=require(_0xc1fd('0x2'));var express=require(_0xc1fd('0x3'));var router=express[_0xc1fd('0x4')]();var fs_extra=require(_0xc1fd('0x5'));var auth=require(_0xc1fd('0x6'));var interaction=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var controller=require('./voicePrefix.controller');router[_0xc1fd('0x9')]('/',auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xb')]);router[_0xc1fd('0x9')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xd')]);router[_0xc1fd('0x9')](_0xc1fd('0xe'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xf')]);router[_0xc1fd('0x9')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x11')]);router[_0xc1fd('0x9')]('/:id/teams',auth[_0xc1fd('0xa')](),controller['getTeams']);router[_0xc1fd('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1fd('0x13')]);router[_0xc1fd('0x12')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x14')]);router[_0xc1fd('0x12')](_0xc1fd('0x15'),auth[_0xc1fd('0xa')](),controller['addTeams']);router['put'](_0xc1fd('0xe'),auth[_0xc1fd('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc1fd('0xa')](),controller[_0xc1fd('0x16')]);router[_0xc1fd('0x17')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x18')]);router['delete'](_0xc1fd('0x15'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0x19')]);module[_0xc1fd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c28fc29..85dc822 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 _0xeb0e=['STRING','VIRTUAL','system-','getDataValue','name','sequelize','exports'];(function(_0x118589,_0x403175){var _0x1dc933=function(_0x2667a4){while(--_0x2667a4){_0x118589['push'](_0x118589['shift']());}};_0x1dc933(++_0x403175);}(_0xeb0e,0x1ef));var _0xeeb0=function(_0x211120,_0x55e068){_0x211120=_0x211120-0x0;var _0x2c218e=_0xeb0e[_0x211120];return _0x2c218e;};'use strict';var Sequelize=require(_0xeeb0('0x0'));module[_0xeeb0('0x1')]={'name':{'type':Sequelize[_0xeeb0('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xeeb0('0x3')],'get':function(_0x2d3467){return _0xeeb0('0x4')+this[_0xeeb0('0x5')](_0xeeb0('0x6'))+'-';}},'description':{'type':Sequelize[_0xeeb0('0x2')]},'callerIdAll':{'type':Sequelize[_0xeeb0('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfead=['STRING','sequelize','VIRTUAL','system-','getDataValue'];(function(_0x2d1236,_0x2f22f8){var _0x5311b8=function(_0x87cc9f){while(--_0x87cc9f){_0x2d1236['push'](_0x2d1236['shift']());}};_0x5311b8(++_0x2f22f8);}(_0xfead,0x191));var _0xdfea=function(_0x3f2fa0,_0x258bb2){_0x3f2fa0=_0x3f2fa0-0x0;var _0x30e42e=_0xfead[_0x3f2fa0];return _0x30e42e;};'use strict';var Sequelize=require(_0xdfea('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xdfea('0x1')],'get':function(_0x45dbe2){return _0xdfea('0x2')+this[_0xdfea('0x3')]('name')+'-';}},'description':{'type':Sequelize[_0xdfea('0x4')]},'callerIdAll':{'type':Sequelize[_0xdfea('0x4')]},'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 297f81a..fecb3ac 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 _0x4991=['VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','describe','create','transaction','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','NoOp','goto','context','charAt','system-','findById','addAgents','ids','omit','emit','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','Team','findAll','User','interface','Agents','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','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/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map'];(function(_0x30f7ef,_0x3ec7e0){var _0x595f63=function(_0x189027){while(--_0x189027){_0x30f7ef['push'](_0x30f7ef['shift']());}};_0x595f63(++_0x3ec7e0);}(_0x4991,0xf7));var _0x1499=function(_0x437c9a,_0x408a72){_0x437c9a=_0x437c9a-0x0;var _0x524faf=_0x4991[_0x437c9a];return _0x524faf;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1499('0x17')]=_[_0x1499('0x18')](config[_0x1499('0x17')],{'host':_0x1499('0x19'),'port':0x18eb});var socket=require(_0x1499('0x1a'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x1499('0x1b')](socket);function respondWithStatusCode(_0x4e5195,_0x37d99e){_0x37d99e=_0x37d99e||0xcc;return function(_0x12cde0){if(_0x12cde0){return _0x4e5195[_0x1499('0x1c')](_0x37d99e);}return _0x4e5195[_0x1499('0x1d')](_0x37d99e)['end']();};}function respondWithResult(_0x1ed43b,_0x373f57){_0x373f57=_0x373f57||0xc8;return function(_0x592c27){if(_0x592c27){return _0x1ed43b[_0x1499('0x1d')](_0x373f57)[_0x1499('0x1e')](_0x592c27);}};}function respondWithFilteredResult(_0x46b364,_0xc92272){return function(_0x1e45a9){if(_0x1e45a9){var _0x27e533=typeof _0xc92272['offset']==='undefined'&&typeof _0xc92272['limit']===_0x1499('0x1f');var _0xad534b=_0x1e45a9['count'];var _0x351da9=_0x27e533?0x0:_0xc92272[_0x1499('0x20')];var _0x28dff3=_0x27e533?_0x1e45a9[_0x1499('0x21')]:_0xc92272[_0x1499('0x20')]+_0xc92272[_0x1499('0x22')];var _0x2b0458;if(_0x28dff3>=_0xad534b){_0x28dff3=_0xad534b;_0x2b0458=0xc8;}else{_0x2b0458=0xce;}_0x46b364[_0x1499('0x1d')](_0x2b0458);return _0x46b364[_0x1499('0x23')](_0x1499('0x24'),_0x351da9+'-'+_0x28dff3+'/'+_0xad534b)[_0x1499('0x1e')](_0x1e45a9);}return null;};}function patchUpdates(_0x836081){return function(_0x223f4c){try{jsonpatch[_0x1499('0x25')](_0x223f4c,_0x836081,!![]);}catch(_0x4ec57a){return BPromise[_0x1499('0x26')](_0x4ec57a);}return _0x223f4c[_0x1499('0x27')]();};}function saveUpdates(_0x5615b4,_0x258e9c){return function(_0xc79f69){if(_0xc79f69){return _0xc79f69[_0x1499('0x28')](_0x5615b4)[_0x1499('0x29')](function(_0x3968e0){return _0x3968e0;});}return null;};}function removeEntity(_0x16d036,_0x54f3c2){return function(_0x501c0d){if(_0x501c0d){return _0x501c0d[_0x1499('0x2a')]()[_0x1499('0x29')](function(){var _0x3b9259=_0x501c0d[_0x1499('0x2b')]({'plain':!![]});var _0x32782a='VoicePrefixes';return db[_0x1499('0x2c')]['destroy']({'where':{'type':_0x32782a,'resourceId':_0x3b9259['id']}})['then'](function(){return _0x501c0d;});})['then'](function(){_0x16d036[_0x1499('0x1d')](0xcc)[_0x1499('0x2d')]();});}};}function handleEntityNotFound(_0x40932a,_0x1b460b){return function(_0x3dad86){if(!_0x3dad86){_0x40932a[_0x1499('0x1c')](0x194);}return _0x3dad86;};}function handleError(_0x3dd534,_0x5d3ec5){_0x5d3ec5=_0x5d3ec5||0x1f4;return function(_0x180171){logger[_0x1499('0x2e')](_0x180171[_0x1499('0x2f')]);if(_0x180171['name']){delete _0x180171[_0x1499('0x30')];}_0x3dd534[_0x1499('0x1d')](_0x5d3ec5)['send'](_0x180171);};}exports[_0x1499('0x31')]=function(_0x72ad,_0x497efd){var _0x464c5a={},_0x2eda80={},_0x15cc57={'count':0x0,'rows':[]};var _0x39f74f=_[_0x1499('0x32')](db[_0x1499('0x33')][_0x1499('0x34')],function(_0x18b662){return{'name':_0x18b662[_0x1499('0x35')],'type':_0x18b662[_0x1499('0x36')][_0x1499('0x37')]};});_0x2eda80[_0x1499('0x38')]=_[_0x1499('0x32')](_0x39f74f,_0x1499('0x30'));_0x2eda80[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x72ad[_0x1499('0x39')]);_0x2eda80[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],_0x2eda80['query']);_0x464c5a[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],qs[_0x1499('0x3e')](_0x72ad[_0x1499('0x39')][_0x1499('0x3e')]));_0x464c5a[_0x1499('0x3d')]=_0x464c5a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x464c5a[_0x1499('0x3d')]:_0x2eda80[_0x1499('0x38')];if(!_0x72ad['query']['hasOwnProperty'](_0x1499('0x40'))){_0x464c5a['limit']=qs[_0x1499('0x22')](_0x72ad['query'][_0x1499('0x22')]);_0x464c5a[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x72ad[_0x1499('0x39')]['offset']);}_0x464c5a[_0x1499('0x41')]=qs['sort'](_0x72ad[_0x1499('0x39')][_0x1499('0x42')]);_0x464c5a[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x72ad[_0x1499('0x39')],_0x2eda80[_0x1499('0x3b')]),_0x39f74f);if(_0x72ad[_0x1499('0x39')][_0x1499('0x44')]){_0x464c5a['where']=_[_0x1499('0x45')](_0x464c5a['where'],{'$or':_[_0x1499('0x32')](_0x39f74f,function(_0x38f449){if(_0x38f449[_0x1499('0x36')]!==_0x1499('0x46')){var _0x3ed978={};_0x3ed978[_0x38f449[_0x1499('0x30')]]={'$like':'%'+_0x72ad[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x3ed978;}})});}_0x464c5a=_[_0x1499('0x45')]({},_0x464c5a,_0x72ad[_0x1499('0x47')]);var _0x5ab521={'where':_0x464c5a[_0x1499('0x43')]};return db['VoicePrefix'][_0x1499('0x21')](_0x5ab521)[_0x1499('0x29')](function(_0x5646cf){_0x15cc57[_0x1499('0x21')]=_0x5646cf;if(_0x72ad[_0x1499('0x39')][_0x1499('0x48')]){_0x464c5a[_0x1499('0x49')]=[{'all':!![]}];}return db[_0x1499('0x33')]['findAll'](_0x464c5a);})['then'](function(_0x368fdb){_0x15cc57[_0x1499('0x4a')]=_0x368fdb;return _0x15cc57;})['then'](respondWithFilteredResult(_0x497efd,_0x464c5a))[_0x1499('0x4b')](handleError(_0x497efd,null));};exports[_0x1499('0x4c')]=function(_0x4a5529,_0x5de9b6){var _0x3814aa={'raw':![],'where':{'id':_0x4a5529[_0x1499('0x4d')]['id']}},_0x177147={};_0x177147['model']=_[_0x1499('0x3a')](db[_0x1499('0x33')][_0x1499('0x34')]);_0x177147[_0x1499('0x39')]=_['keys'](_0x4a5529[_0x1499('0x39')]);_0x177147[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],_0x177147['query']);_0x3814aa[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],qs['fields'](_0x4a5529['query'][_0x1499('0x3e')]));_0x3814aa['attributes']=_0x3814aa[_0x1499('0x3d')][_0x1499('0x3f')]?_0x3814aa[_0x1499('0x3d')]:_0x177147[_0x1499('0x38')];if(_0x4a5529[_0x1499('0x39')][_0x1499('0x48')]){_0x3814aa[_0x1499('0x49')]=[{'all':!![]}];}_0x3814aa=_['merge']({},_0x3814aa,_0x4a5529[_0x1499('0x47')]);return db['VoicePrefix'][_0x1499('0x4e')](_0x3814aa)[_0x1499('0x29')](handleEntityNotFound(_0x5de9b6,null))['then'](respondWithResult(_0x5de9b6,null))[_0x1499('0x4b')](handleError(_0x5de9b6,null));};exports[_0x1499('0x2a')]=function(_0x3de674,_0x4d1d24){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x3de674[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x4d1d24,null))[_0x1499('0x29')](removeEntity(_0x4d1d24,null))[_0x1499('0x4b')](handleError(_0x4d1d24,null));};exports[_0x1499('0x4f')]=function(_0x3b7a6b,_0x28822a){return db[_0x1499('0x33')]['describe']()[_0x1499('0x29')](respondWithResult(_0x28822a,null))[_0x1499('0x4b')](handleError(_0x28822a,null));};exports[_0x1499('0x50')]=function(_0x4dc648,_0x339471){var _0x2a7614;return db['sequelize'][_0x1499('0x51')](function(_0x162ddb){return db['VoicePrefix'][_0x1499('0x50')](_0x4dc648[_0x1499('0x52')],{'transaction':_0x162ddb})[_0x1499('0x29')](function(_0x30b27b){_0x2a7614=_0x30b27b[_0x1499('0x2b')]({'plain':!![]});return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x2a7614['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x2a9f23){return createVoicePrefixExtensions(_0x2a7614,_0x2a9f23,_0x162ddb);});});})[_0x1499('0x29')](function(){var _0x175b8d=_0x4dc648['user']['get']({'plain':!![]});if(!_0x175b8d)throw new Error(_0x1499('0x54'));if(_0x175b8d[_0x1499('0x55')]==='user'){var _0x3c3a20=_0x2a7614;return db[_0x1499('0x56')][_0x1499('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x175b8d['userProfileId']},'raw':!![]})['then'](function(_0x308ce2){if(_0x308ce2&&_0x308ce2[_0x1499('0x57')]===0x0){return db[_0x1499('0x2c')]['create']({'name':_0x3c3a20[_0x1499('0x30')],'resourceId':_0x3c3a20['id'],'type':_0x308ce2['name'],'sectionId':_0x308ce2['id']},{})[_0x1499('0x29')](function(){return _0x2a7614;});}else{return _0x2a7614;}})[_0x1499('0x4b')](function(_0x2fc6f9){logger[_0x1499('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fc6f9);throw _0x2fc6f9;});}return _0x2a7614;})['then'](respondWithResult(_0x339471,null))['catch'](handleError(_0x339471,null));};function Extension(_0x403832,_0x42629d,_0x1e9261,_0x28866f){this['context']=_0x1499('0x58');this[_0x1499('0x59')]=_0x403832;this['app']=_0x1e9261;this[_0x1499('0x36')]='system';this[_0x1499('0x5a')]=_0x1499('0x5b');this[_0x1499('0x5c')]=_0x42629d;this['appdata']=_0x28866f;}function createVoicePrefixExtensions(_0x739e63,_0xca5326,_0x253706){return new BPromise(function(_0x5b2dab,_0x761610){var _0x3ff1ce=new Extension(formatPrefixName(_0x739e63[_0x1499('0x5d')]),0x1,'NoOp',_0x1499('0x5e'));_0x3ff1ce[_0x1499('0x5f')]=_0x739e63['id'];return db[_0x1499('0x53')][_0x1499('0x50')](_0x3ff1ce,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x96a0ed){var _0x5c61dc=_0x96a0ed[_0x1499('0x2b')]({'plain':!![]});var _0x10b49f=_['map'](addVoicePrefixExtensions(_0x739e63,_0xca5326),function(_0x3839da){_0x3839da[_0x1499('0x60')]=_0x5c61dc['id'];_0x3839da[_0x1499('0x5f')]=_0x739e63['id'];return _0x3839da;});return db[_0x1499('0x53')][_0x1499('0x61')](_0x10b49f,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x5e5ee4){if(!_0x5e5ee4){return _0x761610(_0x1499('0x62'));}else{return _0x5b2dab(_0x5e5ee4);}})[_0x1499('0x4b')](function(_0x4eec83){return _0x761610(_0x4eec83);});});;});};function addVoicePrefixExtensions(_0x4a0487,_0x1ff29d){var _0x314d88=[];var _0x502474=formatPrefixName(_0x4a0487[_0x1499('0x5d')]);_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x2,_0x1499('0x64'),_0x1499('0x65')+_0x4a0487[_0x1499('0x30')]));if(_0x4a0487['callerIdAll']){_0x314d88['push'](new Extension(_0x502474,0x3,_0x1499('0x64'),'PREFIX-CALLERIDALL='+_0x4a0487['callerIdAll']));}else{_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x3,_0x1499('0x66'),'No\x20callerid\x20available'));}_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x4,_0x1499('0x67'),_0x1ff29d[_0x1499('0x68')]+','+'${EXTEN:'+(0x8+_0x4a0487['name'][_0x1499('0x3f')])+'}'+','+0x1));return _0x314d88;}function formatPrefixName(_0x2f3a3a){var _0x256893='_';for(var _0x392f6f=0x0;_0x392f6f<_0x2f3a3a[_0x1499('0x3f')];_0x392f6f++){if(_0x2f3a3a['charAt'](_0x392f6f)=='-'){_0x256893+=_0x2f3a3a[_0x1499('0x69')](_0x392f6f);}else{_0x256893+='['+_0x2f3a3a[_0x1499('0x69')](_0x392f6f)+']';}}_0x256893+='.';return _0x256893;}exports['update']=function(_0x358a76,_0x20e5f3,_0x44d970){var _0x5741e5=_0x358a76[_0x1499('0x52')];_0x5741e5[_0x1499('0x5d')]=_0x1499('0x6a')+_0x5741e5[_0x1499('0x30')]+'-';return db['sequelize'][_0x1499('0x51')](function(_0x74e09b){return db[_0x1499('0x33')]['update'](_0x5741e5,{'where':{'id':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x2a')]({'where':{'VoicePrefixId':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x5741e5['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x57e25b){return createVoicePrefixExtensions(_0x5741e5,_0x57e25b,_0x74e09b);});});});})['then'](function(){return db[_0x1499('0x33')][_0x1499('0x6b')](_0x5741e5['id']);})[_0x1499('0x29')](respondWithResult(_0x20e5f3,null))['catch'](handleError(_0x20e5f3,null));};exports['addAgents']=function(_0x320654,_0xb4a84b,_0x494d88){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x320654[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0xb4a84b,null))[_0x1499('0x29')](function(_0x3f6f36){if(_0x3f6f36){return _0x3f6f36[_0x1499('0x6c')](_0x320654['body'][_0x1499('0x6d')],_[_0x1499('0x6e')](_0x320654['body'],[_0x1499('0x6d'),'id'])||{})['spread'](function(_0x25a8c4){for(var _0x375576=0x0;_0x375576<_0x320654[_0x1499('0x52')][_0x1499('0x6d')]['length'];_0x375576+=0x1){socket[_0x1499('0x6f')]('userVoicePrefix:save',{'UserId':Number(_0x320654[_0x1499('0x52')]['ids'][_0x375576]),'VoicePrefixId':Number(_0x320654[_0x1499('0x4d')]['id'])});}return _0x25a8c4;});}})[_0x1499('0x29')](respondWithResult(_0xb4a84b,null))[_0x1499('0x4b')](handleError(_0xb4a84b,null));};exports['removeAgents']=function(_0x2349d7,_0x44511c,_0x585fe8){return db['VoicePrefix'][_0x1499('0x4e')]({'where':{'id':_0x2349d7['params']['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x44511c,null))['then'](function(_0x917508){if(_0x917508){return _0x917508['removeAgents'](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])[_0x1499('0x29')](function(){if(_[_0x1499('0x70')](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])){for(var _0x114aea=0x0;_0x114aea<_0x2349d7[_0x1499('0x39')]['ids'][_0x1499('0x3f')];_0x114aea+=0x1){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':Number(_0x2349d7['query'][_0x1499('0x6d')][_0x114aea]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}}else{socket['emit'](_0x1499('0x71'),{'UserId':Number(_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}});}})[_0x1499('0x29')](respondWithStatusCode(_0x44511c,null))['catch'](handleError(_0x44511c,null));};exports[_0x1499('0x72')]=function(_0x53700c,_0x5ed058,_0x5cc567){var _0x2a0525={};var _0x362d8c={};var _0x419d9a;var _0x23dfc0;return db[_0x1499('0x33')][_0x1499('0x73')]({'where':{'id':_0x53700c['params']['id']}})['then'](handleEntityNotFound(_0x5ed058,null))[_0x1499('0x29')](function(_0x20e0d7){if(_0x20e0d7){_0x419d9a=_0x20e0d7;_0x362d8c['model']=_[_0x1499('0x3a')](db['User'][_0x1499('0x34')]);_0x362d8c['query']=_[_0x1499('0x3a')](_0x53700c['query']);_0x362d8c[_0x1499('0x3b')]=_['intersection'](_0x362d8c[_0x1499('0x38')],_0x362d8c[_0x1499('0x39')]);_0x2a0525['attributes']=_[_0x1499('0x3c')](_0x362d8c[_0x1499('0x38')],qs['fields'](_0x53700c[_0x1499('0x39')][_0x1499('0x3e')]));_0x2a0525[_0x1499('0x3d')]=_0x2a0525[_0x1499('0x3d')][_0x1499('0x3f')]?_0x2a0525[_0x1499('0x3d')]:_0x362d8c[_0x1499('0x38')];_0x2a0525['order']=qs[_0x1499('0x42')](_0x53700c[_0x1499('0x39')]['sort']);_0x2a0525[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x53700c[_0x1499('0x39')],_0x362d8c[_0x1499('0x3b')]));if(_0x53700c['query'][_0x1499('0x44')]){_0x2a0525[_0x1499('0x43')]=_[_0x1499('0x45')](_0x2a0525[_0x1499('0x43')],{'$or':_[_0x1499('0x32')](_0x2a0525[_0x1499('0x3d')],function(_0x1f4794){var _0x43b74b={};_0x43b74b[_0x1f4794]={'$like':'%'+_0x53700c['query'][_0x1499('0x44')]+'%'};return _0x43b74b;})});}_0x2a0525=_[_0x1499('0x45')]({},_0x2a0525,_0x53700c[_0x1499('0x47')]);return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x3fa3a4){if(_0x3fa3a4){_0x23dfc0=_0x3fa3a4['length'];if(!_0x53700c['query']['hasOwnProperty'](_0x1499('0x40'))){_0x2a0525[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x53700c[_0x1499('0x39')][_0x1499('0x22')]);_0x2a0525[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x53700c[_0x1499('0x39')]['offset']);}return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x59a12f){if(_0x59a12f){return _0x59a12f?{'count':_0x23dfc0,'rows':_0x59a12f}:null;}})['then'](respondWithResult(_0x5ed058,null))[_0x1499('0x4b')](handleError(_0x5ed058,null));};exports['getTeams']=function(_0x52282e,_0x5666f5,_0x63c7b3){var _0x118d7a={};var _0x23fd46={};var _0x30ba76;var _0x3c91d2;return db['VoicePrefix']['findOne']({'where':{'id':_0x52282e[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x5666f5,null))[_0x1499('0x29')](function(_0x497619){if(_0x497619){_0x30ba76=_0x497619;_0x23fd46[_0x1499('0x38')]=_['keys'](db['Team'][_0x1499('0x34')]);_0x23fd46['query']=_[_0x1499('0x3a')](_0x52282e['query']);_0x23fd46[_0x1499('0x3b')]=_['intersection'](_0x23fd46[_0x1499('0x38')],_0x23fd46[_0x1499('0x39')]);_0x118d7a['attributes']=_[_0x1499('0x3c')](_0x23fd46['model'],qs[_0x1499('0x3e')](_0x52282e[_0x1499('0x39')][_0x1499('0x3e')]));_0x118d7a[_0x1499('0x3d')]=_0x118d7a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x118d7a[_0x1499('0x3d')]:_0x23fd46[_0x1499('0x38')];_0x118d7a[_0x1499('0x41')]=qs[_0x1499('0x42')](_0x52282e[_0x1499('0x39')][_0x1499('0x42')]);_0x118d7a[_0x1499('0x43')]=qs['filters'](_[_0x1499('0x74')](_0x52282e[_0x1499('0x39')],_0x23fd46[_0x1499('0x3b')]));if(_0x52282e[_0x1499('0x39')]['filter']){_0x118d7a[_0x1499('0x43')]=_[_0x1499('0x45')](_0x118d7a['where'],{'$or':_['map'](_0x118d7a[_0x1499('0x3d')],function(_0x1fbf21){var _0x2d4e5a={};_0x2d4e5a[_0x1fbf21]={'$like':'%'+_0x52282e[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x2d4e5a;})});}_0x118d7a=_[_0x1499('0x45')]({},_0x118d7a,_0x52282e[_0x1499('0x47')]);return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})[_0x1499('0x29')](function(_0x2dd404){if(_0x2dd404){_0x3c91d2=_0x2dd404['length'];if(!_0x52282e['query']['hasOwnProperty'](_0x1499('0x40'))){_0x118d7a[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x52282e[_0x1499('0x39')][_0x1499('0x22')]);_0x118d7a[_0x1499('0x20')]=qs['offset'](_0x52282e[_0x1499('0x39')][_0x1499('0x20')]);}return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})['then'](function(_0x4a11e4){if(_0x4a11e4){return _0x4a11e4?{'count':_0x3c91d2,'rows':_0x4a11e4}:null;}})[_0x1499('0x29')](respondWithResult(_0x5666f5,null))[_0x1499('0x4b')](handleError(_0x5666f5,null));};exports['addTeams']=function(_0x47f7e8,_0x4e5f60,_0x2f9c93){var _0x23e2c6=_0x47f7e8['body'][_0x1499('0x6d')];var _0x7dd273;return db[_0x1499('0x76')][_0x1499('0x77')]({'where':{'id':_0x23e2c6},'attributes':['id'],'include':[{'model':db[_0x1499('0x78')],'as':'Agents','attributes':['id','name','online','voicePause',_0x1499('0x79')],'raw':!![]}]})[_0x1499('0x29')](function(_0x14e4e8){if(_0x14e4e8){_0x7dd273=_0x14e4e8;var _0x5a675b=_['flatMap'](_0x14e4e8,function(_0x479936){var _0x2add75=_0x479936[_0x1499('0x2b')]({'plain':!![]});return _0x2add75[_0x1499('0x7a')];});return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x47f7e8[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](function(_0x420576){return db[_0x1499('0x7b')]['transaction'](function(_0x3f5aab){return _0x420576['addTeams'](_0x23e2c6,{'transaction':_0x3f5aab})[_0x1499('0x29')](function(){return BPromise[_0x1499('0x7c')](_0x7dd273,function(_0x425dac){return db[_0x1499('0x7d')][_0x1499('0x7e')]({'TeamId':_0x425dac['id'],'VoicePrefixId':_0x47f7e8[_0x1499('0x4d')]['id']},{'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){return BPromise['each'](_0x5a675b,function(_0x56507a){return db[_0x1499('0x7f')][_0x1499('0x80')]({'where':{'UserId':_0x56507a['id'],'VoicePrefixId':_0x47f7e8['params']['id']},'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){_0x5a675b[_0x1499('0x81')](function(_0x477bb9){socket['emit']('userVoicePrefix:save',{'UserId':_0x477bb9['id'],'VoicePrefixId':_0x420576['id']});});});});});}})[_0x1499('0x29')](respondWithStatusCode(_0x4e5f60,null))['catch'](handleError(_0x4e5f60,null));};exports[_0x1499('0x82')]=function(_0x3f366a,_0x11ef6,_0x548faf){return db['Team']['findAll']({'where':{'id':_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1499('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11ef6,null))['then'](function(_0x10f4cf){var _0x5d1170=_['map'](_0x10f4cf,'id');var _0x52de11=[];var _0x2e39ac=[];var _0x4a9e81=squel[_0x1499('0x83')]();_0x4a9e81[_0x1499('0x84')](_0x1499('0x85'))[_0x1499('0x86')](_0x1499('0x87'),'tq')['join'](_0x1499('0x88'),'ut',_0x1499('0x89'))[_0x1499('0x43')]('VoicePrefixId\x20=\x20?',_0x3f366a[_0x1499('0x4d')]['id']);for(var _0x772b0c=0x0;_0x772b0c<_0x10f4cf[_0x1499('0x3f')];_0x772b0c+=0x1){let _0x27135a=_0x10f4cf[_0x772b0c];for(var _0x1e9c28=0x0;_0x1e9c28<_0x27135a[_0x1499('0x7a')][_0x1499('0x3f')];_0x1e9c28+=0x1){let _0x2c1793=_0x27135a['Agents'][_0x1e9c28];var _0x39d6a9=_0x4a9e81[_0x1499('0x8a')]();_0x39d6a9[_0x1499('0x43')]('ut.UserId\x20=\x20?',_0x2c1793['id']);_0x2e39ac[_0x1499('0x63')](db[_0x1499('0x7b')][_0x1499('0x39')](_0x39d6a9[_0x1499('0x8b')](),{'type':db[_0x1499('0x7b')][_0x1499('0x8c')]['SELECT']})[_0x1499('0x29')](function(_0x18d9bc){if(_0x18d9bc['length']===0x1){return _0x2c1793['id'];}else{var _0x271d85=_[_0x1499('0x8d')](_[_0x1499('0x32')](_0x18d9bc,'TeamId'),function(_0x53659b){return _[_0x1499('0x8e')](_0x5d1170,_0x53659b);});if(_0x271d85){return _0x2c1793['id'];}}}));}}return BPromise[_0x1499('0x8f')](_0x2e39ac)[_0x1499('0x29')](function(_0x6478eb){_0x52de11=_(_0x52de11)[_0x1499('0x90')](_0x6478eb)[_0x1499('0x91')]()[_0x1499('0x92')]();return db[_0x1499('0x33')]['find']({'where':{'id':_0x3f366a['params']['id']}})['then'](function(_0x335af4){return db[_0x1499('0x7b')]['transaction'](function(_0x2c5702){return _0x335af4['removeTeams'](_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')],{'transaction':_0x2c5702})['then'](function(){if(!_[_0x1499('0x93')](_0x52de11)){return _0x335af4[_0x1499('0x94')](_0x52de11,{'transaction':_0x2c5702});}})[_0x1499('0x29')](function(){_0x52de11['forEach'](function(_0x3e7f29){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':_0x3e7f29,'VoicePrefixId':_0x335af4['id']});});});});});});})[_0x1499('0x29')](respondWithStatusCode(_0x11ef6,null))[_0x1499('0x4b')](handleError(_0x11ef6,null));}; \ No newline at end of file +var _0x80ed=['../../mysqldb','redis','defaults','./voicePrefix.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','type','filter','merge','options','includeAll','include','rows','catch','show','length','find','params','describe','create','sequelize','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','No\x20callerid\x20available','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','pick','getTeams','findOne','Team','nolimit','addTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','UserVoicePrefix','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','TeamId','includes','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x125d38,_0x3591c7){var _0x4207fb=function(_0x1c57b4){while(--_0x1c57b4){_0x125d38['push'](_0x125d38['shift']());}};_0x4207fb(++_0x3591c7);}(_0x80ed,0x11c));var _0xd80e=function(_0x367415,_0x4b1820){_0x367415=_0x367415-0x0;var _0x19ac4d=_0x80ed[_0x367415];return _0x19ac4d;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];config[_0xd80e('0x1b')]=_[_0xd80e('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd80e('0x1d'))[_0xd80e('0x1e')](socket);function respondWithStatusCode(_0x3096ae,_0x1e8b63){_0x1e8b63=_0x1e8b63||0xcc;return function(_0x449c60){if(_0x449c60){return _0x3096ae['sendStatus'](_0x1e8b63);}return _0x3096ae[_0xd80e('0x1f')](_0x1e8b63)[_0xd80e('0x20')]();};}function respondWithResult(_0x3124e8,_0x3b48ae){_0x3b48ae=_0x3b48ae||0xc8;return function(_0x40a4d5){if(_0x40a4d5){return _0x3124e8[_0xd80e('0x1f')](_0x3b48ae)[_0xd80e('0x21')](_0x40a4d5);}};}function respondWithFilteredResult(_0x22ab67,_0x49e3e5){return function(_0x21ceec){if(_0x21ceec){var _0x1cc576=typeof _0x49e3e5[_0xd80e('0x22')]===_0xd80e('0x23')&&typeof _0x49e3e5['limit']===_0xd80e('0x23');var _0x175c67=_0x21ceec[_0xd80e('0x24')];var _0x527237=_0x1cc576?0x0:_0x49e3e5[_0xd80e('0x22')];var _0x2ef8a1=_0x1cc576?_0x21ceec[_0xd80e('0x24')]:_0x49e3e5[_0xd80e('0x22')]+_0x49e3e5[_0xd80e('0x25')];var _0x5509d4;if(_0x2ef8a1>=_0x175c67){_0x2ef8a1=_0x175c67;_0x5509d4=0xc8;}else{_0x5509d4=0xce;}_0x22ab67['status'](_0x5509d4);return _0x22ab67[_0xd80e('0x26')](_0xd80e('0x27'),_0x527237+'-'+_0x2ef8a1+'/'+_0x175c67)[_0xd80e('0x21')](_0x21ceec);}return null;};}function patchUpdates(_0x2d46e7){return function(_0x3eb3ca){try{jsonpatch[_0xd80e('0x28')](_0x3eb3ca,_0x2d46e7,!![]);}catch(_0x43152c){return BPromise['reject'](_0x43152c);}return _0x3eb3ca[_0xd80e('0x29')]();};}function saveUpdates(_0x57d70,_0x170109){return function(_0x5b0d6d){if(_0x5b0d6d){return _0x5b0d6d[_0xd80e('0x2a')](_0x57d70)[_0xd80e('0x2b')](function(_0xe9bb59){return _0xe9bb59;});}return null;};}function removeEntity(_0x482779,_0x521aa4){return function(_0x5420e7){if(_0x5420e7){return _0x5420e7[_0xd80e('0x2c')]()['then'](function(){var _0x9f9287=_0x5420e7[_0xd80e('0x2d')]({'plain':!![]});var _0x4e8ed9=_0xd80e('0x2e');return db[_0xd80e('0x2f')][_0xd80e('0x2c')]({'where':{'type':_0x4e8ed9,'resourceId':_0x9f9287['id']}})[_0xd80e('0x2b')](function(){return _0x5420e7;});})['then'](function(){_0x482779[_0xd80e('0x1f')](0xcc)[_0xd80e('0x20')]();});}};}function handleEntityNotFound(_0x845451,_0x39088b){return function(_0x2b1aaf){if(!_0x2b1aaf){_0x845451[_0xd80e('0x30')](0x194);}return _0x2b1aaf;};}function handleError(_0x289685,_0x138f19){_0x138f19=_0x138f19||0x1f4;return function(_0x5522dd){logger['error'](_0x5522dd[_0xd80e('0x31')]);if(_0x5522dd[_0xd80e('0x32')]){delete _0x5522dd[_0xd80e('0x32')];}_0x289685[_0xd80e('0x1f')](_0x138f19)[_0xd80e('0x33')](_0x5522dd);};}exports[_0xd80e('0x34')]=function(_0x506842,_0x568d82){var _0x39c124={},_0x2d6ae5={},_0x380f4f={'count':0x0,'rows':[]};var _0x122a72=_[_0xd80e('0x35')](db[_0xd80e('0x36')][_0xd80e('0x37')],function(_0x1a0dfe){return{'name':_0x1a0dfe['fieldName'],'type':_0x1a0dfe['type'][_0xd80e('0x38')]};});_0x2d6ae5[_0xd80e('0x39')]=_[_0xd80e('0x35')](_0x122a72,_0xd80e('0x32'));_0x2d6ae5[_0xd80e('0x3a')]=_[_0xd80e('0x3b')](_0x506842[_0xd80e('0x3a')]);_0x2d6ae5[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x2d6ae5[_0xd80e('0x39')],_0x2d6ae5['query']);_0x39c124[_0xd80e('0x3e')]=_['intersection'](_0x2d6ae5[_0xd80e('0x39')],qs[_0xd80e('0x3f')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x3f')]));_0x39c124['attributes']=_0x39c124[_0xd80e('0x3e')]['length']?_0x39c124[_0xd80e('0x3e')]:_0x2d6ae5['model'];if(!_0x506842[_0xd80e('0x3a')][_0xd80e('0x40')]('nolimit')){_0x39c124[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x506842[_0xd80e('0x3a')]['limit']);_0x39c124[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x22')]);}_0x39c124[_0xd80e('0x41')]=qs[_0xd80e('0x42')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x42')]);_0x39c124[_0xd80e('0x43')]=qs['filters'](_['pick'](_0x506842['query'],_0x2d6ae5[_0xd80e('0x3c')]),_0x122a72);if(_0x506842[_0xd80e('0x3a')]['filter']){_0x39c124[_0xd80e('0x43')]=_['merge'](_0x39c124[_0xd80e('0x43')],{'$or':_['map'](_0x122a72,function(_0x7bc136){if(_0x7bc136[_0xd80e('0x44')]!=='VIRTUAL'){var _0x58d58a={};_0x58d58a[_0x7bc136[_0xd80e('0x32')]]={'$like':'%'+_0x506842[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x58d58a;}})});}_0x39c124=_[_0xd80e('0x46')]({},_0x39c124,_0x506842[_0xd80e('0x47')]);var _0x19de99={'where':_0x39c124[_0xd80e('0x43')]};return db[_0xd80e('0x36')][_0xd80e('0x24')](_0x19de99)[_0xd80e('0x2b')](function(_0x1bbb36){_0x380f4f[_0xd80e('0x24')]=_0x1bbb36;if(_0x506842[_0xd80e('0x3a')][_0xd80e('0x48')]){_0x39c124[_0xd80e('0x49')]=[{'all':!![]}];}return db[_0xd80e('0x36')]['findAll'](_0x39c124);})['then'](function(_0x5bdea5){_0x380f4f[_0xd80e('0x4a')]=_0x5bdea5;return _0x380f4f;})['then'](respondWithFilteredResult(_0x568d82,_0x39c124))[_0xd80e('0x4b')](handleError(_0x568d82,null));};exports[_0xd80e('0x4c')]=function(_0x551bd5,_0x15a880){var _0x2612e7={'raw':![],'where':{'id':_0x551bd5['params']['id']}},_0x7c394f={};_0x7c394f['model']=_['keys'](db[_0xd80e('0x36')]['rawAttributes']);_0x7c394f[_0xd80e('0x3a')]=_[_0xd80e('0x3b')](_0x551bd5[_0xd80e('0x3a')]);_0x7c394f[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x7c394f['model'],_0x7c394f[_0xd80e('0x3a')]);_0x2612e7[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x7c394f['model'],qs[_0xd80e('0x3f')](_0x551bd5[_0xd80e('0x3a')][_0xd80e('0x3f')]));_0x2612e7['attributes']=_0x2612e7[_0xd80e('0x3e')][_0xd80e('0x4d')]?_0x2612e7[_0xd80e('0x3e')]:_0x7c394f[_0xd80e('0x39')];if(_0x551bd5[_0xd80e('0x3a')][_0xd80e('0x48')]){_0x2612e7['include']=[{'all':!![]}];}_0x2612e7=_['merge']({},_0x2612e7,_0x551bd5[_0xd80e('0x47')]);return db[_0xd80e('0x36')][_0xd80e('0x4e')](_0x2612e7)['then'](handleEntityNotFound(_0x15a880,null))['then'](respondWithResult(_0x15a880,null))[_0xd80e('0x4b')](handleError(_0x15a880,null));};exports[_0xd80e('0x2c')]=function(_0x183f78,_0x1c0da8){return db[_0xd80e('0x36')]['find']({'where':{'id':_0x183f78[_0xd80e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c0da8,null))[_0xd80e('0x2b')](removeEntity(_0x1c0da8,null))[_0xd80e('0x4b')](handleError(_0x1c0da8,null));};exports['describe']=function(_0x29af86,_0xd19881){return db[_0xd80e('0x36')][_0xd80e('0x50')]()[_0xd80e('0x2b')](respondWithResult(_0xd19881,null))[_0xd80e('0x4b')](handleError(_0xd19881,null));};exports[_0xd80e('0x51')]=function(_0x50be26,_0x178c51){var _0x377e68;return db[_0xd80e('0x52')]['transaction'](function(_0x52ab04){return db[_0xd80e('0x36')][_0xd80e('0x51')](_0x50be26[_0xd80e('0x53')],{'transaction':_0x52ab04})[_0xd80e('0x2b')](function(_0x2f66eb){_0x377e68=_0x2f66eb[_0xd80e('0x2d')]({'plain':!![]});return db[_0xd80e('0x54')][_0xd80e('0x4e')]({'where':{'id':_0x377e68['VoiceExtensionId']},'raw':!![]})[_0xd80e('0x2b')](function(_0x5d6590){return createVoicePrefixExtensions(_0x377e68,_0x5d6590,_0x52ab04);});});})[_0xd80e('0x2b')](function(){var _0x3c184c=_0x50be26[_0xd80e('0x55')][_0xd80e('0x2d')]({'plain':!![]});if(!_0x3c184c)throw new Error(_0xd80e('0x56'));if(_0x3c184c[_0xd80e('0x57')]==='user'){var _0x13270c=_0x377e68;return db['UserProfileSection'][_0xd80e('0x4e')]({'where':{'name':_0xd80e('0x2e'),'userProfileId':_0x3c184c['userProfileId']},'raw':!![]})['then'](function(_0x402c0f){if(_0x402c0f&&_0x402c0f[_0xd80e('0x58')]===0x0){return db[_0xd80e('0x2f')]['create']({'name':_0x13270c['name'],'resourceId':_0x13270c['id'],'type':_0x402c0f[_0xd80e('0x32')],'sectionId':_0x402c0f['id']},{})[_0xd80e('0x2b')](function(){return _0x377e68;});}else{return _0x377e68;}})['catch'](function(_0x386918){logger[_0xd80e('0x59')](_0xd80e('0x5a'),_0x386918);throw _0x386918;});}return _0x377e68;})['then'](respondWithResult(_0x178c51,null))[_0xd80e('0x4b')](handleError(_0x178c51,null));};function Extension(_0x589c0b,_0x720eab,_0x392704,_0x3d8e46){this[_0xd80e('0x5b')]='from-sip';this[_0xd80e('0x5c')]=_0x589c0b;this['app']=_0x392704;this[_0xd80e('0x44')]='system';this[_0xd80e('0x5d')]=_0xd80e('0x5e');this[_0xd80e('0x5f')]=_0x720eab;this[_0xd80e('0x60')]=_0x3d8e46;}function createVoicePrefixExtensions(_0x53dd96,_0x1738ff,_0x280798){return new BPromise(function(_0x5d775f,_0x2ebfea){var _0x391e0c=new Extension(formatPrefixName(_0x53dd96[_0xd80e('0x61')]),0x1,_0xd80e('0x62'),'Voice\x20Prefix');_0x391e0c[_0xd80e('0x63')]=_0x53dd96['id'];return db[_0xd80e('0x54')]['create'](_0x391e0c,{'transaction':_0x280798})[_0xd80e('0x2b')](function(_0x22c680){var _0x136040=_0x22c680['get']({'plain':!![]});var _0x562ed7=_['map'](addVoicePrefixExtensions(_0x53dd96,_0x1738ff),function(_0x5f241c){_0x5f241c[_0xd80e('0x64')]=_0x136040['id'];_0x5f241c['VoicePrefixId']=_0x53dd96['id'];return _0x5f241c;});return db[_0xd80e('0x54')][_0xd80e('0x65')](_0x562ed7,{'transaction':_0x280798})[_0xd80e('0x2b')](function(_0x4e1b08){if(!_0x4e1b08){return _0x2ebfea(_0xd80e('0x66'));}else{return _0x5d775f(_0x4e1b08);}})[_0xd80e('0x4b')](function(_0x2b3ad6){return _0x2ebfea(_0x2b3ad6);});});;});};function addVoicePrefixExtensions(_0x1a351b,_0x43ab7b){var _0x2a34cd=[];var _0x385453=formatPrefixName(_0x1a351b[_0xd80e('0x61')]);_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x2,'Set','CDR(prefix)='+_0x1a351b[_0xd80e('0x32')]));if(_0x1a351b[_0xd80e('0x68')]){_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x3,_0xd80e('0x69'),'PREFIX-CALLERIDALL='+_0x1a351b[_0xd80e('0x68')]));}else{_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x3,_0xd80e('0x62'),_0xd80e('0x6a')));}_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x4,'goto',_0x43ab7b[_0xd80e('0x5b')]+','+_0xd80e('0x6b')+(0x8+_0x1a351b[_0xd80e('0x32')][_0xd80e('0x4d')])+'}'+','+0x1));return _0x2a34cd;}function formatPrefixName(_0x53971e){var _0x215f2d='_';for(var _0x29be62=0x0;_0x29be62<_0x53971e[_0xd80e('0x4d')];_0x29be62++){if(_0x53971e[_0xd80e('0x6c')](_0x29be62)=='-'){_0x215f2d+=_0x53971e[_0xd80e('0x6c')](_0x29be62);}else{_0x215f2d+='['+_0x53971e[_0xd80e('0x6c')](_0x29be62)+']';}}_0x215f2d+='.';return _0x215f2d;}exports['update']=function(_0x3e3176,_0x393fb6,_0x5243c7){var _0x44cf88=_0x3e3176[_0xd80e('0x53')];_0x44cf88[_0xd80e('0x61')]=_0xd80e('0x6d')+_0x44cf88['name']+'-';return db[_0xd80e('0x52')]['transaction'](function(_0x314fbb){return db[_0xd80e('0x36')][_0xd80e('0x2a')](_0x44cf88,{'where':{'id':_0x44cf88['id']},'transaction':_0x314fbb})[_0xd80e('0x2b')](function(){return db[_0xd80e('0x54')]['destroy']({'where':{'VoicePrefixId':_0x44cf88['id']},'transaction':_0x314fbb})[_0xd80e('0x2b')](function(){return db[_0xd80e('0x54')][_0xd80e('0x4e')]({'where':{'id':_0x44cf88[_0xd80e('0x64')]},'raw':!![]})['then'](function(_0x46c926){return createVoicePrefixExtensions(_0x44cf88,_0x46c926,_0x314fbb);});});});})[_0xd80e('0x2b')](function(){return db['VoicePrefix'][_0xd80e('0x6e')](_0x44cf88['id']);})[_0xd80e('0x2b')](respondWithResult(_0x393fb6,null))[_0xd80e('0x4b')](handleError(_0x393fb6,null));};exports[_0xd80e('0x6f')]=function(_0x3feb77,_0x8b2fc4,_0x4a0dea){return db['VoicePrefix'][_0xd80e('0x4e')]({'where':{'id':_0x3feb77['params']['id']}})['then'](handleEntityNotFound(_0x8b2fc4,null))[_0xd80e('0x2b')](function(_0x1c830c){if(_0x1c830c){return _0x1c830c[_0xd80e('0x6f')](_0x3feb77[_0xd80e('0x53')][_0xd80e('0x70')],_[_0xd80e('0x71')](_0x3feb77[_0xd80e('0x53')],[_0xd80e('0x70'),'id'])||{})['spread'](function(_0x2d80d1){for(var _0xc5455e=0x0;_0xc5455e<_0x3feb77[_0xd80e('0x53')][_0xd80e('0x70')]['length'];_0xc5455e+=0x1){socket[_0xd80e('0x72')](_0xd80e('0x73'),{'UserId':Number(_0x3feb77['body'][_0xd80e('0x70')][_0xc5455e]),'VoicePrefixId':Number(_0x3feb77[_0xd80e('0x4f')]['id'])});}return _0x2d80d1;});}})['then'](respondWithResult(_0x8b2fc4,null))[_0xd80e('0x4b')](handleError(_0x8b2fc4,null));};exports[_0xd80e('0x74')]=function(_0x472dd3,_0x3fb194,_0x18299b){return db[_0xd80e('0x36')][_0xd80e('0x4e')]({'where':{'id':_0x472dd3[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x3fb194,null))[_0xd80e('0x2b')](function(_0x5d8e7c){if(_0x5d8e7c){return _0x5d8e7c[_0xd80e('0x74')](_0x472dd3[_0xd80e('0x3a')]['ids'])[_0xd80e('0x2b')](function(){if(_[_0xd80e('0x75')](_0x472dd3[_0xd80e('0x3a')]['ids'])){for(var _0x2090f4=0x0;_0x2090f4<_0x472dd3['query'][_0xd80e('0x70')][_0xd80e('0x4d')];_0x2090f4+=0x1){socket[_0xd80e('0x72')](_0xd80e('0x76'),{'UserId':Number(_0x472dd3[_0xd80e('0x3a')]['ids'][_0x2090f4]),'VoicePrefixId':Number(_0x472dd3[_0xd80e('0x4f')]['id'])});}}else{socket[_0xd80e('0x72')](_0xd80e('0x76'),{'UserId':Number(_0x472dd3[_0xd80e('0x3a')][_0xd80e('0x70')]),'VoicePrefixId':Number(_0x472dd3[_0xd80e('0x4f')]['id'])});}});}})[_0xd80e('0x2b')](respondWithStatusCode(_0x3fb194,null))[_0xd80e('0x4b')](handleError(_0x3fb194,null));};exports[_0xd80e('0x77')]=function(_0x28b7dc,_0x30a3d0,_0x99f183){var _0x31fd22={};var _0x1873d2={};var _0x5ddd1f;var _0x30ba45;return db['VoicePrefix']['findOne']({'where':{'id':_0x28b7dc['params']['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x30a3d0,null))[_0xd80e('0x2b')](function(_0x2d8f13){if(_0x2d8f13){_0x5ddd1f=_0x2d8f13;_0x1873d2[_0xd80e('0x39')]=_['keys'](db[_0xd80e('0x78')][_0xd80e('0x37')]);_0x1873d2[_0xd80e('0x3a')]=_['keys'](_0x28b7dc['query']);_0x1873d2[_0xd80e('0x3c')]=_['intersection'](_0x1873d2[_0xd80e('0x39')],_0x1873d2[_0xd80e('0x3a')]);_0x31fd22[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x1873d2[_0xd80e('0x39')],qs[_0xd80e('0x3f')](_0x28b7dc[_0xd80e('0x3a')]['fields']));_0x31fd22['attributes']=_0x31fd22['attributes'][_0xd80e('0x4d')]?_0x31fd22[_0xd80e('0x3e')]:_0x1873d2[_0xd80e('0x39')];_0x31fd22[_0xd80e('0x41')]=qs[_0xd80e('0x42')](_0x28b7dc[_0xd80e('0x3a')][_0xd80e('0x42')]);_0x31fd22[_0xd80e('0x43')]=qs[_0xd80e('0x3c')](_[_0xd80e('0x79')](_0x28b7dc[_0xd80e('0x3a')],_0x1873d2[_0xd80e('0x3c')]));if(_0x28b7dc[_0xd80e('0x3a')]['filter']){_0x31fd22[_0xd80e('0x43')]=_[_0xd80e('0x46')](_0x31fd22[_0xd80e('0x43')],{'$or':_[_0xd80e('0x35')](_0x31fd22[_0xd80e('0x3e')],function(_0x14ed09){var _0x34fcb2={};_0x34fcb2[_0x14ed09]={'$like':'%'+_0x28b7dc[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x34fcb2;})});}_0x31fd22=_[_0xd80e('0x46')]({},_0x31fd22,_0x28b7dc['options']);return _0x5ddd1f[_0xd80e('0x77')](_0x31fd22);}})[_0xd80e('0x2b')](function(_0x3e36e4){if(_0x3e36e4){_0x30ba45=_0x3e36e4[_0xd80e('0x4d')];if(!_0x28b7dc['query']['hasOwnProperty']('nolimit')){_0x31fd22[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x28b7dc['query'][_0xd80e('0x25')]);_0x31fd22[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x28b7dc['query'][_0xd80e('0x22')]);}return _0x5ddd1f['getAgents'](_0x31fd22);}})[_0xd80e('0x2b')](function(_0x247ebc){if(_0x247ebc){return _0x247ebc?{'count':_0x30ba45,'rows':_0x247ebc}:null;}})['then'](respondWithResult(_0x30a3d0,null))[_0xd80e('0x4b')](handleError(_0x30a3d0,null));};exports[_0xd80e('0x7a')]=function(_0x273551,_0x3d0f54,_0x511baa){var _0x366559={};var _0x494718={};var _0x120907;var _0x39721f;return db[_0xd80e('0x36')][_0xd80e('0x7b')]({'where':{'id':_0x273551[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x3d0f54,null))[_0xd80e('0x2b')](function(_0x23514b){if(_0x23514b){_0x120907=_0x23514b;_0x494718[_0xd80e('0x39')]=_[_0xd80e('0x3b')](db[_0xd80e('0x7c')]['rawAttributes']);_0x494718['query']=_['keys'](_0x273551[_0xd80e('0x3a')]);_0x494718[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x494718[_0xd80e('0x39')],_0x494718[_0xd80e('0x3a')]);_0x366559[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x494718[_0xd80e('0x39')],qs['fields'](_0x273551[_0xd80e('0x3a')]['fields']));_0x366559[_0xd80e('0x3e')]=_0x366559[_0xd80e('0x3e')][_0xd80e('0x4d')]?_0x366559['attributes']:_0x494718[_0xd80e('0x39')];_0x366559['order']=qs[_0xd80e('0x42')](_0x273551['query'][_0xd80e('0x42')]);_0x366559[_0xd80e('0x43')]=qs['filters'](_['pick'](_0x273551[_0xd80e('0x3a')],_0x494718[_0xd80e('0x3c')]));if(_0x273551[_0xd80e('0x3a')][_0xd80e('0x45')]){_0x366559[_0xd80e('0x43')]=_[_0xd80e('0x46')](_0x366559[_0xd80e('0x43')],{'$or':_['map'](_0x366559[_0xd80e('0x3e')],function(_0x5c8d28){var _0x33afc6={};_0x33afc6[_0x5c8d28]={'$like':'%'+_0x273551[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x33afc6;})});}_0x366559=_[_0xd80e('0x46')]({},_0x366559,_0x273551[_0xd80e('0x47')]);return _0x120907['getTeams'](_0x366559);}})['then'](function(_0x42e910){if(_0x42e910){_0x39721f=_0x42e910[_0xd80e('0x4d')];if(!_0x273551[_0xd80e('0x3a')][_0xd80e('0x40')](_0xd80e('0x7d'))){_0x366559[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x273551[_0xd80e('0x3a')][_0xd80e('0x25')]);_0x366559[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x273551[_0xd80e('0x3a')][_0xd80e('0x22')]);}return _0x120907['getTeams'](_0x366559);}})[_0xd80e('0x2b')](function(_0x54eaad){if(_0x54eaad){return _0x54eaad?{'count':_0x39721f,'rows':_0x54eaad}:null;}})[_0xd80e('0x2b')](respondWithResult(_0x3d0f54,null))[_0xd80e('0x4b')](handleError(_0x3d0f54,null));};exports[_0xd80e('0x7e')]=function(_0x3e60bf,_0x47184c,_0x53fbbd){var _0x5c108f=_0x3e60bf[_0xd80e('0x53')][_0xd80e('0x70')];var _0x4f010e;return db[_0xd80e('0x7c')][_0xd80e('0x7f')]({'where':{'id':_0x5c108f},'attributes':['id'],'include':[{'model':db[_0xd80e('0x78')],'as':_0xd80e('0x80'),'attributes':['id','name',_0xd80e('0x81'),_0xd80e('0x82'),_0xd80e('0x83')],'raw':!![]}]})[_0xd80e('0x2b')](function(_0x16737b){if(_0x16737b){_0x4f010e=_0x16737b;var _0xac3eff=_[_0xd80e('0x84')](_0x16737b,function(_0x3be383){var _0x50b24d=_0x3be383['get']({'plain':!![]});return _0x50b24d[_0xd80e('0x80')];});return db[_0xd80e('0x36')][_0xd80e('0x4e')]({'where':{'id':_0x3e60bf[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](function(_0x2c80ed){return db[_0xd80e('0x52')][_0xd80e('0x85')](function(_0x83a318){return _0x2c80ed[_0xd80e('0x7e')](_0x5c108f,{'transaction':_0x83a318})[_0xd80e('0x2b')](function(){return BPromise[_0xd80e('0x86')](_0x4f010e,function(_0x33e712){return db[_0xd80e('0x87')]['upsert']({'TeamId':_0x33e712['id'],'VoicePrefixId':_0x3e60bf[_0xd80e('0x4f')]['id']},{'transaction':_0x83a318});});})[_0xd80e('0x2b')](function(){return BPromise['each'](_0xac3eff,function(_0x2f90b3){return db[_0xd80e('0x88')]['findOrCreate']({'where':{'UserId':_0x2f90b3['id'],'VoicePrefixId':_0x3e60bf[_0xd80e('0x4f')]['id']},'transaction':_0x83a318});});})['then'](function(){_0xac3eff[_0xd80e('0x89')](function(_0x25455c){socket[_0xd80e('0x72')]('userVoicePrefix:save',{'UserId':_0x25455c['id'],'VoicePrefixId':_0x2c80ed['id']});});});});});}})[_0xd80e('0x2b')](respondWithStatusCode(_0x47184c,null))[_0xd80e('0x4b')](handleError(_0x47184c,null));};exports[_0xd80e('0x8a')]=function(_0x35bc9a,_0x598a2e,_0x1ba292){return db[_0xd80e('0x7c')][_0xd80e('0x7f')]({'where':{'id':_0x35bc9a[_0xd80e('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd80e('0x78')],'as':_0xd80e('0x80'),'attributes':['id'],'raw':!![]}]})[_0xd80e('0x2b')](handleEntityNotFound(_0x598a2e,null))[_0xd80e('0x2b')](function(_0x3a6e2d){var _0x4ba15d=_[_0xd80e('0x35')](_0x3a6e2d,'id');var _0x2635e9=[];var _0x21baed=[];var _0x570b33=squel['select']();_0x570b33[_0xd80e('0x8b')](_0xd80e('0x8c'))[_0xd80e('0x8d')](_0xd80e('0x8e'),'tq')[_0xd80e('0x8f')](_0xd80e('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd80e('0x43')](_0xd80e('0x91'),_0x35bc9a[_0xd80e('0x4f')]['id']);for(var _0x24c913=0x0;_0x24c913<_0x3a6e2d[_0xd80e('0x4d')];_0x24c913+=0x1){let _0x302063=_0x3a6e2d[_0x24c913];for(var _0x5a477c=0x0;_0x5a477c<_0x302063[_0xd80e('0x80')][_0xd80e('0x4d')];_0x5a477c+=0x1){let _0x54cbd5=_0x302063['Agents'][_0x5a477c];var _0x33d344=_0x570b33[_0xd80e('0x92')]();_0x33d344[_0xd80e('0x43')](_0xd80e('0x93'),_0x54cbd5['id']);_0x21baed[_0xd80e('0x67')](db[_0xd80e('0x52')][_0xd80e('0x3a')](_0x33d344[_0xd80e('0x94')](),{'type':db[_0xd80e('0x52')]['QueryTypes']['SELECT']})[_0xd80e('0x2b')](function(_0x1387b7){if(_0x1387b7[_0xd80e('0x4d')]===0x1){return _0x54cbd5['id'];}else{var _0xc8b46=_['every'](_[_0xd80e('0x35')](_0x1387b7,_0xd80e('0x95')),function(_0x13590b){return _[_0xd80e('0x96')](_0x4ba15d,_0x13590b);});if(_0xc8b46){return _0x54cbd5['id'];}}}));}}return BPromise['all'](_0x21baed)['then'](function(_0x527b34){_0x2635e9=_(_0x2635e9)[_0xd80e('0x97')](_0x527b34)[_0xd80e('0x98')]()[_0xd80e('0x99')]();return db['VoicePrefix'][_0xd80e('0x4e')]({'where':{'id':_0x35bc9a[_0xd80e('0x4f')]['id']}})['then'](function(_0x5b72de){return db[_0xd80e('0x52')][_0xd80e('0x85')](function(_0x2a46e7){return _0x5b72de[_0xd80e('0x8a')](_0x35bc9a['query'][_0xd80e('0x70')],{'transaction':_0x2a46e7})[_0xd80e('0x2b')](function(){if(!_[_0xd80e('0x9a')](_0x2635e9)){return _0x5b72de[_0xd80e('0x74')](_0x2635e9,{'transaction':_0x2a46e7});}})[_0xd80e('0x2b')](function(){_0x2635e9[_0xd80e('0x89')](function(_0x45a047){socket[_0xd80e('0x72')]('userVoicePrefix:remove',{'UserId':_0x45a047,'VoicePrefixId':_0x5b72de['id']});});});});});});})[_0xd80e('0x2b')](respondWithStatusCode(_0x598a2e,null))[_0xd80e('0x4b')](handleError(_0x598a2e,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 18002c8..649801a 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 _0x43a3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x257124,_0x8a2b30){var _0x356d0e=function(_0x173b3a){while(--_0x173b3a){_0x257124['push'](_0x257124['shift']());}};_0x356d0e(++_0x8a2b30);}(_0x43a3,0x92));var _0x343a=function(_0x40d531,_0x18a633){_0x40d531=_0x40d531-0x0;var _0x4cc4c6=_0x43a3[_0x40d531];return _0x4cc4c6;};'use strict';var EventEmitter=require(_0x343a('0x0'));var VoicePrefix=require(_0x343a('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x343a('0x2')](0x0);var events={'afterCreate':_0x343a('0x3'),'afterUpdate':_0x343a('0x4'),'afterDestroy':_0x343a('0x5')};function emitEvent(_0x18f3c8){return function(_0x43da5e,_0x1f61e2,_0x55b8e0){VoicePrefixEvents[_0x343a('0x6')](_0x18f3c8+':'+_0x43da5e['id'],_0x43da5e);VoicePrefixEvents[_0x343a('0x6')](_0x18f3c8,_0x43da5e);_0x55b8e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x343a('0x7')](e,emitEvent(event));}}module[_0x343a('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x6778=['hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x37839c,_0x8a0491){var _0x30ba0d=function(_0x27d8b8){while(--_0x27d8b8){_0x37839c['push'](_0x37839c['shift']());}};_0x30ba0d(++_0x8a0491);}(_0x6778,0x17b));var _0x8677=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x6778[_0x333714];return _0x4c211e;};'use strict';var EventEmitter=require(_0x8677('0x0'));var VoicePrefix=require(_0x8677('0x1'))['db'][_0x8677('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8677('0x3')](0x0);var events={'afterCreate':_0x8677('0x4'),'afterUpdate':_0x8677('0x5'),'afterDestroy':_0x8677('0x6')};function emitEvent(_0x236376){return function(_0xf45556,_0x27210f,_0x49d9a4){VoicePrefixEvents[_0x8677('0x7')](_0x236376+':'+_0xf45556['id'],_0xf45556);VoicePrefixEvents[_0x8677('0x7')](_0x236376,_0xf45556);_0x49d9a4(null);};}for(var e in events){if(events[_0x8677('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 82b8470..397a829 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 _0xec67=['path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','request-promise'];(function(_0x187e94,_0x305b7b){var _0x49fe00=function(_0x247714){while(--_0x247714){_0x187e94['push'](_0x187e94['shift']());}};_0x49fe00(++_0x305b7b);}(_0xec67,0x16f));var _0x7ec6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xec67[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x7ec6('0x0'));var util=require(_0x7ec6('0x1'));var logger=require(_0x7ec6('0x2'))(_0x7ec6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7ec6('0x4'));var fs=require('fs');var path=require(_0x7ec6('0x5'));var rimraf=require(_0x7ec6('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ec6('0x7'));module[_0x7ec6('0x8')]=function(_0x5d74de,_0x37fd65){return _0x5d74de[_0x7ec6('0x9')](_0x7ec6('0xa'),attributes,{'tableName':_0x7ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f4b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','util','../../config/logger','api'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x5f4b,0x1ad));var _0xb5f4=function(_0x22e784,_0x15d0e4){_0x22e784=_0x22e784-0x0;var _0x3259c6=_0x5f4b[_0x22e784];return _0x3259c6;};'use strict';var _=require('lodash');var util=require(_0xb5f4('0x0'));var logger=require(_0xb5f4('0x1'))(_0xb5f4('0x2'));var moment=require(_0xb5f4('0x3'));var BPromise=require(_0xb5f4('0x4'));var rp=require(_0xb5f4('0x5'));var fs=require('fs');var path=require(_0xb5f4('0x6'));var rimraf=require(_0xb5f4('0x7'));var config=require(_0xb5f4('0x8'));var attributes=require(_0xb5f4('0x9'));module['exports']=function(_0x53dca6,_0x56409d){return _0x53dca6[_0xb5f4('0xa')]('VoicePrefix',attributes,{'tableName':_0xb5f4('0xb'),'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 e2b9549..ee8725b 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 _0x8411=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x109d11,_0x3f27a3){var _0x2d6e0b=function(_0x2f179d){while(--_0x2f179d){_0x109d11['push'](_0x109d11['shift']());}};_0x2d6e0b(++_0x3f27a3);}(_0x8411,0x118));var _0x1841=function(_0x380181,_0x4d9123){_0x380181=_0x380181-0x0;var _0x3f673f=_0x8411[_0x380181];return _0x3f673f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1841('0x0'));var BPromise=require(_0x1841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1841('0x2'))['db'];var utils=require(_0x1841('0x3'));var logger=require(_0x1841('0x4'))(_0x1841('0x5'));var config=require(_0x1841('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1841('0x7')]['http']({'port':0x232a});config[_0x1841('0x8')]=_[_0x1841('0x9')](config[_0x1841('0x8')],{'host':_0x1841('0xa'),'port':0x18eb});var socket=require(_0x1841('0xb'))(new Redis(config[_0x1841('0x8')]));require(_0x1841('0xc'))[_0x1841('0xd')](socket);function respondWithRpcPromise(_0x1d967f,_0x4218ae,_0x108644){return new BPromise(function(_0x1ae8b8,_0x1a3293){return client[_0x1841('0xe')](_0x1d967f,_0x108644)[_0x1841('0xf')](function(_0xf4b1b2){logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));logger['debug'](_0x1841('0x13'),_0x4218ae,_0x1841('0x12'),JSON[_0x1841('0x14')](_0xf4b1b2));if(_0xf4b1b2['error']){if(_0xf4b1b2['error'][_0x1841('0x15')]===0x1f4){logger[_0x1841('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x4218ae,_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);return _0x1a3293(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0xf4b1b2['error'][_0x1841('0x17')]);return _0x1ae8b8(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}else{logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));_0x1ae8b8(_0xf4b1b2[_0x1841('0x18')][_0x1841('0x17')]);}})[_0x1841('0x19')](function(_0x41c7ef){logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0x41c7ef);_0x1a3293(_0x41c7ef);});});} \ No newline at end of file +var _0x36fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x48dc01,_0x19f120){var _0x2a462c=function(_0x4b45d8){while(--_0x4b45d8){_0x48dc01['push'](_0x48dc01['shift']());}};_0x2a462c(++_0x19f120);}(_0x36fe,0x127));var _0xe36f=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x36fe[_0x22ee0f];return _0x204696;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});config[_0xe36f('0xc')]=_[_0xe36f('0xd')](config['redis'],{'host':_0xe36f('0xe'),'port':0x18eb});var socket=require(_0xe36f('0xf'))(new Redis(config['redis']));require(_0xe36f('0x10'))[_0xe36f('0x11')](socket);function respondWithRpcPromise(_0xa26c3d,_0x44bc2f,_0x3d036f){return new BPromise(function(_0x5b23ff,_0x212ff9){return client['request'](_0xa26c3d,_0x3d036f)[_0xe36f('0x12')](function(_0x2b1c1c){logger[_0xe36f('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'));logger[_0xe36f('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'),JSON[_0xe36f('0x16')](_0x2b1c1c));if(_0x2b1c1c[_0xe36f('0x17')]){if(_0x2b1c1c[_0xe36f('0x17')]['code']===0x1f4){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')]['message']);return _0x212ff9(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}logger['error'](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);return _0x5b23ff(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}else{logger[_0xe36f('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x44bc2f,'request\x20sent');_0x5b23ff(_0x2b1c1c['result']['message']);}})[_0xe36f('0x1a')](function(_0x2d6409){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2d6409);_0x212ff9(_0x2d6409);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 5101691..8de67df 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 _0x2621=['register','length','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x5db7fa,_0x3dcdf2){var _0x29d4ef=function(_0x5ad767){while(--_0x5ad767){_0x5db7fa['push'](_0x5db7fa['shift']());}};_0x29d4ef(++_0x3dcdf2);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var VoicePrefixEvents=require(_0x1262('0x0'));var events=[_0x1262('0x1'),_0x1262('0x2'),_0x1262('0x3')];function createListener(_0x1e5b47,_0x44878a){return function(_0x2dfe65){_0x44878a[_0x1262('0x4')](_0x1e5b47,_0x2dfe65);};}function removeListener(_0x192339,_0x3a6d7f){return function(){VoicePrefixEvents[_0x1262('0x5')](_0x192339,_0x3a6d7f);};}exports[_0x1262('0x6')]=function(_0x421716){for(var _0x16075c=0x0,_0x4d4535=events[_0x1262('0x7')];_0x16075c<_0x4d4535;_0x16075c++){var _0x52af34=events[_0x16075c];var _0xaa3c86=createListener('voicePrefix:'+_0x52af34,_0x421716);VoicePrefixEvents['on'](_0x52af34,_0xaa3c86);}}; \ No newline at end of file +var _0x9e0d=['save','remove','update','emit','removeListener','length','voicePrefix:','./voicePrefix.events'];(function(_0x5382cf,_0x1c38f0){var _0x8796a8=function(_0x4242e2){while(--_0x4242e2){_0x5382cf['push'](_0x5382cf['shift']());}};_0x8796a8(++_0x1c38f0);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x30efde,_0x462068){_0x30efde=_0x30efde-0x0;var _0x5c9bc3=_0x9e0d[_0x30efde];return _0x5c9bc3;};'use strict';var VoicePrefixEvents=require(_0xd9e0('0x0'));var events=[_0xd9e0('0x1'),_0xd9e0('0x2'),_0xd9e0('0x3')];function createListener(_0x5195f8,_0x2c5792){return function(_0x3ec198){_0x2c5792[_0xd9e0('0x4')](_0x5195f8,_0x3ec198);};}function removeListener(_0x1c83df,_0x296774){return function(){VoicePrefixEvents[_0xd9e0('0x5')](_0x1c83df,_0x296774);};}exports['register']=function(_0x570a07){for(var _0x22e726=0x0,_0x28ce1e=events[_0xd9e0('0x6')];_0x22e726<_0x28ce1e;_0x22e726++){var _0x3f8bb2=events[_0x22e726];var _0x256df0=createListener(_0xd9e0('0x7')+_0x3f8bb2,_0x570a07);VoicePrefixEvents['on'](_0x3f8bb2,_0x256df0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 5b58f4a..066871d 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(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d20e,_0x217c31){_0x56d20e=_0x56d20e-0x0;var _0x18b27a=_0xb10b[_0x56d20e];return _0x18b27a;};'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(_0x53fc4f,_0x1e6127){var _0x3c177f=function(_0x59bbdc){while(--_0x59bbdc){_0x53fc4f['push'](_0x53fc4f['shift']());}};_0x3c177f(++_0x1e6127);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 056785f..5c83189 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 _0x4f3a=['rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','TEXT','join','split','joinempty','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','preview','power','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4f3a,0x98));var _0xa4f3=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x4f3a[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require(_0xa4f3('0x0'));module['exports']={'name':{'type':Sequelize[_0xa4f3('0x1')],'allowNull':![],'unique':_0xa4f3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x4'),_0xa4f3('0x5')),'allowNull':![],'defaultValue':_0xa4f3('0x4')},'musiconhold':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':_0xa4f3('0x6')},'announce':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa4f3('0x7'),_0xa4f3('0x8'),'fewestcalls',_0xa4f3('0x9'),_0xa4f3('0xa'),_0xa4f3('0xb'),'wrandom',_0xa4f3('0xc')),'allowNull':![],'defaultValue':_0xa4f3('0x7'),'set':function(_0x187112){this[_0xa4f3('0xd')](_0xa4f3('0xe'),_0x187112?_0x187112:_0xa4f3('0xa'));},'get':function(){var _0xfdfd6f=this[_0xa4f3('0xf')]('type');var _0x246e8a=this[_0xa4f3('0xf')](_0xa4f3('0x10'));var _0x251016=this[_0xa4f3('0xf')](_0xa4f3('0xe'));if(_0xfdfd6f===_0xa4f3('0x4')){return _0x251016;}if(_0x246e8a===_0xa4f3('0x11')&&_0x251016===_0xa4f3('0xa')||_0x246e8a==='booked'&&_0x251016===_0xa4f3('0x12')){return _0x251016;}if(_0x246e8a===_0xa4f3('0x13')||_0x246e8a===_0xa4f3('0x14')||_0x246e8a==='power'){return _0x251016;}return null;}},'servicelevel':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa4f3('0x15')](0xb)},'timeout':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa4f3('0x1')]},'weight':{'type':Sequelize[_0xa4f3('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa4f3('0x16'),'no'),'defaultValue':_0xa4f3('0x16')},'autopause':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no',_0xa4f3('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa4f3('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xa4f3('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa4f3('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa4f3('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa4f3('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':_0xa4f3('0x16')},'announce_holdtime':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xa4f3('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa4f3('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa4f3('0x1')]},'queue_youarenext':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa4f3('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa4f3('0x1')]},'queue_quantity1':{'type':Sequelize[_0xa4f3('0x1')]},'queue_quantity2':{'type':Sequelize[_0xa4f3('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xa4f3('0x1')]},'queue_less_than':{'type':Sequelize[_0xa4f3('0x1')]},'periodic_announce':{'type':Sequelize[_0xa4f3('0x18')],'set':function(_0x37aeb4){this[_0xa4f3('0xd')]('periodic_announce',_0x37aeb4?_0x37aeb4[_0xa4f3('0x19')](','):[]);},'get':function(){return this[_0xa4f3('0xf')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0xa4f3('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':_0xa4f3('0x16'),'set':function(_0x2bd05){this['setDataValue'](_0xa4f3('0x1b'),_0x2bd05?_0x2bd05[_0xa4f3('0x19')](','):undefined);},'get':function(){return this[_0xa4f3('0xf')]('joinempty')?this[_0xa4f3('0xf')](_0xa4f3('0x1b'))[_0xa4f3('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x189977){this[_0xa4f3('0xd')](_0xa4f3('0x1c'),_0x189977?_0x189977['join'](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xa4f3('0xf')](_0xa4f3('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa4f3('0x1')]},'acw':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':0x0,'set':function(_0x5c720e){this['setDataValue'](_0xa4f3('0x1e'),_0x5c720e);if(_0x5c720e){if(this[_0xa4f3('0xf')]('wrapuptime')<0x2){this[_0xa4f3('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa4f3('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':0x0,'comment':_0xa4f3('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0xa4f3('0x20'),_0xa4f3('0x13'),_0xa4f3('0x21'),'predictive',_0xa4f3('0x11')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xa4f3('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa4f3('0x23')},'dialLimitQueue':{'type':Sequelize[_0xa4f3('0x15')](0x4)[_0xa4f3('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xa4f3('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa4f3('0x24')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xa4f3('0x25'),_0xa4f3('0x26')),'defaultValue':_0xa4f3('0x26'),'comment':_0xa4f3('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa4f3('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa4f3('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa4f3('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa4f3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa4f3('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':_0xa4f3('0x2c'),'comment':_0xa4f3('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xa4f3('0x1')],'comment':_0xa4f3('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa4f3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa4f3('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)[_0xa4f3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa4f3('0x35')},'dialTimezone':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xa4f3('0x36')},'dialPrefix':{'type':Sequelize[_0xa4f3('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa4f3('0x3')](_0xa4f3('0x37'),_0xa4f3('0x38'),_0xa4f3('0x39')),'defaultValue':_0xa4f3('0x37')},'dialAMDActive':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':0x0,'comment':_0xa4f3('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa4f3('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa4f3('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4f3('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa4f3('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa4f3('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa4f3('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa4f3('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa4f3('0x15')](0x5)[_0xa4f3('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa4f3('0x15')](0x9)[_0xa4f3('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4f3('0x40')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa4f3('0x41')},'dialRecallInQueue':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':0x0,'comment':_0xa4f3('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa4f3('0x3')]('DESC',_0xa4f3('0x43')),'defaultValue':_0xa4f3('0x44')},'dialQueueProject2':{'type':Sequelize[_0xa4f3('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4f3('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4f3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)[_0xa4f3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)[_0xa4f3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa4f3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4f3('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa4f3('0x15')](0x5)[_0xa4f3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4f3('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa4f3('0x15')],'allowNull':!![],'comment':_0xa4f3('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':![],'comment':_0xa4f3('0x50'),'set':function(_0x34335d){if(!_0x34335d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa4f3('0xd')]('mandatoryDisposition',_0x34335d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa4f3('0x15')](0x3)[_0xa4f3('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xa4f3('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa4f3('0x1d')],'defaultValue':!![]}}; \ No newline at end of file +var _0xedf7=['DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\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'];(function(_0x2bd20f,_0x4d6277){var _0x613789=function(_0x3ef730){while(--_0x3ef730){_0x2bd20f['push'](_0x2bd20f['shift']());}};_0x613789(++_0x4d6277);}(_0xedf7,0x66));var _0x7edf=function(_0x22b0a8,_0x4ef757){_0x22b0a8=_0x22b0a8-0x0;var _0x3c5bbc=_0xedf7[_0x22b0a8];return _0x3c5bbc;};'use strict';var Sequelize=require(_0x7edf('0x0'));module[_0x7edf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7edf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x7edf('0x4')},'musiconhold':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':_0x7edf('0x6')},'announce':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x7edf('0x3')]('rr',_0x7edf('0x7'),_0x7edf('0x8'),_0x7edf('0x9'),_0x7edf('0xa'),_0x7edf('0xb'),_0x7edf('0xc'),_0x7edf('0xd'),_0x7edf('0xe')),'allowNull':![],'defaultValue':_0x7edf('0x7'),'set':function(_0x5e5694){this[_0x7edf('0xf')](_0x7edf('0x10'),_0x5e5694?_0x5e5694:'rrmemory');},'get':function(){var _0x27a0df=this[_0x7edf('0x11')]('type');var _0xa3a1af=this[_0x7edf('0x11')](_0x7edf('0x12'));var _0x599993=this[_0x7edf('0x11')]('strategy');if(_0x27a0df===_0x7edf('0x4')){return _0x599993;}if(_0xa3a1af===_0x7edf('0x13')&&_0x599993===_0x7edf('0xb')||_0xa3a1af==='booked'&&_0x599993===_0x7edf('0x14')){return _0x599993;}if(_0xa3a1af===_0x7edf('0x15')||_0xa3a1af===_0x7edf('0x16')||_0xa3a1af===_0x7edf('0x17')){return _0x599993;}return null;}},'servicelevel':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7edf('0x18')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x7edf('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x7edf('0x19'),'no',_0x7edf('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7edf('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x7edf('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7edf('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x7edf('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x7edf('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x7edf('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x7edf('0x19'),'no'),'defaultValue':_0x7edf('0x19')},'announce_holdtime':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no',_0x7edf('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x7edf('0x18')](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[_0x7edf('0x5')]},'queue_youarenext':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7edf('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7edf('0x5')]},'queue_quantity1':{'type':Sequelize[_0x7edf('0x5')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x7edf('0x5')]},'queue_less_than':{'type':Sequelize[_0x7edf('0x5')]},'periodic_announce':{'type':Sequelize[_0x7edf('0x1c')],'set':function(_0x477185){this[_0x7edf('0xf')](_0x7edf('0x1d'),_0x477185?_0x477185[_0x7edf('0x1e')](','):[]);},'get':function(){return this[_0x7edf('0x11')](_0x7edf('0x1d'))?this[_0x7edf('0x11')](_0x7edf('0x1d'))[_0x7edf('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':_0x7edf('0x19'),'set':function(_0x27896d){this['setDataValue']('joinempty',_0x27896d?_0x27896d['join'](','):undefined);},'get':function(){return this[_0x7edf('0x11')](_0x7edf('0x20'))?this[_0x7edf('0x11')](_0x7edf('0x20'))[_0x7edf('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':'no','set':function(_0x3cfa15){this[_0x7edf('0xf')](_0x7edf('0x21'),_0x3cfa15?_0x3cfa15['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x7edf('0x21'))?this[_0x7edf('0x11')]('leavewhenempty')[_0x7edf('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x7edf('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7edf('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7edf('0x5')]},'acw':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':0x0,'set':function(_0x397374){this[_0x7edf('0xf')](_0x7edf('0x23'),_0x397374);if(_0x397374){if(this[_0x7edf('0x11')](_0x7edf('0x24'))<0x2){this['setDataValue'](_0x7edf('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7edf('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':0x0,'comment':_0x7edf('0x25')},'dialMethod':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x26'),'progressive',_0x7edf('0x17'),'predictive',_0x7edf('0x13')),'defaultValue':'progressive','comment':_0x7edf('0x27')},'dialLimitChannel':{'type':Sequelize[_0x7edf('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7edf('0x28')},'dialLimitQueue':{'type':Sequelize[_0x7edf('0x18')](0x4)[_0x7edf('0x29')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x7edf('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x7edf('0x2b'),'dropRate'),'defaultValue':_0x7edf('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7edf('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x7edf('0x29')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7edf('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x7edf('0x18')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':'tTxX','comment':_0x7edf('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x2f')},'dialQueueProject':{'type':Sequelize[_0x7edf('0x5')],'comment':_0x7edf('0x30')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'comment':_0x7edf('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x36')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':_0x7edf('0x37')},'dialPrefix':{'type':Sequelize[_0x7edf('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7edf('0x3')](_0x7edf('0x38'),_0x7edf('0x39'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':0x0,'comment':_0x7edf('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7edf('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7edf('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7edf('0x29')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7edf('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7edf('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7edf('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7edf('0x29')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7edf('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7edf('0x18')](0x9)[_0x7edf('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7edf('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x7edf('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7edf('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':0x0,'comment':_0x7edf('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x7edf('0x44'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x7edf('0x5')],'comment':_0x7edf('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7edf('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7edf('0x45')},'dialCutDigit':{'type':Sequelize[_0x7edf('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7edf('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x48')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7edf('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x4c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7edf('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7edf('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7edf('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7edf('0x18')],'allowNull':!![],'comment':_0x7edf('0x51')},'mandatoryDisposition':{'type':Sequelize[_0x7edf('0x22')],'defaultValue':![],'comment':_0x7edf('0x52'),'set':function(_0x1b3c76){if(!_0x1b3c76)this['setDataValue'](_0x7edf('0x53'),null);this[_0x7edf('0xf')](_0x7edf('0x54'),_0x1b3c76);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7edf('0x18')](0x3)[_0x7edf('0x29')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'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 d7cbe90..33364ff 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 _0x7e87=['hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','VoiceQueue','rawAttributes','intersection','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','QueueCampaigns','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','order','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','interface','emit','userVoiceQueue:save','removeTeams','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','transaction','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','isEmpty','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','phone','scheduledAt','ContactId','ListId','toString','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','fromQuery','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','map','value','includes','type','find','UserProfileResource','end','name','send','index','fieldName','key','query','keys','filters','model','attributes','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e87,0x134));var _0x77e8=function(_0x456e82,_0x366443){_0x456e82=_0x456e82-0x0;var _0x140551=_0x7e87[_0x456e82];return _0x140551;};'use strict';var emlformat=require(_0x77e8('0x0'));var rimraf=require(_0x77e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77e8('0x2'));var rp=require(_0x77e8('0x3'));var moment=require('moment');var BPromise=require(_0x77e8('0x4'));var Mustache=require(_0x77e8('0x5'));var util=require(_0x77e8('0x6'));var path=require(_0x77e8('0x7'));var sox=require(_0x77e8('0x8'));var csv=require(_0x77e8('0x9'));var ejs=require(_0x77e8('0xa'));var fs=require('fs');var fs_extra=require(_0x77e8('0xb'));var _=require(_0x77e8('0xc'));var squel=require(_0x77e8('0xd'));var crypto=require('crypto');var jsforce=require(_0x77e8('0xe'));var deskjs=require(_0x77e8('0xf'));var toCsv=require(_0x77e8('0x9'));var querystring=require(_0x77e8('0x10'));var Papa=require(_0x77e8('0x11'));var Redis=require('ioredis');var authService=require(_0x77e8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x77e8('0x13'));var hardwareService=require(_0x77e8('0x14'));var logger=require(_0x77e8('0x15'))('api');var utils=require(_0x77e8('0x16'));var config=require(_0x77e8('0x17'));var licenseUtil=require(_0x77e8('0x18'));var db=require(_0x77e8('0x19'))['db'];config[_0x77e8('0x1a')]=_[_0x77e8('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x77e8('0x1c'))(new Redis(config[_0x77e8('0x1a')]));require(_0x77e8('0x1d'))['register'](socket);function respondWithStatusCode(_0x32a999,_0x534b22){_0x534b22=_0x534b22||0xcc;return function(_0x4b9bb7){if(_0x4b9bb7){return _0x32a999[_0x77e8('0x1e')](_0x534b22);}return _0x32a999[_0x77e8('0x1f')](_0x534b22)['end']();};}function respondWithResult(_0x535d6f,_0x14cfa6){_0x14cfa6=_0x14cfa6||0xc8;return function(_0x50d7a1){if(_0x50d7a1){return _0x535d6f[_0x77e8('0x1f')](_0x14cfa6)[_0x77e8('0x20')](_0x50d7a1);}};}function respondWithFilteredResult(_0x38ae0f,_0x5d4073){return function(_0x38e740){if(_0x38e740){var _0xd2869e=typeof _0x5d4073[_0x77e8('0x21')]==='undefined'&&typeof _0x5d4073[_0x77e8('0x22')]===_0x77e8('0x23');var _0x3c9845=_0x38e740[_0x77e8('0x24')];var _0x41f045=_0xd2869e?0x0:_0x5d4073[_0x77e8('0x21')];var _0x64c98a=_0xd2869e?_0x38e740[_0x77e8('0x24')]:_0x5d4073[_0x77e8('0x21')]+_0x5d4073['limit'];var _0xccd8f0;if(_0x64c98a>=_0x3c9845){_0x64c98a=_0x3c9845;_0xccd8f0=0xc8;}else{_0xccd8f0=0xce;}_0x38ae0f['status'](_0xccd8f0);return _0x38ae0f[_0x77e8('0x25')](_0x77e8('0x26'),_0x41f045+'-'+_0x64c98a+'/'+_0x3c9845)['json'](_0x38e740);}return null;};}function patchUpdates(_0x565dfd){return function(_0xc518e4){try{jsonpatch['apply'](_0xc518e4,_0x565dfd,!![]);}catch(_0x1f450e){return BPromise[_0x77e8('0x27')](_0x1f450e);}return _0xc518e4[_0x77e8('0x28')]();};}function saveUpdates(_0x14d451,_0x2076d7){return function(_0x41ee2d){if(_0x41ee2d){return _0x41ee2d[_0x77e8('0x29')](_0x14d451)[_0x77e8('0x2a')](function(_0x13a46a){return _0x13a46a;});}return null;};}function removeEntity(_0x3425af,_0x15ebc5){return function(_0x1c0141){if(_0x1c0141){return _0x1c0141[_0x77e8('0x2b')]()['then'](function(){var _0x2947ca=_0x1c0141[_0x77e8('0x2c')]({'plain':!![]});var _0x5d5fcf=[{'name':_0x77e8('0x2d'),'value':_0x77e8('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0x77e8('0x2f'),'ignore':![]}];var _0x1ff078=_(_0x5d5fcf)[_0x77e8('0x30')]('ignore')[_0x77e8('0x31')](_0x77e8('0x32'))[_0x77e8('0x32')]();if(_[_0x77e8('0x33')](_0x1ff078,_0x2947ca[_0x77e8('0x34')])){return;}var _0x23af4d=_[_0x77e8('0x35')](_0x5d5fcf,[_0x77e8('0x32'),_0x2947ca[_0x77e8('0x34')]])['name'];return db[_0x77e8('0x36')][_0x77e8('0x2b')]({'where':{'type':_0x23af4d,'resourceId':_0x2947ca['id']}})[_0x77e8('0x2a')](function(){return _0x1c0141;});})[_0x77e8('0x2a')](function(){_0x3425af[_0x77e8('0x1f')](0xcc)[_0x77e8('0x37')]();});}};}function handleEntityNotFound(_0x3f8ab4,_0x5b8378){return function(_0xa1a5d2){if(!_0xa1a5d2){_0x3f8ab4[_0x77e8('0x1e')](0x194);}return _0xa1a5d2;};}function handleError(_0x25e525,_0x16b95c){_0x16b95c=_0x16b95c||0x1f4;return function(_0x3d647b){logger['error'](_0x3d647b['stack']);if(_0x3d647b[_0x77e8('0x38')]){delete _0x3d647b[_0x77e8('0x38')];}_0x25e525[_0x77e8('0x1f')](_0x16b95c)[_0x77e8('0x39')](_0x3d647b);};}exports[_0x77e8('0x3a')]=function(_0x3386b9,_0x4628cf){var _0x5e02d2={},_0x289a58={},_0x11be77={'count':0x0,'rows':[]};var _0x47d68d=_[_0x77e8('0x31')](db['VoiceQueue']['rawAttributes'],function(_0x32e849){return{'name':_0x32e849[_0x77e8('0x3b')],'type':_0x32e849[_0x77e8('0x34')][_0x77e8('0x3c')]};});_0x289a58['model']=_[_0x77e8('0x31')](_0x47d68d,_0x77e8('0x38'));_0x289a58[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x3386b9['query']);_0x289a58[_0x77e8('0x3f')]=_['intersection'](_0x289a58[_0x77e8('0x40')],_0x289a58[_0x77e8('0x3d')]);_0x5e02d2[_0x77e8('0x41')]=_['intersection'](_0x289a58[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x3386b9[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x5e02d2[_0x77e8('0x41')]=_0x5e02d2['attributes'][_0x77e8('0x43')]?_0x5e02d2[_0x77e8('0x41')]:_0x289a58[_0x77e8('0x40')];if(!_0x3386b9[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0x5e02d2[_0x77e8('0x22')]=qs['limit'](_0x3386b9[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x5e02d2[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x3386b9['query'][_0x77e8('0x21')]);}_0x5e02d2['order']=qs[_0x77e8('0x46')](_0x3386b9['query']['sort']);_0x5e02d2[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_[_0x77e8('0x48')](_0x3386b9['query'],_0x289a58['filters']),_0x47d68d);if(_0x3386b9['query'][_0x77e8('0x30')]){_0x5e02d2[_0x77e8('0x47')]=_[_0x77e8('0x49')](_0x5e02d2[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0x47d68d,function(_0x12cc8d){if(_0x12cc8d[_0x77e8('0x34')]!==_0x77e8('0x4a')){var _0x2469ea={};_0x2469ea[_0x12cc8d[_0x77e8('0x38')]]={'$like':'%'+_0x3386b9['query'][_0x77e8('0x30')]+'%'};return _0x2469ea;}})});}_0x5e02d2=_[_0x77e8('0x49')]({},_0x5e02d2,_0x3386b9['options']);var _0x2c0eff={'where':_0x5e02d2['where']};return db['VoiceQueue']['count'](_0x2c0eff)[_0x77e8('0x2a')](function(_0x2c5d9b){_0x11be77[_0x77e8('0x24')]=_0x2c5d9b;if(_0x3386b9[_0x77e8('0x3d')][_0x77e8('0x4b')]){_0x5e02d2['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x77e8('0x4c')](_0x5e02d2);})[_0x77e8('0x2a')](function(_0x44335c){_0x11be77[_0x77e8('0x4d')]=_0x44335c;return _0x11be77;})['then'](respondWithFilteredResult(_0x4628cf,_0x5e02d2))[_0x77e8('0x4e')](handleError(_0x4628cf,null));};exports[_0x77e8('0x4f')]=function(_0x1681e9,_0xf2bf7b){var _0x57bf23={'raw':![],'where':{'id':_0x1681e9[_0x77e8('0x50')]['id']}},_0x46a5d1={};_0x46a5d1[_0x77e8('0x40')]=_[_0x77e8('0x3e')](db[_0x77e8('0x51')][_0x77e8('0x52')]);_0x46a5d1[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x1681e9['query']);_0x46a5d1[_0x77e8('0x3f')]=_[_0x77e8('0x53')](_0x46a5d1['model'],_0x46a5d1[_0x77e8('0x3d')]);_0x57bf23[_0x77e8('0x41')]=_[_0x77e8('0x53')](_0x46a5d1[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x1681e9['query'][_0x77e8('0x42')]));_0x57bf23[_0x77e8('0x41')]=_0x57bf23[_0x77e8('0x41')][_0x77e8('0x43')]?_0x57bf23[_0x77e8('0x41')]:_0x46a5d1[_0x77e8('0x40')];if(_0x1681e9['query'][_0x77e8('0x4b')]){_0x57bf23[_0x77e8('0x54')]=[{'all':!![]}];}_0x57bf23=_[_0x77e8('0x49')]({},_0x57bf23,_0x1681e9[_0x77e8('0x55')]);return db['VoiceQueue'][_0x77e8('0x35')](_0x57bf23)[_0x77e8('0x2a')](handleEntityNotFound(_0xf2bf7b,null))['then'](respondWithResult(_0xf2bf7b,null))[_0x77e8('0x4e')](handleError(_0xf2bf7b,null));};exports[_0x77e8('0x56')]=function(_0x2353cf,_0x315207){return db[_0x77e8('0x51')][_0x77e8('0x56')](_0x2353cf[_0x77e8('0x57')],{})[_0x77e8('0x2a')](function(_0x1398d4){var _0x1a3a1b=_0x2353cf[_0x77e8('0x58')][_0x77e8('0x2c')]({'plain':!![]});if(!_0x1a3a1b)throw new Error(_0x77e8('0x59'));if(_0x1a3a1b[_0x77e8('0x5a')]===_0x77e8('0x58')){var _0x3f74f2=_0x1398d4[_0x77e8('0x2c')]({'plain':!![]});var _0x2e3df0=[{'name':_0x77e8('0x2d'),'value':_0x77e8('0x2e')},{'name':'QueueCampaigns','value':'outbound'}];var _0x4536ce=_['find'](_0x2e3df0,[_0x77e8('0x32'),_0x3f74f2['type']])[_0x77e8('0x38')];return db[_0x77e8('0x5b')][_0x77e8('0x35')]({'where':{'name':_0x4536ce,'userProfileId':_0x1a3a1b[_0x77e8('0x5c')]},'raw':!![]})[_0x77e8('0x2a')](function(_0x4df8f1){if(_0x4df8f1&&_0x4df8f1[_0x77e8('0x5d')]===0x0){return db[_0x77e8('0x36')][_0x77e8('0x56')]({'name':_0x3f74f2['name'],'resourceId':_0x3f74f2['id'],'type':_0x4df8f1[_0x77e8('0x38')],'sectionId':_0x4df8f1['id']},{})[_0x77e8('0x2a')](function(){return _0x1398d4;});}else{return _0x1398d4;}})[_0x77e8('0x4e')](function(_0x4ccc5b){logger[_0x77e8('0x5e')](_0x77e8('0x5f'),_0x4ccc5b);throw _0x4ccc5b;});}return _0x1398d4;})[_0x77e8('0x2a')](respondWithResult(_0x315207,0xc9))[_0x77e8('0x4e')](handleError(_0x315207,null));};exports['clone']=function(_0x36b9e5,_0x1b0047){var _0xbadde7={'where':{'id':_0x36b9e5[_0x77e8('0x50')]['id']}},_0x3a97e2={};_0x3a97e2['model']=_[_0x77e8('0x3e')](db[_0x77e8('0x51')][_0x77e8('0x52')]);_0xbadde7[_0x77e8('0x41')]=_['intersection'](_0x3a97e2[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x36b9e5[_0x77e8('0x3d')][_0x77e8('0x42')]));_0xbadde7['attributes']=_0xbadde7[_0x77e8('0x41')]['length']?_0xbadde7['attributes']:_0x3a97e2[_0x77e8('0x40')];if(_0x36b9e5[_0x77e8('0x3d')]['includeAll']){_0xbadde7['include']=[{'all':!![]}];}_0xbadde7=_[_0x77e8('0x49')]({},_0xbadde7,_0x36b9e5[_0x77e8('0x55')]);return db[_0x77e8('0x51')][_0x77e8('0x35')](_0xbadde7)[_0x77e8('0x2a')](handleEntityNotFound(_0x1b0047,null))[_0x77e8('0x2a')](function(_0x5e97b7){if(_0x5e97b7){var _0x1c61fd=_0x5e97b7[_0x77e8('0x2c')]({'plain':!![]});_0x1c61fd=qs['omit'](_0x1c61fd,['id',_0x77e8('0x60'),_0x77e8('0x61')]);_0x36b9e5[_0x77e8('0x57')]=_[_0x77e8('0x62')](_0x36b9e5[_0x77e8('0x57')],['id',_0x77e8('0x60'),_0x77e8('0x61')]);return db[_0x77e8('0x51')][_0x77e8('0x56')](_['merge'](_0x1c61fd,_0x36b9e5[_0x77e8('0x57')]),{'include':_0x36b9e5[_0x77e8('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0x77e8('0x2a')](function(_0x3783ae){var _0x355f24=_0x36b9e5[_0x77e8('0x58')][_0x77e8('0x2c')]({'plain':!![]});if(!_0x355f24)throw new Error(_0x77e8('0x59'));if(_0x355f24['role']===_0x77e8('0x58')){var _0x553fed=_0x3783ae[_0x77e8('0x2c')]({'plain':!![]});var _0x997731=[{'name':_0x77e8('0x2d'),'value':_0x77e8('0x2e')},{'name':_0x77e8('0x63'),'value':_0x77e8('0x2f')}];var _0x4fb90b=_['find'](_0x997731,[_0x77e8('0x32'),_0x553fed[_0x77e8('0x34')]])[_0x77e8('0x38')];return db[_0x77e8('0x5b')][_0x77e8('0x35')]({'where':{'name':_0x4fb90b,'userProfileId':_0x355f24['userProfileId']},'raw':!![]})[_0x77e8('0x2a')](function(_0x55f7db){if(_0x55f7db&&_0x55f7db[_0x77e8('0x5d')]===0x0){return db[_0x77e8('0x36')]['create']({'name':_0x553fed[_0x77e8('0x38')],'resourceId':_0x553fed['id'],'type':_0x55f7db[_0x77e8('0x38')],'sectionId':_0x55f7db['id']},{})[_0x77e8('0x2a')](function(){return _0x3783ae;});}else{return _0x3783ae;}})[_0x77e8('0x4e')](function(_0xe1b0cd){logger['error'](_0x77e8('0x5f'),_0xe1b0cd);throw _0xe1b0cd;});}return _0x3783ae;});}})[_0x77e8('0x2a')](respondWithResult(_0x1b0047,0xc9))['catch'](handleError(_0x1b0047,null));};exports[_0x77e8('0x29')]=function(_0x401527,_0x39a242){if(_0x401527[_0x77e8('0x57')]['id']){delete _0x401527[_0x77e8('0x57')]['id'];}return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x401527[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x39a242,null))['then'](saveUpdates(_0x401527[_0x77e8('0x57')],null))['then'](respondWithResult(_0x39a242,null))['catch'](handleError(_0x39a242,null));};exports[_0x77e8('0x2b')]=function(_0x5b385b,_0x4acb84){return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x5b385b[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x4acb84,null))[_0x77e8('0x2a')](removeEntity(_0x4acb84,null))[_0x77e8('0x4e')](handleError(_0x4acb84,null));};exports[_0x77e8('0x64')]=function(_0x5b81d4,_0x15752f,_0x4252f9){var _0x320858={'raw':![],'where':{}};var _0x3dcea9={};var _0x537528={'count':0x0,'rows':[]};return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x5b81d4['params']['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x15752f,null))[_0x77e8('0x2a')](function(_0x26bd8d){if(_0x26bd8d){_0x3dcea9['model']=_[_0x77e8('0x3e')](db[_0x77e8('0x66')][_0x77e8('0x52')]);_0x3dcea9['query']=_['keys'](_0x5b81d4[_0x77e8('0x3d')]);_0x3dcea9[_0x77e8('0x3f')]=_[_0x77e8('0x53')](_0x3dcea9[_0x77e8('0x40')],_0x3dcea9[_0x77e8('0x3d')]);_0x320858[_0x77e8('0x41')]=_[_0x77e8('0x53')](_0x3dcea9['model'],qs[_0x77e8('0x42')](_0x5b81d4[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x320858[_0x77e8('0x41')]=_0x320858[_0x77e8('0x41')][_0x77e8('0x43')]?_0x320858[_0x77e8('0x41')]:_0x3dcea9['model'];if(!_0x5b81d4[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0x320858['limit']=qs[_0x77e8('0x22')](_0x5b81d4[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x320858[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x5b81d4[_0x77e8('0x3d')][_0x77e8('0x21')]);}_0x320858['order']=qs[_0x77e8('0x46')](_0x5b81d4[_0x77e8('0x3d')]['sort']);_0x320858[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_['pick'](_0x5b81d4[_0x77e8('0x3d')],_0x3dcea9[_0x77e8('0x3f')]));_0x320858['where']['VoiceQueueId']=_0x26bd8d['id'];if(_0x5b81d4[_0x77e8('0x3d')]['filter']){_0x320858['where']=_['merge'](_0x320858[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0x320858[_0x77e8('0x41')],function(_0x5ce5cf){var _0x449041={};_0x449041[_0x5ce5cf]={'$like':'%'+_0x5b81d4[_0x77e8('0x3d')]['filter']+'%'};return _0x449041;})});}_0x320858=_['merge']({},_0x320858,_0x5b81d4[_0x77e8('0x55')]);return db[_0x77e8('0x66')]['count']({'where':_0x320858[_0x77e8('0x47')]})['then'](function(_0x1f9ee3){_0x537528['count']=_0x1f9ee3;if(_0x5b81d4['query'][_0x77e8('0x4b')]){_0x320858[_0x77e8('0x54')]=[{'all':!![]}];}return db[_0x77e8('0x66')][_0x77e8('0x4c')](_0x320858);})[_0x77e8('0x2a')](function(_0x15b531){_0x537528[_0x77e8('0x4d')]=_0x15b531;return _0x537528;});}})[_0x77e8('0x2a')](respondWithFilteredResult(_0x15752f,_0x320858))[_0x77e8('0x4e')](handleError(_0x15752f,null));};exports[_0x77e8('0x67')]=function(_0x40f69e,_0x3b126d,_0x3fe2c5){var _0x350b69={'raw':!![],'where':{}};var _0x354507={};var _0x3b189e={'count':0x0,'rows':[]};return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x40f69e['params']['id']}})['then'](handleEntityNotFound(_0x3b126d,null))[_0x77e8('0x2a')](function(_0x1230ab){if(_0x1230ab){_0x354507['model']=_[_0x77e8('0x3e')](db[_0x77e8('0x68')][_0x77e8('0x52')]);_0x354507[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x40f69e[_0x77e8('0x3d')]);_0x354507[_0x77e8('0x3f')]=_[_0x77e8('0x53')](_0x354507[_0x77e8('0x40')],_0x354507['query']);_0x350b69['attributes']=_['intersection'](_0x354507[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x40f69e['query'][_0x77e8('0x42')]));_0x350b69[_0x77e8('0x41')]=_0x350b69['attributes'][_0x77e8('0x43')]?_0x350b69[_0x77e8('0x41')]:_0x354507[_0x77e8('0x40')];if(!_0x40f69e[_0x77e8('0x3d')]['hasOwnProperty'](_0x77e8('0x45'))){_0x350b69['limit']=qs[_0x77e8('0x22')](_0x40f69e[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x350b69[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x40f69e[_0x77e8('0x3d')][_0x77e8('0x21')]);}_0x350b69[_0x77e8('0x69')]=qs[_0x77e8('0x46')](_0x40f69e['query'][_0x77e8('0x46')]);_0x350b69[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_['pick'](_0x40f69e[_0x77e8('0x3d')],_0x354507[_0x77e8('0x3f')]));_0x350b69['where'][_0x77e8('0x6a')]=_0x1230ab['id'];if(_0x40f69e['query'][_0x77e8('0x30')]){_0x350b69['where']=_[_0x77e8('0x49')](_0x350b69['where'],{'$or':_[_0x77e8('0x31')](_0x350b69[_0x77e8('0x41')],function(_0x397c34){var _0x19fdea={};_0x19fdea[_0x397c34]={'$like':'%'+_0x40f69e[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x19fdea;})});}_0x350b69=_[_0x77e8('0x49')]({},_0x350b69,_0x40f69e[_0x77e8('0x55')]);return db['CmHopperHistory'][_0x77e8('0x24')]({'where':_0x350b69[_0x77e8('0x47')]})[_0x77e8('0x2a')](function(_0x163d5a){_0x3b189e[_0x77e8('0x24')]=_0x163d5a;if(_0x40f69e[_0x77e8('0x3d')][_0x77e8('0x4b')]){_0x350b69[_0x77e8('0x54')]=[{'all':!![]}];}return db[_0x77e8('0x68')][_0x77e8('0x4c')](_0x350b69);})[_0x77e8('0x2a')](function(_0x6356f4){_0x3b189e['rows']=_0x6356f4;return _0x3b189e;});}})[_0x77e8('0x2a')](respondWithFilteredResult(_0x3b126d,_0x350b69))[_0x77e8('0x4e')](handleError(_0x3b126d,null));};exports[_0x77e8('0x6b')]=function(_0x5eb77c,_0x15306e,_0x246b7c){var _0x4f8e58={'raw':!![],'where':{}};var _0xfb439f={};var _0x2789f2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x77e8('0x65')]({'where':{'id':_0x5eb77c[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x15306e,null))[_0x77e8('0x2a')](function(_0x3daab){if(_0x3daab){_0xfb439f[_0x77e8('0x40')]=_['keys'](db['CmHopperFinal'][_0x77e8('0x52')]);_0xfb439f[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x5eb77c[_0x77e8('0x3d')]);_0xfb439f[_0x77e8('0x3f')]=_[_0x77e8('0x53')](_0xfb439f['model'],_0xfb439f[_0x77e8('0x3d')]);_0x4f8e58[_0x77e8('0x41')]=_['intersection'](_0xfb439f[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x5eb77c[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x4f8e58['attributes']=_0x4f8e58[_0x77e8('0x41')][_0x77e8('0x43')]?_0x4f8e58[_0x77e8('0x41')]:_0xfb439f['model'];if(!_0x5eb77c[_0x77e8('0x3d')][_0x77e8('0x44')]('nolimit')){_0x4f8e58[_0x77e8('0x22')]=qs[_0x77e8('0x22')](_0x5eb77c[_0x77e8('0x3d')]['limit']);_0x4f8e58[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x5eb77c[_0x77e8('0x3d')]['offset']);}_0x4f8e58[_0x77e8('0x69')]=qs[_0x77e8('0x46')](_0x5eb77c[_0x77e8('0x3d')][_0x77e8('0x46')]);_0x4f8e58[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_['pick'](_0x5eb77c['query'],_0xfb439f[_0x77e8('0x3f')]));_0x4f8e58[_0x77e8('0x47')][_0x77e8('0x6a')]=_0x3daab['id'];if(_0x5eb77c['query'][_0x77e8('0x30')]){_0x4f8e58['where']=_['merge'](_0x4f8e58[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0x4f8e58['attributes'],function(_0x130694){var _0x2cf831={};_0x2cf831[_0x130694]={'$like':'%'+_0x5eb77c[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x2cf831;})});}_0x4f8e58=_[_0x77e8('0x49')]({},_0x4f8e58,_0x5eb77c[_0x77e8('0x55')]);return db[_0x77e8('0x6c')][_0x77e8('0x24')]({'where':_0x4f8e58[_0x77e8('0x47')]})[_0x77e8('0x2a')](function(_0x4ac87f){_0x2789f2[_0x77e8('0x24')]=_0x4ac87f;if(_0x5eb77c[_0x77e8('0x3d')][_0x77e8('0x4b')]){_0x4f8e58[_0x77e8('0x54')]=[{'all':!![]}];}return db[_0x77e8('0x6c')]['findAll'](_0x4f8e58);})[_0x77e8('0x2a')](function(_0x42851e){_0x2789f2[_0x77e8('0x4d')]=_0x42851e;return _0x2789f2;});}})['then'](respondWithFilteredResult(_0x15306e,_0x4f8e58))[_0x77e8('0x4e')](handleError(_0x15306e,null));};exports[_0x77e8('0x6d')]=function(_0x58c41c,_0x31ffcb,_0x132829){var _0xb0ea44={'raw':!![],'where':{}};var _0x182bc1={};var _0x1ebb00={'count':0x0,'rows':[]};return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x58c41c[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x31ffcb,null))[_0x77e8('0x2a')](function(_0x347a71){if(_0x347a71){_0x182bc1[_0x77e8('0x40')]=_[_0x77e8('0x3e')](db[_0x77e8('0x6e')][_0x77e8('0x52')]);_0x182bc1[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x58c41c[_0x77e8('0x3d')]);_0x182bc1[_0x77e8('0x3f')]=_['intersection'](_0x182bc1[_0x77e8('0x40')],_0x182bc1[_0x77e8('0x3d')]);_0xb0ea44[_0x77e8('0x41')]=_[_0x77e8('0x53')](_0x182bc1[_0x77e8('0x40')],qs['fields'](_0x58c41c[_0x77e8('0x3d')][_0x77e8('0x42')]));_0xb0ea44['attributes']=_0xb0ea44[_0x77e8('0x41')][_0x77e8('0x43')]?_0xb0ea44[_0x77e8('0x41')]:_0x182bc1[_0x77e8('0x40')];if(!_0x58c41c[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0xb0ea44[_0x77e8('0x22')]=qs[_0x77e8('0x22')](_0x58c41c[_0x77e8('0x3d')][_0x77e8('0x22')]);_0xb0ea44[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x58c41c['query']['offset']);}_0xb0ea44['order']=qs['sort'](_0x58c41c['query'][_0x77e8('0x46')]);_0xb0ea44[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_[_0x77e8('0x48')](_0x58c41c[_0x77e8('0x3d')],_0x182bc1[_0x77e8('0x3f')]));_0xb0ea44[_0x77e8('0x47')][_0x77e8('0x6a')]=_0x347a71['id'];if(_0x58c41c[_0x77e8('0x3d')][_0x77e8('0x30')]){_0xb0ea44[_0x77e8('0x47')]=_['merge'](_0xb0ea44[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0xb0ea44[_0x77e8('0x41')],function(_0xb973f9){var _0x3eacda={};_0x3eacda[_0xb973f9]={'$like':'%'+_0x58c41c[_0x77e8('0x3d')]['filter']+'%'};return _0x3eacda;})});}_0xb0ea44=_[_0x77e8('0x49')]({},_0xb0ea44,_0x58c41c[_0x77e8('0x55')]);return db['CmHopperBlack'][_0x77e8('0x24')]({'where':_0xb0ea44[_0x77e8('0x47')]})[_0x77e8('0x2a')](function(_0x360fcb){_0x1ebb00[_0x77e8('0x24')]=_0x360fcb;if(_0x58c41c[_0x77e8('0x3d')][_0x77e8('0x4b')]){_0xb0ea44['include']=[{'all':!![]}];}return db[_0x77e8('0x6e')][_0x77e8('0x4c')](_0xb0ea44);})[_0x77e8('0x2a')](function(_0x2bb693){_0x1ebb00['rows']=_0x2bb693;return _0x1ebb00;});}})[_0x77e8('0x2a')](respondWithFilteredResult(_0x31ffcb,_0xb0ea44))[_0x77e8('0x4e')](handleError(_0x31ffcb,null));};exports['getTeams']=function(_0x45456b,_0x55d87d,_0xa65e38){var _0x334d1a={};var _0x46c8c3={};var _0x4696e4;var _0x1c45a8;return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x45456b[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x55d87d,null))[_0x77e8('0x2a')](function(_0x4ee19b){if(_0x4ee19b){_0x4696e4=_0x4ee19b;_0x46c8c3[_0x77e8('0x40')]=_[_0x77e8('0x3e')](db[_0x77e8('0x6f')]['rawAttributes']);_0x46c8c3[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x45456b[_0x77e8('0x3d')]);_0x46c8c3['filters']=_['intersection'](_0x46c8c3[_0x77e8('0x40')],_0x46c8c3['query']);_0x334d1a[_0x77e8('0x41')]=_['intersection'](_0x46c8c3[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x45456b[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x334d1a[_0x77e8('0x41')]=_0x334d1a[_0x77e8('0x41')][_0x77e8('0x43')]?_0x334d1a[_0x77e8('0x41')]:_0x46c8c3[_0x77e8('0x40')];_0x334d1a[_0x77e8('0x69')]=qs[_0x77e8('0x46')](_0x45456b[_0x77e8('0x3d')]['sort']);_0x334d1a[_0x77e8('0x47')]=qs[_0x77e8('0x3f')](_['pick'](_0x45456b[_0x77e8('0x3d')],_0x46c8c3[_0x77e8('0x3f')]));if(_0x45456b['query'][_0x77e8('0x30')]){_0x334d1a[_0x77e8('0x47')]=_[_0x77e8('0x49')](_0x334d1a[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0x334d1a['attributes'],function(_0x1a5be8){var _0x5a1340={};_0x5a1340[_0x1a5be8]={'$like':'%'+_0x45456b[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x5a1340;})});}_0x334d1a=_[_0x77e8('0x49')]({},_0x334d1a,_0x45456b[_0x77e8('0x55')]);return _0x4696e4[_0x77e8('0x70')](_0x334d1a);}})[_0x77e8('0x2a')](function(_0x5e9156){if(_0x5e9156){_0x1c45a8=_0x5e9156[_0x77e8('0x43')];if(!_0x45456b[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0x334d1a[_0x77e8('0x22')]=qs['limit'](_0x45456b[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x334d1a[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x45456b['query'][_0x77e8('0x21')]);}return _0x4696e4['getTeams'](_0x334d1a);}})[_0x77e8('0x2a')](function(_0x2e17f1){if(_0x2e17f1){return _0x2e17f1?{'count':_0x1c45a8,'rows':_0x2e17f1}:null;}})[_0x77e8('0x2a')](respondWithResult(_0x55d87d,null))[_0x77e8('0x4e')](handleError(_0x55d87d,null));};exports[_0x77e8('0x71')]=function(_0x20822f,_0x38cb9d,_0x42abdd){var _0x18fd87=_0x20822f[_0x77e8('0x57')]['teams'];var _0x5fa197=_[_0x77e8('0x31')](_0x18fd87,'id');return db[_0x77e8('0x6f')][_0x77e8('0x4c')]({'where':{'id':_0x5fa197},'attributes':['id'],'include':[{'model':db[_0x77e8('0x72')],'as':_0x77e8('0x73'),'attributes':['id',_0x77e8('0x38'),_0x77e8('0x74'),_0x77e8('0x75'),'interface'],'raw':!![]}]})[_0x77e8('0x2a')](function(_0x34c4b0){if(_0x34c4b0){var _0xbdbefe=_[_0x77e8('0x76')](_0x34c4b0,function(_0x532ff0){var _0x499250=_0x532ff0['get']({'plain':!![]});_0x499250['Agents'][_0x77e8('0x77')](function(_0x148c53){_0x148c53[_0x77e8('0x78')]=_[_0x77e8('0x35')](_0x18fd87,{'id':_0x499250['id']})[_0x77e8('0x78')];});return _0x499250[_0x77e8('0x73')];});return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x20822f['params']['id']}})[_0x77e8('0x2a')](function(_0x5b1178){return db[_0x77e8('0x79')]['transaction'](function(_0x397ca5){return _0x5b1178[_0x77e8('0x71')](_0x5fa197,{'transaction':_0x397ca5})['then'](function(){return BPromise[_0x77e8('0x7a')](_0x18fd87,function(_0xc80bd9){return db[_0x77e8('0x7b')][_0x77e8('0x7c')]({'TeamId':_0xc80bd9['id'],'VoiceQueueId':_0x20822f['params']['id'],'penalty':_0xc80bd9[_0x77e8('0x78')]},{'transaction':_0x397ca5});});})[_0x77e8('0x2a')](function(){return BPromise[_0x77e8('0x7a')](_0xbdbefe,function(_0x19da1e){return db[_0x77e8('0x7d')][_0x77e8('0x7e')]({'where':{'UserId':_0x19da1e['id'],'VoiceQueueId':_0x20822f[_0x77e8('0x50')]['id']},'defaults':{'penalty':_0x19da1e['penalty']},'transaction':_0x397ca5});});})['then'](function(){return BPromise[_0x77e8('0x7a')](_['filter'](_0xbdbefe,{'online':!![]}),function(_0x2b6beb){return db[_0x77e8('0x7f')][_0x77e8('0x7c')]({'membername':_0x2b6beb['name'],'UserId':_0x2b6beb['id'],'queue_name':_0x5b1178[_0x77e8('0x38')],'VoiceQueueId':_0x5b1178['id'],'interface':_[_0x77e8('0x80')](_0x2b6beb['interface'])?util[_0x77e8('0x81')](_0x77e8('0x82'),_0x2b6beb[_0x77e8('0x38')]):_0x2b6beb[_0x77e8('0x83')],'paused':_0x2b6beb[_0x77e8('0x75')]||![],'penalty':_0x2b6beb[_0x77e8('0x78')]},{'transaction':_0x397ca5});});})[_0x77e8('0x2a')](function(){_0xbdbefe[_0x77e8('0x77')](function(_0x2427f3){socket[_0x77e8('0x84')](_0x77e8('0x85'),{'UserId':_0x2427f3['id'],'VoiceQueueId':_0x5b1178['id']});});});});});}})['then'](respondWithStatusCode(_0x38cb9d,null))[_0x77e8('0x4e')](handleError(_0x38cb9d,null));};exports[_0x77e8('0x86')]=function(_0x546cce,_0x1a2407,_0x14d7d1){return db[_0x77e8('0x6f')][_0x77e8('0x4c')]({'where':{'id':_0x546cce[_0x77e8('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x77e8('0x72')],'as':_0x77e8('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1a2407,null))[_0x77e8('0x2a')](function(_0x201df4){var _0x1854c9=_[_0x77e8('0x31')](_0x201df4,'id');var _0x4f756c=[];var _0x4a9d5d=[];var _0xc4e36a=squel[_0x77e8('0x87')]();_0xc4e36a[_0x77e8('0x88')]('tq.TeamId')[_0x77e8('0x89')](_0x77e8('0x8a'),'tq')[_0x77e8('0x8b')](_0x77e8('0x8c'),'ut',_0x77e8('0x8d'))[_0x77e8('0x47')]('VoiceQueueId\x20=\x20?',_0x546cce[_0x77e8('0x50')]['id']);for(var _0x1c7d4f=0x0;_0x1c7d4f<_0x201df4['length'];_0x1c7d4f+=0x1){let _0x4e1111=_0x201df4[_0x1c7d4f];for(var _0x567807=0x0;_0x567807<_0x4e1111[_0x77e8('0x73')][_0x77e8('0x43')];_0x567807+=0x1){let _0x569374=_0x4e1111['Agents'][_0x567807];var _0x33a8c5=_0xc4e36a[_0x77e8('0x8e')]();_0x33a8c5[_0x77e8('0x47')](_0x77e8('0x8f'),_0x569374['id']);_0x4a9d5d[_0x77e8('0x90')](db[_0x77e8('0x79')][_0x77e8('0x3d')](_0x33a8c5['toString'](),{'type':db['sequelize'][_0x77e8('0x91')][_0x77e8('0x92')]})[_0x77e8('0x2a')](function(_0x3921ce){if(_0x3921ce[_0x77e8('0x43')]===0x1){return _0x569374['id'];}else{var _0x96b110=_[_0x77e8('0x93')](_[_0x77e8('0x31')](_0x3921ce,'TeamId'),function(_0x5e94ad){return _[_0x77e8('0x33')](_0x1854c9,_0x5e94ad);});if(_0x96b110){return _0x569374['id'];}}}));}}return BPromise[_0x77e8('0x94')](_0x4a9d5d)['then'](function(_0xcbb455){_0x4f756c=_(_0x4f756c)[_0x77e8('0x95')](_0xcbb455)[_0x77e8('0x96')]()[_0x77e8('0x32')]();return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x546cce[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](function(_0x355fa4){return db[_0x77e8('0x79')][_0x77e8('0x97')](function(_0x33d6c1){return _0x355fa4[_0x77e8('0x86')](_0x546cce[_0x77e8('0x3d')]['ids'],{'transaction':_0x33d6c1})[_0x77e8('0x2a')](function(){if(!_['isEmpty'](_0x4f756c)){return _0x355fa4[_0x77e8('0x98')](_0x4f756c,{'transaction':_0x33d6c1})['then'](function(){return db['UserVoiceQueueRt'][_0x77e8('0x2b')]({'where':{'VoiceQueueId':_0x546cce[_0x77e8('0x50')]['id'],'UserId':_0x4f756c},'transaction':_0x33d6c1});});}})[_0x77e8('0x2a')](function(){_0x4f756c[_0x77e8('0x77')](function(_0xa85779){socket[_0x77e8('0x84')](_0x77e8('0x99'),{'UserId':_0xa85779,'VoiceQueueId':_0x355fa4['id']});});});});});});})['then'](respondWithStatusCode(_0x1a2407,null))[_0x77e8('0x4e')](handleError(_0x1a2407,null));};exports[_0x77e8('0x9a')]=function(_0x3af1cd,_0x2ae2ab,_0x32e35e){var _0x4e3ab9,_0x56fb69;return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x3af1cd[_0x77e8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ae2ab,null))[_0x77e8('0x2a')](function(_0x1653e8){if(_0x1653e8){_0x56fb69=_0x1653e8;return _0x1653e8[_0x77e8('0x9a')](_0x3af1cd['body']['ids'],_['omit'](_0x3af1cd['body'],[_0x77e8('0x9b'),'id'])||{})[_0x77e8('0x9c')](function(_0x5b9283){for(var _0x5416ee=0x0;_0x5416ee<_0x3af1cd['body'][_0x77e8('0x9b')]['length'];_0x5416ee+=0x1){socket[_0x77e8('0x84')](_0x77e8('0x85'),{'UserId':Number(_0x3af1cd[_0x77e8('0x57')][_0x77e8('0x9b')][_0x5416ee]),'VoiceQueueId':Number(_0x3af1cd[_0x77e8('0x50')]['id'])});}return _0x5b9283;});}})[_0x77e8('0x2a')](function(_0x1f882d){_0x4e3ab9=_0x1f882d||[];if(_0x56fb69){return db['User'][_0x77e8('0x4c')]({'where':{'id':_0x3af1cd[_0x77e8('0x57')][_0x77e8('0x9b')]},'attributes':['id',_0x77e8('0x38'),_0x77e8('0x74'),_0x77e8('0x75'),'interface'],'raw':!![]});}})['then'](function(_0x2b7028){if(!_[_0x77e8('0x9d')](_0x2b7028)){var _0x53a632=[];for(var _0x58b87f=0x0;_0x58b87f<_0x2b7028[_0x77e8('0x43')];_0x58b87f++){if(_0x2b7028[_0x58b87f][_0x77e8('0x74')]){_0x53a632[_0x77e8('0x90')](db[_0x77e8('0x7f')]['upsert']({'membername':_0x2b7028[_0x58b87f][_0x77e8('0x38')],'UserId':_0x2b7028[_0x58b87f]['id'],'queue_name':_0x56fb69['name'],'VoiceQueueId':_0x56fb69['id'],'interface':_['isNil'](_0x2b7028[_0x58b87f][_0x77e8('0x83')])?util['format'](_0x77e8('0x82'),_0x2b7028[_0x58b87f][_0x77e8('0x38')]):_0x2b7028[_0x58b87f]['interface'],'paused':_0x2b7028[_0x58b87f]['voicePause']||![],'penalty':_0x3af1cd[_0x77e8('0x57')][_0x77e8('0x78')]||0x0}));}}return BPromise[_0x77e8('0x94')](_0x53a632);}})[_0x77e8('0x2a')](function(){return _0x4e3ab9;})[_0x77e8('0x2a')](respondWithResult(_0x2ae2ab,null))[_0x77e8('0x4e')](handleError(_0x2ae2ab,null));};exports['removeAgents']=function(_0x4de249,_0x3b97b3,_0x198ed0){return db[_0x77e8('0x51')]['find']({'where':{'id':_0x4de249['params']['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x3b97b3,null))[_0x77e8('0x2a')](function(_0x2ce207){if(_0x2ce207){return _0x2ce207[_0x77e8('0x98')](_0x4de249[_0x77e8('0x3d')]['ids'])[_0x77e8('0x2a')](function(){if(_['isArray'](_0x4de249[_0x77e8('0x3d')][_0x77e8('0x9b')])){for(var _0x1178e8=0x0;_0x1178e8<_0x4de249['query'][_0x77e8('0x9b')][_0x77e8('0x43')];_0x1178e8+=0x1){socket[_0x77e8('0x84')](_0x77e8('0x99'),{'UserId':Number(_0x4de249['query'][_0x77e8('0x9b')][_0x1178e8]),'VoiceQueueId':Number(_0x4de249[_0x77e8('0x50')]['id'])});}}else{socket[_0x77e8('0x84')](_0x77e8('0x99'),{'UserId':Number(_0x4de249[_0x77e8('0x3d')][_0x77e8('0x9b')]),'VoiceQueueId':Number(_0x4de249[_0x77e8('0x50')]['id'])});}});}})[_0x77e8('0x2a')](function(_0x27f301){return db['UserVoiceQueueRt'][_0x77e8('0x2b')]({'where':{'VoiceQueueId':_0x4de249[_0x77e8('0x50')]['id'],'UserId':_0x4de249[_0x77e8('0x3d')][_0x77e8('0x9b')]}})[_0x77e8('0x2a')](function(){return _0x27f301;});})['then'](respondWithStatusCode(_0x3b97b3,null))[_0x77e8('0x4e')](handleError(_0x3b97b3,null));};exports[_0x77e8('0x9e')]=function(_0x441e37,_0x3d7bf7,_0x458292){var _0xb9e0dd={};var _0x3459f5={};var _0x176d5d;var _0x2f79d3;return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x441e37[_0x77e8('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d7bf7,null))[_0x77e8('0x2a')](function(_0x5177c1){if(_0x5177c1){_0x176d5d=_0x5177c1;_0x3459f5['model']=_['keys'](db[_0x77e8('0x72')]['rawAttributes']);_0x3459f5[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0x441e37[_0x77e8('0x3d')]);_0x3459f5[_0x77e8('0x3f')]=_['intersection'](_0x3459f5[_0x77e8('0x40')],_0x3459f5['query']);_0xb9e0dd['attributes']=_[_0x77e8('0x53')](_0x3459f5[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x441e37['query'][_0x77e8('0x42')]));_0xb9e0dd[_0x77e8('0x41')]=_0xb9e0dd[_0x77e8('0x41')][_0x77e8('0x43')]?_0xb9e0dd[_0x77e8('0x41')]:_0x3459f5['model'];_0xb9e0dd['order']=qs[_0x77e8('0x46')](_0x441e37[_0x77e8('0x3d')][_0x77e8('0x46')]);_0xb9e0dd['where']=qs[_0x77e8('0x3f')](_[_0x77e8('0x48')](_0x441e37['query'],_0x3459f5[_0x77e8('0x3f')]));if(_0x441e37['query'][_0x77e8('0x30')]){_0xb9e0dd[_0x77e8('0x47')]=_[_0x77e8('0x49')](_0xb9e0dd[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0xb9e0dd['attributes'],function(_0x12826b){var _0x256a95={};_0x256a95[_0x12826b]={'$like':'%'+_0x441e37[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x256a95;})});}_0xb9e0dd=_[_0x77e8('0x49')]({},_0xb9e0dd,_0x441e37[_0x77e8('0x55')]);return _0x176d5d[_0x77e8('0x9e')](_0xb9e0dd);}})[_0x77e8('0x2a')](function(_0x441fb1){if(_0x441fb1){_0x2f79d3=_0x441fb1['length'];if(!_0x441e37[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0xb9e0dd['limit']=qs[_0x77e8('0x22')](_0x441e37['query'][_0x77e8('0x22')]);_0xb9e0dd[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x441e37[_0x77e8('0x3d')][_0x77e8('0x21')]);}return _0x176d5d[_0x77e8('0x9e')](_0xb9e0dd);}})[_0x77e8('0x2a')](function(_0xc13d8c){if(_0xc13d8c){return _0xc13d8c?{'count':_0x2f79d3,'rows':_0xc13d8c}:null;}})[_0x77e8('0x2a')](respondWithResult(_0x3d7bf7,null))[_0x77e8('0x4e')](handleError(_0x3d7bf7,null));};exports[_0x77e8('0x9f')]=function(_0xf64668,_0x2c7477,_0x4af525){var _0x166f9b={};var _0xb4d9c5={};var _0x88c62f;var _0x2d7306;return db[_0x77e8('0x51')]['findOne']({'where':{'id':_0xf64668[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x2c7477,null))['then'](function(_0x51b143){if(_0x51b143){_0x88c62f=_0x51b143;_0xb4d9c5['model']=_[_0x77e8('0x3e')](db[_0x77e8('0x7f')][_0x77e8('0x52')]);_0xb4d9c5[_0x77e8('0x3d')]=_[_0x77e8('0x3e')](_0xf64668['query']);_0xb4d9c5[_0x77e8('0x3f')]=_[_0x77e8('0x53')](_0xb4d9c5[_0x77e8('0x40')],_0xb4d9c5['query']);_0x166f9b['attributes']=_[_0x77e8('0x53')](_0xb4d9c5[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0xf64668[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x166f9b[_0x77e8('0x41')]=_0x166f9b[_0x77e8('0x41')][_0x77e8('0x43')]?_0x166f9b[_0x77e8('0x41')]:_0xb4d9c5[_0x77e8('0x40')];_0x166f9b[_0x77e8('0x69')]=qs['sort'](_0xf64668[_0x77e8('0x3d')]['sort']);_0x166f9b[_0x77e8('0x47')]=qs['filters'](_[_0x77e8('0x48')](_0xf64668[_0x77e8('0x3d')],_0xb4d9c5[_0x77e8('0x3f')]));if(_0xf64668['query'][_0x77e8('0x30')]){_0x166f9b[_0x77e8('0x47')]=_['merge'](_0x166f9b['where'],{'$or':_[_0x77e8('0x31')](_0x166f9b['attributes'],function(_0x5ecb80){var _0x490464={};_0x490464[_0x5ecb80]={'$like':'%'+_0xf64668[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x490464;})});}_0x166f9b=_[_0x77e8('0x49')]({},_0x166f9b,_0xf64668[_0x77e8('0x55')]);return _0x88c62f[_0x77e8('0x9f')](_0x166f9b);}})[_0x77e8('0x2a')](function(_0xc6b711){if(_0xc6b711){_0x2d7306=_0xc6b711['length'];if(!_0xf64668[_0x77e8('0x3d')][_0x77e8('0x44')](_0x77e8('0x45'))){_0x166f9b[_0x77e8('0x22')]=qs[_0x77e8('0x22')](_0xf64668[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x166f9b[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0xf64668['query'][_0x77e8('0x21')]);}return _0x88c62f[_0x77e8('0x9f')](_0x166f9b);}})[_0x77e8('0x2a')](function(_0x3507dd){return _0x3507dd?{'count':_0x2d7306,'rows':_0x3507dd}:null;})['then'](respondWithResult(_0x2c7477,null))[_0x77e8('0x4e')](handleError(_0x2c7477,null));};exports[_0x77e8('0xa0')]=function(_0x3b33de,_0x3501a4,_0x56530b){var _0x1a4981={};var _0x3f923d={};var _0x59da0b;var _0x4c2292;return db[_0x77e8('0x51')]['findOne']({'where':{'id':_0x3b33de['params']['id']}})['then'](handleEntityNotFound(_0x3501a4,null))[_0x77e8('0x2a')](function(_0x2312fd){if(_0x2312fd){_0x59da0b=_0x2312fd;_0x3f923d['model']=_['keys'](db[_0x77e8('0xa1')][_0x77e8('0x52')]);_0x3f923d['query']=_[_0x77e8('0x3e')](_0x3b33de[_0x77e8('0x3d')]);_0x3f923d[_0x77e8('0x3f')]=_['intersection'](_0x3f923d[_0x77e8('0x40')],_0x3f923d[_0x77e8('0x3d')]);_0x1a4981[_0x77e8('0x41')]=_['intersection'](_0x3f923d[_0x77e8('0x40')],qs['fields'](_0x3b33de['query'][_0x77e8('0x42')]));_0x1a4981[_0x77e8('0x41')]=_0x1a4981['attributes'][_0x77e8('0x43')]?_0x1a4981[_0x77e8('0x41')]:_0x3f923d[_0x77e8('0x40')];_0x1a4981[_0x77e8('0x69')]=qs[_0x77e8('0x46')](_0x3b33de[_0x77e8('0x3d')][_0x77e8('0x46')]);_0x1a4981['where']=qs[_0x77e8('0x3f')](_[_0x77e8('0x48')](_0x3b33de['query'],_0x3f923d[_0x77e8('0x3f')]));if(_0x3b33de[_0x77e8('0x3d')][_0x77e8('0x30')]){_0x1a4981[_0x77e8('0x47')]=_[_0x77e8('0x49')](_0x1a4981['where'],{'$or':_['map'](_0x1a4981[_0x77e8('0x41')],function(_0x3f1f77){var _0x2aff93={};_0x2aff93[_0x3f1f77]={'$like':'%'+_0x3b33de[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x2aff93;})});}_0x1a4981=_[_0x77e8('0x49')]({},_0x1a4981,_0x3b33de[_0x77e8('0x55')]);return _0x59da0b[_0x77e8('0xa0')](_0x1a4981);}})[_0x77e8('0x2a')](function(_0x4c3088){if(_0x4c3088){_0x4c2292=_0x4c3088['length'];if(!_0x3b33de[_0x77e8('0x3d')]['hasOwnProperty']('nolimit')){_0x1a4981['limit']=qs['limit'](_0x3b33de[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x1a4981[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x3b33de[_0x77e8('0x3d')][_0x77e8('0x21')]);}return _0x59da0b['getLists'](_0x1a4981);}})[_0x77e8('0x2a')](function(_0x3081dc){if(_0x3081dc){return _0x3081dc?{'count':_0x4c2292,'rows':_0x3081dc}:null;}})[_0x77e8('0x2a')](respondWithResult(_0x3501a4,null))[_0x77e8('0x4e')](handleError(_0x3501a4,null));};exports[_0x77e8('0xa2')]=function(_0x23b889,_0x1b93f0,_0x1a1f57){var _0xa0b520,_0x522465;return db['VoiceQueue']['find']({'where':{'id':_0x23b889[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x1b93f0,null))[_0x77e8('0x2a')](function(_0x21fc19){if(_0x21fc19){_0x522465=_0x21fc19;return _0x21fc19[_0x77e8('0xa2')](_0x23b889['body'][_0x77e8('0x9b')],_['omit'](_0x23b889[_0x77e8('0x57')],[_0x77e8('0x9b'),'id'])||{});}return null;})[_0x77e8('0x9c')](function(_0x3658b7){var _0x5a6a0d;_0xa0b520=_0x3658b7||[];var _0x506159=[];if(_0x3658b7){for(var _0x8d29f9=0x0;_0x8d29f9<_0x3658b7[_0x77e8('0x43')];_0x8d29f9+=0x1){var _0x274622=_0x3658b7[_0x8d29f9][_0x77e8('0x2c')]({'plain':!![]});_0x522465['dialCheckDuplicateType']=_0x23b889['body'][_0x77e8('0xa3')]?_0x23b889[_0x77e8('0x57')][_0x77e8('0xa3')]:_0x522465[_0x77e8('0xa3')];switch(_0x522465[_0x77e8('0xa3')]){case _0x77e8('0xa4'):_0x5a6a0d=squel['insert']()[_0x77e8('0xa5')]('cm_hopper')['fromQuery']([_0x77e8('0xa6'),_0x77e8('0xa7'),_0x77e8('0xa8'),_0x77e8('0xa9'),_0x77e8('0x6a'),_0x77e8('0x60'),'updatedAt'],squel['select']()[_0x77e8('0x88')]('phone',_0x77e8('0xa6'))[_0x77e8('0x88')]('NOW()',_0x77e8('0xa7'))[_0x77e8('0x88')]('id','ContactId')[_0x77e8('0x88')](_0x274622['CmListId']['toString'](),_0x77e8('0xa9'))['field'](_0x23b889[_0x77e8('0x50')]['id'][_0x77e8('0xaa')](),'VoiceQueueId')[_0x77e8('0x88')]('NOW()',_0x77e8('0x60'))[_0x77e8('0x88')]('NOW()',_0x77e8('0x61'))[_0x77e8('0x89')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x77e8('0x47')](_0x77e8('0xab'),_0x274622['CmListId']['toString']())[_0x77e8('0x47')](_0x77e8('0xac'))[_0x77e8('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x77e8('0x87')]()[_0x77e8('0x88')]('COALESCE(calleridnum,\x27\x27)')[_0x77e8('0x89')](_0x77e8('0xad'))[_0x77e8('0x47')](_0x77e8('0xae'),_0x23b889[_0x77e8('0x50')]['id']['toString']()))[_0x77e8('0x47')](_0x77e8('0xaf'),squel['select']()[_0x77e8('0x88')](_0x77e8('0xb0'))[_0x77e8('0x89')](_0x77e8('0xb1'))[_0x77e8('0x47')]('VoiceQueueId\x20=\x20?',_0x23b889['params']['id']['toString']())))[_0x77e8('0xaa')]();break;case _0x77e8('0xb2'):_0x5a6a0d=squel[_0x77e8('0xb3')]()[_0x77e8('0xa5')]('cm_hopper')['fromQuery']([_0x77e8('0xa6'),_0x77e8('0xa7'),_0x77e8('0xa8'),_0x77e8('0xa9'),'VoiceQueueId',_0x77e8('0x60'),_0x77e8('0x61')],squel['select']()[_0x77e8('0x88')](_0x77e8('0xa6'),_0x77e8('0xa6'))[_0x77e8('0x88')]('NOW()',_0x77e8('0xa7'))[_0x77e8('0x88')]('id',_0x77e8('0xa8'))[_0x77e8('0x88')](_0x274622[_0x77e8('0xb4')][_0x77e8('0xaa')](),'ListId')['field'](_0x23b889[_0x77e8('0x50')]['id'][_0x77e8('0xaa')](),_0x77e8('0x6a'))[_0x77e8('0x88')]('NOW()',_0x77e8('0x60'))[_0x77e8('0x88')](_0x77e8('0xb5'),_0x77e8('0x61'))[_0x77e8('0x89')](_0x77e8('0xb6'))[_0x77e8('0x47')](_0x77e8('0xb7'))[_0x77e8('0x47')]('ListId\x20=\x20?',_0x274622['CmListId'][_0x77e8('0xaa')]())[_0x77e8('0x47')](_0x77e8('0xac'))[_0x77e8('0x47')](_0x77e8('0xaf'),squel['select']()[_0x77e8('0x88')](_0x77e8('0xb0'))[_0x77e8('0x89')](_0x77e8('0xb1'))[_0x77e8('0x47')](_0x77e8('0xae'),_0x23b889[_0x77e8('0x50')]['id'][_0x77e8('0xaa')]())))[_0x77e8('0xaa')]();break;default:_0x5a6a0d=squel['insert']()[_0x77e8('0xa5')](_0x77e8('0xb1'))[_0x77e8('0xb8')]([_0x77e8('0xa6'),_0x77e8('0xa7'),_0x77e8('0xa8'),_0x77e8('0xa9'),_0x77e8('0x6a'),_0x77e8('0x60'),_0x77e8('0x61')],squel[_0x77e8('0x87')]()[_0x77e8('0x88')]('phone',_0x77e8('0xa6'))[_0x77e8('0x88')](_0x77e8('0xb5'),_0x77e8('0xa7'))[_0x77e8('0x88')]('id',_0x77e8('0xa8'))[_0x77e8('0x88')](_0x274622[_0x77e8('0xb4')][_0x77e8('0xaa')](),'ListId')[_0x77e8('0x88')](_0x23b889[_0x77e8('0x50')]['id']['toString'](),_0x77e8('0x6a'))['field'](_0x77e8('0xb5'),_0x77e8('0x60'))[_0x77e8('0x88')](_0x77e8('0xb5'),_0x77e8('0x61'))[_0x77e8('0x89')](_0x77e8('0xb6'))['where']('deletedAt\x20IS\x20NULL')[_0x77e8('0x47')](_0x77e8('0xab'),_0x274622[_0x77e8('0xb4')]['toString']())[_0x77e8('0x47')](_0x77e8('0xac')))['toString']();}_0x506159[_0x77e8('0x90')](db[_0x77e8('0x79')][_0x77e8('0x3d')](_0x5a6a0d));}return BPromise[_0x77e8('0x94')](_0x506159);}})[_0x77e8('0x2a')](function(){return _0xa0b520;})['then'](respondWithResult(_0x1b93f0,null))[_0x77e8('0x4e')](handleError(_0x1b93f0,null));};exports['removeLists']=function(_0x14c4ce,_0x185384,_0x89751c){return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x14c4ce[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x185384,null))['then'](function(_0x3a46b0){if(_0x3a46b0){return _0x3a46b0['removeLists'](_0x14c4ce[_0x77e8('0x3d')][_0x77e8('0x9b')]);}})['then'](function(_0x5a45f8){if(_0x5a45f8){return db['CmHopper']['destroy']({'where':{'ListId':_0x14c4ce[_0x77e8('0x3d')][_0x77e8('0x9b')],'VoiceQueueId':_0x14c4ce[_0x77e8('0x50')]['id']}})['then'](function(){return _0x5a45f8;});}})[_0x77e8('0x2a')](respondWithStatusCode(_0x185384,null))[_0x77e8('0x4e')](handleError(_0x185384,null));};exports[_0x77e8('0xb9')]=function(_0x2f7c99,_0x180e7f,_0x3cdb58){var _0x38895e={};var _0x2612f0={};var _0x240687;var _0x3dcb93;return db[_0x77e8('0x51')][_0x77e8('0x65')]({'where':{'id':_0x2f7c99[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x180e7f,null))[_0x77e8('0x2a')](function(_0x51714d){if(_0x51714d){_0x240687=_0x51714d;_0x2612f0['model']=_['keys'](db[_0x77e8('0xa1')][_0x77e8('0x52')]);_0x2612f0['query']=_[_0x77e8('0x3e')](_0x2f7c99[_0x77e8('0x3d')]);_0x2612f0['filters']=_[_0x77e8('0x53')](_0x2612f0[_0x77e8('0x40')],_0x2612f0['query']);_0x38895e['attributes']=_[_0x77e8('0x53')](_0x2612f0[_0x77e8('0x40')],qs[_0x77e8('0x42')](_0x2f7c99[_0x77e8('0x3d')][_0x77e8('0x42')]));_0x38895e['attributes']=_0x38895e[_0x77e8('0x41')]['length']?_0x38895e[_0x77e8('0x41')]:_0x2612f0[_0x77e8('0x40')];_0x38895e[_0x77e8('0x69')]=qs[_0x77e8('0x46')](_0x2f7c99[_0x77e8('0x3d')]['sort']);_0x38895e['where']=qs[_0x77e8('0x3f')](_[_0x77e8('0x48')](_0x2f7c99[_0x77e8('0x3d')],_0x2612f0['filters']));if(_0x2f7c99[_0x77e8('0x3d')][_0x77e8('0x30')]){_0x38895e[_0x77e8('0x47')]=_[_0x77e8('0x49')](_0x38895e[_0x77e8('0x47')],{'$or':_[_0x77e8('0x31')](_0x38895e[_0x77e8('0x41')],function(_0x17ae2f){var _0x4df7bd={};_0x4df7bd[_0x17ae2f]={'$like':'%'+_0x2f7c99[_0x77e8('0x3d')][_0x77e8('0x30')]+'%'};return _0x4df7bd;})});}_0x38895e=_['merge']({},_0x38895e,_0x2f7c99[_0x77e8('0x55')]);return _0x240687['getBlackLists'](_0x38895e);}})[_0x77e8('0x2a')](function(_0x4ba27a){if(_0x4ba27a){_0x3dcb93=_0x4ba27a[_0x77e8('0x43')];if(!_0x2f7c99[_0x77e8('0x3d')]['hasOwnProperty'](_0x77e8('0x45'))){_0x38895e[_0x77e8('0x22')]=qs[_0x77e8('0x22')](_0x2f7c99[_0x77e8('0x3d')][_0x77e8('0x22')]);_0x38895e[_0x77e8('0x21')]=qs[_0x77e8('0x21')](_0x2f7c99[_0x77e8('0x3d')][_0x77e8('0x21')]);}return _0x240687[_0x77e8('0xb9')](_0x38895e);}})[_0x77e8('0x2a')](function(_0x62937b){if(_0x62937b){return _0x62937b?{'count':_0x3dcb93,'rows':_0x62937b}:null;}})[_0x77e8('0x2a')](respondWithResult(_0x180e7f,null))['catch'](handleError(_0x180e7f,null));};exports['addBlackLists']=function(_0x55d4e9,_0x1341e0,_0xf711b9){var _0x5f060d,_0x2bafe0;return db['VoiceQueue'][_0x77e8('0x35')]({'where':{'id':_0x55d4e9[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](handleEntityNotFound(_0x1341e0,null))['then'](function(_0x4daecd){if(_0x4daecd){_0x2bafe0=_0x4daecd;return _0x4daecd[_0x77e8('0xba')](_0x55d4e9[_0x77e8('0x57')][_0x77e8('0x9b')],_[_0x77e8('0x62')](_0x55d4e9['body'],[_0x77e8('0x9b'),'id'])||{});}return null;})[_0x77e8('0x9c')](function(_0x4e7b84){var _0x2639ed;_0x5f060d=_0x4e7b84||[];var _0x357080=[];if(_0x4e7b84){for(var _0x224d28=0x0;_0x224d28<_0x4e7b84[_0x77e8('0x43')];_0x224d28+=0x1){var _0xc94776=_0x4e7b84[_0x224d28][_0x77e8('0x2c')]({'plain':!![]});_0x2639ed=squel[_0x77e8('0xb3')]()[_0x77e8('0xa5')]('cm_hopper_black')[_0x77e8('0xb8')]([_0x77e8('0xa6'),_0x77e8('0xa8'),_0x77e8('0xa9'),'VoiceQueueId',_0x77e8('0x60'),_0x77e8('0x61')],squel['select']()[_0x77e8('0x88')](_0x77e8('0xa6'),_0x77e8('0xa6'))[_0x77e8('0x88')]('id',_0x77e8('0xa8'))[_0x77e8('0x88')](_0xc94776['CmListId'][_0x77e8('0xaa')](),_0x77e8('0xa9'))[_0x77e8('0x88')](_0x55d4e9[_0x77e8('0x50')]['id'][_0x77e8('0xaa')](),'VoiceQueueId')[_0x77e8('0x88')](_0x77e8('0xb5'),_0x77e8('0x60'))['field'](_0x77e8('0xb5'),_0x77e8('0x61'))[_0x77e8('0x89')](_0x77e8('0xb6'))[_0x77e8('0x47')]('deletedAt\x20IS\x20NULL')[_0x77e8('0x47')]('ListId\x20=\x20?',_0xc94776[_0x77e8('0xb4')][_0x77e8('0xaa')]())[_0x77e8('0x47')](_0x77e8('0xac')))[_0x77e8('0xaa')]();_0x357080['push'](db['sequelize'][_0x77e8('0x3d')](_0x2639ed));}return BPromise[_0x77e8('0x94')](_0x357080);}})['then'](function(){return _0x5f060d;})[_0x77e8('0x2a')](respondWithResult(_0x1341e0,null))['catch'](handleError(_0x1341e0,null));};exports[_0x77e8('0xbb')]=function(_0x9802ff,_0x28dcf4,_0x580faf){return db[_0x77e8('0x51')][_0x77e8('0x35')]({'where':{'id':_0x9802ff[_0x77e8('0x50')]['id']}})['then'](handleEntityNotFound(_0x28dcf4,null))[_0x77e8('0x2a')](function(_0x539b10){if(_0x539b10){return _0x539b10[_0x77e8('0xbb')](_0x9802ff['query'][_0x77e8('0x9b')]);}})[_0x77e8('0x2a')](function(_0x41085a){if(_0x41085a){return db[_0x77e8('0x6e')][_0x77e8('0x2b')]({'where':{'ListId':_0x9802ff['query'][_0x77e8('0x9b')],'VoiceQueueId':_0x9802ff[_0x77e8('0x50')]['id']}})[_0x77e8('0x2a')](function(){return _0x41085a;});}})[_0x77e8('0x2a')](respondWithStatusCode(_0x28dcf4,null))[_0x77e8('0x4e')](handleError(_0x28dcf4,null));}; \ No newline at end of file +var _0x6b83=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','send','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','VoiceQueue','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','userProfileId','getHoppers','findOne','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','findOrCreate','upsert','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','transaction','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','isEmpty','isNil','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','field','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb'];(function(_0x56ea49,_0x304296){var _0x52f215=function(_0x57056){while(--_0x57056){_0x56ea49['push'](_0x56ea49['shift']());}};_0x52f215(++_0x304296);}(_0x6b83,0x151));var _0x36b8=function(_0x5e0823,_0x146024){_0x5e0823=_0x5e0823-0x0;var _0x592fbb=_0x6b83[_0x5e0823];return _0x592fbb;};'use strict';var emlformat=require(_0x36b8('0x0'));var rimraf=require(_0x36b8('0x1'));var zipdir=require(_0x36b8('0x2'));var jsonpatch=require(_0x36b8('0x3'));var rp=require(_0x36b8('0x4'));var moment=require(_0x36b8('0x5'));var BPromise=require(_0x36b8('0x6'));var Mustache=require(_0x36b8('0x7'));var util=require(_0x36b8('0x8'));var path=require('path');var sox=require(_0x36b8('0x9'));var csv=require(_0x36b8('0xa'));var ejs=require(_0x36b8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36b8('0xc'));var squel=require(_0x36b8('0xd'));var crypto=require('crypto');var jsforce=require(_0x36b8('0xe'));var deskjs=require(_0x36b8('0xf'));var toCsv=require(_0x36b8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x36b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36b8('0x11'));var logger=require(_0x36b8('0x12'))('api');var utils=require(_0x36b8('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x36b8('0x14'))['db'];config[_0x36b8('0x15')]=_[_0x36b8('0x16')](config[_0x36b8('0x15')],{'host':_0x36b8('0x17'),'port':0x18eb});var socket=require(_0x36b8('0x18'))(new Redis(config[_0x36b8('0x15')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x59a26a,_0x61362c){_0x61362c=_0x61362c||0xcc;return function(_0x2fe21a){if(_0x2fe21a){return _0x59a26a[_0x36b8('0x19')](_0x61362c);}return _0x59a26a[_0x36b8('0x1a')](_0x61362c)[_0x36b8('0x1b')]();};}function respondWithResult(_0xa7cbe,_0x54ead2){_0x54ead2=_0x54ead2||0xc8;return function(_0x30724c){if(_0x30724c){return _0xa7cbe[_0x36b8('0x1a')](_0x54ead2)[_0x36b8('0x1c')](_0x30724c);}};}function respondWithFilteredResult(_0x327bdb,_0xba98ee){return function(_0x3a8059){if(_0x3a8059){var _0x3dfc6e=typeof _0xba98ee['offset']===_0x36b8('0x1d')&&typeof _0xba98ee[_0x36b8('0x1e')]===_0x36b8('0x1d');var _0x2ec8be=_0x3a8059['count'];var _0x434ee9=_0x3dfc6e?0x0:_0xba98ee['offset'];var _0x4b6a68=_0x3dfc6e?_0x3a8059[_0x36b8('0x1f')]:_0xba98ee[_0x36b8('0x20')]+_0xba98ee[_0x36b8('0x1e')];var _0x474ff7;if(_0x4b6a68>=_0x2ec8be){_0x4b6a68=_0x2ec8be;_0x474ff7=0xc8;}else{_0x474ff7=0xce;}_0x327bdb[_0x36b8('0x1a')](_0x474ff7);return _0x327bdb[_0x36b8('0x21')]('Content-Range',_0x434ee9+'-'+_0x4b6a68+'/'+_0x2ec8be)['json'](_0x3a8059);}return null;};}function patchUpdates(_0x1a27c7){return function(_0x1e038d){try{jsonpatch[_0x36b8('0x22')](_0x1e038d,_0x1a27c7,!![]);}catch(_0x49b743){return BPromise[_0x36b8('0x23')](_0x49b743);}return _0x1e038d[_0x36b8('0x24')]();};}function saveUpdates(_0x43ab7a,_0x28ba33){return function(_0xc8f058){if(_0xc8f058){return _0xc8f058[_0x36b8('0x25')](_0x43ab7a)[_0x36b8('0x26')](function(_0x8f95e4){return _0x8f95e4;});}return null;};}function removeEntity(_0x1ac47b,_0x451268){return function(_0x22fef5){if(_0x22fef5){return _0x22fef5[_0x36b8('0x27')]()[_0x36b8('0x26')](function(){var _0x38044d=_0x22fef5[_0x36b8('0x28')]({'plain':!![]});var _0x50314f=[{'name':_0x36b8('0x29'),'value':'inbound','ignore':![]},{'name':_0x36b8('0x2a'),'value':_0x36b8('0x2b'),'ignore':![]}];var _0xe381ff=_(_0x50314f)[_0x36b8('0x2c')]('ignore')[_0x36b8('0x2d')](_0x36b8('0x2e'))['value']();if(_[_0x36b8('0x2f')](_0xe381ff,_0x38044d[_0x36b8('0x30')])){return;}var _0x41eab9=_[_0x36b8('0x31')](_0x50314f,[_0x36b8('0x2e'),_0x38044d[_0x36b8('0x30')]])[_0x36b8('0x32')];return db[_0x36b8('0x33')]['destroy']({'where':{'type':_0x41eab9,'resourceId':_0x38044d['id']}})[_0x36b8('0x26')](function(){return _0x22fef5;});})[_0x36b8('0x26')](function(){_0x1ac47b[_0x36b8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa8f87,_0x28400f){return function(_0x465110){if(!_0x465110){_0xa8f87['sendStatus'](0x194);}return _0x465110;};}function handleError(_0x40c2f4,_0x3ed6ee){_0x3ed6ee=_0x3ed6ee||0x1f4;return function(_0x43103b){logger['error'](_0x43103b['stack']);if(_0x43103b[_0x36b8('0x32')]){delete _0x43103b[_0x36b8('0x32')];}_0x40c2f4[_0x36b8('0x1a')](_0x3ed6ee)[_0x36b8('0x34')](_0x43103b);};}exports[_0x36b8('0x35')]=function(_0x1693aa,_0x164ae9){var _0x341584={},_0x44e9a2={},_0x2fa7e5={'count':0x0,'rows':[]};var _0x579573=_['map'](db['VoiceQueue'][_0x36b8('0x36')],function(_0x406956){return{'name':_0x406956[_0x36b8('0x37')],'type':_0x406956[_0x36b8('0x30')][_0x36b8('0x38')]};});_0x44e9a2[_0x36b8('0x39')]=_[_0x36b8('0x2d')](_0x579573,_0x36b8('0x32'));_0x44e9a2['query']=_[_0x36b8('0x3a')](_0x1693aa[_0x36b8('0x3b')]);_0x44e9a2[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x44e9a2[_0x36b8('0x39')],_0x44e9a2[_0x36b8('0x3b')]);_0x341584[_0x36b8('0x3e')]=_[_0x36b8('0x3d')](_0x44e9a2[_0x36b8('0x39')],qs[_0x36b8('0x3f')](_0x1693aa['query']['fields']));_0x341584[_0x36b8('0x3e')]=_0x341584[_0x36b8('0x3e')]['length']?_0x341584[_0x36b8('0x3e')]:_0x44e9a2['model'];if(!_0x1693aa[_0x36b8('0x3b')][_0x36b8('0x40')](_0x36b8('0x41'))){_0x341584[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x1693aa[_0x36b8('0x3b')]['limit']);_0x341584[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x1693aa[_0x36b8('0x3b')][_0x36b8('0x20')]);}_0x341584[_0x36b8('0x42')]=qs[_0x36b8('0x43')](_0x1693aa[_0x36b8('0x3b')]['sort']);_0x341584[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_['pick'](_0x1693aa[_0x36b8('0x3b')],_0x44e9a2[_0x36b8('0x3c')]),_0x579573);if(_0x1693aa[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x341584['where']=_[_0x36b8('0x45')](_0x341584[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x579573,function(_0x44033b){if(_0x44033b['type']!==_0x36b8('0x46')){var _0x364f80={};_0x364f80[_0x44033b[_0x36b8('0x32')]]={'$like':'%'+_0x1693aa[_0x36b8('0x3b')][_0x36b8('0x2c')]+'%'};return _0x364f80;}})});}_0x341584=_[_0x36b8('0x45')]({},_0x341584,_0x1693aa[_0x36b8('0x47')]);var _0x490152={'where':_0x341584['where']};return db['VoiceQueue'][_0x36b8('0x1f')](_0x490152)[_0x36b8('0x26')](function(_0x2c2f2b){_0x2fa7e5[_0x36b8('0x1f')]=_0x2c2f2b;if(_0x1693aa[_0x36b8('0x3b')][_0x36b8('0x48')]){_0x341584[_0x36b8('0x49')]=[{'all':!![]}];}return db[_0x36b8('0x4a')][_0x36b8('0x4b')](_0x341584);})[_0x36b8('0x26')](function(_0x28bd7b){_0x2fa7e5[_0x36b8('0x4c')]=_0x28bd7b;return _0x2fa7e5;})['then'](respondWithFilteredResult(_0x164ae9,_0x341584))[_0x36b8('0x4d')](handleError(_0x164ae9,null));};exports[_0x36b8('0x4e')]=function(_0x2a1aa1,_0x2fc310){var _0x8a7eb0={'raw':![],'where':{'id':_0x2a1aa1[_0x36b8('0x4f')]['id']}},_0x48f44b={};_0x48f44b[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db[_0x36b8('0x4a')][_0x36b8('0x36')]);_0x48f44b['query']=_['keys'](_0x2a1aa1[_0x36b8('0x3b')]);_0x48f44b[_0x36b8('0x3c')]=_['intersection'](_0x48f44b[_0x36b8('0x39')],_0x48f44b[_0x36b8('0x3b')]);_0x8a7eb0[_0x36b8('0x3e')]=_[_0x36b8('0x3d')](_0x48f44b['model'],qs['fields'](_0x2a1aa1[_0x36b8('0x3b')]['fields']));_0x8a7eb0[_0x36b8('0x3e')]=_0x8a7eb0[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x8a7eb0[_0x36b8('0x3e')]:_0x48f44b[_0x36b8('0x39')];if(_0x2a1aa1['query']['includeAll']){_0x8a7eb0[_0x36b8('0x49')]=[{'all':!![]}];}_0x8a7eb0=_[_0x36b8('0x45')]({},_0x8a7eb0,_0x2a1aa1['options']);return db[_0x36b8('0x4a')][_0x36b8('0x31')](_0x8a7eb0)['then'](handleEntityNotFound(_0x2fc310,null))[_0x36b8('0x26')](respondWithResult(_0x2fc310,null))[_0x36b8('0x4d')](handleError(_0x2fc310,null));};exports[_0x36b8('0x51')]=function(_0x27b306,_0x460ffc){return db[_0x36b8('0x4a')][_0x36b8('0x51')](_0x27b306[_0x36b8('0x52')],{})[_0x36b8('0x26')](function(_0x3c4f5e){var _0x5d9bc9=_0x27b306[_0x36b8('0x53')][_0x36b8('0x28')]({'plain':!![]});if(!_0x5d9bc9)throw new Error(_0x36b8('0x54'));if(_0x5d9bc9['role']===_0x36b8('0x53')){var _0x3e1ffd=_0x3c4f5e['get']({'plain':!![]});var _0x1b8663=[{'name':_0x36b8('0x29'),'value':_0x36b8('0x55')},{'name':_0x36b8('0x2a'),'value':_0x36b8('0x2b')}];var _0x5c497c=_[_0x36b8('0x31')](_0x1b8663,['value',_0x3e1ffd[_0x36b8('0x30')]])[_0x36b8('0x32')];return db[_0x36b8('0x56')]['find']({'where':{'name':_0x5c497c,'userProfileId':_0x5d9bc9['userProfileId']},'raw':!![]})[_0x36b8('0x26')](function(_0x4cdc9c){if(_0x4cdc9c&&_0x4cdc9c['autoAssociation']===0x0){return db[_0x36b8('0x33')]['create']({'name':_0x3e1ffd[_0x36b8('0x32')],'resourceId':_0x3e1ffd['id'],'type':_0x4cdc9c[_0x36b8('0x32')],'sectionId':_0x4cdc9c['id']},{})['then'](function(){return _0x3c4f5e;});}else{return _0x3c4f5e;}})[_0x36b8('0x4d')](function(_0x55b105){logger[_0x36b8('0x57')](_0x36b8('0x58'),_0x55b105);throw _0x55b105;});}return _0x3c4f5e;})[_0x36b8('0x26')](respondWithResult(_0x460ffc,0xc9))[_0x36b8('0x4d')](handleError(_0x460ffc,null));};exports[_0x36b8('0x59')]=function(_0x4aa800,_0x220087){var _0x242b98={'where':{'id':_0x4aa800[_0x36b8('0x4f')]['id']}},_0x3571c4={};_0x3571c4[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db[_0x36b8('0x4a')]['rawAttributes']);_0x242b98[_0x36b8('0x3e')]=_[_0x36b8('0x3d')](_0x3571c4['model'],qs[_0x36b8('0x3f')](_0x4aa800[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x242b98[_0x36b8('0x3e')]=_0x242b98['attributes'][_0x36b8('0x50')]?_0x242b98[_0x36b8('0x3e')]:_0x3571c4[_0x36b8('0x39')];if(_0x4aa800['query']['includeAll']){_0x242b98[_0x36b8('0x49')]=[{'all':!![]}];}_0x242b98=_[_0x36b8('0x45')]({},_0x242b98,_0x4aa800[_0x36b8('0x47')]);return db[_0x36b8('0x4a')][_0x36b8('0x31')](_0x242b98)[_0x36b8('0x26')](handleEntityNotFound(_0x220087,null))[_0x36b8('0x26')](function(_0x1f487b){if(_0x1f487b){var _0x5334a4=_0x1f487b[_0x36b8('0x28')]({'plain':!![]});_0x5334a4=qs['omit'](_0x5334a4,['id',_0x36b8('0x5a'),_0x36b8('0x5b')]);_0x4aa800[_0x36b8('0x52')]=_[_0x36b8('0x5c')](_0x4aa800[_0x36b8('0x52')],['id',_0x36b8('0x5a'),_0x36b8('0x5b')]);return db[_0x36b8('0x4a')][_0x36b8('0x51')](_[_0x36b8('0x45')](_0x5334a4,_0x4aa800[_0x36b8('0x52')]),{'include':_0x4aa800[_0x36b8('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0x36b8('0x26')](function(_0x421431){var _0x3223a9=_0x4aa800[_0x36b8('0x53')][_0x36b8('0x28')]({'plain':!![]});if(!_0x3223a9)throw new Error(_0x36b8('0x54'));if(_0x3223a9[_0x36b8('0x5d')]===_0x36b8('0x53')){var _0x4f434d=_0x421431[_0x36b8('0x28')]({'plain':!![]});var _0x211610=[{'name':_0x36b8('0x29'),'value':_0x36b8('0x55')},{'name':_0x36b8('0x2a'),'value':_0x36b8('0x2b')}];var _0x1891e8=_[_0x36b8('0x31')](_0x211610,[_0x36b8('0x2e'),_0x4f434d[_0x36b8('0x30')]])[_0x36b8('0x32')];return db['UserProfileSection'][_0x36b8('0x31')]({'where':{'name':_0x1891e8,'userProfileId':_0x3223a9[_0x36b8('0x5e')]},'raw':!![]})[_0x36b8('0x26')](function(_0x3a808f){if(_0x3a808f&&_0x3a808f['autoAssociation']===0x0){return db[_0x36b8('0x33')]['create']({'name':_0x4f434d[_0x36b8('0x32')],'resourceId':_0x4f434d['id'],'type':_0x3a808f[_0x36b8('0x32')],'sectionId':_0x3a808f['id']},{})[_0x36b8('0x26')](function(){return _0x421431;});}else{return _0x421431;}})[_0x36b8('0x4d')](function(_0x337aad){logger[_0x36b8('0x57')](_0x36b8('0x58'),_0x337aad);throw _0x337aad;});}return _0x421431;});}})[_0x36b8('0x26')](respondWithResult(_0x220087,0xc9))['catch'](handleError(_0x220087,null));};exports[_0x36b8('0x25')]=function(_0x311e5b,_0x2f74fb){if(_0x311e5b[_0x36b8('0x52')]['id']){delete _0x311e5b[_0x36b8('0x52')]['id'];}return db['VoiceQueue'][_0x36b8('0x31')]({'where':{'id':_0x311e5b['params']['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x2f74fb,null))[_0x36b8('0x26')](saveUpdates(_0x311e5b[_0x36b8('0x52')],null))[_0x36b8('0x26')](respondWithResult(_0x2f74fb,null))['catch'](handleError(_0x2f74fb,null));};exports['destroy']=function(_0x5cd66a,_0xddd482){return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0x5cd66a[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0xddd482,null))['then'](removeEntity(_0xddd482,null))['catch'](handleError(_0xddd482,null));};exports[_0x36b8('0x5f')]=function(_0x5f2bfe,_0x567712,_0xfe4d34){var _0x27e06c={'raw':![],'where':{}};var _0x33f99c={};var _0xa40b6b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x36b8('0x60')]({'where':{'id':_0x5f2bfe[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x567712,null))[_0x36b8('0x26')](function(_0x201808){if(_0x201808){_0x33f99c[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db['CmHopper']['rawAttributes']);_0x33f99c['query']=_['keys'](_0x5f2bfe[_0x36b8('0x3b')]);_0x33f99c[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x33f99c[_0x36b8('0x39')],_0x33f99c[_0x36b8('0x3b')]);_0x27e06c[_0x36b8('0x3e')]=_['intersection'](_0x33f99c[_0x36b8('0x39')],qs[_0x36b8('0x3f')](_0x5f2bfe[_0x36b8('0x3b')]['fields']));_0x27e06c[_0x36b8('0x3e')]=_0x27e06c[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x27e06c[_0x36b8('0x3e')]:_0x33f99c[_0x36b8('0x39')];if(!_0x5f2bfe[_0x36b8('0x3b')][_0x36b8('0x40')](_0x36b8('0x41'))){_0x27e06c[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x5f2bfe['query'][_0x36b8('0x1e')]);_0x27e06c[_0x36b8('0x20')]=qs['offset'](_0x5f2bfe[_0x36b8('0x3b')][_0x36b8('0x20')]);}_0x27e06c['order']=qs[_0x36b8('0x43')](_0x5f2bfe[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x27e06c[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_[_0x36b8('0x61')](_0x5f2bfe['query'],_0x33f99c[_0x36b8('0x3c')]));_0x27e06c[_0x36b8('0x44')][_0x36b8('0x62')]=_0x201808['id'];if(_0x5f2bfe['query']['filter']){_0x27e06c[_0x36b8('0x44')]=_[_0x36b8('0x45')](_0x27e06c[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x27e06c[_0x36b8('0x3e')],function(_0x49258b){var _0xd7e646={};_0xd7e646[_0x49258b]={'$like':'%'+_0x5f2bfe[_0x36b8('0x3b')]['filter']+'%'};return _0xd7e646;})});}_0x27e06c=_[_0x36b8('0x45')]({},_0x27e06c,_0x5f2bfe[_0x36b8('0x47')]);return db[_0x36b8('0x63')]['count']({'where':_0x27e06c[_0x36b8('0x44')]})[_0x36b8('0x26')](function(_0x38bd6c){_0xa40b6b[_0x36b8('0x1f')]=_0x38bd6c;if(_0x5f2bfe[_0x36b8('0x3b')]['includeAll']){_0x27e06c[_0x36b8('0x49')]=[{'all':!![]}];}return db[_0x36b8('0x63')][_0x36b8('0x4b')](_0x27e06c);})[_0x36b8('0x26')](function(_0x547ffe){_0xa40b6b['rows']=_0x547ffe;return _0xa40b6b;});}})[_0x36b8('0x26')](respondWithFilteredResult(_0x567712,_0x27e06c))['catch'](handleError(_0x567712,null));};exports[_0x36b8('0x64')]=function(_0x1cb140,_0x455cbe,_0x22557d){var _0x4a4252={'raw':!![],'where':{}};var _0x2ac936={};var _0x2b1783={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x36b8('0x60')]({'where':{'id':_0x1cb140[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x455cbe,null))[_0x36b8('0x26')](function(_0x46c5ad){if(_0x46c5ad){_0x2ac936[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db['CmHopperHistory'][_0x36b8('0x36')]);_0x2ac936[_0x36b8('0x3b')]=_['keys'](_0x1cb140[_0x36b8('0x3b')]);_0x2ac936[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x2ac936['model'],_0x2ac936[_0x36b8('0x3b')]);_0x4a4252['attributes']=_[_0x36b8('0x3d')](_0x2ac936[_0x36b8('0x39')],qs[_0x36b8('0x3f')](_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x4a4252[_0x36b8('0x3e')]=_0x4a4252[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x4a4252[_0x36b8('0x3e')]:_0x2ac936[_0x36b8('0x39')];if(!_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x40')](_0x36b8('0x41'))){_0x4a4252[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x1e')]);_0x4a4252[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x20')]);}_0x4a4252[_0x36b8('0x42')]=qs['sort'](_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x4a4252[_0x36b8('0x44')]=qs['filters'](_['pick'](_0x1cb140[_0x36b8('0x3b')],_0x2ac936['filters']));_0x4a4252[_0x36b8('0x44')]['VoiceQueueId']=_0x46c5ad['id'];if(_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x4a4252[_0x36b8('0x44')]=_[_0x36b8('0x45')](_0x4a4252[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x4a4252['attributes'],function(_0x1d2ab9){var _0x3e6202={};_0x3e6202[_0x1d2ab9]={'$like':'%'+_0x1cb140['query'][_0x36b8('0x2c')]+'%'};return _0x3e6202;})});}_0x4a4252=_[_0x36b8('0x45')]({},_0x4a4252,_0x1cb140[_0x36b8('0x47')]);return db[_0x36b8('0x65')][_0x36b8('0x1f')]({'where':_0x4a4252[_0x36b8('0x44')]})[_0x36b8('0x26')](function(_0x581426){_0x2b1783['count']=_0x581426;if(_0x1cb140[_0x36b8('0x3b')][_0x36b8('0x48')]){_0x4a4252['include']=[{'all':!![]}];}return db[_0x36b8('0x65')]['findAll'](_0x4a4252);})[_0x36b8('0x26')](function(_0x51874b){_0x2b1783[_0x36b8('0x4c')]=_0x51874b;return _0x2b1783;});}})[_0x36b8('0x26')](respondWithFilteredResult(_0x455cbe,_0x4a4252))[_0x36b8('0x4d')](handleError(_0x455cbe,null));};exports[_0x36b8('0x66')]=function(_0x1cd32b,_0x2ef3e1,_0x27836e){var _0x4165e2={'raw':!![],'where':{}};var _0x1e7988={};var _0x527544={'count':0x0,'rows':[]};return db[_0x36b8('0x4a')][_0x36b8('0x60')]({'where':{'id':_0x1cd32b['params']['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x2ef3e1,null))[_0x36b8('0x26')](function(_0x1a6491){if(_0x1a6491){_0x1e7988[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db[_0x36b8('0x67')][_0x36b8('0x36')]);_0x1e7988['query']=_[_0x36b8('0x3a')](_0x1cd32b[_0x36b8('0x3b')]);_0x1e7988[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x1e7988[_0x36b8('0x39')],_0x1e7988[_0x36b8('0x3b')]);_0x4165e2['attributes']=_[_0x36b8('0x3d')](_0x1e7988['model'],qs[_0x36b8('0x3f')](_0x1cd32b[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x4165e2[_0x36b8('0x3e')]=_0x4165e2[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x4165e2['attributes']:_0x1e7988[_0x36b8('0x39')];if(!_0x1cd32b['query'][_0x36b8('0x40')](_0x36b8('0x41'))){_0x4165e2[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x1cd32b['query'][_0x36b8('0x1e')]);_0x4165e2[_0x36b8('0x20')]=qs['offset'](_0x1cd32b['query'][_0x36b8('0x20')]);}_0x4165e2['order']=qs[_0x36b8('0x43')](_0x1cd32b[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x4165e2[_0x36b8('0x44')]=qs['filters'](_[_0x36b8('0x61')](_0x1cd32b['query'],_0x1e7988[_0x36b8('0x3c')]));_0x4165e2[_0x36b8('0x44')][_0x36b8('0x62')]=_0x1a6491['id'];if(_0x1cd32b['query'][_0x36b8('0x2c')]){_0x4165e2['where']=_[_0x36b8('0x45')](_0x4165e2[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x4165e2[_0x36b8('0x3e')],function(_0xe8bd53){var _0x3a9404={};_0x3a9404[_0xe8bd53]={'$like':'%'+_0x1cd32b[_0x36b8('0x3b')][_0x36b8('0x2c')]+'%'};return _0x3a9404;})});}_0x4165e2=_['merge']({},_0x4165e2,_0x1cd32b['options']);return db[_0x36b8('0x67')][_0x36b8('0x1f')]({'where':_0x4165e2[_0x36b8('0x44')]})['then'](function(_0xb7f27c){_0x527544[_0x36b8('0x1f')]=_0xb7f27c;if(_0x1cd32b[_0x36b8('0x3b')][_0x36b8('0x48')]){_0x4165e2[_0x36b8('0x49')]=[{'all':!![]}];}return db[_0x36b8('0x67')][_0x36b8('0x4b')](_0x4165e2);})[_0x36b8('0x26')](function(_0x45d598){_0x527544[_0x36b8('0x4c')]=_0x45d598;return _0x527544;});}})['then'](respondWithFilteredResult(_0x2ef3e1,_0x4165e2))['catch'](handleError(_0x2ef3e1,null));};exports[_0x36b8('0x68')]=function(_0x3dcc80,_0xb71b21,_0x4fbaad){var _0x4c31a8={'raw':!![],'where':{}};var _0x5c1eb8={};var _0x27a44e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x36b8('0x60')]({'where':{'id':_0x3dcc80[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0xb71b21,null))[_0x36b8('0x26')](function(_0x672d11){if(_0x672d11){_0x5c1eb8[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db[_0x36b8('0x69')][_0x36b8('0x36')]);_0x5c1eb8[_0x36b8('0x3b')]=_[_0x36b8('0x3a')](_0x3dcc80[_0x36b8('0x3b')]);_0x5c1eb8[_0x36b8('0x3c')]=_['intersection'](_0x5c1eb8[_0x36b8('0x39')],_0x5c1eb8['query']);_0x4c31a8['attributes']=_['intersection'](_0x5c1eb8['model'],qs[_0x36b8('0x3f')](_0x3dcc80[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x4c31a8[_0x36b8('0x3e')]=_0x4c31a8[_0x36b8('0x3e')]['length']?_0x4c31a8[_0x36b8('0x3e')]:_0x5c1eb8[_0x36b8('0x39')];if(!_0x3dcc80['query'][_0x36b8('0x40')](_0x36b8('0x41'))){_0x4c31a8['limit']=qs['limit'](_0x3dcc80[_0x36b8('0x3b')][_0x36b8('0x1e')]);_0x4c31a8[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x3dcc80['query'][_0x36b8('0x20')]);}_0x4c31a8[_0x36b8('0x42')]=qs['sort'](_0x3dcc80[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x4c31a8[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_['pick'](_0x3dcc80['query'],_0x5c1eb8[_0x36b8('0x3c')]));_0x4c31a8[_0x36b8('0x44')]['VoiceQueueId']=_0x672d11['id'];if(_0x3dcc80[_0x36b8('0x3b')]['filter']){_0x4c31a8['where']=_[_0x36b8('0x45')](_0x4c31a8[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x4c31a8[_0x36b8('0x3e')],function(_0x5844b8){var _0x525c54={};_0x525c54[_0x5844b8]={'$like':'%'+_0x3dcc80['query'][_0x36b8('0x2c')]+'%'};return _0x525c54;})});}_0x4c31a8=_[_0x36b8('0x45')]({},_0x4c31a8,_0x3dcc80[_0x36b8('0x47')]);return db[_0x36b8('0x69')][_0x36b8('0x1f')]({'where':_0x4c31a8[_0x36b8('0x44')]})[_0x36b8('0x26')](function(_0x324eb2){_0x27a44e[_0x36b8('0x1f')]=_0x324eb2;if(_0x3dcc80[_0x36b8('0x3b')][_0x36b8('0x48')]){_0x4c31a8[_0x36b8('0x49')]=[{'all':!![]}];}return db[_0x36b8('0x69')][_0x36b8('0x4b')](_0x4c31a8);})['then'](function(_0x455f16){_0x27a44e['rows']=_0x455f16;return _0x27a44e;});}})[_0x36b8('0x26')](respondWithFilteredResult(_0xb71b21,_0x4c31a8))[_0x36b8('0x4d')](handleError(_0xb71b21,null));};exports[_0x36b8('0x6a')]=function(_0x3d4d3a,_0x5bc31d,_0x2d11cf){var _0xb730ec={};var _0x21560a={};var _0x5ee271;var _0x5e9297;return db[_0x36b8('0x4a')][_0x36b8('0x60')]({'where':{'id':_0x3d4d3a[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x5bc31d,null))[_0x36b8('0x26')](function(_0x52db9a){if(_0x52db9a){_0x5ee271=_0x52db9a;_0x21560a[_0x36b8('0x39')]=_[_0x36b8('0x3a')](db[_0x36b8('0x6b')]['rawAttributes']);_0x21560a[_0x36b8('0x3b')]=_[_0x36b8('0x3a')](_0x3d4d3a[_0x36b8('0x3b')]);_0x21560a[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x21560a[_0x36b8('0x39')],_0x21560a[_0x36b8('0x3b')]);_0xb730ec['attributes']=_[_0x36b8('0x3d')](_0x21560a[_0x36b8('0x39')],qs[_0x36b8('0x3f')](_0x3d4d3a[_0x36b8('0x3b')]['fields']));_0xb730ec[_0x36b8('0x3e')]=_0xb730ec[_0x36b8('0x3e')][_0x36b8('0x50')]?_0xb730ec[_0x36b8('0x3e')]:_0x21560a[_0x36b8('0x39')];_0xb730ec[_0x36b8('0x42')]=qs[_0x36b8('0x43')](_0x3d4d3a[_0x36b8('0x3b')][_0x36b8('0x43')]);_0xb730ec[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_[_0x36b8('0x61')](_0x3d4d3a[_0x36b8('0x3b')],_0x21560a[_0x36b8('0x3c')]));if(_0x3d4d3a[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0xb730ec[_0x36b8('0x44')]=_[_0x36b8('0x45')](_0xb730ec[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0xb730ec['attributes'],function(_0x19e7b6){var _0xb4eb81={};_0xb4eb81[_0x19e7b6]={'$like':'%'+_0x3d4d3a[_0x36b8('0x3b')][_0x36b8('0x2c')]+'%'};return _0xb4eb81;})});}_0xb730ec=_[_0x36b8('0x45')]({},_0xb730ec,_0x3d4d3a[_0x36b8('0x47')]);return _0x5ee271[_0x36b8('0x6a')](_0xb730ec);}})[_0x36b8('0x26')](function(_0x2f2dee){if(_0x2f2dee){_0x5e9297=_0x2f2dee[_0x36b8('0x50')];if(!_0x3d4d3a[_0x36b8('0x3b')][_0x36b8('0x40')](_0x36b8('0x41'))){_0xb730ec[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x3d4d3a[_0x36b8('0x3b')]['limit']);_0xb730ec[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x3d4d3a[_0x36b8('0x3b')][_0x36b8('0x20')]);}return _0x5ee271[_0x36b8('0x6a')](_0xb730ec);}})[_0x36b8('0x26')](function(_0x3ef3c3){if(_0x3ef3c3){return _0x3ef3c3?{'count':_0x5e9297,'rows':_0x3ef3c3}:null;}})[_0x36b8('0x26')](respondWithResult(_0x5bc31d,null))['catch'](handleError(_0x5bc31d,null));};exports[_0x36b8('0x6c')]=function(_0x23e186,_0x1b5ea5,_0x47a914){var _0xe844ad=_0x23e186[_0x36b8('0x52')][_0x36b8('0x6d')];var _0x115586=_['map'](_0xe844ad,'id');return db[_0x36b8('0x6b')]['findAll']({'where':{'id':_0x115586},'attributes':['id'],'include':[{'model':db[_0x36b8('0x6e')],'as':_0x36b8('0x6f'),'attributes':['id',_0x36b8('0x32'),_0x36b8('0x70'),_0x36b8('0x71'),_0x36b8('0x72')],'raw':!![]}]})['then'](function(_0x431861){if(_0x431861){var _0x45e227=_[_0x36b8('0x73')](_0x431861,function(_0x3f5f8c){var _0x2273cc=_0x3f5f8c['get']({'plain':!![]});_0x2273cc[_0x36b8('0x6f')][_0x36b8('0x74')](function(_0x28217d){_0x28217d[_0x36b8('0x75')]=_[_0x36b8('0x31')](_0xe844ad,{'id':_0x2273cc['id']})['penalty'];});return _0x2273cc[_0x36b8('0x6f')];});return db['VoiceQueue'][_0x36b8('0x31')]({'where':{'id':_0x23e186[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](function(_0x35494f){return db[_0x36b8('0x76')]['transaction'](function(_0x329379){return _0x35494f[_0x36b8('0x6c')](_0x115586,{'transaction':_0x329379})[_0x36b8('0x26')](function(){return BPromise[_0x36b8('0x77')](_0xe844ad,function(_0x3f21b8){return db[_0x36b8('0x78')]['upsert']({'TeamId':_0x3f21b8['id'],'VoiceQueueId':_0x23e186[_0x36b8('0x4f')]['id'],'penalty':_0x3f21b8[_0x36b8('0x75')]},{'transaction':_0x329379});});})[_0x36b8('0x26')](function(){return BPromise[_0x36b8('0x77')](_0x45e227,function(_0x59f67c){return db['UserVoiceQueue'][_0x36b8('0x79')]({'where':{'UserId':_0x59f67c['id'],'VoiceQueueId':_0x23e186['params']['id']},'defaults':{'penalty':_0x59f67c[_0x36b8('0x75')]},'transaction':_0x329379});});})['then'](function(){return BPromise[_0x36b8('0x77')](_[_0x36b8('0x2c')](_0x45e227,{'online':!![]}),function(_0x25a2d5){return db['UserVoiceQueueRt'][_0x36b8('0x7a')]({'membername':_0x25a2d5[_0x36b8('0x32')],'UserId':_0x25a2d5['id'],'queue_name':_0x35494f[_0x36b8('0x32')],'VoiceQueueId':_0x35494f['id'],'interface':_['isNil'](_0x25a2d5[_0x36b8('0x72')])?util[_0x36b8('0x7b')](_0x36b8('0x7c'),_0x25a2d5[_0x36b8('0x32')]):_0x25a2d5['interface'],'paused':_0x25a2d5['voicePause']||![],'penalty':_0x25a2d5[_0x36b8('0x75')]},{'transaction':_0x329379});});})[_0x36b8('0x26')](function(){_0x45e227[_0x36b8('0x74')](function(_0x460b1b){socket['emit'](_0x36b8('0x7d'),{'UserId':_0x460b1b['id'],'VoiceQueueId':_0x35494f['id']});});});});});}})['then'](respondWithStatusCode(_0x1b5ea5,null))[_0x36b8('0x4d')](handleError(_0x1b5ea5,null));};exports[_0x36b8('0x7e')]=function(_0xf26bf9,_0xf557cd,_0x39e056){return db[_0x36b8('0x6b')][_0x36b8('0x4b')]({'where':{'id':_0xf26bf9['query'][_0x36b8('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x36b8('0x6e')],'as':_0x36b8('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x36b8('0x26')](handleEntityNotFound(_0xf557cd,null))['then'](function(_0x39714e){var _0x14bf97=_[_0x36b8('0x2d')](_0x39714e,'id');var _0x112697=[];var _0x4eada7=[];var _0x5c1058=squel[_0x36b8('0x80')]();_0x5c1058['field'](_0x36b8('0x81'))[_0x36b8('0x82')]('team_has_voice_queues','tq')['join'](_0x36b8('0x83'),'ut',_0x36b8('0x84'))[_0x36b8('0x44')](_0x36b8('0x85'),_0xf26bf9[_0x36b8('0x4f')]['id']);for(var _0xf5e53b=0x0;_0xf5e53b<_0x39714e[_0x36b8('0x50')];_0xf5e53b+=0x1){let _0x2c818c=_0x39714e[_0xf5e53b];for(var _0x1058cf=0x0;_0x1058cf<_0x2c818c[_0x36b8('0x6f')][_0x36b8('0x50')];_0x1058cf+=0x1){let _0x2df00c=_0x2c818c[_0x36b8('0x6f')][_0x1058cf];var _0x1ece91=_0x5c1058[_0x36b8('0x59')]();_0x1ece91['where']('ut.UserId\x20=\x20?',_0x2df00c['id']);_0x4eada7[_0x36b8('0x86')](db['sequelize'][_0x36b8('0x3b')](_0x1ece91[_0x36b8('0x87')](),{'type':db['sequelize']['QueryTypes'][_0x36b8('0x88')]})[_0x36b8('0x26')](function(_0x2bebf0){if(_0x2bebf0[_0x36b8('0x50')]===0x1){return _0x2df00c['id'];}else{var _0x1b1e43=_['every'](_[_0x36b8('0x2d')](_0x2bebf0,_0x36b8('0x89')),function(_0x2e5221){return _[_0x36b8('0x2f')](_0x14bf97,_0x2e5221);});if(_0x1b1e43){return _0x2df00c['id'];}}}));}}return BPromise[_0x36b8('0x8a')](_0x4eada7)[_0x36b8('0x26')](function(_0x2444ad){_0x112697=_(_0x112697)[_0x36b8('0x8b')](_0x2444ad)[_0x36b8('0x8c')]()[_0x36b8('0x2e')]();return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0xf26bf9[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](function(_0x4ce98){return db['sequelize'][_0x36b8('0x8d')](function(_0x3a45c2){return _0x4ce98['removeTeams'](_0xf26bf9[_0x36b8('0x3b')][_0x36b8('0x7f')],{'transaction':_0x3a45c2})[_0x36b8('0x26')](function(){if(!_['isEmpty'](_0x112697)){return _0x4ce98[_0x36b8('0x8e')](_0x112697,{'transaction':_0x3a45c2})['then'](function(){return db[_0x36b8('0x8f')]['destroy']({'where':{'VoiceQueueId':_0xf26bf9['params']['id'],'UserId':_0x112697},'transaction':_0x3a45c2});});}})[_0x36b8('0x26')](function(){_0x112697[_0x36b8('0x74')](function(_0x21a5c5){socket[_0x36b8('0x90')](_0x36b8('0x91'),{'UserId':_0x21a5c5,'VoiceQueueId':_0x4ce98['id']});});});});});});})[_0x36b8('0x26')](respondWithStatusCode(_0xf557cd,null))[_0x36b8('0x4d')](handleError(_0xf557cd,null));};exports[_0x36b8('0x92')]=function(_0x42c5f3,_0x2c59a9,_0x5a3a59){var _0x8487c0,_0xc2911d;return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0x42c5f3[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x2c59a9,null))[_0x36b8('0x26')](function(_0x6152b1){if(_0x6152b1){_0xc2911d=_0x6152b1;return _0x6152b1[_0x36b8('0x92')](_0x42c5f3[_0x36b8('0x52')][_0x36b8('0x7f')],_[_0x36b8('0x5c')](_0x42c5f3[_0x36b8('0x52')],[_0x36b8('0x7f'),'id'])||{})['spread'](function(_0x482801){for(var _0x28d2a7=0x0;_0x28d2a7<_0x42c5f3['body'][_0x36b8('0x7f')][_0x36b8('0x50')];_0x28d2a7+=0x1){socket[_0x36b8('0x90')]('userVoiceQueue:save',{'UserId':Number(_0x42c5f3[_0x36b8('0x52')][_0x36b8('0x7f')][_0x28d2a7]),'VoiceQueueId':Number(_0x42c5f3[_0x36b8('0x4f')]['id'])});}return _0x482801;});}})[_0x36b8('0x26')](function(_0xe67c9d){_0x8487c0=_0xe67c9d||[];if(_0xc2911d){return db[_0x36b8('0x6e')][_0x36b8('0x4b')]({'where':{'id':_0x42c5f3[_0x36b8('0x52')]['ids']},'attributes':['id',_0x36b8('0x32'),'online','voicePause',_0x36b8('0x72')],'raw':!![]});}})[_0x36b8('0x26')](function(_0x35b06f){if(!_[_0x36b8('0x93')](_0x35b06f)){var _0x1b0207=[];for(var _0x598896=0x0;_0x598896<_0x35b06f[_0x36b8('0x50')];_0x598896++){if(_0x35b06f[_0x598896][_0x36b8('0x70')]){_0x1b0207['push'](db['UserVoiceQueueRt'][_0x36b8('0x7a')]({'membername':_0x35b06f[_0x598896]['name'],'UserId':_0x35b06f[_0x598896]['id'],'queue_name':_0xc2911d[_0x36b8('0x32')],'VoiceQueueId':_0xc2911d['id'],'interface':_[_0x36b8('0x94')](_0x35b06f[_0x598896][_0x36b8('0x72')])?util[_0x36b8('0x7b')](_0x36b8('0x7c'),_0x35b06f[_0x598896][_0x36b8('0x32')]):_0x35b06f[_0x598896][_0x36b8('0x72')],'paused':_0x35b06f[_0x598896][_0x36b8('0x71')]||![],'penalty':_0x42c5f3['body'][_0x36b8('0x75')]||0x0}));}}return BPromise['all'](_0x1b0207);}})[_0x36b8('0x26')](function(){return _0x8487c0;})[_0x36b8('0x26')](respondWithResult(_0x2c59a9,null))[_0x36b8('0x4d')](handleError(_0x2c59a9,null));};exports[_0x36b8('0x8e')]=function(_0xfc6c23,_0x3dee7d,_0x405c22){return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0xfc6c23[_0x36b8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3dee7d,null))['then'](function(_0x5ac2ed){if(_0x5ac2ed){return _0x5ac2ed['removeAgents'](_0xfc6c23[_0x36b8('0x3b')][_0x36b8('0x7f')])[_0x36b8('0x26')](function(){if(_[_0x36b8('0x95')](_0xfc6c23['query'][_0x36b8('0x7f')])){for(var _0x13e9e0=0x0;_0x13e9e0<_0xfc6c23[_0x36b8('0x3b')][_0x36b8('0x7f')][_0x36b8('0x50')];_0x13e9e0+=0x1){socket[_0x36b8('0x90')](_0x36b8('0x91'),{'UserId':Number(_0xfc6c23[_0x36b8('0x3b')][_0x36b8('0x7f')][_0x13e9e0]),'VoiceQueueId':Number(_0xfc6c23[_0x36b8('0x4f')]['id'])});}}else{socket['emit'](_0x36b8('0x91'),{'UserId':Number(_0xfc6c23[_0x36b8('0x3b')][_0x36b8('0x7f')]),'VoiceQueueId':Number(_0xfc6c23[_0x36b8('0x4f')]['id'])});}});}})[_0x36b8('0x26')](function(_0x5241c0){return db[_0x36b8('0x8f')][_0x36b8('0x27')]({'where':{'VoiceQueueId':_0xfc6c23[_0x36b8('0x4f')]['id'],'UserId':_0xfc6c23['query'][_0x36b8('0x7f')]}})[_0x36b8('0x26')](function(){return _0x5241c0;});})['then'](respondWithStatusCode(_0x3dee7d,null))[_0x36b8('0x4d')](handleError(_0x3dee7d,null));};exports[_0x36b8('0x96')]=function(_0x423ffc,_0x2aa47f,_0x314b6b){var _0x58417f={};var _0xbef31b={};var _0x1ae050;var _0x2ff71c;return db['VoiceQueue']['findOne']({'where':{'id':_0x423ffc[_0x36b8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2aa47f,null))[_0x36b8('0x26')](function(_0x4254e0){if(_0x4254e0){_0x1ae050=_0x4254e0;_0xbef31b[_0x36b8('0x39')]=_['keys'](db[_0x36b8('0x6e')][_0x36b8('0x36')]);_0xbef31b[_0x36b8('0x3b')]=_[_0x36b8('0x3a')](_0x423ffc[_0x36b8('0x3b')]);_0xbef31b[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0xbef31b[_0x36b8('0x39')],_0xbef31b[_0x36b8('0x3b')]);_0x58417f[_0x36b8('0x3e')]=_['intersection'](_0xbef31b[_0x36b8('0x39')],qs['fields'](_0x423ffc[_0x36b8('0x3b')]['fields']));_0x58417f[_0x36b8('0x3e')]=_0x58417f[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x58417f[_0x36b8('0x3e')]:_0xbef31b[_0x36b8('0x39')];_0x58417f[_0x36b8('0x42')]=qs['sort'](_0x423ffc[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x58417f[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_[_0x36b8('0x61')](_0x423ffc[_0x36b8('0x3b')],_0xbef31b['filters']));if(_0x423ffc[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x58417f['where']=_[_0x36b8('0x45')](_0x58417f[_0x36b8('0x44')],{'$or':_[_0x36b8('0x2d')](_0x58417f[_0x36b8('0x3e')],function(_0x37cf78){var _0x252ce6={};_0x252ce6[_0x37cf78]={'$like':'%'+_0x423ffc['query'][_0x36b8('0x2c')]+'%'};return _0x252ce6;})});}_0x58417f=_['merge']({},_0x58417f,_0x423ffc[_0x36b8('0x47')]);return _0x1ae050['getAgents'](_0x58417f);}})[_0x36b8('0x26')](function(_0x214c20){if(_0x214c20){_0x2ff71c=_0x214c20[_0x36b8('0x50')];if(!_0x423ffc[_0x36b8('0x3b')][_0x36b8('0x40')](_0x36b8('0x41'))){_0x58417f[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x423ffc[_0x36b8('0x3b')]['limit']);_0x58417f[_0x36b8('0x20')]=qs['offset'](_0x423ffc[_0x36b8('0x3b')][_0x36b8('0x20')]);}return _0x1ae050[_0x36b8('0x96')](_0x58417f);}})[_0x36b8('0x26')](function(_0x44303a){if(_0x44303a){return _0x44303a?{'count':_0x2ff71c,'rows':_0x44303a}:null;}})[_0x36b8('0x26')](respondWithResult(_0x2aa47f,null))[_0x36b8('0x4d')](handleError(_0x2aa47f,null));};exports[_0x36b8('0x97')]=function(_0x58e0e8,_0x4d3fae,_0xb6b3bd){var _0x30773a={};var _0x56d71c={};var _0x2c2e77;var _0x4b9f75;return db['VoiceQueue'][_0x36b8('0x60')]({'where':{'id':_0x58e0e8['params']['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x4d3fae,null))['then'](function(_0x58f1ec){if(_0x58f1ec){_0x2c2e77=_0x58f1ec;_0x56d71c[_0x36b8('0x39')]=_['keys'](db[_0x36b8('0x8f')]['rawAttributes']);_0x56d71c[_0x36b8('0x3b')]=_[_0x36b8('0x3a')](_0x58e0e8[_0x36b8('0x3b')]);_0x56d71c['filters']=_[_0x36b8('0x3d')](_0x56d71c['model'],_0x56d71c[_0x36b8('0x3b')]);_0x30773a[_0x36b8('0x3e')]=_['intersection'](_0x56d71c['model'],qs[_0x36b8('0x3f')](_0x58e0e8[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x30773a[_0x36b8('0x3e')]=_0x30773a['attributes'][_0x36b8('0x50')]?_0x30773a['attributes']:_0x56d71c[_0x36b8('0x39')];_0x30773a[_0x36b8('0x42')]=qs[_0x36b8('0x43')](_0x58e0e8['query']['sort']);_0x30773a[_0x36b8('0x44')]=qs['filters'](_[_0x36b8('0x61')](_0x58e0e8['query'],_0x56d71c['filters']));if(_0x58e0e8[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x30773a[_0x36b8('0x44')]=_[_0x36b8('0x45')](_0x30773a['where'],{'$or':_[_0x36b8('0x2d')](_0x30773a['attributes'],function(_0x3e8dea){var _0x26b4e1={};_0x26b4e1[_0x3e8dea]={'$like':'%'+_0x58e0e8[_0x36b8('0x3b')][_0x36b8('0x2c')]+'%'};return _0x26b4e1;})});}_0x30773a=_[_0x36b8('0x45')]({},_0x30773a,_0x58e0e8[_0x36b8('0x47')]);return _0x2c2e77['getMembers'](_0x30773a);}})['then'](function(_0x75d661){if(_0x75d661){_0x4b9f75=_0x75d661['length'];if(!_0x58e0e8[_0x36b8('0x3b')][_0x36b8('0x40')]('nolimit')){_0x30773a[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x58e0e8[_0x36b8('0x3b')][_0x36b8('0x1e')]);_0x30773a[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x58e0e8['query'][_0x36b8('0x20')]);}return _0x2c2e77[_0x36b8('0x97')](_0x30773a);}})[_0x36b8('0x26')](function(_0x434b3b){return _0x434b3b?{'count':_0x4b9f75,'rows':_0x434b3b}:null;})[_0x36b8('0x26')](respondWithResult(_0x4d3fae,null))[_0x36b8('0x4d')](handleError(_0x4d3fae,null));};exports[_0x36b8('0x98')]=function(_0x31bda6,_0x5c9c31,_0x41b7b2){var _0x2a7b6f={};var _0x2e7dfd={};var _0x5b6679;var _0x548609;return db[_0x36b8('0x4a')]['findOne']({'where':{'id':_0x31bda6[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x5c9c31,null))[_0x36b8('0x26')](function(_0x3a2050){if(_0x3a2050){_0x5b6679=_0x3a2050;_0x2e7dfd[_0x36b8('0x39')]=_['keys'](db[_0x36b8('0x99')]['rawAttributes']);_0x2e7dfd['query']=_[_0x36b8('0x3a')](_0x31bda6[_0x36b8('0x3b')]);_0x2e7dfd['filters']=_['intersection'](_0x2e7dfd[_0x36b8('0x39')],_0x2e7dfd[_0x36b8('0x3b')]);_0x2a7b6f['attributes']=_[_0x36b8('0x3d')](_0x2e7dfd[_0x36b8('0x39')],qs['fields'](_0x31bda6[_0x36b8('0x3b')]['fields']));_0x2a7b6f[_0x36b8('0x3e')]=_0x2a7b6f[_0x36b8('0x3e')]['length']?_0x2a7b6f[_0x36b8('0x3e')]:_0x2e7dfd[_0x36b8('0x39')];_0x2a7b6f['order']=qs[_0x36b8('0x43')](_0x31bda6['query']['sort']);_0x2a7b6f[_0x36b8('0x44')]=qs[_0x36b8('0x3c')](_[_0x36b8('0x61')](_0x31bda6[_0x36b8('0x3b')],_0x2e7dfd[_0x36b8('0x3c')]));if(_0x31bda6[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x2a7b6f['where']=_[_0x36b8('0x45')](_0x2a7b6f['where'],{'$or':_[_0x36b8('0x2d')](_0x2a7b6f[_0x36b8('0x3e')],function(_0x1f8b8c){var _0x5dc24b={};_0x5dc24b[_0x1f8b8c]={'$like':'%'+_0x31bda6['query'][_0x36b8('0x2c')]+'%'};return _0x5dc24b;})});}_0x2a7b6f=_[_0x36b8('0x45')]({},_0x2a7b6f,_0x31bda6[_0x36b8('0x47')]);return _0x5b6679[_0x36b8('0x98')](_0x2a7b6f);}})[_0x36b8('0x26')](function(_0x4742ef){if(_0x4742ef){_0x548609=_0x4742ef[_0x36b8('0x50')];if(!_0x31bda6['query'][_0x36b8('0x40')](_0x36b8('0x41'))){_0x2a7b6f[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x31bda6[_0x36b8('0x3b')][_0x36b8('0x1e')]);_0x2a7b6f['offset']=qs[_0x36b8('0x20')](_0x31bda6[_0x36b8('0x3b')][_0x36b8('0x20')]);}return _0x5b6679['getLists'](_0x2a7b6f);}})['then'](function(_0x36b99f){if(_0x36b99f){return _0x36b99f?{'count':_0x548609,'rows':_0x36b99f}:null;}})[_0x36b8('0x26')](respondWithResult(_0x5c9c31,null))['catch'](handleError(_0x5c9c31,null));};exports[_0x36b8('0x9a')]=function(_0x16295f,_0x10a74b,_0x1291d4){var _0x32410d,_0x59b84a;return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0x16295f[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x10a74b,null))[_0x36b8('0x26')](function(_0x13b939){if(_0x13b939){_0x59b84a=_0x13b939;return _0x13b939[_0x36b8('0x9a')](_0x16295f[_0x36b8('0x52')][_0x36b8('0x7f')],_[_0x36b8('0x5c')](_0x16295f[_0x36b8('0x52')],[_0x36b8('0x7f'),'id'])||{});}return null;})['spread'](function(_0x571cf8){var _0x10422a;_0x32410d=_0x571cf8||[];var _0x6704fd=[];if(_0x571cf8){for(var _0x458110=0x0;_0x458110<_0x571cf8[_0x36b8('0x50')];_0x458110+=0x1){var _0x3f7c6a=_0x571cf8[_0x458110][_0x36b8('0x28')]({'plain':!![]});_0x59b84a['dialCheckDuplicateType']=_0x16295f[_0x36b8('0x52')][_0x36b8('0x9b')]?_0x16295f[_0x36b8('0x52')][_0x36b8('0x9b')]:_0x59b84a[_0x36b8('0x9b')];switch(_0x59b84a[_0x36b8('0x9b')]){case'always':_0x10422a=squel[_0x36b8('0x9c')]()[_0x36b8('0x9d')](_0x36b8('0x9e'))[_0x36b8('0x9f')]([_0x36b8('0xa0'),'scheduledAt',_0x36b8('0xa1'),_0x36b8('0xa2'),'VoiceQueueId',_0x36b8('0x5a'),_0x36b8('0x5b')],squel['select']()['field'](_0x36b8('0xa0'),_0x36b8('0xa0'))['field'](_0x36b8('0xa3'),_0x36b8('0xa4'))[_0x36b8('0xa5')]('id',_0x36b8('0xa1'))[_0x36b8('0xa5')](_0x3f7c6a[_0x36b8('0xa6')][_0x36b8('0x87')](),'ListId')[_0x36b8('0xa5')](_0x16295f[_0x36b8('0x4f')]['id'][_0x36b8('0x87')](),_0x36b8('0x62'))[_0x36b8('0xa5')](_0x36b8('0xa3'),_0x36b8('0x5a'))[_0x36b8('0xa5')](_0x36b8('0xa3'),_0x36b8('0x5b'))['from'](_0x36b8('0xa7'))['where']('deletedAt\x20IS\x20NULL')[_0x36b8('0x44')]('ListId\x20=\x20?',_0x3f7c6a[_0x36b8('0xa6')]['toString']())[_0x36b8('0x44')](_0x36b8('0xa8'))[_0x36b8('0x44')](_0x36b8('0xa9'),squel['select']()[_0x36b8('0xa5')](_0x36b8('0xaa'))['from'](_0x36b8('0xab'))[_0x36b8('0x44')](_0x36b8('0x85'),_0x16295f[_0x36b8('0x4f')]['id']['toString']()))[_0x36b8('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x36b8('0x80')]()[_0x36b8('0xa5')]('COALESCE(phone,\x27\x27)')['from'](_0x36b8('0x9e'))[_0x36b8('0x44')]('VoiceQueueId\x20=\x20?',_0x16295f[_0x36b8('0x4f')]['id'][_0x36b8('0x87')]())))[_0x36b8('0x87')]();break;case _0x36b8('0xac'):_0x10422a=squel[_0x36b8('0x9c')]()[_0x36b8('0x9d')](_0x36b8('0x9e'))['fromQuery']([_0x36b8('0xa0'),_0x36b8('0xa4'),_0x36b8('0xa1'),'ListId',_0x36b8('0x62'),_0x36b8('0x5a'),'updatedAt'],squel[_0x36b8('0x80')]()['field'](_0x36b8('0xa0'),_0x36b8('0xa0'))[_0x36b8('0xa5')](_0x36b8('0xa3'),_0x36b8('0xa4'))[_0x36b8('0xa5')]('id',_0x36b8('0xa1'))[_0x36b8('0xa5')](_0x3f7c6a[_0x36b8('0xa6')][_0x36b8('0x87')](),_0x36b8('0xa2'))[_0x36b8('0xa5')](_0x16295f[_0x36b8('0x4f')]['id'][_0x36b8('0x87')](),_0x36b8('0x62'))[_0x36b8('0xa5')](_0x36b8('0xa3'),'createdAt')[_0x36b8('0xa5')](_0x36b8('0xa3'),_0x36b8('0x5b'))[_0x36b8('0x82')]('cm_contacts')[_0x36b8('0x44')](_0x36b8('0xad'))[_0x36b8('0x44')](_0x36b8('0xae'),_0x3f7c6a['CmListId'][_0x36b8('0x87')]())[_0x36b8('0x44')](_0x36b8('0xa8'))[_0x36b8('0x44')](_0x36b8('0xa9'),squel[_0x36b8('0x80')]()[_0x36b8('0xa5')]('COALESCE(phone,\x27\x27)')[_0x36b8('0x82')](_0x36b8('0x9e'))['where'](_0x36b8('0x85'),_0x16295f['params']['id'][_0x36b8('0x87')]())))[_0x36b8('0x87')]();break;default:_0x10422a=squel[_0x36b8('0x9c')]()[_0x36b8('0x9d')](_0x36b8('0x9e'))['fromQuery']([_0x36b8('0xa0'),_0x36b8('0xa4'),_0x36b8('0xa1'),_0x36b8('0xa2'),'VoiceQueueId',_0x36b8('0x5a'),_0x36b8('0x5b')],squel[_0x36b8('0x80')]()['field'](_0x36b8('0xa0'),'phone')[_0x36b8('0xa5')](_0x36b8('0xa3'),'scheduledAt')['field']('id',_0x36b8('0xa1'))[_0x36b8('0xa5')](_0x3f7c6a['CmListId'][_0x36b8('0x87')](),'ListId')['field'](_0x16295f[_0x36b8('0x4f')]['id'][_0x36b8('0x87')](),'VoiceQueueId')[_0x36b8('0xa5')](_0x36b8('0xa3'),_0x36b8('0x5a'))[_0x36b8('0xa5')]('NOW()',_0x36b8('0x5b'))[_0x36b8('0x82')](_0x36b8('0xa7'))[_0x36b8('0x44')](_0x36b8('0xad'))[_0x36b8('0x44')](_0x36b8('0xae'),_0x3f7c6a['CmListId'][_0x36b8('0x87')]())[_0x36b8('0x44')](_0x36b8('0xa8')))[_0x36b8('0x87')]();}_0x6704fd[_0x36b8('0x86')](db[_0x36b8('0x76')][_0x36b8('0x3b')](_0x10422a));}return BPromise['all'](_0x6704fd);}})[_0x36b8('0x26')](function(){return _0x32410d;})[_0x36b8('0x26')](respondWithResult(_0x10a74b,null))[_0x36b8('0x4d')](handleError(_0x10a74b,null));};exports[_0x36b8('0xaf')]=function(_0x128085,_0x5981ac,_0x3f98bf){return db[_0x36b8('0x4a')][_0x36b8('0x31')]({'where':{'id':_0x128085['params']['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x5981ac,null))[_0x36b8('0x26')](function(_0x3ceaae){if(_0x3ceaae){return _0x3ceaae[_0x36b8('0xaf')](_0x128085['query']['ids']);}})[_0x36b8('0x26')](function(_0x4eab37){if(_0x4eab37){return db[_0x36b8('0x63')][_0x36b8('0x27')]({'where':{'ListId':_0x128085[_0x36b8('0x3b')][_0x36b8('0x7f')],'VoiceQueueId':_0x128085[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](function(){return _0x4eab37;});}})[_0x36b8('0x26')](respondWithStatusCode(_0x5981ac,null))[_0x36b8('0x4d')](handleError(_0x5981ac,null));};exports[_0x36b8('0xb0')]=function(_0x4bc50b,_0x108ff3,_0x361afb){var _0x25f51e={};var _0x52f84a={};var _0x469368;var _0x49d980;return db['VoiceQueue'][_0x36b8('0x60')]({'where':{'id':_0x4bc50b[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x108ff3,null))[_0x36b8('0x26')](function(_0x11c93f){if(_0x11c93f){_0x469368=_0x11c93f;_0x52f84a['model']=_[_0x36b8('0x3a')](db['CmList']['rawAttributes']);_0x52f84a[_0x36b8('0x3b')]=_[_0x36b8('0x3a')](_0x4bc50b[_0x36b8('0x3b')]);_0x52f84a[_0x36b8('0x3c')]=_[_0x36b8('0x3d')](_0x52f84a[_0x36b8('0x39')],_0x52f84a[_0x36b8('0x3b')]);_0x25f51e[_0x36b8('0x3e')]=_['intersection'](_0x52f84a[_0x36b8('0x39')],qs[_0x36b8('0x3f')](_0x4bc50b[_0x36b8('0x3b')][_0x36b8('0x3f')]));_0x25f51e['attributes']=_0x25f51e[_0x36b8('0x3e')][_0x36b8('0x50')]?_0x25f51e[_0x36b8('0x3e')]:_0x52f84a[_0x36b8('0x39')];_0x25f51e[_0x36b8('0x42')]=qs[_0x36b8('0x43')](_0x4bc50b[_0x36b8('0x3b')][_0x36b8('0x43')]);_0x25f51e[_0x36b8('0x44')]=qs['filters'](_[_0x36b8('0x61')](_0x4bc50b['query'],_0x52f84a[_0x36b8('0x3c')]));if(_0x4bc50b[_0x36b8('0x3b')][_0x36b8('0x2c')]){_0x25f51e[_0x36b8('0x44')]=_[_0x36b8('0x45')](_0x25f51e['where'],{'$or':_['map'](_0x25f51e[_0x36b8('0x3e')],function(_0x4b07d4){var _0x3615c3={};_0x3615c3[_0x4b07d4]={'$like':'%'+_0x4bc50b['query'][_0x36b8('0x2c')]+'%'};return _0x3615c3;})});}_0x25f51e=_[_0x36b8('0x45')]({},_0x25f51e,_0x4bc50b[_0x36b8('0x47')]);return _0x469368['getBlackLists'](_0x25f51e);}})['then'](function(_0x2e31b3){if(_0x2e31b3){_0x49d980=_0x2e31b3['length'];if(!_0x4bc50b[_0x36b8('0x3b')][_0x36b8('0x40')]('nolimit')){_0x25f51e[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x4bc50b['query'][_0x36b8('0x1e')]);_0x25f51e[_0x36b8('0x20')]=qs[_0x36b8('0x20')](_0x4bc50b[_0x36b8('0x3b')]['offset']);}return _0x469368[_0x36b8('0xb0')](_0x25f51e);}})[_0x36b8('0x26')](function(_0x31a3d4){if(_0x31a3d4){return _0x31a3d4?{'count':_0x49d980,'rows':_0x31a3d4}:null;}})['then'](respondWithResult(_0x108ff3,null))[_0x36b8('0x4d')](handleError(_0x108ff3,null));};exports[_0x36b8('0xb1')]=function(_0x1a49b0,_0x3ce4aa,_0x1bce96){var _0x9f1143,_0x490026;return db[_0x36b8('0x4a')]['find']({'where':{'id':_0x1a49b0[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x3ce4aa,null))[_0x36b8('0x26')](function(_0x2823e9){if(_0x2823e9){_0x490026=_0x2823e9;return _0x2823e9[_0x36b8('0xb1')](_0x1a49b0[_0x36b8('0x52')][_0x36b8('0x7f')],_[_0x36b8('0x5c')](_0x1a49b0[_0x36b8('0x52')],[_0x36b8('0x7f'),'id'])||{});}return null;})['spread'](function(_0x225373){var _0x38fbba;_0x9f1143=_0x225373||[];var _0x9e22c4=[];if(_0x225373){for(var _0x3511b9=0x0;_0x3511b9<_0x225373[_0x36b8('0x50')];_0x3511b9+=0x1){var _0x2b1274=_0x225373[_0x3511b9][_0x36b8('0x28')]({'plain':!![]});_0x38fbba=squel[_0x36b8('0x9c')]()[_0x36b8('0x9d')](_0x36b8('0xb2'))['fromQuery']([_0x36b8('0xa0'),_0x36b8('0xa1'),_0x36b8('0xa2'),_0x36b8('0x62'),_0x36b8('0x5a'),_0x36b8('0x5b')],squel[_0x36b8('0x80')]()[_0x36b8('0xa5')]('phone',_0x36b8('0xa0'))[_0x36b8('0xa5')]('id',_0x36b8('0xa1'))[_0x36b8('0xa5')](_0x2b1274['CmListId'][_0x36b8('0x87')](),_0x36b8('0xa2'))[_0x36b8('0xa5')](_0x1a49b0[_0x36b8('0x4f')]['id'][_0x36b8('0x87')](),_0x36b8('0x62'))['field']('NOW()','createdAt')['field'](_0x36b8('0xa3'),_0x36b8('0x5b'))['from']('cm_contacts')[_0x36b8('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x36b8('0xae'),_0x2b1274[_0x36b8('0xa6')][_0x36b8('0x87')]())[_0x36b8('0x44')](_0x36b8('0xa8')))[_0x36b8('0x87')]();_0x9e22c4[_0x36b8('0x86')](db[_0x36b8('0x76')][_0x36b8('0x3b')](_0x38fbba));}return BPromise['all'](_0x9e22c4);}})[_0x36b8('0x26')](function(){return _0x9f1143;})[_0x36b8('0x26')](respondWithResult(_0x3ce4aa,null))[_0x36b8('0x4d')](handleError(_0x3ce4aa,null));};exports['removeBlackLists']=function(_0x439cc2,_0x768e8c,_0x1e115b){return db['VoiceQueue'][_0x36b8('0x31')]({'where':{'id':_0x439cc2[_0x36b8('0x4f')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x768e8c,null))[_0x36b8('0x26')](function(_0x57126a){if(_0x57126a){return _0x57126a['removeBlackLists'](_0x439cc2[_0x36b8('0x3b')][_0x36b8('0x7f')]);}})[_0x36b8('0x26')](function(_0x16b3ef){if(_0x16b3ef){return db[_0x36b8('0x69')][_0x36b8('0x27')]({'where':{'ListId':_0x439cc2[_0x36b8('0x3b')][_0x36b8('0x7f')],'VoiceQueueId':_0x439cc2['params']['id']}})[_0x36b8('0x26')](function(){return _0x16b3ef;});}})[_0x36b8('0x26')](respondWithStatusCode(_0x768e8c,null))[_0x36b8('0x4d')](handleError(_0x768e8c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 1f389ad..c81eb7d 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 _0xc75c=['hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','save','update','remove','emit'];(function(_0x216691,_0x2a6a12){var _0x400215=function(_0x49d945){while(--_0x49d945){_0x216691['push'](_0x216691['shift']());}};_0x400215(++_0x2a6a12);}(_0xc75c,0xb7));var _0xcc75=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0xc75c[_0x3e9ef3];return _0x333748;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xcc75('0x0'))['db'][_0xcc75('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc75('0x2'),'afterUpdate':_0xcc75('0x3'),'afterDestroy':_0xcc75('0x4')};function emitEvent(_0x59a50e){return function(_0x41ee75,_0x5506b3,_0x6f3620){VoiceQueueEvents[_0xcc75('0x5')](_0x59a50e+':'+_0x41ee75['id'],_0x41ee75);VoiceQueueEvents['emit'](_0x59a50e,_0x41ee75);_0x6f3620(null);};}for(var e in events){if(events[_0xcc75('0x6')](e)){var event=events[e];VoiceQueue[_0xcc75('0x7')](e,emitEvent(event));}}module[_0xcc75('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x1aae=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0x1aae,0x13b));var _0xe1aa=function(_0x344aa4,_0x188039){_0x344aa4=_0x344aa4-0x0;var _0x500d82=_0x1aae[_0x344aa4];return _0x500d82;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xe1aa('0x0'))['db'][_0xe1aa('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe1aa('0x2')](0x0);var events={'afterCreate':_0xe1aa('0x3'),'afterUpdate':_0xe1aa('0x4'),'afterDestroy':_0xe1aa('0x5')};function emitEvent(_0x586986){return function(_0x25acbf,_0x2d8366,_0x40b590){VoiceQueueEvents['emit'](_0x586986+':'+_0x25acbf['id'],_0x25acbf);VoiceQueueEvents[_0xe1aa('0x6')](_0x586986,_0x25acbf);_0x40b590(null);};}for(var e in events){if(events[_0xe1aa('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xe1aa('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e1f3269..c4e4c97 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x4610f6,_0x5fe8c3){var _0x422a4d=function(_0x31f4c8){while(--_0x31f4c8){_0x4610f6['push'](_0x4610f6['shift']());}};_0x422a4d(++_0x5fe8c3);}(_0x3e74,0x175));var _0x43e7=function(_0x368966,_0x4d3415){_0x368966=_0x368966-0x0;var _0x23cbcc=_0x3e74[_0x368966];return _0x23cbcc;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x7440e0,_0x42d9b8){var _0x33ee99=function(_0x3edb33){while(--_0x3edb33){_0x7440e0['push'](_0x7440e0['shift']());}};_0x33ee99(++_0x42d9b8);}(_0x008c,0x188));var _0xc008=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0x008c[_0x3f4a8e];return _0x7f68fd;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index c159076..06d7626 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 _0x0a54=['defaults','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','raw','where','attributes','limit','map','model','include','GetVoiceQueue','catch','ShowVoiceQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4de401,_0xf81093){var _0x31571e=function(_0x1487fe){while(--_0x1487fe){_0x4de401['push'](_0x4de401['shift']());}};_0x31571e(++_0xf81093);}(_0x0a54,0x92));var _0x40a5=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x0a54[_0x531cb8];return _0x5cf297;};'use strict';var _=require('lodash');var util=require(_0x40a5('0x0'));var moment=require(_0x40a5('0x1'));var BPromise=require(_0x40a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40a5('0x3'));var db=require(_0x40a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x40a5('0x5'))(_0x40a5('0x6'));var config=require(_0x40a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x40a5('0x8')][_0x40a5('0x9')]({'port':0x232a});config['redis']=_[_0x40a5('0xa')](config['redis'],{'host':_0x40a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x40a5('0xc'))['register'](socket);function respondWithRpcPromise(_0x2adcef,_0x2988ae,_0x2cb1a7){return new BPromise(function(_0x5e79df,_0x5d0f6b){return client[_0x40a5('0xd')](_0x2adcef,_0x2cb1a7)[_0x40a5('0xe')](function(_0x536b3f){logger[_0x40a5('0xf')](_0x40a5('0x10'),_0x2988ae,_0x40a5('0x11'));logger[_0x40a5('0x12')](_0x40a5('0x13'),_0x2988ae,_0x40a5('0x11'),JSON[_0x40a5('0x14')](_0x536b3f));if(_0x536b3f[_0x40a5('0x15')]){if(_0x536b3f[_0x40a5('0x15')][_0x40a5('0x16')]===0x1f4){logger[_0x40a5('0x15')](_0x40a5('0x10'),_0x2988ae,_0x536b3f[_0x40a5('0x15')][_0x40a5('0x17')]);return _0x5d0f6b(_0x536b3f['error'][_0x40a5('0x17')]);}logger[_0x40a5('0x15')](_0x40a5('0x10'),_0x2988ae,_0x536b3f[_0x40a5('0x15')][_0x40a5('0x17')]);return _0x5e79df(_0x536b3f['error'][_0x40a5('0x17')]);}else{logger['info'](_0x40a5('0x10'),_0x2988ae,_0x40a5('0x11'));_0x5e79df(_0x536b3f[_0x40a5('0x18')][_0x40a5('0x17')]);}})['catch'](function(_0x1867ce){logger[_0x40a5('0x15')](_0x40a5('0x10'),_0x2988ae,_0x1867ce);_0x5d0f6b(_0x1867ce);});});}exports['GetVoiceQueue']=function(_0x163c35){var _0x2ead05=this;return new Promise(function(_0x433ff1,_0x4effeb){return db[_0x40a5('0x19')][_0x40a5('0x1a')]({'raw':_0x163c35[_0x40a5('0x1b')]?_0x163c35[_0x40a5('0x1b')][_0x40a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x163c35[_0x40a5('0x1b')]?_0x163c35[_0x40a5('0x1b')][_0x40a5('0x1d')]||null:null,'attributes':_0x163c35['options']?_0x163c35[_0x40a5('0x1b')][_0x40a5('0x1e')]||null:null,'limit':_0x163c35[_0x40a5('0x1b')]?_0x163c35['options'][_0x40a5('0x1f')]||null:null,'include':_0x163c35[_0x40a5('0x1b')]?_0x163c35['options']['include']?_[_0x40a5('0x20')](_0x163c35[_0x40a5('0x1b')]['include'],function(_0x263256){return{'model':db[_0x263256[_0x40a5('0x21')]],'as':_0x263256['as'],'attributes':_0x263256['attributes'],'include':_0x263256[_0x40a5('0x22')]?_[_0x40a5('0x20')](_0x263256[_0x40a5('0x22')],function(_0x2dba65){return{'model':db[_0x2dba65[_0x40a5('0x21')]],'as':_0x2dba65['as'],'attributes':_0x2dba65[_0x40a5('0x1e')],'include':_0x2dba65['include']?_['map'](_0x2dba65['include'],function(_0x133df0){return{'model':db[_0x133df0[_0x40a5('0x21')]],'as':_0x133df0['as'],'attributes':_0x133df0[_0x40a5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39a531){logger[_0x40a5('0xf')](_0x40a5('0x23'),_0x163c35);logger[_0x40a5('0x12')](_0x40a5('0x23'),_0x163c35,JSON[_0x40a5('0x14')](_0x39a531));_0x433ff1(_0x39a531);})[_0x40a5('0x24')](function(_0x54180b){logger[_0x40a5('0x15')](_0x40a5('0x23'),_0x54180b[_0x40a5('0x17')],_0x163c35);_0x4effeb(_0x2ead05[_0x40a5('0x15')](0x1f4,_0x54180b[_0x40a5('0x17')]));});});};exports[_0x40a5('0x25')]=function(_0x623100){var _0xb39b8=this;return new Promise(function(_0x35206d,_0x9bb594){return db[_0x40a5('0x19')][_0x40a5('0x26')]({'raw':_0x623100['options']?_0x623100[_0x40a5('0x1b')][_0x40a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x623100[_0x40a5('0x1b')]?_0x623100[_0x40a5('0x1b')]['where']||null:null,'attributes':_0x623100['options']?_0x623100[_0x40a5('0x1b')][_0x40a5('0x1e')]||null:null,'include':_0x623100[_0x40a5('0x1b')]?_0x623100['options']['include']?_[_0x40a5('0x20')](_0x623100[_0x40a5('0x1b')][_0x40a5('0x22')],function(_0x45b92a){return{'model':db[_0x45b92a[_0x40a5('0x21')]],'as':_0x45b92a['as'],'attributes':_0x45b92a[_0x40a5('0x1e')],'include':_0x45b92a[_0x40a5('0x22')]?_['map'](_0x45b92a[_0x40a5('0x22')],function(_0x304bfc){return{'model':db[_0x304bfc[_0x40a5('0x21')]],'as':_0x304bfc['as'],'attributes':_0x304bfc[_0x40a5('0x1e')],'include':_0x304bfc[_0x40a5('0x22')]?_[_0x40a5('0x20')](_0x304bfc[_0x40a5('0x22')],function(_0x3db044){return{'model':db[_0x3db044[_0x40a5('0x21')]],'as':_0x3db044['as'],'attributes':_0x3db044[_0x40a5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x40a5('0xe')](function(_0x71ebe1){logger[_0x40a5('0xf')](_0x40a5('0x25'),_0x623100);logger[_0x40a5('0x12')](_0x40a5('0x25'),_0x623100,JSON[_0x40a5('0x14')](_0x71ebe1));_0x35206d(_0x71ebe1);})[_0x40a5('0x24')](function(_0x13c929){logger[_0x40a5('0x15')]('ShowVoiceQueue',_0x13c929[_0x40a5('0x17')],_0x623100);_0x9bb594(_0xb39b8[_0x40a5('0x15')](0x1f4,_0x13c929[_0x40a5('0x17')]));});});}; \ No newline at end of file +var _0xc3db=['util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowVoiceQueue','find','lodash'];(function(_0x5918e6,_0x534b4d){var _0x59d078=function(_0xb6489){while(--_0xb6489){_0x5918e6['push'](_0x5918e6['shift']());}};_0x59d078(++_0x534b4d);}(_0xc3db,0xb3));var _0xbc3d=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xc3db[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xbc3d('0x0'));var util=require(_0xbc3d('0x1'));var moment=require('moment');var BPromise=require(_0xbc3d('0x2'));var rs=require(_0xbc3d('0x3'));var fs=require('fs');var Redis=require(_0xbc3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc3d('0x5'));var config=require(_0xbc3d('0x6'));var jayson=require(_0xbc3d('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc3d('0x8')]=_['defaults'](config[_0xbc3d('0x8')],{'host':_0xbc3d('0x9'),'port':0x18eb});var socket=require(_0xbc3d('0xa'))(new Redis(config[_0xbc3d('0x8')]));require(_0xbc3d('0xb'))['register'](socket);function respondWithRpcPromise(_0x28f52a,_0x441f91,_0x5323d8){return new BPromise(function(_0x24466d,_0x17ed79){return client[_0xbc3d('0xc')](_0x28f52a,_0x5323d8)['then'](function(_0x1178d6){logger[_0xbc3d('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x441f91,'request\x20sent');logger[_0xbc3d('0xe')](_0xbc3d('0xf'),_0x441f91,_0xbc3d('0x10'),JSON[_0xbc3d('0x11')](_0x1178d6));if(_0x1178d6[_0xbc3d('0x12')]){if(_0x1178d6[_0xbc3d('0x12')]['code']===0x1f4){logger['error'](_0xbc3d('0x13'),_0x441f91,_0x1178d6[_0xbc3d('0x12')][_0xbc3d('0x14')]);return _0x17ed79(_0x1178d6[_0xbc3d('0x12')][_0xbc3d('0x14')]);}logger['error'](_0xbc3d('0x13'),_0x441f91,_0x1178d6[_0xbc3d('0x12')][_0xbc3d('0x14')]);return _0x24466d(_0x1178d6[_0xbc3d('0x12')][_0xbc3d('0x14')]);}else{logger['info'](_0xbc3d('0x13'),_0x441f91,_0xbc3d('0x10'));_0x24466d(_0x1178d6[_0xbc3d('0x15')]['message']);}})[_0xbc3d('0x16')](function(_0x1f6837){logger[_0xbc3d('0x12')](_0xbc3d('0x13'),_0x441f91,_0x1f6837);_0x17ed79(_0x1f6837);});});}exports[_0xbc3d('0x17')]=function(_0x1c359a){var _0x2e7bf0=this;return new Promise(function(_0x56b9b2,_0x410be5){return db[_0xbc3d('0x18')][_0xbc3d('0x19')]({'raw':_0x1c359a[_0xbc3d('0x1a')]?_0x1c359a[_0xbc3d('0x1a')][_0xbc3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c359a[_0xbc3d('0x1a')]?_0x1c359a['options']['where']||null:null,'attributes':_0x1c359a[_0xbc3d('0x1a')]?_0x1c359a[_0xbc3d('0x1a')][_0xbc3d('0x1c')]||null:null,'limit':_0x1c359a[_0xbc3d('0x1a')]?_0x1c359a[_0xbc3d('0x1a')][_0xbc3d('0x1d')]||null:null,'include':_0x1c359a['options']?_0x1c359a['options'][_0xbc3d('0x1e')]?_[_0xbc3d('0x1f')](_0x1c359a['options'][_0xbc3d('0x1e')],function(_0x28705b){return{'model':db[_0x28705b[_0xbc3d('0x20')]],'as':_0x28705b['as'],'attributes':_0x28705b[_0xbc3d('0x1c')],'include':_0x28705b['include']?_[_0xbc3d('0x1f')](_0x28705b[_0xbc3d('0x1e')],function(_0x395327){return{'model':db[_0x395327[_0xbc3d('0x20')]],'as':_0x395327['as'],'attributes':_0x395327['attributes'],'include':_0x395327[_0xbc3d('0x1e')]?_[_0xbc3d('0x1f')](_0x395327[_0xbc3d('0x1e')],function(_0x3ab827){return{'model':db[_0x3ab827[_0xbc3d('0x20')]],'as':_0x3ab827['as'],'attributes':_0x3ab827[_0xbc3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbc3d('0x21')](function(_0x259736){logger['info'](_0xbc3d('0x17'),_0x1c359a);logger[_0xbc3d('0xe')](_0xbc3d('0x17'),_0x1c359a,JSON[_0xbc3d('0x11')](_0x259736));_0x56b9b2(_0x259736);})[_0xbc3d('0x16')](function(_0x3217fd){logger['error'](_0xbc3d('0x17'),_0x3217fd[_0xbc3d('0x14')],_0x1c359a);_0x410be5(_0x2e7bf0[_0xbc3d('0x12')](0x1f4,_0x3217fd[_0xbc3d('0x14')]));});});};exports[_0xbc3d('0x22')]=function(_0x15f611){var _0x5a5f3b=this;return new Promise(function(_0x3cc01d,_0x96dfb5){return db[_0xbc3d('0x18')][_0xbc3d('0x23')]({'raw':_0x15f611[_0xbc3d('0x1a')]?_0x15f611[_0xbc3d('0x1a')][_0xbc3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x15f611['options']?_0x15f611['options']['where']||null:null,'attributes':_0x15f611[_0xbc3d('0x1a')]?_0x15f611['options'][_0xbc3d('0x1c')]||null:null,'include':_0x15f611[_0xbc3d('0x1a')]?_0x15f611[_0xbc3d('0x1a')][_0xbc3d('0x1e')]?_['map'](_0x15f611[_0xbc3d('0x1a')]['include'],function(_0x563fb1){return{'model':db[_0x563fb1[_0xbc3d('0x20')]],'as':_0x563fb1['as'],'attributes':_0x563fb1[_0xbc3d('0x1c')],'include':_0x563fb1['include']?_[_0xbc3d('0x1f')](_0x563fb1['include'],function(_0x4f52b9){return{'model':db[_0x4f52b9[_0xbc3d('0x20')]],'as':_0x4f52b9['as'],'attributes':_0x4f52b9[_0xbc3d('0x1c')],'include':_0x4f52b9[_0xbc3d('0x1e')]?_['map'](_0x4f52b9[_0xbc3d('0x1e')],function(_0x512da4){return{'model':db[_0x512da4[_0xbc3d('0x20')]],'as':_0x512da4['as'],'attributes':_0x512da4[_0xbc3d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12eb12){logger['info'](_0xbc3d('0x22'),_0x15f611);logger[_0xbc3d('0xe')](_0xbc3d('0x22'),_0x15f611,JSON[_0xbc3d('0x11')](_0x12eb12));_0x3cc01d(_0x12eb12);})[_0xbc3d('0x16')](function(_0xb81ac){logger[_0xbc3d('0x12')](_0xbc3d('0x22'),_0xb81ac[_0xbc3d('0x14')],_0x15f611);_0x96dfb5(_0x5a5f3b[_0xbc3d('0x12')](0x1f4,_0xb81ac[_0xbc3d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7546f52..3dd7186 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 _0xc576=['removeListener','register','length','./voiceQueue.events','save','remove','update'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xc576,0x8f));var _0x6c57=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0xc576[_0x47f719];return _0x407f4e;};'use strict';var VoiceQueueEvents=require(_0x6c57('0x0'));var events=[_0x6c57('0x1'),_0x6c57('0x2'),_0x6c57('0x3')];function createListener(_0x3625fa,_0x45b107){return function(_0x4f01b4){_0x45b107['emit'](_0x3625fa,_0x4f01b4);};}function removeListener(_0x115443,_0x56b7ac){return function(){VoiceQueueEvents[_0x6c57('0x4')](_0x115443,_0x56b7ac);};}exports[_0x6c57('0x5')]=function(_0x278ccb){for(var _0x1c1098=0x0,_0x1eab94=events[_0x6c57('0x6')];_0x1c1098<_0x1eab94;_0x1c1098++){var _0x406062=events[_0x1c1098];var _0x1e1f94=createListener('voiceQueue:'+_0x406062,_0x278ccb);VoiceQueueEvents['on'](_0x406062,_0x1e1f94);}}; \ No newline at end of file +var _0x7e3a=['emit','removeListener','register','length','voiceQueue:','save','remove','update'];(function(_0x8104e9,_0x1820d1){var _0x316db6=function(_0x126e00){while(--_0x126e00){_0x8104e9['push'](_0x8104e9['shift']());}};_0x316db6(++_0x1820d1);}(_0x7e3a,0x1a5));var _0xa7e3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7e3a[_0x5b644e];return _0x49c6bf;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xa7e3('0x0'),_0xa7e3('0x1'),_0xa7e3('0x2')];function createListener(_0x20d74b,_0xb0e58d){return function(_0x5c9081){_0xb0e58d[_0xa7e3('0x3')](_0x20d74b,_0x5c9081);};}function removeListener(_0xc6410,_0x2f41f9){return function(){VoiceQueueEvents[_0xa7e3('0x4')](_0xc6410,_0x2f41f9);};}exports[_0xa7e3('0x5')]=function(_0x2a5ffe){for(var _0x40d266=0x0,_0x169007=events[_0xa7e3('0x6')];_0x40d266<_0x169007;_0x40d266++){var _0x1cf69c=events[_0x40d266];var _0x4701c9=createListener(_0xa7e3('0x7')+_0x1cf69c,_0x2a5ffe);VoiceQueueEvents['on'](_0x1cf69c,_0x4701c9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index cea43b6..2d86f5a 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 _0x57b7=['../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1155fe,_0xe21c80){var _0x5aa832=function(_0x5caae5){while(--_0x5caae5){_0x1155fe['push'](_0x1155fe['shift']());}};_0x5aa832(++_0xe21c80);}(_0x57b7,0x1c0));var _0x757b=function(_0x204602,_0x586b52){_0x204602=_0x204602-0x0;var _0x31751f=_0x57b7[_0x204602];return _0x31751f;};'use strict';var multer=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var path=require(_0x757b('0x2'));var timeout=require(_0x757b('0x3'));var express=require(_0x757b('0x4'));var router=express[_0x757b('0x5')]();var fs_extra=require(_0x757b('0x6'));var auth=require(_0x757b('0x7'));var interaction=require(_0x757b('0x8'));var config=require('../../config/environment');var controller=require(_0x757b('0x9'));router[_0x757b('0xa')]('/',auth[_0x757b('0xb')](),controller[_0x757b('0xc')]);router[_0x757b('0xa')](_0x757b('0xd'),auth[_0x757b('0xb')](),controller[_0x757b('0xe')]);router[_0x757b('0xa')](_0x757b('0xf'),auth[_0x757b('0xb')](),controller[_0x757b('0x10')]);router[_0x757b('0xa')](_0x757b('0x11'),auth['isAuthenticated'](),controller['show']);router[_0x757b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x757b('0x13')](_0x757b('0x11'),auth[_0x757b('0xb')](),controller[_0x757b('0x14')]);router[_0x757b('0x15')]('/:id',auth[_0x757b('0xb')](),controller[_0x757b('0x16')]);module[_0x757b('0x17')]=router; \ No newline at end of file +var _0xa12b=['getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xa12b,0x1ea));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xba12('0x0'));var timeout=require(_0xba12('0x1'));var express=require(_0xba12('0x2'));var router=express[_0xba12('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xba12('0x4'));var interaction=require(_0xba12('0x5'));var config=require(_0xba12('0x6'));var controller=require(_0xba12('0x7'));router[_0xba12('0x8')]('/',auth[_0xba12('0x9')](),controller[_0xba12('0xa')]);router[_0xba12('0x8')](_0xba12('0xb'),auth['isAuthenticated'](),controller[_0xba12('0xc')]);router['get'](_0xba12('0xd'),auth[_0xba12('0x9')](),controller[_0xba12('0xe')]);router[_0xba12('0x8')](_0xba12('0xf'),auth[_0xba12('0x9')](),controller[_0xba12('0x10')]);router[_0xba12('0x11')]('/',auth[_0xba12('0x9')](),controller[_0xba12('0x12')]);router[_0xba12('0x13')](_0xba12('0xf'),auth[_0xba12('0x9')](),controller[_0xba12('0x14')]);router[_0xba12('0x15')]('/:id',auth[_0xba12('0x9')](),controller[_0xba12('0x16')]);module[_0xba12('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d387872..0db7f1f 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 _0x0417=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x15a2d2,_0x5e796d){var _0x43e918=function(_0x2c2471){while(--_0x2c2471){_0x15a2d2['push'](_0x15a2d2['shift']());}};_0x43e918(++_0x5e796d);}(_0x0417,0x1f0));var _0x7041=function(_0x590371,_0x1b2c96){_0x590371=_0x590371-0x0;var _0x4e830f=_0x0417[_0x590371];return _0x4e830f;};'use strict';var Sequelize=require(_0x7041('0x0'));var moment=require(_0x7041('0x1'));module[_0x7041('0x2')]={'type':{'type':Sequelize[_0x7041('0x3')]},'uniqueid':{'type':Sequelize[_0x7041('0x3')]},'calleridnum':{'type':Sequelize[_0x7041('0x3')]},'calleridname':{'type':Sequelize[_0x7041('0x3')]},'queue':{'type':Sequelize[_0x7041('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x7041('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x7041('0x4')],'set':function(_0x27e860){var _0x3f49a0=moment(_0x27e860);var _0x153c89=moment(this[_0x7041('0x5')]('queuecallerjoinAt'))[_0x7041('0x6')](_0x7041('0x7'));var _0x5bb83e=_0x3f49a0['diff'](_0x153c89,_0x7041('0x8'));this[_0x7041('0x9')](_0x7041('0xa'),_0x27e860);this[_0x7041('0x9')](_0x7041('0xb'),_0x5bb83e||null);}},'position':{'type':Sequelize[_0x7041('0xc')]},'count':{'type':Sequelize[_0x7041('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x7041('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7041('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x7041('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7041('0x4')]},'queuecallerexit':{'type':Sequelize[_0x7041('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7041('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x7041('0x3')],'comment':_0x7041('0xe')},'originalposition':{'type':Sequelize[_0x7041('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7041('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7041('0x3')]},'exten':{'type':Sequelize[_0x7041('0x3')]},'priority':{'type':Sequelize[_0x7041('0x3')]},'holdtime':{'type':Sequelize[_0x7041('0xc')]},'mohtime':{'type':Sequelize[_0x7041('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7041('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x7041('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7041('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7041('0x3')]},'disposition':{'type':Sequelize[_0x7041('0x3')]},'secondDisposition':{'type':Sequelize[_0x7041('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7041('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7041('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5dcc=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x31ea65,_0x542e03){var _0x1173b3=function(_0x3b0121){while(--_0x3b0121){_0x31ea65['push'](_0x31ea65['shift']());}};_0x1173b3(++_0x542e03);}(_0x5dcc,0x113));var _0xc5dc=function(_0x583a1b,_0x244e4a){_0x583a1b=_0x583a1b-0x0;var _0xdc083e=_0x5dcc[_0x583a1b];return _0xdc083e;};'use strict';var Sequelize=require(_0xc5dc('0x0'));var moment=require(_0xc5dc('0x1'));module[_0xc5dc('0x2')]={'type':{'type':Sequelize[_0xc5dc('0x3')]},'uniqueid':{'type':Sequelize[_0xc5dc('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc5dc('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xc5dc('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xc5dc('0x4')],'set':function(_0x1bc7f2){var _0x244332=moment(_0x1bc7f2);var _0x21fdbd=moment(this[_0xc5dc('0x5')](_0xc5dc('0x6')))[_0xc5dc('0x7')](_0xc5dc('0x8'));var _0x47cf8c=_0x244332[_0xc5dc('0x9')](_0x21fdbd,_0xc5dc('0xa'));this[_0xc5dc('0xb')](_0xc5dc('0xc'),_0x1bc7f2);this[_0xc5dc('0xb')](_0xc5dc('0xd'),_0x47cf8c||null);}},'position':{'type':Sequelize[_0xc5dc('0xe')]},'count':{'type':Sequelize[_0xc5dc('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xc5dc('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xc5dc('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc5dc('0x4')]},'queuecallerexit':{'type':Sequelize[_0xc5dc('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xc5dc('0x3')],'comment':_0xc5dc('0x10')},'originalposition':{'type':Sequelize[_0xc5dc('0xe')]},'channel':{'type':Sequelize[_0xc5dc('0x3')]},'connectedlinenum':{'type':Sequelize[_0xc5dc('0x3')]},'connectedlinename':{'type':Sequelize[_0xc5dc('0x3')]},'accountcode':{'type':Sequelize[_0xc5dc('0x3')]},'context':{'type':Sequelize[_0xc5dc('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc5dc('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc5dc('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc5dc('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc5dc('0x3')]},'transfer':{'type':Sequelize[_0xc5dc('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc5dc('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc5dc('0x3')]},'transferuniqueid':{'type':Sequelize[_0xc5dc('0x3')]},'disposition':{'type':Sequelize[_0xc5dc('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc5dc('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xc5dc('0xe')],'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 c9b756d..b7faea3 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 _0x1f6f=['path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x47e50b,_0x1fdec6){var _0x2e6fb3=function(_0x5ceb3f){while(--_0x5ceb3f){_0x47e50b['push'](_0x47e50b['shift']());}};_0x2e6fb3(++_0x1fdec6);}(_0x1f6f,0x18c));var _0xf1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf1f6('0x0'));var rimraf=require(_0xf1f6('0x1'));var zipdir=require(_0xf1f6('0x2'));var jsonpatch=require(_0xf1f6('0x3'));var rp=require(_0xf1f6('0x4'));var moment=require(_0xf1f6('0x5'));var BPromise=require(_0xf1f6('0x6'));var Mustache=require(_0xf1f6('0x7'));var util=require(_0xf1f6('0x8'));var path=require(_0xf1f6('0x9'));var sox=require(_0xf1f6('0xa'));var csv=require('to-csv');var ejs=require(_0xf1f6('0xb'));var fs=require('fs');var fs_extra=require(_0xf1f6('0xc'));var _=require('lodash');var squel=require(_0xf1f6('0xd'));var crypto=require(_0xf1f6('0xe'));var jsforce=require(_0xf1f6('0xf'));var deskjs=require(_0xf1f6('0x10'));var toCsv=require(_0xf1f6('0x11'));var querystring=require(_0xf1f6('0x12'));var Papa=require(_0xf1f6('0x13'));var Redis=require('ioredis');var authService=require(_0xf1f6('0x14'));var qs=require(_0xf1f6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1f6('0x16'));var logger=require(_0xf1f6('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1f6('0x18'));var db=require(_0xf1f6('0x19'))['db'];config[_0xf1f6('0x1a')]=_[_0xf1f6('0x1b')](config[_0xf1f6('0x1a')],{'host':_0xf1f6('0x1c'),'port':0x18eb});var socket=require(_0xf1f6('0x1d'))(new Redis(config[_0xf1f6('0x1a')]));require(_0xf1f6('0x1e'))[_0xf1f6('0x1f')](socket);function respondWithStatusCode(_0x4186c6,_0x252e14){_0x252e14=_0x252e14||0xcc;return function(_0x2814bb){if(_0x2814bb){return _0x4186c6[_0xf1f6('0x20')](_0x252e14);}return _0x4186c6[_0xf1f6('0x21')](_0x252e14)['end']();};}function respondWithResult(_0x2424c9,_0x4ee81f){_0x4ee81f=_0x4ee81f||0xc8;return function(_0x597e62){if(_0x597e62){return _0x2424c9[_0xf1f6('0x21')](_0x4ee81f)[_0xf1f6('0x22')](_0x597e62);}};}function respondWithFilteredResult(_0x410cf9,_0xc9e966){return function(_0x382a0f){if(_0x382a0f){var _0x52ce49=typeof _0xc9e966[_0xf1f6('0x23')]===_0xf1f6('0x24')&&typeof _0xc9e966[_0xf1f6('0x25')]===_0xf1f6('0x24');var _0x340954=_0x382a0f[_0xf1f6('0x26')];var _0xe48b4c=_0x52ce49?0x0:_0xc9e966[_0xf1f6('0x23')];var _0x423932=_0x52ce49?_0x382a0f[_0xf1f6('0x26')]:_0xc9e966['offset']+_0xc9e966[_0xf1f6('0x25')];var _0x546d82;if(_0x423932>=_0x340954){_0x423932=_0x340954;_0x546d82=0xc8;}else{_0x546d82=0xce;}_0x410cf9[_0xf1f6('0x21')](_0x546d82);return _0x410cf9[_0xf1f6('0x27')](_0xf1f6('0x28'),_0xe48b4c+'-'+_0x423932+'/'+_0x340954)['json'](_0x382a0f);}return null;};}function patchUpdates(_0x3bdbe5){return function(_0x1021c8){try{jsonpatch['apply'](_0x1021c8,_0x3bdbe5,!![]);}catch(_0x55da9d){return BPromise[_0xf1f6('0x29')](_0x55da9d);}return _0x1021c8[_0xf1f6('0x2a')]();};}function saveUpdates(_0x21df2e,_0x1dc377){return function(_0x5991e9){if(_0x5991e9){return _0x5991e9[_0xf1f6('0x2b')](_0x21df2e)[_0xf1f6('0x2c')](function(_0x36062a){return _0x36062a;});}return null;};}function removeEntity(_0x5300ae,_0x4024a5){return function(_0x24b3c5){if(_0x24b3c5){return _0x24b3c5['destroy']()[_0xf1f6('0x2c')](function(){_0x5300ae[_0xf1f6('0x21')](0xcc)[_0xf1f6('0x2d')]();});}};}function handleEntityNotFound(_0x4f79b1,_0x2b4f22){return function(_0x35c9e2){if(!_0x35c9e2){_0x4f79b1[_0xf1f6('0x20')](0x194);}return _0x35c9e2;};}function handleError(_0x488fb5,_0x17c6e0){_0x17c6e0=_0x17c6e0||0x1f4;return function(_0x1a5646){logger['error'](_0x1a5646['stack']);if(_0x1a5646['name']){delete _0x1a5646['name'];}_0x488fb5[_0xf1f6('0x21')](_0x17c6e0)[_0xf1f6('0x2e')](_0x1a5646);};}exports[_0xf1f6('0x2f')]=function(_0x53f086,_0x5ce99c){var _0x43b431={},_0x2edc64={},_0x4711f9={'count':0x0,'rows':[]};var _0x5be5d5=_[_0xf1f6('0x30')](db['VoiceQueueReport'][_0xf1f6('0x31')],function(_0x163e93){return{'name':_0x163e93['fieldName'],'type':_0x163e93[_0xf1f6('0x32')][_0xf1f6('0x33')]};});_0x2edc64[_0xf1f6('0x34')]=_[_0xf1f6('0x30')](_0x5be5d5,_0xf1f6('0x35'));_0x2edc64[_0xf1f6('0x36')]=_[_0xf1f6('0x37')](_0x53f086[_0xf1f6('0x36')]);_0x2edc64[_0xf1f6('0x38')]=_[_0xf1f6('0x39')](_0x2edc64['model'],_0x2edc64[_0xf1f6('0x36')]);_0x43b431[_0xf1f6('0x3a')]=_[_0xf1f6('0x39')](_0x2edc64[_0xf1f6('0x34')],qs[_0xf1f6('0x3b')](_0x53f086['query']['fields']));_0x43b431[_0xf1f6('0x3a')]=_0x43b431[_0xf1f6('0x3a')][_0xf1f6('0x3c')]?_0x43b431[_0xf1f6('0x3a')]:_0x2edc64['model'];if(!_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x3d')]('nolimit')){_0x43b431[_0xf1f6('0x25')]=qs[_0xf1f6('0x25')](_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x25')]);_0x43b431['offset']=qs[_0xf1f6('0x23')](_0x53f086[_0xf1f6('0x36')]['offset']);}_0x43b431[_0xf1f6('0x3e')]=qs[_0xf1f6('0x3f')](_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x3f')]);_0x43b431[_0xf1f6('0x40')]=qs['filters'](_[_0xf1f6('0x41')](_0x53f086[_0xf1f6('0x36')],_0x2edc64[_0xf1f6('0x38')]),_0x5be5d5);if(_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x42')]){_0x43b431[_0xf1f6('0x40')]=_[_0xf1f6('0x43')](_0x43b431[_0xf1f6('0x40')],{'$or':_[_0xf1f6('0x30')](_0x5be5d5,function(_0x3c8e4b){if(_0x3c8e4b[_0xf1f6('0x32')]!=='VIRTUAL'){var _0x88550d={};_0x88550d[_0x3c8e4b[_0xf1f6('0x35')]]={'$like':'%'+_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x42')]+'%'};return _0x88550d;}})});}_0x43b431=_['merge']({},_0x43b431,_0x53f086['options']);var _0x5adcfa={'where':_0x43b431['where']};return db[_0xf1f6('0x44')][_0xf1f6('0x26')](_0x5adcfa)[_0xf1f6('0x2c')](function(_0xe3d9a6){_0x4711f9[_0xf1f6('0x26')]=_0xe3d9a6;if(_0x53f086[_0xf1f6('0x36')][_0xf1f6('0x45')]){_0x43b431[_0xf1f6('0x46')]=[{'all':!![]}];}return db[_0xf1f6('0x44')][_0xf1f6('0x47')](_0x43b431);})[_0xf1f6('0x2c')](function(_0x14ec97){_0x4711f9[_0xf1f6('0x48')]=_0x14ec97;return _0x4711f9;})[_0xf1f6('0x2c')](respondWithFilteredResult(_0x5ce99c,_0x43b431))[_0xf1f6('0x49')](handleError(_0x5ce99c,null));};exports[_0xf1f6('0x4a')]=function(_0x196538,_0x1f6d62){var _0x49edec={'raw':![],'where':{'id':_0x196538['params']['id']}},_0x127192={};_0x127192['model']=_['keys'](db[_0xf1f6('0x44')][_0xf1f6('0x31')]);_0x127192[_0xf1f6('0x36')]=_[_0xf1f6('0x37')](_0x196538['query']);_0x127192[_0xf1f6('0x38')]=_['intersection'](_0x127192[_0xf1f6('0x34')],_0x127192[_0xf1f6('0x36')]);_0x49edec[_0xf1f6('0x3a')]=_[_0xf1f6('0x39')](_0x127192[_0xf1f6('0x34')],qs[_0xf1f6('0x3b')](_0x196538['query'][_0xf1f6('0x3b')]));_0x49edec['attributes']=_0x49edec['attributes']['length']?_0x49edec[_0xf1f6('0x3a')]:_0x127192[_0xf1f6('0x34')];if(_0x196538[_0xf1f6('0x36')][_0xf1f6('0x45')]){_0x49edec[_0xf1f6('0x46')]=[{'all':!![]}];}_0x49edec=_[_0xf1f6('0x43')]({},_0x49edec,_0x196538[_0xf1f6('0x4b')]);return db[_0xf1f6('0x44')][_0xf1f6('0x4c')](_0x49edec)[_0xf1f6('0x2c')](handleEntityNotFound(_0x1f6d62,null))[_0xf1f6('0x2c')](respondWithResult(_0x1f6d62,null))[_0xf1f6('0x49')](handleError(_0x1f6d62,null));};exports[_0xf1f6('0x4d')]=function(_0x3f2fa6,_0x5f2da5){return db[_0xf1f6('0x44')]['create'](_0x3f2fa6[_0xf1f6('0x4e')],{})[_0xf1f6('0x2c')](respondWithResult(_0x5f2da5,0xc9))[_0xf1f6('0x49')](handleError(_0x5f2da5,null));};exports[_0xf1f6('0x2b')]=function(_0x3fd053,_0x46666){if(_0x3fd053[_0xf1f6('0x4e')]['id']){delete _0x3fd053['body']['id'];}return db[_0xf1f6('0x44')]['find']({'where':{'id':_0x3fd053['params']['id']}})[_0xf1f6('0x2c')](handleEntityNotFound(_0x46666,null))['then'](saveUpdates(_0x3fd053[_0xf1f6('0x4e')],null))['then'](respondWithResult(_0x46666,null))[_0xf1f6('0x49')](handleError(_0x46666,null));};exports['destroy']=function(_0x59bef5,_0x2fa57a){return db[_0xf1f6('0x44')][_0xf1f6('0x4c')]({'where':{'id':_0x59bef5[_0xf1f6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2fa57a,null))['then'](removeEntity(_0x2fa57a,null))[_0xf1f6('0x49')](handleError(_0x2fa57a,null));};exports['describe']=function(_0x4446ae,_0x33aa7b){return db[_0xf1f6('0x44')]['describe']()[_0xf1f6('0x2c')](respondWithResult(_0x33aa7b,null))[_0xf1f6('0x49')](handleError(_0x33aa7b,null));};exports[_0xf1f6('0x50')]=function(_0x339808,_0x3cf29d){var _0x28bda6={},_0x107eb3={},_0x1938d4={'count':0x0,'rows':[]};_0x107eb3[_0xf1f6('0x34')]=_[_0xf1f6('0x37')](db['VoiceQueueReport'][_0xf1f6('0x31')]);_0x107eb3[_0xf1f6('0x36')]=_['keys'](_0x339808[_0xf1f6('0x36')]);_0x107eb3[_0xf1f6('0x38')]=_[_0xf1f6('0x39')](_0x107eb3['model'],_0x107eb3['query']);_0x28bda6['attributes']=_[_0xf1f6('0x39')](_0x107eb3['model'],qs[_0xf1f6('0x3b')](_0x339808[_0xf1f6('0x36')][_0xf1f6('0x3b')]));_0x28bda6[_0xf1f6('0x3a')]=_0x28bda6[_0xf1f6('0x3a')][_0xf1f6('0x3c')]?_0x28bda6[_0xf1f6('0x3a')]:_0x107eb3[_0xf1f6('0x34')];if(!_0x339808['query'][_0xf1f6('0x3d')]('nolimit')){_0x28bda6['limit']=qs[_0xf1f6('0x25')](_0x339808[_0xf1f6('0x36')][_0xf1f6('0x25')]);_0x28bda6[_0xf1f6('0x23')]=qs[_0xf1f6('0x23')](_0x339808[_0xf1f6('0x36')][_0xf1f6('0x23')]);}_0x28bda6[_0xf1f6('0x3e')]=qs[_0xf1f6('0x3f')](_0x339808['query']['sort']);_0x28bda6['where']=qs['filters'](_[_0xf1f6('0x41')](_0x339808['query'],_0x107eb3[_0xf1f6('0x38')]));if(_0x339808[_0xf1f6('0x36')][_0xf1f6('0x42')]){_0x28bda6[_0xf1f6('0x40')]=_[_0xf1f6('0x43')](_0x28bda6[_0xf1f6('0x40')],{'$or':_['map'](_0x28bda6['attributes'],function(_0x11fe37){var _0x36d6e5={};_0x36d6e5[_0x11fe37]={'$like':'%'+_0x339808[_0xf1f6('0x36')]['filter']+'%'};return _0x36d6e5;})});}_0x28bda6=_[_0xf1f6('0x43')]({},_0x28bda6,_0x339808[_0xf1f6('0x4b')]);var _0x5bb64c={'where':_0x28bda6[_0xf1f6('0x40')]};return db[_0xf1f6('0x44')][_0xf1f6('0x26')](_0x5bb64c)[_0xf1f6('0x2c')](function(_0x1029bc){_0x1938d4['count']=_0x1029bc;if(_0x339808[_0xf1f6('0x36')][_0xf1f6('0x45')]){_0x28bda6['include']=[{'all':!![]}];}return db[_0xf1f6('0x44')][_0xf1f6('0x47')](_0x28bda6);})[_0xf1f6('0x2c')](function(_0x1b6964){_0x1938d4[_0xf1f6('0x48')]=_0x1b6964;return _0x1938d4;})[_0xf1f6('0x2c')](respondWithFilteredResult(_0x3cf29d,_0x28bda6,_0xf1f6('0x50')))[_0xf1f6('0x49')](handleError(_0x3cf29d,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x32d4=['set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','VoiceQueueReport','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset'];(function(_0x2d6b69,_0x3d0a97){var _0x40b8f1=function(_0x49893c){while(--_0x49893c){_0x2d6b69['push'](_0x2d6b69['shift']());}};_0x40b8f1(++_0x3d0a97);}(_0x32d4,0x120));var _0x432d=function(_0x1026f4,_0x3997c2){_0x1026f4=_0x1026f4-0x0;var _0x270de6=_0x32d4[_0x1026f4];return _0x270de6;};'use strict';var emlformat=require(_0x432d('0x0'));var rimraf=require(_0x432d('0x1'));var zipdir=require(_0x432d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x432d('0x3'));var moment=require(_0x432d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x432d('0x5'));var path=require(_0x432d('0x6'));var sox=require(_0x432d('0x7'));var csv=require('to-csv');var ejs=require(_0x432d('0x8'));var fs=require('fs');var fs_extra=require(_0x432d('0x9'));var _=require(_0x432d('0xa'));var squel=require(_0x432d('0xb'));var crypto=require(_0x432d('0xc'));var jsforce=require(_0x432d('0xd'));var deskjs=require(_0x432d('0xe'));var toCsv=require(_0x432d('0xf'));var querystring=require(_0x432d('0x10'));var Papa=require(_0x432d('0x11'));var Redis=require(_0x432d('0x12'));var authService=require(_0x432d('0x13'));var qs=require(_0x432d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432d('0x15'));var logger=require('../../config/logger')(_0x432d('0x16'));var utils=require(_0x432d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x432d('0x18'))['db'];config[_0x432d('0x19')]=_['defaults'](config[_0x432d('0x19')],{'host':_0x432d('0x1a'),'port':0x18eb});var socket=require(_0x432d('0x1b'))(new Redis(config[_0x432d('0x19')]));require('./voiceQueueReport.socket')[_0x432d('0x1c')](socket);function respondWithStatusCode(_0x3ce737,_0xdb1002){_0xdb1002=_0xdb1002||0xcc;return function(_0x4b2970){if(_0x4b2970){return _0x3ce737['sendStatus'](_0xdb1002);}return _0x3ce737[_0x432d('0x1d')](_0xdb1002)[_0x432d('0x1e')]();};}function respondWithResult(_0x469878,_0x22b22c){_0x22b22c=_0x22b22c||0xc8;return function(_0x3645c2){if(_0x3645c2){return _0x469878['status'](_0x22b22c)[_0x432d('0x1f')](_0x3645c2);}};}function respondWithFilteredResult(_0x2a3f55,_0x3d9fd4){return function(_0x17579a){if(_0x17579a){var _0x50cdc7=typeof _0x3d9fd4['offset']===_0x432d('0x20')&&typeof _0x3d9fd4[_0x432d('0x21')]===_0x432d('0x20');var _0x18f836=_0x17579a[_0x432d('0x22')];var _0x39c130=_0x50cdc7?0x0:_0x3d9fd4[_0x432d('0x23')];var _0x2033c6=_0x50cdc7?_0x17579a['count']:_0x3d9fd4[_0x432d('0x23')]+_0x3d9fd4[_0x432d('0x21')];var _0x26996d;if(_0x2033c6>=_0x18f836){_0x2033c6=_0x18f836;_0x26996d=0xc8;}else{_0x26996d=0xce;}_0x2a3f55[_0x432d('0x1d')](_0x26996d);return _0x2a3f55[_0x432d('0x24')](_0x432d('0x25'),_0x39c130+'-'+_0x2033c6+'/'+_0x18f836)['json'](_0x17579a);}return null;};}function patchUpdates(_0x2bff19){return function(_0x29ba92){try{jsonpatch['apply'](_0x29ba92,_0x2bff19,!![]);}catch(_0x5b4d27){return BPromise[_0x432d('0x26')](_0x5b4d27);}return _0x29ba92[_0x432d('0x27')]();};}function saveUpdates(_0x376352,_0x3873b7){return function(_0x743478){if(_0x743478){return _0x743478[_0x432d('0x28')](_0x376352)[_0x432d('0x29')](function(_0x5c345c){return _0x5c345c;});}return null;};}function removeEntity(_0x55f054,_0xf1c701){return function(_0x5152d4){if(_0x5152d4){return _0x5152d4[_0x432d('0x2a')]()[_0x432d('0x29')](function(){_0x55f054[_0x432d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c3bdd,_0x1c55a5){return function(_0x599606){if(!_0x599606){_0x3c3bdd[_0x432d('0x2b')](0x194);}return _0x599606;};}function handleError(_0x399eae,_0x3aa982){_0x3aa982=_0x3aa982||0x1f4;return function(_0x1a781b){logger[_0x432d('0x2c')](_0x1a781b['stack']);if(_0x1a781b[_0x432d('0x2d')]){delete _0x1a781b[_0x432d('0x2d')];}_0x399eae['status'](_0x3aa982)[_0x432d('0x2e')](_0x1a781b);};}exports['index']=function(_0x49f376,_0x1982b0){var _0xac6477={},_0x11462b={},_0x3281f8={'count':0x0,'rows':[]};var _0x476001=_[_0x432d('0x2f')](db[_0x432d('0x30')]['rawAttributes'],function(_0x67de6e){return{'name':_0x67de6e['fieldName'],'type':_0x67de6e[_0x432d('0x31')][_0x432d('0x32')]};});_0x11462b[_0x432d('0x33')]=_['map'](_0x476001,'name');_0x11462b[_0x432d('0x34')]=_[_0x432d('0x35')](_0x49f376['query']);_0x11462b[_0x432d('0x36')]=_['intersection'](_0x11462b['model'],_0x11462b[_0x432d('0x34')]);_0xac6477[_0x432d('0x37')]=_[_0x432d('0x38')](_0x11462b[_0x432d('0x33')],qs[_0x432d('0x39')](_0x49f376[_0x432d('0x34')]['fields']));_0xac6477[_0x432d('0x37')]=_0xac6477[_0x432d('0x37')][_0x432d('0x3a')]?_0xac6477['attributes']:_0x11462b['model'];if(!_0x49f376[_0x432d('0x34')]['hasOwnProperty'](_0x432d('0x3b'))){_0xac6477[_0x432d('0x21')]=qs['limit'](_0x49f376[_0x432d('0x34')][_0x432d('0x21')]);_0xac6477[_0x432d('0x23')]=qs[_0x432d('0x23')](_0x49f376['query']['offset']);}_0xac6477[_0x432d('0x3c')]=qs[_0x432d('0x3d')](_0x49f376[_0x432d('0x34')]['sort']);_0xac6477[_0x432d('0x3e')]=qs[_0x432d('0x36')](_[_0x432d('0x3f')](_0x49f376[_0x432d('0x34')],_0x11462b[_0x432d('0x36')]),_0x476001);if(_0x49f376['query'][_0x432d('0x40')]){_0xac6477[_0x432d('0x3e')]=_[_0x432d('0x41')](_0xac6477[_0x432d('0x3e')],{'$or':_[_0x432d('0x2f')](_0x476001,function(_0x120378){if(_0x120378[_0x432d('0x31')]!==_0x432d('0x42')){var _0x5efd33={};_0x5efd33[_0x120378['name']]={'$like':'%'+_0x49f376[_0x432d('0x34')][_0x432d('0x40')]+'%'};return _0x5efd33;}})});}_0xac6477=_[_0x432d('0x41')]({},_0xac6477,_0x49f376[_0x432d('0x43')]);var _0x488962={'where':_0xac6477[_0x432d('0x3e')]};return db[_0x432d('0x30')][_0x432d('0x22')](_0x488962)[_0x432d('0x29')](function(_0xb6a794){_0x3281f8[_0x432d('0x22')]=_0xb6a794;if(_0x49f376[_0x432d('0x34')][_0x432d('0x44')]){_0xac6477[_0x432d('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x432d('0x46')](_0xac6477);})['then'](function(_0x37e131){_0x3281f8[_0x432d('0x47')]=_0x37e131;return _0x3281f8;})['then'](respondWithFilteredResult(_0x1982b0,_0xac6477))[_0x432d('0x48')](handleError(_0x1982b0,null));};exports[_0x432d('0x49')]=function(_0x1c929d,_0x28aefa){var _0x420ce8={'raw':![],'where':{'id':_0x1c929d[_0x432d('0x4a')]['id']}},_0x3692ba={};_0x3692ba['model']=_['keys'](db[_0x432d('0x30')]['rawAttributes']);_0x3692ba['query']=_[_0x432d('0x35')](_0x1c929d[_0x432d('0x34')]);_0x3692ba[_0x432d('0x36')]=_[_0x432d('0x38')](_0x3692ba[_0x432d('0x33')],_0x3692ba['query']);_0x420ce8[_0x432d('0x37')]=_[_0x432d('0x38')](_0x3692ba[_0x432d('0x33')],qs['fields'](_0x1c929d[_0x432d('0x34')][_0x432d('0x39')]));_0x420ce8['attributes']=_0x420ce8[_0x432d('0x37')][_0x432d('0x3a')]?_0x420ce8[_0x432d('0x37')]:_0x3692ba[_0x432d('0x33')];if(_0x1c929d['query'][_0x432d('0x44')]){_0x420ce8['include']=[{'all':!![]}];}_0x420ce8=_[_0x432d('0x41')]({},_0x420ce8,_0x1c929d[_0x432d('0x43')]);return db[_0x432d('0x30')][_0x432d('0x4b')](_0x420ce8)[_0x432d('0x29')](handleEntityNotFound(_0x28aefa,null))[_0x432d('0x29')](respondWithResult(_0x28aefa,null))[_0x432d('0x48')](handleError(_0x28aefa,null));};exports[_0x432d('0x4c')]=function(_0x659e56,_0x2ce6b4){return db[_0x432d('0x30')][_0x432d('0x4c')](_0x659e56[_0x432d('0x4d')],{})[_0x432d('0x29')](respondWithResult(_0x2ce6b4,0xc9))[_0x432d('0x48')](handleError(_0x2ce6b4,null));};exports[_0x432d('0x28')]=function(_0x2e3cd7,_0x2e899f){if(_0x2e3cd7[_0x432d('0x4d')]['id']){delete _0x2e3cd7['body']['id'];}return db[_0x432d('0x30')][_0x432d('0x4b')]({'where':{'id':_0x2e3cd7['params']['id']}})[_0x432d('0x29')](handleEntityNotFound(_0x2e899f,null))[_0x432d('0x29')](saveUpdates(_0x2e3cd7[_0x432d('0x4d')],null))[_0x432d('0x29')](respondWithResult(_0x2e899f,null))[_0x432d('0x48')](handleError(_0x2e899f,null));};exports['destroy']=function(_0x3ec021,_0x1fadab){return db[_0x432d('0x30')]['find']({'where':{'id':_0x3ec021['params']['id']}})[_0x432d('0x29')](handleEntityNotFound(_0x1fadab,null))[_0x432d('0x29')](removeEntity(_0x1fadab,null))[_0x432d('0x48')](handleError(_0x1fadab,null));};exports[_0x432d('0x4e')]=function(_0x3cac7f,_0x1f4a4b){return db['VoiceQueueReport'][_0x432d('0x4e')]()[_0x432d('0x29')](respondWithResult(_0x1f4a4b,null))[_0x432d('0x48')](handleError(_0x1f4a4b,null));};exports[_0x432d('0x4f')]=function(_0x42bd04,_0x391a7c){var _0x1b1c09={},_0x2d181f={},_0x7c3b6e={'count':0x0,'rows':[]};_0x2d181f['model']=_[_0x432d('0x35')](db['VoiceQueueReport']['rawAttributes']);_0x2d181f[_0x432d('0x34')]=_[_0x432d('0x35')](_0x42bd04['query']);_0x2d181f['filters']=_[_0x432d('0x38')](_0x2d181f[_0x432d('0x33')],_0x2d181f[_0x432d('0x34')]);_0x1b1c09[_0x432d('0x37')]=_[_0x432d('0x38')](_0x2d181f[_0x432d('0x33')],qs[_0x432d('0x39')](_0x42bd04['query'][_0x432d('0x39')]));_0x1b1c09[_0x432d('0x37')]=_0x1b1c09[_0x432d('0x37')][_0x432d('0x3a')]?_0x1b1c09[_0x432d('0x37')]:_0x2d181f['model'];if(!_0x42bd04[_0x432d('0x34')][_0x432d('0x50')]('nolimit')){_0x1b1c09['limit']=qs['limit'](_0x42bd04[_0x432d('0x34')][_0x432d('0x21')]);_0x1b1c09[_0x432d('0x23')]=qs[_0x432d('0x23')](_0x42bd04[_0x432d('0x34')][_0x432d('0x23')]);}_0x1b1c09[_0x432d('0x3c')]=qs['sort'](_0x42bd04['query'][_0x432d('0x3d')]);_0x1b1c09[_0x432d('0x3e')]=qs['filters'](_[_0x432d('0x3f')](_0x42bd04['query'],_0x2d181f[_0x432d('0x36')]));if(_0x42bd04[_0x432d('0x34')][_0x432d('0x40')]){_0x1b1c09[_0x432d('0x3e')]=_[_0x432d('0x41')](_0x1b1c09[_0x432d('0x3e')],{'$or':_[_0x432d('0x2f')](_0x1b1c09[_0x432d('0x37')],function(_0x4b7299){var _0x412486={};_0x412486[_0x4b7299]={'$like':'%'+_0x42bd04['query'][_0x432d('0x40')]+'%'};return _0x412486;})});}_0x1b1c09=_[_0x432d('0x41')]({},_0x1b1c09,_0x42bd04[_0x432d('0x43')]);var _0x9b73f9={'where':_0x1b1c09[_0x432d('0x3e')]};return db['VoiceQueueReport'][_0x432d('0x22')](_0x9b73f9)[_0x432d('0x29')](function(_0x8ff384){_0x7c3b6e[_0x432d('0x22')]=_0x8ff384;if(_0x42bd04['query'][_0x432d('0x44')]){_0x1b1c09[_0x432d('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1b1c09);})[_0x432d('0x29')](function(_0x18c29f){_0x7c3b6e[_0x432d('0x47')]=_0x18c29f;return _0x7c3b6e;})[_0x432d('0x29')](respondWithFilteredResult(_0x391a7c,_0x1b1c09,_0x432d('0x4f')))[_0x432d('0x48')](handleError(_0x391a7c,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 81f95b4..1cc7716 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 _0x9299=['emit','hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','setMaxListeners','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9299,0x106));var _0x9929=function(_0xf8cd6f,_0x4f04e6){_0xf8cd6f=_0xf8cd6f-0x0;var _0x594bcf=_0x9299[_0xf8cd6f];return _0x594bcf;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x9929('0x0'))['db'][_0x9929('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9929('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9929('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50a208){return function(_0x5c389e,_0x387898,_0x11af8b){VoiceQueueReportEvents['emit'](_0x50a208+':'+_0x5c389e['id'],_0x5c389e);VoiceQueueReportEvents[_0x9929('0x4')](_0x50a208,_0x5c389e);_0x11af8b(null);};}for(var e in events){if(events[_0x9929('0x5')](e)){var event=events[e];VoiceQueueReport[_0x9929('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x3cfd=['update','remove','emit','hook','events','../../mysqldb','VoiceQueueReport','save'];(function(_0x386cef,_0x112e10){var _0x2f866f=function(_0xcc8a40){while(--_0xcc8a40){_0x386cef['push'](_0x386cef['shift']());}};_0x2f866f(++_0x112e10);}(_0x3cfd,0xa4));var _0xd3cf=function(_0xe77dee,_0x519803){_0xe77dee=_0xe77dee-0x0;var _0x161d05=_0x3cfd[_0xe77dee];return _0x161d05;};'use strict';var EventEmitter=require(_0xd3cf('0x0'));var VoiceQueueReport=require(_0xd3cf('0x1'))['db'][_0xd3cf('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3cf('0x3'),'afterUpdate':_0xd3cf('0x4'),'afterDestroy':_0xd3cf('0x5')};function emitEvent(_0x4b4be1){return function(_0x187386,_0xcb24e9,_0x1d6c9c){VoiceQueueReportEvents[_0xd3cf('0x6')](_0x4b4be1+':'+_0x187386['id'],_0x187386);VoiceQueueReportEvents[_0xd3cf('0x6')](_0x4b4be1,_0x187386);_0x1d6c9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xd3cf('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index e43044c..04a4bcc 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 _0x7671=['./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xcc456b,_0x15c9a4){var _0x49712a=function(_0x14f751){while(--_0x14f751){_0xcc456b['push'](_0xcc456b['shift']());}};_0x49712a(++_0x15c9a4);}(_0x7671,0x1d9));var _0x1767=function(_0x24e364,_0x22c22c){_0x24e364=_0x24e364-0x0;var _0x3921b0=_0x7671[_0x24e364];return _0x3921b0;};'use strict';var _=require(_0x1767('0x0'));var util=require(_0x1767('0x1'));var logger=require('../../config/logger')(_0x1767('0x2'));var moment=require(_0x1767('0x3'));var BPromise=require(_0x1767('0x4'));var rp=require(_0x1767('0x5'));var fs=require('fs');var path=require(_0x1767('0x6'));var rimraf=require('rimraf');var config=require(_0x1767('0x7'));var attributes=require(_0x1767('0x8'));module[_0x1767('0x9')]=function(_0xde6673,_0x464b95){return _0xde6673['define'](_0x1767('0xa'),attributes,{'tableName':_0x1767('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1767('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xefaa=['uniqueid','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xefaa,0x10c));var _0xaefa=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xefaa[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xaefa('0x0'));var util=require('util');var logger=require(_0xaefa('0x1'))(_0xaefa('0x2'));var moment=require(_0xaefa('0x3'));var BPromise=require(_0xaefa('0x4'));var rp=require(_0xaefa('0x5'));var fs=require('fs');var path=require(_0xaefa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaefa('0x7'));module[_0xaefa('0x8')]=function(_0x2a886d,_0x11d31d){return _0x2a886d[_0xaefa('0x9')](_0xaefa('0xa'),attributes,{'tableName':_0xaefa('0xb'),'paranoid':![],'indexes':[{'fields':[_0xaefa('0xc')]},{'fields':[_0xaefa('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 82f4af7..5392175 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 _0x9547=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','map','include','model','attributes','debug','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','raw','limit','lodash'];(function(_0x3fb546,_0x8661fc){var _0x2a9f80=function(_0x422b0b){while(--_0x422b0b){_0x3fb546['push'](_0x3fb546['shift']());}};_0x2a9f80(++_0x8661fc);}(_0x9547,0xc7));var _0x7954=function(_0x4ddcf6,_0x112bda){_0x4ddcf6=_0x4ddcf6-0x0;var _0x1dfbb4=_0x9547[_0x4ddcf6];return _0x1dfbb4;};'use strict';var _=require(_0x7954('0x0'));var util=require(_0x7954('0x1'));var moment=require('moment');var BPromise=require(_0x7954('0x2'));var rs=require(_0x7954('0x3'));var fs=require('fs');var Redis=require(_0x7954('0x4'));var db=require(_0x7954('0x5'))['db'];var utils=require(_0x7954('0x6'));var logger=require(_0x7954('0x7'))('rpc');var config=require(_0x7954('0x8'));var jayson=require(_0x7954('0x9'));var client=jayson[_0x7954('0xa')][_0x7954('0xb')]({'port':0x232a});config['redis']=_[_0x7954('0xc')](config[_0x7954('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7954('0xe'))(new Redis(config[_0x7954('0xd')]));require('./voiceQueueReport.socket')[_0x7954('0xf')](socket);function respondWithRpcPromise(_0x43b502,_0x29cd71,_0x4a7f32){return new BPromise(function(_0x346bed,_0x27f7d1){return client['request'](_0x43b502,_0x4a7f32)[_0x7954('0x10')](function(_0x13c13e){logger[_0x7954('0x11')](_0x7954('0x12'),_0x29cd71,'request\x20sent');logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x29cd71,_0x7954('0x13'),JSON[_0x7954('0x14')](_0x13c13e));if(_0x13c13e['error']){if(_0x13c13e['error']['code']===0x1f4){logger[_0x7954('0x15')](_0x7954('0x12'),_0x29cd71,_0x13c13e[_0x7954('0x15')][_0x7954('0x16')]);return _0x27f7d1(_0x13c13e[_0x7954('0x15')][_0x7954('0x16')]);}logger[_0x7954('0x15')](_0x7954('0x12'),_0x29cd71,_0x13c13e['error'][_0x7954('0x16')]);return _0x346bed(_0x13c13e['error'][_0x7954('0x16')]);}else{logger[_0x7954('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x29cd71,_0x7954('0x13'));_0x346bed(_0x13c13e[_0x7954('0x17')]['message']);}})[_0x7954('0x18')](function(_0x17f26d){logger[_0x7954('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x29cd71,_0x17f26d);_0x27f7d1(_0x17f26d);});});}exports[_0x7954('0x19')]=function(_0x45ca26){var _0x425b8e=this;return new Promise(function(_0x2836d6,_0x306bfd){return db[_0x7954('0x1a')][_0x7954('0x1b')]({'raw':_0x45ca26[_0x7954('0x1c')]?_0x45ca26['options']['raw']===undefined?!![]:![]:!![],'where':_0x45ca26[_0x7954('0x1c')]?_0x45ca26['options'][_0x7954('0x1d')]||null:null,'attributes':_0x45ca26[_0x7954('0x1c')]?_0x45ca26[_0x7954('0x1c')]['attributes']||null:null,'limit':_0x45ca26[_0x7954('0x1c')]?_0x45ca26[_0x7954('0x1c')]['limit']||null:null,'include':_0x45ca26[_0x7954('0x1c')]?_0x45ca26[_0x7954('0x1c')]['include']?_[_0x7954('0x1e')](_0x45ca26[_0x7954('0x1c')][_0x7954('0x1f')],function(_0x5beacd){return{'model':db[_0x5beacd[_0x7954('0x20')]],'as':_0x5beacd['as'],'attributes':_0x5beacd[_0x7954('0x21')],'include':_0x5beacd['include']?_[_0x7954('0x1e')](_0x5beacd[_0x7954('0x1f')],function(_0x41fb72){return{'model':db[_0x41fb72['model']],'as':_0x41fb72['as'],'attributes':_0x41fb72[_0x7954('0x21')],'include':_0x41fb72[_0x7954('0x1f')]?_[_0x7954('0x1e')](_0x41fb72[_0x7954('0x1f')],function(_0x4c4eda){return{'model':db[_0x4c4eda[_0x7954('0x20')]],'as':_0x4c4eda['as'],'attributes':_0x4c4eda[_0x7954('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3af0b2){logger['info'](_0x7954('0x19'),_0x45ca26);logger[_0x7954('0x22')](_0x7954('0x19'),_0x45ca26,JSON[_0x7954('0x14')](_0x3af0b2));_0x2836d6(_0x3af0b2);})[_0x7954('0x18')](function(_0x5c315d){logger[_0x7954('0x15')]('GetVoiceQueueReport',_0x5c315d[_0x7954('0x16')],_0x45ca26);_0x306bfd(_0x425b8e[_0x7954('0x15')](0x1f4,_0x5c315d['message']));});});};exports[_0x7954('0x23')]=function(_0x3e18d4){var _0x407bce=this;return new Promise(function(_0x4d8e4f,_0x102088){return db[_0x7954('0x1a')]['create'](_0x3e18d4[_0x7954('0x24')],{'raw':_0x3e18d4[_0x7954('0x1c')]?_0x3e18d4['options']['raw']===undefined?!![]:![]:!![]})[_0x7954('0x10')](function(_0x2ed84a){logger[_0x7954('0x11')](_0x7954('0x23'),_0x3e18d4);logger[_0x7954('0x22')](_0x7954('0x23'),_0x3e18d4,JSON[_0x7954('0x14')](_0x2ed84a));_0x4d8e4f(_0x2ed84a);})[_0x7954('0x18')](function(_0x15b0ce){logger['error'](_0x7954('0x23'),_0x15b0ce[_0x7954('0x16')],_0x3e18d4);_0x102088(_0x407bce['error'](0x1f4,_0x15b0ce[_0x7954('0x16')]));});});};exports[_0x7954('0x25')]=function(_0x5a9ec2){var _0x3aa9ad=this;return new Promise(function(_0x5523bc,_0x4e133a){return db[_0x7954('0x1a')]['update'](_0x5a9ec2[_0x7954('0x24')],{'raw':_0x5a9ec2[_0x7954('0x1c')]?_0x5a9ec2[_0x7954('0x1c')][_0x7954('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a9ec2['options']?_0x5a9ec2[_0x7954('0x1c')][_0x7954('0x1d')]||null:null,'attributes':_0x5a9ec2['options']?_0x5a9ec2[_0x7954('0x1c')][_0x7954('0x21')]||null:null,'limit':_0x5a9ec2[_0x7954('0x1c')]?_0x5a9ec2[_0x7954('0x1c')][_0x7954('0x27')]||null:null})[_0x7954('0x10')](function(_0x2292a7){logger['info'](_0x7954('0x25'),_0x5a9ec2);logger[_0x7954('0x22')](_0x7954('0x25'),_0x5a9ec2,JSON[_0x7954('0x14')](_0x2292a7));_0x5523bc(_0x2292a7);})[_0x7954('0x18')](function(_0x427dcf){logger[_0x7954('0x15')](_0x7954('0x25'),_0x427dcf[_0x7954('0x16')],_0x5a9ec2);_0x4e133a(_0x3aa9ad[_0x7954('0x15')](0x1f4,_0x427dcf[_0x7954('0x16')]));});});}; \ No newline at end of file +var _0x98e2=['raw','where','attributes','limit','model','include','map','debug','GetVoiceQueueReport','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','body','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options'];(function(_0x3b510c,_0x5ca50d){var _0x3234c0=function(_0x11cf89){while(--_0x11cf89){_0x3b510c['push'](_0x3b510c['shift']());}};_0x3234c0(++_0x5ca50d);}(_0x98e2,0xd0));var _0x298e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x98e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x298e('0x0'));var util=require(_0x298e('0x1'));var moment=require(_0x298e('0x2'));var BPromise=require('bluebird');var rs=require(_0x298e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x298e('0x4'))['db'];var utils=require(_0x298e('0x5'));var logger=require(_0x298e('0x6'))(_0x298e('0x7'));var config=require(_0x298e('0x8'));var jayson=require(_0x298e('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x298e('0xa')](config[_0x298e('0xb')],{'host':_0x298e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x37b7fc,_0x264bb5,_0x5322c3){return new BPromise(function(_0x4f21bd,_0x137c8b){return client['request'](_0x37b7fc,_0x5322c3)[_0x298e('0xd')](function(_0x304cbc){logger[_0x298e('0xe')](_0x298e('0xf'),_0x264bb5,'request\x20sent');logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x264bb5,_0x298e('0x10'),JSON[_0x298e('0x11')](_0x304cbc));if(_0x304cbc[_0x298e('0x12')]){if(_0x304cbc[_0x298e('0x12')][_0x298e('0x13')]===0x1f4){logger['error'](_0x298e('0xf'),_0x264bb5,_0x304cbc[_0x298e('0x12')]['message']);return _0x137c8b(_0x304cbc[_0x298e('0x12')][_0x298e('0x14')]);}logger['error'](_0x298e('0xf'),_0x264bb5,_0x304cbc[_0x298e('0x12')][_0x298e('0x14')]);return _0x4f21bd(_0x304cbc[_0x298e('0x12')][_0x298e('0x14')]);}else{logger[_0x298e('0xe')](_0x298e('0xf'),_0x264bb5,_0x298e('0x10'));_0x4f21bd(_0x304cbc[_0x298e('0x15')][_0x298e('0x14')]);}})[_0x298e('0x16')](function(_0x16bd9c){logger[_0x298e('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x264bb5,_0x16bd9c);_0x137c8b(_0x16bd9c);});});}exports['GetVoiceQueueReport']=function(_0x1a6ee8){var _0x35db1c=this;return new Promise(function(_0x5afe34,_0x2a4ce3){return db[_0x298e('0x17')][_0x298e('0x18')]({'raw':_0x1a6ee8['options']?_0x1a6ee8[_0x298e('0x19')][_0x298e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a6ee8['options']?_0x1a6ee8['options'][_0x298e('0x1b')]||null:null,'attributes':_0x1a6ee8[_0x298e('0x19')]?_0x1a6ee8[_0x298e('0x19')][_0x298e('0x1c')]||null:null,'limit':_0x1a6ee8[_0x298e('0x19')]?_0x1a6ee8[_0x298e('0x19')][_0x298e('0x1d')]||null:null,'include':_0x1a6ee8['options']?_0x1a6ee8[_0x298e('0x19')]['include']?_['map'](_0x1a6ee8[_0x298e('0x19')]['include'],function(_0x1d5edd){return{'model':db[_0x1d5edd[_0x298e('0x1e')]],'as':_0x1d5edd['as'],'attributes':_0x1d5edd[_0x298e('0x1c')],'include':_0x1d5edd[_0x298e('0x1f')]?_[_0x298e('0x20')](_0x1d5edd[_0x298e('0x1f')],function(_0x2af811){return{'model':db[_0x2af811[_0x298e('0x1e')]],'as':_0x2af811['as'],'attributes':_0x2af811['attributes'],'include':_0x2af811['include']?_[_0x298e('0x20')](_0x2af811[_0x298e('0x1f')],function(_0x20a398){return{'model':db[_0x20a398['model']],'as':_0x20a398['as'],'attributes':_0x20a398[_0x298e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x298e('0xd')](function(_0x2df971){logger[_0x298e('0xe')]('GetVoiceQueueReport',_0x1a6ee8);logger[_0x298e('0x21')]('GetVoiceQueueReport',_0x1a6ee8,JSON[_0x298e('0x11')](_0x2df971));_0x5afe34(_0x2df971);})['catch'](function(_0x23180b){logger[_0x298e('0x12')](_0x298e('0x22'),_0x23180b[_0x298e('0x14')],_0x1a6ee8);_0x2a4ce3(_0x35db1c['error'](0x1f4,_0x23180b[_0x298e('0x14')]));});});};exports['CreateVoiceQueueReport']=function(_0x5950fd){var _0x2d610b=this;return new Promise(function(_0x1b1ab8,_0x2538a4){return db['VoiceQueueReport'][_0x298e('0x23')](_0x5950fd['body'],{'raw':_0x5950fd[_0x298e('0x19')]?_0x5950fd[_0x298e('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5d5425){logger[_0x298e('0xe')](_0x298e('0x24'),_0x5950fd);logger[_0x298e('0x21')](_0x298e('0x24'),_0x5950fd,JSON[_0x298e('0x11')](_0x5d5425));_0x1b1ab8(_0x5d5425);})[_0x298e('0x16')](function(_0x2efdcd){logger[_0x298e('0x12')](_0x298e('0x24'),_0x2efdcd[_0x298e('0x14')],_0x5950fd);_0x2538a4(_0x2d610b[_0x298e('0x12')](0x1f4,_0x2efdcd[_0x298e('0x14')]));});});};exports[_0x298e('0x25')]=function(_0xacddd5){var _0x5cdc52=this;return new Promise(function(_0x29123b,_0x3597eb){return db[_0x298e('0x17')]['update'](_0xacddd5[_0x298e('0x26')],{'raw':_0xacddd5['options']?_0xacddd5[_0x298e('0x19')][_0x298e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xacddd5[_0x298e('0x19')]?_0xacddd5[_0x298e('0x19')][_0x298e('0x1b')]||null:null,'attributes':_0xacddd5['options']?_0xacddd5[_0x298e('0x19')]['attributes']||null:null,'limit':_0xacddd5['options']?_0xacddd5[_0x298e('0x19')][_0x298e('0x1d')]||null:null})[_0x298e('0xd')](function(_0x30459f){logger[_0x298e('0xe')](_0x298e('0x25'),_0xacddd5);logger[_0x298e('0x21')](_0x298e('0x25'),_0xacddd5,JSON[_0x298e('0x11')](_0x30459f));_0x29123b(_0x30459f);})['catch'](function(_0x5da109){logger[_0x298e('0x12')](_0x298e('0x25'),_0x5da109[_0x298e('0x14')],_0xacddd5);_0x3597eb(_0x5cdc52[_0x298e('0x12')](0x1f4,_0x5da109[_0x298e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 23d61ba..19ad00f 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 _0x851c=['remove','update','register','./voiceQueueReport.events','save'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x851c,0x19d));var _0xc851=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x851c[_0x167cc1];return _0x10bc4b;};'use strict';var VoiceQueueReportEvents=require(_0xc851('0x0'));var events=[_0xc851('0x1'),_0xc851('0x2'),_0xc851('0x3')];function createListener(_0xeee792,_0x24a12f){return function(_0x205792){_0x24a12f['emit'](_0xeee792,_0x205792);};}function removeListener(_0x2fddd4,_0x84f5ad){return function(){VoiceQueueReportEvents['removeListener'](_0x2fddd4,_0x84f5ad);};}exports[_0xc851('0x4')]=function(_0x272e34){for(var _0x535cf1=0x0,_0x3067e5=events['length'];_0x535cf1<_0x3067e5;_0x535cf1++){var _0x4bc036=events[_0x535cf1];var _0x12a405=createListener('voiceQueueReport:'+_0x4bc036,_0x272e34);VoiceQueueReportEvents['on'](_0x4bc036,_0x12a405);}}; \ No newline at end of file +var _0x280b=['update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x280b,0xce));var _0xb280=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x280b[_0x6131cd];return _0x47e916;};'use strict';var VoiceQueueReportEvents=require(_0xb280('0x0'));var events=[_0xb280('0x1'),'remove',_0xb280('0x2')];function createListener(_0x3c4f59,_0x444d16){return function(_0x3a59e1){_0x444d16[_0xb280('0x3')](_0x3c4f59,_0x3a59e1);};}function removeListener(_0x69abb,_0x2fa322){return function(){VoiceQueueReportEvents[_0xb280('0x4')](_0x69abb,_0x2fa322);};}exports[_0xb280('0x5')]=function(_0x5d1991){for(var _0x4d1b2e=0x0,_0x43e0ee=events[_0xb280('0x6')];_0x4d1b2e<_0x43e0ee;_0x4d1b2e++){var _0x5c98b9=events[_0x4d1b2e];var _0x12433f=createListener(_0xb280('0x7')+_0x5c98b9,_0x5d1991);VoiceQueueReportEvents['on'](_0x5c98b9,_0x12433f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0712b9d..33b7a59 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 _0x7264=['get','show','post','create','put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index'];(function(_0x45ce1a,_0x4f8ea5){var _0x4926d8=function(_0x4b29d8){while(--_0x4b29d8){_0x45ce1a['push'](_0x45ce1a['shift']());}};_0x4926d8(++_0x4f8ea5);}(_0x7264,0xf0));var _0x4726=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7264[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x4726('0x0'));var util=require('util');var path=require(_0x4726('0x1'));var timeout=require(_0x4726('0x2'));var express=require(_0x4726('0x3'));var router=express[_0x4726('0x4')]();var fs_extra=require(_0x4726('0x5'));var auth=require(_0x4726('0x6'));var interaction=require(_0x4726('0x7'));var config=require(_0x4726('0x8'));var controller=require(_0x4726('0x9'));router['get']('/',auth[_0x4726('0xa')](),controller[_0x4726('0xb')]);router[_0x4726('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4726('0xd')]);router[_0x4726('0xe')]('/',auth[_0x4726('0xa')](),controller[_0x4726('0xf')]);router[_0x4726('0x10')]('/:id',auth[_0x4726('0xa')](),controller[_0x4726('0x11')]);router[_0x4726('0x12')](_0x4726('0x13'),auth[_0x4726('0xa')](),controller[_0x4726('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1b8c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','path'];(function(_0x567dcc,_0x2bf822){var _0x501c44=function(_0x51ca38){while(--_0x51ca38){_0x567dcc['push'](_0x567dcc['shift']());}};_0x501c44(++_0x2bf822);}(_0x1b8c,0x130));var _0xc1b8=function(_0x15e749,_0x4458d4){_0x15e749=_0x15e749-0x0;var _0x8eefde=_0x1b8c[_0x15e749];return _0x8eefde;};'use strict';var multer=require(_0xc1b8('0x0'));var util=require('util');var path=require(_0xc1b8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc1b8('0x2')]();var fs_extra=require(_0xc1b8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc1b8('0x4'));var config=require(_0xc1b8('0x5'));var controller=require(_0xc1b8('0x6'));router[_0xc1b8('0x7')]('/',auth[_0xc1b8('0x8')](),controller[_0xc1b8('0x9')]);router[_0xc1b8('0x7')]('/:id',auth[_0xc1b8('0x8')](),controller[_0xc1b8('0xa')]);router[_0xc1b8('0xb')]('/',auth['isAuthenticated'](),controller[_0xc1b8('0xc')]);router[_0xc1b8('0xd')](_0xc1b8('0xe'),auth[_0xc1b8('0x8')](),controller['update']);router[_0xc1b8('0xf')](_0xc1b8('0xe'),auth[_0xc1b8('0x8')](),controller[_0xc1b8('0x10')]);module[_0xc1b8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index d562a9c..e875722 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 _0xf24e=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xf24e,0x110));var _0xef24=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xf24e[_0x3b7a0c];return _0x3bb70f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0xef24('0x0')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xef24('0x0')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xef24('0x1')],'allowNull':![],'defaultValue':moment()[_0xef24('0x2')](_0xef24('0x3'))}}; \ No newline at end of file +var _0x60fe=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','DATE'];(function(_0x4a6e47,_0x396719){var _0x30dd9d=function(_0x5aa781){while(--_0x5aa781){_0x4a6e47['push'](_0x4a6e47['shift']());}};_0x30dd9d(++_0x396719);}(_0x60fe,0x176));var _0xe60f=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x60fe[_0xdd82b4];return _0x549bb2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0xe60f('0x0')]},'callid':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe60f('0x1')],'allowNull':![],'defaultValue':moment()[_0xe60f('0x2')](_0xe60f('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 003e83f..c6bef10 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 _0xaa29=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','keys','include','create','body','find','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2bc340,_0x4f944d){var _0x5defd2=function(_0x2db2bb){while(--_0x2db2bb){_0x2bc340['push'](_0x2bc340['shift']());}};_0x5defd2(++_0x4f944d);}(_0xaa29,0xf3));var _0x9aa2=function(_0x5617a3,_0x3e5e1f){_0x5617a3=_0x5617a3-0x0;var _0x121e58=_0xaa29[_0x5617a3];return _0x121e58;};'use strict';var emlformat=require(_0x9aa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9aa2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9aa2('0x2'));var moment=require(_0x9aa2('0x3'));var BPromise=require(_0x9aa2('0x4'));var Mustache=require(_0x9aa2('0x5'));var util=require(_0x9aa2('0x6'));var path=require('path');var sox=require(_0x9aa2('0x7'));var csv=require(_0x9aa2('0x8'));var ejs=require(_0x9aa2('0x9'));var fs=require('fs');var fs_extra=require(_0x9aa2('0xa'));var _=require('lodash');var squel=require(_0x9aa2('0xb'));var crypto=require(_0x9aa2('0xc'));var jsforce=require(_0x9aa2('0xd'));var deskjs=require(_0x9aa2('0xe'));var toCsv=require(_0x9aa2('0x8'));var querystring=require(_0x9aa2('0xf'));var Papa=require('papaparse');var Redis=require(_0x9aa2('0x10'));var authService=require(_0x9aa2('0x11'));var qs=require(_0x9aa2('0x12'));var as=require(_0x9aa2('0x13'));var hardwareService=require(_0x9aa2('0x14'));var logger=require(_0x9aa2('0x15'))('api');var utils=require(_0x9aa2('0x16'));var config=require(_0x9aa2('0x17'));var licenseUtil=require(_0x9aa2('0x18'));var db=require(_0x9aa2('0x19'))['db'];function respondWithStatusCode(_0x358b25,_0x19c821){_0x19c821=_0x19c821||0xcc;return function(_0x160621){if(_0x160621){return _0x358b25[_0x9aa2('0x1a')](_0x19c821);}return _0x358b25[_0x9aa2('0x1b')](_0x19c821)[_0x9aa2('0x1c')]();};}function respondWithResult(_0x1421df,_0x19a1dc){_0x19a1dc=_0x19a1dc||0xc8;return function(_0x1be9ab){if(_0x1be9ab){return _0x1421df[_0x9aa2('0x1b')](_0x19a1dc)[_0x9aa2('0x1d')](_0x1be9ab);}};}function respondWithFilteredResult(_0x415488,_0x217208){return function(_0x4490a6){if(_0x4490a6){var _0xe27795=typeof _0x217208[_0x9aa2('0x1e')]===_0x9aa2('0x1f')&&typeof _0x217208[_0x9aa2('0x20')]==='undefined';var _0x3612ba=_0x4490a6[_0x9aa2('0x21')];var _0x5ab8fb=_0xe27795?0x0:_0x217208['offset'];var _0x536f40=_0xe27795?_0x4490a6[_0x9aa2('0x21')]:_0x217208['offset']+_0x217208[_0x9aa2('0x20')];var _0x284e01;if(_0x536f40>=_0x3612ba){_0x536f40=_0x3612ba;_0x284e01=0xc8;}else{_0x284e01=0xce;}_0x415488[_0x9aa2('0x1b')](_0x284e01);return _0x415488['set'](_0x9aa2('0x22'),_0x5ab8fb+'-'+_0x536f40+'/'+_0x3612ba)[_0x9aa2('0x1d')](_0x4490a6);}return null;};}function patchUpdates(_0x2ffe1c){return function(_0x58c3bf){try{jsonpatch[_0x9aa2('0x23')](_0x58c3bf,_0x2ffe1c,!![]);}catch(_0x25111b){return BPromise[_0x9aa2('0x24')](_0x25111b);}return _0x58c3bf[_0x9aa2('0x25')]();};}function saveUpdates(_0x4df12f,_0x428449){return function(_0x189e4b){if(_0x189e4b){return _0x189e4b[_0x9aa2('0x26')](_0x4df12f)['then'](function(_0x464b13){return _0x464b13;});}return null;};}function removeEntity(_0x1ad8a5,_0x1cf9b8){return function(_0x36cb37){if(_0x36cb37){return _0x36cb37['destroy']()[_0x9aa2('0x27')](function(){_0x1ad8a5[_0x9aa2('0x1b')](0xcc)[_0x9aa2('0x1c')]();});}};}function handleEntityNotFound(_0x53d365,_0x1c168e){return function(_0x5c64a9){if(!_0x5c64a9){_0x53d365[_0x9aa2('0x1a')](0x194);}return _0x5c64a9;};}function handleError(_0x51b06d,_0x2e51f7){_0x2e51f7=_0x2e51f7||0x1f4;return function(_0x50f1d2){logger[_0x9aa2('0x28')](_0x50f1d2[_0x9aa2('0x29')]);if(_0x50f1d2[_0x9aa2('0x2a')]){delete _0x50f1d2[_0x9aa2('0x2a')];}_0x51b06d[_0x9aa2('0x1b')](_0x2e51f7)[_0x9aa2('0x2b')](_0x50f1d2);};}exports[_0x9aa2('0x2c')]=function(_0x1c6fcf,_0x37dc5d){var _0x58f49f={},_0x43876f={},_0x7aa2df={'count':0x0,'rows':[]};var _0x14734b=_[_0x9aa2('0x2d')](db[_0x9aa2('0x2e')]['rawAttributes'],function(_0x241749){return{'name':_0x241749[_0x9aa2('0x2f')],'type':_0x241749[_0x9aa2('0x30')]['key']};});_0x43876f['model']=_['map'](_0x14734b,_0x9aa2('0x2a'));_0x43876f[_0x9aa2('0x31')]=_['keys'](_0x1c6fcf[_0x9aa2('0x31')]);_0x43876f[_0x9aa2('0x32')]=_[_0x9aa2('0x33')](_0x43876f['model'],_0x43876f[_0x9aa2('0x31')]);_0x58f49f[_0x9aa2('0x34')]=_['intersection'](_0x43876f[_0x9aa2('0x35')],qs[_0x9aa2('0x36')](_0x1c6fcf[_0x9aa2('0x31')]['fields']));_0x58f49f[_0x9aa2('0x34')]=_0x58f49f[_0x9aa2('0x34')][_0x9aa2('0x37')]?_0x58f49f[_0x9aa2('0x34')]:_0x43876f[_0x9aa2('0x35')];if(!_0x1c6fcf['query'][_0x9aa2('0x38')](_0x9aa2('0x39'))){_0x58f49f[_0x9aa2('0x20')]=qs['limit'](_0x1c6fcf['query'][_0x9aa2('0x20')]);_0x58f49f['offset']=qs['offset'](_0x1c6fcf[_0x9aa2('0x31')][_0x9aa2('0x1e')]);}_0x58f49f[_0x9aa2('0x3a')]=qs[_0x9aa2('0x3b')](_0x1c6fcf[_0x9aa2('0x31')][_0x9aa2('0x3b')]);_0x58f49f[_0x9aa2('0x3c')]=qs[_0x9aa2('0x32')](_[_0x9aa2('0x3d')](_0x1c6fcf['query'],_0x43876f[_0x9aa2('0x32')]),_0x14734b);if(_0x1c6fcf[_0x9aa2('0x31')][_0x9aa2('0x3e')]){_0x58f49f[_0x9aa2('0x3c')]=_[_0x9aa2('0x3f')](_0x58f49f[_0x9aa2('0x3c')],{'$or':_[_0x9aa2('0x2d')](_0x14734b,function(_0x1a20e){if(_0x1a20e[_0x9aa2('0x30')]!==_0x9aa2('0x40')){var _0x5a60ce={};_0x5a60ce[_0x1a20e['name']]={'$like':'%'+_0x1c6fcf['query'][_0x9aa2('0x3e')]+'%'};return _0x5a60ce;}})});}_0x58f49f=_[_0x9aa2('0x3f')]({},_0x58f49f,_0x1c6fcf[_0x9aa2('0x41')]);var _0x2f7fbb={'where':_0x58f49f[_0x9aa2('0x3c')]};return db[_0x9aa2('0x2e')]['count'](_0x2f7fbb)['then'](function(_0x4be572){_0x7aa2df[_0x9aa2('0x21')]=_0x4be572;if(_0x1c6fcf[_0x9aa2('0x31')][_0x9aa2('0x42')]){_0x58f49f['include']=[{'all':!![]}];}return db[_0x9aa2('0x2e')][_0x9aa2('0x43')](_0x58f49f);})[_0x9aa2('0x27')](function(_0x5504da){_0x7aa2df['rows']=_0x5504da;return _0x7aa2df;})[_0x9aa2('0x27')](respondWithFilteredResult(_0x37dc5d,_0x58f49f))[_0x9aa2('0x44')](handleError(_0x37dc5d,null));};exports['show']=function(_0x5cae2e,_0x2d33de){var _0x52e6ec={'raw':!![],'where':{'id':_0x5cae2e[_0x9aa2('0x45')]['id']}},_0x54c981={};_0x54c981['model']=_[_0x9aa2('0x46')](db['VoiceQueuesLog']['rawAttributes']);_0x54c981[_0x9aa2('0x31')]=_['keys'](_0x5cae2e[_0x9aa2('0x31')]);_0x54c981['filters']=_[_0x9aa2('0x33')](_0x54c981[_0x9aa2('0x35')],_0x54c981['query']);_0x52e6ec[_0x9aa2('0x34')]=_[_0x9aa2('0x33')](_0x54c981['model'],qs[_0x9aa2('0x36')](_0x5cae2e[_0x9aa2('0x31')][_0x9aa2('0x36')]));_0x52e6ec['attributes']=_0x52e6ec[_0x9aa2('0x34')][_0x9aa2('0x37')]?_0x52e6ec['attributes']:_0x54c981[_0x9aa2('0x35')];if(_0x5cae2e['query'][_0x9aa2('0x42')]){_0x52e6ec[_0x9aa2('0x47')]=[{'all':!![]}];}_0x52e6ec=_[_0x9aa2('0x3f')]({},_0x52e6ec,_0x5cae2e[_0x9aa2('0x41')]);return db['VoiceQueuesLog']['find'](_0x52e6ec)['then'](handleEntityNotFound(_0x2d33de,null))[_0x9aa2('0x27')](respondWithResult(_0x2d33de,null))[_0x9aa2('0x44')](handleError(_0x2d33de,null));};exports[_0x9aa2('0x48')]=function(_0xef2086,_0x2c382d){return db[_0x9aa2('0x2e')]['create'](_0xef2086[_0x9aa2('0x49')],{})[_0x9aa2('0x27')](respondWithResult(_0x2c382d,0xc9))['catch'](handleError(_0x2c382d,null));};exports['update']=function(_0x1b36a8,_0x6d3c91){if(_0x1b36a8[_0x9aa2('0x49')]['id']){delete _0x1b36a8[_0x9aa2('0x49')]['id'];}return db['VoiceQueuesLog'][_0x9aa2('0x4a')]({'where':{'id':_0x1b36a8[_0x9aa2('0x45')]['id']}})['then'](handleEntityNotFound(_0x6d3c91,null))[_0x9aa2('0x27')](saveUpdates(_0x1b36a8[_0x9aa2('0x49')],null))[_0x9aa2('0x27')](respondWithResult(_0x6d3c91,null))[_0x9aa2('0x44')](handleError(_0x6d3c91,null));};exports[_0x9aa2('0x4b')]=function(_0x5da993,_0x155db4){return db[_0x9aa2('0x2e')][_0x9aa2('0x4a')]({'where':{'id':_0x5da993[_0x9aa2('0x45')]['id']}})[_0x9aa2('0x27')](handleEntityNotFound(_0x155db4,null))[_0x9aa2('0x27')](removeEntity(_0x155db4,null))[_0x9aa2('0x44')](handleError(_0x155db4,null));}; \ No newline at end of file +var _0x2044=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x22ed86,_0x54d634){var _0x3084b3=function(_0x503ec6){while(--_0x503ec6){_0x22ed86['push'](_0x22ed86['shift']());}};_0x3084b3(++_0x54d634);}(_0x2044,0x8c));var _0x4204=function(_0x1cd90c,_0x267a33){_0x1cd90c=_0x1cd90c-0x0;var _0x4d876c=_0x2044[_0x1cd90c];return _0x4d876c;};'use strict';var emlformat=require(_0x4204('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4204('0x1'));var jsonpatch=require(_0x4204('0x2'));var rp=require(_0x4204('0x3'));var moment=require(_0x4204('0x4'));var BPromise=require(_0x4204('0x5'));var Mustache=require(_0x4204('0x6'));var util=require(_0x4204('0x7'));var path=require(_0x4204('0x8'));var sox=require(_0x4204('0x9'));var csv=require('to-csv');var ejs=require(_0x4204('0xa'));var fs=require('fs');var fs_extra=require(_0x4204('0xb'));var _=require(_0x4204('0xc'));var squel=require(_0x4204('0xd'));var crypto=require(_0x4204('0xe'));var jsforce=require(_0x4204('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4204('0x10'));var querystring=require('querystring');var Papa=require(_0x4204('0x11'));var Redis=require('ioredis');var authService=require(_0x4204('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4204('0x13'));var hardwareService=require(_0x4204('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4204('0x15'));var licenseUtil=require(_0x4204('0x16'));var db=require(_0x4204('0x17'))['db'];function respondWithStatusCode(_0x972ca1,_0x1a09cf){_0x1a09cf=_0x1a09cf||0xcc;return function(_0x3ab29){if(_0x3ab29){return _0x972ca1[_0x4204('0x18')](_0x1a09cf);}return _0x972ca1[_0x4204('0x19')](_0x1a09cf)[_0x4204('0x1a')]();};}function respondWithResult(_0x22922c,_0xa2d408){_0xa2d408=_0xa2d408||0xc8;return function(_0x20dd60){if(_0x20dd60){return _0x22922c[_0x4204('0x19')](_0xa2d408)[_0x4204('0x1b')](_0x20dd60);}};}function respondWithFilteredResult(_0x473e4b,_0x5bd251){return function(_0x33310f){if(_0x33310f){var _0x32908a=typeof _0x5bd251[_0x4204('0x1c')]===_0x4204('0x1d')&&typeof _0x5bd251[_0x4204('0x1e')]===_0x4204('0x1d');var _0x509e3b=_0x33310f[_0x4204('0x1f')];var _0x56e304=_0x32908a?0x0:_0x5bd251['offset'];var _0x3992af=_0x32908a?_0x33310f[_0x4204('0x1f')]:_0x5bd251[_0x4204('0x1c')]+_0x5bd251[_0x4204('0x1e')];var _0x187585;if(_0x3992af>=_0x509e3b){_0x3992af=_0x509e3b;_0x187585=0xc8;}else{_0x187585=0xce;}_0x473e4b[_0x4204('0x19')](_0x187585);return _0x473e4b[_0x4204('0x20')](_0x4204('0x21'),_0x56e304+'-'+_0x3992af+'/'+_0x509e3b)[_0x4204('0x1b')](_0x33310f);}return null;};}function patchUpdates(_0x4c7cae){return function(_0x407580){try{jsonpatch['apply'](_0x407580,_0x4c7cae,!![]);}catch(_0x7443e5){return BPromise[_0x4204('0x22')](_0x7443e5);}return _0x407580[_0x4204('0x23')]();};}function saveUpdates(_0x26e1f3,_0x2ee93a){return function(_0x3fa477){if(_0x3fa477){return _0x3fa477[_0x4204('0x24')](_0x26e1f3)[_0x4204('0x25')](function(_0xecf74a){return _0xecf74a;});}return null;};}function removeEntity(_0x4b2a70,_0x1601c7){return function(_0x4dffc6){if(_0x4dffc6){return _0x4dffc6[_0x4204('0x26')]()[_0x4204('0x25')](function(){_0x4b2a70[_0x4204('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a207,_0x6e9c31){return function(_0xfda763){if(!_0xfda763){_0x59a207['sendStatus'](0x194);}return _0xfda763;};}function handleError(_0x41f286,_0x24dc2a){_0x24dc2a=_0x24dc2a||0x1f4;return function(_0x36fccf){logger[_0x4204('0x27')](_0x36fccf['stack']);if(_0x36fccf[_0x4204('0x28')]){delete _0x36fccf[_0x4204('0x28')];}_0x41f286[_0x4204('0x19')](_0x24dc2a)['send'](_0x36fccf);};}exports[_0x4204('0x29')]=function(_0xd6277c,_0x72d1d1){var _0x6a4268={},_0x5d4cb8={},_0x89e2c1={'count':0x0,'rows':[]};var _0x159ab4=_[_0x4204('0x2a')](db[_0x4204('0x2b')][_0x4204('0x2c')],function(_0x20486d){return{'name':_0x20486d[_0x4204('0x2d')],'type':_0x20486d[_0x4204('0x2e')]['key']};});_0x5d4cb8[_0x4204('0x2f')]=_['map'](_0x159ab4,'name');_0x5d4cb8[_0x4204('0x30')]=_[_0x4204('0x31')](_0xd6277c['query']);_0x5d4cb8[_0x4204('0x32')]=_[_0x4204('0x33')](_0x5d4cb8['model'],_0x5d4cb8[_0x4204('0x30')]);_0x6a4268[_0x4204('0x34')]=_[_0x4204('0x33')](_0x5d4cb8['model'],qs[_0x4204('0x35')](_0xd6277c['query'][_0x4204('0x35')]));_0x6a4268[_0x4204('0x34')]=_0x6a4268[_0x4204('0x34')]['length']?_0x6a4268[_0x4204('0x34')]:_0x5d4cb8[_0x4204('0x2f')];if(!_0xd6277c[_0x4204('0x30')][_0x4204('0x36')]('nolimit')){_0x6a4268[_0x4204('0x1e')]=qs[_0x4204('0x1e')](_0xd6277c[_0x4204('0x30')][_0x4204('0x1e')]);_0x6a4268['offset']=qs[_0x4204('0x1c')](_0xd6277c[_0x4204('0x30')]['offset']);}_0x6a4268[_0x4204('0x37')]=qs[_0x4204('0x38')](_0xd6277c['query'][_0x4204('0x38')]);_0x6a4268['where']=qs[_0x4204('0x32')](_[_0x4204('0x39')](_0xd6277c[_0x4204('0x30')],_0x5d4cb8[_0x4204('0x32')]),_0x159ab4);if(_0xd6277c[_0x4204('0x30')][_0x4204('0x3a')]){_0x6a4268[_0x4204('0x3b')]=_['merge'](_0x6a4268['where'],{'$or':_['map'](_0x159ab4,function(_0x36ea05){if(_0x36ea05[_0x4204('0x2e')]!==_0x4204('0x3c')){var _0x4df8ba={};_0x4df8ba[_0x36ea05['name']]={'$like':'%'+_0xd6277c[_0x4204('0x30')][_0x4204('0x3a')]+'%'};return _0x4df8ba;}})});}_0x6a4268=_[_0x4204('0x3d')]({},_0x6a4268,_0xd6277c[_0x4204('0x3e')]);var _0x38fa60={'where':_0x6a4268[_0x4204('0x3b')]};return db[_0x4204('0x2b')][_0x4204('0x1f')](_0x38fa60)[_0x4204('0x25')](function(_0x17d067){_0x89e2c1[_0x4204('0x1f')]=_0x17d067;if(_0xd6277c[_0x4204('0x30')]['includeAll']){_0x6a4268[_0x4204('0x3f')]=[{'all':!![]}];}return db[_0x4204('0x2b')][_0x4204('0x40')](_0x6a4268);})[_0x4204('0x25')](function(_0x3f464e){_0x89e2c1[_0x4204('0x41')]=_0x3f464e;return _0x89e2c1;})[_0x4204('0x25')](respondWithFilteredResult(_0x72d1d1,_0x6a4268))['catch'](handleError(_0x72d1d1,null));};exports[_0x4204('0x42')]=function(_0x167877,_0x26fc96){var _0x460874={'raw':!![],'where':{'id':_0x167877['params']['id']}},_0x5e9bd6={};_0x5e9bd6[_0x4204('0x2f')]=_[_0x4204('0x31')](db[_0x4204('0x2b')]['rawAttributes']);_0x5e9bd6[_0x4204('0x30')]=_[_0x4204('0x31')](_0x167877[_0x4204('0x30')]);_0x5e9bd6[_0x4204('0x32')]=_[_0x4204('0x33')](_0x5e9bd6[_0x4204('0x2f')],_0x5e9bd6[_0x4204('0x30')]);_0x460874[_0x4204('0x34')]=_[_0x4204('0x33')](_0x5e9bd6[_0x4204('0x2f')],qs['fields'](_0x167877[_0x4204('0x30')][_0x4204('0x35')]));_0x460874[_0x4204('0x34')]=_0x460874[_0x4204('0x34')][_0x4204('0x43')]?_0x460874['attributes']:_0x5e9bd6['model'];if(_0x167877[_0x4204('0x30')][_0x4204('0x44')]){_0x460874[_0x4204('0x3f')]=[{'all':!![]}];}_0x460874=_[_0x4204('0x3d')]({},_0x460874,_0x167877[_0x4204('0x3e')]);return db[_0x4204('0x2b')][_0x4204('0x45')](_0x460874)[_0x4204('0x25')](handleEntityNotFound(_0x26fc96,null))[_0x4204('0x25')](respondWithResult(_0x26fc96,null))[_0x4204('0x46')](handleError(_0x26fc96,null));};exports[_0x4204('0x47')]=function(_0x4e81ee,_0x21e4a0){return db[_0x4204('0x2b')][_0x4204('0x47')](_0x4e81ee['body'],{})[_0x4204('0x25')](respondWithResult(_0x21e4a0,0xc9))[_0x4204('0x46')](handleError(_0x21e4a0,null));};exports[_0x4204('0x24')]=function(_0x50de86,_0x30c3e3){if(_0x50de86[_0x4204('0x48')]['id']){delete _0x50de86[_0x4204('0x48')]['id'];}return db[_0x4204('0x2b')][_0x4204('0x45')]({'where':{'id':_0x50de86[_0x4204('0x49')]['id']}})['then'](handleEntityNotFound(_0x30c3e3,null))[_0x4204('0x25')](saveUpdates(_0x50de86[_0x4204('0x48')],null))[_0x4204('0x25')](respondWithResult(_0x30c3e3,null))['catch'](handleError(_0x30c3e3,null));};exports[_0x4204('0x26')]=function(_0x586a12,_0xa297b0){return db[_0x4204('0x2b')]['find']({'where':{'id':_0x586a12[_0x4204('0x49')]['id']}})['then'](handleEntityNotFound(_0xa297b0,null))[_0x4204('0x25')](removeEntity(_0xa297b0,null))[_0x4204('0x46')](handleError(_0xa297b0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 2f4fdf8..a53dfed 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 _0xaaf6=['moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xaaf6,0x182));var _0x6aaf=function(_0xe5e020,_0x2353ed){_0xe5e020=_0xe5e020-0x0;var _0x181023=_0xaaf6[_0xe5e020];return _0x181023;};'use strict';var _=require(_0x6aaf('0x0'));var util=require(_0x6aaf('0x1'));var logger=require(_0x6aaf('0x2'))(_0x6aaf('0x3'));var moment=require(_0x6aaf('0x4'));var BPromise=require('bluebird');var rp=require(_0x6aaf('0x5'));var fs=require('fs');var path=require(_0x6aaf('0x6'));var rimraf=require(_0x6aaf('0x7'));var config=require(_0x6aaf('0x8'));var attributes=require(_0x6aaf('0x9'));module['exports']=function(_0xbe18a8,_0x56a41b){return _0xbe18a8['define'](_0x6aaf('0xa'),attributes,{'tableName':_0x6aaf('0xb'),'paranoid':![],'indexes':[{'name':_0x6aaf('0xc'),'fields':[_0x6aaf('0xd'),_0x6aaf('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5c88=['../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39961c,_0x7cda36){var _0x16ed4b=function(_0x508fcb){while(--_0x508fcb){_0x39961c['push'](_0x39961c['shift']());}};_0x16ed4b(++_0x7cda36);}(_0x5c88,0x158));var _0x85c8=function(_0x3ec5a0,_0x5eac96){_0x3ec5a0=_0x3ec5a0-0x0;var _0x289540=_0x5c88[_0x3ec5a0];return _0x289540;};'use strict';var _=require(_0x85c8('0x0'));var util=require(_0x85c8('0x1'));var logger=require('../../config/logger')(_0x85c8('0x2'));var moment=require(_0x85c8('0x3'));var BPromise=require(_0x85c8('0x4'));var rp=require(_0x85c8('0x5'));var fs=require('fs');var path=require(_0x85c8('0x6'));var rimraf=require(_0x85c8('0x7'));var config=require(_0x85c8('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0x85c8('0x9')]=function(_0x50133f,_0x40614b){return _0x50133f[_0x85c8('0xa')](_0x85c8('0xb'),attributes,{'tableName':_0x85c8('0xc'),'paranoid':![],'indexes':[{'name':_0x85c8('0xd'),'fields':[_0x85c8('0xe'),_0x85c8('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 09d9443..e915af5 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 _0x0036=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x351370,_0x3fd174){var _0x25842f=function(_0x8d7af7){while(--_0x8d7af7){_0x351370['push'](_0x351370['shift']());}};_0x25842f(++_0x3fd174);}(_0x0036,0x73));var _0x6003=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0x0036[_0x18a577];return _0x1cb0c7;};'use strict';var _=require(_0x6003('0x0'));var util=require(_0x6003('0x1'));var moment=require(_0x6003('0x2'));var BPromise=require(_0x6003('0x3'));var rs=require(_0x6003('0x4'));var fs=require('fs');var Redis=require(_0x6003('0x5'));var db=require(_0x6003('0x6'))['db'];var utils=require(_0x6003('0x7'));var logger=require(_0x6003('0x8'))(_0x6003('0x9'));var config=require(_0x6003('0xa'));var jayson=require(_0x6003('0xb'));var client=jayson[_0x6003('0xc')][_0x6003('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3ddcff,_0x485fd4,_0x1674ba){return new BPromise(function(_0x1b6954,_0xc733fb){return client[_0x6003('0xe')](_0x3ddcff,_0x1674ba)[_0x6003('0xf')](function(_0x155977){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x485fd4,_0x6003('0x10'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x485fd4,_0x6003('0x10'),JSON[_0x6003('0x11')](_0x155977));if(_0x155977[_0x6003('0x12')]){if(_0x155977[_0x6003('0x12')][_0x6003('0x13')]===0x1f4){logger[_0x6003('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x485fd4,_0x155977[_0x6003('0x12')]['message']);return _0xc733fb(_0x155977[_0x6003('0x12')]['message']);}logger[_0x6003('0x12')](_0x6003('0x14'),_0x485fd4,_0x155977[_0x6003('0x12')][_0x6003('0x15')]);return _0x1b6954(_0x155977[_0x6003('0x12')][_0x6003('0x15')]);}else{logger[_0x6003('0x16')]('VoiceQueuesLog,\x20%s,\x20%s',_0x485fd4,_0x6003('0x10'));_0x1b6954(_0x155977[_0x6003('0x17')]['message']);}})[_0x6003('0x18')](function(_0x3d6ef4){logger[_0x6003('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x485fd4,_0x3d6ef4);_0xc733fb(_0x3d6ef4);});});} \ No newline at end of file +var _0x5694=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x149653,_0x3bcd29){var _0x12bfff=function(_0x197c27){while(--_0x197c27){_0x149653['push'](_0x149653['shift']());}};_0x12bfff(++_0x3bcd29);}(_0x5694,0x1ca));var _0x4569=function(_0x3feb1e,_0x4009db){_0x3feb1e=_0x3feb1e-0x0;var _0x1020f3=_0x5694[_0x3feb1e];return _0x1020f3;};'use strict';var _=require(_0x4569('0x0'));var util=require(_0x4569('0x1'));var moment=require(_0x4569('0x2'));var BPromise=require(_0x4569('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4569('0x4'));var db=require(_0x4569('0x5'))['db'];var utils=require(_0x4569('0x6'));var logger=require('../../config/logger')(_0x4569('0x7'));var config=require('../../config/environment');var jayson=require(_0x4569('0x8'));var client=jayson[_0x4569('0x9')][_0x4569('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x238f77,_0x3e31d0,_0x31199f){return new BPromise(function(_0x86dbc4,_0x2cbcfa){return client[_0x4569('0xb')](_0x238f77,_0x31199f)[_0x4569('0xc')](function(_0x5e4c6a){logger[_0x4569('0xd')](_0x4569('0xe'),_0x3e31d0,_0x4569('0xf'));logger[_0x4569('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3e31d0,'request\x20sent',JSON[_0x4569('0x11')](_0x5e4c6a));if(_0x5e4c6a[_0x4569('0x12')]){if(_0x5e4c6a[_0x4569('0x12')]['code']===0x1f4){logger[_0x4569('0x12')](_0x4569('0xe'),_0x3e31d0,_0x5e4c6a['error'][_0x4569('0x13')]);return _0x2cbcfa(_0x5e4c6a[_0x4569('0x12')][_0x4569('0x13')]);}logger[_0x4569('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3e31d0,_0x5e4c6a[_0x4569('0x12')][_0x4569('0x13')]);return _0x86dbc4(_0x5e4c6a[_0x4569('0x12')][_0x4569('0x13')]);}else{logger['info'](_0x4569('0xe'),_0x3e31d0,'request\x20sent');_0x86dbc4(_0x5e4c6a[_0x4569('0x14')][_0x4569('0x13')]);}})[_0x4569('0x15')](function(_0x4fc172){logger[_0x4569('0x12')](_0x4569('0xe'),_0x3e31d0,_0x4fc172);_0x2cbcfa(_0x4fc172);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1c33a74..ae75799 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 _0xf240=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','/:id','show','/:id/download','download','downloads','post','/:id/transcribe','runTranscribe'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xf240,0x1cd));var _0x0f24=function(_0x22804e,_0x46618c){_0x22804e=_0x22804e-0x0;var _0x129447=_0xf240[_0x22804e];return _0x129447;};'use strict';var multer=require(_0x0f24('0x0'));var util=require(_0x0f24('0x1'));var path=require(_0x0f24('0x2'));var timeout=require(_0x0f24('0x3'));var express=require(_0x0f24('0x4'));var router=express[_0x0f24('0x5')]();var fs_extra=require(_0x0f24('0x6'));var auth=require(_0x0f24('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x0f24('0x8')]('/',auth[_0x0f24('0x9')](),controller['index']);router['get'](_0x0f24('0xa'),auth[_0x0f24('0x9')](),controller['describe']);router['get'](_0x0f24('0xb'),auth[_0x0f24('0x9')](),controller[_0x0f24('0xc')]);router['get'](_0x0f24('0xd'),auth[_0x0f24('0x9')](),controller[_0x0f24('0xe')]);router[_0x0f24('0x8')]('/:id/downloads',controller[_0x0f24('0xf')]);router[_0x0f24('0x8')]('/:id/transcribe',auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x0f24('0x10')]('/',auth[_0x0f24('0x9')](),controller['create']);router[_0x0f24('0x10')](_0x0f24('0x11'),auth[_0x0f24('0x9')](),controller[_0x0f24('0x12')]);router[_0x0f24('0x13')](_0x0f24('0xb'),auth['isAuthenticated'](),controller[_0x0f24('0x14')]);router[_0x0f24('0x15')](_0x0f24('0xb'),auth[_0x0f24('0x9')](),controller[_0x0f24('0x16')]);module[_0x0f24('0x17')]=router; \ No newline at end of file +var _0xdc4c=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdc4c,0x17d));var _0xcdc4=function(_0x340dfb,_0x41ec24){_0x340dfb=_0x340dfb-0x0;var _0x2e0f54=_0xdc4c[_0x340dfb];return _0x2e0f54;};'use strict';var multer=require(_0xcdc4('0x0'));var util=require(_0xcdc4('0x1'));var path=require(_0xcdc4('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdc4('0x3'));var router=express[_0xcdc4('0x4')]();var fs_extra=require(_0xcdc4('0x5'));var auth=require(_0xcdc4('0x6'));var interaction=require(_0xcdc4('0x7'));var config=require(_0xcdc4('0x8'));var controller=require(_0xcdc4('0x9'));router[_0xcdc4('0xa')]('/',auth[_0xcdc4('0xb')](),controller[_0xcdc4('0xc')]);router[_0xcdc4('0xa')](_0xcdc4('0xd'),auth[_0xcdc4('0xb')](),controller[_0xcdc4('0xe')]);router['get'](_0xcdc4('0xf'),auth[_0xcdc4('0xb')](),controller['show']);router[_0xcdc4('0xa')](_0xcdc4('0x10'),auth[_0xcdc4('0xb')](),controller[_0xcdc4('0x11')]);router['get'](_0xcdc4('0x12'),controller[_0xcdc4('0x13')]);router[_0xcdc4('0xa')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xcdc4('0x14')]);router['post']('/',auth[_0xcdc4('0xb')](),controller[_0xcdc4('0x15')]);router[_0xcdc4('0x16')](_0xcdc4('0x17'),auth[_0xcdc4('0xb')](),controller[_0xcdc4('0x18')]);router[_0xcdc4('0x19')](_0xcdc4('0xf'),auth['isAuthenticated'](),controller[_0xcdc4('0x1a')]);router['delete'](_0xcdc4('0xf'),auth[_0xcdc4('0xb')](),controller[_0xcdc4('0x1b')]);module[_0xcdc4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1e03ffa..29fe593 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(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 22acc9b..a1a567a 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 _0x722e=['lodash','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','error','stack','name','send','index','map','fieldName','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VoiceRecording','then','includeAll','include','findAll','rows','show','params','options','find','catch','body','update','describe','download','../../components/encryptor','type','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','Sequelize','ValidationError','info','isNil','File:\x20\x22','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','language','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra'];(function(_0x3689fd,_0x47e501){var _0x507da5=function(_0x47966b){while(--_0x47966b){_0x3689fd['push'](_0x3689fd['shift']());}};_0x507da5(++_0x47e501);}(_0x722e,0x123));var _0xe722=function(_0x9c4bdb,_0x3bd1a1){_0x9c4bdb=_0x9c4bdb-0x0;var _0xffe970=_0x722e[_0x9c4bdb];return _0xffe970;};'use strict';var emlformat=require(_0xe722('0x0'));var rimraf=require(_0xe722('0x1'));var zipdir=require(_0xe722('0x2'));var jsonpatch=require(_0xe722('0x3'));var rp=require('request-promise');var moment=require(_0xe722('0x4'));var BPromise=require(_0xe722('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe722('0x6'));var sox=require(_0xe722('0x7'));var csv=require(_0xe722('0x8'));var ejs=require(_0xe722('0x9'));var fs=require('fs');var fs_extra=require(_0xe722('0xa'));var _=require(_0xe722('0xb'));var squel=require('squel');var crypto=require(_0xe722('0xc'));var jsforce=require(_0xe722('0xd'));var deskjs=require(_0xe722('0xe'));var toCsv=require(_0xe722('0x8'));var querystring=require(_0xe722('0xf'));var Papa=require('papaparse');var AWS=require(_0xe722('0x10'));var uuidv4=require(_0xe722('0x11'));var Redis=require(_0xe722('0x12'));var authService=require(_0xe722('0x13'));var qs=require(_0xe722('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe722('0x15'));var logger=require(_0xe722('0x16'))(_0xe722('0x17'));var utils=require('../../config/utils');var config=require(_0xe722('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe722('0x19'))['db'];function respondWithStatusCode(_0x531d23,_0x397bf6){_0x397bf6=_0x397bf6||0xcc;return function(_0x51f943){if(_0x51f943){return _0x531d23[_0xe722('0x1a')](_0x397bf6);}return _0x531d23[_0xe722('0x1b')](_0x397bf6)[_0xe722('0x1c')]();};}function respondWithResult(_0x1f1179,_0x59303d){_0x59303d=_0x59303d||0xc8;return function(_0x1f3529){if(_0x1f3529){return _0x1f1179['status'](_0x59303d)['json'](_0x1f3529);}};}function respondWithFilteredResult(_0x76140f,_0x3cbc33){return function(_0x5316a1){if(_0x5316a1){var _0x359693=typeof _0x3cbc33[_0xe722('0x1d')]===_0xe722('0x1e')&&typeof _0x3cbc33[_0xe722('0x1f')]===_0xe722('0x1e');var _0x40f2d2=_0x5316a1['count'];var _0x16be1b=_0x359693?0x0:_0x3cbc33[_0xe722('0x1d')];var _0x5d2881=_0x359693?_0x5316a1[_0xe722('0x20')]:_0x3cbc33[_0xe722('0x1d')]+_0x3cbc33[_0xe722('0x1f')];var _0x5b1f76;if(_0x5d2881>=_0x40f2d2){_0x5d2881=_0x40f2d2;_0x5b1f76=0xc8;}else{_0x5b1f76=0xce;}_0x76140f[_0xe722('0x1b')](_0x5b1f76);return _0x76140f[_0xe722('0x21')]('Content-Range',_0x16be1b+'-'+_0x5d2881+'/'+_0x40f2d2)[_0xe722('0x22')](_0x5316a1);}return null;};}function patchUpdates(_0x5ff6e9){return function(_0x5728c7){try{jsonpatch[_0xe722('0x23')](_0x5728c7,_0x5ff6e9,!![]);}catch(_0x4c42d8){return BPromise[_0xe722('0x24')](_0x4c42d8);}return _0x5728c7[_0xe722('0x25')]();};}function saveUpdates(_0x292bd2,_0x56b84f){return function(_0x108d23){if(_0x108d23){return _0x108d23['update'](_0x292bd2)['then'](function(_0x52ccdc){return _0x52ccdc;});}return null;};}function removeEntity(_0x12c791,_0x44f4d0){return function(_0x21f975){if(_0x21f975){return _0x21f975[_0xe722('0x26')]()['then'](function(){_0x12c791['status'](0xcc)[_0xe722('0x1c')]();});}};}function handleEntityNotFound(_0x5a5db6,_0x445373){return function(_0x4b9e7d){if(!_0x4b9e7d){_0x5a5db6[_0xe722('0x1a')](0x194);}return _0x4b9e7d;};}function handleError(_0x55cd3e,_0x51a1ec){_0x51a1ec=_0x51a1ec||0x1f4;return function(_0x2526b0){logger[_0xe722('0x27')](_0x2526b0[_0xe722('0x28')]);if(_0x2526b0[_0xe722('0x29')]){delete _0x2526b0['name'];}_0x55cd3e['status'](_0x51a1ec)[_0xe722('0x2a')](_0x2526b0);};}exports[_0xe722('0x2b')]=function(_0x229f34,_0x480e31){var _0x58c53c={},_0x216e59={},_0x5cca70={'count':0x0,'rows':[]};var _0x4cf144=_[_0xe722('0x2c')](db['VoiceRecording']['rawAttributes'],function(_0x3890a5){return{'name':_0x3890a5[_0xe722('0x2d')],'type':_0x3890a5['type']['key']};});_0x216e59['model']=_['differenceBy'](_[_0xe722('0x2c')](_0x4cf144,_0xe722('0x29')),[_0xe722('0x2e')]);_0x216e59[_0xe722('0x2f')]=_[_0xe722('0x30')](_0x229f34['query']);_0x216e59[_0xe722('0x31')]=_[_0xe722('0x32')](_0x216e59[_0xe722('0x33')],_0x216e59[_0xe722('0x2f')]);_0x58c53c['attributes']=_['intersection'](_0x216e59[_0xe722('0x33')],qs[_0xe722('0x34')](_0x229f34[_0xe722('0x2f')][_0xe722('0x34')]));_0x58c53c['attributes']=_0x58c53c[_0xe722('0x35')][_0xe722('0x36')]?_0x58c53c[_0xe722('0x35')]:_0x216e59[_0xe722('0x33')];if(!_0x229f34[_0xe722('0x2f')][_0xe722('0x37')](_0xe722('0x38'))){_0x58c53c[_0xe722('0x1f')]=qs[_0xe722('0x1f')](_0x229f34[_0xe722('0x2f')][_0xe722('0x1f')]);_0x58c53c[_0xe722('0x1d')]=qs[_0xe722('0x1d')](_0x229f34['query'][_0xe722('0x1d')]);}_0x58c53c[_0xe722('0x39')]=qs[_0xe722('0x3a')](_0x229f34[_0xe722('0x2f')][_0xe722('0x3a')]);_0x58c53c[_0xe722('0x3b')]=qs[_0xe722('0x31')](_['pick'](_0x229f34['query'],_0x216e59[_0xe722('0x31')]),_0x4cf144);if(_0x229f34[_0xe722('0x2f')][_0xe722('0x3c')]){_0x58c53c['where']=_[_0xe722('0x3d')](_0x58c53c[_0xe722('0x3b')],{'$or':_['map'](_0x4cf144,function(_0x17dcfd){if(_0x17dcfd['type']!=='VIRTUAL'){var _0x4a4f05={};_0x4a4f05[_0x17dcfd[_0xe722('0x29')]]={'$like':'%'+_0x229f34[_0xe722('0x2f')][_0xe722('0x3c')]+'%'};return _0x4a4f05;}})});}_0x58c53c=_[_0xe722('0x3d')]({},_0x58c53c,_0x229f34['options']);var _0x30aba0={'where':_0x58c53c[_0xe722('0x3b')]};return db[_0xe722('0x3e')][_0xe722('0x20')](_0x30aba0)[_0xe722('0x3f')](function(_0x2dbb4f){_0x5cca70['count']=_0x2dbb4f;if(_0x229f34[_0xe722('0x2f')][_0xe722('0x40')]){_0x58c53c[_0xe722('0x41')]=[{'all':!![]}];}return db[_0xe722('0x3e')][_0xe722('0x42')](_0x58c53c);})[_0xe722('0x3f')](function(_0x2c6706){_0x5cca70[_0xe722('0x43')]=_0x2c6706;return _0x5cca70;})[_0xe722('0x3f')](respondWithFilteredResult(_0x480e31,_0x58c53c))['catch'](handleError(_0x480e31,null));};exports[_0xe722('0x44')]=function(_0x315f51,_0x32197e){var _0x11d43f={'raw':![],'where':{'id':_0x315f51[_0xe722('0x45')]['id']}},_0x315ce4={};_0x315ce4['model']=_[_0xe722('0x30')](db[_0xe722('0x3e')]['rawAttributes']);_0x315ce4[_0xe722('0x2f')]=_[_0xe722('0x30')](_0x315f51['query']);_0x315ce4[_0xe722('0x31')]=_[_0xe722('0x32')](_0x315ce4[_0xe722('0x33')],_0x315ce4['query']);_0x11d43f['attributes']=_[_0xe722('0x32')](_0x315ce4[_0xe722('0x33')],qs[_0xe722('0x34')](_0x315f51[_0xe722('0x2f')][_0xe722('0x34')]));_0x11d43f[_0xe722('0x35')]=_0x11d43f['attributes'][_0xe722('0x36')]?_0x11d43f[_0xe722('0x35')]:_0x315ce4[_0xe722('0x33')];if(_0x315f51[_0xe722('0x2f')][_0xe722('0x40')]){_0x11d43f[_0xe722('0x41')]=[{'all':!![]}];}_0x11d43f=_['merge']({},_0x11d43f,_0x315f51[_0xe722('0x46')]);return db[_0xe722('0x3e')][_0xe722('0x47')](_0x11d43f)[_0xe722('0x3f')](handleEntityNotFound(_0x32197e,null))[_0xe722('0x3f')](respondWithResult(_0x32197e,null))[_0xe722('0x48')](handleError(_0x32197e,null));};exports['create']=function(_0x395de9,_0x36a3aa){return db[_0xe722('0x3e')]['create'](_0x395de9[_0xe722('0x49')],{})[_0xe722('0x3f')](respondWithResult(_0x36a3aa,0xc9))[_0xe722('0x48')](handleError(_0x36a3aa,null));};exports[_0xe722('0x4a')]=function(_0x2839e3,_0x3869e2){if(_0x2839e3[_0xe722('0x49')]['id']){delete _0x2839e3[_0xe722('0x49')]['id'];}return db[_0xe722('0x3e')]['find']({'where':{'id':_0x2839e3[_0xe722('0x45')]['id']}})[_0xe722('0x3f')](handleEntityNotFound(_0x3869e2,null))[_0xe722('0x3f')](saveUpdates(_0x2839e3[_0xe722('0x49')],null))[_0xe722('0x3f')](respondWithResult(_0x3869e2,null))['catch'](handleError(_0x3869e2,null));};exports[_0xe722('0x4b')]=function(_0x2c164e,_0x40d754){return db[_0xe722('0x3e')]['describe']()['then'](respondWithResult(_0x40d754,null))['catch'](handleError(_0x40d754,null));};exports[_0xe722('0x4c')]=function(_0x1efccc,_0x50e87a,_0x211292){var _0x4e6605=require(_0xe722('0x4d'));var _0x5152a0=![];var _0x130234={};if(_0x1efccc['query'][_0xe722('0x4e')]&&_0x1efccc[_0xe722('0x2f')][_0xe722('0x4e')]===_0xe722('0x4f')){_0x130234[_0xe722('0x4f')]=_0x1efccc['params']['id'];}else{_0x130234['id']=_0x1efccc[_0xe722('0x45')]['id'];}return db['VoiceRecording'][_0xe722('0x47')]({'where':_0x130234,'attributes':['id',_0xe722('0x50')],'raw':!![]})[_0xe722('0x3f')](handleEntityNotFound(_0x50e87a,null))['then'](function(_0x216b8f){if(_0x216b8f){var _0x3500cb=_0x216b8f['value'];var _0x2e64ac=util[_0xe722('0x2e')](_0xe722('0x51'),_0x3500cb);if(fs['existsSync'](_0x2e64ac)){_0x5152a0=!![];return _0x4e6605[_0xe722('0x52')](_0x2e64ac,_0x3500cb,config[_0xe722('0x53')][_0xe722('0x54')])['then'](function(){return _0x216b8f;});}return _0x216b8f;}})[_0xe722('0x3f')](function(_0x66598a){if(_0x66598a){var _0x28c352=_0x66598a[_0xe722('0x50')];if(!fs[_0xe722('0x55')](_0x28c352)){throw new db['Sequelize']['ValidationError'](_0xe722('0x56'));}if(_0x66598a[_0xe722('0x57')]){return _0x50e87a[_0xe722('0x4c')](_0x28c352,_0x66598a[_0xe722('0x57')]+path[_0xe722('0x58')](_0x28c352),function(){if(_0x5152a0){fs[_0xe722('0x59')](_0x28c352);}});}else{return _0x50e87a['download'](_0x28c352,function(_0x5a71a9){if(_0x5152a0){fs[_0xe722('0x59')](_0x28c352);}});}}})[_0xe722('0x48')](function(_0x6a307d){if(_0x6a307d[_0xe722('0x5a')]===_0xe722('0x56')){_0x50e87a['status'](0x194)[_0xe722('0x2a')](_0xe722('0x5b'));}else{return handleError(_0x50e87a,null);}});};exports[_0xe722('0x5c')]=function(_0x393dbd,_0x4197c9,_0x3c2479){var _0x4a51b4=require('../../components/encryptor');var _0x3d2943=![];var _0x26dd0c={'$and':[db[_0xe722('0x5d')][_0xe722('0x3b')](db[_0xe722('0x5d')]['fn']('MD5',db[_0xe722('0x5d')][_0xe722('0x5e')]('uniqueid')),_0x393dbd[_0xe722('0x2f')][_0xe722('0x5f')])]};if(_0x393dbd[_0xe722('0x2f')][_0xe722('0x4e')]&&_0x393dbd[_0xe722('0x2f')][_0xe722('0x4e')]===_0xe722('0x4f')){_0x26dd0c[_0xe722('0x60')][_0xe722('0x61')]({'uniqueid':_0x393dbd['params']['id']});}else{_0x26dd0c[_0xe722('0x60')][_0xe722('0x61')]({'id':_0x393dbd[_0xe722('0x45')]['id']});}return db['VoiceRecording'][_0xe722('0x47')]({'where':_0x26dd0c,'attributes':['id','value'],'raw':!![]})[_0xe722('0x3f')](handleEntityNotFound(_0x4197c9,null))[_0xe722('0x3f')](function(_0x151019){if(_0x151019){var _0x5207f2=util['format']('%s.cypher',_0x151019[_0xe722('0x50')]);if(fs[_0xe722('0x55')](_0x5207f2)){_0x3d2943=!![];return _0x4a51b4[_0xe722('0x52')](_0x5207f2,_0x151019[_0xe722('0x50')],config[_0xe722('0x53')][_0xe722('0x54')])[_0xe722('0x3f')](function(){return _0x151019;});}return _0x151019;}})['then'](function(_0x44723d){if(_0x44723d){if(!fs['existsSync'](_0x44723d[_0xe722('0x50')])){throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))](_0xe722('0x56'));}if(_0x44723d[_0xe722('0x57')]){return _0x4197c9['download'](_0x44723d[_0xe722('0x50')],_0x44723d[_0xe722('0x57')]+path[_0xe722('0x58')](_0x44723d[_0xe722('0x50')]),function(){if(_0x3d2943){fs[_0xe722('0x59')](_0x44723d['value']);}});}else{return _0x4197c9['download'](_0x44723d[_0xe722('0x50')],function(_0x31ff6c){if(_0x3d2943){fs['unlink'](_0x44723d[_0xe722('0x50')]);}});}}})[_0xe722('0x48')](handleError(_0x4197c9,null));};exports['destroy']=function(_0x42f6ce,_0x2fd916){return db['VoiceRecording']['find']({'where':{'id':_0x42f6ce[_0xe722('0x45')]['id']}})[_0xe722('0x3f')](function(_0x58c082){if(_['isNil'](_0x58c082)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58c082;})[_0xe722('0x3f')](function(_0x133783){var _0x1e781e=_0x133783['value'];logger[_0xe722('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x1e781e);if(!_[_0xe722('0x65')](_0x133783[_0xe722('0x50')])&&fs[_0xe722('0x55')](_0x1e781e)){logger[_0xe722('0x64')](_0xe722('0x66')+_0x1e781e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe722('0x67')](_0x1e781e);}_0x1e781e=_0x1e781e+_0xe722('0x68');if(!_['isNil'](_0x133783[_0xe722('0x50')])&&fs[_0xe722('0x55')](_0x1e781e)){logger['info'](_0xe722('0x66')+_0x1e781e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x1e781e);}return _0x133783;})[_0xe722('0x3f')](function(_0x4ba463){if(!_0x4ba463)throw new InternalError();return _0x4ba463[_0xe722('0x26')]();})[_0xe722('0x3f')](function(){_0x2fd916[_0xe722('0x1b')](0xcc)[_0xe722('0x1c')]();})[_0xe722('0x48')](handleError(_0x2fd916,null));};function getBucketslist(_0x1cd544,_0x120ca4,_0x4fcd2f){return new Promise(function(_0x9f55ab,_0x1db035){var _0x269fd7=new AWS['S3']({'accessKeyId':_0x120ca4,'secretAccessKey':_0x1cd544,'region':_0x4fcd2f});_0x269fd7[_0xe722('0x69')]({},function(_0x3105a2,_0x3d5761){if(_0x3105a2){return _0x1db035(_0x3105a2);}else{return _0x9f55ab(_0x3d5761);}});});}function createBucket(_0x1b599e,_0x40196b,_0xf00a45,_0x2a531c){return new Promise(function(_0x6f335,_0x32ba1d){var _0x204911=new AWS['S3']({'accessKeyId':_0x40196b,'secretAccessKey':_0x1b599e,'region':_0xf00a45});_0x204911[_0xe722('0x6a')]({'Bucket':_0x2a531c},function(_0x1bf906,_0x3dfd3a){if(_0x1bf906){return _0x32ba1d(_0x1bf906);}else{return _0x6f335(_0x3dfd3a);}});});}function uploadFile(_0x4171e1,_0x4d0b94,_0x36da6c,_0x52702a,_0x37989d,_0x2456e7){return new Promise(function(_0x151b4e,_0x2abfb4){var _0x230bfd=new AWS['S3']({'accessKeyId':_0x4d0b94,'secretAccessKey':_0x4171e1,'region':_0x36da6c});_0x230bfd[_0xe722('0x6b')]({'Bucket':_0x52702a,'Key':_0x37989d,'Body':_0x2456e7},function(_0x46f6db,_0x5efa13){if(_0x46f6db){return _0x2abfb4(_0x46f6db);}else{return _0x151b4e(_0x5efa13);}});});}function startTranscribe(_0x5a2466,_0x54c539,_0x3ca73d,_0x76975c,_0x1e70b1,_0x2393a4){return new Promise(function(_0x493b02,_0x505c5c){var _0xdb984c=new AWS[(_0xe722('0x6c'))]({'accessKeyId':_0x54c539,'secretAccessKey':_0x5a2466,'region':_0x3ca73d});_0xdb984c[_0xe722('0x6d')]({'TranscriptionJobName':_0x76975c,'LanguageCode':_0x1e70b1,'Media':{'MediaFileUri':_0x2393a4}},function(_0x1d56ea,_0x35d182){if(_0x1d56ea){return _0x505c5c(_0x1d56ea);}else{return _0x493b02(_0x35d182);}});});}function transcribe(_0x582332,_0x31962e,_0x3a46d0,_0x592fbc,_0x395143,_0x2ac725,_0x229b48){return new Promise(function(_0x5a10e9,_0xc8db84){var _0x1c545d={};logger[_0xe722('0x64')](util[_0xe722('0x2e')](_0xe722('0x6e'),_0x582332,_0x395143));return uploadFile(_0x31962e,_0x3a46d0,_0x592fbc,_0x395143,path['basename'](_0x2ac725),fs['readFileSync'](_0x2ac725))[_0xe722('0x3f')](function(_0x46c57d){logger[_0xe722('0x64')](util['format'](_0xe722('0x6f'),_0x582332,_0x395143,_0x46c57d[_0xe722('0x70')]));_0x1c545d[_0xe722('0x71')]=_0x46c57d[_0xe722('0x72')];_0x1c545d[_0xe722('0x73')]=_0x46c57d[_0xe722('0x70')];logger['info'](util[_0xe722('0x2e')](_0xe722('0x74'),_0x582332));return startTranscribe(_0x31962e,_0x3a46d0,_0x592fbc,uuidv4(),_0x229b48,_0x46c57d['Location']);})['then'](function(_0x52c96f){logger[_0xe722('0x64')](util['format'](_0xe722('0x75'),_0x582332,_0x52c96f[_0xe722('0x76')][_0xe722('0x77')]));_0x1c545d[_0xe722('0x78')]=_0x52c96f[_0xe722('0x76')][_0xe722('0x77')];_0x1c545d['transcribeStatus']=_0x52c96f[_0xe722('0x76')][_0xe722('0x79')];return _0x5a10e9(_0x1c545d);})[_0xe722('0x48')](function(_0x4443e7){return _0xc8db84(_0x4443e7);});});}exports[_0xe722('0x7a')]=function(_0x1063eb,_0x3273df,_0x56d434){var _0x560b94;var _0x650132;var _0x2257f5;var _0x2a4d67=require(_0xe722('0x4d'));return db[_0xe722('0x3e')][_0xe722('0x7b')]({'where':{'id':_0x1063eb[_0xe722('0x45')]['id']}})[_0xe722('0x3f')](function(_0x5f0c6f){if(_0x5f0c6f){var _0x927b94=util[_0xe722('0x2e')](_0xe722('0x51'),_0x5f0c6f[_0xe722('0x50')]);if(fs[_0xe722('0x55')](_0x927b94)){cypher=!![];return _0x2a4d67[_0xe722('0x52')](_0x927b94,_0x5f0c6f[_0xe722('0x50')],config[_0xe722('0x53')][_0xe722('0x54')])[_0xe722('0x3f')](function(){return _0x5f0c6f;});}return _0x5f0c6f;}})[_0xe722('0x3f')](function(_0x5ac3e5){if(!_0x5ac3e5){throw new db['Sequelize']['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x650132=_0x5ac3e5;return db[_0xe722('0x7c')][_0xe722('0x7b')]({'where':{'id':0x1}});})[_0xe722('0x3f')](handleEntityNotFound(_0x3273df,null))['then'](function(_0xc28821){if(_0xc28821){_0x560b94=_0xc28821;if(!_0x560b94[_0xe722('0x7d')]||!_0x560b94['transcribeAccountId']||!_0x560b94[_0xe722('0x7e')]||!_0x560b94['language']||!_0x560b94[_0xe722('0x71')]){throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))](_0xe722('0x7f'));}if(_0x1063eb[_0xe722('0x49')][_0xe722('0x80')]&&(!_0x560b94[_0xe722('0x81')]||!_0x560b94['sentimentAccountId']||!_0x560b94[_0xe722('0x82')]||!_0x560b94[_0xe722('0x83')]||!_0x560b94['bucket'])){throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xe722('0x7b')]({'where':{'id':_0x560b94[_0xe722('0x84')]}});}})[_0xe722('0x3f')](function(_0x39a6c1){if(!_0x39a6c1){throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))](_0xe722('0x85'));}if(!_0x39a6c1[_0xe722('0x86')]||!_0x39a6c1[_0xe722('0x87')]){throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))](_0xe722('0x88'));}_0x2257f5=_0x39a6c1;return getBucketslist(_0x2257f5[_0xe722('0x86')],_0x2257f5[_0xe722('0x87')],_0x560b94['transcribeRegion']);})[_0xe722('0x3f')](function(_0x5442e8){if(_0x5442e8&&_0x5442e8[_0xe722('0x89')]){var _0x3151a2=_[_0xe722('0x47')](_0x5442e8[_0xe722('0x89')],function(_0x2b4982){return _0x2b4982[_0xe722('0x8a')]===_0x560b94[_0xe722('0x71')];});if(!_0x3151a2){logger[_0xe722('0x64')](util[_0xe722('0x2e')](_0xe722('0x8b'),_0x1063eb[_0xe722('0x45')]['id'],_0x560b94[_0xe722('0x71')]));return createBucket(_0x2257f5['data1'],_0x2257f5[_0xe722('0x87')],_0x560b94[_0xe722('0x7e')],_0x560b94['bucket']);}logger[_0xe722('0x64')](util['format'](_0xe722('0x8c'),_0x1063eb[_0xe722('0x45')]['id'],_0x560b94[_0xe722('0x71')]));return;}})[_0xe722('0x3f')](function(_0x41c431){if(_0x650132[_0xe722('0x8d')]===_0xe722('0x8e')){return transcribe(_0x1063eb[_0xe722('0x45')]['id'],_0x2257f5[_0xe722('0x86')],_0x2257f5[_0xe722('0x87')],_0x560b94[_0xe722('0x7e')],_0x560b94[_0xe722('0x71')],_0x650132[_0xe722('0x50')],_0x560b94[_0xe722('0x83')]);}else{logger[_0xe722('0x64')](util[_0xe722('0x2e')](_0xe722('0x8f'),_0x1063eb[_0xe722('0x45')]['id']));return{'transcribeStatus':_0xe722('0x90')};}})[_0xe722('0x3f')](function(_0x4d7695){if(_0x4d7695){_0x4d7695[_0xe722('0x91')]=_0x1063eb['body']['runSentiment'];return _0x650132[_0xe722('0x92')](_0x4d7695);}})[_0xe722('0x3f')](respondWithResult(_0x3273df,null))['catch'](handleError(_0x3273df,null));};function writeFile(_0x59650a,_0x20e749){return new Promise(function(_0x2d3dbc,_0x11340f){fs['writeFile'](_0x20e749,_0x59650a,function(_0x2c120a,_0x45495f){if(_0x2c120a){return _0x11340f(_0x2c120a);}else{return _0x2d3dbc(_0x45495f);}});});}exports['downloadTranscribe']=function(_0x11a75a,_0xff411b,_0x33b4bd){return db[_0xe722('0x3e')][_0xe722('0x7b')]({'where':{'id':_0x11a75a[_0xe722('0x45')]['id']}})[_0xe722('0x3f')](handleEntityNotFound(_0xff411b))[_0xe722('0x3f')](function(_0x224ab7){if(_0x224ab7&&_0x224ab7[_0xe722('0x93')]){var _0x271068=_0x224ab7['fileText'];var _0x9dd897=config['root']+_0xe722('0x94')+_0x224ab7['id']+_0xe722('0x95');if(fs[_0xe722('0x55')](_0x9dd897)){return _0x9dd897;}return writeFile(_0x271068,_0x9dd897)[_0xe722('0x3f')](function(){return _0x9dd897;});}else{throw new db[(_0xe722('0x62'))][(_0xe722('0x63'))](_0xe722('0x96'));}})[_0xe722('0x3f')](function(_0x12fc8d){return _0xff411b[_0xe722('0x4c')](_0x12fc8d);})[_0xe722('0x48')](handleError(_0xff411b));}; \ No newline at end of file +var _0xbf0b=['update','destroy','then','error','name','send','index','VoiceRecording','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','format','secrets','recording','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','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','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data2','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x290a9b,_0x2e60fc){var _0x522a9b=function(_0x56e9e4){while(--_0x56e9e4){_0x290a9b['push'](_0x290a9b['shift']());}};_0x522a9b(++_0x2e60fc);}(_0xbf0b,0x199));var _0xbbf0=function(_0x277b27,_0x7a0c2a){_0x277b27=_0x277b27-0x0;var _0x251315=_0xbf0b[_0x277b27];return _0x251315;};'use strict';var emlformat=require(_0xbbf0('0x0'));var rimraf=require(_0xbbf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbf0('0x2'));var rp=require(_0xbbf0('0x3'));var moment=require(_0xbbf0('0x4'));var BPromise=require(_0xbbf0('0x5'));var Mustache=require('mustache');var util=require(_0xbbf0('0x6'));var path=require('path');var sox=require(_0xbbf0('0x7'));var csv=require('to-csv');var ejs=require(_0xbbf0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbf0('0x9'));var squel=require('squel');var crypto=require(_0xbbf0('0xa'));var jsforce=require(_0xbbf0('0xb'));var deskjs=require(_0xbbf0('0xc'));var toCsv=require(_0xbbf0('0xd'));var querystring=require('querystring');var Papa=require(_0xbbf0('0xe'));var AWS=require(_0xbbf0('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0xbbf0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbbf0('0x11'));var hardwareService=require(_0xbbf0('0x12'));var logger=require('../../config/logger')(_0xbbf0('0x13'));var utils=require(_0xbbf0('0x14'));var config=require(_0xbbf0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbf0('0x16'))['db'];function respondWithStatusCode(_0x26b424,_0x45f6e8){_0x45f6e8=_0x45f6e8||0xcc;return function(_0x10a98f){if(_0x10a98f){return _0x26b424[_0xbbf0('0x17')](_0x45f6e8);}return _0x26b424['status'](_0x45f6e8)['end']();};}function respondWithResult(_0x158728,_0x413985){_0x413985=_0x413985||0xc8;return function(_0x4c62ca){if(_0x4c62ca){return _0x158728[_0xbbf0('0x18')](_0x413985)[_0xbbf0('0x19')](_0x4c62ca);}};}function respondWithFilteredResult(_0x24ed26,_0x44f885){return function(_0x466a73){if(_0x466a73){var _0x29a10b=typeof _0x44f885[_0xbbf0('0x1a')]===_0xbbf0('0x1b')&&typeof _0x44f885[_0xbbf0('0x1c')]===_0xbbf0('0x1b');var _0x406e1e=_0x466a73[_0xbbf0('0x1d')];var _0x2e534b=_0x29a10b?0x0:_0x44f885[_0xbbf0('0x1a')];var _0x35389a=_0x29a10b?_0x466a73[_0xbbf0('0x1d')]:_0x44f885[_0xbbf0('0x1a')]+_0x44f885[_0xbbf0('0x1c')];var _0x17d7be;if(_0x35389a>=_0x406e1e){_0x35389a=_0x406e1e;_0x17d7be=0xc8;}else{_0x17d7be=0xce;}_0x24ed26['status'](_0x17d7be);return _0x24ed26[_0xbbf0('0x1e')](_0xbbf0('0x1f'),_0x2e534b+'-'+_0x35389a+'/'+_0x406e1e)[_0xbbf0('0x19')](_0x466a73);}return null;};}function patchUpdates(_0x38fcfc){return function(_0x1fffe8){try{jsonpatch[_0xbbf0('0x20')](_0x1fffe8,_0x38fcfc,!![]);}catch(_0x430e9c){return BPromise[_0xbbf0('0x21')](_0x430e9c);}return _0x1fffe8[_0xbbf0('0x22')]();};}function saveUpdates(_0x24c7cc,_0x2dce50){return function(_0x3b7d1f){if(_0x3b7d1f){return _0x3b7d1f[_0xbbf0('0x23')](_0x24c7cc)['then'](function(_0x2d314c){return _0x2d314c;});}return null;};}function removeEntity(_0xf58302,_0x11e412){return function(_0x5296dd){if(_0x5296dd){return _0x5296dd[_0xbbf0('0x24')]()[_0xbbf0('0x25')](function(){_0xf58302[_0xbbf0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29480b,_0x5a6a1e){return function(_0x328497){if(!_0x328497){_0x29480b[_0xbbf0('0x17')](0x194);}return _0x328497;};}function handleError(_0x5a329a,_0xd69629){_0xd69629=_0xd69629||0x1f4;return function(_0x5db75a){logger[_0xbbf0('0x26')](_0x5db75a['stack']);if(_0x5db75a[_0xbbf0('0x27')]){delete _0x5db75a['name'];}_0x5a329a[_0xbbf0('0x18')](_0xd69629)[_0xbbf0('0x28')](_0x5db75a);};}exports[_0xbbf0('0x29')]=function(_0x301ead,_0x1ff53c){var _0x6bde72={},_0x3af9ac={},_0x5ab47f={'count':0x0,'rows':[]};var _0x23e445=_['map'](db[_0xbbf0('0x2a')][_0xbbf0('0x2b')],function(_0x19da0a){return{'name':_0x19da0a[_0xbbf0('0x2c')],'type':_0x19da0a['type'][_0xbbf0('0x2d')]};});_0x3af9ac[_0xbbf0('0x2e')]=_['differenceBy'](_[_0xbbf0('0x2f')](_0x23e445,_0xbbf0('0x27')),['format']);_0x3af9ac[_0xbbf0('0x30')]=_[_0xbbf0('0x31')](_0x301ead[_0xbbf0('0x30')]);_0x3af9ac[_0xbbf0('0x32')]=_['intersection'](_0x3af9ac[_0xbbf0('0x2e')],_0x3af9ac[_0xbbf0('0x30')]);_0x6bde72[_0xbbf0('0x33')]=_[_0xbbf0('0x34')](_0x3af9ac[_0xbbf0('0x2e')],qs[_0xbbf0('0x35')](_0x301ead[_0xbbf0('0x30')]['fields']));_0x6bde72[_0xbbf0('0x33')]=_0x6bde72[_0xbbf0('0x33')][_0xbbf0('0x36')]?_0x6bde72[_0xbbf0('0x33')]:_0x3af9ac[_0xbbf0('0x2e')];if(!_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x37')](_0xbbf0('0x38'))){_0x6bde72[_0xbbf0('0x1c')]=qs[_0xbbf0('0x1c')](_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x1c')]);_0x6bde72['offset']=qs['offset'](_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x1a')]);}_0x6bde72[_0xbbf0('0x39')]=qs[_0xbbf0('0x3a')](_0x301ead['query'][_0xbbf0('0x3a')]);_0x6bde72['where']=qs[_0xbbf0('0x32')](_[_0xbbf0('0x3b')](_0x301ead[_0xbbf0('0x30')],_0x3af9ac[_0xbbf0('0x32')]),_0x23e445);if(_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x3c')]){_0x6bde72[_0xbbf0('0x3d')]=_[_0xbbf0('0x3e')](_0x6bde72[_0xbbf0('0x3d')],{'$or':_[_0xbbf0('0x2f')](_0x23e445,function(_0x4a4d37){if(_0x4a4d37[_0xbbf0('0x3f')]!==_0xbbf0('0x40')){var _0x981826={};_0x981826[_0x4a4d37[_0xbbf0('0x27')]]={'$like':'%'+_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x3c')]+'%'};return _0x981826;}})});}_0x6bde72=_[_0xbbf0('0x3e')]({},_0x6bde72,_0x301ead[_0xbbf0('0x41')]);var _0x3e0022={'where':_0x6bde72['where']};return db['VoiceRecording']['count'](_0x3e0022)[_0xbbf0('0x25')](function(_0x28b82e){_0x5ab47f[_0xbbf0('0x1d')]=_0x28b82e;if(_0x301ead[_0xbbf0('0x30')][_0xbbf0('0x42')]){_0x6bde72[_0xbbf0('0x43')]=[{'all':!![]}];}return db[_0xbbf0('0x2a')]['findAll'](_0x6bde72);})['then'](function(_0x35c235){_0x5ab47f['rows']=_0x35c235;return _0x5ab47f;})[_0xbbf0('0x25')](respondWithFilteredResult(_0x1ff53c,_0x6bde72))[_0xbbf0('0x44')](handleError(_0x1ff53c,null));};exports[_0xbbf0('0x45')]=function(_0x44f459,_0x344e8d){var _0x407405={'raw':![],'where':{'id':_0x44f459[_0xbbf0('0x46')]['id']}},_0x405e2c={};_0x405e2c['model']=_['keys'](db[_0xbbf0('0x2a')][_0xbbf0('0x2b')]);_0x405e2c[_0xbbf0('0x30')]=_[_0xbbf0('0x31')](_0x44f459[_0xbbf0('0x30')]);_0x405e2c[_0xbbf0('0x32')]=_[_0xbbf0('0x34')](_0x405e2c[_0xbbf0('0x2e')],_0x405e2c[_0xbbf0('0x30')]);_0x407405['attributes']=_[_0xbbf0('0x34')](_0x405e2c[_0xbbf0('0x2e')],qs['fields'](_0x44f459[_0xbbf0('0x30')]['fields']));_0x407405[_0xbbf0('0x33')]=_0x407405[_0xbbf0('0x33')][_0xbbf0('0x36')]?_0x407405[_0xbbf0('0x33')]:_0x405e2c[_0xbbf0('0x2e')];if(_0x44f459[_0xbbf0('0x30')][_0xbbf0('0x42')]){_0x407405[_0xbbf0('0x43')]=[{'all':!![]}];}_0x407405=_[_0xbbf0('0x3e')]({},_0x407405,_0x44f459['options']);return db[_0xbbf0('0x2a')]['find'](_0x407405)['then'](handleEntityNotFound(_0x344e8d,null))['then'](respondWithResult(_0x344e8d,null))[_0xbbf0('0x44')](handleError(_0x344e8d,null));};exports[_0xbbf0('0x47')]=function(_0x10667a,_0x2aa483){return db['VoiceRecording'][_0xbbf0('0x47')](_0x10667a[_0xbbf0('0x48')],{})['then'](respondWithResult(_0x2aa483,0xc9))['catch'](handleError(_0x2aa483,null));};exports['update']=function(_0x487f8e,_0x5e8c9c){if(_0x487f8e['body']['id']){delete _0x487f8e[_0xbbf0('0x48')]['id'];}return db[_0xbbf0('0x2a')][_0xbbf0('0x49')]({'where':{'id':_0x487f8e[_0xbbf0('0x46')]['id']}})[_0xbbf0('0x25')](handleEntityNotFound(_0x5e8c9c,null))[_0xbbf0('0x25')](saveUpdates(_0x487f8e[_0xbbf0('0x48')],null))['then'](respondWithResult(_0x5e8c9c,null))[_0xbbf0('0x44')](handleError(_0x5e8c9c,null));};exports['describe']=function(_0x28ff9e,_0x37298e){return db[_0xbbf0('0x2a')][_0xbbf0('0x4a')]()[_0xbbf0('0x25')](respondWithResult(_0x37298e,null))['catch'](handleError(_0x37298e,null));};exports[_0xbbf0('0x4b')]=function(_0x40d779,_0x365391,_0x1ece81){var _0xb802eb=require(_0xbbf0('0x4c'));var _0x348d8f=![];var _0x59da5e={};if(_0x40d779[_0xbbf0('0x30')][_0xbbf0('0x3f')]&&_0x40d779[_0xbbf0('0x30')][_0xbbf0('0x3f')]===_0xbbf0('0x4d')){_0x59da5e[_0xbbf0('0x4d')]=_0x40d779[_0xbbf0('0x46')]['id'];}else{_0x59da5e['id']=_0x40d779[_0xbbf0('0x46')]['id'];}return db[_0xbbf0('0x2a')][_0xbbf0('0x49')]({'where':_0x59da5e,'attributes':['id',_0xbbf0('0x4e')],'raw':!![]})[_0xbbf0('0x25')](handleEntityNotFound(_0x365391,null))[_0xbbf0('0x25')](function(_0x451690){if(_0x451690){var _0x18ca63=_0x451690[_0xbbf0('0x4e')];var _0x25448e=util['format'](_0xbbf0('0x4f'),_0x18ca63);if(fs[_0xbbf0('0x50')](_0x25448e)){_0x348d8f=!![];return _0xb802eb[_0xbbf0('0x51')](_0x25448e,_0x18ca63,config['secrets']['recording'])[_0xbbf0('0x25')](function(){return _0x451690;});}return _0x451690;}})[_0xbbf0('0x25')](function(_0x39e34c){if(_0x39e34c){var _0x374a96=_0x39e34c[_0xbbf0('0x4e')];if(!fs[_0xbbf0('0x50')](_0x374a96)){throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))](_0xbbf0('0x54'));}if(_0x39e34c[_0xbbf0('0x55')]){return _0x365391['download'](_0x374a96,_0x39e34c[_0xbbf0('0x55')]+path[_0xbbf0('0x56')](_0x374a96),function(){if(_0x348d8f){fs[_0xbbf0('0x57')](_0x374a96);}});}else{return _0x365391[_0xbbf0('0x4b')](_0x374a96,function(_0x3e759d){if(_0x348d8f){fs[_0xbbf0('0x57')](_0x374a96);}});}}})['catch'](function(_0x415ecd){if(_0x415ecd[_0xbbf0('0x58')]===_0xbbf0('0x54')){_0x365391[_0xbbf0('0x18')](0x194)[_0xbbf0('0x28')](_0xbbf0('0x59'));}else{return handleError(_0x365391,null);}});};exports['downloads']=function(_0x522c70,_0x40ad2b,_0x2dd9b1){var _0x43cf3e=require(_0xbbf0('0x4c'));var _0x2112a7=![];var _0x1a0858={'$and':[db[_0xbbf0('0x5a')][_0xbbf0('0x3d')](db['sequelize']['fn'](_0xbbf0('0x5b'),db['sequelize'][_0xbbf0('0x5c')]('uniqueid')),_0x522c70['query'][_0xbbf0('0x5d')])]};if(_0x522c70[_0xbbf0('0x30')]['type']&&_0x522c70['query'][_0xbbf0('0x3f')]===_0xbbf0('0x4d')){_0x1a0858[_0xbbf0('0x5e')]['push']({'uniqueid':_0x522c70[_0xbbf0('0x46')]['id']});}else{_0x1a0858['$and'][_0xbbf0('0x5f')]({'id':_0x522c70[_0xbbf0('0x46')]['id']});}return db['VoiceRecording'][_0xbbf0('0x49')]({'where':_0x1a0858,'attributes':['id','value'],'raw':!![]})[_0xbbf0('0x25')](handleEntityNotFound(_0x40ad2b,null))[_0xbbf0('0x25')](function(_0x359945){if(_0x359945){var _0x21264a=util[_0xbbf0('0x60')]('%s.cypher',_0x359945['value']);if(fs['existsSync'](_0x21264a)){_0x2112a7=!![];return _0x43cf3e[_0xbbf0('0x51')](_0x21264a,_0x359945['value'],config[_0xbbf0('0x61')][_0xbbf0('0x62')])['then'](function(){return _0x359945;});}return _0x359945;}})[_0xbbf0('0x25')](function(_0xd737d4){if(_0xd737d4){if(!fs[_0xbbf0('0x50')](_0xd737d4['value'])){throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))]('VoiceRecording\x20not\x20found');}if(_0xd737d4['filename']){return _0x40ad2b[_0xbbf0('0x4b')](_0xd737d4[_0xbbf0('0x4e')],_0xd737d4[_0xbbf0('0x55')]+path[_0xbbf0('0x56')](_0xd737d4[_0xbbf0('0x4e')]),function(){if(_0x2112a7){fs[_0xbbf0('0x57')](_0xd737d4[_0xbbf0('0x4e')]);}});}else{return _0x40ad2b[_0xbbf0('0x4b')](_0xd737d4['value'],function(_0x4bee96){if(_0x2112a7){fs['unlink'](_0xd737d4[_0xbbf0('0x4e')]);}});}}})[_0xbbf0('0x44')](handleError(_0x40ad2b,null));};exports[_0xbbf0('0x24')]=function(_0x1ab06f,_0x1ee0e6){return db[_0xbbf0('0x2a')][_0xbbf0('0x49')]({'where':{'id':_0x1ab06f[_0xbbf0('0x46')]['id']}})['then'](function(_0x3137f6){if(_[_0xbbf0('0x63')](_0x3137f6)){throw new ReferenceError(_0xbbf0('0x64'));}return _0x3137f6;})['then'](function(_0x5df7cf){var _0x6fb282=_0x5df7cf[_0xbbf0('0x4e')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x6fb282);if(!_[_0xbbf0('0x63')](_0x5df7cf[_0xbbf0('0x4e')])&&fs[_0xbbf0('0x50')](_0x6fb282)){logger[_0xbbf0('0x65')](_0xbbf0('0x66')+_0x6fb282+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbbf0('0x67')](_0x6fb282);}_0x6fb282=_0x6fb282+'.cypher';if(!_[_0xbbf0('0x63')](_0x5df7cf['value'])&&fs['existsSync'](_0x6fb282)){logger[_0xbbf0('0x65')](_0xbbf0('0x66')+_0x6fb282+_0xbbf0('0x68'));fs[_0xbbf0('0x67')](_0x6fb282);}return _0x5df7cf;})[_0xbbf0('0x25')](function(_0x2ef780){if(!_0x2ef780)throw new InternalError();return _0x2ef780[_0xbbf0('0x24')]();})[_0xbbf0('0x25')](function(){_0x1ee0e6['status'](0xcc)['end']();})['catch'](handleError(_0x1ee0e6,null));};function getBucketslist(_0x558ebe,_0x25d443,_0x573c00){return new Promise(function(_0x8d0cb7,_0xf90e91){var _0x1d4014=new AWS['S3']({'accessKeyId':_0x25d443,'secretAccessKey':_0x558ebe,'region':_0x573c00});_0x1d4014[_0xbbf0('0x69')]({},function(_0xbd063,_0x20bd23){if(_0xbd063){return _0xf90e91(_0xbd063);}else{return _0x8d0cb7(_0x20bd23);}});});}function createBucket(_0x586f97,_0x529311,_0x19bfc3,_0x55034f){return new Promise(function(_0x5336cf,_0x35370b){var _0x398480=new AWS['S3']({'accessKeyId':_0x529311,'secretAccessKey':_0x586f97,'region':_0x19bfc3});_0x398480[_0xbbf0('0x6a')]({'Bucket':_0x55034f},function(_0x499936,_0x18ff1d){if(_0x499936){return _0x35370b(_0x499936);}else{return _0x5336cf(_0x18ff1d);}});});}function uploadFile(_0x55716a,_0x5ab8d3,_0x5e154e,_0xb808be,_0x26f092,_0x45564c){return new Promise(function(_0x100a88,_0x470154){var _0x4683e0=new AWS['S3']({'accessKeyId':_0x5ab8d3,'secretAccessKey':_0x55716a,'region':_0x5e154e});_0x4683e0['upload']({'Bucket':_0xb808be,'Key':_0x26f092,'Body':_0x45564c},function(_0x25b362,_0x69b6cc){if(_0x25b362){return _0x470154(_0x25b362);}else{return _0x100a88(_0x69b6cc);}});});}function startTranscribe(_0x347b47,_0x1858cc,_0x39c9dc,_0x7b788a,_0x1d6155,_0x247c81){return new Promise(function(_0x258bf4,_0x5dca5b){var _0x2f8cd1=new AWS['TranscribeService']({'accessKeyId':_0x1858cc,'secretAccessKey':_0x347b47,'region':_0x39c9dc});_0x2f8cd1[_0xbbf0('0x6b')]({'TranscriptionJobName':_0x7b788a,'LanguageCode':_0x1d6155,'Media':{'MediaFileUri':_0x247c81}},function(_0x50641c,_0x538413){if(_0x50641c){return _0x5dca5b(_0x50641c);}else{return _0x258bf4(_0x538413);}});});}function transcribe(_0x2fb796,_0x416982,_0x3b0222,_0x1efedb,_0x4c30d2,_0x1ab340,_0x1bc7dd){return new Promise(function(_0x516847,_0x1ba6fe){var _0x6542ba={};logger['info'](util[_0xbbf0('0x60')](_0xbbf0('0x6c'),_0x2fb796,_0x4c30d2));return uploadFile(_0x416982,_0x3b0222,_0x1efedb,_0x4c30d2,path[_0xbbf0('0x6d')](_0x1ab340),fs[_0xbbf0('0x6e')](_0x1ab340))[_0xbbf0('0x25')](function(_0x2ccff6){logger[_0xbbf0('0x65')](util[_0xbbf0('0x60')](_0xbbf0('0x6f'),_0x2fb796,_0x4c30d2,_0x2ccff6[_0xbbf0('0x70')]));_0x6542ba[_0xbbf0('0x71')]=_0x2ccff6[_0xbbf0('0x72')];_0x6542ba['location']=_0x2ccff6['Location'];logger[_0xbbf0('0x65')](util[_0xbbf0('0x60')](_0xbbf0('0x73'),_0x2fb796));return startTranscribe(_0x416982,_0x3b0222,_0x1efedb,uuidv4(),_0x1bc7dd,_0x2ccff6['Location']);})[_0xbbf0('0x25')](function(_0x2e547e){logger[_0xbbf0('0x65')](util[_0xbbf0('0x60')](_0xbbf0('0x74'),_0x2fb796,_0x2e547e[_0xbbf0('0x75')][_0xbbf0('0x76')]));_0x6542ba['transcribeName']=_0x2e547e['TranscriptionJob']['TranscriptionJobName'];_0x6542ba[_0xbbf0('0x77')]=_0x2e547e[_0xbbf0('0x75')][_0xbbf0('0x78')];return _0x516847(_0x6542ba);})['catch'](function(_0x4fc8fe){return _0x1ba6fe(_0x4fc8fe);});});}exports[_0xbbf0('0x79')]=function(_0x3913b9,_0x4de99a,_0x5959e3){var _0x2bce1a;var _0x268642;var _0x1e9c74;var _0x5e33da=require(_0xbbf0('0x4c'));return db[_0xbbf0('0x2a')][_0xbbf0('0x7a')]({'where':{'id':_0x3913b9['params']['id']}})[_0xbbf0('0x25')](function(_0x5d34a4){if(_0x5d34a4){var _0x428e10=util[_0xbbf0('0x60')](_0xbbf0('0x4f'),_0x5d34a4[_0xbbf0('0x4e')]);if(fs[_0xbbf0('0x50')](_0x428e10)){cypher=!![];return _0x5e33da[_0xbbf0('0x51')](_0x428e10,_0x5d34a4[_0xbbf0('0x4e')],config[_0xbbf0('0x61')][_0xbbf0('0x62')])[_0xbbf0('0x25')](function(){return _0x5d34a4;});}return _0x5d34a4;}})[_0xbbf0('0x25')](function(_0x18f508){if(!_0x18f508){throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))](_0xbbf0('0x7b'));}_0x268642=_0x18f508;return db[_0xbbf0('0x7c')][_0xbbf0('0x7a')]({'where':{'id':0x1}});})[_0xbbf0('0x25')](handleEntityNotFound(_0x4de99a,null))[_0xbbf0('0x25')](function(_0x10f4a4){if(_0x10f4a4){_0x2bce1a=_0x10f4a4;if(!_0x2bce1a[_0xbbf0('0x7d')]||!_0x2bce1a[_0xbbf0('0x7e')]||!_0x2bce1a[_0xbbf0('0x7f')]||!_0x2bce1a[_0xbbf0('0x80')]||!_0x2bce1a[_0xbbf0('0x71')]){throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))](_0xbbf0('0x81'));}if(_0x3913b9[_0xbbf0('0x48')][_0xbbf0('0x82')]&&(!_0x2bce1a['sentiment']||!_0x2bce1a['sentimentAccountId']||!_0x2bce1a['sentimentRegion']||!_0x2bce1a['language']||!_0x2bce1a[_0xbbf0('0x71')])){throw new db['Sequelize'][(_0xbbf0('0x53'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xbbf0('0x7a')]({'where':{'id':_0x2bce1a[_0xbbf0('0x7e')]}});}})[_0xbbf0('0x25')](function(_0x31e8b8){if(!_0x31e8b8){throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))](_0xbbf0('0x83'));}if(!_0x31e8b8[_0xbbf0('0x84')]||!_0x31e8b8['data2']){throw new db['Sequelize'][(_0xbbf0('0x53'))](_0xbbf0('0x85'));}_0x1e9c74=_0x31e8b8;return getBucketslist(_0x1e9c74[_0xbbf0('0x84')],_0x1e9c74['data2'],_0x2bce1a[_0xbbf0('0x7f')]);})[_0xbbf0('0x25')](function(_0x4e8fbf){if(_0x4e8fbf&&_0x4e8fbf[_0xbbf0('0x86')]){var _0x32dd14=_[_0xbbf0('0x49')](_0x4e8fbf[_0xbbf0('0x86')],function(_0x2d39e1){return _0x2d39e1[_0xbbf0('0x87')]===_0x2bce1a[_0xbbf0('0x71')];});if(!_0x32dd14){logger[_0xbbf0('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x3913b9[_0xbbf0('0x46')]['id'],_0x2bce1a[_0xbbf0('0x71')]));return createBucket(_0x1e9c74[_0xbbf0('0x84')],_0x1e9c74['data2'],_0x2bce1a[_0xbbf0('0x7f')],_0x2bce1a[_0xbbf0('0x71')]);}logger[_0xbbf0('0x65')](util[_0xbbf0('0x60')](_0xbbf0('0x88'),_0x3913b9['params']['id'],_0x2bce1a[_0xbbf0('0x71')]));return;}})[_0xbbf0('0x25')](function(_0x503981){if(_0x268642[_0xbbf0('0x77')]===_0xbbf0('0x89')){return transcribe(_0x3913b9['params']['id'],_0x1e9c74['data1'],_0x1e9c74[_0xbbf0('0x8a')],_0x2bce1a['transcribeRegion'],_0x2bce1a[_0xbbf0('0x71')],_0x268642[_0xbbf0('0x4e')],_0x2bce1a['language']);}else{logger[_0xbbf0('0x65')](util['format'](_0xbbf0('0x8b'),_0x3913b9['params']['id']));return{'transcribeStatus':_0xbbf0('0x8c')};}})[_0xbbf0('0x25')](function(_0x111ed9){if(_0x111ed9){_0x111ed9[_0xbbf0('0x8d')]=_0x3913b9['body'][_0xbbf0('0x82')];return _0x268642[_0xbbf0('0x8e')](_0x111ed9);}})[_0xbbf0('0x25')](respondWithResult(_0x4de99a,null))[_0xbbf0('0x44')](handleError(_0x4de99a,null));};function writeFile(_0x5da0d9,_0x3a9444){return new Promise(function(_0x4bfe61,_0x14d27a){fs['writeFile'](_0x3a9444,_0x5da0d9,function(_0x164097,_0x48d269){if(_0x164097){return _0x14d27a(_0x164097);}else{return _0x4bfe61(_0x48d269);}});});}exports[_0xbbf0('0x8f')]=function(_0x1e5107,_0x3be235,_0x873ad3){return db[_0xbbf0('0x2a')][_0xbbf0('0x7a')]({'where':{'id':_0x1e5107[_0xbbf0('0x46')]['id']}})[_0xbbf0('0x25')](handleEntityNotFound(_0x3be235))[_0xbbf0('0x25')](function(_0x29c73e){if(_0x29c73e&&_0x29c73e[_0xbbf0('0x90')]){var _0x16e224=_0x29c73e[_0xbbf0('0x90')];var _0xca8f0f=config[_0xbbf0('0x91')]+'/server/files/transcribes/transcribe_'+_0x29c73e['id']+_0xbbf0('0x92');if(fs[_0xbbf0('0x50')](_0xca8f0f)){return _0xca8f0f;}return writeFile(_0x16e224,_0xca8f0f)[_0xbbf0('0x25')](function(){return _0xca8f0f;});}else{throw new db[(_0xbbf0('0x52'))][(_0xbbf0('0x53'))](_0xbbf0('0x93'));}})[_0xbbf0('0x25')](function(_0x24eeba){return _0x3be235[_0xbbf0('0x4b')](_0x24eeba);})['catch'](handleError(_0x3be235));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 49a00d4..33e68ce 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 _0x43b1=['./voiceRecording.attributes','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x43b1,0x94));var _0x143b=function(_0x140e20,_0x503bd4){_0x140e20=_0x140e20-0x0;var _0x4ebe18=_0x43b1[_0x140e20];return _0x4ebe18;};'use strict';var _=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var logger=require(_0x143b('0x2'))('api');var moment=require(_0x143b('0x3'));var BPromise=require(_0x143b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x143b('0x5'));var rimraf=require(_0x143b('0x6'));var config=require(_0x143b('0x7'));var attributes=require(_0x143b('0x8'));module['exports']=function(_0x16c512,_0x208015){return _0x16c512[_0x143b('0x9')](_0x143b('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x143b('0xb'),'fields':[_0x143b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe083=['request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','api','moment','bluebird'];(function(_0x418edb,_0x57a3ac){var _0x27473f=function(_0x2d0b8c){while(--_0x2d0b8c){_0x418edb['push'](_0x418edb['shift']());}};_0x27473f(++_0x57a3ac);}(_0xe083,0x1dc));var _0x3e08=function(_0x28ba37,_0x3f42f7){_0x28ba37=_0x28ba37-0x0;var _0x415320=_0xe083[_0x28ba37];return _0x415320;};'use strict';var _=require(_0x3e08('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3e08('0x1'));var moment=require(_0x3e08('0x2'));var BPromise=require(_0x3e08('0x3'));var rp=require(_0x3e08('0x4'));var fs=require('fs');var path=require(_0x3e08('0x5'));var rimraf=require(_0x3e08('0x6'));var config=require(_0x3e08('0x7'));var attributes=require(_0x3e08('0x8'));module[_0x3e08('0x9')]=function(_0x3c3079,_0x340b37){return _0x3c3079['define']('VoiceRecording',attributes,{'tableName':_0x3e08('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3e08('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index eeb64f4..9ac9984 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 _0x6a55=['callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateVoiceRecording','update','body','options','where','limit','findOne'];(function(_0x5000e9,_0x50e2a0){var _0x2dd719=function(_0x3a45e3){while(--_0x3a45e3){_0x5000e9['push'](_0x5000e9['shift']());}};_0x2dd719(++_0x50e2a0);}(_0x6a55,0xdb));var _0x56a5=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0x6a55[_0x3b6cc7];return _0x37f564;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56a5('0x2'));var logger=require('../../config/logger')(_0x56a5('0x3'));var config=require('../../config/environment');var jayson=require(_0x56a5('0x4'));var client=jayson[_0x56a5('0x5')][_0x56a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x293ea1,_0x444c65,_0x2272d9){return new BPromise(function(_0x2b8f57,_0x387dcb){return client['request'](_0x293ea1,_0x2272d9)[_0x56a5('0x7')](function(_0xf15490){logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x444c65,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0xf15490));if(_0xf15490['error']){if(_0xf15490['error'][_0x56a5('0xe')]===0x1f4){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x387dcb(_0xf15490[_0x56a5('0xf')]['message']);}logger['error'](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x2b8f57(_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,'request\x20sent');_0x2b8f57(_0xf15490[_0x56a5('0x11')]['message']);}})[_0x56a5('0x12')](function(_0x51d031){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0x51d031);_0x387dcb(_0x51d031);});});}exports[_0x56a5('0x13')]=function(_0x28fe74){var _0x1ba472=this;return new Promise(function(_0x143f3d,_0x1dddec){return db['VoiceRecording'][_0x56a5('0x14')](_0x28fe74[_0x56a5('0x15')],{'raw':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')][_0x56a5('0x17')]||null:null,'attributes':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')]['attributes']||null:null,'limit':_0x28fe74['options']?_0x28fe74[_0x56a5('0x16')][_0x56a5('0x18')]||null:null})['then'](function(_0x1556eb){logger[_0x56a5('0x8')](_0x56a5('0x13'),_0x28fe74);logger[_0x56a5('0xb')](_0x56a5('0x13'),_0x28fe74,JSON[_0x56a5('0xd')](_0x1556eb));_0x143f3d(_0x1556eb);})[_0x56a5('0x12')](function(_0x8431df){logger[_0x56a5('0xf')](_0x56a5('0x13'),_0x8431df[_0x56a5('0x10')],_0x28fe74);_0x1dddec(_0x1ba472[_0x56a5('0xf')](0x1f4,_0x8431df[_0x56a5('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x5c76a7){var _0x2d8e68=this;return new Promise(function(_0x42cd45,_0x2706f9){var _0x43a815=require('../../components/encryptor');var _0x18e863;return db['Setting'][_0x56a5('0x19')]({'attributes':['id',_0x56a5('0x1a')],'where':{'id':0x1},'raw':!![]})[_0x56a5('0x7')](function(_0x284ee5){_0x18e863=_0x284ee5;return db['VoiceRecording'][_0x56a5('0x1b')](_0x5c76a7[_0x56a5('0x15')]);})[_0x56a5('0x7')](function(_0x51ef6f){if(_0x18e863[_0x56a5('0x1a')]&&fs[_0x56a5('0x1c')](_0x51ef6f[_0x56a5('0x1d')])){var _0x214649=util[_0x56a5('0x1e')]('%s.cypher',_0x51ef6f[_0x56a5('0x1d')]);return _0x43a815[_0x56a5('0x1f')](_0x51ef6f[_0x56a5('0x1d')],_0x214649,config[_0x56a5('0x20')][_0x56a5('0x21')])['then'](function(){fs['unlink'](_0x51ef6f[_0x56a5('0x1d')]);logger[_0x56a5('0x8')](_0x56a5('0x22'));return _0x51ef6f;});}return _0x51ef6f;})['then'](function(_0x1de021){logger[_0x56a5('0x8')]('CreateVoiceRecording',_0x5c76a7);logger['debug']('CreateVoiceRecording',_0x5c76a7,JSON['stringify'](_0x1de021));_0x42cd45(_0x1de021);})[_0x56a5('0x12')](function(_0x29c8f1){logger[_0x56a5('0xf')]('CreateVoiceRecording',_0x29c8f1[_0x56a5('0x10')],_0x5c76a7);_0x2706f9(_0x2d8e68['error'](0x1f4,_0x29c8f1[_0x56a5('0x10')]));});});}; \ No newline at end of file +var _0x9f0e=['format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x9f0e,0x116));var _0xe9f0=function(_0xd2ff50,_0x1de17e){_0xd2ff50=_0xd2ff50-0x0;var _0xc871c9=_0x9f0e[_0xd2ff50];return _0xc871c9;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0x2ab12b['body'],{'raw':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options']['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0xb')](function(_0x316cdf){logger[_0xe9f0('0xc')]('UpdateVoiceRecording',_0x2ab12b);logger[_0xe9f0('0xf')](_0xe9f0('0x16'),_0x2ab12b,JSON[_0xe9f0('0x11')](_0x316cdf));_0x59bf5a(_0x316cdf);})[_0xe9f0('0x15')](function(_0x3ca991){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x3ca991[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x3ca991[_0xe9f0('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x371095){var _0x27541f=this;return new Promise(function(_0x2ddfba,_0x1a8478){var _0x4cf1b1=require(_0xe9f0('0x1d'));var _0x2613fd;return db[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'attributes':['id',_0xe9f0('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x130f96){_0x2613fd=_0x130f96;return db[_0xe9f0('0x17')][_0xe9f0('0x21')](_0x371095[_0xe9f0('0x22')]);})[_0xe9f0('0xb')](function(_0xd19788){if(_0x2613fd[_0xe9f0('0x20')]&&fs[_0xe9f0('0x23')](_0xd19788[_0xe9f0('0x24')])){var _0x3dbe49=util[_0xe9f0('0x25')](_0xe9f0('0x26'),_0xd19788[_0xe9f0('0x24')]);return _0x4cf1b1[_0xe9f0('0x27')](_0xd19788[_0xe9f0('0x24')],_0x3dbe49,config[_0xe9f0('0x28')][_0xe9f0('0x29')])[_0xe9f0('0xb')](function(){fs[_0xe9f0('0x2a')](_0xd19788[_0xe9f0('0x24')]);logger[_0xe9f0('0xc')](_0xe9f0('0x2b'));return _0xd19788;});}return _0xd19788;})[_0xe9f0('0xb')](function(_0x3611c0){logger['info']('CreateVoiceRecording',_0x371095);logger['debug'](_0xe9f0('0x2c'),_0x371095,JSON['stringify'](_0x3611c0));_0x2ddfba(_0x3611c0);})[_0xe9f0('0x15')](function(_0xc5fa13){logger['error'](_0xe9f0('0x2c'),_0xc5fa13['message'],_0x371095);_0x1a8478(_0x27541f['error'](0x1f4,_0xc5fa13['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 7c095fc..6fd7366 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 _0x8b09=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x5245d6,_0x30fdd7){var _0x446b84=function(_0x4c185f){while(--_0x4c185f){_0x5245d6['push'](_0x5245d6['shift']());}};_0x446b84(++_0x30fdd7);}(_0x8b09,0xac));var _0x98b0=function(_0x31c21b,_0x4b92c5){_0x31c21b=_0x31c21b-0x0;var _0x3fc53c=_0x8b09[_0x31c21b];return _0x3fc53c;};'use strict';var multer=require(_0x98b0('0x0'));var util=require('util');var path=require(_0x98b0('0x1'));var timeout=require(_0x98b0('0x2'));var express=require(_0x98b0('0x3'));var router=express[_0x98b0('0x4')]();var fs_extra=require(_0x98b0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98b0('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x98b0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x98b0('0x7')](_0x98b0('0x8'),auth[_0x98b0('0x9')](),controller[_0x98b0('0xa')]);router[_0x98b0('0x7')](_0x98b0('0xb'),auth[_0x98b0('0x9')](),controller[_0x98b0('0xc')]);router['post']('/',auth[_0x98b0('0x9')](),controller[_0x98b0('0xd')]);router[_0x98b0('0xe')]('/:id',auth[_0x98b0('0x9')](),controller['update']);router[_0x98b0('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x98b0('0x10')]=router; \ No newline at end of file +var _0xd68c=['/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','./voiceTransferReport.controller','isAuthenticated','index','get'];(function(_0x353cd6,_0xc795f6){var _0x55712a=function(_0x3b83e1){while(--_0x3b83e1){_0x353cd6['push'](_0x353cd6['shift']());}};_0x55712a(++_0xc795f6);}(_0xd68c,0x1ac));var _0xcd68=function(_0x46cf08,_0x489118){_0x46cf08=_0x46cf08-0x0;var _0x46df90=_0xd68c[_0x46cf08];return _0x46df90;};'use strict';var multer=require(_0xcd68('0x0'));var util=require(_0xcd68('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd68('0x2'));var router=express[_0xcd68('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcd68('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcd68('0x5'));router['get']('/',auth[_0xcd68('0x6')](),controller[_0xcd68('0x7')]);router[_0xcd68('0x8')](_0xcd68('0x9'),auth[_0xcd68('0x6')](),controller[_0xcd68('0xa')]);router[_0xcd68('0x8')](_0xcd68('0xb'),auth[_0xcd68('0x6')](),controller[_0xcd68('0xc')]);router[_0xcd68('0xd')]('/',auth[_0xcd68('0x6')](),controller[_0xcd68('0xe')]);router[_0xcd68('0xf')](_0xcd68('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcd68('0x10')](_0xcd68('0xb'),auth[_0xcd68('0x6')](),controller[_0xcd68('0x11')]);module[_0xcd68('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 243713b..f04879a 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 _0xb995=['sequelize','moment','exports','STRING','ENUM','Yes'];(function(_0x17bc38,_0x329502){var _0x1993f8=function(_0x248b8b){while(--_0x248b8b){_0x17bc38['push'](_0x17bc38['shift']());}};_0x1993f8(++_0x329502);}(_0xb995,0xd2));var _0x5b99=function(_0x55bcc2,_0x3728ad){_0x55bcc2=_0x55bcc2-0x0;var _0x5b3b78=_0xb995[_0x55bcc2];return _0x5b3b78;};'use strict';var Sequelize=require(_0x5b99('0x0'));var moment=require(_0x5b99('0x1'));module[_0x5b99('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x5b99('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5b99('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5b99('0x3')]},'transferercontext':{'type':Sequelize[_0x5b99('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x5b99('0x3')]},'transfereechannel':{'type':Sequelize[_0x5b99('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x5b99('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x5b99('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5b99('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5b99('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x5b99('0x3')]},'transfereecontext':{'type':Sequelize[_0x5b99('0x3')]},'transfereeexten':{'type':Sequelize[_0x5b99('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x5b99('0x4')](_0x5b99('0x5'),'No')},'context':{'type':Sequelize[_0x5b99('0x3')]},'extension':{'type':Sequelize[_0x5b99('0x3')]}}; \ No newline at end of file +var _0xc5ec=['STRING','Yes','sequelize','exports','ENUM','blind'];(function(_0x23dc24,_0x960c9c){var _0x41f4a9=function(_0x566756){while(--_0x566756){_0x23dc24['push'](_0x23dc24['shift']());}};_0x41f4a9(++_0x960c9c);}(_0xc5ec,0x1e8));var _0xcc5e=function(_0x496881,_0xd1c6a6){_0x496881=_0x496881-0x0;var _0xac7dfc=_0xc5ec[_0x496881];return _0xac7dfc;};'use strict';var Sequelize=require(_0xcc5e('0x0'));var moment=require('moment');module[_0xcc5e('0x1')]={'type':{'type':Sequelize[_0xcc5e('0x2')](_0xcc5e('0x3'),'attended')},'result':{'type':Sequelize[_0xcc5e('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xcc5e('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xcc5e('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xcc5e('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xcc5e('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xcc5e('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xcc5e('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcc5e('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xcc5e('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xcc5e('0x4')]},'transfereecontext':{'type':Sequelize[_0xcc5e('0x4')]},'transfereeexten':{'type':Sequelize[_0xcc5e('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xcc5e('0x4')]},'isexternal':{'type':Sequelize[_0xcc5e('0x2')](_0xcc5e('0x5'),'No')},'context':{'type':Sequelize[_0xcc5e('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index bc4f923..86a1c7f 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 _0xb0b9=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','limit','undefined','count','offset','set','Content-Range','json','reject','save','then','destroy','status','error','name','map','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','includeAll','include','VoiceTransferReport','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x47087,_0x24eadd){var _0x2fba8c=function(_0x343679){while(--_0x343679){_0x47087['push'](_0x47087['shift']());}};_0x2fba8c(++_0x24eadd);}(_0xb0b9,0x10c));var _0x9b0b=function(_0x1928d0,_0x19ce37){_0x1928d0=_0x1928d0-0x0;var _0x1b6c3b=_0xb0b9[_0x1928d0];return _0x1b6c3b;};'use strict';var emlformat=require(_0x9b0b('0x0'));var rimraf=require(_0x9b0b('0x1'));var zipdir=require(_0x9b0b('0x2'));var jsonpatch=require(_0x9b0b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b0b('0x4'));var Mustache=require(_0x9b0b('0x5'));var util=require(_0x9b0b('0x6'));var path=require(_0x9b0b('0x7'));var sox=require('sox');var csv=require(_0x9b0b('0x8'));var ejs=require(_0x9b0b('0x9'));var fs=require('fs');var fs_extra=require(_0x9b0b('0xa'));var _=require('lodash');var squel=require(_0x9b0b('0xb'));var crypto=require('crypto');var jsforce=require(_0x9b0b('0xc'));var deskjs=require(_0x9b0b('0xd'));var toCsv=require(_0x9b0b('0x8'));var querystring=require(_0x9b0b('0xe'));var Papa=require(_0x9b0b('0xf'));var Redis=require('ioredis');var authService=require(_0x9b0b('0x10'));var qs=require(_0x9b0b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9b0b('0x12'));var config=require(_0x9b0b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b0b('0x14'))['db'];function respondWithStatusCode(_0xaaf3eb,_0x5d2c3a){_0x5d2c3a=_0x5d2c3a||0xcc;return function(_0x40b4f2){if(_0x40b4f2){return _0xaaf3eb[_0x9b0b('0x15')](_0x5d2c3a);}return _0xaaf3eb['status'](_0x5d2c3a)[_0x9b0b('0x16')]();};}function respondWithResult(_0x241fd1,_0x2f37a9){_0x2f37a9=_0x2f37a9||0xc8;return function(_0x496443){if(_0x496443){return _0x241fd1['status'](_0x2f37a9)['json'](_0x496443);}};}function respondWithFilteredResult(_0x3ecf5e,_0x36ce4f){return function(_0x4e855a){if(_0x4e855a){var _0x28f573=typeof _0x36ce4f['offset']==='undefined'&&typeof _0x36ce4f[_0x9b0b('0x17')]===_0x9b0b('0x18');var _0x4867d=_0x4e855a[_0x9b0b('0x19')];var _0x1b52d9=_0x28f573?0x0:_0x36ce4f['offset'];var _0x4beac1=_0x28f573?_0x4e855a['count']:_0x36ce4f[_0x9b0b('0x1a')]+_0x36ce4f[_0x9b0b('0x17')];var _0x127090;if(_0x4beac1>=_0x4867d){_0x4beac1=_0x4867d;_0x127090=0xc8;}else{_0x127090=0xce;}_0x3ecf5e['status'](_0x127090);return _0x3ecf5e[_0x9b0b('0x1b')](_0x9b0b('0x1c'),_0x1b52d9+'-'+_0x4beac1+'/'+_0x4867d)[_0x9b0b('0x1d')](_0x4e855a);}return null;};}function patchUpdates(_0x2b0e9c){return function(_0x9f7ad0){try{jsonpatch['apply'](_0x9f7ad0,_0x2b0e9c,!![]);}catch(_0x32f5c2){return BPromise[_0x9b0b('0x1e')](_0x32f5c2);}return _0x9f7ad0[_0x9b0b('0x1f')]();};}function saveUpdates(_0x53245c,_0x311404){return function(_0x3181a3){if(_0x3181a3){return _0x3181a3['update'](_0x53245c)[_0x9b0b('0x20')](function(_0x605d92){return _0x605d92;});}return null;};}function removeEntity(_0x411d59,_0x5361bb){return function(_0x1c1ed0){if(_0x1c1ed0){return _0x1c1ed0[_0x9b0b('0x21')]()['then'](function(){_0x411d59[_0x9b0b('0x22')](0xcc)[_0x9b0b('0x16')]();});}};}function handleEntityNotFound(_0x2924a9,_0x2b0c56){return function(_0x37a75e){if(!_0x37a75e){_0x2924a9[_0x9b0b('0x15')](0x194);}return _0x37a75e;};}function handleError(_0x154eee,_0x21fde4){_0x21fde4=_0x21fde4||0x1f4;return function(_0x2f8d3f){logger[_0x9b0b('0x23')](_0x2f8d3f['stack']);if(_0x2f8d3f[_0x9b0b('0x24')]){delete _0x2f8d3f[_0x9b0b('0x24')];}_0x154eee['status'](_0x21fde4)['send'](_0x2f8d3f);};}exports['index']=function(_0x1839c5,_0x4838e7){var _0x151e19={},_0x4732ab={},_0x121d79={'count':0x0,'rows':[]};var _0x57572f=_[_0x9b0b('0x25')](db['VoiceTransferReport']['rawAttributes'],function(_0x437b84){return{'name':_0x437b84[_0x9b0b('0x26')],'type':_0x437b84[_0x9b0b('0x27')][_0x9b0b('0x28')]};});_0x4732ab[_0x9b0b('0x29')]=_[_0x9b0b('0x25')](_0x57572f,_0x9b0b('0x24'));_0x4732ab[_0x9b0b('0x2a')]=_['keys'](_0x1839c5[_0x9b0b('0x2a')]);_0x4732ab['filters']=_[_0x9b0b('0x2b')](_0x4732ab[_0x9b0b('0x29')],_0x4732ab[_0x9b0b('0x2a')]);_0x151e19['attributes']=_[_0x9b0b('0x2b')](_0x4732ab[_0x9b0b('0x29')],qs['fields'](_0x1839c5[_0x9b0b('0x2a')][_0x9b0b('0x2c')]));_0x151e19[_0x9b0b('0x2d')]=_0x151e19[_0x9b0b('0x2d')]['length']?_0x151e19[_0x9b0b('0x2d')]:_0x4732ab[_0x9b0b('0x29')];if(!_0x1839c5[_0x9b0b('0x2a')][_0x9b0b('0x2e')](_0x9b0b('0x2f'))){_0x151e19['limit']=qs[_0x9b0b('0x17')](_0x1839c5['query']['limit']);_0x151e19[_0x9b0b('0x1a')]=qs['offset'](_0x1839c5[_0x9b0b('0x2a')][_0x9b0b('0x1a')]);}_0x151e19[_0x9b0b('0x30')]=qs[_0x9b0b('0x31')](_0x1839c5[_0x9b0b('0x2a')]['sort']);_0x151e19['where']=qs[_0x9b0b('0x32')](_[_0x9b0b('0x33')](_0x1839c5['query'],_0x4732ab[_0x9b0b('0x32')]),_0x57572f);if(_0x1839c5[_0x9b0b('0x2a')]['filter']){_0x151e19[_0x9b0b('0x34')]=_[_0x9b0b('0x35')](_0x151e19[_0x9b0b('0x34')],{'$or':_['map'](_0x57572f,function(_0x2503b1){if(_0x2503b1[_0x9b0b('0x27')]!=='VIRTUAL'){var _0x36705b={};_0x36705b[_0x2503b1[_0x9b0b('0x24')]]={'$like':'%'+_0x1839c5['query']['filter']+'%'};return _0x36705b;}})});}_0x151e19=_['merge']({},_0x151e19,_0x1839c5['options']);var _0x22cb23={'where':_0x151e19['where']};return db['VoiceTransferReport']['count'](_0x22cb23)['then'](function(_0x1efeb6){_0x121d79[_0x9b0b('0x19')]=_0x1efeb6;if(_0x1839c5[_0x9b0b('0x2a')][_0x9b0b('0x36')]){_0x151e19[_0x9b0b('0x37')]=[{'all':!![]}];}return db[_0x9b0b('0x38')][_0x9b0b('0x39')](_0x151e19);})[_0x9b0b('0x20')](function(_0x5681d1){_0x121d79[_0x9b0b('0x3a')]=_0x5681d1;return _0x121d79;})[_0x9b0b('0x20')](respondWithFilteredResult(_0x4838e7,_0x151e19))[_0x9b0b('0x3b')](handleError(_0x4838e7,null));};exports[_0x9b0b('0x3c')]=function(_0x4afec6,_0x30d799){var _0x38961d={'raw':!![],'where':{'id':_0x4afec6['params']['id']}},_0x327b71={};_0x327b71['model']=_['keys'](db[_0x9b0b('0x38')]['rawAttributes']);_0x327b71[_0x9b0b('0x2a')]=_['keys'](_0x4afec6[_0x9b0b('0x2a')]);_0x327b71[_0x9b0b('0x32')]=_[_0x9b0b('0x2b')](_0x327b71[_0x9b0b('0x29')],_0x327b71[_0x9b0b('0x2a')]);_0x38961d['attributes']=_['intersection'](_0x327b71[_0x9b0b('0x29')],qs[_0x9b0b('0x2c')](_0x4afec6[_0x9b0b('0x2a')][_0x9b0b('0x2c')]));_0x38961d[_0x9b0b('0x2d')]=_0x38961d[_0x9b0b('0x2d')][_0x9b0b('0x3d')]?_0x38961d[_0x9b0b('0x2d')]:_0x327b71[_0x9b0b('0x29')];if(_0x4afec6['query'][_0x9b0b('0x36')]){_0x38961d[_0x9b0b('0x37')]=[{'all':!![]}];}_0x38961d=_['merge']({},_0x38961d,_0x4afec6[_0x9b0b('0x3e')]);return db[_0x9b0b('0x38')][_0x9b0b('0x3f')](_0x38961d)['then'](handleEntityNotFound(_0x30d799,null))['then'](respondWithResult(_0x30d799,null))[_0x9b0b('0x3b')](handleError(_0x30d799,null));};exports[_0x9b0b('0x40')]=function(_0x16480f,_0x423df0){return db['VoiceTransferReport'][_0x9b0b('0x40')](_0x16480f['body'],{})[_0x9b0b('0x20')](respondWithResult(_0x423df0,0xc9))[_0x9b0b('0x3b')](handleError(_0x423df0,null));};exports['update']=function(_0x37eb99,_0x5a593e){if(_0x37eb99[_0x9b0b('0x41')]['id']){delete _0x37eb99[_0x9b0b('0x41')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x37eb99[_0x9b0b('0x42')]['id']}})[_0x9b0b('0x20')](handleEntityNotFound(_0x5a593e,null))['then'](saveUpdates(_0x37eb99[_0x9b0b('0x41')],null))['then'](respondWithResult(_0x5a593e,null))[_0x9b0b('0x3b')](handleError(_0x5a593e,null));};exports['destroy']=function(_0x589b63,_0x313f05){return db[_0x9b0b('0x38')][_0x9b0b('0x3f')]({'where':{'id':_0x589b63[_0x9b0b('0x42')]['id']}})['then'](handleEntityNotFound(_0x313f05,null))[_0x9b0b('0x20')](removeEntity(_0x313f05,null))[_0x9b0b('0x3b')](handleError(_0x313f05,null));};exports[_0x9b0b('0x43')]=function(_0x4eed31,_0xe2e37){return db['VoiceTransferReport'][_0x9b0b('0x43')]()[_0x9b0b('0x20')](respondWithResult(_0xe2e37,null))[_0x9b0b('0x3b')](handleError(_0xe2e37,null));}; \ No newline at end of file +var _0x7b15=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x9e8f13,_0x3e1a00){var _0x240eee=function(_0x442c20){while(--_0x442c20){_0x9e8f13['push'](_0x9e8f13['shift']());}};_0x240eee(++_0x3e1a00);}(_0x7b15,0x15d));var _0x57b1=function(_0x4853ab,_0x4cd1f4){_0x4853ab=_0x4853ab-0x0;var _0x556084=_0x7b15[_0x4853ab];return _0x556084;};'use strict';var emlformat=require(_0x57b1('0x0'));var rimraf=require(_0x57b1('0x1'));var zipdir=require(_0x57b1('0x2'));var jsonpatch=require(_0x57b1('0x3'));var rp=require(_0x57b1('0x4'));var moment=require(_0x57b1('0x5'));var BPromise=require(_0x57b1('0x6'));var Mustache=require(_0x57b1('0x7'));var util=require('util');var path=require(_0x57b1('0x8'));var sox=require(_0x57b1('0x9'));var csv=require(_0x57b1('0xa'));var ejs=require(_0x57b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x57b1('0xc'));var crypto=require(_0x57b1('0xd'));var jsforce=require(_0x57b1('0xe'));var deskjs=require(_0x57b1('0xf'));var toCsv=require(_0x57b1('0xa'));var querystring=require(_0x57b1('0x10'));var Papa=require(_0x57b1('0x11'));var Redis=require('ioredis');var authService=require(_0x57b1('0x12'));var qs=require(_0x57b1('0x13'));var as=require(_0x57b1('0x14'));var hardwareService=require(_0x57b1('0x15'));var logger=require('../../config/logger')(_0x57b1('0x16'));var utils=require(_0x57b1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x57b1('0x18'));var db=require(_0x57b1('0x19'))['db'];function respondWithStatusCode(_0x2df9e5,_0x4ccc7e){_0x4ccc7e=_0x4ccc7e||0xcc;return function(_0x2fbd6d){if(_0x2fbd6d){return _0x2df9e5[_0x57b1('0x1a')](_0x4ccc7e);}return _0x2df9e5[_0x57b1('0x1b')](_0x4ccc7e)[_0x57b1('0x1c')]();};}function respondWithResult(_0x56b754,_0x23f897){_0x23f897=_0x23f897||0xc8;return function(_0x5793e0){if(_0x5793e0){return _0x56b754[_0x57b1('0x1b')](_0x23f897)[_0x57b1('0x1d')](_0x5793e0);}};}function respondWithFilteredResult(_0x778b35,_0x227145){return function(_0x220bf9){if(_0x220bf9){var _0x4392e0=typeof _0x227145[_0x57b1('0x1e')]===_0x57b1('0x1f')&&typeof _0x227145[_0x57b1('0x20')]===_0x57b1('0x1f');var _0x2e6824=_0x220bf9[_0x57b1('0x21')];var _0x234f1c=_0x4392e0?0x0:_0x227145[_0x57b1('0x1e')];var _0x21a41f=_0x4392e0?_0x220bf9[_0x57b1('0x21')]:_0x227145[_0x57b1('0x1e')]+_0x227145[_0x57b1('0x20')];var _0x254edf;if(_0x21a41f>=_0x2e6824){_0x21a41f=_0x2e6824;_0x254edf=0xc8;}else{_0x254edf=0xce;}_0x778b35[_0x57b1('0x1b')](_0x254edf);return _0x778b35[_0x57b1('0x22')]('Content-Range',_0x234f1c+'-'+_0x21a41f+'/'+_0x2e6824)['json'](_0x220bf9);}return null;};}function patchUpdates(_0x41c4e3){return function(_0x51f23b){try{jsonpatch[_0x57b1('0x23')](_0x51f23b,_0x41c4e3,!![]);}catch(_0xdbf20e){return BPromise[_0x57b1('0x24')](_0xdbf20e);}return _0x51f23b[_0x57b1('0x25')]();};}function saveUpdates(_0x304d1c,_0x4edcf9){return function(_0x22b0c9){if(_0x22b0c9){return _0x22b0c9[_0x57b1('0x26')](_0x304d1c)[_0x57b1('0x27')](function(_0x1b4d41){return _0x1b4d41;});}return null;};}function removeEntity(_0x1b6153,_0x4f44ae){return function(_0x50aec4){if(_0x50aec4){return _0x50aec4[_0x57b1('0x28')]()['then'](function(){_0x1b6153[_0x57b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222134,_0x554f97){return function(_0x108af0){if(!_0x108af0){_0x222134['sendStatus'](0x194);}return _0x108af0;};}function handleError(_0x533485,_0x2f0a32){_0x2f0a32=_0x2f0a32||0x1f4;return function(_0x500fc8){logger['error'](_0x500fc8[_0x57b1('0x29')]);if(_0x500fc8[_0x57b1('0x2a')]){delete _0x500fc8[_0x57b1('0x2a')];}_0x533485[_0x57b1('0x1b')](_0x2f0a32)[_0x57b1('0x2b')](_0x500fc8);};}exports[_0x57b1('0x2c')]=function(_0x2ea382,_0x4dab18){var _0x10946c={},_0x33b8e6={},_0x49d881={'count':0x0,'rows':[]};var _0x5679bb=_[_0x57b1('0x2d')](db[_0x57b1('0x2e')][_0x57b1('0x2f')],function(_0x494ae7){return{'name':_0x494ae7[_0x57b1('0x30')],'type':_0x494ae7[_0x57b1('0x31')]['key']};});_0x33b8e6[_0x57b1('0x32')]=_['map'](_0x5679bb,_0x57b1('0x2a'));_0x33b8e6[_0x57b1('0x33')]=_[_0x57b1('0x34')](_0x2ea382['query']);_0x33b8e6[_0x57b1('0x35')]=_[_0x57b1('0x36')](_0x33b8e6[_0x57b1('0x32')],_0x33b8e6[_0x57b1('0x33')]);_0x10946c[_0x57b1('0x37')]=_[_0x57b1('0x36')](_0x33b8e6[_0x57b1('0x32')],qs[_0x57b1('0x38')](_0x2ea382[_0x57b1('0x33')][_0x57b1('0x38')]));_0x10946c[_0x57b1('0x37')]=_0x10946c[_0x57b1('0x37')][_0x57b1('0x39')]?_0x10946c[_0x57b1('0x37')]:_0x33b8e6[_0x57b1('0x32')];if(!_0x2ea382['query']['hasOwnProperty']('nolimit')){_0x10946c[_0x57b1('0x20')]=qs['limit'](_0x2ea382[_0x57b1('0x33')][_0x57b1('0x20')]);_0x10946c[_0x57b1('0x1e')]=qs[_0x57b1('0x1e')](_0x2ea382[_0x57b1('0x33')]['offset']);}_0x10946c[_0x57b1('0x3a')]=qs['sort'](_0x2ea382[_0x57b1('0x33')]['sort']);_0x10946c['where']=qs[_0x57b1('0x35')](_[_0x57b1('0x3b')](_0x2ea382[_0x57b1('0x33')],_0x33b8e6[_0x57b1('0x35')]),_0x5679bb);if(_0x2ea382[_0x57b1('0x33')][_0x57b1('0x3c')]){_0x10946c['where']=_[_0x57b1('0x3d')](_0x10946c['where'],{'$or':_[_0x57b1('0x2d')](_0x5679bb,function(_0x2c2972){if(_0x2c2972[_0x57b1('0x31')]!=='VIRTUAL'){var _0xdb5ca1={};_0xdb5ca1[_0x2c2972['name']]={'$like':'%'+_0x2ea382[_0x57b1('0x33')]['filter']+'%'};return _0xdb5ca1;}})});}_0x10946c=_[_0x57b1('0x3d')]({},_0x10946c,_0x2ea382[_0x57b1('0x3e')]);var _0x4ff6dc={'where':_0x10946c[_0x57b1('0x3f')]};return db[_0x57b1('0x2e')][_0x57b1('0x21')](_0x4ff6dc)[_0x57b1('0x27')](function(_0x3371c6){_0x49d881[_0x57b1('0x21')]=_0x3371c6;if(_0x2ea382[_0x57b1('0x33')][_0x57b1('0x40')]){_0x10946c[_0x57b1('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x57b1('0x42')](_0x10946c);})[_0x57b1('0x27')](function(_0x1f6d40){_0x49d881[_0x57b1('0x43')]=_0x1f6d40;return _0x49d881;})[_0x57b1('0x27')](respondWithFilteredResult(_0x4dab18,_0x10946c))[_0x57b1('0x44')](handleError(_0x4dab18,null));};exports[_0x57b1('0x45')]=function(_0x428cb3,_0x399062){var _0x584849={'raw':!![],'where':{'id':_0x428cb3['params']['id']}},_0x59d312={};_0x59d312['model']=_['keys'](db[_0x57b1('0x2e')][_0x57b1('0x2f')]);_0x59d312[_0x57b1('0x33')]=_['keys'](_0x428cb3[_0x57b1('0x33')]);_0x59d312[_0x57b1('0x35')]=_[_0x57b1('0x36')](_0x59d312['model'],_0x59d312[_0x57b1('0x33')]);_0x584849[_0x57b1('0x37')]=_[_0x57b1('0x36')](_0x59d312[_0x57b1('0x32')],qs[_0x57b1('0x38')](_0x428cb3['query'][_0x57b1('0x38')]));_0x584849[_0x57b1('0x37')]=_0x584849[_0x57b1('0x37')][_0x57b1('0x39')]?_0x584849[_0x57b1('0x37')]:_0x59d312[_0x57b1('0x32')];if(_0x428cb3[_0x57b1('0x33')][_0x57b1('0x40')]){_0x584849[_0x57b1('0x41')]=[{'all':!![]}];}_0x584849=_[_0x57b1('0x3d')]({},_0x584849,_0x428cb3['options']);return db['VoiceTransferReport'][_0x57b1('0x46')](_0x584849)[_0x57b1('0x27')](handleEntityNotFound(_0x399062,null))['then'](respondWithResult(_0x399062,null))[_0x57b1('0x44')](handleError(_0x399062,null));};exports[_0x57b1('0x47')]=function(_0x1ec9c5,_0x1260da){return db[_0x57b1('0x2e')][_0x57b1('0x47')](_0x1ec9c5[_0x57b1('0x48')],{})[_0x57b1('0x27')](respondWithResult(_0x1260da,0xc9))[_0x57b1('0x44')](handleError(_0x1260da,null));};exports[_0x57b1('0x26')]=function(_0x4adfbf,_0x19b436){if(_0x4adfbf[_0x57b1('0x48')]['id']){delete _0x4adfbf[_0x57b1('0x48')]['id'];}return db['VoiceTransferReport'][_0x57b1('0x46')]({'where':{'id':_0x4adfbf[_0x57b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x19b436,null))[_0x57b1('0x27')](saveUpdates(_0x4adfbf[_0x57b1('0x48')],null))[_0x57b1('0x27')](respondWithResult(_0x19b436,null))[_0x57b1('0x44')](handleError(_0x19b436,null));};exports[_0x57b1('0x28')]=function(_0x15513a,_0x50ecb8){return db[_0x57b1('0x2e')][_0x57b1('0x46')]({'where':{'id':_0x15513a[_0x57b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x50ecb8,null))['then'](removeEntity(_0x50ecb8,null))[_0x57b1('0x44')](handleError(_0x50ecb8,null));};exports[_0x57b1('0x4a')]=function(_0xba3ec6,_0x561515){return db['VoiceTransferReport']['describe']()['then'](respondWithResult(_0x561515,null))[_0x57b1('0x44')](handleError(_0x561515,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8e8f004..3389c02 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 _0x2db5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceTransferReport','report_call_transfer','util'];(function(_0x4fbb3e,_0x55785f){var _0x1eb197=function(_0xfda25){while(--_0xfda25){_0x4fbb3e['push'](_0x4fbb3e['shift']());}};_0x1eb197(++_0x55785f);}(_0x2db5,0x78));var _0x52db=function(_0x3e2480,_0x2eed70){_0x3e2480=_0x3e2480-0x0;var _0x652c0=_0x2db5[_0x3e2480];return _0x652c0;};'use strict';var _=require('lodash');var util=require(_0x52db('0x0'));var logger=require(_0x52db('0x1'))(_0x52db('0x2'));var moment=require(_0x52db('0x3'));var BPromise=require(_0x52db('0x4'));var rp=require(_0x52db('0x5'));var fs=require('fs');var path=require(_0x52db('0x6'));var rimraf=require(_0x52db('0x7'));var config=require(_0x52db('0x8'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x37bc8e,_0x495958){return _0x37bc8e['define'](_0x52db('0x9'),attributes,{'tableName':_0x52db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x476b=['request-promise','path','rimraf','../../config/environment','exports','report_call_transfer','lodash','../../config/logger','api','bluebird'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x476b,0x1aa));var _0xb476=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x476b[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xb476('0x0'));var util=require('util');var logger=require(_0xb476('0x1'))(_0xb476('0x2'));var moment=require('moment');var BPromise=require(_0xb476('0x3'));var rp=require(_0xb476('0x4'));var fs=require('fs');var path=require(_0xb476('0x5'));var rimraf=require(_0xb476('0x6'));var config=require(_0xb476('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xb476('0x8')]=function(_0x5d2fd1,_0x1a30a7){return _0x5d2fd1['define']('VoiceTransferReport',attributes,{'tableName':_0xb476('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 c2c41fc..eaa9178 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 _0xa1c8=['CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','info','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x302c66,_0x2d8961){var _0x20db38=function(_0x47605b){while(--_0x47605b){_0x302c66['push'](_0x302c66['shift']());}};_0x20db38(++_0x2d8961);}(_0xa1c8,0x13f));var _0x8a1c=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa1c8[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8a1c('0x0'));var util=require(_0x8a1c('0x1'));var moment=require('moment');var BPromise=require(_0x8a1c('0x2'));var rs=require(_0x8a1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8a1c('0x4'))(_0x8a1c('0x5'));var config=require('../../config/environment');var jayson=require(_0x8a1c('0x6'));var client=jayson[_0x8a1c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a11c8,_0x28324f,_0x9b99f6){return new BPromise(function(_0x144ab2,_0x15847e){return client[_0x8a1c('0x8')](_0x2a11c8,_0x9b99f6)['then'](function(_0x474631){logger['info'](_0x8a1c('0x9'),_0x28324f,_0x8a1c('0xa'));logger[_0x8a1c('0xb')](_0x8a1c('0xc'),_0x28324f,_0x8a1c('0xa'),JSON[_0x8a1c('0xd')](_0x474631));if(_0x474631[_0x8a1c('0xe')]){if(_0x474631[_0x8a1c('0xe')][_0x8a1c('0xf')]===0x1f4){logger[_0x8a1c('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x28324f,_0x474631[_0x8a1c('0xe')][_0x8a1c('0x10')]);return _0x15847e(_0x474631['error'][_0x8a1c('0x10')]);}logger[_0x8a1c('0xe')](_0x8a1c('0x9'),_0x28324f,_0x474631[_0x8a1c('0xe')][_0x8a1c('0x10')]);return _0x144ab2(_0x474631[_0x8a1c('0xe')]['message']);}else{logger['info'](_0x8a1c('0x9'),_0x28324f,_0x8a1c('0xa'));_0x144ab2(_0x474631[_0x8a1c('0x11')][_0x8a1c('0x10')]);}})[_0x8a1c('0x12')](function(_0x35469e){logger[_0x8a1c('0xe')](_0x8a1c('0x9'),_0x28324f,_0x35469e);_0x15847e(_0x35469e);});});}exports[_0x8a1c('0x13')]=function(_0x4f9f77){var _0x589fe4=this;return new Promise(function(_0x2d68ca,_0x15e691){return db[_0x8a1c('0x14')][_0x8a1c('0x15')](_0x4f9f77['body'],{'raw':_0x4f9f77[_0x8a1c('0x16')]?_0x4f9f77[_0x8a1c('0x16')][_0x8a1c('0x17')]===undefined?!![]:![]:!![]})[_0x8a1c('0x18')](function(_0x6c8320){logger[_0x8a1c('0x19')](_0x8a1c('0x13'),_0x4f9f77);logger[_0x8a1c('0xb')](_0x8a1c('0x13'),_0x4f9f77,JSON['stringify'](_0x6c8320));_0x2d68ca(_0x6c8320);})[_0x8a1c('0x12')](function(_0x15ab5f){logger[_0x8a1c('0xe')]('CreateVoiceTransferReport',_0x15ab5f['message'],_0x4f9f77);_0x15e691(_0x589fe4['error'](0x1f4,_0x15ab5f[_0x8a1c('0x10')]));});});}; \ No newline at end of file +var _0xf5e3=['client','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','raw','then','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0xf5e3,0x199));var _0x3f5e=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xf5e3[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x3f5e('0x0'));var util=require(_0x3f5e('0x1'));var moment=require(_0x3f5e('0x2'));var BPromise=require(_0x3f5e('0x3'));var rs=require(_0x3f5e('0x4'));var fs=require('fs');var Redis=require(_0x3f5e('0x5'));var db=require(_0x3f5e('0x6'))['db'];var utils=require(_0x3f5e('0x7'));var logger=require(_0x3f5e('0x8'))(_0x3f5e('0x9'));var config=require(_0x3f5e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3f5e('0xb')][_0x3f5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ecd62,_0x1fec40,_0x416724){return new BPromise(function(_0xdf3597,_0x30445b){return client[_0x3f5e('0xd')](_0x5ecd62,_0x416724)['then'](function(_0x1e1d9b){logger['info'](_0x3f5e('0xe'),_0x1fec40,_0x3f5e('0xf'));logger[_0x3f5e('0x10')](_0x3f5e('0x11'),_0x1fec40,'request\x20sent',JSON[_0x3f5e('0x12')](_0x1e1d9b));if(_0x1e1d9b[_0x3f5e('0x13')]){if(_0x1e1d9b[_0x3f5e('0x13')][_0x3f5e('0x14')]===0x1f4){logger['error'](_0x3f5e('0xe'),_0x1fec40,_0x1e1d9b['error'][_0x3f5e('0x15')]);return _0x30445b(_0x1e1d9b[_0x3f5e('0x13')][_0x3f5e('0x15')]);}logger[_0x3f5e('0x13')](_0x3f5e('0xe'),_0x1fec40,_0x1e1d9b['error'][_0x3f5e('0x15')]);return _0xdf3597(_0x1e1d9b[_0x3f5e('0x13')][_0x3f5e('0x15')]);}else{logger['info'](_0x3f5e('0xe'),_0x1fec40,_0x3f5e('0xf'));_0xdf3597(_0x1e1d9b[_0x3f5e('0x16')][_0x3f5e('0x15')]);}})[_0x3f5e('0x17')](function(_0x55cea2){logger['error'](_0x3f5e('0xe'),_0x1fec40,_0x55cea2);_0x30445b(_0x55cea2);});});}exports['CreateVoiceTransferReport']=function(_0x368fab){var _0x37dae7=this;return new Promise(function(_0xc6378f,_0x557881){return db[_0x3f5e('0x18')][_0x3f5e('0x19')](_0x368fab[_0x3f5e('0x1a')],{'raw':_0x368fab['options']?_0x368fab['options'][_0x3f5e('0x1b')]===undefined?!![]:![]:!![]})[_0x3f5e('0x1c')](function(_0x473706){logger['info'](_0x3f5e('0x1d'),_0x368fab);logger[_0x3f5e('0x10')]('CreateVoiceTransferReport',_0x368fab,JSON['stringify'](_0x473706));_0xc6378f(_0x473706);})[_0x3f5e('0x17')](function(_0x4addda){logger[_0x3f5e('0x13')](_0x3f5e('0x1d'),_0x4addda['message'],_0x368fab);_0x557881(_0x37dae7[_0x3f5e('0x13')](0x1f4,_0x4addda[_0x3f5e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c03788c..cf465a3 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x282f9a,_0x63dff){var _0x52528c=function(_0xcf1c4c){while(--_0xcf1c4c){_0x282f9a['push'](_0x282f9a['shift']());}};_0x52528c(++_0x63dff);}(_0xdace,0xc5));var _0xedac=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xdace[_0x1ae5ab];return _0x1ce001;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x40f8d7,_0x30769e){var _0x29e6b8=function(_0x5ad157){while(--_0x5ad157){_0x40f8d7['push'](_0x40f8d7['shift']());}};_0x29e6b8(++_0x30769e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x49a612,_0x5692dd){_0x49a612=_0x49a612-0x0;var _0x2489f1=_0xe5b3[_0x49a612];return _0x2489f1;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 4941949..4817174 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 _0x202c=['conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','webbar:transfer','path','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','stack','status','send','name','NotFound','request','code','message','result','catch','User','then','VoiceChannels','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','sessionId','user:%s','webbar:hangup','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all'];(function(_0x2c3bb9,_0x419542){var _0x2cbd24=function(_0x4627f8){while(--_0x4627f8){_0x2c3bb9['push'](_0x2c3bb9['shift']());}};_0x2cbd24(++_0x419542);}(_0x202c,0x178));var _0xc202=function(_0x1d90ca,_0x3bab16){_0x1d90ca=_0x1d90ca-0x0;var _0x28872b=_0x202c[_0x1d90ca];return _0x28872b;};'use strict';var path=require(_0xc202('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xc202('0x1'));var util=require(_0xc202('0x2'));var BPromise=require(_0xc202('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xc202('0x4')][_0xc202('0x5')]({'port':0x232a});var logger=require(_0xc202('0x6'))(_0xc202('0x7'));var Redis=require('ioredis');config[_0xc202('0x8')]=_[_0xc202('0x9')](config['redis'],{'host':_0xc202('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc202('0x8')]));var Schema=require(_0xc202('0xb'));var originateValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],_0xc202('0xd')]},'callNumber':{'type':_0xc202('0xe'),'required':[!![],_0xc202('0xf')]},'callerId':{'type':_0xc202('0xe')},'callbackUrl':{'type':_0xc202('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],_0xc202('0xd')]},'sessionId':{'type':_0xc202('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],_0xc202('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],_0xc202('0xd')]},'sessionId':{'type':_0xc202('0xe'),'required':[!![],_0xc202('0x10')]},'transferNumber':{'type':_0xc202('0xe'),'required':[!![],_0xc202('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xc202('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xc202('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc202('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc202('0xd')]}});function emit(_0x5971a6,_0x19af73,_0x1d580c){logger[_0xc202('0x12')](_0x5971a6,_0x19af73,JSON[_0xc202('0x13')](_0x1d580c));io['to'](_0x5971a6)[_0xc202('0x14')](_0x19af73,_0x1d580c);}function handleError(_0x2419c5){return function(_0x9620a0){console['log'](_0xc202('0x15'),_0x9620a0,_0x9620a0 instanceof RangeError);logger[_0xc202('0x16')](_0x9620a0[_0xc202('0x17')]);if(_0x9620a0 instanceof RangeError){if(_0x9620a0['name']){delete _0x9620a0['name'];}_0x2419c5[_0xc202('0x18')](0x194)[_0xc202('0x19')](_0x9620a0);}else{if(_0x9620a0[_0xc202('0x1a')]){delete _0x9620a0[_0xc202('0x1a')];}_0x2419c5[_0xc202('0x18')](0x1f4)['send'](_0x9620a0);}};}function checkError(){return function(_0x50a32f){if(!_0x50a32f){throw new RangeError(_0xc202('0x1b'));}return _0x50a32f;};}function respondWithRpcPromise(_0x5a6526,_0x3058d3){return new BPromise(function(_0x372b31,_0x56e979){var _0x50f917=amiClient;return _0x50f917[_0xc202('0x1c')](_0x5a6526,_0x3058d3)['then'](function(_0x23e1a0){if(_0x23e1a0[_0xc202('0x16')]){if(_0x23e1a0[_0xc202('0x16')][_0xc202('0x1d')]===0x1f4){return _0x56e979(_0x23e1a0[_0xc202('0x16')]['message']);}return _0x372b31(_0x23e1a0['error'][_0xc202('0x1e')]);}else{_0x372b31(_0x23e1a0[_0xc202('0x1f')]);}})[_0xc202('0x20')](function(_0x4ff3e3){_0x56e979(_0x4ff3e3);});});}function getAgent(_0xdd5798){return db[_0xc202('0x21')]['findOne']({'where':{'id':_0xdd5798,'role':'agent'}})[_0xc202('0x22')](checkError());}function getAgentCheckSession(_0x2f8011,_0xd88a43){return new BPromise(function(_0x6b291c,_0x2a401b){var _0x483357=respondWithRpcPromise(_0xc202('0x23'));var _0x32f56c=getAgent(_0x2f8011);Promise['all']([_0x483357,_0x32f56c])['then'](function(_0x25a954){var _0x278ef5=_0x25a954[0x0];var _0x130e51=_0x25a954[0x1];var _0x189211=_['filter'](_0x278ef5[_0xc202('0x24')],function(_0x2c8fec){return _0x2c8fec[_0xc202('0x25')]==_0x130e51['id']&&_0x2c8fec['sessionId']==_0xd88a43;});if(_0x189211[_0xc202('0x26')]==0x1){_0x6b291c(_0x130e51);}else{_0x2a401b(new RangeError(_0xc202('0x27')+_0xd88a43+_0xc202('0x28')));}});});}exports[_0xc202('0x29')]=function(_0x464ab8,_0x196394){logger[_0xc202('0x12')](_0xc202('0x2a'),_0x464ab8[_0xc202('0x2b')]);var _0x1b4e71=originateValidation[_0xc202('0xb')](_0x464ab8[_0xc202('0x2b')]);if(_0x1b4e71['length']>0x0){return _0x196394[_0xc202('0x18')](0x190)[_0xc202('0x2c')](_0x1b4e71);}var _0x12e11a=_0x464ab8['body'][_0xc202('0x2d')];var _0x501db2=_0x464ab8[_0xc202('0x2b')][_0xc202('0x2e')];var _0x12bf23=_0x464ab8[_0xc202('0x2b')][_0xc202('0x2f')];var _0x77419a=_0x464ab8['body'][_0xc202('0x30')];return getAgent(_0x12e11a)['then'](function(_0x3ac7e8){logger['info'](_0xc202('0x31'),_0x3ac7e8[_0xc202('0x1a')]);emit(util[_0xc202('0x32')]('user:%s',_0x3ac7e8[_0xc202('0x1a')]),_0xc202('0x33'),{'callNumber':_0x501db2,'callerId':_0x12bf23,'callbackUrl':_0x77419a});return _0x196394[_0xc202('0x18')](0xc8)[_0xc202('0x2c')]({'error':![],'message':_0xc202('0x34')});})[_0xc202('0x20')](handleError(_0x196394));};exports['hangup']=function(_0x16608b,_0x1e57c3){logger[_0xc202('0x12')]('hangup\x20fired:',_0x16608b[_0xc202('0x2b')]);var _0x1741b7=hangupValidation[_0xc202('0xb')](_0x16608b[_0xc202('0x2b')]);if(_0x1741b7['length']>0x0){return _0x1e57c3['status'](0x190)[_0xc202('0x2c')](_0x1741b7);}var _0x4caf1b=_0x16608b[_0xc202('0x2b')][_0xc202('0x2d')];var _0x25fdd8=_0x16608b[_0xc202('0x2b')][_0xc202('0x35')];return getAgent(_0x4caf1b)[_0xc202('0x22')](function(_0x52d9d2){logger[_0xc202('0x12')](_0xc202('0x31'),_0x52d9d2[_0xc202('0x1a')]);emit(util[_0xc202('0x32')](_0xc202('0x36'),_0x52d9d2['name']),_0xc202('0x37'),{'sessionId':_0x25fdd8});return _0x1e57c3[_0xc202('0x18')](0xc8)[_0xc202('0x2c')]({'error':![],'message':_0xc202('0x38')});})[_0xc202('0x20')](handleError(_0x1e57c3));};exports['answer']=function(_0x25d75f,_0x5d89b3){logger[_0xc202('0x12')]('answer\x20fired:',_0x25d75f[_0xc202('0x2b')]);var _0x4393f3=answerValidation[_0xc202('0xb')](_0x25d75f[_0xc202('0x2b')]);if(_0x4393f3['length']>0x0){return _0x5d89b3[_0xc202('0x18')](0x190)[_0xc202('0x2c')](_0x4393f3);}var _0x865cd1=_0x25d75f[_0xc202('0x2b')][_0xc202('0x2d')];var _0x91785a=_0x25d75f[_0xc202('0x2b')][_0xc202('0x35')];return getAgent(_0x865cd1)[_0xc202('0x22')](function(_0x6cad30){logger[_0xc202('0x12')](_0xc202('0x31'),_0x6cad30[_0xc202('0x1a')]);emit(util[_0xc202('0x32')](_0xc202('0x36'),_0x6cad30[_0xc202('0x1a')]),_0xc202('0x39'),{'sessionId':_0x91785a});return _0x5d89b3[_0xc202('0x18')](0xc8)[_0xc202('0x2c')]({'error':![],'message':_0xc202('0x3a')});})['catch'](handleError(_0x5d89b3));};exports[_0xc202('0x3b')]=function(_0x187934,_0x291a6b){logger['info']('hold\x20fired:',_0x187934['body']);var _0x113db6=holdValidation[_0xc202('0xb')](_0x187934[_0xc202('0x2b')]);if(_0x113db6[_0xc202('0x26')]>0x0){return _0x291a6b[_0xc202('0x18')](0x190)[_0xc202('0x2c')](_0x113db6);}var _0x157d89=_0x187934[_0xc202('0x2b')][_0xc202('0x2d')];var _0x6d6b02=_0x187934[_0xc202('0x2b')][_0xc202('0x35')];return getAgent(_0x157d89)[_0xc202('0x22')](function(_0x5220a2){logger[_0xc202('0x12')](_0xc202('0x31'),_0x5220a2['name']);emit(util[_0xc202('0x32')](_0xc202('0x36'),_0x5220a2[_0xc202('0x1a')]),_0xc202('0x3c'),{'sessionId':_0x6d6b02});return _0x291a6b[_0xc202('0x18')](0xc8)['json']({'error':![],'message':_0xc202('0x3d')});})['catch'](handleError(_0x291a6b));};exports[_0xc202('0x3e')]=function(_0x5f1b99,_0x305793){logger[_0xc202('0x12')]('unhold\x20fired:',_0x5f1b99[_0xc202('0x2b')]);var _0x239cd=unholdValidation['validate'](_0x5f1b99['body']);if(_0x239cd['length']>0x0){return _0x305793[_0xc202('0x18')](0x190)['json'](_0x239cd);}var _0x1ac5c5=_0x5f1b99[_0xc202('0x2b')][_0xc202('0x2d')];var _0x1f6233=_0x5f1b99[_0xc202('0x2b')][_0xc202('0x35')];return getAgent(_0x1ac5c5)[_0xc202('0x22')](function(_0x3469e0){logger[_0xc202('0x12')](_0xc202('0x31'),_0x3469e0[_0xc202('0x1a')]);emit(util[_0xc202('0x32')](_0xc202('0x36'),_0x3469e0['name']),_0xc202('0x3f'),{'sessionId':_0x1f6233});return _0x305793['status'](0xc8)['json']({'error':![],'message':_0xc202('0x40')});})[_0xc202('0x20')](handleError(_0x305793));};exports[_0xc202('0x41')]=function(_0x52fcbd,_0x1fcc19){logger['info'](_0xc202('0x42'),_0x1fcc19[_0xc202('0x2b')]);var _0x5464ea=callsValidation[_0xc202('0xb')](_0x52fcbd[_0xc202('0x2b')]);if(_0x5464ea['length']>0x0){return _0x1fcc19[_0xc202('0x18')](0x190)['json'](_0x5464ea);}var _0x3c765d=_0x52fcbd[_0xc202('0x2b')][_0xc202('0x2d')];var _0x1a06c5=respondWithRpcPromise(_0xc202('0x23'));var _0x2d475a=getAgent(_0x3c765d);return Promise[_0xc202('0x43')]([_0x1a06c5,_0x2d475a])['then'](function(_0xb98cd7){var _0x3beb0a=_0xb98cd7[0x0];var _0x4e2e04=_0xb98cd7[0x1];var _0x2b3238=_['filter'](_0x3beb0a[_0xc202('0x24')],function(_0x4a2a48){return _0x4a2a48[_0xc202('0x25')]==_0x4e2e04['id'];});return _0x1fcc19['status'](0xc8)[_0xc202('0x2c')]({'count':_0x2b3238['length'],'rows':_0x2b3238});})['catch'](handleError(_0x1fcc19));};exports[_0xc202('0x44')]=function(_0x1dc674,_0x31bc10){logger[_0xc202('0x12')](_0xc202('0x45'),_0x1dc674[_0xc202('0x2b')]);var _0x42c898=conferenceValidation[_0xc202('0xb')](_0x1dc674[_0xc202('0x2b')]);if(_0x42c898[_0xc202('0x26')]>0x0){return _0x31bc10['status'](0x190)[_0xc202('0x2c')](_0x42c898);}var _0xc899bd=_0x1dc674['body'][_0xc202('0x2d')];return getAgent(_0xc899bd)[_0xc202('0x22')](function(_0x43fe84){logger[_0xc202('0x12')](_0xc202('0x31'),_0x43fe84[_0xc202('0x1a')]);emit(util[_0xc202('0x32')](_0xc202('0x36'),_0x43fe84['name']),_0xc202('0x46'));return _0x31bc10[_0xc202('0x18')](0xc8)[_0xc202('0x2c')]({'error':![],'message':_0xc202('0x47')});})[_0xc202('0x20')](handleError(_0x31bc10));};exports['transfer']=function(_0x4149fe,_0x39e986){logger[_0xc202('0x12')]('transfer\x20fired:',_0x4149fe[_0xc202('0x2b')]);var _0x4dfb2f=transferValidation['validate'](_0x4149fe['body']);if(_0x4dfb2f[_0xc202('0x26')]>0x0){return _0x39e986[_0xc202('0x18')](0x190)[_0xc202('0x2c')](_0x4dfb2f);}var _0xe05654=_0x4149fe['body'][_0xc202('0x2d')];var _0x5957e8=_0x4149fe[_0xc202('0x2b')][_0xc202('0x35')];var _0x5bb7f8=_0x4149fe[_0xc202('0x2b')][_0xc202('0x48')];return getAgent(_0xe05654)[_0xc202('0x22')](function(_0x4d9423){logger['info']('entityFound:',_0x4d9423[_0xc202('0x1a')]);emit(util[_0xc202('0x32')]('user:%s',_0x4d9423[_0xc202('0x1a')]),_0xc202('0x49'),{'sessionId':_0x5957e8,'transferNumber':_0x5bb7f8});return _0x39e986['status'](0xc8)[_0xc202('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xc202('0x20')](handleError(_0x39e986));}; \ No newline at end of file +var _0xf120=['validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','stack','name','status','request','then','error','result','catch','findOne','agent','VoiceChannels','all','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','info','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter'];(function(_0x19fe69,_0xec7aac){var _0x38dc2c=function(_0x22c090){while(--_0x22c090){_0x19fe69['push'](_0x19fe69['shift']());}};_0x38dc2c(++_0xec7aac);}(_0xf120,0x179));var _0x0f12=function(_0x15f04c,_0x4fd455){_0x15f04c=_0x15f04c-0x0;var _0x55f08e=_0xf120[_0x15f04c];return _0x55f08e;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x0f12('0x0'));var db=require(_0x0f12('0x1'))['db'];var config=require(_0x0f12('0x2'));var util=require('util');var BPromise=require(_0x0f12('0x3'));var jayson=require(_0x0f12('0x4'));var amiClient=jayson[_0x0f12('0x5')]['http']({'port':0x232a});var logger=require(_0x0f12('0x6'))(_0x0f12('0x7'));var Redis=require(_0x0f12('0x8'));config[_0x0f12('0x9')]=_[_0x0f12('0xa')](config[_0x0f12('0x9')],{'host':_0x0f12('0xb'),'port':0x18eb});var io=require(_0x0f12('0xc'))(new Redis(config['redis']));var Schema=require(_0x0f12('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0f12('0xe')]},'callNumber':{'type':_0x0f12('0xf'),'required':[!![],_0x0f12('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]},'sessionId':{'type':_0x0f12('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]},'sessionId':{'type':_0x0f12('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0f12('0xf'),'required':[!![],_0x0f12('0x12')]},'transferNumber':{'type':_0x0f12('0xf'),'required':[!![],_0x0f12('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]},'sessionId':{'type':_0x0f12('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]},'sessionId':{'type':_0x0f12('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0f12('0x11'),'required':[!![],_0x0f12('0xe')]}});function emit(_0xeccb7c,_0x592617,_0x1db207){logger['info'](_0xeccb7c,_0x592617,JSON[_0x0f12('0x14')](_0x1db207));io['to'](_0xeccb7c)[_0x0f12('0x15')](_0x592617,_0x1db207);}function handleError(_0x28119e){return function(_0x12eb6c){console[_0x0f12('0x16')](_0x0f12('0x17'),_0x12eb6c,_0x12eb6c instanceof RangeError);logger['error'](_0x12eb6c[_0x0f12('0x18')]);if(_0x12eb6c instanceof RangeError){if(_0x12eb6c['name']){delete _0x12eb6c[_0x0f12('0x19')];}_0x28119e['status'](0x194)['send'](_0x12eb6c);}else{if(_0x12eb6c[_0x0f12('0x19')]){delete _0x12eb6c[_0x0f12('0x19')];}_0x28119e[_0x0f12('0x1a')](0x1f4)['send'](_0x12eb6c);}};}function checkError(){return function(_0x10a325){if(!_0x10a325){throw new RangeError('NotFound');}return _0x10a325;};}function respondWithRpcPromise(_0x26b2d7,_0x5b8598){return new BPromise(function(_0x9f283b,_0x379851){var _0x4f06bd=amiClient;return _0x4f06bd[_0x0f12('0x1b')](_0x26b2d7,_0x5b8598)[_0x0f12('0x1c')](function(_0x3a28ae){if(_0x3a28ae[_0x0f12('0x1d')]){if(_0x3a28ae[_0x0f12('0x1d')]['code']===0x1f4){return _0x379851(_0x3a28ae[_0x0f12('0x1d')]['message']);}return _0x9f283b(_0x3a28ae['error']['message']);}else{_0x9f283b(_0x3a28ae[_0x0f12('0x1e')]);}})[_0x0f12('0x1f')](function(_0xa67a43){_0x379851(_0xa67a43);});});}function getAgent(_0x13e737){return db['User'][_0x0f12('0x20')]({'where':{'id':_0x13e737,'role':_0x0f12('0x21')}})[_0x0f12('0x1c')](checkError());}function getAgentCheckSession(_0x5ca297,_0x13baa0){return new BPromise(function(_0x2fdde4,_0x8f43f9){var _0x5cb12b=respondWithRpcPromise(_0x0f12('0x22'));var _0x25a5dc=getAgent(_0x5ca297);Promise[_0x0f12('0x23')]([_0x5cb12b,_0x25a5dc])[_0x0f12('0x1c')](function(_0x1c7d2b){var _0x5693e4=_0x1c7d2b[0x0];var _0x5531ed=_0x1c7d2b[0x1];var _0x343ae0=_['filter'](_0x5693e4[_0x0f12('0x24')],function(_0x3c6ce5){return _0x3c6ce5[_0x0f12('0x25')]==_0x5531ed['id']&&_0x3c6ce5['sessionId']==_0x13baa0;});if(_0x343ae0[_0x0f12('0x26')]==0x1){_0x2fdde4(_0x5531ed);}else{_0x8f43f9(new RangeError(_0x0f12('0x27')+_0x13baa0+_0x0f12('0x28')));}});});}exports[_0x0f12('0x29')]=function(_0x1672da,_0x25d56e){logger['info'](_0x0f12('0x2a'),_0x1672da[_0x0f12('0x2b')]);var _0x3d49fe=originateValidation['validate'](_0x1672da[_0x0f12('0x2b')]);if(_0x3d49fe[_0x0f12('0x26')]>0x0){return _0x25d56e[_0x0f12('0x1a')](0x190)[_0x0f12('0x2c')](_0x3d49fe);}var _0x5a7d94=_0x1672da[_0x0f12('0x2b')][_0x0f12('0x2d')];var _0x3d0a71=_0x1672da[_0x0f12('0x2b')][_0x0f12('0x2e')];var _0x7efa57=_0x1672da[_0x0f12('0x2b')]['callerId'];var _0x15a508=_0x1672da[_0x0f12('0x2b')]['callbackUrl'];return getAgent(_0x5a7d94)[_0x0f12('0x1c')](function(_0x40715e){logger['info'](_0x0f12('0x2f'),_0x40715e[_0x0f12('0x19')]);emit(util['format'](_0x0f12('0x30'),_0x40715e['name']),_0x0f12('0x31'),{'callNumber':_0x3d0a71,'callerId':_0x7efa57,'callbackUrl':_0x15a508});return _0x25d56e[_0x0f12('0x1a')](0xc8)[_0x0f12('0x2c')]({'error':![],'message':_0x0f12('0x32')});})[_0x0f12('0x1f')](handleError(_0x25d56e));};exports[_0x0f12('0x33')]=function(_0x2912b8,_0x1d48a7){logger[_0x0f12('0x34')](_0x0f12('0x35'),_0x2912b8['body']);var _0x3be0b6=hangupValidation[_0x0f12('0xd')](_0x2912b8[_0x0f12('0x2b')]);if(_0x3be0b6['length']>0x0){return _0x1d48a7['status'](0x190)['json'](_0x3be0b6);}var _0x21791c=_0x2912b8[_0x0f12('0x2b')]['userId'];var _0x4bf268=_0x2912b8[_0x0f12('0x2b')][_0x0f12('0x36')];return getAgent(_0x21791c)[_0x0f12('0x1c')](function(_0x51b8c8){logger[_0x0f12('0x34')](_0x0f12('0x2f'),_0x51b8c8['name']);emit(util[_0x0f12('0x37')](_0x0f12('0x30'),_0x51b8c8[_0x0f12('0x19')]),_0x0f12('0x38'),{'sessionId':_0x4bf268});return _0x1d48a7[_0x0f12('0x1a')](0xc8)[_0x0f12('0x2c')]({'error':![],'message':_0x0f12('0x39')});})['catch'](handleError(_0x1d48a7));};exports[_0x0f12('0x3a')]=function(_0x5442c1,_0x3fdcce){logger[_0x0f12('0x34')]('answer\x20fired:',_0x5442c1[_0x0f12('0x2b')]);var _0x2232ec=answerValidation[_0x0f12('0xd')](_0x5442c1['body']);if(_0x2232ec['length']>0x0){return _0x3fdcce[_0x0f12('0x1a')](0x190)[_0x0f12('0x2c')](_0x2232ec);}var _0x106f93=_0x5442c1[_0x0f12('0x2b')]['userId'];var _0xbe1aca=_0x5442c1[_0x0f12('0x2b')][_0x0f12('0x36')];return getAgent(_0x106f93)[_0x0f12('0x1c')](function(_0x5d99a1){logger[_0x0f12('0x34')](_0x0f12('0x2f'),_0x5d99a1['name']);emit(util['format'](_0x0f12('0x30'),_0x5d99a1[_0x0f12('0x19')]),_0x0f12('0x3b'),{'sessionId':_0xbe1aca});return _0x3fdcce['status'](0xc8)['json']({'error':![],'message':_0x0f12('0x3c')});})[_0x0f12('0x1f')](handleError(_0x3fdcce));};exports['hold']=function(_0x40d53d,_0x526cce){logger[_0x0f12('0x34')](_0x0f12('0x3d'),_0x40d53d['body']);var _0x5b831e=holdValidation[_0x0f12('0xd')](_0x40d53d[_0x0f12('0x2b')]);if(_0x5b831e[_0x0f12('0x26')]>0x0){return _0x526cce[_0x0f12('0x1a')](0x190)[_0x0f12('0x2c')](_0x5b831e);}var _0x2f561c=_0x40d53d[_0x0f12('0x2b')][_0x0f12('0x2d')];var _0x5b265d=_0x40d53d[_0x0f12('0x2b')]['sessionId'];return getAgent(_0x2f561c)[_0x0f12('0x1c')](function(_0x52f1c2){logger['info'](_0x0f12('0x2f'),_0x52f1c2['name']);emit(util[_0x0f12('0x37')](_0x0f12('0x30'),_0x52f1c2[_0x0f12('0x19')]),_0x0f12('0x3e'),{'sessionId':_0x5b265d});return _0x526cce['status'](0xc8)[_0x0f12('0x2c')]({'error':![],'message':_0x0f12('0x3f')});})[_0x0f12('0x1f')](handleError(_0x526cce));};exports[_0x0f12('0x40')]=function(_0x48acec,_0x5382cc){logger[_0x0f12('0x34')](_0x0f12('0x41'),_0x48acec[_0x0f12('0x2b')]);var _0x1f69cd=unholdValidation[_0x0f12('0xd')](_0x48acec['body']);if(_0x1f69cd['length']>0x0){return _0x5382cc['status'](0x190)[_0x0f12('0x2c')](_0x1f69cd);}var _0x7719ec=_0x48acec[_0x0f12('0x2b')][_0x0f12('0x2d')];var _0x18c68b=_0x48acec[_0x0f12('0x2b')][_0x0f12('0x36')];return getAgent(_0x7719ec)[_0x0f12('0x1c')](function(_0x31ecc6){logger[_0x0f12('0x34')](_0x0f12('0x2f'),_0x31ecc6['name']);emit(util[_0x0f12('0x37')](_0x0f12('0x30'),_0x31ecc6[_0x0f12('0x19')]),_0x0f12('0x42'),{'sessionId':_0x18c68b});return _0x5382cc['status'](0xc8)['json']({'error':![],'message':_0x0f12('0x43')});})[_0x0f12('0x1f')](handleError(_0x5382cc));};exports[_0x0f12('0x44')]=function(_0x36d0f7,_0xff5bdf){logger[_0x0f12('0x34')](_0x0f12('0x45'),_0xff5bdf[_0x0f12('0x2b')]);var _0x5b2bb1=callsValidation[_0x0f12('0xd')](_0x36d0f7[_0x0f12('0x2b')]);if(_0x5b2bb1['length']>0x0){return _0xff5bdf[_0x0f12('0x1a')](0x190)[_0x0f12('0x2c')](_0x5b2bb1);}var _0x17054a=_0x36d0f7['body'][_0x0f12('0x2d')];var _0x14b337=respondWithRpcPromise(_0x0f12('0x22'));var _0x2ca6bb=getAgent(_0x17054a);return Promise[_0x0f12('0x23')]([_0x14b337,_0x2ca6bb])['then'](function(_0x1b4aa){var _0x51040a=_0x1b4aa[0x0];var _0xc7ab2b=_0x1b4aa[0x1];var _0x54f210=_[_0x0f12('0x46')](_0x51040a[_0x0f12('0x24')],function(_0x53bc13){return _0x53bc13[_0x0f12('0x25')]==_0xc7ab2b['id'];});return _0xff5bdf[_0x0f12('0x1a')](0xc8)['json']({'count':_0x54f210[_0x0f12('0x26')],'rows':_0x54f210});})['catch'](handleError(_0xff5bdf));};exports[_0x0f12('0x47')]=function(_0x59cd88,_0x1d6bb6){logger[_0x0f12('0x34')](_0x0f12('0x48'),_0x59cd88['body']);var _0x5f3bd9=conferenceValidation[_0x0f12('0xd')](_0x59cd88[_0x0f12('0x2b')]);if(_0x5f3bd9['length']>0x0){return _0x1d6bb6[_0x0f12('0x1a')](0x190)[_0x0f12('0x2c')](_0x5f3bd9);}var _0x5bd898=_0x59cd88[_0x0f12('0x2b')][_0x0f12('0x2d')];return getAgent(_0x5bd898)['then'](function(_0x259840){logger[_0x0f12('0x34')](_0x0f12('0x2f'),_0x259840[_0x0f12('0x19')]);emit(util[_0x0f12('0x37')](_0x0f12('0x30'),_0x259840[_0x0f12('0x19')]),_0x0f12('0x49'));return _0x1d6bb6[_0x0f12('0x1a')](0xc8)[_0x0f12('0x2c')]({'error':![],'message':_0x0f12('0x4a')});})[_0x0f12('0x1f')](handleError(_0x1d6bb6));};exports['transfer']=function(_0x10f7c3,_0x361dd5){logger[_0x0f12('0x34')](_0x0f12('0x4b'),_0x10f7c3[_0x0f12('0x2b')]);var _0x5b11f5=transferValidation[_0x0f12('0xd')](_0x10f7c3[_0x0f12('0x2b')]);if(_0x5b11f5[_0x0f12('0x26')]>0x0){return _0x361dd5['status'](0x190)[_0x0f12('0x2c')](_0x5b11f5);}var _0x531dac=_0x10f7c3[_0x0f12('0x2b')][_0x0f12('0x2d')];var _0x2d50ae=_0x10f7c3[_0x0f12('0x2b')]['sessionId'];var _0x3a0c70=_0x10f7c3['body'][_0x0f12('0x4c')];return getAgent(_0x531dac)[_0x0f12('0x1c')](function(_0x5d8a07){logger[_0x0f12('0x34')](_0x0f12('0x2f'),_0x5d8a07[_0x0f12('0x19')]);emit(util[_0x0f12('0x37')](_0x0f12('0x30'),_0x5d8a07[_0x0f12('0x19')]),'webbar:transfer',{'sessionId':_0x2d50ae,'transferNumber':_0x3a0c70});return _0x361dd5[_0x0f12('0x1a')](0xc8)[_0x0f12('0x2c')]({'error':![],'message':_0x0f12('0x4d')});})[_0x0f12('0x1f')](handleError(_0x361dd5));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d801bf4..db48c19 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 _0x0598=['put','update','delete','destroy','/:id/canned_answers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0598,0x92));var _0x8059=function(_0x9c743a,_0x32989d){_0x9c743a=_0x9c743a-0x0;var _0x1d3956=_0x0598[_0x9c743a];return _0x1d3956;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x9')]);router[_0x8059('0x5')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router['get']('/:id/canned_answers',auth[_0x8059('0x6')](),controller[_0x8059('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8059('0xd')]);router[_0x8059('0x5')](_0x8059('0xe'),auth[_0x8059('0x6')](),controller[_0x8059('0xf')]);router['post']('/',auth[_0x8059('0x6')](),controller['create']);router[_0x8059('0x10')]('/:id/dispositions',auth[_0x8059('0x6')](),controller[_0x8059('0x11')]);router[_0x8059('0x10')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x8059('0x10')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x13')]);router[_0x8059('0x10')]('/:id/applications',auth[_0x8059('0x6')](),controller[_0x8059('0x14')]);router[_0x8059('0x10')](_0x8059('0x15'),controller['notify']);router[_0x8059('0x10')]('/:id/send',auth[_0x8059('0x6')](),controller['send']);router[_0x8059('0x16')]('/:id',auth[_0x8059('0x6')](),controller[_0x8059('0x17')]);router[_0x8059('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x19')]);router[_0x8059('0x18')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller['removeDispositions']);router[_0x8059('0x18')](_0x8059('0x1a'),auth[_0x8059('0x6')](),controller['removeAnswers']);router[_0x8059('0x18')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xd943=['show','get','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','send','put','/:id','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0xe6e28c,_0x5ea065){var _0x3304ba=function(_0x7c5ec5){while(--_0x7c5ec5){_0xe6e28c['push'](_0xe6e28c['shift']());}};_0x3304ba(++_0x5ea065);}(_0xd943,0x15d));var _0x3d94=function(_0x56a2c9,_0x43b416){_0x56a2c9=_0x56a2c9-0x0;var _0x275d1d=_0xd943[_0x56a2c9];return _0x275d1d;};'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('./whatsappAccount.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')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller['getDispositions']);router[_0x3d94('0xc')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router[_0x3d94('0xc')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);router['get'](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x12')]);router['post']('/',auth[_0x3d94('0x9')](),controller[_0x3d94('0x13')]);router[_0x3d94('0x14')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller[_0x3d94('0x15')]);router[_0x3d94('0x14')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x16')]);router[_0x3d94('0x14')](_0x3d94('0xf'),auth['isAuthenticated'](),controller[_0x3d94('0x17')]);router[_0x3d94('0x14')](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x18')]);router[_0x3d94('0x14')](_0x3d94('0x19'),controller['notify']);router[_0x3d94('0x14')]('/:id/send',auth[_0x3d94('0x9')](),controller[_0x3d94('0x1a')]);router[_0x3d94('0x1b')](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller['update']);router['delete'](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1d')]);router['delete'](_0x3d94('0x1e'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1f')]);router[_0x3d94('0x20')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x21')]);router[_0x3d94('0x20')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x22')]);module[_0x3d94('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 63bd118..f09e224 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 _0x3a4d=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','ENUM','twilio','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(_0x37bab7,_0x498ff7){var _0x1e453a=function(_0x10e18b){while(--_0x10e18b){_0x37bab7['push'](_0x37bab7['shift']());}};_0x1e453a(++_0x498ff7);}(_0x3a4d,0x11f));var _0xd3a4=function(_0x127074,_0x3bd855){_0x127074=_0x127074-0x0;var _0x4c9463=_0x3a4d[_0x127074];return _0x4c9463;};'use strict';var Sequelize=require(_0xd3a4('0x0'));var rs=require(_0xd3a4('0x1'));module['exports']={'name':{'type':Sequelize[_0xd3a4('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd3a4('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd3a4('0x2')],'defaultValue':function(){return rs[_0xd3a4('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd3a4('0x4')](_0xd3a4('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xd3a4('0x2')]},'baseUrl':{'type':Sequelize[_0xd3a4('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd3a4('0x6')],'defaultValue':function(){return _0xd3a4('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd3a4('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd3a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd3a4('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd3a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3a4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd3a4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3a4('0x9')],'comment':_0xd3a4('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd3a4('0xb'),'set':function(_0x4f9587){if(!_0x4f9587){this[_0xd3a4('0xc')](_0xd3a4('0xd'),null);}this[_0xd3a4('0xc')](_0xd3a4('0xe'),_0x4f9587);}},'description':{'type':Sequelize[_0xd3a4('0x2')]}}; \ No newline at end of file +var _0x3c11=['generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x3c11,0x14f));var _0x13c1=function(_0x41e967,_0x1304e3){_0x41e967=_0x41e967-0x0;var _0x58db16=_0x3c11[_0x41e967];return _0x58db16;};'use strict';var Sequelize=require(_0x13c1('0x0'));var rs=require(_0x13c1('0x1'));module[_0x13c1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x13c1('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x13c1('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x13c1('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x13c1('0x4')],'defaultValue':function(){return rs[_0x13c1('0x5')]();}},'phone':{'type':Sequelize[_0x13c1('0x4')]},'type':{'type':Sequelize[_0x13c1('0x6')](_0x13c1('0x7'),_0x13c1('0x8'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x13c1('0x4')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x13c1('0x9');}},'notificationSound':{'type':Sequelize[_0x13c1('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x13c1('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x13c1('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x13c1('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x13c1('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x13c1('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x13c1('0xa')],'defaultValue':![],'comment':_0x13c1('0xd'),'set':function(_0x29d99e){if(!_0x29d99e){this[_0x13c1('0xe')](_0x13c1('0xf'),null);}this[_0x13c1('0xe')](_0x13c1('0x10'),_0x29d99e);}},'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 2a47fda..af69249 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 _0x8b4f=['removeAnswers','addAgents','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','Applications','account','type','statuses','state','read','timestamp','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','MessageSid','sinch','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','defaults','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','unmanaged','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','WhatsappMessage','Messages','dataValues','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','destroy','get','WhatsappAccounts','stack','name','Pause','map','WhatsappAccount','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','update','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer'];(function(_0x1f54bf,_0x1287da){var _0x191b50=function(_0x522099){while(--_0x522099){_0x1f54bf['push'](_0x1f54bf['shift']());}};_0x191b50(++_0x1287da);}(_0x8b4f,0x1ec));var _0xf8b4=function(_0x36d5d5,_0x1c1590){_0x36d5d5=_0x36d5d5-0x0;var _0x4eaa56=_0x8b4f[_0x36d5d5];return _0x4eaa56;};'use strict';var emlformat=require(_0xf8b4('0x0'));var rimraf=require(_0xf8b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf8b4('0x2'));var moment=require('moment');var BPromise=require(_0xf8b4('0x3'));var Mustache=require(_0xf8b4('0x4'));var util=require('util');var path=require(_0xf8b4('0x5'));var sox=require('sox');var csv=require(_0xf8b4('0x6'));var ejs=require(_0xf8b4('0x7'));var fs=require('fs');var fs_extra=require(_0xf8b4('0x8'));var _=require(_0xf8b4('0x9'));var squel=require('squel');var crypto=require(_0xf8b4('0xa'));var jsforce=require(_0xf8b4('0xb'));var deskjs=require(_0xf8b4('0xc'));var toCsv=require(_0xf8b4('0x6'));var querystring=require(_0xf8b4('0xd'));var Papa=require(_0xf8b4('0xe'));var Redis=require('ioredis');var authService=require(_0xf8b4('0xf'));var qs=require(_0xf8b4('0x10'));var as=require(_0xf8b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8b4('0x12'))(_0xf8b4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf8b4('0x14'));var db=require(_0xf8b4('0x15'))['db'];config[_0xf8b4('0x16')]=_['defaults'](config['redis'],{'host':_0xf8b4('0x17'),'port':0x18eb});var socket=require(_0xf8b4('0x18'))(new Redis(config['redis']));require(_0xf8b4('0x19'))[_0xf8b4('0x1a')](socket);var jayson=require(_0xf8b4('0x1b'));var client=jayson['client'][_0xf8b4('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5b5554,_0x33cc7b,_0xcb32cf,_0x571437){return new BPromise(function(_0x32cf9c,_0x1c6a75){var _0x2a6ff6=_0x571437||client;return _0x2a6ff6[_0xf8b4('0x1d')](_0x5b5554,_0xcb32cf)['then'](function(_0xbe89de){logger['info'](_0xf8b4('0x1e'),_0x33cc7b,_0xf8b4('0x1f'));logger['debug'](_0xf8b4('0x20'),_0x33cc7b,_0xf8b4('0x1f'),JSON['stringify'](_0xbe89de));if(_0xbe89de['error']){if(_0xbe89de[_0xf8b4('0x21')][_0xf8b4('0x22')]===0x1f4){logger[_0xf8b4('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x33cc7b,_0xbe89de['error'][_0xf8b4('0x23')]);return _0x1c6a75(_0xbe89de[_0xf8b4('0x21')][_0xf8b4('0x23')]);}logger[_0xf8b4('0x21')](_0xf8b4('0x1e'),_0x33cc7b,_0xbe89de[_0xf8b4('0x21')][_0xf8b4('0x23')]);return _0x32cf9c(_0xbe89de[_0xf8b4('0x21')][_0xf8b4('0x23')]);}else{logger[_0xf8b4('0x24')](_0xf8b4('0x1e'),_0x33cc7b,_0xf8b4('0x1f'));_0x32cf9c(_0xbe89de[_0xf8b4('0x25')][_0xf8b4('0x23')]);}})[_0xf8b4('0x26')](function(_0x3b8879){logger[_0xf8b4('0x21')](_0xf8b4('0x1e'),_0x33cc7b,_0x3b8879);_0x1c6a75(_0x3b8879);});});}function respondWithStatusCode(_0x3cfc3b,_0x2f5856){_0x2f5856=_0x2f5856||0xcc;return function(_0x1ae5db){if(_0x1ae5db){return _0x3cfc3b[_0xf8b4('0x27')](_0x2f5856);}return _0x3cfc3b[_0xf8b4('0x28')](_0x2f5856)[_0xf8b4('0x29')]();};}function respondWithResult(_0x463c96,_0x51bb67){_0x51bb67=_0x51bb67||0xc8;return function(_0x11a321){if(_0x11a321){return _0x463c96[_0xf8b4('0x28')](_0x51bb67)['json'](_0x11a321);}};}function respondWithFilteredResult(_0x30ad83,_0x32c9ea){return function(_0x510e91){if(_0x510e91){var _0x356ba9=typeof _0x32c9ea['offset']===_0xf8b4('0x2a')&&typeof _0x32c9ea[_0xf8b4('0x2b')]===_0xf8b4('0x2a');var _0x1e9a1b=_0x510e91['count'];var _0x1bd79d=_0x356ba9?0x0:_0x32c9ea[_0xf8b4('0x2c')];var _0xb09873=_0x356ba9?_0x510e91[_0xf8b4('0x2d')]:_0x32c9ea['offset']+_0x32c9ea[_0xf8b4('0x2b')];var _0x31ddb4;if(_0xb09873>=_0x1e9a1b){_0xb09873=_0x1e9a1b;_0x31ddb4=0xc8;}else{_0x31ddb4=0xce;}_0x30ad83['status'](_0x31ddb4);return _0x30ad83[_0xf8b4('0x2e')](_0xf8b4('0x2f'),_0x1bd79d+'-'+_0xb09873+'/'+_0x1e9a1b)[_0xf8b4('0x30')](_0x510e91);}return null;};}function patchUpdates(_0x517c9a){return function(_0x45a91b){try{jsonpatch[_0xf8b4('0x31')](_0x45a91b,_0x517c9a,!![]);}catch(_0x2dc54b){return BPromise[_0xf8b4('0x32')](_0x2dc54b);}return _0x45a91b[_0xf8b4('0x33')]();};}function saveUpdates(_0x3c13f9,_0x5a8771){return function(_0x1e923a){if(_0x1e923a){return _0x1e923a['update'](_0x3c13f9)[_0xf8b4('0x34')](function(_0x356dcc){return _0x356dcc;});}return null;};}function removeEntity(_0x2eae24,_0x53b904){return function(_0x53a89e){if(_0x53a89e){return _0x53a89e[_0xf8b4('0x35')]()[_0xf8b4('0x34')](function(){var _0x28d95e=_0x53a89e[_0xf8b4('0x36')]({'plain':!![]});var _0x477040=_0xf8b4('0x37');return db['UserProfileResource'][_0xf8b4('0x35')]({'where':{'type':_0x477040,'resourceId':_0x28d95e['id']}})[_0xf8b4('0x34')](function(){return _0x53a89e;});})['then'](function(){_0x2eae24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe32dac,_0x112a40){return function(_0x1dc4df){if(!_0x1dc4df){_0xe32dac['sendStatus'](0x194);}return _0x1dc4df;};}function handleError(_0x4d2028,_0x19d100){_0x19d100=_0x19d100||0x1f4;return function(_0x1c0f6a){logger[_0xf8b4('0x21')](_0x1c0f6a[_0xf8b4('0x38')]);if(_0x1c0f6a[_0xf8b4('0x39')]){delete _0x1c0f6a[_0xf8b4('0x39')];}_0x4d2028[_0xf8b4('0x28')](_0x19d100)['send'](_0x1c0f6a);};}exports['index']=function(_0x335da9,_0x511f46){var _0x221058={'include':[{'model':db[_0xf8b4('0x3a')],'as':'mandatoryDispositionPause'}]},_0x207b45={},_0x150818={'count':0x0,'rows':[]};var _0x23233f=_[_0xf8b4('0x3b')](db[_0xf8b4('0x3c')]['rawAttributes'],function(_0x22dd94){return{'name':_0x22dd94[_0xf8b4('0x3d')],'type':_0x22dd94['type'][_0xf8b4('0x3e')]};});_0x207b45[_0xf8b4('0x3f')]=_[_0xf8b4('0x3b')](_0x23233f,_0xf8b4('0x39'));_0x207b45[_0xf8b4('0x40')]=_[_0xf8b4('0x41')](_0x335da9[_0xf8b4('0x40')]);_0x207b45[_0xf8b4('0x42')]=_['intersection'](_0x207b45['model'],_0x207b45[_0xf8b4('0x40')]);_0x221058[_0xf8b4('0x43')]=_[_0xf8b4('0x44')](_0x207b45[_0xf8b4('0x3f')],qs['fields'](_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x45')]));_0x221058['attributes']=_0x221058[_0xf8b4('0x43')]['length']?_0x221058[_0xf8b4('0x43')]:_0x207b45[_0xf8b4('0x3f')];if(!_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x46')](_0xf8b4('0x47'))){_0x221058['limit']=qs[_0xf8b4('0x2b')](_0x335da9['query'][_0xf8b4('0x2b')]);_0x221058[_0xf8b4('0x2c')]=qs[_0xf8b4('0x2c')](_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x2c')]);}_0x221058['order']=qs[_0xf8b4('0x48')](_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x48')]);_0x221058['where']=qs[_0xf8b4('0x42')](_[_0xf8b4('0x49')](_0x335da9[_0xf8b4('0x40')],_0x207b45[_0xf8b4('0x42')]),_0x23233f);if(_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x4a')]){_0x221058[_0xf8b4('0x4b')]=_[_0xf8b4('0x4c')](_0x221058[_0xf8b4('0x4b')],{'$or':_[_0xf8b4('0x3b')](_0x23233f,function(_0x1c9394){if(_0x1c9394['type']!==_0xf8b4('0x4d')){var _0x19fc5b={};_0x19fc5b[_0x1c9394[_0xf8b4('0x39')]]={'$like':'%'+_0x335da9[_0xf8b4('0x40')]['filter']+'%'};return _0x19fc5b;}})});}_0x221058=_[_0xf8b4('0x4c')]({},_0x221058,_0x335da9[_0xf8b4('0x4e')]);var _0xd8698b={'where':_0x221058[_0xf8b4('0x4b')]};return db[_0xf8b4('0x3c')][_0xf8b4('0x2d')](_0xd8698b)[_0xf8b4('0x34')](function(_0x55d23a){_0x150818['count']=_0x55d23a;if(_0x335da9[_0xf8b4('0x40')][_0xf8b4('0x4f')]){_0x221058[_0xf8b4('0x50')]=[{'all':!![]}];}return db[_0xf8b4('0x3c')][_0xf8b4('0x51')](_0x221058);})[_0xf8b4('0x34')](function(_0x134ef3){_0x150818[_0xf8b4('0x52')]=_0x134ef3;return _0x150818;})['then'](respondWithFilteredResult(_0x511f46,_0x221058))[_0xf8b4('0x26')](handleError(_0x511f46,null));};exports[_0xf8b4('0x53')]=function(_0x511b18,_0x446767){var _0x3ed0bf={'raw':![],'where':{'id':_0x511b18['params']['id']},'include':[{'model':db[_0xf8b4('0x3a')],'as':_0xf8b4('0x54')}]},_0x3477d2={};_0x3477d2[_0xf8b4('0x3f')]=_['keys'](db['WhatsappAccount'][_0xf8b4('0x55')]);_0x3477d2[_0xf8b4('0x40')]=_[_0xf8b4('0x41')](_0x511b18[_0xf8b4('0x40')]);_0x3477d2['filters']=_[_0xf8b4('0x44')](_0x3477d2['model'],_0x3477d2['query']);_0x3ed0bf[_0xf8b4('0x43')]=_['intersection'](_0x3477d2[_0xf8b4('0x3f')],qs[_0xf8b4('0x45')](_0x511b18['query'][_0xf8b4('0x45')]));_0x3ed0bf[_0xf8b4('0x43')]=_0x3ed0bf[_0xf8b4('0x43')][_0xf8b4('0x56')]?_0x3ed0bf['attributes']:_0x3477d2[_0xf8b4('0x3f')];if(_0x511b18[_0xf8b4('0x40')][_0xf8b4('0x4f')]){_0x3ed0bf[_0xf8b4('0x50')]=[{'all':!![]}];}_0x3ed0bf=_[_0xf8b4('0x4c')]({},_0x3ed0bf,_0x511b18[_0xf8b4('0x4e')]);return db[_0xf8b4('0x3c')][_0xf8b4('0x57')](_0x3ed0bf)[_0xf8b4('0x34')](handleEntityNotFound(_0x446767,null))[_0xf8b4('0x34')](respondWithResult(_0x446767,null))['catch'](handleError(_0x446767,null));};exports[_0xf8b4('0x58')]=function(_0x163a78,_0x29725a){return db[_0xf8b4('0x3c')][_0xf8b4('0x58')](_0x163a78[_0xf8b4('0x59')],{})['then'](function(_0x327332){var _0x97fef6=_0x163a78[_0xf8b4('0x5a')]['get']({'plain':!![]});if(!_0x97fef6)throw new Error(_0xf8b4('0x5b'));if(_0x97fef6[_0xf8b4('0x5c')]==='user'){var _0x224920=_0x327332[_0xf8b4('0x36')]({'plain':!![]});var _0x649575=_0xf8b4('0x37');return db[_0xf8b4('0x5d')][_0xf8b4('0x57')]({'where':{'name':_0x649575,'userProfileId':_0x97fef6[_0xf8b4('0x5e')]},'raw':!![]})[_0xf8b4('0x34')](function(_0x464672){if(_0x464672&&_0x464672['autoAssociation']===0x0){return db[_0xf8b4('0x5f')][_0xf8b4('0x58')]({'name':_0x224920[_0xf8b4('0x39')],'resourceId':_0x224920['id'],'type':_0x464672[_0xf8b4('0x39')],'sectionId':_0x464672['id']},{})[_0xf8b4('0x34')](function(){return _0x327332;});}else{return _0x327332;}})[_0xf8b4('0x26')](function(_0x439b76){logger[_0xf8b4('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439b76);throw _0x439b76;});}return _0x327332;})[_0xf8b4('0x34')](respondWithResult(_0x29725a,0xc9))[_0xf8b4('0x26')](handleError(_0x29725a,null));};exports[_0xf8b4('0x60')]=function(_0x46a45,_0x25375a){if(_0x46a45[_0xf8b4('0x59')]['id']){delete _0x46a45[_0xf8b4('0x59')]['id'];}return db['WhatsappAccount'][_0xf8b4('0x57')]({'where':{'id':_0x46a45['params']['id']},'include':[{'model':db['Pause'],'as':_0xf8b4('0x54')}]})[_0xf8b4('0x34')](handleEntityNotFound(_0x25375a,null))[_0xf8b4('0x34')](saveUpdates(_0x46a45['body'],null))['then'](respondWithResult(_0x25375a,null))['catch'](handleError(_0x25375a,null));};exports['destroy']=function(_0x48e4a6,_0x449f6f){return db[_0xf8b4('0x3c')][_0xf8b4('0x57')]({'where':{'id':_0x48e4a6[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x449f6f,null))['then'](removeEntity(_0x449f6f,null))[_0xf8b4('0x26')](handleError(_0x449f6f,null));};exports[_0xf8b4('0x62')]=function(_0x4b8c10,_0x114552){return db[_0xf8b4('0x3c')][_0xf8b4('0x62')]()[_0xf8b4('0x34')](respondWithResult(_0x114552,null))[_0xf8b4('0x26')](handleError(_0x114552,null));};exports['addDisposition']=function(_0x1ee5be,_0x5b3b42,_0x1f3e8b){if(_0x1ee5be[_0xf8b4('0x59')]['id']){delete _0x1ee5be[_0xf8b4('0x59')]['id'];}return db[_0xf8b4('0x3c')][_0xf8b4('0x57')]({'where':{'id':_0x1ee5be[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x5b3b42,null))[_0xf8b4('0x34')](function(_0x1a62f6){if(_0x1a62f6){_0x1ee5be['body'][_0xf8b4('0x63')]=_0x1a62f6['id'];return db[_0xf8b4('0x64')][_0xf8b4('0x58')](_0x1ee5be[_0xf8b4('0x59')]);}})[_0xf8b4('0x34')](respondWithResult(_0x5b3b42,null))[_0xf8b4('0x26')](handleError(_0x5b3b42,null));};exports[_0xf8b4('0x65')]=function(_0xa74a43,_0x236edd,_0x254fdd){var _0x16fc09={'raw':![],'where':{}};var _0x186d9e={};var _0x119e09={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf8b4('0x66')]({'where':{'id':_0xa74a43[_0xf8b4('0x61')]['id']}})['then'](handleEntityNotFound(_0x236edd,null))['then'](function(_0x3abeb9){if(_0x3abeb9){_0x186d9e['model']=_[_0xf8b4('0x41')](db[_0xf8b4('0x64')][_0xf8b4('0x55')]);_0x186d9e['query']=_[_0xf8b4('0x41')](_0xa74a43[_0xf8b4('0x40')]);_0x186d9e[_0xf8b4('0x42')]=_[_0xf8b4('0x44')](_0x186d9e[_0xf8b4('0x3f')],_0x186d9e[_0xf8b4('0x40')]);_0x16fc09[_0xf8b4('0x43')]=_[_0xf8b4('0x44')](_0x186d9e[_0xf8b4('0x3f')],qs[_0xf8b4('0x45')](_0xa74a43[_0xf8b4('0x40')][_0xf8b4('0x45')]));_0x16fc09[_0xf8b4('0x43')]=_0x16fc09[_0xf8b4('0x43')]['length']?_0x16fc09[_0xf8b4('0x43')]:_0x186d9e[_0xf8b4('0x3f')];if(!_0xa74a43[_0xf8b4('0x40')][_0xf8b4('0x46')](_0xf8b4('0x47'))){_0x16fc09['limit']=qs[_0xf8b4('0x2b')](_0xa74a43[_0xf8b4('0x40')][_0xf8b4('0x2b')]);_0x16fc09[_0xf8b4('0x2c')]=qs[_0xf8b4('0x2c')](_0xa74a43['query'][_0xf8b4('0x2c')]);}_0x16fc09[_0xf8b4('0x67')]=qs[_0xf8b4('0x48')](_0xa74a43['query'][_0xf8b4('0x48')]);_0x16fc09['where']=qs[_0xf8b4('0x42')](_[_0xf8b4('0x49')](_0xa74a43['query'],_0x186d9e[_0xf8b4('0x42')]));_0x16fc09[_0xf8b4('0x4b')]['WhatsappAccountId']=_0x3abeb9['id'];if(_0xa74a43[_0xf8b4('0x40')]['filter']){_0x16fc09['where']=_['merge'](_0x16fc09['where'],{'$or':_[_0xf8b4('0x3b')](_0x16fc09['attributes'],function(_0x450af6){var _0x2caee6={};_0x2caee6[_0x450af6]={'$like':'%'+_0xa74a43[_0xf8b4('0x40')][_0xf8b4('0x4a')]+'%'};return _0x2caee6;})});}_0x16fc09=_['merge']({},_0x16fc09,_0xa74a43[_0xf8b4('0x4e')]);return db['Disposition']['count']({'where':_0x16fc09['where']})[_0xf8b4('0x34')](function(_0x4638b7){_0x119e09[_0xf8b4('0x2d')]=_0x4638b7;if(_0xa74a43['query']['includeAll']){_0x16fc09[_0xf8b4('0x50')]=[{'all':!![]}];}return db[_0xf8b4('0x64')][_0xf8b4('0x51')](_0x16fc09);})['then'](function(_0x5743bc){_0x119e09[_0xf8b4('0x52')]=_0x5743bc;return _0x119e09;});}})[_0xf8b4('0x34')](respondWithFilteredResult(_0x236edd,_0x16fc09))['catch'](handleError(_0x236edd,null));};exports[_0xf8b4('0x68')]=function(_0x210fa1,_0x24c376,_0xfa413d){return db[_0xf8b4('0x3c')]['find']({'where':{'id':_0x210fa1[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x24c376,null))[_0xf8b4('0x34')](function(_0x1e1414){if(_0x1e1414){return _0x1e1414['removeDispositions'](_0x210fa1[_0xf8b4('0x40')][_0xf8b4('0x69')]);}})[_0xf8b4('0x34')](respondWithStatusCode(_0x24c376,null))[_0xf8b4('0x26')](handleError(_0x24c376,null));};exports[_0xf8b4('0x6a')]=function(_0x7db67c,_0x571632,_0x58c603){if(_0x7db67c[_0xf8b4('0x59')]['id']){delete _0x7db67c['body']['id'];}return db[_0xf8b4('0x3c')][_0xf8b4('0x57')]({'where':{'id':_0x7db67c[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x571632,null))['then'](function(_0x2e9743){if(_0x2e9743){_0x7db67c[_0xf8b4('0x59')]['WhatsappAccountId']=_0x2e9743['id'];return db[_0xf8b4('0x6b')][_0xf8b4('0x58')](_0x7db67c[_0xf8b4('0x59')]);}})[_0xf8b4('0x34')](respondWithResult(_0x571632,null))['catch'](handleError(_0x571632,null));};exports['getAnswers']=function(_0x45fb85,_0x4aa821,_0x305397){var _0x2db308={'raw':![],'where':{}};var _0x56ad82={};var _0x365b9b={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x45fb85['params']['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x4aa821,null))[_0xf8b4('0x34')](function(_0x238508){if(_0x238508){_0x56ad82[_0xf8b4('0x3f')]=_[_0xf8b4('0x41')](db[_0xf8b4('0x6b')][_0xf8b4('0x55')]);_0x56ad82[_0xf8b4('0x40')]=_[_0xf8b4('0x41')](_0x45fb85['query']);_0x56ad82['filters']=_['intersection'](_0x56ad82['model'],_0x56ad82[_0xf8b4('0x40')]);_0x2db308[_0xf8b4('0x43')]=_[_0xf8b4('0x44')](_0x56ad82['model'],qs[_0xf8b4('0x45')](_0x45fb85['query'][_0xf8b4('0x45')]));_0x2db308['attributes']=_0x2db308[_0xf8b4('0x43')][_0xf8b4('0x56')]?_0x2db308[_0xf8b4('0x43')]:_0x56ad82[_0xf8b4('0x3f')];if(!_0x45fb85[_0xf8b4('0x40')][_0xf8b4('0x46')](_0xf8b4('0x47'))){_0x2db308[_0xf8b4('0x2b')]=qs[_0xf8b4('0x2b')](_0x45fb85['query'][_0xf8b4('0x2b')]);_0x2db308[_0xf8b4('0x2c')]=qs[_0xf8b4('0x2c')](_0x45fb85[_0xf8b4('0x40')][_0xf8b4('0x2c')]);}_0x2db308[_0xf8b4('0x67')]=qs[_0xf8b4('0x48')](_0x45fb85[_0xf8b4('0x40')][_0xf8b4('0x48')]);_0x2db308['where']=qs[_0xf8b4('0x42')](_[_0xf8b4('0x49')](_0x45fb85[_0xf8b4('0x40')],_0x56ad82[_0xf8b4('0x42')]));_0x2db308[_0xf8b4('0x4b')][_0xf8b4('0x63')]=_0x238508['id'];if(_0x45fb85[_0xf8b4('0x40')][_0xf8b4('0x4a')]){_0x2db308[_0xf8b4('0x4b')]=_[_0xf8b4('0x4c')](_0x2db308[_0xf8b4('0x4b')],{'$or':_[_0xf8b4('0x3b')](_0x2db308[_0xf8b4('0x43')],function(_0x4cd90f){var _0x349792={};_0x349792[_0x4cd90f]={'$like':'%'+_0x45fb85['query']['filter']+'%'};return _0x349792;})});}_0x2db308=_[_0xf8b4('0x4c')]({},_0x2db308,_0x45fb85[_0xf8b4('0x4e')]);return db[_0xf8b4('0x6b')]['count']({'where':_0x2db308[_0xf8b4('0x4b')]})[_0xf8b4('0x34')](function(_0x4a7763){_0x365b9b[_0xf8b4('0x2d')]=_0x4a7763;if(_0x45fb85[_0xf8b4('0x40')][_0xf8b4('0x4f')]){_0x2db308[_0xf8b4('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2db308);})[_0xf8b4('0x34')](function(_0x10fe66){_0x365b9b[_0xf8b4('0x52')]=_0x10fe66;return _0x365b9b;});}})[_0xf8b4('0x34')](respondWithFilteredResult(_0x4aa821,_0x2db308))[_0xf8b4('0x26')](handleError(_0x4aa821,null));};exports[_0xf8b4('0x6c')]=function(_0x588b59,_0x28a67b,_0x2bab61){return db[_0xf8b4('0x3c')]['find']({'where':{'id':_0x588b59[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x28a67b,null))[_0xf8b4('0x34')](function(_0x136cdf){if(_0x136cdf){return _0x136cdf[_0xf8b4('0x6c')](_0x588b59[_0xf8b4('0x40')][_0xf8b4('0x69')]);}})['then'](respondWithStatusCode(_0x28a67b,null))['catch'](handleError(_0x28a67b,null));};exports['addAgents']=function(_0xf1f418,_0x4c02da,_0xeb97ce){return db['WhatsappAccount'][_0xf8b4('0x57')]({'where':{'id':_0xf1f418['params']['id']}})['then'](handleEntityNotFound(_0x4c02da,null))['then'](function(_0x417b1e){if(_0x417b1e){return _0x417b1e[_0xf8b4('0x6d')](_0xf1f418[_0xf8b4('0x59')][_0xf8b4('0x69')],_['omit'](_0xf1f418[_0xf8b4('0x59')],[_0xf8b4('0x69'),'id'])||{})['spread'](function(_0x266433){for(var _0x40485b=0x0;_0x40485b<_0xf1f418[_0xf8b4('0x59')][_0xf8b4('0x69')][_0xf8b4('0x56')];_0x40485b+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0xf1f418[_0xf8b4('0x59')]['ids'][_0x40485b]),'WhatsappAccountId':Number(_0xf1f418['params']['id'])});}return _0x266433;});}})[_0xf8b4('0x34')](respondWithResult(_0x4c02da,null))[_0xf8b4('0x26')](handleError(_0x4c02da,null));};exports['removeAgents']=function(_0x453405,_0x5e6546,_0x2c54f3){return db['WhatsappAccount'][_0xf8b4('0x57')]({'where':{'id':_0x453405[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x5e6546,null))[_0xf8b4('0x34')](function(_0x2f6eb0){if(_0x2f6eb0){return _0x2f6eb0[_0xf8b4('0x6e')](_0x453405['query'][_0xf8b4('0x69')])[_0xf8b4('0x34')](function(){if(_[_0xf8b4('0x6f')](_0x453405['query'][_0xf8b4('0x69')])){for(var _0x6cf381=0x0;_0x6cf381<_0x453405['query'][_0xf8b4('0x69')][_0xf8b4('0x56')];_0x6cf381+=0x1){socket[_0xf8b4('0x70')](_0xf8b4('0x71'),{'UserId':Number(_0x453405[_0xf8b4('0x40')][_0xf8b4('0x69')][_0x6cf381]),'WhatsappAccountId':Number(_0x453405[_0xf8b4('0x61')]['id'])});}}else{socket['emit'](_0xf8b4('0x71'),{'UserId':Number(_0x453405[_0xf8b4('0x40')][_0xf8b4('0x69')]),'WhatsappAccountId':Number(_0x453405[_0xf8b4('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x5e6546,null))[_0xf8b4('0x26')](handleError(_0x5e6546,null));};exports[_0xf8b4('0x72')]=function(_0x4baff9,_0x46ed99,_0x7dadeb){var _0x41a833={};var _0x29330b={};var _0x335e75;var _0x16341e;return db[_0xf8b4('0x3c')][_0xf8b4('0x66')]({'where':{'id':_0x4baff9['params']['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x46ed99,null))['then'](function(_0xe2ee27){if(_0xe2ee27){_0x335e75=_0xe2ee27;_0x29330b[_0xf8b4('0x3f')]=_[_0xf8b4('0x41')](db[_0xf8b4('0x73')]['rawAttributes']);_0x29330b[_0xf8b4('0x40')]=_[_0xf8b4('0x41')](_0x4baff9['query']);_0x29330b['filters']=_[_0xf8b4('0x44')](_0x29330b['model'],_0x29330b[_0xf8b4('0x40')]);_0x41a833['attributes']=_[_0xf8b4('0x44')](_0x29330b[_0xf8b4('0x3f')],qs[_0xf8b4('0x45')](_0x4baff9[_0xf8b4('0x40')][_0xf8b4('0x45')]));_0x41a833[_0xf8b4('0x43')]=_0x41a833[_0xf8b4('0x43')][_0xf8b4('0x56')]?_0x41a833[_0xf8b4('0x43')]:_0x29330b[_0xf8b4('0x3f')];_0x41a833[_0xf8b4('0x67')]=qs[_0xf8b4('0x48')](_0x4baff9[_0xf8b4('0x40')]['sort']);_0x41a833[_0xf8b4('0x4b')]=qs[_0xf8b4('0x42')](_[_0xf8b4('0x49')](_0x4baff9[_0xf8b4('0x40')],_0x29330b[_0xf8b4('0x42')]));if(_0x4baff9[_0xf8b4('0x40')][_0xf8b4('0x4a')]){_0x41a833[_0xf8b4('0x4b')]=_[_0xf8b4('0x4c')](_0x41a833[_0xf8b4('0x4b')],{'$or':_[_0xf8b4('0x3b')](_0x41a833[_0xf8b4('0x43')],function(_0x59b913){var _0x181396={};_0x181396[_0x59b913]={'$like':'%'+_0x4baff9[_0xf8b4('0x40')][_0xf8b4('0x4a')]+'%'};return _0x181396;})});}_0x41a833=_[_0xf8b4('0x4c')]({},_0x41a833,_0x4baff9['options']);return _0x335e75[_0xf8b4('0x72')](_0x41a833);}})['then'](function(_0x279f39){if(_0x279f39){_0x16341e=_0x279f39['length'];if(!_0x4baff9['query']['hasOwnProperty'](_0xf8b4('0x47'))){_0x41a833[_0xf8b4('0x2b')]=qs['limit'](_0x4baff9['query'][_0xf8b4('0x2b')]);_0x41a833[_0xf8b4('0x2c')]=qs['offset'](_0x4baff9[_0xf8b4('0x40')][_0xf8b4('0x2c')]);}return _0x335e75[_0xf8b4('0x72')](_0x41a833);}})[_0xf8b4('0x34')](function(_0xa5b389){if(_0xa5b389){return _0xa5b389?{'count':_0x16341e,'rows':_0xa5b389}:null;}})['then'](respondWithResult(_0x46ed99,null))[_0xf8b4('0x26')](handleError(_0x46ed99,null));};exports[_0xf8b4('0x74')]=function(_0x2a5c80,_0x58cc50){var _0x6a75f5=_0x2a5c80['params']['id'];var _0x31c63a=_0x2a5c80[_0xf8b4('0x59')];var _0x52ccc9=0xc8;var _0x3876d2=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xf8b4('0x75')][_0xf8b4('0x76')][_0xf8b4('0x77')][_0xf8b4('0x78')]},function(_0xf2a981){return db[_0xf8b4('0x3c')][_0xf8b4('0x66')]({'where':{'id':_0x6a75f5},'transaction':_0xf2a981})['then'](function(_0x37ed80){if(_0x37ed80){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x6a75f5},'transaction':_0xf2a981})[_0xf8b4('0x34')](function(){var _0x115037=_[_0xf8b4('0x3b')](_0x31c63a,function(_0x1d9f95){_0x1d9f95[_0xf8b4('0x63')]=_0x6a75f5;return _0x1d9f95;});return db[_0xf8b4('0x79')][_0xf8b4('0x7a')](_0x115037,{'transaction':_0xf2a981});});}else{_0x52ccc9=0x194;_0x3876d2=[];}});})[_0xf8b4('0x34')](function(){if(_0x52ccc9!==0x194){return db[_0xf8b4('0x79')][_0xf8b4('0x7b')]({'where':{'WhatsappAccountId':_0x6a75f5},'order':_0xf8b4('0x7c')})[_0xf8b4('0x34')](function(_0x3ad323){_0x3876d2=_0x3ad323;});}})['catch'](function(_0x4cb021){_0x52ccc9=0x1f4;logger['error'](_0x4cb021[_0xf8b4('0x38')]);if(_0x4cb021[_0xf8b4('0x39')]){delete _0x4cb021[_0xf8b4('0x39')];}_0x3876d2=_0x4cb021;})[_0xf8b4('0x7d')](function(){if(_0x3876d2===null){_0x58cc50[_0xf8b4('0x27')](_0x52ccc9);}else{if(_0x52ccc9===0x1f4){_0x58cc50[_0xf8b4('0x28')](_0x52ccc9)[_0xf8b4('0x7e')](_0x3876d2);}else{_0x58cc50[_0xf8b4('0x28')](_0x52ccc9)[_0xf8b4('0x30')](_0x3876d2);}}});};exports[_0xf8b4('0x7f')]=function(_0x24c62b,_0x4c920d,_0x59775a){var _0x220509={};var _0x5be1f2={};var _0x40979b;var _0x291db7;return db[_0xf8b4('0x3c')][_0xf8b4('0x66')]({'where':{'id':_0x24c62b[_0xf8b4('0x61')]['id']}})[_0xf8b4('0x34')](handleEntityNotFound(_0x4c920d,null))[_0xf8b4('0x34')](function(_0x4ceaf4){if(_0x4ceaf4){_0x40979b=_0x4ceaf4;_0x5be1f2['model']=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x5be1f2[_0xf8b4('0x40')]=_[_0xf8b4('0x41')](_0x24c62b[_0xf8b4('0x40')]);_0x5be1f2[_0xf8b4('0x42')]=_[_0xf8b4('0x44')](_0x5be1f2[_0xf8b4('0x3f')],_0x5be1f2[_0xf8b4('0x40')]);_0x220509[_0xf8b4('0x43')]=_[_0xf8b4('0x44')](_0x5be1f2[_0xf8b4('0x3f')],qs['fields'](_0x24c62b[_0xf8b4('0x40')][_0xf8b4('0x45')]));_0x220509[_0xf8b4('0x43')]=_0x220509[_0xf8b4('0x43')][_0xf8b4('0x56')]?_0x220509[_0xf8b4('0x43')]:_0x5be1f2[_0xf8b4('0x3f')];_0x220509[_0xf8b4('0x67')]=qs[_0xf8b4('0x48')](_0x24c62b[_0xf8b4('0x40')][_0xf8b4('0x48')]);_0x220509[_0xf8b4('0x4b')]=qs[_0xf8b4('0x42')](_[_0xf8b4('0x49')](_0x24c62b['query'],_0x5be1f2['filters']));if(_0x24c62b[_0xf8b4('0x40')][_0xf8b4('0x4a')]){_0x220509[_0xf8b4('0x4b')]=_['merge'](_0x220509['where'],{'$or':_['map'](_0x220509['attributes'],function(_0x4d082c){var _0x578ea6={};_0x578ea6[_0x4d082c]={'$like':'%'+_0x24c62b[_0xf8b4('0x40')][_0xf8b4('0x4a')]+'%'};return _0x578ea6;})});}_0x220509=_[_0xf8b4('0x4c')]({},_0x220509,_0x24c62b[_0xf8b4('0x4e')]);return _0x40979b[_0xf8b4('0x7f')](_0x220509);}})[_0xf8b4('0x34')](function(_0x568ec7){if(_0x568ec7){_0x291db7=_0x568ec7[_0xf8b4('0x56')];if(!_0x24c62b[_0xf8b4('0x40')]['hasOwnProperty'](_0xf8b4('0x47'))){_0x220509[_0xf8b4('0x2b')]=qs[_0xf8b4('0x2b')](_0x24c62b[_0xf8b4('0x40')][_0xf8b4('0x2b')]);_0x220509[_0xf8b4('0x2c')]=qs[_0xf8b4('0x2c')](_0x24c62b['query'][_0xf8b4('0x2c')]);}return _0x40979b['getApplications'](_0x220509);}})[_0xf8b4('0x34')](function(_0x51c396){if(_0x51c396){return _0x51c396?{'count':_0x291db7,'rows':_0x51c396}:null;}})[_0xf8b4('0x34')](respondWithResult(_0x4c920d,null))[_0xf8b4('0x26')](handleError(_0x4c920d,null));};exports[_0xf8b4('0x80')]=function(_0x40bf6f,_0x29ba2a,_0x104952){var _0x2d8935={'channel':'whatsapp'};var _0x23a070=[];var _0x5b5b10=[];var _0x29a61a={};return db['WhatsappAccount'][_0xf8b4('0x57')]({'where':{'id':_0x40bf6f['params']['id']},'include':[{'model':db[_0xf8b4('0x79')],'as':_0xf8b4('0x81')}]})[_0xf8b4('0x34')](handleEntityNotFound(_0x29ba2a,null))['then'](function(_0x87af03){_0x2d8935[_0xf8b4('0x82')]=_0x87af03;if(_0x2d8935[_0xf8b4('0x82')]&&_0x2d8935['account'][_0xf8b4('0x83')]==='sinch'&&_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x84')]){if(_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x84')]['length']===0x0)return;if(_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x84')][0x0][_0xf8b4('0x85')]!==_0xf8b4('0x86'))return;return db['WhatsappMessage'][_0xf8b4('0x60')]({'read':!![],'readAt':_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x84')][0x0][_0xf8b4('0x87')]},{'where':{'messageId':_0x40bf6f['body'][_0xf8b4('0x84')][0x0][_0xf8b4('0x88')]},'individualHooks':!![]})[_0xf8b4('0x34')](function(_0x396633){return _0x29ba2a[_0xf8b4('0x28')](0xc8)[_0xf8b4('0x30')](_0x396633);});}_0x2d8935['applications']=_[_0xf8b4('0x89')](_0x87af03[_0xf8b4('0x81')],[_0xf8b4('0x7c')],[_0xf8b4('0x8a')]);if(_0x2d8935['account'][_0xf8b4('0x81')]){delete _0x2d8935[_0xf8b4('0x82')]['Applications'];}return db[_0xf8b4('0x8b')][_0xf8b4('0x62')]()[_0xf8b4('0x34')](function(_0x27b4c5){if(!_0x27b4c5){throw new db[(_0xf8b4('0x8c'))][(_0xf8b4('0x8d'))](_0xf8b4('0x8e'));}_0x23a070=_[_0xf8b4('0x8f')](_[_0xf8b4('0x41')](_0x27b4c5),[_0xf8b4('0x90'),_0xf8b4('0x91')]);_0x5b5b10=_['difference'](_[_0xf8b4('0x41')](_0x27b4c5),[_0xf8b4('0x90'),_0xf8b4('0x91'),_0xf8b4('0x92'),_0xf8b4('0x93')]);_0x2d8935[_0xf8b4('0x59')]={'mapKey':_0xf8b4('0x94')};if(_0x2d8935['account']&&_0x2d8935[_0xf8b4('0x82')]['type']===_0xf8b4('0x95')){_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')]=_0x40bf6f['body'][_0xf8b4('0x97')][_0xf8b4('0x98')](_0xf8b4('0x99'),'');_0x2d8935[_0xf8b4('0x59')]['body']=_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x9a')];_0x2d8935[_0xf8b4('0x59')]['messageId']=_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x9b')];}if(_0x2d8935[_0xf8b4('0x82')]&&_0x2d8935[_0xf8b4('0x82')]['type']===_0xf8b4('0x9c')){_0x2d8935['body'][_0xf8b4('0x96')]=_0x40bf6f[_0xf8b4('0x59')][_0xf8b4('0x9d')][0x0][_0xf8b4('0x96')];_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x59')]=_0x40bf6f['body'][_0xf8b4('0x9d')][0x0]['message'][_0xf8b4('0x59')];_0x2d8935[_0xf8b4('0x59')]['messageId']=_0x40bf6f[_0xf8b4('0x59')]['notifications'][0x0]['message_id'];}if(_0x2d8935[_0xf8b4('0x59')]['id']){delete _0x2d8935[_0xf8b4('0x59')]['id'];}if(_['isNil'](_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')])){throw new db['Sequelize'][(_0xf8b4('0x8d'))](_0xf8b4('0x9e'));}if(_[_0xf8b4('0x9f')](_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x59')])||_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x59')]===''){throw new db[(_0xf8b4('0x8c'))][(_0xf8b4('0x8d'))](_0xf8b4('0xa0'));}if(_[_0xf8b4('0x9f')](_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0xa1')])){throw new db['Sequelize'][(_0xf8b4('0x8d'))](_0xf8b4('0xa2')+_0x5b5b10);}if(!_[_0xf8b4('0xa3')](_0x5b5b10,_0x2d8935['body']['mapKey'])){throw new db[(_0xf8b4('0x8c'))]['ValidationError'](_0xf8b4('0xa4')+_0x5b5b10);}_0x29a61a[_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0xa1')]]=_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')];return db[_0xf8b4('0xa5')][_0xf8b4('0x57')]({'where':{'id':_0x2d8935[_0xf8b4('0x82')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x29a61a,'limit':0x1,'order':[[_0xf8b4('0x91'),'DESC']]}]});})[_0xf8b4('0x34')](handleEntityNotFound(_0x29ba2a,null))['then'](function(_0x1520d5){if(_0x1520d5){_0x2d8935[_0xf8b4('0xa6')]=_['omit'](_0x1520d5,['Contacts']);if(_0x1520d5[_0xf8b4('0xa7')][_0xf8b4('0x56')]){return _0x1520d5[_0xf8b4('0xa7')][0x0];}var _0x5612ac=_[_0xf8b4('0xa8')](_0x2d8935[_0xf8b4('0x59')],{'firstName':_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')],'ListId':_0x1520d5['id']});_0x5612ac[_0x2d8935['body'][_0xf8b4('0xa1')]]=_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')];return db[_0xf8b4('0x8b')][_0xf8b4('0x58')](_0x5612ac,{'fields':_0x23a070,'raw':!![]});}})[_0xf8b4('0x34')](handleEntityNotFound(_0x29ba2a,null))['then'](function(_0x72cdfa){if(_0x72cdfa){_0x2d8935[_0xf8b4('0xa9')]=_0x72cdfa;var _0x42fe08={'ContactId':_0x72cdfa['id'],'phone':_0x2d8935['body'][_0xf8b4('0x96')],'WhatsappAccountId':_0x40bf6f[_0xf8b4('0x61')]['id']};var _0x5852b3={'ContactId':_0x72cdfa['id'],'WhatsappAccountId':_0x40bf6f[_0xf8b4('0x61')]['id'],'closed':![]};return db[_0xf8b4('0xaa')][_0xf8b4('0x57')]({'where':_0x5852b3})[_0xf8b4('0x34')](function(_0x36cf59){if(_0x36cf59){return[_0x36cf59,![]];}return db[_0xf8b4('0xaa')][_0xf8b4('0x58')](_0x42fe08)[_0xf8b4('0x34')](function(_0x1d1c32){return[_0x1d1c32,!![]];});});}})[_0xf8b4('0xab')](function(_0x2df90c,_0x13312d){_0x2d8935[_0xf8b4('0xac')]=_0x2df90c[_0xf8b4('0x36')]({'plain':!![]});_0x2d8935[_0xf8b4('0xac')][_0xf8b4('0xad')]=![];if(_0x13312d){if(_0x2d8935[_0xf8b4('0x82')][_0xf8b4('0xae')]){_0x2d8935[_0xf8b4('0xaf')]['push']({'id':0x0,'priority':_0x2d8935[_0xf8b4('0xaf')][_0xf8b4('0x56')]+0x1,'app':'close','appdata':_0xf8b4('0xb0'),'interval':'*,*,*,*'});}_0x2d8935[_0xf8b4('0xac')][_0xf8b4('0xad')]=!![];}return db['WhatsappMessage'][_0xf8b4('0x58')]({'phone':_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x96')],'messageId':_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0xb1')],'body':_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0x59')],'WhatsappAccountId':_0x40bf6f[_0xf8b4('0x61')]['id'],'WhatsappInteractionId':_0x2df90c['id'],'direction':'in','ContactId':_0x2df90c[_0xf8b4('0xb2')],'AttachmentId':_0x2d8935[_0xf8b4('0x59')][_0xf8b4('0xb3')]});})[_0xf8b4('0x34')](function(_0x317eb5){_0x2d8935['message']=_0x317eb5;if(_0x2d8935['interaction'][_0xf8b4('0xb4')]){return db['User'][_0xf8b4('0x57')]({'attributes':['id',_0xf8b4('0x39')],'where':{'id':_0x2d8935[_0xf8b4('0xac')][_0xf8b4('0xb4')]}})[_0xf8b4('0x34')](function(_0x190b05){if(_0x190b05){_0x2d8935[_0xf8b4('0xaf')][_0xf8b4('0xb5')]({'id':0x0,'priority':0x0,'app':_0xf8b4('0xb6'),'appdata':_0x190b05[_0xf8b4('0x39')]+','+(_0x2d8935['account'][_0xf8b4('0xb7')]||0xa),'interval':_0xf8b4('0xb8')});}return respondWithRpcPromise(_0xf8b4('0xb9'),_0xf8b4('0xba'),_0x2d8935);});}return respondWithRpcPromise(_0xf8b4('0xb9'),_0xf8b4('0xba'),_0x2d8935);})[_0xf8b4('0x34')](function(_0x4b3c63){if(_0x4b3c63){var _0xc9e59b=0xc8;var _0x3d9082=_0xf8b4('0xbb');logger[_0xf8b4('0x24')](_0xf8b4('0x20'),_0x3d9082,_0xc9e59b,_0xf8b4('0xbc'));logger[_0xf8b4('0xbd')](_0xf8b4('0xbe'),_0x3d9082,_0xc9e59b,'entity\x20found',JSON[_0xf8b4('0xbf')](_0x4b3c63));if(_0x2d8935[_0xf8b4('0x82')]['type']===_0xf8b4('0x95')){return _0x29ba2a['status'](_0xc9e59b)[_0xf8b4('0x2e')](_0xf8b4('0xc0'),_0xf8b4('0xc1'))[_0xf8b4('0x7e')](_0xf8b4('0xc2'));}else{return _0x29ba2a['status'](_0xc9e59b)['json'](_0x4b3c63);}}});})['catch'](handleError(_0x29ba2a,null));};exports['send']=function(_0x2c7ba1,_0x329dcd,_0x24c500){var _0x50d6b7,_0x33dacc,_0x3c8b4e;if(_['isNil'](_0x2c7ba1['body'][_0xf8b4('0x59')])||_0x2c7ba1[_0xf8b4('0x59')][_0xf8b4('0x59')]===''){throw new db[(_0xf8b4('0x8c'))][(_0xf8b4('0x8d'))](_0xf8b4('0xa0'));}if(_[_0xf8b4('0x9f')](_0x2c7ba1[_0xf8b4('0x59')]['to'])){throw new db['Sequelize']['ValidationError'](_0xf8b4('0xc3'));}_0x50d6b7=_0x2c7ba1[_0xf8b4('0x59')]['to'];return db[_0xf8b4('0x3c')][_0xf8b4('0x57')]({'where':{'id':_0x2c7ba1[_0xf8b4('0x61')]['id']},'include':[{'model':db[_0xf8b4('0xa5')],'as':_0xf8b4('0xc4'),'include':[{'model':db[_0xf8b4('0x8b')],'as':_0xf8b4('0xa7'),'where':{'mobile':_0x50d6b7},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x329dcd,null))[_0xf8b4('0x34')](function(_0x265f72){if(_0x265f72&&_0x265f72[_0xf8b4('0xc4')]){_0x33dacc=_0x265f72[_0xf8b4('0x36')]({'plain':!![]});if(_0x33dacc[_0xf8b4('0xc4')]&&_0x33dacc[_0xf8b4('0xc4')][_0xf8b4('0xa7')][_0xf8b4('0x56')]){return _0x33dacc[_0xf8b4('0xc4')][_0xf8b4('0xa7')][0x0];}return db[_0xf8b4('0x8b')]['create'](_[_0xf8b4('0xa8')](_0x2c7ba1[_0xf8b4('0x59')],{'firstName':_0x50d6b7,'mobile':_0x50d6b7,'phone':_0x50d6b7,'ListId':_0x33dacc[_0xf8b4('0x93')]}));}})[_0xf8b4('0x34')](handleEntityNotFound(_0x329dcd,null))['then'](function(_0x356fd8){if(_0x356fd8){_0x3c8b4e=_0x356fd8;return db[_0xf8b4('0xaa')][_0xf8b4('0x57')]({'where':{'ContactId':_0x3c8b4e['id'],'closed':![],'WhatsappAccountId':_0x33dacc['id']}})[_0xf8b4('0x34')](function(_0x3f63f9){if(_0x3f63f9){return[_0x3f63f9,![]];}return db[_0xf8b4('0xaa')][_0xf8b4('0x58')]({'UserId':_0x2c7ba1[_0xf8b4('0x5a')]['id'],'ContactId':_0x3c8b4e['id'],'WhatsappAccountId':_0x33dacc['id'],'phone':_0x50d6b7,'firstMsgDirection':'out','Messages':[_[_0xf8b4('0x4c')](_0x2c7ba1[_0xf8b4('0x59')],{'read':![],'body':_0x2c7ba1[_0xf8b4('0x59')][_0xf8b4('0x59')],'phone':_0x50d6b7,'WhatsappAccountId':_0x33dacc['id'],'UserId':_0x2c7ba1['user']['id'],'ContactId':_0x3c8b4e['id']})]},{'include':[{'model':db[_0xf8b4('0xc5')],'as':_0xf8b4('0xc6')}]})[_0xf8b4('0x34')](function(_0x12710a){return[_0x12710a,!![]];});});}})[_0xf8b4('0xab')](function(_0x3509ba,_0x37c43b){if(_0x37c43b){return _0x3509ba;}return db[_0xf8b4('0xc5')][_0xf8b4('0x58')](_[_0xf8b4('0x4c')](_0x2c7ba1[_0xf8b4('0x59')],{'read':![],'body':_0x2c7ba1[_0xf8b4('0x59')][_0xf8b4('0x59')],'phone':_0x50d6b7,'WhatsappAccountId':_0x33dacc['id'],'WhatsappInteractionId':_0x3509ba['id'],'UserId':_0x2c7ba1[_0xf8b4('0x5a')]['id'],'ContactId':_0x3c8b4e['id']}))[_0xf8b4('0x34')](function(_0x860109){_0x3509ba[_0xf8b4('0xc7')]['Messages']=[];_0x3509ba[_0xf8b4('0xc7')][_0xf8b4('0xc6')]['push'](_0x860109['dataValues']);return _0x3509ba;});})[_0xf8b4('0x34')](respondWithResult(_0x329dcd,null))[_0xf8b4('0x26')](handleError(_0x329dcd,null));}; \ No newline at end of file +var _0xc53e=['out','Messages','spread','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','WhatsappAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','length','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','WhatsappAccountId','findAll','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','nolimit','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','defaults','contact','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','WhatsappInteraction'];(function(_0x255aca,_0x470ac4){var _0x78b7=function(_0x5031bf){while(--_0x5031bf){_0x255aca['push'](_0x255aca['shift']());}};_0x78b7(++_0x470ac4);}(_0xc53e,0x18c));var _0xec53=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xc53e[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0xec53('0x0'));var rimraf=require(_0xec53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec53('0x2'));var rp=require(_0xec53('0x3'));var moment=require(_0xec53('0x4'));var BPromise=require(_0xec53('0x5'));var Mustache=require(_0xec53('0x6'));var util=require(_0xec53('0x7'));var path=require('path');var sox=require(_0xec53('0x8'));var csv=require(_0xec53('0x9'));var ejs=require(_0xec53('0xa'));var fs=require('fs');var fs_extra=require(_0xec53('0xb'));var _=require(_0xec53('0xc'));var squel=require(_0xec53('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec53('0xe'));var toCsv=require(_0xec53('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xec53('0xf'));var qs=require(_0xec53('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec53('0x11'));var logger=require(_0xec53('0x12'))(_0xec53('0x13'));var utils=require(_0xec53('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xec53('0x15'));var db=require('../../mysqldb')['db'];config[_0xec53('0x16')]=_['defaults'](config[_0xec53('0x16')],{'host':_0xec53('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec53('0x16')]));require('./whatsappAccount.socket')[_0xec53('0x18')](socket);var jayson=require(_0xec53('0x19'));var client=jayson[_0xec53('0x1a')][_0xec53('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x516197,_0x1d1c48,_0x1de323,_0x4e965c){return new BPromise(function(_0x770a9c,_0x485008){var _0x133e3f=_0x4e965c||client;return _0x133e3f[_0xec53('0x1c')](_0x516197,_0x1de323)[_0xec53('0x1d')](function(_0x5f3ada){logger[_0xec53('0x1e')](_0xec53('0x1f'),_0x1d1c48,_0xec53('0x20'));logger[_0xec53('0x21')](_0xec53('0x22'),_0x1d1c48,_0xec53('0x20'),JSON[_0xec53('0x23')](_0x5f3ada));if(_0x5f3ada['error']){if(_0x5f3ada[_0xec53('0x24')][_0xec53('0x25')]===0x1f4){logger[_0xec53('0x24')](_0xec53('0x1f'),_0x1d1c48,_0x5f3ada['error'][_0xec53('0x26')]);return _0x485008(_0x5f3ada[_0xec53('0x24')][_0xec53('0x26')]);}logger[_0xec53('0x24')](_0xec53('0x1f'),_0x1d1c48,_0x5f3ada[_0xec53('0x24')][_0xec53('0x26')]);return _0x770a9c(_0x5f3ada[_0xec53('0x24')][_0xec53('0x26')]);}else{logger['info'](_0xec53('0x1f'),_0x1d1c48,_0xec53('0x20'));_0x770a9c(_0x5f3ada['result']['message']);}})[_0xec53('0x27')](function(_0x5ac02e){logger[_0xec53('0x24')](_0xec53('0x1f'),_0x1d1c48,_0x5ac02e);_0x485008(_0x5ac02e);});});}function respondWithStatusCode(_0x41a0e8,_0x48e919){_0x48e919=_0x48e919||0xcc;return function(_0x3a9e2d){if(_0x3a9e2d){return _0x41a0e8[_0xec53('0x28')](_0x48e919);}return _0x41a0e8[_0xec53('0x29')](_0x48e919)[_0xec53('0x2a')]();};}function respondWithResult(_0x29cade,_0x8d92fe){_0x8d92fe=_0x8d92fe||0xc8;return function(_0x47adaa){if(_0x47adaa){return _0x29cade['status'](_0x8d92fe)[_0xec53('0x2b')](_0x47adaa);}};}function respondWithFilteredResult(_0x694005,_0x3f1fe6){return function(_0x3bb713){if(_0x3bb713){var _0x2b79b0=typeof _0x3f1fe6[_0xec53('0x2c')]===_0xec53('0x2d')&&typeof _0x3f1fe6[_0xec53('0x2e')]===_0xec53('0x2d');var _0x13717e=_0x3bb713[_0xec53('0x2f')];var _0x3b0367=_0x2b79b0?0x0:_0x3f1fe6['offset'];var _0x113318=_0x2b79b0?_0x3bb713[_0xec53('0x2f')]:_0x3f1fe6[_0xec53('0x2c')]+_0x3f1fe6[_0xec53('0x2e')];var _0x26bae1;if(_0x113318>=_0x13717e){_0x113318=_0x13717e;_0x26bae1=0xc8;}else{_0x26bae1=0xce;}_0x694005[_0xec53('0x29')](_0x26bae1);return _0x694005[_0xec53('0x30')](_0xec53('0x31'),_0x3b0367+'-'+_0x113318+'/'+_0x13717e)[_0xec53('0x2b')](_0x3bb713);}return null;};}function patchUpdates(_0xe0b4fc){return function(_0x28db0f){try{jsonpatch[_0xec53('0x32')](_0x28db0f,_0xe0b4fc,!![]);}catch(_0xaa3c61){return BPromise['reject'](_0xaa3c61);}return _0x28db0f[_0xec53('0x33')]();};}function saveUpdates(_0x3128a7,_0x2ce26a){return function(_0x5c86b2){if(_0x5c86b2){return _0x5c86b2['update'](_0x3128a7)[_0xec53('0x1d')](function(_0x46b951){return _0x46b951;});}return null;};}function removeEntity(_0x3758ed,_0x2b0fd8){return function(_0x553f0f){if(_0x553f0f){return _0x553f0f[_0xec53('0x34')]()[_0xec53('0x1d')](function(){var _0x7d8d9a=_0x553f0f[_0xec53('0x35')]({'plain':!![]});var _0x478aa4=_0xec53('0x36');return db['UserProfileResource'][_0xec53('0x34')]({'where':{'type':_0x478aa4,'resourceId':_0x7d8d9a['id']}})[_0xec53('0x1d')](function(){return _0x553f0f;});})[_0xec53('0x1d')](function(){_0x3758ed[_0xec53('0x29')](0xcc)[_0xec53('0x2a')]();});}};}function handleEntityNotFound(_0x5f2de8,_0x2d8242){return function(_0x33dab9){if(!_0x33dab9){_0x5f2de8['sendStatus'](0x194);}return _0x33dab9;};}function handleError(_0x3e4cc6,_0x4e5b58){_0x4e5b58=_0x4e5b58||0x1f4;return function(_0x42a6eb){logger[_0xec53('0x24')](_0x42a6eb[_0xec53('0x37')]);if(_0x42a6eb[_0xec53('0x38')]){delete _0x42a6eb['name'];}_0x3e4cc6[_0xec53('0x29')](_0x4e5b58)[_0xec53('0x39')](_0x42a6eb);};}exports[_0xec53('0x3a')]=function(_0x1e87d1,_0x20280e){var _0x445720={'include':[{'model':db[_0xec53('0x3b')],'as':_0xec53('0x3c')}]},_0x34ad92={},_0x581a1d={'count':0x0,'rows':[]};var _0x542c40=_[_0xec53('0x3d')](db[_0xec53('0x3e')][_0xec53('0x3f')],function(_0x3a5236){return{'name':_0x3a5236[_0xec53('0x40')],'type':_0x3a5236[_0xec53('0x41')][_0xec53('0x42')]};});_0x34ad92[_0xec53('0x43')]=_[_0xec53('0x3d')](_0x542c40,_0xec53('0x38'));_0x34ad92[_0xec53('0x44')]=_[_0xec53('0x45')](_0x1e87d1[_0xec53('0x44')]);_0x34ad92[_0xec53('0x46')]=_[_0xec53('0x47')](_0x34ad92[_0xec53('0x43')],_0x34ad92[_0xec53('0x44')]);_0x445720[_0xec53('0x48')]=_[_0xec53('0x47')](_0x34ad92['model'],qs[_0xec53('0x49')](_0x1e87d1[_0xec53('0x44')][_0xec53('0x49')]));_0x445720['attributes']=_0x445720[_0xec53('0x48')]['length']?_0x445720[_0xec53('0x48')]:_0x34ad92['model'];if(!_0x1e87d1[_0xec53('0x44')][_0xec53('0x4a')]('nolimit')){_0x445720[_0xec53('0x2e')]=qs[_0xec53('0x2e')](_0x1e87d1[_0xec53('0x44')][_0xec53('0x2e')]);_0x445720[_0xec53('0x2c')]=qs[_0xec53('0x2c')](_0x1e87d1[_0xec53('0x44')][_0xec53('0x2c')]);}_0x445720[_0xec53('0x4b')]=qs[_0xec53('0x4c')](_0x1e87d1[_0xec53('0x44')][_0xec53('0x4c')]);_0x445720[_0xec53('0x4d')]=qs[_0xec53('0x46')](_[_0xec53('0x4e')](_0x1e87d1[_0xec53('0x44')],_0x34ad92[_0xec53('0x46')]),_0x542c40);if(_0x1e87d1['query']['filter']){_0x445720[_0xec53('0x4d')]=_[_0xec53('0x4f')](_0x445720[_0xec53('0x4d')],{'$or':_[_0xec53('0x3d')](_0x542c40,function(_0x526d31){if(_0x526d31[_0xec53('0x41')]!=='VIRTUAL'){var _0x3a679e={};_0x3a679e[_0x526d31['name']]={'$like':'%'+_0x1e87d1[_0xec53('0x44')][_0xec53('0x50')]+'%'};return _0x3a679e;}})});}_0x445720=_['merge']({},_0x445720,_0x1e87d1[_0xec53('0x51')]);var _0x1b7ffb={'where':_0x445720['where']};return db[_0xec53('0x3e')][_0xec53('0x2f')](_0x1b7ffb)[_0xec53('0x1d')](function(_0x2e30e7){_0x581a1d[_0xec53('0x2f')]=_0x2e30e7;if(_0x1e87d1['query'][_0xec53('0x52')]){_0x445720[_0xec53('0x53')]=[{'all':!![]}];}return db[_0xec53('0x3e')]['findAll'](_0x445720);})['then'](function(_0x49731f){_0x581a1d[_0xec53('0x54')]=_0x49731f;return _0x581a1d;})['then'](respondWithFilteredResult(_0x20280e,_0x445720))[_0xec53('0x27')](handleError(_0x20280e,null));};exports[_0xec53('0x55')]=function(_0x3811ca,_0x5a4469){var _0x7aaec1={'raw':![],'where':{'id':_0x3811ca[_0xec53('0x56')]['id']},'include':[{'model':db[_0xec53('0x3b')],'as':_0xec53('0x3c')}]},_0x805d19={};_0x805d19[_0xec53('0x43')]=_[_0xec53('0x45')](db['WhatsappAccount'][_0xec53('0x3f')]);_0x805d19[_0xec53('0x44')]=_[_0xec53('0x45')](_0x3811ca[_0xec53('0x44')]);_0x805d19[_0xec53('0x46')]=_[_0xec53('0x47')](_0x805d19[_0xec53('0x43')],_0x805d19[_0xec53('0x44')]);_0x7aaec1[_0xec53('0x48')]=_[_0xec53('0x47')](_0x805d19['model'],qs[_0xec53('0x49')](_0x3811ca[_0xec53('0x44')][_0xec53('0x49')]));_0x7aaec1[_0xec53('0x48')]=_0x7aaec1[_0xec53('0x48')][_0xec53('0x57')]?_0x7aaec1[_0xec53('0x48')]:_0x805d19['model'];if(_0x3811ca[_0xec53('0x44')][_0xec53('0x52')]){_0x7aaec1['include']=[{'all':!![]}];}_0x7aaec1=_[_0xec53('0x4f')]({},_0x7aaec1,_0x3811ca[_0xec53('0x51')]);return db[_0xec53('0x3e')][_0xec53('0x58')](_0x7aaec1)[_0xec53('0x1d')](handleEntityNotFound(_0x5a4469,null))[_0xec53('0x1d')](respondWithResult(_0x5a4469,null))[_0xec53('0x27')](handleError(_0x5a4469,null));};exports[_0xec53('0x59')]=function(_0x150673,_0x4e43e){return db[_0xec53('0x3e')][_0xec53('0x59')](_0x150673['body'],{})[_0xec53('0x1d')](function(_0x3e52e7){var _0x25cceb=_0x150673[_0xec53('0x5a')][_0xec53('0x35')]({'plain':!![]});if(!_0x25cceb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25cceb[_0xec53('0x5b')]===_0xec53('0x5a')){var _0x30e2d2=_0x3e52e7[_0xec53('0x35')]({'plain':!![]});var _0x538a9e=_0xec53('0x36');return db[_0xec53('0x5c')][_0xec53('0x58')]({'where':{'name':_0x538a9e,'userProfileId':_0x25cceb[_0xec53('0x5d')]},'raw':!![]})[_0xec53('0x1d')](function(_0x2febbc){if(_0x2febbc&&_0x2febbc[_0xec53('0x5e')]===0x0){return db[_0xec53('0x5f')][_0xec53('0x59')]({'name':_0x30e2d2[_0xec53('0x38')],'resourceId':_0x30e2d2['id'],'type':_0x2febbc[_0xec53('0x38')],'sectionId':_0x2febbc['id']},{})['then'](function(){return _0x3e52e7;});}else{return _0x3e52e7;}})[_0xec53('0x27')](function(_0x6329ea){logger[_0xec53('0x24')](_0xec53('0x60'),_0x6329ea);throw _0x6329ea;});}return _0x3e52e7;})[_0xec53('0x1d')](respondWithResult(_0x4e43e,0xc9))['catch'](handleError(_0x4e43e,null));};exports[_0xec53('0x61')]=function(_0x420b0a,_0x3805d5){if(_0x420b0a[_0xec53('0x62')]['id']){delete _0x420b0a[_0xec53('0x62')]['id'];}return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x420b0a[_0xec53('0x56')]['id']},'include':[{'model':db[_0xec53('0x3b')],'as':_0xec53('0x3c')}]})['then'](handleEntityNotFound(_0x3805d5,null))[_0xec53('0x1d')](saveUpdates(_0x420b0a[_0xec53('0x62')],null))[_0xec53('0x1d')](respondWithResult(_0x3805d5,null))[_0xec53('0x27')](handleError(_0x3805d5,null));};exports[_0xec53('0x34')]=function(_0x4f5f6a,_0x54084f){return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x4f5f6a['params']['id']}})['then'](handleEntityNotFound(_0x54084f,null))[_0xec53('0x1d')](removeEntity(_0x54084f,null))[_0xec53('0x27')](handleError(_0x54084f,null));};exports['describe']=function(_0x2948bc,_0x2fdcf7){return db[_0xec53('0x3e')][_0xec53('0x63')]()[_0xec53('0x1d')](respondWithResult(_0x2fdcf7,null))[_0xec53('0x27')](handleError(_0x2fdcf7,null));};exports[_0xec53('0x64')]=function(_0x349027,_0x456212,_0x72833b){if(_0x349027[_0xec53('0x62')]['id']){delete _0x349027[_0xec53('0x62')]['id'];}return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x349027[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0x456212,null))[_0xec53('0x1d')](function(_0x304f04){if(_0x304f04){_0x349027[_0xec53('0x62')]['WhatsappAccountId']=_0x304f04['id'];return db[_0xec53('0x65')][_0xec53('0x59')](_0x349027[_0xec53('0x62')]);}})['then'](respondWithResult(_0x456212,null))['catch'](handleError(_0x456212,null));};exports[_0xec53('0x66')]=function(_0x3c1f5e,_0x159b22,_0xe6f804){var _0x190aa9={'raw':![],'where':{}};var _0x1ab010={};var _0x5d40c9={'count':0x0,'rows':[]};return db[_0xec53('0x3e')]['findOne']({'where':{'id':_0x3c1f5e[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0x159b22,null))[_0xec53('0x1d')](function(_0x4ab6ab){if(_0x4ab6ab){_0x1ab010['model']=_['keys'](db[_0xec53('0x65')][_0xec53('0x3f')]);_0x1ab010[_0xec53('0x44')]=_[_0xec53('0x45')](_0x3c1f5e['query']);_0x1ab010['filters']=_[_0xec53('0x47')](_0x1ab010[_0xec53('0x43')],_0x1ab010['query']);_0x190aa9[_0xec53('0x48')]=_[_0xec53('0x47')](_0x1ab010[_0xec53('0x43')],qs[_0xec53('0x49')](_0x3c1f5e[_0xec53('0x44')][_0xec53('0x49')]));_0x190aa9['attributes']=_0x190aa9[_0xec53('0x48')][_0xec53('0x57')]?_0x190aa9[_0xec53('0x48')]:_0x1ab010[_0xec53('0x43')];if(!_0x3c1f5e['query'][_0xec53('0x4a')]('nolimit')){_0x190aa9[_0xec53('0x2e')]=qs[_0xec53('0x2e')](_0x3c1f5e[_0xec53('0x44')]['limit']);_0x190aa9[_0xec53('0x2c')]=qs[_0xec53('0x2c')](_0x3c1f5e['query']['offset']);}_0x190aa9[_0xec53('0x4b')]=qs[_0xec53('0x4c')](_0x3c1f5e['query'][_0xec53('0x4c')]);_0x190aa9[_0xec53('0x4d')]=qs[_0xec53('0x46')](_[_0xec53('0x4e')](_0x3c1f5e['query'],_0x1ab010[_0xec53('0x46')]));_0x190aa9[_0xec53('0x4d')][_0xec53('0x67')]=_0x4ab6ab['id'];if(_0x3c1f5e['query']['filter']){_0x190aa9[_0xec53('0x4d')]=_['merge'](_0x190aa9[_0xec53('0x4d')],{'$or':_['map'](_0x190aa9[_0xec53('0x48')],function(_0x497651){var _0x5c79fe={};_0x5c79fe[_0x497651]={'$like':'%'+_0x3c1f5e[_0xec53('0x44')][_0xec53('0x50')]+'%'};return _0x5c79fe;})});}_0x190aa9=_['merge']({},_0x190aa9,_0x3c1f5e[_0xec53('0x51')]);return db[_0xec53('0x65')][_0xec53('0x2f')]({'where':_0x190aa9[_0xec53('0x4d')]})[_0xec53('0x1d')](function(_0x5c6995){_0x5d40c9[_0xec53('0x2f')]=_0x5c6995;if(_0x3c1f5e[_0xec53('0x44')][_0xec53('0x52')]){_0x190aa9[_0xec53('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xec53('0x68')](_0x190aa9);})[_0xec53('0x1d')](function(_0x4a770c){_0x5d40c9[_0xec53('0x54')]=_0x4a770c;return _0x5d40c9;});}})[_0xec53('0x1d')](respondWithFilteredResult(_0x159b22,_0x190aa9))[_0xec53('0x27')](handleError(_0x159b22,null));};exports['removeDispositions']=function(_0x4fc2da,_0x57b2be,_0x2dab0a){return db[_0xec53('0x3e')]['find']({'where':{'id':_0x4fc2da[_0xec53('0x56')]['id']}})['then'](handleEntityNotFound(_0x57b2be,null))['then'](function(_0x3c8090){if(_0x3c8090){return _0x3c8090[_0xec53('0x69')](_0x4fc2da['query'][_0xec53('0x6a')]);}})['then'](respondWithStatusCode(_0x57b2be,null))[_0xec53('0x27')](handleError(_0x57b2be,null));};exports['addAnswer']=function(_0x523ca1,_0x4ec704,_0xe4db75){if(_0x523ca1[_0xec53('0x62')]['id']){delete _0x523ca1[_0xec53('0x62')]['id'];}return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x523ca1[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0x4ec704,null))[_0xec53('0x1d')](function(_0x125d9d){if(_0x125d9d){_0x523ca1[_0xec53('0x62')][_0xec53('0x67')]=_0x125d9d['id'];return db['CannedAnswer'][_0xec53('0x59')](_0x523ca1['body']);}})[_0xec53('0x1d')](respondWithResult(_0x4ec704,null))[_0xec53('0x27')](handleError(_0x4ec704,null));};exports[_0xec53('0x6b')]=function(_0x9e0b5f,_0xd9102d,_0x9b0327){var _0x7e3532={'raw':![],'where':{}};var _0x2d8f8a={};var _0x28d8fd={'count':0x0,'rows':[]};return db[_0xec53('0x3e')][_0xec53('0x6c')]({'where':{'id':_0x9e0b5f[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0xd9102d,null))[_0xec53('0x1d')](function(_0x4f1a6b){if(_0x4f1a6b){_0x2d8f8a[_0xec53('0x43')]=_[_0xec53('0x45')](db[_0xec53('0x6d')][_0xec53('0x3f')]);_0x2d8f8a[_0xec53('0x44')]=_[_0xec53('0x45')](_0x9e0b5f[_0xec53('0x44')]);_0x2d8f8a[_0xec53('0x46')]=_[_0xec53('0x47')](_0x2d8f8a[_0xec53('0x43')],_0x2d8f8a[_0xec53('0x44')]);_0x7e3532['attributes']=_['intersection'](_0x2d8f8a[_0xec53('0x43')],qs[_0xec53('0x49')](_0x9e0b5f[_0xec53('0x44')]['fields']));_0x7e3532[_0xec53('0x48')]=_0x7e3532[_0xec53('0x48')][_0xec53('0x57')]?_0x7e3532['attributes']:_0x2d8f8a[_0xec53('0x43')];if(!_0x9e0b5f[_0xec53('0x44')][_0xec53('0x4a')]('nolimit')){_0x7e3532[_0xec53('0x2e')]=qs[_0xec53('0x2e')](_0x9e0b5f['query'][_0xec53('0x2e')]);_0x7e3532['offset']=qs[_0xec53('0x2c')](_0x9e0b5f[_0xec53('0x44')]['offset']);}_0x7e3532[_0xec53('0x4b')]=qs['sort'](_0x9e0b5f[_0xec53('0x44')]['sort']);_0x7e3532['where']=qs[_0xec53('0x46')](_['pick'](_0x9e0b5f[_0xec53('0x44')],_0x2d8f8a[_0xec53('0x46')]));_0x7e3532[_0xec53('0x4d')]['WhatsappAccountId']=_0x4f1a6b['id'];if(_0x9e0b5f[_0xec53('0x44')]['filter']){_0x7e3532[_0xec53('0x4d')]=_[_0xec53('0x4f')](_0x7e3532[_0xec53('0x4d')],{'$or':_[_0xec53('0x3d')](_0x7e3532['attributes'],function(_0x46d376){var _0x56229e={};_0x56229e[_0x46d376]={'$like':'%'+_0x9e0b5f['query']['filter']+'%'};return _0x56229e;})});}_0x7e3532=_[_0xec53('0x4f')]({},_0x7e3532,_0x9e0b5f[_0xec53('0x51')]);return db[_0xec53('0x6d')][_0xec53('0x2f')]({'where':_0x7e3532[_0xec53('0x4d')]})[_0xec53('0x1d')](function(_0x4651f2){_0x28d8fd['count']=_0x4651f2;if(_0x9e0b5f[_0xec53('0x44')][_0xec53('0x52')]){_0x7e3532[_0xec53('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xec53('0x68')](_0x7e3532);})[_0xec53('0x1d')](function(_0x33de29){_0x28d8fd[_0xec53('0x54')]=_0x33de29;return _0x28d8fd;});}})['then'](respondWithFilteredResult(_0xd9102d,_0x7e3532))[_0xec53('0x27')](handleError(_0xd9102d,null));};exports[_0xec53('0x6e')]=function(_0x240d1f,_0xa3aff8,_0x45899a){return db['WhatsappAccount'][_0xec53('0x58')]({'where':{'id':_0x240d1f[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0xa3aff8,null))[_0xec53('0x1d')](function(_0x5651c0){if(_0x5651c0){return _0x5651c0[_0xec53('0x6e')](_0x240d1f['query'][_0xec53('0x6a')]);}})[_0xec53('0x1d')](respondWithStatusCode(_0xa3aff8,null))[_0xec53('0x27')](handleError(_0xa3aff8,null));};exports[_0xec53('0x6f')]=function(_0x5ad190,_0x5e9b97,_0x40b7f2){return db[_0xec53('0x3e')]['find']({'where':{'id':_0x5ad190[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0x5e9b97,null))[_0xec53('0x1d')](function(_0x3ac6a4){if(_0x3ac6a4){return _0x3ac6a4[_0xec53('0x6f')](_0x5ad190[_0xec53('0x62')][_0xec53('0x6a')],_[_0xec53('0x70')](_0x5ad190[_0xec53('0x62')],[_0xec53('0x6a'),'id'])||{})['spread'](function(_0x332402){for(var _0x55e6c1=0x0;_0x55e6c1<_0x5ad190[_0xec53('0x62')][_0xec53('0x6a')][_0xec53('0x57')];_0x55e6c1+=0x1){socket[_0xec53('0x71')](_0xec53('0x72'),{'UserId':Number(_0x5ad190[_0xec53('0x62')][_0xec53('0x6a')][_0x55e6c1]),'WhatsappAccountId':Number(_0x5ad190[_0xec53('0x56')]['id'])});}return _0x332402;});}})['then'](respondWithResult(_0x5e9b97,null))[_0xec53('0x27')](handleError(_0x5e9b97,null));};exports[_0xec53('0x73')]=function(_0x42a421,_0x46e4c9,_0x4eed1a){return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x42a421[_0xec53('0x56')]['id']}})[_0xec53('0x1d')](handleEntityNotFound(_0x46e4c9,null))['then'](function(_0x2b5531){if(_0x2b5531){return _0x2b5531[_0xec53('0x73')](_0x42a421[_0xec53('0x44')]['ids'])[_0xec53('0x1d')](function(){if(_[_0xec53('0x74')](_0x42a421['query']['ids'])){for(var _0x5f2fab=0x0;_0x5f2fab<_0x42a421[_0xec53('0x44')]['ids']['length'];_0x5f2fab+=0x1){socket[_0xec53('0x71')](_0xec53('0x75'),{'UserId':Number(_0x42a421[_0xec53('0x44')]['ids'][_0x5f2fab]),'WhatsappAccountId':Number(_0x42a421[_0xec53('0x56')]['id'])});}}else{socket[_0xec53('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x42a421[_0xec53('0x44')][_0xec53('0x6a')]),'WhatsappAccountId':Number(_0x42a421[_0xec53('0x56')]['id'])});}});}})[_0xec53('0x1d')](respondWithStatusCode(_0x46e4c9,null))[_0xec53('0x27')](handleError(_0x46e4c9,null));};exports[_0xec53('0x76')]=function(_0x248945,_0x41a03a,_0x43a81c){var _0x2a9743={};var _0x157a48={};var _0x3058c7;var _0x4407e8;return db['WhatsappAccount'][_0xec53('0x6c')]({'where':{'id':_0x248945[_0xec53('0x56')]['id']}})['then'](handleEntityNotFound(_0x41a03a,null))[_0xec53('0x1d')](function(_0x4c8247){if(_0x4c8247){_0x3058c7=_0x4c8247;_0x157a48[_0xec53('0x43')]=_['keys'](db[_0xec53('0x77')][_0xec53('0x3f')]);_0x157a48[_0xec53('0x44')]=_[_0xec53('0x45')](_0x248945[_0xec53('0x44')]);_0x157a48[_0xec53('0x46')]=_[_0xec53('0x47')](_0x157a48['model'],_0x157a48[_0xec53('0x44')]);_0x2a9743[_0xec53('0x48')]=_[_0xec53('0x47')](_0x157a48[_0xec53('0x43')],qs['fields'](_0x248945[_0xec53('0x44')][_0xec53('0x49')]));_0x2a9743[_0xec53('0x48')]=_0x2a9743[_0xec53('0x48')][_0xec53('0x57')]?_0x2a9743[_0xec53('0x48')]:_0x157a48['model'];_0x2a9743[_0xec53('0x4b')]=qs[_0xec53('0x4c')](_0x248945[_0xec53('0x44')][_0xec53('0x4c')]);_0x2a9743[_0xec53('0x4d')]=qs[_0xec53('0x46')](_[_0xec53('0x4e')](_0x248945[_0xec53('0x44')],_0x157a48[_0xec53('0x46')]));if(_0x248945['query']['filter']){_0x2a9743[_0xec53('0x4d')]=_[_0xec53('0x4f')](_0x2a9743['where'],{'$or':_['map'](_0x2a9743[_0xec53('0x48')],function(_0x5f0b7e){var _0x10289c={};_0x10289c[_0x5f0b7e]={'$like':'%'+_0x248945[_0xec53('0x44')][_0xec53('0x50')]+'%'};return _0x10289c;})});}_0x2a9743=_['merge']({},_0x2a9743,_0x248945[_0xec53('0x51')]);return _0x3058c7['getAgents'](_0x2a9743);}})[_0xec53('0x1d')](function(_0x15d41e){if(_0x15d41e){_0x4407e8=_0x15d41e[_0xec53('0x57')];if(!_0x248945[_0xec53('0x44')][_0xec53('0x4a')]('nolimit')){_0x2a9743[_0xec53('0x2e')]=qs[_0xec53('0x2e')](_0x248945[_0xec53('0x44')]['limit']);_0x2a9743[_0xec53('0x2c')]=qs[_0xec53('0x2c')](_0x248945[_0xec53('0x44')][_0xec53('0x2c')]);}return _0x3058c7[_0xec53('0x76')](_0x2a9743);}})[_0xec53('0x1d')](function(_0x31c466){if(_0x31c466){return _0x31c466?{'count':_0x4407e8,'rows':_0x31c466}:null;}})[_0xec53('0x1d')](respondWithResult(_0x41a03a,null))['catch'](handleError(_0x41a03a,null));};exports['addApplications']=function(_0x163c0a,_0x134d9b){var _0x41d1a9=_0x163c0a[_0xec53('0x56')]['id'];var _0x65c524=_0x163c0a[_0xec53('0x62')];var _0x5b39a6=0xc8;var _0x21443b=null;return db[_0xec53('0x78')][_0xec53('0x79')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xec53('0x7a')]},function(_0x511a44){return db[_0xec53('0x3e')]['findOne']({'where':{'id':_0x41d1a9},'transaction':_0x511a44})['then'](function(_0x18781f){if(_0x18781f){return db[_0xec53('0x7b')][_0xec53('0x34')]({'where':{'WhatsappAccountId':_0x41d1a9},'transaction':_0x511a44})[_0xec53('0x1d')](function(){var _0x3e886b=_['map'](_0x65c524,function(_0x325c72){_0x325c72[_0xec53('0x67')]=_0x41d1a9;return _0x325c72;});return db[_0xec53('0x7b')][_0xec53('0x7c')](_0x3e886b,{'transaction':_0x511a44});});}else{_0x5b39a6=0x194;_0x21443b=[];}});})[_0xec53('0x1d')](function(){if(_0x5b39a6!==0x194){return db[_0xec53('0x7b')][_0xec53('0x7d')]({'where':{'WhatsappAccountId':_0x41d1a9},'order':_0xec53('0x7e')})[_0xec53('0x1d')](function(_0x2998f2){_0x21443b=_0x2998f2;});}})[_0xec53('0x27')](function(_0x726dd0){_0x5b39a6=0x1f4;logger[_0xec53('0x24')](_0x726dd0[_0xec53('0x37')]);if(_0x726dd0[_0xec53('0x38')]){delete _0x726dd0[_0xec53('0x38')];}_0x21443b=_0x726dd0;})[_0xec53('0x7f')](function(){if(_0x21443b===null){_0x134d9b[_0xec53('0x28')](_0x5b39a6);}else{if(_0x5b39a6===0x1f4){_0x134d9b[_0xec53('0x29')](_0x5b39a6)[_0xec53('0x39')](_0x21443b);}else{_0x134d9b[_0xec53('0x29')](_0x5b39a6)[_0xec53('0x2b')](_0x21443b);}}});};exports[_0xec53('0x80')]=function(_0x50e6ce,_0x187519,_0x1c49b8){var _0x11835c={};var _0x108a90={};var _0x5792da;var _0x2a6f35;return db['WhatsappAccount']['findOne']({'where':{'id':_0x50e6ce['params']['id']}})['then'](handleEntityNotFound(_0x187519,null))[_0xec53('0x1d')](function(_0x12f138){if(_0x12f138){_0x5792da=_0x12f138;_0x108a90[_0xec53('0x43')]=_[_0xec53('0x45')](db[_0xec53('0x7b')]['rawAttributes']);_0x108a90['query']=_[_0xec53('0x45')](_0x50e6ce['query']);_0x108a90['filters']=_['intersection'](_0x108a90[_0xec53('0x43')],_0x108a90[_0xec53('0x44')]);_0x11835c[_0xec53('0x48')]=_[_0xec53('0x47')](_0x108a90[_0xec53('0x43')],qs[_0xec53('0x49')](_0x50e6ce[_0xec53('0x44')]['fields']));_0x11835c['attributes']=_0x11835c['attributes'][_0xec53('0x57')]?_0x11835c[_0xec53('0x48')]:_0x108a90[_0xec53('0x43')];_0x11835c['order']=qs[_0xec53('0x4c')](_0x50e6ce[_0xec53('0x44')]['sort']);_0x11835c[_0xec53('0x4d')]=qs['filters'](_[_0xec53('0x4e')](_0x50e6ce[_0xec53('0x44')],_0x108a90['filters']));if(_0x50e6ce[_0xec53('0x44')][_0xec53('0x50')]){_0x11835c[_0xec53('0x4d')]=_[_0xec53('0x4f')](_0x11835c[_0xec53('0x4d')],{'$or':_['map'](_0x11835c[_0xec53('0x48')],function(_0x389a25){var _0xd5b59c={};_0xd5b59c[_0x389a25]={'$like':'%'+_0x50e6ce[_0xec53('0x44')]['filter']+'%'};return _0xd5b59c;})});}_0x11835c=_[_0xec53('0x4f')]({},_0x11835c,_0x50e6ce[_0xec53('0x51')]);return _0x5792da[_0xec53('0x80')](_0x11835c);}})['then'](function(_0x5186b5){if(_0x5186b5){_0x2a6f35=_0x5186b5[_0xec53('0x57')];if(!_0x50e6ce[_0xec53('0x44')][_0xec53('0x4a')](_0xec53('0x81'))){_0x11835c[_0xec53('0x2e')]=qs[_0xec53('0x2e')](_0x50e6ce[_0xec53('0x44')][_0xec53('0x2e')]);_0x11835c[_0xec53('0x2c')]=qs[_0xec53('0x2c')](_0x50e6ce[_0xec53('0x44')]['offset']);}return _0x5792da[_0xec53('0x80')](_0x11835c);}})[_0xec53('0x1d')](function(_0x224660){if(_0x224660){return _0x224660?{'count':_0x2a6f35,'rows':_0x224660}:null;}})[_0xec53('0x1d')](respondWithResult(_0x187519,null))[_0xec53('0x27')](handleError(_0x187519,null));};exports['notify']=function(_0x584290,_0x166cc3,_0x57fa42){var _0x2cc1e5={'channel':'whatsapp'};var _0x568b29=[];var _0x117c12=[];var _0x3ed7ba={};return db[_0xec53('0x3e')]['find']({'where':{'id':_0x584290[_0xec53('0x56')]['id']},'include':[{'model':db[_0xec53('0x7b')],'as':_0xec53('0x82')}]})[_0xec53('0x1d')](handleEntityNotFound(_0x166cc3,null))['then'](function(_0x241a87){_0x2cc1e5[_0xec53('0x83')]=_0x241a87;if(_0x2cc1e5[_0xec53('0x83')]&&_0x2cc1e5[_0xec53('0x83')][_0xec53('0x41')]===_0xec53('0x84')&&_0x584290[_0xec53('0x62')][_0xec53('0x85')]){if(_0x584290[_0xec53('0x62')]['statuses'][_0xec53('0x57')]===0x0)return;if(_0x584290[_0xec53('0x62')][_0xec53('0x85')][0x0][_0xec53('0x86')]!=='read')return;return db[_0xec53('0x87')][_0xec53('0x61')]({'read':!![],'readAt':_0x584290[_0xec53('0x62')][_0xec53('0x85')][0x0][_0xec53('0x88')]},{'where':{'messageId':_0x584290['body'][_0xec53('0x85')][0x0][_0xec53('0x89')]},'individualHooks':!![]})[_0xec53('0x1d')](function(_0x12a4a7){return _0x166cc3[_0xec53('0x29')](0xc8)[_0xec53('0x2b')](_0x12a4a7);});}_0x2cc1e5[_0xec53('0x8a')]=_[_0xec53('0x8b')](_0x241a87[_0xec53('0x82')],[_0xec53('0x7e')],[_0xec53('0x8c')]);if(_0x2cc1e5[_0xec53('0x83')][_0xec53('0x82')]){delete _0x2cc1e5[_0xec53('0x83')]['Applications'];}return db[_0xec53('0x8d')][_0xec53('0x63')]()[_0xec53('0x1d')](function(_0x17806e){if(!_0x17806e){throw new db['Sequelize'][(_0xec53('0x8e'))](_0xec53('0x8f'));}_0x568b29=_[_0xec53('0x90')](_[_0xec53('0x45')](_0x17806e),[_0xec53('0x91'),_0xec53('0x92')]);_0x117c12=_['difference'](_[_0xec53('0x45')](_0x17806e),[_0xec53('0x91'),_0xec53('0x92'),_0xec53('0x93'),_0xec53('0x94')]);_0x2cc1e5[_0xec53('0x62')]={'mapKey':_0xec53('0x95')};if(_0x2cc1e5[_0xec53('0x83')]&&_0x2cc1e5[_0xec53('0x83')][_0xec53('0x41')]===_0xec53('0x96')){_0x2cc1e5[_0xec53('0x62')][_0xec53('0x97')]=_0x584290[_0xec53('0x62')][_0xec53('0x98')]['replace']('whatsapp:','');_0x2cc1e5[_0xec53('0x62')][_0xec53('0x62')]=_0x584290['body'][_0xec53('0x99')];_0x2cc1e5[_0xec53('0x62')][_0xec53('0x9a')]=_0x584290['body'][_0xec53('0x9b')];}if(_0x2cc1e5[_0xec53('0x83')]&&_0x2cc1e5[_0xec53('0x83')][_0xec53('0x41')]===_0xec53('0x84')){_0x2cc1e5[_0xec53('0x62')][_0xec53('0x97')]=_0x584290[_0xec53('0x62')][_0xec53('0x9c')][0x0][_0xec53('0x97')];_0x2cc1e5['body']['body']=_0x584290[_0xec53('0x62')]['notifications'][0x0]['message'][_0xec53('0x62')];_0x2cc1e5['body']['messageId']=_0x584290['body'][_0xec53('0x9c')][0x0][_0xec53('0x89')];}if(_0x2cc1e5[_0xec53('0x62')]['id']){delete _0x2cc1e5[_0xec53('0x62')]['id'];}if(_['isNil'](_0x2cc1e5['body'][_0xec53('0x97')])){throw new db['Sequelize'][(_0xec53('0x8e'))](_0xec53('0x9d'));}if(_[_0xec53('0x9e')](_0x2cc1e5[_0xec53('0x62')][_0xec53('0x62')])||_0x2cc1e5[_0xec53('0x62')][_0xec53('0x62')]===''){throw new db[(_0xec53('0x9f'))][(_0xec53('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xec53('0x9e')](_0x2cc1e5[_0xec53('0x62')]['mapKey'])){throw new db[(_0xec53('0x9f'))][(_0xec53('0x8e'))](_0xec53('0xa0')+_0x117c12);}if(!_['includes'](_0x117c12,_0x2cc1e5['body']['mapKey'])){throw new db[(_0xec53('0x9f'))][(_0xec53('0x8e'))](_0xec53('0xa1')+_0x117c12);}_0x3ed7ba[_0x2cc1e5[_0xec53('0x62')][_0xec53('0xa2')]]=_0x2cc1e5[_0xec53('0x62')][_0xec53('0x97')];return db[_0xec53('0xa3')][_0xec53('0x58')]({'where':{'id':_0x2cc1e5['account']['ListId']},'include':[{'model':db[_0xec53('0x8d')],'as':_0xec53('0xa4'),'where':_0x3ed7ba,'limit':0x1,'order':[[_0xec53('0x92'),_0xec53('0xa5')]]}]});})['then'](handleEntityNotFound(_0x166cc3,null))[_0xec53('0x1d')](function(_0x436dfe){if(_0x436dfe){_0x2cc1e5[_0xec53('0xa6')]=_[_0xec53('0x70')](_0x436dfe,[_0xec53('0xa4')]);if(_0x436dfe['Contacts'][_0xec53('0x57')]){return _0x436dfe[_0xec53('0xa4')][0x0];}var _0x3e3879=_[_0xec53('0xa7')](_0x2cc1e5[_0xec53('0x62')],{'firstName':_0x2cc1e5['body']['from'],'ListId':_0x436dfe['id']});_0x3e3879[_0x2cc1e5[_0xec53('0x62')][_0xec53('0xa2')]]=_0x2cc1e5[_0xec53('0x62')][_0xec53('0x97')];return db[_0xec53('0x8d')][_0xec53('0x59')](_0x3e3879,{'fields':_0x568b29,'raw':!![]});}})[_0xec53('0x1d')](handleEntityNotFound(_0x166cc3,null))[_0xec53('0x1d')](function(_0x53e08d){if(_0x53e08d){_0x2cc1e5[_0xec53('0xa8')]=_0x53e08d;var _0x13b404={'ContactId':_0x53e08d['id'],'phone':_0x2cc1e5['body'][_0xec53('0x97')],'WhatsappAccountId':_0x584290[_0xec53('0x56')]['id']};var _0x262d1f={'ContactId':_0x53e08d['id'],'WhatsappAccountId':_0x584290[_0xec53('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xec53('0x58')]({'where':_0x262d1f})[_0xec53('0x1d')](function(_0xa47542){if(_0xa47542){return[_0xa47542,![]];}return db['WhatsappInteraction']['create'](_0x13b404)[_0xec53('0x1d')](function(_0xd517ea){return[_0xd517ea,!![]];});});}})['spread'](function(_0x442476,_0x108d7c){_0x2cc1e5[_0xec53('0xa9')]=_0x442476['get']({'plain':!![]});_0x2cc1e5['interaction'][_0xec53('0xaa')]=![];if(_0x108d7c){if(_0x2cc1e5[_0xec53('0x83')][_0xec53('0xab')]){_0x2cc1e5[_0xec53('0x8a')][_0xec53('0xac')]({'id':0x0,'priority':_0x2cc1e5[_0xec53('0x8a')][_0xec53('0x57')]+0x1,'app':_0xec53('0xad'),'appdata':_0xec53('0xae'),'interval':'*,*,*,*'});}_0x2cc1e5[_0xec53('0xa9')]['created']=!![];}return db[_0xec53('0x87')][_0xec53('0x59')]({'phone':_0x2cc1e5['body'][_0xec53('0x97')],'messageId':_0x2cc1e5[_0xec53('0x62')][_0xec53('0x9a')],'body':_0x2cc1e5[_0xec53('0x62')][_0xec53('0x62')],'WhatsappAccountId':_0x584290[_0xec53('0x56')]['id'],'WhatsappInteractionId':_0x442476['id'],'direction':'in','ContactId':_0x442476[_0xec53('0xaf')],'AttachmentId':_0x2cc1e5[_0xec53('0x62')][_0xec53('0xb0')]});})[_0xec53('0x1d')](function(_0x3c1f81){_0x2cc1e5[_0xec53('0x26')]=_0x3c1f81;if(_0x2cc1e5[_0xec53('0xa9')][_0xec53('0xb1')]){return db[_0xec53('0x77')][_0xec53('0x58')]({'attributes':['id',_0xec53('0x38')],'where':{'id':_0x2cc1e5[_0xec53('0xa9')][_0xec53('0xb1')]}})[_0xec53('0x1d')](function(_0x279a89){if(_0x279a89){_0x2cc1e5[_0xec53('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':_0xec53('0xb2'),'appdata':_0x279a89[_0xec53('0x38')]+','+(_0x2cc1e5[_0xec53('0x83')][_0xec53('0xb3')]||0xa),'interval':_0xec53('0xb4')});}return respondWithRpcPromise(_0xec53('0xb5'),'startRouting',_0x2cc1e5);});}return respondWithRpcPromise(_0xec53('0xb5'),_0xec53('0xb6'),_0x2cc1e5);})[_0xec53('0x1d')](function(_0x54b6c7){if(_0x54b6c7){var _0x315d81=0xc8;var _0x111917=_0xec53('0xb7');logger['info'](_0xec53('0x22'),_0x111917,_0x315d81,_0xec53('0xb8'));logger[_0xec53('0x21')](_0xec53('0xb9'),_0x111917,_0x315d81,'entity\x20found',JSON[_0xec53('0x23')](_0x54b6c7));if(_0x2cc1e5[_0xec53('0x83')][_0xec53('0x41')]===_0xec53('0x96')){return _0x166cc3[_0xec53('0x29')](_0x315d81)[_0xec53('0x30')]('Content-Type',_0xec53('0xba'))[_0xec53('0x39')](_0xec53('0xbb'));}else{return _0x166cc3['status'](_0x315d81)[_0xec53('0x2b')](_0x54b6c7);}}});})[_0xec53('0x27')](handleError(_0x166cc3,null));};exports[_0xec53('0x39')]=function(_0x1459cb,_0x4c72fa,_0x22af38){var _0x1f8703,_0x19c462,_0x3b804f;if(_[_0xec53('0x9e')](_0x1459cb['body']['body'])||_0x1459cb['body'][_0xec53('0x62')]===''){throw new db[(_0xec53('0x9f'))][(_0xec53('0x8e'))](_0xec53('0xbc'));}if(_[_0xec53('0x9e')](_0x1459cb[_0xec53('0x62')]['to'])){throw new db[(_0xec53('0x9f'))][(_0xec53('0x8e'))](_0xec53('0xbd'));}_0x1f8703=_0x1459cb[_0xec53('0x62')]['to'];return db[_0xec53('0x3e')][_0xec53('0x58')]({'where':{'id':_0x1459cb[_0xec53('0x56')]['id']},'include':[{'model':db[_0xec53('0xa3')],'as':_0xec53('0xbe'),'include':[{'model':db['CmContact'],'as':_0xec53('0xa4'),'where':{'mobile':_0x1f8703},'limit':0x1,'order':[[_0xec53('0x92'),_0xec53('0xa5')]]}]}]})[_0xec53('0x1d')](handleEntityNotFound(_0x4c72fa,null))[_0xec53('0x1d')](function(_0x266f3a){if(_0x266f3a&&_0x266f3a[_0xec53('0xbe')]){_0x19c462=_0x266f3a['get']({'plain':!![]});if(_0x19c462['List']&&_0x19c462[_0xec53('0xbe')][_0xec53('0xa4')][_0xec53('0x57')]){return _0x19c462['List']['Contacts'][0x0];}return db[_0xec53('0x8d')][_0xec53('0x59')](_[_0xec53('0xa7')](_0x1459cb[_0xec53('0x62')],{'firstName':_0x1f8703,'mobile':_0x1f8703,'phone':_0x1f8703,'ListId':_0x19c462[_0xec53('0x94')]}));}})[_0xec53('0x1d')](handleEntityNotFound(_0x4c72fa,null))[_0xec53('0x1d')](function(_0x270339){if(_0x270339){_0x3b804f=_0x270339;return db['WhatsappInteraction'][_0xec53('0x58')]({'where':{'ContactId':_0x3b804f['id'],'closed':![],'WhatsappAccountId':_0x19c462['id']}})[_0xec53('0x1d')](function(_0x49cd83){if(_0x49cd83){return[_0x49cd83,![]];}return db[_0xec53('0xbf')][_0xec53('0x59')]({'UserId':_0x1459cb[_0xec53('0x5a')]['id'],'ContactId':_0x3b804f['id'],'WhatsappAccountId':_0x19c462['id'],'phone':_0x1f8703,'firstMsgDirection':_0xec53('0xc0'),'Messages':[_[_0xec53('0x4f')](_0x1459cb[_0xec53('0x62')],{'read':![],'body':_0x1459cb['body']['body'],'phone':_0x1f8703,'WhatsappAccountId':_0x19c462['id'],'UserId':_0x1459cb[_0xec53('0x5a')]['id'],'ContactId':_0x3b804f['id']})]},{'include':[{'model':db[_0xec53('0x87')],'as':_0xec53('0xc1')}]})[_0xec53('0x1d')](function(_0x245e2c){return[_0x245e2c,!![]];});});}})[_0xec53('0xc2')](function(_0x3c164d,_0x51c709){if(_0x51c709){return _0x3c164d;}return db[_0xec53('0x87')][_0xec53('0x59')](_['merge'](_0x1459cb[_0xec53('0x62')],{'read':![],'body':_0x1459cb[_0xec53('0x62')][_0xec53('0x62')],'phone':_0x1f8703,'WhatsappAccountId':_0x19c462['id'],'WhatsappInteractionId':_0x3c164d['id'],'UserId':_0x1459cb[_0xec53('0x5a')]['id'],'ContactId':_0x3b804f['id']}))[_0xec53('0x1d')](function(_0x4d5391){_0x3c164d[_0xec53('0xc3')]['Messages']=[];_0x3c164d['dataValues'][_0xec53('0xc1')][_0xec53('0xac')](_0x4d5391[_0xec53('0xc3')]);return _0x3c164d;});})[_0xec53('0x1d')](respondWithResult(_0x4c72fa,null))[_0xec53('0x27')](handleError(_0x4c72fa,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f139226..3f6b1da 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 _0xa8b1=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','hasOwnProperty'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa8b1,0xc1));var _0x1a8b=function(_0xef526,_0x55b7fd){_0xef526=_0xef526-0x0;var _0x1145a8=_0xa8b1[_0xef526];return _0x1145a8;};'use strict';var EventEmitter=require(_0x1a8b('0x0'));var WhatsappAccount=require(_0x1a8b('0x1'))['db'][_0x1a8b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1a8b('0x3')](0x0);var events={'afterCreate':_0x1a8b('0x4'),'afterUpdate':_0x1a8b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2866aa){return function(_0x22376e,_0x1fbbc3,_0x3d6cc0){WhatsappAccountEvents['emit'](_0x2866aa+':'+_0x22376e['id'],_0x22376e);WhatsappAccountEvents['emit'](_0x2866aa,_0x22376e);_0x3d6cc0(null);};}for(var e in events){if(events[_0x1a8b('0x6')](e)){var event=events[e];WhatsappAccount[_0x1a8b('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xf98b=['events','WhatsappAccount','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x49d911,_0x21ded0){var _0x5c306e=function(_0x2408db){while(--_0x2408db){_0x49d911['push'](_0x49d911['shift']());}};_0x5c306e(++_0x21ded0);}(_0xf98b,0x1a4));var _0xbf98=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf98b[_0x1e7b16];return _0x37fadc;};'use strict';var EventEmitter=require(_0xbf98('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xbf98('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbf98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbf98('0x3')};function emitEvent(_0x1a1a82){return function(_0x295a28,_0x53a224,_0x57b8b7){WhatsappAccountEvents['emit'](_0x1a1a82+':'+_0x295a28['id'],_0x295a28);WhatsappAccountEvents[_0xbf98('0x4')](_0x1a1a82,_0x295a28);_0x57b8b7(null);};}for(var e in events){if(events[_0xbf98('0x5')](e)){var event=events[e];WhatsappAccount[_0xbf98('0x6')](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 0b40354..edf3cd2 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 _0xf5ff=['path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf5ff,0x162));var _0xff5f=function(_0x16cb8a,_0x25f5b5){_0x16cb8a=_0x16cb8a-0x0;var _0x52d88d=_0xf5ff[_0x16cb8a];return _0x52d88d;};'use strict';var _=require(_0xff5f('0x0'));var util=require(_0xff5f('0x1'));var logger=require(_0xff5f('0x2'))(_0xff5f('0x3'));var moment=require('moment');var BPromise=require(_0xff5f('0x4'));var rp=require(_0xff5f('0x5'));var fs=require('fs');var path=require(_0xff5f('0x6'));var rimraf=require('rimraf');var config=require(_0xff5f('0x7'));var attributes=require(_0xff5f('0x8'));module[_0xff5f('0x9')]=function(_0x50c846,_0x54678d){return _0x50c846[_0xff5f('0xa')](_0xff5f('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5367=['moment','request-promise','path','../../config/environment','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5367,0x11f));var _0x7536=function(_0x55f79a,_0x2ddd4c){_0x55f79a=_0x55f79a-0x0;var _0x2c2f68=_0x5367[_0x55f79a];return _0x2c2f68;};'use strict';var _=require(_0x7536('0x0'));var util=require('util');var logger=require(_0x7536('0x1'))(_0x7536('0x2'));var moment=require(_0x7536('0x3'));var BPromise=require('bluebird');var rp=require(_0x7536('0x4'));var fs=require('fs');var path=require(_0x7536('0x5'));var rimraf=require('rimraf');var config=require(_0x7536('0x6'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x1296c6,_0x34c822){return _0x1296c6[_0x7536('0x7')](_0x7536('0x8'),attributes,{'tableName':_0x7536('0x9'),'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 07ca4b0..b2669db 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 _0xa96b=['include','model','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappAccount','find','options','raw','attributes','map'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa96b,0x10b));var _0xba96=function(_0x37f5ac,_0x3384df){_0x37f5ac=_0x37f5ac-0x0;var _0x2bbec5=_0xa96b[_0x37f5ac];return _0x2bbec5;};'use strict';var _=require(_0xba96('0x0'));var util=require('util');var moment=require(_0xba96('0x1'));var BPromise=require(_0xba96('0x2'));var rs=require(_0xba96('0x3'));var fs=require('fs');var Redis=require(_0xba96('0x4'));var db=require(_0xba96('0x5'))['db'];var utils=require(_0xba96('0x6'));var logger=require(_0xba96('0x7'))('rpc');var config=require(_0xba96('0x8'));var jayson=require(_0xba96('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xba96('0xa')]=_['defaults'](config[_0xba96('0xa')],{'host':_0xba96('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba96('0xa')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1787dc,_0x362669,_0x3bd7d5){return new BPromise(function(_0x5dc5c1,_0x5c4092){return client[_0xba96('0xc')](_0x1787dc,_0x3bd7d5)[_0xba96('0xd')](function(_0x6e7b15){logger[_0xba96('0xe')](_0xba96('0xf'),_0x362669,_0xba96('0x10'));logger[_0xba96('0x11')](_0xba96('0x12'),_0x362669,_0xba96('0x10'),JSON[_0xba96('0x13')](_0x6e7b15));if(_0x6e7b15[_0xba96('0x14')]){if(_0x6e7b15['error'][_0xba96('0x15')]===0x1f4){logger[_0xba96('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x362669,_0x6e7b15[_0xba96('0x14')][_0xba96('0x16')]);return _0x5c4092(_0x6e7b15[_0xba96('0x14')][_0xba96('0x16')]);}logger[_0xba96('0x14')](_0xba96('0xf'),_0x362669,_0x6e7b15[_0xba96('0x14')][_0xba96('0x16')]);return _0x5dc5c1(_0x6e7b15[_0xba96('0x14')]['message']);}else{logger['info'](_0xba96('0xf'),_0x362669,'request\x20sent');_0x5dc5c1(_0x6e7b15[_0xba96('0x17')][_0xba96('0x16')]);}})['catch'](function(_0x12c5e2){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x362669,_0x12c5e2);_0x5c4092(_0x12c5e2);});});}exports['ShowWhatsappAccount']=function(_0x56ee3e){var _0x3f6631=this;return new Promise(function(_0x1b3436,_0x4ba95e){return db[_0xba96('0x18')][_0xba96('0x19')]({'raw':_0x56ee3e[_0xba96('0x1a')]?_0x56ee3e['options'][_0xba96('0x1b')]===undefined?!![]:![]:!![],'where':_0x56ee3e[_0xba96('0x1a')]?_0x56ee3e[_0xba96('0x1a')]['where']||null:null,'attributes':_0x56ee3e[_0xba96('0x1a')]?_0x56ee3e[_0xba96('0x1a')][_0xba96('0x1c')]||null:null,'include':_0x56ee3e[_0xba96('0x1a')]?_0x56ee3e['options']['include']?_[_0xba96('0x1d')](_0x56ee3e[_0xba96('0x1a')][_0xba96('0x1e')],function(_0x12bf1a){return{'model':db[_0x12bf1a['model']],'as':_0x12bf1a['as'],'attributes':_0x12bf1a['attributes'],'include':_0x12bf1a[_0xba96('0x1e')]?_[_0xba96('0x1d')](_0x12bf1a['include'],function(_0x5c1959){return{'model':db[_0x5c1959['model']],'as':_0x5c1959['as'],'attributes':_0x5c1959['attributes'],'include':_0x5c1959[_0xba96('0x1e')]?_[_0xba96('0x1d')](_0x5c1959[_0xba96('0x1e')],function(_0x51037a){return{'model':db[_0x51037a[_0xba96('0x1f')]],'as':_0x51037a['as'],'attributes':_0x51037a[_0xba96('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xba96('0xd')](function(_0x36041e){logger[_0xba96('0xe')](_0xba96('0x20'),_0x56ee3e);logger['debug']('ShowWhatsappAccount',_0x56ee3e,JSON[_0xba96('0x13')](_0x36041e));_0x1b3436(_0x36041e);})['catch'](function(_0x3037ca){logger[_0xba96('0x14')](_0xba96('0x20'),_0x3037ca[_0xba96('0x16')],_0x56ee3e);_0x4ba95e(_0x3f6631['error'](0x1f4,_0x3037ca[_0xba96('0x16')]));});});}; \ No newline at end of file +var _0x926f=['WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','WhatsappAccount','find','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x926f,0x19b));var _0xf926=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x926f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf926('0x0'));var util=require(_0xf926('0x1'));var moment=require('moment');var BPromise=require(_0xf926('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf926('0x3'));var db=require(_0xf926('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf926('0x5'));var config=require(_0xf926('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf926('0x7')][_0xf926('0x8')]({'port':0x232a});config[_0xf926('0x9')]=_[_0xf926('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf926('0xb'))(new Redis(config[_0xf926('0x9')]));require(_0xf926('0xc'))[_0xf926('0xd')](socket);function respondWithRpcPromise(_0x28c755,_0x488659,_0x8ddebc){return new BPromise(function(_0x1e20e6,_0x288e47){return client[_0xf926('0xe')](_0x28c755,_0x8ddebc)[_0xf926('0xf')](function(_0x580667){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x488659,_0xf926('0x10'));logger['debug'](_0xf926('0x11'),_0x488659,_0xf926('0x10'),JSON[_0xf926('0x12')](_0x580667));if(_0x580667[_0xf926('0x13')]){if(_0x580667[_0xf926('0x13')][_0xf926('0x14')]===0x1f4){logger[_0xf926('0x13')](_0xf926('0x15'),_0x488659,_0x580667[_0xf926('0x13')][_0xf926('0x16')]);return _0x288e47(_0x580667[_0xf926('0x13')][_0xf926('0x16')]);}logger[_0xf926('0x13')](_0xf926('0x15'),_0x488659,_0x580667[_0xf926('0x13')][_0xf926('0x16')]);return _0x1e20e6(_0x580667[_0xf926('0x13')]['message']);}else{logger[_0xf926('0x17')](_0xf926('0x15'),_0x488659,'request\x20sent');_0x1e20e6(_0x580667[_0xf926('0x18')][_0xf926('0x16')]);}})[_0xf926('0x19')](function(_0x1c0c92){logger[_0xf926('0x13')](_0xf926('0x15'),_0x488659,_0x1c0c92);_0x288e47(_0x1c0c92);});});}exports['ShowWhatsappAccount']=function(_0x2da9a9){var _0x31d7c1=this;return new Promise(function(_0x29410c,_0x514060){return db[_0xf926('0x1a')][_0xf926('0x1b')]({'raw':_0x2da9a9[_0xf926('0x1c')]?_0x2da9a9['options'][_0xf926('0x1d')]===undefined?!![]:![]:!![],'where':_0x2da9a9[_0xf926('0x1c')]?_0x2da9a9['options'][_0xf926('0x1e')]||null:null,'attributes':_0x2da9a9[_0xf926('0x1c')]?_0x2da9a9[_0xf926('0x1c')]['attributes']||null:null,'include':_0x2da9a9[_0xf926('0x1c')]?_0x2da9a9[_0xf926('0x1c')][_0xf926('0x1f')]?_[_0xf926('0x20')](_0x2da9a9[_0xf926('0x1c')][_0xf926('0x1f')],function(_0xb121fa){return{'model':db[_0xb121fa[_0xf926('0x21')]],'as':_0xb121fa['as'],'attributes':_0xb121fa[_0xf926('0x22')],'include':_0xb121fa[_0xf926('0x1f')]?_[_0xf926('0x20')](_0xb121fa[_0xf926('0x1f')],function(_0x551291){return{'model':db[_0x551291[_0xf926('0x21')]],'as':_0x551291['as'],'attributes':_0x551291[_0xf926('0x22')],'include':_0x551291[_0xf926('0x1f')]?_[_0xf926('0x20')](_0x551291[_0xf926('0x1f')],function(_0x4b7df9){return{'model':db[_0x4b7df9[_0xf926('0x21')]],'as':_0x4b7df9['as'],'attributes':_0x4b7df9[_0xf926('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf926('0xf')](function(_0x52b237){logger['info'](_0xf926('0x23'),_0x2da9a9);logger['debug']('ShowWhatsappAccount',_0x2da9a9,JSON[_0xf926('0x12')](_0x52b237));_0x29410c(_0x52b237);})[_0xf926('0x19')](function(_0x724b3d){logger['error'](_0xf926('0x23'),_0x724b3d['message'],_0x2da9a9);_0x514060(_0x31d7c1[_0xf926('0x13')](0x1f4,_0x724b3d[_0xf926('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 467b286..c608d16 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 _0xa46c=['remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x55a457,_0x4b1c05){var _0x1f7ebe=function(_0x579384){while(--_0x579384){_0x55a457['push'](_0x55a457['shift']());}};_0x1f7ebe(++_0x4b1c05);}(_0xa46c,0x11f));var _0xca46=function(_0x47093d,_0x13c08e){_0x47093d=_0x47093d-0x0;var _0x46c7b1=_0xa46c[_0x47093d];return _0x46c7b1;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xca46('0x0'),_0xca46('0x1')];function createListener(_0x2597e9,_0x3c5127){return function(_0x38b8f5){_0x3c5127[_0xca46('0x2')](_0x2597e9,_0x38b8f5);};}function removeListener(_0x1620d3,_0x4077c6){return function(){WhatsappAccountEvents[_0xca46('0x3')](_0x1620d3,_0x4077c6);};}exports[_0xca46('0x4')]=function(_0x1bced6){for(var _0x3700a8=0x0,_0x27e295=events[_0xca46('0x5')];_0x3700a8<_0x27e295;_0x3700a8++){var _0x214185=events[_0x3700a8];var _0x37605a=createListener(_0xca46('0x6')+_0x214185,_0x1bced6);WhatsappAccountEvents['on'](_0x214185,_0x37605a);}}; \ No newline at end of file +var _0x4081=['save','emit','removeListener','register','whatsappAccount:'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x4081,0x1cc));var _0x1408=function(_0x356556,_0x47a23f){_0x356556=_0x356556-0x0;var _0x4fe8e4=_0x4081[_0x356556];return _0x4fe8e4;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x1408('0x0'),'remove','update'];function createListener(_0x1c4ed0,_0x5ba75b){return function(_0x4a6755){_0x5ba75b[_0x1408('0x1')](_0x1c4ed0,_0x4a6755);};}function removeListener(_0x10a9f1,_0x593890){return function(){WhatsappAccountEvents[_0x1408('0x2')](_0x10a9f1,_0x593890);};}exports[_0x1408('0x3')]=function(_0x59c54b){for(var _0x14edf2=0x0,_0x27cbbc=events['length'];_0x14edf2<_0x27cbbc;_0x14edf2++){var _0x422ecb=events[_0x14edf2];var _0x125d4c=createListener(_0x1408('0x4')+_0x422ecb,_0x59c54b);WhatsappAccountEvents['on'](_0x422ecb,_0x125d4c);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 86e7845..1660dde 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 _0x8c22=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x519d64,_0x15828c){var _0x58700e=function(_0x2b4d64){while(--_0x2b4d64){_0x519d64['push'](_0x519d64['shift']());}};_0x58700e(++_0x15828c);}(_0x8c22,0x1ea));var _0x28c2=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x8c22[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require(_0x28c2('0x0'));var util=require(_0x28c2('0x1'));var path=require(_0x28c2('0x2'));var timeout=require(_0x28c2('0x3'));var express=require(_0x28c2('0x4'));var router=express[_0x28c2('0x5')]();var fs_extra=require(_0x28c2('0x6'));var auth=require(_0x28c2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x28c2('0x8'));var controller=require(_0x28c2('0x9'));router[_0x28c2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x28c2('0xa')](_0x28c2('0xb'),auth[_0x28c2('0xc')](),controller[_0x28c2('0xd')]);router['post']('/',auth[_0x28c2('0xc')](),controller['create']);router[_0x28c2('0xe')](_0x28c2('0xb'),auth['isAuthenticated'](),controller[_0x28c2('0xf')]);router[_0x28c2('0x10')](_0x28c2('0xb'),auth[_0x28c2('0xc')](),controller[_0x28c2('0x11')]);module[_0x28c2('0x12')]=router; \ No newline at end of file +var _0x4604=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x4ae6f4,_0x89142){var _0x2c3101=function(_0x5c6ca6){while(--_0x5c6ca6){_0x4ae6f4['push'](_0x4ae6f4['shift']());}};_0x2c3101(++_0x89142);}(_0x4604,0x67));var _0x4460=function(_0x1f829a,_0x564727){_0x1f829a=_0x1f829a-0x0;var _0x5064f8=_0x4604[_0x1f829a];return _0x5064f8;};'use strict';var multer=require(_0x4460('0x0'));var util=require(_0x4460('0x1'));var path=require(_0x4460('0x2'));var timeout=require(_0x4460('0x3'));var express=require('express');var router=express[_0x4460('0x4')]();var fs_extra=require(_0x4460('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4460('0x6'));var config=require(_0x4460('0x7'));var controller=require(_0x4460('0x8'));router[_0x4460('0x9')]('/',auth[_0x4460('0xa')](),controller[_0x4460('0xb')]);router[_0x4460('0x9')](_0x4460('0xc'),auth[_0x4460('0xa')](),controller[_0x4460('0xd')]);router[_0x4460('0xe')]('/',auth[_0x4460('0xa')](),controller[_0x4460('0xf')]);router[_0x4460('0x10')](_0x4460('0xc'),auth[_0x4460('0xa')](),controller[_0x4460('0x11')]);router[_0x4460('0x12')](_0x4460('0xc'),auth[_0x4460('0xa')](),controller['destroy']);module[_0x4460('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index f814af8..4b8a504 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 _0xc8bb=['*,*,*,*','exports','STRING','noop'];(function(_0x29d3cf,_0x4edf5d){var _0x3cc8ee=function(_0x40b455){while(--_0x40b455){_0x29d3cf['push'](_0x29d3cf['shift']());}};_0x3cc8ee(++_0x4edf5d);}(_0xc8bb,0xb9));var _0xbc8b=function(_0x47c10b,_0x5304c4){_0x47c10b=_0x47c10b-0x0;var _0x29823b=_0xc8bb[_0x47c10b];return _0x29823b;};'use strict';var Sequelize=require('sequelize');module[_0xbc8b('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbc8b('0x1')],'allowNull':![],'defaultValue':_0xbc8b('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbc8b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbc8b('0x3')}}; \ No newline at end of file +var _0x3836=['STRING','TEXT','*,*,*,*','exports'];(function(_0x39c341,_0x2f47ff){var _0x58f61e=function(_0x101e79){while(--_0x101e79){_0x39c341['push'](_0x39c341['shift']());}};_0x58f61e(++_0x2f47ff);}(_0x3836,0x14f));var _0x6383=function(_0x26a84c,_0x5724a7){_0x26a84c=_0x26a84c-0x0;var _0xa7793f=_0x3836[_0x26a84c];return _0xa7793f;};'use strict';var Sequelize=require('sequelize');module[_0x6383('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6383('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6383('0x2')]()},'description':{'type':Sequelize[_0x6383('0x1')]},'interval':{'type':Sequelize[_0x6383('0x1')],'defaultValue':_0x6383('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a5782c1..14e1d99 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 _0xba6f=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','WhatsappApplication','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xd4c789,_0x1f639c){var _0x464017=function(_0x4aadc9){while(--_0x4aadc9){_0xd4c789['push'](_0xd4c789['shift']());}};_0x464017(++_0x1f639c);}(_0xba6f,0x1d0));var _0xfba6=function(_0x3edc22,_0x243990){_0x3edc22=_0x3edc22-0x0;var _0x1ddf50=_0xba6f[_0x3edc22];return _0x1ddf50;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba6('0x1'));var jsonpatch=require(_0xfba6('0x2'));var rp=require(_0xfba6('0x3'));var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require(_0xfba6('0x7'));var path=require(_0xfba6('0x8'));var sox=require(_0xfba6('0x9'));var csv=require(_0xfba6('0xa'));var ejs=require(_0xfba6('0xb'));var fs=require('fs');var fs_extra=require(_0xfba6('0xc'));var _=require(_0xfba6('0xd'));var squel=require('squel');var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfba6('0x10'));var Redis=require(_0xfba6('0x11'));var authService=require(_0xfba6('0x12'));var qs=require(_0xfba6('0x13'));var as=require(_0xfba6('0x14'));var hardwareService=require(_0xfba6('0x15'));var logger=require(_0xfba6('0x16'))(_0xfba6('0x17'));var utils=require(_0xfba6('0x18'));var config=require(_0xfba6('0x19'));var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcfafdb,_0xd34d87){_0xd34d87=_0xd34d87||0xcc;return function(_0x315faf){if(_0x315faf){return _0xcfafdb[_0xfba6('0x1b')](_0xd34d87);}return _0xcfafdb['status'](_0xd34d87)[_0xfba6('0x1c')]();};}function respondWithResult(_0x5dc9e1,_0x4f465f){_0x4f465f=_0x4f465f||0xc8;return function(_0x184169){if(_0x184169){return _0x5dc9e1[_0xfba6('0x1d')](_0x4f465f)[_0xfba6('0x1e')](_0x184169);}};}function respondWithFilteredResult(_0x1d76de,_0x38055e){return function(_0x2c4692){if(_0x2c4692){var _0x24b6a0=typeof _0x38055e[_0xfba6('0x1f')]===_0xfba6('0x20')&&typeof _0x38055e[_0xfba6('0x21')]===_0xfba6('0x20');var _0xf3dbbc=_0x2c4692[_0xfba6('0x22')];var _0x5a29a4=_0x24b6a0?0x0:_0x38055e[_0xfba6('0x1f')];var _0x267c09=_0x24b6a0?_0x2c4692['count']:_0x38055e['offset']+_0x38055e[_0xfba6('0x21')];var _0x204784;if(_0x267c09>=_0xf3dbbc){_0x267c09=_0xf3dbbc;_0x204784=0xc8;}else{_0x204784=0xce;}_0x1d76de['status'](_0x204784);return _0x1d76de[_0xfba6('0x23')](_0xfba6('0x24'),_0x5a29a4+'-'+_0x267c09+'/'+_0xf3dbbc)[_0xfba6('0x1e')](_0x2c4692);}return null;};}function patchUpdates(_0x4f1d15){return function(_0x167528){try{jsonpatch[_0xfba6('0x25')](_0x167528,_0x4f1d15,!![]);}catch(_0xa16868){return BPromise['reject'](_0xa16868);}return _0x167528[_0xfba6('0x26')]();};}function saveUpdates(_0x12f000,_0x25e0ff){return function(_0x2afd26){if(_0x2afd26){return _0x2afd26[_0xfba6('0x27')](_0x12f000)[_0xfba6('0x28')](function(_0x203a4e){return _0x203a4e;});}return null;};}function removeEntity(_0x56b427,_0x5e09ff){return function(_0x41b356){if(_0x41b356){return _0x41b356[_0xfba6('0x29')]()[_0xfba6('0x28')](function(){_0x56b427[_0xfba6('0x1d')](0xcc)[_0xfba6('0x1c')]();});}};}function handleEntityNotFound(_0x53c99a,_0x408ccc){return function(_0x4114bc){if(!_0x4114bc){_0x53c99a[_0xfba6('0x1b')](0x194);}return _0x4114bc;};}function handleError(_0x11bde3,_0x3af399){_0x3af399=_0x3af399||0x1f4;return function(_0x7c7f6a){logger['error'](_0x7c7f6a[_0xfba6('0x2a')]);if(_0x7c7f6a[_0xfba6('0x2b')]){delete _0x7c7f6a['name'];}_0x11bde3[_0xfba6('0x1d')](_0x3af399)[_0xfba6('0x2c')](_0x7c7f6a);};}exports['index']=function(_0x2d703e,_0x3da118){var _0x5f31af={},_0x47973f={},_0x56e8e6={'count':0x0,'rows':[]};var _0xf8134a=_[_0xfba6('0x2d')](db[_0xfba6('0x2e')]['rawAttributes'],function(_0x17440e){return{'name':_0x17440e[_0xfba6('0x2f')],'type':_0x17440e[_0xfba6('0x30')][_0xfba6('0x31')]};});_0x47973f['model']=_[_0xfba6('0x2d')](_0xf8134a,'name');_0x47973f[_0xfba6('0x32')]=_[_0xfba6('0x33')](_0x2d703e[_0xfba6('0x32')]);_0x47973f[_0xfba6('0x34')]=_[_0xfba6('0x35')](_0x47973f['model'],_0x47973f[_0xfba6('0x32')]);_0x5f31af[_0xfba6('0x36')]=_['intersection'](_0x47973f[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x38')]));_0x5f31af[_0xfba6('0x36')]=_0x5f31af[_0xfba6('0x36')][_0xfba6('0x39')]?_0x5f31af[_0xfba6('0x36')]:_0x47973f[_0xfba6('0x37')];if(!_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3a')](_0xfba6('0x3b'))){_0x5f31af['limit']=qs[_0xfba6('0x21')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x21')]);_0x5f31af[_0xfba6('0x1f')]=qs[_0xfba6('0x1f')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x1f')]);}_0x5f31af[_0xfba6('0x3c')]=qs[_0xfba6('0x3d')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3d')]);_0x5f31af['where']=qs[_0xfba6('0x34')](_['pick'](_0x2d703e[_0xfba6('0x32')],_0x47973f[_0xfba6('0x34')]),_0xf8134a);if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3e')]){_0x5f31af[_0xfba6('0x3f')]=_[_0xfba6('0x40')](_0x5f31af[_0xfba6('0x3f')],{'$or':_[_0xfba6('0x2d')](_0xf8134a,function(_0x5bad10){if(_0x5bad10[_0xfba6('0x30')]!==_0xfba6('0x41')){var _0x4807f5={};_0x4807f5[_0x5bad10[_0xfba6('0x2b')]]={'$like':'%'+_0x2d703e['query'][_0xfba6('0x3e')]+'%'};return _0x4807f5;}})});}_0x5f31af=_[_0xfba6('0x40')]({},_0x5f31af,_0x2d703e['options']);var _0x203c67={'where':_0x5f31af[_0xfba6('0x3f')]};return db[_0xfba6('0x2e')]['count'](_0x203c67)[_0xfba6('0x28')](function(_0x18d17c){_0x56e8e6[_0xfba6('0x22')]=_0x18d17c;if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x42')]){_0x5f31af[_0xfba6('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xfba6('0x44')](_0x5f31af);})[_0xfba6('0x28')](function(_0x27a493){_0x56e8e6[_0xfba6('0x45')]=_0x27a493;return _0x56e8e6;})[_0xfba6('0x28')](respondWithFilteredResult(_0x3da118,_0x5f31af))[_0xfba6('0x46')](handleError(_0x3da118,null));};exports[_0xfba6('0x47')]=function(_0x28a9d6,_0x51ee39){var _0x47ca82={'raw':!![],'where':{'id':_0x28a9d6['params']['id']}},_0x18b81d={};_0x18b81d[_0xfba6('0x37')]=_[_0xfba6('0x33')](db[_0xfba6('0x2e')][_0xfba6('0x48')]);_0x18b81d['query']=_[_0xfba6('0x33')](_0x28a9d6['query']);_0x18b81d[_0xfba6('0x34')]=_['intersection'](_0x18b81d[_0xfba6('0x37')],_0x18b81d[_0xfba6('0x32')]);_0x47ca82[_0xfba6('0x36')]=_[_0xfba6('0x35')](_0x18b81d[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x38')]));_0x47ca82[_0xfba6('0x36')]=_0x47ca82['attributes'][_0xfba6('0x39')]?_0x47ca82[_0xfba6('0x36')]:_0x18b81d[_0xfba6('0x37')];if(_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x42')]){_0x47ca82[_0xfba6('0x43')]=[{'all':!![]}];}_0x47ca82=_[_0xfba6('0x40')]({},_0x47ca82,_0x28a9d6[_0xfba6('0x49')]);return db[_0xfba6('0x2e')][_0xfba6('0x4a')](_0x47ca82)[_0xfba6('0x28')](handleEntityNotFound(_0x51ee39,null))[_0xfba6('0x28')](respondWithResult(_0x51ee39,null))[_0xfba6('0x46')](handleError(_0x51ee39,null));};exports[_0xfba6('0x4b')]=function(_0x2c3e90,_0x56900e){return db[_0xfba6('0x2e')][_0xfba6('0x4b')](_0x2c3e90[_0xfba6('0x4c')],{})[_0xfba6('0x28')](respondWithResult(_0x56900e,0xc9))[_0xfba6('0x46')](handleError(_0x56900e,null));};exports[_0xfba6('0x27')]=function(_0x26c050,_0xb637ca){if(_0x26c050['body']['id']){delete _0x26c050['body']['id'];}return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x26c050[_0xfba6('0x4d')]['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0xb637ca,null))[_0xfba6('0x28')](saveUpdates(_0x26c050['body'],null))['then'](respondWithResult(_0xb637ca,null))[_0xfba6('0x46')](handleError(_0xb637ca,null));};exports[_0xfba6('0x29')]=function(_0x4f78ff,_0x4c150){return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x4f78ff['params']['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0x4c150,null))['then'](removeEntity(_0x4c150,null))[_0xfba6('0x46')](handleError(_0x4c150,null));}; \ No newline at end of file +var _0xc43c=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','WhatsappApplication','includeAll','include','rows','catch','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','sox','to-csv','ejs'];(function(_0x3d37cf,_0x3d1ace){var _0x4f2e5e=function(_0x3c93d8){while(--_0x3c93d8){_0x3d37cf['push'](_0x3d37cf['shift']());}};_0x4f2e5e(++_0x3d1ace);}(_0xc43c,0xd4));var _0xcc43=function(_0x9b52e2,_0x3014fc){_0x9b52e2=_0x9b52e2-0x0;var _0x28c9e1=_0xc43c[_0x9b52e2];return _0x28c9e1;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc43('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcc43('0x4'));var csv=require(_0xcc43('0x5'));var ejs=require(_0xcc43('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc43('0x7'));var squel=require(_0xcc43('0x8'));var crypto=require(_0xcc43('0x9'));var jsforce=require(_0xcc43('0xa'));var deskjs=require(_0xcc43('0xb'));var toCsv=require(_0xcc43('0x5'));var querystring=require(_0xcc43('0xc'));var Papa=require(_0xcc43('0xd'));var Redis=require('ioredis');var authService=require(_0xcc43('0xe'));var qs=require(_0xcc43('0xf'));var as=require(_0xcc43('0x10'));var hardwareService=require(_0xcc43('0x11'));var logger=require(_0xcc43('0x12'))(_0xcc43('0x13'));var utils=require(_0xcc43('0x14'));var config=require(_0xcc43('0x15'));var licenseUtil=require(_0xcc43('0x16'));var db=require(_0xcc43('0x17'))['db'];function respondWithStatusCode(_0x31257d,_0x52c7fb){_0x52c7fb=_0x52c7fb||0xcc;return function(_0x2d17bb){if(_0x2d17bb){return _0x31257d[_0xcc43('0x18')](_0x52c7fb);}return _0x31257d[_0xcc43('0x19')](_0x52c7fb)[_0xcc43('0x1a')]();};}function respondWithResult(_0x5c4e8d,_0x2ce18b){_0x2ce18b=_0x2ce18b||0xc8;return function(_0x446095){if(_0x446095){return _0x5c4e8d[_0xcc43('0x19')](_0x2ce18b)[_0xcc43('0x1b')](_0x446095);}};}function respondWithFilteredResult(_0xed8608,_0x538d67){return function(_0x2e2a21){if(_0x2e2a21){var _0x3a1933=typeof _0x538d67['offset']===_0xcc43('0x1c')&&typeof _0x538d67['limit']===_0xcc43('0x1c');var _0x43ed95=_0x2e2a21[_0xcc43('0x1d')];var _0x50348a=_0x3a1933?0x0:_0x538d67[_0xcc43('0x1e')];var _0x295ecb=_0x3a1933?_0x2e2a21[_0xcc43('0x1d')]:_0x538d67[_0xcc43('0x1e')]+_0x538d67['limit'];var _0x2d526e;if(_0x295ecb>=_0x43ed95){_0x295ecb=_0x43ed95;_0x2d526e=0xc8;}else{_0x2d526e=0xce;}_0xed8608[_0xcc43('0x19')](_0x2d526e);return _0xed8608['set'](_0xcc43('0x1f'),_0x50348a+'-'+_0x295ecb+'/'+_0x43ed95)['json'](_0x2e2a21);}return null;};}function patchUpdates(_0xcfb0d9){return function(_0x5dda76){try{jsonpatch[_0xcc43('0x20')](_0x5dda76,_0xcfb0d9,!![]);}catch(_0x2a604e){return BPromise[_0xcc43('0x21')](_0x2a604e);}return _0x5dda76['save']();};}function saveUpdates(_0x213757,_0x5e0a61){return function(_0x1a578f){if(_0x1a578f){return _0x1a578f[_0xcc43('0x22')](_0x213757)[_0xcc43('0x23')](function(_0x948783){return _0x948783;});}return null;};}function removeEntity(_0x36b655,_0x5b9195){return function(_0x2ba3d0){if(_0x2ba3d0){return _0x2ba3d0[_0xcc43('0x24')]()['then'](function(){_0x36b655[_0xcc43('0x19')](0xcc)[_0xcc43('0x1a')]();});}};}function handleEntityNotFound(_0x7838d0,_0x55fd66){return function(_0x35d2a1){if(!_0x35d2a1){_0x7838d0['sendStatus'](0x194);}return _0x35d2a1;};}function handleError(_0x26a407,_0xf78759){_0xf78759=_0xf78759||0x1f4;return function(_0x399d3a){logger[_0xcc43('0x25')](_0x399d3a[_0xcc43('0x26')]);if(_0x399d3a['name']){delete _0x399d3a[_0xcc43('0x27')];}_0x26a407[_0xcc43('0x19')](_0xf78759)[_0xcc43('0x28')](_0x399d3a);};}exports[_0xcc43('0x29')]=function(_0x246ecb,_0x5940da){var _0x4c1492={},_0x17acce={},_0x3a0779={'count':0x0,'rows':[]};var _0x28cc44=_[_0xcc43('0x2a')](db['WhatsappApplication'][_0xcc43('0x2b')],function(_0x3c0b77){return{'name':_0x3c0b77[_0xcc43('0x2c')],'type':_0x3c0b77[_0xcc43('0x2d')]['key']};});_0x17acce[_0xcc43('0x2e')]=_[_0xcc43('0x2a')](_0x28cc44,_0xcc43('0x27'));_0x17acce[_0xcc43('0x2f')]=_['keys'](_0x246ecb['query']);_0x17acce[_0xcc43('0x30')]=_[_0xcc43('0x31')](_0x17acce[_0xcc43('0x2e')],_0x17acce[_0xcc43('0x2f')]);_0x4c1492[_0xcc43('0x32')]=_[_0xcc43('0x31')](_0x17acce[_0xcc43('0x2e')],qs[_0xcc43('0x33')](_0x246ecb['query'][_0xcc43('0x33')]));_0x4c1492['attributes']=_0x4c1492['attributes'][_0xcc43('0x34')]?_0x4c1492[_0xcc43('0x32')]:_0x17acce[_0xcc43('0x2e')];if(!_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x35')]('nolimit')){_0x4c1492['limit']=qs['limit'](_0x246ecb['query'][_0xcc43('0x36')]);_0x4c1492[_0xcc43('0x1e')]=qs[_0xcc43('0x1e')](_0x246ecb['query'][_0xcc43('0x1e')]);}_0x4c1492[_0xcc43('0x37')]=qs[_0xcc43('0x38')](_0x246ecb['query'][_0xcc43('0x38')]);_0x4c1492[_0xcc43('0x39')]=qs['filters'](_[_0xcc43('0x3a')](_0x246ecb[_0xcc43('0x2f')],_0x17acce[_0xcc43('0x30')]),_0x28cc44);if(_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x3b')]){_0x4c1492[_0xcc43('0x39')]=_[_0xcc43('0x3c')](_0x4c1492[_0xcc43('0x39')],{'$or':_[_0xcc43('0x2a')](_0x28cc44,function(_0x34ba54){if(_0x34ba54[_0xcc43('0x2d')]!==_0xcc43('0x3d')){var _0x4c9965={};_0x4c9965[_0x34ba54[_0xcc43('0x27')]]={'$like':'%'+_0x246ecb['query'][_0xcc43('0x3b')]+'%'};return _0x4c9965;}})});}_0x4c1492=_[_0xcc43('0x3c')]({},_0x4c1492,_0x246ecb['options']);var _0x225c4b={'where':_0x4c1492['where']};return db[_0xcc43('0x3e')][_0xcc43('0x1d')](_0x225c4b)[_0xcc43('0x23')](function(_0x36646e){_0x3a0779[_0xcc43('0x1d')]=_0x36646e;if(_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x3f')]){_0x4c1492[_0xcc43('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x4c1492);})['then'](function(_0x1a071e){_0x3a0779[_0xcc43('0x41')]=_0x1a071e;return _0x3a0779;})[_0xcc43('0x23')](respondWithFilteredResult(_0x5940da,_0x4c1492))[_0xcc43('0x42')](handleError(_0x5940da,null));};exports['show']=function(_0xfa36a7,_0x143229){var _0x408de6={'raw':!![],'where':{'id':_0xfa36a7['params']['id']}},_0x50e5af={};_0x50e5af[_0xcc43('0x2e')]=_[_0xcc43('0x43')](db[_0xcc43('0x3e')][_0xcc43('0x2b')]);_0x50e5af['query']=_[_0xcc43('0x43')](_0xfa36a7['query']);_0x50e5af['filters']=_[_0xcc43('0x31')](_0x50e5af[_0xcc43('0x2e')],_0x50e5af[_0xcc43('0x2f')]);_0x408de6[_0xcc43('0x32')]=_['intersection'](_0x50e5af['model'],qs[_0xcc43('0x33')](_0xfa36a7[_0xcc43('0x2f')][_0xcc43('0x33')]));_0x408de6[_0xcc43('0x32')]=_0x408de6[_0xcc43('0x32')][_0xcc43('0x34')]?_0x408de6[_0xcc43('0x32')]:_0x50e5af[_0xcc43('0x2e')];if(_0xfa36a7[_0xcc43('0x2f')][_0xcc43('0x3f')]){_0x408de6[_0xcc43('0x40')]=[{'all':!![]}];}_0x408de6=_[_0xcc43('0x3c')]({},_0x408de6,_0xfa36a7[_0xcc43('0x44')]);return db[_0xcc43('0x3e')][_0xcc43('0x45')](_0x408de6)[_0xcc43('0x23')](handleEntityNotFound(_0x143229,null))[_0xcc43('0x23')](respondWithResult(_0x143229,null))[_0xcc43('0x42')](handleError(_0x143229,null));};exports['create']=function(_0x3cc4fd,_0x530576){return db[_0xcc43('0x3e')][_0xcc43('0x46')](_0x3cc4fd[_0xcc43('0x47')],{})[_0xcc43('0x23')](respondWithResult(_0x530576,0xc9))['catch'](handleError(_0x530576,null));};exports[_0xcc43('0x22')]=function(_0x32c2ff,_0x526328){if(_0x32c2ff[_0xcc43('0x47')]['id']){delete _0x32c2ff[_0xcc43('0x47')]['id'];}return db[_0xcc43('0x3e')][_0xcc43('0x45')]({'where':{'id':_0x32c2ff[_0xcc43('0x48')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x526328,null))[_0xcc43('0x23')](saveUpdates(_0x32c2ff[_0xcc43('0x47')],null))[_0xcc43('0x23')](respondWithResult(_0x526328,null))[_0xcc43('0x42')](handleError(_0x526328,null));};exports[_0xcc43('0x24')]=function(_0x489a70,_0x2fba49){return db[_0xcc43('0x3e')]['find']({'where':{'id':_0x489a70[_0xcc43('0x48')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x2fba49,null))[_0xcc43('0x23')](removeEntity(_0x2fba49,null))[_0xcc43('0x42')](handleError(_0x2fba49,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 172a80c..149809f 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 _0x4006=['../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','../../config/logger','api','moment','path'];(function(_0x24b305,_0xa0b8ea){var _0x7dff18=function(_0x144b07){while(--_0x144b07){_0x24b305['push'](_0x24b305['shift']());}};_0x7dff18(++_0xa0b8ea);}(_0x4006,0x1c7));var _0x6400=function(_0x5b19da,_0x5d5d66){_0x5b19da=_0x5b19da-0x0;var _0x2608ed=_0x4006[_0x5b19da];return _0x2608ed;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var logger=require(_0x6400('0x1'))(_0x6400('0x2'));var moment=require(_0x6400('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6400('0x4'));var rimraf=require('rimraf');var config=require(_0x6400('0x5'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x2dbd03,_0x599e6f){return _0x2dbd03[_0x6400('0x6')](_0x6400('0x7'),attributes,{'tableName':_0x6400('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6400('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbe02=['exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x250c3d,_0x4d6a6e){var _0x5de2ec=function(_0x55dc28){while(--_0x55dc28){_0x250c3d['push'](_0x250c3d['shift']());}};_0x5de2ec(++_0x4d6a6e);}(_0xbe02,0x146));var _0x2be0=function(_0x89f81d,_0xd6ed49){_0x89f81d=_0x89f81d-0x0;var _0x59185b=_0xbe02[_0x89f81d];return _0x59185b;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var logger=require(_0x2be0('0x2'))(_0x2be0('0x3'));var moment=require('moment');var BPromise=require(_0x2be0('0x4'));var rp=require(_0x2be0('0x5'));var fs=require('fs');var path=require(_0x2be0('0x6'));var rimraf=require(_0x2be0('0x7'));var config=require(_0x2be0('0x8'));var attributes=require(_0x2be0('0x9'));module[_0x2be0('0xa')]=function(_0x474a35,_0x39a2ca){return _0x474a35['define']('WhatsappApplication',attributes,{'tableName':_0x2be0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2be0('0xc'),'collate':_0x2be0('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 03176eb..7ae4434 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3e2ec8,_0x3111da){var _0x191305=function(_0x825227){while(--_0x825227){_0x3e2ec8['push'](_0x3e2ec8['shift']());}};_0x191305(++_0x3111da);}(_0xac9d,0x14d));var _0xdac9=function(_0x2a1185,_0x2740c5){_0x2a1185=_0x2a1185-0x0;var _0x5588d9=_0xac9d[_0x2a1185];return _0x5588d9;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5636,0x102));var _0x6563=function(_0x4ee2dc,_0x2fc157){_0x4ee2dc=_0x4ee2dc-0x0;var _0x17f04f=_0x5636[_0x4ee2dc];return _0x17f04f;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a3820a5..baef10f 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 _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53f88e,_0xac72b){var _0x5b5dd6=function(_0xc520af){while(--_0xc520af){_0x53f88e['push'](_0x53f88e['shift']());}};_0x5b5dd6(++_0xac72b);}(_0x4317,0x7c));var _0x7431=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4317[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router; \ No newline at end of file +var _0xbeea=['whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','create','post','tracked','whatsapp','whatsappinteraction:addtags','addTags','/:id','whatsappinteraction:update','update','delete'];(function(_0x4621c7,_0x24f171){var _0x2a83d6=function(_0x3a7008){while(--_0x3a7008){_0x4621c7['push'](_0x4621c7['shift']());}};_0x2a83d6(++_0x24f171);}(_0xbeea,0xb1));var _0xabee=function(_0x36acfb,_0x5854d8){_0x36acfb=_0x36acfb-0x0;var _0x9235f0=_0xbeea[_0x36acfb];return _0x9235f0;};'use strict';var multer=require(_0xabee('0x0'));var util=require('util');var path=require(_0xabee('0x1'));var timeout=require(_0xabee('0x2'));var express=require(_0xabee('0x3'));var router=express['Router']();var fs_extra=require(_0xabee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xabee('0x5'));var config=require(_0xabee('0x6'));var controller=require(_0xabee('0x7'));router[_0xabee('0x8')]('/',auth[_0xabee('0x9')](),controller['index']);router['get'](_0xabee('0xa'),auth[_0xabee('0x9')](),controller['describe']);router[_0xabee('0x8')]('/:id',auth[_0xabee('0x9')](),controller[_0xabee('0xb')]);router[_0xabee('0x8')](_0xabee('0xc'),auth[_0xabee('0x9')](),controller[_0xabee('0xd')]);router['get'](_0xabee('0xe'),auth[_0xabee('0x9')](),controller[_0xabee('0xf')]);router['post']('/',auth[_0xabee('0x9')](),controller[_0xabee('0x10')]);router[_0xabee('0x11')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x14')),controller[_0xabee('0x15')]);router['put'](_0xabee('0x16'),auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x17')),controller[_0xabee('0x18')]);router[_0xabee('0x19')]('/:id',auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x1a')),controller[_0xabee('0x1b')]);router[_0xabee('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xabee('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 214ca7e..35a6c5e 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 _0xecb2=['sequelize','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0xd4f616,_0x5ceaf3){var _0x5ba265=function(_0x539511){while(--_0x539511){_0xd4f616['push'](_0xd4f616['shift']());}};_0x5ba265(++_0x5ceaf3);}(_0xecb2,0xf6));var _0x2ecb=function(_0x9118a1,_0x527b4c){_0x9118a1=_0x9118a1-0x0;var _0x5437b5=_0xecb2[_0x9118a1];return _0x5437b5;};'use strict';var Sequelize=require(_0x2ecb('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x2ecb('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2ecb('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2ecb('0x2')]},'note':{'type':Sequelize[_0x2ecb('0x2')]},'phone':{'type':Sequelize[_0x2ecb('0x2')]},'read1stAt':{'type':Sequelize[_0x2ecb('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2ecb('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2ecb('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2ecb('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x326f=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4f477e,_0x4b4c16){var _0x1e41eb=function(_0x386bcb){while(--_0x386bcb){_0x4f477e['push'](_0x4f477e['shift']());}};_0x1e41eb(++_0x4b4c16);}(_0x326f,0xd1));var _0xf326=function(_0x232e43,_0x320506){_0x232e43=_0x232e43-0x0;var _0x483b88=_0x326f[_0x232e43];return _0x483b88;};'use strict';var Sequelize=require(_0xf326('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xf326('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf326('0x2')]},'disposition':{'type':Sequelize[_0xf326('0x3')]},'secondDisposition':{'type':Sequelize[_0xf326('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf326('0x3')]},'note':{'type':Sequelize[_0xf326('0x3')]},'phone':{'type':Sequelize[_0xf326('0x3')]},'read1stAt':{'type':Sequelize[_0xf326('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf326('0x4')]('in',_0xf326('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf326('0x4')]('in',_0xf326('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf326('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index feb2298..476b8e0 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 _0x7880=['Owner','get','Whatsapp','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','total','closed','waiting','UserId','unmanaged','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','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?','buildExpression','keys','some','isEmpty','WhatsappAccountId','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','include','options','create','catch','update','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','push','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','Account'];(function(_0x4cd179,_0x4411eb){var _0x114975=function(_0x4fb98d){while(--_0x4fb98d){_0x4cd179['push'](_0x4cd179['shift']());}};_0x114975(++_0x4411eb);}(_0x7880,0x1f4));var _0x0788=function(_0x24741a,_0x36a3f9){_0x24741a=_0x24741a-0x0;var _0x4d57ac=_0x7880[_0x24741a];return _0x4d57ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);function respondWithStatusCode(_0x43ca01,_0x4ed024){_0x4ed024=_0x4ed024||0xcc;return function(_0x195f14){if(_0x195f14){return _0x43ca01[_0x0788('0x20')](_0x4ed024);}return _0x43ca01[_0x0788('0x21')](_0x4ed024)[_0x0788('0x22')]();};}function respondWithResult(_0x2ddd1a,_0x430e34){_0x430e34=_0x430e34||0xc8;return function(_0x5e1a29){if(_0x5e1a29){return _0x2ddd1a['status'](_0x430e34)[_0x0788('0x23')](_0x5e1a29);}};}function respondWithFilteredResult(_0x461d9d,_0x5b2bdc){return function(_0x654e4b){if(_0x654e4b){var _0x415f19=typeof _0x5b2bdc[_0x0788('0x24')]==='undefined'&&typeof _0x5b2bdc[_0x0788('0x25')]===_0x0788('0x26');var _0x492c2c=_0x654e4b[_0x0788('0x27')];var _0x5173d6=_0x415f19?0x0:_0x5b2bdc[_0x0788('0x24')];var _0x48bc5f=_0x415f19?_0x654e4b[_0x0788('0x27')]:_0x5b2bdc[_0x0788('0x24')]+_0x5b2bdc[_0x0788('0x25')];var _0x3cd197;if(_0x48bc5f>=_0x492c2c){_0x48bc5f=_0x492c2c;_0x3cd197=0xc8;}else{_0x3cd197=0xce;}_0x461d9d[_0x0788('0x21')](_0x3cd197);return _0x461d9d['set']('Content-Range',_0x5173d6+'-'+_0x48bc5f+'/'+_0x492c2c)[_0x0788('0x23')](_0x654e4b);}return null;};}function patchUpdates(_0x2a1460){return function(_0x645320){try{jsonpatch[_0x0788('0x28')](_0x645320,_0x2a1460,!![]);}catch(_0x5ba1da){return BPromise['reject'](_0x5ba1da);}return _0x645320[_0x0788('0x29')]();};}function saveUpdates(_0x18cc33,_0x40309d){return function(_0x50b65c){if(_0x50b65c){return _0x50b65c['update'](_0x18cc33)[_0x0788('0x2a')](function(_0xa1f7dc){return _0xa1f7dc;});}return null;};}function removeEntity(_0x5f2dda,_0x48816a){return function(_0x5a54a5){if(_0x5a54a5){return _0x5a54a5[_0x0788('0x2b')]()['then'](function(){_0x5f2dda[_0x0788('0x21')](0xcc)[_0x0788('0x22')]();});}};}function handleEntityNotFound(_0x467d52,_0x18fc0e){return function(_0xf9ba32){if(!_0xf9ba32){_0x467d52[_0x0788('0x20')](0x194);}return _0xf9ba32;};}function handleError(_0x6bf651,_0x3ffe4f){_0x3ffe4f=_0x3ffe4f||0x1f4;return function(_0x5b7594){logger['error'](_0x5b7594[_0x0788('0x2c')]);if(_0x5b7594[_0x0788('0x2d')]){delete _0x5b7594['name'];}_0x6bf651['status'](_0x3ffe4f)[_0x0788('0x2e')](_0x5b7594);};}function getInteractionUsers(_0x68658a,_0x20fcd8){return new BPromise(function(_0x436031,_0x44cbfb){try{if(_0x20fcd8[_0x68658a['id']]){_0x68658a[_0x0788('0x2f')]=_[_0x0788('0x30')](_0x20fcd8[_0x68658a['id']],function(_0x36e077){return{'id':_0x36e077['id'],'fullname':_0x36e077[_0x0788('0x31')]};});}}catch(_0x85e579){_0x44cbfb(_0x85e579);}_0x436031(_0x68658a);});}function getInteractionTags(_0x5ec0ed,_0x2a08b7){return new BPromise(function(_0x1aab6a,_0x2db509){try{if(_0x5ec0ed[_0x0788('0x32')]){_0x5ec0ed[_0x0788('0x33')]=[];_0x5ec0ed[_0x0788('0x32')][_0x0788('0x34')](',')[_0x0788('0x35')](function(_0x1cb6c0){_0x5ec0ed[_0x0788('0x33')]['push'](_0x2a08b7[_0x1cb6c0]);});}delete _0x5ec0ed['TagIds'];}catch(_0x5947d3){_0x2db509(_0x5947d3);}_0x1aab6a(_0x5ec0ed);});}function updateWhatsappInteraction(_0x5633da,_0x516cce,_0x586a06){return new BPromise(function(_0x208a89,_0x38a4ae){return getInteractionUsers(_0x5633da,_0x586a06)[_0x0788('0x2a')](function(_0x574576){return getInteractionTags(_0x574576,_0x516cce);})[_0x0788('0x2a')](function(_0x3369a1){return getStateInteraction(_0x3369a1);})[_0x0788('0x2a')](function(_0xaea11d){_0x208a89(_0xaea11d);})['catch'](function(_0x2ed940){_0x38a4ae(_0x2ed940);});});}function getStateInteraction(_0x4a4a2b){return new BPromise(function(_0x322465){_0x4a4a2b['waiting']=0x0;_0x4a4a2b[_0x0788('0x36')]=0x0;_0x4a4a2b[_0x0788('0x37')]=0x0;_0x4a4a2b['unmanaged']=0x0;_0x4a4a2b[_0x0788('0x38')]=0x0;if(!_0x4a4a2b[_0x0788('0x39')]&&!_0x4a4a2b['UserId']){_0x4a4a2b[_0x0788('0x3a')]+=0x1;}if(!_0x4a4a2b['closed']&&_0x4a4a2b[_0x0788('0x3b')]){_0x4a4a2b['talking']+=0x1;if(_0x4a4a2b[_0x0788('0x3a')]){_0x4a4a2b['waiting']-=0x1;}}if(_0x4a4a2b[_0x0788('0x39')]&&_0x4a4a2b['UserId']){_0x4a4a2b['answered']+=0x1;if(_0x4a4a2b[_0x0788('0x36')]){_0x4a4a2b[_0x0788('0x36')]-=0x1;}}if(_0x4a4a2b[_0x0788('0x39')]&&!_0x4a4a2b[_0x0788('0x3b')]){_0x4a4a2b[_0x0788('0x3c')]+=0x1;if(_0x4a4a2b['waiting']){_0x4a4a2b['waiting']-=0x1;}}_0x4a4a2b['total']+=0x1;_0x322465(_0x4a4a2b);});}exports['index']=function(_0x501dd5,_0x1202c4){var _0x45b247={},_0x358a22={},_0x362c49={'count':0x0,'rows':[]};var _0x5993ad=_['map'](db[_0x0788('0x3d')][_0x0788('0x3e')],function(_0x330421){return{'name':_0x330421[_0x0788('0x3f')],'type':_0x330421[_0x0788('0x40')][_0x0788('0x41')]};});_0x358a22[_0x0788('0x42')]=_[_0x0788('0x30')](_0x5993ad,_0x0788('0x2d'));_0x358a22['query']=_['keys'](_0x501dd5[_0x0788('0x43')]);_0x358a22[_0x0788('0x44')]=_[_0x0788('0x45')](_0x358a22['model'],_0x358a22['query']);_0x45b247['attributes']=_[_0x0788('0x45')](_0x358a22[_0x0788('0x42')],qs[_0x0788('0x46')](_0x501dd5[_0x0788('0x43')][_0x0788('0x46')]));_0x45b247[_0x0788('0x47')]=_0x45b247[_0x0788('0x47')][_0x0788('0x48')]?_0x45b247['attributes']:_0x358a22[_0x0788('0x42')];if(!_0x501dd5[_0x0788('0x43')][_0x0788('0x49')](_0x0788('0x4a'))){_0x45b247['limit']=qs[_0x0788('0x25')](_0x501dd5[_0x0788('0x43')]['limit']);_0x45b247['offset']=qs['offset'](_0x501dd5[_0x0788('0x43')]['offset']);}_0x45b247[_0x0788('0x4b')]=qs[_0x0788('0x4c')](_0x501dd5[_0x0788('0x43')][_0x0788('0x4c')]);_0x45b247[_0x0788('0x4d')]=qs[_0x0788('0x44')](_[_0x0788('0x4e')](_0x501dd5[_0x0788('0x43')],_0x358a22['filters']),_0x5993ad);var _0x4c6366=[];var _0x39c3cc=squel[_0x0788('0x4f')]()[_0x0788('0x50')]('id')['field'](_0x0788('0x2d'))[_0x0788('0x50')](_0x0788('0x51'))[_0x0788('0x52')](_0x0788('0x53'));var _0x5b0c7c=squel['select']()[_0x0788('0x50')](_0x0788('0x54'))['field'](_0x0788('0x55'))['field'](_0x0788('0x56'))[_0x0788('0x52')](_0x0788('0x57'),'ui')[_0x0788('0x58')](_0x0788('0x59'),'u',_0x0788('0x5a'));var _0x1722d4=squel[_0x0788('0x4f')]()['from'](_0x0788('0x5b'),'i')[_0x0788('0x58')](_0x0788('0x5c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0788('0x58')](_0x0788('0x59'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x58')](_0x0788('0x5d'),'a',_0x0788('0x5e'))[_0x0788('0x58')](_0x0788('0x5f'),'me',_0x0788('0x60'))['left_join']('whatsapp_interaction_has_tags','it',_0x0788('0x61'))[_0x0788('0x58')]('tools_tags','t',_0x0788('0x62'));var _0x1f205c=squel[_0x0788('0x63')]();var _0x2b8f63=[];var _0xf543a8=squel[_0x0788('0x63')]();var _0x112870;if(_0x501dd5[_0x0788('0x43')][_0x0788('0x64')]){_0x112870=as[_0x0788('0x65')](_0x501dd5[_0x0788('0x43')][_0x0788('0x64')]);var _0x55481c=_0x112870[_0x0788('0x66')];for(var _0x223036=0x0;_0x223036<_0x112870[_0x0788('0x67')]['length'];_0x223036++){var _0x9a13b=_0x112870[_0x0788('0x67')][_0x223036];var _0x531ccf='i';var _0x48ef37=_[_0x0788('0x68')](_0x5993ad,[_0x0788('0x2d'),_0x9a13b[_0x0788('0x50')]]);if(!_0x48ef37){switch(_0x9a13b[_0x0788('0x50')]){case _0x0788('0x69'):if(_0x9a13b[_0x0788('0x6a')]==0x1){_0x1722d4['having']('`'+_0x9a13b[_0x0788('0x50')]+_0x0788('0x6b'));}else{_0x1722d4[_0x0788('0x6c')]('`'+_0x9a13b['field']+'`\x20>\x200');}break;case _0x0788('0x6d'):if(_0x9a13b['operator']===_0x0788('0x6e')){if(_0x9a13b[_0x0788('0x6a')][_0x0788('0x34')]('\x20')[_0x0788('0x48')]>0x1){_0x1f205c[_0x55481c](_0x0788('0x6f'),qs[_0x0788('0x70')](_0x9a13b[_0x0788('0x6a')]),null);}else{var _0x29c912='%'+_0x9a13b[_0x0788('0x6a')]+'%';_0x1f205c[_0x55481c](_0x0788('0x71'),_0x29c912,_0x29c912,_0x29c912);}}else{_0x48ef37=_['find'](_0x5993ad,[_0x0788('0x2d'),_0x0788('0x72')]);_0x9a13b[_0x0788('0x50')]=_0x0788('0x72');_0x56c4bc=as['buildExpression'](_0x531ccf,_0x48ef37[_0x0788('0x40')],_0x9a13b);_0x1f205c[_0x55481c](_0x56c4bc[_0x0788('0x73')],_0x56c4bc[_0x0788('0x6a')][_0x0788('0x74')],_0x56c4bc[_0x0788('0x6a')]['end']);}break;case _0x0788('0x75'):var _0x4aa3af=_0x9a13b[_0x0788('0x6a')][_0x0788('0x34')](',')[_0x0788('0x30')](function(_0x47f22c){return Number(_0x47f22c);});_0x4aa3af[_0x0788('0x35')](function(_0x348cbf){_0xf543a8['or'](_0x0788('0x76'),'%,'+_0x348cbf+',%');});_0x2b8f63=_[_0x0788('0x77')](_0x2b8f63,_0x4aa3af);break;case _0x0788('0x78'):if(_0x9a13b['operator']===_0x0788('0x6e')){_0x1f205c[_0x55481c](_0x0788('0x79'),'%'+_0x9a13b[_0x0788('0x6a')]+'%',null);}else{_0x48ef37=_['find'](_0x5993ad,['name',_0x0788('0x3b')]);_0x9a13b[_0x0788('0x50')]=_0x0788('0x3b');_0x56c4bc=as['buildExpression'](_0x531ccf,_0x48ef37[_0x0788('0x40')],_0x9a13b);_0x1f205c[_0x55481c](_0x56c4bc[_0x0788('0x73')],_0x56c4bc[_0x0788('0x6a')][_0x0788('0x74')],_0x56c4bc['value']['end']);}break;case'body':_0x56c4bc=as[_0x0788('0x7a')]('me',null,_0x9a13b);_0x1f205c[_0x55481c](_0x56c4bc[_0x0788('0x73')],_0x56c4bc[_0x0788('0x6a')]['start'],_0x56c4bc['value'][_0x0788('0x22')]);break;}}else{var _0x56c4bc=as[_0x0788('0x7a')](_0x531ccf,_0x48ef37[_0x0788('0x40')],_0x9a13b);_0x1f205c[_0x55481c](_0x56c4bc[_0x0788('0x73')],_0x56c4bc[_0x0788('0x6a')][_0x0788('0x74')],_0x56c4bc[_0x0788('0x6a')][_0x0788('0x22')]);}}}else{var _0x47543a=_(_0x501dd5[_0x0788('0x43')])[_0x0788('0x7b')]()['map'](function(_0x240210){return _[_0x0788('0x7c')](_0x5993ad,['name',_0x240210])?_0x240210:undefined;})['compact']()[_0x0788('0x6a')]();if(!_[_0x0788('0x7d')](_0x47543a)){_0x47543a[_0x0788('0x35')](function(_0x219252){if(_0x219252===_0x0788('0x7e')){_0x1722d4[_0x0788('0x4d')]('i.WhatsappAccountId\x20IN\x20?',[][_0x0788('0x7f')](_0x501dd5[_0x0788('0x43')][_0x219252]));}else if(_0x219252===_0x0788('0x80')){var _0x389e6f=JSON['parse'](_0x501dd5[_0x0788('0x43')][_0x219252])[_0x0788('0x81')];var _0x3f3616=JSON[_0x0788('0x82')](_0x501dd5['query'][_0x219252])['$lte'];_0x1722d4[_0x0788('0x4d')](_0x0788('0x83'),_0x389e6f,_0x3f3616);}else{if(_0x501dd5[_0x0788('0x43')][_0x219252]===_0x0788('0x84')){_0x1722d4[_0x0788('0x4d')]('i.'+_0x219252+_0x0788('0x85'));}else{_0x1722d4[_0x0788('0x4d')]('i.'+_0x219252+_0x0788('0x86'),_0x501dd5[_0x0788('0x43')][_0x219252]);}}});}if(_0x501dd5['query'][_0x0788('0x87')]){if(_0x501dd5[_0x0788('0x43')][_0x0788('0x87')]==0x1){_0x1722d4['having']('`unreadMessages`\x20=\x200');}else{_0x1722d4[_0x0788('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x501dd5[_0x0788('0x43')][_0x0788('0x88')]){_0x2b8f63=_[_0x0788('0x89')](_0x501dd5[_0x0788('0x43')][_0x0788('0x88')])?_0x501dd5[_0x0788('0x43')][_0x0788('0x88')]:new Array(_0x501dd5[_0x0788('0x43')][_0x0788('0x88')]);_0x2b8f63['forEach'](function(_0xc0057f){_0xf543a8['or'](_0x0788('0x76'),'%,'+_0xc0057f+',%');});}if(_0x501dd5[_0x0788('0x43')]['filter']){var _0x37efae=_0x501dd5[_0x0788('0x43')][_0x0788('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x0788('0x8b')](/'/g,'\x27\x27');if(qs[_0x0788('0x8c')](_0x37efae)){_0x1f205c['or'](_0x0788('0x8d'),_0x37efae+'%')['or'](_0x0788('0x8e'),_0x37efae+'%');}else{_0x1f205c['or'](_0x0788('0x8f'),qs[_0x0788('0x70')](_0x37efae))['or'](_0x0788('0x90'),_0x37efae+'%');}}}_0x1722d4[_0x0788('0x4d')](_0x1f205c);_0x1722d4[_0x0788('0x91')]('i.id');var _0x471b3a={'type':db[_0x0788('0x92')][_0x0788('0x93')][_0x0788('0x94')],'raw':!![]};var _0x251072=_0x1722d4['clone']();_0x251072[_0x0788('0x50')](_0x0788('0x95'));_0x251072[_0x0788('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0788('0x69'));if(_0x45b247[_0x0788('0x4b')]){_0x45b247[_0x0788('0x4b')][_0x0788('0x35')](function(_0x2b74df){var _0x48afda=_0x2b74df[0x0]===_0x0788('0x96')?_0x2b74df[0x0]:'i.'+_0x2b74df[0x0];_0x1722d4[_0x0788('0x4b')](_0x48afda,_0x2b74df[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0788('0x7d')](_0x2b8f63)){_0x1722d4[_0x0788('0x6c')](_0xf543a8);_0x251072['where'](_0x0788('0x97'),_0x2b8f63);}BPromise[_0x0788('0x98')]()[_0x0788('0x2a')](function(){if(!_0x112870){if(_0x501dd5['query'][_0x0788('0x7e')])return;_0x251072[_0x0788('0x4d')](_0x0788('0x99'));_0x1722d4['where'](_0x0788('0x99'));return;}if(_0x501dd5[_0x0788('0x9a')][_0x0788('0x9b')]!==_0x0788('0x9c'))return;return _0x501dd5[_0x0788('0x9a')][_0x0788('0x9d')]({'attributes':['id'],'raw':!![]})[_0x0788('0x2a')](function(_0x174931){if(_['isEmpty'](_0x174931)){_0x251072[_0x0788('0x4d')](_0x0788('0x9e'));_0x1722d4[_0x0788('0x4d')](_0x0788('0x9e'));}else{_0x251072['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x0788('0x30')](_0x174931,'id'));_0x1722d4[_0x0788('0x4d')]('i.WhatsappAccountId\x20IN\x20?',_[_0x0788('0x30')](_0x174931,'id'));}});})[_0x0788('0x2a')](function(){if(_0x501dd5[_0x0788('0x9a')]['role']==='agent'&&!_0x112870&&!_0x501dd5[_0x0788('0x43')][_0x0788('0x7e')])return[];return db['sequelize']['query'](_0x251072['toString'](),_0x471b3a);})[_0x0788('0x2a')](function(_0x3536f7){_0x362c49['count']=_0x3536f7[_0x0788('0x48')];if(_0x362c49[_0x0788('0x27')]===0x0)return[];return db[_0x0788('0x9f')][_0x0788('0x43')](_0x39c3cc[_0x0788('0xa0')](),_0x471b3a)['then'](function(_0x4152c7){_0x4c6366=_['keyBy'](_0x4152c7,'id');_0x471b3a=_[_0x0788('0xa1')](_0x471b3a,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x501dd5[_0x0788('0x43')][_0x0788('0x46')]){_0x45b247[_0x0788('0x47')][_0x0788('0x35')](function(_0x13f796){_0x1722d4[_0x0788('0x50')]('i.'+_0x13f796);});}else{_0x1722d4[_0x0788('0x50')](_0x0788('0xa2'),_0x0788('0x69'));_0x1722d4[_0x0788('0x50')](_0x0788('0xa3'),_0x0788('0xa4'));_0x1722d4[_0x0788('0x50')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x1722d4['field'](_0x0788('0xa5'),_0x0788('0x96'));_0x1722d4[_0x0788('0x50')](_0x0788('0xa6'));_0x1722d4[_0x0788('0x50')](_0x0788('0xa7'),_0x0788('0xa8'));_0x1722d4[_0x0788('0x50')](_0x0788('0xa9'),_0x0788('0xaa'));_0x1722d4[_0x0788('0x50')]('c.email','Contact.email');_0x1722d4[_0x0788('0x50')](_0x0788('0xab'),_0x0788('0xac'));_0x1722d4[_0x0788('0x50')](_0x0788('0xad'),_0x0788('0xae'));_0x1722d4[_0x0788('0x50')](_0x0788('0xaf'),'Contact.fax');_0x1722d4['field'](_0x0788('0xb0'),_0x0788('0xb1'));_0x1722d4[_0x0788('0x50')](_0x0788('0xb2'),_0x0788('0xb3'));_0x1722d4[_0x0788('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0788('0x32'));}if(_0x45b247[_0x0788('0x25')])_0x1722d4[_0x0788('0x25')](_0x45b247[_0x0788('0x25')]);if(_0x45b247[_0x0788('0x24')])_0x1722d4[_0x0788('0x24')](_0x45b247[_0x0788('0x24')]);return db[_0x0788('0x9f')][_0x0788('0x43')](_0x1722d4['toString'](),_0x471b3a);})[_0x0788('0x2a')](function(_0x42d1f6){if(_0x42d1f6[_0x0788('0x48')]>0x0)_0x5b0c7c[_0x0788('0x4d')](_0x0788('0xb4'),_[_0x0788('0x30')](_0x42d1f6,'id'));return db['sequelize'][_0x0788('0x43')](_0x5b0c7c[_0x0788('0xa0')](),_0x471b3a)[_0x0788('0x2a')](function(_0x1ef574){var _0x1f29c9=_[_0x0788('0xb5')](_0x1ef574,_0x0788('0xb6'));var _0x3d3779=[];_0x42d1f6[_0x0788('0x35')](function(_0x9e76de){_0x3d3779['push'](updateWhatsappInteraction(_0x9e76de,_0x4c6366,_0x1f29c9));});return BPromise[_0x0788('0xb7')](_0x3d3779);});});})['then'](function(_0x275ad2){_0x362c49['rows']=_0x275ad2;return _0x362c49;})[_0x0788('0x2a')](respondWithFilteredResult(_0x1202c4,_0x45b247))['catch'](handleError(_0x1202c4,null));};exports[_0x0788('0xb8')]=function(_0x957920,_0x1f1f92){var _0xdfcfaf={'raw':![],'where':{'id':_0x957920[_0x0788('0xb9')]['id']}},_0x5242eb={};_0x5242eb[_0x0788('0x42')]=_[_0x0788('0x7b')](db['WhatsappInteraction'][_0x0788('0x3e')]);_0x5242eb[_0x0788('0x43')]=_['keys'](_0x957920[_0x0788('0x43')]);_0x5242eb[_0x0788('0x44')]=_[_0x0788('0x45')](_0x5242eb[_0x0788('0x42')],_0x5242eb[_0x0788('0x43')]);_0xdfcfaf[_0x0788('0x47')]=_[_0x0788('0x45')](_0x5242eb['model'],qs[_0x0788('0x46')](_0x957920[_0x0788('0x43')][_0x0788('0x46')]));_0xdfcfaf[_0x0788('0x47')]=_0xdfcfaf[_0x0788('0x47')][_0x0788('0x48')]?_0xdfcfaf[_0x0788('0x47')]:_0x5242eb[_0x0788('0x42')];if(_0x957920['query']['includeAll']){_0xdfcfaf[_0x0788('0xba')]=[{'all':!![]}];}_0xdfcfaf=_[_0x0788('0xa1')]({},_0xdfcfaf,_0x957920[_0x0788('0xbb')]);return db[_0x0788('0x3d')][_0x0788('0x68')](_0xdfcfaf)[_0x0788('0x2a')](handleEntityNotFound(_0x1f1f92,null))[_0x0788('0x2a')](respondWithResult(_0x1f1f92,null))['catch'](handleError(_0x1f1f92,null));};exports[_0x0788('0xbc')]=function(_0x4b40cd,_0x4eae11){return db[_0x0788('0x3d')][_0x0788('0xbc')](_0x4b40cd['body'],{})[_0x0788('0x2a')](respondWithResult(_0x4eae11,0xc9))[_0x0788('0xbd')](handleError(_0x4eae11,null));};exports[_0x0788('0xbe')]=function(_0x16a035,_0x3b7f9c){if(_0x16a035[_0x0788('0xbf')]['id']){delete _0x16a035['body']['id'];}return db[_0x0788('0x3d')][_0x0788('0x68')]({'where':{'id':_0x16a035['params']['id']}})[_0x0788('0x2a')](handleEntityNotFound(_0x3b7f9c,null))[_0x0788('0x2a')](saveUpdates(_0x16a035['body'],null))[_0x0788('0x2a')](respondWithResult(_0x3b7f9c,null))[_0x0788('0xbd')](handleError(_0x3b7f9c,null));};exports[_0x0788('0x2b')]=function(_0xf53811,_0x105aab){return db[_0x0788('0x3d')][_0x0788('0x68')]({'where':{'id':_0xf53811['params']['id']}})[_0x0788('0x2a')](handleEntityNotFound(_0x105aab,null))[_0x0788('0x2a')](removeEntity(_0x105aab,null))[_0x0788('0xbd')](handleError(_0x105aab,null));};exports[_0x0788('0xc0')]=function(_0x4c0f3d,_0x46e679){return db[_0x0788('0x3d')]['describe']()['then'](respondWithResult(_0x46e679,null))[_0x0788('0xbd')](handleError(_0x46e679,null));};exports[_0x0788('0xc1')]=function(_0x7620af,_0x3e9acc,_0xcb96a3){return db[_0x0788('0xc2')]['find']({'where':{'id':_0x7620af[_0x0788('0xb9')]['id']}})[_0x0788('0x2a')](handleEntityNotFound(_0x3e9acc,null))[_0x0788('0x2a')](function(_0x205edb){if(_0x205edb){return _0x205edb[_0x0788('0xc1')](_0x7620af[_0x0788('0xbf')][_0x0788('0xc3')],_[_0x0788('0xc4')](_0x7620af[_0x0788('0xbf')],[_0x0788('0xc3'),'id'])||{});}})[_0x0788('0x2a')](respondWithResult(_0x3e9acc,null))[_0x0788('0xbd')](handleError(_0x3e9acc,null));};exports[_0x0788('0xc5')]=function(_0x2b5cd9,_0x17da6a,_0x150a05){var _0x1e0fb7={'raw':![],'where':{}};var _0x4bb16c={};var _0x4086c1={'count':0x0,'rows':[]};return db[_0x0788('0x3d')][_0x0788('0xc6')]({'where':{'id':_0x2b5cd9[_0x0788('0xb9')]['id']}})['then'](handleEntityNotFound(_0x17da6a,null))[_0x0788('0x2a')](function(_0x5d0919){if(_0x5d0919){_0x4bb16c[_0x0788('0x42')]=_['keys'](db['WhatsappMessage'][_0x0788('0x3e')]);_0x4bb16c[_0x0788('0x43')]=_['keys'](_0x2b5cd9[_0x0788('0x43')]);_0x4bb16c['filters']=_[_0x0788('0x45')](_0x4bb16c['model'],_0x4bb16c[_0x0788('0x43')]);_0x1e0fb7[_0x0788('0x47')]=_[_0x0788('0x45')](_0x4bb16c[_0x0788('0x42')],qs[_0x0788('0x46')](_0x2b5cd9[_0x0788('0x43')]['fields']));_0x1e0fb7[_0x0788('0x47')]=_0x1e0fb7['attributes'][_0x0788('0x48')]?_0x1e0fb7[_0x0788('0x47')]:_0x4bb16c['model'];if(!_0x2b5cd9['query']['hasOwnProperty'](_0x0788('0x4a'))){_0x1e0fb7['limit']=qs['limit'](_0x2b5cd9['query']['limit']);_0x1e0fb7['offset']=qs['offset'](_0x2b5cd9[_0x0788('0x43')][_0x0788('0x24')]);}_0x1e0fb7['order']=qs[_0x0788('0x4c')](_0x2b5cd9['query'][_0x0788('0x4c')]);_0x1e0fb7['where']=qs[_0x0788('0x44')](_[_0x0788('0x4e')](_0x2b5cd9[_0x0788('0x43')],_0x4bb16c[_0x0788('0x44')]));_0x1e0fb7[_0x0788('0x4d')][_0x0788('0xb6')]=_0x5d0919['id'];if(_0x2b5cd9[_0x0788('0x43')][_0x0788('0x8a')]){_0x1e0fb7[_0x0788('0x4d')]=_[_0x0788('0xa1')](_0x1e0fb7['where'],{'$or':_[_0x0788('0x30')](_0x1e0fb7['attributes'],function(_0x3bd7f3){var _0x5430e5={};_0x5430e5[_0x3bd7f3]={'$like':'%'+_0x2b5cd9['query'][_0x0788('0x8a')]+'%'};return _0x5430e5;})});}if(_0x2b5cd9[_0x0788('0x43')][_0x0788('0x81')]){var _0x4ea339=_0x2b5cd9[_0x0788('0x43')][_0x0788('0x81')]['split'](',');var _0x5eb313={};_0x5eb313[_0x4ea339[0x0]]={'$gte':moment(_0x4ea339[0x1])[_0x0788('0xc7')](_0x0788('0xc8'))};_0x1e0fb7[_0x0788('0x4d')]=_['merge'](_0x1e0fb7['where'],_0x5eb313);}_0x1e0fb7=_[_0x0788('0xa1')]({},_0x1e0fb7,_0x2b5cd9[_0x0788('0xbb')]);return db[_0x0788('0xc2')][_0x0788('0x27')]({'where':_0x1e0fb7[_0x0788('0x4d')]})[_0x0788('0x2a')](function(_0x39d590){_0x4086c1[_0x0788('0x27')]=_0x39d590;if(_0x2b5cd9[_0x0788('0x43')]['includeAll']){_0x1e0fb7[_0x0788('0xba')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x0788('0xc9')](_0x1e0fb7);})[_0x0788('0x2a')](function(_0x39ce5f){_0x4086c1[_0x0788('0xca')]=_0x39ce5f;return _0x4086c1;});}})[_0x0788('0x2a')](respondWithFilteredResult(_0x17da6a,_0x1e0fb7))['catch'](handleError(_0x17da6a,null));};exports[_0x0788('0xcb')]=function(_0x8a3171,_0x5ad30b,_0x10d641){return db[_0x0788('0x3d')]['find']({'where':{'id':_0x8a3171[_0x0788('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5ad30b,null))[_0x0788('0x2a')](function(_0xc257be){if(_0xc257be){return _0xc257be['setTags'](_0x8a3171[_0x0788('0xbf')][_0x0788('0xc3')],_[_0x0788('0xc4')](_0x8a3171[_0x0788('0xbf')],[_0x0788('0xc3'),'id'])||{})[_0x0788('0xcc')](function(){return db[_0x0788('0x75')][_0x0788('0xc9')]({'attributes':['id','name',_0x0788('0x51')],'where':{'id':_0x8a3171[_0x0788('0xbf')][_0x0788('0xc3')]}});})['then'](function(_0x5ac0bc){socket[_0x0788('0xcd')](_0x0788('0xce'),{'id':Number(_0x8a3171[_0x0788('0xb9')]['id']),'tags':_0x5ac0bc||[]});return{'id':Number(_0x8a3171[_0x0788('0xb9')]['id']),'tags':_0x5ac0bc||[]};});}})[_0x0788('0x2a')](respondWithResult(_0x5ad30b,null))[_0x0788('0xbd')](handleError(_0x5ad30b,null));};exports['removeTags']=function(_0x8cd474,_0x227eaf,_0x1d8579){return db[_0x0788('0x3d')][_0x0788('0x68')]({'where':{'id':_0x8cd474[_0x0788('0xb9')]['id']}})[_0x0788('0x2a')](handleEntityNotFound(_0x227eaf,null))[_0x0788('0x2a')](function(_0x1fc335){if(_0x1fc335){return _0x1fc335[_0x0788('0xcf')](_0x8cd474[_0x0788('0x43')][_0x0788('0xc3')]);}})[_0x0788('0x2a')](respondWithStatusCode(_0x227eaf,null))[_0x0788('0xbd')](handleError(_0x227eaf,null));};exports[_0x0788('0xd0')]=function(_0x21cd8b,_0x3ffb9a){var _0x1989c4=moment()[_0x0788('0xd1')]()[_0x0788('0xa0')]();var _0x2ff130=path['join'](config[_0x0788('0xd2')],_0x0788('0xd3'),_0x0788('0xd4'),_0x0788('0xd5'));var _0x47f5bc=path[_0x0788('0xd6')](config[_0x0788('0xd2')],'server',_0x0788('0xd4'),'attachments');var _0x5c2b2b=path['join'](_0x2ff130,_0x1989c4);var _0x546d10=util[_0x0788('0xc7')](_0x0788('0xd7'),_0x21cd8b[_0x0788('0xb9')]['id'],_0x1989c4);var _0x4378d1=path[_0x0788('0xd6')](_0x2ff130,_0x546d10);var _0x43fd23=[];_0x43fd23[_0x0788('0xd8')]({'model':db[_0x0788('0x78')],'as':_0x0788('0x78'),'attributes':['id',_0x0788('0x31')],'raw':!![]});_0x43fd23[_0x0788('0xd8')]({'model':db[_0x0788('0xd9')],'as':'Contact','attributes':['id',_0x0788('0xda'),_0x0788('0xdb')],'raw':!![]});if(_0x21cd8b['query'][_0x0788('0xdc')]){_0x43fd23[_0x0788('0xd8')]({'model':db[_0x0788('0xdd')],'as':_0x0788('0xdd'),'raw':!![]});}var _0x22b4cb=[{'model':db[_0x0788('0xc2')],'as':_0x0788('0xde'),'attributes':['id',_0x0788('0xbf'),_0x0788('0x80'),_0x0788('0xdf'),_0x0788('0xe0'),_0x0788('0x87')],'include':_0x43fd23}];_0x22b4cb[_0x0788('0xd8')]({'model':db['WhatsappAccount'],'as':_0x0788('0xe1'),'attributes':['id',_0x0788('0x2d')]});_0x22b4cb['push']({'model':db['User'],'as':_0x0788('0xe2'),'attributes':['id',_0x0788('0x31')]});return db['WhatsappInteraction'][_0x0788('0x68')]({'where':{'id':_0x21cd8b[_0x0788('0xb9')]['id']},'include':_0x22b4cb})[_0x0788('0x2a')](handleEntityNotFound(_0x3ffb9a,null))['then'](function(_0x5e02d8){if(_0x5e02d8){var _0x3296a3=_0x5e02d8[_0x0788('0xe3')]({'plain':!![]});fs['mkdirSync'](_0x5c2b2b);var _0x5ad0b7={'channel':_0x0788('0xe4'),'account':_0x3296a3[_0x0788('0xe1')]['name'],'agent':_0x3296a3['Owner']?_0x3296a3[_0x0788('0xe2')][_0x0788('0x31')]:'N.A.','createdAt':moment(_0x3296a3[_0x0788('0x80')])[_0x0788('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0788('0xa0')](),'closedAt':_0x3296a3[_0x0788('0x39')]?moment(_0x3296a3[_0x0788('0xe5')])[_0x0788('0xc7')](_0x0788('0xc8'))['toString']():'','disposition':_0x3296a3[_0x0788('0xe6')],'messages':_(_0x3296a3[_0x0788('0xde')])[_0x0788('0x8a')]({'secret':![]})[_0x0788('0x30')](function(_0x11e5d8){if(_0x11e5d8['Attachment']){var _0x31ffc7=path['join'](_0x47f5bc,_0x11e5d8['Attachment'][_0x0788('0xe7')]);if(fs[_0x0788('0xe8')](_0x31ffc7)){fs[_0x0788('0xe9')](_0x31ffc7)[_0x0788('0xea')](fs['createWriteStream'](path[_0x0788('0xd6')](_0x5c2b2b,_0x11e5d8[_0x0788('0xdd')][_0x0788('0xe7')])));}}return{'date':moment(_0x11e5d8['createdAt'])[_0x0788('0xc7')](_0x0788('0xc8'))[_0x0788('0xa0')](),'sender':_0x11e5d8[_0x0788('0xdf')]===_0x0788('0xeb')?_0x11e5d8['User']?_0x11e5d8[_0x0788('0x78')]['fullname']:_0x0788('0xec'):_0x11e5d8[_0x0788('0x6d')][_0x0788('0xda')]+(_0x11e5d8[_0x0788('0x6d')][_0x0788('0xdb')]?'\x20'+_0x11e5d8['Contact'][_0x0788('0xdb')]:''),'body':_0x11e5d8['Attachment']?_0x11e5d8[_0x0788('0xdd')]['basename']:_0x11e5d8[_0x0788('0xbf')],'direction':_0x11e5d8[_0x0788('0xdf')]==='out'?'A':'C','secret':_0x11e5d8[_0x0788('0xe0')],'read':_0x11e5d8[_0x0788('0x87')],'attachment':_0x11e5d8[_0x0788('0xdd')]};})[_0x0788('0x6a')]()};return ejs[_0x0788('0xed')](path[_0x0788('0xd6')](config[_0x0788('0xd2')],_0x0788('0xd3'),_0x0788('0xee'),_0x0788('0xef')),{'interaction':_0x5ad0b7})[_0x0788('0x2a')](function(_0x5dfccd){var _0x303d5=path['join'](_0x5c2b2b,_0x0788('0xf0')+_0x3296a3['id']+'-'+_0x1989c4+'.pdf');var _0x27043f={'path':_0x303d5,'channel':_0x0788('0xe4'),'interactionId':_0x3296a3['id']};return pdf['createPdfFromHTML'](_0x5dfccd,_0x27043f);})['then'](function(){return new BPromise(function(_0x57dd82,_0x26f282){zipdir(_0x5c2b2b,{'saveTo':_0x4378d1},function(_0x4a1301,_0x50a0ed){if(_0x4a1301)return _0x26f282(_0x4a1301);return _0x57dd82(_0x50a0ed);});})[_0x0788('0x2a')](function(){return new BPromise(function(_0x2d81ff,_0x1bf1d9){rimraf(_0x5c2b2b,function(_0x5c5464){if(_0x5c5464)_0x1bf1d9(_0x5c5464);return _0x2d81ff();});});})[_0x0788('0x2a')](function(){return _0x3ffb9a[_0x0788('0xd0')](_0x4378d1,_0x546d10,function(_0x14420b){if(_0x14420b){console['log']('err',_0x14420b);}else{fs[_0x0788('0xf1')](_0x4378d1);}});});});}else{return _0x3ffb9a[_0x0788('0x20')](0xc8);}})[_0x0788('0xbd')](handleError(_0x3ffb9a,null));}; \ No newline at end of file +var _0xcae2=['Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','rawAttributes','includeAll','options','create','describe','addMessage','WhatsappMessage','omit','ids','nolimit','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','disposition','existsSync','createReadStream','pipe','out','System','firstName','views','downloadInteraction.ejs','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','map','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','limit','order','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','compact','isEmpty','forEach','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','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','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','WhatsappInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email'];(function(_0x2a302f,_0x53820c){var _0x2f09b9=function(_0x15e5b8){while(--_0x15e5b8){_0x2a302f['push'](_0x2a302f['shift']());}};_0x2f09b9(++_0x53820c);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2cae('0x0'));var rimraf=require(_0x2cae('0x1'));var zipdir=require(_0x2cae('0x2'));var jsonpatch=require(_0x2cae('0x3'));var rp=require(_0x2cae('0x4'));var moment=require(_0x2cae('0x5'));var BPromise=require(_0x2cae('0x6'));var Mustache=require('mustache');var util=require(_0x2cae('0x7'));var path=require(_0x2cae('0x8'));var sox=require(_0x2cae('0x9'));var csv=require(_0x2cae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cae('0xb'));var _=require(_0x2cae('0xc'));var squel=require(_0x2cae('0xd'));var crypto=require(_0x2cae('0xe'));var jsforce=require(_0x2cae('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2cae('0x10'));var authService=require(_0x2cae('0x11'));var qs=require(_0x2cae('0x12'));var as=require(_0x2cae('0x13'));var pdf=require(_0x2cae('0x14'));var hardwareService=require(_0x2cae('0x15'));var logger=require('../../config/logger')(_0x2cae('0x16'));var utils=require('../../config/utils');var config=require(_0x2cae('0x17'));var licenseUtil=require(_0x2cae('0x18'));var db=require(_0x2cae('0x19'))['db'];config[_0x2cae('0x1a')]=_[_0x2cae('0x1b')](config[_0x2cae('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cae('0x1c'))(new Redis(config['redis']));require(_0x2cae('0x1d'))[_0x2cae('0x1e')](socket);function respondWithStatusCode(_0x51d416,_0x819da9){_0x819da9=_0x819da9||0xcc;return function(_0x2295c0){if(_0x2295c0){return _0x51d416[_0x2cae('0x1f')](_0x819da9);}return _0x51d416[_0x2cae('0x20')](_0x819da9)['end']();};}function respondWithResult(_0x3fda2f,_0x272401){_0x272401=_0x272401||0xc8;return function(_0x4a89e1){if(_0x4a89e1){return _0x3fda2f[_0x2cae('0x20')](_0x272401)[_0x2cae('0x21')](_0x4a89e1);}};}function respondWithFilteredResult(_0x1788a3,_0xe6314f){return function(_0x2813b1){if(_0x2813b1){var _0x164aee=typeof _0xe6314f[_0x2cae('0x22')]===_0x2cae('0x23')&&typeof _0xe6314f['limit']==='undefined';var _0x276ed4=_0x2813b1[_0x2cae('0x24')];var _0x6f7bda=_0x164aee?0x0:_0xe6314f[_0x2cae('0x22')];var _0x2f4f5c=_0x164aee?_0x2813b1[_0x2cae('0x24')]:_0xe6314f[_0x2cae('0x22')]+_0xe6314f['limit'];var _0x4bc93c;if(_0x2f4f5c>=_0x276ed4){_0x2f4f5c=_0x276ed4;_0x4bc93c=0xc8;}else{_0x4bc93c=0xce;}_0x1788a3[_0x2cae('0x20')](_0x4bc93c);return _0x1788a3[_0x2cae('0x25')]('Content-Range',_0x6f7bda+'-'+_0x2f4f5c+'/'+_0x276ed4)['json'](_0x2813b1);}return null;};}function patchUpdates(_0x48f0f5){return function(_0x1fbc3f){try{jsonpatch[_0x2cae('0x26')](_0x1fbc3f,_0x48f0f5,!![]);}catch(_0x4ced40){return BPromise['reject'](_0x4ced40);}return _0x1fbc3f[_0x2cae('0x27')]();};}function saveUpdates(_0x1c8063,_0x407324){return function(_0x2fdc92){if(_0x2fdc92){return _0x2fdc92[_0x2cae('0x28')](_0x1c8063)[_0x2cae('0x29')](function(_0x11413f){return _0x11413f;});}return null;};}function removeEntity(_0x307096,_0x214dba){return function(_0x1a35f9){if(_0x1a35f9){return _0x1a35f9[_0x2cae('0x2a')]()[_0x2cae('0x29')](function(){_0x307096[_0x2cae('0x20')](0xcc)[_0x2cae('0x2b')]();});}};}function handleEntityNotFound(_0x3422bb,_0x2d8e66){return function(_0x564892){if(!_0x564892){_0x3422bb['sendStatus'](0x194);}return _0x564892;};}function handleError(_0x56bedb,_0x5afca5){_0x5afca5=_0x5afca5||0x1f4;return function(_0x7d5421){logger[_0x2cae('0x2c')](_0x7d5421[_0x2cae('0x2d')]);if(_0x7d5421[_0x2cae('0x2e')]){delete _0x7d5421['name'];}_0x56bedb[_0x2cae('0x20')](_0x5afca5)[_0x2cae('0x2f')](_0x7d5421);};}function getInteractionUsers(_0xd53da6,_0x5d1fc8){return new BPromise(function(_0x2db662,_0x5cdbac){try{if(_0x5d1fc8[_0xd53da6['id']]){_0xd53da6[_0x2cae('0x30')]=_['map'](_0x5d1fc8[_0xd53da6['id']],function(_0x47a256){return{'id':_0x47a256['id'],'fullname':_0x47a256[_0x2cae('0x31')]};});}}catch(_0x768aaf){_0x5cdbac(_0x768aaf);}_0x2db662(_0xd53da6);});}function getInteractionTags(_0x4b2cdc,_0x335345){return new BPromise(function(_0x42dda4,_0x2d7f38){try{if(_0x4b2cdc[_0x2cae('0x32')]){_0x4b2cdc[_0x2cae('0x33')]=[];_0x4b2cdc[_0x2cae('0x32')]['split'](',')['forEach'](function(_0x1f68e1){_0x4b2cdc[_0x2cae('0x33')]['push'](_0x335345[_0x1f68e1]);});}delete _0x4b2cdc['TagIds'];}catch(_0x5d9e4b){_0x2d7f38(_0x5d9e4b);}_0x42dda4(_0x4b2cdc);});}function updateWhatsappInteraction(_0x374675,_0x2cd412,_0x56ec52){return new BPromise(function(_0x4c09ce,_0x5afd72){return getInteractionUsers(_0x374675,_0x56ec52)[_0x2cae('0x29')](function(_0x222828){return getInteractionTags(_0x222828,_0x2cd412);})[_0x2cae('0x29')](function(_0x34d3c1){return getStateInteraction(_0x34d3c1);})[_0x2cae('0x29')](function(_0x521bf5){_0x4c09ce(_0x521bf5);})[_0x2cae('0x34')](function(_0xe21a66){_0x5afd72(_0xe21a66);});});}function getStateInteraction(_0x54d047){return new BPromise(function(_0x66a008){_0x54d047[_0x2cae('0x35')]=0x0;_0x54d047[_0x2cae('0x36')]=0x0;_0x54d047[_0x2cae('0x37')]=0x0;_0x54d047[_0x2cae('0x38')]=0x0;_0x54d047[_0x2cae('0x39')]=0x0;if(!_0x54d047['closed']&&!_0x54d047[_0x2cae('0x3a')]){_0x54d047[_0x2cae('0x35')]+=0x1;}if(!_0x54d047['closed']&&_0x54d047[_0x2cae('0x3a')]){_0x54d047[_0x2cae('0x36')]+=0x1;if(_0x54d047[_0x2cae('0x35')]){_0x54d047[_0x2cae('0x35')]-=0x1;}}if(_0x54d047[_0x2cae('0x3b')]&&_0x54d047['UserId']){_0x54d047['answered']+=0x1;if(_0x54d047[_0x2cae('0x36')]){_0x54d047[_0x2cae('0x36')]-=0x1;}}if(_0x54d047['closed']&&!_0x54d047[_0x2cae('0x3a')]){_0x54d047[_0x2cae('0x38')]+=0x1;if(_0x54d047[_0x2cae('0x35')]){_0x54d047[_0x2cae('0x35')]-=0x1;}}_0x54d047[_0x2cae('0x39')]+=0x1;_0x66a008(_0x54d047);});}exports[_0x2cae('0x3c')]=function(_0x145167,_0x504b47){var _0x2792f7={},_0xe89227={},_0xe314={'count':0x0,'rows':[]};var _0x2d6e01=_[_0x2cae('0x3d')](db['WhatsappInteraction']['rawAttributes'],function(_0x3e5c1e){return{'name':_0x3e5c1e[_0x2cae('0x3e')],'type':_0x3e5c1e[_0x2cae('0x3f')][_0x2cae('0x40')]};});_0xe89227['model']=_[_0x2cae('0x3d')](_0x2d6e01,'name');_0xe89227['query']=_[_0x2cae('0x41')](_0x145167['query']);_0xe89227['filters']=_[_0x2cae('0x42')](_0xe89227[_0x2cae('0x43')],_0xe89227[_0x2cae('0x44')]);_0x2792f7[_0x2cae('0x45')]=_[_0x2cae('0x42')](_0xe89227[_0x2cae('0x43')],qs[_0x2cae('0x46')](_0x145167[_0x2cae('0x44')]['fields']));_0x2792f7['attributes']=_0x2792f7['attributes'][_0x2cae('0x47')]?_0x2792f7['attributes']:_0xe89227[_0x2cae('0x43')];if(!_0x145167['query'][_0x2cae('0x48')]('nolimit')){_0x2792f7[_0x2cae('0x49')]=qs[_0x2cae('0x49')](_0x145167[_0x2cae('0x44')][_0x2cae('0x49')]);_0x2792f7[_0x2cae('0x22')]=qs[_0x2cae('0x22')](_0x145167[_0x2cae('0x44')][_0x2cae('0x22')]);}_0x2792f7[_0x2cae('0x4a')]=qs['sort'](_0x145167[_0x2cae('0x44')]['sort']);_0x2792f7['where']=qs[_0x2cae('0x4b')](_[_0x2cae('0x4c')](_0x145167[_0x2cae('0x44')],_0xe89227['filters']),_0x2d6e01);var _0x48f779=[];var _0x26abbb=squel[_0x2cae('0x4d')]()[_0x2cae('0x4e')]('id')[_0x2cae('0x4e')](_0x2cae('0x2e'))[_0x2cae('0x4e')](_0x2cae('0x4f'))[_0x2cae('0x50')](_0x2cae('0x51'));var _0x40e0ff=squel['select']()[_0x2cae('0x4e')](_0x2cae('0x52'))['field'](_0x2cae('0x53'))['field']('ui.WhatsappInteractionId')[_0x2cae('0x50')](_0x2cae('0x54'),'ui')[_0x2cae('0x55')](_0x2cae('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x19f0ae=squel[_0x2cae('0x4d')]()[_0x2cae('0x50')](_0x2cae('0x57'),'i')[_0x2cae('0x55')](_0x2cae('0x58'),'c',_0x2cae('0x59'))[_0x2cae('0x55')](_0x2cae('0x56'),'o',_0x2cae('0x5a'))[_0x2cae('0x55')](_0x2cae('0x5b'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x2cae('0x55')](_0x2cae('0x5c'),'me',_0x2cae('0x5d'))['left_join']('whatsapp_interaction_has_tags','it',_0x2cae('0x5e'))[_0x2cae('0x55')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x440608=squel[_0x2cae('0x5f')]();var _0xbfbfce=[];var _0x2487b6=squel[_0x2cae('0x5f')]();var _0x570ae0;if(_0x145167[_0x2cae('0x44')][_0x2cae('0x60')]){_0x570ae0=as[_0x2cae('0x61')](_0x145167[_0x2cae('0x44')][_0x2cae('0x60')]);var _0x235fc3=_0x570ae0['sqlOperator'];for(var _0x4bbf22=0x0;_0x4bbf22<_0x570ae0[_0x2cae('0x62')][_0x2cae('0x47')];_0x4bbf22++){var _0x39ecea=_0x570ae0[_0x2cae('0x62')][_0x4bbf22];var _0x4458f='i';var _0x2a9b82=_[_0x2cae('0x63')](_0x2d6e01,[_0x2cae('0x2e'),_0x39ecea['field']]);if(!_0x2a9b82){switch(_0x39ecea[_0x2cae('0x4e')]){case _0x2cae('0x64'):if(_0x39ecea[_0x2cae('0x65')]==0x1){_0x19f0ae[_0x2cae('0x66')]('`'+_0x39ecea[_0x2cae('0x4e')]+_0x2cae('0x67'));}else{_0x19f0ae[_0x2cae('0x66')]('`'+_0x39ecea[_0x2cae('0x4e')]+'`\x20>\x200');}break;case _0x2cae('0x68'):if(_0x39ecea[_0x2cae('0x69')]===_0x2cae('0x6a')){if(_0x39ecea['value'][_0x2cae('0x6b')]('\x20')[_0x2cae('0x47')]>0x1){_0x440608[_0x235fc3](_0x2cae('0x6c'),qs[_0x2cae('0x6d')](_0x39ecea[_0x2cae('0x65')]),null);}else{var _0x1b852a='%'+_0x39ecea[_0x2cae('0x65')]+'%';_0x440608[_0x235fc3](_0x2cae('0x6e'),_0x1b852a,_0x1b852a,_0x1b852a);}}else{_0x2a9b82=_[_0x2cae('0x63')](_0x2d6e01,['name',_0x2cae('0x6f')]);_0x39ecea['field']=_0x2cae('0x6f');_0x34c42f=as['buildExpression'](_0x4458f,_0x2a9b82[_0x2cae('0x3f')],_0x39ecea);_0x440608[_0x235fc3](_0x34c42f[_0x2cae('0x70')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x71')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x2b')]);}break;case _0x2cae('0x72'):var _0x109f87=_0x39ecea[_0x2cae('0x65')][_0x2cae('0x6b')](',')[_0x2cae('0x3d')](function(_0x52da22){return Number(_0x52da22);});_0x109f87['forEach'](function(_0x522a65){_0x2487b6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x522a65+',%');});_0xbfbfce=_[_0x2cae('0x73')](_0xbfbfce,_0x109f87);break;case _0x2cae('0x74'):if(_0x39ecea['operator']==='$substring'){_0x440608[_0x235fc3](_0x2cae('0x75'),'%'+_0x39ecea[_0x2cae('0x65')]+'%',null);}else{_0x2a9b82=_[_0x2cae('0x63')](_0x2d6e01,[_0x2cae('0x2e'),_0x2cae('0x3a')]);_0x39ecea[_0x2cae('0x4e')]=_0x2cae('0x3a');_0x34c42f=as[_0x2cae('0x76')](_0x4458f,_0x2a9b82[_0x2cae('0x3f')],_0x39ecea);_0x440608[_0x235fc3](_0x34c42f[_0x2cae('0x70')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x71')],_0x34c42f['value'][_0x2cae('0x2b')]);}break;case _0x2cae('0x77'):_0x34c42f=as[_0x2cae('0x76')]('me',null,_0x39ecea);_0x440608[_0x235fc3](_0x34c42f[_0x2cae('0x70')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x71')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x2b')]);break;}}else{var _0x34c42f=as[_0x2cae('0x76')](_0x4458f,_0x2a9b82['type'],_0x39ecea);_0x440608[_0x235fc3](_0x34c42f[_0x2cae('0x70')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x71')],_0x34c42f[_0x2cae('0x65')][_0x2cae('0x2b')]);}}}else{var _0x3d0613=_(_0x145167[_0x2cae('0x44')])[_0x2cae('0x41')]()[_0x2cae('0x3d')](function(_0x430ba5){return _['some'](_0x2d6e01,['name',_0x430ba5])?_0x430ba5:undefined;})[_0x2cae('0x78')]()[_0x2cae('0x65')]();if(!_[_0x2cae('0x79')](_0x3d0613)){_0x3d0613[_0x2cae('0x7a')](function(_0x12fe74){if(_0x12fe74===_0x2cae('0x7b')){_0x19f0ae[_0x2cae('0x7c')](_0x2cae('0x7d'),[][_0x2cae('0x7e')](_0x145167['query'][_0x12fe74]));}else if(_0x12fe74===_0x2cae('0x7f')){var _0x12588b=JSON[_0x2cae('0x80')](_0x145167[_0x2cae('0x44')][_0x12fe74])['$gte'];var _0x52cf2c=JSON[_0x2cae('0x80')](_0x145167[_0x2cae('0x44')][_0x12fe74])[_0x2cae('0x81')];_0x19f0ae[_0x2cae('0x7c')](_0x2cae('0x82'),_0x12588b,_0x52cf2c);}else{if(_0x145167['query'][_0x12fe74]===_0x2cae('0x83')){_0x19f0ae[_0x2cae('0x7c')]('i.'+_0x12fe74+'\x20IS\x20NULL');}else{_0x19f0ae[_0x2cae('0x7c')]('i.'+_0x12fe74+'\x20=\x20?',_0x145167[_0x2cae('0x44')][_0x12fe74]);}}});}if(_0x145167[_0x2cae('0x44')]['read']){if(_0x145167[_0x2cae('0x44')][_0x2cae('0x84')]==0x1){_0x19f0ae['having'](_0x2cae('0x85'));}else{_0x19f0ae[_0x2cae('0x66')](_0x2cae('0x86'));}}if(_0x145167[_0x2cae('0x44')]['tag']){_0xbfbfce=_[_0x2cae('0x87')](_0x145167['query'][_0x2cae('0x88')])?_0x145167[_0x2cae('0x44')][_0x2cae('0x88')]:new Array(_0x145167[_0x2cae('0x44')][_0x2cae('0x88')]);_0xbfbfce[_0x2cae('0x7a')](function(_0x38a72f){_0x2487b6['or'](_0x2cae('0x89'),'%,'+_0x38a72f+',%');});}if(_0x145167[_0x2cae('0x44')][_0x2cae('0x8a')]){var _0x54dadc=_0x145167['query'][_0x2cae('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x2cae('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x54dadc)){_0x440608['or']('i.id\x20LIKE\x20?',_0x54dadc+'%')['or'](_0x2cae('0x8c'),_0x54dadc+'%');}else{_0x440608['or'](_0x2cae('0x8d'),qs[_0x2cae('0x6d')](_0x54dadc))['or'](_0x2cae('0x8e'),_0x54dadc+'%');}}}_0x19f0ae['where'](_0x440608);_0x19f0ae[_0x2cae('0x8f')](_0x2cae('0x90'));var _0xce57e4={'type':db[_0x2cae('0x91')][_0x2cae('0x92')][_0x2cae('0x93')],'raw':!![]};var _0x907964=_0x19f0ae[_0x2cae('0x94')]();_0x907964[_0x2cae('0x4e')](_0x2cae('0x90'));_0x907964[_0x2cae('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x2792f7['order']){_0x2792f7[_0x2cae('0x4a')]['forEach'](function(_0x3a6219){var _0x5e0c52=_0x3a6219[0x0]===_0x2cae('0x95')?_0x3a6219[0x0]:'i.'+_0x3a6219[0x0];_0x19f0ae[_0x2cae('0x4a')](_0x5e0c52,_0x3a6219[0x1]===_0x2cae('0x96')?![]:!![]);});}if(!_['isEmpty'](_0xbfbfce)){_0x19f0ae[_0x2cae('0x66')](_0x2487b6);_0x907964['where'](_0x2cae('0x97'),_0xbfbfce);}BPromise[_0x2cae('0x98')]()[_0x2cae('0x29')](function(){if(!_0x570ae0){if(_0x145167['query'][_0x2cae('0x7b')])return;_0x907964[_0x2cae('0x7c')](_0x2cae('0x99'));_0x19f0ae[_0x2cae('0x7c')](_0x2cae('0x99'));return;}if(_0x145167[_0x2cae('0x9a')][_0x2cae('0x9b')]!==_0x2cae('0x9c'))return;return _0x145167[_0x2cae('0x9a')][_0x2cae('0x9d')]({'attributes':['id'],'raw':!![]})[_0x2cae('0x29')](function(_0x38683b){if(_[_0x2cae('0x79')](_0x38683b)){_0x907964[_0x2cae('0x7c')](_0x2cae('0x9e'));_0x19f0ae[_0x2cae('0x7c')](_0x2cae('0x9e'));}else{_0x907964[_0x2cae('0x7c')](_0x2cae('0x7d'),_[_0x2cae('0x3d')](_0x38683b,'id'));_0x19f0ae[_0x2cae('0x7c')](_0x2cae('0x7d'),_[_0x2cae('0x3d')](_0x38683b,'id'));}});})[_0x2cae('0x29')](function(){if(_0x145167[_0x2cae('0x9a')]['role']===_0x2cae('0x9c')&&!_0x570ae0&&!_0x145167[_0x2cae('0x44')][_0x2cae('0x7b')])return[];return db[_0x2cae('0x9f')][_0x2cae('0x44')](_0x907964[_0x2cae('0xa0')](),_0xce57e4);})[_0x2cae('0x29')](function(_0x5d255d){_0xe314[_0x2cae('0x24')]=_0x5d255d[_0x2cae('0x47')];if(_0xe314[_0x2cae('0x24')]===0x0)return[];return db[_0x2cae('0x9f')][_0x2cae('0x44')](_0x26abbb['toString'](),_0xce57e4)[_0x2cae('0x29')](function(_0x43fef4){_0x48f779=_[_0x2cae('0xa1')](_0x43fef4,'id');_0xce57e4=_[_0x2cae('0xa2')](_0xce57e4,{'model':db[_0x2cae('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x145167['query']['fields']){_0x2792f7[_0x2cae('0x45')][_0x2cae('0x7a')](function(_0x2316c2){_0x19f0ae['field']('i.'+_0x2316c2);});}else{_0x19f0ae['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x19f0ae['field'](_0x2cae('0xa4'),_0x2cae('0xa5'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xa6'),_0x2cae('0xa7'));_0x19f0ae[_0x2cae('0x4e')]('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',_0x2cae('0x95'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xa8'));_0x19f0ae['field']('c.firstName',_0x2cae('0xa9'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xaa'),_0x2cae('0xab'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xac'),_0x2cae('0xad'));_0x19f0ae['field'](_0x2cae('0xae'),_0x2cae('0xaf'));_0x19f0ae[_0x2cae('0x4e')]('c.mobile',_0x2cae('0xb0'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xb1'),_0x2cae('0xb2'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xb3'),'Owner.fullname');_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xb4'),_0x2cae('0xb5'));_0x19f0ae[_0x2cae('0x4e')](_0x2cae('0xb6'),'TagIds');}if(_0x2792f7[_0x2cae('0x49')])_0x19f0ae[_0x2cae('0x49')](_0x2792f7[_0x2cae('0x49')]);if(_0x2792f7[_0x2cae('0x22')])_0x19f0ae[_0x2cae('0x22')](_0x2792f7[_0x2cae('0x22')]);return db[_0x2cae('0x9f')][_0x2cae('0x44')](_0x19f0ae[_0x2cae('0xa0')](),_0xce57e4);})[_0x2cae('0x29')](function(_0x586e0a){if(_0x586e0a[_0x2cae('0x47')]>0x0)_0x40e0ff[_0x2cae('0x7c')](_0x2cae('0xb7'),_[_0x2cae('0x3d')](_0x586e0a,'id'));return db[_0x2cae('0x9f')][_0x2cae('0x44')](_0x40e0ff[_0x2cae('0xa0')](),_0xce57e4)[_0x2cae('0x29')](function(_0x34e72d){var _0x21e077=_[_0x2cae('0xb8')](_0x34e72d,_0x2cae('0xb9'));var _0x37861f=[];_0x586e0a['forEach'](function(_0x13cd50){_0x37861f['push'](updateWhatsappInteraction(_0x13cd50,_0x48f779,_0x21e077));});return BPromise[_0x2cae('0xba')](_0x37861f);});});})['then'](function(_0x1accd5){_0xe314[_0x2cae('0xbb')]=_0x1accd5;return _0xe314;})[_0x2cae('0x29')](respondWithFilteredResult(_0x504b47,_0x2792f7))['catch'](handleError(_0x504b47,null));};exports[_0x2cae('0xbc')]=function(_0x5db58d,_0x2856db){var _0xa2e349={'raw':![],'where':{'id':_0x5db58d[_0x2cae('0xbd')]['id']}},_0x1f6aaa={};_0x1f6aaa[_0x2cae('0x43')]=_[_0x2cae('0x41')](db[_0x2cae('0xa3')][_0x2cae('0xbe')]);_0x1f6aaa[_0x2cae('0x44')]=_[_0x2cae('0x41')](_0x5db58d[_0x2cae('0x44')]);_0x1f6aaa[_0x2cae('0x4b')]=_[_0x2cae('0x42')](_0x1f6aaa[_0x2cae('0x43')],_0x1f6aaa[_0x2cae('0x44')]);_0xa2e349[_0x2cae('0x45')]=_[_0x2cae('0x42')](_0x1f6aaa[_0x2cae('0x43')],qs['fields'](_0x5db58d[_0x2cae('0x44')][_0x2cae('0x46')]));_0xa2e349[_0x2cae('0x45')]=_0xa2e349['attributes'][_0x2cae('0x47')]?_0xa2e349[_0x2cae('0x45')]:_0x1f6aaa[_0x2cae('0x43')];if(_0x5db58d[_0x2cae('0x44')][_0x2cae('0xbf')]){_0xa2e349['include']=[{'all':!![]}];}_0xa2e349=_[_0x2cae('0xa2')]({},_0xa2e349,_0x5db58d[_0x2cae('0xc0')]);return db[_0x2cae('0xa3')][_0x2cae('0x63')](_0xa2e349)['then'](handleEntityNotFound(_0x2856db,null))[_0x2cae('0x29')](respondWithResult(_0x2856db,null))['catch'](handleError(_0x2856db,null));};exports[_0x2cae('0xc1')]=function(_0x4a3d46,_0x58cc0f){return db['WhatsappInteraction'][_0x2cae('0xc1')](_0x4a3d46[_0x2cae('0x77')],{})[_0x2cae('0x29')](respondWithResult(_0x58cc0f,0xc9))['catch'](handleError(_0x58cc0f,null));};exports[_0x2cae('0x28')]=function(_0x46d3fc,_0x12031c){if(_0x46d3fc[_0x2cae('0x77')]['id']){delete _0x46d3fc['body']['id'];}return db[_0x2cae('0xa3')][_0x2cae('0x63')]({'where':{'id':_0x46d3fc[_0x2cae('0xbd')]['id']}})[_0x2cae('0x29')](handleEntityNotFound(_0x12031c,null))[_0x2cae('0x29')](saveUpdates(_0x46d3fc[_0x2cae('0x77')],null))[_0x2cae('0x29')](respondWithResult(_0x12031c,null))[_0x2cae('0x34')](handleError(_0x12031c,null));};exports[_0x2cae('0x2a')]=function(_0x32871c,_0x52526a){return db[_0x2cae('0xa3')][_0x2cae('0x63')]({'where':{'id':_0x32871c[_0x2cae('0xbd')]['id']}})['then'](handleEntityNotFound(_0x52526a,null))[_0x2cae('0x29')](removeEntity(_0x52526a,null))[_0x2cae('0x34')](handleError(_0x52526a,null));};exports[_0x2cae('0xc2')]=function(_0xd95fe4,_0x4fdc84){return db['WhatsappInteraction'][_0x2cae('0xc2')]()[_0x2cae('0x29')](respondWithResult(_0x4fdc84,null))[_0x2cae('0x34')](handleError(_0x4fdc84,null));};exports[_0x2cae('0xc3')]=function(_0x28d857,_0x30ec5c,_0x3e13b7){return db[_0x2cae('0xc4')][_0x2cae('0x63')]({'where':{'id':_0x28d857[_0x2cae('0xbd')]['id']}})[_0x2cae('0x29')](handleEntityNotFound(_0x30ec5c,null))[_0x2cae('0x29')](function(_0x288834){if(_0x288834){return _0x288834['addMessage'](_0x28d857[_0x2cae('0x77')]['ids'],_[_0x2cae('0xc5')](_0x28d857[_0x2cae('0x77')],[_0x2cae('0xc6'),'id'])||{});}})[_0x2cae('0x29')](respondWithResult(_0x30ec5c,null))[_0x2cae('0x34')](handleError(_0x30ec5c,null));};exports['getMessages']=function(_0x2ffa51,_0x108171,_0x545a02){var _0x4250c2={'raw':![],'where':{}};var _0xc14fa9={};var _0x340cac={'count':0x0,'rows':[]};return db[_0x2cae('0xa3')]['findOne']({'where':{'id':_0x2ffa51[_0x2cae('0xbd')]['id']}})[_0x2cae('0x29')](handleEntityNotFound(_0x108171,null))['then'](function(_0x4d419d){if(_0x4d419d){_0xc14fa9[_0x2cae('0x43')]=_[_0x2cae('0x41')](db['WhatsappMessage'][_0x2cae('0xbe')]);_0xc14fa9[_0x2cae('0x44')]=_[_0x2cae('0x41')](_0x2ffa51[_0x2cae('0x44')]);_0xc14fa9[_0x2cae('0x4b')]=_[_0x2cae('0x42')](_0xc14fa9[_0x2cae('0x43')],_0xc14fa9[_0x2cae('0x44')]);_0x4250c2[_0x2cae('0x45')]=_[_0x2cae('0x42')](_0xc14fa9[_0x2cae('0x43')],qs[_0x2cae('0x46')](_0x2ffa51[_0x2cae('0x44')][_0x2cae('0x46')]));_0x4250c2['attributes']=_0x4250c2[_0x2cae('0x45')][_0x2cae('0x47')]?_0x4250c2[_0x2cae('0x45')]:_0xc14fa9[_0x2cae('0x43')];if(!_0x2ffa51['query']['hasOwnProperty'](_0x2cae('0xc7'))){_0x4250c2[_0x2cae('0x49')]=qs[_0x2cae('0x49')](_0x2ffa51[_0x2cae('0x44')]['limit']);_0x4250c2['offset']=qs[_0x2cae('0x22')](_0x2ffa51[_0x2cae('0x44')][_0x2cae('0x22')]);}_0x4250c2[_0x2cae('0x4a')]=qs[_0x2cae('0xc8')](_0x2ffa51['query'][_0x2cae('0xc8')]);_0x4250c2[_0x2cae('0x7c')]=qs[_0x2cae('0x4b')](_[_0x2cae('0x4c')](_0x2ffa51[_0x2cae('0x44')],_0xc14fa9[_0x2cae('0x4b')]));_0x4250c2[_0x2cae('0x7c')][_0x2cae('0xb9')]=_0x4d419d['id'];if(_0x2ffa51[_0x2cae('0x44')]['filter']){_0x4250c2[_0x2cae('0x7c')]=_['merge'](_0x4250c2['where'],{'$or':_[_0x2cae('0x3d')](_0x4250c2[_0x2cae('0x45')],function(_0x569c35){var _0x1f33c3={};_0x1f33c3[_0x569c35]={'$like':'%'+_0x2ffa51[_0x2cae('0x44')][_0x2cae('0x8a')]+'%'};return _0x1f33c3;})});}if(_0x2ffa51[_0x2cae('0x44')][_0x2cae('0xc9')]){var _0x29b242=_0x2ffa51[_0x2cae('0x44')][_0x2cae('0xc9')][_0x2cae('0x6b')](',');var _0x36cd19={};_0x36cd19[_0x29b242[0x0]]={'$gte':moment(_0x29b242[0x1])['format'](_0x2cae('0xca'))};_0x4250c2[_0x2cae('0x7c')]=_[_0x2cae('0xa2')](_0x4250c2['where'],_0x36cd19);}_0x4250c2=_[_0x2cae('0xa2')]({},_0x4250c2,_0x2ffa51[_0x2cae('0xc0')]);return db['WhatsappMessage'][_0x2cae('0x24')]({'where':_0x4250c2[_0x2cae('0x7c')]})[_0x2cae('0x29')](function(_0x5edae0){_0x340cac[_0x2cae('0x24')]=_0x5edae0;if(_0x2ffa51[_0x2cae('0x44')][_0x2cae('0xbf')]){_0x4250c2[_0x2cae('0xcb')]=[{'all':!![]}];}return db[_0x2cae('0xc4')][_0x2cae('0xcc')](_0x4250c2);})[_0x2cae('0x29')](function(_0x9b3231){_0x340cac['rows']=_0x9b3231;return _0x340cac;});}})['then'](respondWithFilteredResult(_0x108171,_0x4250c2))[_0x2cae('0x34')](handleError(_0x108171,null));};exports['addTags']=function(_0xac8396,_0x169500,_0x455ba8){return db[_0x2cae('0xa3')][_0x2cae('0x63')]({'where':{'id':_0xac8396[_0x2cae('0xbd')]['id']}})[_0x2cae('0x29')](handleEntityNotFound(_0x169500,null))[_0x2cae('0x29')](function(_0x3f8a36){if(_0x3f8a36){return _0x3f8a36[_0x2cae('0xcd')](_0xac8396[_0x2cae('0x77')][_0x2cae('0xc6')],_[_0x2cae('0xc5')](_0xac8396['body'],[_0x2cae('0xc6'),'id'])||{})[_0x2cae('0xce')](function(){return db[_0x2cae('0x72')][_0x2cae('0xcc')]({'attributes':['id',_0x2cae('0x2e'),_0x2cae('0x4f')],'where':{'id':_0xac8396['body'][_0x2cae('0xc6')]}});})[_0x2cae('0x29')](function(_0x28df2e){socket[_0x2cae('0xcf')](_0x2cae('0xd0'),{'id':Number(_0xac8396['params']['id']),'tags':_0x28df2e||[]});return{'id':Number(_0xac8396['params']['id']),'tags':_0x28df2e||[]};});}})[_0x2cae('0x29')](respondWithResult(_0x169500,null))[_0x2cae('0x34')](handleError(_0x169500,null));};exports[_0x2cae('0xd1')]=function(_0x59481c,_0x4ed1f6,_0xb490d6){return db[_0x2cae('0xa3')][_0x2cae('0x63')]({'where':{'id':_0x59481c[_0x2cae('0xbd')]['id']}})[_0x2cae('0x29')](handleEntityNotFound(_0x4ed1f6,null))['then'](function(_0x3f76f7){if(_0x3f76f7){return _0x3f76f7[_0x2cae('0xd1')](_0x59481c['query'][_0x2cae('0xc6')]);}})[_0x2cae('0x29')](respondWithStatusCode(_0x4ed1f6,null))[_0x2cae('0x34')](handleError(_0x4ed1f6,null));};exports[_0x2cae('0xd2')]=function(_0x7a5e37,_0x4bb937){var _0x7a1869=moment()[_0x2cae('0xd3')]()[_0x2cae('0xa0')]();var _0x1d3b35=path[_0x2cae('0xd4')](config[_0x2cae('0xd5')],_0x2cae('0xd6'),_0x2cae('0xd7'),_0x2cae('0xd8'));var _0x4fa927=path['join'](config[_0x2cae('0xd5')],_0x2cae('0xd6'),'files',_0x2cae('0xd9'));var _0x3020aa=path[_0x2cae('0xd4')](_0x1d3b35,_0x7a1869);var _0x2967b3=util[_0x2cae('0xda')](_0x2cae('0xdb'),_0x7a5e37['params']['id'],_0x7a1869);var _0x38946a=path['join'](_0x1d3b35,_0x2967b3);var _0x171ddd=[];_0x171ddd[_0x2cae('0xdc')]({'model':db[_0x2cae('0x74')],'as':_0x2cae('0x74'),'attributes':['id','fullname'],'raw':!![]});_0x171ddd[_0x2cae('0xdc')]({'model':db[_0x2cae('0xdd')],'as':_0x2cae('0x68'),'attributes':['id','firstName',_0x2cae('0xde')],'raw':!![]});if(_0x7a5e37[_0x2cae('0x44')][_0x2cae('0xd9')]){_0x171ddd[_0x2cae('0xdc')]({'model':db[_0x2cae('0xdf')],'as':_0x2cae('0xdf'),'raw':!![]});}var _0x18f7d4=[{'model':db['WhatsappMessage'],'as':_0x2cae('0xe0'),'attributes':['id',_0x2cae('0x77'),_0x2cae('0x7f'),_0x2cae('0xe1'),_0x2cae('0xe2'),'read'],'include':_0x171ddd}];_0x18f7d4[_0x2cae('0xdc')]({'model':db[_0x2cae('0xe3')],'as':_0x2cae('0xe4'),'attributes':['id','name']});_0x18f7d4['push']({'model':db[_0x2cae('0x74')],'as':_0x2cae('0xe5'),'attributes':['id',_0x2cae('0x31')]});return db[_0x2cae('0xa3')]['find']({'where':{'id':_0x7a5e37[_0x2cae('0xbd')]['id']},'include':_0x18f7d4})[_0x2cae('0x29')](handleEntityNotFound(_0x4bb937,null))[_0x2cae('0x29')](function(_0x4989ea){if(_0x4989ea){var _0x5af667=_0x4989ea[_0x2cae('0xe6')]({'plain':!![]});fs[_0x2cae('0xe7')](_0x3020aa);var _0x2af95c={'channel':'Whatsapp','account':_0x5af667[_0x2cae('0xe4')][_0x2cae('0x2e')],'agent':_0x5af667[_0x2cae('0xe5')]?_0x5af667[_0x2cae('0xe5')][_0x2cae('0x31')]:_0x2cae('0xe8'),'createdAt':moment(_0x5af667[_0x2cae('0x7f')])[_0x2cae('0xda')](_0x2cae('0xca'))[_0x2cae('0xa0')](),'closedAt':_0x5af667['closed']?moment(_0x5af667['closedAt'])[_0x2cae('0xda')](_0x2cae('0xca'))[_0x2cae('0xa0')]():'','disposition':_0x5af667[_0x2cae('0xe9')],'messages':_(_0x5af667['Messages'])['filter']({'secret':![]})['map'](function(_0x4eafa7){if(_0x4eafa7[_0x2cae('0xdf')]){var _0x1a5019=path[_0x2cae('0xd4')](_0x4fa927,_0x4eafa7[_0x2cae('0xdf')]['basename']);if(fs[_0x2cae('0xea')](_0x1a5019)){fs[_0x2cae('0xeb')](_0x1a5019)[_0x2cae('0xec')](fs['createWriteStream'](path['join'](_0x3020aa,_0x4eafa7['Attachment']['basename'])));}}return{'date':moment(_0x4eafa7[_0x2cae('0x7f')])[_0x2cae('0xda')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4eafa7[_0x2cae('0xe1')]===_0x2cae('0xed')?_0x4eafa7[_0x2cae('0x74')]?_0x4eafa7['User'][_0x2cae('0x31')]:_0x2cae('0xee'):_0x4eafa7[_0x2cae('0x68')][_0x2cae('0xef')]+(_0x4eafa7[_0x2cae('0x68')][_0x2cae('0xde')]?'\x20'+_0x4eafa7[_0x2cae('0x68')]['lastName']:''),'body':_0x4eafa7[_0x2cae('0xdf')]?_0x4eafa7['Attachment']['basename']:_0x4eafa7[_0x2cae('0x77')],'direction':_0x4eafa7[_0x2cae('0xe1')]===_0x2cae('0xed')?'A':'C','secret':_0x4eafa7[_0x2cae('0xe2')],'read':_0x4eafa7[_0x2cae('0x84')],'attachment':_0x4eafa7[_0x2cae('0xdf')]};})[_0x2cae('0x65')]()};return ejs['renderFile'](path[_0x2cae('0xd4')](config[_0x2cae('0xd5')],'server',_0x2cae('0xf0'),_0x2cae('0xf1')),{'interaction':_0x2af95c})[_0x2cae('0x29')](function(_0x534c86){var _0x1e4843=path[_0x2cae('0xd4')](_0x3020aa,'transcript-'+_0x5af667['id']+'-'+_0x7a1869+_0x2cae('0xf2'));var _0x2152a4={'path':_0x1e4843,'channel':_0x2cae('0xf3'),'interactionId':_0x5af667['id']};return pdf[_0x2cae('0xf4')](_0x534c86,_0x2152a4);})[_0x2cae('0x29')](function(){return new BPromise(function(_0x9271af,_0x2f2d78){zipdir(_0x3020aa,{'saveTo':_0x38946a},function(_0x267030,_0x4a4959){if(_0x267030)return _0x2f2d78(_0x267030);return _0x9271af(_0x4a4959);});})[_0x2cae('0x29')](function(){return new BPromise(function(_0x2547b0,_0x1483fd){rimraf(_0x3020aa,function(_0x2c20d2){if(_0x2c20d2)_0x1483fd(_0x2c20d2);return _0x2547b0();});});})[_0x2cae('0x29')](function(){return _0x4bb937[_0x2cae('0xd2')](_0x38946a,_0x2967b3,function(_0x22c943){if(_0x22c943){console[_0x2cae('0xf5')](_0x2cae('0xf6'),_0x22c943);}else{fs[_0x2cae('0xf7')](_0x38946a);}});});});}else{return _0x4bb937[_0x2cae('0x1f')](0xc8);}})[_0x2cae('0x34')](handleError(_0x4bb937,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 436af33..c2e8b71 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 _0x502a=['events','../../mysqldb','WhatsappMessage','update','getUsers','setDataValue','findAll','unreadMessages','emit','catch','hook','exports'];(function(_0x2848fc,_0x42da92){var _0x35f4a2=function(_0xb32951){while(--_0xb32951){_0x2848fc['push'](_0x2848fc['shift']());}};_0x35f4a2(++_0x42da92);}(_0x502a,0xd8));var _0xa502=function(_0x43d4f5,_0x205735){_0x43d4f5=_0x43d4f5-0x0;var _0x550ebd=_0x502a[_0x43d4f5];return _0x550ebd;};'use strict';var EventEmitter=require(_0xa502('0x0'));var WhatsappInteraction=require(_0xa502('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xa502('0x1'))['db'][_0xa502('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa502('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13ee72){return function(_0x437bb8,_0x15e29f,_0x1cb2e4){_0x437bb8[_0xa502('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x329022){_0x437bb8[_0xa502('0x5')]('Users',_0x329022['map'](function(_0x13e991){return{'id':_0x13e991['id']};}));return WhatsappMessage[_0xa502('0x6')]({'where':{'WhatsappInteractionId':_0x437bb8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x31d6f0){_0x437bb8[_0xa502('0x5')](_0xa502('0x7'),_0x31d6f0['length']);WhatsappInteractionEvents[_0xa502('0x8')](_0x13ee72+':'+_0x437bb8['id'],_0x437bb8);WhatsappInteractionEvents[_0xa502('0x8')](_0x13ee72,_0x437bb8);_0x1cb2e4(null);})[_0xa502('0x9')](_0x1cb2e4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xa502('0xa')](e,emitEvent(event));}}module[_0xa502('0xb')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x81a5=['map','findAll','length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then','setDataValue','Users'];(function(_0x2a1cca,_0x4b13a2){var _0x4eb8d5=function(_0x4f89a7){while(--_0x4f89a7){_0x2a1cca['push'](_0x2a1cca['shift']());}};_0x4eb8d5(++_0x4b13a2);}(_0x81a5,0x1c8));var _0x581a=function(_0x210926,_0x23f9cc){_0x210926=_0x210926-0x0;var _0x1e3e09=_0x81a5[_0x210926];return _0x1e3e09;};'use strict';var EventEmitter=require(_0x581a('0x0'));var WhatsappInteraction=require(_0x581a('0x1'))['db'][_0x581a('0x2')];var WhatsappMessage=require(_0x581a('0x1'))['db'][_0x581a('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x581a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x581a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f5f9a){return function(_0x51d349,_0x4b491c,_0x21fea7){_0x51d349['getUsers']({'attributes':['id'],'raw':!![]})[_0x581a('0x6')](function(_0x3bcfe6){_0x51d349[_0x581a('0x7')](_0x581a('0x8'),_0x3bcfe6[_0x581a('0x9')](function(_0x2356d3){return{'id':_0x2356d3['id']};}));return WhatsappMessage[_0x581a('0xa')]({'where':{'WhatsappInteractionId':_0x51d349['id'],'direction':'in','read':![]},'raw':!![]});})[_0x581a('0x6')](function(_0x524948){_0x51d349[_0x581a('0x7')]('unreadMessages',_0x524948[_0x581a('0xb')]);WhatsappInteractionEvents[_0x581a('0xc')](_0x4f5f9a+':'+_0x51d349['id'],_0x51d349);WhatsappInteractionEvents[_0x581a('0xc')](_0x4f5f9a,_0x51d349);_0x21fea7(null);})[_0x581a('0xd')](_0x21fea7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x581a('0xe')](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 e06365e..f0104ba 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 _0xc042=['YYYY-MM-DD\x20HH:mm:ss','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xc042,0x121));var _0x2c04=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xc042[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c04('0x0'))('api');var moment=require(_0x2c04('0x1'));var BPromise=require(_0x2c04('0x2'));var rp=require(_0x2c04('0x3'));var fs=require('fs');var path=require(_0x2c04('0x4'));var rimraf=require(_0x2c04('0x5'));var config=require(_0x2c04('0x6'));var attributes=require(_0x2c04('0x7'));module[_0x2c04('0x8')]=function(_0x472374,_0x550fae){return _0x472374[_0x2c04('0x9')](_0x2c04('0xa'),attributes,{'tableName':_0x2c04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x445db6,_0x550d7e,_0x2373ef){if(_0x445db6[_0x2c04('0xc')]('closed')){_0x445db6[_0x2c04('0xd')]=moment()[_0x2c04('0xe')](_0x2c04('0xf'));}_0x2373ef(null,_0x445db6);}}});}; \ No newline at end of file +var _0x5402=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x1b80e5,_0x4bb7c8){var _0x3079eb=function(_0x450895){while(--_0x450895){_0x1b80e5['push'](_0x1b80e5['shift']());}};_0x3079eb(++_0x4bb7c8);}(_0x5402,0x121));var _0x2540=function(_0x4d6d97,_0x486cd5){_0x4d6d97=_0x4d6d97-0x0;var _0x4da402=_0x5402[_0x4d6d97];return _0x4da402;};'use strict';var _=require(_0x2540('0x0'));var util=require(_0x2540('0x1'));var logger=require(_0x2540('0x2'))('api');var moment=require(_0x2540('0x3'));var BPromise=require(_0x2540('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2540('0x5'));var attributes=require(_0x2540('0x6'));module[_0x2540('0x7')]=function(_0xe9d347,_0x3954b5){return _0xe9d347[_0x2540('0x8')](_0x2540('0x9'),attributes,{'tableName':_0x2540('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4dd7af,_0x1396d6,_0x191db0){if(_0x4dd7af[_0x2540('0xb')](_0x2540('0xc'))){_0x4dd7af[_0x2540('0xd')]=moment()['format'](_0x2540('0xe'));}_0x191db0(null,_0x4dd7af);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 58f2763..84de942 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 _0x873e=['WhatsappInteraction,\x20%s,\x20%s','info','result','catch','WhatsappInteraction','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x359d35,_0x58043d){var _0x48f906=function(_0x1f13bc){while(--_0x1f13bc){_0x359d35['push'](_0x359d35['shift']());}};_0x48f906(++_0x58043d);}(_0x873e,0x1d4));var _0xe873=function(_0x3116e6,_0x44a52a){_0x3116e6=_0x3116e6-0x0;var _0x2c9707=_0x873e[_0x3116e6];return _0x2c9707;};'use strict';var _=require(_0xe873('0x0'));var util=require(_0xe873('0x1'));var moment=require(_0xe873('0x2'));var BPromise=require(_0xe873('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe873('0x4'))['db'];var utils=require(_0xe873('0x5'));var logger=require(_0xe873('0x6'))(_0xe873('0x7'));var config=require(_0xe873('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe873('0x9')][_0xe873('0xa')]({'port':0x232a});config[_0xe873('0xb')]=_[_0xe873('0xc')](config['redis'],{'host':_0xe873('0xd'),'port':0x18eb});var socket=require(_0xe873('0xe'))(new Redis(config[_0xe873('0xb')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x498560,_0x327f15,_0x533012){return new BPromise(function(_0x5eaa46,_0x2036b2){return client[_0xe873('0xf')](_0x498560,_0x533012)[_0xe873('0x10')](function(_0x5030f5){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x327f15,_0xe873('0x11'));logger[_0xe873('0x12')](_0xe873('0x13'),_0x327f15,_0xe873('0x11'),JSON[_0xe873('0x14')](_0x5030f5));if(_0x5030f5[_0xe873('0x15')]){if(_0x5030f5[_0xe873('0x15')][_0xe873('0x16')]===0x1f4){logger[_0xe873('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x327f15,_0x5030f5[_0xe873('0x15')][_0xe873('0x17')]);return _0x2036b2(_0x5030f5[_0xe873('0x15')][_0xe873('0x17')]);}logger[_0xe873('0x15')](_0xe873('0x18'),_0x327f15,_0x5030f5[_0xe873('0x15')][_0xe873('0x17')]);return _0x5eaa46(_0x5030f5[_0xe873('0x15')]['message']);}else{logger[_0xe873('0x19')](_0xe873('0x18'),_0x327f15,_0xe873('0x11'));_0x5eaa46(_0x5030f5[_0xe873('0x1a')][_0xe873('0x17')]);}})[_0xe873('0x1b')](function(_0x545122){logger[_0xe873('0x15')](_0xe873('0x18'),_0x327f15,_0x545122);_0x2036b2(_0x545122);});});}exports['UpdateWhatsappInteraction']=function(_0x2085e9){var _0x188309=this;return new Promise(function(_0x52e6af,_0x3adef0){return db[_0xe873('0x1c')]['update'](_0x2085e9[_0xe873('0x1d')],{'raw':_0x2085e9['options']?_0x2085e9[_0xe873('0x1e')][_0xe873('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2085e9[_0xe873('0x1e')]?_0x2085e9[_0xe873('0x1e')][_0xe873('0x20')]||null:null,'attributes':_0x2085e9[_0xe873('0x1e')]?_0x2085e9[_0xe873('0x1e')][_0xe873('0x21')]||null:null,'limit':_0x2085e9['options']?_0x2085e9[_0xe873('0x1e')][_0xe873('0x22')]||null:null})[_0xe873('0x10')](function(_0x4e1016){logger[_0xe873('0x19')]('UpdateWhatsappInteraction',_0x2085e9);logger[_0xe873('0x12')](_0xe873('0x23'),_0x2085e9,JSON['stringify'](_0x4e1016));_0x52e6af(_0x4e1016);})[_0xe873('0x1b')](function(_0x3f3577){logger[_0xe873('0x15')](_0xe873('0x23'),_0x3f3577[_0xe873('0x17')],_0x2085e9);_0x3adef0(_0x188309['error'](0x1f4,_0x3f3577[_0xe873('0x17')]));});});};exports[_0xe873('0x24')]=function(_0x1ca381){return new Promise(function(_0x423d63,_0x4390e2){return db['WhatsappInteraction'][_0xe873('0x25')]({'where':_0x1ca381[_0xe873('0x1e')]?_0x1ca381[_0xe873('0x1e')][_0xe873('0x20')]||null:null})['then'](function(_0x3a7178){if(_0x3a7178){return _0x3a7178['addTags'](_0x1ca381[_0xe873('0x1d')][_0xe873('0x26')],_['omit'](_0x1ca381['body'],[_0xe873('0x26'),'id'])||{});}})[_0xe873('0x27')](function(_0x24ed6c){logger[_0xe873('0x19')](_0xe873('0x28'),_0x1ca381);logger[_0xe873('0x12')](_0xe873('0x28'),_0x1ca381,JSON[_0xe873('0x14')](_0x24ed6c));_0x423d63(_0x24ed6c);})['catch'](function(_0x55f27e){logger['error'](_0xe873('0x28'),_0x55f27e['message'],_0x1ca381);_0x4390e2(_this[_0xe873('0x15')](0x1f4,_0x55f27e[_0xe873('0x17')]));});});}; \ No newline at end of file +var _0xe400=['find','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','limit','info','AddTagsToWhatsappInteraction'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0xe400,0xf6));var _0x0e40=function(_0x506e5d,_0x5a8473){_0x506e5d=_0x506e5d-0x0;var _0x458646=_0xe400[_0x506e5d];return _0x458646;};'use strict';var _=require('lodash');var util=require(_0x0e40('0x0'));var moment=require(_0x0e40('0x1'));var BPromise=require(_0x0e40('0x2'));var rs=require(_0x0e40('0x3'));var fs=require('fs');var Redis=require(_0x0e40('0x4'));var db=require(_0x0e40('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e40('0x6'))(_0x0e40('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e40('0x8'));var client=jayson['client'][_0x0e40('0x9')]({'port':0x232a});config[_0x0e40('0xa')]=_['defaults'](config[_0x0e40('0xa')],{'host':_0x0e40('0xb'),'port':0x18eb});var socket=require(_0x0e40('0xc'))(new Redis(config[_0x0e40('0xa')]));require(_0x0e40('0xd'))['register'](socket);function respondWithRpcPromise(_0x4575cc,_0x515036,_0x3fdd96){return new BPromise(function(_0xd7e127,_0x2a9eb5){return client[_0x0e40('0xe')](_0x4575cc,_0x3fdd96)[_0x0e40('0xf')](function(_0x3f8a2e){logger['info'](_0x0e40('0x10'),_0x515036,'request\x20sent');logger[_0x0e40('0x11')](_0x0e40('0x12'),_0x515036,_0x0e40('0x13'),JSON[_0x0e40('0x14')](_0x3f8a2e));if(_0x3f8a2e[_0x0e40('0x15')]){if(_0x3f8a2e[_0x0e40('0x15')]['code']===0x1f4){logger[_0x0e40('0x15')](_0x0e40('0x10'),_0x515036,_0x3f8a2e['error']['message']);return _0x2a9eb5(_0x3f8a2e[_0x0e40('0x15')]['message']);}logger[_0x0e40('0x15')](_0x0e40('0x10'),_0x515036,_0x3f8a2e[_0x0e40('0x15')][_0x0e40('0x16')]);return _0xd7e127(_0x3f8a2e[_0x0e40('0x15')][_0x0e40('0x16')]);}else{logger['info'](_0x0e40('0x10'),_0x515036,'request\x20sent');_0xd7e127(_0x3f8a2e[_0x0e40('0x17')]['message']);}})[_0x0e40('0x18')](function(_0x1e7f75){logger[_0x0e40('0x15')](_0x0e40('0x10'),_0x515036,_0x1e7f75);_0x2a9eb5(_0x1e7f75);});});}exports[_0x0e40('0x19')]=function(_0x2aa30d){var _0x5e93da=this;return new Promise(function(_0x58cc93,_0x48e016){return db[_0x0e40('0x1a')]['update'](_0x2aa30d['body'],{'raw':_0x2aa30d['options']?_0x2aa30d[_0x0e40('0x1b')][_0x0e40('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2aa30d[_0x0e40('0x1b')]?_0x2aa30d[_0x0e40('0x1b')][_0x0e40('0x1d')]||null:null,'attributes':_0x2aa30d[_0x0e40('0x1b')]?_0x2aa30d['options'][_0x0e40('0x1e')]||null:null,'limit':_0x2aa30d[_0x0e40('0x1b')]?_0x2aa30d[_0x0e40('0x1b')][_0x0e40('0x1f')]||null:null})[_0x0e40('0xf')](function(_0x1c71f9){logger[_0x0e40('0x20')](_0x0e40('0x19'),_0x2aa30d);logger['debug'](_0x0e40('0x19'),_0x2aa30d,JSON[_0x0e40('0x14')](_0x1c71f9));_0x58cc93(_0x1c71f9);})[_0x0e40('0x18')](function(_0x4b18e8){logger[_0x0e40('0x15')]('UpdateWhatsappInteraction',_0x4b18e8[_0x0e40('0x16')],_0x2aa30d);_0x48e016(_0x5e93da[_0x0e40('0x15')](0x1f4,_0x4b18e8['message']));});});};exports[_0x0e40('0x21')]=function(_0x1ef6c3){return new Promise(function(_0x51d74e,_0x49476c){return db[_0x0e40('0x1a')][_0x0e40('0x22')]({'where':_0x1ef6c3[_0x0e40('0x1b')]?_0x1ef6c3[_0x0e40('0x1b')][_0x0e40('0x1d')]||null:null})[_0x0e40('0xf')](function(_0x14016e){if(_0x14016e){return _0x14016e['addTags'](_0x1ef6c3[_0x0e40('0x23')][_0x0e40('0x24')],_[_0x0e40('0x25')](_0x1ef6c3[_0x0e40('0x23')],['ids','id'])||{});}})[_0x0e40('0x26')](function(_0x2fb84f){logger['info']('AddTags',_0x1ef6c3);logger[_0x0e40('0x11')](_0x0e40('0x27'),_0x1ef6c3,JSON[_0x0e40('0x14')](_0x2fb84f));_0x51d74e(_0x2fb84f);})[_0x0e40('0x18')](function(_0x477ec9){logger[_0x0e40('0x15')](_0x0e40('0x27'),_0x477ec9[_0x0e40('0x16')],_0x1ef6c3);_0x49476c(_this[_0x0e40('0x15')](0x1f4,_0x477ec9['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 6699737..04beb9d 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 _0x6fe1=['update','emit','removeListener','register','length','save'];(function(_0x21aee6,_0x23191d){var _0x378d35=function(_0x3010b3){while(--_0x3010b3){_0x21aee6['push'](_0x21aee6['shift']());}};_0x378d35(++_0x23191d);}(_0x6fe1,0x12b));var _0x16fe=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x6fe1[_0x23b655];return _0x364b32;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x16fe('0x0'),'remove',_0x16fe('0x1')];function createListener(_0x2e79a5,_0x4d9549){return function(_0x368c4b){_0x4d9549[_0x16fe('0x2')](_0x2e79a5,_0x368c4b);};}function removeListener(_0x2e22b9,_0x531d2e){return function(){WhatsappInteractionEvents[_0x16fe('0x3')](_0x2e22b9,_0x531d2e);};}exports[_0x16fe('0x4')]=function(_0x5bcae4){for(var _0x15556c=0x0,_0x507545=events[_0x16fe('0x5')];_0x15556c<_0x507545;_0x15556c++){var _0x23c232=events[_0x15556c];var _0x40115b=createListener('whatsappInteraction:'+_0x23c232,_0x5bcae4);WhatsappInteractionEvents['on'](_0x23c232,_0x40115b);}}; \ No newline at end of file +var _0x8bc7=['save','update','removeListener','length','./whatsappInteraction.events'];(function(_0x16946a,_0x2c6288){var _0x55cbe3=function(_0x3b76ce){while(--_0x3b76ce){_0x16946a['push'](_0x16946a['shift']());}};_0x55cbe3(++_0x2c6288);}(_0x8bc7,0xd1));var _0x78bc=function(_0x492444,_0x5d0dae){_0x492444=_0x492444-0x0;var _0x1a25e7=_0x8bc7[_0x492444];return _0x1a25e7;};'use strict';var WhatsappInteractionEvents=require(_0x78bc('0x0'));var events=[_0x78bc('0x1'),'remove',_0x78bc('0x2')];function createListener(_0x48818c,_0x14764b){return function(_0x1c53ab){_0x14764b['emit'](_0x48818c,_0x1c53ab);};}function removeListener(_0x5dfe5c,_0x503395){return function(){WhatsappInteractionEvents[_0x78bc('0x3')](_0x5dfe5c,_0x503395);};}exports['register']=function(_0xbf31b0){for(var _0x5ce155=0x0,_0x5c6866=events[_0x78bc('0x4')];_0x5ce155<_0x5c6866;_0x5ce155++){var _0x5d2b72=events[_0x5ce155];var _0x502048=createListener('whatsappInteraction:'+_0x5d2b72,_0xbf31b0);WhatsappInteractionEvents['on'](_0x5d2b72,_0x502048);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index ab4fbc0..3e69f67 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 _0x9fc0=['/:id','show','post','tracked','whatsapp','create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x137fb5,_0x2f9d33){var _0x4099eb=function(_0x18eabf){while(--_0x18eabf){_0x137fb5['push'](_0x137fb5['shift']());}};_0x4099eb(++_0x2f9d33);}(_0x9fc0,0x115));var _0x09fc=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x9fc0[_0x4f08dd];return _0x3017ee;};'use strict';var multer=require(_0x09fc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09fc('0x1'));var router=express[_0x09fc('0x2')]();var fs_extra=require(_0x09fc('0x3'));var auth=require(_0x09fc('0x4'));var interaction=require(_0x09fc('0x5'));var config=require(_0x09fc('0x6'));var controller=require(_0x09fc('0x7'));router[_0x09fc('0x8')]('/',auth[_0x09fc('0x9')](),controller[_0x09fc('0xa')]);router[_0x09fc('0x8')](_0x09fc('0xb'),auth[_0x09fc('0x9')](),controller[_0x09fc('0xc')]);router[_0x09fc('0x8')](_0x09fc('0xd'),auth[_0x09fc('0x9')](),controller[_0x09fc('0xe')]);router[_0x09fc('0xf')]('/',auth[_0x09fc('0x9')](),interaction[_0x09fc('0x10')](_0x09fc('0x11'),'whatsappmessage:create'),controller[_0x09fc('0x12')]);router[_0x09fc('0xf')](_0x09fc('0x13'),controller[_0x09fc('0x14')]);router[_0x09fc('0x15')]('/:id',auth[_0x09fc('0x9')](),controller[_0x09fc('0x16')]);router[_0x09fc('0x15')](_0x09fc('0x17'),auth[_0x09fc('0x9')](),controller['accept']);router[_0x09fc('0x15')](_0x09fc('0x18'),auth[_0x09fc('0x9')](),controller[_0x09fc('0x19')]);router[_0x09fc('0x1a')](_0x09fc('0xd'),auth[_0x09fc('0x9')](),controller[_0x09fc('0x1b')]);module[_0x09fc('0x1c')]=router; \ No newline at end of file +var _0xb119=['../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x12fc98,_0xe38860){var _0x31903d=function(_0x5072f4){while(--_0x5072f4){_0x12fc98['push'](_0x12fc98['shift']());}};_0x31903d(++_0xe38860);}(_0xb119,0xed));var _0x9b11=function(_0x5e73c3,_0x2a9328){_0x5e73c3=_0x5e73c3-0x0;var _0x144335=_0xb119[_0x5e73c3];return _0x144335;};'use strict';var multer=require(_0x9b11('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b11('0x1'));var express=require(_0x9b11('0x2'));var router=express[_0x9b11('0x3')]();var fs_extra=require(_0x9b11('0x4'));var auth=require(_0x9b11('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9b11('0x6'));var controller=require(_0x9b11('0x7'));router[_0x9b11('0x8')]('/',auth[_0x9b11('0x9')](),controller[_0x9b11('0xa')]);router[_0x9b11('0x8')](_0x9b11('0xb'),auth[_0x9b11('0x9')](),controller[_0x9b11('0xc')]);router[_0x9b11('0x8')](_0x9b11('0xd'),auth[_0x9b11('0x9')](),controller[_0x9b11('0xe')]);router[_0x9b11('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9b11('0x10')](_0x9b11('0x11'),_0x9b11('0x12')),controller[_0x9b11('0x13')]);router[_0x9b11('0xf')](_0x9b11('0x14'),controller[_0x9b11('0x15')]);router[_0x9b11('0x16')](_0x9b11('0xd'),auth[_0x9b11('0x9')](),controller[_0x9b11('0x17')]);router[_0x9b11('0x16')](_0x9b11('0x18'),auth[_0x9b11('0x9')](),controller[_0x9b11('0x19')]);router[_0x9b11('0x16')]('/:id/reject',auth[_0x9b11('0x9')](),controller['reject']);router['delete'](_0x9b11('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9b11('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index e20d86d..2f287cd 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 _0xc978=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x567760,_0x282c85){var _0xbfbb92=function(_0x1d0738){while(--_0x1d0738){_0x567760['push'](_0x567760['shift']());}};_0xbfbb92(++_0x282c85);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8c97('0x0'));module[_0x8c97('0x1')]={'body':{'type':Sequelize[_0x8c97('0x2')](_0x8c97('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8c97('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8c97('0x5')]('in','out'),'defaultValue':_0x8c97('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8c97('0x7')](0xbe)},'phone':{'type':Sequelize[_0x8c97('0x7')]},'readAt':{'type':Sequelize[_0x8c97('0x8')]},'secret':{'type':Sequelize[_0x8c97('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8c97('0x7')]},'providerResponse':{'type':Sequelize[_0x8c97('0x2')]}}; \ No newline at end of file +var _0xc2b1=['out','STRING','TEXT','BOOLEAN','ENUM'];(function(_0x515312,_0x42d99a){var _0x1e81ea=function(_0x5b8af4){while(--_0x5b8af4){_0x515312['push'](_0x515312['shift']());}};_0x1e81ea(++_0x42d99a);}(_0xc2b1,0x1a1));var _0x1c2b=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xc2b1[_0x31eb67];return _0x2a8cb8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1c2b('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1c2b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c2b('0x2')]('in',_0x1c2b('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1c2b('0x4')](0xbe)},'phone':{'type':Sequelize[_0x1c2b('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1c2b('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c2b('0x4')]},'providerResponse':{'type':Sequelize[_0x1c2b('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index df427a5..e685c35 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 _0xb61a=['twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','merge','options','WhatsappMessage','include','findAll','show','params','rawAttributes','includeAll','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect'];(function(_0x1e2bed,_0x151e5e){var _0x40faea=function(_0x99c655){while(--_0x99c655){_0x1e2bed['push'](_0x1e2bed['shift']());}};_0x40faea(++_0x151e5e);}(_0xb61a,0x1af));var _0xab61=function(_0x8c5cb4,_0x16c3ad){_0x8c5cb4=_0x8c5cb4-0x0;var _0x12b1d7=_0xb61a[_0x8c5cb4];return _0x12b1d7;};'use strict';var emlformat=require(_0xab61('0x0'));var rimraf=require(_0xab61('0x1'));var zipdir=require(_0xab61('0x2'));var jsonpatch=require(_0xab61('0x3'));var rp=require('request-promise');var moment=require(_0xab61('0x4'));var BPromise=require(_0xab61('0x5'));var Mustache=require(_0xab61('0x6'));var util=require(_0xab61('0x7'));var path=require('path');var sox=require(_0xab61('0x8'));var csv=require(_0xab61('0x9'));var ejs=require(_0xab61('0xa'));var fs=require('fs');var fs_extra=require(_0xab61('0xb'));var _=require('lodash');var squel=require(_0xab61('0xc'));var crypto=require('crypto');var jsforce=require(_0xab61('0xd'));var deskjs=require(_0xab61('0xe'));var toCsv=require('to-csv');var querystring=require(_0xab61('0xf'));var Papa=require(_0xab61('0x10'));var Redis=require('ioredis');var authService=require(_0xab61('0x11'));var qs=require(_0xab61('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab61('0x13'));var logger=require(_0xab61('0x14'))(_0xab61('0x15'));var utils=require('../../config/utils');var config=require(_0xab61('0x16'));var licenseUtil=require(_0xab61('0x17'));var db=require('../../mysqldb')['db'];config[_0xab61('0x18')]=_[_0xab61('0x19')](config[_0xab61('0x18')],{'host':_0xab61('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab61('0x18')]));require(_0xab61('0x1b'))[_0xab61('0x1c')](socket);var jayson=require(_0xab61('0x1d'));var client=jayson[_0xab61('0x1e')][_0xab61('0x1f')]({'port':0x232c});var client9002=jayson[_0xab61('0x1e')][_0xab61('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x160ed8,_0x3668de,_0x5c41b1,_0x11716d){return new BPromise(function(_0x31a957,_0x4d9c3d){var _0x262074=_0x11716d||client;return _0x262074['request'](_0x160ed8,_0x5c41b1)[_0xab61('0x20')](function(_0x24d1a5){logger[_0xab61('0x21')](_0xab61('0x22'),_0x3668de,_0xab61('0x23'));logger[_0xab61('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3668de,_0xab61('0x23'),JSON[_0xab61('0x25')](_0x24d1a5));if(_0x24d1a5[_0xab61('0x26')]){if(_0x24d1a5[_0xab61('0x26')]['code']===0x1f4){logger[_0xab61('0x26')](_0xab61('0x22'),_0x3668de,_0x24d1a5[_0xab61('0x26')][_0xab61('0x27')]);return _0x4d9c3d(_0x24d1a5['error'][_0xab61('0x27')]);}logger[_0xab61('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x3668de,_0x24d1a5[_0xab61('0x26')][_0xab61('0x27')]);return _0x31a957(_0x24d1a5['error']['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3668de,_0xab61('0x23'));_0x31a957(_0x24d1a5[_0xab61('0x28')]['message']);}})[_0xab61('0x29')](function(_0x4465b5){logger['error'](_0xab61('0x22'),_0x3668de,_0x4465b5);_0x4d9c3d(_0x4465b5);});});}function respondWithStatusCode(_0x45ef8f,_0x1da987){_0x1da987=_0x1da987||0xcc;return function(_0x3ea51f){if(_0x3ea51f){return _0x45ef8f['sendStatus'](_0x1da987);}return _0x45ef8f[_0xab61('0x2a')](_0x1da987)[_0xab61('0x2b')]();};}function respondWithResult(_0x5caffc,_0xe20653){_0xe20653=_0xe20653||0xc8;return function(_0x442827){if(_0x442827){return _0x5caffc[_0xab61('0x2a')](_0xe20653)[_0xab61('0x2c')](_0x442827);}};}function respondWithFilteredResult(_0x585159,_0x167706){return function(_0x5468ee){if(_0x5468ee){var _0x281935=typeof _0x167706['offset']===_0xab61('0x2d')&&typeof _0x167706[_0xab61('0x2e')]===_0xab61('0x2d');var _0x3b35d7=_0x5468ee[_0xab61('0x2f')];var _0x2dfa87=_0x281935?0x0:_0x167706['offset'];var _0x4d92b5=_0x281935?_0x5468ee[_0xab61('0x2f')]:_0x167706[_0xab61('0x30')]+_0x167706[_0xab61('0x2e')];var _0x424da3;if(_0x4d92b5>=_0x3b35d7){_0x4d92b5=_0x3b35d7;_0x424da3=0xc8;}else{_0x424da3=0xce;}_0x585159['status'](_0x424da3);return _0x585159['set'](_0xab61('0x31'),_0x2dfa87+'-'+_0x4d92b5+'/'+_0x3b35d7)[_0xab61('0x2c')](_0x5468ee);}return null;};}function patchUpdates(_0x4dae1d){return function(_0xbbaaf1){try{jsonpatch[_0xab61('0x32')](_0xbbaaf1,_0x4dae1d,!![]);}catch(_0x1ee0d6){return BPromise[_0xab61('0x33')](_0x1ee0d6);}return _0xbbaaf1[_0xab61('0x34')]();};}function saveUpdates(_0x3ab276,_0x2f6160){return function(_0x3dafc7){if(_0x3dafc7){return _0x3dafc7[_0xab61('0x35')](_0x3ab276)[_0xab61('0x20')](function(_0xa7fe6d){return _0xa7fe6d;});}return null;};}function removeEntity(_0x5aca07,_0x11d7c8){return function(_0x233106){if(_0x233106){return _0x233106[_0xab61('0x36')]()[_0xab61('0x20')](function(){_0x5aca07[_0xab61('0x2a')](0xcc)[_0xab61('0x2b')]();});}};}function handleEntityNotFound(_0x4d1f16,_0x4f8e53){return function(_0xcadf43){if(!_0xcadf43){_0x4d1f16[_0xab61('0x37')](0x194);}return _0xcadf43;};}function handleError(_0x5d820b,_0x3fd102){_0x3fd102=_0x3fd102||0x1f4;return function(_0x588f10){logger['error'](_0x588f10[_0xab61('0x38')]);if(_0x588f10[_0xab61('0x39')]){delete _0x588f10[_0xab61('0x39')];}_0x5d820b[_0xab61('0x2a')](_0x3fd102)[_0xab61('0x3a')](_0x588f10);};}exports[_0xab61('0x3b')]=function(_0x106182,_0x2681d3){var _0x47a307={},_0xd5f033={},_0x5906f0={'count':0x0,'rows':[]};var _0xd7f25=_[_0xab61('0x3c')](db['WhatsappMessage']['rawAttributes'],function(_0x50701f){return{'name':_0x50701f[_0xab61('0x3d')],'type':_0x50701f['type'][_0xab61('0x3e')]};});_0xd5f033[_0xab61('0x3f')]=_[_0xab61('0x3c')](_0xd7f25,'name');_0xd5f033['query']=_[_0xab61('0x40')](_0x106182[_0xab61('0x41')]);_0xd5f033[_0xab61('0x42')]=_[_0xab61('0x43')](_0xd5f033[_0xab61('0x3f')],_0xd5f033[_0xab61('0x41')]);_0x47a307[_0xab61('0x44')]=_[_0xab61('0x43')](_0xd5f033['model'],qs[_0xab61('0x45')](_0x106182[_0xab61('0x41')]['fields']));_0x47a307[_0xab61('0x44')]=_0x47a307[_0xab61('0x44')][_0xab61('0x46')]?_0x47a307[_0xab61('0x44')]:_0xd5f033[_0xab61('0x3f')];if(!_0x106182['query'][_0xab61('0x47')]('nolimit')){_0x47a307['limit']=qs[_0xab61('0x2e')](_0x106182[_0xab61('0x41')][_0xab61('0x2e')]);_0x47a307[_0xab61('0x30')]=qs[_0xab61('0x30')](_0x106182[_0xab61('0x41')]['offset']);}_0x47a307['order']=qs[_0xab61('0x48')](_0x106182[_0xab61('0x41')][_0xab61('0x48')]);_0x47a307[_0xab61('0x49')]=qs[_0xab61('0x42')](_['pick'](_0x106182[_0xab61('0x41')],_0xd5f033[_0xab61('0x42')]),_0xd7f25);if(_0x106182[_0xab61('0x41')][_0xab61('0x4a')]){_0x47a307[_0xab61('0x49')]=_['merge'](_0x47a307[_0xab61('0x49')],{'$or':_[_0xab61('0x3c')](_0xd7f25,function(_0x2b5f47){if(_0x2b5f47[_0xab61('0x4b')]!=='VIRTUAL'){var _0x34a458={};_0x34a458[_0x2b5f47['name']]={'$like':'%'+_0x106182[_0xab61('0x41')]['filter']+'%'};return _0x34a458;}})});}_0x47a307=_[_0xab61('0x4c')]({},_0x47a307,_0x106182[_0xab61('0x4d')]);var _0x3d458a={'where':_0x47a307[_0xab61('0x49')]};return db[_0xab61('0x4e')]['count'](_0x3d458a)[_0xab61('0x20')](function(_0x39bf03){_0x5906f0[_0xab61('0x2f')]=_0x39bf03;if(_0x106182[_0xab61('0x41')]['includeAll']){_0x47a307[_0xab61('0x4f')]=[{'all':!![]}];}return db[_0xab61('0x4e')][_0xab61('0x50')](_0x47a307);})[_0xab61('0x20')](function(_0x3b925f){_0x5906f0['rows']=_0x3b925f;return _0x5906f0;})[_0xab61('0x20')](respondWithFilteredResult(_0x2681d3,_0x47a307))[_0xab61('0x29')](handleError(_0x2681d3,null));};exports[_0xab61('0x51')]=function(_0x3017a4,_0x35eb8f){var _0x350938={'raw':!![],'where':{'id':_0x3017a4[_0xab61('0x52')]['id']}},_0x37014f={};_0x37014f[_0xab61('0x3f')]=_['keys'](db[_0xab61('0x4e')][_0xab61('0x53')]);_0x37014f['query']=_[_0xab61('0x40')](_0x3017a4[_0xab61('0x41')]);_0x37014f['filters']=_[_0xab61('0x43')](_0x37014f[_0xab61('0x3f')],_0x37014f[_0xab61('0x41')]);_0x350938['attributes']=_[_0xab61('0x43')](_0x37014f[_0xab61('0x3f')],qs[_0xab61('0x45')](_0x3017a4[_0xab61('0x41')][_0xab61('0x45')]));_0x350938['attributes']=_0x350938[_0xab61('0x44')][_0xab61('0x46')]?_0x350938['attributes']:_0x37014f[_0xab61('0x3f')];if(_0x3017a4[_0xab61('0x41')][_0xab61('0x54')]){_0x350938[_0xab61('0x4f')]=[{'all':!![]}];}_0x350938=_[_0xab61('0x4c')]({},_0x350938,_0x3017a4[_0xab61('0x4d')]);return db[_0xab61('0x4e')]['find'](_0x350938)[_0xab61('0x20')](handleEntityNotFound(_0x35eb8f,null))[_0xab61('0x20')](respondWithResult(_0x35eb8f,null))[_0xab61('0x29')](handleError(_0x35eb8f,null));};exports[_0xab61('0x55')]=function(_0x3d5055,_0x55f321){return db[_0xab61('0x4e')][_0xab61('0x55')](_0x3d5055['body'],{})['then'](respondWithResult(_0x55f321,0xc9))['catch'](handleError(_0x55f321,null));};exports[_0xab61('0x35')]=function(_0x3ae36e,_0x240c08){if(_0x3ae36e[_0xab61('0x56')]['id']){delete _0x3ae36e['body']['id'];}return db['WhatsappMessage'][_0xab61('0x57')]({'where':{'id':_0x3ae36e['params']['id']}})['then'](handleEntityNotFound(_0x240c08,null))[_0xab61('0x20')](saveUpdates(_0x3ae36e['body'],null))['then'](respondWithResult(_0x240c08,null))[_0xab61('0x29')](handleError(_0x240c08,null));};exports[_0xab61('0x36')]=function(_0x541328,_0x2c5a10){return db[_0xab61('0x4e')][_0xab61('0x57')]({'where':{'id':_0x541328[_0xab61('0x52')]['id']}})[_0xab61('0x20')](handleEntityNotFound(_0x2c5a10,null))[_0xab61('0x20')](removeEntity(_0x2c5a10,null))[_0xab61('0x29')](handleError(_0x2c5a10,null));};exports[_0xab61('0x58')]=function(_0x69c170,_0x365c6f){return db[_0xab61('0x4e')]['describe']()[_0xab61('0x20')](respondWithResult(_0x365c6f,null))[_0xab61('0x29')](handleError(_0x365c6f,null));};var interaction_log=require(_0xab61('0x14'))(_0xab61('0x59'));exports[_0xab61('0x5a')]=function(_0x5ae234,_0x4156b9,_0x216fc9){var _0x165591={'agent':{},'channel':_0xab61('0x5b')};if(_0x5ae234['body']['id']){delete _0x5ae234[_0xab61('0x56')]['id'];}_0x5ae234[_0xab61('0x56')][_0xab61('0x5c')]=!![];_0x5ae234[_0xab61('0x56')][_0xab61('0x5d')]=moment()['format'](_0xab61('0x5e'));_0x5ae234[_0xab61('0x56')][_0xab61('0x5f')]=_0x5ae234['body'][_0xab61('0x5f')]||_0x5ae234[_0xab61('0x60')]['id'];_0x165591['agent']['id']=_0x5ae234[_0xab61('0x56')][_0xab61('0x5f')];return db[_0xab61('0x4e')]['find']({'where':{'id':_0x5ae234[_0xab61('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4156b9,null))['then'](saveUpdates(_0x5ae234[_0xab61('0x56')],null))[_0xab61('0x20')](function(_0x307121){if(_0x307121){_0x165591[_0xab61('0x27')]=_0x307121['get']({'plain':!![]});return db[_0xab61('0x61')][_0xab61('0x57')]({'where':{'id':_0x307121[_0xab61('0x62')]}});}return null;})[_0xab61('0x20')](handleEntityNotFound(_0x4156b9,null))[_0xab61('0x20')](function(_0x3f3511){if(_0x3f3511){return _0x3f3511[_0xab61('0x35')]({'UserId':_0x5ae234[_0xab61('0x56')][_0xab61('0x5f')],'read1stAt':_[_0xab61('0x63')](_0x3f3511[_0xab61('0x64')])?moment()[_0xab61('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xab61('0x20')](function(_0x1d5047){if(_0x1d5047){_0x165591[_0xab61('0x66')]=_0x1d5047[_0xab61('0x67')]({'plain':!![]});interaction_log[_0xab61('0x21')](_0xab61('0x68'),_0x5ae234[_0xab61('0x60')]['id'],_0x5ae234['user'][_0xab61('0x39')],_0x5ae234[_0xab61('0x60')][_0xab61('0x69')],_0x165591[_0xab61('0x66')]['id'],_0x5ae234[_0xab61('0x56')]?JSON['stringify'](_0x5ae234['body']):_0xab61('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xab61('0x6b'),_0x165591);}return null;})[_0xab61('0x20')](function(_0x34607b){var _0x3789dc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34607b[_0xab61('0x27')]['ContactId'];return db[_0xab61('0x6c')][_0xab61('0x41')](_0x3789dc,{'type':db['Sequelize'][_0xab61('0x6d')][_0xab61('0x6e')],'raw':!![]})[_0xab61('0x20')](function(_0x502e8e){return _0x502e8e;});})['then'](function(_0x5f4811){if(_0x5f4811){_0x165591[_0xab61('0x27')][_0xab61('0x6f')]=_0x5f4811[0x0];if(!_0x5ae234[_0xab61('0x56')][_0xab61('0x5f')])return;return db[_0xab61('0x70')]['find']({'where':{'id':_0x5ae234[_0xab61('0x56')][_0xab61('0x5f')],'role':_0xab61('0x71')},'attributes':['id',_0xab61('0x39'),_0xab61('0x72'),_0xab61('0x73'),_0xab61('0x74')],'raw':!![]});}return null;})['then'](function(_0x47eb24){if(!_0x47eb24)return null;_0x165591[_0xab61('0x27')][_0xab61('0x71')]=_0x47eb24;return _0x165591;})[_0xab61('0x20')](function(_0x333de0){if(_0x333de0){if(_0x5ae234[_0xab61('0x56')][_0xab61('0x75')]){_0x165591[_0xab61('0x27')][_0xab61('0x76')]=util[_0xab61('0x65')](_0xab61('0x77'),_0x5ae234['user'][_0xab61('0x39')]);_0x165591[_0xab61('0x27')][_0xab61('0x78')]=_0x165591[_0xab61('0x78')];_0x165591[_0xab61('0x27')]['motionChannel']=_0x165591['channel'];_0x165591['message'][_0xab61('0x79')]=_0xab61('0x5a');return respondWithRpcPromise('EventManager',_0xab61('0x7a'),{'event':_0xab61('0x7b'),'message':_0x165591['message']},client9002)[_0xab61('0x20')](function(){return _0x165591;});}return _0x165591;}return null;})[_0xab61('0x20')](respondWithResult(_0x4156b9,null))[_0xab61('0x29')](handleError(_0x4156b9,null));};var interaction_log=require(_0xab61('0x14'))('whatsapp-interactions');exports[_0xab61('0x33')]=function(_0x4440cb,_0x7c7086,_0x4b9f95){var _0x5d2707={'agent':{},'channel':_0xab61('0x5b')};if(_0x4440cb[_0xab61('0x56')]['id']){delete _0x4440cb[_0xab61('0x56')]['id'];}_0x4440cb[_0xab61('0x56')]['UserId']=_0x4440cb[_0xab61('0x56')][_0xab61('0x5f')]||_0x4440cb[_0xab61('0x60')]['id'];_0x5d2707[_0xab61('0x71')]['id']=_0x4440cb[_0xab61('0x56')][_0xab61('0x5f')];return db[_0xab61('0x4e')][_0xab61('0x57')]({'where':{'id':_0x4440cb[_0xab61('0x52')]['id'],'UserId':null}})[_0xab61('0x20')](handleEntityNotFound(_0x7c7086,null))[_0xab61('0x20')](function(_0x2af2c8){if(_0x2af2c8){_0x5d2707[_0xab61('0x27')]=_0x2af2c8[_0xab61('0x67')]({'plain':!![]});return db[_0xab61('0x61')][_0xab61('0x57')]({'where':{'id':_0x2af2c8['WhatsappInteractionId']}});}return null;})[_0xab61('0x20')](handleEntityNotFound(_0x7c7086,null))[_0xab61('0x20')](function(_0x288c30){if(_0x288c30){_0x5d2707[_0xab61('0x66')]=_0x288c30[_0xab61('0x67')]({'plain':!![]});interaction_log[_0xab61('0x21')](_0xab61('0x7c'),_0x4440cb[_0xab61('0x60')]['id'],_0x4440cb[_0xab61('0x60')][_0xab61('0x39')],_0x4440cb[_0xab61('0x60')][_0xab61('0x69')],_0x5d2707['interaction']['id'],_0x4440cb[_0xab61('0x56')]?JSON[_0xab61('0x25')](_0x4440cb[_0xab61('0x56')]):_0xab61('0x6a'));return respondWithRpcPromise(_0xab61('0x7d'),_0xab61('0x7e'),_0x5d2707);}return null;})[_0xab61('0x20')](function(_0x380d41){var _0x1afb98=_0xab61('0x7f')+_0x380d41[_0xab61('0x27')][_0xab61('0x80')];return db['sequelize']['query'](_0x1afb98,{'type':db[_0xab61('0x81')][_0xab61('0x6d')][_0xab61('0x6e')],'raw':!![]})['then'](function(_0x743348){return _0x743348;});})[_0xab61('0x20')](function(_0x1b1e4d){if(_0x1b1e4d){_0x5d2707[_0xab61('0x27')]['contact']=_0x1b1e4d[0x0];if(!_0x4440cb[_0xab61('0x56')][_0xab61('0x5f')])return;return db['User']['find']({'where':{'id':_0x4440cb[_0xab61('0x56')][_0xab61('0x5f')],'role':'agent'},'attributes':['id',_0xab61('0x39'),_0xab61('0x72'),_0xab61('0x73'),'internal'],'raw':!![]});}return null;})[_0xab61('0x20')](function(_0x3da2d){if(!_0x3da2d)return null;_0x5d2707[_0xab61('0x27')][_0xab61('0x71')]=_0x3da2d;return _0x5d2707;})[_0xab61('0x20')](function(_0xbedf74){if(_0xbedf74){_0xbedf74['message'][_0xab61('0x76')]=util[_0xab61('0x65')](_0xab61('0x77'),_0x4440cb[_0xab61('0x60')][_0xab61('0x39')]);_0xbedf74[_0xab61('0x27')]['channel']=_0x5d2707['channel'];_0xbedf74[_0xab61('0x27')][_0xab61('0x82')]=_0x5d2707[_0xab61('0x78')];_0xbedf74[_0xab61('0x27')][_0xab61('0x79')]='reject';respondWithRpcPromise('EventManager',_0xab61('0x7a'),{'event':_0xab61('0x83'),'message':_0xbedf74[_0xab61('0x27')]},client9002);return _0x5d2707;}return null;})[_0xab61('0x20')](respondWithResult(_0x7c7086,null))[_0xab61('0x29')](handleError(_0x7c7086,null));};exports['status']=function(_0x363772,_0x48c9ba,_0x55ed0f){if(_0x363772['body']['id']){delete _0x363772['body']['id'];}var _0x2662d3;return db['WhatsappMessage'][_0xab61('0x57')]({'where':{'id':_0x363772[_0xab61('0x52')]['id']}})[_0xab61('0x20')](handleEntityNotFound(_0x48c9ba,null))[_0xab61('0x20')](function(_0x381817){if(_0x381817){_0x2662d3=_0x381817;return db[_0xab61('0x84')][_0xab61('0x57')]({'where':{'id':_0x381817[_0xab61('0x85')]}});}})[_0xab61('0x20')](handleEntityNotFound(_0x48c9ba,null))[_0xab61('0x20')](function(_0x51e239){if(_0x51e239){logger[_0xab61('0x24')](_0xab61('0x86'),_0xab61('0x2a'),_0xab61('0x87'),_0x51e239[_0xab61('0x4b')],util[_0xab61('0x88')](_0x363772['body'],{'showHidden':![],'depth':null}));switch(_0x51e239[_0xab61('0x4b')]){case _0xab61('0x89'):if(_0x363772[_0xab61('0x56')][_0xab61('0x8a')]&&_0x363772[_0xab61('0x56')][_0xab61('0x8a')]===_0x2662d3[_0xab61('0x8b')]&&_0x363772[_0xab61('0x56')][_0xab61('0x8c')]&&_0x363772['body']['MessageStatus']==='read'){return _0x2662d3[_0xab61('0x35')]({'read':!![]});}else{logger[_0xab61('0x26')](_0xab61('0x8d'),_0xab61('0x2a'),_0xab61('0x89'),util[_0xab61('0x88')](_0x363772[_0xab61('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x2662d3;}})['then'](respondWithResult(_0x48c9ba,null))[_0xab61('0x29')](handleError(_0x48c9ba,null));}; \ No newline at end of file +var _0x2050=['defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','include','options','find','create','body','update','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','isNil','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','WhatsappInteractionId','null','RejectMessage','rejectMessage','User','fullname','event','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1998f5,_0x5382f2){var _0x48a6b0=function(_0x5315c7){while(--_0x5315c7){_0x1998f5['push'](_0x1998f5['shift']());}};_0x48a6b0(++_0x5382f2);}(_0x2050,0x198));var _0x0205=function(_0x579a8f,_0x1fae4c){_0x579a8f=_0x579a8f-0x0;var _0x5c2e33=_0x2050[_0x579a8f];return _0x5c2e33;};'use strict';var emlformat=require(_0x0205('0x0'));var rimraf=require(_0x0205('0x1'));var zipdir=require(_0x0205('0x2'));var jsonpatch=require(_0x0205('0x3'));var rp=require(_0x0205('0x4'));var moment=require(_0x0205('0x5'));var BPromise=require(_0x0205('0x6'));var Mustache=require(_0x0205('0x7'));var util=require(_0x0205('0x8'));var path=require(_0x0205('0x9'));var sox=require(_0x0205('0xa'));var csv=require(_0x0205('0xb'));var ejs=require(_0x0205('0xc'));var fs=require('fs');var fs_extra=require(_0x0205('0xd'));var _=require(_0x0205('0xe'));var squel=require(_0x0205('0xf'));var crypto=require(_0x0205('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x0205('0x11'));var toCsv=require(_0x0205('0xb'));var querystring=require('querystring');var Papa=require(_0x0205('0x12'));var Redis=require(_0x0205('0x13'));var authService=require(_0x0205('0x14'));var qs=require(_0x0205('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0205('0x16'));var logger=require('../../config/logger')(_0x0205('0x17'));var utils=require('../../config/utils');var config=require(_0x0205('0x18'));var licenseUtil=require(_0x0205('0x19'));var db=require(_0x0205('0x1a'))['db'];config['redis']=_[_0x0205('0x1b')](config['redis'],{'host':_0x0205('0x1c'),'port':0x18eb});var socket=require(_0x0205('0x1d'))(new Redis(config['redis']));require(_0x0205('0x1e'))[_0x0205('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0205('0x20')][_0x0205('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x13798e,_0x503ddd,_0x3b7a41,_0x442071){return new BPromise(function(_0x29740f,_0x599648){var _0x240963=_0x442071||client;return _0x240963[_0x0205('0x22')](_0x13798e,_0x3b7a41)[_0x0205('0x23')](function(_0x7222b9){logger['info'](_0x0205('0x24'),_0x503ddd,'request\x20sent');logger['debug'](_0x0205('0x25'),_0x503ddd,'request\x20sent',JSON[_0x0205('0x26')](_0x7222b9));if(_0x7222b9[_0x0205('0x27')]){if(_0x7222b9[_0x0205('0x27')][_0x0205('0x28')]===0x1f4){logger[_0x0205('0x27')](_0x0205('0x24'),_0x503ddd,_0x7222b9['error'][_0x0205('0x29')]);return _0x599648(_0x7222b9[_0x0205('0x27')][_0x0205('0x29')]);}logger['error'](_0x0205('0x24'),_0x503ddd,_0x7222b9[_0x0205('0x27')][_0x0205('0x29')]);return _0x29740f(_0x7222b9[_0x0205('0x27')]['message']);}else{logger[_0x0205('0x2a')](_0x0205('0x24'),_0x503ddd,_0x0205('0x2b'));_0x29740f(_0x7222b9['result'][_0x0205('0x29')]);}})[_0x0205('0x2c')](function(_0x4112a7){logger[_0x0205('0x27')](_0x0205('0x24'),_0x503ddd,_0x4112a7);_0x599648(_0x4112a7);});});}function respondWithStatusCode(_0x104d77,_0x469b05){_0x469b05=_0x469b05||0xcc;return function(_0x162d6f){if(_0x162d6f){return _0x104d77['sendStatus'](_0x469b05);}return _0x104d77[_0x0205('0x2d')](_0x469b05)[_0x0205('0x2e')]();};}function respondWithResult(_0x52d26f,_0x403e15){_0x403e15=_0x403e15||0xc8;return function(_0x1c095f){if(_0x1c095f){return _0x52d26f[_0x0205('0x2d')](_0x403e15)[_0x0205('0x2f')](_0x1c095f);}};}function respondWithFilteredResult(_0x5916d7,_0x274b04){return function(_0x5a38ff){if(_0x5a38ff){var _0x245887=typeof _0x274b04['offset']==='undefined'&&typeof _0x274b04['limit']===_0x0205('0x30');var _0x448248=_0x5a38ff[_0x0205('0x31')];var _0xb50876=_0x245887?0x0:_0x274b04[_0x0205('0x32')];var _0x44e7ee=_0x245887?_0x5a38ff[_0x0205('0x31')]:_0x274b04['offset']+_0x274b04[_0x0205('0x33')];var _0x2c5d13;if(_0x44e7ee>=_0x448248){_0x44e7ee=_0x448248;_0x2c5d13=0xc8;}else{_0x2c5d13=0xce;}_0x5916d7[_0x0205('0x2d')](_0x2c5d13);return _0x5916d7['set'](_0x0205('0x34'),_0xb50876+'-'+_0x44e7ee+'/'+_0x448248)[_0x0205('0x2f')](_0x5a38ff);}return null;};}function patchUpdates(_0x323e78){return function(_0x5cf487){try{jsonpatch['apply'](_0x5cf487,_0x323e78,!![]);}catch(_0x45aa25){return BPromise[_0x0205('0x35')](_0x45aa25);}return _0x5cf487[_0x0205('0x36')]();};}function saveUpdates(_0x1d7dc8,_0x2ad234){return function(_0x36de6a){if(_0x36de6a){return _0x36de6a['update'](_0x1d7dc8)['then'](function(_0x19fa14){return _0x19fa14;});}return null;};}function removeEntity(_0x276516,_0x205d9b){return function(_0x42cd3f){if(_0x42cd3f){return _0x42cd3f[_0x0205('0x37')]()[_0x0205('0x23')](function(){_0x276516[_0x0205('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93e2ee,_0x4f8e16){return function(_0x17dcab){if(!_0x17dcab){_0x93e2ee[_0x0205('0x38')](0x194);}return _0x17dcab;};}function handleError(_0x205554,_0x482b71){_0x482b71=_0x482b71||0x1f4;return function(_0x3f08cd){logger[_0x0205('0x27')](_0x3f08cd[_0x0205('0x39')]);if(_0x3f08cd[_0x0205('0x3a')]){delete _0x3f08cd[_0x0205('0x3a')];}_0x205554[_0x0205('0x2d')](_0x482b71)[_0x0205('0x3b')](_0x3f08cd);};}exports[_0x0205('0x3c')]=function(_0x19a99c,_0x1a21a5){var _0x1c8875={},_0x127472={},_0x239e10={'count':0x0,'rows':[]};var _0x3cee44=_[_0x0205('0x3d')](db[_0x0205('0x3e')][_0x0205('0x3f')],function(_0x51c5e7){return{'name':_0x51c5e7[_0x0205('0x40')],'type':_0x51c5e7[_0x0205('0x41')][_0x0205('0x42')]};});_0x127472[_0x0205('0x43')]=_['map'](_0x3cee44,'name');_0x127472[_0x0205('0x44')]=_['keys'](_0x19a99c[_0x0205('0x44')]);_0x127472[_0x0205('0x45')]=_[_0x0205('0x46')](_0x127472[_0x0205('0x43')],_0x127472[_0x0205('0x44')]);_0x1c8875['attributes']=_['intersection'](_0x127472[_0x0205('0x43')],qs[_0x0205('0x47')](_0x19a99c[_0x0205('0x44')][_0x0205('0x47')]));_0x1c8875['attributes']=_0x1c8875[_0x0205('0x48')][_0x0205('0x49')]?_0x1c8875[_0x0205('0x48')]:_0x127472['model'];if(!_0x19a99c[_0x0205('0x44')][_0x0205('0x4a')](_0x0205('0x4b'))){_0x1c8875[_0x0205('0x33')]=qs['limit'](_0x19a99c[_0x0205('0x44')][_0x0205('0x33')]);_0x1c8875[_0x0205('0x32')]=qs['offset'](_0x19a99c[_0x0205('0x44')][_0x0205('0x32')]);}_0x1c8875[_0x0205('0x4c')]=qs[_0x0205('0x4d')](_0x19a99c[_0x0205('0x44')][_0x0205('0x4d')]);_0x1c8875[_0x0205('0x4e')]=qs['filters'](_[_0x0205('0x4f')](_0x19a99c[_0x0205('0x44')],_0x127472['filters']),_0x3cee44);if(_0x19a99c[_0x0205('0x44')][_0x0205('0x50')]){_0x1c8875[_0x0205('0x4e')]=_[_0x0205('0x51')](_0x1c8875[_0x0205('0x4e')],{'$or':_['map'](_0x3cee44,function(_0x5ae49f){if(_0x5ae49f['type']!==_0x0205('0x52')){var _0x2d0d4b={};_0x2d0d4b[_0x5ae49f[_0x0205('0x3a')]]={'$like':'%'+_0x19a99c[_0x0205('0x44')]['filter']+'%'};return _0x2d0d4b;}})});}_0x1c8875=_[_0x0205('0x51')]({},_0x1c8875,_0x19a99c['options']);var _0x59b272={'where':_0x1c8875[_0x0205('0x4e')]};return db['WhatsappMessage'][_0x0205('0x31')](_0x59b272)[_0x0205('0x23')](function(_0x336578){_0x239e10[_0x0205('0x31')]=_0x336578;if(_0x19a99c['query'][_0x0205('0x53')]){_0x1c8875['include']=[{'all':!![]}];}return db[_0x0205('0x3e')][_0x0205('0x54')](_0x1c8875);})[_0x0205('0x23')](function(_0x3ef287){_0x239e10['rows']=_0x3ef287;return _0x239e10;})[_0x0205('0x23')](respondWithFilteredResult(_0x1a21a5,_0x1c8875))['catch'](handleError(_0x1a21a5,null));};exports[_0x0205('0x55')]=function(_0x1a0f45,_0x4c2590){var _0xb565cd={'raw':!![],'where':{'id':_0x1a0f45[_0x0205('0x56')]['id']}},_0x4df029={};_0x4df029[_0x0205('0x43')]=_['keys'](db[_0x0205('0x3e')][_0x0205('0x3f')]);_0x4df029[_0x0205('0x44')]=_['keys'](_0x1a0f45[_0x0205('0x44')]);_0x4df029[_0x0205('0x45')]=_[_0x0205('0x46')](_0x4df029['model'],_0x4df029[_0x0205('0x44')]);_0xb565cd[_0x0205('0x48')]=_['intersection'](_0x4df029['model'],qs[_0x0205('0x47')](_0x1a0f45[_0x0205('0x44')][_0x0205('0x47')]));_0xb565cd[_0x0205('0x48')]=_0xb565cd[_0x0205('0x48')][_0x0205('0x49')]?_0xb565cd[_0x0205('0x48')]:_0x4df029['model'];if(_0x1a0f45[_0x0205('0x44')][_0x0205('0x53')]){_0xb565cd[_0x0205('0x57')]=[{'all':!![]}];}_0xb565cd=_[_0x0205('0x51')]({},_0xb565cd,_0x1a0f45[_0x0205('0x58')]);return db[_0x0205('0x3e')][_0x0205('0x59')](_0xb565cd)[_0x0205('0x23')](handleEntityNotFound(_0x4c2590,null))['then'](respondWithResult(_0x4c2590,null))['catch'](handleError(_0x4c2590,null));};exports[_0x0205('0x5a')]=function(_0x1704f3,_0x1cc2c3){return db[_0x0205('0x3e')][_0x0205('0x5a')](_0x1704f3[_0x0205('0x5b')],{})['then'](respondWithResult(_0x1cc2c3,0xc9))['catch'](handleError(_0x1cc2c3,null));};exports[_0x0205('0x5c')]=function(_0x4bb61b,_0xc2a9aa){if(_0x4bb61b[_0x0205('0x5b')]['id']){delete _0x4bb61b['body']['id'];}return db[_0x0205('0x3e')][_0x0205('0x59')]({'where':{'id':_0x4bb61b['params']['id']}})['then'](handleEntityNotFound(_0xc2a9aa,null))[_0x0205('0x23')](saveUpdates(_0x4bb61b[_0x0205('0x5b')],null))[_0x0205('0x23')](respondWithResult(_0xc2a9aa,null))[_0x0205('0x2c')](handleError(_0xc2a9aa,null));};exports[_0x0205('0x37')]=function(_0x3673f5,_0x12d7da){return db['WhatsappMessage'][_0x0205('0x59')]({'where':{'id':_0x3673f5['params']['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x12d7da,null))[_0x0205('0x23')](removeEntity(_0x12d7da,null))['catch'](handleError(_0x12d7da,null));};exports['describe']=function(_0x4766fb,_0x1f109f){return db['WhatsappMessage'][_0x0205('0x5d')]()[_0x0205('0x23')](respondWithResult(_0x1f109f,null))['catch'](handleError(_0x1f109f,null));};var interaction_log=require(_0x0205('0x5e'))(_0x0205('0x5f'));exports[_0x0205('0x60')]=function(_0x4bf7c2,_0x4d9f6a,_0x36210e){var _0x467458={'agent':{},'channel':_0x0205('0x61')};if(_0x4bf7c2[_0x0205('0x5b')]['id']){delete _0x4bf7c2['body']['id'];}_0x4bf7c2[_0x0205('0x5b')]['read']=!![];_0x4bf7c2[_0x0205('0x5b')][_0x0205('0x62')]=moment()[_0x0205('0x63')](_0x0205('0x64'));_0x4bf7c2['body'][_0x0205('0x65')]=_0x4bf7c2[_0x0205('0x5b')][_0x0205('0x65')]||_0x4bf7c2[_0x0205('0x66')]['id'];_0x467458[_0x0205('0x67')]['id']=_0x4bf7c2[_0x0205('0x5b')][_0x0205('0x65')];return db['WhatsappMessage'][_0x0205('0x59')]({'where':{'id':_0x4bf7c2[_0x0205('0x56')]['id'],'UserId':null}})[_0x0205('0x23')](handleEntityNotFound(_0x4d9f6a,null))['then'](saveUpdates(_0x4bf7c2[_0x0205('0x5b')],null))[_0x0205('0x23')](function(_0x402696){if(_0x402696){_0x467458['message']=_0x402696['get']({'plain':!![]});return db[_0x0205('0x68')][_0x0205('0x59')]({'where':{'id':_0x402696['WhatsappInteractionId']}});}return null;})[_0x0205('0x23')](handleEntityNotFound(_0x4d9f6a,null))['then'](function(_0x4d880a){if(_0x4d880a){return _0x4d880a[_0x0205('0x5c')]({'UserId':_0x4bf7c2[_0x0205('0x5b')][_0x0205('0x65')],'read1stAt':_[_0x0205('0x69')](_0x4d880a['read1stAt'])?moment()['format'](_0x0205('0x64')):undefined});}return null;})[_0x0205('0x23')](function(_0x30ebe4){if(_0x30ebe4){_0x467458[_0x0205('0x6a')]=_0x30ebe4[_0x0205('0x6b')]({'plain':!![]});interaction_log['info'](_0x0205('0x6c'),_0x4bf7c2['user']['id'],_0x4bf7c2[_0x0205('0x66')]['name'],_0x4bf7c2['user']['role'],_0x467458[_0x0205('0x6a')]['id'],_0x4bf7c2[_0x0205('0x5b')]?JSON[_0x0205('0x26')](_0x4bf7c2[_0x0205('0x5b')]):'null');return respondWithRpcPromise(_0x0205('0x6d'),_0x0205('0x6e'),_0x467458);}return null;})['then'](function(_0x321eb1){var _0x17e11f=_0x0205('0x6f')+_0x321eb1[_0x0205('0x29')][_0x0205('0x70')];return db[_0x0205('0x71')]['query'](_0x17e11f,{'type':db[_0x0205('0x72')][_0x0205('0x73')][_0x0205('0x74')],'raw':!![]})[_0x0205('0x23')](function(_0x354d48){return _0x354d48;});})[_0x0205('0x23')](function(_0x1441a8){if(_0x1441a8){_0x467458[_0x0205('0x29')][_0x0205('0x75')]=_0x1441a8[0x0];if(!_0x4bf7c2[_0x0205('0x5b')]['UserId'])return;return db['User'][_0x0205('0x59')]({'where':{'id':_0x4bf7c2[_0x0205('0x5b')]['UserId'],'role':_0x0205('0x67')},'attributes':['id','name','fullname',_0x0205('0x76'),_0x0205('0x77')],'raw':!![]});}return null;})['then'](function(_0x17dbc7){if(!_0x17dbc7)return null;_0x467458['message'][_0x0205('0x67')]=_0x17dbc7;return _0x467458;})[_0x0205('0x23')](function(_0x4eb5fe){if(_0x4eb5fe){if(_0x4bf7c2[_0x0205('0x5b')][_0x0205('0x78')]){_0x467458[_0x0205('0x29')][_0x0205('0x79')]=util[_0x0205('0x63')](_0x0205('0x7a'),_0x4bf7c2['user'][_0x0205('0x3a')]);_0x467458[_0x0205('0x29')][_0x0205('0x7b')]=_0x467458[_0x0205('0x7b')];_0x467458[_0x0205('0x29')][_0x0205('0x7c')]=_0x467458[_0x0205('0x7b')];_0x467458[_0x0205('0x29')]['event']=_0x0205('0x60');return respondWithRpcPromise(_0x0205('0x7d'),'EventManager',{'event':_0x0205('0x7e'),'message':_0x467458[_0x0205('0x29')]},client9002)['then'](function(){return _0x467458;});}return _0x467458;}return null;})['then'](respondWithResult(_0x4d9f6a,null))['catch'](handleError(_0x4d9f6a,null));};var interaction_log=require(_0x0205('0x5e'))(_0x0205('0x5f'));exports['reject']=function(_0xfb5ded,_0x33ebca,_0x4c9587){var _0x1457cd={'agent':{},'channel':_0x0205('0x61')};if(_0xfb5ded[_0x0205('0x5b')]['id']){delete _0xfb5ded['body']['id'];}_0xfb5ded[_0x0205('0x5b')][_0x0205('0x65')]=_0xfb5ded[_0x0205('0x5b')][_0x0205('0x65')]||_0xfb5ded[_0x0205('0x66')]['id'];_0x1457cd[_0x0205('0x67')]['id']=_0xfb5ded[_0x0205('0x5b')][_0x0205('0x65')];return db[_0x0205('0x3e')]['find']({'where':{'id':_0xfb5ded[_0x0205('0x56')]['id'],'UserId':null}})[_0x0205('0x23')](handleEntityNotFound(_0x33ebca,null))['then'](function(_0x2a3c0f){if(_0x2a3c0f){_0x1457cd[_0x0205('0x29')]=_0x2a3c0f[_0x0205('0x6b')]({'plain':!![]});return db[_0x0205('0x68')]['find']({'where':{'id':_0x2a3c0f[_0x0205('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x33ebca,null))[_0x0205('0x23')](function(_0x37cc78){if(_0x37cc78){_0x1457cd[_0x0205('0x6a')]=_0x37cc78['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfb5ded['user']['id'],_0xfb5ded[_0x0205('0x66')][_0x0205('0x3a')],_0xfb5ded[_0x0205('0x66')]['role'],_0x1457cd['interaction']['id'],_0xfb5ded[_0x0205('0x5b')]?JSON[_0x0205('0x26')](_0xfb5ded[_0x0205('0x5b')]):_0x0205('0x80'));return respondWithRpcPromise(_0x0205('0x81'),_0x0205('0x82'),_0x1457cd);}return null;})[_0x0205('0x23')](function(_0x2bdb5b){var _0x46eacc=_0x0205('0x6f')+_0x2bdb5b[_0x0205('0x29')]['ContactId'];return db['sequelize'][_0x0205('0x44')](_0x46eacc,{'type':db['Sequelize'][_0x0205('0x73')][_0x0205('0x74')],'raw':!![]})['then'](function(_0x27f8a9){return _0x27f8a9;});})[_0x0205('0x23')](function(_0x4d2d2e){if(_0x4d2d2e){_0x1457cd[_0x0205('0x29')]['contact']=_0x4d2d2e[0x0];if(!_0xfb5ded[_0x0205('0x5b')]['UserId'])return;return db[_0x0205('0x83')][_0x0205('0x59')]({'where':{'id':_0xfb5ded[_0x0205('0x5b')][_0x0205('0x65')],'role':'agent'},'attributes':['id','name',_0x0205('0x84'),_0x0205('0x76'),_0x0205('0x77')],'raw':!![]});}return null;})[_0x0205('0x23')](function(_0x425a89){if(!_0x425a89)return null;_0x1457cd[_0x0205('0x29')][_0x0205('0x67')]=_0x425a89;return _0x1457cd;})[_0x0205('0x23')](function(_0x988c6a){if(_0x988c6a){_0x988c6a[_0x0205('0x29')][_0x0205('0x79')]=util[_0x0205('0x63')]('SIP/%s',_0xfb5ded[_0x0205('0x66')][_0x0205('0x3a')]);_0x988c6a[_0x0205('0x29')][_0x0205('0x7b')]=_0x1457cd[_0x0205('0x7b')];_0x988c6a['message'][_0x0205('0x7c')]=_0x1457cd['channel'];_0x988c6a['message'][_0x0205('0x85')]='reject';respondWithRpcPromise(_0x0205('0x7d'),_0x0205('0x7d'),{'event':_0x0205('0x86'),'message':_0x988c6a['message']},client9002);return _0x1457cd;}return null;})[_0x0205('0x23')](respondWithResult(_0x33ebca,null))[_0x0205('0x2c')](handleError(_0x33ebca,null));};exports[_0x0205('0x2d')]=function(_0x12ecfb,_0x5602b4,_0x3fd268){if(_0x12ecfb['body']['id']){delete _0x12ecfb[_0x0205('0x5b')]['id'];}var _0x138d74;return db[_0x0205('0x3e')]['find']({'where':{'id':_0x12ecfb[_0x0205('0x56')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x5602b4,null))[_0x0205('0x23')](function(_0x53507f){if(_0x53507f){_0x138d74=_0x53507f;return db[_0x0205('0x87')][_0x0205('0x59')]({'where':{'id':_0x53507f['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x5602b4,null))[_0x0205('0x23')](function(_0x3640da){if(_0x3640da){logger[_0x0205('0x88')](_0x0205('0x89'),_0x0205('0x2d'),_0x0205('0x8a'),_0x3640da[_0x0205('0x41')],util[_0x0205('0x8b')](_0x12ecfb[_0x0205('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3640da['type']){case'twilio':if(_0x12ecfb[_0x0205('0x5b')][_0x0205('0x8c')]&&_0x12ecfb[_0x0205('0x5b')][_0x0205('0x8c')]===_0x138d74[_0x0205('0x8d')]&&_0x12ecfb[_0x0205('0x5b')][_0x0205('0x8e')]&&_0x12ecfb['body'][_0x0205('0x8e')]===_0x0205('0x8f')){return _0x138d74['update']({'read':!![]});}else{logger[_0x0205('0x27')](_0x0205('0x90'),'status','twilio',util[_0x0205('0x8b')](_0x12ecfb[_0x0205('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x138d74;}})[_0x0205('0x23')](respondWithResult(_0x5602b4,null))[_0x0205('0x2c')](handleError(_0x5602b4,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 32b4101..4e50105 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 _0x6f7a=['events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x249fb4,_0x9a88b2){_0x249fb4=_0x249fb4-0x0;var _0x5dd945=_0x6f7a[_0x249fb4];return _0x5dd945;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var WhatsappMessage=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){WhatsappMessageEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);WhatsappMessageEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];WhatsappMessage[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0972=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x341e43,_0x3020c8){var _0x468dbf=function(_0x3d6807){while(--_0x3d6807){_0x341e43['push'](_0x341e43['shift']());}};_0x468dbf(++_0x3020c8);}(_0x0972,0x64));var _0x2097=function(_0x4c25c0,_0x2e3bd2){_0x4c25c0=_0x4c25c0-0x0;var _0x36c8c5=_0x0972[_0x4c25c0];return _0x36c8c5;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2097('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2097('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2097('0x2'),'afterDestroy':_0x2097('0x3')};function emitEvent(_0x5b16c0){return function(_0x348ad8,_0x431d1c,_0xe6fbae){WhatsappMessageEvents[_0x2097('0x4')](_0x5b16c0+':'+_0x348ad8['id'],_0x348ad8);WhatsappMessageEvents[_0x2097('0x4')](_0x5b16c0,_0x348ad8);_0xe6fbae(null);};}for(var e in events){if(events[_0x2097('0x5')](e)){var event=events[e];WhatsappMessage[_0x2097('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index a7eefc8..983cbe6 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 _0x142c=['type','twilio','accountSid','authToken','messages','create','body','whatsapp:','phone','remote','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','node-fetch','../../config/environment','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','direction','toLowerCase','secret','isNil','WhatsappInteraction','WhatsappInteractionId','update','createdAt','error','out','find','WhatsappAccountId','then'];(function(_0x39e089,_0x5cad80){var _0x24df56=function(_0x5aa3e8){while(--_0x5aa3e8){_0x39e089['push'](_0x39e089['shift']());}};_0x24df56(++_0x5cad80);}(_0x142c,0x86));var _0xc142=function(_0x468cc7,_0x3096d8){_0x468cc7=_0x468cc7-0x0;var _0x329cc6=_0x142c[_0x468cc7];return _0x329cc6;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var logger=require(_0xc142('0x1'))(_0xc142('0x2'));var moment=require(_0xc142('0x3'));var BPromise=require('bluebird');var rp=require(_0xc142('0x4'));var fetch=require(_0xc142('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc142('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0xc142('0x7')]=function(_0x53b32f,_0x2d6796){return _0x53b32f[_0xc142('0x8')](_0xc142('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc142('0xa')]},{'name':_0xc142('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x128066,_0xc9a6a0,_0x565b60){var _0x3009ba=_0x53b32f['models'];var _0x3d404d=_0x128066['get']({'plain':!![]});if(_0x3d404d[_0xc142('0xc')][_0xc142('0xd')]()==='in'||_0x3d404d[_0xc142('0xc')][_0xc142('0xd')]()==='out'&&!_0x3d404d[_0xc142('0xe')]&&!_[_0xc142('0xf')](_0x3d404d['UserId'])){_0x3009ba[_0xc142('0x10')]['findOne']({'where':{'id':_0x3d404d[_0xc142('0x11')]}})['then'](function(_0x589eb8){if(_0x589eb8){_0x589eb8[_0xc142('0x12')]({'lastMsgAt':_0x3d404d[_0xc142('0x13')],'lastMsgDirection':_0x3d404d[_0xc142('0xc')][_0xc142('0xd')]()});}})['catch'](function(_0x2c5364){console[_0xc142('0x14')](_0x2c5364);});}if(_0x3d404d[_0xc142('0xc')]===_0xc142('0x15')&&!_0x3d404d[_0xc142('0xe')]){var _0x410e92;_0x3009ba['WhatsappAccount'][_0xc142('0x16')]({'where':{'id':_0x3d404d[_0xc142('0x17')]},'raw':!![]})[_0xc142('0x18')](function(_0x2ec1f9){_0x410e92=_0x2ec1f9;if(_0x410e92&&_0x410e92[_0xc142('0x19')]){switch(_0x410e92[_0xc142('0x19')]){case _0xc142('0x1a'):var _0x2af054=require(_0xc142('0x1a'));if(_0x410e92[_0xc142('0x1b')]&&_0x410e92[_0xc142('0x1c')]&&_0x410e92['phone']){var _0x557039=new _0x2af054(_0x410e92[_0xc142('0x1b')],_0x410e92['authToken']);_0x557039[_0xc142('0x1d')][_0xc142('0x1e')]({'body':_0x3d404d[_0xc142('0x1f')],'to':_0xc142('0x20')+_0x3d404d[_0xc142('0x21')],'from':_0xc142('0x20')+_0x410e92[_0xc142('0x21')],'statusCallback':_0x410e92[_0xc142('0x22')]+'/api/whatsapp/messages/'+_0x3d404d['id']+_0xc142('0x23')+_0x410e92[_0xc142('0x24')]})[_0xc142('0x18')](function(_0x4190fc){if(_0x4190fc[_0xc142('0x25')]){return _0x128066['update']({'messageId':_0x4190fc[_0xc142('0x25')]});}})[_0xc142('0x26')](function(_0x4e0bdd){logger[_0xc142('0x14')](_0xc142('0x27'),'afterCreate','twilio',util[_0xc142('0x28')](_0x4e0bdd,{'showHidden':![],'depth':null}));});}else{logger[_0xc142('0x14')](_0xc142('0x27'),'afterCreate',_0xc142('0x1a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc142('0x29'):var _0x41762f=_0x410e92['accountSid'];var _0x472372=_0x410e92[_0xc142('0x1c')];var _0x2b90cc=_0x410e92[_0xc142('0x2a')]+_0xc142('0x2b')+_0x41762f+'/messages/';var _0x18ebf5={'to':[_0x3d404d[_0xc142('0x21')]],'message':{'type':_0xc142('0x2c'),'text':_0x3d404d[_0xc142('0x1f')]}};var _0x294020={'method':_0xc142('0x2d'),'uri':_0x2b90cc,'headers':{'Authorization':_0xc142('0x2e')+_0x472372,'Content-Type':_0xc142('0x2f')},'body':_0x18ebf5,'json':!![]};rp(_0x294020)[_0xc142('0x18')](function(_0x52f1dd){if(_0x52f1dd[_0xc142('0x30')][0x0][_0xc142('0x31')]){return _0x128066[_0xc142('0x12')]({'messageId':_0x52f1dd[_0xc142('0x30')][0x0]['message_id']});}})[_0xc142('0x26')](function(_0x49ded9){logger[_0xc142('0x32')]('WhatsappMessage,\x20%s',_0x49ded9);});break;}}})[_0xc142('0x33')](function(){_0x565b60();});}else{_0x565b60();}}},'charset':'utf8mb4','collate':_0xc142('0x34')});}; \ No newline at end of file +var _0x8d05=['sid','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','application/json','statuses','message_id','err','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','secret','type','authToken','accountSid','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token'];(function(_0x597632,_0x2c4c21){var _0x4eafe4=function(_0x46c04e){while(--_0x46c04e){_0x597632['push'](_0x597632['shift']());}};_0x4eafe4(++_0x2c4c21);}(_0x8d05,0x1ad));var _0x58d0=function(_0x19a46d,_0x28c3fb){_0x19a46d=_0x19a46d-0x0;var _0x241dab=_0x8d05[_0x19a46d];return _0x241dab;};'use strict';var _=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var logger=require(_0x58d0('0x2'))(_0x58d0('0x3'));var moment=require(_0x58d0('0x4'));var BPromise=require(_0x58d0('0x5'));var rp=require(_0x58d0('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x58d0('0x7'));var rimraf=require('rimraf');var config=require(_0x58d0('0x8'));var attributes=require(_0x58d0('0x9'));module[_0x58d0('0xa')]=function(_0x52c5d8,_0x141fdf){return _0x52c5d8[_0x58d0('0xb')](_0x58d0('0xc'),attributes,{'tableName':_0x58d0('0xd'),'paranoid':![],'indexes':[{'name':_0x58d0('0xe'),'fields':[_0x58d0('0xe')]},{'name':'fti_whatsapp_messages','fields':[_0x58d0('0xf')],'type':_0x58d0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d28b1,_0x20b7ee,_0x5e3e20){var _0x2ec4aa=_0x52c5d8[_0x58d0('0x11')];var _0x530cda=_0x4d28b1[_0x58d0('0x12')]({'plain':!![]});if(_0x530cda[_0x58d0('0x13')][_0x58d0('0x14')]()==='in'||_0x530cda[_0x58d0('0x13')][_0x58d0('0x14')]()===_0x58d0('0x15')&&!_0x530cda['secret']&&!_[_0x58d0('0x16')](_0x530cda[_0x58d0('0x17')])){_0x2ec4aa['WhatsappInteraction'][_0x58d0('0x18')]({'where':{'id':_0x530cda[_0x58d0('0x19')]}})[_0x58d0('0x1a')](function(_0x278e4b){if(_0x278e4b){_0x278e4b[_0x58d0('0x1b')]({'lastMsgAt':_0x530cda[_0x58d0('0x1c')],'lastMsgDirection':_0x530cda[_0x58d0('0x13')][_0x58d0('0x14')]()});}})[_0x58d0('0x1d')](function(_0x5b7029){console[_0x58d0('0x1e')](_0x5b7029);});}if(_0x530cda[_0x58d0('0x13')]===_0x58d0('0x15')&&!_0x530cda[_0x58d0('0x1f')]){var _0x116819;_0x2ec4aa['WhatsappAccount']['find']({'where':{'id':_0x530cda['WhatsappAccountId']},'raw':!![]})['then'](function(_0xfc8a0c){_0x116819=_0xfc8a0c;if(_0x116819&&_0x116819[_0x58d0('0x20')]){switch(_0x116819[_0x58d0('0x20')]){case'twilio':var _0xd1fbf6=require('twilio');if(_0x116819['accountSid']&&_0x116819[_0x58d0('0x21')]&&_0x116819['phone']){var _0x41aa6a=new _0xd1fbf6(_0x116819[_0x58d0('0x22')],_0x116819[_0x58d0('0x21')]);_0x41aa6a[_0x58d0('0x23')][_0x58d0('0x24')]({'body':_0x530cda['body'],'to':_0x58d0('0x25')+_0x530cda[_0x58d0('0x26')],'from':_0x58d0('0x25')+_0x116819[_0x58d0('0x26')],'statusCallback':_0x116819[_0x58d0('0x27')]+_0x58d0('0x28')+_0x530cda['id']+_0x58d0('0x29')+_0x116819[_0x58d0('0x2a')]})[_0x58d0('0x1a')](function(_0x480064){if(_0x480064[_0x58d0('0x2b')]){return _0x4d28b1['update']({'messageId':_0x480064[_0x58d0('0x2b')]});}})[_0x58d0('0x1d')](function(_0x14b850){logger[_0x58d0('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x58d0('0x2c'),_0x58d0('0x2d'),util[_0x58d0('0x2e')](_0x14b850,{'showHidden':![],'depth':null}));});}else{logger[_0x58d0('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x58d0('0x2c'),'twilio',_0x58d0('0x2f'));}break;case _0x58d0('0x30'):var _0x3ef624=_0x116819[_0x58d0('0x22')];var _0x498a79=_0x116819[_0x58d0('0x21')];var _0x20f192=_0x116819[_0x58d0('0x31')]+_0x58d0('0x32')+_0x3ef624+_0x58d0('0x33');var _0x462659={'to':[_0x530cda[_0x58d0('0x26')]],'message':{'type':_0x58d0('0x34'),'text':_0x530cda[_0x58d0('0xf')]}};var _0x1f8859={'method':'POST','uri':_0x20f192,'headers':{'Authorization':'Bearer\x20'+_0x498a79,'Content-Type':_0x58d0('0x35')},'body':_0x462659,'json':!![]};rp(_0x1f8859)[_0x58d0('0x1a')](function(_0x4ec033){if(_0x4ec033[_0x58d0('0x36')][0x0][_0x58d0('0x37')]){return _0x4d28b1[_0x58d0('0x1b')]({'messageId':_0x4ec033[_0x58d0('0x36')][0x0]['message_id']});}})[_0x58d0('0x1d')](function(_0x1f5a0b){logger[_0x58d0('0x38')]('WhatsappMessage,\x20%s',_0x1f5a0b);});break;}}})['finally'](function(){_0x5e3e20();});}else{_0x5e3e20();}}},'charset':_0x58d0('0x39'),'collate':_0x58d0('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 6025d20..8364bd6 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 _0x62c2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','WhatsappMessage','body','options','raw','then','CreateWhatsappMessage','stringify','lodash','util','bluebird','../../mysqldb'];(function(_0x61a2d6,_0x26f0b3){var _0x2b178c=function(_0x1a6860){while(--_0x1a6860){_0x61a2d6['push'](_0x61a2d6['shift']());}};_0x2b178c(++_0x26f0b3);}(_0x62c2,0x104));var _0x262c=function(_0x21880d,_0x55bb14){_0x21880d=_0x21880d-0x0;var _0x398b56=_0x62c2[_0x21880d];return _0x398b56;};'use strict';var _=require(_0x262c('0x0'));var util=require(_0x262c('0x1'));var moment=require('moment');var BPromise=require(_0x262c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x262c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x262c('0x4'))(_0x262c('0x5'));var config=require(_0x262c('0x6'));var jayson=require(_0x262c('0x7'));var client=jayson[_0x262c('0x8')][_0x262c('0x9')]({'port':0x232a});config[_0x262c('0xa')]=_[_0x262c('0xb')](config[_0x262c('0xa')],{'host':_0x262c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x262c('0xa')]));require(_0x262c('0xd'))[_0x262c('0xe')](socket);function respondWithRpcPromise(_0x452d1d,_0x2a39a2,_0x5f5da5){return new BPromise(function(_0x10c3df,_0x7c3d4){return client[_0x262c('0xf')](_0x452d1d,_0x5f5da5)['then'](function(_0x42c527){logger[_0x262c('0x10')](_0x262c('0x11'),_0x2a39a2,_0x262c('0x12'));logger[_0x262c('0x13')](_0x262c('0x14'),_0x2a39a2,_0x262c('0x12'),JSON['stringify'](_0x42c527));if(_0x42c527[_0x262c('0x15')]){if(_0x42c527[_0x262c('0x15')][_0x262c('0x16')]===0x1f4){logger[_0x262c('0x15')](_0x262c('0x11'),_0x2a39a2,_0x42c527['error'][_0x262c('0x17')]);return _0x7c3d4(_0x42c527['error'][_0x262c('0x17')]);}logger[_0x262c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x2a39a2,_0x42c527[_0x262c('0x15')][_0x262c('0x17')]);return _0x10c3df(_0x42c527[_0x262c('0x15')]['message']);}else{logger[_0x262c('0x10')](_0x262c('0x11'),_0x2a39a2,_0x262c('0x12'));_0x10c3df(_0x42c527[_0x262c('0x18')][_0x262c('0x17')]);}})[_0x262c('0x19')](function(_0x406cce){logger[_0x262c('0x15')](_0x262c('0x11'),_0x2a39a2,_0x406cce);_0x7c3d4(_0x406cce);});});}exports['CreateWhatsappMessage']=function(_0x35e162){var _0x1775a1=this;return new Promise(function(_0x15af5b,_0x3fd0e0){return db[_0x262c('0x1a')]['create'](_0x35e162[_0x262c('0x1b')],{'raw':_0x35e162[_0x262c('0x1c')]?_0x35e162[_0x262c('0x1c')][_0x262c('0x1d')]===undefined?!![]:![]:!![]})[_0x262c('0x1e')](function(_0x425765){logger['info']('CreateWhatsappMessage',_0x35e162);logger[_0x262c('0x13')](_0x262c('0x1f'),_0x35e162,JSON[_0x262c('0x20')](_0x425765));_0x15af5b(_0x425765);})[_0x262c('0x19')](function(_0x29cfed){logger[_0x262c('0x15')]('CreateWhatsappMessage',_0x29cfed[_0x262c('0x17')],_0x35e162);_0x3fd0e0(_0x1775a1[_0x262c('0x15')](0x1f4,_0x29cfed[_0x262c('0x17')]));});});}; \ No newline at end of file +var _0xf07d=['http','defaults','redis','./whatsappMessage.socket','register','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappMessage','create','body','options','raw','info','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1e22c8,_0x538585){var _0x29eaf5=function(_0x52495f){while(--_0x52495f){_0x1e22c8['push'](_0x1e22c8['shift']());}};_0x29eaf5(++_0x538585);}(_0xf07d,0x11a));var _0xdf07=function(_0x182384,_0x370b58){_0x182384=_0x182384-0x0;var _0x255f8d=_0xf07d[_0x182384];return _0x255f8d;};'use strict';var _=require(_0xdf07('0x0'));var util=require(_0xdf07('0x1'));var moment=require(_0xdf07('0x2'));var BPromise=require(_0xdf07('0x3'));var rs=require(_0xdf07('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf07('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdf07('0x6'));var jayson=require(_0xdf07('0x7'));var client=jayson['client'][_0xdf07('0x8')]({'port':0x232a});config['redis']=_[_0xdf07('0x9')](config[_0xdf07('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf07('0xa')]));require(_0xdf07('0xb'))[_0xdf07('0xc')](socket);function respondWithRpcPromise(_0x7703bc,_0x1e101d,_0x3ec4da){return new BPromise(function(_0x12b5be,_0x2b30bb){return client['request'](_0x7703bc,_0x3ec4da)['then'](function(_0x578376){logger['info'](_0xdf07('0xd'),_0x1e101d,_0xdf07('0xe'));logger[_0xdf07('0xf')](_0xdf07('0x10'),_0x1e101d,_0xdf07('0xe'),JSON[_0xdf07('0x11')](_0x578376));if(_0x578376[_0xdf07('0x12')]){if(_0x578376['error']['code']===0x1f4){logger[_0xdf07('0x12')](_0xdf07('0xd'),_0x1e101d,_0x578376[_0xdf07('0x12')][_0xdf07('0x13')]);return _0x2b30bb(_0x578376[_0xdf07('0x12')][_0xdf07('0x13')]);}logger[_0xdf07('0x12')](_0xdf07('0xd'),_0x1e101d,_0x578376[_0xdf07('0x12')][_0xdf07('0x13')]);return _0x12b5be(_0x578376[_0xdf07('0x12')][_0xdf07('0x13')]);}else{logger['info'](_0xdf07('0xd'),_0x1e101d,_0xdf07('0xe'));_0x12b5be(_0x578376[_0xdf07('0x14')][_0xdf07('0x13')]);}})[_0xdf07('0x15')](function(_0xcd2755){logger['error'](_0xdf07('0xd'),_0x1e101d,_0xcd2755);_0x2b30bb(_0xcd2755);});});}exports['CreateWhatsappMessage']=function(_0x583904){var _0x497c26=this;return new Promise(function(_0x427a74,_0x4f8010){return db[_0xdf07('0x16')][_0xdf07('0x17')](_0x583904[_0xdf07('0x18')],{'raw':_0x583904[_0xdf07('0x19')]?_0x583904[_0xdf07('0x19')][_0xdf07('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x31e607){logger[_0xdf07('0x1b')](_0xdf07('0x1c'),_0x583904);logger[_0xdf07('0xf')](_0xdf07('0x1c'),_0x583904,JSON[_0xdf07('0x11')](_0x31e607));_0x427a74(_0x31e607);})['catch'](function(_0x43c9e6){logger['error'](_0xdf07('0x1c'),_0x43c9e6[_0xdf07('0x13')],_0x583904);_0x4f8010(_0x497c26[_0xdf07('0x12')](0x1f4,_0x43c9e6['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d8b961d..a2118f3 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 _0x71e4=['length','./whatsappMessage.events','save','remove','emit','removeListener','register'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x71e4,0x119));var _0x471e=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x71e4[_0x319784];return _0x1917da;};'use strict';var WhatsappMessageEvents=require(_0x471e('0x0'));var events=[_0x471e('0x1'),_0x471e('0x2'),'update'];function createListener(_0x474dc8,_0x3eeae7){return function(_0xc5c4ca){_0x3eeae7[_0x471e('0x3')](_0x474dc8,_0xc5c4ca);};}function removeListener(_0x489d03,_0x284e6e){return function(){WhatsappMessageEvents[_0x471e('0x4')](_0x489d03,_0x284e6e);};}exports[_0x471e('0x5')]=function(_0x1dc4c9){for(var _0x45847f=0x0,_0x7a9335=events[_0x471e('0x6')];_0x45847f<_0x7a9335;_0x45847f++){var _0x275f1e=events[_0x45847f];var _0x581cc0=createListener('whatsappMessage:'+_0x275f1e,_0x1dc4c9);WhatsappMessageEvents['on'](_0x275f1e,_0x581cc0);}}; \ No newline at end of file +var _0x9b6c=['update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x535722,_0x260c84){var _0x43fc78=function(_0x4c8745){while(--_0x4c8745){_0x535722['push'](_0x535722['shift']());}};_0x43fc78(++_0x260c84);}(_0x9b6c,0x13e));var _0xc9b6=function(_0x768d2a,_0x40c96e){_0x768d2a=_0x768d2a-0x0;var _0x15130b=_0x9b6c[_0x768d2a];return _0x15130b;};'use strict';var WhatsappMessageEvents=require(_0xc9b6('0x0'));var events=[_0xc9b6('0x1'),'remove',_0xc9b6('0x2')];function createListener(_0x2ed359,_0x1a8722){return function(_0x42a756){_0x1a8722[_0xc9b6('0x3')](_0x2ed359,_0x42a756);};}function removeListener(_0xd28755,_0x2fabb3){return function(){WhatsappMessageEvents[_0xc9b6('0x4')](_0xd28755,_0x2fabb3);};}exports[_0xc9b6('0x5')]=function(_0x11a57a){for(var _0xe1dc70=0x0,_0x3a8fcd=events[_0xc9b6('0x6')];_0xe1dc70<_0x3a8fcd;_0xe1dc70++){var _0x157256=events[_0xe1dc70];var _0x16150c=createListener(_0xc9b6('0x7')+_0x157256,_0x11a57a);WhatsappMessageEvents['on'](_0x157256,_0x16150c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 2828046..4b70d8f 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 _0xda72=['/:id','/:id/members','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','/:id/teams','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','index','get','isAuthenticated','describe'];(function(_0x95980a,_0x38c0e8){var _0x36613=function(_0x3e14c9){while(--_0x3e14c9){_0x95980a['push'](_0x95980a['shift']());}};_0x36613(++_0x38c0e8);}(_0xda72,0x174));var _0x2da7=function(_0x50e066,_0x81d508){_0x50e066=_0x50e066-0x0;var _0x5dc76f=_0xda72[_0x50e066];return _0x5dc76f;};'use strict';var multer=require(_0x2da7('0x0'));var util=require(_0x2da7('0x1'));var path=require(_0x2da7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2da7('0x3')]();var fs_extra=require(_0x2da7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2da7('0x5'));var config=require(_0x2da7('0x6'));var controller=require(_0x2da7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2da7('0x8')]);router[_0x2da7('0x9')]('/describe',auth[_0x2da7('0xa')](),controller[_0x2da7('0xb')]);router['get'](_0x2da7('0xc'),auth[_0x2da7('0xa')](),controller['show']);router[_0x2da7('0x9')](_0x2da7('0xd'),auth[_0x2da7('0xa')](),controller['getMembers']);router[_0x2da7('0x9')]('/:id/teams',auth[_0x2da7('0xa')](),controller['getTeams']);router[_0x2da7('0x9')](_0x2da7('0xe'),auth[_0x2da7('0xa')](),controller[_0x2da7('0xf')]);router[_0x2da7('0x10')]('/',auth[_0x2da7('0xa')](),controller[_0x2da7('0x11')]);router[_0x2da7('0x10')]('/:id/teams',auth[_0x2da7('0xa')](),controller[_0x2da7('0x12')]);router['post']('/:id/users',auth[_0x2da7('0xa')](),controller[_0x2da7('0x13')]);router['put'](_0x2da7('0xc'),auth[_0x2da7('0xa')](),controller[_0x2da7('0x14')]);router[_0x2da7('0x15')](_0x2da7('0xc'),auth[_0x2da7('0xa')](),controller['destroy']);router[_0x2da7('0x15')](_0x2da7('0x16'),auth[_0x2da7('0xa')](),controller['removeTeams']);router[_0x2da7('0x15')]('/:id/users',auth[_0x2da7('0xa')](),controller[_0x2da7('0x17')]);module['exports']=router; \ No newline at end of file +var _0x154f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','get','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','/:id','delete','removeAgents','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x154f,0xf9));var _0xf154=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x154f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf154('0x0'));var util=require(_0xf154('0x1'));var path=require(_0xf154('0x2'));var timeout=require(_0xf154('0x3'));var express=require(_0xf154('0x4'));var router=express[_0xf154('0x5')]();var fs_extra=require(_0xf154('0x6'));var auth=require(_0xf154('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf154('0x8'));var controller=require(_0xf154('0x9'));router['get']('/',auth[_0xf154('0xa')](),controller[_0xf154('0xb')]);router['get'](_0xf154('0xc'),auth[_0xf154('0xa')](),controller['describe']);router[_0xf154('0xd')]('/:id',auth[_0xf154('0xa')](),controller[_0xf154('0xe')]);router[_0xf154('0xd')]('/:id/members',auth[_0xf154('0xa')](),controller[_0xf154('0xf')]);router[_0xf154('0xd')](_0xf154('0x10'),auth[_0xf154('0xa')](),controller[_0xf154('0x11')]);router[_0xf154('0xd')](_0xf154('0x12'),auth[_0xf154('0xa')](),controller[_0xf154('0x13')]);router[_0xf154('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf154('0x14')]('/:id/teams',auth[_0xf154('0xa')](),controller[_0xf154('0x15')]);router[_0xf154('0x14')](_0xf154('0x12'),auth[_0xf154('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0xf154('0xa')](),controller['update']);router['delete'](_0xf154('0x16'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xf154('0x10'),auth[_0xf154('0xa')](),controller['removeTeams']);router[_0xf154('0x17')](_0xf154('0x12'),auth[_0xf154('0xa')](),controller[_0xf154('0x18')]);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 3b04626..48a7b62 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 _0x9567=['INTEGER','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x4dcecc,_0x3865b9){var _0x2aa658=function(_0x334d85){while(--_0x334d85){_0x4dcecc['push'](_0x4dcecc['shift']());}};_0x2aa658(++_0x3865b9);}(_0x9567,0xdc));var _0x7956=function(_0x3b4730,_0x5823ef){_0x3b4730=_0x3b4730-0x0;var _0xaa06c7=_0x9567[_0x3b4730];return _0xaa06c7;};'use strict';var Sequelize=require(_0x7956('0x0'));module[_0x7956('0x1')]={'name':{'type':Sequelize[_0x7956('0x2')],'unique':_0x7956('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7956('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7956('0x5'),_0x7956('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbbfa=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3b584b,_0x39dc34){var _0x38559d=function(_0x2cbf9e){while(--_0x2cbf9e){_0x3b584b['push'](_0x3b584b['shift']());}};_0x38559d(++_0x39dc34);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0xbbfa[_0x3c5f8d];return _0x3b7beb;};'use strict';var Sequelize=require(_0xabbf('0x0'));module['exports']={'name':{'type':Sequelize[_0xabbf('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xabbf('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xabbf('0x3')](_0xabbf('0x4'),_0xabbf('0x5'),_0xabbf('0x6'))},'description':{'type':Sequelize[_0xabbf('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4dca28e..bc281bb 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 _0x559b=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','WhatsappQueues','UserProfileResource','then','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserWhatsappQueue','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','SIP','updatedAt','getTeams','Team','hasOwnProperty','addTeams','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','from','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','removeTeams','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','findOne','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xc26e6d,_0x2886f0){var _0x4f49f0=function(_0xa1f8d2){while(--_0xa1f8d2){_0xc26e6d['push'](_0xc26e6d['shift']());}};_0x4f49f0(++_0x2886f0);}(_0x559b,0x105));var _0xb559=function(_0x34fbee,_0xc24eaa){_0x34fbee=_0x34fbee-0x0;var _0x289c90=_0x559b[_0x34fbee];return _0x289c90;};'use strict';var emlformat=require(_0xb559('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb559('0x1'));var jsonpatch=require(_0xb559('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb559('0x3'));var Mustache=require(_0xb559('0x4'));var util=require(_0xb559('0x5'));var path=require('path');var sox=require(_0xb559('0x6'));var csv=require('to-csv');var ejs=require(_0xb559('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb559('0x8'));var squel=require(_0xb559('0x9'));var crypto=require(_0xb559('0xa'));var jsforce=require(_0xb559('0xb'));var deskjs=require(_0xb559('0xc'));var toCsv=require(_0xb559('0xd'));var querystring=require('querystring');var Papa=require(_0xb559('0xe'));var Redis=require(_0xb559('0xf'));var authService=require(_0xb559('0x10'));var qs=require(_0xb559('0x11'));var as=require(_0xb559('0x12'));var hardwareService=require(_0xb559('0x13'));var logger=require(_0xb559('0x14'))(_0xb559('0x15'));var utils=require(_0xb559('0x16'));var config=require(_0xb559('0x17'));var licenseUtil=require(_0xb559('0x18'));var db=require('../../mysqldb')['db'];config[_0xb559('0x19')]=_[_0xb559('0x1a')](config[_0xb559('0x19')],{'host':_0xb559('0x1b'),'port':0x18eb});var socket=require(_0xb559('0x1c'))(new Redis(config[_0xb559('0x19')]));require(_0xb559('0x1d'))['register'](socket);function respondWithStatusCode(_0xcaa03f,_0x8095c3){_0x8095c3=_0x8095c3||0xcc;return function(_0x58d787){if(_0x58d787){return _0xcaa03f['sendStatus'](_0x8095c3);}return _0xcaa03f['status'](_0x8095c3)[_0xb559('0x1e')]();};}function respondWithResult(_0x2a045d,_0x357882){_0x357882=_0x357882||0xc8;return function(_0x25d8a1){if(_0x25d8a1){return _0x2a045d[_0xb559('0x1f')](_0x357882)[_0xb559('0x20')](_0x25d8a1);}};}function respondWithFilteredResult(_0x1cf305,_0x2c0cfd){return function(_0x3afa90){if(_0x3afa90){var _0x3ae4f0=typeof _0x2c0cfd[_0xb559('0x21')]===_0xb559('0x22')&&typeof _0x2c0cfd['limit']==='undefined';var _0x8f9de5=_0x3afa90[_0xb559('0x23')];var _0x18796a=_0x3ae4f0?0x0:_0x2c0cfd['offset'];var _0x25a639=_0x3ae4f0?_0x3afa90[_0xb559('0x23')]:_0x2c0cfd[_0xb559('0x21')]+_0x2c0cfd[_0xb559('0x24')];var _0x13392f;if(_0x25a639>=_0x8f9de5){_0x25a639=_0x8f9de5;_0x13392f=0xc8;}else{_0x13392f=0xce;}_0x1cf305[_0xb559('0x1f')](_0x13392f);return _0x1cf305[_0xb559('0x25')](_0xb559('0x26'),_0x18796a+'-'+_0x25a639+'/'+_0x8f9de5)[_0xb559('0x20')](_0x3afa90);}return null;};}function patchUpdates(_0x104284){return function(_0x3282e9){try{jsonpatch[_0xb559('0x27')](_0x3282e9,_0x104284,!![]);}catch(_0x46bb92){return BPromise['reject'](_0x46bb92);}return _0x3282e9[_0xb559('0x28')]();};}function saveUpdates(_0x29358e,_0x1a1536){return function(_0x16e548){if(_0x16e548){return _0x16e548[_0xb559('0x29')](_0x29358e)['then'](function(_0x5c78b6){return _0x5c78b6;});}return null;};}function removeEntity(_0x2d3157,_0x3f640b){return function(_0x1bf755){if(_0x1bf755){return _0x1bf755[_0xb559('0x2a')]()['then'](function(){var _0x26d268=_0x1bf755[_0xb559('0x2b')]({'plain':!![]});var _0x12c655=_0xb559('0x2c');return db[_0xb559('0x2d')]['destroy']({'where':{'type':_0x12c655,'resourceId':_0x26d268['id']}})[_0xb559('0x2e')](function(){return _0x1bf755;});})[_0xb559('0x2e')](function(){_0x2d3157[_0xb559('0x1f')](0xcc)[_0xb559('0x1e')]();});}};}function handleEntityNotFound(_0x132b5d,_0x22f74b){return function(_0x469dcf){if(!_0x469dcf){_0x132b5d['sendStatus'](0x194);}return _0x469dcf;};}function handleError(_0x1e6370,_0x1f819d){_0x1f819d=_0x1f819d||0x1f4;return function(_0x3237b3){logger['error'](_0x3237b3[_0xb559('0x2f')]);if(_0x3237b3[_0xb559('0x30')]){delete _0x3237b3[_0xb559('0x30')];}_0x1e6370[_0xb559('0x1f')](_0x1f819d)[_0xb559('0x31')](_0x3237b3);};}exports[_0xb559('0x32')]=function(_0x407d00,_0x5ae9dc){var _0x4186ae={},_0x3bc5e0={},_0x3745e0={'count':0x0,'rows':[]};var _0x38e38a=_[_0xb559('0x33')](db[_0xb559('0x34')][_0xb559('0x35')],function(_0x1aa57c){return{'name':_0x1aa57c[_0xb559('0x36')],'type':_0x1aa57c[_0xb559('0x37')][_0xb559('0x38')]};});_0x3bc5e0[_0xb559('0x39')]=_[_0xb559('0x33')](_0x38e38a,'name');_0x3bc5e0[_0xb559('0x3a')]=_['keys'](_0x407d00[_0xb559('0x3a')]);_0x3bc5e0[_0xb559('0x3b')]=_[_0xb559('0x3c')](_0x3bc5e0[_0xb559('0x39')],_0x3bc5e0[_0xb559('0x3a')]);_0x4186ae[_0xb559('0x3d')]=_[_0xb559('0x3c')](_0x3bc5e0['model'],qs['fields'](_0x407d00['query']['fields']));_0x4186ae[_0xb559('0x3d')]=_0x4186ae[_0xb559('0x3d')]['length']?_0x4186ae[_0xb559('0x3d')]:_0x3bc5e0[_0xb559('0x39')];if(!_0x407d00['query']['hasOwnProperty'](_0xb559('0x3e'))){_0x4186ae[_0xb559('0x24')]=qs['limit'](_0x407d00[_0xb559('0x3a')]['limit']);_0x4186ae['offset']=qs[_0xb559('0x21')](_0x407d00['query'][_0xb559('0x21')]);}_0x4186ae[_0xb559('0x3f')]=qs[_0xb559('0x40')](_0x407d00[_0xb559('0x3a')]['sort']);_0x4186ae[_0xb559('0x41')]=qs[_0xb559('0x3b')](_['pick'](_0x407d00[_0xb559('0x3a')],_0x3bc5e0['filters']),_0x38e38a);if(_0x407d00[_0xb559('0x3a')]['filter']){_0x4186ae[_0xb559('0x41')]=_[_0xb559('0x42')](_0x4186ae[_0xb559('0x41')],{'$or':_[_0xb559('0x33')](_0x38e38a,function(_0xb880f0){if(_0xb880f0['type']!==_0xb559('0x43')){var _0x399fba={};_0x399fba[_0xb880f0[_0xb559('0x30')]]={'$like':'%'+_0x407d00[_0xb559('0x3a')][_0xb559('0x44')]+'%'};return _0x399fba;}})});}_0x4186ae=_[_0xb559('0x42')]({},_0x4186ae,_0x407d00['options']);var _0x45a992={'where':_0x4186ae['where']};return db[_0xb559('0x34')][_0xb559('0x23')](_0x45a992)[_0xb559('0x2e')](function(_0x1d6d94){_0x3745e0[_0xb559('0x23')]=_0x1d6d94;if(_0x407d00[_0xb559('0x3a')][_0xb559('0x45')]){_0x4186ae[_0xb559('0x46')]=[{'all':!![]}];}return db[_0xb559('0x34')][_0xb559('0x47')](_0x4186ae);})[_0xb559('0x2e')](function(_0xc30c12){_0x3745e0[_0xb559('0x48')]=_0xc30c12;return _0x3745e0;})['then'](respondWithFilteredResult(_0x5ae9dc,_0x4186ae))[_0xb559('0x49')](handleError(_0x5ae9dc,null));};exports[_0xb559('0x4a')]=function(_0x1119ba,_0x155d22){var _0x563e74={'raw':!![],'where':{'id':_0x1119ba['params']['id']}},_0x50141d={};_0x50141d[_0xb559('0x39')]=_[_0xb559('0x4b')](db[_0xb559('0x34')][_0xb559('0x35')]);_0x50141d[_0xb559('0x3a')]=_['keys'](_0x1119ba['query']);_0x50141d['filters']=_[_0xb559('0x3c')](_0x50141d[_0xb559('0x39')],_0x50141d[_0xb559('0x3a')]);_0x563e74['attributes']=_[_0xb559('0x3c')](_0x50141d[_0xb559('0x39')],qs['fields'](_0x1119ba['query'][_0xb559('0x4c')]));_0x563e74[_0xb559('0x3d')]=_0x563e74[_0xb559('0x3d')][_0xb559('0x4d')]?_0x563e74[_0xb559('0x3d')]:_0x50141d['model'];if(_0x1119ba[_0xb559('0x3a')][_0xb559('0x45')]){_0x563e74[_0xb559('0x46')]=[{'all':!![]}];}_0x563e74=_[_0xb559('0x42')]({},_0x563e74,_0x1119ba[_0xb559('0x4e')]);return db[_0xb559('0x34')][_0xb559('0x4f')](_0x563e74)[_0xb559('0x2e')](handleEntityNotFound(_0x155d22,null))[_0xb559('0x2e')](respondWithResult(_0x155d22,null))[_0xb559('0x49')](handleError(_0x155d22,null));};exports[_0xb559('0x50')]=function(_0x3cb62c,_0x45665){return db[_0xb559('0x34')][_0xb559('0x50')](_0x3cb62c[_0xb559('0x51')],{})[_0xb559('0x2e')](function(_0x173b62){var _0x4baa7a=_0x3cb62c[_0xb559('0x52')][_0xb559('0x2b')]({'plain':!![]});if(!_0x4baa7a)throw new Error(_0xb559('0x53'));if(_0x4baa7a[_0xb559('0x54')]===_0xb559('0x52')){var _0x32885a=_0x173b62['get']({'plain':!![]});var _0x3a4d45=_0xb559('0x2c');return db[_0xb559('0x55')]['find']({'where':{'name':_0x3a4d45,'userProfileId':_0x4baa7a[_0xb559('0x56')]},'raw':!![]})[_0xb559('0x2e')](function(_0x40d9fe){if(_0x40d9fe&&_0x40d9fe[_0xb559('0x57')]===0x0){return db[_0xb559('0x2d')][_0xb559('0x50')]({'name':_0x32885a[_0xb559('0x30')],'resourceId':_0x32885a['id'],'type':_0x40d9fe[_0xb559('0x30')],'sectionId':_0x40d9fe['id']},{})[_0xb559('0x2e')](function(){return _0x173b62;});}else{return _0x173b62;}})['catch'](function(_0x2abd8d){logger['error'](_0xb559('0x58'),_0x2abd8d);throw _0x2abd8d;});}return _0x173b62;})[_0xb559('0x2e')](respondWithResult(_0x45665,0xc9))[_0xb559('0x49')](handleError(_0x45665,null));};exports['update']=function(_0x3eac9f,_0xac659d){if(_0x3eac9f[_0xb559('0x51')]['id']){delete _0x3eac9f[_0xb559('0x51')]['id'];}return db[_0xb559('0x34')]['find']({'where':{'id':_0x3eac9f[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0xac659d,null))['then'](saveUpdates(_0x3eac9f[_0xb559('0x51')],null))[_0xb559('0x2e')](respondWithResult(_0xac659d,null))[_0xb559('0x49')](handleError(_0xac659d,null));};exports[_0xb559('0x2a')]=function(_0x70e3b8,_0xe1bb5f){return db[_0xb559('0x34')][_0xb559('0x4f')]({'where':{'id':_0x70e3b8[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0xe1bb5f,null))['then'](removeEntity(_0xe1bb5f,null))[_0xb559('0x49')](handleError(_0xe1bb5f,null));};exports[_0xb559('0x5a')]=function(_0x28958f,_0x2c51bf){return db['WhatsappQueue'][_0xb559('0x5a')]()[_0xb559('0x2e')](respondWithResult(_0x2c51bf,null))[_0xb559('0x49')](handleError(_0x2c51bf,null));};exports['getMembers']=function(_0x3a514f,_0x73b22c,_0x16ec23){var _0x1b3c93={'raw':!![],'where':{}},_0xd885e1={},_0x2259ed;return db[_0xb559('0x34')]['findOne']({'where':{'id':_0x3a514f[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0x73b22c,null))[_0xb559('0x2e')](function(_0x5f8a6){if(_0x5f8a6){_0x2259ed=_0x5f8a6[_0xb559('0x2b')]({'plain':!![]});_0xd885e1[_0xb559('0x39')]=_['keys'](db[_0xb559('0x5b')][_0xb559('0x35')]);_0xd885e1['query']=_[_0xb559('0x4b')](_0x3a514f[_0xb559('0x3a')]);_0xd885e1['filters']=_[_0xb559('0x3c')](_0xd885e1[_0xb559('0x39')],_0xd885e1[_0xb559('0x3a')]);_0x1b3c93[_0xb559('0x3d')]=_['intersection'](_0xd885e1['model'],qs['fields'](_0x3a514f[_0xb559('0x3a')][_0xb559('0x4c')]));_0x1b3c93[_0xb559('0x3d')]=_0x1b3c93['attributes']['length']?_0x1b3c93['attributes']:_0xd885e1[_0xb559('0x39')];if(!_0x3a514f[_0xb559('0x3a')]['hasOwnProperty']('nolimit')){_0x1b3c93[_0xb559('0x24')]=qs[_0xb559('0x24')](_0x3a514f[_0xb559('0x3a')][_0xb559('0x24')]);_0x1b3c93[_0xb559('0x21')]=qs[_0xb559('0x21')](_0x3a514f[_0xb559('0x3a')][_0xb559('0x21')]);}_0x1b3c93['order']=qs[_0xb559('0x40')](_0x3a514f[_0xb559('0x3a')][_0xb559('0x40')]);_0x1b3c93['where']=qs[_0xb559('0x3b')](_[_0xb559('0x5c')](_0x3a514f[_0xb559('0x3a')],_0xd885e1[_0xb559('0x3b')]));_0x1b3c93[_0xb559('0x41')][_0xb559('0x5d')]=_0x5f8a6['id'];if(_0x3a514f[_0xb559('0x3a')][_0xb559('0x44')]){_0x1b3c93[_0xb559('0x41')]=_[_0xb559('0x42')](_0x1b3c93['where'],{'$or':_[_0xb559('0x33')](_0x1b3c93[_0xb559('0x3d')],function(_0x1f4e0f){var _0x5ec65e={};_0x5ec65e[_0x1f4e0f]={'$like':'%'+_0x3a514f[_0xb559('0x3a')][_0xb559('0x44')]+'%'};return _0x5ec65e;})});}_0x1b3c93=_[_0xb559('0x42')]({},_0x1b3c93,_0x3a514f[_0xb559('0x4e')]);return db[_0xb559('0x5b')][_0xb559('0x47')](_0x1b3c93);}})[_0xb559('0x2e')](function(_0x4aafda){if(_0x4aafda){return db[_0xb559('0x5e')][_0xb559('0x5f')]({'where':{'id':_['map'](_0x4aafda,_0xb559('0x60')),'role':_0xb559('0x61')},'attributes':['id','name',_0xb559('0x62'),'updatedAt',_0xb559('0x63')]});}})[_0xb559('0x2e')](function(_0x32c2aa){if(_0x32c2aa){return{'count':_0x32c2aa[_0xb559('0x23')],'rows':_[_0xb559('0x33')](_0x32c2aa[_0xb559('0x48')],function(_0x50b87e){return{'membername':_0x50b87e[_0xb559('0x30')],'UserId':_0x50b87e['id'],'queue_name':_0x2259ed[_0xb559('0x30')],'WhatsappQueueId':_0x2259ed['id'],'interface':util[_0xb559('0x64')]('%s/%s',_0xb559('0x65'),_0x50b87e['name']),'penalty':0x0,'paused':_0x50b87e['whatsappPause'],'createdAt':_0x50b87e[_0xb559('0x63')],'updatedAt':_0x50b87e[_0xb559('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb559('0x2e')](respondWithFilteredResult(_0x73b22c,_0x1b3c93))[_0xb559('0x49')](handleError(_0x73b22c,null));};exports[_0xb559('0x67')]=function(_0x2364b5,_0x3dae98,_0x46d133){var _0x4b169b={};var _0x100ac7={};var _0x2a59f4;var _0x29ac31;return db[_0xb559('0x34')]['findOne']({'where':{'id':_0x2364b5[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0x3dae98,null))[_0xb559('0x2e')](function(_0x298e2b){if(_0x298e2b){_0x2a59f4=_0x298e2b;_0x100ac7['model']=_[_0xb559('0x4b')](db[_0xb559('0x68')][_0xb559('0x35')]);_0x100ac7[_0xb559('0x3a')]=_[_0xb559('0x4b')](_0x2364b5[_0xb559('0x3a')]);_0x100ac7[_0xb559('0x3b')]=_['intersection'](_0x100ac7[_0xb559('0x39')],_0x100ac7['query']);_0x4b169b[_0xb559('0x3d')]=_[_0xb559('0x3c')](_0x100ac7['model'],qs[_0xb559('0x4c')](_0x2364b5[_0xb559('0x3a')]['fields']));_0x4b169b[_0xb559('0x3d')]=_0x4b169b[_0xb559('0x3d')]['length']?_0x4b169b['attributes']:_0x100ac7[_0xb559('0x39')];_0x4b169b[_0xb559('0x3f')]=qs[_0xb559('0x40')](_0x2364b5[_0xb559('0x3a')]['sort']);_0x4b169b[_0xb559('0x41')]=qs[_0xb559('0x3b')](_['pick'](_0x2364b5[_0xb559('0x3a')],_0x100ac7[_0xb559('0x3b')]));if(_0x2364b5[_0xb559('0x3a')][_0xb559('0x44')]){_0x4b169b[_0xb559('0x41')]=_['merge'](_0x4b169b[_0xb559('0x41')],{'$or':_[_0xb559('0x33')](_0x4b169b[_0xb559('0x3d')],function(_0x271294){var _0x2190b6={};_0x2190b6[_0x271294]={'$like':'%'+_0x2364b5[_0xb559('0x3a')][_0xb559('0x44')]+'%'};return _0x2190b6;})});}_0x4b169b=_[_0xb559('0x42')]({},_0x4b169b,_0x2364b5[_0xb559('0x4e')]);return _0x2a59f4[_0xb559('0x67')](_0x4b169b);}})[_0xb559('0x2e')](function(_0x3019e5){if(_0x3019e5){_0x29ac31=_0x3019e5[_0xb559('0x4d')];if(!_0x2364b5[_0xb559('0x3a')][_0xb559('0x69')](_0xb559('0x3e'))){_0x4b169b[_0xb559('0x24')]=qs[_0xb559('0x24')](_0x2364b5[_0xb559('0x3a')][_0xb559('0x24')]);_0x4b169b[_0xb559('0x21')]=qs[_0xb559('0x21')](_0x2364b5[_0xb559('0x3a')][_0xb559('0x21')]);}return _0x2a59f4[_0xb559('0x67')](_0x4b169b);}})[_0xb559('0x2e')](function(_0x5e26f0){if(_0x5e26f0){return _0x5e26f0?{'count':_0x29ac31,'rows':_0x5e26f0}:null;}})[_0xb559('0x2e')](respondWithResult(_0x3dae98,null))[_0xb559('0x49')](handleError(_0x3dae98,null));};exports[_0xb559('0x6a')]=function(_0x26303e,_0x132282,_0x186eaf){var _0x52ec77=_0x26303e[_0xb559('0x51')]['ids'];return db[_0xb559('0x68')][_0xb559('0x47')]({'where':{'id':_0x52ec77},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xb559('0x6b'),_0xb559('0x6c'),'interface'],'raw':!![]}]})[_0xb559('0x2e')](function(_0x426e9b){if(_0x426e9b){var _0x19c639=_[_0xb559('0x6d')](_0x426e9b,function(_0x333ac8){var _0x224ebd=_0x333ac8[_0xb559('0x2b')]({'plain':!![]});return _0x224ebd[_0xb559('0x6e')];});return db[_0xb559('0x34')][_0xb559('0x4f')]({'where':{'id':_0x26303e[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](function(_0x38f408){return db[_0xb559('0x6f')][_0xb559('0x70')](function(_0x364a06){return _0x38f408[_0xb559('0x6a')](_0x52ec77,{'transaction':_0x364a06})[_0xb559('0x2e')](function(){return BPromise[_0xb559('0x71')](_0x19c639,function(_0x3c2175){return db['UserWhatsappQueue'][_0xb559('0x72')]({'where':{'UserId':_0x3c2175['id'],'WhatsappQueueId':_0x26303e[_0xb559('0x59')]['id']},'transaction':_0x364a06});});})[_0xb559('0x2e')](function(){_0x19c639[_0xb559('0x73')](function(_0x24eba5){socket[_0xb559('0x74')](_0xb559('0x75'),{'UserId':_0x24eba5['id'],'WhatsappQueueId':_0x38f408['id']});});});});});}})[_0xb559('0x2e')](respondWithStatusCode(_0x132282,null))['catch'](handleError(_0x132282,null));};exports['removeTeams']=function(_0x2bc4d0,_0x477e7f,_0xbc56b1){return db[_0xb559('0x68')][_0xb559('0x47')]({'where':{'id':_0x2bc4d0['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xb559('0x5e')],'as':_0xb559('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x477e7f,null))['then'](function(_0x8dc7f7){var _0x26ab2a=_[_0xb559('0x33')](_0x8dc7f7,'id');var _0x30596a=[];var _0x192b0a=[];var _0x4c0000=squel[_0xb559('0x76')]();_0x4c0000['field']('tq.TeamId')[_0xb559('0x77')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb559('0x41')](_0xb559('0x78'),_0x2bc4d0[_0xb559('0x59')]['id']);for(var _0x23e79e=0x0;_0x23e79e<_0x8dc7f7[_0xb559('0x4d')];_0x23e79e+=0x1){let _0x33bf3d=_0x8dc7f7[_0x23e79e];for(var _0x5f4be7=0x0;_0x5f4be7<_0x33bf3d['Agents'][_0xb559('0x4d')];_0x5f4be7+=0x1){let _0x11f9a6=_0x33bf3d[_0xb559('0x6e')][_0x5f4be7];var _0x228897=_0x4c0000[_0xb559('0x79')]();_0x228897['where'](_0xb559('0x7a'),_0x11f9a6['id']);_0x192b0a[_0xb559('0x7b')](db['sequelize'][_0xb559('0x3a')](_0x228897[_0xb559('0x7c')](),{'type':db[_0xb559('0x6f')][_0xb559('0x7d')][_0xb559('0x7e')]})[_0xb559('0x2e')](function(_0x3e47e3){if(_0x3e47e3[_0xb559('0x4d')]===0x1){return _0x11f9a6['id'];}else{var _0x2a3034=_[_0xb559('0x7f')](_[_0xb559('0x33')](_0x3e47e3,_0xb559('0x80')),function(_0x17ebf8){return _['includes'](_0x26ab2a,_0x17ebf8);});if(_0x2a3034){return _0x11f9a6['id'];}}}));}}return BPromise[_0xb559('0x81')](_0x192b0a)[_0xb559('0x2e')](function(_0x1de801){_0x30596a=_(_0x30596a)[_0xb559('0x82')](_0x1de801)['compact']()[_0xb559('0x83')]();return db[_0xb559('0x34')]['find']({'where':{'id':_0x2bc4d0[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](function(_0x577049){return db[_0xb559('0x6f')]['transaction'](function(_0x3a4314){return _0x577049[_0xb559('0x84')](_0x2bc4d0['query'][_0xb559('0x85')],{'transaction':_0x3a4314})[_0xb559('0x2e')](function(){if(!_[_0xb559('0x86')](_0x30596a)){return _0x577049[_0xb559('0x87')](_0x30596a,{'transaction':_0x3a4314});}})[_0xb559('0x2e')](function(){_0x30596a[_0xb559('0x73')](function(_0x59c69d){socket[_0xb559('0x74')](_0xb559('0x88'),{'UserId':_0x59c69d,'WhatsappQueueId':_0x577049['id']});});});});});});})[_0xb559('0x2e')](respondWithStatusCode(_0x477e7f,null))['catch'](handleError(_0x477e7f,null));};exports[_0xb559('0x89')]=function(_0xeb848f,_0x28ad7b,_0x5e532c){return db['WhatsappQueue'][_0xb559('0x4f')]({'where':{'id':_0xeb848f[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0x28ad7b,null))[_0xb559('0x2e')](function(_0x35470b){if(_0x35470b){return _0x35470b[_0xb559('0x89')](_0xeb848f['body'][_0xb559('0x85')],_[_0xb559('0x8a')](_0xeb848f[_0xb559('0x51')],['ids','id'])||{})[_0xb559('0x8b')](function(_0xb9a245){for(var _0x272cb6=0x0;_0x272cb6<_0xeb848f['body'][_0xb559('0x85')]['length'];_0x272cb6+=0x1){socket[_0xb559('0x74')](_0xb559('0x75'),{'UserId':Number(_0xeb848f['body']['ids'][_0x272cb6]),'WhatsappQueueId':Number(_0xeb848f[_0xb559('0x59')]['id'])});}return _0xb9a245;});}})['then'](respondWithResult(_0x28ad7b,null))[_0xb559('0x49')](handleError(_0x28ad7b,null));};exports[_0xb559('0x87')]=function(_0x2af725,_0x52e381,_0x32d75f){return db[_0xb559('0x34')][_0xb559('0x4f')]({'where':{'id':_0x2af725[_0xb559('0x59')]['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0x52e381,null))[_0xb559('0x2e')](function(_0x26fff5){if(_0x26fff5){return _0x26fff5[_0xb559('0x87')](_0x2af725[_0xb559('0x3a')][_0xb559('0x85')])[_0xb559('0x2e')](function(){if(_['isArray'](_0x2af725[_0xb559('0x3a')]['ids'])){for(var _0x12ad56=0x0;_0x12ad56<_0x2af725[_0xb559('0x3a')][_0xb559('0x85')][_0xb559('0x4d')];_0x12ad56+=0x1){socket['emit'](_0xb559('0x88'),{'UserId':Number(_0x2af725[_0xb559('0x3a')][_0xb559('0x85')][_0x12ad56]),'WhatsappQueueId':Number(_0x2af725[_0xb559('0x59')]['id'])});}}else{socket[_0xb559('0x74')](_0xb559('0x88'),{'UserId':Number(_0x2af725[_0xb559('0x3a')][_0xb559('0x85')]),'WhatsappQueueId':Number(_0x2af725[_0xb559('0x59')]['id'])});}});}})[_0xb559('0x2e')](respondWithStatusCode(_0x52e381,null))[_0xb559('0x49')](handleError(_0x52e381,null));};exports[_0xb559('0x8c')]=function(_0x303050,_0x28723c,_0x33820d){var _0x402581={};var _0xf3cbbc={};var _0x4b2b6b;var _0x492c48;return db['WhatsappQueue'][_0xb559('0x8d')]({'where':{'id':_0x303050['params']['id']}})[_0xb559('0x2e')](handleEntityNotFound(_0x28723c,null))[_0xb559('0x2e')](function(_0x56bf32){if(_0x56bf32){_0x4b2b6b=_0x56bf32;_0xf3cbbc[_0xb559('0x39')]=_[_0xb559('0x4b')](db[_0xb559('0x5e')][_0xb559('0x35')]);_0xf3cbbc[_0xb559('0x3a')]=_[_0xb559('0x4b')](_0x303050[_0xb559('0x3a')]);_0xf3cbbc[_0xb559('0x3b')]=_[_0xb559('0x3c')](_0xf3cbbc[_0xb559('0x39')],_0xf3cbbc[_0xb559('0x3a')]);_0x402581[_0xb559('0x3d')]=_[_0xb559('0x3c')](_0xf3cbbc[_0xb559('0x39')],qs[_0xb559('0x4c')](_0x303050[_0xb559('0x3a')]['fields']));_0x402581['attributes']=_0x402581['attributes'][_0xb559('0x4d')]?_0x402581[_0xb559('0x3d')]:_0xf3cbbc[_0xb559('0x39')];_0x402581['order']=qs['sort'](_0x303050['query'][_0xb559('0x40')]);_0x402581[_0xb559('0x41')]=qs[_0xb559('0x3b')](_['pick'](_0x303050[_0xb559('0x3a')],_0xf3cbbc[_0xb559('0x3b')]));if(_0x303050[_0xb559('0x3a')]['filter']){_0x402581[_0xb559('0x41')]=_[_0xb559('0x42')](_0x402581[_0xb559('0x41')],{'$or':_['map'](_0x402581[_0xb559('0x3d')],function(_0x42f0f2){var _0x49c432={};_0x49c432[_0x42f0f2]={'$like':'%'+_0x303050[_0xb559('0x3a')]['filter']+'%'};return _0x49c432;})});}_0x402581=_[_0xb559('0x42')]({},_0x402581,_0x303050[_0xb559('0x4e')]);return _0x4b2b6b['getAgents'](_0x402581);}})[_0xb559('0x2e')](function(_0x4f61e6){if(_0x4f61e6){_0x492c48=_0x4f61e6['length'];if(!_0x303050['query'][_0xb559('0x69')]('nolimit')){_0x402581[_0xb559('0x24')]=qs[_0xb559('0x24')](_0x303050[_0xb559('0x3a')][_0xb559('0x24')]);_0x402581[_0xb559('0x21')]=qs[_0xb559('0x21')](_0x303050[_0xb559('0x3a')][_0xb559('0x21')]);}return _0x4b2b6b[_0xb559('0x8c')](_0x402581);}})['then'](function(_0x952ad7){if(_0x952ad7){return _0x952ad7?{'count':_0x492c48,'rows':_0x952ad7}:null;}})[_0xb559('0x2e')](respondWithResult(_0x28723c,null))['catch'](handleError(_0x28723c,null));}; \ No newline at end of file +var _0x1f6e=['get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','VIRTUAL','options','include','findAll','catch','show','merge','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','params','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','%s/%s','getTeams','ids','Agents','interface','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','Team','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','destroy','then'];(function(_0x4b6cbb,_0x3c5123){var _0x4366a9=function(_0x185e26){while(--_0x185e26){_0x4b6cbb['push'](_0x4b6cbb['shift']());}};_0x4366a9(++_0x3c5123);}(_0x1f6e,0x172));var _0xe1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe1f6('0x0'));var rimraf=require(_0xe1f6('0x1'));var zipdir=require(_0xe1f6('0x2'));var jsonpatch=require(_0xe1f6('0x3'));var rp=require(_0xe1f6('0x4'));var moment=require(_0xe1f6('0x5'));var BPromise=require(_0xe1f6('0x6'));var Mustache=require(_0xe1f6('0x7'));var util=require('util');var path=require(_0xe1f6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe1f6('0x9'));var fs=require('fs');var fs_extra=require(_0xe1f6('0xa'));var _=require(_0xe1f6('0xb'));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(_0xe1f6('0xc'));var Papa=require(_0xe1f6('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe1f6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1f6('0xf'));var logger=require(_0xe1f6('0x10'))(_0xe1f6('0x11'));var utils=require(_0xe1f6('0x12'));var config=require(_0xe1f6('0x13'));var licenseUtil=require(_0xe1f6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe1f6('0x15')](config[_0xe1f6('0x16')],{'host':_0xe1f6('0x17'),'port':0x18eb});var socket=require(_0xe1f6('0x18'))(new Redis(config[_0xe1f6('0x16')]));require(_0xe1f6('0x19'))['register'](socket);function respondWithStatusCode(_0x1f5e27,_0x27d7e5){_0x27d7e5=_0x27d7e5||0xcc;return function(_0x3d83cc){if(_0x3d83cc){return _0x1f5e27[_0xe1f6('0x1a')](_0x27d7e5);}return _0x1f5e27[_0xe1f6('0x1b')](_0x27d7e5)[_0xe1f6('0x1c')]();};}function respondWithResult(_0x4ffcf5,_0x3d3313){_0x3d3313=_0x3d3313||0xc8;return function(_0x21ff1f){if(_0x21ff1f){return _0x4ffcf5[_0xe1f6('0x1b')](_0x3d3313)['json'](_0x21ff1f);}};}function respondWithFilteredResult(_0x3aa1a3,_0x3f93b6){return function(_0x49da73){if(_0x49da73){var _0x1f7984=typeof _0x3f93b6['offset']==='undefined'&&typeof _0x3f93b6[_0xe1f6('0x1d')]===_0xe1f6('0x1e');var _0x4f417f=_0x49da73[_0xe1f6('0x1f')];var _0x3e0189=_0x1f7984?0x0:_0x3f93b6[_0xe1f6('0x20')];var _0x42ae16=_0x1f7984?_0x49da73['count']:_0x3f93b6[_0xe1f6('0x20')]+_0x3f93b6[_0xe1f6('0x1d')];var _0x4ba67a;if(_0x42ae16>=_0x4f417f){_0x42ae16=_0x4f417f;_0x4ba67a=0xc8;}else{_0x4ba67a=0xce;}_0x3aa1a3[_0xe1f6('0x1b')](_0x4ba67a);return _0x3aa1a3[_0xe1f6('0x21')](_0xe1f6('0x22'),_0x3e0189+'-'+_0x42ae16+'/'+_0x4f417f)[_0xe1f6('0x23')](_0x49da73);}return null;};}function patchUpdates(_0x2124e5){return function(_0x60367f){try{jsonpatch[_0xe1f6('0x24')](_0x60367f,_0x2124e5,!![]);}catch(_0x196ccf){return BPromise['reject'](_0x196ccf);}return _0x60367f[_0xe1f6('0x25')]();};}function saveUpdates(_0x3c15c6,_0x3b7867){return function(_0x26c761){if(_0x26c761){return _0x26c761[_0xe1f6('0x26')](_0x3c15c6)['then'](function(_0x3dc868){return _0x3dc868;});}return null;};}function removeEntity(_0x2bd86f,_0x54143c){return function(_0x4e0afd){if(_0x4e0afd){return _0x4e0afd[_0xe1f6('0x27')]()[_0xe1f6('0x28')](function(){var _0x44c0f0=_0x4e0afd[_0xe1f6('0x29')]({'plain':!![]});var _0x167910=_0xe1f6('0x2a');return db[_0xe1f6('0x2b')][_0xe1f6('0x27')]({'where':{'type':_0x167910,'resourceId':_0x44c0f0['id']}})[_0xe1f6('0x28')](function(){return _0x4e0afd;});})[_0xe1f6('0x28')](function(){_0x2bd86f[_0xe1f6('0x1b')](0xcc)[_0xe1f6('0x1c')]();});}};}function handleEntityNotFound(_0x5f4740,_0x357ccc){return function(_0x155e9d){if(!_0x155e9d){_0x5f4740['sendStatus'](0x194);}return _0x155e9d;};}function handleError(_0x11b523,_0x363085){_0x363085=_0x363085||0x1f4;return function(_0x4ad2ca){logger[_0xe1f6('0x2c')](_0x4ad2ca[_0xe1f6('0x2d')]);if(_0x4ad2ca[_0xe1f6('0x2e')]){delete _0x4ad2ca[_0xe1f6('0x2e')];}_0x11b523['status'](_0x363085)[_0xe1f6('0x2f')](_0x4ad2ca);};}exports[_0xe1f6('0x30')]=function(_0x25c8c1,_0x2e7930){var _0x51b1f5={},_0x40f2bc={},_0x264cb3={'count':0x0,'rows':[]};var _0x119e38=_[_0xe1f6('0x31')](db[_0xe1f6('0x32')][_0xe1f6('0x33')],function(_0x3dd65d){return{'name':_0x3dd65d[_0xe1f6('0x34')],'type':_0x3dd65d[_0xe1f6('0x35')][_0xe1f6('0x36')]};});_0x40f2bc[_0xe1f6('0x37')]=_['map'](_0x119e38,_0xe1f6('0x2e'));_0x40f2bc[_0xe1f6('0x38')]=_[_0xe1f6('0x39')](_0x25c8c1[_0xe1f6('0x38')]);_0x40f2bc['filters']=_[_0xe1f6('0x3a')](_0x40f2bc['model'],_0x40f2bc[_0xe1f6('0x38')]);_0x51b1f5[_0xe1f6('0x3b')]=_[_0xe1f6('0x3a')](_0x40f2bc['model'],qs[_0xe1f6('0x3c')](_0x25c8c1[_0xe1f6('0x38')][_0xe1f6('0x3c')]));_0x51b1f5['attributes']=_0x51b1f5[_0xe1f6('0x3b')][_0xe1f6('0x3d')]?_0x51b1f5['attributes']:_0x40f2bc[_0xe1f6('0x37')];if(!_0x25c8c1[_0xe1f6('0x38')]['hasOwnProperty']('nolimit')){_0x51b1f5[_0xe1f6('0x1d')]=qs[_0xe1f6('0x1d')](_0x25c8c1[_0xe1f6('0x38')]['limit']);_0x51b1f5[_0xe1f6('0x20')]=qs[_0xe1f6('0x20')](_0x25c8c1[_0xe1f6('0x38')][_0xe1f6('0x20')]);}_0x51b1f5[_0xe1f6('0x3e')]=qs[_0xe1f6('0x3f')](_0x25c8c1[_0xe1f6('0x38')][_0xe1f6('0x3f')]);_0x51b1f5[_0xe1f6('0x40')]=qs[_0xe1f6('0x41')](_['pick'](_0x25c8c1['query'],_0x40f2bc[_0xe1f6('0x41')]),_0x119e38);if(_0x25c8c1[_0xe1f6('0x38')][_0xe1f6('0x42')]){_0x51b1f5[_0xe1f6('0x40')]=_['merge'](_0x51b1f5[_0xe1f6('0x40')],{'$or':_[_0xe1f6('0x31')](_0x119e38,function(_0x5b563d){if(_0x5b563d['type']!==_0xe1f6('0x43')){var _0x1cc932={};_0x1cc932[_0x5b563d['name']]={'$like':'%'+_0x25c8c1[_0xe1f6('0x38')]['filter']+'%'};return _0x1cc932;}})});}_0x51b1f5=_['merge']({},_0x51b1f5,_0x25c8c1[_0xe1f6('0x44')]);var _0x36f619={'where':_0x51b1f5['where']};return db[_0xe1f6('0x32')][_0xe1f6('0x1f')](_0x36f619)[_0xe1f6('0x28')](function(_0x2f60d5){_0x264cb3[_0xe1f6('0x1f')]=_0x2f60d5;if(_0x25c8c1['query']['includeAll']){_0x51b1f5[_0xe1f6('0x45')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xe1f6('0x46')](_0x51b1f5);})[_0xe1f6('0x28')](function(_0x39db82){_0x264cb3['rows']=_0x39db82;return _0x264cb3;})[_0xe1f6('0x28')](respondWithFilteredResult(_0x2e7930,_0x51b1f5))[_0xe1f6('0x47')](handleError(_0x2e7930,null));};exports[_0xe1f6('0x48')]=function(_0x1becbc,_0x68a272){var _0x4c3a87={'raw':!![],'where':{'id':_0x1becbc['params']['id']}},_0x18a234={};_0x18a234[_0xe1f6('0x37')]=_[_0xe1f6('0x39')](db[_0xe1f6('0x32')][_0xe1f6('0x33')]);_0x18a234[_0xe1f6('0x38')]=_[_0xe1f6('0x39')](_0x1becbc[_0xe1f6('0x38')]);_0x18a234[_0xe1f6('0x41')]=_[_0xe1f6('0x3a')](_0x18a234[_0xe1f6('0x37')],_0x18a234[_0xe1f6('0x38')]);_0x4c3a87[_0xe1f6('0x3b')]=_['intersection'](_0x18a234[_0xe1f6('0x37')],qs[_0xe1f6('0x3c')](_0x1becbc['query'][_0xe1f6('0x3c')]));_0x4c3a87[_0xe1f6('0x3b')]=_0x4c3a87['attributes']['length']?_0x4c3a87[_0xe1f6('0x3b')]:_0x18a234['model'];if(_0x1becbc['query']['includeAll']){_0x4c3a87[_0xe1f6('0x45')]=[{'all':!![]}];}_0x4c3a87=_[_0xe1f6('0x49')]({},_0x4c3a87,_0x1becbc[_0xe1f6('0x44')]);return db[_0xe1f6('0x32')][_0xe1f6('0x4a')](_0x4c3a87)[_0xe1f6('0x28')](handleEntityNotFound(_0x68a272,null))['then'](respondWithResult(_0x68a272,null))['catch'](handleError(_0x68a272,null));};exports[_0xe1f6('0x4b')]=function(_0x26f692,_0x1839b5){return db[_0xe1f6('0x32')]['create'](_0x26f692[_0xe1f6('0x4c')],{})['then'](function(_0x25ea4a){var _0x51f243=_0x26f692['user'][_0xe1f6('0x29')]({'plain':!![]});if(!_0x51f243)throw new Error(_0xe1f6('0x4d'));if(_0x51f243[_0xe1f6('0x4e')]===_0xe1f6('0x4f')){var _0x12fd86=_0x25ea4a[_0xe1f6('0x29')]({'plain':!![]});var _0x2a36ee='WhatsappQueues';return db[_0xe1f6('0x50')][_0xe1f6('0x4a')]({'where':{'name':_0x2a36ee,'userProfileId':_0x51f243[_0xe1f6('0x51')]},'raw':!![]})[_0xe1f6('0x28')](function(_0x45b6b0){if(_0x45b6b0&&_0x45b6b0[_0xe1f6('0x52')]===0x0){return db[_0xe1f6('0x2b')][_0xe1f6('0x4b')]({'name':_0x12fd86[_0xe1f6('0x2e')],'resourceId':_0x12fd86['id'],'type':_0x45b6b0[_0xe1f6('0x2e')],'sectionId':_0x45b6b0['id']},{})[_0xe1f6('0x28')](function(){return _0x25ea4a;});}else{return _0x25ea4a;}})[_0xe1f6('0x47')](function(_0x43a2bc){logger['error'](_0xe1f6('0x53'),_0x43a2bc);throw _0x43a2bc;});}return _0x25ea4a;})[_0xe1f6('0x28')](respondWithResult(_0x1839b5,0xc9))[_0xe1f6('0x47')](handleError(_0x1839b5,null));};exports['update']=function(_0x495266,_0x4ad599){if(_0x495266[_0xe1f6('0x4c')]['id']){delete _0x495266[_0xe1f6('0x4c')]['id'];}return db[_0xe1f6('0x32')]['find']({'where':{'id':_0x495266['params']['id']}})[_0xe1f6('0x28')](handleEntityNotFound(_0x4ad599,null))[_0xe1f6('0x28')](saveUpdates(_0x495266[_0xe1f6('0x4c')],null))['then'](respondWithResult(_0x4ad599,null))[_0xe1f6('0x47')](handleError(_0x4ad599,null));};exports['destroy']=function(_0x3b733d,_0xa2c785){return db[_0xe1f6('0x32')]['find']({'where':{'id':_0x3b733d[_0xe1f6('0x54')]['id']}})[_0xe1f6('0x28')](handleEntityNotFound(_0xa2c785,null))[_0xe1f6('0x28')](removeEntity(_0xa2c785,null))[_0xe1f6('0x47')](handleError(_0xa2c785,null));};exports['describe']=function(_0x250e79,_0x20bf4c){return db[_0xe1f6('0x32')][_0xe1f6('0x55')]()[_0xe1f6('0x28')](respondWithResult(_0x20bf4c,null))[_0xe1f6('0x47')](handleError(_0x20bf4c,null));};exports[_0xe1f6('0x56')]=function(_0x1a0ba1,_0x11ef41,_0x10221d){var _0xc3774a={'raw':!![],'where':{}},_0x2b41c8={},_0x83eb4e;return db[_0xe1f6('0x32')][_0xe1f6('0x57')]({'where':{'id':_0x1a0ba1[_0xe1f6('0x54')]['id']}})[_0xe1f6('0x28')](handleEntityNotFound(_0x11ef41,null))[_0xe1f6('0x28')](function(_0x4c9702){if(_0x4c9702){_0x83eb4e=_0x4c9702['get']({'plain':!![]});_0x2b41c8['model']=_[_0xe1f6('0x39')](db[_0xe1f6('0x58')]['rawAttributes']);_0x2b41c8[_0xe1f6('0x38')]=_['keys'](_0x1a0ba1[_0xe1f6('0x38')]);_0x2b41c8[_0xe1f6('0x41')]=_[_0xe1f6('0x3a')](_0x2b41c8[_0xe1f6('0x37')],_0x2b41c8[_0xe1f6('0x38')]);_0xc3774a[_0xe1f6('0x3b')]=_[_0xe1f6('0x3a')](_0x2b41c8['model'],qs['fields'](_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x3c')]));_0xc3774a[_0xe1f6('0x3b')]=_0xc3774a['attributes']['length']?_0xc3774a[_0xe1f6('0x3b')]:_0x2b41c8[_0xe1f6('0x37')];if(!_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x59')](_0xe1f6('0x5a'))){_0xc3774a[_0xe1f6('0x1d')]=qs[_0xe1f6('0x1d')](_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x1d')]);_0xc3774a['offset']=qs[_0xe1f6('0x20')](_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x20')]);}_0xc3774a[_0xe1f6('0x3e')]=qs[_0xe1f6('0x3f')](_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x3f')]);_0xc3774a[_0xe1f6('0x40')]=qs[_0xe1f6('0x41')](_[_0xe1f6('0x5b')](_0x1a0ba1[_0xe1f6('0x38')],_0x2b41c8[_0xe1f6('0x41')]));_0xc3774a['where'][_0xe1f6('0x5c')]=_0x4c9702['id'];if(_0x1a0ba1[_0xe1f6('0x38')][_0xe1f6('0x42')]){_0xc3774a[_0xe1f6('0x40')]=_['merge'](_0xc3774a['where'],{'$or':_[_0xe1f6('0x31')](_0xc3774a['attributes'],function(_0x44cfb4){var _0x105158={};_0x105158[_0x44cfb4]={'$like':'%'+_0x1a0ba1['query']['filter']+'%'};return _0x105158;})});}_0xc3774a=_[_0xe1f6('0x49')]({},_0xc3774a,_0x1a0ba1[_0xe1f6('0x44')]);return db[_0xe1f6('0x58')][_0xe1f6('0x46')](_0xc3774a);}})[_0xe1f6('0x28')](function(_0x9bca74){if(_0x9bca74){return db[_0xe1f6('0x5d')][_0xe1f6('0x5e')]({'where':{'id':_[_0xe1f6('0x31')](_0x9bca74,_0xe1f6('0x5f')),'role':_0xe1f6('0x60')},'attributes':['id','name',_0xe1f6('0x61'),_0xe1f6('0x62'),'createdAt']});}})[_0xe1f6('0x28')](function(_0x18ed7a){if(_0x18ed7a){return{'count':_0x18ed7a['count'],'rows':_[_0xe1f6('0x31')](_0x18ed7a[_0xe1f6('0x63')],function(_0x1c641e){return{'membername':_0x1c641e[_0xe1f6('0x2e')],'UserId':_0x1c641e['id'],'queue_name':_0x83eb4e[_0xe1f6('0x2e')],'WhatsappQueueId':_0x83eb4e['id'],'interface':util['format'](_0xe1f6('0x64'),'SIP',_0x1c641e[_0xe1f6('0x2e')]),'penalty':0x0,'paused':_0x1c641e['whatsappPause'],'createdAt':_0x1c641e['createdAt'],'updatedAt':_0x1c641e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x11ef41,_0xc3774a))[_0xe1f6('0x47')](handleError(_0x11ef41,null));};exports[_0xe1f6('0x65')]=function(_0x506c61,_0x5a5cf3,_0x36588b){var _0x58d722={};var _0x17472b={};var _0x46e009;var _0x5bf686;return db['WhatsappQueue'][_0xe1f6('0x57')]({'where':{'id':_0x506c61['params']['id']}})[_0xe1f6('0x28')](handleEntityNotFound(_0x5a5cf3,null))[_0xe1f6('0x28')](function(_0x6d59d2){if(_0x6d59d2){_0x46e009=_0x6d59d2;_0x17472b[_0xe1f6('0x37')]=_[_0xe1f6('0x39')](db['Team'][_0xe1f6('0x33')]);_0x17472b['query']=_[_0xe1f6('0x39')](_0x506c61[_0xe1f6('0x38')]);_0x17472b[_0xe1f6('0x41')]=_[_0xe1f6('0x3a')](_0x17472b[_0xe1f6('0x37')],_0x17472b['query']);_0x58d722[_0xe1f6('0x3b')]=_[_0xe1f6('0x3a')](_0x17472b['model'],qs[_0xe1f6('0x3c')](_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x3c')]));_0x58d722[_0xe1f6('0x3b')]=_0x58d722[_0xe1f6('0x3b')][_0xe1f6('0x3d')]?_0x58d722[_0xe1f6('0x3b')]:_0x17472b['model'];_0x58d722['order']=qs[_0xe1f6('0x3f')](_0x506c61[_0xe1f6('0x38')]['sort']);_0x58d722['where']=qs[_0xe1f6('0x41')](_[_0xe1f6('0x5b')](_0x506c61['query'],_0x17472b[_0xe1f6('0x41')]));if(_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x42')]){_0x58d722[_0xe1f6('0x40')]=_[_0xe1f6('0x49')](_0x58d722[_0xe1f6('0x40')],{'$or':_['map'](_0x58d722[_0xe1f6('0x3b')],function(_0x4b53aa){var _0x201260={};_0x201260[_0x4b53aa]={'$like':'%'+_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x42')]+'%'};return _0x201260;})});}_0x58d722=_['merge']({},_0x58d722,_0x506c61['options']);return _0x46e009[_0xe1f6('0x65')](_0x58d722);}})[_0xe1f6('0x28')](function(_0x2a6d89){if(_0x2a6d89){_0x5bf686=_0x2a6d89['length'];if(!_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x59')](_0xe1f6('0x5a'))){_0x58d722[_0xe1f6('0x1d')]=qs[_0xe1f6('0x1d')](_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x1d')]);_0x58d722[_0xe1f6('0x20')]=qs['offset'](_0x506c61[_0xe1f6('0x38')][_0xe1f6('0x20')]);}return _0x46e009['getTeams'](_0x58d722);}})['then'](function(_0x3cd2a0){if(_0x3cd2a0){return _0x3cd2a0?{'count':_0x5bf686,'rows':_0x3cd2a0}:null;}})[_0xe1f6('0x28')](respondWithResult(_0x5a5cf3,null))[_0xe1f6('0x47')](handleError(_0x5a5cf3,null));};exports['addTeams']=function(_0x2e30d0,_0x194852,_0x477ec5){var _0x766eee=_0x2e30d0[_0xe1f6('0x4c')][_0xe1f6('0x66')];return db['Team'][_0xe1f6('0x46')]({'where':{'id':_0x766eee},'attributes':['id'],'include':[{'model':db[_0xe1f6('0x5d')],'as':_0xe1f6('0x67'),'attributes':['id',_0xe1f6('0x2e'),'online','voicePause',_0xe1f6('0x68')],'raw':!![]}]})[_0xe1f6('0x28')](function(_0x1bc5b0){if(_0x1bc5b0){var _0x1dc951=_['flatMap'](_0x1bc5b0,function(_0x4ff208){var _0xdc25c1=_0x4ff208[_0xe1f6('0x29')]({'plain':!![]});return _0xdc25c1['Agents'];});return db[_0xe1f6('0x32')][_0xe1f6('0x4a')]({'where':{'id':_0x2e30d0['params']['id']}})[_0xe1f6('0x28')](function(_0x1f80bf){return db[_0xe1f6('0x69')][_0xe1f6('0x6a')](function(_0x14b230){return _0x1f80bf['addTeams'](_0x766eee,{'transaction':_0x14b230})[_0xe1f6('0x28')](function(){return BPromise[_0xe1f6('0x6b')](_0x1dc951,function(_0x93ac4){return db[_0xe1f6('0x58')]['findOrCreate']({'where':{'UserId':_0x93ac4['id'],'WhatsappQueueId':_0x2e30d0['params']['id']},'transaction':_0x14b230});});})[_0xe1f6('0x28')](function(){_0x1dc951[_0xe1f6('0x6c')](function(_0x1c30ef){socket[_0xe1f6('0x6d')](_0xe1f6('0x6e'),{'UserId':_0x1c30ef['id'],'WhatsappQueueId':_0x1f80bf['id']});});});});});}})[_0xe1f6('0x28')](respondWithStatusCode(_0x194852,null))[_0xe1f6('0x47')](handleError(_0x194852,null));};exports['removeTeams']=function(_0x596064,_0x740c67,_0x443252){return db[_0xe1f6('0x6f')]['findAll']({'where':{'id':_0x596064[_0xe1f6('0x38')][_0xe1f6('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe1f6('0x5d')],'as':_0xe1f6('0x67'),'attributes':['id'],'raw':!![]}]})[_0xe1f6('0x28')](handleEntityNotFound(_0x740c67,null))[_0xe1f6('0x28')](function(_0x5f1494){var _0x3d80ab=_['map'](_0x5f1494,'id');var _0x39d6b6=[];var _0x369255=[];var _0x29882c=squel[_0xe1f6('0x70')]();_0x29882c[_0xe1f6('0x71')](_0xe1f6('0x72'))[_0xe1f6('0x73')](_0xe1f6('0x74'),'tq')[_0xe1f6('0x75')](_0xe1f6('0x76'),'ut',_0xe1f6('0x77'))[_0xe1f6('0x40')]('WhatsappQueueId\x20=\x20?',_0x596064[_0xe1f6('0x54')]['id']);for(var _0x57da03=0x0;_0x57da03<_0x5f1494[_0xe1f6('0x3d')];_0x57da03+=0x1){let _0x522271=_0x5f1494[_0x57da03];for(var _0x49d013=0x0;_0x49d013<_0x522271['Agents'][_0xe1f6('0x3d')];_0x49d013+=0x1){let _0x157ef1=_0x522271[_0xe1f6('0x67')][_0x49d013];var _0x33a727=_0x29882c[_0xe1f6('0x78')]();_0x33a727['where'](_0xe1f6('0x79'),_0x157ef1['id']);_0x369255[_0xe1f6('0x7a')](db[_0xe1f6('0x69')][_0xe1f6('0x38')](_0x33a727['toString'](),{'type':db['sequelize'][_0xe1f6('0x7b')][_0xe1f6('0x7c')]})[_0xe1f6('0x28')](function(_0x487d39){if(_0x487d39['length']===0x1){return _0x157ef1['id'];}else{var _0x2dffc0=_[_0xe1f6('0x7d')](_['map'](_0x487d39,'TeamId'),function(_0x4a5ed0){return _['includes'](_0x3d80ab,_0x4a5ed0);});if(_0x2dffc0){return _0x157ef1['id'];}}}));}}return BPromise[_0xe1f6('0x7e')](_0x369255)[_0xe1f6('0x28')](function(_0x2d0cd0){_0x39d6b6=_(_0x39d6b6)[_0xe1f6('0x7f')](_0x2d0cd0)[_0xe1f6('0x80')]()[_0xe1f6('0x81')]();return db[_0xe1f6('0x32')]['find']({'where':{'id':_0x596064[_0xe1f6('0x54')]['id']}})['then'](function(_0x3b0d77){return db[_0xe1f6('0x69')][_0xe1f6('0x6a')](function(_0x2a1da0){return _0x3b0d77[_0xe1f6('0x82')](_0x596064[_0xe1f6('0x38')]['ids'],{'transaction':_0x2a1da0})[_0xe1f6('0x28')](function(){if(!_[_0xe1f6('0x83')](_0x39d6b6)){return _0x3b0d77[_0xe1f6('0x84')](_0x39d6b6,{'transaction':_0x2a1da0});}})[_0xe1f6('0x28')](function(){_0x39d6b6[_0xe1f6('0x6c')](function(_0x3bd4d2){socket[_0xe1f6('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x3bd4d2,'WhatsappQueueId':_0x3b0d77['id']});});});});});});})[_0xe1f6('0x28')](respondWithStatusCode(_0x740c67,null))[_0xe1f6('0x47')](handleError(_0x740c67,null));};exports[_0xe1f6('0x85')]=function(_0x3a10a0,_0x313991,_0x105bab){return db[_0xe1f6('0x32')][_0xe1f6('0x4a')]({'where':{'id':_0x3a10a0[_0xe1f6('0x54')]['id']}})['then'](handleEntityNotFound(_0x313991,null))['then'](function(_0x5922e2){if(_0x5922e2){return _0x5922e2[_0xe1f6('0x85')](_0x3a10a0[_0xe1f6('0x4c')][_0xe1f6('0x66')],_['omit'](_0x3a10a0[_0xe1f6('0x4c')],[_0xe1f6('0x66'),'id'])||{})[_0xe1f6('0x86')](function(_0xf35939){for(var _0x1cdea8=0x0;_0x1cdea8<_0x3a10a0[_0xe1f6('0x4c')][_0xe1f6('0x66')]['length'];_0x1cdea8+=0x1){socket['emit'](_0xe1f6('0x6e'),{'UserId':Number(_0x3a10a0['body'][_0xe1f6('0x66')][_0x1cdea8]),'WhatsappQueueId':Number(_0x3a10a0['params']['id'])});}return _0xf35939;});}})[_0xe1f6('0x28')](respondWithResult(_0x313991,null))['catch'](handleError(_0x313991,null));};exports[_0xe1f6('0x84')]=function(_0x27f996,_0x718df4,_0x14f093){return db[_0xe1f6('0x32')]['find']({'where':{'id':_0x27f996['params']['id']}})['then'](handleEntityNotFound(_0x718df4,null))['then'](function(_0x232050){if(_0x232050){return _0x232050['removeAgents'](_0x27f996[_0xe1f6('0x38')][_0xe1f6('0x66')])[_0xe1f6('0x28')](function(){if(_[_0xe1f6('0x87')](_0x27f996['query'][_0xe1f6('0x66')])){for(var _0x103556=0x0;_0x103556<_0x27f996['query'][_0xe1f6('0x66')]['length'];_0x103556+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x27f996[_0xe1f6('0x38')][_0xe1f6('0x66')][_0x103556]),'WhatsappQueueId':Number(_0x27f996[_0xe1f6('0x54')]['id'])});}}else{socket[_0xe1f6('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x27f996['query'][_0xe1f6('0x66')]),'WhatsappQueueId':Number(_0x27f996['params']['id'])});}});}})[_0xe1f6('0x28')](respondWithStatusCode(_0x718df4,null))['catch'](handleError(_0x718df4,null));};exports[_0xe1f6('0x88')]=function(_0x1dee24,_0x3202cd,_0x152b5c){var _0x131082={};var _0x2b40fc={};var _0x122346;var _0x3f146b;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1dee24[_0xe1f6('0x54')]['id']}})[_0xe1f6('0x28')](handleEntityNotFound(_0x3202cd,null))['then'](function(_0x141085){if(_0x141085){_0x122346=_0x141085;_0x2b40fc['model']=_['keys'](db[_0xe1f6('0x5d')][_0xe1f6('0x33')]);_0x2b40fc[_0xe1f6('0x38')]=_[_0xe1f6('0x39')](_0x1dee24[_0xe1f6('0x38')]);_0x2b40fc['filters']=_[_0xe1f6('0x3a')](_0x2b40fc[_0xe1f6('0x37')],_0x2b40fc[_0xe1f6('0x38')]);_0x131082[_0xe1f6('0x3b')]=_[_0xe1f6('0x3a')](_0x2b40fc[_0xe1f6('0x37')],qs[_0xe1f6('0x3c')](_0x1dee24[_0xe1f6('0x38')]['fields']));_0x131082[_0xe1f6('0x3b')]=_0x131082[_0xe1f6('0x3b')][_0xe1f6('0x3d')]?_0x131082[_0xe1f6('0x3b')]:_0x2b40fc['model'];_0x131082[_0xe1f6('0x3e')]=qs[_0xe1f6('0x3f')](_0x1dee24[_0xe1f6('0x38')][_0xe1f6('0x3f')]);_0x131082[_0xe1f6('0x40')]=qs[_0xe1f6('0x41')](_[_0xe1f6('0x5b')](_0x1dee24[_0xe1f6('0x38')],_0x2b40fc['filters']));if(_0x1dee24[_0xe1f6('0x38')][_0xe1f6('0x42')]){_0x131082[_0xe1f6('0x40')]=_[_0xe1f6('0x49')](_0x131082['where'],{'$or':_[_0xe1f6('0x31')](_0x131082[_0xe1f6('0x3b')],function(_0x58b20a){var _0x5ee635={};_0x5ee635[_0x58b20a]={'$like':'%'+_0x1dee24['query'][_0xe1f6('0x42')]+'%'};return _0x5ee635;})});}_0x131082=_[_0xe1f6('0x49')]({},_0x131082,_0x1dee24[_0xe1f6('0x44')]);return _0x122346['getAgents'](_0x131082);}})[_0xe1f6('0x28')](function(_0x5ed921){if(_0x5ed921){_0x3f146b=_0x5ed921[_0xe1f6('0x3d')];if(!_0x1dee24[_0xe1f6('0x38')][_0xe1f6('0x59')](_0xe1f6('0x5a'))){_0x131082[_0xe1f6('0x1d')]=qs['limit'](_0x1dee24[_0xe1f6('0x38')][_0xe1f6('0x1d')]);_0x131082[_0xe1f6('0x20')]=qs[_0xe1f6('0x20')](_0x1dee24[_0xe1f6('0x38')][_0xe1f6('0x20')]);}return _0x122346['getAgents'](_0x131082);}})[_0xe1f6('0x28')](function(_0xb8025f){if(_0xb8025f){return _0xb8025f?{'count':_0x3f146b,'rows':_0xb8025f}:null;}})['then'](respondWithResult(_0x3202cd,null))['catch'](handleError(_0x3202cd,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d6dc681..7360f93 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 _0x5f0f=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x3b3f4f,_0x353297){var _0x42bc80=function(_0x560d7f){while(--_0x560d7f){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x42bc80(++_0x353297);}(_0x5f0f,0xef));var _0xf5f0=function(_0x289cdb,_0x59a4ef){_0x289cdb=_0x289cdb-0x0;var _0x2cdfac=_0x5f0f[_0x289cdb];return _0x2cdfac;};'use strict';var EventEmitter=require(_0xf5f0('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf5f0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf5f0('0x2')](0x0);var events={'afterCreate':_0xf5f0('0x3'),'afterUpdate':_0xf5f0('0x4'),'afterDestroy':_0xf5f0('0x5')};function emitEvent(_0x42fb10){return function(_0x26bf09,_0x26b8bf,_0x3d353a){WhatsappQueueEvents[_0xf5f0('0x6')](_0x42fb10+':'+_0x26bf09['id'],_0x26bf09);WhatsappQueueEvents[_0xf5f0('0x6')](_0x42fb10,_0x26bf09);_0x3d353a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xf5f0('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xac47=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xac47,0x14f));var _0x7ac4=function(_0x1f0448,_0xa2865f){_0x1f0448=_0x1f0448-0x0;var _0x16fe78=_0xac47[_0x1f0448];return _0x16fe78;};'use strict';var EventEmitter=require(_0x7ac4('0x0'));var WhatsappQueue=require(_0x7ac4('0x1'))['db'][_0x7ac4('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7ac4('0x3')](0x0);var events={'afterCreate':_0x7ac4('0x4'),'afterUpdate':_0x7ac4('0x5'),'afterDestroy':_0x7ac4('0x6')};function emitEvent(_0x211ef5){return function(_0x2a1b6e,_0x279047,_0xd5e2a2){WhatsappQueueEvents[_0x7ac4('0x7')](_0x211ef5+':'+_0x2a1b6e['id'],_0x2a1b6e);WhatsappQueueEvents['emit'](_0x211ef5,_0x2a1b6e);_0xd5e2a2(null);};}for(var e in events){if(events[_0x7ac4('0x8')](e)){var event=events[e];WhatsappQueue[_0x7ac4('0x9')](e,emitEvent(event));}}module[_0x7ac4('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 8b78d00..8e11194 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 _0x318e=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x375e94,_0x1b9c0d){var _0x1201bd=function(_0x5da849){while(--_0x5da849){_0x375e94['push'](_0x375e94['shift']());}};_0x1201bd(++_0x1b9c0d);}(_0x318e,0x19e));var _0xe318=function(_0x5f5bf1,_0x2c800e){_0x5f5bf1=_0x5f5bf1-0x0;var _0x4bfe4a=_0x318e[_0x5f5bf1];return _0x4bfe4a;};'use strict';var _=require(_0xe318('0x0'));var util=require(_0xe318('0x1'));var logger=require(_0xe318('0x2'))('api');var moment=require(_0xe318('0x3'));var BPromise=require(_0xe318('0x4'));var rp=require(_0xe318('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe318('0x6'));var config=require(_0xe318('0x7'));var attributes=require(_0xe318('0x8'));module[_0xe318('0x9')]=function(_0x53d98c,_0x510e31){return _0x53d98c[_0xe318('0xa')]('WhatsappQueue',attributes,{'tableName':_0xe318('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab9a=['bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab9a,0x1ed));var _0xaab9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xab9a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaab9('0x0'));var moment=require(_0xaab9('0x1'));var BPromise=require(_0xaab9('0x2'));var rp=require(_0xaab9('0x3'));var fs=require('fs');var path=require(_0xaab9('0x4'));var rimraf=require(_0xaab9('0x5'));var config=require('../../config/environment');var attributes=require(_0xaab9('0x6'));module[_0xaab9('0x7')]=function(_0x4942e5,_0x5b888a){return _0x4942e5[_0xaab9('0x8')](_0xaab9('0x9'),attributes,{'tableName':_0xaab9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index d798d82..0c868f1 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 _0x558b=['ShowWhatsappQueue','stringify','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','find'];(function(_0x41b6d2,_0x47a084){var _0x3b2102=function(_0x3fc390){while(--_0x3fc390){_0x41b6d2['push'](_0x41b6d2['shift']());}};_0x3b2102(++_0x47a084);}(_0x558b,0xc5));var _0xb558=function(_0x1ed59f,_0x5c0f23){_0x1ed59f=_0x1ed59f-0x0;var _0x112240=_0x558b[_0x1ed59f];return _0x112240;};'use strict';var _=require(_0xb558('0x0'));var util=require('util');var moment=require(_0xb558('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb558('0x2'));var db=require(_0xb558('0x3'))['db'];var utils=require(_0xb558('0x4'));var logger=require('../../config/logger')(_0xb558('0x5'));var config=require(_0xb558('0x6'));var jayson=require(_0xb558('0x7'));var client=jayson[_0xb558('0x8')]['http']({'port':0x232a});config['redis']=_[_0xb558('0x9')](config[_0xb558('0xa')],{'host':_0xb558('0xb'),'port':0x18eb});var socket=require(_0xb558('0xc'))(new Redis(config['redis']));require(_0xb558('0xd'))[_0xb558('0xe')](socket);function respondWithRpcPromise(_0x35ce0d,_0x4ea2a0,_0xd79ab4){return new BPromise(function(_0x4ac409,_0x5ca901){return client[_0xb558('0xf')](_0x35ce0d,_0xd79ab4)[_0xb558('0x10')](function(_0x130b28){logger[_0xb558('0x11')](_0xb558('0x12'),_0x4ea2a0,'request\x20sent');logger[_0xb558('0x13')](_0xb558('0x14'),_0x4ea2a0,_0xb558('0x15'),JSON['stringify'](_0x130b28));if(_0x130b28[_0xb558('0x16')]){if(_0x130b28[_0xb558('0x16')]['code']===0x1f4){logger[_0xb558('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x4ea2a0,_0x130b28[_0xb558('0x16')][_0xb558('0x17')]);return _0x5ca901(_0x130b28[_0xb558('0x16')][_0xb558('0x17')]);}logger['error'](_0xb558('0x12'),_0x4ea2a0,_0x130b28[_0xb558('0x16')][_0xb558('0x17')]);return _0x4ac409(_0x130b28[_0xb558('0x16')][_0xb558('0x17')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x4ea2a0,_0xb558('0x15'));_0x4ac409(_0x130b28[_0xb558('0x18')]['message']);}})[_0xb558('0x19')](function(_0x5a6bd0){logger[_0xb558('0x16')](_0xb558('0x12'),_0x4ea2a0,_0x5a6bd0);_0x5ca901(_0x5a6bd0);});});}exports['GetWhatsappQueue']=function(_0x1ab8f2){var _0x1703ee=this;return new Promise(function(_0x1fc6e8,_0xd26cee){return db[_0xb558('0x1a')]['findAll']({'raw':_0x1ab8f2[_0xb558('0x1b')]?_0x1ab8f2[_0xb558('0x1b')][_0xb558('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ab8f2[_0xb558('0x1b')]?_0x1ab8f2['options'][_0xb558('0x1d')]||null:null,'attributes':_0x1ab8f2[_0xb558('0x1b')]?_0x1ab8f2[_0xb558('0x1b')][_0xb558('0x1e')]||null:null,'limit':_0x1ab8f2[_0xb558('0x1b')]?_0x1ab8f2['options'][_0xb558('0x1f')]||null:null,'include':_0x1ab8f2[_0xb558('0x1b')]?_0x1ab8f2[_0xb558('0x1b')][_0xb558('0x20')]?_[_0xb558('0x21')](_0x1ab8f2[_0xb558('0x1b')][_0xb558('0x20')],function(_0x21c22e){return{'model':db[_0x21c22e[_0xb558('0x22')]],'as':_0x21c22e['as'],'attributes':_0x21c22e[_0xb558('0x1e')],'include':_0x21c22e[_0xb558('0x20')]?_[_0xb558('0x21')](_0x21c22e[_0xb558('0x20')],function(_0x96dfc2){return{'model':db[_0x96dfc2[_0xb558('0x22')]],'as':_0x96dfc2['as'],'attributes':_0x96dfc2[_0xb558('0x1e')],'include':_0x96dfc2[_0xb558('0x20')]?_['map'](_0x96dfc2[_0xb558('0x20')],function(_0x299836){return{'model':db[_0x299836[_0xb558('0x22')]],'as':_0x299836['as'],'attributes':_0x299836[_0xb558('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb558('0x10')](function(_0xd7b0b5){logger[_0xb558('0x11')](_0xb558('0x23'),_0x1ab8f2);logger[_0xb558('0x13')](_0xb558('0x23'),_0x1ab8f2,JSON['stringify'](_0xd7b0b5));_0x1fc6e8(_0xd7b0b5);})['catch'](function(_0x376240){logger[_0xb558('0x16')](_0xb558('0x23'),_0x376240[_0xb558('0x17')],_0x1ab8f2);_0xd26cee(_0x1703ee[_0xb558('0x16')](0x1f4,_0x376240['message']));});});};exports['ShowWhatsappQueue']=function(_0x1ac595){var _0x1aa588=this;return new Promise(function(_0x3fe6e9,_0x23fd8f){return db['WhatsappQueue'][_0xb558('0x24')]({'raw':_0x1ac595[_0xb558('0x1b')]?_0x1ac595[_0xb558('0x1b')][_0xb558('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ac595[_0xb558('0x1b')]?_0x1ac595[_0xb558('0x1b')][_0xb558('0x1d')]||null:null,'attributes':_0x1ac595[_0xb558('0x1b')]?_0x1ac595[_0xb558('0x1b')][_0xb558('0x1e')]||null:null,'include':_0x1ac595['options']?_0x1ac595['options'][_0xb558('0x20')]?_['map'](_0x1ac595[_0xb558('0x1b')][_0xb558('0x20')],function(_0x565d38){return{'model':db[_0x565d38['model']],'as':_0x565d38['as'],'attributes':_0x565d38[_0xb558('0x1e')],'include':_0x565d38[_0xb558('0x20')]?_[_0xb558('0x21')](_0x565d38[_0xb558('0x20')],function(_0x25117e){return{'model':db[_0x25117e['model']],'as':_0x25117e['as'],'attributes':_0x25117e[_0xb558('0x1e')],'include':_0x25117e[_0xb558('0x20')]?_[_0xb558('0x21')](_0x25117e[_0xb558('0x20')],function(_0x5665c0){return{'model':db[_0x5665c0['model']],'as':_0x5665c0['as'],'attributes':_0x5665c0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb558('0x10')](function(_0x3270f7){logger[_0xb558('0x11')](_0xb558('0x25'),_0x1ac595);logger[_0xb558('0x13')](_0xb558('0x25'),_0x1ac595,JSON[_0xb558('0x26')](_0x3270f7));_0x3fe6e9(_0x3270f7);})[_0xb558('0x19')](function(_0x325ccb){logger['error'](_0xb558('0x25'),_0x325ccb[_0xb558('0x17')],_0x1ac595);_0x23fd8f(_0x1aa588[_0xb558('0x16')](0x1f4,_0x325ccb[_0xb558('0x17')]));});});}; \ No newline at end of file +var _0x23f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','WhatsappQueue','findAll','options','raw','where','limit','map','include','attributes','model','GetWhatsappQueue','debug','find','ShowWhatsappQueue','stringify','lodash','randomstring'];(function(_0x21e75b,_0x31dcbf){var _0x2610ef=function(_0x368ce4){while(--_0x368ce4){_0x21e75b['push'](_0x21e75b['shift']());}};_0x2610ef(++_0x31dcbf);}(_0x23f2,0x195));var _0x223f=function(_0x316e74,_0x3e66b2){_0x316e74=_0x316e74-0x0;var _0x319743=_0x23f2[_0x316e74];return _0x319743;};'use strict';var _=require(_0x223f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x223f('0x1'));var fs=require('fs');var Redis=require(_0x223f('0x2'));var db=require(_0x223f('0x3'))['db'];var utils=require(_0x223f('0x4'));var logger=require(_0x223f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x223f('0x6')]['http']({'port':0x232a});config['redis']=_[_0x223f('0x7')](config['redis'],{'host':_0x223f('0x8'),'port':0x18eb});var socket=require(_0x223f('0x9'))(new Redis(config[_0x223f('0xa')]));require(_0x223f('0xb'))[_0x223f('0xc')](socket);function respondWithRpcPromise(_0x2b945b,_0x2919ac,_0x409418){return new BPromise(function(_0x407dbe,_0x5d14fb){return client['request'](_0x2b945b,_0x409418)[_0x223f('0xd')](function(_0x16265d){logger[_0x223f('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x2919ac,'request\x20sent');logger['debug'](_0x223f('0xf'),_0x2919ac,_0x223f('0x10'),JSON['stringify'](_0x16265d));if(_0x16265d['error']){if(_0x16265d[_0x223f('0x11')]['code']===0x1f4){logger[_0x223f('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x2919ac,_0x16265d[_0x223f('0x11')]['message']);return _0x5d14fb(_0x16265d[_0x223f('0x11')][_0x223f('0x12')]);}logger[_0x223f('0x11')](_0x223f('0x13'),_0x2919ac,_0x16265d[_0x223f('0x11')][_0x223f('0x12')]);return _0x407dbe(_0x16265d['error'][_0x223f('0x12')]);}else{logger[_0x223f('0xe')](_0x223f('0x13'),_0x2919ac,_0x223f('0x10'));_0x407dbe(_0x16265d[_0x223f('0x14')][_0x223f('0x12')]);}})[_0x223f('0x15')](function(_0x21c396){logger['error'](_0x223f('0x13'),_0x2919ac,_0x21c396);_0x5d14fb(_0x21c396);});});}exports['GetWhatsappQueue']=function(_0x8c1308){var _0x5ef4f9=this;return new Promise(function(_0x1a20c1,_0x31449a){return db[_0x223f('0x16')][_0x223f('0x17')]({'raw':_0x8c1308[_0x223f('0x18')]?_0x8c1308['options'][_0x223f('0x19')]===undefined?!![]:![]:!![],'where':_0x8c1308['options']?_0x8c1308[_0x223f('0x18')][_0x223f('0x1a')]||null:null,'attributes':_0x8c1308['options']?_0x8c1308['options']['attributes']||null:null,'limit':_0x8c1308[_0x223f('0x18')]?_0x8c1308['options'][_0x223f('0x1b')]||null:null,'include':_0x8c1308[_0x223f('0x18')]?_0x8c1308[_0x223f('0x18')]['include']?_[_0x223f('0x1c')](_0x8c1308['options'][_0x223f('0x1d')],function(_0x38a024){return{'model':db[_0x38a024['model']],'as':_0x38a024['as'],'attributes':_0x38a024[_0x223f('0x1e')],'include':_0x38a024[_0x223f('0x1d')]?_[_0x223f('0x1c')](_0x38a024[_0x223f('0x1d')],function(_0x2bf97d){return{'model':db[_0x2bf97d[_0x223f('0x1f')]],'as':_0x2bf97d['as'],'attributes':_0x2bf97d[_0x223f('0x1e')],'include':_0x2bf97d['include']?_['map'](_0x2bf97d[_0x223f('0x1d')],function(_0x183471){return{'model':db[_0x183471[_0x223f('0x1f')]],'as':_0x183471['as'],'attributes':_0x183471['attributes']};}):[]};}):[]};}):[]:[]})[_0x223f('0xd')](function(_0x1990d0){logger['info'](_0x223f('0x20'),_0x8c1308);logger[_0x223f('0x21')]('GetWhatsappQueue',_0x8c1308,JSON['stringify'](_0x1990d0));_0x1a20c1(_0x1990d0);})['catch'](function(_0x1fa78f){logger[_0x223f('0x11')](_0x223f('0x20'),_0x1fa78f['message'],_0x8c1308);_0x31449a(_0x5ef4f9[_0x223f('0x11')](0x1f4,_0x1fa78f[_0x223f('0x12')]));});});};exports['ShowWhatsappQueue']=function(_0x1144b6){var _0x4aeab1=this;return new Promise(function(_0xfeff04,_0x350186){return db[_0x223f('0x16')][_0x223f('0x22')]({'raw':_0x1144b6[_0x223f('0x18')]?_0x1144b6[_0x223f('0x18')][_0x223f('0x19')]===undefined?!![]:![]:!![],'where':_0x1144b6[_0x223f('0x18')]?_0x1144b6['options'][_0x223f('0x1a')]||null:null,'attributes':_0x1144b6[_0x223f('0x18')]?_0x1144b6[_0x223f('0x18')][_0x223f('0x1e')]||null:null,'include':_0x1144b6['options']?_0x1144b6[_0x223f('0x18')][_0x223f('0x1d')]?_[_0x223f('0x1c')](_0x1144b6[_0x223f('0x18')]['include'],function(_0x356dec){return{'model':db[_0x356dec[_0x223f('0x1f')]],'as':_0x356dec['as'],'attributes':_0x356dec['attributes'],'include':_0x356dec[_0x223f('0x1d')]?_[_0x223f('0x1c')](_0x356dec['include'],function(_0x17766f){return{'model':db[_0x17766f[_0x223f('0x1f')]],'as':_0x17766f['as'],'attributes':_0x17766f['attributes'],'include':_0x17766f['include']?_[_0x223f('0x1c')](_0x17766f[_0x223f('0x1d')],function(_0x3b73ef){return{'model':db[_0x3b73ef[_0x223f('0x1f')]],'as':_0x3b73ef['as'],'attributes':_0x3b73ef[_0x223f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x223f('0xd')](function(_0x5c0c3f){logger[_0x223f('0xe')](_0x223f('0x23'),_0x1144b6);logger['debug'](_0x223f('0x23'),_0x1144b6,JSON[_0x223f('0x24')](_0x5c0c3f));_0xfeff04(_0x5c0c3f);})[_0x223f('0x15')](function(_0x4daccb){logger['error'](_0x223f('0x23'),_0x4daccb['message'],_0x1144b6);_0x350186(_0x4aeab1[_0x223f('0x11')](0x1f4,_0x4daccb[_0x223f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index b7018ec..5ec8cc2 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 _0xd63b=['length','save','remove','emit','removeListener','register'];(function(_0x17460e,_0x5a6150){var _0x133321=function(_0x5f0402){while(--_0x5f0402){_0x17460e['push'](_0x17460e['shift']());}};_0x133321(++_0x5a6150);}(_0xd63b,0x1c3));var _0xbd63=function(_0x43cc23,_0x19dfc2){_0x43cc23=_0x43cc23-0x0;var _0x450ca6=_0xd63b[_0x43cc23];return _0x450ca6;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xbd63('0x0'),_0xbd63('0x1'),'update'];function createListener(_0x5522c8,_0x431269){return function(_0x55834a){_0x431269[_0xbd63('0x2')](_0x5522c8,_0x55834a);};}function removeListener(_0x1376b6,_0xb01843){return function(){WhatsappQueueEvents[_0xbd63('0x3')](_0x1376b6,_0xb01843);};}exports[_0xbd63('0x4')]=function(_0x5c4fb0){for(var _0x4af56a=0x0,_0xc36314=events[_0xbd63('0x5')];_0x4af56a<_0xc36314;_0x4af56a++){var _0x476b58=events[_0x4af56a];var _0x13c1a8=createListener('whatsappQueue:'+_0x476b58,_0x5c4fb0);WhatsappQueueEvents['on'](_0x476b58,_0x13c1a8);}}; \ No newline at end of file +var _0x5c3a=['emit','removeListener','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x5c3a,0x153));var _0xa5c3=function(_0x231228,_0x27d0cf){_0x231228=_0x231228-0x0;var _0x2f52bd=_0x5c3a[_0x231228];return _0x2f52bd;};'use strict';var WhatsappQueueEvents=require(_0xa5c3('0x0'));var events=[_0xa5c3('0x1'),_0xa5c3('0x2'),_0xa5c3('0x3')];function createListener(_0x400e49,_0x4954c8){return function(_0x3837e7){_0x4954c8[_0xa5c3('0x4')](_0x400e49,_0x3837e7);};}function removeListener(_0x43d6ee,_0x22d305){return function(){WhatsappQueueEvents[_0xa5c3('0x5')](_0x43d6ee,_0x22d305);};}exports['register']=function(_0x581eb8){for(var _0x12e755=0x0,_0x4e98dc=events['length'];_0x12e755<_0x4e98dc;_0x12e755++){var _0x5f271f=events[_0x12e755];var _0x49f228=createListener(_0xa5c3('0x6')+_0x5f271f,_0x581eb8);WhatsappQueueEvents['on'](_0x5f271f,_0x49f228);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 56abc63..465bea5 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 _0x4a9a=['/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x4a9a,0x15b));var _0xa4a9=function(_0x4020e5,_0x477594){_0x4020e5=_0x4020e5-0x0;var _0x3f717a=_0x4a9a[_0x4020e5];return _0x3f717a;};'use strict';var multer=require(_0xa4a9('0x0'));var util=require('util');var path=require(_0xa4a9('0x1'));var timeout=require(_0xa4a9('0x2'));var express=require(_0xa4a9('0x3'));var router=express[_0xa4a9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa4a9('0x5'));var interaction=require(_0xa4a9('0x6'));var config=require(_0xa4a9('0x7'));var controller=require(_0xa4a9('0x8'));router[_0xa4a9('0x9')]('/',auth[_0xa4a9('0xa')](),controller[_0xa4a9('0xb')]);router[_0xa4a9('0x9')](_0xa4a9('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa4a9('0x9')](_0xa4a9('0xd'),auth[_0xa4a9('0xa')](),controller['show']);router[_0xa4a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa4a9('0xf')]);router[_0xa4a9('0x10')](_0xa4a9('0xd'),auth[_0xa4a9('0xa')](),controller[_0xa4a9('0x11')]);router[_0xa4a9('0x12')](_0xa4a9('0xd'),auth[_0xa4a9('0xa')](),controller['destroy']);module[_0xa4a9('0x13')]=router; \ No newline at end of file +var _0xbf6f=['Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put','/:id','update','exports','util','path','connect-timeout'];(function(_0xcda74b,_0x1a7333){var _0xd8dbf2=function(_0x272e8c){while(--_0x272e8c){_0xcda74b['push'](_0xcda74b['shift']());}};_0xd8dbf2(++_0x1a7333);}(_0xbf6f,0x12d));var _0xfbf6=function(_0xd14903,_0x2034f0){_0xd14903=_0xd14903-0x0;var _0xe52b9a=_0xbf6f[_0xd14903];return _0xe52b9a;};'use strict';var multer=require('multer');var util=require(_0xfbf6('0x0'));var path=require(_0xfbf6('0x1'));var timeout=require(_0xfbf6('0x2'));var express=require('express');var router=express[_0xfbf6('0x3')]();var fs_extra=require(_0xfbf6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfbf6('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xfbf6('0x6')](),controller[_0xfbf6('0x7')]);router[_0xfbf6('0x8')]('/describe',auth[_0xfbf6('0x6')](),controller['describe']);router[_0xfbf6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfbf6('0x9')]);router[_0xfbf6('0xa')]('/',auth[_0xfbf6('0x6')](),controller[_0xfbf6('0xb')]);router[_0xfbf6('0xc')](_0xfbf6('0xd'),auth['isAuthenticated'](),controller[_0xfbf6('0xe')]);router['delete'](_0xfbf6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xfbf6('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b6cb1e6..71218c6 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(_0x3794b5,_0xd6d4c3){var _0x3b37fb=function(_0x178348){while(--_0x178348){_0x3794b5['push'](_0x3794b5['shift']());}};_0x3b37fb(++_0xd6d4c3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5b71da,_0x38a78c){var _0x3ca476=function(_0x5dd7db){while(--_0x5dd7db){_0x5b71da['push'](_0x5b71da['shift']());}};_0x3ca476(++_0x38a78c);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 660d09e..3033e11 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 _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(_0x34ef47,_0x4628a8){var _0x2e7994=function(_0x53a8d8){while(--_0x53a8d8){_0x34ef47['push'](_0x34ef47['shift']());}};_0x2e7994(++_0x4628a8);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xbfcc[_0x44216d];return _0xeca523;};'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 +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(_0x553dc1,_0x16f096){var _0x45ab22=function(_0x3cede5){while(--_0x3cede5){_0x553dc1['push'](_0x553dc1['shift']());}};_0x45ab22(++_0x16f096);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xbfcc[_0x4bd950];return _0x5dc59a;};'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 69cd8b0..0aeda27 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 _0x5826=['uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','report_whatsapp_queue'];(function(_0xe3daa9,_0x3caf82){var _0x7c3dd3=function(_0x165800){while(--_0x165800){_0xe3daa9['push'](_0xe3daa9['shift']());}};_0x7c3dd3(++_0x3caf82);}(_0x5826,0xc7));var _0x6582=function(_0x51da03,_0x63e573){_0x51da03=_0x51da03-0x0;var _0x7775b1=_0x5826[_0x51da03];return _0x7775b1;};'use strict';var _=require(_0x6582('0x0'));var util=require('util');var logger=require(_0x6582('0x1'))('api');var moment=require(_0x6582('0x2'));var BPromise=require(_0x6582('0x3'));var rp=require(_0x6582('0x4'));var fs=require('fs');var path=require(_0x6582('0x5'));var rimraf=require(_0x6582('0x6'));var config=require(_0x6582('0x7'));var attributes=require(_0x6582('0x8'));module['exports']=function(_0xc27176,_0x4efb89){return _0xc27176['define']('WhatsappQueueReport',attributes,{'tableName':_0x6582('0x9'),'paranoid':![],'indexes':[{'name':_0x6582('0xa'),'fields':[_0x6582('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1093=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x2d4bdb,_0x3d5506){var _0x498922=function(_0x23e35d){while(--_0x23e35d){_0x2d4bdb['push'](_0x2d4bdb['shift']());}};_0x498922(++_0x3d5506);}(_0x1093,0x14e));var _0x3109=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x1093[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x3109('0x0'));var util=require('util');var logger=require(_0x3109('0x1'))(_0x3109('0x2'));var moment=require(_0x3109('0x3'));var BPromise=require(_0x3109('0x4'));var rp=require(_0x3109('0x5'));var fs=require('fs');var path=require(_0x3109('0x6'));var rimraf=require(_0x3109('0x7'));var config=require(_0x3109('0x8'));var attributes=require(_0x3109('0x9'));module[_0x3109('0xa')]=function(_0x183c40,_0x2ddb9c){return _0x183c40[_0x3109('0xb')](_0x3109('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x3109('0xd'),'fields':[_0x3109('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index acda0de..22320f8 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 _0xc3cd=['lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','where','attributes','limit'];(function(_0xdeac79,_0x365532){var _0x2cb4cc=function(_0x167e35){while(--_0x167e35){_0xdeac79['push'](_0xdeac79['shift']());}};_0x2cb4cc(++_0x365532);}(_0xc3cd,0x186));var _0xdc3c=function(_0x61d0f,_0x329d2f){_0x61d0f=_0x61d0f-0x0;var _0x1c54b8=_0xc3cd[_0x61d0f];return _0x1c54b8;};'use strict';var _=require(_0xdc3c('0x0'));var util=require('util');var moment=require(_0xdc3c('0x1'));var BPromise=require(_0xdc3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc3c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc3c('0x4'))(_0xdc3c('0x5'));var config=require(_0xdc3c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc3c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x47f400,_0x743cb,_0x49cc7d){return new BPromise(function(_0x44c563,_0x191329){return client[_0xdc3c('0x8')](_0x47f400,_0x49cc7d)[_0xdc3c('0x9')](function(_0xd4fdca){logger[_0xdc3c('0xa')](_0xdc3c('0xb'),_0x743cb,_0xdc3c('0xc'));logger[_0xdc3c('0xd')](_0xdc3c('0xe'),_0x743cb,'request\x20sent',JSON[_0xdc3c('0xf')](_0xd4fdca));if(_0xd4fdca['error']){if(_0xd4fdca[_0xdc3c('0x10')][_0xdc3c('0x11')]===0x1f4){logger['error'](_0xdc3c('0xb'),_0x743cb,_0xd4fdca[_0xdc3c('0x10')][_0xdc3c('0x12')]);return _0x191329(_0xd4fdca[_0xdc3c('0x10')][_0xdc3c('0x12')]);}logger[_0xdc3c('0x10')](_0xdc3c('0xb'),_0x743cb,_0xd4fdca[_0xdc3c('0x10')]['message']);return _0x44c563(_0xd4fdca['error'][_0xdc3c('0x12')]);}else{logger[_0xdc3c('0xa')](_0xdc3c('0xb'),_0x743cb,_0xdc3c('0xc'));_0x44c563(_0xd4fdca[_0xdc3c('0x13')]['message']);}})[_0xdc3c('0x14')](function(_0x4ca51e){logger[_0xdc3c('0x10')](_0xdc3c('0xb'),_0x743cb,_0x4ca51e);_0x191329(_0x4ca51e);});});}exports[_0xdc3c('0x15')]=function(_0x27b8d5){var _0x5c5bb6=this;return new Promise(function(_0x49643a,_0x43e54f){return db[_0xdc3c('0x16')][_0xdc3c('0x17')](_0x27b8d5[_0xdc3c('0x18')],{'raw':_0x27b8d5['options']?_0x27b8d5[_0xdc3c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3db16b){logger[_0xdc3c('0xa')](_0xdc3c('0x15'),_0x27b8d5);logger[_0xdc3c('0xd')](_0xdc3c('0x15'),_0x27b8d5,JSON['stringify'](_0x3db16b));_0x49643a(_0x3db16b);})[_0xdc3c('0x14')](function(_0xc4ecd){logger[_0xdc3c('0x10')](_0xdc3c('0x15'),_0xc4ecd[_0xdc3c('0x12')],_0x27b8d5);_0x43e54f(_0x5c5bb6['error'](0x1f4,_0xc4ecd[_0xdc3c('0x12')]));});});};exports[_0xdc3c('0x1a')]=function(_0x372ca6){var _0x29026c=this;return new Promise(function(_0xffe00,_0x28c6f1){return db[_0xdc3c('0x16')]['update'](_0x372ca6['body'],{'raw':_0x372ca6[_0xdc3c('0x19')]?_0x372ca6[_0xdc3c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x372ca6[_0xdc3c('0x19')]?_0x372ca6[_0xdc3c('0x19')][_0xdc3c('0x1b')]||null:null,'attributes':_0x372ca6[_0xdc3c('0x19')]?_0x372ca6[_0xdc3c('0x19')][_0xdc3c('0x1c')]||null:null,'limit':_0x372ca6[_0xdc3c('0x19')]?_0x372ca6[_0xdc3c('0x19')][_0xdc3c('0x1d')]||null:null})[_0xdc3c('0x9')](function(_0x40fbf3){logger[_0xdc3c('0xa')]('UpdateWhatsappQueueReport',_0x372ca6);logger[_0xdc3c('0xd')](_0xdc3c('0x1a'),_0x372ca6,JSON[_0xdc3c('0xf')](_0x40fbf3));_0xffe00(_0x40fbf3);})['catch'](function(_0x403ab3){logger[_0xdc3c('0x10')]('UpdateWhatsappQueueReport',_0x403ab3[_0xdc3c('0x12')],_0x372ca6);_0x28c6f1(_0x29026c[_0xdc3c('0x10')](0x1f4,_0x403ab3[_0xdc3c('0x12')]));});});}; \ No newline at end of file +var _0xdf61=['../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','raw','debug','catch','UpdateWhatsappQueueReport','options','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f895b,_0x2804aa){var _0x6acc9b=function(_0xb90787){while(--_0xb90787){_0x3f895b['push'](_0x3f895b['shift']());}};_0x6acc9b(++_0x2804aa);}(_0xdf61,0x83));var _0x1df6=function(_0x39dd40,_0x2373e7){_0x39dd40=_0x39dd40-0x0;var _0x26e5c9=_0xdf61[_0x39dd40];return _0x26e5c9;};'use strict';var _=require(_0x1df6('0x0'));var util=require(_0x1df6('0x1'));var moment=require(_0x1df6('0x2'));var BPromise=require('bluebird');var rs=require(_0x1df6('0x3'));var fs=require('fs');var Redis=require(_0x1df6('0x4'));var db=require(_0x1df6('0x5'))['db'];var utils=require(_0x1df6('0x6'));var logger=require(_0x1df6('0x7'))(_0x1df6('0x8'));var config=require(_0x1df6('0x9'));var jayson=require(_0x1df6('0xa'));var client=jayson['client'][_0x1df6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d3a33,_0x5463e2,_0x29a167){return new BPromise(function(_0xe6acb8,_0x45eb3c){return client[_0x1df6('0xc')](_0x1d3a33,_0x29a167)[_0x1df6('0xd')](function(_0x269a9a){logger['info'](_0x1df6('0xe'),_0x5463e2,_0x1df6('0xf'));logger['debug'](_0x1df6('0x10'),_0x5463e2,_0x1df6('0xf'),JSON[_0x1df6('0x11')](_0x269a9a));if(_0x269a9a[_0x1df6('0x12')]){if(_0x269a9a[_0x1df6('0x12')][_0x1df6('0x13')]===0x1f4){logger[_0x1df6('0x12')](_0x1df6('0xe'),_0x5463e2,_0x269a9a[_0x1df6('0x12')][_0x1df6('0x14')]);return _0x45eb3c(_0x269a9a[_0x1df6('0x12')][_0x1df6('0x14')]);}logger[_0x1df6('0x12')](_0x1df6('0xe'),_0x5463e2,_0x269a9a[_0x1df6('0x12')][_0x1df6('0x14')]);return _0xe6acb8(_0x269a9a[_0x1df6('0x12')][_0x1df6('0x14')]);}else{logger[_0x1df6('0x15')](_0x1df6('0xe'),_0x5463e2,_0x1df6('0xf'));_0xe6acb8(_0x269a9a[_0x1df6('0x16')][_0x1df6('0x14')]);}})['catch'](function(_0x2c325a){logger[_0x1df6('0x12')](_0x1df6('0xe'),_0x5463e2,_0x2c325a);_0x45eb3c(_0x2c325a);});});}exports[_0x1df6('0x17')]=function(_0x2144e0){var _0x5c0d76=this;return new Promise(function(_0x476e8e,_0x439048){return db[_0x1df6('0x18')][_0x1df6('0x19')](_0x2144e0[_0x1df6('0x1a')],{'raw':_0x2144e0['options']?_0x2144e0['options'][_0x1df6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1aba2c){logger[_0x1df6('0x15')](_0x1df6('0x17'),_0x2144e0);logger[_0x1df6('0x1c')](_0x1df6('0x17'),_0x2144e0,JSON['stringify'](_0x1aba2c));_0x476e8e(_0x1aba2c);})[_0x1df6('0x1d')](function(_0x41d4c8){logger['error'](_0x1df6('0x17'),_0x41d4c8['message'],_0x2144e0);_0x439048(_0x5c0d76[_0x1df6('0x12')](0x1f4,_0x41d4c8[_0x1df6('0x14')]));});});};exports[_0x1df6('0x1e')]=function(_0x53f7a0){var _0x135592=this;return new Promise(function(_0x4c3c8d,_0x16b50a){return db[_0x1df6('0x18')]['update'](_0x53f7a0['body'],{'raw':_0x53f7a0['options']?_0x53f7a0[_0x1df6('0x1f')][_0x1df6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f7a0['options']?_0x53f7a0['options'][_0x1df6('0x20')]||null:null,'attributes':_0x53f7a0[_0x1df6('0x1f')]?_0x53f7a0['options'][_0x1df6('0x21')]||null:null,'limit':_0x53f7a0[_0x1df6('0x1f')]?_0x53f7a0[_0x1df6('0x1f')][_0x1df6('0x22')]||null:null})['then'](function(_0xbe8130){logger[_0x1df6('0x15')](_0x1df6('0x1e'),_0x53f7a0);logger[_0x1df6('0x1c')](_0x1df6('0x1e'),_0x53f7a0,JSON[_0x1df6('0x11')](_0xbe8130));_0x4c3c8d(_0xbe8130);})['catch'](function(_0x57e152){logger[_0x1df6('0x12')]('UpdateWhatsappQueueReport',_0x57e152['message'],_0x53f7a0);_0x16b50a(_0x135592['error'](0x1f4,_0x57e152['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 2fb6285..9094195 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 _0xa8f8=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x4c4fbe,_0x483482){var _0x39b3b9=function(_0x803f56){while(--_0x803f56){_0x4c4fbe['push'](_0x4c4fbe['shift']());}};_0x39b3b9(++_0x483482);}(_0xa8f8,0x1c7));var _0x8a8f=function(_0x100e0c,_0x5523b8){_0x100e0c=_0x100e0c-0x0;var _0x4db1aa=_0xa8f8[_0x100e0c];return _0x4db1aa;};'use strict';var multer=require('multer');var util=require(_0x8a8f('0x0'));var path=require(_0x8a8f('0x1'));var timeout=require(_0x8a8f('0x2'));var express=require(_0x8a8f('0x3'));var router=express['Router']();var fs_extra=require(_0x8a8f('0x4'));var auth=require(_0x8a8f('0x5'));var interaction=require(_0x8a8f('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x8a8f('0x7')](),controller[_0x8a8f('0x8')]);router[_0x8a8f('0x9')](_0x8a8f('0xa'),auth[_0x8a8f('0x7')](),controller[_0x8a8f('0xb')]);router[_0x8a8f('0x9')](_0x8a8f('0xc'),auth['isAuthenticated'](),controller[_0x8a8f('0xd')]);router[_0x8a8f('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a8f('0xf')]);router[_0x8a8f('0x10')](_0x8a8f('0xc'),auth['isAuthenticated'](),controller[_0x8a8f('0x11')]);router[_0x8a8f('0x12')](_0x8a8f('0xc'),auth[_0x8a8f('0x7')](),controller[_0x8a8f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x904c=['./whatsappTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19757b,_0x2a0676){var _0xa1a5ef=function(_0x2c82df){while(--_0x2c82df){_0x19757b['push'](_0x19757b['shift']());}};_0xa1a5ef(++_0x2a0676);}(_0x904c,0x1f2));var _0xc904=function(_0x1e8e69,_0x508379){_0x1e8e69=_0x1e8e69-0x0;var _0x291b1a=_0x904c[_0x1e8e69];return _0x291b1a;};'use strict';var multer=require('multer');var util=require(_0xc904('0x0'));var path=require(_0xc904('0x1'));var timeout=require('connect-timeout');var express=require(_0xc904('0x2'));var router=express[_0xc904('0x3')]();var fs_extra=require(_0xc904('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc904('0x5'));var config=require('../../config/environment');var controller=require(_0xc904('0x6'));router['get']('/',auth[_0xc904('0x7')](),controller['index']);router[_0xc904('0x8')](_0xc904('0x9'),auth[_0xc904('0x7')](),controller[_0xc904('0xa')]);router[_0xc904('0x8')](_0xc904('0xb'),auth[_0xc904('0x7')](),controller[_0xc904('0xc')]);router['post']('/',auth[_0xc904('0x7')](),controller[_0xc904('0xd')]);router[_0xc904('0xe')](_0xc904('0xb'),auth[_0xc904('0x7')](),controller['update']);router[_0xc904('0xf')]('/:id',auth[_0xc904('0x7')](),controller[_0xc904('0x10')]);module[_0xc904('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 187357b..1963d1b 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 _0x97db=['STRING','agent','queue','DATE','sequelize','exports'];(function(_0x14df6d,_0x5bb3f7){var _0x2e1cf2=function(_0x36b69a){while(--_0x36b69a){_0x14df6d['push'](_0x14df6d['shift']());}};_0x2e1cf2(++_0x5bb3f7);}(_0x97db,0x1b4));var _0xb97d=function(_0x2d2a69,_0x2b53ff){_0x2d2a69=_0x2d2a69-0x0;var _0x564ac2=_0x97db[_0x2d2a69];return _0x564ac2;};'use strict';var Sequelize=require(_0xb97d('0x0'));module[_0xb97d('0x1')]={'uniqueid':{'type':Sequelize[_0xb97d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xb97d('0x3'),_0xb97d('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb97d('0x5')]}}; \ No newline at end of file +var _0xd824=['queue','DATE','sequelize','exports','account','agent'];(function(_0x5bdab0,_0x4da362){var _0xe55b0d=function(_0x17dd79){while(--_0x17dd79){_0x5bdab0['push'](_0x5bdab0['shift']());}};_0xe55b0d(++_0x4da362);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4d82('0x2'),_0x4d82('0x3'),_0x4d82('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4d82('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 0c1d0ee..09562ad 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 _0x05e3=['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','undefined','limit','count','offset','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','WhatsappTransferReport','findAll','rows','params','keys','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x190f33,_0x1b76c7){var _0x185429=function(_0xae880e){while(--_0xae880e){_0x190f33['push'](_0x190f33['shift']());}};_0x185429(++_0x1b76c7);}(_0x05e3,0x86));var _0x305e=function(_0x3523cb,_0x511b5c){_0x3523cb=_0x3523cb-0x0;var _0x54efd9=_0x05e3[_0x3523cb];return _0x54efd9;};'use strict';var emlformat=require(_0x305e('0x0'));var rimraf=require(_0x305e('0x1'));var zipdir=require(_0x305e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x305e('0x3'));var BPromise=require(_0x305e('0x4'));var Mustache=require('mustache');var util=require(_0x305e('0x5'));var path=require(_0x305e('0x6'));var sox=require('sox');var csv=require(_0x305e('0x7'));var ejs=require(_0x305e('0x8'));var fs=require('fs');var fs_extra=require(_0x305e('0x9'));var _=require(_0x305e('0xa'));var squel=require(_0x305e('0xb'));var crypto=require(_0x305e('0xc'));var jsforce=require(_0x305e('0xd'));var deskjs=require(_0x305e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x305e('0xf'));var Papa=require('papaparse');var Redis=require(_0x305e('0x10'));var authService=require(_0x305e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x305e('0x12'));var hardwareService=require(_0x305e('0x13'));var logger=require(_0x305e('0x14'))(_0x305e('0x15'));var utils=require(_0x305e('0x16'));var config=require(_0x305e('0x17'));var licenseUtil=require(_0x305e('0x18'));var db=require(_0x305e('0x19'))['db'];function respondWithStatusCode(_0x350b,_0x301068){_0x301068=_0x301068||0xcc;return function(_0x3535b9){if(_0x3535b9){return _0x350b[_0x305e('0x1a')](_0x301068);}return _0x350b['status'](_0x301068)[_0x305e('0x1b')]();};}function respondWithResult(_0xf813ca,_0x5964c4){_0x5964c4=_0x5964c4||0xc8;return function(_0x4398a6){if(_0x4398a6){return _0xf813ca[_0x305e('0x1c')](_0x5964c4)[_0x305e('0x1d')](_0x4398a6);}};}function respondWithFilteredResult(_0x154039,_0x21f147){return function(_0xc5b3dc){if(_0xc5b3dc){var _0x475ef4=typeof _0x21f147['offset']===_0x305e('0x1e')&&typeof _0x21f147[_0x305e('0x1f')]==='undefined';var _0x2b9bed=_0xc5b3dc[_0x305e('0x20')];var _0x265bf3=_0x475ef4?0x0:_0x21f147[_0x305e('0x21')];var _0x45ede9=_0x475ef4?_0xc5b3dc['count']:_0x21f147['offset']+_0x21f147['limit'];var _0x5f2bad;if(_0x45ede9>=_0x2b9bed){_0x45ede9=_0x2b9bed;_0x5f2bad=0xc8;}else{_0x5f2bad=0xce;}_0x154039['status'](_0x5f2bad);return _0x154039['set']('Content-Range',_0x265bf3+'-'+_0x45ede9+'/'+_0x2b9bed)[_0x305e('0x1d')](_0xc5b3dc);}return null;};}function patchUpdates(_0x2f8b4f){return function(_0x3b15be){try{jsonpatch[_0x305e('0x22')](_0x3b15be,_0x2f8b4f,!![]);}catch(_0x2e8afd){return BPromise[_0x305e('0x23')](_0x2e8afd);}return _0x3b15be['save']();};}function saveUpdates(_0x472d2b,_0x573f2d){return function(_0x309b47){if(_0x309b47){return _0x309b47[_0x305e('0x24')](_0x472d2b)['then'](function(_0x27cef6){return _0x27cef6;});}return null;};}function removeEntity(_0x1318bf,_0x2061d1){return function(_0x223ebf){if(_0x223ebf){return _0x223ebf[_0x305e('0x25')]()[_0x305e('0x26')](function(){_0x1318bf[_0x305e('0x1c')](0xcc)[_0x305e('0x1b')]();});}};}function handleEntityNotFound(_0x2d7fbd,_0x554b54){return function(_0x5e9aea){if(!_0x5e9aea){_0x2d7fbd[_0x305e('0x1a')](0x194);}return _0x5e9aea;};}function handleError(_0x1335aa,_0x1aeb09){_0x1aeb09=_0x1aeb09||0x1f4;return function(_0x282076){logger[_0x305e('0x27')](_0x282076['stack']);if(_0x282076['name']){delete _0x282076[_0x305e('0x28')];}_0x1335aa[_0x305e('0x1c')](_0x1aeb09)[_0x305e('0x29')](_0x282076);};}exports[_0x305e('0x2a')]=function(_0x3919ec,_0x5dacb1){var _0x479912={},_0xb845fb={},_0x18841a={'count':0x0,'rows':[]};var _0x15e558=_[_0x305e('0x2b')](db['WhatsappTransferReport'][_0x305e('0x2c')],function(_0x3a6c0e){return{'name':_0x3a6c0e['fieldName'],'type':_0x3a6c0e[_0x305e('0x2d')][_0x305e('0x2e')]};});_0xb845fb[_0x305e('0x2f')]=_[_0x305e('0x2b')](_0x15e558,_0x305e('0x28'));_0xb845fb['query']=_['keys'](_0x3919ec[_0x305e('0x30')]);_0xb845fb[_0x305e('0x31')]=_['intersection'](_0xb845fb['model'],_0xb845fb[_0x305e('0x30')]);_0x479912[_0x305e('0x32')]=_[_0x305e('0x33')](_0xb845fb['model'],qs[_0x305e('0x34')](_0x3919ec['query'][_0x305e('0x34')]));_0x479912[_0x305e('0x32')]=_0x479912[_0x305e('0x32')][_0x305e('0x35')]?_0x479912[_0x305e('0x32')]:_0xb845fb[_0x305e('0x2f')];if(!_0x3919ec[_0x305e('0x30')]['hasOwnProperty'](_0x305e('0x36'))){_0x479912[_0x305e('0x1f')]=qs[_0x305e('0x1f')](_0x3919ec[_0x305e('0x30')][_0x305e('0x1f')]);_0x479912['offset']=qs[_0x305e('0x21')](_0x3919ec['query'][_0x305e('0x21')]);}_0x479912[_0x305e('0x37')]=qs[_0x305e('0x38')](_0x3919ec[_0x305e('0x30')][_0x305e('0x38')]);_0x479912[_0x305e('0x39')]=qs[_0x305e('0x31')](_[_0x305e('0x3a')](_0x3919ec[_0x305e('0x30')],_0xb845fb[_0x305e('0x31')]),_0x15e558);if(_0x3919ec[_0x305e('0x30')]['filter']){_0x479912[_0x305e('0x39')]=_[_0x305e('0x3b')](_0x479912[_0x305e('0x39')],{'$or':_[_0x305e('0x2b')](_0x15e558,function(_0x1c0407){if(_0x1c0407[_0x305e('0x2d')]!==_0x305e('0x3c')){var _0x2ec9e6={};_0x2ec9e6[_0x1c0407[_0x305e('0x28')]]={'$like':'%'+_0x3919ec[_0x305e('0x30')][_0x305e('0x3d')]+'%'};return _0x2ec9e6;}})});}_0x479912=_[_0x305e('0x3b')]({},_0x479912,_0x3919ec['options']);var _0x509faf={'where':_0x479912[_0x305e('0x39')]};return db['WhatsappTransferReport'][_0x305e('0x20')](_0x509faf)[_0x305e('0x26')](function(_0x131843){_0x18841a[_0x305e('0x20')]=_0x131843;if(_0x3919ec['query'][_0x305e('0x3e')]){_0x479912[_0x305e('0x3f')]=[{'all':!![]}];}return db[_0x305e('0x40')][_0x305e('0x41')](_0x479912);})[_0x305e('0x26')](function(_0x4e4ccd){_0x18841a[_0x305e('0x42')]=_0x4e4ccd;return _0x18841a;})[_0x305e('0x26')](respondWithFilteredResult(_0x5dacb1,_0x479912))['catch'](handleError(_0x5dacb1,null));};exports['show']=function(_0x343ab2,_0x565ac2){var _0x510c65={'raw':!![],'where':{'id':_0x343ab2[_0x305e('0x43')]['id']}},_0xf02850={};_0xf02850['model']=_[_0x305e('0x44')](db[_0x305e('0x40')][_0x305e('0x2c')]);_0xf02850[_0x305e('0x30')]=_[_0x305e('0x44')](_0x343ab2[_0x305e('0x30')]);_0xf02850[_0x305e('0x31')]=_[_0x305e('0x33')](_0xf02850[_0x305e('0x2f')],_0xf02850[_0x305e('0x30')]);_0x510c65[_0x305e('0x32')]=_[_0x305e('0x33')](_0xf02850[_0x305e('0x2f')],qs[_0x305e('0x34')](_0x343ab2[_0x305e('0x30')]['fields']));_0x510c65[_0x305e('0x32')]=_0x510c65['attributes'][_0x305e('0x35')]?_0x510c65[_0x305e('0x32')]:_0xf02850[_0x305e('0x2f')];if(_0x343ab2[_0x305e('0x30')][_0x305e('0x3e')]){_0x510c65[_0x305e('0x3f')]=[{'all':!![]}];}_0x510c65=_[_0x305e('0x3b')]({},_0x510c65,_0x343ab2[_0x305e('0x45')]);return db[_0x305e('0x40')][_0x305e('0x46')](_0x510c65)[_0x305e('0x26')](handleEntityNotFound(_0x565ac2,null))[_0x305e('0x26')](respondWithResult(_0x565ac2,null))[_0x305e('0x47')](handleError(_0x565ac2,null));};exports[_0x305e('0x48')]=function(_0x222958,_0x4a2095){return db[_0x305e('0x40')][_0x305e('0x48')](_0x222958['body'],{})[_0x305e('0x26')](respondWithResult(_0x4a2095,0xc9))[_0x305e('0x47')](handleError(_0x4a2095,null));};exports[_0x305e('0x24')]=function(_0x3abf32,_0x1cc43b){if(_0x3abf32[_0x305e('0x49')]['id']){delete _0x3abf32[_0x305e('0x49')]['id'];}return db[_0x305e('0x40')][_0x305e('0x46')]({'where':{'id':_0x3abf32[_0x305e('0x43')]['id']}})['then'](handleEntityNotFound(_0x1cc43b,null))[_0x305e('0x26')](saveUpdates(_0x3abf32['body'],null))['then'](respondWithResult(_0x1cc43b,null))[_0x305e('0x47')](handleError(_0x1cc43b,null));};exports['destroy']=function(_0x5e7c80,_0x5bd2b3){return db['WhatsappTransferReport'][_0x305e('0x46')]({'where':{'id':_0x5e7c80[_0x305e('0x43')]['id']}})[_0x305e('0x26')](handleEntityNotFound(_0x5bd2b3,null))[_0x305e('0x26')](removeEntity(_0x5bd2b3,null))['catch'](handleError(_0x5bd2b3,null));};exports[_0x305e('0x4a')]=function(_0x444ef6,_0x295e0d){return db['WhatsappTransferReport'][_0x305e('0x4a')]()[_0x305e('0x26')](respondWithResult(_0x295e0d,null))['catch'](handleError(_0x295e0d,null));}; \ No newline at end of file +var _0x3d45=['name','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','stack'];(function(_0x383fba,_0x319cbf){var _0x56d7e9=function(_0x4b4ddf){while(--_0x4b4ddf){_0x383fba['push'](_0x383fba['shift']());}};_0x56d7e9(++_0x319cbf);}(_0x3d45,0x1d2));var _0x53d4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3d45[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x53d4('0x0'));var rimraf=require(_0x53d4('0x1'));var zipdir=require(_0x53d4('0x2'));var jsonpatch=require(_0x53d4('0x3'));var rp=require(_0x53d4('0x4'));var moment=require('moment');var BPromise=require(_0x53d4('0x5'));var Mustache=require(_0x53d4('0x6'));var util=require('util');var path=require(_0x53d4('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(_0x53d4('0x8'));var squel=require(_0x53d4('0x9'));var crypto=require(_0x53d4('0xa'));var jsforce=require(_0x53d4('0xb'));var deskjs=require(_0x53d4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x53d4('0xd'));var Papa=require(_0x53d4('0xe'));var Redis=require(_0x53d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x53d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53d4('0x11'));var logger=require(_0x53d4('0x12'))(_0x53d4('0x13'));var utils=require(_0x53d4('0x14'));var config=require(_0x53d4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x53d4('0x16'))['db'];function respondWithStatusCode(_0x11afa8,_0x445c6e){_0x445c6e=_0x445c6e||0xcc;return function(_0x4cd884){if(_0x4cd884){return _0x11afa8[_0x53d4('0x17')](_0x445c6e);}return _0x11afa8[_0x53d4('0x18')](_0x445c6e)['end']();};}function respondWithResult(_0x256409,_0x4999ac){_0x4999ac=_0x4999ac||0xc8;return function(_0x39e990){if(_0x39e990){return _0x256409[_0x53d4('0x18')](_0x4999ac)[_0x53d4('0x19')](_0x39e990);}};}function respondWithFilteredResult(_0x500d03,_0x136478){return function(_0x121bcb){if(_0x121bcb){var _0x1b2e0b=typeof _0x136478[_0x53d4('0x1a')]===_0x53d4('0x1b')&&typeof _0x136478['limit']===_0x53d4('0x1b');var _0x11a0fc=_0x121bcb['count'];var _0x5e5cbf=_0x1b2e0b?0x0:_0x136478[_0x53d4('0x1a')];var _0xfdde54=_0x1b2e0b?_0x121bcb[_0x53d4('0x1c')]:_0x136478['offset']+_0x136478[_0x53d4('0x1d')];var _0x463d8f;if(_0xfdde54>=_0x11a0fc){_0xfdde54=_0x11a0fc;_0x463d8f=0xc8;}else{_0x463d8f=0xce;}_0x500d03[_0x53d4('0x18')](_0x463d8f);return _0x500d03[_0x53d4('0x1e')](_0x53d4('0x1f'),_0x5e5cbf+'-'+_0xfdde54+'/'+_0x11a0fc)[_0x53d4('0x19')](_0x121bcb);}return null;};}function patchUpdates(_0x25ed73){return function(_0x3c3005){try{jsonpatch['apply'](_0x3c3005,_0x25ed73,!![]);}catch(_0x57dfd0){return BPromise['reject'](_0x57dfd0);}return _0x3c3005[_0x53d4('0x20')]();};}function saveUpdates(_0x557c63,_0x87fabf){return function(_0x3c8618){if(_0x3c8618){return _0x3c8618[_0x53d4('0x21')](_0x557c63)[_0x53d4('0x22')](function(_0x1de622){return _0x1de622;});}return null;};}function removeEntity(_0x1fb85f,_0x1c281d){return function(_0x3a2ff4){if(_0x3a2ff4){return _0x3a2ff4[_0x53d4('0x23')]()[_0x53d4('0x22')](function(){_0x1fb85f[_0x53d4('0x18')](0xcc)[_0x53d4('0x24')]();});}};}function handleEntityNotFound(_0x100d71,_0x18d6e7){return function(_0xcb69ef){if(!_0xcb69ef){_0x100d71[_0x53d4('0x17')](0x194);}return _0xcb69ef;};}function handleError(_0x215175,_0x341c62){_0x341c62=_0x341c62||0x1f4;return function(_0x112e91){logger['error'](_0x112e91[_0x53d4('0x25')]);if(_0x112e91[_0x53d4('0x26')]){delete _0x112e91[_0x53d4('0x26')];}_0x215175[_0x53d4('0x18')](_0x341c62)['send'](_0x112e91);};}exports[_0x53d4('0x27')]=function(_0x445cc3,_0x49e0a7){var _0x5a3702={},_0x52074b={},_0x423ee6={'count':0x0,'rows':[]};var _0x1586ab=_[_0x53d4('0x28')](db[_0x53d4('0x29')][_0x53d4('0x2a')],function(_0x547eb9){return{'name':_0x547eb9[_0x53d4('0x2b')],'type':_0x547eb9['type'][_0x53d4('0x2c')]};});_0x52074b[_0x53d4('0x2d')]=_[_0x53d4('0x28')](_0x1586ab,_0x53d4('0x26'));_0x52074b[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x445cc3['query']);_0x52074b['filters']=_[_0x53d4('0x30')](_0x52074b['model'],_0x52074b['query']);_0x5a3702[_0x53d4('0x31')]=_[_0x53d4('0x30')](_0x52074b[_0x53d4('0x2d')],qs[_0x53d4('0x32')](_0x445cc3['query']['fields']));_0x5a3702[_0x53d4('0x31')]=_0x5a3702[_0x53d4('0x31')][_0x53d4('0x33')]?_0x5a3702[_0x53d4('0x31')]:_0x52074b[_0x53d4('0x2d')];if(!_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x34')](_0x53d4('0x35'))){_0x5a3702[_0x53d4('0x1d')]=qs[_0x53d4('0x1d')](_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x1d')]);_0x5a3702[_0x53d4('0x1a')]=qs['offset'](_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x1a')]);}_0x5a3702[_0x53d4('0x36')]=qs[_0x53d4('0x37')](_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x37')]);_0x5a3702[_0x53d4('0x38')]=qs[_0x53d4('0x39')](_[_0x53d4('0x3a')](_0x445cc3[_0x53d4('0x2e')],_0x52074b['filters']),_0x1586ab);if(_0x445cc3['query'][_0x53d4('0x3b')]){_0x5a3702[_0x53d4('0x38')]=_['merge'](_0x5a3702[_0x53d4('0x38')],{'$or':_['map'](_0x1586ab,function(_0x2d8e2d){if(_0x2d8e2d['type']!==_0x53d4('0x3c')){var _0x2dc9c2={};_0x2dc9c2[_0x2d8e2d[_0x53d4('0x26')]]={'$like':'%'+_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x3b')]+'%'};return _0x2dc9c2;}})});}_0x5a3702=_['merge']({},_0x5a3702,_0x445cc3[_0x53d4('0x3d')]);var _0x45f23a={'where':_0x5a3702[_0x53d4('0x38')]};return db[_0x53d4('0x29')][_0x53d4('0x1c')](_0x45f23a)[_0x53d4('0x22')](function(_0x32f6cf){_0x423ee6['count']=_0x32f6cf;if(_0x445cc3[_0x53d4('0x2e')][_0x53d4('0x3e')]){_0x5a3702[_0x53d4('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x5a3702);})[_0x53d4('0x22')](function(_0x34c46e){_0x423ee6[_0x53d4('0x40')]=_0x34c46e;return _0x423ee6;})[_0x53d4('0x22')](respondWithFilteredResult(_0x49e0a7,_0x5a3702))[_0x53d4('0x41')](handleError(_0x49e0a7,null));};exports['show']=function(_0x569656,_0x3d84ab){var _0x1f52e6={'raw':!![],'where':{'id':_0x569656[_0x53d4('0x42')]['id']}},_0x407fc2={};_0x407fc2[_0x53d4('0x2d')]=_['keys'](db[_0x53d4('0x29')][_0x53d4('0x2a')]);_0x407fc2[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x569656['query']);_0x407fc2[_0x53d4('0x39')]=_[_0x53d4('0x30')](_0x407fc2[_0x53d4('0x2d')],_0x407fc2['query']);_0x1f52e6[_0x53d4('0x31')]=_[_0x53d4('0x30')](_0x407fc2[_0x53d4('0x2d')],qs[_0x53d4('0x32')](_0x569656[_0x53d4('0x2e')][_0x53d4('0x32')]));_0x1f52e6[_0x53d4('0x31')]=_0x1f52e6[_0x53d4('0x31')][_0x53d4('0x33')]?_0x1f52e6[_0x53d4('0x31')]:_0x407fc2[_0x53d4('0x2d')];if(_0x569656[_0x53d4('0x2e')]['includeAll']){_0x1f52e6[_0x53d4('0x3f')]=[{'all':!![]}];}_0x1f52e6=_[_0x53d4('0x43')]({},_0x1f52e6,_0x569656['options']);return db[_0x53d4('0x29')][_0x53d4('0x44')](_0x1f52e6)[_0x53d4('0x22')](handleEntityNotFound(_0x3d84ab,null))['then'](respondWithResult(_0x3d84ab,null))[_0x53d4('0x41')](handleError(_0x3d84ab,null));};exports[_0x53d4('0x45')]=function(_0x2c48e3,_0x4638d1){return db[_0x53d4('0x29')][_0x53d4('0x45')](_0x2c48e3['body'],{})[_0x53d4('0x22')](respondWithResult(_0x4638d1,0xc9))[_0x53d4('0x41')](handleError(_0x4638d1,null));};exports['update']=function(_0x42395f,_0x5d379a){if(_0x42395f[_0x53d4('0x46')]['id']){delete _0x42395f[_0x53d4('0x46')]['id'];}return db['WhatsappTransferReport'][_0x53d4('0x44')]({'where':{'id':_0x42395f[_0x53d4('0x42')]['id']}})[_0x53d4('0x22')](handleEntityNotFound(_0x5d379a,null))[_0x53d4('0x22')](saveUpdates(_0x42395f[_0x53d4('0x46')],null))[_0x53d4('0x22')](respondWithResult(_0x5d379a,null))[_0x53d4('0x41')](handleError(_0x5d379a,null));};exports[_0x53d4('0x23')]=function(_0x1457ce,_0x2154a9){return db[_0x53d4('0x29')][_0x53d4('0x44')]({'where':{'id':_0x1457ce[_0x53d4('0x42')]['id']}})[_0x53d4('0x22')](handleEntityNotFound(_0x2154a9,null))['then'](removeEntity(_0x2154a9,null))[_0x53d4('0x41')](handleError(_0x2154a9,null));};exports[_0x53d4('0x47')]=function(_0x91c0f7,_0x2e2115){return db['WhatsappTransferReport'][_0x53d4('0x47')]()[_0x53d4('0x22')](respondWithResult(_0x2e2115,null))[_0x53d4('0x41')](handleError(_0x2e2115,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 148d862..6ee9686 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 _0x8d43=['request-promise','path','rimraf','define','WhatsappTransferReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x29d530,_0x5da0d7){var _0x242905=function(_0x5e7857){while(--_0x5e7857){_0x29d530['push'](_0x29d530['shift']());}};_0x242905(++_0x5da0d7);}(_0x8d43,0x1b4));var _0x38d4=function(_0x25cb23,_0xc3ead6){_0x25cb23=_0x25cb23-0x0;var _0x1019d1=_0x8d43[_0x25cb23];return _0x1019d1;};'use strict';var _=require('lodash');var util=require(_0x38d4('0x0'));var logger=require(_0x38d4('0x1'))('api');var moment=require(_0x38d4('0x2'));var BPromise=require(_0x38d4('0x3'));var rp=require(_0x38d4('0x4'));var fs=require('fs');var path=require(_0x38d4('0x5'));var rimraf=require(_0x38d4('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x4ea321,_0x338a82){return _0x4ea321[_0x38d4('0x7')](_0x38d4('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x38d4('0x9'),'fields':[_0x38d4('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8246=['WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x348931,_0x5e6eaa){var _0x3255f1=function(_0x205469){while(--_0x205469){_0x348931['push'](_0x348931['shift']());}};_0x3255f1(++_0x5e6eaa);}(_0x8246,0x1c5));var _0x6824=function(_0x54e7bf,_0x2e23aa){_0x54e7bf=_0x54e7bf-0x0;var _0xad87f7=_0x8246[_0x54e7bf];return _0xad87f7;};'use strict';var _=require(_0x6824('0x0'));var util=require(_0x6824('0x1'));var logger=require(_0x6824('0x2'))(_0x6824('0x3'));var moment=require(_0x6824('0x4'));var BPromise=require(_0x6824('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6824('0x6'));var rimraf=require(_0x6824('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x6824('0x8')]=function(_0x52e0cb,_0x31fdfc){return _0x52e0cb['define'](_0x6824('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x6824('0xa'),'fields':[_0x6824('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 6787842..8b10e34 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 _0x4ee0=['request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x20e5d4,_0x4ae460){var _0x54d52a=function(_0x3c3192){while(--_0x3c3192){_0x20e5d4['push'](_0x20e5d4['shift']());}};_0x54d52a(++_0x4ae460);}(_0x4ee0,0x102));var _0x04ee=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x4ee0[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x04ee('0x0'));var util=require(_0x04ee('0x1'));var moment=require(_0x04ee('0x2'));var BPromise=require(_0x04ee('0x3'));var rs=require(_0x04ee('0x4'));var fs=require('fs');var Redis=require(_0x04ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x04ee('0x6'));var logger=require(_0x04ee('0x7'))(_0x04ee('0x8'));var config=require(_0x04ee('0x9'));var jayson=require(_0x04ee('0xa'));var client=jayson[_0x04ee('0xb')][_0x04ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x291d30,_0x1bae38,_0x55dbc2){return new BPromise(function(_0x1242fa,_0x2f6c6a){return client[_0x04ee('0xd')](_0x291d30,_0x55dbc2)[_0x04ee('0xe')](function(_0x12e53d){logger[_0x04ee('0xf')](_0x04ee('0x10'),_0x1bae38,_0x04ee('0x11'));logger['debug'](_0x04ee('0x12'),_0x1bae38,_0x04ee('0x11'),JSON[_0x04ee('0x13')](_0x12e53d));if(_0x12e53d[_0x04ee('0x14')]){if(_0x12e53d['error'][_0x04ee('0x15')]===0x1f4){logger[_0x04ee('0x14')](_0x04ee('0x10'),_0x1bae38,_0x12e53d[_0x04ee('0x14')][_0x04ee('0x16')]);return _0x2f6c6a(_0x12e53d[_0x04ee('0x14')][_0x04ee('0x16')]);}logger[_0x04ee('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1bae38,_0x12e53d['error'][_0x04ee('0x16')]);return _0x1242fa(_0x12e53d[_0x04ee('0x14')][_0x04ee('0x16')]);}else{logger[_0x04ee('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1bae38,_0x04ee('0x11'));_0x1242fa(_0x12e53d[_0x04ee('0x17')]['message']);}})[_0x04ee('0x18')](function(_0x485953){logger['error'](_0x04ee('0x10'),_0x1bae38,_0x485953);_0x2f6c6a(_0x485953);});});} \ No newline at end of file +var _0xa338=['client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x261c14,_0x8b8e56){var _0x37bcd3=function(_0x4c4f9d){while(--_0x4c4f9d){_0x261c14['push'](_0x261c14['shift']());}};_0x37bcd3(++_0x8b8e56);}(_0xa338,0x1f0));var _0x8a33=function(_0x1993f5,_0x38128b){_0x1993f5=_0x1993f5-0x0;var _0x29a38f=_0xa338[_0x1993f5];return _0x29a38f;};'use strict';var _=require('lodash');var util=require(_0x8a33('0x0'));var moment=require(_0x8a33('0x1'));var BPromise=require(_0x8a33('0x2'));var rs=require(_0x8a33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a33('0x5'))(_0x8a33('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a33('0x7'));var client=jayson[_0x8a33('0x8')][_0x8a33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8934,_0x9e08d0,_0x3b5977){return new BPromise(function(_0x5dffec,_0x254bc1){return client[_0x8a33('0xa')](_0x2c8934,_0x3b5977)['then'](function(_0xbbe828){logger[_0x8a33('0xb')](_0x8a33('0xc'),_0x9e08d0,'request\x20sent');logger[_0x8a33('0xd')](_0x8a33('0xe'),_0x9e08d0,_0x8a33('0xf'),JSON[_0x8a33('0x10')](_0xbbe828));if(_0xbbe828[_0x8a33('0x11')]){if(_0xbbe828['error']['code']===0x1f4){logger[_0x8a33('0x11')](_0x8a33('0xc'),_0x9e08d0,_0xbbe828[_0x8a33('0x11')]['message']);return _0x254bc1(_0xbbe828[_0x8a33('0x11')]['message']);}logger[_0x8a33('0x11')](_0x8a33('0xc'),_0x9e08d0,_0xbbe828[_0x8a33('0x11')][_0x8a33('0x12')]);return _0x5dffec(_0xbbe828['error'][_0x8a33('0x12')]);}else{logger[_0x8a33('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x9e08d0,_0x8a33('0xf'));_0x5dffec(_0xbbe828[_0x8a33('0x13')][_0x8a33('0x12')]);}})[_0x8a33('0x14')](function(_0x135864){logger[_0x8a33('0x11')](_0x8a33('0xc'),_0x9e08d0,_0x135864);_0x254bc1(_0x135864);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 4a8b7d6..5e0e219 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0304=['lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','then','listen','start','info','map','name','Offline\x20apps:','filter','status','online','join','None','seedDB','./config/seedDB','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x12ed1d,_0x46293d){var _0x2496b6=function(_0x2d7c49){while(--_0x2d7c49){_0x12ed1d['push'](_0x12ed1d['shift']());}};_0x2496b6(++_0x46293d);}(_0x0304,0x1ed));var _0x4030=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x0304[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x4030('0x0'));var mysqldb=require(_0x4030('0x1'));var rpc=require(_0x4030('0x2'));var config=require('./config/environment');var logger=require(_0x4030('0x3'))(_0x4030('0x4'));var pm2=require(_0x4030('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x4030('0x6'));var chat=require(_0x4030('0x7'));var whatsapp=require(_0x4030('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x4030('0x9')][_0x4030('0xa')]()[_0x4030('0xb')](function(){return rpc[_0x4030('0xc')]();})[_0x4030('0xb')](function(_0x21cb5e){logger['info'](_0x21cb5e);return chat[_0x4030('0xd')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x4030('0xd')]();})['then'](function(){return transcribe['start']();})['then'](function(_0x29156b){logger[_0x4030('0xe')](_0x29156b);return pm2['start'](pm2Config);})[_0x4030('0xb')](function(_0x603af9){logger[_0x4030('0xe')]('Online\x20apps:',_[_0x4030('0xf')](_['filter'](_0x603af9,{'status':'online'}),_0x4030('0x10'))['join']());logger['info'](_0x4030('0x11'),_[_0x4030('0xf')](_[_0x4030('0x12')](_0x603af9,function(_0x832e56){return _0x832e56[_0x4030('0x13')]!==_0x4030('0x14');}),_0x4030('0x10'))[_0x4030('0x15')]()||_0x4030('0x16'));config[_0x4030('0x17')]&&require(_0x4030('0x18'))['default']();require(_0x4030('0x19'))['default']();})['catch'](function(_0x50aba2){logger[_0x4030('0x1a')](_0x4030('0x1b'),_0x50aba2);process[_0x4030('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x6ae1=['app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','then','start','info','Online\x20apps:','map','online','join','Offline\x20apps:','filter','status','name','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','./config/logger'];(function(_0x17d4b0,_0x161da8){var _0x5969b1=function(_0x528468){while(--_0x528468){_0x17d4b0['push'](_0x17d4b0['shift']());}};_0x5969b1(++_0x161da8);}(_0x6ae1,0x1af));var _0x16ae=function(_0xa32734,_0x373eae){_0xa32734=_0xa32734-0x0;var _0x1e3b41=_0x6ae1[_0xa32734];return _0x1e3b41;};'use strict';var _=require(_0x16ae('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x16ae('0x1'));var logger=require(_0x16ae('0x2'))(_0x16ae('0x3'));var pm2=require(_0x16ae('0x4'));var pm2Config=require(_0x16ae('0x5'));var schedule=require('./config/schedule');var chat=require(_0x16ae('0x6'));var whatsapp=require(_0x16ae('0x7'));var transcribe=require(_0x16ae('0x8'));function main(){return mysqldb['db'][_0x16ae('0x9')][_0x16ae('0xa')]()['then'](function(){return rpc[_0x16ae('0xb')]();})[_0x16ae('0xc')](function(_0x39316e){logger['info'](_0x39316e);return chat[_0x16ae('0xd')]();})['then'](function(){return whatsapp[_0x16ae('0xd')]();})[_0x16ae('0xc')](function(){return schedule[_0x16ae('0xd')]();})[_0x16ae('0xc')](function(){return transcribe['start']();})[_0x16ae('0xc')](function(_0x30332c){logger[_0x16ae('0xe')](_0x30332c);return pm2['start'](pm2Config);})[_0x16ae('0xc')](function(_0x494356){logger['info'](_0x16ae('0xf'),_[_0x16ae('0x10')](_['filter'](_0x494356,{'status':_0x16ae('0x11')}),'name')[_0x16ae('0x12')]());logger['info'](_0x16ae('0x13'),_['map'](_[_0x16ae('0x14')](_0x494356,function(_0x172a41){return _0x172a41[_0x16ae('0x15')]!=='online';}),_0x16ae('0x16'))['join']()||_0x16ae('0x17'));config[_0x16ae('0x18')]&&require(_0x16ae('0x19'))[_0x16ae('0x1a')]();require(_0x16ae('0x1b'))['default']();})[_0x16ae('0x1c')](function(_0x1d2a36){logger['error'](_0x16ae('0x1d'),_0x1d2a36);process[_0x16ae('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 15fcc85..e00a9ef 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 _0x5454=['findOne','params','closed','disposition','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','find','name','authenticate','pass','json','Wrong\x20credentials.','startsWith','Unknown\x20authorization\x20format','apikey','getUuid','User','then','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','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','toLowerCase','format','Sequelize','split','length','unshift','join','sign','secret','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','crypto','util','secrets','session','role','fullname','internal','permissions','voicePause','smsPause','openchannelPause','pauseType','showWebBar','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarPrefixRequired','interface','privacyEnabled','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use'];(function(_0x49677b,_0x42b7cd){var _0x24f2fd=function(_0x2938c6){while(--_0x2938c6){_0x49677b['push'](_0x49677b['shift']());}};_0x24f2fd(++_0x42b7cd);}(_0x5454,0xb7));var _0x4545=function(_0x3d6693,_0x246552){_0x3d6693=_0x3d6693-0x0;var _0x5a9b5a=_0x5454[_0x3d6693];return _0x5a9b5a;};'use strict';var db=require(_0x4545('0x0'))['db'];var config=require(_0x4545('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x4545('0x2'));var jwt=require(_0x4545('0x3'));var expressJwt=require('express-jwt');var compose=require(_0x4545('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0x4545('0x5'));var BPromise=require('bluebird');var util=require(_0x4545('0x6'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x4545('0x7')][_0x4545('0x8')]});var userAttributes=['id',_0x4545('0x9'),_0x4545('0xa'),'name',_0x4545('0xb'),'email','userpic',_0x4545('0xc'),'md5secret',_0x4545('0xd'),'chatPause','mailPause','faxPause',_0x4545('0xe'),_0x4545('0xf'),_0x4545('0x10'),_0x4545('0x11'),'lastLoginAt','lastPauseAt','crudPermissions',_0x4545('0x12'),_0x4545('0x13'),_0x4545('0x14'),'phoneBarAutoAnswer',_0x4545('0x15'),_0x4545('0x16'),'phoneBarEnableRecording',_0x4545('0x17'),'phoneBarEnableSettings','phoneBarExpires',_0x4545('0x18'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk',_0x4545('0x19'),'userProfileId',_0x4545('0x1a'),'settingsEnabled','wssPort','downloadVoiceRecordings',_0x4545('0x1b'),_0x4545('0x1c'),'ignorePauseForPreviewCalls',_0x4545('0x1d')];exports[_0x4545('0x1e')]=function(){return this[_0x4545('0x1f')](!![])[_0x4545('0x20')](function(_0x41b4dc,_0x345bc9,_0x4fc47a){if(_0x41b4dc['user']){_0x4fc47a();}else{return db['ChatInteraction'][_0x4545('0x21')]({'where':{'id':_0x41b4dc[_0x4545('0x22')]['id']},'attributes':['id',_0x4545('0x23'),_0x4545('0x24')],'raw':!![]})['then'](function(_0xc56ff3){if(_0xc56ff3&&_0xc56ff3['closed']){return _0x345bc9[_0x4545('0x25')](_0xc56ff3['disposition']===_0x4545('0x26')?0x195:0x193)['json']({'message':_0xc56ff3[_0x4545('0x24')]==='unmanaged'?_0x4545('0x27'):_0x4545('0x28')});}else{_0x4fc47a();}})[_0x4545('0x29')](function(_0x21fda9){_0x4fc47a(_0x21fda9);});}});};exports[_0x4545('0x1f')]=function isAuthenticated(_0x2fcca4){return compose()[_0x4545('0x20')](function(_0x1991c0,_0x3af0a0,_0x2be222){var _0x54fa93;if(_0x1991c0[_0x4545('0x2a')][_0x4545('0x2b')]){if(_['startsWith'](_0x1991c0[_0x4545('0x2a')]['authorization'],'Basic')){var _0x4a8145=basicAuth(_0x1991c0);db['User'][_0x4545('0x2c')]({'where':{'name':_0x4a8145[_0x4545('0x2d')]}})['then'](function(_0x3f2757){if(!_0x3f2757||!_0x3f2757[_0x4545('0x2e')](_0x4a8145[_0x4545('0x2f')])){return _0x3af0a0['status'](0x191)[_0x4545('0x30')]({'message':_0x4545('0x31')});}_0x1991c0['user']={'id':_0x3f2757['id']};_0x2be222();})['catch'](function(_0x3a3138){_0x2be222(_0x3a3138);});}else if(_[_0x4545('0x32')](_0x1991c0[_0x4545('0x2a')][_0x4545('0x2b')],'Bearer')){validateJwt(_0x1991c0,_0x3af0a0,_0x2be222);}else{if(_0x2fcca4){_0x2be222();}else{return _0x3af0a0['status'](0x193)['json']({'message':_0x4545('0x33')});}}}else if(_0x1991c0['query'][_0x4545('0x34')]){try{var _0x2cf456={'audience':hardwareConf[_0x4545('0x35')](),'issuer':hardwareConf[_0x4545('0x35')]()};verifyJwt(_0x1991c0['query'][_0x4545('0x34')],_0x2cf456)['then'](function(_0x563d1f){return db[_0x4545('0x36')]['find']({'where':{'id':_0x563d1f['sub']}})[_0x4545('0x37')](function(_0x48c7f5){_0x54fa93=_0x48c7f5;return db[_0x4545('0x38')][_0x4545('0x21')]({'where':{'id':0x1},'attributes':[_0x4545('0x39'),_0x4545('0x3a')],'raw':!![]});})[_0x4545('0x37')](function(_0x5a8b12){if(!_0x54fa93||!_['isEqual'](_0x54fa93[_0x4545('0x3b')],_0x563d1f['nonce'])){return _0x3af0a0['status'](0x191)[_0x4545('0x30')]({'message':_0x4545('0x3c')});}if(_0x54fa93[_0x4545('0x3d')]){return _0x3af0a0['status'](0x191)[_0x4545('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x54fa93[_0x4545('0x3e')]){if(_0x5a8b12[_0x4545('0x3a')]>0x0){if(moment(_0x54fa93[_0x4545('0x3f')])[_0x4545('0x40')](_0x5a8b12[_0x4545('0x3a')],'minutes')>moment()){return _0x3af0a0[_0x4545('0x25')](0x191)[_0x4545('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3af0a0[_0x4545('0x25')](0x191)[_0x4545('0x30')]({'message':_0x4545('0x41')});}}_0x1991c0[_0x4545('0x42')]={'id':_0x54fa93['id']};_0x2be222();});})[_0x4545('0x29')](function(){return _0x3af0a0[_0x4545('0x25')](0x191)[_0x4545('0x30')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x594dd5){_0x2be222(_0x594dd5);}}else if(_0x2fcca4){_0x2be222();}else{return _0x3af0a0[_0x4545('0x25')](0x193)[_0x4545('0x30')]({'message':_0x4545('0x33')});}})[_0x4545('0x20')](function(_0x3d0073,_0x30c4e8,_0x24e1c1){if(_0x3d0073[_0x4545('0x42')]){db[_0x4545('0x36')][_0x4545('0x2c')]({'where':{'id':_0x3d0073[_0x4545('0x42')]['id']},'attributes':userAttributes})[_0x4545('0x37')](function(_0xef8db3){if(!_0xef8db3){return _0x30c4e8[_0x4545('0x25')](0x194)[_0x4545('0x30')]({'message':_0x4545('0x43')});}_0x3d0073[_0x4545('0x42')]=_0xef8db3;_0x24e1c1();})['catch'](function(_0x5ab489){_0x24e1c1(_0x5ab489);});}else if(_0x2fcca4){_0x24e1c1();}else{return _0x30c4e8[_0x4545('0x25')](0x194)[_0x4545('0x30')]({'message':_0x4545('0x44')});}});};exports[_0x4545('0x45')]=function canUpdate(){return compose()[_0x4545('0x20')](function(_0x47adbf,_0x21a21f,_0x2ae44b){return licenseUtil[_0x4545('0x46')]()['then'](function(_0x487889){if(_0x487889[_0x4545('0x47')]){_0x2ae44b();}else{return _0x21a21f[_0x4545('0x25')](0x193)[_0x4545('0x30')]({'message':'Forbidden'});}})[_0x4545('0x29')](function(_0x1d47ef){_0x2ae44b(_0x1d47ef);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x4545('0x20')](function(_0x37859c,_0x20fd92,_0x4611f0){return licenseUtil[_0x4545('0x46')]()['then'](function(_0x562618){if(_0x562618[_0x4545('0x48')]){_0x4611f0();}else{return _0x20fd92[_0x4545('0x25')](0x193)[_0x4545('0x30')]({'message':'Forbidden'});}})[_0x4545('0x29')](function(_0x4ec4c5){_0x4611f0(_0x4ec4c5);});});};exports[_0x4545('0x49')]=function(_0x3a74b1,_0x251eeb,_0x2041d6){_0x3a74b1['isMiddleware']=!![];return _0x2041d6();};exports[_0x4545('0x4a')]=function signToken(_0x111ae8){return signJwt(_0x111ae8);};exports[_0x4545('0x4b')]=function(_0x581fba,_0x28fa4a){if(!_0x581fba['user']){return _0x28fa4a['status'](0x194)[_0x4545('0x30')]({'message':_0x4545('0x4c')});}var _0x25b57f={'payload':{'id':_0x581fba[_0x4545('0x42')]['id'],'role':_0x581fba['user'][_0x4545('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x25b57f)[_0x4545('0x37')](function(_0x276f8a){_0x28fa4a[_0x4545('0x4d')](_0x4545('0x4e'),_0x276f8a);_0x28fa4a['redirect']('/dashboards/general');})['catch'](function(_0x268626){return _0x28fa4a[_0x4545('0x25')](0x1f4)[_0x4545('0x4f')](_0x268626);});};exports[_0x4545('0x50')]=function(_0x5f44db){if(_[_0x4545('0x51')](_0x5f44db[_0x4545('0x3b')])||_[_0x4545('0x51')](_0x5f44db[_0x4545('0x52')])){return null;}else{return createJwt(_0x5f44db);}};exports[_0x4545('0x53')]=function(_0x186dfe){_0x186dfe['apiKeyNonce']=generateNonce();_0x186dfe[_0x4545('0x52')]=generateIssuedAt();return createJwt(_0x186dfe);};exports[_0x4545('0x54')]=function(_0x29862f,_0xee0265){var _0x4b9683=_0x29862f['query'][_0x4545('0x34')];if(_0x4b9683){var _0xee8b3a={'nonce':_0xee0265[_0x4545('0x3b')],'iat':_0xee0265[_0x4545('0x52')],'audience':hardwareConf[_0x4545('0x35')](),'issuer':hardwareConf[_0x4545('0x35')]()};return verifyJwt(_0x4b9683,_0xee8b3a)[_0x4545('0x37')](function(){return generateApiKey(_0xee0265);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0xbece58){var _0x3cea38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3cea38[_0x4545('0x55')](_0xbece58))throw new db['Sequelize'][(_0x4545('0x56'))](_0x4545('0x57'));return;};exports[_0x4545('0x58')]=function(_0xf2cb38,_0x51187e,_0x786578){var _0x1a0c8e=encryptor[_0x4545('0x59')](_0x51187e)['split'](',');for(var _0x297b93=0x0;_0x297b93<_0x786578;_0x297b93++){if(!_0x1a0c8e[_0x297b93])break;if(_0xf2cb38['toLowerCase']()===_0x1a0c8e[_0x297b93][_0x4545('0x5a')]()){var _0x59c5c4=util[_0x4545('0x5b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x786578);if(_0x786578===0x1){_0x59c5c4='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x4545('0x5c'))][(_0x4545('0x56'))](_0x59c5c4);}}return;};exports['updatePasswordsHistory']=function(_0x28e853,_0x290098){var _0x29eeb3=_0x290098?encryptor[_0x4545('0x59')](_0x290098)[_0x4545('0x5d')](','):[];if(_0x29eeb3[_0x4545('0x5e')]===0x5){_0x29eeb3['splice'](-0x1,0x1);}_0x29eeb3[_0x4545('0x5f')](_0x28e853);return encryptor['encryptString'](_0x29eeb3[_0x4545('0x60')](','));};function signJwt(_0x2585ae){var _0x3d096b=BPromise['promisify'](jwt[_0x4545('0x61')],{'context':jwt});var _0xff9d0e=_0x2585ae[_0x4545('0x62')]||config['secrets'][_0x4545('0x8')];return new BPromise(function(_0x51ba63,_0x797de5){_0x3d096b(_0x2585ae[_0x4545('0x63')],_0xff9d0e,_0x2585ae[_0x4545('0x64')])['then'](function(_0x12c691){_0x51ba63(_0x12c691);})['catch'](function(_0x3f0680){_0x797de5(_0x3f0680);});});}function verifyJwt(_0x142bee,_0x26898a,_0x455a71){var _0x1165b5=BPromise['promisify'](jwt[_0x4545('0x65')],{'context':jwt});var _0x4993b5=_0x455a71||config[_0x4545('0x7')]['session'];return new BPromise(function(_0x17d223,_0xa5b20c){_0x1165b5(_0x142bee,_0x4993b5,_0x26898a)['then'](function(_0x261a35){_0x17d223(_0x261a35);})[_0x4545('0x29')](function(_0x384790){_0xa5b20c(_0x384790);});});}function generateNonce(){return crypto[_0x4545('0x66')](0x10)['toString'](_0x4545('0x67'));}function generateIssuedAt(){return Math[_0x4545('0x68')](Date[_0x4545('0x69')]()/0x3e8)[_0x4545('0x6a')]();}function createJwt(_0x5c2154){var _0x389e7c={'payload':{'iat':_0x5c2154[_0x4545('0x52')],'nonce':_0x5c2154[_0x4545('0x3b')]},'options':{'algorithm':_0x4545('0x6b'),'subject':_0x5c2154['id'][_0x4545('0x6a')](),'issuer':hardwareConf[_0x4545('0x35')](),'audience':hardwareConf[_0x4545('0x35')]()}};return signJwt(_0x389e7c)[_0x4545('0x37')](function(_0x5aed08){return{'iat':_0x5c2154[_0x4545('0x52')],'nonce':_0x5c2154[_0x4545('0x3b')],'token':_0x5aed08};});} \ No newline at end of file +var _0xcf5e=['canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','redirect','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','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','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','join','promisify','sign','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','moment','secrets','session','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','closed','then','status','disposition','unmanaged','Unmanaged.','Forbidden.','authorization','Basic','User','authenticate','pass','json','Wrong\x20credentials.','catch','startsWith','headers','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','findOne','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','blockDuration','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xcf5e,0x132));var _0xecf5=function(_0x19521b,_0x38cfa1){_0x19521b=_0x19521b-0x0;var _0x733f4f=_0xcf5e[_0x19521b];return _0x733f4f;};'use strict';var db=require(_0xecf5('0x0'))['db'];var config=require(_0xecf5('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xecf5('0x2'));var encryptor=require(_0xecf5('0x3'));var _=require('lodash');var jwt=require(_0xecf5('0x4'));var expressJwt=require(_0xecf5('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xecf5('0x6'));var crypto=require(_0xecf5('0x7'));var BPromise=require(_0xecf5('0x8'));var util=require('util');var moment=require(_0xecf5('0x9'));var validateJwt=expressJwt({'secret':config[_0xecf5('0xa')][_0xecf5('0xb')]});var userAttributes=['id','role','fullname',_0xecf5('0xc'),_0xecf5('0xd'),_0xecf5('0xe'),_0xecf5('0xf'),_0xecf5('0x10'),_0xecf5('0x11'),_0xecf5('0x12'),_0xecf5('0x13'),_0xecf5('0x14'),_0xecf5('0x15'),_0xecf5('0x16'),_0xecf5('0x17'),_0xecf5('0x18'),_0xecf5('0x19'),_0xecf5('0x1a'),_0xecf5('0x1b'),_0xecf5('0x1c'),'allowmessenger','passwordResetAt',_0xecf5('0x1d'),_0xecf5('0x1e'),_0xecf5('0x1f'),_0xecf5('0x20'),_0xecf5('0x21'),_0xecf5('0x22'),'phoneBarEnableSettings',_0xecf5('0x23'),_0xecf5('0x24'),'phoneBarRemoteControl',_0xecf5('0x25'),_0xecf5('0x26'),_0xecf5('0x27'),_0xecf5('0x28'),_0xecf5('0x29'),'settingsEnabled',_0xecf5('0x2a'),_0xecf5('0x2b'),_0xecf5('0x2c'),'downloadAttachments','ignorePauseForPreviewCalls',_0xecf5('0x2d')];exports[_0xecf5('0x2e')]=function(){return this[_0xecf5('0x2f')](!![])[_0xecf5('0x30')](function(_0x455363,_0x158d49,_0x11f0cc){if(_0x455363[_0xecf5('0x31')]){_0x11f0cc();}else{return db[_0xecf5('0x32')]['findOne']({'where':{'id':_0x455363[_0xecf5('0x33')]['id']},'attributes':['id',_0xecf5('0x34'),'disposition'],'raw':!![]})[_0xecf5('0x35')](function(_0x7912a6){if(_0x7912a6&&_0x7912a6[_0xecf5('0x34')]){return _0x158d49[_0xecf5('0x36')](_0x7912a6[_0xecf5('0x37')]===_0xecf5('0x38')?0x195:0x193)['json']({'message':_0x7912a6['disposition']===_0xecf5('0x38')?_0xecf5('0x39'):_0xecf5('0x3a')});}else{_0x11f0cc();}})['catch'](function(_0x380359){_0x11f0cc(_0x380359);});}});};exports[_0xecf5('0x2f')]=function isAuthenticated(_0x46d84a){return compose()[_0xecf5('0x30')](function(_0x16faa6,_0x2aefdb,_0xb5578a){var _0x11093e;if(_0x16faa6['headers'][_0xecf5('0x3b')]){if(_['startsWith'](_0x16faa6['headers'][_0xecf5('0x3b')],_0xecf5('0x3c'))){var _0x2ccafb=basicAuth(_0x16faa6);db[_0xecf5('0x3d')]['find']({'where':{'name':_0x2ccafb['name']}})[_0xecf5('0x35')](function(_0x22964f){if(!_0x22964f||!_0x22964f[_0xecf5('0x3e')](_0x2ccafb[_0xecf5('0x3f')])){return _0x2aefdb[_0xecf5('0x36')](0x191)[_0xecf5('0x40')]({'message':_0xecf5('0x41')});}_0x16faa6['user']={'id':_0x22964f['id']};_0xb5578a();})[_0xecf5('0x42')](function(_0x49a0e5){_0xb5578a(_0x49a0e5);});}else if(_[_0xecf5('0x43')](_0x16faa6[_0xecf5('0x44')][_0xecf5('0x3b')],_0xecf5('0x45'))){validateJwt(_0x16faa6,_0x2aefdb,_0xb5578a);}else{if(_0x46d84a){_0xb5578a();}else{return _0x2aefdb[_0xecf5('0x36')](0x193)['json']({'message':_0xecf5('0x46')});}}}else if(_0x16faa6[_0xecf5('0x47')][_0xecf5('0x48')]){try{var _0xd70cfb={'audience':hardwareConf[_0xecf5('0x49')](),'issuer':hardwareConf[_0xecf5('0x49')]()};verifyJwt(_0x16faa6[_0xecf5('0x47')][_0xecf5('0x48')],_0xd70cfb)[_0xecf5('0x35')](function(_0x4a31af){return db[_0xecf5('0x3d')][_0xecf5('0x4a')]({'where':{'id':_0x4a31af[_0xecf5('0x4b')]}})['then'](function(_0x236362){_0x11093e=_0x236362;return db['Setting'][_0xecf5('0x4c')]({'where':{'id':0x1},'attributes':[_0xecf5('0x4d'),'blockDuration'],'raw':!![]});})[_0xecf5('0x35')](function(_0x3eb008){if(!_0x11093e||!_[_0xecf5('0x4e')](_0x11093e[_0xecf5('0x4f')],_0x4a31af[_0xecf5('0x50')])){return _0x2aefdb['status'](0x191)[_0xecf5('0x40')]({'message':_0xecf5('0x51')});}if(_0x11093e[_0xecf5('0x52')]){return _0x2aefdb['status'](0x191)[_0xecf5('0x40')]({'message':_0xecf5('0x53')});}if(_0x11093e['blocked']){if(_0x3eb008['blockDuration']>0x0){if(moment(_0x11093e[_0xecf5('0x54')])[_0xecf5('0x55')](_0x3eb008[_0xecf5('0x56')],_0xecf5('0x57'))>moment()){return _0x2aefdb[_0xecf5('0x36')](0x191)['json']({'message':_0xecf5('0x53')});}}else{return _0x2aefdb['status'](0x191)[_0xecf5('0x40')]({'message':_0xecf5('0x53')});}}_0x16faa6[_0xecf5('0x31')]={'id':_0x11093e['id']};_0xb5578a();});})['catch'](function(){return _0x2aefdb[_0xecf5('0x36')](0x191)[_0xecf5('0x40')]({'message':_0xecf5('0x53')});});}catch(_0x4943f6){_0xb5578a(_0x4943f6);}}else if(_0x46d84a){_0xb5578a();}else{return _0x2aefdb[_0xecf5('0x36')](0x193)[_0xecf5('0x40')]({'message':_0xecf5('0x46')});}})[_0xecf5('0x30')](function(_0x452e80,_0x1f7b88,_0x477071){if(_0x452e80[_0xecf5('0x31')]){db['User'][_0xecf5('0x4a')]({'where':{'id':_0x452e80['user']['id']},'attributes':userAttributes})[_0xecf5('0x35')](function(_0x209cec){if(!_0x209cec){return _0x1f7b88[_0xecf5('0x36')](0x194)['json']({'message':_0xecf5('0x58')});}_0x452e80['user']=_0x209cec;_0x477071();})['catch'](function(_0x2a48d6){_0x477071(_0x2a48d6);});}else if(_0x46d84a){_0x477071();}else{return _0x1f7b88['status'](0x194)[_0xecf5('0x40')]({'message':_0xecf5('0x59')});}});};exports[_0xecf5('0x5a')]=function canUpdate(){return compose()[_0xecf5('0x30')](function(_0x3cf599,_0x25a778,_0x481c46){return licenseUtil[_0xecf5('0x5b')]()['then'](function(_0x3f8fd1){if(_0x3f8fd1[_0xecf5('0x5c')]){_0x481c46();}else{return _0x25a778[_0xecf5('0x36')](0x193)['json']({'message':_0xecf5('0x5d')});}})[_0xecf5('0x42')](function(_0x2edd17){_0x481c46(_0x2edd17);});});};exports[_0xecf5('0x5e')]=function isWebrtcLicence(){return compose()['use'](function(_0x46b910,_0x1d6a96,_0x301789){return licenseUtil['getLicense']()[_0xecf5('0x35')](function(_0x1595fd){if(_0x1595fd[_0xecf5('0x5f')]){_0x301789();}else{return _0x1d6a96[_0xecf5('0x36')](0x193)[_0xecf5('0x40')]({'message':_0xecf5('0x5d')});}})[_0xecf5('0x42')](function(_0x890ebf){_0x301789(_0x890ebf);});});};exports[_0xecf5('0x60')]=function(_0x3f8ced,_0x4a135a,_0x190c02){_0x3f8ced[_0xecf5('0x60')]=!![];return _0x190c02();};exports[_0xecf5('0x61')]=function signToken(_0x4dbaf1){return signJwt(_0x4dbaf1);};exports[_0xecf5('0x62')]=function(_0x52a214,_0x2db6e4){if(!_0x52a214[_0xecf5('0x31')]){return _0x2db6e4[_0xecf5('0x36')](0x194)[_0xecf5('0x40')]({'message':_0xecf5('0x63')});}var _0xff65a={'payload':{'id':_0x52a214[_0xecf5('0x31')]['id'],'role':_0x52a214[_0xecf5('0x31')][_0xecf5('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0xff65a)[_0xecf5('0x35')](function(_0x54751d){_0x2db6e4['cookie']('motion.token',_0x54751d);_0x2db6e4[_0xecf5('0x65')]('/dashboards/general');})[_0xecf5('0x42')](function(_0x1b3f89){return _0x2db6e4['status'](0x1f4)[_0xecf5('0x66')](_0x1b3f89);});};exports[_0xecf5('0x67')]=function(_0x568346){if(_[_0xecf5('0x68')](_0x568346[_0xecf5('0x4f')])||_[_0xecf5('0x68')](_0x568346['apiKeyIat'])){return null;}else{return createJwt(_0x568346);}};exports[_0xecf5('0x69')]=function(_0x27c74d){_0x27c74d[_0xecf5('0x4f')]=generateNonce();_0x27c74d[_0xecf5('0x6a')]=generateIssuedAt();return createJwt(_0x27c74d);};exports[_0xecf5('0x6b')]=function(_0x6b2e37,_0x5a466d){var _0x39e1a1=_0x6b2e37['query']['apikey'];if(_0x39e1a1){var _0x57ea5a={'nonce':_0x5a466d[_0xecf5('0x4f')],'iat':_0x5a466d[_0xecf5('0x6a')],'audience':hardwareConf[_0xecf5('0x49')](),'issuer':hardwareConf[_0xecf5('0x49')]()};return verifyJwt(_0x39e1a1,_0x57ea5a)[_0xecf5('0x35')](function(){return generateApiKey(_0x5a466d);});}else{throw{'message':_0xecf5('0x6c')};}};exports['validatePasswordPattern']=function(_0x305768){var _0x1a0e75=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1a0e75[_0xecf5('0x6d')](_0x305768))throw new db[(_0xecf5('0x6e'))][(_0xecf5('0x6f'))](_0xecf5('0x70'));return;};exports[_0xecf5('0x71')]=function(_0x4acca6,_0x44c2a7,_0x54f8b3){var _0x4e10c6=encryptor['decryptString'](_0x44c2a7)[_0xecf5('0x72')](',');for(var _0x1a6fca=0x0;_0x1a6fca<_0x54f8b3;_0x1a6fca++){if(!_0x4e10c6[_0x1a6fca])break;if(_0x4acca6[_0xecf5('0x73')]()===_0x4e10c6[_0x1a6fca][_0xecf5('0x73')]()){var _0x32caaf=util['format'](_0xecf5('0x74'),_0x54f8b3);if(_0x54f8b3===0x1){_0x32caaf=_0xecf5('0x75');}throw new db[(_0xecf5('0x6e'))][(_0xecf5('0x6f'))](_0x32caaf);}}return;};exports[_0xecf5('0x76')]=function(_0x36e8db,_0x1f49bf){var _0x100b25=_0x1f49bf?encryptor['decryptString'](_0x1f49bf)[_0xecf5('0x72')](','):[];if(_0x100b25[_0xecf5('0x77')]===0x5){_0x100b25['splice'](-0x1,0x1);}_0x100b25[_0xecf5('0x78')](_0x36e8db);return encryptor['encryptString'](_0x100b25[_0xecf5('0x79')](','));};function signJwt(_0x5c15fe){var _0x1cc3a6=BPromise[_0xecf5('0x7a')](jwt[_0xecf5('0x7b')],{'context':jwt});var _0x499b1a=_0x5c15fe['secret']||config[_0xecf5('0xa')][_0xecf5('0xb')];return new BPromise(function(_0x10de80,_0x227f59){_0x1cc3a6(_0x5c15fe['payload'],_0x499b1a,_0x5c15fe[_0xecf5('0x7c')])['then'](function(_0x53004c){_0x10de80(_0x53004c);})[_0xecf5('0x42')](function(_0x36c3ee){_0x227f59(_0x36c3ee);});});}function verifyJwt(_0x483a2b,_0x55c10d,_0x307b8b){var _0x4f51cb=BPromise[_0xecf5('0x7a')](jwt[_0xecf5('0x7d')],{'context':jwt});var _0x3d82e8=_0x307b8b||config[_0xecf5('0xa')]['session'];return new BPromise(function(_0xd0f326,_0xc008d){_0x4f51cb(_0x483a2b,_0x3d82e8,_0x55c10d)[_0xecf5('0x35')](function(_0x50cb23){_0xd0f326(_0x50cb23);})[_0xecf5('0x42')](function(_0x5b89b0){_0xc008d(_0x5b89b0);});});}function generateNonce(){return crypto[_0xecf5('0x7e')](0x10)[_0xecf5('0x7f')](_0xecf5('0x80'));}function generateIssuedAt(){return Math[_0xecf5('0x81')](Date[_0xecf5('0x82')]()/0x3e8)[_0xecf5('0x7f')]();}function createJwt(_0x5ba1b6){var _0x135499={'payload':{'iat':_0x5ba1b6[_0xecf5('0x6a')],'nonce':_0x5ba1b6['apiKeyNonce']},'options':{'algorithm':_0xecf5('0x83'),'subject':_0x5ba1b6['id'][_0xecf5('0x7f')](),'issuer':hardwareConf[_0xecf5('0x49')](),'audience':hardwareConf[_0xecf5('0x49')]()}};return signJwt(_0x135499)[_0xecf5('0x35')](function(_0x59da70){return{'iat':_0x5ba1b6[_0xecf5('0x6a')],'nonce':_0x5ba1b6[_0xecf5('0x4f')],'token':_0x59da70};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index e9ec908..417c15d 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 _0x9072=['createReadStream','createWriteStream','update','binary','final','close','decryptFile','write','end','unlink','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9072,0x186));var _0x2907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9072[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x2907('0x0'));var fs=require('fs');var BPromise=require(_0x2907('0x1'));var _=require('lodash');var config=require(_0x2907('0x2'));var logger=require(_0x2907('0x3'))(_0x2907('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2907('0x5')][_0x2907('0x6')],'algorithm':_0x2907('0x7')};const fileOptions={'algorithm':_0x2907('0x8')};if(config[_0x2907('0x9')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x2907('0x9')][_0x2907('0xa')]);if(isSupported){fileOptions[_0x2907('0xa')]=config[_0x2907('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2907('0xb')](',\x20');logger['error'](config[_0x2907('0x9')][_0x2907('0xa')],_0x2907('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1e7800){return AES_SUPPORTED_RX[_0x2907('0xd')](_0x1e7800);}function getSupportedCiphers(){return crypto[_0x2907('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xaf82d0){return getSupportedCiphers()[_0x2907('0xf')](_0xaf82d0)>-0x1;}function combineOptions(_0x1bb2fa){var _0x12e58c={};for(var _0x2603de in fileOptions){if(fileOptions['hasOwnProperty'](_0x2603de)){_0x12e58c[_0x2603de]=fileOptions[_0x2603de];}}if(_0x1bb2fa){for(var _0x243100 in _0x1bb2fa){if(_0x1bb2fa[_0x2907('0x10')](_0x243100)){_0x12e58c[_0x243100]=_0x1bb2fa[_0x243100];}}}return _0x12e58c;}exports[_0x2907('0x11')]=function(_0x1d49fe,_0x556b9b,_0x46f736,_0x5adb42){return new BPromise(function(_0x99c829,_0xb2966c){_0x5adb42=combineOptions(_0x5adb42);var _0x19766e=new Buffer(_0x46f736);var _0x1e7ef2=fs[_0x2907('0x12')](_0x1d49fe);var _0x56ebc2=fs[_0x2907('0x13')](_0x556b9b);var _0x2abe4d=crypto['createCipher'](_0x5adb42[_0x2907('0xa')],_0x19766e);_0x1e7ef2['on']('data',function(_0x56e8e3){var _0x3d3a71=new Buffer(_0x2abe4d[_0x2907('0x14')](_0x56e8e3),_0x2907('0x15'));_0x56ebc2['write'](_0x3d3a71);});_0x1e7ef2['on']('end',function(){try{var _0x2a1c5a=new Buffer(_0x2abe4d[_0x2907('0x16')](_0x2907('0x15')),_0x2907('0x15'));_0x56ebc2['write'](_0x2a1c5a);_0x56ebc2['end']();_0x56ebc2['on'](_0x2907('0x17'),function(){return _0x99c829(_0x556b9b);});}catch(_0x5a46f0){fs['unlink'](_0x556b9b);return _0xb2966c(_0x5a46f0);}});});};exports[_0x2907('0x18')]=function(_0x109290,_0x5bf721,_0x86978c,_0x5130b5){return new BPromise(function(_0x308fc7,_0x55cf87){_0x5130b5=combineOptions(_0x5130b5);var _0x57e2b5=new Buffer(_0x86978c);var _0x3f310a=fs[_0x2907('0x12')](_0x109290);var _0x509ebd=fs[_0x2907('0x13')](_0x5bf721);var _0x11ccfc=crypto['createDecipher'](_0x5130b5[_0x2907('0xa')],_0x57e2b5);_0x3f310a['on']('data',function(_0x30056f){var _0x50acf6=new Buffer(_0x11ccfc['update'](_0x30056f),'binary');_0x509ebd[_0x2907('0x19')](_0x50acf6);});_0x3f310a['on'](_0x2907('0x1a'),function(){try{var _0x9fa45c=new Buffer(_0x11ccfc[_0x2907('0x16')](_0x2907('0x15')),_0x2907('0x15'));_0x509ebd['write'](_0x9fa45c);_0x509ebd[_0x2907('0x1a')]();_0x509ebd['on'](_0x2907('0x17'),function(){return _0x308fc7(_0x5bf721);});}catch(_0x2738e5){fs[_0x2907('0x1b')](_0x5bf721);return _0x55cf87(_0x2738e5);}});});};exports[_0x2907('0x1c')]=function(_0x38291e,_0x2cef0a,_0x1bfa47){var _0x95bf73=_0x1bfa47||stringOptions[_0x2907('0xa')];var _0x2366a5=_0x2cef0a||stringOptions[_0x2907('0x1d')];var _0x31d658=crypto[_0x2907('0x1e')](_0x95bf73,_0x2366a5);var _0x12092f=_0x31d658[_0x2907('0x14')](_0x38291e,_0x2907('0x1f'),_0x2907('0x20'));_0x12092f+=_0x31d658[_0x2907('0x16')](_0x2907('0x20'));return _0x12092f;};exports[_0x2907('0x21')]=function(_0x4d6c63,_0x2dd79c,_0x18ee3e){var _0x271851=_0x18ee3e||stringOptions[_0x2907('0xa')];var _0x578c8d=_0x2dd79c||stringOptions[_0x2907('0x1d')];var _0x256535=crypto['createDecipher'](_0x271851,_0x578c8d);var _0x48bfe8=_0x256535[_0x2907('0x14')](_0x4d6c63,_0x2907('0x20'),_0x2907('0x1f'));_0x48bfe8+=_0x256535[_0x2907('0x16')](_0x2907('0x1f'));return _0x48bfe8;}; \ No newline at end of file +var _0x5b54=['encryptString','base64','decryptString','utf8','bluebird','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','write','end','binary','unlink','decryptFile','createDecipher','final','close'];(function(_0x32ae47,_0x51d275){var _0x1bd719=function(_0x142879){while(--_0x142879){_0x32ae47['push'](_0x32ae47['shift']());}};_0x1bd719(++_0x51d275);}(_0x5b54,0x104));var _0x45b5=function(_0x48494e,_0x1b2419){_0x48494e=_0x48494e-0x0;var _0x41bf90=_0x5b54[_0x48494e];return _0x41bf90;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x45b5('0x0'));var _=require('lodash');var config=require(_0x45b5('0x1'));var logger=require(_0x45b5('0x2'))(_0x45b5('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x45b5('0x4')};const fileOptions={'algorithm':_0x45b5('0x5')};if(config['encrypt']&&config[_0x45b5('0x6')][_0x45b5('0x7')]){var isSupported=isAlgorithmSupported(config[_0x45b5('0x6')]['algorithm']);if(isSupported){fileOptions[_0x45b5('0x7')]=config[_0x45b5('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x45b5('0x8')](',\x20');logger['error'](config['encrypt'][_0x45b5('0x7')],_0x45b5('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x1510a2){return AES_SUPPORTED_RX[_0x45b5('0xa')](_0x1510a2);}function getSupportedCiphers(){return crypto[_0x45b5('0xb')]()[_0x45b5('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x3e4a46){return getSupportedCiphers()[_0x45b5('0xd')](_0x3e4a46)>-0x1;}function combineOptions(_0x9ffb90){var _0x4957ea={};for(var _0x206a17 in fileOptions){if(fileOptions[_0x45b5('0xe')](_0x206a17)){_0x4957ea[_0x206a17]=fileOptions[_0x206a17];}}if(_0x9ffb90){for(var _0x45eafb in _0x9ffb90){if(_0x9ffb90[_0x45b5('0xe')](_0x45eafb)){_0x4957ea[_0x45eafb]=_0x9ffb90[_0x45eafb];}}}return _0x4957ea;}exports[_0x45b5('0xf')]=function(_0x4262f4,_0x39465a,_0x52f06c,_0x21e532){return new BPromise(function(_0x42fde5,_0x2ec405){_0x21e532=combineOptions(_0x21e532);var _0x16270f=new Buffer(_0x52f06c);var _0x4027aa=fs['createReadStream'](_0x4262f4);var _0x560400=fs[_0x45b5('0x10')](_0x39465a);var _0x5c8110=crypto[_0x45b5('0x11')](_0x21e532[_0x45b5('0x7')],_0x16270f);_0x4027aa['on'](_0x45b5('0x12'),function(_0x32470b){var _0x435772=new Buffer(_0x5c8110[_0x45b5('0x13')](_0x32470b),'binary');_0x560400[_0x45b5('0x14')](_0x435772);});_0x4027aa['on'](_0x45b5('0x15'),function(){try{var _0x1db56f=new Buffer(_0x5c8110['final'](_0x45b5('0x16')),_0x45b5('0x16'));_0x560400[_0x45b5('0x14')](_0x1db56f);_0x560400[_0x45b5('0x15')]();_0x560400['on']('close',function(){return _0x42fde5(_0x39465a);});}catch(_0x1a82cb){fs[_0x45b5('0x17')](_0x39465a);return _0x2ec405(_0x1a82cb);}});});};exports[_0x45b5('0x18')]=function(_0x450e25,_0x52947a,_0x1040f8,_0x1bbb5d){return new BPromise(function(_0x33eb17,_0xc58289){_0x1bbb5d=combineOptions(_0x1bbb5d);var _0x146cc8=new Buffer(_0x1040f8);var _0x1e01d7=fs['createReadStream'](_0x450e25);var _0x17f7bd=fs[_0x45b5('0x10')](_0x52947a);var _0xf16876=crypto[_0x45b5('0x19')](_0x1bbb5d[_0x45b5('0x7')],_0x146cc8);_0x1e01d7['on'](_0x45b5('0x12'),function(_0x190d36){var _0x4f9a84=new Buffer(_0xf16876[_0x45b5('0x13')](_0x190d36),_0x45b5('0x16'));_0x17f7bd['write'](_0x4f9a84);});_0x1e01d7['on'](_0x45b5('0x15'),function(){try{var _0x6cf2ce=new Buffer(_0xf16876[_0x45b5('0x1a')](_0x45b5('0x16')),_0x45b5('0x16'));_0x17f7bd['write'](_0x6cf2ce);_0x17f7bd[_0x45b5('0x15')]();_0x17f7bd['on'](_0x45b5('0x1b'),function(){return _0x33eb17(_0x52947a);});}catch(_0x53ba74){fs['unlink'](_0x52947a);return _0xc58289(_0x53ba74);}});});};exports[_0x45b5('0x1c')]=function(_0x407548,_0x2a594d,_0x59e846){var _0x413127=_0x59e846||stringOptions['algorithm'];var _0x257562=_0x2a594d||stringOptions['secret'];var _0x6022fd=crypto[_0x45b5('0x11')](_0x413127,_0x257562);var _0x339171=_0x6022fd[_0x45b5('0x13')](_0x407548,'utf8','base64');_0x339171+=_0x6022fd['final'](_0x45b5('0x1d'));return _0x339171;};exports[_0x45b5('0x1e')]=function(_0x5168d2,_0x4b98df,_0x2bc4f0){var _0x392149=_0x2bc4f0||stringOptions[_0x45b5('0x7')];var _0x55b7a1=_0x4b98df||stringOptions['secret'];var _0x2cebf1=crypto[_0x45b5('0x19')](_0x392149,_0x55b7a1);var _0xf9c2a0=_0x2cebf1['update'](_0x5168d2,_0x45b5('0x1d'),_0x45b5('0x1f'));_0xf9c2a0+=_0x2cebf1[_0x45b5('0x1a')](_0x45b5('0x1f'));return _0xf9c2a0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 2b5fb78..95b8ca5 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 _0x23fa=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s.%s','csv','writeFileSync','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','CSV','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','range','num','isInteger','push','QueryTypes','query'];(function(_0x5a8bd6,_0x1a9c19){var _0x37117d=function(_0x5cf461){while(--_0x5cf461){_0x5a8bd6['push'](_0x5a8bd6['shift']());}};_0x37117d(++_0x1a9c19);}(_0x23fa,0x75));var _0xa23f=function(_0x37ef9e,_0x2ca202){_0x37ef9e=_0x37ef9e-0x0;var _0x5adb7b=_0x23fa[_0x37ef9e];return _0x5adb7b;};'use strict';var util=require(_0xa23f('0x0'));var path=require(_0xa23f('0x1'));var _=require(_0xa23f('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xa23f('0x3'));var rimraf=require(_0xa23f('0x4'));var db=require(_0xa23f('0x5'))['db'];var dbH=require('../../mysqldb')[_0xa23f('0x6')];var logger=require(_0xa23f('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa23f('0x8')][0x2]);var QUERY=process[_0xa23f('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d1cd,_0x235917){var _0xe71a94={'status':_0x3d1cd};var _0x560dd2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x235917){_0xe71a94[_0xa23f('0x9')]=_0x235917;}return db[_0xa23f('0xa')][_0xa23f('0xb')](_0xe71a94,_0x560dd2);}function main(){var _0x46e1af=0x1388;var _0x2f1b7d;logger['info'](util[_0xa23f('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa23f('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa23f('0xe'),'splitSizeCsv']})[_0xa23f('0xf')](function(_0x4f3313){if(_0x4f3313){_0x2f1b7d=_0x4f3313;_0x46e1af=_0x2f1b7d[_0xa23f('0x10')]||0x1388;}})[_0xa23f('0xf')](function(){return dbH[_0xa23f('0x11')]['query'](util[_0xa23f('0xc')](_0xa23f('0x12'),QUERY),{'type':dbH[_0xa23f('0x11')]['QueryTypes'][_0xa23f('0x13')]});})['then'](function(_0x336706){if(!_0x336706[0x0]['num']){return analyticExtractedReport(_0xa23f('0x14'));}var _0x5006e9=[];var _0x59a522=0x0;if(_0x2f1b7d[_0xa23f('0xe')]){if(_0x336706&&_0x336706['length']){var _0xac839a=_[_0xa23f('0x15')](_0x336706[0x0][_0xa23f('0x16')]/_0x46e1af);var _0x267cbf=Number[_0xa23f('0x17')](_0x336706[0x0][_0xa23f('0x16')]/_0x46e1af)?_0x336706[0x0][_0xa23f('0x16')]%_0x46e1af:0x0;_0xac839a['forEach'](function(_0x34dd04){if(_0x34dd04>0x0){_0x59a522+=_0x46e1af;}_0x5006e9[_0xa23f('0x18')](dbH[_0xa23f('0x11')]['query'](util[_0xa23f('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x46e1af,_0x59a522),{'type':dbH[_0xa23f('0x11')][_0xa23f('0x19')][_0xa23f('0x13')]}));});if(_0x267cbf>0x0){_0x59a522+=_0x46e1af;_0x5006e9[_0xa23f('0x18')](dbH[_0xa23f('0x11')][_0xa23f('0x1a')](util['format'](_0xa23f('0x1b'),QUERY,_0x267cbf,_0x59a522),{'type':dbH['sequelize']['QueryTypes'][_0xa23f('0x13')]}));}}}else{_0x5006e9[_0xa23f('0x18')](dbH[_0xa23f('0x11')][_0xa23f('0x1a')](QUERY,{'type':dbH[_0xa23f('0x11')][_0xa23f('0x19')]['SELECT']}));}var _0x3b7af6=path[_0xa23f('0x1c')](PATH);var _0x207c96=path[_0xa23f('0x1d')](PATH,_0xa23f('0x1e'));var _0x31115b=_0x2f1b7d[_0xa23f('0xe')]&&_0x5006e9[_0xa23f('0x1f')]>0x1;var _0x3398bb=[];if(!fs[_0xa23f('0x20')](path[_0xa23f('0x21')](_0x3b7af6,_0x207c96))&&_0x31115b){fs[_0xa23f('0x22')](path['join'](_0x3b7af6,_0x207c96));}return BPromise['each'](_0x5006e9,function(_0x1e4b75){_0x3398bb[_0xa23f('0x18')](_0x1e4b75);})['then'](function(){for(var _0x16a555=0x0;_0x16a555<_0x3398bb[_0xa23f('0x1f')];_0x16a555+=0x1){var _0x1e22de;var _0x2f63c0=_0x3398bb[_0x16a555];if(_0x31115b){_0x1e22de=path[_0xa23f('0x21')](_0x3b7af6,_0x207c96,util[_0xa23f('0xc')]('%s%d.%s',_0x207c96,_0x16a555,'csv'));}else{_0x1e22de=path['join'](_0x3b7af6,util['format'](_0xa23f('0x23'),_0x207c96,_0xa23f('0x24')));}fs[_0xa23f('0x25')](_0x1e22de,csv(_0x2f63c0));}})[_0xa23f('0xf')](function(){if(_0x31115b){return new Promise(function(_0x253cd3){zipdir(path['join'](_0x3b7af6,_0x207c96),{'saveTo':path[_0xa23f('0x21')](_0x3b7af6,util['format'](_0xa23f('0x23'),_0x207c96,'zip'))},function(_0x45c9d4,_0x322e29){rimraf(path[_0xa23f('0x21')](_0x3b7af6,_0x207c96),function(){});_0x253cd3('zip\x20finished');});});}})[_0xa23f('0xf')](function(){logger[_0xa23f('0x26')](util[_0xa23f('0xc')](_0xa23f('0x27'),EXTRACTED_REPORT_ID,_0xa23f('0xd')));return analyticExtractedReport(_0xa23f('0x28'),_0x31115b?util[_0xa23f('0xc')](_0xa23f('0x23'),_0x207c96,_0x31115b?_0xa23f('0x29'):_0xa23f('0x24')):null);});})[_0xa23f('0x2a')](function(_0x350877){logger[_0xa23f('0x26')](util[_0xa23f('0xc')](_0xa23f('0x2b'),EXTRACTED_REPORT_ID,_0xa23f('0xd')),util[_0xa23f('0x2c')](_0x350877,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa23f('0x2d'));})[_0xa23f('0x2e')](function(){process[_0xa23f('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xec21=['CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2a829c,_0x34312b){var _0x2550ad=function(_0x231dee){while(--_0x231dee){_0x2a829c['push'](_0x2a829c['shift']());}};_0x2550ad(++_0x34312b);}(_0xec21,0x8d));var _0x1ec2=function(_0x2bb0a4,_0x3572cc){_0x2bb0a4=_0x2bb0a4-0x0;var _0x4372fd=_0xec21[_0x2bb0a4];return _0x4372fd;};'use strict';var util=require(_0x1ec2('0x0'));var path=require(_0x1ec2('0x1'));var _=require(_0x1ec2('0x2'));var csv=require(_0x1ec2('0x3'));var fs=require('fs');var BPromise=require(_0x1ec2('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1ec2('0x5'));var db=require(_0x1ec2('0x6'))['db'];var dbH=require(_0x1ec2('0x6'))[_0x1ec2('0x7')];var logger=require(_0x1ec2('0x8'))(_0x1ec2('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1ec2('0xa')][0x3];var PATH=process[_0x1ec2('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x49a480,_0x36f8e1){var _0x447731={'status':_0x49a480};var _0x145e37={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36f8e1){_0x447731[_0x1ec2('0xb')]=_0x36f8e1;}return db['AnalyticExtractedReport'][_0x1ec2('0xc')](_0x447731,_0x145e37);}function main(){var _0x356d44=0x1388;var _0x133d91;logger[_0x1ec2('0xd')](util['format'](_0x1ec2('0xe'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')));return db[_0x1ec2('0x10')][_0x1ec2('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1ec2('0x12'),_0x1ec2('0x13')]})['then'](function(_0x309811){if(_0x309811){_0x133d91=_0x309811;_0x356d44=_0x133d91[_0x1ec2('0x13')]||0x1388;}})[_0x1ec2('0x14')](function(){return dbH[_0x1ec2('0x15')][_0x1ec2('0x16')](util[_0x1ec2('0x17')](_0x1ec2('0x18'),QUERY),{'type':dbH[_0x1ec2('0x15')][_0x1ec2('0x19')][_0x1ec2('0x1a')]});})[_0x1ec2('0x14')](function(_0x145f5b){if(!_0x145f5b[0x0]['num']){return analyticExtractedReport(_0x1ec2('0x1b'));}var _0x4ec5c7=[];var _0x19ea42=0x0;if(_0x133d91['split']){if(_0x145f5b&&_0x145f5b['length']){var _0x1e85d4=_[_0x1ec2('0x1c')](_0x145f5b[0x0][_0x1ec2('0x1d')]/_0x356d44);var _0x173e63=Number[_0x1ec2('0x1e')](_0x145f5b[0x0][_0x1ec2('0x1d')]/_0x356d44)?_0x145f5b[0x0][_0x1ec2('0x1d')]%_0x356d44:0x0;_0x1e85d4[_0x1ec2('0x1f')](function(_0x43fc19){if(_0x43fc19>0x0){_0x19ea42+=_0x356d44;}_0x4ec5c7['push'](dbH[_0x1ec2('0x15')][_0x1ec2('0x16')](util[_0x1ec2('0x17')](_0x1ec2('0x20'),QUERY,_0x356d44,_0x19ea42),{'type':dbH[_0x1ec2('0x15')][_0x1ec2('0x19')][_0x1ec2('0x1a')]}));});if(_0x173e63>0x0){_0x19ea42+=_0x356d44;_0x4ec5c7[_0x1ec2('0x21')](dbH[_0x1ec2('0x15')][_0x1ec2('0x16')](util['format'](_0x1ec2('0x20'),QUERY,_0x173e63,_0x19ea42),{'type':dbH[_0x1ec2('0x15')]['QueryTypes'][_0x1ec2('0x1a')]}));}}}else{_0x4ec5c7[_0x1ec2('0x21')](dbH[_0x1ec2('0x15')][_0x1ec2('0x16')](QUERY,{'type':dbH[_0x1ec2('0x15')][_0x1ec2('0x19')][_0x1ec2('0x1a')]}));}var _0x2bd6b8=path[_0x1ec2('0x22')](PATH);var _0x572c73=path['basename'](PATH,_0x1ec2('0x23'));var _0x3cab5a=_0x133d91[_0x1ec2('0x12')]&&_0x4ec5c7[_0x1ec2('0x24')]>0x1;var _0x3bcffa=[];if(!fs[_0x1ec2('0x25')](path[_0x1ec2('0x26')](_0x2bd6b8,_0x572c73))&&_0x3cab5a){fs[_0x1ec2('0x27')](path['join'](_0x2bd6b8,_0x572c73));}return BPromise[_0x1ec2('0x28')](_0x4ec5c7,function(_0x2a436f){_0x3bcffa[_0x1ec2('0x21')](_0x2a436f);})[_0x1ec2('0x14')](function(){for(var _0x563a21=0x0;_0x563a21<_0x3bcffa['length'];_0x563a21+=0x1){var _0x124ddb;var _0x59cc49=_0x3bcffa[_0x563a21];if(_0x3cab5a){_0x124ddb=path['join'](_0x2bd6b8,_0x572c73,util[_0x1ec2('0x17')](_0x1ec2('0x29'),_0x572c73,_0x563a21,_0x1ec2('0x2a')));}else{_0x124ddb=path[_0x1ec2('0x26')](_0x2bd6b8,util[_0x1ec2('0x17')](_0x1ec2('0x2b'),_0x572c73,_0x1ec2('0x2a')));}fs[_0x1ec2('0x2c')](_0x124ddb,csv(_0x59cc49));}})[_0x1ec2('0x14')](function(){if(_0x3cab5a){return new Promise(function(_0x949ae4){zipdir(path[_0x1ec2('0x26')](_0x2bd6b8,_0x572c73),{'saveTo':path[_0x1ec2('0x26')](_0x2bd6b8,util[_0x1ec2('0x17')](_0x1ec2('0x2b'),_0x572c73,_0x1ec2('0x2d')))},function(_0x1d3e0f,_0x6136da){rimraf(path['join'](_0x2bd6b8,_0x572c73),function(){});_0x949ae4(_0x1ec2('0x2e'));});});}})['then'](function(){logger[_0x1ec2('0xd')](util['format'](_0x1ec2('0x2f'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')));return analyticExtractedReport(_0x1ec2('0x30'),_0x3cab5a?util['format'](_0x1ec2('0x2b'),_0x572c73,_0x3cab5a?_0x1ec2('0x2d'):_0x1ec2('0x2a')):null);});})[_0x1ec2('0x31')](function(_0x20c6e7){logger[_0x1ec2('0xd')](util[_0x1ec2('0x17')](_0x1ec2('0x32'),EXTRACTED_REPORT_ID,_0x1ec2('0xf')),util[_0x1ec2('0x33')](_0x20c6e7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index d0fa33d..57e656b 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 _0x7ec9=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','push','body','chunk','format'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7ec9,0x15d));var _0x97ec=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x7ec9[_0x5e238b];return _0x389bea;};'use strict';var _=require(_0x97ec('0x0'));var fs=require('fs');var util=require(_0x97ec('0x1'));var path=require(_0x97ec('0x2'));var moment=require(_0x97ec('0x3'));var htmlToPdfmake=require(_0x97ec('0x4'));var PdfPrinter=require(_0x97ec('0x5'));var zipdir=require(_0x97ec('0x6'));var rimraf=require(_0x97ec('0x7'));var JSDOM=require(_0x97ec('0x8'))[_0x97ec('0x9')];var window=new JSDOM('')['window'];var BPromise=require(_0x97ec('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0x97ec('0xb'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x97ec('0xc')][0x2]);var QUERY=process[_0x97ec('0xc')][0x3];var PATH=process[_0x97ec('0xc')][0x4];var NAME=process[_0x97ec('0xc')][0x5];var FORMAT=_0x97ec('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4ed829,_0xe7f3af){var _0x47a54b={'status':_0x4ed829};var _0x389356={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe7f3af){_0x47a54b['savename']=_0xe7f3af;}return db[_0x97ec('0xe')][_0x97ec('0xf')](_0x47a54b,_0x389356);}function getHeaders(_0x444853){return _[_0x97ec('0x10')](_0x444853,function(_0x24f183){return{'text':_0x24f183,'style':_0x97ec('0x11')};});}function getRows(_0x40413a,_0x2ff661){return _[_0x97ec('0x10')](_0x2ff661,function(_0x28da6c){return _(_0x28da6c)['pick'](_0x40413a)[_0x97ec('0x10')](function(_0x35a034){return _0x35a034?_[_0x97ec('0x12')](_0x35a034):'';})[_0x97ec('0x13')]();});}function createTable(_0x41e9ff,_0x3aa376){var _0xa66b54={'widths':_[_0x97ec('0x14')](Array(_0x41e9ff[_0x97ec('0x15')]),0x91),'heights':function(_0x4b52fd){return _0x4b52fd===0x0?_0x97ec('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x323287=getHeaders(_0x41e9ff);_0xa66b54['body'][_0x97ec('0x17')](_0x323287);var _0x471491=getRows(_0x41e9ff,_0x3aa376);_0xa66b54[_0x97ec('0x18')]=_0xa66b54[_0x97ec('0x18')]['concat'](_0x471491);return _0xa66b54;}function createTables(_0x40e72b){var _0x395e14=[];var _0x343c62=_[_0x97ec('0x19')](Object['keys'](_0x40e72b[0x0]),0x5);_0x343c62['forEach'](function(_0x5df2c6){_0x395e14[_0x97ec('0x17')](createTable(_0x5df2c6,_0x40e72b));});return _0x395e14;}function getPDFDocDefinition(_0x1de2c3){var _0x344c87=util[_0x97ec('0x1a')](_0x97ec('0x1b'),NAME,EXTRACTED_REPORT[_0x97ec('0x1c')],moment(EXTRACTED_REPORT[_0x97ec('0x1d')])[_0x97ec('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x97ec('0x1e')])[_0x97ec('0x1a')](FORMAT));var _0x447607=[];for(var _0x4607d5=0x0;_0x4607d5<_0x1de2c3[_0x97ec('0x15')];_0x4607d5++){var _0x7bb906=[];if(_0x4607d5===0x0){_0x7bb906[_0x97ec('0x17')]({'text':_0x344c87,'style':_0x97ec('0x1f')});}var _0x5361b5={'table':_0x1de2c3[_0x4607d5]};if(_0x4607d5>0x0){_0x5361b5[_0x97ec('0x20')]=_0x97ec('0x21');_0x5361b5[_0x97ec('0x22')]=[0x0,0x46,0x0,0x0];}_0x7bb906[_0x97ec('0x17')](_0x5361b5);_0x447607['push'](_0x7bb906);}return{'pageSize':'A4','pageOrientation':_0x97ec('0x23'),'content':_0x447607,'footer':function(_0x4cd5d4,_0xacf661){return{'text':_0x4cd5d4[_0x97ec('0x12')]()+_0x97ec('0x24')+_0xacf661,'style':_0x97ec('0x25')};},'defaultStyle':{'font':_0x97ec('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x97ec('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4a0796){var _0x4d7419=0x1388;var _0xb3cd99;if(!_0x4a0796[0x0][_0x97ec('0x28')]){return analyticExtractedReport(_0x97ec('0x29'));}return db[_0x97ec('0x2a')][_0x97ec('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x97ec('0x2c'),_0x97ec('0x2d')]})[_0x97ec('0x2e')](function(_0x1b0f2b){if(_0x1b0f2b){_0xb3cd99=_0x1b0f2b;_0x4d7419=_0xb3cd99[_0x97ec('0x2d')]||0x3e8;}})[_0x97ec('0x2e')](function(){var _0x2a2b67=[];var _0x3035ba=0x0;if(_0xb3cd99[_0x97ec('0x2c')]){if(_0x4a0796&&_0x4a0796['length']){var _0x2c013d=_[_0x97ec('0x2f')](_0x4a0796[0x0][_0x97ec('0x28')]/_0x4d7419);var _0x2bef1e=Number[_0x97ec('0x30')](_0x4a0796[0x0][_0x97ec('0x28')]/_0x4d7419)?_0x4a0796[0x0]['num']%_0x4d7419:0x0;_0x2c013d[_0x97ec('0x31')](function(_0x34b86f){if(_0x34b86f>0x0){_0x3035ba+=_0x4d7419;}_0x2a2b67[_0x97ec('0x17')](dbH[_0x97ec('0x32')][_0x97ec('0x33')](util[_0x97ec('0x1a')](_0x97ec('0x34'),QUERY,_0x4d7419,_0x3035ba),{'type':dbH[_0x97ec('0x32')][_0x97ec('0x35')]['SELECT']}));});if(_0x2bef1e>0x0){_0x3035ba+=_0x4d7419;_0x2a2b67[_0x97ec('0x17')](dbH['sequelize']['query'](util[_0x97ec('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2bef1e,_0x3035ba),{'type':dbH['sequelize'][_0x97ec('0x35')]['SELECT']}));}}}else{_0x2a2b67[_0x97ec('0x17')](dbH[_0x97ec('0x32')]['query'](QUERY,{'type':dbH[_0x97ec('0x32')][_0x97ec('0x35')][_0x97ec('0x36')]}));}var _0x58cd6c=path[_0x97ec('0x37')](PATH);var _0x2cbe31=path[_0x97ec('0x38')](PATH,_0x97ec('0x39'));var _0x2974c5=_0xb3cd99[_0x97ec('0x2c')]&&_0x2a2b67[_0x97ec('0x15')]>0x1;var _0x3e3002=[];if(!fs['existsSync'](path['join'](_0x58cd6c,_0x2cbe31))&&_0x2974c5){fs[_0x97ec('0x3a')](path[_0x97ec('0x3b')](_0x58cd6c,_0x2cbe31));}return BPromise[_0x97ec('0x3c')](_0x2a2b67,function(_0x1a2289){_0x3e3002[_0x97ec('0x17')](_0x1a2289);})[_0x97ec('0x2e')](function(){var _0x1cf124=[];for(var _0xbb2067=0x0;_0xbb2067<_0x3e3002[_0x97ec('0x15')];_0xbb2067+=0x1){var _0x232d62=_0x3e3002[_0xbb2067];var _0x403864=createTables(_[_0x97ec('0x3d')](_0x232d62));var _0x6aa4a4;var _0x453ac0=getPDFDocDefinition(_0x403864);var _0x5a4b00=getPDFPrinter();var _0x2ece18=_0x5a4b00[_0x97ec('0x3e')](_0x453ac0);if(_0x2974c5){_0x6aa4a4=path[_0x97ec('0x3b')](_0x58cd6c,_0x2cbe31,util[_0x97ec('0x1a')](_0x97ec('0x3f'),_0x2cbe31,_0xbb2067,_0x97ec('0x40')));}else{_0x6aa4a4=path[_0x97ec('0x3b')](_0x58cd6c,util[_0x97ec('0x1a')](_0x97ec('0x41'),_0x2cbe31,_0x97ec('0x40')));}_0x1cf124[_0x97ec('0x17')](writePDFDocument(_0x2ece18,_0x6aa4a4));}return Promise[_0x97ec('0x42')](_0x1cf124);})['then'](function(){if(_0x2974c5){return new Promise(function(_0x309a40){zipdir(path[_0x97ec('0x3b')](_0x58cd6c,_0x2cbe31),{'saveTo':path['join'](_0x58cd6c,util[_0x97ec('0x1a')](_0x97ec('0x41'),_0x2cbe31,'zip'))},function(){rimraf(path[_0x97ec('0x3b')](_0x58cd6c,_0x2cbe31),function(){});_0x309a40(_0x97ec('0x43'));});});}})[_0x97ec('0x2e')](function(){if(!_0x2974c5)return;rimraf(path[_0x97ec('0x3b')](_0x58cd6c,_0x2cbe31),function(){});})['then'](function(){logger['info'](util[_0x97ec('0x1a')](_0x97ec('0x44'),EXTRACTED_REPORT_ID,_0x97ec('0x45')));return analyticExtractedReport(_0x97ec('0x46'),_0x2974c5?util[_0x97ec('0x1a')](_0x97ec('0x41'),_0x2cbe31,_0x2974c5?_0x97ec('0x47'):_0x97ec('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x97ec('0x48')](util[_0x97ec('0x1a')](_0x97ec('0x49'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x97ec('0xe')][_0x97ec('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x97ec('0x2e')](function(_0x5ef610){EXTRACTED_REPORT=_0x5ef610;return dbH[_0x97ec('0x32')][_0x97ec('0x33')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x97ec('0x35')][_0x97ec('0x36')]});})[_0x97ec('0x2e')](extractReport)[_0x97ec('0x4b')](function(_0x4c1910){logger[_0x97ec('0x48')](util['format'](_0x97ec('0x4c'),EXTRACTED_REPORT_ID,'PDF'),util[_0x97ec('0x4d')](_0x4c1910,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x97ec('0x4e')](function(){process[_0x97ec('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5e3073=new PdfPrinter({'Arial':{'normal':__dirname+_0x97ec('0x50'),'bold':__dirname+_0x97ec('0x51'),'italics':__dirname+_0x97ec('0x52'),'bolditalics':__dirname+_0x97ec('0x53')}});return _0x5e3073;}function getPDFDocDefinitionFromHTML(_0x49e7fe,_0x14a2a6){var _0x3da880=util['format'](_0x97ec('0x54'),_0x14a2a6[_0x97ec('0x55')],_0x14a2a6['interactionId']);var _0x1963f8=moment()[_0x97ec('0x1a')]('YYYY-MM-DD')[_0x97ec('0x12')]();var _0x14ca19=htmlToPdfmake(_0x49e7fe,{'window':window,'tableAutoSize':!![]});return{'content':[_0x14ca19],'defaultStyle':{'font':_0x97ec('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x97ec('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x97ec('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x97ec('0x56')}},'header':function(){return[{'text':_0x97ec('0x57'),'style':_0x97ec('0x1f')}];},'footer':function(_0x43fdc9,_0x2e102c){return[{'text':util[_0x97ec('0x1a')](_0x97ec('0x58'),_0x3da880,_0x43fdc9,_0x2e102c,_0x1963f8),'style':_0x97ec('0x25')}];}};}function writePDFDocument(_0x1234f4,_0xf73644){return new Promise(function(_0x5c6563,_0x1316bf){var _0x2d7e34=_0x1234f4[_0x97ec('0x59')](fs[_0x97ec('0x5a')](_0xf73644));_0x2d7e34['on'](_0x97ec('0x5b'),function(){_0x5c6563('finish');});_0x2d7e34['on']('error',function(_0x5b68d3){_0x1316bf(_0x5b68d3);});_0x1234f4[_0x97ec('0x5c')]();});}exports[_0x97ec('0x5d')]=function(_0x1a5f26,_0x3a35b9){var _0x594a73=getPDFPrinter();var _0x5f163a=getPDFDocDefinitionFromHTML(_0x1a5f26,_0x3a35b9);var _0x3ff3e3=_0x594a73['createPdfKitDocument'](_0x5f163a);return writePDFDocument(_0x3ff3e3,_0x3a35b9[_0x97ec('0x2')])[_0x97ec('0x4b')](function(_0x4ba34f){throw _0x4ba34f;});}; \ No newline at end of file +var _0xb01f=['Empty','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/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','createWriteStream','finish','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','num'];(function(_0x36398c,_0x432e93){var _0x529a2c=function(_0x3dcd06){while(--_0x3dcd06){_0x36398c['push'](_0x36398c['shift']());}};_0x529a2c(++_0x432e93);}(_0xb01f,0xe3));var _0xfb01=function(_0x3d125f,_0x271ed9){_0x3d125f=_0x3d125f-0x0;var _0x3851e7=_0xb01f[_0x3d125f];return _0x3851e7;};'use strict';var _=require(_0xfb01('0x0'));var fs=require('fs');var util=require(_0xfb01('0x1'));var path=require(_0xfb01('0x2'));var moment=require(_0xfb01('0x3'));var htmlToPdfmake=require(_0xfb01('0x4'));var PdfPrinter=require(_0xfb01('0x5'));var zipdir=require(_0xfb01('0x6'));var rimraf=require(_0xfb01('0x7'));var JSDOM=require('jsdom')[_0xfb01('0x8')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xfb01('0x9'))['db'];var dbH=require(_0xfb01('0x9'))['dbH'];var logger=require('../../config/logger')(_0xfb01('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xfb01('0xb')][0x3];var PATH=process[_0xfb01('0xb')][0x4];var NAME=process[_0xfb01('0xb')][0x5];var FORMAT=_0xfb01('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x358f8c,_0xe76164){var _0x465582={'status':_0x358f8c};var _0x38a09a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe76164){_0x465582[_0xfb01('0xd')]=_0xe76164;}return db[_0xfb01('0xe')][_0xfb01('0xf')](_0x465582,_0x38a09a);}function getHeaders(_0x4b403c){return _[_0xfb01('0x10')](_0x4b403c,function(_0x30c095){return{'text':_0x30c095,'style':'tableHeader'};});}function getRows(_0x2adecf,_0x1e2e26){return _[_0xfb01('0x10')](_0x1e2e26,function(_0x2393d3){return _(_0x2393d3)[_0xfb01('0x11')](_0x2adecf)['map'](function(_0x51afd5){return _0x51afd5?_[_0xfb01('0x12')](_0x51afd5):'';})[_0xfb01('0x13')]();});}function createTable(_0x264b74,_0x5efd28){var _0x282c13={'widths':_[_0xfb01('0x14')](Array(_0x264b74[_0xfb01('0x15')]),0x91),'heights':function(_0x1358fd){return _0x1358fd===0x0?_0xfb01('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x7926f0=getHeaders(_0x264b74);_0x282c13[_0xfb01('0x17')]['push'](_0x7926f0);var _0x112191=getRows(_0x264b74,_0x5efd28);_0x282c13['body']=_0x282c13[_0xfb01('0x17')][_0xfb01('0x18')](_0x112191);return _0x282c13;}function createTables(_0x4e0834){var _0x278214=[];var _0x569f2f=_[_0xfb01('0x19')](Object[_0xfb01('0x1a')](_0x4e0834[0x0]),0x5);_0x569f2f[_0xfb01('0x1b')](function(_0x473275){_0x278214[_0xfb01('0x1c')](createTable(_0x473275,_0x4e0834));});return _0x278214;}function getPDFDocDefinition(_0x159971){var _0x141a96=util[_0xfb01('0x1d')](_0xfb01('0x1e'),NAME,EXTRACTED_REPORT[_0xfb01('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0xfb01('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xfb01('0x20')])[_0xfb01('0x1d')](FORMAT));var _0x553f71=[];for(var _0x4e80b0=0x0;_0x4e80b0<_0x159971[_0xfb01('0x15')];_0x4e80b0++){var _0x3ef5e1=[];if(_0x4e80b0===0x0){_0x3ef5e1[_0xfb01('0x1c')]({'text':_0x141a96,'style':_0xfb01('0x21')});}var _0x4a27f9={'table':_0x159971[_0x4e80b0]};if(_0x4e80b0>0x0){_0x4a27f9[_0xfb01('0x22')]='before';_0x4a27f9[_0xfb01('0x23')]=[0x0,0x46,0x0,0x0];}_0x3ef5e1[_0xfb01('0x1c')](_0x4a27f9);_0x553f71['push'](_0x3ef5e1);}return{'pageSize':'A4','pageOrientation':_0xfb01('0x24'),'content':_0x553f71,'footer':function(_0x17d353,_0x3aeed5){return{'text':_0x17d353[_0xfb01('0x12')]()+_0xfb01('0x25')+_0x3aeed5,'style':_0xfb01('0x26')};},'defaultStyle':{'font':_0xfb01('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xfb01('0x28')},'footer':{'alignment':_0xfb01('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5c7515){var _0x365b0f=0x1388;var _0x559296;if(!_0x5c7515[0x0][_0xfb01('0x2a')]){return analyticExtractedReport(_0xfb01('0x2b'));}return db['Setting'][_0xfb01('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfb01('0x2d'),_0xfb01('0x2e')]})[_0xfb01('0x2f')](function(_0x1792f8){if(_0x1792f8){_0x559296=_0x1792f8;_0x365b0f=_0x559296[_0xfb01('0x2e')]||0x3e8;}})['then'](function(){var _0x56d88e=[];var _0x4085ca=0x0;if(_0x559296[_0xfb01('0x2d')]){if(_0x5c7515&&_0x5c7515['length']){var _0x523861=_['range'](_0x5c7515[0x0]['num']/_0x365b0f);var _0x2afc38=Number['isInteger'](_0x5c7515[0x0][_0xfb01('0x2a')]/_0x365b0f)?_0x5c7515[0x0][_0xfb01('0x2a')]%_0x365b0f:0x0;_0x523861[_0xfb01('0x1b')](function(_0x4c423a){if(_0x4c423a>0x0){_0x4085ca+=_0x365b0f;}_0x56d88e['push'](dbH[_0xfb01('0x30')][_0xfb01('0x31')](util[_0xfb01('0x1d')](_0xfb01('0x32'),QUERY,_0x365b0f,_0x4085ca),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));});if(_0x2afc38>0x0){_0x4085ca+=_0x365b0f;_0x56d88e[_0xfb01('0x1c')](dbH[_0xfb01('0x30')][_0xfb01('0x31')](util[_0xfb01('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2afc38,_0x4085ca),{'type':dbH['sequelize'][_0xfb01('0x33')]['SELECT']}));}}}else{_0x56d88e[_0xfb01('0x1c')](dbH[_0xfb01('0x30')][_0xfb01('0x31')](QUERY,{'type':dbH[_0xfb01('0x30')][_0xfb01('0x33')]['SELECT']}));}var _0x3a7346=path[_0xfb01('0x34')](PATH);var _0x4a47b1=path[_0xfb01('0x35')](PATH,'.pdf');var _0xeb39d2=_0x559296[_0xfb01('0x2d')]&&_0x56d88e[_0xfb01('0x15')]>0x1;var _0x134ed2=[];if(!fs[_0xfb01('0x36')](path[_0xfb01('0x37')](_0x3a7346,_0x4a47b1))&&_0xeb39d2){fs[_0xfb01('0x38')](path[_0xfb01('0x37')](_0x3a7346,_0x4a47b1));}return BPromise[_0xfb01('0x39')](_0x56d88e,function(_0x558cbc){_0x134ed2[_0xfb01('0x1c')](_0x558cbc);})['then'](function(){var _0x272170=[];for(var _0x557ba4=0x0;_0x557ba4<_0x134ed2[_0xfb01('0x15')];_0x557ba4+=0x1){var _0x35607d=_0x134ed2[_0x557ba4];var _0x41c608=createTables(_[_0xfb01('0x3a')](_0x35607d));var _0x1736a9;var _0x31b6f9=getPDFDocDefinition(_0x41c608);var _0x50c830=getPDFPrinter();var _0x42b8e1=_0x50c830[_0xfb01('0x3b')](_0x31b6f9);if(_0xeb39d2){_0x1736a9=path['join'](_0x3a7346,_0x4a47b1,util[_0xfb01('0x1d')](_0xfb01('0x3c'),_0x4a47b1,_0x557ba4,'pdf'));}else{_0x1736a9=path[_0xfb01('0x37')](_0x3a7346,util[_0xfb01('0x1d')](_0xfb01('0x3d'),_0x4a47b1,_0xfb01('0x3e')));}_0x272170[_0xfb01('0x1c')](writePDFDocument(_0x42b8e1,_0x1736a9));}return Promise['all'](_0x272170);})[_0xfb01('0x2f')](function(){if(_0xeb39d2){return new Promise(function(_0x3041e6){zipdir(path[_0xfb01('0x37')](_0x3a7346,_0x4a47b1),{'saveTo':path[_0xfb01('0x37')](_0x3a7346,util[_0xfb01('0x1d')](_0xfb01('0x3d'),_0x4a47b1,_0xfb01('0x3f')))},function(){rimraf(path[_0xfb01('0x37')](_0x3a7346,_0x4a47b1),function(){});_0x3041e6(_0xfb01('0x40'));});});}})['then'](function(){if(!_0xeb39d2)return;rimraf(path['join'](_0x3a7346,_0x4a47b1),function(){});})['then'](function(){logger['info'](util[_0xfb01('0x1d')](_0xfb01('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xfb01('0x42'),_0xeb39d2?util[_0xfb01('0x1d')](_0xfb01('0x3d'),_0x4a47b1,_0xeb39d2?'zip':_0xfb01('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfb01('0x43')](util[_0xfb01('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xfb01('0x44')));return db['AnalyticExtractedReport'][_0xfb01('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xfb01('0x2f')](function(_0x4b79d0){EXTRACTED_REPORT=_0x4b79d0;return dbH['sequelize'][_0xfb01('0x31')](util[_0xfb01('0x1d')](_0xfb01('0x46'),QUERY),{'type':dbH[_0xfb01('0x30')][_0xfb01('0x33')]['SELECT']});})[_0xfb01('0x2f')](extractReport)[_0xfb01('0x47')](function(_0x26e94c){logger[_0xfb01('0x43')](util[_0xfb01('0x1d')](_0xfb01('0x48'),EXTRACTED_REPORT_ID,_0xfb01('0x44')),util[_0xfb01('0x49')](_0x26e94c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfb01('0x4a'));})[_0xfb01('0x4b')](function(){process[_0xfb01('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x42837d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xfb01('0x4d'),'italics':__dirname+_0xfb01('0x4e'),'bolditalics':__dirname+_0xfb01('0x4f')}});return _0x42837d;}function getPDFDocDefinitionFromHTML(_0xbc5559,_0x2db678){var _0xf31a2b=util['format'](_0xfb01('0x50'),_0x2db678[_0xfb01('0x51')],_0x2db678[_0xfb01('0x52')]);var _0x455426=moment()[_0xfb01('0x1d')](_0xfb01('0x53'))[_0xfb01('0x12')]();var _0x478196=htmlToPdfmake(_0xbc5559,{'window':window,'tableAutoSize':!![]});return{'content':[_0x478196],'defaultStyle':{'font':_0xfb01('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xfb01('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xfb01('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xfb01('0x55'),'style':'header'}];},'footer':function(_0x5291e4,_0x17dd18){return[{'text':util[_0xfb01('0x1d')](_0xfb01('0x56'),_0xf31a2b,_0x5291e4,_0x17dd18,_0x455426),'style':_0xfb01('0x26')}];}};}function writePDFDocument(_0x4c671e,_0x191757){return new Promise(function(_0x46342a,_0x451c92){var _0x2cd0f0=_0x4c671e['pipe'](fs[_0xfb01('0x57')](_0x191757));_0x2cd0f0['on'](_0xfb01('0x58'),function(){_0x46342a(_0xfb01('0x58'));});_0x2cd0f0['on']('error',function(_0x415f25){_0x451c92(_0x415f25);});_0x4c671e['end']();});}exports[_0xfb01('0x59')]=function(_0x512894,_0x40fd89){var _0x2d0037=getPDFPrinter();var _0x26d80b=getPDFDocDefinitionFromHTML(_0x512894,_0x40fd89);var _0x5da1de=_0x2d0037[_0xfb01('0x3b')](_0x26d80b);return writePDFDocument(_0x5da1de,_0x40fd89[_0xfb01('0x2')])['catch'](function(_0x590807){throw _0x590807;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index fb6ff00..1281b48 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 _0x3eae=['zip','catch','inspect','Failed','finally','exit','lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','%s%d.%s','xlsx','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x2931de,_0x4ef48d){var _0x51f1ce=function(_0x3eb803){while(--_0x3eb803){_0x2931de['push'](_0x2931de['shift']());}};_0x51f1ce(++_0x4ef48d);}(_0x3eae,0x66));var _0xe3ea=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x3eae[_0x383356];return _0x32ee5a;};'use strict';var util=require('util');var path=require('path');var _=require(_0xe3ea('0x0'));var fs=require('fs');var json2xls=require(_0xe3ea('0x1'));var BPromise=require('bluebird');var zipdir=require(_0xe3ea('0x2'));var rimraf=require(_0xe3ea('0x3'));var db=require(_0xe3ea('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xe3ea('0x5'))(_0xe3ea('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xe3ea('0x7')][0x3];var PATH=process[_0xe3ea('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x59335d,_0x26f1b6){var _0x47f24d={'status':_0x59335d};var _0x42e89f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x26f1b6){_0x47f24d[_0xe3ea('0x8')]=_0x26f1b6;}return db[_0xe3ea('0x9')]['update'](_0x47f24d,_0x42e89f);}function main(){var _0xd81169=0x1388;var _0x1b6707;logger[_0xe3ea('0xa')](util[_0xe3ea('0xb')](_0xe3ea('0xc'),EXTRACTED_REPORT_ID,_0xe3ea('0xd')));return db[_0xe3ea('0xe')][_0xe3ea('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xe3ea('0x10')](function(_0x6a9294){if(_0x6a9294){_0x1b6707=_0x6a9294;_0xd81169=_0x1b6707[_0xe3ea('0x11')]||0x1388;}})[_0xe3ea('0x10')](function(){return dbH[_0xe3ea('0x12')][_0xe3ea('0x13')](util[_0xe3ea('0xb')](_0xe3ea('0x14'),QUERY),{'type':dbH[_0xe3ea('0x12')][_0xe3ea('0x15')][_0xe3ea('0x16')]});})[_0xe3ea('0x10')](function(_0x445775){if(!_0x445775[0x0]['num']){return analyticExtractedReport(_0xe3ea('0x17'));}var _0x2a086a=[];var _0x1d686c=0x0;if(_0x1b6707[_0xe3ea('0x18')]){if(_0x445775&&_0x445775[_0xe3ea('0x19')]){var _0x33e6ae=_[_0xe3ea('0x1a')](_0x445775[0x0][_0xe3ea('0x1b')]/_0xd81169);var _0x33f6f8=Number[_0xe3ea('0x1c')](_0x445775[0x0][_0xe3ea('0x1b')]/_0xd81169)?_0x445775[0x0][_0xe3ea('0x1b')]%_0xd81169:0x0;_0x33e6ae[_0xe3ea('0x1d')](function(_0x2bc16c){if(_0x2bc16c>0x0){_0x1d686c+=_0xd81169;}_0x2a086a[_0xe3ea('0x1e')](dbH[_0xe3ea('0x12')][_0xe3ea('0x13')](util[_0xe3ea('0xb')](_0xe3ea('0x1f'),QUERY,_0xd81169,_0x1d686c),{'type':dbH[_0xe3ea('0x12')][_0xe3ea('0x15')][_0xe3ea('0x16')]}));});if(_0x33f6f8>0x0){_0x1d686c+=_0xd81169;_0x2a086a[_0xe3ea('0x1e')](dbH[_0xe3ea('0x12')][_0xe3ea('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x33f6f8,_0x1d686c),{'type':dbH['sequelize'][_0xe3ea('0x15')]['SELECT']}));}}}else{_0x2a086a['push'](dbH[_0xe3ea('0x12')][_0xe3ea('0x13')](QUERY,{'type':dbH['sequelize'][_0xe3ea('0x15')][_0xe3ea('0x16')]}));}var _0x594ba1=path[_0xe3ea('0x20')](PATH);var _0x4bb839=path[_0xe3ea('0x21')](PATH,_0xe3ea('0x22'));var _0x99e84a=_0x1b6707['split']&&_0x2a086a[_0xe3ea('0x19')]>0x1;var _0x3491d7=[];if(!fs['existsSync'](path[_0xe3ea('0x23')](_0x594ba1,_0x4bb839))&&_0x99e84a){fs['mkdirSync'](path['join'](_0x594ba1,_0x4bb839));}return BPromise['each'](_0x2a086a,function(_0x5f1eff){_0x3491d7[_0xe3ea('0x1e')](_0x5f1eff);})[_0xe3ea('0x10')](function(){for(var _0x42d889=0x0;_0x42d889<_0x3491d7[_0xe3ea('0x19')];_0x42d889+=0x1){var _0x5395fa;var _0x48a6a1=_0x3491d7[_0x42d889];if(_0x99e84a){_0x5395fa=path[_0xe3ea('0x23')](_0x594ba1,_0x4bb839,util['format'](_0xe3ea('0x24'),_0x4bb839,_0x42d889,_0xe3ea('0x25')));}else{_0x5395fa=path[_0xe3ea('0x23')](_0x594ba1,util['format']('%s.%s',_0x4bb839,_0xe3ea('0x25')));}fs[_0xe3ea('0x26')](_0x5395fa,json2xls(_0x48a6a1),'binary');}})[_0xe3ea('0x10')](function(){if(_0x99e84a){return new Promise(function(_0x11e012){zipdir(path[_0xe3ea('0x23')](_0x594ba1,_0x4bb839),{'saveTo':path['join'](_0x594ba1,util[_0xe3ea('0xb')](_0xe3ea('0x27'),_0x4bb839,'zip'))},function(_0x1d77c5,_0x697bd6){rimraf(path[_0xe3ea('0x23')](_0x594ba1,_0x4bb839),function(){});_0x11e012(_0xe3ea('0x28'));});});}})[_0xe3ea('0x10')](function(){logger[_0xe3ea('0xa')](util[_0xe3ea('0xb')](_0xe3ea('0x29'),EXTRACTED_REPORT_ID,_0xe3ea('0xd')));return analyticExtractedReport('Completed',_0x99e84a?util['format'](_0xe3ea('0x27'),_0x4bb839,_0x99e84a?_0xe3ea('0x2a'):_0xe3ea('0x25')):null);});})[_0xe3ea('0x2b')](function(_0x327168){logger[_0xe3ea('0xa')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe3ea('0xd')),util[_0xe3ea('0x2c')](_0x327168,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe3ea('0x2d'));})[_0xe3ea('0x2e')](function(){process[_0xe3ea('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2a4e=['lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','inspect','finally','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2a4e,0x1df));var _0xe2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4e[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xe2a4('0x0'));var path=require('path');var _=require(_0xe2a4('0x1'));var fs=require('fs');var json2xls=require(_0xe2a4('0x2'));var BPromise=require(_0xe2a4('0x3'));var zipdir=require(_0xe2a4('0x4'));var rimraf=require(_0xe2a4('0x5'));var db=require(_0xe2a4('0x6'))['db'];var dbH=require(_0xe2a4('0x6'))[_0xe2a4('0x7')];var logger=require(_0xe2a4('0x8'))(_0xe2a4('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe2a4('0xa')][0x2]);var QUERY=process[_0xe2a4('0xa')][0x3];var PATH=process[_0xe2a4('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4705b0,_0x185b0e){var _0x10773f={'status':_0x4705b0};var _0x306f07={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x185b0e){_0x10773f[_0xe2a4('0xb')]=_0x185b0e;}return db[_0xe2a4('0xc')]['update'](_0x10773f,_0x306f07);}function main(){var _0x2bcfbd=0x1388;var _0x5ac6d5;logger[_0xe2a4('0xd')](util['format'](_0xe2a4('0xe'),EXTRACTED_REPORT_ID,_0xe2a4('0xf')));return db[_0xe2a4('0x10')][_0xe2a4('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe2a4('0x12'),_0xe2a4('0x13')]})[_0xe2a4('0x14')](function(_0x3aeb62){if(_0x3aeb62){_0x5ac6d5=_0x3aeb62;_0x2bcfbd=_0x5ac6d5[_0xe2a4('0x13')]||0x1388;}})['then'](function(){return dbH[_0xe2a4('0x15')][_0xe2a4('0x16')](util[_0xe2a4('0x17')](_0xe2a4('0x18'),QUERY),{'type':dbH[_0xe2a4('0x15')][_0xe2a4('0x19')]['SELECT']});})[_0xe2a4('0x14')](function(_0x3a8025){if(!_0x3a8025[0x0][_0xe2a4('0x1a')]){return analyticExtractedReport(_0xe2a4('0x1b'));}var _0x440cba=[];var _0xb2e3e6=0x0;if(_0x5ac6d5['split']){if(_0x3a8025&&_0x3a8025['length']){var _0x56f98e=_[_0xe2a4('0x1c')](_0x3a8025[0x0][_0xe2a4('0x1a')]/_0x2bcfbd);var _0x6dc186=Number['isInteger'](_0x3a8025[0x0]['num']/_0x2bcfbd)?_0x3a8025[0x0][_0xe2a4('0x1a')]%_0x2bcfbd:0x0;_0x56f98e['forEach'](function(_0x506557){if(_0x506557>0x0){_0xb2e3e6+=_0x2bcfbd;}_0x440cba[_0xe2a4('0x1d')](dbH[_0xe2a4('0x15')][_0xe2a4('0x16')](util[_0xe2a4('0x17')](_0xe2a4('0x1e'),QUERY,_0x2bcfbd,_0xb2e3e6),{'type':dbH[_0xe2a4('0x15')]['QueryTypes']['SELECT']}));});if(_0x6dc186>0x0){_0xb2e3e6+=_0x2bcfbd;_0x440cba['push'](dbH['sequelize'][_0xe2a4('0x16')](util[_0xe2a4('0x17')](_0xe2a4('0x1e'),QUERY,_0x6dc186,_0xb2e3e6),{'type':dbH[_0xe2a4('0x15')][_0xe2a4('0x19')]['SELECT']}));}}}else{_0x440cba[_0xe2a4('0x1d')](dbH[_0xe2a4('0x15')][_0xe2a4('0x16')](QUERY,{'type':dbH[_0xe2a4('0x15')][_0xe2a4('0x19')][_0xe2a4('0x1f')]}));}var _0x4887e5=path['dirname'](PATH);var _0x1c69f2=path[_0xe2a4('0x20')](PATH,_0xe2a4('0x21'));var _0x518c26=_0x5ac6d5['split']&&_0x440cba[_0xe2a4('0x22')]>0x1;var _0xc733cc=[];if(!fs[_0xe2a4('0x23')](path[_0xe2a4('0x24')](_0x4887e5,_0x1c69f2))&&_0x518c26){fs[_0xe2a4('0x25')](path['join'](_0x4887e5,_0x1c69f2));}return BPromise[_0xe2a4('0x26')](_0x440cba,function(_0x94f29d){_0xc733cc[_0xe2a4('0x1d')](_0x94f29d);})[_0xe2a4('0x14')](function(){for(var _0x56abdd=0x0;_0x56abdd<_0xc733cc[_0xe2a4('0x22')];_0x56abdd+=0x1){var _0x440190;var _0x18d4d9=_0xc733cc[_0x56abdd];if(_0x518c26){_0x440190=path[_0xe2a4('0x24')](_0x4887e5,_0x1c69f2,util['format'](_0xe2a4('0x27'),_0x1c69f2,_0x56abdd,_0xe2a4('0x28')));}else{_0x440190=path['join'](_0x4887e5,util[_0xe2a4('0x17')](_0xe2a4('0x29'),_0x1c69f2,_0xe2a4('0x28')));}fs['writeFileSync'](_0x440190,json2xls(_0x18d4d9),_0xe2a4('0x2a'));}})['then'](function(){if(_0x518c26){return new Promise(function(_0x1413fc){zipdir(path['join'](_0x4887e5,_0x1c69f2),{'saveTo':path[_0xe2a4('0x24')](_0x4887e5,util[_0xe2a4('0x17')](_0xe2a4('0x29'),_0x1c69f2,_0xe2a4('0x2b')))},function(_0x584975,_0x94e4e4){rimraf(path['join'](_0x4887e5,_0x1c69f2),function(){});_0x1413fc(_0xe2a4('0x2c'));});});}})['then'](function(){logger[_0xe2a4('0xd')](util[_0xe2a4('0x17')](_0xe2a4('0x2d'),EXTRACTED_REPORT_ID,_0xe2a4('0xf')));return analyticExtractedReport('Completed',_0x518c26?util[_0xe2a4('0x17')]('%s.%s',_0x1c69f2,_0x518c26?_0xe2a4('0x2b'):_0xe2a4('0x28')):null);});})['catch'](function(_0x3af562){logger[_0xe2a4('0xd')](util[_0xe2a4('0x17')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0xe2a4('0x2e')](_0x3af562,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe2a4('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d63ffd6..2b78bf6 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 _0xfc0c=['filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','Set','format','type','context','VoiceExtensionId','push','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','*,*,*,*','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','toLowerCase','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','bulkCreate','sortBy','lodash','models','Interval','findAll','then','intervals','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xfc0c,0x144));var _0xcfc0=function(_0x2fafa5,_0x3b7457){_0x2fafa5=_0x2fafa5-0x0;var _0x34339f=_0xfc0c[_0x2fafa5];return _0x34339f;};'use strict';var _=require(_0xcfc0('0x0'));var util=require('util');function rewrite(_0x33085d,_0x146768){var _0x44a043=this;return _0x33085d[_0xcfc0('0x1')][_0xcfc0('0x2')][_0xcfc0('0x3')]({'raw':!![]})[_0xcfc0('0x4')](function(_0x48f49a){_0x44a043[_0xcfc0('0x5')]=_0x48f49a;return _0x33085d[_0xcfc0('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x146768[_0xcfc0('0x6')]},'raw':!![]});})[_0xcfc0('0x4')](function(_0x469cbc){return _0x33085d[_0xcfc0('0x1')]['VoiceExtension'][_0xcfc0('0x3')]({'where':{'exten':{'$in':_[_0xcfc0('0x7')](_[_0xcfc0('0x8')](_0x469cbc,_0xcfc0('0x9')))}},'order':[{'raw':_0xcfc0('0xa')}],'raw':!![]});})[_0xcfc0('0x4')](function(_0x42b4e7){var _0xc85b80=_['filter'](_0x42b4e7,{'priority':'1'});var _0x72a93e=_[_0xcfc0('0xb')](_0x42b4e7,{'isApp':0x1});var _0xea56d1=_['groupBy'](_0x72a93e,_0xcfc0('0x9'));var _0xd64de7=[_0xcfc0('0xc'),_0xcfc0('0xd')];var _0x249677=[];var _0x6ccc76=[];for(var _0x1c17d9 in _0xea56d1){if(_0xea56d1[_0xcfc0('0xe')](_0x1c17d9)){_0x44a043[_0xcfc0('0xf')]=0x2;_0x44a043[_0xcfc0('0x10')]=[];_0x44a043[_0xcfc0('0x11')]=_[_0xcfc0('0x12')](_0xc85b80,{'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')]});_0x44a043[_0xcfc0('0x10')]['push']({'type':_0xea56d1[_0x1c17d9][0x0]['type'],'app':_0xcfc0('0x13'),'appdata':util[_0xcfc0('0x14')]('CDR(type)=%s',_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')]),'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});if(_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')]==='inbound'){_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0]['type'],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x19')+_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId'],'context':_0xea56d1[_0x1c17d9][0x0]['context'],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});}else if(_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')]===_0xcfc0('0x1a')){if(_0x44a043[_0xcfc0('0x11')]){_0x44a043[_0xcfc0('0x10')]['push']({'type':_0xea56d1[_0x1c17d9][0x0]['type'],'app':_0xcfc0('0x13'),'appdata':'CDR(destination)='+(_0x44a043[_0xcfc0('0x11')][_0xcfc0('0x1b')]?_0xcfc0('0x1c')+_0x44a043[_0xcfc0('0x11')]['cutdigits']+'}':_0xcfc0('0x1d')),'context':_0xea56d1[_0x1c17d9][0x0]['context'],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId']});}_0x44a043['extensions'][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x19')+_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')],'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});var _0x1315ff=_0x44a043[_0xcfc0('0xf')]++;_0x44a043['extensions'][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x1e'),'appdata':_0xcfc0('0x1f')+(_0x1315ff+0x2)+'):Goto('+(_0x1315ff+0x1)+')','context':_0xea56d1[_0x1c17d9][0x0]['context'],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x1315ff,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId']});if(_0x44a043[_0xcfc0('0x11')]){_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0]['type'],'app':_0xcfc0('0x13'),'appdata':_0x44a043[_0xcfc0('0x11')][_0xcfc0('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x44a043[_0xcfc0('0x11')][_0xcfc0('0x1b')]+'}':_0xcfc0('0x20'),'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043['priority']++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId']});}_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x21')+_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')],'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});if(_0x44a043['extension']&&_0x44a043['extension']['hasOwnProperty'](_0xcfc0('0x22'))&&_0x44a043[_0xcfc0('0x11')][_0xcfc0('0x22')]!==_0xcfc0('0x23')){_0x44a043[_0xcfc0('0x10')]['push']({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x24'),'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x44a043[_0xcfc0('0x11')]['recordingFormat']||_0xcfc0('0x25'),'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0]['exten'],'priority':_0x44a043['priority']++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});}}_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});_0x44a043['extensions'][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':'Set','appdata':_0xcfc0('0x26'),'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'priority':_0x44a043['priority']++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});_0x44a043[_0xcfc0('0x10')][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':'Set','appdata':_0xcfc0('0x27'),'context':_0xea56d1[_0x1c17d9][0x0]['context'],'exten':_0xea56d1[_0x1c17d9][0x0]['exten'],'priority':_0x44a043[_0xcfc0('0xf')]++,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId']});for(var _0x1e15f9=0x0,_0x42a724=0x0;_0x1e15f9<_0xea56d1[_0x1c17d9][_0xcfc0('0x28')];_0x1e15f9+=0x1,_0x42a724=0x0){var _0x23f17a=_0xea56d1[_0x1c17d9][_0x1e15f9];if(_0x23f17a[_0xcfc0('0x15')]){_0x23f17a[_0xcfc0('0x15')]=_0x23f17a[_0xcfc0('0x15')]['toLowerCase']();}var _0x9b3562=[];var _0x4a60b2=[];delete _0x23f17a['id'];delete _0x23f17a['createdAt'];delete _0x23f17a[_0xcfc0('0x29')];var _0x5d28a4=_0x23f17a['interval']!==_0xcfc0('0x2a')?[_0x23f17a[_0xcfc0('0x2b')]]:_0x23f17a[_0xcfc0('0x6')]?_[_0xcfc0('0x8')](_[_0xcfc0('0xb')](_0x44a043[_0xcfc0('0x5')],{'IntervalId':_0x23f17a['IntervalId']}),_0xcfc0('0x2b')):[];if(_0x23f17a['hasOwnProperty'](_0xcfc0('0x2c'))){if(_0x23f17a['tag']&&_0x23f17a[_0xcfc0('0x2c')]!=='--'){_0x9b3562['push']({'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x2d')+_0x23f17a[_0xcfc0('0x2c')],'context':_0x23f17a[_0xcfc0('0x16')],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4['length']+_0x44a043['priority']+_0x42a724++,'VoiceExtensionId':_0x23f17a[_0xcfc0('0x17')]});}}if(_0x23f17a[_0xcfc0('0x15')]===_0xcfc0('0x1a')&&_0x23f17a['hasOwnProperty'](_0xcfc0('0x2e'))){if(_0x23f17a[_0xcfc0('0x2e')]){_0x9b3562[_0xcfc0('0x18')]({'type':_0x23f17a[_0xcfc0('0x15')],'app':'ExecIf','appdata':_0xcfc0('0x2f')+_0x23f17a[_0xcfc0('0x2e')]+')','context':_0x23f17a['context'],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4['length']+_0x44a043[_0xcfc0('0xf')]+_0x42a724++,'VoiceExtensionId':_0x23f17a[_0xcfc0('0x17')]});}else{_0x9b3562['push']({'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x1e'),'appdata':_0xcfc0('0x30'),'context':_0x23f17a[_0xcfc0('0x16')],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4[_0xcfc0('0x28')]+_0x44a043[_0xcfc0('0xf')]+_0x42a724++,'VoiceExtensionId':_0x23f17a['VoiceExtensionId']});}}if(_0x23f17a[_0xcfc0('0xe')](_0xcfc0('0x31'))){if(_0xd64de7[_0xcfc0('0x32')](_0x23f17a[_0xcfc0('0x33')][_0xcfc0('0x34')]())>=0x0&&_0x23f17a['appType']!=='custom'){if(_0x23f17a['answer']){_0x9b3562[_0xcfc0('0x18')]({'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x1e'),'appdata':_0xcfc0('0x35'),'context':_0x23f17a[_0xcfc0('0x16')],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4[_0xcfc0('0x28')]+_0x44a043[_0xcfc0('0xf')]+_0x42a724++,'VoiceExtensionId':_0x23f17a[_0xcfc0('0x17')]});_0x9b3562['push']({'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x36'),'context':_0x23f17a[_0xcfc0('0x16')],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4[_0xcfc0('0x28')]+_0x44a043[_0xcfc0('0xf')]+_0x42a724++,'VoiceExtensionId':_0x23f17a['VoiceExtensionId']});}else{_0x9b3562[_0xcfc0('0x18')]({'type':_0x23f17a['type'],'app':'ExecIf','appdata':_0xcfc0('0x37'),'context':_0x23f17a['context'],'exten':_0x23f17a['exten'],'priority':_0x5d28a4[_0xcfc0('0x28')]+_0x44a043[_0xcfc0('0xf')]+_0x42a724++,'VoiceExtensionId':_0x23f17a[_0xcfc0('0x17')]});_0x9b3562[_0xcfc0('0x18')]({'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x13'),'appdata':_0xcfc0('0x38'),'context':_0x23f17a[_0xcfc0('0x16')],'exten':_0x23f17a[_0xcfc0('0x9')],'priority':_0x5d28a4[_0xcfc0('0x28')]+_0x44a043['priority']+_0x42a724++,'VoiceExtensionId':_0x23f17a[_0xcfc0('0x17')]});}}}for(var _0x1a8918=0x0;_0x1a8918<_0x5d28a4[_0xcfc0('0x28')];_0x1a8918+=0x1){var _0x58464c=_0x44a043[_0xcfc0('0xf')]+_0x5d28a4[_0xcfc0('0x28')];var _0x548862=_0x1a8918===_0x5d28a4[_0xcfc0('0x28')]-0x1?_0x44a043[_0xcfc0('0xf')]+_0x9b3562[_0xcfc0('0x28')]+_0x4a60b2[_0xcfc0('0x28')]+0x2:_0x44a043[_0xcfc0('0xf')]+_0x1a8918+0x1;_0x9b3562[_0xcfc0('0x39')](_0x1a8918,0x0,{'type':_0x23f17a[_0xcfc0('0x15')],'app':_0xcfc0('0x3a'),'appdata':_0x5d28a4[_0x1a8918]+'?'+_0x23f17a[_0xcfc0('0x16')]+',${EXTEN},'+_0x58464c+':'+_0x23f17a[_0xcfc0('0x16')]+_0xcfc0('0x3b')+_0x548862,'exten':_0x23f17a[_0xcfc0('0x9')],'context':_0x23f17a[_0xcfc0('0x16')],'priority':_0x44a043[_0xcfc0('0xf')]+_0x1a8918,'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0]['VoiceExtensionId']});}_0x23f17a[_0xcfc0('0xf')]=_0x9b3562[_0xcfc0('0x28')]?_[_0xcfc0('0x3c')](_0x9b3562)[_0xcfc0('0xf')]+0x1:_0x44a043[_0xcfc0('0xf')];_0x44a043[_0xcfc0('0xf')]=(_0x4a60b2[_0xcfc0('0x28')]?_[_0xcfc0('0x3c')](_0x4a60b2)['priority']:_0x23f17a['priority'])+0x1;_0x44a043['extensions']=_[_0xcfc0('0x3d')](_0x44a043[_0xcfc0('0x10')],_0x9b3562,[_0x23f17a],_0x4a60b2);}_0x44a043['extensions'][_0xcfc0('0x18')]({'type':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x15')],'app':_0xcfc0('0x3e'),'exten':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x9')],'context':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x16')],'priority':_0x44a043[_0xcfc0('0xf')],'VoiceExtensionId':_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]});_0x249677[_0xcfc0('0x18')](_0xea56d1[_0x1c17d9][0x0][_0xcfc0('0x17')]);_0x6ccc76=_[_0xcfc0('0x3d')](_0x6ccc76,_0x44a043['extensions']);}}return _0x33085d[_0xcfc0('0x3f')](function(_0x1e5e88){return _0x33085d['models'][_0xcfc0('0x40')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x249677}},'transaction':_0x1e5e88})[_0xcfc0('0x4')](function(_0x129bec){return _0x33085d[_0xcfc0('0x1')]['VoiceExtension'][_0xcfc0('0x41')](_[_0xcfc0('0x42')](_0x6ccc76,'priority'),{'transaction':_0x1e5e88});});});})['catch'](function(_0x4c8399){console['error'](_0x4c8399);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x21b5=['extension','find','extensions','push','type','Set','format','context','priority','VoiceExtensionId','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','tag','CDR(tag)=','outbound','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${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-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x21b5,0x111));var _0x521b=function(_0x2e7934,_0xa2266b){_0x2e7934=_0x2e7934-0x0;var _0x2b95a0=_0x21b5[_0x2e7934];return _0x2b95a0;};'use strict';var _=require(_0x521b('0x0'));var util=require(_0x521b('0x1'));function rewrite(_0x1bd431,_0x54ba79){var _0x5af966=this;return _0x1bd431[_0x521b('0x2')]['Interval'][_0x521b('0x3')]({'raw':!![]})[_0x521b('0x4')](function(_0x3c5f51){_0x5af966[_0x521b('0x5')]=_0x3c5f51;return _0x1bd431[_0x521b('0x2')][_0x521b('0x6')][_0x521b('0x3')]({'where':{'IntervalId':_0x54ba79[_0x521b('0x7')]},'raw':!![]});})['then'](function(_0x2ab35d){return _0x1bd431['models'][_0x521b('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x521b('0x8')](_0x2ab35d,_0x521b('0x9')))}},'order':[{'raw':_0x521b('0xa')}],'raw':!![]});})[_0x521b('0x4')](function(_0x410f7e){var _0x5a9a3a=_[_0x521b('0xb')](_0x410f7e,{'priority':'1'});var _0x2dcae7=_[_0x521b('0xb')](_0x410f7e,{'isApp':0x1});var _0x233062=_[_0x521b('0xc')](_0x2dcae7,_0x521b('0x9'));var _0x9db99c=['queue',_0x521b('0xd')];var _0x2dc547=[];var _0x260250=[];for(var _0x168935 in _0x233062){if(_0x233062[_0x521b('0xe')](_0x168935)){_0x5af966['priority']=0x2;_0x5af966['extensions']=[];_0x5af966[_0x521b('0xf')]=_[_0x521b('0x10')](_0x5a9a3a,{'exten':_0x233062[_0x168935][0x0]['exten']});_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':util[_0x521b('0x15')]('CDR(type)=%s',_0x233062[_0x168935][0x0][_0x521b('0x13')]),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});if(_0x233062[_0x168935][0x0]['type']==='inbound'){_0x5af966['extensions']['push']({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x19')+_0x233062[_0x168935][0x0]['VoiceExtensionId'],'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0]['exten'],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0]['VoiceExtensionId']});}else if(_0x233062[_0x168935][0x0][_0x521b('0x13')]==='outbound'){if(_0x5af966[_0x521b('0xf')]){_0x5af966['extensions'][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0]['type'],'app':_0x521b('0x14'),'appdata':_0x521b('0x1a')+(_0x5af966['extension']['cutdigits']?'${EXTEN:'+_0x5af966['extension'][_0x521b('0x1b')]+'}':_0x521b('0x1c')),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0]['exten'],'priority':_0x5af966['priority']++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});}_0x5af966['extensions'][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0]['type'],'app':'Set','appdata':_0x521b('0x19')+_0x233062[_0x168935][0x0]['VoiceExtensionId'],'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966['priority']++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});var _0x398fcd=_0x5af966[_0x521b('0x17')]++;_0x5af966['extensions'][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x1d'),'appdata':_0x521b('0x1e')+(_0x398fcd+0x2)+_0x521b('0x1f')+(_0x398fcd+0x1)+')','context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0]['exten'],'priority':_0x398fcd,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});if(_0x5af966[_0x521b('0xf')]){_0x5af966['extensions'][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':'Set','appdata':_0x5af966['extension'][_0x521b('0x1b')]?_0x521b('0x20')+_0x5af966['extension']['cutdigits']+'}':_0x521b('0x21'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966['priority']++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});}_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x22')+_0x233062[_0x168935][0x0][_0x521b('0x18')],'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});if(_0x5af966[_0x521b('0xf')]&&_0x5af966['extension'][_0x521b('0xe')](_0x521b('0x23'))&&_0x5af966[_0x521b('0xf')][_0x521b('0x23')]!==_0x521b('0x24')){_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x25'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0]['VoiceExtensionId']});_0x5af966[_0x521b('0x11')]['push']({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x26')+_0x5af966[_0x521b('0xf')][_0x521b('0x23')]||_0x521b('0x27'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});}}_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x28'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0]['VoiceExtensionId']});_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0]['type'],'app':_0x521b('0x14'),'appdata':_0x521b('0x29'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});_0x5af966[_0x521b('0x11')][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':_0x521b('0x2a'),'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'exten':_0x233062[_0x168935][0x0][_0x521b('0x9')],'priority':_0x5af966[_0x521b('0x17')]++,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});for(var _0x3426ef=0x0,_0x468a58=0x0;_0x3426ef<_0x233062[_0x168935][_0x521b('0x2b')];_0x3426ef+=0x1,_0x468a58=0x0){var _0x304641=_0x233062[_0x168935][_0x3426ef];if(_0x304641['type']){_0x304641['type']=_0x304641[_0x521b('0x13')][_0x521b('0x2c')]();}var _0x2fa98a=[];var _0x43b050=[];delete _0x304641['id'];delete _0x304641['createdAt'];delete _0x304641['updatedAt'];var _0x2e663a=_0x304641[_0x521b('0x2d')]!=='*,*,*,*'?[_0x304641[_0x521b('0x2d')]]:_0x304641[_0x521b('0x7')]?_[_0x521b('0x8')](_[_0x521b('0xb')](_0x5af966[_0x521b('0x5')],{'IntervalId':_0x304641[_0x521b('0x7')]}),_0x521b('0x2d')):[];if(_0x304641['hasOwnProperty'](_0x521b('0x2e'))){if(_0x304641[_0x521b('0x2e')]&&_0x304641[_0x521b('0x2e')]!=='--'){_0x2fa98a[_0x521b('0x12')]({'type':_0x304641[_0x521b('0x13')],'app':'Set','appdata':_0x521b('0x2f')+_0x304641[_0x521b('0x2e')],'context':_0x304641['context'],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a['length']+_0x5af966[_0x521b('0x17')]+_0x468a58++,'VoiceExtensionId':_0x304641['VoiceExtensionId']});}}if(_0x304641[_0x521b('0x13')]===_0x521b('0x30')&&_0x304641[_0x521b('0xe')]('callerID')){if(_0x304641['callerID']){_0x2fa98a['push']({'type':_0x304641[_0x521b('0x13')],'app':_0x521b('0x1d'),'appdata':_0x521b('0x31')+_0x304641[_0x521b('0x32')]+')','context':_0x304641[_0x521b('0x16')],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a[_0x521b('0x2b')]+_0x5af966['priority']+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});}else{_0x2fa98a[_0x521b('0x12')]({'type':_0x304641[_0x521b('0x13')],'app':_0x521b('0x1d'),'appdata':_0x521b('0x33'),'context':_0x304641[_0x521b('0x16')],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a['length']+_0x5af966['priority']+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});}}if(_0x304641['hasOwnProperty'](_0x521b('0x34'))){if(_0x9db99c[_0x521b('0x35')](_0x304641[_0x521b('0x36')][_0x521b('0x2c')]())>=0x0&&_0x304641[_0x521b('0x37')]!==_0x521b('0x38')){if(_0x304641[_0x521b('0x34')]){_0x2fa98a['push']({'type':_0x304641[_0x521b('0x13')],'app':_0x521b('0x1d'),'appdata':_0x521b('0x39'),'context':_0x304641['context'],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a[_0x521b('0x2b')]+_0x5af966['priority']+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});_0x2fa98a['push']({'type':_0x304641[_0x521b('0x13')],'app':_0x521b('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x304641['context'],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a[_0x521b('0x2b')]+_0x5af966[_0x521b('0x17')]+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});}else{_0x2fa98a['push']({'type':_0x304641['type'],'app':_0x521b('0x1d'),'appdata':_0x521b('0x3a'),'context':_0x304641[_0x521b('0x16')],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a['length']+_0x5af966[_0x521b('0x17')]+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});_0x2fa98a[_0x521b('0x12')]({'type':_0x304641['type'],'app':_0x521b('0x14'),'appdata':_0x521b('0x3b'),'context':_0x304641['context'],'exten':_0x304641[_0x521b('0x9')],'priority':_0x2e663a['length']+_0x5af966['priority']+_0x468a58++,'VoiceExtensionId':_0x304641[_0x521b('0x18')]});}}}for(var _0x44f463=0x0;_0x44f463<_0x2e663a[_0x521b('0x2b')];_0x44f463+=0x1){var _0x268fda=_0x5af966[_0x521b('0x17')]+_0x2e663a['length'];var _0xe2674f=_0x44f463===_0x2e663a['length']-0x1?_0x5af966['priority']+_0x2fa98a['length']+_0x43b050[_0x521b('0x2b')]+0x2:_0x5af966['priority']+_0x44f463+0x1;_0x2fa98a[_0x521b('0x3c')](_0x44f463,0x0,{'type':_0x304641[_0x521b('0x13')],'app':_0x521b('0x3d'),'appdata':_0x2e663a[_0x44f463]+'?'+_0x304641['context']+_0x521b('0x3e')+_0x268fda+':'+_0x304641[_0x521b('0x16')]+_0x521b('0x3e')+_0xe2674f,'exten':_0x304641['exten'],'context':_0x304641[_0x521b('0x16')],'priority':_0x5af966[_0x521b('0x17')]+_0x44f463,'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});}_0x304641[_0x521b('0x17')]=_0x2fa98a['length']?_[_0x521b('0x3f')](_0x2fa98a)[_0x521b('0x17')]+0x1:_0x5af966[_0x521b('0x17')];_0x5af966[_0x521b('0x17')]=(_0x43b050['length']?_[_0x521b('0x3f')](_0x43b050)[_0x521b('0x17')]:_0x304641[_0x521b('0x17')])+0x1;_0x5af966['extensions']=_['concat'](_0x5af966[_0x521b('0x11')],_0x2fa98a,[_0x304641],_0x43b050);}_0x5af966['extensions'][_0x521b('0x12')]({'type':_0x233062[_0x168935][0x0][_0x521b('0x13')],'app':_0x521b('0x40'),'exten':_0x233062[_0x168935][0x0]['exten'],'context':_0x233062[_0x168935][0x0][_0x521b('0x16')],'priority':_0x5af966[_0x521b('0x17')],'VoiceExtensionId':_0x233062[_0x168935][0x0][_0x521b('0x18')]});_0x2dc547['push'](_0x233062[_0x168935][0x0][_0x521b('0x18')]);_0x260250=_[_0x521b('0x41')](_0x260250,_0x5af966[_0x521b('0x11')]);}}return _0x1bd431[_0x521b('0x42')](function(_0x3dc103){return _0x1bd431[_0x521b('0x2')][_0x521b('0x6')][_0x521b('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x2dc547}},'transaction':_0x3dc103})['then'](function(_0x5bf37c){return _0x1bd431[_0x521b('0x2')][_0x521b('0x6')]['bulkCreate'](_[_0x521b('0x44')](_0x260250,'priority'),{'transaction':_0x3dc103});});});})[_0x521b('0x45')](function(_0x5d55a1){console[_0x521b('0x46')](_0x5d55a1);});}exports[_0x521b('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 821c438..1c2fc60 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 _0x0d71=['exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','find','duplicate','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','createdAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','\x20=\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','sequelize','query','VoiceQueueId','all','CmList','BlackLists','get','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:'];(function(_0x2e1d99,_0x3a3a46){var _0x63613c=function(_0x326cf1){while(--_0x326cf1){_0x2e1d99['push'](_0x2e1d99['shift']());}};_0x63613c(++_0x3a3a46);}(_0x0d71,0xe8));var _0x10d7=function(_0xa3d7a1,_0x5d7fce){_0xa3d7a1=_0xa3d7a1-0x0;var _0x2afdac=_0x0d71[_0xa3d7a1];return _0x2afdac;};'use strict';var BPromise=require(_0x10d7('0x0'));var util=require('util');var _=require(_0x10d7('0x1'));var fs=require('fs');var squel=require(_0x10d7('0x2'));var Papa=require(_0x10d7('0x3'));var Redis=require(_0x10d7('0x4'));var db=require(_0x10d7('0x5'))['db'];var config=require(_0x10d7('0x6'));var logger=require(_0x10d7('0x7'))('api');config[_0x10d7('0x8')]=_[_0x10d7('0x9')](config[_0x10d7('0x8')],{'host':_0x10d7('0xa'),'port':0x18eb});var socket=require(_0x10d7('0xb'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x10d7('0xc')](socket);try{if(!process[_0x10d7('0xd')][0x2]||process[_0x10d7('0xd')][0x2]==='undefined'||process[_0x10d7('0xd')][0x2]===_0x10d7('0xe')){throw new Error(_0x10d7('0xf'));}var FILEPATH=process[_0x10d7('0xd')][0x2];if(!process[_0x10d7('0xd')][0x3]||process[_0x10d7('0xd')][0x3]===_0x10d7('0x10')||process['argv'][0x3]==='null'||!process[_0x10d7('0xd')][0x4]||process[_0x10d7('0xd')][0x4]===_0x10d7('0x10')||process[_0x10d7('0xd')][0x4]==='null'){throw new Error(_0x10d7('0x11'));}var FIELDS=_[_0x10d7('0x12')](process[_0x10d7('0xd')][0x3][_0x10d7('0x13')](','),process[_0x10d7('0xd')][0x4][_0x10d7('0x13')](','));if(!process[_0x10d7('0xd')][0x5]||process[_0x10d7('0xd')][0x5]===_0x10d7('0x10')||process[_0x10d7('0xd')][0x5]===_0x10d7('0xe')){throw new Error(_0x10d7('0x14'));}var LISTID=process[_0x10d7('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x10d7('0xd')][0x6]!==_0x10d7('0x10')&&process[_0x10d7('0xd')][0x6]!==_0x10d7('0xe')?process[_0x10d7('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x10d7('0xd')][0x7]!==_0x10d7('0x10')&&process['argv'][0x7]!=='null'?process[_0x10d7('0xd')][0x7]:null;if(!process[_0x10d7('0xd')][0x8]||process[_0x10d7('0xd')][0x8]===_0x10d7('0x10')||process['argv'][0x8]==='null'){throw new Error(_0x10d7('0x15'));}var SOCKET_TIMESTAMP=process[_0x10d7('0xd')][0x8];}catch(_0x448c8b){logger[_0x10d7('0x16')](_0x448c8b);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(_0x75e42c,_0x273885,_0x3ed8c8,_0x2ba1eb){var _0x18308a={'message':_0x273885};_0x18308a[_0x75e42c]=!![];if(_0x3ed8c8){_0x18308a[_0x10d7('0x17')]=_0x3ed8c8;}if(_0x2ba1eb){_0x18308a['index']=_0x2ba1eb;}return _0x18308a;}function isEmail(_0x15091c){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))*$/[_0x10d7('0x18')](_0x15091c);}function checkRow(_0x1b5637,_0x373e7f,_0x42e4d0){return new BPromise(function(_0x1b20e2,_0x1fdc72){if(_[_0x10d7('0x19')](_0x1b5637)){return _0x1fdc72(handleCheckRowError('error',_0x10d7('0x1a'),null,_0x42e4d0));}if(_0x1b5637[_0x10d7('0x1b')]&&_0x1b5637[_0x10d7('0x1b')][_0x10d7('0x1c')]){var _0xbd7879=_[_0x10d7('0x1d')](_0x1b5637['errors'],_0x10d7('0x1e'))[_0x10d7('0x1f')](';');return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),_0xbd7879,null,_0x42e4d0));}var _0x171df4={};for(var _0x197a29 in FIELDS){if(FIELDS['hasOwnProperty'](_0x197a29)&&FIELDS[_0x197a29]){_0x171df4[_0x197a29]=_0x1b5637[_0x10d7('0x20')][0x0][FIELDS[_0x197a29]]||_0x1b5637[_0x10d7('0x20')][0x0]['\ufeff'+FIELDS[_0x197a29]];}}if(!_0x171df4[_0x10d7('0x21')]){return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),_0x10d7('0x22'),null,_0x42e4d0));}if(!_0x171df4[_0x10d7('0x23')]){return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),_0x10d7('0x24'),null,_0x42e4d0));}if(_0x171df4[_0x10d7('0x25')]){var _0x363787=moment(_0x171df4['birthDate'],'YYYY-MM-DD');if(!_0x363787[_0x10d7('0x26')]()){return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),_0x10d7('0x27'),null,_0x42e4d0));}}if(_0x171df4[_0x10d7('0x28')]){if(!isEmail(_0x171df4[_0x10d7('0x28')])){return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x42e4d0));}}_0x171df4[_0x10d7('0x29')]=LISTID;_0x171df4['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x10d7('0x1c')]&&_0x373e7f){var _0x19f1ae={};for(var _0x442e92=0x0,_0x4570ac=DUPLICATES['length'];_0x442e92<_0x4570ac;_0x442e92+=0x1){_0x19f1ae[DUPLICATES[_0x442e92]]=_0x171df4[DUPLICATES[_0x442e92]];}var _0x483d8e=_[_0x10d7('0x2a')](_0x373e7f,_0x19f1ae);if(_0x483d8e){return _0x1fdc72(handleCheckRowError(_0x10d7('0x2b'),'Duplicate\x20Contact',_0x483d8e,_0x42e4d0));}}return db[_0x10d7('0x2c')][_0x10d7('0x2d')](_0x171df4,{'raw':!![],'hooks':![],'fields':_[_0x10d7('0x2e')](_0x171df4)})[_0x10d7('0x2f')](function(_0x390e23){if(DUPLICATES&&DUPLICATES[_0x10d7('0x1c')]&&_0x373e7f){_0x373e7f[_0x10d7('0x30')](_['pick'](_0x171df4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x390e23['id'];return _0x1b20e2();})[_0x10d7('0x31')](function(_0x120cd7){return _0x1fdc72(handleCheckRowError(_0x10d7('0x16'),_0x10d7('0x32')+(_0x120cd7[_0x10d7('0x1e')]||JSON[_0x10d7('0x33')](_0x120cd7)),null,_0x42e4d0));});});}function checkHopper(){function _0x327cd9(){return function(_0x59d56b){logger['error'](_0x10d7('0x34'),_0x10d7('0x35'),util[_0x10d7('0x36')](_0x59d56b,{'showHidden':![],'depth':null}));};}var _0xeaddde=function(_0x2479ba,_0x5b597f){var _0x5a8cc4=squel[_0x10d7('0x37')]()[_0x10d7('0x38')](_0x10d7('0x39'))[_0x10d7('0x3a')]([_0x10d7('0x23'),_0x10d7('0x3b'),_0x10d7('0x3c'),_0x10d7('0x29'),_0x5b597f,'createdAt',_0x10d7('0x3d')],squel[_0x10d7('0x3e')]()[_0x10d7('0x3f')]('phone',_0x10d7('0x23'))[_0x10d7('0x3f')](_0x10d7('0x40'),_0x10d7('0x3b'))['field']('id',_0x10d7('0x3c'))[_0x10d7('0x3f')](LISTID[_0x10d7('0x41')](),_0x10d7('0x29'))[_0x10d7('0x3f')](_0x2479ba['id'][_0x10d7('0x41')](),_0x5b597f)[_0x10d7('0x3f')](_0x10d7('0x40'),'createdAt')[_0x10d7('0x3f')](_0x10d7('0x40'),_0x10d7('0x3d'))[_0x10d7('0x42')](_0x10d7('0x43'))[_0x10d7('0x44')]('deletedAt\x20IS\x20NULL')[_0x10d7('0x44')](_0x10d7('0x45'),LISTID[_0x10d7('0x41')]())[_0x10d7('0x44')](_0x10d7('0x46'))['where'](_0x10d7('0x47'),squel['select']()[_0x10d7('0x3f')]('phone')[_0x10d7('0x42')](_0x10d7('0x39'))['where'](_0x5b597f+'\x20=\x20?',_0x2479ba['id'][_0x10d7('0x41')]())))[_0x10d7('0x41')]();return _0x5a8cc4;};var _0x10696c=function(_0x59d23b,_0x59fd5c){var _0x5784e2=squel[_0x10d7('0x37')]()[_0x10d7('0x38')](_0x10d7('0x39'))[_0x10d7('0x3a')](['phone','scheduledAt',_0x10d7('0x3c'),_0x10d7('0x29'),_0x59fd5c,_0x10d7('0x48'),'updatedAt'],squel[_0x10d7('0x3e')]()['field'](_0x10d7('0x23'),_0x10d7('0x23'))['field'](_0x10d7('0x40'),_0x10d7('0x3b'))[_0x10d7('0x3f')]('id',_0x10d7('0x3c'))[_0x10d7('0x3f')](LISTID[_0x10d7('0x41')](),_0x10d7('0x29'))['field'](_0x59d23b['id'][_0x10d7('0x41')](),_0x59fd5c)[_0x10d7('0x3f')](_0x10d7('0x40'),_0x10d7('0x48'))[_0x10d7('0x3f')](_0x10d7('0x40'),_0x10d7('0x3d'))[_0x10d7('0x42')](_0x10d7('0x43'))['where'](_0x10d7('0x49'))[_0x10d7('0x44')](_0x10d7('0x45'),LISTID['toString']())['where'](_0x10d7('0x4a'),squel['str'](hopperContacts))[_0x10d7('0x44')](_0x10d7('0x46'))[_0x10d7('0x44')](_0x10d7('0x47'),squel[_0x10d7('0x3e')]()['field'](_0x10d7('0x4b'))[_0x10d7('0x42')](_0x10d7('0x4c'))[_0x10d7('0x44')](_0x59fd5c+_0x10d7('0x4d'),_0x59d23b['id'][_0x10d7('0x41')]()))[_0x10d7('0x44')](_0x10d7('0x47'),squel['select']()['field'](_0x10d7('0x23'))[_0x10d7('0x42')](_0x10d7('0x39'))[_0x10d7('0x44')](_0x59fd5c+_0x10d7('0x4d'),_0x59d23b['id']['toString']())))[_0x10d7('0x41')]();return _0x5784e2;};function _0x49daf4(_0x369c5e,_0x2e9715){var _0x175052=squel[_0x10d7('0x37')]()['into'](_0x10d7('0x39'))[_0x10d7('0x3a')]([_0x10d7('0x23'),_0x10d7('0x3b'),_0x10d7('0x3c'),_0x10d7('0x29'),_0x2e9715,_0x10d7('0x48'),_0x10d7('0x3d')],squel[_0x10d7('0x3e')]()[_0x10d7('0x3f')]('phone',_0x10d7('0x23'))[_0x10d7('0x3f')]('NOW()',_0x10d7('0x3b'))[_0x10d7('0x3f')]('id',_0x10d7('0x3c'))[_0x10d7('0x3f')](LISTID[_0x10d7('0x41')](),_0x10d7('0x29'))[_0x10d7('0x3f')](_0x369c5e['id'][_0x10d7('0x41')](),_0x2e9715)[_0x10d7('0x3f')]('NOW()',_0x10d7('0x48'))[_0x10d7('0x3f')]('NOW()',_0x10d7('0x3d'))[_0x10d7('0x42')](_0x10d7('0x43'))[_0x10d7('0x44')](_0x10d7('0x49'))[_0x10d7('0x44')](_0x10d7('0x45'),LISTID[_0x10d7('0x41')]())[_0x10d7('0x44')](_0x10d7('0x4a'),squel[_0x10d7('0x4e')](hopperContacts))[_0x10d7('0x44')](_0x10d7('0x46')))[_0x10d7('0x41')]();return _0x175052;}function _0x3c24fc(_0x38b350,_0x9a8523){var _0x2d15be=squel[_0x10d7('0x37')]()['into'](_0x10d7('0x4f'))['fromQuery']([_0x10d7('0x23'),_0x10d7('0x3c'),'ListId',_0x9a8523,_0x10d7('0x48'),_0x10d7('0x3d')],squel[_0x10d7('0x3e')]()[_0x10d7('0x3f')](_0x10d7('0x23'),'phone')[_0x10d7('0x3f')]('id',_0x10d7('0x3c'))[_0x10d7('0x3f')](LISTID[_0x10d7('0x41')](),'ListId')[_0x10d7('0x3f')](_0x38b350['id'][_0x10d7('0x41')](),_0x9a8523)['field'](_0x10d7('0x40'),_0x10d7('0x48'))[_0x10d7('0x3f')](_0x10d7('0x40'),_0x10d7('0x3d'))[_0x10d7('0x42')](_0x10d7('0x43'))[_0x10d7('0x44')](_0x10d7('0x49'))[_0x10d7('0x44')]('ListId\x20=\x20?',LISTID[_0x10d7('0x41')]())[_0x10d7('0x44')](_0x10d7('0x4a'),squel[_0x10d7('0x4e')](hopperContacts))[_0x10d7('0x44')](_0x10d7('0x46')))['toString']();return _0x2d15be;}return db[_0x10d7('0x50')][_0x10d7('0x51')]({'where':{'type':_0x10d7('0x52')},'attributes':['id',_0x10d7('0x53')],'include':[{'model':db['CmList'],'as':_0x10d7('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x5821af){var _0x21fbd1=[];if(_0x5821af){var _0x575466;for(var _0x46c304=0x0,_0x46fdc8;_0x46c304<_0x5821af['length'];_0x46c304+=0x1){_0x46fdc8=_0x5821af[_0x46c304]['get']({'plain':!![]});switch(_0x46fdc8[_0x10d7('0x53')]){case'always':_0x21fbd1[_0x10d7('0x30')](db[_0x10d7('0x55')][_0x10d7('0x56')](_0x10696c(_0x46fdc8,_0x10d7('0x57')))[_0x10d7('0x2f')](function(){})[_0x10d7('0x31')](_0x327cd9()));break;case'onlyIfOpen':_0x21fbd1['push'](db['sequelize'][_0x10d7('0x56')](_0xeaddde(_0x46fdc8,_0x10d7('0x57')))['then'](function(){})[_0x10d7('0x31')](_0x327cd9()));break;default:_0x21fbd1[_0x10d7('0x30')](db[_0x10d7('0x55')]['query'](_0x49daf4(_0x46fdc8,'VoiceQueueId'))[_0x10d7('0x2f')](function(){})[_0x10d7('0x31')](_0x327cd9()));}}}return _0x21fbd1;})[_0x10d7('0x58')]()[_0x10d7('0x2f')](function(){return db[_0x10d7('0x50')][_0x10d7('0x51')]({'where':{'type':_0x10d7('0x52')},'attributes':['id'],'include':[{'model':db[_0x10d7('0x59')],'as':_0x10d7('0x5a'),'where':{'id':LISTID}}]})[_0x10d7('0x2f')](function(_0x106d99){var _0x26327d=[];if(_0x106d99){var _0x3b4dc6;for(var _0x4e37e3=0x0,_0x2b14f5;_0x4e37e3<_0x106d99[_0x10d7('0x1c')];_0x4e37e3+=0x1){_0x2b14f5=_0x106d99[_0x4e37e3][_0x10d7('0x5b')]({'plain':!![]});_0x26327d['push'](db[_0x10d7('0x55')][_0x10d7('0x56')](_0x3c24fc(_0x2b14f5,_0x10d7('0x57')))[_0x10d7('0x2f')](function(){})[_0x10d7('0x31')](_0x327cd9()));}}return _0x26327d;})[_0x10d7('0x58')]();})['then'](function(){return db[_0x10d7('0x5c')][_0x10d7('0x51')]({'attributes':['id',_0x10d7('0x53')],'include':[{'model':db[_0x10d7('0x59')],'as':_0x10d7('0x54'),'where':{'id':LISTID}}]})[_0x10d7('0x2f')](function(_0x2adfd5){var _0x1cfb31=[];if(_0x2adfd5){for(var _0x4c5cab=0x0,_0x3d54da;_0x4c5cab<_0x2adfd5[_0x10d7('0x1c')];_0x4c5cab+=0x1){_0x3d54da=_0x2adfd5[_0x4c5cab][_0x10d7('0x5b')]({'plain':!![]});switch(_0x3d54da['dialCheckDuplicateType']){case _0x10d7('0x5d'):_0x1cfb31[_0x10d7('0x30')](db[_0x10d7('0x55')][_0x10d7('0x56')](_0x10696c(_0x3d54da,_0x10d7('0x5e')))[_0x10d7('0x2f')](function(){})[_0x10d7('0x31')](_0x327cd9()));break;case _0x10d7('0x5f'):_0x1cfb31[_0x10d7('0x30')](db[_0x10d7('0x55')][_0x10d7('0x56')](_0xeaddde(_0x3d54da,_0x10d7('0x5e')))[_0x10d7('0x2f')](function(){})['catch'](_0x327cd9()));break;default:_0x1cfb31['push'](db['sequelize'][_0x10d7('0x56')](_0x49daf4(_0x3d54da,_0x10d7('0x5e')))[_0x10d7('0x2f')](function(){})[_0x10d7('0x31')](_0x327cd9()));}}}return _0x1cfb31;})[_0x10d7('0x58')]();})[_0x10d7('0x2f')](function(){return db[_0x10d7('0x5c')][_0x10d7('0x51')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x10d7('0x5a'),'where':{'id':LISTID}}]})[_0x10d7('0x2f')](function(_0x22d0bd){var _0x1f1947=[];if(_0x22d0bd){for(var _0x1b41aa=0x0,_0x18c27f;_0x1b41aa<_0x22d0bd[_0x10d7('0x1c')];_0x1b41aa+=0x1){_0x18c27f=_0x22d0bd[_0x1b41aa][_0x10d7('0x5b')]({'plain':!![]});_0x1f1947[_0x10d7('0x30')](db[_0x10d7('0x55')][_0x10d7('0x56')](_0x3c24fc(_0x18c27f,_0x10d7('0x5e')))['then'](function(){})['catch'](_0x327cd9()));}}return _0x1f1947;})[_0x10d7('0x58')]();})['catch'](function(_0x25d903){logger[_0x10d7('0x16')](_0x10d7('0x60'),_0x10d7('0x61'),_0x25d903[_0x10d7('0x1e')]);});}var processPromises=function(_0xf206ff){return BPromise[_0x10d7('0x58')](promises)[_0x10d7('0x2f')](function(_0x126142){})[_0x10d7('0x31')](function(_0x53389c){logger[_0x10d7('0x16')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x53389c));})[_0x10d7('0x62')](function(){socket[_0x10d7('0x63')](_0x10d7('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xf206ff){return _0xf206ff[_0x10d7('0x65')]();}});};var endCsv=function(){return BPromise[_0x10d7('0x66')]()[_0x10d7('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x10d7('0x63')](_0x10d7('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x28ca7b){logger[_0x10d7('0x16')](_0x10d7('0x67'),JSON[_0x10d7('0x33')](_0x28ca7b));}finally{process[_0x10d7('0x68')](0x0);}});};process['on'](_0x10d7('0x69'),function(){logger[_0x10d7('0x6a')](_0x10d7('0x6b'));endCsv();});function main(){return BPromise['resolve']()[_0x10d7('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x10d7('0x13')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x10d7('0x2f')](function(_0x30cab4){var _0x4326f6=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x10d7('0x6c')](_0x4326f6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x336782,_0x40590c){total+=0x1;var _0x406422=total;promises[_0x10d7('0x30')](checkRow(_0x336782,_0x30cab4,_0x406422)[_0x10d7('0x2f')](function(){success+=0x1;})[_0x10d7('0x31')](function(_0x27c377){if(_0x27c377[_0x10d7('0x16')]){errors+=0x1;delete _0x27c377[_0x10d7('0x16')];}else if(_0x27c377[_0x10d7('0x2b')]){duplicates+=0x1;delete _0x27c377[_0x10d7('0x2b')];}rows['push'](_0x27c377);}));if(total%0xc8===0x0){_0x40590c[_0x10d7('0x6d')]();return processPromises(_0x40590c);}},'complete':function(){return processPromises()[_0x10d7('0x2f')](function(){logger[_0x10d7('0x6a')](_0x10d7('0x6e'));endCsv();});},'error':function(_0x21bb2b,_0x42e8d7){logger[_0x10d7('0x6a')](_0x10d7('0x6f'),JSON['stringify'](_0x21bb2b));endCsv();}});})['catch'](function(_0x2e578e){logger[_0x10d7('0x16')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x10d7('0x33')](_0x2e578e));});}main(); \ No newline at end of file +var _0x8c94=['resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','insert','into','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','\x20=\x20?','str','cm_hopper_black','fromQuery','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','VoiceQueueId','then','onlyIfOpen','query','all','BlackLists','get','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_'];(function(_0x487372,_0x435849){var _0x27fe69=function(_0x3db1cc){while(--_0x3db1cc){_0x487372['push'](_0x487372['shift']());}};_0x27fe69(++_0x435849);}(_0x8c94,0x15c));var _0x48c9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8c94[_0x3bf83f];return _0x22c4a9;};'use strict';var BPromise=require(_0x48c9('0x0'));var util=require('util');var _=require(_0x48c9('0x1'));var fs=require('fs');var squel=require(_0x48c9('0x2'));var Papa=require(_0x48c9('0x3'));var Redis=require(_0x48c9('0x4'));var db=require(_0x48c9('0x5'))['db'];var config=require(_0x48c9('0x6'));var logger=require(_0x48c9('0x7'))('api');config[_0x48c9('0x8')]=_['defaults'](config[_0x48c9('0x8')],{'host':_0x48c9('0x9'),'port':0x18eb});var socket=require(_0x48c9('0xa'))(new Redis(config['redis']));require(_0x48c9('0xb'))[_0x48c9('0xc')](socket);try{if(!process[_0x48c9('0xd')][0x2]||process[_0x48c9('0xd')][0x2]===_0x48c9('0xe')||process[_0x48c9('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x48c9('0xd')][0x2];if(!process[_0x48c9('0xd')][0x3]||process[_0x48c9('0xd')][0x3]===_0x48c9('0xe')||process[_0x48c9('0xd')][0x3]===_0x48c9('0xf')||!process[_0x48c9('0xd')][0x4]||process['argv'][0x4]===_0x48c9('0xe')||process[_0x48c9('0xd')][0x4]===_0x48c9('0xf')){throw new Error(_0x48c9('0x10'));}var FIELDS=_[_0x48c9('0x11')](process[_0x48c9('0xd')][0x3][_0x48c9('0x12')](','),process[_0x48c9('0xd')][0x4]['split'](','));if(!process[_0x48c9('0xd')][0x5]||process[_0x48c9('0xd')][0x5]===_0x48c9('0xe')||process['argv'][0x5]===_0x48c9('0xf')){throw new Error(_0x48c9('0x13'));}var LISTID=process[_0x48c9('0xd')][0x5];var COMPANYID=process[_0x48c9('0xd')][0x6]&&process[_0x48c9('0xd')][0x6]!==_0x48c9('0xe')&&process['argv'][0x6]!=='null'?process[_0x48c9('0xd')][0x6]:null;var DUPLICATES=process[_0x48c9('0xd')][0x7]&&process['argv'][0x7]!=='undefined'&&process['argv'][0x7]!==_0x48c9('0xf')?process[_0x48c9('0xd')][0x7]:null;if(!process[_0x48c9('0xd')][0x8]||process[_0x48c9('0xd')][0x8]===_0x48c9('0xe')||process[_0x48c9('0xd')][0x8]===_0x48c9('0xf')){throw new Error(_0x48c9('0x14'));}var SOCKET_TIMESTAMP=process[_0x48c9('0xd')][0x8];}catch(_0x42f802){logger[_0x48c9('0x15')](_0x42f802);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(_0x35a62a,_0x44f040,_0x2ba929,_0x5ee6e2){var _0x423609={'message':_0x44f040};_0x423609[_0x35a62a]=!![];if(_0x2ba929){_0x423609[_0x48c9('0x16')]=_0x2ba929;}if(_0x5ee6e2){_0x423609['index']=_0x5ee6e2;}return _0x423609;}function isEmail(_0x1e0d7f){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))*$/[_0x48c9('0x17')](_0x1e0d7f);}function checkRow(_0x2e2873,_0x321803,_0x4d6ae7){return new BPromise(function(_0x31bd85,_0x34e4c2){if(_[_0x48c9('0x18')](_0x2e2873)){return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4d6ae7));}if(_0x2e2873[_0x48c9('0x19')]&&_0x2e2873[_0x48c9('0x19')]['length']){var _0x1d6da1=_[_0x48c9('0x1a')](_0x2e2873[_0x48c9('0x19')],_0x48c9('0x1b'))[_0x48c9('0x1c')](';');return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),_0x1d6da1,null,_0x4d6ae7));}var _0x228750={};for(var _0x2755d9 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2755d9)&&FIELDS[_0x2755d9]){_0x228750[_0x2755d9]=_0x2e2873[_0x48c9('0x1d')][0x0][FIELDS[_0x2755d9]]||_0x2e2873[_0x48c9('0x1d')][0x0]['\ufeff'+FIELDS[_0x2755d9]];}}if(!_0x228750[_0x48c9('0x1e')]){return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),_0x48c9('0x1f'),null,_0x4d6ae7));}if(!_0x228750[_0x48c9('0x20')]){return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),'phone\x20not\x20specified!',null,_0x4d6ae7));}if(_0x228750[_0x48c9('0x21')]){var _0x1d27e0=moment(_0x228750[_0x48c9('0x21')],_0x48c9('0x22'));if(!_0x1d27e0[_0x48c9('0x23')]()){return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4d6ae7));}}if(_0x228750[_0x48c9('0x24')]){if(!isEmail(_0x228750[_0x48c9('0x24')])){return _0x34e4c2(handleCheckRowError(_0x48c9('0x15'),_0x48c9('0x25'),null,_0x4d6ae7));}}_0x228750[_0x48c9('0x26')]=LISTID;_0x228750[_0x48c9('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x321803){var _0xa8bb2c={};for(var _0x4a7c11=0x0,_0x33d5a0=DUPLICATES[_0x48c9('0x28')];_0x4a7c11<_0x33d5a0;_0x4a7c11+=0x1){_0xa8bb2c[DUPLICATES[_0x4a7c11]]=_0x228750[DUPLICATES[_0x4a7c11]];}var _0x572d8e=_[_0x48c9('0x29')](_0x321803,_0xa8bb2c);if(_0x572d8e){return _0x34e4c2(handleCheckRowError(_0x48c9('0x2a'),_0x48c9('0x2b'),_0x572d8e,_0x4d6ae7));}}return db['CmContact'][_0x48c9('0x2c')](_0x228750,{'raw':!![],'hooks':![],'fields':_[_0x48c9('0x2d')](_0x228750)})['then'](function(_0x55d1ff){if(DUPLICATES&&DUPLICATES[_0x48c9('0x28')]&&_0x321803){_0x321803[_0x48c9('0x2e')](_[_0x48c9('0x2f')](_0x228750,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x55d1ff['id'];return _0x31bd85();})[_0x48c9('0x30')](function(_0x1eb210){return _0x34e4c2(handleCheckRowError('error',_0x48c9('0x31')+(_0x1eb210[_0x48c9('0x1b')]||JSON[_0x48c9('0x32')](_0x1eb210)),null,_0x4d6ae7));});});}function checkHopper(){function _0x14fcc0(){return function(_0x49699a){logger[_0x48c9('0x15')]('cmContact',_0x48c9('0x33'),util[_0x48c9('0x34')](_0x49699a,{'showHidden':![],'depth':null}));};}var _0x3ebb26=function(_0xe2da2a,_0x12e320){var _0xf8dfcb=squel['insert']()['into'](_0x48c9('0x35'))['fromQuery'](['phone',_0x48c9('0x36'),_0x48c9('0x37'),'ListId',_0x12e320,_0x48c9('0x38'),_0x48c9('0x39')],squel[_0x48c9('0x3a')]()['field'](_0x48c9('0x20'),_0x48c9('0x20'))[_0x48c9('0x3b')]('NOW()','scheduledAt')[_0x48c9('0x3b')]('id',_0x48c9('0x37'))[_0x48c9('0x3b')](LISTID[_0x48c9('0x3c')](),_0x48c9('0x26'))[_0x48c9('0x3b')](_0xe2da2a['id'][_0x48c9('0x3c')](),_0x12e320)[_0x48c9('0x3b')](_0x48c9('0x3d'),_0x48c9('0x38'))[_0x48c9('0x3b')](_0x48c9('0x3d'),'updatedAt')['from'](_0x48c9('0x3e'))[_0x48c9('0x3f')](_0x48c9('0x40'))[_0x48c9('0x3f')]('ListId\x20=\x20?',LISTID[_0x48c9('0x3c')]())[_0x48c9('0x3f')](_0x48c9('0x41'))[_0x48c9('0x3f')](_0x48c9('0x42'),squel['select']()['field'](_0x48c9('0x20'))[_0x48c9('0x43')](_0x48c9('0x35'))[_0x48c9('0x3f')](_0x12e320+'\x20=\x20?',_0xe2da2a['id'][_0x48c9('0x3c')]())))[_0x48c9('0x3c')]();return _0xf8dfcb;};var _0x33b23b=function(_0x305d14,_0x3b5f14){var _0x4893a9=squel[_0x48c9('0x44')]()[_0x48c9('0x45')](_0x48c9('0x35'))['fromQuery']([_0x48c9('0x20'),_0x48c9('0x36'),'ContactId','ListId',_0x3b5f14,_0x48c9('0x38'),_0x48c9('0x39')],squel[_0x48c9('0x3a')]()['field'](_0x48c9('0x20'),_0x48c9('0x20'))[_0x48c9('0x3b')](_0x48c9('0x3d'),'scheduledAt')[_0x48c9('0x3b')]('id',_0x48c9('0x37'))['field'](LISTID['toString'](),_0x48c9('0x26'))['field'](_0x305d14['id'][_0x48c9('0x3c')](),_0x3b5f14)[_0x48c9('0x3b')](_0x48c9('0x3d'),_0x48c9('0x38'))[_0x48c9('0x3b')]('NOW()','updatedAt')[_0x48c9('0x43')]('cm_contacts')[_0x48c9('0x3f')](_0x48c9('0x40'))['where'](_0x48c9('0x46'),LISTID[_0x48c9('0x3c')]())['where'](_0x48c9('0x47'),squel['str'](hopperContacts))[_0x48c9('0x3f')](_0x48c9('0x41'))['where'](_0x48c9('0x42'),squel[_0x48c9('0x3a')]()[_0x48c9('0x3b')](_0x48c9('0x48'))[_0x48c9('0x43')]('cm_hopper_final')[_0x48c9('0x3f')](_0x3b5f14+'\x20=\x20?',_0x305d14['id']['toString']()))[_0x48c9('0x3f')](_0x48c9('0x42'),squel['select']()['field'](_0x48c9('0x20'))[_0x48c9('0x43')](_0x48c9('0x35'))[_0x48c9('0x3f')](_0x3b5f14+_0x48c9('0x49'),_0x305d14['id'][_0x48c9('0x3c')]())))[_0x48c9('0x3c')]();return _0x4893a9;};function _0x4c532c(_0x495e36,_0x4ba120){var _0x351f37=squel['insert']()['into'](_0x48c9('0x35'))['fromQuery'](['phone','scheduledAt',_0x48c9('0x37'),_0x48c9('0x26'),_0x4ba120,_0x48c9('0x38'),_0x48c9('0x39')],squel['select']()['field'](_0x48c9('0x20'),_0x48c9('0x20'))[_0x48c9('0x3b')](_0x48c9('0x3d'),'scheduledAt')['field']('id',_0x48c9('0x37'))['field'](LISTID[_0x48c9('0x3c')](),_0x48c9('0x26'))[_0x48c9('0x3b')](_0x495e36['id'][_0x48c9('0x3c')](),_0x4ba120)['field'](_0x48c9('0x3d'),'createdAt')[_0x48c9('0x3b')](_0x48c9('0x3d'),_0x48c9('0x39'))[_0x48c9('0x43')](_0x48c9('0x3e'))['where'](_0x48c9('0x40'))['where'](_0x48c9('0x46'),LISTID['toString']())[_0x48c9('0x3f')](_0x48c9('0x47'),squel[_0x48c9('0x4a')](hopperContacts))[_0x48c9('0x3f')](_0x48c9('0x41')))['toString']();return _0x351f37;}function _0x1e25e7(_0x131885,_0x1e384f){var _0x4c253b=squel[_0x48c9('0x44')]()[_0x48c9('0x45')](_0x48c9('0x4b'))[_0x48c9('0x4c')]([_0x48c9('0x20'),_0x48c9('0x37'),_0x48c9('0x26'),_0x1e384f,'createdAt',_0x48c9('0x39')],squel[_0x48c9('0x3a')]()[_0x48c9('0x3b')](_0x48c9('0x20'),'phone')['field']('id','ContactId')[_0x48c9('0x3b')](LISTID[_0x48c9('0x3c')](),_0x48c9('0x26'))[_0x48c9('0x3b')](_0x131885['id'][_0x48c9('0x3c')](),_0x1e384f)[_0x48c9('0x3b')](_0x48c9('0x3d'),_0x48c9('0x38'))[_0x48c9('0x3b')]('NOW()',_0x48c9('0x39'))[_0x48c9('0x43')](_0x48c9('0x3e'))[_0x48c9('0x3f')]('deletedAt\x20IS\x20NULL')[_0x48c9('0x3f')](_0x48c9('0x46'),LISTID['toString']())[_0x48c9('0x3f')](_0x48c9('0x47'),squel[_0x48c9('0x4a')](hopperContacts))[_0x48c9('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x48c9('0x3c')]();return _0x4c253b;}return db[_0x48c9('0x4d')][_0x48c9('0x4e')]({'where':{'type':_0x48c9('0x4f')},'attributes':['id',_0x48c9('0x50')],'include':[{'model':db[_0x48c9('0x51')],'as':_0x48c9('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x3bae2f){var _0x7f8c42=[];if(_0x3bae2f){var _0x355bf5;for(var _0x5e0f75=0x0,_0x121a8c;_0x5e0f75<_0x3bae2f['length'];_0x5e0f75+=0x1){_0x121a8c=_0x3bae2f[_0x5e0f75]['get']({'plain':!![]});switch(_0x121a8c[_0x48c9('0x50')]){case _0x48c9('0x53'):_0x7f8c42[_0x48c9('0x2e')](db[_0x48c9('0x54')]['query'](_0x33b23b(_0x121a8c,_0x48c9('0x55')))[_0x48c9('0x56')](function(){})[_0x48c9('0x30')](_0x14fcc0()));break;case _0x48c9('0x57'):_0x7f8c42[_0x48c9('0x2e')](db[_0x48c9('0x54')]['query'](_0x3ebb26(_0x121a8c,_0x48c9('0x55')))['then'](function(){})[_0x48c9('0x30')](_0x14fcc0()));break;default:_0x7f8c42['push'](db[_0x48c9('0x54')][_0x48c9('0x58')](_0x4c532c(_0x121a8c,_0x48c9('0x55')))[_0x48c9('0x56')](function(){})[_0x48c9('0x30')](_0x14fcc0()));}}}return _0x7f8c42;})[_0x48c9('0x59')]()['then'](function(){return db[_0x48c9('0x4d')][_0x48c9('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x48c9('0x5a'),'where':{'id':LISTID}}]})[_0x48c9('0x56')](function(_0x508020){var _0x1a41be=[];if(_0x508020){var _0x250ed9;for(var _0x2642fd=0x0,_0x5da371;_0x2642fd<_0x508020[_0x48c9('0x28')];_0x2642fd+=0x1){_0x5da371=_0x508020[_0x2642fd]['get']({'plain':!![]});_0x1a41be[_0x48c9('0x2e')](db[_0x48c9('0x54')][_0x48c9('0x58')](_0x1e25e7(_0x5da371,_0x48c9('0x55')))[_0x48c9('0x56')](function(){})[_0x48c9('0x30')](_0x14fcc0()));}}return _0x1a41be;})[_0x48c9('0x59')]();})[_0x48c9('0x56')](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x48c9('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x48c9('0x56')](function(_0x6fdb30){var _0x13cb53=[];if(_0x6fdb30){for(var _0x141435=0x0,_0x40f5d1;_0x141435<_0x6fdb30['length'];_0x141435+=0x1){_0x40f5d1=_0x6fdb30[_0x141435][_0x48c9('0x5b')]({'plain':!![]});switch(_0x40f5d1[_0x48c9('0x50')]){case'always':_0x13cb53[_0x48c9('0x2e')](db['sequelize'][_0x48c9('0x58')](_0x33b23b(_0x40f5d1,_0x48c9('0x5c')))['then'](function(){})['catch'](_0x14fcc0()));break;case _0x48c9('0x57'):_0x13cb53['push'](db['sequelize'][_0x48c9('0x58')](_0x3ebb26(_0x40f5d1,_0x48c9('0x5c')))['then'](function(){})[_0x48c9('0x30')](_0x14fcc0()));break;default:_0x13cb53['push'](db[_0x48c9('0x54')][_0x48c9('0x58')](_0x4c532c(_0x40f5d1,_0x48c9('0x5c')))['then'](function(){})[_0x48c9('0x30')](_0x14fcc0()));}}}return _0x13cb53;})[_0x48c9('0x59')]();})[_0x48c9('0x56')](function(){return db[_0x48c9('0x5d')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x48c9('0x51')],'as':_0x48c9('0x5a'),'where':{'id':LISTID}}]})[_0x48c9('0x56')](function(_0x31396f){var _0x1caadf=[];if(_0x31396f){for(var _0x137a9a=0x0,_0x2e3088;_0x137a9a<_0x31396f[_0x48c9('0x28')];_0x137a9a+=0x1){_0x2e3088=_0x31396f[_0x137a9a][_0x48c9('0x5b')]({'plain':!![]});_0x1caadf['push'](db[_0x48c9('0x54')][_0x48c9('0x58')](_0x1e25e7(_0x2e3088,_0x48c9('0x5c')))[_0x48c9('0x56')](function(){})[_0x48c9('0x30')](_0x14fcc0()));}}return _0x1caadf;})[_0x48c9('0x59')]();})[_0x48c9('0x30')](function(_0x122ef2){logger[_0x48c9('0x15')](_0x48c9('0x5e'),_0x48c9('0x5f'),_0x122ef2[_0x48c9('0x1b')]);});}var processPromises=function(_0x43f3e1){return BPromise[_0x48c9('0x59')](promises)['then'](function(_0x4a605c){})[_0x48c9('0x30')](function(_0x3626fa){logger['error'](_0x48c9('0x60'),JSON[_0x48c9('0x32')](_0x3626fa));})[_0x48c9('0x61')](function(){socket[_0x48c9('0x62')](_0x48c9('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x43f3e1){return _0x43f3e1[_0x48c9('0x64')]();}});};var endCsv=function(){return BPromise[_0x48c9('0x65')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x48c9('0x56')](function(){socket[_0x48c9('0x62')](_0x48c9('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x48c9('0x66')](FILEPATH);}catch(_0x1ded54){logger['error'](_0x48c9('0x67'),JSON['stringify'](_0x1ded54));}finally{process[_0x48c9('0x68')](0x0);}});};process['on'](_0x48c9('0x69'),function(){logger[_0x48c9('0x6a')](_0x48c9('0x6b'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x48c9('0x12')](',');return db[_0x48c9('0x6c')][_0x48c9('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x48c9('0x56')](function(_0x38a696){var _0x1dc39b=fs[_0x48c9('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x48c9('0x6e')](_0x1dc39b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x27d90b,_0xb0563a){total+=0x1;var _0x1cc503=total;promises[_0x48c9('0x2e')](checkRow(_0x27d90b,_0x38a696,_0x1cc503)[_0x48c9('0x56')](function(){success+=0x1;})[_0x48c9('0x30')](function(_0x1993de){if(_0x1993de[_0x48c9('0x15')]){errors+=0x1;delete _0x1993de[_0x48c9('0x15')];}else if(_0x1993de[_0x48c9('0x2a')]){duplicates+=0x1;delete _0x1993de['duplicate'];}rows[_0x48c9('0x2e')](_0x1993de);}));if(total%0xc8===0x0){_0xb0563a['pause']();return processPromises(_0xb0563a);}},'complete':function(){return processPromises()[_0x48c9('0x56')](function(){logger[_0x48c9('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5c79cf,_0x420f85){logger[_0x48c9('0x6a')](_0x48c9('0x6f'),JSON[_0x48c9('0x32')](_0x5c79cf));endCsv();}});})['catch'](function(_0x556389){logger[_0x48c9('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x48c9('0x32')](_0x556389));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1d035d6..8bf7c49 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 _0xf6ea=['data','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','push','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','each','affectedRows','unlink','exit','complete','argv','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','join','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','from','cm_contacts','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.id','into','cm_hopper_black','cm_contacts.ListId\x20=\x20','.CmListId','field','ListId\x20=\x20?','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','toString','info','Received\x20SIGINT','error','message','query','catch','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','errors'];(function(_0x4a9e5f,_0x528064){var _0x4d3596=function(_0xd80108){while(--_0xd80108){_0x4a9e5f['push'](_0x4a9e5f['shift']());}};_0x4d3596(++_0x528064);}(_0xf6ea,0x1ab));var _0xaf6e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf6ea[_0x21a9d9];return _0x46adce;};'use strict';var fs=require('fs');var path=require(_0xaf6e('0x0'));var _=require('lodash');var Papa=require(_0xaf6e('0x1'));var util=require(_0xaf6e('0x2'));var BPromise=require('bluebird');var moment=require(_0xaf6e('0x3'));var squel=require('squel');var Redis=require(_0xaf6e('0x4'));var db=require(_0xaf6e('0x5'))['db'];var config=require(_0xaf6e('0x6'));var logger=require(_0xaf6e('0x7'))(_0xaf6e('0x8'));config[_0xaf6e('0x9')]=_[_0xaf6e('0xa')](config[_0xaf6e('0x9')],{'host':_0xaf6e('0xb'),'port':0x18eb});var socket=require(_0xaf6e('0xc'))(new Redis(config[_0xaf6e('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xaf6e('0xd')](_0xaf6e('0xe'));function isEmail(_0x5b4dc8){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))*$/[_0xaf6e('0xf')](_0x5b4dc8);}function selectNotIn(_0x20e021,_0x5828f1,_0x220847,_0x35cdd8,_0x229ab8){return squel[_0xaf6e('0x10')]()['field']('phone')['from'](_0x35cdd8)[_0xaf6e('0x11')](_0x5828f1,null,_0x5828f1+'.id\x20=\x20'+_0x35cdd8+'.'+_0x220847)['where'](_0x35cdd8+'.'+_0x220847+_0xaf6e('0x12')+_0x20e021+'.'+_0x220847)['where'](_0x5828f1+_0xaf6e('0x13')+_0x229ab8[_0xaf6e('0x11')]()+')');}function insertCmHopper(_0x3bf6ab,_0x315b5d,_0x20eb57,_0x1b801a,_0x32d623){var _0x3c1735=[_0xaf6e('0x14'),_0xaf6e('0x15'),'cm_contacts.id',_0xaf6e('0x16'),_0x315b5d+'.'+_0x1b801a,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xaf6e('0x17'),_0xaf6e('0x18'),'\x22'+_0x32d623+'\x22'];return squel[_0xaf6e('0x19')]()['into'](_0xaf6e('0x1a'))[_0xaf6e('0x1b')]([_0xaf6e('0x1c'),_0xaf6e('0x1d'),_0xaf6e('0x1e'),_0xaf6e('0x1f'),_0x1b801a,_0xaf6e('0x20'),_0xaf6e('0x21'),_0xaf6e('0x22'),'UserId',_0xaf6e('0x23')],squel[_0xaf6e('0x10')]()[_0xaf6e('0x24')](_0x3c1735)[_0xaf6e('0x25')](_0x315b5d)[_0xaf6e('0x11')](_0xaf6e('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x315b5d+'.CmListId')[_0xaf6e('0x11')](_0x20eb57,null,_0x20eb57+_0xaf6e('0x27')+_0x315b5d+'.'+_0x1b801a)[_0xaf6e('0x28')](_0x315b5d+_0xaf6e('0x29'),_0x3bf6ab)['where'](_0xaf6e('0x2a'),NOW)[_0xaf6e('0x28')](_0xaf6e('0x2b'),selectNotIn(_0x315b5d,_0x20eb57,_0x1b801a,_0xaf6e('0x1a'),[_0xaf6e('0x2c'),'\x22onlyIfOpen\x22']))[_0xaf6e('0x28')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x315b5d,_0x20eb57,_0x1b801a,'cm_hopper',[_0xaf6e('0x2c')])))['toString']();}function insertCmHopperBlack(_0x40ac79,_0x54ec9b,_0x38a04a,_0x280551){var _0x25b5d8=[_0xaf6e('0x14'),_0xaf6e('0x2d'),_0xaf6e('0x16'),_0x54ec9b+'.'+_0x280551,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xaf6e('0x2e')](_0xaf6e('0x2f'))[_0xaf6e('0x1b')](['phone',_0xaf6e('0x1e'),'ListId',_0x280551,_0xaf6e('0x20'),_0xaf6e('0x21')],squel[_0xaf6e('0x10')]()[_0xaf6e('0x24')](_0x25b5d8)[_0xaf6e('0x25')](_0x54ec9b)[_0xaf6e('0x11')](_0xaf6e('0x26'),null,_0xaf6e('0x30')+_0x54ec9b+_0xaf6e('0x31'))['join'](_0x38a04a,null,_0x38a04a+_0xaf6e('0x27')+_0x54ec9b+'.'+_0x280551)[_0xaf6e('0x28')](_0x54ec9b+_0xaf6e('0x29'),_0x40ac79)[_0xaf6e('0x28')](_0xaf6e('0x2a'),NOW)[_0xaf6e('0x28')](_0xaf6e('0x2b'),squel[_0xaf6e('0x10')]()[_0xaf6e('0x32')](_0xaf6e('0x1c'))[_0xaf6e('0x25')](_0xaf6e('0x2f'))[_0xaf6e('0x28')](_0xaf6e('0x33'),_0x40ac79)['where'](_0x280551+'\x20=\x20?',_0x54ec9b+'.'+_0x280551)))['toString']();}function insertCmContact(_0x11f3f2,_0x287828,_0x1710ce,_0x412b1b){var _0x4f840d=_['concat'](_[_0xaf6e('0x34')](_0x412b1b),[_0xaf6e('0x1f'),_0xaf6e('0x35'),_0xaf6e('0x20'),_0xaf6e('0x21')]);return squel[_0xaf6e('0x19')]()[_0xaf6e('0x2e')](_0xaf6e('0x26'))[_0xaf6e('0x1b')](_0x4f840d,squel[_0xaf6e('0x10')]()[_0xaf6e('0x24')](_0x4f840d)[_0xaf6e('0x25')](_0x287828)[_0xaf6e('0x28')]('('+_0x1710ce['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xaf6e('0x10')]()[_0xaf6e('0x24')](_0x1710ce)[_0xaf6e('0x25')](_0xaf6e('0x26'))[_0xaf6e('0x28')](_0xaf6e('0x33'),_0x11f3f2)[_0xaf6e('0x28')](_0xaf6e('0x36')))[_0xaf6e('0x28')](_0xaf6e('0x37'),squel[_0xaf6e('0x10')]()['field'](_0xaf6e('0x38'),_0xaf6e('0x39'))[_0xaf6e('0x25')](_0x287828)[_0xaf6e('0x3a')](_0x1710ce[_0xaf6e('0x11')](','))))[_0xaf6e('0x3b')]();}function handleStop(){logger[_0xaf6e('0x3c')](_0xaf6e('0x3d'));stopped=!![];}function handleUncaughtException(_0x283055){logger[_0xaf6e('0x3e')](_0x283055[_0xaf6e('0x3f')]);process['exit'](0x1);}function handleError(_0x3f9d51,_0x478189){stats['errors']['push']({'name':_0x478189['code'],'message':_0x478189[_0xaf6e('0x3f')],'row':_0x3f9d51});}function handleQuery(_0x4a773c){logger[_0xaf6e('0x3c')](_0x4a773c);return db['sequelize'][_0xaf6e('0x40')](_0x4a773c)['spread'](function(_0x1e00c4){results['push'](_0x1e00c4);})[_0xaf6e('0x41')](function(_0x3002be){logger[_0xaf6e('0x3e')](_0x3002be[_0xaf6e('0x3f')]);});}function main(_0x3f7b53,_0x73c762,_0x50a60b,_0x22acc1){logger[_0xaf6e('0x3c')]('main',_0x3f7b53,JSON[_0xaf6e('0x42')](_0x73c762));process[_0xaf6e('0x43')](_0xaf6e('0x44'));var _0x45a69b=_0x73c762[_0xaf6e('0x45')];var _0x1f5668=_0x73c762[_0xaf6e('0x46')];var _0x57279d=path[_0xaf6e('0x11')](config[_0xaf6e('0x47')],_0xaf6e('0x48'),_0x1f5668+_0xaf6e('0x49'));var _0x5e94e0=_['keys'](_0x45a69b)[_0xaf6e('0x11')]();logger[_0xaf6e('0x3c')](_0xaf6e('0x4a'),_0x5e94e0);fs[_0xaf6e('0x4b')](_0x57279d,_0x5e94e0+'\x0a');Papa[_0xaf6e('0x4c')](fs[_0xaf6e('0x4d')](_0x3f7b53),{'header':!![],'skipEmptyLines':!![],'step':function(_0x12aab0,_0x43014c){try{for(var _0x2d11e9=0x0,_0x10d496=[];_0x2d11e9<_0x12aab0['data'][_0xaf6e('0x4e')];_0x2d11e9++){stats[_0xaf6e('0x4f')]+=0x1;if(_0x12aab0[_0xaf6e('0x50')][_0x2d11e9]){handleError(_0x12aab0[_0xaf6e('0x51')][_0x2d11e9],_0x12aab0[_0xaf6e('0x50')][_0x2d11e9]);}else{var _0x5bac17=[];for(var _0x5c75d8 in _0x45a69b){if(_0x45a69b['hasOwnProperty'](_0x5c75d8)){if(_0x12aab0['data'][_0x2d11e9][_0x45a69b[_0x5c75d8]]){var _0x2c9069=_['trim'](_0x12aab0[_0xaf6e('0x51')][_0x2d11e9][_0x45a69b[_0x5c75d8]][_0xaf6e('0x52')](/"/g,'\x27'));switch(_0x5c75d8){case'scheduledat':var _0x2fb997=moment(_0x2c9069,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2fb997[_0xaf6e('0x53')]()){_0x10d496['push']('\x22'+_0x2c9069+'\x22');}else{_0x5bac17['push'](_0xaf6e('0x54'));}break;case _0xaf6e('0x22'):var _0xaf9b35=parseInt(_0x2c9069);_0x2c9069=_[_0xaf6e('0x55')](_0xaf9b35)||_0xaf9b35<0x0||_0xaf9b35>0x4?_0x22acc1?0x3:0x2:_0xaf9b35;_0x10d496['push']('\x22'+_0x2c9069+'\x22');break;case _0xaf6e('0x56'):var _0x1e8e2e=parseInt(_0x2c9069);if(_['isNumber'](_0x1e8e2e)&&_['includes'](_0x50a60b,_0x1e8e2e)){_0x10d496[_0xaf6e('0x57')]('\x22'+_0x1e8e2e+'\x22');}else{_0x5bac17[_0xaf6e('0x57')](_0xaf6e('0x58'));}break;case'email':if(isEmail(_0x2c9069)){_0x10d496[_0xaf6e('0x57')]('\x22'+_0x2c9069+'\x22');}else{_0x5bac17['push'](_0xaf6e('0x59'));}break;case _0xaf6e('0x5a'):var _0x1d2a0b=moment(_0x2c9069,_0xaf6e('0x5b'),!![]);if(_0x1d2a0b[_0xaf6e('0x53')]()){_0x10d496[_0xaf6e('0x57')]('\x22'+_0x2c9069+'\x22');}else{_0x5bac17[_0xaf6e('0x57')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x10d496['push']('\x22'+_0x2c9069+'\x22');}}else{switch(_0x5c75d8){case _0xaf6e('0x5c'):case _0xaf6e('0x1c'):_0x5bac17[_0xaf6e('0x57')](_0x5c75d8+_0xaf6e('0x5d'));break;default:_0x10d496[_0xaf6e('0x57')]('\x22\x22');}}}}if(_0x5bac17[_0xaf6e('0x4e')]){handleError(_0x12aab0[_0xaf6e('0x51')][_0x2d11e9],{'code':_0xaf6e('0x5e'),'message':_0x5bac17[_0xaf6e('0x11')]()});}else{fs[_0xaf6e('0x5f')](_0x57279d,_0x10d496[_0xaf6e('0x11')]()+'\x0a');}_0x10d496=[];}if(!(stats[_0xaf6e('0x4f')]%0xc8)){socket[_0xaf6e('0x60')](_0xaf6e('0x61')+_0x1f5668,stats);stats[_0xaf6e('0x50')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x43014c[_0xaf6e('0x62')]();}}catch(_0x3840e2){handleError(_0x12aab0[_0xaf6e('0x51')][_0x2d11e9],{'code':_0xaf6e('0x63'),'message':_0x3840e2[_0xaf6e('0x3f')]});logger[_0xaf6e('0x3e')](_0xaf6e('0x64'),_0x3840e2['message']);}},'complete':function(){try{var _0x14c53a=[];var _0x169348=_0xaf6e('0x26');if(_0x73c762[_0xaf6e('0x65')]&&_0x73c762[_0xaf6e('0x65')]['length']){_0x169348=_0xaf6e('0x66')+_0x1f5668;_0x14c53a[_0xaf6e('0x57')]('CREATE\x20TABLE\x20'+_0x169348+_0xaf6e('0x67'));}var _0x272abb=util[_0xaf6e('0xd')]('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',_0x57279d,_0x169348,_0x5e94e0,_0x73c762[_0xaf6e('0x1f')],_0x73c762[_0xaf6e('0x35')]||null,NOW,NOW);if(_[_0xaf6e('0x68')](_0x45a69b[_0xaf6e('0x1d')])){_0x272abb+=_0xaf6e('0x69');}_0x14c53a['push'](_0x272abb);if(_0x73c762[_0xaf6e('0x65')]&&_0x73c762[_0xaf6e('0x65')]['length']){_0x14c53a[_0xaf6e('0x57')](insertCmContact(_0x73c762[_0xaf6e('0x1f')],_0x169348,_0x73c762[_0xaf6e('0x65')],_0x45a69b));_0x14c53a[_0xaf6e('0x57')](_0xaf6e('0x6a')+_0x169348+';');}_0x14c53a[_0xaf6e('0x57')](insertCmHopper(_0x73c762[_0xaf6e('0x1f')],_0xaf6e('0x6b'),'voice_queues',_0xaf6e('0x6c'),_0x22acc1));_0x14c53a['push'](insertCmHopperBlack(_0x73c762[_0xaf6e('0x1f')],_0xaf6e('0x6d'),_0xaf6e('0x6e'),'VoiceQueueId'));_0x14c53a[_0xaf6e('0x57')](insertCmHopper(_0x73c762[_0xaf6e('0x1f')],_0xaf6e('0x6f'),'campaigns','CampaignId',_0x22acc1));_0x14c53a[_0xaf6e('0x57')](insertCmHopperBlack(_0x73c762[_0xaf6e('0x1f')],_0xaf6e('0x70'),'campaigns',_0xaf6e('0x71')));BPromise[_0xaf6e('0x72')](_0x14c53a,handleQuery)['then'](function(_0x19300f){stats['finish']=!![];stats[_0xaf6e('0x73')]=_0x73c762[_0xaf6e('0x65')]&&_0x73c762[_0xaf6e('0x65')][_0xaf6e('0x4e')]?results[0x2][_0xaf6e('0x73')]:results[0x0]['affectedRows'];socket[_0xaf6e('0x60')](_0xaf6e('0x61')+_0x1f5668,stats);fs['unlink'](_0x3f7b53);fs[_0xaf6e('0x74')](_0x57279d);process[_0xaf6e('0x75')](0x0);})[_0xaf6e('0x41')](function(_0x2b4ea1){logger[_0xaf6e('0x3e')](_0x2b4ea1[_0xaf6e('0x3f')]);process[_0xaf6e('0x75')](0x1);});}catch(_0x35fda6){logger[_0xaf6e('0x3e')](_0xaf6e('0x76'),_0x35fda6[_0xaf6e('0x3f')]);process['exit'](0x1);}},'error':function(_0x11ac60,_0x53d1a8,_0x3b456b,_0x1e633a){throw new Error(_0x1e633a);}});}function validate(){if(process['argv']&&process[_0xaf6e('0x77')][_0xaf6e('0x4e')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x2a9f8d=path[_0xaf6e('0x11')](config['root'],'server/files/tmp',process[_0xaf6e('0x77')][0x2]);if(!fs[_0xaf6e('0x78')](_0x2a9f8d)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x237489={};try{_0x237489=JSON[_0xaf6e('0x4c')](process['argv'][0x3]);if(!_0x237489[_0xaf6e('0x45')]){throw new Error(_0xaf6e('0x79'));}if(!_0x237489[_0xaf6e('0x45')][_0xaf6e('0x1c')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x237489[_0xaf6e('0x45')][_0xaf6e('0x5c')]){throw new Error(_0xaf6e('0x7a'));}var _0x5c70b7=0x0;if(_0x237489['binding'][_0xaf6e('0x56')]){_0x5c70b7=0x1;}if(!_0x237489[_0xaf6e('0x1f')]){throw new Error(_0xaf6e('0x7b'));}}catch(_0x2dc305){throw new Error(_0xaf6e('0x7c'));}var _0x281c97=[];try{_0x281c97=_['map'](JSON['parse'](process[_0xaf6e('0x77')][0x4]),'id');}catch(_0x4f5bdf){logger['info'](_0xaf6e('0x7d'));}main(_0x2a9f8d,_0x237489,_0x281c97,_0x5c70b7);}validate();process['on'](_0xaf6e('0x7e'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x9247=['existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','query','push','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','length','rows','data','hasOwnProperty','trim','replace','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','cm_contacts_','CREATE\x20TABLE\x20','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20'];(function(_0x52e716,_0x48170f){var _0x1fdc6b=function(_0x2d3738){while(--_0x2d3738){_0x52e716['push'](_0x52e716['shift']());}};_0x1fdc6b(++_0x48170f);}(_0x9247,0x11d));var _0x7924=function(_0x44f4c5,_0x60cd8b){_0x44f4c5=_0x44f4c5-0x0;var _0x35cf6a=_0x9247[_0x44f4c5];return _0x35cf6a;};'use strict';var fs=require('fs');var path=require(_0x7924('0x0'));var _=require(_0x7924('0x1'));var Papa=require(_0x7924('0x2'));var util=require('util');var BPromise=require(_0x7924('0x3'));var moment=require(_0x7924('0x4'));var squel=require(_0x7924('0x5'));var Redis=require('ioredis');var db=require(_0x7924('0x6'))['db'];var config=require(_0x7924('0x7'));var logger=require(_0x7924('0x8'))(_0x7924('0x9'));config['redis']=_['defaults'](config[_0x7924('0xa')],{'host':_0x7924('0xb'),'port':0x18eb});var socket=require(_0x7924('0xc'))(new Redis(config[_0x7924('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x7924('0xd'));function isEmail(_0x103bc9){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))*$/[_0x7924('0xe')](_0x103bc9);}function selectNotIn(_0x48e526,_0x18d66f,_0x1c7ad7,_0x329ad1,_0x324f6a){return squel[_0x7924('0xf')]()[_0x7924('0x10')]('phone')[_0x7924('0x11')](_0x329ad1)['join'](_0x18d66f,null,_0x18d66f+_0x7924('0x12')+_0x329ad1+'.'+_0x1c7ad7)[_0x7924('0x13')](_0x329ad1+'.'+_0x1c7ad7+_0x7924('0x14')+_0x48e526+'.'+_0x1c7ad7)[_0x7924('0x13')](_0x18d66f+_0x7924('0x15')+_0x324f6a[_0x7924('0x16')]()+')');}function insertCmHopper(_0x50016d,_0x378320,_0x10d4ce,_0x5d152d,_0x2de2b1){var _0xcf4ed6=[_0x7924('0x17'),_0x7924('0x18'),_0x7924('0x19'),_0x7924('0x1a'),_0x378320+'.'+_0x5d152d,_0x7924('0x1b'),_0x7924('0x1c'),'cm_contacts.priority',_0x7924('0x1d'),'\x22'+_0x2de2b1+'\x22'];return squel[_0x7924('0x1e')]()[_0x7924('0x1f')](_0x7924('0x20'))[_0x7924('0x21')]([_0x7924('0x22'),'scheduledat',_0x7924('0x23'),_0x7924('0x24'),_0x5d152d,_0x7924('0x25'),_0x7924('0x26'),_0x7924('0x27'),'UserId',_0x7924('0x28')],squel[_0x7924('0xf')]()[_0x7924('0x29')](_0xcf4ed6)[_0x7924('0x11')](_0x378320)[_0x7924('0x16')](_0x7924('0x2a'),null,'cm_contacts.ListId\x20=\x20'+_0x378320+_0x7924('0x2b'))[_0x7924('0x16')](_0x10d4ce,null,_0x10d4ce+_0x7924('0x12')+_0x378320+'.'+_0x5d152d)[_0x7924('0x13')](_0x378320+_0x7924('0x2c'),_0x50016d)[_0x7924('0x13')](_0x7924('0x2d'),NOW)['where'](_0x7924('0x2e'),selectNotIn(_0x378320,_0x10d4ce,_0x5d152d,_0x7924('0x20'),[_0x7924('0x2f'),_0x7924('0x30')]))[_0x7924('0x13')](_0x7924('0x2e'),selectNotIn(_0x378320,_0x10d4ce,_0x5d152d,'cm_hopper',['\x22always\x22'])))[_0x7924('0x31')]();}function insertCmHopperBlack(_0x383ebc,_0x2ba152,_0x412c59,_0x32dc01){var _0x244a96=[_0x7924('0x17'),_0x7924('0x19'),'cm_contacts.ListId',_0x2ba152+'.'+_0x32dc01,_0x7924('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7924('0x1e')]()[_0x7924('0x1f')](_0x7924('0x32'))[_0x7924('0x21')]([_0x7924('0x22'),_0x7924('0x23'),_0x7924('0x24'),_0x32dc01,_0x7924('0x25'),_0x7924('0x26')],squel[_0x7924('0xf')]()['fields'](_0x244a96)['from'](_0x2ba152)[_0x7924('0x16')]('cm_contacts',null,_0x7924('0x33')+_0x2ba152+_0x7924('0x2b'))[_0x7924('0x16')](_0x412c59,null,_0x412c59+_0x7924('0x12')+_0x2ba152+'.'+_0x32dc01)[_0x7924('0x13')](_0x2ba152+_0x7924('0x2c'),_0x383ebc)[_0x7924('0x13')](_0x7924('0x2d'),NOW)[_0x7924('0x13')](_0x7924('0x2e'),squel[_0x7924('0xf')]()[_0x7924('0x10')](_0x7924('0x22'))[_0x7924('0x11')](_0x7924('0x32'))['where'](_0x7924('0x34'),_0x383ebc)[_0x7924('0x13')](_0x32dc01+_0x7924('0x35'),_0x2ba152+'.'+_0x32dc01)))[_0x7924('0x31')]();}function insertCmContact(_0x3ae35d,_0x1cf9db,_0x12e361,_0x16fcff){var _0x1297b1=_[_0x7924('0x36')](_[_0x7924('0x37')](_0x16fcff),[_0x7924('0x24'),'CompanyId',_0x7924('0x25'),_0x7924('0x26')]);return squel[_0x7924('0x1e')]()[_0x7924('0x1f')](_0x7924('0x2a'))[_0x7924('0x21')](_0x1297b1,squel[_0x7924('0xf')]()['fields'](_0x1297b1)[_0x7924('0x11')](_0x1cf9db)['where']('('+_0x12e361[_0x7924('0x16')](',')+_0x7924('0x38'),squel['select']()[_0x7924('0x29')](_0x12e361)[_0x7924('0x11')](_0x7924('0x2a'))[_0x7924('0x13')](_0x7924('0x34'),_0x3ae35d)[_0x7924('0x13')](_0x7924('0x39')))['where'](_0x7924('0x3a'),squel[_0x7924('0xf')]()[_0x7924('0x10')](_0x7924('0x3b'),_0x7924('0x3c'))['from'](_0x1cf9db)[_0x7924('0x3d')](_0x12e361[_0x7924('0x16')](','))))[_0x7924('0x31')]();}function handleStop(){logger[_0x7924('0x3e')](_0x7924('0x3f'));stopped=!![];}function handleUncaughtException(_0x5714d3){logger[_0x7924('0x40')](_0x5714d3[_0x7924('0x41')]);process[_0x7924('0x42')](0x1);}function handleError(_0x49d5dd,_0x20fe5a){stats[_0x7924('0x43')]['push']({'name':_0x20fe5a[_0x7924('0x44')],'message':_0x20fe5a[_0x7924('0x41')],'row':_0x49d5dd});}function handleQuery(_0x391e0c){logger[_0x7924('0x3e')](_0x391e0c);return db['sequelize'][_0x7924('0x45')](_0x391e0c)['spread'](function(_0x504542){results[_0x7924('0x46')](_0x504542);})[_0x7924('0x47')](function(_0x25ad35){logger[_0x7924('0x40')](_0x25ad35[_0x7924('0x41')]);});}function main(_0x330989,_0x47c20e,_0x52f779,_0xd44eb7){logger[_0x7924('0x3e')](_0x7924('0x48'),_0x330989,JSON[_0x7924('0x49')](_0x47c20e));process[_0x7924('0x4a')]('start');var _0xa5ceb2=_0x47c20e[_0x7924('0x4b')];var _0x34afb5=_0x47c20e[_0x7924('0x4c')];var _0x2ba17d=path['join'](config[_0x7924('0x4d')],_0x7924('0x4e'),_0x34afb5+_0x7924('0x4f'));var _0x5c8cb5=_[_0x7924('0x37')](_0xa5ceb2)['join']();logger[_0x7924('0x3e')](_0x7924('0x50'),_0x5c8cb5);fs[_0x7924('0x51')](_0x2ba17d,_0x5c8cb5+'\x0a');Papa[_0x7924('0x52')](fs['createReadStream'](_0x330989),{'header':!![],'skipEmptyLines':!![],'step':function(_0x229430,_0x52064f){try{for(var _0x4948ea=0x0,_0x501091=[];_0x4948ea<_0x229430['data'][_0x7924('0x53')];_0x4948ea++){stats[_0x7924('0x54')]+=0x1;if(_0x229430[_0x7924('0x43')][_0x4948ea]){handleError(_0x229430[_0x7924('0x55')][_0x4948ea],_0x229430[_0x7924('0x43')][_0x4948ea]);}else{var _0x47aa68=[];for(var _0xc32ed0 in _0xa5ceb2){if(_0xa5ceb2[_0x7924('0x56')](_0xc32ed0)){if(_0x229430[_0x7924('0x55')][_0x4948ea][_0xa5ceb2[_0xc32ed0]]){var _0x36b0d7=_[_0x7924('0x57')](_0x229430[_0x7924('0x55')][_0x4948ea][_0xa5ceb2[_0xc32ed0]][_0x7924('0x58')](/"/g,'\x27'));switch(_0xc32ed0){case _0x7924('0x59'):var _0x5602af=moment(_0x36b0d7,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5602af['isValid']()){_0x501091[_0x7924('0x46')]('\x22'+_0x36b0d7+'\x22');}else{_0x47aa68[_0x7924('0x46')](_0x7924('0x5a'));}break;case _0x7924('0x27'):var _0x5d1685=parseInt(_0x36b0d7);_0x36b0d7=_[_0x7924('0x5b')](_0x5d1685)||_0x5d1685<0x0||_0x5d1685>0x4?_0xd44eb7?0x3:0x2:_0x5d1685;_0x501091[_0x7924('0x46')]('\x22'+_0x36b0d7+'\x22');break;case _0x7924('0x5c'):var _0x4a53a0=parseInt(_0x36b0d7);if(_['isNumber'](_0x4a53a0)&&_['includes'](_0x52f779,_0x4a53a0)){_0x501091[_0x7924('0x46')]('\x22'+_0x4a53a0+'\x22');}else{_0x47aa68[_0x7924('0x46')]('agent\x20not\x20exists');}break;case _0x7924('0x5d'):if(isEmail(_0x36b0d7)){_0x501091[_0x7924('0x46')]('\x22'+_0x36b0d7+'\x22');}else{_0x47aa68[_0x7924('0x46')](_0x7924('0x5e'));}break;case _0x7924('0x5f'):var _0x113bfe=moment(_0x36b0d7,_0x7924('0x60'),!![]);if(_0x113bfe[_0x7924('0x61')]()){_0x501091[_0x7924('0x46')]('\x22'+_0x36b0d7+'\x22');}else{_0x47aa68['push'](_0x7924('0x62'));}break;default:_0x501091[_0x7924('0x46')]('\x22'+_0x36b0d7+'\x22');}}else{switch(_0xc32ed0){case _0x7924('0x63'):case'phone':_0x47aa68[_0x7924('0x46')](_0xc32ed0+_0x7924('0x64'));break;default:_0x501091['push']('\x22\x22');}}}}if(_0x47aa68[_0x7924('0x53')]){handleError(_0x229430['data'][_0x4948ea],{'code':_0x7924('0x65'),'message':_0x47aa68['join']()});}else{fs[_0x7924('0x66')](_0x2ba17d,_0x501091[_0x7924('0x16')]()+'\x0a');}_0x501091=[];}if(!(stats[_0x7924('0x54')]%0xc8)){socket['emit'](_0x7924('0x67')+_0x34afb5,stats);stats['errors']=[];}}if(stopped){logger[_0x7924('0x3e')](_0x7924('0x68'));_0x52064f[_0x7924('0x69')]();}}catch(_0x691ea8){handleError(_0x229430[_0x7924('0x55')][_0x4948ea],{'code':_0x7924('0x6a'),'message':_0x691ea8[_0x7924('0x41')]});logger[_0x7924('0x40')]('step',_0x691ea8[_0x7924('0x41')]);}},'complete':function(){try{var _0x16dfee=[];var _0x3daaa9=_0x7924('0x2a');if(_0x47c20e['duplicates']&&_0x47c20e['duplicates'][_0x7924('0x53')]){_0x3daaa9=_0x7924('0x6b')+_0x34afb5;_0x16dfee['push'](_0x7924('0x6c')+_0x3daaa9+'\x20LIKE\x20cm_contacts;');}var _0x180991=util[_0x7924('0x6d')](_0x7924('0x6e'),_0x2ba17d,_0x3daaa9,_0x5c8cb5,_0x47c20e['ListId'],_0x47c20e[_0x7924('0x6f')]||null,NOW,NOW);if(_[_0x7924('0x70')](_0xa5ceb2[_0x7924('0x59')])){_0x180991+=',\x20scheduledAt\x20=\x20NOW()';}_0x16dfee[_0x7924('0x46')](_0x180991);if(_0x47c20e[_0x7924('0x71')]&&_0x47c20e[_0x7924('0x71')][_0x7924('0x53')]){_0x16dfee['push'](insertCmContact(_0x47c20e[_0x7924('0x24')],_0x3daaa9,_0x47c20e[_0x7924('0x71')],_0xa5ceb2));_0x16dfee[_0x7924('0x46')](_0x7924('0x72')+_0x3daaa9+';');}_0x16dfee[_0x7924('0x46')](insertCmHopper(_0x47c20e['ListId'],_0x7924('0x73'),'voice_queues','VoiceQueueId',_0xd44eb7));_0x16dfee[_0x7924('0x46')](insertCmHopperBlack(_0x47c20e[_0x7924('0x24')],'voice_queues_has_cm_blacklists',_0x7924('0x74'),_0x7924('0x75')));_0x16dfee[_0x7924('0x46')](insertCmHopper(_0x47c20e['ListId'],'campaigns_has_cm_lists',_0x7924('0x76'),'CampaignId',_0xd44eb7));_0x16dfee[_0x7924('0x46')](insertCmHopperBlack(_0x47c20e[_0x7924('0x24')],_0x7924('0x77'),_0x7924('0x76'),_0x7924('0x78')));BPromise[_0x7924('0x79')](_0x16dfee,handleQuery)[_0x7924('0x7a')](function(_0x432296){stats[_0x7924('0x7b')]=!![];stats[_0x7924('0x7c')]=_0x47c20e['duplicates']&&_0x47c20e['duplicates']['length']?results[0x2][_0x7924('0x7c')]:results[0x0][_0x7924('0x7c')];socket['emit'](_0x7924('0x67')+_0x34afb5,stats);fs[_0x7924('0x7d')](_0x330989);fs[_0x7924('0x7d')](_0x2ba17d);process[_0x7924('0x42')](0x0);})['catch'](function(_0x1758f7){logger[_0x7924('0x40')](_0x1758f7[_0x7924('0x41')]);process[_0x7924('0x42')](0x1);});}catch(_0x55294b){logger[_0x7924('0x40')](_0x7924('0x7e'),_0x55294b[_0x7924('0x41')]);process['exit'](0x1);}},'error':function(_0x1afa1b,_0x5d7535,_0x4de33b,_0x5e1762){throw new Error(_0x5e1762);}});}function validate(){if(process[_0x7924('0x7f')]&&process[_0x7924('0x7f')][_0x7924('0x53')]<0x4){throw new Error(_0x7924('0x80'));}var _0x3f60c7=path[_0x7924('0x16')](config[_0x7924('0x4d')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7924('0x81')](_0x3f60c7)){throw new Error(_0x7924('0x82'));}var _0x257450={};try{_0x257450=JSON[_0x7924('0x52')](process['argv'][0x3]);if(!_0x257450[_0x7924('0x4b')]){throw new Error(_0x7924('0x83'));}if(!_0x257450[_0x7924('0x4b')][_0x7924('0x22')]){throw new Error(_0x7924('0x84'));}if(!_0x257450[_0x7924('0x4b')][_0x7924('0x63')]){throw new Error(_0x7924('0x85'));}var _0x2e3be0=0x0;if(_0x257450[_0x7924('0x4b')][_0x7924('0x5c')]){_0x2e3be0=0x1;}if(!_0x257450[_0x7924('0x24')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x57d511){throw new Error('body\x20id\x20mandatory');}var _0x5265d0=[];try{_0x5265d0=_[_0x7924('0x86')](JSON[_0x7924('0x52')](process[_0x7924('0x7f')][0x4]),'id');}catch(_0x285c71){logger[_0x7924('0x3e')](_0x7924('0x87'));}main(_0x3f60c7,_0x257450,_0x5265d0,_0x2e3be0);}validate();process['on'](_0x7924('0x88'),handleStop);process['on'](_0x7924('0x89'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 333a438..8ece1df 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 _0x93cc=['inbound','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','Agent\x20Ring','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0x93cc,0x1db));var _0xc93c=function(_0x4f9f58,_0x5e5f30){_0x4f9f58=_0x4f9f58-0x0;var _0x3cafa1=_0x93cc[_0x4f9f58];return _0x3cafa1;};'use strict';exports[_0xc93c('0x0')]=function(_0x56a5f4,_0x51abcc){var _0x3f7c9e=[{'type':_0xc93c('0x1'),'content':_0xc93c('0x2'),'variableName':null}];switch(_0x56a5f4[_0xc93c('0x3')]()){case _0xc93c('0x4'):switch(_0x51abcc[_0xc93c('0x3')]()){case _0xc93c('0x5'):_0x3f7c9e[_0xc93c('0x6')]({'type':_0xc93c('0x7'),'content':'','variableName':'queue'});_0x3f7c9e['push']({'type':'variable','content':'','variableName':_0xc93c('0x8')});break;case'outbound':_0x3f7c9e[_0xc93c('0x6')]({'type':_0xc93c('0x1'),'content':_0xc93c('0x9'),'variableName':null});_0x3f7c9e['push']({'type':_0xc93c('0x7'),'content':'','variableName':_0xc93c('0xa')});break;}}return _0x3f7c9e;};exports[_0xc93c('0xb')]=function(_0x2f6479,_0x5ac19b){var _0x13915a=[];switch(_0x2f6479[_0xc93c('0x3')]()){case _0xc93c('0x4'):switch(_0x5ac19b['toLowerCase']()){case _0xc93c('0x5'):_0x13915a=[{'type':_0xc93c('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0xd'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x8')},{'type':'keyValue','content':'','key':_0xc93c('0xe'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0xf')},{'type':'keyValue','content':'','key':_0xc93c('0x10'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x11')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x12'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x13')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x14'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x15')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x16'),'keyType':'variable','variableName':_0xc93c('0x17')},{'type':_0xc93c('0x1'),'content':_0xc93c('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xc93c('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x19')},{'type':'keyValue','content':'','key':_0xc93c('0x1a'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0xa')},{'type':_0xc93c('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x1b'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x17')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0xc93c('0x7'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0xc93c('0x7'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0xc93c('0x1c'),'keyType':_0xc93c('0x7'),'variableName':_0xc93c('0x1d')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x1e'),'keyType':_0xc93c('0x7'),'variableName':'talktime'}];break;case'outbound':_0x13915a=[{'type':_0xc93c('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x1f'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':_0xc93c('0xa')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x20'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':_0xc93c('0x21')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x14'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x16'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':_0xc93c('0x22')},{'type':_0xc93c('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x23'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x24'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x25'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':_0xc93c('0x26')},{'type':_0xc93c('0xc'),'content':'','key':_0xc93c('0x27'),'keyType':_0xc93c('0x7'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x13915a;}; \ No newline at end of file +var _0x6da2=['calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','Caller\x20Number','calleridname','keyValue','Call\x20To','destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue'];(function(_0x49e16f,_0x2fc5b3){var _0x127ffb=function(_0x17fb0e){while(--_0x17fb0e){_0x49e16f['push'](_0x49e16f['shift']());}};_0x127ffb(++_0x2fc5b3);}(_0x6da2,0x13b));var _0x26da=function(_0x6be9d9,_0x153d7e){_0x6be9d9=_0x6be9d9-0x0;var _0x43858f=_0x6da2[_0x6be9d9];return _0x43858f;};'use strict';exports[_0x26da('0x0')]=function(_0x2c422f,_0x137f08){var _0x1a6f88=[{'type':'string','content':_0x26da('0x1'),'variableName':null}];switch(_0x2c422f[_0x26da('0x2')]()){case'voice':switch(_0x137f08[_0x26da('0x2')]()){case _0x26da('0x3'):_0x1a6f88[_0x26da('0x4')]({'type':_0x26da('0x5'),'content':'','variableName':_0x26da('0x6')});_0x1a6f88[_0x26da('0x4')]({'type':_0x26da('0x5'),'content':'','variableName':_0x26da('0x7')});break;case _0x26da('0x8'):_0x1a6f88['push']({'type':_0x26da('0x9'),'content':_0x26da('0xa'),'variableName':null});_0x1a6f88[_0x26da('0x4')]({'type':_0x26da('0x5'),'content':'','variableName':_0x26da('0xb')});break;}}return _0x1a6f88;};exports[_0x26da('0xc')]=function(_0x15786d,_0x350229){var _0x1b0f04=[];switch(_0x15786d['toLowerCase']()){case _0x26da('0xd'):switch(_0x350229[_0x26da('0x2')]()){case'inbound':_0x1b0f04=[{'type':_0x26da('0x9'),'content':_0x26da('0xe'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x26da('0xf'),'keyType':'variable','variableName':_0x26da('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x26da('0x10')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x12'),'keyType':_0x26da('0x5'),'variableName':_0x26da('0x13')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x14'),'keyType':_0x26da('0x5'),'variableName':_0x26da('0x6')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x15'),'keyType':_0x26da('0x5'),'variableName':'uniqueid'},{'type':_0x26da('0x11'),'content':'','key':'Date','keyType':_0x26da('0x5'),'variableName':_0x26da('0x16')},{'type':_0x26da('0x9'),'content':_0x26da('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x18'),'keyType':'variable','variableName':_0x26da('0x19')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x1a'),'keyType':_0x26da('0x5'),'variableName':_0x26da('0xb')},{'type':_0x26da('0x9'),'content':_0x26da('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x1c'),'keyType':_0x26da('0x5'),'variableName':_0x26da('0x16')},{'type':_0x26da('0x11'),'content':'','key':'Agent\x20Connect','keyType':_0x26da('0x5'),'variableName':'agentconnectAt'},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x1d'),'keyType':_0x26da('0x5'),'variableName':_0x26da('0x1e')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x1f'),'keyType':_0x26da('0x5'),'variableName':'holdtime'},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x20'),'keyType':'variable','variableName':_0x26da('0x21')}];break;case _0x26da('0x8'):_0x1b0f04=[{'type':_0x26da('0x9'),'content':_0x26da('0xe'),'variableName':null},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x22'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':_0x26da('0xb')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x23'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':_0x26da('0x24')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x15'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x25'),'keyType':'variable','keyContent':'','variableName':_0x26da('0x26')},{'type':'string','content':_0x26da('0x1b')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x27'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':_0x26da('0x28')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x29'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x2a'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':_0x26da('0x2b')},{'type':_0x26da('0x11'),'content':'','key':_0x26da('0x2c'),'keyType':_0x26da('0x5'),'keyContent':'','variableName':_0x26da('0x2d')}];break;}}return _0x1b0f04;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 6adc5d3..71dbf16 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 _0x6710=['unknown','toLowerCase','toUpperCase','name','role','stringify','upperFirst','findOne','then','info','catch','tracked','query','clone','body','omit','html','phone','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId'];(function(_0x1c9bd0,_0x1216d6){var _0x216fa1=function(_0x5cafbd){while(--_0x5cafbd){_0x1c9bd0['push'](_0x1c9bd0['shift']());}};_0x216fa1(++_0x1216d6);}(_0x6710,0x1de));var _0x0671=function(_0x2afe26,_0x584c84){_0x2afe26=_0x2afe26-0x0;var _0x5a4e24=_0x6710[_0x2afe26];return _0x5a4e24;};'use strict';var _=require('lodash');var db=require(_0x0671('0x0'))['db'];var loggers={'openchannel':require(_0x0671('0x1'))(_0x0671('0x2')),'mail':require(_0x0671('0x1'))(_0x0671('0x3')),'fax':require(_0x0671('0x1'))(_0x0671('0x4')),'sms':require('../../config/logger')(_0x0671('0x5')),'chat':require(_0x0671('0x1'))(_0x0671('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x53d95e,_0x373860,_0x4dbc3b){if(_0x53d95e&&_0x53d95e[_['upperFirst'](_0x4dbc3b)+_0x0671('0x7')]){return _0x53d95e[_['upperFirst'](_0x4dbc3b)+_0x0671('0x7')];}else if(_0x53d95e&&_0x53d95e['id']){return _0x53d95e['id'];}else if(_0x373860&&_0x373860['id']){return _0x373860['id'];}else{return _0x0671('0x8');}}function log(_0x4b49cb,_0x36064c,_0x16afa6,_0x107dc4,_0x5ba3fa,_0xfdbdd8){loggers[_0x5ba3fa[_0x0671('0x9')]()][_0x4b49cb]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfdbdd8[_0x0671('0xa')](),_0x36064c?_0x36064c['id']:null,_0x36064c?_0x36064c[_0x0671('0xb')]:null,_0x36064c?_0x36064c[_0x0671('0xc')]:null,getInteractionId(_0x16afa6,_0x107dc4,_0x5ba3fa),_0x16afa6?JSON[_0x0671('0xd')](_0x16afa6):'null');}function updateUser(_0x55fcfd,_0x4721c6,_0xe5690d,_0x5122ad,_0x3ae16f){db[_[_0x0671('0xe')](_0x5122ad)+'Interaction'][_0x0671('0xf')]({'where':{'id':getInteractionId(_0x4721c6,_0xe5690d,_0x5122ad)}})['then'](function(_0x2fe796){if(_0x2fe796){return _0x2fe796['update']({'UserId':_0x55fcfd?_0x55fcfd['id']:null});}})[_0x0671('0x10')](function(_0x40e1af){if(_0x40e1af){log(_0x0671('0x11'),_0x55fcfd,_0x4721c6,_0xe5690d,_0x5122ad,_0x3ae16f);}})[_0x0671('0x12')](function(){log('error',_0x55fcfd,_0x4721c6,_0xe5690d,_0x5122ad,_0x3ae16f);});}exports[_0x0671('0x13')]=function(_0x4a3129,_0x5cccf5){return function(_0x2bbd41,_0x2ccaed,_0x4d5b68){var _0x53fe20=_0x2bbd41['user'];var _0x108341={};var _0x12e146=_0x2bbd41[_0x0671('0x14')];if(_0x108341){_0x108341=_[_0x0671('0x15')](_0x2bbd41[_0x0671('0x16')]);_0x108341=_[_0x0671('0x17')](_0x108341,[_0x0671('0x16'),_0x0671('0x18'),_0x0671('0x19'),'fax',_0x0671('0x1a')]);}updateUser(_0x53fe20,_0x108341,_0x12e146,_0x4a3129,_0x5cccf5);_0x4d5b68(null);};}; \ No newline at end of file +var _0x4417=['info','error','tracked','user','query','clone','body','omit','html','phone','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update'];(function(_0x449727,_0x5692ab){var _0x38ffee=function(_0x2682e1){while(--_0x2682e1){_0x449727['push'](_0x449727['shift']());}};_0x38ffee(++_0x5692ab);}(_0x4417,0xa6));var _0x7441=function(_0x5a758b,_0x20eaaa){_0x5a758b=_0x5a758b-0x0;var _0x36c774=_0x4417[_0x5a758b];return _0x36c774;};'use strict';var _=require('lodash');var db=require(_0x7441('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x7441('0x1')),'mail':require(_0x7441('0x2'))(_0x7441('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x7441('0x2'))(_0x7441('0x4')),'whatsapp':require(_0x7441('0x2'))(_0x7441('0x5'))};function getInteractionId(_0x5d981b,_0x45441a,_0x20853d){if(_0x5d981b&&_0x5d981b[_[_0x7441('0x6')](_0x20853d)+'InteractionId']){return _0x5d981b[_[_0x7441('0x6')](_0x20853d)+_0x7441('0x7')];}else if(_0x5d981b&&_0x5d981b['id']){return _0x5d981b['id'];}else if(_0x45441a&&_0x45441a['id']){return _0x45441a['id'];}else{return _0x7441('0x8');}}function log(_0x3f6ff4,_0x14714b,_0x2cc5af,_0x1042ec,_0x295182,_0x36e7ae){loggers[_0x295182[_0x7441('0x9')]()][_0x3f6ff4](_0x7441('0xa'),_0x36e7ae[_0x7441('0xb')](),_0x14714b?_0x14714b['id']:null,_0x14714b?_0x14714b[_0x7441('0xc')]:null,_0x14714b?_0x14714b[_0x7441('0xd')]:null,getInteractionId(_0x2cc5af,_0x1042ec,_0x295182),_0x2cc5af?JSON[_0x7441('0xe')](_0x2cc5af):_0x7441('0xf'));}function updateUser(_0x3e7ddf,_0x216f0a,_0x16b600,_0xfb86e8,_0x4e4ca8){db[_[_0x7441('0x6')](_0xfb86e8)+_0x7441('0x10')][_0x7441('0x11')]({'where':{'id':getInteractionId(_0x216f0a,_0x16b600,_0xfb86e8)}})[_0x7441('0x12')](function(_0x10ca59){if(_0x10ca59){return _0x10ca59[_0x7441('0x13')]({'UserId':_0x3e7ddf?_0x3e7ddf['id']:null});}})[_0x7441('0x12')](function(_0x1e7d4f){if(_0x1e7d4f){log(_0x7441('0x14'),_0x3e7ddf,_0x216f0a,_0x16b600,_0xfb86e8,_0x4e4ca8);}})['catch'](function(){log(_0x7441('0x15'),_0x3e7ddf,_0x216f0a,_0x16b600,_0xfb86e8,_0x4e4ca8);});}exports[_0x7441('0x16')]=function(_0x2459b0,_0x25d08b){return function(_0x2307cd,_0x1469c2,_0x2393e2){var _0x109f93=_0x2307cd[_0x7441('0x17')];var _0x3dc313={};var _0x5a8661=_0x2307cd[_0x7441('0x18')];if(_0x3dc313){_0x3dc313=_[_0x7441('0x19')](_0x2307cd[_0x7441('0x1a')]);_0x3dc313=_[_0x7441('0x1b')](_0x3dc313,[_0x7441('0x1a'),_0x7441('0x1c'),_0x7441('0x1d'),'fax',_0x7441('0x1e')]);}updateUser(_0x109f93,_0x3dc313,_0x5a8661,_0x2459b0,_0x25d08b);_0x2393e2(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 5724a5a..070c2d2 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 _0xf846=['User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','findOne','then','status','catch','users'];(function(_0x568a2d,_0x402790){var _0x47abdc=function(_0x15df24){while(--_0x15df24){_0x568a2d['push'](_0x568a2d['shift']());}};_0x47abdc(++_0x402790);}(_0xf846,0x70));var _0x6f84=function(_0x36baa5,_0x1f5096){_0x36baa5=_0x36baa5-0x0;var _0x5e6c82=_0xf846[_0x36baa5];return _0x5e6c82;};'use strict';var crypto=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var compose=require(_0x6f84('0x2'));var db=require(_0x6f84('0x3'))['db'];var config=require(_0x6f84('0x4'));function getValueFromLicense(_0x9ef36c,_0xbef666){if(_0x9ef36c&&_0xbef666){if(_0xbef666['data1']&&_0xbef666[_0x6f84('0x5')]){var _0x564b85=_0xbef666[_0x6f84('0x6')];var _0x5416a2=_0xbef666['license'];var _0x8fd139=_0x564b85['split']('-')[0x4];var _0x38ee32=_0x564b85[_0x6f84('0x7')]('-')[0x0];var _0x27c32c=crypto[_0x6f84('0x8')](_0x6f84('0x9'),util[_0x6f84('0xa')](_0x6f84('0xb'),_0x8fd139,_0x564b85,_0x38ee32));var _0x55adf2=_0x27c32c[_0x6f84('0xc')](_0x5416a2,_0x6f84('0xd'),_0x6f84('0xe'));_0x55adf2+=_0x27c32c['final'](_0x6f84('0xe'));var _0x4aeb2d=JSON[_0x6f84('0xf')](_0x55adf2);return _0x4aeb2d[_0x6f84('0x10')](_0x9ef36c)?_0x4aeb2d[_0x9ef36c]:null;}}return null;}function isLimit(_0x4cd9e9,_0x2d6471,_0x97c182,_0x43bf1f){var _0x3cc7a2=_0x2d6471;return compose()[_0x6f84('0x11')](function(_0x31fd7a,_0x22b504,_0x297035){return db['License'][_0x6f84('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x6f84('0x13')](function(_0x3a6915){var _0x533bf8=getValueFromLicense(_0x4cd9e9,_0x3a6915);return _0x533bf8?_0x533bf8:_0x3cc7a2;})[_0x6f84('0x13')](function(_0xc4aa10){_0x3cc7a2=_0xc4aa10;return _0x97c182['count'](_0x43bf1f);})['then'](function(_0x2f8cc9){if(_0x2f8cc9>=_0x3cc7a2){return _0x22b504[_0x6f84('0x14')](0x193)['json']({'message':util[_0x6f84('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4cd9e9)});}_0x297035();})[_0x6f84('0x15')](function(_0x2600e7){_0x297035(_0x2600e7);});});}function isUserLimit(){return isLimit(_0x6f84('0x16'),0x1,db[_0x6f84('0x17')],{'where':{'$or':[{'role':_0x6f84('0x18')},{'role':_0x6f84('0x19')}]}});}exports[_0x6f84('0x1a')]=isUserLimit; \ No newline at end of file +var _0x2b18=['update','base64','utf8','final','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','isUserLimit','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s'];(function(_0x26b519,_0x3d7051){var _0x116e97=function(_0x51b9ec){while(--_0x51b9ec){_0x26b519['push'](_0x26b519['shift']());}};_0x116e97(++_0x3d7051);}(_0x2b18,0xa7));var _0x82b1=function(_0x4349e0,_0x25e859){_0x4349e0=_0x4349e0-0x0;var _0x5e53a1=_0x2b18[_0x4349e0];return _0x5e53a1;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x82b1('0x0'))['db'];var config=require(_0x82b1('0x1'));function getValueFromLicense(_0x24ca3c,_0x25bbd2){if(_0x24ca3c&&_0x25bbd2){if(_0x25bbd2['data1']&&_0x25bbd2[_0x82b1('0x2')]){var _0x313fda=_0x25bbd2[_0x82b1('0x3')];var _0x58a298=_0x25bbd2[_0x82b1('0x2')];var _0x58c8d7=_0x313fda[_0x82b1('0x4')]('-')[0x4];var _0x521837=_0x313fda['split']('-')[0x0];var _0x52e68a=crypto[_0x82b1('0x5')](_0x82b1('0x6'),util['format'](_0x82b1('0x7'),_0x58c8d7,_0x313fda,_0x521837));var _0x2bd0cf=_0x52e68a[_0x82b1('0x8')](_0x58a298,_0x82b1('0x9'),_0x82b1('0xa'));_0x2bd0cf+=_0x52e68a[_0x82b1('0xb')]('utf8');var _0x139c96=JSON['parse'](_0x2bd0cf);return _0x139c96['hasOwnProperty'](_0x24ca3c)?_0x139c96[_0x24ca3c]:null;}}return null;}function isLimit(_0xc3455d,_0x28892d,_0x4c1357,_0x1290b9){var _0x362c32=_0x28892d;return compose()[_0x82b1('0xc')](function(_0x584cec,_0x8a3d69,_0xc7513b){return db[_0x82b1('0xd')][_0x82b1('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x82b1('0xf')](function(_0xe096fe){var _0x5eb1db=getValueFromLicense(_0xc3455d,_0xe096fe);return _0x5eb1db?_0x5eb1db:_0x362c32;})[_0x82b1('0xf')](function(_0x355135){_0x362c32=_0x355135;return _0x4c1357[_0x82b1('0x10')](_0x1290b9);})['then'](function(_0x28c1ff){if(_0x28c1ff>=_0x362c32){return _0x8a3d69[_0x82b1('0x11')](0x193)[_0x82b1('0x12')]({'message':util[_0x82b1('0x13')](_0x82b1('0x14'),_0xc3455d)});}_0xc7513b();})[_0x82b1('0x15')](function(_0x1816ac){_0xc7513b(_0x1816ac);});});}function isUserLimit(){return isLimit(_0x82b1('0x16'),0x1,db[_0x82b1('0x17')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x82b1('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 00cad4d..0387243 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 _0x7c6e=['$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','shift','match','filter','indexOf','push','buildExpression','DATE','operator','$eq','$between','value','$gt'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7c6e,0x8c));var _0xe7c6=function(_0xf8de05,_0x5c5cf7){_0xf8de05=_0xf8de05-0x0;var _0x9d53f1=_0x7c6e[_0xf8de05];return _0x9d53f1;};'use strict';var _=require(_0xe7c6('0x0'));var moment=require('moment');exports[_0xe7c6('0x1')]=function(_0x143e16){var _0x1327e0={'conditions':[]};_0x1327e0[_0xe7c6('0x2')]=_[_0xe7c6('0x3')](_0x143e16,_0xe7c6('0x4'))?'or':_0xe7c6('0x5');var _0x2ebd7a=_0x143e16[_0xe7c6('0x6')]('[$and]','')['replace'](_0xe7c6('0x4'),'')[_0xe7c6('0x7')]('||');for(var _0x35df82=0x0;_0x35df82<_0x2ebd7a[_0xe7c6('0x8')];_0x35df82++){var _0x436cc5=_0x2ebd7a[_0x35df82][_0xe7c6('0x7')](':=');var _0x3da106=_0x436cc5[0x0];var _0x31fec1=_0x436cc5[_0xe7c6('0x9')](0x1);_0x31fec1['forEach'](function(_0x58e1a6){var _0x25bcef=_0x58e1a6[_0xe7c6('0x7')]('[')[_0xe7c6('0xa')]();var _0x1818b7=_0x58e1a6[_0xe7c6('0xb')](/\[(.*?)\]/g);_0x1818b7['forEach'](function(_0x2248b4){var _0x5ab917=_0x2248b4[_0xe7c6('0x7')]('[')[_0xe7c6('0xc')](function(_0x48f9ff){return _0x48f9ff[_0xe7c6('0xd')](']')>-0x1;})['map'](function(_0xc0acae){return _0xc0acae[_0xe7c6('0x7')](']')[0x0];})[0x0];_0x1327e0['conditions'][_0xe7c6('0xe')]({'field':_0x3da106,'operator':_0x25bcef,'value':_0x5ab917});});});}return _0x1327e0;};exports[_0xe7c6('0xf')]=function(_0x2a6367,_0xbe9804,_0x3669e4){var _0x8d1415={};if(_0xbe9804===_0xe7c6('0x10')){if(_0x3669e4[_0xe7c6('0x11')]===_0xe7c6('0x12')){_0x3669e4['operator']=_0xe7c6('0x13');_0x3669e4[_0xe7c6('0x14')]+=','+_0x3669e4[_0xe7c6('0x14')];}else if(_['includes']([_0xe7c6('0x15'),_0xe7c6('0x16')],_0x3669e4[_0xe7c6('0x11')])){_0x3669e4[_0xe7c6('0x14')]=moment(_0x3669e4[_0xe7c6('0x14')])['add'](0x1,_0xe7c6('0x17'))[_0xe7c6('0x18')](_0xe7c6('0x19'));}}if(_0x3669e4['castTo']){_0xbe9804=_0x3669e4[_0xe7c6('0x1a')];_0x8d1415[_0xe7c6('0x1b')]=_0xe7c6('0x1c')+_0x2a6367+'.'+_0x3669e4[_0xe7c6('0x1d')]+_0xe7c6('0x1e')+_0x3669e4[_0xe7c6('0x1a')]+')\x20'+parseOperator(_0x3669e4[_0xe7c6('0x11')]);}else{_0x8d1415[_0xe7c6('0x1b')]=_0x2a6367+'.'+_0x3669e4[_0xe7c6('0x1d')]+'\x20'+parseOperator(_0x3669e4[_0xe7c6('0x11')]);}if(_['includes']([_0xe7c6('0x1f'),'$notIn'],_0x3669e4[_0xe7c6('0x11')]))_0x8d1415[_0xe7c6('0x1b')]='('+_0x8d1415[_0xe7c6('0x1b')]+'\x20OR\x20'+_0x2a6367+'.'+_0x3669e4[_0xe7c6('0x1d')]+_0xe7c6('0x20');_0x8d1415[_0xe7c6('0x14')]=parseValue(_0xbe9804,_0x3669e4['operator'],_0x3669e4['value']);return _0x8d1415;};function parseOperator(_0x3ea2ee){var _0x2afc89;switch(_0x3ea2ee){case _0xe7c6('0x21'):_0x2afc89=_0xe7c6('0x22');break;case'$notIn':_0x2afc89=_0xe7c6('0x23');break;case'$eq':_0x2afc89=_0xe7c6('0x24');break;case _0xe7c6('0x1f'):_0x2afc89='<>\x20?';break;case _0xe7c6('0x25'):case _0xe7c6('0x26'):case _0xe7c6('0x27'):_0x2afc89=_0xe7c6('0x28');break;case _0xe7c6('0x29'):_0x2afc89=_0xe7c6('0x2a');break;case _0xe7c6('0x15'):_0x2afc89='>\x20?';break;case _0xe7c6('0x16'):_0x2afc89=_0xe7c6('0x2b');break;case _0xe7c6('0x2c'):_0x2afc89=_0xe7c6('0x2d');break;case'$between':_0x2afc89=_0xe7c6('0x2e');break;}return _0x2afc89;}function parseValue(_0x5bd974,_0x59a735,_0x320378){var _0x137eab={'start':undefined,'end':undefined};switch(_0x59a735){case'$in':case'$notIn':_0x137eab[_0xe7c6('0x2f')]=_0x320378[_0xe7c6('0x7')](',');break;case _0xe7c6('0x25'):_0x137eab['start']='%'+_0x320378+'%';break;case'$startsWith':_0x137eab['start']=_0x320378+'%';break;case _0xe7c6('0x27'):_0x137eab['start']='%'+_0x320378;break;case _0xe7c6('0x13'):var _0x159494=_0x320378[_0xe7c6('0x7')](',');var _0x320378=_0x159494[_0xe7c6('0xa')]();var _0x43ff47=_0x159494[_0xe7c6('0x30')]();if(_0x5bd974===_0xe7c6('0x10')){_0x320378=moment(_0x320378)[_0xe7c6('0x31')](0x0,!![])[_0xe7c6('0x18')]();_0x43ff47=moment(_0x43ff47)[_0xe7c6('0x31')](0x0,!![])[_0xe7c6('0x32')](0x17,_0xe7c6('0x33'))[_0xe7c6('0x32')](0x3b,_0xe7c6('0x34'))['add'](0x3b,_0xe7c6('0x35'))[_0xe7c6('0x18')]();}_0x137eab={'start':_0x320378,'end':_0x43ff47};break;default:_0x137eab[_0xe7c6('0x2f')]=_0x320378;break;}return _0x137eab;} \ No newline at end of file +var _0x3ae9=['utcOffset','add','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','forEach','filter','indexOf','map','conditions','DATE','operator','$eq','value','$gt','$lte','days','format','castTo','text','CAST(','field','\x20AS\x20','includes','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','$startsWith','shift','pop'];(function(_0x5ca911,_0x6a8d75){var _0x181aec=function(_0x290ae2){while(--_0x290ae2){_0x5ca911['push'](_0x5ca911['shift']());}};_0x181aec(++_0x6a8d75);}(_0x3ae9,0x148));var _0x93ae=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x3ae9[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var moment=require(_0x93ae('0x0'));exports[_0x93ae('0x1')]=function(_0x128c8b){var _0x8eb33d={'conditions':[]};_0x8eb33d[_0x93ae('0x2')]=_[_0x93ae('0x3')](_0x128c8b,_0x93ae('0x4'))?'or':'and';var _0x361c0f=_0x128c8b[_0x93ae('0x5')]('[$and]','')['replace'](_0x93ae('0x4'),'')[_0x93ae('0x6')]('||');for(var _0x322206=0x0;_0x322206<_0x361c0f[_0x93ae('0x7')];_0x322206++){var _0x19180b=_0x361c0f[_0x322206][_0x93ae('0x6')](':=');var _0x2f5e80=_0x19180b[0x0];var _0x7654c1=_0x19180b['slice'](0x1);_0x7654c1[_0x93ae('0x8')](function(_0x25fbcf){var _0x2a5703=_0x25fbcf[_0x93ae('0x6')]('[')['shift']();var _0x4404a9=_0x25fbcf['match'](/\[(.*?)\]/g);_0x4404a9[_0x93ae('0x8')](function(_0x2cbec6){var _0x2c60f0=_0x2cbec6[_0x93ae('0x6')]('[')[_0x93ae('0x9')](function(_0x4240c3){return _0x4240c3[_0x93ae('0xa')](']')>-0x1;})[_0x93ae('0xb')](function(_0x475173){return _0x475173['split'](']')[0x0];})[0x0];_0x8eb33d[_0x93ae('0xc')]['push']({'field':_0x2f5e80,'operator':_0x2a5703,'value':_0x2c60f0});});});}return _0x8eb33d;};exports['buildExpression']=function(_0x4fc184,_0x1bf209,_0xf1667f){var _0x840cc8={};if(_0x1bf209===_0x93ae('0xd')){if(_0xf1667f[_0x93ae('0xe')]===_0x93ae('0xf')){_0xf1667f[_0x93ae('0xe')]='$between';_0xf1667f['value']+=','+_0xf1667f[_0x93ae('0x10')];}else if(_['includes']([_0x93ae('0x11'),_0x93ae('0x12')],_0xf1667f[_0x93ae('0xe')])){_0xf1667f['value']=moment(_0xf1667f[_0x93ae('0x10')])['add'](0x1,_0x93ae('0x13'))[_0x93ae('0x14')]('YYYY-MM-DD');}}if(_0xf1667f[_0x93ae('0x15')]){_0x1bf209=_0xf1667f[_0x93ae('0x15')];_0x840cc8[_0x93ae('0x16')]=_0x93ae('0x17')+_0x4fc184+'.'+_0xf1667f[_0x93ae('0x18')]+_0x93ae('0x19')+_0xf1667f[_0x93ae('0x15')]+')\x20'+parseOperator(_0xf1667f[_0x93ae('0xe')]);}else{_0x840cc8[_0x93ae('0x16')]=_0x4fc184+'.'+_0xf1667f[_0x93ae('0x18')]+'\x20'+parseOperator(_0xf1667f['operator']);}if(_[_0x93ae('0x1a')](['$ne',_0x93ae('0x1b')],_0xf1667f[_0x93ae('0xe')]))_0x840cc8[_0x93ae('0x16')]='('+_0x840cc8[_0x93ae('0x16')]+_0x93ae('0x1c')+_0x4fc184+'.'+_0xf1667f['field']+_0x93ae('0x1d');_0x840cc8['value']=parseValue(_0x1bf209,_0xf1667f['operator'],_0xf1667f[_0x93ae('0x10')]);return _0x840cc8;};function parseOperator(_0x1b993c){var _0x25cf2d;switch(_0x1b993c){case'$in':_0x25cf2d=_0x93ae('0x1e');break;case _0x93ae('0x1b'):_0x25cf2d=_0x93ae('0x1f');break;case _0x93ae('0xf'):_0x25cf2d=_0x93ae('0x20');break;case _0x93ae('0x21'):_0x25cf2d=_0x93ae('0x22');break;case _0x93ae('0x23'):case'$startsWith':case _0x93ae('0x24'):_0x25cf2d='LIKE\x20?';break;case _0x93ae('0x25'):_0x25cf2d=_0x93ae('0x26');break;case _0x93ae('0x11'):_0x25cf2d=_0x93ae('0x27');break;case _0x93ae('0x12'):_0x25cf2d=_0x93ae('0x28');break;case _0x93ae('0x29'):_0x25cf2d=_0x93ae('0x2a');break;case _0x93ae('0x2b'):_0x25cf2d=_0x93ae('0x2c');break;}return _0x25cf2d;}function parseValue(_0x7ce68b,_0x62bae6,_0x2a62fa){var _0x49ca98={'start':undefined,'end':undefined};switch(_0x62bae6){case _0x93ae('0x2d'):case _0x93ae('0x1b'):_0x49ca98[_0x93ae('0x2e')]=_0x2a62fa['split'](',');break;case'$substring':_0x49ca98[_0x93ae('0x2e')]='%'+_0x2a62fa+'%';break;case _0x93ae('0x2f'):_0x49ca98['start']=_0x2a62fa+'%';break;case _0x93ae('0x24'):_0x49ca98[_0x93ae('0x2e')]='%'+_0x2a62fa;break;case _0x93ae('0x2b'):var _0x28f440=_0x2a62fa[_0x93ae('0x6')](',');var _0x2a62fa=_0x28f440[_0x93ae('0x30')]();var _0x595b3a=_0x28f440[_0x93ae('0x31')]();if(_0x7ce68b===_0x93ae('0xd')){_0x2a62fa=moment(_0x2a62fa)[_0x93ae('0x32')](0x0,!![])['format']();_0x595b3a=moment(_0x595b3a)['utcOffset'](0x0,!![])[_0x93ae('0x33')](0x17,'hours')[_0x93ae('0x33')](0x3b,_0x93ae('0x34'))[_0x93ae('0x33')](0x3b,_0x93ae('0x35'))[_0x93ae('0x14')]();}_0x49ca98={'start':_0x2a62fa,'end':_0x595b3a};break;default:_0x49ca98[_0x93ae('0x2e')]=_0x2a62fa;break;}return _0x49ca98;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 06af908..390f834 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 _0x7b0b=['includes','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','YYYY-MM-DD','utc','format','$lte','name','isArray','limit','offset','sort','map','indexOf','cast','col','priority','substr','ASC','omit','isObject','length','unset','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','filters','intersection','attributes','hasOwnProperty','order','pick','filter','object','columns','value','where','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7b0b,0x19f));var _0xb7b0=function(_0x3f0302,_0x1129a3){_0x3f0302=_0x3f0302-0x0;var _0x28b532=_0x7b0b[_0x3f0302];return _0x28b532;};'use strict';var _=require(_0xb7b0('0x0'));var sequelize=require(_0xb7b0('0x1'));var moment=require(_0xb7b0('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5b7a65){var _0x308b6a=['ne'];try{var _0x509e05=JSON[_0xb7b0('0x3')](_0x5b7a65);var _0x12f975=Object[_0xb7b0('0x4')](_0x509e05)[0x0];return _0x308b6a[_0xb7b0('0x5')](_0x12f975);}catch(_0x2e4f98){return![];}}function getOperatorValue(_0xfdde4a){var _0x4559eb=JSON['parse'](_0xfdde4a);var _0x22a5ca=Object[_0xb7b0('0x4')](_0x4559eb)[0x0];var _0x4c0e1b=_0x4559eb[_0x22a5ca];return{['$'+_0x22a5ca]:_0x4c0e1b};}exports[_0xb7b0('0x6')]=function(_0x2b86b5){var _0xd8c4e0=null;if(_0x2b86b5){_0xd8c4e0=_0x2b86b5[_0xb7b0('0x7')](',');}return _0xd8c4e0;};exports['filters']=function(_0x21642f,_0xe1cb13){var _0x566858={};if(!_[_0xb7b0('0x8')](_0x21642f)){_[_0xb7b0('0x9')](_0x21642f,function(_0x3ca72e,_0x40c751){try{if(_0xe1cb13){var _0x5e18dc=_[_0xb7b0('0xa')](_0xe1cb13,{'name':_0x40c751})||{};if(hasSequelizeOperator(_0x3ca72e)){_0x566858[_0x40c751]=getOperatorValue(_0x3ca72e);}else if(_0x5e18dc[_0xb7b0('0xb')]===_0xb7b0('0xc')&&_[_0xb7b0('0xd')](_0x3ca72e)){var _0x454125=JSON[_0xb7b0('0x3')](_0x3ca72e);var _0x4dd614={'$gte':moment(moment(_0x454125['$gte'])['format'](_0xb7b0('0xe')))[_0xb7b0('0xf')]()[_0xb7b0('0x10')](),'$lte':moment(moment(_0x454125[_0xb7b0('0x11')])[_0xb7b0('0x10')](_0xb7b0('0xe')))['utc']()['subtract'](0x1,'s')[_0xb7b0('0x10')]()};_0x566858[_0x40c751]=_0x4dd614;}else if(_0x5e18dc[_0xb7b0('0x12')]==='uniqueid'){_0x566858[_0x40c751]=_0x3ca72e;}else{_0x566858[_0x40c751]=_[_0xb7b0('0x13')](_0x3ca72e)?_0x3ca72e:JSON[_0xb7b0('0x3')](_0x3ca72e);}}else{_0x566858[_0x40c751]=_[_0xb7b0('0x13')](_0x3ca72e)?_0x3ca72e:JSON[_0xb7b0('0x3')](_0x3ca72e);}}catch(_0xb201bf){_0x566858[_0x40c751]=_0x3ca72e[_0xb7b0('0x7')](',');}});}return _0x566858;};exports[_0xb7b0('0x14')]=function(_0x44c051){_0x44c051=parseInt(_0x44c051,0xa);if(!_0x44c051||_0x44c051<0x0){_0x44c051=LIMIT_VALUE;}return _0x44c051;};exports[_0xb7b0('0x15')]=function(_0x1151c7){_0x1151c7=parseInt(_0x1151c7,0xa);if(!_0x1151c7||_0x1151c7<0x0){_0x1151c7=0x0;}return _0x1151c7;};exports[_0xb7b0('0x16')]=function(_0x5c49cf){var _0x210066,_0x11037c=null;if(_0x5c49cf){_0x210066=_0x5c49cf[_0xb7b0('0x7')](',');_0x11037c=_[_0xb7b0('0x17')](_0x210066,function(_0x14dc58){if(_0x14dc58[_0xb7b0('0x18')]('-')===0x0){return[_0x14dc58==='priority'?sequelize[_0xb7b0('0x19')](sequelize[_0xb7b0('0x1a')](_0xb7b0('0x1b')),'unsigned'):_0x14dc58[_0xb7b0('0x1c')](0x1),'DESC'];}else{return[_0x14dc58==='priority'?sequelize[_0xb7b0('0x19')](sequelize[_0xb7b0('0x1a')]('priority'),'unsigned'):_0x14dc58,_0xb7b0('0x1d')];}});}return _0x11037c;};exports[_0xb7b0('0x1e')]=function(_0x1c33e1,_0x5b111f){if(_[_0xb7b0('0x8')](_0x1c33e1)){return _0x1c33e1;}if(_[_0xb7b0('0x13')](_0x1c33e1)){for(var _0x560f8d=0x0;_0x560f8d<_0x1c33e1['length'];_0x560f8d+=0x1){_0x1c33e1[_0x560f8d]=this[_0xb7b0('0x1e')](_0x1c33e1[_0x560f8d],_0x5b111f);}return _0x1c33e1;}if(!_[_0xb7b0('0x1f')](_0x1c33e1)){return _0x1c33e1;}if(_['isString'](_0x5b111f)){_0x5b111f=[_0x5b111f];}if(!_[_0xb7b0('0x13')](_0x5b111f)){return _0x1c33e1;}for(var _0x237136=0x0;_0x237136<_0x5b111f[_0xb7b0('0x20')];_0x237136+=0x1){_[_0xb7b0('0x21')](_0x1c33e1,_0x5b111f[_0x237136]);}for(var _0x32a82a in _0x1c33e1){if(_0x1c33e1['hasOwnProperty'](_0x32a82a)){_0x1c33e1[_0x32a82a]=this[_0xb7b0('0x1e')](_0x1c33e1[_0x32a82a],_0x5b111f);}}return _0x1c33e1;};exports[_0xb7b0('0x22')]=function(_0x43bc6b){return _0x43bc6b[_0xb7b0('0x23')](RegExp(_0xb7b0('0x24')))?!![]:![];};exports['isEmail']=function(_0x3cad73){return _0x3cad73[_0xb7b0('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xb7b0('0x25')]=function(_0x40eb0f){var _0x2da48a=[];_0x40eb0f['split'](/[ ,]+/)[_0xb7b0('0x26')](function(_0x1f1a0a){_0x1f1a0a=_0x1f1a0a[_0xb7b0('0x27')](/([^:]")"+/g,'$1');_0x1f1a0a='+'+_0x1f1a0a+'*';var _0x3c95c0=/[ `!@#$%^&*()_\-?~]/;if(_0x1f1a0a[_0xb7b0('0x23')](_0x3c95c0))_0x1f1a0a='\x22'+_0x1f1a0a+'\x22';_0x2da48a[_0xb7b0('0x28')](_0x1f1a0a);});return _0x2da48a[_0xb7b0('0x29')]('\x20');};exports[_0xb7b0('0x2a')]=function(_0x49b8b2,_0x3691cc,_0x393e1a){var _0x492d0c={},_0x155333={};if(_0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x2c')]){_0x3691cc['query']['id']=_0x3691cc[_0xb7b0('0x2b')]['$id'];delete _0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x2c')];}_0x492d0c[_0xb7b0('0x2d')]=_[_0xb7b0('0x17')](_0x49b8b2,_0xb7b0('0x12'));_0x492d0c['query']=_[_0xb7b0('0x4')](_0x3691cc['query']);_0x492d0c[_0xb7b0('0x2e')]=_[_0xb7b0('0x2f')](_0x492d0c['model'],_0x492d0c[_0xb7b0('0x2b')]);_0x155333[_0xb7b0('0x30')]=_[_0xb7b0('0x2f')](_0x492d0c[_0xb7b0('0x2d')],this['fields'](_0x3691cc[_0xb7b0('0x2b')]['fields']));_0x155333[_0xb7b0('0x30')]=_0x155333['attributes'][_0xb7b0('0x20')]?_0x155333[_0xb7b0('0x30')]:_0x492d0c[_0xb7b0('0x2d')];if(!_0x3691cc['query'][_0xb7b0('0x31')]('nolimit')){_0x155333['limit']=this[_0xb7b0('0x14')](_0x3691cc[_0xb7b0('0x2b')]['limit']);_0x155333[_0xb7b0('0x15')]=this[_0xb7b0('0x15')](_0x3691cc[_0xb7b0('0x2b')]['offset']);}_0x155333[_0xb7b0('0x32')]=this[_0xb7b0('0x16')](_0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x16')]);_0x155333['where']=this[_0xb7b0('0x2e')](_[_0xb7b0('0x33')](_0x3691cc[_0xb7b0('0x2b')],_0x492d0c[_0xb7b0('0x2e')]),_0x49b8b2);if(_0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x34')]){var _0x3c223c=_0x49b8b2;var _0x29bc3=_0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x34')];if(typeof _0x29bc3===_0xb7b0('0x35')){_0x3c223c=_['filter'](_0x49b8b2,function(_0x4c6273){return _[_0xb7b0('0x5')](_0x29bc3[_0xb7b0('0x36')],_0x4c6273[_0xb7b0('0x12')]);});_0x29bc3=_0x29bc3[_0xb7b0('0x37')];}_0x155333[_0xb7b0('0x38')]=_[_0xb7b0('0x39')](_0x155333[_0xb7b0('0x38')],{'$or':_['map'](_0x3c223c,function(_0x43d7d9){if(_0x43d7d9[_0xb7b0('0xb')]!==_0xb7b0('0x3a')){if(_0x393e1a){return sequelize[_0xb7b0('0x38')](sequelize['fn'](_0xb7b0('0x3b'),sequelize[_0xb7b0('0x1a')](_0x43d7d9[_0xb7b0('0x12')])),{'$like':sequelize['fn'](_0xb7b0('0x3b'),'%'+_0x3691cc[_0xb7b0('0x2b')][_0xb7b0('0x34')]+'%')});}else{var _0x248a67={};_0x248a67[_0x43d7d9[_0xb7b0('0x12')]]={'$like':'%'+_0x3691cc[_0xb7b0('0x2b')]['filter']+'%'};return _0x248a67;}}})});}_0x155333=_[_0xb7b0('0x39')]({},_0x155333,_0x3691cc['options']);return _0x155333;}; \ No newline at end of file +var _0x013c=['moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','length','omit','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','query','$id','intersection','attributes','model','nolimit','limit','where','pick','filter','object','columns','value','merge','type','VIRTUAL','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x013c,0x1df));var _0xc013=function(_0x26393b,_0x449a84){_0x26393b=_0x26393b-0x0;var _0x57230a=_0x013c[_0x26393b];return _0x57230a;};'use strict';var _=require(_0xc013('0x0'));var sequelize=require('sequelize');var moment=require(_0xc013('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x57e6df){var _0x33f11f=['ne'];try{var _0x35ed1c=JSON[_0xc013('0x2')](_0x57e6df);var _0x4d1b13=Object[_0xc013('0x3')](_0x35ed1c)[0x0];return _0x33f11f[_0xc013('0x4')](_0x4d1b13);}catch(_0x78cc6c){return![];}}function getOperatorValue(_0x7eb191){var _0x453f9b=JSON[_0xc013('0x2')](_0x7eb191);var _0x42a9f6=Object[_0xc013('0x3')](_0x453f9b)[0x0];var _0x167ec0=_0x453f9b[_0x42a9f6];return{['$'+_0x42a9f6]:_0x167ec0};}exports[_0xc013('0x5')]=function(_0x448c6e){var _0x464226=null;if(_0x448c6e){_0x464226=_0x448c6e[_0xc013('0x6')](',');}return _0x464226;};exports[_0xc013('0x7')]=function(_0x505bb0,_0x336fed){var _0x107fb6={};if(!_[_0xc013('0x8')](_0x505bb0)){_[_0xc013('0x9')](_0x505bb0,function(_0x3711a1,_0x33b630){try{if(_0x336fed){var _0x111020=_['find'](_0x336fed,{'name':_0x33b630})||{};if(hasSequelizeOperator(_0x3711a1)){_0x107fb6[_0x33b630]=getOperatorValue(_0x3711a1);}else if(_0x111020['type']===_0xc013('0xa')&&_[_0xc013('0xb')](_0x3711a1)){var _0x5ac57f=JSON[_0xc013('0x2')](_0x3711a1);var _0x32088d={'$gte':moment(moment(_0x5ac57f[_0xc013('0xc')])[_0xc013('0xd')](_0xc013('0xe')))[_0xc013('0xf')]()[_0xc013('0xd')](),'$lte':moment(moment(_0x5ac57f[_0xc013('0x10')])[_0xc013('0xd')](_0xc013('0xe')))[_0xc013('0xf')]()[_0xc013('0x11')](0x1,'s')[_0xc013('0xd')]()};_0x107fb6[_0x33b630]=_0x32088d;}else if(_0x111020[_0xc013('0x12')]===_0xc013('0x13')){_0x107fb6[_0x33b630]=_0x3711a1;}else{_0x107fb6[_0x33b630]=_[_0xc013('0x14')](_0x3711a1)?_0x3711a1:JSON[_0xc013('0x2')](_0x3711a1);}}else{_0x107fb6[_0x33b630]=_['isArray'](_0x3711a1)?_0x3711a1:JSON['parse'](_0x3711a1);}}catch(_0x456323){_0x107fb6[_0x33b630]=_0x3711a1[_0xc013('0x6')](',');}});}return _0x107fb6;};exports['limit']=function(_0x5cec79){_0x5cec79=parseInt(_0x5cec79,0xa);if(!_0x5cec79||_0x5cec79<0x0){_0x5cec79=LIMIT_VALUE;}return _0x5cec79;};exports[_0xc013('0x15')]=function(_0x1f995f){_0x1f995f=parseInt(_0x1f995f,0xa);if(!_0x1f995f||_0x1f995f<0x0){_0x1f995f=0x0;}return _0x1f995f;};exports['sort']=function(_0x5742e8){var _0x279171,_0xd8e3a8=null;if(_0x5742e8){_0x279171=_0x5742e8[_0xc013('0x6')](',');_0xd8e3a8=_[_0xc013('0x16')](_0x279171,function(_0x57cfd0){if(_0x57cfd0[_0xc013('0x17')]('-')===0x0){return[_0x57cfd0===_0xc013('0x18')?sequelize[_0xc013('0x19')](sequelize[_0xc013('0x1a')]('priority'),'unsigned'):_0x57cfd0[_0xc013('0x1b')](0x1),_0xc013('0x1c')];}else{return[_0x57cfd0===_0xc013('0x18')?sequelize['cast'](sequelize['col'](_0xc013('0x18')),_0xc013('0x1d')):_0x57cfd0,_0xc013('0x1e')];}});}return _0xd8e3a8;};exports['omit']=function(_0x5c2e7c,_0x104882){if(_[_0xc013('0x8')](_0x5c2e7c)){return _0x5c2e7c;}if(_['isArray'](_0x5c2e7c)){for(var _0x763f30=0x0;_0x763f30<_0x5c2e7c[_0xc013('0x1f')];_0x763f30+=0x1){_0x5c2e7c[_0x763f30]=this[_0xc013('0x20')](_0x5c2e7c[_0x763f30],_0x104882);}return _0x5c2e7c;}if(!_['isObject'](_0x5c2e7c)){return _0x5c2e7c;}if(_['isString'](_0x104882)){_0x104882=[_0x104882];}if(!_[_0xc013('0x14')](_0x104882)){return _0x5c2e7c;}for(var _0x60acdb=0x0;_0x60acdb<_0x104882['length'];_0x60acdb+=0x1){_[_0xc013('0x21')](_0x5c2e7c,_0x104882[_0x60acdb]);}for(var _0x17b784 in _0x5c2e7c){if(_0x5c2e7c[_0xc013('0x22')](_0x17b784)){_0x5c2e7c[_0x17b784]=this['omit'](_0x5c2e7c[_0x17b784],_0x104882);}}return _0x5c2e7c;};exports[_0xc013('0x23')]=function(_0x4cf71e){return _0x4cf71e[_0xc013('0x24')](RegExp(_0xc013('0x25')))?!![]:![];};exports[_0xc013('0x26')]=function(_0x27e159){return _0x27e159[_0xc013('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xc013('0x27')]=function(_0x2326b0){var _0x31e5ea=[];_0x2326b0[_0xc013('0x6')](/[ ,]+/)[_0xc013('0x28')](function(_0x2e23ec){_0x2e23ec=_0x2e23ec[_0xc013('0x29')](/([^:]")"+/g,'$1');_0x2e23ec='+'+_0x2e23ec+'*';var _0x48bbb8=/[ `!@#$%^&*()_\-?~]/;if(_0x2e23ec[_0xc013('0x24')](_0x48bbb8))_0x2e23ec='\x22'+_0x2e23ec+'\x22';_0x31e5ea[_0xc013('0x2a')](_0x2e23ec);});return _0x31e5ea[_0xc013('0x2b')]('\x20');};exports['getOptions']=function(_0x552a74,_0x56222d,_0x65d900){var _0x129cb2={},_0x4a3e29={};if(_0x56222d[_0xc013('0x2c')][_0xc013('0x2d')]){_0x56222d[_0xc013('0x2c')]['id']=_0x56222d['query'][_0xc013('0x2d')];delete _0x56222d[_0xc013('0x2c')][_0xc013('0x2d')];}_0x129cb2['model']=_[_0xc013('0x16')](_0x552a74,_0xc013('0x12'));_0x129cb2[_0xc013('0x2c')]=_[_0xc013('0x3')](_0x56222d[_0xc013('0x2c')]);_0x129cb2[_0xc013('0x7')]=_[_0xc013('0x2e')](_0x129cb2['model'],_0x129cb2[_0xc013('0x2c')]);_0x4a3e29[_0xc013('0x2f')]=_['intersection'](_0x129cb2['model'],this[_0xc013('0x5')](_0x56222d['query'][_0xc013('0x5')]));_0x4a3e29[_0xc013('0x2f')]=_0x4a3e29[_0xc013('0x2f')][_0xc013('0x1f')]?_0x4a3e29[_0xc013('0x2f')]:_0x129cb2[_0xc013('0x30')];if(!_0x56222d['query']['hasOwnProperty'](_0xc013('0x31'))){_0x4a3e29[_0xc013('0x32')]=this[_0xc013('0x32')](_0x56222d[_0xc013('0x2c')][_0xc013('0x32')]);_0x4a3e29[_0xc013('0x15')]=this[_0xc013('0x15')](_0x56222d[_0xc013('0x2c')][_0xc013('0x15')]);}_0x4a3e29['order']=this['sort'](_0x56222d[_0xc013('0x2c')]['sort']);_0x4a3e29[_0xc013('0x33')]=this[_0xc013('0x7')](_[_0xc013('0x34')](_0x56222d[_0xc013('0x2c')],_0x129cb2[_0xc013('0x7')]),_0x552a74);if(_0x56222d['query']['filter']){var _0x349b44=_0x552a74;var _0x55083e=_0x56222d[_0xc013('0x2c')][_0xc013('0x35')];if(typeof _0x55083e===_0xc013('0x36')){_0x349b44=_[_0xc013('0x35')](_0x552a74,function(_0x267f4d){return _['includes'](_0x55083e[_0xc013('0x37')],_0x267f4d[_0xc013('0x12')]);});_0x55083e=_0x55083e[_0xc013('0x38')];}_0x4a3e29[_0xc013('0x33')]=_[_0xc013('0x39')](_0x4a3e29[_0xc013('0x33')],{'$or':_[_0xc013('0x16')](_0x349b44,function(_0x299e2a){if(_0x299e2a[_0xc013('0x3a')]!==_0xc013('0x3b')){if(_0x65d900){return sequelize[_0xc013('0x33')](sequelize['fn']('lower',sequelize[_0xc013('0x1a')](_0x299e2a[_0xc013('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x56222d['query'][_0xc013('0x35')]+'%')});}else{var _0x412104={};_0x412104[_0x299e2a[_0xc013('0x12')]]={'$like':'%'+_0x56222d['query'][_0xc013('0x35')]+'%'};return _0x412104;}}})});}_0x4a3e29=_[_0xc013('0x39')]({},_0x4a3e29,_0x56222d['options']);return _0x4a3e29;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6a4f8da..1e8ee5e 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6f0=['body-parser','method-override','cookie-parser','errorhandler','path','passport','moment','./environment','default','env','set','appPath','join','root','client','use','json\x20replacer','split','static','get','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon'];(function(_0x370e98,_0x3ae7f1){var _0x1da80c=function(_0xbc6deb){while(--_0xbc6deb){_0x370e98['push'](_0x370e98['shift']());}};_0x1da80c(++_0x3ae7f1);}(_0xb6f0,0xfe));var _0x0b6f=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xb6f0[_0x42245d];return _0x4b211a;};'use strict';var express=require(_0x0b6f('0x0'));var favicon=require(_0x0b6f('0x1'));var bodyParser=require(_0x0b6f('0x2'));var methodOverride=require(_0x0b6f('0x3'));var cookieParser=require(_0x0b6f('0x4'));var errorHandler=require(_0x0b6f('0x5'));var path=require(_0x0b6f('0x6'));var passport=require(_0x0b6f('0x7'));var cors=require('cors');var moment=require(_0x0b6f('0x8'));var config=require(_0x0b6f('0x9'));var db=require('../mysqldb')['db'];exports[_0x0b6f('0xa')]=function(_0xe4b2e6){var _0x4bd32b=_0xe4b2e6['get'](_0x0b6f('0xb'));if(_0x4bd32b==='production'){_0xe4b2e6[_0x0b6f('0xc')](_0x0b6f('0xd'),path[_0x0b6f('0xe')](config[_0x0b6f('0xf')],'public'));}if(_0x4bd32b==='development'||_0x4bd32b==='test'){_0xe4b2e6['set'](_0x0b6f('0xd'),path['join'](config[_0x0b6f('0xf')],_0x0b6f('0x10')));_0xe4b2e6[_0x0b6f('0x11')](errorHandler());}_0xe4b2e6['set'](_0x0b6f('0x12'),function(_0x4a4755,_0x123d4a){if(this[_0x4a4755]instanceof Date){_0x123d4a=this[_0x4a4755]['toISOString']()[_0x0b6f('0x13')]('.')[0x0]+'Z';}return _0x123d4a;});_0xe4b2e6[_0x0b6f('0x11')](express[_0x0b6f('0x14')](_0xe4b2e6[_0x0b6f('0x15')](_0x0b6f('0xd'))));_0xe4b2e6[_0x0b6f('0xc')](_0x0b6f('0x16'),config[_0x0b6f('0xf')]+_0x0b6f('0x17'));_0xe4b2e6[_0x0b6f('0x18')](_0x0b6f('0x19'),require(_0x0b6f('0x1a'))[_0x0b6f('0x1b')]);_0xe4b2e6[_0x0b6f('0xc')](_0x0b6f('0x1c'),_0x0b6f('0x19'));_0xe4b2e6[_0x0b6f('0x11')](bodyParser['urlencoded']({'limit':_0x0b6f('0x1d'),'extended':!![]}));_0xe4b2e6['use'](bodyParser[_0x0b6f('0x1e')]({'limit':_0x0b6f('0x1d')}));_0xe4b2e6[_0x0b6f('0x11')](cors());_0xe4b2e6[_0x0b6f('0x11')](methodOverride());_0xe4b2e6[_0x0b6f('0x11')](cookieParser());_0xe4b2e6[_0x0b6f('0x11')](passport[_0x0b6f('0x1f')]());}; \ No newline at end of file +var _0x0508=['50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','get','env','appPath','join','root','public','development','test','set','use','json\x20replacer','split','static','engine','html','ejs','renderFile','view\x20engine','urlencoded'];(function(_0x164d16,_0x2f39a9){var _0x2cff6b=function(_0x32f3c7){while(--_0x32f3c7){_0x164d16['push'](_0x164d16['shift']());}};_0x2cff6b(++_0x2f39a9);}(_0x0508,0x14d));var _0x8050=function(_0x2ecb01,_0x3bcf1b){_0x2ecb01=_0x2ecb01-0x0;var _0x5047ac=_0x0508[_0x2ecb01];return _0x5047ac;};'use strict';var express=require(_0x8050('0x0'));var favicon=require(_0x8050('0x1'));var bodyParser=require(_0x8050('0x2'));var methodOverride=require(_0x8050('0x3'));var cookieParser=require(_0x8050('0x4'));var errorHandler=require(_0x8050('0x5'));var path=require(_0x8050('0x6'));var passport=require(_0x8050('0x7'));var cors=require('cors');var moment=require(_0x8050('0x8'));var config=require(_0x8050('0x9'));var db=require(_0x8050('0xa'))['db'];exports['default']=function(_0x109fd3){var _0x8082f9=_0x109fd3[_0x8050('0xb')](_0x8050('0xc'));if(_0x8082f9==='production'){_0x109fd3['set'](_0x8050('0xd'),path[_0x8050('0xe')](config[_0x8050('0xf')],_0x8050('0x10')));}if(_0x8082f9===_0x8050('0x11')||_0x8082f9===_0x8050('0x12')){_0x109fd3[_0x8050('0x13')]('appPath',path[_0x8050('0xe')](config[_0x8050('0xf')],'client'));_0x109fd3[_0x8050('0x14')](errorHandler());}_0x109fd3[_0x8050('0x13')](_0x8050('0x15'),function(_0x1172ca,_0x3200b1){if(this[_0x1172ca]instanceof Date){_0x3200b1=this[_0x1172ca]['toISOString']()[_0x8050('0x16')]('.')[0x0]+'Z';}return _0x3200b1;});_0x109fd3[_0x8050('0x14')](express[_0x8050('0x17')](_0x109fd3[_0x8050('0xb')](_0x8050('0xd'))));_0x109fd3['set']('views',config[_0x8050('0xf')]+'/server/views');_0x109fd3[_0x8050('0x18')](_0x8050('0x19'),require(_0x8050('0x1a'))[_0x8050('0x1b')]);_0x109fd3[_0x8050('0x13')](_0x8050('0x1c'),_0x8050('0x19'));_0x109fd3[_0x8050('0x14')](bodyParser[_0x8050('0x1d')]({'limit':_0x8050('0x1e'),'extended':!![]}));_0x109fd3[_0x8050('0x14')](bodyParser[_0x8050('0x1f')]({'limit':_0x8050('0x1e')}));_0x109fd3['use'](cors());_0x109fd3[_0x8050('0x14')](methodOverride());_0x109fd3[_0x8050('0x14')](cookieParser());_0x109fd3[_0x8050('0x14')](passport[_0x8050('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 494326d..2b2c860 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 _0xaea5=['utf8','hostname','ipAddress','md5','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','orderBy','cpus','join','createHash','update','digest','hex','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x546895,_0xb414da){var _0x3b5a09=function(_0x1da01c){while(--_0x1da01c){_0x546895['push'](_0x546895['shift']());}};_0x3b5a09(++_0xb414da);}(_0xaea5,0xc5));var _0x5aea=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xaea5[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x5aea('0x0'));var machine=require(_0x5aea('0x1'));var exec=require(_0x5aea('0x2'))[_0x5aea('0x3')];var config=require('../environment');function getInterfaces(){var _0x24ed6c=[];var _0xd0721e=os[_0x5aea('0x4')]();var _0x2e4a08=_['orderBy'](_[_0x5aea('0x5')](_0xd0721e));for(var _0x489960=0x0;_0x489960<_0x2e4a08[_0x5aea('0x6')];_0x489960++){var _0x5bb623=_0xd0721e[_0x2e4a08[_0x489960]][_0x5aea('0x7')](function(_0x2b4725){return _0x2b4725[_0x5aea('0x8')]===_0x5aea('0x9')&&_0x2b4725[_0x5aea('0xa')]===![];});_0x24ed6c=_0x24ed6c[_0x5aea('0xb')](_0x5bb623);}return _0x24ed6c;}function getFirstInterface(){var _0x2e7e7b=_[_0x5aea('0xc')](getInterfaces());return{'macAddress':_0x2e7e7b&&_0x2e7e7b['mac']?_0x2e7e7b[_0x5aea('0xd')]:'00:00:00:00:00:00','ipAddress':_0x2e7e7b&&_0x2e7e7b['address']?_0x2e7e7b[_0x5aea('0xe')]:_0x5aea('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x380f85=_[_0x5aea('0x10')](os[_0x5aea('0x11')]()['map'](function(_0x454d2f){return _0x454d2f['model'];}))[_0x5aea('0x12')](':');return crypto[_0x5aea('0x13')]('md5')[_0x5aea('0x14')](_0x380f85)[_0x5aea('0x15')](_0x5aea('0x16'));}exports['getUuid']=function(){var _0x1bf048=os['platform']();var _0x3c4900=/[0-9a-f-]{36}/;if(config[_0x5aea('0x17')]&&_0x3c4900[_0x5aea('0x18')](config[_0x5aea('0x17')])){return config[_0x5aea('0x17')];}else if(_0x1bf048===_0x5aea('0x19')){return exec(_0x5aea('0x1a'),{'encoding':_0x5aea('0x1b')})['replace']('\x0d\x0a','');}else{var _0xa59ded=getFirstInterface();var _0x33c916=getCPUhash();var _0x260db1=_0x33c916+'|'+os[_0x5aea('0x1c')]()+'|'+_0xa59ded['macAddress']+'|'+_0xa59ded[_0x5aea('0x1d')];var _0x31a4c4=crypto[_0x5aea('0x13')](_0x5aea('0x1e'))['update'](_0x260db1)[_0x5aea('0x15')]('hex');return _0x31a4c4[_0x5aea('0x1f')](0x0,0x8)+'-'+_0x31a4c4[_0x5aea('0x1f')](0x8,0xc)+'-'+_0x31a4c4[_0x5aea('0x1f')](0xc,0x10)+'-'+_0x31a4c4['substring'](0x10,0x14)+'-'+_0x31a4c4[_0x5aea('0x1f')](0x14);}}; \ No newline at end of file +var _0x9ff9=['update','platform','test','licenseToken','win32','utf8','replace','hostname','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5'];(function(_0x51b343,_0x219daf){var _0x3baf36=function(_0x65700d){while(--_0x65700d){_0x51b343['push'](_0x51b343['shift']());}};_0x3baf36(++_0x219daf);}(_0x9ff9,0x1a3));var _0x99ff=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x9ff9[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x99ff('0x0'));var os=require('os');var crypto=require(_0x99ff('0x1'));var machine=require(_0x99ff('0x2'));var exec=require(_0x99ff('0x3'))[_0x99ff('0x4')];var config=require(_0x99ff('0x5'));function getInterfaces(){var _0x2758fa=[];var _0x3b2acf=os[_0x99ff('0x6')]();var _0x988cdc=_[_0x99ff('0x7')](_[_0x99ff('0x8')](_0x3b2acf));for(var _0x259d82=0x0;_0x259d82<_0x988cdc[_0x99ff('0x9')];_0x259d82++){var _0x1ea1f5=_0x3b2acf[_0x988cdc[_0x259d82]]['filter'](function(_0x9e978d){return _0x9e978d['family']==='IPv4'&&_0x9e978d[_0x99ff('0xa')]===![];});_0x2758fa=_0x2758fa[_0x99ff('0xb')](_0x1ea1f5);}return _0x2758fa;}function getFirstInterface(){var _0x1b9bd9=_[_0x99ff('0xc')](getInterfaces());return{'macAddress':_0x1b9bd9&&_0x1b9bd9[_0x99ff('0xd')]?_0x1b9bd9['mac']:_0x99ff('0xe'),'ipAddress':_0x1b9bd9&&_0x1b9bd9[_0x99ff('0xf')]?_0x1b9bd9[_0x99ff('0xf')]:_0x99ff('0x10')};}exports[_0x99ff('0x11')]=getFirstInterface;function getCPUhash(){var _0x2a0b0f=_[_0x99ff('0x7')](os['cpus']()[_0x99ff('0x12')](function(_0x955bb5){return _0x955bb5[_0x99ff('0x13')];}))[_0x99ff('0x14')](':');return crypto[_0x99ff('0x15')](_0x99ff('0x16'))[_0x99ff('0x17')](_0x2a0b0f)['digest']('hex');}exports['getUuid']=function(){var _0x458b1f=os[_0x99ff('0x18')]();var _0x2af963=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2af963[_0x99ff('0x19')](config[_0x99ff('0x1a')])){return config[_0x99ff('0x1a')];}else if(_0x458b1f===_0x99ff('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x99ff('0x1c')})[_0x99ff('0x1d')]('\x0d\x0a','');}else{var _0x51bbca=getFirstInterface();var _0x2cb47d=getCPUhash();var _0x1d1a90=_0x2cb47d+'|'+os[_0x99ff('0x1e')]()+'|'+_0x51bbca['macAddress']+'|'+_0x51bbca['ipAddress'];var _0x5e8620=crypto[_0x99ff('0x15')]('md5')['update'](_0x1d1a90)[_0x99ff('0x1f')](_0x99ff('0x20'));return _0x5e8620[_0x99ff('0x21')](0x0,0x8)+'-'+_0x5e8620['substring'](0x8,0xc)+'-'+_0x5e8620[_0x99ff('0x21')](0xc,0x10)+'-'+_0x5e8620[_0x99ff('0x21')](0x10,0x14)+'-'+_0x5e8620[_0x99ff('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3f64a37..66a2b82 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 _0x4c03=['message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','exports','GET','then','catch','get','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error'];(function(_0x711eb4,_0x27a15c){var _0x3166ab=function(_0x42e337){while(--_0x42e337){_0x711eb4['push'](_0x711eb4['shift']());}};_0x3166ab(++_0x27a15c);}(_0x4c03,0x18d));var _0x34c0=function(_0x3278ba,_0x1c1e64){_0x3278ba=_0x3278ba-0x0;var _0x509110=_0x4c03[_0x3278ba];return _0x509110;};'use strict';var util=require(_0x34c0('0x0'));var moment=require(_0x34c0('0x1'));var rp=require(_0x34c0('0x2'));var BPromise=require(_0x34c0('0x3'));var pkginfo=require(_0x34c0('0x4'))(module,_0x34c0('0x5'));var db=require(_0x34c0('0x6'))['db'];var encryptor=require(_0x34c0('0x7'));var hardware=require(_0x34c0('0x8'));var logger=require('../logger')(_0x34c0('0x9'));var HOST=_0x34c0('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x513bad){return new BPromise(function(_0x9331d6,_0x262c95){var _0x26c046=util[_0x34c0('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x513bad,module[_0x34c0('0xc')][_0x34c0('0x5')]);if(oldToken){_0x26c046=util[_0x34c0('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x513bad,module[_0x34c0('0xc')][_0x34c0('0x5')],oldToken);}var _0x4b81a8={'uri':_0x26c046,'method':_0x34c0('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4b81a8)[_0x34c0('0xe')](function(_0x28de68){_0x9331d6(_0x28de68);})[_0x34c0('0xf')](function(_0x2b1208){_0x262c95(_0x2b1208);});});}function manageLicense(_0x54f31c,_0x382bee){var _0x51a0bb=_0x382bee[_0x34c0('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x51a0bb['data1']!==_0x54f31c&&!_0x51a0bb['data2']){oldToken=_0x51a0bb[_0x34c0('0x11')];}httpRequest(_0x54f31c)[_0x34c0('0xe')](function(_0x211339){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x211339[_0x34c0('0x12')]){isOldTokenSent=![];if(!_0x51a0bb[_0x34c0('0x9')]&&_0x51a0bb['license']!=_0x211339[_0x34c0('0x9')]||_0x51a0bb[_0x34c0('0x9')]&&_0x51a0bb['data2']){logger[_0x34c0('0x13')](_0x34c0('0x14'));}if(_0x51a0bb[_0x34c0('0x9')]&&!_0x51a0bb[_0x34c0('0x15')]&&_0x51a0bb[_0x34c0('0x9')]!=_0x211339[_0x34c0('0x9')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x51a0bb['license']&&!_0x51a0bb[_0x34c0('0x15')]&&_0x51a0bb[_0x34c0('0x9')]==_0x211339[_0x34c0('0x9')]){return _0x382bee;}return _0x382bee[_0x34c0('0x16')]({'data1':_0x54f31c,'data2':null,'license':_0x211339[_0x34c0('0x9')]});}else{if(_0x211339[_0x34c0('0x9')]||_0x51a0bb[_0x34c0('0x9')]){if(!_0x51a0bb[_0x34c0('0x15')]){if(_0x51a0bb[_0x34c0('0x11')]==_0x54f31c){GRAY_PERIOD_REASON='Disabled';logger[_0x34c0('0x13')](_0x34c0('0x17'));}else{GRAY_PERIOD_REASON=_0x34c0('0x18');logger['info'](_0x34c0('0x19'),_0x51a0bb[_0x34c0('0x11')],_0x54f31c);}logger[_0x34c0('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x34c0('0x1a')](),moment()[_0x34c0('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x382bee[_0x34c0('0x16')]({'data2':encryptor['encryptString'](moment()[_0x34c0('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x34c0('0x1b')](encryptor['decryptString'](_0x51a0bb[_0x34c0('0x15')]),_0x34c0('0x1c'))>DAYS){logger[_0x34c0('0x13')](_0x34c0('0x1d'),moment()[_0x34c0('0xb')](_0x34c0('0x1e')));isOldTokenSent=![];return _0x382bee[_0x34c0('0x16')]({'data1':_0x54f31c,'data2':null,'license':null});}}}else{if(_0x51a0bb[_0x34c0('0x11')]!=_0x54f31c){logger[_0x34c0('0x13')](_0x34c0('0x19'),_0x51a0bb['data1'],_0x54f31c);return _0x382bee[_0x34c0('0x16')]({'data1':_0x54f31c,'data2':null,'license':null});}}}return _0x382bee;})['then'](function(_0x1dea9f){_0x382bee=_0x1dea9f;})[_0x34c0('0xf')](function(_0x515d72){logger[_0x34c0('0x1f')](_0x515d72[_0x34c0('0x20')]);})[_0x34c0('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x34c0('0x22')](),_0x382bee);},TIME);});}function defaultLicense(){var _0x5e8f2b=hardware[_0x34c0('0x22')]();if(_0x5e8f2b){return db[_0x34c0('0x23')][_0x34c0('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5e8f2b}})['spread'](function(_0x4910c7,_0x3952d5){logger[_0x34c0('0x13')](_0x34c0('0x25'),_0x5e8f2b);manageLicense(_0x5e8f2b,_0x4910c7);})[_0x34c0('0xf')](function(_0x17ee02){logger[_0x34c0('0x1f')](_0x17ee02['message']);});}}exports[_0x34c0('0x26')]=defaultLicense; \ No newline at end of file +var _0xb033=['Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','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','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xb033,0x148));var _0x3b03=function(_0x38b1bc,_0x5a1de7){_0x38b1bc=_0x38b1bc-0x0;var _0x1bb441=_0xb033[_0x38b1bc];return _0x1bb441;};'use strict';var util=require(_0x3b03('0x0'));var moment=require(_0x3b03('0x1'));var rp=require(_0x3b03('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3b03('0x3'))(module,_0x3b03('0x4'));var db=require(_0x3b03('0x5'))['db'];var encryptor=require(_0x3b03('0x6'));var hardware=require(_0x3b03('0x7'));var logger=require(_0x3b03('0x8'))(_0x3b03('0x9'));var HOST=_0x3b03('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3747b6){return new BPromise(function(_0x36be9f,_0x2a0481){var _0x399b3b=util[_0x3b03('0xb')](_0x3b03('0xc'),HOST,_0x3747b6,module[_0x3b03('0xd')][_0x3b03('0x4')]);if(oldToken){_0x399b3b=util[_0x3b03('0xb')](_0x3b03('0xe'),HOST,_0x3747b6,module[_0x3b03('0xd')][_0x3b03('0x4')],oldToken);}var _0x117f3f={'uri':_0x399b3b,'method':_0x3b03('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x117f3f)[_0x3b03('0x10')](function(_0x3a34c1){_0x36be9f(_0x3a34c1);})['catch'](function(_0x2fd990){_0x2a0481(_0x2fd990);});});}function manageLicense(_0x31c548,_0x5c3d20){var _0x57334f=_0x5c3d20[_0x3b03('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x57334f[_0x3b03('0x12')]!==_0x31c548&&!_0x57334f[_0x3b03('0x13')]){oldToken=_0x57334f[_0x3b03('0x12')];}httpRequest(_0x31c548)[_0x3b03('0x10')](function(_0x2db964){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2db964[_0x3b03('0x14')]){isOldTokenSent=![];if(!_0x57334f[_0x3b03('0x9')]&&_0x57334f[_0x3b03('0x9')]!=_0x2db964[_0x3b03('0x9')]||_0x57334f['license']&&_0x57334f['data2']){logger[_0x3b03('0x15')](_0x3b03('0x16'));}if(_0x57334f['license']&&!_0x57334f['data2']&&_0x57334f[_0x3b03('0x9')]!=_0x2db964[_0x3b03('0x9')]){logger[_0x3b03('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x57334f[_0x3b03('0x9')]&&!_0x57334f[_0x3b03('0x13')]&&_0x57334f[_0x3b03('0x9')]==_0x2db964[_0x3b03('0x9')]){return _0x5c3d20;}return _0x5c3d20[_0x3b03('0x17')]({'data1':_0x31c548,'data2':null,'license':_0x2db964[_0x3b03('0x9')]});}else{if(_0x2db964[_0x3b03('0x9')]||_0x57334f[_0x3b03('0x9')]){if(!_0x57334f[_0x3b03('0x13')]){if(_0x57334f[_0x3b03('0x12')]==_0x31c548){GRAY_PERIOD_REASON=_0x3b03('0x18');logger['info'](_0x3b03('0x19'));}else{GRAY_PERIOD_REASON=_0x3b03('0x1a');logger['info'](_0x3b03('0x1b'),_0x57334f['data1'],_0x31c548);}logger[_0x3b03('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x3b03('0x1c')](),moment()[_0x3b03('0xb')](_0x3b03('0x1d')));return _0x5c3d20[_0x3b03('0x17')]({'data2':encryptor[_0x3b03('0x1e')](moment()['format'](_0x3b03('0x1d')))});}else{if(moment()[_0x3b03('0x1f')](encryptor[_0x3b03('0x20')](_0x57334f['data2']),'days')>DAYS){logger[_0x3b03('0x15')](_0x3b03('0x21'),moment()[_0x3b03('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x5c3d20['update']({'data1':_0x31c548,'data2':null,'license':null});}}}else{if(_0x57334f[_0x3b03('0x12')]!=_0x31c548){logger[_0x3b03('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x57334f['data1'],_0x31c548);return _0x5c3d20[_0x3b03('0x17')]({'data1':_0x31c548,'data2':null,'license':null});}}}return _0x5c3d20;})[_0x3b03('0x10')](function(_0x8a48c4){_0x5c3d20=_0x8a48c4;})[_0x3b03('0x22')](function(_0x1d1b5f){logger[_0x3b03('0x23')](_0x1d1b5f[_0x3b03('0x24')]);})[_0x3b03('0x25')](function(){setTimeout(function(){manageLicense(hardware[_0x3b03('0x26')](),_0x5c3d20);},TIME);});}function defaultLicense(){var _0x45e338=hardware[_0x3b03('0x26')]();if(_0x45e338){return db[_0x3b03('0x27')][_0x3b03('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x45e338}})[_0x3b03('0x29')](function(_0x50f684,_0x1bbf06){logger[_0x3b03('0x15')](_0x3b03('0x2a'),_0x45e338);manageLicense(_0x45e338,_0x50f684);})['catch'](function(_0x2848c5){logger[_0x3b03('0x23')](_0x2848c5[_0x3b03('0x24')]);});}}exports[_0x3b03('0x2b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 7cee391..71850a5 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 _0x7f3e=['COUNT','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','add','days','grayReason','changed','message','User','findAll','role','sequelize'];(function(_0x2c281a,_0x1affb6){var _0x4518b0=function(_0x47aa21){while(--_0x47aa21){_0x2c281a['push'](_0x2c281a['shift']());}};_0x4518b0(++_0x1affb6);}(_0x7f3e,0x127));var _0xe7f3=function(_0x6cc281,_0x39c359){_0x6cc281=_0x6cc281-0x0;var _0x19bd94=_0x7f3e[_0x6cc281];return _0x19bd94;};'use strict';var util=require(_0xe7f3('0x0'));var _=require(_0xe7f3('0x1'));var moment=require(_0xe7f3('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0xe7f3('0x3'));var db=require(_0xe7f3('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe7f3('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xe7f3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe7f3('0x7'),'machineUuid':hardware[_0xe7f3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4290af){return new BPromise(function(_0x117f81,_0x47b7f1){return db['License'][_0xe7f3('0x8')](_[_0xe7f3('0x9')](_0x4290af,{'raw':!![],'where':{'id':0x1}}))[_0xe7f3('0xa')](function(_0x20784d){return checkLicense(_0x20784d,null);})[_0xe7f3('0xa')](function(_0x55e4b1){_0x117f81(_0x55e4b1);return;})[_0xe7f3('0xb')](function(_0x32b854){_0x47b7f1(_0x32b854);});});}function checkLicense(_0x3dbcbb,_0x5546e7){if(!_0x3dbcbb){demoLicense[_0xe7f3('0xc')]=_0x3dbcbb[_0xe7f3('0xd')];return demoLicense;}try{var _0x2e3ec1=_0x5546e7||_0x3dbcbb[_0xe7f3('0xe')];if(_[_0xe7f3('0xf')](_0x2e3ec1)){throw new Error(_0xe7f3('0x10'));}var _0x2378e4=_0x3dbcbb[_0xe7f3('0xd')];var _0x1eed14=_0x3dbcbb[_0xe7f3('0x11')];var _0x32752c=_0x2378e4[_0xe7f3('0x12')]('-')[0x4];var _0xe37527=_0x2378e4['split']('-')[0x0];var _0x194f8d=encryptor['decryptString'](_0x2e3ec1,util[_0xe7f3('0x13')](_0xe7f3('0x14'),_0x32752c,_0x2378e4,_0xe37527));var _0x3203ba=JSON[_0xe7f3('0x15')](_0x194f8d);_0x3203ba[_0xe7f3('0x16')]=![];_0x3203ba[_0xe7f3('0xc')]=_0x2378e4;_0x3203ba[_0xe7f3('0x17')]=hardware[_0xe7f3('0x6')]();if(_0x1eed14){var _0x15e767=encryptor[_0xe7f3('0x18')](_0x1eed14);_0x3203ba['gray']=_0x15e767;_0x3203ba['deadline']=moment(_0x15e767)[_0xe7f3('0x19')](0x7,_0xe7f3('0x1a'))['format']();_0x3203ba[_0xe7f3('0x1b')]=_0x3203ba[_0xe7f3('0xc')]!=_0x3203ba['machineUuid']?_0xe7f3('0x1c'):'disabled';}return _0x3203ba;}catch(_0x5f0dc6){breakingLicense[_0xe7f3('0xc')]=_0x3dbcbb['data1'];breakingLicense[_0xe7f3('0x1d')]=_0x5f0dc6[_0xe7f3('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1d6578,_0x36857f){getLicense()[_0xe7f3('0xa')](function(_0x41bcef){return db[_0xe7f3('0x1e')][_0xe7f3('0x1f')]({'attributes':[_0xe7f3('0x20'),[db[_0xe7f3('0x21')]['fn'](_0xe7f3('0x22'),db['sequelize']['col']('role')),_0xe7f3('0x23')]],'group':_0xe7f3('0x20'),'where':{'role':{'$or':[_0xe7f3('0x24'),_0xe7f3('0x25'),_0xe7f3('0x26')]}},'raw':!![]})[_0xe7f3('0xa')](function(_0x4d1fdb){var _0x5d029e={'user':_0x41bcef[_0xe7f3('0x27')]||0x0,'telephone':_0x41bcef[_0xe7f3('0x28')]||0x0};_0x4d1fdb[_0xe7f3('0x29')](function(_0x515e83){var _0xaf2109=_0x515e83['role']===_0xe7f3('0x24')?_0xe7f3('0x25'):_0x515e83[_0xe7f3('0x20')];_0x5d029e[_0xaf2109]-=_0x515e83['count'];if(_0x5d029e[_0xaf2109]<0x0)_0x5d029e[_0xaf2109]=0x0;});_0x1d6578(_0x5d029e);return;});})[_0xe7f3('0xb')](function(_0x44a5e5){_0x36857f(_0x44a5e5);});});}function checkUserLimits(_0x28f625){return new BPromise(function(_0x3c515c,_0xef6edf){getLimits()[_0xe7f3('0xa')](function(_0x3f552f){var _0x331b90=_[_0xe7f3('0x2a')](_[_0xe7f3('0x2b')](_0x28f625,_0xe7f3('0x20')),['admin','user','telephone']);var _0x4ff265=(_0x331b90[_0xe7f3('0x24')]||0x0)+(_0x331b90[_0xe7f3('0x25')]||0x0);var _0x354398=_0x331b90[_0xe7f3('0x26')]||0x0;if(_0x4ff265>_0x3f552f['user'])return _0xef6edf(_0xe7f3('0x2c'));if(_0x354398>_0x3f552f[_0xe7f3('0x26')])return _0xef6edf(_0xe7f3('0x2d'));return _0x3c515c();})[_0xe7f3('0xb')](function(_0x3d299b){_0xef6edf(_0x3d299b);});});}module[_0xe7f3('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1404=['machineUuid','decryptString','gray','deadline','add','days','changed','disabled','message','findAll','role','COUNT','sequelize','count','admin','user','telephone','users','forEach','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','parse'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1404,0x1cf));var _0x4140=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x1404[_0x4709c0];return _0x13348b;};'use strict';var util=require('util');var _=require(_0x4140('0x0'));var moment=require(_0x4140('0x1'));var BPromise=require(_0x4140('0x2'));var hardware=require(_0x4140('0x3'));var encryptor=require(_0x4140('0x4'));var db=require(_0x4140('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':_0x4140('0x6'),'machineUuid':hardware[_0x4140('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4140('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x4140('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4eee8a){return new BPromise(function(_0x382b3c,_0x143421){return db['License'][_0x4140('0x9')](_[_0x4140('0xa')](_0x4eee8a,{'raw':!![],'where':{'id':0x1}}))[_0x4140('0xb')](function(_0x4b3ec5){return checkLicense(_0x4b3ec5,null);})[_0x4140('0xb')](function(_0x2fe507){_0x382b3c(_0x2fe507);return;})[_0x4140('0xc')](function(_0x57df7c){_0x143421(_0x57df7c);});});}function checkLicense(_0x459108,_0x50b149){if(!_0x459108){demoLicense[_0x4140('0xd')]=_0x459108[_0x4140('0xe')];return demoLicense;}try{var _0x563e47=_0x50b149||_0x459108['license'];if(_[_0x4140('0xf')](_0x563e47)){throw new Error(_0x4140('0x10'));}var _0x4e5ebd=_0x459108[_0x4140('0xe')];var _0x2873ff=_0x459108[_0x4140('0x11')];var _0x44516d=_0x4e5ebd['split']('-')[0x4];var _0x28e8dc=_0x4e5ebd[_0x4140('0x12')]('-')[0x0];var _0x1c1431=encryptor['decryptString'](_0x563e47,util[_0x4140('0x13')]('%s:%s:%s',_0x44516d,_0x4e5ebd,_0x28e8dc));var _0x1f0581=JSON[_0x4140('0x14')](_0x1c1431);_0x1f0581['demo']=![];_0x1f0581['uuid']=_0x4e5ebd;_0x1f0581[_0x4140('0x15')]=hardware[_0x4140('0x7')]();if(_0x2873ff){var _0x3db27d=encryptor[_0x4140('0x16')](_0x2873ff);_0x1f0581[_0x4140('0x17')]=_0x3db27d;_0x1f0581[_0x4140('0x18')]=moment(_0x3db27d)[_0x4140('0x19')](0x7,_0x4140('0x1a'))[_0x4140('0x13')]();_0x1f0581['grayReason']=_0x1f0581['uuid']!=_0x1f0581[_0x4140('0x15')]?_0x4140('0x1b'):_0x4140('0x1c');}return _0x1f0581;}catch(_0xccbaa3){breakingLicense[_0x4140('0xd')]=_0x459108['data1'];breakingLicense['message']=_0xccbaa3[_0x4140('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x248eb8,_0x34aed6){getLicense()[_0x4140('0xb')](function(_0x150de3){return db['User'][_0x4140('0x1e')]({'attributes':[_0x4140('0x1f'),[db['sequelize']['fn'](_0x4140('0x20'),db[_0x4140('0x21')]['col'](_0x4140('0x1f'))),_0x4140('0x22')]],'group':_0x4140('0x1f'),'where':{'role':{'$or':[_0x4140('0x23'),_0x4140('0x24'),_0x4140('0x25')]}},'raw':!![]})[_0x4140('0xb')](function(_0x3eebf5){var _0x4fe9cf={'user':_0x150de3[_0x4140('0x26')]||0x0,'telephone':_0x150de3['telephones']||0x0};_0x3eebf5[_0x4140('0x27')](function(_0x1f0a07){var _0x25cca4=_0x1f0a07['role']===_0x4140('0x23')?_0x4140('0x24'):_0x1f0a07['role'];_0x4fe9cf[_0x25cca4]-=_0x1f0a07[_0x4140('0x22')];if(_0x4fe9cf[_0x25cca4]<0x0)_0x4fe9cf[_0x25cca4]=0x0;});_0x248eb8(_0x4fe9cf);return;});})[_0x4140('0xc')](function(_0x1c2ec2){_0x34aed6(_0x1c2ec2);});});}function checkUserLimits(_0xfff16){return new BPromise(function(_0x2b392e,_0x4c14fd){getLimits()[_0x4140('0xb')](function(_0x112a46){var _0x271a7a=_[_0x4140('0x28')](_['countBy'](_0xfff16,_0x4140('0x1f')),['admin',_0x4140('0x24'),_0x4140('0x25')]);var _0x14758f=(_0x271a7a['admin']||0x0)+(_0x271a7a['user']||0x0);var _0x4a28f2=_0x271a7a['telephone']||0x0;if(_0x14758f>_0x112a46[_0x4140('0x24')])return _0x4c14fd(_0x4140('0x29'));if(_0x4a28f2>_0x112a46[_0x4140('0x25')])return _0x4c14fd(_0x4140('0x2a'));return _0x2b392e();})[_0x4140('0xc')](function(_0x4ad0e4){_0x4c14fd(_0x4ad0e4);});});}module[_0x4140('0x2b')]={'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 9a9cc74..33bc87d 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 _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xfb11[_0x5b561d];return _0x431060;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x1399=['app-id','exports','http://localhost:9000'];(function(_0x12075e,_0x475329){var _0x5a5718=function(_0x767fc2){while(--_0x767fc2){_0x12075e['push'](_0x12075e['shift']());}};_0x5a5718(++_0x475329);}(_0x1399,0x16c));var _0x9139=function(_0x2cd0e9,_0x281ef1){_0x2cd0e9=_0x2cd0e9-0x0;var _0x22ac17=_0x1399[_0x2cd0e9];return _0x22ac17;};'use strict';module[_0x9139('0x0')]={'DOMAIN':_0x9139('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x9139('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index def4882..5bcd7fb 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b80=['/var','log','xcally','%s-%s.log','message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','path','INFO'];(function(_0x1550fb,_0x267ba0){var _0x3189f3=function(_0x30b351){while(--_0x30b351){_0x1550fb['push'](_0x1550fb['shift']());}};_0x3189f3(++_0x267ba0);}(_0x5b80,0x1bd));var _0x05b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5b80[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x05b8('0x0'));var winston=require(_0x05b8('0x1'));var util=require(_0x05b8('0x2'));var path=require(_0x05b8('0x3'));var debugLevel=_0x05b8('0x4');function filename(_0xdb07ef,_0x1ba948){return path['join'](_0x05b8('0x5'),_0x05b8('0x6'),_0x05b8('0x7'),util['format'](_0x05b8('0x8'),_0xdb07ef,_0x1ba948));}function formatter(_0xdfc106,_0x1f263a){_0x1f263a[_0x05b8('0x9')]=_0x1f263a[_0x05b8('0x9')][_0x05b8('0xa')](/@@{/g,_0x05b8('0xb'))['replace'](/}@@/g,_0x05b8('0xc'))['replace'](/@{/g,'{{')[_0x05b8('0xa')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x05b8('0xd')](_0x05b8('0xe')),_0x1f263a[_0x05b8('0xf')]['toUpperCase'](),_0xdfc106,_0x1f263a[_0x05b8('0x9')]);}module[_0x05b8('0x10')]=function(_0x2d9c8b){return new winston[(_0x05b8('0x11'))]({'transports':[new winston[(_0x05b8('0x12'))][(_0x05b8('0x13'))]({'name':util[_0x05b8('0xd')](_0x05b8('0x14'),_0x2d9c8b,_0x05b8('0x15')),'filename':filename(_0x2d9c8b,_0x05b8('0x15')),'level':_0x05b8('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8c178f){return formatter(_0x2d9c8b,_0x8c178f);}}),new winston[(_0x05b8('0x12'))]['File']({'name':util[_0x05b8('0xd')]('%s-%s',_0x2d9c8b,_0x05b8('0x16')),'filename':filename(_0x2d9c8b,_0x05b8('0x16')),'level':_0x05b8('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x19784e){return formatter(_0x2d9c8b,_0x19784e);}}),new winston[(_0x05b8('0x12'))][(_0x05b8('0x17'))]({'level':process['env'][_0x05b8('0x18')]||debugLevel,'json':![],'formatter':function(_0x402957){return formatter(_0x2d9c8b,_0x402957);}})]});}; \ No newline at end of file +var _0x7144=['env','debugLevel','moment','winston','util','path','join','/var','log','xcally','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','File','%s-%s','error','transports','info','Console'];(function(_0x1ebeb2,_0x344b20){var _0x4740b3=function(_0x537142){while(--_0x537142){_0x1ebeb2['push'](_0x1ebeb2['shift']());}};_0x4740b3(++_0x344b20);}(_0x7144,0x1b2));var _0x4714=function(_0xdc2e3,_0x24e9aa){_0xdc2e3=_0xdc2e3-0x0;var _0x26c466=_0x7144[_0xdc2e3];return _0x26c466;};'use strict';var moment=require(_0x4714('0x0'));var winston=require(_0x4714('0x1'));var util=require(_0x4714('0x2'));var path=require(_0x4714('0x3'));var debugLevel='INFO';function filename(_0x119160,_0x2f8470){return path[_0x4714('0x4')](_0x4714('0x5'),_0x4714('0x6'),_0x4714('0x7'),util['format'](_0x4714('0x8'),_0x119160,_0x2f8470));}function formatter(_0x35927d,_0x269cfd){_0x269cfd[_0x4714('0x9')]=_0x269cfd['message'][_0x4714('0xa')](/@@{/g,_0x4714('0xb'))[_0x4714('0xa')](/}@@/g,_0x4714('0xc'))['replace'](/@{/g,'{{')[_0x4714('0xa')](/}@/g,'}}');return util[_0x4714('0xd')](_0x4714('0xe'),moment()['format'](_0x4714('0xf')),_0x269cfd[_0x4714('0x10')][_0x4714('0x11')](),_0x35927d,_0x269cfd[_0x4714('0x9')]);}module[_0x4714('0x12')]=function(_0x3df5f2){return new winston['Logger']({'transports':[new winston['transports'][(_0x4714('0x13'))]({'name':util[_0x4714('0xd')](_0x4714('0x14'),_0x3df5f2,_0x4714('0x15')),'filename':filename(_0x3df5f2,_0x4714('0x15')),'level':_0x4714('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x235d0a){return formatter(_0x3df5f2,_0x235d0a);}}),new winston[(_0x4714('0x16'))][(_0x4714('0x13'))]({'name':util['format'](_0x4714('0x14'),_0x3df5f2,_0x4714('0x17')),'filename':filename(_0x3df5f2,_0x4714('0x17')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x508b51){return formatter(_0x3df5f2,_0x508b51);}}),new winston[(_0x4714('0x16'))][(_0x4714('0x18'))]({'level':process[_0x4714('0x19')][_0x4714('0x1a')]||debugLevel,'json':![],'formatter':function(_0x474864){return formatter(_0x3df5f2,_0x474864);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9ef0d66..32359fb 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 _0x06cf=['agi','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','exports','express','ami','../../services/ami/index.js'];(function(_0x13ed69,_0x229161){var _0x50c72e=function(_0x4f1491){while(--_0x4f1491){_0x13ed69['push'](_0x13ed69['shift']());}};_0x50c72e(++_0x229161);}(_0x06cf,0xd9));var _0xf06c=function(_0x350eef,_0x1f89a2){_0x350eef=_0x350eef-0x0;var _0x21a99c=_0x06cf[_0x350eef];return _0x21a99c;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xf06c('0x0'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xf06c('0x1'),'script':path['join'](__dirname,_0xf06c('0x2'))},{'name':_0xf06c('0x3'),'script':path[_0xf06c('0x4')](__dirname,_0xf06c('0x5'))},{'name':_0xf06c('0x6'),'script':path[_0xf06c('0x4')](__dirname,_0xf06c('0x7'))},{'name':_0xf06c('0x8'),'script':path['join'](__dirname,_0xf06c('0x9'))},{'name':'xdr','script':path[_0xf06c('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0xf06c('0xa')]=config; \ No newline at end of file +var _0x2a75=['path','express','join','../../services/express/index.js','ami','agi','email','routing','../../services/routing/index.js','xdr','exports'];(function(_0x149ac2,_0x54bea9){var _0x149945=function(_0x4e8657){while(--_0x4e8657){_0x149ac2['push'](_0x149ac2['shift']());}};_0x149945(++_0x54bea9);}(_0x2a75,0xc6));var _0x52a7=function(_0x5ca00b,_0x34738a){_0x5ca00b=_0x5ca00b-0x0;var _0x23303b=_0x2a75[_0x5ca00b];return _0x23303b;};'use strict';var path=require(_0x52a7('0x0'));var os=require('os');var config={'apps':[{'name':_0x52a7('0x1'),'script':path[_0x52a7('0x2')](__dirname,_0x52a7('0x3'))},{'name':_0x52a7('0x4'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x52a7('0x5'),'script':path[_0x52a7('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x52a7('0x6'),'script':path[_0x52a7('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x52a7('0x7'),'script':path[_0x52a7('0x2')](__dirname,_0x52a7('0x8'))},{'name':_0x52a7('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x52a7('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8b21ddb..fd90d0c 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 _0x8a4c=['then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','start'];(function(_0xab2622,_0x582313){var _0x3ab544=function(_0x591570){while(--_0x591570){_0xab2622['push'](_0xab2622['shift']());}};_0x3ab544(++_0x582313);}(_0x8a4c,0x183));var _0xc8a4=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x8a4c[_0x136619];return _0x38c4a5;};'use strict';var pm2=require(_0xc8a4('0x0'));var BPromise=require(_0xc8a4('0x1'));var config=require(_0xc8a4('0x2'));function connect(){return new BPromise(function(_0xe659d0,_0x38cdf6){return pm2[_0xc8a4('0x3')](function(_0xce1cfb){if(_0xce1cfb){return _0x38cdf6(_0xce1cfb);}return _0xe659d0('connected');});});};exports[_0xc8a4('0x4')]=function(_0x2312ce){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x29a5c0,_0x50b48f){return pm2['start'](_0x2312ce,function(_0x743e5a,_0x733c64){if(_0x743e5a){return _0x50b48f(_0x743e5a);}pm2['disconnect']();return _0x29a5c0(_0x733c64);});});});};exports['stop']=function(_0x3a0379){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x4b9217,_0x41b0fe){return pm2[_0xc8a4('0x6')](_0x3a0379,function(_0x2c0ac9,_0x2d9bcb){if(_0x2c0ac9){return _0x41b0fe(_0x2c0ac9);}pm2[_0xc8a4('0x7')]();return _0x4b9217(_0x2d9bcb);});});});};exports[_0xc8a4('0x8')]=function(_0x21be13){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x36eec3,_0x5efc63){return pm2[_0xc8a4('0x8')](_0x21be13,function(_0x2a84b2,_0x5b0434){if(_0x2a84b2){return _0x5efc63(_0x2a84b2);}pm2[_0xc8a4('0x7')]();return _0x36eec3(_0x5b0434);});});});};exports[_0xc8a4('0x9')]=function(){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x29b9ad,_0x1c3246){return pm2[_0xc8a4('0x9')](function(_0x31ce0f,_0x383ccd){if(_0x31ce0f){return _0x1c3246(_0x31ce0f);}pm2[_0xc8a4('0x7')]();return _0x29b9ad(_0x383ccd);});});});};exports[_0xc8a4('0xa')]=function(_0x29fd6e){return connect()['then'](function(){return new BPromise(function(_0x5c48b,_0x59bac5){return pm2[_0xc8a4('0xa')](_0x29fd6e,function(_0x1130aa,_0x3e42ac){if(_0x1130aa){return _0x59bac5(_0x1130aa);}pm2[_0xc8a4('0x7')]();return _0x5c48b(_0x3e42ac);});});});};exports[_0xc8a4('0xb')]=function(_0x1c6681){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x1bf488,_0x3b96b1){return pm2['delete'](_0x1c6681,function(_0x2c792f,_0x239232){if(_0x2c792f){return _0x3b96b1(_0x2c792f);}pm2['disconnect']();return _0x1bf488(_0x239232);});});});};exports[_0xc8a4('0xc')]=function(){return connect()[_0xc8a4('0x5')](function(){return new BPromise(function(_0x10e99a,_0x17b71f){return pm2[_0xc8a4('0xc')](function(_0x238d2c){if(_0x238d2c){return _0x17b71f(_0x238d2c);}return _0x10e99a(_0xc8a4('0xd'));});});});}; \ No newline at end of file +var _0xa031=['bluebird','connect','connected','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x17aa68,_0x3fb85a){var _0x123b58=function(_0x1e4dad){while(--_0x1e4dad){_0x17aa68['push'](_0x17aa68['shift']());}};_0x123b58(++_0x3fb85a);}(_0xa031,0x1d3));var _0x1a03=function(_0x3f07c6,_0x35d30e){_0x3f07c6=_0x3f07c6-0x0;var _0x33893b=_0xa031[_0x3f07c6];return _0x33893b;};'use strict';var pm2=require(_0x1a03('0x0'));var BPromise=require(_0x1a03('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x584cf5,_0x3e9cfa){return pm2[_0x1a03('0x2')](function(_0x22c967){if(_0x22c967){return _0x3e9cfa(_0x22c967);}return _0x584cf5(_0x1a03('0x3'));});});};exports['start']=function(_0x4690b8){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0x6707a2,_0x523c2b){return pm2['start'](_0x4690b8,function(_0x594b56,_0x4c584f){if(_0x594b56){return _0x523c2b(_0x594b56);}pm2[_0x1a03('0x5')]();return _0x6707a2(_0x4c584f);});});});};exports[_0x1a03('0x6')]=function(_0x5e1164){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0xf041fb,_0x5c3547){return pm2['stop'](_0x5e1164,function(_0x1126e8,_0x450f63){if(_0x1126e8){return _0x5c3547(_0x1126e8);}pm2[_0x1a03('0x5')]();return _0xf041fb(_0x450f63);});});});};exports['restart']=function(_0x174d70){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0x2487da,_0x302826){return pm2[_0x1a03('0x7')](_0x174d70,function(_0x46f66a,_0x3a6a52){if(_0x46f66a){return _0x302826(_0x46f66a);}pm2[_0x1a03('0x5')]();return _0x2487da(_0x3a6a52);});});});};exports[_0x1a03('0x8')]=function(){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0x573f4b,_0x349535){return pm2[_0x1a03('0x8')](function(_0x18aa83,_0x4436fd){if(_0x18aa83){return _0x349535(_0x18aa83);}pm2[_0x1a03('0x5')]();return _0x573f4b(_0x4436fd);});});});};exports[_0x1a03('0x9')]=function(_0x429008){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0x901c77,_0x23c18d){return pm2[_0x1a03('0x9')](_0x429008,function(_0x1381a4,_0x1128d5){if(_0x1381a4){return _0x23c18d(_0x1381a4);}pm2['disconnect']();return _0x901c77(_0x1128d5);});});});};exports[_0x1a03('0xa')]=function(_0xf5613b){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0x2afee7,_0x3c4c16){return pm2[_0x1a03('0xa')](_0xf5613b,function(_0xad08d2,_0x32690d){if(_0xad08d2){return _0x3c4c16(_0xad08d2);}pm2[_0x1a03('0x5')]();return _0x2afee7(_0x32690d);});});});};exports[_0x1a03('0xb')]=function(){return connect()[_0x1a03('0x4')](function(){return new BPromise(function(_0xcd06ef,_0x25e777){return pm2[_0x1a03('0xb')](function(_0x5df386){if(_0x5df386){return _0x25e777(_0x5df386);}return _0xcd06ef(_0x1a03('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 1e56afb..2603fcf 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 _0x1a4a=['then','ChatInteraction','findAll','lastMsgAt','minutes','length','map','info','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x1a4a,0x8e));var _0xa1a4=function(_0x836a5c,_0x34dba2){_0x836a5c=_0x836a5c-0x0;var _0x57f9ac=_0x1a4a[_0x836a5c];return _0x57f9ac;};'use strict';var _=require(_0xa1a4('0x0'));var moment=require(_0xa1a4('0x1'));var Redis=require('ioredis');var util=require(_0xa1a4('0x2'));var config=require('../../config/environment');var db=require(_0xa1a4('0x3'))['db'];var logger=require(_0xa1a4('0x4'))(_0xa1a4('0x5'));config[_0xa1a4('0x6')]=_[_0xa1a4('0x7')](config[_0xa1a4('0x6')],{'host':_0xa1a4('0x8'),'port':0x18eb});var io=require(_0xa1a4('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x4e1a86=0x0;var _0x2d7ee2=[];return db[_0xa1a4('0xa')][_0xa1a4('0xb')]({'raw':!![],'attributes':['id',_0xa1a4('0xc')],'where':{'id':0x1}})[_0xa1a4('0xd')](function(_0x20791a){_0x4e1a86=_0x20791a[_0xa1a4('0xc')];if(_0x4e1a86){return db[_0xa1a4('0xe')][_0xa1a4('0xf')]({'raw':!![],'attributes':['id',_0xa1a4('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x20791a['chatTimeout'],_0xa1a4('0x11'))}}});}else{return[];}})['then'](function(_0x55655){if(_0x55655&&_0x55655[_0xa1a4('0x12')]){_0x2d7ee2=_[_0xa1a4('0x13')](_0x55655||[],'id');logger[_0xa1a4('0x14')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2d7ee2[_0xa1a4('0x15')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':_0xa1a4('0x16'),'closed':!![],'closedAt':moment()[_0xa1a4('0x17')](_0xa1a4('0x18'))},{'where':{'id':_0x2d7ee2}});}})['then'](function(){if(_0x2d7ee2&&_0x2d7ee2[_0xa1a4('0x12')]){logger['info'](_0xa1a4('0x19'),_0x2d7ee2[_0xa1a4('0x15')]());for(var _0x408b9f=0x0;_0x408b9f<_0x2d7ee2[_0xa1a4('0x12')];_0x408b9f++){io[_0xa1a4('0x1a')](_0xa1a4('0x1b'),{'id':_0x2d7ee2[_0x408b9f],'closed':!![]});}}})[_0xa1a4('0x1c')](function(_0x452494){logger['error'](_0xa1a4('0x1d'),_0x452494?util['inspect'](_0x452494,{'showHidden':![],'depth':null}):'');});}exports[_0xa1a4('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xddac=['chatTimeout','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','lodash','moment','../../config/environment','../logger','defaults','redis','localhost','find'];(function(_0x289df1,_0x35a92c){var _0x41be9a=function(_0x4eb497){while(--_0x4eb497){_0x289df1['push'](_0x289df1['shift']());}};_0x41be9a(++_0x35a92c);}(_0xddac,0x1db));var _0xcdda=function(_0x5cf315,_0x50ceea){_0x5cf315=_0x5cf315-0x0;var _0x276c16=_0xddac[_0x5cf315];return _0x276c16;};'use strict';var _=require(_0xcdda('0x0'));var moment=require(_0xcdda('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xcdda('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xcdda('0x3'))('schedule');config['redis']=_[_0xcdda('0x4')](config[_0xcdda('0x5')],{'host':_0xcdda('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcdda('0x5')]));function closeInteractions(){var _0x48d9e8=0x0;var _0x104c77=[];return db['Setting'][_0xcdda('0x7')]({'raw':!![],'attributes':['id',_0xcdda('0x8')],'where':{'id':0x1}})['then'](function(_0x329516){_0x48d9e8=_0x329516[_0xcdda('0x8')];if(_0x48d9e8){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xcdda('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcdda('0xa')](_0x329516[_0xcdda('0x8')],_0xcdda('0xb'))}}});}else{return[];}})['then'](function(_0x19662d){if(_0x19662d&&_0x19662d[_0xcdda('0xc')]){_0x104c77=_['map'](_0x19662d||[],'id');logger[_0xcdda('0xd')](_0xcdda('0xe'),_0x104c77[_0xcdda('0xf')]());return db[_0xcdda('0x10')][_0xcdda('0x11')]({'closeReason':'system','disposition':_0xcdda('0x12'),'closed':!![],'closedAt':moment()[_0xcdda('0x13')](_0xcdda('0x14'))},{'where':{'id':_0x104c77}});}})['then'](function(){if(_0x104c77&&_0x104c77[_0xcdda('0xc')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x104c77['join']());for(var _0x51d668=0x0;_0x51d668<_0x104c77[_0xcdda('0xc')];_0x51d668++){io[_0xcdda('0x15')]('chatInteraction:update',{'id':_0x104c77[_0x51d668],'closed':!![]});}}})[_0xcdda('0x16')](function(_0x13543d){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x13543d?util['inspect'](_0x13543d,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3108c56..732cffb 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 _0xd94f=['../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','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','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','intersection','difference','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop','stop\x20cron','update\x20cron','run','start','util','path','lodash','cron-job-manager','bluebird','../logger','schedule','../../mysqldb'];(function(_0x533f3e,_0xb58836){var _0x237847=function(_0x4355e4){while(--_0x4355e4){_0x533f3e['push'](_0x533f3e['shift']());}};_0x237847(++_0xb58836);}(_0xd94f,0x106));var _0xfd94=function(_0x259cdb,_0x3696ff){_0x259cdb=_0x259cdb-0x0;var _0x102792=_0xd94f[_0x259cdb];return _0x102792;};'use strict';var fs=require('fs');var util=require(_0xfd94('0x0'));var path=require(_0xfd94('0x1'));var _=require(_0xfd94('0x2'));var moment=require('moment');var CronJobManager=require(_0xfd94('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xfd94('0x4'));var logger=require(_0xfd94('0x5'))(_0xfd94('0x6'));var db=require(_0xfd94('0x7'))['db'];var analyticCustomReportController=require(_0xfd94('0x8'));var analyticDefaultReportController=require(_0xfd94('0x9'));var client=jayson[_0xfd94('0xa')][_0xfd94('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3e4d33,_0x566d1a){return function(){logger[_0xfd94('0xc')](_0xfd94('0xd'),_0x3e4d33[_0xfd94('0xe')]);var _0x19012d=!![];var _0x3f3b1f={'tls':{'rejectUnauthorized':![]}};if(_0x3e4d33[_0xfd94('0xf')][_0xfd94('0x10')][_0xfd94('0x11')]){_0x3f3b1f['service']=_0x3e4d33[_0xfd94('0xf')]['Smtp']['service'];}else{_0x3f3b1f[_0xfd94('0x12')]=_0x3e4d33[_0xfd94('0xf')]['Smtp']['host'];_0x3f3b1f[_0xfd94('0x13')]=_0x3e4d33['MailAccount'][_0xfd94('0x10')][_0xfd94('0x13')];_0x3f3b1f['secure']=_0x3e4d33[_0xfd94('0xf')]['Smtp']['secure'];}if(_0x3e4d33[_0xfd94('0xf')][_0xfd94('0x10')]['authentication']){_0x3f3b1f[_0xfd94('0x14')]={'user':_0x3e4d33[_0xfd94('0xf')][_0xfd94('0x10')]['user'],'pass':_0x3e4d33[_0xfd94('0xf')]['Smtp'][_0xfd94('0x15')]};}var _0x313684={'account':_0x3f3b1f,'message':{'from':util[_0xfd94('0x16')](_0xfd94('0x17'),_0x3e4d33[_0xfd94('0xf')][_0xfd94('0x18')],_0x3e4d33['MailAccount']['email']||_0x3e4d33[_0xfd94('0xf')][_0xfd94('0x10')][_0xfd94('0x19')]),'to':_0x3e4d33[_0xfd94('0xe')],'cc':_0x3e4d33['cc'],'bcc':_0x3e4d33[_0xfd94('0x1a')],'subject':util['format'](_0xfd94('0x1b'),_0x566d1a[_0xfd94('0x18')],_0x3e4d33[_0xfd94('0x1c')],_0x3e4d33[_0xfd94('0x1d')])}};var _0x1300ed=path[_0xfd94('0x1e')](__dirname,_0xfd94('0x1f'));var _0x30dc7c=_0x566d1a['savename'];var _0x2a4e78=util[_0xfd94('0x16')](_0xfd94('0x20'),path[_0xfd94('0x21')](_0x566d1a[_0xfd94('0x22')],path[_0xfd94('0x23')](_0x566d1a['savename'])),_0xfd94('0x24'));var _0x5cb452=path['join'](_0x1300ed,_0x30dc7c);var _0x430f5c=path[_0xfd94('0x1e')](_0x1300ed,_0x2a4e78);if(fs[_0xfd94('0x25')](_0x5cb452)){_0x566d1a[_0xfd94('0x26')]=_0xfd94('0x27');_0x313684[_0xfd94('0x28')][_0xfd94('0x29')]=[{'filename':_0x30dc7c,'path':_0x5cb452}];_0x313684[_0xfd94('0x28')]['text']=util[_0xfd94('0x16')](_0xfd94('0x2a'),JSON['stringify'](_0x566d1a,null,0x2));}else if(fs[_0xfd94('0x25')](_0x430f5c)){_0x566d1a[_0xfd94('0x26')]=_0xfd94('0x27');_0x313684[_0xfd94('0x28')][_0xfd94('0x29')]=[{'filename':_0x2a4e78,'path':_0x430f5c}];}else{_0x313684[_0xfd94('0x28')][_0xfd94('0x2b')]=_0xfd94('0x2c');if(!_0x3e4d33['sendIfEmpty']){_0x19012d=![];logger[_0xfd94('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x19012d){return client[_0xfd94('0x2d')]('SendMail',_0x313684)[_0xfd94('0x2e')](function(_0x320cbd){if(_0x320cbd[_0xfd94('0x2f')]){return logger[_0xfd94('0x2f')](_0xfd94('0x30'),JSON[_0xfd94('0x31')](_0x320cbd));}return logger[_0xfd94('0xc')](_0xfd94('0x32'));})[_0xfd94('0x33')](function(_0x5e4cee){return logger[_0xfd94('0x2f')](_0xfd94('0x30'),JSON['stringify'](_0x5e4cee));});}};}function handleError(){return function(_0x36b5bc){return logger[_0xfd94('0x2f')](JSON[_0xfd94('0x31')](_0x36b5bc));};}function handleResult(_0x335b69){return function(_0x2fa4ad){logger[_0xfd94('0xc')](_0xfd94('0x34'),JSON[_0xfd94('0x31')](_0x2fa4ad));if(_0x335b69[_0xfd94('0xf')]&&_0x335b69['MailAccount'][_0xfd94('0x10')]&&!_[_0xfd94('0x35')](_0x335b69[_0xfd94('0xe')])){setTimeout(handleSendEmail(_0x335b69,_0x2fa4ad),0x3c*0x3e8);}};}function handleJob(_0x233044){return function(){try{if(_[_0xfd94('0x35')](_0x233044[_0xfd94('0x1c')])){return logger[_0xfd94('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xfd94('0x35')](_0x233044[_0xfd94('0x1d')])){return logger[_0xfd94('0xc')](_0xfd94('0x36'));}var _0x576e82={'startDate':moment()['subtract'](_0x233044[_0xfd94('0x1c')],_0x233044[_0xfd94('0x1d')])['format'](_0xfd94('0x37')),'endDate':moment()[_0xfd94('0x16')](_0xfd94('0x37')),'type':_0xfd94('0x38'),'output':_0x233044['output'],'name':_0x233044[_0xfd94('0x18')]};if(!_[_0xfd94('0x35')](_0x233044[_0xfd94('0x39')])){logger[_0xfd94('0xc')](_0xfd94('0x3a'),_0x233044[_0xfd94('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x233044['DefaultReportId']},_0x576e82)[_0xfd94('0x2e')](handleResult(_0x233044))[_0xfd94('0x33')](handleError());}if(!_[_0xfd94('0x35')](_0x233044[_0xfd94('0x3b')])){logger[_0xfd94('0xc')](_0xfd94('0x3c'),_0x233044['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x233044[_0xfd94('0x3b')]},_0x576e82)[_0xfd94('0x2e')](handleResult(_0x233044))['catch'](handleError());}}catch(_0x422435){logger[_0xfd94('0x2f')](JSON[_0xfd94('0x31')](_0x422435));}return logger['info'](_0xfd94('0x3d'));};}function getJobs(_0x1952bd){var _0x46dd6a={};if(_0x1952bd){_0x46dd6a['id']=_0x1952bd;}return db[_0xfd94('0x3e')]['findAll']({'where':_0x46dd6a,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xfd94('0xe')],'include':[{'model':db[_0xfd94('0x3f')],'as':_0xfd94('0x10')}]}]})[_0xfd94('0x2e')](function(_0x2f4153){var _0x1701cf=_[_0xfd94('0x40')](manager[_0xfd94('0x41')]);var _0x61a3a1=_['map'](_0x2f4153,function(_0x4800ba){return _0x4800ba['id'][_0xfd94('0x42')]();});var _0x2ca193=_[_0xfd94('0x43')](_0x2f4153,function(_0x44e487){return _0x44e487['id'][_0xfd94('0x42')]();});var _0x270e06=_0x1952bd?_0x61a3a1:_['difference'](_0x61a3a1,_0x1701cf);var _0xeb14fd=_[_0xfd94('0x44')](_0x61a3a1,_0x1701cf);var _0x7b16f4=_[_0xfd94('0x45')](_0x1701cf,_0x61a3a1);var _0xb342ab;var _0x57e180;for(_0xb342ab=0x0;_0xb342ab<_0x7b16f4[_0xfd94('0x46')]&&!_0x1952bd;_0xb342ab+=0x1){_0x57e180=_0x7b16f4[_0xb342ab][_0xfd94('0x42')]();if(manager[_0xfd94('0x47')](_0x57e180)){manager['stop'](_0x57e180);manager[_0xfd94('0x48')](_0x57e180);logger[_0xfd94('0xc')](_0xfd94('0x49'),_0x57e180);}}logger[_0xfd94('0xc')](_0xfd94('0x4a'),JSON[_0xfd94('0x31')](_0x270e06));for(_0xb342ab=0x0;_0xb342ab<_0x270e06['length'];_0xb342ab+=0x1){_0x57e180=_0x270e06[_0xb342ab][_0xfd94('0x42')]();logger[_0xfd94('0xc')](_0xfd94('0x4b'),_0x57e180);if(_0x1952bd){logger[_0xfd94('0xc')](_0xfd94('0x4c'),_0x1952bd);logger[_0xfd94('0xc')](JSON[_0xfd94('0x31')](_0x2ca193[_0x57e180]));BPromise[_0xfd94('0x4d')]()[_0xfd94('0x2e')](handleJob(_0x2ca193[_0x57e180]));logger[_0xfd94('0xc')]('run\x20job',_0x2ca193[_0x57e180]['name'],_0x2ca193[_0x57e180][_0xfd94('0x4e')]);}else if(_0x2ca193[_0x57e180]['cron']&&_0x2ca193[_0x57e180][_0xfd94('0x4f')]&&moment()[_0xfd94('0x50')](_0x2ca193[_0x57e180][_0xfd94('0x51')],_0x2ca193[_0x57e180][_0xfd94('0x52')])){manager[_0xfd94('0x53')](_0x57e180,_0x2ca193[_0x57e180][_0xfd94('0x4e')],handleJob(_0x2ca193[_0x57e180]));manager['start'](_0x57e180);logger[_0xfd94('0xc')](_0xfd94('0x54'),_0x2ca193[_0x57e180][_0xfd94('0x18')],_0x2ca193[_0x57e180][_0xfd94('0x4e')]);}else if(manager['exists'](_0x57e180)){manager[_0xfd94('0x55')](_0x57e180);manager[_0xfd94('0x48')](_0x57e180);logger[_0xfd94('0xc')](_0xfd94('0x56'),_0x2ca193[_0x57e180][_0xfd94('0x18')],_0x2ca193[_0x57e180][_0xfd94('0x4e')]);}}for(_0xb342ab=0x0,_0x57e180;_0xb342ab<_0xeb14fd[_0xfd94('0x46')]&&!_0x1952bd;_0xb342ab+=0x1){_0x57e180=_0xeb14fd[_0xb342ab][_0xfd94('0x42')]();if(manager['exists'](_0x57e180)){if(_0x2ca193[_0x57e180][_0xfd94('0x4e')]&&_0x2ca193[_0x57e180][_0xfd94('0x4f')]&&moment()[_0xfd94('0x50')](_0x2ca193[_0x57e180][_0xfd94('0x51')],_0x2ca193[_0x57e180][_0xfd94('0x52')])){manager['update'](_0x57e180,_0x2ca193[_0x57e180][_0xfd94('0x4e')],handleJob(_0x2ca193[_0x57e180]));logger[_0xfd94('0xc')](_0xfd94('0x57'),_0x2ca193[_0x57e180][_0xfd94('0x18')],_0x2ca193[_0x57e180][_0xfd94('0x4e')]);}else{manager['stop'](_0x57e180);manager['deleteJob'](_0x57e180);logger[_0xfd94('0xc')](_0xfd94('0x56'),_0x2ca193[_0x57e180][_0xfd94('0x18')],_0x2ca193[_0x57e180][_0xfd94('0x4e')]);}}}})[_0xfd94('0x33')](function(_0xee15c5){logger[_0xfd94('0x2f')](JSON[_0xfd94('0x31')](_0xee15c5));});}exports[_0xfd94('0x58')]=function(_0xbc8ded){return getJobs(_0xbc8ded);};exports[_0xfd94('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8ee5=['cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','auth','user','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','%s.%s','basename','extname','zip','join','existsSync','status','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','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','length','exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','update','run','util','path','lodash','moment'];(function(_0x3980,_0x5874fd){var _0x54e919=function(_0x271331){while(--_0x271331){_0x3980['push'](_0x3980['shift']());}};_0x54e919(++_0x5874fd);}(_0x8ee5,0xac));var _0x58ee=function(_0x4a67c6,_0x3634fb){_0x4a67c6=_0x4a67c6-0x0;var _0x3c1927=_0x8ee5[_0x4a67c6];return _0x3c1927;};'use strict';var fs=require('fs');var util=require(_0x58ee('0x0'));var path=require(_0x58ee('0x1'));var _=require(_0x58ee('0x2'));var moment=require(_0x58ee('0x3'));var CronJobManager=require(_0x58ee('0x4'));var jayson=require(_0x58ee('0x5'));var BPromise=require(_0x58ee('0x6'));var logger=require('../logger')(_0x58ee('0x7'));var db=require(_0x58ee('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x58ee('0x9'));var client=jayson[_0x58ee('0xa')][_0x58ee('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xd2c6e1,_0xae215c){return function(){logger[_0x58ee('0xc')](_0x58ee('0xd'),_0xd2c6e1[_0x58ee('0xe')]);var _0x54c46b=!![];var _0x276933={'tls':{'rejectUnauthorized':![]}};if(_0xd2c6e1['MailAccount'][_0x58ee('0xf')][_0x58ee('0x10')]){_0x276933[_0x58ee('0x10')]=_0xd2c6e1[_0x58ee('0x11')]['Smtp'][_0x58ee('0x10')];}else{_0x276933[_0x58ee('0x12')]=_0xd2c6e1['MailAccount']['Smtp'][_0x58ee('0x12')];_0x276933[_0x58ee('0x13')]=_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xf')]['port'];_0x276933[_0x58ee('0x14')]=_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xf')][_0x58ee('0x14')];}if(_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xf')]['authentication']){_0x276933[_0x58ee('0x15')]={'user':_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xf')][_0x58ee('0x16')],'pass':_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xf')]['pass']};}var _0x2dc201={'account':_0x276933,'message':{'from':util[_0x58ee('0x17')]('\x22%s\x22\x20<%s>',_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0x18')],_0xd2c6e1[_0x58ee('0x11')][_0x58ee('0xe')]||_0xd2c6e1['MailAccount'][_0x58ee('0xf')]['user']),'to':_0xd2c6e1[_0x58ee('0xe')],'cc':_0xd2c6e1['cc'],'bcc':_0xd2c6e1[_0x58ee('0x19')],'subject':util[_0x58ee('0x17')](_0x58ee('0x1a'),_0xae215c[_0x58ee('0x18')],_0xd2c6e1[_0x58ee('0x1b')],_0xd2c6e1['subtractUnit'])}};var _0x57696c=path['join'](__dirname,'../../files/reports');var _0x21538f=_0xae215c[_0x58ee('0x1c')];var _0x1b4bfa=util[_0x58ee('0x17')](_0x58ee('0x1d'),path[_0x58ee('0x1e')](_0xae215c['savename'],path[_0x58ee('0x1f')](_0xae215c['savename'])),_0x58ee('0x20'));var _0x4a317c=path['join'](_0x57696c,_0x21538f);var _0x4c929=path[_0x58ee('0x21')](_0x57696c,_0x1b4bfa);if(fs[_0x58ee('0x22')](_0x4a317c)){_0xae215c[_0x58ee('0x23')]=_0x58ee('0x24');_0x2dc201[_0x58ee('0x25')][_0x58ee('0x26')]=[{'filename':_0x21538f,'path':_0x4a317c}];_0x2dc201[_0x58ee('0x25')]['text']=util[_0x58ee('0x17')](_0x58ee('0x27'),JSON['stringify'](_0xae215c,null,0x2));}else if(fs[_0x58ee('0x22')](_0x4c929)){_0xae215c[_0x58ee('0x23')]='Sent';_0x2dc201[_0x58ee('0x25')]['attachments']=[{'filename':_0x1b4bfa,'path':_0x4c929}];}else{_0x2dc201['message'][_0x58ee('0x28')]=_0x58ee('0x29');if(!_0xd2c6e1['sendIfEmpty']){_0x54c46b=![];logger[_0x58ee('0xc')](_0x58ee('0x2a'));}}if(_0x54c46b){return client[_0x58ee('0x2b')]('SendMail',_0x2dc201)[_0x58ee('0x2c')](function(_0x3288f5){if(_0x3288f5['error']){return logger[_0x58ee('0x2d')](_0x58ee('0x2e'),JSON[_0x58ee('0x2f')](_0x3288f5));}return logger[_0x58ee('0xc')](_0x58ee('0x30'));})['catch'](function(_0x4013bc){return logger[_0x58ee('0x2d')]('error\x20mail',JSON[_0x58ee('0x2f')](_0x4013bc));});}};}function handleError(){return function(_0x531979){return logger['error'](JSON[_0x58ee('0x2f')](_0x531979));};}function handleResult(_0x9f35d8){return function(_0x14d9f5){logger['info'](_0x58ee('0x31'),JSON[_0x58ee('0x2f')](_0x14d9f5));if(_0x9f35d8['MailAccount']&&_0x9f35d8[_0x58ee('0x11')][_0x58ee('0xf')]&&!_[_0x58ee('0x32')](_0x9f35d8[_0x58ee('0xe')])){setTimeout(handleSendEmail(_0x9f35d8,_0x14d9f5),0x3c*0x3e8);}};}function handleJob(_0x2ae03b){return function(){try{if(_[_0x58ee('0x32')](_0x2ae03b[_0x58ee('0x1b')])){return logger[_0x58ee('0xc')](_0x58ee('0x33'));}if(_[_0x58ee('0x32')](_0x2ae03b[_0x58ee('0x34')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x1238ac={'startDate':moment()[_0x58ee('0x35')](_0x2ae03b[_0x58ee('0x1b')],_0x2ae03b[_0x58ee('0x34')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x58ee('0x17')](_0x58ee('0x36')),'type':_0x58ee('0x37'),'output':_0x2ae03b[_0x58ee('0x38')],'name':_0x2ae03b[_0x58ee('0x18')]};if(!_[_0x58ee('0x32')](_0x2ae03b['DefaultReportId'])){logger[_0x58ee('0xc')](_0x58ee('0x39'),_0x2ae03b[_0x58ee('0x3a')]);return analyticDefaultReportController[_0x58ee('0x3b')]({'id':_0x2ae03b[_0x58ee('0x3a')]},_0x1238ac)['then'](handleResult(_0x2ae03b))[_0x58ee('0x3c')](handleError());}if(!_[_0x58ee('0x32')](_0x2ae03b['CustomReportId'])){logger[_0x58ee('0xc')](_0x58ee('0x3d'),_0x2ae03b[_0x58ee('0x3e')]);return analyticCustomReportController[_0x58ee('0x3b')]({'id':_0x2ae03b[_0x58ee('0x3e')]},_0x1238ac)[_0x58ee('0x2c')](handleResult(_0x2ae03b))['catch'](handleError());}}catch(_0x24839f){logger['error'](JSON[_0x58ee('0x2f')](_0x24839f));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5ede04){var _0x5eb590={};if(_0x5ede04){_0x5eb590['id']=_0x5ede04;}return db[_0x58ee('0x3f')][_0x58ee('0x40')]({'where':_0x5eb590,'include':[{'model':db[_0x58ee('0x11')],'attributes':['id',_0x58ee('0x18'),_0x58ee('0xe')],'include':[{'model':db[_0x58ee('0x41')],'as':'Smtp'}]}]})['then'](function(_0x220878){var _0x2992b3=_[_0x58ee('0x42')](manager[_0x58ee('0x43')]);var _0x35c907=_['map'](_0x220878,function(_0x3ebf89){return _0x3ebf89['id'][_0x58ee('0x44')]();});var _0x16199e=_[_0x58ee('0x45')](_0x220878,function(_0x5ead3b){return _0x5ead3b['id'][_0x58ee('0x44')]();});var _0x3ecc68=_0x5ede04?_0x35c907:_[_0x58ee('0x46')](_0x35c907,_0x2992b3);var _0x56d4c1=_['intersection'](_0x35c907,_0x2992b3);var _0x5ba4c2=_['difference'](_0x2992b3,_0x35c907);var _0x315b85;var _0x50af39;for(_0x315b85=0x0;_0x315b85<_0x5ba4c2[_0x58ee('0x47')]&&!_0x5ede04;_0x315b85+=0x1){_0x50af39=_0x5ba4c2[_0x315b85][_0x58ee('0x44')]();if(manager[_0x58ee('0x48')](_0x50af39)){manager[_0x58ee('0x49')](_0x50af39);manager[_0x58ee('0x4a')](_0x50af39);logger[_0x58ee('0xc')]('delete\x20cron',_0x50af39);}}logger[_0x58ee('0xc')](_0x58ee('0x4b'),JSON['stringify'](_0x3ecc68));for(_0x315b85=0x0;_0x315b85<_0x3ecc68[_0x58ee('0x47')];_0x315b85+=0x1){_0x50af39=_0x3ecc68[_0x315b85][_0x58ee('0x44')]();logger['info']('index',_0x50af39);if(_0x5ede04){logger[_0x58ee('0xc')](_0x58ee('0x4c'),_0x5ede04);logger[_0x58ee('0xc')](JSON[_0x58ee('0x2f')](_0x16199e[_0x50af39]));BPromise[_0x58ee('0x4d')]()[_0x58ee('0x2c')](handleJob(_0x16199e[_0x50af39]));logger['info'](_0x58ee('0x4e'),_0x16199e[_0x50af39][_0x58ee('0x18')],_0x16199e[_0x50af39][_0x58ee('0x4f')]);}else if(_0x16199e[_0x50af39][_0x58ee('0x4f')]&&_0x16199e[_0x50af39][_0x58ee('0x50')]&&moment()[_0x58ee('0x51')](_0x16199e[_0x50af39][_0x58ee('0x52')],_0x16199e[_0x50af39][_0x58ee('0x53')])){manager[_0x58ee('0x54')](_0x50af39,_0x16199e[_0x50af39][_0x58ee('0x4f')],handleJob(_0x16199e[_0x50af39]));manager[_0x58ee('0x55')](_0x50af39);logger['info']('add\x20cron',_0x16199e[_0x50af39]['name'],_0x16199e[_0x50af39]['cron']);}else if(manager[_0x58ee('0x48')](_0x50af39)){manager['stop'](_0x50af39);manager[_0x58ee('0x4a')](_0x50af39);logger[_0x58ee('0xc')]('stop\x20cron',_0x16199e[_0x50af39][_0x58ee('0x18')],_0x16199e[_0x50af39][_0x58ee('0x4f')]);}}for(_0x315b85=0x0,_0x50af39;_0x315b85<_0x56d4c1['length']&&!_0x5ede04;_0x315b85+=0x1){_0x50af39=_0x56d4c1[_0x315b85][_0x58ee('0x44')]();if(manager[_0x58ee('0x48')](_0x50af39)){if(_0x16199e[_0x50af39][_0x58ee('0x4f')]&&_0x16199e[_0x50af39][_0x58ee('0x50')]&&moment()['isBetween'](_0x16199e[_0x50af39]['startAt'],_0x16199e[_0x50af39][_0x58ee('0x53')])){manager[_0x58ee('0x56')](_0x50af39,_0x16199e[_0x50af39][_0x58ee('0x4f')],handleJob(_0x16199e[_0x50af39]));logger[_0x58ee('0xc')]('update\x20cron',_0x16199e[_0x50af39][_0x58ee('0x18')],_0x16199e[_0x50af39]['cron']);}else{manager[_0x58ee('0x49')](_0x50af39);manager[_0x58ee('0x4a')](_0x50af39);logger[_0x58ee('0xc')]('stop\x20cron',_0x16199e[_0x50af39][_0x58ee('0x18')],_0x16199e[_0x50af39][_0x58ee('0x4f')]);}}}})[_0x58ee('0x3c')](function(_0x2b561b){logger[_0x58ee('0x2d')](JSON[_0x58ee('0x2f')](_0x2b561b));});}exports[_0x58ee('0x57')]=function(_0x25ace6){return getJobs(_0x25ace6);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 1b87331..a312cf6 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 _0xddb8=['request-promise','util','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','length','transcripts','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk'];(function(_0x14fb9d,_0x22401e){var _0x44b7df=function(_0x193995){while(--_0x193995){_0x14fb9d['push'](_0x14fb9d['shift']());}};_0x44b7df(++_0x22401e);}(_0xddb8,0xd7));var _0x8ddb=function(_0x14bd3b,_0x520c24){_0x14bd3b=_0x14bd3b-0x0;var _0x6c2e03=_0xddb8[_0x14bd3b];return _0x6c2e03;};var _=require('lodash');var AWS=require(_0x8ddb('0x0'));var rp=require(_0x8ddb('0x1'));var util=require(_0x8ddb('0x2'));var BPromise=require('bluebird');var db=require(_0x8ddb('0x3'))['db'];var logger=require(_0x8ddb('0x4'))(_0x8ddb('0x5'));function getTranscriptionJob(_0xb61e9,_0x173cb3,_0x110046,_0x505f57){return new Promise(function(_0x5a52ec,_0x2ebc4b){var _0x1dcf86=new AWS['TranscribeService']({'accessKeyId':_0x173cb3,'secretAccessKey':_0xb61e9,'region':_0x110046});_0x1dcf86['getTranscriptionJob']({'TranscriptionJobName':_0x505f57},function(_0x27b901,_0x2af85c){if(_0x27b901){return _0x2ebc4b(_0x27b901);}else{return _0x5a52ec(_0x2af85c);}});});}function sentiment(_0x729998,_0x49b77e,_0x459f24,_0x21d488,_0x24d7af){return new Promise(function(_0x20ab58,_0x258ac4){var _0x53173f=new AWS[(_0x8ddb('0x6'))]({'accessKeyId':_0x49b77e,'secretAccessKey':_0x729998,'region':_0x459f24});_0x53173f[_0x8ddb('0x7')]({'Text':_0x21d488,'LanguageCode':_0x24d7af['substring'](0x0,0x2)},function(_0x2d743d,_0x14e699){if(_0x2d743d){return _0x258ac4(_0x2d743d);}else{return _0x20ab58(_0x14e699);}});});}function checkTranscribeJob(_0x36498f,_0x8f1670,_0x3f2832){var _0x2376a5;return new BPromise(function(_0xf567ca,_0x37277e){logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x9'),_0x36498f['id'],_0x36498f[_0x8ddb('0xa')]));return getTranscriptionJob(_0x3f2832[_0x8ddb('0xb')],_0x3f2832[_0x8ddb('0xc')],_0x8f1670[_0x8ddb('0xd')],_0x36498f[_0x8ddb('0xa')])[_0x8ddb('0xe')](function(_0x799e41){logger['info'](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x36498f['id'],_0x36498f[_0x8ddb('0xa')],_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')]));if(!_0x36498f['fileText']){switch(_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')]){case _0x8ddb('0x12'):var _0x26cee6={'transcribeStatus':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')],'fileUri':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x13')][_0x8ddb('0x14')]};logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x15'),_0x36498f['id']));return rp({'uri':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x13')][_0x8ddb('0x14')],'json':!![]})['then'](function(_0x42b978){logger[_0x8ddb('0x8')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x36498f['id']));if(_0x42b978&&_0x42b978[_0x8ddb('0x16')]&&_0x42b978[_0x8ddb('0x16')]['transcripts']&&_0x42b978[_0x8ddb('0x16')]['transcripts'][_0x8ddb('0x17')]){_0x26cee6['fileText']='';for(var _0x53b199=0x0;_0x53b199<_0x42b978['results'][_0x8ddb('0x18')][_0x8ddb('0x17')];_0x53b199++){_0x26cee6[_0x8ddb('0x19')]+=_0x42b978[_0x8ddb('0x16')][_0x8ddb('0x18')][_0x53b199]['transcript']+'';}}return _0x36498f[_0x8ddb('0x1a')](_0x26cee6);})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));if(!_0x36498f['tempSentiment']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x1d'));}if(!_0x8f1670['sentiment']||!_0x8f1670['sentimentAccountId']||!_0x8f1670[_0x8ddb('0x1e')]||!_0x8f1670[_0x8ddb('0x1f')]||!_0x8f1670[_0x8ddb('0x20')]){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x22'));}if(!_0x26cee6[_0x8ddb('0x19')]){throw new Error(_0x8ddb('0x23'));}if(_0x8f1670[_0x8ddb('0x24')]===_0x3f2832['id']){return _0x3f2832;}else{return db['CloudProvider'][_0x8ddb('0x25')]({'where':{'id':_settings[_0x8ddb('0x24')]}});}})['then'](function(_0x46f47a){if(!_0x46f47a){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x26'));}if(!_0x46f47a[_0x8ddb('0xb')]||!_0x46f47a[_0x8ddb('0xc')]){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x27'));}_0x2376a5=_0x46f47a;logger['info'](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x36498f['id']));return sentiment(_0x2376a5['data1'],_0x2376a5[_0x8ddb('0xc')],_0x8f1670['sentimentRegion'],_0x26cee6['fileText'],_0x8f1670[_0x8ddb('0x1f')]);})['then'](function(_0x4a1772){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x36498f['id']));return _0x36498f[_0x8ddb('0x1a')]({'sentiment':_0x4a1772['Sentiment'],'sPositive':_0x4a1772[_0x8ddb('0x28')][_0x8ddb('0x29')],'sNegative':_0x4a1772['SentimentScore'][_0x8ddb('0x2a')],'sMixed':_0x4a1772['SentimentScore'][_0x8ddb('0x2b')],'sNeutral':_0x4a1772[_0x8ddb('0x28')][_0x8ddb('0x2c')]});})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));_0xf567ca();});case _0x8ddb('0x2d'):return _0x36498f['update']({'transcribeStatus':_0x8ddb('0x2d'),'failureReason':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x2e')]})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x36498f['id']));_0xf567ca();});default:logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x2f'),_0x36498f['id']));break;}}else{return BPromise[_0x8ddb('0x30')]()[_0x8ddb('0xe')](function(){if(!_0x36498f[_0x8ddb('0x31')]){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x1d'));}if(!_0x8f1670[_0x8ddb('0x32')]||!_0x8f1670[_0x8ddb('0x24')]||!_0x8f1670['sentimentRegion']||!_0x8f1670[_0x8ddb('0x1f')]||!_0x8f1670[_0x8ddb('0x20')]){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x22'));}if(!_0x36498f[_0x8ddb('0x19')]){throw new Error(_0x8ddb('0x23'));}if(_0x8f1670[_0x8ddb('0x24')]===_0x3f2832['id']){return _0x3f2832;}else{return db[_0x8ddb('0x33')][_0x8ddb('0x25')]({'where':{'id':_settings[_0x8ddb('0x24')]}});}})[_0x8ddb('0xe')](function(_0x502f63){if(!_0x502f63){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x26'));}if(!_0x502f63['data1']||!_0x502f63[_0x8ddb('0xc')]){throw new db['Sequelize'][(_0x8ddb('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x2376a5=_0x502f63;logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x34'),_0x36498f['id']));return sentiment(_0x2376a5[_0x8ddb('0xb')],_0x2376a5['data2'],_0x8f1670[_0x8ddb('0x1e')],_0x36498f[_0x8ddb('0x19')],_0x8f1670['language']);})['then'](function(_0x234ade){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x35'),_0x36498f['id']));return _0x36498f[_0x8ddb('0x1a')]({'sentiment':_0x234ade[_0x8ddb('0x36')],'sPositive':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x29')],'sNegative':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2a')],'sMixed':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2b')],'sNeutral':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2c')],'transcribeStatus':_0x8ddb('0x12')});})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));_0xf567ca();});}})[_0x8ddb('0x37')](function(_0x50a68e){if(_0x50a68e){if(!_0x50a68e[_0x8ddb('0x38')]||_0x50a68e[_0x8ddb('0x38')]!==_0x8ddb('0x39')){logger[_0x8ddb('0x3a')](util[_0x8ddb('0xf')](_0x8ddb('0x3b'),_0x36498f['id']),util[_0x8ddb('0x3c')](_0x50a68e,{'showHidden':![],'depth':null}));}}_0xf567ca();});});}function checkTranscribe(){var _0x5dd670;var _0xd619b6;var _0x2d6e6c;return db['VoiceRecording'][_0x8ddb('0x3d')]({'where':{'transcribeStatus':_0x8ddb('0x3e')}})[_0x8ddb('0xe')](function(_0x174b87){if(!_0x174b87||!_0x174b87['length']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x3f'));}_0x5dd670=_0x174b87;return db[_0x8ddb('0x40')][_0x8ddb('0x25')]({'where':{'id':0x1}});})[_0x8ddb('0xe')](function(_0x451b4b){if(!_0x451b4b){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x41'));}_0xd619b6=_0x451b4b;if(!_0xd619b6[_0x8ddb('0x5')]||!_0xd619b6[_0x8ddb('0x42')]||!_0xd619b6[_0x8ddb('0xd')]||!_0xd619b6[_0x8ddb('0x1f')]||!_0xd619b6['bucket']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x43'));}return db[_0x8ddb('0x33')][_0x8ddb('0x25')]({'where':{'id':_0xd619b6[_0x8ddb('0x42')]}});})[_0x8ddb('0xe')](function(_0x5bb8c6){if(!_0x5bb8c6){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x26'));}if(!_0x5bb8c6['data1']||!_0x5bb8c6['data2']){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x2d6e6c=_0x5bb8c6;var _0x26b448=[];_0x5dd670[_0x8ddb('0x44')](function(_0x9ae800){_0x26b448[_0x8ddb('0x45')](checkTranscribeJob(_0x9ae800,_0xd619b6,_0x2d6e6c));});return BPromise[_0x8ddb('0x46')](_0x26b448);})[_0x8ddb('0x37')](function(_0x4220b5){if(_0x4220b5){if(!_0x4220b5[_0x8ddb('0x38')]||_0x4220b5['name']!==_0x8ddb('0x39')){logger[_0x8ddb('0x3a')](util[_0x8ddb('0x3c')](_0x4220b5,{'showHidden':![],'depth':null}));}}});}exports[_0x8ddb('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2136=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','CloudProvider','Positive','catch','name','SequelizeValidationError','error','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','push','all','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','substring','format','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x2136,0x1eb));var _0x6213=function(_0x4fcbbe,_0x55a068){_0x4fcbbe=_0x4fcbbe-0x0;var _0x2ac729=_0x2136[_0x4fcbbe];return _0x2ac729;};var _=require(_0x6213('0x0'));var AWS=require(_0x6213('0x1'));var rp=require(_0x6213('0x2'));var util=require(_0x6213('0x3'));var BPromise=require(_0x6213('0x4'));var db=require(_0x6213('0x5'))['db'];var logger=require(_0x6213('0x6'))(_0x6213('0x7'));function getTranscriptionJob(_0x41f18f,_0x2e89e8,_0x50da41,_0x458207){return new Promise(function(_0x41b760,_0x1ae2cc){var _0x49db78=new AWS[(_0x6213('0x8'))]({'accessKeyId':_0x2e89e8,'secretAccessKey':_0x41f18f,'region':_0x50da41});_0x49db78['getTranscriptionJob']({'TranscriptionJobName':_0x458207},function(_0x3604f1,_0x88e8a0){if(_0x3604f1){return _0x1ae2cc(_0x3604f1);}else{return _0x41b760(_0x88e8a0);}});});}function sentiment(_0x551a16,_0x49c38c,_0x275ba8,_0x23548f,_0x4082b0){return new Promise(function(_0x41d1db,_0x1d9bf2){var _0x2fd8d4=new AWS[(_0x6213('0x9'))]({'accessKeyId':_0x49c38c,'secretAccessKey':_0x551a16,'region':_0x275ba8});_0x2fd8d4['detectSentiment']({'Text':_0x23548f,'LanguageCode':_0x4082b0[_0x6213('0xa')](0x0,0x2)},function(_0x1c6bcf,_0x2b238e){if(_0x1c6bcf){return _0x1d9bf2(_0x1c6bcf);}else{return _0x41d1db(_0x2b238e);}});});}function checkTranscribeJob(_0x5d665a,_0x23c118,_0x23dd5b){var _0x3a7c02;return new BPromise(function(_0x26b968,_0x1ef15f){logger['info'](util[_0x6213('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5d665a['id'],_0x5d665a[_0x6213('0xc')]));return getTranscriptionJob(_0x23dd5b[_0x6213('0xd')],_0x23dd5b[_0x6213('0xe')],_0x23c118['transcribeRegion'],_0x5d665a[_0x6213('0xc')])[_0x6213('0xf')](function(_0x5ef2d6){logger['info'](util[_0x6213('0xb')](_0x6213('0x10'),_0x5d665a['id'],_0x5d665a['transcribeName'],_0x5ef2d6[_0x6213('0x11')][_0x6213('0x12')]));if(!_0x5d665a[_0x6213('0x13')]){switch(_0x5ef2d6['TranscriptionJob'][_0x6213('0x12')]){case'COMPLETED':var _0x1a9421={'transcribeStatus':_0x5ef2d6[_0x6213('0x11')]['TranscriptionJobStatus'],'fileUri':_0x5ef2d6[_0x6213('0x11')]['Transcript'][_0x6213('0x14')]};logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x16'),_0x5d665a['id']));return rp({'uri':_0x5ef2d6[_0x6213('0x11')][_0x6213('0x17')][_0x6213('0x14')],'json':!![]})[_0x6213('0xf')](function(_0x363584){logger[_0x6213('0x15')](util['format'](_0x6213('0x18'),_0x5d665a['id']));if(_0x363584&&_0x363584[_0x6213('0x19')]&&_0x363584[_0x6213('0x19')][_0x6213('0x1a')]&&_0x363584[_0x6213('0x19')][_0x6213('0x1a')][_0x6213('0x1b')]){_0x1a9421[_0x6213('0x13')]='';for(var _0x229fb0=0x0;_0x229fb0<_0x363584[_0x6213('0x19')][_0x6213('0x1a')][_0x6213('0x1b')];_0x229fb0++){_0x1a9421[_0x6213('0x13')]+=_0x363584['results']['transcripts'][_0x229fb0][_0x6213('0x1c')]+'';}}return _0x5d665a[_0x6213('0x1d')](_0x1a9421);})[_0x6213('0xf')](function(){logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x1e'),_0x5d665a['id']));if(!_0x5d665a[_0x6213('0x1f')]){throw new db[(_0x6213('0x20'))]['ValidationError'](_0x6213('0x21'));}if(!_0x23c118[_0x6213('0x22')]||!_0x23c118['sentimentAccountId']||!_0x23c118[_0x6213('0x23')]||!_0x23c118[_0x6213('0x24')]||!_0x23c118['bucket']){throw new db['Sequelize'][(_0x6213('0x25'))](_0x6213('0x26'));}if(!_0x1a9421[_0x6213('0x13')]){throw new Error(_0x6213('0x27'));}if(_0x23c118[_0x6213('0x28')]===_0x23dd5b['id']){return _0x23dd5b;}else{return db['CloudProvider'][_0x6213('0x29')]({'where':{'id':_settings[_0x6213('0x28')]}});}})[_0x6213('0xf')](function(_0x2f160b){if(!_0x2f160b){throw new db[(_0x6213('0x20'))][(_0x6213('0x25'))](_0x6213('0x2a'));}if(!_0x2f160b[_0x6213('0xd')]||!_0x2f160b[_0x6213('0xe')]){throw new db[(_0x6213('0x20'))][(_0x6213('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0x3a7c02=_0x2f160b;logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x2b'),_0x5d665a['id']));return sentiment(_0x3a7c02[_0x6213('0xd')],_0x3a7c02[_0x6213('0xe')],_0x23c118[_0x6213('0x23')],_0x1a9421[_0x6213('0x13')],_0x23c118['language']);})[_0x6213('0xf')](function(_0x240088){logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x2c'),_0x5d665a['id']));return _0x5d665a[_0x6213('0x1d')]({'sentiment':_0x240088[_0x6213('0x2d')],'sPositive':_0x240088['SentimentScore']['Positive'],'sNegative':_0x240088[_0x6213('0x2e')][_0x6213('0x2f')],'sMixed':_0x240088[_0x6213('0x2e')][_0x6213('0x30')],'sNeutral':_0x240088[_0x6213('0x2e')][_0x6213('0x31')]});})[_0x6213('0xf')](function(){logger[_0x6213('0x15')](util['format'](_0x6213('0x1e'),_0x5d665a['id']));_0x26b968();});case _0x6213('0x32'):return _0x5d665a[_0x6213('0x1d')]({'transcribeStatus':_0x6213('0x32'),'failureReason':_0x5ef2d6[_0x6213('0x11')][_0x6213('0x33')]})[_0x6213('0xf')](function(){logger['info'](util[_0x6213('0xb')](_0x6213('0x1e'),_0x5d665a['id']));_0x26b968();});default:logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x34'),_0x5d665a['id']));break;}}else{return BPromise[_0x6213('0x35')]()['then'](function(){if(!_0x5d665a[_0x6213('0x1f')]){throw new db['Sequelize'][(_0x6213('0x25'))](_0x6213('0x21'));}if(!_0x23c118['sentiment']||!_0x23c118[_0x6213('0x28')]||!_0x23c118[_0x6213('0x23')]||!_0x23c118[_0x6213('0x24')]||!_0x23c118[_0x6213('0x36')]){throw new db[(_0x6213('0x20'))][(_0x6213('0x25'))](_0x6213('0x26'));}if(!_0x5d665a['fileText']){throw new Error(_0x6213('0x27'));}if(_0x23c118['sentimentAccountId']===_0x23dd5b['id']){return _0x23dd5b;}else{return db[_0x6213('0x37')][_0x6213('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6213('0xf')](function(_0x3d0b00){if(!_0x3d0b00){throw new db['Sequelize'][(_0x6213('0x25'))](_0x6213('0x2a'));}if(!_0x3d0b00['data1']||!_0x3d0b00[_0x6213('0xe')]){throw new db['Sequelize'][(_0x6213('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0x3a7c02=_0x3d0b00;logger[_0x6213('0x15')](util[_0x6213('0xb')](_0x6213('0x2b'),_0x5d665a['id']));return sentiment(_0x3a7c02['data1'],_0x3a7c02['data2'],_0x23c118[_0x6213('0x23')],_0x5d665a['fileText'],_0x23c118[_0x6213('0x24')]);})[_0x6213('0xf')](function(_0x18c4f6){logger[_0x6213('0x15')](util['format'](_0x6213('0x2c'),_0x5d665a['id']));return _0x5d665a[_0x6213('0x1d')]({'sentiment':_0x18c4f6[_0x6213('0x2d')],'sPositive':_0x18c4f6[_0x6213('0x2e')][_0x6213('0x38')],'sNegative':_0x18c4f6[_0x6213('0x2e')][_0x6213('0x2f')],'sMixed':_0x18c4f6['SentimentScore'][_0x6213('0x30')],'sNeutral':_0x18c4f6[_0x6213('0x2e')]['Neutral'],'transcribeStatus':'COMPLETED'});})[_0x6213('0xf')](function(){logger['info'](util[_0x6213('0xb')](_0x6213('0x1e'),_0x5d665a['id']));_0x26b968();});}})[_0x6213('0x39')](function(_0x7f2e69){if(_0x7f2e69){if(!_0x7f2e69[_0x6213('0x3a')]||_0x7f2e69[_0x6213('0x3a')]!==_0x6213('0x3b')){logger[_0x6213('0x3c')](util[_0x6213('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5d665a['id']),util['inspect'](_0x7f2e69,{'showHidden':![],'depth':null}));}}_0x26b968();});});}function checkTranscribe(){var _0x37efb3;var _0x4c9247;var _0x47eadf;return db['VoiceRecording'][_0x6213('0x3d')]({'where':{'transcribeStatus':_0x6213('0x3e')}})[_0x6213('0xf')](function(_0x16661a){if(!_0x16661a||!_0x16661a['length']){throw new db[(_0x6213('0x20'))][(_0x6213('0x25'))](_0x6213('0x3f'));}_0x37efb3=_0x16661a;return db[_0x6213('0x40')][_0x6213('0x29')]({'where':{'id':0x1}});})[_0x6213('0xf')](function(_0x28394b){if(!_0x28394b){throw new db[(_0x6213('0x20'))][(_0x6213('0x25'))]('Settings\x20not\x20available');}_0x4c9247=_0x28394b;if(!_0x4c9247['transcribe']||!_0x4c9247[_0x6213('0x41')]||!_0x4c9247[_0x6213('0x42')]||!_0x4c9247['language']||!_0x4c9247[_0x6213('0x36')]){throw new db['Sequelize']['ValidationError'](_0x6213('0x43'));}return db[_0x6213('0x37')]['findOne']({'where':{'id':_0x4c9247[_0x6213('0x41')]}});})[_0x6213('0xf')](function(_0x58fce6){if(!_0x58fce6){throw new db['Sequelize']['ValidationError'](_0x6213('0x2a'));}if(!_0x58fce6[_0x6213('0xd')]||!_0x58fce6[_0x6213('0xe')]){throw new db['Sequelize']['ValidationError'](_0x6213('0x44'));}_0x47eadf=_0x58fce6;var _0x2ebedb=[];_0x37efb3[_0x6213('0x45')](function(_0xa935da){_0x2ebedb[_0x6213('0x46')](checkTranscribeJob(_0xa935da,_0x4c9247,_0x47eadf));});return BPromise[_0x6213('0x47')](_0x2ebedb);})[_0x6213('0x39')](function(_0x5a9935){if(_0x5a9935){if(!_0x5a9935['name']||_0x5a9935[_0x6213('0x3a')]!==_0x6213('0x3b')){logger[_0x6213('0x3c')](util[_0x6213('0x48')](_0x5a9935,{'showHidden':![],'depth':null}));}}});}exports[_0x6213('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 32476d2..776d54b 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 _0x9523=['length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','WhatsappInteraction','findAll','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c1b81,_0x26b5a8){var _0x16e9c4=function(_0x3456b0){while(--_0x3456b0){_0x1c1b81['push'](_0x1c1b81['shift']());}};_0x16e9c4(++_0x26b5a8);}(_0x9523,0x19c));var _0x3952=function(_0xe4293b,_0x3268d5){_0xe4293b=_0xe4293b-0x0;var _0x565fe9=_0x9523[_0xe4293b];return _0x565fe9;};'use strict';var _=require(_0x3952('0x0'));var moment=require('moment');var Redis=require(_0x3952('0x1'));var util=require(_0x3952('0x2'));var config=require(_0x3952('0x3'));var db=require(_0x3952('0x4'))['db'];var logger=require(_0x3952('0x5'))('schedule');config[_0x3952('0x6')]=_[_0x3952('0x7')](config[_0x3952('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x518341=[];return db[_0x3952('0x8')][_0x3952('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3952('0xa')](0x18,_0x3952('0xb'))}}})[_0x3952('0xc')](function(_0x3ff5b0){if(_0x3ff5b0&&_0x3ff5b0['length']){_0x518341=_[_0x3952('0xd')](_0x3ff5b0||[],'id');logger[_0x3952('0xe')](_0x3952('0xf'),_0x518341[_0x3952('0x10')]());return db['WhatsappInteraction']['update']({'closeReason':_0x3952('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x3952('0x12')](_0x3952('0x13'))},{'where':{'id':_0x518341}});}})[_0x3952('0xc')](function(){if(_0x518341&&_0x518341[_0x3952('0x14')]){logger[_0x3952('0xe')](_0x3952('0x15'),_0x518341[_0x3952('0x10')]());for(var _0x43352b=0x0;_0x43352b<_0x518341[_0x3952('0x14')];_0x43352b++){io['emit'](_0x3952('0x16'),{'id':_0x518341[_0x43352b],'closed':!![]});}}})[_0x3952('0x17')](function(_0x10111a){logger[_0x3952('0x18')](_0x3952('0x19'),_0x10111a?util[_0x3952('0x1a')](_0x10111a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x287e=['hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','format','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','subtract'];(function(_0x3babe2,_0x4b07fc){var _0xd8614b=function(_0x5eff36){while(--_0x5eff36){_0x3babe2['push'](_0x3babe2['shift']());}};_0xd8614b(++_0x4b07fc);}(_0x287e,0x1e3));var _0xe287=function(_0x498194,_0x513989){_0x498194=_0x498194-0x0;var _0x8cfd41=_0x287e[_0x498194];return _0x8cfd41;};'use strict';var _=require(_0xe287('0x0'));var moment=require(_0xe287('0x1'));var Redis=require(_0xe287('0x2'));var util=require(_0xe287('0x3'));var config=require(_0xe287('0x4'));var db=require(_0xe287('0x5'))['db'];var logger=require(_0xe287('0x6'))(_0xe287('0x7'));config[_0xe287('0x8')]=_['defaults'](config[_0xe287('0x8')],{'host':_0xe287('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x38bd18=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe287('0xa')](0x18,_0xe287('0xb'))}}})[_0xe287('0xc')](function(_0x3b1a68){if(_0x3b1a68&&_0x3b1a68[_0xe287('0xd')]){_0x38bd18=_[_0xe287('0xe')](_0x3b1a68||[],'id');logger[_0xe287('0xf')](_0xe287('0x10'),_0x38bd18[_0xe287('0x11')]());return db[_0xe287('0x12')][_0xe287('0x13')]({'closeReason':_0xe287('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xe287('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x38bd18}});}})[_0xe287('0xc')](function(){if(_0x38bd18&&_0x38bd18['length']){logger[_0xe287('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x38bd18[_0xe287('0x11')]());for(var _0x399981=0x0;_0x399981<_0x38bd18[_0xe287('0xd')];_0x399981++){io[_0xe287('0x16')](_0xe287('0x17'),{'id':_0x38bd18[_0x399981],'closed':!![]});}}})['catch'](function(_0x298641){logger['error'](_0xe287('0x18'),_0x298641?util[_0xe287('0x19')](_0x298641,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 1f7047b..9ec8ef8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe75c=['push','Innocenzo','Biondo','innocenzo.biondo','now','destroy','then','CmContact','log','finished\x20populating','contacts1','bulkCreate','contacts2','CmHopper','hopper2','util'];(function(_0x344538,_0x23f767){var _0x15b549=function(_0x276784){while(--_0x276784){_0x344538['push'](_0x344538['shift']());}};_0x15b549(++_0x23f767);}(_0xe75c,0x13f));var _0xce75=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe75c[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0xce75('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xce75('0x1')]({'id':i,'firstName':_0xce75('0x2')+i,'lastName':_0xce75('0x3')+i,'phone':0xf879fb460+i,'email':_0xce75('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xce75('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xce75('0x1')]({'id':i,'firstName':_0xce75('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xce75('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xce75('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xce75('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xce75('0x5')](),'updatedAt':Date[_0xce75('0x5')]()});}db['CmContact'][_0xce75('0x6')]({'where':{}})[_0xce75('0x7')](function(){return db[_0xce75('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0xce75('0x9')](_0xce75('0xa'),_0xce75('0xb'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db['CmHopper'][_0xce75('0xc')](hopper);})['then'](function(){console[_0xce75('0x9')](_0xce75('0xa'),'hopper1');return db[_0xce75('0x8')][_0xce75('0xc')](contacts2);})[_0xce75('0x7')](function(){console[_0xce75('0x9')](_0xce75('0xa'),_0xce75('0xd'));return db[_0xce75('0xe')]['bulkCreate'](hopper2);})['then'](function(){console[_0xce75('0x9')](_0xce75('0xa'),_0xce75('0xf'));})['catch'](function(_0x2f8809){console[_0xce75('0x9')](_0x2f8809);}); \ No newline at end of file +var _0x7714=['innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','contacts1','destroy','CmHopper','log','finished\x20populating','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo'];(function(_0x395e70,_0xdc9951){var _0xc713ff=function(_0x39fa2a){while(--_0x39fa2a){_0x395e70['push'](_0x395e70['shift']());}};_0xc713ff(++_0xdc9951);}(_0x7714,0xa6));var _0x4771=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x7714[_0x2aea9e];return _0x430b92;};'use strict';var util=require(_0x4771('0x0'));var db=require(_0x4771('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4771('0x2')]({'id':i,'firstName':_0x4771('0x3')+i,'lastName':_0x4771('0x4')+i,'phone':0xf879fb460+i,'email':_0x4771('0x5')+i+_0x4771('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4771('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4771('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4771('0x7')](),'updatedAt':Date[_0x4771('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4771('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x4771('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4771('0x7')](),'updatedAt':Date[_0x4771('0x7')]()});}db[_0x4771('0x8')]['destroy']({'where':{}})[_0x4771('0x9')](function(){return db[_0x4771('0x8')][_0x4771('0xa')](contacts);})[_0x4771('0x9')](function(){console['log']('finished\x20populating',_0x4771('0xb'));return db['CmHopper'][_0x4771('0xc')]({'where':{}});})[_0x4771('0x9')](function(){return db[_0x4771('0xd')][_0x4771('0xa')](hopper);})[_0x4771('0x9')](function(){console[_0x4771('0xe')](_0x4771('0xf'),'hopper1');return db[_0x4771('0x8')][_0x4771('0xa')](contacts2);})[_0x4771('0x9')](function(){console[_0x4771('0xe')](_0x4771('0xf'),_0x4771('0x10'));return db[_0x4771('0xd')][_0x4771('0xa')](hopper2);})[_0x4771('0x9')](function(){console[_0x4771('0xe')](_0x4771('0xf'),_0x4771('0x11'));})[_0x4771('0x12')](function(_0x52f154){console[_0x4771('0xe')](_0x52f154);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 02e4b86..63a711b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6011=['password','friend','udp','wss','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0xb5966c,_0x574e53){var _0x34508d=function(_0x354d19){while(--_0x354d19){_0xb5966c['push'](_0xb5966c['shift']());}};_0x34508d(++_0x574e53);}(_0x6011,0xe1));var _0x1601=function(_0x4c1c26,_0x3566da){_0x4c1c26=_0x4c1c26-0x0;var _0x5047a4=_0x6011[_0x4c1c26];return _0x5047a4;};'use strict';var util=require('util');var db=require(_0x1601('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1601('0x1')]({'name':util[_0x1601('0x2')](_0x1601('0x3'),_0x1601('0x4'),i),'fullname':util['format'](_0x1601('0x3'),_0x1601('0x4'),i),'email':util['format'](_0x1601('0x5'),_0x1601('0x4'),i),'role':_0x1601('0x4'),'password':_0x1601('0x6'),'internal':0xfa0+i,'type':_0x1601('0x7'),'transport':[_0x1601('0x8'),'ws',_0x1601('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x1601('0x2')](_0x1601('0x3'),'agent',i),'encryption':'yes','avpf':'yes','force_avp':_0x1601('0xa'),'icesupport':_0x1601('0xa'),'dtlsenable':_0x1601('0xa'),'dtlsverify':'no','dtlscertfile':_0x1601('0xb'),'dtlsprivatekey':_0x1601('0xc'),'dtlssetup':_0x1601('0xd'),'callerid':util[_0x1601('0x2')](_0x1601('0xe'),util[_0x1601('0x2')]('%s%s',_0x1601('0x4'),i),0xfa0+i)});}db[_0x1601('0xf')][_0x1601('0x10')](users)[_0x1601('0x11')](function(){console[_0x1601('0x12')](_0x1601('0x13'));})[_0x1601('0x14')](function(_0x4e7f34){console[_0x1601('0x12')](_0x4e7f34);}); \ No newline at end of file +var _0x4d59=['add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','log'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4d59,0x1ca));var _0x94d5=function(_0x1a95b4,_0x4917ad){_0x1a95b4=_0x1a95b4-0x0;var _0x1f57af=_0x4d59[_0x1a95b4];return _0x1f57af;};'use strict';var util=require(_0x94d5('0x0'));var db=require(_0x94d5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x94d5('0x2')]({'name':util[_0x94d5('0x3')]('%s%s','agent',i),'fullname':util['format'](_0x94d5('0x4'),_0x94d5('0x5'),i),'email':util['format'](_0x94d5('0x6'),'agent',i),'role':_0x94d5('0x5'),'password':'password','internal':0xfa0+i,'type':_0x94d5('0x7'),'transport':[_0x94d5('0x8'),'ws','wss'],'disallow':[_0x94d5('0x9')],'allow':['ulaw'],'defaultuser':util[_0x94d5('0x3')](_0x94d5('0x4'),_0x94d5('0x5'),i),'encryption':_0x94d5('0xa'),'avpf':'yes','force_avp':_0x94d5('0xa'),'icesupport':_0x94d5('0xa'),'dtlsenable':_0x94d5('0xa'),'dtlsverify':'no','dtlscertfile':_0x94d5('0xb'),'dtlsprivatekey':_0x94d5('0xc'),'dtlssetup':'actpass','callerid':util[_0x94d5('0x3')](_0x94d5('0xd'),util[_0x94d5('0x3')](_0x94d5('0x4'),_0x94d5('0x5'),i),0xfa0+i)});}db['User'][_0x94d5('0xe')](users)[_0x94d5('0xf')](function(){console[_0x94d5('0x10')](_0x94d5('0x11'));})[_0x94d5('0x12')](function(_0x109f33){console['log'](_0x109f33);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2fd71db..569d580 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed20=['DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','telephone','agent','type','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','then','resourceId','where','ivr','%s:queue:%s','length','format','handshake','query','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','SmsQueue','Trunks','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed20,0xce));var _0x0ed2=function(_0x2b8a3a,_0x351ed5){_0x2b8a3a=_0x2b8a3a-0x0;var _0x56eb10=_0xed20[_0x2b8a3a];return _0x56eb10;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var BPromise=require(_0x0ed2('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x0ed2('0x3'));var queryQueues={'attributes':['id',_0x0ed2('0x4')],'include':[{'as':_0x0ed2('0x5'),'model':db[_0x0ed2('0x6')],'attributes':['id',_0x0ed2('0x4'),_0x0ed2('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0ed2('0x4')],'where':{'role':_0x0ed2('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x0ed2('0x4')],'where':{'role':_0x0ed2('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0ed2('0x4'),_0x0ed2('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x686f75,_0x2f2248,_0x4167ee){return db[_0x0ed2('0xb')]['findOne']({'where':{'name':_0x686f75,'userProfileId':_0x2f2248},'raw':!![]})['then'](function(_0x36bd70){if(_0x36bd70){if(_0x36bd70[_0x0ed2('0xc')]){switch(_0x686f75){case _0x0ed2('0xd'):case _0x0ed2('0xe'):case _0x0ed2('0xf'):case _0x0ed2('0x10'):case _0x0ed2('0x11'):case _0x0ed2('0x12'):case _0x0ed2('0x13'):return db[_0x4167ee][_0x0ed2('0x14')](queryQueues);case _0x0ed2('0x15'):return db[_0x4167ee][_0x0ed2('0x14')](queryTelephones);case'Trunks':return db[_0x4167ee][_0x0ed2('0x14')](queryTrunks);case _0x0ed2('0x16'):return db[_0x4167ee][_0x0ed2('0x14')](queryCampaigns);}}else{return db[_0x0ed2('0x17')][_0x0ed2('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x36bd70['id']},'raw':!![]})[_0x0ed2('0x18')](function(_0x55ca){if(_0x55ca){var _0x350995={'where':{'id':_['map'](_0x55ca,_0x0ed2('0x19'))},'raw':!![]};switch(_0x4167ee){case'User':_0x350995[_0x0ed2('0x1a')][_0x0ed2('0x7')]=_0x0ed2('0x8');break;case'Campaign':_0x350995['where'][_0x0ed2('0xa')]=_0x0ed2('0x1b');break;}return db[_0x4167ee]['findAll'](_0x350995);}else{return[];}});}}else{return[];}})[_0x0ed2('0x18')](function(_0x577b66){return _0x577b66;});}function joinOrLeaveQueues(_0x25e4dc,_0x15188d,_0x4d5c76,_0x5ac0aa){_0x25e4dc[_0x15188d](util['format'](_0x0ed2('0x1c'),_0x4d5c76,_0x5ac0aa[_0x0ed2('0x4')]));if(_0x5ac0aa[_0x0ed2('0x5')]){for(var _0x1206e3=0x0;_0x1206e3<_0x5ac0aa[_0x0ed2('0x5')][_0x0ed2('0x1d')];_0x1206e3+=0x1){_0x25e4dc[_0x15188d](util[_0x0ed2('0x1e')]('user:%s',_0x5ac0aa['Agents'][_0x1206e3][_0x0ed2('0x4')]));}}}function joinOrLeave(_0x1e1ea8,_0x7a3157,_0x505321){var _0x42911c;if(_0x1e1ea8[_0x0ed2('0x1f')][_0x0ed2('0x20')]['id']){db[_0x0ed2('0x6')]['find']({'attributes':['id',_0x0ed2('0x4'),_0x0ed2('0x7'),_0x0ed2('0x21')],'where':{'id':_0x1e1ea8[_0x0ed2('0x1f')][_0x0ed2('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x0ed2('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x0ed2('0x23')],'as':_0x0ed2('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x0ed2('0x25')],'as':_0x0ed2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x0ed2('0x27')],'as':_0x0ed2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x0ed2('0x29')],'as':_0x0ed2('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x0ed2('0x2b')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x0ed2('0x18')](function(_0x5e9d4d){if(_0x5e9d4d){_0x42911c=_0x5e9d4d;_0x1e1ea8[_0x7a3157](util['format'](_0x0ed2('0x2c'),_0x5e9d4d[_0x0ed2('0x4')]));var _0x11add7=[];switch(_0x5e9d4d[_0x0ed2('0x7')]){case _0x0ed2('0x2d'):_0x1e1ea8[_0x7a3157](_0x0ed2('0x2e'));_0x1e1ea8[_0x7a3157]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x0ed2('0x2f')];}_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x31')][_0x0ed2('0x14')](queryQueues));_0x11add7['push'](db[_0x0ed2('0x32')]['findAll'](queryQueues));_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x33')]['findAll'](queryQueues));_0x11add7[_0x0ed2('0x30')](db['SmsQueue'][_0x0ed2('0x14')](queryQueues));_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x34')][_0x0ed2('0x14')](queryQueues));_0x11add7['push'](db[_0x0ed2('0x35')][_0x0ed2('0x14')](queryQueues));_0x11add7['push'](db[_0x0ed2('0x36')][_0x0ed2('0x14')](queryQueues));_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x6')][_0x0ed2('0x14')](queryTelephones));_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x37')][_0x0ed2('0x14')](queryTrunks));_0x11add7[_0x0ed2('0x30')](db[_0x0ed2('0x38')][_0x0ed2('0x14')](queryCampaigns));_0x11add7[_0x0ed2('0x30')](db['User']['findAll'](queryAgents));break;case _0x0ed2('0x39'):_0x1e1ea8[_0x7a3157]('voice:inbound');_0x1e1ea8[_0x7a3157](_0x0ed2('0x3a'));_0x11add7[_0x0ed2('0x30')](getAssociatedResources(_0x0ed2('0xd'),_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x31')));_0x11add7['push'](getAssociatedResources(_0x0ed2('0xe'),_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x32')));_0x11add7[_0x0ed2('0x30')](getAssociatedResources(_0x0ed2('0xf'),_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x33')));_0x11add7['push'](getAssociatedResources('SmsQueues',_0x5e9d4d['userProfileId'],_0x0ed2('0x3b')));_0x11add7[_0x0ed2('0x30')](getAssociatedResources(_0x0ed2('0x11'),_0x5e9d4d['userProfileId'],_0x0ed2('0x34')));_0x11add7['push'](getAssociatedResources(_0x0ed2('0x12'),_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x35')));_0x11add7[_0x0ed2('0x30')](getAssociatedResources(_0x0ed2('0x13'),_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x36')));_0x11add7['push'](getAssociatedResources('Telephones',_0x5e9d4d[_0x0ed2('0x21')],'User'));_0x11add7[_0x0ed2('0x30')](getAssociatedResources(_0x0ed2('0x3c'),_0x5e9d4d['userProfileId'],_0x0ed2('0x37')));_0x11add7[_0x0ed2('0x30')](getAssociatedResources('IvrCampaigns',_0x5e9d4d[_0x0ed2('0x21')],_0x0ed2('0x38')));_0x11add7['push'](db[_0x0ed2('0x6')]['findAll'](queryAgents));break;case _0x0ed2('0x9'):_0x1e1ea8[_0x7a3157](_0x0ed2('0x2e'));_0x1e1ea8[_0x7a3157](_0x0ed2('0x3a'));_0x11add7['push'](_0x5e9d4d['getVoiceQueues']({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7[_0x0ed2('0x30')](_0x5e9d4d[_0x0ed2('0x3d')]({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7['push'](_0x5e9d4d['getFaxQueues']({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7['push'](_0x5e9d4d[_0x0ed2('0x3e')]({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7[_0x0ed2('0x30')](_0x5e9d4d[_0x0ed2('0x3f')]({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7['push'](_0x5e9d4d[_0x0ed2('0x40')]({'attributes':['id',_0x0ed2('0x4')]}));_0x11add7['push'](_0x5e9d4d[_0x0ed2('0x41')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x11add7);}})[_0x0ed2('0x18')](function(_0x4374a9){if(_0x4374a9&&_0x4374a9[_0x0ed2('0x1d')]){for(var _0x27fb48=0x0;_0x27fb48<_0x4374a9[_0x0ed2('0x1d')];_0x27fb48+=0x1){for(var _0x56ee63=0x0;_0x56ee63<_0x4374a9[_0x27fb48]['length'];_0x56ee63+=0x1){switch(_0x27fb48){case 0x0:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x42'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x1:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x43'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x2:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x44'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x3:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x45'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x4:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x46'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x5:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x47'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x6:joinOrLeaveQueues(_0x1e1ea8,_0x7a3157,_0x0ed2('0x48'),_0x4374a9[_0x27fb48][_0x56ee63]);break;case 0x7:if(_0x42911c[_0x0ed2('0x7')]!==_0x0ed2('0x9'))_0x1e1ea8[_0x7a3157](util[_0x0ed2('0x1e')](_0x0ed2('0x49'),_0x4374a9[_0x27fb48][_0x56ee63][_0x0ed2('0x4')]));break;case 0x8:if(_0x42911c[_0x0ed2('0x7')]!==_0x0ed2('0x9'))_0x1e1ea8[_0x7a3157](util[_0x0ed2('0x1e')](_0x0ed2('0x4a'),_0x4374a9[_0x27fb48][_0x56ee63][_0x0ed2('0x4')]));break;case 0x9:if(_0x42911c['role']!==_0x0ed2('0x9'))_0x1e1ea8[_0x7a3157](util[_0x0ed2('0x1e')](_0x0ed2('0x4b'),_0x4374a9[_0x27fb48][_0x56ee63]['type'],_0x4374a9[_0x27fb48][_0x56ee63][_0x0ed2('0x4')]));break;case 0xa:_0x1e1ea8[_0x7a3157](util['format'](_0x0ed2('0x2c'),_0x4374a9[_0x27fb48][_0x56ee63]['name']));break;}}}}})[_0x0ed2('0x18')](function(){if(_0x7a3157===_0x0ed2('0x4c')){var _0x1e44c8=_[_0x0ed2('0x4d')](_0x42911c['ChatInteractions'],'id');return _0x42911c['removeChatInteractions'](_0x1e44c8)[_0x0ed2('0x18')](function(){for(var _0x5e5fe4=0x0;_0x5e5fe4<_0x1e44c8[_0x0ed2('0x1d')];_0x5e5fe4+=0x1){_0x505321[_0x0ed2('0x4e')](_0x0ed2('0x4f'),{'ChatInteractionId':Number(_0x1e44c8[_0x5e5fe4]),'UserId':Number(_0x42911c['id'])});}});}})['then'](function(){if(_0x7a3157===_0x0ed2('0x4c')){var _0x478a23=_[_0x0ed2('0x4d')](_0x42911c[_0x0ed2('0x24')],'id');return _0x42911c[_0x0ed2('0x50')](_0x478a23)[_0x0ed2('0x18')](function(){for(var _0x219944=0x0;_0x219944<_0x478a23[_0x0ed2('0x1d')];_0x219944+=0x1){_0x505321[_0x0ed2('0x4e')](_0x0ed2('0x51'),{'MailInteractionId':Number(_0x478a23[_0x219944]),'UserId':Number(_0x42911c['id'])});}});}})['then'](function(){if(_0x7a3157===_0x0ed2('0x4c')){var _0x45d75a=_[_0x0ed2('0x4d')](_0x42911c[_0x0ed2('0x26')],'id');return _0x42911c[_0x0ed2('0x52')](_0x45d75a)[_0x0ed2('0x18')](function(){for(var _0x17dd89=0x0;_0x17dd89<_0x45d75a[_0x0ed2('0x1d')];_0x17dd89+=0x1){_0x505321[_0x0ed2('0x4e')](_0x0ed2('0x53'),{'FaxInteractionId':Number(_0x45d75a[_0x17dd89]),'UserId':Number(_0x42911c['id'])});}});}})['then'](function(){if(_0x7a3157===_0x0ed2('0x4c')){var _0x2509e3=_[_0x0ed2('0x4d')](_0x42911c[_0x0ed2('0x28')],'id');return _0x42911c[_0x0ed2('0x54')](_0x2509e3)[_0x0ed2('0x18')](function(){for(var _0x3489cf=0x0;_0x3489cf<_0x2509e3[_0x0ed2('0x1d')];_0x3489cf+=0x1){_0x505321[_0x0ed2('0x4e')](_0x0ed2('0x55'),{'SmsInteractionId':Number(_0x2509e3[_0x3489cf]),'UserId':Number(_0x42911c['id'])});}});}})[_0x0ed2('0x18')](function(){if(_0x7a3157==='leave'){var _0x18a0e7=_['map'](_0x42911c['OpenchannelInteractions'],'id');return _0x42911c[_0x0ed2('0x56')](_0x18a0e7)['then'](function(){for(var _0x29ba9a=0x0;_0x29ba9a<_0x18a0e7[_0x0ed2('0x1d')];_0x29ba9a+=0x1){_0x505321['emit'](_0x0ed2('0x57'),{'OpenchannelInteractionId':Number(_0x18a0e7[_0x29ba9a]),'UserId':Number(_0x42911c['id'])});}});}})['then'](function(){if(_0x7a3157===_0x0ed2('0x4c')){var _0x281a30=_[_0x0ed2('0x4d')](_0x42911c[_0x0ed2('0x58')],'id');return _0x42911c[_0x0ed2('0x59')](_0x281a30)[_0x0ed2('0x18')](function(){for(var _0x5bb4d6=0x0;_0x5bb4d6<_0x281a30[_0x0ed2('0x1d')];_0x5bb4d6+=0x1){_0x505321[_0x0ed2('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x281a30[_0x5bb4d6]),'UserId':Number(_0x42911c['id'])});}});}})[_0x0ed2('0x5a')](function(_0x1d49d0){_0x1e1ea8[_0x0ed2('0x5b')](_0x1d49d0);});}}function onDisconnect(_0x104572,_0x5984d9){joinOrLeave(_0x104572,_0x0ed2('0x4c'),_0x5984d9);}function onConnect(_0x568547){joinOrLeave(_0x568547,_0x0ed2('0x5c'));}exports['default']=function(_0x2f2ec2){_0x2f2ec2['on'](_0x0ed2('0x5d'),function(_0x5c28c7){_0x5c28c7[_0x0ed2('0x5e')](0x0);_0x5c28c7[_0x0ed2('0x5f')]=_0x5c28c7[_0x0ed2('0x60')][_0x0ed2('0x5d')][_0x0ed2('0x61')]+':'+_0x5c28c7[_0x0ed2('0x60')][_0x0ed2('0x5d')][_0x0ed2('0x62')];_0x5c28c7[_0x0ed2('0x63')]=new Date();_0x5c28c7[_0x0ed2('0x5b')]=function(_0x3a9930){console['log']('SocketIO\x20'+_0x5c28c7['nsp'][_0x0ed2('0x4')]+'['+_0x5c28c7[_0x0ed2('0x5f')]+']',_0x3a9930);};_0x5c28c7['on']('disconnect',function(){onDisconnect(_0x5c28c7,_0x2f2ec2);_0x5c28c7[_0x0ed2('0x5b')](_0x0ed2('0x64'));});onConnect(_0x5c28c7);_0x5c28c7[_0x0ed2('0x5b')](_0x0ed2('0x65'));});}; \ No newline at end of file +var _0x7156=['remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','util','bluebird','./environment','name','Agents','User','agent','telephone','type','findOne','then','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','map','where','role','Campaign','ivr','format','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','VoiceQueue','ChatQueue','FaxQueues','FaxQueue','WhatsappQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x7156,0x122));var _0x6715=function(_0x59bfdd,_0x55c3f8){_0x59bfdd=_0x59bfdd-0x0;var _0x5ea4ea=_0x7156[_0x59bfdd];return _0x5ea4ea;};'use strict';var _=require('lodash');var util=require(_0x6715('0x0'));var BPromise=require(_0x6715('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x6715('0x2'));var queryQueues={'attributes':['id',_0x6715('0x3')],'include':[{'as':_0x6715('0x4'),'model':db[_0x6715('0x5')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x6715('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6715('0x3')],'where':{'role':_0x6715('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x6715('0x3')],'where':{'role':_0x6715('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6715('0x3'),_0x6715('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x469816,_0x470a02,_0x1c418a){return db['UserProfileSection'][_0x6715('0x9')]({'where':{'name':_0x469816,'userProfileId':_0x470a02},'raw':!![]})[_0x6715('0xa')](function(_0x530261){if(_0x530261){if(_0x530261['autoAssociation']){switch(_0x469816){case'VoiceQueues':case _0x6715('0xb'):case'FaxQueues':case _0x6715('0xc'):case _0x6715('0xd'):case _0x6715('0xe'):case'WhatsappQueues':return db[_0x1c418a][_0x6715('0xf')](queryQueues);case _0x6715('0x10'):return db[_0x1c418a][_0x6715('0xf')](queryTelephones);case _0x6715('0x11'):return db[_0x1c418a][_0x6715('0xf')](queryTrunks);case _0x6715('0x12'):return db[_0x1c418a][_0x6715('0xf')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x530261['id']},'raw':!![]})[_0x6715('0xa')](function(_0x535cc5){if(_0x535cc5){var _0x57fc60={'where':{'id':_[_0x6715('0x13')](_0x535cc5,'resourceId')},'raw':!![]};switch(_0x1c418a){case _0x6715('0x5'):_0x57fc60[_0x6715('0x14')][_0x6715('0x15')]='telephone';break;case _0x6715('0x16'):_0x57fc60[_0x6715('0x14')]['type']=_0x6715('0x17');break;}return db[_0x1c418a][_0x6715('0xf')](_0x57fc60);}else{return[];}});}}else{return[];}})['then'](function(_0x142deb){return _0x142deb;});}function joinOrLeaveQueues(_0x30dbb7,_0x154de8,_0x41a717,_0x3b5241){_0x30dbb7[_0x154de8](util[_0x6715('0x18')]('%s:queue:%s',_0x41a717,_0x3b5241[_0x6715('0x3')]));if(_0x3b5241[_0x6715('0x4')]){for(var _0x3dd4cc=0x0;_0x3dd4cc<_0x3b5241[_0x6715('0x4')]['length'];_0x3dd4cc+=0x1){_0x30dbb7[_0x154de8](util[_0x6715('0x18')](_0x6715('0x19'),_0x3b5241[_0x6715('0x4')][_0x3dd4cc][_0x6715('0x3')]));}}}function joinOrLeave(_0x54f5d0,_0x3aced5,_0x7e6beb){var _0x50acc3;if(_0x54f5d0[_0x6715('0x1a')]['query']['id']){db[_0x6715('0x5')]['find']({'attributes':['id',_0x6715('0x3'),'role',_0x6715('0x1b')],'where':{'id':_0x54f5d0[_0x6715('0x1a')][_0x6715('0x1c')]['id']},'include':[{'model':db[_0x6715('0x1d')],'as':_0x6715('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x6715('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x6715('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x6715('0x21')],'as':_0x6715('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x6715('0x23')],'as':_0x6715('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6715('0x25')],'as':_0x6715('0x26'),'attributes':['id'],'raw':!![]}]})[_0x6715('0xa')](function(_0x35c21b){if(_0x35c21b){_0x50acc3=_0x35c21b;_0x54f5d0[_0x3aced5](util[_0x6715('0x18')](_0x6715('0x19'),_0x35c21b[_0x6715('0x3')]));var _0x2edc88=[];switch(_0x35c21b['role']){case _0x6715('0x27'):_0x54f5d0[_0x3aced5](_0x6715('0x28'));_0x54f5d0[_0x3aced5](_0x6715('0x29'));if(queryQueues[_0x6715('0x2a')](_0x6715('0x2b'))){delete queryQueues[_0x6715('0x2b')];}_0x2edc88[_0x6715('0x2c')](db['VoiceQueue'][_0x6715('0xf')](queryQueues));_0x2edc88[_0x6715('0x2c')](db['ChatQueue'][_0x6715('0xf')](queryQueues));_0x2edc88[_0x6715('0x2c')](db['FaxQueue'][_0x6715('0xf')](queryQueues));_0x2edc88[_0x6715('0x2c')](db['SmsQueue']['findAll'](queryQueues));_0x2edc88[_0x6715('0x2c')](db[_0x6715('0x2d')]['findAll'](queryQueues));_0x2edc88[_0x6715('0x2c')](db[_0x6715('0x2e')][_0x6715('0xf')](queryQueues));_0x2edc88[_0x6715('0x2c')](db[_0x6715('0x2f')][_0x6715('0xf')](queryQueues));_0x2edc88[_0x6715('0x2c')](db['User'][_0x6715('0xf')](queryTelephones));_0x2edc88[_0x6715('0x2c')](db[_0x6715('0x30')][_0x6715('0xf')](queryTrunks));_0x2edc88['push'](db[_0x6715('0x16')]['findAll'](queryCampaigns));_0x2edc88[_0x6715('0x2c')](db['User'][_0x6715('0xf')](queryAgents));break;case _0x6715('0x31'):_0x54f5d0[_0x3aced5](_0x6715('0x28'));_0x54f5d0[_0x3aced5](_0x6715('0x29'));_0x2edc88['push'](getAssociatedResources(_0x6715('0x32'),_0x35c21b[_0x6715('0x1b')],_0x6715('0x33')));_0x2edc88[_0x6715('0x2c')](getAssociatedResources('ChatQueues',_0x35c21b['userProfileId'],_0x6715('0x34')));_0x2edc88['push'](getAssociatedResources(_0x6715('0x35'),_0x35c21b['userProfileId'],_0x6715('0x36')));_0x2edc88[_0x6715('0x2c')](getAssociatedResources('SmsQueues',_0x35c21b[_0x6715('0x1b')],'SmsQueue'));_0x2edc88[_0x6715('0x2c')](getAssociatedResources(_0x6715('0xd'),_0x35c21b['userProfileId'],'MailQueue'));_0x2edc88[_0x6715('0x2c')](getAssociatedResources('OpenchannelQueues',_0x35c21b[_0x6715('0x1b')],_0x6715('0x2e')));_0x2edc88['push'](getAssociatedResources(_0x6715('0x37'),_0x35c21b[_0x6715('0x1b')],_0x6715('0x2f')));_0x2edc88[_0x6715('0x2c')](getAssociatedResources('Telephones',_0x35c21b[_0x6715('0x1b')],_0x6715('0x5')));_0x2edc88[_0x6715('0x2c')](getAssociatedResources(_0x6715('0x11'),_0x35c21b[_0x6715('0x1b')],_0x6715('0x30')));_0x2edc88[_0x6715('0x2c')](getAssociatedResources(_0x6715('0x12'),_0x35c21b[_0x6715('0x1b')],_0x6715('0x16')));_0x2edc88['push'](db['User'][_0x6715('0xf')](queryAgents));break;case _0x6715('0x6'):_0x54f5d0[_0x3aced5](_0x6715('0x28'));_0x54f5d0[_0x3aced5](_0x6715('0x29'));_0x2edc88[_0x6715('0x2c')](_0x35c21b['getVoiceQueues']({'attributes':['id',_0x6715('0x3')]}));_0x2edc88[_0x6715('0x2c')](_0x35c21b[_0x6715('0x38')]({'attributes':['id',_0x6715('0x3')]}));_0x2edc88[_0x6715('0x2c')](_0x35c21b[_0x6715('0x39')]({'attributes':['id',_0x6715('0x3')]}));_0x2edc88['push'](_0x35c21b['getSmsQueues']({'attributes':['id',_0x6715('0x3')]}));_0x2edc88[_0x6715('0x2c')](_0x35c21b['getMailQueues']({'attributes':['id',_0x6715('0x3')]}));_0x2edc88[_0x6715('0x2c')](_0x35c21b[_0x6715('0x3a')]({'attributes':['id',_0x6715('0x3')]}));_0x2edc88['push'](_0x35c21b[_0x6715('0x3b')]({'attributes':['id','name']}));break;}return BPromise[_0x6715('0x3c')](_0x2edc88);}})[_0x6715('0xa')](function(_0x371e43){if(_0x371e43&&_0x371e43[_0x6715('0x3d')]){for(var _0x9f8e19=0x0;_0x9f8e19<_0x371e43['length'];_0x9f8e19+=0x1){for(var _0x28a3a1=0x0;_0x28a3a1<_0x371e43[_0x9f8e19]['length'];_0x28a3a1+=0x1){switch(_0x9f8e19){case 0x0:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x3e'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x1:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x3f'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x2:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x40'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x3:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x41'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x4:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x42'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x5:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x43'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x6:joinOrLeaveQueues(_0x54f5d0,_0x3aced5,_0x6715('0x44'),_0x371e43[_0x9f8e19][_0x28a3a1]);break;case 0x7:if(_0x50acc3[_0x6715('0x15')]!==_0x6715('0x6'))_0x54f5d0[_0x3aced5](util['format'](_0x6715('0x45'),_0x371e43[_0x9f8e19][_0x28a3a1][_0x6715('0x3')]));break;case 0x8:if(_0x50acc3[_0x6715('0x15')]!==_0x6715('0x6'))_0x54f5d0[_0x3aced5](util[_0x6715('0x18')]('trunk:%s',_0x371e43[_0x9f8e19][_0x28a3a1]['name']));break;case 0x9:if(_0x50acc3[_0x6715('0x15')]!=='agent')_0x54f5d0[_0x3aced5](util['format'](_0x6715('0x46'),_0x371e43[_0x9f8e19][_0x28a3a1][_0x6715('0x8')],_0x371e43[_0x9f8e19][_0x28a3a1][_0x6715('0x3')]));break;case 0xa:_0x54f5d0[_0x3aced5](util[_0x6715('0x18')](_0x6715('0x19'),_0x371e43[_0x9f8e19][_0x28a3a1]['name']));break;}}}}})[_0x6715('0xa')](function(){if(_0x3aced5===_0x6715('0x47')){var _0x140da8=_['map'](_0x50acc3[_0x6715('0x1e')],'id');return _0x50acc3['removeChatInteractions'](_0x140da8)[_0x6715('0xa')](function(){for(var _0x2313de=0x0;_0x2313de<_0x140da8[_0x6715('0x3d')];_0x2313de+=0x1){_0x7e6beb[_0x6715('0x48')](_0x6715('0x49'),{'ChatInteractionId':Number(_0x140da8[_0x2313de]),'UserId':Number(_0x50acc3['id'])});}});}})['then'](function(){if(_0x3aced5==='leave'){var _0x114b41=_[_0x6715('0x13')](_0x50acc3['MailInteractions'],'id');return _0x50acc3[_0x6715('0x4a')](_0x114b41)[_0x6715('0xa')](function(){for(var _0x4868bd=0x0;_0x4868bd<_0x114b41[_0x6715('0x3d')];_0x4868bd+=0x1){_0x7e6beb['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x114b41[_0x4868bd]),'UserId':Number(_0x50acc3['id'])});}});}})[_0x6715('0xa')](function(){if(_0x3aced5===_0x6715('0x47')){var _0x4ca678=_[_0x6715('0x13')](_0x50acc3[_0x6715('0x20')],'id');return _0x50acc3[_0x6715('0x4b')](_0x4ca678)['then'](function(){for(var _0x2374d4=0x0;_0x2374d4<_0x4ca678['length'];_0x2374d4+=0x1){_0x7e6beb[_0x6715('0x48')](_0x6715('0x4c'),{'FaxInteractionId':Number(_0x4ca678[_0x2374d4]),'UserId':Number(_0x50acc3['id'])});}});}})['then'](function(){if(_0x3aced5===_0x6715('0x47')){var _0x27d9c9=_['map'](_0x50acc3['SmsInteractions'],'id');return _0x50acc3[_0x6715('0x4d')](_0x27d9c9)['then'](function(){for(var _0xe9baad=0x0;_0xe9baad<_0x27d9c9[_0x6715('0x3d')];_0xe9baad+=0x1){_0x7e6beb['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x27d9c9[_0xe9baad]),'UserId':Number(_0x50acc3['id'])});}});}})[_0x6715('0xa')](function(){if(_0x3aced5===_0x6715('0x47')){var _0x53dea0=_[_0x6715('0x13')](_0x50acc3[_0x6715('0x24')],'id');return _0x50acc3[_0x6715('0x4e')](_0x53dea0)[_0x6715('0xa')](function(){for(var _0x204500=0x0;_0x204500<_0x53dea0[_0x6715('0x3d')];_0x204500+=0x1){_0x7e6beb[_0x6715('0x48')](_0x6715('0x4f'),{'OpenchannelInteractionId':Number(_0x53dea0[_0x204500]),'UserId':Number(_0x50acc3['id'])});}});}})[_0x6715('0xa')](function(){if(_0x3aced5===_0x6715('0x47')){var _0x56a628=_['map'](_0x50acc3[_0x6715('0x26')],'id');return _0x50acc3[_0x6715('0x50')](_0x56a628)[_0x6715('0xa')](function(){for(var _0x63e186=0x0;_0x63e186<_0x56a628['length'];_0x63e186+=0x1){_0x7e6beb[_0x6715('0x48')](_0x6715('0x51'),{'WhatsappInteractionId':Number(_0x56a628[_0x63e186]),'UserId':Number(_0x50acc3['id'])});}});}})[_0x6715('0x52')](function(_0x24be16){_0x54f5d0[_0x6715('0x53')](_0x24be16);});}}function onDisconnect(_0x371672,_0x5c5f78){joinOrLeave(_0x371672,_0x6715('0x47'),_0x5c5f78);}function onConnect(_0x535d94){joinOrLeave(_0x535d94,'join');}exports[_0x6715('0x54')]=function(_0x227ec){_0x227ec['on'](_0x6715('0x55'),function(_0x5acd8b){_0x5acd8b[_0x6715('0x56')](0x0);_0x5acd8b[_0x6715('0x57')]=_0x5acd8b[_0x6715('0x58')][_0x6715('0x55')][_0x6715('0x59')]+':'+_0x5acd8b['request'][_0x6715('0x55')][_0x6715('0x5a')];_0x5acd8b[_0x6715('0x5b')]=new Date();_0x5acd8b[_0x6715('0x53')]=function(_0x2a6659){console[_0x6715('0x53')]('SocketIO\x20'+_0x5acd8b[_0x6715('0x5c')][_0x6715('0x3')]+'['+_0x5acd8b[_0x6715('0x57')]+']',_0x2a6659);};_0x5acd8b['on']('disconnect',function(){onDisconnect(_0x5acd8b,_0x227ec);_0x5acd8b[_0x6715('0x53')](_0x6715('0x5d'));});onConnect(_0x5acd8b);_0x5acd8b[_0x6715('0x53')](_0x6715('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index f1f46bb..7cb2e6d 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 _0x5ec3=['closed','substatus','get','find','fullname','email','internal','default','length','model','callback','condition','util','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','closedinteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','motionChannel','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','contact','UserId','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','event','opened','sequelize','QueryTypes','interface','format','AfterCreate','changed'];(function(_0x3f29f4,_0x5ca90b){var _0x3f7dff=function(_0x393c65){while(--_0x393c65){_0x3f29f4['push'](_0x3f29f4['shift']());}};_0x3f7dff(++_0x5ca90b);}(_0x5ec3,0x12c));var _0x35ec=function(_0x4c7f9c,_0x2f8008){_0x4c7f9c=_0x4c7f9c-0x0;var _0x276aa0=_0x5ec3[_0x4c7f9c];return _0x276aa0;};'use strict';var util=require(_0x35ec('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x35ec('0x1'));var logger=require('../logger')(_0x35ec('0x2'));var client=jayson[_0x35ec('0x3')][_0x35ec('0x4')]({'port':0x232a});var triggers=[{'channel':_0x35ec('0x5'),'model':_0x35ec('0x6'),'event':_0x35ec('0x7'),'condition':_0x35ec('0x8'),'callback':afterCreate},{'channel':_0x35ec('0x5'),'model':_0x35ec('0x6'),'event':_0x35ec('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x35ec('0x5'),'model':_0x35ec('0xa'),'event':_0x35ec('0x7'),'condition':_0x35ec('0xb'),'callback':afterCreateMessage},{'channel':_0x35ec('0xc'),'model':'SmsInteraction','event':_0x35ec('0x7'),'condition':_0x35ec('0x8'),'callback':afterCreate},{'channel':_0x35ec('0xc'),'model':_0x35ec('0xd'),'event':_0x35ec('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x35ec('0xe'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x35ec('0xf'),'model':_0x35ec('0x10'),'event':'afterCreate','condition':_0x35ec('0x8'),'callback':afterCreate},{'channel':_0x35ec('0xf'),'model':_0x35ec('0x10'),'event':_0x35ec('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x35ec('0xf'),'model':'WhatsappMessage','event':_0x35ec('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x35ec('0x11'),'model':_0x35ec('0x12'),'event':_0x35ec('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x35ec('0x12'),'event':_0x35ec('0x9'),'condition':_0x35ec('0x13'),'callback':afterUpdate},{'channel':_0x35ec('0x11'),'model':_0x35ec('0x14'),'event':_0x35ec('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x35ec('0x15'),'model':_0x35ec('0x16'),'event':_0x35ec('0x7'),'condition':_0x35ec('0x8'),'callback':afterCreate},{'channel':_0x35ec('0x15'),'model':_0x35ec('0x16'),'event':_0x35ec('0x9'),'condition':_0x35ec('0x13'),'callback':afterUpdate},{'channel':_0x35ec('0x15'),'model':_0x35ec('0x17'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x35ec('0x18'),'model':_0x35ec('0x19'),'event':_0x35ec('0x7'),'condition':_0x35ec('0x8'),'callback':afterCreate},{'channel':_0x35ec('0x18'),'model':_0x35ec('0x19'),'event':_0x35ec('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x35ec('0x18'),'model':_0x35ec('0x1a'),'event':'afterCreate','condition':_0x35ec('0xb'),'callback':afterCreateMessage}];function request(_0x22ea15){return client[_0x35ec('0x1b')](_0x35ec('0x1c'),_0x22ea15)[_0x35ec('0x1d')](function(_0x7206ad){logger[_0x35ec('0x1e')](_0x35ec('0x1f'),_0x35ec('0x1c'),_0x7206ad);if(_0x7206ad[_0x35ec('0x20')]){if(_0x7206ad[_0x35ec('0x20')][_0x35ec('0x21')]===0x1f4){logger['error'](_0x35ec('0x1f'),_0x35ec('0x1c'),_0x7206ad[_0x35ec('0x20')]);}}})[_0x35ec('0x22')](function(_0x2a2c01){logger[_0x35ec('0x20')](_0x35ec('0x1f'),_0x35ec('0x1c'),_0x2a2c01);});}function afterCreateMessage(_0x3ca992){return function(_0x3e7dfe){_0x3e7dfe=_0x3e7dfe['get']({'plain':!![]});_0x3e7dfe[_0x35ec('0x23')]=_0x3ca992;_0x3e7dfe[_0x35ec('0x24')]=_0x3ca992;_0x3e7dfe['event']=_0x3e7dfe[_0x35ec('0x25')];Promise[_0x35ec('0x26')]()[_0x35ec('0x1d')](function(){if(typeof _0x3e7dfe[_0x35ec('0x27')]===_0x35ec('0x28'))return null;var _0x328f63=_0x35ec('0x29')+_0x3e7dfe[_0x35ec('0x27')];return db['sequelize'][_0x35ec('0x2a')](_0x328f63,{'type':db[_0x35ec('0x2b')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x35ec('0x1d')](function(_0x14b19e){if(_0x14b19e){_0x3e7dfe[_0x35ec('0x2c')]=_0x14b19e[0x0];}if(typeof _0x3e7dfe['UserId']===_0x35ec('0x28'))return;return getAgent(_0x3e7dfe[_0x35ec('0x2d')]);})['then'](function(_0x3521c2){if(_0x3521c2){_0x3e7dfe['interface']=util['format'](_0x35ec('0x2e'),_0x3521c2[_0x35ec('0x2f')]);_0x3e7dfe[_0x35ec('0x30')]=_0x3521c2;_0x3e7dfe[_0x35ec('0x23')]=_0x3ca992;return request({'event':_0x35ec('0x31'),'message':_0x3e7dfe});}else{return request({'event':_0x35ec('0x32'),'message':_0x3e7dfe});}})[_0x35ec('0x22')](function(_0x29d7df){logger[_0x35ec('0x20')](_0x35ec('0x1f'),_0x35ec('0x33'),_0x29d7df);});};}function afterCreate(_0xd5e8b9,_0x2ffcd0){return function(_0x2934ac){_0x2934ac=_0x2934ac['get']({'plain':!![]});_0x2934ac[_0x35ec('0x23')]=_0xd5e8b9;_0x2934ac[_0x35ec('0x24')]=_0xd5e8b9;_0x2934ac[_0x35ec('0x34')]=_0x35ec('0x35');Promise[_0x35ec('0x26')]()[_0x35ec('0x1d')](function(){var _0x4a6511='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2934ac[_0x35ec('0x27')];return db[_0x35ec('0x36')]['query'](_0x4a6511,{'type':db[_0x35ec('0x2b')][_0x35ec('0x37')]['SELECT'],'raw':!![]});})['then'](function(_0x1c9598){if(_0x1c9598){_0x2934ac[_0x35ec('0x2c')]=_0x1c9598[0x0];}if(typeof _0x2934ac[_0x35ec('0x2d')]===_0x35ec('0x28'))return;return getAgent(_0x2934ac[_0x35ec('0x2d')]);})[_0x35ec('0x1d')](function(_0x11bcd7){if(_0x11bcd7){_0x2934ac[_0x35ec('0x38')]=util[_0x35ec('0x39')](_0x35ec('0x2e'),_0x11bcd7['name']);_0x2934ac[_0x35ec('0x30')]=_0x11bcd7;}return request({'event':_0x2ffcd0,'message':_0x2934ac});})[_0x35ec('0x22')](function(_0x297771){logger['error']('Trigger,\x20%s',_0x35ec('0x3a'),_0x297771);});};}function afterUpdate(_0x44e3ed){return function(_0x524368){var _0x242dea=_0x524368[_0x35ec('0x3b')](_0x35ec('0x3c'))&&_0x524368[_0x35ec('0x3c')];var _0x3e6eb6=_0x524368[_0x35ec('0x3b')](_0x35ec('0x3d'));if(_0x242dea||_0x3e6eb6){var _0x36a922=_0x242dea?_0x35ec('0x13'):'substatus';var _0x470761=_0x524368[_0x35ec('0x3e')]({'plain':!![]});_0x470761[_0x35ec('0x23')]=_0x44e3ed;_0x470761[_0x35ec('0x24')]=_0x44e3ed;_0x470761[_0x35ec('0x34')]=_0x242dea?_0x35ec('0x3c'):_0x35ec('0x3d');var _0xd9845a=_0x35ec('0x29')+_0x470761[_0x35ec('0x27')];return db['sequelize'][_0x35ec('0x2a')](_0xd9845a,{'type':db[_0x35ec('0x2b')][_0x35ec('0x37')]['SELECT'],'raw':!![]})[_0x35ec('0x1d')](function(_0x3eeb6b){if(_0x3eeb6b){_0x470761[_0x35ec('0x2c')]=_0x3eeb6b[0x0];}if(typeof _0x470761[_0x35ec('0x2d')]==='undefined')return;return getAgent(_0x470761['UserId']);})[_0x35ec('0x1d')](function(_0x3a8cf6){if(_0x3a8cf6){_0x470761[_0x35ec('0x38')]=util[_0x35ec('0x39')](_0x35ec('0x2e'),_0x3a8cf6[_0x35ec('0x2f')]);_0x470761['agent']=_0x3a8cf6;}return request({'event':_0x36a922,'message':_0x470761});})[_0x35ec('0x22')](function(_0x410aaf){logger[_0x35ec('0x20')](_0x35ec('0x1f'),'AfterUpdate',_0x410aaf);});}};}function getAgent(_0x4f3e78){return db['User'][_0x35ec('0x3f')]({'where':{'id':_0x4f3e78},'attributes':['id',_0x35ec('0x2f'),_0x35ec('0x40'),_0x35ec('0x41'),_0x35ec('0x42')],'raw':!![]})[_0x35ec('0x1d')](function(_0x143147){return _0x143147;});}exports[_0x35ec('0x43')]=function(){for(var _0x3cca4d=0x0;_0x3cca4d=_0x5e3702[_0xe3a8('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1fe493(_0x537982);})['catch'](function(_0x1b4e29){_0x2b0054(_0x1b4e29);});});}; \ No newline at end of file +var _0x6bda=['then','catch','lodash','bluebird','./license/util','voice','mail','chat','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','updateAttributes','getLicense','role','agent','User','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bda,0x1a4));var _0xa6bd=function(_0x45b25b,_0x18009f){_0x45b25b=_0x45b25b-0x0;var _0x54306b=_0x6bda[_0x45b25b];return _0x54306b;};'use strict';var _=require(_0xa6bd('0x0'));var BPromise=require(_0xa6bd('0x1'));var db=require('../mysqldb')['db'];var util=require(_0xa6bd('0x2'));var channels=[_0xa6bd('0x3'),_0xa6bd('0x4'),_0xa6bd('0x5'),_0xa6bd('0x6'),'sms',_0xa6bd('0x7'),_0xa6bd('0x8')];exports[_0xa6bd('0x9')]=function(){return channels;};exports[_0xa6bd('0xa')]=function(_0x291727){_0x291727=_0x291727[_0xa6bd('0xb')]();return _[_0xa6bd('0xc')](channels,_0x291727);};exports['clearBlockUser']=function(_0x436e17,_0x2f4300,_0x2d902c,_0x2d97a3){var _0x34d3ff={'loginAttempts':_0x2f4300,'blocked':_0x2d902c};if(!_[_0xa6bd('0xd')](_0x2d97a3)){_0x34d3ff['blockedAt']=_0x2d97a3;}return _0x436e17[_0xa6bd('0xe')](_0x34d3ff);};exports[_0xa6bd('0xf')]=function(_0x26c9ea){return new BPromise(function(_0xf56591,_0x56c1d7){var _0x5e51c3=0x0;if(_0x26c9ea[_0xa6bd('0x10')]!==_0xa6bd('0x11')){_0xf56591(_0x26c9ea);}db[_0xa6bd('0x12')][_0xa6bd('0x13')]({'where':{'role':_0xa6bd('0x11'),'online':!![],'id':{'$ne':_0x26c9ea['id']}}})[_0xa6bd('0x14')](function(_0x415bbc){_0x5e51c3=_0x415bbc;return util[_0xa6bd('0xf')]();})[_0xa6bd('0x14')](function(_0x2c441a){if(_0x2c441a&&_0x2c441a['agents']&&_0x5e51c3>=_0x2c441a['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xf56591(_0x26c9ea);})[_0xa6bd('0x15')](function(_0x52b239){_0x56c1d7(_0x52b239);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 50b1dc0..5699c40 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1e4=['status','render','json','send'];(function(_0x5288da,_0x2d77cc){var _0x2ac233=function(_0x57de57){while(--_0x57de57){_0x5288da['push'](_0x5288da['shift']());}};_0x2ac233(++_0x2d77cc);}(_0xf1e4,0x1e4));var _0x4f1e=function(_0x2f2ade,_0x5d3811){_0x2f2ade=_0x2f2ade-0x0;var _0x40a722=_0xf1e4[_0x2f2ade];return _0x40a722;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4c9f3b,_0x56663c){var _0x24e7ad='404';var _0x45a267=0x194;var _0x525576={'status':_0x45a267};_0x56663c[_0x4f1e('0x0')](_0x525576[_0x4f1e('0x0')]);_0x56663c[_0x4f1e('0x1')](_0x24e7ad,{},function(_0x34b345,_0x3c86c2){if(_0x34b345){return _0x56663c[_0x4f1e('0x0')](_0x525576[_0x4f1e('0x0')])[_0x4f1e('0x2')](_0x525576);}_0x56663c[_0x4f1e('0x3')](_0x3c86c2);});}; \ No newline at end of file +var _0x8185=['404','status','json','send','exports'];(function(_0x68ba99,_0xfbebae){var _0x77f2d0=function(_0x2d8772){while(--_0x2d8772){_0x68ba99['push'](_0x68ba99['shift']());}};_0x77f2d0(++_0xfbebae);}(_0x8185,0xb8));var _0x5818=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8185[_0x53ccf2];return _0x5a2964;};'use strict';module[_0x5818('0x0')][0x194]=function pageNotFound(_0x2db91d,_0x8f33e3){var _0x490fc9=_0x5818('0x1');var _0x3a7e3c=0x194;var _0xd888b3={'status':_0x3a7e3c};_0x8f33e3[_0x5818('0x2')](_0xd888b3[_0x5818('0x2')]);_0x8f33e3['render'](_0x490fc9,{},function(_0xdc0847,_0x124d5d){if(_0xdc0847){return _0x8f33e3[_0x5818('0x2')](_0xd888b3[_0x5818('0x2')])[_0x5818('0x3')](_0xd888b3);}_0x8f33e3[_0x5818('0x4')](_0x124d5d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 3d5cf3d..0e563ee 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['UserVoicePrefix','hasOne','cascade','UserId','User','hasMany','Recordings','VoiceQueuesRt','Extensions','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','uniqueid','VoiceAgentReport','Contact','MailAccountId','MailServerOut','Dispositions','Answers','Interactions','List','ListId','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','DashboardItem','Items','FaxAccountId','Exntensions','user_has_fax_accounts','fax_interaction_has_tags','ThroughTags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Tags','user_has_sms_interactions','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','AttachmentId','team_has_chat_queues','ChatGroupId','Website','CompanyId','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','Schedule','AnalyticDefaultReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','ZohoAccount','ZohoConfiguration','ZohoField','Descriptions','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesAccount','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','SessionId','ProjectId','VoicePrefixes','TrunkId','TrunkBackupId','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','Contacts','HopperHistory','Queues','UserProfileSection','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','sequelize','lodash','jstz','xC@LL1234','127.0.0.1','utf8mb4','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','motion2','xcall','mysql','database','username','options','password','../api/user/user.model','VoiceChanSpy','import','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../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','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix'];(function(_0x1961ba,_0x414643){var _0x5fcf06=function(_0x4c0b0a){while(--_0x4c0b0a){_0x1961ba['push'](_0x1961ba['shift']());}};_0x5fcf06(++_0x414643);}(_0x91a7,0xe7));var _0x791a=function(_0x596a36,_0x44bd3f){_0x596a36=_0x596a36-0x0;var _0x1c3e61=_0x91a7[_0x596a36];return _0x1c3e61;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x791a('0x0'));var _=require(_0x791a('0x1'));var jstz=require(_0x791a('0x2'));var timezone=jstz['determine']();config[_0x791a('0x0')]=_['defaultsDeep'](config[_0x791a('0x0')],{'database':'motion2','username':'xcall','password':_0x791a('0x3'),'options':{'host':_0x791a('0x4'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x791a('0x5')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x791a('0x6'),'collate':_0x791a('0x7')}}});config['sequelizeHistory']=_[_0x791a('0x8')](config[_0x791a('0x9')],{'database':_0x791a('0xa'),'username':_0x791a('0xb'),'password':_0x791a('0x3'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x791a('0xc'),'dialectOptions':{'charset':_0x791a('0x5')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x791a('0x6'),'collate':_0x791a('0x7')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x791a('0x0')][_0x791a('0xd')],config[_0x791a('0x0')][_0x791a('0xe')],config['sequelize']['password'],config[_0x791a('0x0')][_0x791a('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x791a('0xd')],config[_0x791a('0x9')]['username'],config[_0x791a('0x9')][_0x791a('0x10')],config[_0x791a('0x9')][_0x791a('0xf')])};db['User']=db[_0x791a('0x0')]['import'](_0x791a('0x11'));db[_0x791a('0x12')]=db['sequelize'][_0x791a('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x791a('0x14')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db[_0x791a('0x15')]=db['sequelize']['import'](_0x791a('0x16'));db[_0x791a('0x17')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x791a('0x18')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x19'));db['VoiceRecording']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1a'));db[_0x791a('0x1b')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1c'));db[_0x791a('0x1d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1e'));db['VoiceMailMessage']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1f'));db[_0x791a('0x20')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x21'));db['VoiceDialReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x22'));db['VoiceAgentReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x23'));db[_0x791a('0x24')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x25'));db[_0x791a('0x26')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x27'));db[_0x791a('0x28')]=db['sequelize'][_0x791a('0x13')]('../api/trunk/trunk.model');db[_0x791a('0x29')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x2a'));db[_0x791a('0x2b')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x791a('0x2c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x2d'));db[_0x791a('0x2e')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x2f'));db[_0x791a('0x30')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x791a('0x31')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x32'));db[_0x791a('0x33')]=db['sequelize'][_0x791a('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x791a('0x34')]=db['sequelize']['import'](_0x791a('0x35'));db[_0x791a('0x36')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x37'));db[_0x791a('0x38')]=db[_0x791a('0x0')]['import'](_0x791a('0x39'));db['MailServerOut']=db[_0x791a('0x0')]['import'](_0x791a('0x3a'));db[_0x791a('0x3b')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x3c'));db['MailQueue']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x3d'));db[_0x791a('0x3e')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x3f'));db[_0x791a('0x40')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x791a('0x41')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/mailMessage/mailMessage.model');db[_0x791a('0x42')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x791a('0x43')]=db[_0x791a('0x0')]['import'](_0x791a('0x44'));db[_0x791a('0x45')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x791a('0x13')](_0x791a('0x46'));db['FaxAccount']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x47'));db[_0x791a('0x48')]=db['sequelize'][_0x791a('0x13')]('../api/faxApplication/faxApplication.model');db[_0x791a('0x49')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x4a'));db[_0x791a('0x4b')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x4c'));db[_0x791a('0x4d')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/faxQueue/faxQueue.model');db[_0x791a('0x4e')]=db[_0x791a('0x0')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x791a('0x4f')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsApplication/smsApplication.model');db[_0x791a('0x50')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x51'));db[_0x791a('0x52')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x53'));db[_0x791a('0x54')]=db[_0x791a('0x0')]['import'](_0x791a('0x55'));db[_0x791a('0x56')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x57'));db[_0x791a('0x58')]=db[_0x791a('0x0')]['import'](_0x791a('0x59'));db[_0x791a('0x5a')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x5b'));db['OpenchannelQueue']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x5c'));db[_0x791a('0x5d')]=db[_0x791a('0x0')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x791a('0x0')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x791a('0x5e')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x5f'));db['ChatInteraction']=db['sequelize'][_0x791a('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x791a('0x60')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/chatMessage/chatMessage.model');db[_0x791a('0x61')]=db[_0x791a('0x0')]['import'](_0x791a('0x62'));db[_0x791a('0x63')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x64'));db[_0x791a('0x65')]=db['sequelize']['import'](_0x791a('0x66'));db['ChatProactiveAction']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x67'));db[_0x791a('0x68')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x69'));db['CmContact']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6a'));db[_0x791a('0x6b')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6c'));db['CmHopperBlack']=db[_0x791a('0x0')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x791a('0x6d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6e'));db[_0x791a('0x6f')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x70'));db[_0x791a('0x71')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x72'));db[_0x791a('0x73')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x74'));db[_0x791a('0x75')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x76'));db['Automation']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x77'));db[_0x791a('0x78')]=db[_0x791a('0x0')]['import'](_0x791a('0x79'));db[_0x791a('0x7a')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/disposition/disposition.model');db[_0x791a('0x7b')]=db['sequelize']['import']('../api/condition/condition.model');db['Interval']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x7c'));db[_0x791a('0x7d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x7e'));db['Cdr']=db['sequelize'][_0x791a('0x13')](_0x791a('0x7f'));db['VoiceQueuesLog']=db['sequelize'][_0x791a('0x13')](_0x791a('0x80'));db['Schedule']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x81'));db[_0x791a('0x82')]=db['sequelize']['import'](_0x791a('0x83'));db[_0x791a('0x84')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x85'));db[_0x791a('0x86')]=db[_0x791a('0x0')]['import'](_0x791a('0x87'));db[_0x791a('0x88')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x89'));db[_0x791a('0x8a')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/variable/variable.model');db['Integration']=db['sequelize'][_0x791a('0x13')](_0x791a('0x8b'));db[_0x791a('0x8c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x8d'));db[_0x791a('0x8e')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x8f'));db['AnalyticDefaultReport']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x791a('0x90')]=db[_0x791a('0x0')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x791a('0x91')]=db[_0x791a('0x0')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x791a('0x92')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x791a('0x93')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x94'));db[_0x791a('0x95')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x96'));db['SalesforceConfiguration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x97'));db[_0x791a('0x98')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x99'));db[_0x791a('0x9a')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x9b'));db[_0x791a('0x9c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x9d'));db[_0x791a('0x9e')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x791a('0x9f')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xa0'));db[_0x791a('0xa1')]=db['sequelize'][_0x791a('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x791a('0xa2')]=db['sequelize'][_0x791a('0x13')](_0x791a('0xa3'));db['ZohoAccount']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xa4'));db['ZohoConfiguration']=db[_0x791a('0x0')]['import'](_0x791a('0xa5'));db['ZohoField']=db['sequelize']['import'](_0x791a('0xa6'));db[_0x791a('0xa7')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x791a('0xa8')]=db[_0x791a('0x0')]['import'](_0x791a('0xa9'));db[_0x791a('0xaa')]=db[_0x791a('0x0')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x791a('0xab')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xac'));db[_0x791a('0xad')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xae'));db['FreshdeskField']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xaf'));db[_0x791a('0xb0')]=db['sequelize']['import'](_0x791a('0xb1'));db[_0x791a('0xb2')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb3'));db[_0x791a('0xb4')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb5'));db[_0x791a('0xb6')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb7'));db['ServicenowConfiguration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb8'));db[_0x791a('0xb9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xba'));db[_0x791a('0xbb')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x791a('0xbc')]=db[_0x791a('0x0')]['import'](_0x791a('0xbd'));db[_0x791a('0xbe')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xbf'));db['FreshsalesAccount']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc0'));db['FreshsalesConfiguration']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc1'));db[_0x791a('0xc2')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xc3'));db[_0x791a('0xc4')]=db[_0x791a('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xc5'));db['ChatQueueReport']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc6'));db[_0x791a('0xc7')]=db[_0x791a('0x0')]['import'](_0x791a('0xc8'));db[_0x791a('0xc9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xca'));db[_0x791a('0xcb')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xcc'));db[_0x791a('0xcd')]=db[_0x791a('0x0')]['import'](_0x791a('0xce'));db[_0x791a('0xcf')]=db[_0x791a('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xd0'));db[_0x791a('0xd1')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x791a('0xd2')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x791a('0xd3')]=db[_0x791a('0x0')]['import'](_0x791a('0xd4'));db['SquareOdbc']=db[_0x791a('0x0')]['import'](_0x791a('0xd5'));db['SquareProject']=db['sequelize']['import']('../api/squareProject/squareProject.model');db[_0x791a('0xd6')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/squareRecording/squareRecording.model');db[_0x791a('0xd7')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xd8'));db[_0x791a('0xd9')]=db['sequelize']['import'](_0x791a('0xda'));db[_0x791a('0xdb')]=db[_0x791a('0x0')]['import'](_0x791a('0xdc'));db['Campaign']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xdd'));db['Migration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xde'));db['Attachment']=db['sequelize'][_0x791a('0x13')](_0x791a('0xdf'));db[_0x791a('0xe0')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize']['import'](_0x791a('0xe1'));db['ChatTransferReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe2'));db[_0x791a('0xe3')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe4'));db[_0x791a('0xe5')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe6'));db['SmsTransferReport']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x791a('0xe7')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/cmList/cmList.model');db[_0x791a('0xe8')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x791a('0xe9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xea'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0x791a('0xeb')]=db[_0x791a('0x0')]['import'](_0x791a('0xec'));db[_0x791a('0xed')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xee'));db[_0x791a('0xef')]=db[_0x791a('0x0')]['import'](_0x791a('0xf0'));db[_0x791a('0xf1')]=db['sequelize'][_0x791a('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x791a('0xf2')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x791a('0xf3')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf4'));db[_0x791a('0xf5')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf6'));db[_0x791a('0xf7')]=db[_0x791a('0x0')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x791a('0xf8')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf9'));db[_0x791a('0xfa')]=db['sequelize']['import'](_0x791a('0xfb'));db[_0x791a('0xfc')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xfd'));db[_0x791a('0xfe')]=db['sequelize'][_0x791a('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x791a('0xff')]=db['sequelize'][_0x791a('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['User'][_0x791a('0x100')](db[_0x791a('0x1d')],{'as':_0x791a('0x1d'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db['VoiceRecording'],{'as':_0x791a('0x105'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x2b')],{'as':_0x791a('0x106'),'foreignKey':'UserId'});db[_0x791a('0x103')]['hasMany'](db['VoiceExtension'],{'as':_0x791a('0x107'),'onDelete':'cascade','hooks':!![]});db[_0x791a('0x103')]['hasMany'](db[_0x791a('0x6d')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':_0x791a('0x102')});db['User']['hasMany'](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'foreignKey':'UserId'});db[_0x791a('0x103')]['hasMany'](db[_0x791a('0x109')],{'as':_0x791a('0x10a'),'foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db['FaxInteraction'],{'as':_0x791a('0x10c'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0xf2')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User'][_0x791a('0x104')](db[_0x791a('0xed')],{'as':_0x791a('0x10d'),'foreignKey':'SenderId'});db[_0x791a('0x103')][_0x791a('0x10e')](db[_0x791a('0xe9')],{'as':'UserProfile','foreignKey':_0x791a('0x10f')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x65')],{'as':_0x791a('0x111'),'through':_0x791a('0x112')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x113')],{'as':'Contacts','through':_0x791a('0x114')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':'cm_user_has_lists'});db[_0x791a('0x103')][_0x791a('0x110')](db['Team'],{'through':_0x791a('0x116')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x40')],{'as':_0x791a('0x117'),'through':_0x791a('0x118')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x109')],{'as':_0x791a('0x10a'),'through':_0x791a('0x119')});db[_0x791a('0x103')][_0x791a('0x110')](db['FaxInteraction'],{'as':_0x791a('0x10c'),'through':_0x791a('0x11a')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'through':'user_has_sms_interactions'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'through':_0x791a('0x11b')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xf2')],{'as':_0x791a('0x11c'),'through':_0x791a('0x11d')});db['User'][_0x791a('0x110')](db[_0x791a('0x18')],{'as':_0x791a('0x11e'),'through':'UserVoiceQueue','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe8')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x11f')],{'as':_0x791a('0x120'),'through':_0x791a('0x30'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x63')],{'as':_0x791a('0x121'),'through':_0x791a('0x2e'),'required':![],'hooks':!![]});db[_0x791a('0x103')]['belongsToMany'](db[_0x791a('0x4d')],{'as':_0x791a('0x122'),'through':_0x791a('0x31'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x52')],{'as':_0x791a('0x123'),'through':_0x791a('0x33'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x124')],{'as':_0x791a('0x125'),'through':_0x791a('0x34'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xf8')],{'as':_0x791a('0x126'),'through':'UserWhatsappQueue','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe7')],{'through':_0x791a('0x127')});db[_0x791a('0x103')]['belongsToMany'](db[_0x791a('0x5d')],{'as':_0x791a('0x128'),'through':_0x791a('0x129')});db['User']['belongsToMany'](db[_0x791a('0x12a')],{'as':_0x791a('0x12b'),'through':'user_has_fax_accounts'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x3b')],{'as':_0x791a('0x12c'),'through':_0x791a('0x12d')});db['User']['belongsToMany'](db[_0x791a('0x54')],{'as':_0x791a('0x12e'),'through':_0x791a('0x12f')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x4f')],{'as':_0x791a('0x130'),'through':_0x791a('0x131')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xef')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x132')],{'as':_0x791a('0x133'),'through':_0x791a('0x134')});db['VoiceChanSpy'][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x135'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x136')});db[_0x791a('0x14')][_0x791a('0x104')](db['VoiceExtension'],{'onDelete':_0x791a('0x101')});db[_0x791a('0x15')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x137'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x791a('0x82')],{'as':_0x791a('0x138'),'through':_0x791a('0x139')});db[_0x791a('0x18')][_0x791a('0x104')](db['UserVoiceQueueRt'],{'as':_0x791a('0x13a'),'foreignKey':_0x791a('0x13b')});db['VoiceQueue'][_0x791a('0x104')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x6d')],{'as':_0x791a('0x13c'),'foreignKey':_0x791a('0x13b')});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x6f')],{'as':_0x791a('0x13d'),'foreignKey':_0x791a('0x13b')});db['VoiceQueue'][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x13e')],{'as':_0x791a('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db['JscriptySessionReport'],{'as':_0x791a('0x140'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x28'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x141'),'foreignKey':'TrunkBackupId'});db[_0x791a('0x18')][_0x791a('0x10e')](db[_0x791a('0x142')],{'as':'Interval','foreignKey':_0x791a('0x143')});db[_0x791a('0x18')][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db[_0x791a('0x18')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':_0x791a('0x146')});db[_0x791a('0x18')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x2c')});db['VoiceQueue'][_0x791a('0x110')](db['Team'],{'as':_0x791a('0x148'),'through':_0x791a('0xfc')});db[_0x791a('0x18')][_0x791a('0x110')](db['CmList'],{'as':_0x791a('0x149'),'through':_0x791a('0x14a')});db[_0x791a('0x14b')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db['ScreenRecording'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x1d')][_0x791a('0x104')](db[_0x791a('0x14c')],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':'mailboxuser','sourceKey':_0x791a('0x14e')});db[_0x791a('0x14c')][_0x791a('0x10e')](db['VoiceMail'],{'foreignKey':_0x791a('0x14f'),'targetKey':_0x791a('0x14e')});db[_0x791a('0x20')][_0x791a('0x104')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x791a('0x150'),'constraints':![]});db[_0x791a('0x20')][_0x791a('0x104')](db[_0x791a('0x151')],{'as':'AgentReports','foreignKey':_0x791a('0x150'),'constraints':![]});db[_0x791a('0x20')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x20')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x38')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':'MailAccount','foreignKey':_0x791a('0x153')});db[_0x791a('0x154')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x791a('0x3b')][_0x791a('0x100')](db[_0x791a('0x38')],{'as':'Imap','onDelete':'cascade'});db[_0x791a('0x3b')][_0x791a('0x100')](db[_0x791a('0x154')],{'as':'Smtp','onDelete':_0x791a('0x101')});db[_0x791a('0x3b')][_0x791a('0x104')](db['Disposition'],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x153'),'onDelete':'cascade'});db[_0x791a('0x3b')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x153')});db[_0x791a('0x3b')]['hasMany'](db[_0x791a('0x41')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x153')});db['MailAccount'][_0x791a('0x104')](db[_0x791a('0x40')],{'as':_0x791a('0x157')});db['MailAccount']['hasMany'](db['MailApplication'],{'as':_0x791a('0x137')});db[_0x791a('0x3b')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x3b')]['belongsTo'](db[_0x791a('0x86')],{'as':_0x791a('0x86'),'foreignKey':'TemplateId'});db['MailAccount'][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0x3b')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x147'),'through':_0x791a('0x12d')});db['MailQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x30')});db[_0x791a('0x11f')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x15a'),'as':_0x791a('0x148')});db[_0x791a('0x40')][_0x791a('0x104')](db[_0x791a('0x41')],{'as':_0x791a('0x14d'),'onDelete':'cascade','foreignKey':_0x791a('0x15b')});db[_0x791a('0x40')][_0x791a('0x10e')](db['MailAccount'],{'as':_0x791a('0x15c'),'foreignKey':'MailAccountId'});db[_0x791a('0x40')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x40')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x40')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x15f'),'as':'Tags'});db['MailInteraction']['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x15f'),'as':'ThroughTags'});db['MailInteraction'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':_0x791a('0x118'),'foreignKey':_0x791a('0x15b')});db[_0x791a('0x41')]['hasMany'](db[_0x791a('0x161')],{'as':_0x791a('0x162'),'onDelete':_0x791a('0x101')});db['MailMessage'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103')});db[_0x791a('0x41')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db['MailMessage']['belongsTo'](db[_0x791a('0x40')],{'as':_0x791a('0x163'),'foreignKey':_0x791a('0x15b')});db[_0x791a('0x41')][_0x791a('0x10e')](db['MailAccount'],{'as':_0x791a('0x15c'),'foreignKey':'MailAccountId'});db[_0x791a('0x41')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x5d'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x41')]['belongsTo'](db[_0x791a('0x61')],{'as':_0x791a('0x61'),'foreignKey':_0x791a('0x165')});db[_0x791a('0x42')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x11f')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'onDelete':_0x791a('0x166')});db['MailApplication'][_0x791a('0x10e')](db['Interval'],{'onDelete':_0x791a('0x166'),'foreignKey':'IntervalId'});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x3b')],{});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x43')][_0x791a('0x10e')](db['MailInteraction'],{});db['MailQueueReport'][_0x791a('0x10e')](db[_0x791a('0x41')],{});db[_0x791a('0x43')]['belongsTo'](db[_0x791a('0x103')],{});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x11f')],{});db[_0x791a('0x45')][_0x791a('0x104')](db[_0x791a('0x168')],{'as':_0x791a('0x169'),'onDelete':_0x791a('0x101')});db[_0x791a('0x12a')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x16a'),'onDelete':'cascade'});db[_0x791a('0x12a')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'FaxAccountId'});db[_0x791a('0x12a')]['hasMany'](db[_0x791a('0x49')],{'as':_0x791a('0x157')});db['FaxAccount'][_0x791a('0x104')](db['FaxApplication'],{'as':'Applications'});db[_0x791a('0x12a')][_0x791a('0x104')](db['VoiceExtension'],{'as':_0x791a('0x16b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x12a')]['hasMany'](db[_0x791a('0x4b')],{'as':_0x791a('0x14d')});db[_0x791a('0x12a')]['belongsTo'](db[_0x791a('0x28')],{'as':_0x791a('0x28')});db[_0x791a('0x12a')]['belongsTo'](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x12a')]['belongsTo'](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x16c')});db[_0x791a('0x48')][_0x791a('0x10e')](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x48')][_0x791a('0x10e')](db[_0x791a('0x4d')],{'onDelete':_0x791a('0x166')});db['FaxApplication'][_0x791a('0x10e')](db['FaxAccount'],{'onDelete':_0x791a('0x166')});db['FaxApplication'][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x49')][_0x791a('0x104')](db[_0x791a('0x4b')],{'as':'Messages','onDelete':_0x791a('0x101'),'foreignKey':'FaxInteractionId'});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x12a')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x16a')});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x16d'),'as':'Tags'});db[_0x791a('0x49')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x16d'),'as':_0x791a('0x16e')});db[_0x791a('0x49')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':'Users','through':_0x791a('0x11a'),'foreignKey':_0x791a('0x16f')});db[_0x791a('0x4b')][_0x791a('0x10e')](db['User'],{'onDelete':_0x791a('0x101'),'as':'User'});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x49')],{'as':_0x791a('0x163'),'foreignKey':_0x791a('0x16f')});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':'Contact'});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x161')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x791a('0x4b')]['belongsTo'](db[_0x791a('0x12a')],{'as':'Account','foreignKey':_0x791a('0x16a')});db[_0x791a('0x4d')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'UserFaxQueue'});db[_0x791a('0x4d')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x170'),'as':_0x791a('0x148')});db[_0x791a('0x4e')]['belongsTo'](db[_0x791a('0x12a')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x4e')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0x49')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0x4b')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db['User'],{});db['FaxQueueReport'][_0x791a('0x10e')](db['FaxQueue'],{});db[_0x791a('0x4f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x791a('0x171'),'onDelete':_0x791a('0x101')});db[_0x791a('0x4f')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'SmsAccountId'});db[_0x791a('0x4f')][_0x791a('0x104')](db[_0x791a('0x172')],{'as':'Messages','foreignKey':_0x791a('0x171')});db['SmsAccount']['hasMany'](db[_0x791a('0x50')],{'as':_0x791a('0x157')});db[_0x791a('0x4f')][_0x791a('0x104')](db['SmsApplication'],{'as':_0x791a('0x137')});db[_0x791a('0x4f')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':_0x791a('0x159')});db[_0x791a('0x4f')][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db[_0x791a('0x4f')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x131')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x52')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x4f')],{'onDelete':_0x791a('0x166')});db['SmsApplication'][_0x791a('0x10e')](db['Interval'],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x791a('0x50')][_0x791a('0x104')](db[_0x791a('0x172')],{'as':_0x791a('0x14d'),'onDelete':'cascade','foreignKey':_0x791a('0x174')});db['SmsInteraction'][_0x791a('0x10e')](db[_0x791a('0x4f')],{'as':_0x791a('0x15c'),'foreignKey':'SmsAccountId'});db['SmsInteraction']['belongsTo'](db[_0x791a('0x113')],{'as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x50')][_0x791a('0x10e')](db['User'],{'as':'Owner','foreignKey':_0x791a('0x102')});db[_0x791a('0x50')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x175'),'as':_0x791a('0x176')});db[_0x791a('0x50')]['belongsToMany'](db[_0x791a('0x84')],{'through':'sms_interaction_has_tags','as':_0x791a('0x16e')});db[_0x791a('0x50')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x160'),'through':_0x791a('0x177'),'foreignKey':_0x791a('0x174')});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':'User'});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':'Contact'});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x50')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x791a('0x10e')](db[_0x791a('0x4f')],{'as':_0x791a('0x15c'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x791a('0x52')][_0x791a('0x110')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x178'),'onDelete':_0x791a('0x101')});db[_0x791a('0x54')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x791a('0x104')](db[_0x791a('0x58')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x791a('0x54')]['hasMany'](db[_0x791a('0x5a')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x178')});db[_0x791a('0x54')][_0x791a('0x104')](db[_0x791a('0x56')],{'as':'Applications','foreignKey':_0x791a('0x178')});db[_0x791a('0x54')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x54')][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db['OpenchannelAccount'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x12f')});db[_0x791a('0x56')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x124')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x179')});db['OpenchannelApplication'][_0x791a('0x10e')](db[_0x791a('0x54')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x178')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x142')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x58')]['hasMany'](db['OpenchannelMessage'],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x17a')});db[_0x791a('0x58')][_0x791a('0x10e')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x791a('0x178')});db[_0x791a('0x58')]['belongsTo'](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db['OpenchannelInteraction']['belongsTo'](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db['OpenchannelInteraction'][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x17b'),'as':_0x791a('0x176')});db[_0x791a('0x58')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x17b'),'as':_0x791a('0x16e')});db[_0x791a('0x58')]['belongsToMany'](db['User'],{'as':'Users','through':_0x791a('0x11b'),'foreignKey':_0x791a('0x17a')});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x103')});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db[_0x791a('0x5a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':_0x791a('0x17a')});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x161')],{'as':_0x791a('0x161'),'foreignKey':'AttachmentId'});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x54')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x178')});db['OpenchannelQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x34'),'foreignKey':_0x791a('0x179')});db[_0x791a('0x124')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x17c'),'as':_0x791a('0x148')});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x164'),'onDelete':_0x791a('0x101')});db[_0x791a('0x5d')]['hasMany'](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x164')});db['ChatWebsite'][_0x791a('0x104')](db[_0x791a('0x17d')],{'as':'ProactiveActions'});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x109')],{'as':_0x791a('0x157')});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x5e')],{'as':_0x791a('0x137')});db[_0x791a('0x5d')]['hasMany'](db[_0x791a('0x60')],{'as':_0x791a('0x14d')});db['ChatWebsite'][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db['ChatWebsite'][_0x791a('0x10e')](db['Interval'],{'as':_0x791a('0x142'),'foreignKey':'IntervalId'});db[_0x791a('0x5d')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':_0x791a('0x3b'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0x5d')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x129')});db['OpenchannelQueueReport']['belongsTo'](db[_0x791a('0x54')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x17e')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x17e')][_0x791a('0x10e')](db['OpenchannelInteraction'],{});db[_0x791a('0x17e')][_0x791a('0x10e')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x791a('0x10e')](db['User'],{});db[_0x791a('0x17e')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x17f'),'foreignKey':_0x791a('0x102'),'onDelete':'restrict'});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x63')],{'as':'Queue','foreignKey':_0x791a('0x180'),'onDelete':'restrict'});db[_0x791a('0x5e')][_0x791a('0x10e')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x791a('0x164'),'onDelete':_0x791a('0x166')});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x109')][_0x791a('0x104')](db[_0x791a('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x791a('0x181')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x109')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x182'),'as':_0x791a('0x176')});db[_0x791a('0x109')]['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x182'),'as':_0x791a('0x16e')});db[_0x791a('0x109')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':'user_has_chat_interactions','foreignKey':_0x791a('0x181')});db[_0x791a('0x60')][_0x791a('0x10e')](db['User'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x103')});db[_0x791a('0x60')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x60')][_0x791a('0x10e')](db[_0x791a('0x109')],{'onDelete':_0x791a('0x101'),'as':'Interaction','foreignKey':_0x791a('0x181')});db[_0x791a('0x60')][_0x791a('0x10e')](db['Attachment'],{'as':_0x791a('0x161'),'foreignKey':_0x791a('0x183')});db['ChatMessage'][_0x791a('0x10e')](db['ChatWebsite'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x164')});db['ChatOfflineMessage']['hasMany'](db[_0x791a('0x161')],{'as':'Attachments','foreignKey':_0x791a('0x165'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['ChatOfflineMessage'][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x61')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x791a('0x63')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x2e'),'hooks':!![]});db[_0x791a('0x63')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x184'),'as':_0x791a('0x148')});db[_0x791a('0x65')][_0x791a('0x104')](db[_0x791a('0xc7')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x185'),'onDelete':_0x791a('0x101')});db[_0x791a('0x65')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x13a'),'through':_0x791a('0x112')});db[_0x791a('0x17d')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x186'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x68')][_0x791a('0x104')](db['CmContact'],{'as':'Contacts','foreignKey':_0x791a('0x187')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0x6b')],{'as':'Hoppers','foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0x6d')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x6f')],{'as':_0x791a('0x13d'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0xcd')],{'as':_0x791a('0x140'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'foreignKey':'ContactId','onDelete':_0x791a('0x166')});db[_0x791a('0x113')]['hasMany'](db['ChatInteraction'],{'as':_0x791a('0x10a'),'foreignKey':_0x791a('0x15d'),'onDelete':'restrict'});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x166')});db['CmContact'][_0x791a('0x104')](db[_0x791a('0x49')],{'as':'FaxInteractions','foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x166')});db[_0x791a('0x113')][_0x791a('0x104')](db['MailInteraction'],{'as':_0x791a('0x117'),'foreignKey':'ContactId','onDelete':_0x791a('0x166')});db[_0x791a('0x113')]['belongsTo'](db[_0x791a('0x68')],{'as':_0x791a('0x188'),'foreignKey':_0x791a('0x187')});db[_0x791a('0x113')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':'ListId','onDelete':_0x791a('0x101')});db[_0x791a('0x113')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':'cm_user_has_contacts'});db[_0x791a('0x113')]['belongsToMany'](db[_0x791a('0x84')],{'as':'Tags','through':_0x791a('0x189')});db[_0x791a('0x113')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x189'),'as':_0x791a('0x16e')});db[_0x791a('0x6b')]['belongsTo'](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x101')});db[_0x791a('0x6b')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159'),'onDelete':_0x791a('0x101')});db['CmHopper'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x17f'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x6b')][_0x791a('0x10e')](db['VoiceQueue'],{'as':_0x791a('0x18a'),'foreignKey':_0x791a('0x13b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x6b')]['belongsTo'](db[_0x791a('0x18b')],{'as':_0x791a('0x18b'),'foreignKey':_0x791a('0x18c'),'onDelete':_0x791a('0x101')});db['CmHopper'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':'Owner','foreignKey':_0x791a('0x18d')});db[_0x791a('0x13e')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')][_0x791a('0x10e')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x791a('0x13b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x791a('0x18c'),'onDelete':'cascade'});db[_0x791a('0x18e')][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x18f'),'singular':_0x791a('0x190')},'foreignKey':_0x791a('0x191'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x18e')][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':'Any','singular':_0x791a('0x192')},'foreignKey':_0x791a('0x193'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['Automation'][_0x791a('0x104')](db[_0x791a('0x75')],{'as':_0x791a('0x194'),'foreignKey':_0x791a('0x195'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x7a')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':'Dispositions','foreignKey':_0x791a('0x196'),'onDelete':_0x791a('0x101')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x142')],{'as':_0x791a('0x197'),'foreignKey':'IntervalId','onDelete':_0x791a('0x101'),'hooks':!![],'required':![]});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x107'),'foreignKey':'IntervalId','onDelete':_0x791a('0x166')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x42')],{'as':_0x791a('0x198'),'foreignKey':_0x791a('0x143')});db['Interval']['hasMany'](db[_0x791a('0x5e')],{'as':_0x791a('0x199'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x48')],{'as':'FaxApplications','foreignKey':_0x791a('0x143')});db[_0x791a('0x142')][_0x791a('0x104')](db['SmsApplication'],{'as':_0x791a('0x19a'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x19b')][_0x791a('0x10e')](db[_0x791a('0x3b')],{});db['Schedule'][_0x791a('0x10e')](db[_0x791a('0x19c')],{'foreignKey':'DefaultReportId'});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x791a('0x19d')});db[_0x791a('0x82')][_0x791a('0x110')](db[_0x791a('0x17')],{'as':_0x791a('0x19e'),'through':'moh_has_sounds','onDelete':_0x791a('0x166')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x113')],{'through':'cm_contact_has_tags'});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x109')],{'through':_0x791a('0x182')});db[_0x791a('0x84')][_0x791a('0x110')](db['MailInteraction'],{'through':_0x791a('0x15f')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x50')],{'through':_0x791a('0x175')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x49')],{'through':_0x791a('0x16d')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x58')],{'through':_0x791a('0x17b')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0xf2')],{'through':_0x791a('0x19f')});db['Trigger'][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x1a0'),'singular':_0x791a('0x1a1')},'foreignKey':_0x791a('0x1a2'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['Trigger'][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x1a3'),'singular':_0x791a('0x1a4')},'foreignKey':_0x791a('0x1a5'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x88')]['hasMany'](db[_0x791a('0x75')],{'as':'Actions','foreignKey':_0x791a('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x791a('0x8e')][_0x791a('0x104')](db[_0x791a('0x92')],{'as':'Fields','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x19d'),'hooks':!![]});db['AnalyticDefaultReport'][_0x791a('0x104')](db[_0x791a('0x92')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1a8')});db[_0x791a('0x91')][_0x791a('0x104')](db['AnalyticFieldReport'],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1a9')});db['AnalyticFieldReport']['belongsTo'](db[_0x791a('0x91')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x791a('0x104')](db[_0x791a('0x1aa')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['SalesforceConfiguration'][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1aa')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x791a('0x1af')});db['SalesforceConfiguration'][_0x791a('0x104')](db['SalesforceField'],{'as':_0x791a('0x1a7'),'onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1aa')][_0x791a('0x10e')](db['SalesforceAccount'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['SalesforceField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x9a')][_0x791a('0x104')](db[_0x791a('0x9c')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x9c')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':'Subjects','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x9c')]['hasMany'](db[_0x791a('0x9e')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x791a('0x1af')});db[_0x791a('0x9c')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db['SugarcrmConfiguration'][_0x791a('0x10e')](db['SugarcrmAccount'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x9e')][_0x791a('0x104')](db['SugarcrmField'],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x9e')][_0x791a('0x104')](db['SugarcrmField'],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x9e')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['SugarcrmField']['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':'VariableId'});db[_0x791a('0x9f')]['hasMany'](db['DeskConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['DeskConfiguration'][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa1')]['hasMany'](db[_0x791a('0xa2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x791a('0xa1')][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xa1')][_0x791a('0x10e')](db[_0x791a('0x9f')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xa1')][_0x791a('0x110')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa2')][_0x791a('0x104')](db['DeskField'],{'as':'Description','foreignKey':_0x791a('0x1af')});db[_0x791a('0xa2')][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xa2')][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1b5')][_0x791a('0x104')](db[_0x791a('0x1b6')],{'as':_0x791a('0x1ab'),'onDelete':'cascade','foreignKey':_0x791a('0x1ac')});db[_0x791a('0x1b6')][_0x791a('0x104')](db['ZohoField'],{'as':_0x791a('0x1ad'),'onDelete':'cascade','foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1b6')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b8'),'onDelete':_0x791a('0x101'),'foreignKey':'DescriptionId'});db[_0x791a('0x1b6')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1b6')][_0x791a('0x10e')](db[_0x791a('0x1b5')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x1b7')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1b7')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db['ZohoField'][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1b7')]['belongsTo'](db[_0x791a('0x8a')],{'as':'Variable','foreignKey':'VariableId'});db['ZendeskAccount'][_0x791a('0x104')](db[_0x791a('0xa8')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1ad'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db['ZendeskConfiguration'][_0x791a('0x10e')](db[_0x791a('0xa7')],{'as':'Account','foreignKey':'AccountId'});db[_0x791a('0xa8')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x1b9')});db[_0x791a('0xaa')]['hasMany'](db[_0x791a('0xaa')],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xaa')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0xaa')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['ZendeskField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xab')][_0x791a('0x104')](db['FreshdeskConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xad')][_0x791a('0x104')](db['FreshdeskField'],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':'Descriptions','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xad')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':_0x791a('0x1a7'),'onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0xad')]['belongsTo'](db[_0x791a('0xab')],{'as':_0x791a('0x15c'),'foreignKey':'AccountId'});db[_0x791a('0xad')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x1bb')});db[_0x791a('0x1ba')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x791a('0x1ba')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1ba')][_0x791a('0x104')](db['FreshdeskField'],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1ba')]['belongsTo'](db[_0x791a('0x8a')],{'as':'Variable','foreignKey':'VariableId'});db[_0x791a('0xb0')][_0x791a('0x104')](db['VtigerConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x791a('0xb2')]['hasMany'](db[_0x791a('0xb4')],{'as':_0x791a('0x1ad'),'foreignKey':'SubjectId'});db[_0x791a('0xb2')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xb2')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xb2')][_0x791a('0x10e')](db[_0x791a('0xb0')],{'as':'Account','foreignKey':'AccountId'});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xb4')]['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xb6')][_0x791a('0x104')](db[_0x791a('0x1bc')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':'Subjects','foreignKey':_0x791a('0x1ae')});db['ServicenowConfiguration']['hasMany'](db[_0x791a('0xb9')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1bc')]['hasMany'](db[_0x791a('0xb9')],{'as':_0x791a('0x1a7'),'foreignKey':'FieldId'});db[_0x791a('0x1bc')][_0x791a('0x10e')](db[_0x791a('0xb6')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b3'),'foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xbb')][_0x791a('0x104')](db[_0x791a('0xbc')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['Dynamics365Configuration'][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xbc')][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1b8'),'onDelete':_0x791a('0x101'),'foreignKey':'DescriptionId'});db[_0x791a('0xbc')][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0xbc')]['belongsTo'](db[_0x791a('0xbb')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xbe')]['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db['Dynamics365Field']['hasMany'](db[_0x791a('0xbe')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db['Dynamics365Field'][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xbe')][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1bd')][_0x791a('0x104')](db[_0x791a('0x1be')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db[_0x791a('0x1be')][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1ad'),'foreignKey':_0x791a('0x1ae')});db['FreshsalesConfiguration'][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1be')][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1be')][_0x791a('0x10e')](db[_0x791a('0x1bd')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['FreshsalesField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['ChatWebsite'],{});db[_0x791a('0x1bf')]['belongsTo'](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x1bf')]['belongsTo'](db[_0x791a('0x109')],{});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['ChatMessage'],{});db[_0x791a('0x1bf')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db['ChatQueueReport']['belongsTo'](db[_0x791a('0x63')],{});db[_0x791a('0xc7')]['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1c0')});db[_0x791a('0xc7')]['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1c1')});db['JscriptySessionReport'][_0x791a('0x104')](db['JscriptyQuestionReport'],{'foreignKey':_0x791a('0x1c2'),'onDelete':_0x791a('0x101')});db[_0x791a('0xcd')][_0x791a('0x104')](db[_0x791a('0xc9')],{'foreignKey':_0x791a('0x1c2'),'onDelete':'cascade'});db['SmsQueueReport'][_0x791a('0x10e')](db[_0x791a('0x4f')],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xcf')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x50')],{});db[_0x791a('0xcf')]['belongsTo'](db['SmsMessage'],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x52')],{});db['JscriptyProject']['hasMany'](db[_0x791a('0xcd')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x791a('0xcb')],{'foreignKey':_0x791a('0x1c3')});db[_0x791a('0xd2')]['hasMany'](db[_0x791a('0xc9')],{'foreignKey':_0x791a('0x1c3')});db[_0x791a('0x132')]['belongsToMany'](db['User'],{'as':_0x791a('0x160'),'through':'user_has_square_projects'});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'user_has_teams'});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x18')],{'through':_0x791a('0xfc'),'as':_0x791a('0x11e')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x11f')],{'through':_0x791a('0x15a'),'as':_0x791a('0x120')});db['Team'][_0x791a('0x110')](db[_0x791a('0x63')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0x4d')],{'through':_0x791a('0x170'),'as':_0x791a('0x122')});db['Team']['belongsToMany'](db[_0x791a('0x52')],{'through':'team_has_sms_queues','as':_0x791a('0x123')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x124')],{'through':_0x791a('0x17c'),'as':_0x791a('0x125')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0xf8')],{'through':'team_has_whatsapp_queues','as':_0x791a('0x126')});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0xe8')],{'through':_0x791a('0xfe'),'as':_0x791a('0x1c4')});db[_0x791a('0x18b')]['hasMany'](db[_0x791a('0x6b')],{'as':'Hoppers','foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperFinal'],{'as':_0x791a('0x13c'),'foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperBlack'],{'as':_0x791a('0x13f'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x791a('0x28')],{'as':_0x791a('0x28'),'foreignKey':_0x791a('0x1c5')});db['Campaign'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x141'),'foreignKey':_0x791a('0x1c6')});db[_0x791a('0x18b')][_0x791a('0x10e')](db[_0x791a('0x142')],{'as':'Interval','foreignKey':_0x791a('0x143')});db[_0x791a('0x18b')][_0x791a('0x10e')](db[_0x791a('0x132')],{'as':_0x791a('0x132'),'foreignKey':'SquareProjectId'});db[_0x791a('0x18b')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x149'),'through':'campaigns_has_cm_blacklists'});db[_0x791a('0x161')][_0x791a('0x10e')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x791a('0x165')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x41')],{});db[_0x791a('0x1c7')][_0x791a('0x10e')](db['MailInteraction'],{});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'foreignKey':_0x791a('0x1c8'),'as':_0x791a('0x1c9')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db['User'],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':_0x791a('0x1cd')});db[_0x791a('0x1c7')]['belongsTo'](db[_0x791a('0x11f')],{'foreignKey':_0x791a('0x1ce'),'as':_0x791a('0x1cf')});db['MailTransferReport'][_0x791a('0x10e')](db[_0x791a('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x791a('0x1d0')});db[_0x791a('0x1d1')]['belongsTo'](db[_0x791a('0x60')],{});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x109')],{});db['ChatTransferReport'][_0x791a('0x10e')](db[_0x791a('0x5d')],{'foreignKey':'FromChatWebsiteId','as':_0x791a('0x1c9')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x63')],{'foreignKey':'ToChatQueueId','as':_0x791a('0x1cf')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db['ChatWebsite'],{'foreignKey':_0x791a('0x1d2'),'as':_0x791a('0x1d0')});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x4b')],{});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x49')],{});db['FaxTransferReport'][_0x791a('0x10e')](db[_0x791a('0x12a')],{'foreignKey':'FromFaxAccountId','as':_0x791a('0x1c9')});db['FaxTransferReport'][_0x791a('0x10e')](db['User'],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db['FaxTransferReport'][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0x791a('0x4d')],{'foreignKey':_0x791a('0x1d3'),'as':_0x791a('0x1cf')});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x12a')],{'foreignKey':_0x791a('0x1d4'),'as':'ToAccount'});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x5a')],{});db['OpenchannelTransferReport'][_0x791a('0x10e')](db[_0x791a('0x58')],{});db[_0x791a('0xe5')][_0x791a('0x10e')](db['OpenchannelAccount'],{'foreignKey':_0x791a('0x1d5'),'as':_0x791a('0x1c9')});db['OpenchannelTransferReport'][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1ca'),'as':'FromAgent'});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x124')],{'foreignKey':_0x791a('0x1d6'),'as':'ToQueue'});db[_0x791a('0xe5')][_0x791a('0x10e')](db['OpenchannelAccount'],{'foreignKey':_0x791a('0x1d7'),'as':_0x791a('0x1d0')});db['SmsTransferReport'][_0x791a('0x10e')](db[_0x791a('0x172')],{});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsInteraction'],{});db[_0x791a('0x1d8')][_0x791a('0x10e')](db[_0x791a('0x4f')],{'foreignKey':_0x791a('0x1d9'),'as':_0x791a('0x1c9')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x791a('0x1d8')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsQueue'],{'foreignKey':_0x791a('0x1da'),'as':'ToQueue'});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x791a('0x1d0')});db[_0x791a('0xe7')][_0x791a('0x104')](db['Disposition'],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x159'),'onDelete':'cascade'});db['CmList'][_0x791a('0x104')](db[_0x791a('0x73')],{'as':'CustomFields','foreignKey':_0x791a('0x159')});db['CmList']['hasMany'](db[_0x791a('0x113')],{'as':_0x791a('0x1db'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xe7')]['hasMany'](db[_0x791a('0x6d')],{'as':_0x791a('0x13c'),'foreignKey':'ListId'});db[_0x791a('0xe7')][_0x791a('0x104')](db['CmHopperHistory'],{'as':_0x791a('0x1dc'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xe7')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x791a('0x159')});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0x791a('0x1dd'),'through':_0x791a('0x146')});db[_0x791a('0xe7')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x127')});db[_0x791a('0xe8')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x107'),'onDelete':_0x791a('0x101')});db[_0x791a('0xe8')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0xff')});db[_0x791a('0xe8')][_0x791a('0x110')](db['Team'],{'through':_0x791a('0xfe'),'as':_0x791a('0x148')});db['UserProfile']['hasMany'](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'foreignKey':'userProfileId'});db[_0x791a('0xe9')][_0x791a('0x104')](db[_0x791a('0x1de')],{'as':'UserProfileSections','foreignKey':_0x791a('0x10f'),'onDelete':_0x791a('0x101')});db['UserProfileSection'][_0x791a('0x104')](db[_0x791a('0xeb')],{'as':_0x791a('0x1df'),'foreignKey':'sectionId','onDelete':_0x791a('0x101')});db['WhatsappAccount'][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x1e0'),'onDelete':_0x791a('0x101')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x1e0')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf3')],{'as':'Messages','foreignKey':_0x791a('0x1e0')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf2')],{'as':_0x791a('0x157')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf1')],{'as':_0x791a('0x137')});db[_0x791a('0xef')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xef')][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0xef')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x1e1')});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0xf8')],{'onDelete':'restrict'});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0xef')],{'onDelete':_0x791a('0x166')});db[_0x791a('0xf1')][_0x791a('0x10e')](db[_0x791a('0x142')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db['WhatsappApplication']['belongsTo'](db['Tag'],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0xf2')][_0x791a('0x104')](db[_0x791a('0xf3')],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x791a('0x10e')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x791a('0xf2')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0xf2')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0xf2')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x19f'),'as':_0x791a('0x176')});db[_0x791a('0xf2')]['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x19f'),'as':_0x791a('0x16e')});db[_0x791a('0xf2')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x160'),'through':_0x791a('0x11d'),'foreignKey':_0x791a('0x1e2')});db['WhatsappMessage'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103')});db[_0x791a('0xf3')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db[_0x791a('0xf3')]['belongsTo'](db[_0x791a('0xf2')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':_0x791a('0x1e2')});db['WhatsappMessage']['belongsTo'](db[_0x791a('0xef')],{'as':'Account','foreignKey':_0x791a('0x1e0')});db['WhatsappQueueReport'][_0x791a('0x10e')](db[_0x791a('0xef')],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport'][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0xf2')],{});db['WhatsappQueueReport'][_0x791a('0x10e')](db[_0x791a('0xf8')],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db['WhatsappMessage'],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db[_0x791a('0xf7')][_0x791a('0x10e')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x791a('0xf2')],{});db['WhatsappTransferReport'][_0x791a('0x10e')](db[_0x791a('0xef')],{'foreignKey':_0x791a('0x1e3'),'as':'FromAccount'});db[_0x791a('0xf7')]['belongsTo'](db[_0x791a('0xef')],{'foreignKey':_0x791a('0x1e4'),'as':'ToAccount'});db[_0x791a('0xf7')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x791a('0x1cf')});db[_0x791a('0xf7')]['belongsTo'](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db[_0x791a('0xf7')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':_0x791a('0x1cd')});db['WhatsappQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x36'),'foreignKey':_0x791a('0x1e5')});db['WhatsappQueue'][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':'team_has_whatsapp_queues','as':_0x791a('0x148')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9ffd=['ScreenRecording','VoiceMailMessage','Messages','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','VoiceCallReport','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','Interactions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroupId','chat_group_has_users','CmCompany','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Actions','Fields','MetricId','Configurations','Subjects','SubjectId','FieldId','AccountId','Subject','DescriptionId','Field','VariableId','Description','int_desk_configuration_has_tags','ZohoConfiguration','Descriptions','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_square_projects','MailQueues','ChatQueues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','TrunkBackup','TrunkBackupId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserVoicePrefix','userProfileId','UserProfileSection','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','options','password','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','Team','Campaign','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','User','hasMany','VoiceRecording','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','SenderId','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','FaxQueues','SmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','WhatsappAccounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','IntervalId','Agents','Teams','voice_queues_has_cm_blacklists'];(function(_0x32be9a,_0x15bc93){var _0x35ddba=function(_0x35a804){while(--_0x35a804){_0x32be9a['push'](_0x32be9a['shift']());}};_0x35ddba(++_0x15bc93);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1d9c60,_0xf5d309){_0x1d9c60=_0x1d9c60-0x0;var _0x2bb657=_0x9ffd[_0x1d9c60];return _0x2bb657;};'use strict';var config=require(_0xd9ff('0x0'));var Sequelize=require(_0xd9ff('0x1'));var _=require(_0xd9ff('0x2'));var jstz=require('jstz');var timezone=jstz[_0xd9ff('0x3')]();config[_0xd9ff('0x1')]=_[_0xd9ff('0x4')](config[_0xd9ff('0x1')],{'database':'motion2','username':_0xd9ff('0x5'),'password':_0xd9ff('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xd9ff('0x7'),'dialectOptions':{'charset':_0xd9ff('0x8')},'logging':![],'timezone':timezone[_0xd9ff('0x9')](),'define':{'charset':_0xd9ff('0xa'),'collate':_0xd9ff('0xb')}}});config[_0xd9ff('0xc')]=_[_0xd9ff('0x4')](config[_0xd9ff('0xc')],{'database':_0xd9ff('0xd'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd9ff('0x8')},'logging':![],'timezone':timezone[_0xd9ff('0x9')](),'define':{'charset':_0xd9ff('0xa'),'collate':_0xd9ff('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd9ff('0x1')][_0xd9ff('0xe')],config[_0xd9ff('0x1')][_0xd9ff('0xf')],config['sequelize']['password'],config[_0xd9ff('0x1')][_0xd9ff('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd9ff('0xc')][_0xd9ff('0xe')],config[_0xd9ff('0xc')]['username'],config[_0xd9ff('0xc')][_0xd9ff('0x11')],config['sequelizeHistory'][_0xd9ff('0x10')])};db['User']=db['sequelize']['import']('../api/user/user.model');db[_0xd9ff('0x12')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x14'));db[_0xd9ff('0x15')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x16'));db[_0xd9ff('0x17')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x18'));db[_0xd9ff('0x19')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize']['import'](_0xd9ff('0x1a'));db['ScreenRecording']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x1b'));db[_0xd9ff('0x1c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x1d'));db['VoiceCallReport']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x1e'));db[_0xd9ff('0x1f')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0xd9ff('0x20')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x21'));db['VoiceQueueReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x22'));db[_0xd9ff('0x23')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x24'));db[_0xd9ff('0x25')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x26'));db['VoiceTransferReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x27'));db['UserVoiceQueueRt']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x28'));db[_0xd9ff('0x29')]=db['sequelize'][_0xd9ff('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd9ff('0x2a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2b'));db[_0xd9ff('0x2c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2d'));db[_0xd9ff('0x2e')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x2f'));db[_0xd9ff('0x30')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x31'));db[_0xd9ff('0x32')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x33'));db['UserWhatsappQueue']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x34'));db['MailServerIn']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x35'));db['MailServerOut']=db['sequelize']['import'](_0xd9ff('0x36'));db[_0xd9ff('0x37')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x38'));db[_0xd9ff('0x39')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0xd9ff('0x3a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x3b'));db['MailInteraction']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x3c'));db[_0xd9ff('0x3d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/mailMessage/mailMessage.model');db[_0xd9ff('0x3e')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x3f'));db[_0xd9ff('0x40')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x41'));db[_0xd9ff('0x42')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x43'));db[_0xd9ff('0x44')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xd9ff('0x45')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x46'));db[_0xd9ff('0x47')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xd9ff('0x48')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x49'));db[_0xd9ff('0x4a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4b'));db['FaxQueueReport']=db['sequelize']['import'](_0xd9ff('0x4c'));db['SmsAccount']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4d'));db['SmsApplication']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/smsApplication/smsApplication.model');db[_0xd9ff('0x4e')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x4f'));db['SmsMessage']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x50'));db['SmsQueue']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x51'));db[_0xd9ff('0x52')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x53'));db[_0xd9ff('0x54')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x55'));db[_0xd9ff('0x56')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x57'));db[_0xd9ff('0x58')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x59'));db[_0xd9ff('0x5a')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x5b'));db[_0xd9ff('0x5c')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xd9ff('0x5d')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatApplication/chatApplication.model');db[_0xd9ff('0x5e')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xd9ff('0x5f')]=db['sequelize'][_0xd9ff('0x13')]('../api/chatMessage/chatMessage.model');db[_0xd9ff('0x60')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x61'));db[_0xd9ff('0x62')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x63'));db[_0xd9ff('0x64')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x65'));db[_0xd9ff('0x66')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x67'));db['CmCompany']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x68'));db[_0xd9ff('0x69')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x6a'));db['CmHopper']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/cmHopper/cmHopper.model');db[_0xd9ff('0x6b')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x6c'));db[_0xd9ff('0x6d')]=db[_0xd9ff('0x1')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0xd9ff('0x6e')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x6f'));db[_0xd9ff('0x70')]=db[_0xd9ff('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x71'));db[_0xd9ff('0x72')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x73'));db['Automation']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x74'));db[_0xd9ff('0x75')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x76'));db[_0xd9ff('0x77')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x78'));db['Condition']=db['sequelize'][_0xd9ff('0x13')]('../api/condition/condition.model');db[_0xd9ff('0x79')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x7a'));db[_0xd9ff('0x7b')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7c'));db['Cdr']=db[_0xd9ff('0x1')]['import']('../api/cdr/cdr.model');db[_0xd9ff('0x7d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7e'));db['Schedule']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x7f'));db[_0xd9ff('0x80')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x81'));db[_0xd9ff('0x82')]=db['sequelize']['import']('../api/tag/tag.model');db[_0xd9ff('0x83')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x84'));db[_0xd9ff('0x85')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x86'));db[_0xd9ff('0x87')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/variable/variable.model');db[_0xd9ff('0x88')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/integration/integration.model');db[_0xd9ff('0x89')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x8a'));db[_0xd9ff('0x8b')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0x8c'));db[_0xd9ff('0x8d')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x8e'));db[_0xd9ff('0x8f')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x90'));db[_0xd9ff('0x91')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x92'));db[_0xd9ff('0x93')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x94'));db['AnalyticTreeReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xd9ff('0x95')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd9ff('0x96')]=db['sequelize'][_0xd9ff('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xd9ff('0x97')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x98'));db[_0xd9ff('0x99')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x9a'));db[_0xd9ff('0x9b')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0x9c'));db[_0xd9ff('0x9d')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0x9e'));db[_0xd9ff('0x9f')]=db['sequelize']['import'](_0xd9ff('0xa0'));db[_0xd9ff('0xa1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa2'));db[_0xd9ff('0xa3')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xa4'));db[_0xd9ff('0xa5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa6'));db['ZohoConfiguration']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa7'));db[_0xd9ff('0xa8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xa9'));db[_0xd9ff('0xaa')]=db['sequelize'][_0xd9ff('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd9ff('0xab')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xac'));db[_0xd9ff('0xad')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xae'));db[_0xd9ff('0xaf')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xb0'));db[_0xd9ff('0xb1')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xb2'));db[_0xd9ff('0xb3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xb4'));db[_0xd9ff('0xb5')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xb6'));db[_0xd9ff('0xb7')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xb8'));db[_0xd9ff('0xb9')]=db['sequelize'][_0xd9ff('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0xd9ff('0xba')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xbb'));db[_0xd9ff('0xbc')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xbd'));db[_0xd9ff('0xbe')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0xd9ff('0xbf')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xc0'));db[_0xd9ff('0xc1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xc2'));db[_0xd9ff('0xc3')]=db['sequelize']['import'](_0xd9ff('0xc4'));db['FreshsalesAccount']=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xd9ff('0xc5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xc6'));db['Integration']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xc7'));db[_0xd9ff('0xc8')]=db[_0xd9ff('0x1')]['import']('../api/network/network.model');db[_0xd9ff('0xc9')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xca'));db[_0xd9ff('0xcb')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xcc'));db[_0xd9ff('0xcd')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xce'));db[_0xd9ff('0xcf')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xd0'));db[_0xd9ff('0xd1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xd9ff('0xd2')]=db[_0xd9ff('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0xd9ff('0xd3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xd4'));db[_0xd9ff('0xd5')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xd6'));db[_0xd9ff('0xd7')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xd8'));db[_0xd9ff('0xd9')]=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xda'));db[_0xd9ff('0xdb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xdc'));db['SquareRecording']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xdd'));db[_0xd9ff('0xde')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/squareMessage/squareMessage.model');db[_0xd9ff('0xdf')]=db[_0xd9ff('0x1')]['import']('../api/team/team.model');db['License']=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/license/license.model');db[_0xd9ff('0xe0')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xd9ff('0x13')]('../api/migration/migration.model');db[_0xd9ff('0xe1')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xe2'));db[_0xd9ff('0xe3')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe4'));db['MailTransferReport']=db[_0xd9ff('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe5'));db[_0xd9ff('0xe6')]=db['sequelize']['import'](_0xd9ff('0xe7'));db[_0xd9ff('0xe8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xe9'));db['SmsTransferReport']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xea'));db[_0xd9ff('0xeb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xec'));db['VoicePrefix']=db[_0xd9ff('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0xd9ff('0xed')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xee'));db['UserProfileSection']=db['sequelize'][_0xd9ff('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xef'));db['UserNotification']=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf0'));db[_0xd9ff('0xf1')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf2'));db['WhatsappApplication']=db[_0xd9ff('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db[_0xd9ff('0xf3')]=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xf4'));db['WhatsappMessage']=db['sequelize'][_0xd9ff('0x13')](_0xd9ff('0xf5'));db[_0xd9ff('0xf6')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf7'));db[_0xd9ff('0xf8')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xf9'));db[_0xd9ff('0xfa')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize'][_0xd9ff('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0xd9ff('0xfb')]=db[_0xd9ff('0x1')][_0xd9ff('0x13')](_0xd9ff('0xfc'));db['TeamVoicePrefix']=db[_0xd9ff('0x1')]['import'](_0xd9ff('0xfd'));db['UserVoicePrefix']=db['sequelize']['import'](_0xd9ff('0xfe'));db['User'][_0xd9ff('0xff')](db['VoiceMail'],{'as':_0xd9ff('0x1c'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x104')],{'as':'Recordings','foreignKey':'UserId'});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x105')],{'as':_0xd9ff('0x106'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':_0xd9ff('0x108'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x109'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')]['hasMany'](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db['FaxInteraction'],{'as':_0xd9ff('0x10e'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x102')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x110'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0xf3')],{'as':_0xd9ff('0x111'),'foreignKey':_0xd9ff('0x101')});db['User'][_0xd9ff('0x103')](db[_0xd9ff('0x112')],{'as':'UserNotifications','foreignKey':_0xd9ff('0x113')});db[_0xd9ff('0x102')]['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x64')],{'as':'Groups','through':'chat_group_has_users'});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'through':_0xd9ff('0x116')});db['User']['belongsToMany'](db['CmList'],{'as':_0xd9ff('0x117'),'through':_0xd9ff('0x118')});db['User'][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x119')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x110'),'through':_0xd9ff('0x11a')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'through':_0xd9ff('0x11b')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x10e'),'through':_0xd9ff('0x11c')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'through':_0xd9ff('0x11d')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'through':_0xd9ff('0x11e')});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0xf3')],{'as':_0xd9ff('0x111'),'through':'user_has_whatsapp_interactions'});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x120'),'through':_0xd9ff('0x29'),'required':![]});db[_0xd9ff('0x102')]['belongsToMany'](db['VoicePrefix'],{'as':_0xd9ff('0x121'),'through':'UserVoicePrefix','required':![]});db['User'][_0xd9ff('0x114')](db[_0xd9ff('0x39')],{'as':'MailQueues','through':_0xd9ff('0x2c'),'required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x62')],{'as':'ChatQueues','through':_0xd9ff('0x2a'),'required':![],'hooks':!![]});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x4a')],{'as':_0xd9ff('0x122'),'through':'UserFaxQueue','required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x123')],{'as':'SmsQueues','through':_0xd9ff('0x30'),'required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db['OpenchannelQueue'],{'as':_0xd9ff('0x124'),'through':'UserOpenchannelQueue','required':![]});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0xfa')],{'as':_0xd9ff('0x125'),'through':_0xd9ff('0x126'),'required':![]});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0xeb')],{'through':_0xd9ff('0x118')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x5a')],{'as':'ChatWebsites','through':_0xd9ff('0x127')});db[_0xd9ff('0x102')]['belongsToMany'](db[_0xd9ff('0x45')],{'as':_0xd9ff('0x128'),'through':_0xd9ff('0x129')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x12a'),'through':_0xd9ff('0x12b')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x12c'),'through':_0xd9ff('0x12d')});db[_0xd9ff('0x102')][_0xd9ff('0x114')](db[_0xd9ff('0x12e')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0xd9ff('0x114')](db['WhatsappAccount'],{'as':_0xd9ff('0x12f'),'through':'user_has_whatsapp_accounts'});db['User']['belongsToMany'](db[_0xd9ff('0xdb')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0xd9ff('0x12')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x130'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x131')});db[_0xd9ff('0x15')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x17')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x132'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xd9ff('0x114')](db[_0xd9ff('0x80')],{'as':_0xd9ff('0x133'),'through':_0xd9ff('0x134')});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x105')],{'as':_0xd9ff('0x135'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd9ff('0x103')](db[_0xd9ff('0x6d')],{'as':'HopperFinals','foreignKey':_0xd9ff('0x138')});db[_0xd9ff('0x11f')]['hasMany'](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x138')});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x103')](db[_0xd9ff('0x6b')],{'as':_0xd9ff('0x13a'),'foreignKey':_0xd9ff('0x138')});db['VoiceQueue'][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'as':_0xd9ff('0x13b'),'foreignKey':'VoiceQueueId'});db[_0xd9ff('0x11f')][_0xd9ff('0x13c')](db[_0xd9ff('0x25')],{'as':'Trunk','foreignKey':_0xd9ff('0x13d')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xd9ff('0x11f')][_0xd9ff('0x13c')](db['Interval'],{'as':_0xd9ff('0x79'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x11f')]['belongsTo'](db[_0xd9ff('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x29')});db[_0xd9ff('0x11f')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'as':_0xd9ff('0x140'),'through':_0xd9ff('0xfb')});db['VoiceQueue'][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':'BlackLists','through':_0xd9ff('0x141')});db[_0xd9ff('0x104')]['belongsTo'](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x142')]['belongsTo'](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x1c')][_0xd9ff('0x103')](db[_0xd9ff('0x143')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xd9ff('0x143')]['belongsTo'](db[_0xd9ff('0x1c')],{'foreignKey':_0xd9ff('0x145'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0xd9ff('0x146')],{'as':_0xd9ff('0x147'),'foreignKey':_0xd9ff('0x148'),'constraints':![]});db['VoiceCallReport'][_0xd9ff('0x103')](db[_0xd9ff('0x20')],{'as':_0xd9ff('0x149'),'foreignKey':_0xd9ff('0x148'),'constraints':![]});db[_0xd9ff('0x14a')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':'User','foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x14a')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x14d')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x37'),'foreignKey':_0xd9ff('0x14e')});db['MailServerOut']['belongsTo'](db[_0xd9ff('0x37')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xd9ff('0x37')][_0xd9ff('0xff')](db[_0xd9ff('0x14d')],{'as':_0xd9ff('0x14f'),'onDelete':_0xd9ff('0x100')});db['MailAccount'][_0xd9ff('0xff')](db['MailServerOut'],{'as':_0xd9ff('0x150'),'onDelete':_0xd9ff('0x100')});db['MailAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x14e'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db['CannedAnswer'],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x14e')});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db[_0xd9ff('0x3d')],{'as':_0xd9ff('0x144'),'foreignKey':'MailAccountId'});db[_0xd9ff('0x37')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':'Interactions'});db[_0xd9ff('0x37')]['hasMany'](db[_0xd9ff('0x3e')],{'as':'Applications'});db[_0xd9ff('0x37')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153')});db['MailAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0x83')],{'as':_0xd9ff('0x83'),'foreignKey':_0xd9ff('0x154')});db[_0xd9ff('0x37')]['belongsTo'](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0x37')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xd9ff('0x39')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x2c')});db[_0xd9ff('0x39')][_0xd9ff('0x114')](db['Team'],{'through':_0xd9ff('0x157'),'as':_0xd9ff('0x140')});db[_0xd9ff('0x10f')][_0xd9ff('0x103')](db[_0xd9ff('0x3d')],{'as':_0xd9ff('0x144'),'onDelete':'cascade','foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x10f')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x14e')});db['MailInteraction']['belongsTo'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x10f')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db['MailInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x15b'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x10f')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x15b'),'as':'ThroughTags'});db['MailInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11a'),'foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x3d')][_0xd9ff('0x103')](db[_0xd9ff('0xe1')],{'as':'Attachments','onDelete':_0xd9ff('0x100')});db['MailMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x3d')]['belongsTo'](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x158')});db[_0xd9ff('0x3d')]['belongsTo'](db[_0xd9ff('0x37')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x5a'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x3d')][_0xd9ff('0x13c')](db[_0xd9ff('0x60')],{'as':_0xd9ff('0x60'),'foreignKey':_0xd9ff('0x160')});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db['MailApplication'][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{'onDelete':'restrict'});db['MailApplication'][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'onDelete':'restrict'});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db['Interval'],{'onDelete':_0xd9ff('0x161'),'foreignKey':'IntervalId'});db[_0xd9ff('0x3e')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x40')]['belongsTo'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x40')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db['MailQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{});db[_0xd9ff('0x42')]['hasMany'](db['DashboardItem'],{'as':_0xd9ff('0x164'),'onDelete':_0xd9ff('0x100')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x165')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x167')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0x45')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':'Exntensions','onDelete':_0xd9ff('0x100')});db['FaxAccount'][_0xd9ff('0x103')](db['FaxMessage'],{'as':_0xd9ff('0x144')});db[_0xd9ff('0x45')][_0xd9ff('0x13c')](db['Trunk'],{'as':'Trunk'});db['FaxAccount']['belongsTo'](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x45')][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x45')][_0xd9ff('0x114')](db['User'],{'as':'Agents','through':_0xd9ff('0x129')});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x167')]['belongsTo'](db[_0xd9ff('0x4a')],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xd9ff('0x167')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':_0xd9ff('0x161'),'foreignKey':'TagId'});db[_0xd9ff('0x47')][_0xd9ff('0x103')](db[_0xd9ff('0x48')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x168')});db['FaxInteraction']['belongsTo'](db[_0xd9ff('0x45')],{'as':'Account','foreignKey':_0xd9ff('0x165')});db['FaxInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':'ContactId'});db[_0xd9ff('0x47')][_0xd9ff('0x13c')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x169'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':'fax_interaction_has_tags','as':_0xd9ff('0x16a')});db[_0xd9ff('0x47')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11c'),'foreignKey':_0xd9ff('0x168')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['User'],{'onDelete':'cascade','as':'User'});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['FaxInteraction'],{'as':_0xd9ff('0x15e'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db['Attachment'],{'as':_0xd9ff('0xe1'),'foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x48')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xd9ff('0x4a')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x2e')});db[_0xd9ff('0x4a')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x16c'),'as':_0xd9ff('0x140')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{});db['FaxQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x47')],{});db[_0xd9ff('0x16d')]['belongsTo'](db[_0xd9ff('0x48')],{});db[_0xd9ff('0x16d')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db['FaxQueueReport'][_0xd9ff('0x13c')](db['FaxQueue'],{});db['SmsAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x16e'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db['CannedAnswer'],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x16e')});db['SmsAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x16f')],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x12e')][_0xd9ff('0x103')](db[_0xd9ff('0x170')],{'as':'Applications'});db['SmsAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x12e')][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd9ff('0x12e')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'user_has_sms_accounts'});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db['SmsApplication']['belongsTo'](db[_0xd9ff('0x123')],{'onDelete':'restrict'});db['SmsApplication'][_0xd9ff('0x13c')](db['SmsAccount'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'onDelete':_0xd9ff('0x161'),'foreignKey':'IntervalId'});db[_0xd9ff('0x170')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db['SmsInteraction']['hasMany'](db[_0xd9ff('0x16f')],{'as':'Messages','onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xd9ff('0x4e')]['belongsTo'](db['SmsAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x4e')][_0xd9ff('0x13c')](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x4e')][_0xd9ff('0x13c')](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':'UserId'});db['SmsInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x171'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x4e')][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x171'),'as':_0xd9ff('0x16a')});db['SmsInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11d'),'foreignKey':_0xd9ff('0x172')});db[_0xd9ff('0x16f')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x16f')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'onDelete':'cascade','as':_0xd9ff('0x14b')});db[_0xd9ff('0x16f')][_0xd9ff('0x13c')](db[_0xd9ff('0x4e')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x172')});db['SmsMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'as':'Account','foreignKey':_0xd9ff('0x16e')});db[_0xd9ff('0x123')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x30'),'foreignKey':_0xd9ff('0x173')});db[_0xd9ff('0x123')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':'team_has_sms_queues','as':_0xd9ff('0x140')});db[_0xd9ff('0x52')]['hasMany'](db[_0xd9ff('0x77')],{'as':'Dispositions','foreignKey':_0xd9ff('0x174'),'onDelete':_0xd9ff('0x100')});db['OpenchannelAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0xd9ff('0x52')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xd9ff('0x166'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x103')](db[_0xd9ff('0x56')],{'as':'Messages','foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x103')](db[_0xd9ff('0x54')],{'as':'Applications','foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x52')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0x52')][_0xd9ff('0x13c')](db['Pause'],{'as':_0xd9ff('0x155'),'foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0x52')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x12d')});db['OpenchannelApplication'][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x58')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x175')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x54')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x162')});db['OpenchannelInteraction'][_0xd9ff('0x103')](db[_0xd9ff('0x56')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x10a')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x174')});db['OpenchannelInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x10a')]['belongsTo'](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db['OpenchannelInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x177'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0x10a')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':'openchannel_interaction_has_tags','as':_0xd9ff('0x16a')});db['OpenchannelInteraction'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x11e'),'foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x56')][_0xd9ff('0x13c')](db['User'],{'onDelete':_0xd9ff('0x100'),'as':'User'});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b')});db['OpenchannelMessage'][_0xd9ff('0x13c')](db['OpenchannelInteraction'],{'onDelete':_0xd9ff('0x100'),'as':'Interaction','foreignKey':_0xd9ff('0x176')});db[_0xd9ff('0x56')]['belongsTo'](db[_0xd9ff('0xe1')],{'as':_0xd9ff('0xe1'),'foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x56')]['belongsTo'](db[_0xd9ff('0x52')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x174')});db[_0xd9ff('0x58')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0xd9ff('0x175')});db[_0xd9ff('0x58')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x178'),'as':_0xd9ff('0x140')});db['ChatWebsite'][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x15f'),'onDelete':_0xd9ff('0x100')});db['ChatWebsite'][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db[_0xd9ff('0x66')],{'as':_0xd9ff('0x179')});db['ChatWebsite'][_0xd9ff('0x103')](db['ChatInteraction'],{'as':_0xd9ff('0x166')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db[_0xd9ff('0x5d')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0x5a')][_0xd9ff('0x103')](db['ChatMessage'],{'as':_0xd9ff('0x144')});db[_0xd9ff('0x5a')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db['ChatWebsite']['belongsTo'](db[_0xd9ff('0x79')],{'as':_0xd9ff('0x79'),'foreignKey':_0xd9ff('0x13e')});db['ChatWebsite'][_0xd9ff('0x13c')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xd9ff('0x14e')});db[_0xd9ff('0x5a')][_0xd9ff('0x13c')](db['Pause'],{'as':_0xd9ff('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':'ListId'});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x10a')],{});db['OpenchannelQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x56')],{});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0x5c')][_0xd9ff('0x13c')](db[_0xd9ff('0x58')],{});db[_0xd9ff('0x5d')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x17a'),'foreignKey':'UserId','onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x62')],{'as':'Queue','foreignKey':_0xd9ff('0x17b'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x17c'),'foreignKey':_0xd9ff('0x15f'),'onDelete':'restrict'});db[_0xd9ff('0x5d')][_0xd9ff('0x13c')](db[_0xd9ff('0x82')],{'onDelete':_0xd9ff('0x161'),'foreignKey':'TagId'});db['ChatInteraction'][_0xd9ff('0x103')](db[_0xd9ff('0x5f')],{'as':'Messages','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':'ContactId'});db[_0xd9ff('0x5e')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0x5e')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x17e'),'as':_0xd9ff('0x15c')});db['ChatInteraction']['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x17e'),'as':'ThroughTags'});db[_0xd9ff('0x5e')][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x15d'),'through':'user_has_chat_interactions','foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x102')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x5e')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x15e'),'foreignKey':_0xd9ff('0x17d')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db[_0xd9ff('0xe1')],{'as':'Attachment','foreignKey':_0xd9ff('0x16b')});db[_0xd9ff('0x5f')][_0xd9ff('0x13c')](db['ChatWebsite'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db[_0xd9ff('0x60')][_0xd9ff('0x103')](db[_0xd9ff('0xe1')],{'as':_0xd9ff('0x17f'),'foreignKey':_0xd9ff('0x160'),'onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x60')]['belongsTo'](db[_0xd9ff('0x69')],{'onDelete':_0xd9ff('0x100'),'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatOfflineMessage']['belongsTo'](db[_0xd9ff('0x5a')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x15f')});db['ChatQueue'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':'team_has_chat_queues','as':_0xd9ff('0x140')});db[_0xd9ff('0x64')][_0xd9ff('0x103')](db[_0xd9ff('0xcb')],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x180'),'onDelete':'cascade'});db[_0xd9ff('0x64')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x135'),'through':_0xd9ff('0x181')});db[_0xd9ff('0x66')][_0xd9ff('0x13c')](db['ChatWebsite'],{'as':_0xd9ff('0x17c'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xd9ff('0x103')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'foreignKey':'CompanyId'});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')]['hasMany'](db[_0xd9ff('0x70')],{'as':_0xd9ff('0x70'),'foreignKey':_0xd9ff('0x14c')});db['CmContact'][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'as':'JscriptySessions','foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x10a')],{'as':_0xd9ff('0x10b'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x5e')],{'as':_0xd9ff('0x10c'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db['CmContact']['hasMany'](db[_0xd9ff('0x4e')],{'as':_0xd9ff('0x10d'),'foreignKey':'ContactId','onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x47')],{'as':_0xd9ff('0x10e'),'foreignKey':_0xd9ff('0x14c'),'onDelete':'restrict'});db[_0xd9ff('0x69')][_0xd9ff('0x103')](db[_0xd9ff('0x10f')],{'as':'MailInteractions','foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x69')][_0xd9ff('0x13c')](db[_0xd9ff('0x182')],{'as':_0xd9ff('0x183'),'foreignKey':'CompanyId'});db[_0xd9ff('0x69')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153'),'onDelete':'cascade'});db[_0xd9ff('0x69')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x116')});db[_0xd9ff('0x69')]['belongsToMany'](db[_0xd9ff('0x82')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xd9ff('0x69')]['belongsToMany'](db['Tag'],{'through':_0xd9ff('0x184'),'as':_0xd9ff('0x16a')});db['CmHopper']['belongsTo'](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153'),'onDelete':'cascade'});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x17a'),'foreignKey':_0xd9ff('0x101')});db['CmHopper'][_0xd9ff('0x13c')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x185'),'foreignKey':_0xd9ff('0x138'),'onDelete':_0xd9ff('0x100')});db['CmHopper'][_0xd9ff('0x13c')](db[_0xd9ff('0xe0')],{'as':'Campaign','foreignKey':_0xd9ff('0x186'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x136')][_0xd9ff('0x13c')](db['User'],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x187')});db['CmHopperBlack']['belongsTo'](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xd9ff('0x100')});db['CmHopperBlack'][_0xd9ff('0x13c')](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x6b')][_0xd9ff('0x13c')](db['VoiceQueue'],{'as':_0xd9ff('0x185'),'foreignKey':_0xd9ff('0x138'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x6b')][_0xd9ff('0x13c')](db[_0xd9ff('0xe0')],{'as':_0xd9ff('0xe0'),'foreignKey':_0xd9ff('0x186'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x18a'),'singular':_0xd9ff('0x18b')},'foreignKey':_0xd9ff('0x18c'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x18d'),'singular':_0xd9ff('0x18e')},'foreignKey':_0xd9ff('0x18f'),'onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x188')][_0xd9ff('0x103')](db[_0xd9ff('0x72')],{'as':'Actions','foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x77')]['hasMany'](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x190'),'onDelete':_0xd9ff('0x100')});db['Interval'][_0xd9ff('0x103')](db[_0xd9ff('0x79')],{'as':'Intervals','foreignKey':_0xd9ff('0x13e'),'onDelete':_0xd9ff('0x100'),'hooks':!![],'required':![]});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'foreignKey':_0xd9ff('0x13e'),'onDelete':'restrict'});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db['MailApplication'],{'as':_0xd9ff('0x191'),'foreignKey':'IntervalId'});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x5d')],{'as':_0xd9ff('0x192'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x79')][_0xd9ff('0x103')](db[_0xd9ff('0x167')],{'as':_0xd9ff('0x193'),'foreignKey':'IntervalId'});db[_0xd9ff('0x79')]['hasMany'](db['SmsApplication'],{'as':_0xd9ff('0x194'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x195')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{});db[_0xd9ff('0x195')][_0xd9ff('0x13c')](db[_0xd9ff('0x8d')],{'foreignKey':_0xd9ff('0x196')});db['Schedule'][_0xd9ff('0x13c')](db[_0xd9ff('0x8b')],{'foreignKey':_0xd9ff('0x197')});db[_0xd9ff('0x80')][_0xd9ff('0x114')](db[_0xd9ff('0x19')],{'as':_0xd9ff('0x198'),'through':_0xd9ff('0x134'),'onDelete':_0xd9ff('0x161')});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0x69')],{'through':_0xd9ff('0x184')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x5e')],{'through':_0xd9ff('0x17e')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x10f')],{'through':'mail_interaction_has_tags'});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db[_0xd9ff('0x4e')],{'through':'sms_interaction_has_tags'});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0x47')],{'through':_0xd9ff('0x169')});db[_0xd9ff('0x82')][_0xd9ff('0x114')](db['OpenchannelInteraction'],{'through':_0xd9ff('0x177')});db['Tag'][_0xd9ff('0x114')](db[_0xd9ff('0xf3')],{'through':_0xd9ff('0x199')});db[_0xd9ff('0x85')][_0xd9ff('0x103')](db[_0xd9ff('0x189')],{'as':{'plural':_0xd9ff('0x19a'),'singular':_0xd9ff('0x19b')},'foreignKey':_0xd9ff('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0xd9ff('0x85')][_0xd9ff('0x103')](db['Condition'],{'as':{'plural':_0xd9ff('0x19d'),'singular':_0xd9ff('0x19e')},'foreignKey':'TriggerAnyId','onDelete':_0xd9ff('0x100'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xd9ff('0x72')],{'as':_0xd9ff('0x19f'),'foreignKey':'TriggerId','onDelete':_0xd9ff('0x100'),'hooks':!![]});db[_0xd9ff('0x8b')][_0xd9ff('0x103')](db['AnalyticFieldReport'],{'as':_0xd9ff('0x1a0'),'onDelete':'cascade','foreignKey':_0xd9ff('0x197'),'hooks':!![]});db[_0xd9ff('0x8d')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x196')});db[_0xd9ff('0x91')]['hasMany'](db[_0xd9ff('0x93')],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a1')});db['AnalyticFieldReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x91')],{'foreignKey':_0xd9ff('0x1a1')});db['SalesforceAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x96')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':'AccountId'});db[_0xd9ff('0x96')][_0xd9ff('0x103')](db['SalesforceField'],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x96')]['hasMany'](db[_0xd9ff('0x97')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':'DescriptionId'});db[_0xd9ff('0x96')]['hasMany'](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0x96')][_0xd9ff('0x13c')](db[_0xd9ff('0x95')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':'Description','foreignKey':_0xd9ff('0x1a8')});db['SalesforceField'][_0xd9ff('0x103')](db[_0xd9ff('0x97')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['SalesforceField']['belongsTo'](db[_0xd9ff('0x87')],{'as':'Variable','foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x99')][_0xd9ff('0x103')](db['SugarcrmConfiguration'],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x9b')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a3'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x9b')]['hasMany'](db[_0xd9ff('0x9d')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0x9b')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db['SugarcrmConfiguration'][_0xd9ff('0x13c')](db['SugarcrmAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x9d')]['hasMany'](db['SugarcrmField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0x9d')][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['SugarcrmField'][_0xd9ff('0x103')](db[_0xd9ff('0x9d')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0x9d')]['belongsTo'](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x9f')]['hasMany'](db[_0xd9ff('0xa1')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db['DeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':'Subjects','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xa1')]['hasMany'](db[_0xd9ff('0xa3')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':'Fields','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa1')][_0xd9ff('0x13c')](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xd9ff('0xa1')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x1ac')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db[_0xd9ff('0xa3')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db['DeskField'],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xa3')][_0xd9ff('0x103')](db['DeskField'],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa3')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xa5')][_0xd9ff('0x103')](db[_0xd9ff('0x1ad')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1a3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1ae'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0x1ad')][_0xd9ff('0x103')](db['ZohoField'],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xd9ff('0x1ad')]['belongsTo'](db[_0xd9ff('0xa5')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db['ZohoField'][_0xd9ff('0x103')](db[_0xd9ff('0xa8')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xa8')][_0xd9ff('0x103')](db['ZohoField'],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xa8')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xaa')][_0xd9ff('0x103')](db[_0xd9ff('0xab')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Subjects','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Descriptions','foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xab')][_0xd9ff('0x103')](db['ZendeskField'],{'as':_0xd9ff('0x1a0'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xd9ff('0xaa')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db['ZendeskConfiguration'][_0xd9ff('0x114')](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x1af')});db[_0xd9ff('0xad')]['hasMany'](db[_0xd9ff('0xad')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xad')]['hasMany'](db[_0xd9ff('0xad')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xad')][_0xd9ff('0x103')](db[_0xd9ff('0xad')],{'as':'Field','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xad')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xaf')][_0xd9ff('0x103')](db['FreshdeskConfiguration'],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb1')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb1')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xb1')][_0xd9ff('0x13c')](db[_0xd9ff('0xaf')],{'as':'Account','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb1')][_0xd9ff('0x114')](db['Tag'],{'through':_0xd9ff('0x1b0')});db['FreshdeskField'][_0xd9ff('0x103')](db['FreshdeskField'],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb3')][_0xd9ff('0x103')](db[_0xd9ff('0xb3')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0xd9ff('0xb3')],{'as':_0xd9ff('0x1a9'),'foreignKey':'FieldId'});db['FreshdeskField'][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':'VariableId'});db[_0xd9ff('0xb5')]['hasMany'](db[_0xd9ff('0xb7')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a6')});db['VtigerConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a3'),'foreignKey':'SubjectId'});db[_0xd9ff('0xb7')]['hasMany'](db['VtigerField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a0'),'foreignKey':'FieldId'});db[_0xd9ff('0xb7')][_0xd9ff('0x13c')](db['VtigerAccount'],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xb9')]['hasMany'](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a7'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xb9')]['hasMany'](db['VtigerField'],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['VtigerField']['hasMany'](db[_0xd9ff('0xb9')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xb9')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xba')][_0xd9ff('0x103')](db[_0xd9ff('0xbc')],{'as':_0xd9ff('0x1a2'),'onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db['ServicenowConfiguration'][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1a3'),'foreignKey':'SubjectId'});db[_0xd9ff('0xbc')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Descriptions','foreignKey':_0xd9ff('0x1a8')});db[_0xd9ff('0xbc')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Fields','foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xbc')][_0xd9ff('0x13c')](db[_0xd9ff('0xba')],{'as':_0xd9ff('0x159'),'foreignKey':'AccountId'});db['ServicenowField'][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xbe')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1ab'),'foreignKey':'DescriptionId'});db[_0xd9ff('0xbe')][_0xd9ff('0x103')](db[_0xd9ff('0xbe')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xbe')][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':'Variable','foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0xbf')]['hasMany'](db[_0xd9ff('0xc1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xc1')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a3'),'onDelete':_0xd9ff('0x100'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Descriptions','onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a8')});db['Dynamics365Configuration'][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a0'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1a5')});db['Dynamics365Configuration'][_0xd9ff('0x13c')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Subject','foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd9ff('0xc3')][_0xd9ff('0x103')](db[_0xd9ff('0xc3')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['Dynamics365Field']['belongsTo'](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':_0xd9ff('0x1aa')});db[_0xd9ff('0x1b1')][_0xd9ff('0x103')](db[_0xd9ff('0xc5')],{'as':_0xd9ff('0x1a2'),'onDelete':_0xd9ff('0x100'),'foreignKey':'AccountId'});db[_0xd9ff('0xc5')]['hasMany'](db['FreshsalesField'],{'as':_0xd9ff('0x1a3'),'foreignKey':_0xd9ff('0x1a4')});db[_0xd9ff('0xc5')][_0xd9ff('0x103')](db['FreshsalesField'],{'as':_0xd9ff('0x1ae'),'foreignKey':'DescriptionId'});db[_0xd9ff('0xc5')][_0xd9ff('0x103')](db['FreshsalesField'],{'as':_0xd9ff('0x1a0'),'foreignKey':_0xd9ff('0x1a5')});db[_0xd9ff('0xc5')][_0xd9ff('0x13c')](db[_0xd9ff('0x1b1')],{'as':_0xd9ff('0x159'),'foreignKey':_0xd9ff('0x1a6')});db[_0xd9ff('0x1b2')]['hasMany'](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1a7'),'foreignKey':'SubjectId'});db[_0xd9ff('0x1b2')][_0xd9ff('0x103')](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1ab'),'foreignKey':_0xd9ff('0x1a8')});db['FreshsalesField'][_0xd9ff('0x103')](db[_0xd9ff('0x1b2')],{'as':_0xd9ff('0x1a9'),'foreignKey':_0xd9ff('0x1a5')});db['FreshsalesField'][_0xd9ff('0x13c')](db[_0xd9ff('0x87')],{'as':_0xd9ff('0x87'),'foreignKey':'VariableId'});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db['ChatWebsite'],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db['CmContact'],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db['ChatQueueReport'][_0xd9ff('0x13c')](db['ChatInteraction'],{});db['ChatQueueReport'][_0xd9ff('0x13c')](db['ChatMessage'],{});db['ChatQueueReport'][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0xc9')][_0xd9ff('0x13c')](db[_0xd9ff('0x62')],{});db[_0xd9ff('0xcb')][_0xd9ff('0x13c')](db['User'],{'onDelete':'cascade','foreignKey':_0xd9ff('0x1b3')});db['ChatInternalMessage'][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1b4')});db[_0xd9ff('0xd1')][_0xd9ff('0x103')](db[_0xd9ff('0xcf')],{'foreignKey':'SessionId','onDelete':_0xd9ff('0x100')});db['JscriptySessionReport']['hasMany'](db[_0xd9ff('0xcd')],{'foreignKey':_0xd9ff('0x1b5'),'onDelete':_0xd9ff('0x100')});db['SmsQueueReport'][_0xd9ff('0x13c')](db['SmsAccount'],{});db['SmsQueueReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xeb')],{'as':'List','foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xd2')][_0xd9ff('0x13c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xd9ff('0xd2')]['belongsTo'](db[_0xd9ff('0x4e')],{});db[_0xd9ff('0xd2')]['belongsTo'](db[_0xd9ff('0x16f')],{});db['SmsQueueReport'][_0xd9ff('0x13c')](db['User'],{});db[_0xd9ff('0xd2')][_0xd9ff('0x13c')](db[_0xd9ff('0x123')],{});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xd1')],{'foreignKey':_0xd9ff('0x1b6')});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xcf')],{'foreignKey':_0xd9ff('0x1b6')});db[_0xd9ff('0xd7')][_0xd9ff('0x103')](db[_0xd9ff('0xcd')],{'foreignKey':'ProjectId'});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xd9ff('0x15d'),'through':_0xd9ff('0x1b7')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':'Agents','through':_0xd9ff('0x119')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'through':_0xd9ff('0xfb'),'as':_0xd9ff('0x120')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xd9ff('0x1b8')});db['Team'][_0xd9ff('0x114')](db[_0xd9ff('0x62')],{'through':'team_has_chat_queues','as':_0xd9ff('0x1b9')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x4a')],{'through':_0xd9ff('0x16c'),'as':_0xd9ff('0x122')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x123')],{'through':_0xd9ff('0x1ba'),'as':_0xd9ff('0x1bb')});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':_0xd9ff('0x178'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db['WhatsappQueue'],{'through':_0xd9ff('0x1bc'),'as':_0xd9ff('0x125')});db[_0xd9ff('0xdf')][_0xd9ff('0x114')](db[_0xd9ff('0x1bd')],{'through':_0xd9ff('0x1be'),'as':_0xd9ff('0x121')});db['Campaign'][_0xd9ff('0x103')](db[_0xd9ff('0x136')],{'as':_0xd9ff('0x137'),'foreignKey':'CampaignId'});db['Campaign'][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x186')});db[_0xd9ff('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':_0xd9ff('0x139'),'foreignKey':_0xd9ff('0x186')});db[_0xd9ff('0xe0')][_0xd9ff('0x103')](db[_0xd9ff('0x6b')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xd9ff('0xe0')]['belongsTo'](db[_0xd9ff('0x25')],{'as':_0xd9ff('0x25'),'foreignKey':_0xd9ff('0x13d')});db['Campaign'][_0xd9ff('0x13c')](db[_0xd9ff('0x25')],{'as':_0xd9ff('0x1bf'),'foreignKey':_0xd9ff('0x1c0')});db[_0xd9ff('0xe0')][_0xd9ff('0x13c')](db[_0xd9ff('0x79')],{'as':'Interval','foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0xe0')][_0xd9ff('0x13c')](db['SquareProject'],{'as':_0xd9ff('0xdb'),'foreignKey':'SquareProjectId'});db[_0xd9ff('0xe0')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x117'),'through':_0xd9ff('0x1c1')});db[_0xd9ff('0xe0')][_0xd9ff('0x114')](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x1c2'),'through':_0xd9ff('0x1c3')});db[_0xd9ff('0xe1')][_0xd9ff('0x13c')](db[_0xd9ff('0x60')],{'as':_0xd9ff('0x60'),'foreignKey':_0xd9ff('0x160')});db['MailTransferReport']['belongsTo'](db[_0xd9ff('0x3d')],{});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x10f')],{});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'foreignKey':_0xd9ff('0x1c5'),'as':_0xd9ff('0x1c6')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1c4')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x39')],{'foreignKey':'ToMailQueueId','as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1c4')][_0xd9ff('0x13c')](db[_0xd9ff('0x37')],{'foreignKey':_0xd9ff('0x1ca'),'as':'ToAccount'});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db[_0xd9ff('0x5f')],{});db['ChatTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x5e')],{});db[_0xd9ff('0x1cb')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xd9ff('0x1cc'),'as':_0xd9ff('0x1c6')});db[_0xd9ff('0x1cb')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1cb')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db['ChatQueue'],{'foreignKey':_0xd9ff('0x1cf'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1cb')][_0xd9ff('0x13c')](db[_0xd9ff('0x5a')],{'foreignKey':'ToChatWebsiteId','as':_0xd9ff('0x1d0')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db['FaxMessage'],{});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db['FaxInteraction'],{});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'foreignKey':_0xd9ff('0x1d1'),'as':'FromAccount'});db[_0xd9ff('0xe6')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'FromUserId','as':_0xd9ff('0x1c8')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':_0xd9ff('0x1ce')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x4a')],{'foreignKey':_0xd9ff('0x1d2'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xe6')][_0xd9ff('0x13c')](db[_0xd9ff('0x45')],{'foreignKey':_0xd9ff('0x1d3'),'as':'ToAccount'});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db['OpenchannelMessage'],{});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x10a')],{});db['OpenchannelTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'foreignKey':_0xd9ff('0x1d4'),'as':_0xd9ff('0x1c6')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db['User'],{'foreignKey':'FromUserId','as':_0xd9ff('0x1c8')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db[_0xd9ff('0xe8')]['belongsTo'](db[_0xd9ff('0x58')],{'foreignKey':_0xd9ff('0x1d5'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xe8')][_0xd9ff('0x13c')](db[_0xd9ff('0x52')],{'foreignKey':_0xd9ff('0x1d6'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x16f')],{});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x4e')],{});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'foreignKey':'FromSmsAccountId','as':_0xd9ff('0x1c6')});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db['User'],{'foreignKey':_0xd9ff('0x1c7'),'as':_0xd9ff('0x1c8')});db[_0xd9ff('0x1d7')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':'ToUserId','as':_0xd9ff('0x1ce')});db['SmsTransferReport'][_0xd9ff('0x13c')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xd9ff('0x1c9')});db[_0xd9ff('0x1d7')][_0xd9ff('0x13c')](db[_0xd9ff('0x12e')],{'foreignKey':_0xd9ff('0x1d8'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xd9ff('0xeb')]['hasMany'](db[_0xd9ff('0x1d9')],{'as':_0xd9ff('0x1da'),'foreignKey':'ListId'});db[_0xd9ff('0xeb')]['hasMany'](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x115'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd9ff('0x153')});db['CmList'][_0xd9ff('0x103')](db[_0xd9ff('0x6e')],{'as':_0xd9ff('0x109'),'foreignKey':'ListId'});db[_0xd9ff('0xeb')][_0xd9ff('0x103')](db[_0xd9ff('0x70')],{'as':'ReportAgentPreview','foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xeb')][_0xd9ff('0x114')](db[_0xd9ff('0x11f')],{'as':_0xd9ff('0x1db'),'through':'voice_queues_has_cm_lists'});db[_0xd9ff('0xeb')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'cm_user_has_lists'});db[_0xd9ff('0x1bd')][_0xd9ff('0x103')](db[_0xd9ff('0x17')],{'as':_0xd9ff('0x107'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x1bd')][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':_0xd9ff('0x1dc')});db[_0xd9ff('0x1bd')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x1be'),'as':_0xd9ff('0x140')});db[_0xd9ff('0xed')][_0xd9ff('0x103')](db['User'],{'as':'Users','foreignKey':_0xd9ff('0x1dd')});db[_0xd9ff('0xed')][_0xd9ff('0x103')](db[_0xd9ff('0x1de')],{'as':_0xd9ff('0x1df'),'foreignKey':'userProfileId','onDelete':_0xd9ff('0x100')});db[_0xd9ff('0x1de')][_0xd9ff('0x103')](db[_0xd9ff('0x1e0')],{'as':'Resources','foreignKey':_0xd9ff('0x1e1'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db[_0xd9ff('0x77')],{'as':_0xd9ff('0x151'),'foreignKey':_0xd9ff('0x1e2'),'onDelete':_0xd9ff('0x100')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db[_0xd9ff('0x75')],{'as':_0xd9ff('0x152'),'foreignKey':_0xd9ff('0x1e2')});db[_0xd9ff('0xf1')][_0xd9ff('0x103')](db['WhatsappMessage'],{'as':_0xd9ff('0x144'),'foreignKey':_0xd9ff('0x1e2')});db[_0xd9ff('0xf1')]['hasMany'](db[_0xd9ff('0xf3')],{'as':'Interactions'});db['WhatsappAccount'][_0xd9ff('0x103')](db[_0xd9ff('0x1e3')],{'as':_0xd9ff('0x132')});db[_0xd9ff('0xf1')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db['WhatsappAccount'][_0xd9ff('0x13c')](db[_0xd9ff('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0xd9ff('0x156')});db[_0xd9ff('0xf1')]['belongsToMany'](db[_0xd9ff('0x102')],{'as':'Agents','through':_0xd9ff('0x1e4')});db[_0xd9ff('0x1e3')]['belongsTo'](db['User'],{'onDelete':_0xd9ff('0x161')});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['WhatsappAccount'],{'onDelete':_0xd9ff('0x161')});db['WhatsappApplication'][_0xd9ff('0x13c')](db['Interval'],{'onDelete':_0xd9ff('0x161'),'foreignKey':_0xd9ff('0x13e')});db[_0xd9ff('0x1e3')][_0xd9ff('0x13c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xd9ff('0x162')});db[_0xd9ff('0xf3')][_0xd9ff('0x103')](db[_0xd9ff('0x1e5')],{'as':_0xd9ff('0x144'),'onDelete':_0xd9ff('0x100'),'foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0xf3')][_0xd9ff('0x13c')](db[_0xd9ff('0xf1')],{'as':'Account','foreignKey':_0xd9ff('0x1e2')});db['WhatsappInteraction'][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd9ff('0xf3')]['belongsTo'](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x15a'),'foreignKey':_0xd9ff('0x101')});db[_0xd9ff('0xf3')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x199'),'as':_0xd9ff('0x15c')});db[_0xd9ff('0xf3')]['belongsToMany'](db[_0xd9ff('0x82')],{'through':_0xd9ff('0x199'),'as':_0xd9ff('0x16a')});db['WhatsappInteraction'][_0xd9ff('0x114')](db['User'],{'as':_0xd9ff('0x15d'),'through':'user_has_whatsapp_interactions','foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x102')});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db['CmContact'],{'onDelete':_0xd9ff('0x100'),'as':'Contact'});db[_0xd9ff('0x1e5')][_0xd9ff('0x13c')](db[_0xd9ff('0xf3')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xd9ff('0x1e6')});db[_0xd9ff('0x1e5')]['belongsTo'](db[_0xd9ff('0xf1')],{'as':_0xd9ff('0x159'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xd9ff('0x13c')](db['WhatsappAccount'],{});db[_0xd9ff('0xf6')]['belongsTo'](db[_0xd9ff('0xeb')],{'as':_0xd9ff('0x163'),'foreignKey':_0xd9ff('0x153')});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x69')],{'as':_0xd9ff('0x14b'),'foreignKey':_0xd9ff('0x14c')});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db['WhatsappInteraction'],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0xfa')],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x1e5')],{});db[_0xd9ff('0xf6')][_0xd9ff('0x13c')](db[_0xd9ff('0x102')],{});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db['WhatsappMessage'],{});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db[_0xd9ff('0xf3')],{});db['WhatsappTransferReport'][_0xd9ff('0x13c')](db[_0xd9ff('0xf1')],{'foreignKey':_0xd9ff('0x1e7'),'as':'FromAccount'});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0xf1')],{'foreignKey':_0xd9ff('0x1e8'),'as':_0xd9ff('0x1d0')});db[_0xd9ff('0xf8')][_0xd9ff('0x13c')](db[_0xd9ff('0xfa')],{'foreignKey':_0xd9ff('0x1e9'),'as':_0xd9ff('0x1c9')});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1c7'),'as':'FromAgent'});db[_0xd9ff('0xf8')]['belongsTo'](db[_0xd9ff('0x102')],{'foreignKey':_0xd9ff('0x1cd'),'as':_0xd9ff('0x1ce')});db['WhatsappQueue'][_0xd9ff('0x114')](db[_0xd9ff('0x102')],{'as':_0xd9ff('0x13f'),'through':'UserWhatsappQueue','foreignKey':_0xd9ff('0x1ea')});db[_0xd9ff('0xfa')][_0xd9ff('0x114')](db[_0xd9ff('0xdf')],{'through':_0xd9ff('0x1bc'),'as':'Teams'});module[_0xd9ff('0x1eb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6fb6c63..9bd4553 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5484=['./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','format','method','x-forwarded-for','headers','connection','remoteAddress','url','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','other','agent_name','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/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/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/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/faxAccount','./api/faxMessage','/api/fax/queues','./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/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./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/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/condition','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/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/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString','replace','@@{','lodash','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth'];(function(_0x494df3,_0xc727b6){var _0x372aab=function(_0x2ffa63){while(--_0x2ffa63){_0x494df3['push'](_0x494df3['shift']());}};_0x372aab(++_0xc727b6);}(_0x5484,0x145));var _0x4548=function(_0x41f992,_0x572f6e){_0x41f992=_0x41f992-0x0;var _0x3ae51d=_0x5484[_0x41f992];return _0x3ae51d;};'use strict';var _=require(_0x4548('0x0'));var path=require(_0x4548('0x1'));var express=require(_0x4548('0x2'));var ewinston=require(_0x4548('0x3'));var util=require(_0x4548('0x4'));var errors=require(_0x4548('0x5'));var config=require(_0x4548('0x6'));var logger=require('./config/logger')(_0x4548('0x7'));var authLogger=require(_0x4548('0x8'))(_0x4548('0x9'));var safeTemplate=require(_0x4548('0xa'))[_0x4548('0xb')];exports[_0x4548('0xc')]=function(_0x26ca5d){_0x26ca5d[_0x4548('0xd')](ewinston[_0x4548('0xe')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x71495,_0x3032d9){var _0x5a5796=_0x4548('0xf');if(!_[_0x4548('0x10')](_0x71495['body'])){_0x5a5796+='\x20body=%s';var _0x1c03fd=_0x71495['body'];maskSensitiveData(_0x1c03fd);}return safeTemplate(util[_0x4548('0x11')](_0x5a5796,_0x71495[_0x4548('0x12')],_0x71495['headers'][_0x4548('0x13')]?_0x71495[_0x4548('0x14')][_0x4548('0x13')]:_0x71495[_0x4548('0x15')][_0x4548('0x16')]||_0x71495['ip'],_0x71495[_0x4548('0x17')],_0x3032d9['statusCode'],_0x3032d9[_0x4548('0x18')],_0x71495['user']?_0x71495[_0x4548('0x19')]['id']:null,_0x71495[_0x4548('0x19')]?_0x71495[_0x4548('0x19')][_0x4548('0x1a')]:null,_0x71495[_0x4548('0x19')]?_0x71495[_0x4548('0x19')][_0x4548('0x1b')]:null,_0x1c03fd?util[_0x4548('0x1c')](_0x1c03fd,![],null):''));}}));_0x26ca5d[_0x4548('0xd')](ewinston[_0x4548('0xe')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x22e5a5,_0x107c81){var _0x5eb73f=_0x4548('0x1d');if(_0x22e5a5[_0x4548('0x1e')]&&_0x22e5a5[_0x4548('0x1e')][_0x4548('0x1f')]&&_0x22e5a5[_0x4548('0x1e')][_0x4548('0x20')]){_0x5eb73f=_0x4548('0x21');}return util[_0x4548('0x11')](_0x5eb73f,_0x22e5a5[_0x4548('0x12')],_0x22e5a5[_0x4548('0x14')][_0x4548('0x13')]?_0x22e5a5[_0x4548('0x14')][_0x4548('0x13')]:_0x22e5a5[_0x4548('0x15')]['remoteAddress']||_0x22e5a5['ip'],_0x22e5a5[_0x4548('0x17')],_0x107c81[_0x4548('0x22')],_0x107c81[_0x4548('0x18')],_0x22e5a5[_0x4548('0x19')]?_0x22e5a5[_0x4548('0x19')]['id']:null,_0x22e5a5['user']?_0x22e5a5['user']['name']:null,_0x22e5a5[_0x4548('0x19')]?_0x22e5a5[_0x4548('0x19')][_0x4548('0x1b')]:null,_0x22e5a5['body']&&_0x22e5a5['body']['device']?_0x22e5a5[_0x4548('0x1e')]['device']:_0x4548('0x23'),_0x22e5a5[_0x4548('0x1e')]&&_0x22e5a5['body'][_0x4548('0x20')]?_0x22e5a5[_0x4548('0x1e')][_0x4548('0x20')]:'',_0x22e5a5[_0x4548('0x1e')]&&_0x22e5a5[_0x4548('0x1e')][_0x4548('0x24')]?_0x22e5a5[_0x4548('0x1e')][_0x4548('0x24')]:'');},'ignoreRoute':function(_0x3cb832){var _0x18cc4e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x18cc4e['test'](_0x3cb832[_0x4548('0x17')]);}}));_0x26ca5d[_0x4548('0xd')](_0x4548('0x25'),require(_0x4548('0x26')));_0x26ca5d[_0x4548('0xd')]('/api/voice/chanspy',require(_0x4548('0x27')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x28'),require(_0x4548('0x29')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x2a'),require(_0x4548('0x2b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x2c'),require('./api/voiceMusicOnHold'));_0x26ca5d['use']('/api/voice/queues',require('./api/voiceQueue'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x2d'),require(_0x4548('0x2e')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x2f'),require(_0x4548('0x30')));_0x26ca5d['use']('/api/voice/mails',require(_0x4548('0x31')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x32'),require(_0x4548('0x33')));_0x26ca5d['use'](_0x4548('0x34'),require(_0x4548('0x35')));_0x26ca5d[_0x4548('0xd')]('/api/voice/dials/reports',require(_0x4548('0x36')));_0x26ca5d['use'](_0x4548('0x37'),require(_0x4548('0x38')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x39'),require(_0x4548('0x3a')));_0x26ca5d[_0x4548('0xd')]('/api/members/reports',require(_0x4548('0x3b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x3c'),require(_0x4548('0x3d')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x3e'),require(_0x4548('0x3f')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x40'),require(_0x4548('0x41')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x42'),require(_0x4548('0x43')));_0x26ca5d[_0x4548('0xd')]('/api/mail/queues',require('./api/mailQueue'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x44'),require(_0x4548('0x45')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x46'),require('./api/mailInteraction'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x47'),require(_0x4548('0x48')));_0x26ca5d[_0x4548('0xd')]('/api/mail/applications',require(_0x4548('0x49')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x4a'),require(_0x4548('0x4b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x4c'),require(_0x4548('0x4d')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x4e'),require(_0x4548('0x4f')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x50'),require(_0x4548('0x51')));_0x26ca5d[_0x4548('0xd')]('/api/fax/applications',require('./api/faxApplication'));_0x26ca5d['use']('/api/fax/interactions',require('./api/faxInteraction'));_0x26ca5d[_0x4548('0xd')]('/api/fax/messages',require(_0x4548('0x52')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x53'),require(_0x4548('0x54')));_0x26ca5d['use'](_0x4548('0x55'),require(_0x4548('0x56')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x57'),require(_0x4548('0x58')));_0x26ca5d[_0x4548('0xd')]('/api/sms/applications',require(_0x4548('0x59')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x5a'),require(_0x4548('0x5b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x5c'),require(_0x4548('0x5d')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x5e'),require(_0x4548('0x5f')));_0x26ca5d[_0x4548('0xd')]('/api/openchannel/accounts',require(_0x4548('0x60')));_0x26ca5d[_0x4548('0xd')]('/api/openchannel/applications',require(_0x4548('0x61')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x62'),require(_0x4548('0x63')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x64'),require(_0x4548('0x65')));_0x26ca5d[_0x4548('0xd')]('/api/openchannel/queues',require(_0x4548('0x66')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x67'),require(_0x4548('0x68')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x69'),require(_0x4548('0x6a')));_0x26ca5d[_0x4548('0xd')]('/api/chat/applications',require('./api/chatApplication'));_0x26ca5d['use'](_0x4548('0x6b'),require(_0x4548('0x6c')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x6d'),require(_0x4548('0x6e')));_0x26ca5d['use'](_0x4548('0x6f'),require(_0x4548('0x70')));_0x26ca5d[_0x4548('0xd')]('/api/chat/queues',require(_0x4548('0x71')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x72'),require(_0x4548('0x73')));_0x26ca5d['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x74'),require(_0x4548('0x75')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x76'),require('./api/cmContact'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x77'),require(_0x4548('0x78')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x79'),require('./api/cmHopperBlack'));_0x26ca5d['use'](_0x4548('0x7a'),require(_0x4548('0x7b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x7c'),require(_0x4548('0x7d')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x7e'),require('./api/cmCustomField'));_0x26ca5d['use'](_0x4548('0x7f'),require(_0x4548('0x80')));_0x26ca5d['use'](_0x4548('0x81'),require(_0x4548('0x82')));_0x26ca5d['use'](_0x4548('0x83'),require('./api/cannedAnswer'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x84'),require('./api/disposition'));_0x26ca5d[_0x4548('0xd')]('/api/conditions',require(_0x4548('0x85')));_0x26ca5d[_0x4548('0xd')]('/api/intervals',require(_0x4548('0x86')));_0x26ca5d['use'](_0x4548('0x87'),require('./api/pause'));_0x26ca5d['use'](_0x4548('0x88'),require('./api/cdr'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x89'),require(_0x4548('0x8a')));_0x26ca5d[_0x4548('0xd')]('/api/schedules',require(_0x4548('0x8b')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x8c'),require(_0x4548('0x8d')));_0x26ca5d[_0x4548('0xd')]('/api/tags',require(_0x4548('0x8e')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x8f'),require('./api/template'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x90'),require(_0x4548('0x91')));_0x26ca5d['use'](_0x4548('0x92'),require(_0x4548('0x93')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x94'),require(_0x4548('0x95')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x96'),require(_0x4548('0x97')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x98'),require('./api/analyticCustomReport'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x99'),require(_0x4548('0x9a')));_0x26ca5d['use']('/api/analytics/extracted_reports',require(_0x4548('0x9b')));_0x26ca5d[_0x4548('0xd')]('/api/analytics/metrics',require(_0x4548('0x9c')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x9d'),require(_0x4548('0x9e')));_0x26ca5d['use'](_0x4548('0x9f'),require(_0x4548('0xa0')));_0x26ca5d[_0x4548('0xd')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x26ca5d[_0x4548('0xd')]('/api/integrations/salesforce/configurations',require(_0x4548('0xa1')));_0x26ca5d['use'](_0x4548('0xa2'),require(_0x4548('0xa3')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xa4'),require(_0x4548('0xa5')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xa6'),require(_0x4548('0xa7')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xa8'),require(_0x4548('0xa9')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xaa'),require(_0x4548('0xab')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xac'),require(_0x4548('0xad')));_0x26ca5d['use'](_0x4548('0xae'),require('./api/intDeskField'));_0x26ca5d['use'](_0x4548('0xaf'),require(_0x4548('0xb0')));_0x26ca5d['use'](_0x4548('0xb1'),require(_0x4548('0xb2')));_0x26ca5d['use'](_0x4548('0xb3'),require(_0x4548('0xb4')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xb5'),require(_0x4548('0xb6')));_0x26ca5d['use'](_0x4548('0xb7'),require(_0x4548('0xb8')));_0x26ca5d['use']('/api/integrations/zendesk/fields',require(_0x4548('0xb9')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xba'),require('./api/intFreshdeskAccount'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xbb'),require('./api/intFreshdeskConfiguration'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xbc'),require(_0x4548('0xbd')));_0x26ca5d['use'](_0x4548('0xbe'),require(_0x4548('0xbf')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xc0'),require(_0x4548('0xc1')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xc2'),require('./api/intVtigerField'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xc3'),require('./api/intServicenowAccount'));_0x26ca5d['use']('/api/integrations/servicenow/configurations',require(_0x4548('0xc4')));_0x26ca5d['use'](_0x4548('0xc5'),require(_0x4548('0xc6')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xc7'),require('./api/intDynamics365Account'));_0x26ca5d['use'](_0x4548('0xc8'),require('./api/intDynamics365Configuration'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xc9'),require(_0x4548('0xca')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xcb'),require(_0x4548('0xcc')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xcd'),require(_0x4548('0xce')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xcf'),require(_0x4548('0xd0')));_0x26ca5d['use'](_0x4548('0xd1'),require(_0x4548('0xd2')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xd3'),require(_0x4548('0xd4')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xd5'),require(_0x4548('0xd6')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xd7'),require(_0x4548('0xd8')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xd9'),require(_0x4548('0xda')));_0x26ca5d['use'](_0x4548('0xdb'),require(_0x4548('0xdc')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xdd'),require(_0x4548('0xde')));_0x26ca5d['use']('/api/square/reports',require('./api/squareReport'));_0x26ca5d['use']('/api/square/details/reports',require(_0x4548('0xdf')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe0'),require(_0x4548('0xe1')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe2'),require(_0x4548('0xe3')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe4'),require(_0x4548('0xe5')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe6'),require('./api/squareProject'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe7'),require(_0x4548('0xe8')));_0x26ca5d[_0x4548('0xd')]('/api/square/messages',require('./api/squareMessage'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xe9'),require('./api/team'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xea'),require(_0x4548('0xeb')));_0x26ca5d['use'](_0x4548('0xec'),require('./api/campaign'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xed'),require(_0x4548('0xee')));_0x26ca5d['use'](_0x4548('0xef'),require(_0x4548('0xf0')));_0x26ca5d['use'](_0x4548('0xf1'),require(_0x4548('0xf2')));_0x26ca5d[_0x4548('0xd')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xf3'),require(_0x4548('0xf4')));_0x26ca5d[_0x4548('0xd')]('/api/fax/reports/transfer',require(_0x4548('0xf5')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xf6'),require('./api/openchannelTransferReport'));_0x26ca5d[_0x4548('0xd')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xf7'),require('./api/cmList'));_0x26ca5d['use'](_0x4548('0xf8'),require('./api/voicePrefix'));_0x26ca5d[_0x4548('0xd')](_0x4548('0xf9'),require('./api/userProfile'));_0x26ca5d['use'](_0x4548('0xfa'),require(_0x4548('0xfb')));_0x26ca5d[_0x4548('0xd')](_0x4548('0xfc'),require(_0x4548('0xfd')));_0x26ca5d['use']('/api/userNotifications',require(_0x4548('0xfe')));_0x26ca5d['use']('/api/whatsapp/accounts',require(_0x4548('0xff')));_0x26ca5d['use'](_0x4548('0x100'),require(_0x4548('0x101')));_0x26ca5d['use'](_0x4548('0x102'),require(_0x4548('0x103')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x104'),require('./api/whatsappMessage'));_0x26ca5d['use']('/api/whatsapp/reports/queue',require(_0x4548('0x105')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x106'),require(_0x4548('0x107')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x108'),require(_0x4548('0x109')));_0x26ca5d[_0x4548('0xd')]('/api/cloudProviders',require(_0x4548('0x10a')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x10b'),require(_0x4548('0x10c')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x10d'),require(_0x4548('0x10e')));_0x26ca5d['use']('/api/auth/google',require(_0x4548('0x10f')));_0x26ca5d['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x110'),require('./api/jira'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x111'),require('./api/rpc'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x112'),require(_0x4548('0x113')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x114'),require('./api/system'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x115'),require('./api/pm2'));_0x26ca5d[_0x4548('0xd')](_0x4548('0x116'),require(_0x4548('0x117')));_0x26ca5d[_0x4548('0xd')](_0x4548('0x118'),express[_0x4548('0x119')](path[_0x4548('0x11a')](config[_0x4548('0x11b')],_0x4548('0x118'))));_0x26ca5d['use'](_0x4548('0x11c'),express[_0x4548('0x119')](path[_0x4548('0x11a')](config[_0x4548('0x11b')],_0x4548('0x11c'))));_0x26ca5d[_0x4548('0xd')](_0x4548('0x11d'),express[_0x4548('0x119')](path[_0x4548('0x11a')](config[_0x4548('0x11b')],_0x4548('0x11d'))));_0x26ca5d[_0x4548('0xd')](_0x4548('0x11e'),express[_0x4548('0x119')](path[_0x4548('0x11a')](config[_0x4548('0x11b')],'snippet',_0x4548('0x11f'))));_0x26ca5d[_0x4548('0xd')](_0x4548('0x120'),express[_0x4548('0x119')](path['join'](config[_0x4548('0x11b')],_0x4548('0x121'))));_0x26ca5d[_0x4548('0x122')](_0x4548('0x123'))[_0x4548('0x124')](errors[0x194]);_0x26ca5d[_0x4548('0x122')]('/*')[_0x4548('0x124')](function(_0x5f30cf,_0x301029){_0x301029['sendFile'](path[_0x4548('0x125')](_0x26ca5d[_0x4548('0x124')](_0x4548('0x126'))+_0x4548('0x127')));});};var sensitiveFields=['username',_0x4548('0x128'),_0x4548('0x129'),_0x4548('0x12a'),_0x4548('0x12b'),_0x4548('0x12c'),_0x4548('0x12d'),_0x4548('0x12e'),_0x4548('0x12f'),_0x4548('0x130'),_0x4548('0x131'),'clientId',_0x4548('0x132'),_0x4548('0x133'),_0x4548('0x134'),_0x4548('0x135'),_0x4548('0x136'),_0x4548('0x137'),_0x4548('0x138'),_0x4548('0x139'),'accessTokenSecret',_0x4548('0x13a'),_0x4548('0x13b'),'consumerSecret',_0x4548('0x13c'),_0x4548('0x13d'),_0x4548('0x13e'),_0x4548('0x13f'),'vidaooApiKey',_0x4548('0x140'),_0x4548('0x141'),_0x4548('0x142'),_0x4548('0x143'),'key','user',_0x4548('0x144'),_0x4548('0x145'),_0x4548('0x146'),_0x4548('0x147'),_0x4548('0x148'),'registry',_0x4548('0x149')];function maskSensitiveData(_0x234973){var _0x16aac4=/(?!^)[\s\S](?!$)/g;if(!_[_0x4548('0x14a')](_0x234973))return;for(var _0x278244 in _0x234973){if(_[_0x4548('0x14b')](_0x234973[_0x278244])){for(var _0x29489f=0x0;_0x29489f<_0x234973[_0x278244]['length'];_0x29489f++){maskSensitiveData(_0x234973[_0x278244][_0x29489f]);}}else if(_[_0x4548('0x14a')](_0x234973[_0x278244])){maskSensitiveData(_0x234973[_0x278244]);}else if(_[_0x4548('0x14c')](_0x234973[_0x278244])){_0x234973[_0x278244]=_0x234973[_0x278244][_0x4548('0x14d')](/{{{/g,_0x4548('0x14e'))['replace'](/}}}/g,'}@@')[_0x4548('0x14d')](/{{/g,'@{')[_0x4548('0x14d')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x278244)){_0x234973[_0x278244]=_0x234973[_0x278244]['replace'](_0x16aac4,'*');}}}} \ No newline at end of file +var _0x1f26=['/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','newPassword','apiKey','firstName','street','phone','email','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','vidaooApiKey','clientEmail','accesskeyid','pass','accountSid','localstationid','secret','registry','oldPassword','length','replace','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','safeTemplate','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','role','other','agent_name','use','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/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/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0x1f26,0x197));var _0x61f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x61f2('0x0'));var path=require(_0x61f2('0x1'));var express=require(_0x61f2('0x2'));var ewinston=require(_0x61f2('0x3'));var util=require(_0x61f2('0x4'));var errors=require(_0x61f2('0x5'));var config=require(_0x61f2('0x6'));var logger=require('./config/logger')(_0x61f2('0x7'));var authLogger=require(_0x61f2('0x8'))(_0x61f2('0x9'));var safeTemplate=require('./safe-template')[_0x61f2('0xa')];exports['default']=function(_0x29211f){_0x29211f['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x34ac46,_0x273963){var _0x160dd2=_0x61f2('0xb');if(!_[_0x61f2('0xc')](_0x34ac46[_0x61f2('0xd')])){_0x160dd2+=_0x61f2('0xe');var _0x3dc52b=_0x34ac46[_0x61f2('0xd')];maskSensitiveData(_0x3dc52b);}return safeTemplate(util[_0x61f2('0xf')](_0x160dd2,_0x34ac46[_0x61f2('0x10')],_0x34ac46['headers'][_0x61f2('0x11')]?_0x34ac46[_0x61f2('0x12')]['x-forwarded-for']:_0x34ac46['connection']['remoteAddress']||_0x34ac46['ip'],_0x34ac46['url'],_0x273963['statusCode'],_0x273963[_0x61f2('0x13')],_0x34ac46[_0x61f2('0x14')]?_0x34ac46['user']['id']:null,_0x34ac46[_0x61f2('0x14')]?_0x34ac46['user'][_0x61f2('0x15')]:null,_0x34ac46[_0x61f2('0x14')]?_0x34ac46[_0x61f2('0x14')]['role']:null,_0x3dc52b?util[_0x61f2('0x16')](_0x3dc52b,![],null):''));}}));_0x29211f['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x534f90,_0x51f7e5){var _0x2dcab6=_0x61f2('0x17');if(_0x534f90[_0x61f2('0xd')]&&_0x534f90['body'][_0x61f2('0x18')]&&_0x534f90['body'][_0x61f2('0x19')]){_0x2dcab6=_0x61f2('0x1a');}return util[_0x61f2('0xf')](_0x2dcab6,_0x534f90[_0x61f2('0x10')],_0x534f90[_0x61f2('0x12')]['x-forwarded-for']?_0x534f90['headers'][_0x61f2('0x11')]:_0x534f90[_0x61f2('0x1b')]['remoteAddress']||_0x534f90['ip'],_0x534f90['url'],_0x51f7e5['statusCode'],_0x51f7e5['responseTime'],_0x534f90[_0x61f2('0x14')]?_0x534f90[_0x61f2('0x14')]['id']:null,_0x534f90['user']?_0x534f90[_0x61f2('0x14')][_0x61f2('0x15')]:null,_0x534f90['user']?_0x534f90[_0x61f2('0x14')][_0x61f2('0x1c')]:null,_0x534f90[_0x61f2('0xd')]&&_0x534f90[_0x61f2('0xd')][_0x61f2('0x18')]?_0x534f90[_0x61f2('0xd')][_0x61f2('0x18')]:_0x61f2('0x1d'),_0x534f90['body']&&_0x534f90[_0x61f2('0xd')][_0x61f2('0x19')]?_0x534f90[_0x61f2('0xd')][_0x61f2('0x19')]:'',_0x534f90['body']&&_0x534f90[_0x61f2('0xd')][_0x61f2('0x1e')]?_0x534f90[_0x61f2('0xd')]['agent_name']:'');},'ignoreRoute':function(_0x4a39b7){var _0x1de72d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1de72d['test'](_0x4a39b7['url']);}}));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x20'),require(_0x61f2('0x21')));_0x29211f[_0x61f2('0x1f')]('/api/voice/chanspy',require(_0x61f2('0x22')));_0x29211f['use']('/api/voice/contexts',require(_0x61f2('0x23')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x24'),require(_0x61f2('0x25')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x26'),require('./api/voiceMusicOnHold'));_0x29211f[_0x61f2('0x1f')]('/api/voice/queues',require('./api/voiceQueue'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x27'),require(_0x61f2('0x28')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x29'),require('./api/screenRecording'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x2a'),require(_0x61f2('0x2b')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x2c'),require(_0x61f2('0x2d')));_0x29211f['use']('/api/voice/calls/reports',require(_0x61f2('0x2e')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x2f'),require(_0x61f2('0x30')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x31'),require('./api/voiceAgentReport'));_0x29211f['use'](_0x61f2('0x32'),require(_0x61f2('0x33')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x34'),require(_0x61f2('0x35')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x36'),require(_0x61f2('0x37')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x38'),require(_0x61f2('0x39')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x3a'),require('./api/mailServerOut'));_0x29211f['use']('/api/mail/accounts',require(_0x61f2('0x3b')));_0x29211f['use'](_0x61f2('0x3c'),require(_0x61f2('0x3d')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x3e'),require(_0x61f2('0x3f')));_0x29211f[_0x61f2('0x1f')]('/api/mail/interactions',require(_0x61f2('0x40')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x41'),require('./api/mailMessage'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x42'),require(_0x61f2('0x43')));_0x29211f[_0x61f2('0x1f')]('/api/mail/reports/queue',require(_0x61f2('0x44')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x45'),require(_0x61f2('0x46')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x47'),require(_0x61f2('0x48')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x49'),require(_0x61f2('0x4a')));_0x29211f[_0x61f2('0x1f')]('/api/fax/applications',require(_0x61f2('0x4b')));_0x29211f['use'](_0x61f2('0x4c'),require(_0x61f2('0x4d')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x4e'),require(_0x61f2('0x4f')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x50'),require(_0x61f2('0x51')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x52'),require(_0x61f2('0x53')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x54'),require(_0x61f2('0x55')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x56'),require(_0x61f2('0x57')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x58'),require('./api/smsInteraction'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x59'),require(_0x61f2('0x5a')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x5b'),require(_0x61f2('0x5c')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x5d'),require(_0x61f2('0x5e')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x5f'),require(_0x61f2('0x60')));_0x29211f[_0x61f2('0x1f')]('/api/openchannel/interactions',require(_0x61f2('0x61')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x62'),require(_0x61f2('0x63')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x64'),require(_0x61f2('0x65')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x66'),require(_0x61f2('0x67')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x68'),require(_0x61f2('0x69')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x6a'),require('./api/chatApplication'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x6b'),require('./api/chatInteraction'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x6c'),require(_0x61f2('0x6d')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x6e'),require(_0x61f2('0x6f')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x70'),require('./api/chatQueue'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x71'),require(_0x61f2('0x72')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x73'),require(_0x61f2('0x74')));_0x29211f['use']('/api/cm/companies',require(_0x61f2('0x75')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x76'),require('./api/cmContact'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x77'),require(_0x61f2('0x78')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x79'),require('./api/cmHopperBlack'));_0x29211f['use'](_0x61f2('0x7a'),require(_0x61f2('0x7b')));_0x29211f[_0x61f2('0x1f')]('/api/cm/hopper_history',require(_0x61f2('0x7c')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x7d'),require(_0x61f2('0x7e')));_0x29211f['use'](_0x61f2('0x7f'),require(_0x61f2('0x80')));_0x29211f['use'](_0x61f2('0x81'),require(_0x61f2('0x82')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x83'),require(_0x61f2('0x84')));_0x29211f[_0x61f2('0x1f')]('/api/dispositions',require(_0x61f2('0x85')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x86'),require(_0x61f2('0x87')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x88'),require(_0x61f2('0x89')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x8a'),require(_0x61f2('0x8b')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x8c'),require(_0x61f2('0x8d')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x8e'),require('./api/voiceQueuesLog'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x8f'),require(_0x61f2('0x90')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x91'),require(_0x61f2('0x92')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x93'),require(_0x61f2('0x94')));_0x29211f[_0x61f2('0x1f')]('/api/templates',require(_0x61f2('0x95')));_0x29211f['use'](_0x61f2('0x96'),require(_0x61f2('0x97')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x98'),require('./api/variable'));_0x29211f[_0x61f2('0x1f')]('/api/integrations',require('./api/integration'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x99'),require(_0x61f2('0x9a')));_0x29211f['use'](_0x61f2('0x9b'),require(_0x61f2('0x9c')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x9d'),require(_0x61f2('0x9e')));_0x29211f['use'](_0x61f2('0x9f'),require(_0x61f2('0xa0')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xa1'),require(_0x61f2('0xa2')));_0x29211f['use'](_0x61f2('0xa3'),require('./api/analyticFieldReport'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xa4'),require(_0x61f2('0xa5')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xa6'),require(_0x61f2('0xa7')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xa8'),require(_0x61f2('0xa9')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xaa'),require(_0x61f2('0xab')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/sugarcrm/accounts',require(_0x61f2('0xac')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xad'),require(_0x61f2('0xae')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/sugarcrm/fields',require(_0x61f2('0xaf')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xb0'),require('./api/intDeskAccount'));_0x29211f['use'](_0x61f2('0xb1'),require(_0x61f2('0xb2')));_0x29211f['use']('/api/integrations/desk/fields',require(_0x61f2('0xb3')));_0x29211f['use'](_0x61f2('0xb4'),require('./api/intZohoAccount'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xb5'),require(_0x61f2('0xb6')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xb7'),require('./api/intZendeskAccount'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xb8'),require(_0x61f2('0xb9')));_0x29211f['use']('/api/integrations/zendesk/fields',require(_0x61f2('0xba')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xbb'),require('./api/intFreshdeskAccount'));_0x29211f['use']('/api/integrations/freshdesk/configurations',require(_0x61f2('0xbc')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xbd'),require(_0x61f2('0xbe')));_0x29211f['use'](_0x61f2('0xbf'),require(_0x61f2('0xc0')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xc1'),require(_0x61f2('0xc2')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xc3'),require(_0x61f2('0xc4')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xc5'),require('./api/intServicenowAccount'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xc6'),require(_0x61f2('0xc7')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x29211f['use'](_0x61f2('0xc8'),require(_0x61f2('0xc9')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/dynamics365/configurations',require(_0x61f2('0xca')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xcb'),require(_0x61f2('0xcc')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xcd'),require(_0x61f2('0xce')));_0x29211f[_0x61f2('0x1f')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xcf'),require(_0x61f2('0xd0')));_0x29211f[_0x61f2('0x1f')]('/api/networks',require('./api/network'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xd1'),require(_0x61f2('0xd2')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xd3'),require(_0x61f2('0xd4')));_0x29211f[_0x61f2('0x1f')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xd5'),require(_0x61f2('0xd6')));_0x29211f['use']('/api/jscripty/sessions/reports',require(_0x61f2('0xd7')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xd8'),require(_0x61f2('0xd9')));_0x29211f[_0x61f2('0x1f')]('/api/square/reports',require(_0x61f2('0xda')));_0x29211f[_0x61f2('0x1f')]('/api/square/details/reports',require(_0x61f2('0xdb')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xdc'),require(_0x61f2('0xdd')));_0x29211f['use'](_0x61f2('0xde'),require(_0x61f2('0xdf')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xe0'),require(_0x61f2('0xe1')));_0x29211f[_0x61f2('0x1f')]('/api/square/projects',require(_0x61f2('0xe2')));_0x29211f['use'](_0x61f2('0xe3'),require('./api/squareRecording'));_0x29211f[_0x61f2('0x1f')]('/api/square/messages',require('./api/squareMessage'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xe4'),require('./api/team'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xe5'),require(_0x61f2('0xe6')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xe7'),require(_0x61f2('0xe8')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xe9'),require('./api/migration'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xea'),require(_0x61f2('0xeb')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xec'),require('./api/plugin'));_0x29211f[_0x61f2('0x1f')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xed'),require(_0x61f2('0xee')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xef'),require(_0x61f2('0xf0')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xf1'),require(_0x61f2('0xf2')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xf3'),require(_0x61f2('0xf4')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xf5'),require(_0x61f2('0xf6')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xf7'),require(_0x61f2('0xf8')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xf9'),require('./api/userProfile'));_0x29211f[_0x61f2('0x1f')]('/api/userProfile/sections',require(_0x61f2('0xfa')));_0x29211f[_0x61f2('0x1f')]('/api/userProfile/resources',require(_0x61f2('0xfb')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xfc'),require(_0x61f2('0xfd')));_0x29211f[_0x61f2('0x1f')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x29211f['use'](_0x61f2('0xfe'),require('./api/whatsappApplication'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0xff'),require(_0x61f2('0x100')));_0x29211f['use']('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x29211f['use']('/api/whatsapp/reports/queue',require(_0x61f2('0x101')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x102'),require(_0x61f2('0x103')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x104'),require(_0x61f2('0x105')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x106'),require('./api/cloudProvider'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x107'),require(_0x61f2('0x108')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x109'),require('./api/authLocal'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x10a'),require('./api/authGoogle'));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x10b'),require('./api/authActiveDirectory'));_0x29211f[_0x61f2('0x1f')]('/api/jira',require(_0x61f2('0x10c')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x10d'),require(_0x61f2('0x10e')));_0x29211f[_0x61f2('0x1f')]('/api/version',require(_0x61f2('0x10f')));_0x29211f['use'](_0x61f2('0x110'),require(_0x61f2('0x111')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x112'),require('./api/pm2'));_0x29211f['use'](_0x61f2('0x113'),require('./api/webbar'));_0x29211f['use'](_0x61f2('0x114'),express[_0x61f2('0x115')](path[_0x61f2('0x116')](config[_0x61f2('0x117')],_0x61f2('0x114'))));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x118'),express[_0x61f2('0x115')](path['join'](config[_0x61f2('0x117')],'/www')));_0x29211f[_0x61f2('0x1f')]('/demo',express[_0x61f2('0x115')](path[_0x61f2('0x116')](config[_0x61f2('0x117')],_0x61f2('0x119'))));_0x29211f['use'](_0x61f2('0x11a'),express[_0x61f2('0x115')](path[_0x61f2('0x116')](config[_0x61f2('0x117')],_0x61f2('0x11b'),'3.0.0')));_0x29211f[_0x61f2('0x1f')](_0x61f2('0x11c'),express['static'](path[_0x61f2('0x116')](config['root'],_0x61f2('0x11d'))));_0x29211f[_0x61f2('0x11e')](_0x61f2('0x11f'))[_0x61f2('0x120')](errors[0x194]);_0x29211f[_0x61f2('0x11e')]('/*')[_0x61f2('0x120')](function(_0x1a36bf,_0x375cde){_0x375cde[_0x61f2('0x121')](path[_0x61f2('0x122')](_0x29211f[_0x61f2('0x120')](_0x61f2('0x123'))+_0x61f2('0x124')));});};var sensitiveFields=['username','password',_0x61f2('0x125'),_0x61f2('0x126'),_0x61f2('0x127'),'lastName',_0x61f2('0x128'),_0x61f2('0x129'),'mobile','fax',_0x61f2('0x12a'),_0x61f2('0x12b'),_0x61f2('0x12c'),_0x61f2('0x12d'),_0x61f2('0x12e'),_0x61f2('0x12f'),'tenantId',_0x61f2('0x130'),_0x61f2('0x131'),_0x61f2('0x132'),_0x61f2('0x133'),_0x61f2('0x134'),_0x61f2('0x135'),_0x61f2('0x136'),_0x61f2('0x137'),_0x61f2('0x138'),'calleridnum','exten',_0x61f2('0x139'),_0x61f2('0x13a'),'privateKey',_0x61f2('0x13b'),'secretaccesskey','key',_0x61f2('0x14'),_0x61f2('0x13c'),_0x61f2('0x13d'),_0x61f2('0x13e'),'dsn',_0x61f2('0x13f'),_0x61f2('0x140'),_0x61f2('0x141')];function maskSensitiveData(_0x1e3403){var _0x120227=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x1e3403))return;for(var _0x2883f6 in _0x1e3403){if(_['isArray'](_0x1e3403[_0x2883f6])){for(var _0x2f4190=0x0;_0x2f4190<_0x1e3403[_0x2883f6][_0x61f2('0x142')];_0x2f4190++){maskSensitiveData(_0x1e3403[_0x2883f6][_0x2f4190]);}}else if(_['isPlainObject'](_0x1e3403[_0x2883f6])){maskSensitiveData(_0x1e3403[_0x2883f6]);}else if(_['isString'](_0x1e3403[_0x2883f6])){_0x1e3403[_0x2883f6]=_0x1e3403[_0x2883f6][_0x61f2('0x143')](/{{{/g,'@@{')[_0x61f2('0x143')](/}}}/g,_0x61f2('0x144'))[_0x61f2('0x143')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x61f2('0x145')](sensitiveFields,_0x2883f6)){_0x1e3403[_0x2883f6]=_0x1e3403[_0x2883f6]['replace'](_0x120227,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 04eaa9b..42e9434 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x223d=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','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/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x223d,0x1a9));var _0xd223=function(_0x416861,_0x519444){_0x416861=_0x416861-0x0;var _0x4fab84=_0x223d[_0x416861];return _0x4fab84;};'use strict';var jayson=require(_0xd223('0x0'));var BPromise=require(_0xd223('0x1'));var _=require(_0xd223('0x2'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x40ab79,_0x5c3472){var _0x3ede07={};_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x4')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x5')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x6')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x7')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x8')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x9')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0xa')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0xb')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/memberReport/memberReport.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0xc')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0xd')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0xe')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0xf')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x10')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x11')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x12')));_0x3ede07=_['merge'](_0x3ede07,require('../api/mailMessage/mailMessage.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/mailApplication/mailApplication.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x13')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x14')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x15')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x16')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x17')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x18')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x19')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x1a')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x1b')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x1c')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x1d')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x1e')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x1f')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x20')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x21')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x22')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x23')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/chatMessage/chatMessage.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x24')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x25')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x26')));_0x3ede07=_['merge'](_0x3ede07,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x27')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x28')));_0x3ede07=_['merge'](_0x3ede07,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x29')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/pause/pause.rpc'));_0x3ede07=_['merge'](_0x3ede07,require('../api/sound/sound.rpc'));_0x3ede07=_['merge'](_0x3ede07,require('../api/template/template.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/trigger/trigger.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x2a')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x2b')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x2c')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x2d')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x2e')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x2f')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x30')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x31')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x32')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x33')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x34')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x35')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x36')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x37')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x38')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x39')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x3a')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x3b')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x3c')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x3d')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x3e')));_0x3ede07=_['merge'](_0x3ede07,require(_0xd223('0x3f')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x40')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x41')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x42')));_0x3ede07=_[_0xd223('0x3')](_0x3ede07,require(_0xd223('0x43')));var _0x5396ea=jayson[_0xd223('0x44')](_0x3ede07)['http']();var _0x1b602b=config[_0xd223('0x45')][_0xd223('0x46')]||config[_0xd223('0x46')]+0x1;var _0x4c9adc=config['rpc']['ip']||_0xd223('0x47');_0x5396ea['on'](_0xd223('0x48'),function(_0x53bc5f){return _0x5c3472(_0x53bc5f);});_0x5396ea['listen'](_0x1b602b,_0x4c9adc,function(){console[_0xd223('0x49')](_0xd223('0x4a'),_0x4c9adc,_0x1b602b);require(_0xd223('0x4b'))['default']();return _0x40ab79(_0xd223('0x4c')+_0x4c9adc+':'+_0x1b602b);});});}; \ No newline at end of file +var _0x69f9=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc'];(function(_0x50ead9,_0x16a07b){var _0x11308a=function(_0x31725d){while(--_0x31725d){_0x50ead9['push'](_0x50ead9['shift']());}};_0x11308a(++_0x16a07b);}(_0x69f9,0x153));var _0x969f=function(_0x28acd8,_0x82781a){_0x28acd8=_0x28acd8-0x0;var _0x39968c=_0x69f9[_0x28acd8];return _0x39968c;};'use strict';var jayson=require(_0x969f('0x0'));var BPromise=require('bluebird');var _=require(_0x969f('0x1'));var config=require(_0x969f('0x2'));exports[_0x969f('0x3')]=function(){return new BPromise(function(_0x1004a1,_0x2cd02b){var _0x15b414={};_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x4')));_0x15b414=_['merge'](_0x15b414,require('../api/voiceExtension/voiceExtension.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x6')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x7')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x8')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x9')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0xa')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0xb')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0xc')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0xd')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0xe')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0xf')));_0x15b414=_['merge'](_0x15b414,require('../api/mailAccount/mailAccount.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x10')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/mailInteraction/mailInteraction.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x11')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x12')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x13')));_0x15b414=_['merge'](_0x15b414,require('../api/faxAccount/faxAccount.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x14')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/faxInteraction/faxInteraction.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x15')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/faxQueue/faxQueue.rpc'));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x16')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x17')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x18')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x19')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x1a')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x1b')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x1c')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x1d')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x1e')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x1f')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x20')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x21')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x22')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/cmContact/cmContact.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/cmHopper/cmHopper.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x23')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x24')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x25')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x26')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x27')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x28')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x29')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x2a')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x2b')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x2c')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x2d')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x2e')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x2f')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x30')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x31')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x32')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x33')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x34')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x35')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x36')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x37')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x38')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x39')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3a')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3b')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3c')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3d')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3e')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x3f')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x40')));_0x15b414=_[_0x969f('0x5')](_0x15b414,require(_0x969f('0x41')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x42')));_0x15b414=_['merge'](_0x15b414,require(_0x969f('0x43')));var _0x242712=jayson[_0x969f('0x44')](_0x15b414)['http']();var _0xf939a=config[_0x969f('0x45')][_0x969f('0x46')]||config[_0x969f('0x46')]+0x1;var _0x4c5cf7=config[_0x969f('0x45')]['ip']||_0x969f('0x47');_0x242712['on']('error',function(_0x268f02){return _0x2cd02b(_0x268f02);});_0x242712[_0x969f('0x3')](_0xf939a,_0x4c5cf7,function(){console[_0x969f('0x48')](_0x969f('0x49'),_0x4c5cf7,_0xf939a);require('../config/triggers')[_0x969f('0x4a')]();return _0x1004a1('RPC\x20listening\x20on\x20'+_0x4c5cf7+':'+_0xf939a);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 892b87b..2563c50 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0xda2f14,_0x42d208){var _0x5a5bea=function(_0x28d816){while(--_0x28d816){_0xda2f14['push'](_0xda2f14['shift']());}};_0x5a5bea(++_0x42d208);}(_0x9354,0x96));var _0x4935=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x9354[_0x3616bb];return _0x1c0994;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42d9d9){return _0x42d9d9==='{{'?_0x4935('0x0'):'\x20}\x20}';}function safeTemplate(_0x263dd5){var _0x2a4993=_0x263dd5;if(typeof _0x263dd5===_0x4935('0x1')){_0x2a4993=_0x263dd5[_0x4935('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x263dd5)){_0x2a4993=_0x263dd5[_0x4935('0x3')](function(_0x2d509b){return safeTemplate(_0x2d509b);});}else if(_[_0x4935('0x4')](_0x263dd5)){_0x2a4993=Object[_0x4935('0x5')](_0x263dd5)[_0x4935('0x6')](function(_0x2e47bd,_0x118d36){_0x2e47bd[_0x118d36]=safeTemplate(_0x263dd5[_0x118d36]);return _0x2e47bd;},{});}return _0x2a4993;}module[_0x4935('0x7')][_0x4935('0x8')]=safeTemplate; \ No newline at end of file +var _0xdd4f=['isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','replace'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x411964,_0x1e847e){_0x411964=_0x411964-0x0;var _0x41ee51=_0xdd4f[_0x411964];return _0x41ee51;};var _=require(_0xfdd4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x51d240){return _0x51d240==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x291ae7){var _0x19cda7=_0x291ae7;if(typeof _0x291ae7==='string'){_0x19cda7=_0x291ae7[_0xfdd4('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfdd4('0x2')](_0x291ae7)){_0x19cda7=_0x291ae7[_0xfdd4('0x3')](function(_0x554e44){return safeTemplate(_0x554e44);});}else if(_[_0xfdd4('0x4')](_0x291ae7)){_0x19cda7=Object[_0xfdd4('0x5')](_0x291ae7)[_0xfdd4('0x6')](function(_0x307ac6,_0x3c72d4){_0x307ac6[_0x3c72d4]=safeTemplate(_0x291ae7[_0x3c72d4]);return _0x307ac6;},{});}return _0x19cda7;}module['exports'][_0xfdd4('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 76563ff..cd6e64d 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 _0x63f2=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','prototype','answer','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s'];(function(_0x65c83c,_0x5f40b0){var _0x28f6aa=function(_0x4dcd55){while(--_0x4dcd55){_0x65c83c['push'](_0x65c83c['shift']());}};_0x28f6aa(++_0x5f40b0);}(_0x63f2,0x19b));var _0x263f=function(_0x38f4db,_0x3298b2){_0x38f4db=_0x38f4db-0x0;var _0x36f0e3=_0x63f2[_0x38f4db];return _0x36f0e3;};'use strict';var util=require(_0x263f('0x0'));var _=require(_0x263f('0x1'));var EventEmitter=require(_0x263f('0x2'))[_0x263f('0x3')];var AGIReply=require(_0x263f('0x4'));var AGIError=require(_0x263f('0x5'));function AGIChannel(_0x15660c){var _0x4cd09c=this,_0x3e39a0=new AGIReply(),_0x5926d1=![],_0x1a4ead={};EventEmitter[_0x263f('0x6')](_0x4cd09c);_0x15660c['setEncoding'](_0x263f('0x7'));_0x15660c[_0x263f('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3e39a0[_0x263f('0x9')]('utf8');_0x3e39a0['on'](_0x263f('0xa'),function(_0x2a49a5){for(var _0x3aa6d1 in _0x2a49a5){_0x4cd09c[_0x3aa6d1]=_0x2a49a5[_0x3aa6d1];}_0x4cd09c[_0x263f('0xb')](_0x263f('0xc'));});_0x3e39a0['on'](_0x263f('0xd'),function(_0x58a102){if(_0x58a102[_0x263f('0xe')]()==_0x263f('0xf')){_0x4cd09c['emit'](_0x263f('0xf'));return;}if(_0x58a102[_0x263f('0x10')](0x0,0xb)==_0x263f('0x11')){_0x5926d1=!![];}if(_0x5926d1){_0x1a4ead['rx']+=_0x58a102+'\x0a';if(_0x58a102[_0x263f('0x12')](_0x263f('0x13'))!=-0x1){_0x5926d1=![];}}else{_0x1a4ead['rx']=_0x58a102;}if(_0x5926d1){return;}if(typeof _0x1a4ead['cb']==_0x263f('0x14')){var _0x2053ea=_0x1a4ead['rx']['substring'](0x0,0x3),_0x84e574=null,_0x1bb05a=null;_0x2053ea=parseInt(_0x2053ea);if(isNaN(_0x2053ea)){_0x1a4ead['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x263f('0x15')});return;}if(_0x2053ea!=0xc8){_0x1a4ead['cb'](null,{'code':_0x2053ea,'result':-0x1,'extra':'KO'});return;}_0x84e574=_0x1a4ead['rx'][_0x263f('0x10')](0x4)[_0x263f('0x16')](_0x263f('0x17'),'');if(_0x84e574['indexOf']('\x20')!=-0x1){_0x84e574=_0x84e574['substr'](0x0,_0x84e574['indexOf']('\x20'));}if(_[_0x263f('0x18')](_0x84e574,'-1')){_0x84e574=parseInt(_0x84e574);}_0x1bb05a=_0x1a4ead['rx'][_0x263f('0x19')]('\x20');if(_0x1bb05a['length']==0x3){_0x1bb05a=_0x1bb05a[0x2][_0x263f('0x10')](0x1,_0x1bb05a[0x2][_0x263f('0x1a')]-0x1);}else if(_0x1bb05a[_0x263f('0x1a')]>0x3){var _0x2a0ff1=/\((.+)\)/;var _0x5365ea=_0x1a4ead['rx'][_0x263f('0x1b')](_0x2a0ff1);if(_0x5365ea){_0x1bb05a=_0x5365ea[0x1];}else{_0x1bb05a=null;}}else{_0x1bb05a=null;}_0x1a4ead['cb'](null,{'code':_0x2053ea,'result':_0x84e574,'extra':_0x1bb05a});}});_0x15660c['on'](_0x263f('0x1c'),function(_0x143dcd){_0x4cd09c[_0x263f('0xb')]('error',new AGIError(_0x263f('0x1d'),_0x143dcd[_0x263f('0x1e')]));});_0x15660c['on'](_0x263f('0x1f'),function(){_0x4cd09c[_0x263f('0xb')](_0x263f('0x1f'),new AGIError(_0x263f('0x20')));});_0x15660c['on'](_0x263f('0x21'),function(){_0x4cd09c[_0x263f('0xb')](_0x263f('0x21'),new AGIError(_0x263f('0x22')));_0x15660c['destroy']();});_0x15660c[_0x263f('0x23')](_0x3e39a0);this[_0x263f('0x24')]=function(_0xd9984d,_0x1e9703){var _0xd9984d=_0xd9984d||'',_0x1e9703=typeof _0x1e9703==_0x263f('0x14')?_0x1e9703:new Function();_0x1a4ead={'tx':_0xd9984d,'rx':'','cb':_0x1e9703};_0x15660c[_0x263f('0x25')](_0xd9984d+'\x0a');},this[_0x263f('0x1f')]=function(){_0x15660c[_0x263f('0x26')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x263f('0x27')]['sendRequest']=function(_0x364105){return this['command']['sync'](this,_0x364105);};AGIChannel['prototype'][_0x263f('0x28')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x263f('0x27')][_0x263f('0x29')]=function(_0x4f912d,_0x1761a0,_0x1f3aab){_0x4f912d=_0x4f912d===undefined?_0x263f('0x2a'):_0x4f912d;_0x1761a0=_0x1761a0===undefined?'5':_0x1761a0;_0x1f3aab=_0x1f3aab===undefined?'1':_0x1f3aab;return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x2d'),_0x4f912d,_0x1761a0*0x3e8,_0x1f3aab));};AGIChannel[_0x263f('0x27')][_0x263f('0x2e')]=function(_0x4ac6a6){_0x4ac6a6=_0x4ac6a6||_0x263f('0x2f');return this['sendRequest'](util[_0x263f('0x2c')](_0x263f('0x30'),_0x4ac6a6));};AGIChannel[_0x263f('0x27')][_0x263f('0x31')]=function(_0x4fef0e,_0x89c70c){if(_[_0x263f('0x32')](_0x89c70c)){return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x33'),_0x4fef0e,_0x89c70c[_0x263f('0x34')](',')));}return this[_0x263f('0x2b')](util[_0x263f('0x2c')]('EXEC\x20%s\x20%s',_0x4fef0e,_0x89c70c));};AGIChannel[_0x263f('0x27')][_0x263f('0x35')]=function(_0x5cbaf1){return this['sendRequest'](util[_0x263f('0x2c')](_0x263f('0x36'),_0x5cbaf1));};AGIChannel[_0x263f('0x27')][_0x263f('0x37')]=function(_0x42a4e8){return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x38'),_0x42a4e8));};AGIChannel[_0x263f('0x27')]['setPriority']=function(_0x34a95e){return this['sendRequest'](util[_0x263f('0x2c')](_0x263f('0x39'),_0x34a95e));};AGIChannel[_0x263f('0x27')][_0x263f('0xf')]=function(){return this[_0x263f('0x2b')]('HANGUP');};AGIChannel[_0x263f('0x27')]['setVariable']=function(_0x430fdf,_0x2e2275){var _0x27c30f=_[_0x263f('0x3a')](_0x2e2275)||_[_0x263f('0x3b')](_0x2e2275)?_0x2e2275[_0x263f('0x3c')]():_0x2e2275;return this[_0x263f('0x2b')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x430fdf,_0x27c30f?_0x27c30f[_0x263f('0x3c')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x263f('0x3d')]=function(_0x477d1a,_0xf271fa){return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x3e'),_0x477d1a,_0xf271fa));};AGIChannel[_0x263f('0x27')][_0x263f('0x3f')]=function(_0xe77a93,_0x2cadb7){return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x40'),_0xe77a93,_0x2cadb7));};AGIChannel[_0x263f('0x27')][_0x263f('0x41')]=function(_0xf9a72b,_0x59604d){return this[_0x263f('0x2b')](util['format'](_0x263f('0x42'),_0xf9a72b,_0x59604d));};AGIChannel[_0x263f('0x27')][_0x263f('0x43')]=function(_0x22742a,_0x461a14,_0x52e13a){_0x461a14=_0x461a14||this[_0x263f('0x44')];_0x52e13a=_0x52e13a||0x1;this['setContext'](_0x22742a);this['setExtension'](_0x461a14);this[_0x263f('0x45')](_0x52e13a);return this[_0x263f('0x2e')](util[_0x263f('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x22742a,_0x461a14,_0x52e13a));};AGIChannel[_0x263f('0x27')][_0x263f('0x46')]=function(_0x232b0b){return this[_0x263f('0x2b')](util[_0x263f('0x2c')](_0x263f('0x47'),_0x232b0b));};AGIChannel[_0x263f('0x27')][_0x263f('0x48')]=function(_0x60eaac,_0x442de2,_0x135550,_0x51f09c,_0x30997d,_0x4eef5f){_0x442de2=_0x442de2||_0x263f('0x49');_0x135550=_0x135550||'';_0x51f09c=_0x51f09c===undefined?-0x1:_0x51f09c==='-1'?-0x1:_0x51f09c*0x3e8;_0x30997d=_0x30997d===undefined?'':'s='+_0x30997d;_0x4eef5f=_0x4eef5f?'BEEP':'';return this['sendRequest'](util[_0x263f('0x2c')](_0x263f('0x4a'),_0x60eaac,_0x442de2,_0x135550,_0x51f09c,_0x4eef5f,_0x30997d));};AGIChannel['prototype']['streamFile']=function(_0x589105,_0x40c8c9){_0x40c8c9=_0x40c8c9||'';return this['sendRequest'](util['format'](_0x263f('0x4b'),_0x589105,_0x40c8c9));};AGIChannel[_0x263f('0x27')]['agi']=function(_0x35efde){return this['exec'](_0x263f('0x4c'),_0x35efde);};AGIChannel[_0x263f('0x27')][_0x263f('0x4d')]=function(_0x2ce885){return this[_0x263f('0x31')](_0x263f('0x4e'),_0x2ce885);};AGIChannel[_0x263f('0x27')][_0x263f('0x1c')]=function(_0x384fc9,_0x1454d2){this[_0x263f('0x2e')](util[_0x263f('0x2c')](_0x263f('0x4f'),_0x384fc9['id'],_0x384fc9['label'],_0x1454d2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x263f('0x50')]=AGIChannel; \ No newline at end of file +var _0x3024=['exec','isArray','format','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','exports','util','lodash','EventEmitter','./reply','setEncoding','utf8','headers','emit','ready','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22'];(function(_0x1752ba,_0x5287c5){var _0x1e2bdb=function(_0xf956cb){while(--_0xf956cb){_0x1752ba['push'](_0x1752ba['shift']());}};_0x1e2bdb(++_0x5287c5);}(_0x3024,0x64));var _0x4302=function(_0x5874ca,_0x31e519){_0x5874ca=_0x5874ca-0x0;var _0x3fdab4=_0x3024[_0x5874ca];return _0x3fdab4;};'use strict';var util=require(_0x4302('0x0'));var _=require(_0x4302('0x1'));var EventEmitter=require('events')[_0x4302('0x2')];var AGIReply=require(_0x4302('0x3'));var AGIError=require('./error');function AGIChannel(_0x520133){var _0x22cb7f=this,_0x4ba02d=new AGIReply(),_0x2d3e1d=![],_0x1d9b55={};EventEmitter['call'](_0x22cb7f);_0x520133[_0x4302('0x4')](_0x4302('0x5'));_0x520133['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x4ba02d[_0x4302('0x4')](_0x4302('0x5'));_0x4ba02d['on'](_0x4302('0x6'),function(_0x285613){for(var _0x22cb00 in _0x285613){_0x22cb7f[_0x22cb00]=_0x285613[_0x22cb00];}_0x22cb7f[_0x4302('0x7')](_0x4302('0x8'));});_0x4ba02d['on']('line',function(_0x1a51bd){if(_0x1a51bd[_0x4302('0x9')]()==_0x4302('0xa')){_0x22cb7f['emit'](_0x4302('0xa'));return;}if(_0x1a51bd[_0x4302('0xb')](0x0,0xb)=='520-Invalid'){_0x2d3e1d=!![];}if(_0x2d3e1d){_0x1d9b55['rx']+=_0x1a51bd+'\x0a';if(_0x1a51bd[_0x4302('0xc')](_0x4302('0xd'))!=-0x1){_0x2d3e1d=![];}}else{_0x1d9b55['rx']=_0x1a51bd;}if(_0x2d3e1d){return;}if(typeof _0x1d9b55['cb']==_0x4302('0xe')){var _0x5a0241=_0x1d9b55['rx']['substring'](0x0,0x3),_0x3ce552=null,_0x177706=null;_0x5a0241=parseInt(_0x5a0241);if(isNaN(_0x5a0241)){_0x1d9b55['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4302('0xf')});return;}if(_0x5a0241!=0xc8){_0x1d9b55['cb'](null,{'code':_0x5a0241,'result':-0x1,'extra':'KO'});return;}_0x3ce552=_0x1d9b55['rx'][_0x4302('0xb')](0x4)[_0x4302('0x10')]('result=','');if(_0x3ce552[_0x4302('0x11')]('\x20')!=-0x1){_0x3ce552=_0x3ce552[_0x4302('0x12')](0x0,_0x3ce552['indexOf']('\x20'));}if(_[_0x4302('0x13')](_0x3ce552,'-1')){_0x3ce552=parseInt(_0x3ce552);}_0x177706=_0x1d9b55['rx'][_0x4302('0x14')]('\x20');if(_0x177706['length']==0x3){_0x177706=_0x177706[0x2][_0x4302('0xb')](0x1,_0x177706[0x2][_0x4302('0x15')]-0x1);}else if(_0x177706[_0x4302('0x15')]>0x3){var _0x32178f=/\((.+)\)/;var _0x33c1c0=_0x1d9b55['rx'][_0x4302('0x16')](_0x32178f);if(_0x33c1c0){_0x177706=_0x33c1c0[0x1];}else{_0x177706=null;}}else{_0x177706=null;}_0x1d9b55['cb'](null,{'code':_0x5a0241,'result':_0x3ce552,'extra':_0x177706});}});_0x520133['on'](_0x4302('0x17'),function(_0x23aa0e){_0x22cb7f[_0x4302('0x7')](_0x4302('0x17'),new AGIError(_0x4302('0x18'),_0x23aa0e[_0x4302('0x19')]));});_0x520133['on'](_0x4302('0x1a'),function(){_0x22cb7f[_0x4302('0x7')]('close',new AGIError(_0x4302('0x1b')));});_0x520133['on']('timeout',function(){_0x22cb7f[_0x4302('0x7')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x520133[_0x4302('0x1c')]();});_0x520133[_0x4302('0x1d')](_0x4ba02d);this[_0x4302('0x1e')]=function(_0x70249c,_0x525520){var _0x70249c=_0x70249c||'',_0x525520=typeof _0x525520==_0x4302('0xe')?_0x525520:new Function();_0x1d9b55={'tx':_0x70249c,'rx':'','cb':_0x525520};_0x520133[_0x4302('0x1f')](_0x70249c+'\x0a');},this['close']=function(){_0x520133[_0x4302('0x1c')]();};}util[_0x4302('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x4302('0x21')][_0x4302('0x22')]=function(_0x5536e0){return this['command']['sync'](this,_0x5536e0);};AGIChannel['prototype'][_0x4302('0x23')]=function(){return this[_0x4302('0x22')]('ANSWER');};AGIChannel[_0x4302('0x21')][_0x4302('0x24')]=function(_0x20fe19,_0x5407b3,_0x17a8b7){_0x20fe19=_0x20fe19===undefined?'beep':_0x20fe19;_0x5407b3=_0x5407b3===undefined?'5':_0x5407b3;_0x17a8b7=_0x17a8b7===undefined?'1':_0x17a8b7;return this['sendRequest'](util['format'](_0x4302('0x25'),_0x20fe19,_0x5407b3*0x3e8,_0x17a8b7));};AGIChannel['prototype'][_0x4302('0x26')]=function(_0x1aca12){_0x1aca12=_0x1aca12||'NO\x20MESSAGE';return this[_0x4302('0x22')](util['format'](_0x4302('0x27'),_0x1aca12));};AGIChannel[_0x4302('0x21')][_0x4302('0x28')]=function(_0x27aea6,_0x2dd48c){if(_[_0x4302('0x29')](_0x2dd48c)){return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x2b'),_0x27aea6,_0x2dd48c['join'](',')));}return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x2b'),_0x27aea6,_0x2dd48c));};AGIChannel[_0x4302('0x21')]['setContext']=function(_0xe33711){return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x2c'),_0xe33711));};AGIChannel[_0x4302('0x21')]['setExtension']=function(_0x13caf0){return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x2d'),_0x13caf0));};AGIChannel[_0x4302('0x21')][_0x4302('0x2e')]=function(_0x42c99e){return this[_0x4302('0x22')](util[_0x4302('0x2a')]('SET\x20PRIORITY\x20%s',_0x42c99e));};AGIChannel[_0x4302('0x21')]['hangup']=function(){return this[_0x4302('0x22')]('HANGUP');};AGIChannel['prototype'][_0x4302('0x2f')]=function(_0x35ad22,_0x1684f2){var _0x52920a=_[_0x4302('0x30')](_0x1684f2)||_[_0x4302('0x31')](_0x1684f2)?_0x1684f2[_0x4302('0x32')]():_0x1684f2;return this[_0x4302('0x22')](util['format'](_0x4302('0x33'),_0x35ad22,_0x52920a?_0x52920a['toString']()[_0x4302('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4302('0x21')][_0x4302('0x34')]=function(_0x31e786,_0xffd1ca){return this['sendRequest'](util[_0x4302('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x31e786,_0xffd1ca));};AGIChannel['prototype']['sayDigits']=function(_0x423c0a,_0x39bedf){return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x35'),_0x423c0a,_0x39bedf));};AGIChannel[_0x4302('0x21')][_0x4302('0x36')]=function(_0x263950,_0x3af7ae){return this[_0x4302('0x22')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x263950,_0x3af7ae));};AGIChannel[_0x4302('0x21')][_0x4302('0x37')]=function(_0x3a5fcf,_0x3a8fb5,_0x5016fa){_0x3a8fb5=_0x3a8fb5||this['extension'];_0x5016fa=_0x5016fa||0x1;this[_0x4302('0x38')](_0x3a5fcf);this[_0x4302('0x39')](_0x3a8fb5);this[_0x4302('0x2e')](_0x5016fa);return this[_0x4302('0x26')](util[_0x4302('0x2a')](_0x4302('0x3a'),_0x3a5fcf,_0x3a8fb5,_0x5016fa));};AGIChannel['prototype'][_0x4302('0x3b')]=function(_0x52e975){return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x3c'),_0x52e975));};AGIChannel[_0x4302('0x21')]['recordFile']=function(_0x368256,_0x476d2a,_0x3ba0a8,_0x231786,_0x62184f,_0x53e61a){_0x476d2a=_0x476d2a||_0x4302('0x3d');_0x3ba0a8=_0x3ba0a8||'';_0x231786=_0x231786===undefined?-0x1:_0x231786==='-1'?-0x1:_0x231786*0x3e8;_0x62184f=_0x62184f===undefined?'':'s='+_0x62184f;_0x53e61a=_0x53e61a?_0x4302('0x3e'):'';return this['sendRequest'](util['format'](_0x4302('0x3f'),_0x368256,_0x476d2a,_0x3ba0a8,_0x231786,_0x53e61a,_0x62184f));};AGIChannel[_0x4302('0x21')]['streamFile']=function(_0x2240f5,_0x30a38a){_0x30a38a=_0x30a38a||'';return this[_0x4302('0x22')](util[_0x4302('0x2a')](_0x4302('0x40'),_0x2240f5,_0x30a38a));};AGIChannel[_0x4302('0x21')][_0x4302('0x41')]=function(_0x24ce01){return this[_0x4302('0x28')](_0x4302('0x42'),_0x24ce01);};AGIChannel['prototype'][_0x4302('0x43')]=function(_0x4ce759){return this[_0x4302('0x28')]('WAIT',_0x4ce759);};AGIChannel[_0x4302('0x21')][_0x4302('0x17')]=function(_0x577d17,_0x34bc72){this['noop'](util[_0x4302('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x577d17['id'],_0x577d17[_0x4302('0x44')],_0x34bc72));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4302('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 63eb98d..4c16248 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 _0xa17d=['message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply'];(function(_0x2256ee,_0x5194ec){var _0x2088cf=function(_0x409752){while(--_0x409752){_0x2256ee['push'](_0x2256ee['shift']());}};_0x2088cf(++_0x5194ec);}(_0xa17d,0x143));var _0xda17=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0xa17d[_0x2e78e9];return _0x35aad4;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xda17('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xda17('0x1'),'E_AGI_SERVER_CLOSE':_0xda17('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xda17('0x3'),'E_AGI_SOCKET_ERROR':_0xda17('0x4'),'E_AGI_SOCKET_CLOSE':_0xda17('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xda17('0x6'),'E_AGI_COMMAND_EMPTY':_0xda17('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xda17('0x8'),'E_AGI_IVR_ENTRY':_0xda17('0x9')};function AGIError(_0x1b469c){var _0x1b469c=_0x1b469c||null,_0x2df923=_0x2df923||[],_0x208788=0x1,_0x5a0f3a='';if(!error[_0x1b469c]){_0x1b469c=_0xda17('0xa');}_0x2df923['push'](error[_0x1b469c]);while(arguments[_0x208788]){_0x2df923['push'](arguments[_0x208788]);_0x208788++;}_0x5a0f3a=util[_0xda17('0xb')][_0xda17('0xc')](util,_0x2df923);this[_0xda17('0xd')]=_0x5a0f3a;this[_0xda17('0xe')]=_0x1b469c;}module[_0xda17('0xf')]=AGIError; \ No newline at end of file +var _0x8c07=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x8c07,0x71));var _0x78c0=function(_0x13e884,_0x43946f){_0x13e884=_0x13e884-0x0;var _0x5f3e69=_0x8c07[_0x13e884];return _0x5f3e69;};'use strict';var util=require(_0x78c0('0x0'));var error={'E_AGI_UNDEFINED':_0x78c0('0x1'),'E_AGI_ARGUMENT_PORT':_0x78c0('0x2'),'E_AGI_SERVER_ERROR':_0x78c0('0x3'),'E_AGI_SERVER_CLOSE':_0x78c0('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x78c0('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x78c0('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x78c0('0x7'),'E_AGI_COMMAND_EMPTY':_0x78c0('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x78c0('0x9'),'E_AGI_IVR_ENTRY':_0x78c0('0xa')};function AGIError(_0x26427e){var _0x26427e=_0x26427e||null,_0x22cfeb=_0x22cfeb||[],_0x3b2133=0x1,_0x3179ad='';if(!error[_0x26427e]){_0x26427e='E_AGI_UNDEFINED';}_0x22cfeb[_0x78c0('0xb')](error[_0x26427e]);while(arguments[_0x3b2133]){_0x22cfeb[_0x78c0('0xb')](arguments[_0x3b2133]);_0x3b2133++;}_0x3179ad=util[_0x78c0('0xc')]['apply'](util,_0x22cfeb);this[_0x78c0('0xd')]=_0x3179ad;this[_0x78c0('0xe')]=_0x26427e;}module[_0x78c0('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 2a69728..fedc223 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 _0xe35d=['length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse'];(function(_0x422cbe,_0x41f7f8){var _0x9c4c31=function(_0x3fc1f2){while(--_0x3fc1f2){_0x422cbe['push'](_0x422cbe['shift']());}};_0x9c4c31(++_0x41f7f8);}(_0xe35d,0x14d));var _0xde35=function(_0x5b79ba,_0x398df1){_0x5b79ba=_0x5b79ba-0x0;var _0x2eacbe=_0xe35d[_0x5b79ba];return _0x2eacbe;};'use strict';var _=require(_0xde35('0x0'));var logger=require(_0xde35('0x1'))(_0xde35('0x2'));var verticesWithRetry=[_0xde35('0x3'),_0xde35('0x4'),_0xde35('0x5')];var Graph=function(){this[_0xde35('0x6')]={};this[_0xde35('0x7')]={};this[_0xde35('0x8')]=0x0;};Graph[_0xde35('0x9')][_0xde35('0xa')]=function(_0x594448){this['vertices'][_0x594448['id']]=_0x594448;this['edges'][_0x594448['id']]=[];};Graph[_0xde35('0x9')][_0xde35('0xb')]=function(_0xa0218a,_0x18141f,_0xf6e608){this[_0xde35('0x7')][_0xa0218a][_0xde35('0xc')]({'target':_0x18141f,'condition':_0xf6e608});this[_0xde35('0x8')]+=0x1;};Graph[_0xde35('0x9')][_0xde35('0xd')]=function(){return _[_0xde35('0xd')](this[_0xde35('0x6')]);};Graph[_0xde35('0x9')][_0xde35('0xe')]=function(){return this[_0xde35('0x8')];};Graph['prototype']['getVertex']=function(_0x57f15b){return this[_0xde35('0x6')][_0x57f15b];};Graph[_0xde35('0x9')][_0xde35('0xf')]=function(_0x3adaa9,_0x33a07d){if(!this[_0xde35('0x6')][_0x3adaa9]){return logger[_0xde35('0x10')](_0xde35('0x11'));}var _0x10ae7a=_0x33a07d(this[_0xde35('0x6')][_0x3adaa9]);if(!_0x10ae7a){return logger[_0xde35('0x10')](_0xde35('0x12'));}if(this[_0xde35('0x7')][_0x3adaa9][_0xde35('0x13')]===0x0){return logger[_0xde35('0x10')](_0xde35('0x14'));}for(var _0x5c0912=0x0,_0x52383f=[],_0x127a4d=![];_0x5c0912\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','toJson','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','getSquareProject','then','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','debug','gotoc','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','catch','[LICENSE]','connection'];(function(_0x450002,_0x25b659){var _0x49a8fb=function(_0xa776f8){while(--_0xa776f8){_0x450002['push'](_0x450002['shift']());}};_0x49a8fb(++_0x25b659);}(_0x64f5,0x1ae));var _0x564f=function(_0x5b0911,_0x1ccf2d){_0x5b0911=_0x5b0911-0x0;var _0x440024=_0x64f5[_0x5b0911];return _0x440024;};'use strict';var parser=require(_0x564f('0x0'));var _=require(_0x564f('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x564f('0x2'));var config=require(_0x564f('0x3'));var logger=require(_0x564f('0x4'))(_0x564f('0x5'));var utilLicense=require(_0x564f('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x564f('0x7'));var Graph=require(_0x564f('0x8'));var Vertices=require(_0x564f('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x564f('0x5')]=_[_0x564f('0xa')](config[_0x564f('0x5')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x48a9ea){process[_0x564f('0xb')](function(){syncho(function(){try{setChannelVariables(_0x48a9ea);agiHandler(_0x48a9ea);}catch(_0x46819c){logger[_0x564f('0xc')](_0x46819c['stack']);}});});}function listeningHandler(){console[_0x564f('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x564f('0x5')]['port']);logger[_0x564f('0xe')](util[_0x564f('0xf')](_0x564f('0x10'),config['agi']['ip'],config[_0x564f('0x5')][_0x564f('0x11')]));}function errorHandler(_0x137eee){if(_0x137eee&&_0x137eee['name']&&_0x137eee[_0x564f('0x12')]){logger['error'](util[_0x564f('0xf')]('[%s]\x20%s',_0x137eee['name'],_0x137eee['message']));}else{logger[_0x564f('0xc')](util['format'](_0x564f('0x13'),_0x137eee[_0x564f('0x14')]));}}function closeHandler(){logger[_0x564f('0xe')](util[_0x564f('0xf')](_0x564f('0x15'),this[_0x564f('0x16')],this[_0x564f('0x17')],this[_0x564f('0x18')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x7a811f){logger[_0x564f('0xc')](_0x7a811f[_0x564f('0x14')]);}}function timeoutHandler(){logger[_0x564f('0xe')](util[_0x564f('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x564f('0x16')],this[_0x564f('0x17')],this[_0x564f('0x18')],this['dnid'],this[_0x564f('0x19')]));}function hangupHandler(){logger[_0x564f('0xe')](util[_0x564f('0xf')](_0x564f('0x1a'),this[_0x564f('0x16')],this[_0x564f('0x17')],this[_0x564f('0x18')],this[_0x564f('0x1b')],this['uniqueid']));this[_0x564f('0x1c')]=!![];}function getRoot(_0x3419fc){return parser[_0x564f('0x1d')](_0x3419fc,{'object':!![]})['mxGraphModel'][_0x564f('0x1e')];}function addVertex(_0x49eda5,_0x302ffc,_0x51bdf5){_0x302ffc[_0x564f('0x1f')]=_0x51bdf5;if(_0x302ffc['hasOwnProperty'](_0x564f('0x20'))){_0x302ffc[_0x564f('0x21')]=parseInt(_0x302ffc[_0x564f('0x20')],0xa);}_0x49eda5[_0x564f('0x22')](_[_0x564f('0x23')](_0x302ffc,_0x564f('0x24')));}function initGraph(_0x24f0da,_0xebde65){var _0x1ac9f6=new Graph();for(var _0x2cda09 in _0x24f0da){if(_0x24f0da[_0x564f('0x25')](_0x2cda09)){if(_[_0x564f('0x26')](_0x24f0da[_0x2cda09])){for(var _0x4e4340=0x0;_0x4e4340<_0x24f0da[_0x2cda09][_0x564f('0x27')];_0x4e4340+=0x1){addVertex(_0x1ac9f6,_0x24f0da[_0x2cda09][_0x4e4340],_0x2cda09);}}else{addVertex(_0x1ac9f6,_0x24f0da[_0x2cda09],_0x2cda09);}}}for(var _0x1192c2=0x0;_0x1192c2<_0xebde65[_0x564f('0x27')];_0x1192c2+=0x1){if(_0xebde65[_0x1192c2][_0x564f('0x28')]&&_0xebde65[_0x1192c2]['target']){_0x1ac9f6[_0x564f('0x29')](_0xebde65[_0x1192c2][_0x564f('0x28')],_0xebde65[_0x1192c2][_0x564f('0x2a')],_0xebde65[_0x1192c2]['value']);}}return _0x1ac9f6;}function getSquareProject(_0x30c852,_0x7588a0){rpc[_0x564f('0x2b')](_0x30c852)[_0x564f('0x2c')](function(_0xd0cf94){_0x7588a0(null,_0xd0cf94);})['catch'](function(_0x2c4487){_0x7588a0(null,_0x2c4487);});}function createSquareReport(_0x149714,_0x57188b){rpc[_0x564f('0x2d')](_0x149714)[_0x564f('0x2c')](function(_0x402e62){if(_0x57188b){_0x57188b(null,_0x402e62);}})['catch'](function(_0x57f6ba){if(_0x57188b){_0x57188b(null,_0x57f6ba);}});}function setChannelVariables(_0x47d2f5){for(var _0x1cc6f4 in _0x47d2f5){if(_0x47d2f5[_0x564f('0x25')](_0x1cc6f4)){if(_0x1cc6f4[_0x564f('0x2e')](_0x564f('0x2f'))===0x0){_0x47d2f5[_0x1cc6f4[_0x564f('0x30')](0x4)]=_0x47d2f5[_0x1cc6f4];delete _0x47d2f5[_0x1cc6f4];}}}}function getLogFromObject(_0x2c2582){return util[_0x564f('0x31')](_0x2c2582,{'showHidden':![],'depth':null});}function agiHandler(_0x3a8d99){var _0x2134ae,_0xdf03aa,_0x47a810,_0xa8b54f,_0x4477f5;logger['debug'](_0x564f('0x32'),JSON[_0x564f('0x33')](_0x3a8d99,null,0x2));logger['info'](util[_0x564f('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a8d99[_0x564f('0x16')],_0x3a8d99[_0x564f('0x17')],_0x3a8d99[_0x564f('0x18')],_0x3a8d99[_0x564f('0x1b')],_0x3a8d99['uniqueid']));_0x3a8d99['on'](_0x564f('0xc'),errorHandler);_0x3a8d99['on'](_0x564f('0x34'),closeHandler);_0x3a8d99['on'](_0x564f('0x35'),timeoutHandler);_0x3a8d99[_0x564f('0x1c')]=![];_0x3a8d99['on'](_0x564f('0x36'),hangupHandler);var _0x17ea2f=getSquareProject[_0x564f('0x37')](null,_0x3a8d99[_0x564f('0x16')]);if(_0x17ea2f){if(_0x17ea2f[_0x564f('0x38')]){_0x2134ae=getRoot(_0x17ea2f[_0x564f('0x38')]);if(_0x2134ae&&_0x2134ae[_0x564f('0x39')]){logger['debug'](_0x564f('0x1e'),JSON[_0x564f('0x33')](_0x2134ae,null,0x2));_0x3a8d99[_0x564f('0x3a')]=moment()[_0x564f('0xf')](_0x564f('0x3b'));_0xdf03aa=initGraph(_[_0x564f('0x23')](_0x2134ae,_0x564f('0x24')),_0x2134ae['mxCell']);_0x47a810=new Vertices(_0x3a8d99,rpc,mailRpc);logger[_0x564f('0xe')](util[_0x564f('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a8d99[_0x564f('0x16')],_0x3a8d99[_0x564f('0x17')],_0x3a8d99[_0x564f('0x18')],_0x3a8d99[_0x564f('0x1b')],_0x3a8d99[_0x564f('0x19')]));_0xdf03aa[_0x564f('0x3c')](_0x2134ae['start']['id'],function(_0x443db6){try{_0x443db6=_0x47a810[_0x564f('0x3d')](_0x443db6);logger[_0x564f('0x3e')]('vertex',JSON[_0x564f('0x33')](_0x443db6,null,0x2));if(_0x443db6['agicommand']===_0x564f('0x3f')){logger[_0x564f('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3a8d99[_0x564f('0x40')]=_0x443db6[_0x564f('0x40')]||_0x3a8d99[_0x564f('0x40')];_0x3a8d99[_0x564f('0x41')]=_0x443db6[_0x564f('0x41')];_0x3a8d99[_0x564f('0x42')]=_0x443db6[_0x564f('0x42')]?_0x443db6['priority']-0x1:0x1;return null;}else if(_0x443db6&&_0x47a810[_0x443db6[_0x564f('0x1f')]]){_0x4477f5=_0x47a810[_0x443db6[_0x564f('0x1f')]](_0x443db6);logger[_0x564f('0xe')](_0x564f('0x43'),JSON[_0x564f('0x33')](_0x4477f5,null,0x2));if(_0x4477f5&&_0x4477f5['code']===AGI_CODE_SUCCESS&&_0x4477f5[_0x564f('0x44')]!==AGI_RESULT_ERROR&&!_0x3a8d99['evtHangup']){logger[_0x564f('0x3e')](_0x564f('0x43'),getLogFromObject(_0x4477f5));return _[_0x564f('0x45')](_0x4477f5[_0x564f('0x44')])?null:_0x4477f5[_0x564f('0x44')][_0x564f('0x46')]();}else{logger[_0x564f('0xc')](_0x564f('0x43'),getLogFromObject(_0x4477f5));return null;}}else{logger[_0x564f('0xc')](_0x564f('0x47'));return null;}}catch(_0x53537e){logger[_0x564f('0xc')](_0x53537e[_0x564f('0x14')]);return null;}});if(_0x2134ae[_0x564f('0x48')]){logger[_0x564f('0xe')](util['format'](_0x564f('0x49'),_0x3a8d99[_0x564f('0x16')],_0x3a8d99[_0x564f('0x17')],_0x3a8d99['callerid'],_0x3a8d99['dnid'],_0x3a8d99[_0x564f('0x19')]));_0xdf03aa[_0x564f('0x3c')](_0x2134ae[_0x564f('0x48')]['id'],function(_0x554d68){try{_0x554d68=_0x47a810[_0x564f('0x3d')](_0x554d68);logger['debug'](_0x564f('0x4a'),JSON[_0x564f('0x33')](_0x554d68,null,0x2));if(_0x554d68&&_0x47a810[_0x554d68[_0x564f('0x1f')]]){_0x4477f5=_0x47a810[_0x554d68['agicommand']](_0x554d68);if(_0x4477f5){logger['debug'](_0x564f('0x43'),getLogFromObject(_0x4477f5));return _[_0x564f('0x45')](_0x4477f5[_0x564f('0x44')])?null:_0x4477f5[_0x564f('0x44')][_0x564f('0x46')]();}else{logger['error']('response',getLogFromObject(_0x4477f5));return null;}}else{logger[_0x564f('0xc')](_0x564f('0x47'));return null;}}catch(_0x9b02dc){logger['error'](_0x9b02dc[_0x564f('0x14')]);return null;}});}logger['info'](util[_0x564f('0xf')](_0x564f('0x4b'),_0x3a8d99[_0x564f('0x16')],_0x3a8d99[_0x564f('0x17')],_0x3a8d99['callerid'],_0x3a8d99['dnid'],_0x3a8d99[_0x564f('0x19')]));logger['info'](util[_0x564f('0xf')](_0x564f('0x4c'),_0x3a8d99[_0x564f('0x40')],_0x3a8d99[_0x564f('0x41')],parseInt(_0x3a8d99[_0x564f('0x42')],0xa)+0x1));_0x3a8d99[_0x564f('0x4d')](_0x3a8d99[_0x564f('0x40')],_0x3a8d99['extension'],parseInt(_0x3a8d99[_0x564f('0x42')],0xa)+0x1);_0x3a8d99[_0x564f('0x34')]();}}else{logger[_0x564f('0xc')](util[_0x564f('0xf')](_0x564f('0x4e'),_0x3a8d99['arg_1']));_0x3a8d99[_0x564f('0x4d')](_0x3a8d99['context'],_0x3a8d99[_0x564f('0x41')],parseInt(_0x3a8d99[_0x564f('0x42')],0xa)+0x1);_0x3a8d99[_0x564f('0x34')]();}}else{logger['error'](util['format'](_0x564f('0x4f'),_0x3a8d99[_0x564f('0x16')]));_0x3a8d99[_0x564f('0x4d')](_0x3a8d99[_0x564f('0x40')],_0x3a8d99[_0x564f('0x41')],parseInt(_0x3a8d99[_0x564f('0x42')],0xa)+0x1);_0x3a8d99[_0x564f('0x34')]();}}function main(){var _0x400787;return utilLicense['getLicense']()['then'](function(_0x210520){if(_0x210520){if(_0x210520[_0x564f('0x50')]){if(_0x210520[_0x564f('0x51')]&&_0x210520[_0x564f('0x51')]>0x0){logger[_0x564f('0xe')](util[_0x564f('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x210520['callysquare']));_0x400787=_0x210520['callysquare'];}else{logger[_0x564f('0xe')](_0x564f('0x52'));}}else{logger[_0x564f('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x400787=-0x1;}}})[_0x564f('0x53')](function(_0x2aa23f){logger[_0x564f('0xc')](_0x564f('0x54'),_0x2aa23f[_0x564f('0x14')]);})[_0x564f('0x48')](function(){var _0x4fe4f9=require('./server')(config[_0x564f('0x5')][_0x564f('0x11')],config[_0x564f('0x5')]['ip'],_0x400787);_0x4fe4f9['on'](_0x564f('0xc'),errorHandler);_0x4fe4f9['on']('listening',listeningHandler);_0x4fe4f9['on'](_0x564f('0x55'),connectionHandler);_0x4fe4f9['on'](_0x564f('0x34'),closeHandler);});}main(); \ No newline at end of file +var _0xe016=['[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','arg_1','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x246419,_0x554ea8){var _0x5c54c6=function(_0xc723fc){while(--_0xc723fc){_0x246419['push'](_0x246419['shift']());}};_0x5c54c6(++_0x554ea8);}(_0xe016,0x1cd));var _0x6e01=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xe016[_0x1a72f3];return _0x57ef47;};'use strict';var parser=require(_0x6e01('0x0'));var _=require('lodash');var syncho=require(_0x6e01('0x1'));var util=require(_0x6e01('0x2'));var moment=require(_0x6e01('0x3'));var config=require('../../config/environment');var logger=require(_0x6e01('0x4'))(_0x6e01('0x5'));var utilLicense=require(_0x6e01('0x6'));var rpc=require(_0x6e01('0x7'));var mailRpc=require(_0x6e01('0x8'));var Graph=require(_0x6e01('0x9'));var Vertices=require(_0x6e01('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x6e01('0x5')]=_[_0x6e01('0xb')](config[_0x6e01('0x5')],{'ip':_0x6e01('0xc'),'port':0x11dd});function connectionHandler(_0x5f2860){process[_0x6e01('0xd')](function(){syncho(function(){try{setChannelVariables(_0x5f2860);agiHandler(_0x5f2860);}catch(_0x428c4b){logger[_0x6e01('0xe')](_0x428c4b[_0x6e01('0xf')]);}});});}function listeningHandler(){console['log'](_0x6e01('0x10'),config[_0x6e01('0x5')][_0x6e01('0x11')]);logger[_0x6e01('0x12')](util['format'](_0x6e01('0x13'),config[_0x6e01('0x5')]['ip'],config['agi'][_0x6e01('0x11')]));}function errorHandler(_0x43c4ba){if(_0x43c4ba&&_0x43c4ba[_0x6e01('0x14')]&&_0x43c4ba[_0x6e01('0x15')]){logger[_0x6e01('0xe')](util[_0x6e01('0x16')](_0x6e01('0x17'),_0x43c4ba[_0x6e01('0x14')],_0x43c4ba[_0x6e01('0x15')]));}else{logger[_0x6e01('0xe')](util[_0x6e01('0x16')]('[ERROR]\x20%s',_0x43c4ba[_0x6e01('0xf')]));}}function closeHandler(){logger[_0x6e01('0x12')](util['format'](_0x6e01('0x18'),this['arg_1'],this[_0x6e01('0x19')],this[_0x6e01('0x1a')],this['dnid'],this[_0x6e01('0x1b')]));try{createSquareReport(this);}catch(_0x4178c6){logger['error'](_0x4178c6[_0x6e01('0xf')]);}}function timeoutHandler(){logger['info'](util[_0x6e01('0x16')](_0x6e01('0x1c'),this['arg_1'],this[_0x6e01('0x19')],this[_0x6e01('0x1a')],this[_0x6e01('0x1d')],this[_0x6e01('0x1b')]));}function hangupHandler(){logger[_0x6e01('0x12')](util[_0x6e01('0x16')](_0x6e01('0x1e'),this[_0x6e01('0x1f')],this[_0x6e01('0x19')],this[_0x6e01('0x1a')],this[_0x6e01('0x1d')],this[_0x6e01('0x1b')]));this[_0x6e01('0x20')]=!![];}function getRoot(_0x1d8013){return parser['toJson'](_0x1d8013,{'object':!![]})[_0x6e01('0x21')][_0x6e01('0x22')];}function addVertex(_0xb94ad8,_0x2a5197,_0x11654d){_0x2a5197[_0x6e01('0x23')]=_0x11654d;if(_0x2a5197[_0x6e01('0x24')]('retry')){_0x2a5197[_0x6e01('0x25')]=parseInt(_0x2a5197[_0x6e01('0x26')],0xa);}_0xb94ad8[_0x6e01('0x27')](_[_0x6e01('0x28')](_0x2a5197,_0x6e01('0x29')));}function initGraph(_0x1d7a42,_0x3b6b36){var _0x460bba=new Graph();for(var _0x55e17a in _0x1d7a42){if(_0x1d7a42[_0x6e01('0x24')](_0x55e17a)){if(_['isArray'](_0x1d7a42[_0x55e17a])){for(var _0x35bf56=0x0;_0x35bf56<_0x1d7a42[_0x55e17a][_0x6e01('0x2a')];_0x35bf56+=0x1){addVertex(_0x460bba,_0x1d7a42[_0x55e17a][_0x35bf56],_0x55e17a);}}else{addVertex(_0x460bba,_0x1d7a42[_0x55e17a],_0x55e17a);}}}for(var _0xfc3dc2=0x0;_0xfc3dc2<_0x3b6b36[_0x6e01('0x2a')];_0xfc3dc2+=0x1){if(_0x3b6b36[_0xfc3dc2][_0x6e01('0x2b')]&&_0x3b6b36[_0xfc3dc2][_0x6e01('0x2c')]){_0x460bba[_0x6e01('0x2d')](_0x3b6b36[_0xfc3dc2][_0x6e01('0x2b')],_0x3b6b36[_0xfc3dc2][_0x6e01('0x2c')],_0x3b6b36[_0xfc3dc2][_0x6e01('0x2e')]);}}return _0x460bba;}function getSquareProject(_0x434ba0,_0x544226){rpc[_0x6e01('0x2f')](_0x434ba0)[_0x6e01('0x30')](function(_0x351d17){_0x544226(null,_0x351d17);})[_0x6e01('0x31')](function(_0x1a29da){_0x544226(null,_0x1a29da);});}function createSquareReport(_0x4a7a7d,_0x9c5475){rpc[_0x6e01('0x32')](_0x4a7a7d)[_0x6e01('0x30')](function(_0x34b291){if(_0x9c5475){_0x9c5475(null,_0x34b291);}})['catch'](function(_0x2c9524){if(_0x9c5475){_0x9c5475(null,_0x2c9524);}});}function setChannelVariables(_0x57cd19){for(var _0x2e52a6 in _0x57cd19){if(_0x57cd19['hasOwnProperty'](_0x2e52a6)){if(_0x2e52a6[_0x6e01('0x33')](_0x6e01('0x34'))===0x0){_0x57cd19[_0x2e52a6[_0x6e01('0x35')](0x4)]=_0x57cd19[_0x2e52a6];delete _0x57cd19[_0x2e52a6];}}}}function getLogFromObject(_0x8f0ee4){return util['inspect'](_0x8f0ee4,{'showHidden':![],'depth':null});}function agiHandler(_0x26a94d){var _0x4cc676,_0x1ad851,_0x59fa6c,_0x138be0,_0xc424b8;logger[_0x6e01('0x36')](_0x6e01('0x37'),JSON[_0x6e01('0x38')](_0x26a94d,null,0x2));logger[_0x6e01('0x12')](util[_0x6e01('0x16')](_0x6e01('0x39'),_0x26a94d[_0x6e01('0x1f')],_0x26a94d[_0x6e01('0x19')],_0x26a94d[_0x6e01('0x1a')],_0x26a94d['dnid'],_0x26a94d['uniqueid']));_0x26a94d['on']('error',errorHandler);_0x26a94d['on'](_0x6e01('0x3a'),closeHandler);_0x26a94d['on'](_0x6e01('0x3b'),timeoutHandler);_0x26a94d[_0x6e01('0x20')]=![];_0x26a94d['on']('hangup',hangupHandler);var _0xe98235=getSquareProject[_0x6e01('0x3c')](null,_0x26a94d[_0x6e01('0x1f')]);if(_0xe98235){if(_0xe98235[_0x6e01('0x3d')]){_0x4cc676=getRoot(_0xe98235['production']);if(_0x4cc676&&_0x4cc676[_0x6e01('0x3e')]){logger[_0x6e01('0x36')](_0x6e01('0x22'),JSON['stringify'](_0x4cc676,null,0x2));_0x26a94d['joinAt']=moment()[_0x6e01('0x16')](_0x6e01('0x3f'));_0x1ad851=initGraph(_[_0x6e01('0x28')](_0x4cc676,'mxCell'),_0x4cc676['mxCell']);_0x59fa6c=new Vertices(_0x26a94d,rpc,mailRpc);logger[_0x6e01('0x12')](util[_0x6e01('0x16')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x26a94d[_0x6e01('0x1f')],_0x26a94d['calleridname'],_0x26a94d[_0x6e01('0x1a')],_0x26a94d[_0x6e01('0x1d')],_0x26a94d[_0x6e01('0x1b')]));_0x1ad851[_0x6e01('0x40')](_0x4cc676['start']['id'],function(_0x400849){try{_0x400849=_0x59fa6c[_0x6e01('0x41')](_0x400849);logger[_0x6e01('0x36')](_0x6e01('0x42'),JSON['stringify'](_0x400849,null,0x2));if(_0x400849[_0x6e01('0x23')]===_0x6e01('0x43')){logger[_0x6e01('0x12')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x26a94d[_0x6e01('0x44')]=_0x400849[_0x6e01('0x44')]||_0x26a94d[_0x6e01('0x44')];_0x26a94d[_0x6e01('0x45')]=_0x400849[_0x6e01('0x45')];_0x26a94d[_0x6e01('0x46')]=_0x400849['priority']?_0x400849['priority']-0x1:0x1;return null;}else if(_0x400849&&_0x59fa6c[_0x400849[_0x6e01('0x23')]]){_0xc424b8=_0x59fa6c[_0x400849[_0x6e01('0x23')]](_0x400849);logger[_0x6e01('0x12')](_0x6e01('0x47'),JSON[_0x6e01('0x38')](_0xc424b8,null,0x2));if(_0xc424b8&&_0xc424b8['code']===AGI_CODE_SUCCESS&&_0xc424b8['result']!==AGI_RESULT_ERROR&&!_0x26a94d[_0x6e01('0x20')]){logger[_0x6e01('0x36')](_0x6e01('0x47'),getLogFromObject(_0xc424b8));return _[_0x6e01('0x48')](_0xc424b8['result'])?null:_0xc424b8[_0x6e01('0x49')][_0x6e01('0x4a')]();}else{logger[_0x6e01('0xe')](_0x6e01('0x47'),getLogFromObject(_0xc424b8));return null;}}else{logger[_0x6e01('0xe')](_0x6e01('0x4b'));return null;}}catch(_0x24b270){logger[_0x6e01('0xe')](_0x24b270['stack']);return null;}});if(_0x4cc676[_0x6e01('0x4c')]){logger[_0x6e01('0x12')](util[_0x6e01('0x16')](_0x6e01('0x4d'),_0x26a94d[_0x6e01('0x1f')],_0x26a94d['calleridname'],_0x26a94d['callerid'],_0x26a94d[_0x6e01('0x1d')],_0x26a94d[_0x6e01('0x1b')]));_0x1ad851[_0x6e01('0x40')](_0x4cc676[_0x6e01('0x4c')]['id'],function(_0x39faf5){try{_0x39faf5=_0x59fa6c['clear'](_0x39faf5);logger[_0x6e01('0x36')](_0x6e01('0x42'),JSON['stringify'](_0x39faf5,null,0x2));if(_0x39faf5&&_0x59fa6c[_0x39faf5[_0x6e01('0x23')]]){_0xc424b8=_0x59fa6c[_0x39faf5['agicommand']](_0x39faf5);if(_0xc424b8){logger[_0x6e01('0x36')](_0x6e01('0x47'),getLogFromObject(_0xc424b8));return _[_0x6e01('0x48')](_0xc424b8[_0x6e01('0x49')])?null:_0xc424b8[_0x6e01('0x49')]['toString']();}else{logger[_0x6e01('0xe')](_0x6e01('0x47'),getLogFromObject(_0xc424b8));return null;}}else{logger['error'](_0x6e01('0x4b'));return null;}}catch(_0x2fa04b){logger[_0x6e01('0xe')](_0x2fa04b[_0x6e01('0xf')]);return null;}});}logger[_0x6e01('0x12')](util['format'](_0x6e01('0x4e'),_0x26a94d[_0x6e01('0x1f')],_0x26a94d['calleridname'],_0x26a94d[_0x6e01('0x1a')],_0x26a94d[_0x6e01('0x1d')],_0x26a94d[_0x6e01('0x1b')]));logger[_0x6e01('0x12')](util[_0x6e01('0x16')](_0x6e01('0x4f'),_0x26a94d[_0x6e01('0x44')],_0x26a94d[_0x6e01('0x45')],parseInt(_0x26a94d['priority'],0xa)+0x1));_0x26a94d['continueAt'](_0x26a94d[_0x6e01('0x44')],_0x26a94d[_0x6e01('0x45')],parseInt(_0x26a94d[_0x6e01('0x46')],0xa)+0x1);_0x26a94d[_0x6e01('0x3a')]();}}else{logger['error'](util[_0x6e01('0x16')](_0x6e01('0x50'),_0x26a94d['arg_1']));_0x26a94d['continueAt'](_0x26a94d[_0x6e01('0x44')],_0x26a94d[_0x6e01('0x45')],parseInt(_0x26a94d[_0x6e01('0x46')],0xa)+0x1);_0x26a94d[_0x6e01('0x3a')]();}}else{logger[_0x6e01('0xe')](util[_0x6e01('0x16')]('Project\x20%s\x20not\x20found',_0x26a94d[_0x6e01('0x1f')]));_0x26a94d[_0x6e01('0x51')](_0x26a94d[_0x6e01('0x44')],_0x26a94d[_0x6e01('0x45')],parseInt(_0x26a94d[_0x6e01('0x46')],0xa)+0x1);_0x26a94d[_0x6e01('0x3a')]();}}function main(){var _0x4bc781;return utilLicense['getLicense']()['then'](function(_0x34cfa9){if(_0x34cfa9){if(_0x34cfa9[_0x6e01('0x52')]){if(_0x34cfa9[_0x6e01('0x53')]&&_0x34cfa9['callysquare']>0x0){logger[_0x6e01('0x12')](util[_0x6e01('0x16')](_0x6e01('0x54'),_0x34cfa9[_0x6e01('0x53')]));_0x4bc781=_0x34cfa9[_0x6e01('0x53')];}else{logger[_0x6e01('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x6e01('0x12')](_0x6e01('0x55'));_0x4bc781=-0x1;}}})['catch'](function(_0x27b117){logger['error'](_0x6e01('0x56'),_0x27b117[_0x6e01('0xf')]);})[_0x6e01('0x4c')](function(){var _0x31e6e6=require(_0x6e01('0x57'))(config[_0x6e01('0x5')][_0x6e01('0x11')],config['agi']['ip'],_0x4bc781);_0x31e6e6['on'](_0x6e01('0xe'),errorHandler);_0x31e6e6['on'](_0x6e01('0x58'),listeningHandler);_0x31e6e6['on'](_0x6e01('0x59'),connectionHandler);_0x31e6e6['on'](_0x6e01('0x3a'),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 37e3244..3cd3d67 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 _0x56ad=['jayson/promise','client','http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0xff007f,_0xeeeed2){var _0x594632=function(_0x86d286){while(--_0x86d286){_0xff007f['push'](_0xff007f['shift']());}};_0x594632(++_0xeeeed2);}(_0x56ad,0x173));var _0xd56a=function(_0x81823e,_0x496b5d){_0x81823e=_0x81823e-0x0;var _0xe20ead=_0x56ad[_0x81823e];return _0xe20ead;};'use strict';var BPromise=require(_0xd56a('0x0'));var jayson=require(_0xd56a('0x1'));var client=jayson[_0xd56a('0x2')][_0xd56a('0x3')]({'port':0x232b});function request(_0x478ebf,_0x2823e9){return new BPromise(function(_0x1462cb,_0x2fa00b){return client[_0xd56a('0x4')](_0x478ebf,_0x2823e9)[_0xd56a('0x5')](function(_0x58e348){if(_0x58e348[_0xd56a('0x6')]){return _0x2fa00b(_0x58e348[_0xd56a('0x6')][_0xd56a('0x7')]);}else{return _0x1462cb(_0x58e348[_0xd56a('0x8')]);}})[_0xd56a('0x9')](function(_0x2392d3){return _0x2fa00b(_0x2392d3);});});}exports[_0xd56a('0xa')]=function(_0x36b8fa,_0x1333aa){return request(_0xd56a('0xb'),{'account':_0x36b8fa,'message':_0x1333aa});}; \ No newline at end of file +var _0xd248=['result','catch','sendMailMessage','bluebird','client','http','request','then','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd248,0x6f));var _0x8d24=function(_0x562be0,_0x4c6d1a){_0x562be0=_0x562be0-0x0;var _0x2a6405=_0xd248[_0x562be0];return _0x2a6405;};'use strict';var BPromise=require(_0x8d24('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x8d24('0x1')][_0x8d24('0x2')]({'port':0x232b});function request(_0x2927c8,_0x1b6d9d){return new BPromise(function(_0x5007b1,_0x7a3372){return client[_0x8d24('0x3')](_0x2927c8,_0x1b6d9d)[_0x8d24('0x4')](function(_0x999652){if(_0x999652[_0x8d24('0x5')]){return _0x7a3372(_0x999652[_0x8d24('0x5')]['message']);}else{return _0x5007b1(_0x999652[_0x8d24('0x6')]);}})[_0x8d24('0x7')](function(_0xaccf89){return _0x7a3372(_0xaccf89);});});}exports[_0x8d24('0x8')]=function(_0x37fb3e,_0x373f95){return request('SendMail',{'account':_0x37fb3e,'message':_0x373f95});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index fb022ed..1ec395f 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 _0x29e1=['stream','Transform','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','emit','headers','_inBody','line','util'];(function(_0x34253f,_0x5713fb){var _0x2a3de2=function(_0x208171){while(--_0x208171){_0x34253f['push'](_0x34253f['shift']());}};_0x2a3de2(++_0x5713fb);}(_0x29e1,0x142));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x129e('0x0'));var Transform=require(_0x129e('0x1'))[_0x129e('0x2')];function AGIReply(_0x10115e){Transform['call'](this,_0x10115e);this[_0x129e('0x3')]='';this['_inBody']=![];}util[_0x129e('0x4')](AGIReply,Transform);AGIReply[_0x129e('0x5')][_0x129e('0x6')]=function(_0x10b42e,_0x3ac55d,_0x393406){var _0x5a2040='\x0a',_0x3eb8f4=['\x0a\x0a',_0x129e('0x7')],_0x2469d4=-0x1,_0x106ddb=-0x1,_0x49c81b='',_0x37f5e2=0x0,_0x420675='',_0x23e531='';this[_0x129e('0x3')]+=_0x10b42e[_0x129e('0x8')]();_0x420675=this[_0x129e('0x3')];if(!this['_inBody']){_0x37f5e2=0x0;while(_0x3eb8f4[_0x37f5e2]){while((_0x106ddb=_0x420675['indexOf'](_0x3eb8f4[_0x37f5e2]))!=-0x1){_0x49c81b=_0x3eb8f4[_0x37f5e2];_0x23e531=_0x420675[_0x129e('0x9')](0x0,_0x106ddb);_0x420675=_0x420675['substring'](_0x106ddb+_0x49c81b[_0x129e('0xa')]);var _0x54d59c=_0x23e531[_0x129e('0xb')](_0x5a2040),_0x25cde8=0x0,_0x5a88c9={},_0x4a3ac5='',_0x4c9eb1='',_0x423266=-0x1;while(_0x54d59c[_0x25cde8]){_0x423266=_0x54d59c[_0x25cde8][_0x129e('0xc')](':');if(_0x423266!=-0x1){_0x4a3ac5=_0x54d59c[_0x25cde8][_0x129e('0xd')](0x0,_0x423266)['trim']();_0x4c9eb1=_0x54d59c[_0x25cde8][_0x129e('0xd')](_0x423266+0x1)[_0x129e('0xe')]();if(_0x4a3ac5[_0x129e('0xa')]>0x0){_0x5a88c9[_0x4a3ac5]=_0x4c9eb1;}}else{}_0x25cde8++;}this[_0x129e('0xf')](_0x129e('0x10'),_0x5a88c9);this[_0x129e('0x11')]=!![];}_0x37f5e2++;}this[_0x129e('0x3')]=_0x420675;}else{while((_0x2469d4=_0x420675['indexOf'](_0x5a2040))!=-0x1){_0x23e531=_0x420675[_0x129e('0x9')](0x0,_0x2469d4);this[_0x129e('0xf')](_0x129e('0x12'),_0x23e531);_0x420675=_0x420675[_0x129e('0x9')](_0x2469d4+_0x5a2040[_0x129e('0xa')]);}this[_0x129e('0x3')]=_0x420675;}_0x393406();};module['exports']=AGIReply; \ No newline at end of file +var _0x78c7=['split','slice','trim','headers','emit','line','exports','stream','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x78c7,0x1c1));var _0x778c=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x78c7[_0x47a349];return _0x18ab75;};'use strict';var util=require('util');var Transform=require(_0x778c('0x0'))[_0x778c('0x1')];function AGIReply(_0x6971d1){Transform[_0x778c('0x2')](this,_0x6971d1);this[_0x778c('0x3')]='';this[_0x778c('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x778c('0x5')]=function(_0x1c3337,_0x2325b2,_0x4f4f2e){var _0x2fdd0b='\x0a',_0x2ee28f=['\x0a\x0a',_0x778c('0x6')],_0x353343=-0x1,_0x3f8d1b=-0x1,_0x23508c='',_0x518546=0x0,_0x455e34='',_0x272a4e='';this[_0x778c('0x3')]+=_0x1c3337['toString']();_0x455e34=this['_localBuffer'];if(!this[_0x778c('0x4')]){_0x518546=0x0;while(_0x2ee28f[_0x518546]){while((_0x3f8d1b=_0x455e34[_0x778c('0x7')](_0x2ee28f[_0x518546]))!=-0x1){_0x23508c=_0x2ee28f[_0x518546];_0x272a4e=_0x455e34[_0x778c('0x8')](0x0,_0x3f8d1b);_0x455e34=_0x455e34[_0x778c('0x8')](_0x3f8d1b+_0x23508c[_0x778c('0x9')]);var _0x4451d3=_0x272a4e[_0x778c('0xa')](_0x2fdd0b),_0x3b2f8f=0x0,_0xdfe394={},_0x12749d='',_0x2f95b4='',_0x4e9554=-0x1;while(_0x4451d3[_0x3b2f8f]){_0x4e9554=_0x4451d3[_0x3b2f8f][_0x778c('0x7')](':');if(_0x4e9554!=-0x1){_0x12749d=_0x4451d3[_0x3b2f8f][_0x778c('0xb')](0x0,_0x4e9554)[_0x778c('0xc')]();_0x2f95b4=_0x4451d3[_0x3b2f8f][_0x778c('0xb')](_0x4e9554+0x1)[_0x778c('0xc')]();if(_0x12749d[_0x778c('0x9')]>0x0){_0xdfe394[_0x12749d]=_0x2f95b4;}}else{}_0x3b2f8f++;}this['emit'](_0x778c('0xd'),_0xdfe394);this[_0x778c('0x4')]=!![];}_0x518546++;}this[_0x778c('0x3')]=_0x455e34;}else{while((_0x353343=_0x455e34[_0x778c('0x7')](_0x2fdd0b))!=-0x1){_0x272a4e=_0x455e34[_0x778c('0x8')](0x0,_0x353343);this[_0x778c('0xe')](_0x778c('0xf'),_0x272a4e);_0x455e34=_0x455e34[_0x778c('0x8')](_0x353343+_0x2fdd0b[_0x778c('0x9')]);}this[_0x778c('0x3')]=_0x455e34;}_0x4f4f2e();};module[_0x778c('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a2d2302..ba64ef1 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 _0xdd76=['createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','agentLogout','LogoutUser','bluebird','jayson/promise','http','request','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','getSquareProjectById','getVoiceQueueById','getVariableById','getSquareOdbcById','dsn','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount'];(function(_0x123753,_0x57d282){var _0x101137=function(_0x13e5d7){while(--_0x13e5d7){_0x123753['push'](_0x123753['shift']());}};_0x101137(++_0x57d282);}(_0xdd76,0x11a));var _0x6dd7=function(_0x1fe19a,_0xb7554){_0x1fe19a=_0x1fe19a-0x0;var _0x592be6=_0xdd76[_0x1fe19a];return _0x592be6;};'use strict';var BPromise=require(_0x6dd7('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x6dd7('0x1'));var client=jayson['client'][_0x6dd7('0x2')]({'port':0x2329});function request(_0x4a5502,_0x2a1d1a){return new BPromise(function(_0x37ca2b,_0x4ceb65){return client[_0x6dd7('0x3')](_0x4a5502,_0x2a1d1a)['then'](function(_0x90a5b0){if(_0x90a5b0[_0x6dd7('0x4')]){return _0x4ceb65(_0x90a5b0[_0x6dd7('0x4')][_0x6dd7('0x5')]);}else{return _0x37ca2b(_0x90a5b0[_0x6dd7('0x6')]);}})[_0x6dd7('0x7')](function(_0x14a536){return _0x4ceb65(_0x14a536);});});}exports['getSquareProject']=function(_0x190100){return request(_0x6dd7('0x8'),{'options':{'raw':![],'where':{'name':_0x190100},'attributes':[_0x6dd7('0x9')]}});};exports[_0x6dd7('0xa')]=function(_0x4efe76){return request(_0x6dd7('0xb'),{'options':{'raw':![],'where':{'id':_0x4efe76},'include':[{'model':_0x6dd7('0xc'),'as':'Smtp'}],'attributes':['id',_0x6dd7('0xd'),'email']}});};exports[_0x6dd7('0xe')]=function(_0x1b501c){return request(_0x6dd7('0x8'),{'options':{'where':{'id':_0x1b501c},'attributes':['name']}});};exports[_0x6dd7('0xf')]=function(_0xe9a952){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xe9a952},'attributes':['name']}});};exports[_0x6dd7('0x10')]=function(_0x3b2d02){return request('ShowVariable',{'options':{'where':{'id':_0x3b2d02},'attributes':[_0x6dd7('0xd')]}});};exports[_0x6dd7('0x11')]=function(_0x2ff4ba){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2ff4ba},'attributes':[_0x6dd7('0x12')]}});};exports['getUserById']=function(_0x5e0960){return request(_0x6dd7('0x13'),{'options':{'where':{'id':_0x5e0960},'attributes':[_0x6dd7('0xd')]}});};exports[_0x6dd7('0x14')]=function(_0xb47fc3){return request(_0x6dd7('0x15'),{'options':{'where':{'id':_0xb47fc3},'attributes':[_0x6dd7('0xd')]}});};exports['getSoundById']=function(_0x44d279){return request(_0x6dd7('0x16'),{'options':{'where':{'id':_0x44d279},'attributes':[_0x6dd7('0x17')]}});};exports[_0x6dd7('0x18')]=function(_0x26a4df){return request(_0x6dd7('0x19'),{'options':{'raw':![],'where':{'id':_0x26a4df},'include':[{'model':_0x6dd7('0x1a'),'as':_0x6dd7('0x1b')}]}});};exports[_0x6dd7('0x1c')]=function(_0x28549b){return request(_0x6dd7('0x1d'),{'options':{'where':{'id':_0x28549b},'attributes':['id','name']}});};exports[_0x6dd7('0x1e')]=function(_0x25a30f){return request(_0x6dd7('0x1f'),{'body':_0x25a30f});};exports[_0x6dd7('0x20')]=function(_0x1f0b47){return request(_0x6dd7('0x21'),{'body':_0x1f0b47});};exports[_0x6dd7('0x22')]=function(_0x5d54e5){return request(_0x6dd7('0x23'),{'body':_[_0x6dd7('0x24')](_0x5d54e5,{'project_name':_0x5d54e5['arg_1'],'prev_project_name':_0x5d54e5[_0x6dd7('0x25')]||'','is_subproject':_0x5d54e5[_0x6dd7('0x25')]?!![]:![],'leaveAt':moment()['format'](_0x6dd7('0x26'))})});};exports['createSquareRecording']=function(_0x305391){return request(_0x6dd7('0x27'),{'body':_0x305391});};exports[_0x6dd7('0x28')]=function(_0x54f0cb){return request(_0x6dd7('0x29'),{'body':_0x54f0cb});};exports['createCmContact']=function(_0x465d4c){return request(_0x6dd7('0x2a'),{'options':{'raw':![],'where':{'phone':_0x465d4c[_0x6dd7('0x2b')],'ListId':_0x465d4c['ListId']}}})[_0x6dd7('0x2c')](function(_0x1635ac){if(_0x1635ac){return _0x1635ac;}return request(_0x6dd7('0x2d'),{'body':_0x465d4c});});};exports[_0x6dd7('0x2e')]=function(_0x351c9f){return request(_0x6dd7('0x2f'),{'options':{'where':{'id':_0x351c9f},'attributes':['name']}});};exports[_0x6dd7('0x30')]=function(_0x194e3b,_0x45caca){return request('LoginUser',{'body':{'interface':_0x45caca},'options':{'where':_0x194e3b}});};exports[_0x6dd7('0x31')]=function(_0x21a576,_0x4231cd,_0x50ace5){return request('PauseUser',{'body':{'type':_0x4231cd,'uniqueid':_0x50ace5},'options':{'where':_0x21a576}});};exports['agentUnpause']=function(_0x16bd5e){return request('UnpauseUser',{'body':{},'options':{'where':_0x16bd5e}});};exports[_0x6dd7('0x32')]=function(_0xf4cbad){return request(_0x6dd7('0x33'),{'body':{},'options':{'where':_0xf4cbad}});}; \ No newline at end of file +var _0xb606=['bluebird','moment','lodash','util','client','http','error','result','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x5c182f,_0x25e6c4){var _0x525a12=function(_0x415b2c){while(--_0x415b2c){_0x5c182f['push'](_0x5c182f['shift']());}};_0x525a12(++_0x25e6c4);}(_0xb606,0x13e));var _0x6b60=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xb606[_0x32f26d];return _0x5d9ddc;};'use strict';var BPromise=require(_0x6b60('0x0'));var moment=require(_0x6b60('0x1'));var _=require(_0x6b60('0x2'));var util=require(_0x6b60('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x6b60('0x4')][_0x6b60('0x5')]({'port':0x2329});function request(_0x29fa7b,_0x12a3db){return new BPromise(function(_0x3abe91,_0x23a985){return client['request'](_0x29fa7b,_0x12a3db)['then'](function(_0x3d18b1){if(_0x3d18b1[_0x6b60('0x6')]){return _0x23a985(_0x3d18b1['error']['message']);}else{return _0x3abe91(_0x3d18b1[_0x6b60('0x7')]);}})['catch'](function(_0x4ece8){return _0x23a985(_0x4ece8);});});}exports[_0x6b60('0x8')]=function(_0x3ffdff){return request(_0x6b60('0x9'),{'options':{'raw':![],'where':{'name':_0x3ffdff},'attributes':[_0x6b60('0xa')]}});};exports[_0x6b60('0xb')]=function(_0x30f868){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x30f868},'include':[{'model':'MailServerOut','as':_0x6b60('0xc')}],'attributes':['id',_0x6b60('0xd'),'email']}});};exports[_0x6b60('0xe')]=function(_0x4b6339){return request('ShowSquareProject',{'options':{'where':{'id':_0x4b6339},'attributes':['name']}});};exports[_0x6b60('0xf')]=function(_0x4fbd62){return request(_0x6b60('0x10'),{'options':{'where':{'id':_0x4fbd62},'attributes':[_0x6b60('0xd')]}});};exports[_0x6b60('0x11')]=function(_0x28880e){return request(_0x6b60('0x12'),{'options':{'where':{'id':_0x28880e},'attributes':[_0x6b60('0xd')]}});};exports[_0x6b60('0x13')]=function(_0x5cf6e2){return request(_0x6b60('0x14'),{'options':{'where':{'id':_0x5cf6e2},'attributes':[_0x6b60('0x15')]}});};exports['getUserById']=function(_0x210bab){return request(_0x6b60('0x16'),{'options':{'where':{'id':_0x210bab},'attributes':[_0x6b60('0xd')]}});};exports['getTrunkById']=function(_0x5b6b6e){return request(_0x6b60('0x17'),{'options':{'where':{'id':_0x5b6b6e},'attributes':['name']}});};exports[_0x6b60('0x18')]=function(_0x2cac8b){return request(_0x6b60('0x19'),{'options':{'where':{'id':_0x2cac8b},'attributes':[_0x6b60('0x1a')]}});};exports[_0x6b60('0x1b')]=function(_0x19f331){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x19f331},'include':[{'model':_0x6b60('0x1c'),'as':_0x6b60('0x1d')}]}});};exports['getSmsAccountById']=function(_0x4dc6f4){return request(_0x6b60('0x1e'),{'options':{'where':{'id':_0x4dc6f4},'attributes':['id',_0x6b60('0xd')]}});};exports[_0x6b60('0x1f')]=function(_0x4edf8a){return request(_0x6b60('0x20'),{'body':_0x4edf8a});};exports[_0x6b60('0x21')]=function(_0x21f325){return request('CreateSquareDetailsReport',{'body':_0x21f325});};exports[_0x6b60('0x22')]=function(_0x11ad68){return request(_0x6b60('0x23'),{'body':_[_0x6b60('0x24')](_0x11ad68,{'project_name':_0x11ad68['arg_1'],'prev_project_name':_0x11ad68['arg_2']||'','is_subproject':_0x11ad68[_0x6b60('0x25')]?!![]:![],'leaveAt':moment()[_0x6b60('0x26')](_0x6b60('0x27'))})});};exports[_0x6b60('0x28')]=function(_0x4e7907){return request('CreateSquareRecording',{'body':_0x4e7907});};exports['createSquareMessage']=function(_0x290532){return request('CreateSquareMessage',{'body':_0x290532});};exports['createCmContact']=function(_0x1a7726){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x1a7726[_0x6b60('0x29')],'ListId':_0x1a7726[_0x6b60('0x2a')]}}})[_0x6b60('0x2b')](function(_0x5d854e){if(_0x5d854e){return _0x5d854e;}return request(_0x6b60('0x2c'),{'body':_0x1a7726});});};exports[_0x6b60('0x2d')]=function(_0x5d0670){return request(_0x6b60('0x2e'),{'options':{'where':{'id':_0x5d0670},'attributes':['name']}});};exports[_0x6b60('0x2f')]=function(_0x21b47a,_0x4788d0){return request(_0x6b60('0x30'),{'body':{'interface':_0x4788d0},'options':{'where':_0x21b47a}});};exports[_0x6b60('0x31')]=function(_0x4df89f,_0x365257,_0x2079ff){return request('PauseUser',{'body':{'type':_0x365257,'uniqueid':_0x2079ff},'options':{'where':_0x4df89f}});};exports['agentUnpause']=function(_0x7da77d){return request(_0x6b60('0x32'),{'body':{},'options':{'where':_0x7da77d}});};exports[_0x6b60('0x33')]=function(_0xf511e0){return request(_0x6b60('0x34'),{'body':{},'options':{'where':_0xf511e0}});}; \ 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 ec143a3..26e97a0 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 _0xa6bb=['./lex','exports'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0xa6bb,0x12c));var _0xba6b=function(_0x4c584d,_0x20e25d){_0x4c584d=_0x4c584d-0x0;var _0x16bc52=_0xa6bb[_0x4c584d];return _0x16bc52;};var polly=require('./polly');var lex=require(_0xba6b('0x0'));module[_0xba6b('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9b2c=['exports','./lex'];(function(_0x4057f9,_0x17c5b5){var _0x5552b7=function(_0xeb792f){while(--_0xeb792f){_0x4057f9['push'](_0x4057f9['shift']());}};_0x5552b7(++_0x17c5b5);}(_0x9b2c,0x189));var _0xc9b2=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x9b2c[_0x4c9f6a];return _0x5df5b9;};var polly=require('./polly');var lex=require(_0xc9b2('0x0'));module[_0xc9b2('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index ec07728..206ddb7 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 _0xda3f=['exports'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xda3f,0xec));var _0xfda3=function(_0x1680eb,_0x24a6a5){_0x1680eb=_0x1680eb-0x0;var _0x16ee82=_0xda3f[_0x1680eb];return _0x16ee82;};'use strict';var lex=require('./lib/api');module[_0xfda3('0x0')]=function(_0xf4e78,_0x534697,_0x5299b0,_0x5d7071,_0x3859fe,_0x581693){return lex(_0xf4e78,_0x534697,_0x5299b0,_0x5d7071,_0x3859fe,_0x581693);}; \ No newline at end of file +var _0x9348=['exports','./lib/api'];(function(_0x4a57e5,_0x341527){var _0x23cec4=function(_0x496ba3){while(--_0x496ba3){_0x4a57e5['push'](_0x4a57e5['shift']());}};_0x23cec4(++_0x341527);}(_0x9348,0x10d));var _0x8934=function(_0x2c9ec3,_0x4f0b97){_0x2c9ec3=_0x2c9ec3-0x0;var _0x494999=_0x9348[_0x2c9ec3];return _0x494999;};'use strict';var lex=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b){return lex(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b);}; \ 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 3f0de90..c7024ae 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(_0x4529b6,_0x20b9a4){var _0x3422f9=function(_0x1f21b7){while(--_0x1f21b7){_0x4529b6['push'](_0x4529b6['shift']());}};_0x3422f9(++_0x20b9a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0xef78a4,_0x2a85d7){var _0x5df13a=function(_0x1bc1c2){while(--_0x1bc1c2){_0xef78a4['push'](_0xef78a4['shift']());}};_0x5df13a(++_0x2a85d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 3e097b5..07c90a6 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 _0xfcdc=['exports'];(function(_0x5bf7a9,_0x25d3ef){var _0x440cc4=function(_0x9038ee){while(--_0x9038ee){_0x5bf7a9['push'](_0x5bf7a9['shift']());}};_0x440cc4(++_0x25d3ef);}(_0xfcdc,0x1df));var _0xcfcd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcdc[_0x20a584];return _0x4b41a8;};'use strict';var polly=require('./lib/api');module[_0xcfcd('0x0')]=function(_0x1ccc5c,_0x5ad12b,_0x421e90,_0x1dcc38,_0x39a018,_0x488502,_0x11d841){return polly(_0x1ccc5c,_0x5ad12b,_0x421e90,_0x1dcc38,_0x39a018,_0x488502,_0x11d841);}; \ No newline at end of file +var _0x2e19=['exports','./lib/api'];(function(_0x13a5a8,_0x186495){var _0x397582=function(_0x33dc56){while(--_0x33dc56){_0x13a5a8['push'](_0x13a5a8['shift']());}};_0x397582(++_0x186495);}(_0x2e19,0x8b));var _0x92e1=function(_0x3906a5,_0x5b54fa){_0x3906a5=_0x3906a5-0x0;var _0x2ff831=_0x2e19[_0x3906a5];return _0x2ff831;};'use strict';var polly=require(_0x92e1('0x0'));module[_0x92e1('0x1')]=function(_0x5b5201,_0x40ec0f,_0x4345eb,_0xf74fee,_0x134801,_0x386f98,_0x314d7a){return polly(_0x5b5201,_0x40ec0f,_0x4345eb,_0xf74fee,_0x134801,_0x386f98,_0x314d7a);}; \ 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 65ecbcd..95c1df3 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 _0x75a7=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','synthesizeSpeech'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x75a7,0x16a));var _0x775a=function(_0x412c57,_0x5db5c6){_0x412c57=_0x412c57-0x0;var _0x206345=_0x75a7[_0x412c57];return _0x206345;};'use strict';var fs=require('fs');var path=require(_0x775a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x2c8063,_0x39f43c,_0x311202){return new BPromise(function(_0x335c83,_0x17b898){_0x2c8063[_0x775a('0x1')](_0x39f43c,function(_0x33d5aa,_0x2fb783){if(_0x33d5aa){_0x17b898(_0x33d5aa);}else if(_0x2fb783){if(_0x2fb783[_0x775a('0x2')]instanceof Buffer){fs['writeFile'](_0x311202,_0x2fb783[_0x775a('0x2')],function(_0x484b91){if(_0x484b91){_0x17b898(_0x484b91);}else{_0x335c83();}});}else{_0x17b898(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x17b898(new Error(_0x775a('0x3')));}});});}module['exports']=function(_0x34a151,_0x462663,_0x4999aa,_0x2b19e0,_0x10b5f7,_0x125a39,_0x4a1fb5){var _0xcac3d4=new AWS[(_0x775a('0x4'))]({'accessKeyId':_0x34a151,'secretAccessKey':_0x462663,'region':_0x4999aa});var _0x937094={'Text':_0x10b5f7,'TextType':_0x125a39||_0x775a('0x5'),'OutputFormat':_0x775a('0x6'),'VoiceId':_0x2b19e0};return pollyResult(_0xcac3d4,_0x937094,_0x4a1fb5);}; \ No newline at end of file +var _0x4102=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird'];(function(_0x443cb4,_0x4075cc){var _0xd71266=function(_0x56cc54){while(--_0x56cc54){_0x443cb4['push'](_0x443cb4['shift']());}};_0xd71266(++_0x4075cc);}(_0x4102,0x104));var _0x2410=function(_0x315711,_0x1b5513){_0x315711=_0x315711-0x0;var _0x11ac90=_0x4102[_0x315711];return _0x11ac90;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x2410('0x0'));var rs=require('randomstring');var AWS=require(_0x2410('0x1'));function pollyResult(_0x46dd52,_0x2b46e2,_0x5ea33c){return new BPromise(function(_0x2824d5,_0x278ab3){_0x46dd52['synthesizeSpeech'](_0x2b46e2,function(_0x183c9b,_0x3b513b){if(_0x183c9b){_0x278ab3(_0x183c9b);}else if(_0x3b513b){if(_0x3b513b[_0x2410('0x2')]instanceof Buffer){fs[_0x2410('0x3')](_0x5ea33c,_0x3b513b[_0x2410('0x2')],function(_0x1f3669){if(_0x1f3669){_0x278ab3(_0x1f3669);}else{_0x2824d5();}});}else{_0x278ab3(new Error(_0x2410('0x4')));}}else{_0x278ab3(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x2410('0x5')]=function(_0x1c2351,_0x4fabdd,_0x39748c,_0x515429,_0x31ea4c,_0x1de39f,_0xa3498b){var _0x2cf13c=new AWS[(_0x2410('0x6'))]({'accessKeyId':_0x1c2351,'secretAccessKey':_0x4fabdd,'region':_0x39748c});var _0x210799={'Text':_0x31ea4c,'TextType':_0x1de39f||_0x2410('0x7'),'OutputFormat':_0x2410('0x8'),'VoiceId':_0x515429};return pollyResult(_0x2cf13c,_0x210799,_0xa3498b);}; \ 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 f06ff24..45b95ff 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 _0xb153=['./lib/api','exports'];(function(_0x27e9b3,_0x1b17af){var _0x553cac=function(_0x5c368e){while(--_0x5c368e){_0x27e9b3['push'](_0x27e9b3['shift']());}};_0x553cac(++_0x1b17af);}(_0xb153,0x1d4));var _0x3b15=function(_0x98a9b0,_0x1098fe){_0x98a9b0=_0x98a9b0-0x0;var _0xb6f377=_0xb153[_0x98a9b0];return _0xb6f377;};'use strict';var asr=require(_0x3b15('0x0'));module[_0x3b15('0x1')]=function(_0x261af3,_0x50459a,_0x2adcd5,_0x1b2593){return asr(_0x261af3,_0x50459a,_0x2adcd5);}; \ No newline at end of file +var _0x3283=['exports'];(function(_0x1a9126,_0xa43be2){var _0x3b4253=function(_0x49ff4a){while(--_0x49ff4a){_0x1a9126['push'](_0x1a9126['shift']());}};_0x3b4253(++_0xa43be2);}(_0x3283,0x160));var _0x3328=function(_0xeb76a1,_0x3a0e97){_0xeb76a1=_0xeb76a1-0x0;var _0x471179=_0x3283[_0xeb76a1];return _0x471179;};'use strict';var asr=require('./lib/api');module[_0x3328('0x0')]=function(_0x16201d,_0x447c3d,_0x19be46,_0x26643b){return asr(_0x16201d,_0x447c3d,_0x19be46);}; \ 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 7d70e6d..7d33979 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 _0x94dc=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x490a1e,_0x4b44f4){var _0x26b8bc=function(_0x2044a6){while(--_0x2044a6){_0x490a1e['push'](_0x490a1e['shift']());}};_0x26b8bc(++_0x4b44f4);}(_0x94dc,0xb1));var _0xc94d=function(_0x101dac,_0x263121){_0x101dac=_0x101dac-0x0;var _0x5a65fb=_0x94dc[_0x101dac];return _0x5a65fb;};'use strict';var url=require(_0xc94d('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc94d('0x1');module['exports']=function(_0x1645b0,_0x1b2070,_0x40e7d8){return new BPromise(function(_0x4b2dcc,_0x306706){var _0x41d4ec;if(typeof _0x1645b0!==_0xc94d('0x2')||_0x1645b0[_0xc94d('0x3')]===0x0){return _0x306706(_0xc94d('0x4'));}if(typeof _0x1b2070!==_0xc94d('0x2')||_0x1b2070[_0xc94d('0x3')]===0x0){return _0x306706('key\x20should\x20be\x20a\x20string');}if(typeof _0x40e7d8!==_0xc94d('0x5')&&(typeof _0x40e7d8!==_0xc94d('0x2')||_0x40e7d8[_0xc94d('0x3')]===0x0)){return _0x306706(_0xc94d('0x6'));}try{_0x41d4ec=fs[_0xc94d('0x7')](_0x1645b0)['toString'](_0xc94d('0x8'));}catch(_0x13096c){return _0x306706(_0x13096c);}return _0x4b2dcc({'method':_0xc94d('0x9'),'uri':host+_0xc94d('0xa')+_0x1b2070,'body':{'config':{'encoding':_0xc94d('0xb'),'sampleRateHertz':_0xc94d('0xc'),'languageCode':_0x40e7d8},'audio':{'content':_0x41d4ec}},'json':!![]});});}; \ No newline at end of file +var _0x4ea3=['url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','LINEAR16','8000'];(function(_0x38e131,_0x2a0e94){var _0x54df9c=function(_0x24e9f7){while(--_0x24e9f7){_0x38e131['push'](_0x38e131['shift']());}};_0x54df9c(++_0x2a0e94);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var url=require(_0x34ea('0x0'));var BPromise=require(_0x34ea('0x1'));var fs=require('fs');var host=_0x34ea('0x2');module[_0x34ea('0x3')]=function(_0x588172,_0x374ec1,_0x494b56){return new BPromise(function(_0x269d4c,_0x571f1b){var _0x5e5a84;if(typeof _0x588172!==_0x34ea('0x4')||_0x588172[_0x34ea('0x5')]===0x0){return _0x571f1b(_0x34ea('0x6'));}if(typeof _0x374ec1!==_0x34ea('0x4')||_0x374ec1[_0x34ea('0x5')]===0x0){return _0x571f1b(_0x34ea('0x7'));}if(typeof _0x494b56!==_0x34ea('0x8')&&(typeof _0x494b56!=='string'||_0x494b56[_0x34ea('0x5')]===0x0)){return _0x571f1b(_0x34ea('0x9'));}try{_0x5e5a84=fs[_0x34ea('0xa')](_0x588172)['toString'](_0x34ea('0xb'));}catch(_0xea1be2){return _0x571f1b(_0xea1be2);}return _0x269d4c({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x374ec1,'body':{'config':{'encoding':_0x34ea('0xc'),'sampleRateHertz':_0x34ea('0xd'),'languageCode':_0x494b56},'audio':{'content':_0x5e5a84}},'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 355926f..f96390f 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 _0x9a5d=['exports','./asr'];(function(_0xff9b9d,_0x55eb38){var _0x267e23=function(_0x3831a1){while(--_0x3831a1){_0xff9b9d['push'](_0xff9b9d['shift']());}};_0x267e23(++_0x55eb38);}(_0x9a5d,0x1a7));var _0xd9a5=function(_0x3b9cd1,_0x55a28b){_0x3b9cd1=_0x3b9cd1-0x0;var _0x1eb495=_0x9a5d[_0x3b9cd1];return _0x1eb495;};var asr=require(_0xd9a5('0x0'));module[_0xd9a5('0x1')]={'asr':asr}; \ No newline at end of file +var _0xc28b=['./asr'];(function(_0x59cc1f,_0x42c496){var _0x4a2242=function(_0x5be697){while(--_0x5be697){_0x59cc1f['push'](_0x59cc1f['shift']());}};_0x4a2242(++_0x42c496);}(_0xc28b,0x1ef));var _0xbc28=function(_0x866ecf,_0x484490){_0x866ecf=_0x866ecf-0x0;var _0x359a7b=_0xc28b[_0x866ecf];return _0x359a7b;};var asr=require(_0xbc28('0x0'));module['exports']={'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 eb47d82..673e035 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 _0x2c67=['alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','source','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','queryText','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','path','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','POST','.mp3','from','tmp','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','.wav','goggleTTS\x20path','asr','uri','results','map'];(function(_0x3c35f1,_0x21c67a){var _0x3f7cb1=function(_0x12b1df){while(--_0x12b1df){_0x3c35f1['push'](_0x3c35f1['shift']());}};_0x3f7cb1(++_0x21c67a);}(_0x2c67,0xc1));var _0x72c6=function(_0x49d749,_0x51605f){_0x49d749=_0x49d749-0x0;var _0x392f59=_0x2c67[_0x49d749];return _0x392f59;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x72c6('0x0'));var dialogflow=require(_0x72c6('0x1'));var fs=require('fs');var http=require(_0x72c6('0x2'));var https=require(_0x72c6('0x3'));var md5=require(_0x72c6('0x4'));var path=require('path');var querystring=require(_0x72c6('0x5'));var rp=require(_0x72c6('0x6'));var rs=require(_0x72c6('0x7'));var sox=require(_0x72c6('0x8'));var tts=require(_0x72c6('0x9'));var urlParse=require(_0x72c6('0xa'))['parse'];var util=require(_0x72c6('0xb'));var aws=require('./aws');var google=require(_0x72c6('0xc'));var sestek=require('./sestek');var tilde=require(_0x72c6('0xd'));var logger=require(_0x72c6('0xe'))(_0x72c6('0xf'));var ISPEECH_API=_0x72c6('0x10');function downloadFile(_0x1ba37a,_0x30db88){return new BPromise(function(_0x17a96f,_0x568c9e){var _0x108c61=urlParse(_0x1ba37a);var _0x16ea95=_0x108c61[_0x72c6('0x11')]===_0x72c6('0x12')?https:http;var _0x3a27da={'host':_0x108c61['host'],'path':_0x108c61['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x16ea95['get'](_0x3a27da,function(_0x4dc3ef){if(_0x4dc3ef[_0x72c6('0x13')]!==0xc8){logger[_0x72c6('0x14')](_0x72c6('0x15')+_0x1ba37a+_0x72c6('0x16')+_0x4dc3ef['statusCode']+'\x20('+_0x4dc3ef[_0x72c6('0x17')]+')');_0x568c9e(new Error('request\x20to\x20'+_0x1ba37a+_0x72c6('0x16')+_0x4dc3ef['statusCode']+'\x20('+_0x4dc3ef[_0x72c6('0x17')]+')'));return;}var _0x184b30=fs[_0x72c6('0x18')](_0x30db88);_0x184b30['on'](_0x72c6('0x19'),function(){logger[_0x72c6('0x1a')](_0x72c6('0x1b'));_0x184b30[_0x72c6('0x1c')](_0x17a96f);});_0x184b30['on'](_0x72c6('0x14'),function(_0x2f184a){fs[_0x72c6('0x1d')](_0x30db88);logger[_0x72c6('0x14')]('download\x20error',_0x2f184a);_0x568c9e(_0x2f184a);});_0x4dc3ef[_0x72c6('0x1e')](_0x184b30);})['on']('error',function(_0xab74e2){logger['error'](_0xab74e2);_0x568c9e(_0xab74e2);})[_0x72c6('0x1f')]();});}function uploadFile(_0x4a9cd9){return new BPromise(function(_0x4a0f15,_0x49f1fb){var _0x32feb6=urlParse(_0x4a9cd9);var _0x5655e3=_0x32feb6[_0x72c6('0x11')]===_0x72c6('0x12')?https:http;var _0x415f4d={'host':_0x32feb6['host'],'path':_0x32feb6[_0x72c6('0x20')],'headers':{'user-agent':_0x72c6('0x21')}};_0x5655e3['get'](_0x415f4d,function(_0x2697e5){if(_0x2697e5[_0x72c6('0x13')]!==0xc8){_0x49f1fb(new Error('request\x20to\x20'+_0x4a9cd9+_0x72c6('0x16')+_0x2697e5['statusCode']+'\x20('+_0x2697e5['statusMessage']+')'));return;}var _0x137e83='';_0x2697e5['on'](_0x72c6('0x22'),function(_0x1d5543){_0x137e83+=_0x1d5543;});_0x2697e5['on'](_0x72c6('0x1f'),function(){_0x4a0f15(_0x137e83);});})['on'](_0x72c6('0x14'),function(_0x4fc302){_0x49f1fb(_0x4fc302);})[_0x72c6('0x1f')]();});}function convertFile(_0x5e174d,_0xedcdb4){return new BPromise(function(_0x395a0d,_0x4ec94c){var _0x4aac54=sox['transcode'](_0x5e174d,_0xedcdb4,{'sampleRate':0x1f40,'format':_0x72c6('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4aac54['on'](_0x72c6('0x14'),function(_0x420e0e){logger['error'](_0x72c6('0x24'),_0x420e0e);_0x4ec94c(_0x420e0e);});_0x4aac54['on']('end',function(){logger['info'](_0x72c6('0x25'));_0x395a0d();});_0x4aac54[_0x72c6('0x26')]();});}function base64Decode(_0x427483,_0xc84e45){var _0x46aa08=path[_0x72c6('0x27')](__dirname,'tmp',rs[_0x72c6('0x28')](0x4)+'.wav');fs[_0x72c6('0x29')](_0x46aa08,_0x427483,_0x72c6('0x2a'));return convertFile(_0x46aa08,_0xc84e45)[_0x72c6('0x2b')](function(){try{fs['unlink'](_0x46aa08);fs[_0x72c6('0x2c')](_0xc84e45,_0x72c6('0x2d'));}catch(_0x16bfb1){logger[_0x72c6('0x14')](_0x16bfb1);}return _0xc84e45[_0x72c6('0x2e')]('.')[0x0];});}function base64Encode(_0x5cf0b6){var _0xed1be5=fs[_0x72c6('0x2f')](_0x5cf0b6);return new Buffer(_0xed1be5)[_0x72c6('0x30')](_0x72c6('0x2a'));}exports[_0x72c6('0x31')]=function(_0x5dbf97,_0x4ba272,_0x549abe,_0x1e7ba6,_0x680283,_0xbe5402){var _0x5e5bd2,_0x20b1ab;var _0x56086b=_0x72c6('0x32');var _0x991c1=_0x72c6('0x33')+_0x5dbf97;var _0x44a532={};if(_0x4ba272===_0x72c6('0x34')){_0x44a532[_0x72c6('0x35')]={'ssml':_0x549abe};}else{_0x44a532[_0x72c6('0x35')]={'text':_0x549abe};};_0x44a532['voice']={'languageCode':_0x1e7ba6,'ssmlGender':_0x680283};_0x44a532[_0x72c6('0x36')]={'audioEncoding':_0x72c6('0x37'),'sampleRateHertz':0x1f40};var _0x5d430c={'url':_0x56086b+'text:synthesize'+_0x991c1,'method':_0x72c6('0x38'),'json':!![],'body':_0x44a532};return rp(_0x5d430c)[_0x72c6('0x2b')](function(_0x472ee9){return new BPromise(function(_0x4a071e,_0x3b24d3){_0x5e5bd2=path['resolve'](__dirname,'tmp',rs[_0x72c6('0x28')](0x4)+_0x72c6('0x39'));var _0x546b59=Buffer[_0x72c6('0x3a')](_0x472ee9['audioContent'],_0x72c6('0x2a'));return fs['writeFile'](_0x5e5bd2,_0x546b59,function(_0x313fd4){_0x3b24d3(_0x313fd4);},function(_0x285c76){fs[_0x72c6('0x2c')](_0x5e5bd2,'777');_0x4a071e(_0x285c76);});});})[_0x72c6('0x2b')](function(_0x16e908){_0x20b1ab=path[_0x72c6('0x27')](__dirname,_0x72c6('0x3b'),rs[_0x72c6('0x28')](0x4)+'.wav');return convertFile(_0x5e5bd2,_0x20b1ab);})[_0x72c6('0x2b')](function(){try{fs[_0x72c6('0x1d')](_0x5e5bd2);fs['chmodSync'](_0x20b1ab,_0x72c6('0x2d'));}catch(_0xa1fc28){logger['error'](_0xa1fc28);}logger[_0x72c6('0x1a')](_0x72c6('0x3c'),_0x20b1ab['split']('.')[0x0]);return _0x20b1ab[_0x72c6('0x2e')]('.')[0x0];});};exports[_0x72c6('0x3d')]=function(_0x11cfd1,_0x106c04){var _0x3a3e81=_0x72c6('0x3e');var _0x2343b0,_0x2586d5;var _0x33d9ca;var _0x29fb61={'encoding':'utf8','method':_0x72c6('0x38'),'timeout':0x2710,'url':_0x3a3e81,'headers':{'Content-Type':_0x72c6('0x3f')},'body':_0x72c6('0x40')+encodeURIComponent(JSON[_0x72c6('0x41')]([[[_0x72c6('0x42'),JSON[_0x72c6('0x41')]([_0x11cfd1,_0x106c04||'en',![],_0x72c6('0x43')]),null,_0x72c6('0x44')]]]))};return rp(_0x29fb61)[_0x72c6('0x2b')](function(_0x2a9867){try{_0x33d9ca=eval(_0x2a9867[_0x72c6('0x45')](0x5))[0x0][0x2];}catch(_0x17cb07){throw new Error('parse\x20response\x20failed:\x0a'+_0x2a9867['data']);}if(!_0x33d9ca){if(_0x11cfd1[_0x72c6('0x46')]>0xc8){throw new Error(_0x72c6('0x47'));}else{throw new Error(_0x72c6('0x48')+_0x106c04+_0x72c6('0x49'));}}try{_0x33d9ca=eval(_0x33d9ca)[0x0];}catch(_0x135fae){throw new Error(_0x72c6('0x4a')+res['data']);}const _0x482622=_0x33d9ca;_0x2343b0=path[_0x72c6('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x72c6('0x39'));fs[_0x72c6('0x29')](_0x2343b0,_0x33d9ca,{'encoding':_0x72c6('0x2a')});_0x2586d5=path[_0x72c6('0x27')](__dirname,_0x72c6('0x3b'),rs['generate'](0x4)+_0x72c6('0x4b'));return convertFile(_0x2343b0,_0x2586d5);})[_0x72c6('0x2b')](function(){try{fs['unlink'](_0x2343b0);fs[_0x72c6('0x2c')](_0x2586d5,_0x72c6('0x2d'));}catch(_0x58b6a3){logger[_0x72c6('0x14')](_0x58b6a3);}logger['info'](_0x72c6('0x4c'),_0x2586d5[_0x72c6('0x2e')]('.')[0x0]);return _0x2586d5[_0x72c6('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x2b24d8,_0x3fc380,_0x39d7c5){return google[_0x72c6('0x4d')](_0x2b24d8,_0x3fc380,_0x39d7c5)[_0x72c6('0x2b')](function(_0x36f926){logger[_0x72c6('0x1a')](_0x36f926[_0x72c6('0x4e')]);return rp(_0x36f926);})['then'](function(_0xcb7539){var _0x163825='';var _0x53141f=0x0;try{fs[_0x72c6('0x1d')](_0x2b24d8);}catch(_0x275e55){logger[_0x72c6('0x14')](_0x275e55);}if(_0xcb7539&&_0xcb7539[_0x72c6('0x4f')]){_0x163825=_0xcb7539[_0x72c6('0x4f')][_0x72c6('0x50')](function(_0x3856f1){return _0x3856f1&&_0x3856f1[_0x72c6('0x51')][0x0]&&_0x3856f1[_0x72c6('0x51')][0x0]['transcript']?_0x3856f1['alternatives'][0x0][_0x72c6('0x52')]:'';})[_0x72c6('0x53')]('\x0a');_0x53141f=_0xcb7539['results']['map'](function(_0x565715){return _0x565715&&_0x565715[_0x72c6('0x51')][0x0]&&_0x565715['alternatives'][0x0][_0x72c6('0x54')]?_0x565715['alternatives'][0x0][_0x72c6('0x54')]:0x0;})[_0x72c6('0x53')]('\x0a');}logger[_0x72c6('0x1a')](_0x72c6('0x55'),_0x163825);logger['info'](_0x72c6('0x56'),_0x53141f);return{'transcript':_0x163825,'confidence':_0x53141f};})[_0x72c6('0x57')](function(_0x45e4b7){logger['error'](_0x72c6('0x58'),_0x45e4b7['statusCode'],_0x45e4b7[_0x72c6('0x59')],_0x45e4b7['message']);});};exports['googleDialogflow']=function(_0x137fd1,_0x850b31,_0x34e923,_0x356eac){var _0x316ad4=apiai(_0x850b31,{'language':_0x356eac||'en'});return _0x316ad4[_0x72c6('0x5a')](_0x34e923,{'sessionId':md5(_0x137fd1)})[_0x72c6('0x2b')](function(_0x57a3c6){logger[_0x72c6('0x1a')](JSON['stringify'](_0x57a3c6));return{'source':_0x57a3c6[_0x72c6('0x5b')][_0x72c6('0x5c')],'resolvedQuery':_0x57a3c6[_0x72c6('0x5b')]['resolvedQuery'],'action':_0x57a3c6[_0x72c6('0x5b')][_0x72c6('0x5d')],'actionIncomplete':_0x57a3c6[_0x72c6('0x5b')][_0x72c6('0x5e')],'speech':_0x57a3c6[_0x72c6('0x5b')]['fulfillment'][_0x72c6('0x5f')],'score':_0x57a3c6['result'][_0x72c6('0x60')],'statusCode':_0x57a3c6[_0x72c6('0x61')][_0x72c6('0x62')],'endConversation':_0x57a3c6[_0x72c6('0x5b')][_0x72c6('0x63')][_0x72c6('0x64')]||![],'isFallbackIntent':_0x57a3c6[_0x72c6('0x5b')][_0x72c6('0x63')][_0x72c6('0x65')]};});};exports['googleDialogflowV2']=function(_0x599a77,_0xf6d0cf,_0x4e333a,_0x43f5a7,_0x2c107f,_0x20d708){var _0x248f0f=_0x43f5a7[_0x72c6('0x66')](/\\n/g,'\x0a');var _0x4e1b3c={'credentials':{'private_key':_0x248f0f,'client_email':_0x4e333a}};var _0x2e7f41=new dialogflow[(_0x72c6('0x67'))](_0x4e1b3c);var _0x93af78=_0x2e7f41[_0x72c6('0x68')](_0xf6d0cf,md5(_0x599a77));var _0x2a5b7b={'session':_0x93af78,'queryInput':{'text':{'text':_0x2c107f,'languageCode':_0x20d708}}};return _0x2e7f41[_0x72c6('0x69')](_0x2a5b7b)[_0x72c6('0x2b')](function(_0x3a085d){if(_0x3a085d&&_0x3a085d['length']){logger[_0x72c6('0x1a')](_0x72c6('0x6a'),JSON['stringify'](_0x3a085d));var _0x164022=_0x3a085d[0x0];if(_0x164022){var _0x3f950a={'action':_0x164022['queryResult'][_0x72c6('0x5d')],'allRequiredParamsPresent':_0x164022[_0x72c6('0x6b')][_0x72c6('0x6c')],'endConversation':_0x164022[_0x72c6('0x6b')]['diagnosticInfo']&&_0x164022[_0x72c6('0x6b')][_0x72c6('0x6d')][_0x72c6('0x6e')]?_0x164022[_0x72c6('0x6b')][_0x72c6('0x6d')][_0x72c6('0x6e')][_0x72c6('0x6f')][_0x72c6('0x70')]:![],'fulfillmentText':_0x164022[_0x72c6('0x6b')]['fulfillmentText'],'intentName':_0x164022[_0x72c6('0x6b')][_0x72c6('0x71')]['name'],'intentDisplayName':_0x164022['queryResult'][_0x72c6('0x71')][_0x72c6('0x72')],'isFallbackIntent':_0x164022['queryResult'][_0x72c6('0x71')]['isFallback'],'languageCode':_0x164022['queryResult']['languageCode'],'queryText':_0x164022['queryResult'][_0x72c6('0x73')],'responseId':_0x164022['responseId'],'score':_0x164022[_0x72c6('0x6b')]['intentDetectionConfidence'],'speech':_0x164022[_0x72c6('0x6b')][_0x72c6('0x74')],'providerResponse':JSON[_0x72c6('0x41')](_0x3a085d)};return _0x3f950a;}}});};exports[_0x72c6('0x75')]=function(_0xba3bb4,_0x5aa701,_0x3cb1c9,_0x2a4917){return tilde['asr'](_0xba3bb4,_0x5aa701,_0x3cb1c9,_0x2a4917)[_0x72c6('0x2b')](function(_0x271e30){try{fs[_0x72c6('0x1d')](_0xba3bb4);}catch(_0x2e3c5d){logger[_0x72c6('0x14')](_0x2e3c5d);}logger[_0x72c6('0x1a')](_0x72c6('0x76'),_0x271e30[_0x72c6('0x52')]);logger[_0x72c6('0x1a')](_0x72c6('0x77'),_0x271e30[_0x72c6('0x54')]);return _0x271e30;});};exports[_0x72c6('0x78')]=function(_0x2c9127,_0x273a20,_0x2b270e,_0x39ff42,_0xb21207,_0xfab9a1){var _0x21e80b=path['resolve'](__dirname,_0x72c6('0x3b'),rs[_0x72c6('0x28')](0x4)+_0x72c6('0x39'));var _0x4bc9be;return aws[_0x72c6('0x79')](_0x2c9127,_0x273a20,_0x2b270e,_0x39ff42,_0xb21207,_0xfab9a1,_0x21e80b)[_0x72c6('0x2b')](function(){_0x4bc9be=path['resolve'](__dirname,_0x72c6('0x3b'),rs[_0x72c6('0x28')](0x4)+_0x72c6('0x4b'));return convertFile(_0x21e80b,_0x4bc9be);})[_0x72c6('0x2b')](function(){try{fs['unlink'](_0x21e80b);fs[_0x72c6('0x2c')](_0x4bc9be,'777');}catch(_0x3b1490){logger['error'](_0x3b1490);}return _0x4bc9be[_0x72c6('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x20e7d5,_0x514bd5,_0xedfdf8,_0x5c6638,_0x42d5f9,_0xe7ca23){return aws[_0x72c6('0x7a')](_0x20e7d5,_0x514bd5,_0xedfdf8,_0x5c6638,_0x42d5f9,_0xe7ca23)[_0x72c6('0x2b')](function(_0x577b07){logger[_0x72c6('0x1a')](JSON[_0x72c6('0x41')](_0x577b07));return _0x577b07;});};exports['ispeechTTS']=function(_0x122314,_0x2ab549,_0x485321,_0x1eb060){var _0x123850=util[_0x72c6('0x7b')](_0x72c6('0x7c'),ISPEECH_API,_0x122314,encodeURIComponent(_0x2ab549),_0x485321,_0x1eb060);var _0x23f345=path[_0x72c6('0x27')](__dirname,'tmp',rs[_0x72c6('0x28')](0x4)+_0x72c6('0x39'));var _0x1b09d3;return downloadFile(_0x123850,_0x23f345)[_0x72c6('0x2b')](function(){_0x1b09d3=path[_0x72c6('0x27')](__dirname,'tmp',rs[_0x72c6('0x28')](0x4)+_0x72c6('0x4b'));return convertFile(_0x23f345,_0x1b09d3);})[_0x72c6('0x2b')](function(){try{fs['unlink'](_0x23f345);fs['chmodSync'](_0x1b09d3,_0x72c6('0x2d'));}catch(_0x5e8af2){logger[_0x72c6('0x14')](_0x5e8af2);}return _0x1b09d3[_0x72c6('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x2a461c,_0x48b12a,_0x1f5b0d,_0x56ba72){var _0x416bec=util[_0x72c6('0x7b')](_0x72c6('0x7d'),ISPEECH_API,_0x48b12a,_0x1f5b0d,base64Encode(_0x2a461c),_0x56ba72?util[_0x72c6('0x7b')](_0x72c6('0x7e'),encodeURIComponent(_0x56ba72)):'freeform=3');return uploadFile(_0x416bec)[_0x72c6('0x2b')](function(_0x526fde){return querystring[_0x72c6('0x7f')](_0x526fde);});};exports[_0x72c6('0x80')]=function(_0x3d3bae,_0x1d7c05){return sestek[_0x72c6('0x81')](_0x3d3bae,_0x1d7c05)[_0x72c6('0x2b')](function(_0x3e2f0d){logger[_0x72c6('0x1a')](JSON['stringify'](_0x3e2f0d));var _0x5977e1={'speech':_0x3e2f0d['text'],'action':_0x3e2f0d[_0x72c6('0x82')]?_0x3e2f0d[_0x72c6('0x82')][_0x72c6('0x83')]:undefined,'actiondata':_0x3e2f0d[_0x72c6('0x82')]?_0x3e2f0d[_0x72c6('0x82')][_0x72c6('0x84')]:undefined};if(_0x3e2f0d[_0x72c6('0x82')]&&_0x3e2f0d[_0x72c6('0x82')][_0x72c6('0x85')]){return base64Decode(_0x3e2f0d[_0x72c6('0x82')]['AudioFromTts'][_0x72c6('0x86')],path[_0x72c6('0x27')](__dirname,_0x72c6('0x3b'),rs['generate'](0x4)+_0x72c6('0x4b')))[_0x72c6('0x2b')](function(_0x22b836){_0x5977e1[_0x72c6('0x87')]=_0x22b836;return _0x5977e1;});}return _0x5977e1;});};exports[_0x72c6('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x2b97=['writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','textRequest','stringify','result','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','request-promise','sox','url','parse','util','./google','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','https:','WHAT_EVER','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','then','chmodSync','777','split','toString','base64','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','POST','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0x2b97,0x145));var _0x72b9=function(_0x32e4d0,_0x9a3f64){_0x32e4d0=_0x32e4d0-0x0;var _0x27a71b=_0x2b97[_0x32e4d0];return _0x27a71b;};'use strict';var apiai=require(_0x72b9('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x72b9('0x1'));var fs=require('fs');var http=require(_0x72b9('0x2'));var https=require(_0x72b9('0x3'));var md5=require(_0x72b9('0x4'));var path=require(_0x72b9('0x5'));var querystring=require('querystring');var rp=require(_0x72b9('0x6'));var rs=require('randomstring');var sox=require(_0x72b9('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x72b9('0x8'))[_0x72b9('0x9')];var util=require(_0x72b9('0xa'));var aws=require('./aws');var google=require(_0x72b9('0xb'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x72b9('0xc'));var ISPEECH_API=_0x72b9('0xd');function downloadFile(_0x356333,_0x426022){return new BPromise(function(_0xa4eb86,_0x2f57ab){var _0x21fe99=urlParse(_0x356333);var _0x7e6489=_0x21fe99[_0x72b9('0xe')]==='https:'?https:http;var _0x525b17={'host':_0x21fe99[_0x72b9('0xf')],'path':_0x21fe99[_0x72b9('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x7e6489[_0x72b9('0x10')](_0x525b17,function(_0x74d3f7){if(_0x74d3f7[_0x72b9('0x11')]!==0xc8){logger[_0x72b9('0x12')](_0x72b9('0x13')+_0x356333+_0x72b9('0x14')+_0x74d3f7[_0x72b9('0x11')]+'\x20('+_0x74d3f7[_0x72b9('0x15')]+')');_0x2f57ab(new Error(_0x72b9('0x13')+_0x356333+'\x20failed,\x20status\x20code\x20=\x20'+_0x74d3f7[_0x72b9('0x11')]+'\x20('+_0x74d3f7[_0x72b9('0x15')]+')'));return;}var _0x7c84df=fs[_0x72b9('0x16')](_0x426022);_0x7c84df['on'](_0x72b9('0x17'),function(){logger[_0x72b9('0x18')](_0x72b9('0x19'));_0x7c84df[_0x72b9('0x1a')](_0xa4eb86);});_0x7c84df['on']('error',function(_0x2c3f80){fs[_0x72b9('0x1b')](_0x426022);logger['error'](_0x72b9('0x1c'),_0x2c3f80);_0x2f57ab(_0x2c3f80);});_0x74d3f7['pipe'](_0x7c84df);})['on'](_0x72b9('0x12'),function(_0x27996c){logger['error'](_0x27996c);_0x2f57ab(_0x27996c);})['end']();});}function uploadFile(_0x4f4c49){return new BPromise(function(_0xf3d19a,_0x184d36){var _0x3a2600=urlParse(_0x4f4c49);var _0x2b8756=_0x3a2600[_0x72b9('0xe')]===_0x72b9('0x1d')?https:http;var _0x4b55c0={'host':_0x3a2600[_0x72b9('0xf')],'path':_0x3a2600[_0x72b9('0x5')],'headers':{'user-agent':_0x72b9('0x1e')}};_0x2b8756['get'](_0x4b55c0,function(_0x35364a){if(_0x35364a[_0x72b9('0x11')]!==0xc8){_0x184d36(new Error('request\x20to\x20'+_0x4f4c49+_0x72b9('0x14')+_0x35364a[_0x72b9('0x11')]+'\x20('+_0x35364a[_0x72b9('0x15')]+')'));return;}var _0x419945='';_0x35364a['on'](_0x72b9('0x1f'),function(_0x83d971){_0x419945+=_0x83d971;});_0x35364a['on']('end',function(){_0xf3d19a(_0x419945);});})['on']('error',function(_0xea58eb){_0x184d36(_0xea58eb);})[_0x72b9('0x20')]();});}function convertFile(_0x168d39,_0x56f2dc){return new BPromise(function(_0x1ba69e,_0x583a58){var _0x483366=sox[_0x72b9('0x21')](_0x168d39,_0x56f2dc,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x483366['on'](_0x72b9('0x12'),function(_0x499681){logger[_0x72b9('0x12')](_0x72b9('0x22'),_0x499681);_0x583a58(_0x499681);});_0x483366['on'](_0x72b9('0x20'),function(){logger['info'](_0x72b9('0x23'));_0x1ba69e();});_0x483366[_0x72b9('0x24')]();});}function base64Decode(_0x51c89c,_0xfd770f){var _0x18e8e1=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs['generate'](0x4)+_0x72b9('0x27'));fs['writeFileSync'](_0x18e8e1,_0x51c89c,'base64');return convertFile(_0x18e8e1,_0xfd770f)[_0x72b9('0x28')](function(){try{fs[_0x72b9('0x1b')](_0x18e8e1);fs[_0x72b9('0x29')](_0xfd770f,_0x72b9('0x2a'));}catch(_0x329364){logger[_0x72b9('0x12')](_0x329364);}return _0xfd770f[_0x72b9('0x2b')]('.')[0x0];});}function base64Encode(_0x444839){var _0x5a1cd9=fs['readFileSync'](_0x444839);return new Buffer(_0x5a1cd9)[_0x72b9('0x2c')](_0x72b9('0x2d'));}exports['googleCloudTTS']=function(_0x5ea5fd,_0x21031f,_0x2ee8d4,_0x51438f,_0xce9b6a,_0x1db5aa){var _0x524e20,_0x3cdb35;var _0x130d31=_0x72b9('0x2e');var _0x1fa69c='?key='+_0x5ea5fd;var _0x424088={};if(_0x21031f===_0x72b9('0x2f')){_0x424088['input']={'ssml':_0x2ee8d4};}else{_0x424088[_0x72b9('0x30')]={'text':_0x2ee8d4};};_0x424088[_0x72b9('0x31')]={'languageCode':_0x51438f,'ssmlGender':_0xce9b6a};_0x424088[_0x72b9('0x32')]={'audioEncoding':_0x72b9('0x33'),'sampleRateHertz':0x1f40};var _0x4d5af0={'url':_0x130d31+'text:synthesize'+_0x1fa69c,'method':_0x72b9('0x34'),'json':!![],'body':_0x424088};return rp(_0x4d5af0)[_0x72b9('0x28')](function(_0x7eeb1b){return new BPromise(function(_0x2a908e,_0x17a05e){_0x524e20=path[_0x72b9('0x25')](__dirname,'tmp',rs[_0x72b9('0x35')](0x4)+_0x72b9('0x36'));var _0x1b0c12=Buffer[_0x72b9('0x37')](_0x7eeb1b[_0x72b9('0x38')],_0x72b9('0x2d'));return fs[_0x72b9('0x39')](_0x524e20,_0x1b0c12,function(_0x2d6da8){_0x17a05e(_0x2d6da8);},function(_0x500023){fs[_0x72b9('0x29')](_0x524e20,_0x72b9('0x2a'));_0x2a908e(_0x500023);});});})[_0x72b9('0x28')](function(_0x1ab59a){_0x3cdb35=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x27'));return convertFile(_0x524e20,_0x3cdb35);})['then'](function(){try{fs['unlink'](_0x524e20);fs[_0x72b9('0x29')](_0x3cdb35,_0x72b9('0x2a'));}catch(_0x3fcf9c){logger[_0x72b9('0x12')](_0x3fcf9c);}logger[_0x72b9('0x18')](_0x72b9('0x3a'),_0x3cdb35[_0x72b9('0x2b')]('.')[0x0]);return _0x3cdb35['split']('.')[0x0];});};exports[_0x72b9('0x3b')]=function(_0x3a531d,_0x5e2a60){var _0x3769cf=_0x72b9('0x3c');var _0x218d03,_0x4a7efc;var _0xfc64db;var _0x36db4e={'encoding':_0x72b9('0x3d'),'method':'POST','timeout':0x2710,'url':_0x3769cf,'headers':{'Content-Type':_0x72b9('0x3e')},'body':_0x72b9('0x3f')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x3a531d,_0x5e2a60||'en',![],'null']),null,'generic']]]))};return rp(_0x36db4e)[_0x72b9('0x28')](function(_0x5d14e2){try{_0xfc64db=eval(_0x5d14e2['slice'](0x5))[0x0][0x2];}catch(_0xa79824){throw new Error(_0x72b9('0x40')+_0x5d14e2[_0x72b9('0x1f')]);}if(!_0xfc64db){if(_0x3a531d[_0x72b9('0x41')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x72b9('0x42')+_0x5e2a60+_0x72b9('0x43'));}}try{_0xfc64db=eval(_0xfc64db)[0x0];}catch(_0x2ff5bd){throw new Error(_0x72b9('0x40')+res[_0x72b9('0x1f')]);}const _0x2ffacd=_0xfc64db;_0x218d03=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x36'));fs[_0x72b9('0x44')](_0x218d03,_0xfc64db,{'encoding':'base64'});_0x4a7efc=path['resolve'](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+'.wav');return convertFile(_0x218d03,_0x4a7efc);})[_0x72b9('0x28')](function(){try{fs[_0x72b9('0x1b')](_0x218d03);fs['chmodSync'](_0x4a7efc,_0x72b9('0x2a'));}catch(_0xfe4e44){logger[_0x72b9('0x12')](_0xfe4e44);}logger[_0x72b9('0x18')](_0x72b9('0x45'),_0x4a7efc[_0x72b9('0x2b')]('.')[0x0]);return _0x4a7efc['split']('.')[0x0];});};exports[_0x72b9('0x46')]=function(_0x1532cc,_0x5df4dd,_0x4a93b3){return google[_0x72b9('0x47')](_0x1532cc,_0x5df4dd,_0x4a93b3)['then'](function(_0x848700){logger[_0x72b9('0x18')](_0x848700[_0x72b9('0x48')]);return rp(_0x848700);})[_0x72b9('0x28')](function(_0x3671d5){var _0x406166='';var _0x30712f=0x0;try{fs[_0x72b9('0x1b')](_0x1532cc);}catch(_0x1628bf){logger[_0x72b9('0x12')](_0x1628bf);}if(_0x3671d5&&_0x3671d5['results']){_0x406166=_0x3671d5[_0x72b9('0x49')][_0x72b9('0x4a')](function(_0x494f37){return _0x494f37&&_0x494f37[_0x72b9('0x4b')][0x0]&&_0x494f37[_0x72b9('0x4b')][0x0]['transcript']?_0x494f37[_0x72b9('0x4b')][0x0][_0x72b9('0x4c')]:'';})['join']('\x0a');_0x30712f=_0x3671d5[_0x72b9('0x49')][_0x72b9('0x4a')](function(_0xa03367){return _0xa03367&&_0xa03367['alternatives'][0x0]&&_0xa03367['alternatives'][0x0]['confidence']?_0xa03367['alternatives'][0x0][_0x72b9('0x4d')]:0x0;})[_0x72b9('0x4e')]('\x0a');}logger[_0x72b9('0x18')](_0x72b9('0x4f'),_0x406166);logger[_0x72b9('0x18')](_0x72b9('0x50'),_0x30712f);return{'transcript':_0x406166,'confidence':_0x30712f};})['catch'](function(_0x4d940e){logger[_0x72b9('0x12')](_0x72b9('0x51'),_0x4d940e['statusCode'],_0x4d940e['name'],_0x4d940e[_0x72b9('0x52')]);});};exports[_0x72b9('0x53')]=function(_0x391f00,_0x1e16f9,_0x103174,_0x40680f){var _0x52a792=apiai(_0x1e16f9,{'language':_0x40680f||'en'});return _0x52a792[_0x72b9('0x54')](_0x103174,{'sessionId':md5(_0x391f00)})[_0x72b9('0x28')](function(_0x4dd30b){logger[_0x72b9('0x18')](JSON[_0x72b9('0x55')](_0x4dd30b));return{'source':_0x4dd30b[_0x72b9('0x56')]['source'],'resolvedQuery':_0x4dd30b[_0x72b9('0x56')]['resolvedQuery'],'action':_0x4dd30b[_0x72b9('0x56')]['action'],'actionIncomplete':_0x4dd30b[_0x72b9('0x56')]['actionIncomplete'],'speech':_0x4dd30b['result'][_0x72b9('0x57')][_0x72b9('0x58')],'score':_0x4dd30b[_0x72b9('0x56')][_0x72b9('0x59')],'statusCode':_0x4dd30b[_0x72b9('0x5a')]['code'],'endConversation':_0x4dd30b[_0x72b9('0x56')][_0x72b9('0x5b')][_0x72b9('0x5c')]||![],'isFallbackIntent':_0x4dd30b[_0x72b9('0x56')]['metadata'][_0x72b9('0x5d')]};});};exports[_0x72b9('0x5e')]=function(_0x3a4e1e,_0x55ebe3,_0x4f2736,_0xf78285,_0x2d08bd,_0x981519){var _0x2a5c27=_0xf78285[_0x72b9('0x5f')](/\\n/g,'\x0a');var _0x2013a1={'credentials':{'private_key':_0x2a5c27,'client_email':_0x4f2736}};var _0x292d1e=new dialogflow[(_0x72b9('0x60'))](_0x2013a1);var _0x1c88ce=_0x292d1e[_0x72b9('0x61')](_0x55ebe3,md5(_0x3a4e1e));var _0x8232e0={'session':_0x1c88ce,'queryInput':{'text':{'text':_0x2d08bd,'languageCode':_0x981519}}};return _0x292d1e['detectIntent'](_0x8232e0)['then'](function(_0x1c57e8){if(_0x1c57e8&&_0x1c57e8[_0x72b9('0x41')]){logger['info'](_0x72b9('0x62'),JSON[_0x72b9('0x55')](_0x1c57e8));var _0x12d131=_0x1c57e8[0x0];if(_0x12d131){var _0x2d730b={'action':_0x12d131[_0x72b9('0x63')][_0x72b9('0x64')],'allRequiredParamsPresent':_0x12d131['queryResult'][_0x72b9('0x65')],'endConversation':_0x12d131['queryResult'][_0x72b9('0x66')]&&_0x12d131['queryResult'][_0x72b9('0x66')][_0x72b9('0x67')]?_0x12d131[_0x72b9('0x63')][_0x72b9('0x66')][_0x72b9('0x67')]['end_conversation'][_0x72b9('0x68')]:![],'fulfillmentText':_0x12d131[_0x72b9('0x63')][_0x72b9('0x69')],'intentName':_0x12d131['queryResult'][_0x72b9('0x6a')]['name'],'intentDisplayName':_0x12d131[_0x72b9('0x63')][_0x72b9('0x6a')][_0x72b9('0x6b')],'isFallbackIntent':_0x12d131[_0x72b9('0x63')][_0x72b9('0x6a')]['isFallback'],'languageCode':_0x12d131[_0x72b9('0x63')][_0x72b9('0x6c')],'queryText':_0x12d131['queryResult']['queryText'],'responseId':_0x12d131['responseId'],'score':_0x12d131[_0x72b9('0x63')][_0x72b9('0x6d')],'speech':_0x12d131[_0x72b9('0x63')][_0x72b9('0x69')],'providerResponse':JSON[_0x72b9('0x55')](_0x1c57e8)};return _0x2d730b;}}});};exports[_0x72b9('0x6e')]=function(_0x46d0d1,_0x2bf5c8,_0x3901ea,_0x212f6d){return tilde['asr'](_0x46d0d1,_0x2bf5c8,_0x3901ea,_0x212f6d)[_0x72b9('0x28')](function(_0x510a7b){try{fs['unlink'](_0x46d0d1);}catch(_0x2b1537){logger[_0x72b9('0x12')](_0x2b1537);}logger[_0x72b9('0x18')](_0x72b9('0x6f'),_0x510a7b[_0x72b9('0x4c')]);logger['info'](_0x72b9('0x70'),_0x510a7b[_0x72b9('0x4d')]);return _0x510a7b;});};exports[_0x72b9('0x71')]=function(_0x526c50,_0x298e43,_0x426bf0,_0x554caf,_0x3dbc6e,_0x37c4ab){var _0x19dbaf=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x36'));var _0x3105e6;return aws['polly'](_0x526c50,_0x298e43,_0x426bf0,_0x554caf,_0x3dbc6e,_0x37c4ab,_0x19dbaf)[_0x72b9('0x28')](function(){_0x3105e6=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x27'));return convertFile(_0x19dbaf,_0x3105e6);})[_0x72b9('0x28')](function(){try{fs[_0x72b9('0x1b')](_0x19dbaf);fs[_0x72b9('0x29')](_0x3105e6,_0x72b9('0x2a'));}catch(_0x3279bb){logger[_0x72b9('0x12')](_0x3279bb);}return _0x3105e6['split']('.')[0x0];});};exports[_0x72b9('0x72')]=function(_0x153027,_0x1a74f4,_0x18c972,_0x1be55e,_0x413e5b,_0x338c7d){return aws[_0x72b9('0x73')](_0x153027,_0x1a74f4,_0x18c972,_0x1be55e,_0x413e5b,_0x338c7d)[_0x72b9('0x28')](function(_0x26a20b){logger[_0x72b9('0x18')](JSON[_0x72b9('0x55')](_0x26a20b));return _0x26a20b;});};exports[_0x72b9('0x74')]=function(_0x3302a2,_0x138c21,_0x2e3078,_0x28146f){var _0x5f3361=util[_0x72b9('0x75')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3302a2,encodeURIComponent(_0x138c21),_0x2e3078,_0x28146f);var _0x4cda38=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x36'));var _0x913b61;return downloadFile(_0x5f3361,_0x4cda38)[_0x72b9('0x28')](function(){_0x913b61=path[_0x72b9('0x25')](__dirname,_0x72b9('0x26'),rs[_0x72b9('0x35')](0x4)+_0x72b9('0x27'));return convertFile(_0x4cda38,_0x913b61);})[_0x72b9('0x28')](function(){try{fs[_0x72b9('0x1b')](_0x4cda38);fs[_0x72b9('0x29')](_0x913b61,_0x72b9('0x2a'));}catch(_0x1b5083){logger[_0x72b9('0x12')](_0x1b5083);}return _0x913b61[_0x72b9('0x2b')]('.')[0x0];});};exports['ispeechASR']=function(_0x7a3765,_0x3d319e,_0x411ab9,_0x4e1cfd){var _0x484c0b=util[_0x72b9('0x75')](_0x72b9('0x76'),ISPEECH_API,_0x3d319e,_0x411ab9,base64Encode(_0x7a3765),_0x4e1cfd?util['format'](_0x72b9('0x77'),encodeURIComponent(_0x4e1cfd)):_0x72b9('0x78'));return uploadFile(_0x484c0b)['then'](function(_0x13ba29){return querystring[_0x72b9('0x9')](_0x13ba29);});};exports[_0x72b9('0x79')]=function(_0x207c6b,_0x4504af){return sestek[_0x72b9('0x7a')](_0x207c6b,_0x4504af)[_0x72b9('0x28')](function(_0x36a6a8){logger[_0x72b9('0x18')](JSON['stringify'](_0x36a6a8));var _0xbee97f={'speech':_0x36a6a8[_0x72b9('0x7b')],'action':_0x36a6a8['channelData']?_0x36a6a8[_0x72b9('0x7c')][_0x72b9('0x7d')]:undefined,'actiondata':_0x36a6a8[_0x72b9('0x7c')]?_0x36a6a8[_0x72b9('0x7c')][_0x72b9('0x7e')]:undefined};if(_0x36a6a8[_0x72b9('0x7c')]&&_0x36a6a8[_0x72b9('0x7c')][_0x72b9('0x7f')]){return base64Decode(_0x36a6a8[_0x72b9('0x7c')][_0x72b9('0x7f')][_0x72b9('0x80')],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x72b9('0x27')))[_0x72b9('0x28')](function(_0x13dcff){_0xbee97f[_0x72b9('0x81')]=_0x13dcff;return _0xbee97f;});}return _0xbee97f;});};exports[_0x72b9('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 8f34e03..effc96b 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x342e=['exports','./nda'];(function(_0x2de64e,_0xdc4719){var _0x40b13a=function(_0x3cbb71){while(--_0x3cbb71){_0x2de64e['push'](_0x2de64e['shift']());}};_0x40b13a(++_0xdc4719);}(_0x342e,0x1b7));var _0xe342=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x342e[_0x3ab353];return _0x1e2285;};var nda=require(_0xe342('0x0'));module[_0xe342('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 599e85c..69c00dc 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 _0xd61e=['ndagenerate_audio','audio/wav','custom_action','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','calleridname','dnid','project','body','channelData','ProjectName'];(function(_0x315a89,_0x360084){var _0x222ba3=function(_0x91c60c){while(--_0x91c60c){_0x315a89['push'](_0x315a89['shift']());}};_0x222ba3(++_0x360084);}(_0xd61e,0x13d));var _0xed61=function(_0x357fb4,_0x1a1204){_0x357fb4=_0x357fb4-0x0;var _0x535630=_0xd61e[_0x357fb4];return _0x535630;};'use strict';var rp=require(_0xed61('0x0'));var url=require(_0xed61('0x1'));var logger=require(_0xed61('0x2'))(_0xed61('0x3'));module[_0xed61('0x4')]=function(_0x22d436,_0x5ae3f8){var _0x123e01={'method':_0xed61('0x5'),'uri':url[_0xed61('0x6')](_0x5ae3f8[_0xed61('0x7')],_0xed61('0x8')),'form':{'grant_type':_0xed61('0x9'),'username':_0x5ae3f8[_0xed61('0xa')],'password':_0x5ae3f8['password']},'json':!![]};return rp(_0x123e01)['then'](function(_0x59ef0e){var _0x5cbbd7={'method':'POST','uri':url[_0xed61('0x6')](_0x5ae3f8[_0xed61('0xb')],_0xed61('0xc')),'body':{'type':_0x5ae3f8[_0xed61('0xd')]||_0xed61('0xe'),'channelId':'Nda','conversation':{'id':_0x22d436['uniqueid']},'from':{'id':_0x22d436['callerid'],'name':_0x22d436[_0xed61('0xf')]},'recipient':{'id':_0x22d436[_0xed61('0x10')],'name':_0x22d436['extension']},'text':_0x5ae3f8['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x59ef0e['access_token']},'json':!![]};if(_0x5ae3f8[_0xed61('0x11')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')][_0xed61('0x14')]=_0x5ae3f8['project'];}if(_0x5ae3f8[_0xed61('0x15')]=='1'){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xed61('0x16')};}if(_0x5ae3f8[_0xed61('0x17')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['CustomAction']=_0x5ae3f8[_0xed61('0x17')];if(_0x5ae3f8[_0xed61('0x18')]){_0x5cbbd7[_0xed61('0x12')][_0xed61('0x13')]['CustomActionData']=_0x5ae3f8[_0xed61('0x18')];}}logger[_0xed61('0x19')](JSON['stringify'](_0x5cbbd7));return rp(_0x5cbbd7);});}; \ No newline at end of file +var _0xe130=['dnid','extension','text','Bearer\x20','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','request-promise','url','agi','exports','resolve','ndauth_url','/token','password','POST','ndaactivity_type','message','Nda','uniqueid'];(function(_0x11c708,_0xd68536){var _0x2fe0ce=function(_0x203d59){while(--_0x203d59){_0x11c708['push'](_0x11c708['shift']());}};_0x2fe0ce(++_0xd68536);}(_0xe130,0x127));var _0x0e13=function(_0x1d8f32,_0xfc3357){_0x1d8f32=_0x1d8f32-0x0;var _0x1a8f75=_0xe130[_0x1d8f32];return _0x1a8f75;};'use strict';var rp=require(_0x0e13('0x0'));var url=require(_0x0e13('0x1'));var logger=require('../../../../../config/logger')(_0x0e13('0x2'));module[_0x0e13('0x3')]=function(_0x1dd4fa,_0x360489){var _0x449ddd={'method':'POST','uri':url[_0x0e13('0x4')](_0x360489[_0x0e13('0x5')],_0x0e13('0x6')),'form':{'grant_type':_0x0e13('0x7'),'username':_0x360489['username'],'password':_0x360489[_0x0e13('0x7')]},'json':!![]};return rp(_0x449ddd)['then'](function(_0x567031){var _0x5aaa22={'method':_0x0e13('0x8'),'uri':url[_0x0e13('0x4')](_0x360489['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x360489[_0x0e13('0x9')]||_0x0e13('0xa'),'channelId':_0x0e13('0xb'),'conversation':{'id':_0x1dd4fa[_0x0e13('0xc')]},'from':{'id':_0x1dd4fa['callerid'],'name':_0x1dd4fa['calleridname']},'recipient':{'id':_0x1dd4fa[_0x0e13('0xd')],'name':_0x1dd4fa[_0x0e13('0xe')]},'text':_0x360489[_0x0e13('0xf')],'channelData':{}},'headers':{'Authorization':_0x0e13('0x10')+_0x567031['access_token']},'json':!![]};if(_0x360489[_0x0e13('0x11')]){_0x5aaa22['body'][_0x0e13('0x12')][_0x0e13('0x13')]=_0x360489[_0x0e13('0x11')];}if(_0x360489[_0x0e13('0x14')]=='1'){_0x5aaa22[_0x0e13('0x15')][_0x0e13('0x12')][_0x0e13('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0e13('0x17')};}if(_0x360489[_0x0e13('0x18')]){_0x5aaa22['body'][_0x0e13('0x12')][_0x0e13('0x19')]=_0x360489[_0x0e13('0x18')];if(_0x360489[_0x0e13('0x1a')]){_0x5aaa22[_0x0e13('0x15')][_0x0e13('0x12')]['CustomActionData']=_0x360489[_0x0e13('0x1a')];}}logger[_0x0e13('0x1b')](JSON['stringify'](_0x5aaa22));return rp(_0x5aaa22);});}; \ 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 870c13f..506c090 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 _0x5971=['exports','./lib/api'];(function(_0x16601c,_0x376e95){var _0x3ed5ad=function(_0x32be6b){while(--_0x32be6b){_0x16601c['push'](_0x16601c['shift']());}};_0x3ed5ad(++_0x376e95);}(_0x5971,0x161));var _0x1597=function(_0x28d266,_0x15d985){_0x28d266=_0x28d266-0x0;var _0x339a7a=_0x5971[_0x28d266];return _0x339a7a;};'use strict';var asr=require(_0x1597('0x0'));module[_0x1597('0x1')]=function(_0x51b1dd,_0x1adadc,_0x50b9db,_0x4c1cc8){return asr(_0x51b1dd,_0x1adadc,_0x50b9db,_0x4c1cc8);}; \ No newline at end of file +var _0x25b4=['./lib/api','exports'];(function(_0x455ac0,_0x1d5f16){var _0xfb9257=function(_0x126d21){while(--_0x126d21){_0x455ac0['push'](_0x455ac0['shift']());}};_0xfb9257(++_0x1d5f16);}(_0x25b4,0xd4));var _0x425b=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x25b4[_0x3b76f7];return _0x43984e;};'use strict';var asr=require(_0x425b('0x0'));module[_0x425b('0x1')]=function(_0x49c5d5,_0x3a2d07,_0x484fae,_0x4dcda4){return asr(_0x49c5d5,_0x3a2d07,_0x484fae,_0x4dcda4);}; \ 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 75a4a60..512b81a 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 _0xae01=['message','bluebird','crypto','../../../../../../config/logger','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open'];(function(_0x5a5f36,_0x618e96){var _0x343806=function(_0x4d6e93){while(--_0x4d6e93){_0x5a5f36['push'](_0x5a5f36['shift']());}};_0x343806(++_0x618e96);}(_0xae01,0xba));var _0x1ae0=function(_0x3f0b76,_0x27bfbf){_0x3f0b76=_0x3f0b76-0x0;var _0x11e5a3=_0xae01[_0x3f0b76];return _0x11e5a3;};'use strict';var BPromise=require(_0x1ae0('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x1ae0('0x1'));var logger=require(_0x1ae0('0x2'))(_0x1ae0('0x3'));module[_0x1ae0('0x4')]=function(_0xf9e727,_0x2fc969,_0x1b714c,_0xe7c7f7){return new BPromise(function(_0x3ecd98,_0x304ab4){logger['info']('Tilde\x20URI',_0xe7c7f7||_0x1ae0('0x5'));var _0x3ebb34=new WebSocket(_0xe7c7f7||_0x1ae0('0x5'),{'perMessageDeflate':![]});var _0x43ddb5='';var _0x2c51e1='0';var _0x51f3cf='1';var _0xcf7b3e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x66c2eb(_0x56a380){var _0x446c85=crypto['createHash']('sha1');_0x446c85[_0x1ae0('0x6')](_0x56a380);return _0x446c85[_0x1ae0('0x7')](_0x1ae0('0x8'));}function _0x1ad21b(){try{logger[_0x1ae0('0x9')](_0x1ae0('0xa'));var _0x3276ba=moment()[_0x1ae0('0xb')]();var _0x5db2f9=_0x66c2eb(_0x3276ba+_0x2fc969+_0x1b714c);_0x3ebb34['send'](JSON[_0x1ae0('0xc')]({'appID':_0x2fc969,'timestamp':_0x3276ba,'appKey':_0x5db2f9}));var _0x44f920=fs[_0x1ae0('0xd')](_0xf9e727);_0x44f920['on'](_0x1ae0('0xe'),function(_0x9d8b50){_0x3ebb34[_0x1ae0('0xf')](_0x9d8b50);});_0x44f920['on'](_0x1ae0('0x10'),function(){_0x3ebb34['send'](_0x1ae0('0x11'));});}catch(_0x3aff51){logger[_0x1ae0('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x1ae0('0xc')](_0x3aff51));_0x3ebb34[_0x1ae0('0x13')]();}}function _0x5e43bb(_0x5c22a9){try{if(_0x5c22a9){var _0x122d86=JSON['parse'](_0x5c22a9);switch(_0x122d86[_0x1ae0('0x14')]){case 0x0:if(_0x122d86[_0x1ae0('0x15')]){if(_0x122d86[_0x1ae0('0x15')]['final']){logger[_0x1ae0('0x9')](_0x1ae0('0x16'),JSON[_0x1ae0('0xc')](_0x122d86['result']['hypotheses']));_0x43ddb5=_0x122d86[_0x1ae0('0x15')][_0x1ae0('0x17')][0x0][_0x1ae0('0x18')];_0x2c51e1=_0x122d86[_0x1ae0('0x15')][_0x1ae0('0x17')][0x0][_0x1ae0('0x19')];_0x51f3cf='0';_0xcf7b3e='Success.';_0x3ebb34['terminate']();}}break;case 0x1:logger[_0x1ae0('0x9')](_0x1ae0('0x1a'));_0x51f3cf='1';_0xcf7b3e=_0x1ae0('0x1a');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x51f3cf='2';_0xcf7b3e=_0x1ae0('0x1b');break;case 0x9:logger[_0x1ae0('0x9')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x51f3cf='9';_0xcf7b3e=_0x1ae0('0x1c');break;case 0xa:logger[_0x1ae0('0x9')](_0x1ae0('0x1d'));_0x51f3cf='10';_0xcf7b3e='Authentication\x20failed.';break;case 0xb:logger[_0x1ae0('0x9')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x51f3cf='11';_0xcf7b3e=_0x1ae0('0x1e');}}}catch(_0x177387){logger[_0x1ae0('0x12')](_0x1ae0('0x1f'),JSON['stringify'](_0x177387));_0x3ebb34[_0x1ae0('0x13')]();}}function _0x164962(){logger[_0x1ae0('0x9')](_0x1ae0('0x20'));_0x3ecd98({'transcript':_0x43ddb5,'confidence':_0x2c51e1,'status':_0x51f3cf,'status_message':_0xcf7b3e});}function _0x2e72b8(_0x2d64f8){logger[_0x1ae0('0x12')](_0x1ae0('0x21'));if(!_[_0x1ae0('0x22')](_0x2d64f8)){logger['error'](_['isObject'](_0x2d64f8)?JSON['stringify'](_0x2d64f8):_0x2d64f8);}}_0x3ebb34['on'](_0x1ae0('0x23'),_0x1ad21b);_0x3ebb34['on'](_0x1ae0('0x24'),_0x5e43bb);_0x3ebb34['on']('close',_0x164962);_0x3ebb34['on'](_0x1ae0('0x12'),_0x2e72b8);});}; \ No newline at end of file +var _0x5606=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','close','bluebird','moment','crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x3fbd90,_0x47f6bc){var _0x2850df=function(_0x59899c){while(--_0x59899c){_0x3fbd90['push'](_0x3fbd90['shift']());}};_0x2850df(++_0x47f6bc);}(_0x5606,0x1cf));var _0x6560=function(_0x3c46c2,_0x304d86){_0x3c46c2=_0x3c46c2-0x0;var _0x25fcb2=_0x5606[_0x3c46c2];return _0x25fcb2;};'use strict';var BPromise=require(_0x6560('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6560('0x1'));var crypto=require(_0x6560('0x2'));var logger=require('../../../../../../config/logger')(_0x6560('0x3'));module['exports']=function(_0x4fd77e,_0x939de7,_0xfe651c,_0x41f640){return new BPromise(function(_0x5590a7,_0x2bc51b){logger[_0x6560('0x4')](_0x6560('0x5'),_0x41f640||_0x6560('0x6'));var _0x217930=new WebSocket(_0x41f640||_0x6560('0x6'),{'perMessageDeflate':![]});var _0x3d94b9='';var _0x5bf932='0';var _0x2b57cf='1';var _0x555546=_0x6560('0x7');function _0x3a362a(_0x37d6cb){var _0x5190b3=crypto[_0x6560('0x8')](_0x6560('0x9'));_0x5190b3['update'](_0x37d6cb);return _0x5190b3['digest']('hex');}function _0x37532a(){try{logger['info'](_0x6560('0xa'));var _0x3d0d60=moment()[_0x6560('0xb')]();var _0x2b6d0b=_0x3a362a(_0x3d0d60+_0x939de7+_0xfe651c);_0x217930[_0x6560('0xc')](JSON['stringify']({'appID':_0x939de7,'timestamp':_0x3d0d60,'appKey':_0x2b6d0b}));var _0x3020b2=fs[_0x6560('0xd')](_0x4fd77e);_0x3020b2['on'](_0x6560('0xe'),function(_0x344e0d){_0x217930[_0x6560('0xc')](_0x344e0d);});_0x3020b2['on']('close',function(){_0x217930[_0x6560('0xc')](_0x6560('0xf'));});}catch(_0xfc1df6){logger[_0x6560('0x10')](_0x6560('0x11'),JSON[_0x6560('0x12')](_0xfc1df6));_0x217930[_0x6560('0x13')]();}}function _0x54745c(_0x355d5c){try{if(_0x355d5c){var _0x3135e8=JSON[_0x6560('0x14')](_0x355d5c);switch(_0x3135e8[_0x6560('0x15')]){case 0x0:if(_0x3135e8[_0x6560('0x16')]){if(_0x3135e8[_0x6560('0x16')][_0x6560('0x17')]){logger[_0x6560('0x4')](_0x6560('0x18'),JSON[_0x6560('0x12')](_0x3135e8[_0x6560('0x16')][_0x6560('0x19')]));_0x3d94b9=_0x3135e8[_0x6560('0x16')][_0x6560('0x19')][0x0][_0x6560('0x1a')];_0x5bf932=_0x3135e8[_0x6560('0x16')][_0x6560('0x19')][0x0][_0x6560('0x1b')];_0x2b57cf='0';_0x555546=_0x6560('0x1c');_0x217930[_0x6560('0x13')]();}}break;case 0x1:logger[_0x6560('0x4')](_0x6560('0x7'));_0x2b57cf='1';_0x555546='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x6560('0x4')](_0x6560('0x1d'));_0x2b57cf='2';_0x555546='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x6560('0x1e'));_0x2b57cf='9';_0x555546=_0x6560('0x1e');break;case 0xa:logger[_0x6560('0x4')]('Authentication\x20failed.');_0x2b57cf='10';_0x555546='Authentication\x20failed.';break;case 0xb:logger[_0x6560('0x4')](_0x6560('0x1f'));_0x2b57cf='11';_0x555546=_0x6560('0x1f');}}}catch(_0x376ebb){logger[_0x6560('0x10')](_0x6560('0x20'),JSON[_0x6560('0x12')](_0x376ebb));_0x217930[_0x6560('0x13')]();}}function _0x422781(){logger[_0x6560('0x4')](_0x6560('0x21'));_0x5590a7({'transcript':_0x3d94b9,'confidence':_0x5bf932,'status':_0x2b57cf,'status_message':_0x555546});}function _0x4737ac(_0x19d8b2){logger['error'](_0x6560('0x22'));if(!_['isNil'](_0x19d8b2)){logger[_0x6560('0x10')](_['isObject'](_0x19d8b2)?JSON[_0x6560('0x12')](_0x19d8b2):_0x19d8b2);}}_0x217930['on'](_0x6560('0x23'),_0x37532a);_0x217930['on'](_0x6560('0x24'),_0x54745c);_0x217930['on'](_0x6560('0x25'),_0x422781);_0x217930['on'](_0x6560('0x10'),_0x4737ac);});}; \ 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 2463d1b..45be1df 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 _0xe4d5=['./asr','exports'];(function(_0x41dca8,_0x13d314){var _0x261a1a=function(_0x41c4ae){while(--_0x41c4ae){_0x41dca8['push'](_0x41dca8['shift']());}};_0x261a1a(++_0x13d314);}(_0xe4d5,0x138));var _0x5e4d=function(_0x532745,_0x1a16d6){_0x532745=_0x532745-0x0;var _0x37a301=_0xe4d5[_0x532745];return _0x37a301;};var asr=require(_0x5e4d('0x0'));module[_0x5e4d('0x1')]={'asr':asr}; \ No newline at end of file +var _0xff3a=['./asr','exports'];(function(_0x3ac097,_0x16df8d){var _0x42e3d3=function(_0x2313c3){while(--_0x2313c3){_0x3ac097['push'](_0x3ac097['shift']());}};_0x42e3d3(++_0x16df8d);}(_0xff3a,0x18c));var _0xaff3=function(_0x274a30,_0x21aaa4){_0x274a30=_0x274a30-0x0;var _0x2445e8=_0xff3a[_0x274a30];return _0x2445e8;};var asr=require(_0xaff3('0x0'));module[_0xaff3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 40a984b..f7bade6 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 _0x4fca=['E_AGI_SERVER_VOICE_DISABLED','nextTick','inherits','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR'];(function(_0x2291cb,_0x3d2b79){var _0x53b5d2=function(_0x300c99){while(--_0x300c99){_0x2291cb['push'](_0x2291cb['shift']());}};_0x53b5d2(++_0x3d2b79);}(_0x4fca,0xb8));var _0xa4fc=function(_0x5c40ba,_0x322555){_0x5c40ba=_0x5c40ba-0x0;var _0x5c88a9=_0x4fca[_0x5c40ba];return _0x5c88a9;};'use strict';var util=require('util');var net=require(_0xa4fc('0x0'));var EventEmitter=require(_0xa4fc('0x1'))[_0xa4fc('0x2')];var AGIError=require(_0xa4fc('0x3'));var AGIChannel=require(_0xa4fc('0x4'));var AGIServer=function(_0x4acc54,_0x427d0b,_0x710a6a){var _0x448f5f=this,_0x4acc54=_0x4acc54||0x11dd,_0x427d0b=_0x427d0b||_0xa4fc('0x5'),_0x10f179=null,_0x16754f=0x0;EventEmitter[_0xa4fc('0x6')](_0x448f5f);function _0x3e60b9(){if(!_0x4acc54){_0x448f5f[_0xa4fc('0x7')](_0xa4fc('0x8'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x10f179=net[_0xa4fc('0x9')]();_0x10f179['listen'](_0x4acc54,_0x427d0b);_0x10f179['on']('listening',function(){_0x448f5f[_0xa4fc('0x7')](_0xa4fc('0xa'));});_0x10f179['on'](_0xa4fc('0xb'),function(_0x516991){_0x10f179[_0xa4fc('0xc')](function(_0x53da0c,_0x5f1dc5){if(_0x53da0c){_0x448f5f['emit'](_0xa4fc('0x8'),new AGIError(_0xa4fc('0xd'),_0x53da0c));}else if(_0x710a6a&&_0x710a6a<0x0){_0x448f5f['emit'](_0xa4fc('0x8'),new AGIError(_0xa4fc('0xe')));_0x516991['destroy']();}else if(_0x710a6a&&_0x710a6a>0x0&&_0x710a6a<_0x5f1dc5){_0x16754f+=0x1;_0x448f5f[_0xa4fc('0x7')](_0xa4fc('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x16754f));_0x516991['destroy']();}else{var _0x4a580=new AGIChannel(_0x516991);_0x4a580['on']('ready',function(){_0x448f5f[_0xa4fc('0x7')]('connection',_0x4a580);});}});});_0x10f179['on'](_0xa4fc('0x8'),function(_0x2ffd48){_0x448f5f[_0xa4fc('0x7')]('error',new AGIError(_0xa4fc('0xd'),_0x2ffd48['code']));});_0x10f179['on']('close',function(){_0x448f5f[_0xa4fc('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xa4fc('0xf')](function(){_0x3e60b9();});};util[_0xa4fc('0x10')](AGIServer,EventEmitter);module[_0xa4fc('0x11')]=function(_0x3662ac,_0x264fb8,_0x73b3c1){return new AGIServer(_0x3662ac,_0x264fb8,_0x73b3c1);}; \ No newline at end of file +var _0x953d=['getConnections','error','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','code','close','nextTick','inherits','util','net','events','EventEmitter','./error','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection'];(function(_0x35005d,_0x337870){var _0x34476f=function(_0x1177d6){while(--_0x1177d6){_0x35005d['push'](_0x35005d['shift']());}};_0x34476f(++_0x337870);}(_0x953d,0x105));var _0xd953=function(_0x13d905,_0x4093f6){_0x13d905=_0x13d905-0x0;var _0x308b2f=_0x953d[_0x13d905];return _0x308b2f;};'use strict';var util=require(_0xd953('0x0'));var net=require(_0xd953('0x1'));var EventEmitter=require(_0xd953('0x2'))[_0xd953('0x3')];var AGIError=require(_0xd953('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x5b0a13,_0x19df62,_0x5eba19){var _0x48b0cc=this,_0x5b0a13=_0x5b0a13||0x11dd,_0x19df62=_0x19df62||_0xd953('0x5'),_0x3782be=null,_0x1bbc6d=0x0;EventEmitter[_0xd953('0x6')](_0x48b0cc);function _0x2d0f3c(){if(!_0x5b0a13){_0x48b0cc[_0xd953('0x7')]('error',new AGIError(_0xd953('0x8')));return![];}_0x3782be=net[_0xd953('0x9')]();_0x3782be['listen'](_0x5b0a13,_0x19df62);_0x3782be['on'](_0xd953('0xa'),function(){_0x48b0cc['emit']('listening');});_0x3782be['on'](_0xd953('0xb'),function(_0x2cd06c){_0x3782be[_0xd953('0xc')](function(_0x156870,_0x2af406){if(_0x156870){_0x48b0cc[_0xd953('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x156870));}else if(_0x5eba19&&_0x5eba19<0x0){_0x48b0cc[_0xd953('0x7')](_0xd953('0xd'),new AGIError(_0xd953('0xe')));_0x2cd06c['destroy']();}else if(_0x5eba19&&_0x5eba19>0x0&&_0x5eba19<_0x2af406){_0x1bbc6d+=0x1;_0x48b0cc[_0xd953('0x7')](_0xd953('0xd'),new AGIError(_0xd953('0xf'),_0x1bbc6d));_0x2cd06c[_0xd953('0x10')]();}else{var _0x3768c2=new AGIChannel(_0x2cd06c);_0x3768c2['on']('ready',function(){_0x48b0cc[_0xd953('0x7')](_0xd953('0xb'),_0x3768c2);});}});});_0x3782be['on'](_0xd953('0xd'),function(_0x3868d7){_0x48b0cc['emit'](_0xd953('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x3868d7[_0xd953('0x11')]));});_0x3782be['on'](_0xd953('0x12'),function(){_0x48b0cc[_0xd953('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xd953('0x13')](function(){_0x2d0f3c();});};util[_0xd953('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x5dea25,_0xad7294,_0x853b00){return new AGIServer(_0x5dea25,_0xad7294,_0x853b00);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index ed5e0bc..63f3991 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 _0x2630=['ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','PLAYBACK','queue','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','wav','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','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>','user','subject','service','host','port','secure','auth','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','exec','replace','googleCloudTTS','apiKey','MALE','audioEncoding','googleTTS','text','google_tts_language','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','headers','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeech_tts_language','ispeechASR','ispeech_asr_language','en-US','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','stringify','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','username','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%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','maxdigit','test','mindigit','hiddendigitsnum','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','no\x20condition\x20configured','condition','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x2630,0x79));var _0x0263=function(_0x29260f,_0x4e2309){_0x29260f=_0x29260f-0x0;var _0x517d7b=_0x2630[_0x29260f];return _0x517d7b;};'use strict';var fs=require('fs');var path=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var _=require(_0x0263('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x0263('0x3'));var moment=require(_0x0263('0x4'));var Mustache=require(_0x0263('0x5'));var rp=require(_0x0263('0x6'));var logger=require(_0x0263('0x7'))(_0x0263('0x8'));var config=require('../../config/environment');var scripts=require(_0x0263('0x9'));var FILES_PATH=_0x0263('0xa');var recursiveMapAttributes=['rawHeaders',_0x0263('0xb')];var verticesWithRetry=[_0x0263('0xc'),_0x0263('0xd'),_0x0263('0xe')];var AGIVertices=function(_0x445e08,_0x4b99bf,_0x20350e){this[_0x0263('0xf')]=_0x445e08;this[_0x0263('0x10')]=_0x4b99bf;this[_0x0263('0x11')]=_0x20350e;};AGIVertices[_0x0263('0x12')]['getVariable']=function(_0x1682c2,_0x545588){this[_0x0263('0x10')][_0x0263('0x13')](_0x1682c2)[_0x0263('0x14')](function(_0x4a6922){_0x545588(null,_0x4a6922?_0x4a6922[_0x0263('0x15')]:![]);})['catch'](function(_0x2af921){_0x545588(_0x2af921);});};AGIVertices['prototype'][_0x0263('0x16')]=function(_0x70207e,_0x1dda38){this[_0x0263('0x10')][_0x0263('0x17')](_0x70207e)[_0x0263('0x14')](function(_0x46a28a){_0x1dda38(null,_0x46a28a?_0x46a28a[_0x0263('0x15')]:![]);})[_0x0263('0x18')](function(_0x3c4b8e){_0x1dda38(_0x3c4b8e);});};AGIVertices['prototype']['getSquareProject']=function(_0x47a011,_0x496770){this[_0x0263('0x10')]['getSquareProjectById'](_0x47a011)[_0x0263('0x14')](function(_0x5b544c){_0x496770(null,_0x5b544c?_0x5b544c[_0x0263('0x15')]:![]);})['catch'](function(_0x247658){_0x496770(_0x247658);});};AGIVertices['prototype'][_0x0263('0x19')]=function(_0x4ffd3f,_0x5dbd50){this[_0x0263('0x10')][_0x0263('0x1a')](_0x4ffd3f)[_0x0263('0x14')](function(_0x40416b){_0x5dbd50(null,_0x40416b?_0x40416b[_0x0263('0x1b')]:![]);})[_0x0263('0x18')](function(_0x55c8b3){_0x5dbd50(_0x55c8b3);});};AGIVertices[_0x0263('0x12')][_0x0263('0x1c')]=function(_0xf630ac,_0x1f0fb4){this[_0x0263('0x10')][_0x0263('0x1d')](_0xf630ac)['then'](function(_0x3f83f6){_0x1f0fb4(null,_0x3f83f6?_0x3f83f6[_0x0263('0x15')]:![]);})[_0x0263('0x18')](function(_0x1f3fdb){_0x1f0fb4(_0x1f3fdb);});};AGIVertices[_0x0263('0x12')][_0x0263('0x1e')]=function(_0x2780e7,_0x56b711){this[_0x0263('0x10')][_0x0263('0x1f')](_0x2780e7)[_0x0263('0x14')](function(_0x1a15bc){_0x56b711(null,_0x1a15bc?_0x1a15bc[_0x0263('0x15')]:![]);})[_0x0263('0x18')](function(_0x3ef70f){_0x56b711(_0x3ef70f);});};AGIVertices[_0x0263('0x12')][_0x0263('0x20')]=function(_0x333184,_0x121f50){var _0xfa4cac=this;this[_0x0263('0x10')]['getSoundById'](_0x333184)['then'](function(_0x1c331d){_0x121f50(null,_0x1c331d?_0xfa4cac[_0x0263('0x21')](_0x1c331d[_0x0263('0x22')]):![]);})[_0x0263('0x18')](function(_0x3503cb){_0x121f50(_0x3503cb);});};AGIVertices[_0x0263('0x12')][_0x0263('0x23')]=function(_0x2033ca,_0x273d6f){this[_0x0263('0x10')][_0x0263('0x24')](_0x2033ca)[_0x0263('0x14')](function(_0x1e5e8d){_0x273d6f(null,_0x1e5e8d?_0x1e5e8d:![]);})['catch'](function(_0xf89366){_0x273d6f(_0xf89366);});};AGIVertices[_0x0263('0x12')][_0x0263('0x25')]=function(_0x5ac282,_0x313591,_0x5681ae){this['mailRpc'][_0x0263('0x25')](_0x5ac282,_0x313591)[_0x0263('0x14')](function(){_0x5681ae(null);})[_0x0263('0x18')](function(_0x22db35){_0x5681ae(_0x22db35);});};AGIVertices[_0x0263('0x12')]['getIntervals']=function(_0x5a8f65,_0x4c3e04){this[_0x0263('0x10')]['getIntervalById'](_0x5a8f65)[_0x0263('0x14')](function(_0x106cee){if(_0x106cee){if(_0x106cee['IntervalId']){_0x4c3e04(null,[_0x106cee['interval']]);}else{_0x4c3e04(null,_[_0x0263('0x26')](_0x106cee[_0x0263('0x27')],_0x0263('0x28')));}}else{_0x4c3e04(null,![]);}})[_0x0263('0x18')](function(_0x1ba13f){_0x4c3e04(_0x1ba13f);});};AGIVertices[_0x0263('0x12')][_0x0263('0x21')]=function(_0x3100b0){return util[_0x0263('0x29')](_0x0263('0x2a'),FILES_PATH,_0x3100b0);};AGIVertices[_0x0263('0x12')][_0x0263('0x2b')]=function(_0x187bae,_0x355f81,_0x2964bd){odbc[_0x0263('0x2c')](_0x187bae,function(_0x49d0b8){if(_0x49d0b8){logger[_0x0263('0x2d')](_0x0263('0x2e'),_0x49d0b8);_0x2964bd(_0x49d0b8);}else{logger[_0x0263('0x2f')](_0x0263('0x30'));odbc[_0x0263('0x31')](_0x355f81,function(_0x364650,_0xaf738c){if(_0x364650){logger['info'](_0x0263('0x32'),_0x355f81);_0x2964bd(_0x364650);}else{logger[_0x0263('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x355f81);odbc[_0x0263('0x33')](function(_0x4cd7f9){if(_0x4cd7f9){logger[_0x0263('0x2d')](_0x0263('0x34'),_0x4cd7f9);}_0x2964bd(null,_0xaf738c);});}});}});};AGIVertices['prototype'][_0x0263('0x35')]=function(_0x3dee66,_0x277900){this['rpc'][_0x0263('0x36')](_0x3dee66)['then'](function(_0x3532aa){_0x277900(null,_0x3532aa?_0x3532aa:![]);})['catch'](function(_0x3c8043){_0x277900(_0x3c8043);});};AGIVertices['prototype'][_0x0263('0x37')]=function(_0xfefca2,_0x27efd9){this[_0x0263('0x10')][_0x0263('0x37')](_0xfefca2)[_0x0263('0x14')](function(_0x5e18ab){_0x27efd9(null,_0x5e18ab);})['catch'](function(_0x2c51c3){_0x27efd9(_0x2c51c3);});};AGIVertices['prototype'][_0x0263('0x38')]=function(_0x38a8cd,_0x3dac61,_0x23ccd0){this[_0x0263('0x10')][_0x0263('0x38')]({'uniqueid':this[_0x0263('0xf')][_0x0263('0x39')],'node':_0x38a8cd[_0x0263('0x3a')],'application':_0x38a8cd['agicommand'],'data':_0x3dac61||null,'project_name':this[_0x0263('0xf')][_0x0263('0x3b')],'callerid':this[_0x0263('0xf')]['callerid']})['then'](function(_0x3d33cf){if(_0x23ccd0){_0x23ccd0(null,_0x3d33cf);}})['catch'](function(_0x46d21a){if(_0x23ccd0){_0x23ccd0(_0x46d21a);}});};AGIVertices[_0x0263('0x12')][_0x0263('0x3c')]=function(_0x2cf61b,_0x53daec,_0x1112a5,_0x4345b2){this[_0x0263('0x10')][_0x0263('0x3c')]({'uniqueid':this[_0x0263('0xf')]['uniqueid'],'callerid':this[_0x0263('0xf')][_0x0263('0x3d')],'calleridname':this[_0x0263('0xf')][_0x0263('0x3e')],'context':this[_0x0263('0xf')][_0x0263('0x3f')],'extension':this[_0x0263('0xf')][_0x0263('0x40')],'priority':this['channel'][_0x0263('0x41')],'accountcode':this[_0x0263('0xf')][_0x0263('0x42')],'dnid':this[_0x0263('0xf')][_0x0263('0x43')],'projectName':this[_0x0263('0xf')][_0x0263('0x3b')],'saveName':_0x53daec,'filename':_0x2cf61b[_0x0263('0x44')]||_0x53daec,'savePath':_0x1112a5})[_0x0263('0x14')](function(_0x3f061b){_0x4345b2(null,_0x3f061b);})[_0x0263('0x18')](function(_0x3641d7){_0x4345b2(_0x3641d7);});};AGIVertices[_0x0263('0x12')]['createSquareMessage']=function(_0x3b0a43,_0x295faa,_0x15579d,_0x3c8a6e,_0x4cf9c9){this[_0x0263('0x10')][_0x0263('0x45')]({'uniqueid':this['channel']['uniqueid'],'body':_0x3b0a43,'direction':_0x295faa,'providerName':_0x15579d,'providerResponse':_0x3c8a6e})[_0x0263('0x14')](function(_0x19ddef){if(_0x4cf9c9){_0x4cf9c9(null,_0x19ddef);}})[_0x0263('0x18')](function(_0x14b92c){if(_0x4cf9c9){_0x4cf9c9(_0x14b92c);}});};AGIVertices[_0x0263('0x12')]['createCmContact']=function(_0x36b33c,_0xf39c86){this[_0x0263('0x10')][_0x0263('0x46')]({'firstName':_[_0x0263('0x47')](_0x36b33c[_0x0263('0x15')])||_[_0x0263('0x48')](_0x36b33c[_0x0263('0x15')])?_0x0263('0x49')+Math[_0x0263('0x4a')]():_0x36b33c['name'],'lastName':_[_0x0263('0x47')](_0x36b33c[_0x0263('0x4b')])||_['isNil'](_0x36b33c[_0x0263('0x4b')])?null:_0x36b33c[_0x0263('0x4b')],'phone':_0x36b33c[_0x0263('0x4c')],'ListId':_0x36b33c[_0x0263('0x4d')],'scheduledat':_0x36b33c[_0x0263('0x4e')],'callbackUniqueid':this['channel'][_0x0263('0x39')],'tags':_0x0263('0x4f'),'description':_0x0263('0x50')+_0x36b33c[_0x0263('0x4e')][_0x0263('0x51')](),'priority':_0x36b33c[_0x0263('0x52')]})[_0x0263('0x14')](function(_0x1490d6){_0xf39c86(null,_0x1490d6);})[_0x0263('0x18')](function(_0x43acea){_0xf39c86(_0x43acea);});};AGIVertices[_0x0263('0x12')][_0x0263('0x53')]=function(_0x2002d3,_0x2b6ad7){this['rpc']['getPauseById'](_0x2002d3)[_0x0263('0x14')](function(_0x3b51f6){_0x2b6ad7(null,_0x3b51f6?_0x3b51f6[_0x0263('0x15')]:![]);})[_0x0263('0x18')](function(_0x120d2a){_0x2b6ad7(_0x120d2a);});};AGIVertices[_0x0263('0x12')][_0x0263('0x54')]=function(_0x153275,_0x7505ca,_0x393f64){var _0x4f5855={'role':_0x0263('0x55')};_0x4f5855[_0x153275]=this[_0x0263('0xf')]['callerid'];this['rpc'][_0x0263('0x54')](_0x4f5855,_0x7505ca,this[_0x0263('0xf')][_0x0263('0x39')])[_0x0263('0x14')](function(_0x1273db){_0x393f64(null,_[_0x0263('0x48')](_0x1273db)?![]:!![]);})['catch'](function(_0x251299){logger[_0x0263('0x2d')](_0x251299);_0x393f64(null,![]);});};AGIVertices['prototype'][_0x0263('0x56')]=function(_0x196836,_0x129878){var _0x2f045c={'role':_0x0263('0x55')};_0x2f045c[_0x196836]=this[_0x0263('0xf')]['callerid'];this[_0x0263('0x10')][_0x0263('0x56')](_0x2f045c)[_0x0263('0x14')](function(_0x48932e){_0x129878(null,_[_0x0263('0x48')](_0x48932e)?![]:!![]);})[_0x0263('0x18')](function(_0x504647){logger[_0x0263('0x2d')](_0x504647);_0x129878(null,![]);});};AGIVertices[_0x0263('0x12')][_0x0263('0x57')]=function(_0x4ff9ad,_0x362e91){var _0x5dac9b={'role':_0x0263('0x55')};_0x5dac9b[_0x4ff9ad]=this[_0x0263('0xf')][_0x0263('0x3d')];this[_0x0263('0x10')][_0x0263('0x57')](_0x5dac9b)[_0x0263('0x14')](function(_0x43a419){_0x362e91(null,_[_0x0263('0x48')](_0x43a419)?![]:!![]);})[_0x0263('0x18')](function(_0x2f6513){logger[_0x0263('0x2d')](_0x2f6513);_0x362e91(null,![]);});};AGIVertices[_0x0263('0x12')]['agentLogin']=function(_0x56c310,_0x38318d){var _0x4e4cae={'role':_0x0263('0x55')};_0x4e4cae[_0x56c310]=this[_0x0263('0xf')][_0x0263('0x3d')];var _0x18652b=_0x56c310!=_0x0263('0x58')?util[_0x0263('0x29')](_0x0263('0x59'),'LOCAL',this[_0x0263('0xf')][_0x0263('0x3d')]):undefined;this[_0x0263('0x10')][_0x0263('0x5a')](_0x4e4cae,_0x18652b)['then'](function(_0x3f739d){_0x38318d(null,_[_0x0263('0x48')](_0x3f739d)?![]:!![]);})[_0x0263('0x18')](function(_0x42c732){logger[_0x0263('0x2d')](_0x42c732);_0x38318d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x5ebb72,_0x102150){sh[_0x0263('0x5b')](_['trim'](_0x5ebb72),function(_0x11d524,_0x50b405){var _0x5e801f=_0x50b405[_0x0263('0x5c')](/(\r\n|\n|\r)/gm,'');_0x102150(null,_0x5e801f);});};AGIVertices[_0x0263('0x12')][_0x0263('0x5d')]=function(_0x1106f2,_0x2cba3c){scripts[_0x0263('0x5d')](_0x1106f2[_0x0263('0x5e')],_0x1106f2['google_cloud_tts_text_type']||'text',_0x1106f2['text'],_0x1106f2['languageCode']||'en-US',_0x1106f2['ssmlGender']||_0x0263('0x5f'),_0x1106f2[_0x0263('0x60')]||'MP3')[_0x0263('0x14')](function(_0x448096){_0x2cba3c(null,_0x448096);})[_0x0263('0x18')](function(_0x3c4f10){_0x2cba3c(_0x3c4f10);});};AGIVertices[_0x0263('0x12')][_0x0263('0x61')]=function(_0xf06b9b,_0x5f5d1e){scripts['googleTTS'](_0xf06b9b[_0x0263('0x62')],_0xf06b9b[_0x0263('0x63')]||'en',0x1)[_0x0263('0x14')](function(_0x8fa576){_0x5f5d1e(null,_0x8fa576);})[_0x0263('0x18')](function(_0x38e7e2){_0x5f5d1e(_0x38e7e2);});};AGIVertices[_0x0263('0x12')]['restAPI']=function(_0x58b1bb,_0x7afb2c){var _0x4ee045={'uri':_0x58b1bb[_0x0263('0x64')],'method':_0x58b1bb[_0x0263('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x58b1bb[_0x0263('0x66')])==='number'&&parseInt(_0x58b1bb['timeout'])>=0x1?parseInt(_0x58b1bb['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0263('0x67')]([_0x0263('0x68'),_0x0263('0x69')],_0x4ee045[_0x0263('0x65')][_0x0263('0x6a')]())){try{_0x4ee045[_0x0263('0x6b')]=_0x58b1bb[_0x0263('0xb')]?JSON[_0x0263('0x6c')](_0x58b1bb[_0x0263('0xb')]):{};}catch(_0x2eacbe){logger[_0x0263('0x2d')](_0x0263('0x6d'),_0x2eacbe);}}try{_0x4ee045['headers']=_0x58b1bb[_0x0263('0x6e')]?JSON[_0x0263('0x6c')](_0x58b1bb[_0x0263('0x6e')]):{};}catch(_0x264790){logger[_0x0263('0x2d')](_0x0263('0x6f'),_0x264790);}if(_0x58b1bb[_0x0263('0x70')]){try{var _0x28bd24=require(_0x58b1bb[_0x0263('0x70')])['sync'](this,_0x4ee045);_0x4ee045[_0x0263('0x71')]=Mustache['render'](_0x58b1bb['url'],_0x28bd24,{},['$$','$$']);if(_0x4ee045[_0x0263('0x72')]){_0x4ee045[_0x0263('0x72')]=JSON['parse'](Mustache[_0x0263('0x73')](JSON['stringify'](_0x4ee045[_0x0263('0x72')]),_0x28bd24,{},['$$','$$']));}if(_0x4ee045[_0x0263('0x6b')]){_0x4ee045[_0x0263('0x6b')]=JSON[_0x0263('0x6c')](Mustache[_0x0263('0x73')](JSON['stringify'](_0x4ee045[_0x0263('0x6b')]),_0x28bd24,{},['$$','$$']));}}catch(_0x50ade2){logger['error'](_0x0263('0x74'),_0x50ade2);}}rp(_0x4ee045)[_0x0263('0x14')](function(_0x13e52f){var _0x4b620c={'statusCode':_0x13e52f[_0x0263('0x75')]||0xc8,'statusMessage':_0x13e52f['statusMessage']||'OK','headers':_0x13e52f[_0x0263('0x72')]||{},'body':_0x13e52f['body']||{}};_0x7afb2c(null,_0x4b620c);})[_0x0263('0x18')](function(_0x255885){var _0x10b647={'statusCode':_0x255885[_0x0263('0x75')]||0x1f4,'statusMessage':_0x255885[_0x0263('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x255885[_0x0263('0x77')][_0x0263('0x72')]||{},'body':_0x255885[_0x0263('0x77')][_0x0263('0x6b')]||{}};_0x7afb2c(null,_0x10b647);});};AGIVertices['prototype'][_0x0263('0x78')]=function(_0x2d74da,_0x2fbcfd){scripts[_0x0263('0x78')](this[_0x0263('0xf')][_0x0263('0x39')],_0x2d74da[_0x0263('0x79')],_0x2d74da[_0x0263('0x62')],_0x2d74da[_0x0263('0x7a')]||'en')[_0x0263('0x14')](function(_0x4c396b){_0x2fbcfd(null,_0x4c396b);})['catch'](function(_0x6ecd71){_0x2fbcfd(_0x6ecd71);});};AGIVertices[_0x0263('0x12')][_0x0263('0x7b')]=function(_0x421749,_0x1687ed){scripts[_0x0263('0x7b')](this[_0x0263('0xf')][_0x0263('0x39')],_0x421749[_0x0263('0x7c')],_0x421749['client_email'],_0x421749['private_key'],_0x421749['text'],_0x421749[_0x0263('0x7d')]||'en')[_0x0263('0x14')](function(_0x3da9f6){_0x1687ed(null,_0x3da9f6);})[_0x0263('0x18')](function(_0x5ffb81){_0x1687ed(_0x5ffb81);});};AGIVertices['prototype'][_0x0263('0x7e')]=function(_0x195cfc,_0x25de7a){scripts[_0x0263('0x7e')](this[_0x0263('0xf')],_0x195cfc)['then'](function(_0x222401){_0x25de7a(null,_0x222401);})[_0x0263('0x18')](function(_0xed8e5e){_0x25de7a(_0xed8e5e);});};AGIVertices[_0x0263('0x12')]['ispeechTTS']=function(_0x2b2d0b,_0x286813){scripts['ispeechTTS'](_0x2b2d0b[_0x0263('0x79')],_0x2b2d0b['text'],_0x2b2d0b[_0x0263('0x7f')]||'en-US',_0x2b2d0b['speed'])[_0x0263('0x14')](function(_0x5aebe5){_0x286813(null,_0x5aebe5);})[_0x0263('0x18')](function(_0x504e9b){_0x286813(_0x504e9b);});};AGIVertices[_0x0263('0x12')][_0x0263('0x80')]=function(_0x108abc,_0x3bf196,_0x47c23b){scripts['ispeechASR'](_0x3bf196,_0x108abc[_0x0263('0x79')],_0x108abc[_0x0263('0x81')]||_0x0263('0x82'),this['isConfigured'](_0x108abc[_0x0263('0x83')])?_0x108abc[_0x0263('0x83')]:undefined)[_0x0263('0x14')](function(_0x294fc1){_0x47c23b(null,_0x294fc1);})[_0x0263('0x18')](function(_0x29c4b7){_0x47c23b(_0x29c4b7);});};AGIVertices['prototype'][_0x0263('0x84')]=function(_0x2b87db,_0x3da2de){scripts[_0x0263('0x84')](_0x2b87db[_0x0263('0x85')],_0x2b87db['aws_secret_access_key'],_0x2b87db[_0x0263('0x86')],_0x2b87db[_0x0263('0x87')]||_0x0263('0x88'),_0x2b87db[_0x0263('0x62')],_0x2b87db[_0x0263('0x89')]||'text')['then'](function(_0x37c77c){_0x3da2de(null,_0x37c77c);})[_0x0263('0x18')](function(_0x56fcfb){_0x3da2de(_0x56fcfb);});};AGIVertices['prototype'][_0x0263('0x8a')]=function(_0x453397,_0x7342b){scripts[_0x0263('0x8a')](this[_0x0263('0xf')]['uniqueid'],_0x453397['aws_access_key_id'],_0x453397['aws_secret_access_key'],_0x453397[_0x0263('0x8b')],_0x453397['text'],_0x453397[_0x0263('0x8c')])[_0x0263('0x14')](function(_0x2bffc6){_0x7342b(null,_0x2bffc6);})[_0x0263('0x18')](function(_0x11f0f5){_0x7342b(_0x11f0f5);});};AGIVertices[_0x0263('0x12')][_0x0263('0x8d')]=function(_0x47d8c4,_0x5490ed,_0x1885d0){scripts[_0x0263('0x8d')](_0x5490ed,_0x47d8c4[_0x0263('0x79')],_0x47d8c4['google_asr_language']||'en-US')['then'](function(_0x8f27aa){_0x1885d0(null,_0x8f27aa);})[_0x0263('0x18')](function(_0x5cab80){_0x1885d0(_0x5cab80);});};AGIVertices[_0x0263('0x12')]['tildeASR']=function(_0x526465,_0x5d8e16,_0x5f1d11){scripts[_0x0263('0x8e')](_0x5d8e16,_0x526465['appid'],_0x526465[_0x0263('0x8f')],_0x526465['uri'])['then'](function(_0xb2767a){_0x5f1d11(null,_0xb2767a);})['catch'](function(_0x13429c){_0x5f1d11(_0x13429c);});};AGIVertices[_0x0263('0x12')][_0x0263('0x90')]=function(_0x3c19a2){var _0x3d2556=_[_0x0263('0x67')](verticesWithRetry,_0x3c19a2[_0x0263('0x91')])?_0x3c19a2:_[_0x0263('0x92')](_0x3c19a2);for(var _0x341574 in _0x3d2556){if(_0x3d2556[_0x0263('0x93')](_0x341574)){if(_0x3d2556[_0x341574]&&_[_0x0263('0x94')](_0x3d2556[_0x341574])){if(_[_0x0263('0x67')](recursiveMapAttributes,_0x341574)){_0x3d2556[_0x341574]=this[_0x0263('0x95')](_0x3d2556[_0x341574]);}else{_0x3d2556[_0x341574]=this[_0x0263('0x96')](_0x3d2556[_0x341574]);}}}}return _0x3d2556;};AGIVertices[_0x0263('0x12')][_0x0263('0x97')]=function(_0xc98da3){for(var _0x8065e5 in _0xc98da3){if(_0xc98da3[_0x0263('0x93')](_0x8065e5)){if(_[_0x0263('0x98')](_0xc98da3[_0x8065e5])){this[_0x0263('0x97')](_0xc98da3[_0x8065e5]);}else if(_[_0x0263('0x99')](_0xc98da3[_0x8065e5])){for(var _0xf776ed=0x0;_0xf776ed<_0xc98da3[_0x8065e5][_0x0263('0x9a')];_0xf776ed++){this[_0x0263('0x97')](_0xc98da3[_0x8065e5][_0xf776ed]);}}else if(_[_0x0263('0x94')](_0xc98da3[_0x8065e5])){_0xc98da3[_0x8065e5]=this[_0x0263('0x96')](_0xc98da3[_0x8065e5]);}}}};AGIVertices[_0x0263('0x12')][_0x0263('0x9b')]=function(_0xeb9839,_0xc70f27){for(var _0x3546e2 in _0xeb9839){if(_0xeb9839['hasOwnProperty'](_0x3546e2)){if(_[_0x0263('0x98')](_0xeb9839[_0x3546e2])){if(!_[_0x0263('0x47')](_0xeb9839[_0x3546e2])){this[_0x0263('0x9b')](_0xeb9839[_0x3546e2],util[_0x0263('0x29')](_0x0263('0x9c'),_0xc70f27,_0x3546e2));}}else if(_[_0x0263('0x99')](_0xeb9839[_0x3546e2])){for(var _0x5e5688=0x0;_0x5e5688<_0xeb9839[_0x3546e2][_0x0263('0x9a')];_0x5e5688++){this[_0x0263('0x9b')](_0xeb9839[_0x3546e2][_0x5e5688],util[_0x0263('0x29')](_0x0263('0x9c'),_0xc70f27,_0x3546e2+'['+_0x5e5688+']'));}}else{if(!_[_0x0263('0x48')](_0xeb9839[_0x3546e2])){this['channel']['setVariable'](util[_0x0263('0x29')](_0x0263('0x9c'),_0xc70f27,_0x3546e2),_0xeb9839[_0x3546e2]);}}}}};AGIVertices[_0x0263('0x12')][_0x0263('0x95')]=function(_0x2c10fe){try{var _0x3e9554=JSON[_0x0263('0x6c')](_0x2c10fe);this['recursiveNodeIndex'](_0x3e9554);return JSON[_0x0263('0x9d')](_0x3e9554);}catch(_0x26cb7d){return this[_0x0263('0x96')](_0x2c10fe);}};AGIVertices['prototype'][_0x0263('0x96')]=function(_0x581121){var _0x5638ec=_0x581121['split']('{');for(var _0x29e17e=0x1;_0x29e17e<_0x5638ec[_0x0263('0x9a')];_0x29e17e+=0x1){var _0x54ecf5=_0x5638ec[_0x29e17e][_0x0263('0x9e')]('}');if(_0x54ecf5['length']>0x1){_0x581121=_0x581121[_0x0263('0x9f')]('{'+_0x54ecf5[0x0]+'}',this[_0x0263('0xf')][_0x0263('0xa0')](_0x54ecf5[0x0])[_0x0263('0xa1')]||_0x54ecf5[0x0]);}}if(_0x5638ec['length']===0x1){return _0x581121[_0x0263('0x51')]();}return this[_0x0263('0x96')](_0x581121);};AGIVertices['prototype']['getAndSetVariable']=function(_0x38959b,_0x375828){var _0x4f096e=this['channel'][_0x0263('0xa0')](_0x38959b);if(_0x4f096e[_0x0263('0xa2')]===-0x1){return _0x4f096e;}logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xa3'),_0x375828,_0x4f096e[_0x0263('0xa1')]));return this['channel'][_0x0263('0xa4')](_0x375828,_0x4f096e[_0x0263('0xa1')]);};AGIVertices[_0x0263('0x12')][_0x0263('0xa5')]=function(_0x17ab43){return _0x17ab43&&_0x17ab43!=='0'&&_0x17ab43!=='-1'&&_0x17ab43!=='';};AGIVertices[_0x0263('0x12')][_0x0263('0xa6')]=function(_0x41bd98){this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x41bd98,'-');_0x41bd98['retry']=_0x41bd98[_0x0263('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0263('0x12')][_0x0263('0xa8')]=function(_0x5721b3){logger['info'](util['format'](_0x0263('0xa9'),_0x5721b3[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x5721b3[_0x0263('0x62')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xab'));}var _0x5432db='\x22'+_0x5721b3[_0x0263('0x62')]+'\x22';if(this['isConfigured'](_0x5721b3['options'])){_0x5432db+=','+_0x5721b3[_0x0263('0x77')];}var _0x145674=this[_0x0263('0xf')][_0x0263('0x5b')](_0x0263('0xac'),_0x5432db);if(_0x145674[_0x0263('0xa2')]===-0x1){return _0x145674;}return this['channel']['noop'](util[_0x0263('0x29')](_0x0263('0xad'),_0x5432db));};AGIVertices['prototype'][_0x0263('0xae')]=function(_0x287c8e){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xaf'),_0x287c8e[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x287c8e['grammar'])){return this['channel'][_0x0263('0xaa')](_0x0263('0xb0'));}var _0xeacc96=_0x287c8e['grammar'];if(this[_0x0263('0xa5')](_0x287c8e['options'])){_0xeacc96+=','+_0x287c8e['options'];}var _0x2187a5=this['channel'][_0x0263('0x5b')]('MRCPRecog',_0xeacc96);if(_0x2187a5[_0x0263('0xa2')]===-0x1){return _0x2187a5;}var _0x1643f3=this[_0x0263('0xb1')]('RECOG_CONFIDENCE()',_0x0263('0xb2'));if(_0x1643f3[_0x0263('0xa2')]===-0x1){return _0x1643f3;}var _0x41e580=this['getAndSetVariable'](_0x0263('0xb3'),_0x0263('0xb4'));if(_0x41e580['result']===-0x1){return _0x41e580;}var _0x5e7389=this['getAndSetVariable'](_0x0263('0xb5'),'MRCP_RECOG_INSTANCE');if(_0x5e7389[_0x0263('0xa2')]===-0x1){return _0x5e7389;}return this[_0x0263('0xf')][_0x0263('0xaa')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0xeacc96));};AGIVertices[_0x0263('0x12')]['agi']=function(_0x25ebd8){logger['info'](util[_0x0263('0x29')](_0x0263('0xb6'),_0x25ebd8[_0x0263('0x3a')]));return this['channel'][_0x0263('0x8')]([_0x25ebd8[_0x0263('0xb7')],_0x25ebd8[_0x0263('0xb8')]]);};AGIVertices[_0x0263('0x12')]['answer']=function(_0xb4825){logger['info'](util['format'](_0x0263('0xb9'),_0xb4825['label']));if(this[_0x0263('0xa5')](_0xb4825[_0x0263('0x66')])){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xba'),_0xb4825['timeout']));var _0xa901e5=this[_0x0263('0xf')]['wait'](_0xb4825[_0x0263('0x66')]);if(_0xa901e5[_0x0263('0xa2')]===-0x1){return _0xa901e5;}}return this['channel'][_0x0263('0xbb')]();};AGIVertices[_0x0263('0x12')][_0x0263('0x4f')]=function(_0x1def91){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xbc'),_0x1def91[_0x0263('0x3a')]));if(!this['isConfigured'](_0x1def91[_0x0263('0x4d')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x1def91,_0x0263('0xbd'));}_0x1def91[_0x0263('0x4e')]=moment();if(this[_0x0263('0xa5')](_0x1def91['delay'])){_0x1def91['scheduledAt']=moment()[_0x0263('0xbe')](_0x1def91[_0x0263('0xbf')],_0x0263('0xc0'));}if(!this[_0x0263('0xa5')](_0x1def91['callback_priority'])){_0x1def91[_0x0263('0x52')]=0x2;}this[_0x0263('0x46')][_0x0263('0xa7')](this,_0x1def91);return this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0xc1'),_0x1def91[_0x0263('0x4c')],_0x1def91[_0x0263('0x4d')],_0x1def91[_0x0263('0x4e')]));};AGIVertices[_0x0263('0x12')][_0x0263('0xc2')]=function(_0x1c7e40){logger['info'](util['format'](_0x0263('0xc3'),_0x1c7e40[_0x0263('0x3a')]));var _0x5131b0=this[_0x0263('0xf')][_0x0263('0x5b')](_0x1c7e40['application'],_0x1c7e40[_0x0263('0x77')]);if(_0x5131b0['result']===-0x1){return _0x5131b0;}return this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0xc4'),_0x1c7e40[_0x0263('0xc5')],_0x1c7e40[_0x0263('0x77')]));};AGIVertices[_0x0263('0x12')][_0x0263('0xc6')]=function(_0x2bccc2){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2bccc2['label']));if(!this[_0x0263('0xa5')](_0x2bccc2['text'])){return this['channel'][_0x0263('0xaa')](_0x0263('0xab'));}var _0x18421a='\x22'+_0x2bccc2[_0x0263('0x62')]+'\x22';if(this[_0x0263('0xa5')](_0x2bccc2['options'])){_0x18421a+=','+_0x2bccc2[_0x0263('0x77')];}var _0x538a36=this[_0x0263('0xf')]['exec'](_0x0263('0xac'),_0x18421a);if(_0x538a36['result']===-0x1){return _0x538a36;}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xad'),_0x18421a));};AGIVertices[_0x0263('0x12')][_0x0263('0xc7')]=function(_0x28e703){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xc8'),_0x28e703[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x28e703[_0x0263('0x62')])){return this[_0x0263('0xf')]['noop'](_0x0263('0xab'));}var _0x12d662='\x22'+_0x28e703[_0x0263('0x62')]+'\x22';if(this[_0x0263('0xa5')](_0x28e703[_0x0263('0x77')])){_0x12d662+=','+_0x28e703[_0x0263('0x77')];}var _0x35aee2=this[_0x0263('0xf')]['exec'](_0x0263('0xac'),_0x12d662);if(_0x35aee2[_0x0263('0xa2')]===-0x1){return _0x35aee2;}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x12d662));};AGIVertices[_0x0263('0x12')]['lumenvoxasr']=function(_0x56b8aa){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x56b8aa[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x56b8aa[_0x0263('0xc9')])){return this['channel'][_0x0263('0xaa')](_0x0263('0xb0'));}var _0x12d3d8=_0x56b8aa[_0x0263('0xc9')];if(this['isConfigured'](_0x56b8aa[_0x0263('0x77')])){_0x12d3d8+=','+_0x56b8aa[_0x0263('0x77')];}var _0x14fae0=this[_0x0263('0xf')][_0x0263('0x5b')](_0x0263('0xca'),_0x12d3d8);if(_0x14fae0[_0x0263('0xa2')]===-0x1){return _0x14fae0;}var _0xc389c1=this['getAndSetVariable'](_0x0263('0xcb'),_0x0263('0xcc'));if(_0xc389c1[_0x0263('0xa2')]===-0x1){return _0xc389c1;}var _0x4df10e=this[_0x0263('0xb1')]('RECOG_INPUT()',_0x0263('0xcd'));if(_0x4df10e[_0x0263('0xa2')]===-0x1){return _0x4df10e;}var _0x55cb00=this[_0x0263('0xb1')](_0x0263('0xb5'),_0x0263('0xce'));if(_0x55cb00['result']===-0x1){return _0x55cb00;}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xcf'),_0x12d3d8));};AGIVertices[_0x0263('0x12')][_0x0263('0xd0')]=function(_0x4b04cf){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xd1'),_0x4b04cf[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x4b04cf['grammar'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xb0'));}var _0x579ffd=_0x4b04cf['grammar'];if(this[_0x0263('0xa5')](_0x4b04cf['options'])){_0x579ffd+=','+_0x4b04cf[_0x0263('0x77')];}var _0x43a6cd=this['channel']['exec']('MRCPRecog',_0x579ffd);if(_0x43a6cd['result']===-0x1){return _0x43a6cd;}var _0x46fe57=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0263('0xd2'));if(_0x46fe57['result']===-0x1){return _0x46fe57;}var _0x3e60f2=this[_0x0263('0xb1')](_0x0263('0xb3'),_0x0263('0xd3'));if(_0x3e60f2[_0x0263('0xa2')]===-0x1){return _0x3e60f2;}var _0x5907a9=this['getAndSetVariable'](_0x0263('0xb5'),'SESTEK_ASR_INSTANCE');if(_0x5907a9[_0x0263('0xa2')]===-0x1){return _0x5907a9;}return this['channel'][_0x0263('0xaa')](util['format'](_0x0263('0xcf'),_0x579ffd));};AGIVertices[_0x0263('0x12')][_0x0263('0xd4')]=function(_0x449983){logger['info'](util[_0x0263('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x449983['label']));if(!this[_0x0263('0xa5')](_0x449983[_0x0263('0xd5')])){return this['channel']['error'](_0x449983,_0x0263('0xd6'));}var _0xd501c1=this[_0x0263('0x19')][_0x0263('0xa7')](this,_0x449983[_0x0263('0xd5')]);if(!_0xd501c1){return this[_0x0263('0xf')]['error'](_0x449983,'no\x20odbc\x20database\x20found');}if(!this[_0x0263('0xa5')](_0x449983[_0x0263('0x31')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x449983,_0x0263('0xd7'));}var _0x562a9f=_0x449983['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('query:\x20%s',_0x562a9f));var _0x25fac0=this[_0x0263('0x2b')][_0x0263('0xa7')](this,_0xd501c1,_0x562a9f);this[_0x0263('0x38')]['sync'](this,_0x449983,_0x562a9f);if(!this[_0x0263('0xa5')](_0x449983[_0x0263('0xd8')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xd9'));}var _0x414573=this['getVariable']['sync'](this,_0x449983[_0x0263('0xd8')]);if(!_0x414573){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x449983,_0x0263('0xda'));}var _0x4d6e12=this;_0x25fac0['forEach'](function(_0x1ab540,_0xd1f3c0){Object[_0x0263('0xdb')](_0x1ab540)[_0x0263('0xdc')](function(_0x12fa07){_0x4d6e12[_0x0263('0xf')]['setVariable'](util[_0x0263('0x29')](_0x0263('0xdd'),_0x414573,_0xd1f3c0,_0x12fa07),_0x1ab540[_0x12fa07]);});});this[_0x0263('0xf')][_0x0263('0xa4')](util[_0x0263('0x29')](_0x0263('0xde'),_0x414573),_0x25fac0[_0x0263('0x9a')]);return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xdf'),_0x414573));};AGIVertices['prototype'][_0x0263('0xe0')]=function(_0xe09875){logger['debug'](util[_0x0263('0x29')](_0x0263('0xe1'),_0xe09875['label']));if(!this[_0x0263('0xa5')](_0xe09875[_0x0263('0xe2')])){return this['channel'][_0x0263('0x2d')](_0xe09875,_0x0263('0xe3'));}var _0x5ca2ca=this['getUser'][_0x0263('0xa7')](this,_0xe09875['sip_id']);if(!_0x5ca2ca){return this[_0x0263('0xf')][_0x0263('0x2d')](_0xe09875,_0x0263('0xe4'));}var _0x291f88=this['channel']['exec'](_0x0263('0xe5'),[util['format']('SIP/%s',_0x5ca2ca),_0xe09875[_0x0263('0x66')],_0xe09875[_0x0263('0xe6')],_0xe09875[_0x0263('0x64')]]);if(_0x291f88[_0x0263('0xa2')]===-0x1){return _0x291f88;}return this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0xe7'),_0x0263('0xe5')));};AGIVertices[_0x0263('0x12')][_0x0263('0xe8')]=function(_0x56ed04){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xe9'),_0x56ed04[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x56ed04['key'])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x56ed04[_0x0263('0x62')])){return this[_0x0263('0xf')]['noop'](_0x0263('0xab'));}this[_0x0263('0xf')]['bot']=!![];this[_0x0263('0x38')](_0x56ed04);this[_0x0263('0x45')](_0x56ed04['text'],'in','','');this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0xea'),_0x56ed04[_0x0263('0x62')]));var _0x47dd91=this['googleDialogflow'][_0x0263('0xa7')](this,_0x56ed04);if(_0x47dd91){for(var _0x464a62 in _0x47dd91){if(_0x47dd91[_0x0263('0x93')](_0x464a62)){this[_0x0263('0xf')][_0x0263('0xa4')](util['format'](_0x0263('0xeb'),_0x464a62[_0x0263('0x6a')]()),_0x47dd91[_0x464a62]);}}this[_0x0263('0x45')](_0x47dd91[_0x0263('0xec')],_0x0263('0xed'),_0x0263('0xe8'),'');return this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')]('Dialogflow\x20Result\x20%s',_0x47dd91['speech']));}return this[_0x0263('0xf')][_0x0263('0x2d')](_0x56ed04,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x0263('0x12')][_0x0263('0xee')]=function(_0x466cdb){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0xef'),_0x466cdb[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x466cdb['dialogflowV2_project_id'])){return this['channel'][_0x0263('0xaa')]('no\x20project_id\x20configured');}if(!this[_0x0263('0xa5')](_0x466cdb[_0x0263('0xf0')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xf1'));}if(!this[_0x0263('0xa5')](_0x466cdb[_0x0263('0xf2')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xf3'));}if(!this[_0x0263('0xa5')](_0x466cdb[_0x0263('0x7d')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xf4'));}if(!this[_0x0263('0xa5')](_0x466cdb[_0x0263('0x62')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xab'));}this[_0x0263('0xf')][_0x0263('0xf5')]=!![];this[_0x0263('0x38')](_0x466cdb);this[_0x0263('0x45')](_0x466cdb[_0x0263('0x62')],'in','','');this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xf6'),_0x466cdb['text']));var _0x194578=this[_0x0263('0x7b')][_0x0263('0xa7')](this,_0x466cdb);if(_0x194578){for(var _0x2fe279 in _0x194578){if(_0x194578['hasOwnProperty'](_0x2fe279)){if(_0x2fe279!==_0x0263('0xf7')){this[_0x0263('0xf')][_0x0263('0xa4')](util['format'](_0x0263('0xeb'),_0x2fe279[_0x0263('0x6a')]()),_0x194578[_0x2fe279]);}}}this[_0x0263('0x45')](_0x194578['speech'],_0x0263('0xed'),_0x0263('0xee'),_0x194578[_0x0263('0xf7')]);return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xf8'),_0x194578[_0x0263('0xec')]));}return this[_0x0263('0xf')]['error'](_0x466cdb,_0x0263('0xf9'));};AGIVertices[_0x0263('0x12')]['sesteknda']=function(_0x5bfdd8){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5bfdd8[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x5bfdd8[_0x0263('0xfa')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xfb'));}if(!this['isConfigured'](_0x5bfdd8[_0x0263('0xfc')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x5bfdd8['password'])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x5bfdd8[_0x0263('0xfd')])){return this[_0x0263('0xf')]['noop'](_0x0263('0xab'));}this[_0x0263('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x5bfdd8);this['createSquareMessage'](_0x5bfdd8[_0x0263('0x62')],'in','','');this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('Trying\x20SestekNDA:\x20%s',_0x5bfdd8[_0x0263('0x62')]));var _0x4bb24e=this['sestekNDA'][_0x0263('0xa7')](this,_0x5bfdd8);if(_0x4bb24e){for(var _0x23307a in _0x4bb24e){if(_0x4bb24e[_0x0263('0x93')](_0x23307a)){this['channel'][_0x0263('0xa4')](util[_0x0263('0x29')]('SESTEK_NDA_%s',_0x23307a[_0x0263('0x6a')]()),_0x4bb24e[_0x23307a]);}}this['createSquareMessage'](_0x4bb24e[_0x0263('0xec')],_0x0263('0xed'),'sesteknda','');if(_0x4bb24e[_0x0263('0xfe')]){this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0xff'),_0x4bb24e[_0x0263('0xfe')]));var _0x34fcce=this['channel'][_0x0263('0x100')](_0x4bb24e[_0x0263('0xfe')]);try{fs[_0x0263('0x101')](_0x4bb24e[_0x0263('0xfe')]+_0x0263('0x102'));}catch(_0x32f30b){logger[_0x0263('0x2d')](_0x32f30b);}return _0x34fcce;}else{return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x103'),_0x4bb24e[_0x0263('0xec')]));}}return this[_0x0263('0xf')][_0x0263('0x2d')](_0x5bfdd8,_0x0263('0x104'));};AGIVertices[_0x0263('0x12')][_0x0263('0x105')]=function(_0xd7ad87){logger[_0x0263('0x2f')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0xd7ad87[_0x0263('0x3a')]));return this['channel']['noop'](_0x0263('0x105'));};AGIVertices[_0x0263('0x12')][_0x0263('0x106')]=function(_0x2d10a0){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x107'),_0x2d10a0['label']));var _0x4a8c60='';if(_0x2d10a0['trunk_id']){if(!this[_0x0263('0xa5')](_0x2d10a0[_0x0263('0x108')])){return this['channel'][_0x0263('0x2d')](_0x2d10a0,'no\x20trunk\x20selected');}else{var _0x5a79ab=parseInt(_0x2d10a0[_0x0263('0x108')],0xa);if(isNaN(_0x5a79ab)){_0x4a8c60=_0x2d10a0[_0x0263('0x108')];}else{_0x4a8c60=this[_0x0263('0x1e')]['sync'](this,_0x2d10a0[_0x0263('0x108')]);if(!_0x4a8c60){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x2d10a0,_0x0263('0x109'));}}}}else if(_0x2d10a0[_0x0263('0x10a')]){_0x4a8c60=_0x2d10a0['trunk_name'];}else{return this[_0x0263('0xf')]['error'](_0x2d10a0,_0x0263('0x10b'));}var _0x373312=this[_0x0263('0xf')]['exec'](_0x0263('0xe5'),[util[_0x0263('0x29')](_0x0263('0x10c'),_0x4a8c60,_0x2d10a0[_0x0263('0x4c')]),_0x2d10a0['timeout'],_0x2d10a0[_0x0263('0xe6')],_0x2d10a0[_0x0263('0x64')]]);if(_0x373312[_0x0263('0xa2')]===-0x1){return _0x373312;}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xe7'),'DIAL'));};AGIVertices[_0x0263('0x12')][_0x0263('0x10d')]=function(_0x4ed836){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x10e'),_0x4ed836['label']));return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x10d'));};AGIVertices['prototype'][_0x0263('0xd')]=function(_0x53acb7){logger[_0x0263('0x2f')](util['format'](_0x0263('0x10f'),_0x53acb7[_0x0263('0x3a')]));if(_0x53acb7[_0x0263('0x110')]===0x0){return this[_0x0263('0xa6')](_0x53acb7);}_0x53acb7[_0x0263('0x110')]-=0x1;if(!this[_0x0263('0xa5')](_0x53acb7[_0x0263('0x111')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x53acb7,_0x0263('0x112'));}var _0x340d0e=this[_0x0263('0x20')][_0x0263('0xa7')](this,_0x53acb7[_0x0263('0x111')]);if(!_0x340d0e){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x53acb7,_0x0263('0x113'));}if(!this[_0x0263('0xa5')](_0x53acb7[_0x0263('0xd8')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x0263('0xd9'));}var _0x34e7f3=this['channel']['getData'](_0x340d0e,_0x53acb7['response'],_0x53acb7[_0x0263('0x114')]);var _0x5a57f2=_0x34e7f3[_0x0263('0xa2')]?_0x34e7f3[_0x0263('0xa2')]['toString']():'';logger[_0x0263('0x2f')](_0x0263('0x115'),JSON[_0x0263('0x9d')](_0x34e7f3));if(_0x34e7f3['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x53acb7,_0x5a57f2);return _0x34e7f3;}else if(_0x34e7f3[_0x0263('0xa1')]===_0x0263('0x66')){_0x34e7f3[_0x0263('0xa2')]=_0x5a57f2[_0x0263('0x9a')]>=parseInt(_0x53acb7[_0x0263('0x116')])?'x':'i';}else{_0x34e7f3[_0x0263('0xa2')]=_0x5a57f2[_0x0263('0x9a')]>=parseInt(_0x53acb7['mindigit'])&&_0x5a57f2[_0x0263('0x9a')]<=parseInt(_0x53acb7['maxdigit'])?'x':'i';}var _0x2bfa97=this[_0x0263('0xa0')]['sync'](this,_0x53acb7[_0x0263('0xd8')]);if(!_0x2bfa97){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x53acb7,'no\x20variable\x20found');}this[_0x0263('0xf')][_0x0263('0xa4')](_0x2bfa97,_0x5a57f2);if(this[_0x0263('0xa5')](_0x53acb7[_0x0263('0x117')])){var _0xcce7e1=parseInt(_0x53acb7[_0x0263('0x117')],0xa);var _0x3003ae=rs['generate']({'charset':'*','length':_0xcce7e1});var _0x4cd5f3=_0x5a57f2[_0x0263('0x9a')];if(_0x4cd5f3>0x0){if(_0x4cd5f3>_0xcce7e1){this[_0x0263('0x38')]['sync'](this,_0x53acb7,_0x53acb7['hiddendigitspos']==='first'?_0x3003ae+_0x5a57f2[_0x0263('0x118')](_0xcce7e1):_0x5a57f2[_0x0263('0x118')](0x0,_0x4cd5f3-_0xcce7e1)+_0x3003ae);}else{this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x53acb7,rs[_0x0263('0x119')]({'charset':'*','length':_0x4cd5f3}));}}else{this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x53acb7,'');}}else{this[_0x0263('0x38')]['sync'](this,_0x53acb7,_0x5a57f2);}return _0x34e7f3;};AGIVertices[_0x0263('0x12')][_0x0263('0xe')]=function(_0x2dd9db){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x11a'),_0x2dd9db[_0x0263('0x3a')]));return this[_0x0263('0xd')](_0x2dd9db);};AGIVertices[_0x0263('0x12')][_0x0263('0x11b')]=function(_0x2f2720){logger[_0x0263('0x2f')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x2f2720[_0x0263('0x3a')]));this['createSquareDetailsReport'][_0x0263('0xa7')](this,_0x2f2720,_0x2f2720['goalname']);return this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x11c'),_0x2f2720[_0x0263('0x11d')]));};AGIVertices[_0x0263('0x12')][_0x0263('0x11e')]=function(_0x349458){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x11f'),_0x349458[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x349458[_0x0263('0x85')])||!this[_0x0263('0xa5')](_0x349458[_0x0263('0x120')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0263('0xa5')](_0x349458[_0x0263('0x62')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xab'));}this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0x121'),_0x349458[_0x0263('0x62')]));var _0x1b69f4=this[_0x0263('0x84')]['sync'](this,_0x349458);if(_0x1b69f4){this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x122'),_0x1b69f4));var _0x1ba49e=this[_0x0263('0xf')][_0x0263('0x100')](_0x1b69f4);try{fs[_0x0263('0x101')](_0x1b69f4+_0x0263('0x102'));}catch(_0x779aba){logger[_0x0263('0x2d')](_0x779aba);}return _0x1ba49e;}return this['channel'][_0x0263('0x2d')](_0x349458,_0x0263('0x123'));};AGIVertices['prototype'][_0x0263('0x124')]=function(_0x64d442){logger['info'](util[_0x0263('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x64d442[_0x0263('0x3a')]));if(!this['isConfigured'](_0x64d442[_0x0263('0x85')])||!this[_0x0263('0xa5')](_0x64d442[_0x0263('0x120')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x125'));}if(!this[_0x0263('0xa5')](_0x64d442['aws_bot_name'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x126'));}if(!this[_0x0263('0xa5')](_0x64d442[_0x0263('0x62')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20text\x20configured');}this[_0x0263('0xf')]['bot']=!![];this[_0x0263('0x38')](_0x64d442);this['createSquareMessage'](_0x64d442[_0x0263('0x62')],'in','','');this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x127'),_0x64d442[_0x0263('0x62')]));var _0x20f1ee=this[_0x0263('0x8a')][_0x0263('0xa7')](this,_0x64d442);if(_0x20f1ee){for(var _0xecf59b in _0x20f1ee){if(_0x20f1ee[_0x0263('0x93')](_0xecf59b)&&_['isString'](_0x20f1ee[_0xecf59b])){this['channel'][_0x0263('0xa4')](util[_0x0263('0x29')](_0x0263('0x128'),_0xecf59b['toUpperCase']()),_0x20f1ee[_0xecf59b]);}}if(_[_0x0263('0x48')](_0x20f1ee['message'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x129'));}else{this['createSquareMessage'](_0x20f1ee[_0x0263('0x76')],'out',_0x0263('0x12a'),'');return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x12b'),_0x20f1ee[_0x0263('0x76')]));}}return this['channel'][_0x0263('0x2d')](_0x64d442,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0263('0x12')][_0x0263('0x12c')]=function(_0x55b66f){logger[_0x0263('0x2f')](util['format'](_0x0263('0x12d'),_0x55b66f[_0x0263('0x3a')],_0x55b66f[_0x0263('0x66')]));if(!this['isConfigured'](_0x55b66f[_0x0263('0x79')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20key\x20configured');}var _0x125602='wav';var _0x30081c=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x0263('0x119')](0x4));var _0x4d7f=util['format'](_0x0263('0x9c'),_0x30081c,_0x125602);var _0x2df445=!![];if(_0x55b66f[_0x0263('0x12e')]===_0x0263('0x12f')){_0x2df445=![];}var _0x44ebc2=this[_0x0263('0xf')][_0x0263('0x130')](_0x30081c,_0x125602,_0x55b66f['intKey'],_0x55b66f[_0x0263('0x66')],undefined,_0x2df445);if(_0x44ebc2[_0x0263('0xa2')]!==-0x1){this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x131'),_0x4d7f));var _0x1c92a1=this[_0x0263('0x8d')][_0x0263('0xa7')](this,_0x55b66f,_0x4d7f);if(_0x1c92a1){for(var _0x42c65d in _0x1c92a1){if(_0x1c92a1['hasOwnProperty'](_0x42c65d)){this[_0x0263('0xf')][_0x0263('0xa4')](util[_0x0263('0x29')]('GOOGLE_ASR_%s',_0x42c65d[_0x0263('0x6a')]()),_0x1c92a1[_0x42c65d]);}}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x132'),JSON['stringify'](_0x1c92a1)));}}return _0x44ebc2;};AGIVertices[_0x0263('0x12')][_0x0263('0x133')]=function(_0x252f3c){logger[_0x0263('0x2f')](util['format'](_0x0263('0x134'),_0x252f3c[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x252f3c[_0x0263('0x135')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x136'));}if(!this[_0x0263('0xa5')](_0x252f3c[_0x0263('0x8f')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x137'));}var _0x57b6f1='wav';var _0x576f4c=util[_0x0263('0x29')](_0x0263('0x138'),FILES_PATH,rs[_0x0263('0x119')](0x4));var _0x480fbf=util['format'](_0x0263('0x9c'),_0x576f4c,_0x57b6f1);var _0x2a70bb=!![];if(_0x252f3c['beep']===_0x0263('0x12f')){_0x2a70bb=![];}var _0x409d75=this[_0x0263('0xf')][_0x0263('0x130')](_0x576f4c,_0x57b6f1,_0x252f3c[_0x0263('0x139')],_0x252f3c[_0x0263('0x66')],undefined,_0x2a70bb);if(_0x409d75[_0x0263('0xa2')]!==-0x1){this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')]('tilde\x20%s\x20file\x20created',_0x480fbf));var _0x62b884=this[_0x0263('0x8e')]['sync'](this,_0x252f3c,_0x480fbf);if(_0x62b884){for(var _0x72720 in _0x62b884){if(_0x62b884[_0x0263('0x93')](_0x72720)){this[_0x0263('0xf')]['setVariable'](util[_0x0263('0x29')](_0x0263('0x13a'),_0x72720[_0x0263('0x6a')]()),_0x62b884[_0x72720]);}}return this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0x13b'),JSON['stringify'](_0x62b884)));}}return _0x409d75;};AGIVertices[_0x0263('0x12')][_0x0263('0x13c')]=function(_0x5b4278){logger['info'](util[_0x0263('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5b4278[_0x0263('0x3a')]));return this['channel'][_0x0263('0x13d')](_0x5b4278[_0x0263('0x3f')],_0x5b4278[_0x0263('0x40')],_0x5b4278['priority']);};AGIVertices[_0x0263('0x12')]['gotoif']=function(_0x4beedf){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4beedf[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x4beedf['condition'])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x4beedf,_0x0263('0x13e'));}try{var _0x4ccf6a=eval(_0x4beedf[_0x0263('0x13f')])?'true':'false';this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x140'),_0x4beedf[_0x0263('0x13f')],_0x4ccf6a));return{'code':0xc8,'result':_0x4ccf6a};}catch(_0x4ff18b){return{'code':0xc8,'result':_0x0263('0x141')};}};AGIVertices[_0x0263('0x12')][_0x0263('0x142')]=function(_0x4543c9){logger['info'](util[_0x0263('0x29')](_0x0263('0x143'),_0x4543c9[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x4543c9['interval_id'])){return this[_0x0263('0xf')]['error'](_0x4543c9,_0x0263('0x144'));}var _0x5a46f8=this[_0x0263('0x145')][_0x0263('0xa7')](this,_0x4543c9[_0x0263('0x146')]);if(!_0x5a46f8){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x4543c9,_0x0263('0x147'));}for(var _0x5f4118=0x0;_0x5f4118<_0x5a46f8[_0x0263('0x9a')];_0x5f4118+=0x1){var _0x2f3783=this[_0x0263('0xf')][_0x0263('0xa0')](util['format']('IFTIME(%s?true:false)',_0x5a46f8[_0x5f4118]));if(_0x2f3783[_0x0263('0xa2')]===-0x1){return _0x2f3783;}logger[_0x0263('0x2f')](util['format'](_0x0263('0x148'),_0x5a46f8[_0x5f4118],_0x2f3783[_0x0263('0xa1')]));if(_0x2f3783[_0x0263('0xa1')]==='true'){logger['info'](util[_0x0263('0x29')](_0x0263('0x148'),_0x5a46f8[_0x5f4118],_0x0263('0x149')));this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x148'),_0x5a46f8[_0x5f4118],_0x0263('0x149')));return{'code':0xc8,'result':_0x0263('0x149')};}else{logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x148'),_0x5a46f8[_0x5f4118],'false'));this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x148'),_0x5a46f8[_0x5f4118],_0x0263('0x141')));}}return{'code':0xc8,'result':_0x0263('0x141')};};AGIVertices['prototype'][_0x0263('0x14a')]=function(_0x2e1a17){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x2e1a17['label']));return this['channel'][_0x0263('0x14a')]();};AGIVertices[_0x0263('0x12')][_0x0263('0x14b')]=function(_0x1cb6a4){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x14c'),_0x1cb6a4[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x1cb6a4['key'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x14d'));}var _0x725f07='wav';var _0x20aaf4=util[_0x0263('0x29')](_0x0263('0x138'),FILES_PATH,rs['generate'](0x4));var _0x4c71a2=util[_0x0263('0x29')](_0x0263('0x9c'),_0x20aaf4,_0x725f07);var _0x5aec8d=!![];if(_0x1cb6a4[_0x0263('0x12e')]===_0x0263('0x12f')){_0x5aec8d=![];}var _0x37ec37=this['channel'][_0x0263('0x130')](_0x20aaf4,_0x725f07,_0x1cb6a4[_0x0263('0x139')],_0x1cb6a4[_0x0263('0x66')],undefined,_0x5aec8d);if(_0x37ec37[_0x0263('0xa2')]!==-0x1){this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x14e'),_0x4c71a2));var _0x16d59e=this[_0x0263('0x80')][_0x0263('0xa7')](this,_0x1cb6a4,_0x4c71a2);if(_0x16d59e){for(var _0x175e8e in _0x16d59e){if(_0x16d59e[_0x0263('0x93')](_0x175e8e)){this['channel']['setVariable'](util['format'](_0x0263('0x14f'),_0x175e8e['toUpperCase']()),_0x16d59e[_0x175e8e]);}}return this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x150'),JSON[_0x0263('0x9d')](_0x16d59e)));}}return _0x37ec37;};AGIVertices[_0x0263('0x12')][_0x0263('0x151')]=function(_0x109c2e){logger['info'](util[_0x0263('0x29')](_0x0263('0x152'),_0x109c2e[_0x0263('0x3a')]));if(!this['isConfigured'](_0x109c2e[_0x0263('0x79')])){return this['channel'][_0x0263('0xaa')](_0x0263('0x14d'));}if(!this[_0x0263('0xa5')](_0x109c2e[_0x0263('0x62')])){return this['channel']['noop'](_0x0263('0xab'));}this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x153'),_0x109c2e[_0x0263('0x62')]));var _0x3c4581=this[_0x0263('0x154')][_0x0263('0xa7')](this,_0x109c2e);if(_0x3c4581){this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x14e'),_0x3c4581));var _0x497900=this[_0x0263('0xf')][_0x0263('0x100')](_0x3c4581,_0x109c2e[_0x0263('0x139')]);try{fs[_0x0263('0x101')](_0x3c4581+_0x0263('0x102'));}catch(_0xc8eaaf){logger[_0x0263('0x2d')](_0xc8eaaf);}return _0x497900;}return this[_0x0263('0xf')][_0x0263('0x2d')](_0x109c2e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0263('0x12')]['login']=function(_0x539b8d){logger[_0x0263('0x2f')](util['format'](_0x0263('0x155'),_0x539b8d['label']));if(!this[_0x0263('0xa5')](_0x539b8d[_0x0263('0x156')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x539b8d,_0x0263('0x157'));}logger[_0x0263('0x2f')](util[_0x0263('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0263('0xf')][_0x0263('0x3d')],_0x539b8d[_0x0263('0x156')]));var _0x5c6abb=this[_0x0263('0x5a')][_0x0263('0xa7')](this,_0x539b8d['findBy']);if(_0x5c6abb){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x158'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x539b8d[_0x0263('0x156')]));this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x158'),this['channel'][_0x0263('0x3d')],_0x539b8d[_0x0263('0x156')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x0263('0x159'),this[_0x0263('0xf')]['callerid'],_0x539b8d[_0x0263('0x156')]));this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x159'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x539b8d[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15a')};}};AGIVertices[_0x0263('0x12')][_0x0263('0x15b')]=function(_0x46b26b){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x46b26b[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x46b26b[_0x0263('0x156')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x46b26b,_0x0263('0x157'));}logger[_0x0263('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x0263('0x3d')],_0x46b26b[_0x0263('0x156')]));var _0xcce103=this[_0x0263('0x57')][_0x0263('0xa7')](this,_0x46b26b['findBy']);if(_0xcce103){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x158'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x46b26b[_0x0263('0x156')]));this[_0x0263('0xf')][_0x0263('0xaa')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0263('0xf')]['callerid'],_0x46b26b[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15c')};}else{logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x159'),this['channel'][_0x0263('0x3d')],_0x46b26b[_0x0263('0x156')]));this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x159'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x46b26b[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15a')};}};AGIVertices['prototype'][_0x0263('0x15d')]=function(_0xecf336){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x15e'),_0xecf336['label']));if(!this['isConfigured'](_0xecf336[_0x0263('0x15f')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0xecf336,_0x0263('0x160'));}this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('math\x20%s',_0xecf336['operation']));var _0x186b51=eval(_0xecf336[_0x0263('0x15f')]);if(!this[_0x0263('0xa5')](_0xecf336['variable_id'])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5453ac=this[_0x0263('0xa0')][_0x0263('0xa7')](this,_0xecf336[_0x0263('0xd8')]);if(!_0x5453ac){return this[_0x0263('0xf')]['error'](_0xecf336,_0x0263('0xda'));}if(_[_0x0263('0x99')](_0x186b51)){var _0x4ff1b1=this;_0x186b51[_0x0263('0xdc')](function(_0x5f3a66,_0x506519){_0x4ff1b1[_0x0263('0xf')]['setVariable'](util[_0x0263('0x29')](_0x0263('0x161'),_0x5453ac,_0x506519),_0x5f3a66);});return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x162'),_0x5453ac));}else{return this[_0x0263('0xf')][_0x0263('0xa4')](_0x5453ac,_0x186b51);}};AGIVertices[_0x0263('0x12')][_0x0263('0xc')]=function(_0x15a9e2){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x163'),_0x15a9e2[_0x0263('0x3a')]));if(_0x15a9e2['retry']===0x0){return this[_0x0263('0xa6')](_0x15a9e2);}_0x15a9e2[_0x0263('0x110')]-=0x1;if(!this[_0x0263('0xa5')](_0x15a9e2[_0x0263('0x111')])){return this[_0x0263('0xf')]['error'](_0x15a9e2,'no\x20file\x20audio\x20selected');}var _0x1db91a=this['getSound']['sync'](this,_0x15a9e2[_0x0263('0x111')]);if(!_0x1db91a){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x15a9e2,'no\x20file\x20audio\x20found');}var _0x5804f2=this[_0x0263('0xf')][_0x0263('0x164')](_0x1db91a,_0x15a9e2[_0x0263('0x165')],_0x15a9e2[_0x0263('0x166')]);var _0x137373=_0x5804f2[_0x0263('0xa2')];if(_0x5804f2['result']===-0x1){this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x15a9e2,'-1');return _0x5804f2;}else if(_0x5804f2[_0x0263('0xa1')]==='timeout'){_0x5804f2[_0x0263('0xa2')]=_0x5804f2['result'][_0x0263('0x9a')]>0x0?_0x5804f2['result']:'t';}else if(_[_0x0263('0x47')](_0x5804f2['result'])){_0x5804f2['result']='#';_0x137373='#';}if(!this['isConfigured'](_0x15a9e2[_0x0263('0xd8')])){this[_0x0263('0xf')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2a3f6a=this[_0x0263('0xa0')][_0x0263('0xa7')](this,_0x15a9e2[_0x0263('0xd8')]);if(!_0x2a3f6a){return this[_0x0263('0xf')]['error'](_0x15a9e2,_0x0263('0xda'));}this[_0x0263('0xf')][_0x0263('0xa4')](_0x2a3f6a,_0x137373);}this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x15a9e2,_0x137373);return _0x5804f2;};AGIVertices[_0x0263('0x12')][_0x0263('0xaa')]=function(_0x13bb9){logger['info'](util[_0x0263('0x29')](_0x0263('0x167'),_0x13bb9['label']));return this[_0x0263('0xf')]['noop'](_0x13bb9[_0x0263('0x168')]||_0x13bb9[_0x0263('0x3a')]);};AGIVertices[_0x0263('0x12')][_0x0263('0x169')]=function(_0x349220){logger['info'](util[_0x0263('0x29')](_0x0263('0x16a'),_0x349220['label']));if(!this[_0x0263('0xa5')](_0x349220[_0x0263('0x156')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x349220,_0x0263('0x157'));}logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x16b'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x349220['findBy']));var _0x51c668=this[_0x0263('0x53')][_0x0263('0xa7')](this,_0x349220[_0x0263('0x16c')]);var _0x204eb6=this['agentPause'][_0x0263('0xa7')](this,_0x349220[_0x0263('0x156')],_0x51c668);if(_0x204eb6){logger[_0x0263('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x349220[_0x0263('0x156')]));this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x158'),this[_0x0263('0xf')]['callerid'],_0x349220[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15c')};}else{logger['info'](util[_0x0263('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0263('0xf')][_0x0263('0x3d')],_0x349220[_0x0263('0x156')]));this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x158'),this['channel'][_0x0263('0x3d')],_0x349220[_0x0263('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0263('0x12')][_0x0263('0x16d')]=function(_0x3999bf){logger['info'](util[_0x0263('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3999bf[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x3999bf[_0x0263('0x111')])){return this['channel'][_0x0263('0x2d')](_0x3999bf,_0x0263('0x112'));}var _0x5af431=this['getSound']['sync'](this,_0x3999bf[_0x0263('0x111')]);if(!_0x5af431){return this['channel']['error'](_0x3999bf,_0x0263('0x113'));}var _0x32229b=this[_0x0263('0xf')]['exec'](_0x0263('0x16e'),[_0x5af431,_0x3999bf[_0x0263('0xe6')]]);if(_0x32229b['result']===-0x1){return _0x32229b;}return this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0xc4'),'PLAYBACK',_0x5af431));};AGIVertices['prototype'][_0x0263('0x16f')]=function(_0x3c100d){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3c100d[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x3c100d['queue_id'])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x3c100d,'no\x20queue\x20selected');}var _0x5edbd5='';var _0x56bcc6=parseInt(_0x3c100d['queue_id'],0xa);if(isNaN(_0x56bcc6)){_0x5edbd5=_0x3c100d[_0x0263('0x170')];}else{_0x5edbd5=this[_0x0263('0x16')]['sync'](this,_0x3c100d[_0x0263('0x170')]);if(!_0x5edbd5){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x3c100d,'no\x20queue\x20found');}}var _0x37fb35='';if(this[_0x0263('0xa5')](_0x3c100d['file_id'])){var _0x2210c4=this[_0x0263('0x20')][_0x0263('0xa7')](this,_0x3c100d[_0x0263('0x111')]);if(_0x2210c4){_0x37fb35=_0x2210c4;}}this['createSquareDetailsReport'][_0x0263('0xa7')](this,_0x3c100d,_0x5edbd5);if(_0x3c100d[_0x0263('0xe6')]['indexOf']('x')<0x0){_0x3c100d[_0x0263('0xe6')]+='x';}if(_0x3c100d[_0x0263('0xe6')][_0x0263('0x171')]('X')<0x0){_0x3c100d[_0x0263('0xe6')]+='X';}this[_0x0263('0xf')][_0x0263('0xa4')](_0x0263('0x172'),_0x5edbd5?_0x5edbd5[_0x0263('0x173')]():'');var _0x16b742=this[_0x0263('0xf')]['exec'](_0x0263('0x174'),[_0x5edbd5,_0x3c100d[_0x0263('0xe6')],_0x3c100d[_0x0263('0x64')],_0x37fb35,_0x3c100d[_0x0263('0x66')],_0x3c100d[_0x0263('0x8')],_0x3c100d['macro'],_0x3c100d[_0x0263('0x175')],'',_0x3c100d[_0x0263('0x176')]]);if(_0x16b742[_0x0263('0xa2')]===-0x1){return _0x16b742;}return this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0xc4'),_0x0263('0x174'),_0x5edbd5));};AGIVertices['prototype'][_0x0263('0x177')]=function(_0x42e76b){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x42e76b[_0x0263('0x3a')]));var _0xfbe651=_0x42e76b['recordingFormat']||_0x0263('0x178');var _0xa70f52=util[_0x0263('0x29')](_0x0263('0x179'),this['channel'][_0x0263('0x39')],rs[_0x0263('0x119')](0x5));var _0x53a675=util[_0x0263('0x29')](_0x0263('0x17a'),FILES_PATH,_0xa70f52,_0xfbe651);var _0x243d24=util[_0x0263('0x29')]('%s/recordings/%s',FILES_PATH,_0xa70f52);this[_0x0263('0x3c')][_0x0263('0xa7')](this,_0x42e76b,_0xa70f52,_0x53a675);this['channel']['setVariable']('RECORDING_SAVENAME',_0xa70f52);logger[_0x0263('0x2f')](_0x0263('0x17b'),_0x243d24,_0xfbe651,_0x42e76b[_0x0263('0x17c')],_0x42e76b[_0x0263('0x66')]);return this[_0x0263('0xf')]['recordFile'](_0x243d24,_0xfbe651,_0x42e76b[_0x0263('0x17c')],_0x42e76b[_0x0263('0x66')],undefined,!![]);};AGIVertices[_0x0263('0x12')]['restapi']=function(_0x412df8){logger['info'](util[_0x0263('0x29')](_0x0263('0x17d'),_0x412df8['label']));if(!this['isConfigured'](_0x412df8['url'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x17e'));}var _0x558305=this[_0x0263('0x17f')][_0x0263('0xa7')](this,_0x412df8);logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Response:',util['inspect'](_0x558305,{'showHidden':![],'depth':null})));if(!this[_0x0263('0xa5')](_0x412df8[_0x0263('0xd8')])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x180'));}var _0x586544=this[_0x0263('0xa0')][_0x0263('0xa7')](this,_0x412df8[_0x0263('0xd8')]);if(!_0x586544){return this[_0x0263('0xf')]['error'](_0x412df8,_0x0263('0xda'));}this[_0x0263('0xf')][_0x0263('0xa4')](util[_0x0263('0x29')]('%s_STATUS_CODE',_0x586544),_0x558305[_0x0263('0x75')]?_0x558305['statusCode']:_0x0263('0x181'));this[_0x0263('0xf')][_0x0263('0xa4')](util[_0x0263('0x29')](_0x0263('0x182'),_0x586544),_0x558305['statusMessage']?_0x558305[_0x0263('0x183')]:'OK');if(_0x558305[_0x0263('0x6b')]){try{this[_0x0263('0x9b')](_0x558305[_0x0263('0x6b')],_0x586544);}catch(_0x5a8245){logger['error'](util[_0x0263('0x29')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x586544));}}return this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0xdf'),_0x586544));};AGIVertices['prototype'][_0x0263('0x184')]=function(_0x5bd32b){logger[_0x0263('0x2f')](util['format'](_0x0263('0x185'),_0x5bd32b[_0x0263('0x3a')]));return this[_0x0263('0xf')][_0x0263('0x186')](_0x5bd32b[_0x0263('0x187')][_0x0263('0x5c')](/\s+/g,''),_0x5bd32b['escape_digits']);};AGIVertices['prototype'][_0x0263('0x188')]=function(_0x53fee1){logger['info'](util[_0x0263('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x53fee1[_0x0263('0x3a')]));return this['channel'][_0x0263('0x189')](_0x53fee1[_0x0263('0x18a')][_0x0263('0x5c')](/\s+/g,''),_0x53fee1[_0x0263('0x17c')]);};AGIVertices['prototype'][_0x0263('0x18b')]=function(_0x42f368){logger[_0x0263('0x2f')](util['format'](_0x0263('0x18c'),_0x42f368[_0x0263('0x3a')]));return this[_0x0263('0xf')][_0x0263('0x18d')](_0x42f368[_0x0263('0x62')],_0x42f368[_0x0263('0x17c')]);};AGIVertices[_0x0263('0x12')]['sendMail']=function(_0x157651){logger['info'](util[_0x0263('0x29')](_0x0263('0x18e'),_0x157651['label']));if(!this[_0x0263('0xa5')](_0x157651[_0x0263('0x18f')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20mail\x20account\x20configured');}var _0x1f29ad=this[_0x0263('0x23')]['sync'](this,_0x157651[_0x0263('0x18f')]);if(!_0x1f29ad||!_0x1f29ad[_0x0263('0x190')]){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x157651,_0x0263('0x191'));}var _0x20bc4c={'from':util[_0x0263('0x29')](_0x0263('0x192'),_0x1f29ad[_0x0263('0x15')],_0x1f29ad['email']||_0x1f29ad[_0x0263('0x190')][_0x0263('0x193')]),'to':_0x157651['to']||'','cc':_0x157651['cc']||'','bcc':_0x157651['bcc']||'','subject':_0x157651[_0x0263('0x194')],'html':_0x157651[_0x0263('0x62')],'text':_0x157651[_0x0263('0x62')]};var _0x56949f={'tls':{'rejectUnauthorized':![]}};if(_0x1f29ad[_0x0263('0x190')][_0x0263('0x195')]){_0x56949f[_0x0263('0x195')]=_0x1f29ad['Smtp'][_0x0263('0x195')];}else{_0x56949f[_0x0263('0x196')]=_0x1f29ad[_0x0263('0x190')]['host'];_0x56949f[_0x0263('0x197')]=_0x1f29ad[_0x0263('0x190')][_0x0263('0x197')];_0x56949f['secure']=_0x1f29ad['Smtp'][_0x0263('0x198')];}if(_0x1f29ad[_0x0263('0x190')]['authentication']){_0x56949f[_0x0263('0x199')]={'user':_0x1f29ad[_0x0263('0x190')][_0x0263('0x193')],'pass':_0x1f29ad[_0x0263('0x190')]['pass']};}if(this[_0x0263('0xa5')](_0x157651[_0x0263('0x19a')])){}logger[_0x0263('0x19b')]('sendMail\x20message',JSON['stringify'](_0x20bc4c));this[_0x0263('0x38')]['sync'](this,_0x157651,_0x157651['account_id']);this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x19c'),_0x1f29ad[_0x0263('0x15')]));this[_0x0263('0x25')]['sync'](this,_0x56949f,_0x20bc4c);return this['channel'][_0x0263('0xaa')](_0x0263('0x19d'));};AGIVertices[_0x0263('0x12')]['sendFax']=function(_0x33acec){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x19e'),_0x33acec[_0x0263('0x3a')]));return this[_0x0263('0xf')][_0x0263('0xaa')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x0263('0x12')]['sendSMS']=function(_0x126a04){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x126a04[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x126a04[_0x0263('0x19f')])){return this[_0x0263('0xf')][_0x0263('0xaa')]('no\x20sms\x20account\x20configured');}var _0x19ea93=this[_0x0263('0x35')][_0x0263('0xa7')](this,_0x126a04[_0x0263('0x19f')]);if(!_0x19ea93){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x126a04,_0x0263('0x1a0'));}var _0x19b75a={'body':_0x126a04[_0x0263('0x1a1')],'phone':_0x126a04['to']||'','SmsAccountId':_0x19ea93['id']};logger['debug'](_0x0263('0x1a2'),JSON[_0x0263('0x9d')](_0x19b75a));this['createSquareDetailsReport'][_0x0263('0xa7')](this,_0x126a04,_0x126a04[_0x0263('0x19f')]);this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x19ea93['name']));this[_0x0263('0x37')]['sync'](this,_0x19b75a);return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0x1a3'));};AGIVertices[_0x0263('0x12')][_0x0263('0x1a4')]=function(_0x3a2e0a){logger[_0x0263('0x2f')](util['format'](_0x0263('0x1a5'),_0x3a2e0a[_0x0263('0x3a')]));if(!this['isConfigured'](_0x3a2e0a[_0x0263('0xd8')])){return this[_0x0263('0xf')]['error'](_0x3a2e0a,_0x0263('0x1a6'));}var _0x2fd81d=this[_0x0263('0xa0')]['sync'](this,_0x3a2e0a['variable_id']);if(!_0x2fd81d){return this['channel']['error'](_0x3a2e0a,'no\x20variable\x20found');}return this[_0x0263('0xf')]['setVariable'](_0x2fd81d,_0x3a2e0a['variable_value']);};AGIVertices[_0x0263('0x12')][_0x0263('0x1a7')]=function(_0x30e685){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x1a8'),_0x30e685[_0x0263('0x3a')]));this[_0x0263('0xf')]['noop'](_0x0263('0x1a9'));if(_0x30e685[_0x0263('0xbb')]===_0x0263('0x1aa')){this['channel']['noop'](_0x0263('0x1ab'));return this[_0x0263('0xf')][_0x0263('0xbb')]();}return this[_0x0263('0xf')][_0x0263('0xaa')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x0263('0x1ac')]=function(_0x29b409){logger[_0x0263('0x2f')](util['format'](_0x0263('0x1ad'),_0x29b409[_0x0263('0x3a')]));if(!this['isConfigured'](_0x29b409[_0x0263('0x1ae')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x29b409,_0x0263('0x1af'));}var _0x35894b=this[_0x0263('0x1b0')]['sync'](this,_0x29b409[_0x0263('0x1ae')]);if(!this[_0x0263('0xa5')](_0x35894b)){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x29b409,util[_0x0263('0x29')](_0x0263('0x1b1'),_0x29b409[_0x0263('0x1ae')]));}if(_0x35894b===this[_0x0263('0xf')]['arg_1']){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x29b409,_0x0263('0x1b2'));}this[_0x0263('0x38')]['sync'](this,_0x29b409,_0x35894b);var _0x1c8aa0=this[_0x0263('0xf')][_0x0263('0x5b')](_0x0263('0x1b3'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0263('0x8')][_0x0263('0x196')]||_0x0263('0x1b4'),_0x35894b,this[_0x0263('0xf')]['arg_1']));if(_0x1c8aa0[_0x0263('0xa2')]===-0x1){return _0x1c8aa0;}return this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0xc4'),_0x0263('0x1b3'),_0x35894b));};AGIVertices[_0x0263('0x12')][_0x0263('0x1b5')]=function(_0x163d04){logger['info'](util[_0x0263('0x29')](_0x0263('0x1b6'),_0x163d04['label']));var _0x149a7c=this[_0x0263('0x1b7')][_0x0263('0xa7')](this,_0x163d04[_0x0263('0xb7')]);this[_0x0263('0x38')][_0x0263('0xa7')](this,_0x163d04,_0x163d04[_0x0263('0xb7')]);if(this[_0x0263('0xa5')](_0x163d04[_0x0263('0xd8')])){var _0x48fdb2=this[_0x0263('0xa0')][_0x0263('0xa7')](this,_0x163d04[_0x0263('0xd8')]);if(_0x48fdb2){this['channel'][_0x0263('0xa4')](_0x48fdb2,_0x149a7c);return this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x1b8'),_0x163d04['command'],_0x48fdb2));}}return this['channel']['noop'](util[_0x0263('0x29')](_0x0263('0x1b9'),_0x163d04[_0x0263('0xb7')]));};AGIVertices[_0x0263('0x12')][_0x0263('0x1ba')]=function(_0x11df12){logger[_0x0263('0x2f')](util['format'](_0x0263('0x1bb'),_0x11df12[_0x0263('0x3a')]));_0x11df12[_0x0263('0x62')]=_0x11df12[_0x0263('0x62')][_0x0263('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0263('0xa5')](_0x11df12[_0x0263('0x5e')])){return this[_0x0263('0xf')]['noop'](_0x0263('0x1bc'));}if(!this[_0x0263('0xa5')](_0x11df12['text'])){return this[_0x0263('0xf')][_0x0263('0xaa')](_0x0263('0xab'));}this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0x1bd'),_0x11df12['text']));var _0xc3b40d=this[_0x0263('0x5d')][_0x0263('0xa7')](this,_0x11df12);if(_0xc3b40d){this[_0x0263('0xf')][_0x0263('0xaa')](util[_0x0263('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xc3b40d));var _0x4131e6=this[_0x0263('0xf')][_0x0263('0x100')](_0xc3b40d);try{fs[_0x0263('0x101')](_0xc3b40d+_0x0263('0x102'));}catch(_0x234ff3){logger[_0x0263('0x2d')](_0x234ff3);}return _0x4131e6;}return this['channel'][_0x0263('0x2d')](_0x11df12,_0x0263('0x1be'));};AGIVertices[_0x0263('0x12')][_0x0263('0x1bf')]=function(_0x232b7e){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x232b7e[_0x0263('0x3a')]));_0x232b7e[_0x0263('0x62')]=_0x232b7e[_0x0263('0x62')][_0x0263('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0263('0xa5')](_0x232b7e['text'])){return this['channel'][_0x0263('0xaa')](_0x0263('0xab'));}this[_0x0263('0xf')]['noop'](util[_0x0263('0x29')](_0x0263('0x1c0'),_0x232b7e[_0x0263('0x62')]));var _0x51ce0c=this['googleTTS'][_0x0263('0xa7')](this,_0x232b7e);if(_0x51ce0c){this['channel'][_0x0263('0xaa')](util[_0x0263('0x29')](_0x0263('0x1c1'),_0x51ce0c));var _0x1d0c66=this[_0x0263('0xf')][_0x0263('0x100')](_0x51ce0c);try{fs[_0x0263('0x101')](_0x51ce0c+'.wav');}catch(_0x4eb0ce){logger[_0x0263('0x2d')](_0x4eb0ce);}return _0x1d0c66;}return this['channel'][_0x0263('0x2d')](_0x232b7e,_0x0263('0x1c2'));};AGIVertices[_0x0263('0x12')]['unpause']=function(_0x44d032){logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x1c3'),_0x44d032[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x44d032[_0x0263('0x156')])){return this[_0x0263('0xf')]['error'](_0x44d032,'no\x20find\x20by\x20configured');}logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x16b'),this['channel']['callerid'],_0x44d032['findBy']));var _0x4d665f=this[_0x0263('0x56')][_0x0263('0xa7')](this,_0x44d032['findBy']);if(_0x4d665f){logger['info'](util[_0x0263('0x29')](_0x0263('0x158'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x44d032['findBy']));this[_0x0263('0xf')][_0x0263('0xaa')](util['format'](_0x0263('0x158'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x44d032[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15c')};}else{logger[_0x0263('0x2f')](util[_0x0263('0x29')](_0x0263('0x159'),this[_0x0263('0xf')]['callerid'],_0x44d032['findBy']));this['channel']['noop'](util[_0x0263('0x29')](_0x0263('0x159'),this[_0x0263('0xf')][_0x0263('0x3d')],_0x44d032[_0x0263('0x156')]));return{'code':0xc8,'result':_0x0263('0x15a')};}};AGIVertices['prototype'][_0x0263('0x1c4')]=function(_0x1f2969){logger[_0x0263('0x2f')](util[_0x0263('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1f2969['label']));var _0x44db43=this[_0x0263('0xf')][_0x0263('0x5b')](_0x0263('0x1c5'),[_0x1f2969[_0x0263('0x1c6')],_0x1f2969[_0x0263('0x77')]]);if(_0x44db43[_0x0263('0xa2')]===-0x1){return _0x44db43;}return this['channel'][_0x0263('0xaa')](util['format'](_0x0263('0xc4'),_0x0263('0x1c5'),_0x1f2969[_0x0263('0x1c6')]));};AGIVertices[_0x0263('0x12')]['vswitch']=function(_0x93b9ce){logger['info'](util['format'](_0x0263('0x1c7'),_0x93b9ce[_0x0263('0x3a')]));if(!this[_0x0263('0xa5')](_0x93b9ce[_0x0263('0xd8')])){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x93b9ce,_0x0263('0x1a6'));}var _0x82f6a7=this['getVariable']['sync'](this,_0x93b9ce['variable_id']);if(!_0x82f6a7){return this[_0x0263('0xf')][_0x0263('0x2d')](_0x93b9ce,_0x0263('0xda'));}var _0x3a9f0e=this[_0x0263('0xf')][_0x0263('0xa0')](_0x82f6a7);return{'code':0xc8,'result':_0x3a9f0e[_0x0263('0xa1')]?_0x3a9f0e[_0x0263('0xa1')]:'-'};};String['prototype']['replaceAll']=function(_0x57add9,_0x158c65){return this[_0x0263('0x9e')](_0x57add9)[_0x0263('0x1c8')](_0x158c65);};module[_0x0263('0x1c9')]=AGIVertices; \ No newline at end of file +var _0xc288=['label','callerid','createSquareRecording','context','extension','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','callback_','lastName','isNil','phone','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','saveRestApiResult','isPlainObject','isArray','length','%s.%s','split','replaceAll','extra','setVariable','isConfigured','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','options','exec','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','list_id','no\x20list\x20selected','add','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','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\x20%s\x20file\x20created','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','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','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayNumber','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','rawHeaders','rawBody','menu','getsecretdigits','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getSound','save_name','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','createSmsMessage','createSquareDetailsReport','channel'];(function(_0x3194f8,_0x43b043){var _0x5db8be=function(_0x23bc3a){while(--_0x23bc3a){_0x3194f8['push'](_0x3194f8['shift']());}};_0x5db8be(++_0x43b043);}(_0xc288,0x197));var _0x8c28=function(_0x4e845c,_0x279724){_0x4e845c=_0x4e845c-0x0;var _0x5f3ce3=_0xc288[_0x4e845c];return _0x5f3ce3;};'use strict';var fs=require('fs');var path=require(_0x8c28('0x0'));var util=require(_0x8c28('0x1'));var _=require(_0x8c28('0x2'));var sh=require(_0x8c28('0x3'));var odbc=require(_0x8c28('0x4'))();var rs=require(_0x8c28('0x5'));var moment=require('moment');var Mustache=require(_0x8c28('0x6'));var rp=require(_0x8c28('0x7'));var logger=require(_0x8c28('0x8'))(_0x8c28('0x9'));var config=require(_0x8c28('0xa'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x8c28('0xb'),_0x8c28('0xc')];var verticesWithRetry=[_0x8c28('0xd'),'getdigits',_0x8c28('0xe')];var AGIVertices=function(_0x3b936c,_0x79b31,_0x3a07f6){this['channel']=_0x3b936c;this['rpc']=_0x79b31;this['mailRpc']=_0x3a07f6;};AGIVertices[_0x8c28('0xf')][_0x8c28('0x10')]=function(_0x1fdb8f,_0x1dabf4){this[_0x8c28('0x11')][_0x8c28('0x12')](_0x1fdb8f)[_0x8c28('0x13')](function(_0x562e98){_0x1dabf4(null,_0x562e98?_0x562e98[_0x8c28('0x14')]:![]);})['catch'](function(_0x47a371){_0x1dabf4(_0x47a371);});};AGIVertices['prototype'][_0x8c28('0x15')]=function(_0x218804,_0x406989){this[_0x8c28('0x11')][_0x8c28('0x16')](_0x218804)[_0x8c28('0x13')](function(_0x350f34){_0x406989(null,_0x350f34?_0x350f34[_0x8c28('0x14')]:![]);})[_0x8c28('0x17')](function(_0x56a439){_0x406989(_0x56a439);});};AGIVertices['prototype']['getSquareProject']=function(_0xf2d51f,_0x3b68a6){this['rpc'][_0x8c28('0x18')](_0xf2d51f)[_0x8c28('0x13')](function(_0x2a76b7){_0x3b68a6(null,_0x2a76b7?_0x2a76b7['name']:![]);})['catch'](function(_0x4b43df){_0x3b68a6(_0x4b43df);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x19')]=function(_0x2a571,_0x24f9a4){this[_0x8c28('0x11')][_0x8c28('0x1a')](_0x2a571)['then'](function(_0x39dffc){_0x24f9a4(null,_0x39dffc?_0x39dffc['dsn']:![]);})['catch'](function(_0x13ad28){_0x24f9a4(_0x13ad28);});};AGIVertices['prototype']['getUser']=function(_0x25da25,_0x29d033){this[_0x8c28('0x11')][_0x8c28('0x1b')](_0x25da25)[_0x8c28('0x13')](function(_0x48395a){_0x29d033(null,_0x48395a?_0x48395a['name']:![]);})[_0x8c28('0x17')](function(_0x402c7e){_0x29d033(_0x402c7e);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1c')]=function(_0x59dec2,_0x40abba){this[_0x8c28('0x11')]['getTrunkById'](_0x59dec2)[_0x8c28('0x13')](function(_0x406d2f){_0x40abba(null,_0x406d2f?_0x406d2f[_0x8c28('0x14')]:![]);})['catch'](function(_0x2f9e88){_0x40abba(_0x2f9e88);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1d')]=function(_0x407bd3,_0x5472c4){var _0x361e1a=this;this['rpc']['getSoundById'](_0x407bd3)['then'](function(_0x2ae740){_0x5472c4(null,_0x2ae740?_0x361e1a['getSoundPath'](_0x2ae740[_0x8c28('0x1e')]):![]);})['catch'](function(_0xf25706){_0x5472c4(_0xf25706);});};AGIVertices[_0x8c28('0xf')]['getMailAccount']=function(_0x1d3bd3,_0x2e259f){this['rpc'][_0x8c28('0x1f')](_0x1d3bd3)['then'](function(_0x5d8005){_0x2e259f(null,_0x5d8005?_0x5d8005:![]);})[_0x8c28('0x17')](function(_0x2e2da7){_0x2e259f(_0x2e2da7);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x20')]=function(_0xe7eb7b,_0x519305,_0x114c22){this[_0x8c28('0x21')][_0x8c28('0x20')](_0xe7eb7b,_0x519305)[_0x8c28('0x13')](function(){_0x114c22(null);})[_0x8c28('0x17')](function(_0x32aed8){_0x114c22(_0x32aed8);});};AGIVertices[_0x8c28('0xf')]['getIntervals']=function(_0x287e71,_0x50cab3){this['rpc'][_0x8c28('0x22')](_0x287e71)[_0x8c28('0x13')](function(_0x29de7e){if(_0x29de7e){if(_0x29de7e[_0x8c28('0x23')]){_0x50cab3(null,[_0x29de7e[_0x8c28('0x24')]]);}else{_0x50cab3(null,_[_0x8c28('0x25')](_0x29de7e[_0x8c28('0x26')],'interval'));}}else{_0x50cab3(null,![]);}})[_0x8c28('0x17')](function(_0x122fd8){_0x50cab3(_0x122fd8);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x27')]=function(_0x3d9af4){return util[_0x8c28('0x28')](_0x8c28('0x29'),FILES_PATH,_0x3d9af4);};AGIVertices[_0x8c28('0xf')][_0x8c28('0x2a')]=function(_0x7151ed,_0x29ab9b,_0x57ded0){odbc[_0x8c28('0x2b')](_0x7151ed,function(_0x5184f7){if(_0x5184f7){logger[_0x8c28('0x2c')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5184f7);_0x57ded0(_0x5184f7);}else{logger[_0x8c28('0x2d')](_0x8c28('0x2e'));odbc[_0x8c28('0x2f')](_0x29ab9b,function(_0x1127e5,_0x575d23){if(_0x1127e5){logger['info'](_0x8c28('0x30'),_0x29ab9b);_0x57ded0(_0x1127e5);}else{logger[_0x8c28('0x2d')]('Query\x20executed\x20correctly\x20%s',_0x29ab9b);odbc['close'](function(_0x15161d){if(_0x15161d){logger[_0x8c28('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x15161d);}_0x57ded0(null,_0x575d23);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x225057,_0x454d84){this['rpc']['getSmsAccountById'](_0x225057)[_0x8c28('0x13')](function(_0x4b0a39){_0x454d84(null,_0x4b0a39?_0x4b0a39:![]);})[_0x8c28('0x17')](function(_0x9807e4){_0x454d84(_0x9807e4);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x31')]=function(_0x4f6d12,_0x74c491){this['rpc'][_0x8c28('0x31')](_0x4f6d12)[_0x8c28('0x13')](function(_0x58af5a){_0x74c491(null,_0x58af5a);})[_0x8c28('0x17')](function(_0x38cb65){_0x74c491(_0x38cb65);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x32')]=function(_0x32f279,_0x4b053c,_0x5f3926){this[_0x8c28('0x11')][_0x8c28('0x32')]({'uniqueid':this[_0x8c28('0x33')]['uniqueid'],'node':_0x32f279[_0x8c28('0x34')],'application':_0x32f279['agicommand'],'data':_0x4b053c||null,'project_name':this[_0x8c28('0x33')]['arg_1'],'callerid':this[_0x8c28('0x33')][_0x8c28('0x35')]})[_0x8c28('0x13')](function(_0x159b41){if(_0x5f3926){_0x5f3926(null,_0x159b41);}})['catch'](function(_0x32218a){if(_0x5f3926){_0x5f3926(_0x32218a);}});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x36')]=function(_0x44ffd6,_0x32552d,_0x28d483,_0x12ae56){this[_0x8c28('0x11')][_0x8c28('0x36')]({'uniqueid':this['channel']['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0x8c28('0x33')]['calleridname'],'context':this['channel'][_0x8c28('0x37')],'extension':this[_0x8c28('0x33')][_0x8c28('0x38')],'priority':this[_0x8c28('0x33')]['priority'],'accountcode':this[_0x8c28('0x33')]['accountcode'],'dnid':this['channel'][_0x8c28('0x39')],'projectName':this[_0x8c28('0x33')]['arg_1'],'saveName':_0x32552d,'filename':_0x44ffd6[_0x8c28('0x3a')]||_0x32552d,'savePath':_0x28d483})[_0x8c28('0x13')](function(_0x37abc5){_0x12ae56(null,_0x37abc5);})[_0x8c28('0x17')](function(_0x439228){_0x12ae56(_0x439228);});};AGIVertices['prototype'][_0x8c28('0x3b')]=function(_0xe4f678,_0x48d861,_0xb82186,_0x1f8bab,_0x43019c){this['rpc'][_0x8c28('0x3b')]({'uniqueid':this[_0x8c28('0x33')][_0x8c28('0x3c')],'body':_0xe4f678,'direction':_0x48d861,'providerName':_0xb82186,'providerResponse':_0x1f8bab})['then'](function(_0x448fc0){if(_0x43019c){_0x43019c(null,_0x448fc0);}})[_0x8c28('0x17')](function(_0xe5ea9d){if(_0x43019c){_0x43019c(_0xe5ea9d);}});};AGIVertices['prototype'][_0x8c28('0x3d')]=function(_0x3031e5,_0x9639e){this['rpc'][_0x8c28('0x3d')]({'firstName':_[_0x8c28('0x3e')](_0x3031e5[_0x8c28('0x14')])||_['isNil'](_0x3031e5['name'])?_0x8c28('0x3f')+Math['random']():_0x3031e5[_0x8c28('0x14')],'lastName':_[_0x8c28('0x3e')](_0x3031e5[_0x8c28('0x40')])||_[_0x8c28('0x41')](_0x3031e5[_0x8c28('0x40')])?null:_0x3031e5[_0x8c28('0x40')],'phone':_0x3031e5[_0x8c28('0x42')],'ListId':_0x3031e5['list_id'],'scheduledat':_0x3031e5['scheduledAt'],'callbackUniqueid':this[_0x8c28('0x33')][_0x8c28('0x3c')],'tags':'callback','description':_0x8c28('0x43')+_0x3031e5[_0x8c28('0x44')][_0x8c28('0x45')](),'priority':_0x3031e5['callback_priority']})[_0x8c28('0x13')](function(_0x4ca941){_0x9639e(null,_0x4ca941);})[_0x8c28('0x17')](function(_0x529650){_0x9639e(_0x529650);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x46')]=function(_0x1eb553,_0x42d49e){this[_0x8c28('0x11')][_0x8c28('0x47')](_0x1eb553)[_0x8c28('0x13')](function(_0x577b0c){_0x42d49e(null,_0x577b0c?_0x577b0c['name']:![]);})['catch'](function(_0x523660){_0x42d49e(_0x523660);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x48')]=function(_0x3dfe0f,_0x3b6415,_0x5e9bbb){var _0x468d13={'role':_0x8c28('0x49')};_0x468d13[_0x3dfe0f]=this[_0x8c28('0x33')][_0x8c28('0x35')];this[_0x8c28('0x11')][_0x8c28('0x48')](_0x468d13,_0x3b6415,this[_0x8c28('0x33')][_0x8c28('0x3c')])[_0x8c28('0x13')](function(_0x520afb){_0x5e9bbb(null,_[_0x8c28('0x41')](_0x520afb)?![]:!![]);})[_0x8c28('0x17')](function(_0x42079d){logger[_0x8c28('0x2c')](_0x42079d);_0x5e9bbb(null,![]);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x4a')]=function(_0xc651b6,_0x4edb9c){var _0x463170={'role':_0x8c28('0x49')};_0x463170[_0xc651b6]=this[_0x8c28('0x33')][_0x8c28('0x35')];this[_0x8c28('0x11')][_0x8c28('0x4a')](_0x463170)[_0x8c28('0x13')](function(_0x345c62){_0x4edb9c(null,_[_0x8c28('0x41')](_0x345c62)?![]:!![]);})['catch'](function(_0x280bc1){logger['error'](_0x280bc1);_0x4edb9c(null,![]);});};AGIVertices[_0x8c28('0xf')]['agentLogout']=function(_0x231504,_0x19d1ff){var _0x51f9e2={'role':_0x8c28('0x49')};_0x51f9e2[_0x231504]=this['channel'][_0x8c28('0x35')];this[_0x8c28('0x11')][_0x8c28('0x4b')](_0x51f9e2)[_0x8c28('0x13')](function(_0x7afea9){_0x19d1ff(null,_[_0x8c28('0x41')](_0x7afea9)?![]:!![]);})['catch'](function(_0xcf0f10){logger[_0x8c28('0x2c')](_0xcf0f10);_0x19d1ff(null,![]);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x4c')]=function(_0x191683,_0x1d90ea){var _0x49c324={'role':_0x8c28('0x49')};_0x49c324[_0x191683]=this[_0x8c28('0x33')]['callerid'];var _0x2be1ce=_0x191683!=_0x8c28('0x4d')?util[_0x8c28('0x28')]('%s/%s@from-sip/n',_0x8c28('0x4e'),this['channel']['callerid']):undefined;this['rpc'][_0x8c28('0x4c')](_0x49c324,_0x2be1ce)[_0x8c28('0x13')](function(_0x42c37c){_0x1d90ea(null,_['isNil'](_0x42c37c)?![]:!![]);})[_0x8c28('0x17')](function(_0x3896e9){logger[_0x8c28('0x2c')](_0x3896e9);_0x1d90ea(null,![]);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x4f')]=function(_0x2a35ba,_0x2d73fc){sh['exec'](_[_0x8c28('0x50')](_0x2a35ba),function(_0x5c8518,_0x2887f7){var _0xb2d1b5=_0x2887f7[_0x8c28('0x51')](/(\r\n|\n|\r)/gm,'');_0x2d73fc(null,_0xb2d1b5);});};AGIVertices['prototype'][_0x8c28('0x52')]=function(_0x18af88,_0x1a34d3){scripts[_0x8c28('0x52')](_0x18af88[_0x8c28('0x53')],_0x18af88[_0x8c28('0x54')]||_0x8c28('0x55'),_0x18af88[_0x8c28('0x55')],_0x18af88[_0x8c28('0x56')]||_0x8c28('0x57'),_0x18af88[_0x8c28('0x58')]||_0x8c28('0x59'),_0x18af88[_0x8c28('0x5a')]||'MP3')[_0x8c28('0x13')](function(_0x4e2996){_0x1a34d3(null,_0x4e2996);})[_0x8c28('0x17')](function(_0x4ddaa3){_0x1a34d3(_0x4ddaa3);});};AGIVertices['prototype']['googleTTS']=function(_0x5d6dca,_0x595021){scripts[_0x8c28('0x5b')](_0x5d6dca[_0x8c28('0x55')],_0x5d6dca[_0x8c28('0x5c')]||'en',0x1)['then'](function(_0xb466fd){_0x595021(null,_0xb466fd);})[_0x8c28('0x17')](function(_0x3c8404){_0x595021(_0x3c8404);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x5d')]=function(_0x12465d,_0x3323a1){var _0x5e8f53={'uri':_0x12465d[_0x8c28('0x5e')],'method':_0x12465d[_0x8c28('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x12465d['timeout'])===_0x8c28('0x60')&&parseInt(_0x12465d[_0x8c28('0x61')])>=0x1?parseInt(_0x12465d[_0x8c28('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x8c28('0x62')]([_0x8c28('0x63'),'PUT'],_0x5e8f53[_0x8c28('0x5f')][_0x8c28('0x64')]())){try{_0x5e8f53[_0x8c28('0x65')]=_0x12465d[_0x8c28('0xc')]?JSON[_0x8c28('0x66')](_0x12465d[_0x8c28('0xc')]):{};}catch(_0x2d73ac){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2d73ac);}}try{_0x5e8f53[_0x8c28('0x67')]=_0x12465d[_0x8c28('0xb')]?JSON[_0x8c28('0x66')](_0x12465d[_0x8c28('0xb')]):{};}catch(_0x36e3bc){logger[_0x8c28('0x2c')](_0x8c28('0x68'),_0x36e3bc);}if(_0x12465d[_0x8c28('0x69')]){try{var _0x46f473=require(_0x12465d[_0x8c28('0x69')])['sync'](this,_0x5e8f53);_0x5e8f53[_0x8c28('0x6a')]=Mustache[_0x8c28('0x6b')](_0x12465d[_0x8c28('0x5e')],_0x46f473,{},['$$','$$']);if(_0x5e8f53[_0x8c28('0x67')]){_0x5e8f53[_0x8c28('0x67')]=JSON['parse'](Mustache['render'](JSON[_0x8c28('0x6c')](_0x5e8f53[_0x8c28('0x67')]),_0x46f473,{},['$$','$$']));}if(_0x5e8f53['body']){_0x5e8f53[_0x8c28('0x65')]=JSON[_0x8c28('0x66')](Mustache[_0x8c28('0x6b')](JSON[_0x8c28('0x6c')](_0x5e8f53[_0x8c28('0x65')]),_0x46f473,{},['$$','$$']));}}catch(_0xcac14a){logger[_0x8c28('0x2c')](_0x8c28('0x6d'),_0xcac14a);}}rp(_0x5e8f53)[_0x8c28('0x13')](function(_0x400437){var _0xd23262={'statusCode':_0x400437['statusCode']||0xc8,'statusMessage':_0x400437[_0x8c28('0x6e')]||'OK','headers':_0x400437[_0x8c28('0x67')]||{},'body':_0x400437[_0x8c28('0x65')]||{}};_0x3323a1(null,_0xd23262);})['catch'](function(_0x323b0f){var _0x3ff721={'statusCode':_0x323b0f[_0x8c28('0x6f')]||0x1f4,'statusMessage':_0x323b0f['message']||_0x8c28('0x70'),'headers':_0x323b0f['options'][_0x8c28('0x67')]||{},'body':_0x323b0f['options'][_0x8c28('0x65')]||{}};_0x3323a1(null,_0x3ff721);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x71')]=function(_0xed8b3d,_0x5e3e53){scripts[_0x8c28('0x71')](this['channel'][_0x8c28('0x3c')],_0xed8b3d[_0x8c28('0x72')],_0xed8b3d['text'],_0xed8b3d[_0x8c28('0x73')]||'en')['then'](function(_0xf02ff7){_0x5e3e53(null,_0xf02ff7);})[_0x8c28('0x17')](function(_0x39deeb){_0x5e3e53(_0x39deeb);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x74')]=function(_0x341af1,_0x58a81b){scripts[_0x8c28('0x74')](this[_0x8c28('0x33')]['uniqueid'],_0x341af1[_0x8c28('0x75')],_0x341af1[_0x8c28('0x76')],_0x341af1[_0x8c28('0x77')],_0x341af1[_0x8c28('0x55')],_0x341af1[_0x8c28('0x78')]||'en')['then'](function(_0x2de63b){_0x58a81b(null,_0x2de63b);})[_0x8c28('0x17')](function(_0x527ef6){_0x58a81b(_0x527ef6);});};AGIVertices['prototype'][_0x8c28('0x79')]=function(_0x5d755a,_0x44c573){scripts[_0x8c28('0x79')](this[_0x8c28('0x33')],_0x5d755a)[_0x8c28('0x13')](function(_0x5ae799){_0x44c573(null,_0x5ae799);})[_0x8c28('0x17')](function(_0x3a13fa){_0x44c573(_0x3a13fa);});};AGIVertices[_0x8c28('0xf')]['ispeechTTS']=function(_0x4daf3f,_0x526c6a){scripts['ispeechTTS'](_0x4daf3f[_0x8c28('0x72')],_0x4daf3f[_0x8c28('0x55')],_0x4daf3f[_0x8c28('0x7a')]||_0x8c28('0x57'),_0x4daf3f['speed'])['then'](function(_0x592738){_0x526c6a(null,_0x592738);})[_0x8c28('0x17')](function(_0x346722){_0x526c6a(_0x346722);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x7b')]=function(_0xfd2390,_0x34ff20,_0x14dbc6){scripts[_0x8c28('0x7b')](_0x34ff20,_0xfd2390['key'],_0xfd2390[_0x8c28('0x7c')]||_0x8c28('0x57'),this['isConfigured'](_0xfd2390[_0x8c28('0x7d')])?_0xfd2390[_0x8c28('0x7d')]:undefined)[_0x8c28('0x13')](function(_0x36172c){_0x14dbc6(null,_0x36172c);})[_0x8c28('0x17')](function(_0x235877){_0x14dbc6(_0x235877);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x7e')]=function(_0x6e39ea,_0x23b22d){scripts[_0x8c28('0x7e')](_0x6e39ea[_0x8c28('0x7f')],_0x6e39ea[_0x8c28('0x80')],_0x6e39ea[_0x8c28('0x81')],_0x6e39ea[_0x8c28('0x82')]||_0x8c28('0x83'),_0x6e39ea['text'],_0x6e39ea[_0x8c28('0x84')]||'text')[_0x8c28('0x13')](function(_0x456744){_0x23b22d(null,_0x456744);})[_0x8c28('0x17')](function(_0x3a223e){_0x23b22d(_0x3a223e);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x85')]=function(_0x53fa97,_0x566489){scripts[_0x8c28('0x85')](this['channel'][_0x8c28('0x3c')],_0x53fa97[_0x8c28('0x7f')],_0x53fa97[_0x8c28('0x80')],_0x53fa97[_0x8c28('0x86')],_0x53fa97[_0x8c28('0x55')],_0x53fa97[_0x8c28('0x87')])[_0x8c28('0x13')](function(_0x23d16b){_0x566489(null,_0x23d16b);})[_0x8c28('0x17')](function(_0x373793){_0x566489(_0x373793);});};AGIVertices[_0x8c28('0xf')][_0x8c28('0x88')]=function(_0x6a5383,_0x7a02,_0x184eff){scripts[_0x8c28('0x88')](_0x7a02,_0x6a5383[_0x8c28('0x72')],_0x6a5383['google_asr_language']||_0x8c28('0x57'))[_0x8c28('0x13')](function(_0x26816c){_0x184eff(null,_0x26816c);})[_0x8c28('0x17')](function(_0xe4a72b){_0x184eff(_0xe4a72b);});};AGIVertices[_0x8c28('0xf')]['tildeASR']=function(_0x56d28b,_0x15adc5,_0x2934ad){scripts[_0x8c28('0x89')](_0x15adc5,_0x56d28b[_0x8c28('0x8a')],_0x56d28b[_0x8c28('0x8b')],_0x56d28b['uri'])['then'](function(_0x2530a1){_0x2934ad(null,_0x2530a1);})[_0x8c28('0x17')](function(_0x2a9971){_0x2934ad(_0x2a9971);});};AGIVertices['prototype'][_0x8c28('0x8c')]=function(_0x298183){var _0x20ee05=_[_0x8c28('0x62')](verticesWithRetry,_0x298183[_0x8c28('0x8d')])?_0x298183:_[_0x8c28('0x8e')](_0x298183);for(var _0x3e16f6 in _0x20ee05){if(_0x20ee05[_0x8c28('0x8f')](_0x3e16f6)){if(_0x20ee05[_0x3e16f6]&&_[_0x8c28('0x90')](_0x20ee05[_0x3e16f6])){if(_['includes'](recursiveMapAttributes,_0x3e16f6)){_0x20ee05[_0x3e16f6]=this[_0x8c28('0x91')](_0x20ee05[_0x3e16f6]);}else{_0x20ee05[_0x3e16f6]=this[_0x8c28('0x92')](_0x20ee05[_0x3e16f6]);}}}}return _0x20ee05;};AGIVertices[_0x8c28('0xf')][_0x8c28('0x93')]=function(_0x5a22dd){for(var _0xabd29 in _0x5a22dd){if(_0x5a22dd[_0x8c28('0x8f')](_0xabd29)){if(_['isPlainObject'](_0x5a22dd[_0xabd29])){this[_0x8c28('0x93')](_0x5a22dd[_0xabd29]);}else if(_['isArray'](_0x5a22dd[_0xabd29])){for(var _0x1beacd=0x0;_0x1beacd<_0x5a22dd[_0xabd29]['length'];_0x1beacd++){this['recursiveNodeIndex'](_0x5a22dd[_0xabd29][_0x1beacd]);}}else if(_[_0x8c28('0x90')](_0x5a22dd[_0xabd29])){_0x5a22dd[_0xabd29]=this[_0x8c28('0x92')](_0x5a22dd[_0xabd29]);}}}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x94')]=function(_0x41481c,_0x2a0d5d){for(var _0x315d98 in _0x41481c){if(_0x41481c['hasOwnProperty'](_0x315d98)){if(_[_0x8c28('0x95')](_0x41481c[_0x315d98])){if(!_[_0x8c28('0x3e')](_0x41481c[_0x315d98])){this[_0x8c28('0x94')](_0x41481c[_0x315d98],util[_0x8c28('0x28')]('%s.%s',_0x2a0d5d,_0x315d98));}}else if(_[_0x8c28('0x96')](_0x41481c[_0x315d98])){for(var _0x2d9ce0=0x0;_0x2d9ce0<_0x41481c[_0x315d98][_0x8c28('0x97')];_0x2d9ce0++){this['saveRestApiResult'](_0x41481c[_0x315d98][_0x2d9ce0],util['format'](_0x8c28('0x98'),_0x2a0d5d,_0x315d98+'['+_0x2d9ce0+']'));}}else{if(!_[_0x8c28('0x41')](_0x41481c[_0x315d98])){this[_0x8c28('0x33')]['setVariable'](util[_0x8c28('0x28')](_0x8c28('0x98'),_0x2a0d5d,_0x315d98),_0x41481c[_0x315d98]);}}}}};AGIVertices['prototype'][_0x8c28('0x91')]=function(_0x2f1f09){try{var _0x47893a=JSON[_0x8c28('0x66')](_0x2f1f09);this[_0x8c28('0x93')](_0x47893a);return JSON[_0x8c28('0x6c')](_0x47893a);}catch(_0x3844d6){return this['replaceAllVariables'](_0x2f1f09);}};AGIVertices[_0x8c28('0xf')]['replaceAllVariables']=function(_0xad40bf){var _0x2d312f=_0xad40bf[_0x8c28('0x99')]('{');for(var _0x12bcf8=0x1;_0x12bcf8<_0x2d312f[_0x8c28('0x97')];_0x12bcf8+=0x1){var _0x42d884=_0x2d312f[_0x12bcf8][_0x8c28('0x99')]('}');if(_0x42d884['length']>0x1){_0xad40bf=_0xad40bf[_0x8c28('0x9a')]('{'+_0x42d884[0x0]+'}',this['channel'][_0x8c28('0x10')](_0x42d884[0x0])[_0x8c28('0x9b')]||_0x42d884[0x0]);}}if(_0x2d312f[_0x8c28('0x97')]===0x1){return _0xad40bf[_0x8c28('0x45')]();}return this[_0x8c28('0x92')](_0xad40bf);};AGIVertices[_0x8c28('0xf')]['getAndSetVariable']=function(_0x4177cc,_0x6bcaf7){var _0x184156=this[_0x8c28('0x33')][_0x8c28('0x10')](_0x4177cc);if(_0x184156['result']===-0x1){return _0x184156;}logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x6bcaf7,_0x184156[_0x8c28('0x9b')]));return this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x6bcaf7,_0x184156['extra']);};AGIVertices['prototype'][_0x8c28('0x9d')]=function(_0x2b734c){return _0x2b734c&&_0x2b734c!=='0'&&_0x2b734c!=='-1'&&_0x2b734c!=='';};AGIVertices[_0x8c28('0xf')][_0x8c28('0x9e')]=function(_0x3a52ad){this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x3a52ad,'-');_0x3a52ad['retry']=_0x3a52ad[_0x8c28('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x8c28('0xa0')]=function(_0x24ca73){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0xa1'),_0x24ca73[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x24ca73['text'])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0xa2'));}var _0x1a2b5a='\x22'+_0x24ca73[_0x8c28('0x55')]+'\x22';if(this[_0x8c28('0x9d')](_0x24ca73[_0x8c28('0xa3')])){_0x1a2b5a+=','+_0x24ca73[_0x8c28('0xa3')];}var _0xd7fb77=this['channel'][_0x8c28('0xa4')](_0x8c28('0xa5'),_0x1a2b5a);if(_0xd7fb77[_0x8c28('0xa6')]===-0x1){return _0xd7fb77;}return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0xa7'),_0x1a2b5a));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xa8')]=function(_0x319168){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0xa9'),_0x319168[_0x8c28('0x34')]));if(!this['isConfigured'](_0x319168[_0x8c28('0xaa')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xac'));}var _0x59410e=_0x319168['grammar'];if(this['isConfigured'](_0x319168['options'])){_0x59410e+=','+_0x319168[_0x8c28('0xa3')];}var _0x3bff90=this[_0x8c28('0x33')][_0x8c28('0xa4')]('MRCPRecog',_0x59410e);if(_0x3bff90[_0x8c28('0xa6')]===-0x1){return _0x3bff90;}var _0xad3d75=this[_0x8c28('0xad')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0xad3d75[_0x8c28('0xa6')]===-0x1){return _0xad3d75;}var _0x3a5b4f=this[_0x8c28('0xad')](_0x8c28('0xae'),_0x8c28('0xaf'));if(_0x3a5b4f[_0x8c28('0xa6')]===-0x1){return _0x3a5b4f;}var _0x281197=this[_0x8c28('0xad')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x281197[_0x8c28('0xa6')]===-0x1){return _0x281197;}return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0xb0'),_0x59410e));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x9')]=function(_0x3c94bd){logger[_0x8c28('0x2d')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3c94bd[_0x8c28('0x34')]));return this[_0x8c28('0x33')][_0x8c28('0x9')]([_0x3c94bd[_0x8c28('0xb1')],_0x3c94bd[_0x8c28('0xb2')]]);};AGIVertices[_0x8c28('0xf')][_0x8c28('0xb3')]=function(_0x3d31b9){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0xb4'),_0x3d31b9['label']));if(this[_0x8c28('0x9d')](_0x3d31b9[_0x8c28('0x61')])){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0xb5'),_0x3d31b9[_0x8c28('0x61')]));var _0x55bb3e=this[_0x8c28('0x33')][_0x8c28('0xb6')](_0x3d31b9[_0x8c28('0x61')]);if(_0x55bb3e[_0x8c28('0xa6')]===-0x1){return _0x55bb3e;}}return this[_0x8c28('0x33')][_0x8c28('0xb3')]();};AGIVertices[_0x8c28('0xf')][_0x8c28('0xb7')]=function(_0x4e758d){logger[_0x8c28('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4e758d['label']));if(!this['isConfigured'](_0x4e758d[_0x8c28('0xb8')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x4e758d,_0x8c28('0xb9'));}_0x4e758d[_0x8c28('0x44')]=moment();if(this[_0x8c28('0x9d')](_0x4e758d['delay'])){_0x4e758d[_0x8c28('0x44')]=moment()[_0x8c28('0xba')](_0x4e758d[_0x8c28('0xbb')],_0x8c28('0xbc'));}if(!this[_0x8c28('0x9d')](_0x4e758d[_0x8c28('0xbd')])){_0x4e758d[_0x8c28('0xbd')]=0x2;}this['createCmContact'][_0x8c28('0x9f')](this,_0x4e758d);return this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xbe'),_0x4e758d[_0x8c28('0x42')],_0x4e758d[_0x8c28('0xb8')],_0x4e758d[_0x8c28('0x44')]));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xbf')]=function(_0x249b6c){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0xc0'),_0x249b6c[_0x8c28('0x34')]));var _0x1734ac=this[_0x8c28('0x33')][_0x8c28('0xa4')](_0x249b6c['application'],_0x249b6c['options']);if(_0x1734ac[_0x8c28('0xa6')]===-0x1){return _0x1734ac;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xc1'),_0x249b6c['application'],_0x249b6c[_0x8c28('0xa3')]));};AGIVertices['prototype'][_0x8c28('0xc2')]=function(_0x583ef6){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0xc3'),_0x583ef6[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x583ef6['text'])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20text\x20configured');}var _0x3b79f5='\x22'+_0x583ef6['text']+'\x22';if(this[_0x8c28('0x9d')](_0x583ef6['options'])){_0x3b79f5+=','+_0x583ef6[_0x8c28('0xa3')];}var _0x179a1d=this['channel'][_0x8c28('0xa4')](_0x8c28('0xa5'),_0x3b79f5);if(_0x179a1d[_0x8c28('0xa6')]===-0x1){return _0x179a1d;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3b79f5));};AGIVertices['prototype'][_0x8c28('0xc4')]=function(_0x47a522){logger['info'](util[_0x8c28('0x28')](_0x8c28('0xc5'),_0x47a522[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x47a522['text'])){return this['channel']['noop'](_0x8c28('0xa2'));}var _0x14e925='\x22'+_0x47a522['text']+'\x22';if(this[_0x8c28('0x9d')](_0x47a522[_0x8c28('0xa3')])){_0x14e925+=','+_0x47a522['options'];}var _0x161ac9=this[_0x8c28('0x33')][_0x8c28('0xa4')]('MRCPSynth',_0x14e925);if(_0x161ac9[_0x8c28('0xa6')]===-0x1){return _0x161ac9;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0xa7'),_0x14e925));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xc6')]=function(_0x58f9da){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0xc7'),_0x58f9da[_0x8c28('0x34')]));if(!this['isConfigured'](_0x58f9da[_0x8c28('0xaa')])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20grammar\x20configured');}var _0x3012be=_0x58f9da[_0x8c28('0xaa')];if(this[_0x8c28('0x9d')](_0x58f9da[_0x8c28('0xa3')])){_0x3012be+=','+_0x58f9da['options'];}var _0x49053d=this[_0x8c28('0x33')]['exec'](_0x8c28('0xc8'),_0x3012be);if(_0x49053d[_0x8c28('0xa6')]===-0x1){return _0x49053d;}var _0x2b75eb=this['getAndSetVariable'](_0x8c28('0xc9'),_0x8c28('0xca'));if(_0x2b75eb[_0x8c28('0xa6')]===-0x1){return _0x2b75eb;}var _0x220785=this[_0x8c28('0xad')](_0x8c28('0xae'),_0x8c28('0xcb'));if(_0x220785['result']===-0x1){return _0x220785;}var _0x91708f=this[_0x8c28('0xad')](_0x8c28('0xcc'),_0x8c28('0xcd'));if(_0x91708f[_0x8c28('0xa6')]===-0x1){return _0x91708f;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xb0'),_0x3012be));};AGIVertices[_0x8c28('0xf')]['sestekasr']=function(_0x367dd5){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0xce'),_0x367dd5['label']));if(!this[_0x8c28('0x9d')](_0x367dd5[_0x8c28('0xaa')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xac'));}var _0xebb19d=_0x367dd5[_0x8c28('0xaa')];if(this[_0x8c28('0x9d')](_0x367dd5['options'])){_0xebb19d+=','+_0x367dd5[_0x8c28('0xa3')];}var _0x1de1b8=this[_0x8c28('0x33')]['exec'](_0x8c28('0xc8'),_0xebb19d);if(_0x1de1b8[_0x8c28('0xa6')]===-0x1){return _0x1de1b8;}var _0x39acc4=this[_0x8c28('0xad')](_0x8c28('0xc9'),'SESTEK_ASR_CONFIDENCE');if(_0x39acc4[_0x8c28('0xa6')]===-0x1){return _0x39acc4;}var _0xfa9b39=this[_0x8c28('0xad')](_0x8c28('0xae'),_0x8c28('0xcf'));if(_0xfa9b39[_0x8c28('0xa6')]===-0x1){return _0xfa9b39;}var _0x557b54=this[_0x8c28('0xad')]('RECOG_INSTANCE()',_0x8c28('0xd0'));if(_0x557b54[_0x8c28('0xa6')]===-0x1){return _0x557b54;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xb0'),_0xebb19d));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xd1')]=function(_0x3bf3eb){logger[_0x8c28('0x2d')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3bf3eb[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x3bf3eb[_0x8c28('0xd2')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x3bf3eb,_0x8c28('0xd3'));}var _0x132a70=this[_0x8c28('0x19')]['sync'](this,_0x3bf3eb[_0x8c28('0xd2')]);if(!_0x132a70){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x3bf3eb,_0x8c28('0xd4'));}if(!this[_0x8c28('0x9d')](_0x3bf3eb['query'])){return this['channel']['error'](_0x3bf3eb,_0x8c28('0xd5'));}var _0x1b9b31=_0x3bf3eb['query'][_0x8c28('0x51')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xd6'),_0x1b9b31));var _0x15a80a=this[_0x8c28('0x2a')][_0x8c28('0x9f')](this,_0x132a70,_0x1b9b31);this[_0x8c28('0x32')]['sync'](this,_0x3bf3eb,_0x1b9b31);if(!this[_0x8c28('0x9d')](_0x3bf3eb[_0x8c28('0xd7')])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0xd8'));}var _0x36855b=this[_0x8c28('0x10')][_0x8c28('0x9f')](this,_0x3bf3eb['variable_id']);if(!_0x36855b){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x3bf3eb,'no\x20variable\x20found');}var _0x12b8a5=this;_0x15a80a[_0x8c28('0xd9')](function(_0x26dabb,_0x15e4f3){Object['keys'](_0x26dabb)['forEach'](function(_0x11d0cd){_0x12b8a5[_0x8c28('0x33')][_0x8c28('0x9c')](util['format'](_0x8c28('0xda'),_0x36855b,_0x15e4f3,_0x11d0cd),_0x26dabb[_0x11d0cd]);});});this['channel'][_0x8c28('0x9c')](util[_0x8c28('0x28')](_0x8c28('0xdb'),_0x36855b),_0x15a80a[_0x8c28('0x97')]);return this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0xdc'),_0x36855b));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xdd')]=function(_0x43324e){logger[_0x8c28('0xde')](util[_0x8c28('0x28')](_0x8c28('0xdf'),_0x43324e[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x43324e[_0x8c28('0xe0')])){return this['channel'][_0x8c28('0x2c')](_0x43324e,_0x8c28('0xe1'));}var _0x2100f6=this['getUser'][_0x8c28('0x9f')](this,_0x43324e[_0x8c28('0xe0')]);if(!_0x2100f6){return this['channel']['error'](_0x43324e,_0x8c28('0xe2'));}var _0x36bc72=this[_0x8c28('0x33')][_0x8c28('0xa4')](_0x8c28('0xe3'),[util[_0x8c28('0x28')](_0x8c28('0xe4'),_0x2100f6),_0x43324e[_0x8c28('0x61')],_0x43324e['opts'],_0x43324e[_0x8c28('0x5e')]]);if(_0x36bc72[_0x8c28('0xa6')]===-0x1){return _0x36bc72;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0xe5'),_0x8c28('0xe3')));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xe6')]=function(_0x40acdb){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x40acdb['label']));if(!this[_0x8c28('0x9d')](_0x40acdb[_0x8c28('0x72')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xe7'));}if(!this[_0x8c28('0x9d')](_0x40acdb[_0x8c28('0x55')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xa2'));}this[_0x8c28('0x33')][_0x8c28('0xe8')]=!![];this['createSquareDetailsReport'](_0x40acdb);this['createSquareMessage'](_0x40acdb[_0x8c28('0x55')],'in','','');this['channel']['noop'](util[_0x8c28('0x28')](_0x8c28('0xe9'),_0x40acdb[_0x8c28('0x55')]));var _0x469e48=this[_0x8c28('0x71')][_0x8c28('0x9f')](this,_0x40acdb);if(_0x469e48){for(var _0x5bd366 in _0x469e48){if(_0x469e48[_0x8c28('0x8f')](_0x5bd366)){this[_0x8c28('0x33')][_0x8c28('0x9c')](util[_0x8c28('0x28')]('DIALOGFLOW_%s',_0x5bd366['toUpperCase']()),_0x469e48[_0x5bd366]);}}this[_0x8c28('0x3b')](_0x469e48[_0x8c28('0xea')],_0x8c28('0xeb'),_0x8c28('0xe6'),'');return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('Dialogflow\x20Result\x20%s',_0x469e48[_0x8c28('0xea')]));}return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x40acdb,_0x8c28('0xec'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0xed')]=function(_0x6a69cb){logger['info'](util['format'](_0x8c28('0xee'),_0x6a69cb[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x6a69cb['dialogflowV2_project_id'])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xef'));}if(!this[_0x8c28('0x9d')](_0x6a69cb[_0x8c28('0x76')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xf0'));}if(!this[_0x8c28('0x9d')](_0x6a69cb[_0x8c28('0x77')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0xf1'));}if(!this['isConfigured'](_0x6a69cb[_0x8c28('0x78')])){return this['channel'][_0x8c28('0xab')]('no\x20anguage\x20configured');}if(!this[_0x8c28('0x9d')](_0x6a69cb[_0x8c28('0x55')])){return this[_0x8c28('0x33')]['noop']('no\x20text\x20configured');}this['channel'][_0x8c28('0xe8')]=!![];this[_0x8c28('0x32')](_0x6a69cb);this[_0x8c28('0x3b')](_0x6a69cb['text'],'in','','');this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0xf2'),_0x6a69cb[_0x8c28('0x55')]));var _0x39d12c=this[_0x8c28('0x74')][_0x8c28('0x9f')](this,_0x6a69cb);if(_0x39d12c){for(var _0x1cff3c in _0x39d12c){if(_0x39d12c[_0x8c28('0x8f')](_0x1cff3c)){if(_0x1cff3c!==_0x8c28('0xf3')){this[_0x8c28('0x33')]['setVariable'](util['format'](_0x8c28('0xf4'),_0x1cff3c[_0x8c28('0x64')]()),_0x39d12c[_0x1cff3c]);}}}this[_0x8c28('0x3b')](_0x39d12c[_0x8c28('0xea')],_0x8c28('0xeb'),_0x8c28('0xed'),_0x39d12c['providerResponse']);return this[_0x8c28('0x33')][_0x8c28('0xab')](util['format']('DialogflowV2\x20Result\x20%s',_0x39d12c[_0x8c28('0xea')]));}return this['channel'][_0x8c28('0x2c')](_0x6a69cb,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x8c28('0xf')]['sesteknda']=function(_0x3004b0){logger['info'](util[_0x8c28('0x28')](_0x8c28('0xf5'),_0x3004b0['label']));if(!this[_0x8c28('0x9d')](_0x3004b0[_0x8c28('0xf6')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0xf7'));}if(!this[_0x8c28('0x9d')](_0x3004b0[_0x8c28('0xf8')])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20username\x20configured');}if(!this[_0x8c28('0x9d')](_0x3004b0['password'])){return this['channel'][_0x8c28('0xab')](_0x8c28('0xf9'));}if(!this['isConfigured'](_0x3004b0[_0x8c28('0xfa')])){return this[_0x8c28('0x33')]['noop']('no\x20text\x20configured');}this[_0x8c28('0x33')][_0x8c28('0xe8')]=!![];this['createSquareDetailsReport'](_0x3004b0);this[_0x8c28('0x3b')](_0x3004b0[_0x8c28('0x55')],'in','','');this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xfb'),_0x3004b0[_0x8c28('0x55')]));var _0x448102=this['sestekNDA'][_0x8c28('0x9f')](this,_0x3004b0);if(_0x448102){for(var _0x195d6a in _0x448102){if(_0x448102[_0x8c28('0x8f')](_0x195d6a)){this[_0x8c28('0x33')][_0x8c28('0x9c')](util['format'](_0x8c28('0xfc'),_0x195d6a[_0x8c28('0x64')]()),_0x448102[_0x195d6a]);}}this[_0x8c28('0x3b')](_0x448102[_0x8c28('0xea')],_0x8c28('0xeb'),_0x8c28('0xfd'),'');if(_0x448102[_0x8c28('0xfe')]){this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x448102[_0x8c28('0xfe')]));var _0x207ac0=this['channel'][_0x8c28('0xff')](_0x448102[_0x8c28('0xfe')]);try{fs[_0x8c28('0x100')](_0x448102[_0x8c28('0xfe')]+_0x8c28('0x101'));}catch(_0x3db089){logger[_0x8c28('0x2c')](_0x3db089);}return _0x207ac0;}else{return this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x102'),_0x448102[_0x8c28('0xea')]));}}return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x3004b0,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x8c28('0xf')]['end']=function(_0x313812){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x103'),_0x313812[_0x8c28('0x34')]));return this['channel'][_0x8c28('0xab')](_0x8c28('0x104'));};AGIVertices['prototype'][_0x8c28('0x105')]=function(_0x4c2ad8){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x106'),_0x4c2ad8[_0x8c28('0x34')]));var _0x57da6d='';if(_0x4c2ad8[_0x8c28('0x107')]){if(!this[_0x8c28('0x9d')](_0x4c2ad8[_0x8c28('0x107')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x4c2ad8,'no\x20trunk\x20selected');}else{var _0x34d41e=parseInt(_0x4c2ad8[_0x8c28('0x107')],0xa);if(isNaN(_0x34d41e)){_0x57da6d=_0x4c2ad8[_0x8c28('0x107')];}else{_0x57da6d=this[_0x8c28('0x1c')]['sync'](this,_0x4c2ad8[_0x8c28('0x107')]);if(!_0x57da6d){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x4c2ad8,_0x8c28('0x108'));}}}}else if(_0x4c2ad8['trunk_name']){_0x57da6d=_0x4c2ad8[_0x8c28('0x109')];}else{return this['channel'][_0x8c28('0x2c')](_0x4c2ad8,_0x8c28('0x10a'));}var _0x351a2f=this[_0x8c28('0x33')]['exec'](_0x8c28('0xe3'),[util['format']('SIP/%s/%s',_0x57da6d,_0x4c2ad8[_0x8c28('0x42')]),_0x4c2ad8[_0x8c28('0x61')],_0x4c2ad8[_0x8c28('0x10b')],_0x4c2ad8[_0x8c28('0x5e')]]);if(_0x351a2f['result']===-0x1){return _0x351a2f;}return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0xe5'),'DIAL'));};AGIVertices[_0x8c28('0xf')]['finally']=function(_0x5b8e77){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x10c'),_0x5b8e77[_0x8c28('0x34')]));return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0x10d'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x10e')]=function(_0x12fe5f){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x12fe5f[_0x8c28('0x34')]));if(_0x12fe5f[_0x8c28('0x10f')]===0x0){return this['maxRetry'](_0x12fe5f);}_0x12fe5f[_0x8c28('0x10f')]-=0x1;if(!this[_0x8c28('0x9d')](_0x12fe5f[_0x8c28('0x110')])){return this[_0x8c28('0x33')]['error'](_0x12fe5f,_0x8c28('0x111'));}var _0x1d8d60=this['getSound'][_0x8c28('0x9f')](this,_0x12fe5f[_0x8c28('0x110')]);if(!_0x1d8d60){return this[_0x8c28('0x33')]['error'](_0x12fe5f,_0x8c28('0x112'));}if(!this[_0x8c28('0x9d')](_0x12fe5f[_0x8c28('0xd7')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4f83ec=this['channel'][_0x8c28('0x113')](_0x1d8d60,_0x12fe5f['response'],_0x12fe5f['maxdigit']);var _0x3eb337=_0x4f83ec[_0x8c28('0xa6')]?_0x4f83ec[_0x8c28('0xa6')]['toString']():'';logger[_0x8c28('0x2d')](_0x8c28('0x114'),JSON[_0x8c28('0x6c')](_0x4f83ec));if(_0x4f83ec[_0x8c28('0xa6')]===-0x1){this['createSquareDetailsReport'][_0x8c28('0x9f')](this,_0x12fe5f,_0x3eb337);return _0x4f83ec;}else if(_0x4f83ec[_0x8c28('0x9b')]===_0x8c28('0x61')){_0x4f83ec[_0x8c28('0xa6')]=_0x3eb337[_0x8c28('0x97')]>=parseInt(_0x12fe5f['mindigit'])?'x':'i';}else{_0x4f83ec[_0x8c28('0xa6')]=_0x3eb337['length']>=parseInt(_0x12fe5f[_0x8c28('0x115')])&&_0x3eb337[_0x8c28('0x97')]<=parseInt(_0x12fe5f[_0x8c28('0x116')])?'x':'i';}var _0x82cc2=this[_0x8c28('0x10')][_0x8c28('0x9f')](this,_0x12fe5f[_0x8c28('0xd7')]);if(!_0x82cc2){return this['channel'][_0x8c28('0x2c')](_0x12fe5f,_0x8c28('0x117'));}this['channel'][_0x8c28('0x9c')](_0x82cc2,_0x3eb337);if(this[_0x8c28('0x9d')](_0x12fe5f[_0x8c28('0x118')])){var _0x3a5958=parseInt(_0x12fe5f['hiddendigitsnum'],0xa);var _0x3a0d90=rs['generate']({'charset':'*','length':_0x3a5958});var _0x426a7f=_0x3eb337['length'];if(_0x426a7f>0x0){if(_0x426a7f>_0x3a5958){this['createSquareDetailsReport']['sync'](this,_0x12fe5f,_0x12fe5f[_0x8c28('0x119')]===_0x8c28('0x11a')?_0x3a0d90+_0x3eb337[_0x8c28('0x11b')](_0x3a5958):_0x3eb337['substr'](0x0,_0x426a7f-_0x3a5958)+_0x3a0d90);}else{this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x12fe5f,rs[_0x8c28('0x11c')]({'charset':'*','length':_0x426a7f}));}}else{this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x12fe5f,'');}}else{this['createSquareDetailsReport'][_0x8c28('0x9f')](this,_0x12fe5f,_0x3eb337);}return _0x4f83ec;};AGIVertices[_0x8c28('0xf')][_0x8c28('0xe')]=function(_0x5145f1){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x11d'),_0x5145f1['label']));return this[_0x8c28('0x10e')](_0x5145f1);};AGIVertices[_0x8c28('0xf')][_0x8c28('0x11e')]=function(_0x455a6c){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x11f'),_0x455a6c['label']));this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x455a6c,_0x455a6c[_0x8c28('0x120')]);return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x121'),_0x455a6c['goalname']));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x122')]=function(_0x4f4c0e){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x123'),_0x4f4c0e[_0x8c28('0x34')]));if(!this['isConfigured'](_0x4f4c0e['aws_access_key_id'])||!this[_0x8c28('0x9d')](_0x4f4c0e['aws_secret_access_key'])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0x124'));}if(!this[_0x8c28('0x9d')](_0x4f4c0e['text'])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20text\x20configured');}this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x125'),_0x4f4c0e[_0x8c28('0x55')]));var _0xa5f1f7=this[_0x8c28('0x7e')]['sync'](this,_0x4f4c0e);if(_0xa5f1f7){this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x126'),_0xa5f1f7));var _0x6ff68e=this[_0x8c28('0x33')]['streamFile'](_0xa5f1f7);try{fs[_0x8c28('0x100')](_0xa5f1f7+'.wav');}catch(_0x41dad8){logger[_0x8c28('0x2c')](_0x41dad8);}return _0x6ff68e;}return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x4f4c0e,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x8c28('0xf')][_0x8c28('0x127')]=function(_0x3bf680){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x3bf680[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x3bf680[_0x8c28('0x7f')])||!this[_0x8c28('0x9d')](_0x3bf680[_0x8c28('0x80')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0x124'));}if(!this[_0x8c28('0x9d')](_0x3bf680['aws_bot_name'])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0x128'));}if(!this[_0x8c28('0x9d')](_0x3bf680[_0x8c28('0x55')])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20text\x20configured');}this[_0x8c28('0x33')][_0x8c28('0xe8')]=!![];this[_0x8c28('0x32')](_0x3bf680);this[_0x8c28('0x3b')](_0x3bf680[_0x8c28('0x55')],'in','','');this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3bf680[_0x8c28('0x55')]));var _0x1ea954=this[_0x8c28('0x85')][_0x8c28('0x9f')](this,_0x3bf680);if(_0x1ea954){for(var _0x33260b in _0x1ea954){if(_0x1ea954['hasOwnProperty'](_0x33260b)&&_['isString'](_0x1ea954[_0x33260b])){this[_0x8c28('0x33')]['setVariable'](util[_0x8c28('0x28')](_0x8c28('0x129'),_0x33260b[_0x8c28('0x64')]()),_0x1ea954[_0x33260b]);}}if(_['isNil'](_0x1ea954[_0x8c28('0x12a')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0x12b'));}else{this[_0x8c28('0x3b')](_0x1ea954[_0x8c28('0x12a')],'out',_0x8c28('0x12c'),'');return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x12d'),_0x1ea954[_0x8c28('0x12a')]));}}return this['channel']['error'](_0x3bf680,_0x8c28('0x12e'));};AGIVertices[_0x8c28('0xf')]['googleasr']=function(_0x10ebb6){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x10ebb6[_0x8c28('0x34')],_0x10ebb6[_0x8c28('0x61')]));if(!this[_0x8c28('0x9d')](_0x10ebb6[_0x8c28('0x72')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xe7'));}var _0x432f55=_0x8c28('0x12f');var _0x43b06c=util[_0x8c28('0x28')](_0x8c28('0x130'),FILES_PATH,rs['generate'](0x4));var _0x1bad4e=util[_0x8c28('0x28')](_0x8c28('0x98'),_0x43b06c,_0x432f55);var _0xeb3776=!![];if(_0x10ebb6['beep']==='NOBEEP'){_0xeb3776=![];}var _0xaae58c=this[_0x8c28('0x33')][_0x8c28('0x131')](_0x43b06c,_0x432f55,_0x10ebb6[_0x8c28('0x132')],_0x10ebb6['timeout'],undefined,_0xeb3776);if(_0xaae58c[_0x8c28('0xa6')]!==-0x1){this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0x133'),_0x1bad4e));var _0x5668d4=this[_0x8c28('0x88')][_0x8c28('0x9f')](this,_0x10ebb6,_0x1bad4e);if(_0x5668d4){for(var _0x51db95 in _0x5668d4){if(_0x5668d4[_0x8c28('0x8f')](_0x51db95)){this[_0x8c28('0x33')][_0x8c28('0x9c')](util[_0x8c28('0x28')](_0x8c28('0x134'),_0x51db95[_0x8c28('0x64')]()),_0x5668d4[_0x51db95]);}}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x8c28('0x6c')](_0x5668d4)));}}return _0xaae58c;};AGIVertices['prototype']['tildeasr']=function(_0x21323e){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x135'),_0x21323e[_0x8c28('0x34')]));if(!this['isConfigured'](_0x21323e[_0x8c28('0x8a')])){return this[_0x8c28('0x33')][_0x8c28('0xab')]('no\x20appid\x20configured');}if(!this[_0x8c28('0x9d')](_0x21323e['appsecret'])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0x136'));}var _0x4fee6e=_0x8c28('0x12f');var _0xdb4551=util[_0x8c28('0x28')](_0x8c28('0x130'),FILES_PATH,rs[_0x8c28('0x11c')](0x4));var _0x5850d4=util[_0x8c28('0x28')](_0x8c28('0x98'),_0xdb4551,_0x4fee6e);var _0x1e6c13=!![];if(_0x21323e[_0x8c28('0x137')]===_0x8c28('0x138')){_0x1e6c13=![];}var _0x289fb2=this[_0x8c28('0x33')][_0x8c28('0x131')](_0xdb4551,_0x4fee6e,_0x21323e[_0x8c28('0x132')],_0x21323e[_0x8c28('0x61')],undefined,_0x1e6c13);if(_0x289fb2[_0x8c28('0xa6')]!==-0x1){this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x139'),_0x5850d4));var _0x243507=this[_0x8c28('0x89')][_0x8c28('0x9f')](this,_0x21323e,_0x5850d4);if(_0x243507){for(var _0x1eb639 in _0x243507){if(_0x243507[_0x8c28('0x8f')](_0x1eb639)){this[_0x8c28('0x33')][_0x8c28('0x9c')](util['format'](_0x8c28('0x13a'),_0x1eb639['toUpperCase']()),_0x243507[_0x1eb639]);}}return this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x13b'),JSON['stringify'](_0x243507)));}}return _0x289fb2;};AGIVertices['prototype'][_0x8c28('0x13c')]=function(_0x40b96e){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x40b96e[_0x8c28('0x34')]));return this[_0x8c28('0x33')]['continueAt'](_0x40b96e[_0x8c28('0x37')],_0x40b96e[_0x8c28('0x38')],_0x40b96e[_0x8c28('0x13d')]);};AGIVertices[_0x8c28('0xf')][_0x8c28('0x13e')]=function(_0x35d4cd){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x13f'),_0x35d4cd['label']));if(!this[_0x8c28('0x9d')](_0x35d4cd[_0x8c28('0x140')])){return this[_0x8c28('0x33')]['error'](_0x35d4cd,_0x8c28('0x141'));}try{var _0x3ac80e=eval(_0x35d4cd[_0x8c28('0x140')])?_0x8c28('0x142'):_0x8c28('0x143');this['channel']['noop'](util['format'](_0x8c28('0x144'),_0x35d4cd[_0x8c28('0x140')],_0x3ac80e));return{'code':0xc8,'result':_0x3ac80e};}catch(_0x2ddd2a){return{'code':0xc8,'result':_0x8c28('0x143')};}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x145')]=function(_0x3904ae){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x146'),_0x3904ae[_0x8c28('0x34')]));if(!this['isConfigured'](_0x3904ae[_0x8c28('0x147')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x3904ae,_0x8c28('0x148'));}var _0x13708c=this['getIntervals']['sync'](this,_0x3904ae[_0x8c28('0x147')]);if(!_0x13708c){return this['channel'][_0x8c28('0x2c')](_0x3904ae,'no\x20intervals\x20found');}for(var _0x63a576=0x0;_0x63a576<_0x13708c[_0x8c28('0x97')];_0x63a576+=0x1){var _0x37fc4b=this[_0x8c28('0x33')]['getVariable'](util[_0x8c28('0x28')]('IFTIME(%s?true:false)',_0x13708c[_0x63a576]));if(_0x37fc4b['result']===-0x1){return _0x37fc4b;}logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x149'),_0x13708c[_0x63a576],_0x37fc4b[_0x8c28('0x9b')]));if(_0x37fc4b['extra']==='true'){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x149'),_0x13708c[_0x63a576],'true'));this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('IFTIME\x20%s\x20%s',_0x13708c[_0x63a576],_0x8c28('0x142')));return{'code':0xc8,'result':_0x8c28('0x142')};}else{logger['info'](util[_0x8c28('0x28')](_0x8c28('0x149'),_0x13708c[_0x63a576],_0x8c28('0x143')));this[_0x8c28('0x33')][_0x8c28('0xab')](util['format'](_0x8c28('0x149'),_0x13708c[_0x63a576],_0x8c28('0x143')));}}return{'code':0xc8,'result':_0x8c28('0x143')};};AGIVertices[_0x8c28('0xf')][_0x8c28('0x14a')]=function(_0x5a7b40){logger['info'](util['format'](_0x8c28('0x14b'),_0x5a7b40[_0x8c28('0x34')]));return this[_0x8c28('0x33')][_0x8c28('0x14a')]();};AGIVertices[_0x8c28('0xf')][_0x8c28('0x14c')]=function(_0x44d918){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x14d'),_0x44d918[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x44d918[_0x8c28('0x72')])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0xe7'));}var _0x1de897=_0x8c28('0x12f');var _0x14870a=util[_0x8c28('0x28')](_0x8c28('0x130'),FILES_PATH,rs[_0x8c28('0x11c')](0x4));var _0x2cc8da=util[_0x8c28('0x28')](_0x8c28('0x98'),_0x14870a,_0x1de897);var _0x494077=!![];if(_0x44d918[_0x8c28('0x137')]===_0x8c28('0x138')){_0x494077=![];}var _0x350893=this[_0x8c28('0x33')][_0x8c28('0x131')](_0x14870a,_0x1de897,_0x44d918[_0x8c28('0x132')],_0x44d918[_0x8c28('0x61')],undefined,_0x494077);if(_0x350893[_0x8c28('0xa6')]!==-0x1){this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x14e'),_0x2cc8da));var _0x16189e=this['ispeechASR'][_0x8c28('0x9f')](this,_0x44d918,_0x2cc8da);if(_0x16189e){for(var _0x132ffc in _0x16189e){if(_0x16189e[_0x8c28('0x8f')](_0x132ffc)){this['channel'][_0x8c28('0x9c')](util['format'](_0x8c28('0x14f'),_0x132ffc[_0x8c28('0x64')]()),_0x16189e[_0x132ffc]);}}return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x150'),JSON[_0x8c28('0x6c')](_0x16189e)));}}return _0x350893;};AGIVertices[_0x8c28('0xf')][_0x8c28('0x151')]=function(_0x4283a6){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x152'),_0x4283a6['label']));if(!this[_0x8c28('0x9d')](_0x4283a6['key'])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0xe7'));}if(!this[_0x8c28('0x9d')](_0x4283a6[_0x8c28('0x55')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xa2'));}this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x153'),_0x4283a6[_0x8c28('0x55')]));var _0x2971c6=this[_0x8c28('0x154')][_0x8c28('0x9f')](this,_0x4283a6);if(_0x2971c6){this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x14e'),_0x2971c6));var _0x4cada3=this[_0x8c28('0x33')][_0x8c28('0xff')](_0x2971c6,_0x4283a6[_0x8c28('0x132')]);try{fs['unlink'](_0x2971c6+_0x8c28('0x101'));}catch(_0x5a184f){logger[_0x8c28('0x2c')](_0x5a184f);}return _0x4cada3;}return this['channel'][_0x8c28('0x2c')](_0x4283a6,_0x8c28('0x155'));};AGIVertices['prototype']['login']=function(_0x252b01){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x156'),_0x252b01[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x252b01[_0x8c28('0x157')])){return this[_0x8c28('0x33')]['error'](_0x252b01,_0x8c28('0x158'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x252b01[_0x8c28('0x157')]));var _0x325b3e=this[_0x8c28('0x4c')][_0x8c28('0x9f')](this,_0x252b01[_0x8c28('0x157')]);if(_0x325b3e){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x252b01['findBy']));this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x252b01[_0x8c28('0x157')]));return{'code':0xc8,'result':_0x8c28('0x15a')};}else{logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x252b01[_0x8c28('0x157')]));this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x15b'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x252b01['findBy']));return{'code':0xc8,'result':_0x8c28('0x15c')};}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x15d')]=function(_0x1fbf9f){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x15e'),_0x1fbf9f[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x1fbf9f[_0x8c28('0x157')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x1fbf9f,_0x8c28('0x158'));}logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c28('0x33')]['callerid'],_0x1fbf9f[_0x8c28('0x157')]));var _0x2a49ce=this[_0x8c28('0x4b')][_0x8c28('0x9f')](this,_0x1fbf9f[_0x8c28('0x157')]);if(_0x2a49ce){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x1fbf9f[_0x8c28('0x157')]));this['channel'][_0x8c28('0xab')](util['format'](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x1fbf9f['findBy']));return{'code':0xc8,'result':_0x8c28('0x15a')};}else{logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x15b'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x1fbf9f[_0x8c28('0x157')]));this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x15b'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x1fbf9f[_0x8c28('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x15f')]=function(_0x193936){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x160'),_0x193936['label']));if(!this[_0x8c28('0x9d')](_0x193936[_0x8c28('0x161')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x193936,_0x8c28('0x162'));}this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x163'),_0x193936[_0x8c28('0x161')]));var _0x429dd4=eval(_0x193936[_0x8c28('0x161')]);if(!this['isConfigured'](_0x193936[_0x8c28('0xd7')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0xd8'));}var _0x32e32b=this[_0x8c28('0x10')][_0x8c28('0x9f')](this,_0x193936[_0x8c28('0xd7')]);if(!_0x32e32b){return this['channel'][_0x8c28('0x2c')](_0x193936,_0x8c28('0x117'));}if(_[_0x8c28('0x96')](_0x429dd4)){var _0x712227=this;_0x429dd4[_0x8c28('0xd9')](function(_0x54b421,_0x3a869c){_0x712227[_0x8c28('0x33')]['setVariable'](util[_0x8c28('0x28')]('%s[%s]',_0x32e32b,_0x3a869c),_0x54b421);});return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('variable\x20%s[key]\x20set',_0x32e32b));}else{return this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x32e32b,_0x429dd4);}};AGIVertices[_0x8c28('0xf')][_0x8c28('0xd')]=function(_0x1d1bd0){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1d1bd0[_0x8c28('0x34')]));if(_0x1d1bd0['retry']===0x0){return this[_0x8c28('0x9e')](_0x1d1bd0);}_0x1d1bd0[_0x8c28('0x10f')]-=0x1;if(!this['isConfigured'](_0x1d1bd0['file_id'])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x1d1bd0,_0x8c28('0x111'));}var _0x5ce326=this['getSound'][_0x8c28('0x9f')](this,_0x1d1bd0[_0x8c28('0x110')]);if(!_0x5ce326){return this[_0x8c28('0x33')]['error'](_0x1d1bd0,'no\x20file\x20audio\x20found');}var _0x4d9459=this[_0x8c28('0x33')][_0x8c28('0x113')](_0x5ce326,_0x1d1bd0[_0x8c28('0x164')],_0x1d1bd0[_0x8c28('0x165')]);var _0x1b30fa=_0x4d9459[_0x8c28('0xa6')];if(_0x4d9459['result']===-0x1){this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x1d1bd0,'-1');return _0x4d9459;}else if(_0x4d9459[_0x8c28('0x9b')]===_0x8c28('0x61')){_0x4d9459[_0x8c28('0xa6')]=_0x4d9459[_0x8c28('0xa6')][_0x8c28('0x97')]>0x0?_0x4d9459[_0x8c28('0xa6')]:'t';}else if(_[_0x8c28('0x3e')](_0x4d9459['result'])){_0x4d9459[_0x8c28('0xa6')]='#';_0x1b30fa='#';}if(!this[_0x8c28('0x9d')](_0x1d1bd0[_0x8c28('0xd7')])){this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xd8'));}else{var _0x3cebf2=this[_0x8c28('0x10')]['sync'](this,_0x1d1bd0[_0x8c28('0xd7')]);if(!_0x3cebf2){return this['channel'][_0x8c28('0x2c')](_0x1d1bd0,_0x8c28('0x117'));}this['channel'][_0x8c28('0x9c')](_0x3cebf2,_0x1b30fa);}this[_0x8c28('0x32')]['sync'](this,_0x1d1bd0,_0x1b30fa);return _0x4d9459;};AGIVertices['prototype'][_0x8c28('0xab')]=function(_0x738f2f){logger['info'](util['format'](_0x8c28('0x166'),_0x738f2f[_0x8c28('0x34')]));return this['channel'][_0x8c28('0xab')](_0x738f2f[_0x8c28('0x167')]||_0x738f2f['label']);};AGIVertices[_0x8c28('0xf')][_0x8c28('0x168')]=function(_0x2e23c7){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x169'),_0x2e23c7[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x2e23c7['findBy'])){return this['channel'][_0x8c28('0x2c')](_0x2e23c7,_0x8c28('0x158'));}logger['info'](util[_0x8c28('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x8c28('0x35')],_0x2e23c7[_0x8c28('0x157')]));var _0x5c71b6=this[_0x8c28('0x46')]['sync'](this,_0x2e23c7['pause_id']);var _0x5d3192=this[_0x8c28('0x48')][_0x8c28('0x9f')](this,_0x2e23c7[_0x8c28('0x157')],_0x5c71b6);if(_0x5d3192){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')]['callerid'],_0x2e23c7['findBy']));this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x2e23c7[_0x8c28('0x157')]));return{'code':0xc8,'result':_0x8c28('0x15a')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8c28('0x35')],_0x2e23c7[_0x8c28('0x157')]));this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x2e23c7[_0x8c28('0x157')]));return{'code':0xc8,'result':_0x8c28('0x15c')};}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x16a')]=function(_0x5b3aa2){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x16b'),_0x5b3aa2['label']));if(!this['isConfigured'](_0x5b3aa2[_0x8c28('0x110')])){return this['channel'][_0x8c28('0x2c')](_0x5b3aa2,_0x8c28('0x111'));}var _0x2664a6=this['getSound'][_0x8c28('0x9f')](this,_0x5b3aa2[_0x8c28('0x110')]);if(!_0x2664a6){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x5b3aa2,_0x8c28('0x112'));}var _0x29080a=this[_0x8c28('0x33')]['exec'](_0x8c28('0x16c'),[_0x2664a6,_0x5b3aa2[_0x8c28('0x10b')]]);if(_0x29080a[_0x8c28('0xa6')]===-0x1){return _0x29080a;}return this['channel'][_0x8c28('0xab')](util['format'](_0x8c28('0xc1'),_0x8c28('0x16c'),_0x2664a6));};AGIVertices[_0x8c28('0xf')]['queue']=function(_0x80b6de){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x80b6de[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x80b6de[_0x8c28('0x16d')])){return this[_0x8c28('0x33')]['error'](_0x80b6de,_0x8c28('0x16e'));}var _0x45b385='';var _0x38c756=parseInt(_0x80b6de['queue_id'],0xa);if(isNaN(_0x38c756)){_0x45b385=_0x80b6de[_0x8c28('0x16d')];}else{_0x45b385=this[_0x8c28('0x15')][_0x8c28('0x9f')](this,_0x80b6de[_0x8c28('0x16d')]);if(!_0x45b385){return this['channel']['error'](_0x80b6de,_0x8c28('0x16f'));}}var _0x4e9856='';if(this[_0x8c28('0x9d')](_0x80b6de[_0x8c28('0x110')])){var _0x5d934b=this[_0x8c28('0x1d')]['sync'](this,_0x80b6de[_0x8c28('0x110')]);if(_0x5d934b){_0x4e9856=_0x5d934b;}}this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x80b6de,_0x45b385);if(_0x80b6de['opts'][_0x8c28('0x170')]('x')<0x0){_0x80b6de[_0x8c28('0x10b')]+='x';}if(_0x80b6de[_0x8c28('0x10b')][_0x8c28('0x170')]('X')<0x0){_0x80b6de['opts']+='X';}this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x8c28('0x171'),_0x45b385?_0x45b385[_0x8c28('0x172')]():'');var _0x1db23f=this[_0x8c28('0x33')]['exec'](_0x8c28('0x173'),[_0x45b385,_0x80b6de[_0x8c28('0x10b')],_0x80b6de[_0x8c28('0x5e')],_0x4e9856,_0x80b6de[_0x8c28('0x61')],_0x80b6de['agi'],_0x80b6de[_0x8c28('0x174')],_0x80b6de[_0x8c28('0x175')],'',_0x80b6de[_0x8c28('0x176')]]);if(_0x1db23f[_0x8c28('0xa6')]===-0x1){return _0x1db23f;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')]('Executed\x20command\x20%s\x20%s',_0x8c28('0x173'),_0x45b385));};AGIVertices[_0x8c28('0xf')]['record']=function(_0x5772a8){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x177'),_0x5772a8[_0x8c28('0x34')]));var _0x5513e2=_0x5772a8['recordingFormat']||_0x8c28('0x12f');var _0x14b62e=util[_0x8c28('0x28')](_0x8c28('0x178'),this[_0x8c28('0x33')]['uniqueid'],rs[_0x8c28('0x11c')](0x5));var _0x272eef=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x14b62e,_0x5513e2);var _0x3e0932=util[_0x8c28('0x28')](_0x8c28('0x130'),FILES_PATH,_0x14b62e);this[_0x8c28('0x36')]['sync'](this,_0x5772a8,_0x14b62e,_0x272eef);this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x8c28('0x179'),_0x14b62e);logger[_0x8c28('0x2d')](_0x8c28('0x17a'),_0x3e0932,_0x5513e2,_0x5772a8[_0x8c28('0x17b')],_0x5772a8['timeout']);return this[_0x8c28('0x33')][_0x8c28('0x131')](_0x3e0932,_0x5513e2,_0x5772a8[_0x8c28('0x17b')],_0x5772a8[_0x8c28('0x61')],undefined,!![]);};AGIVertices[_0x8c28('0xf')]['restapi']=function(_0x1ba1a4){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1ba1a4[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x1ba1a4[_0x8c28('0x5e')])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0x17c'));}var _0x5a9d45=this[_0x8c28('0x5d')]['sync'](this,_0x1ba1a4);logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x17d'),util[_0x8c28('0x17e')](_0x5a9d45,{'showHidden':![],'depth':null})));if(!this[_0x8c28('0x9d')](_0x1ba1a4[_0x8c28('0xd7')])){return this['channel'][_0x8c28('0xab')](_0x8c28('0x17f'));}var _0x52bc=this[_0x8c28('0x10')][_0x8c28('0x9f')](this,_0x1ba1a4[_0x8c28('0xd7')]);if(!_0x52bc){return this[_0x8c28('0x33')]['error'](_0x1ba1a4,'no\x20variable\x20found');}this['channel'][_0x8c28('0x9c')](util['format'](_0x8c28('0x180'),_0x52bc),_0x5a9d45[_0x8c28('0x6f')]?_0x5a9d45['statusCode']:_0x8c28('0x181'));this[_0x8c28('0x33')][_0x8c28('0x9c')](util[_0x8c28('0x28')](_0x8c28('0x182'),_0x52bc),_0x5a9d45[_0x8c28('0x6e')]?_0x5a9d45[_0x8c28('0x6e')]:'OK');if(_0x5a9d45[_0x8c28('0x65')]){try{this[_0x8c28('0x94')](_0x5a9d45[_0x8c28('0x65')],_0x52bc);}catch(_0x4e7fa0){logger[_0x8c28('0x2c')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x52bc));}}return this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')]('variable\x20%s\x20set',_0x52bc));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x183')]=function(_0x4f9898){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x184'),_0x4f9898[_0x8c28('0x34')]));return this['channel'][_0x8c28('0x185')](_0x4f9898[_0x8c28('0x186')][_0x8c28('0x51')](/\s+/g,''),_0x4f9898['escape_digits']);};AGIVertices[_0x8c28('0xf')]['saynumber']=function(_0x2f9ec2){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2f9ec2['label']));return this[_0x8c28('0x33')][_0x8c28('0x187')](_0x2f9ec2[_0x8c28('0x60')][_0x8c28('0x51')](/\s+/g,''),_0x2f9ec2[_0x8c28('0x17b')]);};AGIVertices['prototype']['sayphonetic']=function(_0x5075af){logger['info'](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5075af['label']));return this[_0x8c28('0x33')]['sayPhonetic'](_0x5075af[_0x8c28('0x55')],_0x5075af[_0x8c28('0x17b')]);};AGIVertices[_0x8c28('0xf')][_0x8c28('0x188')]=function(_0x1fd442){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x189'),_0x1fd442[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x1fd442[_0x8c28('0x18a')])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0x18b'));}var _0x1a94c7=this[_0x8c28('0x18c')]['sync'](this,_0x1fd442[_0x8c28('0x18a')]);if(!_0x1a94c7||!_0x1a94c7[_0x8c28('0x18d')]){return this[_0x8c28('0x33')]['error'](_0x1fd442,_0x8c28('0x18e'));}var _0x5840dd={'from':util[_0x8c28('0x28')]('\x22%s\x22\x20<%s>',_0x1a94c7['name'],_0x1a94c7[_0x8c28('0x18f')]||_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x190')]),'to':_0x1fd442['to']||'','cc':_0x1fd442['cc']||'','bcc':_0x1fd442[_0x8c28('0x191')]||'','subject':_0x1fd442[_0x8c28('0x192')],'html':_0x1fd442['text'],'text':_0x1fd442['text']};var _0x46572d={'tls':{'rejectUnauthorized':![]}};if(_0x1a94c7[_0x8c28('0x18d')]['service']){_0x46572d[_0x8c28('0x193')]=_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x193')];}else{_0x46572d[_0x8c28('0x194')]=_0x1a94c7[_0x8c28('0x18d')]['host'];_0x46572d['port']=_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x195')];_0x46572d[_0x8c28('0x196')]=_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x196')];}if(_0x1a94c7[_0x8c28('0x18d')]['authentication']){_0x46572d[_0x8c28('0x197')]={'user':_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x190')],'pass':_0x1a94c7[_0x8c28('0x18d')][_0x8c28('0x198')]};}if(this[_0x8c28('0x9d')](_0x1fd442[_0x8c28('0x199')])){}logger[_0x8c28('0xde')](_0x8c28('0x19a'),JSON['stringify'](_0x5840dd));this['createSquareDetailsReport']['sync'](this,_0x1fd442,_0x1fd442['account_id']);this['channel']['noop'](util[_0x8c28('0x28')](_0x8c28('0x19b'),_0x1a94c7[_0x8c28('0x14')]));this[_0x8c28('0x20')][_0x8c28('0x9f')](this,_0x46572d,_0x5840dd);return this[_0x8c28('0x33')]['noop'](_0x8c28('0x19c'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x19d')]=function(_0xfd2596){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xfd2596[_0x8c28('0x34')]));return this[_0x8c28('0x33')][_0x8c28('0xab')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x8c28('0xf')][_0x8c28('0x19e')]=function(_0x3fc1dc){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x19f'),_0x3fc1dc[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x3fc1dc['sms_account_id'])){return this['channel'][_0x8c28('0xab')]('no\x20sms\x20account\x20configured');}var _0x39286e=this[_0x8c28('0x1a0')][_0x8c28('0x9f')](this,_0x3fc1dc['sms_account_id']);if(!_0x39286e){return this[_0x8c28('0x33')]['error'](_0x3fc1dc,_0x8c28('0x1a1'));}var _0x446772={'body':_0x3fc1dc[_0x8c28('0x1a2')],'phone':_0x3fc1dc['to']||'','SmsAccountId':_0x39286e['id']};logger[_0x8c28('0xde')](_0x8c28('0x1a3'),JSON['stringify'](_0x446772));this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x3fc1dc,_0x3fc1dc[_0x8c28('0x1a4')]);this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x1a5'),_0x39286e['name']));this['createSmsMessage'][_0x8c28('0x9f')](this,_0x446772);return this[_0x8c28('0x33')][_0x8c28('0xab')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1a6')]=function(_0x2dcbf8){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x1a7'),_0x2dcbf8[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x2dcbf8[_0x8c28('0xd7')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x2dcbf8,'no\x20variable\x20selected');}var _0x2f4300=this[_0x8c28('0x10')]['sync'](this,_0x2dcbf8[_0x8c28('0xd7')]);if(!_0x2f4300){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x2dcbf8,_0x8c28('0x117'));}return this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x2f4300,_0x2dcbf8['variable_value']);};AGIVertices['prototype']['start']=function(_0x59e073){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x1a8'),_0x59e073[_0x8c28('0x34')]));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0x59e073[_0x8c28('0xb3')]===_0x8c28('0x1a9')){this['channel'][_0x8c28('0xab')](_0x8c28('0x1aa'));return this['channel'][_0x8c28('0xb3')]();}return this[_0x8c28('0x33')]['noop'](_0x8c28('0x1ab'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1ac')]=function(_0x53a49a){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x1ad'),_0x53a49a[_0x8c28('0x34')]));if(!this[_0x8c28('0x9d')](_0x53a49a[_0x8c28('0x1ae')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x53a49a,_0x8c28('0x1af'));}var _0x160bf8=this['getSquareProject']['sync'](this,_0x53a49a[_0x8c28('0x1ae')]);if(!this[_0x8c28('0x9d')](_0x160bf8)){return this['channel'][_0x8c28('0x2c')](_0x53a49a,util[_0x8c28('0x28')](_0x8c28('0x1b0'),_0x53a49a[_0x8c28('0x1ae')]));}if(_0x160bf8===this['channel'][_0x8c28('0x1b1')]){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x53a49a,_0x8c28('0x1b2'));}this[_0x8c28('0x32')]['sync'](this,_0x53a49a,_0x160bf8);var _0x11f510=this['channel'][_0x8c28('0xa4')](_0x8c28('0x1b3'),util['format'](_0x8c28('0x1b4'),config['agi'][_0x8c28('0x194')]||'127.0.0.1',_0x160bf8,this['channel'][_0x8c28('0x1b1')]));if(_0x11f510[_0x8c28('0xa6')]===-0x1){return _0x11f510;}return this[_0x8c28('0x33')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x8c28('0x1b3'),_0x160bf8));};AGIVertices[_0x8c28('0xf')]['system']=function(_0x36bf77){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x1b5'),_0x36bf77[_0x8c28('0x34')]));var _0x292e2d=this[_0x8c28('0x4f')]['sync'](this,_0x36bf77['command']);this[_0x8c28('0x32')][_0x8c28('0x9f')](this,_0x36bf77,_0x36bf77[_0x8c28('0xb1')]);if(this[_0x8c28('0x9d')](_0x36bf77['variable_id'])){var _0x43f442=this[_0x8c28('0x10')][_0x8c28('0x9f')](this,_0x36bf77[_0x8c28('0xd7')]);if(_0x43f442){this[_0x8c28('0x33')][_0x8c28('0x9c')](_0x43f442,_0x292e2d);return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x1b6'),_0x36bf77['command'],_0x43f442));}}return this[_0x8c28('0x33')]['noop'](util['format'](_0x8c28('0x1b7'),_0x36bf77[_0x8c28('0xb1')]));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1b8')]=function(_0x58ef4e){logger['info'](util[_0x8c28('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x58ef4e[_0x8c28('0x34')]));_0x58ef4e[_0x8c28('0x55')]=_0x58ef4e[_0x8c28('0x55')][_0x8c28('0x51')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8c28('0x9d')](_0x58ef4e[_0x8c28('0x53')])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0x1b9'));}if(!this['isConfigured'](_0x58ef4e[_0x8c28('0x55')])){return this[_0x8c28('0x33')][_0x8c28('0xab')](_0x8c28('0xa2'));}this['channel'][_0x8c28('0xab')](util['format'](_0x8c28('0x1ba'),_0x58ef4e[_0x8c28('0x55')]));var _0x1166be=this[_0x8c28('0x52')][_0x8c28('0x9f')](this,_0x58ef4e);if(_0x1166be){this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x1bb'),_0x1166be));var _0x1b5b03=this[_0x8c28('0x33')]['streamFile'](_0x1166be);try{fs['unlink'](_0x1166be+_0x8c28('0x101'));}catch(_0x4f572a){logger['error'](_0x4f572a);}return _0x1b5b03;}return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x58ef4e,_0x8c28('0x1bc'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1bd')]=function(_0x24c3e3){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x1be'),_0x24c3e3[_0x8c28('0x34')]));_0x24c3e3[_0x8c28('0x55')]=_0x24c3e3['text'][_0x8c28('0x51')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8c28('0x9d')](_0x24c3e3['text'])){return this[_0x8c28('0x33')]['noop'](_0x8c28('0xa2'));}this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x24c3e3[_0x8c28('0x55')]));var _0x16ef45=this[_0x8c28('0x5b')][_0x8c28('0x9f')](this,_0x24c3e3);if(_0x16ef45){this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0x1bf'),_0x16ef45));var _0x73cdd9=this['channel']['streamFile'](_0x16ef45);try{fs[_0x8c28('0x100')](_0x16ef45+'.wav');}catch(_0x42ff03){logger[_0x8c28('0x2c')](_0x42ff03);}return _0x73cdd9;}return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x24c3e3,_0x8c28('0x1c0'));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1c1')]=function(_0x79c419){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')](_0x8c28('0x1c2'),_0x79c419['label']));if(!this[_0x8c28('0x9d')](_0x79c419[_0x8c28('0x157')])){return this[_0x8c28('0x33')][_0x8c28('0x2c')](_0x79c419,_0x8c28('0x158'));}logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x79c419[_0x8c28('0x157')]));var _0x15bb7a=this['agentUnpause'][_0x8c28('0x9f')](this,_0x79c419[_0x8c28('0x157')]);if(_0x15bb7a){logger[_0x8c28('0x2d')](util[_0x8c28('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x79c419[_0x8c28('0x157')]));this[_0x8c28('0x33')]['noop'](util[_0x8c28('0x28')](_0x8c28('0x159'),this[_0x8c28('0x33')][_0x8c28('0x35')],_0x79c419[_0x8c28('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8c28('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x79c419['findBy']));this['channel'][_0x8c28('0xab')](util[_0x8c28('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8c28('0x33')][_0x8c28('0x35')],_0x79c419[_0x8c28('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1c3')]=function(_0x26ed77){logger['info'](util[_0x8c28('0x28')](_0x8c28('0x1c4'),_0x26ed77[_0x8c28('0x34')]));var _0x400502=this[_0x8c28('0x33')][_0x8c28('0xa4')](_0x8c28('0x1c5'),[_0x26ed77[_0x8c28('0x1c6')],_0x26ed77['options']]);if(_0x400502[_0x8c28('0xa6')]===-0x1){return _0x400502;}return this[_0x8c28('0x33')][_0x8c28('0xab')](util[_0x8c28('0x28')](_0x8c28('0xc1'),'VOICEMAIL',_0x26ed77[_0x8c28('0x1c6')]));};AGIVertices[_0x8c28('0xf')][_0x8c28('0x1c7')]=function(_0x232bf3){logger[_0x8c28('0x2d')](util['format'](_0x8c28('0x1c8'),_0x232bf3['label']));if(!this[_0x8c28('0x9d')](_0x232bf3[_0x8c28('0xd7')])){return this[_0x8c28('0x33')]['error'](_0x232bf3,_0x8c28('0x1c9'));}var _0x4c452a=this['getVariable'][_0x8c28('0x9f')](this,_0x232bf3['variable_id']);if(!_0x4c452a){return this[_0x8c28('0x33')]['error'](_0x232bf3,_0x8c28('0x117'));}var _0x4080f7=this[_0x8c28('0x33')][_0x8c28('0x10')](_0x4c452a);return{'code':0xc8,'result':_0x4080f7[_0x8c28('0x9b')]?_0x4080f7[_0x8c28('0x9b')]:'-'};};String[_0x8c28('0xf')][_0x8c28('0x9a')]=function(_0xbf37f5,_0x23cac6){return this['split'](_0xbf37f5)['join'](_0x23cac6);};module[_0x8c28('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 402faf0..d91ccd0 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 _0xd524=['name','Action','QueuePause','then','getAgent','voicePause','info','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','finally','[ACW][START]\x20%s','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x441d25,_0x30aa5d){var _0xd78a58=function(_0x303103){while(--_0x303103){_0x441d25['push'](_0x441d25['shift']());}};_0xd78a58(++_0x30aa5d);}(_0xd524,0x191));var _0x4d52=function(_0x72ad5c,_0x511b8a){_0x72ad5c=_0x72ad5c-0x0;var _0x200548=_0xd524[_0x72ad5c];return _0x200548;};'use strict';var util=require(_0x4d52('0x0'));var _=require(_0x4d52('0x1'));var moment=require('moment');var ami=require(_0x4d52('0x2'));var logger=require(_0x4d52('0x3'))(_0x4d52('0x4'));var RpcUser=require(_0x4d52('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3bab49){this[_0x4d52('0x6')]=_0x3bab49[_0x4d52('0x6')];this['agents']=_0x3bab49[_0x4d52('0x7')];this[_0x4d52('0x8')]=_0x3bab49[_0x4d52('0x8')];this['channels']={};ami['on'](_0x4d52('0x9'),this[_0x4d52('0xa')][_0x4d52('0xb')](this));ami['on'](_0x4d52('0xc'),this['syncHangupRequest'][_0x4d52('0xb')](this));ami['on'](_0x4d52('0xd'),this['syncHangup'][_0x4d52('0xb')](this));ami['on'](_0x4d52('0xe'),this['syncAgentRingNoAnswer'][_0x4d52('0xb')](this));ami['on'](_0x4d52('0xf'),this[_0x4d52('0x10')][_0x4d52('0xb')](this));ami['on'](_0x4d52('0x11'),this['syncBlindTransfer'][_0x4d52('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x4d52('0x12')][_0x4d52('0xb')](this));}function getDiff(_0x554d78){var _0x42b2fe=moment()[_0x4d52('0x13')](0x0);var _0x1346f4=moment(_0x554d78)[_0x4d52('0x13')](0x0);return _0x42b2fe[_0x4d52('0x14')](_0x1346f4,_0x4d52('0x15'));}Acw[_0x4d52('0x16')][_0x4d52('0x17')]=function(_0x1cfa8b){try{var _0x260439=this;var _0x3c58ea=this[_0x4d52('0x18')][_0x1cfa8b][_0x4d52('0x19')];var _0x1a7c66=this[_0x4d52('0x18')][_0x1cfa8b][_0x4d52('0x1a')];var _0x4e4b5a=this[_0x4d52('0x6')][_0x1a7c66];var _0x3de5b9=![];var _0x4d8c0e='ACW';if(_0x4e4b5a[_0x4d52('0x1b')]){if(_0x4e4b5a[_0x4d52('0x1c')][_0x4d52('0x1d')]){_0x3de5b9=!![];_0x4d8c0e=_0x4e4b5a[_0x4d52('0x1c')][_0x4d52('0x1d')];}}ami[_0x4d52('0x1e')]({'action':_0x4d52('0x1f'),'interface':_0x3c58ea,'paused':!![],'reason':_0x4d8c0e})[_0x4d52('0x20')](function(_0x5034f7){if(_0x260439[_0x4d52('0x7')][_0x3c58ea]){return RpcUser[_0x4d52('0x21')](_0x260439['agents'][_0x3c58ea]['id'])[_0x4d52('0x20')](function(_0x287adc){if(_0x287adc&&!_0x287adc[_0x4d52('0x22')]){logger[_0x4d52('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x1cfa8b,_0x3c58ea,_0x1a7c66);var _0x339167=_0x260439[_0x4d52('0x18')][_0x1cfa8b][_0x4d52('0x24')]&&_0x260439['channels'][_0x1cfa8b]['destlinkedid']?_0x260439[_0x4d52('0x18')][_0x1cfa8b]['destlinkedid']:_0x1cfa8b;return RpcUser[_0x4d52('0x25')](_0x260439[_0x4d52('0x7')][_0x3c58ea],_0x4d8c0e,_0x339167)[_0x4d52('0x20')](function(_0x3504a7){if(!_0x3de5b9){_0x260439[_0x4d52('0x8')][_0x3c58ea]={};logger[_0x4d52('0x23')](_0x4d52('0x26'),_0x1cfa8b,_0x260439[_0x4d52('0x6')][_0x1a7c66][_0x4d52('0x27')],_0x3c58ea,_0x1a7c66);_0x260439[_0x4d52('0x8')][_0x3c58ea][_0x4d52('0x28')]=setTimeout(_0x260439[_0x4d52('0x29')][_0x4d52('0xb')](_0x260439,_0x3c58ea),_0x260439[_0x4d52('0x6')][_0x1a7c66][_0x4d52('0x27')]*0x3e8);_0x260439[_0x4d52('0x8')][_0x3c58ea][_0x4d52('0x2a')]=moment()['format'](_0x4d52('0x2b'));_0x260439['timers'][_0x3c58ea][_0x4d52('0x2c')]=_0x1cfa8b;_0x260439['timers'][_0x3c58ea]['queue']=_0x1a7c66;_0x260439[_0x4d52('0x8')][_0x3c58ea][_0x4d52('0x2d')]=function(){var _0x156961=getDiff(_0x260439[_0x4d52('0x8')][_0x3c58ea][_0x4d52('0x2a')]);clearTimeout(_0x260439[_0x4d52('0x8')][_0x3c58ea][_0x4d52('0x28')]);_0x260439['timers'][_0x3c58ea][_0x4d52('0x28')]=![];RpcVoiceAgentReport[_0x4d52('0x2e')]({'acwtime':_0x156961},_0x260439[_0x4d52('0x8')][_0x3c58ea]['uniqueid'],_0x3c58ea)[_0x4d52('0x20')](function(_0x105e16){logger[_0x4d52('0x23')](_0x4d52('0x2f'),_0x1cfa8b,_0x156961,_0x105e16);})['catch'](function(_0x21768c){logger[_0x4d52('0x30')](_0x4d52('0x31'),_0x1cfa8b,_0x21768c);});delete _0x260439[_0x4d52('0x8')][_0x3c58ea];};}});}else{logger[_0x4d52('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1cfa8b,_0x3c58ea,_0x1a7c66);}});}})[_0x4d52('0x32')](function(_0x3ec74c){logger[_0x4d52('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1cfa8b,_0x260439[_0x4d52('0x6')][_0x1a7c66][_0x4d52('0x27')],_0x3c58ea,_0x1a7c66);})[_0x4d52('0x33')](function(){delete _0x260439[_0x4d52('0x18')][_0x1cfa8b];});}catch(_0x4c9b4c){logger[_0x4d52('0x30')](_0x4d52('0x34'),_0x4c9b4c['message']);}};Acw[_0x4d52('0x16')]['stopAcw']=function(_0x191767){try{var _0xcfdff5=this;if(_0xcfdff5[_0x4d52('0x8')][_0x191767]){_0xcfdff5[_0x4d52('0x8')][_0x191767][_0x4d52('0x28')]=![];var _0x5eeaf6=_0xcfdff5['timers'][_0x191767][_0x4d52('0x2c')];var _0xd62836=_0xcfdff5[_0x4d52('0x8')][_0x191767][_0x4d52('0x1a')];var _0x4b04a8=_0xcfdff5[_0x4d52('0x6')][_0xd62836][_0x4d52('0x27')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x5eeaf6,_0x191767);RpcUser[_0x4d52('0x35')](this[_0x4d52('0x7')][_0x191767]);RpcVoiceAgentReport[_0x4d52('0x2e')]({'acwtime':_0x4b04a8,'agentacw':!![]},_0x5eeaf6,_0x191767)[_0x4d52('0x20')](function(_0x121157){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x5eeaf6,_0x4b04a8,_0x121157);})['catch'](function(_0x5a3d82){logger[_0x4d52('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x5eeaf6,_0x5a3d82);});}else{logger['error'](_0x4d52('0x36'),_0x191767);if(_0xcfdff5[_0x4d52('0x8')]){logger[_0x4d52('0x23')]('[ACW][TIMERS]',JSON[_0x4d52('0x37')](_0xcfdff5[_0x4d52('0x8')]));}}}catch(_0x195451){logger[_0x4d52('0x30')](_0x4d52('0x38'),_0x195451[_0x4d52('0x39')]);}};Acw[_0x4d52('0x16')][_0x4d52('0xa')]=function(_0x31bb61){try{if(this[_0x4d52('0x6')][_0x31bb61['queue']]&&(this['voiceQueues'][_0x31bb61[_0x4d52('0x1a')]][_0x4d52('0x4')]||this[_0x4d52('0x6')][_0x31bb61[_0x4d52('0x1a')]][_0x4d52('0x1b')])){if(this[_0x4d52('0x7')][_0x31bb61[_0x4d52('0x19')]]){this[_0x4d52('0x18')][_0x31bb61[_0x4d52('0x2c')]]={'queue':_0x31bb61[_0x4d52('0x1a')],'interface':_0x31bb61[_0x4d52('0x19')],'destlinkedid':_0x31bb61[_0x4d52('0x3a')]};}}}catch(_0x48c37d){logger[_0x4d52('0x30')](_0x4d52('0x3b'),_0x48c37d[_0x4d52('0x39')]);}};Acw[_0x4d52('0x16')][_0x4d52('0x12')]=function(_0x11e1ca){try{if(this[_0x4d52('0x6')][_0x11e1ca[_0x4d52('0x1a')]]&&(this['voiceQueues'][_0x11e1ca[_0x4d52('0x1a')]][_0x4d52('0x4')]||this[_0x4d52('0x6')][_0x11e1ca[_0x4d52('0x1a')]][_0x4d52('0x1b')])){if(this[_0x4d52('0x7')][_0x11e1ca[_0x4d52('0x19')]]){this['channels'][_0x11e1ca[_0x4d52('0x2c')]]={'queue':_0x11e1ca[_0x4d52('0x1a')],'interface':_0x11e1ca[_0x4d52('0x19')]};}}}catch(_0x98f72c){logger[_0x4d52('0x30')](_0x4d52('0x3c'),_0x98f72c['message']);}};Acw['prototype'][_0x4d52('0x3d')]=function(_0xd5ff5d){try{if(this[_0x4d52('0x18')][_0xd5ff5d[_0x4d52('0x2c')]]&&_[_0x4d52('0x3e')](this[_0x4d52('0x18')][_0xd5ff5d[_0x4d52('0x2c')]][_0x4d52('0x24')])){logger[_0x4d52('0x23')](_0x4d52('0x3f'),_0xd5ff5d[_0x4d52('0x2c')]);this[_0x4d52('0x17')](_0xd5ff5d[_0x4d52('0x2c')]);}else if(this[_0x4d52('0x18')][_0xd5ff5d['linkedid']]&&_[_0x4d52('0x3e')](this['channels'][_0xd5ff5d[_0x4d52('0x40')]][_0x4d52('0x24')])){logger[_0x4d52('0x23')](_0x4d52('0x41'),_0xd5ff5d[_0x4d52('0x40')]);this['startAcw'](_0xd5ff5d[_0x4d52('0x40')]);}}catch(_0x263a4a){logger[_0x4d52('0x30')](_0x4d52('0x42'),_0x263a4a[_0x4d52('0x39')]);}};Acw['prototype'][_0x4d52('0x43')]=function(_0x342700){try{if(this['channels'][_0x342700['uniqueid']]&&this['channels'][_0x342700[_0x4d52('0x2c')]]['attended']){logger['info'](_0x4d52('0x44'),_0x342700[_0x4d52('0x2c')]);this[_0x4d52('0x17')](_0x342700['uniqueid']);}else if(this['channels'][_0x342700[_0x4d52('0x40')]]&&this[_0x4d52('0x18')][_0x342700[_0x4d52('0x40')]][_0x4d52('0x24')]){logger[_0x4d52('0x23')](_0x4d52('0x45'),_0x342700[_0x4d52('0x40')]);this[_0x4d52('0x17')](_0x342700[_0x4d52('0x40')]);}}catch(_0xa8869d){logger[_0x4d52('0x30')](_0x4d52('0x46'),_0xa8869d[_0x4d52('0x39')]);}};Acw[_0x4d52('0x16')][_0x4d52('0x10')]=function(_0x17441b){try{if(!_[_0x4d52('0x47')](this[_0x4d52('0x18')][_0x17441b['transfereeuniqueid']])){this[_0x4d52('0x17')](_0x17441b['transfereeuniqueid']);if(this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x48')]]){this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x48')]][_0x4d52('0x24')]=!![];this[_0x4d52('0x18')][_0x17441b['transfertargetuniqueid']]=this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x48')]];delete this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x48')]];}}else if(!_[_0x4d52('0x47')](this['channels'][_0x17441b[_0x4d52('0x49')]])){this[_0x4d52('0x17')](_0x17441b['transfertargetuniqueid']);if(this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x4a')]]){this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x4a')]][_0x4d52('0x24')]=!![];this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x4b')]]=this[_0x4d52('0x18')][_0x17441b[_0x4d52('0x4a')]];delete this[_0x4d52('0x18')][_0x17441b['origtransfereruniqueid']];}}}catch(_0x556670){logger[_0x4d52('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x556670[_0x4d52('0x39')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x35ad5e){try{if(this[_0x4d52('0x18')][_0x35ad5e[_0x4d52('0x4c')]]){logger[_0x4d52('0x23')](_0x4d52('0x4d'),JSON[_0x4d52('0x37')](_0x35ad5e[_0x4d52('0x4c')]));this[_0x4d52('0x17')](_0x35ad5e[_0x4d52('0x4c')]);}else if(this[_0x4d52('0x18')][_0x35ad5e[_0x4d52('0x4e')]]){logger[_0x4d52('0x23')](_0x4d52('0x4f'),JSON[_0x4d52('0x37')](_0x35ad5e['transfererlinkedid']));this['startAcw'](_0x35ad5e[_0x4d52('0x4e')]);}}catch(_0x46384c){logger[_0x4d52('0x30')]('[ACW][syncBlindTransfer]\x20%s',_0x46384c[_0x4d52('0x39')]);}};Acw[_0x4d52('0x16')][_0x4d52('0x50')]=function(_0x1166f5){try{if(this[_0x4d52('0x6')][_0x1166f5[_0x4d52('0x1a')]]&&this[_0x4d52('0x6')][_0x1166f5[_0x4d52('0x1a')]]['autopause']===_0x4d52('0x51')){if(this[_0x4d52('0x7')][_0x1166f5[_0x4d52('0x19')]]){logger['info'](_0x4d52('0x52'),_0x1166f5[_0x4d52('0x2c')],_0x1166f5[_0x4d52('0x19')],_0x1166f5[_0x4d52('0x1a')]);return RpcUser[_0x4d52('0x25')](this['agents'][_0x1166f5[_0x4d52('0x19')]],_0x4d52('0x53'),_0x1166f5[_0x4d52('0x2c')]);}}}catch(_0x56b7d1){logger['error'](_0x4d52('0x54'),_0x56b7d1[_0x4d52('0x39')]);}};module[_0x4d52('0x55')]=Acw; \ No newline at end of file +var _0xaab6=['agentconnect','bind','syncHangupRequest','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','milliseconds','seconds','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','name','then','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','queue','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers'];(function(_0x4a827e,_0x212316){var _0x44f714=function(_0x29bbc3){while(--_0x29bbc3){_0x4a827e['push'](_0x4a827e['shift']());}};_0x44f714(++_0x212316);}(_0xaab6,0xe8));var _0x6aab=function(_0x2c8b51,_0x238f77){_0x2c8b51=_0x2c8b51-0x0;var _0x4e9c1e=_0xaab6[_0x2c8b51];return _0x4e9c1e;};'use strict';var util=require(_0x6aab('0x0'));var _=require('lodash');var moment=require(_0x6aab('0x1'));var ami=require(_0x6aab('0x2'));var logger=require(_0x6aab('0x3'))(_0x6aab('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1faa2d){this[_0x6aab('0x5')]=_0x1faa2d[_0x6aab('0x5')];this[_0x6aab('0x6')]=_0x1faa2d[_0x6aab('0x6')];this['timers']=_0x1faa2d[_0x6aab('0x7')];this['channels']={};ami['on'](_0x6aab('0x8'),this['syncAgentConnect'][_0x6aab('0x9')](this));ami['on']('hanguprequest',this[_0x6aab('0xa')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x6aab('0x9')](this));ami['on'](_0x6aab('0xb'),this[_0x6aab('0xc')][_0x6aab('0x9')](this));ami['on'](_0x6aab('0xd'),this['syncAttendedTransfer'][_0x6aab('0x9')](this));ami['on'](_0x6aab('0xe'),this['syncBlindTransfer'][_0x6aab('0x9')](this));ami['on'](_0x6aab('0xf'),this['syncAgentConnectPreview'][_0x6aab('0x9')](this));}function getDiff(_0x4c87f9){var _0x2acf28=moment()[_0x6aab('0x10')](0x0);var _0x39bc86=moment(_0x4c87f9)['milliseconds'](0x0);return _0x2acf28['diff'](_0x39bc86,_0x6aab('0x11'));}Acw[_0x6aab('0x12')][_0x6aab('0x13')]=function(_0x55508f){try{var _0x96be22=this;var _0x56a0e9=this[_0x6aab('0x14')][_0x55508f][_0x6aab('0x15')];var _0x3c0e94=this[_0x6aab('0x14')][_0x55508f]['queue'];var _0x1884fa=this['voiceQueues'][_0x3c0e94];var _0x28c240=![];var _0x353e8e=_0x6aab('0x16');if(_0x1884fa[_0x6aab('0x17')]){if(_0x1884fa['mandatoryDispositionPause'][_0x6aab('0x18')]){_0x28c240=!![];_0x353e8e=_0x1884fa['mandatoryDispositionPause'][_0x6aab('0x18')];}}ami['Action']({'action':'QueuePause','interface':_0x56a0e9,'paused':!![],'reason':_0x353e8e})['then'](function(_0x2413b7){if(_0x96be22['agents'][_0x56a0e9]){return RpcUser['getAgent'](_0x96be22[_0x6aab('0x6')][_0x56a0e9]['id'])[_0x6aab('0x19')](function(_0x2f4bb3){if(_0x2f4bb3&&!_0x2f4bb3['voicePause']){logger[_0x6aab('0x1a')](_0x6aab('0x1b'),_0x55508f,_0x56a0e9,_0x3c0e94);var _0x54ca03=_0x96be22[_0x6aab('0x14')][_0x55508f]['attended']&&_0x96be22[_0x6aab('0x14')][_0x55508f]['destlinkedid']?_0x96be22[_0x6aab('0x14')][_0x55508f][_0x6aab('0x1c')]:_0x55508f;return RpcUser[_0x6aab('0x1d')](_0x96be22[_0x6aab('0x6')][_0x56a0e9],_0x353e8e,_0x54ca03)[_0x6aab('0x19')](function(_0x2d3971){if(!_0x28c240){_0x96be22[_0x6aab('0x7')][_0x56a0e9]={};logger[_0x6aab('0x1a')](_0x6aab('0x1e'),_0x55508f,_0x96be22['voiceQueues'][_0x3c0e94]['acwTimeout'],_0x56a0e9,_0x3c0e94);_0x96be22[_0x6aab('0x7')][_0x56a0e9][_0x6aab('0x1f')]=setTimeout(_0x96be22['stopAcw'][_0x6aab('0x9')](_0x96be22,_0x56a0e9),_0x96be22[_0x6aab('0x5')][_0x3c0e94][_0x6aab('0x20')]*0x3e8);_0x96be22[_0x6aab('0x7')][_0x56a0e9][_0x6aab('0x21')]=moment()[_0x6aab('0x22')](_0x6aab('0x23'));_0x96be22[_0x6aab('0x7')][_0x56a0e9][_0x6aab('0x24')]=_0x55508f;_0x96be22['timers'][_0x56a0e9]['queue']=_0x3c0e94;_0x96be22['timers'][_0x56a0e9][_0x6aab('0x25')]=function(){var _0x5a105c=getDiff(_0x96be22[_0x6aab('0x7')][_0x56a0e9][_0x6aab('0x21')]);clearTimeout(_0x96be22['timers'][_0x56a0e9][_0x6aab('0x1f')]);_0x96be22[_0x6aab('0x7')][_0x56a0e9]['timer']=![];RpcVoiceAgentReport[_0x6aab('0x26')]({'acwtime':_0x5a105c},_0x96be22[_0x6aab('0x7')][_0x56a0e9][_0x6aab('0x24')],_0x56a0e9)[_0x6aab('0x19')](function(_0x4d86e9){logger[_0x6aab('0x1a')](_0x6aab('0x27'),_0x55508f,_0x5a105c,_0x4d86e9);})[_0x6aab('0x28')](function(_0x35ffc4){logger[_0x6aab('0x29')](_0x6aab('0x2a'),_0x55508f,_0x35ffc4);});delete _0x96be22[_0x6aab('0x7')][_0x56a0e9];};}});}else{logger[_0x6aab('0x1a')](_0x6aab('0x2b'),_0x55508f,_0x56a0e9,_0x3c0e94);}});}})[_0x6aab('0x28')](function(_0x5635a6){logger[_0x6aab('0x29')](_0x6aab('0x1e'),_0x55508f,_0x96be22[_0x6aab('0x5')][_0x3c0e94][_0x6aab('0x20')],_0x56a0e9,_0x3c0e94);})['finally'](function(){delete _0x96be22[_0x6aab('0x14')][_0x55508f];});}catch(_0x4b707e){logger[_0x6aab('0x29')](_0x6aab('0x2c'),_0x4b707e[_0x6aab('0x2d')]);}};Acw[_0x6aab('0x12')]['stopAcw']=function(_0x331ac1){try{var _0x1baedb=this;if(_0x1baedb['timers'][_0x331ac1]){_0x1baedb[_0x6aab('0x7')][_0x331ac1]['timer']=![];var _0x310f4e=_0x1baedb[_0x6aab('0x7')][_0x331ac1][_0x6aab('0x24')];var _0x500d66=_0x1baedb['timers'][_0x331ac1][_0x6aab('0x2e')];var _0x22a3e6=_0x1baedb['voiceQueues'][_0x500d66][_0x6aab('0x20')];logger[_0x6aab('0x1a')](_0x6aab('0x2f'),_0x310f4e,_0x331ac1);RpcUser['saveUnpause'](this[_0x6aab('0x6')][_0x331ac1]);RpcVoiceAgentReport[_0x6aab('0x26')]({'acwtime':_0x22a3e6,'agentacw':!![]},_0x310f4e,_0x331ac1)[_0x6aab('0x19')](function(_0x35fc9f){logger[_0x6aab('0x1a')](_0x6aab('0x27'),_0x310f4e,_0x22a3e6,_0x35fc9f);})['catch'](function(_0x1f276){logger[_0x6aab('0x29')]('[%s][UPDATE][ERRORS:%s]',_0x310f4e,_0x1f276);});}else{logger['error'](_0x6aab('0x30'),_0x331ac1);if(_0x1baedb[_0x6aab('0x7')]){logger[_0x6aab('0x1a')](_0x6aab('0x31'),JSON[_0x6aab('0x32')](_0x1baedb[_0x6aab('0x7')]));}}}catch(_0x5bfae0){logger[_0x6aab('0x29')](_0x6aab('0x33'),_0x5bfae0[_0x6aab('0x2d')]);}};Acw['prototype'][_0x6aab('0x34')]=function(_0x668f82){try{if(this[_0x6aab('0x5')][_0x668f82[_0x6aab('0x2e')]]&&(this[_0x6aab('0x5')][_0x668f82['queue']][_0x6aab('0x4')]||this['voiceQueues'][_0x668f82[_0x6aab('0x2e')]][_0x6aab('0x17')])){if(this[_0x6aab('0x6')][_0x668f82['interface']]){this[_0x6aab('0x14')][_0x668f82[_0x6aab('0x24')]]={'queue':_0x668f82[_0x6aab('0x2e')],'interface':_0x668f82[_0x6aab('0x15')],'destlinkedid':_0x668f82[_0x6aab('0x1c')]};}}}catch(_0xde7e3b){logger['error'](_0x6aab('0x35'),_0xde7e3b[_0x6aab('0x2d')]);}};Acw[_0x6aab('0x12')][_0x6aab('0x36')]=function(_0x80be9a){try{if(this[_0x6aab('0x5')][_0x80be9a[_0x6aab('0x2e')]]&&(this[_0x6aab('0x5')][_0x80be9a[_0x6aab('0x2e')]][_0x6aab('0x4')]||this['voiceQueues'][_0x80be9a[_0x6aab('0x2e')]][_0x6aab('0x17')])){if(this[_0x6aab('0x6')][_0x80be9a[_0x6aab('0x15')]]){this[_0x6aab('0x14')][_0x80be9a[_0x6aab('0x24')]]={'queue':_0x80be9a[_0x6aab('0x2e')],'interface':_0x80be9a['interface']};}}}catch(_0x1a7834){logger[_0x6aab('0x29')](_0x6aab('0x37'),_0x1a7834[_0x6aab('0x2d')]);}};Acw['prototype'][_0x6aab('0xa')]=function(_0x100372){try{if(this[_0x6aab('0x14')][_0x100372[_0x6aab('0x24')]]&&_[_0x6aab('0x38')](this[_0x6aab('0x14')][_0x100372[_0x6aab('0x24')]]['attended'])){logger[_0x6aab('0x1a')](_0x6aab('0x39'),_0x100372[_0x6aab('0x24')]);this[_0x6aab('0x13')](_0x100372[_0x6aab('0x24')]);}else if(this['channels'][_0x100372['linkedid']]&&_['isUndefined'](this['channels'][_0x100372[_0x6aab('0x3a')]][_0x6aab('0x3b')])){logger[_0x6aab('0x1a')](_0x6aab('0x3c'),_0x100372[_0x6aab('0x3a')]);this[_0x6aab('0x13')](_0x100372['linkedid']);}}catch(_0x4af1e2){logger[_0x6aab('0x29')](_0x6aab('0x3d'),_0x4af1e2['message']);}};Acw[_0x6aab('0x12')][_0x6aab('0x3e')]=function(_0x5e83ee){try{if(this[_0x6aab('0x14')][_0x5e83ee['uniqueid']]&&this[_0x6aab('0x14')][_0x5e83ee['uniqueid']][_0x6aab('0x3b')]){logger[_0x6aab('0x1a')](_0x6aab('0x3f'),_0x5e83ee[_0x6aab('0x24')]);this[_0x6aab('0x13')](_0x5e83ee['uniqueid']);}else if(this['channels'][_0x5e83ee['linkedid']]&&this['channels'][_0x5e83ee[_0x6aab('0x3a')]][_0x6aab('0x3b')]){logger[_0x6aab('0x1a')](_0x6aab('0x40'),_0x5e83ee[_0x6aab('0x3a')]);this['startAcw'](_0x5e83ee[_0x6aab('0x3a')]);}}catch(_0x24de11){logger[_0x6aab('0x29')]('[ACW][syncHangup]\x20%s',_0x24de11['message']);}};Acw[_0x6aab('0x12')][_0x6aab('0x41')]=function(_0x140e63){try{if(!_['isNil'](this[_0x6aab('0x14')][_0x140e63['transfereeuniqueid']])){this['startAcw'](_0x140e63[_0x6aab('0x42')]);if(this['channels'][_0x140e63[_0x6aab('0x43')]]){this['channels'][_0x140e63[_0x6aab('0x43')]][_0x6aab('0x3b')]=!![];this[_0x6aab('0x14')][_0x140e63[_0x6aab('0x44')]]=this['channels'][_0x140e63[_0x6aab('0x43')]];delete this['channels'][_0x140e63[_0x6aab('0x43')]];}}else if(!_['isNil'](this['channels'][_0x140e63['transfertargetuniqueid']])){this[_0x6aab('0x13')](_0x140e63[_0x6aab('0x44')]);if(this[_0x6aab('0x14')][_0x140e63[_0x6aab('0x45')]]){this['channels'][_0x140e63[_0x6aab('0x45')]]['attended']=!![];this['channels'][_0x140e63[_0x6aab('0x42')]]=this[_0x6aab('0x14')][_0x140e63['origtransfereruniqueid']];delete this[_0x6aab('0x14')][_0x140e63[_0x6aab('0x45')]];}}}catch(_0x4ca646){logger[_0x6aab('0x29')]('[ACW][syncAttendedTransfer]\x20%s',_0x4ca646[_0x6aab('0x2d')]);}};Acw[_0x6aab('0x12')]['syncBlindTransfer']=function(_0x52ca68){try{if(this[_0x6aab('0x14')][_0x52ca68[_0x6aab('0x46')]]){logger[_0x6aab('0x1a')](_0x6aab('0x47'),JSON[_0x6aab('0x32')](_0x52ca68[_0x6aab('0x46')]));this[_0x6aab('0x13')](_0x52ca68[_0x6aab('0x46')]);}else if(this['channels'][_0x52ca68[_0x6aab('0x48')]]){logger['info'](_0x6aab('0x49'),JSON['stringify'](_0x52ca68[_0x6aab('0x48')]));this[_0x6aab('0x13')](_0x52ca68[_0x6aab('0x48')]);}}catch(_0x2785be){logger[_0x6aab('0x29')](_0x6aab('0x4a'),_0x2785be[_0x6aab('0x2d')]);}};Acw[_0x6aab('0x12')][_0x6aab('0xc')]=function(_0x2f4c8b){try{if(this['voiceQueues'][_0x2f4c8b[_0x6aab('0x2e')]]&&this[_0x6aab('0x5')][_0x2f4c8b[_0x6aab('0x2e')]][_0x6aab('0x4b')]===_0x6aab('0x4c')){if(this['agents'][_0x2f4c8b[_0x6aab('0x15')]]){logger[_0x6aab('0x1a')](_0x6aab('0x4d'),_0x2f4c8b[_0x6aab('0x24')],_0x2f4c8b['interface'],_0x2f4c8b[_0x6aab('0x2e')]);return RpcUser[_0x6aab('0x1d')](this['agents'][_0x2f4c8b[_0x6aab('0x15')]],_0x6aab('0x4e'),_0x2f4c8b['uniqueid']);}}}catch(_0x3d535f){logger[_0x6aab('0x29')](_0x6aab('0x4f'),_0x3d535f[_0x6aab('0x2d')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8ae4dee..9427464 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 _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x1e4305,_0x5b1de6){var _0x27b4ec=function(_0x3738df){while(--_0x3738df){_0x1e4305['push'](_0x1e4305['shift']());}};_0x27b4ec(++_0x5b1de6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +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(_0x26c53b,_0x39b43b){var _0x124277=function(_0x14159b){while(--_0x14159b){_0x26c53b['push'](_0x26c53b['shift']());}};_0x124277(++_0x39b43b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x0b0e[_0x4c6d6f];return _0x2d4478;};'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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a907f4b..93c9e3e 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 _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xac4a,0x13f));var _0xaac4=function(_0x5bf281,_0x450c54){_0x5bf281=_0x5bf281-0x0;var _0x22eb15=_0xac4a[_0x5bf281];return _0x22eb15;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xcb91[_0x51c819];return _0x15c5d2;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index c34bb75..4002f86 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 _0xa78f=['\x22%s\x22\x20<%s>','dialCutDigit','substring','voiceQueue','prototype','getQueue','queue','exports','util','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller'];(function(_0x3ec10c,_0x2b12aa){var _0x29d7da=function(_0x51822f){while(--_0x51822f){_0x3ec10c['push'](_0x3ec10c['shift']());}};_0x29d7da(++_0x2b12aa);}(_0xa78f,0x8c));var _0xfa78=function(_0x5c989e,_0x3bb062){_0x5c989e=_0x5c989e-0x0;var _0x1cd16d=_0xa78f[_0x5c989e];return _0x1cd16d;};'use strict';var util=require(_0xfa78('0x0'));var _=require('lodash');var moment=require(_0xfa78('0x1'));function checkNameSurname(_0x4b0443,_0xb1038d,_0x32316a){var _0x47a756='';if(!_[_0xfa78('0x2')](_0xb1038d)&&'string'===typeof _0xb1038d){_0x47a756+=_0xb1038d;}if(!_[_0xfa78('0x2')](_0x32316a)&&_0xfa78('0x3')===typeof _0x32316a){_0x47a756+='\x20'+_0x32316a;}if(_0x47a756!==''){return _0x47a756;}return _0x4b0443;}function Action(_0x3b6fe5,_0x32afd1,_0x228be5){this['voiceQueue']=_0x3b6fe5;this[_0xfa78('0x4')]=_0x228be5||undefined;this[_0xfa78('0x5')]=checkNameSurname(_0x32afd1[_0xfa78('0x6')][_0xfa78('0x7')],_0x32afd1['Contact'][_0xfa78('0x8')],_0x32afd1[_0xfa78('0x6')][_0xfa78('0x9')]);this[_0xfa78('0xa')]=_0x32afd1[_0xfa78('0x6')][_0xfa78('0x7')];this['queue']=_0x3b6fe5[_0xfa78('0x5')];this[_0xfa78('0xb')]=_0x32afd1[_0xfa78('0xb')]||![];this[_0xfa78('0xc')]=_0x3b6fe5[_0xfa78('0xc')];this['dialQueueTimeout']=_0x3b6fe5[_0xfa78('0xd')]||0x3;this[_0xfa78('0xe')]=_0x32afd1['scheduledat'];this['countbusyretry']=_0x32afd1[_0xfa78('0xf')];this[_0xfa78('0x10')]=_0x32afd1[_0xfa78('0x10')];this[_0xfa78('0x11')]=_0x32afd1[_0xfa78('0x11')];this[_0xfa78('0x12')]=_0x32afd1[_0xfa78('0x12')];this[_0xfa78('0x13')]=_0x32afd1[_0xfa78('0x13')];this['countabandonedretry']=_0x32afd1[_0xfa78('0x14')];this[_0xfa78('0x15')]=_0x32afd1[_0xfa78('0x15')];this[_0xfa78('0x16')]=_0x32afd1[_0xfa78('0x16')];this[_0xfa78('0x17')]=_0x32afd1[_0xfa78('0x17')];this[_0xfa78('0x18')]=_0x32afd1[_0xfa78('0x18')];this['UserId']=_0x32afd1[_0xfa78('0x19')];this['VoiceQueueId']=_0x32afd1[_0xfa78('0x1a')];this['CampaignId']=_0x32afd1[_0xfa78('0x1b')];this['idHopper']=_0x32afd1['id'];this[_0xfa78('0x1c')]=_0x32afd1[_0xfa78('0x6')][_0xfa78('0x8')]||'';this[_0xfa78('0x1d')]=moment()[_0xfa78('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x32afd1['callback'];this[_0xfa78('0x1f')]=_0x32afd1['callbackuniqueid'];this[_0xfa78('0x20')]=_0x32afd1[_0xfa78('0x20')];this['recallme']=_0x32afd1['recallme'];this[_0xfa78('0x21')]='';this[_0xfa78('0x22')]='';}Action['prototype'][_0xfa78('0x23')]=function(){return util[_0xfa78('0x1e')](_0xfa78('0x24'),this[_0xfa78('0x5')],this['voiceQueue'][_0xfa78('0x25')]>0x0?this[_0xfa78('0xa')][_0xfa78('0x26')](this[_0xfa78('0x27')][_0xfa78('0x25')]):this['number']);};Action[_0xfa78('0x28')][_0xfa78('0x29')]=function(){return this[_0xfa78('0x2a')];};module[_0xfa78('0x2b')]=Action; \ No newline at end of file +var _0x64eb=['recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat'];(function(_0x14aa48,_0x383051){var _0x373bc7=function(_0x3c1b28){while(--_0x3c1b28){_0x14aa48['push'](_0x14aa48['shift']());}};_0x373bc7(++_0x383051);}(_0x64eb,0xef));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xb64e('0x0'));var _=require(_0xb64e('0x1'));var moment=require(_0xb64e('0x2'));function checkNameSurname(_0x3bfe69,_0x170868,_0x2cbce1){var _0x4ed7c8='';if(!_[_0xb64e('0x3')](_0x170868)&&_0xb64e('0x4')===typeof _0x170868){_0x4ed7c8+=_0x170868;}if(!_[_0xb64e('0x3')](_0x2cbce1)&&_0xb64e('0x4')===typeof _0x2cbce1){_0x4ed7c8+='\x20'+_0x2cbce1;}if(_0x4ed7c8!==''){return _0x4ed7c8;}return _0x3bfe69;}function Action(_0x453732,_0x23f423,_0x4c8171){this[_0xb64e('0x5')]=_0x453732;this[_0xb64e('0x6')]=_0x4c8171||undefined;this[_0xb64e('0x7')]=checkNameSurname(_0x23f423[_0xb64e('0x8')][_0xb64e('0x9')],_0x23f423[_0xb64e('0x8')][_0xb64e('0xa')],_0x23f423[_0xb64e('0x8')][_0xb64e('0xb')]);this['number']=_0x23f423[_0xb64e('0x8')]['phone'];this['queue']=_0x453732[_0xb64e('0x7')];this[_0xb64e('0xc')]=_0x23f423['active']||![];this[_0xb64e('0xd')]=_0x453732[_0xb64e('0xd')];this[_0xb64e('0xe')]=_0x453732[_0xb64e('0xe')]||0x3;this[_0xb64e('0xf')]=_0x23f423[_0xb64e('0xf')];this['countbusyretry']=_0x23f423[_0xb64e('0x10')];this[_0xb64e('0x11')]=_0x23f423[_0xb64e('0x11')];this[_0xb64e('0x12')]=_0x23f423[_0xb64e('0x12')];this[_0xb64e('0x13')]=_0x23f423[_0xb64e('0x13')];this[_0xb64e('0x14')]=_0x23f423[_0xb64e('0x14')];this[_0xb64e('0x15')]=_0x23f423[_0xb64e('0x15')];this[_0xb64e('0x16')]=_0x23f423[_0xb64e('0x16')];this[_0xb64e('0x17')]=_0x23f423[_0xb64e('0x17')];this[_0xb64e('0x18')]=_0x23f423[_0xb64e('0x18')];this[_0xb64e('0x19')]=_0x23f423[_0xb64e('0x19')];this[_0xb64e('0x1a')]=_0x23f423[_0xb64e('0x1a')];this['VoiceQueueId']=_0x23f423[_0xb64e('0x1b')];this[_0xb64e('0x1c')]=_0x23f423[_0xb64e('0x1c')];this[_0xb64e('0x1d')]=_0x23f423['id'];this[_0xb64e('0x1e')]=_0x23f423[_0xb64e('0x8')][_0xb64e('0xa')]||'';this[_0xb64e('0x1f')]=moment()[_0xb64e('0x20')](_0xb64e('0x21'));this['callback']=_0x23f423[_0xb64e('0x22')];this[_0xb64e('0x23')]=_0x23f423[_0xb64e('0x23')];this[_0xb64e('0x24')]=_0x23f423[_0xb64e('0x24')];this[_0xb64e('0x25')]=_0x23f423[_0xb64e('0x25')];this[_0xb64e('0x26')]='';this['originatecalleridname']='';}Action[_0xb64e('0x27')]['getCaller']=function(){return util[_0xb64e('0x20')](_0xb64e('0x28'),this[_0xb64e('0x7')],this[_0xb64e('0x5')][_0xb64e('0x29')]>0x0?this[_0xb64e('0x2a')][_0xb64e('0x2b')](this['voiceQueue'][_0xb64e('0x29')]):this['number']);};Action[_0xb64e('0x27')]['getQueue']=function(){return this[_0xb64e('0x2c')];};module[_0xb64e('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 4881ae0..eac340e 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 _0x38d4=['Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc'];(function(_0x5981cd,_0x2cd07f){var _0x1fac02=function(_0x426e85){while(--_0x426e85){_0x5981cd['push'](_0x5981cd['shift']());}};_0x1fac02(++_0x2cd07f);}(_0x38d4,0x178));var _0x438d=function(_0x4e8fa0,_0x46459b){_0x4e8fa0=_0x4e8fa0-0x0;var _0x531803=_0x38d4[_0x4e8fa0];return _0x531803;};'use strict';var util=require(_0x438d('0x0'));var _=require(_0x438d('0x1'));var moment=require(_0x438d('0x2'));function getSeconds(_0x2fc64c,_0xc57d70){var _0x46dde0=moment(_0x2fc64c)[_0x438d('0x3')](0x0);var _0x1d4280=moment(_0xc57d70)[_0x438d('0x3')](0x0);return _0x46dde0[_0x438d('0x4')](_0x1d4280,_0x438d('0x5'));}function AgentComplete(_0x48cc31,_0x1adb77){this[_0x438d('0x6')]=0x4;this[_0x438d('0x7')]=_0x438d('0x8');this['scheduledat']=_0x48cc31[_0x438d('0x9')];this[_0x438d('0xa')]=_0x48cc31[_0x438d('0xa')];this[_0x438d('0xb')]=_0x48cc31['type']===_0x438d('0xc')?'queue':_0x48cc31[_0x438d('0xa')];this[_0x438d('0xd')]=_0x48cc31[_0x438d('0xd')];this[_0x438d('0xe')]=_0x48cc31[_0x438d('0xe')];this[_0x438d('0xf')]=_0x48cc31[_0x438d('0xf')];this[_0x438d('0x10')]=_0x48cc31[_0x438d('0xd')]+_0x48cc31['countcongestionretry']+_0x48cc31[_0x438d('0xf')]+_0x48cc31['countnosuchnumberretry']+_0x48cc31[_0x438d('0x11')]+_0x48cc31[_0x438d('0x12')]+_0x48cc31[_0x438d('0x13')]+_0x48cc31[_0x438d('0x14')];this[_0x438d('0x15')]=_0x48cc31[_0x438d('0x15')];this[_0x438d('0x11')]=_0x48cc31[_0x438d('0x11')];this[_0x438d('0x12')]=_0x48cc31[_0x438d('0x12')];this[_0x438d('0x13')]=_0x48cc31[_0x438d('0x13')];this['countagentrejectretry']=_0x48cc31[_0x438d('0x14')];this[_0x438d('0x16')]=_0x1adb77['uniqueid'];this[_0x438d('0x17')]=_0x48cc31[_0x438d('0x18')];this[_0x438d('0x19')]=_0x48cc31['number'];this[_0x438d('0x1a')]=_0x48cc31[_0x438d('0x1a')];this['responsetime']=_0x48cc31[_0x438d('0x1b')];this[_0x438d('0x1c')]=_0x48cc31[_0x438d('0x1c')];this[_0x438d('0x1d')]=moment()[_0x438d('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x438d('0x1f')]=getSeconds(_0x48cc31[_0x438d('0x1b')],_0x48cc31[_0x438d('0x1a')]);this[_0x438d('0x20')]=getSeconds(_0x48cc31[_0x438d('0x1c')],_0x48cc31[_0x438d('0x1b')]);this[_0x438d('0x21')]=getSeconds(this['endtime'],_0x48cc31[_0x438d('0x1c')]);this[_0x438d('0x22')]=_0x1adb77['queue'];this[_0x438d('0x23')]=_0x1adb77[_0x438d('0x23')];this['reason']=_0x1adb77[_0x438d('0x24')];this[_0x438d('0x25')]=_0x48cc31[_0x438d('0x25')];this[_0x438d('0x26')]=_0x48cc31[_0x438d('0x26')];this['callbackat']=_0x48cc31[_0x438d('0x27')];this[_0x438d('0x28')]=_0x48cc31[_0x438d('0x28')];this[_0x438d('0x29')]=_0x48cc31['ContactId'];this[_0x438d('0x2a')]=_0x48cc31[_0x438d('0x2a')];this[_0x438d('0x2b')]=_0x48cc31['UserId'];this[_0x438d('0x2c')]=_0x48cc31[_0x438d('0x2c')];this['CampaignId']=_0x48cc31[_0x438d('0x2d')];this['originatecalleridnum']=_0x48cc31[_0x438d('0x2e')]||'';this[_0x438d('0x2f')]=_0x48cc31[_0x438d('0x2f')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x4ae8=['answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','talktime','queue','reason','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','milliseconds','diff','state','statedesc','scheduledat','type','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridnum','number','responsetime'];(function(_0x4cfbd0,_0x1fc867){var _0x2be81d=function(_0x5d3533){while(--_0x5d3533){_0x4cfbd0['push'](_0x4cfbd0['shift']());}};_0x2be81d(++_0x1fc867);}(_0x4ae8,0x1cd));var _0x84ae=function(_0x43f4dc,_0x52f33d){_0x43f4dc=_0x43f4dc-0x0;var _0x15f848=_0x4ae8[_0x43f4dc];return _0x15f848;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x1949e1,_0x435b14){var _0x3419b3=moment(_0x1949e1)['milliseconds'](0x0);var _0x3295b9=moment(_0x435b14)[_0x84ae('0x0')](0x0);return _0x3419b3[_0x84ae('0x1')](_0x3295b9,'seconds');}function AgentComplete(_0x1f6353,_0x21956d){this[_0x84ae('0x2')]=0x4;this[_0x84ae('0x3')]='Answer';this[_0x84ae('0x4')]=_0x1f6353[_0x84ae('0x4')];this['type']=_0x1f6353['type'];this['campaigntype']=_0x1f6353[_0x84ae('0x5')]===_0x84ae('0x6')?'queue':_0x1f6353[_0x84ae('0x5')];this['countbusyretry']=_0x1f6353[_0x84ae('0x7')];this['countcongestionretry']=_0x1f6353['countcongestionretry'];this[_0x84ae('0x8')]=_0x1f6353[_0x84ae('0x8')];this[_0x84ae('0x9')]=_0x1f6353[_0x84ae('0x7')]+_0x1f6353[_0x84ae('0xa')]+_0x1f6353['countnoanswerretry']+_0x1f6353[_0x84ae('0xb')]+_0x1f6353[_0x84ae('0xc')]+_0x1f6353[_0x84ae('0xd')]+_0x1f6353['countmachineretry']+_0x1f6353[_0x84ae('0xe')];this[_0x84ae('0xb')]=_0x1f6353['countnosuchnumberretry'];this['countdropretry']=_0x1f6353['countdropretry'];this[_0x84ae('0xd')]=_0x1f6353['countabandonedretry'];this[_0x84ae('0xf')]=_0x1f6353[_0x84ae('0xf')];this[_0x84ae('0xe')]=_0x1f6353[_0x84ae('0xe')];this['uniqueid']=_0x21956d[_0x84ae('0x10')];this['calleridname']=_0x1f6353['name'];this[_0x84ae('0x11')]=_0x1f6353[_0x84ae('0x12')];this['starttime']=_0x1f6353['starttime'];this[_0x84ae('0x13')]=_0x1f6353['responsetime'];this[_0x84ae('0x14')]=_0x1f6353[_0x84ae('0x14')];this[_0x84ae('0x15')]=moment()['format'](_0x84ae('0x16'));this[_0x84ae('0x17')]=getSeconds(_0x1f6353['responsetime'],_0x1f6353[_0x84ae('0x18')]);this['holdtime']=getSeconds(_0x1f6353['answertime'],_0x1f6353[_0x84ae('0x13')]);this[_0x84ae('0x19')]=getSeconds(this['endtime'],_0x1f6353['answertime']);this[_0x84ae('0x1a')]=_0x21956d[_0x84ae('0x1a')];this['membername']=_0x21956d['membername'];this[_0x84ae('0x1b')]=_0x21956d[_0x84ae('0x1b')];this['callback']=_0x1f6353[_0x84ae('0x1c')];this[_0x84ae('0x1d')]=_0x1f6353[_0x84ae('0x1d')];this[_0x84ae('0x1e')]=_0x1f6353['callbackat'];this['recallme']=_0x1f6353['recallme'];this[_0x84ae('0x1f')]=_0x1f6353[_0x84ae('0x1f')];this['ListId']=_0x1f6353['ListId'];this[_0x84ae('0x20')]=_0x1f6353['UserId'];this[_0x84ae('0x21')]=_0x1f6353[_0x84ae('0x21')];this['CampaignId']=_0x1f6353[_0x84ae('0x22')];this[_0x84ae('0x23')]=_0x1f6353[_0x84ae('0x23')]||'';this['originatecalleridname']=_0x1f6353[_0x84ae('0x24')]||'';}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 697dfa9..7b76e84 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 _0x4f0d=['campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','uniqueid','scheduledat','type'];(function(_0x50027f,_0x53b2df){var _0x879451=function(_0x5849ce){while(--_0x5849ce){_0x50027f['push'](_0x50027f['shift']());}};_0x879451(++_0x53b2df);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x4f0d[_0x2338fa];return _0x42df9b;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5290b6,_0x5cd109){var _0xc4d56b=moment(_0x5290b6)[_0xd4f0('0x0')](0x0);var _0x216b0d=moment(_0x5cd109)['milliseconds'](0x0);return _0xc4d56b[_0xd4f0('0x1')](_0x216b0d,'seconds');}function Final(_0x501b8f){this[_0xd4f0('0x2')]=_0x501b8f['uniqueid'];this[_0xd4f0('0x3')]=_0x501b8f[_0xd4f0('0x3')];this['type']=_0x501b8f[_0xd4f0('0x4')];this[_0xd4f0('0x5')]=_0x501b8f[_0xd4f0('0x4')]===_0xd4f0('0x6')?_0xd4f0('0x7'):_0x501b8f['type'];this[_0xd4f0('0x8')]=_0x501b8f[_0xd4f0('0x8')];this['countcongestionretry']=_0x501b8f['countcongestionretry'];this[_0xd4f0('0x9')]=_0x501b8f[_0xd4f0('0x9')];this['countglobal']=_0x501b8f[_0xd4f0('0x8')]+_0x501b8f[_0xd4f0('0xa')]+_0x501b8f[_0xd4f0('0x9')]+_0x501b8f[_0xd4f0('0xb')]+_0x501b8f[_0xd4f0('0xc')]+_0x501b8f['countabandonedretry']+_0x501b8f[_0xd4f0('0xd')]+_0x501b8f[_0xd4f0('0xe')];this[_0xd4f0('0xb')]=_0x501b8f[_0xd4f0('0xb')];this[_0xd4f0('0xc')]=_0x501b8f[_0xd4f0('0xc')];this[_0xd4f0('0xf')]=_0x501b8f[_0xd4f0('0xf')];this[_0xd4f0('0xd')]=_0x501b8f[_0xd4f0('0xd')];this[_0xd4f0('0xe')]=_0x501b8f[_0xd4f0('0xe')];this['queue']=_0x501b8f['queue'];this[_0xd4f0('0x10')]=_0x501b8f[_0xd4f0('0x10')];this[_0xd4f0('0x11')]=_0x501b8f[_0xd4f0('0x11')];this['starttime']=_0x501b8f['starttime'];this[_0xd4f0('0x12')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x13')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x14')]=_0x501b8f[_0xd4f0('0x14')]||0x0;this[_0xd4f0('0x15')]=_0x501b8f[_0xd4f0('0x15')]||0x0;this[_0xd4f0('0x16')]=_0x501b8f[_0xd4f0('0x16')]||0x0;this['callback']=_0x501b8f[_0xd4f0('0x17')];this[_0xd4f0('0x18')]=_0x501b8f[_0xd4f0('0x18')];this['callbackat']=_0x501b8f[_0xd4f0('0x19')];this[_0xd4f0('0x1a')]=_0x501b8f[_0xd4f0('0x1a')];this['ContactId']=_0x501b8f[_0xd4f0('0x1b')];this[_0xd4f0('0x1c')]=_0x501b8f[_0xd4f0('0x1c')];this[_0xd4f0('0x1d')]=_0x501b8f['UserId'];this[_0xd4f0('0x1e')]=_0x501b8f[_0xd4f0('0x1e')];this[_0xd4f0('0x1f')]=_0x501b8f[_0xd4f0('0x1f')];this['originatecalleridnum']=_0x501b8f[_0xd4f0('0x20')]||'';this['originatecalleridname']=_0x501b8f[_0xd4f0('0x21')]||'';}module[_0xd4f0('0x22')]=Final; \ No newline at end of file +var _0x1224=['countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x22901f,_0x562cf1){var _0x54c7f5=function(_0x42ddb4){while(--_0x42ddb4){_0x22901f['push'](_0x22901f['shift']());}};_0x54c7f5(++_0x562cf1);}(_0x1224,0x10d));var _0x4122=function(_0x23563c,_0xc2f3c5){_0x23563c=_0x23563c-0x0;var _0xeddf50=_0x1224[_0x23563c];return _0xeddf50;};'use strict';var util=require(_0x4122('0x0'));var _=require(_0x4122('0x1'));var moment=require(_0x4122('0x2'));function getSeconds(_0x4122fd,_0x488f55){var _0x3d42a9=moment(_0x4122fd)['milliseconds'](0x0);var _0x1b3b05=moment(_0x488f55)[_0x4122('0x3')](0x0);return _0x3d42a9[_0x4122('0x4')](_0x1b3b05,'seconds');}function Final(_0x1d39a5){this[_0x4122('0x5')]=_0x1d39a5[_0x4122('0x5')];this[_0x4122('0x6')]=_0x1d39a5[_0x4122('0x6')];this[_0x4122('0x7')]=_0x1d39a5[_0x4122('0x7')];this[_0x4122('0x8')]=_0x1d39a5[_0x4122('0x7')]===_0x4122('0x9')?_0x4122('0xa'):_0x1d39a5[_0x4122('0x7')];this[_0x4122('0xb')]=_0x1d39a5[_0x4122('0xb')];this[_0x4122('0xc')]=_0x1d39a5[_0x4122('0xc')];this[_0x4122('0xd')]=_0x1d39a5[_0x4122('0xd')];this[_0x4122('0xe')]=_0x1d39a5[_0x4122('0xb')]+_0x1d39a5[_0x4122('0xc')]+_0x1d39a5[_0x4122('0xd')]+_0x1d39a5[_0x4122('0xf')]+_0x1d39a5[_0x4122('0x10')]+_0x1d39a5[_0x4122('0x11')]+_0x1d39a5[_0x4122('0x12')]+_0x1d39a5[_0x4122('0x13')];this[_0x4122('0xf')]=_0x1d39a5[_0x4122('0xf')];this[_0x4122('0x10')]=_0x1d39a5[_0x4122('0x10')];this['countabandonedretry']=_0x1d39a5[_0x4122('0x11')];this[_0x4122('0x12')]=_0x1d39a5[_0x4122('0x12')];this[_0x4122('0x13')]=_0x1d39a5['countagentrejectretry'];this[_0x4122('0xa')]=_0x1d39a5[_0x4122('0xa')];this['calleridname']=_0x1d39a5[_0x4122('0x14')];this[_0x4122('0x15')]=_0x1d39a5[_0x4122('0x15')];this[_0x4122('0x16')]=_0x1d39a5[_0x4122('0x16')];this[_0x4122('0x17')]=_0x1d39a5[_0x4122('0x17')];this['endtime']=_0x1d39a5['responsetime'];this['ringtime']=_0x1d39a5[_0x4122('0x18')]||0x0;this[_0x4122('0x19')]=_0x1d39a5[_0x4122('0x19')]||0x0;this[_0x4122('0x1a')]=_0x1d39a5[_0x4122('0x1a')]||0x0;this[_0x4122('0x1b')]=_0x1d39a5[_0x4122('0x1b')];this[_0x4122('0x1c')]=_0x1d39a5['callbackuniqueid'];this[_0x4122('0x1d')]=_0x1d39a5['callbackat'];this['recallme']=_0x1d39a5['recallme'];this[_0x4122('0x1e')]=_0x1d39a5[_0x4122('0x1e')];this[_0x4122('0x1f')]=_0x1d39a5['ListId'];this[_0x4122('0x20')]=_0x1d39a5[_0x4122('0x20')];this['VoiceQueueId']=_0x1d39a5['VoiceQueueId'];this[_0x4122('0x21')]=_0x1d39a5['CampaignId'];this['originatecalleridnum']=_0x1d39a5['originatecalleridnum']||'';this[_0x4122('0x22')]=_0x1d39a5[_0x4122('0x22')]||'';}module[_0x4122('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 25dea4f..d7a112f 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 _0xddf1=['number','starttime','responsetime','endtime','format','ringtime','holdtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xddf1,0xbf));var _0x1ddf=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xddf1[_0x2aa0e7];return _0x1472c0;};'use strict';var util=require(_0x1ddf('0x0'));var _=require(_0x1ddf('0x1'));var moment=require(_0x1ddf('0x2'));function getSeconds(_0x27e75b,_0x2bce8c){var _0x593ba4=moment(_0x27e75b)['milliseconds'](0x0);var _0x399eb2=moment(_0x2bce8c)[_0x1ddf('0x3')](0x0);return _0x593ba4['diff'](_0x399eb2,_0x1ddf('0x4'));}function Hangup(_0xe4da65,_0x3ce783){this[_0x1ddf('0x5')]=0x4;this[_0x1ddf('0x6')]=_0x1ddf('0x7');this['scheduledat']=_0xe4da65[_0x1ddf('0x8')];this[_0x1ddf('0x9')]=_0xe4da65[_0x1ddf('0x9')];this[_0x1ddf('0xa')]=_0xe4da65[_0x1ddf('0x9')]===_0x1ddf('0xb')?_0x1ddf('0xc'):_0xe4da65[_0x1ddf('0x9')];this['countbusyretry']=_0xe4da65['countbusyretry'];this[_0x1ddf('0xd')]=_0xe4da65['countcongestionretry'];this[_0x1ddf('0xe')]=_0xe4da65[_0x1ddf('0xe')];this[_0x1ddf('0xf')]=_0xe4da65['countbusyretry']+_0xe4da65[_0x1ddf('0xd')]+_0xe4da65[_0x1ddf('0xe')]+_0xe4da65['countnosuchnumberretry']+_0xe4da65[_0x1ddf('0x10')]+_0xe4da65[_0x1ddf('0x11')]+_0xe4da65['countmachineretry']+_0xe4da65[_0x1ddf('0x12')];this[_0x1ddf('0x13')]=_0xe4da65['countnosuchnumberretry'];this['countdropretry']=_0xe4da65[_0x1ddf('0x10')];this['countabandonedretry']=_0xe4da65['countabandonedretry'];this[_0x1ddf('0x14')]=_0xe4da65[_0x1ddf('0x14')];this['countagentrejectretry']=_0xe4da65['countagentrejectretry'];this[_0x1ddf('0x15')]=_0x3ce783['uniqueid'];this[_0x1ddf('0x16')]=_0xe4da65[_0x1ddf('0x17')];this['calleridnum']=_0xe4da65[_0x1ddf('0x18')];this['starttime']=_0xe4da65[_0x1ddf('0x19')];this[_0x1ddf('0x1a')]=_0xe4da65['responsetime'];this[_0x1ddf('0x1b')]=moment()[_0x1ddf('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1ddf('0x1d')]=getSeconds(_0xe4da65[_0x1ddf('0x1a')],_0xe4da65['starttime']);this[_0x1ddf('0x1e')]=0x0;this['talktime']=getSeconds(this[_0x1ddf('0x1b')],_0xe4da65[_0x1ddf('0x1a')]);this['queue']=_0xe4da65['queue'];this[_0x1ddf('0x1f')]=_0x1ddf('0x20');this[_0x1ddf('0x21')]=_0x3ce783['cause-txt'];this[_0x1ddf('0x22')]=_0xe4da65[_0x1ddf('0x22')];this[_0x1ddf('0x23')]=_0xe4da65[_0x1ddf('0x23')];this['callbackat']=_0xe4da65[_0x1ddf('0x24')];this[_0x1ddf('0x25')]=_0xe4da65[_0x1ddf('0x25')];this['ContactId']=_0xe4da65[_0x1ddf('0x26')];this['ListId']=_0xe4da65['ListId'];this[_0x1ddf('0x27')]=_0xe4da65[_0x1ddf('0x27')];this[_0x1ddf('0x28')]=_0xe4da65['VoiceQueueId'];this['CampaignId']=_0xe4da65[_0x1ddf('0x29')];}module[_0x1ddf('0x2a')]=Hangup; \ No newline at end of file +var _0xfd65=['membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','moment','milliseconds','diff','seconds','statedesc','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfd65,0x103));var _0x5fd6=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xfd65[_0x68c979];return _0x4f0001;};'use strict';var util=require(_0x5fd6('0x0'));var _=require('lodash');var moment=require(_0x5fd6('0x1'));function getSeconds(_0x292f50,_0x5c143e){var _0x5247c2=moment(_0x292f50)[_0x5fd6('0x2')](0x0);var _0x40ed8d=moment(_0x5c143e)[_0x5fd6('0x2')](0x0);return _0x5247c2[_0x5fd6('0x3')](_0x40ed8d,_0x5fd6('0x4'));}function Hangup(_0x5574a7,_0xf6d909){this['state']=0x4;this[_0x5fd6('0x5')]='Answer';this['scheduledat']=_0x5574a7['scheduledat'];this[_0x5fd6('0x6')]=_0x5574a7[_0x5fd6('0x6')];this['campaigntype']=_0x5574a7[_0x5fd6('0x6')]===_0x5fd6('0x7')?_0x5fd6('0x8'):_0x5574a7['type'];this[_0x5fd6('0x9')]=_0x5574a7[_0x5fd6('0x9')];this[_0x5fd6('0xa')]=_0x5574a7[_0x5fd6('0xa')];this['countnoanswerretry']=_0x5574a7['countnoanswerretry'];this[_0x5fd6('0xb')]=_0x5574a7[_0x5fd6('0x9')]+_0x5574a7['countcongestionretry']+_0x5574a7[_0x5fd6('0xc')]+_0x5574a7[_0x5fd6('0xd')]+_0x5574a7[_0x5fd6('0xe')]+_0x5574a7[_0x5fd6('0xf')]+_0x5574a7['countmachineretry']+_0x5574a7['countagentrejectretry'];this[_0x5fd6('0xd')]=_0x5574a7[_0x5fd6('0xd')];this['countdropretry']=_0x5574a7[_0x5fd6('0xe')];this[_0x5fd6('0xf')]=_0x5574a7['countabandonedretry'];this['countmachineretry']=_0x5574a7[_0x5fd6('0x10')];this[_0x5fd6('0x11')]=_0x5574a7[_0x5fd6('0x11')];this[_0x5fd6('0x12')]=_0xf6d909['uniqueid'];this[_0x5fd6('0x13')]=_0x5574a7['name'];this[_0x5fd6('0x14')]=_0x5574a7[_0x5fd6('0x15')];this[_0x5fd6('0x16')]=_0x5574a7[_0x5fd6('0x16')];this[_0x5fd6('0x17')]=_0x5574a7['responsetime'];this[_0x5fd6('0x18')]=moment()[_0x5fd6('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5fd6('0x1a')]=getSeconds(_0x5574a7[_0x5fd6('0x17')],_0x5574a7[_0x5fd6('0x16')]);this[_0x5fd6('0x1b')]=0x0;this['talktime']=getSeconds(this[_0x5fd6('0x18')],_0x5574a7[_0x5fd6('0x17')]);this['queue']=_0x5574a7[_0x5fd6('0x8')];this[_0x5fd6('0x1c')]=_0x5fd6('0x1d');this[_0x5fd6('0x1e')]=_0xf6d909[_0x5fd6('0x1f')];this[_0x5fd6('0x20')]=_0x5574a7['callback'];this[_0x5fd6('0x21')]=_0x5574a7['callbackuniqueid'];this[_0x5fd6('0x22')]=_0x5574a7[_0x5fd6('0x22')];this[_0x5fd6('0x23')]=_0x5574a7[_0x5fd6('0x23')];this['ContactId']=_0x5574a7[_0x5fd6('0x24')];this[_0x5fd6('0x25')]=_0x5574a7['ListId'];this['UserId']=_0x5574a7[_0x5fd6('0x26')];this[_0x5fd6('0x27')]=_0x5574a7[_0x5fd6('0x27')];this['CampaignId']=_0x5574a7['CampaignId'];}module[_0x5fd6('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index fd98e84..1944ee4 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 _0xcd8f=['campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd8f,0x1c0));var _0xfcd8=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xcd8f[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0xfcd8('0x0'));var _=require(_0xfcd8('0x1'));var moment=require(_0xfcd8('0x2'));function getSeconds(_0x25280d,_0x5cf9b3){var _0x308a04=moment(_0x25280d)[_0xfcd8('0x3')](0x0);var _0xddf098=moment(_0x5cf9b3)[_0xfcd8('0x3')](0x0);return _0x308a04['diff'](_0xddf098,_0xfcd8('0x4'));}function History(_0x5e1441){this[_0xfcd8('0x5')]=_0x5e1441[_0xfcd8('0x5')];this[_0xfcd8('0x6')]=_0x5e1441[_0xfcd8('0x6')]||undefined;this[_0xfcd8('0x7')]=_0x5e1441[_0xfcd8('0x7')];this[_0xfcd8('0x8')]=_0x5e1441['type']==='outbound'?'queue':_0x5e1441['type'];this[_0xfcd8('0x9')]=_0x5e1441[_0xfcd8('0x9')];this['countcongestionretry']=_0x5e1441[_0xfcd8('0xa')];this['countnoanswerretry']=_0x5e1441[_0xfcd8('0xb')];this[_0xfcd8('0xc')]=_0x5e1441[_0xfcd8('0x9')]+_0x5e1441['countcongestionretry']+_0x5e1441[_0xfcd8('0xb')]+_0x5e1441['countnosuchnumberretry']+_0x5e1441[_0xfcd8('0xd')]+_0x5e1441['countabandonedretry']+_0x5e1441['countmachineretry']+_0x5e1441[_0xfcd8('0xe')];this[_0xfcd8('0xf')]=_0x5e1441[_0xfcd8('0xf')];this[_0xfcd8('0xd')]=_0x5e1441[_0xfcd8('0xd')];this[_0xfcd8('0x10')]=_0x5e1441['countabandonedretry'];this[_0xfcd8('0x11')]=_0x5e1441['countmachineretry'];this[_0xfcd8('0xe')]=_0x5e1441[_0xfcd8('0xe')];this[_0xfcd8('0x12')]=_0x5e1441['queue'];this['calleridname']=_0x5e1441[_0xfcd8('0x13')];this[_0xfcd8('0x14')]=_0x5e1441[_0xfcd8('0x15')];this[_0xfcd8('0x16')]=_0x5e1441[_0xfcd8('0x16')];this[_0xfcd8('0x17')]=_0x5e1441[_0xfcd8('0x17')];this[_0xfcd8('0x18')]=_0x5e1441['responsetime'];this[_0xfcd8('0x19')]=getSeconds(_0x5e1441[_0xfcd8('0x17')],_0x5e1441[_0xfcd8('0x16')]);this['holdtime']=0x0;this[_0xfcd8('0x1a')]=0x0;this[_0xfcd8('0x1b')]=_0x5e1441[_0xfcd8('0x1b')];this[_0xfcd8('0x1c')]=_0x5e1441[_0xfcd8('0x1c')];this[_0xfcd8('0x1d')]=_0x5e1441[_0xfcd8('0x1d')];this['recallme']=_0x5e1441[_0xfcd8('0x1e')];this[_0xfcd8('0x1f')]=_0x5e1441['ContactId'];this[_0xfcd8('0x20')]=_0x5e1441['ListId'];this[_0xfcd8('0x21')]=_0x5e1441[_0xfcd8('0x21')];this[_0xfcd8('0x22')]=_0x5e1441[_0xfcd8('0x22')];this[_0xfcd8('0x23')]=_0x5e1441['CampaignId'];this['originatecalleridnum']=_0x5e1441[_0xfcd8('0x24')]||'';this[_0xfcd8('0x25')]=_0x5e1441[_0xfcd8('0x25')]||'';}module['exports']=History; \ No newline at end of file +var _0x162d=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x162d,0xbf));var _0xd162=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x162d[_0x27af45];return _0x18df21;};'use strict';var util=require(_0xd162('0x0'));var _=require(_0xd162('0x1'));var moment=require(_0xd162('0x2'));function getSeconds(_0x23f8e8,_0xee2b18){var _0x17fb29=moment(_0x23f8e8)[_0xd162('0x3')](0x0);var _0x599153=moment(_0xee2b18)[_0xd162('0x3')](0x0);return _0x17fb29[_0xd162('0x4')](_0x599153,_0xd162('0x5'));}function History(_0x1533c5){this[_0xd162('0x6')]=_0x1533c5[_0xd162('0x6')];this['scheduledat']=_0x1533c5['scheduledat']||undefined;this[_0xd162('0x7')]=_0x1533c5[_0xd162('0x7')];this[_0xd162('0x8')]=_0x1533c5[_0xd162('0x7')]===_0xd162('0x9')?_0xd162('0xa'):_0x1533c5['type'];this['countbusyretry']=_0x1533c5[_0xd162('0xb')];this[_0xd162('0xc')]=_0x1533c5['countcongestionretry'];this[_0xd162('0xd')]=_0x1533c5['countnoanswerretry'];this['countglobal']=_0x1533c5[_0xd162('0xb')]+_0x1533c5[_0xd162('0xc')]+_0x1533c5[_0xd162('0xd')]+_0x1533c5['countnosuchnumberretry']+_0x1533c5[_0xd162('0xe')]+_0x1533c5[_0xd162('0xf')]+_0x1533c5[_0xd162('0x10')]+_0x1533c5['countagentrejectretry'];this[_0xd162('0x11')]=_0x1533c5[_0xd162('0x11')];this[_0xd162('0xe')]=_0x1533c5[_0xd162('0xe')];this[_0xd162('0xf')]=_0x1533c5['countabandonedretry'];this[_0xd162('0x10')]=_0x1533c5[_0xd162('0x10')];this[_0xd162('0x12')]=_0x1533c5[_0xd162('0x12')];this[_0xd162('0xa')]=_0x1533c5[_0xd162('0xa')];this[_0xd162('0x13')]=_0x1533c5[_0xd162('0x14')];this[_0xd162('0x15')]=_0x1533c5[_0xd162('0x16')];this[_0xd162('0x17')]=_0x1533c5[_0xd162('0x17')];this[_0xd162('0x18')]=_0x1533c5[_0xd162('0x18')];this[_0xd162('0x19')]=_0x1533c5[_0xd162('0x18')];this[_0xd162('0x1a')]=getSeconds(_0x1533c5[_0xd162('0x18')],_0x1533c5[_0xd162('0x17')]);this['holdtime']=0x0;this[_0xd162('0x1b')]=0x0;this[_0xd162('0x1c')]=_0x1533c5[_0xd162('0x1c')];this[_0xd162('0x1d')]=_0x1533c5[_0xd162('0x1d')];this[_0xd162('0x1e')]=_0x1533c5['callbackat'];this[_0xd162('0x1f')]=_0x1533c5['recallme'];this['ContactId']=_0x1533c5[_0xd162('0x20')];this['ListId']=_0x1533c5[_0xd162('0x21')];this[_0xd162('0x22')]=_0x1533c5['UserId'];this['VoiceQueueId']=_0x1533c5[_0xd162('0x23')];this[_0xd162('0x24')]=_0x1533c5['CampaignId'];this['originatecalleridnum']=_0x1533c5[_0xd162('0x25')]||'';this[_0xd162('0x26')]=_0x1533c5[_0xd162('0x26')]||'';}module[_0xd162('0x27')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 40f63a2..1234b75 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 _0x92fc=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice:queue:%s','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','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','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','isNil','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','variable','exten','xcally-motion-dialer','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','[syncHangupInAMD]','dialAMDActive','value','MACHINE','countglobal','amd','buildObj','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','ListId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countabandonedretry','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','dialQueueProject','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','Unknow','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','channel','actionid','locked','status','paused','stateinterface','push','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','timezones','content','indexOf','true','all','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','loggedIn','checkIfTime','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','pow','replace','match','actionOriginate','object','originate','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','Action','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','md5','ioredis','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','syncOriginateResponse','bind','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x92fc,0x1b2));var _0xc92f=function(_0x59cba9,_0x1e8f27){_0x59cba9=_0x59cba9-0x0;var _0xae4206=_0x92fc[_0x59cba9];return _0xae4206;};'use strict';var util=require(_0xc92f('0x0'));var _=require(_0xc92f('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xc92f('0x2'));var rr=require('rr');var md5=require(_0xc92f('0x3'));var Redis=require(_0xc92f('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xc92f('0x5'));var loggerBooked=require(_0xc92f('0x6'))(_0xc92f('0x7'));var loggerPredictive=require(_0xc92f('0x6'))(_0xc92f('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc92f('0x9'));var loggerSyncQueueSummary=require(_0xc92f('0x6'))(_0xc92f('0xa'));var ami=require(_0xc92f('0xb'));config['redis']=_[_0xc92f('0xc')](config[_0xc92f('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xc92f('0xe'))(new Redis(config[_0xc92f('0xd')]));var cmHopper=require(_0xc92f('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc92f('0x10'));var voiceQueueRt=require(_0xc92f('0x11'));var Action=require('./action');var History=require('./history');var Final=require(_0xc92f('0x12'));var AgentComplete=require(_0xc92f('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xc92f('0x14'));var ipAgi=process['env'][_0xc92f('0x15')]||'127.0.0.1';var strategy={'rrmemory':_0xc92f('0x16'),'roundrobin':_0xc92f('0x17')};var Sequence=function(){};Sequence['prototype'][_0xc92f('0x18')]=function(_0x3d2fa1){this[_0xc92f('0x19')]=this[_0xc92f('0x19')]?this['tail'][_0xc92f('0x1a')](_0x3d2fa1):_0x3d2fa1();};function Dialer(_0x7d47ab,_0x476177){this[_0xc92f('0x1b')]=new Sequence();this[_0xc92f('0x1c')]=_0x476177;this[_0xc92f('0x1d')]=_0x7d47ab[_0xc92f('0x1d')];this[_0xc92f('0x1e')]=_0x7d47ab['campaigns'];this['agents']=_0x7d47ab[_0xc92f('0x1f')];this[_0xc92f('0x20')]=_0x7d47ab[_0xc92f('0x20')];this['maxNumberOriginate']=config[_0xc92f('0x21')]||0x2;this[_0xc92f('0x22')]={};this[_0xc92f('0x23')]={};this['contactsId']={};this[_0xc92f('0x24')]={};this['optionPredictive']={};this[_0xc92f('0x25')]={};this[_0xc92f('0x26')]={};this[_0xc92f('0x27')]={};this[_0xc92f('0x28')]={};this[_0xc92f('0x29')]={};ami['on'](_0xc92f('0x2a'),this[_0xc92f('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this[_0xc92f('0x2c')]['bind'](this));ami['on']('originateresponse',this[_0xc92f('0x2d')][_0xc92f('0x2e')](this));ami['on'](_0xc92f('0x2f'),this['syncAgentComplete']['bind'](this));ami['on'](_0xc92f('0x30'),this['syncQueueSummary'][_0xc92f('0x2e')](this));ami['on'](_0xc92f('0x31'),this[_0xc92f('0x32')][_0xc92f('0x2e')](this));ami['on'](_0xc92f('0x33'),this[_0xc92f('0x34')][_0xc92f('0x2e')](this));ami['on'](_0xc92f('0x35'),this[_0xc92f('0x36')][_0xc92f('0x2e')](this));ami['on'](_0xc92f('0x37'),this[_0xc92f('0x38')][_0xc92f('0x2e')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xc92f('0x2e')](this));this[_0xc92f('0x39')]();this[_0xc92f('0x3a')]();}function isNotNull(_0x58ebc6){return _0x58ebc6!==null&&!_[_0xc92f('0x3b')](_0x58ebc6);}function checkIsLoggedIn(_0x82d17,_0x19b54d){return function(){if(_0x19b54d<=0x0){_0x82d17['message']='AGENTS_NOT_LOGGED';throw _0x82d17[_0xc92f('0x3c')]+_0xc92f('0x3d');}};}function isActive(_0x2534d3){return _0x2534d3;}function checkIsActive(_0x379e03,_0x5bdb02){return function(){if(!isActive(_0x5bdb02)){_0x379e03['message']='NOT_ACTIVE';throw _0x379e03[_0xc92f('0x3c')]+_0xc92f('0x3e');}};}function checkInterval(_0x488074){return function(){if(!isNotNull(_0x488074[_0xc92f('0x3f')])){_0x488074[_0xc92f('0x40')]=_0xc92f('0x41');throw _0x488074[_0xc92f('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x488074['Interval'][_0xc92f('0x42')])){_0x488074[_0xc92f('0x40')]=_0xc92f('0x41');throw _0x488074[_0xc92f('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xc92f('0x43')](_0x488074[_0xc92f('0x3f')]['Intervals']))){_0x488074['message']=_0xc92f('0x41');throw _0x488074[_0xc92f('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xe7e75f,_0x27a576,_0x4ec88b){return{'action':_0xe7e75f,'response':_0x27a576,'message':_0x4ec88b,'stack':_0x4ec88b};}function myreject(_0x1542d3){return function(_0x47d0d0){return _0x1542d3(msgResponse(_0xc92f('0x44'),'Error',JSON['stringify'](_0x47d0d0)));};}function getSeconds(_0x2bb232,_0x1ff625){var _0x2118ee=moment(_0x2bb232)['milliseconds'](0x0);var _0x403638=moment(_0x1ff625)[_0xc92f('0x45')](0x0);return _0x2118ee['diff'](_0x403638,_0xc92f('0x46'));}function emit(_0x16a430,_0x570a8a,_0x243a26){io['to'](_0x16a430)[_0xc92f('0x47')](_0x570a8a,_0x243a26);}function emitVoiceQueueSummary(_0x523c67){if(_0x523c67['type']===_0xc92f('0x48')){var _0x4ca19c={'id':_0x523c67['id'],'name':_0x523c67[_0xc92f('0x3c')],'strategy':_0x523c67[_0xc92f('0x49')],'answered':_0x523c67[_0xc92f('0x4a')],'available':_0x523c67[_0xc92f('0x4b')],'loggedIn':_0x523c67['loggedIn'],'pTalking':_0x523c67[_0xc92f('0x4c')],'sumBillable':_0x523c67[_0xc92f('0x4d')],'sumDuration':_0x523c67[_0xc92f('0x4e')],'sumHoldTime':_0x523c67[_0xc92f('0x4f')]||0x0,'talking':_0x523c67[_0xc92f('0x50')],'total':_0x523c67[_0xc92f('0x51')],'type':_0x523c67[_0xc92f('0x52')],'unmanaged':_0x523c67[_0xc92f('0x53')],'abandoned':_0x523c67[_0xc92f('0x54')],'waiting':_0x523c67[_0xc92f('0x55')],'loggedInDb':_0x523c67[_0xc92f('0x56')],'dialActive':_0x523c67[_0xc92f('0x57')],'dialMethod':_0x523c67[_0xc92f('0x58')],'dialOriginateCallerIdName':_0x523c67['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x523c67[_0xc92f('0x59')],'dialOriginateTimeout':_0x523c67['dialOriginateTimeout'],'dialPrefix':_0x523c67[_0xc92f('0x5a')],'outboundAnswerAgiCallsDay':_0x523c67[_0xc92f('0x5b')],'outboundAnswerCallsDay':_0x523c67[_0xc92f('0x5c')],'outboundBlacklistCallsDay':_0x523c67[_0xc92f('0x5d')],'outboundBusyCallsDay':_0x523c67[_0xc92f('0x5e')],'outboundCongestionCallsDay':_0x523c67[_0xc92f('0x5f')],'outboundDropCallsDayACS':_0x523c67[_0xc92f('0x60')],'outboundDropCallsDayCallersExit':_0x523c67['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x523c67[_0xc92f('0x61')],'outboundNoAnswerCallsDay':_0x523c67['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x523c67[_0xc92f('0x62')],'outboundOriginateFailureCallsDay':_0x523c67[_0xc92f('0x63')],'outboundReCallsDay':_0x523c67[_0xc92f('0x64')],'outboundRejectCallsDay':_0x523c67[_0xc92f('0x65')],'outboundUnknownCallsDay':_0x523c67[_0xc92f('0x66')],'predictiveIntervalAnsweredCalls':_0x523c67[_0xc92f('0x67')],'predictiveIntervalAvgHoldtime':_0x523c67['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x523c67[_0xc92f('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x523c67['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x523c67[_0xc92f('0x69')],'predictiveIntervalErlangCalls':_0x523c67[_0xc92f('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x523c67['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x523c67[_0xc92f('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x523c67[_0xc92f('0x6c')],'predictiveIntervalPauses':_0x523c67['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x523c67['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x523c67[_0xc92f('0x6d')],'message':_0x523c67['message'],'originated':_0x523c67['originated'],'erlangCalls':_0x523c67['erlangCalls'],'erlangCallToSecond':_0x523c67[_0xc92f('0x6e')],'erlangAbandonmentRate':_0x523c67[_0xc92f('0x6f')],'erlangBusyFactor':_0x523c67['erlangBusyFactor'],'startPredictive':_0x523c67['startPredictive'],'startProgressive':_0x523c67[_0xc92f('0x26')]};if(_0x523c67[_0xc92f('0x70')]){_0x4ca19c['Trunk']={'id':_0x523c67['Trunk']['id'],'name':_0x523c67['Trunk'][_0xc92f('0x3c')],'active':_0x523c67[_0xc92f('0x70')][_0xc92f('0x71')],'callerid':_0x523c67[_0xc92f('0x70')][_0xc92f('0x72')]};}if(_0x523c67[_0xc92f('0x3f')]){_0x4ca19c[_0xc92f('0x3f')]={'id':_0x523c67[_0xc92f('0x3f')]['id'],'name':_0x523c67[_0xc92f('0x3f')][_0xc92f('0x3c')]};}var _0x1ebef9=md5(JSON['stringify'](_0x4ca19c));if(_0x523c67['md5']!==_0x1ebef9){_0x523c67[_0xc92f('0x3')]=_0x1ebef9;emit(util[_0xc92f('0x73')](_0xc92f('0x74'),_0x4ca19c[_0xc92f('0x3c')]),'voice_queue:save',_0x4ca19c);}}}function emitCampaignSummary(_0x3a3eb3){if(_0x3a3eb3[_0xc92f('0x52')]===_0xc92f('0x75')){emit(util[_0xc92f('0x73')](_0xc92f('0x76'),_0x3a3eb3[_0xc92f('0x3c')]),_0xc92f('0x77'),_0x3a3eb3);}}function checkGetDataPredictive(_0x462fc3){if(isNotNull(_0x462fc3)&&!_[_0xc92f('0x43')](_0x462fc3)){loggerPredictive[_0xc92f('0x78')](_0xc92f('0x79'));loggerPredictive[_0xc92f('0x78')](_0xc92f('0x7a'),_0x462fc3['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xc92f('0x7b'),_0x462fc3[_0xc92f('0x67')]);loggerPredictive[_0xc92f('0x78')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x462fc3[_0xc92f('0x69')]);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x7c'),_0x462fc3[_0xc92f('0x7d')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x462fc3['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xc92f('0x7e'),_0x462fc3[_0xc92f('0x68')]);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x7f'));if(_0x462fc3[_0xc92f('0x6d')]>0x0){if(!_['isUndefined'](_0x462fc3['predictiveIntervalAvgTalktime'])&&_0x462fc3[_0xc92f('0x68')]>0x0){return!![];}loggerPredictive[_0xc92f('0x78')](_0xc92f('0x80'));if(!_['isUndefined'](_0x462fc3[_0xc92f('0x81')])&&_0x462fc3[_0xc92f('0x81')]>0x0){return!![];}loggerPredictive[_0xc92f('0x78')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc92f('0x78')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xc92f('0x82'));}return![];}function mergeDataErlangB(_0x4d6888){return function(_0x2dc20d){loggerPredictive[_0xc92f('0x78')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc92f('0x78')](_0xc92f('0x83'),_0x2dc20d['erlangCalls']);loggerPredictive['info'](_0xc92f('0x84'),_0x2dc20d[_0xc92f('0x6e')]);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x85'),_0x2dc20d['erlangAbandonmentRate']);loggerPredictive['info'](_0xc92f('0x86'),_0x2dc20d['erlangBusyFactor']);loggerPredictive[_0xc92f('0x78')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2dc20d[_0xc92f('0x6f')]);loggerPredictive[_0xc92f('0x78')]('---------------------------');_['merge'](_0x4d6888,_0x2dc20d);};}function getDiff(_0x1ce63b){var _0x242197=moment()[_0xc92f('0x45')](0x0);var _0x459da8=moment(_0x1ce63b)[_0xc92f('0x45')](0x0);return _0x242197[_0xc92f('0x87')](_0x459da8,_0xc92f('0x46'));}function ifInterval(_0x497b95,_0x5e87b4){if(_[_0xc92f('0x3b')](_0x5e87b4)){return![];}return getDiff(_0x5e87b4)<_0x497b95*0x3c;}function freeVariablesPredictive(_0x3b1cf0){if(isNotNull(_0x3b1cf0)){if(!_[_0xc92f('0x3b')](_0x3b1cf0[_0xc92f('0x26')])){_0x3b1cf0[_0xc92f('0x26')]=undefined;loggerPredictive['info'](_0x3b1cf0[_0xc92f('0x3c')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xc92f('0x3b')](_0x3b1cf0['startPredictive'])){_0x3b1cf0['startPredictive']=undefined;loggerPredictive[_0xc92f('0x78')](_0x3b1cf0[_0xc92f('0x3c')],_0xc92f('0x88'));}if(!_['isUndefined'](_0x3b1cf0[_0xc92f('0x89')])){clearInterval(_0x3b1cf0['handlePredictive']);_0x3b1cf0[_0xc92f('0x89')]=undefined;loggerPredictive[_0xc92f('0x78')](_0x3b1cf0[_0xc92f('0x3c')],_0xc92f('0x8a'));}}}function erlangb(_0x306b98,_0x43d8d9){if(_0x43d8d9===0x0){return 0x0;}var _0x421e08=0x1;for(var _0x107ff8=0x1;_0x107ff8<=_0x43d8d9;_0x107ff8+=0x1){_0x421e08=0x1+_0x421e08*_0x107ff8/_0x306b98;}return 0x1/_0x421e08;}function isVoiceQueueOutbound(_0x4d47c2){return _0x4d47c2===_0xc92f('0x48');}function isNotPreview(_0x67dab0){return _0x67dab0!==_0xc92f('0x1c');}function isCampaignIvr(_0x5ed193){return _0x5ed193==='ivr';}function getCallerId(_0x35ed73,_0x2ddcd5,_0x4be660){if(!_['isUndefined'](_0x4be660)&&typeof _0x4be660===_0xc92f('0x8b')&&!_['isEmpty'](_0x4be660)){if(!_[_0xc92f('0x3b')](_0x2ddcd5)&&typeof _0x2ddcd5===_0xc92f('0x8b')&&!_[_0xc92f('0x43')](_0x2ddcd5)){return util[_0xc92f('0x73')](_0xc92f('0x8c'),_0x2ddcd5,_0x4be660);}return util[_0xc92f('0x73')](_0xc92f('0x8c'),_0x4be660,_0x4be660);}if(!_['isUndefined'](_0x35ed73)&&typeof _0x35ed73==='string'&&!_[_0xc92f('0x43')](_0x35ed73)){return _0x35ed73;}return _0xc92f('0x8d');}function loggerCatchQueueSummary(_0x801f58,_0x36cc14){return function(_0x53f610){freeVariablesPredictive(_0x36cc14);emitVoiceQueueSummary(_0x36cc14);emitCampaignSummary(_0x36cc14);loggerSyncQueueSummary[_0xc92f('0x8e')](_0x801f58,util[_0xc92f('0x8f')](_0x53f610,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x448865,_0x9e0281){return function(_0x3218d9){loggerPredictive[_0xc92f('0x8e')](_0x9e0281[_0xc92f('0x3c')],_0x448865);loggerPredictive[_0xc92f('0x8e')](_0x3218d9[_0xc92f('0x90')]);freeVariablesPredictive(_0x9e0281);};}function loggerCatch(_0x179a5e){return function(_0x26f63f){logger['error'](_0x179a5e,util[_0xc92f('0x8f')](_0x26f63f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x33f250){return _0x33f250&&!_[_0xc92f('0x3b')](_0x33f250)&&_0x33f250[_0xc92f('0x91')]>0x0;}function decremetOriginate(_0x246169){if(!_[_0xc92f('0x3b')](_0x246169)&&_0x246169!==null){if(typeof _0x246169[_0xc92f('0x92')]!==_0xc92f('0x93')){if(_0x246169[_0xc92f('0x92')]>0x0){_0x246169['originated']-=0x1;}else{logger[_0xc92f('0x8e')](_0xc92f('0x94'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xd6b300,_0x3ac1ae,_0x2dfdb1){if(_0x3ac1ae>_0x2dfdb1){for(var _0x3259cd=0x0;_0x3259cd<_0x3ac1ae-_0x2dfdb1;_0x3259cd+=0x1){decremetOriginate(_0xd6b300);}}}function loggerGetContactDialer(_0x2ef3ee,_0x5001dd,_0x37592e){return function(_0x4736e1){checkContactLowerLimitOriginate(_0x5001dd,_0x37592e,0x0);logger[_0xc92f('0x8e')](_0x2ef3ee,util['inspect'](_0x4736e1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x32dc44){return function(_0x253925){if(isNotNull(_0x253925)&&isNotNull(_0x253925[0x0])){if(_0x253925[0x0][_0xc92f('0x95')]>0x0){_0x32dc44['message']='RESCHEDULED_CONTACTS';logger[_0xc92f('0x78')](_0xc92f('0x96')+_0x32dc44[_0xc92f('0x3c')],_0x253925[0x0][_0xc92f('0x95')],'contacts');}else{_0x32dc44[_0xc92f('0x40')]=_0xc92f('0x97');logger[_0xc92f('0x78')](_0xc92f('0x98')+_0x32dc44['name']);}}};}function notSendMessagesQueue(_0x13ad2f){if(_0x13ad2f['sendMessageOneNotActive']){freeVariablesPredictive(_0x13ad2f);if(_0x13ad2f['originated']===0x0&&_0x13ad2f[_0xc92f('0x50')]===0x0&&_0x13ad2f['waiting']===0x0&&(_0x13ad2f[_0xc92f('0x4c')]||0x0)===0x0){_0x13ad2f[_0xc92f('0x99')]=![];_0x13ad2f['available']=0x0;_0x13ad2f[_0xc92f('0x40')]=_0xc92f('0x9a');loggerSyncQueueSummary[_0xc92f('0x8e')](_0xc92f('0x9b'),_0x13ad2f[_0xc92f('0x3c')],_0xc92f('0x9c'));}else{_0x13ad2f[_0xc92f('0x40')]=_0xc92f('0x9d');loggerSyncQueueSummary[_0xc92f('0x8e')](_0xc92f('0x9b'),_0x13ad2f[_0xc92f('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x13ad2f);}}function notSendMessagesCampaign(_0x20926a){if(_0x20926a[_0xc92f('0x99')]){if(_0x20926a[_0xc92f('0x92')]===0x0){_0x20926a[_0xc92f('0x99')]=![];_0x20926a[_0xc92f('0x40')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xc92f('0x8e')](_0xc92f('0x9e'),_0x20926a['name'],_0xc92f('0x9c'));}else{_0x20926a[_0xc92f('0x40')]=_0xc92f('0x9d');loggerSyncQueueSummary[_0xc92f('0x8e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x20926a[_0xc92f('0x3c')],_0xc92f('0x9f'));}emitCampaignSummary(_0x20926a);}}function createObjHistory(_0x244c60,_0xa3c1c8,_0x39cc22,_0x1d0375,_0x13503c){_0x244c60[_0xc92f('0x40')]=_0x39cc22;var _0x7db132=new Action(_0x244c60,_0xa3c1c8);var _0x25a579=new History(_0x7db132);_0x25a579[_0xc92f('0xa0')]=_0x1d0375;_0x25a579[_0xc92f('0xa1')]=_0x13503c;_0x25a579['endtime']=_0x7db132[_0xc92f('0xa2')];return _0x25a579;}Dialer[_0xc92f('0xa3')][_0xc92f('0x3a')]=function(){var _0x23fae4=this;setInterval(function(){_0x23fae4['clearZombieChannels'](_0x23fae4[_0xc92f('0x24')],_0xc92f('0xa4'));_0x23fae4[_0xc92f('0xa5')](_0x23fae4[_0xc92f('0x23')],_0xc92f('0xa6'));},0x32c8);};Dialer['prototype'][_0xc92f('0xa5')]=function(_0x4cd026,_0x306cd0){var _0x136d51=this;for(var _0x27f4bf in _0x4cd026){if(typeof _0x4cd026[_0x27f4bf]!=='undefined'){this['sequence'][_0xc92f('0x18')](function(){if(!_[_0xc92f('0xa7')](_0x4cd026[_0x27f4bf])){return ami['Action']({'action':'status','channel':_0x4cd026[_0x27f4bf]['channel']})[_0xc92f('0xa8')](function(_0x28801e){if(_0x28801e['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x4cd026[_0x27f4bf]&&_0x4cd026[_0x27f4bf][_0xc92f('0x52')]!==_0xc92f('0x75')){_0x136d51[_0xc92f('0xa9')](_0x136d51['voiceQueues'][_0x4cd026[_0x27f4bf][_0xc92f('0xaa')]]);logger[_0xc92f('0x8e')](_0xc92f('0xab'),_0x306cd0,_0x27f4bf,_0x4cd026[_0x27f4bf][_0xc92f('0xaa')]);delete _0x4cd026[_0x27f4bf];}if(_0x4cd026[_0x27f4bf]&&_0x4cd026[_0x27f4bf][_0xc92f('0x52')]==='ivr'){_0x136d51[_0xc92f('0xa9')](_0x136d51[_0xc92f('0x1e')][_0x4cd026[_0x27f4bf][_0xc92f('0xaa')]]);logger[_0xc92f('0x8e')](_0xc92f('0xac'),_0x306cd0,_0x27f4bf,_0x4cd026[_0x27f4bf]['queue']);delete _0x4cd026[_0x27f4bf];}},0x2328);}});}});}}};Dialer[_0xc92f('0xa3')]['countReScheduled']=function(_0x3d716a){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopper[_0xc92f('0xaf')](_0x3d716a))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xb0')));};Dialer[_0xc92f('0xa3')]['checkIsBlackList']=function(_0x68690d){return BPromise[_0xc92f('0xad')]()['then'](cmHopperBlack[_0xc92f('0xb1')](_0x68690d))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xc92f('0xa3')][_0xc92f('0xb2')]=function(_0x1aa1c9){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopperBlack[_0xc92f('0xb2')](_0x1aa1c9))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xb3')));};Dialer[_0xc92f('0xa3')][_0xc92f('0xb4')]=function(_0x4264f2){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopperHistory['avgHandleTime'](_0x4264f2))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xb5')));};Dialer['prototype']['rescheduleContact']=function(_0x133d09){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopper[_0xc92f('0xb6')](_0x133d09))[_0xc92f('0xa8')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0xc92f('0xb7')]=function(_0x100c5e,_0x2a703,_0x5d1c46){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopper[_0xc92f('0xb7')](_0x100c5e,_0x2a703,_0x5d1c46))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xb8')));};Dialer['prototype'][_0xc92f('0xb9')]=function(_0x4ac642,_0x8ae566,_0x4945a7,_0x3d4a91,_0xb57c0a){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopper['getContactDialer'](_0x4ac642,_0x8ae566,_0x4945a7,_0x3d4a91))[_0xc92f('0xa8')](function(_0x470e09){_0xb57c0a['temp']-=_0x4945a7;_0xb57c0a[_0xc92f('0xba')]=_0xb57c0a[_0xc92f('0xba')]>0x0?_0xb57c0a[_0xc92f('0xba')]:0x0;loggerCatch(_0xc92f('0xbb'))(_0x470e09);});};Dialer[_0xc92f('0xa3')]['getContactDialerIvr']=function(_0x18b222,_0xc101b8,_0x5af013,_0xbf3869){return BPromise['resolve']()[_0xc92f('0xae')](cmHopper[_0xc92f('0xbc')](_0x18b222,_0xc101b8,_0x5af013))[_0xc92f('0xa8')](function(_0x3d557f){_0xbf3869[_0xc92f('0xba')]-=_0xc101b8;_0xbf3869[_0xc92f('0xba')]=_0xbf3869['temp']>0x0?_0xbf3869[_0xc92f('0xba')]:0x0;loggerCatch(_0xc92f('0xbd'))(_0x3d557f);});};Dialer[_0xc92f('0xa3')][_0xc92f('0xbe')]=function(_0x2ebd28){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2ebd28))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xbf')));};Dialer[_0xc92f('0xa3')]['moveContactManagedDialer']=function(_0x6f8b5a){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopper[_0xc92f('0xc0')](_0x6f8b5a))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xc1')));};Dialer['prototype'][_0xc92f('0xc2')]=function(_0x1529d0){return BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](cmHopperHistory[_0xc92f('0xc2')](_0x1529d0))[_0xc92f('0xa8')](loggerCatch('[createHistory]\x20'));};Dialer[_0xc92f('0xa3')][_0xc92f('0xa9')]=function(_0x2911d5){if(!_[_0xc92f('0x3b')](_0x2911d5)&&_0x2911d5!==null){if(typeof _0x2911d5[_0xc92f('0x92')]!==_0xc92f('0x93')){if(_0x2911d5[_0xc92f('0x92')]>0x0){_0x2911d5['originated']-=0x1;}else{logger[_0xc92f('0x8e')](_0xc92f('0xc3'));}}}else{logger[_0xc92f('0x8e')](_0xc92f('0xc4'));}};Dialer['prototype'][_0xc92f('0xc5')]=function(_0x5e96a,_0x2e038b){var _0x34140e=this;return function(_0x226fa5){_0x34140e[_0xc92f('0xa9')](_0x2e038b);logger['error'](_0x5e96a,util[_0xc92f('0x8f')](_0x226fa5,{'showHidden':![],'depth':null}));};};Dialer[_0xc92f('0xa3')][_0xc92f('0xc6')]=function(_0x3705fa,_0x21dee6,_0x19bd6e){var _0x4e9464={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x21dee6);this[_0xc92f('0xc7')](_[_0xc92f('0xc8')](_0x4e9464,_['pick'](_0x19bd6e,[_0xc92f('0xc9'),'ListId',_0xc92f('0xca'),_0xc92f('0xcb'),_0xc92f('0xcc')])),_0xc92f('0xcd'),_0xc92f('0xce'));logger['error'](_0x3705fa);};Dialer[_0xc92f('0xa3')][_0xc92f('0xcf')]=function(_0x2fb258){return _0x2fb258===_0xc92f('0xd0');};Dialer['prototype'][_0xc92f('0xd1')]=function(_0x247abf){return!_[_0xc92f('0x3b')](_0x247abf)&&_0x247abf&&!_['isUndefined'](_0x247abf[_0xc92f('0x3c')])&&!_[_0xc92f('0x3b')](_0x247abf[_0xc92f('0x71')])&&_0x247abf[_0xc92f('0x71')]&&(this[_0xc92f('0x20')][util[_0xc92f('0x73')](_0xc92f('0xd2'),_0x247abf['name'])]['status']===_0xc92f('0xd3')||this['trunks'][util[_0xc92f('0x73')](_0xc92f('0xd2'),_0x247abf[_0xc92f('0x3c')])]['status']==='unmonitored');};Dialer[_0xc92f('0xa3')][_0xc92f('0xc7')]=function(_0x380c73,_0xfdc7ca,_0x1e59c5){this['createHistory'](_0x380c73)['catch'](loggerCatch(_0xfdc7ca));this[_0xc92f('0xc0')](_0x380c73)['catch'](loggerCatch(_0x1e59c5));};Dialer[_0xc92f('0xa3')][_0xc92f('0x36')]=function(_0x49f054){var _0x2787d8=this['uniqueId'][_0x49f054['uniqueid']];var _0x64efed;if(!_['isNil'](_0x49f054)&&!_[_0xc92f('0xa7')](_0x49f054[_0xc92f('0xd4')])&&!_['isNil'](_0x49f054[_0xc92f('0xd4')]['amdstatus'])&&_0x49f054[_0xc92f('0xd5')]===_0xc92f('0xd6')&&_0x2787d8){if(_0x2787d8[_0xc92f('0x52')]!==_0xc92f('0x75')&&this[_0xc92f('0x1d')][_0x2787d8[_0xc92f('0xaa')]]['dialAMDActive']&&_0x49f054['value']===_0xc92f('0xd7')){delete this[_0xc92f('0x24')][_0x49f054[_0xc92f('0xd8')]];this[_0xc92f('0xa9')](this['voiceQueues'][_0x2787d8[_0xc92f('0xaa')]]);this[_0xc92f('0x1d')][_0x2787d8['queue']][_0xc92f('0x5c')]+=0x1;this[_0xc92f('0x1d')][_0x2787d8[_0xc92f('0xaa')]][_0xc92f('0x5b')]+=0x1;_0x64efed=new Hangup(_0x2787d8,_0x49f054);_0x64efed[_0xc92f('0xa0')]=0x12;_0x64efed[_0xc92f('0xa1')]=_0xc92f('0xd9');_0x64efed[_0xc92f('0xda')]=_0xc92f('0xdb');ami[_0xc92f('0x47')](_0xc92f('0xdc'),ut['buildObj'](_0x64efed,'amd'));this['saveInDb'](_0x64efed,'[syncHangupInAMD][createHistory]',_0xc92f('0xdd'));}if(_0x2787d8[_0xc92f('0x52')]!==_0xc92f('0x75')&&this['voiceQueues'][_0x2787d8[_0xc92f('0xaa')]][_0xc92f('0xde')]&&_0x49f054[_0xc92f('0xdf')]===_0xc92f('0xe0')){var _0x17d298=this;return new BPromise(function(_0x359291,_0x23da23){delete _0x17d298[_0xc92f('0x24')][_0x49f054[_0xc92f('0xd8')]];_0x17d298[_0xc92f('0xa9')](_0x17d298[_0xc92f('0x1d')][_0x2787d8[_0xc92f('0xaa')]]);_0x17d298['voiceQueues'][_0x2787d8['queue']][_0xc92f('0x5c')]+=0x1;_0x17d298[_0xc92f('0x1d')][_0x2787d8[_0xc92f('0xaa')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x82a139=_0x17d298[_0xc92f('0x1d')][_0x2787d8[_0xc92f('0xaa')]];var _0x2110c5=new Hangup(_0x2787d8,_0x49f054);_0x2110c5['state']=0x13;_0x2110c5[_0xc92f('0xa1')]='Machine';_0x2110c5[_0xc92f('0xda')]=_0xc92f('0xdb');_0x2110c5['countmachineretry']+=0x1;_0x2110c5[_0xc92f('0xe1')]+=0x1;_0x2110c5[_0xc92f('0xe2')]=!![];ami['emit'](_0xc92f('0xdc'),ut[_0xc92f('0xe3')](_0x2110c5,'amd'));_0x17d298['createHistory'](_0x2110c5)[_0xc92f('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2110c5[_0xc92f('0xe4')]+_0x2110c5['countcongestionretry']+_0x2110c5[_0xc92f('0xe5')]+_0x2110c5[_0xc92f('0xe6')]+_0x2110c5[_0xc92f('0xe7')]+_0x2110c5['countabandonedretry']+_0x2110c5[_0xc92f('0xe8')]+_0x2110c5[_0xc92f('0xe9')]>=_0x82a139[_0xc92f('0xea')]){_0x17d298[_0xc92f('0xeb')](_0x2110c5,_0x359291,_0x23da23,'reason19\x20machine....');}else{if(_0x2110c5[_0xc92f('0xe8')]>=_0x82a139[_0xc92f('0xec')]){_0x17d298[_0xc92f('0xed')](_0x2110c5,_0x359291,_0x23da23,_0xc92f('0xee'));}else{_0x17d298['rescheduleContact']({'active':![],'countmachineretry':_0x2110c5[_0xc92f('0xe8')],'scheduledat':moment()[_0xc92f('0xef')](_0x82a139[_0xc92f('0xf0')],_0xc92f('0xf1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2110c5[_0xc92f('0xc9')],'ListId':_0x2110c5[_0xc92f('0xf2')],'VoiceQueueId':_0x2110c5['VoiceQueueId']||undefined,'CampaignId':_0x2110c5['CampaignId']||undefined})[_0xc92f('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x359291({'reschedule':0x1});}}});}if(_0x2787d8[_0xc92f('0x52')]===_0xc92f('0x75')&&this[_0xc92f('0x1e')][_0x2787d8[_0xc92f('0xaa')]][_0xc92f('0xde')]&&_0x49f054[_0xc92f('0xdf')]===_0xc92f('0xd7')){delete this[_0xc92f('0x24')][_0x49f054['uniqueid']];this['updateOriginated'](this['campaigns'][_0x2787d8['queue']]);_0x64efed=new Hangup(_0x2787d8,_0x49f054);_0x64efed[_0xc92f('0xa0')]=0x12;_0x64efed[_0xc92f('0xa1')]=_0xc92f('0xd9');_0x64efed['membername']='AMD';ami[_0xc92f('0x47')]('custom:amd',ut['buildObj'](_0x64efed,_0xc92f('0xe2')));this['saveInDb'](_0x64efed,_0xc92f('0xf3'),_0xc92f('0xf4'));}if(_0x2787d8[_0xc92f('0x52')]===_0xc92f('0x75')&&this[_0xc92f('0x1e')][_0x2787d8['queue']][_0xc92f('0xde')]&&_0x49f054[_0xc92f('0xdf')]==='MACHINE'){var _0x17d298=this;return new BPromise(function(_0x193aa1,_0x46858c){delete _0x17d298[_0xc92f('0x24')][_0x49f054[_0xc92f('0xd8')]];_0x17d298[_0xc92f('0xa9')](_0x17d298[_0xc92f('0x1e')][_0x2787d8[_0xc92f('0xaa')]]);_0x17d298[_0xc92f('0x1e')][_0x2787d8[_0xc92f('0xaa')]][_0xc92f('0x5c')]+=0x1;_0x17d298[_0xc92f('0x1e')][_0x2787d8['queue']][_0xc92f('0x5b')]+=0x1;var _0x485cf2=_0x17d298[_0xc92f('0x1e')][_0x2787d8[_0xc92f('0xaa')]];var _0x47270f=new Hangup(_0x2787d8,_0x49f054);_0x47270f[_0xc92f('0xa0')]=0x13;_0x47270f['statedesc']=_0xc92f('0xf5');_0x47270f['membername']=_0xc92f('0xdb');_0x47270f[_0xc92f('0xe8')]+=0x1;_0x47270f[_0xc92f('0xe1')]+=0x1;_0x47270f['amd']=!![];ami[_0xc92f('0x47')](_0xc92f('0xdc'),ut['buildObj'](_0x47270f,_0xc92f('0xe2')));_0x17d298[_0xc92f('0xc2')](_0x47270f)[_0xc92f('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x47270f[_0xc92f('0xe4')]+_0x47270f['countcongestionretry']+_0x47270f['countnoanswerretry']+_0x47270f[_0xc92f('0xe6')]+_0x47270f['countdropretry']+_0x47270f[_0xc92f('0xf6')]+_0x47270f['countmachineretry']+_0x47270f[_0xc92f('0xe9')]>=_0x485cf2['dialGlobalMaxRetry']){_0x17d298[_0xc92f('0xeb')](_0x47270f,_0x193aa1,_0x46858c,'reason19\x20machine....');}else{if(_0x47270f['countmachineretry']>=_0x485cf2[_0xc92f('0xec')]){_0x17d298[_0xc92f('0xed')](_0x47270f,_0x193aa1,_0x46858c,_0xc92f('0xee'));}else{_0x17d298['rescheduleContact']({'active':![],'countmachineretry':_0x47270f[_0xc92f('0xe8')],'scheduledat':moment()[_0xc92f('0xef')](_0x485cf2[_0xc92f('0xf0')],_0xc92f('0xf1'))[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0x47270f[_0xc92f('0xc9')],'ListId':_0x47270f[_0xc92f('0xf2')],'VoiceQueueId':_0x47270f['VoiceQueueId']||undefined,'CampaignId':_0x47270f[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xf8')));_0x193aa1({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x46b930){var _0x10adf4=this[_0xc92f('0x24')][_0x46b930[_0xc92f('0xd8')]];var _0x49eee0=this;var _0x38475c;if(_0x10adf4&&_0x10adf4[_0xc92f('0x52')]===_0xc92f('0x75')){delete this['uniqueId'][_0x46b930[_0xc92f('0xd8')]];this[_0xc92f('0xa9')](this['campaigns'][_0x10adf4[_0xc92f('0xaa')]]);this[_0xc92f('0x1e')][_0x10adf4['queue']][_0xc92f('0xf9')]+=0x1;_0x38475c=new Hangup(_0x10adf4,_0x46b930);this['createHistory'](_0x38475c)[_0xc92f('0xa8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc92f('0xc0')](_0x38475c)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x10adf4&&_0x10adf4[_0xc92f('0x52')]!==_0xc92f('0x75')&&isNotNull(this[_0xc92f('0x1d')][_0x10adf4[_0xc92f('0xaa')]][_0xc92f('0xfa')])){delete this[_0xc92f('0x24')][_0x46b930['uniqueid']];this[_0xc92f('0xa9')](this[_0xc92f('0x1d')][_0x10adf4['queue']]);this[_0xc92f('0x1d')][_0x10adf4[_0xc92f('0xaa')]]['outboundAnswerCallsDay']+=0x1;this[_0xc92f('0x1d')][_0x10adf4[_0xc92f('0xaa')]][_0xc92f('0x5b')]+=0x1;_0x38475c=new Hangup(_0x10adf4,_0x46b930);_0x38475c[_0xc92f('0xa0')]=0x10;_0x38475c[_0xc92f('0xa1')]='AnswerAGI';_0x38475c[_0xc92f('0xda')]=_0xc92f('0xfb');this[_0xc92f('0xc2')](_0x38475c)['catch'](loggerCatch(_0xc92f('0xfc')));this['moveContactManagedDialer'](_0x38475c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xfd')));}if(_0x10adf4&&_0x10adf4[_0xc92f('0x52')]!==_0xc92f('0x75')&&!isNotNull(this[_0xc92f('0x1d')][_0x10adf4[_0xc92f('0xaa')]][_0xc92f('0xfa')])){delete this[_0xc92f('0x24')][_0x46b930[_0xc92f('0xd8')]];this[_0xc92f('0xa9')](this[_0xc92f('0x1d')][_0x10adf4['queue']]);this[_0xc92f('0x1d')][_0x10adf4[_0xc92f('0xaa')]]['outboundUnknownCallsDay']+=0x1;_0x38475c=new Hangup(_0x10adf4,_0x46b930);_0x38475c[_0xc92f('0xa0')]=0xc;_0x38475c['statedesc']=_0x46b930['cause-txt'];_0x38475c[_0xc92f('0xda')]=_0xc92f('0xfe');this[_0xc92f('0xc2')](_0x38475c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xfc')));this[_0xc92f('0xc0')](_0x38475c)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc92f('0xa3')][_0xc92f('0xff')]=function(_0x2697b7){var _0x302cdc=this[_0xc92f('0x24')][_0x2697b7[_0xc92f('0xd8')]];var _0x3bd063=this;if(this[_0xc92f('0x1d')][_0x2697b7['queue']]){if(_0x302cdc&&_0x302cdc[_0xc92f('0x52')]!==_0xc92f('0x75')){delete this[_0xc92f('0x24')][_0x2697b7[_0xc92f('0xd8')]];this[_0xc92f('0x1d')][_0x2697b7[_0xc92f('0xaa')]]['outboundAnswerCallsDay']+=0x1;var _0x3d6695=new AgentComplete(_0x302cdc,_0x2697b7);if(_0x2697b7['reason']===_0xc92f('0x100')){_0x3d6695[_0xc92f('0x101')]=this[_0xc92f('0x1d')][_0x2697b7[_0xc92f('0xaa')]][_0xc92f('0x102')]&&this['voiceQueues'][_0x2697b7['queue']][_0xc92f('0x103')]?moment()[_0xc92f('0x73')](_0xc92f('0xf7')):undefined;}this['createHistory'](_0x3d6695)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x104')));this[_0xc92f('0xc0')](_0x3d6695)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xc92f('0xa3')][_0xc92f('0x2b')]=function(_0x238ff3){if(this[_0xc92f('0x1d')][_0x238ff3[_0xc92f('0xaa')]]){if(this['uniqueId'][_0x238ff3['uniqueid']]&&this[_0xc92f('0x24')][_0x238ff3[_0xc92f('0xd8')]][_0xc92f('0x52')]!==_0xc92f('0x75')){this[_0xc92f('0xa9')](this[_0xc92f('0x1d')][_0x238ff3['queue']]);this['uniqueId'][_0x238ff3[_0xc92f('0xd8')]][_0xc92f('0x105')]=moment()[_0xc92f('0x73')](_0xc92f('0xf7'));}}};Dialer[_0xc92f('0xa3')][_0xc92f('0x106')]=function(_0x2875b5){this[_0xc92f('0xc2')](_0x2875b5)['catch'](loggerCatch(_0xc92f('0x104')));this[_0xc92f('0xc0')](_0x2875b5)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x107')));};Dialer[_0xc92f('0xa3')][_0xc92f('0x2c')]=function(_0xeafa30){var _0x2d918f=this['uniqueId'][_0xeafa30[_0xc92f('0xd8')]];var _0x1fc689=this;if(this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]]){if(_0x2d918f&&_0x2d918f[_0xc92f('0x52')]!=='ivr'){delete this[_0xc92f('0x24')][_0xeafa30[_0xc92f('0xd8')]];this[_0xc92f('0xa9')](this['voiceQueues'][_0xeafa30[_0xc92f('0xaa')]]);_0x2d918f[_0xc92f('0x108')]=moment()[_0xc92f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0xe00aba=new QueueCallerAbandon(_0x2d918f,_0xeafa30);if(getSeconds(_0x2d918f[_0xc92f('0x108')],_0x2d918f[_0xc92f('0x109')])>=_0x2d918f[_0xc92f('0x10a')]){this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x69')]+=0x1;this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x61')]+=0x1;this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x10b')]+=0x1;_0xe00aba['state']=0xa;_0xe00aba[_0xc92f('0xa1')]=_0xc92f('0x10c');_0xe00aba[_0xc92f('0x10d')]=_0xc92f('0x10e');_0xe00aba['agiafterat']=this['voiceQueues'][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x102')]?moment()[_0xc92f('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xe00aba[_0xc92f('0xe7')]+=0x1;_0xe00aba[_0xc92f('0xe1')]+=0x1;if(_0xe00aba['countdropretry']>=this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x10f')]){this['queueCallerAbandonCreateState'](_0xe00aba);}else{this['rescheduleContact']({'active':![],'countdropretry':_0xe00aba[_0xc92f('0xe7')],'scheduledat':moment()['add'](this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x110')],'minutes')['format'](_0xc92f('0xf7')),'ContactId':_0x2d918f[_0xc92f('0xc9')],'ListId':_0x2d918f[_0xc92f('0xf2')],'VoiceQueueId':_0x2d918f[_0xc92f('0xcb')]||undefined,'CampaignId':_0x2d918f['CampaignId']||undefined})[_0xc92f('0xa8')](loggerCatch('[rescheduleContact][Drop]'));var _0x2198bd=new History(_0xe00aba);_0x2198bd[_0xc92f('0xa0')]=0xa;_0x2198bd[_0xc92f('0xa1')]=_0xc92f('0x10c');_0x2198bd['starttime']=moment()[_0xc92f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x2198bd[_0xc92f('0x111')]=_0x2198bd[_0xc92f('0xa2')];_0x2198bd[_0xc92f('0x112')]=_0xe00aba['calleridname'];_0x2198bd[_0xc92f('0x113')]=_0xe00aba[_0xc92f('0x113')];this['createHistory'](_0x2198bd)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x114')));}}else{this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x7d')]+=0x1;this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x115')]+=0x1;_0xe00aba[_0xc92f('0xa0')]=0xb;_0xe00aba['statedesc']='Abandoned';_0xe00aba[_0xc92f('0x10d')]=_0xc92f('0x116');_0xe00aba[_0xc92f('0xf6')]+=0x1;_0xe00aba[_0xc92f('0xe1')]+=0x1;if(_0xe00aba[_0xc92f('0xf6')]>=this[_0xc92f('0x1d')][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x117')]){this[_0xc92f('0x106')](_0xe00aba);}else{this[_0xc92f('0xb6')]({'active':![],'countabandonedretry':_0xe00aba[_0xc92f('0xf6')],'scheduledat':moment()[_0xc92f('0xef')](this['voiceQueues'][_0xeafa30[_0xc92f('0xaa')]][_0xc92f('0x118')],_0xc92f('0xf1'))[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0x2d918f[_0xc92f('0xc9')],'ListId':_0x2d918f[_0xc92f('0xf2')],'VoiceQueueId':_0x2d918f[_0xc92f('0xcb')]||undefined,'CampaignId':_0x2d918f[_0xc92f('0xcc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2198bd=new History(_0xe00aba);_0x2198bd[_0xc92f('0xa0')]=0xb;_0x2198bd[_0xc92f('0xa1')]='Abandoned';_0x2198bd[_0xc92f('0xa2')]=moment()[_0xc92f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x2198bd['endtime']=_0x2198bd[_0xc92f('0xa2')];_0x2198bd['calleridname']=_0xe00aba[_0xc92f('0x112')];_0x2198bd[_0xc92f('0x113')]=_0xe00aba[_0xc92f('0x113')];this[_0xc92f('0xc2')](_0x2198bd)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x119')));}}}}};Dialer[_0xc92f('0xa3')][_0xc92f('0x34')]=function(_0x215ae3){if(this[_0xc92f('0x23')][_0x215ae3['uniqueid']]){this['actions'][_0x215ae3[_0xc92f('0xd8')]][_0xc92f('0x11a')]=_0x215ae3[_0xc92f('0x11a')];}if(this['uniqueId'][_0x215ae3['uniqueid']]){this[_0xc92f('0x24')][_0x215ae3[_0xc92f('0xd8')]]['channel']=_0x215ae3['channel'];}};Dialer[_0xc92f('0xa3')][_0xc92f('0x38')]=function(_0x32428b){if(strategy[this[_0xc92f('0x1d')][this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]]['queue']]['strategy']]==='roundrobin'){if(this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]]&&_['isNil'](this['actions'][_0x32428b[_0xc92f('0x11b')]][_0xc92f('0x11c')])&&_0x32428b[_0xc92f('0x11d')]==='1'&&_0x32428b[_0xc92f('0x11e')]==='0'){if(this[_0xc92f('0x1f')][_0x32428b[_0xc92f('0x11f')]]){if(!this[_0xc92f('0x1f')][_0x32428b[_0xc92f('0x11f')]][_0xc92f('0x11c')]){this['agents'][_0x32428b[_0xc92f('0x11f')]][_0xc92f('0x11c')]=!![];this[_0xc92f('0x23')][_0x32428b['actionid']][_0xc92f('0x11c')]=!![];this[_0xc92f('0x23')][_0x32428b['actionid']]['stateinterface']=_0x32428b[_0xc92f('0x11f')];}}}}else if((strategy[this['voiceQueues'][this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]][_0xc92f('0xaa')]][_0xc92f('0x49')]]||_0xc92f('0x16'))===_0xc92f('0x16')){if(this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]]){if(this[_0xc92f('0x1f')][_0x32428b['stateinterface']]){this[_0xc92f('0x23')][_0x32428b['actionid']][_0xc92f('0x11f')]=_0x32428b[_0xc92f('0x11f')];if(_[_0xc92f('0xa7')](this[_0xc92f('0x28')][this['actions'][_0x32428b['actionid']][_0xc92f('0xaa')]])){this[_0xc92f('0x28')][this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]=[];}this[_0xc92f('0x28')][this['actions'][_0x32428b[_0xc92f('0x11b')]][_0xc92f('0xaa')]][_0xc92f('0x120')](_[_0xc92f('0xc8')](_['pick'](this[_0xc92f('0x23')][_0x32428b[_0xc92f('0x11b')]],['idHopper','stateinterface']),{'status':_0x32428b['status'],'paused':_0x32428b[_0xc92f('0x11e')]}));}}}};function unlockQueueStatus(_0x542ffc,_0x52f9e1){setTimeout(function(){if(_['isUndefined'](_0x542ffc['queueStatusComplete'])){loggerBooked['error'](_0xc92f('0x121'),_0x52f9e1);}_0x542ffc[_0xc92f('0x122')]=!![];loggerBooked[_0xc92f('0x78')](_0xc92f('0x123'),_0x52f9e1,JSON[_0xc92f('0x124')](_[_0xc92f('0x125')](_0x542ffc,[_0xc92f('0x3c'),_0xc92f('0x122')])));},0x1f3);}Dialer['prototype'][_0xc92f('0x126')]=function(_0x452a0b){var _0x4e504f=this;var _0x26bcc2=_0x4e504f[_0xc92f('0x1d')][_0x4e504f['actions'][_0x452a0b['actionid']][_0xc92f('0xaa')]];if(strategy[this[_0xc92f('0x1d')][this[_0xc92f('0x23')][_0x452a0b['actionid']][_0xc92f('0xaa')]][_0xc92f('0x49')]]===_0xc92f('0x17')){if(this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]]&&this['actions'][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0x11f')]){this[_0xc92f('0x1c')][_0xc92f('0x127')](this[_0xc92f('0x23')][_0x452a0b['actionid']]['idHopper'],this['actions'][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0x11f')])[_0xc92f('0xa8')](function(_0x301efb){logger[_0xc92f('0x8e')](_0xc92f('0x128'),util['inspect'](_0x301efb,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4e504f['updateOriginated'](_0x4e504f[_0xc92f('0x1d')][_0x4e504f[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]]['queue']]);_0x4e504f['agents'][_0x4e504f['actions'][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0x11f')]][_0xc92f('0x11c')]=![];delete _0x4e504f['actions'][_0x452a0b[_0xc92f('0x11b')]];unlockQueueStatus(_0x26bcc2);});}else{this[_0xc92f('0xa9')](this[_0xc92f('0x1d')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xc9')],'ListId':this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xf2')],'VoiceQueueId':this[_0xc92f('0x23')][_0x452a0b['actionid']][_0xc92f('0xcb')]||undefined,'CampaignId':this['actions'][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x129')));delete this['actions'][_0x452a0b[_0xc92f('0x11b')]];unlockQueueStatus(_0x26bcc2);}}else if((strategy[this[_0xc92f('0x1d')][this['actions'][_0x452a0b['actionid']]['queue']][_0xc92f('0x49')]]||_0xc92f('0x16'))===_0xc92f('0x16')){var _0x458ff1;if(this[_0xc92f('0x23')][_0x452a0b['actionid']]&&!_['isEmpty'](this[_0xc92f('0x28')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]]['queue']])){if(this['queueBookedRR'][_0x4e504f[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]){this['queueBookedRR'][_0x4e504f[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]=this[_0xc92f('0x29')][this[_0xc92f('0x23')][_0x452a0b['actionid']][_0xc92f('0xaa')]]?this['queueBookedRR'][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]:this[_0xc92f('0x28')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]?this[_0xc92f('0x28')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]]['_rr']||0x0:0x0;}this[_0xc92f('0x28')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]][_0xc92f('0x12a')]=this[_0xc92f('0x29')][this[_0xc92f('0x23')][_0x452a0b[_0xc92f('0x11b')]][_0xc92f('0xaa')]];for(var _0x517fe5=0x0;_0x517fe5=0x0;})[_0xc92f('0xa8')](myreject(_0x566b80)));}}else{_0x27f7df['push'](ami['Action']({'action':'command','command':util[_0xc92f('0x73')]('iftime\x20%s,%s',_0x2427a3,!_[_0xc92f('0x3b')](config[_0xc92f('0x13f')][_0x2d6c54])?_0x2d6c54:'')})['then'](function(_0x4e37ea){return _0x4e37ea[_0xc92f('0x140')][_0xc92f('0x141')](_0xc92f('0x142'))>=0x0;})[_0xc92f('0xa8')](myreject(_0x566b80)));}BPromise[_0xc92f('0x143')](_0x27f7df)['then'](function(_0x5333ff){var _0x122999=_['some'](_0x5333ff);if(_0x122999){return _0x45d669(_0x122999);}else{_0x23a1d2['message']=_0x38cd5a?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc92f('0x144');return _0x566b80(msgResponse('[ifTime][promiseAll]',_0xc92f('0x138'),'Global:\x20'+_0x38cd5a+'\x20'+_0x1d2447+_0xc92f('0x145')+util[_0xc92f('0x8f')](_0x2427a3,{'showHidden':![],'depth':null})+_0xc92f('0x146')+_0x2d6c54));}})[_0xc92f('0xa8')](function(_0x3bd6b4){return _0x566b80(msgResponse(_0xc92f('0x137'),_0xc92f('0x138'),JSON[_0xc92f('0x124')](_0x3bd6b4)));});});};Dialer[_0xc92f('0xa3')][_0xc92f('0x147')]=function(_0xfce16d){var _0x4b6956=this;return function(){switch(_0xfce16d[_0xc92f('0x58')]){case _0xc92f('0x148'):freeVariablesPredictive(_0xfce16d);_0x4b6956[_0xc92f('0x149')](_0xfce16d,0x1);break;case _0xc92f('0x14a'):freeVariablesPredictive(_0xfce16d);_0x4b6956[_0xc92f('0x149')](_0xfce16d,_0xfce16d[_0xc92f('0x14b')]);break;case'predictive':_0x4b6956[_0xc92f('0x8')](_0xfce16d);break;case'booked':freeVariablesPredictive(_0xfce16d);_0x4b6956[_0xc92f('0x149')](_0xfce16d,0x1);break;default:freeVariablesPredictive(_0xfce16d);logger[_0xc92f('0x8e')](_0xc92f('0x14c'),_0xfce16d[_0xc92f('0x3c')],'method\x20not\x20recognized');}};};Dialer[_0xc92f('0xa3')][_0xc92f('0x14d')]=function(_0x2c4cc3){var _0x4a6345=this;return function(){_0x4a6345['handleIvr'](_0x2c4cc3);};};Dialer[_0xc92f('0xa3')]['syncQueueSummary']=function(_0x460d1b){var _0x145f89=this;if(isNotPreview(_0x460d1b[_0xc92f('0x58')])){if(isVoiceQueueOutbound(_0x460d1b[_0xc92f('0x52')])&&isActive(_0x460d1b[_0xc92f('0x57')])){_0x460d1b[_0xc92f('0x99')]=!![];BPromise['resolve']()[_0xc92f('0xae')](checkIsLoggedIn(_0x460d1b,_0x460d1b[_0xc92f('0x14e')]))[_0xc92f('0xae')](checkIsActive(_0x460d1b,_0x460d1b[_0xc92f('0x57')]))[_0xc92f('0xae')](checkInterval(_0x460d1b))[_0xc92f('0xae')](_0x145f89[_0xc92f('0x132')](_0x460d1b))[_0xc92f('0xae')](_0x145f89[_0xc92f('0x14f')](_0x460d1b['dialGlobalInterval'],_0x460d1b[_0xc92f('0x150')],_0x460d1b[_0xc92f('0x3c')],_0x460d1b))[_0xc92f('0xae')](_0x145f89['checkIfTimeIntervals'](_0x460d1b[_0xc92f('0x3f')],_0x460d1b[_0xc92f('0x150')],_0x460d1b[_0xc92f('0x3c')],_0x460d1b))[_0xc92f('0xae')](_0x145f89['checkDialMethod'](_0x460d1b))[_0xc92f('0xa8')](loggerCatchQueueSummary(_0xc92f('0x151'),_0x460d1b));}else{notSendMessagesQueue(_0x460d1b);}}else{freeVariablesPredictive(_0x460d1b);}};Dialer[_0xc92f('0xa3')][_0xc92f('0x131')]=function(){var _0x39d119=this;var _0x216fd2;for(var _0x370b00 in this[_0xc92f('0x1e')]){if(typeof this['campaigns'][_0x370b00]!==_0xc92f('0x93')){_0x216fd2=this['campaigns'][_0x370b00];if(isCampaignIvr(_0x216fd2['type'])&&isActive(_0x216fd2['active'])){_0x216fd2['sendMessageOneNotActive']=!![];BPromise[_0xc92f('0xad')]()[_0xc92f('0xae')](checkIsActive(_0x216fd2,_0x216fd2[_0xc92f('0x71')]))[_0xc92f('0xae')](checkInterval(_0x216fd2))['then'](_0x39d119['checkIsTrunkReachable'](_0x216fd2))['then'](_0x39d119[_0xc92f('0x14f')](_0x216fd2[_0xc92f('0x152')],_0x216fd2[_0xc92f('0x150')],_0x216fd2[_0xc92f('0x3c')],_0x216fd2))[_0xc92f('0xae')](_0x39d119[_0xc92f('0x136')](_0x216fd2['Interval'],_0x216fd2['dialTimezone'],_0x216fd2[_0xc92f('0x3c')],_0x216fd2))[_0xc92f('0xae')](_0x39d119[_0xc92f('0x14d')](_0x216fd2))['catch'](loggerCatchQueueSummary(_0xc92f('0x153'),_0x216fd2));}else{notSendMessagesCampaign(_0x216fd2);}}}};function getCallerIdRandom(_0x103e51,_0x398032){var _0x43b594;var _0x15c3be;var _0x3fda60;if(_0x398032<=0x0){_0x398032=0x1;}_0x43b594=new RegExp('\x5cw{0,'+_0x398032+'}$');_0x15c3be=Math[_0xc92f('0x154')](0xa,_0x398032-0x1);_0x3fda60=Math['pow'](0xa,_0x398032)-0x1;return util['format']('%s',_[_0xc92f('0x155')](_0x103e51,_0x43b594,_['random'](_0x15c3be,_0x3fda60)));}function extractCalleridName(_0x2e3cd5){var _0x3a445b=_0x2e3cd5[_0xc92f('0x156')](/"(.*?)"/);return _0x3a445b?_0x3a445b[0x1]:_0x2e3cd5;}function extractCalleridNumber(_0x308260){var _0x5d2452=_0x308260['match'](/<(.*?)>/);return _0x5d2452?_0x5d2452[0x1]:_0x308260;}Dialer[_0xc92f('0xa3')][_0xc92f('0x157')]=function(_0x49a193,_0x5f47ab){var _0x179140=this;var _0xfe510e=uuid['v4']();this['actions'][_0xfe510e]=new Action(_0x49a193,_0x5f47ab,_0xfe510e);return new BPromise(function(_0x2573bb,_0x25700b){if(_[_0xc92f('0x3b')](_0x49a193)&&typeof _0x49a193!==_0xc92f('0x158')){return _0x25700b(msgResponse(_0xc92f('0x159'),'Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x5f47ab[_0xc92f('0x15a')][_0xc92f('0x15b')])||_0x5f47ab[_0xc92f('0x15a')]['phone']===null){return _0x25700b(msgResponse(_0xc92f('0x159'),_0xc92f('0x138'),'contact\x20is\x20undefine'));}var _0x2e9d9f={'XMD-CALLERID':_0x179140[_0xc92f('0x23')][_0xfe510e][_0xc92f('0x15c')](),'XMD-AGI':_0x49a193[_0xc92f('0xfa')]?util[_0xc92f('0x73')](_0xc92f('0x15d'),ipAgi,_0x49a193[_0xc92f('0xfa')]):'NONE','XMD-AGIAFTER':_0x49a193[_0xc92f('0x102')]?util[_0xc92f('0x73')](_0xc92f('0x15d'),ipAgi,_0x49a193[_0xc92f('0x102')]):_0xc92f('0x15e'),'XMD-QUEUE':_0x49a193['type']===_0xc92f('0x48')?util[_0xc92f('0x73')](_0xc92f('0x15f'),_0x49a193[_0xc92f('0x3c')],_0x49a193[_0xc92f('0x160')]||'',_0x49a193['dialAgiAfterHangupAgent']?'c':'',_0x49a193[_0xc92f('0x10a')]||0x3):_0xc92f('0x15e'),'XMD-CONTACTID':_0x5f47ab[_0xc92f('0xc9')],'XMD-CDRTYPE':_0xc92f('0x5'),'CALLERID(all)':_0x179140[_0xc92f('0x23')][_0xfe510e][_0xc92f('0x15c')](),'XMD-AMD':_0x49a193[_0xc92f('0xde')]?_0xc92f('0x161'):'NONE','XMD-DESTINATION':_0xc92f('0xd6')};if(_0x49a193[_0xc92f('0xde')]){_0x2e9d9f[_0xc92f('0x162')]=_0x49a193[_0xc92f('0x163')]||0x9c4;_0x2e9d9f['XMD-AMDGREETING']=_0x49a193[_0xc92f('0x164')]||0x5dc;_0x2e9d9f[_0xc92f('0x165')]=_0x49a193[_0xc92f('0x166')]||0x320;_0x2e9d9f[_0xc92f('0x167')]=_0x49a193['dialAMDTotalAnalysisTime']||0x1388;_0x2e9d9f[_0xc92f('0x168')]=_0x49a193[_0xc92f('0x169')]||0x64;_0x2e9d9f['XMD-AMDBETWEENWORDSSILENCE']=_0x49a193[_0xc92f('0x16a')]||0x32;_0x2e9d9f[_0xc92f('0x16b')]=_0x49a193['dialAMDMaximumNumberOfWords']||0x3;_0x2e9d9f[_0xc92f('0x16c')]=_0x49a193[_0xc92f('0x16d')]||0x100;_0x2e9d9f[_0xc92f('0x16e')]=_0x49a193[_0xc92f('0x16f')]||0x1388;}if(_0x49a193[_0xc92f('0x52')]===_0xc92f('0x48')){_0x2e9d9f[_0xc92f('0x170')]=_0x5f47ab[_0xc92f('0xcb')];}else{_0x2e9d9f[_0xc92f('0x171')]=_0x5f47ab[_0xc92f('0xcc')];}for(var _0x3db432 in _0x5f47ab['Contact']){if(typeof _0x5f47ab[_0xc92f('0x15a')][_0x3db432]!==_0xc92f('0x93')){if(isNotNull(_0x5f47ab[_0xc92f('0x15a')][_0x3db432])&&_0x3db432!=='id'&&_0x3db432!==_0xc92f('0x172')&&_0x3db432!==_0xc92f('0x173')&&_0x3db432!=='updatedAt'){_0x2e9d9f[util[_0xc92f('0x73')]('%s%s',_0xc92f('0x174'),_[_0xc92f('0x175')](_0x3db432))]=_0x5f47ab[_0xc92f('0x15a')][_0x3db432];}}}var _0xa5fd35=_0x179140[_0xc92f('0xd1')](_0x49a193[_0xc92f('0x70')])?getCallerId(_0x49a193['Trunk'][_0xc92f('0x72')],_0x49a193[_0xc92f('0x176')],_0x49a193['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x49a193[_0xc92f('0x59')],_0x49a193[_0xc92f('0x177')]):_0x49a193[_0xc92f('0x59')]):getCallerId(_[_0xc92f('0xa7')](_0x49a193[_0xc92f('0x133')])?_0x49a193[_0xc92f('0x70')][_0xc92f('0x72')]:_0x49a193['TrunkBackup'][_0xc92f('0x72')],_0x49a193[_0xc92f('0x176')],_0x49a193[_0xc92f('0x177')]>0x0?getCallerIdRandom(_0x49a193[_0xc92f('0x59')],_0x49a193[_0xc92f('0x177')]):_0x49a193[_0xc92f('0x59')]);if(_0xa5fd35){_0x2e9d9f[_0xc92f('0x178')]=_0x179140[_0xc92f('0x23')][_0xfe510e][_0xc92f('0x179')]=extractCalleridName(_0xa5fd35);_0x2e9d9f[_0xc92f('0x17a')]=_0x179140['actions'][_0xfe510e][_0xc92f('0x17b')]=extractCalleridNumber(_0xa5fd35);}return ami['Action']({'actionid':_0xfe510e,'action':_0xc92f('0x159'),'channel':_0x179140[_0xc92f('0xd1')](_0x49a193[_0xc92f('0x70')])?util['format'](_0xc92f('0x17c'),_0x49a193[_0xc92f('0x70')][_0xc92f('0x3c')],isNotNull(_0x49a193['dialPrefix'])?_0x49a193[_0xc92f('0x5a')][_0xc92f('0x17d')]()||'':'',_0x49a193['dialCutDigit']>0x0?_0x5f47ab[_0xc92f('0x15a')][_0xc92f('0x15b')]['substring'](_0x49a193[_0xc92f('0x17e')]):_0x5f47ab[_0xc92f('0x15a')][_0xc92f('0x15b')]):util[_0xc92f('0x73')](_0xc92f('0x17c'),_['isNil'](_0x49a193[_0xc92f('0x133')])?_0x49a193[_0xc92f('0x70')][_0xc92f('0x3c')]:_0x49a193['TrunkBackup'][_0xc92f('0x3c')],isNotNull(_0x49a193[_0xc92f('0x5a')])?_0x49a193[_0xc92f('0x5a')][_0xc92f('0x17d')]()||'':'',_0x49a193[_0xc92f('0x17e')]>0x0?_0x5f47ab[_0xc92f('0x15a')][_0xc92f('0x15b')][_0xc92f('0x17f')](_0x49a193['dialCutDigit']):_0x5f47ab[_0xc92f('0x15a')][_0xc92f('0x15b')]),'callerid':_0xa5fd35,'Exten':_0xc92f('0xd6'),'Context':_0xc92f('0x180'),'Priority':'1','variable':_0x2e9d9f,'timeout':(_0x49a193[_0xc92f('0x181')]||0x1e)*0x3e8,'async':!![],'channelid':_0xfe510e})[_0xc92f('0xae')](function(_0x1e98bc){return _0x2573bb(_0x1e98bc);})[_0xc92f('0xa8')](function(_0x3fcf0e){_0x49a193[_0xc92f('0x63')]+=0x1;var _0x532abd=new History(_0x179140[_0xc92f('0x23')][_0xfe510e]);logger[_0xc92f('0x8e')](util[_0xc92f('0x73')]('[originateError]:\x20%s',JSON['stringify'](_0x3fcf0e)));_0x532abd[_0xc92f('0xa0')]=0xe;_0x532abd['statedesc']=_0xc92f('0x182');_0x532abd[_0xc92f('0xa2')]=moment()[_0xc92f('0x73')](_0xc92f('0xf7'));_0x532abd[_0xc92f('0x111')]=_0x532abd[_0xc92f('0xa2')];_0x179140['createHistory'](_0x532abd)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x183')));_0x179140['moveContactManagedDialer'](_0x532abd)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x183')))[_0xc92f('0x1a')](function(){delete _0x179140[_0xc92f('0x23')][_0xfe510e];return _0x25700b(msgResponse(_0xc92f('0x159'),_0xc92f('0x184'),'originate\x20action\x20Error'));});});});};Dialer[_0xc92f('0xa3')][_0xc92f('0x2d')]=function(_0x5518ca){var _0xff583a=this[_0xc92f('0x23')][_0x5518ca[_0xc92f('0x11b')]];if(_0xff583a){delete this[_0xc92f('0x23')][_0x5518ca['actionid']];_0xff583a[_0xc92f('0x109')]=moment()[_0xc92f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x43fe13=_0xff583a['type']==='ivr'?this[_0xc92f('0x1e')][_0xff583a[_0xc92f('0xaa')]]:this[_0xc92f('0x1d')][_0xff583a[_0xc92f('0x185')]()];if(!this[_0xc92f('0xcf')](_0x5518ca[_0xc92f('0x186')])){this['updateOriginated'](_0x43fe13);return this['callProgressDetecting'](_0xff583a,_0x43fe13,_0x5518ca)['catch'](loggerCatch(_0xc92f('0x187')));}this[_0xc92f('0x24')][_0x5518ca[_0xc92f('0xd8')]]=_0xff583a;}};Dialer['prototype'][_0xc92f('0x188')]=function(_0x3cade6,_0x1e88ae,_0x4448d4){var _0xdef59c=new History(_0x1e88ae);if(_0xdef59c[_0xc92f('0xe4')]+_0xdef59c[_0xc92f('0x189')]+_0xdef59c[_0xc92f('0xe5')]+_0xdef59c[_0xc92f('0xe6')]+_0xdef59c[_0xc92f('0xe7')]+_0xdef59c[_0xc92f('0xf6')]+_0xdef59c[_0xc92f('0xe8')]+_0xdef59c[_0xc92f('0xe9')]>=_0x4448d4[_0xc92f('0xea')]-0x1){return!![];}switch(_0x3cade6){case 0x3:if(_0xdef59c[_0xc92f('0xe5')]>=_0x4448d4[_0xc92f('0x18a')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countnoanswerretry':_0xdef59c[_0xc92f('0xe5')]+=0x1,'scheduledat':moment()['add'](_0x4448d4[_0xc92f('0x18b')],_0xc92f('0xf1'))['format'](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c[_0xc92f('0xcb')]||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})['catch'](loggerCatch(_0xc92f('0x18c')));break;case 0x5:if(_0xdef59c['countbusyretry']>=_0x4448d4[_0xc92f('0x18d')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countbusyretry':_0xdef59c[_0xc92f('0xe4')]+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4['dialBusyRetryFrequency'],_0xc92f('0xf1'))[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c[_0xc92f('0xcb')]||undefined,'CampaignId':_0xdef59c['CampaignId']||undefined})['catch'](loggerCatch(_0xc92f('0x18e')));break;case 0x8:if(_0xdef59c['countcongestionretry']>=_0x4448d4[_0xc92f('0x18f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0xdef59c[_0xc92f('0x189')]+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4['dialCongestionRetryFrequency'],'minutes')[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c['VoiceQueueId']||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x190')));break;case 0x0:if(_0xdef59c[_0xc92f('0xe6')]>=_0x4448d4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xdef59c['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4[_0xc92f('0x191')],'minutes')['format'](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c['ListId'],'VoiceQueueId':_0xdef59c[_0xc92f('0xcb')]||undefined,'CampaignId':_0xdef59c['CampaignId']||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x192')));}break;case 0xa:if(_0xdef59c[_0xc92f('0xe7')]>=_0x4448d4[_0xc92f('0x10f')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countdropretry':_0xdef59c['countdropretry']+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4[_0xc92f('0x110')],'minutes')[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c['VoiceQueueId']||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x193')));break;case 0xb:if(_0xdef59c[_0xc92f('0xf6')]>=_0x4448d4[_0xc92f('0x117')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countabandonedretry':_0xdef59c[_0xc92f('0xf6')]+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4[_0xc92f('0x118')],_0xc92f('0xf1'))['format'](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c['VoiceQueueId']||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0xdef59c[_0xc92f('0xe8')]>=_0x4448d4[_0xc92f('0xec')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countmachineretry':_0xdef59c['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x4448d4['dialMachineRetryFrequency'],_0xc92f('0xf1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c[_0xc92f('0xcb')]||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0xf8')));break;case 0x14:if(_0xdef59c[_0xc92f('0xe9')]>=_0x4448d4[_0xc92f('0x194')]-0x1){return!![];}this[_0xc92f('0xb6')]({'active':![],'countagentrejectretry':_0xdef59c[_0xc92f('0xe9')]+=0x1,'scheduledat':moment()[_0xc92f('0xef')](_0x4448d4['dialAgentRejectRetryFrequency'],_0xc92f('0xf1'))[_0xc92f('0x73')](_0xc92f('0xf7')),'ContactId':_0xdef59c[_0xc92f('0xc9')],'ListId':_0xdef59c[_0xc92f('0xf2')],'VoiceQueueId':_0xdef59c['VoiceQueueId']||undefined,'CampaignId':_0xdef59c[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x195')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0xf232a5,_0x19bc13,_0x46d681){var _0x3da38a=this;var _0x3aa90c=new History(_0xf232a5);return new BPromise(function(_0x707529,_0x3210b7){if(_['isUndefined'](_0x19bc13)&&typeof _0x19bc13!==_0xc92f('0x158')){return _0x3210b7(msgResponse(_0xc92f('0x196'),_0xc92f('0x138'),_0xc92f('0x197')));}if(_[_0xc92f('0x3b')](_0x46d681)&&typeof _0x46d681!=='object'){return _0x3210b7(msgResponse(_0xc92f('0x196'),_0xc92f('0x138'),_0xc92f('0x198')));}switch(_0x46d681[_0xc92f('0x199')]){case'0':_0x19bc13['outboundNoSuchCallsDay']+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0x0;_0x3aa90c[_0xc92f('0xa1')]=_0xc92f('0x19a');_0x3aa90c[_0xc92f('0xe6')]+=0x1;_0x3aa90c[_0xc92f('0xe1')]+=0x1;ami[_0xc92f('0x47')](_0xc92f('0x19b'),ut[_0xc92f('0xe3')](_0xf232a5,_0xc92f('0x19c')));_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x19d')));if(_0x3da38a[_0xc92f('0x188')](0x0,_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0xe6')]>=_0x19bc13[_0xc92f('0x19e')]){_0x3da38a[_0xc92f('0xed')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x19f'));}else{_0x3da38a[_0xc92f('0xeb')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x19f'));}}break;case'3':_0x19bc13[_0xc92f('0x1a0')]+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0x3;_0x3aa90c[_0xc92f('0xa1')]=_0xc92f('0x1a1');_0x3aa90c[_0xc92f('0xe5')]+=0x1;_0x3aa90c['countglobal']+=0x1;ami[_0xc92f('0x47')](_0xc92f('0x1a2'),ut[_0xc92f('0xe3')](_0xf232a5,_0xc92f('0x1a3')));_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1a4')));if(_0x3da38a[_0xc92f('0x188')](0x3,_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0xe5')]>=_0x19bc13[_0xc92f('0x18a')]){_0x3da38a['createStateFinal'](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1a5'));}else{_0x3da38a[_0xc92f('0xeb')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1a5'));}}break;case'5':_0x19bc13[_0xc92f('0x5e')]+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0x5;_0x3aa90c[_0xc92f('0xa1')]='Busy';_0x3aa90c[_0xc92f('0xe4')]+=0x1;_0x3aa90c['countglobal']+=0x1;ami['emit'](_0xc92f('0x1a6'),ut[_0xc92f('0xe3')](_0xf232a5,_0xc92f('0x1a7')));_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1a8')));if(_0x3da38a[_0xc92f('0x188')](0x5,_0xf232a5,_0x19bc13)){if(_0x3aa90c['countbusyretry']>=_0x19bc13[_0xc92f('0x18d')]){_0x3da38a['createStateFinal'](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1a9'));}else{_0x3da38a[_0xc92f('0xeb')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1a9'));}}break;case'8':_0x19bc13[_0xc92f('0x5f')]+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0x8;_0x3aa90c[_0xc92f('0xa1')]='Congestion';_0x3aa90c[_0xc92f('0x189')]+=0x1;_0x3aa90c['countglobal']+=0x1;ami['emit'](_0xc92f('0x1aa'),ut['buildObj'](_0xf232a5,'congestion'));_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1ab')));if(_0x3da38a[_0xc92f('0x188')](0x8,_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0x189')]>=_0x19bc13[_0xc92f('0x18f')]){_0x3da38a[_0xc92f('0xed')](_0x3aa90c,_0x707529,_0x3210b7,'reason\x208\x20congestion');}else{_0x3da38a['stateGlobal'](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1ac'));}}break;case'11':_0x19bc13[_0xc92f('0x1ad')]+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0xb;_0x3aa90c['statedesc']=_0xc92f('0x1ae');_0x3aa90c[_0xc92f('0xf6')]+=0x1;_0x3aa90c['countglobal']+=0x1;_0x3da38a['createHistory'](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x119')));if(_0x3da38a[_0xc92f('0x188')](0xb,_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0xf6')]>=_0x19bc13['dialAbandonedMaxRetry']){_0x3da38a[_0xc92f('0xed')](_0x3aa90c,_0x707529,_0x3210b7,'reason\x2011\x20abandoned');}else{_0x3da38a[_0xc92f('0xeb')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1af'));}}break;case'20':_0x19bc13[_0xc92f('0x65')]+=0x1;_0x3aa90c['state']=0x14;_0x3aa90c[_0xc92f('0xa1')]='AgentReject';_0x3aa90c[_0xc92f('0xe9')]+=0x1;_0x3aa90c['countglobal']+=0x1;ami['emit'](_0xc92f('0x1b0'),ut['buildObj'](_0xf232a5,_0xc92f('0x1b1')));_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1b2')));if(_0x3da38a[_0xc92f('0x188')](0x14,_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0xe9')]>=_0x19bc13['dialAgentRejectMaxRetry']){_0x3da38a['createStateFinal'](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1b3'));}else{_0x3da38a[_0xc92f('0xeb')](_0x3aa90c,_0x707529,_0x3210b7,_0xc92f('0x1b3'));}}break;default:_0x19bc13[_0xc92f('0x66')]+=0x1;_0x3aa90c[_0xc92f('0xa0')]=0xc;_0x3aa90c[_0xc92f('0xa1')]=_0x46d681[_0xc92f('0x199')];_0x3da38a[_0xc92f('0xc2')](_0x3aa90c)[_0xc92f('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3da38a[_0xc92f('0x188')](_0x46d681[_0xc92f('0x199')],_0xf232a5,_0x19bc13)){if(_0x3aa90c[_0xc92f('0xe4')]+_0x3aa90c['countcongestionretry']+_0x3aa90c[_0xc92f('0xe5')]+_0x3aa90c[_0xc92f('0xe6')]+_0x3aa90c[_0xc92f('0xe7')]+_0x3aa90c[_0xc92f('0xf6')]+_0x3aa90c['countmachineretry']+_0x3aa90c[_0xc92f('0xe9')]>=_0x19bc13[_0xc92f('0xea')]){_0x3da38a['stateGlobal'](_0x3aa90c,_0x707529,_0x3210b7,_0x46d681[_0xc92f('0x199')]);}else{_0x3da38a[_0xc92f('0xed')](_0x3aa90c,_0x707529,_0x3210b7,_0x46d681['reason']);}}}});};Dialer[_0xc92f('0xa3')][_0xc92f('0xeb')]=function(_0x340b13,_0x377e8b,_0x3e639c,_0x2710ec){var _0x646828=new Final(_0x340b13);_0x646828[_0xc92f('0xa0')]=0xf;_0x646828[_0xc92f('0xa1')]='Global';this[_0xc92f('0xed')](_0x646828,_0x377e8b,_0x3e639c,_0x2710ec);};Dialer[_0xc92f('0xa3')][_0xc92f('0xed')]=function(_0x1a98ed,_0x20913f,_0x18cb06,_0x4ea2ba){this[_0xc92f('0xc0')](_0x1a98ed)[_0xc92f('0xae')](function(){return _0x20913f(msgResponse(_0xc92f('0x196'),_0xc92f('0xd0'),_0x4ea2ba));})[_0xc92f('0xa8')](function(){return _0x18cb06(msgResponse('[moveContactManagedDialer][0]',_0xc92f('0x138'),_0xc92f('0x1b4')));});};Dialer[_0xc92f('0xa3')]['predictive']=function(_0x59c79a){var _0x328891=_0x59c79a[_0xc92f('0x1b5')]/0x64;var _0x2f98bb=_0x59c79a['outboundDropCallsDayTimeout']/(_0x59c79a[_0xc92f('0x61')]+_0x59c79a[_0xc92f('0x5c')]);var _0x32b4ac=Math[_0xc92f('0x1b6')](_0x59c79a[_0xc92f('0x1b7')]*(_0x59c79a[_0xc92f('0x1b8')]/0x64));var _0x1da8ef=Math[_0xc92f('0x1b6')](_0x59c79a[_0xc92f('0x1b7')]*(_0x59c79a[_0xc92f('0x1b9')]/0x64));var _0x49b996=_0x59c79a['available']+_0x59c79a[_0xc92f('0x50')];var _0x493eae=Math[_0xc92f('0x1ba')](_0x59c79a['erlangCalls']*_0x59c79a[_0xc92f('0x6f')]*_0x59c79a[_0xc92f('0x6b')]*_0x59c79a[_0xc92f('0x6c')]);if(_[_0xc92f('0x3b')](_0x59c79a['startProgressive'])){if(!_[_0xc92f('0x3b')](_0x59c79a[_0xc92f('0x25')])){_0x59c79a[_0xc92f('0x25')]=undefined;loggerPredictive[_0xc92f('0x8e')]('[startMethodPredictive][StartProgressive]',_0xc92f('0x1bb'));}if(!_[_0xc92f('0x3b')](_0x59c79a[_0xc92f('0x89')])){loggerPredictive['error'](_0xc92f('0x1bc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x59c79a['handlePredictive']);_0x59c79a[_0xc92f('0x89')]=undefined;}_0x59c79a[_0xc92f('0x26')]=moment()[_0xc92f('0x73')](_0xc92f('0xf7'));loggerPredictive['info'](_0x59c79a[_0xc92f('0x3c')],_0xc92f('0x1bd'),_0x59c79a[_0xc92f('0x26')]);this[_0xc92f('0x149')](_0x59c79a,0x1);}else if(ifInterval(_0x59c79a['dialPredictiveInterval'],_0x59c79a['startProgressive'])){this[_0xc92f('0x149')](_0x59c79a,0x1);loggerPredictiveCalls[_0xc92f('0x78')](_0xc92f('0x1be'),_0x59c79a[_0xc92f('0x26')],_0x59c79a[_0xc92f('0x3c')]);_0x59c79a[_0xc92f('0x1bf')]=0x0;_0x59c79a[_0xc92f('0x10b')]=0x0;}else if(_0x328891<_0x2f98bb&&_0x59c79a['dialPredictiveOptimization']===_0xc92f('0x1c0')){freeVariablesPredictive(_0x59c79a);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x1c1'),_0xc92f('0x1c2'),_0x2f98bb,'startProgressive',_0x59c79a[_0xc92f('0x3c')]);}else if(_0x493eae<_0x59c79a[_0xc92f('0x10b')]&&_0x59c79a['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x59c79a);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x1c3'),_0xc92f('0x1c4'),_0x493eae,'Drop\x20in\x20this\x20interval',_0x59c79a[_0xc92f('0x10b')],_0xc92f('0x26'),_0x59c79a[_0xc92f('0x3c')]);}else if(!ifInterval(_0x59c79a[_0xc92f('0x1c5')],_0x59c79a[_0xc92f('0x26')])&&_[_0xc92f('0x3b')](_0x59c79a[_0xc92f('0x25')])&&!_[_0xc92f('0x3b')](_0x59c79a[_0xc92f('0x26')])){_0x59c79a[_0xc92f('0x25')]=moment()[_0xc92f('0x73')](_0xc92f('0xf7'));loggerPredictive[_0xc92f('0x78')](_0x59c79a[_0xc92f('0x3c')],_0xc92f('0x1c6'),_0x59c79a[_0xc92f('0x25')]);this['averageHandleTime'](_0x59c79a[_0xc92f('0x1c5')])[_0xc92f('0xae')](this[_0xc92f('0x1c7')](_0x59c79a))[_0xc92f('0xae')](mergeDataErlangB(_0x59c79a))['then'](this[_0xc92f('0x1c8')](_0x59c79a))[_0xc92f('0xa8')](loggerCatchPredictive(_0xc92f('0x1c9'),_0x59c79a));}else if(!ifInterval(_0x59c79a[_0xc92f('0x1c5')],_0x59c79a['startPredictive'])){_0x59c79a[_0xc92f('0x10b')]=0x0;_0x59c79a['startPredictive']=moment()[_0xc92f('0x73')](_0xc92f('0xf7'));loggerPredictive[_0xc92f('0x78')](_0x59c79a[_0xc92f('0x3c')],_0xc92f('0x1ca'),_0x59c79a['startPredictive']);clearInterval(_0x59c79a[_0xc92f('0x89')]);_0x59c79a['handlePredictive']=undefined;this[_0xc92f('0xb4')](_0x59c79a['dialPredictiveInterval'])[_0xc92f('0xae')](this[_0xc92f('0x1c7')](_0x59c79a))['then'](mergeDataErlangB(_0x59c79a))[_0xc92f('0xae')](this['startMethodPredictive'](_0x59c79a))[_0xc92f('0xa8')](loggerCatchPredictive(_0xc92f('0x1cb'),_0x59c79a));}else if(_0x59c79a['predictiveIntervalAvailable']&&_0x49b996<_0x59c79a[_0xc92f('0x1b7')]-_0x1da8ef){freeVariablesPredictive(_0x59c79a);loggerPredictive[_0xc92f('0x78')](_0x59c79a[_0xc92f('0x3c')],_0xc92f('0x1cc'),_0x49b996,_0xc92f('0x1cd'),_0x59c79a[_0xc92f('0x1b7')],'-',_0x1da8ef,'=',_0x59c79a[_0xc92f('0x1b7')]-_0x1da8ef,')');}else if(_0x59c79a[_0xc92f('0x1b7')]&&_0x49b996>_0x59c79a[_0xc92f('0x1b7')]+_0x32b4ac){freeVariablesPredictive(_0x59c79a);loggerPredictive[_0xc92f('0x78')](_0x59c79a[_0xc92f('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x49b996,_0xc92f('0x1ce'),_0x59c79a[_0xc92f('0x1b7')],'+',_0x32b4ac,'=',_0x59c79a[_0xc92f('0x1b7')]+_0x32b4ac,')');}};Dialer[_0xc92f('0xa3')][_0xc92f('0x1c7')]=function(_0x2985a3){var _0x106490=this;return function(_0x4aa0ec){return new BPromise(function(_0xe860ed,_0xca75db){_[_0xc92f('0xc8')](_0x2985a3,_0x4aa0ec[0x0]);if(checkGetDataPredictive(_0x4aa0ec[0x0])){var _0x42f9db=_0x2985a3['predictiveIntervalAvailable']=_0x2985a3[_0xc92f('0x50')]+_0x2985a3[_0xc92f('0x4b')];var _0x36fa50=_0x2985a3[_0xc92f('0x1c5')]*0x3c;var _0xcc80d7=_0x4aa0ec[0x0][_0xc92f('0x68')]+_0x4aa0ec[0x0][_0xc92f('0x81')];var _0x515078=(_0x4aa0ec[0x0][_0xc92f('0x67')]+_0x4aa0ec[0x0][_0xc92f('0x69')]+_0x4aa0ec[0x0][_0xc92f('0x7d')])/_0x4aa0ec[0x0][_0xc92f('0x6d')];_0x2985a3[_0xc92f('0x6b')]=_0x515078>0x0?_0x515078:0x1;switch(_0x2985a3[_0xc92f('0x1cf')]){case _0xc92f('0x1c0'):var _0x1380b9=_0x2985a3['dialPredictiveOptimizationPercentage']/0x64;return _0x106490[_0xc92f('0x1d0')](_0x42f9db,_0x36fa50,_0xcc80d7,_0x515078,_0x1380b9)[_0xc92f('0xae')](function(_0x139938){return _0xe860ed(_0x139938);});case _0xc92f('0x1d1'):var _0x3b2daa=_0x2985a3['dialPredictiveOptimizationPercentage']/0x64;return _0x106490[_0xc92f('0x1d2')](_0x42f9db,_0x36fa50,_0xcc80d7,_0x515078,_0x3b2daa)[_0xc92f('0xae')](function(_0x183df3){return _0xe860ed(_0x183df3);});default:return _0xca75db(msgResponse(_0xc92f('0x1d3'),'Failure',_0xc92f('0x1d4')));}}else{return _0xca75db(msgResponse(_0xc92f('0x1d3'),_0xc92f('0x138'),_0xc92f('0x1d5')));}});};};Dialer[_0xc92f('0xa3')][_0xc92f('0x1d6')]=function(_0x2f7f28){var _0x304394=this;return function(_0x31d35b){return new BPromise(function(_0x36bb89,_0x3bca8c){_[_0xc92f('0xc8')](_0x2f7f28,_0x31d35b[0x0]);if(checkGetDataPredictive(_0x31d35b[0x0])){loggerPredictive[_0xc92f('0x78')](JSON[_0xc92f('0x124')](_0x31d35b[0x0]));if(_0x2f7f28[_0xc92f('0x1cf')]===_0xc92f('0x1c0')){return _0x304394[_0xc92f('0xbe')](_0x2f7f28['id'])[_0xc92f('0xae')](function(_0x10e82a){var _0x595eca=_0x2f7f28['loggedIn']-_0x10e82a[0x0][_0xc92f('0x1d7')];var _0x1607f8=_0x2f7f28['dialPredictiveInterval']*0x3c;var _0x4a9ef7=_0x31d35b[0x0][_0xc92f('0x68')]+_0x31d35b[0x0]['predictiveIntervalAvgHoldtime'];var _0x437191=(_0x31d35b[0x0]['predictiveIntervalAnsweredCalls']+_0x31d35b[0x0][_0xc92f('0x69')]+_0x31d35b[0x0][_0xc92f('0x7d')])/_0x31d35b[0x0]['predictiveIntervalTotalCalls'];var _0x540923=_0x2f7f28[_0xc92f('0x1b5')]/0x64;_0x2f7f28['predictiveIntervalPauses']=_0x10e82a[0x0]['outboundQueuePauses']||0x0;_0x2f7f28[_0xc92f('0x6b')]=_0x437191>0x0?_0x437191:0x1;return _0x304394['abandonmentRate'](_0x595eca,_0x1607f8,_0x4a9ef7,_0x437191,_0x540923);})[_0xc92f('0xae')](function(_0x51f30f){return _0x36bb89(_0x51f30f);})[_0xc92f('0xa8')](function(_0x551e2c){return _0x3bca8c(msgResponse('[CatchErlangB]',_0xc92f('0x138'),JSON[_0xc92f('0x124')](_0x551e2c)));});}if(_0x2f7f28['dialPredictiveOptimization']==='agentBusyFactor'){return _0x304394['getVoiceQueueRtPauses'](_0x2f7f28['id'])[_0xc92f('0xae')](function(_0x7b617c){var _0x1a8b34=_0x2f7f28[_0xc92f('0x14e')]-_0x7b617c[0x0][_0xc92f('0x1d7')];var _0x58b52f=_0x2f7f28[_0xc92f('0x1c5')]*0x3c;var _0x8b9674=_0x31d35b[0x0][_0xc92f('0x68')]+_0x31d35b[0x0][_0xc92f('0x81')];var _0x115b38=(_0x31d35b[0x0][_0xc92f('0x67')]+_0x31d35b[0x0][_0xc92f('0x69')]+_0x31d35b[0x0][_0xc92f('0x7d')])/_0x31d35b[0x0][_0xc92f('0x6d')];var _0x134934=_0x2f7f28['dialPredictiveOptimizationPercentage']/0x64;_0x2f7f28['predictiveIntervalPauses']=_0x7b617c[0x0][_0xc92f('0x1d7')]||0x0;_0x2f7f28[_0xc92f('0x6b')]=_0x115b38>0x0?_0x115b38:0x1;return _0x304394[_0xc92f('0x1d2')](_0x1a8b34,_0x58b52f,_0x8b9674,_0x115b38,_0x134934);})[_0xc92f('0xae')](function(_0x24e3b7){return _0x36bb89(_0x24e3b7);})[_0xc92f('0xa8')](function(_0x33b9e9){return _0x3bca8c(msgResponse(_0xc92f('0x1d8'),'Failure',JSON[_0xc92f('0x124')](_0x33b9e9)));});}}else{return _0x3bca8c(msgResponse(_0xc92f('0x1d3'),_0xc92f('0x138'),_0xc92f('0x1d5')));}});};};Dialer['prototype'][_0xc92f('0x1c8')]=function(_0x13126a){var _0x2712d2=this;return function(){var _0x481ddc=0x0;var _0x3bc0bd=Math[_0xc92f('0x1ba')](_0x13126a[_0xc92f('0x6e')]*0x3e8);if(_0x3bc0bd>0x0){_0x3bc0bd=_0x3bc0bd<0x64?0x64:_0x3bc0bd;loggerPredictive[_0xc92f('0x78')](_0x13126a['name'],_0xc92f('0x1d9'),_0x3bc0bd,_0xc92f('0x45'));_0x13126a[_0xc92f('0x89')]=setInterval(function(){_0x2712d2[_0xc92f('0x89')](_0x13126a);loggerPredictiveCalls[_0xc92f('0x78')](_0xc92f('0x1da'),_0x481ddc+=0x1);},_0x3bc0bd);}else{loggerPredictive[_0xc92f('0x78')](_0x13126a['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc92f('0xa3')][_0xc92f('0x1db')]=function(_0x4f6888,_0x37b59b){var _0x36a8e4=this;return function(_0x46d7d3){if(_['isEmpty'](_0x46d7d3)){if(_[_0xc92f('0xa7')](_0x37b59b[_0xc92f('0xca')])||!_0x37b59b[_0xc92f('0x1dc')]){if(_0x4f6888[_0xc92f('0x58')]==='booked'){_0x4f6888[_0xc92f('0x122')]=_[_0xc92f('0x3b')](_0x4f6888[_0xc92f('0x122')])?!![]:_0x4f6888[_0xc92f('0x122')];var _0x142fd9=uuid['v4']();_0x36a8e4['actions'][_0x142fd9]=new Action(_0x4f6888,_0x37b59b,_0x142fd9);loggerBooked[_0xc92f('0x78')](_0xc92f('0x1dd'),_0x142fd9,_0xc92f('0x1de'),JSON[_0xc92f('0x124')](_0x4f6888['queueStatusComplete']),_0xc92f('0x1df'),_0x4f6888[_0xc92f('0x3c')]);if(_0x4f6888[_0xc92f('0x122')]){_0x4f6888[_0xc92f('0x122')]=![];_0x36a8e4[_0xc92f('0x28')][_0x36a8e4[_0xc92f('0x23')][_0x142fd9][_0xc92f('0xaa')]]=[];ami[_0xc92f('0x1e0')]({'actionid':_0x142fd9,'action':_0xc92f('0x1e1'),'queue':_0x4f6888[_0xc92f('0x3c')]})[_0xc92f('0xa8')](function(){_0x36a8e4[_0xc92f('0xa9')](_0x4f6888);_0x36a8e4[_0xc92f('0xb6')]({'active':![],'ContactId':_0x36a8e4[_0xc92f('0x23')][_0x142fd9][_0xc92f('0xc9')],'ListId':_0x36a8e4[_0xc92f('0x23')][_0x142fd9][_0xc92f('0xf2')],'VoiceQueueId':_0x36a8e4['actions'][_0x142fd9][_0xc92f('0xcb')]||undefined,'CampaignId':_0x36a8e4['actions'][_0x142fd9]['CampaignId']||undefined})[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1e2')));delete _0x36a8e4[_0xc92f('0x23')][_0x142fd9];});}else{loggerBooked[_0xc92f('0x78')]('[booked][checkContactBlack][else]',JSON[_0xc92f('0x124')](_0x4f6888[_0xc92f('0x122')]),_0xc92f('0x1df'),_0x4f6888[_0xc92f('0x3c')]);_0x36a8e4['updateOriginated'](_0x4f6888);_0x36a8e4[_0xc92f('0xb6')]({'active':![],'ContactId':_0x36a8e4[_0xc92f('0x23')][_0x142fd9]['ContactId'],'ListId':_0x36a8e4['actions'][_0x142fd9][_0xc92f('0xf2')],'VoiceQueueId':_0x36a8e4[_0xc92f('0x23')][_0x142fd9][_0xc92f('0xcb')]||undefined,'CampaignId':_0x36a8e4[_0xc92f('0x23')][_0x142fd9]['CampaignId']||undefined})[_0xc92f('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x36a8e4[_0xc92f('0x23')][_0x142fd9];}}else{return _0x36a8e4['actionOriginate'](_0x4f6888,_0x37b59b);}}else{if(getDiff(_0x37b59b[_0xc92f('0x1e3')])<_0x4f6888[_0xc92f('0x1e4')]*0x3c){if(_0x37b59b[_0xc92f('0x1e5')]&&!_0x37b59b['Agent'][_0xc92f('0x1e6')]){_0x36a8e4[_0xc92f('0x1c')][_0xc92f('0x127')](_0x37b59b['id'])['finally'](function(){_0x36a8e4[_0xc92f('0xa9')](_0x4f6888);});}else{_0x36a8e4[_0xc92f('0xb7')]({'active':![]},_0x37b59b['id'],0x1)[_0xc92f('0x1a')](function(){_0x36a8e4['updateOriginated'](_0x4f6888);});}}else{_0x4f6888[_0xc92f('0x64')]+=0x1;_0x36a8e4[_0xc92f('0xa9')](_0x4f6888);if(_0x4f6888[_0xc92f('0x1e7')]){_0x36a8e4['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x37b59b['ContactId'],'ListId':_0x37b59b[_0xc92f('0xf2')],'VoiceQueueId':_0x37b59b[_0xc92f('0xcb')]||undefined,'CampaignId':_0x37b59b[_0xc92f('0xcc')]||undefined})[_0xc92f('0xa8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x36a8e4['createHistory'](createObjHistory(_0x4f6888,_0x37b59b,_0xc92f('0x1e8'),0x17,_0xc92f('0x1e9')))[_0xc92f('0xa8')](loggerCatch(_0xc92f('0x1ea')));}else{_0x36a8e4['saveInDb'](createObjHistory(_0x4f6888,_0x37b59b,_0xc92f('0x1eb'),0x16,_0xc92f('0x1ec')),_0xc92f('0x1ed'),_0xc92f('0x1ee'));}}}}else{_0x4f6888[_0xc92f('0x5d')]+=0x1;_0x36a8e4[_0xc92f('0xc7')](createObjHistory(_0x4f6888,_0x37b59b,_0xc92f('0x1ef'),0xd,'Blacklist'),_0xc92f('0x1f0'),'[Originate][MoveBlacklist]');throw _0xc92f('0x1f1');}};};Dialer[_0xc92f('0xa3')][_0xc92f('0x1f2')]=function(_0xdc339){var _0x516afc=this;var _0x298548=_0xdc339[_0xc92f('0x1f3')]-_0xdc339[_0xc92f('0x92')]-_0xdc339[_0xc92f('0xba')];emitCampaignSummary(_0xdc339);if(_0x298548>0x0){if(_0x298548>this[_0xc92f('0x21')]){_0x298548=this[_0xc92f('0x21')];}_0xdc339[_0xc92f('0xba')]+=_0x298548;this[_0xc92f('0xbc')](_0xdc339['id'],_0x298548,_0xdc339[_0xc92f('0x1f4')],_0xdc339)['then'](function(_0x5d25b7){_0xdc339[_0xc92f('0xba')]-=_0x298548;_0xdc339[_0xc92f('0xba')]=_0xdc339['temp']>0x0?_0xdc339['temp']:0x0;if(!checkContactEmpty(_0x5d25b7)){_0xdc339[_0xc92f('0x40')]=_0xc92f('0x97');logger[_0xc92f('0x78')](_0xc92f('0x1f5')+_0xdc339[_0xc92f('0x3c')]);}else{_0xdc339['originated']+=_0x5d25b7[_0xc92f('0x91')];_0xdc339['message']=_0xc92f('0x1f6');for(var _0x1b8ebf=0x0;_0x1b8ebf<_0x5d25b7[_0xc92f('0x91')];_0x1b8ebf+=0x1){_0xdc339['ivrTotalCallsDays']+=0x1;if(_[_0xc92f('0xa7')](_0x5d25b7[_0x1b8ebf])||_['isNil'](_0x5d25b7[_0x1b8ebf][_0xc92f('0x15a')])||_['isNil'](_0x5d25b7[_0x1b8ebf]['Contact'][_0xc92f('0x15b')])){_0x516afc[_0xc92f('0xc6')](_0xc92f('0x1f7'),_0xdc339,_0x5d25b7[_0x1b8ebf]);}else{_0x516afc[_0xc92f('0xb2')](_[_0xc92f('0x125')](_0x5d25b7[_0x1b8ebf],['CampaignId',_0xc92f('0x1f8')]))[_0xc92f('0xae')](_0x516afc[_0xc92f('0x1db')](_0xdc339,_0x5d25b7[_0x1b8ebf]))[_0xc92f('0xa8')](_0x516afc[_0xc92f('0xc5')](_0xc92f('0x1f9'),_0xdc339));}}}})[_0xc92f('0xa8')](loggerGetContactDialer('[getContactCampaign2]',_0xdc339,_0x298548));}};Dialer[_0xc92f('0xa3')][_0xc92f('0x149')]=function(_0x50d3e8,_0xa9f4d6){var _0xf8748c=this;var _0x5d3e87=[];var _0x413c23=_0xa9f4d6>=0x1?_0xa9f4d6:0x1;if(_0x50d3e8['dialMethod']===_0xc92f('0x7')){_0x413c23=0x1;}var _0x3901ee=Math[_0xc92f('0x1ba')](_0x50d3e8[_0xc92f('0x4b')]*_0x413c23)-_0x50d3e8[_0xc92f('0x92')]-_0x50d3e8[_0xc92f('0xba')];emitVoiceQueueSummary(_0x50d3e8);if(_0x50d3e8[_0xc92f('0x1fa')]>0x0){var _0x1bd36a=_0x50d3e8[_0xc92f('0x1fa')]-_0x50d3e8[_0xc92f('0x92')]-_0x50d3e8[_0xc92f('0x50')]-_0x50d3e8['temp']-_0x50d3e8[_0xc92f('0x4c')];if(_0x3901ee>_0x1bd36a){_0x3901ee=_0x1bd36a;}}if(_0x3901ee>0x0){if(_0x50d3e8[_0xc92f('0x58')]===_0xc92f('0x7')){_0x3901ee=0x1;}if(_0x3901ee>this['maxNumberOriginate']){_0x3901ee=this['maxNumberOriginate'];}_0x50d3e8[_0xc92f('0xba')]+=_0x3901ee;for(var _0x5d195b in this['agents']){if(typeof this[_0xc92f('0x1f')][_0x5d195b]!==_0xc92f('0x93')){if(this[_0xc92f('0x1f')][_0x5d195b][_0xc92f('0xa0')]==='not_inuse'&&this[_0xc92f('0x1f')][_0x5d195b][_0xc92f('0x11d')]===_0xc92f('0xd3')){_0x5d3e87[_0xc92f('0x120')](this[_0xc92f('0x1f')][_0x5d195b]['id']);}}}this[_0xc92f('0xb9')](_0x50d3e8['id'],_0x5d3e87,_0x3901ee,_0x50d3e8[_0xc92f('0x1f4')],_0x50d3e8)[_0xc92f('0xae')](function(_0x3e0a9f){_0x50d3e8[_0xc92f('0xba')]-=_0x3901ee;_0x50d3e8[_0xc92f('0xba')]=_0x50d3e8['temp']>0x0?_0x50d3e8[_0xc92f('0xba')]:0x0;if(!checkContactEmpty(_0x3e0a9f)){_0xf8748c[_0xc92f('0xaf')](_0x50d3e8)[_0xc92f('0xae')](sendMessageReschedule(_0x50d3e8))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x50d3e8[_0xc92f('0x92')]+=_0x3e0a9f[_0xc92f('0x91')];_0x50d3e8[_0xc92f('0x40')]=_0x50d3e8['dialMethod']==='booked'?_0xc92f('0x161'):_0xc92f('0x1f6');for(var _0x8a60d6=0x0;_0x8a60d6<_0x3e0a9f[_0xc92f('0x91')];_0x8a60d6+=0x1){if(_[_0xc92f('0xa7')](_0x3e0a9f[_0x8a60d6])||_[_0xc92f('0xa7')](_0x3e0a9f[_0x8a60d6][_0xc92f('0x15a')])||_[_0xc92f('0xa7')](_0x3e0a9f[_0x8a60d6][_0xc92f('0x15a')][_0xc92f('0x15b')])){_0xf8748c[_0xc92f('0xc6')](_0xc92f('0x1f7'),_0x50d3e8,_0x3e0a9f[_0x8a60d6]);}else{_0xf8748c[_0xc92f('0xb1')](_[_0xc92f('0x125')](_0x3e0a9f[_0x8a60d6],[_0xc92f('0xcb'),_0xc92f('0x1f8')]))[_0xc92f('0xae')](_0xf8748c['checkContactBlack'](_0x50d3e8,_0x3e0a9f[_0x8a60d6]))['catch'](_0xf8748c[_0xc92f('0xc5')](_0xc92f('0x1f7'),_0x50d3e8));}}}})[_0xc92f('0xa8')](loggerGetContactDialer(_0xc92f('0x1fb'),_0x50d3e8,_0x3901ee));}};Dialer[_0xc92f('0xa3')]['handlePredictive']=function(_0xac2f3){if(_0xac2f3['dialLimitQueue']>0x0){var _0x14b9cd=_0xac2f3[_0xc92f('0x1fa')]-_0xac2f3[_0xc92f('0x92')]-_0xac2f3[_0xc92f('0x50')];if(_0x14b9cd>0x0){this[_0xc92f('0x1fc')](_0xac2f3);}else{loggerPredictiveCalls['info'](_0xc92f('0x1fd'));}}else{this[_0xc92f('0x1fc')](_0xac2f3);}};Dialer[_0xc92f('0xa3')][_0xc92f('0x1fc')]=function(_0x228590){var _0x5af08e=this;var _0x552ee2=[];_0x228590[_0xc92f('0x92')]+=0x1;for(var _0x426a22 in this[_0xc92f('0x1f')]){if(typeof this[_0xc92f('0x1f')][_0x426a22]!==_0xc92f('0x93')){if(this['agents'][_0x426a22]['state']==='not_inuse'&&this['agents'][_0x426a22][_0xc92f('0x11d')]===_0xc92f('0xd3')){_0x552ee2[_0xc92f('0x120')](this['agents'][_0x426a22]['id']);}}}this[_0xc92f('0xb9')](_0x228590['id'],_0x552ee2,0x1,_0x228590['dialOrderByScheduledAt'],_0x228590)[_0xc92f('0xae')](function(_0x541d89){if(!checkContactEmpty(_0x541d89)){checkContactLowerLimitOriginate(_0x228590,0x1,0x0);_0x5af08e[_0xc92f('0xaf')](_0x228590)[_0xc92f('0xae')](sendMessageReschedule(_0x228590))['catch'](loggerCatch(_0xc92f('0xb0')));}else{_0x228590['message']=_0xc92f('0x1f6');if(_['isNil'](_0x541d89[0x0])||_['isNil'](_0x541d89[0x0][_0xc92f('0x15a')])||_[_0xc92f('0xa7')](_0x541d89[0x0][_0xc92f('0x15a')][_0xc92f('0x15b')])){_0x5af08e['emptyContact'](_0xc92f('0x1f7'),_0x228590,_0x541d89[0x0]);}else{_0x5af08e[_0xc92f('0xb1')](_[_0xc92f('0x125')](_0x541d89[0x0],[_0xc92f('0xcb'),_0xc92f('0x1f8')]))['then'](_0x5af08e[_0xc92f('0x1db')](_0x228590,_0x541d89[0x0]))['catch'](_0x5af08e['loggerHandler'](_0xc92f('0x1fe'),_0x228590));}}})[_0xc92f('0xa8')](loggerGetContactDialer(_0xc92f('0x1ff'),_0x228590,0x1));emitVoiceQueueSummary(_0x228590);};Dialer[_0xc92f('0xa3')][_0xc92f('0x1d0')]=function(_0x53b217,_0x66eb4a,_0x4276b7,_0x4c02b3,_0x50bbf,_0x1f7c66){loggerPredictive[_0xc92f('0x78')](_0xc92f('0x200'));loggerPredictive[_0xc92f('0x78')]('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',_0x53b217);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x201'),_0x66eb4a);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x202'),_0x4276b7);loggerPredictive[_0xc92f('0x78')]('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',_0x4c02b3);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x203'),_0x50bbf);loggerPredictive[_0xc92f('0x78')]('---------------------------');return new BPromise(function(_0x5216e6,_0x498f55){if(_0x53b217<=0x0||isNaN(_0x53b217)){return _0x498f55(msgResponse(_0xc92f('0x204'),_0xc92f('0x184'),'m\x20=\x20'+_0x53b217));}if(_0x4276b7<=0x0||isNaN(_0x4276b7)){return _0x498f55(msgResponse(_0xc92f('0x204'),'Error',_0xc92f('0x205')+_0x4276b7));}if(_0x4c02b3<=0x0||isNaN(_0x4c02b3)){return _0x498f55(msgResponse(_0xc92f('0x204'),_0xc92f('0x184'),_0xc92f('0x206')+_0x4c02b3));}if(_0x66eb4a<=0x0||isNaN(_0x66eb4a)){return _0x498f55(msgResponse('[abandonmentRate]',_0xc92f('0x184'),_0xc92f('0x207')+_0x66eb4a));}if(_0x50bbf<=0x0||isNaN(_0x50bbf)){return _0x498f55(msgResponse(_0xc92f('0x204'),_0xc92f('0x184'),_0xc92f('0x208')+_0x50bbf));}_0x1f7c66=_0x1f7c66||0x0;var _0x37ee4b=0x1/_0x4276b7;var _0x359a38=0x0;var _0x188142=0x0;var _0x46de77=0x0;var _0x2d2fe4=0x0;for(var _0x17efd5=0x0;_0x46de77<_0x50bbf;_0x17efd5+=0x1){_0x188142=_0x17efd5/_0x66eb4a;_0x359a38=(_0x4c02b3*_0x188142+_0x1f7c66)/_0x37ee4b;_0x46de77=erlangb(_0x359a38,_0x53b217);_0x2d2fe4=_0x359a38/_0x53b217*(0x1-erlangb(_0x359a38,_0x53b217));}return _0x5216e6({'erlangCalls':_0x17efd5,'erlangCallToSecond':_0x66eb4a/_0x17efd5,'erlangAbandonmentRate':_0x46de77,'erlangBusyFactor':_0x2d2fe4});});};Dialer[_0xc92f('0xa3')][_0xc92f('0x1d2')]=function(_0x553daf,_0x4fa800,_0x202458,_0x2c8a17,_0x1c9d62,_0x44846d){loggerPredictive[_0xc92f('0x78')](_0xc92f('0x209'));loggerPredictive[_0xc92f('0x78')]('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',_0x553daf);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x201'),_0x4fa800);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x202'),_0x202458);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x20a'),_0x2c8a17);loggerPredictive[_0xc92f('0x78')](_0xc92f('0x20b'),_0x1c9d62);loggerPredictive[_0xc92f('0x78')]('---------------------------');return new BPromise(function(_0x30ab3d,_0x166abf){if(_0x553daf<=0x0||isNaN(_0x553daf)){return _0x166abf(msgResponse(_0xc92f('0x20c'),_0xc92f('0x184'),_0xc92f('0x20d')+_0x553daf));}if(_0x202458<=0x0||isNaN(_0x202458)){return _0x166abf(msgResponse(_0xc92f('0x20c'),_0xc92f('0x184'),'Ts\x20=\x20'+_0x202458));}if(_0x2c8a17<=0x0||isNaN(_0x2c8a17)){return _0x166abf(msgResponse(_0xc92f('0x20c'),_0xc92f('0x184'),_0xc92f('0x206')+_0x2c8a17));}if(_0x4fa800<=0x0||isNaN(_0x4fa800)){return _0x166abf(msgResponse(_0xc92f('0x20c'),'Error',_0xc92f('0x207')+_0x4fa800));}if(_0x1c9d62<=0x0||isNaN(_0x1c9d62)){return _0x166abf(msgResponse('[busyFactor]',_0xc92f('0x184'),_0xc92f('0x20e')+_0x1c9d62));}_0x44846d=_0x44846d||0x0;var _0xfb3e67=0x1/_0x202458;var _0x9895c1=0x0;var _0x503656=0x0;var _0x361cbf=0x0;var _0x169247=0x0;for(var _0x1b04d0=0x0;_0x169247<_0x1c9d62;_0x1b04d0+=0x1){_0x503656=_0x1b04d0/_0x4fa800;_0x9895c1=(_0x2c8a17*_0x503656+_0x44846d)/_0xfb3e67;_0x361cbf=erlangb(_0x9895c1,_0x553daf);_0x169247=_0x9895c1/_0x553daf*(0x1-erlangb(_0x9895c1,_0x553daf));}return _0x30ab3d({'erlangCalls':_0x1b04d0,'erlangCallToSecond':_0x4fa800/_0x1b04d0,'erlangAbandonmentRate':_0x361cbf,'erlangBusyFactor':_0x169247});});};module[_0xc92f('0x20f')]=Dialer; \ No newline at end of file +var _0x2d6c=['from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','checkRetriveMax','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','agentBusyFactor','busyFactor','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','unlockContact','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[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','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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','uuid','md5','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','startPredictive','Trunk','active','callerid','Interval','format','voice_queue:save','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','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','clearing\x20variable\x20start\x20progressive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','IS_DISACTIVED','is\x20disactive','state','endtime','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','catch','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','merge','ContactId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','variable','amdstatus','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerCallsDay','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countabandonedretry','stateGlobal','ivrAnswerCallsDay','dialQueueProject','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','countglobal','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','idHopper','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','Queue','method\x20not\x20recognized','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','phone','substring','trim'];(function(_0x2031fc,_0x439ab6){var _0x128e3c=function(_0x443628){while(--_0x443628){_0x2031fc['push'](_0x2031fc['shift']());}};_0x128e3c(++_0x439ab6);}(_0x2d6c,0x80));var _0xc2d6=function(_0x1cc06b,_0x2a6bca){_0x1cc06b=_0x1cc06b-0x0;var _0x38b888=_0x2d6c[_0x1cc06b];return _0x38b888;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xc2d6('0x0'));var moment=require('moment');var rr=require('rr');var md5=require(_0xc2d6('0x1'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0xc2d6('0x2'));var logger=require(_0xc2d6('0x3'))(_0xc2d6('0x4'));var loggerBooked=require(_0xc2d6('0x3'))(_0xc2d6('0x5'));var loggerPredictive=require('../../../config/logger')(_0xc2d6('0x6'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xc2d6('0x7'));var ami=require(_0xc2d6('0x8'));config[_0xc2d6('0x9')]=_[_0xc2d6('0xa')](config[_0xc2d6('0x9')],{'host':_0xc2d6('0xb'),'port':0x18eb});var io=require(_0xc2d6('0xc'))(new Redis(config[_0xc2d6('0x9')]));var cmHopper=require(_0xc2d6('0xd'));var cmHopperHistory=require(_0xc2d6('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xc2d6('0xf'));var History=require(_0xc2d6('0x10'));var Final=require(_0xc2d6('0x11'));var AgentComplete=require(_0xc2d6('0x12'));var QueueCallerAbandon=require(_0xc2d6('0x13'));var Hangup=require(_0xc2d6('0x14'));var ipAgi=process[_0xc2d6('0x15')][_0xc2d6('0x16')]||_0xc2d6('0x17');var strategy={'rrmemory':_0xc2d6('0x18'),'roundrobin':_0xc2d6('0x19')};var Sequence=function(){};Sequence[_0xc2d6('0x1a')][_0xc2d6('0x1b')]=function(_0x3a52d2){this['tail']=this[_0xc2d6('0x1c')]?this['tail']['finally'](_0x3a52d2):_0x3a52d2();};function Dialer(_0x1beaee,_0x3c72bc){this[_0xc2d6('0x1d')]=new Sequence();this[_0xc2d6('0x1e')]=_0x3c72bc;this['voiceQueues']=_0x1beaee[_0xc2d6('0x1f')];this[_0xc2d6('0x20')]=_0x1beaee[_0xc2d6('0x20')];this[_0xc2d6('0x21')]=_0x1beaee[_0xc2d6('0x21')];this['trunks']=_0x1beaee[_0xc2d6('0x22')];this['maxNumberOriginate']=config[_0xc2d6('0x23')]||0x2;this['channels']={};this[_0xc2d6('0x24')]={};this[_0xc2d6('0x25')]={};this[_0xc2d6('0x26')]={};this[_0xc2d6('0x27')]={};this['startPredictive']={};this[_0xc2d6('0x28')]={};this[_0xc2d6('0x29')]={};this[_0xc2d6('0x2a')]={};this[_0xc2d6('0x2b')]={};ami['on'](_0xc2d6('0x2c'),this[_0xc2d6('0x2d')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x2f'),this[_0xc2d6('0x30')][_0xc2d6('0x2e')](this));ami['on']('originateresponse',this[_0xc2d6('0x31')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x32'),this['syncAgentComplete'][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x33'),this[_0xc2d6('0x7')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x34'),this[_0xc2d6('0x35')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x36'),this[_0xc2d6('0x37')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x38'),this[_0xc2d6('0x39')][_0xc2d6('0x2e')](this));ami['on'](_0xc2d6('0x3a'),this[_0xc2d6('0x3b')]['bind'](this));ami['on'](_0xc2d6('0x3c'),this[_0xc2d6('0x3d')][_0xc2d6('0x2e')](this));this[_0xc2d6('0x3e')]();this[_0xc2d6('0x3f')]();}function isNotNull(_0x40c7b5){return _0x40c7b5!==null&&!_[_0xc2d6('0x40')](_0x40c7b5);}function checkIsLoggedIn(_0x118cb7,_0x28c807){return function(){if(_0x28c807<=0x0){_0x118cb7[_0xc2d6('0x41')]='AGENTS_NOT_LOGGED';throw _0x118cb7[_0xc2d6('0x42')]+_0xc2d6('0x43');}};}function isActive(_0x4a85e1){return _0x4a85e1;}function checkIsActive(_0x146b1d,_0x38fcae){return function(){if(!isActive(_0x38fcae)){_0x146b1d[_0xc2d6('0x41')]=_0xc2d6('0x44');throw _0x146b1d['name']+_0xc2d6('0x45');}};}function checkInterval(_0x28c0b1){return function(){if(!isNotNull(_0x28c0b1['Interval'])){_0x28c0b1['message']='INTERVAL_IS_NULL';throw _0x28c0b1[_0xc2d6('0x42')]+_0xc2d6('0x46');}if(!isNotNull(_0x28c0b1['Interval'][_0xc2d6('0x47')])){_0x28c0b1['message']=_0xc2d6('0x48');throw _0x28c0b1['name']+_0xc2d6('0x46');}if(!isNotNull(_[_0xc2d6('0x49')](_0x28c0b1['Interval'][_0xc2d6('0x47')]))){_0x28c0b1['message']=_0xc2d6('0x48');throw _0x28c0b1[_0xc2d6('0x42')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5d7663,_0x51d656,_0x1d3628){return{'action':_0x5d7663,'response':_0x51d656,'message':_0x1d3628,'stack':_0x1d3628};}function myreject(_0xcb6c02){return function(_0x9426fa){return _0xcb6c02(msgResponse('[ifTime][Action]',_0xc2d6('0x4a'),JSON[_0xc2d6('0x4b')](_0x9426fa)));};}function getSeconds(_0x41fa7b,_0x263d2b){var _0x49aeb8=moment(_0x41fa7b)[_0xc2d6('0x4c')](0x0);var _0x4a9a6d=moment(_0x263d2b)['milliseconds'](0x0);return _0x49aeb8['diff'](_0x4a9a6d,_0xc2d6('0x4d'));}function emit(_0x401f45,_0x10ba65,_0x23ab00){io['to'](_0x401f45)[_0xc2d6('0x4e')](_0x10ba65,_0x23ab00);}function emitVoiceQueueSummary(_0x514acf){if(_0x514acf[_0xc2d6('0x4f')]===_0xc2d6('0x50')){var _0x24b6e8={'id':_0x514acf['id'],'name':_0x514acf[_0xc2d6('0x42')],'strategy':_0x514acf[_0xc2d6('0x51')],'answered':_0x514acf[_0xc2d6('0x52')],'available':_0x514acf[_0xc2d6('0x53')],'loggedIn':_0x514acf[_0xc2d6('0x54')],'pTalking':_0x514acf[_0xc2d6('0x55')],'sumBillable':_0x514acf[_0xc2d6('0x56')],'sumDuration':_0x514acf[_0xc2d6('0x57')],'sumHoldTime':_0x514acf['sumHoldTime']||0x0,'talking':_0x514acf[_0xc2d6('0x58')],'total':_0x514acf['total'],'type':_0x514acf[_0xc2d6('0x4f')],'unmanaged':_0x514acf[_0xc2d6('0x59')],'abandoned':_0x514acf[_0xc2d6('0x5a')],'waiting':_0x514acf[_0xc2d6('0x5b')],'loggedInDb':_0x514acf[_0xc2d6('0x5c')],'dialActive':_0x514acf['dialActive'],'dialMethod':_0x514acf[_0xc2d6('0x5d')],'dialOriginateCallerIdName':_0x514acf[_0xc2d6('0x5e')],'dialOriginateCallerIdNumber':_0x514acf[_0xc2d6('0x5f')],'dialOriginateTimeout':_0x514acf[_0xc2d6('0x60')],'dialPrefix':_0x514acf['dialPrefix'],'outboundAnswerAgiCallsDay':_0x514acf[_0xc2d6('0x61')],'outboundAnswerCallsDay':_0x514acf['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x514acf[_0xc2d6('0x62')],'outboundBusyCallsDay':_0x514acf['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x514acf[_0xc2d6('0x63')],'outboundDropCallsDayACS':_0x514acf['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x514acf[_0xc2d6('0x64')],'outboundDropCallsDayTimeout':_0x514acf[_0xc2d6('0x65')],'outboundNoAnswerCallsDay':_0x514acf['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x514acf[_0xc2d6('0x66')],'outboundOriginateFailureCallsDay':_0x514acf[_0xc2d6('0x67')],'outboundReCallsDay':_0x514acf[_0xc2d6('0x68')],'outboundRejectCallsDay':_0x514acf[_0xc2d6('0x69')],'outboundUnknownCallsDay':_0x514acf[_0xc2d6('0x6a')],'predictiveIntervalAnsweredCalls':_0x514acf[_0xc2d6('0x6b')],'predictiveIntervalAvgHoldtime':_0x514acf[_0xc2d6('0x6c')],'predictiveIntervalAvgTalktime':_0x514acf[_0xc2d6('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x514acf[_0xc2d6('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x514acf[_0xc2d6('0x6f')],'predictiveIntervalErlangCalls':_0x514acf['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x514acf['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x514acf[_0xc2d6('0x70')],'predictiveIntervalMultiplicativeFactor':_0x514acf[_0xc2d6('0x71')],'predictiveIntervalPauses':_0x514acf['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x514acf[_0xc2d6('0x72')],'predictiveIntervalTotalCalls':_0x514acf['predictiveIntervalTotalCalls'],'message':_0x514acf['message'],'originated':_0x514acf[_0xc2d6('0x73')],'erlangCalls':_0x514acf[_0xc2d6('0x74')],'erlangCallToSecond':_0x514acf[_0xc2d6('0x75')],'erlangAbandonmentRate':_0x514acf['erlangAbandonmentRate'],'erlangBusyFactor':_0x514acf['erlangBusyFactor'],'startPredictive':_0x514acf[_0xc2d6('0x76')],'startProgressive':_0x514acf[_0xc2d6('0x28')]};if(_0x514acf[_0xc2d6('0x77')]){_0x24b6e8[_0xc2d6('0x77')]={'id':_0x514acf[_0xc2d6('0x77')]['id'],'name':_0x514acf[_0xc2d6('0x77')][_0xc2d6('0x42')],'active':_0x514acf[_0xc2d6('0x77')][_0xc2d6('0x78')],'callerid':_0x514acf[_0xc2d6('0x77')][_0xc2d6('0x79')]};}if(_0x514acf[_0xc2d6('0x7a')]){_0x24b6e8[_0xc2d6('0x7a')]={'id':_0x514acf[_0xc2d6('0x7a')]['id'],'name':_0x514acf[_0xc2d6('0x7a')]['name']};}var _0x1005ea=md5(JSON['stringify'](_0x24b6e8));if(_0x514acf[_0xc2d6('0x1')]!==_0x1005ea){_0x514acf['md5']=_0x1005ea;emit(util[_0xc2d6('0x7b')]('voice:queue:%s',_0x24b6e8[_0xc2d6('0x42')]),_0xc2d6('0x7c'),_0x24b6e8);}}}function emitCampaignSummary(_0xaa1be5){if(_0xaa1be5[_0xc2d6('0x4f')]==='ivr'){emit(util['format'](_0xc2d6('0x7d'),_0xaa1be5['name']),_0xc2d6('0x7e'),_0xaa1be5);}}function checkGetDataPredictive(_0x51c599){if(isNotNull(_0x51c599)&&!_[_0xc2d6('0x49')](_0x51c599)){loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x80'));loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x81'),_0x51c599[_0xc2d6('0x82')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x83'),_0x51c599[_0xc2d6('0x6b')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x84'),_0x51c599[_0xc2d6('0x6f')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x85'),_0x51c599['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xc2d6('0x86'),_0x51c599[_0xc2d6('0x6c')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x87'),_0x51c599[_0xc2d6('0x6d')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x88'));if(_0x51c599['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x51c599['predictiveIntervalAvgTalktime'])&&_0x51c599['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x89'));if(!_[_0xc2d6('0x40')](_0x51c599['predictiveIntervalAvgHoldtime'])&&_0x51c599[_0xc2d6('0x6c')]>0x0){return!![];}loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8a'));}else{loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8b'));}}else{loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8c'));}return![];}function mergeDataErlangB(_0x3ce8cb){return function(_0x2d71da){loggerPredictive[_0xc2d6('0x7f')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8d'),_0x2d71da[_0xc2d6('0x74')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8e'),_0x2d71da['erlangCallToSecond']);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8f'),_0x2d71da[_0xc2d6('0x90')]);loggerPredictive['info'](_0xc2d6('0x91'),_0x2d71da[_0xc2d6('0x92')]);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x8f'),_0x2d71da['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_['merge'](_0x3ce8cb,_0x2d71da);};}function getDiff(_0x218978){var _0x4ecad7=moment()[_0xc2d6('0x4c')](0x0);var _0x346970=moment(_0x218978)[_0xc2d6('0x4c')](0x0);return _0x4ecad7['diff'](_0x346970,'seconds');}function ifInterval(_0x5c6de1,_0x5cc335){if(_[_0xc2d6('0x40')](_0x5cc335)){return![];}return getDiff(_0x5cc335)<_0x5c6de1*0x3c;}function freeVariablesPredictive(_0x44083b){if(isNotNull(_0x44083b)){if(!_[_0xc2d6('0x40')](_0x44083b['startProgressive'])){_0x44083b[_0xc2d6('0x28')]=undefined;loggerPredictive[_0xc2d6('0x7f')](_0x44083b[_0xc2d6('0x42')],_0xc2d6('0x93'));}if(!_[_0xc2d6('0x40')](_0x44083b[_0xc2d6('0x76')])){_0x44083b[_0xc2d6('0x76')]=undefined;loggerPredictive[_0xc2d6('0x7f')](_0x44083b[_0xc2d6('0x42')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xc2d6('0x40')](_0x44083b[_0xc2d6('0x94')])){clearInterval(_0x44083b[_0xc2d6('0x94')]);_0x44083b[_0xc2d6('0x94')]=undefined;loggerPredictive[_0xc2d6('0x7f')](_0x44083b[_0xc2d6('0x42')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4e7dce,_0x38eadc){if(_0x38eadc===0x0){return 0x0;}var _0x189ee1=0x1;for(var _0x2d2743=0x1;_0x2d2743<=_0x38eadc;_0x2d2743+=0x1){_0x189ee1=0x1+_0x189ee1*_0x2d2743/_0x4e7dce;}return 0x1/_0x189ee1;}function isVoiceQueueOutbound(_0x393927){return _0x393927===_0xc2d6('0x50');}function isNotPreview(_0x7ae9f9){return _0x7ae9f9!==_0xc2d6('0x1e');}function isCampaignIvr(_0x3b28d4){return _0x3b28d4==='ivr';}function getCallerId(_0x1b04ca,_0x5b5c95,_0x3d2060){if(!_['isUndefined'](_0x3d2060)&&typeof _0x3d2060===_0xc2d6('0x95')&&!_[_0xc2d6('0x49')](_0x3d2060)){if(!_[_0xc2d6('0x40')](_0x5b5c95)&&typeof _0x5b5c95===_0xc2d6('0x95')&&!_[_0xc2d6('0x49')](_0x5b5c95)){return util['format']('\x22%s\x22\x20<%s>',_0x5b5c95,_0x3d2060);}return util[_0xc2d6('0x7b')](_0xc2d6('0x96'),_0x3d2060,_0x3d2060);}if(!_[_0xc2d6('0x40')](_0x1b04ca)&&typeof _0x1b04ca===_0xc2d6('0x95')&&!_[_0xc2d6('0x49')](_0x1b04ca)){return _0x1b04ca;}return _0xc2d6('0x97');}function loggerCatchQueueSummary(_0x298361,_0x85039){return function(_0x4f6ee3){freeVariablesPredictive(_0x85039);emitVoiceQueueSummary(_0x85039);emitCampaignSummary(_0x85039);loggerSyncQueueSummary['error'](_0x298361,util[_0xc2d6('0x98')](_0x4f6ee3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3a566f,_0x2428df){return function(_0x4bfb5a){loggerPredictive[_0xc2d6('0x99')](_0x2428df[_0xc2d6('0x42')],_0x3a566f);loggerPredictive[_0xc2d6('0x99')](_0x4bfb5a['stack']);freeVariablesPredictive(_0x2428df);};}function loggerCatch(_0x274569){return function(_0x59c3c4){logger[_0xc2d6('0x99')](_0x274569,util['inspect'](_0x59c3c4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x334ea2){return _0x334ea2&&!_[_0xc2d6('0x40')](_0x334ea2)&&_0x334ea2[_0xc2d6('0x9a')]>0x0;}function decremetOriginate(_0x44837d){if(!_[_0xc2d6('0x40')](_0x44837d)&&_0x44837d!==null){if(typeof _0x44837d[_0xc2d6('0x73')]!=='undefined'){if(_0x44837d['originated']>0x0){_0x44837d[_0xc2d6('0x73')]-=0x1;}else{logger[_0xc2d6('0x99')](_0xc2d6('0x9b'));}}}else{logger['error'](_0xc2d6('0x9c'));}}function checkContactLowerLimitOriginate(_0x3b0c51,_0x2084c3,_0x5700d9){if(_0x2084c3>_0x5700d9){for(var _0xf07933=0x0;_0xf07933<_0x2084c3-_0x5700d9;_0xf07933+=0x1){decremetOriginate(_0x3b0c51);}}}function loggerGetContactDialer(_0x624e63,_0x20182a,_0x5e920d){return function(_0x1bf5ae){checkContactLowerLimitOriginate(_0x20182a,_0x5e920d,0x0);logger[_0xc2d6('0x99')](_0x624e63,util[_0xc2d6('0x98')](_0x1bf5ae,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x528724){return function(_0xd16d81){if(isNotNull(_0xd16d81)&&isNotNull(_0xd16d81[0x0])){if(_0xd16d81[0x0][_0xc2d6('0x9d')]>0x0){_0x528724['message']=_0xc2d6('0x9e');logger[_0xc2d6('0x7f')]('[getContactDialer2][ReScheduled]'+_0x528724[_0xc2d6('0x42')],_0xd16d81[0x0][_0xc2d6('0x9d')],_0xc2d6('0x9f'));}else{_0x528724[_0xc2d6('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xc2d6('0x7f')](_0xc2d6('0xa0')+_0x528724[_0xc2d6('0x42')]);}}};}function notSendMessagesQueue(_0x1137dd){if(_0x1137dd[_0xc2d6('0xa1')]){freeVariablesPredictive(_0x1137dd);if(_0x1137dd[_0xc2d6('0x73')]===0x0&&_0x1137dd[_0xc2d6('0x58')]===0x0&&_0x1137dd[_0xc2d6('0x5b')]===0x0&&(_0x1137dd[_0xc2d6('0x55')]||0x0)===0x0){_0x1137dd['sendMessageOneNotActive']=![];_0x1137dd[_0xc2d6('0x53')]=0x0;_0x1137dd['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xc2d6('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1137dd['name'],'is\x20not\x20active');}else{_0x1137dd['message']=_0xc2d6('0xa2');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1137dd[_0xc2d6('0x42')],_0xc2d6('0xa3'));}emitVoiceQueueSummary(_0x1137dd);}}function notSendMessagesCampaign(_0x8b9398){if(_0x8b9398[_0xc2d6('0xa1')]){if(_0x8b9398[_0xc2d6('0x73')]===0x0){_0x8b9398['sendMessageOneNotActive']=![];_0x8b9398[_0xc2d6('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x8b9398[_0xc2d6('0x42')],'is\x20not\x20active');}else{_0x8b9398[_0xc2d6('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc2d6('0x99')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x8b9398[_0xc2d6('0x42')],_0xc2d6('0xa3'));}emitCampaignSummary(_0x8b9398);}}function createObjHistory(_0x518e5a,_0x5d102a,_0x5a78d4,_0x31b669,_0x5f00b9){_0x518e5a[_0xc2d6('0x41')]=_0x5a78d4;var _0x3a05f0=new Action(_0x518e5a,_0x5d102a);var _0x2835d0=new History(_0x3a05f0);_0x2835d0[_0xc2d6('0xa4')]=_0x31b669;_0x2835d0['statedesc']=_0x5f00b9;_0x2835d0[_0xc2d6('0xa5')]=_0x3a05f0[_0xc2d6('0xa6')];return _0x2835d0;}Dialer[_0xc2d6('0x1a')][_0xc2d6('0x3f')]=function(){var _0x172420=this;setInterval(function(){_0x172420[_0xc2d6('0xa7')](_0x172420['uniqueId'],_0xc2d6('0xa8'));_0x172420['clearZombieChannels'](_0x172420[_0xc2d6('0x24')],'[actions]');},0x32c8);};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xa7')]=function(_0x1068da,_0x26a365){var _0x3f6683=this;for(var _0xa01a94 in _0x1068da){if(typeof _0x1068da[_0xa01a94]!=='undefined'){this[_0xc2d6('0x1d')][_0xc2d6('0x1b')](function(){if(!_[_0xc2d6('0xa9')](_0x1068da[_0xa01a94])){return ami[_0xc2d6('0xaa')]({'action':_0xc2d6('0xab'),'channel':_0x1068da[_0xa01a94]['channel']})[_0xc2d6('0xac')](function(_0xdb0bfe){if(_0xdb0bfe['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x1068da[_0xa01a94]&&_0x1068da[_0xa01a94][_0xc2d6('0x4f')]!==_0xc2d6('0xad')){_0x3f6683[_0xc2d6('0xae')](_0x3f6683[_0xc2d6('0x1f')][_0x1068da[_0xa01a94][_0xc2d6('0xaf')]]);logger[_0xc2d6('0x99')](_0xc2d6('0xb0'),_0x26a365,_0xa01a94,_0x1068da[_0xa01a94][_0xc2d6('0xaf')]);delete _0x1068da[_0xa01a94];}if(_0x1068da[_0xa01a94]&&_0x1068da[_0xa01a94][_0xc2d6('0x4f')]===_0xc2d6('0xad')){_0x3f6683[_0xc2d6('0xae')](_0x3f6683['campaigns'][_0x1068da[_0xa01a94][_0xc2d6('0xaf')]]);logger[_0xc2d6('0x99')](_0xc2d6('0xb1'),_0x26a365,_0xa01a94,_0x1068da[_0xa01a94][_0xc2d6('0xaf')]);delete _0x1068da[_0xa01a94];}},0x2328);}});}});}}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xb2')]=function(_0x2f1a07){return BPromise[_0xc2d6('0xb3')]()['then'](cmHopper[_0xc2d6('0xb2')](_0x2f1a07))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xb4')));};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xb5')]=function(_0x2480d1){return BPromise[_0xc2d6('0xb3')]()[_0xc2d6('0xb6')](cmHopperBlack[_0xc2d6('0xb5')](_0x2480d1))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xb7')));};Dialer['prototype'][_0xc2d6('0xb8')]=function(_0xdbda69){return BPromise[_0xc2d6('0xb3')]()['then'](cmHopperBlack[_0xc2d6('0xb8')](_0xdbda69))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xb9')));};Dialer['prototype'][_0xc2d6('0xba')]=function(_0x565056){return BPromise['resolve']()[_0xc2d6('0xb6')](cmHopperHistory[_0xc2d6('0xbb')](_0x565056))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xbc')));};Dialer['prototype'][_0xc2d6('0xbd')]=function(_0x26831d){return BPromise[_0xc2d6('0xb3')]()[_0xc2d6('0xb6')](cmHopper[_0xc2d6('0xbd')](_0x26831d))['catch'](loggerCatch(_0xc2d6('0xbe')));};Dialer[_0xc2d6('0x1a')]['unlockContact']=function(_0x329697,_0x8f7a11,_0x5416b8){return BPromise[_0xc2d6('0xb3')]()[_0xc2d6('0xb6')](cmHopper['unlockContact'](_0x329697,_0x8f7a11,_0x5416b8))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xbf')));};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xc0')]=function(_0x4e0b4b,_0x5ef315,_0x39da2b,_0x1bba37,_0x401999){return BPromise['resolve']()[_0xc2d6('0xb6')](cmHopper['getContactDialer'](_0x4e0b4b,_0x5ef315,_0x39da2b,_0x1bba37))[_0xc2d6('0xac')](function(_0x1348ab){_0x401999[_0xc2d6('0xc1')]-=_0x39da2b;_0x401999['temp']=_0x401999['temp']>0x0?_0x401999[_0xc2d6('0xc1')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x1348ab);});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xc2')]=function(_0x4dc34c,_0x415eeb,_0x4ba74b,_0x6fd4b3){return BPromise[_0xc2d6('0xb3')]()['then'](cmHopper[_0xc2d6('0xc2')](_0x4dc34c,_0x415eeb,_0x4ba74b))[_0xc2d6('0xac')](function(_0x38cf66){_0x6fd4b3[_0xc2d6('0xc1')]-=_0x415eeb;_0x6fd4b3[_0xc2d6('0xc1')]=_0x6fd4b3[_0xc2d6('0xc1')]>0x0?_0x6fd4b3[_0xc2d6('0xc1')]:0x0;loggerCatch(_0xc2d6('0xc3'))(_0x38cf66);});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xc4')]=function(_0x2a851e){return BPromise['resolve']()['then'](voiceQueueRt[_0xc2d6('0xc4')](_0x2a851e))['catch'](loggerCatch(_0xc2d6('0xc5')));};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xc6')]=function(_0x24046b){return BPromise[_0xc2d6('0xb3')]()[_0xc2d6('0xb6')](cmHopper[_0xc2d6('0xc6')](_0x24046b))['catch'](loggerCatch(_0xc2d6('0xc7')));};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xc8')]=function(_0x4338d2){return BPromise[_0xc2d6('0xb3')]()['then'](cmHopperHistory['createHistory'](_0x4338d2))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xc9')));};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xae')]=function(_0x5bc729){if(!_['isUndefined'](_0x5bc729)&&_0x5bc729!==null){if(typeof _0x5bc729[_0xc2d6('0x73')]!==_0xc2d6('0xca')){if(_0x5bc729[_0xc2d6('0x73')]>0x0){_0x5bc729['originated']-=0x1;}else{logger['error'](_0xc2d6('0xcb'));}}}else{logger[_0xc2d6('0x99')](_0xc2d6('0xcc'));}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xcd')]=function(_0x59508f,_0x21b883){var _0x23e43b=this;return function(_0x4bd3c9){_0x23e43b[_0xc2d6('0xae')](_0x21b883);logger[_0xc2d6('0x99')](_0x59508f,util[_0xc2d6('0x98')](_0x4bd3c9,{'showHidden':![],'depth':null}));};};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xce')]=function(_0x393ab7,_0xbfb062,_0x2bbbec){var _0x305d0d={'state':0x19,'statedesc':_0xc2d6('0xcf')};this['updateOriginated'](_0xbfb062);this['saveInDb'](_[_0xc2d6('0xd0')](_0x305d0d,_['pick'](_0x2bbbec,[_0xc2d6('0xd1'),'ListId','UserId','VoiceQueueId',_0xc2d6('0xd2')])),_0xc2d6('0xd3'),_0xc2d6('0xd4'));logger[_0xc2d6('0x99')](_0x393ab7);};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xd5')]=function(_0x5f38b5){return _0x5f38b5===_0xc2d6('0xd6');};Dialer['prototype'][_0xc2d6('0xd7')]=function(_0x4cd2d9){return!_['isUndefined'](_0x4cd2d9)&&_0x4cd2d9&&!_['isUndefined'](_0x4cd2d9['name'])&&!_[_0xc2d6('0x40')](_0x4cd2d9['active'])&&_0x4cd2d9[_0xc2d6('0x78')]&&(this[_0xc2d6('0x22')][util[_0xc2d6('0x7b')](_0xc2d6('0xd8'),_0x4cd2d9[_0xc2d6('0x42')])][_0xc2d6('0xab')]===_0xc2d6('0xd9')||this[_0xc2d6('0x22')][util['format'](_0xc2d6('0xd8'),_0x4cd2d9['name'])][_0xc2d6('0xab')]==='unmonitored');};Dialer[_0xc2d6('0x1a')]['saveInDb']=function(_0xee1073,_0x3df44d,_0x206545){this[_0xc2d6('0xc8')](_0xee1073)[_0xc2d6('0xac')](loggerCatch(_0x3df44d));this[_0xc2d6('0xc6')](_0xee1073)['catch'](loggerCatch(_0x206545));};Dialer['prototype']['syncVarSet']=function(_0x51badc){var _0x1fb507=this[_0xc2d6('0x26')][_0x51badc['uniqueid']];var _0x4ee287;if(!_[_0xc2d6('0xa9')](_0x51badc)&&!_[_0xc2d6('0xa9')](_0x51badc['variable'])&&!_[_0xc2d6('0xa9')](_0x51badc[_0xc2d6('0xda')][_0xc2d6('0xdb')])&&_0x51badc['exten']==='xcally-motion-dialer'&&_0x1fb507){if(_0x1fb507[_0xc2d6('0x4f')]!==_0xc2d6('0xad')&&this[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0xdc')]&&_0x51badc[_0xc2d6('0xdd')]===_0xc2d6('0xde')){delete this[_0xc2d6('0x26')][_0x51badc[_0xc2d6('0xdf')]];this[_0xc2d6('0xae')](this[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]]);this['voiceQueues'][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0xe0')]+=0x1;this[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0x61')]+=0x1;_0x4ee287=new Hangup(_0x1fb507,_0x51badc);_0x4ee287[_0xc2d6('0xa4')]=0x12;_0x4ee287[_0xc2d6('0xe1')]=_0xc2d6('0xe2');_0x4ee287[_0xc2d6('0xe3')]=_0xc2d6('0xe4');ami[_0xc2d6('0x4e')](_0xc2d6('0xe5'),ut[_0xc2d6('0xe6')](_0x4ee287,_0xc2d6('0xe7')));this[_0xc2d6('0xe8')](_0x4ee287,_0xc2d6('0xe9'),_0xc2d6('0xea'));}if(_0x1fb507['type']!=='ivr'&&this[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0xdc')]&&_0x51badc[_0xc2d6('0xdd')]===_0xc2d6('0xeb')){var _0x5aa187=this;return new BPromise(function(_0x19821b,_0x136334){delete _0x5aa187[_0xc2d6('0x26')][_0x51badc[_0xc2d6('0xdf')]];_0x5aa187[_0xc2d6('0xae')](_0x5aa187['voiceQueues'][_0x1fb507[_0xc2d6('0xaf')]]);_0x5aa187[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]]['outboundAnswerCallsDay']+=0x1;_0x5aa187[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0x61')]+=0x1;var _0x520d66=_0x5aa187[_0xc2d6('0x1f')][_0x1fb507[_0xc2d6('0xaf')]];var _0x1f998d=new Hangup(_0x1fb507,_0x51badc);_0x1f998d['state']=0x13;_0x1f998d['statedesc']=_0xc2d6('0xec');_0x1f998d[_0xc2d6('0xe3')]='AMD';_0x1f998d[_0xc2d6('0xed')]+=0x1;_0x1f998d['countglobal']+=0x1;_0x1f998d[_0xc2d6('0xe7')]=!![];ami[_0xc2d6('0x4e')](_0xc2d6('0xe5'),ut[_0xc2d6('0xe6')](_0x1f998d,_0xc2d6('0xe7')));_0x5aa187[_0xc2d6('0xc8')](_0x1f998d)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1f998d['countbusyretry']+_0x1f998d[_0xc2d6('0xee')]+_0x1f998d[_0xc2d6('0xef')]+_0x1f998d['countnosuchnumberretry']+_0x1f998d[_0xc2d6('0xf0')]+_0x1f998d['countabandonedretry']+_0x1f998d[_0xc2d6('0xed')]+_0x1f998d[_0xc2d6('0xf1')]>=_0x520d66[_0xc2d6('0xf2')]){_0x5aa187['stateGlobal'](_0x1f998d,_0x19821b,_0x136334,_0xc2d6('0xf3'));}else{if(_0x1f998d[_0xc2d6('0xed')]>=_0x520d66[_0xc2d6('0xf4')]){_0x5aa187[_0xc2d6('0xf5')](_0x1f998d,_0x19821b,_0x136334,_0xc2d6('0xf6'));}else{_0x5aa187['rescheduleContact']({'active':![],'countmachineretry':_0x1f998d[_0xc2d6('0xed')],'scheduledat':moment()[_0xc2d6('0xf7')](_0x520d66[_0xc2d6('0xf8')],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x1f998d[_0xc2d6('0xd1')],'ListId':_0x1f998d[_0xc2d6('0xfb')],'VoiceQueueId':_0x1f998d[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x1f998d[_0xc2d6('0xd2')]||undefined})['catch'](loggerCatch(_0xc2d6('0xfd')));_0x19821b({'reschedule':0x1});}}});}if(_0x1fb507[_0xc2d6('0x4f')]==='ivr'&&this[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0xdc')]&&_0x51badc[_0xc2d6('0xdd')]==='HANGUP'){delete this[_0xc2d6('0x26')][_0x51badc[_0xc2d6('0xdf')]];this[_0xc2d6('0xae')](this[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]]);_0x4ee287=new Hangup(_0x1fb507,_0x51badc);_0x4ee287[_0xc2d6('0xa4')]=0x12;_0x4ee287[_0xc2d6('0xe1')]=_0xc2d6('0xe2');_0x4ee287[_0xc2d6('0xe3')]='AMD';ami['emit'](_0xc2d6('0xe5'),ut[_0xc2d6('0xe6')](_0x4ee287,_0xc2d6('0xe7')));this[_0xc2d6('0xe8')](_0x4ee287,_0xc2d6('0xfe'),_0xc2d6('0xff'));}if(_0x1fb507['type']===_0xc2d6('0xad')&&this[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]]['dialAMDActive']&&_0x51badc[_0xc2d6('0xdd')]===_0xc2d6('0xeb')){var _0x5aa187=this;return new BPromise(function(_0x12fba1,_0x4d5583){delete _0x5aa187['uniqueId'][_0x51badc[_0xc2d6('0xdf')]];_0x5aa187[_0xc2d6('0xae')](_0x5aa187[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]]);_0x5aa187[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0xe0')]+=0x1;_0x5aa187[_0xc2d6('0x20')][_0x1fb507[_0xc2d6('0xaf')]][_0xc2d6('0x61')]+=0x1;var _0x44c210=_0x5aa187['campaigns'][_0x1fb507[_0xc2d6('0xaf')]];var _0x166d0d=new Hangup(_0x1fb507,_0x51badc);_0x166d0d[_0xc2d6('0xa4')]=0x13;_0x166d0d[_0xc2d6('0xe1')]=_0xc2d6('0xec');_0x166d0d[_0xc2d6('0xe3')]=_0xc2d6('0xe4');_0x166d0d[_0xc2d6('0xed')]+=0x1;_0x166d0d['countglobal']+=0x1;_0x166d0d[_0xc2d6('0xe7')]=!![];ami[_0xc2d6('0x4e')](_0xc2d6('0xe5'),ut[_0xc2d6('0xe6')](_0x166d0d,_0xc2d6('0xe7')));_0x5aa187[_0xc2d6('0xc8')](_0x166d0d)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x100')));if(_0x166d0d[_0xc2d6('0x101')]+_0x166d0d[_0xc2d6('0xee')]+_0x166d0d[_0xc2d6('0xef')]+_0x166d0d[_0xc2d6('0x102')]+_0x166d0d['countdropretry']+_0x166d0d[_0xc2d6('0x103')]+_0x166d0d[_0xc2d6('0xed')]+_0x166d0d['countagentrejectretry']>=_0x44c210[_0xc2d6('0xf2')]){_0x5aa187[_0xc2d6('0x104')](_0x166d0d,_0x12fba1,_0x4d5583,_0xc2d6('0xf3'));}else{if(_0x166d0d[_0xc2d6('0xed')]>=_0x44c210[_0xc2d6('0xf4')]){_0x5aa187['createStateFinal'](_0x166d0d,_0x12fba1,_0x4d5583,_0xc2d6('0xf6'));}else{_0x5aa187[_0xc2d6('0xbd')]({'active':![],'countmachineretry':_0x166d0d['countmachineretry'],'scheduledat':moment()[_0xc2d6('0xf7')](_0x44c210['dialMachineRetryFrequency'],_0xc2d6('0xf9'))['format'](_0xc2d6('0xfa')),'ContactId':_0x166d0d[_0xc2d6('0xd1')],'ListId':_0x166d0d[_0xc2d6('0xfb')],'VoiceQueueId':_0x166d0d[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x166d0d[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xfd')));_0x12fba1({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xc2d6('0x35')]=function(_0x19fe8c){var _0x5344e5=this[_0xc2d6('0x26')][_0x19fe8c['uniqueid']];var _0x53408e=this;var _0x370d59;if(_0x5344e5&&_0x5344e5[_0xc2d6('0x4f')]==='ivr'){delete this[_0xc2d6('0x26')][_0x19fe8c[_0xc2d6('0xdf')]];this['updateOriginated'](this[_0xc2d6('0x20')][_0x5344e5[_0xc2d6('0xaf')]]);this[_0xc2d6('0x20')][_0x5344e5['queue']][_0xc2d6('0x105')]+=0x1;_0x370d59=new Hangup(_0x5344e5,_0x19fe8c);this[_0xc2d6('0xc8')](_0x370d59)[_0xc2d6('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc2d6('0xc6')](_0x370d59)[_0xc2d6('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x5344e5&&_0x5344e5['type']!==_0xc2d6('0xad')&&isNotNull(this[_0xc2d6('0x1f')][_0x5344e5[_0xc2d6('0xaf')]][_0xc2d6('0x106')])){delete this['uniqueId'][_0x19fe8c[_0xc2d6('0xdf')]];this[_0xc2d6('0xae')](this['voiceQueues'][_0x5344e5['queue']]);this['voiceQueues'][_0x5344e5[_0xc2d6('0xaf')]][_0xc2d6('0xe0')]+=0x1;this['voiceQueues'][_0x5344e5[_0xc2d6('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x370d59=new Hangup(_0x5344e5,_0x19fe8c);_0x370d59[_0xc2d6('0xa4')]=0x10;_0x370d59[_0xc2d6('0xe1')]='AnswerAGI';_0x370d59[_0xc2d6('0xe3')]=_0xc2d6('0x107');this['createHistory'](_0x370d59)['catch'](loggerCatch(_0xc2d6('0x108')));this[_0xc2d6('0xc6')](_0x370d59)['catch'](loggerCatch(_0xc2d6('0x109')));}if(_0x5344e5&&_0x5344e5[_0xc2d6('0x4f')]!==_0xc2d6('0xad')&&!isNotNull(this[_0xc2d6('0x1f')][_0x5344e5['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x19fe8c[_0xc2d6('0xdf')]];this[_0xc2d6('0xae')](this[_0xc2d6('0x1f')][_0x5344e5[_0xc2d6('0xaf')]]);this[_0xc2d6('0x1f')][_0x5344e5[_0xc2d6('0xaf')]][_0xc2d6('0x6a')]+=0x1;_0x370d59=new Hangup(_0x5344e5,_0x19fe8c);_0x370d59[_0xc2d6('0xa4')]=0xc;_0x370d59[_0xc2d6('0xe1')]=_0x19fe8c[_0xc2d6('0x10a')];_0x370d59[_0xc2d6('0xe3')]=_0xc2d6('0x10b');this[_0xc2d6('0xc8')](_0x370d59)[_0xc2d6('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc2d6('0xc6')](_0x370d59)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x109')));}};Dialer['prototype']['syncAgentComplete']=function(_0x364b8c){var _0x265e3c=this[_0xc2d6('0x26')][_0x364b8c['uniqueid']];var _0x6cd3a5=this;if(this[_0xc2d6('0x1f')][_0x364b8c[_0xc2d6('0xaf')]]){if(_0x265e3c&&_0x265e3c[_0xc2d6('0x4f')]!=='ivr'){delete this[_0xc2d6('0x26')][_0x364b8c[_0xc2d6('0xdf')]];this[_0xc2d6('0x1f')][_0x364b8c[_0xc2d6('0xaf')]][_0xc2d6('0xe0')]+=0x1;var _0x10d57f=new AgentComplete(_0x265e3c,_0x364b8c);if(_0x364b8c[_0xc2d6('0x10c')]===_0xc2d6('0x10d')){_0x10d57f[_0xc2d6('0x10e')]=this['voiceQueues'][_0x364b8c[_0xc2d6('0xaf')]][_0xc2d6('0x10f')]&&this[_0xc2d6('0x1f')][_0x364b8c[_0xc2d6('0xaf')]][_0xc2d6('0x110')]?moment()['format'](_0xc2d6('0xfa')):undefined;}this[_0xc2d6('0xc8')](_0x10d57f)['catch'](loggerCatch(_0xc2d6('0x111')));this[_0xc2d6('0xc6')](_0x10d57f)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x112')));}}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x2d')]=function(_0x2d2767){if(this[_0xc2d6('0x1f')][_0x2d2767[_0xc2d6('0xaf')]]){if(this[_0xc2d6('0x26')][_0x2d2767['uniqueid']]&&this[_0xc2d6('0x26')][_0x2d2767[_0xc2d6('0xdf')]][_0xc2d6('0x4f')]!=='ivr'){this[_0xc2d6('0xae')](this['voiceQueues'][_0x2d2767[_0xc2d6('0xaf')]]);this[_0xc2d6('0x26')][_0x2d2767[_0xc2d6('0xdf')]][_0xc2d6('0x113')]=moment()['format'](_0xc2d6('0xfa'));}}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x114')]=function(_0x16e707){this[_0xc2d6('0xc8')](_0x16e707)['catch'](loggerCatch(_0xc2d6('0x111')));this[_0xc2d6('0xc6')](_0x16e707)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x115')));};Dialer['prototype'][_0xc2d6('0x30')]=function(_0xbf8449){var _0x3f5bce=this[_0xc2d6('0x26')][_0xbf8449[_0xc2d6('0xdf')]];var _0x486e06=this;if(this['voiceQueues'][_0xbf8449[_0xc2d6('0xaf')]]){if(_0x3f5bce&&_0x3f5bce[_0xc2d6('0x4f')]!==_0xc2d6('0xad')){delete this['uniqueId'][_0xbf8449[_0xc2d6('0xdf')]];this[_0xc2d6('0xae')](this[_0xc2d6('0x1f')][_0xbf8449['queue']]);_0x3f5bce[_0xc2d6('0x116')]=moment()[_0xc2d6('0x7b')](_0xc2d6('0xfa'));var _0x1607bd=new QueueCallerAbandon(_0x3f5bce,_0xbf8449);if(getSeconds(_0x3f5bce['droptime'],_0x3f5bce[_0xc2d6('0x117')])>=_0x3f5bce[_0xc2d6('0x118')]){this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x65')]+=0x1;this['voiceQueues'][_0xbf8449[_0xc2d6('0xaf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1607bd[_0xc2d6('0xa4')]=0xa;_0x1607bd['statedesc']=_0xc2d6('0x119');_0x1607bd['dropreason']='TIMEOUT';_0x1607bd[_0xc2d6('0x10e')]=this['voiceQueues'][_0xbf8449['queue']][_0xc2d6('0x10f')]?moment()[_0xc2d6('0x7b')](_0xc2d6('0xfa')):undefined;_0x1607bd[_0xc2d6('0xf0')]+=0x1;_0x1607bd[_0xc2d6('0x11a')]+=0x1;if(_0x1607bd[_0xc2d6('0xf0')]>=this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x11b')]){this[_0xc2d6('0x114')](_0x1607bd);}else{this[_0xc2d6('0xbd')]({'active':![],'countdropretry':_0x1607bd['countdropretry'],'scheduledat':moment()[_0xc2d6('0xf7')](this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x11c')],_0xc2d6('0xf9'))['format'](_0xc2d6('0xfa')),'ContactId':_0x3f5bce[_0xc2d6('0xd1')],'ListId':_0x3f5bce[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f5bce[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f5bce[_0xc2d6('0xd2')]||undefined})['catch'](loggerCatch(_0xc2d6('0x11d')));var _0x5620e9=new History(_0x1607bd);_0x5620e9[_0xc2d6('0xa4')]=0xa;_0x5620e9[_0xc2d6('0xe1')]=_0xc2d6('0x119');_0x5620e9[_0xc2d6('0xa6')]=moment()[_0xc2d6('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5620e9[_0xc2d6('0xa5')]=_0x5620e9[_0xc2d6('0xa6')];_0x5620e9[_0xc2d6('0x11e')]=_0x1607bd[_0xc2d6('0x11e')];_0x5620e9[_0xc2d6('0x11f')]=_0x1607bd[_0xc2d6('0x11f')];this[_0xc2d6('0xc8')](_0x5620e9)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x120')));}}else{this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x64')]+=0x1;_0x1607bd[_0xc2d6('0xa4')]=0xb;_0x1607bd['statedesc']='Abandoned';_0x1607bd[_0xc2d6('0x121')]=_0xc2d6('0x122');_0x1607bd[_0xc2d6('0x103')]+=0x1;_0x1607bd[_0xc2d6('0x11a')]+=0x1;if(_0x1607bd[_0xc2d6('0x103')]>=this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x123')]){this[_0xc2d6('0x114')](_0x1607bd);}else{this[_0xc2d6('0xbd')]({'active':![],'countabandonedretry':_0x1607bd[_0xc2d6('0x103')],'scheduledat':moment()['add'](this[_0xc2d6('0x1f')][_0xbf8449[_0xc2d6('0xaf')]][_0xc2d6('0x124')],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f5bce[_0xc2d6('0xd1')],'ListId':_0x3f5bce['ListId'],'VoiceQueueId':_0x3f5bce[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f5bce[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x125')));var _0x5620e9=new History(_0x1607bd);_0x5620e9[_0xc2d6('0xa4')]=0xb;_0x5620e9[_0xc2d6('0xe1')]=_0xc2d6('0x126');_0x5620e9[_0xc2d6('0xa6')]=moment()[_0xc2d6('0x7b')](_0xc2d6('0xfa'));_0x5620e9[_0xc2d6('0xa5')]=_0x5620e9['starttime'];_0x5620e9['calleridname']=_0x1607bd[_0xc2d6('0x11e')];_0x5620e9[_0xc2d6('0x11f')]=_0x1607bd[_0xc2d6('0x11f')];this['createHistory'](_0x5620e9)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x127')));}}}}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x37')]=function(_0xc7ab0){if(this['actions'][_0xc7ab0[_0xc2d6('0xdf')]]){this['actions'][_0xc7ab0[_0xc2d6('0xdf')]][_0xc2d6('0x128')]=_0xc7ab0['channel'];}if(this[_0xc2d6('0x26')][_0xc7ab0['uniqueid']]){this['uniqueId'][_0xc7ab0[_0xc2d6('0xdf')]][_0xc2d6('0x128')]=_0xc7ab0[_0xc2d6('0x128')];}};Dialer['prototype'][_0xc2d6('0x3b')]=function(_0x37e44e){if(strategy[this['voiceQueues'][this['actions'][_0x37e44e['actionid']][_0xc2d6('0xaf')]][_0xc2d6('0x51')]]===_0xc2d6('0x19')){if(this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]]&&_['isNil'](this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]][_0xc2d6('0x12a')])&&_0x37e44e[_0xc2d6('0xab')]==='1'&&_0x37e44e[_0xc2d6('0x12b')]==='0'){if(this['agents'][_0x37e44e[_0xc2d6('0x12c')]]){if(!this[_0xc2d6('0x21')][_0x37e44e[_0xc2d6('0x12c')]][_0xc2d6('0x12a')]){this['agents'][_0x37e44e['stateinterface']]['locked']=!![];this[_0xc2d6('0x24')][_0x37e44e['actionid']]['locked']=!![];this[_0xc2d6('0x24')][_0x37e44e['actionid']]['stateinterface']=_0x37e44e[_0xc2d6('0x12c')];}}}}else if((strategy[this[_0xc2d6('0x1f')][this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]]['queue']][_0xc2d6('0x51')]]||_0xc2d6('0x18'))===_0xc2d6('0x18')){if(this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]]){if(this[_0xc2d6('0x21')][_0x37e44e[_0xc2d6('0x12c')]]){this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]][_0xc2d6('0x12c')]=_0x37e44e[_0xc2d6('0x12c')];if(_[_0xc2d6('0xa9')](this['queueBooked'][this['actions'][_0x37e44e[_0xc2d6('0x129')]][_0xc2d6('0xaf')]])){this['queueBooked'][this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]][_0xc2d6('0xaf')]]=[];}this[_0xc2d6('0x2a')][this[_0xc2d6('0x24')][_0x37e44e[_0xc2d6('0x129')]][_0xc2d6('0xaf')]][_0xc2d6('0x12d')](_[_0xc2d6('0xd0')](_['pick'](this[_0xc2d6('0x24')][_0x37e44e['actionid']],['idHopper',_0xc2d6('0x12c')]),{'status':_0x37e44e[_0xc2d6('0xab')],'paused':_0x37e44e[_0xc2d6('0x12b')]}));}}}};function unlockQueueStatus(_0x48ee74,_0x29d9ab){setTimeout(function(){if(_[_0xc2d6('0x40')](_0x48ee74[_0xc2d6('0x12e')])){loggerBooked[_0xc2d6('0x99')](_0xc2d6('0x12f'),_0x29d9ab);}_0x48ee74['queueStatusComplete']=!![];loggerBooked[_0xc2d6('0x7f')](_0xc2d6('0x130'),_0x29d9ab,JSON[_0xc2d6('0x4b')](_[_0xc2d6('0x131')](_0x48ee74,[_0xc2d6('0x42'),_0xc2d6('0x12e')])));},0x1f3);}Dialer[_0xc2d6('0x1a')]['syncQueueStatusComplete']=function(_0x2e7da5){var _0x526973=this;var _0x557f6b=_0x526973['voiceQueues'][_0x526973['actions'][_0x2e7da5[_0xc2d6('0x129')]]['queue']];if(strategy[this[_0xc2d6('0x1f')][this['actions'][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xaf')]]['strategy']]==='roundrobin'){if(this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]]&&this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]]['stateinterface']){this[_0xc2d6('0x1e')][_0xc2d6('0x132')](this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0x133')],this['actions'][_0x2e7da5[_0xc2d6('0x129')]]['stateinterface'])[_0xc2d6('0xac')](function(_0x10c81d){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xc2d6('0x98')](_0x10c81d,{'showHidden':![],'depth':null}));})[_0xc2d6('0x134')](function(){_0x526973['updateOriginated'](_0x526973['voiceQueues'][_0x526973['actions'][_0x2e7da5['actionid']]['queue']]);_0x526973[_0xc2d6('0x21')][_0x526973[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]]['stateinterface']][_0xc2d6('0x12a')]=![];delete _0x526973[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]];unlockQueueStatus(_0x557f6b);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xc2d6('0x24')][_0x2e7da5['actionid']][_0xc2d6('0xaf')]]);this[_0xc2d6('0xbd')]({'active':![],'ContactId':this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xd1')],'ListId':this['actions'][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xfb')],'VoiceQueueId':this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xfc')]||undefined,'CampaignId':this['actions'][_0x2e7da5[_0xc2d6('0x129')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]];unlockQueueStatus(_0x557f6b);}}else if((strategy[this[_0xc2d6('0x1f')][this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xaf')]][_0xc2d6('0x51')]]||_0xc2d6('0x18'))==='rrmemory'){var _0x247a0b;if(this['actions'][_0x2e7da5[_0xc2d6('0x129')]]&&!_[_0xc2d6('0x49')](this[_0xc2d6('0x2a')][this['actions'][_0x2e7da5[_0xc2d6('0x129')]]['queue']])){if(this['queueBookedRR'][_0x526973['actions'][_0x2e7da5[_0xc2d6('0x129')]]['queue']]){this[_0xc2d6('0x2b')][_0x526973[_0xc2d6('0x24')][_0x2e7da5['actionid']][_0xc2d6('0xaf')]]=this[_0xc2d6('0x2b')][this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]]['queue']]?this[_0xc2d6('0x2b')][this['actions'][_0x2e7da5['actionid']][_0xc2d6('0xaf')]]:this['queueBooked'][this[_0xc2d6('0x24')][_0x2e7da5['actionid']][_0xc2d6('0xaf')]]?this[_0xc2d6('0x2a')][this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xaf')]][_0xc2d6('0x135')]||0x0:0x0;}this[_0xc2d6('0x2a')][this['actions'][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xaf')]][_0xc2d6('0x135')]=this['queueBookedRR'][this[_0xc2d6('0x24')][_0x2e7da5[_0xc2d6('0x129')]][_0xc2d6('0xaf')]];for(var _0x4d5474=0x0;_0x4d5474=0x0;})['catch'](myreject(_0x7b1c37)));}}else{_0x5551b8[_0xc2d6('0x12d')](ami[_0xc2d6('0xaa')]({'action':_0xc2d6('0x14f'),'command':util[_0xc2d6('0x7b')]('iftime\x20%s,%s',_0x560372,!_[_0xc2d6('0x40')](config['timezones'][_0x1006be])?_0x1006be:'')})['then'](function(_0xbda854){return _0xbda854[_0xc2d6('0x151')]['indexOf'](_0xc2d6('0x153'))>=0x0;})[_0xc2d6('0xac')](myreject(_0x7b1c37)));}BPromise[_0xc2d6('0x154')](_0x5551b8)[_0xc2d6('0xb6')](function(_0x33805e){var _0x501301=_[_0xc2d6('0x155')](_0x33805e);if(_0x501301){return _0x2f1ff3(_0x501301);}else{_0x28a781['message']=_0x3c2b9c?_0xc2d6('0x156'):_0xc2d6('0x157');return _0x7b1c37(msgResponse(_0xc2d6('0x158'),_0xc2d6('0x147'),_0xc2d6('0x159')+_0x3c2b9c+'\x20'+_0x756d7d+_0xc2d6('0x15a')+util['inspect'](_0x560372,{'showHidden':![],'depth':null})+_0xc2d6('0x15b')+_0x1006be));}})[_0xc2d6('0xac')](function(_0x441055){return _0x7b1c37(msgResponse(_0xc2d6('0x146'),_0xc2d6('0x147'),JSON['stringify'](_0x441055)));});});};Dialer['prototype']['checkDialMethod']=function(_0x532313){var _0x332d1d=this;return function(){switch(_0x532313[_0xc2d6('0x5d')]){case _0xc2d6('0x15c'):freeVariablesPredictive(_0x532313);_0x332d1d[_0xc2d6('0x15d')](_0x532313,0x1);break;case _0xc2d6('0x15e'):freeVariablesPredictive(_0x532313);_0x332d1d[_0xc2d6('0x15d')](_0x532313,_0x532313['dialPowerLevel']);break;case _0xc2d6('0x6'):_0x332d1d[_0xc2d6('0x6')](_0x532313);break;case _0xc2d6('0x5'):freeVariablesPredictive(_0x532313);_0x332d1d['handlePower'](_0x532313,0x1);break;default:freeVariablesPredictive(_0x532313);logger[_0xc2d6('0x99')](_0xc2d6('0x15f'),_0x532313[_0xc2d6('0x42')],_0xc2d6('0x160'));}};};Dialer[_0xc2d6('0x1a')]['launchHandleIvr']=function(_0x321e2a){var _0x4b6f7a=this;return function(){_0x4b6f7a[_0xc2d6('0x161')](_0x321e2a);};};Dialer[_0xc2d6('0x1a')]['syncQueueSummary']=function(_0x555bda){var _0x2184e9=this;if(isNotPreview(_0x555bda['dialMethod'])){if(isVoiceQueueOutbound(_0x555bda['type'])&&isActive(_0x555bda[_0xc2d6('0x162')])){_0x555bda['sendMessageOneNotActive']=!![];BPromise[_0xc2d6('0xb3')]()['then'](checkIsLoggedIn(_0x555bda,_0x555bda[_0xc2d6('0x54')]))[_0xc2d6('0xb6')](checkIsActive(_0x555bda,_0x555bda[_0xc2d6('0x162')]))['then'](checkInterval(_0x555bda))[_0xc2d6('0xb6')](_0x2184e9[_0xc2d6('0x141')](_0x555bda))[_0xc2d6('0xb6')](_0x2184e9[_0xc2d6('0x145')](_0x555bda[_0xc2d6('0x163')],_0x555bda[_0xc2d6('0x164')],_0x555bda['name'],_0x555bda))[_0xc2d6('0xb6')](_0x2184e9[_0xc2d6('0x165')](_0x555bda[_0xc2d6('0x7a')],_0x555bda['dialTimezone'],_0x555bda[_0xc2d6('0x42')],_0x555bda))[_0xc2d6('0xb6')](_0x2184e9[_0xc2d6('0x166')](_0x555bda))[_0xc2d6('0xac')](loggerCatchQueueSummary(_0xc2d6('0x167'),_0x555bda));}else{notSendMessagesQueue(_0x555bda);}}else{freeVariablesPredictive(_0x555bda);}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x168')]=function(){var _0x7942e2=this;var _0x46e94c;for(var _0xf11f76 in this[_0xc2d6('0x20')]){if(typeof this[_0xc2d6('0x20')][_0xf11f76]!==_0xc2d6('0xca')){_0x46e94c=this[_0xc2d6('0x20')][_0xf11f76];if(isCampaignIvr(_0x46e94c[_0xc2d6('0x4f')])&&isActive(_0x46e94c[_0xc2d6('0x78')])){_0x46e94c['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xc2d6('0xb6')](checkIsActive(_0x46e94c,_0x46e94c[_0xc2d6('0x78')]))[_0xc2d6('0xb6')](checkInterval(_0x46e94c))['then'](_0x7942e2[_0xc2d6('0x141')](_0x46e94c))[_0xc2d6('0xb6')](_0x7942e2[_0xc2d6('0x145')](_0x46e94c['dialGlobalInterval'],_0x46e94c[_0xc2d6('0x164')],_0x46e94c['name'],_0x46e94c))[_0xc2d6('0xb6')](_0x7942e2[_0xc2d6('0x165')](_0x46e94c[_0xc2d6('0x7a')],_0x46e94c['dialTimezone'],_0x46e94c['name'],_0x46e94c))[_0xc2d6('0xb6')](_0x7942e2[_0xc2d6('0x169')](_0x46e94c))['catch'](loggerCatchQueueSummary(_0xc2d6('0x16a'),_0x46e94c));}else{notSendMessagesCampaign(_0x46e94c);}}}};function getCallerIdRandom(_0xf094f5,_0x4f0ff5){var _0x36d284;var _0x1bc6b0;var _0x24665c;if(_0x4f0ff5<=0x0){_0x4f0ff5=0x1;}_0x36d284=new RegExp(_0xc2d6('0x16b')+_0x4f0ff5+'}$');_0x1bc6b0=Math[_0xc2d6('0x16c')](0xa,_0x4f0ff5-0x1);_0x24665c=Math[_0xc2d6('0x16c')](0xa,_0x4f0ff5)-0x1;return util['format']('%s',_[_0xc2d6('0x16d')](_0xf094f5,_0x36d284,_['random'](_0x1bc6b0,_0x24665c)));}function extractCalleridName(_0x1ba35a){var _0x2c6052=_0x1ba35a[_0xc2d6('0x16e')](/"(.*?)"/);return _0x2c6052?_0x2c6052[0x1]:_0x1ba35a;}function extractCalleridNumber(_0x6a596c){var _0x35f2b2=_0x6a596c[_0xc2d6('0x16e')](/<(.*?)>/);return _0x35f2b2?_0x35f2b2[0x1]:_0x6a596c;}Dialer[_0xc2d6('0x1a')][_0xc2d6('0x16f')]=function(_0xc736b,_0x210eb0){var _0x1c6315=this;var _0x17d1a2=uuid['v4']();this[_0xc2d6('0x24')][_0x17d1a2]=new Action(_0xc736b,_0x210eb0,_0x17d1a2);return new BPromise(function(_0x32eca9,_0x5afcfa){if(_[_0xc2d6('0x40')](_0xc736b)&&typeof _0xc736b!=='object'){return _0x5afcfa(msgResponse(_0xc2d6('0x170'),'Failure',_0xc2d6('0x171')));}if(_[_0xc2d6('0x40')](_0x210eb0[_0xc2d6('0x172')]['phone'])||_0x210eb0[_0xc2d6('0x172')]['phone']===null){return _0x5afcfa(msgResponse('originate',_0xc2d6('0x147'),_0xc2d6('0x173')));}var _0xfac516={'XMD-CALLERID':_0x1c6315[_0xc2d6('0x24')][_0x17d1a2][_0xc2d6('0x174')](),'XMD-AGI':_0xc736b[_0xc2d6('0x106')]?util[_0xc2d6('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0xc736b[_0xc2d6('0x106')]):'NONE','XMD-AGIAFTER':_0xc736b[_0xc2d6('0x10f')]?util[_0xc2d6('0x7b')](_0xc2d6('0x175'),ipAgi,_0xc736b[_0xc2d6('0x10f')]):_0xc2d6('0x176'),'XMD-QUEUE':_0xc736b[_0xc2d6('0x4f')]===_0xc2d6('0x50')?util[_0xc2d6('0x7b')]('\x22%s,%s%s,,,%s\x22',_0xc736b['name'],_0xc736b[_0xc2d6('0x177')]||'',_0xc736b[_0xc2d6('0x110')]?'c':'',_0xc736b[_0xc2d6('0x118')]||0x3):_0xc2d6('0x176'),'XMD-CONTACTID':_0x210eb0['ContactId'],'XMD-CDRTYPE':_0xc2d6('0x4'),'CALLERID(all)':_0x1c6315[_0xc2d6('0x24')][_0x17d1a2][_0xc2d6('0x174')](),'XMD-AMD':_0xc736b['dialAMDActive']?_0xc2d6('0x178'):_0xc2d6('0x176'),'XMD-DESTINATION':_0xc2d6('0x179')};if(_0xc736b['dialAMDActive']){_0xfac516[_0xc2d6('0x17a')]=_0xc736b[_0xc2d6('0x17b')]||0x9c4;_0xfac516[_0xc2d6('0x17c')]=_0xc736b['dialAMDGreeting']||0x5dc;_0xfac516[_0xc2d6('0x17d')]=_0xc736b[_0xc2d6('0x17e')]||0x320;_0xfac516['XMD-AMDTOTALANALYSISTIME']=_0xc736b[_0xc2d6('0x17f')]||0x1388;_0xfac516[_0xc2d6('0x180')]=_0xc736b['dialAMDMinWordLength']||0x64;_0xfac516['XMD-AMDBETWEENWORDSSILENCE']=_0xc736b[_0xc2d6('0x181')]||0x32;_0xfac516[_0xc2d6('0x182')]=_0xc736b['dialAMDMaximumNumberOfWords']||0x3;_0xfac516['XMD-AMDSILENCETHRESHOLD']=_0xc736b['dialAMDSilenceThreshold']||0x100;_0xfac516[_0xc2d6('0x183')]=_0xc736b['dialAMDMaximumWordLength']||0x1388;}if(_0xc736b['type']===_0xc2d6('0x50')){_0xfac516[_0xc2d6('0x184')]=_0x210eb0[_0xc2d6('0xfc')];}else{_0xfac516[_0xc2d6('0x185')]=_0x210eb0['CampaignId'];}for(var _0x66d603 in _0x210eb0[_0xc2d6('0x172')]){if(typeof _0x210eb0[_0xc2d6('0x172')][_0x66d603]!==_0xc2d6('0xca')){if(isNotNull(_0x210eb0[_0xc2d6('0x172')][_0x66d603])&&_0x66d603!=='id'&&_0x66d603!==_0xc2d6('0x186')&&_0x66d603!==_0xc2d6('0x187')&&_0x66d603!=='updatedAt'){_0xfac516[util[_0xc2d6('0x7b')]('%s%s','XMD-',_[_0xc2d6('0x188')](_0x66d603))]=_0x210eb0['Contact'][_0x66d603];}}}var _0x5f5bef=_0x1c6315[_0xc2d6('0xd7')](_0xc736b[_0xc2d6('0x77')])?getCallerId(_0xc736b[_0xc2d6('0x77')][_0xc2d6('0x79')],_0xc736b[_0xc2d6('0x5e')],_0xc736b[_0xc2d6('0x189')]>0x0?getCallerIdRandom(_0xc736b[_0xc2d6('0x5f')],_0xc736b[_0xc2d6('0x189')]):_0xc736b[_0xc2d6('0x5f')]):getCallerId(_[_0xc2d6('0xa9')](_0xc736b[_0xc2d6('0x142')])?_0xc736b['Trunk'][_0xc2d6('0x79')]:_0xc736b['TrunkBackup'][_0xc2d6('0x79')],_0xc736b[_0xc2d6('0x5e')],_0xc736b[_0xc2d6('0x189')]>0x0?getCallerIdRandom(_0xc736b[_0xc2d6('0x5f')],_0xc736b[_0xc2d6('0x189')]):_0xc736b[_0xc2d6('0x5f')]);if(_0x5f5bef){_0xfac516[_0xc2d6('0x18a')]=_0x1c6315[_0xc2d6('0x24')][_0x17d1a2][_0xc2d6('0x18b')]=extractCalleridName(_0x5f5bef);_0xfac516['XMD-ORIGINATECALLERIDNUM']=_0x1c6315['actions'][_0x17d1a2][_0xc2d6('0x18c')]=extractCalleridNumber(_0x5f5bef);}return ami[_0xc2d6('0xaa')]({'actionid':_0x17d1a2,'action':_0xc2d6('0x170'),'channel':_0x1c6315[_0xc2d6('0xd7')](_0xc736b[_0xc2d6('0x77')])?util['format'](_0xc2d6('0x18d'),_0xc736b[_0xc2d6('0x77')][_0xc2d6('0x42')],isNotNull(_0xc736b[_0xc2d6('0x18e')])?_0xc736b[_0xc2d6('0x18e')]['trim']()||'':'',_0xc736b[_0xc2d6('0x18f')]>0x0?_0x210eb0[_0xc2d6('0x172')][_0xc2d6('0x190')][_0xc2d6('0x191')](_0xc736b['dialCutDigit']):_0x210eb0['Contact'][_0xc2d6('0x190')]):util[_0xc2d6('0x7b')](_0xc2d6('0x18d'),_[_0xc2d6('0xa9')](_0xc736b[_0xc2d6('0x142')])?_0xc736b[_0xc2d6('0x77')][_0xc2d6('0x42')]:_0xc736b[_0xc2d6('0x142')][_0xc2d6('0x42')],isNotNull(_0xc736b[_0xc2d6('0x18e')])?_0xc736b[_0xc2d6('0x18e')][_0xc2d6('0x192')]()||'':'',_0xc736b['dialCutDigit']>0x0?_0x210eb0[_0xc2d6('0x172')][_0xc2d6('0x190')][_0xc2d6('0x191')](_0xc736b[_0xc2d6('0x18f')]):_0x210eb0[_0xc2d6('0x172')][_0xc2d6('0x190')]),'callerid':_0x5f5bef,'Exten':_0xc2d6('0x179'),'Context':_0xc2d6('0x193'),'Priority':'1','variable':_0xfac516,'timeout':(_0xc736b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x17d1a2})[_0xc2d6('0xb6')](function(_0x20890c){return _0x32eca9(_0x20890c);})['catch'](function(_0x4032db){_0xc736b[_0xc2d6('0x67')]+=0x1;var _0x210fd3=new History(_0x1c6315[_0xc2d6('0x24')][_0x17d1a2]);logger['error'](util[_0xc2d6('0x7b')](_0xc2d6('0x194'),JSON['stringify'](_0x4032db)));_0x210fd3[_0xc2d6('0xa4')]=0xe;_0x210fd3['statedesc']=_0xc2d6('0x195');_0x210fd3['starttime']=moment()[_0xc2d6('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x210fd3[_0xc2d6('0xa5')]=_0x210fd3['starttime'];_0x1c6315[_0xc2d6('0xc8')](_0x210fd3)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x196')));_0x1c6315[_0xc2d6('0xc6')](_0x210fd3)[_0xc2d6('0xac')](loggerCatch('[originate][error]'))[_0xc2d6('0x134')](function(){delete _0x1c6315[_0xc2d6('0x24')][_0x17d1a2];return _0x5afcfa(msgResponse(_0xc2d6('0x170'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x31')]=function(_0x57dcae){var _0x395daf=this['actions'][_0x57dcae[_0xc2d6('0x129')]];if(_0x395daf){delete this['actions'][_0x57dcae[_0xc2d6('0x129')]];_0x395daf[_0xc2d6('0x117')]=moment()['format'](_0xc2d6('0xfa'));var _0x32baa9=_0x395daf['type']===_0xc2d6('0xad')?this['campaigns'][_0x395daf[_0xc2d6('0xaf')]]:this[_0xc2d6('0x1f')][_0x395daf['getQueue']()];if(!this[_0xc2d6('0xd5')](_0x57dcae[_0xc2d6('0x197')])){this[_0xc2d6('0xae')](_0x32baa9);return this[_0xc2d6('0x198')](_0x395daf,_0x32baa9,_0x57dcae)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x199')));}this[_0xc2d6('0x26')][_0x57dcae['uniqueid']]=_0x395daf;}};Dialer[_0xc2d6('0x1a')]['checkRetriveMax']=function(_0x3d0fab,_0x4939fa,_0x25e70e){var _0x3f8d62=new History(_0x4939fa);if(_0x3f8d62[_0xc2d6('0x101')]+_0x3f8d62['countcongestionretry']+_0x3f8d62[_0xc2d6('0xef')]+_0x3f8d62[_0xc2d6('0x102')]+_0x3f8d62[_0xc2d6('0xf0')]+_0x3f8d62['countabandonedretry']+_0x3f8d62['countmachineretry']+_0x3f8d62[_0xc2d6('0xf1')]>=_0x25e70e[_0xc2d6('0xf2')]-0x1){return!![];}switch(_0x3d0fab){case 0x3:if(_0x3f8d62['countnoanswerretry']>=_0x25e70e[_0xc2d6('0x19a')]-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countnoanswerretry':_0x3f8d62[_0xc2d6('0xef')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e[_0xc2d6('0x19b')],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62[_0xc2d6('0xd1')],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3f8d62['countbusyretry']>=_0x25e70e[_0xc2d6('0x19c')]-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countbusyretry':_0x3f8d62[_0xc2d6('0x101')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e[_0xc2d6('0x19d')],'minutes')[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62[_0xc2d6('0xd1')],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x19e')));break;case 0x8:if(_0x3f8d62[_0xc2d6('0xee')]>=_0x25e70e['dialCongestionMaxRetry']-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countcongestionretry':_0x3f8d62['countcongestionretry']+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e['dialCongestionRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f8d62[_0xc2d6('0xd1')],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62['VoiceQueueId']||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x19f')));break;case 0x0:if(_0x3f8d62[_0xc2d6('0x102')]>=_0x25e70e[_0xc2d6('0x1a0')]-0x1){return!![];}else{this[_0xc2d6('0xbd')]({'active':![],'countnosuchnumberretry':_0x3f8d62[_0xc2d6('0x102')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e[_0xc2d6('0x1a1')],'minutes')[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62[_0xc2d6('0xd1')],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3f8d62[_0xc2d6('0xf0')]>=_0x25e70e[_0xc2d6('0x11b')]-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countdropretry':_0x3f8d62[_0xc2d6('0xf0')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e[_0xc2d6('0x11c')],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62['ContactId'],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x3f8d62[_0xc2d6('0x103')]>=_0x25e70e['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countabandonedretry':_0x3f8d62['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e['dialAbandonedRetryFrequency'],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62['ContactId'],'ListId':_0x3f8d62['ListId'],'VoiceQueueId':_0x3f8d62['VoiceQueueId']||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3f8d62[_0xc2d6('0xed')]>=_0x25e70e[_0xc2d6('0xf4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3f8d62[_0xc2d6('0xed')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e[_0xc2d6('0xf8')],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62['ContactId'],'ListId':_0x3f8d62['ListId'],'VoiceQueueId':_0x3f8d62[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xfd')));break;case 0x14:if(_0x3f8d62['countagentrejectretry']>=_0x25e70e[_0xc2d6('0x1a2')]-0x1){return!![];}this[_0xc2d6('0xbd')]({'active':![],'countagentrejectretry':_0x3f8d62[_0xc2d6('0xf1')]+=0x1,'scheduledat':moment()[_0xc2d6('0xf7')](_0x25e70e['dialAgentRejectRetryFrequency'],_0xc2d6('0xf9'))[_0xc2d6('0x7b')](_0xc2d6('0xfa')),'ContactId':_0x3f8d62[_0xc2d6('0xd1')],'ListId':_0x3f8d62[_0xc2d6('0xfb')],'VoiceQueueId':_0x3f8d62['VoiceQueueId']||undefined,'CampaignId':_0x3f8d62[_0xc2d6('0xd2')]||undefined})[_0xc2d6('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x198')]=function(_0x20bdd3,_0x5dee02,_0x56e5fe){var _0x176dbe=this;var _0x38a67b=new History(_0x20bdd3);return new BPromise(function(_0x46e27b,_0x45f774){if(_[_0xc2d6('0x40')](_0x5dee02)&&typeof _0x5dee02!==_0xc2d6('0x1a3')){return _0x45f774(msgResponse('[callProgressDetecting]',_0xc2d6('0x147'),_0xc2d6('0x1a4')));}if(_[_0xc2d6('0x40')](_0x56e5fe)&&typeof _0x56e5fe!==_0xc2d6('0x1a3')){return _0x45f774(msgResponse(_0xc2d6('0x1a5'),_0xc2d6('0x147'),_0xc2d6('0x1a6')));}switch(_0x56e5fe[_0xc2d6('0x10c')]){case'0':_0x5dee02[_0xc2d6('0x66')]+=0x1;_0x38a67b['state']=0x0;_0x38a67b['statedesc']='NoSuchNumber';_0x38a67b[_0xc2d6('0x102')]+=0x1;_0x38a67b[_0xc2d6('0x11a')]+=0x1;ami[_0xc2d6('0x4e')]('custom:agentnosuchnumber',ut[_0xc2d6('0xe6')](_0x20bdd3,_0xc2d6('0x1a7')));_0x176dbe['createHistory'](_0x38a67b)['catch'](loggerCatch(_0xc2d6('0x100')));if(_0x176dbe['checkRetriveMax'](0x0,_0x20bdd3,_0x5dee02)){if(_0x38a67b[_0xc2d6('0x102')]>=_0x5dee02[_0xc2d6('0x1a0')]){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1a8'));}else{_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1a8'));}}break;case'3':_0x5dee02[_0xc2d6('0x1a9')]+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0x3;_0x38a67b[_0xc2d6('0xe1')]='NoAnswer';_0x38a67b[_0xc2d6('0xef')]+=0x1;_0x38a67b[_0xc2d6('0x11a')]+=0x1;ami[_0xc2d6('0x4e')]('custom:agentnoanswer',ut[_0xc2d6('0xe6')](_0x20bdd3,_0xc2d6('0x1aa')));_0x176dbe['createHistory'](_0x38a67b)['catch'](loggerCatch(_0xc2d6('0x1ab')));if(_0x176dbe['checkRetriveMax'](0x3,_0x20bdd3,_0x5dee02)){if(_0x38a67b['countnoanswerretry']>=_0x5dee02[_0xc2d6('0x19a')]){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1ac'));}else{_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1ac'));}}break;case'5':_0x5dee02[_0xc2d6('0x1ad')]+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0x5;_0x38a67b[_0xc2d6('0xe1')]='Busy';_0x38a67b[_0xc2d6('0x101')]+=0x1;_0x38a67b[_0xc2d6('0x11a')]+=0x1;ami[_0xc2d6('0x4e')](_0xc2d6('0x1ae'),ut[_0xc2d6('0xe6')](_0x20bdd3,_0xc2d6('0x1af')));_0x176dbe[_0xc2d6('0xc8')](_0x38a67b)['catch'](loggerCatch(_0xc2d6('0x1b0')));if(_0x176dbe['checkRetriveMax'](0x5,_0x20bdd3,_0x5dee02)){if(_0x38a67b[_0xc2d6('0x101')]>=_0x5dee02['dialBusyMaxRetry']){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1b1'));}else{_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1b1'));}}break;case'8':_0x5dee02['outboundCongestionCallsDay']+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0x8;_0x38a67b['statedesc']=_0xc2d6('0x1b2');_0x38a67b[_0xc2d6('0xee')]+=0x1;_0x38a67b[_0xc2d6('0x11a')]+=0x1;ami[_0xc2d6('0x4e')](_0xc2d6('0x1b3'),ut[_0xc2d6('0xe6')](_0x20bdd3,'congestion'));_0x176dbe[_0xc2d6('0xc8')](_0x38a67b)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x1b4')));if(_0x176dbe[_0xc2d6('0x1b5')](0x8,_0x20bdd3,_0x5dee02)){if(_0x38a67b['countcongestionretry']>=_0x5dee02['dialCongestionMaxRetry']){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1b6'));}else{_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,'reason\x208\x20congestion');}}break;case'11':_0x5dee02[_0xc2d6('0x1b7')]+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0xb;_0x38a67b[_0xc2d6('0xe1')]=_0xc2d6('0x126');_0x38a67b[_0xc2d6('0x103')]+=0x1;_0x38a67b[_0xc2d6('0x11a')]+=0x1;_0x176dbe[_0xc2d6('0xc8')](_0x38a67b)[_0xc2d6('0xac')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x176dbe[_0xc2d6('0x1b5')](0xb,_0x20bdd3,_0x5dee02)){if(_0x38a67b[_0xc2d6('0x103')]>=_0x5dee02[_0xc2d6('0x123')]){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1b8'));}else{_0x176dbe['stateGlobal'](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1b8'));}}break;case'20':_0x5dee02[_0xc2d6('0x69')]+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0x14;_0x38a67b['statedesc']=_0xc2d6('0x1b9');_0x38a67b[_0xc2d6('0xf1')]+=0x1;_0x38a67b['countglobal']+=0x1;ami[_0xc2d6('0x4e')]('custom:agentreject',ut[_0xc2d6('0xe6')](_0x20bdd3,'agentreject'));_0x176dbe[_0xc2d6('0xc8')](_0x38a67b)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x1ba')));if(_0x176dbe[_0xc2d6('0x1b5')](0x14,_0x20bdd3,_0x5dee02)){if(_0x38a67b[_0xc2d6('0xf1')]>=_0x5dee02[_0xc2d6('0x1a2')]){_0x176dbe[_0xc2d6('0xf5')](_0x38a67b,_0x46e27b,_0x45f774,'reason\x2020\x20agentreject');}else{_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,_0xc2d6('0x1bb'));}}break;default:_0x5dee02[_0xc2d6('0x6a')]+=0x1;_0x38a67b[_0xc2d6('0xa4')]=0xc;_0x38a67b[_0xc2d6('0xe1')]=_0x56e5fe['reason'];_0x176dbe[_0xc2d6('0xc8')](_0x38a67b)[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x1bc')));if(_0x176dbe[_0xc2d6('0x1b5')](_0x56e5fe['reason'],_0x20bdd3,_0x5dee02)){if(_0x38a67b[_0xc2d6('0x101')]+_0x38a67b[_0xc2d6('0xee')]+_0x38a67b[_0xc2d6('0xef')]+_0x38a67b[_0xc2d6('0x102')]+_0x38a67b[_0xc2d6('0xf0')]+_0x38a67b[_0xc2d6('0x103')]+_0x38a67b[_0xc2d6('0xed')]+_0x38a67b[_0xc2d6('0xf1')]>=_0x5dee02[_0xc2d6('0xf2')]){_0x176dbe[_0xc2d6('0x104')](_0x38a67b,_0x46e27b,_0x45f774,_0x56e5fe['reason']);}else{_0x176dbe['createStateFinal'](_0x38a67b,_0x46e27b,_0x45f774,_0x56e5fe[_0xc2d6('0x10c')]);}}}});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x104')]=function(_0x43d16a,_0x1b9c34,_0x3e98f2,_0x16b703){var _0x44bd91=new Final(_0x43d16a);_0x44bd91[_0xc2d6('0xa4')]=0xf;_0x44bd91[_0xc2d6('0xe1')]=_0xc2d6('0x1bd');this[_0xc2d6('0xf5')](_0x44bd91,_0x1b9c34,_0x3e98f2,_0x16b703);};Dialer[_0xc2d6('0x1a')][_0xc2d6('0xf5')]=function(_0x495cfd,_0x24e3d4,_0xb8a972,_0x34ceb2){this['moveContactManagedDialer'](_0x495cfd)[_0xc2d6('0xb6')](function(){return _0x24e3d4(msgResponse(_0xc2d6('0x1a5'),_0xc2d6('0xd6'),_0x34ceb2));})[_0xc2d6('0xac')](function(){return _0xb8a972(msgResponse('[moveContactManagedDialer][0]',_0xc2d6('0x147'),'contact\x20not\x20moved'));});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x6')]=function(_0x21b70a){var _0x10fabe=_0x21b70a[_0xc2d6('0x1be')]/0x64;var _0x2d3586=_0x21b70a[_0xc2d6('0x65')]/(_0x21b70a[_0xc2d6('0x65')]+_0x21b70a[_0xc2d6('0xe0')]);var _0x23fd24=Math[_0xc2d6('0x1bf')](_0x21b70a[_0xc2d6('0x72')]*(_0x21b70a['predictiveIntervalMaxThreshold']/0x64));var _0x13f207=Math[_0xc2d6('0x1bf')](_0x21b70a[_0xc2d6('0x72')]*(_0x21b70a[_0xc2d6('0x1c0')]/0x64));var _0x653780=_0x21b70a['available']+_0x21b70a[_0xc2d6('0x58')];var _0x45edd4=Math[_0xc2d6('0x1c1')](_0x21b70a['erlangCalls']*_0x21b70a[_0xc2d6('0x90')]*_0x21b70a['predictiveIntervalHitRate']*_0x21b70a[_0xc2d6('0x71')]);if(_['isUndefined'](_0x21b70a[_0xc2d6('0x28')])){if(!_['isUndefined'](_0x21b70a[_0xc2d6('0x76')])){_0x21b70a[_0xc2d6('0x76')]=undefined;loggerPredictive[_0xc2d6('0x99')](_0xc2d6('0x1c2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc2d6('0x40')](_0x21b70a['handlePredictive'])){loggerPredictive[_0xc2d6('0x99')]('[startMethodPredictive][StartProgressive]',_0xc2d6('0x1c3'));clearInterval(_0x21b70a[_0xc2d6('0x94')]);_0x21b70a[_0xc2d6('0x94')]=undefined;}_0x21b70a['startProgressive']=moment()[_0xc2d6('0x7b')](_0xc2d6('0xfa'));loggerPredictive[_0xc2d6('0x7f')](_0x21b70a[_0xc2d6('0x42')],_0xc2d6('0x1c4'),_0x21b70a[_0xc2d6('0x28')]);this[_0xc2d6('0x15d')](_0x21b70a,0x1);}else if(ifInterval(_0x21b70a[_0xc2d6('0x1c5')],_0x21b70a[_0xc2d6('0x28')])){this[_0xc2d6('0x15d')](_0x21b70a,0x1);loggerPredictiveCalls['info'](_0xc2d6('0x1c6'),_0x21b70a[_0xc2d6('0x28')],_0x21b70a['name']);_0x21b70a[_0xc2d6('0x74')]=0x0;_0x21b70a[_0xc2d6('0x1c7')]=0x0;}else if(_0x10fabe<_0x2d3586&&_0x21b70a[_0xc2d6('0x1c8')]===_0xc2d6('0x1c9')){freeVariablesPredictive(_0x21b70a);loggerPredictive['info'](_0xc2d6('0x1ca'),'Dropped\x20calls\x20day',_0x2d3586,_0xc2d6('0x28'),_0x21b70a[_0xc2d6('0x42')]);}else if(_0x45edd4<_0x21b70a[_0xc2d6('0x1c7')]&&_0x21b70a[_0xc2d6('0x1c8')]===_0xc2d6('0x1c9')){freeVariablesPredictive(_0x21b70a);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x1cb'),_0xc2d6('0x1cc'),_0x45edd4,'Drop\x20in\x20this\x20interval',_0x21b70a[_0xc2d6('0x1c7')],_0xc2d6('0x28'),_0x21b70a[_0xc2d6('0x42')]);}else if(!ifInterval(_0x21b70a[_0xc2d6('0x1c5')],_0x21b70a[_0xc2d6('0x28')])&&_[_0xc2d6('0x40')](_0x21b70a['startPredictive'])&&!_[_0xc2d6('0x40')](_0x21b70a[_0xc2d6('0x28')])){_0x21b70a['startPredictive']=moment()[_0xc2d6('0x7b')](_0xc2d6('0xfa'));loggerPredictive[_0xc2d6('0x7f')](_0x21b70a[_0xc2d6('0x42')],_0xc2d6('0x1cd'),_0x21b70a[_0xc2d6('0x76')]);this[_0xc2d6('0xba')](_0x21b70a['dialPredictiveInterval'])[_0xc2d6('0xb6')](this[_0xc2d6('0x1ce')](_0x21b70a))[_0xc2d6('0xb6')](mergeDataErlangB(_0x21b70a))[_0xc2d6('0xb6')](this[_0xc2d6('0x1cf')](_0x21b70a))['catch'](loggerCatchPredictive(_0xc2d6('0x1d0'),_0x21b70a));}else if(!ifInterval(_0x21b70a['dialPredictiveInterval'],_0x21b70a['startPredictive'])){_0x21b70a[_0xc2d6('0x1c7')]=0x0;_0x21b70a['startPredictive']=moment()[_0xc2d6('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc2d6('0x7f')](_0x21b70a['name'],_0xc2d6('0x1d1'),_0x21b70a[_0xc2d6('0x76')]);clearInterval(_0x21b70a['handlePredictive']);_0x21b70a['handlePredictive']=undefined;this[_0xc2d6('0xba')](_0x21b70a[_0xc2d6('0x1c5')])[_0xc2d6('0xb6')](this[_0xc2d6('0x1ce')](_0x21b70a))[_0xc2d6('0xb6')](mergeDataErlangB(_0x21b70a))[_0xc2d6('0xb6')](this[_0xc2d6('0x1cf')](_0x21b70a))[_0xc2d6('0xac')](loggerCatchPredictive(_0xc2d6('0x1d2'),_0x21b70a));}else if(_0x21b70a['predictiveIntervalAvailable']&&_0x653780<_0x21b70a[_0xc2d6('0x72')]-_0x13f207){freeVariablesPredictive(_0x21b70a);loggerPredictive[_0xc2d6('0x7f')](_0x21b70a['name'],_0xc2d6('0x1d3'),_0x653780,_0xc2d6('0x1d4'),_0x21b70a[_0xc2d6('0x72')],'-',_0x13f207,'=',_0x21b70a[_0xc2d6('0x72')]-_0x13f207,')');}else if(_0x21b70a[_0xc2d6('0x72')]&&_0x653780>_0x21b70a['predictiveIntervalAvailable']+_0x23fd24){freeVariablesPredictive(_0x21b70a);loggerPredictive[_0xc2d6('0x7f')](_0x21b70a[_0xc2d6('0x42')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x653780,')\x20are\x20more\x20than\x20threshold\x20(',_0x21b70a['predictiveIntervalAvailable'],'+',_0x23fd24,'=',_0x21b70a[_0xc2d6('0x72')]+_0x23fd24,')');}};Dialer['prototype'][_0xc2d6('0x1ce')]=function(_0x502f45){var _0x34238d=this;return function(_0x533120){return new BPromise(function(_0x5cd8d1,_0x4f98f1){_[_0xc2d6('0xd0')](_0x502f45,_0x533120[0x0]);if(checkGetDataPredictive(_0x533120[0x0])){var _0xfaafc0=_0x502f45[_0xc2d6('0x72')]=_0x502f45[_0xc2d6('0x58')]+_0x502f45[_0xc2d6('0x53')];var _0x64e735=_0x502f45[_0xc2d6('0x1c5')]*0x3c;var _0x505555=_0x533120[0x0][_0xc2d6('0x6d')]+_0x533120[0x0][_0xc2d6('0x6c')];var _0x2d97dc=(_0x533120[0x0]['predictiveIntervalAnsweredCalls']+_0x533120[0x0][_0xc2d6('0x6f')]+_0x533120[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x533120[0x0]['predictiveIntervalTotalCalls'];_0x502f45['predictiveIntervalHitRate']=_0x2d97dc>0x0?_0x2d97dc:0x1;switch(_0x502f45[_0xc2d6('0x1c8')]){case _0xc2d6('0x1c9'):var _0x125864=_0x502f45['dialPredictiveOptimizationPercentage']/0x64;return _0x34238d['abandonmentRate'](_0xfaafc0,_0x64e735,_0x505555,_0x2d97dc,_0x125864)[_0xc2d6('0xb6')](function(_0x308cd9){return _0x5cd8d1(_0x308cd9);});case'agentBusyFactor':var _0x48147a=_0x502f45[_0xc2d6('0x1be')]/0x64;return _0x34238d['busyFactor'](_0xfaafc0,_0x64e735,_0x505555,_0x2d97dc,_0x48147a)[_0xc2d6('0xb6')](function(_0x57d5bc){return _0x5cd8d1(_0x57d5bc);});default:return _0x4f98f1(msgResponse(_0xc2d6('0x1d5'),_0xc2d6('0x147'),_0xc2d6('0x1d6')));}}else{return _0x4f98f1(msgResponse(_0xc2d6('0x1d5'),_0xc2d6('0x147'),'check\x20failure'));}});};};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x1d7')]=function(_0x1d539a){var _0x5e43f3=this;return function(_0x47538b){return new BPromise(function(_0x3a9eb6,_0x41efc3){_[_0xc2d6('0xd0')](_0x1d539a,_0x47538b[0x0]);if(checkGetDataPredictive(_0x47538b[0x0])){loggerPredictive[_0xc2d6('0x7f')](JSON['stringify'](_0x47538b[0x0]));if(_0x1d539a[_0xc2d6('0x1c8')]==='dropRate'){return _0x5e43f3[_0xc2d6('0xc4')](_0x1d539a['id'])['then'](function(_0x45ae82){var _0x519a0d=_0x1d539a[_0xc2d6('0x54')]-_0x45ae82[0x0][_0xc2d6('0x1d8')];var _0x274a38=_0x1d539a[_0xc2d6('0x1c5')]*0x3c;var _0x54a17b=_0x47538b[0x0]['predictiveIntervalAvgTalktime']+_0x47538b[0x0][_0xc2d6('0x6c')];var _0x5ca749=(_0x47538b[0x0][_0xc2d6('0x6b')]+_0x47538b[0x0][_0xc2d6('0x6f')]+_0x47538b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x47538b[0x0]['predictiveIntervalTotalCalls'];var _0x18499b=_0x1d539a[_0xc2d6('0x1be')]/0x64;_0x1d539a[_0xc2d6('0x1d9')]=_0x45ae82[0x0][_0xc2d6('0x1d8')]||0x0;_0x1d539a['predictiveIntervalHitRate']=_0x5ca749>0x0?_0x5ca749:0x1;return _0x5e43f3[_0xc2d6('0x1da')](_0x519a0d,_0x274a38,_0x54a17b,_0x5ca749,_0x18499b);})[_0xc2d6('0xb6')](function(_0x39d514){return _0x3a9eb6(_0x39d514);})[_0xc2d6('0xac')](function(_0x4b1d02){return _0x41efc3(msgResponse('[CatchErlangB]','Failure',JSON[_0xc2d6('0x4b')](_0x4b1d02)));});}if(_0x1d539a[_0xc2d6('0x1c8')]===_0xc2d6('0x1db')){return _0x5e43f3[_0xc2d6('0xc4')](_0x1d539a['id'])[_0xc2d6('0xb6')](function(_0x3b32d6){var _0x4be06e=_0x1d539a['loggedIn']-_0x3b32d6[0x0]['outboundQueuePauses'];var _0x4e8f4b=_0x1d539a[_0xc2d6('0x1c5')]*0x3c;var _0x2cd489=_0x47538b[0x0][_0xc2d6('0x6d')]+_0x47538b[0x0][_0xc2d6('0x6c')];var _0x5d55e6=(_0x47538b[0x0][_0xc2d6('0x6b')]+_0x47538b[0x0][_0xc2d6('0x6f')]+_0x47538b[0x0][_0xc2d6('0x6e')])/_0x47538b[0x0][_0xc2d6('0x82')];var _0x5015bb=_0x1d539a[_0xc2d6('0x1be')]/0x64;_0x1d539a['predictiveIntervalPauses']=_0x3b32d6[0x0]['outboundQueuePauses']||0x0;_0x1d539a['predictiveIntervalHitRate']=_0x5d55e6>0x0?_0x5d55e6:0x1;return _0x5e43f3[_0xc2d6('0x1dc')](_0x4be06e,_0x4e8f4b,_0x2cd489,_0x5d55e6,_0x5015bb);})[_0xc2d6('0xb6')](function(_0x4a1832){return _0x3a9eb6(_0x4a1832);})[_0xc2d6('0xac')](function(_0x1a8153){return _0x41efc3(msgResponse('[CatchErlangB]',_0xc2d6('0x147'),JSON[_0xc2d6('0x4b')](_0x1a8153)));});}}else{return _0x41efc3(msgResponse(_0xc2d6('0x1d5'),_0xc2d6('0x147'),_0xc2d6('0x1dd')));}});};};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x1cf')]=function(_0x2a73d0){var _0x466e4c=this;return function(){var _0x5be384=0x0;var _0x4a19a3=Math[_0xc2d6('0x1c1')](_0x2a73d0[_0xc2d6('0x75')]*0x3e8);if(_0x4a19a3>0x0){_0x4a19a3=_0x4a19a3<0x64?0x64:_0x4a19a3;loggerPredictive[_0xc2d6('0x7f')](_0x2a73d0['name'],_0xc2d6('0x1de'),_0x4a19a3,'milliseconds');_0x2a73d0[_0xc2d6('0x94')]=setInterval(function(){_0x466e4c['handlePredictive'](_0x2a73d0);loggerPredictiveCalls[_0xc2d6('0x7f')](_0xc2d6('0x1df'),_0x5be384+=0x1);},_0x4a19a3);}else{loggerPredictive['info'](_0x2a73d0[_0xc2d6('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x1e0')]=function(_0x254e1c,_0x55576c){var _0x23220d=this;return function(_0x2dd0a3){if(_[_0xc2d6('0x49')](_0x2dd0a3)){if(_['isNil'](_0x55576c[_0xc2d6('0x1e1')])||!_0x55576c[_0xc2d6('0x1e2')]){if(_0x254e1c[_0xc2d6('0x5d')]===_0xc2d6('0x5')){_0x254e1c['queueStatusComplete']=_[_0xc2d6('0x40')](_0x254e1c[_0xc2d6('0x12e')])?!![]:_0x254e1c['queueStatusComplete'];var _0x806b6b=uuid['v4']();_0x23220d[_0xc2d6('0x24')][_0x806b6b]=new Action(_0x254e1c,_0x55576c,_0x806b6b);loggerBooked['info'](_0xc2d6('0x1e3'),_0x806b6b,'queueStatusComplete:\x20',JSON[_0xc2d6('0x4b')](_0x254e1c[_0xc2d6('0x12e')]),_0xc2d6('0x1e4'),_0x254e1c[_0xc2d6('0x42')]);if(_0x254e1c[_0xc2d6('0x12e')]){_0x254e1c['queueStatusComplete']=![];_0x23220d[_0xc2d6('0x2a')][_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xaf')]]=[];ami['Action']({'actionid':_0x806b6b,'action':_0xc2d6('0x1e5'),'queue':_0x254e1c[_0xc2d6('0x42')]})[_0xc2d6('0xac')](function(){_0x23220d[_0xc2d6('0xae')](_0x254e1c);_0x23220d['rescheduleContact']({'active':![],'ContactId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xd1')],'ListId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xfb')],'VoiceQueueId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xfc')]||undefined,'CampaignId':_0x23220d['actions'][_0x806b6b]['CampaignId']||undefined})[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0x1e6')));delete _0x23220d[_0xc2d6('0x24')][_0x806b6b];});}else{loggerBooked[_0xc2d6('0x7f')](_0xc2d6('0x1e7'),JSON[_0xc2d6('0x4b')](_0x254e1c['queueStatusComplete']),_0xc2d6('0x1e4'),_0x254e1c[_0xc2d6('0x42')]);_0x23220d[_0xc2d6('0xae')](_0x254e1c);_0x23220d[_0xc2d6('0xbd')]({'active':![],'ContactId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xd1')],'ListId':_0x23220d[_0xc2d6('0x24')][_0x806b6b]['ListId'],'VoiceQueueId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xfc')]||undefined,'CampaignId':_0x23220d[_0xc2d6('0x24')][_0x806b6b][_0xc2d6('0xd2')]||undefined})['catch'](loggerCatch(_0xc2d6('0x1e6')));delete _0x23220d['actions'][_0x806b6b];}}else{return _0x23220d[_0xc2d6('0x16f')](_0x254e1c,_0x55576c);}}else{if(getDiff(_0x55576c[_0xc2d6('0x1e8')])<_0x254e1c[_0xc2d6('0x1e9')]*0x3c){if(_0x55576c[_0xc2d6('0x1ea')]&&!_0x55576c[_0xc2d6('0x1ea')][_0xc2d6('0x1eb')]){_0x23220d[_0xc2d6('0x1e')][_0xc2d6('0x132')](_0x55576c['id'])[_0xc2d6('0x134')](function(){_0x23220d[_0xc2d6('0xae')](_0x254e1c);});}else{_0x23220d[_0xc2d6('0x1ec')]({'active':![]},_0x55576c['id'],0x1)[_0xc2d6('0x134')](function(){_0x23220d[_0xc2d6('0xae')](_0x254e1c);});}}else{_0x254e1c[_0xc2d6('0x68')]+=0x1;_0x23220d[_0xc2d6('0xae')](_0x254e1c);if(_0x254e1c['dialRecallInQueue']){_0x23220d[_0xc2d6('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x55576c[_0xc2d6('0xd1')],'ListId':_0x55576c[_0xc2d6('0xfb')],'VoiceQueueId':_0x55576c[_0xc2d6('0xfc')]||undefined,'CampaignId':_0x55576c[_0xc2d6('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x23220d[_0xc2d6('0xc8')](createObjHistory(_0x254e1c,_0x55576c,_0xc2d6('0x1ed'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0xc2d6('0x1ee')));}else{_0x23220d[_0xc2d6('0xe8')](createObjHistory(_0x254e1c,_0x55576c,'RECALLFAILEDTIMEOUT',0x16,_0xc2d6('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x254e1c[_0xc2d6('0x62')]+=0x1;_0x23220d[_0xc2d6('0xe8')](createObjHistory(_0x254e1c,_0x55576c,_0xc2d6('0x1f0'),0xd,_0xc2d6('0x1f1')),_0xc2d6('0x1f2'),_0xc2d6('0x1f3'));throw _0xc2d6('0x1f4');}};};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x161')]=function(_0x31fd32){var _0x2b29d5=this;var _0x3d162c=_0x31fd32['limitCalls']-_0x31fd32[_0xc2d6('0x73')]-_0x31fd32[_0xc2d6('0xc1')];emitCampaignSummary(_0x31fd32);if(_0x3d162c>0x0){if(_0x3d162c>this[_0xc2d6('0x23')]){_0x3d162c=this[_0xc2d6('0x23')];}_0x31fd32[_0xc2d6('0xc1')]+=_0x3d162c;this[_0xc2d6('0xc2')](_0x31fd32['id'],_0x3d162c,_0x31fd32[_0xc2d6('0x1f5')],_0x31fd32)[_0xc2d6('0xb6')](function(_0x4af836){_0x31fd32['temp']-=_0x3d162c;_0x31fd32['temp']=_0x31fd32[_0xc2d6('0xc1')]>0x0?_0x31fd32['temp']:0x0;if(!checkContactEmpty(_0x4af836)){_0x31fd32[_0xc2d6('0x41')]=_0xc2d6('0x1f6');logger['info']('[getContactCampaign2][Empty]'+_0x31fd32['name']);}else{_0x31fd32[_0xc2d6('0x73')]+=_0x4af836[_0xc2d6('0x9a')];_0x31fd32[_0xc2d6('0x41')]=_0xc2d6('0x1f7');for(var _0x482f2b=0x0;_0x482f2b<_0x4af836[_0xc2d6('0x9a')];_0x482f2b+=0x1){_0x31fd32[_0xc2d6('0x1f8')]+=0x1;if(_[_0xc2d6('0xa9')](_0x4af836[_0x482f2b])||_[_0xc2d6('0xa9')](_0x4af836[_0x482f2b][_0xc2d6('0x172')])||_[_0xc2d6('0xa9')](_0x4af836[_0x482f2b][_0xc2d6('0x172')][_0xc2d6('0x190')])){_0x2b29d5[_0xc2d6('0xce')](_0xc2d6('0x1f9'),_0x31fd32,_0x4af836[_0x482f2b]);}else{_0x2b29d5[_0xc2d6('0xb8')](_[_0xc2d6('0x131')](_0x4af836[_0x482f2b],[_0xc2d6('0xd2'),_0xc2d6('0x1fa')]))[_0xc2d6('0xb6')](_0x2b29d5['checkContactBlack'](_0x31fd32,_0x4af836[_0x482f2b]))[_0xc2d6('0xac')](_0x2b29d5[_0xc2d6('0xcd')]('[actionOriginateIvr]\x20',_0x31fd32));}}}})['catch'](loggerGetContactDialer(_0xc2d6('0x1fb'),_0x31fd32,_0x3d162c));}};Dialer[_0xc2d6('0x1a')]['handlePower']=function(_0x2415ea,_0x5256fa){var _0x50a1be=this;var _0x1b848b=[];var _0x290b4c=_0x5256fa>=0x1?_0x5256fa:0x1;if(_0x2415ea[_0xc2d6('0x5d')]==='booked'){_0x290b4c=0x1;}var _0x56912e=Math[_0xc2d6('0x1c1')](_0x2415ea['available']*_0x290b4c)-_0x2415ea[_0xc2d6('0x73')]-_0x2415ea['temp'];emitVoiceQueueSummary(_0x2415ea);if(_0x2415ea[_0xc2d6('0x1fc')]>0x0){var _0xac5c16=_0x2415ea[_0xc2d6('0x1fc')]-_0x2415ea['originated']-_0x2415ea['talking']-_0x2415ea[_0xc2d6('0xc1')]-_0x2415ea[_0xc2d6('0x55')];if(_0x56912e>_0xac5c16){_0x56912e=_0xac5c16;}}if(_0x56912e>0x0){if(_0x2415ea['dialMethod']===_0xc2d6('0x5')){_0x56912e=0x1;}if(_0x56912e>this[_0xc2d6('0x23')]){_0x56912e=this[_0xc2d6('0x23')];}_0x2415ea[_0xc2d6('0xc1')]+=_0x56912e;for(var _0x4afbd8 in this['agents']){if(typeof this[_0xc2d6('0x21')][_0x4afbd8]!==_0xc2d6('0xca')){if(this['agents'][_0x4afbd8]['state']==='not_inuse'&&this[_0xc2d6('0x21')][_0x4afbd8][_0xc2d6('0xab')]===_0xc2d6('0xd9')){_0x1b848b[_0xc2d6('0x12d')](this[_0xc2d6('0x21')][_0x4afbd8]['id']);}}}this[_0xc2d6('0xc0')](_0x2415ea['id'],_0x1b848b,_0x56912e,_0x2415ea[_0xc2d6('0x1f5')],_0x2415ea)['then'](function(_0x28e00b){_0x2415ea[_0xc2d6('0xc1')]-=_0x56912e;_0x2415ea[_0xc2d6('0xc1')]=_0x2415ea[_0xc2d6('0xc1')]>0x0?_0x2415ea[_0xc2d6('0xc1')]:0x0;if(!checkContactEmpty(_0x28e00b)){_0x50a1be[_0xc2d6('0xb2')](_0x2415ea)[_0xc2d6('0xb6')](sendMessageReschedule(_0x2415ea))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xb4')));}else{_0x2415ea[_0xc2d6('0x73')]+=_0x28e00b[_0xc2d6('0x9a')];_0x2415ea[_0xc2d6('0x41')]=_0x2415ea[_0xc2d6('0x5d')]==='booked'?_0xc2d6('0x178'):_0xc2d6('0x1f7');for(var _0x4b2fd2=0x0;_0x4b2fd2<_0x28e00b['length'];_0x4b2fd2+=0x1){if(_[_0xc2d6('0xa9')](_0x28e00b[_0x4b2fd2])||_['isNil'](_0x28e00b[_0x4b2fd2]['Contact'])||_[_0xc2d6('0xa9')](_0x28e00b[_0x4b2fd2][_0xc2d6('0x172')]['phone'])){_0x50a1be[_0xc2d6('0xce')](_0xc2d6('0x1f9'),_0x2415ea,_0x28e00b[_0x4b2fd2]);}else{_0x50a1be[_0xc2d6('0xb5')](_[_0xc2d6('0x131')](_0x28e00b[_0x4b2fd2],[_0xc2d6('0xfc'),_0xc2d6('0x1fa')]))[_0xc2d6('0xb6')](_0x50a1be[_0xc2d6('0x1e0')](_0x2415ea,_0x28e00b[_0x4b2fd2]))[_0xc2d6('0xac')](_0x50a1be[_0xc2d6('0xcd')](_0xc2d6('0x1f9'),_0x2415ea));}}}})[_0xc2d6('0xac')](loggerGetContactDialer(_0xc2d6('0x1fd'),_0x2415ea,_0x56912e));}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x94')]=function(_0x3d9f6e){if(_0x3d9f6e[_0xc2d6('0x1fc')]>0x0){var _0x34e6fa=_0x3d9f6e[_0xc2d6('0x1fc')]-_0x3d9f6e['originated']-_0x3d9f6e[_0xc2d6('0x58')];if(_0x34e6fa>0x0){this[_0xc2d6('0x1fe')](_0x3d9f6e);}else{loggerPredictiveCalls[_0xc2d6('0x7f')](_0xc2d6('0x1ff'));}}else{this[_0xc2d6('0x1fe')](_0x3d9f6e);}};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x1fe')]=function(_0x385c4b){var _0x4b8d48=this;var _0x218bde=[];_0x385c4b[_0xc2d6('0x73')]+=0x1;for(var _0x1269d6 in this[_0xc2d6('0x21')]){if(typeof this[_0xc2d6('0x21')][_0x1269d6]!=='undefined'){if(this[_0xc2d6('0x21')][_0x1269d6][_0xc2d6('0xa4')]===_0xc2d6('0x200')&&this['agents'][_0x1269d6][_0xc2d6('0xab')]===_0xc2d6('0xd9')){_0x218bde['push'](this['agents'][_0x1269d6]['id']);}}}this['getContactDialer'](_0x385c4b['id'],_0x218bde,0x1,_0x385c4b['dialOrderByScheduledAt'],_0x385c4b)[_0xc2d6('0xb6')](function(_0xb97263){if(!checkContactEmpty(_0xb97263)){checkContactLowerLimitOriginate(_0x385c4b,0x1,0x0);_0x4b8d48[_0xc2d6('0xb2')](_0x385c4b)[_0xc2d6('0xb6')](sendMessageReschedule(_0x385c4b))[_0xc2d6('0xac')](loggerCatch(_0xc2d6('0xb4')));}else{_0x385c4b['message']='RUNNING';if(_['isNil'](_0xb97263[0x0])||_[_0xc2d6('0xa9')](_0xb97263[0x0]['Contact'])||_['isNil'](_0xb97263[0x0][_0xc2d6('0x172')][_0xc2d6('0x190')])){_0x4b8d48[_0xc2d6('0xce')]('[actionOriginate]\x20',_0x385c4b,_0xb97263[0x0]);}else{_0x4b8d48[_0xc2d6('0xb5')](_['pick'](_0xb97263[0x0],[_0xc2d6('0xfc'),_0xc2d6('0x1fa')]))[_0xc2d6('0xb6')](_0x4b8d48[_0xc2d6('0x1e0')](_0x385c4b,_0xb97263[0x0]))[_0xc2d6('0xac')](_0x4b8d48[_0xc2d6('0xcd')](_0xc2d6('0x201'),_0x385c4b));}}})['catch'](loggerGetContactDialer(_0xc2d6('0x202'),_0x385c4b,0x1));emitVoiceQueueSummary(_0x385c4b);};Dialer['prototype'][_0xc2d6('0x1da')]=function(_0x544cf3,_0x1e465c,_0x423066,_0x594d4a,_0x2f30f5,_0x1f5f09){loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x203'));loggerPredictive['info'](_0xc2d6('0x204'),_0x544cf3);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e465c);loggerPredictive['info'](_0xc2d6('0x205'),_0x423066);loggerPredictive[_0xc2d6('0x7f')]('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',_0x594d4a);loggerPredictive[_0xc2d6('0x7f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f30f5);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x88'));return new BPromise(function(_0x2f092c,_0x3dc9df){if(_0x544cf3<=0x0||isNaN(_0x544cf3)){return _0x3dc9df(msgResponse(_0xc2d6('0x206'),_0xc2d6('0x4a'),'m\x20=\x20'+_0x544cf3));}if(_0x423066<=0x0||isNaN(_0x423066)){return _0x3dc9df(msgResponse('[abandonmentRate]',_0xc2d6('0x4a'),_0xc2d6('0x207')+_0x423066));}if(_0x594d4a<=0x0||isNaN(_0x594d4a)){return _0x3dc9df(msgResponse('[abandonmentRate]','Error',_0xc2d6('0x208')+_0x594d4a));}if(_0x1e465c<=0x0||isNaN(_0x1e465c)){return _0x3dc9df(msgResponse(_0xc2d6('0x206'),_0xc2d6('0x4a'),_0xc2d6('0x209')+_0x1e465c));}if(_0x2f30f5<=0x0||isNaN(_0x2f30f5)){return _0x3dc9df(msgResponse(_0xc2d6('0x206'),'Error',_0xc2d6('0x20a')+_0x2f30f5));}_0x1f5f09=_0x1f5f09||0x0;var _0x12d7ed=0x1/_0x423066;var _0x4a2333=0x0;var _0x402906=0x0;var _0x32ed7f=0x0;var _0x333175=0x0;for(var _0x1cb840=0x0;_0x32ed7f<_0x2f30f5;_0x1cb840+=0x1){_0x402906=_0x1cb840/_0x1e465c;_0x4a2333=(_0x594d4a*_0x402906+_0x1f5f09)/_0x12d7ed;_0x32ed7f=erlangb(_0x4a2333,_0x544cf3);_0x333175=_0x4a2333/_0x544cf3*(0x1-erlangb(_0x4a2333,_0x544cf3));}return _0x2f092c({'erlangCalls':_0x1cb840,'erlangCallToSecond':_0x1e465c/_0x1cb840,'erlangAbandonmentRate':_0x32ed7f,'erlangBusyFactor':_0x333175});});};Dialer[_0xc2d6('0x1a')][_0xc2d6('0x1dc')]=function(_0xf025e0,_0x162fb4,_0x48c1da,_0x12bcf5,_0x33ce7d,_0x2013b3){loggerPredictive['info'](_0xc2d6('0x20b'));loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x204'),_0xf025e0);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x20c'),_0x162fb4);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48c1da);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x20d'),_0x12bcf5);loggerPredictive[_0xc2d6('0x7f')](_0xc2d6('0x20e'),_0x33ce7d);loggerPredictive['info'](_0xc2d6('0x88'));return new BPromise(function(_0x4c485a,_0x56eb8d){if(_0xf025e0<=0x0||isNaN(_0xf025e0)){return _0x56eb8d(msgResponse(_0xc2d6('0x20f'),_0xc2d6('0x4a'),_0xc2d6('0x210')+_0xf025e0));}if(_0x48c1da<=0x0||isNaN(_0x48c1da)){return _0x56eb8d(msgResponse(_0xc2d6('0x20f'),_0xc2d6('0x4a'),_0xc2d6('0x207')+_0x48c1da));}if(_0x12bcf5<=0x0||isNaN(_0x12bcf5)){return _0x56eb8d(msgResponse(_0xc2d6('0x20f'),_0xc2d6('0x4a'),_0xc2d6('0x208')+_0x12bcf5));}if(_0x162fb4<=0x0||isNaN(_0x162fb4)){return _0x56eb8d(msgResponse('[busyFactor]',_0xc2d6('0x4a'),_0xc2d6('0x209')+_0x162fb4));}if(_0x33ce7d<=0x0||isNaN(_0x33ce7d)){return _0x56eb8d(msgResponse(_0xc2d6('0x20f'),_0xc2d6('0x4a'),_0xc2d6('0x211')+_0x33ce7d));}_0x2013b3=_0x2013b3||0x0;var _0x2a2946=0x1/_0x48c1da;var _0x42e781=0x0;var _0x2afa66=0x0;var _0x287793=0x0;var _0x208357=0x0;for(var _0x1ec790=0x0;_0x208357<_0x33ce7d;_0x1ec790+=0x1){_0x2afa66=_0x1ec790/_0x162fb4;_0x42e781=(_0x12bcf5*_0x2afa66+_0x2013b3)/_0x2a2946;_0x287793=erlangb(_0x42e781,_0xf025e0);_0x208357=_0x42e781/_0xf025e0*(0x1-erlangb(_0x42e781,_0xf025e0));}return _0x4c485a({'erlangCalls':_0x1ec790,'erlangCallToSecond':_0x162fb4/_0x1ec790,'erlangAbandonmentRate':_0x287793,'erlangBusyFactor':_0x208357});});};module[_0xc2d6('0x212')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 9ca9b50..fa6105a 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 _0xa3d8=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue'];(function(_0x58a069,_0x406bcb){var _0x39eba0=function(_0x13b029){while(--_0x13b029){_0x58a069['push'](_0x58a069['shift']());}};_0x39eba0(++_0x406bcb);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x2313bb,_0x8a54a8){_0x2313bb=_0x2313bb-0x0;var _0x1fd2ad=_0xa3d8[_0x2313bb];return _0x1fd2ad;};'use strict';var util=require(_0x8a3d('0x0'));var _=require('lodash');var moment=require(_0x8a3d('0x1'));function getSeconds(_0x1e901b,_0x190043){var _0x50ea9f=moment(_0x1e901b)[_0x8a3d('0x2')](0x0);var _0x1dfa89=moment(_0x190043)[_0x8a3d('0x2')](0x0);return _0x50ea9f[_0x8a3d('0x3')](_0x1dfa89,_0x8a3d('0x4'));}function QueueCallerAbandon(_0xfc4d1d,_0x202212){this[_0x8a3d('0x5')]=_0xfc4d1d[_0x8a3d('0x5')];this[_0x8a3d('0x6')]=_0xfc4d1d['type'];this[_0x8a3d('0x7')]=_0xfc4d1d[_0x8a3d('0x6')]===_0x8a3d('0x8')?_0x8a3d('0x9'):_0xfc4d1d[_0x8a3d('0x6')];this[_0x8a3d('0xa')]=_0xfc4d1d[_0x8a3d('0xa')];this['countcongestionretry']=_0xfc4d1d[_0x8a3d('0xb')];this[_0x8a3d('0xc')]=_0xfc4d1d['countnoanswerretry'];this[_0x8a3d('0xd')]=_0xfc4d1d[_0x8a3d('0xa')]+_0xfc4d1d[_0x8a3d('0xb')]+_0xfc4d1d[_0x8a3d('0xc')]+_0xfc4d1d[_0x8a3d('0xe')]+_0xfc4d1d[_0x8a3d('0xf')]+_0xfc4d1d['countabandonedretry']+_0xfc4d1d[_0x8a3d('0x10')]+_0xfc4d1d[_0x8a3d('0x11')];this[_0x8a3d('0xe')]=_0xfc4d1d[_0x8a3d('0xe')];this[_0x8a3d('0xf')]=_0xfc4d1d[_0x8a3d('0xf')];this[_0x8a3d('0x12')]=_0xfc4d1d[_0x8a3d('0x12')];this[_0x8a3d('0x10')]=_0xfc4d1d[_0x8a3d('0x10')];this[_0x8a3d('0x11')]=_0xfc4d1d[_0x8a3d('0x11')];this[_0x8a3d('0x13')]=_0x202212[_0x8a3d('0x13')];this['calleridname']=_0xfc4d1d[_0x8a3d('0x14')];this[_0x8a3d('0x15')]=_0xfc4d1d[_0x8a3d('0x16')];this[_0x8a3d('0x17')]=_0xfc4d1d['starttime'];this[_0x8a3d('0x18')]=_0xfc4d1d['responsetime'];this[_0x8a3d('0x19')]=_0xfc4d1d[_0x8a3d('0x19')];this['endtime']=this[_0x8a3d('0x19')];this['ringtime']=getSeconds(_0xfc4d1d['responsetime'],_0xfc4d1d[_0x8a3d('0x17')]);this['holdtime']=getSeconds(this['droptime'],_0xfc4d1d[_0x8a3d('0x18')]);this[_0x8a3d('0x1a')]=0x0;this[_0x8a3d('0x9')]=_0x202212['queue'];this[_0x8a3d('0x1b')]=_0x202212[_0x8a3d('0x1c')];this['reason']=_0x202212[_0x8a3d('0x1d')];this['callback']=_0xfc4d1d['callback'];this['callbackuniqueid']=_0xfc4d1d[_0x8a3d('0x1e')];this[_0x8a3d('0x1f')]=_0xfc4d1d[_0x8a3d('0x1f')];this[_0x8a3d('0x20')]=_0xfc4d1d[_0x8a3d('0x20')];this['ContactId']=_0xfc4d1d[_0x8a3d('0x21')];this['ListId']=_0xfc4d1d[_0x8a3d('0x22')];this[_0x8a3d('0x23')]=_0xfc4d1d['UserId'];this['VoiceQueueId']=_0xfc4d1d[_0x8a3d('0x24')];this[_0x8a3d('0x25')]=_0xfc4d1d[_0x8a3d('0x25')];this['originatecalleridnum']=_0xfc4d1d['originatecalleridnum']||'';this[_0x8a3d('0x26')]=_0xfc4d1d['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xcf3e=['originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','starttime','responsetime','droptime','endtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x25ba97,_0x3b9316){var _0x1311fe=function(_0x3a690f){while(--_0x3a690f){_0x25ba97['push'](_0x25ba97['shift']());}};_0x1311fe(++_0x3b9316);}(_0xcf3e,0xc4));var _0xecf3=function(_0x42532a,_0x2b51e3){_0x42532a=_0x42532a-0x0;var _0x2d4a53=_0xcf3e[_0x42532a];return _0x2d4a53;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xecf3('0x0'));function getSeconds(_0xbaa9d0,_0x5732e0){var _0x3c58f7=moment(_0xbaa9d0)[_0xecf3('0x1')](0x0);var _0x2c3b73=moment(_0x5732e0)[_0xecf3('0x1')](0x0);return _0x3c58f7[_0xecf3('0x2')](_0x2c3b73,_0xecf3('0x3'));}function QueueCallerAbandon(_0x25a502,_0x33e660){this['scheduledat']=_0x25a502[_0xecf3('0x4')];this[_0xecf3('0x5')]=_0x25a502[_0xecf3('0x5')];this[_0xecf3('0x6')]=_0x25a502[_0xecf3('0x5')]===_0xecf3('0x7')?'queue':_0x25a502[_0xecf3('0x5')];this[_0xecf3('0x8')]=_0x25a502[_0xecf3('0x8')];this[_0xecf3('0x9')]=_0x25a502[_0xecf3('0x9')];this['countnoanswerretry']=_0x25a502[_0xecf3('0xa')];this[_0xecf3('0xb')]=_0x25a502[_0xecf3('0x8')]+_0x25a502[_0xecf3('0x9')]+_0x25a502[_0xecf3('0xa')]+_0x25a502[_0xecf3('0xc')]+_0x25a502[_0xecf3('0xd')]+_0x25a502['countabandonedretry']+_0x25a502[_0xecf3('0xe')]+_0x25a502['countagentrejectretry'];this[_0xecf3('0xc')]=_0x25a502[_0xecf3('0xc')];this[_0xecf3('0xd')]=_0x25a502[_0xecf3('0xd')];this['countabandonedretry']=_0x25a502[_0xecf3('0xf')];this[_0xecf3('0xe')]=_0x25a502['countmachineretry'];this['countagentrejectretry']=_0x25a502[_0xecf3('0x10')];this[_0xecf3('0x11')]=_0x33e660[_0xecf3('0x11')];this['calleridname']=_0x25a502[_0xecf3('0x12')];this['calleridnum']=_0x25a502['number'];this[_0xecf3('0x13')]=_0x25a502[_0xecf3('0x13')];this[_0xecf3('0x14')]=_0x25a502[_0xecf3('0x14')];this[_0xecf3('0x15')]=_0x25a502[_0xecf3('0x15')];this[_0xecf3('0x16')]=this[_0xecf3('0x15')];this['ringtime']=getSeconds(_0x25a502[_0xecf3('0x14')],_0x25a502['starttime']);this['holdtime']=getSeconds(this[_0xecf3('0x15')],_0x25a502[_0xecf3('0x14')]);this[_0xecf3('0x17')]=0x0;this[_0xecf3('0x18')]=_0x33e660[_0xecf3('0x18')];this[_0xecf3('0x19')]=_0x33e660[_0xecf3('0x1a')];this[_0xecf3('0x1b')]=_0x33e660['reason'];this[_0xecf3('0x1c')]=_0x25a502['callback'];this[_0xecf3('0x1d')]=_0x25a502[_0xecf3('0x1d')];this[_0xecf3('0x1e')]=_0x25a502[_0xecf3('0x1e')];this['recallme']=_0x25a502[_0xecf3('0x1f')];this[_0xecf3('0x20')]=_0x25a502[_0xecf3('0x20')];this[_0xecf3('0x21')]=_0x25a502['ListId'];this[_0xecf3('0x22')]=_0x25a502[_0xecf3('0x22')];this[_0xecf3('0x23')]=_0x25a502[_0xecf3('0x23')];this[_0xecf3('0x24')]=_0x25a502['CampaignId'];this[_0xecf3('0x25')]=_0x25a502['originatecalleridnum']||'';this[_0xecf3('0x26')]=_0x25a502[_0xecf3('0x26')]||'';}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 cb99c52..ea56842 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(_0x1c007b,_0x528664){var _0x2596d7=function(_0x16a788){while(--_0x16a788){_0x1c007b['push'](_0x1c007b['shift']());}};_0x2596d7(++_0x528664);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x16d701,_0x2658a8){var _0x15ae71=function(_0x24141a){while(--_0x24141a){_0x16d701['push'](_0x16d701['shift']());}};_0x15ae71(++_0x2658a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 1d18cc1..dab8a35 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 _0xc788=['value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','AttachmentId','update','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','checkTrunk','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable'];(function(_0x4e7eec,_0x13cd74){var _0x79b028=function(_0xd14b18){while(--_0xd14b18){_0x4e7eec['push'](_0x4e7eec['shift']());}};_0x79b028(++_0x13cd74);}(_0xc788,0xc4));var _0x8c78=function(_0x2947d1,_0x5e70b0){_0x2947d1=_0x2947d1-0x0;var _0x2b36a5=_0xc788[_0x2947d1];return _0x2b36a5;};'use strict';var util=require(_0x8c78('0x0'));var _=require(_0x8c78('0x1'));var BPromise=require(_0x8c78('0x2'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x8c78('0x3'));var tiff2pdf=require(_0x8c78('0x4'));var gs=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var ami=require('../ami');var rpcDb=require(_0x8c78('0x8'));var Channel=require(_0x8c78('0x9'));var ut=require(_0x8c78('0xa'));var Action=require(_0x8c78('0xb'));var faxAccount=require(_0x8c78('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x8c78('0xd'));function Fax(_0x299d9d){this[_0x8c78('0xe')]={};this[_0x8c78('0xf')]=_0x299d9d[_0x8c78('0xf')];this[_0x8c78('0x10')]=_0x299d9d['trunks'];this[_0x8c78('0x11')]={};ami['on']('newchannel',this[_0x8c78('0x12')][_0x8c78('0x13')](this));ami['on']('varset',this[_0x8c78('0x14')][_0x8c78('0x13')](this));ami['on']('newstate',this[_0x8c78('0x15')]['bind'](this));ami['on']('newexten',this[_0x8c78('0x16')][_0x8c78('0x13')](this));ami['on'](_0x8c78('0x17'),this[_0x8c78('0x18')][_0x8c78('0x13')](this));ami['on'](_0x8c78('0x19'),this[_0x8c78('0x1a')][_0x8c78('0x13')](this));ami['on'](_0x8c78('0x1b'),this[_0x8c78('0x1c')]['bind'](this));ami['on'](_0x8c78('0x1d'),this[_0x8c78('0x1e')]['bind'](this));}Fax[_0x8c78('0x1f')][_0x8c78('0x12')]=function(_0xe7c355){if(_0xe7c355[_0x8c78('0x20')]===_0x8c78('0x21')){for(var _0x461eff in this['faxAccounts']){if(this['faxAccounts'][_0x8c78('0x22')](_0x461eff)){if(_0xe7c355['exten']===this['faxAccounts'][_0x461eff][_0x8c78('0x23')]){this['channels'][_0xe7c355[_0x8c78('0x24')]]={};this[_0x8c78('0xe')][_0xe7c355['uniqueid']][_0x8c78('0x25')]=_0xe7c355['channel'];this[_0x8c78('0xe')][_0xe7c355[_0x8c78('0x24')]]['id']=this['faxAccounts'][_0x461eff]['id'];this[_0x8c78('0xe')][_0xe7c355[_0x8c78('0x24')]]['name']=this[_0x8c78('0xf')][_0x461eff][_0x8c78('0x26')];logger[_0x8c78('0x27')](_0xe7c355[_0x8c78('0x24')],_0x8c78('0x28'));}}}}if(this[_0x8c78('0x11')][_0xe7c355[_0x8c78('0x24')]]){this[_0x8c78('0xe')][_0xe7c355[_0x8c78('0x24')]]={};this['channels'][_0xe7c355[_0x8c78('0x24')]][_0x8c78('0x25')]=_0xe7c355[_0x8c78('0x25')];logger['info'](_0xe7c355[_0x8c78('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x8c78('0x1f')][_0x8c78('0x14')]=function(_0x8d9ff9){if(this['channels'][_0x8d9ff9[_0x8c78('0x24')]]){for(var _0x2568d5 in _0x8d9ff9['variable']){if(_0x8d9ff9[_0x8c78('0x29')][_0x8c78('0x22')](_0x2568d5)){this[_0x8c78('0xe')][_0x8d9ff9[_0x8c78('0x24')]][_0x2568d5]=_0x8d9ff9[_0x8c78('0x2a')];}}}};Fax[_0x8c78('0x1f')]['syncNewState']=function(_0x1c3039){if(this['channels'][_0x1c3039[_0x8c78('0x24')]]){this[_0x8c78('0xe')][_0x1c3039[_0x8c78('0x24')]]['channelstate']=_0x1c3039[_0x8c78('0x2b')];this[_0x8c78('0xe')][_0x1c3039['uniqueid']][_0x8c78('0x2c')]=_0x1c3039[_0x8c78('0x2c')];}};Fax[_0x8c78('0x1f')]['syncNewExten']=function(_0x36ece0){if(this[_0x8c78('0xe')][_0x36ece0[_0x8c78('0x24')]]){for(var _0x5348ab in _0x36ece0[_0x8c78('0x29')]){if(_0x36ece0[_0x8c78('0x29')]['hasOwnProperty'](_0x5348ab)){this[_0x8c78('0xe')][_0x36ece0[_0x8c78('0x24')]][_0x5348ab]=_0x36ece0[_0x8c78('0x2a')];}}}};Fax[_0x8c78('0x1f')][_0x8c78('0x18')]=function(_0x5b5429){if(this[_0x8c78('0xe')][_0x5b5429[_0x8c78('0x24')]]){this[_0x8c78('0xe')][_0x5b5429[_0x8c78('0x24')]]['operation']=_0x5b5429[_0x8c78('0x2d')];this[_0x8c78('0xe')][_0x5b5429[_0x8c78('0x24')]][_0x8c78('0x2e')]=_0x5b5429[_0x8c78('0x2e')];this['channels'][_0x5b5429[_0x8c78('0x24')]][_0x8c78('0x23')]=_0x5b5429[_0x8c78('0x23')];this['channels'][_0x5b5429[_0x8c78('0x24')]][_0x8c78('0x2f')]=_0x5b5429['filename'];logger[_0x8c78('0x27')](_0x5b5429['uniqueid'],_0x8c78('0x30'));}};Fax[_0x8c78('0x1f')][_0x8c78('0x1a')]=function(_0x157b81){var _0x496104=this;if(this[_0x8c78('0xe')][_0x157b81['uniqueid']]){var _0x3b8f4f=this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]]['id'];this['channels'][_0x157b81['uniqueid']][_0x8c78('0x31')]=_0x157b81[_0x8c78('0x31')];this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]][_0x8c78('0x32')]=_0x157b81[_0x8c78('0x32')];this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]][_0x8c78('0x23')]=_0x157b81[_0x8c78('0x23')];this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]][_0x8c78('0x33')]=_0x157b81['resolution'];this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]]['transferrate']=_0x157b81['transferrate'];this[_0x8c78('0xe')][_0x157b81[_0x8c78('0x24')]]['filename']=_0x157b81[_0x8c78('0x2f')];this[_0x8c78('0xe')][_0x157b81['uniqueid']][_0x8c78('0x34')]=_0x157b81[_0x8c78('0x34')];if(this['channels'][_0x157b81[_0x8c78('0x24')]][_0x8c78('0x32')]>0x0){tiff2pdf(_0x157b81[_0x8c78('0x2f')],_0x8c78('0x35'),function(_0x3dfb4b){logger['info'](_0x157b81['uniqueid'],_0x8c78('0x36'),_0x3dfb4b[_0x8c78('0x37')]);attachment[_0x8c78('0x38')]({'name':path[_0x8c78('0x39')](_0x157b81[_0x8c78('0x2f')])[_0x8c78('0x26')],'basename':path[_0x8c78('0x39')](_0x157b81[_0x8c78('0x2f')])[_0x8c78('0x26')]+_0x8c78('0x3a'),'type':_0x8c78('0x3b')})['then'](function(_0x1015bf){faxAccount[_0x8c78('0x3c')](_0x3b8f4f,{'from':_0x157b81[_0x8c78('0x34')],'mapKey':_0x8c78('0x7'),'body':path[_0x8c78('0x39')](_0x157b81['filename'])[_0x8c78('0x26')]+_0x8c78('0x3a'),'AttachmentId':_0x1015bf['id']})[_0x8c78('0x3d')](function(_0x267f87){logger[_0x8c78('0x3e')](_0x157b81['uniqueid'],_0x8c78('0x3f'),JSON['stringify'](_0x267f87));});})['catch'](function(_0x4467fb){logger[_0x8c78('0x3e')](_0x157b81[_0x8c78('0x24')],'\x20receiveFax\x20',JSON[_0x8c78('0x40')](_0x4467fb));});});}logger[_0x8c78('0x27')](_0x157b81[_0x8c78('0x24')],_0x8c78('0x41'));}};Fax[_0x8c78('0x1f')][_0x8c78('0x1e')]=function(_0x26103c){if(this[_0x8c78('0x11')][_0x26103c[_0x8c78('0x24')]]){_['merge'](this[_0x8c78('0xe')][_0x26103c[_0x8c78('0x24')]],_[_0x8c78('0x42')](_0x26103c,[_0x8c78('0x43'),'reason']));}};function updateStatus(_0x2fa61e){if(_0x2fa61e[_0x8c78('0x44')]){faxMessage[_0x8c78('0x45')](_0x2fa61e[_0x8c78('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x8c78('0x46')](function(_0x38f7af){ut[_0x8c78('0x47')]('[Fax][Message][Error][Updated]',_0x38f7af);})[_0x8c78('0x3d')](function(_0x5ee4f5){ut[_0x8c78('0x47')](_0x8c78('0x48'),_0x5ee4f5);});}else{ut[_0x8c78('0x47')](_0x8c78('0x49'));}}Fax[_0x8c78('0x1f')][_0x8c78('0x4a')]=function(_0xf68e0,_0x38fec1,_0x19d807){var _0x454e97=this;var _0x23e568={};if(_0x38fec1){_0x23e568={'read':_0x38fec1};}else{_0x23e568={'failMessage':_0x19d807};}if(this[_0x8c78('0x11')][_0xf68e0][_0x8c78('0x44')]){faxMessage[_0x8c78('0x45')](this['actions'][_0xf68e0][_0x8c78('0x44')],_0x23e568)[_0x8c78('0x46')](function(_0x11c490){ut[_0x8c78('0x47')]('[Fax][Message][Updated]',_0x11c490);})[_0x8c78('0x3d')](function(_0x32fa95){ut[_0x8c78('0x47')](_0x8c78('0x4b'),_0x32fa95);})[_0x8c78('0x4c')](function(){delete _0x454e97[_0x8c78('0xe')][_0xf68e0];delete _0x454e97['actions'][_0xf68e0];});}else{ut[_0x8c78('0x47')](_0x8c78('0x4d'));delete this['channels'][_0xf68e0];delete this[_0x8c78('0x11')][_0xf68e0];}};Fax['prototype'][_0x8c78('0x1c')]=function(_0x2a7149){var _0x257533=this;if(this[_0x8c78('0xe')][_0x2a7149[_0x8c78('0x24')]]){if(this[_0x8c78('0x11')][_0x2a7149[_0x8c78('0x24')]]){this['channels'][_0x2a7149[_0x8c78('0x24')]]['id']=this[_0x8c78('0x11')][_0x2a7149['uniqueid']]['id'];this[_0x8c78('0xe')][_0x2a7149[_0x8c78('0x24')]]['name']=this[_0x8c78('0x11')][_0x2a7149[_0x8c78('0x24')]][_0x8c78('0x26')];}logger[_0x8c78('0x27')](_0x2a7149[_0x8c78('0x24')],this[_0x8c78('0x11')][_0x2a7149[_0x8c78('0x24')]]?_0x8c78('0x4e'):_0x8c78('0x4f'),JSON[_0x8c78('0x40')](this[_0x8c78('0xe')][_0x2a7149[_0x8c78('0x24')]]));if(this[_0x8c78('0x11')][_0x2a7149[_0x8c78('0x24')]]){if(this['channels'][_0x2a7149[_0x8c78('0x24')]]['faxpages']>0x0&&this[_0x8c78('0xe')][_0x2a7149['uniqueid']]['faxstatus']==='SUCCESS'){this[_0x8c78('0x4a')](_0x2a7149['uniqueid'],!![]);}else{this['updateStatus'](_0x2a7149['uniqueid'],![],this[_0x8c78('0xe')][_0x2a7149[_0x8c78('0x24')]][_0x8c78('0x50')]?_0x8c78('0x51')+this['channels'][_0x2a7149[_0x8c78('0x24')]][_0x8c78('0x50')]:_0x8c78('0x52'));}}}};Fax[_0x8c78('0x1f')][_0x8c78('0x53')]=function(_0x3c3332){var _0x3990c2=this;return new BPromise(function(_0x54d561,_0x25c255){_0x3990c2[_0x8c78('0x54')](_0x3c3332,_0x3990c2[_0x8c78('0xf')][_0x3c3332[_0x8c78('0x55')]])[_0x8c78('0x46')](function(_0x37da1f){ut['logger'](_0x8c78('0x56'),_0x37da1f);_0x54d561(ut['message'](_0x8c78('0x57')));})[_0x8c78('0x3d')](function(_0x420ccf){ut['logger'](_0x8c78('0x58'),_0x420ccf);updateStatus(_0x3c3332);_0x25c255(ut[_0x8c78('0x37')](_0x8c78('0x59')));});});};Fax['prototype'][_0x8c78('0x5a')]=function(_0x2240cd){var _0x55d0ac=this;return new BPromise(function(_0xbfafd1,_0x2ee94b){var _0x1763a7=_0x55d0ac['checkTrunk'](_0x55d0ac[_0x8c78('0xf')][_0x2240cd[_0x8c78('0x55')]][_0x8c78('0x5b')],_0x2240cd);if(_0x1763a7[_0x8c78('0x5c')]){_0xbfafd1(ut[_0x8c78('0x37')](_0x8c78('0x5d')));}else{_0x2ee94b(ut[_0x8c78('0x37')](_0x1763a7[_0x8c78('0x37')]));}});};function originate(_0x240f1e,_0x5646ff,_0x1f2b8f){return new BPromise(function(_0x21b400,_0x3c6886){if(_0x1f2b8f){var _0x2c20d1=util[_0x8c78('0x5e')](_0x8c78('0x5f'),path[_0x8c78('0x39')](_0x240f1e[_0x8c78('0x3')])[_0x8c78('0x26')],_0x240f1e['path']);gs[_0x8c78('0x60')](_0x2c20d1)[_0x8c78('0x46')](function(){_0x240f1e['path']=util['format'](_0x8c78('0x61'),path['parse'](_0x240f1e[_0x8c78('0x3')])[_0x8c78('0x62')],path[_0x8c78('0x39')](_0x240f1e[_0x8c78('0x3')])[_0x8c78('0x26')]);_0x5646ff[_0x8c78('0x63')]=_0x240f1e['path'];ut['logger'](_0x8c78('0x64'),'');ami[_0x8c78('0x65')](ut[_0x8c78('0x66')](_0x240f1e,_0x5646ff))[_0x8c78('0x46')](function(_0x2c35c7){_0x21b400(_0x2c35c7);})['catch'](function(_0x41adf0){_0x3c6886(_0x41adf0);});})[_0x8c78('0x3d')](function(_0x3c8b20){_0x3c6886(_0x3c8b20);});}else{ami[_0x8c78('0x65')](ut[_0x8c78('0x66')](_0x240f1e,_0x5646ff))[_0x8c78('0x46')](function(_0x5d92c8){_0x21b400(_0x5d92c8);})[_0x8c78('0x3d')](function(_0x155725){_0x3c6886(_0x155725);});}});}Fax['prototype'][_0x8c78('0x54')]=function(_0x13205e,_0xae45a8){var _0x1f3f8b=this;return new BPromise(function(_0x3f2496,_0x44ee41){var _0x35bce4=uuid['v4']();var _0x3b4874=ut[_0x8c78('0x67')](_0x13205e,_0xae45a8);_0x1f3f8b[_0x8c78('0x11')][_0x35bce4]=new Action(_0x35bce4,_0xae45a8,_0x13205e);var _0x280a8b=_0x1f3f8b[_0x8c78('0x11')][_0x35bce4];if(path[_0x8c78('0x39')](_0x13205e[_0x8c78('0x3')])[_0x8c78('0x68')]===_0x8c78('0x3a')){originate(_0x280a8b,_0x3b4874,!![])[_0x8c78('0x46')](function(_0x4c6cc5){_0x3f2496(_0x4c6cc5);})[_0x8c78('0x3d')](function(_0x4da5dc){_0x44ee41(_0x4da5dc);});}else{originate(_0x280a8b,_0x3b4874,![])['then'](function(_0xdb2d67){_0x3f2496(_0xdb2d67);})[_0x8c78('0x3d')](function(_0x2e540b){_0x44ee41(_0x2e540b);});}});};Fax[_0x8c78('0x1f')]['isTrunkReachable']=function(_0x2779ad){return!_[_0x8c78('0x69')](_0x2779ad)&&!_[_0x8c78('0x69')](_0x2779ad['name'])&&!_[_0x8c78('0x69')](_0x2779ad[_0x8c78('0x6a')])&&_0x2779ad[_0x8c78('0x6a')]&&!_[_0x8c78('0x69')](this['trunks'][util[_0x8c78('0x5e')](_0x8c78('0x6b'),_0x2779ad['name'])])&&!_['isNil'](this['trunks'][util[_0x8c78('0x5e')](_0x8c78('0x6b'),_0x2779ad[_0x8c78('0x26')])][_0x8c78('0x2e')])&&(this['trunks'][util[_0x8c78('0x5e')]('SIP/%s',_0x2779ad[_0x8c78('0x26')])][_0x8c78('0x2e')]===_0x8c78('0x6c')||this[_0x8c78('0x10')][util[_0x8c78('0x5e')](_0x8c78('0x6b'),_0x2779ad['name'])]['status']==='unmonitored');};Fax[_0x8c78('0x1f')][_0x8c78('0x6d')]=function(_0x53b653,_0xb40796){if(!this[_0x8c78('0x6e')](_0x53b653)){ut[_0x8c78('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x8c78('0x69')](_0x53b653)?'':_0x53b653['name']+_0x8c78('0x6f'));return{'isValid':![],'message':_0x8c78('0x70')};}if(_[_0x8c78('0x69')](_0xb40796[_0x8c78('0x7')])){ut[_0x8c78('0x47')](_0x8c78('0x71'),JSON[_0x8c78('0x40')](_0xb40796));return{'isValid':![],'message':_0x8c78('0x72')};}if(_[_0x8c78('0x69')](_0xb40796[_0x8c78('0x3')])){ut[_0x8c78('0x47')](_0x8c78('0x73'),JSON['stringify'](_0xb40796));return{'isValid':![],'message':_0x8c78('0x74')};}return{'isValid':!![],'message':_0x8c78('0x75')};};module[_0x8c78('0x76')]=Fax; \ No newline at end of file +var _0x69d3=['syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','syncOriginateResponse','prototype','context','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','../../../config/logger','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','syncNewState'];(function(_0xbca777,_0x242a64){var _0x20c416=function(_0x5fb465){while(--_0x5fb465){_0xbca777['push'](_0xbca777['shift']());}};_0x20c416(++_0x242a64);}(_0x69d3,0xda));var _0x369d=function(_0x1a9283,_0x57eafc){_0x1a9283=_0x1a9283-0x0;var _0x5353fb=_0x69d3[_0x1a9283];return _0x5353fb;};'use strict';var util=require(_0x369d('0x0'));var _=require(_0x369d('0x1'));var BPromise=require(_0x369d('0x2'));var uuid=require('uuid');var moment=require(_0x369d('0x3'));var path=require(_0x369d('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x369d('0x5'))('fax');var ami=require('../ami');var rpcDb=require(_0x369d('0x6'));var Channel=require(_0x369d('0x7'));var ut=require(_0x369d('0x8'));var Action=require(_0x369d('0x9'));var faxAccount=require(_0x369d('0xa'));var attachment=require(_0x369d('0xb'));var faxMessage=require(_0x369d('0xc'));function Fax(_0x2ac0ec){this[_0x369d('0xd')]={};this['faxAccounts']=_0x2ac0ec['faxAccounts'];this[_0x369d('0xe')]=_0x2ac0ec[_0x369d('0xe')];this[_0x369d('0xf')]={};ami['on'](_0x369d('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0x369d('0x11'),this[_0x369d('0x12')][_0x369d('0x13')](this));ami['on'](_0x369d('0x14'),this[_0x369d('0x15')][_0x369d('0x13')](this));ami['on']('newexten',this[_0x369d('0x16')][_0x369d('0x13')](this));ami['on'](_0x369d('0x17'),this[_0x369d('0x18')][_0x369d('0x13')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x369d('0x19'),this[_0x369d('0x1a')][_0x369d('0x13')](this));ami['on']('originateresponse',this[_0x369d('0x1b')][_0x369d('0x13')](this));}Fax[_0x369d('0x1c')]['syncNewchannel']=function(_0x368c05){if(_0x368c05[_0x369d('0x1d')]==='from-voip-provider'){for(var _0x572513 in this['faxAccounts']){if(this[_0x369d('0x1e')][_0x369d('0x1f')](_0x572513)){if(_0x368c05[_0x369d('0x20')]===this['faxAccounts'][_0x572513][_0x369d('0x21')]){this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]={};this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]['channel']=_0x368c05[_0x369d('0x23')];this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]['id']=this[_0x369d('0x1e')][_0x572513]['id'];this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]][_0x369d('0x24')]=this[_0x369d('0x1e')][_0x572513]['name'];logger['info'](_0x368c05[_0x369d('0x22')],_0x369d('0x25'));}}}}if(this[_0x369d('0xf')][_0x368c05[_0x369d('0x22')]]){this[_0x369d('0xd')][_0x368c05[_0x369d('0x22')]]={};this[_0x369d('0xd')][_0x368c05['uniqueid']]['channel']=_0x368c05[_0x369d('0x23')];logger[_0x369d('0x26')](_0x368c05[_0x369d('0x22')],_0x369d('0x25'));}};Fax[_0x369d('0x1c')][_0x369d('0x12')]=function(_0x8090b0){if(this['channels'][_0x8090b0[_0x369d('0x22')]]){for(var _0xe95742 in _0x8090b0[_0x369d('0x27')]){if(_0x8090b0[_0x369d('0x27')][_0x369d('0x1f')](_0xe95742)){this[_0x369d('0xd')][_0x8090b0[_0x369d('0x22')]][_0xe95742]=_0x8090b0['value'];}}}};Fax[_0x369d('0x1c')]['syncNewState']=function(_0x57b94c){if(this[_0x369d('0xd')][_0x57b94c[_0x369d('0x22')]]){this['channels'][_0x57b94c[_0x369d('0x22')]]['channelstate']=_0x57b94c[_0x369d('0x28')];this[_0x369d('0xd')][_0x57b94c[_0x369d('0x22')]][_0x369d('0x29')]=_0x57b94c[_0x369d('0x29')];}};Fax[_0x369d('0x1c')][_0x369d('0x16')]=function(_0x47f60c){if(this[_0x369d('0xd')][_0x47f60c[_0x369d('0x22')]]){for(var _0x219faf in _0x47f60c[_0x369d('0x27')]){if(_0x47f60c[_0x369d('0x27')][_0x369d('0x1f')](_0x219faf)){this[_0x369d('0xd')][_0x47f60c[_0x369d('0x22')]][_0x219faf]=_0x47f60c['value'];}}}};Fax[_0x369d('0x1c')][_0x369d('0x18')]=function(_0x376abf){if(this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]]){this['channels'][_0x376abf[_0x369d('0x22')]][_0x369d('0x2a')]=_0x376abf[_0x369d('0x2a')];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x2b')]=_0x376abf['status'];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x21')]=_0x376abf[_0x369d('0x21')];this[_0x369d('0xd')][_0x376abf[_0x369d('0x22')]][_0x369d('0x2c')]=_0x376abf[_0x369d('0x2c')];logger[_0x369d('0x26')](_0x376abf[_0x369d('0x22')],_0x369d('0x2d'));}};Fax[_0x369d('0x1c')][_0x369d('0x2e')]=function(_0x43d734){var _0x56922d=this;if(this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]]){var _0x69c7af=this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]]['id'];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x2f')]=_0x43d734[_0x369d('0x2f')];this['channels'][_0x43d734['uniqueid']][_0x369d('0x30')]=_0x43d734[_0x369d('0x30')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x21')]=_0x43d734[_0x369d('0x21')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x31')]=_0x43d734['resolution'];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x32')]=_0x43d734[_0x369d('0x32')];this[_0x369d('0xd')][_0x43d734[_0x369d('0x22')]][_0x369d('0x2c')]=_0x43d734[_0x369d('0x2c')];this['channels'][_0x43d734['uniqueid']][_0x369d('0x33')]=_0x43d734[_0x369d('0x33')];if(this[_0x369d('0xd')][_0x43d734['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x43d734['filename'],_0x369d('0x34'),function(_0x6e8477){logger['info'](_0x43d734[_0x369d('0x22')],_0x369d('0x35'),_0x6e8477[_0x369d('0x36')]);attachment[_0x369d('0x37')]({'name':path['parse'](_0x43d734[_0x369d('0x2c')])['name'],'basename':path[_0x369d('0x38')](_0x43d734['filename'])[_0x369d('0x24')]+_0x369d('0x39'),'type':_0x369d('0x3a')})['then'](function(_0x4e5df6){faxAccount[_0x369d('0x3b')](_0x69c7af,{'from':_0x43d734[_0x369d('0x33')],'mapKey':_0x369d('0x3c'),'body':path['parse'](_0x43d734[_0x369d('0x2c')])[_0x369d('0x24')]+_0x369d('0x39'),'AttachmentId':_0x4e5df6['id']})[_0x369d('0x3d')](function(_0x34e2e4){logger[_0x369d('0x3e')](_0x43d734[_0x369d('0x22')],_0x369d('0x3f'),JSON[_0x369d('0x40')](_0x34e2e4));});})['catch'](function(_0x11ce32){logger[_0x369d('0x3e')](_0x43d734[_0x369d('0x22')],_0x369d('0x41'),JSON[_0x369d('0x40')](_0x11ce32));});});}logger[_0x369d('0x26')](_0x43d734['uniqueid'],_0x369d('0x41'));}};Fax[_0x369d('0x1c')][_0x369d('0x1b')]=function(_0x44a357){if(this[_0x369d('0xf')][_0x44a357[_0x369d('0x22')]]){_[_0x369d('0x42')](this[_0x369d('0xd')][_0x44a357[_0x369d('0x22')]],_[_0x369d('0x43')](_0x44a357,[_0x369d('0x44'),_0x369d('0x45')]));}};function updateStatus(_0x573774){if(_0x573774[_0x369d('0x46')]){faxMessage[_0x369d('0x47')](_0x573774[_0x369d('0x46')],{'failMessage':_0x369d('0x48')})[_0x369d('0x49')](function(_0x4b41e5){ut[_0x369d('0x4a')]('[Fax][Message][Error][Updated]',_0x4b41e5);})[_0x369d('0x3d')](function(_0x2709f7){ut[_0x369d('0x4a')](_0x369d('0x4b'),_0x2709f7);});}else{ut[_0x369d('0x4a')](_0x369d('0x4c'));}}Fax[_0x369d('0x1c')][_0x369d('0x4d')]=function(_0x1cdeca,_0x9f1544,_0x4d582a){var _0x5a3dd4=this;var _0x203750={};if(_0x9f1544){_0x203750={'read':_0x9f1544};}else{_0x203750={'failMessage':_0x4d582a};}if(this[_0x369d('0xf')][_0x1cdeca][_0x369d('0x46')]){faxMessage[_0x369d('0x47')](this[_0x369d('0xf')][_0x1cdeca]['AttachmentId'],_0x203750)['then'](function(_0x4215ff){ut[_0x369d('0x4a')]('[Fax][Message][Updated]',_0x4215ff);})[_0x369d('0x3d')](function(_0x49c3b5){ut[_0x369d('0x4a')](_0x369d('0x4e'),_0x49c3b5);})[_0x369d('0x4f')](function(){delete _0x5a3dd4['channels'][_0x1cdeca];delete _0x5a3dd4[_0x369d('0xf')][_0x1cdeca];});}else{ut[_0x369d('0x4a')](_0x369d('0x50'));delete this[_0x369d('0xd')][_0x1cdeca];delete this['actions'][_0x1cdeca];}};Fax['prototype'][_0x369d('0x1a')]=function(_0x476ee8){var _0x35667d=this;if(this['channels'][_0x476ee8[_0x369d('0x22')]]){if(this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]]){this['channels'][_0x476ee8['uniqueid']]['id']=this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]]['id'];this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]]['name']=this[_0x369d('0xf')][_0x476ee8[_0x369d('0x22')]][_0x369d('0x24')];}logger[_0x369d('0x26')](_0x476ee8[_0x369d('0x22')],this['actions'][_0x476ee8[_0x369d('0x22')]]?_0x369d('0x51'):_0x369d('0x52'),JSON['stringify'](this[_0x369d('0xd')][_0x476ee8['uniqueid']]));if(this[_0x369d('0xf')][_0x476ee8['uniqueid']]){if(this['channels'][_0x476ee8['uniqueid']]['faxpages']>0x0&&this[_0x369d('0xd')][_0x476ee8['uniqueid']][_0x369d('0x17')]==='SUCCESS'){this[_0x369d('0x4d')](_0x476ee8[_0x369d('0x22')],!![]);}else{this[_0x369d('0x4d')](_0x476ee8['uniqueid'],![],this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]][_0x369d('0x53')]?_0x369d('0x54')+this[_0x369d('0xd')][_0x476ee8[_0x369d('0x22')]]['faxstatusstring']:_0x369d('0x55'));}}}};Fax['prototype']['send']=function(_0x56c98e){var _0x36e990=this;return new BPromise(function(_0xab8c70,_0xde27de){_0x36e990[_0x369d('0x56')](_0x56c98e,_0x36e990[_0x369d('0x1e')][_0x56c98e[_0x369d('0x57')]])[_0x369d('0x49')](function(_0x3fe68c){ut[_0x369d('0x4a')](_0x369d('0x58'),_0x3fe68c);_0xab8c70(ut[_0x369d('0x36')](_0x369d('0x59')));})[_0x369d('0x3d')](function(_0x7ba3e5){ut[_0x369d('0x4a')](_0x369d('0x5a'),_0x7ba3e5);updateStatus(_0x56c98e);_0xde27de(ut['message'](_0x369d('0x5b')));});});};Fax['prototype'][_0x369d('0x5c')]=function(_0x2ecc06){var _0x2492fb=this;return new BPromise(function(_0x38efd7,_0x23dcd9){var _0x561331=_0x2492fb[_0x369d('0x5d')](_0x2492fb['faxAccounts'][_0x2ecc06['FaxAccountId']][_0x369d('0x5e')],_0x2ecc06);if(_0x561331[_0x369d('0x5f')]){_0x38efd7(ut[_0x369d('0x36')](_0x369d('0x60')));}else{_0x23dcd9(ut[_0x369d('0x36')](_0x561331[_0x369d('0x36')]));}});};function originate(_0x341d93,_0x11ac7d,_0x55a811){return new BPromise(function(_0x461782,_0x24e70d){if(_0x55a811){var _0x4c741d=util[_0x369d('0x61')](_0x369d('0x62'),path[_0x369d('0x38')](_0x341d93['path'])[_0x369d('0x24')],_0x341d93['path']);gs[_0x369d('0x63')](_0x4c741d)[_0x369d('0x49')](function(){_0x341d93[_0x369d('0x4')]=util[_0x369d('0x61')](_0x369d('0x64'),path[_0x369d('0x38')](_0x341d93[_0x369d('0x4')])['dir'],path[_0x369d('0x38')](_0x341d93[_0x369d('0x4')])['name']);_0x11ac7d[_0x369d('0x65')]=_0x341d93['path'];ut[_0x369d('0x4a')](_0x369d('0x66'),'');ami[_0x369d('0x67')](ut['variablesAction'](_0x341d93,_0x11ac7d))[_0x369d('0x49')](function(_0x2cbe15){_0x461782(_0x2cbe15);})['catch'](function(_0x8740ed){_0x24e70d(_0x8740ed);});})[_0x369d('0x3d')](function(_0xb94d21){_0x24e70d(_0xb94d21);});}else{ami['Action'](ut[_0x369d('0x68')](_0x341d93,_0x11ac7d))[_0x369d('0x49')](function(_0x3db9b9){_0x461782(_0x3db9b9);})[_0x369d('0x3d')](function(_0x46c137){_0x24e70d(_0x46c137);});}});}Fax['prototype'][_0x369d('0x56')]=function(_0xa05657,_0x45fadd){var _0x4560d8=this;return new BPromise(function(_0x1e0a41,_0x5ebc42){var _0x586972=uuid['v4']();var _0x3c8615=ut[_0x369d('0x69')](_0xa05657,_0x45fadd);_0x4560d8[_0x369d('0xf')][_0x586972]=new Action(_0x586972,_0x45fadd,_0xa05657);var _0x11b348=_0x4560d8[_0x369d('0xf')][_0x586972];if(path[_0x369d('0x38')](_0xa05657['path'])[_0x369d('0x6a')]===_0x369d('0x39')){originate(_0x11b348,_0x3c8615,!![])['then'](function(_0x6c8235){_0x1e0a41(_0x6c8235);})['catch'](function(_0x4936eb){_0x5ebc42(_0x4936eb);});}else{originate(_0x11b348,_0x3c8615,![])['then'](function(_0x2b791a){_0x1e0a41(_0x2b791a);})[_0x369d('0x3d')](function(_0x5b2c2f){_0x5ebc42(_0x5b2c2f);});}});};Fax[_0x369d('0x1c')]['isTrunkReachable']=function(_0x26faf4){return!_['isNil'](_0x26faf4)&&!_['isNil'](_0x26faf4[_0x369d('0x24')])&&!_[_0x369d('0x6b')](_0x26faf4[_0x369d('0x6c')])&&_0x26faf4[_0x369d('0x6c')]&&!_[_0x369d('0x6b')](this['trunks'][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])])&&!_[_0x369d('0x6b')](this[_0x369d('0xe')][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')])&&(this['trunks'][util[_0x369d('0x61')](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')]==='reachable'||this[_0x369d('0xe')][util['format'](_0x369d('0x6d'),_0x26faf4[_0x369d('0x24')])][_0x369d('0x2b')]===_0x369d('0x6e'));};Fax[_0x369d('0x1c')][_0x369d('0x5d')]=function(_0x3fa663,_0x3582fe){if(!this[_0x369d('0x6f')](_0x3fa663)){ut[_0x369d('0x4a')](_0x369d('0x70'),_[_0x369d('0x6b')](_0x3fa663)?'':_0x3fa663[_0x369d('0x24')]+_0x369d('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x369d('0x6b')](_0x3582fe['fax'])){ut['logger'](_0x369d('0x72'),JSON[_0x369d('0x40')](_0x3582fe));return{'isValid':![],'message':_0x369d('0x73')};}if(_[_0x369d('0x6b')](_0x3582fe[_0x369d('0x4')])){ut[_0x369d('0x4a')](_0x369d('0x74'),JSON[_0x369d('0x40')](_0x3582fe));return{'isValid':![],'message':_0x369d('0x75')};}return{'isValid':!![],'message':_0x369d('0x76')};};module[_0x369d('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f68f2d6..717e9f6 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 _0xeb3d=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','catch','[Notify]\x20','bluebird'];(function(_0x130209,_0x2cc129){var _0x155fb7=function(_0x891a60){while(--_0x891a60){_0x130209['push'](_0x130209['shift']());}};_0x155fb7(++_0x2cc129);}(_0xeb3d,0x15d));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var BPromise=require(_0xdeb3('0x0'));var logger=require(_0xdeb3('0x1'))(_0xdeb3('0x2'));var _=require(_0xdeb3('0x3'));var faxAccount=require(_0xdeb3('0x4'));function loggerCatch(_0x18b0eb){return function(_0x1e3b3c){logger[_0xdeb3('0x5')](_0x18b0eb,util[_0xdeb3('0x6')](_0x1e3b3c,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x27e13c,_0x5673a9){return BPromise['resolve']()['then'](faxAccount[_0xdeb3('0x7')](_0x27e13c,_0x5673a9))[_0xdeb3('0x8')](loggerCatch(_0xdeb3('0x9')));}; \ No newline at end of file +var _0xeeb4=['[Notify]\x20','../../../config/logger','preview','lodash','then','notify'];(function(_0x40ee2c,_0x4e13bf){var _0x587b92=function(_0x13eb75){while(--_0x13eb75){_0x40ee2c['push'](_0x40ee2c['shift']());}};_0x587b92(++_0x4e13bf);}(_0xeeb4,0x6d));var _0x4eeb=function(_0x2df351,_0x570c47){_0x2df351=_0x2df351-0x0;var _0x546291=_0xeeb4[_0x2df351];return _0x546291;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4eeb('0x0'))(_0x4eeb('0x1'));var _=require(_0x4eeb('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x9a5184){return function(_0x5bde8){logger['error'](_0x9a5184,util['inspect'](_0x5bde8,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xd5f618,_0x2c09ec){return BPromise['resolve']()[_0x4eeb('0x3')](faxAccount[_0x4eeb('0x4')](_0xd5f618,_0x2c09ec))['catch'](loggerCatch(_0x4eeb('0x5')));}; \ 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 3b0ff8c..1844944 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 _0x2220=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs'];(function(_0x102cd9,_0x2b9210){var _0x443cc2=function(_0x59f60b){while(--_0x59f60b){_0x102cd9['push'](_0x102cd9['shift']());}};_0x443cc2(++_0x2b9210);}(_0x2220,0x17e));var _0x0222=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2220[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x0222('0x0'));var logger=require(_0x0222('0x1'))(_0x0222('0x2'));var BPromise=require(_0x0222('0x3'));var exec=require(_0x0222('0x4'))[_0x0222('0x5')];exports['execute']=function(_0x484e3){return new BPromise(function(_0x2f1f4d,_0x47fdf5){exec(_0x484e3,function(_0x100b39,_0x12104f,_0x2abf3e){logger[_0x0222('0x6')]('Exec\x20gs',_0x12104f);if(_0x100b39){logger['info'](_0x0222('0x7'),_0x0222('0x8'),util[_0x0222('0x9')](_0x100b39,{'showHidden':![],'depth':null}),_0x12104f,_0x2abf3e);_0x47fdf5(_0x100b39);}_0x2f1f4d(_0x12104f);});});}; \ No newline at end of file +var _0x936c=['exec','info','\x20Error\x20:','inspect','util','../../../../config/logger','child_process'];(function(_0x2eeb31,_0x4917f5){var _0x13f89b=function(_0x5cc746){while(--_0x5cc746){_0x2eeb31['push'](_0x2eeb31['shift']());}};_0x13f89b(++_0x4917f5);}(_0x936c,0xa5));var _0xc936=function(_0x57ca08,_0x211928){_0x57ca08=_0x57ca08-0x0;var _0x21fc92=_0x936c[_0x57ca08];return _0x21fc92;};'use strict';var util=require(_0xc936('0x0'));var logger=require(_0xc936('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0xc936('0x2'))[_0xc936('0x3')];exports['execute']=function(_0x3d20da){return new BPromise(function(_0x24d184,_0x5da620){exec(_0x3d20da,function(_0x1fb24f,_0x3b5383,_0x27b6ca){logger[_0xc936('0x4')]('Exec\x20gs',_0x3b5383);if(_0x1fb24f){logger[_0xc936('0x4')]('Exec\x20gs',_0xc936('0x5'),util[_0xc936('0x6')](_0x1fb24f,{'showHidden':![],'depth':null}),_0x3b5383,_0x27b6ca);_0x5da620(_0x1fb24f);}_0x24d184(_0x3b5383);});});}; \ 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 1bc0400..00ee86c 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 _0xc66c=['gateway','path','variablesAction','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid','util','../../../../config/logger','fax','message','logger','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xc66c,0x77));var _0xcc66=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc66c[_0x126558];return _0x1f6d14;};'use strict';var util=require(_0xcc66('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xcc66('0x1'))(_0xcc66('0x2'));exports[_0xcc66('0x3')]=function(_0x899087){return{'message':_0x899087};};exports[_0xcc66('0x4')]=function(_0x272546,_0x4ccad3){logger['info'](_0x272546,util['inspect'](_0x4ccad3,{'showHidden':![],'depth':null}));};exports[_0xcc66('0x5')]=function(_0x2472d6,_0x35a04f){var _0xc7ab={'XMF-ECM':_0x35a04f[_0xcc66('0x6')],'XMF-HEADERINFO':_0x35a04f[_0xcc66('0x7')],'XMF-MINRATE':_0x35a04f[_0xcc66('0x8')],'XMF-MAXRATE':_0x35a04f[_0xcc66('0x9')],'XMF-MODEM':util[_0xcc66('0xa')](_0xcc66('0xb'),_0x35a04f[_0xcc66('0xc')]),'XMF-GATEWAY':_0x35a04f[_0xcc66('0xd')],'XMF-FAXDETECT':_0x35a04f['faxdetect'],'XMF-T38TIMEOUT':_0x35a04f['t38timeout'],'XMF-LOCALSTATIONID':_0x35a04f['localstationid'],'XMF-PATH':_0x2472d6[_0xcc66('0xe')]};return _0xc7ab;};exports[_0xcc66('0xf')]=function(_0xe54325,_0x15d8f2){return{'actionid':_0xe54325['uniqueid'],'action':'originate','channel':_0xe54325[_0xcc66('0x10')],'Exten':_0xcc66('0x11'),'Context':_0xcc66('0x12'),'Priority':'1','callerid':util[_0xcc66('0xa')](_0xcc66('0x13'),_0xe54325[_0xcc66('0x7')]?_0xe54325['headerinfo']:'',_0xe54325[_0xcc66('0x14')]),'variable':_0x15d8f2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xe54325[_0xcc66('0x15')]};}; \ No newline at end of file +var _0x2f2d=['ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','variablesAction','originate','xcally-motion-fax','from-sip','localstationid','uniqueid','lodash','moment','../../../../config/logger','fax','message','logger','inspect','addVariables'];(function(_0x16bfc5,_0x4f9dc3){var _0x43b820=function(_0x363ced){while(--_0x363ced){_0x16bfc5['push'](_0x16bfc5['shift']());}};_0x43b820(++_0x4f9dc3);}(_0x2f2d,0xb8));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0xd2f2('0x0'));var moment=require(_0xd2f2('0x1'));var logger=require(_0xd2f2('0x2'))(_0xd2f2('0x3'));exports[_0xd2f2('0x4')]=function(_0x4ebf30){return{'message':_0x4ebf30};};exports[_0xd2f2('0x5')]=function(_0x3caf1c,_0x57959b){logger['info'](_0x3caf1c,util[_0xd2f2('0x6')](_0x57959b,{'showHidden':![],'depth':null}));};exports[_0xd2f2('0x7')]=function(_0x3fbf5e,_0x56f52a){var _0x19680d={'XMF-ECM':_0x56f52a[_0xd2f2('0x8')],'XMF-HEADERINFO':_0x56f52a[_0xd2f2('0x9')],'XMF-MINRATE':_0x56f52a[_0xd2f2('0xa')],'XMF-MAXRATE':_0x56f52a[_0xd2f2('0xb')],'XMF-MODEM':util[_0xd2f2('0xc')](_0xd2f2('0xd'),_0x56f52a[_0xd2f2('0xe')]),'XMF-GATEWAY':_0x56f52a[_0xd2f2('0xf')],'XMF-FAXDETECT':_0x56f52a[_0xd2f2('0x10')],'XMF-T38TIMEOUT':_0x56f52a[_0xd2f2('0x11')],'XMF-LOCALSTATIONID':_0x56f52a['localstationid'],'XMF-PATH':_0x3fbf5e['path']};return _0x19680d;};exports[_0xd2f2('0x12')]=function(_0x1a4de7,_0x4db0f2){return{'actionid':_0x1a4de7['uniqueid'],'action':_0xd2f2('0x13'),'channel':_0x1a4de7['channel'],'Exten':_0xd2f2('0x14'),'Context':_0xd2f2('0x15'),'Priority':'1','callerid':util[_0xd2f2('0xc')]('\x22%s\x22\x20<%s>',_0x1a4de7['headerinfo']?_0x1a4de7[_0xd2f2('0x9')]:'',_0x1a4de7[_0xd2f2('0x16')]),'variable':_0x4db0f2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a4de7[_0xd2f2('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4f1bdcf..2bf9ee6 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 _0xcbdc=['getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','bluebird','util','moment','./server','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates'];(function(_0x145eae,_0x2fc6a5){var _0x4c6a1f=function(_0x21f0f8){while(--_0x21f0f8){_0x145eae['push'](_0x145eae['shift']());}};_0x4c6a1f(++_0x2fc6a5);}(_0xcbdc,0xb7));var _0xccbd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcbdc[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require(_0xccbd('0x0'));var util=require(_0xccbd('0x1'));var moment=require(_0xccbd('0x2'));var server=require(_0xccbd('0x3'));var Realtime=require('./realtime');var Report=require(_0xccbd('0x4'));var Acw=require(_0xccbd('0x5'));var Trigger=require(_0xccbd('0x6'));var Dialer=require('./dialer');var Preview=require(_0xccbd('0x7'));var Fax=require(_0xccbd('0x8'));var user=require(_0xccbd('0x9'));var voiceQueue=require(_0xccbd('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xccbd('0xb'));var trunk=require(_0xccbd('0xc'));var trigger=require(_0xccbd('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xccbd('0xe'));var campaign=require(_0xccbd('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xccbd('0x10'));var zendesk=require(_0xccbd('0x11'));var salesforce=require(_0xccbd('0x12'));var sugarcrm=require(_0xccbd('0x13'));var freshdesk=require(_0xccbd('0x14'));var desk=require(_0xccbd('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xccbd('0x16'));var freshsales=require(_0xccbd('0x17'));var servicenow=require(_0xccbd('0x18'));var dynamics365=require(_0xccbd('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xccbd('0x1a'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xccbd('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xccbd('0x1b')](_0xccbd('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xccbd('0x1d')]()[_0xccbd('0x1e')](user[_0xccbd('0x1f')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x20')]())[_0xccbd('0x1e')](user[_0xccbd('0x21')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x22')]())[_0xccbd('0x1e')](trunk[_0xccbd('0x23')]())['then'](realtime[_0xccbd('0x24')]())[_0xccbd('0x1e')](voiceQueue[_0xccbd('0x25')]())[_0xccbd('0x1e')](realtime['initVoiceQueues']())['then'](trigger[_0xccbd('0x26')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x27')]())['then'](template[_0xccbd('0x28')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x29')]())[_0xccbd('0x1e')](zendesk[_0xccbd('0x2a')]())[_0xccbd('0x1e')](realtime['initZendeskAccounts']())[_0xccbd('0x1e')](salesforce[_0xccbd('0x2b')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x2c')]())[_0xccbd('0x1e')](sugarcrm[_0xccbd('0x2d')]())[_0xccbd('0x1e')](realtime['initSugarcrmAccounts']())[_0xccbd('0x1e')](freshdesk[_0xccbd('0x2e')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x2f')]())[_0xccbd('0x1e')](desk[_0xccbd('0x30')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x31')]())['then'](zoho[_0xccbd('0x32')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x33')]())['then'](vtiger['getVtigerAccounts']())[_0xccbd('0x1e')](realtime['initVtigerAccounts']())[_0xccbd('0x1e')](freshsales['getFreshsalesAccounts']())[_0xccbd('0x1e')](realtime[_0xccbd('0x34')]())[_0xccbd('0x1e')](servicenow[_0xccbd('0x35')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x36')]())[_0xccbd('0x1e')](dynamics365[_0xccbd('0x37')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x38')]())[_0xccbd('0x1e')](campaign[_0xccbd('0x39')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x3a')]())['then'](voiceExtension[_0xccbd('0x3b')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x3c')]())['then'](faxAccount[_0xccbd('0x3d')]())['then'](realtime[_0xccbd('0x3e')]())[_0xccbd('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xccbd('0x1e')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0xccbd('0x3f')]())['then'](cmHopperHistory[_0xccbd('0x40')]())['then'](realtime[_0xccbd('0x41')]())[_0xccbd('0x1e')](cmHopperHistory[_0xccbd('0x42')]())[_0xccbd('0x1e')](realtime['initCampaignHopperHistory']())[_0xccbd('0x1e')](voiceCallReport[_0xccbd('0x43')]())[_0xccbd('0x1e')](realtime[_0xccbd('0x44')]())[_0xccbd('0x45')](function(_0x5879aa){logger[_0xccbd('0x46')](_0xccbd('0x47'),util[_0xccbd('0x48')](_0x5879aa,{'showHidden':![],'depth':null}));});}function main(){return server[_0xccbd('0x49')](realtime,preview,fax)['then'](function(_0x55835f){return initRealtime();})[_0xccbd('0x1e')](function(){return initParams();})[_0xccbd('0x1e')](function(){report[_0xccbd('0x4a')]();setInterval(initRealtime,0x1388);})[_0xccbd('0x45')](function(_0x37330c){logger['error']('[index.js][main]',util[_0xccbd('0x48')](_0x37330c,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdfb3=['./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','initVoiceQueues','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','error','inspect','sync','util','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfb3,0xe2));var _0x3dfb=function(_0x1e23e2,_0x2c67d2){_0x1e23e2=_0x1e23e2-0x0;var _0x1398f4=_0xdfb3[_0x1e23e2];return _0x1398f4;};'use strict';var BPromise=require('bluebird');var util=require(_0x3dfb('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x3dfb('0x1'));var Trigger=require(_0x3dfb('0x2'));var Dialer=require('./dialer');var Preview=require(_0x3dfb('0x3'));var Fax=require(_0x3dfb('0x4'));var user=require(_0x3dfb('0x5'));var voiceQueue=require(_0x3dfb('0x6'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x3dfb('0x7'));var trigger=require('./rpc/trigger');var template=require(_0x3dfb('0x8'));var cmHopperHistory=require(_0x3dfb('0x9'));var campaign=require(_0x3dfb('0xa'));var voiceExtension=require(_0x3dfb('0xb'));var faxAccount=require(_0x3dfb('0xc'));var zendesk=require(_0x3dfb('0xd'));var salesforce=require(_0x3dfb('0xe'));var sugarcrm=require(_0x3dfb('0xf'));var freshdesk=require(_0x3dfb('0x10'));var desk=require(_0x3dfb('0x11'));var zoho=require(_0x3dfb('0x12'));var vtiger=require(_0x3dfb('0x13'));var freshsales=require(_0x3dfb('0x14'));var servicenow=require(_0x3dfb('0x15'));var dynamics365=require(_0x3dfb('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3dfb('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3dfb('0x17')](_0x3dfb('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3dfb('0x19')](user[_0x3dfb('0x1a')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x1b')]())[_0x3dfb('0x19')](user[_0x3dfb('0x1c')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x1d')]())[_0x3dfb('0x19')](trunk['getTrunks']())[_0x3dfb('0x19')](realtime[_0x3dfb('0x1e')]())['then'](voiceQueue['getVoiceQueues']())[_0x3dfb('0x19')](realtime[_0x3dfb('0x1f')]())[_0x3dfb('0x19')](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0x3dfb('0x19')](template[_0x3dfb('0x20')]())[_0x3dfb('0x19')](realtime['initTemplates']())[_0x3dfb('0x19')](zendesk[_0x3dfb('0x21')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x22')]())['then'](salesforce[_0x3dfb('0x23')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x3dfb('0x24')]())[_0x3dfb('0x19')](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x3dfb('0x19')](realtime[_0x3dfb('0x25')]())[_0x3dfb('0x19')](desk[_0x3dfb('0x26')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x27')]())['then'](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x3dfb('0x19')](vtiger[_0x3dfb('0x28')]())[_0x3dfb('0x19')](realtime['initVtigerAccounts']())['then'](freshsales[_0x3dfb('0x29')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x2a')]())[_0x3dfb('0x19')](servicenow['getServicenowAccounts']())[_0x3dfb('0x19')](realtime[_0x3dfb('0x2b')]())[_0x3dfb('0x19')](dynamics365[_0x3dfb('0x2c')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x2d')]())[_0x3dfb('0x19')](campaign[_0x3dfb('0x2e')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x2f')]())['then'](voiceExtension['getVoiceExtensions']())[_0x3dfb('0x19')](realtime[_0x3dfb('0x30')]())[_0x3dfb('0x19')](faxAccount[_0x3dfb('0x31')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x32')]())[_0x3dfb('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x3dfb('0x33')]()[_0x3dfb('0x19')](voiceQueueReport[_0x3dfb('0x34')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x35')]())[_0x3dfb('0x19')](cmHopperHistory[_0x3dfb('0x36')]())[_0x3dfb('0x19')](realtime[_0x3dfb('0x37')]())[_0x3dfb('0x19')](cmHopperHistory[_0x3dfb('0x38')]())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x3dfb('0x39')]())[_0x3dfb('0x19')](realtime['initVoiceCallReports']())[_0x3dfb('0x3a')](function(_0x54cbff){logger[_0x3dfb('0x3b')]('[index.js][initParams]',util[_0x3dfb('0x3c')](_0x54cbff,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x3dfb('0x19')](function(_0x4f8bd1){return initRealtime();})['then'](function(){return initParams();})[_0x3dfb('0x19')](function(){report[_0x3dfb('0x3d')]();setInterval(initRealtime,0x1388);})[_0x3dfb('0x3a')](function(_0x3d0585){logger['error']('[index.js][main]',util[_0x3dfb('0x3c')](_0x3d0585,{'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 75cd026..1f3ba6a 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x59bd53,_0x504f1c){var _0x50b459=function(_0x37e0ff){while(--_0x37e0ff){_0x59bd53['push'](_0x59bd53['shift']());}};_0x50b459(++_0x504f1c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xcb91[_0x263f4c];return _0x3a78d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0xd63b06,_0x34850f){var _0x343035=function(_0x17f681){while(--_0x17f681){_0xd63b06['push'](_0xd63b06['shift']());}};_0x343035(++_0x34850f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e23d1d3..996e10c 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 _0xd0f2=['active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays'];(function(_0x14757a,_0x3a11bc){var _0x5e8b72=function(_0x346e63){while(--_0x346e63){_0x14757a['push'](_0x14757a['shift']());}};_0x5e8b72(++_0x3a11bc);}(_0xd0f2,0x11b));var _0x2d0f=function(_0x248ee4,_0x4223e6){_0x248ee4=_0x248ee4-0x0;var _0x2fef92=_0xd0f2[_0x248ee4];return _0x2fef92;};'use strict';function Campaign(_0x26eb1c){this['id']=_0x26eb1c['id']||0x0;this[_0x2d0f('0x0')]=_0x26eb1c[_0x2d0f('0x0')]||'';this['type']=_0x26eb1c[_0x2d0f('0x1')]||_0x2d0f('0x2');this[_0x2d0f('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x2d0f('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x2d0f('0x5')]=_0x26eb1c[_0x2d0f('0x5')];this[_0x2d0f('0x6')]=_0x26eb1c[_0x2d0f('0x6')];this[_0x2d0f('0x7')]=_0x26eb1c[_0x2d0f('0x7')]||null;this['dialGlobalInterval']=_0x26eb1c['dialGlobalInterval']?_0x26eb1c[_0x2d0f('0x8')]:null;this[_0x2d0f('0x9')]=_0x26eb1c[_0x2d0f('0x9')];this[_0x2d0f('0xa')]=_0x26eb1c['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x26eb1c[_0x2d0f('0xb')]||0x1e;this[_0x2d0f('0xc')]=_0x26eb1c[_0x2d0f('0xc')];this[_0x2d0f('0xd')]=_0x26eb1c['dialCongestionRetryFrequency'];this[_0x2d0f('0xe')]=_0x26eb1c[_0x2d0f('0xe')];this[_0x2d0f('0xf')]=_0x26eb1c[_0x2d0f('0xf')];this[_0x2d0f('0x10')]=_0x26eb1c[_0x2d0f('0x10')];this['dialNoAnswerRetryFrequency']=_0x26eb1c[_0x2d0f('0x11')];this[_0x2d0f('0x12')]=_0x26eb1c[_0x2d0f('0x12')];this[_0x2d0f('0x13')]=_0x26eb1c[_0x2d0f('0x13')]||0x3;this[_0x2d0f('0x14')]=_0x26eb1c['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x26eb1c[_0x2d0f('0x15')]||0x3;this['dialDropRetryFrequency']=_0x26eb1c[_0x2d0f('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x26eb1c['dialAbandonedMaxRetry']||0x3;this[_0x2d0f('0x17')]=_0x26eb1c[_0x2d0f('0x17')]||0x96;this[_0x2d0f('0x18')]=_0x26eb1c[_0x2d0f('0x18')]||0x3;this[_0x2d0f('0x19')]=_0x26eb1c['dialMachineRetryFrequency']||0x96;this[_0x2d0f('0x1a')]=_0x26eb1c[_0x2d0f('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x26eb1c[_0x2d0f('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x26eb1c[_0x2d0f('0x1c')]||_0x2d0f('0x1d');this['dialPrefix']=_0x26eb1c[_0x2d0f('0x1e')]||undefined;this[_0x2d0f('0x1f')]=_0x26eb1c[_0x2d0f('0x1f')]||undefined;this[_0x2d0f('0x20')]=_0x26eb1c[_0x2d0f('0x20')]||undefined;this[_0x2d0f('0x21')]=_0x26eb1c[_0x2d0f('0x21')]?_0x26eb1c[_0x2d0f('0x21')]:undefined;this[_0x2d0f('0x22')]=_0x26eb1c[_0x2d0f('0x22')]?_0x26eb1c[_0x2d0f('0x22')]:undefined;this[_0x2d0f('0x23')]=_0x26eb1c['Interval']?_0x26eb1c[_0x2d0f('0x23')]:undefined;this[_0x2d0f('0x24')]=_0x26eb1c[_0x2d0f('0x24')]?_0x26eb1c[_0x2d0f('0x24')]:undefined;this['dialQueueProject']=_0x26eb1c[_0x2d0f('0x24')]?_0x26eb1c[_0x2d0f('0x24')][_0x2d0f('0x0')]:undefined;this[_0x2d0f('0x25')]=_0x26eb1c[_0x2d0f('0x25')]||![];this[_0x2d0f('0x26')]=_0x26eb1c[_0x2d0f('0x26')];this[_0x2d0f('0x27')]=_0x26eb1c['dialAMDGreeting'];this[_0x2d0f('0x28')]=_0x26eb1c[_0x2d0f('0x28')];this[_0x2d0f('0x29')]=_0x26eb1c[_0x2d0f('0x29')];this[_0x2d0f('0x2a')]=_0x26eb1c[_0x2d0f('0x2a')];this[_0x2d0f('0x2b')]=_0x26eb1c[_0x2d0f('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x26eb1c[_0x2d0f('0x2c')];this[_0x2d0f('0x2d')]=_0x26eb1c[_0x2d0f('0x2d')];this[_0x2d0f('0x2e')]=_0x26eb1c[_0x2d0f('0x2e')];}module[_0x2d0f('0x2f')]=Campaign; \ No newline at end of file +var _0xf8fd=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x6e7d02,_0x2e9bec){var _0x97d01=function(_0x3433be){while(--_0x3433be){_0x6e7d02['push'](_0x6e7d02['shift']());}};_0x97d01(++_0x2e9bec);}(_0xf8fd,0x70));var _0xdf8f=function(_0x9e872d,_0x2d8362){_0x9e872d=_0x9e872d-0x0;var _0x291dd1=_0xf8fd[_0x9e872d];return _0x291dd1;};'use strict';function Campaign(_0x173fda){this['id']=_0x173fda['id']||0x0;this['name']=_0x173fda[_0xdf8f('0x0')]||'';this[_0xdf8f('0x1')]=_0x173fda[_0xdf8f('0x1')]||_0xdf8f('0x2');this['originated']=0x0;this['temp']=0x0;this[_0xdf8f('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xdf8f('0x4')]='';this['sendMessageOneNotActive']=!![];this[_0xdf8f('0x5')]=_0x173fda[_0xdf8f('0x5')];this[_0xdf8f('0x6')]=_0x173fda['limitCalls'];this[_0xdf8f('0x7')]=_0x173fda[_0xdf8f('0x7')]||null;this[_0xdf8f('0x8')]=_0x173fda[_0xdf8f('0x8')]?_0x173fda[_0xdf8f('0x8')]:null;this['dialOriginateCallerIdName']=_0x173fda[_0xdf8f('0x9')];this[_0xdf8f('0xa')]=_0x173fda['dialOriginateCallerIdNumber'];this[_0xdf8f('0xb')]=_0x173fda['dialOriginateTimeout']||0x1e;this[_0xdf8f('0xc')]=_0x173fda['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x173fda[_0xdf8f('0xd')];this[_0xdf8f('0xe')]=_0x173fda['dialBusyMaxRetry'];this[_0xdf8f('0xf')]=_0x173fda[_0xdf8f('0xf')];this[_0xdf8f('0x10')]=_0x173fda['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x173fda[_0xdf8f('0x11')];this[_0xdf8f('0x12')]=_0x173fda[_0xdf8f('0x12')];this[_0xdf8f('0x13')]=_0x173fda['dialNoSuchNumberMaxRetry']||0x3;this[_0xdf8f('0x14')]=_0x173fda['dialNoSuchNumberRetryFrequency']||0x96;this[_0xdf8f('0x15')]=_0x173fda[_0xdf8f('0x15')]||0x3;this[_0xdf8f('0x16')]=_0x173fda['dialDropRetryFrequency']||0x96;this[_0xdf8f('0x17')]=_0x173fda[_0xdf8f('0x17')]||0x3;this[_0xdf8f('0x18')]=_0x173fda[_0xdf8f('0x18')]||0x96;this[_0xdf8f('0x19')]=_0x173fda[_0xdf8f('0x19')]||0x3;this[_0xdf8f('0x1a')]=_0x173fda['dialMachineRetryFrequency']||0x96;this[_0xdf8f('0x1b')]=_0x173fda[_0xdf8f('0x1b')]||0x3;this[_0xdf8f('0x1c')]=_0x173fda['dialAgentRejectRetryFrequency']||0x96;this[_0xdf8f('0x1d')]=_0x173fda['dialOrderByScheduledAt']||_0xdf8f('0x1e');this[_0xdf8f('0x1f')]=_0x173fda[_0xdf8f('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x173fda[_0xdf8f('0x20')]||undefined;this[_0xdf8f('0x21')]=_0x173fda[_0xdf8f('0x21')]||undefined;this['TrunkBackup']=_0x173fda[_0xdf8f('0x22')]?_0x173fda['TrunkBackup']:undefined;this[_0xdf8f('0x23')]=_0x173fda[_0xdf8f('0x23')]?_0x173fda[_0xdf8f('0x23')]:undefined;this[_0xdf8f('0x24')]=_0x173fda[_0xdf8f('0x24')]?_0x173fda[_0xdf8f('0x24')]:undefined;this['SquareProject']=_0x173fda[_0xdf8f('0x25')]?_0x173fda['SquareProject']:undefined;this[_0xdf8f('0x26')]=_0x173fda['SquareProject']?_0x173fda[_0xdf8f('0x25')][_0xdf8f('0x0')]:undefined;this['dialAMDActive']=_0x173fda[_0xdf8f('0x27')]||![];this[_0xdf8f('0x28')]=_0x173fda[_0xdf8f('0x28')];this['dialAMDGreeting']=_0x173fda[_0xdf8f('0x29')];this['dialAMDAfterGreetingSilence']=_0x173fda[_0xdf8f('0x2a')];this[_0xdf8f('0x2b')]=_0x173fda['dialAMDTotalAnalysisTime'];this[_0xdf8f('0x2c')]=_0x173fda[_0xdf8f('0x2c')];this['dialAMDBetweenWordsSilence']=_0x173fda[_0xdf8f('0x2d')];this[_0xdf8f('0x2e')]=_0x173fda[_0xdf8f('0x2e')];this[_0xdf8f('0x2f')]=_0x173fda['dialAMDSilenceThreshold'];this[_0xdf8f('0x30')]=_0x173fda[_0xdf8f('0x30')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index e4cce60..dbfbe80 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 _0x73f5=['monitors','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','unmanaged','lastapplication','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue'];(function(_0x400566,_0x474083){var _0x40f3e8=function(_0x34c917){while(--_0x34c917){_0x400566['push'](_0x400566['shift']());}};_0x40f3e8(++_0x474083);}(_0x73f5,0x1cb));var _0x573f=function(_0x530abe,_0x4698e8){_0x530abe=_0x530abe-0x0;var _0x38c964=_0x73f5[_0x530abe];return _0x38c964;};'use strict';function Channel(){this[_0x573f('0x0')]=null;this[_0x573f('0x1')]='';this[_0x573f('0x2')]='';this[_0x573f('0x3')]=0x0;this['calleridname']='';this[_0x573f('0x4')]=undefined;this[_0x573f('0x5')]=undefined;this[_0x573f('0x6')]=0x0;this[_0x573f('0x7')]='';this[_0x573f('0x8')]=0x0;this[_0x573f('0x9')]=0x0;this[_0x573f('0xa')]=0x0;this['answered']=![];this[_0x573f('0xb')]=null;this['endtime']=null;this[_0x573f('0xc')]=![];this['abandoned']=![];this[_0x573f('0xd')]='';this['lastdata']='';this[_0x573f('0xe')]=0x0;this[_0x573f('0xf')]=0x0;this[_0x573f('0x10')]=0x0;this['type']=null;this[_0x573f('0x11')]=null;this['disposition']=null;this[_0x573f('0x12')]=![];this[_0x573f('0x13')]=null;this[_0x573f('0x14')]=null;this[_0x573f('0x15')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x573f('0x16')]=0x0;}module[_0x573f('0x17')]=Channel; \ No newline at end of file +var _0x1dcc=['abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged'];(function(_0x34262e,_0x25f6c7){var _0x2c4272=function(_0x4ede0b){while(--_0x4ede0b){_0x34262e['push'](_0x34262e['shift']());}};_0x2c4272(++_0x25f6c7);}(_0x1dcc,0x77));var _0xc1dc=function(_0x12f97c,_0x1b2349){_0x12f97c=_0x12f97c-0x0;var _0x371363=_0x1dcc[_0x12f97c];return _0x371363;};'use strict';function Channel(){this[_0xc1dc('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0xc1dc('0x1')]=0x0;this[_0xc1dc('0x2')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xc1dc('0x3')]=0x0;this[_0xc1dc('0x4')]='';this[_0xc1dc('0x5')]=0x0;this[_0xc1dc('0x6')]=0x0;this[_0xc1dc('0x7')]=0x0;this[_0xc1dc('0x8')]=![];this[_0xc1dc('0x9')]=null;this['endtime']=null;this[_0xc1dc('0xa')]=![];this[_0xc1dc('0xb')]=![];this[_0xc1dc('0xc')]='';this[_0xc1dc('0xd')]='';this[_0xc1dc('0xe')]=0x0;this[_0xc1dc('0xf')]=0x0;this[_0xc1dc('0x10')]=0x0;this[_0xc1dc('0x11')]=null;this[_0xc1dc('0x12')]=null;this[_0xc1dc('0x13')]=null;this['monitor']=![];this[_0xc1dc('0x14')]=null;this[_0xc1dc('0x15')]=null;this['monitors']=[];this[_0xc1dc('0x16')]=undefined;this[_0xc1dc('0x17')]=undefined;this['transferType']=undefined;this[_0xc1dc('0x18')]=0x0;}module[_0xc1dc('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 8711b2f..d9b82c4 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 _0x2812=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x439621,_0x1ebe19){var _0x206e55=function(_0x5f317a){while(--_0x5f317a){_0x439621['push'](_0x439621['shift']());}};_0x206e55(++_0x1ebe19);}(_0x2812,0x1b9));var _0x2281=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x2812[_0x20e7e3];return _0x14b9de;};'use strict';function DeskAccount(_0xcadc72){this['id']=_0xcadc72['id']||0x0;this[_0x2281('0x0')]=_0xcadc72[_0x2281('0x0')]||'';this[_0x2281('0x1')]=_0xcadc72['username']||'';this[_0x2281('0x2')]=_0xcadc72[_0x2281('0x2')]||'';this[_0x2281('0x3')]=_0xcadc72[_0x2281('0x3')]||'';this[_0x2281('0x4')]=_0xcadc72['password']||'';this[_0x2281('0x5')]=_0xcadc72[_0x2281('0x5')]||'';this[_0x2281('0x6')]=_0xcadc72['consumerSecret']||'';this['token']=_0xcadc72[_0x2281('0x7')]||'';this[_0x2281('0x8')]=_0xcadc72['tokenSecret']||'';this['type']=_0xcadc72[_0x2281('0x9')]||'';this[_0x2281('0xa')]=_0xcadc72[_0x2281('0xa')]||'';this[_0x2281('0xb')]=_0xcadc72['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x397d=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x397d,0x114));var _0xd397=function(_0x281e0e,_0x165f87){_0x281e0e=_0x281e0e-0x0;var _0x40b7f9=_0x397d[_0x281e0e];return _0x40b7f9;};'use strict';function DeskAccount(_0x1dcbb6){this['id']=_0x1dcbb6['id']||0x0;this[_0xd397('0x0')]=_0x1dcbb6['name']||'';this['username']=_0x1dcbb6[_0xd397('0x1')]||'';this[_0xd397('0x2')]=_0x1dcbb6['remoteUri']||'';this[_0xd397('0x3')]=_0x1dcbb6[_0xd397('0x3')]||'';this[_0xd397('0x4')]=_0x1dcbb6[_0xd397('0x4')]||'';this[_0xd397('0x5')]=_0x1dcbb6[_0xd397('0x5')]||'';this[_0xd397('0x6')]=_0x1dcbb6['consumerSecret']||'';this[_0xd397('0x7')]=_0x1dcbb6['token']||'';this[_0xd397('0x8')]=_0x1dcbb6[_0xd397('0x8')]||'';this[_0xd397('0x9')]=_0x1dcbb6['type']||'';this[_0xd397('0xa')]=_0x1dcbb6['serverUrl']||'';this[_0xd397('0xb')]=_0x1dcbb6[_0xd397('0xb')]||{};}module[_0xd397('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 39dcf2c..8de697b 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 _0xbaf0=['Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x329684,_0x1ef95a){var _0x3dcd67=function(_0x142820){while(--_0x142820){_0x329684['push'](_0x329684['shift']());}};_0x3dcd67(++_0x1ef95a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';function Dynamics365Account(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||'';this[_0x0baf('0x2')]=_0x61caa9[_0x0baf('0x2')]||'';this['remoteUri']=_0x61caa9[_0x0baf('0x3')]||'';this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||'';this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||'';this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||{};this[_0x0baf('0x7')]=_0x61caa9[_0x0baf('0x7')]||'';this['Configurations']=_0x61caa9[_0x0baf('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb58b=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x29ed3c,_0xf746a5){var _0x468c43=function(_0x594c21){while(--_0x594c21){_0x29ed3c['push'](_0x29ed3c['shift']());}};_0x468c43(++_0xf746a5);}(_0xb58b,0x1f1));var _0xbb58=function(_0x57a07a,_0x21cbd9){_0x57a07a=_0x57a07a-0x0;var _0x5e5f23=_0xb58b[_0x57a07a];return _0x5e5f23;};'use strict';function Dynamics365Account(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['username']||'';this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')]||'';this['remoteUri']=_0x250573[_0xbb58('0x3')]||'';this['tenantId']=_0x250573[_0xbb58('0x4')]||'';this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||'';this['clientSecret']=_0x250573[_0xbb58('0x6')]||{};this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||'';this[_0xbb58('0x8')]=_0x250573[_0xbb58('0x8')]||{};}module[_0xbb58('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index af3053b..9797390 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 _0x9243=['key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9243,0x89));var _0x3924=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0x9243[_0x15a634];return _0xf4f7a0;};'use strict';function FaxAccount(_0x1a4890){this['id']=_0x1a4890['id']||0x0;this[_0x3924('0x0')]=_0x1a4890[_0x3924('0x0')]||'';this[_0x3924('0x1')]=_0x1a4890['description'];this[_0x3924('0x2')]=_0x1a4890['ecm'];this[_0x3924('0x3')]=_0x1a4890[_0x3924('0x3')];this[_0x3924('0x4')]=_0x1a4890[_0x3924('0x4')];this[_0x3924('0x5')]=_0x1a4890['minrate']||0x960;this[_0x3924('0x6')]=_0x1a4890['maxrate']||0x3840;this[_0x3924('0x7')]=_0x1a4890[_0x3924('0x7')]||_0x3924('0x8');this[_0x3924('0x9')]=_0x1a4890['gateway']||'no';this[_0x3924('0xa')]=_0x1a4890[_0x3924('0xa')]||'no';this[_0x3924('0xb')]=_0x1a4890['t38timeout']||0x1388;this['tech']=_0x1a4890[_0x3924('0xc')]||_0x3924('0xd');this[_0x3924('0xe')]=_0x1a4890[_0x3924('0xe')]?_0x1a4890[_0x3924('0xe')]:undefined;this['ListId']=_0x1a4890[_0x3924('0xf')];this['key']=_0x1a4890[_0x3924('0x10')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xeec9=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','localstationid'];(function(_0x4fccaa,_0x32b98b){var _0x40efa1=function(_0x4c1360){while(--_0x4c1360){_0x4fccaa['push'](_0x4fccaa['shift']());}};_0x40efa1(++_0x32b98b);}(_0xeec9,0x17c));var _0x9eec=function(_0x573cc1,_0xcf5089){_0x573cc1=_0x573cc1-0x0;var _0x174833=_0xeec9[_0x573cc1];return _0x174833;};'use strict';function FaxAccount(_0x57f1e6){this['id']=_0x57f1e6['id']||0x0;this[_0x9eec('0x0')]=_0x57f1e6[_0x9eec('0x0')]||'';this[_0x9eec('0x1')]=_0x57f1e6[_0x9eec('0x1')];this[_0x9eec('0x2')]=_0x57f1e6[_0x9eec('0x2')];this['headerinfo']=_0x57f1e6['headerinfo'];this[_0x9eec('0x3')]=_0x57f1e6[_0x9eec('0x3')];this[_0x9eec('0x4')]=_0x57f1e6['minrate']||0x960;this[_0x9eec('0x5')]=_0x57f1e6[_0x9eec('0x5')]||0x3840;this[_0x9eec('0x6')]=_0x57f1e6[_0x9eec('0x6')]||_0x9eec('0x7');this[_0x9eec('0x8')]=_0x57f1e6[_0x9eec('0x8')]||'no';this[_0x9eec('0x9')]=_0x57f1e6[_0x9eec('0x9')]||'no';this[_0x9eec('0xa')]=_0x57f1e6[_0x9eec('0xa')]||0x1388;this[_0x9eec('0xb')]=_0x57f1e6['tech']||_0x9eec('0xc');this[_0x9eec('0xd')]=_0x57f1e6[_0x9eec('0xd')]?_0x57f1e6[_0x9eec('0xd')]:undefined;this[_0x9eec('0xe')]=_0x57f1e6[_0x9eec('0xe')];this[_0x9eec('0xf')]=_0x57f1e6[_0x9eec('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 59dc884..14d9510 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 _0xdaf8=['name','username','apiKey','token','remoteUri','Configurations'];(function(_0x360732,_0x578a03){var _0x3d977b=function(_0x50f166){while(--_0x50f166){_0x360732['push'](_0x360732['shift']());}};_0x3d977b(++_0x578a03);}(_0xdaf8,0x174));var _0x8daf=function(_0x5a37f3,_0x5ab362){_0x5a37f3=_0x5a37f3-0x0;var _0x2932a1=_0xdaf8[_0x5a37f3];return _0x2932a1;};'use strict';function FreshdeskAccount(_0x3de256){this['id']=_0x3de256['id']||0x0;this[_0x8daf('0x0')]=_0x3de256[_0x8daf('0x0')]||'';this[_0x8daf('0x1')]=_0x3de256[_0x8daf('0x1')]||'';this[_0x8daf('0x2')]=_0x3de256[_0x8daf('0x3')]||'';this[_0x8daf('0x4')]=_0x3de256[_0x8daf('0x4')]||'';this['serverUrl']=_0x3de256['serverUrl']||'';this[_0x8daf('0x5')]=_0x3de256[_0x8daf('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xbad7=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x5cf568,_0x5c168a){var _0x29c2f4=function(_0x41428b){while(--_0x41428b){_0x5cf568['push'](_0x5cf568['shift']());}};_0x29c2f4(++_0x5c168a);}(_0xbad7,0x19d));var _0x7bad=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0xbad7[_0x177cc9];return _0x2fe577;};'use strict';function FreshdeskAccount(_0x593245){this['id']=_0x593245['id']||0x0;this[_0x7bad('0x0')]=_0x593245[_0x7bad('0x0')]||'';this[_0x7bad('0x1')]=_0x593245[_0x7bad('0x1')]||'';this[_0x7bad('0x2')]=_0x593245[_0x7bad('0x3')]||'';this[_0x7bad('0x4')]=_0x593245['remoteUri']||'';this[_0x7bad('0x5')]=_0x593245['serverUrl']||'';this[_0x7bad('0x6')]=_0x593245[_0x7bad('0x6')]||{};}module[_0x7bad('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 54a848f..8a23d00 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 _0x102b=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x102b,0x1be));var _0xb102=function(_0x295ac1,_0x2aae3b){_0x295ac1=_0x295ac1-0x0;var _0x3f7134=_0x102b[_0x295ac1];return _0x3f7134;};'use strict';function FreshsalesAccount(_0x18269b){this['id']=_0x18269b['id']||0x0;this[_0xb102('0x0')]=_0x18269b['name']||'';this[_0xb102('0x1')]=_0x18269b[_0xb102('0x1')]||'';this[_0xb102('0x2')]=_0x18269b[_0xb102('0x3')]||'';this[_0xb102('0x4')]=_0x18269b[_0xb102('0x4')]||'';this[_0xb102('0x5')]=_0x18269b[_0xb102('0x5')]||'';this['Configurations']=_0x18269b[_0xb102('0x6')]||{};}module[_0xb102('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xcdd0=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xcdd0[_0x433a86];return _0x23000c;};'use strict';function FreshsalesAccount(_0x157662){this['id']=_0x157662['id']||0x0;this[_0x0cdd('0x0')]=_0x157662[_0x0cdd('0x0')]||'';this[_0x0cdd('0x1')]=_0x157662['username']||'';this[_0x0cdd('0x2')]=_0x157662['token']||'';this['remoteUri']=_0x157662[_0x0cdd('0x3')]||'';this['serverUrl']=_0x157662[_0x0cdd('0x4')]||'';this[_0x0cdd('0x5')]=_0x157662[_0x0cdd('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 854ad14..ada0e82 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 _0xb696=['uniqueid','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','lastAssignedTo','motionChannel','voice','mohtime','exports','type'];(function(_0x41be19,_0x546ffc){var _0x3c6c74=function(_0x5512a6){while(--_0x5512a6){_0x41be19['push'](_0x41be19['shift']());}};_0x3c6c74(++_0x546ffc);}(_0xb696,0x1cb));var _0x6b69=function(_0xc1a3d1,_0x1a8e88){_0xc1a3d1=_0xc1a3d1-0x0;var _0xb66a10=_0xb696[_0xc1a3d1];return _0xb66a10;};'use strict';function QueueReport(){this[_0x6b69('0x0')]='inbound';this[_0x6b69('0x1')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0x6b69('0x2')]=null;this[_0x6b69('0x3')]=null;this[_0x6b69('0x4')]=0x1;this['count']=0x1;this[_0x6b69('0x5')]=![];this[_0x6b69('0x6')]=null;this['queuecallercomplete']=![];this[_0x6b69('0x7')]=null;this[_0x6b69('0x8')]=![];this[_0x6b69('0x9')]=null;this[_0x6b69('0xa')]=0x1;this[_0x6b69('0xb')]='';this[_0x6b69('0xc')]='';this[_0x6b69('0xd')]='';this[_0x6b69('0xe')]='';this[_0x6b69('0xf')]='';this[_0x6b69('0x10')]='';this[_0x6b69('0x11')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x6b69('0x12')]='';this[_0x6b69('0x13')]=_0x6b69('0x14');this[_0x6b69('0x15')]=0x0;this['variables']={};}module[_0x6b69('0x16')]=QueueReport; \ No newline at end of file +var _0x5dab=['type','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime'];(function(_0xaeacdf,_0x4aa4e2){var _0x4dd38d=function(_0x1ddfce){while(--_0x1ddfce){_0xaeacdf['push'](_0xaeacdf['shift']());}};_0x4dd38d(++_0x4aa4e2);}(_0x5dab,0xa1));var _0xb5da=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5dab[_0x4154a6];return _0x3b2786;};'use strict';function QueueReport(){this[_0xb5da('0x0')]='inbound';this['uniqueid']='';this[_0xb5da('0x1')]='';this['calleridname']='';this[_0xb5da('0x2')]='';this[_0xb5da('0x3')]=null;this[_0xb5da('0x4')]=null;this[_0xb5da('0x5')]=0x1;this[_0xb5da('0x6')]=0x1;this[_0xb5da('0x7')]=![];this[_0xb5da('0x8')]=null;this[_0xb5da('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xb5da('0xa')]=null;this[_0xb5da('0xb')]=0x1;this[_0xb5da('0xc')]='';this[_0xb5da('0xd')]='';this[_0xb5da('0xe')]='';this['accountcode']='';this[_0xb5da('0xf')]='';this['exten']='';this[_0xb5da('0x10')]='';this[_0xb5da('0x11')]=0x0;this[_0xb5da('0x12')]=![];this[_0xb5da('0x13')]='';this[_0xb5da('0x14')]=_0xb5da('0x15');this[_0xb5da('0x16')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a997448..4da92ac 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 _0x7d5d=['username','remoteUri','password','clientId','clientSecret','securityToken','integrationTab','serverUrl','Configurations','exports','name'];(function(_0xae6c67,_0x538d8f){var _0x1da613=function(_0x3c2d4c){while(--_0x3c2d4c){_0xae6c67['push'](_0xae6c67['shift']());}};_0x1da613(++_0x538d8f);}(_0x7d5d,0x99));var _0xd7d5=function(_0x1bce78,_0x416521){_0x1bce78=_0x1bce78-0x0;var _0x284351=_0x7d5d[_0x1bce78];return _0x284351;};'use strict';function SalesforceAccount(_0x5f103f){this['id']=_0x5f103f['id']||0x0;this[_0xd7d5('0x0')]=_0x5f103f[_0xd7d5('0x0')]||'';this[_0xd7d5('0x1')]=_0x5f103f[_0xd7d5('0x1')]||'';this[_0xd7d5('0x2')]=_0x5f103f[_0xd7d5('0x2')]||'';this[_0xd7d5('0x3')]=_0x5f103f['password']||'';this[_0xd7d5('0x4')]=_0x5f103f['clientId']||'';this[_0xd7d5('0x5')]=_0x5f103f[_0xd7d5('0x5')]||'';this[_0xd7d5('0x6')]=_0x5f103f[_0xd7d5('0x6')]||'';this['type']=_0x5f103f['type']||_0xd7d5('0x7');this[_0xd7d5('0x8')]=_0x5f103f[_0xd7d5('0x8')]||'';this['Configurations']=_0x5f103f[_0xd7d5('0x9')]||{};}module[_0xd7d5('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x4e2e=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x48e422,_0x473503){var _0x48cf0e=function(_0x4fdbd9){while(--_0x4fdbd9){_0x48e422['push'](_0x48e422['shift']());}};_0x48cf0e(++_0x473503);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x5aac79,_0x44b354){_0x5aac79=_0x5aac79-0x0;var _0x15a8b9=_0x4e2e[_0x5aac79];return _0x15a8b9;};'use strict';function SalesforceAccount(_0x5e27b1){this['id']=_0x5e27b1['id']||0x0;this[_0xe4e2('0x0')]=_0x5e27b1[_0xe4e2('0x0')]||'';this[_0xe4e2('0x1')]=_0x5e27b1[_0xe4e2('0x1')]||'';this[_0xe4e2('0x2')]=_0x5e27b1[_0xe4e2('0x2')]||'';this['password']=_0x5e27b1[_0xe4e2('0x3')]||'';this[_0xe4e2('0x4')]=_0x5e27b1[_0xe4e2('0x4')]||'';this[_0xe4e2('0x5')]=_0x5e27b1['clientSecret']||'';this[_0xe4e2('0x6')]=_0x5e27b1[_0xe4e2('0x6')]||'';this[_0xe4e2('0x7')]=_0x5e27b1[_0xe4e2('0x7')]||_0xe4e2('0x8');this[_0xe4e2('0x9')]=_0x5e27b1[_0xe4e2('0x9')]||'';this[_0xe4e2('0xa')]=_0x5e27b1['Configurations']||{};}module[_0xe4e2('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 ba56505..43befcc 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 _0x776c=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2d2c7f,_0x45e907){var _0xa3dacd=function(_0x1d768d){while(--_0x1d768d){_0x2d2c7f['push'](_0x2d2c7f['shift']());}};_0xa3dacd(++_0x45e907);}(_0x776c,0x172));var _0xc776=function(_0x53c732,_0x5686bb){_0x53c732=_0x53c732-0x0;var _0x34aeb7=_0x776c[_0x53c732];return _0x34aeb7;};'use strict';function ServicenowAccount(_0x752556){this['id']=_0x752556['id']||0x0;this[_0xc776('0x0')]=_0x752556[_0xc776('0x0')]||'';this[_0xc776('0x1')]=_0x752556[_0xc776('0x1')]||'';this['password']=_0x752556[_0xc776('0x2')]||'';this[_0xc776('0x3')]=_0x752556[_0xc776('0x3')]||'';this[_0xc776('0x4')]=_0x752556[_0xc776('0x4')]||'';this['Configurations']=_0x752556[_0xc776('0x5')]||{};}module[_0xc776('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x406f=['name','password','remoteUri','Configurations','exports'];(function(_0x5f2205,_0x595d35){var _0xed9401=function(_0x2736d7){while(--_0x2736d7){_0x5f2205['push'](_0x5f2205['shift']());}};_0xed9401(++_0x595d35);}(_0x406f,0x122));var _0xf406=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x406f[_0x4ed520];return _0x4415a6;};'use strict';function ServicenowAccount(_0x2da806){this['id']=_0x2da806['id']||0x0;this['name']=_0x2da806[_0xf406('0x0')]||'';this['username']=_0x2da806['username']||'';this[_0xf406('0x1')]=_0x2da806[_0xf406('0x1')]||'';this[_0xf406('0x2')]=_0x2da806['remoteUri']||'';this['serverUrl']=_0x2da806['serverUrl']||'';this[_0xf406('0x3')]=_0x2da806[_0xf406('0x3')]||{};}module[_0xf406('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 3189ff9..df6346e 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 _0xaede=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x168c68,_0x35ae2e){var _0x5d110f=function(_0x4db72e){while(--_0x4db72e){_0x168c68['push'](_0x168c68['shift']());}};_0x5d110f(++_0x35ae2e);}(_0xaede,0x11c));var _0xeaed=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xaede[_0x57b54c];return _0x59cc19;};'use strict';function SugarcrmAccount(_0x11d057){this['id']=_0x11d057['id']||0x0;this[_0xeaed('0x0')]=_0x11d057[_0xeaed('0x0')]||'';this[_0xeaed('0x1')]=_0x11d057['username']||'';this[_0xeaed('0x2')]=_0x11d057[_0xeaed('0x2')]||'';this[_0xeaed('0x3')]=_0x11d057[_0xeaed('0x3')]||'';this[_0xeaed('0x4')]=_0x11d057['serverUrl']||'';this['Configurations']=_0x11d057[_0xeaed('0x5')]||{};}module[_0xeaed('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xc44e=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x39f3e9,_0x1edfab){var _0x5e0ca8=function(_0x5238d3){while(--_0x5238d3){_0x39f3e9['push'](_0x39f3e9['shift']());}};_0x5e0ca8(++_0x1edfab);}(_0xc44e,0x162));var _0xec44=function(_0x5cfcef,_0x20d843){_0x5cfcef=_0x5cfcef-0x0;var _0x21df12=_0xc44e[_0x5cfcef];return _0x21df12;};'use strict';function SugarcrmAccount(_0x212ee9){this['id']=_0x212ee9['id']||0x0;this[_0xec44('0x0')]=_0x212ee9[_0xec44('0x0')]||'';this['username']=_0x212ee9[_0xec44('0x1')]||'';this[_0xec44('0x2')]=_0x212ee9['password']||'';this[_0xec44('0x3')]=_0x212ee9[_0xec44('0x3')]||'';this['serverUrl']=_0x212ee9[_0xec44('0x4')]||'';this[_0xec44('0x5')]=_0x212ee9['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 8c4eda4..ed9c387 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 _0x26ef=['name','accountcode','unknown','stateTime','status','exports'];(function(_0x4f6750,_0x36fa77){var _0x97e70e=function(_0x4f7bed){while(--_0x4f7bed){_0x4f6750['push'](_0x4f6750['shift']());}};_0x97e70e(++_0x36fa77);}(_0x26ef,0x13e));var _0xf26e=function(_0x710a8c,_0xd8c418){_0x710a8c=_0x710a8c-0x0;var _0x55a19c=_0x26ef[_0x710a8c];return _0x55a19c;};'use strict';function Telephone(_0x10d133){this['id']=_0x10d133['id']||0x0;this[_0xf26e('0x0')]=_0x10d133[_0xf26e('0x0')]||'';this[_0xf26e('0x1')]=_0x10d133[_0xf26e('0x1')]||'';this['state']=_0xf26e('0x2');this[_0xf26e('0x3')]=0x0;this[_0xf26e('0x4')]='unknown';this['address']='';}module[_0xf26e('0x5')]=Telephone; \ No newline at end of file +var _0x1339=['status','address','exports','name','accountcode','stateTime'];(function(_0x1fdc6a,_0x30f085){var _0x4c031f=function(_0x152871){while(--_0x152871){_0x1fdc6a['push'](_0x1fdc6a['shift']());}};_0x4c031f(++_0x30f085);}(_0x1339,0x1bf));var _0x9133=function(_0x4f2552,_0x143d91){_0x4f2552=_0x4f2552-0x0;var _0x2a9b75=_0x1339[_0x4f2552];return _0x2a9b75;};'use strict';function Telephone(_0x8b7b3b){this['id']=_0x8b7b3b['id']||0x0;this[_0x9133('0x0')]=_0x8b7b3b['name']||'';this[_0x9133('0x1')]=_0x8b7b3b[_0x9133('0x1')]||'';this['state']='unknown';this[_0x9133('0x2')]=0x0;this[_0x9133('0x3')]='unknown';this[_0x9133('0x4')]='';}module[_0x9133('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 2e00cf8..9ee270c 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(_0x22c4de,_0x3ab607){var _0x33e47a=function(_0x32e865){while(--_0x32e865){_0x22c4de['push'](_0x22c4de['shift']());}};_0x33e47a(++_0x3ab607);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x5abf4d,_0x35ed41){var _0x43ea6e=function(_0x504d29){while(--_0x504d29){_0x5abf4d['push'](_0x5abf4d['shift']());}};_0x43ea6e(++_0x35ed41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 0390e95..9d3f910 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0x0b0e[_0x184759];return _0xf26d5f;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x0b0e[_0x5e6ea3];return _0x4048b5;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a31c9ad..83d2674 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 _0xe5bc=['status','registry','split','host','domain','domainport','refresh','stateRegistry','unknown','registrationtime','address','defaultuser','exports','name','state'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xe5bc,0x1ed));var _0xce5b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xe5bc[_0x1d1779];return _0x2377e9;};'use strict';function Trunk(_0xa0f1f){this['id']=_0xa0f1f['id']||0x0;this['active']=_0xa0f1f['active']||![];this[_0xce5b('0x0')]=_0xa0f1f[_0xce5b('0x0')]||'';this[_0xce5b('0x1')]='unknown';this['stateTime']=0x0;this[_0xce5b('0x2')]='unknown';this[_0xce5b('0x3')]=_0xa0f1f[_0xce5b('0x3')]&&_0xa0f1f[_0xce5b('0x3')]['indexOf'](':')?_0xa0f1f[_0xce5b('0x3')][_0xce5b('0x4')](':')[0x0]:'';this[_0xce5b('0x5')]='';this['port']='';this[_0xce5b('0x6')]='';this[_0xce5b('0x7')]='';this[_0xce5b('0x8')]='';this[_0xce5b('0x9')]=_0xce5b('0xa');this[_0xce5b('0xb')]='';this[_0xce5b('0xc')]='';this['defaultuser']=_0xa0f1f[_0xce5b('0xd')]||'';}module[_0xce5b('0xe')]=Trunk; \ No newline at end of file +var _0xbecc=['registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xbecc,0xc7));var _0xcbec=function(_0x1b6f3d,_0x731bfd){_0x1b6f3d=_0x1b6f3d-0x0;var _0x13f514=_0xbecc[_0x1b6f3d];return _0x13f514;};'use strict';function Trunk(_0x80edf3){this['id']=_0x80edf3['id']||0x0;this['active']=_0x80edf3[_0xcbec('0x0')]||![];this[_0xcbec('0x1')]=_0x80edf3[_0xcbec('0x1')]||'';this[_0xcbec('0x2')]=_0xcbec('0x3');this['stateTime']=0x0;this[_0xcbec('0x4')]=_0xcbec('0x3');this[_0xcbec('0x5')]=_0x80edf3['registry']&&_0x80edf3[_0xcbec('0x5')][_0xcbec('0x6')](':')?_0x80edf3[_0xcbec('0x5')][_0xcbec('0x7')](':')[0x0]:'';this[_0xcbec('0x8')]='';this[_0xcbec('0x9')]='';this[_0xcbec('0xa')]='';this[_0xcbec('0xb')]='';this['refresh']='';this[_0xcbec('0xc')]=_0xcbec('0x3');this[_0xcbec('0xd')]='';this[_0xcbec('0xe')]='';this[_0xcbec('0xf')]=_0x80edf3[_0xcbec('0xf')]||'';}module[_0xcbec('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6a8c94c..6a527c4 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 _0x3ecc=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x316d26,_0x55bc14){var _0x1d33d6=function(_0x5e376f){while(--_0x5e376f){_0x316d26['push'](_0x316d26['shift']());}};_0x1d33d6(++_0x55bc14);}(_0x3ecc,0xa6));var _0xc3ec=function(_0x2c1b24,_0x35b9de){_0x2c1b24=_0x2c1b24-0x0;var _0x3d3714=_0x3ecc[_0x2c1b24];return _0x3d3714;};'use strict';function voiceExtension(_0x5defda){this['id']=_0x5defda['id']||0x0;this[_0xc3ec('0x0')]=_0x5defda[_0xc3ec('0x0')]||'';this[_0xc3ec('0x1')]=_0x5defda['recordingFormat']||_0xc3ec('0x2');this['mandatoryDisposition']=_0x5defda[_0xc3ec('0x3')]||![];}module[_0xc3ec('0x4')]=voiceExtension; \ No newline at end of file +var _0x98e9=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x12db71,_0x4ac41b){var _0x2dacbd=function(_0x5b94c1){while(--_0x5b94c1){_0x12db71['push'](_0x12db71['shift']());}};_0x2dacbd(++_0x4ac41b);}(_0x98e9,0x9e));var _0x998e=function(_0x39836b,_0x544694){_0x39836b=_0x39836b-0x0;var _0x453150=_0x98e9[_0x39836b];return _0x453150;};'use strict';function voiceExtension(_0x40c2de){this['id']=_0x40c2de['id']||0x0;this['exten']=_0x40c2de[_0x998e('0x0')]||'';this['recordingFormat']=_0x40c2de[_0x998e('0x1')]||'none';this[_0x998e('0x2')]=_0x40c2de[_0x998e('0x2')]||![];}module[_0x998e('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 7f2b27c..ec5889d 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 _0xfc83=['dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','talking','total','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','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','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout'];(function(_0x1bb468,_0x2a76de){var _0x1f28fe=function(_0x49c331){while(--_0x49c331){_0x1bb468['push'](_0x1bb468['shift']());}};_0x1f28fe(++_0x2a76de);}(_0xfc83,0x81));var _0x3fc8=function(_0x670368,_0x1d532e){_0x670368=_0x670368-0x0;var _0x2abe99=_0xfc83[_0x670368];return _0x2abe99;};'use strict';var statusDesc=[_0x3fc8('0x0'),_0x3fc8('0x1'),_0x3fc8('0x2'),_0x3fc8('0x3'),_0x3fc8('0x4'),_0x3fc8('0x5'),_0x3fc8('0x6'),'ringinuse',_0x3fc8('0x7')];var monitorFormat={'wav':_0x3fc8('0x8'),'wav49':_0x3fc8('0x9'),'gsm':_0x3fc8('0xa')};var strategy={'rrmemory':_0x3fc8('0xb'),'roundrobin':_0x3fc8('0xc')};function VoiceQueue(_0x4c5386){this['id']=_0x4c5386['id']||0x0;this['name']=_0x4c5386[_0x3fc8('0xd')]||'';this['monitor_format']=_0x4c5386[_0x3fc8('0xe')]||'';this['type']=_0x4c5386[_0x3fc8('0xf')]||'inbound';this['waiting']=0x0;this[_0x3fc8('0x10')]=0x0;this[_0x3fc8('0x11')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x3fc8('0x12')]=0x0;this[_0x3fc8('0x13')]=0x0;this[_0x3fc8('0x14')]=0x0;this[_0x3fc8('0x15')]=0x0;this[_0x3fc8('0x16')]=0x0;this[_0x3fc8('0x17')]=0x0;this['acw']=_0x4c5386['acw']||![];this[_0x3fc8('0x18')]=_0x4c5386[_0x3fc8('0x18')]||0xa;this['autopause']=_0x4c5386[_0x3fc8('0x19')]||'no';this[_0x3fc8('0x1a')]=!![];this[_0x3fc8('0x1b')]='';this[_0x3fc8('0x1c')]=0x0;this[_0x3fc8('0x1d')]=0x0;this[_0x3fc8('0x1e')]=_0x4c5386[_0x3fc8('0x1e')]||null;this['dialGlobalInterval']=_0x4c5386[_0x3fc8('0x1f')]?_0x4c5386[_0x3fc8('0x1f')]:null;this[_0x3fc8('0x20')]=_0x4c5386[_0x3fc8('0x20')];this[_0x3fc8('0x21')]=_0x4c5386[_0x3fc8('0x21')]||_0x3fc8('0x22');this[_0x3fc8('0x23')]=_0x4c5386[_0x3fc8('0x23')]||0x0;this[_0x3fc8('0x24')]=_0x4c5386[_0x3fc8('0x24')]||0x0;this[_0x3fc8('0x25')]=_0x4c5386[_0x3fc8('0x25')]||0x1;this['dialPredictiveOptimization']=_0x4c5386[_0x3fc8('0x26')]||_0x3fc8('0x27');this[_0x3fc8('0x28')]=_0x4c5386[_0x3fc8('0x28')]||0.03;this[_0x3fc8('0x29')]=_0x4c5386[_0x3fc8('0x29')]||0x258;this[_0x3fc8('0x2a')]=_0x4c5386[_0x3fc8('0x2a')]||_0x3fc8('0x2b');this['dialOriginateCallerIdNumber']=_0x4c5386[_0x3fc8('0x2c')]||'anonymous';this['dialOriginateTimeout']=_0x4c5386[_0x3fc8('0x2d')]||0x1e;this['dialQueueOptions']=_0x4c5386[_0x3fc8('0x2e')]||'tTxX';this[_0x3fc8('0x2f')]=_0x4c5386[_0x3fc8('0x2f')]||0x3;this[_0x3fc8('0x30')]=_0x4c5386[_0x3fc8('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x4c5386[_0x3fc8('0x31')]||0x3;this[_0x3fc8('0x32')]=_0x4c5386[_0x3fc8('0x32')]||0x96;this[_0x3fc8('0x33')]=_0x4c5386['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x4c5386['dialBusyRetryFrequency']||0x96;this[_0x3fc8('0x34')]=_0x4c5386['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x4c5386[_0x3fc8('0x35')]||0x96;this[_0x3fc8('0x36')]=_0x4c5386['dialNoSuchNumberMaxRetry']||0x3;this[_0x3fc8('0x37')]=_0x4c5386[_0x3fc8('0x37')]||0x96;this[_0x3fc8('0x38')]=_0x4c5386[_0x3fc8('0x38')]||0x3;this[_0x3fc8('0x39')]=_0x4c5386[_0x3fc8('0x39')]||0x96;this[_0x3fc8('0x3a')]=_0x4c5386[_0x3fc8('0x3a')]||0x3;this[_0x3fc8('0x3b')]=_0x4c5386[_0x3fc8('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x4c5386[_0x3fc8('0x3c')]||0x3;this[_0x3fc8('0x3d')]=_0x4c5386['dialMachineRetryFrequency']||0x96;this[_0x3fc8('0x3e')]=_0x4c5386[_0x3fc8('0x3e')]||0x3;this[_0x3fc8('0x3f')]=_0x4c5386[_0x3fc8('0x3f')]||0x96;this[_0x3fc8('0x40')]=_0x4c5386['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x4c5386[_0x3fc8('0x41')]?_0x4c5386[_0x3fc8('0x41')]:undefined;this[_0x3fc8('0x42')]=_0x4c5386[_0x3fc8('0x42')]?_0x4c5386[_0x3fc8('0x42')]:undefined;this[_0x3fc8('0x43')]=_0x4c5386[_0x3fc8('0x43')]||undefined;this[_0x3fc8('0x44')]=_0x4c5386[_0x3fc8('0x44')]?_0x4c5386['Interval']:undefined;this['dialOrderByScheduledAt']=_0x4c5386[_0x3fc8('0x45')]||_0x3fc8('0x46');this[_0x3fc8('0x47')]=_0x4c5386['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x3fc8('0x48')]=_0x4c5386[_0x3fc8('0x48')]||undefined;this['strategy']=strategy[_0x4c5386[_0x3fc8('0x49')]]||_0x3fc8('0xb');this[_0x3fc8('0x4a')]=!![];this[_0x3fc8('0x4b')]=_0x4c5386[_0x3fc8('0x4b')]||![];this[_0x3fc8('0x4c')]=_0x4c5386[_0x3fc8('0x4c')];this[_0x3fc8('0x4d')]=_0x4c5386['dialAMDGreeting'];this[_0x3fc8('0x4e')]=_0x4c5386['dialAMDAfterGreetingSilence'];this[_0x3fc8('0x4f')]=_0x4c5386['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x4c5386[_0x3fc8('0x50')];this[_0x3fc8('0x51')]=_0x4c5386[_0x3fc8('0x51')];this['dialAMDMaximumNumberOfWords']=_0x4c5386[_0x3fc8('0x52')];this[_0x3fc8('0x53')]=_0x4c5386[_0x3fc8('0x53')];this[_0x3fc8('0x54')]=_0x4c5386['dialAMDMaximumWordLength'];this[_0x3fc8('0x55')]=0x0;this[_0x3fc8('0x56')]=0x0;this[_0x3fc8('0x57')]=_0x4c5386[_0x3fc8('0x57')];this[_0x3fc8('0x58')]=0x0;this[_0x3fc8('0x59')]=0x0;this[_0x3fc8('0x5a')]=0x0;this[_0x3fc8('0x5b')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x3fc8('0x5c')]=0x0;this[_0x3fc8('0x5d')]=0x0;this[_0x3fc8('0x5e')]=0x0;this[_0x3fc8('0x5f')]=0x0;this[_0x3fc8('0x60')]=0x0;this[_0x3fc8('0x61')]=0x0;this[_0x3fc8('0x62')]=0x0;this[_0x3fc8('0x63')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x3fc8('0x64')]=undefined;this[_0x3fc8('0x65')]=undefined;this[_0x3fc8('0x66')]=undefined;this[_0x3fc8('0x67')]=1.05;this[_0x3fc8('0x68')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x3fc8('0x69')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x3fc8('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x3fc8('0x6b')]=_0x4c5386[_0x3fc8('0x6c')]||0x14;this[_0x3fc8('0x6d')]=_0x4c5386[_0x3fc8('0x6c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x3fc8('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x3fc8('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x3fc8('0x70')]=0x0;this[_0x3fc8('0x71')]=0x0;this[_0x3fc8('0x72')]=_0x4c5386[_0x3fc8('0x72')]||0x1e;this[_0x3fc8('0x73')]=_0x4c5386['dialRecallInQueue']||![];this[_0x3fc8('0x74')]=!!_0x4c5386[_0x3fc8('0x74')]||![];this['dialQueueProject2']=_0x4c5386[_0x3fc8('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x4c5386['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x4c5386[_0x3fc8('0x76')]||![];this['monitor_format']=monitorFormat[_0x4c5386[_0x3fc8('0xe')]]?monitorFormat[_0x4c5386[_0x3fc8('0xe')]]:undefined;this['mandatoryDisposition']=_0x4c5386[_0x3fc8('0x77')]||![];this[_0x3fc8('0x78')]=_0x4c5386[_0x3fc8('0x78')]?_0x4c5386[_0x3fc8('0x78')]:undefined;}module[_0x3fc8('0x79')]=VoiceQueue; \ No newline at end of file +var _0x4f1d=['dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','exports','unknown','not_inuse','inuse','busy','ringing','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4f1d,0x1e4));var _0xd4f1=function(_0x5338fe,_0x5e71d1){_0x5338fe=_0x5338fe-0x0;var _0xf0a1be=_0x4f1d[_0x5338fe];return _0xf0a1be;};'use strict';var statusDesc=[_0xd4f1('0x0'),_0xd4f1('0x1'),_0xd4f1('0x2'),_0xd4f1('0x3'),'invalid','unavailable',_0xd4f1('0x4'),'ringinuse',_0xd4f1('0x5')];var monitorFormat={'wav':_0xd4f1('0x6'),'wav49':'wav49','gsm':_0xd4f1('0x7')};var strategy={'rrmemory':_0xd4f1('0x8'),'roundrobin':_0xd4f1('0x9')};function VoiceQueue(_0x2c7fd2){this['id']=_0x2c7fd2['id']||0x0;this[_0xd4f1('0xa')]=_0x2c7fd2['name']||'';this[_0xd4f1('0xb')]=_0x2c7fd2[_0xd4f1('0xb')]||'';this['type']=_0x2c7fd2[_0xd4f1('0xc')]||_0xd4f1('0xd');this[_0xd4f1('0xe')]=0x0;this[_0xd4f1('0xf')]=0x0;this[_0xd4f1('0x10')]=0x0;this[_0xd4f1('0x11')]=0x0;this[_0xd4f1('0x12')]=0x0;this[_0xd4f1('0x13')]=0x0;this[_0xd4f1('0x14')]=0x0;this[_0xd4f1('0x15')]=0x0;this[_0xd4f1('0x16')]=0x0;this[_0xd4f1('0x17')]=0x0;this['available']=0x0;this['acw']=_0x2c7fd2[_0xd4f1('0x18')]||![];this[_0xd4f1('0x19')]=_0x2c7fd2[_0xd4f1('0x19')]||0xa;this['autopause']=_0x2c7fd2[_0xd4f1('0x1a')]||'no';this[_0xd4f1('0x1b')]=!![];this['message']='';this['originated']=0x0;this[_0xd4f1('0x1c')]=0x0;this[_0xd4f1('0x1d')]=_0x2c7fd2[_0xd4f1('0x1d')]||null;this['dialGlobalInterval']=_0x2c7fd2[_0xd4f1('0x1e')]?_0x2c7fd2[_0xd4f1('0x1e')]:null;this['dialActive']=_0x2c7fd2[_0xd4f1('0x1f')];this[_0xd4f1('0x20')]=_0x2c7fd2[_0xd4f1('0x20')]||'progressive';this[_0xd4f1('0x21')]=_0x2c7fd2[_0xd4f1('0x21')]||0x0;this[_0xd4f1('0x22')]=_0x2c7fd2[_0xd4f1('0x22')]||0x0;this[_0xd4f1('0x23')]=_0x2c7fd2[_0xd4f1('0x23')]||0x1;this[_0xd4f1('0x24')]=_0x2c7fd2['dialPredictiveOptimization']||_0xd4f1('0x25');this[_0xd4f1('0x26')]=_0x2c7fd2[_0xd4f1('0x26')]||0.03;this[_0xd4f1('0x27')]=_0x2c7fd2[_0xd4f1('0x27')]||0x258;this[_0xd4f1('0x28')]=_0x2c7fd2[_0xd4f1('0x28')]||_0xd4f1('0x29');this[_0xd4f1('0x2a')]=_0x2c7fd2['dialOriginateCallerIdNumber']||_0xd4f1('0x29');this[_0xd4f1('0x2b')]=_0x2c7fd2[_0xd4f1('0x2b')]||0x1e;this[_0xd4f1('0x2c')]=_0x2c7fd2[_0xd4f1('0x2c')]||_0xd4f1('0x2d');this['dialQueueTimeout']=_0x2c7fd2[_0xd4f1('0x2e')]||0x3;this[_0xd4f1('0x2f')]=_0x2c7fd2['dialQueueProject']||undefined;this[_0xd4f1('0x30')]=_0x2c7fd2[_0xd4f1('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x2c7fd2[_0xd4f1('0x31')]||0x96;this[_0xd4f1('0x32')]=_0x2c7fd2[_0xd4f1('0x32')]||0x3;this[_0xd4f1('0x33')]=_0x2c7fd2[_0xd4f1('0x33')]||0x96;this[_0xd4f1('0x34')]=_0x2c7fd2[_0xd4f1('0x34')]||0x3;this[_0xd4f1('0x35')]=_0x2c7fd2[_0xd4f1('0x35')]||0x96;this[_0xd4f1('0x36')]=_0x2c7fd2[_0xd4f1('0x36')]||0x3;this[_0xd4f1('0x37')]=_0x2c7fd2[_0xd4f1('0x37')]||0x96;this[_0xd4f1('0x38')]=_0x2c7fd2['dialDropMaxRetry']||0x3;this[_0xd4f1('0x39')]=_0x2c7fd2[_0xd4f1('0x39')]||0x96;this[_0xd4f1('0x3a')]=_0x2c7fd2[_0xd4f1('0x3a')]||0x3;this[_0xd4f1('0x3b')]=_0x2c7fd2[_0xd4f1('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x2c7fd2[_0xd4f1('0x3c')]||0x3;this['dialMachineRetryFrequency']=_0x2c7fd2['dialMachineRetryFrequency']||0x96;this[_0xd4f1('0x3d')]=_0x2c7fd2[_0xd4f1('0x3d')]||0x3;this[_0xd4f1('0x3e')]=_0x2c7fd2[_0xd4f1('0x3e')]||0x96;this[_0xd4f1('0x3f')]=_0x2c7fd2[_0xd4f1('0x3f')]||0x4;this[_0xd4f1('0x40')]=_0x2c7fd2[_0xd4f1('0x40')]?_0x2c7fd2[_0xd4f1('0x40')]:undefined;this['TrunkBackup']=_0x2c7fd2[_0xd4f1('0x41')]?_0x2c7fd2[_0xd4f1('0x41')]:undefined;this[_0xd4f1('0x42')]=_0x2c7fd2[_0xd4f1('0x42')]||undefined;this[_0xd4f1('0x43')]=_0x2c7fd2[_0xd4f1('0x43')]?_0x2c7fd2[_0xd4f1('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x2c7fd2[_0xd4f1('0x44')]||_0xd4f1('0x45');this[_0xd4f1('0x46')]=_0x2c7fd2[_0xd4f1('0x46')]||undefined;this[_0xd4f1('0x47')]=_0x2c7fd2[_0xd4f1('0x47')]||undefined;this[_0xd4f1('0x48')]=strategy[_0x2c7fd2[_0xd4f1('0x48')]]||'rrmemory';this[_0xd4f1('0x49')]=!![];this[_0xd4f1('0x4a')]=_0x2c7fd2[_0xd4f1('0x4a')]||![];this[_0xd4f1('0x4b')]=_0x2c7fd2[_0xd4f1('0x4b')];this[_0xd4f1('0x4c')]=_0x2c7fd2[_0xd4f1('0x4c')];this['dialAMDAfterGreetingSilence']=_0x2c7fd2['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2c7fd2['dialAMDTotalAnalysisTime'];this[_0xd4f1('0x4d')]=_0x2c7fd2[_0xd4f1('0x4d')];this[_0xd4f1('0x4e')]=_0x2c7fd2[_0xd4f1('0x4e')];this[_0xd4f1('0x4f')]=_0x2c7fd2[_0xd4f1('0x4f')];this[_0xd4f1('0x50')]=_0x2c7fd2[_0xd4f1('0x50')];this[_0xd4f1('0x51')]=_0x2c7fd2[_0xd4f1('0x51')];this[_0xd4f1('0x52')]=0x0;this[_0xd4f1('0x53')]=0x0;this['timeout']=_0x2c7fd2[_0xd4f1('0x54')];this[_0xd4f1('0x55')]=0x0;this[_0xd4f1('0x56')]=0x0;this[_0xd4f1('0x57')]=0x0;this[_0xd4f1('0x58')]=0x0;this[_0xd4f1('0x59')]=0x0;this[_0xd4f1('0x5a')]=0x0;this[_0xd4f1('0x5b')]=0x0;this[_0xd4f1('0x5c')]=0x0;this[_0xd4f1('0x5d')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xd4f1('0x5e')]=0x0;this[_0xd4f1('0x5f')]=0x0;this[_0xd4f1('0x60')]=0x0;this[_0xd4f1('0x61')]=0x0;this[_0xd4f1('0x62')]=undefined;this[_0xd4f1('0x63')]=undefined;this[_0xd4f1('0x64')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xd4f1('0x65')]=0x0;this[_0xd4f1('0x66')]=0x0;this[_0xd4f1('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xd4f1('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xd4f1('0x69')]=0x0;this[_0xd4f1('0x6a')]=0x0;this[_0xd4f1('0x6b')]=_0x2c7fd2['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xd4f1('0x6c')]=_0x2c7fd2[_0xd4f1('0x6d')]||0xa;this[_0xd4f1('0x6e')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xd4f1('0x6f')]=0x0;this[_0xd4f1('0x70')]=0x0;this[_0xd4f1('0x71')]=0x0;this['dialRecallMeTimeout']=_0x2c7fd2['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x2c7fd2[_0xd4f1('0x72')]||![];this['dialPreviewAutoRecallMe']=!!_0x2c7fd2[_0xd4f1('0x73')]||![];this[_0xd4f1('0x74')]=_0x2c7fd2['dialQueueProject2']||undefined;this[_0xd4f1('0x75')]=_0x2c7fd2['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x2c7fd2['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x2c7fd2[_0xd4f1('0xb')]]?monitorFormat[_0x2c7fd2[_0xd4f1('0xb')]]:undefined;this[_0xd4f1('0x76')]=_0x2c7fd2[_0xd4f1('0x76')]||![];this['mandatoryDispositionPause']=_0x2c7fd2['mandatoryDispositionPause']?_0x2c7fd2['mandatoryDispositionPause']:undefined;}module[_0xd4f1('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f702137..8637f8f 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 _0x2cc4=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x306e2e,_0x1fd086){var _0x390769=function(_0x9141a3){while(--_0x9141a3){_0x306e2e['push'](_0x306e2e['shift']());}};_0x390769(++_0x1fd086);}(_0x2cc4,0xdd));var _0x42cc=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x2cc4[_0x107f10];return _0x811cab;};'use strict';function VtigerAccount(_0x1e3102){this['id']=_0x1e3102['id']||0x0;this[_0x42cc('0x0')]=_0x1e3102[_0x42cc('0x0')]||'';this[_0x42cc('0x1')]=_0x1e3102[_0x42cc('0x1')]||'';this['accessKey']=_0x1e3102[_0x42cc('0x2')]||'';this[_0x42cc('0x3')]=_0x1e3102['remoteUri']||'';this[_0x42cc('0x4')]=_0x1e3102[_0x42cc('0x4')]||'';this[_0x42cc('0x5')]=_0x1e3102[_0x42cc('0x5')]||{};}module[_0x42cc('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd941=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xd941,0xdf));var _0x1d94=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xd941[_0x126f47];return _0x49508a;};'use strict';function VtigerAccount(_0x5eb063){this['id']=_0x5eb063['id']||0x0;this['name']=_0x5eb063[_0x1d94('0x0')]||'';this[_0x1d94('0x1')]=_0x5eb063[_0x1d94('0x1')]||'';this['accessKey']=_0x5eb063['accessKey']||'';this[_0x1d94('0x2')]=_0x5eb063[_0x1d94('0x2')]||'';this[_0x1d94('0x3')]=_0x5eb063[_0x1d94('0x3')]||'';this[_0x1d94('0x4')]=_0x5eb063[_0x1d94('0x4')]||{};}module[_0x1d94('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9d6d2ec..1a3ef02 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 _0xcea9=['name','username','password','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x56bd73,_0x54d2ae){var _0x16a8ad=function(_0x599c04){while(--_0x599c04){_0x56bd73['push'](_0x56bd73['shift']());}};_0x16a8ad(++_0x54d2ae);}(_0xcea9,0x132));var _0x9cea=function(_0x303456,_0x158f63){_0x303456=_0x303456-0x0;var _0x299438=_0xcea9[_0x303456];return _0x299438;};'use strict';function ZendeskAccount(_0x35a984){this['id']=_0x35a984['id']||0x0;this[_0x9cea('0x0')]=_0x35a984[_0x9cea('0x0')]||'';this[_0x9cea('0x1')]=_0x35a984['username']||'';this[_0x9cea('0x2')]=_0x35a984[_0x9cea('0x2')]||'';this['token']=_0x35a984['token']||'';this[_0x9cea('0x3')]=_0x35a984['remoteUri']||'';this['authType']=_0x35a984[_0x9cea('0x4')]||'';this[_0x9cea('0x5')]=_0x35a984[_0x9cea('0x5')]||'integrationTab';this[_0x9cea('0x6')]=_0x35a984[_0x9cea('0x6')]||'';this[_0x9cea('0x7')]=_0x35a984['Configurations']||{};}module[_0x9cea('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x7353=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x1b9255,_0xa6df8b){var _0x30087d=function(_0x1c5fbb){while(--_0x1c5fbb){_0x1b9255['push'](_0x1b9255['shift']());}};_0x30087d(++_0xa6df8b);}(_0x7353,0x102));var _0x3735=function(_0x420652,_0x1ec2e7){_0x420652=_0x420652-0x0;var _0x4f8f33=_0x7353[_0x420652];return _0x4f8f33;};'use strict';function ZendeskAccount(_0x2d77d6){this['id']=_0x2d77d6['id']||0x0;this[_0x3735('0x0')]=_0x2d77d6[_0x3735('0x0')]||'';this[_0x3735('0x1')]=_0x2d77d6[_0x3735('0x1')]||'';this[_0x3735('0x2')]=_0x2d77d6[_0x3735('0x2')]||'';this[_0x3735('0x3')]=_0x2d77d6[_0x3735('0x3')]||'';this[_0x3735('0x4')]=_0x2d77d6['remoteUri']||'';this[_0x3735('0x5')]=_0x2d77d6[_0x3735('0x5')]||'';this['type']=_0x2d77d6[_0x3735('0x6')]||_0x3735('0x7');this[_0x3735('0x8')]=_0x2d77d6['serverUrl']||'';this[_0x3735('0x9')]=_0x2d77d6[_0x3735('0x9')]||{};}module[_0x3735('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 ad2d768..32a33b8 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 _0xa3e1=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0xa3e1,0xad));var _0x1a3e=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xa3e1[_0x15876a];return _0xbd900f;};'use strict';function ZohoAccount(_0x2bac59){this['id']=_0x2bac59['id']||0x0;this['name']=_0x2bac59[_0x1a3e('0x0')]||'';this[_0x1a3e('0x1')]=_0x2bac59[_0x1a3e('0x1')]||'';this[_0x1a3e('0x2')]=_0x2bac59[_0x1a3e('0x2')]||'';this[_0x1a3e('0x3')]=_0x2bac59[_0x1a3e('0x3')]||'';this[_0x1a3e('0x4')]=_0x2bac59[_0x1a3e('0x4')]||'';this[_0x1a3e('0x5')]=_0x2bac59[_0x1a3e('0x5')]||'';this[_0x1a3e('0x6')]=_0x2bac59[_0x1a3e('0x6')]||'';this['code']=_0x2bac59['code']||'';this[_0x1a3e('0x7')]=_0x2bac59[_0x1a3e('0x7')]||'';this[_0x1a3e('0x8')]=_0x2bac59[_0x1a3e('0x8')]||{};}module[_0x1a3e('0x9')]=ZohoAccount; \ No newline at end of file +var _0xa0e4=['Configurations','exports','name','description','host','zone','clientId','serverUrl','code','refreshToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0e4,0x142));var _0x4a0e=function(_0x18cea4,_0x5ec50c){_0x18cea4=_0x18cea4-0x0;var _0x2cac6a=_0xa0e4[_0x18cea4];return _0x2cac6a;};'use strict';function ZohoAccount(_0x31ee8c){this['id']=_0x31ee8c['id']||0x0;this[_0x4a0e('0x0')]=_0x31ee8c[_0x4a0e('0x0')]||'';this[_0x4a0e('0x1')]=_0x31ee8c[_0x4a0e('0x1')]||'';this['host']=_0x31ee8c[_0x4a0e('0x2')]||'';this[_0x4a0e('0x3')]=_0x31ee8c[_0x4a0e('0x3')]||'';this[_0x4a0e('0x4')]=_0x31ee8c['clientId']||'';this['clientSecret']=_0x31ee8c['clientSecret']||'';this['serverUrl']=_0x31ee8c[_0x4a0e('0x5')]||'';this['code']=_0x31ee8c[_0x4a0e('0x6')]||'';this[_0x4a0e('0x7')]=_0x31ee8c[_0x4a0e('0x7')]||'';this[_0x4a0e('0x8')]=_0x31ee8c['Configurations']||{};}module[_0x4a0e('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 2eeafd1..75447f9 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 _0xb5a1=['Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','uniqueid','queue','name','type','dialAnswer','isNil','Agent','channelAgent','format','SIP/%s','membername','calleridname'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb5a1,0x173));var _0x1b5a=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0xb5a1[_0x4e55a9];return _0x4a9b67;};'use strict';var util=require(_0x1b5a('0x0'));var _=require(_0x1b5a('0x1'));var moment=require(_0x1b5a('0x2'));function checkNameSurname(_0x165b1b,_0x117327,_0xc0ca4b){var _0x31fc05='';if(!_['isNil'](_0x117327)&&_0x1b5a('0x3')===typeof _0x117327){_0x31fc05+=_0x117327;}if(!_['isNil'](_0xc0ca4b)&&_0x1b5a('0x3')===typeof _0xc0ca4b){_0x31fc05+='\x20'+_0xc0ca4b;}if(_0x31fc05!==''){return _0x31fc05;}return _0x165b1b;}function Action(_0x494631,_0x4f9662,_0x2decdd,_0x5d5e08,_0x21e95c){this[_0x1b5a('0x4')]=_0x2decdd||undefined;this['idContact']=_0x494631['id'];this[_0x1b5a('0x5')]=_0x4f9662[_0x1b5a('0x6')];this['type']=_0x4f9662[_0x1b5a('0x7')];this['campaigntype']=_0x1b5a('0x5');this[_0x1b5a('0x8')]=![];this['membername']=_[_0x1b5a('0x9')](_0x494631['Agent'])?undefined:_0x494631[_0x1b5a('0xa')][_0x1b5a('0x6')];this[_0x1b5a('0xb')]=this['membername']?util[_0x1b5a('0xc')](_0x1b5a('0xd'),this[_0x1b5a('0xe')]):_0x5d5e08||undefined;this[_0x1b5a('0xf')]=checkNameSurname(_0x494631[_0x1b5a('0x10')][_0x1b5a('0x11')],_0x494631[_0x1b5a('0x10')][_0x1b5a('0x12')],_0x494631[_0x1b5a('0x10')]['lastName']);this[_0x1b5a('0x13')]=_0x494631[_0x1b5a('0x13')]||![];this[_0x1b5a('0x14')]=_0x494631[_0x1b5a('0x10')][_0x1b5a('0x11')];this[_0x1b5a('0x15')]=_0x494631[_0x1b5a('0x15')];this[_0x1b5a('0x16')]=_0x494631['countbusyretry']||0x0;this[_0x1b5a('0x17')]=_0x494631[_0x1b5a('0x17')]||0x0;this['countnoanswerretry']=_0x494631[_0x1b5a('0x18')]||0x0;this[_0x1b5a('0x19')]=(_0x494631[_0x1b5a('0x16')]||0x0)+(_0x494631[_0x1b5a('0x17')]||0x0)+(_0x494631[_0x1b5a('0x18')]||0x0)+(_0x494631['countnosuchnumberretry']||0x0)+(_0x494631[_0x1b5a('0x1a')]||0x0)+(_0x494631[_0x1b5a('0x1b')]||0x0)+(_0x494631[_0x1b5a('0x1c')]||0x0)+(_0x494631[_0x1b5a('0x1d')]||0x0);this[_0x1b5a('0x1e')]=_0x494631[_0x1b5a('0x1e')]||0x0;this[_0x1b5a('0x1a')]=_0x494631['countdropretry']||0x0;this['countabandonedretry']=_0x494631[_0x1b5a('0x1b')]||0x0;this[_0x1b5a('0x1c')]=_0x494631[_0x1b5a('0x1c')]||0x0;this[_0x1b5a('0x1d')]=_0x494631[_0x1b5a('0x1d')]||0x0;this[_0x1b5a('0x1f')]=_0x494631['callback'];this[_0x1b5a('0x20')]=_0x494631[_0x1b5a('0x20')];this['callbackat']=_0x494631['callbackat'];this[_0x1b5a('0x21')]=_0x494631[_0x1b5a('0x21')];this['ContactId']=_0x494631[_0x1b5a('0x22')];this[_0x1b5a('0x23')]=_0x494631[_0x1b5a('0x23')];this[_0x1b5a('0x24')]=_['isNil'](_0x494631['Agent'])?_0x494631[_0x1b5a('0x24')]:_0x494631[_0x1b5a('0xa')]['id'];this[_0x1b5a('0x25')]=_0x494631[_0x1b5a('0x25')];this[_0x1b5a('0x26')]='';this[_0x1b5a('0x27')]='';}Action[_0x1b5a('0x28')]['getCaller']=function(){return util[_0x1b5a('0xc')](_0x1b5a('0x29'),this[_0x1b5a('0xf')],this[_0x1b5a('0x2a')]);};module['exports']=Action; \ No newline at end of file +var _0x6cdd=['ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme'];(function(_0x56ac9f,_0x561dcc){var _0x55f712=function(_0x77d18c){while(--_0x77d18c){_0x56ac9f['push'](_0x56ac9f['shift']());}};_0x55f712(++_0x561dcc);}(_0x6cdd,0xad));var _0xd6cd=function(_0x1afdaa,_0x4a3129){_0x1afdaa=_0x1afdaa-0x0;var _0x1fd872=_0x6cdd[_0x1afdaa];return _0x1fd872;};'use strict';var util=require(_0xd6cd('0x0'));var _=require(_0xd6cd('0x1'));var moment=require('moment');function checkNameSurname(_0xd47d5b,_0x19ecfa,_0x511e9a){var _0x1aa43f='';if(!_[_0xd6cd('0x2')](_0x19ecfa)&&'string'===typeof _0x19ecfa){_0x1aa43f+=_0x19ecfa;}if(!_['isNil'](_0x511e9a)&&_0xd6cd('0x3')===typeof _0x511e9a){_0x1aa43f+='\x20'+_0x511e9a;}if(_0x1aa43f!==''){return _0x1aa43f;}return _0xd47d5b;}function Action(_0x101ebe,_0x493ff3,_0x3578ec,_0xd12e25,_0x44ea1f){this[_0xd6cd('0x4')]=_0x3578ec||undefined;this[_0xd6cd('0x5')]=_0x101ebe['id'];this[_0xd6cd('0x6')]=_0x493ff3[_0xd6cd('0x7')];this[_0xd6cd('0x8')]=_0x493ff3[_0xd6cd('0x8')];this[_0xd6cd('0x9')]=_0xd6cd('0x6');this['dialAnswer']=![];this[_0xd6cd('0xa')]=_[_0xd6cd('0x2')](_0x101ebe[_0xd6cd('0xb')])?undefined:_0x101ebe[_0xd6cd('0xb')]['name'];this[_0xd6cd('0xc')]=this[_0xd6cd('0xa')]?util[_0xd6cd('0xd')](_0xd6cd('0xe'),this['membername']):_0xd12e25||undefined;this[_0xd6cd('0xf')]=checkNameSurname(_0x101ebe[_0xd6cd('0x10')][_0xd6cd('0x11')],_0x101ebe['Contact']['firstName'],_0x101ebe[_0xd6cd('0x10')]['lastName']);this['active']=_0x101ebe[_0xd6cd('0x12')]||![];this['calleridnum']=_0x101ebe['Contact'][_0xd6cd('0x11')];this[_0xd6cd('0x13')]=_0x101ebe[_0xd6cd('0x13')];this['countbusyretry']=_0x101ebe[_0xd6cd('0x14')]||0x0;this[_0xd6cd('0x15')]=_0x101ebe['countcongestionretry']||0x0;this[_0xd6cd('0x16')]=_0x101ebe[_0xd6cd('0x16')]||0x0;this[_0xd6cd('0x17')]=(_0x101ebe['countbusyretry']||0x0)+(_0x101ebe[_0xd6cd('0x15')]||0x0)+(_0x101ebe[_0xd6cd('0x16')]||0x0)+(_0x101ebe[_0xd6cd('0x18')]||0x0)+(_0x101ebe[_0xd6cd('0x19')]||0x0)+(_0x101ebe['countabandonedretry']||0x0)+(_0x101ebe[_0xd6cd('0x1a')]||0x0)+(_0x101ebe[_0xd6cd('0x1b')]||0x0);this[_0xd6cd('0x18')]=_0x101ebe[_0xd6cd('0x18')]||0x0;this[_0xd6cd('0x19')]=_0x101ebe['countdropretry']||0x0;this['countabandonedretry']=_0x101ebe['countabandonedretry']||0x0;this[_0xd6cd('0x1a')]=_0x101ebe[_0xd6cd('0x1a')]||0x0;this['countagentrejectretry']=_0x101ebe[_0xd6cd('0x1b')]||0x0;this['callback']=_0x101ebe[_0xd6cd('0x1c')];this[_0xd6cd('0x1d')]=_0x101ebe[_0xd6cd('0x1d')];this[_0xd6cd('0x1e')]=_0x101ebe['callbackat'];this[_0xd6cd('0x1f')]=_0x101ebe[_0xd6cd('0x1f')];this[_0xd6cd('0x20')]=_0x101ebe['ContactId'];this[_0xd6cd('0x21')]=_0x101ebe['ListId'];this['UserId']=_[_0xd6cd('0x2')](_0x101ebe[_0xd6cd('0xb')])?_0x101ebe[_0xd6cd('0x22')]:_0x101ebe[_0xd6cd('0xb')]['id'];this['VoiceQueueId']=_0x101ebe[_0xd6cd('0x23')];this['originatecalleridnum']='';this[_0xd6cd('0x24')]='';}Action[_0xd6cd('0x25')][_0xd6cd('0x26')]=function(){return util[_0xd6cd('0xd')]('\x22%s\x22\x20<%s>',this[_0xd6cd('0xf')],this[_0xd6cd('0x27')]);};module[_0xd6cd('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 7800302..0e7ba24 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 _0x4d9e=['Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','agents','logLookAgent','clone','response','idContact','custom:agentringnoanswer','rejected','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','uuid','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','available','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','dialActive','dialMethod','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','\x20is\x20not\x20active','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','clockClearZombieChannels','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','status','channel','updateOriginated','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','length','getDiff','voicePause','run','then','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','complete','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countbusyretry','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','called','Calling','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','unmonitored','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','checkIsBlackList','VoiceQueueId'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5cad71,_0x318e33){_0x5cad71=_0x5cad71-0x0;var _0x5afd2e=_0x4d9e[_0x5cad71];return _0x5afd2e;};'use strict';var util=require(_0xe4d9('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xe4d9('0x1'));var moment=require('moment');var md5=require(_0xe4d9('0x2'));var Redis=require('ioredis');var config=require(_0xe4d9('0x3'));var logger=require(_0xe4d9('0x4'))('preview');var loggerAction=require(_0xe4d9('0x4'))(_0xe4d9('0x5'));var ami=require(_0xe4d9('0x6'));var rpcDb=require(_0xe4d9('0x7'));var Action=require(_0xe4d9('0x8'));var ut=require(_0xe4d9('0x9'));config['redis']=_[_0xe4d9('0xa')](config[_0xe4d9('0xb')],{'host':_0xe4d9('0xc'),'port':0x18eb});var io=require(_0xe4d9('0xd'))(new Redis(config[_0xe4d9('0xb')]));var Sequence=function(){};Sequence[_0xe4d9('0xe')]['enqueue']=function(_0x1127e5){this[_0xe4d9('0xf')]=this[_0xe4d9('0xf')]?this[_0xe4d9('0xf')][_0xe4d9('0x10')](_0x1127e5):_0x1127e5();};function Preview(_0x3d1e0e){this[_0xe4d9('0x11')]=new Sequence();this['campaignsPreview']=_0x3d1e0e['voiceQueues'];this['trunks']=_0x3d1e0e['trunks'];this['actions']={};this['agents']=_0x3d1e0e['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xe4d9('0x12'),this[_0xe4d9('0x13')][_0xe4d9('0x14')](this));ami['on']('hangup',this[_0xe4d9('0x15')][_0xe4d9('0x14')](this));ami['on'](_0xe4d9('0x16'),this[_0xe4d9('0x17')]['bind'](this));ami['on'](_0xe4d9('0x18'),this[_0xe4d9('0x19')][_0xe4d9('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0xe4d9('0x14')](this));ami['on'](_0xe4d9('0x1a'),this['syncVarSet'][_0xe4d9('0x14')](this));ami['on']('attendedtransfer',this[_0xe4d9('0x1b')][_0xe4d9('0x14')](this));ami['on'](_0xe4d9('0x1c'),this[_0xe4d9('0x1d')]['bind'](this));this[_0xe4d9('0x1e')](this[_0xe4d9('0x1f')]);}function emit(_0x151220,_0x171224,_0x2c6b89){io['to'](_0x151220)[_0xe4d9('0x20')](_0x171224,_0x2c6b89);}function emitCampaignPreview(_0x30d923){if(_0x30d923[_0xe4d9('0x21')]===_0xe4d9('0x22')){var _0x4fed7f={'id':_0x30d923['id'],'name':_0x30d923[_0xe4d9('0x23')],'strategy':_0x30d923[_0xe4d9('0x24')],'answered':_0x30d923['answered'],'available':_0x30d923[_0xe4d9('0x25')],'loggedIn':_0x30d923['loggedIn'],'pTalking':_0x30d923[_0xe4d9('0x26')],'sumBillable':_0x30d923[_0xe4d9('0x27')],'sumDuration':_0x30d923['sumDuration'],'sumHoldTime':_0x30d923[_0xe4d9('0x28')]||0x0,'talking':_0x30d923[_0xe4d9('0x29')],'total':_0x30d923['total'],'type':_0x30d923[_0xe4d9('0x21')],'unmanaged':_0x30d923[_0xe4d9('0x2a')],'abandoned':_0x30d923[_0xe4d9('0x2b')],'waiting':_0x30d923['waiting'],'loggedInDb':_0x30d923['loggedInDb'],'dialActive':_0x30d923[_0xe4d9('0x2c')],'dialMethod':_0x30d923[_0xe4d9('0x2d')],'dialOriginateCallerIdName':_0x30d923['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x30d923['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x30d923['dialOriginateTimeout'],'dialPrefix':_0x30d923['dialPrefix'],'outboundAnswerAgiCallsDay':_0x30d923[_0xe4d9('0x2e')],'outboundAnswerCallsDay':_0x30d923['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x30d923[_0xe4d9('0x2f')],'outboundBusyCallsDay':_0x30d923[_0xe4d9('0x30')],'outboundCongestionCallsDay':_0x30d923[_0xe4d9('0x31')],'outboundDropCallsDayACS':_0x30d923['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x30d923[_0xe4d9('0x32')],'outboundDropCallsDayTimeout':_0x30d923[_0xe4d9('0x33')],'outboundNoAnswerCallsDay':_0x30d923[_0xe4d9('0x34')],'outboundNoSuchCallsDay':_0x30d923[_0xe4d9('0x35')],'outboundOriginateFailureCallsDay':_0x30d923[_0xe4d9('0x36')],'outboundReCallsDay':_0x30d923[_0xe4d9('0x37')],'outboundRejectCallsDay':_0x30d923[_0xe4d9('0x38')],'outboundUnknownCallsDay':_0x30d923[_0xe4d9('0x39')],'outboundAbandonedCallsDay':_0x30d923[_0xe4d9('0x3a')],'predictiveIntervalAnsweredCalls':_0x30d923[_0xe4d9('0x3b')],'predictiveIntervalAvgHoldtime':_0x30d923[_0xe4d9('0x3c')],'predictiveIntervalAvgTalktime':_0x30d923[_0xe4d9('0x3d')],'predictiveIntervalDroppedCallsCallersExit':_0x30d923['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x30d923[_0xe4d9('0x3e')],'predictiveIntervalErlangCalls':_0x30d923[_0xe4d9('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x30d923[_0xe4d9('0x40')],'predictiveIntervalHitRate':_0x30d923[_0xe4d9('0x41')],'predictiveIntervalMultiplicativeFactor':_0x30d923[_0xe4d9('0x42')],'predictiveIntervalPauses':_0x30d923[_0xe4d9('0x43')],'predictiveIntervalAvailable':_0x30d923['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x30d923['predictiveIntervalTotalCalls'],'message':_0x30d923['message'],'originated':_0x30d923[_0xe4d9('0x44')],'erlangCalls':_0x30d923[_0xe4d9('0x45')],'erlangCallToSecond':_0x30d923[_0xe4d9('0x46')],'erlangAbandonmentRate':_0x30d923['erlangAbandonmentRate'],'erlangBusyFactor':_0x30d923['erlangBusyFactor'],'startPredictive':_0x30d923['startPredictive'],'startProgressive':_0x30d923['startProgressive']};if(_0x30d923[_0xe4d9('0x47')]){_0x4fed7f[_0xe4d9('0x47')]={'id':_0x30d923['Trunk']['id'],'name':_0x30d923[_0xe4d9('0x47')][_0xe4d9('0x23')],'active':_0x30d923['Trunk'][_0xe4d9('0x48')],'callerid':_0x30d923[_0xe4d9('0x47')][_0xe4d9('0x49')]};}if(_0x30d923[_0xe4d9('0x4a')]){_0x4fed7f[_0xe4d9('0x4a')]={'id':_0x30d923[_0xe4d9('0x4a')]['id'],'name':_0x30d923[_0xe4d9('0x4a')][_0xe4d9('0x23')]};}var _0x3fd26a=md5(JSON[_0xe4d9('0x4b')](_0x4fed7f));if(_0x30d923[_0xe4d9('0x2')]!==_0x3fd26a){_0x30d923[_0xe4d9('0x2')]=_0x3fd26a;emit(util[_0xe4d9('0x4c')](_0xe4d9('0x4d'),_0x4fed7f['name']),_0xe4d9('0x4e'),_0x4fed7f);}}}function emitVoiceQueueChannelRemove(_0x20aef6){logger[_0xe4d9('0x4f')](_0xe4d9('0x50'),JSON[_0xe4d9('0x4b')](_0x20aef6));emit(util[_0xe4d9('0x4c')](_0xe4d9('0x4d'),_0x20aef6[_0xe4d9('0x23')]),_0xe4d9('0x51'),_0x20aef6);io['emit']('voice_queue_presence:remove',_0x20aef6);}function notSendMessagesQueue(_0x5f5bc5){if(_0x5f5bc5[_0xe4d9('0x52')]){if(_0x5f5bc5[_0xe4d9('0x44')]===0x0&&_0x5f5bc5[_0xe4d9('0x26')]===0x0){_0x5f5bc5[_0xe4d9('0x52')]=![];_0x5f5bc5[_0xe4d9('0x25')]=0x0;_0x5f5bc5[_0xe4d9('0x53')]=0x0;_0x5f5bc5[_0xe4d9('0x54')]='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5f5bc5[_0xe4d9('0x23')]+_0xe4d9('0x55'));}else{_0x5f5bc5['message']=_0xe4d9('0x56');ut[_0xe4d9('0x57')](_0xe4d9('0x58'),_0x5f5bc5[_0xe4d9('0x23')]+'\x20is\x20disactive');}emitCampaignPreview(_0x5f5bc5);}}Preview[_0xe4d9('0xe')][_0xe4d9('0x1e')]=function(){var _0x2afa91=this;setInterval(function(){_0x2afa91[_0xe4d9('0x59')]();},0x7cf);};Preview[_0xe4d9('0xe')][_0xe4d9('0x59')]=function(){var _0x25b1f0=this[_0xe4d9('0x1f')];this[_0xe4d9('0x5a')]+=0x1;for(var _0x288c86 in _0x25b1f0){if(_0x25b1f0[_0xe4d9('0x5b')](_0x288c86)&&(_0x25b1f0[_0x288c86]['dialMethod']===_0xe4d9('0x5c')||_0x25b1f0[_0x288c86][_0xe4d9('0x2d')]===_0xe4d9('0x5d'))&&_0x25b1f0[_0x288c86][_0xe4d9('0x21')]===_0xe4d9('0x22')){if(this['clockClearZombieChannels']>0x7){this[_0xe4d9('0x5a')]=0x0;this[_0xe4d9('0x5e')]();}}if(_0x25b1f0[_0xe4d9('0x5b')](_0x288c86)&&_0x25b1f0[_0x288c86][_0xe4d9('0x2d')]===_0xe4d9('0x5c')&&_0x25b1f0[_0x288c86][_0xe4d9('0x21')]===_0xe4d9('0x22')){if(_0x25b1f0[_0x288c86][_0xe4d9('0x2c')]){this[_0xe4d9('0x5f')](_0x25b1f0[_0x288c86]);if(_0x25b1f0[_0x288c86][_0xe4d9('0x60')])this['recallMe'](_0x25b1f0[_0x288c86]);}else{notSendMessagesQueue(_0x25b1f0[_0x288c86]);}}}};Preview[_0xe4d9('0xe')][_0xe4d9('0x61')]=function(_0x96ead7){var _0x54bf07=this;this[_0xe4d9('0x11')][_0xe4d9('0x62')](function(){if(!_[_0xe4d9('0x63')](_0x54bf07[_0xe4d9('0x64')][_0x96ead7])){loggerAction[_0xe4d9('0x4f')](_0xe4d9('0x65'),_0x96ead7,_0xe4d9('0x66'),_0x54bf07['actions'][_0x96ead7][_0xe4d9('0x67')],_0xe4d9('0x68'),JSON[_0xe4d9('0x4b')](_0x54bf07[_0xe4d9('0x1f')][_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x67')]]['originated']),_0xe4d9('0x69'),JSON[_0xe4d9('0x4b')](_0x54bf07[_0xe4d9('0x1f')][_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x67')]][_0xe4d9('0x26')]),JSON['stringify'](_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x6a')]),JSON['stringify'](_[_0xe4d9('0x6b')](_0x54bf07['actions'][_0x96ead7],[_0xe4d9('0x6c'),_0xe4d9('0x6d'),'VoiceQueueId',_0xe4d9('0x6e')])));return ami['Action']({'action':_0xe4d9('0x6f'),'channel':_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x70')]})['catch'](function(_0x39634c){if(_0x39634c[_0xe4d9('0x54')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x54bf07[_0xe4d9('0x64')][_0x96ead7]){ut[_0xe4d9('0x71')](_0x54bf07[_0xe4d9('0x1f')][_0x54bf07[_0xe4d9('0x64')][_0x96ead7]['queue']],'[clearZombieChannel]');if(_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x6a')]===!![]){ut[_0xe4d9('0x72')](_0x54bf07[_0xe4d9('0x1f')][_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x67')]],'[clearZombieChannel]');ut['loggerError'](_0xe4d9('0x73')+_0x96ead7,_0x54bf07[_0xe4d9('0x64')][_0x96ead7][_0xe4d9('0x67')]);}ut[_0xe4d9('0x74')](_0xe4d9('0x75')+_0x96ead7,_0x54bf07[_0xe4d9('0x64')][_0x96ead7]['queue']);delete _0x54bf07[_0xe4d9('0x64')][_0x96ead7];}},0x2328);}});}});};Preview[_0xe4d9('0xe')][_0xe4d9('0x5e')]=function(){var _0x48f452=this;loggerAction[_0xe4d9('0x4f')](_0xe4d9('0x76'),_[_0xe4d9('0x77')](this['actions']));for(var _0x1f7c11 in this['actions']){if(_0x48f452[_0xe4d9('0x64')][_0xe4d9('0x5b')](_0x1f7c11)){_0x48f452[_0xe4d9('0x61')](_0x1f7c11);}}};Preview['prototype']['recallMe']=function(_0x5bd06b){var _0x3b70c5=this;rpcDb['getContactRecallMe'](_0x5bd06b['id'],ut[_0xe4d9('0x78')](this['agents']))['then'](function(_0x3c2196){if(!_[_0xe4d9('0x63')](_0x3c2196)){for(var _0x467c29=0x0;_0x467c29<_0x3c2196[_0xe4d9('0x79')];_0x467c29+=0x1){if(ut[_0xe4d9('0x7a')](_0x3c2196[_0x467c29]['scheduledat'])<_0x5bd06b['dialRecallMeTimeout']*0x3c){if(_0x3c2196[_0x467c29]['Agent']&&!_0x3c2196[_0x467c29]['Agent'][_0xe4d9('0x7b')]){_0x3b70c5[_0xe4d9('0x7c')](_0x3c2196[_0x467c29]['id'])[_0xe4d9('0x7d')](ut[_0xe4d9('0x7e')](_0xe4d9('0x7f')))[_0xe4d9('0x80')](ut[_0xe4d9('0x7e')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x3c2196[_0x467c29]['id']);}}else{var _0x7d1fb9=new Action(_0x3c2196[_0x467c29],_0x5bd06b);_0x7d1fb9[_0xe4d9('0x81')]=moment()[_0xe4d9('0x4c')](_0xe4d9('0x82'));_0x5bd06b[_0xe4d9('0x37')]+=0x1;ut[_0xe4d9('0x83')](_0x7d1fb9,0x17,_0xe4d9('0x84'));if(_0x5bd06b[_0xe4d9('0x85')]){rpcDb[_0xe4d9('0x86')](ut[_0xe4d9('0x87')](_0x3c2196[_0x467c29]));rpcDb[_0xe4d9('0x88')](_0x7d1fb9,_0xe4d9('0x89'));}else{ut['logCustomer'](_0x7d1fb9,0x16,_0xe4d9('0x8a'));rpcDb[_0xe4d9('0x88')](_0x7d1fb9,_0xe4d9('0x8b'));rpcDb[_0xe4d9('0x8c')](_0x7d1fb9,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2'](_0xe4d9('0x8d')));};Preview[_0xe4d9('0xe')][_0xe4d9('0x5f')]=function(_0x43b750){_0x43b750['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x43b750[_0xe4d9('0x8e')])){_0x43b750[_0xe4d9('0x54')]=_0xe4d9('0x8f');}else if(!ut[_0xe4d9('0x90')](_0x43b750[_0xe4d9('0x2c')])){_0x43b750[_0xe4d9('0x54')]='NOT_ACTIVE';}else if(!this[_0xe4d9('0x91')](_0x43b750['Trunk'])){if(!this[_0xe4d9('0x91')](_0x43b750[_0xe4d9('0x92')])){_0x43b750['message']=_0xe4d9('0x93');}else{_0x43b750[_0xe4d9('0x54')]='ACTIVE';}}else{_0x43b750[_0xe4d9('0x54')]=_0xe4d9('0x94');}emitCampaignPreview(_0x43b750);};Preview[_0xe4d9('0xe')][_0xe4d9('0x95')]=function(_0x3a7ff2,_0x1e61a3,_0x4ec908){var _0x489439=this;var _0x3473ad=this['actions'][_0x1e61a3];var _0x10ef01=this['campaignsPreview'][_0x3473ad['queue']];var _0x2f6f7b;if(_0x10ef01){switch(_0x4ec908){case'1':_0x10ef01[_0xe4d9('0x35')]+=0x1;_0x3473ad[_0xe4d9('0x96')]+=0x1;_0x3473ad['countglobal']=ut[_0xe4d9('0x97')](_0x3473ad);ut['logCustomer'](_0x3473ad,0x0,_0xe4d9('0x98'));ami[_0xe4d9('0x20')](_0xe4d9('0x99'),ut[_0xe4d9('0x9a')](_0x3473ad,'nosuchnumber'));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0x9b'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut[_0xe4d9('0x9d')](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0x9f'));}else{if(_0x3473ad[_0xe4d9('0x96')]>=_0x10ef01['dialNoSuchNumberMaxRetry']){rpcDb[_0xe4d9('0x8c')](_0x3473ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xe4d9('0xa0')](ut[_0xe4d9('0xa1')](_0x3473ad,_0xe4d9('0x96'),_0x10ef01[_0xe4d9('0xa2')]),_0x3473ad['unlockAgent'],_0x3473ad['activeContact']);}}delete this[_0xe4d9('0x64')][_0x3a7ff2[_0xe4d9('0xa3')]];break;case _0xe4d9('0xa4'):var _0x40efe3=moment()[_0xe4d9('0x4c')](_0xe4d9('0x82'));_0x3473ad[_0xe4d9('0xa5')]=_0x40efe3;_0x3473ad[_0xe4d9('0xa6')]=_0x40efe3;_0x3473ad[_0xe4d9('0x6a')]=!![];_0x10ef01['pTalking']+=0x1;logger[_0xe4d9('0x4f')](_0xe4d9('0xa7'),_0x3473ad['uniqueid'],_0xe4d9('0xa8'),_0x10ef01[_0xe4d9('0x23')],_0xe4d9('0x69'),_0x10ef01[_0xe4d9('0x26')]);ami[_0xe4d9('0x20')]('custom:agentconnect',ut[_0xe4d9('0x9a')](_0x3473ad,_0xe4d9('0xa9'),this[_0xe4d9('0x1f')][_0x3473ad[_0xe4d9('0x67')]]));if(_0x10ef01[_0xe4d9('0xaa')]){ami[_0xe4d9('0x20')](_0xe4d9('0xab'),ut[_0xe4d9('0xac')](_0x3473ad));}break;case'16':ami[_0xe4d9('0x20')]('custom:agentcomplete',ut[_0xe4d9('0x9a')](_0x3473ad,'complete',this[_0xe4d9('0x1f')][_0x3473ad[_0xe4d9('0x67')]]));emitVoiceQueueChannelRemove(ut[_0xe4d9('0x9a')](_0x3473ad,_0xe4d9('0xad')));_0x10ef01['outboundAnswerCallsDay']+=0x1;_0x10ef01[_0xe4d9('0xae')]+=0x1;_0x10ef01[_0xe4d9('0xaf')]+=0x1;ut['decrementTalkink'](_0x10ef01,_0xe4d9('0xb0'));_0x3473ad[_0xe4d9('0xb1')]=ut['totalGlobal'](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x4,_0xe4d9('0xb2'));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xb3'));rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xb4'));rpcDb[_0xe4d9('0xb5')](_0x3473ad);_0x10ef01[_0xe4d9('0xb6')]+=_0x3473ad[_0xe4d9('0xb7')];_0x10ef01['sumBillable']+=_0x3473ad[_0xe4d9('0xb7')];logger['info'](_0xe4d9('0xb8'),_0x3473ad['uniqueid'],_0xe4d9('0xa8'),_0x10ef01[_0xe4d9('0x23')],_0xe4d9('0x69'),_0x10ef01[_0xe4d9('0x26')]);delete this[_0xe4d9('0x64')][_0x3a7ff2[_0xe4d9('0xa3')]];break;case _0xe4d9('0xb9'):_0x10ef01[_0xe4d9('0x30')]+=0x1;_0x3473ad['countbusyretry']+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x5,_0xe4d9('0xba'));ami[_0xe4d9('0x20')](_0xe4d9('0xbb'),ut[_0xe4d9('0x9a')](_0x3473ad,_0xe4d9('0xbc')));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xbd'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut[_0xe4d9('0x9d')](_0x3473ad,0xf,'Global');rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xbe'));}else{if(_0x3473ad['countbusyretry']>=_0x10ef01[_0xe4d9('0xbf')]){rpcDb[_0xe4d9('0x8c')](_0x3473ad,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xe4d9('0xa0')](ut[_0xe4d9('0xa1')](_0x3473ad,_0xe4d9('0xc0'),_0x10ef01[_0xe4d9('0xc1')]),_0x3473ad[_0xe4d9('0xc2')],_0x3473ad[_0xe4d9('0xc3')]);}}break;case _0xe4d9('0xc4'):_0x10ef01[_0xe4d9('0x34')]+=0x1;_0x3473ad[_0xe4d9('0xc5')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x3,_0xe4d9('0xc6'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x3473ad,_0xe4d9('0xc7')));rpcDb[_0xe4d9('0x88')](_0x3473ad,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut['cloneAction'](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb['createCustomerFinal'](_0x2f6f7b,_0xe4d9('0xc8'));}else{if(_0x3473ad[_0xe4d9('0xc5')]>=_0x10ef01['dialNoAnswerMaxRetry']){rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xc9'));}else{rpcDb[_0xe4d9('0xa0')](ut['scheduledAt'](_0x3473ad,_0xe4d9('0xc5'),_0x10ef01[_0xe4d9('0xca')]),_0x3473ad[_0xe4d9('0xc2')],_0x3473ad[_0xe4d9('0xc3')]);}}break;case _0xe4d9('0xcb'):_0x10ef01[_0xe4d9('0x31')]+=0x1;_0x3473ad[_0xe4d9('0xcc')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x8,_0xe4d9('0xcd'));ami[_0xe4d9('0x20')](_0xe4d9('0xce'),ut[_0xe4d9('0x9a')](_0x3473ad,_0xe4d9('0xcf')));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xd0'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut[_0xe4d9('0x9d')](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xd1'));}else{if(_0x3473ad[_0xe4d9('0xcc')]>=_0x10ef01['dialCongestionMaxRetry']){rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xd0'));}else{rpcDb[_0xe4d9('0xa0')](ut[_0xe4d9('0xa1')](_0x3473ad,_0xe4d9('0xcc'),_0x10ef01['dialBusyRetryFrequency']),_0x3473ad[_0xe4d9('0xc2')],_0x3473ad['activeContact']);}}break;case _0xe4d9('0xd2'):_0x10ef01[_0xe4d9('0x38')]+=0x1;_0x3473ad[_0xe4d9('0xd3')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut['logCustomer'](_0x3473ad,0x14,_0xe4d9('0xd4'));ami[_0xe4d9('0x20')](_0xe4d9('0xd5'),ut[_0xe4d9('0x9a')](_0x3473ad,'agentreject'));rpcDb['createCustomerHistory'](_0x3473ad,_0xe4d9('0xd6'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01['dialGlobalMaxRetry']){_0x2f6f7b=ut[_0xe4d9('0x9d')](_0x3473ad,0x14,_0xe4d9('0xd4'));rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xd7'));}else{if(_0x3473ad[_0xe4d9('0xd3')]>=_0x10ef01[_0xe4d9('0xd8')]){rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xd7'));}else{rpcDb[_0xe4d9('0xa0')](ut[_0xe4d9('0xa1')](_0x3473ad,_0xe4d9('0xd3'),_0x10ef01['dialAgentRejectRetryFrequency']),_0x3473ad[_0xe4d9('0xc2')],_0x3473ad['activeContact']);}}break;case'ABANDONED':_0x10ef01['outboundAbandonedCallsDay']+=0x1;_0x3473ad[_0xe4d9('0xd9')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0xb,_0xe4d9('0xda'));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xdb'));if(ut['totalGlobal'](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut[_0xe4d9('0x9d')](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xdb'));}else{if(_0x3473ad['countabandonedetry']>=_0x10ef01[_0xe4d9('0xdc')]){rpcDb[_0xe4d9('0x8c')](_0x3473ad,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xe4d9('0xa0')](ut[_0xe4d9('0xa1')](_0x3473ad,_0xe4d9('0xd9'),_0x10ef01[_0xe4d9('0xdd')]),_0x3473ad['unlockAgent'],_0x3473ad[_0xe4d9('0xc3')]);}}break;case'18':_0x10ef01['outboundUnknownCallsDay']+=0x1;_0x3473ad[_0xe4d9('0xde')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut[_0xe4d9('0x97')](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x12,_0x3a7ff2[_0xe4d9('0xdf')]||_0x3a7ff2[_0xe4d9('0xe0')]);ami[_0xe4d9('0x20')]('custom:amd',ut['buildObj'](_0x3473ad,_0xe4d9('0xe1')));rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xe2'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01['dialGlobalMaxRetry']){_0x2f6f7b=ut['cloneAction'](_0x3473ad,0xf,'Global');rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xe2'));}else{rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xe2'));}delete this[_0xe4d9('0x64')][_0x3a7ff2[_0xe4d9('0xa3')]];break;case'19':_0x10ef01[_0xe4d9('0x39')]+=0x1;_0x3473ad[_0xe4d9('0xb1')]=ut['totalGlobal'](_0x3473ad);ut[_0xe4d9('0x83')](_0x3473ad,0x13,_0x3a7ff2[_0xe4d9('0xdf')]||_0x3a7ff2['dialstatus']);ami['emit'](_0xe4d9('0xe3'),ut[_0xe4d9('0x9a')](_0x3473ad,_0xe4d9('0xe1')));rpcDb[_0xe4d9('0x88')](_0x3473ad,'[callProgressDetectingCustomer][machine]');if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut['cloneAction'](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb['createCustomerFinal'](_0x2f6f7b,_0xe4d9('0xe4'));}else{rpcDb['createCustomerFinal'](_0x3473ad,_0xe4d9('0xe4'));}delete this['actions'][_0x3a7ff2[_0xe4d9('0xa3')]];break;default:if(_0x3473ad[_0xe4d9('0x6a')]){ut[_0xe4d9('0x72')](_0x10ef01,_0xe4d9('0xe5'));ut[_0xe4d9('0x74')](_0xe4d9('0xe6')+_0x10ef01[_0xe4d9('0x23')],_0x3a7ff2);}_0x10ef01[_0xe4d9('0x39')]+=0x1;_0x3473ad['countglobal']=ut[_0xe4d9('0x97')](_0x3473ad);ut['logCustomer'](_0x3473ad,0xc,_0x3a7ff2[_0xe4d9('0xdf')]||_0x3a7ff2[_0xe4d9('0xe0')]);rpcDb[_0xe4d9('0x88')](_0x3473ad,_0xe4d9('0xe7'));if(ut[_0xe4d9('0x97')](_0x3473ad)>=_0x10ef01[_0xe4d9('0x9c')]){_0x2f6f7b=ut['cloneAction'](_0x3473ad,0xf,_0xe4d9('0x9e'));rpcDb[_0xe4d9('0x8c')](_0x2f6f7b,_0xe4d9('0xe8'));}else{rpcDb[_0xe4d9('0x8c')](_0x3473ad,_0xe4d9('0xe8'));}delete this[_0xe4d9('0x64')][_0x3a7ff2[_0xe4d9('0xa3')]];}if(!(_0x3473ad[_0xe4d9('0x6a')]&&_0x4ec908==='16')){ut[_0xe4d9('0x71')](_0x10ef01,'[callProgressDetectingCustomer]');logger['info'](_0xe4d9('0xe9'),_0x3473ad[_0xe4d9('0xea')],_0xe4d9('0xa8'),_0x10ef01[_0xe4d9('0x23')],'originated:\x20',_0x10ef01[_0xe4d9('0x44')]);}if(_0x4ec908!=='ANSWER'){delete this[_0xe4d9('0x64')][_0x3a7ff2[_0xe4d9('0xa3')]];delete this['actions'][_0x3a7ff2['destlinkedid']];}}};Preview[_0xe4d9('0xe')][_0xe4d9('0xeb')]=function(_0x34d518,_0x771610,_0x42370d){if(_[_0xe4d9('0xec')](_0x771610)&&_0xe4d9('0xed')!==typeof _0x771610){return;}if(_[_0xe4d9('0xec')](_0x42370d)&&'object'!==typeof _0x42370d){return;}switch(_0x42370d[_0xe4d9('0xee')]){case'0':ut[_0xe4d9('0xef')](_0x34d518,0x0,_0xe4d9('0x98'));rpcDb['createAgentHistory'](_0x34d518,_0xe4d9('0xf0'));break;case'3':ut[_0xe4d9('0xef')](_0x34d518,0x3,'NoAnswer');rpcDb[_0xe4d9('0xf1')](_0x34d518,_0xe4d9('0xf2'));break;case'5':ut[_0xe4d9('0xef')](_0x34d518,0x5,_0xe4d9('0xba'));rpcDb[_0xe4d9('0xf1')](_0x34d518,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe4d9('0xef')](_0x34d518,0x8,'Congestion');rpcDb['createAgentHistory'](_0x34d518,_0xe4d9('0xf3'));break;case'22':ut[_0xe4d9('0xef')](_0x34d518,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x34d518,_0xe4d9('0xf4'));break;default:ut[_0xe4d9('0xef')](_0x34d518,0xc,_0x42370d[_0xe4d9('0xee')]);rpcDb[_0xe4d9('0xf1')](_0x34d518,_0xe4d9('0xf3'));}ut[_0xe4d9('0x71')](_0x771610,_0xe4d9('0xf5'));logger[_0xe4d9('0x4f')](_0xe4d9('0xf6'),_0x34d518['uniqueid'],_0xe4d9('0xa8'),_0x771610['name'],'originated:\x20',_0x771610[_0xe4d9('0x44')]);delete this[_0xe4d9('0x64')][_0x34d518['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x294f63,_0x4f0e79,_0x2941d3,_0x4c8cd1,_0x40e057){var _0x1eb004=this;return new BPromise(function(_0x3f363d,_0xaf558e){if(_['isNil'](_0x4f0e79)||_[_0xe4d9('0x63')](_0x4f0e79[_0xe4d9('0xf7')])||_[_0xe4d9('0x63')](_0x4f0e79[_0xe4d9('0xf7')][_0xe4d9('0xf8')])||_['isNil'](_0x4f0e79['VoiceQueueId'])){_0xaf558e(ut[_0xe4d9('0x54')](_0xe4d9('0xf9'),_0x4c8cd1,_0x40e057));return;}var _0xefcf63=uuid['v4']();var _0xa5ddf3=_0x1eb004[_0xe4d9('0x1f')][_0x4f0e79[_0xe4d9('0x66')]['name']];var _0x1e76e9=_0x2941d3?_0x1eb004['agents'][_0x2941d3]['id']:undefined;_0x1eb004['actions'][_0xefcf63]=new Action(_0x4f0e79,_0xa5ddf3,_0xefcf63,_0x2941d3,_0x1e76e9);var _0x1fbcad=_0x1eb004[_0xe4d9('0x64')][_0xefcf63];_0x1fbcad[_0xe4d9('0xc2')]=_0x4c8cd1;_0x1fbcad[_0xe4d9('0xc3')]=_0x40e057;_0x1fbcad[_0xe4d9('0xfa')]=_0x2941d3;if(_['isEmpty'](_0x294f63)){_0x1eb004[_0xe4d9('0xfb')](_0x1fbcad,_0xa5ddf3,_0x4f0e79,_0x2941d3)['then'](function(_0x401970){logger[_0xe4d9('0x4f')](_0xe4d9('0xfc'),'Queue:\x20'+_0x1fbcad[_0xe4d9('0x67')]+'\x20IdHopper:\x20'+_0x1fbcad['idContact'],JSON[_0xe4d9('0x4b')](_0x401970));ami[_0xe4d9('0x20')]('custom:agentcalled',ut['buildObj'](_0x1fbcad,_0xe4d9('0xfd'),_0x1eb004[_0xe4d9('0x1f')][_0x1fbcad[_0xe4d9('0x67')]]));_0x3f363d(ut[_0xe4d9('0x54')](_0xe4d9('0xfe')));})[_0xe4d9('0x80')](function(_0x42447e){ut['logger']('[Preview][execCall][failure]',_0x42447e);_0xaf558e(ut[_0xe4d9('0x54')](_0xe4d9('0xff'),_0x4c8cd1,_0x40e057));});}else{_0xa5ddf3[_0xe4d9('0x2f')]+=0x1;ut[_0xe4d9('0x100')](_0x1fbcad);rpcDb['createHistory'](_0x1fbcad,_0xe4d9('0x101'));delete _0x1eb004[_0xe4d9('0x64')][_0xefcf63];_0xaf558e(ut[_0xe4d9('0x54')](_0xe4d9('0x102'),_0x4c8cd1,_0x40e057));}});};Preview[_0xe4d9('0xe')][_0xe4d9('0x91')]=function(_0x10f7eb){return!_[_0xe4d9('0x63')](_0x10f7eb)&&!_[_0xe4d9('0x63')](_0x10f7eb[_0xe4d9('0x23')])&&!_['isNil'](_0x10f7eb[_0xe4d9('0x48')])&&_0x10f7eb[_0xe4d9('0x48')]&&!_[_0xe4d9('0x63')](this[_0xe4d9('0x103')][util[_0xe4d9('0x4c')](_0xe4d9('0x104'),_0x10f7eb[_0xe4d9('0x23')])])&&!_[_0xe4d9('0x63')](this[_0xe4d9('0x103')][util['format'](_0xe4d9('0x104'),_0x10f7eb[_0xe4d9('0x23')])][_0xe4d9('0x6f')])&&(this['trunks'][util[_0xe4d9('0x4c')]('SIP/%s',_0x10f7eb[_0xe4d9('0x23')])]['status']==='reachable'||this['trunks'][util[_0xe4d9('0x4c')]('SIP/%s',_0x10f7eb['name'])][_0xe4d9('0x6f')]===_0xe4d9('0x105'));};Preview[_0xe4d9('0xe')]['run']=function(_0x1286cd,_0x2c52ee){var _0x2bf586=this;return new BPromise(function(_0x50c2b6,_0x2a35ad){_0x2bf586[_0xe4d9('0x106')](_0x1286cd,_0x2c52ee)[_0xe4d9('0x7d')](function(_0x3cd481){_0x50c2b6(_['pick'](_0x3cd481,[_0xe4d9('0x54')]));})[_0xe4d9('0x80')](function(_0x4bcdac){if(_0x4bcdac[_0xe4d9('0x107')]){rpcDb[_0xe4d9('0x108')](_0x1286cd);}if(_0x4bcdac[_0xe4d9('0x48')]){rpcDb[_0xe4d9('0x109')](_0x1286cd);}_0x2a35ad(_[_0xe4d9('0x6b')](_0x4bcdac,[_0xe4d9('0x54')]));});});};Preview[_0xe4d9('0xe')][_0xe4d9('0x106')]=function(_0x50d0ef,_0x1d1b63){var _0x71fe70=this;return new BPromise(function(_0x15945a,_0x3c2a9e){var _0x7f62c6,_0x39f82f;rpcDb[_0xe4d9('0x10a')](_0x50d0ef)[_0xe4d9('0x7d')](function(_0x36584b){if(!_[_0xe4d9('0x63')](_0x36584b[0x0])){_0x39f82f=_0x36584b[0x0]['recallme']?![]:!![];_0x7f62c6=_0x36584b[0x0][_0xe4d9('0x10b')]?!![]:![];_0x7f62c6=_0x1d1b63?!![]:_0x7f62c6;}var _0x1b08a6=_0x71fe70['validateContact'](_0x36584b);if(_0x1b08a6['isValid']){rpcDb[_0xe4d9('0x10c')](_[_0xe4d9('0x6b')](_0x36584b[0x0],[_0xe4d9('0x10d'),'Contact.phone']))[_0xe4d9('0x7d')](function(_0x3cbf6b){_0x71fe70['checkInBlack'](_0x3cbf6b,_0x36584b[0x0],_0x1d1b63,_0x39f82f,_0x7f62c6)[_0xe4d9('0x7d')](function(_0x368ed6){_0x15945a(_0x368ed6);})[_0xe4d9('0x80')](function(_0xcfc051){_0x3c2a9e(_0xcfc051);});})['catch'](function(_0xccaa05){ut['logger']('[Preview][checkIsBlackList]',_0xccaa05);_0x3c2a9e(ut[_0xe4d9('0x54')](_0xe4d9('0x10e'),_0x39f82f,_0x7f62c6));});}else{_0x3c2a9e(ut['message'](_0x1b08a6[_0xe4d9('0x54')],_0x39f82f,_0x7f62c6));}})['catch'](function(_0x41ae10){ut['logger'](_0xe4d9('0x10f'),_0x41ae10);_0x3c2a9e(ut[_0xe4d9('0x54')](_0xe4d9('0x10e'),![],!![]));});});};Preview['prototype'][_0xe4d9('0x110')]=function(_0x55d72b){if(_[_0xe4d9('0x63')](_0x55d72b)||_[_0xe4d9('0x111')](_0x55d72b)||!_['isNil'](_0x55d72b[0x0][_0xe4d9('0x112')])&&_['isNil'](_0x55d72b[0x0][_0xe4d9('0x112')][_0xe4d9('0x23')])){ut[_0xe4d9('0x57')](_0xe4d9('0x113'),_0x55d72b);return{'isValid':![],'message':_0xe4d9('0x114')};}var _0x299319=this[_0xe4d9('0x1f')][_0x55d72b[0x0][_0xe4d9('0x66')][_0xe4d9('0x23')]];_0x299319[_0xe4d9('0x54')]=_0xe4d9('0x94');if(_[_0xe4d9('0x63')](_0x299319)){ut[_0xe4d9('0x57')](_0xe4d9('0x115'),_0x299319);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xe4d9('0x91')](_0x299319[_0xe4d9('0x47')])){ut[_0xe4d9('0x57')](_0xe4d9('0x116'),_0xe4d9('0x117')+_0x299319[_0xe4d9('0x23')]+_0xe4d9('0x118'));if(!this['isTrunkReachable'](_0x299319[_0xe4d9('0x92')])){ut[_0xe4d9('0x57')](_0xe4d9('0x116'),_0x299319['name']+_0xe4d9('0x119'));return{'isValid':![],'message':_0xe4d9('0x11a')};}}if(!ut[_0xe4d9('0x90')](_0x299319[_0xe4d9('0x2c')])){ut[_0xe4d9('0x57')](_0xe4d9('0x11b'),_0x299319[_0xe4d9('0x23')]+_0xe4d9('0x11c'));return{'isValid':![],'message':_0xe4d9('0x117')+_0x299319[_0xe4d9('0x23')]+_0xe4d9('0x11c')};}return{'isValid':!![],'message':_0xe4d9('0x11d')};};Preview[_0xe4d9('0xe')][_0xe4d9('0xfb')]=function(_0x3fee53,_0x3284a8,_0x32373c,_0x4be41c){var _0x155627=this;return new BPromise(function(_0x4b3aef,_0x33384d){var _0x48d83a=_0x3fee53['uniqueid'];var _0x382c0e=_0x155627['isTrunkReachable'](_0x3284a8[_0xe4d9('0x47')])?util[_0xe4d9('0x4c')](_0xe4d9('0x11e'),_0x3284a8[_0xe4d9('0x47')][_0xe4d9('0x23')],_[_0xe4d9('0x63')](_0x3284a8[_0xe4d9('0x11f')])?'':_0x3284a8['dialPrefix'][_0xe4d9('0x120')]()||'',_0x3284a8[_0xe4d9('0x121')]>0x0?_0x32373c['Contact']['phone']['substring'](_0x3284a8[_0xe4d9('0x121')]):_0x32373c[_0xe4d9('0xf7')]['phone']):util[_0xe4d9('0x4c')](_0xe4d9('0x11e'),_[_0xe4d9('0x63')](_0x3284a8[_0xe4d9('0x92')])?_0x3284a8[_0xe4d9('0x47')][_0xe4d9('0x23')]:_0x3284a8[_0xe4d9('0x92')][_0xe4d9('0x23')],_['isNil'](_0x3284a8[_0xe4d9('0x11f')])?'':_0x3284a8[_0xe4d9('0x11f')][_0xe4d9('0x120')]()||'',_0x3284a8[_0xe4d9('0x121')]>0x0?_0x32373c[_0xe4d9('0xf7')]['phone'][_0xe4d9('0x122')](_0x3284a8[_0xe4d9('0x121')]):_0x32373c['Contact'][_0xe4d9('0xf8')]);var _0x491241=_0x155627[_0xe4d9('0x91')](_0x3284a8[_0xe4d9('0x47')])?ut[_0xe4d9('0x123')](_0x3284a8[_0xe4d9('0x47')][_0xe4d9('0x49')],_0x3284a8[_0xe4d9('0x124')],_0x3284a8[_0xe4d9('0x125')]>0x0?ut[_0xe4d9('0x126')](_0x3284a8[_0xe4d9('0x127')],_0x3284a8[_0xe4d9('0x125')]):_0x3284a8[_0xe4d9('0x127')]):ut[_0xe4d9('0x123')](_['isNil'](_0x3284a8[_0xe4d9('0x92')])?_0x3284a8[_0xe4d9('0x47')][_0xe4d9('0x49')]:_0x3284a8[_0xe4d9('0x92')][_0xe4d9('0x49')],_0x3284a8[_0xe4d9('0x124')],_0x3284a8[_0xe4d9('0x125')]>0x0?ut[_0xe4d9('0x126')](_0x3284a8[_0xe4d9('0x127')],_0x3284a8[_0xe4d9('0x125')]):_0x3284a8[_0xe4d9('0x127')]);if(_0x491241){_0x3fee53[_0xe4d9('0x128')]=ut[_0xe4d9('0x129')](_0x491241);_0x3fee53[_0xe4d9('0x12a')]=ut['extractCalleridNumber'](_0x491241);}var _0x2a84c9=ut[_0xe4d9('0x12b')](_0x3284a8,_0x32373c,_0x382c0e,_0x491241,_0x48d83a,_0x3fee53);_[_0xe4d9('0x12c')](_0x3fee53,ut[_0xe4d9('0x12d')](_0x2a84c9));_0x3fee53[_0xe4d9('0x81')]=moment()[_0xe4d9('0x4c')](_0xe4d9('0x82'));ami[_0xe4d9('0x12e')](ut['variablesAction'](_0x3fee53,_0x3284a8,_0x2a84c9,_0x3fee53['activeContact'],_0x4be41c))[_0xe4d9('0x7d')](function(_0x53268d){_0x3284a8['originated']+=0x1;logger[_0xe4d9('0x4f')](_0xe4d9('0x12f'),_0x48d83a,_0xe4d9('0xa8'),_0x3284a8['name'],'originated:\x20',_0x3284a8[_0xe4d9('0x44')]);_0x4b3aef(_0x53268d);})[_0xe4d9('0x80')](function(_0x10a54a){ut['logAgent'](_0x3fee53,0xe,_0xe4d9('0x130'));rpcDb[_0xe4d9('0xf1')](_0x3fee53,_0xe4d9('0x131'));_0x33384d(_0x10a54a);});});};Preview['prototype'][_0xe4d9('0x132')]=function(_0x483ce1){if(this[_0xe4d9('0x64')][_0x483ce1[_0xe4d9('0xa3')]]){this[_0xe4d9('0x64')][_0x483ce1[_0xe4d9('0xa3')]][_0xe4d9('0x70')]=_0x483ce1['channel'];}};Preview[_0xe4d9('0xe')]['syncOriginateResponse']=function(_0x3e0a91){var _0x40d369=this;var _0x4e1165=this['actions'][_0x3e0a91[_0xe4d9('0x133')]];if(_0x4e1165){if(_0x4e1165['lookAgent']&&this[_0xe4d9('0x134')][_0x4e1165[_0xe4d9('0xfa')]]){ut[_0xe4d9('0x135')](_0x4e1165,this[_0xe4d9('0x134')][_0x4e1165[_0xe4d9('0xfa')]][_0xe4d9('0x23')],this['agents'][_0x4e1165[_0xe4d9('0xfa')]]['id']);}var _0x55da19=_[_0xe4d9('0x136')](_0x4e1165);_0x55da19[_0xe4d9('0xa5')]=moment()[_0xe4d9('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1fec40=_0x40d369[_0xe4d9('0x1f')][_0x4e1165[_0xe4d9('0x67')]];if(ut['isFailure'](_0x3e0a91[_0xe4d9('0x137')])){if(_0x4e1165[_0xe4d9('0xc2')]){rpcDb[_0xe4d9('0x108')](_0x4e1165[_0xe4d9('0x138')]);}if(_0x4e1165[_0xe4d9('0xc3')]){rpcDb[_0xe4d9('0x109')](_0x4e1165[_0xe4d9('0x138')]);}ami[_0xe4d9('0x20')](_0xe4d9('0x139'),ut[_0xe4d9('0x9a')](_0x4e1165,_0xe4d9('0x13a'),this[_0xe4d9('0x1f')][_0x4e1165[_0xe4d9('0x67')]]));this[_0xe4d9('0xeb')](_0x55da19,_0x1fec40,_0x3e0a91);}else{_0x4e1165[_0xe4d9('0x81')]=moment()[_0xe4d9('0x4c')](_0xe4d9('0x82'));ut[_0xe4d9('0xef')](_0x55da19,0x4,'Answer');rpcDb[_0xe4d9('0xf1')](_0x55da19,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype']['syncHangup']=function(_0x31ac36){var _0xfc782f=this;var _0x3b56b1=this[_0xe4d9('0x64')][_0x31ac36[_0xe4d9('0xa3')]];var _0x809f73;if(_0x3b56b1){_0x809f73=this[_0xe4d9('0x1f')][_0x3b56b1[_0xe4d9('0x67')]];logger[_0xe4d9('0x4f')]('[syncHangup][talking]',_0x31ac36['linkedid'],'\x20Queue',_0x809f73[_0xe4d9('0x23')],'pTalking:\x20',_0x809f73[_0xe4d9('0x26')]);}if(this['actions'][_0x31ac36[_0xe4d9('0xa3')]]&&_0x31ac36[_0xe4d9('0xa3')]!==_0x31ac36['uniqueid']){if(_0x31ac36['cause']==='16'&&this['actions'][_0x31ac36['linkedid']][_0xe4d9('0x6a')]){this['callProgressDetectingCustomer'](_0x31ac36,_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')]);}else if(this['actions'][_0x31ac36[_0xe4d9('0xa3')]][_0xe4d9('0x6a')]){logger['info']('[syncHangup][talking][cause]',_0x31ac36['linkedid'],_0x31ac36[_0xe4d9('0x13b')],_0xe4d9('0xa8'),_0x809f73[_0xe4d9('0x23')],_0xe4d9('0x69'),_0x809f73[_0xe4d9('0x26')]);this[_0xe4d9('0x95')](_0x31ac36,_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')]);}}else if(_0x3b56b1&&_[_0xe4d9('0x63')](_0x3b56b1[_0xe4d9('0x13c')])&&_0x809f73['dialQueueProject']&&_0x31ac36[_0xe4d9('0xa3')]===_0x31ac36['uniqueid']&&_[_0xe4d9('0x63')](_0x31ac36[_0xe4d9('0xee')])&&_0x31ac36[_0xe4d9('0x13b')]==='16'&&_0x31ac36[_0xe4d9('0x13d')]==='6'&&_[_0xe4d9('0xec')](_0x3b56b1[_0xe4d9('0x13e')])){if(_0x3b56b1[_0xe4d9('0xc2')]){rpcDb[_0xe4d9('0x108')](_0x3b56b1[_0xe4d9('0x138')]);}if(_0x3b56b1[_0xe4d9('0xc3')]){rpcDb['disableContact'](_0x3b56b1[_0xe4d9('0x138')]);}_0x31ac36[_0xe4d9('0xee')]='22';this['callProgressDetectingAgent'](_0x3b56b1,_0x809f73,_0x31ac36);}else if(_0x3b56b1&&_0x3b56b1['transfer']){if(_0x31ac36['cause']==='16'&&this[_0xe4d9('0x64')][_0x31ac36[_0xe4d9('0xa3')]]['dialAnswer']){logger[_0xe4d9('0x4f')](_0xe4d9('0x13f'),_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')],_0xe4d9('0xa8'),_0x809f73[_0xe4d9('0x23')],_0xe4d9('0x69'),_0x809f73['pTalking']);this[_0xe4d9('0x95')](_0x31ac36,_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')]);}else if(this['actions'][_0x31ac36['linkedid']]['dialAnswer']){logger[_0xe4d9('0x4f')](_0xe4d9('0x140'),_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')],_0xe4d9('0xa8'),_0x809f73[_0xe4d9('0x23')],'pTalking:\x20',_0x809f73[_0xe4d9('0x26')]);this['callProgressDetectingCustomer'](_0x31ac36,_0x31ac36[_0xe4d9('0xa3')],_0x31ac36[_0xe4d9('0x13b')]);}}};Preview[_0xe4d9('0xe')]['syncDialEnd']=function(_0x2236e6){if(this[_0xe4d9('0x64')][_0x2236e6[_0xe4d9('0x141')]]&&_0x2236e6['destlinkedid']!==_0x2236e6[_0xe4d9('0x142')]){this[_0xe4d9('0x95')](_0x2236e6,_0x2236e6['destlinkedid'],_0x2236e6['dialstatus']);}};Preview[_0xe4d9('0xe')][_0xe4d9('0x17')]=function(_0x3f679b){if(this[_0xe4d9('0x64')][_0x3f679b[_0xe4d9('0xa3')]]&&_0x3f679b[_0xe4d9('0xa3')]!==_0x3f679b['uniqueid']&&!this[_0xe4d9('0x64')][_0x3f679b[_0xe4d9('0xa3')]][_0xe4d9('0x6a')]){if(_0x3f679b['cause']==='1'){this['callProgressDetectingCustomer'](_0x3f679b,_0x3f679b['linkedid'],_0x3f679b[_0xe4d9('0x13b')]);}}};Preview['prototype'][_0xe4d9('0x143')]=function(_0x46f323,_0xb0237c,_0x106bca){if(this['actions'][_0x46f323]){if(_['isNil'](this[_0xe4d9('0x64')][_0x46f323][_0xe4d9('0x144')])){this[_0xe4d9('0x64')][_0x46f323][_0xe4d9('0x144')]={};}this['actions'][_0x46f323][_0xe4d9('0x144')][_0xb0237c]=_0x106bca;}};Preview[_0xe4d9('0xe')][_0xe4d9('0x145')]=function(_0x317d71){try{if(!_[_0xe4d9('0x63')](_0x317d71)){if(ut[_0xe4d9('0x146')](_[_0xe4d9('0x147')](_0x317d71[_0xe4d9('0x148')])[0x0])){this[_0xe4d9('0x143')](_0x317d71[_0xe4d9('0xea')],_[_0xe4d9('0x147')](_0x317d71[_0xe4d9('0x148')])[0x0],_0x317d71[_0xe4d9('0x149')]);}}}catch(_0x2f4a9d){logger['error'](_0xe4d9('0x14a'),util['inspect'](_0x2f4a9d,{'showHidden':![],'depth':null}));}};Preview[_0xe4d9('0xe')][_0xe4d9('0x1b')]=function(_0x13c95e){if(_0x13c95e){if(this[_0xe4d9('0x64')][_0x13c95e[_0xe4d9('0x14b')]]){this[_0xe4d9('0x64')][_0x13c95e[_0xe4d9('0x14b')]][_0xe4d9('0x13e')]=!![];}}};Preview[_0xe4d9('0xe')]['syncBlindTransfer']=function(_0x1c2eb0){if(_0x1c2eb0){if(this['actions'][_0x1c2eb0[_0xe4d9('0x14c')]]){this[_0xe4d9('0x64')][_0x1c2eb0[_0xe4d9('0x14c')]][_0xe4d9('0x13e')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x7dfd=['[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','logAgent','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','unlock','unlockContact','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','Action','variablesAction','[originated][increment]','OriginateError','actionid','logLookAgent','isFailure','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','ListId','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','responsetime','uniqueid','\x20Queue','connect','acw','buildAcw','custom:agentcomplete','complete','Answer','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]'];(function(_0x5814ca,_0x3b6713){var _0xeb1833=function(_0x553de1){while(--_0x553de1){_0x5814ca['push'](_0x5814ca['shift']());}};_0xeb1833(++_0x3b6713);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd7df('0x0'));var _=require(_0xd7df('0x1'));var BPromise=require(_0xd7df('0x2'));var uuid=require(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var md5=require(_0xd7df('0x5'));var Redis=require(_0xd7df('0x6'));var config=require(_0xd7df('0x7'));var logger=require(_0xd7df('0x8'))(_0xd7df('0x9'));var loggerAction=require(_0xd7df('0x8'))(_0xd7df('0xa'));var ami=require(_0xd7df('0xb'));var rpcDb=require(_0xd7df('0xc'));var Action=require(_0xd7df('0xd'));var ut=require(_0xd7df('0xe'));config[_0xd7df('0xf')]=_['defaults'](config[_0xd7df('0xf')],{'host':_0xd7df('0x10'),'port':0x18eb});var io=require(_0xd7df('0x11'))(new Redis(config[_0xd7df('0xf')]));var Sequence=function(){};Sequence['prototype'][_0xd7df('0x12')]=function(_0x532c14){this[_0xd7df('0x13')]=this['tail']?this[_0xd7df('0x13')][_0xd7df('0x14')](_0x532c14):_0x532c14();};function Preview(_0x28d358){this[_0xd7df('0x15')]=new Sequence();this[_0xd7df('0x16')]=_0x28d358[_0xd7df('0x17')];this[_0xd7df('0x18')]=_0x28d358[_0xd7df('0x18')];this[_0xd7df('0x19')]={};this[_0xd7df('0x1a')]=_0x28d358[_0xd7df('0x1a')];this[_0xd7df('0x1b')]=0x0;ami['on'](_0xd7df('0x1c'),this[_0xd7df('0x1d')][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x1f'),this[_0xd7df('0x20')]['bind'](this));ami['on'](_0xd7df('0x21'),this[_0xd7df('0x22')]['bind'](this));ami['on'](_0xd7df('0x23'),this[_0xd7df('0x24')]['bind'](this));ami['on'](_0xd7df('0x25'),this[_0xd7df('0x26')][_0xd7df('0x1e')](this));ami['on']('varset',this[_0xd7df('0x27')][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x28'),this['syncAttendedTransfer'][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x29'),this[_0xd7df('0x2a')]['bind'](this));this[_0xd7df('0x2b')](this['campaignsPreview']);}function emit(_0x225e33,_0x5ab737,_0x3ae7c3){io['to'](_0x225e33)[_0xd7df('0x2c')](_0x5ab737,_0x3ae7c3);}function emitCampaignPreview(_0x4eabb8){if(_0x4eabb8['type']===_0xd7df('0x2d')){var _0x502ae8={'id':_0x4eabb8['id'],'name':_0x4eabb8[_0xd7df('0x2e')],'strategy':_0x4eabb8[_0xd7df('0x2f')],'answered':_0x4eabb8[_0xd7df('0x30')],'available':_0x4eabb8[_0xd7df('0x31')],'loggedIn':_0x4eabb8[_0xd7df('0x32')],'pTalking':_0x4eabb8[_0xd7df('0x33')],'sumBillable':_0x4eabb8[_0xd7df('0x34')],'sumDuration':_0x4eabb8['sumDuration'],'sumHoldTime':_0x4eabb8['sumHoldTime']||0x0,'talking':_0x4eabb8[_0xd7df('0x35')],'total':_0x4eabb8[_0xd7df('0x36')],'type':_0x4eabb8[_0xd7df('0x37')],'unmanaged':_0x4eabb8[_0xd7df('0x38')],'abandoned':_0x4eabb8[_0xd7df('0x39')],'waiting':_0x4eabb8[_0xd7df('0x3a')],'loggedInDb':_0x4eabb8[_0xd7df('0x3b')],'dialActive':_0x4eabb8[_0xd7df('0x3c')],'dialMethod':_0x4eabb8[_0xd7df('0x3d')],'dialOriginateCallerIdName':_0x4eabb8['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4eabb8[_0xd7df('0x3e')],'dialOriginateTimeout':_0x4eabb8[_0xd7df('0x3f')],'dialPrefix':_0x4eabb8[_0xd7df('0x40')],'outboundAnswerAgiCallsDay':_0x4eabb8[_0xd7df('0x41')],'outboundAnswerCallsDay':_0x4eabb8[_0xd7df('0x42')],'outboundBlacklistCallsDay':_0x4eabb8[_0xd7df('0x43')],'outboundBusyCallsDay':_0x4eabb8[_0xd7df('0x44')],'outboundCongestionCallsDay':_0x4eabb8[_0xd7df('0x45')],'outboundDropCallsDayACS':_0x4eabb8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4eabb8['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4eabb8['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4eabb8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4eabb8['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4eabb8[_0xd7df('0x46')],'outboundReCallsDay':_0x4eabb8['outboundReCallsDay'],'outboundRejectCallsDay':_0x4eabb8[_0xd7df('0x47')],'outboundUnknownCallsDay':_0x4eabb8[_0xd7df('0x48')],'outboundAbandonedCallsDay':_0x4eabb8['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4eabb8[_0xd7df('0x49')],'predictiveIntervalAvgHoldtime':_0x4eabb8[_0xd7df('0x4a')],'predictiveIntervalAvgTalktime':_0x4eabb8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4eabb8[_0xd7df('0x4b')],'predictiveIntervalDroppedCallsTimeout':_0x4eabb8[_0xd7df('0x4c')],'predictiveIntervalErlangCalls':_0x4eabb8[_0xd7df('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0x4eabb8[_0xd7df('0x4e')],'predictiveIntervalHitRate':_0x4eabb8[_0xd7df('0x4f')],'predictiveIntervalMultiplicativeFactor':_0x4eabb8[_0xd7df('0x50')],'predictiveIntervalPauses':_0x4eabb8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4eabb8[_0xd7df('0x51')],'predictiveIntervalTotalCalls':_0x4eabb8[_0xd7df('0x52')],'message':_0x4eabb8[_0xd7df('0x53')],'originated':_0x4eabb8[_0xd7df('0x54')],'erlangCalls':_0x4eabb8[_0xd7df('0x55')],'erlangCallToSecond':_0x4eabb8[_0xd7df('0x56')],'erlangAbandonmentRate':_0x4eabb8[_0xd7df('0x57')],'erlangBusyFactor':_0x4eabb8[_0xd7df('0x58')],'startPredictive':_0x4eabb8[_0xd7df('0x59')],'startProgressive':_0x4eabb8[_0xd7df('0x5a')]};if(_0x4eabb8[_0xd7df('0x5b')]){_0x502ae8['Trunk']={'id':_0x4eabb8['Trunk']['id'],'name':_0x4eabb8[_0xd7df('0x5b')]['name'],'active':_0x4eabb8[_0xd7df('0x5b')][_0xd7df('0x5c')],'callerid':_0x4eabb8[_0xd7df('0x5b')][_0xd7df('0x5d')]};}if(_0x4eabb8['Interval']){_0x502ae8['Interval']={'id':_0x4eabb8['Interval']['id'],'name':_0x4eabb8[_0xd7df('0x5e')][_0xd7df('0x2e')]};}var _0x55c43f=md5(JSON[_0xd7df('0x5f')](_0x502ae8));if(_0x4eabb8[_0xd7df('0x5')]!==_0x55c43f){_0x4eabb8[_0xd7df('0x5')]=_0x55c43f;emit(util[_0xd7df('0x60')]('voice:queue:%s',_0x502ae8[_0xd7df('0x2e')]),_0xd7df('0x61'),_0x502ae8);}}}function emitVoiceQueueChannelRemove(_0x5f0a6d){logger[_0xd7df('0x62')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd7df('0x5f')](_0x5f0a6d));emit(util[_0xd7df('0x60')](_0xd7df('0x63'),_0x5f0a6d['name']),_0xd7df('0x64'),_0x5f0a6d);io[_0xd7df('0x2c')](_0xd7df('0x65'),_0x5f0a6d);}function notSendMessagesQueue(_0x379e32){if(_0x379e32['sendMessageOneNotActive']){if(_0x379e32[_0xd7df('0x54')]===0x0&&_0x379e32[_0xd7df('0x33')]===0x0){_0x379e32[_0xd7df('0x66')]=![];_0x379e32['available']=0x0;_0x379e32[_0xd7df('0x67')]=0x0;_0x379e32[_0xd7df('0x53')]=_0xd7df('0x68');ut['logger'](_0xd7df('0x69'),_0x379e32[_0xd7df('0x2e')]+'\x20is\x20not\x20active');}else{_0x379e32['message']=_0xd7df('0x6a');ut[_0xd7df('0x6b')](_0xd7df('0x69'),_0x379e32['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x379e32);}}Preview[_0xd7df('0x6c')]['loopCampaigns']=function(){var _0xe606f4=this;setInterval(function(){_0xe606f4['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xd7df('0x6d')]=function(){var _0x579d0f=this[_0xd7df('0x16')];this[_0xd7df('0x1b')]+=0x1;for(var _0xad2d69 in _0x579d0f){if(_0x579d0f[_0xd7df('0x6e')](_0xad2d69)&&(_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x9')||_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x6f'))&&_0x579d0f[_0xad2d69][_0xd7df('0x37')]==='outbound'){if(this[_0xd7df('0x1b')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xd7df('0x70')]();}}if(_0x579d0f[_0xd7df('0x6e')](_0xad2d69)&&_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x9')&&_0x579d0f[_0xad2d69][_0xd7df('0x37')]===_0xd7df('0x2d')){if(_0x579d0f[_0xad2d69][_0xd7df('0x3c')]){this[_0xd7df('0x71')](_0x579d0f[_0xad2d69]);if(_0x579d0f[_0xad2d69][_0xd7df('0x72')])this['recallMe'](_0x579d0f[_0xad2d69]);}else{notSendMessagesQueue(_0x579d0f[_0xad2d69]);}}}};Preview[_0xd7df('0x6c')][_0xd7df('0x73')]=function(_0x49085b){var _0x4af751=this;this[_0xd7df('0x15')][_0xd7df('0x12')](function(){if(!_[_0xd7df('0x74')](_0x4af751['actions'][_0x49085b])){loggerAction['info'](_0xd7df('0x75'),_0x49085b,'Queue',_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')],_0xd7df('0x77'),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]][_0xd7df('0x54')]),_0xd7df('0x78'),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b]['queue']][_0xd7df('0x33')]),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x79')]),JSON[_0xd7df('0x5f')](_['pick'](_0x4af751[_0xd7df('0x19')][_0x49085b],[_0xd7df('0x7a'),_0xd7df('0x7b'),'VoiceQueueId',_0xd7df('0x7c')])));return ami['Action']({'action':_0xd7df('0x7d'),'channel':_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x7e')]})[_0xd7df('0x7f')](function(_0xc4a51b){if(_0xc4a51b['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x4af751['actions'][_0x49085b]){ut[_0xd7df('0x80')](_0x4af751['campaignsPreview'][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]],_0xd7df('0x81'));if(_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x79')]===!![]){ut[_0xd7df('0x82')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]],_0xd7df('0x81'));ut[_0xd7df('0x83')](_0xd7df('0x84')+_0x49085b,_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]);}ut[_0xd7df('0x83')](_0xd7df('0x85')+_0x49085b,_0x4af751['actions'][_0x49085b][_0xd7df('0x76')]);delete _0x4af751[_0xd7df('0x19')][_0x49085b];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x238e3c=this;loggerAction['info'](_0xd7df('0x86'),_['size'](this[_0xd7df('0x19')]));for(var _0x28151a in this[_0xd7df('0x19')]){if(_0x238e3c['actions']['hasOwnProperty'](_0x28151a)){_0x238e3c['clearZombieChannel'](_0x28151a);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x87')]=function(_0x19c387){var _0x527b6f=this;rpcDb[_0xd7df('0x88')](_0x19c387['id'],ut[_0xd7df('0x89')](this['agents']))[_0xd7df('0x8a')](function(_0x3570c4){if(!_[_0xd7df('0x74')](_0x3570c4)){for(var _0x25d187=0x0;_0x25d187<_0x3570c4[_0xd7df('0x8b')];_0x25d187+=0x1){if(ut[_0xd7df('0x8c')](_0x3570c4[_0x25d187][_0xd7df('0x8d')])<_0x19c387[_0xd7df('0x8e')]*0x3c){if(_0x3570c4[_0x25d187][_0xd7df('0x8f')]&&!_0x3570c4[_0x25d187][_0xd7df('0x8f')][_0xd7df('0x90')]){_0x527b6f[_0xd7df('0x91')](_0x3570c4[_0x25d187]['id'])[_0xd7df('0x8a')](ut[_0xd7df('0x92')](_0xd7df('0x93')))[_0xd7df('0x7f')](ut[_0xd7df('0x92')](_0xd7df('0x93')));}else{rpcDb[_0xd7df('0x94')](_0x3570c4[_0x25d187]['id']);}}else{var _0x1e6277=new Action(_0x3570c4[_0x25d187],_0x19c387);_0x1e6277[_0xd7df('0x95')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));_0x19c387[_0xd7df('0x97')]+=0x1;ut[_0xd7df('0x98')](_0x1e6277,0x17,_0xd7df('0x99'));if(_0x19c387['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xd7df('0x9a')](_0x3570c4[_0x25d187]));rpcDb[_0xd7df('0x9b')](_0x1e6277,_0xd7df('0x9c'));}else{ut['logCustomer'](_0x1e6277,0x16,_0xd7df('0x9d'));rpcDb[_0xd7df('0x9b')](_0x1e6277,_0xd7df('0x9e'));rpcDb[_0xd7df('0x9f')](_0x1e6277,'[HistoryRecallClose]');}}}}})[_0xd7df('0x7f')](ut[_0xd7df('0x92')](_0xd7df('0xa0')));};Preview[_0xd7df('0x6c')][_0xd7df('0x71')]=function(_0x2fbc53){_0x2fbc53[_0xd7df('0x66')]=!![];if(ut[_0xd7df('0xa1')](_0x2fbc53['loggedIn'])){_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa2');}else if(!ut['isActive'](_0x2fbc53['dialActive'])){_0x2fbc53['message']=_0xd7df('0x68');}else if(!this[_0xd7df('0xa3')](_0x2fbc53[_0xd7df('0x5b')])){if(!this[_0xd7df('0xa3')](_0x2fbc53['TrunkBackup'])){_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa4');}else{_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa5');}}else{_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa5');}emitCampaignPreview(_0x2fbc53);};Preview[_0xd7df('0x6c')]['callProgressDetectingCustomer']=function(_0x535925,_0x40d5c9,_0x5c1e68){var _0x588537=this;var _0x332fb3=this[_0xd7df('0x19')][_0x40d5c9];var _0x55b859=this['campaignsPreview'][_0x332fb3[_0xd7df('0x76')]];var _0x44d824;if(_0x55b859){switch(_0x5c1e68){case'1':_0x55b859['outboundNoSuchCallsDay']+=0x1;_0x332fb3[_0xd7df('0xa6')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x0,_0xd7df('0xa8'));ami['emit'](_0xd7df('0xa9'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xab')));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xac'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x332fb3[_0xd7df('0xa6')]>=_0x55b859[_0xd7df('0xb1')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xb2'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xa6'),_0x55b859[_0xd7df('0xb5')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3['activeContact']);}}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;case'ANSWER':var _0xb80762=moment()[_0xd7df('0x60')](_0xd7df('0x96'));_0x332fb3[_0xd7df('0xb8')]=_0xb80762;_0x332fb3['answertime']=_0xb80762;_0x332fb3['dialAnswer']=!![];_0x55b859['pTalking']+=0x1;logger[_0xd7df('0x62')]('[syncHangup][talking][increment]',_0x332fb3[_0xd7df('0xb9')],_0xd7df('0xba'),_0x55b859[_0xd7df('0x2e')],_0xd7df('0x78'),_0x55b859[_0xd7df('0x33')]);ami[_0xd7df('0x2c')]('custom:agentconnect',ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xbb'),this[_0xd7df('0x16')][_0x332fb3['queue']]));if(_0x55b859[_0xd7df('0xbc')]){ami[_0xd7df('0x2c')]('custom:agentConnectPreview',ut[_0xd7df('0xbd')](_0x332fb3));}break;case'16':ami[_0xd7df('0x2c')](_0xd7df('0xbe'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xbf'),this[_0xd7df('0x16')][_0x332fb3[_0xd7df('0x76')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x332fb3,_0xd7df('0xbf')));_0x55b859[_0xd7df('0x42')]+=0x1;_0x55b859[_0xd7df('0x36')]+=0x1;_0x55b859[_0xd7df('0x30')]+=0x1;ut['decrementTalkink'](_0x55b859,'[16]');_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x4,_0xd7df('0xc0'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xd7df('0x9f')](_0x332fb3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x332fb3);_0x55b859[_0xd7df('0xc1')]+=_0x332fb3[_0xd7df('0xc2')];_0x55b859[_0xd7df('0x34')]+=_0x332fb3[_0xd7df('0xc2')];logger[_0xd7df('0x62')](_0xd7df('0xc3'),_0x332fb3['uniqueid'],'\x20Queue',_0x55b859[_0xd7df('0x2e')],_0xd7df('0x78'),_0x55b859[_0xd7df('0x33')]);delete this[_0xd7df('0x19')][_0x535925['linkedid']];break;case _0xd7df('0xc4'):_0x55b859['outboundBusyCallsDay']+=0x1;_0x332fb3[_0xd7df('0xc5')]+=0x1;_0x332fb3['countglobal']=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x5,_0xd7df('0xc6'));ami[_0xd7df('0x2c')](_0xd7df('0xc7'),ut[_0xd7df('0xaa')](_0x332fb3,'busy'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xc8'));}else{if(_0x332fb3[_0xd7df('0xc5')]>=_0x55b859[_0xd7df('0xc9')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xca'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xc5'),_0x55b859[_0xd7df('0xcb')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xcd'):_0x55b859['outboundNoAnswerCallsDay']+=0x1;_0x332fb3[_0xd7df('0xce')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut['logCustomer'](_0x332fb3,0x3,'NoAnswer');ami[_0xd7df('0x2c')](_0xd7df('0xcf'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xd0')));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xd1'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xd2'));}else{if(_0x332fb3[_0xd7df('0xce')]>=_0x55b859[_0xd7df('0xd3')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xd1'));}else{rpcDb[_0xd7df('0xb3')](ut['scheduledAt'](_0x332fb3,'countnoanswerretry',_0x55b859[_0xd7df('0xd4')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xd5'):_0x55b859[_0xd7df('0x45')]+=0x1;_0x332fb3['countcongestionretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x8,_0xd7df('0xd6'));ami[_0xd7df('0x2c')](_0xd7df('0xd7'),ut[_0xd7df('0xaa')](_0x332fb3,'congestion'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xd8'));}else{if(_0x332fb3['countcongestionretry']>=_0x55b859['dialCongestionMaxRetry']){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xd9'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xda'),_0x55b859['dialBusyRetryFrequency']),_0x332fb3['unlockAgent'],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xdb'):_0x55b859[_0xd7df('0x47')]+=0x1;_0x332fb3[_0xd7df('0xdc')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x14,_0xd7df('0xdd'));ami[_0xd7df('0x2c')](_0xd7df('0xde'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xdf')));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[syncHangupRequest][logAgentReject]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0x14,'AgentReject');rpcDb[_0xd7df('0x9f')](_0x44d824,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x332fb3[_0xd7df('0xdc')]>=_0x55b859[_0xd7df('0xe0')]){rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xe1'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xdc'),_0x55b859[_0xd7df('0xe2')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xe3'):_0x55b859[_0xd7df('0xe4')]+=0x1;_0x332fb3['countabandonedretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut['logCustomer'](_0x332fb3,0xb,'Abandoned');rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xe5'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb[_0xd7df('0x9f')](_0x44d824,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x332fb3[_0xd7df('0xe6')]>=_0x55b859[_0xd7df('0xe7')]){rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xe8'),_0x55b859[_0xd7df('0xe9')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case'18':_0x55b859[_0xd7df('0x48')]+=0x1;_0x332fb3['countmachineretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x12,_0x535925[_0xd7df('0xea')]||_0x535925[_0xd7df('0xeb')]);ami[_0xd7df('0x2c')](_0xd7df('0xec'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xed')));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859['dialGlobalMaxRetry']){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb[_0xd7df('0x9f')](_0x44d824,_0xd7df('0xee'));}else{rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xee'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;case'19':_0x55b859[_0xd7df('0x48')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x13,_0x535925[_0xd7df('0xea')]||_0x535925['dialstatus']);ami[_0xd7df('0x2c')]('custom:amd',ut['buildObj'](_0x332fb3,'amd'));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xef'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xef'));}else{rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xef'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;default:if(_0x332fb3[_0xd7df('0x79')]){ut['decrementTalkink'](_0x55b859,_0xd7df('0xf0'));ut['loggerError'](_0xd7df('0xf1')+_0x55b859[_0xd7df('0x2e')],_0x535925);}_0x55b859['outboundUnknownCallsDay']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0xc,_0x535925[_0xd7df('0xea')]||_0x535925[_0xd7df('0xeb')]);rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xf2'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859['dialGlobalMaxRetry']){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xf3'));}else{rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xf3'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];}if(!(_0x332fb3[_0xd7df('0x79')]&&_0x5c1e68==='16')){ut[_0xd7df('0x80')](_0x55b859,'[callProgressDetectingCustomer]');logger[_0xd7df('0x62')](_0xd7df('0xf4'),_0x332fb3[_0xd7df('0xb9')],_0xd7df('0xba'),_0x55b859[_0xd7df('0x2e')],_0xd7df('0x77'),_0x55b859[_0xd7df('0x54')]);}if(_0x5c1e68!=='ANSWER'){delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];delete this[_0xd7df('0x19')][_0x535925['destlinkedid']];}}};Preview['prototype'][_0xd7df('0xf5')]=function(_0x5275f3,_0x244ac3,_0x5c5af5){if(_[_0xd7df('0xf6')](_0x244ac3)&&_0xd7df('0xf7')!==typeof _0x244ac3){return;}if(_[_0xd7df('0xf6')](_0x5c5af5)&&'object'!==typeof _0x5c5af5){return;}switch(_0x5c5af5['reason']){case'0':ut[_0xd7df('0xf8')](_0x5275f3,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x5275f3,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x5275f3,0x3,_0xd7df('0xf9'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfb'));break;case'5':ut[_0xd7df('0xf8')](_0x5275f3,0x5,_0xd7df('0xc6'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfc'));break;case'8':ut[_0xd7df('0xf8')](_0x5275f3,0x8,_0xd7df('0xd6'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfd'));break;case'22':ut[_0xd7df('0xf8')](_0x5275f3,0x16,_0xd7df('0xfe'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xff'));break;default:ut[_0xd7df('0xf8')](_0x5275f3,0xc,_0x5c5af5['reason']);rpcDb[_0xd7df('0xfa')](_0x5275f3,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd7df('0x80')](_0x244ac3,_0xd7df('0x100'));logger[_0xd7df('0x62')]('[originated][decrement][callProgressDetectingAgent]',_0x5275f3['uniqueid'],_0xd7df('0xba'),_0x244ac3[_0xd7df('0x2e')],_0xd7df('0x77'),_0x244ac3['originated']);delete this[_0xd7df('0x19')][_0x5275f3[_0xd7df('0xb9')]];};Preview['prototype'][_0xd7df('0x101')]=function(_0x3494e8,_0x5dc0ed,_0x2c94db,_0x52a8d8,_0x5e7f75){var _0x4e8ce0=this;return new BPromise(function(_0x40c32a,_0x1b90a3){if(_['isNil'](_0x5dc0ed)||_[_0xd7df('0x74')](_0x5dc0ed['Contact'])||_[_0xd7df('0x74')](_0x5dc0ed[_0xd7df('0x102')][_0xd7df('0x103')])||_['isNil'](_0x5dc0ed[_0xd7df('0x104')])){_0x1b90a3(ut[_0xd7df('0x53')](_0xd7df('0x105'),_0x52a8d8,_0x5e7f75));return;}var _0x246b97=uuid['v4']();var _0x45fbb1=_0x4e8ce0[_0xd7df('0x16')][_0x5dc0ed[_0xd7df('0x106')][_0xd7df('0x2e')]];var _0x488607=_0x2c94db?_0x4e8ce0['agents'][_0x2c94db]['id']:undefined;_0x4e8ce0[_0xd7df('0x19')][_0x246b97]=new Action(_0x5dc0ed,_0x45fbb1,_0x246b97,_0x2c94db,_0x488607);var _0x4e6e77=_0x4e8ce0['actions'][_0x246b97];_0x4e6e77[_0xd7df('0xb6')]=_0x52a8d8;_0x4e6e77[_0xd7df('0xcc')]=_0x5e7f75;_0x4e6e77[_0xd7df('0x107')]=_0x2c94db;if(_[_0xd7df('0x108')](_0x3494e8)){_0x4e8ce0[_0xd7df('0x109')](_0x4e6e77,_0x45fbb1,_0x5dc0ed,_0x2c94db)['then'](function(_0x2b5791){logger[_0xd7df('0x62')](_0xd7df('0x10a'),_0xd7df('0x10b')+_0x4e6e77[_0xd7df('0x76')]+_0xd7df('0x10c')+_0x4e6e77[_0xd7df('0x10d')],JSON[_0xd7df('0x5f')](_0x2b5791));ami['emit'](_0xd7df('0x10e'),ut[_0xd7df('0xaa')](_0x4e6e77,_0xd7df('0x10f'),_0x4e8ce0[_0xd7df('0x16')][_0x4e6e77['queue']]));_0x40c32a(ut['message'](_0xd7df('0x110')));})[_0xd7df('0x7f')](function(_0x4af3bc){ut['logger'](_0xd7df('0x111'),_0x4af3bc);_0x1b90a3(ut['message'](_0xd7df('0x112'),_0x52a8d8,_0x5e7f75));});}else{_0x45fbb1[_0xd7df('0x43')]+=0x1;ut['logBlacklist'](_0x4e6e77);rpcDb[_0xd7df('0x113')](_0x4e6e77,'[Blacklist][error]');delete _0x4e8ce0[_0xd7df('0x19')][_0x246b97];_0x1b90a3(ut[_0xd7df('0x53')](_0xd7df('0x114'),_0x52a8d8,_0x5e7f75));}});};Preview[_0xd7df('0x6c')][_0xd7df('0xa3')]=function(_0x1fe4be){return!_[_0xd7df('0x74')](_0x1fe4be)&&!_[_0xd7df('0x74')](_0x1fe4be['name'])&&!_['isNil'](_0x1fe4be[_0xd7df('0x5c')])&&_0x1fe4be[_0xd7df('0x5c')]&&!_[_0xd7df('0x74')](this['trunks'][util['format'](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])])&&!_[_0xd7df('0x74')](this['trunks'][util[_0xd7df('0x60')](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])]['status'])&&(this[_0xd7df('0x18')][util[_0xd7df('0x60')](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])][_0xd7df('0x7d')]===_0xd7df('0x116')||this['trunks'][util['format']('SIP/%s',_0x1fe4be[_0xd7df('0x2e')])][_0xd7df('0x7d')]===_0xd7df('0x117'));};Preview[_0xd7df('0x6c')]['run']=function(_0x32b24c,_0x249f4c){var _0x5edd49=this;return new BPromise(function(_0x9dfc27,_0x57e2f9){_0x5edd49[_0xd7df('0x118')](_0x32b24c,_0x249f4c)[_0xd7df('0x8a')](function(_0x191ab8){_0x9dfc27(_[_0xd7df('0x119')](_0x191ab8,[_0xd7df('0x53')]));})['catch'](function(_0x48183e){if(_0x48183e[_0xd7df('0x11a')]){rpcDb[_0xd7df('0x11b')](_0x32b24c);}if(_0x48183e[_0xd7df('0x5c')]){rpcDb['disableContact'](_0x32b24c);}_0x57e2f9(_[_0xd7df('0x119')](_0x48183e,[_0xd7df('0x53')]));});});};Preview[_0xd7df('0x6c')][_0xd7df('0x118')]=function(_0x5479dc,_0x1c2dad){var _0x32df94=this;return new BPromise(function(_0x5e69ae,_0x2e7b75){var _0x139b57,_0x51e16e;rpcDb['getContactPreview'](_0x5479dc)['then'](function(_0x3a47c2){if(!_[_0xd7df('0x74')](_0x3a47c2[0x0])){_0x51e16e=_0x3a47c2[0x0][_0xd7df('0x11c')]?![]:!![];_0x139b57=_0x3a47c2[0x0][_0xd7df('0x11c')]?!![]:![];_0x139b57=_0x1c2dad?!![]:_0x139b57;}var _0x38389f=_0x32df94[_0xd7df('0x11d')](_0x3a47c2);if(_0x38389f[_0xd7df('0x11e')]){rpcDb['checkIsBlackList'](_['pick'](_0x3a47c2[0x0],['VoiceQueueId',_0xd7df('0x11f')]))['then'](function(_0x188610){_0x32df94[_0xd7df('0x101')](_0x188610,_0x3a47c2[0x0],_0x1c2dad,_0x51e16e,_0x139b57)['then'](function(_0x3d058a){_0x5e69ae(_0x3d058a);})[_0xd7df('0x7f')](function(_0xafcb26){_0x2e7b75(_0xafcb26);});})[_0xd7df('0x7f')](function(_0x472d0d){ut['logger'](_0xd7df('0x120'),_0x472d0d);_0x2e7b75(ut['message']('Call\x20unsuccessful',_0x51e16e,_0x139b57));});}else{_0x2e7b75(ut[_0xd7df('0x53')](_0x38389f['message'],_0x51e16e,_0x139b57));}})['catch'](function(_0x36d991){ut['logger'](_0xd7df('0x121'),_0x36d991);_0x2e7b75(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd7df('0x6c')]['validateContact']=function(_0x36f7d4){if(_[_0xd7df('0x74')](_0x36f7d4)||_['isEmpty'](_0x36f7d4)||!_[_0xd7df('0x74')](_0x36f7d4[0x0][_0xd7df('0x8f')])&&_[_0xd7df('0x74')](_0x36f7d4[0x0][_0xd7df('0x8f')]['name'])){ut[_0xd7df('0x6b')](_0xd7df('0x122'),_0x36f7d4);return{'isValid':![],'message':_0xd7df('0x123')};}var _0x53508f=this['campaignsPreview'][_0x36f7d4[0x0][_0xd7df('0x106')]['name']];_0x53508f[_0xd7df('0x53')]=_0xd7df('0xa5');if(_[_0xd7df('0x74')](_0x53508f)){ut['logger'](_0xd7df('0x124'),_0x53508f);return{'isValid':![],'message':_0xd7df('0x125')};}if(!this[_0xd7df('0xa3')](_0x53508f[_0xd7df('0x5b')])){ut['logger'](_0xd7df('0x126'),_0xd7df('0x127')+_0x53508f[_0xd7df('0x2e')]+_0xd7df('0x128'));if(!this[_0xd7df('0xa3')](_0x53508f[_0xd7df('0x129')])){ut['logger'](_0xd7df('0x126'),_0x53508f['name']+_0xd7df('0x12a'));return{'isValid':![],'message':_0xd7df('0x12b')};}}if(!ut[_0xd7df('0x12c')](_0x53508f['dialActive'])){ut[_0xd7df('0x6b')](_0xd7df('0x12d'),_0x53508f['name']+_0xd7df('0x12e'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53508f[_0xd7df('0x2e')]+_0xd7df('0x12e')};}return{'isValid':!![],'message':_0xd7df('0x12f')};};Preview[_0xd7df('0x6c')][_0xd7df('0x109')]=function(_0x3f19a2,_0x95dd5,_0x26b10c,_0x51c4c4){var _0x5a1549=this;return new BPromise(function(_0xee4852,_0x5ada9d){var _0x53b350=_0x3f19a2['uniqueid'];var _0x4c1334=_0x5a1549[_0xd7df('0xa3')](_0x95dd5[_0xd7df('0x5b')])?util[_0xd7df('0x60')](_0xd7df('0x130'),_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x2e')],_[_0xd7df('0x74')](_0x95dd5['dialPrefix'])?'':_0x95dd5[_0xd7df('0x40')][_0xd7df('0x131')]()||'',_0x95dd5[_0xd7df('0x132')]>0x0?_0x26b10c[_0xd7df('0x102')][_0xd7df('0x103')][_0xd7df('0x133')](_0x95dd5[_0xd7df('0x132')]):_0x26b10c['Contact'][_0xd7df('0x103')]):util[_0xd7df('0x60')](_0xd7df('0x130'),_['isNil'](_0x95dd5[_0xd7df('0x129')])?_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x2e')]:_0x95dd5[_0xd7df('0x129')]['name'],_[_0xd7df('0x74')](_0x95dd5['dialPrefix'])?'':_0x95dd5[_0xd7df('0x40')][_0xd7df('0x131')]()||'',_0x95dd5[_0xd7df('0x132')]>0x0?_0x26b10c['Contact'][_0xd7df('0x103')][_0xd7df('0x133')](_0x95dd5[_0xd7df('0x132')]):_0x26b10c[_0xd7df('0x102')]['phone']);var _0x1e4346=_0x5a1549['isTrunkReachable'](_0x95dd5[_0xd7df('0x5b')])?ut[_0xd7df('0x134')](_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x5d')],_0x95dd5[_0xd7df('0x135')],_0x95dd5['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd7df('0x136')](_0x95dd5['dialOriginateCallerIdNumber'],_0x95dd5[_0xd7df('0x137')]):_0x95dd5[_0xd7df('0x3e')]):ut[_0xd7df('0x134')](_[_0xd7df('0x74')](_0x95dd5['TrunkBackup'])?_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x5d')]:_0x95dd5[_0xd7df('0x129')][_0xd7df('0x5d')],_0x95dd5['dialOriginateCallerIdName'],_0x95dd5[_0xd7df('0x137')]>0x0?ut[_0xd7df('0x136')](_0x95dd5[_0xd7df('0x3e')],_0x95dd5[_0xd7df('0x137')]):_0x95dd5[_0xd7df('0x3e')]);if(_0x1e4346){_0x3f19a2[_0xd7df('0x138')]=ut[_0xd7df('0x139')](_0x1e4346);_0x3f19a2[_0xd7df('0x13a')]=ut[_0xd7df('0x13b')](_0x1e4346);}var _0x27627f=ut['addVariables'](_0x95dd5,_0x26b10c,_0x4c1334,_0x1e4346,_0x53b350,_0x3f19a2);_[_0xd7df('0x13c')](_0x3f19a2,ut['toLowerVariables'](_0x27627f));_0x3f19a2[_0xd7df('0x95')]=moment()[_0xd7df('0x60')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xd7df('0x13d')](ut[_0xd7df('0x13e')](_0x3f19a2,_0x95dd5,_0x27627f,_0x3f19a2[_0xd7df('0xcc')],_0x51c4c4))[_0xd7df('0x8a')](function(_0x719c95){_0x95dd5[_0xd7df('0x54')]+=0x1;logger[_0xd7df('0x62')](_0xd7df('0x13f'),_0x53b350,_0xd7df('0xba'),_0x95dd5['name'],_0xd7df('0x77'),_0x95dd5[_0xd7df('0x54')]);_0xee4852(_0x719c95);})[_0xd7df('0x7f')](function(_0x514186){ut[_0xd7df('0xf8')](_0x3f19a2,0xe,_0xd7df('0x140'));rpcDb['createAgentHistory'](_0x3f19a2,'[originateFailure][logOriginateFailure]');_0x5ada9d(_0x514186);});});};Preview[_0xd7df('0x6c')][_0xd7df('0x26')]=function(_0x14f37b){if(this[_0xd7df('0x19')][_0x14f37b[_0xd7df('0xb7')]]){this[_0xd7df('0x19')][_0x14f37b['linkedid']][_0xd7df('0x7e')]=_0x14f37b[_0xd7df('0x7e')];}};Preview[_0xd7df('0x6c')][_0xd7df('0x1d')]=function(_0x304119){var _0x145af8=this;var _0x2934f2=this[_0xd7df('0x19')][_0x304119[_0xd7df('0x141')]];if(_0x2934f2){if(_0x2934f2[_0xd7df('0x107')]&&this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]]){ut[_0xd7df('0x142')](_0x2934f2,this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]][_0xd7df('0x2e')],this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]]['id']);}var _0x486a6b=_['clone'](_0x2934f2);_0x486a6b[_0xd7df('0xb8')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));var _0x9369a8=_0x145af8[_0xd7df('0x16')][_0x2934f2['queue']];if(ut[_0xd7df('0x143')](_0x304119['response'])){if(_0x2934f2[_0xd7df('0xb6')]){rpcDb[_0xd7df('0x11b')](_0x2934f2['idContact']);}if(_0x2934f2[_0xd7df('0xcc')]){rpcDb[_0xd7df('0x94')](_0x2934f2['idContact']);}ami[_0xd7df('0x2c')]('custom:agentringnoanswer',ut[_0xd7df('0xaa')](_0x2934f2,'rejected',this[_0xd7df('0x16')][_0x2934f2[_0xd7df('0x76')]]));this[_0xd7df('0xf5')](_0x486a6b,_0x9369a8,_0x304119);}else{_0x2934f2[_0xd7df('0x95')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));ut[_0xd7df('0xf8')](_0x486a6b,0x4,_0xd7df('0xc0'));rpcDb['createAgentHistory'](_0x486a6b,_0xd7df('0x144'));}}};Preview[_0xd7df('0x6c')]['syncHangup']=function(_0x329a10){var _0x5c5546=this;var _0x2fa4c0=this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]];var _0x4264a9;if(_0x2fa4c0){_0x4264a9=this[_0xd7df('0x16')][_0x2fa4c0['queue']];logger['info']('[syncHangup][talking]',_0x329a10[_0xd7df('0xb7')],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);}if(this['actions'][_0x329a10['linkedid']]&&_0x329a10[_0xd7df('0xb7')]!==_0x329a10['uniqueid']){if(_0x329a10[_0xd7df('0x145')]==='16'&&this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]]['dialAnswer']){this[_0xd7df('0x146')](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')]);}else if(this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]]['dialAnswer']){logger['info'](_0xd7df('0x147'),_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);this[_0xd7df('0x146')](_0x329a10,_0x329a10['linkedid'],_0x329a10[_0xd7df('0x145')]);}}else if(_0x2fa4c0&&_['isNil'](_0x2fa4c0[_0xd7df('0x148')])&&_0x4264a9[_0xd7df('0x149')]&&_0x329a10[_0xd7df('0xb7')]===_0x329a10[_0xd7df('0xb9')]&&_[_0xd7df('0x74')](_0x329a10[_0xd7df('0x14a')])&&_0x329a10[_0xd7df('0x145')]==='16'&&_0x329a10['channelstate']==='6'&&_[_0xd7df('0xf6')](_0x2fa4c0[_0xd7df('0x14b')])){if(_0x2fa4c0[_0xd7df('0xb6')]){rpcDb['unlockContact'](_0x2fa4c0[_0xd7df('0x10d')]);}if(_0x2fa4c0[_0xd7df('0xcc')]){rpcDb[_0xd7df('0x94')](_0x2fa4c0[_0xd7df('0x10d')]);}_0x329a10[_0xd7df('0x14a')]='22';this['callProgressDetectingAgent'](_0x2fa4c0,_0x4264a9,_0x329a10);}else if(_0x2fa4c0&&_0x2fa4c0[_0xd7df('0x14b')]){if(_0x329a10['cause']==='16'&&this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]][_0xd7df('0x79')]){logger['info'](_0xd7df('0x14c'),_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')],'\x20Queue',_0x4264a9['name'],'pTalking:\x20',_0x4264a9[_0xd7df('0x33')]);this['callProgressDetectingCustomer'](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')]);}else if(this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]][_0xd7df('0x79')]){logger['info'](_0xd7df('0x147'),_0x329a10['linkedid'],_0x329a10['cause'],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);this[_0xd7df('0x146')](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10['cause']);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x24')]=function(_0xe9a387){if(this['actions'][_0xe9a387[_0xd7df('0x14d')]]&&_0xe9a387[_0xd7df('0x14d')]!==_0xe9a387[_0xd7df('0x14e')]){this[_0xd7df('0x146')](_0xe9a387,_0xe9a387[_0xd7df('0x14d')],_0xe9a387[_0xd7df('0xeb')]);}};Preview[_0xd7df('0x6c')][_0xd7df('0x22')]=function(_0x2f722d){if(this[_0xd7df('0x19')][_0x2f722d['linkedid']]&&_0x2f722d[_0xd7df('0xb7')]!==_0x2f722d[_0xd7df('0xb9')]&&!this['actions'][_0x2f722d[_0xd7df('0xb7')]]['dialAnswer']){if(_0x2f722d[_0xd7df('0x145')]==='1'){this[_0xd7df('0x146')](_0x2f722d,_0x2f722d[_0xd7df('0xb7')],_0x2f722d[_0xd7df('0x145')]);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x14f')]=function(_0x12ee07,_0x20768d,_0x50f648){if(this[_0xd7df('0x19')][_0x12ee07]){if(_['isNil'](this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')])){this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')]={};}this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')][_0x20768d]=_0x50f648;}};Preview['prototype'][_0xd7df('0x27')]=function(_0x496755){try{if(!_['isNil'](_0x496755)){if(ut[_0xd7df('0x151')](_[_0xd7df('0x152')](_0x496755[_0xd7df('0x153')])[0x0])){this[_0xd7df('0x14f')](_0x496755[_0xd7df('0xb9')],_[_0xd7df('0x152')](_0x496755[_0xd7df('0x153')])[0x0],_0x496755[_0xd7df('0x154')]);}}}catch(_0x178432){logger[_0xd7df('0x155')](_0xd7df('0x156'),util[_0xd7df('0x157')](_0x178432,{'showHidden':![],'depth':null}));}};Preview[_0xd7df('0x6c')][_0xd7df('0x158')]=function(_0x3edf54){if(_0x3edf54){if(this[_0xd7df('0x19')][_0x3edf54['transfertargetlinkedid']]){this[_0xd7df('0x19')][_0x3edf54[_0xd7df('0x159')]][_0xd7df('0x14b')]=!![];}}};Preview[_0xd7df('0x6c')][_0xd7df('0x2a')]=function(_0x166963){if(_0x166963){if(this[_0xd7df('0x19')][_0x166963['transfererlinkedid']]){this['actions'][_0x166963['transfererlinkedid']][_0xd7df('0x14b')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 1b55710..4630732 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 _0x6cac=['bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util'];(function(_0x2b9769,_0x57fdbc){var _0x5377e6=function(_0x3a7b13){while(--_0x3a7b13){_0x2b9769['push'](_0x2b9769['shift']());}};_0x5377e6(++_0x57fdbc);}(_0x6cac,0x15b));var _0xc6ca=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6cac[_0x13d07a];return _0x5ee0ee;};'use strict';var util=require(_0xc6ca('0x0'));var BPromise=require(_0xc6ca('0x1'));var logger=require(_0xc6ca('0x2'))(_0xc6ca('0x3'));var _=require(_0xc6ca('0x4'));var cmHopper=require(_0xc6ca('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc6ca('0x6'));var cmHopperBlack=require(_0xc6ca('0x7'));var voiceQueueRt=require(_0xc6ca('0x8'));var agentReportPreview=require(_0xc6ca('0x9'));var voiceQueueReport=require(_0xc6ca('0xa'));function loggerCatch(_0x9c458c){return function(_0x535e7c){logger[_0xc6ca('0xb')](_0x9c458c,util[_0xc6ca('0xc')](_0x535e7c,{'showHidden':![],'depth':null}));};}function create(_0x3b0e03){return BPromise['resolve']()[_0xc6ca('0xd')](cmHopperHistory[_0xc6ca('0xe')](_0x3b0e03))[_0xc6ca('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x470aa6){return BPromise[_0xc6ca('0x10')]()['then'](agentReportPreview['createHistory'](_0x470aa6))[_0xc6ca('0xf')](loggerCatch(_0xc6ca('0x11')));}function moveContact(_0x253876){return BPromise[_0xc6ca('0x10')]()[_0xc6ca('0xd')](cmHopper[_0xc6ca('0x12')](_0x253876,!![]))[_0xc6ca('0xf')](loggerCatch(_0xc6ca('0x13')));}exports[_0xc6ca('0x14')]=function(_0x46a114){return BPromise[_0xc6ca('0x10')]()[_0xc6ca('0xd')](cmHopperBlack[_0xc6ca('0x14')](_0x46a114))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xc6ca('0x15')]=function(_0x1b60f2){return BPromise['resolve']()[_0xc6ca('0xd')](cmHopper['getContactPreview'](_0x1b60f2))[_0xc6ca('0xf')](loggerCatch(_0xc6ca('0x16')));};exports[_0xc6ca('0xe')]=function(_0x512ef3,_0x118a53){create(_0x512ef3)['catch'](loggerCatch(_0x118a53));moveContact(_0x512ef3)[_0xc6ca('0xf')](loggerCatch(_0x118a53));};exports[_0xc6ca('0x17')]=function(_0x1842e2,_0x2c22c0){createAgent(_0x1842e2)['catch'](loggerCatch(_0x2c22c0));};exports[_0xc6ca('0x18')]=function(_0x5bc153,_0x1548a3){create(_0x5bc153)[_0xc6ca('0xf')](loggerCatch(_0x1548a3));};exports['createCustomerFinal']=function(_0x30fee0,_0x4e0a7e){moveContact(_0x30fee0)['catch'](loggerCatch(_0x4e0a7e));};exports[_0xc6ca('0x19')]=function(_0x4b35ab,_0x26076a,_0x5cf208){if(_0x26076a){_0x4b35ab['UserId']=null;}if(_0x5cf208){_0x4b35ab[_0xc6ca('0x1a')]=![];}return BPromise[_0xc6ca('0x10')]()[_0xc6ca('0xd')](cmHopper['rescheduleContact'](_0x4b35ab))[_0xc6ca('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x1f0c1b){return BPromise['resolve']()[_0xc6ca('0xd')](cmHopper[_0xc6ca('0x1b')](_0x1f0c1b))['catch'](loggerCatch(_0xc6ca('0x1c')));};exports[_0xc6ca('0x1d')]=function(_0x5eba6f){return BPromise['resolve']()['then'](cmHopper[_0xc6ca('0x1d')]({'UserId':null},_0x5eba6f,0x1))[_0xc6ca('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xc6ca('0x1e')]=function(_0x45c893){return BPromise[_0xc6ca('0x10')]()['then'](cmHopper['unlockContact']({'active':![]},_0x45c893,0x1))['catch'](loggerCatch(_0xc6ca('0x1f')));};exports['crateCustomerReportQueue']=function(_0x3cca88){var _0x3972e2={};_0x3972e2[_0xc6ca('0x20')]=_0x3cca88[_0xc6ca('0x20')];_0x3972e2[_0xc6ca('0x21')]=_0x3cca88[_0xc6ca('0x21')];_0x3972e2[_0xc6ca('0x22')]=_0x3cca88[_0xc6ca('0x22')];_0x3972e2[_0xc6ca('0x23')]=_0x3cca88[_0xc6ca('0x23')];_0x3972e2['queue']=_0x3cca88[_0xc6ca('0x24')];_0x3972e2[_0xc6ca('0x25')]=_0x3cca88[_0xc6ca('0x26')];_0x3972e2[_0xc6ca('0x27')]=_0x3cca88[_0xc6ca('0x26')];_0x3972e2[_0xc6ca('0x28')]=0x1;_0x3972e2[_0xc6ca('0x29')]=_0x3cca88['endtime'];_0x3972e2[_0xc6ca('0x2a')]=_0x3cca88[_0xc6ca('0x2b')];_0x3972e2[_0xc6ca('0x2c')]=_0xc6ca('0x2d');_0x3972e2[_0xc6ca('0x2e')]=_0xc6ca('0x2f');_0x3972e2[_0xc6ca('0x30')]=0x0;_0x3972e2[_0xc6ca('0x31')]=0x1;_0x3972e2[_0xc6ca('0x32')]=_0x3cca88[_0xc6ca('0x2b')];_0x3972e2[_0xc6ca('0x33')]=_0xc6ca('0x34');return BPromise['resolve']()['then'](voiceQueueReport[_0xc6ca('0x35')](_0x3972e2))['catch'](loggerCatch(_0xc6ca('0x36')));};exports[_0xc6ca('0x37')]=function(_0xb0cf4f,_0xf0639d){return BPromise[_0xc6ca('0x10')]()[_0xc6ca('0xd')](cmHopper[_0xc6ca('0x37')](_0xb0cf4f,_0xf0639d))['catch'](loggerCatch(_0xc6ca('0x38')));};exports['rescheduleContactInQueue']=function(_0x2d4c2a){return BPromise[_0xc6ca('0x10')]()[_0xc6ca('0xd')](cmHopper['rescheduleContact'](_0x2d4c2a,!![],!![]))[_0xc6ca('0xf')](loggerCatch(_0xc6ca('0x39')));}; \ No newline at end of file +var _0xdabb=['[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xdabb,0xeb));var _0xbdab=function(_0x17c9d6,_0xb95b04){_0x17c9d6=_0x17c9d6-0x0;var _0x68b7a2=_0xdabb[_0x17c9d6];return _0x68b7a2;};'use strict';var util=require(_0xbdab('0x0'));var BPromise=require('bluebird');var logger=require(_0xbdab('0x1'))(_0xbdab('0x2'));var _=require(_0xbdab('0x3'));var cmHopper=require(_0xbdab('0x4'));var cmHopperFinal=require(_0xbdab('0x5'));var cmHopperHistory=require(_0xbdab('0x6'));var cmHopperBlack=require(_0xbdab('0x7'));var voiceQueueRt=require(_0xbdab('0x8'));var agentReportPreview=require(_0xbdab('0x9'));var voiceQueueReport=require(_0xbdab('0xa'));function loggerCatch(_0x1deee9){return function(_0x308863){logger[_0xbdab('0xb')](_0x1deee9,util[_0xbdab('0xc')](_0x308863,{'showHidden':![],'depth':null}));};}function create(_0x572d02){return BPromise[_0xbdab('0xd')]()['then'](cmHopperHistory[_0xbdab('0xe')](_0x572d02))[_0xbdab('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x530ce5){return BPromise[_0xbdab('0xd')]()['then'](agentReportPreview[_0xbdab('0xe')](_0x530ce5))[_0xbdab('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x571f40){return BPromise[_0xbdab('0xd')]()['then'](cmHopper[_0xbdab('0x10')](_0x571f40,!![]))['catch'](loggerCatch(_0xbdab('0x11')));}exports['checkIsBlackList']=function(_0x321207){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopperBlack[_0xbdab('0x13')](_0x321207))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x14')));};exports[_0xbdab('0x15')]=function(_0x5dd472){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopper['getContactPreview'](_0x5dd472))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x16')));};exports[_0xbdab('0xe')]=function(_0x3ae221,_0x48172f){create(_0x3ae221)['catch'](loggerCatch(_0x48172f));moveContact(_0x3ae221)['catch'](loggerCatch(_0x48172f));};exports['createAgentHistory']=function(_0x331a10,_0x5c5e79){createAgent(_0x331a10)[_0xbdab('0xf')](loggerCatch(_0x5c5e79));};exports[_0xbdab('0x17')]=function(_0x550912,_0x5002a5){create(_0x550912)[_0xbdab('0xf')](loggerCatch(_0x5002a5));};exports['createCustomerFinal']=function(_0x32714c,_0x14042e){moveContact(_0x32714c)[_0xbdab('0xf')](loggerCatch(_0x14042e));};exports[_0xbdab('0x18')]=function(_0x2b88a3,_0x432675,_0x275e17){if(_0x432675){_0x2b88a3[_0xbdab('0x19')]=null;}if(_0x275e17){_0x2b88a3['active']=![];}return BPromise['resolve']()[_0xbdab('0x12')](cmHopper[_0xbdab('0x18')](_0x2b88a3))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x1a')));};exports[_0xbdab('0x1b')]=function(_0x247413){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopper[_0xbdab('0x1b')](_0x247413))[_0xbdab('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0xbdab('0x1c')]=function(_0x3d5fe1){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopper[_0xbdab('0x1c')]({'UserId':null},_0x3d5fe1,0x1))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x1d')));};exports[_0xbdab('0x1e')]=function(_0x1214ef){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopper[_0xbdab('0x1c')]({'active':![]},_0x1214ef,0x1))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x1f')));};exports['crateCustomerReportQueue']=function(_0x54f175){var _0x10f90a={};_0x10f90a[_0xbdab('0x20')]=_0x54f175['type'];_0x10f90a[_0xbdab('0x21')]=_0x54f175[_0xbdab('0x21')];_0x10f90a['calleridnum']=_0x54f175[_0xbdab('0x22')];_0x10f90a[_0xbdab('0x23')]=_0x54f175['calleridname'];_0x10f90a[_0xbdab('0x24')]=_0x54f175['queue'];_0x10f90a[_0xbdab('0x25')]=_0x54f175[_0xbdab('0x26')];_0x10f90a[_0xbdab('0x27')]=_0x54f175['answertime'];_0x10f90a[_0xbdab('0x28')]=0x1;_0x10f90a[_0xbdab('0x29')]=_0x54f175[_0xbdab('0x2a')];_0x10f90a[_0xbdab('0x2b')]=_0x54f175[_0xbdab('0x2c')];_0x10f90a[_0xbdab('0x2d')]='from-sip';_0x10f90a[_0xbdab('0x2e')]=_0xbdab('0x2f');_0x10f90a[_0xbdab('0x30')]=0x0;_0x10f90a[_0xbdab('0x31')]=0x1;_0x10f90a[_0xbdab('0x32')]=_0x54f175['membername'];_0x10f90a[_0xbdab('0x33')]=_0xbdab('0x34');return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](voiceQueueReport['create'](_0x10f90a))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x35')));};exports[_0xbdab('0x36')]=function(_0x611208,_0x15fd7c){return BPromise[_0xbdab('0xd')]()[_0xbdab('0x12')](cmHopper[_0xbdab('0x36')](_0x611208,_0x15fd7c))[_0xbdab('0xf')](loggerCatch(_0xbdab('0x37')));};exports[_0xbdab('0x38')]=function(_0x2dacc8){return BPromise[_0xbdab('0xd')]()['then'](cmHopper[_0xbdab('0x18')](_0x2dacc8,!![],!![]))['catch'](loggerCatch(_0xbdab('0x39')));}; \ 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 3911142..9b1257c 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 _0xf226=['toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','membername','UserId','endtime','ringtime','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','channelAgent','voice','mandatoryDisposition','agentReadyId','status','getDiff','createBody','CampaignId','idContact','campaigntype','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-'];(function(_0x2a99f3,_0xc3b1ac){var _0xa216a2=function(_0x42d24b){while(--_0x42d24b){_0x2a99f3['push'](_0x2a99f3['shift']());}};_0xa216a2(++_0xc3b1ac);}(_0xf226,0xe8));var _0x6f22=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf226[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6f22('0x0'));var _=require(_0x6f22('0x1'));var moment=require('moment');var logger=require(_0x6f22('0x2'))('preview');var ipAgi=process['env'][_0x6f22('0x3')]||_0x6f22('0x4');function getSeconds(_0x4d6ac4,_0xb7fb71){var _0xc51379=moment(_0x4d6ac4)['milliseconds'](0x0);var _0x2df3f8=moment(_0xb7fb71)[_0x6f22('0x5')](0x0);return _0xc51379[_0x6f22('0x6')](_0x2df3f8,_0x6f22('0x7'));}exports[_0x6f22('0x8')]=function(_0x531a64){return function(_0x26e8ca){logger[_0x6f22('0x9')](_0x531a64,util[_0x6f22('0xa')](_0x26e8ca,{'showHidden':![],'depth':null}));};};exports[_0x6f22('0xb')]=function(_0x49ad71,_0x2e190b){logger[_0x6f22('0xc')](_0x49ad71,util[_0x6f22('0xa')](_0x2e190b,{'showHidden':![],'depth':null}));};exports[_0x6f22('0xd')]=function(_0x1271c3,_0x432a80){logger[_0x6f22('0x9')](_0x1271c3,util[_0x6f22('0xa')](_0x432a80,{'showHidden':![],'depth':null}));};exports[_0x6f22('0xe')]=function(_0x505cca){return function(_0x28660d){logger[_0x6f22('0xc')](_0x505cca,util[_0x6f22('0xa')](_0x28660d,{'showHidden':![],'depth':null}));};};exports[_0x6f22('0xf')]=function(_0x3ebad1,_0x275864,_0x3cd324){return{'message':_0x3ebad1,'unlock':_0x275864,'active':_0x3cd324};};exports[_0x6f22('0x10')]=function(_0x2679ea,_0x2220b5,_0x1b1d63){if(!_['isUndefined'](_0x1b1d63)&&_0x6f22('0x11')===typeof _0x1b1d63&&!_[_0x6f22('0x12')](_0x1b1d63)){if(!_[_0x6f22('0x13')](_0x2220b5)&&'string'===typeof _0x2220b5&&!_['isEmpty'](_0x2220b5)){return util[_0x6f22('0x14')](_0x6f22('0x15'),_0x2220b5,_0x1b1d63);}return util[_0x6f22('0x14')]('\x22%s\x22\x20<%s>',_0x1b1d63,_0x1b1d63);}if(!_['isUndefined'](_0x2679ea)&&_0x6f22('0x11')===typeof _0x2679ea&&!_[_0x6f22('0x12')](_0x2679ea)){return _0x2679ea;}return _0x6f22('0x16');};exports[_0x6f22('0x17')]=function(_0x412912){if(_[_0x6f22('0x18')](_0x412912)){return![];}return _0x412912;};exports[_0x6f22('0x19')]=function(_0x53fee5,_0x3c9c3e,_0x3a3f10,_0x1b5ba1,_0x137449,_0x42a48b){var _0x152f99={'XMD-QUEUE':_0x3c9c3e[_0x6f22('0x1a')]?_0x3c9c3e[_0x6f22('0x1a')][_0x6f22('0x1b')]:'','XMD-CALLERID':_0x1b5ba1,'XMD-CALLERID-PREVIEW':_0x42a48b?util[_0x6f22('0x14')](_0x6f22('0x15'),_0x42a48b[_0x6f22('0x1c')],_0x42a48b[_0x6f22('0x1d')]):_0x1b5ba1,'XMD-DIALID':_0x137449,'XMD-CONTACTID':_0x3c9c3e[_0x6f22('0x1e')],'XMD-CDRTYPE':_0x6f22('0x1f'),'CALLERID(all)':_0x1b5ba1,'XMD-VOICEQUEUEID':_0x3c9c3e[_0x6f22('0x20')],'XMD-DIALCHANNEL':_0x3a3f10,'XMD-DIALTIMEOUT':_0x53fee5[_0x6f22('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0x6f22('0x14')](_0x6f22('0x22'),_0x53fee5['dialQueueProject2']?'g':'',_['isEmpty'](_0x53fee5[_0x6f22('0x23')])?'':_0x6f22('0x24')),'XMD-DIALURL':_0x53fee5[_0x6f22('0x25')]||'','XMD-AGI':_0x53fee5[_0x6f22('0x26')]?util[_0x6f22('0x14')](_0x6f22('0x27'),ipAgi,_0x53fee5[_0x6f22('0x26')]):_0x6f22('0x28'),'XMD-AGIAFTER':_0x53fee5[_0x6f22('0x29')]?util[_0x6f22('0x14')](_0x6f22('0x27'),ipAgi,_0x53fee5[_0x6f22('0x29')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x42a48b?_0x42a48b[_0x6f22('0x2a')]:'','XMD-ORIGINATECALLERIDNAME':_0x42a48b?_0x42a48b[_0x6f22('0x2b')]:'','XMD-DESTINATION':_0x6f22('0x2c'),'SIPADDHEADER':_0x6f22('0x2d')};if(!_['isEmpty'](_0x53fee5[_0x6f22('0x23')])){_0x152f99[util[_0x6f22('0x14')]('%s',_0x6f22('0x2e'))]=_0x53fee5['monitor_format'];_0x152f99[util[_0x6f22('0x14')]('%s',_0x6f22('0x2f'))]=_0x137449;}if(_0x3c9c3e&&_0x3c9c3e['Contact']){for(var _0x368525 in _0x3c9c3e['Contact']){if(_0x3c9c3e[_0x6f22('0x30')][_0x6f22('0x31')](_0x368525)){if(!_[_0x6f22('0x18')](_0x3c9c3e[_0x6f22('0x30')][_0x368525])&&_0x368525!=='id'&&_0x368525!=='tags'&&_0x368525!==_0x6f22('0x32')&&_0x368525!==_0x6f22('0x33')){_0x152f99[util[_0x6f22('0x14')](_0x6f22('0x34'),_0x6f22('0x35'),_[_0x6f22('0x36')](_0x368525))]=_0x3c9c3e[_0x6f22('0x30')][_0x368525];}}}}return _0x152f99;};exports[_0x6f22('0x37')]=function(_0x16ae62){var _0x31e22e={};for(var _0xafcaa6 in _0x16ae62){if(_0x16ae62[_0x6f22('0x31')](_0xafcaa6)){_0x31e22e[util[_0x6f22('0x14')]('%s',_['toLower'](_0xafcaa6))]=_0x16ae62[_0xafcaa6];}}return{'variables':_0x31e22e};};exports[_0x6f22('0x38')]=function(_0x3f6874,_0x3ba758){if(!_[_0x6f22('0x18')](_0x3f6874)){if(_0x3f6874[_0x6f22('0x31')](_0x6f22('0x39'))){if(_0x3f6874[_0x6f22('0x39')]>0x0){_0x3f6874[_0x6f22('0x39')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3ba758);}}}else{logger[_0x6f22('0x9')](_0x6f22('0x3a'),_0x3ba758);}};exports[_0x6f22('0x3b')]=function(_0x47e5c2){var _0x174821=moment()['format'](_0x6f22('0x3c'));_0x47e5c2[_0x6f22('0x3d')]=0xd;_0x47e5c2[_0x6f22('0x3e')]=_0x6f22('0x3f');_0x47e5c2[_0x6f22('0x40')]=_0x174821;_0x47e5c2[_0x6f22('0x41')]=_0x174821;_0x47e5c2['endtime']=_0x174821;};exports[_0x6f22('0x42')]=function(_0x4c42b7,_0x27ebd6,_0x719df4){var _0x5276f2=moment()['format'](_0x6f22('0x3c'));_0x4c42b7[_0x6f22('0x3d')]=_0x27ebd6;_0x4c42b7[_0x6f22('0x3e')]=_0x719df4;_0x4c42b7['responsetime']=_0x5276f2;_0x4c42b7['ringtime']=getSeconds(_0x4c42b7[_0x6f22('0x41')],_0x4c42b7[_0x6f22('0x40')]);};exports['logLookAgent']=function(_0x5a5edd,_0x348f9d,_0x35dc64){_0x5a5edd[_0x6f22('0x43')]=_0x348f9d;_0x5a5edd[_0x6f22('0x44')]=_0x35dc64;};exports['logCustomer']=function(_0x505d8d,_0x38d3aa,_0x3a5f51){var _0x487c28=moment()[_0x6f22('0x14')](_0x6f22('0x3c'));_0x505d8d[_0x6f22('0x3d')]=_0x38d3aa;_0x505d8d[_0x6f22('0x3e')]=_0x3a5f51;_0x505d8d[_0x6f22('0x41')]=_0x505d8d[_0x6f22('0x41')]?_0x505d8d[_0x6f22('0x41')]:_0x487c28;_0x505d8d[_0x6f22('0x45')]=_0x505d8d[_0x6f22('0x45')]?_0x505d8d[_0x6f22('0x45')]:_0x487c28;_0x505d8d[_0x6f22('0x46')]=getSeconds(_0x505d8d[_0x6f22('0x41')]||0x0,_0x505d8d[_0x6f22('0x40')]||0x0);_0x505d8d[_0x6f22('0x47')]=_0x505d8d[_0x6f22('0x48')]?getSeconds(_0x505d8d[_0x6f22('0x45')],_0x505d8d[_0x6f22('0x48')]):0x0;};exports[_0x6f22('0x49')]=function(_0x3b59cc){return _0x3b59cc==='Failure';};exports['variablesAction']=function(_0x5ca5ed,_0x43b513,_0x5ae0ce,_0x14501f,_0x516cb8){var _0x342e17=_0x14501f?_0x6f22('0x4a'):_0x5ca5ed[_0x6f22('0x1c')];_0x342e17=_0x516cb8?_0x6f22('0x4b'):_0x342e17;return{'actionid':_0x5ca5ed[_0x6f22('0x4c')],'action':_0x6f22('0x4d'),'channel':_0x5ca5ed['channelAgent'],'callerid':util[_0x6f22('0x14')](_0x6f22('0x15'),_0x342e17,_0x5ca5ed[_0x6f22('0x1d')]),'Exten':_0x6f22('0x2c'),'Context':'from-sip','Priority':'1','variable':_0x5ae0ce,'timeout':(_0x43b513[_0x6f22('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5ca5ed['uniqueid']};};exports[_0x6f22('0x4f')]=function(_0x28db98){return _0x28db98[_0x6f22('0x50')]+_0x28db98[_0x6f22('0x51')]+_0x28db98['countnoanswerretry']+_0x28db98[_0x6f22('0x52')]+_0x28db98['countnosuchnumberretry'];};exports[_0x6f22('0x53')]=function(_0x58833f){var _0x414dda=_[_0x6f22('0x54')](_0x58833f);_0x414dda[_0x6f22('0x3d')]=0xf;_0x414dda[_0x6f22('0x3e')]='Global';return _0x414dda;};exports[_0x6f22('0x55')]=function(_0x5290b0,_0x553c73,_0xa70ab6){var _0x59957b={};_0x59957b[_0x553c73]=_0x5290b0[_0x553c73];_0x59957b[_0x6f22('0x56')]=![];_0x59957b[_0x6f22('0x57')]=moment()[_0x6f22('0x58')](_0xa70ab6,_0x6f22('0x59'))[_0x6f22('0x14')](_0x6f22('0x3c'));_0x59957b[_0x6f22('0x1e')]=_0x5290b0[_0x6f22('0x1e')];_0x59957b[_0x6f22('0x5a')]=_0x5290b0[_0x6f22('0x5a')];_0x59957b[_0x6f22('0x20')]=_0x5290b0[_0x6f22('0x20')]||undefined;return _0x59957b;};exports[_0x6f22('0x5b')]=function(_0x51d037,_0x418da0){if(!_[_0x6f22('0x18')](_0x51d037)){if(_0x51d037[_0x6f22('0x5c')]>0x0){_0x51d037[_0x6f22('0x5c')]-=0x1;}else{logger[_0x6f22('0x9')](_0x418da0,_0x6f22('0x5d'));}}else{logger[_0x6f22('0x9')](_0x418da0,_0x6f22('0x5e'));}};exports[_0x6f22('0x5f')]=function(_0x44ef95){if(_0x44ef95<=0x0){return!![];}return![];};exports[_0x6f22('0x60')]=function(_0x4783a0,_0x23d645,_0x42758b){_0x4783a0[_0x6f22('0x61')]=_0x23d645;_0x4783a0['name']=_0x4783a0[_0x6f22('0x62')];_0x4783a0[_0x6f22('0x63')]=_0x4783a0[_0x6f22('0x64')];_0x4783a0['motionChannel']=_0x6f22('0x65');if(_0x42758b){_0x4783a0[_0x6f22('0x66')]=_0x42758b['mandatoryDisposition'];}return _0x4783a0;};exports['buildAcw']=function(_0x2683c1){var _0x232f97={};_0x232f97[_0x6f22('0x62')]=_0x2683c1[_0x6f22('0x62')];_0x232f97[_0x6f22('0x63')]=_0x2683c1[_0x6f22('0x64')];_0x232f97['uniqueid']=_0x2683c1[_0x6f22('0x4c')];return _0x232f97;};exports[_0x6f22('0x67')]=function(_0x2fe234){var _0x17efea=[];for(var _0x4986d4 in _0x2fe234){if(_0x2fe234[_0x6f22('0x31')](_0x4986d4)){if(!_['isNil'](_0x2fe234[_0x4986d4])&&_0x2fe234[_0x4986d4][_0x6f22('0x3d')]==='not_inuse'&&_0x2fe234[_0x4986d4][_0x6f22('0x68')]==='reachable'){_0x17efea['push'](_0x2fe234[_0x4986d4]['id']);}}}return _0x17efea;};exports[_0x6f22('0x69')]=function(_0x14b001){var _0x216b01=moment()[_0x6f22('0x5')](0x0);var _0x54cea1=moment(_0x14b001)[_0x6f22('0x5')](0x0);return _0x216b01[_0x6f22('0x6')](_0x54cea1,_0x6f22('0x7'));};exports[_0x6f22('0x6a')]=function(_0x438dea){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x438dea['ContactId'],'ListId':_0x438dea['ListId'],'VoiceQueueId':_0x438dea[_0x6f22('0x20')]||undefined,'CampaignId':_0x438dea[_0x6f22('0x6b')]||undefined};};exports['filterKey']=function(_0x3598b6){if(_0x3598b6==='uniqueid'||_0x3598b6===_0x6f22('0x6c')||_0x3598b6===_0x6f22('0x62')||_0x3598b6==='type'||_0x3598b6===_0x6f22('0x6d')||_0x3598b6==='dialAnswer'||_0x3598b6===_0x6f22('0x43')||_0x3598b6===_0x6f22('0x64')||_0x3598b6==='calleridname'||_0x3598b6===_0x6f22('0x56')||_0x3598b6===_0x6f22('0x1d')||_0x3598b6===_0x6f22('0x57')||_0x3598b6===_0x6f22('0x50')||_0x3598b6==='countcongestionretry'||_0x3598b6===_0x6f22('0x6e')||_0x3598b6===_0x6f22('0x6f')||_0x3598b6===_0x6f22('0x70')||_0x3598b6===_0x6f22('0x71')||_0x3598b6===_0x6f22('0x72')||_0x3598b6===_0x6f22('0x73')||_0x3598b6===_0x6f22('0x1e')||_0x3598b6===_0x6f22('0x5a')||_0x3598b6===_0x6f22('0x44')||_0x3598b6===_0x6f22('0x20')||_0x3598b6===_0x6f22('0x74')||_0x3598b6===_0x6f22('0x75')||_0x3598b6===_0x6f22('0x76')||_0x3598b6===_0x6f22('0x77')||_0x3598b6===_0x6f22('0x78')||_0x3598b6===_0x6f22('0x79')||_0x3598b6==='xmd-dialtimeout'||_0x3598b6==='xmd-dialoptions'||_0x3598b6===_0x6f22('0x7a')||_0x3598b6===_0x6f22('0x7b')||_0x3598b6==='xmd-contactid'||_0x3598b6==='xmd-cdrtype'||_0x3598b6===_0x6f22('0x7c')||_0x3598b6===_0x6f22('0x7d')||_0x3598b6===_0x6f22('0x7e')||_0x3598b6===_0x6f22('0x7f')||_0x3598b6==='rtpaudioqosbridged'||_0x3598b6===_0x6f22('0x80')||_0x3598b6===_0x6f22('0x81')||_0x3598b6===_0x6f22('0x82')||_0x3598b6===_0x6f22('0x83')||_0x3598b6===_0x6f22('0x84')||_0x3598b6===_0x6f22('0x85')||_0x3598b6==='rtpaudioqos'||_0x3598b6==='rtpaudioqosbridged'||_0x3598b6===_0x6f22('0x80')||_0x3598b6===_0x6f22('0x81')||_0x3598b6===_0x6f22('0x82')||_0x3598b6==='rtpaudioqoslossbridged'||_0x3598b6===_0x6f22('0x84')||_0x3598b6===_0x6f22('0x85')||_0x3598b6===_0x6f22('0x86')||_0x3598b6==='bridgepvtcallid'||_0x3598b6===_0x6f22('0x3d')||_0x3598b6===_0x6f22('0x3e')){return![];}return!![];};exports[_0x6f22('0x87')]=function(_0x54115a,_0x1a29f6){var _0x3a2036,_0x35f2f5,_0x712341;if(_0x1a29f6<=0x0){_0x1a29f6=0x1;}_0x3a2036=new RegExp(_0x6f22('0x88')+_0x1a29f6+'}$');_0x35f2f5=Math[_0x6f22('0x89')](0xa,_0x1a29f6-0x1);_0x712341=Math[_0x6f22('0x89')](0xa,_0x1a29f6)-0x1;return util[_0x6f22('0x14')]('%s',_[_0x6f22('0x8a')](_0x54115a,_0x3a2036,_[_0x6f22('0x8b')](_0x35f2f5,_0x712341)));};exports[_0x6f22('0x8c')]=function(_0xb331f6){var _0x250f3c=_0xb331f6[_0x6f22('0x8d')](/"(.*?)"/);return _0x250f3c?_0x250f3c[0x1]:_0xb331f6;};exports[_0x6f22('0x8e')]=function(_0x46dcea){var _0x469242=_0x46dcea[_0x6f22('0x8d')](/<(.*?)>/);return _0x469242?_0x469242[0x1]:_0x46dcea;}; \ No newline at end of file +var _0x456b=['isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','push','seconds','ListId','filterKey','dialAnswer','membername','active','callback','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','inspect','logger','loggerError','error','logger2','info','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>'];(function(_0x2d69b7,_0x540ea0){var _0x32a17a=function(_0x3dab6e){while(--_0x3dab6e){_0x2d69b7['push'](_0x2d69b7['shift']());}};_0x32a17a(++_0x540ea0);}(_0x456b,0x17b));var _0xb456=function(_0x449ca9,_0x238089){_0x449ca9=_0x449ca9-0x0;var _0x137f32=_0x456b[_0x449ca9];return _0x137f32;};'use strict';var util=require(_0xb456('0x0'));var _=require(_0xb456('0x1'));var moment=require('moment');var logger=require(_0xb456('0x2'))('preview');var ipAgi=process[_0xb456('0x3')][_0xb456('0x4')]||_0xb456('0x5');function getSeconds(_0x37f076,_0x2de9f1){var _0x553254=moment(_0x37f076)[_0xb456('0x6')](0x0);var _0x213e78=moment(_0x2de9f1)[_0xb456('0x6')](0x0);return _0x553254[_0xb456('0x7')](_0x213e78,'seconds');}exports['loggerCatch']=function(_0x166298){return function(_0x26fd2c){logger['error'](_0x166298,util[_0xb456('0x8')](_0x26fd2c,{'showHidden':![],'depth':null}));};};exports[_0xb456('0x9')]=function(_0x36129b,_0x167367){logger['info'](_0x36129b,util['inspect'](_0x167367,{'showHidden':![],'depth':null}));};exports[_0xb456('0xa')]=function(_0x3bce40,_0x4c5740){logger[_0xb456('0xb')](_0x3bce40,util['inspect'](_0x4c5740,{'showHidden':![],'depth':null}));};exports[_0xb456('0xc')]=function(_0x1eae4a){return function(_0xbc3ed7){logger[_0xb456('0xd')](_0x1eae4a,util[_0xb456('0x8')](_0xbc3ed7,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4d16a5,_0x1d2981,_0x588779){return{'message':_0x4d16a5,'unlock':_0x1d2981,'active':_0x588779};};exports['getCallerId']=function(_0x4876b6,_0x5b441c,_0x57c6f1){if(!_[_0xb456('0xe')](_0x57c6f1)&&_0xb456('0xf')===typeof _0x57c6f1&&!_[_0xb456('0x10')](_0x57c6f1)){if(!_[_0xb456('0xe')](_0x5b441c)&&_0xb456('0xf')===typeof _0x5b441c&&!_[_0xb456('0x10')](_0x5b441c)){return util[_0xb456('0x11')](_0xb456('0x12'),_0x5b441c,_0x57c6f1);}return util['format'](_0xb456('0x12'),_0x57c6f1,_0x57c6f1);}if(!_[_0xb456('0xe')](_0x4876b6)&&'string'===typeof _0x4876b6&&!_[_0xb456('0x10')](_0x4876b6)){return _0x4876b6;}return _0xb456('0x13');};exports[_0xb456('0x14')]=function(_0x368942){if(_[_0xb456('0x15')](_0x368942)){return![];}return _0x368942;};exports[_0xb456('0x16')]=function(_0x5cfa21,_0xf8ef17,_0x58c59d,_0x20bb88,_0x26823d,_0x50b42e){var _0x1ec7e7={'XMD-QUEUE':_0xf8ef17[_0xb456('0x17')]?_0xf8ef17['Queue'][_0xb456('0x18')]:'','XMD-CALLERID':_0x20bb88,'XMD-CALLERID-PREVIEW':_0x50b42e?util[_0xb456('0x11')](_0xb456('0x12'),_0x50b42e[_0xb456('0x19')],_0x50b42e['calleridnum']):_0x20bb88,'XMD-DIALID':_0x26823d,'XMD-CONTACTID':_0xf8ef17[_0xb456('0x1a')],'XMD-CDRTYPE':_0xb456('0x1b'),'CALLERID(all)':_0x20bb88,'XMD-VOICEQUEUEID':_0xf8ef17[_0xb456('0x1c')],'XMD-DIALCHANNEL':_0x58c59d,'XMD-DIALTIMEOUT':_0x5cfa21['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xb456('0x11')](_0xb456('0x1d'),_0x5cfa21[_0xb456('0x1e')]?'g':'',_[_0xb456('0x10')](_0x5cfa21[_0xb456('0x1f')])?'':_0xb456('0x20')),'XMD-DIALURL':_0x5cfa21['dialPreviewUrl']||'','XMD-AGI':_0x5cfa21['dialQueueProject']?util[_0xb456('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5cfa21['dialQueueProject']):_0xb456('0x21'),'XMD-AGIAFTER':_0x5cfa21[_0xb456('0x1e')]?util[_0xb456('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5cfa21[_0xb456('0x1e')]):_0xb456('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x50b42e?_0x50b42e[_0xb456('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x50b42e?_0x50b42e[_0xb456('0x23')]:'','XMD-DESTINATION':_0xb456('0x24'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xb456('0x10')](_0x5cfa21['monitor_format'])){_0x1ec7e7[util[_0xb456('0x11')]('%s',_0xb456('0x25'))]=_0x5cfa21[_0xb456('0x1f')];_0x1ec7e7[util[_0xb456('0x11')]('%s',_0xb456('0x26'))]=_0x26823d;}if(_0xf8ef17&&_0xf8ef17[_0xb456('0x27')]){for(var _0x282327 in _0xf8ef17[_0xb456('0x27')]){if(_0xf8ef17[_0xb456('0x27')][_0xb456('0x28')](_0x282327)){if(!_['isNil'](_0xf8ef17['Contact'][_0x282327])&&_0x282327!=='id'&&_0x282327!==_0xb456('0x29')&&_0x282327!==_0xb456('0x2a')&&_0x282327!==_0xb456('0x2b')){_0x1ec7e7[util['format'](_0xb456('0x2c'),_0xb456('0x2d'),_[_0xb456('0x2e')](_0x282327))]=_0xf8ef17['Contact'][_0x282327];}}}}return _0x1ec7e7;};exports[_0xb456('0x2f')]=function(_0x1a4512){var _0x238c6b={};for(var _0x3dbc6c in _0x1a4512){if(_0x1a4512[_0xb456('0x28')](_0x3dbc6c)){_0x238c6b[util[_0xb456('0x11')]('%s',_[_0xb456('0x30')](_0x3dbc6c))]=_0x1a4512[_0x3dbc6c];}}return{'variables':_0x238c6b};};exports[_0xb456('0x31')]=function(_0x422dbc,_0x3ea309){if(!_[_0xb456('0x15')](_0x422dbc)){if(_0x422dbc[_0xb456('0x28')]('originated')){if(_0x422dbc['originated']>0x0){_0x422dbc[_0xb456('0x32')]-=0x1;}else{logger[_0xb456('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3ea309);}}}else{logger[_0xb456('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3ea309);}};exports[_0xb456('0x33')]=function(_0x2b2933){var _0x303655=moment()[_0xb456('0x11')](_0xb456('0x34'));_0x2b2933[_0xb456('0x35')]=0xd;_0x2b2933[_0xb456('0x36')]=_0xb456('0x37');_0x2b2933[_0xb456('0x38')]=_0x303655;_0x2b2933[_0xb456('0x39')]=_0x303655;_0x2b2933[_0xb456('0x3a')]=_0x303655;};exports[_0xb456('0x3b')]=function(_0x124f62,_0x28b3be,_0x438bd6){var _0x3fb11e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x124f62[_0xb456('0x35')]=_0x28b3be;_0x124f62[_0xb456('0x36')]=_0x438bd6;_0x124f62[_0xb456('0x39')]=_0x3fb11e;_0x124f62[_0xb456('0x3c')]=getSeconds(_0x124f62['responsetime'],_0x124f62[_0xb456('0x38')]);};exports['logLookAgent']=function(_0x5c361d,_0x2fbbe8,_0x2bf75b){_0x5c361d['membername']=_0x2fbbe8;_0x5c361d[_0xb456('0x3d')]=_0x2bf75b;};exports[_0xb456('0x3e')]=function(_0x75a688,_0x593be2,_0x465129){var _0x527d35=moment()[_0xb456('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x75a688[_0xb456('0x35')]=_0x593be2;_0x75a688[_0xb456('0x36')]=_0x465129;_0x75a688[_0xb456('0x39')]=_0x75a688[_0xb456('0x39')]?_0x75a688[_0xb456('0x39')]:_0x527d35;_0x75a688['endtime']=_0x75a688[_0xb456('0x3a')]?_0x75a688[_0xb456('0x3a')]:_0x527d35;_0x75a688[_0xb456('0x3c')]=getSeconds(_0x75a688[_0xb456('0x39')]||0x0,_0x75a688['starttime']||0x0);_0x75a688[_0xb456('0x3f')]=_0x75a688['answertime']?getSeconds(_0x75a688[_0xb456('0x3a')],_0x75a688[_0xb456('0x40')]):0x0;};exports[_0xb456('0x41')]=function(_0x26b56f){return _0x26b56f===_0xb456('0x42');};exports[_0xb456('0x43')]=function(_0x2a0eae,_0x55b28b,_0x22fb34,_0x1c750a,_0x415690){var _0x5a398f=_0x1c750a?'RECALL':_0x2a0eae[_0xb456('0x19')];_0x5a398f=_0x415690?_0xb456('0x44'):_0x5a398f;return{'actionid':_0x2a0eae[_0xb456('0x45')],'action':_0xb456('0x46'),'channel':_0x2a0eae[_0xb456('0x47')],'callerid':util[_0xb456('0x11')](_0xb456('0x12'),_0x5a398f,_0x2a0eae[_0xb456('0x48')]),'Exten':_0xb456('0x24'),'Context':_0xb456('0x49'),'Priority':'1','variable':_0x22fb34,'timeout':(_0x55b28b['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2a0eae[_0xb456('0x45')]};};exports[_0xb456('0x4a')]=function(_0x2fe7d2){return _0x2fe7d2[_0xb456('0x4b')]+_0x2fe7d2[_0xb456('0x4c')]+_0x2fe7d2[_0xb456('0x4d')]+_0x2fe7d2[_0xb456('0x4e')]+_0x2fe7d2[_0xb456('0x4f')];};exports[_0xb456('0x50')]=function(_0x35cec3){var _0x3ad1ed=_['clone'](_0x35cec3);_0x3ad1ed[_0xb456('0x35')]=0xf;_0x3ad1ed['statedesc']=_0xb456('0x51');return _0x3ad1ed;};exports['scheduledAt']=function(_0x321bbb,_0x6123c2,_0x39ca02){var _0x224c00={};_0x224c00[_0x6123c2]=_0x321bbb[_0x6123c2];_0x224c00['active']=![];_0x224c00[_0xb456('0x52')]=moment()[_0xb456('0x53')](_0x39ca02,_0xb456('0x54'))[_0xb456('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x224c00[_0xb456('0x1a')]=_0x321bbb[_0xb456('0x1a')];_0x224c00['ListId']=_0x321bbb['ListId'];_0x224c00['VoiceQueueId']=_0x321bbb[_0xb456('0x1c')]||undefined;return _0x224c00;};exports[_0xb456('0x55')]=function(_0x471dd8,_0x2e8e5d){if(!_[_0xb456('0x15')](_0x471dd8)){if(_0x471dd8[_0xb456('0x56')]>0x0){_0x471dd8[_0xb456('0x56')]-=0x1;}else{logger['error'](_0x2e8e5d,_0xb456('0x57'));}}else{logger[_0xb456('0xb')](_0x2e8e5d,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xb456('0x58')]=function(_0x24b12c){if(_0x24b12c<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4b9e4b,_0x4fa74a,_0xda9e24){_0x4b9e4b[_0xb456('0x59')]=_0x4fa74a;_0x4b9e4b[_0xb456('0x18')]=_0x4b9e4b[_0xb456('0x5a')];_0x4b9e4b[_0xb456('0x5b')]=_0x4b9e4b[_0xb456('0x47')];_0x4b9e4b['motionChannel']='voice';if(_0xda9e24){_0x4b9e4b[_0xb456('0x5c')]=_0xda9e24[_0xb456('0x5c')];}return _0x4b9e4b;};exports[_0xb456('0x5d')]=function(_0xbcdfd0){var _0x3ee725={};_0x3ee725[_0xb456('0x5a')]=_0xbcdfd0[_0xb456('0x5a')];_0x3ee725[_0xb456('0x5b')]=_0xbcdfd0[_0xb456('0x47')];_0x3ee725[_0xb456('0x45')]=_0xbcdfd0[_0xb456('0x45')];return _0x3ee725;};exports[_0xb456('0x5e')]=function(_0x4fdfc0){var _0x114c73=[];for(var _0x32133e in _0x4fdfc0){if(_0x4fdfc0['hasOwnProperty'](_0x32133e)){if(!_['isNil'](_0x4fdfc0[_0x32133e])&&_0x4fdfc0[_0x32133e][_0xb456('0x35')]===_0xb456('0x5f')&&_0x4fdfc0[_0x32133e][_0xb456('0x60')]==='reachable'){_0x114c73[_0xb456('0x61')](_0x4fdfc0[_0x32133e]['id']);}}}return _0x114c73;};exports['getDiff']=function(_0x3a86fa){var _0x3ae876=moment()['milliseconds'](0x0);var _0x39cf93=moment(_0x3a86fa)['milliseconds'](0x0);return _0x3ae876[_0xb456('0x7')](_0x39cf93,_0xb456('0x62'));};exports['createBody']=function(_0x3d6af3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d6af3[_0xb456('0x1a')],'ListId':_0x3d6af3[_0xb456('0x63')],'VoiceQueueId':_0x3d6af3[_0xb456('0x1c')]||undefined,'CampaignId':_0x3d6af3['CampaignId']||undefined};};exports[_0xb456('0x64')]=function(_0x122046){if(_0x122046===_0xb456('0x45')||_0x122046==='idContact'||_0x122046===_0xb456('0x5a')||_0x122046==='type'||_0x122046==='campaigntype'||_0x122046===_0xb456('0x65')||_0x122046===_0xb456('0x66')||_0x122046==='channelAgent'||_0x122046==='calleridname'||_0x122046===_0xb456('0x67')||_0x122046==='calleridnum'||_0x122046===_0xb456('0x52')||_0x122046===_0xb456('0x4b')||_0x122046==='countcongestionretry'||_0x122046===_0xb456('0x4d')||_0x122046==='countglobal'||_0x122046===_0xb456('0x68')||_0x122046==='callbackuniqueid'||_0x122046==='callbackat'||_0x122046==='recallme'||_0x122046==='ContactId'||_0x122046==='ListId'||_0x122046===_0xb456('0x3d')||_0x122046==='VoiceQueueId'||_0x122046===_0xb456('0x69')||_0x122046===_0xb456('0x6a')||_0x122046===_0xb456('0x6b')||_0x122046===_0xb456('0x6c')||_0x122046==='xmd-listid'||_0x122046===_0xb456('0x6d')||_0x122046===_0xb456('0x6e')||_0x122046===_0xb456('0x6f')||_0x122046===_0xb456('0x70')||_0x122046===_0xb456('0x71')||_0x122046===_0xb456('0x72')||_0x122046==='xmd-cdrtype'||_0x122046===_0xb456('0x73')||_0x122046===_0xb456('0x74')||_0x122046==='xmd-agi'||_0x122046===_0xb456('0x75')||_0x122046===_0xb456('0x76')||_0x122046===_0xb456('0x77')||_0x122046===_0xb456('0x78')||_0x122046===_0xb456('0x79')||_0x122046===_0xb456('0x7a')||_0x122046===_0xb456('0x7b')||_0x122046===_0xb456('0x7c')||_0x122046===_0xb456('0x75')||_0x122046===_0xb456('0x76')||_0x122046===_0xb456('0x77')||_0x122046===_0xb456('0x78')||_0x122046===_0xb456('0x79')||_0x122046===_0xb456('0x7a')||_0x122046==='rtpaudioqosrtt'||_0x122046===_0xb456('0x7c')||_0x122046===_0xb456('0x7d')||_0x122046==='bridgepvtcallid'||_0x122046==='state'||_0x122046==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2e3c70,_0x1bc0c8){var _0x3fdc54,_0x2b1f6d,_0x1dbe8c;if(_0x1bc0c8<=0x0){_0x1bc0c8=0x1;}_0x3fdc54=new RegExp(_0xb456('0x7e')+_0x1bc0c8+'}$');_0x2b1f6d=Math[_0xb456('0x7f')](0xa,_0x1bc0c8-0x1);_0x1dbe8c=Math[_0xb456('0x7f')](0xa,_0x1bc0c8)-0x1;return util[_0xb456('0x11')]('%s',_[_0xb456('0x80')](_0x2e3c70,_0x3fdc54,_[_0xb456('0x81')](_0x2b1f6d,_0x1dbe8c)));};exports[_0xb456('0x82')]=function(_0xe1a5a8){var _0x2bab3c=_0xe1a5a8[_0xb456('0x83')](/"(.*?)"/);return _0x2bab3c?_0x2bab3c[0x1]:_0xe1a5a8;};exports[_0xb456('0x84')]=function(_0x122efb){var _0x35de5a=_0x122efb['match'](/<(.*?)>/);return _0x35de5a?_0x35de5a[0x1]:_0x122efb;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 05660bd..6ce4a58 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 _0xe36a=['voicechannel','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0x1aa62d,_0xd15325){var _0x3e0b28=function(_0x3b1a50){while(--_0x3b1a50){_0x1aa62d['push'](_0x1aa62d['shift']());}};_0x3e0b28(++_0xd15325);}(_0xe36a,0x141));var _0xae36=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0xe36a[_0x122d9f];return _0x41a09e;};'use strict';exports[_0xae36('0x0')]={'queue':{'type':_0xae36('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xae36('0x1'),'required':!![]},'penalty':{'type':_0xae36('0x2'),'required':![]},'paused':{'type':_0xae36('0x3'),'required':![]}};exports[_0xae36('0x4')]={'queue':{'type':_0xae36('0x1'),'required':!![]},'interface':{'type':_0xae36('0x1'),'required':!![]}};exports[_0xae36('0x5')]={'interface':{'type':_0xae36('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xae36('0x1'),'required':![]}};exports[_0xae36('0x6')]={'module':{'type':_0xae36('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0xae36('0x7')]={'uniqueid':{'type':_0xae36('0x1'),'required':!![]},'filename':{'type':_0xae36('0x1')},'format':{'type':_0xae36('0x1')},'mixmonitorid':{'type':_0xae36('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xae36('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xae36('0x1'),'required':!![]},'exten':{'type':_0xae36('0x1'),'required':!![]},'context':{'type':_0xae36('0x1')}}; \ No newline at end of file +var _0x0fbe=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queueremove','reload'];(function(_0x39c48f,_0x2b0daa){var _0x3e1f59=function(_0x3d8714){while(--_0x3d8714){_0x39c48f['push'](_0x39c48f['shift']());}};_0x3e1f59(++_0x2b0daa);}(_0x0fbe,0x8a));var _0xe0fb=function(_0x4e6463,_0x73900c){_0x4e6463=_0x4e6463-0x0;var _0x3456b5=_0x0fbe[_0x4e6463];return _0x3456b5;};'use strict';exports[_0xe0fb('0x0')]={'queue':{'type':_0xe0fb('0x1'),'required':!![]},'interface':{'type':_0xe0fb('0x1'),'required':!![]},'membername':{'type':_0xe0fb('0x1'),'required':!![]},'penalty':{'type':_0xe0fb('0x2'),'required':![]},'paused':{'type':_0xe0fb('0x3'),'required':![]}};exports[_0xe0fb('0x4')]={'queue':{'type':_0xe0fb('0x1'),'required':!![]},'interface':{'type':_0xe0fb('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xe0fb('0x1'),'required':!![]},'paused':{'type':_0xe0fb('0x3')},'reason':{'type':_0xe0fb('0x1'),'required':![]}};exports[_0xe0fb('0x5')]={'module':{'type':_0xe0fb('0x1'),'required':![]}};exports[_0xe0fb('0x6')]={'uniqueid':{'type':_0xe0fb('0x1'),'required':!![]}};exports[_0xe0fb('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xe0fb('0x1')},'format':{'type':_0xe0fb('0x1')},'mixmonitorid':{'type':_0xe0fb('0x1')}};exports[_0xe0fb('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xe0fb('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ac61ba0..06509c0 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 _0xd917=['queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','initTelephones','initTrunks','isUndefined','trunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','util','moment','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xd917,0x197));var _0x7d91=function(_0x32a00d,_0xb3d01f){_0x32a00d=_0x32a00d-0x0;var _0x1c9096=_0xd917[_0x32a00d];return _0x1c9096;};'use strict';var BPromise=require(_0x7d91('0x0'));var util=require(_0x7d91('0x1'));var _=require('lodash');var moment=require(_0x7d91('0x2'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x7d91('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x7d91('0x4'));var Template=require(_0x7d91('0x5'));var Campaign=require(_0x7d91('0x6'));var VoiceExtension=require(_0x7d91('0x7'));var ZendeskAccount=require(_0x7d91('0x8'));var SalesforceAccount=require(_0x7d91('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x7d91('0xa'));var DeskAccount=require(_0x7d91('0xb'));var VtigerAccount=require(_0x7d91('0xc'));var ServicenowAccount=require(_0x7d91('0xd'));var Dynamics365Account=require(_0x7d91('0xe'));var FreshsalesAccount=require(_0x7d91('0xf'));var FaxAccount=require(_0x7d91('0x10'));var Realtime=function(){this[_0x7d91('0x11')]={};this[_0x7d91('0x12')]={};this['trunks']={};this[_0x7d91('0x13')]={};this[_0x7d91('0x14')]={};this['campaigns']={};this[_0x7d91('0x15')]={};this[_0x7d91('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7d91('0x17')]={};this[_0x7d91('0x18')]={};this[_0x7d91('0x19')]={};this[_0x7d91('0x1a')]={};this['timers']={};this[_0x7d91('0x1b')]={};this[_0x7d91('0x1c')]={};this[_0x7d91('0x1d')]={};this[_0x7d91('0x1e')]={};this[_0x7d91('0x1f')]={};this['zohoAccounts']={};this[_0x7d91('0x20')]={};this['vtigerAccounts']={};this[_0x7d91('0x21')]={};this[_0x7d91('0x22')]={};this[_0x7d91('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x70a141,_0x22d104,_0x2ebb0f){var _0x491985=_[_0x7d91('0x24')](_0x70a141,function(_0x575480,_0x1d88c4){return _0x575480[_0x2ebb0f];});for(var _0x59a987 in _0x22d104){if(_0x22d104[_0x7d91('0x25')](_0x59a987)){if(!_0x491985[_0x59a987]){delete _0x22d104[_0x59a987];}}}}function freeIsNotKeySip(_0x137601,_0x3fdbf5){var _0x66d1f4=_[_0x7d91('0x24')](_0x137601,function(_0x2460b3,_0x135d6d){return util[_0x7d91('0x26')](_0x7d91('0x27'),_0x2460b3[_0x7d91('0x28')]);});for(var _0x24aca3 in _0x3fdbf5){if(_0x3fdbf5['hasOwnProperty'](_0x24aca3)){if(!_0x66d1f4[_0x24aca3]){delete _0x3fdbf5[_0x24aca3];}}}}function freeIsNotKeyAgent(_0x100c65,_0x276c76){var _0x27c3d3=_['mapKeys'](_0x100c65,function(_0x32ecae,_0x5a3330){var _0x16fc61=_[_0x7d91('0x29')](_0x32ecae[_0x7d91('0x2a')])?util[_0x7d91('0x26')]('SIP/%s',_0x32ecae[_0x7d91('0x28')]):_0x32ecae[_0x7d91('0x2a')];return _0x16fc61;});for(var _0x4b729f in _0x276c76){if(_0x276c76[_0x7d91('0x25')](_0x4b729f)){if(!_0x27c3d3[_0x4b729f]){delete _0x276c76[_0x4b729f];}}}}function clearVoiceCallReports(_0x562636){_0x562636[_0x7d91('0x2b')]=0x0;_0x562636[_0x7d91('0x2c')]=0x0;_0x562636[_0x7d91('0x2d')]=0x0;_0x562636[_0x7d91('0x2e')]=0x0;_0x562636[_0x7d91('0x2f')]=0x0;}function clearCampaigns(_0xfab79b){if(!_['isEmpty'](_0xfab79b)){for(var _0x248ddf in _0xfab79b){if(_0xfab79b['hasOwnProperty'](_0x248ddf)){_0xfab79b[_0x248ddf][_0x7d91('0x30')]=0x0;_0xfab79b[_0x248ddf][_0x7d91('0x31')]=0x0;}}}}function clearVoiceQueues(_0x4e4fc5){if(!_[_0x7d91('0x32')](_0x4e4fc5)){for(var _0x115df8 in _0x4e4fc5){if(_0x4e4fc5[_0x7d91('0x25')](_0x115df8)){_0x4e4fc5[_0x115df8][_0x7d91('0x2b')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x2c')]=0x0;_0x4e4fc5[_0x115df8]['unmanaged']=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x33')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x2d')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x2e')]=0x0;_0x4e4fc5[_0x115df8]['sumBillable']=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x34')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x35')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x36')]=0x0;_0x4e4fc5[_0x115df8]['outboundCongestionCallsDay']=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x37')]=0x0;_0x4e4fc5[_0x115df8]['outboundUnknownCallsDay']=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x38')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x39')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x3a')]=0x0;_0x4e4fc5[_0x115df8]['outboundOriginateFailureCallsDay']=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x3b')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x3c')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x34')]=0x0;_0x4e4fc5[_0x115df8][_0x7d91('0x3d')]=0x0;_0x4e4fc5[_0x115df8]['queueStatusComplete']=!![];}}}}Realtime[_0x7d91('0x3e')][_0x7d91('0x3f')]=function(_0x572bd7,_0x133300){for(var _0x32ddbd in _0x133300){if(_0x572bd7[_0x7d91('0x25')](_0x32ddbd)){_0x572bd7[_0x32ddbd]=_0x133300[_0x32ddbd];}}};Realtime[_0x7d91('0x3e')][_0x7d91('0x40')]=function(){var _0x4cdfee=this;return function(_0x40a8fa){if(_0x40a8fa){freeIsNotKeyAgent(_0x40a8fa,_0x4cdfee[_0x7d91('0x11')]);for(var _0x3ee840=0x0,_0x4ef50b={},_0x3163d5={};_0x3ee840<_0x40a8fa[_0x7d91('0x41')];_0x3ee840+=0x1){_0x4ef50b=_0x40a8fa[_0x3ee840];var _0x198ef7=_[_0x7d91('0x29')](_0x4ef50b['interface'])?util[_0x7d91('0x26')](_0x7d91('0x27'),_0x4ef50b[_0x7d91('0x28')]):_0x4ef50b[_0x7d91('0x2a')];if(_['isUndefined'](_0x4cdfee[_0x7d91('0x11')][_0x198ef7])){_0x4cdfee[_0x7d91('0x11')][_0x198ef7]=new Agent(_0x4ef50b);}else{_0x4cdfee[_0x7d91('0x3f')](_0x4cdfee[_0x7d91('0x11')][_0x198ef7],_0x4ef50b);}}}return _0x4cdfee[_0x7d91('0x11')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x42')]=function(){var _0x3268c9=this;return function(_0x490707){if(_0x490707){freeIsNotKeySip(_0x490707,_0x3268c9[_0x7d91('0x12')]);for(var _0x3c2b2b=0x0,_0x306629={},_0x2eb06e={};_0x3c2b2b<_0x490707[_0x7d91('0x41')];_0x3c2b2b+=0x1){_0x306629=_0x490707[_0x3c2b2b];if(_['isUndefined'](_0x3268c9[_0x7d91('0x12')][util[_0x7d91('0x26')](_0x7d91('0x27'),_0x306629[_0x7d91('0x28')])])){_0x3268c9['telephones'][util['format'](_0x7d91('0x27'),_0x306629[_0x7d91('0x28')])]=new Telephone(_0x306629);}else{_0x3268c9[_0x7d91('0x3f')](_0x3268c9['telephones'][util[_0x7d91('0x26')](_0x7d91('0x27'),_0x306629[_0x7d91('0x28')])],_0x306629);}}}return _0x3268c9['telephones'];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x43')]=function(){var _0x51d1ba=this;return function(_0x593120){if(_0x593120){freeIsNotKeySip(_0x593120,_0x51d1ba['trunks']);for(var _0x2223fe=0x0,_0x568ba2={},_0xa09148={};_0x2223fe<_0x593120[_0x7d91('0x41')];_0x2223fe+=0x1){_0x568ba2=_0x593120[_0x2223fe];if(_[_0x7d91('0x44')](_0x51d1ba[_0x7d91('0x45')][util[_0x7d91('0x26')](_0x7d91('0x27'),_0x568ba2[_0x7d91('0x28')])])){_0x51d1ba[_0x7d91('0x45')][util['format'](_0x7d91('0x27'),_0x568ba2[_0x7d91('0x28')])]=new Trunk(_0x568ba2);}else{_0x51d1ba['mergeFromDatabase'](_0x51d1ba[_0x7d91('0x45')][util['format'](_0x7d91('0x27'),_0x568ba2[_0x7d91('0x28')])],_0x568ba2);}}}return _0x51d1ba[_0x7d91('0x45')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x46')]=function(){var _0x3ceaab=this;return function(_0x1ba3f2){if(_0x1ba3f2){freeIsNotKey(_0x1ba3f2,_0x3ceaab[_0x7d91('0x13')],'name');for(var _0x2b617e=0x0,_0x358acf={},_0x4ddb99={};_0x2b617e<_0x1ba3f2['length'];_0x2b617e+=0x1){_0x358acf=_0x1ba3f2[_0x2b617e];if(_[_0x7d91('0x44')](_0x3ceaab[_0x7d91('0x13')][_0x358acf[_0x7d91('0x28')]])){_0x3ceaab[_0x7d91('0x13')][_0x358acf[_0x7d91('0x28')]]=new VoiceQueue(_0x358acf);}else{_0x3ceaab['mergeFromDatabase'](_0x3ceaab[_0x7d91('0x13')][_0x358acf[_0x7d91('0x28')]],_0x358acf);}}}return _0x3ceaab[_0x7d91('0x13')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x47')]=function(){var _0x12d334=this;return function(_0xab3bcb){if(_0xab3bcb){freeIsNotKey(_0xab3bcb,_0x12d334['triggers'],'id');for(var _0x5b2a3e=0x0,_0x241b38={},_0x51d2d5={};_0x5b2a3e<_0xab3bcb[_0x7d91('0x41')];_0x5b2a3e+=0x1){_0x241b38=_0xab3bcb[_0x5b2a3e];if(_[_0x7d91('0x44')](_0x12d334[_0x7d91('0x14')][_0x241b38['id']])){_0x12d334[_0x7d91('0x14')][_0x241b38['id']]=new Trigger(_0x241b38);}else{_0x12d334['mergeFromDatabase'](_0x12d334['triggers'][_0x241b38['id']],_0x241b38);}}}return _0x12d334[_0x7d91('0x14')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x48')]=function(){var _0x53b5ce=this;return function(_0x571a32){if(_0x571a32){freeIsNotKey(_0x571a32,_0x53b5ce[_0x7d91('0x15')],'id');for(var _0x3b6752=0x0,_0x164f56={},_0x414e4f={};_0x3b6752<_0x571a32[_0x7d91('0x41')];_0x3b6752+=0x1){_0x164f56=_0x571a32[_0x3b6752];if(_['isUndefined'](_0x53b5ce[_0x7d91('0x15')][_0x164f56['id']])){_0x53b5ce['templates'][_0x164f56['id']]=new Template(_0x164f56);}else{_0x53b5ce[_0x7d91('0x3f')](_0x53b5ce[_0x7d91('0x15')][_0x164f56['id']],_0x164f56);}}}return _0x53b5ce[_0x7d91('0x15')];};};Realtime[_0x7d91('0x3e')]['initZendeskAccounts']=function(){var _0xf0564=this;return function(_0x48e9ba){if(_0x48e9ba){freeIsNotKey(_0x48e9ba,_0xf0564[_0x7d91('0x1c')],'id');for(var _0x5940e0=0x0,_0x25f3e1={},_0x146264={};_0x5940e0<_0x48e9ba['length'];_0x5940e0+=0x1){_0x25f3e1=_0x48e9ba[_0x5940e0];if(_[_0x7d91('0x44')](_0xf0564[_0x7d91('0x1c')][_0x25f3e1['id']])){_0xf0564[_0x7d91('0x1c')][_0x25f3e1['id']]=new ZendeskAccount(_0x25f3e1);}else{_0xf0564['mergeFromDatabase'](_0xf0564[_0x7d91('0x1c')][_0x25f3e1['id']],_0x25f3e1);}}}return _0xf0564[_0x7d91('0x1c')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x49')]=function(){var _0x19100d=this;return function(_0x8a6a6f){if(_0x8a6a6f){freeIsNotKey(_0x8a6a6f,_0x19100d['salesforceAccounts'],'id');for(var _0x112948=0x0,_0x188705={},_0x47a47c={};_0x112948<_0x8a6a6f[_0x7d91('0x41')];_0x112948+=0x1){_0x188705=_0x8a6a6f[_0x112948];if(_[_0x7d91('0x44')](_0x19100d[_0x7d91('0x1d')][_0x188705['id']])){_0x19100d[_0x7d91('0x1d')][_0x188705['id']]=new SalesforceAccount(_0x188705);}else{_0x19100d['mergeFromDatabase'](_0x19100d['salesforceAccounts'][_0x188705['id']],_0x188705);}}}return _0x19100d[_0x7d91('0x1d')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x472cb6=this;return function(_0x28ce88){if(_0x28ce88){freeIsNotKey(_0x28ce88,_0x472cb6[_0x7d91('0x1f')],'id');for(var _0x454dcf=0x0,_0x3a79d1={},_0x5e1aba={};_0x454dcf<_0x28ce88[_0x7d91('0x41')];_0x454dcf+=0x1){_0x3a79d1=_0x28ce88[_0x454dcf];if(_[_0x7d91('0x44')](_0x472cb6['freshdeskAccounts'][_0x3a79d1['id']])){_0x472cb6[_0x7d91('0x1f')][_0x3a79d1['id']]=new FreshdeskAccount(_0x3a79d1);}else{_0x472cb6[_0x7d91('0x3f')](_0x472cb6[_0x7d91('0x1f')][_0x3a79d1['id']],_0x3a79d1);}}}return _0x472cb6[_0x7d91('0x1f')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x4a')]=function(){var _0x38b617=this;return function(_0x4dbd62){if(_0x4dbd62){freeIsNotKey(_0x4dbd62,_0x38b617['zohoAccounts'],'id');for(var _0x2000c4=0x0,_0xcb0e31={},_0x3fefef={};_0x2000c4<_0x4dbd62[_0x7d91('0x41')];_0x2000c4+=0x1){_0xcb0e31=_0x4dbd62[_0x2000c4];if(_[_0x7d91('0x44')](_0x38b617[_0x7d91('0x4b')][_0xcb0e31['id']])){_0x38b617['zohoAccounts'][_0xcb0e31['id']]=new ZohoAccount(_0xcb0e31);}else{_0x38b617[_0x7d91('0x3f')](_0x38b617[_0x7d91('0x4b')][_0xcb0e31['id']],_0xcb0e31);}}}return _0x38b617[_0x7d91('0x4b')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x4c')]=function(){var _0x3d70ce=this;return function(_0x1dd1d6){if(_0x1dd1d6){freeIsNotKey(_0x1dd1d6,_0x3d70ce[_0x7d91('0x20')],'id');for(var _0x426e5e=0x0,_0x19cf80={},_0x53b048={};_0x426e5e<_0x1dd1d6['length'];_0x426e5e+=0x1){_0x19cf80=_0x1dd1d6[_0x426e5e];if(_[_0x7d91('0x44')](_0x3d70ce[_0x7d91('0x20')][_0x19cf80['id']])){_0x3d70ce['deskAccounts'][_0x19cf80['id']]=new DeskAccount(_0x19cf80);}else{_0x3d70ce[_0x7d91('0x3f')](_0x3d70ce[_0x7d91('0x20')][_0x19cf80['id']],_0x19cf80);}}}return _0x3d70ce[_0x7d91('0x20')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x4d')]=function(){var _0x4fdcc9=this;return function(_0x2d99be){if(_0x2d99be){freeIsNotKey(_0x2d99be,_0x4fdcc9[_0x7d91('0x1e')],'id');for(var _0x1cee0f=0x0,_0x8bc5e8={},_0x43e232={};_0x1cee0f<_0x2d99be[_0x7d91('0x41')];_0x1cee0f+=0x1){_0x8bc5e8=_0x2d99be[_0x1cee0f];if(_[_0x7d91('0x44')](_0x4fdcc9[_0x7d91('0x1e')][_0x8bc5e8['id']])){_0x4fdcc9[_0x7d91('0x1e')][_0x8bc5e8['id']]=new SugarcrmAccount(_0x8bc5e8);}else{_0x4fdcc9[_0x7d91('0x3f')](_0x4fdcc9[_0x7d91('0x1e')][_0x8bc5e8['id']],_0x8bc5e8);}}}return _0x4fdcc9[_0x7d91('0x1e')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x4e')]=function(){var _0x5dcea2=this;return function(_0x43b6e1){if(_0x43b6e1){freeIsNotKey(_0x43b6e1,_0x5dcea2['vtigerAccounts'],'id');for(var _0x20245f=0x0,_0x38c450={},_0x17665d={};_0x20245f<_0x43b6e1[_0x7d91('0x41')];_0x20245f+=0x1){_0x38c450=_0x43b6e1[_0x20245f];if(_['isUndefined'](_0x5dcea2[_0x7d91('0x4f')][_0x38c450['id']])){_0x5dcea2[_0x7d91('0x4f')][_0x38c450['id']]=new VtigerAccount(_0x38c450);}else{_0x5dcea2['mergeFromDatabase'](_0x5dcea2['vtigerAccounts'][_0x38c450['id']],_0x38c450);}}}return _0x5dcea2[_0x7d91('0x4f')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x50')]=function(){var _0x2a1a25=this;return function(_0x3e7741){if(_0x3e7741){freeIsNotKey(_0x3e7741,_0x2a1a25[_0x7d91('0x21')],'id');for(var _0x4cb7f9=0x0,_0x4f4392={},_0x401c2a={};_0x4cb7f9<_0x3e7741[_0x7d91('0x41')];_0x4cb7f9+=0x1){_0x4f4392=_0x3e7741[_0x4cb7f9];if(_['isUndefined'](_0x2a1a25[_0x7d91('0x21')][_0x4f4392['id']])){_0x2a1a25[_0x7d91('0x21')][_0x4f4392['id']]=new ServicenowAccount(_0x4f4392);}else{_0x2a1a25['mergeFromDatabase'](_0x2a1a25[_0x7d91('0x21')][_0x4f4392['id']],_0x4f4392);}}}return _0x2a1a25[_0x7d91('0x21')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x51')]=function(){var _0x33d8ac=this;return function(_0x2cc343){if(_0x2cc343){freeIsNotKey(_0x2cc343,_0x33d8ac[_0x7d91('0x22')],'id');for(var _0x415d8b=0x0,_0x1e42cb={},_0x2360a5={};_0x415d8b<_0x2cc343[_0x7d91('0x41')];_0x415d8b+=0x1){_0x1e42cb=_0x2cc343[_0x415d8b];if(_[_0x7d91('0x44')](_0x33d8ac[_0x7d91('0x22')][_0x1e42cb['id']])){_0x33d8ac[_0x7d91('0x22')][_0x1e42cb['id']]=new Dynamics365Account(_0x1e42cb);}else{_0x33d8ac[_0x7d91('0x3f')](_0x33d8ac[_0x7d91('0x22')][_0x1e42cb['id']],_0x1e42cb);}}}return _0x33d8ac[_0x7d91('0x22')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x52')]=function(){var _0x12ddbc=this;return function(_0xc58e58){if(_0xc58e58){freeIsNotKey(_0xc58e58,_0x12ddbc[_0x7d91('0x23')],'id');for(var _0x21a27e=0x0,_0x2638b0={},_0x9197f8={};_0x21a27e<_0xc58e58['length'];_0x21a27e+=0x1){_0x2638b0=_0xc58e58[_0x21a27e];if(_[_0x7d91('0x44')](_0x12ddbc[_0x7d91('0x23')][_0x2638b0['id']])){_0x12ddbc[_0x7d91('0x23')][_0x2638b0['id']]=new FreshsalesAccount(_0x2638b0);}else{_0x12ddbc[_0x7d91('0x3f')](_0x12ddbc[_0x7d91('0x23')][_0x2638b0['id']],_0x2638b0);}}}return _0x12ddbc[_0x7d91('0x23')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x53')]=function(){var _0xa91306=this;return function(_0x4c29ec){for(var _0x701dcc=0x0;_0x701dcc<_0x4c29ec[_0x7d91('0x41')];_0x701dcc+=0x1){_['merge'](_0xa91306[_0x7d91('0x13')][_0x4c29ec[_0x701dcc][_0x7d91('0x28')]],_0x4c29ec[_0x701dcc]);}return _0xa91306[_0x7d91('0x13')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x54')]=function(){var _0x492e40=this;return function(_0x231b71){clearVoiceQueues(_0x492e40[_0x7d91('0x13')]);if(_0x231b71){_0x231b71=_[_0x7d91('0x55')](_0x231b71,'uniqueid');for(var _0x21ee4d in _0x231b71){if(_0x231b71[_0x7d91('0x25')](_0x21ee4d)){var _0x1b9d6a={};for(var _0x5a7ff6=0x0;_0x5a7ff6<_0x231b71[_0x21ee4d][_0x7d91('0x41')];_0x5a7ff6+=0x1){var _0x189a84=_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x56')];if(_0x492e40[_0x7d91('0x13')][_0x189a84]){if(_0x231b71[_0x21ee4d][_0x5a7ff6]['queuecallerexit']){_0x492e40[_0x7d91('0x13')][_0x189a84][_0x7d91('0x57')]+=0x1;}if(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x58')]){_0x492e40[_0x7d91('0x13')][_0x189a84]['abandoned']+=0x1;}_0x492e40[_0x7d91('0x13')][_0x189a84][_0x7d91('0x2d')]+=moment(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x59')])[_0x7d91('0x5a')](moment(_0x231b71[_0x21ee4d][_0x5a7ff6]['queuecallerjoinAt']),_0x7d91('0x5b'))||0x0;if(_0x5a7ff6===_0x231b71[_0x21ee4d][_0x7d91('0x41')]-0x1){_0x492e40['voiceQueues'][_0x189a84]['sumDuration']+=moment(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x5c')]||_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x5d')]||_0x231b71[_0x21ee4d][_0x5a7ff6]['queuecallerexitAt'])[_0x7d91('0x5a')](moment(_0x231b71[_0x21ee4d][_0x5a7ff6]['queuecallerjoinAt']),_0x7d91('0x5b'))||0x0;_0x492e40['voiceQueues'][_0x189a84]['total']+=0x1;if(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x5e')]){_0x492e40[_0x7d91('0x13')][_0x189a84]['answered']+=0x1;_0x492e40[_0x7d91('0x13')][_0x189a84][_0x7d91('0x2f')]+=moment(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x5c')])['diff'](moment(_0x231b71[_0x21ee4d][_0x5a7ff6][_0x7d91('0x59')]),_0x7d91('0x5b'))||0x0;}}else{_0x492e40[_0x7d91('0x13')][_0x189a84]['sumDuration']+=_0x492e40[_0x7d91('0x13')][_0x189a84][_0x7d91('0x2d')]||0x0;}}}}}}return _0x492e40['voiceQueues'];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x5f')]=function(){var _0x1b8c28=this;return function(_0x954c54){clearVoiceCallReports(_0x1b8c28[_0x7d91('0x16')]);if(_0x954c54){for(var _0x47f07a=0x0;_0x47f07a<_0x954c54[_0x7d91('0x41')];_0x47f07a+=0x1){_0x1b8c28[_0x7d91('0x16')][_0x7d91('0x2b')]+=0x1;_0x1b8c28['outbound'][_0x7d91('0x2e')]+=_0x954c54[_0x47f07a][_0x7d91('0x60')];if(_0x954c54[_0x47f07a][_0x7d91('0x61')]===_0x7d91('0x62')){_0x1b8c28[_0x7d91('0x16')]['answered']+=0x1;_0x1b8c28[_0x7d91('0x16')][_0x7d91('0x2d')]+=_0x954c54[_0x47f07a][_0x7d91('0x60')]-_0x954c54[_0x47f07a][_0x7d91('0x63')]||0x0;_0x1b8c28[_0x7d91('0x16')][_0x7d91('0x2f')]+=_0x954c54[_0x47f07a][_0x7d91('0x63')];}}}return _0x1b8c28[_0x7d91('0x16')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x64')]=function(){var _0x5a580b=this;return function(_0x47755d){if(_0x47755d){freeIsNotKey(_0x47755d,_0x5a580b[_0x7d91('0x65')],_0x7d91('0x28'));for(var _0xd8d69=0x0,_0x2cc4ca={};_0xd8d69<_0x47755d['length'];_0xd8d69+=0x1){_0x2cc4ca=_0x47755d[_0xd8d69];if(_[_0x7d91('0x44')](_0x5a580b[_0x7d91('0x65')][_0x2cc4ca[_0x7d91('0x28')]])){_0x5a580b[_0x7d91('0x65')][_0x2cc4ca[_0x7d91('0x28')]]=new Campaign(_0x2cc4ca);}else{_0x5a580b['mergeFromDatabase'](_0x5a580b[_0x7d91('0x65')][_0x2cc4ca[_0x7d91('0x28')]],_0x2cc4ca);_0x5a580b[_0x7d91('0x65')][_0x2cc4ca[_0x7d91('0x28')]][_0x7d91('0x66')]=_0x2cc4ca[_0x7d91('0x67')]?_0x2cc4ca['SquareProject'][_0x7d91('0x28')]:undefined;}}}return _0x5a580b[_0x7d91('0x65')];};};Realtime['prototype'][_0x7d91('0x68')]=function(){var _0x225593=this;return function(_0x30ed2e){if(_0x30ed2e){freeIsNotKey(_0x30ed2e,_0x225593[_0x7d91('0x17')],'id');for(var _0x5667e6=0x0,_0x407eb0={};_0x5667e6<_0x30ed2e[_0x7d91('0x41')];_0x5667e6+=0x1){_0x407eb0=_0x30ed2e[_0x5667e6];if(_[_0x7d91('0x44')](_0x225593[_0x7d91('0x17')][_0x407eb0['id']])){_0x225593['voiceExtensions'][_0x407eb0['id']]=new VoiceExtension(_0x407eb0);}else{_0x225593['mergeFromDatabase'](_0x225593[_0x7d91('0x17')][_0x407eb0['id']],_0x407eb0);}}}return _0x225593[_0x7d91('0x17')];};};Realtime[_0x7d91('0x3e')][_0x7d91('0x69')]=function(){var _0x3fcc70=this;return function(_0x23e2b7){clearCampaigns(_0x3fcc70['campaigns']);for(var _0x230867=0x0;_0x230867<_0x23e2b7[_0x7d91('0x41')];_0x230867+=0x1){_['merge'](_0x3fcc70[_0x7d91('0x65')][_0x23e2b7[_0x230867]['name']],_0x23e2b7[_0x230867]);}return _0x3fcc70[_0x7d91('0x65')];};};Realtime[_0x7d91('0x3e')]['initFaxAccounts']=function(){var _0x2c14c2=this;return function(_0x44548b){if(_0x44548b){freeIsNotKey(_0x44548b,_0x2c14c2['faxAccounts'],'id');for(var _0x494d38=0x0,_0x13e763={},_0x5b3eda={};_0x494d38<_0x44548b[_0x7d91('0x41')];_0x494d38+=0x1){_0x13e763=_0x44548b[_0x494d38];if(_[_0x7d91('0x44')](_0x2c14c2[_0x7d91('0x6a')][_0x13e763['id']])){_0x2c14c2['faxAccounts'][_0x13e763['id']]=new FaxAccount(_0x13e763);}else{_0x2c14c2['mergeFromDatabase'](_0x2c14c2[_0x7d91('0x6a')][_0x13e763['id']],_0x13e763);}}}return _0x2c14c2[_0x7d91('0x6a')];};};module[_0x7d91('0x6b')]=Realtime; \ No newline at end of file +var _0xaf43=['templates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','sumBillable','initVoiceCallReports','disposition','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','name','interface','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','length','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTriggers'];(function(_0x28b89a,_0x969718){var _0x3a09f5=function(_0x3a425c){while(--_0x3a425c){_0x28b89a['push'](_0x28b89a['shift']());}};_0x3a09f5(++_0x969718);}(_0xaf43,0x99));var _0x3af4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xaf43[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0x3af4('0x0'));var util=require(_0x3af4('0x1'));var _=require(_0x3af4('0x2'));var moment=require(_0x3af4('0x3'));var Agent=require(_0x3af4('0x4'));var Telephone=require(_0x3af4('0x5'));var Trunk=require(_0x3af4('0x6'));var VoiceQueue=require(_0x3af4('0x7'));var Trigger=require(_0x3af4('0x8'));var Template=require(_0x3af4('0x9'));var Campaign=require(_0x3af4('0xa'));var VoiceExtension=require(_0x3af4('0xb'));var ZendeskAccount=require(_0x3af4('0xc'));var SalesforceAccount=require(_0x3af4('0xd'));var FreshdeskAccount=require(_0x3af4('0xe'));var SugarcrmAccount=require(_0x3af4('0xf'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x3af4('0x10'));var VtigerAccount=require(_0x3af4('0x11'));var ServicenowAccount=require(_0x3af4('0x12'));var Dynamics365Account=require(_0x3af4('0x13'));var FreshsalesAccount=require(_0x3af4('0x14'));var FaxAccount=require(_0x3af4('0x15'));var Realtime=function(){this['agents']={};this[_0x3af4('0x16')]={};this['trunks']={};this[_0x3af4('0x17')]={};this[_0x3af4('0x18')]={};this[_0x3af4('0x19')]={};this['templates']={};this[_0x3af4('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3af4('0x1b')]={};this[_0x3af4('0x1c')]={};this[_0x3af4('0x1d')]={};this[_0x3af4('0x1e')]={};this[_0x3af4('0x1f')]={};this[_0x3af4('0x20')]={};this[_0x3af4('0x21')]={};this[_0x3af4('0x22')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x3af4('0x23')]={};this[_0x3af4('0x24')]={};this['vtigerAccounts']={};this[_0x3af4('0x25')]={};this[_0x3af4('0x26')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x5b8c9f,_0x1276ba,_0x1832cf){var _0x1bd3c7=_[_0x3af4('0x27')](_0x5b8c9f,function(_0x4417e8,_0xab9fbb){return _0x4417e8[_0x1832cf];});for(var _0x25ff89 in _0x1276ba){if(_0x1276ba[_0x3af4('0x28')](_0x25ff89)){if(!_0x1bd3c7[_0x25ff89]){delete _0x1276ba[_0x25ff89];}}}}function freeIsNotKeySip(_0x248988,_0x140464){var _0x4c5f43=_[_0x3af4('0x27')](_0x248988,function(_0x52811f,_0x33a891){return util[_0x3af4('0x29')](_0x3af4('0x2a'),_0x52811f['name']);});for(var _0x86fab9 in _0x140464){if(_0x140464[_0x3af4('0x28')](_0x86fab9)){if(!_0x4c5f43[_0x86fab9]){delete _0x140464[_0x86fab9];}}}}function freeIsNotKeyAgent(_0x544927,_0x2aa9b4){var _0x2e5d34=_[_0x3af4('0x27')](_0x544927,function(_0x41ad65,_0x1e76d9){var _0x21992c=_[_0x3af4('0x2b')](_0x41ad65['interface'])?util[_0x3af4('0x29')](_0x3af4('0x2a'),_0x41ad65[_0x3af4('0x2c')]):_0x41ad65[_0x3af4('0x2d')];return _0x21992c;});for(var _0x45e62a in _0x2aa9b4){if(_0x2aa9b4[_0x3af4('0x28')](_0x45e62a)){if(!_0x2e5d34[_0x45e62a]){delete _0x2aa9b4[_0x45e62a];}}}}function clearVoiceCallReports(_0x169993){_0x169993[_0x3af4('0x2e')]=0x0;_0x169993[_0x3af4('0x2f')]=0x0;_0x169993[_0x3af4('0x30')]=0x0;_0x169993[_0x3af4('0x31')]=0x0;_0x169993['sumBillable']=0x0;}function clearCampaigns(_0x1e3aa3){if(!_['isEmpty'](_0x1e3aa3)){for(var _0x9dd48a in _0x1e3aa3){if(_0x1e3aa3[_0x3af4('0x28')](_0x9dd48a)){_0x1e3aa3[_0x9dd48a][_0x3af4('0x32')]=0x0;_0x1e3aa3[_0x9dd48a][_0x3af4('0x33')]=0x0;}}}}function clearVoiceQueues(_0x353751){if(!_['isEmpty'](_0x353751)){for(var _0x1b9b13 in _0x353751){if(_0x353751[_0x3af4('0x28')](_0x1b9b13)){_0x353751[_0x1b9b13][_0x3af4('0x2e')]=0x0;_0x353751[_0x1b9b13]['answered']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x34')]=0x0;_0x353751[_0x1b9b13][_0x3af4('0x35')]=0x0;_0x353751[_0x1b9b13][_0x3af4('0x30')]=0x0;_0x353751[_0x1b9b13]['sumDuration']=0x0;_0x353751[_0x1b9b13]['sumBillable']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x36')]=0x0;_0x353751[_0x1b9b13]['outboundNoAnswerCallsDay']=0x0;_0x353751[_0x1b9b13]['outboundBusyCallsDay']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x37')]=0x0;_0x353751[_0x1b9b13]['outboundNoSuchCallsDay']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x38')]=0x0;_0x353751[_0x1b9b13][_0x3af4('0x39')]=0x0;_0x353751[_0x1b9b13][_0x3af4('0x3a')]=0x0;_0x353751[_0x1b9b13]['outboundBlacklistCallsDay']=0x0;_0x353751[_0x1b9b13]['outboundOriginateFailureCallsDay']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x3b')]=0x0;_0x353751[_0x1b9b13][_0x3af4('0x3c')]=0x0;_0x353751[_0x1b9b13]['outboundAnswerAgiCallsDay']=0x0;_0x353751[_0x1b9b13]['outboundAnswerCallsDay']=0x0;_0x353751[_0x1b9b13][_0x3af4('0x3d')]=!![];}}}}Realtime['prototype'][_0x3af4('0x3e')]=function(_0xe65038,_0x5922d9){for(var _0x398a0b in _0x5922d9){if(_0xe65038[_0x3af4('0x28')](_0x398a0b)){_0xe65038[_0x398a0b]=_0x5922d9[_0x398a0b];}}};Realtime[_0x3af4('0x3f')][_0x3af4('0x40')]=function(){var _0x2ed05e=this;return function(_0x34eb08){if(_0x34eb08){freeIsNotKeyAgent(_0x34eb08,_0x2ed05e[_0x3af4('0x41')]);for(var _0x147215=0x0,_0x11b749={},_0x8cace1={};_0x147215<_0x34eb08[_0x3af4('0x42')];_0x147215+=0x1){_0x11b749=_0x34eb08[_0x147215];var _0x3c711e=_[_0x3af4('0x2b')](_0x11b749[_0x3af4('0x2d')])?util[_0x3af4('0x29')](_0x3af4('0x2a'),_0x11b749[_0x3af4('0x2c')]):_0x11b749['interface'];if(_[_0x3af4('0x43')](_0x2ed05e[_0x3af4('0x41')][_0x3c711e])){_0x2ed05e[_0x3af4('0x41')][_0x3c711e]=new Agent(_0x11b749);}else{_0x2ed05e['mergeFromDatabase'](_0x2ed05e[_0x3af4('0x41')][_0x3c711e],_0x11b749);}}}return _0x2ed05e['agents'];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x44')]=function(){var _0x168e96=this;return function(_0x2ccbb4){if(_0x2ccbb4){freeIsNotKeySip(_0x2ccbb4,_0x168e96['telephones']);for(var _0x45b7db=0x0,_0xcf93ba={},_0xf4ac40={};_0x45b7db<_0x2ccbb4[_0x3af4('0x42')];_0x45b7db+=0x1){_0xcf93ba=_0x2ccbb4[_0x45b7db];if(_[_0x3af4('0x43')](_0x168e96[_0x3af4('0x16')][util['format'](_0x3af4('0x2a'),_0xcf93ba[_0x3af4('0x2c')])])){_0x168e96[_0x3af4('0x16')][util[_0x3af4('0x29')](_0x3af4('0x2a'),_0xcf93ba['name'])]=new Telephone(_0xcf93ba);}else{_0x168e96[_0x3af4('0x3e')](_0x168e96['telephones'][util[_0x3af4('0x29')]('SIP/%s',_0xcf93ba[_0x3af4('0x2c')])],_0xcf93ba);}}}return _0x168e96[_0x3af4('0x16')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x45')]=function(){var _0x16908d=this;return function(_0x2224f6){if(_0x2224f6){freeIsNotKeySip(_0x2224f6,_0x16908d[_0x3af4('0x46')]);for(var _0xcb97d1=0x0,_0x495430={},_0x2a8bc0={};_0xcb97d1<_0x2224f6[_0x3af4('0x42')];_0xcb97d1+=0x1){_0x495430=_0x2224f6[_0xcb97d1];if(_[_0x3af4('0x43')](_0x16908d[_0x3af4('0x46')][util['format'](_0x3af4('0x2a'),_0x495430[_0x3af4('0x2c')])])){_0x16908d[_0x3af4('0x46')][util[_0x3af4('0x29')](_0x3af4('0x2a'),_0x495430[_0x3af4('0x2c')])]=new Trunk(_0x495430);}else{_0x16908d['mergeFromDatabase'](_0x16908d[_0x3af4('0x46')][util[_0x3af4('0x29')]('SIP/%s',_0x495430['name'])],_0x495430);}}}return _0x16908d['trunks'];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x47')]=function(){var _0x28fc90=this;return function(_0x38f02d){if(_0x38f02d){freeIsNotKey(_0x38f02d,_0x28fc90[_0x3af4('0x17')],_0x3af4('0x2c'));for(var _0x30aea5=0x0,_0x5cac84={},_0x374848={};_0x30aea5<_0x38f02d[_0x3af4('0x42')];_0x30aea5+=0x1){_0x5cac84=_0x38f02d[_0x30aea5];if(_[_0x3af4('0x43')](_0x28fc90[_0x3af4('0x17')][_0x5cac84['name']])){_0x28fc90[_0x3af4('0x17')][_0x5cac84[_0x3af4('0x2c')]]=new VoiceQueue(_0x5cac84);}else{_0x28fc90[_0x3af4('0x3e')](_0x28fc90['voiceQueues'][_0x5cac84['name']],_0x5cac84);}}}return _0x28fc90[_0x3af4('0x17')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x48')]=function(){var _0xaa10df=this;return function(_0x2a7bfa){if(_0x2a7bfa){freeIsNotKey(_0x2a7bfa,_0xaa10df[_0x3af4('0x18')],'id');for(var _0xb6cc8a=0x0,_0x1e9b3c={},_0x39cc00={};_0xb6cc8a<_0x2a7bfa[_0x3af4('0x42')];_0xb6cc8a+=0x1){_0x1e9b3c=_0x2a7bfa[_0xb6cc8a];if(_[_0x3af4('0x43')](_0xaa10df[_0x3af4('0x18')][_0x1e9b3c['id']])){_0xaa10df[_0x3af4('0x18')][_0x1e9b3c['id']]=new Trigger(_0x1e9b3c);}else{_0xaa10df[_0x3af4('0x3e')](_0xaa10df[_0x3af4('0x18')][_0x1e9b3c['id']],_0x1e9b3c);}}}return _0xaa10df[_0x3af4('0x18')];};};Realtime[_0x3af4('0x3f')]['initTemplates']=function(){var _0x431ce6=this;return function(_0x36d60e){if(_0x36d60e){freeIsNotKey(_0x36d60e,_0x431ce6[_0x3af4('0x49')],'id');for(var _0x102535=0x0,_0x375b22={},_0x1a142b={};_0x102535<_0x36d60e['length'];_0x102535+=0x1){_0x375b22=_0x36d60e[_0x102535];if(_[_0x3af4('0x43')](_0x431ce6[_0x3af4('0x49')][_0x375b22['id']])){_0x431ce6[_0x3af4('0x49')][_0x375b22['id']]=new Template(_0x375b22);}else{_0x431ce6['mergeFromDatabase'](_0x431ce6[_0x3af4('0x49')][_0x375b22['id']],_0x375b22);}}}return _0x431ce6[_0x3af4('0x49')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x4a')]=function(){var _0x80c7b6=this;return function(_0x14f8a7){if(_0x14f8a7){freeIsNotKey(_0x14f8a7,_0x80c7b6['zendeskAccounts'],'id');for(var _0x5960c7=0x0,_0x46ed74={},_0x2475e6={};_0x5960c7<_0x14f8a7[_0x3af4('0x42')];_0x5960c7+=0x1){_0x46ed74=_0x14f8a7[_0x5960c7];if(_[_0x3af4('0x43')](_0x80c7b6[_0x3af4('0x21')][_0x46ed74['id']])){_0x80c7b6[_0x3af4('0x21')][_0x46ed74['id']]=new ZendeskAccount(_0x46ed74);}else{_0x80c7b6['mergeFromDatabase'](_0x80c7b6['zendeskAccounts'][_0x46ed74['id']],_0x46ed74);}}}return _0x80c7b6[_0x3af4('0x21')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x4b')]=function(){var _0x55df28=this;return function(_0x3a804b){if(_0x3a804b){freeIsNotKey(_0x3a804b,_0x55df28[_0x3af4('0x22')],'id');for(var _0x10043a=0x0,_0x527ae0={},_0xc8271={};_0x10043a<_0x3a804b[_0x3af4('0x42')];_0x10043a+=0x1){_0x527ae0=_0x3a804b[_0x10043a];if(_['isUndefined'](_0x55df28[_0x3af4('0x22')][_0x527ae0['id']])){_0x55df28[_0x3af4('0x22')][_0x527ae0['id']]=new SalesforceAccount(_0x527ae0);}else{_0x55df28['mergeFromDatabase'](_0x55df28[_0x3af4('0x22')][_0x527ae0['id']],_0x527ae0);}}}return _0x55df28[_0x3af4('0x22')];};};Realtime[_0x3af4('0x3f')]['initFreshdeskAccounts']=function(){var _0x4ee038=this;return function(_0x485f26){if(_0x485f26){freeIsNotKey(_0x485f26,_0x4ee038[_0x3af4('0x4c')],'id');for(var _0x539ca8=0x0,_0x533d94={},_0x19e1c7={};_0x539ca8<_0x485f26[_0x3af4('0x42')];_0x539ca8+=0x1){_0x533d94=_0x485f26[_0x539ca8];if(_[_0x3af4('0x43')](_0x4ee038[_0x3af4('0x4c')][_0x533d94['id']])){_0x4ee038['freshdeskAccounts'][_0x533d94['id']]=new FreshdeskAccount(_0x533d94);}else{_0x4ee038['mergeFromDatabase'](_0x4ee038[_0x3af4('0x4c')][_0x533d94['id']],_0x533d94);}}}return _0x4ee038[_0x3af4('0x4c')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x4d')]=function(){var _0x284728=this;return function(_0x339c03){if(_0x339c03){freeIsNotKey(_0x339c03,_0x284728[_0x3af4('0x23')],'id');for(var _0x4bcc52=0x0,_0x13a154={},_0x51a3ee={};_0x4bcc52<_0x339c03[_0x3af4('0x42')];_0x4bcc52+=0x1){_0x13a154=_0x339c03[_0x4bcc52];if(_['isUndefined'](_0x284728['zohoAccounts'][_0x13a154['id']])){_0x284728['zohoAccounts'][_0x13a154['id']]=new ZohoAccount(_0x13a154);}else{_0x284728['mergeFromDatabase'](_0x284728[_0x3af4('0x23')][_0x13a154['id']],_0x13a154);}}}return _0x284728[_0x3af4('0x23')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x4e')]=function(){var _0x2a016f=this;return function(_0x3322b7){if(_0x3322b7){freeIsNotKey(_0x3322b7,_0x2a016f[_0x3af4('0x24')],'id');for(var _0x5cf480=0x0,_0x5ae10b={},_0xdb4130={};_0x5cf480<_0x3322b7[_0x3af4('0x42')];_0x5cf480+=0x1){_0x5ae10b=_0x3322b7[_0x5cf480];if(_[_0x3af4('0x43')](_0x2a016f[_0x3af4('0x24')][_0x5ae10b['id']])){_0x2a016f[_0x3af4('0x24')][_0x5ae10b['id']]=new DeskAccount(_0x5ae10b);}else{_0x2a016f[_0x3af4('0x3e')](_0x2a016f[_0x3af4('0x24')][_0x5ae10b['id']],_0x5ae10b);}}}return _0x2a016f[_0x3af4('0x24')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x4f')]=function(){var _0x11761f=this;return function(_0x453850){if(_0x453850){freeIsNotKey(_0x453850,_0x11761f['sugarcrmAccounts'],'id');for(var _0x25096a=0x0,_0x2da1db={},_0x42ebb6={};_0x25096a<_0x453850[_0x3af4('0x42')];_0x25096a+=0x1){_0x2da1db=_0x453850[_0x25096a];if(_[_0x3af4('0x43')](_0x11761f[_0x3af4('0x50')][_0x2da1db['id']])){_0x11761f[_0x3af4('0x50')][_0x2da1db['id']]=new SugarcrmAccount(_0x2da1db);}else{_0x11761f[_0x3af4('0x3e')](_0x11761f['sugarcrmAccounts'][_0x2da1db['id']],_0x2da1db);}}}return _0x11761f[_0x3af4('0x50')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x51')]=function(){var _0x2ae135=this;return function(_0x275f6c){if(_0x275f6c){freeIsNotKey(_0x275f6c,_0x2ae135[_0x3af4('0x52')],'id');for(var _0x289222=0x0,_0x42a8b5={},_0x2810be={};_0x289222<_0x275f6c[_0x3af4('0x42')];_0x289222+=0x1){_0x42a8b5=_0x275f6c[_0x289222];if(_[_0x3af4('0x43')](_0x2ae135['vtigerAccounts'][_0x42a8b5['id']])){_0x2ae135[_0x3af4('0x52')][_0x42a8b5['id']]=new VtigerAccount(_0x42a8b5);}else{_0x2ae135[_0x3af4('0x3e')](_0x2ae135['vtigerAccounts'][_0x42a8b5['id']],_0x42a8b5);}}}return _0x2ae135[_0x3af4('0x52')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x53')]=function(){var _0x240ecb=this;return function(_0x5921bf){if(_0x5921bf){freeIsNotKey(_0x5921bf,_0x240ecb[_0x3af4('0x25')],'id');for(var _0x48d0ea=0x0,_0x5ee777={},_0x54731b={};_0x48d0ea<_0x5921bf[_0x3af4('0x42')];_0x48d0ea+=0x1){_0x5ee777=_0x5921bf[_0x48d0ea];if(_[_0x3af4('0x43')](_0x240ecb['servicenowAccounts'][_0x5ee777['id']])){_0x240ecb[_0x3af4('0x25')][_0x5ee777['id']]=new ServicenowAccount(_0x5ee777);}else{_0x240ecb[_0x3af4('0x3e')](_0x240ecb['servicenowAccounts'][_0x5ee777['id']],_0x5ee777);}}}return _0x240ecb[_0x3af4('0x25')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x54')]=function(){var _0x52a9d9=this;return function(_0x481e2e){if(_0x481e2e){freeIsNotKey(_0x481e2e,_0x52a9d9['dynamics365Accounts'],'id');for(var _0x29981a=0x0,_0xea26d3={},_0x3a5cb8={};_0x29981a<_0x481e2e['length'];_0x29981a+=0x1){_0xea26d3=_0x481e2e[_0x29981a];if(_[_0x3af4('0x43')](_0x52a9d9[_0x3af4('0x26')][_0xea26d3['id']])){_0x52a9d9[_0x3af4('0x26')][_0xea26d3['id']]=new Dynamics365Account(_0xea26d3);}else{_0x52a9d9[_0x3af4('0x3e')](_0x52a9d9[_0x3af4('0x26')][_0xea26d3['id']],_0xea26d3);}}}return _0x52a9d9[_0x3af4('0x26')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x55')]=function(){var _0x140551=this;return function(_0x124cdd){if(_0x124cdd){freeIsNotKey(_0x124cdd,_0x140551['freshsalesAccounts'],'id');for(var _0x33365a=0x0,_0x7d81de={},_0x122a0f={};_0x33365a<_0x124cdd[_0x3af4('0x42')];_0x33365a+=0x1){_0x7d81de=_0x124cdd[_0x33365a];if(_[_0x3af4('0x43')](_0x140551[_0x3af4('0x56')][_0x7d81de['id']])){_0x140551[_0x3af4('0x56')][_0x7d81de['id']]=new FreshsalesAccount(_0x7d81de);}else{_0x140551['mergeFromDatabase'](_0x140551[_0x3af4('0x56')][_0x7d81de['id']],_0x7d81de);}}}return _0x140551[_0x3af4('0x56')];};};Realtime['prototype'][_0x3af4('0x57')]=function(){var _0xe91619=this;return function(_0x506d85){for(var _0x81b745=0x0;_0x81b745<_0x506d85[_0x3af4('0x42')];_0x81b745+=0x1){_[_0x3af4('0x58')](_0xe91619[_0x3af4('0x17')][_0x506d85[_0x81b745][_0x3af4('0x2c')]],_0x506d85[_0x81b745]);}return _0xe91619['voiceQueues'];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x59')]=function(){var _0x21a968=this;return function(_0x10dafb){clearVoiceQueues(_0x21a968[_0x3af4('0x17')]);if(_0x10dafb){_0x10dafb=_[_0x3af4('0x5a')](_0x10dafb,_0x3af4('0x5b'));for(var _0x4b94ac in _0x10dafb){if(_0x10dafb[_0x3af4('0x28')](_0x4b94ac)){var _0x38246e={};for(var _0x564675=0x0;_0x564675<_0x10dafb[_0x4b94ac][_0x3af4('0x42')];_0x564675+=0x1){var _0x20edd1=_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x5c')];if(_0x21a968['voiceQueues'][_0x20edd1]){if(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x5d')]){_0x21a968[_0x3af4('0x17')][_0x20edd1]['unmanaged']+=0x1;}if(_0x10dafb[_0x4b94ac][_0x564675]['queuecallerabandon']){_0x21a968[_0x3af4('0x17')][_0x20edd1][_0x3af4('0x35')]+=0x1;}_0x21a968[_0x3af4('0x17')][_0x20edd1]['sumHoldTime']+=moment(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x5e')])[_0x3af4('0x5f')](moment(_0x10dafb[_0x4b94ac][_0x564675]['queuecallerjoinAt']),_0x3af4('0x60'))||0x0;if(_0x564675===_0x10dafb[_0x4b94ac]['length']-0x1){_0x21a968[_0x3af4('0x17')][_0x20edd1]['sumDuration']+=moment(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x61')]||_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x62')]||_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x63')])[_0x3af4('0x5f')](moment(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x64')]),_0x3af4('0x60'))||0x0;_0x21a968[_0x3af4('0x17')][_0x20edd1][_0x3af4('0x2e')]+=0x1;if(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x65')]){_0x21a968['voiceQueues'][_0x20edd1]['answered']+=0x1;_0x21a968[_0x3af4('0x17')][_0x20edd1][_0x3af4('0x66')]+=moment(_0x10dafb[_0x4b94ac][_0x564675][_0x3af4('0x61')])[_0x3af4('0x5f')](moment(_0x10dafb[_0x4b94ac][_0x564675]['queuecallerleaveAt']),_0x3af4('0x60'))||0x0;}}else{_0x21a968[_0x3af4('0x17')][_0x20edd1][_0x3af4('0x31')]+=_0x21a968[_0x3af4('0x17')][_0x20edd1][_0x3af4('0x30')]||0x0;}}}}}}return _0x21a968[_0x3af4('0x17')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x67')]=function(){var _0x2a8240=this;return function(_0x43c03b){clearVoiceCallReports(_0x2a8240['outbound']);if(_0x43c03b){for(var _0x374ee0=0x0;_0x374ee0<_0x43c03b[_0x3af4('0x42')];_0x374ee0+=0x1){_0x2a8240[_0x3af4('0x1a')][_0x3af4('0x2e')]+=0x1;_0x2a8240[_0x3af4('0x1a')][_0x3af4('0x31')]+=_0x43c03b[_0x374ee0]['duration'];if(_0x43c03b[_0x374ee0][_0x3af4('0x68')]==='ANSWERED'){_0x2a8240[_0x3af4('0x1a')][_0x3af4('0x2f')]+=0x1;_0x2a8240[_0x3af4('0x1a')][_0x3af4('0x30')]+=_0x43c03b[_0x374ee0][_0x3af4('0x69')]-_0x43c03b[_0x374ee0][_0x3af4('0x6a')]||0x0;_0x2a8240[_0x3af4('0x1a')][_0x3af4('0x66')]+=_0x43c03b[_0x374ee0][_0x3af4('0x6a')];}}}return _0x2a8240[_0x3af4('0x1a')];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x6b')]=function(){var _0x183eea=this;return function(_0x25df4e){if(_0x25df4e){freeIsNotKey(_0x25df4e,_0x183eea['campaigns'],_0x3af4('0x2c'));for(var _0x232884=0x0,_0x579f7e={};_0x232884<_0x25df4e[_0x3af4('0x42')];_0x232884+=0x1){_0x579f7e=_0x25df4e[_0x232884];if(_[_0x3af4('0x43')](_0x183eea['campaigns'][_0x579f7e[_0x3af4('0x2c')]])){_0x183eea[_0x3af4('0x19')][_0x579f7e[_0x3af4('0x2c')]]=new Campaign(_0x579f7e);}else{_0x183eea[_0x3af4('0x3e')](_0x183eea[_0x3af4('0x19')][_0x579f7e[_0x3af4('0x2c')]],_0x579f7e);_0x183eea['campaigns'][_0x579f7e[_0x3af4('0x2c')]]['dialQueueProject']=_0x579f7e[_0x3af4('0x6c')]?_0x579f7e[_0x3af4('0x6c')]['name']:undefined;}}}return _0x183eea['campaigns'];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x6d')]=function(){var _0x786ec2=this;return function(_0x52daaa){if(_0x52daaa){freeIsNotKey(_0x52daaa,_0x786ec2[_0x3af4('0x1b')],'id');for(var _0x1b2a81=0x0,_0x4b1353={};_0x1b2a81<_0x52daaa['length'];_0x1b2a81+=0x1){_0x4b1353=_0x52daaa[_0x1b2a81];if(_[_0x3af4('0x43')](_0x786ec2[_0x3af4('0x1b')][_0x4b1353['id']])){_0x786ec2[_0x3af4('0x1b')][_0x4b1353['id']]=new VoiceExtension(_0x4b1353);}else{_0x786ec2[_0x3af4('0x3e')](_0x786ec2[_0x3af4('0x1b')][_0x4b1353['id']],_0x4b1353);}}}return _0x786ec2['voiceExtensions'];};};Realtime[_0x3af4('0x3f')]['initCampaignHopperHistory']=function(){var _0xab5cd4=this;return function(_0x435ad5){clearCampaigns(_0xab5cd4[_0x3af4('0x19')]);for(var _0x55c5b1=0x0;_0x55c5b1<_0x435ad5[_0x3af4('0x42')];_0x55c5b1+=0x1){_[_0x3af4('0x58')](_0xab5cd4[_0x3af4('0x19')][_0x435ad5[_0x55c5b1]['name']],_0x435ad5[_0x55c5b1]);}return _0xab5cd4['campaigns'];};};Realtime[_0x3af4('0x3f')][_0x3af4('0x6e')]=function(){var _0x6c379=this;return function(_0x56cf65){if(_0x56cf65){freeIsNotKey(_0x56cf65,_0x6c379[_0x3af4('0x6f')],'id');for(var _0x43861d=0x0,_0x314451={},_0x53fc7f={};_0x43861d<_0x56cf65[_0x3af4('0x42')];_0x43861d+=0x1){_0x314451=_0x56cf65[_0x43861d];if(_[_0x3af4('0x43')](_0x6c379[_0x3af4('0x6f')][_0x314451['id']])){_0x6c379['faxAccounts'][_0x314451['id']]=new FaxAccount(_0x314451);}else{_0x6c379[_0x3af4('0x3e')](_0x6c379['faxAccounts'][_0x314451['id']],_0x314451);}}}return _0x6c379[_0x3af4('0x6f')];};};module[_0x3af4('0x70')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f6ebeda..fb5b30e 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 _0x7721=['transfers','linkedid','uniqueid','UserId','membername','create','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','mobile','blindTransfer','exports','lodash','moment','util','../../../config/environment','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','assigned','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','keys','getCallType','split','getAgentByInternal','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','callerid','\x22%s\x22\x20<%s>','calleridname'];(function(_0x51b705,_0xcae5c1){var _0x5dec15=function(_0x26b1c0){while(--_0x26b1c0){_0x51b705['push'](_0x51b705['shift']());}};_0x5dec15(++_0xcae5c1);}(_0x7721,0x124));var _0x1772=function(_0x5694df,_0x40bd24){_0x5694df=_0x5694df-0x0;var _0x13a69e=_0x7721[_0x5694df];return _0x13a69e;};'use strict';var _=require(_0x1772('0x0'));var moment=require(_0x1772('0x1'));var util=require(_0x1772('0x2'));var config=require(_0x1772('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x1772('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x1772('0x5'));var RpcVoiceQueueReport=require(_0x1772('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x1772('0x7'));var VoiceQueueReport=require(_0x1772('0x8'));var VoiceCallReport=require(_0x1772('0x9'));var VoiceAgentReport=require(_0x1772('0xa'));var VoiceDialReport=require(_0x1772('0xb'));var UserReport=require(_0x1772('0xc'));function Report(_0x23e2f3){this[_0x1772('0xd')]=_0x23e2f3;this[_0x1772('0xe')]=_0x23e2f3[_0x1772('0xe')];this[_0x1772('0xf')]=_0x23e2f3['telephones'];}Report[_0x1772('0x10')][_0x1772('0x11')]=function(_0xe31b2c){var _0x401b7b=new VoiceQueueReport(this[_0x1772('0xd')]);var _0x3c8e74=new VoiceAgentReport(this['realtime']);var _0x84b3b1=new VoiceDialReport(this[_0x1772('0xd')]);var _0x333096=new VoiceCallReport(this[_0x1772('0xd')]);var _0x2420bb=new UserReport(this[_0x1772('0xd')]);if(config[_0x1772('0x12')]&&config['xdr']['disabled']){ami['on'](_0x1772('0x13'),this[_0x1772('0x14')][_0x1772('0x15')](this));ami['on'](_0x1772('0x16'),this[_0x1772('0x17')][_0x1772('0x15')](this));ami['on'](_0x1772('0x18'),this[_0x1772('0x19')][_0x1772('0x15')](this));ami['on'](_0x1772('0x1a'),this[_0x1772('0x1b')][_0x1772('0x15')](this));ami['on']('blindtransfer',this['blindTransfer'][_0x1772('0x15')](this));ami['on'](_0x1772('0x1c'),this[_0x1772('0x1d')][_0x1772('0x15')](this));}};Report['prototype'][_0x1772('0x1e')]=function(_0xfa1d29){var _0x4e3ef5;_0x4e3ef5=_[_0x1772('0x1f')](this[_0x1772('0xe')],function(_0x1639b4){return _0x1639b4[_0x1772('0x20')]==_0xfa1d29||_0x1639b4[_0x1772('0x21')]==_0xfa1d29;});if(_[_0x1772('0x22')](_0x4e3ef5)){var _0x21a18f=_[_0x1772('0x1f')](this[_0x1772('0xf')],function(_0x3a9b0e){return _0x3a9b0e[_0x1772('0x20')]==_0xfa1d29||_0x3a9b0e[_0x1772('0x21')]==_0xfa1d29;});if(_0x21a18f){_0x4e3ef5=_[_0x1772('0x1f')](this[_0x1772('0xe')],function(_0x43bb92){return _0x43bb92['interface']==util[_0x1772('0x23')](_0x1772('0x24'),_0x21a18f[_0x1772('0x21')]);});}}return _0x4e3ef5;};Report['prototype'][_0x1772('0x14')]=function(_0x4c8c5f){for(var _0x394765=0x0;_0x394765<_0x4c8c5f[_0x1772('0x25')];_0x394765+=0x1){var _0x17bef7=this[_0x1772('0x1e')](_0x4c8c5f[_0x394765]['connectedlinenum']);if(_0x17bef7){_0x4c8c5f[_0x394765]['accountcode']=_0x17bef7['accountcode'];_0x4c8c5f[_0x394765][_0x1772('0x26')]=!![];_0x4c8c5f[_0x394765]['lastAssignedTo']=_0x17bef7[_0x1772('0x21')];_0x4c8c5f[_0x394765][_0x1772('0x27')]=_[_0x1772('0x22')](_0x17bef7['interface'])?util['format'](_0x1772('0x24'),_0x17bef7['name']):_0x17bef7[_0x1772('0x27')];if(_0x4c8c5f[_0x394765][_0x1772('0x28')]){_0x4c8c5f[_0x394765][_0x1772('0x29')]=moment()['format'](_0x1772('0x2a'));}if(_0x4c8c5f[_0x394765]['queuecallerexit']){_0x4c8c5f[_0x394765][_0x1772('0x2b')]=moment()['format'](_0x1772('0x2a'));}RpcMemberReport[_0x1772('0x14')](_0x4c8c5f[_0x394765]);}RpcVoiceQueueReport['create'](_0x4c8c5f[_0x394765]);}};function extractCalleridNumber(_0x2e0452){var _0x2f9b3a=_0x2e0452[_0x1772('0x2c')](/<(.*?)>/);return _0x2f9b3a?_0x2f9b3a[0x1]:_0x2e0452;}Report[_0x1772('0x10')]['getAgentByInternal']=function(_0x109421){for(var _0xdb1634=0x0;_0xdb1634','calleridname','transfers','linkedid','uniqueid','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','xcally-motion-preview'];(function(_0x36ffd5,_0x130ede){var _0x22bd77=function(_0x1db7ae){while(--_0x1db7ae){_0x36ffd5['push'](_0x36ffd5['shift']());}};_0x22bd77(++_0x130ede);}(_0xe399,0x11e));var _0x9e39=function(_0x3b74ee,_0x40e684){_0x3b74ee=_0x3b74ee-0x0;var _0x42d182=_0xe399[_0x3b74ee];return _0x42d182;};'use strict';var _=require(_0x9e39('0x0'));var moment=require(_0x9e39('0x1'));var util=require(_0x9e39('0x2'));var config=require(_0x9e39('0x3'));var ami=require(_0x9e39('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9e39('0x5'));var RpcVoiceDialReport=require(_0x9e39('0x6'));var RpcMemberReport=require(_0x9e39('0x7'));var RpcVoiceQueueReport=require(_0x9e39('0x8'));var RpcVoiceRecording=require(_0x9e39('0x9'));var RpcVoiceTransferReport=require(_0x9e39('0xa'));var VoiceQueueReport=require(_0x9e39('0xb'));var VoiceCallReport=require(_0x9e39('0xc'));var VoiceAgentReport=require(_0x9e39('0xd'));var VoiceDialReport=require(_0x9e39('0xe'));var UserReport=require(_0x9e39('0xf'));function Report(_0xad3a5f){this[_0x9e39('0x10')]=_0xad3a5f;this['agents']=_0xad3a5f['agents'];this['telephones']=_0xad3a5f[_0x9e39('0x11')];}Report[_0x9e39('0x12')][_0x9e39('0x13')]=function(_0x66c610){var _0x38d786=new VoiceQueueReport(this[_0x9e39('0x10')]);var _0x2f548a=new VoiceAgentReport(this['realtime']);var _0x1ae3fb=new VoiceDialReport(this['realtime']);var _0x54feb3=new VoiceCallReport(this[_0x9e39('0x10')]);var _0x48e1bd=new UserReport(this[_0x9e39('0x10')]);if(config[_0x9e39('0x14')]&&config[_0x9e39('0x14')][_0x9e39('0x15')]){ami['on'](_0x9e39('0x16'),this[_0x9e39('0x17')]['bind'](this));ami['on'](_0x9e39('0x18'),this['voiceCallReport'][_0x9e39('0x19')](this));ami['on'](_0x9e39('0x1a'),this[_0x9e39('0x1b')][_0x9e39('0x19')](this));ami['on']('custom:voiceDialReport',this[_0x9e39('0x1c')][_0x9e39('0x19')](this));ami['on'](_0x9e39('0x1d'),this[_0x9e39('0x1e')][_0x9e39('0x19')](this));ami['on'](_0x9e39('0x1f'),this[_0x9e39('0x20')][_0x9e39('0x19')](this));}};Report[_0x9e39('0x12')][_0x9e39('0x21')]=function(_0x5f0a35){var _0x27302f;_0x27302f=_[_0x9e39('0x22')](this[_0x9e39('0x23')],function(_0x12c7d8){return _0x12c7d8[_0x9e39('0x24')]==_0x5f0a35||_0x12c7d8[_0x9e39('0x25')]==_0x5f0a35;});if(_[_0x9e39('0x26')](_0x27302f)){var _0x53e02c=_['find'](this[_0x9e39('0x11')],function(_0x4336d9){return _0x4336d9[_0x9e39('0x24')]==_0x5f0a35||_0x4336d9['name']==_0x5f0a35;});if(_0x53e02c){_0x27302f=_['find'](this[_0x9e39('0x23')],function(_0x1b5b56){return _0x1b5b56[_0x9e39('0x27')]==util[_0x9e39('0x28')](_0x9e39('0x29'),_0x53e02c[_0x9e39('0x25')]);});}}return _0x27302f;};Report['prototype'][_0x9e39('0x17')]=function(_0x598f97){for(var _0x3af915=0x0;_0x3af915<_0x598f97['length'];_0x3af915+=0x1){var _0x558481=this[_0x9e39('0x21')](_0x598f97[_0x3af915][_0x9e39('0x2a')]);if(_0x558481){_0x598f97[_0x3af915][_0x9e39('0x24')]=_0x558481[_0x9e39('0x24')];_0x598f97[_0x3af915]['assigned']=!![];_0x598f97[_0x3af915][_0x9e39('0x2b')]=_0x558481[_0x9e39('0x25')];_0x598f97[_0x3af915][_0x9e39('0x27')]=_[_0x9e39('0x26')](_0x558481['interface'])?util[_0x9e39('0x28')](_0x9e39('0x29'),_0x558481[_0x9e39('0x25')]):_0x558481[_0x9e39('0x27')];if(_0x598f97[_0x3af915][_0x9e39('0x2c')]){_0x598f97[_0x3af915][_0x9e39('0x2d')]=moment()[_0x9e39('0x28')](_0x9e39('0x2e'));}if(_0x598f97[_0x3af915][_0x9e39('0x2f')]){_0x598f97[_0x3af915][_0x9e39('0x30')]=moment()[_0x9e39('0x28')](_0x9e39('0x2e'));}RpcMemberReport[_0x9e39('0x17')](_0x598f97[_0x3af915]);}RpcVoiceQueueReport[_0x9e39('0x31')](_0x598f97[_0x3af915]);}};function extractCalleridNumber(_0x402b2f){var _0x23aa21=_0x402b2f['match'](/<(.*?)>/);return _0x23aa21?_0x23aa21[0x1]:_0x402b2f;}Report[_0x9e39('0x12')][_0x9e39('0x32')]=function(_0x4967f0){for(var _0x501f21=0x0;_0x501f210x0?_0x5ad1f9:0x0;this['voiceQueues'][_0x415a74['queue']][_0x60b5('0x56')]=this[_0x60b5('0xf')][_0x415a74['queue']][_0x60b5('0x56')]>_['toNumber'](_0x415a74['loggedin'])?_['toNumber'](_0x415a74['loggedin']):this['voiceQueues'][_0x415a74[_0x60b5('0x6b')]][_0x60b5('0x56')];this[_0x60b5('0x4f')](this[_0x60b5('0xf')][_0x415a74[_0x60b5('0x6b')]],'queuesummary');}logger[_0x60b5('0x4b')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x60b5('0x3b')](this['voiceQueues'][_0x415a74[_0x60b5('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x60b5('0x43')](_0x60b5('0x70'),this[_0x60b5('0xf')][_0x415a74[_0x60b5('0x6b')]]);}}}catch(_0x7deb8){logger[_0x60b5('0x39')](_0x60b5('0x66'),util[_0x60b5('0x3b')](_0x7deb8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')]['syncQueueSummaryComplete']=function(_0x4adec3){logger['debug'](_0x60b5('0x71'),util[_0x60b5('0x3b')](_0x4adec3,{'showHidden':![],'depth':null}));this[_0x60b5('0x10')]=!![];};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0x16')]=function(_0x4f5c9b){try{if(this['isNotNull'](_0x4f5c9b)){logger[_0x60b5('0x4b')](_0x60b5('0x72'),_0x4f5c9b['uniqueid'],util['inspect'](_0x4f5c9b,{'showHidden':![],'depth':null}));if(_[_0x60b5('0x62')](this['queueReports'][_0x4f5c9b['uniqueid']]))this[_0x60b5('0x3c')][_0x4f5c9b[_0x60b5('0x47')]]=[];if(_['isUndefined'](this[_0x60b5('0xe')][_0x4f5c9b['uniqueid']]))this[_0x60b5('0xe')][_0x4f5c9b[_0x60b5('0x47')]]={};var _0x341eb0=new QueueReport();_0x341eb0[_0x60b5('0x4a')]=_0x4f5c9b[_0x60b5('0x6b')];_0x341eb0[_0x60b5('0x50')]=this['voiceQueues'][_0x341eb0[_0x60b5('0x4a')]]&&this[_0x60b5('0xf')][_0x341eb0[_0x60b5('0x4a')]][_0x60b5('0x50')]?this[_0x60b5('0xf')][_0x341eb0[_0x60b5('0x4a')]][_0x60b5('0x50')]||_0x60b5('0x51'):'inbound';_0x341eb0[_0x60b5('0x6b')]=_0x4f5c9b['queue'];_0x341eb0[_0x60b5('0x73')]=moment()['format'](_0x60b5('0x74'));_0x341eb0[_0x60b5('0x75')]=_0x4f5c9b[_0x60b5('0x75')];_0x341eb0[_0x60b5('0x76')]=_0x4f5c9b[_0x60b5('0x76')];_0x341eb0[_0x60b5('0x47')]=_0x4f5c9b[_0x60b5('0x47')];_0x341eb0['routealias']=this[_0x60b5('0xe')][_0x4f5c9b[_0x60b5('0x47')]][_0x60b5('0x77')];logger[_0x60b5('0x68')](_0x60b5('0x78'),_0x341eb0['name'],_0x341eb0['type']);_['merge'](_0x341eb0,_[_0x60b5('0x79')](_0x4f5c9b,_[_0x60b5('0x7a')](_0x341eb0)));this[_0x60b5('0x3c')][_0x4f5c9b[_0x60b5('0x47')]]['push'](_0x341eb0);this[_0x60b5('0xe')][_0x4f5c9b[_0x60b5('0x47')]]=_0x341eb0;this[_0x60b5('0x44')](_0x341eb0,'queuecallerjoin');}}catch(_0x3d39a6){logger[_0x60b5('0x39')](_0x60b5('0x72'),_0x4f5c9b['uniqueid'],util[_0x60b5('0x3b')](_0x3d39a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0x18')]=function(_0x53eb03){try{if(this['isNotNull'](_0x53eb03)){logger[_0x60b5('0x4b')](_0x60b5('0x7b'),_0x53eb03[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x53eb03,{'showHidden':![],'depth':null}));if(this[_0x60b5('0x3c')][_0x53eb03[_0x60b5('0x47')]]){var _0x41b9d7=_[_0x60b5('0x7c')](this[_0x60b5('0x3c')][_0x53eb03['uniqueid']]);_0x41b9d7[_0x60b5('0x7d')]=![];_0x41b9d7[_0x60b5('0x7e')]=null;_0x41b9d7[_0x60b5('0x7f')]=_0x53eb03[_0x60b5('0x7f')];_0x41b9d7[_0x60b5('0x80')]=_0x53eb03[_0x60b5('0x80')];_0x41b9d7[_0x60b5('0x17')]=!![];_0x41b9d7[_0x60b5('0x81')]=moment()['format'](_0x60b5('0x74'));_0x41b9d7['queuecallerexitreason']=_0x60b5('0x82');_0x41b9d7[_0x60b5('0x83')]=null;logger[_0x60b5('0x68')](_0x60b5('0x84'),_0x41b9d7[_0x60b5('0x4a')],_0x41b9d7[_0x60b5('0x50')]);this[_0x60b5('0xe')][_0x53eb03[_0x60b5('0x47')]]=_0x41b9d7;this[_0x60b5('0x41')](_0x41b9d7,_0x60b5('0x17'));}}}catch(_0x27f852){logger['error'](_0x60b5('0x7b'),_0x53eb03['uniqueid'],util[_0x60b5('0x3b')](_0x27f852,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')]['syncQueueCallerLeave']=function(_0x61eac2){try{if(this[_0x60b5('0x61')](_0x61eac2)){logger[_0x60b5('0x4b')](_0x60b5('0x85'),_0x61eac2[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x61eac2,{'showHidden':![],'depth':null}));if(this[_0x60b5('0x3c')][_0x61eac2[_0x60b5('0x47')]]){var _0x751a7b=_[_0x60b5('0x7c')](this[_0x60b5('0x3c')][_0x61eac2['uniqueid']]);_0x751a7b[_0x60b5('0x86')]=moment()[_0x60b5('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x751a7b[_0x60b5('0x87')]=_0x61eac2[_0x60b5('0x87')];_0x751a7b[_0x60b5('0x88')]=_0x61eac2['connectedlinename'];logger[_0x60b5('0x68')](_0x60b5('0x89'),_0x751a7b[_0x60b5('0x4a')],_0x751a7b[_0x60b5('0x50')],_0x61eac2[_0x60b5('0x87')],_0x61eac2[_0x60b5('0x88')]);this[_0x60b5('0xe')][_0x61eac2[_0x60b5('0x47')]]=_0x751a7b;this['emitVoiceQueueChannelSave'](_0x751a7b,'queuecallerleave');}}}catch(_0x3173d1){logger[_0x60b5('0x39')](_0x60b5('0x85'),_0x61eac2[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x3173d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0x8a')]=function(_0x1957fe){try{if(this[_0x60b5('0x61')](_0x1957fe)){logger[_0x60b5('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x1957fe[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x1957fe,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1957fe[_0x60b5('0x47')]]){var _0x266d40=_[_0x60b5('0x7c')](this[_0x60b5('0x3c')][_0x1957fe[_0x60b5('0x47')]]);_0x266d40[_0x60b5('0x7d')]=!![];_0x266d40['queuecallerexitreason']=_0x60b5('0x8b');logger[_0x60b5('0x68')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x266d40[_0x60b5('0x4a')],_0x266d40[_0x60b5('0x50')]);}}}catch(_0x50301d){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x1957fe['uniqueid'],util[_0x60b5('0x3b')](_0x50301d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0x1b')]=function(_0x35904c){try{if(this['isNotNull'](_0x35904c)){logger[_0x60b5('0x4b')](_0x60b5('0x8c'),_0x35904c[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x35904c,{'showHidden':![],'depth':null}));if(this[_0x60b5('0x3c')][_0x35904c['uniqueid']]){var _0x382f43=_[_0x60b5('0x7c')](this['queueReports'][_0x35904c['uniqueid']]);_0x382f43[_0x60b5('0x17')]=![];_0x382f43['queuecallerabandonAt']=null;_0x382f43[_0x60b5('0x8d')]=!![];_0x382f43['lastAssignedTo']=_0x35904c['membername'];_0x382f43[_0x60b5('0x7f')]=_0x35904c[_0x60b5('0x7f')];_0x382f43[_0x60b5('0x7d')]=!![];_0x382f43[_0x60b5('0x8e')]=![];_0x382f43[_0x60b5('0x8f')]=null;if(!_0x382f43['transfer']){if(_0x35904c[_0x60b5('0x90')]==_0x60b5('0x91')){_0x382f43['queuecallerexitreason']=_0x60b5('0x92');logger[_0x60b5('0x68')](_0x60b5('0x93'),_0x382f43[_0x60b5('0x4a')],_0x382f43[_0x60b5('0x50')]);}else{if(_[_0x60b5('0x94')](_0x35904c[_0x60b5('0x36')]['toLowerCase'](),_0x60b5('0x95'))){if(this['queueReports'][_0x35904c[_0x60b5('0x96')]]){var _0x2ac4f5=_[_0x60b5('0x7c')](this[_0x60b5('0x3c')][_0x35904c['linkedid']]);_0x2ac4f5['queuecallercomplete']=![];_0x2ac4f5['queuecallerexit']=!![];_0x2ac4f5['queuecallerexitAt']=moment(_0x382f43[_0x60b5('0x73')])[_0x60b5('0x97')](_0x35904c[_0x60b5('0x7f')],_0x60b5('0x98'))['format'](_0x60b5('0x74'));_0x2ac4f5['queuecallerexitreason']='FORWARDTRANSFER';_0x2ac4f5[_0x60b5('0x91')]=!![];_0x2ac4f5[_0x60b5('0x99')]=_0x60b5('0x9a');_0x2ac4f5[_0x60b5('0x9b')]=_0x35904c['destexten'];_0x2ac4f5[_0x60b5('0x9c')]=_0x35904c[_0x60b5('0x47')];logger[_0x60b5('0x68')](_0x60b5('0x9d'),_0x2ac4f5[_0x60b5('0x4a')],_0x2ac4f5[_0x60b5('0x50')]);var _0x159a42=this[_0x60b5('0x3c')][_0x35904c[_0x60b5('0x96')]];this[_0x60b5('0x3c')][_0x35904c[_0x60b5('0x96')]]=this[_0x60b5('0x3c')][_0x35904c[_0x60b5('0x47')]];this['queueReports'][_0x35904c[_0x60b5('0x47')]]=_0x159a42;}}else{_0x382f43[_0x60b5('0x9e')]=_0x60b5('0x9f')+_0x35904c[_0x60b5('0x90')][_0x60b5('0xa0')]();logger[_0x60b5('0x68')](_0x60b5('0xa1'),_0x382f43['name'],_0x382f43[_0x60b5('0x50')],_0x382f43['queuecallerexitreason']);}}}this[_0x60b5('0xe')][_0x35904c[_0x60b5('0x47')]]=_0x382f43;this[_0x60b5('0x41')](_0x382f43,_0x60b5('0xa2'));}}}catch(_0xa37657){logger[_0x60b5('0x39')]('[%s][voiceQueueReport][agentcomplete]',_0x35904c[_0x60b5('0x47')],util['inspect'](_0xa37657,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')]['syncVarSet']=function(_0x1e8eef){try{if(this[_0x60b5('0x61')](_0x1e8eef)){logger[_0x60b5('0x4b')](_0x60b5('0xa3'),_0x1e8eef[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x1e8eef,{'showHidden':![],'depth':null}));this[_0x60b5('0xa4')](_0x1e8eef[_0x60b5('0x47')],_[_0x60b5('0x7a')](_0x1e8eef['variable'])[0x0],_0x1e8eef[_0x60b5('0xa5')]);if(this['queueReports'][_0x1e8eef[_0x60b5('0x47')]]){var _0x9c819a=_[_0x60b5('0x7c')](this[_0x60b5('0x3c')][_0x1e8eef[_0x60b5('0x47')]]);if(_0x9c819a){if(this[_0x60b5('0x61')](_0x1e8eef['variable'])&&this[_0x60b5('0x61')](_0x1e8eef[_0x60b5('0xa6')][_0x60b5('0xa7')])){switch(_0x1e8eef['value']){case _0x60b5('0xa8'):_0x9c819a['queuecallerexit']=![];_0x9c819a[_0x60b5('0x8f')]=null;break;case _0x60b5('0xa9'):_0x9c819a['lastevent']=_0x60b5('0xaa');_0x9c819a[_0x60b5('0x8e')]=!![];_0x9c819a[_0x60b5('0x8f')]=moment()[_0x60b5('0x48')](_0x60b5('0x74'));_0x9c819a[_0x60b5('0x86')]=moment()['format'](_0x60b5('0x74'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1e8eef[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x9c819a,{'showHidden':![],'depth':null}));ami[_0x60b5('0x43')]('custom:timeout',_0x9c819a);break;default:_0x9c819a[_0x60b5('0x8e')]=!![];_0x9c819a[_0x60b5('0x8f')]=moment()['format'](_0x60b5('0x74'));_0x9c819a[_0x60b5('0x86')]=moment()[_0x60b5('0x48')](_0x60b5('0x74'));}_0x9c819a[_0x60b5('0x17')]=![];_0x9c819a[_0x60b5('0x81')]=null;_0x9c819a[_0x60b5('0x9e')]=_0x1e8eef[_0x60b5('0xa5')];this[_0x60b5('0xe')][_0x1e8eef[_0x60b5('0x47')]]=_0x9c819a;this[_0x60b5('0x41')](_0x9c819a,_0x60b5('0x1c'));}else if(this[_0x60b5('0x61')](_0x1e8eef[_0x60b5('0xa6')])&&this[_0x60b5('0x61')](_0x1e8eef['variable'][_0x60b5('0xab')])){if(!_0x9c819a[_0x60b5('0x17')]){_0x9c819a[_0x60b5('0x8e')]=!![];_0x9c819a[_0x60b5('0x8f')]=moment()[_0x60b5('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x9c819a[_0x60b5('0x9e')]=_0x60b5('0xac');_0x9c819a[_0x60b5('0x86')]=moment()['format'](_0x60b5('0x74'));this[_0x60b5('0xe')][_0x1e8eef[_0x60b5('0x47')]]=_0x9c819a;}}logger['info'](_0x60b5('0xad'),_0x1e8eef[_0x60b5('0x47')],_0x9c819a[_0x60b5('0x4a')],_0x9c819a[_0x60b5('0x50')],_[_0x60b5('0x7a')](_0x1e8eef[_0x60b5('0xa6')])[0x0],_0x1e8eef[_0x60b5('0xa5')]);_0x9c819a[_0x60b5('0x3e')]=this[_0x60b5('0x3e')][_0x1e8eef[_0x60b5('0x47')]];}}}}catch(_0x4da0d3){logger['error']('[%s][voiceQueueReport][varset]',_0x1e8eef[_0x60b5('0x47')],util[_0x60b5('0x3b')](_0x4da0d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0xa4')]=function(_0x49de50,_0x143d8b,_0x32862b){var _0x2c2834=['rtpaudioqos',_0x60b5('0xae'),_0x60b5('0xaf'),'rtpaudioqosjitterbridged',_0x60b5('0xb0'),_0x60b5('0xb1'),'rtpaudioqosrtt',_0x60b5('0xb2'),_0x60b5('0xb3'),_0x60b5('0xb4'),'bridgepeer',_0x60b5('0xb5'),_0x60b5('0xb6'),'memberdynamic',_0x60b5('0xb7'),'memberlastcall',_0x60b5('0xb8'),_0x60b5('0xb9'),_0x60b5('0xba')];if(!_[_0x60b5('0xbb')](_0x143d8b)&&!_[_0x60b5('0xbc')](_0x2c2834,_0x143d8b)){if(_[_0x60b5('0x62')](this[_0x60b5('0x3e')][_0x49de50])){this[_0x60b5('0x3e')][_0x49de50]={};}this[_0x60b5('0x3e')][_0x49de50][_0x143d8b]=_0x32862b;}};VoiceQueueReport[_0x60b5('0x8')][_0x60b5('0x1e')]=function(_0x3daa3e){try{if(this[_0x60b5('0x61')](_0x3daa3e)){logger[_0x60b5('0x4b')]('[%s][voiceQueueReport][hangup]',_0x3daa3e[_0x60b5('0x47')],util['inspect'](_0x3daa3e,{'showHidden':![],'depth':null}));if(this[_0x60b5('0x3c')][_0x3daa3e['uniqueid']]){for(var _0x54ce44=0x0,_0x11674f={};_0x54ce440x0?_0x4d92dc:0x0;this[_0x45b9('0x10')][_0xcc12dc['queue']]['talking']=this['voiceQueues'][_0xcc12dc[_0x45b9('0x66')]][_0x45b9('0x56')]>_[_0x45b9('0x6a')](_0xcc12dc['loggedin'])?_['toNumber'](_0xcc12dc[_0x45b9('0x6d')]):this[_0x45b9('0x10')][_0xcc12dc[_0x45b9('0x66')]][_0x45b9('0x56')];this[_0x45b9('0x4e')](this['voiceQueues'][_0xcc12dc['queue']],_0x45b9('0x64'));}logger[_0x45b9('0x4b')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x45b9('0x3d')](this[_0x45b9('0x10')][_0xcc12dc['queue']],{'showHidden':![],'depth':null}));ami[_0x45b9('0x43')](_0x45b9('0x6e'),this['voiceQueues'][_0xcc12dc['queue']]);}}}catch(_0x54797d){logger[_0x45b9('0x3b')](_0x45b9('0x65'),util['inspect'](_0x54797d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')]['syncQueueSummaryComplete']=function(_0x42a3fc){logger[_0x45b9('0x4b')](_0x45b9('0x6f'),util[_0x45b9('0x3d')](_0x42a3fc,{'showHidden':![],'depth':null}));this[_0x45b9('0x11')]=!![];};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x70')]=function(_0x5e7309){try{if(this[_0x45b9('0x60')](_0x5e7309)){logger[_0x45b9('0x4b')](_0x45b9('0x71'),_0x5e7309[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x5e7309,{'showHidden':![],'depth':null}));if(_[_0x45b9('0x61')](this[_0x45b9('0xd')][_0x5e7309['uniqueid']]))this[_0x45b9('0xd')][_0x5e7309[_0x45b9('0x72')]]=[];if(_[_0x45b9('0x61')](this[_0x45b9('0x34')][_0x5e7309[_0x45b9('0x72')]]))this[_0x45b9('0x34')][_0x5e7309[_0x45b9('0x72')]]={};var _0x3e6684=new QueueReport();_0x3e6684['name']=_0x5e7309[_0x45b9('0x66')];_0x3e6684[_0x45b9('0x4f')]=this['voiceQueues'][_0x3e6684[_0x45b9('0x49')]]&&this['voiceQueues'][_0x3e6684[_0x45b9('0x49')]][_0x45b9('0x4f')]?this[_0x45b9('0x10')][_0x3e6684[_0x45b9('0x49')]][_0x45b9('0x4f')]||'inbound':_0x45b9('0x50');_0x3e6684[_0x45b9('0x66')]=_0x5e7309[_0x45b9('0x66')];_0x3e6684[_0x45b9('0x73')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));_0x3e6684[_0x45b9('0x75')]=_0x5e7309[_0x45b9('0x75')];_0x3e6684[_0x45b9('0x76')]=_0x5e7309[_0x45b9('0x76')];_0x3e6684['uniqueid']=_0x5e7309[_0x45b9('0x72')];_0x3e6684['routealias']=this['channels'][_0x5e7309[_0x45b9('0x72')]][_0x45b9('0x77')];logger[_0x45b9('0x68')](_0x45b9('0x78'),_0x3e6684[_0x45b9('0x49')],_0x3e6684[_0x45b9('0x4f')]);_['merge'](_0x3e6684,_[_0x45b9('0x79')](_0x5e7309,_['keys'](_0x3e6684)));this[_0x45b9('0xd')][_0x5e7309[_0x45b9('0x72')]][_0x45b9('0x7a')](_0x3e6684);this[_0x45b9('0x34')][_0x5e7309[_0x45b9('0x72')]]=_0x3e6684;this[_0x45b9('0x44')](_0x3e6684,_0x45b9('0x7b'));}}catch(_0x191f4f){logger[_0x45b9('0x3b')](_0x45b9('0x71'),_0x5e7309[_0x45b9('0x72')],util['inspect'](_0x191f4f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')]['syncQueueCallerAbandon']=function(_0x2c6c64){try{if(this['isNotNull'](_0x2c6c64)){logger[_0x45b9('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2c6c64['uniqueid'],util[_0x45b9('0x3d')](_0x2c6c64,{'showHidden':![],'depth':null}));if(this[_0x45b9('0xd')][_0x2c6c64['uniqueid']]){var _0x4d8326=_[_0x45b9('0x7c')](this[_0x45b9('0xd')][_0x2c6c64[_0x45b9('0x72')]]);_0x4d8326[_0x45b9('0x7d')]=![];_0x4d8326[_0x45b9('0x7e')]=null;_0x4d8326[_0x45b9('0x7f')]=_0x2c6c64['holdtime'];_0x4d8326[_0x45b9('0x80')]=_0x2c6c64[_0x45b9('0x80')];_0x4d8326['queuecallerabandon']=!![];_0x4d8326[_0x45b9('0x81')]=moment()['format'](_0x45b9('0x74'));_0x4d8326[_0x45b9('0x82')]=_0x45b9('0x83');_0x4d8326[_0x45b9('0x84')]=null;logger[_0x45b9('0x68')](_0x45b9('0x85'),_0x4d8326[_0x45b9('0x49')],_0x4d8326['type']);this[_0x45b9('0x34')][_0x2c6c64[_0x45b9('0x72')]]=_0x4d8326;this[_0x45b9('0x41')](_0x4d8326,_0x45b9('0x17'));}}}catch(_0x5ef018){logger['error'](_0x45b9('0x86'),_0x2c6c64[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x5ef018,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x19')]=function(_0x448592){try{if(this[_0x45b9('0x60')](_0x448592)){logger[_0x45b9('0x4b')]('[%s][voiceQueueReport][queuecallerleave]',_0x448592[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x448592,{'showHidden':![],'depth':null}));if(this[_0x45b9('0xd')][_0x448592[_0x45b9('0x72')]]){var _0x19cbdc=_[_0x45b9('0x7c')](this[_0x45b9('0xd')][_0x448592[_0x45b9('0x72')]]);_0x19cbdc['queuecallerleaveAt']=moment()[_0x45b9('0x47')](_0x45b9('0x74'));_0x19cbdc[_0x45b9('0x87')]=_0x448592[_0x45b9('0x87')];_0x19cbdc[_0x45b9('0x88')]=_0x448592[_0x45b9('0x88')];logger[_0x45b9('0x68')](_0x45b9('0x89'),_0x19cbdc[_0x45b9('0x49')],_0x19cbdc['type'],_0x448592['connectedlinenum'],_0x448592[_0x45b9('0x88')]);this[_0x45b9('0x34')][_0x448592[_0x45b9('0x72')]]=_0x19cbdc;this['emitVoiceQueueChannelSave'](_0x19cbdc,_0x45b9('0x18'));}}}catch(_0x477407){logger[_0x45b9('0x3b')](_0x45b9('0x8a'),_0x448592[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x477407,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x1d')]=function(_0x694406){try{if(this[_0x45b9('0x60')](_0x694406)){logger[_0x45b9('0x4b')](_0x45b9('0x8b'),_0x694406[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x694406,{'showHidden':![],'depth':null}));if(this[_0x45b9('0xd')][_0x694406[_0x45b9('0x72')]]){var _0x3d5fb1=_['last'](this[_0x45b9('0xd')][_0x694406[_0x45b9('0x72')]]);_0x3d5fb1[_0x45b9('0x7d')]=!![];_0x3d5fb1[_0x45b9('0x82')]=_0x45b9('0x8c');logger['info'](_0x45b9('0x8d'),_0x3d5fb1[_0x45b9('0x49')],_0x3d5fb1[_0x45b9('0x4f')]);}}}catch(_0x180ee1){logger['error'](_0x45b9('0x8b'),_0x694406[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x180ee1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x1b')]=function(_0x1ad6e6){try{if(this[_0x45b9('0x60')](_0x1ad6e6)){logger[_0x45b9('0x4b')](_0x45b9('0x8e'),_0x1ad6e6[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x1ad6e6,{'showHidden':![],'depth':null}));if(this[_0x45b9('0xd')][_0x1ad6e6[_0x45b9('0x72')]]){var _0x11f7da=_[_0x45b9('0x7c')](this[_0x45b9('0xd')][_0x1ad6e6[_0x45b9('0x72')]]);_0x11f7da[_0x45b9('0x17')]=![];_0x11f7da['queuecallerabandonAt']=null;_0x11f7da[_0x45b9('0x8f')]=!![];_0x11f7da[_0x45b9('0x84')]=_0x1ad6e6['membername'];_0x11f7da[_0x45b9('0x7f')]=_0x1ad6e6[_0x45b9('0x7f')];_0x11f7da[_0x45b9('0x7d')]=!![];_0x11f7da[_0x45b9('0x90')]=![];_0x11f7da[_0x45b9('0x91')]=null;if(!_0x11f7da[_0x45b9('0x92')]){if(_0x1ad6e6[_0x45b9('0x93')]==_0x45b9('0x92')){_0x11f7da[_0x45b9('0x82')]=_0x45b9('0x94');logger[_0x45b9('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x11f7da[_0x45b9('0x49')],_0x11f7da[_0x45b9('0x4f')]);}else{if(_[_0x45b9('0x95')](_0x1ad6e6[_0x45b9('0x37')][_0x45b9('0x96')](),_0x45b9('0x97'))){if(this['queueReports'][_0x1ad6e6[_0x45b9('0x98')]]){var _0x4754b8=_[_0x45b9('0x7c')](this[_0x45b9('0xd')][_0x1ad6e6[_0x45b9('0x98')]]);_0x4754b8[_0x45b9('0x7d')]=![];_0x4754b8['queuecallerexit']=!![];_0x4754b8[_0x45b9('0x91')]=moment(_0x11f7da[_0x45b9('0x73')])[_0x45b9('0x99')](_0x1ad6e6['holdtime'],_0x45b9('0x9a'))[_0x45b9('0x47')](_0x45b9('0x74'));_0x4754b8[_0x45b9('0x82')]=_0x45b9('0x9b');_0x4754b8['transfer']=!![];_0x4754b8[_0x45b9('0x9c')]=_0x45b9('0x9d');_0x4754b8['transferexten']=_0x1ad6e6[_0x45b9('0x9e')];_0x4754b8['transferuniqueid']=_0x1ad6e6['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4754b8[_0x45b9('0x49')],_0x4754b8[_0x45b9('0x4f')]);var _0x20118c=this[_0x45b9('0xd')][_0x1ad6e6['linkedid']];this['queueReports'][_0x1ad6e6[_0x45b9('0x98')]]=this['queueReports'][_0x1ad6e6[_0x45b9('0x72')]];this[_0x45b9('0xd')][_0x1ad6e6[_0x45b9('0x72')]]=_0x20118c;}}else{_0x11f7da[_0x45b9('0x82')]=_0x45b9('0x9f')+_0x1ad6e6[_0x45b9('0x93')][_0x45b9('0xa0')]();logger[_0x45b9('0x68')](_0x45b9('0xa1'),_0x11f7da[_0x45b9('0x49')],_0x11f7da[_0x45b9('0x4f')],_0x11f7da[_0x45b9('0x82')]);}}}this[_0x45b9('0x34')][_0x1ad6e6[_0x45b9('0x72')]]=_0x11f7da;this[_0x45b9('0x41')](_0x11f7da,_0x45b9('0x1a'));}}}catch(_0x40d861){logger[_0x45b9('0x3b')](_0x45b9('0x8e'),_0x1ad6e6[_0x45b9('0x72')],util['inspect'](_0x40d861,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x1f')]=function(_0x21305d){try{if(this[_0x45b9('0x60')](_0x21305d)){logger['debug'](_0x45b9('0xa2'),_0x21305d[_0x45b9('0x72')],util['inspect'](_0x21305d,{'showHidden':![],'depth':null}));this[_0x45b9('0xa3')](_0x21305d[_0x45b9('0x72')],_[_0x45b9('0xa4')](_0x21305d[_0x45b9('0xa5')])[0x0],_0x21305d[_0x45b9('0xa6')]);if(this[_0x45b9('0xd')][_0x21305d['uniqueid']]){var _0x579a46=_[_0x45b9('0x7c')](this[_0x45b9('0xd')][_0x21305d[_0x45b9('0x72')]]);if(_0x579a46){if(this[_0x45b9('0x60')](_0x21305d[_0x45b9('0xa5')])&&this['isNotNull'](_0x21305d[_0x45b9('0xa5')][_0x45b9('0xa7')])){switch(_0x21305d[_0x45b9('0xa6')]){case _0x45b9('0xa8'):_0x579a46['queuecallerexit']=![];_0x579a46[_0x45b9('0x91')]=null;break;case _0x45b9('0xa9'):_0x579a46['lastevent']='timeout';_0x579a46['queuecallerexit']=!![];_0x579a46[_0x45b9('0x91')]=moment()[_0x45b9('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x579a46[_0x45b9('0xaa')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));logger[_0x45b9('0x4b')](_0x45b9('0xab'),_0x21305d[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x579a46,{'showHidden':![],'depth':null}));ami[_0x45b9('0x43')](_0x45b9('0xac'),_0x579a46);break;default:_0x579a46[_0x45b9('0x90')]=!![];_0x579a46[_0x45b9('0x91')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));_0x579a46[_0x45b9('0xaa')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));}_0x579a46['queuecallerabandon']=![];_0x579a46[_0x45b9('0x81')]=null;_0x579a46[_0x45b9('0x82')]=_0x21305d[_0x45b9('0xa6')];this[_0x45b9('0x34')][_0x21305d[_0x45b9('0x72')]]=_0x579a46;this[_0x45b9('0x41')](_0x579a46,_0x45b9('0x1e'));}else if(this[_0x45b9('0x60')](_0x21305d['variable'])&&this[_0x45b9('0x60')](_0x21305d[_0x45b9('0xa5')][_0x45b9('0xad')])){if(!_0x579a46[_0x45b9('0x17')]){_0x579a46['queuecallerexit']=!![];_0x579a46[_0x45b9('0x91')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));_0x579a46['queuecallerexitreason']=_0x45b9('0xae');_0x579a46[_0x45b9('0xaa')]=moment()[_0x45b9('0x47')](_0x45b9('0x74'));this[_0x45b9('0x34')][_0x21305d[_0x45b9('0x72')]]=_0x579a46;}}logger[_0x45b9('0x68')](_0x45b9('0xaf'),_0x21305d[_0x45b9('0x72')],_0x579a46[_0x45b9('0x49')],_0x579a46[_0x45b9('0x4f')],_[_0x45b9('0xa4')](_0x21305d[_0x45b9('0xa5')])[0x0],_0x21305d['value']);_0x579a46[_0x45b9('0x13')]=this[_0x45b9('0x13')][_0x21305d[_0x45b9('0x72')]];}}}}catch(_0x2384ed){logger[_0x45b9('0x3b')](_0x45b9('0xa2'),_0x21305d[_0x45b9('0x72')],util[_0x45b9('0x3d')](_0x2384ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x464438,_0x3aba9e,_0x547403){var _0x16221b=[_0x45b9('0xb0'),_0x45b9('0xb1'),_0x45b9('0xb2'),'rtpaudioqosjitterbridged',_0x45b9('0xb3'),_0x45b9('0xb4'),_0x45b9('0xb5'),_0x45b9('0xb6'),_0x45b9('0xb7'),_0x45b9('0xb8'),_0x45b9('0xb9'),_0x45b9('0xba'),'membercalls',_0x45b9('0xbb'),_0x45b9('0xbc'),'memberlastcall','membername',_0x45b9('0xbd'),_0x45b9('0xbe')];if(!_['isNil'](_0x3aba9e)&&!_[_0x45b9('0xbf')](_0x16221b,_0x3aba9e)){if(_['isUndefined'](this[_0x45b9('0x13')][_0x464438])){this[_0x45b9('0x13')][_0x464438]={};}this[_0x45b9('0x13')][_0x464438][_0x3aba9e]=_0x547403;}};VoiceQueueReport[_0x45b9('0xa')][_0x45b9('0x20')]=function(_0x471e65){try{if(this['isNotNull'](_0x471e65)){logger[_0x45b9('0x4b')](_0x45b9('0xc0'),_0x471e65[_0x45b9('0x72')],util['inspect'](_0x471e65,{'showHidden':![],'depth':null}));if(this[_0x45b9('0xd')][_0x471e65[_0x45b9('0x72')]]){for(var _0x3db72a=0x0,_0x4cdbba={};_0x3db72a=0x0?moment(_0x3ea8b6[_0xc13b('0x19')])['diff'](_0x3ea8b6[_0xc13b('0x18')],_0xc13b('0xe')):null,'data1':_0xc13b('0x1a'),'data2':_0x3ea8b6[_0xc13b('0x14')],'data3':_0x3ea8b6[_0xc13b('0x11')],'data4':_0x3ea8b6[_0xc13b('0x1b')]||null,'role':_0xc13b('0x13'),'internal':_0x3ea8b6[_0xc13b('0x14')]?_['toNumber'](_0x3ea8b6['accountcode']):undefined,'uniqueid':_0x3ea8b6[_0xc13b('0x16')]},'log':_0xc13b('0x6')});}; \ No newline at end of file +var _0x6acd=['moment','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','format','SIP/%s','interface','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voice','endtime','starttime','outbound','toNumber'];(function(_0x59a4ee,_0x543744){var _0x192306=function(_0x45f6d5){while(--_0x45f6d5){_0x59a4ee['push'](_0x59a4ee['shift']());}};_0x192306(++_0x543744);}(_0x6acd,0x152));var _0xd6ac=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6acd[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0xd6ac('0x0'));var _=require('lodash');var util=require(_0xd6ac('0x1'));var client=require('../client');exports[_0xd6ac('0x2')]=function(_0x53e43f){var _0x311fc3=_0x53e43f[_0xd6ac('0x3')]||_0x53e43f[_0xd6ac('0x4')];return client['Request'](_0xd6ac('0x5'),{'body':{'channel':'voice','membername':_0x53e43f[_0xd6ac('0x6')],'interface':_[_0xd6ac('0x7')](_0x53e43f['interface'])?util[_0xd6ac('0x8')](_0xd6ac('0x9'),_0x53e43f['lastAssignedTo']):_0x53e43f[_0xd6ac('0xa')],'type':'TALKING','enterAt':_0x53e43f[_0xd6ac('0xb')],'exitAt':_0x311fc3,'duration':moment(_0x311fc3)[_0xd6ac('0xc')](_0x53e43f[_0xd6ac('0xb')],_0xd6ac('0xd')),'data1':_0xd6ac('0xe'),'data2':_0x53e43f[_0xd6ac('0xf')],'data3':_0x53e43f[_0xd6ac('0x10')],'data4':null,'data5':_0x53e43f[_0xd6ac('0x11')],'role':_0xd6ac('0x12'),'internal':_0x53e43f[_0xd6ac('0x13')]?_['toNumber'](_0x53e43f['accountcode']):undefined,'uniqueid':_0x53e43f[_0xd6ac('0x14')]},'log':_0xd6ac('0x5')});};exports['voiceDialReport']=function(_0xeee9eb){return client['Request']('CreateMemberReport',{'body':{'channel':_0xd6ac('0x15'),'membername':_0xeee9eb['membername'],'interface':_0xeee9eb['interface'],'type':'TALKING','enterAt':_0xeee9eb['starttime'],'exitAt':_0xeee9eb[_0xd6ac('0x16')],'duration':moment(_0xeee9eb['endtime'])[_0xd6ac('0xc')](_0xeee9eb['starttime'],'seconds')>=0x0?moment(_0xeee9eb[_0xd6ac('0x16')])[_0xd6ac('0xc')](_0xeee9eb[_0xd6ac('0x17')],_0xd6ac('0xd')):null,'data1':_0xd6ac('0x18'),'data2':_0xeee9eb[_0xd6ac('0x13')],'data3':_0xeee9eb[_0xd6ac('0x10')],'data4':_0xeee9eb['dialstring']||null,'role':_0xd6ac('0x12'),'internal':_0xeee9eb[_0xd6ac('0x13')]?_[_0xd6ac('0x19')](_0xeee9eb[_0xd6ac('0x13')]):undefined,'uniqueid':_0xeee9eb['uniqueid']},'log':_0xd6ac('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 8a45eb1..dbc3312 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 _0xbde2=['ShowSetting','GetSettings','getSettings','Request'];(function(_0xd27967,_0x2b4782){var _0x4910b6=function(_0x4da7d6){while(--_0x4da7d6){_0xd27967['push'](_0xd27967['shift']());}};_0x4910b6(++_0x2b4782);}(_0xbde2,0x7a));var _0x2bde=function(_0x4d75b3,_0xae124d){_0x4d75b3=_0x4d75b3-0x0;var _0x18928f=_0xbde2[_0x4d75b3];return _0x18928f;};'use strict';var client=require('../client');exports[_0x2bde('0x0')]=function(){return client[_0x2bde('0x1')](_0x2bde('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x2bde('0x3')});}; \ No newline at end of file +var _0x7d89=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0x7d89,0x158));var _0x97d8=function(_0x2a4bc3,_0x40b9a6){_0x2a4bc3=_0x2a4bc3-0x0;var _0x3fd424=_0x7d89[_0x2a4bc3];return _0x3fd424;};'use strict';var client=require(_0x97d8('0x0'));exports[_0x97d8('0x1')]=function(){return client[_0x97d8('0x2')](_0x97d8('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x97d8('0x4')]},'log':_0x97d8('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index e92bce2..2c477d6 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 _0xa772=['Request','GetTemplate','name','html','getTemplates'];(function(_0x4f373b,_0x536714){var _0x3c766e=function(_0x523032){while(--_0x523032){_0x4f373b['push'](_0x4f373b['shift']());}};_0x3c766e(++_0x536714);}(_0xa772,0x1b2));var _0x2a77=function(_0xc9396b,_0x734ceb){_0xc9396b=_0xc9396b-0x0;var _0x56d6ee=_0xa772[_0xc9396b];return _0x56d6ee;};'use strict';var client=require('../client');exports[_0x2a77('0x0')]=function(_0x5b8318){return function(_0x6b733a){return client[_0x2a77('0x1')](_0x2a77('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2a77('0x3'),_0x2a77('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x6156=['html','../client','getTemplates','name'];(function(_0x5c71ca,_0x2dc7db){var _0x4ef463=function(_0x3d4144){while(--_0x3d4144){_0x5c71ca['push'](_0x5c71ca['shift']());}};_0x4ef463(++_0x2dc7db);}(_0x6156,0x1dd));var _0x6615=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6156[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x6615('0x0'));exports[_0x6615('0x1')]=function(_0x28a0aa){return function(_0x38a68c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x6615('0x2'),_0x6615('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4b12658..02b5cf6 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 _0x7f74=['channel','Condition','AllConditions','value','field','operator','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name'];(function(_0x1c67ce,_0x5e9c96){var _0x378d1f=function(_0x3fa875){while(--_0x3fa875){_0x1c67ce['push'](_0x1c67ce['shift']());}};_0x378d1f(++_0x5e9c96);}(_0x7f74,0xb0));var _0x47f7=function(_0x3c04ef,_0x594793){_0x3c04ef=_0x3c04ef-0x0;var _0x2e9626=_0x7f74[_0x3c04ef];return _0x2e9626;};'use strict';var client=require(_0x47f7('0x0'));exports[_0x47f7('0x1')]=function(_0x22935f){return function(_0x2dce08){return client['Request'](_0x47f7('0x2'),{'options':{'raw':![],'attributes':['id',_0x47f7('0x3'),_0x47f7('0x4'),'status'],'include':[{'model':_0x47f7('0x5'),'as':_0x47f7('0x6'),'attributes':['id','field','operator',_0x47f7('0x7')]},{'model':_0x47f7('0x5'),'as':'AnyConditions','attributes':['id',_0x47f7('0x8'),_0x47f7('0x9'),'value']},{'model':_0x47f7('0xa'),'as':_0x47f7('0xb'),'attributes':['id',_0x47f7('0xc'),_0x47f7('0xd'),_0x47f7('0xe'),_0x47f7('0xf'),_0x47f7('0x10'),_0x47f7('0x11'),_0x47f7('0x12'),_0x47f7('0x13')]}]},'log':_0x47f7('0x2')});};}; \ No newline at end of file +var _0x86f1=['data2','data3','data4','data5','data6','data7','../client','Request','GetTrigger','name','channel','Condition','AllConditions','field','operator','value','AnyConditions','Action'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x86f1,0xa8));var _0x186f=function(_0x52e3ac,_0x569b26){_0x52e3ac=_0x52e3ac-0x0;var _0x4c7faf=_0x86f1[_0x52e3ac];return _0x4c7faf;};'use strict';var client=require(_0x186f('0x0'));exports['getTriggers']=function(_0x4fd005){return function(_0x1197e7){return client[_0x186f('0x1')](_0x186f('0x2'),{'options':{'raw':![],'attributes':['id',_0x186f('0x3'),_0x186f('0x4'),'status'],'include':[{'model':_0x186f('0x5'),'as':_0x186f('0x6'),'attributes':['id',_0x186f('0x7'),_0x186f('0x8'),_0x186f('0x9')]},{'model':_0x186f('0x5'),'as':_0x186f('0xa'),'attributes':['id',_0x186f('0x7'),'operator',_0x186f('0x9')]},{'model':_0x186f('0xb'),'as':'Actions','attributes':['id','action','data1',_0x186f('0xc'),_0x186f('0xd'),_0x186f('0xe'),_0x186f('0xf'),_0x186f('0x10'),_0x186f('0x11')]}]},'log':_0x186f('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d5d5d6b..14943bf 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 _0xda49=['name','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0xf8ba2e,_0x2c2d49){var _0x4e0799=function(_0x3a7861){while(--_0x3a7861){_0xf8ba2e['push'](_0xf8ba2e['shift']());}};_0x4e0799(++_0x2c2d49);}(_0xda49,0x1b3));var _0x9da4=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xda49[_0x2283dc];return _0x16db90;};'use strict';var client=require(_0x9da4('0x0'));exports[_0x9da4('0x1')]=function(_0x3f11e0){return function(_0x3acfbc){return client[_0x9da4('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9da4('0x3'),'registry',_0x9da4('0x4')]},'log':_0x9da4('0x5')});};}; \ No newline at end of file +var _0x17ba=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x17ba,0xab));var _0xa17b=function(_0x13db5a,_0x330fa4){_0x13db5a=_0x13db5a-0x0;var _0x44528d=_0x17ba[_0x13db5a];return _0x44528d;};'use strict';var client=require(_0xa17b('0x0'));exports[_0xa17b('0x1')]=function(_0x4a2032){return function(_0x2ce1c0){return client[_0xa17b('0x2')](_0xa17b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa17b('0x4'),_0xa17b('0x5'),_0xa17b('0x6')]},'log':_0xa17b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 0b49f34..ed670ab 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x180cf,_0x456008){var _0x557ff5=function(_0xc94e40){while(--_0xc94e40){_0x180cf['push'](_0x180cf['shift']());}};_0x557ff5(++_0x456008);}(_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 088deee..8572c54 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 _0xc4d0=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xc4d0,0x17c));var _0x0c4d=function(_0x58c86a,_0x602654){_0x58c86a=_0x58c86a-0x0;var _0x2bb374=_0xc4d0[_0x58c86a];return _0x2bb374;};'use strict';var client=require(_0x0c4d('0x0'));exports['create']=function(_0x425a92){return client[_0x0c4d('0x1')](_0x0c4d('0x2'),{'body':_0x425a92,'log':'CreateVoiceAgentReport'});};exports[_0x0c4d('0x3')]=function(_0x46babc,_0x2edd3b,_0x6a98e7){return client['Request'](_0x0c4d('0x4'),{'body':_0x46babc,'options':{'where':{'uniqueid':_0x2edd3b,'interface':_0x6a98e7,'agentcomplete':!![]}},'log':_0x0c4d('0x4')});}; \ No newline at end of file +var _0x2de8=['Request','update','UpdateVoiceAgentReport','../client'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0x2de8,0x147));var _0x82de=function(_0x307777,_0x131c2e){_0x307777=_0x307777-0x0;var _0x3c13c6=_0x2de8[_0x307777];return _0x3c13c6;};'use strict';var client=require(_0x82de('0x0'));exports['create']=function(_0x5a278a){return client[_0x82de('0x1')]('CreateVoiceAgentReport',{'body':_0x5a278a,'log':'CreateVoiceAgentReport'});};exports[_0x82de('0x2')]=function(_0x277e80,_0x303657,_0x3e3de3){return client[_0x82de('0x1')](_0x82de('0x3'),{'body':_0x277e80,'options':{'where':{'uniqueid':_0x303657,'interface':_0x3e3de3,'agentcomplete':!![]}},'log':_0x82de('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8e4526b..92b1785 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 _0x555b=['context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','create','merge','calleridnum'];(function(_0x457e61,_0x14a306){var _0x1b0b2f=function(_0x1ee7de){while(--_0x1ee7de){_0x457e61['push'](_0x457e61['shift']());}};_0x1b0b2f(++_0x14a306);}(_0x555b,0x10d));var _0xb555=function(_0x536409,_0xcb7795){_0x536409=_0x536409-0x0;var _0x331474=_0x555b[_0x536409];return _0x331474;};'use strict';var moment=require(_0xb555('0x0'));var util=require('util');var _=require('lodash');var client=require('../client');exports[_0xb555('0x1')]=function(_0x4bee3e){return client['Request']('CreateVoiceCallReport',{'body':_[_0xb555('0x2')](_0x4bee3e,{'source':_0x4bee3e[_0xb555('0x3')],'destinationcontext':_0x4bee3e[_0xb555('0x4')],'callerid':_0x4bee3e['callerid'],'amaflags':_0xb555('0x5')}),'log':_0xb555('0x6')});};exports[_0xb555('0x7')]=function(){return function(){return client[_0xb555('0x8')](_0xb555('0x9'),{'options':{'where':{'type':[_0xb555('0xa')],'createdAt':{'$between':[moment()[_0xb555('0xb')](_0xb555('0xc'))[_0xb555('0xd')](_0xb555('0xe')),moment()[_0xb555('0xf')]('day')['format'](_0xb555('0xe'))]}},'attributes':[_0xb555('0x10'),_0xb555('0x11'),_0xb555('0x12'),_0xb555('0x13')]},'log':_0xb555('0x14')});};}; \ No newline at end of file +var _0x5db0=['lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util'];(function(_0x28d6b9,_0xbe9964){var _0x1e2bee=function(_0xc75f76){while(--_0xc75f76){_0x28d6b9['push'](_0x28d6b9['shift']());}};_0x1e2bee(++_0xbe9964);}(_0x5db0,0x7c));var _0x05db=function(_0x22588b,_0x5b1c6d){_0x22588b=_0x22588b-0x0;var _0x4e225b=_0x5db0[_0x22588b];return _0x4e225b;};'use strict';var moment=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var _=require(_0x05db('0x2'));var client=require('../client');exports[_0x05db('0x3')]=function(_0x5939a7){return client[_0x05db('0x4')](_0x05db('0x5'),{'body':_[_0x05db('0x6')](_0x5939a7,{'source':_0x5939a7[_0x05db('0x7')],'destinationcontext':_0x5939a7[_0x05db('0x8')],'callerid':_0x5939a7['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x05db('0x5')});};exports[_0x05db('0x9')]=function(){return function(){return client[_0x05db('0x4')](_0x05db('0xa'),{'options':{'where':{'type':[_0x05db('0xb')],'createdAt':{'$between':[moment()[_0x05db('0xc')](_0x05db('0xd'))[_0x05db('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x05db('0xf')](_0x05db('0xd'))[_0x05db('0xe')](_0x05db('0x10'))]}},'attributes':[_0x05db('0x11'),_0x05db('0x12'),_0x05db('0x13'),'billableseconds']},'log':_0x05db('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e76907c..14fe58b 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 _0x8925=['Request','CreateVoiceDialReport','create'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x8925,0x1a3));var _0x5892=function(_0x58422c,_0x55903e){_0x58422c=_0x58422c-0x0;var _0x4f4554=_0x8925[_0x58422c];return _0x4f4554;};'use strict';var client=require('../client');exports[_0x5892('0x0')]=function(_0x4d2f89){return client[_0x5892('0x1')](_0x5892('0x2'),{'body':_0x4d2f89,'log':_0x5892('0x2')});}; \ No newline at end of file +var _0x4d97=['CreateVoiceDialReport','../client','create','Request'];(function(_0x2ed502,_0x3b7fab){var _0x191886=function(_0x446add){while(--_0x446add){_0x2ed502['push'](_0x2ed502['shift']());}};_0x191886(++_0x3b7fab);}(_0x4d97,0x6d));var _0x74d9=function(_0x594f01,_0xf96389){_0x594f01=_0x594f01-0x0;var _0x530761=_0x4d97[_0x594f01];return _0x530761;};'use strict';var client=require(_0x74d9('0x0'));exports[_0x74d9('0x1')]=function(_0x5bc6b9){return client[_0x74d9('0x2')](_0x74d9('0x3'),{'body':_0x5bc6b9,'log':_0x74d9('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2b5603c..8fbbc24 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 _0x657b=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x657b,0x131));var _0xb657=function(_0x1c6447,_0x4a35f9){_0x1c6447=_0x1c6447-0x0;var _0x4587e0=_0x657b[_0x1c6447];return _0x4587e0;};'use strict';var client=require(_0xb657('0x0'));exports[_0xb657('0x1')]=function(){return function(){return client[_0xb657('0x2')](_0xb657('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb657('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb657('0x1')});};}; \ No newline at end of file +var _0xb6b1=['Request','exten','recordingFormat','../client'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xb6b1[_0x443494];return _0x4a6794;};'use strict';var client=require(_0x1b6b('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x1b6b('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x1b6b('0x2'),_0x1b6b('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 2038e7b..f442276 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 _0x87d8=['dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0x87d8,0x1a9));var _0x887d=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x87d8[_0x18b344];return _0x5ef6bb;};'use strict';var client=require('../client');exports[_0x887d('0x0')]=function(){return function(){return client[_0x887d('0x1')](_0x887d('0x2'),{'options':{'raw':![],'attributes':['id',_0x887d('0x3'),_0x887d('0x4'),_0x887d('0x5'),_0x887d('0x6'),_0x887d('0x7'),_0x887d('0x8'),_0x887d('0x9'),_0x887d('0xa'),_0x887d('0xb'),_0x887d('0xc'),_0x887d('0xd'),_0x887d('0xe'),'dialPredictiveOptimizationPercentage',_0x887d('0xf'),_0x887d('0x10'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0x887d('0x11'),_0x887d('0x12'),_0x887d('0x13'),_0x887d('0x14'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x887d('0x15'),_0x887d('0x16'),_0x887d('0x17'),_0x887d('0x18'),_0x887d('0x19'),_0x887d('0x1a'),_0x887d('0x1b'),_0x887d('0x1c'),'dialAMDGreeting',_0x887d('0x1d'),_0x887d('0x1e'),_0x887d('0x1f'),'dialAMDBetweenWordsSilence',_0x887d('0x20'),_0x887d('0x21'),'dialAMDMaximumWordLength','timeout','dialRecallMeTimeout',_0x887d('0x22'),_0x887d('0x23'),'dialAgiAfterHangupAgent',_0x887d('0x24'),_0x887d('0x25'),_0x887d('0x7'),'strategy',_0x887d('0x26'),_0x887d('0x27'),'dialNoSuchNumberMaxRetry',_0x887d('0x28'),'dialDropMaxRetry',_0x887d('0x29'),_0x887d('0x2a'),_0x887d('0x2b'),_0x887d('0x2c'),_0x887d('0x2d'),_0x887d('0x2e'),_0x887d('0x2f'),_0x887d('0x30'),_0x887d('0x31'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe'],'include':[{'model':_0x887d('0x32'),'as':'Trunk','attributes':['id',_0x887d('0x3'),_0x887d('0x33'),_0x887d('0x34')]},{'model':_0x887d('0x35'),'as':_0x887d('0x36'),'attributes':['id',_0x887d('0x3')]},{'model':'Trunk','as':_0x887d('0x37'),'attributes':['id',_0x887d('0x3'),'callerid','active']},{'model':_0x887d('0x38'),'as':_0x887d('0x38'),'attributes':['id',_0x887d('0x3')],'include':[{'model':_0x887d('0x38'),'as':'Intervals','attributes':['id',_0x887d('0x3'),_0x887d('0x39')]}]}]},'log':_0x887d('0x0')});};}; \ No newline at end of file +var _0xbd51=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry'];(function(_0x2e69eb,_0x3e5931){var _0x438789=function(_0x5443a7){while(--_0x5443a7){_0x2e69eb['push'](_0x2e69eb['shift']());}};_0x438789(++_0x3e5931);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x288877,_0x2e8b91){_0x288877=_0x288877-0x0;var _0x5a8ced=_0xbd51[_0x288877];return _0x5a8ced;};'use strict';var client=require(_0x1bd5('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x1bd5('0x1')](_0x1bd5('0x2'),{'options':{'raw':![],'attributes':['id',_0x1bd5('0x3'),_0x1bd5('0x4'),'acwTimeout','autopause','monitor_format','type',_0x1bd5('0x5'),_0x1bd5('0x6'),_0x1bd5('0x7'),'dialLimitQueue',_0x1bd5('0x8'),_0x1bd5('0x9'),_0x1bd5('0xa'),_0x1bd5('0xb'),_0x1bd5('0xc'),'dialOriginateCallerIdNumber',_0x1bd5('0xd'),'dialQueueOptions',_0x1bd5('0xe'),_0x1bd5('0xf'),_0x1bd5('0x10'),_0x1bd5('0x11'),_0x1bd5('0x12'),_0x1bd5('0x13'),'dialNoAnswerMaxRetry',_0x1bd5('0x14'),'dialGlobalMaxRetry',_0x1bd5('0x15'),_0x1bd5('0x16'),_0x1bd5('0x17'),_0x1bd5('0x18'),_0x1bd5('0x19'),_0x1bd5('0x1a'),_0x1bd5('0x1b'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x1bd5('0x1c'),_0x1bd5('0x1d'),_0x1bd5('0x1e'),_0x1bd5('0x1f'),'dialAMDMaximumWordLength','timeout',_0x1bd5('0x20'),_0x1bd5('0x21'),_0x1bd5('0x22'),_0x1bd5('0x23'),_0x1bd5('0x24'),_0x1bd5('0x25'),_0x1bd5('0x26'),_0x1bd5('0x27'),_0x1bd5('0x28'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x1bd5('0x29'),_0x1bd5('0x2a'),_0x1bd5('0x2b'),_0x1bd5('0x2c'),_0x1bd5('0x2d'),_0x1bd5('0x2e'),_0x1bd5('0x2f'),_0x1bd5('0x30'),_0x1bd5('0x31'),_0x1bd5('0x32'),_0x1bd5('0x33'),_0x1bd5('0x34'),_0x1bd5('0x35')],'include':[{'model':_0x1bd5('0x36'),'as':_0x1bd5('0x36'),'attributes':['id',_0x1bd5('0x3'),_0x1bd5('0x37'),_0x1bd5('0x38')]},{'model':'Pause','as':_0x1bd5('0x39'),'attributes':['id','name']},{'model':_0x1bd5('0x36'),'as':_0x1bd5('0x3a'),'attributes':['id',_0x1bd5('0x3'),'callerid',_0x1bd5('0x38')]},{'model':'Interval','as':_0x1bd5('0x3b'),'attributes':['id',_0x1bd5('0x3')],'include':[{'model':_0x1bd5('0x3b'),'as':_0x1bd5('0x3c'),'attributes':['id','name',_0x1bd5('0x3d')]}]}]},'log':_0x1bd5('0x3e')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 14c18f0..44ca03c 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(_0x45cfa8,_0x245be9){var _0x58bad5=function(_0x11cf62){while(--_0x11cf62){_0x45cfa8['push'](_0x45cfa8['shift']());}};_0x58bad5(++_0x245be9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x42a68f,_0x19b0be){var _0x54ffff=function(_0x4d5f2b){while(--_0x4d5f2b){_0x42a68f['push'](_0x42a68f['shift']());}};_0x54ffff(++_0x19b0be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index c45251e..e261ab8 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 _0xf72b=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf72b,0x9e));var _0xbf72=function(_0x51ecd1,_0x48c66c){_0x51ecd1=_0x51ecd1-0x0;var _0x3f791c=_0xf72b[_0x51ecd1];return _0x3f791c;};'use strict';var client=require(_0xbf72('0x0'));exports[_0xbf72('0x1')]=function(_0x15512f){return function(){return client[_0xbf72('0x2')](_0xbf72('0x3'),{'options':{'where':{'VoiceQueueId':_0x15512f,'paused':!![]},'raw':!![]},'log':_0xbf72('0x1')});};}; \ No newline at end of file +var _0x73f1=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x73f1,0x1cb));var _0x173f=function(_0x40f6c9,_0x2bdbf9){_0x40f6c9=_0x40f6c9-0x0;var _0x2985d1=_0x73f1[_0x40f6c9];return _0x2985d1;};'use strict';var client=require(_0x173f('0x0'));exports[_0x173f('0x1')]=function(_0x185396){return function(){return client['Request'](_0x173f('0x2'),{'options':{'where':{'VoiceQueueId':_0x185396,'paused':!![]},'raw':!![]},'log':_0x173f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e3e599b..aee6d10 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x37aa55,_0x3755ad){var _0x108da6=function(_0x14ad54){while(--_0x14ad54){_0x37aa55['push'](_0x37aa55['shift']());}};_0x108da6(++_0x3755ad);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x577920,_0x50564f){var _0x563667=function(_0x8ba93e){while(--_0x8ba93e){_0x577920['push'](_0x577920['shift']());}};_0x563667(++_0x50564f);}(_0x7a54,0x106));var _0x47a5=function(_0x5c56b2,_0x11ccae){_0x5c56b2=_0x5c56b2-0x0;var _0x3bc795=_0x7a54[_0x5c56b2];return _0x3bc795;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index ed65671..989ac18 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 _0x7732=['blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','attendedTransfer','result','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers'];(function(_0x148107,_0x55755a){var _0x4008fc=function(_0x494ab9){while(--_0x494ab9){_0x148107['push'](_0x148107['shift']());}};_0x4008fc(++_0x55755a);}(_0x7732,0xa8));var _0x2773=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x7732[_0x45ee03];return _0x13d535;};'use strict';var client=require(_0x2773('0x0'));exports[_0x2773('0x1')]={};exports[_0x2773('0x2')]=function(_0x33a892){return client[_0x2773('0x3')](_0x2773('0x4'),{'body':{'result':_0x33a892['result'],'transfererchannel':_0x33a892[_0x2773('0x5')],'transferercalleridnum':_0x33a892[_0x2773('0x6')],'transferercalleridname':_0x33a892[_0x2773('0x7')],'transfererconnectedlinenum':_0x33a892['transfererconnectedlinenum'],'transfererconnectedlinename':_0x33a892[_0x2773('0x8')],'transfereraccountcode':_0x33a892['transfereraccountcode'],'transferercontext':_0x33a892['transferercontext'],'transfererexten':_0x33a892['transfererexten'],'transfererlinkedid':_0x33a892[_0x2773('0x9')],'transfereechannel':_0x33a892['transfereechannel'],'transfereecalleridnum':_0x33a892['transfereecalleridnum'],'transfereecalleridname':_0x33a892[_0x2773('0xa')],'transfereeconnectedlinenum':_0x33a892[_0x2773('0xb')],'transfereeconnectedlinename':_0x33a892['transfereeconnectedlinename'],'transfereeaccountcode':_0x33a892[_0x2773('0xc')],'transfereecontext':_0x33a892[_0x2773('0xd')],'transfereeexten':_0x33a892[_0x2773('0xe')],'transfereelinkedid':_0x33a892['transfereelinkedid'],'isexternal':_0x33a892[_0x2773('0xf')],'context':_0x33a892['context'],'extension':_0x33a892[_0x2773('0x10')],'type':_0x2773('0x11')},'log':'CreateVoiceTransferReport'});};exports[_0x2773('0x12')]=function(_0x3f4541){return client[_0x2773('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x3f4541[_0x2773('0x13')],'transfererchannel':_0x3f4541['origtransfererchannel'],'transferercalleridnum':_0x3f4541[_0x2773('0x14')],'transferercalleridname':_0x3f4541['origtransferercalleridname'],'transfererconnectedlinenum':_0x3f4541[_0x2773('0x15')],'transfererconnectedlinename':_0x3f4541[_0x2773('0x16')],'transfereraccountcode':_0x3f4541[_0x2773('0x17')],'transferercontext':_0x3f4541['secondtransferercontext'],'transfererexten':_0x3f4541[_0x2773('0x18')],'transfererlinkedid':_0x3f4541[_0x2773('0x19')],'transfereechannel':_0x3f4541['transfertargetchannel'],'transfereecalleridnum':_0x3f4541[_0x2773('0x1a')],'transfereecalleridname':_0x3f4541[_0x2773('0x1b')],'transfereeconnectedlinenum':_0x3f4541['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3f4541['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3f4541[_0x2773('0x1c')],'transfereecontext':_0x3f4541[_0x2773('0x1d')],'transfereeexten':_0x3f4541[_0x2773('0x1e')],'transfereelinkedid':_0x3f4541[_0x2773('0x1f')],'isexternal':_0x3f4541['isexternal'],'context':_0x3f4541[_0x2773('0x20')],'extension':_0x3f4541['origtransfererexten'],'type':_0x2773('0x21')},'log':_0x2773('0x4')});}; \ No newline at end of file +var _0x0ea4=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum'];(function(_0x495c47,_0x20e4e1){var _0x204106=function(_0x360602){while(--_0x360602){_0x495c47['push'](_0x495c47['shift']());}};_0x204106(++_0x20e4e1);}(_0x0ea4,0xcb));var _0x40ea=function(_0x4f67ae,_0x25eac6){_0x4f67ae=_0x4f67ae-0x0;var _0x4f5be8=_0x0ea4[_0x4f67ae];return _0x4f5be8;};'use strict';var client=require('../client');exports[_0x40ea('0x0')]={};exports[_0x40ea('0x1')]=function(_0x54c460){return client['Request'](_0x40ea('0x2'),{'body':{'result':_0x54c460['result'],'transfererchannel':_0x54c460[_0x40ea('0x3')],'transferercalleridnum':_0x54c460[_0x40ea('0x4')],'transferercalleridname':_0x54c460[_0x40ea('0x5')],'transfererconnectedlinenum':_0x54c460[_0x40ea('0x6')],'transfererconnectedlinename':_0x54c460[_0x40ea('0x7')],'transfereraccountcode':_0x54c460[_0x40ea('0x8')],'transferercontext':_0x54c460[_0x40ea('0x9')],'transfererexten':_0x54c460[_0x40ea('0xa')],'transfererlinkedid':_0x54c460[_0x40ea('0xb')],'transfereechannel':_0x54c460['transfereechannel'],'transfereecalleridnum':_0x54c460[_0x40ea('0xc')],'transfereecalleridname':_0x54c460[_0x40ea('0xd')],'transfereeconnectedlinenum':_0x54c460[_0x40ea('0xe')],'transfereeconnectedlinename':_0x54c460[_0x40ea('0xf')],'transfereeaccountcode':_0x54c460[_0x40ea('0x10')],'transfereecontext':_0x54c460[_0x40ea('0x11')],'transfereeexten':_0x54c460[_0x40ea('0x12')],'transfereelinkedid':_0x54c460['transfereelinkedid'],'isexternal':_0x54c460[_0x40ea('0x13')],'context':_0x54c460['context'],'extension':_0x54c460[_0x40ea('0x14')],'type':_0x40ea('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x40ea('0x16')]=function(_0x389527){return client[_0x40ea('0x17')]('CreateVoiceTransferReport',{'body':{'result':_0x389527['result'],'transfererchannel':_0x389527[_0x40ea('0x18')],'transferercalleridnum':_0x389527[_0x40ea('0x19')],'transferercalleridname':_0x389527[_0x40ea('0x1a')],'transfererconnectedlinenum':_0x389527['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x389527[_0x40ea('0x1b')],'transfereraccountcode':_0x389527['origtransfereraccountcode'],'transferercontext':_0x389527[_0x40ea('0x1c')],'transfererexten':_0x389527[_0x40ea('0x1d')],'transfererlinkedid':_0x389527['origtransfererlinkedid'],'transfereechannel':_0x389527[_0x40ea('0x1e')],'transfereecalleridnum':_0x389527[_0x40ea('0x1f')],'transfereecalleridname':_0x389527[_0x40ea('0x20')],'transfereeconnectedlinenum':_0x389527[_0x40ea('0x21')],'transfereeconnectedlinename':_0x389527[_0x40ea('0x22')],'transfereeaccountcode':_0x389527[_0x40ea('0x23')],'transfereecontext':_0x389527[_0x40ea('0x24')],'transfereeexten':_0x389527[_0x40ea('0x25')],'transfereelinkedid':_0x389527[_0x40ea('0x26')],'isexternal':_0x389527[_0x40ea('0x13')],'context':_0x389527[_0x40ea('0x27')],'extension':_0x389527[_0x40ea('0x28')],'type':_0x40ea('0x29')},'log':_0x40ea('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 21253e0..a3a5971 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 _0x326f=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','undefined','values','channels','length','username','voicechannel','map','channel','format','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','then','StopMixMonitor','destinationchannel','%s.%s','wav','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','checkAfterSend','server','http','127.0.0.1','log','lodash','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','message','catch','error','Command','content','voiceQueues','hasOwnProperty','strategy','available','sumBillable','sumDuration','sumHoldTime','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x326f,0xd1));var _0xf326=function(_0x4bd16f,_0xea8817){_0x4bd16f=_0x4bd16f-0x0;var _0x4c4620=_0x326f[_0x4bd16f];return _0x4c4620;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xf326('0x1'));var BPromise=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var properties=require(_0xf326('0x5'));var ami=require(_0xf326('0x6'));exports[_0xf326('0x7')]=function(_0xf1c243,_0x1b5a56,_0x3ace29){return new BPromise(function(_0x4c2249,_0x3c254d){var _0x3851eb={'QueuePause':function(_0x165f95){return new Promise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=util['format'](_0xf326('0x8'),_0xf326('0x9'),_0x165f95[_0xf326('0xa')]);if(_0xf1c243[_0xf326('0xb')]&&_0xf1c243[_0xf326('0xb')][_0x4c206c]&&_0xf1c243['timers'][_0x4c206c][_0xf326('0xc')]){_0xf1c243['timers'][_0x4c206c][_0xf326('0xd')]();}if(_0xf1c243['agents'][_0x4c206c]){_0xf1c243[_0xf326('0xe')][_0x4c206c]['updateStatusRealtime']({'statePause':_0x165f95[_0xf326('0xf')]?!![]:![]});}_0x1e7b8a({'code':0xc8,'message':_0xf326('0x10')});});},'Reload':function(_0x4b3966){var _0x342fe5=this;return new Promise(function(_0x472632,_0x3504eb){if(ami[_0xf326('0x11')]()==![]){return _0x3504eb(_0x342fe5['error'](0x1f4,[config[_0xf326('0x12')]['ip'],config['asterisk']['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}_0x4b3966=_[_0xf326('0x15')](_0x4b3966,_[_0xf326('0x16')](properties[_0xf326('0x17')]));_0x4b3966[_0xf326('0x18')]=_0xf326('0x19');return ami[_0xf326('0x1a')](_0x4b3966)['then'](function(_0x3ad7da){_0x472632({'code':0xc8,'message':_0x3ad7da[_0xf326('0x1b')]});})[_0xf326('0x1c')](function(_0x31ffb9){_0x3504eb(_0x342fe5[_0xf326('0x1d')](0x1f5,_0x31ffb9[_0xf326('0x1b')]));});});},'Command':function(_0x4d3d41){var _0x4a5b6c=this;return new Promise(function(_0x56ad41,_0x16e605){if(ami[_0xf326('0x11')]()==![]){return _0x16e605(_0x4a5b6c['error'](0x1f4,[config['asterisk']['ip'],config[_0xf326('0x12')]['username'],'ami\x20disconnected'][_0xf326('0x14')]('\x20')));}_0x4d3d41=_[_0xf326('0x15')](_0x4d3d41,'command');_0x4d3d41['action']=_0xf326('0x1e');return ami[_0xf326('0x1a')](_0x4d3d41)['then'](function(_0x337ed5){_0x56ad41({'code':0xc8,'message':_0x337ed5[_0xf326('0x1f')]});})[_0xf326('0x1c')](function(_0x295752){_0x16e605(_0x4a5b6c[_0xf326('0x1d')](0x1f5,_0x295752[_0xf326('0x1b')]));});});},'VoiceQueues':function(_0x5ce532){return new Promise(function(_0x55b9f4,_0x4f31f6){var _0x520d85=[];for(var _0x1a2c4e in _0xf1c243[_0xf326('0x20')]){if(_0xf1c243[_0xf326('0x20')][_0xf326('0x21')](_0x1a2c4e)){var _0x410237=_0xf1c243['voiceQueues'][_0x1a2c4e];var _0x201d28={'id':_0x410237['id'],'name':_0x410237[_0xf326('0xa')],'strategy':_0x410237[_0xf326('0x22')],'answered':_0x410237['answered'],'available':_0x410237[_0xf326('0x23')],'loggedIn':_0x410237['loggedIn'],'pTalking':_0x410237['pTalking'],'sumBillable':_0x410237[_0xf326('0x24')],'sumDuration':_0x410237[_0xf326('0x25')],'sumHoldTime':_0x410237[_0xf326('0x26')]||0x0,'talking':_0x410237['talking'],'total':_0x410237[_0xf326('0x27')],'type':_0x410237[_0xf326('0x28')],'unmanaged':_0x410237['unmanaged'],'abandoned':_0x410237[_0xf326('0x29')],'waiting':_0x410237[_0xf326('0x2a')],'loggedInDb':_0x410237[_0xf326('0x2b')]};if(_0x410237[_0xf326('0x28')]===_0xf326('0x2c')){_0x201d28[_0xf326('0x2d')]=_0x410237[_0xf326('0x2d')];_0x201d28[_0xf326('0x2e')]=_0x410237[_0xf326('0x2e')];_0x201d28[_0xf326('0x2f')]=_0x410237['dialOriginateCallerIdName'];_0x201d28[_0xf326('0x30')]=_0x410237[_0xf326('0x30')];_0x201d28[_0xf326('0x31')]=_0x410237['dialOriginateTimeout'];_0x201d28[_0xf326('0x32')]=_0x410237[_0xf326('0x32')];_0x201d28[_0xf326('0x33')]=_0x410237['temp'];_0x201d28['outboundAnswerAgiCallsDay']=_0x410237[_0xf326('0x34')];_0x201d28[_0xf326('0x35')]=_0x410237[_0xf326('0x35')];_0x201d28[_0xf326('0x36')]=_0x410237[_0xf326('0x36')];_0x201d28[_0xf326('0x37')]=_0x410237[_0xf326('0x37')];_0x201d28[_0xf326('0x38')]=_0x410237['outboundCongestionCallsDay'];_0x201d28[_0xf326('0x39')]=_0x410237[_0xf326('0x39')];_0x201d28['outboundDropCallsDayCallersExit']=_0x410237[_0xf326('0x3a')];_0x201d28['outboundDropCallsDayTimeout']=_0x410237[_0xf326('0x3b')];_0x201d28['outboundNoAnswerCallsDay']=_0x410237['outboundNoAnswerCallsDay'];_0x201d28[_0xf326('0x3c')]=_0x410237['outboundNoSuchCallsDay'];_0x201d28[_0xf326('0x3d')]=_0x410237['outboundOriginateFailureCallsDay'];_0x201d28[_0xf326('0x3e')]=_0x410237[_0xf326('0x3e')];_0x201d28[_0xf326('0x3f')]=_0x410237['outboundRejectCallsDay'];_0x201d28[_0xf326('0x40')]=_0x410237[_0xf326('0x40')];_0x201d28['predictiveIntervalAnsweredCalls']=_0x410237[_0xf326('0x41')];_0x201d28[_0xf326('0x42')]=_0x410237[_0xf326('0x42')];_0x201d28[_0xf326('0x43')]=_0x410237['predictiveIntervalAvgTalktime'];_0x201d28[_0xf326('0x44')]=_0x410237[_0xf326('0x44')];_0x201d28[_0xf326('0x45')]=_0x410237[_0xf326('0x45')];_0x201d28[_0xf326('0x46')]=_0x410237['predictiveIntervalErlangCalls'];_0x201d28[_0xf326('0x47')]=_0x410237[_0xf326('0x47')];_0x201d28['predictiveIntervalHitRate']=_0x410237['predictiveIntervalHitRate'];_0x201d28[_0xf326('0x48')]=_0x410237['predictiveIntervalMultiplicativeFactor'];_0x201d28['predictiveIntervalPauses']=_0x410237[_0xf326('0x49')];_0x201d28['predictiveIntervalAvailable']=_0x410237[_0xf326('0x4a')];_0x201d28[_0xf326('0x4b')]=_0x410237[_0xf326('0x4b')];_0x201d28[_0xf326('0x1b')]=_0x410237['message'];_0x201d28[_0xf326('0x4c')]=_0x410237[_0xf326('0x4c')];_0x201d28[_0xf326('0x4d')]=_0x410237[_0xf326('0x4d')];_0x201d28[_0xf326('0x4e')]=_0x410237[_0xf326('0x4e')];_0x201d28[_0xf326('0x4f')]=_0x410237[_0xf326('0x4f')];_0x201d28[_0xf326('0x50')]=_0x410237[_0xf326('0x50')];_0x201d28[_0xf326('0x51')]=_0x410237[_0xf326('0x51')];_0x201d28['startProgressive']=_0x410237[_0xf326('0x52')];}if(_0x410237[_0xf326('0x53')]){_0x201d28[_0xf326('0x53')]={'id':_0x410237[_0xf326('0x53')]['id'],'name':_0x410237[_0xf326('0x53')][_0xf326('0xa')],'active':_0x410237['Trunk'][_0xf326('0x54')],'callerid':_0x410237[_0xf326('0x53')]['callerid']};}if(_0x410237[_0xf326('0x55')]){_0x201d28[_0xf326('0x55')]={'id':_0x410237[_0xf326('0x55')]['id'],'name':_0x410237[_0xf326('0x55')][_0xf326('0xa')]};}_0x520d85['push'](_0x201d28);}}_0x55b9f4({'count':_0x520d85['length'],'rows':_0x520d85});});},'UpdateVoiceQueue':function(_0x184a74){return new Promise(function(_0x44e101,_0x5ed62e){var _0x4bd865=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x20')],{'id':parseInt(_0x184a74['id'])});var _0x21c98e=_['omit'](_0x184a74,['id']);if(_0x4bd865){for(var _0x301e65 in _0x21c98e){if(typeof _0x21c98e[_0x301e65]!==_0xf326('0x57')&&typeof _0x4bd865[_0x301e65]!==_0xf326('0x57')){_0x4bd865[_0x301e65]=_0x21c98e[_0x301e65];}}_0x44e101(_0x4bd865);}else{_0x5ed62e();}});},'VoiceChannels':function(_0xc43507){return new Promise(function(_0xc99be,_0x2d9bba){var _0x12792c=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x59')]);_0xc99be({'count':_0x12792c[_0xf326('0x5a')],'rows':_0x12792c});});},'VoiceChannelMixMonitor':function(_0x1c76c8){var _0xa1ba7a=this;return new Promise(function(_0x1beef7,_0x395b1e){if(ami[_0xf326('0x11')]()==![]){return _0x395b1e(_0xa1ba7a['error'](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')][_0xf326('0x5b')],_0xf326('0x13')]['join']('\x20')));}var _0x10f437=schema(properties[_0xf326('0x5c')])[_0xf326('0x1')](_0x1c76c8);if(_0x10f437[_0xf326('0x5a')]>0x0){return _0x395b1e(_0xa1ba7a['error'](0x1f4,_[_0xf326('0x5d')](_0x10f437,_0xf326('0x1b'))[_0xf326('0x14')](',\x20')));}var _0x451ac7=_[_0xf326('0x56')](_0xf1c243['channels'],{'uniqueid':_0x1c76c8['uniqueid']});if(_0x451ac7&&_0x451ac7[_0xf326('0x5e')]){var _0x38ff64=util[_0xf326('0x5f')]('%s.%s',_0x1c76c8[_0xf326('0x60')]||_0x1c76c8[_0xf326('0x61')],_0x1c76c8[_0xf326('0x5f')]||'wav');return ami['Action']({'action':_0xf326('0x62'),'channel':_0x451ac7['channel'],'file':_0x38ff64,'options':_0xf326('0x63')})['then'](function(_0x458e5f){var _0x7ee57=_[_0xf326('0x56')](_0x451ac7[_0xf326('0x64')],{'filename':_0xf326('0x65')+_0x38ff64[_0xf326('0x66')]()});if(_[_0xf326('0x67')](_0x7ee57)){_0x451ac7['monitors'][_0xf326('0x68')]({'filename':_0xf326('0x65')+_0x38ff64[_0xf326('0x66')](),'createdAt':moment()['format'](_0xf326('0x69')),'mixmonitorid':_0x458e5f[_0xf326('0x6a')],'status':_0xf326('0x6b')});}else{_0x7ee57[_0xf326('0x6a')]=_0x458e5f[_0xf326('0x6a')];_0x7ee57['status']=_0xf326('0x6b');}_0x1beef7({'code':0xc8,'message':[_0x1c76c8[_0xf326('0x61')],_0xf326('0x6c'),_0x458e5f[_0xf326('0x6a')]]['join']('\x20'),'mixmonitorid':_0x458e5f[_0xf326('0x6a')]});})[_0xf326('0x1c')](function(_0x227850){_0x395b1e(_0xa1ba7a[_0xf326('0x1d')](0x1f5,[_0x1c76c8['uniqueid'],_0x227850['message'][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')));});}else{return _0x395b1e(_0xa1ba7a['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x29de71){var _0x316609=this;return new Promise(function(_0x1258d1,_0x5765b0){if(ami[_0xf326('0x11')]()==![]){return _0x5765b0(_0x316609['error'](0x1f4,[config['asterisk']['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x2ceb57=schema(properties['voicechannel'])['validate'](_0x29de71);if(_0x2ceb57[_0xf326('0x5a')]>0x0){return _0x5765b0(_0x316609[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x2ceb57,'message')[_0xf326('0x14')](',\x20')));}var _0x487020=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x59')],{'uniqueid':_0x29de71[_0xf326('0x61')]});if(_0x487020){return BPromise[_0xf326('0x6e')]()[_0xf326('0x6f')](function(){if(_0x487020[_0xf326('0x5e')]){return ami[_0xf326('0x1a')]({'action':_0xf326('0x70'),'channel':_0x487020[_0xf326('0x5e')],'mixmonitorid':_0x29de71[_0xf326('0x6a')]})[_0xf326('0x1c')](function(_0x1e56fb){});}})[_0xf326('0x6f')](function(){if(_0x487020['destinationchannel']){return ami[_0xf326('0x1a')]({'action':'StopMixMonitor','channel':_0x487020[_0xf326('0x71')],'mixmonitorid':_0x29de71[_0xf326('0x6a')]})['catch'](function(_0x2b770c){});}})['then'](function(_0x3255b2){var _0xd55246=_[_0xf326('0x56')](_0x487020[_0xf326('0x64')],{'mixmonitorid':_0x29de71[_0xf326('0x6a')]});if(_0xd55246){_0xd55246['status']='stop';}})[_0xf326('0x6f')](function(){var _0x32fe3a=util[_0xf326('0x5f')](_0xf326('0x72'),_0x29de71[_0xf326('0x60')]||_0x29de71['uniqueid'],_0x29de71[_0xf326('0x5f')]||_0xf326('0x73'));var _0x4aadc9=_['find'](_0x487020['monitors'],{'filename':_0xf326('0x65')+_0x32fe3a[_0xf326('0x66')]()});if(_0x4aadc9){_0x4aadc9[_0xf326('0x74')]=_0xf326('0x75');}})[_0xf326('0x6f')](function(){_0x1258d1({'code':0xc8,'message':[_0x29de71[_0xf326('0x61')],_0xf326('0x76')]['join']('\x20')});})[_0xf326('0x1c')](function(_0x588d26){_0x5765b0(_0x316609[_0xf326('0x1d')](0x1f5,[_0x29de71[_0xf326('0x61')],_0x588d26['message'][_0xf326('0x66')]()]['join']('\x20')));});}else{return _0x5765b0(_0x316609['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceQueuesChannels':function(_0x540fa0){return new Promise(function(_0x78ba34,_0x3411a4){var _0x461059=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x77')]);_0x78ba34({'count':_0x461059['length'],'rows':_0x461059});});},'VoiceQueuesChannel':function(_0x4a053c){var _0x48d84a=this;return new Promise(function(_0xeeea57,_0x307441){var _0x229a34=schema(properties[_0xf326('0x78')])[_0xf326('0x1')](_0x4a053c);if(_0x229a34['length']>0x0){return _0x307441(_0x48d84a[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x229a34,_0xf326('0x1b'))['join'](',\x20')));}var _0x567492=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x4a053c['uniqueid']});if(_0x567492){_0xeeea57(_0x567492);}else{return _0x307441(_0x48d84a['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x5ba28d){var _0xc3a897=this;return new Promise(function(_0x4ae744,_0x5c390c){if(ami['isConnected']()==![]){return _0x5c390c(_0xc3a897[_0xf326('0x1d')](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x35e34d=schema(properties[_0xf326('0x79')])[_0xf326('0x1')](_0x5ba28d);if(_0x35e34d[_0xf326('0x5a')]>0x0){return _0x5c390c(_0xc3a897[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x35e34d,_0xf326('0x1b'))['join'](',\x20')));}var _0x34c3cf=_['find'](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x5ba28d[_0xf326('0x61')]});if(_0x34c3cf&&_0x34c3cf[_0xf326('0x5e')]){return ami['Action']({'action':_0xf326('0x7a'),'channel':_0x34c3cf[_0xf326('0x5e')]})[_0xf326('0x6f')](function(_0x4dc8d7){_0x4ae744({'code':0xc8,'message':[_0x5ba28d[_0xf326('0x61')],_0x4dc8d7[_0xf326('0x1b')][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')});})['catch'](function(_0x3addac){_0x5c390c(_0xc3a897['error'](0x1f5,[_0x5ba28d['uniqueid'],_0x3addac[_0xf326('0x1b')][_0xf326('0x66')]()]['join']('\x20')));});}else{return _0x5c390c(_0xc3a897['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2bd990){var _0x543689=this;return new Promise(function(_0x102d03,_0x37a564){if(ami[_0xf326('0x11')]()==![]){return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x5f1724=schema(properties['voicequeuechannelredirect'])[_0xf326('0x1')](_0x2bd990);if(_0x5f1724['length']>0x0){return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x5f1724,_0xf326('0x1b'))[_0xf326('0x14')](',\x20')));}var _0x19d676=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x2bd990[_0xf326('0x61')]});if(_0x19d676&&_0x19d676[_0xf326('0x5e')]){return ami['Action']({'action':_0xf326('0x7b'),'channel':_0x19d676[_0xf326('0x5e')],'exten':_0x2bd990['exten'],'context':_0x2bd990[_0xf326('0x7c')]||_0x19d676['context'],'priority':0x1})[_0xf326('0x6f')](function(_0x34fe36){_0x102d03({'code':0xc8,'message':[_0x2bd990[_0xf326('0x61')],_0x34fe36['message'][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')});})[_0xf326('0x1c')](function(_0x1de866){_0x37a564(_0x543689[_0xf326('0x1d')](0x1f5,[_0x2bd990[_0xf326('0x61')],_0x1de866[_0xf326('0x1b')][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')));});}else{return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f5,_0xf326('0x6d')));}});},'Agents':function(_0x32b2ea){return new Promise(function(_0x452e28,_0x3abcff){var _0x1f990d=_['values'](_0xf1c243[_0xf326('0xe')]);_0x452e28({'count':_0x1f990d[_0xf326('0x5a')],'rows':_0x1f990d});});},'Telephones':function(_0x4829ae){return new Promise(function(_0x438daa,_0x424be4){var _0x5c1686=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x7d')]);_0x438daa({'count':_0x5c1686[_0xf326('0x5a')],'rows':_0x5c1686});});},'Trunks':function(_0x8dbd96){return new Promise(function(_0x2ab607,_0x35c228){var _0x1bb7cc=_['values'](_0xf1c243[_0xf326('0x7e')]);_0x2ab607({'count':_0x1bb7cc[_0xf326('0x5a')],'rows':_0x1bb7cc});});},'OutboundChannels':function(_0x323fb1){return new Promise(function(_0x3c33d1,_0x316c8e){var _0x1d50e2=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x7f')]);_0x3c33d1({'count':_0x1d50e2['length'],'rows':_0x1d50e2});});},'Outbound':function(_0xa8e05b){return new Promise(function(_0x2e2103,_0x49c3da){_0x2e2103(_0xf1c243[_0xf326('0x2c')]);});},'Campaigns':function(_0x4b2295){return new Promise(function(_0x2be05a,_0x24a08e){var _0x16bc97=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x80')]);_0x2be05a({'count':_0x16bc97[_0xf326('0x5a')],'rows':_0x16bc97});});},'VoiceQueuesPreview':function(_0xf66b70){var _0x1eb29d=this;return new Promise(function(_0x3afd5e,_0x13e03b){_0x1b5a56[_0xf326('0x81')](_0xf66b70['id'])[_0xf326('0x6f')](function(_0x3d0c8b){_0x3afd5e({'code':0xc8,'message':_0x3d0c8b[_0xf326('0x1b')]});})['catch'](function(_0x2bb6f0){_0x13e03b(_0x1eb29d[_0xf326('0x1d')](0x1f4,_0x2bb6f0[_0xf326('0x1b')]));});});},'EventManager':function(_0x3d3bd4){var _0xdb2ad8=this;return new Promise(function(_0x550f34,_0x1ec128){if(!_0x3d3bd4[_0xf326('0x82')]){return _0x1ec128(_0xdb2ad8[_0xf326('0x1d')](0x1f4,_0xf326('0x83')));}ami[_0xf326('0x84')]('custom:'+_0x3d3bd4['event'],_0x3d3bd4[_0xf326('0x1b')]);_0x550f34({'code':0xc8,'message':_0x3d3bd4});});},'FaxAccounts':function(_0x47c347){return new Promise(function(_0xedbcf2,_0x143965){var _0x29610a=_['values'](_0xf1c243['faxAccounts']);_0xedbcf2({'count':_0x29610a[_0xf326('0x5a')],'rows':_0x29610a});});},'SendFax':function(_0x2d92e4){var _0x167ac9=this;return new Promise(function(_0x34870c,_0x40230c){_0x3ace29['send'](_0x2d92e4)[_0xf326('0x6f')](function(_0x428eae){_0x34870c({'code':0xc8,'message':_0x428eae[_0xf326('0x1b')]});})['catch'](function(_0x4cc620){_0x40230c(_0x167ac9['error'](0x1f4,_0x4cc620[_0xf326('0x1b')]));});});},'CheckAfterSend':function(_0x17c96c){var _0x2d275d=this;return new Promise(function(_0x30922e,_0x58ef98){_0x3ace29[_0xf326('0x85')](_0x17c96c)[_0xf326('0x6f')](function(_0x598a93){_0x30922e({'code':0xc8,'message':_0x598a93['message']});})[_0xf326('0x1c')](function(_0x228c81){_0x58ef98(_0x2d275d[_0xf326('0x1d')](0x1f4,_0x228c81['message']));});});}};var _0xd85b34=jayson[_0xf326('0x86')](_0x3851eb)[_0xf326('0x87')]();_0xd85b34['on']('error',function(_0x39d16d){return _0x3c254d(_0x39d16d);});_0xd85b34[_0xf326('0x7')](0x232a,_0xf326('0x88'),function(){console[_0xf326('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4c2249('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x2c8f=['updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','error','message','command','Command','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','channels','voicechannel','validate','uniqueid','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','channel','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','map','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','event','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','log','util','moment','../../../config/environment','../properties','format','%s/%s','name','timers','timer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c8f,0x192));var _0xf2c8=function(_0x49da9b,_0x58d062){_0x49da9b=_0x49da9b-0x0;var _0x57a038=_0x2c8f[_0x49da9b];return _0x57a038;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xf2c8('0x1'));var config=require(_0xf2c8('0x2'));var properties=require(_0xf2c8('0x3'));var ami=require('../ami');exports['listen']=function(_0x2581a1,_0x34f179,_0x182b73){return new BPromise(function(_0x3ad7a0,_0x2785ee){var _0x4eae22={'QueuePause':function(_0x475616){return new Promise(function(_0x28cc0d,_0x4e3109){var _0x450f1e=util[_0xf2c8('0x4')](_0xf2c8('0x5'),'SIP',_0x475616[_0xf2c8('0x6')]);if(_0x2581a1[_0xf2c8('0x7')]&&_0x2581a1[_0xf2c8('0x7')][_0x450f1e]&&_0x2581a1[_0xf2c8('0x7')][_0x450f1e][_0xf2c8('0x8')]){_0x2581a1[_0xf2c8('0x7')][_0x450f1e][_0xf2c8('0x9')]();}if(_0x2581a1[_0xf2c8('0xa')][_0x450f1e]){_0x2581a1['agents'][_0x450f1e][_0xf2c8('0xb')]({'statePause':_0x475616['pause']?!![]:![]});}_0x28cc0d({'code':0xc8,'message':_0xf2c8('0xc')});});},'Reload':function(_0x16b7a4){var _0x2b6565=this;return new Promise(function(_0x46d0c6,_0x37db9b){if(ami[_0xf2c8('0xd')]()==![]){return _0x37db9b(_0x2b6565['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config[_0xf2c8('0xe')][_0xf2c8('0xf')],_0xf2c8('0x10')][_0xf2c8('0x11')]('\x20')));}_0x16b7a4=_[_0xf2c8('0x12')](_0x16b7a4,_[_0xf2c8('0x13')](properties['module']));_0x16b7a4[_0xf2c8('0x14')]=_0xf2c8('0x15');return ami[_0xf2c8('0x16')](_0x16b7a4)[_0xf2c8('0x17')](function(_0xe1ec71){_0x46d0c6({'code':0xc8,'message':_0xe1ec71['message']});})['catch'](function(_0x104d9d){_0x37db9b(_0x2b6565[_0xf2c8('0x18')](0x1f5,_0x104d9d[_0xf2c8('0x19')]));});});},'Command':function(_0x283ecf){var _0x516d99=this;return new Promise(function(_0x29d2df,_0x100542){if(ami[_0xf2c8('0xd')]()==![]){return _0x100542(_0x516d99['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config[_0xf2c8('0xe')]['username'],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}_0x283ecf=_[_0xf2c8('0x12')](_0x283ecf,_0xf2c8('0x1a'));_0x283ecf['action']=_0xf2c8('0x1b');return ami[_0xf2c8('0x16')](_0x283ecf)[_0xf2c8('0x17')](function(_0x239350){_0x29d2df({'code':0xc8,'message':_0x239350['content']});})[_0xf2c8('0x1c')](function(_0xe5ff6c){_0x100542(_0x516d99[_0xf2c8('0x18')](0x1f5,_0xe5ff6c[_0xf2c8('0x19')]));});});},'VoiceQueues':function(_0x16938e){return new Promise(function(_0x4d0e56,_0x93707c){var _0x54bbcb=[];for(var _0x3cd344 in _0x2581a1[_0xf2c8('0x1d')]){if(_0x2581a1[_0xf2c8('0x1d')][_0xf2c8('0x1e')](_0x3cd344)){var _0x1d2e74=_0x2581a1[_0xf2c8('0x1d')][_0x3cd344];var _0x3ffd20={'id':_0x1d2e74['id'],'name':_0x1d2e74[_0xf2c8('0x6')],'strategy':_0x1d2e74[_0xf2c8('0x1f')],'answered':_0x1d2e74[_0xf2c8('0x20')],'available':_0x1d2e74[_0xf2c8('0x21')],'loggedIn':_0x1d2e74[_0xf2c8('0x22')],'pTalking':_0x1d2e74[_0xf2c8('0x23')],'sumBillable':_0x1d2e74['sumBillable'],'sumDuration':_0x1d2e74[_0xf2c8('0x24')],'sumHoldTime':_0x1d2e74['sumHoldTime']||0x0,'talking':_0x1d2e74['talking'],'total':_0x1d2e74[_0xf2c8('0x25')],'type':_0x1d2e74['type'],'unmanaged':_0x1d2e74[_0xf2c8('0x26')],'abandoned':_0x1d2e74[_0xf2c8('0x27')],'waiting':_0x1d2e74[_0xf2c8('0x28')],'loggedInDb':_0x1d2e74[_0xf2c8('0x29')]};if(_0x1d2e74[_0xf2c8('0x2a')]===_0xf2c8('0x2b')){_0x3ffd20[_0xf2c8('0x2c')]=_0x1d2e74['dialActive'];_0x3ffd20[_0xf2c8('0x2d')]=_0x1d2e74[_0xf2c8('0x2d')];_0x3ffd20[_0xf2c8('0x2e')]=_0x1d2e74[_0xf2c8('0x2e')];_0x3ffd20[_0xf2c8('0x2f')]=_0x1d2e74[_0xf2c8('0x2f')];_0x3ffd20['dialOriginateTimeout']=_0x1d2e74[_0xf2c8('0x30')];_0x3ffd20['dialPrefix']=_0x1d2e74[_0xf2c8('0x31')];_0x3ffd20['temp']=_0x1d2e74[_0xf2c8('0x32')];_0x3ffd20[_0xf2c8('0x33')]=_0x1d2e74[_0xf2c8('0x33')];_0x3ffd20[_0xf2c8('0x34')]=_0x1d2e74[_0xf2c8('0x34')];_0x3ffd20['outboundBlacklistCallsDay']=_0x1d2e74[_0xf2c8('0x35')];_0x3ffd20[_0xf2c8('0x36')]=_0x1d2e74['outboundBusyCallsDay'];_0x3ffd20[_0xf2c8('0x37')]=_0x1d2e74[_0xf2c8('0x37')];_0x3ffd20['outboundDropCallsDayACS']=_0x1d2e74[_0xf2c8('0x38')];_0x3ffd20[_0xf2c8('0x39')]=_0x1d2e74[_0xf2c8('0x39')];_0x3ffd20[_0xf2c8('0x3a')]=_0x1d2e74[_0xf2c8('0x3a')];_0x3ffd20['outboundNoAnswerCallsDay']=_0x1d2e74['outboundNoAnswerCallsDay'];_0x3ffd20[_0xf2c8('0x3b')]=_0x1d2e74[_0xf2c8('0x3b')];_0x3ffd20[_0xf2c8('0x3c')]=_0x1d2e74[_0xf2c8('0x3c')];_0x3ffd20[_0xf2c8('0x3d')]=_0x1d2e74[_0xf2c8('0x3d')];_0x3ffd20[_0xf2c8('0x3e')]=_0x1d2e74[_0xf2c8('0x3e')];_0x3ffd20['outboundUnknownCallsDay']=_0x1d2e74[_0xf2c8('0x3f')];_0x3ffd20[_0xf2c8('0x40')]=_0x1d2e74[_0xf2c8('0x40')];_0x3ffd20['predictiveIntervalAvgHoldtime']=_0x1d2e74['predictiveIntervalAvgHoldtime'];_0x3ffd20['predictiveIntervalAvgTalktime']=_0x1d2e74['predictiveIntervalAvgTalktime'];_0x3ffd20[_0xf2c8('0x41')]=_0x1d2e74['predictiveIntervalDroppedCallsCallersExit'];_0x3ffd20[_0xf2c8('0x42')]=_0x1d2e74['predictiveIntervalDroppedCallsTimeout'];_0x3ffd20[_0xf2c8('0x43')]=_0x1d2e74['predictiveIntervalErlangCalls'];_0x3ffd20['predictiveIntervalErlangCallsDroppedCalls']=_0x1d2e74[_0xf2c8('0x44')];_0x3ffd20[_0xf2c8('0x45')]=_0x1d2e74['predictiveIntervalHitRate'];_0x3ffd20[_0xf2c8('0x46')]=_0x1d2e74[_0xf2c8('0x46')];_0x3ffd20['predictiveIntervalPauses']=_0x1d2e74[_0xf2c8('0x47')];_0x3ffd20[_0xf2c8('0x48')]=_0x1d2e74[_0xf2c8('0x48')];_0x3ffd20[_0xf2c8('0x49')]=_0x1d2e74[_0xf2c8('0x49')];_0x3ffd20[_0xf2c8('0x19')]=_0x1d2e74['message'];_0x3ffd20['originated']=_0x1d2e74[_0xf2c8('0x4a')];_0x3ffd20['erlangCalls']=_0x1d2e74[_0xf2c8('0x4b')];_0x3ffd20['erlangCallToSecond']=_0x1d2e74[_0xf2c8('0x4c')];_0x3ffd20['erlangAbandonmentRate']=_0x1d2e74[_0xf2c8('0x4d')];_0x3ffd20[_0xf2c8('0x4e')]=_0x1d2e74[_0xf2c8('0x4e')];_0x3ffd20[_0xf2c8('0x4f')]=_0x1d2e74['startPredictive'];_0x3ffd20[_0xf2c8('0x50')]=_0x1d2e74[_0xf2c8('0x50')];}if(_0x1d2e74['Trunk']){_0x3ffd20[_0xf2c8('0x51')]={'id':_0x1d2e74[_0xf2c8('0x51')]['id'],'name':_0x1d2e74[_0xf2c8('0x51')][_0xf2c8('0x6')],'active':_0x1d2e74[_0xf2c8('0x51')][_0xf2c8('0x52')],'callerid':_0x1d2e74[_0xf2c8('0x51')]['callerid']};}if(_0x1d2e74[_0xf2c8('0x53')]){_0x3ffd20[_0xf2c8('0x53')]={'id':_0x1d2e74[_0xf2c8('0x53')]['id'],'name':_0x1d2e74[_0xf2c8('0x53')]['name']};}_0x54bbcb['push'](_0x3ffd20);}}_0x4d0e56({'count':_0x54bbcb[_0xf2c8('0x54')],'rows':_0x54bbcb});});},'UpdateVoiceQueue':function(_0x175b93){return new Promise(function(_0x3203c3,_0x520029){var _0xe257cc=_[_0xf2c8('0x55')](_0x2581a1['voiceQueues'],{'id':parseInt(_0x175b93['id'])});var _0x574476=_[_0xf2c8('0x56')](_0x175b93,['id']);if(_0xe257cc){for(var _0xce3dd5 in _0x574476){if(typeof _0x574476[_0xce3dd5]!==_0xf2c8('0x57')&&typeof _0xe257cc[_0xce3dd5]!==_0xf2c8('0x57')){_0xe257cc[_0xce3dd5]=_0x574476[_0xce3dd5];}}_0x3203c3(_0xe257cc);}else{_0x520029();}});},'VoiceChannels':function(_0x48ee2c){return new Promise(function(_0x16f713,_0x826ca6){var _0x18bbd9=_['values'](_0x2581a1[_0xf2c8('0x58')]);_0x16f713({'count':_0x18bbd9[_0xf2c8('0x54')],'rows':_0x18bbd9});});},'VoiceChannelMixMonitor':function(_0x15fa55){var _0x48f770=this;return new Promise(function(_0x105438,_0x452b12){if(ami[_0xf2c8('0xd')]()==![]){return _0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x168acb=schema(properties[_0xf2c8('0x59')])[_0xf2c8('0x5a')](_0x15fa55);if(_0x168acb[_0xf2c8('0x54')]>0x0){return _0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f4,_['map'](_0x168acb,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x34bd47=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x58')],{'uniqueid':_0x15fa55[_0xf2c8('0x5b')]});if(_0x34bd47&&_0x34bd47['channel']){var _0x53f6ee=util[_0xf2c8('0x4')](_0xf2c8('0x5c'),_0x15fa55[_0xf2c8('0x5d')]||_0x15fa55[_0xf2c8('0x5b')],_0x15fa55[_0xf2c8('0x4')]||_0xf2c8('0x5e'));return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x5f'),'channel':_0x34bd47['channel'],'file':_0x53f6ee,'options':_0xf2c8('0x60')})[_0xf2c8('0x17')](function(_0x5ebf58){var _0x56f7e5=_[_0xf2c8('0x55')](_0x34bd47[_0xf2c8('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x53f6ee[_0xf2c8('0x62')]()});if(_[_0xf2c8('0x63')](_0x56f7e5)){_0x34bd47[_0xf2c8('0x61')]['push']({'filename':_0xf2c8('0x64')+_0x53f6ee[_0xf2c8('0x62')](),'createdAt':moment()[_0xf2c8('0x4')](_0xf2c8('0x65')),'mixmonitorid':_0x5ebf58[_0xf2c8('0x66')],'status':_0xf2c8('0x67')});}else{_0x56f7e5[_0xf2c8('0x66')]=_0x5ebf58[_0xf2c8('0x66')];_0x56f7e5['status']=_0xf2c8('0x67');}_0x105438({'code':0xc8,'message':[_0x15fa55[_0xf2c8('0x5b')],_0xf2c8('0x68'),_0x5ebf58['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x5ebf58[_0xf2c8('0x66')]});})[_0xf2c8('0x1c')](function(_0x4d79af){_0x452b12(_0x48f770[_0xf2c8('0x18')](0x1f5,[_0x15fa55['uniqueid'],_0x4d79af['message'][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x452b12(_0x48f770['error'](0x1f5,_0xf2c8('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x3adba6){var _0x28464c=this;return new Promise(function(_0x3d2d39,_0x2f78b1){if(ami['isConnected']()==![]){return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}var _0x184c25=schema(properties[_0xf2c8('0x59')])[_0xf2c8('0x5a')](_0x3adba6);if(_0x184c25[_0xf2c8('0x54')]>0x0){return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f4,_['map'](_0x184c25,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x2fe8da=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x58')],{'uniqueid':_0x3adba6['uniqueid']});if(_0x2fe8da){return BPromise[_0xf2c8('0x6a')]()[_0xf2c8('0x17')](function(){if(_0x2fe8da[_0xf2c8('0x6b')]){return ami[_0xf2c8('0x16')]({'action':'StopMixMonitor','channel':_0x2fe8da[_0xf2c8('0x6b')],'mixmonitorid':_0x3adba6[_0xf2c8('0x66')]})[_0xf2c8('0x1c')](function(_0x20d8d4){});}})[_0xf2c8('0x17')](function(){if(_0x2fe8da[_0xf2c8('0x6c')]){return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x6d'),'channel':_0x2fe8da[_0xf2c8('0x6c')],'mixmonitorid':_0x3adba6['mixmonitorid']})[_0xf2c8('0x1c')](function(_0x117bac){});}})['then'](function(_0xdbf069){var _0x452ade=_['find'](_0x2fe8da[_0xf2c8('0x61')],{'mixmonitorid':_0x3adba6[_0xf2c8('0x66')]});if(_0x452ade){_0x452ade[_0xf2c8('0x6e')]=_0xf2c8('0x6f');}})['then'](function(){var _0x5b4758=util[_0xf2c8('0x4')]('%s.%s',_0x3adba6[_0xf2c8('0x5d')]||_0x3adba6[_0xf2c8('0x5b')],_0x3adba6[_0xf2c8('0x4')]||_0xf2c8('0x5e'));var _0x13afc0=_[_0xf2c8('0x55')](_0x2fe8da['monitors'],{'filename':_0xf2c8('0x64')+_0x5b4758[_0xf2c8('0x62')]()});if(_0x13afc0){_0x13afc0['status']=_0xf2c8('0x6f');}})[_0xf2c8('0x17')](function(){_0x3d2d39({'code':0xc8,'message':[_0x3adba6['uniqueid'],_0xf2c8('0x70')]['join']('\x20')});})[_0xf2c8('0x1c')](function(_0x154cbe){_0x2f78b1(_0x28464c['error'](0x1f5,[_0x3adba6['uniqueid'],_0x154cbe['message'][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x2f78b1(_0x28464c[_0xf2c8('0x18')](0x1f5,_0xf2c8('0x69')));}});},'VoiceQueuesChannels':function(_0xb5801f){return new Promise(function(_0x2e963f,_0x5bf80e){var _0x2f5718=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x72')]);_0x2e963f({'count':_0x2f5718[_0xf2c8('0x54')],'rows':_0x2f5718});});},'VoiceQueuesChannel':function(_0x4ff195){var _0x5b0b51=this;return new Promise(function(_0x949a87,_0x9d63ca){var _0x3f0dcb=schema(properties[_0xf2c8('0x73')])['validate'](_0x4ff195);if(_0x3f0dcb['length']>0x0){return _0x9d63ca(_0x5b0b51[_0xf2c8('0x18')](0x1f4,_[_0xf2c8('0x74')](_0x3f0dcb,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x4c0ae9=_['find'](_0x2581a1[_0xf2c8('0x72')],{'uniqueid':_0x4ff195[_0xf2c8('0x5b')]});if(_0x4c0ae9){_0x949a87(_0x4c0ae9);}else{return _0x9d63ca(_0x5b0b51[_0xf2c8('0x18')](0x1f5,_0xf2c8('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x30190c){var _0x24ed2c=this;return new Promise(function(_0x5ef316,_0x35c799){if(ami[_0xf2c8('0xd')]()==![]){return _0x35c799(_0x24ed2c['error'](0x1f4,[config[_0xf2c8('0xe')]['ip'],config['asterisk'][_0xf2c8('0xf')],'ami\x20disconnected'][_0xf2c8('0x11')]('\x20')));}var _0x173e02=schema(properties[_0xf2c8('0x75')])[_0xf2c8('0x5a')](_0x30190c);if(_0x173e02[_0xf2c8('0x54')]>0x0){return _0x35c799(_0x24ed2c['error'](0x1f4,_['map'](_0x173e02,'message')[_0xf2c8('0x11')](',\x20')));}var _0x25addf=_[_0xf2c8('0x55')](_0x2581a1['queueChannels'],{'uniqueid':_0x30190c[_0xf2c8('0x5b')]});if(_0x25addf&&_0x25addf['channel']){return ami[_0xf2c8('0x16')]({'action':'Hangup','channel':_0x25addf[_0xf2c8('0x6b')]})['then'](function(_0x4316e2){_0x5ef316({'code':0xc8,'message':[_0x30190c[_0xf2c8('0x5b')],_0x4316e2[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')});})[_0xf2c8('0x1c')](function(_0xb3f69a){_0x35c799(_0x24ed2c[_0xf2c8('0x18')](0x1f5,[_0x30190c['uniqueid'],_0xb3f69a[_0xf2c8('0x19')]['toLowerCase']()][_0xf2c8('0x11')]('\x20')));});}else{return _0x35c799(_0x24ed2c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5936cd){var _0x54ef2e=this;return new Promise(function(_0x34989a,_0x2f48dc){if(ami[_0xf2c8('0xd')]()==![]){return _0x2f48dc(_0x54ef2e[_0xf2c8('0x18')](0x1f4,[config['asterisk']['ip'],config[_0xf2c8('0xe')][_0xf2c8('0xf')],_0xf2c8('0x10')][_0xf2c8('0x11')]('\x20')));}var _0x48f6b9=schema(properties[_0xf2c8('0x76')])[_0xf2c8('0x5a')](_0x5936cd);if(_0x48f6b9['length']>0x0){return _0x2f48dc(_0x54ef2e['error'](0x1f4,_[_0xf2c8('0x74')](_0x48f6b9,_0xf2c8('0x19'))[_0xf2c8('0x11')](',\x20')));}var _0x4d2686=_[_0xf2c8('0x55')](_0x2581a1[_0xf2c8('0x72')],{'uniqueid':_0x5936cd[_0xf2c8('0x5b')]});if(_0x4d2686&&_0x4d2686['channel']){return ami[_0xf2c8('0x16')]({'action':_0xf2c8('0x77'),'channel':_0x4d2686[_0xf2c8('0x6b')],'exten':_0x5936cd[_0xf2c8('0x78')],'context':_0x5936cd[_0xf2c8('0x79')]||_0x4d2686[_0xf2c8('0x79')],'priority':0x1})['then'](function(_0xb8f09c){_0x34989a({'code':0xc8,'message':[_0x5936cd[_0xf2c8('0x5b')],_0xb8f09c[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')});})[_0xf2c8('0x1c')](function(_0x5eedb2){_0x2f48dc(_0x54ef2e[_0xf2c8('0x18')](0x1f5,[_0x5936cd[_0xf2c8('0x5b')],_0x5eedb2[_0xf2c8('0x19')][_0xf2c8('0x62')]()][_0xf2c8('0x11')]('\x20')));});}else{return _0x2f48dc(_0x54ef2e['error'](0x1f5,_0xf2c8('0x69')));}});},'Agents':function(_0x4766a7){return new Promise(function(_0x268480,_0x5e07cf){var _0x45428c=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0xa')]);_0x268480({'count':_0x45428c[_0xf2c8('0x54')],'rows':_0x45428c});});},'Telephones':function(_0x3d6b14){return new Promise(function(_0x535ef0,_0x5e9f26){var _0x2b1939=_['values'](_0x2581a1[_0xf2c8('0x7a')]);_0x535ef0({'count':_0x2b1939[_0xf2c8('0x54')],'rows':_0x2b1939});});},'Trunks':function(_0x295f52){return new Promise(function(_0x48e8ee,_0x30c823){var _0x22ce8f=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7b')]);_0x48e8ee({'count':_0x22ce8f[_0xf2c8('0x54')],'rows':_0x22ce8f});});},'OutboundChannels':function(_0x1cf5fa){return new Promise(function(_0x8acd72,_0x33d312){var _0x1c4a85=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7c')]);_0x8acd72({'count':_0x1c4a85['length'],'rows':_0x1c4a85});});},'Outbound':function(_0x558303){return new Promise(function(_0x17352c,_0x415424){_0x17352c(_0x2581a1[_0xf2c8('0x2b')]);});},'Campaigns':function(_0x1f679f){return new Promise(function(_0x462f32,_0xa20ca3){var _0x176186=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x7d')]);_0x462f32({'count':_0x176186[_0xf2c8('0x54')],'rows':_0x176186});});},'VoiceQueuesPreview':function(_0x3d9947){var _0x3c822e=this;return new Promise(function(_0x1912e2,_0x6b1ec){_0x34f179[_0xf2c8('0x7e')](_0x3d9947['id'])['then'](function(_0x4455b3){_0x1912e2({'code':0xc8,'message':_0x4455b3[_0xf2c8('0x19')]});})[_0xf2c8('0x1c')](function(_0xe80749){_0x6b1ec(_0x3c822e[_0xf2c8('0x18')](0x1f4,_0xe80749[_0xf2c8('0x19')]));});});},'EventManager':function(_0x3f94f2){var _0x17e707=this;return new Promise(function(_0x32dfa2,_0x40cfac){if(!_0x3f94f2['event']){return _0x40cfac(_0x17e707[_0xf2c8('0x18')](0x1f4,_0xf2c8('0x7f')));}ami[_0xf2c8('0x80')]('custom:'+_0x3f94f2[_0xf2c8('0x81')],_0x3f94f2[_0xf2c8('0x19')]);_0x32dfa2({'code':0xc8,'message':_0x3f94f2});});},'FaxAccounts':function(_0x13fecc){return new Promise(function(_0x2d32d3,_0x4762e1){var _0x25e0e4=_[_0xf2c8('0x71')](_0x2581a1[_0xf2c8('0x82')]);_0x2d32d3({'count':_0x25e0e4[_0xf2c8('0x54')],'rows':_0x25e0e4});});},'SendFax':function(_0x182fbf){var _0x1169c4=this;return new Promise(function(_0x24759b,_0x480d25){_0x182b73['send'](_0x182fbf)[_0xf2c8('0x17')](function(_0x3299af){_0x24759b({'code':0xc8,'message':_0x3299af[_0xf2c8('0x19')]});})['catch'](function(_0x271c5c){_0x480d25(_0x1169c4[_0xf2c8('0x18')](0x1f4,_0x271c5c['message']));});});},'CheckAfterSend':function(_0x55ae62){var _0x56ec66=this;return new Promise(function(_0x5a1204,_0x111746){_0x182b73[_0xf2c8('0x83')](_0x55ae62)[_0xf2c8('0x17')](function(_0x1f55e5){_0x5a1204({'code':0xc8,'message':_0x1f55e5[_0xf2c8('0x19')]});})[_0xf2c8('0x1c')](function(_0x41d22e){_0x111746(_0x56ec66['error'](0x1f4,_0x41d22e[_0xf2c8('0x19')]));});});}};var _0x346a11=jayson[_0xf2c8('0x84')](_0x4eae22)[_0xf2c8('0x85')]();_0x346a11['on'](_0xf2c8('0x18'),function(_0x49ddc1){return _0x2785ee(_0x49ddc1);});_0x346a11[_0xf2c8('0x86')](0x232a,_0xf2c8('0x87'),function(){console[_0xf2c8('0x88')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3ad7a0('RPC\x20listening\x20on\x20port:'+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 175e511..0cfe4c0 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 _0xb903=['data1','data2','data5','xmd-contactid','data3','split','phone','destcalleridnum','calleridnum','firstName','fax','ListId','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','Unknown','destcalleridname','push','user:%s','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info'];(function(_0x2ab7a5,_0x8becb3){var _0x5ddff7=function(_0x1fdfea){while(--_0x1fdfea){_0x2ab7a5['push'](_0x2ab7a5['shift']());}};_0x5ddff7(++_0x8becb3);}(_0xb903,0x185));var _0x3b90=function(_0x5b72a2,_0x543e9e){_0x5b72a2=_0x5b72a2-0x0;var _0x249d4d=_0xb903[_0x5b72a2];return _0x249d4d;};'use strict';var _=require(_0x3b90('0x0'));var BPromise=require(_0x3b90('0x1'));var Redis=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3b90('0x4'))(_0x3b90('0x5'));var cmContactRpc=require(_0x3b90('0x6'));config[_0x3b90('0x7')]=_[_0x3b90('0x8')](config[_0x3b90('0x7')],{'host':_0x3b90('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b90('0x7')]));function emit(_0x5e845a,_0x55792c,_0x153283,_0x2e4c06,_0x42efe8){logger[_0x3b90('0xa')]('[CM][%s][%s]',_0x5e845a,_0x55792c['id'],_0x153283,_0x2e4c06,JSON['stringify'](_0x42efe8));io['to'](_0x153283)['emit'](_0x2e4c06,_0x42efe8);}exports['exec']=function(_0x56261b,_0x55db3f,_0x336913,_0x5af39c){var _0x574955,_0x30c49c;var _0x233509={};var _0x4bb8f4=Number(_0x336913[_0x3b90('0xb')]);var _0x174c0d=_0x336913[_0x3b90('0xc')]?Boolean(Number(_0x336913['data2'])):![];var _0x5447df;var _0x58c4d1=![];if(!_['isNil'](_0x336913['data5'])){if(_0x336913[_0x3b90('0xd')]=='1')_0x58c4d1=!![];}if(!_0x58c4d1){if(_0x5af39c[_0x3b90('0xe')]){_0x233509['id']=_0x5af39c['xmd-contactid'];}}if(!_0x233509['id']){_0x233509['ListId']=_0x4bb8f4;_0x5447df=_0x336913[_0x3b90('0xf')]&&_0x336913[_0x3b90('0xf')]!=='0'?_0x336913[_0x3b90('0xf')][_0x3b90('0x10')](','):[_0x3b90('0x11')];_0x233509['$or']=_['map'](_0x5447df,function(_0xd83280){var _0x5420dc={};_0x5420dc[_0xd83280]=_0x5af39c['routeId']?_0x5af39c[_0x3b90('0x12')]:_0x5af39c[_0x3b90('0x13')];return _0x5420dc;});}var _0x11ad7d=['id',_0x3b90('0x14'),'lastName',_0x3b90('0x11'),'mobile',_0x3b90('0x15'),_0x3b90('0x16'),'createdAt',_0x3b90('0x17'),_0x3b90('0x18')];var _0x3642c0=_[_0x3b90('0x19')](_0x11ad7d,_0x5447df);BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc[_0x3b90('0x1c')]({'attributes':_0x3642c0,'where':_0x233509}))[_0x3b90('0x1b')](function(_0xa98414){_0x30c49c=_0xa98414;if(!_[_0x3b90('0x1d')](_0x30c49c)){if(_0x30c49c['length']===0x1){_0x574955=_0x30c49c[0x0];logger[_0x3b90('0xa')](_0x3b90('0x1e'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}else{logger[_0x3b90('0xa')](_0x3b90('0x20'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_['map'](_0x30c49c,'id')['join'](','));}return;}else{logger[_0x3b90('0xa')](_0x3b90('0x21'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);var _0x2ffa1a={'ListId':_0x4bb8f4};var _0x583523=_0x336913[_0x3b90('0x22')]&&_0x336913[_0x3b90('0x22')]!=='0'?_0x336913[_0x3b90('0x22')]:'phone';if(_0x174c0d){logger[_0x3b90('0xa')](_0x3b90('0x23'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c[_0x3b90('0x25')])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c['destcalleridnum'];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:_0x3b90('0x28');}else{_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c['destcalleridname']!==''?_0x5af39c[_0x3b90('0x29')]:_0x3b90('0x28');}return BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc['createContact'](_0x2ffa1a))['then'](function(_0xd33ac9){_0x574955=_0xd33ac9;_0x30c49c[_0x3b90('0x2a')](_0xd33ac9);if(_0x574955){logger[_0x3b90('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c['routeId'])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c[_0x3b90('0x12')];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:'Unknown';}else{_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c[_0x3b90('0x29')]!==''?_0x5af39c['destcalleridname']:_0x3b90('0x28');}_0x574955=_0x2ffa1a;_0x30c49c[_0x3b90('0x2a')](_0x2ffa1a);return;}}})[_0x3b90('0x1b')](function(){if(_0x56261b){emit(_0x5af39c[_0x3b90('0x1f')],_0x55db3f,util['format'](_0x3b90('0x2b'),_0x56261b['name']),util[_0x3b90('0x2c')](_0x3b90('0x2d'),_0x336913[_0x3b90('0x2e')][_0x3b90('0x2f')]()),{'evt':_[_0x3b90('0x30')](_0x5af39c,{'autoCreate':_0x174c0d}),'contact':_0x574955===undefined?{}:_0x574955,'contacts':_0x30c49c[_0x3b90('0x31')]===0x0?undefined:_0x30c49c});}});}; \ No newline at end of file +var _0xf3cd=['isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','getContacts','then'];(function(_0x4c591b,_0xfe9e8d){var _0x2ce050=function(_0x2cd0f3){while(--_0x2cd0f3){_0x4c591b['push'](_0x4c591b['shift']());}};_0x2ce050(++_0xfe9e8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4abab9,_0xde21a4){_0x4abab9=_0x4abab9-0x0;var _0x374eba=_0xf3cd[_0x4abab9];return _0x374eba;};'use strict';var _=require(_0xdf3c('0x0'));var BPromise=require(_0xdf3c('0x1'));var Redis=require(_0xdf3c('0x2'));var util=require(_0xdf3c('0x3'));var config=require(_0xdf3c('0x4'));var logger=require(_0xdf3c('0x5'))('trigger');var cmContactRpc=require(_0xdf3c('0x6'));config[_0xdf3c('0x7')]=_[_0xdf3c('0x8')](config['redis'],{'host':_0xdf3c('0x9'),'port':0x18eb});var io=require(_0xdf3c('0xa'))(new Redis(config[_0xdf3c('0x7')]));function emit(_0x1f0601,_0x106021,_0x28edae,_0x52c073,_0x15705d){logger['info']('[CM][%s][%s]',_0x1f0601,_0x106021['id'],_0x28edae,_0x52c073,JSON[_0xdf3c('0xb')](_0x15705d));io['to'](_0x28edae)[_0xdf3c('0xc')](_0x52c073,_0x15705d);}exports['exec']=function(_0x1dba4c,_0x205f33,_0x2d420c,_0x21a6e5){var _0x3a3154,_0x1c456b;var _0xf7da9d={};var _0x32d2db=Number(_0x2d420c['data1']);var _0x1d483c=_0x2d420c[_0xdf3c('0xd')]?Boolean(Number(_0x2d420c[_0xdf3c('0xd')])):![];var _0x17319c;var _0x59e431=![];if(!_[_0xdf3c('0xe')](_0x2d420c[_0xdf3c('0xf')])){if(_0x2d420c[_0xdf3c('0xf')]=='1')_0x59e431=!![];}if(!_0x59e431){if(_0x21a6e5['xmd-contactid']){_0xf7da9d['id']=_0x21a6e5[_0xdf3c('0x10')];}}if(!_0xf7da9d['id']){_0xf7da9d[_0xdf3c('0x11')]=_0x32d2db;_0x17319c=_0x2d420c[_0xdf3c('0x12')]&&_0x2d420c[_0xdf3c('0x12')]!=='0'?_0x2d420c[_0xdf3c('0x12')][_0xdf3c('0x13')](','):[_0xdf3c('0x14')];_0xf7da9d[_0xdf3c('0x15')]=_[_0xdf3c('0x16')](_0x17319c,function(_0x5d3991){var _0x54cdd4={};_0x54cdd4[_0x5d3991]=_0x21a6e5[_0xdf3c('0x17')]?_0x21a6e5[_0xdf3c('0x18')]:_0x21a6e5[_0xdf3c('0x19')];return _0x54cdd4;});}var _0x18d4ec=['id',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x14'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),_0xdf3c('0x11'),_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20')];var _0x5d2390=_['union'](_0x18d4ec,_0x17319c);BPromise[_0xdf3c('0x21')]()['then'](cmContactRpc[_0xdf3c('0x22')]({'attributes':_0x5d2390,'where':_0xf7da9d}))[_0xdf3c('0x23')](function(_0x36552e){_0x1c456b=_0x36552e;if(!_[_0xdf3c('0x24')](_0x1c456b)){if(_0x1c456b[_0xdf3c('0x25')]===0x1){_0x3a3154=_0x1c456b[0x0];logger[_0xdf3c('0x26')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}else{logger[_0xdf3c('0x26')](_0xdf3c('0x28'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_[_0xdf3c('0x16')](_0x1c456b,'id')[_0xdf3c('0x29')](','));}return;}else{logger[_0xdf3c('0x26')](_0xdf3c('0x2a'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id']);var _0x1adee4={'ListId':_0x32d2db};var _0x4c076c=_0x2d420c[_0xdf3c('0x2b')]&&_0x2d420c[_0xdf3c('0x2b')]!=='0'?_0x2d420c['data4']:_0xdf3c('0x14');if(_0x1d483c){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5['calleridnum']:_0x21a6e5['destcalleridnum'];if(_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5[_0xdf3c('0x2c')]&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2c')]:'Unknown';}else{_0x1adee4['firstName']=_0x21a6e5[_0xdf3c('0x2e')]&&_0x21a6e5[_0xdf3c('0x2e')]!==_0xdf3c('0x2d')?_0x21a6e5['destcalleridname']:_0xdf3c('0x2f');}return BPromise[_0xdf3c('0x21')]()[_0xdf3c('0x23')](cmContactRpc[_0xdf3c('0x30')](_0x1adee4))['then'](function(_0xda0de0){_0x3a3154=_0xda0de0;_0x1c456b[_0xdf3c('0x31')](_0xda0de0);if(_0x3a3154){logger['info'](_0xdf3c('0x32'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}return;});}else{logger[_0xdf3c('0x26')](_0xdf3c('0x33'),_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5[_0xdf3c('0x19')]:_0x21a6e5[_0xdf3c('0x18')];if(_['isNil'](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5['calleridname']&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5['calleridname']:_0xdf3c('0x2f');}else{_0x1adee4['firstName']=_0x21a6e5['destcalleridname']&&_0x21a6e5['destcalleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2e')]:_0xdf3c('0x2f');}_0x3a3154=_0x1adee4;_0x1c456b[_0xdf3c('0x31')](_0x1adee4);return;}}})['then'](function(){if(_0x1dba4c){emit(_0x21a6e5['uniqueid'],_0x205f33,util[_0xdf3c('0x34')]('user:%s',_0x1dba4c[_0xdf3c('0x35')]),util[_0xdf3c('0x34')](_0xdf3c('0x36'),_0x2d420c[_0xdf3c('0x37')][_0xdf3c('0x38')]()),{'evt':_[_0xdf3c('0x39')](_0x21a6e5,{'autoCreate':_0x1d483c}),'contact':_0x3a3154===undefined?{}:_0x3a3154,'contacts':_0x1c456b[_0xdf3c('0x25')]===0x0?undefined:_0x1c456b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index ecb8634..faba9f8 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 _0x8d08=['custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','emit','info','prototype','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','600','winApplication','render','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','util','lodash','url','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','dynamics365Accounts'];(function(_0x311994,_0x4ac9c7){var _0x35a89c=function(_0xfc1549){while(--_0xfc1549){_0x311994['push'](_0x311994['shift']());}};_0x35a89c(++_0x4ac9c7);}(_0x8d08,0x1c9));var _0x88d0=function(_0x4573bd,_0x19b9b5){_0x4573bd=_0x4573bd-0x0;var _0xc07bb9=_0x8d08[_0x4573bd];return _0xc07bb9;};'use strict';var util=require(_0x88d0('0x0'));var _=require(_0x88d0('0x1'));var url=require(_0x88d0('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x88d0('0x3'));var integration=require(_0x88d0('0x4'));var cmContact=require(_0x88d0('0x5'));var script=require(_0x88d0('0x6'));var config=require(_0x88d0('0x7'));var logger=require(_0x88d0('0x8'))(_0x88d0('0x9'));var ami=require('../ami');config[_0x88d0('0xa')]=_[_0x88d0('0xb')](config['redis'],{'host':_0x88d0('0xc'),'port':0x18eb});var io=require(_0x88d0('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x236ef7,_0x235bd4){return _0x236ef7==_0x235bd4;},'not_equals':function(_0x2b2188,_0x45f389){return _0x2b2188!=_0x45f389;}};var barAndWebActions=[_0x88d0('0xe'),_0x88d0('0x2'),_0x88d0('0xf')];function Trigger(_0x5765b9){this['triggers']=_0x5765b9[_0x88d0('0x10')];this['agents']=_0x5765b9[_0x88d0('0x11')];this[_0x88d0('0x12')]=_0x5765b9[_0x88d0('0x12')];this['templates']=_0x5765b9[_0x88d0('0x13')];this[_0x88d0('0x14')]=_0x5765b9[_0x88d0('0x14')];this['zendeskAccounts']=_0x5765b9[_0x88d0('0x15')];this[_0x88d0('0x16')]=_0x5765b9['freshdeskAccounts'];this['salesforceAccounts']=_0x5765b9[_0x88d0('0x17')];this[_0x88d0('0x18')]=_0x5765b9[_0x88d0('0x18')];this['zohoAccounts']=_0x5765b9[_0x88d0('0x19')];this['deskAccounts']=_0x5765b9['deskAccounts'];this['vtigerAccounts']=_0x5765b9[_0x88d0('0x1a')];this[_0x88d0('0x1b')]=_0x5765b9[_0x88d0('0x1b')];this['dynamics365Accounts']=_0x5765b9['dynamics365Accounts'];this[_0x88d0('0x1c')]=_0x5765b9[_0x88d0('0x1c')];this[_0x88d0('0x1d')]={'zendesk':this[_0x88d0('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x88d0('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x88d0('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0x88d0('0x1a')],'dynamics365':this[_0x88d0('0x1e')],'freshsales':this[_0x88d0('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x88d0('0x1f'),this[_0x88d0('0x20')]['bind'](this));ami['on']('custom:agentconnect',this[_0x88d0('0x20')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x22'),this['syncCustomEvent'][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x23'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x24'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x25'),this['syncCustomEvent'][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x26'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x27'),this[_0x88d0('0x20')]['bind'](this));ami['on'](_0x88d0('0x28'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x29'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x2a'),this['syncCustomEvent'][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x2b'),this['syncAgentDial'][_0x88d0('0x21')](this));ami['on']('custom:dialconnect',this[_0x88d0('0x2c')]['bind'](this));ami['on'](_0x88d0('0x2d'),this[_0x88d0('0x2c')][_0x88d0('0x21')](this));ami['on']('custom:newinteraction',this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x2e'),this['syncCustomEvent'][_0x88d0('0x21')](this));ami['on']('custom:substatus',this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x2f'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x30'),this['syncCustomEvent'][_0x88d0('0x21')](this));ami['on'](_0x88d0('0x31'),this[_0x88d0('0x20')][_0x88d0('0x21')](this));ami['on']('custom:rejectmessage',this[_0x88d0('0x20')][_0x88d0('0x21')](this));}Trigger['prototype'][_0x88d0('0x32')]=function(_0x549a7d,_0x2776e2,_0x26a5a1){logger[_0x88d0('0x33')](_0x549a7d,_0x2776e2,JSON['stringify'](_0x26a5a1));io['to'](_0x549a7d)[_0x88d0('0x32')](_0x2776e2,_0x26a5a1);};Trigger[_0x88d0('0x34')]['syncCustomEvent']=function(_0x3d00d2){var _0x4d8415=_['clone'](_0x3d00d2);if(typeof _0x4d8415[_0x88d0('0x35')]===_0x88d0('0x36')){_0x4d8415[_0x88d0('0x35')]=_0x88d0('0x37');}this['checkTriggers'](_0x4d8415);};Trigger[_0x88d0('0x34')][_0x88d0('0x2c')]=function(_0x392b88){if(this[_0x88d0('0x11')][_0x392b88['interface']]){this[_0x88d0('0x20')](_0x392b88);}};Trigger[_0x88d0('0x34')][_0x88d0('0x38')]=function(_0x27d79b){var _0x1f88f4;for(var _0x19bb62 in this[_0x88d0('0x10')]){if(this['triggers'][_0x88d0('0x39')](_0x19bb62)){if(this[_0x88d0('0x10')][_0x19bb62]['status']){_0x1f88f4=this[_0x88d0('0x3a')](this['triggers'][_0x19bb62],_0x27d79b);if(_0x1f88f4){_[_0x88d0('0x3b')](_0x27d79b,_0x27d79b['variables']);for(var _0x17b61a=0x0,_0x2dc8ee,_0x5c5cd7,_0x40fd57;_0x17b61a0x0){_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 _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x5fc3[_0x3e6d5d];return _0x238923;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 88586a8..f53b8ec 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 _0x6dc7=['monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','name','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','4.0','telephone1','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x908d46,_0x17ebd9){var _0x149816=function(_0x5dfcbb){while(--_0x5dfcbb){_0x908d46['push'](_0x908d46['shift']());}};_0x149816(++_0x17ebd9);}(_0x6dc7,0x147));var _0x76dc=function(_0x4faf96,_0x1db35c){_0x4faf96=_0x4faf96-0x0;var _0x28ff12=_0x6dc7[_0x4faf96];return _0x28ff12;};'use strict';var _=require(_0x76dc('0x0'));var BPromise=require(_0x76dc('0x1'));var rp=require(_0x76dc('0x2'));var util=require(_0x76dc('0x3'));var intUtil=require(_0x76dc('0x4'));var md5=require('md5');var Redis=require(_0x76dc('0x5'));var logger=require(_0x76dc('0x6'))(_0x76dc('0x7'));var config=require(_0x76dc('0x8'));config[_0x76dc('0x9')]=_[_0x76dc('0xa')](config[_0x76dc('0x9')],{'host':_0x76dc('0xb'),'port':0x18eb});var io=require(_0x76dc('0xc'))(new Redis(config[_0x76dc('0x9')]));function getAuthToken(_0x3801d1,_0x1964c9,_0x573fcf){var _0x19b98b={'method':_0x76dc('0xd'),'uri':_0x1964c9,'form':{'client_id':_0x3801d1[_0x76dc('0xe')],'resource':_0x3801d1['remoteUri'],'username':_0x3801d1['username'],'password':_0x3801d1[_0x76dc('0xf')],'grant_type':'password','client_secret':_0x3801d1[_0x76dc('0x10')]},'json':!![]};return rp(_0x19b98b)[_0x76dc('0x11')](function(_0x1cff73){return _0x1cff73[_0x76dc('0x12')];})['catch'](function(_0x3ab888){logger[_0x76dc('0x13')]('['+[_0x573fcf[_0x76dc('0x14')]()]+_0x76dc('0x15'));return _0x3ab888[_0x76dc('0x16')];});}function getUser(_0x496335,_0x2a079b,_0x2e78a1,_0x4cf68f,_0x9f6a05,_0x583992){return new BPromise(function(_0x45cee7,_0x587e3c){return getAuthToken(_0x2a079b,_0x4cf68f,_0x583992)[_0x76dc('0x11')](function(_0xd6890f){var _0x590dbb={'method':'GET','uri':_0x9f6a05+_0x76dc('0x17'),'headers':{'Authorization':_0x76dc('0x18')+_0xd6890f,'OData-Version':'4.0'},'json':!![]};return rp(_0x590dbb);})[_0x76dc('0x11')](function(_0x2a7a11){var _0x190ce0=_0x2a7a11[_0x76dc('0x19')];var _0x5288c2=![];var _0x2a886d=null;if(!_[_0x76dc('0x1a')](_0x2e78a1)){if(intUtil['validateEmail'](_0x2e78a1[_0x76dc('0x1b')])){_0x496335[_0x76dc('0x1c')]=_0x2e78a1[_0x76dc('0x1b')];for(_0x2a886d=0x0;_0x2a886d<_0x190ce0[_0x76dc('0x1d')];_0x2a886d++){if(_0x190ce0[_0x2a886d][_0x76dc('0x1e')]===_0x2e78a1[_0x76dc('0x1b')]&&!_0x190ce0[_0x2a886d][_0x76dc('0x1f')]){_0x5288c2=!![];logger[_0x76dc('0x20')]('['+[_0x583992[_0x76dc('0x14')]()]+']\x20Agent\x20found\x20'+_0x190ce0[_0x2a886d]['systemuserid']+'!');_0x496335[_0x76dc('0x21')]=_0x190ce0[_0x2a886d][_0x76dc('0x22')];}}}}if(!_0x5288c2){logger[_0x76dc('0x20')]('['+[_0x583992[_0x76dc('0x14')]()]+_0x76dc('0x23'));_0x496335['userEmail']=_0x2a079b[_0x76dc('0x24')];for(_0x2a886d=0x0;_0x2a886d<_0x190ce0[_0x76dc('0x1d')];_0x2a886d++){if(_0x190ce0[_0x2a886d][_0x76dc('0x1e')]===_0x2a079b[_0x76dc('0x24')]){_0x496335[_0x76dc('0x21')]=_0x190ce0[_0x2a886d][_0x76dc('0x22')];}}}_0x45cee7(_0x496335);})[_0x76dc('0x25')](function(_0x1354e1){_0x587e3c(_0x1354e1[_0x76dc('0x16')]);});});}function createEndUser(_0x498f52,_0x44d223,_0x1660f9,_0x4cd975,_0x225b08,_0x43694a){return new BPromise(function(_0x218cc6,_0x20c43a){return getAuthToken(_0x44d223,_0x1660f9,_0x43694a)[_0x76dc('0x11')](function(_0x59ea09){var _0x489ac6=_0x43694a['toLowerCase']()===_0x76dc('0x26')?_0x225b08['destcalleridnum']:_0x225b08[_0x76dc('0x27')];var _0xf857eb={'method':_0x76dc('0xd'),'uri':_0x4cd975+_0x76dc('0x28'),'body':{'telephone1':_0x489ac6,'fullname':_0x489ac6,'firstname':_0x489ac6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x76dc('0x29')+_0x498f52[_0x76dc('0x21')]+')'},'headers':{'Authorization':_0x76dc('0x18')+_0x59ea09,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf857eb);})[_0x76dc('0x11')](function(_0xfa0736){var _0x42996d=_0xfa0736[_0x76dc('0x2a')][_0x76dc('0x2b')];var _0x462d9b=_0x42996d[_0x76dc('0x2c')](_0x42996d['lastIndexOf']('(')+0x1,_0x42996d[_0x76dc('0x2d')](')'));_0x498f52[_0x76dc('0x2e')]=_0x462d9b;_0x218cc6(_0x498f52);})[_0x76dc('0x25')](function(_0x3bf30a){_0x20c43a(_0x3bf30a['message']);});});}function getEndUser(_0x512f9f,_0x325dbb,_0x402285,_0x4cd020,_0xfaef33,_0x4eda75,_0x4d564c){var _0x17295b=_0x4eda75[_0x76dc('0x2f')]()===_0x76dc('0x26')?_0xfaef33[_0x76dc('0x30')]:_0xfaef33['calleridnum'];return getAuthToken(_0x325dbb,_0x402285,_0x4eda75)[_0x76dc('0x11')](function(_0x263e0e){var _0x40e5e8={'method':_0x76dc('0x31'),'uri':_0x4cd020+_0x76dc('0x32')+_0x17295b[_0x76dc('0x33')]('+',_0x76dc('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x263e0e,'If-None-Match':null,'OData-Version':_0x76dc('0x35')},'json':!![]};return rp(_0x40e5e8);})[_0x76dc('0x11')](function(_0x535391){var _0x2fff97=![];if(!_0x535391)return _0x2fff97;var _0x4c71e9=_0x535391[_0x76dc('0x19')];for(var _0x4ca1cc=0x0;_0x4ca1cc<_0x4c71e9[_0x76dc('0x1d')];_0x4ca1cc++){if(_0x4c71e9[_0x4ca1cc][_0x76dc('0x36')]===_0x17295b){_0x2fff97=!![];_0x512f9f[_0x76dc('0x2e')]=_0x4c71e9[_0x4ca1cc]['contactid'];}}return _0x2fff97;})[_0x76dc('0x11')](function(_0x401e8b){if(_0x401e8b)return _0x512f9f;if(_0x4d564c===_0x76dc('0x37')){logger['info']('['+[_0x4eda75['toUpperCase']()]+_0x76dc('0x38'));return _0x512f9f;}return createEndUser(_0x512f9f,_0x325dbb,_0x402285,_0x4cd020,_0xfaef33,_0x4eda75)[_0x76dc('0x11')](function(_0xc0533){logger['info']('['+[_0x4eda75[_0x76dc('0x14')]()]+_0x76dc('0x39'),_0xc0533['enduserId']);return _0xc0533;});});}function getCustomFields(_0x8ebc0e,_0x5d2f66,_0x18085a){var _0x10486d={};if(_0x8ebc0e[_0x76dc('0x1d')]>0x0){_[_0x76dc('0x3a')](_0x8ebc0e,function(_0x28d14f){if(_[_0x76dc('0x3b')]([_0x76dc('0x3c'),'picklist'],_0x28d14f[_0x76dc('0x3d')])&&_0x28d14f['nameField']&&!_0x28d14f[_0x76dc('0x3e')]){var _0x29b550=_0x28d14f[_0x76dc('0x3f')]['toLowerCase']();var _0x38588b=_0x29b550['substring'](0x0,_0x29b550[_0x76dc('0x40')]('_'));var _0x333e7f=_0x29b550[_0x76dc('0x2c')](_0x29b550[_0x76dc('0x40')]('_')+0x1);if(_0x38588b===_0x18085a){_0x10486d[_0x333e7f]=_0x28d14f[_0x76dc('0x41')];}}});}return _0x10486d;}function getTicket(_0x47c80c,_0x279843,_0x107cd4,_0x52fb2d,_0x1c0c37,_0xdd44b9,_0x28d9a1){return new BPromise(function(_0x5150f3,_0x5c53d3){var _0x58db49;return getAuthToken(_0x279843,_0x107cd4,_0x28d9a1)[_0x76dc('0x11')](function(_0x24a7fd){if(_0xdd44b9[_0x76dc('0x42')]===_0x76dc('0x43')){_0x58db49={'method':_0x76dc('0xd'),'uri':_0x52fb2d+_0x76dc('0x44'),'body':Object[_0x76dc('0x45')]({},{'title':intUtil[_0x76dc('0x46')](_0xdd44b9[_0x76dc('0x47')],_0x1c0c37,'\x20'),'description':intUtil[_0x76dc('0x46')](_0xdd44b9[_0x76dc('0x48')],_0x1c0c37,'\x0a'),'customerid_contact@odata.bind':_0x47c80c[_0x76dc('0x2e')]?_0x76dc('0x49')+_0x47c80c[_0x76dc('0x2e')]+')':undefined,'ownerid@odata.bind':_0x76dc('0x29')+_0x47c80c[_0x76dc('0x21')]+')','caseorigincode':'1'},getCustomFields(_0xdd44b9[_0x76dc('0x4a')],_0x1c0c37,_0xdd44b9[_0x76dc('0x42')])),'headers':{'Authorization':_0x76dc('0x18')+_0x24a7fd,'OData-Version':_0x76dc('0x35')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xdd44b9[_0x76dc('0x42')]===_0x76dc('0x4b')){var _0x3f4f1b=_0x47c80c[_0x76dc('0x2e')]?[{'partyid_systemuser@odata.bind':_0x76dc('0x29')+_0x47c80c[_0x76dc('0x21')]+')','participationtypemask':_0x47c80c[_0x76dc('0x4c')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x76dc('0x49')+_0x47c80c[_0x76dc('0x2e')]+')','participationtypemask':_0x47c80c[_0x76dc('0x4c')]===_0x76dc('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x76dc('0x29')+_0x47c80c[_0x76dc('0x21')]+')','participationtypemask':_0x47c80c[_0x76dc('0x4c')]===_0x76dc('0x4d')?0x2:0x1}];_0x58db49={'method':_0x76dc('0xd'),'uri':_0x52fb2d+_0x76dc('0x4e'),'body':Object[_0x76dc('0x45')]({},{'subject':intUtil[_0x76dc('0x46')](_0xdd44b9['Subjects'],_0x1c0c37,'\x20'),'phonenumber':String(_0x1c0c37['calleridnum']),'description':intUtil['getString'](_0xdd44b9[_0x76dc('0x48')],_0x1c0c37,'\x0a'),'regardingobjectid_contact@odata.bind':_0x47c80c[_0x76dc('0x2e')]?_0x76dc('0x49')+_0x47c80c['enduserId']+')':undefined,'ownerid@odata.bind':_0x76dc('0x29')+_0x47c80c[_0x76dc('0x21')]+')','directioncode':_0x47c80c[_0x76dc('0x4c')]===_0x76dc('0x4d')?![]:!![],'phonecall_activity_parties':_0x3f4f1b},getCustomFields(_0xdd44b9['Fields'],_0x1c0c37,_0xdd44b9[_0x76dc('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x24a7fd,'OData-Version':_0x76dc('0x35')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x58db49);})[_0x76dc('0x11')](function(_0x21d7cf){var _0x443a42=_0x21d7cf['headers'][_0x76dc('0x2b')];var _0x409ba3=_0x443a42[_0x76dc('0x2c')](_0x443a42[_0x76dc('0x2d')]('(')+0x1,_0x443a42['lastIndexOf'](')'));_0x47c80c[_0x76dc('0x4f')]=_0x409ba3;_0x5150f3(_0x47c80c);})['catch'](function(_0x2ce14f){_0x5c53d3(_0x2ce14f[_0x76dc('0x16')]);});});}function emit(_0x5f18f6,_0x52379b,_0x344449,_0x594d46){var _0x2eeaf8={'uri':util[_0x76dc('0x50')](_0x76dc('0x51'),_0x5f18f6,_0x344449,_0x594d46)};io['to'](util[_0x76dc('0x50')](_0x76dc('0x52'),_0x52379b))[_0x76dc('0x53')](_0x76dc('0x54'),_0x2eeaf8);}exports['cs']=function(_0x24d523,_0x4b577a,_0x1d38f9,_0x11182e,_0x297e9a,_0x2424bc,_0x2e15a8,_0x4e1964){var _0xab504={};_0x2424bc[_0x76dc('0x55')]=intUtil[_0x76dc('0x56')](_0x2424bc[_0x76dc('0x55')]);_0x2424bc[_0x76dc('0x57')]=intUtil[_0x76dc('0x56')](_0x2424bc[_0x76dc('0x57')]);_0xab504[_0x76dc('0x4c')]=_0x4e1964===_0x76dc('0x4d')||_0x4e1964===_0x76dc('0x58')?'queue':'outbound';var _0x4a29f3=util[_0x76dc('0x50')](_0x76dc('0x59'),_0x2424bc[_0x76dc('0x55')]);var _0x3131ba=util[_0x76dc('0x50')](_0x76dc('0x5a'),_0x2424bc['tenantId']);var _0x15585b=util[_0x76dc('0x50')](_0x76dc('0x5b'),_0x2424bc[_0x76dc('0x57')],_0x4b577a[_0x76dc('0x5c')],md5(_0x4b577a[_0x76dc('0x5c')]));if(_0x297e9a&&_0x297e9a[_0x76dc('0x5d')]){logger[_0x76dc('0x20')](_0x76dc('0x5e'),'Recording\x20is\x20enabled!');_0x4b577a[_0x76dc('0x5f')]=_0x15585b;}else if(_0x2e15a8&&_0x2e15a8['recordingFormat']&&_0x2e15a8[_0x76dc('0x60')]!=='none'){logger['info'](_0x76dc('0x61'),_0x76dc('0x62'));_0x4b577a['recordingURL']=_0x15585b;}else{_0x4b577a[_0x76dc('0x5f')]='';}return getUser(_0xab504,_0x2424bc,_0x11182e,_0x3131ba,_0x4a29f3,_0x4e1964)[_0x76dc('0x11')](function(_0x15ef02){logger['info']('['+_0x4e1964['toUpperCase']()+_0x76dc('0x63'),_0x15ef02[_0x76dc('0x21')]);logger['info']('['+_0x4e1964[_0x76dc('0x14')]()+_0x76dc('0x64'),_0x15ef02[_0x76dc('0x1c')]);return getEndUser(_0x15ef02,_0x2424bc,_0x3131ba,_0x4a29f3,_0x4b577a,_0x4e1964,_0x1d38f9[_0x76dc('0x65')]);})['then'](function(_0x3a9b1d){logger['info']('['+_0x4e1964[_0x76dc('0x14')]()+_0x76dc('0x66'),_0x3a9b1d[_0x76dc('0x2e')]);logger[_0x76dc('0x20')]('['+_0x4e1964[_0x76dc('0x14')]()+_0x76dc('0x67'),_0x4b577a[_0x76dc('0x27')]);return getTicket(_0x3a9b1d,_0x2424bc,_0x3131ba,_0x4a29f3,_0x4b577a,_0x1d38f9,_0x4e1964);})['then'](function(_0x5b4068){logger['info'](util[_0x76dc('0x50')]('['+_0x4e1964[_0x76dc('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1d38f9[_0x76dc('0x42')],_0x5b4068['ticketId']));logger[_0x76dc('0x20')](util[_0x76dc('0x50')]('['+_0x4e1964[_0x76dc('0x14')]()+']\x20Call\x20direction:\x20%s',_0x4e1964));if(_0x4e1964!==_0x76dc('0x58')){logger['info']('['+_0x4e1964[_0x76dc('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2424bc[_0x76dc('0x55')],_0x11182e[_0x76dc('0x68')],_0x1d38f9[_0x76dc('0x42')],_0x5b4068['ticketId']);}})[_0x76dc('0x25')](function(_0x36c1f){logger[_0x76dc('0x13')]('['+_0x4e1964['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x36c1f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc781=['Fields','callDirection','queue','phonecalls','assign','Descriptions','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','../../../../config/logger','../../../../config/environment','redis','localhost','POST','remoteUri','username','password','clientSecret','then','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','catch','message','toLowerCase','outbound','destcalleridnum','contacts','headers','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','getString','Subjects','/contacts(','/systemusers('];(function(_0x4bf14a,_0x4a3732){var _0x5841e3=function(_0x51ff52){while(--_0x51ff52){_0x4bf14a['push'](_0x4bf14a['shift']());}};_0x5841e3(++_0x4a3732);}(_0xc781,0x14f));var _0x1c78=function(_0x415e6b,_0x543657){_0x415e6b=_0x415e6b-0x0;var _0x52444c=_0xc781[_0x415e6b];return _0x52444c;};'use strict';var _=require(_0x1c78('0x0'));var BPromise=require('bluebird');var rp=require(_0x1c78('0x1'));var util=require(_0x1c78('0x2'));var intUtil=require(_0x1c78('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x1c78('0x4'))('dynamics365');var config=require(_0x1c78('0x5'));config[_0x1c78('0x6')]=_['defaults'](config[_0x1c78('0x6')],{'host':_0x1c78('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1c78('0x6')]));function getAuthToken(_0x4535bc,_0x1ed22b,_0x100794){var _0x46a3ff={'method':_0x1c78('0x8'),'uri':_0x1ed22b,'form':{'client_id':_0x4535bc['clientId'],'resource':_0x4535bc[_0x1c78('0x9')],'username':_0x4535bc[_0x1c78('0xa')],'password':_0x4535bc[_0x1c78('0xb')],'grant_type':'password','client_secret':_0x4535bc[_0x1c78('0xc')]},'json':!![]};return rp(_0x46a3ff)[_0x1c78('0xd')](function(_0x5a14ce){return _0x5a14ce['access_token'];})['catch'](function(_0x1347a7){logger[_0x1c78('0xe')]('['+[_0x100794[_0x1c78('0xf')]()]+_0x1c78('0x10'));return _0x1347a7['message'];});}function getUser(_0x264838,_0x3d6cc2,_0x13bf0e,_0x37331c,_0x389f83,_0x31ebe1){return new BPromise(function(_0x1051c2,_0x1f683b){return getAuthToken(_0x3d6cc2,_0x37331c,_0x31ebe1)['then'](function(_0x5ce45e){var _0x9fadf={'method':_0x1c78('0x11'),'uri':_0x389f83+_0x1c78('0x12'),'headers':{'Authorization':_0x1c78('0x13')+_0x5ce45e,'OData-Version':_0x1c78('0x14')},'json':!![]};return rp(_0x9fadf);})['then'](function(_0x436b69){var _0x3d5531=_0x436b69['value'];var _0x2b6837=![];var _0x5a5faf=null;if(!_[_0x1c78('0x15')](_0x13bf0e)){if(intUtil[_0x1c78('0x16')](_0x13bf0e[_0x1c78('0x17')])){_0x264838[_0x1c78('0x18')]=_0x13bf0e['email'];for(_0x5a5faf=0x0;_0x5a5faf<_0x3d5531[_0x1c78('0x19')];_0x5a5faf++){if(_0x3d5531[_0x5a5faf][_0x1c78('0x1a')]===_0x13bf0e[_0x1c78('0x17')]&&!_0x3d5531[_0x5a5faf][_0x1c78('0x1b')]){_0x2b6837=!![];logger[_0x1c78('0x1c')]('['+[_0x31ebe1[_0x1c78('0xf')]()]+_0x1c78('0x1d')+_0x3d5531[_0x5a5faf]['systemuserid']+'!');_0x264838[_0x1c78('0x1e')]=_0x3d5531[_0x5a5faf][_0x1c78('0x1f')];}}}}if(!_0x2b6837){logger[_0x1c78('0x1c')]('['+[_0x31ebe1[_0x1c78('0xf')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x264838['userEmail']=_0x3d6cc2['username'];for(_0x5a5faf=0x0;_0x5a5faf<_0x3d5531[_0x1c78('0x19')];_0x5a5faf++){if(_0x3d5531[_0x5a5faf][_0x1c78('0x1a')]===_0x3d6cc2[_0x1c78('0xa')]){_0x264838[_0x1c78('0x1e')]=_0x3d5531[_0x5a5faf][_0x1c78('0x1f')];}}}_0x1051c2(_0x264838);})[_0x1c78('0x20')](function(_0x1b4141){_0x1f683b(_0x1b4141[_0x1c78('0x21')]);});});}function createEndUser(_0x5a167f,_0x5c4ccf,_0x34e495,_0x34398f,_0x205923,_0x5a2f98){return new BPromise(function(_0x36bd8b,_0x45466b){return getAuthToken(_0x5c4ccf,_0x34e495,_0x5a2f98)[_0x1c78('0xd')](function(_0x6005c1){var _0x8201fc=_0x5a2f98[_0x1c78('0x22')]()===_0x1c78('0x23')?_0x205923[_0x1c78('0x24')]:_0x205923['calleridnum'];var _0x2f1f79={'method':_0x1c78('0x8'),'uri':_0x34398f+_0x1c78('0x25'),'body':{'telephone1':_0x8201fc,'fullname':_0x8201fc,'firstname':_0x8201fc,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5a167f[_0x1c78('0x1e')]+')'},'headers':{'Authorization':_0x1c78('0x13')+_0x6005c1,'OData-Version':_0x1c78('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2f1f79);})[_0x1c78('0xd')](function(_0xfca282){var _0x840791=_0xfca282[_0x1c78('0x26')]['odata-entityid'];var _0x3328be=_0x840791['substring'](_0x840791['lastIndexOf']('(')+0x1,_0x840791[_0x1c78('0x27')](')'));_0x5a167f[_0x1c78('0x28')]=_0x3328be;_0x36bd8b(_0x5a167f);})[_0x1c78('0x20')](function(_0x429bbd){_0x45466b(_0x429bbd[_0x1c78('0x21')]);});});}function getEndUser(_0x1ef493,_0x3bcd73,_0x523588,_0x599c3f,_0x1cd52b,_0x27340f,_0x37267e){var _0x54f949=_0x27340f[_0x1c78('0x22')]()===_0x1c78('0x23')?_0x1cd52b[_0x1c78('0x24')]:_0x1cd52b[_0x1c78('0x29')];return getAuthToken(_0x3bcd73,_0x523588,_0x27340f)[_0x1c78('0xd')](function(_0x5145f8){var _0x2fb9f9={'method':_0x1c78('0x11'),'uri':_0x599c3f+_0x1c78('0x2a')+_0x54f949['replace']('+',_0x1c78('0x2b'))+'\x27','headers':{'Authorization':_0x1c78('0x13')+_0x5145f8,'If-None-Match':null,'OData-Version':_0x1c78('0x14')},'json':!![]};return rp(_0x2fb9f9);})['then'](function(_0x4807e0){var _0x4131bc=![];if(!_0x4807e0)return _0x4131bc;var _0x582e8f=_0x4807e0[_0x1c78('0x2c')];for(var _0x267669=0x0;_0x267669<_0x582e8f[_0x1c78('0x19')];_0x267669++){if(_0x582e8f[_0x267669]['telephone1']===_0x54f949){_0x4131bc=!![];_0x1ef493[_0x1c78('0x28')]=_0x582e8f[_0x267669][_0x1c78('0x2d')];}}return _0x4131bc;})['then'](function(_0x577cf1){if(_0x577cf1)return _0x1ef493;if(_0x37267e===_0x1c78('0x2e')){logger[_0x1c78('0x1c')]('['+[_0x27340f[_0x1c78('0xf')]()]+_0x1c78('0x2f'));return _0x1ef493;}return createEndUser(_0x1ef493,_0x3bcd73,_0x523588,_0x599c3f,_0x1cd52b,_0x27340f)['then'](function(_0x2650c8){logger['info']('['+[_0x27340f[_0x1c78('0xf')]()]+_0x1c78('0x30'),_0x2650c8['enduserId']);return _0x2650c8;});});}function getCustomFields(_0x60656e,_0x29573a,_0x56c7da){var _0x10dee0={};if(_0x60656e[_0x1c78('0x19')]>0x0){_[_0x1c78('0x31')](_0x60656e,function(_0x5c3725){if(_[_0x1c78('0x32')]([_0x1c78('0x33'),'picklist'],_0x5c3725[_0x1c78('0x34')])&&_0x5c3725[_0x1c78('0x35')]&&!_0x5c3725[_0x1c78('0x36')]){var _0x2f5478=_0x5c3725[_0x1c78('0x37')][_0x1c78('0x22')]();var _0x3f2629=_0x2f5478['substring'](0x0,_0x2f5478['indexOf']('_'));var _0x3fe9bb=_0x2f5478[_0x1c78('0x38')](_0x2f5478[_0x1c78('0x39')]('_')+0x1);if(_0x3f2629===_0x56c7da){_0x10dee0[_0x3fe9bb]=_0x5c3725[_0x1c78('0x3a')];}}});}return _0x10dee0;}function getTicket(_0x13a225,_0x1779c6,_0x39b89d,_0x3280ca,_0x3d2a6b,_0x5b6349,_0x2fa857){return new BPromise(function(_0x5b9de0,_0x30c2a2){var _0x13b9e5;return getAuthToken(_0x1779c6,_0x39b89d,_0x2fa857)[_0x1c78('0xd')](function(_0xd36405){if(_0x5b6349[_0x1c78('0x3b')]===_0x1c78('0x3c')){_0x13b9e5={'method':_0x1c78('0x8'),'uri':_0x3280ca+'incidents','body':Object['assign']({},{'title':intUtil[_0x1c78('0x3d')](_0x5b6349[_0x1c78('0x3e')],_0x3d2a6b,'\x20'),'description':intUtil[_0x1c78('0x3d')](_0x5b6349['Descriptions'],_0x3d2a6b,'\x0a'),'customerid_contact@odata.bind':_0x13a225[_0x1c78('0x28')]?_0x1c78('0x3f')+_0x13a225['enduserId']+')':undefined,'ownerid@odata.bind':_0x1c78('0x40')+_0x13a225[_0x1c78('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x5b6349[_0x1c78('0x41')],_0x3d2a6b,_0x5b6349[_0x1c78('0x3b')])),'headers':{'Authorization':_0x1c78('0x13')+_0xd36405,'OData-Version':_0x1c78('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5b6349[_0x1c78('0x3b')]==='phonecall'){var _0x3239c8=_0x13a225[_0x1c78('0x28')]?[{'partyid_systemuser@odata.bind':_0x1c78('0x40')+_0x13a225['userId']+')','participationtypemask':_0x13a225[_0x1c78('0x42')]===_0x1c78('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x1c78('0x3f')+_0x13a225[_0x1c78('0x28')]+')','participationtypemask':_0x13a225[_0x1c78('0x42')]===_0x1c78('0x43')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x13a225[_0x1c78('0x1e')]+')','participationtypemask':_0x13a225[_0x1c78('0x42')]===_0x1c78('0x43')?0x2:0x1}];_0x13b9e5={'method':_0x1c78('0x8'),'uri':_0x3280ca+_0x1c78('0x44'),'body':Object[_0x1c78('0x45')]({},{'subject':intUtil[_0x1c78('0x3d')](_0x5b6349['Subjects'],_0x3d2a6b,'\x20'),'phonenumber':String(_0x3d2a6b[_0x1c78('0x29')]),'description':intUtil['getString'](_0x5b6349[_0x1c78('0x46')],_0x3d2a6b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x13a225[_0x1c78('0x28')]?_0x1c78('0x3f')+_0x13a225[_0x1c78('0x28')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x13a225['userId']+')','directioncode':_0x13a225[_0x1c78('0x42')]===_0x1c78('0x43')?![]:!![],'phonecall_activity_parties':_0x3239c8},getCustomFields(_0x5b6349[_0x1c78('0x41')],_0x3d2a6b,_0x5b6349[_0x1c78('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0xd36405,'OData-Version':_0x1c78('0x14')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x13b9e5);})[_0x1c78('0xd')](function(_0x1a9141){var _0x41fa6f=_0x1a9141[_0x1c78('0x26')][_0x1c78('0x47')];var _0xf3c9f=_0x41fa6f[_0x1c78('0x38')](_0x41fa6f[_0x1c78('0x27')]('(')+0x1,_0x41fa6f[_0x1c78('0x27')](')'));_0x13a225['ticketId']=_0xf3c9f;_0x5b9de0(_0x13a225);})[_0x1c78('0x20')](function(_0x15abfd){_0x30c2a2(_0x15abfd[_0x1c78('0x21')]);});});}function emit(_0x1c169c,_0x5aa617,_0x39fb0e,_0x54051e){var _0x540aed={'uri':util[_0x1c78('0x48')](_0x1c78('0x49'),_0x1c169c,_0x39fb0e,_0x54051e)};io['to'](util[_0x1c78('0x48')](_0x1c78('0x4a'),_0x5aa617))[_0x1c78('0x4b')](_0x1c78('0x4c'),_0x540aed);}exports['cs']=function(_0x488790,_0x3fd02c,_0x524cf1,_0x2e623a,_0x3d4c8f,_0x526d31,_0xdc74c,_0x59be5d){var _0x2fd8c5={};_0x526d31['remoteUri']=intUtil[_0x1c78('0x4d')](_0x526d31[_0x1c78('0x9')]);_0x526d31[_0x1c78('0x4e')]=intUtil[_0x1c78('0x4d')](_0x526d31['serverUrl']);_0x2fd8c5[_0x1c78('0x42')]=_0x59be5d==='queue'||_0x59be5d===_0x1c78('0x4f')?_0x1c78('0x43'):'outbound';var _0x5d11ce=util[_0x1c78('0x48')](_0x1c78('0x50'),_0x526d31[_0x1c78('0x9')]);var _0x2aba66=util[_0x1c78('0x48')](_0x1c78('0x51'),_0x526d31['tenantId']);var _0x2ddf9f=util[_0x1c78('0x48')](_0x1c78('0x52'),_0x526d31[_0x1c78('0x4e')],_0x3fd02c[_0x1c78('0x53')],md5(_0x3fd02c[_0x1c78('0x53')]));if(_0x3d4c8f&&_0x3d4c8f[_0x1c78('0x54')]){logger[_0x1c78('0x1c')](_0x1c78('0x55'),_0x1c78('0x56'));_0x3fd02c['recordingURL']=_0x2ddf9f;}else if(_0xdc74c&&_0xdc74c['recordingFormat']&&_0xdc74c[_0x1c78('0x57')]!==_0x1c78('0x58')){logger[_0x1c78('0x1c')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3fd02c['recordingURL']=_0x2ddf9f;}else{_0x3fd02c[_0x1c78('0x59')]='';}return getUser(_0x2fd8c5,_0x526d31,_0x2e623a,_0x2aba66,_0x5d11ce,_0x59be5d)['then'](function(_0x319e41){logger['info']('['+_0x59be5d[_0x1c78('0xf')]()+_0x1c78('0x5a'),_0x319e41[_0x1c78('0x1e')]);logger[_0x1c78('0x1c')]('['+_0x59be5d['toUpperCase']()+_0x1c78('0x5b'),_0x319e41[_0x1c78('0x18')]);return getEndUser(_0x319e41,_0x526d31,_0x2aba66,_0x5d11ce,_0x3fd02c,_0x59be5d,_0x524cf1['moduleCreate']);})['then'](function(_0x1d4f2e){logger[_0x1c78('0x1c')]('['+_0x59be5d[_0x1c78('0xf')]()+_0x1c78('0x5c'),_0x1d4f2e[_0x1c78('0x28')]);logger[_0x1c78('0x1c')]('['+_0x59be5d[_0x1c78('0xf')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3fd02c[_0x1c78('0x29')]);return getTicket(_0x1d4f2e,_0x526d31,_0x2aba66,_0x5d11ce,_0x3fd02c,_0x524cf1,_0x59be5d);})[_0x1c78('0xd')](function(_0x2177a7){logger['info'](util['format']('['+_0x59be5d[_0x1c78('0xf')]()+_0x1c78('0x5d'),_0x524cf1[_0x1c78('0x3b')],_0x2177a7[_0x1c78('0x5e')]));logger[_0x1c78('0x1c')](util['format']('['+_0x59be5d[_0x1c78('0xf')]()+_0x1c78('0x5f'),_0x59be5d));if(_0x59be5d!==_0x1c78('0x4f')){logger[_0x1c78('0x1c')]('['+_0x59be5d['toUpperCase']()+']',_0x1c78('0x60'));emit(_0x526d31[_0x1c78('0x9')],_0x2e623a[_0x1c78('0x61')],_0x524cf1[_0x1c78('0x3b')],_0x2177a7['ticketId']);}})[_0x1c78('0x20')](function(_0xa1496e){logger[_0x1c78('0xe')]('['+_0x59be5d[_0x1c78('0xf')]()+_0x1c78('0x62'),util[_0x1c78('0x63')](_0xa1496e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index cfe0815..2f8c721 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 _0xb991=['POST','then','info','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri'];(function(_0x403dc4,_0x99fbe9){var _0x1435d7=function(_0xb801fa){while(--_0xb801fa){_0x403dc4['push'](_0x403dc4['shift']());}};_0x1435d7(++_0x99fbe9);}(_0xb991,0x1ba));var _0x1b99=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xb991[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x1b99('0x0'));var rp=require('request-promise');var md5=require(_0x1b99('0x1'));var util=require(_0x1b99('0x2'));var Redis=require(_0x1b99('0x3'));var intUtil=require('./util');var config=require(_0x1b99('0x4'));var logger=require(_0x1b99('0x5'))('freshdesk');config[_0x1b99('0x6')]=_[_0x1b99('0x7')](config[_0x1b99('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1b99('0x8'))(new Redis(config[_0x1b99('0x6')]));var headers={'Content-Type':_0x1b99('0x9'),'Accept':'application/json'};function emit(_0x4d0e67,_0x5c12d9,_0x292c0e){io['to'](_0x4d0e67)[_0x1b99('0xa')](_0x5c12d9,_0x292c0e);}function getTicket(_0x193c0b,_0x3b6d41,_0x4cbe8c,_0x4d78b1,_0x480313){logger['info'](_0x1b99('0xb'));var _0x2eb492=_[_0x1b99('0xc')]({'responder_id':_0x3b6d41['id'],'requester_id':_0x4cbe8c['id'],'name':util[_0x1b99('0xd')](_0x1b99('0xe'),_0x480313[_0x1b99('0xf')]),'phone':_0x480313['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1b99('0x10')](_0x4d78b1[_0x1b99('0x11')],_0x480313,'\x20'),'description':intUtil[_0x1b99('0x10')](_0x4d78b1[_0x1b99('0x12')],_0x480313,_0x1b99('0x13')),'tags':getTags(_0x4d78b1[_0x1b99('0x14')],_0x1b99('0x15'))},getCustomFields(_0x4d78b1[_0x1b99('0x16')],_0x480313));_0x2eb492[_0x1b99('0x17')]=_[_0x1b99('0x18')](_[_0x1b99('0x19')](_0x2eb492[_0x1b99('0x17')],'id'),_0x1b99('0x1a'));return request({'uri':util[_0x1b99('0xd')]('%s/api/v2/tickets',_0x193c0b[_0x1b99('0x1b')]),'method':_0x1b99('0x1c'),'body':_0x2eb492})[_0x1b99('0x1d')](function(_0x1c69b5){logger[_0x1b99('0x1e')]('Ticket\x20created!');return _0x1c69b5;});}function getUser(_0xfc81e,_0x13d46){if(intUtil['validateEmail'](_0x13d46)){return request({'uri':util[_0x1b99('0xd')]('%s/api/v2/agents',_0xfc81e[_0x1b99('0x1b')]),'qs':{'email':_0x13d46}})['then'](function(_0x58704b){if(_0x58704b[_0x1b99('0x1f')]){logger['info'](_0x1b99('0x20'));return _[_0x1b99('0x21')](_0x58704b,function(_0x18052e){return _0x18052e[_0x1b99('0x22')][_0x1b99('0x23')]===_0x13d46;});}else{logger[_0x1b99('0x1e')](_0x1b99('0x24'));return request({'uri':util[_0x1b99('0xd')](_0x1b99('0x25'),_0xfc81e[_0x1b99('0x1b')])})['then'](function(_0xf5ee9e){logger[_0x1b99('0x1e')](_0x1b99('0x26'));return _0xf5ee9e;});}});}else{logger['info'](_0x1b99('0x27'));return request({'uri':util['format'](_0x1b99('0x25'),_0xfc81e[_0x1b99('0x1b')])})[_0x1b99('0x1d')](function(_0x4014b1){logger['info'](_0x1b99('0x26'));return _0x4014b1;});}}function getEndUser(_0x459640,_0x4e0fb7,_0x35699){logger[_0x1b99('0x1e')](_0x1b99('0x28'),_0x35699);return request({'uri':util[_0x1b99('0xd')](_0x1b99('0x29'),_0x459640[_0x1b99('0x1b')]),'qs':{'phone':_0x35699}})[_0x1b99('0x1d')](function(_0xdea94b){if(_0xdea94b['length']){logger[_0x1b99('0x1e')]('Enduser\x20found!');return _[_0x1b99('0x21')](_0xdea94b,{'phone':_0x35699});}else{logger[_0x1b99('0x1e')](_0x1b99('0x2a'));return request({'uri':util[_0x1b99('0xd')](_0x1b99('0x29'),_0x459640[_0x1b99('0x1b')]),'method':_0x1b99('0x1c'),'body':{'name':_0x4e0fb7,'phone':_0x35699}})[_0x1b99('0x1d')](function(_0x33394e){logger[_0x1b99('0x1e')](_0x1b99('0x2b'));return _0x33394e;});}});}function getAuth(_0x37e73e){return util[_0x1b99('0xd')](_0x1b99('0x2c'),new Buffer(_0x37e73e[_0x1b99('0x2d')]+':X')[_0x1b99('0x2e')]('base64'));}function request(_0x2dd034){logger[_0x1b99('0x2f')](_0x1b99('0x30'),JSON[_0x1b99('0x31')](_0x2dd034));return rp(_[_0x1b99('0x7')](_0x2dd034,{'method':_0x1b99('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2b658e,_0x52a0d9){var _0x6b6f4d=[];if(_0x2b658e&&_0x2b658e[_0x1b99('0x1f')]>0x0){_0x6b6f4d=_[_0x1b99('0x33')](_0x2b658e,_0x52a0d9);}return _0x6b6f4d;}function getCustomFields(_0x35acdf,_0x50a09e){var _0x64048f=[];var _0x2d6ceb={'custom_fields':[]};if(_0x35acdf[_0x1b99('0x1f')]>0x0){_[_0x1b99('0x34')](_0x35acdf,function(_0x4316b0){if(_[_0x1b99('0x35')]([_0x1b99('0x36'),_0x1b99('0x37')],_0x4316b0[_0x1b99('0x38')])&&_0x4316b0[_0x1b99('0x39')]&&!_0x4316b0['customField']){_0x2d6ceb[_0x4316b0[_0x1b99('0x39')][_0x1b99('0x3a')]()]=_0x4316b0[_0x1b99('0x3b')][_0x1b99('0x2e')]();}else if(_[_0x1b99('0x35')]([_0x1b99('0x36'),_0x1b99('0x37')],_0x4316b0['type'])&&_0x4316b0[_0x1b99('0x3c')]&&_0x4316b0[_0x1b99('0x3d')]){_0x2d6ceb['custom_fields']['push']({'id':_0x4316b0[_0x1b99('0x3c')],'value':_0x4316b0[_0x1b99('0x3b')][_0x1b99('0x2e')]()});}else if(_0x4316b0[_0x1b99('0x38')]===_0x1b99('0x3e')&&_0x4316b0[_0x1b99('0x3f')]&&_0x4316b0['idField']&&_0x4316b0[_0x1b99('0x3d')]){_0x50a09e[_0x4316b0[_0x1b99('0x3f')]]&&_0x2d6ceb[_0x1b99('0x17')]['push']({'id':_0x4316b0[_0x1b99('0x3c')],'value':_0x50a09e[_0x4316b0[_0x1b99('0x3f')]][_0x1b99('0x2e')]()});}else if(_0x4316b0[_0x1b99('0x38')]==='customVariable'&&_0x4316b0['Variable']&&_0x4316b0['Variable'][_0x1b99('0x15')]&&_0x4316b0[_0x1b99('0x3c')]&&_0x4316b0[_0x1b99('0x3d')]){_0x50a09e[_0x4316b0[_0x1b99('0x40')][_0x1b99('0x15')][_0x1b99('0x3a')]()]&&_0x2d6ceb[_0x1b99('0x17')]['push']({'id':_0x4316b0[_0x1b99('0x3c')],'value':_0x50a09e[_0x4316b0[_0x1b99('0x40')][_0x1b99('0x15')][_0x1b99('0x3a')]()][_0x1b99('0x2e')]()});}});}return _0x2d6ceb;}exports[_0x1b99('0x41')]=function(_0x2ed122,_0xa46b52,_0x385ffb,_0x478652,_0x430936,_0x6302d3){var _0x2d40c1,_0xd8f405;_0x6302d3[_0x1b99('0x1b')]=intUtil['stripTrailingSlash'](_0x6302d3['remoteUri']);_0x6302d3[_0x1b99('0x42')]=intUtil[_0x1b99('0x43')](_0x6302d3[_0x1b99('0x42')]);if(_0x430936&&_0x430936[_0x1b99('0x44')]){logger[_0x1b99('0x1e')](_0x1b99('0x45'),_0x1b99('0x46'));_0xa46b52['recordingURL']=util[_0x1b99('0xd')](_0x1b99('0x47'),_0x6302d3[_0x1b99('0x42')],_0xa46b52[_0x1b99('0x48')],md5(_0xa46b52[_0x1b99('0x48')]));}else{_0xa46b52[_0x1b99('0x49')]='';}headers[_0x1b99('0x4a')]=getAuth(_0x6302d3);return getUser(_0x6302d3,_0x478652['email'])[_0x1b99('0x1d')](function(_0x39fd10){_0x2d40c1=_0x39fd10;logger['info'](_0x1b99('0x4b'),_0x2d40c1['id']);return getEndUser(_0x6302d3,_0xa46b52[_0x1b99('0xf')],_0xa46b52[_0x1b99('0x4c')]);})[_0x1b99('0x1d')](function(_0x1224ad){_0xd8f405=_0x1224ad;logger[_0x1b99('0x1e')](_0x1b99('0x4d'),_0xd8f405['id']);return getTicket(_0x6302d3,_0x2d40c1,_0xd8f405,_0x385ffb,_0xa46b52);})[_0x1b99('0x1d')](function(_0xe93199){if(_0xe93199&&_0xe93199['id']){logger['info'](_0x1b99('0x4e'));logger[_0x1b99('0x1e')]('The\x20Ticket\x20ID\x20is:',_0xe93199['id']);logger[_0x1b99('0x1e')](_0x1b99('0x45'),_0x1b99('0x4f'));emit(util['format']('user:%s',_0x478652[_0x1b99('0x15')]),_0x1b99('0x50'),{'uri':util['format'](_0x1b99('0x51'),_0x6302d3['remoteUri'],_0xe93199['id'])});}})[_0x1b99('0x52')](function(_0x1e674f){logger[_0x1b99('0x53')](_0x1b99('0x45'),JSON[_0x1b99('0x31')](_0x1e674f));});};exports[_0x1b99('0x54')]=function(_0x2b891d,_0x37cf2e,_0x51ad14,_0x52cacb,_0x378ce4,_0x7f80c7,_0x3cda60){var _0x489bcf,_0xed330e;_0x7f80c7[_0x1b99('0x1b')]=intUtil['stripTrailingSlash'](_0x7f80c7[_0x1b99('0x1b')]);_0x7f80c7['serverUrl']=intUtil['stripTrailingSlash'](_0x7f80c7[_0x1b99('0x42')]);if(_0x3cda60&&_0x3cda60[_0x1b99('0x55')]&&_0x3cda60[_0x1b99('0x55')]!==_0x1b99('0x56')){logger[_0x1b99('0x1e')](_0x1b99('0x57'),_0x1b99('0x46'));_0x37cf2e[_0x1b99('0x49')]=util[_0x1b99('0xd')](_0x1b99('0x47'),_0x7f80c7[_0x1b99('0x42')],_0x37cf2e[_0x1b99('0x48')],md5(_0x37cf2e[_0x1b99('0x48')]));}headers[_0x1b99('0x4a')]=getAuth(_0x7f80c7);return getUser(_0x7f80c7,_0x52cacb[_0x1b99('0x23')])['then'](function(_0x89c68c){_0x489bcf=_0x89c68c;logger['info'](_0x1b99('0x4b'),_0x489bcf['id']);return getEndUser(_0x7f80c7,_0x37cf2e[_0x1b99('0x58')],_0x37cf2e[_0x1b99('0x59')]);})[_0x1b99('0x1d')](function(_0x5b1a0f){_0xed330e=_0x5b1a0f;logger[_0x1b99('0x1e')](_0x1b99('0x4d'),_0xed330e['id']);return getTicket(_0x7f80c7,_0x489bcf,_0xed330e,_0x51ad14,_0x37cf2e);})[_0x1b99('0x1d')](function(_0x2e3123){if(_0x2e3123&&_0x2e3123['id']){logger['info']('Ticket\x20created!');logger[_0x1b99('0x1e')](_0x1b99('0x5a'),_0x2e3123['id']);logger['info'](_0x1b99('0x57'),_0x1b99('0x4f'));emit(util[_0x1b99('0xd')]('user:%s',_0x52cacb[_0x1b99('0x15')]),_0x1b99('0x50'),{'uri':util[_0x1b99('0xd')]('%s/helpdesk/tickets/%d',_0x7f80c7['remoteUri'],_0x2e3123['id'])});}})[_0x1b99('0x52')](function(_0x5c99be){logger[_0x1b99('0x53')](_0x1b99('0x57'),JSON[_0x1b99('0x31')](_0x5c99be));});};exports[_0x1b99('0x5b')]=function(_0xd45b60,_0x193788,_0x1ffeef,_0x109aed,_0x5e781c,_0xfe4677){var _0x402500,_0x5e6719;_0xfe4677[_0x1b99('0x1b')]=intUtil['stripTrailingSlash'](_0xfe4677[_0x1b99('0x1b')]);_0xfe4677['serverUrl']=intUtil['stripTrailingSlash'](_0xfe4677[_0x1b99('0x42')]);if(_0x5e781c&&_0x5e781c['monitor_format']){logger[_0x1b99('0x1e')]('['+_0x193788[_0x1b99('0x5c')][_0x1b99('0x5d')]()+']',_0x1b99('0x46'));_0x193788[_0x1b99('0x49')]=util[_0x1b99('0xd')](_0x1b99('0x47'),_0xfe4677[_0x1b99('0x42')],_0x193788[_0x1b99('0x48')],md5(_0x193788[_0x1b99('0x48')]));}else{_0x193788[_0x1b99('0x49')]='';}headers['Authorization']=getAuth(_0xfe4677);return getUser(_0xfe4677,'')['then'](function(_0x1a19e9){_0x402500=_0x1a19e9;logger[_0x1b99('0x1e')](_0x1b99('0x4b'),_0x402500['id']);return getEndUser(_0xfe4677,_0x193788[_0x1b99('0xf')],_0x193788[_0x1b99('0x4c')]);})['then'](function(_0x6109e1){_0x5e6719=_0x6109e1;logger['info'](_0x1b99('0x4d'),_0x5e6719['id']);return getTicket(_0xfe4677,_0x402500,_0x5e6719,_0x1ffeef,_0x193788);})[_0x1b99('0x1d')](function(_0x1d0371){if(_0x1d0371){logger[_0x1b99('0x1e')](_0x1b99('0x4e'));logger[_0x1b99('0x1e')](_0x1b99('0x5a'),_0x1d0371['id']);}})[_0x1b99('0x52')](function(_0x489a3b){logger['error']('['+_0x193788[_0x1b99('0x5c')][_0x1b99('0x5d')]()+']',JSON[_0x1b99('0x31')](_0x489a3b));});}; \ No newline at end of file +var _0x18ca=['info','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','apiKey','base64','debug','stringify','GET','map','forEach','includes','picklist','nameField','toLowerCase','content','string','type','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','unmanaged','monitor_format','lastevent','lodash','request-promise','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18ca,0x9e));var _0xa18c=function(_0x4fa3fd,_0x3e0dd7){_0x4fa3fd=_0x4fa3fd-0x0;var _0x14b28f=_0x18ca[_0x4fa3fd];return _0x14b28f;};'use strict';var _=require(_0xa18c('0x0'));var rp=require(_0xa18c('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xa18c('0x2'));var intUtil=require(_0xa18c('0x3'));var config=require(_0xa18c('0x4'));var logger=require('../../../../config/logger')(_0xa18c('0x5'));config[_0xa18c('0x6')]=_[_0xa18c('0x7')](config[_0xa18c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa18c('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0xa18c('0x9'),'Accept':_0xa18c('0x9')};function emit(_0x52172d,_0x21797e,_0x1ad2de){io['to'](_0x52172d)[_0xa18c('0xa')](_0x21797e,_0x1ad2de);}function getTicket(_0x1633db,_0x3f9d91,_0x5212d2,_0x541b92,_0x3449d4){logger['info'](_0xa18c('0xb'));var _0x55c222=_[_0xa18c('0xc')]({'responder_id':_0x3f9d91['id'],'requester_id':_0x5212d2['id'],'name':util['format'](_0xa18c('0xd'),_0x3449d4[_0xa18c('0xe')]),'phone':_0x3449d4['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa18c('0xf')](_0x541b92[_0xa18c('0x10')],_0x3449d4,'\x20'),'description':intUtil[_0xa18c('0xf')](_0x541b92[_0xa18c('0x11')],_0x3449d4,_0xa18c('0x12')),'tags':getTags(_0x541b92[_0xa18c('0x13')],_0xa18c('0x14'))},getCustomFields(_0x541b92[_0xa18c('0x15')],_0x3449d4));_0x55c222[_0xa18c('0x16')]=_[_0xa18c('0x17')](_[_0xa18c('0x18')](_0x55c222[_0xa18c('0x16')],'id'),_0xa18c('0x19'));return request({'uri':util[_0xa18c('0x1a')](_0xa18c('0x1b'),_0x1633db[_0xa18c('0x1c')]),'method':_0xa18c('0x1d'),'body':_0x55c222})['then'](function(_0x5a560c){logger[_0xa18c('0x1e')](_0xa18c('0x1f'));return _0x5a560c;});}function getUser(_0xd68f2f,_0x662c06){if(intUtil[_0xa18c('0x20')](_0x662c06)){return request({'uri':util[_0xa18c('0x1a')](_0xa18c('0x21'),_0xd68f2f[_0xa18c('0x1c')]),'qs':{'email':_0x662c06}})[_0xa18c('0x22')](function(_0x58b503){if(_0x58b503[_0xa18c('0x23')]){logger[_0xa18c('0x1e')](_0xa18c('0x24'));return _[_0xa18c('0x25')](_0x58b503,function(_0x38fb1e){return _0x38fb1e[_0xa18c('0x26')][_0xa18c('0x27')]===_0x662c06;});}else{logger[_0xa18c('0x1e')](_0xa18c('0x28'));return request({'uri':util[_0xa18c('0x1a')](_0xa18c('0x29'),_0xd68f2f[_0xa18c('0x1c')])})['then'](function(_0xd4b874){logger[_0xa18c('0x1e')]('Admin\x20account\x20selected.');return _0xd4b874;});}});}else{logger[_0xa18c('0x1e')](_0xa18c('0x2a'));return request({'uri':util[_0xa18c('0x1a')](_0xa18c('0x29'),_0xd68f2f[_0xa18c('0x1c')])})[_0xa18c('0x22')](function(_0x5a33c2){logger['info']('Admin\x20account\x20selected.');return _0x5a33c2;});}}function getEndUser(_0x2b26d7,_0x39faa0,_0x2852fa){logger[_0xa18c('0x1e')]('Searching\x20enduser\x20with\x20phone',_0x2852fa);return request({'uri':util['format'](_0xa18c('0x2b'),_0x2b26d7[_0xa18c('0x1c')]),'qs':{'phone':_0x2852fa}})[_0xa18c('0x22')](function(_0x53092c){if(_0x53092c[_0xa18c('0x23')]){logger[_0xa18c('0x1e')](_0xa18c('0x2c'));return _['find'](_0x53092c,{'phone':_0x2852fa});}else{logger[_0xa18c('0x1e')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xa18c('0x1a')](_0xa18c('0x2b'),_0x2b26d7[_0xa18c('0x1c')]),'method':_0xa18c('0x1d'),'body':{'name':_0x39faa0,'phone':_0x2852fa}})['then'](function(_0x570425){logger[_0xa18c('0x1e')]('Enduser\x20created.');return _0x570425;});}});}function getAuth(_0x3cfcd8){return util['format'](_0xa18c('0x2d'),new Buffer(_0x3cfcd8[_0xa18c('0x2e')]+':X')['toString'](_0xa18c('0x2f')));}function request(_0x56d1bb){logger[_0xa18c('0x30')]('[HTTP]',JSON[_0xa18c('0x31')](_0x56d1bb));return rp(_[_0xa18c('0x7')](_0x56d1bb,{'method':_0xa18c('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x29edaf,_0x50ad44){var _0x33c0ec=[];if(_0x29edaf&&_0x29edaf[_0xa18c('0x23')]>0x0){_0x33c0ec=_[_0xa18c('0x33')](_0x29edaf,_0x50ad44);}return _0x33c0ec;}function getCustomFields(_0x54f118,_0x48d8f0){var _0x3e59ad=[];var _0x2ce8dc={'custom_fields':[]};if(_0x54f118['length']>0x0){_[_0xa18c('0x34')](_0x54f118,function(_0x513f8b){if(_[_0xa18c('0x35')](['string',_0xa18c('0x36')],_0x513f8b['type'])&&_0x513f8b[_0xa18c('0x37')]&&!_0x513f8b['customField']){_0x2ce8dc[_0x513f8b['nameField'][_0xa18c('0x38')]()]=_0x513f8b[_0xa18c('0x39')]['toString']();}else if(_['includes']([_0xa18c('0x3a'),'picklist'],_0x513f8b[_0xa18c('0x3b')])&&_0x513f8b[_0xa18c('0x3c')]&&_0x513f8b[_0xa18c('0x3d')]){_0x2ce8dc[_0xa18c('0x16')][_0xa18c('0x3e')]({'id':_0x513f8b[_0xa18c('0x3c')],'value':_0x513f8b['content']['toString']()});}else if(_0x513f8b[_0xa18c('0x3b')]===_0xa18c('0x3f')&&_0x513f8b[_0xa18c('0x40')]&&_0x513f8b[_0xa18c('0x3c')]&&_0x513f8b[_0xa18c('0x3d')]){_0x48d8f0[_0x513f8b[_0xa18c('0x40')]]&&_0x2ce8dc[_0xa18c('0x16')][_0xa18c('0x3e')]({'id':_0x513f8b[_0xa18c('0x3c')],'value':_0x48d8f0[_0x513f8b[_0xa18c('0x40')]]['toString']()});}else if(_0x513f8b[_0xa18c('0x3b')]==='customVariable'&&_0x513f8b['Variable']&&_0x513f8b['Variable'][_0xa18c('0x14')]&&_0x513f8b['idField']&&_0x513f8b[_0xa18c('0x3d')]){_0x48d8f0[_0x513f8b[_0xa18c('0x41')]['name']['toLowerCase']()]&&_0x2ce8dc[_0xa18c('0x16')][_0xa18c('0x3e')]({'id':_0x513f8b[_0xa18c('0x3c')],'value':_0x48d8f0[_0x513f8b['Variable'][_0xa18c('0x14')][_0xa18c('0x38')]()]['toString']()});}});}return _0x2ce8dc;}exports[_0xa18c('0x42')]=function(_0x245f73,_0x1c18bb,_0x547a95,_0x47ac01,_0x990726,_0x4f67d3){var _0x2fd288,_0x3f3ca9;_0x4f67d3[_0xa18c('0x1c')]=intUtil[_0xa18c('0x43')](_0x4f67d3[_0xa18c('0x1c')]);_0x4f67d3[_0xa18c('0x44')]=intUtil[_0xa18c('0x43')](_0x4f67d3[_0xa18c('0x44')]);if(_0x990726&&_0x990726['monitor_format']){logger[_0xa18c('0x1e')]('[QUEUE]',_0xa18c('0x45'));_0x1c18bb[_0xa18c('0x46')]=util[_0xa18c('0x1a')](_0xa18c('0x47'),_0x4f67d3[_0xa18c('0x44')],_0x1c18bb['uniqueid'],md5(_0x1c18bb[_0xa18c('0x48')]));}else{_0x1c18bb[_0xa18c('0x46')]='';}headers[_0xa18c('0x49')]=getAuth(_0x4f67d3);return getUser(_0x4f67d3,_0x47ac01['email'])['then'](function(_0x2eb7eb){_0x2fd288=_0x2eb7eb;logger[_0xa18c('0x1e')]('The\x20User\x20ID\x20is:',_0x2fd288['id']);return getEndUser(_0x4f67d3,_0x1c18bb[_0xa18c('0xe')],_0x1c18bb[_0xa18c('0x4a')]);})[_0xa18c('0x22')](function(_0x3b5492){_0x3f3ca9=_0x3b5492;logger[_0xa18c('0x1e')](_0xa18c('0x4b'),_0x3f3ca9['id']);return getTicket(_0x4f67d3,_0x2fd288,_0x3f3ca9,_0x547a95,_0x1c18bb);})[_0xa18c('0x22')](function(_0x432877){if(_0x432877&&_0x432877['id']){logger[_0xa18c('0x1e')](_0xa18c('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x432877['id']);logger[_0xa18c('0x1e')](_0xa18c('0x4c'),_0xa18c('0x4d'));emit(util[_0xa18c('0x1a')](_0xa18c('0x4e'),_0x47ac01['name']),_0xa18c('0x4f'),{'uri':util[_0xa18c('0x1a')]('%s/helpdesk/tickets/%d',_0x4f67d3[_0xa18c('0x1c')],_0x432877['id'])});}})[_0xa18c('0x50')](function(_0x5d2429){logger[_0xa18c('0x51')]('[QUEUE]',JSON[_0xa18c('0x31')](_0x5d2429));});};exports[_0xa18c('0x52')]=function(_0x45d5eb,_0x3fcbce,_0x2dc822,_0x203125,_0x1336a5,_0x3530cd,_0xb0a337){var _0x5d028d,_0x46a6c5;_0x3530cd[_0xa18c('0x1c')]=intUtil['stripTrailingSlash'](_0x3530cd[_0xa18c('0x1c')]);_0x3530cd['serverUrl']=intUtil[_0xa18c('0x43')](_0x3530cd[_0xa18c('0x44')]);if(_0xb0a337&&_0xb0a337[_0xa18c('0x53')]&&_0xb0a337[_0xa18c('0x53')]!==_0xa18c('0x54')){logger[_0xa18c('0x1e')](_0xa18c('0x55'),'Recording\x20is\x20enabled!');_0x3fcbce[_0xa18c('0x46')]=util[_0xa18c('0x1a')](_0xa18c('0x47'),_0x3530cd[_0xa18c('0x44')],_0x3fcbce['uniqueid'],md5(_0x3fcbce[_0xa18c('0x48')]));}headers[_0xa18c('0x49')]=getAuth(_0x3530cd);return getUser(_0x3530cd,_0x203125['email'])[_0xa18c('0x22')](function(_0x40c4be){_0x5d028d=_0x40c4be;logger[_0xa18c('0x1e')](_0xa18c('0x56'),_0x5d028d['id']);return getEndUser(_0x3530cd,_0x3fcbce[_0xa18c('0x57')],_0x3fcbce[_0xa18c('0x58')]);})[_0xa18c('0x22')](function(_0x4da6c1){_0x46a6c5=_0x4da6c1;logger['info'](_0xa18c('0x4b'),_0x46a6c5['id']);return getTicket(_0x3530cd,_0x5d028d,_0x46a6c5,_0x2dc822,_0x3fcbce);})['then'](function(_0x211165){if(_0x211165&&_0x211165['id']){logger[_0xa18c('0x1e')]('Ticket\x20created!');logger['info'](_0xa18c('0x59'),_0x211165['id']);logger[_0xa18c('0x1e')](_0xa18c('0x55'),_0xa18c('0x4d'));emit(util[_0xa18c('0x1a')]('user:%s',_0x203125[_0xa18c('0x14')]),_0xa18c('0x4f'),{'uri':util[_0xa18c('0x1a')](_0xa18c('0x5a'),_0x3530cd[_0xa18c('0x1c')],_0x211165['id'])});}})['catch'](function(_0x3c998c){logger[_0xa18c('0x51')](_0xa18c('0x55'),JSON['stringify'](_0x3c998c));});};exports[_0xa18c('0x5b')]=function(_0x57c055,_0x67f529,_0x117762,_0x2d6d6a,_0x57fecd,_0x352016){var _0x150919,_0x5486d5;_0x352016['remoteUri']=intUtil[_0xa18c('0x43')](_0x352016[_0xa18c('0x1c')]);_0x352016[_0xa18c('0x44')]=intUtil[_0xa18c('0x43')](_0x352016[_0xa18c('0x44')]);if(_0x57fecd&&_0x57fecd[_0xa18c('0x5c')]){logger['info']('['+_0x67f529['lastevent']['toUpperCase']()+']',_0xa18c('0x45'));_0x67f529[_0xa18c('0x46')]=util[_0xa18c('0x1a')](_0xa18c('0x47'),_0x352016[_0xa18c('0x44')],_0x67f529[_0xa18c('0x48')],md5(_0x67f529['uniqueid']));}else{_0x67f529[_0xa18c('0x46')]='';}headers['Authorization']=getAuth(_0x352016);return getUser(_0x352016,'')[_0xa18c('0x22')](function(_0x57500f){_0x150919=_0x57500f;logger[_0xa18c('0x1e')](_0xa18c('0x56'),_0x150919['id']);return getEndUser(_0x352016,_0x67f529[_0xa18c('0xe')],_0x67f529[_0xa18c('0x4a')]);})[_0xa18c('0x22')](function(_0x5b380b){_0x5486d5=_0x5b380b;logger[_0xa18c('0x1e')]('The\x20Enduser\x20ID\x20is:',_0x5486d5['id']);return getTicket(_0x352016,_0x150919,_0x5486d5,_0x117762,_0x67f529);})[_0xa18c('0x22')](function(_0x24f89f){if(_0x24f89f){logger[_0xa18c('0x1e')](_0xa18c('0x1f'));logger[_0xa18c('0x1e')](_0xa18c('0x59'),_0x24f89f['id']);}})[_0xa18c('0x50')](function(_0x2b8030){logger[_0xa18c('0x51')]('['+_0x67f529[_0xa18c('0x5d')]['toUpperCase']()+']',JSON[_0xa18c('0x31')](_0x2b8030));});}; \ 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 9a7151d..773c74a 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 _0x37d0=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','userEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','calleridnum','callDirection','queue','uniqueid'];(function(_0x380723,_0x29175b){var _0x353d3b=function(_0x1aded9){while(--_0x1aded9){_0x380723['push'](_0x380723['shift']());}};_0x353d3b(++_0x29175b);}(_0x37d0,0x1b4));var _0x037d=function(_0x38b7d1,_0x3efb42){_0x38b7d1=_0x38b7d1-0x0;var _0x198af9=_0x37d0[_0x38b7d1];return _0x198af9;};'use strict';var _=require(_0x037d('0x0'));var rp=require(_0x037d('0x1'));var md5=require(_0x037d('0x2'));var util=require(_0x037d('0x3'));var moment=require(_0x037d('0x4'));var Promise=require(_0x037d('0x5'));var Redis=require(_0x037d('0x6'));var intUtil=require(_0x037d('0x7'));var config=require(_0x037d('0x8'));var logger=require(_0x037d('0x9'))(_0x037d('0xa'));config[_0x037d('0xb')]=_['defaults'](config['redis'],{'host':_0x037d('0xc'),'port':0x18eb});var io=require(_0x037d('0xd'))(new Redis(config[_0x037d('0xb')]));function getAdminId(_0x4acfb9,_0x15c6ed,_0x1f0a37,_0x540926){return new Promise(function(_0x2e6fe3,_0x3812d8){var _0x7e1781=![];var _0x2cd3f9={'method':_0x037d('0xe'),'uri':_0x540926+_0x037d('0xf'),'json':!![]};_0x2cd3f9[_0x037d('0x10')]=_0x1f0a37;logger[_0x037d('0x11')]('Getting\x20admin\x20information');return rp(_0x2cd3f9)[_0x037d('0x12')](function(_0x45a769){if(_0x45a769){var _0x10e225=_0x45a769[_0x037d('0x13')];var _0x3965fd=null;for(_0x3965fd=0x0;_0x3965fd<_0x10e225[_0x037d('0x14')];_0x3965fd++){if(_0x10e225[_0x3965fd][_0x037d('0x15')]===_0x4acfb9['adminEmail']){_0x4acfb9[_0x037d('0x16')]=_0x10e225[_0x3965fd]['id'];_0x7e1781=!![];}}if(_0x7e1781){logger[_0x037d('0x11')](_0x037d('0x17'),_0x4acfb9[_0x037d('0x16')]);_0x2e6fe3(_0x4acfb9);}else{_0x3812d8({'statusCode':0x194,'message':_0x037d('0x18')});}}else{_0x3812d8({'statusCode':0x194,'message':_0x037d('0x18')});}})[_0x037d('0x19')](function(_0x13da22){logger[_0x037d('0x1a')]('['+[_0x15c6ed[_0x037d('0x1b')]()]+']',_0x13da22[_0x037d('0x1c')]);_0x3812d8(_0x13da22);});});}function getUser(_0x50ca89,_0x8a8557,_0x4ed8ce){return function(_0x569603){return new Promise(function(_0x4d23c3,_0x865d11){var _0x550619={'method':'GET','uri':_0x4ed8ce+_0x037d('0xf'),'json':!![]};_0x550619[_0x037d('0x10')]=_0x8a8557;logger[_0x037d('0x11')]('Getting\x20user\x20list');return rp(_0x550619)['then'](function(_0x1d18b3){if(_0x1d18b3){var _0x1fe965=_0x1d18b3[_0x037d('0x13')];var _0x3103c6=![];var _0x1e2ab4=null;if(_0x569603[_0x037d('0x1d')]!==null){logger[_0x037d('0x11')](_0x037d('0x1e'),_0x569603[_0x037d('0x1d')]);_0x569603['userEmail']=_0x569603[_0x037d('0x1d')];for(_0x1e2ab4=0x0;_0x1e2ab4<_0x1fe965[_0x037d('0x14')];_0x1e2ab4++){if(_0x1fe965[_0x1e2ab4][_0x037d('0x15')]===_0x569603[_0x037d('0x1d')]){_0x3103c6=!![];_0x569603[_0x037d('0x1f')]=_0x1fe965[_0x1e2ab4]['id'];logger['info'](_0x037d('0x20'),_0x569603['userId']);}}}if(!_0x3103c6){logger[_0x037d('0x11')]('Admin\x20selected');_0x569603[_0x037d('0x21')]=_0x569603['adminEmail'];_0x569603[_0x037d('0x1f')]=_0x569603[_0x037d('0x16')];_0x3103c6=!![];}if(_0x3103c6){_0x4d23c3(_0x569603);}else{_0x865d11({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x865d11({'statusCode':0x194,'message':_0x037d('0x18')});}})[_0x037d('0x19')](function(_0x5dd730){logger['error']('['+[_0x50ca89[_0x037d('0x1b')]()]+']',_0x5dd730['message']);_0x865d11(_0x5dd730);});});};}function searchContact(_0x5adf32,_0x59a714,_0x1af975,_0x454aac){return new Promise(function(_0x29d1d5,_0x348e22){var _0x3a5d45={'method':_0x037d('0xe'),'headers':_0x59a714,'uri':_0x5adf32+_0x037d('0x22')+_0x454aac+_0x037d('0x23')+_0x1af975+_0x037d('0x24'),'json':!![]};rp(_0x3a5d45)[_0x037d('0x12')](function(_0xf758c1){var _0x24758e=_[_0x037d('0x25')](_0xf758c1['contacts'][_0x037d('0x26')],[_0x1af975,_0x454aac]);_0x29d1d5(_0x24758e);})[_0x037d('0x19')](function(_0x59a506){_0x348e22(_0x59a506);});});}function getEndUser(_0x50aea6,_0x134067,_0x285bc7){return function(_0x1f73d6){return new Promise(function(_0x1ac4fc,_0x4e9391){logger[_0x037d('0x11')](util[_0x037d('0x27')](_0x037d('0x28'),_0x1f73d6[_0x037d('0x29')]));searchContact(_0x285bc7,_0x134067,_0x037d('0x2a'),_0x1f73d6[_0x037d('0x29')])[_0x037d('0x12')](function(_0x469232){if(_0x469232){_0x1f73d6[_0x037d('0x2b')]=_0x469232['id'];logger[_0x037d('0x11')](_0x037d('0x2c'),_0x1f73d6[_0x037d('0x2b')]);return _0x1ac4fc(_0x1f73d6);}searchContact(_0x285bc7,_0x134067,_0x037d('0x2d'),_0x1f73d6[_0x037d('0x29')])[_0x037d('0x12')](function(_0xdf8400){if(_0xdf8400){_0x1f73d6[_0x037d('0x2b')]=_0xdf8400['id'];logger[_0x037d('0x11')](_0x037d('0x2e'),_0x1f73d6[_0x037d('0x2b')]);return _0x1ac4fc(_0x1f73d6);}createEndUser(_0x1f73d6,_0x50aea6,_0x134067,_0x285bc7)[_0x037d('0x12')](function(_0xa48ea5){logger['info']('Contact\x20created:',_0xa48ea5[_0x037d('0x2b')]);return _0x1ac4fc(_0xa48ea5);});});})[_0x037d('0x19')](function(_0x75d620){_0x4e9391(_0x75d620);});});};}function createEndUser(_0x5347ff,_0x447f8d,_0x4b26fa,_0x3d1572){return new Promise(function(_0x385276,_0x5d3403){var _0x3cf601=moment();var _0x1ce432={'method':_0x037d('0x2f'),'uri':_0x3d1572+_0x037d('0x30'),'body':{'contact':{'last_name':_0x5347ff['contactNumber'],'work_number':_0x5347ff[_0x037d('0x29')],'mobile_number':_0x5347ff[_0x037d('0x29')],'owner_id':_0x5347ff[_0x037d('0x1f')],'created_at':_0x3cf601[_0x037d('0x27')](_0x037d('0x31'))}},'json':!![]};_0x1ce432[_0x037d('0x10')]=_0x4b26fa;logger[_0x037d('0x11')](_0x037d('0x32'));return rp(_0x1ce432)[_0x037d('0x12')](function(_0x3f9c24){_0x5347ff[_0x037d('0x2b')]=_0x3f9c24[_0x037d('0x33')]['id'];_0x385276(_0x5347ff);})[_0x037d('0x19')](function(_0x5bade){logger[_0x037d('0x1a')]('['+[_0x447f8d['toUpperCase']()]+']',_0x5bade[_0x037d('0x1c')]);_0x5d3403(_0x5bade[_0x037d('0x1c')]);});});}function getTicket(_0xd8cc40,_0x40c185,_0x4f9db5,_0xebd342,_0x277151){return function(_0x1c2b27){logger[_0x037d('0x11')](_0x037d('0x34'));return new Promise(function(_0x4d5862,_0x49ba21){var _0x3a0b16=moment();var _0x1aa153={'method':_0x037d('0x2f'),'uri':_0x4f9db5+'/api/tasks','body':{'title':intUtil[_0x037d('0x35')](_0xebd342[_0x037d('0x36')],_0x277151,'\x20'),'description':intUtil[_0x037d('0x35')](_0xebd342[_0x037d('0x37')],_0x277151,'\x0a'),'owner_id':_0x1c2b27['userId'],'creater_id':_0x1c2b27[_0x037d('0x16')],'targetable_id':_0x1c2b27[_0x037d('0x2b')],'targetable_type':_0x037d('0x38'),'created_at':_0x3a0b16[_0x037d('0x27')](_0x037d('0x31')),'due_date':_0x3a0b16['add'](0x1e,'m')['format'](_0x037d('0x31'))},'json':!![]};_0x1aa153[_0x037d('0x10')]=_0x40c185;return rp(_0x1aa153)[_0x037d('0x12')](function(_0x3cfbc0){_0x1c2b27[_0x037d('0x39')]=_0x3cfbc0[_0x037d('0x3a')]['id'];logger[_0x037d('0x11')](_0x037d('0x3b'),_0x1c2b27[_0x037d('0x39')]);_0x4d5862(_0x1c2b27);})[_0x037d('0x19')](function(_0x20a270){logger['error']('['+[_0xd8cc40['toUpperCase']()]+']',_0x20a270['message']);_0x49ba21(_0x20a270[_0x037d('0x1c')]);});});};}function emit(_0x52d1ba,_0x373db3,_0x3db92c){var _0x12ab2f={'uri':_0x52d1ba+_0x037d('0x3c')+_0x3db92c};io['to'](util[_0x037d('0x27')]('user:%s',_0x373db3))[_0x037d('0x3d')](_0x037d('0x3e'),_0x12ab2f);}exports['cs']=function(_0x186f1b,_0x426911,_0x24eda1,_0x5670d6,_0x205dbb,_0x1476ed,_0x5d2c2b,_0xd80e45){var _0x2e69b8={};var _0x1fc527={'Authorization':_0x037d('0x3f')+_0x1476ed[_0x037d('0x40')]};_0x1476ed[_0x037d('0x41')]=intUtil[_0x037d('0x42')](_0x1476ed[_0x037d('0x41')]);_0x1476ed[_0x037d('0x43')]=intUtil[_0x037d('0x42')](_0x1476ed[_0x037d('0x43')]);var _0x428312=_0x1476ed[_0x037d('0x41')];_0x2e69b8['adminEmail']=_0x1476ed[_0x037d('0x44')];_0x2e69b8[_0x037d('0x29')]=_0xd80e45['toLowerCase']()===_0x037d('0x45')?_0x426911['destcalleridnum']:_0x426911[_0x037d('0x46')];_0x2e69b8[_0x037d('0x47')]=_0xd80e45===_0x037d('0x48')||_0xd80e45==='unmanaged'?_0x037d('0x48'):'outbound';if(_0x5670d6){_0x2e69b8[_0x037d('0x1d')]=_0x5670d6['email'];}var _0x31a94e=util[_0x037d('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1476ed[_0x037d('0x43')],_0x426911[_0x037d('0x49')],md5(_0x426911['uniqueid']));if(_0x205dbb&&_0x205dbb[_0x037d('0x4a')]){logger[_0x037d('0x11')](_0x037d('0x4b'),_0x037d('0x4c'));_0x426911[_0x037d('0x4d')]=_0x31a94e;}else if(_0x5d2c2b&&_0x5d2c2b[_0x037d('0x4e')]&&_0x5d2c2b[_0x037d('0x4e')]!==_0x037d('0x4f')){logger[_0x037d('0x11')]('[OUTBOUND]',_0x037d('0x4c'));_0x426911['recordingURL']=_0x31a94e;}else{_0x426911[_0x037d('0x4d')]='';}return getAdminId(_0x2e69b8,_0xd80e45,_0x1fc527,_0x428312)[_0x037d('0x12')](getUser(_0xd80e45,_0x1fc527,_0x428312))[_0x037d('0x12')](getEndUser(_0xd80e45,_0x1fc527,_0x428312))[_0x037d('0x12')](getTicket(_0xd80e45,_0x1fc527,_0x428312,_0x24eda1,_0x426911))['then'](function(_0x2b82c3){logger[_0x037d('0x11')](util['format'](_0x037d('0x50'),_0x2b82c3[_0x037d('0x39')]));if(_0xd80e45!==_0x037d('0x51')){logger[_0x037d('0x11')]('['+[_0xd80e45[_0x037d('0x1b')]()]+']',_0x037d('0x52'));emit(_0x428312,_0x5670d6[_0x037d('0x53')],_0x2b82c3[_0x037d('0x2b')]);}})['catch'](function(_0x3cbc8b){logger[_0x037d('0x1a')]('['+[_0xd80e45[_0x037d('0x1b')]()]+_0x037d('0x54'),util['inspect'](_0x3cbc8b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd7ba=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','adminEmail','error','toUpperCase','message','/api/lookup?q=','&f=','&entities=contact','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','Task\x20created:','/contacts/','user:%s','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0xd7ba,0x1f0));var _0xad7b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd7ba[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var rp=require(_0xad7b('0x0'));var md5=require(_0xad7b('0x1'));var util=require(_0xad7b('0x2'));var moment=require(_0xad7b('0x3'));var Promise=require(_0xad7b('0x4'));var Redis=require('ioredis');var intUtil=require(_0xad7b('0x5'));var config=require(_0xad7b('0x6'));var logger=require(_0xad7b('0x7'))(_0xad7b('0x8'));config['redis']=_[_0xad7b('0x9')](config[_0xad7b('0xa')],{'host':_0xad7b('0xb'),'port':0x18eb});var io=require(_0xad7b('0xc'))(new Redis(config[_0xad7b('0xa')]));function getAdminId(_0x272d88,_0x185c95,_0x2a9753,_0x1c4f73){return new Promise(function(_0x3c9f92,_0x56a556){var _0x4eb97e=![];var _0x32013d={'method':_0xad7b('0xd'),'uri':_0x1c4f73+_0xad7b('0xe'),'json':!![]};_0x32013d[_0xad7b('0xf')]=_0x2a9753;logger[_0xad7b('0x10')](_0xad7b('0x11'));return rp(_0x32013d)[_0xad7b('0x12')](function(_0x129945){if(_0x129945){var _0x322127=_0x129945[_0xad7b('0x13')];var _0x3dc03f=null;for(_0x3dc03f=0x0;_0x3dc03f<_0x322127[_0xad7b('0x14')];_0x3dc03f++){if(_0x322127[_0x3dc03f][_0xad7b('0x15')]===_0x272d88['adminEmail']){_0x272d88[_0xad7b('0x16')]=_0x322127[_0x3dc03f]['id'];_0x4eb97e=!![];}}if(_0x4eb97e){logger[_0xad7b('0x10')](_0xad7b('0x17'),_0x272d88[_0xad7b('0x16')]);_0x3c9f92(_0x272d88);}else{_0x56a556({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x56a556({'statusCode':0x194,'message':_0xad7b('0x18')});}})['catch'](function(_0x155e5f){logger['error']('['+[_0x185c95['toUpperCase']()]+']',_0x155e5f['message']);_0x56a556(_0x155e5f);});});}function getUser(_0x2583c5,_0x3d3f67,_0x53132e){return function(_0x2662c3){return new Promise(function(_0x389eaa,_0x5d66d1){var _0x44548c={'method':_0xad7b('0xd'),'uri':_0x53132e+_0xad7b('0xe'),'json':!![]};_0x44548c[_0xad7b('0xf')]=_0x3d3f67;logger[_0xad7b('0x10')](_0xad7b('0x19'));return rp(_0x44548c)[_0xad7b('0x12')](function(_0x145b37){if(_0x145b37){var _0x28613d=_0x145b37[_0xad7b('0x13')];var _0x28b555=![];var _0x31ffb4=null;if(_0x2662c3[_0xad7b('0x1a')]!==null){logger['info'](_0xad7b('0x1b'),_0x2662c3[_0xad7b('0x1a')]);_0x2662c3['userEmail']=_0x2662c3[_0xad7b('0x1a')];for(_0x31ffb4=0x0;_0x31ffb4<_0x28613d[_0xad7b('0x14')];_0x31ffb4++){if(_0x28613d[_0x31ffb4][_0xad7b('0x15')]===_0x2662c3['agentEmail']){_0x28b555=!![];_0x2662c3[_0xad7b('0x1c')]=_0x28613d[_0x31ffb4]['id'];logger['info'](_0xad7b('0x1d'),_0x2662c3['userId']);}}}if(!_0x28b555){logger[_0xad7b('0x10')](_0xad7b('0x1e'));_0x2662c3['userEmail']=_0x2662c3[_0xad7b('0x1f')];_0x2662c3[_0xad7b('0x1c')]=_0x2662c3['adminId'];_0x28b555=!![];}if(_0x28b555){_0x389eaa(_0x2662c3);}else{_0x5d66d1({'statusCode':0x194,'message':_0xad7b('0x18')});}}else{_0x5d66d1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x123e8b){logger[_0xad7b('0x20')]('['+[_0x2583c5[_0xad7b('0x21')]()]+']',_0x123e8b[_0xad7b('0x22')]);_0x5d66d1(_0x123e8b);});});};}function searchContact(_0x4401d5,_0x26a0f3,_0x588dc5,_0x3a57e6){return new Promise(function(_0x45c58f,_0x4b03c3){var _0x597e39={'method':_0xad7b('0xd'),'headers':_0x26a0f3,'uri':_0x4401d5+_0xad7b('0x23')+_0x3a57e6+_0xad7b('0x24')+_0x588dc5+_0xad7b('0x25'),'json':!![]};rp(_0x597e39)['then'](function(_0x5bbe5f){var _0x500fcc=_['find'](_0x5bbe5f['contacts'][_0xad7b('0x26')],[_0x588dc5,_0x3a57e6]);_0x45c58f(_0x500fcc);})[_0xad7b('0x27')](function(_0x321434){_0x4b03c3(_0x321434);});});}function getEndUser(_0x1ccae7,_0x5e89be,_0x730a69){return function(_0x441562){return new Promise(function(_0x5b301e,_0x199308){logger[_0xad7b('0x10')](util[_0xad7b('0x28')](_0xad7b('0x29'),_0x441562[_0xad7b('0x2a')]));searchContact(_0x730a69,_0x5e89be,_0xad7b('0x2b'),_0x441562[_0xad7b('0x2a')])[_0xad7b('0x12')](function(_0x178fc5){if(_0x178fc5){_0x441562[_0xad7b('0x2c')]=_0x178fc5['id'];logger[_0xad7b('0x10')](_0xad7b('0x2d'),_0x441562[_0xad7b('0x2c')]);return _0x5b301e(_0x441562);}searchContact(_0x730a69,_0x5e89be,'work_number',_0x441562[_0xad7b('0x2a')])[_0xad7b('0x12')](function(_0x139f93){if(_0x139f93){_0x441562[_0xad7b('0x2c')]=_0x139f93['id'];logger[_0xad7b('0x10')](_0xad7b('0x2e'),_0x441562[_0xad7b('0x2c')]);return _0x5b301e(_0x441562);}createEndUser(_0x441562,_0x1ccae7,_0x5e89be,_0x730a69)[_0xad7b('0x12')](function(_0x52f0af){logger['info'](_0xad7b('0x2f'),_0x52f0af[_0xad7b('0x2c')]);return _0x5b301e(_0x52f0af);});});})['catch'](function(_0x865cec){_0x199308(_0x865cec);});});};}function createEndUser(_0x4694a5,_0x4f9423,_0x136652,_0x46030f){return new Promise(function(_0x40d6d8,_0x71e9f2){var _0x23bb21=moment();var _0x26da00={'method':_0xad7b('0x30'),'uri':_0x46030f+'/api/contacts','body':{'contact':{'last_name':_0x4694a5['contactNumber'],'work_number':_0x4694a5[_0xad7b('0x2a')],'mobile_number':_0x4694a5['contactNumber'],'owner_id':_0x4694a5['userId'],'created_at':_0x23bb21[_0xad7b('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x26da00[_0xad7b('0xf')]=_0x136652;logger[_0xad7b('0x10')](_0xad7b('0x31'));return rp(_0x26da00)[_0xad7b('0x12')](function(_0x78a4ee){_0x4694a5[_0xad7b('0x2c')]=_0x78a4ee['contact']['id'];_0x40d6d8(_0x4694a5);})[_0xad7b('0x27')](function(_0x38ccbf){logger['error']('['+[_0x4f9423[_0xad7b('0x21')]()]+']',_0x38ccbf[_0xad7b('0x22')]);_0x71e9f2(_0x38ccbf[_0xad7b('0x22')]);});});}function getTicket(_0x47a9e4,_0x468c30,_0x19f55a,_0x9ed249,_0x2c8b46){return function(_0x12e19f){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x16391d,_0x590e71){var _0x3e6b77=moment();var _0x27dc02={'method':_0xad7b('0x30'),'uri':_0x19f55a+'/api/tasks','body':{'title':intUtil[_0xad7b('0x32')](_0x9ed249['Subjects'],_0x2c8b46,'\x20'),'description':intUtil[_0xad7b('0x32')](_0x9ed249[_0xad7b('0x33')],_0x2c8b46,'\x0a'),'owner_id':_0x12e19f[_0xad7b('0x1c')],'creater_id':_0x12e19f[_0xad7b('0x16')],'targetable_id':_0x12e19f[_0xad7b('0x2c')],'targetable_type':_0xad7b('0x34'),'created_at':_0x3e6b77[_0xad7b('0x28')](_0xad7b('0x35')),'due_date':_0x3e6b77[_0xad7b('0x36')](0x1e,'m')[_0xad7b('0x28')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x27dc02[_0xad7b('0xf')]=_0x468c30;return rp(_0x27dc02)[_0xad7b('0x12')](function(_0xa7d684){_0x12e19f[_0xad7b('0x37')]=_0xa7d684['task']['id'];logger['info'](_0xad7b('0x38'),_0x12e19f[_0xad7b('0x37')]);_0x16391d(_0x12e19f);})[_0xad7b('0x27')](function(_0x165e2a){logger[_0xad7b('0x20')]('['+[_0x47a9e4[_0xad7b('0x21')]()]+']',_0x165e2a[_0xad7b('0x22')]);_0x590e71(_0x165e2a['message']);});});};}function emit(_0x368719,_0x1d0a2b,_0x17bf62){var _0x30eee4={'uri':_0x368719+_0xad7b('0x39')+_0x17bf62};io['to'](util[_0xad7b('0x28')](_0xad7b('0x3a'),_0x1d0a2b))['emit']('trigger:browser:url',_0x30eee4);}exports['cs']=function(_0x3d83c2,_0x9aaa5,_0x10ecee,_0x29ceb6,_0x4d4b26,_0x3fb793,_0x55fac1,_0x4ef69c){var _0x97c11f={};var _0xbd23f0={'Authorization':'Token\x20token='+_0x3fb793['apiKey']};_0x3fb793['remoteUri']=intUtil['stripTrailingSlash'](_0x3fb793[_0xad7b('0x3b')]);_0x3fb793[_0xad7b('0x3c')]=intUtil[_0xad7b('0x3d')](_0x3fb793[_0xad7b('0x3c')]);var _0x2508b4=_0x3fb793[_0xad7b('0x3b')];_0x97c11f[_0xad7b('0x1f')]=_0x3fb793['username'];_0x97c11f['contactNumber']=_0x4ef69c[_0xad7b('0x3e')]()===_0xad7b('0x3f')?_0x9aaa5['destcalleridnum']:_0x9aaa5[_0xad7b('0x40')];_0x97c11f[_0xad7b('0x41')]=_0x4ef69c===_0xad7b('0x42')||_0x4ef69c===_0xad7b('0x43')?'queue':_0xad7b('0x3f');if(_0x29ceb6){_0x97c11f[_0xad7b('0x1a')]=_0x29ceb6[_0xad7b('0x15')];}var _0x340d40=util[_0xad7b('0x28')](_0xad7b('0x44'),_0x3fb793[_0xad7b('0x3c')],_0x9aaa5[_0xad7b('0x45')],md5(_0x9aaa5['uniqueid']));if(_0x4d4b26&&_0x4d4b26[_0xad7b('0x46')]){logger[_0xad7b('0x10')](_0xad7b('0x47'),_0xad7b('0x48'));_0x9aaa5[_0xad7b('0x49')]=_0x340d40;}else if(_0x55fac1&&_0x55fac1[_0xad7b('0x4a')]&&_0x55fac1[_0xad7b('0x4a')]!==_0xad7b('0x4b')){logger['info'](_0xad7b('0x4c'),_0xad7b('0x48'));_0x9aaa5[_0xad7b('0x49')]=_0x340d40;}else{_0x9aaa5[_0xad7b('0x49')]='';}return getAdminId(_0x97c11f,_0x4ef69c,_0xbd23f0,_0x2508b4)[_0xad7b('0x12')](getUser(_0x4ef69c,_0xbd23f0,_0x2508b4))[_0xad7b('0x12')](getEndUser(_0x4ef69c,_0xbd23f0,_0x2508b4))[_0xad7b('0x12')](getTicket(_0x4ef69c,_0xbd23f0,_0x2508b4,_0x10ecee,_0x9aaa5))[_0xad7b('0x12')](function(_0x140126){logger[_0xad7b('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x140126[_0xad7b('0x37')]));if(_0x4ef69c!==_0xad7b('0x43')){logger[_0xad7b('0x10')]('['+[_0x4ef69c[_0xad7b('0x21')]()]+']',_0xad7b('0x4d'));emit(_0x2508b4,_0x29ceb6[_0xad7b('0x4e')],_0x140126[_0xad7b('0x2c')]);}})['catch'](function(_0x44749f){logger[_0xad7b('0x20')]('['+[_0x4ef69c[_0xad7b('0x21')]()]+_0xad7b('0x4f'),util['inspect'](_0x44749f,{'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 822a242..c87dab9 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 _0xc9b0=['data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x3cad2d,_0x29db57){var _0x3b977e=function(_0x55f8b6){while(--_0x55f8b6){_0x3cad2d['push'](_0x3cad2d['shift']());}};_0x3b977e(++_0x29db57);}(_0xc9b0,0x14c));var _0x0c9b=function(_0x49d316,_0x613add){_0x49d316=_0x49d316-0x0;var _0x2f4d21=_0xc9b0[_0x49d316];return _0x2f4d21;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var zendesk=require(_0x0c9b('0x2'));var salesforce=require(_0x0c9b('0x3'));var sugarcrm=require(_0x0c9b('0x4'));var freshdesk=require(_0x0c9b('0x5'));var zoho=require(_0x0c9b('0x6'));var desk=require(_0x0c9b('0x7'));var vtiger=require(_0x0c9b('0x8'));var servicenow=require(_0x0c9b('0x9'));var dynamics365=require(_0x0c9b('0xa'));var freshsales=require('./freshsales');var integrations=[_0x0c9b('0xb'),_0x0c9b('0xc'),_0x0c9b('0xd'),_0x0c9b('0xe'),_0x0c9b('0xf'),_0x0c9b('0x10'),_0x0c9b('0x11'),_0x0c9b('0x12'),_0x0c9b('0x13'),_0x0c9b('0x14')];exports[_0x0c9b('0x15')]=function(_0x4ce719,_0x489177,_0xe083d2,_0x43dda4,_0x58d519,_0x34f2db){if(_0xe083d2){if(_[_0x0c9b('0x16')](integrations,_0x4ce719['data1'][_0x0c9b('0x17')]())){try{var _0x3dbe2f=null;var _0x22c253='';var _0xf99f03=_0xe083d2[_0x4ce719[_0x0c9b('0x18')]['toLowerCase']()];if(_0xf99f03){var _0x1da456=_0xf99f03[_0x4ce719['data2']];if(_0x1da456){var _0x3df51c=_[_0x0c9b('0x19')](_0x1da456[_0x0c9b('0x1a')],{'id':parseInt(_0x4ce719['data3'],0xa)});if(_0x3df51c){if(_0x43dda4){if(_0x58d519&&_0x489177[_0x0c9b('0x1b')]){_0x22c253='queue';}else if(_0x489177[_0x0c9b('0x1c')]){_0x22c253=_0x0c9b('0x1d');}else{console[_0x0c9b('0x1e')](_0x0c9b('0x1f'),_0x489177);}}else{_0x22c253=_0x0c9b('0x20');}switch(_0x4ce719[_0x0c9b('0x18')][_0x0c9b('0x17')]()){case _0x0c9b('0xb'):zendesk[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case'salesforce':salesforce[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case _0x0c9b('0xd'):sugarcrm[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case _0x0c9b('0xe'):freshdesk[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case _0x0c9b('0xf'):zoho[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case _0x0c9b('0x10'):desk[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case'vtiger':vtiger[_0x22c253](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db);break;case _0x0c9b('0x13'):freshsales['cs'](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db,_0x22c253);break;case _0x0c9b('0x14'):servicenow['cs'](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db,_0x22c253);break;case _0x0c9b('0x12'):dynamics365['cs'](_0x4ce719,_0x489177,_0x3df51c,_0x43dda4,_0x58d519,_0x1da456,_0x34f2db,_0x22c253);break;default:console['log']('unknown\x20integration');}}else{_0x3dbe2f=require('../../../../config/logger')(_0x4ce719['data1'][_0x0c9b('0x17')]());_0x3dbe2f[_0x0c9b('0x21')](_0x0c9b('0x22'),util[_0x0c9b('0x23')](_0x0c9b('0x24'),_0x4ce719['data1'][_0x0c9b('0x17')](),_0x4ce719[_0x0c9b('0x25')]));}}else{_0x3dbe2f=require(_0x0c9b('0x26'))(_0x4ce719[_0x0c9b('0x18')]['toLowerCase']());_0x3dbe2f[_0x0c9b('0x21')]('[EXEC]',util[_0x0c9b('0x23')](_0x0c9b('0x27'),_0x4ce719[_0x0c9b('0x18')][_0x0c9b('0x17')](),_0x4ce719[_0x0c9b('0x28')]));}}else{}}catch(_0x23ac7a){console[_0x0c9b('0x21')](_0x23ac7a);}}}}; \ No newline at end of file +var _0x16d1=['data1','toLowerCase','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','vtiger','servicenow','unknown\x20integration','error','format','../../../../config/logger','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','dynamics365','freshsales','exec','includes'];(function(_0x3665de,_0x5b35b4){var _0x2f98b4=function(_0xb96719){while(--_0xb96719){_0x3665de['push'](_0x3665de['shift']());}};_0x2f98b4(++_0x5b35b4);}(_0x16d1,0xc9));var _0x116d=function(_0x57a2ca,_0x172d5e){_0x57a2ca=_0x57a2ca-0x0;var _0x16e258=_0x16d1[_0x57a2ca];return _0x16e258;};'use strict';var _=require(_0x116d('0x0'));var util=require(_0x116d('0x1'));var zendesk=require(_0x116d('0x2'));var salesforce=require(_0x116d('0x3'));var sugarcrm=require(_0x116d('0x4'));var freshdesk=require(_0x116d('0x5'));var zoho=require(_0x116d('0x6'));var desk=require(_0x116d('0x7'));var vtiger=require(_0x116d('0x8'));var servicenow=require(_0x116d('0x9'));var dynamics365=require(_0x116d('0xa'));var freshsales=require(_0x116d('0xb'));var integrations=[_0x116d('0xc'),_0x116d('0xd'),_0x116d('0xe'),_0x116d('0xf'),'zoho',_0x116d('0x10'),'vtiger',_0x116d('0x11'),_0x116d('0x12'),'servicenow'];exports[_0x116d('0x13')]=function(_0x1a876a,_0xe9ea69,_0x265709,_0x5afdc8,_0x3c9fd3,_0x9d5071){if(_0x265709){if(_[_0x116d('0x14')](integrations,_0x1a876a[_0x116d('0x15')][_0x116d('0x16')]())){try{var _0x44f347=null;var _0x1a5a2f='';var _0x43ab5b=_0x265709[_0x1a876a[_0x116d('0x15')]['toLowerCase']()];if(_0x43ab5b){var _0x4891ad=_0x43ab5b[_0x1a876a['data2']];if(_0x4891ad){var _0x5866e0=_[_0x116d('0x17')](_0x4891ad[_0x116d('0x18')],{'id':parseInt(_0x1a876a[_0x116d('0x19')],0xa)});if(_0x5866e0){if(_0x5afdc8){if(_0x3c9fd3&&_0xe9ea69[_0x116d('0x1a')]){_0x1a5a2f=_0x116d('0x1a');}else if(_0xe9ea69['routeId']){_0x1a5a2f=_0x116d('0x1b');}else{console[_0x116d('0x1c')](_0x116d('0x1d'),_0xe9ea69);}}else{_0x1a5a2f='unmanaged';}switch(_0x1a876a[_0x116d('0x15')][_0x116d('0x16')]()){case _0x116d('0xc'):zendesk[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case _0x116d('0xd'):salesforce[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case _0x116d('0xe'):sugarcrm[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case _0x116d('0xf'):freshdesk[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case'zoho':zoho[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case'desk':desk[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case _0x116d('0x1e'):vtiger[_0x1a5a2f](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071);break;case _0x116d('0x12'):freshsales['cs'](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071,_0x1a5a2f);break;case _0x116d('0x1f'):servicenow['cs'](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071,_0x1a5a2f);break;case _0x116d('0x11'):dynamics365['cs'](_0x1a876a,_0xe9ea69,_0x5866e0,_0x5afdc8,_0x3c9fd3,_0x4891ad,_0x9d5071,_0x1a5a2f);break;default:console['log'](_0x116d('0x20'));}}else{_0x44f347=require('../../../../config/logger')(_0x1a876a['data1'][_0x116d('0x16')]());_0x44f347[_0x116d('0x21')]('[EXEC]',util[_0x116d('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1a876a[_0x116d('0x15')][_0x116d('0x16')](),_0x1a876a[_0x116d('0x19')]));}}else{_0x44f347=require(_0x116d('0x23'))(_0x1a876a[_0x116d('0x15')][_0x116d('0x16')]());_0x44f347[_0x116d('0x21')]('[EXEC]',util[_0x116d('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x1a876a[_0x116d('0x15')][_0x116d('0x16')](),_0x1a876a[_0x116d('0x24')]));}}else{}}catch(_0x51d703){console[_0x116d('0x21')](_0x51d703);}}}}; \ 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 093b140..b1a3bd8 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 _0xabdb=['../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString','Subjects','ticketType','ActivityDate','IsReminderSet','endUserType','contact','lead','WhatId','Case','ContactId','AccountId','leadId','info','sobject','create','isNil','validateEmail','User','find','execute','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','No\x20Company','account','upperFirst','includes','idField','content','toString','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase','request-promise','bluebird','md5','jsforce','./util'];(function(_0x545a69,_0x353dbd){var _0x219923=function(_0x355884){while(--_0x355884){_0x545a69['push'](_0x545a69['shift']());}};_0x219923(++_0x353dbd);}(_0xabdb,0xe3));var _0xbabd=function(_0x232ae0,_0x161b4c){_0x232ae0=_0x232ae0-0x0;var _0x12e1af=_0xabdb[_0x232ae0];return _0x12e1af;};'use strict';var _=require('lodash');var rp=require(_0xbabd('0x0'));var moment=require('moment');var BPromise=require(_0xbabd('0x1'));var md5=require(_0xbabd('0x2'));var jsforce=require(_0xbabd('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xbabd('0x4'));var config=require(_0xbabd('0x5'));var logger=require(_0xbabd('0x6'))(_0xbabd('0x7'));config[_0xbabd('0x8')]=_[_0xbabd('0x9')](config[_0xbabd('0x8')],{'host':_0xbabd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2eed58,_0x47d635,_0x32e55d){io['to'](_0x2eed58)[_0xbabd('0xb')](_0x47d635,_0x32e55d);}function getTicket(_0x45a52e,_0x5551f3,_0x220392,_0x403ed8,_0x3f4dd4,_0x4f9cac,_0x36b34a,_0x31dfa1){var _0x559fe4=Object['assign']({},{'OwnerId':_0x5551f3['id'],'Subject':intUtil[_0xbabd('0xc')](_0x403ed8[_0xbabd('0xd')],_0x3f4dd4,'\x20'),'Description':intUtil['getString'](_0x403ed8['Descriptions'],_0x3f4dd4,'\x0a')},getCustomFields(_0x4f9cac,_0x3f4dd4));if(_0x220392){if(_0x403ed8[_0xbabd('0xe')]==='Task'){_0x559fe4[_0xbabd('0xf')]=moment['utc']();_0x559fe4[_0xbabd('0x10')]=![];_0x559fe4['IsRecurrence']=![];if(_0x220392[_0xbabd('0x11')]===_0xbabd('0x12')||_0x220392[_0xbabd('0x11')]===_0xbabd('0x13')){_0x559fe4['WhoId']=_0x220392['id'];}else if(_0x220392[_0xbabd('0x11')]==='account'){_0x559fe4[_0xbabd('0x14')]=_0x220392['id'];}}else if(_0x403ed8['ticketType']===_0xbabd('0x15')){if(_0x220392[_0xbabd('0x11')]==='contact'){_0x559fe4[_0xbabd('0x16')]=_0x220392['id'];}else if(_0x220392[_0xbabd('0x11')]==='account'){_0x559fe4[_0xbabd('0x17')]=_0x220392['id'];}else if(_0x220392[_0xbabd('0x11')]===_0xbabd('0x13')&&_0x403ed8[_0xbabd('0x18')]){_0x559fe4[_0x403ed8['leadId']]=_0x220392['id'];}else{logger[_0xbabd('0x19')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x36b34a[_0xbabd('0x1a')](_0x403ed8[_0xbabd('0xe')])[_0xbabd('0x1b')](_0x559fe4);}function getUser(_0x5053af,_0x1e814e,_0x119133){if(!_[_0xbabd('0x1c')](_0x1e814e)&&intUtil[_0xbabd('0x1d')](_0x1e814e)){var _0x652ab6={'Email':_0x1e814e};var _0x4b6d45={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x119133[_0xbabd('0x1a')](_0xbabd('0x1e'))[_0xbabd('0x1f')](_0x652ab6,_0x4b6d45)[_0xbabd('0x20')]()['then'](function(_0x424f55){if(_0x424f55[_0xbabd('0x21')]){var _0x4a23f2=_[_0xbabd('0x1f')](_0x424f55,function(_0x526234){return _0x526234[_0xbabd('0x22')]===_0x1e814e;});if(_0x4a23f2){logger[_0xbabd('0x19')]('Agent\x20%s\x20found.',_0x1e814e);return BPromise[_0xbabd('0x23')]({'id':_0x4a23f2['Id'],'name':_0x4a23f2[_0xbabd('0x24')]});}}else{logger[_0xbabd('0x19')](_0xbabd('0x25'),_0x1e814e);return _0x119133[_0xbabd('0x26')]()['then'](function(_0x45dd45){return BPromise[_0xbabd('0x23')]({'id':_0x45dd45['user_id'],'name':_0x45dd45[_0xbabd('0x27')]});});}});}else{logger[_0xbabd('0x19')](_0xbabd('0x25'),_0x1e814e);return _0x119133[_0xbabd('0x26')]()[_0xbabd('0x28')](function(_0x59539e){return BPromise[_0xbabd('0x23')]({'id':_0x59539e[_0xbabd('0x29')],'name':_0x59539e[_0xbabd('0x27')]});});}}function getEndUser(_0x530b8a,_0x394166,_0x12469a,_0x28a5da,_0x2d61e0){var _0x21880b={'$or':{'Phone':_0x28a5da}};var _0x4f47a5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbabd('0x23')]()['then'](function(){logger[_0xbabd('0x19')](_0xbabd('0x2a'),_0x28a5da,_0x394166[_0xbabd('0x2b')]);switch(_0x394166[_0xbabd('0x2b')]){case _0xbabd('0x2c'):var _0x4cc925=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166['additionalSearchContact']){var _0x3c7445={};_0x3c7445[_0x394166[_0xbabd('0x2e')]]=_0x28a5da;_['merge'](_0x4cc925[_0xbabd('0x2f')],_0x3c7445);}return _0x2d61e0[_0xbabd('0x1a')]('Contact')['find'](_0x4cc925,_0x4f47a5)[_0xbabd('0x20')]()[_0xbabd('0x28')](function(_0x1492e7){if(_0x1492e7&&_0x1492e7['length']){return _0x1492e7;}else{var _0x3c57d0=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x30')]){var _0x4f2cda={};_0x4f2cda[_0x394166[_0xbabd('0x30')]]=_0x28a5da;_[_0xbabd('0x31')](_0x3c57d0['$or'],_0x4f2cda);}return _0x2d61e0['sobject'](_0xbabd('0x32'))[_0xbabd('0x1f')](_0x3c57d0,_0x4f47a5);}});case _0xbabd('0x33'):var _0x53b0e2=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x34')]){var _0x3c7445={};_0x3c7445[_0x394166['additionalSearchAccount']]=_0x28a5da;_[_0xbabd('0x31')](_0x53b0e2['$or'],_0x3c7445);}return _0x2d61e0[_0xbabd('0x1a')](_0xbabd('0x35'))[_0xbabd('0x1f')](_0x53b0e2,_0x4f47a5)[_0xbabd('0x20')]()['then'](function(_0x3b9db9){if(_0x3b9db9&&_0x3b9db9[_0xbabd('0x21')]){return _0x3b9db9;}else{var _0x2805a5=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x2e')]){var _0x40ee94={};_0x40ee94[_0x394166[_0xbabd('0x2e')]]=_0x28a5da;_[_0xbabd('0x31')](_0x2805a5[_0xbabd('0x2f')],_0x40ee94);}return _0x2d61e0['sobject']('Contact')['find'](_0x2805a5,_0x4f47a5)[_0xbabd('0x28')](function(_0xd52555){if(_0xd52555&&_0xd52555['length']){return _0xd52555;}else{var _0x4e2b52=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x30')]){var _0x26bb7d={};_0x26bb7d[_0x394166['additionalSearchLead']]=_0x28a5da;_[_0xbabd('0x31')](_0x4e2b52[_0xbabd('0x2f')],_0x26bb7d);}return _0x2d61e0['sobject'](_0xbabd('0x32'))[_0xbabd('0x1f')](_0x4e2b52,_0x4f47a5);}});}});case'contact':var _0x4cc925=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x2e')]){var _0x3c7445={};_0x3c7445[_0x394166[_0xbabd('0x2e')]]=_0x28a5da;_['merge'](_0x4cc925[_0xbabd('0x2f')],_0x3c7445);}return _0x2d61e0[_0xbabd('0x1a')](_0xbabd('0x36'))[_0xbabd('0x1f')](_0x4cc925,_0x4f47a5)['execute']();case _0xbabd('0x13'):var _0x5ae09b=_[_0xbabd('0x2d')](_0x21880b);if(_0x394166[_0xbabd('0x30')]){var _0x3c7445={};_0x3c7445[_0x394166[_0xbabd('0x30')]]=_0x28a5da;_[_0xbabd('0x31')](_0x5ae09b[_0xbabd('0x2f')],_0x3c7445);}return _0x2d61e0['sobject'](_0xbabd('0x32'))[_0xbabd('0x1f')](_0x5ae09b,_0x4f47a5);case'account':var _0x53b0e2=_['cloneDeep'](_0x21880b);if(_0x394166['additionalSearchAccount']){var _0x3c7445={};_0x3c7445[_0x394166[_0xbabd('0x34')]]=_0x28a5da;_[_0xbabd('0x31')](_0x53b0e2[_0xbabd('0x2f')],_0x3c7445);}return _0x2d61e0[_0xbabd('0x1a')]('Account')['find'](_0x53b0e2,_0x4f47a5);default:return null;}})['then'](function(_0x17afdf){if(_0x17afdf&&_0x17afdf['length']){var _0x111860=_['first'](_0x17afdf);if(_0x111860){return BPromise[_0xbabd('0x23')]({'id':_0x111860['Id'],'name':_0x111860[_0xbabd('0x24')],'phone':_0x111860['Phone'],'endUserType':_0x111860['attributes'][_0xbabd('0x37')][_0xbabd('0x38')]()});}}})[_0xbabd('0x28')](function(_0x525553){if(_0x525553){logger[_0xbabd('0x19')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x525553[_0xbabd('0x11')],_0x28a5da);return BPromise['resolve'](_0x525553);}else{logger[_0xbabd('0x19')](_0xbabd('0x39'),_0x28a5da);var _0x4c5f5b={'Phone':_0x28a5da};if(_0x394166[_0xbabd('0x3a')]){if(_0x394166[_0xbabd('0x3a')]===_0xbabd('0x12')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x28a5da,_0x394166['moduleCreate']);_0x4c5f5b['LastName']=_0x12469a!==''?_0x12469a:util[_0xbabd('0x3b')](_0xbabd('0x3c'),_0x28a5da);}else if(_0x394166[_0xbabd('0x3a')]==='lead'){logger[_0xbabd('0x19')](_0xbabd('0x3d'),_0x28a5da,_0x394166[_0xbabd('0x3a')]);_0x4c5f5b[_0xbabd('0x3e')]=_0x12469a!==_0xbabd('0x3f')?_0x12469a:util[_0xbabd('0x3b')](_0xbabd('0x3c'),_0x28a5da);_0x4c5f5b['Company']=_0xbabd('0x40');}else if(_0x394166[_0xbabd('0x3a')]===_0xbabd('0x41')){logger['info'](_0xbabd('0x3d'),_0x28a5da,_0x394166['moduleCreate']);_0x4c5f5b[_0xbabd('0x24')]=_0x12469a!==''?_0x12469a:util[_0xbabd('0x3b')](_0xbabd('0x3c'),_0x28a5da);}else{return null;}}return _0x2d61e0[_0xbabd('0x1a')](_[_0xbabd('0x42')](_0x394166['moduleCreate']))['create'](_0x4c5f5b)[_0xbabd('0x28')](function(_0x1cca31){return BPromise[_0xbabd('0x23')]({'id':_0x1cca31['id'],'endUserType':_0x394166['moduleCreate']});});}});}function getCustomFields(_0x595056,_0x15661d){var _0x498bef={};if(_0x595056[_0xbabd('0x21')]>0x0){_['forEach'](_0x595056,function(_0x589aea){if(_[_0xbabd('0x43')](['string','picklist'],_0x589aea['type'])&&_0x589aea['idField']){_0x498bef[_0x589aea[_0xbabd('0x44')]]=_0x589aea[_0xbabd('0x45')][_0xbabd('0x46')]();}else if(_0x589aea['type']==='variable'&&_0x589aea[_0xbabd('0x47')]&&_0x589aea[_0xbabd('0x44')]){_0x15661d[_0x589aea['variableName']]&&(_0x498bef[_0x589aea[_0xbabd('0x44')]]=_0x15661d[_0x589aea[_0xbabd('0x47')]]['toString']());}else if(_0x589aea[_0xbabd('0x37')]===_0xbabd('0x48')&&_0x589aea[_0xbabd('0x49')]&&_0x589aea[_0xbabd('0x49')][_0xbabd('0x4a')]&&_0x589aea['idField']){_0x15661d[_0x589aea[_0xbabd('0x49')]['name'][_0xbabd('0x38')]()]&&(_0x498bef[_0x589aea[_0xbabd('0x44')]]=_0x15661d[_0x589aea[_0xbabd('0x49')][_0xbabd('0x4a')][_0xbabd('0x38')]()]['toString']());}});}return _0x498bef;}function getConnection(_0x187119){var _0x368780=_0x187119['password'][_0xbabd('0x4b')](_0x187119[_0xbabd('0x4c')]);var _0x5c4079=new jsforce[(_0xbabd('0x4d'))]({'oauth2':{'loginUrl':_0x187119[_0xbabd('0x4e')]||_0xbabd('0x4f'),'clientId':_0x187119['clientId'],'clientSecret':_0x187119['clientSecret']}});return _0x5c4079[_0xbabd('0x50')](_0x187119[_0xbabd('0x51')],_0x368780)[_0xbabd('0x28')](function(){logger[_0xbabd('0x19')]('Connection\x20established.');return _0x5c4079;});}exports['queue']=function(_0x216bea,_0x543762,_0x4d931f,_0x273842,_0x2e6c9e,_0x101026){var _0xd6f39e,_0x38b158,_0x26d209,_0x49b835;_0x101026[_0xbabd('0x52')]=intUtil[_0xbabd('0x53')](_0x101026[_0xbabd('0x52')]);_0x101026[_0xbabd('0x4e')]=intUtil['stripTrailingSlash'](_0x101026[_0xbabd('0x4e')]);if(_0x2e6c9e&&_0x2e6c9e[_0xbabd('0x54')]){logger['info'](_0xbabd('0x55'),_0xbabd('0x56'));_0x543762['recordingURL']=util[_0xbabd('0x3b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x101026['serverUrl'],_0x543762['uniqueid'],md5(_0x543762[_0xbabd('0x57')]));}else{_0x543762[_0xbabd('0x58')]='';}return getConnection(_0x101026)['then'](function(_0x2b087a){_0x49b835=_0x2b087a;return getUser(_0x101026,_0x273842[_0xbabd('0x59')],_0x49b835);})['then'](function(_0x561015){_0xd6f39e=_0x561015;return getEndUser(_0x101026,_0x4d931f,_0x543762[_0xbabd('0x5a')],_0x543762[_0xbabd('0x5b')],_0x49b835);})[_0xbabd('0x28')](function(_0x198018){_0x38b158=_0x198018;return getTicket(_0x101026,_0xd6f39e,_0x38b158,_0x4d931f,_0x543762,_0x4d931f[_0xbabd('0x5c')],_0x49b835,_0xbabd('0x5d'));})[_0xbabd('0x28')](function(_0x4d03eb){_0x26d209=_0x4d03eb;logger[_0xbabd('0x19')](_0xbabd('0x5e'),_0x26d209['id']);logger['info'](_0xbabd('0x5f'),_0x26d209['id'],_0x273842[_0xbabd('0x4a')],_0x101026[_0xbabd('0x37')]);switch(_0x101026['type']){case _0xbabd('0x60'):emit(util[_0xbabd('0x3b')](_0xbabd('0x61'),_0x273842[_0xbabd('0x4a')]),_0xbabd('0x62'),{'recordId':_0x26d209['id']});break;case _0xbabd('0x63'):emit(util[_0xbabd('0x3b')](_0xbabd('0x61'),_0x273842[_0xbabd('0x4a')]),_0xbabd('0x64'),{'uri':util[_0xbabd('0x3b')](_0xbabd('0x65'),_0x49b835[_0xbabd('0x66')],_0x26d209['id'])});break;default:logger[_0xbabd('0x67')](_0xbabd('0x68'));}})[_0xbabd('0x69')](function(_0x45d410){logger[_0xbabd('0x67')](_0xbabd('0x55'),_0x45d410);});};exports['outbound']=function(_0x1aeaad,_0x9076e9,_0x5039a8,_0x5a5d0a,_0x39beeb,_0x502bf8,_0x465cc8){var _0x342a0c,_0x54a291,_0x6cb4a3,_0x18d067;_0x502bf8[_0xbabd('0x52')]=intUtil[_0xbabd('0x53')](_0x502bf8['serverUrl']);_0x502bf8[_0xbabd('0x4e')]=intUtil['stripTrailingSlash'](_0x502bf8['remoteUri']);if(_0x465cc8&&_0x465cc8[_0xbabd('0x6a')]&&_0x465cc8[_0xbabd('0x6a')]!==_0xbabd('0x6b')){logger[_0xbabd('0x19')](_0xbabd('0x6c'),_0xbabd('0x56'));_0x9076e9[_0xbabd('0x58')]=util['format'](_0xbabd('0x6d'),_0x502bf8['serverUrl'],_0x9076e9['uniqueid'],md5(_0x9076e9['uniqueid']));}return getConnection(_0x502bf8)[_0xbabd('0x28')](function(_0x1bb450){_0x18d067=_0x1bb450;return getUser(_0x502bf8,_0x5a5d0a[_0xbabd('0x59')],_0x18d067);})[_0xbabd('0x28')](function(_0x112ad9){_0x342a0c=_0x112ad9;return getEndUser(_0x502bf8,_0x5039a8,_0x9076e9[_0xbabd('0x6e')],_0x9076e9[_0xbabd('0x6f')],_0x18d067);})[_0xbabd('0x28')](function(_0x1a91f2){_0x54a291=_0x1a91f2;return getTicket(_0x502bf8,_0x342a0c,_0x54a291,_0x5039a8,_0x9076e9,_0x5039a8['Fields'],_0x18d067,'outbound');})[_0xbabd('0x28')](function(_0x151c78){_0x6cb4a3=_0x151c78;logger[_0xbabd('0x19')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x6cb4a3['id']);logger[_0xbabd('0x19')](_0xbabd('0x70'),_0x6cb4a3['id'],_0x5a5d0a['name'],_0x502bf8[_0xbabd('0x37')]);switch(_0x502bf8[_0xbabd('0x37')]){case _0xbabd('0x60'):emit(util['format'](_0xbabd('0x61'),_0x5a5d0a[_0xbabd('0x4a')]),_0xbabd('0x62'),{'recordId':_0x6cb4a3['id']});break;case _0xbabd('0x63'):emit(util[_0xbabd('0x3b')]('user:%s',_0x5a5d0a[_0xbabd('0x4a')]),_0xbabd('0x64'),{'uri':util[_0xbabd('0x3b')](_0xbabd('0x65'),_0x18d067['instanceUrl'],_0x6cb4a3['id'])});break;default:logger[_0xbabd('0x67')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbabd('0x69')](function(_0xa34470){logger[_0xbabd('0x67')](_0xbabd('0x6c'),_0xa34470);});};exports[_0xbabd('0x71')]=function(_0x153713,_0x541d86,_0x5b46af,_0x59386a,_0x182efa,_0x21924f){var _0x5646c2,_0x12bb1a,_0x4f391a,_0x2f3a00;_0x21924f[_0xbabd('0x52')]=intUtil[_0xbabd('0x53')](_0x21924f[_0xbabd('0x52')]);_0x21924f[_0xbabd('0x4e')]=intUtil[_0xbabd('0x53')](_0x21924f[_0xbabd('0x4e')]);if(_0x182efa&&_0x182efa[_0xbabd('0x54')]){logger[_0xbabd('0x19')]('['+_0x541d86['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x541d86[_0xbabd('0x58')]=util[_0xbabd('0x3b')](_0xbabd('0x6d'),_0x21924f[_0xbabd('0x52')],_0x541d86[_0xbabd('0x57')],md5(_0x541d86[_0xbabd('0x57')]));}else{_0x541d86[_0xbabd('0x58')]='';}return getConnection(_0x21924f)['then'](function(_0x1bc859){_0x2f3a00=_0x1bc859;if(!_[_0xbabd('0x1c')](_0x59386a)){return getUser(_0x21924f,_0x59386a[_0xbabd('0x4a')],_0x2f3a00);}else{return getUser(_0x21924f,null,_0x2f3a00);}})[_0xbabd('0x28')](function(_0xf72cbd){_0x5646c2=_0xf72cbd;return getEndUser(_0x21924f,_0x5b46af,_0x541d86[_0xbabd('0x5a')],_0x541d86[_0xbabd('0x5b')],_0x2f3a00);})[_0xbabd('0x28')](function(_0x33e5c4){_0x12bb1a=_0x33e5c4;return getTicket(_0x21924f,_0x5646c2,_0x12bb1a,_0x5b46af,_0x541d86,_0x5b46af[_0xbabd('0x5c')],_0x2f3a00);})[_0xbabd('0x28')](function(_0x218d98){_0x4f391a=_0x218d98;logger[_0xbabd('0x19')]('['+_0x541d86[_0xbabd('0x72')][_0xbabd('0x73')]()+']\x20Ticket\x20%s\x20created.',_0x4f391a['id']);logger[_0xbabd('0x19')]('['+_0x541d86[_0xbabd('0x72')][_0xbabd('0x73')]()+']\x20Integration\x20account\x20type\x20%s.',_0x21924f['type']);})[_0xbabd('0x69')](function(_0xe13e41){logger[_0xbabd('0x67')]('['+_0x541d86[_0xbabd('0x72')][_0xbabd('0x73')]()+']',_0xe13e41);});}; \ No newline at end of file +var _0x29df=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[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','%s/%s/e','instanceUrl','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase','calleridname','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','bluebird','md5','jsforce','util','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','lead','leadId','info','sobject','create','isNil','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','execute','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','length','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','forEach','string','picklist','content','toString','variableName','idField','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x10d6cf,_0x576e4e){var _0x2911a6=function(_0x12604c){while(--_0x12604c){_0x10d6cf['push'](_0x10d6cf['shift']());}};_0x2911a6(++_0x576e4e);}(_0x29df,0x117));var _0xf29d=function(_0x28fbc4,_0x341bea){_0x28fbc4=_0x28fbc4-0x0;var _0x1de879=_0x29df[_0x28fbc4];return _0x1de879;};'use strict';var _=require('lodash');var rp=require(_0xf29d('0x0'));var moment=require('moment');var BPromise=require(_0xf29d('0x1'));var md5=require(_0xf29d('0x2'));var jsforce=require(_0xf29d('0x3'));var util=require(_0xf29d('0x4'));var Redis=require('ioredis');var intUtil=require(_0xf29d('0x5'));var config=require(_0xf29d('0x6'));var logger=require('../../../../config/logger')('salesforce');config['redis']=_['defaults'](config[_0xf29d('0x7')],{'host':_0xf29d('0x8'),'port':0x18eb});var io=require(_0xf29d('0x9'))(new Redis(config[_0xf29d('0x7')]));function emit(_0x5f055c,_0x4a45d4,_0x212b79){io['to'](_0x5f055c)[_0xf29d('0xa')](_0x4a45d4,_0x212b79);}function getTicket(_0x3780a8,_0x38007a,_0x208e4a,_0xaf052e,_0x485771,_0x24d8e6,_0x19a36e,_0xd640ef){var _0x1c9a9e=Object['assign']({},{'OwnerId':_0x38007a['id'],'Subject':intUtil[_0xf29d('0xb')](_0xaf052e[_0xf29d('0xc')],_0x485771,'\x20'),'Description':intUtil['getString'](_0xaf052e[_0xf29d('0xd')],_0x485771,'\x0a')},getCustomFields(_0x24d8e6,_0x485771));if(_0x208e4a){if(_0xaf052e[_0xf29d('0xe')]===_0xf29d('0xf')){_0x1c9a9e[_0xf29d('0x10')]=moment[_0xf29d('0x11')]();_0x1c9a9e[_0xf29d('0x12')]=![];_0x1c9a9e[_0xf29d('0x13')]=![];if(_0x208e4a[_0xf29d('0x14')]===_0xf29d('0x15')||_0x208e4a[_0xf29d('0x14')]==='lead'){_0x1c9a9e[_0xf29d('0x16')]=_0x208e4a['id'];}else if(_0x208e4a[_0xf29d('0x14')]===_0xf29d('0x17')){_0x1c9a9e[_0xf29d('0x18')]=_0x208e4a['id'];}}else if(_0xaf052e[_0xf29d('0xe')]===_0xf29d('0x19')){if(_0x208e4a[_0xf29d('0x14')]==='contact'){_0x1c9a9e['ContactId']=_0x208e4a['id'];}else if(_0x208e4a[_0xf29d('0x14')]===_0xf29d('0x17')){_0x1c9a9e['AccountId']=_0x208e4a['id'];}else if(_0x208e4a[_0xf29d('0x14')]===_0xf29d('0x1a')&&_0xaf052e[_0xf29d('0x1b')]){_0x1c9a9e[_0xaf052e[_0xf29d('0x1b')]]=_0x208e4a['id'];}else{logger[_0xf29d('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x19a36e[_0xf29d('0x1d')](_0xaf052e[_0xf29d('0xe')])[_0xf29d('0x1e')](_0x1c9a9e);}function getUser(_0x41d0a5,_0x38f81a,_0x1d605b){if(!_[_0xf29d('0x1f')](_0x38f81a)&&intUtil['validateEmail'](_0x38f81a)){var _0x273259={'Email':_0x38f81a};var _0x44dd20={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1d605b[_0xf29d('0x1d')]('User')[_0xf29d('0x20')](_0x273259,_0x44dd20)['execute']()['then'](function(_0x5aafa1){if(_0x5aafa1['length']){var _0xe1cbe3=_[_0xf29d('0x20')](_0x5aafa1,function(_0x359e75){return _0x359e75[_0xf29d('0x21')]===_0x38f81a;});if(_0xe1cbe3){logger[_0xf29d('0x1c')](_0xf29d('0x22'),_0x38f81a);return BPromise[_0xf29d('0x23')]({'id':_0xe1cbe3['Id'],'name':_0xe1cbe3[_0xf29d('0x24')]});}}else{logger[_0xf29d('0x1c')](_0xf29d('0x25'),_0x38f81a);return _0x1d605b[_0xf29d('0x26')]()[_0xf29d('0x27')](function(_0x4feee7){return BPromise[_0xf29d('0x23')]({'id':_0x4feee7['user_id'],'name':_0x4feee7[_0xf29d('0x28')]});});}});}else{logger[_0xf29d('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x38f81a);return _0x1d605b[_0xf29d('0x26')]()[_0xf29d('0x27')](function(_0x3b2da9){return BPromise[_0xf29d('0x23')]({'id':_0x3b2da9[_0xf29d('0x29')],'name':_0x3b2da9[_0xf29d('0x28')]});});}}function getEndUser(_0x2d05a0,_0x143554,_0x491ca2,_0x51aeee,_0x424dca){var _0x21c1a5={'$or':{'Phone':_0x51aeee}};var _0x2401b3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf29d('0x23')]()[_0xf29d('0x27')](function(){logger[_0xf29d('0x1c')](_0xf29d('0x2a'),_0x51aeee,_0x143554[_0xf29d('0x2b')]);switch(_0x143554[_0xf29d('0x2b')]){case _0xf29d('0x2c'):var _0x385e28=_['cloneDeep'](_0x21c1a5);if(_0x143554[_0xf29d('0x2d')]){var _0x146025={};_0x146025[_0x143554[_0xf29d('0x2d')]]=_0x51aeee;_[_0xf29d('0x2e')](_0x385e28[_0xf29d('0x2f')],_0x146025);}return _0x424dca['sobject'](_0xf29d('0x30'))['find'](_0x385e28,_0x2401b3)[_0xf29d('0x31')]()['then'](function(_0x43524a){if(_0x43524a&&_0x43524a['length']){return _0x43524a;}else{var _0x4ea3bb=_[_0xf29d('0x32')](_0x21c1a5);if(_0x143554[_0xf29d('0x33')]){var _0x993c6f={};_0x993c6f[_0x143554['additionalSearchLead']]=_0x51aeee;_[_0xf29d('0x2e')](_0x4ea3bb['$or'],_0x993c6f);}return _0x424dca[_0xf29d('0x1d')](_0xf29d('0x34'))[_0xf29d('0x20')](_0x4ea3bb,_0x2401b3);}});case _0xf29d('0x35'):var _0x48d5a3=_[_0xf29d('0x32')](_0x21c1a5);if(_0x143554['additionalSearchAccount']){var _0x146025={};_0x146025[_0x143554[_0xf29d('0x36')]]=_0x51aeee;_[_0xf29d('0x2e')](_0x48d5a3[_0xf29d('0x2f')],_0x146025);}return _0x424dca[_0xf29d('0x1d')](_0xf29d('0x37'))[_0xf29d('0x20')](_0x48d5a3,_0x2401b3)[_0xf29d('0x31')]()[_0xf29d('0x27')](function(_0x5622c1){if(_0x5622c1&&_0x5622c1[_0xf29d('0x38')]){return _0x5622c1;}else{var _0x132a98=_['cloneDeep'](_0x21c1a5);if(_0x143554[_0xf29d('0x2d')]){var _0x1c54e2={};_0x1c54e2[_0x143554[_0xf29d('0x2d')]]=_0x51aeee;_[_0xf29d('0x2e')](_0x132a98[_0xf29d('0x2f')],_0x1c54e2);}return _0x424dca[_0xf29d('0x1d')](_0xf29d('0x30'))[_0xf29d('0x20')](_0x132a98,_0x2401b3)[_0xf29d('0x27')](function(_0x69a80){if(_0x69a80&&_0x69a80[_0xf29d('0x38')]){return _0x69a80;}else{var _0x1afcff=_['cloneDeep'](_0x21c1a5);if(_0x143554[_0xf29d('0x33')]){var _0x5dbc6f={};_0x5dbc6f[_0x143554[_0xf29d('0x33')]]=_0x51aeee;_[_0xf29d('0x2e')](_0x1afcff[_0xf29d('0x2f')],_0x5dbc6f);}return _0x424dca[_0xf29d('0x1d')](_0xf29d('0x34'))[_0xf29d('0x20')](_0x1afcff,_0x2401b3);}});}});case'contact':var _0x385e28=_[_0xf29d('0x32')](_0x21c1a5);if(_0x143554[_0xf29d('0x2d')]){var _0x146025={};_0x146025[_0x143554['additionalSearchContact']]=_0x51aeee;_[_0xf29d('0x2e')](_0x385e28[_0xf29d('0x2f')],_0x146025);}return _0x424dca['sobject'](_0xf29d('0x30'))[_0xf29d('0x20')](_0x385e28,_0x2401b3)['execute']();case _0xf29d('0x1a'):var _0x1364ad=_[_0xf29d('0x32')](_0x21c1a5);if(_0x143554['additionalSearchLead']){var _0x146025={};_0x146025[_0x143554[_0xf29d('0x33')]]=_0x51aeee;_[_0xf29d('0x2e')](_0x1364ad[_0xf29d('0x2f')],_0x146025);}return _0x424dca[_0xf29d('0x1d')]('Lead')[_0xf29d('0x20')](_0x1364ad,_0x2401b3);case _0xf29d('0x17'):var _0x48d5a3=_[_0xf29d('0x32')](_0x21c1a5);if(_0x143554['additionalSearchAccount']){var _0x146025={};_0x146025[_0x143554[_0xf29d('0x36')]]=_0x51aeee;_['merge'](_0x48d5a3[_0xf29d('0x2f')],_0x146025);}return _0x424dca[_0xf29d('0x1d')](_0xf29d('0x37'))[_0xf29d('0x20')](_0x48d5a3,_0x2401b3);default:return null;}})[_0xf29d('0x27')](function(_0x38f033){if(_0x38f033&&_0x38f033[_0xf29d('0x38')]){var _0x28880e=_[_0xf29d('0x39')](_0x38f033);if(_0x28880e){return BPromise[_0xf29d('0x23')]({'id':_0x28880e['Id'],'name':_0x28880e[_0xf29d('0x24')],'phone':_0x28880e[_0xf29d('0x3a')],'endUserType':_0x28880e[_0xf29d('0x3b')][_0xf29d('0x3c')][_0xf29d('0x3d')]()});}}})[_0xf29d('0x27')](function(_0xc6ea00){if(_0xc6ea00){logger['info'](_0xf29d('0x3e'),_0xc6ea00[_0xf29d('0x14')],_0x51aeee);return BPromise[_0xf29d('0x23')](_0xc6ea00);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x51aeee);var _0x5e8f4b={'Phone':_0x51aeee};if(_0x143554[_0xf29d('0x3f')]){if(_0x143554[_0xf29d('0x3f')]===_0xf29d('0x15')){logger[_0xf29d('0x1c')](_0xf29d('0x40'),_0x51aeee,_0x143554[_0xf29d('0x3f')]);_0x5e8f4b[_0xf29d('0x41')]=_0x491ca2!==_0xf29d('0x42')?_0x491ca2:util['format'](_0xf29d('0x43'),_0x51aeee);}else if(_0x143554['moduleCreate']===_0xf29d('0x1a')){logger[_0xf29d('0x1c')](_0xf29d('0x40'),_0x51aeee,_0x143554[_0xf29d('0x3f')]);_0x5e8f4b['LastName']=_0x491ca2!==''?_0x491ca2:util[_0xf29d('0x44')](_0xf29d('0x43'),_0x51aeee);_0x5e8f4b[_0xf29d('0x45')]='No\x20Company';}else if(_0x143554[_0xf29d('0x3f')]===_0xf29d('0x17')){logger['info'](_0xf29d('0x40'),_0x51aeee,_0x143554['moduleCreate']);_0x5e8f4b[_0xf29d('0x24')]=_0x491ca2!==''?_0x491ca2:util[_0xf29d('0x44')](_0xf29d('0x43'),_0x51aeee);}else{return null;}}return _0x424dca['sobject'](_['upperFirst'](_0x143554[_0xf29d('0x3f')]))[_0xf29d('0x1e')](_0x5e8f4b)[_0xf29d('0x27')](function(_0x20b88c){return BPromise[_0xf29d('0x23')]({'id':_0x20b88c['id'],'endUserType':_0x143554['moduleCreate']});});}});}function getCustomFields(_0x3c3890,_0xaefda6){var _0x43882c={};if(_0x3c3890['length']>0x0){_[_0xf29d('0x46')](_0x3c3890,function(_0x3aa520){if(_['includes']([_0xf29d('0x47'),_0xf29d('0x48')],_0x3aa520[_0xf29d('0x3c')])&&_0x3aa520['idField']){_0x43882c[_0x3aa520['idField']]=_0x3aa520[_0xf29d('0x49')][_0xf29d('0x4a')]();}else if(_0x3aa520['type']==='variable'&&_0x3aa520[_0xf29d('0x4b')]&&_0x3aa520[_0xf29d('0x4c')]){_0xaefda6[_0x3aa520[_0xf29d('0x4b')]]&&(_0x43882c[_0x3aa520['idField']]=_0xaefda6[_0x3aa520[_0xf29d('0x4b')]][_0xf29d('0x4a')]());}else if(_0x3aa520[_0xf29d('0x3c')]===_0xf29d('0x4d')&&_0x3aa520[_0xf29d('0x4e')]&&_0x3aa520[_0xf29d('0x4e')][_0xf29d('0x4f')]&&_0x3aa520[_0xf29d('0x4c')]){_0xaefda6[_0x3aa520[_0xf29d('0x4e')]['name']['toLowerCase']()]&&(_0x43882c[_0x3aa520['idField']]=_0xaefda6[_0x3aa520[_0xf29d('0x4e')][_0xf29d('0x4f')][_0xf29d('0x3d')]()][_0xf29d('0x4a')]());}});}return _0x43882c;}function getConnection(_0x16a4ed){var _0x7b3d26=_0x16a4ed['password'][_0xf29d('0x50')](_0x16a4ed[_0xf29d('0x51')]);var _0x51b564=new jsforce[(_0xf29d('0x52'))]({'oauth2':{'loginUrl':_0x16a4ed[_0xf29d('0x53')]||_0xf29d('0x54'),'clientId':_0x16a4ed[_0xf29d('0x55')],'clientSecret':_0x16a4ed[_0xf29d('0x56')]}});return _0x51b564[_0xf29d('0x57')](_0x16a4ed['username'],_0x7b3d26)[_0xf29d('0x27')](function(){logger[_0xf29d('0x1c')](_0xf29d('0x58'));return _0x51b564;});}exports['queue']=function(_0x4de43e,_0x21df93,_0xea34e9,_0x4270a8,_0x5bb2c4,_0xddbeee){var _0x1ceb81,_0x2c78cc,_0x1f6c7a,_0x3734ac;_0xddbeee[_0xf29d('0x59')]=intUtil[_0xf29d('0x5a')](_0xddbeee[_0xf29d('0x59')]);_0xddbeee['remoteUri']=intUtil['stripTrailingSlash'](_0xddbeee[_0xf29d('0x53')]);if(_0x5bb2c4&&_0x5bb2c4['monitor_format']){logger[_0xf29d('0x1c')](_0xf29d('0x5b'),_0xf29d('0x5c'));_0x21df93[_0xf29d('0x5d')]=util['format'](_0xf29d('0x5e'),_0xddbeee[_0xf29d('0x59')],_0x21df93[_0xf29d('0x5f')],md5(_0x21df93['uniqueid']));}else{_0x21df93['recordingURL']='';}return getConnection(_0xddbeee)['then'](function(_0x10ddc1){_0x3734ac=_0x10ddc1;return getUser(_0xddbeee,_0x4270a8[_0xf29d('0x60')],_0x3734ac);})[_0xf29d('0x27')](function(_0x46acac){_0x1ceb81=_0x46acac;return getEndUser(_0xddbeee,_0xea34e9,_0x21df93['calleridname'],_0x21df93[_0xf29d('0x61')],_0x3734ac);})['then'](function(_0x249a45){_0x2c78cc=_0x249a45;return getTicket(_0xddbeee,_0x1ceb81,_0x2c78cc,_0xea34e9,_0x21df93,_0xea34e9['Fields'],_0x3734ac,'queue');})[_0xf29d('0x27')](function(_0x16eed2){_0x1f6c7a=_0x16eed2;logger[_0xf29d('0x1c')](_0xf29d('0x62'),_0x1f6c7a['id']);logger['info'](_0xf29d('0x63'),_0x1f6c7a['id'],_0x4270a8[_0xf29d('0x4f')],_0xddbeee[_0xf29d('0x3c')]);switch(_0xddbeee[_0xf29d('0x3c')]){case'integrationTab':emit(util[_0xf29d('0x44')](_0xf29d('0x64'),_0x4270a8[_0xf29d('0x4f')]),_0xf29d('0x65'),{'recordId':_0x1f6c7a['id']});break;case _0xf29d('0x66'):emit(util['format'](_0xf29d('0x64'),_0x4270a8[_0xf29d('0x4f')]),'trigger:browser:url',{'uri':util[_0xf29d('0x44')](_0xf29d('0x67'),_0x3734ac[_0xf29d('0x68')],_0x1f6c7a['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xf29d('0x69')](function(_0x175954){logger[_0xf29d('0x6a')]('[QUEUE]',_0x175954);});};exports[_0xf29d('0x6b')]=function(_0x4511e3,_0x167486,_0x5ad2c7,_0x5c4932,_0x22886c,_0x246937,_0x49fa50){var _0x5d10f8,_0x3e46d1,_0x3f791e,_0x24bb18;_0x246937['serverUrl']=intUtil['stripTrailingSlash'](_0x246937[_0xf29d('0x59')]);_0x246937[_0xf29d('0x53')]=intUtil[_0xf29d('0x5a')](_0x246937[_0xf29d('0x53')]);if(_0x49fa50&&_0x49fa50[_0xf29d('0x6c')]&&_0x49fa50[_0xf29d('0x6c')]!=='none'){logger['info'](_0xf29d('0x6d'),_0xf29d('0x5c'));_0x167486[_0xf29d('0x5d')]=util[_0xf29d('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x246937[_0xf29d('0x59')],_0x167486['uniqueid'],md5(_0x167486[_0xf29d('0x5f')]));}return getConnection(_0x246937)['then'](function(_0x4932d4){_0x24bb18=_0x4932d4;return getUser(_0x246937,_0x5c4932[_0xf29d('0x60')],_0x24bb18);})[_0xf29d('0x27')](function(_0x121b43){_0x5d10f8=_0x121b43;return getEndUser(_0x246937,_0x5ad2c7,_0x167486[_0xf29d('0x6e')],_0x167486[_0xf29d('0x6f')],_0x24bb18);})[_0xf29d('0x27')](function(_0xc4fb33){_0x3e46d1=_0xc4fb33;return getTicket(_0x246937,_0x5d10f8,_0x3e46d1,_0x5ad2c7,_0x167486,_0x5ad2c7['Fields'],_0x24bb18,_0xf29d('0x6b'));})['then'](function(_0x3d5616){_0x3f791e=_0x3d5616;logger['info'](_0xf29d('0x70'),_0x3f791e['id']);logger['info'](_0xf29d('0x71'),_0x3f791e['id'],_0x5c4932[_0xf29d('0x4f')],_0x246937[_0xf29d('0x3c')]);switch(_0x246937[_0xf29d('0x3c')]){case _0xf29d('0x72'):emit(util[_0xf29d('0x44')]('user:%s',_0x5c4932[_0xf29d('0x4f')]),_0xf29d('0x65'),{'recordId':_0x3f791e['id']});break;case'newTab':emit(util[_0xf29d('0x44')]('user:%s',_0x5c4932[_0xf29d('0x4f')]),_0xf29d('0x73'),{'uri':util[_0xf29d('0x44')](_0xf29d('0x67'),_0x24bb18[_0xf29d('0x68')],_0x3f791e['id'])});break;default:logger['error'](_0xf29d('0x6d'),_0xf29d('0x74'));}})[_0xf29d('0x69')](function(_0x240013){logger[_0xf29d('0x6a')]('[OUTBOUND]',_0x240013);});};exports['unmanaged']=function(_0x420faa,_0x438845,_0x3dcac6,_0x1f2d61,_0x4b3d26,_0x13af79){var _0x3afe2d,_0x207592,_0x3f960e,_0x471ef8;_0x13af79[_0xf29d('0x59')]=intUtil[_0xf29d('0x5a')](_0x13af79['serverUrl']);_0x13af79[_0xf29d('0x53')]=intUtil[_0xf29d('0x5a')](_0x13af79[_0xf29d('0x53')]);if(_0x4b3d26&&_0x4b3d26[_0xf29d('0x75')]){logger['info']('['+_0x438845[_0xf29d('0x76')][_0xf29d('0x77')]()+']','Recording\x20is\x20enabled!');_0x438845[_0xf29d('0x5d')]=util[_0xf29d('0x44')](_0xf29d('0x5e'),_0x13af79[_0xf29d('0x59')],_0x438845[_0xf29d('0x5f')],md5(_0x438845[_0xf29d('0x5f')]));}else{_0x438845[_0xf29d('0x5d')]='';}return getConnection(_0x13af79)[_0xf29d('0x27')](function(_0x154889){_0x471ef8=_0x154889;if(!_['isNil'](_0x1f2d61)){return getUser(_0x13af79,_0x1f2d61[_0xf29d('0x4f')],_0x471ef8);}else{return getUser(_0x13af79,null,_0x471ef8);}})[_0xf29d('0x27')](function(_0x379585){_0x3afe2d=_0x379585;return getEndUser(_0x13af79,_0x3dcac6,_0x438845[_0xf29d('0x78')],_0x438845[_0xf29d('0x61')],_0x471ef8);})[_0xf29d('0x27')](function(_0x124fe3){_0x207592=_0x124fe3;return getTicket(_0x13af79,_0x3afe2d,_0x207592,_0x3dcac6,_0x438845,_0x3dcac6[_0xf29d('0x79')],_0x471ef8);})[_0xf29d('0x27')](function(_0x4fe913){_0x3f960e=_0x4fe913;logger[_0xf29d('0x1c')]('['+_0x438845[_0xf29d('0x76')][_0xf29d('0x77')]()+_0xf29d('0x7a'),_0x3f960e['id']);logger[_0xf29d('0x1c')]('['+_0x438845[_0xf29d('0x76')][_0xf29d('0x77')]()+_0xf29d('0x7b'),_0x13af79['type']);})[_0xf29d('0x69')](function(_0x2befd9){logger[_0xf29d('0x6a')]('['+_0x438845['lastevent'][_0xf29d('0x77')]()+']',_0x2befd9);});}; \ 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 d86ae71..bbd607f 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 _0x35c1=['customVariable','Variable','name','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','sysparm_limit=1','remoteUri','stripTrailingSlash','isNil','email','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','then','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','active','true','userId','adminEmail','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','variableName'];(function(_0x1c62d0,_0x170597){var _0x17eed4=function(_0x750d96){while(--_0x750d96){_0x1c62d0['push'](_0x1c62d0['shift']());}};_0x17eed4(++_0x170597);}(_0x35c1,0x104));var _0x135c=function(_0x3a964d,_0x305ccf){_0x3a964d=_0x3a964d-0x0;var _0x536907=_0x35c1[_0x3a964d];return _0x536907;};'use strict';var _=require(_0x135c('0x0'));var Promise=require(_0x135c('0x1'));var rp=require(_0x135c('0x2'));var util=require(_0x135c('0x3'));var md5=require(_0x135c('0x4'));var Redis=require(_0x135c('0x5'));var intUtil=require(_0x135c('0x6'));var config=require(_0x135c('0x7'));var logger=require(_0x135c('0x8'))(_0x135c('0x9'));config[_0x135c('0xa')]=_[_0x135c('0xb')](config[_0x135c('0xa')],{'host':_0x135c('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x135c('0xa')]));function getAdminUser(_0x5e4de8,_0x43af3c,_0x3369da,_0x400f34,_0x1a2e88,_0x4f3954){return new Promise(function(_0x20d15c,_0xab9c9e){var _0xf06b05={'method':_0x135c('0xd'),'uri':_0x400f34+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x1a2e88+'&'+_0x4f3954,'auth':_0x43af3c,'json':!![]};return rp(_0xf06b05)[_0x135c('0xe')](function(_0x5b614e){if(_0x5b614e['result']['length']>0x0){_0x3369da[_0x135c('0xf')]=_0x5b614e[_0x135c('0x10')][0x0][_0x135c('0x11')];}logger[_0x135c('0x12')]('['+[_0x5e4de8[_0x135c('0x13')]()]+_0x135c('0x14'),_0x3369da);_0x20d15c(_0x3369da);})['catch'](function(_0x4d6284){logger['error']('['+[_0x5e4de8[_0x135c('0x13')]()]+']',_0x4d6284['message']);_0xab9c9e(_0x4d6284[_0x135c('0x15')]);});});}function getUser(_0x23ba21,_0x512819,_0x151fdf,_0x3c3bb7,_0x5057a5){return function(_0x17775f){logger[_0x135c('0x12')]('['+[_0x23ba21[_0x135c('0x13')]()]+_0x135c('0x16'),_0x17775f);return new Promise(function(_0x3de602,_0x3bd961){if(intUtil[_0x135c('0x17')](_0x17775f[_0x135c('0x18')])){var _0x3235f2={'method':_0x135c('0xd'),'uri':_0x151fdf+_0x135c('0x19')+_0x17775f['userEmail']+'&'+_0x3c3bb7+'&'+_0x5057a5,'auth':_0x512819,'json':!![]};logger[_0x135c('0x12')]('['+[_0x23ba21[_0x135c('0x13')]()]+_0x135c('0x1a'),_0x3235f2);return rp(_0x3235f2)['then'](function(_0x3fe24c){logger[_0x135c('0x12')]('['+[_0x23ba21[_0x135c('0x13')]()]+'],\x20getUser\x20entity',_0x3fe24c);if(_0x3fe24c[_0x135c('0x10')][_0x135c('0x1b')]>0x0&&String(_0x3fe24c[_0x135c('0x10')][0x0][_0x135c('0x1c')])===_0x135c('0x1d')){_0x17775f[_0x135c('0x1e')]=_0x3fe24c[_0x135c('0x10')][0x0][_0x135c('0x11')];}else{_0x17775f['userId']=_0x17775f[_0x135c('0xf')];_0x17775f[_0x135c('0x18')]=_0x17775f[_0x135c('0x1f')];}logger[_0x135c('0x12')]('['+[_0x23ba21['toUpperCase']()]+_0x135c('0x20'),_0x17775f);_0x3de602(_0x17775f);})[_0x135c('0x21')](function(_0x10d1c1){logger[_0x135c('0x22')]('['+[_0x23ba21[_0x135c('0x13')]()]+']',_0x10d1c1[_0x135c('0x15')]);_0x3bd961(_0x10d1c1['message']);});}else{logger[_0x135c('0x12')]('['+[_0x23ba21[_0x135c('0x13')]()]+_0x135c('0x23'));_0x17775f[_0x135c('0x1e')]=_0x17775f[_0x135c('0xf')];_0x17775f[_0x135c('0x18')]=_0x17775f[_0x135c('0x1f')];_0x3de602(_0x17775f);}});};}function createEndUser(_0x2db504,_0x4b2055,_0xc1e62b,_0x45857e,_0x12da92){logger['info']('['+[_0x2db504[_0x135c('0x13')]()]+_0x135c('0x24'),_0xc1e62b);return new Promise(function(_0x45be94,_0x26facc){var _0x45b6aa={'method':_0x135c('0x25'),'uri':_0x45857e+_0x135c('0x26')+_0x12da92,'body':{'user_name':_0xc1e62b['endUserNumber'],'roles':'user','first_name':_0xc1e62b[_0x135c('0x27')],'active':'true','date_format':_0x135c('0x28'),'phone':_0xc1e62b['endUserNumber']},'auth':_0x4b2055,'json':!![]};return rp(_0x45b6aa)[_0x135c('0xe')](function(_0x1bb76c){logger[_0x135c('0x12')]('['+[_0x2db504['toUpperCase']()]+_0x135c('0x29'),_0x1bb76c[_0x135c('0x10')]);_0xc1e62b['endUserId']=_0x1bb76c[_0x135c('0x10')]['sys_id'];_0x45be94(_0xc1e62b);})[_0x135c('0x21')](function(_0x1b6b5e){logger[_0x135c('0x22')]('['+[_0x2db504['toUpperCase']()]+']',_0x1b6b5e['message']);_0x26facc(_0x1b6b5e['message']);});});}function getEndUser(_0x35fcd1,_0x5aa8c4,_0x4f5e43,_0x32d823,_0x3a8b04){return function(_0xe34807){logger['info']('['+[_0x35fcd1[_0x135c('0x13')]()]+_0x135c('0x2a'),_0xe34807);return new Promise(function(_0x3c7235,_0xe15a5a){var _0x1a29e2={'method':'GET','uri':_0x4f5e43+_0x135c('0x2b')+_0xe34807[_0x135c('0x27')]+'&'+_0x32d823+'&'+_0x3a8b04,'auth':_0x5aa8c4,'json':!![]};return rp(_0x1a29e2)['then'](function(_0x3b2336){if(_0x3b2336[_0x135c('0x10')][_0x135c('0x1b')]>0x0){_0xe34807[_0x135c('0x2c')]=_0x3b2336['result'][0x0][_0x135c('0x11')];logger[_0x135c('0x12')]('['+[_0x35fcd1[_0x135c('0x13')]()]+'],\x20getEndUser\x20crm',_0xe34807);_0x3c7235(_0xe34807);}else{return createEndUser(_0x35fcd1,_0x5aa8c4,_0xe34807,_0x4f5e43,_0x32d823)[_0x135c('0xe')](function(_0x33cf7e){logger[_0x135c('0x12')]('['+[_0x35fcd1[_0x135c('0x13')]()]+_0x135c('0x2d'),_0x33cf7e);_0x3c7235(_0x33cf7e);});}})[_0x135c('0x21')](function(_0x4a8a56){logger[_0x135c('0x22')]('['+[_0x35fcd1[_0x135c('0x13')]()]+']',_0x4a8a56[_0x135c('0x15')]);_0xe15a5a(_0x4a8a56[_0x135c('0x15')]);});});};}function getCustomFields(_0xe9c6fa,_0x3f0aa8){var _0x30e465={};if(_0xe9c6fa[_0x135c('0x1b')]>0x0){_[_0x135c('0x2e')](_0xe9c6fa,function(_0x5631da){if(_[_0x135c('0x2f')]([_0x135c('0x30'),'picklist'],_0x5631da[_0x135c('0x31')])&&_0x5631da[_0x135c('0x32')]&&!_0x5631da[_0x135c('0x33')]){_0x30e465[_0x5631da['nameField'][_0x135c('0x34')]()]=_0x5631da[_0x135c('0x35')][_0x135c('0x36')]();}else if(_[_0x135c('0x2f')](['string',_0x135c('0x37')],_0x5631da['type'])&&_0x5631da[_0x135c('0x38')]&&_0x5631da[_0x135c('0x33')]){_0x30e465[_0x5631da['idField'][_0x135c('0x34')]()]=_0x5631da[_0x135c('0x35')][_0x135c('0x36')]();}else if(_0x5631da[_0x135c('0x31')]==='variable'&&_0x5631da[_0x135c('0x39')]&&_0x5631da[_0x135c('0x38')]&&_0x5631da[_0x135c('0x33')]){_0x30e465[_0x5631da[_0x135c('0x38')][_0x135c('0x34')]()]=_0x3f0aa8[_0x5631da[_0x135c('0x39')]][_0x135c('0x36')]();}else if(_0x5631da['type']===_0x135c('0x3a')&&_0x5631da['Variable']&&_0x5631da[_0x135c('0x3b')][_0x135c('0x3c')]&&_0x5631da[_0x135c('0x38')]&&_0x5631da[_0x135c('0x33')]){_0x30e465[_0x5631da['idField'][_0x135c('0x34')]()]=_0x3f0aa8[_0x5631da[_0x135c('0x3b')]['name'][_0x135c('0x34')]()]['toString']();}});}return _0x30e465;}function getTicket(_0x1d9107,_0xcad673,_0x750d0c,_0x1d599a,_0x53157b,_0x5f462c){return function(_0x2bdec9){logger[_0x135c('0x12')]('['+[_0x1d9107['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x2bdec9);return new Promise(function(_0x25d9a2,_0x21e7e6){var _0x103768=_0x1d9107[_0x135c('0x34')]()==='outbound'?_0x2bdec9[_0x135c('0x1e')]:_0x2bdec9[_0x135c('0x2c')];var _0x5a5a82={'method':_0x135c('0x25'),'uri':_0x750d0c+_0x135c('0x3d')+'?'+_0x5f462c,'body':Object['assign']({},{'active':'true','caller_id':_0x103768,'assigned_to':_0x2bdec9[_0x135c('0x1e')],'short_description':intUtil[_0x135c('0x3e')](_0x1d599a[_0x135c('0x3f')],_0x53157b,'\x20'),'description':intUtil[_0x135c('0x3e')](_0x1d599a[_0x135c('0x40')],_0x53157b,'\x0a')},getCustomFields(_0x1d599a[_0x135c('0x41')],_0x53157b)),'auth':_0xcad673,'json':!![]};return rp(_0x5a5a82)[_0x135c('0xe')](function(_0x4bdc71){logger[_0x135c('0x12')]('['+[_0x1d9107[_0x135c('0x13')]()]+_0x135c('0x42'),_0x4bdc71[_0x135c('0x10')]);_0x2bdec9[_0x135c('0x43')]=_0x4bdc71[_0x135c('0x10')][_0x135c('0x11')];_0x2bdec9[_0x135c('0x44')]=_0x4bdc71[_0x135c('0x10')][_0x135c('0x45')];logger[_0x135c('0x12')]('['+[_0x1d9107[_0x135c('0x13')]()]+_0x135c('0x46'),_0x2bdec9);_0x25d9a2(_0x2bdec9);})[_0x135c('0x21')](function(_0x4121c4){logger[_0x135c('0x22')]('['+[_0x1d9107[_0x135c('0x13')]()]+']',_0x4121c4[_0x135c('0x15')]);_0x21e7e6(_0x4121c4[_0x135c('0x15')]);});});};}function createRemoteTag(_0x4b86e6,_0x16bb4e,_0x263bc7,_0x54126f){return new Promise(function(_0x41a1d2,_0x1eccea){var _0x5d3a44={'method':_0x135c('0x25'),'uri':_0x263bc7+'label'+'?'+_0x54126f,'body':{'short_description':_0x4b86e6,'global':!![],'active':!![],'name':_0x4b86e6},'auth':_0x16bb4e,'json':!![]};return rp(_0x5d3a44)['then'](function(_0x6d4ae8){var _0x2442a6=_0x6d4ae8['result'][_0x135c('0x11')];_0x41a1d2(_0x2442a6);});});}function getRemoteTag(_0x303fe3,_0x38b377,_0x45d8cb,_0x59d613,_0x5e1777){return new Promise(function(_0x31cd07,_0x15d1f1){var _0x34f22a={'method':_0x135c('0xd'),'uri':_0x45d8cb+'label'+_0x135c('0x47')+_0x303fe3+'&'+_0x59d613,'auth':_0x38b377,'json':!![]};return rp(_0x34f22a)['then'](function(_0x4a516a){if(_0x4a516a[_0x135c('0x10')]['length']>0x0){var _0x3084e2=_0x4a516a['result'][0x0][_0x135c('0x11')];_0x31cd07(_0x3084e2);}else{return createRemoteTag(_0x303fe3,_0x38b377,_0x45d8cb,_0x59d613)[_0x135c('0xe')](function(_0x381c26){_0x31cd07(_0x381c26);});}});});}function assignTagToIncident(_0x39b909,_0x5ab033,_0x587040,_0x3a5991,_0x23bc30){return new Promise(function(_0xc907cd,_0x147ee6){var _0x2171b3={'method':_0x135c('0x25'),'uri':_0x587040+_0x135c('0x48')+'?'+_0x23bc30,'body':{'label':_0x39b909,'table':_0x135c('0x3d'),'id_type':_0x135c('0x49'),'table_key':_0x3a5991['ticketId'],'title':_0x135c('0x4a')+_0x3a5991[_0x135c('0x44')],'id_display':_0x3a5991[_0x135c('0x44')]},'auth':_0x5ab033,'json':!![]};return rp(_0x2171b3)['then'](function(_0x3da740){_0xc907cd();})[_0x135c('0x21')](function(){_0xc907cd();});});}function manageTags(_0x38d3eb,_0x25e4e0,_0x8cffa7,_0x4bae91,_0x23ad8c,_0x2fe838,_0xeb9bb9){return new Promise(function(_0xf6a2fd,_0x4f4b27){var _0xa01a76=[];_0x25e4e0['forEach'](function(_0x49dd2b){_0xa01a76[_0x135c('0x4b')](getRemoteTag(_0x49dd2b,_0x8cffa7,_0x4bae91,_0x2fe838,_0xeb9bb9));});return Promise['all'](_0xa01a76)[_0x135c('0xe')](function(_0x1a2d3b){if(_0x1a2d3b[_0x135c('0x1b')]){logger[_0x135c('0x12')]('['+[_0x38d3eb[_0x135c('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1a2d3b);var _0x52622d=[];_0x1a2d3b['forEach'](function(_0x264954){_0x52622d[_0x135c('0x4b')](assignTagToIncident(_0x264954,_0x8cffa7,_0x4bae91,_0x23ad8c,_0x2fe838));});return Promise[_0x135c('0x4c')](_0x52622d)[_0x135c('0xe')](function(){_0xf6a2fd();})['catch'](function(){_0xf6a2fd();});}else{_0xf6a2fd();}});});}function getTags(_0x24e37c,_0x1d2f7d,_0x2d9196,_0x5bd6b1,_0x3a2912,_0x20d84d){return function(_0x24e3cd){return new Promise(function(_0x23bc61,_0x25a2d0){var _0x47b0f4=[];var _0x56edee=_0x5bd6b1['Tags'];if(_0x56edee&&_0x56edee[_0x135c('0x1b')]>0x0){_0x47b0f4=_[_0x135c('0x4d')](_0x56edee,_0x135c('0x3c'));}if(_0x47b0f4['length']>0x0){return manageTags(_0x24e37c,_0x47b0f4,_0x1d2f7d,_0x2d9196,_0x24e3cd,_0x3a2912,_0x20d84d)[_0x135c('0xe')](function(){_0x23bc61(_0x24e3cd);});}else{_0x23bc61(_0x24e3cd);}});};}function emit(_0x140fb5,_0x51f181,_0x1e9efb){var _0x3ec1e7=_0x135c('0x4e')+_0x135c('0x4f')+_0x135c('0x50')+_0x135c('0x51');var _0x397a37={'uri':_0x140fb5+_0x135c('0x52')+_0x1e9efb+_0x3ec1e7};io['to'](util[_0x135c('0x53')](_0x135c('0x54'),_0x51f181))[_0x135c('0x55')]('trigger:browser:url',_0x397a37);}exports['cs']=function(_0x5d753c,_0x3468e8,_0x15f8c3,_0x17ef09,_0x4d31a9,_0x158d95,_0x273764,_0x14b533){var _0x239b78={};var _0xec30eb={'user':_0x158d95[_0x135c('0x56')],'pass':_0x158d95['password']};var _0x1d09d2=_0x135c('0x57');var _0x2ad043='sysparm_display_value=true';_0x158d95[_0x135c('0x58')]=intUtil[_0x135c('0x59')](_0x158d95[_0x135c('0x58')]);_0x158d95['serverUrl']=intUtil[_0x135c('0x59')](_0x158d95['serverUrl']);var _0x4d3245=util['format']('%s/api/now/table/',_0x158d95[_0x135c('0x58')]);_0x239b78['userEmail']=!_[_0x135c('0x5a')](_0x17ef09)?_0x17ef09[_0x135c('0x5b')]:null;_0x239b78['adminEmail']=_0x158d95[_0x135c('0x5b')];_0x239b78[_0x135c('0x27')]=_0x14b533[_0x135c('0x34')]()==='outbound'?_0x3468e8['destcalleridnum']:_0x3468e8[_0x135c('0x5c')];_0x239b78['callDirection']=_0x14b533===_0x135c('0x5d')||_0x14b533===_0x135c('0x5e')?_0x135c('0x5d'):'outbound';var _0x1890c0=util[_0x135c('0x53')](_0x135c('0x5f'),_0x158d95['serverUrl'],_0x3468e8[_0x135c('0x60')],md5(_0x3468e8['uniqueid']));if(_0x4d31a9&&_0x4d31a9[_0x135c('0x61')]){logger[_0x135c('0x12')](_0x135c('0x62'),_0x135c('0x63'));_0x3468e8['recordingURL']=_0x1890c0;}else if(_0x273764&&_0x273764[_0x135c('0x64')]&&_0x273764[_0x135c('0x64')]!==_0x135c('0x65')){logger[_0x135c('0x12')](_0x135c('0x66'),'Recording\x20is\x20enabled!');_0x3468e8['recordingURL']=_0x1890c0;}else{_0x3468e8['recordingURL']='';}return getAdminUser(_0x14b533,_0xec30eb,_0x239b78,_0x4d3245,_0x2ad043,_0x1d09d2)[_0x135c('0xe')](getUser(_0x14b533,_0xec30eb,_0x4d3245,_0x2ad043,_0x1d09d2))['then'](getEndUser(_0x14b533,_0xec30eb,_0x4d3245,_0x2ad043,_0x1d09d2))[_0x135c('0xe')](getTicket(_0x14b533,_0xec30eb,_0x4d3245,_0x15f8c3,_0x3468e8,_0x2ad043))[_0x135c('0xe')](function(_0x1e5985){logger[_0x135c('0x12')](util['format'](_0x135c('0x67'),_0x1e5985[_0x135c('0x43')]));logger[_0x135c('0x12')](util[_0x135c('0x53')](_0x135c('0x68'),_0x14b533));if(_0x14b533!=='unmanaged'){logger['info']('['+[_0x14b533[_0x135c('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x158d95[_0x135c('0x58')],_0x17ef09[_0x135c('0x3c')],_0x1e5985[_0x135c('0x43')]);}})[_0x135c('0x21')](function(_0x4c4b3b){logger[_0x135c('0x22')]('['+[_0x14b533[_0x135c('0x13')]()]+_0x135c('0x69'),util['inspect'](_0x4c4b3b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1f5e=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','ioredis','./util','../../../../config/environment','servicenow','redis','localhost','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','GET','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','toString','variableName','Variable','name','outbound','incident','assign','Subjects','getString','Descriptions','Fields','ticketId','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email'];(function(_0x1df4ea,_0x45edfe){var _0x172f8=function(_0x521376){while(--_0x521376){_0x1df4ea['push'](_0x1df4ea['shift']());}};_0x172f8(++_0x45edfe);}(_0x1f5e,0xe0));var _0xe1f5=function(_0x41069d,_0x24fd9d){_0x41069d=_0x41069d-0x0;var _0x269206=_0x1f5e[_0x41069d];return _0x269206;};'use strict';var _=require(_0xe1f5('0x0'));var Promise=require(_0xe1f5('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0xe1f5('0x2'));var Redis=require(_0xe1f5('0x3'));var intUtil=require(_0xe1f5('0x4'));var config=require(_0xe1f5('0x5'));var logger=require('../../../../config/logger')(_0xe1f5('0x6'));config[_0xe1f5('0x7')]=_['defaults'](config[_0xe1f5('0x7')],{'host':_0xe1f5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x54cd20,_0x3135d0,_0x2c4420,_0x22e905,_0x32e035,_0x5332a2){return new Promise(function(_0x167eb0,_0x3f6836){var _0x1edbf2={'method':'GET','uri':_0x22e905+_0xe1f5('0x9')+'&'+_0x32e035+'&'+_0x5332a2,'auth':_0x3135d0,'json':!![]};return rp(_0x1edbf2)[_0xe1f5('0xa')](function(_0x3ec169){if(_0x3ec169['result']['length']>0x0){_0x2c4420['adminId']=_0x3ec169[_0xe1f5('0xb')][0x0][_0xe1f5('0xc')];}logger[_0xe1f5('0xd')]('['+[_0x54cd20[_0xe1f5('0xe')]()]+'],\x20getAdminUser\x20crm',_0x2c4420);_0x167eb0(_0x2c4420);})[_0xe1f5('0xf')](function(_0x4d91d7){logger[_0xe1f5('0x10')]('['+[_0x54cd20[_0xe1f5('0xe')]()]+']',_0x4d91d7[_0xe1f5('0x11')]);_0x3f6836(_0x4d91d7[_0xe1f5('0x11')]);});});}function getUser(_0x25b257,_0x25c464,_0x33046c,_0xb2875f,_0x4ca52e){return function(_0x20cfcc){logger['info']('['+[_0x25b257[_0xe1f5('0xe')]()]+_0xe1f5('0x12'),_0x20cfcc);return new Promise(function(_0x2ccc4f,_0x48be28){if(intUtil[_0xe1f5('0x13')](_0x20cfcc[_0xe1f5('0x14')])){var _0x2592b6={'method':'GET','uri':_0x33046c+_0xe1f5('0x15')+_0x20cfcc['userEmail']+'&'+_0xb2875f+'&'+_0x4ca52e,'auth':_0x25c464,'json':!![]};logger['info']('['+[_0x25b257[_0xe1f5('0xe')]()]+_0xe1f5('0x16'),_0x2592b6);return rp(_0x2592b6)['then'](function(_0x16fe4e){logger[_0xe1f5('0xd')]('['+[_0x25b257['toUpperCase']()]+'],\x20getUser\x20entity',_0x16fe4e);if(_0x16fe4e[_0xe1f5('0xb')]['length']>0x0&&String(_0x16fe4e[_0xe1f5('0xb')][0x0][_0xe1f5('0x17')])===_0xe1f5('0x18')){_0x20cfcc[_0xe1f5('0x19')]=_0x16fe4e[_0xe1f5('0xb')][0x0]['sys_id'];}else{_0x20cfcc[_0xe1f5('0x19')]=_0x20cfcc[_0xe1f5('0x1a')];_0x20cfcc[_0xe1f5('0x14')]=_0x20cfcc['adminEmail'];}logger[_0xe1f5('0xd')]('['+[_0x25b257[_0xe1f5('0xe')]()]+'],\x20getUser\x20crm',_0x20cfcc);_0x2ccc4f(_0x20cfcc);})[_0xe1f5('0xf')](function(_0x1e2fc3){logger[_0xe1f5('0x10')]('['+[_0x25b257[_0xe1f5('0xe')]()]+']',_0x1e2fc3[_0xe1f5('0x11')]);_0x48be28(_0x1e2fc3['message']);});}else{logger[_0xe1f5('0xd')]('['+[_0x25b257[_0xe1f5('0xe')]()]+']\x20using\x20admin\x20profile');_0x20cfcc[_0xe1f5('0x19')]=_0x20cfcc[_0xe1f5('0x1a')];_0x20cfcc['userEmail']=_0x20cfcc[_0xe1f5('0x1b')];_0x2ccc4f(_0x20cfcc);}});};}function createEndUser(_0x195d5f,_0x481742,_0x31c21f,_0x3523d7,_0x1e51a9){logger[_0xe1f5('0xd')]('['+[_0x195d5f[_0xe1f5('0xe')]()]+_0xe1f5('0x1c'),_0x31c21f);return new Promise(function(_0x381462,_0x27cad0){var _0x10a673={'method':_0xe1f5('0x1d'),'uri':_0x3523d7+'sys_user?'+_0x1e51a9,'body':{'user_name':_0x31c21f[_0xe1f5('0x1e')],'roles':'user','first_name':_0x31c21f[_0xe1f5('0x1e')],'active':_0xe1f5('0x18'),'date_format':_0xe1f5('0x1f'),'phone':_0x31c21f['endUserNumber']},'auth':_0x481742,'json':!![]};return rp(_0x10a673)[_0xe1f5('0xa')](function(_0x1245fa){logger[_0xe1f5('0xd')]('['+[_0x195d5f[_0xe1f5('0xe')]()]+'],\x20EndUser\x20schema',_0x1245fa[_0xe1f5('0xb')]);_0x31c21f[_0xe1f5('0x20')]=_0x1245fa[_0xe1f5('0xb')][_0xe1f5('0xc')];_0x381462(_0x31c21f);})['catch'](function(_0x1d88b6){logger[_0xe1f5('0x10')]('['+[_0x195d5f[_0xe1f5('0xe')]()]+']',_0x1d88b6[_0xe1f5('0x11')]);_0x27cad0(_0x1d88b6[_0xe1f5('0x11')]);});});}function getEndUser(_0x3261d7,_0x40d5ea,_0xe4c04c,_0xa04420,_0x2ec8f5){return function(_0xba8116){logger[_0xe1f5('0xd')]('['+[_0x3261d7[_0xe1f5('0xe')]()]+_0xe1f5('0x21'),_0xba8116);return new Promise(function(_0x1d4bed,_0x419b8e){var _0x4c6832={'method':_0xe1f5('0x22'),'uri':_0xe4c04c+_0xe1f5('0x23')+_0xba8116[_0xe1f5('0x1e')]+'&'+_0xa04420+'&'+_0x2ec8f5,'auth':_0x40d5ea,'json':!![]};return rp(_0x4c6832)[_0xe1f5('0xa')](function(_0x15c612){if(_0x15c612[_0xe1f5('0xb')]['length']>0x0){_0xba8116[_0xe1f5('0x20')]=_0x15c612[_0xe1f5('0xb')][0x0]['sys_id'];logger[_0xe1f5('0xd')]('['+[_0x3261d7[_0xe1f5('0xe')]()]+_0xe1f5('0x24'),_0xba8116);_0x1d4bed(_0xba8116);}else{return createEndUser(_0x3261d7,_0x40d5ea,_0xba8116,_0xe4c04c,_0xa04420)[_0xe1f5('0xa')](function(_0xa6fc9a){logger[_0xe1f5('0xd')]('['+[_0x3261d7[_0xe1f5('0xe')]()]+_0xe1f5('0x25'),_0xa6fc9a);_0x1d4bed(_0xa6fc9a);});}})['catch'](function(_0x3ceb45){logger[_0xe1f5('0x10')]('['+[_0x3261d7['toUpperCase']()]+']',_0x3ceb45[_0xe1f5('0x11')]);_0x419b8e(_0x3ceb45[_0xe1f5('0x11')]);});});};}function getCustomFields(_0x56a20c,_0x136b8f){var _0x17f3ed={};if(_0x56a20c[_0xe1f5('0x26')]>0x0){_[_0xe1f5('0x27')](_0x56a20c,function(_0x374442){if(_['includes']([_0xe1f5('0x28'),_0xe1f5('0x29')],_0x374442[_0xe1f5('0x2a')])&&_0x374442[_0xe1f5('0x2b')]&&!_0x374442[_0xe1f5('0x2c')]){_0x17f3ed[_0x374442[_0xe1f5('0x2b')][_0xe1f5('0x2d')]()]=_0x374442[_0xe1f5('0x2e')]['toString']();}else if(_[_0xe1f5('0x2f')]([_0xe1f5('0x28'),_0xe1f5('0x29')],_0x374442[_0xe1f5('0x2a')])&&_0x374442['idField']&&_0x374442[_0xe1f5('0x2c')]){_0x17f3ed[_0x374442[_0xe1f5('0x30')]['toLowerCase']()]=_0x374442[_0xe1f5('0x2e')][_0xe1f5('0x31')]();}else if(_0x374442[_0xe1f5('0x2a')]==='variable'&&_0x374442[_0xe1f5('0x32')]&&_0x374442[_0xe1f5('0x30')]&&_0x374442[_0xe1f5('0x2c')]){_0x17f3ed[_0x374442[_0xe1f5('0x30')]['toLowerCase']()]=_0x136b8f[_0x374442[_0xe1f5('0x32')]][_0xe1f5('0x31')]();}else if(_0x374442[_0xe1f5('0x2a')]==='customVariable'&&_0x374442[_0xe1f5('0x33')]&&_0x374442[_0xe1f5('0x33')]['name']&&_0x374442[_0xe1f5('0x30')]&&_0x374442[_0xe1f5('0x2c')]){_0x17f3ed[_0x374442['idField'][_0xe1f5('0x2d')]()]=_0x136b8f[_0x374442[_0xe1f5('0x33')][_0xe1f5('0x34')][_0xe1f5('0x2d')]()][_0xe1f5('0x31')]();}});}return _0x17f3ed;}function getTicket(_0x57ef06,_0x1b3f93,_0x5b43da,_0x24b8d8,_0x4a0118,_0x24f7bf){return function(_0x3f0ce0){logger[_0xe1f5('0xd')]('['+[_0x57ef06['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x3f0ce0);return new Promise(function(_0x39f61a,_0xc65884){var _0x1463dc=_0x57ef06['toLowerCase']()===_0xe1f5('0x35')?_0x3f0ce0[_0xe1f5('0x19')]:_0x3f0ce0['endUserId'];var _0x40fc5b={'method':_0xe1f5('0x1d'),'uri':_0x5b43da+_0xe1f5('0x36')+'?'+_0x24f7bf,'body':Object[_0xe1f5('0x37')]({},{'active':_0xe1f5('0x18'),'caller_id':_0x1463dc,'assigned_to':_0x3f0ce0[_0xe1f5('0x19')],'short_description':intUtil['getString'](_0x24b8d8[_0xe1f5('0x38')],_0x4a0118,'\x20'),'description':intUtil[_0xe1f5('0x39')](_0x24b8d8[_0xe1f5('0x3a')],_0x4a0118,'\x0a')},getCustomFields(_0x24b8d8[_0xe1f5('0x3b')],_0x4a0118)),'auth':_0x1b3f93,'json':!![]};return rp(_0x40fc5b)[_0xe1f5('0xa')](function(_0x3adb9d){logger[_0xe1f5('0xd')]('['+[_0x57ef06['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x3adb9d[_0xe1f5('0xb')]);_0x3f0ce0[_0xe1f5('0x3c')]=_0x3adb9d[_0xe1f5('0xb')][_0xe1f5('0xc')];_0x3f0ce0['ticketNumber']=_0x3adb9d['result'][_0xe1f5('0x3d')];logger[_0xe1f5('0xd')]('['+[_0x57ef06[_0xe1f5('0xe')]()]+']\x20getTicket\x20crm',_0x3f0ce0);_0x39f61a(_0x3f0ce0);})[_0xe1f5('0xf')](function(_0x38e85e){logger[_0xe1f5('0x10')]('['+[_0x57ef06[_0xe1f5('0xe')]()]+']',_0x38e85e['message']);_0xc65884(_0x38e85e[_0xe1f5('0x11')]);});});};}function createRemoteTag(_0x26efb1,_0x545c5a,_0x5e9d78,_0x2217a5){return new Promise(function(_0x56aead,_0x1f476b){var _0x49e36d={'method':_0xe1f5('0x1d'),'uri':_0x5e9d78+_0xe1f5('0x3e')+'?'+_0x2217a5,'body':{'short_description':_0x26efb1,'global':!![],'active':!![],'name':_0x26efb1},'auth':_0x545c5a,'json':!![]};return rp(_0x49e36d)['then'](function(_0x11a228){var _0x3fc3e1=_0x11a228[_0xe1f5('0xb')][_0xe1f5('0xc')];_0x56aead(_0x3fc3e1);});});}function getRemoteTag(_0x24c393,_0x111c13,_0x49d8b5,_0x1d408c,_0x3b495a){return new Promise(function(_0x8f2d4e,_0x15a16d){var _0x2b28f5={'method':_0xe1f5('0x22'),'uri':_0x49d8b5+_0xe1f5('0x3e')+_0xe1f5('0x3f')+_0x24c393+'&'+_0x1d408c,'auth':_0x111c13,'json':!![]};return rp(_0x2b28f5)[_0xe1f5('0xa')](function(_0x28618a){if(_0x28618a[_0xe1f5('0xb')]['length']>0x0){var _0x248389=_0x28618a[_0xe1f5('0xb')][0x0]['sys_id'];_0x8f2d4e(_0x248389);}else{return createRemoteTag(_0x24c393,_0x111c13,_0x49d8b5,_0x1d408c)[_0xe1f5('0xa')](function(_0x275219){_0x8f2d4e(_0x275219);});}});});}function assignTagToIncident(_0x5bd312,_0xcb5800,_0x4d3741,_0x499a54,_0x2d07bb){return new Promise(function(_0xf33828,_0x3871d2){var _0x578572={'method':'POST','uri':_0x4d3741+_0xe1f5('0x40')+'?'+_0x2d07bb,'body':{'label':_0x5bd312,'table':_0xe1f5('0x36'),'id_type':_0xe1f5('0x41'),'table_key':_0x499a54[_0xe1f5('0x3c')],'title':_0xe1f5('0x42')+_0x499a54[_0xe1f5('0x43')],'id_display':_0x499a54['ticketNumber']},'auth':_0xcb5800,'json':!![]};return rp(_0x578572)[_0xe1f5('0xa')](function(_0xd6b061){_0xf33828();})[_0xe1f5('0xf')](function(){_0xf33828();});});}function manageTags(_0x31edf4,_0x446976,_0x33f07d,_0x234d10,_0x183412,_0x3155b4,_0x1f3d82){return new Promise(function(_0x42a29c,_0x257cb9){var _0x578011=[];_0x446976['forEach'](function(_0x52d032){_0x578011[_0xe1f5('0x44')](getRemoteTag(_0x52d032,_0x33f07d,_0x234d10,_0x3155b4,_0x1f3d82));});return Promise['all'](_0x578011)[_0xe1f5('0xa')](function(_0x2cb51b){if(_0x2cb51b[_0xe1f5('0x26')]){logger[_0xe1f5('0xd')]('['+[_0x31edf4['toUpperCase']()]+_0xe1f5('0x45'),_0x2cb51b);var _0x41fcaf=[];_0x2cb51b[_0xe1f5('0x27')](function(_0x546168){_0x41fcaf[_0xe1f5('0x44')](assignTagToIncident(_0x546168,_0x33f07d,_0x234d10,_0x183412,_0x3155b4));});return Promise[_0xe1f5('0x46')](_0x41fcaf)[_0xe1f5('0xa')](function(){_0x42a29c();})[_0xe1f5('0xf')](function(){_0x42a29c();});}else{_0x42a29c();}});});}function getTags(_0x252938,_0x5a697a,_0x5c1113,_0x5acba4,_0x1bc3f2,_0x49ee5d){return function(_0x511c72){return new Promise(function(_0x306d5c,_0x534f81){var _0x2523bf=[];var _0x412321=_0x5acba4[_0xe1f5('0x47')];if(_0x412321&&_0x412321[_0xe1f5('0x26')]>0x0){_0x2523bf=_[_0xe1f5('0x48')](_0x412321,_0xe1f5('0x34'));}if(_0x2523bf['length']>0x0){return manageTags(_0x252938,_0x2523bf,_0x5a697a,_0x5c1113,_0x511c72,_0x1bc3f2,_0x49ee5d)[_0xe1f5('0xa')](function(){_0x306d5c(_0x511c72);});}else{_0x306d5c(_0x511c72);}});};}function emit(_0x5f07c7,_0x2d40bd,_0x4ce41e){var _0x2309ff=_0xe1f5('0x49')+_0xe1f5('0x4a')+_0xe1f5('0x4b')+'%255EORDERBYDESCnumber';var _0x2b9ffc={'uri':_0x5f07c7+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4ce41e+_0x2309ff};io['to'](util[_0xe1f5('0x4c')](_0xe1f5('0x4d'),_0x2d40bd))[_0xe1f5('0x4e')]('trigger:browser:url',_0x2b9ffc);}exports['cs']=function(_0x5edcf7,_0x444fd,_0x426c2e,_0x6e6c9b,_0x21f830,_0x458a15,_0x34af87,_0x4d7155){var _0xb44d46={};var _0x57ddab={'user':_0x458a15[_0xe1f5('0x4f')],'pass':_0x458a15['password']};var _0x1371c7=_0xe1f5('0x50');var _0x5973f1=_0xe1f5('0x51');_0x458a15[_0xe1f5('0x52')]=intUtil[_0xe1f5('0x53')](_0x458a15[_0xe1f5('0x52')]);_0x458a15[_0xe1f5('0x54')]=intUtil[_0xe1f5('0x53')](_0x458a15[_0xe1f5('0x54')]);var _0x1cbd9f=util['format'](_0xe1f5('0x55'),_0x458a15[_0xe1f5('0x52')]);_0xb44d46[_0xe1f5('0x14')]=!_[_0xe1f5('0x56')](_0x6e6c9b)?_0x6e6c9b[_0xe1f5('0x57')]:null;_0xb44d46[_0xe1f5('0x1b')]=_0x458a15[_0xe1f5('0x57')];_0xb44d46[_0xe1f5('0x1e')]=_0x4d7155[_0xe1f5('0x2d')]()===_0xe1f5('0x35')?_0x444fd[_0xe1f5('0x58')]:_0x444fd[_0xe1f5('0x59')];_0xb44d46[_0xe1f5('0x5a')]=_0x4d7155===_0xe1f5('0x5b')||_0x4d7155===_0xe1f5('0x5c')?_0xe1f5('0x5b'):_0xe1f5('0x35');var _0xf890fd=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x458a15[_0xe1f5('0x54')],_0x444fd[_0xe1f5('0x5d')],md5(_0x444fd['uniqueid']));if(_0x21f830&&_0x21f830[_0xe1f5('0x5e')]){logger[_0xe1f5('0xd')]('[QUEUE]',_0xe1f5('0x5f'));_0x444fd[_0xe1f5('0x60')]=_0xf890fd;}else if(_0x34af87&&_0x34af87[_0xe1f5('0x61')]&&_0x34af87['recordingFormat']!==_0xe1f5('0x62')){logger[_0xe1f5('0xd')](_0xe1f5('0x63'),_0xe1f5('0x5f'));_0x444fd[_0xe1f5('0x60')]=_0xf890fd;}else{_0x444fd['recordingURL']='';}return getAdminUser(_0x4d7155,_0x57ddab,_0xb44d46,_0x1cbd9f,_0x5973f1,_0x1371c7)[_0xe1f5('0xa')](getUser(_0x4d7155,_0x57ddab,_0x1cbd9f,_0x5973f1,_0x1371c7))[_0xe1f5('0xa')](getEndUser(_0x4d7155,_0x57ddab,_0x1cbd9f,_0x5973f1,_0x1371c7))[_0xe1f5('0xa')](getTicket(_0x4d7155,_0x57ddab,_0x1cbd9f,_0x426c2e,_0x444fd,_0x5973f1))[_0xe1f5('0xa')](function(_0x165d32){logger['info'](util[_0xe1f5('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x165d32[_0xe1f5('0x3c')]));logger[_0xe1f5('0xd')](util[_0xe1f5('0x4c')](_0xe1f5('0x64'),_0x4d7155));if(_0x4d7155!==_0xe1f5('0x5c')){logger[_0xe1f5('0xd')]('['+[_0x4d7155[_0xe1f5('0xe')]()]+']',_0xe1f5('0x65'));emit(_0x458a15['remoteUri'],_0x6e6c9b[_0xe1f5('0x34')],_0x165d32['ticketId']);}})[_0xe1f5('0xf')](function(_0x1bdce3){logger[_0xe1f5('0x10')]('['+[_0x4d7155[_0xe1f5('0xe')]()]+_0xe1f5('0x66'),util[_0xe1f5('0x67')](_0x1bdce3,{'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 2ccab00..1b16a78 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 _0xe081=['sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','%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','error','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Outbound','users','version','charAt','[OUTBOUND]','unmanaged','toUpperCase','recordingURL','lastevent','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','set_entry','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','JSON','isNil','info','get_entry_list','Employees','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','customField','nameField','toLowerCase','type','idField','custom_fields','push','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration'];(function(_0x563188,_0x157c4d){var _0x211dde=function(_0x175b4b){while(--_0x175b4b){_0x563188['push'](_0x563188['shift']());}};_0x211dde(++_0x157c4d);}(_0xe081,0xa1));var _0x1e08=function(_0x1f64cc,_0x2c2101){_0x1f64cc=_0x1f64cc-0x0;var _0x525531=_0xe081[_0x1f64cc];return _0x525531;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x1e08('0x0'));var md5=require(_0x1e08('0x1'));var util=require(_0x1e08('0x2'));var Redis=require(_0x1e08('0x3'));var intUtil=require('./util');var config=require(_0x1e08('0x4'));var logger=require(_0x1e08('0x5'))(_0x1e08('0x6'));config[_0x1e08('0x7')]=_[_0x1e08('0x8')](config[_0x1e08('0x7')],{'host':_0x1e08('0x9'),'port':0x18eb});var io=require(_0x1e08('0xa'))(new Redis(config[_0x1e08('0x7')]));var def={'method':_0x1e08('0xb'),'json':!![]};function emit(_0x446439,_0x4430af,_0x32e2c7){io['to'](_0x446439)[_0x1e08('0xc')](_0x4430af,_0x32e2c7);}function getTicket(_0x375bca,_0xf70782,_0x5cd11e,_0x133c11,_0x45b3b7,_0x585e66,_0xa86d12,_0x783529){logger['info'](_0x1e08('0xd'));var _0x1b43b8=new Date();var _0x148da1=[{'name':'name','value':intUtil[_0x1e08('0xe')](_0x133c11[_0x1e08('0xf')],_0x45b3b7,'\x20')},{'name':'assigned_user_id','value':_0xf70782['id']},{'name':_0x1e08('0x10'),'value':_0xf70782['id']},{'name':_0x1e08('0x11'),'value':intUtil['getString'](_0x133c11[_0x1e08('0x12')],_0x45b3b7,'\x0a')},{'name':'date_start','value':_0x1b43b8[_0x1e08('0x13')]()[_0x1e08('0x14')](0x0,0x13)[_0x1e08('0x15')]('T','\x20')},{'name':_0x1e08('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x5cd11e['id']},{'name':_0x1e08('0x17'),'value':_0x1e08('0x18')},{'name':_0x1e08('0x19'),'value':_0x5cd11e[_0x1e08('0x1a')]},{'name':_0x1e08('0x1b'),'value':_0x783529}];if(_0x585e66[_0x1e08('0x1c')]){_[_0x1e08('0x1d')](_0x585e66,function(_0x4599bd){if(_0x45b3b7[_0x4599bd[_0x1e08('0x1e')]]){_0x148da1['push']({'name':_0x4599bd['idField'],'value':_0x45b3b7[_0x4599bd['variableName']]});}});}return request({'form':{'method':_0x1e08('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1e08('0x20')]({'session':_0xa86d12['id'],'module_name':_0x1e08('0x21'),'name_value_list':_0x148da1})}});}function getAuth(_0x29ed9b){return util[_0x1e08('0x22')](_0x1e08('0x23'),new Buffer(_0x29ed9b['apiKey']+':X')[_0x1e08('0x24')](_0x1e08('0x25')));}function getServerInfo(_0x29a855){return request({'form':{'method':_0x1e08('0x26'),'input_type':_0x1e08('0x27'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x29a855['id']})}});}function getUser(_0x129f6c,_0x5294bf,_0x45ea97){if(!_[_0x1e08('0x28')](_0x5294bf)){logger[_0x1e08('0x29')]('Getting\x20agent\x20with\x20name',_0x5294bf);return request({'form':{'method':_0x1e08('0x2a'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1e08('0x20')]({'session':_0x45ea97['id'],'module_name':_0x1e08('0x2b'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5294bf),'order_by':'','offset':'0','select_fields':['id',_0x1e08('0x1a'),_0x1e08('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3c8fe7){if(_0x3c8fe7[_0x1e08('0x2d')]['length']){var _0x49c29b=_[_0x1e08('0x2e')](_0x3c8fe7['entry_list'],function(_0xcee2a3){return _0xcee2a3[_0x1e08('0x2f')][_0x1e08('0x2c')][_0x1e08('0x30')]===_0x5294bf;});if(_0x49c29b){logger[_0x1e08('0x29')](_0x1e08('0x31'));return BPromise[_0x1e08('0x32')]({'id':_0x49c29b['name_value_list']['id']['value'],'name':_0x49c29b[_0x1e08('0x2f')][_0x1e08('0x1a')]['value']});}}logger[_0x1e08('0x29')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1e08('0x32')]({'id':_0x45ea97['name_value_list'][_0x1e08('0x33')][_0x1e08('0x30')],'name':_0x45ea97[_0x1e08('0x2f')][_0x1e08('0x2c')][_0x1e08('0x30')]});});}else{logger[_0x1e08('0x29')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1e08('0x32')]({'id':_0x45ea97['name_value_list'][_0x1e08('0x33')][_0x1e08('0x30')],'name':_0x45ea97[_0x1e08('0x2f')]['user_name']['value']});}}function getEndUser(_0x265982,_0x5b11d6,_0x4cb082,_0x542fd8){logger[_0x1e08('0x29')](_0x1e08('0x34'),_0x4cb082);return request({'form':{'method':_0x1e08('0x2a'),'input_type':_0x1e08('0x27'),'response_type':'JSON','rest_data':JSON[_0x1e08('0x20')]({'session':_0x542fd8['id'],'module_name':'Contacts','query':util[_0x1e08('0x22')](_0x1e08('0x35'),_0x4cb082),'order_by':'','offset':'0','select_fields':['id',_0x1e08('0x1a'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1e08('0x36')](function(_0x50c17d){if(_0x50c17d[_0x1e08('0x2d')][_0x1e08('0x1c')]){var _0xbaff16=_[_0x1e08('0x2e')](_0x50c17d[_0x1e08('0x2d')],function(_0x989b52){return _0x989b52[_0x1e08('0x2f')][_0x1e08('0x37')][_0x1e08('0x30')]===_0x4cb082;});if(_0xbaff16){logger['info'](_0x1e08('0x38'));return BPromise['resolve']({'id':_0xbaff16['name_value_list']['id'][_0x1e08('0x30')],'name':_0xbaff16[_0x1e08('0x2f')][_0x1e08('0x1a')][_0x1e08('0x30')],'phone':_0xbaff16[_0x1e08('0x2f')]['phone_home'][_0x1e08('0x30')]});}}else{logger[_0x1e08('0x29')](_0x1e08('0x39'));return request({'form':{'method':_0x1e08('0x1f'),'input_type':_0x1e08('0x27'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x542fd8['id'],'module_name':_0x1e08('0x18'),'name_value_list':[{'name':_0x1e08('0x3a'),'value':_0x5b11d6!==_0x1e08('0x3b')?_0x5b11d6:util['format'](_0x1e08('0x3c'),_0x4cb082)},{'name':'phone_home','value':_0x4cb082}]})}})[_0x1e08('0x36')](function(_0x53b6ef){logger['info'](_0x1e08('0x3d'));return BPromise[_0x1e08('0x32')]({'id':_0x53b6ef['id'],'name':_0x53b6ef['entry_list']['first_name']['value'],'phone':_0x53b6ef['entry_list'][_0x1e08('0x37')]['value']});});}});}function request(_0x4bd21a){logger[_0x1e08('0x3e')](_0x1e08('0x3f'),JSON[_0x1e08('0x20')](_0x4bd21a));return rp(_[_0x1e08('0x40')](def,_0x4bd21a));}function getTags(_0x38df2e,_0x4d2730){var _0x46ae5f=[];if(_0x38df2e&&_0x38df2e[_0x1e08('0x1c')]>0x0){_0x46ae5f=_[_0x1e08('0x41')](_0x38df2e,_0x4d2730);}return _0x46ae5f;}function getCustomFields(_0x3703f6,_0x2695c4){var _0x2fa430=[];var _0x5d2af8={'custom_fields':[]};if(_0x3703f6[_0x1e08('0x1c')]>0x0){_[_0x1e08('0x1d')](_0x3703f6,function(_0x51048f){if(_0x51048f['type']===_0x1e08('0x42')&&_0x51048f['nameField']&&!_0x51048f[_0x1e08('0x43')]){_0x5d2af8[_0x51048f[_0x1e08('0x44')][_0x1e08('0x45')]()]=_0x51048f['content'][_0x1e08('0x24')]();}else if(_0x51048f[_0x1e08('0x46')]===_0x1e08('0x42')&&_0x51048f[_0x1e08('0x47')]&&_0x51048f[_0x1e08('0x43')]){_0x5d2af8[_0x1e08('0x48')][_0x1e08('0x49')]({'id':_0x51048f[_0x1e08('0x47')],'value':_0x51048f['content'][_0x1e08('0x24')]()});}else if(_0x51048f['type']===_0x1e08('0x4a')&&_0x51048f[_0x1e08('0x1e')]&&_0x51048f[_0x1e08('0x47')]&&_0x51048f[_0x1e08('0x43')]){_0x2695c4[_0x51048f['variableName']]&&_0x5d2af8['custom_fields'][_0x1e08('0x49')]({'id':_0x51048f['idField'],'value':_0x2695c4[_0x51048f[_0x1e08('0x1e')]][_0x1e08('0x24')]()});}else if(_0x51048f[_0x1e08('0x46')]==='customVariable'&&_0x51048f[_0x1e08('0x4b')]&&_0x51048f['Variable']['name']&&_0x51048f[_0x1e08('0x47')]&&_0x51048f[_0x1e08('0x43')]){_0x2695c4[_0x51048f['Variable'][_0x1e08('0x1a')][_0x1e08('0x45')]()]&&_0x5d2af8['custom_fields'][_0x1e08('0x49')]({'id':_0x51048f['idField'],'value':_0x2695c4[_0x51048f[_0x1e08('0x4b')][_0x1e08('0x1a')][_0x1e08('0x45')]()]['toString']()});}});}return _0x5d2af8;}function getConnection(_0x1382de){return request({'method':_0x1e08('0xb'),'form':{'method':_0x1e08('0x4c'),'input_type':'JSON','response_type':_0x1e08('0x27'),'rest_data':JSON[_0x1e08('0x20')]({'user_auth':{'user_name':_0x1382de[_0x1e08('0x4d')],'password':_0x1382de[_0x1e08('0x4e')],'encryption':_0x1e08('0x4f')},'application':_0x1e08('0x50')})}})[_0x1e08('0x36')](function(_0x421a12){var _0x476dce=_0x421a12;if(_0x476dce['id']){def[_0x1e08('0x51')]=_0x476dce['id'];return BPromise[_0x1e08('0x32')](_0x476dce);}else{throw new Error(util[_0x1e08('0x22')](_0x1e08('0x52'),_0x1382de['id']));}});}function setRelationship(_0x461c1f,_0x48e1f5,_0x1365d9,_0x349cf6){return request({'form':{'method':'set_relationship','input_type':_0x1e08('0x27'),'response_type':_0x1e08('0x27'),'rest_data':JSON[_0x1e08('0x20')]({'session':_0x461c1f['id'],'module_name':_0x1e08('0x21'),'module_id':_0x1365d9['id'],'link_field_name':_0x349cf6,'related_ids':[_0x48e1f5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1e08('0x53')]=function(_0x3cba01,_0x5de6f3,_0x18c938,_0x277e6c,_0x2f96c2,_0x5b5101){var _0x4824ce,_0x1ecace,_0x3779ee,_0x1dc6e6;_0x5b5101[_0x1e08('0x54')]=intUtil[_0x1e08('0x55')](_0x5b5101[_0x1e08('0x54')]);_0x5b5101['serverUrl']=intUtil[_0x1e08('0x55')](_0x5b5101[_0x1e08('0x56')]);def[_0x1e08('0x57')]=util[_0x1e08('0x22')](_0x1e08('0x58'),_0x5b5101[_0x1e08('0x54')]);if(_0x2f96c2&&_0x2f96c2[_0x1e08('0x59')]){logger[_0x1e08('0x29')](_0x1e08('0x5a'),_0x1e08('0x5b'));_0x5de6f3['recordingURL']=util[_0x1e08('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b5101[_0x1e08('0x56')],_0x5de6f3[_0x1e08('0x5c')],md5(_0x5de6f3['uniqueid']));}else{_0x5de6f3['recordingURL']='';}return getConnection(_0x5b5101)[_0x1e08('0x36')](function(_0x2588c4){_0x1dc6e6=_0x2588c4;return getUser(_0x5b5101,_0x277e6c[_0x1e08('0x1a')],_0x1dc6e6);})['then'](function(_0x3b32b4){_0x4824ce=_0x3b32b4;logger['info'](_0x1e08('0x5d'),_0x4824ce['id']);return getEndUser(_0x5b5101,_0x5de6f3[_0x1e08('0x5e')],_0x5de6f3[_0x1e08('0x5f')],_0x1dc6e6);})[_0x1e08('0x36')](function(_0x1d3dd6){_0x1ecace=_0x1d3dd6;logger[_0x1e08('0x29')](_0x1e08('0x60'),_0x1ecace['id']);return getTicket(_0x5b5101,_0x4824ce,_0x1ecace,_0x18c938,_0x5de6f3,_0x18c938[_0x1e08('0x61')],_0x1dc6e6,_0x1e08('0x62'));})[_0x1e08('0x36')](function(_0x41b490){_0x3779ee=_0x41b490;logger[_0x1e08('0x29')](_0x1e08('0x63'));logger['info'](_0x1e08('0x64'),_0x3779ee['id']);return setRelationship(_0x1dc6e6,_0x4824ce,_0x3779ee,'users');})[_0x1e08('0x36')](function(){return setRelationship(_0x1dc6e6,_0x1ecace,_0x3779ee,_0x1e08('0x65'));})['then'](function(){return getServerInfo(_0x1dc6e6);})[_0x1e08('0x36')](function(_0x10fff6){var _0x514749=parseInt(_0x10fff6['version']['charAt'](0x0));var _0x1d6e70=util['format'](_0x1e08('0x66'),_0x5b5101[_0x1e08('0x54')],_0x3779ee['id']);if(_0x514749>0x6){_0x1d6e70=util[_0x1e08('0x22')](_0x1e08('0x67'),_0x5b5101[_0x1e08('0x54')],_0x3779ee['id']);}logger[_0x1e08('0x29')](_0x1e08('0x5a'),_0x1e08('0x68'));emit(util['format'](_0x1e08('0x69'),_0x277e6c['name']),_0x1e08('0x6a'),{'uri':_0x1d6e70});})[_0x1e08('0x6b')](function(_0xa9660c){logger[_0x1e08('0x6c')](_0x1e08('0x5a'),JSON[_0x1e08('0x20')](_0xa9660c));});};exports[_0x1e08('0x6d')]=function(_0x55cabe,_0x3a3fff,_0x54d6fc,_0x3ad30c,_0x48c739,_0x4183c1,_0x759abd){var _0x394748,_0x41a5b7,_0x445910,_0xb9bc3c;_0x4183c1[_0x1e08('0x54')]=intUtil[_0x1e08('0x55')](_0x4183c1[_0x1e08('0x54')]);_0x4183c1[_0x1e08('0x56')]=intUtil[_0x1e08('0x55')](_0x4183c1[_0x1e08('0x56')]);def[_0x1e08('0x57')]=util[_0x1e08('0x22')]('%s/service/v4_1/rest.php',_0x4183c1['remoteUri']);if(_0x759abd&&_0x759abd[_0x1e08('0x6e')]&&_0x759abd['recordingFormat']!=='none'){logger[_0x1e08('0x29')]('[OUTBOUND]',_0x1e08('0x5b'));_0x3a3fff['recordingURL']=util[_0x1e08('0x22')](_0x1e08('0x6f'),_0x4183c1['serverUrl'],_0x3a3fff[_0x1e08('0x5c')],md5(_0x3a3fff[_0x1e08('0x5c')]));}return getConnection(_0x4183c1)['then'](function(_0x5c9e4e){_0xb9bc3c=_0x5c9e4e;return getUser(_0x4183c1,_0x3ad30c[_0x1e08('0x1a')],_0xb9bc3c);})['then'](function(_0x20a863){_0x394748=_0x20a863;logger[_0x1e08('0x29')](_0x1e08('0x5d'),_0x394748['id']);return getEndUser(_0x4183c1,_0x3a3fff['destcalleridname'],_0x3a3fff['destcalleridnum'],_0xb9bc3c);})['then'](function(_0xfa8a3d){_0x41a5b7=_0xfa8a3d;logger[_0x1e08('0x29')](_0x1e08('0x60'),_0x41a5b7['id']);return getTicket(_0x4183c1,_0x394748,_0x41a5b7,_0x54d6fc,_0x3a3fff,_0x54d6fc[_0x1e08('0x61')],_0xb9bc3c,_0x1e08('0x70'));})[_0x1e08('0x36')](function(_0x3d3786){_0x445910=_0x3d3786;logger[_0x1e08('0x29')](_0x1e08('0x63'));logger[_0x1e08('0x29')]('The\x20Ticket\x20ID\x20is:',_0x445910['id']);return setRelationship(_0xb9bc3c,_0x394748,_0x445910,_0x1e08('0x71'));})[_0x1e08('0x36')](function(){return setRelationship(_0xb9bc3c,_0x41a5b7,_0x445910,_0x1e08('0x65'));})[_0x1e08('0x36')](function(){return getServerInfo(_0xb9bc3c);})[_0x1e08('0x36')](function(_0x282813){var _0x167269=parseInt(_0x282813[_0x1e08('0x72')][_0x1e08('0x73')](0x0));var _0x58cb7c=util[_0x1e08('0x22')](_0x1e08('0x66'),_0x4183c1[_0x1e08('0x54')],_0x445910['id']);if(_0x167269>0x6){_0x58cb7c=util[_0x1e08('0x22')](_0x1e08('0x67'),_0x4183c1[_0x1e08('0x54')],_0x445910['id']);}logger['info']('[OUTBOUND]',_0x1e08('0x68'));emit(util[_0x1e08('0x22')](_0x1e08('0x69'),_0x3ad30c[_0x1e08('0x1a')]),_0x1e08('0x6a'),{'uri':_0x58cb7c});})['catch'](function(_0xaee37){logger[_0x1e08('0x6c')](_0x1e08('0x74'),JSON[_0x1e08('0x20')](_0xaee37));});};exports[_0x1e08('0x75')]=function(_0x5b6b19,_0x28af98,_0x2c9166,_0x20e8c2,_0x34afbc,_0x4fc541){var _0x35ac06,_0x46e714,_0x56b392,_0x774ff1;_0x4fc541[_0x1e08('0x54')]=intUtil[_0x1e08('0x55')](_0x4fc541[_0x1e08('0x54')]);_0x4fc541['serverUrl']=intUtil[_0x1e08('0x55')](_0x4fc541[_0x1e08('0x56')]);def[_0x1e08('0x57')]=util[_0x1e08('0x22')](_0x1e08('0x58'),_0x4fc541[_0x1e08('0x54')]);if(_0x34afbc&&_0x34afbc[_0x1e08('0x59')]){logger[_0x1e08('0x29')]('['+_0x28af98['lastevent'][_0x1e08('0x76')]()+']',_0x1e08('0x5b'));_0x28af98[_0x1e08('0x77')]=util[_0x1e08('0x22')](_0x1e08('0x6f'),_0x4fc541[_0x1e08('0x56')],_0x28af98['uniqueid'],md5(_0x28af98['uniqueid']));}else{_0x28af98[_0x1e08('0x77')]='';}return getConnection(_0x4fc541)[_0x1e08('0x36')](function(_0xf4bba6){_0x774ff1=_0xf4bba6;if(!_[_0x1e08('0x28')](_0x20e8c2)){return getUser(_0x4fc541,_0x20e8c2[_0x1e08('0x1a')],_0x774ff1);}else{return getUser(_0x4fc541,null,_0x774ff1);}})[_0x1e08('0x36')](function(_0x5c9ce9){_0x35ac06=_0x5c9ce9;logger[_0x1e08('0x29')](_0x1e08('0x5d'),_0x35ac06['id']);return getEndUser(_0x4fc541,_0x28af98[_0x1e08('0x5e')],_0x28af98[_0x1e08('0x5f')],_0x774ff1);})[_0x1e08('0x36')](function(_0xcb9f5c){_0x46e714=_0xcb9f5c;logger['info'](_0x1e08('0x60'),_0x46e714['id']);return getTicket(_0x4fc541,_0x35ac06,_0x46e714,_0x2c9166,_0x28af98,_0x2c9166[_0x1e08('0x61')],_0x774ff1,'Inbound');})[_0x1e08('0x36')](function(_0x2e625c){_0x56b392=_0x2e625c;logger[_0x1e08('0x29')](_0x1e08('0x63'));logger[_0x1e08('0x29')](_0x1e08('0x64'),_0x56b392['id']);return setRelationship(_0x774ff1,_0x35ac06,_0x56b392,_0x1e08('0x71'));})[_0x1e08('0x36')](function(){return setRelationship(_0x774ff1,_0x46e714,_0x56b392,_0x1e08('0x65'));})[_0x1e08('0x36')](function(){return getServerInfo(_0x774ff1);})[_0x1e08('0x6b')](function(_0x372dda){logger[_0x1e08('0x6c')]('['+_0x28af98[_0x1e08('0x78')][_0x1e08('0x76')]()+']',JSON[_0x1e08('0x20')](_0x372dda));});}; \ No newline at end of file +var _0xaae0=['Outbound','catch','unmanaged','lastevent','toUpperCase','error','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','parent_type','direction','length','forEach','push','idField','variableName','JSON','Calls','format','Basic\x20%s','apiKey','base64','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','find','entry_list','name_value_list','Agent\x20found!','resolve','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','toString','custom_fields','variable','customField','Variable','login','username','password','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!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','none','[OUTBOUND]','The\x20User\x20ID\x20is:'];(function(_0x3faf6b,_0x129aad){var _0x5e0510=function(_0x11932d){while(--_0x11932d){_0x3faf6b['push'](_0x3faf6b['shift']());}};_0x5e0510(++_0x129aad);}(_0xaae0,0x16b));var _0x0aae=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaae0[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require(_0x0aae('0x0'));var BPromise=require(_0x0aae('0x1'));var md5=require(_0x0aae('0x2'));var util=require(_0x0aae('0x3'));var Redis=require(_0x0aae('0x4'));var intUtil=require('./util');var config=require(_0x0aae('0x5'));var logger=require(_0x0aae('0x6'))(_0x0aae('0x7'));config[_0x0aae('0x8')]=_[_0x0aae('0x9')](config[_0x0aae('0x8')],{'host':_0x0aae('0xa'),'port':0x18eb});var io=require(_0x0aae('0xb'))(new Redis(config[_0x0aae('0x8')]));var def={'method':_0x0aae('0xc'),'json':!![]};function emit(_0x3d5450,_0x2d03b7,_0x172367){io['to'](_0x3d5450)[_0x0aae('0xd')](_0x2d03b7,_0x172367);}function getTicket(_0x21b1e7,_0x7fa7be,_0x360e41,_0x2e20df,_0x5e2c6c,_0x22f8a5,_0x476207,_0x39708e){logger['info'](_0x0aae('0xe'));var _0x386037=new Date();var _0x452e12=[{'name':_0x0aae('0xf'),'value':intUtil[_0x0aae('0x10')](_0x2e20df[_0x0aae('0x11')],_0x5e2c6c,'\x20')},{'name':_0x0aae('0x12'),'value':_0x7fa7be['id']},{'name':_0x0aae('0x13'),'value':_0x7fa7be['id']},{'name':_0x0aae('0x14'),'value':intUtil[_0x0aae('0x10')](_0x2e20df[_0x0aae('0x15')],_0x5e2c6c,'\x0a')},{'name':_0x0aae('0x16'),'value':_0x386037[_0x0aae('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x360e41['id']},{'name':_0x0aae('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x360e41[_0x0aae('0xf')]},{'name':_0x0aae('0x19'),'value':_0x39708e}];if(_0x22f8a5[_0x0aae('0x1a')]){_[_0x0aae('0x1b')](_0x22f8a5,function(_0x128e89){if(_0x5e2c6c[_0x128e89['variableName']]){_0x452e12[_0x0aae('0x1c')]({'name':_0x128e89[_0x0aae('0x1d')],'value':_0x5e2c6c[_0x128e89[_0x0aae('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x0aae('0x1f'),'response_type':_0x0aae('0x1f'),'rest_data':JSON['stringify']({'session':_0x476207['id'],'module_name':_0x0aae('0x20'),'name_value_list':_0x452e12})}});}function getAuth(_0x52a048){return util[_0x0aae('0x21')](_0x0aae('0x22'),new Buffer(_0x52a048[_0x0aae('0x23')]+':X')['toString'](_0x0aae('0x24')));}function getServerInfo(_0x2faa61){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x0aae('0x1f'),'rest_data':JSON[_0x0aae('0x25')]({'session':_0x2faa61['id']})}});}function getUser(_0x2d5390,_0x43dc2b,_0x16e04a){if(!_[_0x0aae('0x26')](_0x43dc2b)){logger['info'](_0x0aae('0x27'),_0x43dc2b);return request({'form':{'method':_0x0aae('0x28'),'input_type':_0x0aae('0x1f'),'response_type':'JSON','rest_data':JSON[_0x0aae('0x25')]({'session':_0x16e04a['id'],'module_name':'Employees','query':util[_0x0aae('0x21')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x43dc2b),'order_by':'','offset':'0','select_fields':['id',_0x0aae('0xf'),_0x0aae('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0aae('0x2a')](function(_0x4d17f4){if(_0x4d17f4['entry_list']['length']){var _0x2ffee9=_[_0x0aae('0x2b')](_0x4d17f4[_0x0aae('0x2c')],function(_0x474733){return _0x474733[_0x0aae('0x2d')][_0x0aae('0x29')]['value']===_0x43dc2b;});if(_0x2ffee9){logger['info'](_0x0aae('0x2e'));return BPromise[_0x0aae('0x2f')]({'id':_0x2ffee9[_0x0aae('0x2d')]['id']['value'],'name':_0x2ffee9['name_value_list'][_0x0aae('0xf')]['value']});}}logger[_0x0aae('0x30')](_0x0aae('0x31'));return BPromise[_0x0aae('0x2f')]({'id':_0x16e04a['name_value_list'][_0x0aae('0x32')][_0x0aae('0x33')],'name':_0x16e04a['name_value_list']['user_name'][_0x0aae('0x33')]});});}else{logger['info'](_0x0aae('0x34'));return BPromise[_0x0aae('0x2f')]({'id':_0x16e04a['name_value_list'][_0x0aae('0x32')]['value'],'name':_0x16e04a[_0x0aae('0x2d')][_0x0aae('0x29')]['value']});}}function getEndUser(_0x3fdf24,_0x3d20b6,_0x1f6421,_0x4fab29){logger['info'](_0x0aae('0x35'),_0x1f6421);return request({'form':{'method':_0x0aae('0x28'),'input_type':'JSON','response_type':_0x0aae('0x1f'),'rest_data':JSON['stringify']({'session':_0x4fab29['id'],'module_name':_0x0aae('0x36'),'query':util[_0x0aae('0x21')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1f6421),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0aae('0x2a')](function(_0x137477){if(_0x137477[_0x0aae('0x2c')][_0x0aae('0x1a')]){var _0x184a53=_['find'](_0x137477['entry_list'],function(_0xef82c3){return _0xef82c3[_0x0aae('0x2d')]['phone_home'][_0x0aae('0x33')]===_0x1f6421;});if(_0x184a53){logger[_0x0aae('0x30')](_0x0aae('0x37'));return BPromise[_0x0aae('0x2f')]({'id':_0x184a53[_0x0aae('0x2d')]['id'][_0x0aae('0x33')],'name':_0x184a53['name_value_list']['name'][_0x0aae('0x33')],'phone':_0x184a53[_0x0aae('0x2d')][_0x0aae('0x38')][_0x0aae('0x33')]});}}else{logger['info'](_0x0aae('0x39'));return request({'form':{'method':_0x0aae('0x3a'),'input_type':'JSON','response_type':_0x0aae('0x1f'),'rest_data':JSON['stringify']({'session':_0x4fab29['id'],'module_name':_0x0aae('0x36'),'name_value_list':[{'name':'first_name','value':_0x3d20b6!==_0x0aae('0x3b')?_0x3d20b6:util[_0x0aae('0x21')]('Caller\x20-\x20%s',_0x1f6421)},{'name':'phone_home','value':_0x1f6421}]})}})[_0x0aae('0x2a')](function(_0x26d75d){logger['info'](_0x0aae('0x3c'));return BPromise[_0x0aae('0x2f')]({'id':_0x26d75d['id'],'name':_0x26d75d[_0x0aae('0x2c')][_0x0aae('0x3d')]['value'],'phone':_0x26d75d[_0x0aae('0x2c')]['phone_home'][_0x0aae('0x33')]});});}});}function request(_0x4deb94){logger[_0x0aae('0x3e')](_0x0aae('0x3f'),JSON[_0x0aae('0x25')](_0x4deb94));return rp(_[_0x0aae('0x40')](def,_0x4deb94));}function getTags(_0x51150b,_0x523bc5){var _0x120309=[];if(_0x51150b&&_0x51150b['length']>0x0){_0x120309=_[_0x0aae('0x41')](_0x51150b,_0x523bc5);}return _0x120309;}function getCustomFields(_0x2845fa,_0x4c8f76){var _0x32fe0f=[];var _0x580aa5={'custom_fields':[]};if(_0x2845fa[_0x0aae('0x1a')]>0x0){_[_0x0aae('0x1b')](_0x2845fa,function(_0x2f8407){if(_0x2f8407[_0x0aae('0x42')]===_0x0aae('0x43')&&_0x2f8407[_0x0aae('0x44')]&&!_0x2f8407['customField']){_0x580aa5[_0x2f8407['nameField'][_0x0aae('0x45')]()]=_0x2f8407[_0x0aae('0x46')][_0x0aae('0x47')]();}else if(_0x2f8407[_0x0aae('0x42')]===_0x0aae('0x43')&&_0x2f8407['idField']&&_0x2f8407['customField']){_0x580aa5[_0x0aae('0x48')]['push']({'id':_0x2f8407[_0x0aae('0x1d')],'value':_0x2f8407[_0x0aae('0x46')][_0x0aae('0x47')]()});}else if(_0x2f8407[_0x0aae('0x42')]===_0x0aae('0x49')&&_0x2f8407[_0x0aae('0x1e')]&&_0x2f8407[_0x0aae('0x1d')]&&_0x2f8407[_0x0aae('0x4a')]){_0x4c8f76[_0x2f8407['variableName']]&&_0x580aa5[_0x0aae('0x48')][_0x0aae('0x1c')]({'id':_0x2f8407[_0x0aae('0x1d')],'value':_0x4c8f76[_0x2f8407['variableName']]['toString']()});}else if(_0x2f8407[_0x0aae('0x42')]==='customVariable'&&_0x2f8407[_0x0aae('0x4b')]&&_0x2f8407[_0x0aae('0x4b')]['name']&&_0x2f8407[_0x0aae('0x1d')]&&_0x2f8407[_0x0aae('0x4a')]){_0x4c8f76[_0x2f8407[_0x0aae('0x4b')][_0x0aae('0xf')][_0x0aae('0x45')]()]&&_0x580aa5[_0x0aae('0x48')][_0x0aae('0x1c')]({'id':_0x2f8407['idField'],'value':_0x4c8f76[_0x2f8407[_0x0aae('0x4b')][_0x0aae('0xf')]['toLowerCase']()][_0x0aae('0x47')]()});}});}return _0x580aa5;}function getConnection(_0x2c80de){return request({'method':_0x0aae('0xc'),'form':{'method':_0x0aae('0x4c'),'input_type':_0x0aae('0x1f'),'response_type':_0x0aae('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2c80de[_0x0aae('0x4d')],'password':_0x2c80de[_0x0aae('0x4e')],'encryption':_0x0aae('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x0aae('0x2a')](function(_0x5cffdd){var _0x47874b=_0x5cffdd;if(_0x47874b['id']){def[_0x0aae('0x50')]=_0x47874b['id'];return BPromise[_0x0aae('0x2f')](_0x47874b);}else{throw new Error(util[_0x0aae('0x21')](_0x0aae('0x51'),_0x2c80de['id']));}});}function setRelationship(_0x46a0d7,_0x3b3371,_0x43f3fc,_0x3dafb6){return request({'form':{'method':_0x0aae('0x52'),'input_type':_0x0aae('0x1f'),'response_type':_0x0aae('0x1f'),'rest_data':JSON[_0x0aae('0x25')]({'session':_0x46a0d7['id'],'module_name':_0x0aae('0x20'),'module_id':_0x43f3fc['id'],'link_field_name':_0x3dafb6,'related_ids':[_0x3b3371['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0aae('0x53')]=function(_0x328851,_0x3daf18,_0x254fc1,_0x4c4d1d,_0x2ce163,_0x234075){var _0x530df9,_0x4da16a,_0x2e2ff5,_0x3129c2;_0x234075[_0x0aae('0x54')]=intUtil[_0x0aae('0x55')](_0x234075[_0x0aae('0x54')]);_0x234075[_0x0aae('0x56')]=intUtil['stripTrailingSlash'](_0x234075[_0x0aae('0x56')]);def[_0x0aae('0x57')]=util['format'](_0x0aae('0x58'),_0x234075[_0x0aae('0x54')]);if(_0x2ce163&&_0x2ce163[_0x0aae('0x59')]){logger[_0x0aae('0x30')](_0x0aae('0x5a'),_0x0aae('0x5b'));_0x3daf18['recordingURL']=util[_0x0aae('0x21')](_0x0aae('0x5c'),_0x234075[_0x0aae('0x56')],_0x3daf18[_0x0aae('0x5d')],md5(_0x3daf18[_0x0aae('0x5d')]));}else{_0x3daf18[_0x0aae('0x5e')]='';}return getConnection(_0x234075)['then'](function(_0x2d6456){_0x3129c2=_0x2d6456;return getUser(_0x234075,_0x4c4d1d[_0x0aae('0xf')],_0x3129c2);})[_0x0aae('0x2a')](function(_0x45d87b){_0x530df9=_0x45d87b;logger[_0x0aae('0x30')]('The\x20User\x20ID\x20is:',_0x530df9['id']);return getEndUser(_0x234075,_0x3daf18['calleridname'],_0x3daf18[_0x0aae('0x5f')],_0x3129c2);})[_0x0aae('0x2a')](function(_0x21141f){_0x4da16a=_0x21141f;logger[_0x0aae('0x30')](_0x0aae('0x60'),_0x4da16a['id']);return getTicket(_0x234075,_0x530df9,_0x4da16a,_0x254fc1,_0x3daf18,_0x254fc1[_0x0aae('0x61')],_0x3129c2,_0x0aae('0x62'));})[_0x0aae('0x2a')](function(_0x28e649){_0x2e2ff5=_0x28e649;logger[_0x0aae('0x30')](_0x0aae('0x63'));logger[_0x0aae('0x30')](_0x0aae('0x64'),_0x2e2ff5['id']);return setRelationship(_0x3129c2,_0x530df9,_0x2e2ff5,_0x0aae('0x65'));})['then'](function(){return setRelationship(_0x3129c2,_0x4da16a,_0x2e2ff5,_0x0aae('0x66'));})[_0x0aae('0x2a')](function(){return getServerInfo(_0x3129c2);})[_0x0aae('0x2a')](function(_0x42f4aa){var _0x2eb8dd=parseInt(_0x42f4aa[_0x0aae('0x67')][_0x0aae('0x68')](0x0));var _0x2eac52=util[_0x0aae('0x21')](_0x0aae('0x69'),_0x234075['remoteUri'],_0x2e2ff5['id']);if(_0x2eb8dd>0x6){_0x2eac52=util['format'](_0x0aae('0x6a'),_0x234075[_0x0aae('0x54')],_0x2e2ff5['id']);}logger[_0x0aae('0x30')]('[QUEUE]',_0x0aae('0x6b'));emit(util['format'](_0x0aae('0x6c'),_0x4c4d1d[_0x0aae('0xf')]),_0x0aae('0x6d'),{'uri':_0x2eac52});})['catch'](function(_0x195fac){logger['error'](_0x0aae('0x5a'),JSON['stringify'](_0x195fac));});};exports['outbound']=function(_0x5deada,_0xb5cc27,_0x5ab198,_0x16598a,_0x3154a0,_0x1019d3,_0x4ae860){var _0xea0220,_0x1cf689,_0x2bcf2e,_0x258783;_0x1019d3[_0x0aae('0x54')]=intUtil[_0x0aae('0x55')](_0x1019d3[_0x0aae('0x54')]);_0x1019d3['serverUrl']=intUtil[_0x0aae('0x55')](_0x1019d3[_0x0aae('0x56')]);def[_0x0aae('0x57')]=util[_0x0aae('0x21')](_0x0aae('0x58'),_0x1019d3[_0x0aae('0x54')]);if(_0x4ae860&&_0x4ae860['recordingFormat']&&_0x4ae860['recordingFormat']!==_0x0aae('0x6e')){logger[_0x0aae('0x30')](_0x0aae('0x6f'),_0x0aae('0x5b'));_0xb5cc27[_0x0aae('0x5e')]=util[_0x0aae('0x21')](_0x0aae('0x5c'),_0x1019d3['serverUrl'],_0xb5cc27[_0x0aae('0x5d')],md5(_0xb5cc27[_0x0aae('0x5d')]));}return getConnection(_0x1019d3)[_0x0aae('0x2a')](function(_0xa98641){_0x258783=_0xa98641;return getUser(_0x1019d3,_0x16598a[_0x0aae('0xf')],_0x258783);})[_0x0aae('0x2a')](function(_0x65772e){_0xea0220=_0x65772e;logger[_0x0aae('0x30')](_0x0aae('0x70'),_0xea0220['id']);return getEndUser(_0x1019d3,_0xb5cc27['destcalleridname'],_0xb5cc27['destcalleridnum'],_0x258783);})[_0x0aae('0x2a')](function(_0x6cbece){_0x1cf689=_0x6cbece;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1cf689['id']);return getTicket(_0x1019d3,_0xea0220,_0x1cf689,_0x5ab198,_0xb5cc27,_0x5ab198[_0x0aae('0x61')],_0x258783,_0x0aae('0x71'));})[_0x0aae('0x2a')](function(_0x4c4818){_0x2bcf2e=_0x4c4818;logger[_0x0aae('0x30')](_0x0aae('0x63'));logger[_0x0aae('0x30')](_0x0aae('0x64'),_0x2bcf2e['id']);return setRelationship(_0x258783,_0xea0220,_0x2bcf2e,_0x0aae('0x65'));})[_0x0aae('0x2a')](function(){return setRelationship(_0x258783,_0x1cf689,_0x2bcf2e,_0x0aae('0x66'));})['then'](function(){return getServerInfo(_0x258783);})['then'](function(_0x3d3c14){var _0x207bb6=parseInt(_0x3d3c14['version'][_0x0aae('0x68')](0x0));var _0x2d1afc=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1019d3[_0x0aae('0x54')],_0x2bcf2e['id']);if(_0x207bb6>0x6){_0x2d1afc=util[_0x0aae('0x21')](_0x0aae('0x6a'),_0x1019d3[_0x0aae('0x54')],_0x2bcf2e['id']);}logger[_0x0aae('0x30')]('[OUTBOUND]',_0x0aae('0x6b'));emit(util[_0x0aae('0x21')](_0x0aae('0x6c'),_0x16598a[_0x0aae('0xf')]),'trigger:browser:url',{'uri':_0x2d1afc});})[_0x0aae('0x72')](function(_0x3294da){logger['error'](_0x0aae('0x6f'),JSON[_0x0aae('0x25')](_0x3294da));});};exports[_0x0aae('0x73')]=function(_0x53c1f1,_0x27490f,_0x5402c1,_0x52c626,_0x2c5439,_0x43a20d){var _0x451504,_0x51557e,_0x27bbaa,_0x4d68de;_0x43a20d['remoteUri']=intUtil[_0x0aae('0x55')](_0x43a20d[_0x0aae('0x54')]);_0x43a20d[_0x0aae('0x56')]=intUtil[_0x0aae('0x55')](_0x43a20d[_0x0aae('0x56')]);def['uri']=util[_0x0aae('0x21')](_0x0aae('0x58'),_0x43a20d['remoteUri']);if(_0x2c5439&&_0x2c5439[_0x0aae('0x59')]){logger[_0x0aae('0x30')]('['+_0x27490f[_0x0aae('0x74')][_0x0aae('0x75')]()+']',_0x0aae('0x5b'));_0x27490f[_0x0aae('0x5e')]=util[_0x0aae('0x21')](_0x0aae('0x5c'),_0x43a20d[_0x0aae('0x56')],_0x27490f[_0x0aae('0x5d')],md5(_0x27490f[_0x0aae('0x5d')]));}else{_0x27490f['recordingURL']='';}return getConnection(_0x43a20d)[_0x0aae('0x2a')](function(_0x4f61a5){_0x4d68de=_0x4f61a5;if(!_['isNil'](_0x52c626)){return getUser(_0x43a20d,_0x52c626[_0x0aae('0xf')],_0x4d68de);}else{return getUser(_0x43a20d,null,_0x4d68de);}})['then'](function(_0x4bb58a){_0x451504=_0x4bb58a;logger[_0x0aae('0x30')](_0x0aae('0x70'),_0x451504['id']);return getEndUser(_0x43a20d,_0x27490f['calleridname'],_0x27490f[_0x0aae('0x5f')],_0x4d68de);})[_0x0aae('0x2a')](function(_0x3ced89){_0x51557e=_0x3ced89;logger[_0x0aae('0x30')]('The\x20Enduser\x20ID\x20is:',_0x51557e['id']);return getTicket(_0x43a20d,_0x451504,_0x51557e,_0x5402c1,_0x27490f,_0x5402c1['Fields'],_0x4d68de,_0x0aae('0x62'));})[_0x0aae('0x2a')](function(_0xd3326b){_0x27bbaa=_0xd3326b;logger[_0x0aae('0x30')](_0x0aae('0x63'));logger['info'](_0x0aae('0x64'),_0x27bbaa['id']);return setRelationship(_0x4d68de,_0x451504,_0x27bbaa,_0x0aae('0x65'));})[_0x0aae('0x2a')](function(){return setRelationship(_0x4d68de,_0x51557e,_0x27bbaa,_0x0aae('0x66'));})[_0x0aae('0x2a')](function(){return getServerInfo(_0x4d68de);})[_0x0aae('0x72')](function(_0x221dc0){logger[_0x0aae('0x76')]('['+_0x27490f['lastevent'][_0x0aae('0x75')]()+']',JSON['stringify'](_0x221dc0));});}; \ 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 f7f0c33..dee64a4 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 _0x03cf=['type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x03cf,0x1ad));var _0xf03c=function(_0x32bf42,_0x15d7e4){_0x32bf42=_0x32bf42-0x0;var _0x391912=_0x03cf[_0x32bf42];return _0x391912;};'use strict';var _=require(_0xf03c('0x0'));var util=require('util');exports[_0xf03c('0x1')]=function(_0xc3da25,_0x5298a0,_0x23e739){var _0x1a1883=[];if(_0xc3da25[_0xf03c('0x2')]>0x0){var _0x31c362=_['sortBy'](_0xc3da25,['id']);for(var _0x1c68e6=0x0;_0x1c68e6<_0x31c362['length'];_0x1c68e6++){var _0x2fae0e=_0x31c362[_0x1c68e6];if(_0x2fae0e[_0xf03c('0x3')]==='string'){_0x1a1883[_0xf03c('0x4')](_0x2fae0e[_0xf03c('0x5')]);}else if(_0x2fae0e[_0xf03c('0x3')]===_0xf03c('0x6')&&_0x2fae0e['variableName']){_0x5298a0[_0x2fae0e[_0xf03c('0x7')]]&&_0x1a1883[_0xf03c('0x4')](_0x5298a0[_0x2fae0e[_0xf03c('0x7')]][_0xf03c('0x8')]());}else if(_0x2fae0e[_0xf03c('0x3')]===_0xf03c('0x9')&&_0x2fae0e['Variable']&&_0x2fae0e[_0xf03c('0xa')]['name']){_0x5298a0[_0x2fae0e[_0xf03c('0xa')][_0xf03c('0xb')][_0xf03c('0xc')]()]&&_0x1a1883[_0xf03c('0x4')](_0x5298a0[_0x2fae0e[_0xf03c('0xa')][_0xf03c('0xb')][_0xf03c('0xc')]()]['toString']());}else if(_0x2fae0e['type']===_0xf03c('0xd')){if(_0x2fae0e[_0xf03c('0xe')]===_0xf03c('0xf')&&_0x2fae0e[_0xf03c('0x10')]){_0x1a1883[_0xf03c('0x4')](util['format'](_0xf03c('0x11'),_0x2fae0e['key'],_0x2fae0e[_0xf03c('0x12')]));}else if(_0x2fae0e['keyType']===_0xf03c('0x6')&&_0x2fae0e['variableName']&&_0x2fae0e[_0xf03c('0x10')]){_0x5298a0[_0x2fae0e[_0xf03c('0x7')]]&&_0x1a1883[_0xf03c('0x4')](util[_0xf03c('0x13')](_0xf03c('0x11'),_0x2fae0e[_0xf03c('0x10')],_0x5298a0[_0x2fae0e[_0xf03c('0x7')]]));}else if(_0x2fae0e[_0xf03c('0xe')]===_0xf03c('0x9')&&_0x2fae0e[_0xf03c('0xa')]&&_0x2fae0e[_0xf03c('0xa')][_0xf03c('0xb')]&&_0x2fae0e[_0xf03c('0x10')]){_0x5298a0[_0x2fae0e['Variable']['name'][_0xf03c('0xc')]()]&&_0x1a1883[_0xf03c('0x4')](util['format']('%s:\x20%s',_0x2fae0e[_0xf03c('0x10')],_0x5298a0[_0x2fae0e[_0xf03c('0xa')]['name'][_0xf03c('0xc')]()]));}}}}return _0x1a1883[_0xf03c('0x14')](_0x23e739);};exports[_0xf03c('0x15')]=function(_0x527970){var _0x492622=_0x527970['slice'](-0x1);if(_0x492622==='/'){_0x527970=_0x527970[_0xf03c('0x16')](0x0,_0x527970[_0xf03c('0x17')](_0x492622));}return _0x527970;};exports[_0xf03c('0x18')]=function(_0x56858d){if(!_[_0xf03c('0x19')](_0x56858d)&&_0x56858d!==''){var _0x3b2134=/^(([^<>()\[\]\\.,;:\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 _0x3b2134[_0xf03c('0x1a')](String(_0x56858d)[_0xf03c('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xd4ea=['sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd4ea,0xef));var _0xad4e=function(_0x330a9e,_0x3eb7b4){_0x330a9e=_0x330a9e-0x0;var _0x43c7c4=_0xd4ea[_0x330a9e];return _0x43c7c4;};'use strict';var _=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));exports[_0xad4e('0x2')]=function(_0x376c41,_0x52be35,_0xbc30c5){var _0x9aa737=[];if(_0x376c41[_0xad4e('0x3')]>0x0){var _0xae41d6=_[_0xad4e('0x4')](_0x376c41,['id']);for(var _0x365afb=0x0;_0x365afb<_0xae41d6[_0xad4e('0x3')];_0x365afb++){var _0x41c050=_0xae41d6[_0x365afb];if(_0x41c050[_0xad4e('0x5')]===_0xad4e('0x6')){_0x9aa737[_0xad4e('0x7')](_0x41c050[_0xad4e('0x8')]);}else if(_0x41c050[_0xad4e('0x5')]==='variable'&&_0x41c050['variableName']){_0x52be35[_0x41c050[_0xad4e('0x9')]]&&_0x9aa737['push'](_0x52be35[_0x41c050[_0xad4e('0x9')]][_0xad4e('0xa')]());}else if(_0x41c050[_0xad4e('0x5')]===_0xad4e('0xb')&&_0x41c050[_0xad4e('0xc')]&&_0x41c050[_0xad4e('0xc')]['name']){_0x52be35[_0x41c050[_0xad4e('0xc')][_0xad4e('0xd')][_0xad4e('0xe')]()]&&_0x9aa737['push'](_0x52be35[_0x41c050['Variable'][_0xad4e('0xd')]['toLowerCase']()][_0xad4e('0xa')]());}else if(_0x41c050[_0xad4e('0x5')]===_0xad4e('0xf')){if(_0x41c050[_0xad4e('0x10')]===_0xad4e('0x6')&&_0x41c050[_0xad4e('0x11')]){_0x9aa737[_0xad4e('0x7')](util['format'](_0xad4e('0x12'),_0x41c050[_0xad4e('0x11')],_0x41c050[_0xad4e('0x13')]));}else if(_0x41c050[_0xad4e('0x10')]==='variable'&&_0x41c050[_0xad4e('0x9')]&&_0x41c050[_0xad4e('0x11')]){_0x52be35[_0x41c050[_0xad4e('0x9')]]&&_0x9aa737[_0xad4e('0x7')](util['format']('%s:\x20%s',_0x41c050['key'],_0x52be35[_0x41c050['variableName']]));}else if(_0x41c050[_0xad4e('0x10')]===_0xad4e('0xb')&&_0x41c050[_0xad4e('0xc')]&&_0x41c050[_0xad4e('0xc')][_0xad4e('0xd')]&&_0x41c050['key']){_0x52be35[_0x41c050[_0xad4e('0xc')]['name'][_0xad4e('0xe')]()]&&_0x9aa737[_0xad4e('0x7')](util['format'](_0xad4e('0x12'),_0x41c050[_0xad4e('0x11')],_0x52be35[_0x41c050[_0xad4e('0xc')][_0xad4e('0xd')][_0xad4e('0xe')]()]));}}}}return _0x9aa737[_0xad4e('0x14')](_0xbc30c5);};exports[_0xad4e('0x15')]=function(_0x599932){var _0x2a7fca=_0x599932[_0xad4e('0x16')](-0x1);if(_0x2a7fca==='/'){_0x599932=_0x599932['substring'](0x0,_0x599932[_0xad4e('0x17')](_0x2a7fca));}return _0x599932;};exports[_0xad4e('0x18')]=function(_0x3b27e1){if(!_[_0xad4e('0x19')](_0x3b27e1)&&_0x3b27e1!==''){var _0x3c9936=/^(([^<>()\[\]\\.,;:\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 _0x3c9936[_0xad4e('0x1a')](String(_0x3b27e1)[_0xad4e('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 7c02e9d..91a3167 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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(_0x4959f2,_0x3d1162){var _0x12acdc=function(_0x4636f4){while(--_0x4636f4){_0x4959f2['push'](_0x4959f2['shift']());}};_0x12acdc(++_0x3d1162);}(_0xe706,0xa3));var _0x6e70=function(_0x1c190c,_0x48125d){_0x1c190c=_0x1c190c-0x0;var _0x4fda82=_0xe706[_0x1c190c];return _0x4fda82;};'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 75afd8e..c001918 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 _0x647a=['The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','merge','Tags','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','remoteUri','count','Agent\x20found!','find','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','then','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','%s:%s','password','authType','token','%s/token:%s','Basic\x20%s','toString','base64','defaults','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x541ac7,_0x21c8f){var _0x29b484=function(_0x44988d){while(--_0x44988d){_0x541ac7['push'](_0x541ac7['shift']());}};_0x29b484(++_0x21c8f);}(_0x647a,0x8c));var _0xa647=function(_0x2782b1,_0x1f93f4){_0x2782b1=_0x2782b1-0x0;var _0x98e50a=_0x647a[_0x2782b1];return _0x98e50a;};'use strict';var _=require(_0xa647('0x0'));var rp=require(_0xa647('0x1'));var md5=require(_0xa647('0x2'));var util=require(_0xa647('0x3'));var Redis=require(_0xa647('0x4'));var intUtil=require(_0xa647('0x5'));var config=require(_0xa647('0x6'));var logger=require(_0xa647('0x7'))(_0xa647('0x8'));config[_0xa647('0x9')]=_['defaults'](config[_0xa647('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa647('0xa'))(new Redis(config[_0xa647('0x9')]));function emit(_0x436752,_0x50f6e5,_0x42fce9){io['to'](_0x436752)[_0xa647('0xb')](_0x50f6e5,_0x42fce9);}var headers={'Content-Type':_0xa647('0xc'),'Accept':_0xa647('0xc')};function getTicket(_0x192d08,_0x11b017,_0x574298,_0x4e4232,_0x5e0e14){logger[_0xa647('0xd')](_0xa647('0xe'));return request({'uri':util['format']('%s/tickets.json',_0x192d08['remoteUri']),'method':'POST','body':{'ticket':_[_0xa647('0xf')]({'requester_id':_0x574298['id'],'submitter_id':_0x11b017?_0x11b017['id']:undefined,'assignee_id':_0x11b017?_0x11b017['id']:undefined,'tags':getTags(_0x4e4232[_0xa647('0x10')],'name'),'subject':intUtil[_0xa647('0x11')](_0x4e4232['Subjects'],_0x5e0e14,'\x20'),'description':intUtil['getString'](_0x4e4232[_0xa647('0x12')],_0x5e0e14,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa647('0x11')](_0x4e4232['Descriptions'],_0x5e0e14,'\x0a')}},getCustomFields(_0x4e4232[_0xa647('0x13')],_0x5e0e14))}})['then'](function(_0x51d23c){logger[_0xa647('0xd')](_0xa647('0x14'));return _0x51d23c[_0xa647('0x15')];});}function getUser(_0x3177c9,_0x33caed){if(intUtil[_0xa647('0x16')](_0x33caed)){logger['info']('Getting\x20agent\x20with\x20email',_0x33caed);return request({'uri':util['format']('%s/search.json',_0x3177c9[_0xa647('0x17')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x33caed)}})['then'](function(_0x14c520){if(_0x14c520[_0xa647('0x18')]){logger[_0xa647('0xd')](_0xa647('0x19'));return _[_0xa647('0x1a')](_0x14c520[_0xa647('0x1b')],{'email':_0x33caed,'role':_0xa647('0x1c')});}else{logger[_0xa647('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3177c9[_0xa647('0x17')])})['then'](function(_0x1642e7){logger[_0xa647('0xd')]('Admin\x20account\x20selected.');return _0x1642e7[_0xa647('0x1d')];});}});}else{logger['info'](_0xa647('0x1e'));return request({'uri':util[_0xa647('0x1f')](_0xa647('0x20'),_0x3177c9[_0xa647('0x17')])})['then'](function(_0x4d40b7){logger[_0xa647('0xd')](_0xa647('0x21'));return _0x4d40b7[_0xa647('0x1d')];});}}function getEndUser(_0x31643a,_0x5c166a,_0x35db20){logger[_0xa647('0xd')]('Searching\x20enduser\x20with\x20phone',_0x35db20);return request({'uri':util['format'](_0xa647('0x22'),_0x31643a[_0xa647('0x17')]),'qs':{'query':util[_0xa647('0x1f')](_0xa647('0x23'),_0x35db20)}})[_0xa647('0x24')](function(_0x1b3223){var _0x1341ff;if(_0x1b3223[_0xa647('0x1b')][_0xa647('0x25')]){_0x1b3223[_0xa647('0x1b')]=_[_0xa647('0x26')](_0x1b3223[_0xa647('0x1b')],{'suspended':![],'role':_0xa647('0x27')});if(_0x1b3223['results']['length']){_0x1341ff=_[_0xa647('0x28')](_0x1b3223[_0xa647('0x1b')]);}}if(_0x1341ff){logger[_0xa647('0xd')](_0xa647('0x29'));return _0x1341ff;}else{logger[_0xa647('0xd')](_0xa647('0x2a'));return request({'uri':util[_0xa647('0x1f')](_0xa647('0x2b'),_0x31643a[_0xa647('0x17')]),'method':_0xa647('0x2c'),'body':{'user':{'role':_0xa647('0x27'),'name':util[_0xa647('0x1f')]('Caller\x20-\x20%s',_0x5c166a||_0x35db20),'phone':_0x35db20}}})[_0xa647('0x24')](function(_0x2a9766){logger[_0xa647('0xd')]('Enduser\x20created.');return _0x2a9766[_0xa647('0x1d')];});}});}function getAuth(_0x32e40f){var _0x48be66;if(_0x32e40f['authType']==='password'){_0x48be66=util[_0xa647('0x1f')](_0xa647('0x2d'),_0x32e40f['username'],_0x32e40f[_0xa647('0x2e')]);}else if(_0x32e40f[_0xa647('0x2f')]===_0xa647('0x30')){_0x48be66=util['format'](_0xa647('0x31'),_0x32e40f['username'],_0x32e40f[_0xa647('0x30')]);}return util[_0xa647('0x1f')](_0xa647('0x32'),new Buffer(_0x48be66)[_0xa647('0x33')](_0xa647('0x34')));}function request(_0x2ad8e4){logger['debug']('[HTTP]',JSON['stringify'](_0x2ad8e4));return rp(_[_0xa647('0x35')](_0x2ad8e4,{'method':_0xa647('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x2a67db,_0x2b0430){var _0x3e8e7d=[];if(_0x2a67db&&_0x2a67db[_0xa647('0x25')]>0x0){_0x3e8e7d=_[_0xa647('0x37')](_0x2a67db,_0x2b0430);}return _0x3e8e7d;}function getCustomFields(_0x348ac6,_0x135630){var _0x32051f=[];var _0x3b7a88={'custom_fields':[]};if(_0x348ac6['length']>0x0){_[_0xa647('0x38')](_0x348ac6,function(_0x33809f){if(_[_0xa647('0x39')]([_0xa647('0x3a'),_0xa647('0x3b')],_0x33809f['type'])&&_0x33809f[_0xa647('0x3c')]&&!_0x33809f[_0xa647('0x3d')]){_0x3b7a88[_0x33809f[_0xa647('0x3c')][_0xa647('0x3e')]()]=_0x33809f[_0xa647('0x3f')][_0xa647('0x33')]();}else if(_[_0xa647('0x39')]([_0xa647('0x3a'),'picklist'],_0x33809f[_0xa647('0x40')])&&_0x33809f[_0xa647('0x41')]&&_0x33809f['customField']){_0x3b7a88[_0xa647('0x42')][_0xa647('0x43')]({'id':_0x33809f[_0xa647('0x41')],'value':_0x33809f[_0xa647('0x3f')][_0xa647('0x33')]()});}else if(_0x33809f[_0xa647('0x40')]===_0xa647('0x44')&&_0x33809f['variableName']&&_0x33809f[_0xa647('0x41')]&&_0x33809f[_0xa647('0x3d')]){_0x135630[_0x33809f[_0xa647('0x45')]]&&_0x3b7a88[_0xa647('0x42')][_0xa647('0x43')]({'id':_0x33809f[_0xa647('0x41')],'value':_0x135630[_0x33809f[_0xa647('0x45')]]['toString']()});}else if(_0x33809f[_0xa647('0x40')]==='customVariable'&&_0x33809f[_0xa647('0x46')]&&_0x33809f[_0xa647('0x46')][_0xa647('0x47')]&&_0x33809f[_0xa647('0x41')]&&_0x33809f[_0xa647('0x3d')]){_0x135630[_0x33809f['Variable'][_0xa647('0x47')]['toLowerCase']()]&&_0x3b7a88[_0xa647('0x42')][_0xa647('0x43')]({'id':_0x33809f['idField'],'value':_0x135630[_0x33809f[_0xa647('0x46')][_0xa647('0x47')][_0xa647('0x3e')]()][_0xa647('0x33')]()});}});}return _0x3b7a88;}exports[_0xa647('0x48')]=function(_0x58fedc,_0x19b310,_0x51d029,_0x2c2d37,_0x848e76,_0x3bc899){var _0x3af231,_0x1910f5;_0x3bc899[_0xa647('0x17')]=intUtil[_0xa647('0x49')](_0x3bc899[_0xa647('0x17')]);_0x3bc899[_0xa647('0x4a')]=intUtil[_0xa647('0x49')](_0x3bc899['serverUrl']);if(_0x848e76&&_0x848e76['monitor_format']){logger['info']('[QUEUE]',_0xa647('0x4b'));_0x19b310[_0xa647('0x4c')]=util[_0xa647('0x1f')](_0xa647('0x4d'),_0x3bc899['serverUrl'],_0x19b310['uniqueid'],md5(_0x19b310[_0xa647('0x4e')]));}else{_0x19b310[_0xa647('0x4c')]='';}headers[_0xa647('0x4f')]=getAuth(_0x3bc899);return getUser(_0x3bc899,_0x2c2d37['email'])[_0xa647('0x24')](function(_0x3bbc25){_0x3af231=_0x3bbc25;logger[_0xa647('0xd')](_0xa647('0x50'),_0x3af231['id']);return getEndUser(_0x3bc899,_0x19b310[_0xa647('0x51')],_0x19b310[_0xa647('0x52')]);})['then'](function(_0x3378f7){_0x1910f5=_0x3378f7;logger['info'](_0xa647('0x53'),_0x1910f5['id']);return getTicket(_0x3bc899,_0x3af231,_0x1910f5,_0x51d029,_0x19b310);})['then'](function(_0x23b17d){if(_0x23b17d){logger['info'](_0xa647('0x54'),_0x23b17d['id']);switch(_0x3bc899[_0xa647('0x40')]){case _0xa647('0x55'):logger['info'](_0xa647('0x56'),_0xa647('0x57'));return request({'uri':util[_0xa647('0x1f')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3bc899[_0xa647('0x17')],_0x3af231['id'],_0x23b17d['id']),'method':_0xa647('0x2c')});case _0xa647('0x58'):logger['info'](_0xa647('0x56'),_0xa647('0x59'));emit(util['format']('user:%s',_0x2c2d37['name']),_0xa647('0x5a'),{'uri':util[_0xa647('0x1f')]('%s/agent/tickets/%s',_0x3bc899[_0xa647('0x17')][_0xa647('0x5b')](_0xa647('0x5c'),''),_0x23b17d['id'])});break;default:logger[_0xa647('0x5d')](_0xa647('0x56'),_0xa647('0x5e'));}}})[_0xa647('0x5f')](function(_0x349b0b){logger[_0xa647('0x5d')](_0xa647('0x60'),util[_0xa647('0x61')](_0x349b0b,{'showHidden':!![],'depth':null}));});};exports[_0xa647('0x62')]=function(_0x331d2e,_0x63c9f0,_0x38c116,_0x30db06,_0x28a3e2,_0x15e862,_0x5792ad){var _0xeb9ba3,_0x2417cb;_0x15e862[_0xa647('0x17')]=intUtil[_0xa647('0x49')](_0x15e862['remoteUri']);_0x15e862[_0xa647('0x4a')]=intUtil[_0xa647('0x49')](_0x15e862['serverUrl']);if(_0x5792ad&&_0x5792ad[_0xa647('0x63')]&&_0x5792ad[_0xa647('0x63')]!=='none'){logger['info'](_0xa647('0x64'),_0xa647('0x4b'));_0x63c9f0['recordingURL']=util['format'](_0xa647('0x4d'),_0x15e862['serverUrl'],_0x63c9f0['uniqueid'],md5(_0x63c9f0[_0xa647('0x4e')]));}headers[_0xa647('0x4f')]=getAuth(_0x15e862);return getUser(_0x15e862,_0x30db06['email'])['then'](function(_0x59fa24){_0xeb9ba3=_0x59fa24;logger['info'](_0xa647('0x50'),_0xeb9ba3['id']);return getEndUser(_0x15e862,_0x63c9f0[_0xa647('0x65')],_0x63c9f0[_0xa647('0x66')]);})[_0xa647('0x24')](function(_0x59358c){_0x2417cb=_0x59358c;logger[_0xa647('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2417cb['id']);return getTicket(_0x15e862,_0xeb9ba3,_0x2417cb,_0x38c116,_0x63c9f0);})['then'](function(_0x1b84b5){if(_0x1b84b5){logger['info']('The\x20Ticket\x20ID\x20is:',_0x1b84b5['id']);switch(_0x15e862['type']){case'integrationTab':logger['info'](_0xa647('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa647('0x1f')](_0xa647('0x67'),_0x15e862[_0xa647('0x17')],_0xeb9ba3['id'],_0x1b84b5['id']),'method':_0xa647('0x2c')});case _0xa647('0x58'):logger[_0xa647('0xd')]('[OUTBOUND]',_0xa647('0x59'));emit(util[_0xa647('0x1f')](_0xa647('0x68'),_0x30db06[_0xa647('0x47')]),_0xa647('0x5a'),{'uri':util[_0xa647('0x1f')](_0xa647('0x69'),_0x15e862[_0xa647('0x17')][_0xa647('0x5b')](_0xa647('0x5c'),''),_0x1b84b5['id'])});break;default:logger[_0xa647('0x5d')](_0xa647('0x64'),_0xa647('0x5e'));}}})['catch'](function(_0x3644ee){logger['error'](_0xa647('0x6a'),util[_0xa647('0x61')](_0x3644ee,{'showHidden':!![],'depth':null}));});};exports[_0xa647('0x6b')]=function(_0x3125ca,_0xe0b9ab,_0x453ce0,_0x5558e6,_0x1fea7b,_0x4157e4){var _0x1c794e,_0x319dc9;_0x4157e4[_0xa647('0x17')]=intUtil[_0xa647('0x49')](_0x4157e4[_0xa647('0x17')]);_0x4157e4['serverUrl']=intUtil[_0xa647('0x49')](_0x4157e4[_0xa647('0x4a')]);if(_0x1fea7b&&_0x1fea7b[_0xa647('0x6c')]){logger[_0xa647('0xd')]('['+_0xe0b9ab[_0xa647('0x6d')][_0xa647('0x6e')]()+']',_0xa647('0x4b'));_0xe0b9ab[_0xa647('0x4c')]=util[_0xa647('0x1f')](_0xa647('0x4d'),_0x4157e4[_0xa647('0x4a')],_0xe0b9ab[_0xa647('0x4e')],md5(_0xe0b9ab[_0xa647('0x4e')]));}else{_0xe0b9ab[_0xa647('0x4c')]='';}headers[_0xa647('0x4f')]=getAuth(_0x4157e4);return getUser(_0x4157e4)[_0xa647('0x24')](function(_0x1745a2){_0x1c794e=_0x1745a2;logger[_0xa647('0xd')](_0xa647('0x50'),_0x1c794e['id']);return getEndUser(_0x4157e4,_0xe0b9ab[_0xa647('0x51')],_0xe0b9ab['calleridnum']);})['then'](function(_0xce5d04){_0x319dc9=_0xce5d04;logger[_0xa647('0xd')](_0xa647('0x53'),_0x319dc9['id']);return getTicket(_0x4157e4,_0x1c794e,_0x319dc9,_0x453ce0,_0xe0b9ab);})[_0xa647('0x24')](function(_0x542032){if(_0x542032){logger[_0xa647('0xd')]('The\x20Ticket\x20ID\x20is:',_0x542032['id']);}})[_0xa647('0x5f')](function(_0x3fc004){logger[_0xa647('0x5d')]('['+_0xe0b9ab[_0xa647('0x6d')][_0xa647('0x6e')]()+']'+_0xa647('0x6f'),util['inspect'](_0x3fc004,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5a96=['customField','content','picklist','idField','push','type','variable','variableName','custom_fields','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\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','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','inspect','calleridname','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','map','includes','string','nameField'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x5a96,0xa1));var _0x65a9=function(_0x3a1ed6,_0x2184cd){_0x3a1ed6=_0x3a1ed6-0x0;var _0x28480b=_0x5a96[_0x3a1ed6];return _0x28480b;};'use strict';var _=require(_0x65a9('0x0'));var rp=require('request-promise');var md5=require(_0x65a9('0x1'));var util=require(_0x65a9('0x2'));var Redis=require(_0x65a9('0x3'));var intUtil=require(_0x65a9('0x4'));var config=require(_0x65a9('0x5'));var logger=require('../../../../config/logger')('zendesk');config['redis']=_[_0x65a9('0x6')](config[_0x65a9('0x7')],{'host':_0x65a9('0x8'),'port':0x18eb});var io=require(_0x65a9('0x9'))(new Redis(config['redis']));function emit(_0x20bee3,_0x42cb78,_0x518d9d){io['to'](_0x20bee3)[_0x65a9('0xa')](_0x42cb78,_0x518d9d);}var headers={'Content-Type':'application/json','Accept':_0x65a9('0xb')};function getTicket(_0x54d920,_0x3ee529,_0x594f99,_0x3147ab,_0xb01e2f){logger[_0x65a9('0xc')](_0x65a9('0xd'));return request({'uri':util[_0x65a9('0xe')]('%s/tickets.json',_0x54d920[_0x65a9('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x594f99['id'],'submitter_id':_0x3ee529?_0x3ee529['id']:undefined,'assignee_id':_0x3ee529?_0x3ee529['id']:undefined,'tags':getTags(_0x3147ab[_0x65a9('0x10')],_0x65a9('0x11')),'subject':intUtil[_0x65a9('0x12')](_0x3147ab[_0x65a9('0x13')],_0xb01e2f,'\x20'),'description':intUtil[_0x65a9('0x12')](_0x3147ab[_0x65a9('0x14')],_0xb01e2f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x65a9('0x12')](_0x3147ab['Descriptions'],_0xb01e2f,'\x0a')}},getCustomFields(_0x3147ab[_0x65a9('0x15')],_0xb01e2f))}})[_0x65a9('0x16')](function(_0x4ad09a){logger[_0x65a9('0xc')](_0x65a9('0x17'));return _0x4ad09a[_0x65a9('0x18')];});}function getUser(_0x3c49ae,_0xd07c17){if(intUtil[_0x65a9('0x19')](_0xd07c17)){logger[_0x65a9('0xc')](_0x65a9('0x1a'),_0xd07c17);return request({'uri':util[_0x65a9('0xe')](_0x65a9('0x1b'),_0x3c49ae['remoteUri']),'qs':{'query':util[_0x65a9('0xe')](_0x65a9('0x1c'),_0xd07c17)}})[_0x65a9('0x16')](function(_0x1be6ba){if(_0x1be6ba[_0x65a9('0x1d')]){logger['info'](_0x65a9('0x1e'));return _[_0x65a9('0x1f')](_0x1be6ba[_0x65a9('0x20')],{'email':_0xd07c17,'role':_0x65a9('0x21')});}else{logger[_0x65a9('0xc')](_0x65a9('0x22'));return request({'uri':util[_0x65a9('0xe')](_0x65a9('0x23'),_0x3c49ae[_0x65a9('0xf')])})['then'](function(_0xb88cb6){logger[_0x65a9('0xc')](_0x65a9('0x24'));return _0xb88cb6[_0x65a9('0x25')];});}});}else{logger[_0x65a9('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3c49ae['remoteUri'])})['then'](function(_0x3c2eb0){logger[_0x65a9('0xc')](_0x65a9('0x24'));return _0x3c2eb0['user'];});}}function getEndUser(_0x298510,_0x35f421,_0x3b326b){logger['info'](_0x65a9('0x26'),_0x3b326b);return request({'uri':util['format'](_0x65a9('0x1b'),_0x298510[_0x65a9('0xf')]),'qs':{'query':util['format'](_0x65a9('0x27'),_0x3b326b)}})[_0x65a9('0x16')](function(_0x25d517){var _0x1152ea;if(_0x25d517[_0x65a9('0x20')][_0x65a9('0x28')]){_0x25d517[_0x65a9('0x20')]=_['filter'](_0x25d517[_0x65a9('0x20')],{'suspended':![],'role':_0x65a9('0x29')});if(_0x25d517[_0x65a9('0x20')][_0x65a9('0x28')]){_0x1152ea=_[_0x65a9('0x2a')](_0x25d517['results']);}}if(_0x1152ea){logger[_0x65a9('0xc')](_0x65a9('0x2b'));return _0x1152ea;}else{logger['info'](_0x65a9('0x2c'));return request({'uri':util['format'](_0x65a9('0x2d'),_0x298510[_0x65a9('0xf')]),'method':_0x65a9('0x2e'),'body':{'user':{'role':_0x65a9('0x29'),'name':util[_0x65a9('0xe')](_0x65a9('0x2f'),_0x35f421||_0x3b326b),'phone':_0x3b326b}}})['then'](function(_0x4fb3c4){logger['info'](_0x65a9('0x30'));return _0x4fb3c4[_0x65a9('0x25')];});}});}function getAuth(_0x4e1efe){var _0x49d408;if(_0x4e1efe[_0x65a9('0x31')]==='password'){_0x49d408=util[_0x65a9('0xe')](_0x65a9('0x32'),_0x4e1efe[_0x65a9('0x33')],_0x4e1efe['password']);}else if(_0x4e1efe[_0x65a9('0x31')]===_0x65a9('0x34')){_0x49d408=util['format'](_0x65a9('0x35'),_0x4e1efe[_0x65a9('0x33')],_0x4e1efe[_0x65a9('0x34')]);}return util['format'](_0x65a9('0x36'),new Buffer(_0x49d408)[_0x65a9('0x37')]('base64'));}function request(_0x1f049a){logger[_0x65a9('0x38')](_0x65a9('0x39'),JSON[_0x65a9('0x3a')](_0x1f049a));return rp(_[_0x65a9('0x6')](_0x1f049a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3e7fc3,_0x107f0f){var _0x5934fc=[];if(_0x3e7fc3&&_0x3e7fc3[_0x65a9('0x28')]>0x0){_0x5934fc=_[_0x65a9('0x3b')](_0x3e7fc3,_0x107f0f);}return _0x5934fc;}function getCustomFields(_0xf2e969,_0x3ea51c){var _0x2b4667=[];var _0x3003e1={'custom_fields':[]};if(_0xf2e969[_0x65a9('0x28')]>0x0){_['forEach'](_0xf2e969,function(_0x3ce1f1){if(_[_0x65a9('0x3c')]([_0x65a9('0x3d'),'picklist'],_0x3ce1f1['type'])&&_0x3ce1f1[_0x65a9('0x3e')]&&!_0x3ce1f1[_0x65a9('0x3f')]){_0x3003e1[_0x3ce1f1[_0x65a9('0x3e')]['toLowerCase']()]=_0x3ce1f1[_0x65a9('0x40')][_0x65a9('0x37')]();}else if(_[_0x65a9('0x3c')]([_0x65a9('0x3d'),_0x65a9('0x41')],_0x3ce1f1['type'])&&_0x3ce1f1[_0x65a9('0x42')]&&_0x3ce1f1[_0x65a9('0x3f')]){_0x3003e1['custom_fields'][_0x65a9('0x43')]({'id':_0x3ce1f1[_0x65a9('0x42')],'value':_0x3ce1f1[_0x65a9('0x40')]['toString']()});}else if(_0x3ce1f1[_0x65a9('0x44')]===_0x65a9('0x45')&&_0x3ce1f1[_0x65a9('0x46')]&&_0x3ce1f1['idField']&&_0x3ce1f1[_0x65a9('0x3f')]){_0x3ea51c[_0x3ce1f1[_0x65a9('0x46')]]&&_0x3003e1[_0x65a9('0x47')][_0x65a9('0x43')]({'id':_0x3ce1f1['idField'],'value':_0x3ea51c[_0x3ce1f1[_0x65a9('0x46')]][_0x65a9('0x37')]()});}else if(_0x3ce1f1[_0x65a9('0x44')]===_0x65a9('0x48')&&_0x3ce1f1['Variable']&&_0x3ce1f1[_0x65a9('0x49')][_0x65a9('0x11')]&&_0x3ce1f1[_0x65a9('0x42')]&&_0x3ce1f1[_0x65a9('0x3f')]){_0x3ea51c[_0x3ce1f1[_0x65a9('0x49')][_0x65a9('0x11')][_0x65a9('0x4a')]()]&&_0x3003e1[_0x65a9('0x47')][_0x65a9('0x43')]({'id':_0x3ce1f1[_0x65a9('0x42')],'value':_0x3ea51c[_0x3ce1f1['Variable'][_0x65a9('0x11')][_0x65a9('0x4a')]()][_0x65a9('0x37')]()});}});}return _0x3003e1;}exports[_0x65a9('0x4b')]=function(_0x27ffbc,_0x4b7f02,_0xf508af,_0x1bec0e,_0x384fab,_0xb01f58){var _0x3a030f,_0x17f4a7;_0xb01f58[_0x65a9('0xf')]=intUtil[_0x65a9('0x4c')](_0xb01f58[_0x65a9('0xf')]);_0xb01f58[_0x65a9('0x4d')]=intUtil[_0x65a9('0x4c')](_0xb01f58[_0x65a9('0x4d')]);if(_0x384fab&&_0x384fab[_0x65a9('0x4e')]){logger[_0x65a9('0xc')](_0x65a9('0x4f'),_0x65a9('0x50'));_0x4b7f02[_0x65a9('0x51')]=util[_0x65a9('0xe')](_0x65a9('0x52'),_0xb01f58[_0x65a9('0x4d')],_0x4b7f02[_0x65a9('0x53')],md5(_0x4b7f02['uniqueid']));}else{_0x4b7f02[_0x65a9('0x51')]='';}headers[_0x65a9('0x54')]=getAuth(_0xb01f58);return getUser(_0xb01f58,_0x1bec0e['email'])[_0x65a9('0x16')](function(_0x24f4f8){_0x3a030f=_0x24f4f8;logger[_0x65a9('0xc')](_0x65a9('0x55'),_0x3a030f['id']);return getEndUser(_0xb01f58,_0x4b7f02['calleridname'],_0x4b7f02['calleridnum']);})['then'](function(_0x176950){_0x17f4a7=_0x176950;logger['info']('The\x20Enduser\x20ID\x20is:',_0x17f4a7['id']);return getTicket(_0xb01f58,_0x3a030f,_0x17f4a7,_0xf508af,_0x4b7f02);})[_0x65a9('0x16')](function(_0x1426ff){if(_0x1426ff){logger[_0x65a9('0xc')](_0x65a9('0x56'),_0x1426ff['id']);switch(_0xb01f58[_0x65a9('0x44')]){case _0x65a9('0x57'):logger[_0x65a9('0xc')]('[QUEUE]',_0x65a9('0x58'));return request({'uri':util[_0x65a9('0xe')](_0x65a9('0x59'),_0xb01f58[_0x65a9('0xf')],_0x3a030f['id'],_0x1426ff['id']),'method':_0x65a9('0x2e')});case _0x65a9('0x5a'):logger[_0x65a9('0xc')](_0x65a9('0x4f'),_0x65a9('0x5b'));emit(util[_0x65a9('0xe')](_0x65a9('0x5c'),_0x1bec0e[_0x65a9('0x11')]),_0x65a9('0x5d'),{'uri':util[_0x65a9('0xe')](_0x65a9('0x5e'),_0xb01f58['remoteUri'][_0x65a9('0x5f')](_0x65a9('0x60'),''),_0x1426ff['id'])});break;default:logger[_0x65a9('0x61')](_0x65a9('0x4f'),_0x65a9('0x62'));}}})[_0x65a9('0x63')](function(_0x4955d4){logger[_0x65a9('0x61')](_0x65a9('0x64'),util['inspect'](_0x4955d4,{'showHidden':!![],'depth':null}));});};exports[_0x65a9('0x65')]=function(_0x13b6f7,_0x3cfd98,_0x36a9d9,_0x19037d,_0x2f9d0b,_0x4b4545,_0x45c04f){var _0x5595e7,_0x47e796;_0x4b4545[_0x65a9('0xf')]=intUtil[_0x65a9('0x4c')](_0x4b4545[_0x65a9('0xf')]);_0x4b4545['serverUrl']=intUtil[_0x65a9('0x4c')](_0x4b4545[_0x65a9('0x4d')]);if(_0x45c04f&&_0x45c04f['recordingFormat']&&_0x45c04f['recordingFormat']!==_0x65a9('0x66')){logger[_0x65a9('0xc')](_0x65a9('0x67'),_0x65a9('0x50'));_0x3cfd98[_0x65a9('0x51')]=util[_0x65a9('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b4545[_0x65a9('0x4d')],_0x3cfd98[_0x65a9('0x53')],md5(_0x3cfd98[_0x65a9('0x53')]));}headers[_0x65a9('0x54')]=getAuth(_0x4b4545);return getUser(_0x4b4545,_0x19037d[_0x65a9('0x68')])[_0x65a9('0x16')](function(_0x141530){_0x5595e7=_0x141530;logger[_0x65a9('0xc')]('The\x20User\x20ID\x20is:',_0x5595e7['id']);return getEndUser(_0x4b4545,_0x3cfd98[_0x65a9('0x69')],_0x3cfd98[_0x65a9('0x6a')]);})['then'](function(_0x479ab9){_0x47e796=_0x479ab9;logger[_0x65a9('0xc')](_0x65a9('0x6b'),_0x47e796['id']);return getTicket(_0x4b4545,_0x5595e7,_0x47e796,_0x36a9d9,_0x3cfd98);})[_0x65a9('0x16')](function(_0x11590a){if(_0x11590a){logger['info'](_0x65a9('0x56'),_0x11590a['id']);switch(_0x4b4545[_0x65a9('0x44')]){case _0x65a9('0x57'):logger[_0x65a9('0xc')](_0x65a9('0x67'),_0x65a9('0x58'));return request({'uri':util[_0x65a9('0xe')](_0x65a9('0x59'),_0x4b4545['remoteUri'],_0x5595e7['id'],_0x11590a['id']),'method':_0x65a9('0x2e')});case _0x65a9('0x5a'):logger['info'](_0x65a9('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x65a9('0xe')]('user:%s',_0x19037d[_0x65a9('0x11')]),_0x65a9('0x5d'),{'uri':util[_0x65a9('0xe')](_0x65a9('0x5e'),_0x4b4545['remoteUri'][_0x65a9('0x5f')](_0x65a9('0x60'),''),_0x11590a['id'])});break;default:logger['error'](_0x65a9('0x67'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x65a9('0x63')](function(_0x3f0b6d){logger[_0x65a9('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x65a9('0x6c')](_0x3f0b6d,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3caf45,_0x2da80d,_0x24abc3,_0x22eb8d,_0x35cea,_0x4b61e0){var _0x3df158,_0x37ae1e;_0x4b61e0[_0x65a9('0xf')]=intUtil[_0x65a9('0x4c')](_0x4b61e0[_0x65a9('0xf')]);_0x4b61e0[_0x65a9('0x4d')]=intUtil['stripTrailingSlash'](_0x4b61e0['serverUrl']);if(_0x35cea&&_0x35cea[_0x65a9('0x4e')]){logger[_0x65a9('0xc')]('['+_0x2da80d['lastevent']['toUpperCase']()+']',_0x65a9('0x50'));_0x2da80d[_0x65a9('0x51')]=util[_0x65a9('0xe')](_0x65a9('0x52'),_0x4b61e0[_0x65a9('0x4d')],_0x2da80d[_0x65a9('0x53')],md5(_0x2da80d['uniqueid']));}else{_0x2da80d[_0x65a9('0x51')]='';}headers['Authorization']=getAuth(_0x4b61e0);return getUser(_0x4b61e0)['then'](function(_0x519d26){_0x3df158=_0x519d26;logger[_0x65a9('0xc')](_0x65a9('0x55'),_0x3df158['id']);return getEndUser(_0x4b61e0,_0x2da80d[_0x65a9('0x6d')],_0x2da80d['calleridnum']);})['then'](function(_0x56116a){_0x37ae1e=_0x56116a;logger['info'](_0x65a9('0x6b'),_0x37ae1e['id']);return getTicket(_0x4b61e0,_0x3df158,_0x37ae1e,_0x24abc3,_0x2da80d);})[_0x65a9('0x16')](function(_0x588985){if(_0x588985){logger['info']('The\x20Ticket\x20ID\x20is:',_0x588985['id']);}})[_0x65a9('0x63')](function(_0x35a981){logger[_0x65a9('0x61')]('['+_0x2da80d[_0x65a9('0x6e')]['toUpperCase']()+']'+_0x65a9('0x6f'),util[_0x65a9('0x6c')](_0x35a981,{'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 4d1af6a..b48debc 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 _0x1df5=['https://www.zohoapis.','/crm/v2/','startCase','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','role','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','format','answertime','endtime','diff','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','Call\x20created!','err','stack','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','none','[OUTBOUND]','Recording\x20is\x20enabled!','com','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x1df5,0xfd));var _0x51df=function(_0x214479,_0x1f964d){_0x214479=_0x214479-0x0;var _0x290d2f=_0x1df5[_0x214479];return _0x290d2f;};'use strict';var _=require(_0x51df('0x0'));var rp=require(_0x51df('0x1'));var md5=require(_0x51df('0x2'));var util=require(_0x51df('0x3'));var intUtil=require(_0x51df('0x4'));var moment=require('moment');var Redis=require(_0x51df('0x5'));var BPromise=require(_0x51df('0x6'));var config=require(_0x51df('0x7'));var logger=require(_0x51df('0x8'))(_0x51df('0x9'));config[_0x51df('0xa')]=_[_0x51df('0xb')](config[_0x51df('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x51df('0xc'))(new Redis(config['redis']));function emit(_0x42a74a,_0x3e7952,_0x8dbf50){io['to'](_0x42a74a)[_0x51df('0xd')](_0x3e7952,_0x8dbf50);}function request(_0x7e1410){logger[_0x51df('0xe')](_0x51df('0xf'),JSON[_0x51df('0x10')](_0x7e1410));return rp(_0x7e1410);}function getCustomFields(_0x5f0736,_0x3b2224){var _0xf92e25={};if(_0x5f0736[_0x51df('0x11')]>0x0){_[_0x51df('0x12')](_0x5f0736,function(_0x4540f5){if(_[_0x51df('0x13')]([_0x51df('0x14'),_0x51df('0x15')],_0x4540f5[_0x51df('0x16')])&&_0x4540f5[_0x51df('0x17')]){_0xf92e25[_0x4540f5[_0x51df('0x17')]]=_0x4540f5[_0x51df('0x18')][_0x51df('0x19')]();}else if(_0x4540f5[_0x51df('0x16')]===_0x51df('0x1a')&&_0x4540f5['variableName']&&_0x4540f5[_0x51df('0x17')]&&_0x3b2224[_0x4540f5[_0x51df('0x1b')]]){_0xf92e25[_0x4540f5['idField']]=_0x3b2224[_0x4540f5[_0x51df('0x1b')]][_0x51df('0x19')]();}else if(_0x4540f5[_0x51df('0x16')]==='customVariable'&&_0x4540f5[_0x51df('0x1c')]&&_0x4540f5[_0x51df('0x1c')][_0x51df('0x1d')]&&_0x4540f5[_0x51df('0x17')]&&_0x3b2224[_0x4540f5['Variable'][_0x51df('0x1d')][_0x51df('0x1e')]()]){_0xf92e25[_0x4540f5[_0x51df('0x17')]]=_0x3b2224[_0x4540f5['Variable'][_0x51df('0x1d')]['toLowerCase']()][_0x51df('0x19')]();}});}return _0xf92e25;}function getName(_0x466dad){if(_0x466dad[_0x51df('0x1f')]('\x20')>0x0){var _0x23d4e0=_0x466dad['split'](/ (.+)/);if(_0x23d4e0[0x1]){return _0x23d4e0;}}return[_0x466dad,_0x466dad];}var accountsTokens={};function getAccessToken(_0xfba51f){return new Promise(function(_0xdf7fa4,_0x4bf535){if(!_[_0x51df('0x20')](accountsTokens[_0xfba51f['id']])&&!_['isNil'](accountsTokens[_0xfba51f['id']][_0x51df('0x21')])){if(moment()['isBefore'](accountsTokens[_0xfba51f['id']]['expires_in'])){_0xdf7fa4(accountsTokens[_0xfba51f['id']][_0x51df('0x21')]);}}var _0x366e6f;switch(_0xfba51f[_0x51df('0x22')]){case'US':_0x366e6f=_0x51df('0x23');break;case'AU':_0x366e6f=_0x51df('0x24');break;case'EU':_0x366e6f=_0x51df('0x25');break;case'IN':_0x366e6f=_0x51df('0x26');break;case'CN':_0x366e6f=_0x51df('0x27');break;default:_0x366e6f=_0x51df('0x25');break;}var _0x40b6c7={'method':_0x51df('0x28'),'uri':_0x366e6f+_0x51df('0x29'),'qs':{'refresh_token':_0xfba51f[_0x51df('0x2a')],'client_id':_0xfba51f[_0x51df('0x2b')],'client_secret':_0xfba51f[_0x51df('0x2c')],'grant_type':_0x51df('0x2d')},'json':!![]};return rp(_0x40b6c7)[_0x51df('0x2e')](function(_0x417942){accountsTokens[_0xfba51f['id']]={'access_token':_0x417942[_0x51df('0x21')],'expires_in':moment()[_0x51df('0x2f')](_0x417942['expires_in'],'seconds')};_0xdf7fa4(_0x417942[_0x51df('0x21')]);})[_0x51df('0x30')](function(_0x1c961c){logger[_0x51df('0x31')](_0x51df('0x32'),_0x1c961c['stack']);_0x4bf535(_0x1c961c);});});}function getUser(_0x4bf243,_0x42f85c,_0x35e7da,_0x442bb5){logger[_0x51df('0x33')](_0x51df('0x34'));return request({'method':_0x51df('0x35'),'uri':util['format'](_0x51df('0x36'),_0x42f85c),'qs':{'type':_0x51df('0x37')},'headers':{'Authorization':_0x51df('0x38')+_0x4bf243},'json':!![]})[_0x51df('0x2e')](function(_0x3a391c){if(_0x3a391c[_0x51df('0x39')]){var _0x6b7cac=-0x1;if(_[_0x51df('0x3a')](_0x3a391c[_0x51df('0x39')])){if(!_['isNil'](_0x442bb5)){_0x6b7cac=_[_0x51df('0x3b')](_0x3a391c[_0x51df('0x39')],function(_0x2a0253){return _0x2a0253['email']===_0x442bb5;});}if(_0x6b7cac>=0x0){logger[_0x51df('0x33')](_0x51df('0x3c'));}else{logger['info'](_0x51df('0x3d'));_0x6b7cac=_['findIndex'](_0x3a391c['users'],function(_0x451bfe){return _0x451bfe[_0x51df('0x3e')]['name']===_0x51df('0x3f');});}return _0x3a391c[_0x51df('0x39')][_0x6b7cac];}else{if(_0x3a391c[_0x51df('0x40')]['profile'][_0x51df('0x1d')]===_0x51df('0x3f')){logger[_0x51df('0x33')](_0x51df('0x3d'));user=_0x3a391c[_0x51df('0x40')];return user;}else{logger[_0x51df('0x31')](_0x51df('0x41'),JSON[_0x51df('0x10')](_0x3a391c));throw new Error(_0x51df('0x42')+JSON['stringify'](_0x3a391c));}}}else{logger[_0x51df('0x31')](_0x51df('0x41'),JSON['stringify'](_0x3a391c));throw new Error(_0x51df('0x42')+JSON['stringify'](_0x3a391c));}})['catch'](function(_0xdf41af){console[_0x51df('0x31')](_0xdf41af);});}function getZohoUser(_0x1dc1b0,_0xeaf0c3){return new BPromise(function(_0x1d8364,_0x2d8fb9){request(_0x1dc1b0)[_0x51df('0x2e')](function(_0x1c2821){var _0x605ee5=null;if(_0x1c2821){_0x605ee5=_0x1c2821[_0x51df('0x43')][0x0];_0x605ee5[_0x51df('0x44')]=_0xeaf0c3;}_0x1d8364(_0x605ee5);})[_0x51df('0x30')](function(_0x2ac726){_0x2d8fb9(_0x2ac726);});});}function createEndUser(_0x31aade,_0x417ac0,_0x4299fc,_0x13ad6c,_0x3dcdf5,_0x16b225){var _0x4299fc=getName(_0x4299fc);return request({'method':_0x51df('0x28'),'uri':_0x51df('0x45')+_0x417ac0+_0x51df('0x46')+_[_0x51df('0x47')](_0x16b225['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4299fc[0x1],'First_Name':_0x4299fc[0x0],'Phone':_0x13ad6c,'Owner':{'name':!_[_0x51df('0x20')](_0x3dcdf5['role']['name'])?_0x3dcdf5['role'][_0x51df('0x1d')]:!_[_0x51df('0x20')](_0x3dcdf5[_0x51df('0x48')])?_0x3dcdf5[_0x51df('0x48')]+'\x20'+_0x3dcdf5[_0x51df('0x49')]:_0x3dcdf5[_0x51df('0x49')],'id':_0x3dcdf5['id']}}]},'headers':{'Authorization':_0x51df('0x38')+_0x31aade},'json':!![]})[_0x51df('0x2e')](function(_0x426e87){if(_0x426e87&&_0x426e87[_0x51df('0x43')][0x0][_0x51df('0x4a')]===_0x51df('0x4b')){var _0x3e3b70=_0x426e87[_0x51df('0x43')][0x0][_0x51df('0x4c')];_0x3e3b70[_0x51df('0x44')]=_[_0x51df('0x47')](_0x16b225[_0x51df('0x4d')])+'s';return _0x3e3b70;}logger[_0x51df('0x31')](_0x51df('0x41'),JSON[_0x51df('0x10')](data));throw new Error(_0x51df('0x4e')+JSON[_0x51df('0x10')](data));})['catch'](function(_0x45886a){console[_0x51df('0x4f')](_0x51df('0x50'),_0x45886a);});}function getEndUser(_0x3c65b6,_0x545b5f,_0x299270,_0x14a787,_0x448f6d,_0x2ace7d,_0x445005){var _0x2ccd61={'method':_0x51df('0x35'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3c65b6},'json':!![]};switch(_0x445005[_0x51df('0x51')]){case _0x51df('0x52'):_0x2ccd61[_0x51df('0x53')]=_0x51df('0x45')+_0x545b5f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x448f6d+'))';return getZohoUser(_0x2ccd61,'Contacts')[_0x51df('0x2e')](function(_0x13a4f8){if(_0x13a4f8)return _0x13a4f8;_0x2ccd61[_0x51df('0x53')]=_0x51df('0x45')+_0x545b5f+_0x51df('0x54')+_0x448f6d+'))';return getZohoUser(_0x2ccd61,_0x51df('0x55'))[_0x51df('0x2e')](function(_0x1a502a){if(_0x1a502a)return _0x1a502a;if(_0x445005['moduleCreate']!=_0x51df('0x56')){return createEndUser(_0x3c65b6,_0x545b5f,_0x14a787,_0x448f6d,_0x2ace7d,_0x445005);}else{return{};}});});break;case'contact':_0x2ccd61[_0x51df('0x53')]=_0x51df('0x45')+_0x545b5f+_0x51df('0x57')+_0x448f6d+'))';return getZohoUser(_0x2ccd61,'Contacts')['then'](function(_0x2625bb){if(_0x2625bb)return _0x2625bb;if(_0x445005[_0x51df('0x4d')]!=_0x51df('0x56')){return createEndUser(_0x3c65b6,_0x545b5f,_0x14a787,_0x448f6d,_0x2ace7d,_0x445005);}else{return{};}});break;case _0x51df('0x58'):_0x2ccd61['uri']='https://www.zohoapis.'+_0x545b5f+_0x51df('0x54')+_0x448f6d+'))';return getZohoUser(_0x2ccd61,_0x51df('0x55'))[_0x51df('0x2e')](function(_0x492eb0){if(_0x492eb0)return _0x492eb0;if(_0x445005['moduleCreate']!=_0x51df('0x56')){return createEndUser(_0x3c65b6,_0x545b5f,_0x14a787,_0x448f6d,_0x2ace7d,_0x445005);}else{return{};}});break;}}function getCall(_0x8bf2f3,_0x581a2a,_0x3918f1,_0x4caca6,_0x4501cf,_0x533d2c,_0x4d6eb0,_0x1dd94c){logger[_0x51df('0x33')](_0x51df('0x59'));var _0x2631ab={};_0x2631ab[_0x51df('0x5a')]={'name':!_[_0x51df('0x20')](_0x4caca6[_0x51df('0x5b')][_0x51df('0x1d')])&&!_[_0x51df('0x20')](_0x4caca6[_0x51df('0x3e')][_0x51df('0x1d')])&&_0x4caca6[_0x51df('0x3e')]['name']===_0x51df('0x5c')?_0x4caca6[_0x51df('0x5b')][_0x51df('0x1d')]:!_['isNil'](_0x4caca6['first_name'])?_0x4caca6[_0x51df('0x48')]+'\x20'+_0x4caca6['last_name']:_0x4caca6[_0x51df('0x49')],'id':_0x4caca6['id']};_0x2631ab[_0x51df('0x5d')]=intUtil[_0x51df('0x5e')](_0x533d2c[_0x51df('0x5f')],_0x4d6eb0,'\x20');_0x2631ab[_0x51df('0x60')]=intUtil[_0x51df('0x5e')](_0x533d2c[_0x51df('0x61')],_0x4d6eb0,'\x0a');if(_0x4501cf[_0x51df('0x44')]==='Contacts'){_0x2631ab[_0x51df('0x62')]={'name':!_[_0x51df('0x20')](_0x4501cf[_0x51df('0x63')])?_0x4501cf[_0x51df('0x63')]:!_[_0x51df('0x20')](_0x4501cf[_0x51df('0x64')])?_0x4501cf[_0x51df('0x64')]+'\x20'+_0x4501cf[_0x51df('0x65')]:_0x4501cf[_0x51df('0x65')],'id':_0x4501cf['id']};}if(_0x4501cf['enduserType']==='Leads'){_0x2631ab['What_Id']={'name':!_[_0x51df('0x20')](_0x4501cf[_0x51df('0x63')])?_0x4501cf[_0x51df('0x63')]:!_[_0x51df('0x20')](_0x4501cf[_0x51df('0x64')])?_0x4501cf[_0x51df('0x64')]+'\x20'+_0x4501cf[_0x51df('0x65')]:_0x4501cf[_0x51df('0x65')],'id':_0x4501cf['id']};_0x2631ab[_0x51df('0x66')]=_[_0x51df('0x47')](_0x4501cf['enduserType']);}if(_0x4d6eb0[_0x51df('0x67')]){_0x2631ab[_0x51df('0x68')]=moment[_0x51df('0x69')](parseInt(_0x4d6eb0['talktime'])*0x3e8)[_0x51df('0x6a')]('mm:ss');}else if(_0x4d6eb0[_0x51df('0x6b')]&&_0x4d6eb0['endtime']){_0x2631ab[_0x51df('0x68')]=moment[_0x51df('0x69')](moment(_0x4d6eb0[_0x51df('0x6c')],'YYYY-MM-DDTHH:mm:ss')[_0x51df('0x6d')](moment(_0x4d6eb0['starttime'],_0x51df('0x6e'))))[_0x51df('0x6a')](_0x51df('0x6f'));}switch(_0x4d6eb0[_0x51df('0x70')]){case _0x51df('0x71'):_0x2631ab[_0x51df('0x72')]=_0x51df('0x73');break;case'complete':case _0x51df('0x74'):_0x2631ab[_0x51df('0x72')]=_0x51df('0x75');break;case _0x51df('0x76'):_0x2631ab['Call_Result']=_0x51df('0x77');break;case'abandoned':_0x2631ab['Call_Result']=_0x51df('0x78');break;case _0x51df('0x79'):_0x2631ab[_0x51df('0x72')]=_0x51df('0x7a');default:}_0x2631ab[_0x51df('0x7b')]=(_0x1dd94c===_0x51df('0x7c')?moment(_0x4d6eb0['starttime'])[_0x51df('0x6a')](_0x51df('0x6e')):moment(_0x4d6eb0['agentcalledAt'])[_0x51df('0x6a')](_0x51df('0x6e')))||moment()[_0x51df('0x6a')]('YYYY-MM-DDTHH:mm:ss');_0x2631ab[_0x51df('0x7d')]=_0x1dd94c||_0x51df('0x7e');_0x2631ab=_[_0x51df('0x7f')](_0x2631ab,getCustomFields(_0x533d2c[_0x51df('0x80')],_0x4d6eb0));return request({'method':_0x51df('0x28'),'uri':_0x51df('0x45')+_0x581a2a+'/crm/v2/Calls','headers':{'Authorization':_0x51df('0x38')+_0x8bf2f3},'body':{'data':[_0x2631ab]},'json':!![]})[_0x51df('0x2e')](function(_0x20789b){if(_0x20789b&&_0x20789b[_0x51df('0x43')][0x0][_0x51df('0x4a')]===_0x51df('0x4b')){logger[_0x51df('0x33')](_0x51df('0x81'));return{'id':_0x20789b[_0x51df('0x43')][0x0][_0x51df('0x4c')]['id']};}})[_0x51df('0x30')](function(_0x492fe0){logger[_0x51df('0x33')](_0x51df('0x82'),_0x492fe0[_0x51df('0x83')]);console[_0x51df('0x4f')]('err',_0x492fe0);});}exports['queue']=function(_0x1dbaed,_0x20fd05,_0x429946,_0x2babba,_0x27c30f,_0x21a9dd){var _0x514c29,_0x2c43a4,_0x32d020;_0x21a9dd[_0x51df('0x84')]=intUtil[_0x51df('0x85')](_0x21a9dd['host']);_0x21a9dd[_0x51df('0x86')]=intUtil[_0x51df('0x85')](_0x21a9dd[_0x51df('0x86')]);if(_0x27c30f&&_0x27c30f[_0x51df('0x87')]){logger[_0x51df('0x33')](_0x51df('0x88'),'Recording\x20is\x20enabled!');_0x20fd05[_0x51df('0x89')]=_0x21a9dd[_0x51df('0x86')]+_0x51df('0x8a')+_0x20fd05[_0x51df('0x8b')]+_0x51df('0x8c')+md5(_0x20fd05[_0x51df('0x8b')]);}else{_0x20fd05[_0x51df('0x89')]='';}var _0x50f593=_0x21a9dd[_0x51df('0x84')]===_0x51df('0x8d')?'eu':'com';return getAccessToken(_0x21a9dd)['then'](function(_0x4a5dd6){_0x32d020=_0x4a5dd6;return getUser(_0x32d020,_0x50f593,_0x21a9dd,_0x2babba['email']);})[_0x51df('0x2e')](function(_0x7cd6b1){_0x514c29=_0x7cd6b1;logger[_0x51df('0x33')]('The\x20User\x20ID\x20is:',_0x514c29['id']);return getEndUser(_0x32d020,_0x50f593,_0x21a9dd,_0x20fd05[_0x51df('0x8e')],_0x20fd05[_0x51df('0x8f')],_0x514c29,_0x429946);})[_0x51df('0x2e')](function(_0x3174ca){_0x2c43a4=_0x3174ca;return getCall(_0x32d020,_0x50f593,_0x21a9dd,_0x514c29,_0x2c43a4,_0x429946,_0x20fd05,'Inbound');})['then'](function(_0x2dc04c){if(_0x2dc04c){logger['info'](_0x51df('0x90'),_0x2dc04c['id']);logger[_0x51df('0x33')]('[QUEUE]',_0x51df('0x91'));emit(util['format'](_0x51df('0x92'),_0x2babba[_0x51df('0x1d')]),'trigger:browser:url',{'uri':_0x51df('0x93')+_0x21a9dd[_0x51df('0x84')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2dc04c['id']});}})[_0x51df('0x30')](function(_0x55a6bc){logger[_0x51df('0x31')](_0x51df('0x88'),JSON[_0x51df('0x10')](_0x55a6bc));});};exports[_0x51df('0x7c')]=function(_0x122291,_0x4a5446,_0x1cf58b,_0x3b2873,_0x2ad014,_0x5630a2,_0xa8cbfe){var _0x1aeb1e,_0x2aa27b,_0x2c0ed7;_0x5630a2[_0x51df('0x84')]=intUtil[_0x51df('0x85')](_0x5630a2['host']);_0x5630a2[_0x51df('0x86')]=intUtil[_0x51df('0x85')](_0x5630a2[_0x51df('0x86')]);if(_0xa8cbfe&&_0xa8cbfe['recordingFormat']&&_0xa8cbfe['recordingFormat']!==_0x51df('0x94')){logger['info'](_0x51df('0x95'),_0x51df('0x96'));_0x4a5446[_0x51df('0x89')]=_0x5630a2['serverUrl']+_0x51df('0x8a')+_0x4a5446[_0x51df('0x8b')]+_0x51df('0x8c')+md5(_0x4a5446['uniqueid']);}var _0x5b1a09=_0x5630a2[_0x51df('0x84')]===_0x51df('0x8d')?'eu':_0x51df('0x97');return getAccessToken(_0x5630a2)['then'](function(_0x3cd942){_0x2c0ed7=_0x3cd942;return getUser(_0x2c0ed7,_0x5b1a09,_0x5630a2,_0x3b2873[_0x51df('0x98')]);})['then'](function(_0x1c79cb){_0x1aeb1e=_0x1c79cb;logger[_0x51df('0x33')](_0x51df('0x99'),_0x1aeb1e['id']);return getEndUser(_0x2c0ed7,_0x5b1a09,_0x5630a2,_0x4a5446[_0x51df('0x9a')],_0x4a5446[_0x51df('0x9b')],_0x1aeb1e,_0x1cf58b);})[_0x51df('0x2e')](function(_0x1af10d){_0x2aa27b=_0x1af10d;return getCall(_0x2c0ed7,_0x5b1a09,_0x5630a2,_0x1aeb1e,_0x2aa27b,_0x1cf58b,_0x4a5446,_0x51df('0x9c'));})[_0x51df('0x2e')](function(_0x42a563){if(_0x42a563){logger[_0x51df('0x33')](_0x51df('0x90'),_0x42a563['id']);logger[_0x51df('0x33')]('[OUTBOUND]',_0x51df('0x91'));emit(util['format'](_0x51df('0x92'),_0x3b2873[_0x51df('0x1d')]),_0x51df('0x9d'),{'uri':_0x51df('0x93')+_0x5630a2[_0x51df('0x84')]+_0x51df('0x9e')+_0x42a563['id']});}})[_0x51df('0x30')](function(_0x5e3a5e){logger[_0x51df('0x31')](_0x51df('0x95'),JSON[_0x51df('0x10')](_0x5e3a5e));});};exports[_0x51df('0x9f')]=function(_0x55bb75,_0x2f81ab,_0x5a80a4,_0x5be9b4,_0x239faa,_0x5e1cb6){var _0x22329b,_0x535f0f,_0x2b791e;_0x5e1cb6[_0x51df('0x84')]=intUtil[_0x51df('0x85')](_0x5e1cb6['host']);_0x5e1cb6[_0x51df('0x86')]=intUtil[_0x51df('0x85')](_0x5e1cb6[_0x51df('0x86')]);if(_0x239faa&&_0x239faa[_0x51df('0x87')]){logger[_0x51df('0x33')]('['+_0x2f81ab[_0x51df('0x70')]['toUpperCase']()+']',_0x51df('0x96'));_0x2f81ab[_0x51df('0x89')]=_0x5e1cb6[_0x51df('0x86')]+'/api/voice/recordings/'+_0x2f81ab[_0x51df('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x2f81ab[_0x51df('0x8b')]);}else{_0x2f81ab[_0x51df('0x89')]='';}var _0x59afea=_0x5e1cb6[_0x51df('0x84')]==='zoho.eu'?'eu':_0x51df('0x97');return getAccessToken(_0x5e1cb6)[_0x51df('0x2e')](function(_0x4372ad){_0x2b791e=_0x4372ad;return getUser(_0x2b791e,_0x59afea,_0x5e1cb6);})[_0x51df('0x2e')](function(_0x5e5591){_0x22329b=_0x5e5591;logger[_0x51df('0x33')](_0x51df('0x99'),_0x22329b['id']);return getEndUser(_0x2b791e,_0x59afea,_0x5e1cb6,_0x2f81ab[_0x51df('0x8e')],_0x2f81ab[_0x51df('0x8f')],_0x22329b,_0x5a80a4);})[_0x51df('0x2e')](function(_0x3edbec){_0x535f0f=_0x3edbec;return getCall(_0x2b791e,_0x59afea,_0x5e1cb6,_0x22329b,_0x535f0f,_0x5a80a4,_0x2f81ab,_0x51df('0x7e'));})[_0x51df('0x2e')](function(_0x4cb488){if(_0x4cb488){logger[_0x51df('0x33')]('The\x20Call\x20ID\x20is:',_0x4cb488['id']);}})[_0x51df('0x30')](function(_0x19e80f){logger[_0x51df('0x31')]('['+_0x2f81ab[_0x51df('0x70')][_0x51df('0xa0')]()+']',JSON[_0x51df('0x10')](_0x19e80f));});}; \ No newline at end of file +var _0x8fe3=['First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','rejected','Rejected','abandoned','Abandoned','Timeout','outbound','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','calleridname','lodash','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','length','includes','string','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Creating\x20new\x20call...','administrator','getString','Subjects','Who_Id','Full_Name'];(function(_0xb0418b,_0x361e3f){var _0x59741c=function(_0x40d84a){while(--_0x40d84a){_0xb0418b['push'](_0xb0418b['shift']());}};_0x59741c(++_0x361e3f);}(_0x8fe3,0x163));var _0x38fe=function(_0x2f21a1,_0x577a10){_0x2f21a1=_0x2f21a1-0x0;var _0x1a34c8=_0x8fe3[_0x2f21a1];return _0x1a34c8;};'use strict';var _=require(_0x38fe('0x0'));var rp=require(_0x38fe('0x1'));var md5=require('md5');var util=require(_0x38fe('0x2'));var intUtil=require('./util');var moment=require(_0x38fe('0x3'));var Redis=require(_0x38fe('0x4'));var BPromise=require('bluebird');var config=require(_0x38fe('0x5'));var logger=require(_0x38fe('0x6'))('zoho');config[_0x38fe('0x7')]=_[_0x38fe('0x8')](config['redis'],{'host':_0x38fe('0x9'),'port':0x18eb});var io=require(_0x38fe('0xa'))(new Redis(config[_0x38fe('0x7')]));function emit(_0x1c26e2,_0x4ee3cf,_0x17c321){io['to'](_0x1c26e2)['emit'](_0x4ee3cf,_0x17c321);}function request(_0xffba97){logger[_0x38fe('0xb')](_0x38fe('0xc'),JSON['stringify'](_0xffba97));return rp(_0xffba97);}function getCustomFields(_0x3335bc,_0x121a9f){var _0x2a3999={};if(_0x3335bc[_0x38fe('0xd')]>0x0){_['forEach'](_0x3335bc,function(_0x4d76b0){if(_[_0x38fe('0xe')]([_0x38fe('0xf'),'picklist'],_0x4d76b0[_0x38fe('0x10')])&&_0x4d76b0[_0x38fe('0x11')]){_0x2a3999[_0x4d76b0[_0x38fe('0x11')]]=_0x4d76b0['content']['toString']();}else if(_0x4d76b0[_0x38fe('0x10')]===_0x38fe('0x12')&&_0x4d76b0['variableName']&&_0x4d76b0[_0x38fe('0x11')]&&_0x121a9f[_0x4d76b0[_0x38fe('0x13')]]){_0x2a3999[_0x4d76b0['idField']]=_0x121a9f[_0x4d76b0['variableName']][_0x38fe('0x14')]();}else if(_0x4d76b0[_0x38fe('0x10')]===_0x38fe('0x15')&&_0x4d76b0[_0x38fe('0x16')]&&_0x4d76b0[_0x38fe('0x16')][_0x38fe('0x17')]&&_0x4d76b0[_0x38fe('0x11')]&&_0x121a9f[_0x4d76b0[_0x38fe('0x16')][_0x38fe('0x17')][_0x38fe('0x18')]()]){_0x2a3999[_0x4d76b0[_0x38fe('0x11')]]=_0x121a9f[_0x4d76b0['Variable'][_0x38fe('0x17')]['toLowerCase']()][_0x38fe('0x14')]();}});}return _0x2a3999;}function getName(_0x132a4a){if(_0x132a4a[_0x38fe('0x19')]('\x20')>0x0){var _0x397eae=_0x132a4a[_0x38fe('0x1a')](/ (.+)/);if(_0x397eae[0x1]){return _0x397eae;}}return[_0x132a4a,_0x132a4a];}var accountsTokens={};function getAccessToken(_0x2bfd81){return new Promise(function(_0x42a842,_0x2820de){if(!_[_0x38fe('0x1b')](accountsTokens[_0x2bfd81['id']])&&!_[_0x38fe('0x1b')](accountsTokens[_0x2bfd81['id']][_0x38fe('0x1c')])){if(moment()[_0x38fe('0x1d')](accountsTokens[_0x2bfd81['id']][_0x38fe('0x1e')])){_0x42a842(accountsTokens[_0x2bfd81['id']][_0x38fe('0x1c')]);}}var _0x52c4af;switch(_0x2bfd81[_0x38fe('0x1f')]){case'US':_0x52c4af='https://accounts.zoho.com';break;case'AU':_0x52c4af=_0x38fe('0x20');break;case'EU':_0x52c4af='https://accounts.zoho.eu';break;case'IN':_0x52c4af=_0x38fe('0x21');break;case'CN':_0x52c4af=_0x38fe('0x22');break;default:_0x52c4af=_0x38fe('0x23');break;}var _0x50020c={'method':_0x38fe('0x24'),'uri':_0x52c4af+_0x38fe('0x25'),'qs':{'refresh_token':_0x2bfd81[_0x38fe('0x26')],'client_id':_0x2bfd81[_0x38fe('0x27')],'client_secret':_0x2bfd81[_0x38fe('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x50020c)[_0x38fe('0x29')](function(_0x2b9a05){accountsTokens[_0x2bfd81['id']]={'access_token':_0x2b9a05[_0x38fe('0x1c')],'expires_in':moment()['add'](_0x2b9a05[_0x38fe('0x1e')],_0x38fe('0x2a'))};_0x42a842(_0x2b9a05[_0x38fe('0x1c')]);})[_0x38fe('0x2b')](function(_0x3e507d){logger[_0x38fe('0x2c')](_0x38fe('0x2d'),_0x3e507d[_0x38fe('0x2e')]);_0x2820de(_0x3e507d);});});}function getUser(_0x1a2889,_0x18b087,_0x245176,_0xfbc8d3){logger[_0x38fe('0x2f')]('Search\x20user');return request({'method':'GET','uri':util[_0x38fe('0x30')](_0x38fe('0x31'),_0x18b087),'qs':{'type':_0x38fe('0x32')},'headers':{'Authorization':_0x38fe('0x33')+_0x1a2889},'json':!![]})[_0x38fe('0x29')](function(_0x20a05e){if(_0x20a05e[_0x38fe('0x34')]){var _0x74ce94=-0x1;if(_[_0x38fe('0x35')](_0x20a05e[_0x38fe('0x34')])){if(!_[_0x38fe('0x1b')](_0xfbc8d3)){_0x74ce94=_[_0x38fe('0x36')](_0x20a05e[_0x38fe('0x34')],function(_0x5aabc7){return _0x5aabc7[_0x38fe('0x37')]===_0xfbc8d3;});}if(_0x74ce94>=0x0){logger[_0x38fe('0x2f')](_0x38fe('0x38'));}else{logger[_0x38fe('0x2f')](_0x38fe('0x39'));_0x74ce94=_['findIndex'](_0x20a05e[_0x38fe('0x34')],function(_0x364553){return _0x364553[_0x38fe('0x3a')][_0x38fe('0x17')]===_0x38fe('0x3b');});}return _0x20a05e[_0x38fe('0x34')][_0x74ce94];}else{if(_0x20a05e[_0x38fe('0x3c')][_0x38fe('0x3a')][_0x38fe('0x17')]===_0x38fe('0x3b')){logger[_0x38fe('0x2f')](_0x38fe('0x39'));user=_0x20a05e[_0x38fe('0x3c')];return user;}else{logger[_0x38fe('0x2c')](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](_0x20a05e));throw new Error(_0x38fe('0x3f')+JSON[_0x38fe('0x3e')](_0x20a05e));}}}else{logger['error'](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](_0x20a05e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x38fe('0x3e')](_0x20a05e));}})['catch'](function(_0x3a6e3f){console[_0x38fe('0x2c')](_0x3a6e3f);});}function getZohoUser(_0x2160cb,_0x764d69){return new BPromise(function(_0x40db8e,_0x333561){request(_0x2160cb)['then'](function(_0x452953){var _0x13ddbd=null;if(_0x452953){_0x13ddbd=_0x452953['data'][0x0];_0x13ddbd[_0x38fe('0x40')]=_0x764d69;}_0x40db8e(_0x13ddbd);})[_0x38fe('0x2b')](function(_0x30c889){_0x333561(_0x30c889);});});}function createEndUser(_0x4a9cf8,_0x46f490,_0x148c50,_0x591485,_0x36d2f8,_0x2b81fe){var _0x148c50=getName(_0x148c50);return request({'method':_0x38fe('0x24'),'uri':_0x38fe('0x41')+_0x46f490+_0x38fe('0x42')+_[_0x38fe('0x43')](_0x2b81fe[_0x38fe('0x44')])+'s','body':{'data':[{'Last_Name':_0x148c50[0x1],'First_Name':_0x148c50[0x0],'Phone':_0x591485,'Owner':{'name':!_['isNil'](_0x36d2f8['role'][_0x38fe('0x17')])?_0x36d2f8[_0x38fe('0x45')][_0x38fe('0x17')]:!_['isNil'](_0x36d2f8['first_name'])?_0x36d2f8[_0x38fe('0x46')]+'\x20'+_0x36d2f8[_0x38fe('0x47')]:_0x36d2f8[_0x38fe('0x47')],'id':_0x36d2f8['id']}}]},'headers':{'Authorization':_0x38fe('0x33')+_0x4a9cf8},'json':!![]})['then'](function(_0x37bdaf){if(_0x37bdaf&&_0x37bdaf[_0x38fe('0x48')][0x0][_0x38fe('0x49')]===_0x38fe('0x4a')){var _0x1918fa=_0x37bdaf[_0x38fe('0x48')][0x0][_0x38fe('0x4b')];_0x1918fa[_0x38fe('0x40')]=_[_0x38fe('0x43')](_0x2b81fe['moduleCreate'])+'s';return _0x1918fa;}logger['error'](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](data));throw new Error(_0x38fe('0x4c')+JSON['stringify'](data));})['catch'](function(_0x5db578){console[_0x38fe('0x4d')]('CREATE\x20ERROR',_0x5db578);});}function getEndUser(_0x271d35,_0x4ae961,_0x22f65c,_0x3787e8,_0x288a28,_0x104499,_0x243202){var _0x420260={'method':'GET','uri':'','headers':{'Authorization':_0x38fe('0x33')+_0x271d35},'json':!![]};switch(_0x243202[_0x38fe('0x4e')]){case _0x38fe('0x4f'):_0x420260[_0x38fe('0x50')]='https://www.zohoapis.'+_0x4ae961+_0x38fe('0x51')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x52'))[_0x38fe('0x29')](function(_0x1de907){if(_0x1de907)return _0x1de907;_0x420260[_0x38fe('0x50')]=_0x38fe('0x41')+_0x4ae961+_0x38fe('0x53')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x54'))[_0x38fe('0x29')](function(_0x241cd5){if(_0x241cd5)return _0x241cd5;if(_0x243202['moduleCreate']!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});});break;case'contact':_0x420260[_0x38fe('0x50')]=_0x38fe('0x41')+_0x4ae961+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x52'))['then'](function(_0x3bd16b){if(_0x3bd16b)return _0x3bd16b;if(_0x243202[_0x38fe('0x44')]!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});break;case'lead':_0x420260['uri']=_0x38fe('0x41')+_0x4ae961+_0x38fe('0x53')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x54'))[_0x38fe('0x29')](function(_0x461d0f){if(_0x461d0f)return _0x461d0f;if(_0x243202[_0x38fe('0x44')]!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});break;}}function getCall(_0xf136c,_0x7e6f33,_0x51aa9d,_0x2a6d59,_0x5729d8,_0x181fdc,_0x29cb57,_0x45cbe9){logger['info'](_0x38fe('0x56'));var _0x21d6f2={};_0x21d6f2['Owner']={'name':!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x45')][_0x38fe('0x17')])&&!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x3a')][_0x38fe('0x17')])&&_0x2a6d59[_0x38fe('0x3a')]['name']===_0x38fe('0x57')?_0x2a6d59[_0x38fe('0x45')][_0x38fe('0x17')]:!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x46')])?_0x2a6d59[_0x38fe('0x46')]+'\x20'+_0x2a6d59[_0x38fe('0x47')]:_0x2a6d59[_0x38fe('0x47')],'id':_0x2a6d59['id']};_0x21d6f2['Subject']=intUtil[_0x38fe('0x58')](_0x181fdc[_0x38fe('0x59')],_0x29cb57,'\x20');_0x21d6f2['Description']=intUtil[_0x38fe('0x58')](_0x181fdc['Descriptions'],_0x29cb57,'\x0a');if(_0x5729d8[_0x38fe('0x40')]===_0x38fe('0x52')){_0x21d6f2[_0x38fe('0x5a')]={'name':!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5b')])?_0x5729d8['Full_Name']:!_['isNil'](_0x5729d8[_0x38fe('0x5c')])?_0x5729d8[_0x38fe('0x5c')]+'\x20'+_0x5729d8['Last_Name']:_0x5729d8['Last_Name'],'id':_0x5729d8['id']};}if(_0x5729d8['enduserType']==='Leads'){_0x21d6f2[_0x38fe('0x5d')]={'name':!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5b')])?_0x5729d8[_0x38fe('0x5b')]:!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5c')])?_0x5729d8[_0x38fe('0x5c')]+'\x20'+_0x5729d8[_0x38fe('0x5e')]:_0x5729d8[_0x38fe('0x5e')],'id':_0x5729d8['id']};_0x21d6f2[_0x38fe('0x5f')]=_[_0x38fe('0x43')](_0x5729d8[_0x38fe('0x40')]);}if(_0x29cb57[_0x38fe('0x60')]){_0x21d6f2[_0x38fe('0x61')]=moment['utc'](parseInt(_0x29cb57[_0x38fe('0x60')])*0x3e8)[_0x38fe('0x30')](_0x38fe('0x62'));}else if(_0x29cb57[_0x38fe('0x63')]&&_0x29cb57[_0x38fe('0x64')]){_0x21d6f2[_0x38fe('0x61')]=moment[_0x38fe('0x65')](moment(_0x29cb57[_0x38fe('0x64')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x29cb57[_0x38fe('0x66')],_0x38fe('0x67'))))[_0x38fe('0x30')](_0x38fe('0x62'));}switch(_0x29cb57[_0x38fe('0x68')]){case _0x38fe('0x69'):_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x6b');break;case'complete':case _0x38fe('0x6c'):_0x21d6f2[_0x38fe('0x6a')]='Answered';break;case _0x38fe('0x6d'):_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x6e');break;case _0x38fe('0x6f'):_0x21d6f2['Call_Result']=_0x38fe('0x70');break;case'timeout':_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x71');default:}_0x21d6f2['Call_Start_Time']=(_0x45cbe9===_0x38fe('0x72')?moment(_0x29cb57[_0x38fe('0x66')])[_0x38fe('0x30')](_0x38fe('0x67')):moment(_0x29cb57['agentcalledAt'])[_0x38fe('0x30')](_0x38fe('0x67')))||moment()['format'](_0x38fe('0x67'));_0x21d6f2[_0x38fe('0x73')]=_0x45cbe9||_0x38fe('0x74');_0x21d6f2=_[_0x38fe('0x75')](_0x21d6f2,getCustomFields(_0x181fdc[_0x38fe('0x76')],_0x29cb57));return request({'method':_0x38fe('0x24'),'uri':_0x38fe('0x41')+_0x7e6f33+'/crm/v2/Calls','headers':{'Authorization':_0x38fe('0x33')+_0xf136c},'body':{'data':[_0x21d6f2]},'json':!![]})[_0x38fe('0x29')](function(_0x2cc8f2){if(_0x2cc8f2&&_0x2cc8f2['data'][0x0][_0x38fe('0x49')]===_0x38fe('0x4a')){logger[_0x38fe('0x2f')](_0x38fe('0x77'));return{'id':_0x2cc8f2[_0x38fe('0x48')][0x0][_0x38fe('0x4b')]['id']};}})['catch'](function(_0x4d5a08){logger[_0x38fe('0x2f')](_0x38fe('0x78'),_0x4d5a08['stack']);console['log'](_0x38fe('0x78'),_0x4d5a08);});}exports[_0x38fe('0x79')]=function(_0x220919,_0x2ec29d,_0x35cd7c,_0x19de22,_0x381932,_0x5e8856){var _0x52e80e,_0x469b26,_0x63b68c;_0x5e8856[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x5e8856[_0x38fe('0x7a')]);_0x5e8856[_0x38fe('0x7c')]=intUtil[_0x38fe('0x7b')](_0x5e8856[_0x38fe('0x7c')]);if(_0x381932&&_0x381932[_0x38fe('0x7d')]){logger['info'](_0x38fe('0x7e'),'Recording\x20is\x20enabled!');_0x2ec29d[_0x38fe('0x7f')]=_0x5e8856[_0x38fe('0x7c')]+_0x38fe('0x80')+_0x2ec29d[_0x38fe('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x2ec29d[_0x38fe('0x81')]);}else{_0x2ec29d[_0x38fe('0x7f')]='';}var _0x128d2a=_0x5e8856[_0x38fe('0x7a')]===_0x38fe('0x82')?'eu':'com';return getAccessToken(_0x5e8856)[_0x38fe('0x29')](function(_0x32b93b){_0x63b68c=_0x32b93b;return getUser(_0x63b68c,_0x128d2a,_0x5e8856,_0x19de22[_0x38fe('0x37')]);})[_0x38fe('0x29')](function(_0x1c7592){_0x52e80e=_0x1c7592;logger['info'](_0x38fe('0x83'),_0x52e80e['id']);return getEndUser(_0x63b68c,_0x128d2a,_0x5e8856,_0x2ec29d['calleridname'],_0x2ec29d[_0x38fe('0x84')],_0x52e80e,_0x35cd7c);})[_0x38fe('0x29')](function(_0x5ca621){_0x469b26=_0x5ca621;return getCall(_0x63b68c,_0x128d2a,_0x5e8856,_0x52e80e,_0x469b26,_0x35cd7c,_0x2ec29d,_0x38fe('0x74'));})[_0x38fe('0x29')](function(_0x40ce7d){if(_0x40ce7d){logger[_0x38fe('0x2f')](_0x38fe('0x85'),_0x40ce7d['id']);logger[_0x38fe('0x2f')](_0x38fe('0x7e'),_0x38fe('0x86'));emit(util[_0x38fe('0x30')](_0x38fe('0x87'),_0x19de22[_0x38fe('0x17')]),_0x38fe('0x88'),{'uri':'https://crm.'+_0x5e8856['host']+_0x38fe('0x89')+_0x40ce7d['id']});}})[_0x38fe('0x2b')](function(_0x5f12b5){logger[_0x38fe('0x2c')](_0x38fe('0x7e'),JSON[_0x38fe('0x3e')](_0x5f12b5));});};exports[_0x38fe('0x72')]=function(_0x1e1d53,_0x50adde,_0x1c6159,_0x5f4d8f,_0x5c0450,_0x3f64fd,_0x176674){var _0x4f7204,_0x1fc5db,_0x12e393;_0x3f64fd[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x3f64fd['host']);_0x3f64fd['serverUrl']=intUtil['stripTrailingSlash'](_0x3f64fd[_0x38fe('0x7c')]);if(_0x176674&&_0x176674[_0x38fe('0x8a')]&&_0x176674[_0x38fe('0x8a')]!=='none'){logger[_0x38fe('0x2f')](_0x38fe('0x8b'),'Recording\x20is\x20enabled!');_0x50adde[_0x38fe('0x7f')]=_0x3f64fd['serverUrl']+_0x38fe('0x80')+_0x50adde[_0x38fe('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x50adde[_0x38fe('0x81')]);}var _0x3132f9=_0x3f64fd[_0x38fe('0x7a')]==='zoho.eu'?'eu':_0x38fe('0x8c');return getAccessToken(_0x3f64fd)[_0x38fe('0x29')](function(_0x38788c){_0x12e393=_0x38788c;return getUser(_0x12e393,_0x3132f9,_0x3f64fd,_0x5f4d8f[_0x38fe('0x37')]);})[_0x38fe('0x29')](function(_0x158abf){_0x4f7204=_0x158abf;logger[_0x38fe('0x2f')](_0x38fe('0x83'),_0x4f7204['id']);return getEndUser(_0x12e393,_0x3132f9,_0x3f64fd,_0x50adde[_0x38fe('0x8d')],_0x50adde[_0x38fe('0x8e')],_0x4f7204,_0x1c6159);})['then'](function(_0x16c998){_0x1fc5db=_0x16c998;return getCall(_0x12e393,_0x3132f9,_0x3f64fd,_0x4f7204,_0x1fc5db,_0x1c6159,_0x50adde,_0x38fe('0x8f'));})['then'](function(_0x4fbf49){if(_0x4fbf49){logger[_0x38fe('0x2f')](_0x38fe('0x85'),_0x4fbf49['id']);logger[_0x38fe('0x2f')](_0x38fe('0x8b'),_0x38fe('0x86'));emit(util[_0x38fe('0x30')](_0x38fe('0x87'),_0x5f4d8f[_0x38fe('0x17')]),_0x38fe('0x88'),{'uri':_0x38fe('0x90')+_0x3f64fd['host']+_0x38fe('0x89')+_0x4fbf49['id']});}})['catch'](function(_0x3b5d3b){logger[_0x38fe('0x2c')]('[OUTBOUND]',JSON[_0x38fe('0x3e')](_0x3b5d3b));});};exports[_0x38fe('0x91')]=function(_0xf7c300,_0x9dbf8a,_0x547a82,_0x392037,_0x4d3056,_0x823460){var _0x5a46e2,_0x15581a,_0x3ed8a6;_0x823460[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x823460['host']);_0x823460[_0x38fe('0x7c')]=intUtil[_0x38fe('0x7b')](_0x823460[_0x38fe('0x7c')]);if(_0x4d3056&&_0x4d3056[_0x38fe('0x7d')]){logger['info']('['+_0x9dbf8a[_0x38fe('0x68')]['toUpperCase']()+']',_0x38fe('0x92'));_0x9dbf8a[_0x38fe('0x7f')]=_0x823460[_0x38fe('0x7c')]+_0x38fe('0x80')+_0x9dbf8a[_0x38fe('0x81')]+_0x38fe('0x93')+md5(_0x9dbf8a['uniqueid']);}else{_0x9dbf8a[_0x38fe('0x7f')]='';}var _0x19c4a6=_0x823460[_0x38fe('0x7a')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x823460)[_0x38fe('0x29')](function(_0x55b4c0){_0x3ed8a6=_0x55b4c0;return getUser(_0x3ed8a6,_0x19c4a6,_0x823460);})['then'](function(_0x5c3200){_0x5a46e2=_0x5c3200;logger[_0x38fe('0x2f')](_0x38fe('0x83'),_0x5a46e2['id']);return getEndUser(_0x3ed8a6,_0x19c4a6,_0x823460,_0x9dbf8a[_0x38fe('0x94')],_0x9dbf8a[_0x38fe('0x84')],_0x5a46e2,_0x547a82);})[_0x38fe('0x29')](function(_0x342ee1){_0x15581a=_0x342ee1;return getCall(_0x3ed8a6,_0x19c4a6,_0x823460,_0x5a46e2,_0x15581a,_0x547a82,_0x9dbf8a,_0x38fe('0x74'));})[_0x38fe('0x29')](function(_0xa690cb){if(_0xa690cb){logger[_0x38fe('0x2f')]('The\x20Call\x20ID\x20is:',_0xa690cb['id']);}})['catch'](function(_0xbe3b2d){logger[_0x38fe('0x2c')]('['+_0x9dbf8a[_0x38fe('0x68')]['toUpperCase']()+']',JSON[_0x38fe('0x3e')](_0xbe3b2d));});}; \ 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 74cb58b..1b1a32b 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 _0xcbff=['util','shelljs','../../../../config/logger','trigger','exec','data2','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcbff,0x174));var _0xfcbf=function(_0x14a83c,_0x394b54){_0x14a83c=_0x14a83c-0x0;var _0x345d56=_0xcbff[_0x14a83c];return _0x345d56;};'use strict';var util=require(_0xfcbf('0x0'));var sh=require(_0xfcbf('0x1'));var Mustache=require('mustache');var logger=require(_0xfcbf('0x2'))(_0xfcbf('0x3'));exports[_0xfcbf('0x4')]=function(_0x548c4a,_0x4e103e){var _0x614206=_0x548c4a[_0xfcbf('0x5')]?_0x548c4a[_0xfcbf('0x5')]:'Script';var _0x145538=_0x548c4a[_0xfcbf('0x6')]?Mustache['render'](_0x548c4a[_0xfcbf('0x6')],_0x4e103e):_0x4e103e;sh[_0xfcbf('0x4')](_0x145538,function(_0x1f016d,_0x27d13a,_0x52293a){if(_0x1f016d!==0x0){logger[_0xfcbf('0x7')](util['format'](_0xfcbf('0x8'),_0x614206,_0x145538,_0x1f016d,_0x52293a));}else{logger[_0xfcbf('0x9')](util[_0xfcbf('0xa')](_0xfcbf('0xb'),_0x614206,_0x145538,_0x27d13a));}});}; \ No newline at end of file +var _0xf22f=['exec','data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs'];(function(_0x3b2e0d,_0x1b417d){var _0x4d69b3=function(_0x5f21d6){while(--_0x5f21d6){_0x3b2e0d['push'](_0x3b2e0d['shift']());}};_0x4d69b3(++_0x1b417d);}(_0xf22f,0x121));var _0xff22=function(_0x25a409,_0x584b22){_0x25a409=_0x25a409-0x0;var _0x321845=_0xf22f[_0x25a409];return _0x321845;};'use strict';var util=require('util');var sh=require(_0xff22('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0xff22('0x1')]=function(_0x2b43ff,_0x2af40f){var _0x379f80=_0x2b43ff[_0xff22('0x2')]?_0x2b43ff[_0xff22('0x2')]:'Script';var _0x4afa26=_0x2b43ff[_0xff22('0x3')]?Mustache[_0xff22('0x4')](_0x2b43ff[_0xff22('0x3')],_0x2af40f):_0x2af40f;sh['exec'](_0x4afa26,function(_0x455a4c,_0xb79f50,_0x57348d){if(_0x455a4c!==0x0){logger[_0xff22('0x5')](util[_0xff22('0x6')](_0xff22('0x7'),_0x379f80,_0x4afa26,_0x455a4c,_0x57348d));}else{logger[_0xff22('0x8')](util[_0xff22('0x6')](_0xff22('0x9'),_0x379f80,_0x4afa26,_0xb79f50));}});}; \ 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 994171f..e07d007 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 _0xc068=['format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','error','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','exec','toUpperCase','data2','data5','render','data6','stack','DELETE','POST','data7','parse','body','info','data1','stringify','then','isNil',',\x20request\x20body:\x20','object'];(function(_0x833c3b,_0x213e0c){var _0x43a84e=function(_0x2b6bc3){while(--_0x2b6bc3){_0x833c3b['push'](_0x833c3b['shift']());}};_0x43a84e(++_0x213e0c);}(_0xc068,0x7f));var _0x8c06=function(_0x6b4f4a,_0x196a5e){_0x6b4f4a=_0x6b4f4a-0x0;var _0x3adca7=_0xc068[_0x6b4f4a];return _0x3adca7;};'use strict';var rp=require(_0x8c06('0x0'));var util=require(_0x8c06('0x1'));var _=require(_0x8c06('0x2'));var Mustache=require(_0x8c06('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0x8c06('0x4')]=function(_0x22ac76,_0x198952){var _0x42770d,_0x4e74a3;var _0x51700d={'method':_0x22ac76['data1'][_0x8c06('0x5')](),'uri':Mustache['render'](_0x22ac76[_0x8c06('0x6')],_0x198952),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x22ac76['data5'])==='number'&&parseInt(_0x22ac76[_0x8c06('0x7')])>=0x1&&parseInt(_0x22ac76['data5'])<=0xa?parseInt(_0x22ac76[_0x8c06('0x7')])*0x3e8:0x5*0x3e8};try{_0x51700d['headers']=_0x22ac76['data6']?JSON['parse'](Mustache[_0x8c06('0x8')](_0x22ac76[_0x8c06('0x9')],_0x198952)):{};}catch(_0x1f8ffd){logger['error'](_0x1f8ffd[_0x8c06('0xa')]);}switch(_0x22ac76['data1'][_0x8c06('0x5')]()){case'GET':case _0x8c06('0xb'):_0x42770d=null;_0x51700d['qs']=_0x198952;break;case _0x8c06('0xc'):case'PUT':if(_0x22ac76[_0x8c06('0xd')]){try{_0x42770d=JSON[_0x8c06('0xe')](Mustache[_0x8c06('0x8')](_0x22ac76['data7'],_0x198952));_0x51700d[_0x8c06('0xf')]=_0x42770d;}catch(_0x367e89){logger['error'](_0x367e89[_0x8c06('0xa')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x42770d=_0x198952;_0x51700d[_0x8c06('0xf')]=_0x42770d;}break;}logger[_0x8c06('0x10')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x22ac76[_0x8c06('0x11')],_0x22ac76['data2'],JSON[_0x8c06('0x12')](_0x51700d)));rp(_0x51700d)[_0x8c06('0x13')](function(_0x21c665){_0x42770d=!_[_0x8c06('0x14')](_0x42770d)?_0x8c06('0x15')+_0x42770d:'';_0x4e74a3=typeof _0x21c665[_0x8c06('0xf')]===_0x8c06('0x16')?JSON['stringify'](_0x21c665[_0x8c06('0xf')]):_0x21c665[_0x8c06('0xf')];logger[_0x8c06('0x10')](util[_0x8c06('0x17')](_0x8c06('0x18'),_0x22ac76[_0x8c06('0x11')],_0x22ac76['data2'],_0x21c665[_0x8c06('0x19')],_0x4e74a3));})[_0x8c06('0x1a')](function(_0x54a1fb){logger[_0x8c06('0x1b')](util[_0x8c06('0x17')](_0x8c06('0x1c'),_0x22ac76['data1'],_0x22ac76[_0x8c06('0x6')],_0x54a1fb[_0x8c06('0x19')],_0x54a1fb['name'],_0x54a1fb[_0x8c06('0x1d')]));});}; \ No newline at end of file +var _0x3a13=['data2','data5','number','headers','data6','parse','stack','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','stringify',',\x20request\x20body:\x20','object','format','%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','trigger','exec','data1','toUpperCase','render'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x3a13,0xd8));var _0x33a1=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x3a13[_0x725a4c];return _0x37b2cc;};'use strict';var rp=require(_0x33a1('0x0'));var util=require(_0x33a1('0x1'));var _=require(_0x33a1('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x33a1('0x3'));exports[_0x33a1('0x4')]=function(_0x598b8b,_0x42f8ec){var _0x18c418,_0x61178a;var _0x39607e={'method':_0x598b8b[_0x33a1('0x5')][_0x33a1('0x6')](),'uri':Mustache[_0x33a1('0x7')](_0x598b8b[_0x33a1('0x8')],_0x42f8ec),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x598b8b[_0x33a1('0x9')])===_0x33a1('0xa')&&parseInt(_0x598b8b['data5'])>=0x1&&parseInt(_0x598b8b[_0x33a1('0x9')])<=0xa?parseInt(_0x598b8b[_0x33a1('0x9')])*0x3e8:0x5*0x3e8};try{_0x39607e[_0x33a1('0xb')]=_0x598b8b[_0x33a1('0xc')]?JSON[_0x33a1('0xd')](Mustache['render'](_0x598b8b[_0x33a1('0xc')],_0x42f8ec)):{};}catch(_0xd47fb6){logger['error'](_0xd47fb6[_0x33a1('0xe')]);}switch(_0x598b8b[_0x33a1('0x5')][_0x33a1('0x6')]()){case'GET':case'DELETE':_0x18c418=null;_0x39607e['qs']=_0x42f8ec;break;case _0x33a1('0xf'):case _0x33a1('0x10'):if(_0x598b8b[_0x33a1('0x11')]){try{_0x18c418=JSON[_0x33a1('0xd')](Mustache[_0x33a1('0x7')](_0x598b8b['data7'],_0x42f8ec));_0x39607e[_0x33a1('0x12')]=_0x18c418;}catch(_0x454ccc){logger['error'](_0x454ccc[_0x33a1('0xe')]);logger[_0x33a1('0x13')](_0x33a1('0x14'));}}else{_0x18c418=_0x42f8ec;_0x39607e[_0x33a1('0x12')]=_0x18c418;}break;}logger[_0x33a1('0x15')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x598b8b[_0x33a1('0x5')],_0x598b8b['data2'],JSON[_0x33a1('0x16')](_0x39607e)));rp(_0x39607e)['then'](function(_0x46188c){_0x18c418=!_['isNil'](_0x18c418)?_0x33a1('0x17')+_0x18c418:'';_0x61178a=typeof _0x46188c[_0x33a1('0x12')]===_0x33a1('0x18')?JSON['stringify'](_0x46188c['body']):_0x46188c['body'];logger[_0x33a1('0x15')](util[_0x33a1('0x19')](_0x33a1('0x1a'),_0x598b8b[_0x33a1('0x5')],_0x598b8b['data2'],_0x46188c[_0x33a1('0x1b')],_0x61178a));})[_0x33a1('0x1c')](function(_0x229969){logger[_0x33a1('0x13')](util[_0x33a1('0x19')](_0x33a1('0x1d'),_0x598b8b[_0x33a1('0x5')],_0x598b8b[_0x33a1('0x8')],_0x229969[_0x33a1('0x1b')],_0x229969[_0x33a1('0x1e')],_0x229969[_0x33a1('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e3c649f..da34a6f 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 _0x3b34=['rpc','error','message','catch','jayson/promise','routing','client','http','Request','request','then','debug'];(function(_0x7135a8,_0x23df3e){var _0x1ed919=function(_0x5ce0c6){while(--_0x5ce0c6){_0x7135a8['push'](_0x7135a8['shift']());}};_0x1ed919(++_0x23df3e);}(_0x3b34,0x7c));var _0x43b3=function(_0x47f392,_0x4a976a){_0x47f392=_0x47f392-0x0;var _0x5778f9=_0x3b34[_0x47f392];return _0x5778f9;};'use strict';var jayson=require(_0x43b3('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x43b3('0x1'));var client=jayson[_0x43b3('0x2')][_0x43b3('0x3')]({'port':0x2329});client[_0x43b3('0x4')]=function(_0xb0e3c0,_0x25fa60){return new BPromise(function(_0x3634d2,_0x1862a0){return client[_0x43b3('0x5')](_0xb0e3c0,_0x25fa60)[_0x43b3('0x6')](function(_0x3b0edd){logger[_0x43b3('0x7')](_0x43b3('0x8'),'routing',_0xb0e3c0,_0x25fa60,_0x3b0edd);if(_0x3b0edd[_0x43b3('0x9')]){logger[_0x43b3('0x9')](_0x43b3('0x8'),_0x43b3('0x1'),_0xb0e3c0,_0x3b0edd['error'][_0x43b3('0xa')],_0x25fa60);return _0x1862a0(_0x3b0edd[_0x43b3('0x9')][_0x43b3('0xa')]);}else{return _0x3634d2(_0x3b0edd['result']);}})[_0x43b3('0xb')](function(_0x481ea0){logger[_0x43b3('0x9')](_0x43b3('0x8'),_0x43b3('0x1'),_0xb0e3c0,_0x481ea0,_0x25fa60);return _0x1862a0(_0x481ea0);});});};module['exports']=client; \ No newline at end of file +var _0x6874=['request','then','rpc','error','message','result','catch','bluebird','routing','http'];(function(_0x39146b,_0x43cf19){var _0x2c6134=function(_0x177f90){while(--_0x177f90){_0x39146b['push'](_0x39146b['shift']());}};_0x2c6134(++_0x43cf19);}(_0x6874,0x1e7));var _0x4687=function(_0x36ff03,_0x4ec3a7){_0x36ff03=_0x36ff03-0x0;var _0x59710e=_0x6874[_0x36ff03];return _0x59710e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4687('0x0'));var logger=require('../../config/logger')(_0x4687('0x1'));var client=jayson['client'][_0x4687('0x2')]({'port':0x2329});client['Request']=function(_0x2657e0,_0x33de4a){return new BPromise(function(_0x461375,_0x3997bd){return client[_0x4687('0x3')](_0x2657e0,_0x33de4a)[_0x4687('0x4')](function(_0x351e8e){logger['debug'](_0x4687('0x5'),_0x4687('0x1'),_0x2657e0,_0x33de4a,_0x351e8e);if(_0x351e8e[_0x4687('0x6')]){logger[_0x4687('0x6')](_0x4687('0x5'),_0x4687('0x1'),_0x2657e0,_0x351e8e[_0x4687('0x6')][_0x4687('0x7')],_0x33de4a);return _0x3997bd(_0x351e8e['error']['message']);}else{return _0x461375(_0x351e8e[_0x4687('0x8')]);}})[_0x4687('0x9')](function(_0x53c128){logger[_0x4687('0x6')](_0x4687('0x5'),_0x4687('0x1'),_0x2657e0,_0x53c128,_0x33de4a);return _0x3997bd(_0x53c128);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 8c6f9f8..a848691 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 _0xe37b=['./rpc/setting','then','getMailAccounts','refresh','getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email'];(function(_0x32b4ef,_0x573875){var _0x3eceb7=function(_0x569846){while(--_0x569846){_0x32b4ef['push'](_0x32b4ef['shift']());}};_0x3eceb7(++_0x573875);}(_0xe37b,0x1e8));var _0xbe37=function(_0x3a721e,_0x1cb998){_0x3a721e=_0x3a721e-0x0;var _0x54b5d=_0xe37b[_0x3a721e];return _0x54b5d;};'use strict';var BPromise=require(_0xbe37('0x0'));var server=require(_0xbe37('0x1'));var Realtime=require(_0xbe37('0x2'));var EmailChannel=require(_0xbe37('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xbe37('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xbe37('0x5')](mailAccount[_0xbe37('0x6')]())['then'](realtime['initMailAccounts']())[_0xbe37('0x5')](function(){email[_0xbe37('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xbe37('0x5')](function(){return initRealtime();})[_0xbe37('0x5')](function(){return setting[_0xbe37('0x8')]();})[_0xbe37('0x5')](function(_0x11ac60){return setInterval(initRealtime,_0x11ac60[_0xbe37('0x9')]*0x3e8);})[_0xbe37('0xa')](function(_0x57a8f8){console[_0xbe37('0xb')](_0x57a8f8);});}main(); \ No newline at end of file +var _0xf891=['listen','getSettings','loginMailFrequency','catch','bluebird','./server','./rpc/mailAccount','./rpc/setting','then','initMailAccounts','mailAccounts'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf891,0x93));var _0x1f89=function(_0x1248c8,_0x3eb7b5){_0x1248c8=_0x1248c8-0x0;var _0x45c353=_0xf891[_0x1248c8];return _0x45c353;};'use strict';var BPromise=require(_0x1f89('0x0'));var server=require(_0x1f89('0x1'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x1f89('0x2'));var setting=require(_0x1f89('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x1f89('0x4')](mailAccount['getMailAccounts']())[_0x1f89('0x4')](realtime[_0x1f89('0x5')]())[_0x1f89('0x4')](function(){email['refresh'](realtime[_0x1f89('0x6')]);return realtime;});}function main(){return server[_0x1f89('0x7')](realtime,email)['then'](function(){return initRealtime();})[_0x1f89('0x4')](function(){return setting[_0x1f89('0x8')]();})[_0x1f89('0x4')](function(_0x21d6f5){return setInterval(initRealtime,_0x21d6f5[_0x1f89('0x9')]*0x3e8);})[_0x1f89('0xa')](function(_0xa49401){console['log'](_0xa49401);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 732869f..8208798 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 _0x1ac6=['notify','then','catch','error','sendMail','verifySmtp','Smtp','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','handleImapEnd','handleImapError','status','disabled','prototype','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1ac6,0x1b1));var _0x61ac=function(_0x5572b7,_0x244036){_0x5572b7=_0x5572b7-0x0;var _0x1bc232=_0x1ac6[_0x5572b7];return _0x1bc232;};'use strict';var _=require('lodash');var moment=require(_0x61ac('0x0'));var BPromise=require(_0x61ac('0x1'));var md5=require(_0x61ac('0x2'));var Redis=require(_0x61ac('0x3'));var config=require(_0x61ac('0x4'));var logger=require(_0x61ac('0x5'))(_0x61ac('0x6'));config['redis']=_[_0x61ac('0x7')](config[_0x61ac('0x8')],{'host':_0x61ac('0x9'),'port':0x18eb});var io=require(_0x61ac('0xa'))(new Redis(config[_0x61ac('0x8')]));var EmailImap=require(_0x61ac('0xb'));var EmailSmtp=require(_0x61ac('0xc'));var mailAccount=require(_0x61ac('0xd'));var md5Accounts={};function EmailChannel(_0x2e98cb){logger['info'](_0x61ac('0xe'));this[_0x61ac('0xf')]=_0x2e98cb['mailAccounts'];this[_0x61ac('0x10')]={};this[_0x61ac('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0x61ac('0x12')]=function(_0x43257b){var _0x5e4433=this[_0x61ac('0xf')][_0x43257b];var _0x3d0669={'id':_0x5e4433['id'],'name':_0x5e4433[_0x61ac('0x13')],'key':_0x5e4433['key'],'active':_0x5e4433[_0x61ac('0x14')],'Imap':{'status':_0x5e4433[_0x61ac('0x15')]['status'],'messageStatus':_0x5e4433[_0x61ac('0x15')][_0x61ac('0x16')],'total':_0x5e4433[_0x61ac('0x15')][_0x61ac('0x17')]}};if(_[_0x61ac('0x18')](md5Accounts[_0x43257b])){md5Accounts[_0x43257b]={};}var _0x41a90e=md5(JSON[_0x61ac('0x19')](_0x3d0669));if(md5Accounts[_0x43257b][_0x61ac('0x2')]!==_0x41a90e){md5Accounts[_0x43257b][_0x61ac('0x2')]=_0x41a90e;io['emit'](_0x61ac('0x1a'),_0x3d0669);}};EmailChannel['prototype']['refresh']=function(_0x165db8){for(var _0x7aad21 in _0x165db8){if(_0x165db8[_0x61ac('0x1b')](_0x7aad21)){if(_0x165db8[_0x7aad21][_0x61ac('0x15')]&&_0x165db8[_0x7aad21][_0x61ac('0x14')]){var _0x8229fd=_0x165db8[_0x7aad21][_0x61ac('0x15')];if(!this[_0x61ac('0x10')][_0x61ac('0x1b')](_0x8229fd['id'])){this[_0x61ac('0x10')][_0x8229fd['id']]=new EmailImap(_0x8229fd,_0x165db8[_0x7aad21][_0x61ac('0x6')]);this[_0x61ac('0x10')][_0x8229fd['id']]['on'](_0x61ac('0x1c'),this[_0x61ac('0x1d')]['bind'](this,_0x7aad21));this[_0x61ac('0x10')][_0x8229fd['id']]['on']('email',this[_0x61ac('0x1e')][_0x61ac('0x1f')](this,_0x7aad21));this['imapAccounts'][_0x8229fd['id']]['on']('end',this[_0x61ac('0x20')][_0x61ac('0x1f')](this,_0x7aad21));this[_0x61ac('0x10')][_0x8229fd['id']]['on']('error',this[_0x61ac('0x21')][_0x61ac('0x1f')](this,_0x7aad21));}}else{if(_[_0x61ac('0x18')](this[_0x61ac('0xf')][_0x7aad21][_0x61ac('0x15')])){this[_0x61ac('0xf')][_0x7aad21][_0x61ac('0x15')]={};}this['mailAccounts'][_0x7aad21][_0x61ac('0x15')][_0x61ac('0x22')]=_0x61ac('0x23');this['mailAccounts'][_0x7aad21][_0x61ac('0x15')][_0x61ac('0x16')]='';this[_0x61ac('0x12')](_0x7aad21);}}}};EmailChannel[_0x61ac('0x24')][_0x61ac('0x1d')]=function(_0x439918,_0x3a8a7f){if(this['mailAccounts'][_0x439918]){this['mailAccounts'][_0x439918][_0x61ac('0x15')][_0x61ac('0x22')]=_0x61ac('0x25');this[_0x61ac('0xf')][_0x439918][_0x61ac('0x15')][_0x61ac('0x16')]=_0x3a8a7f[_0x61ac('0x13')];if(_0x3a8a7f[_0x61ac('0x26')]){this[_0x61ac('0xf')][_0x439918]['Imap'][_0x61ac('0x17')]=_0x3a8a7f[_0x61ac('0x26')]['total'];}return this[_0x61ac('0x12')](_0x439918);}};EmailChannel[_0x61ac('0x24')]['handleImapEmail']=function(_0x562af2,_0x5202b3){logger[_0x61ac('0x27')](_0x61ac('0x28'),_0x5202b3[_0x61ac('0x29')],_0x5202b3[_0x61ac('0x2a')],_0x5202b3[_0x61ac('0x2b')],_0x562af2);if(this[_0x61ac('0xf')][_0x562af2]){return mailAccount[_0x61ac('0x2c')](_0x562af2,_0x5202b3)[_0x61ac('0x2d')](function(_0x1d1373){if(_0x1d1373){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x61ac('0x2e')](function(_0x3236b2){logger[_0x61ac('0x2f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x61ac('0x19')](_0x3236b2));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x1628c5){if(this['mailAccounts'][_0x1628c5]&&this[_0x61ac('0xf')][_0x1628c5][_0x61ac('0x15')]){if(this[_0x61ac('0x10')][this['mailAccounts'][_0x1628c5]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x1628c5][_0x61ac('0x15')]['id']];}this[_0x61ac('0xf')][_0x1628c5][_0x61ac('0x15')]['lastSync']=moment();this[_0x61ac('0x12')](_0x1628c5);}};EmailChannel['prototype'][_0x61ac('0x21')]=function(_0x52247f,_0x36ae4e){if(this[_0x61ac('0xf')][_0x52247f]){this[_0x61ac('0xf')][_0x52247f][_0x61ac('0x15')][_0x61ac('0x22')]=_0x61ac('0x2f');this[_0x61ac('0xf')][_0x52247f][_0x61ac('0x15')][_0x61ac('0x16')]=_0x36ae4e;return this['emit'](_0x52247f);}};EmailChannel[_0x61ac('0x24')][_0x61ac('0x30')]=function(_0x4451a0,_0x58d8f3){return this['smtp']['send'](_0x4451a0,_0x58d8f3);};EmailChannel[_0x61ac('0x24')][_0x61ac('0x31')]=function(_0x3a69fe){var _0x4e610d=this;if(this[_0x61ac('0xf')][_0x3a69fe['id']]){if(_[_0x61ac('0x18')](this[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')])){this[_0x61ac('0xf')][_0x3a69fe['id']]['Smtp']={};}this[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')]['lastSync']=moment();return new BPromise(function(_0xe680d9,_0x43d8c6){return _0x4e610d['smtp'][_0x61ac('0x33')](_0x3a69fe)['then'](function(_0x321add){_0x4e610d[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')][_0x61ac('0x22')]='verified';_0x4e610d[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')]['messageStatus']='';_0x4e610d[_0x61ac('0x12')](_0x3a69fe['id']);_0xe680d9(_0x321add);})[_0x61ac('0x2e')](function(_0x5a5a77){_0x4e610d[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')][_0x61ac('0x22')]=_0x61ac('0x2f');_0x4e610d[_0x61ac('0xf')][_0x3a69fe['id']][_0x61ac('0x32')][_0x61ac('0x16')]=_0x5a5a77;_0x4e610d['emit'](_0x3a69fe['id']);_0x43d8c6(_0x5a5a77);});});}return this[_0x61ac('0x11')][_0x61ac('0x33')](_0x3a69fe);};module[_0x61ac('0x34')]=EmailChannel; \ No newline at end of file +var _0x2a3c=['catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','active','Imap','status','messageStatus','total','stringify','emit','prototype','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','isNil','disabled','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20accepted\x20from\x20routing'];(function(_0x24e862,_0x80f1d9){var _0xaa27a6=function(_0x301bf8){while(--_0x301bf8){_0x24e862['push'](_0x24e862['shift']());}};_0xaa27a6(++_0x80f1d9);}(_0x2a3c,0x123));var _0xc2a3=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2a3c[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xc2a3('0x0'));var moment=require('moment');var BPromise=require(_0xc2a3('0x1'));var md5=require(_0xc2a3('0x2'));var Redis=require(_0xc2a3('0x3'));var config=require(_0xc2a3('0x4'));var logger=require(_0xc2a3('0x5'))(_0xc2a3('0x6'));config[_0xc2a3('0x7')]=_['defaults'](config[_0xc2a3('0x7')],{'host':_0xc2a3('0x8'),'port':0x18eb});var io=require(_0xc2a3('0x9'))(new Redis(config[_0xc2a3('0x7')]));var EmailImap=require(_0xc2a3('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xc2a3('0xb'));var md5Accounts={};function EmailChannel(_0xd33a7b){logger['info'](_0xc2a3('0xc'));this[_0xc2a3('0xd')]=_0xd33a7b[_0xc2a3('0xd')];this[_0xc2a3('0xe')]={};this[_0xc2a3('0xf')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x466385){var _0x8cbdae=this['mailAccounts'][_0x466385];var _0x5ece51={'id':_0x8cbdae['id'],'name':_0x8cbdae[_0xc2a3('0x10')],'key':_0x8cbdae[_0xc2a3('0x11')],'active':_0x8cbdae[_0xc2a3('0x12')],'Imap':{'status':_0x8cbdae[_0xc2a3('0x13')][_0xc2a3('0x14')],'messageStatus':_0x8cbdae[_0xc2a3('0x13')][_0xc2a3('0x15')],'total':_0x8cbdae['Imap'][_0xc2a3('0x16')]}};if(_['isNil'](md5Accounts[_0x466385])){md5Accounts[_0x466385]={};}var _0x386cd5=md5(JSON[_0xc2a3('0x17')](_0x5ece51));if(md5Accounts[_0x466385]['md5']!==_0x386cd5){md5Accounts[_0x466385][_0xc2a3('0x2')]=_0x386cd5;io[_0xc2a3('0x18')]('mailAccount:update',_0x5ece51);}};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x1a')]=function(_0x4c0c4e){for(var _0x512a62 in _0x4c0c4e){if(_0x4c0c4e[_0xc2a3('0x1b')](_0x512a62)){if(_0x4c0c4e[_0x512a62][_0xc2a3('0x13')]&&_0x4c0c4e[_0x512a62][_0xc2a3('0x12')]){var _0x428678=_0x4c0c4e[_0x512a62][_0xc2a3('0x13')];if(!this[_0xc2a3('0xe')][_0xc2a3('0x1b')](_0x428678['id'])){this[_0xc2a3('0xe')][_0x428678['id']]=new EmailImap(_0x428678,_0x4c0c4e[_0x512a62]['email']);this['imapAccounts'][_0x428678['id']]['on'](_0xc2a3('0x1c'),this[_0xc2a3('0x1d')][_0xc2a3('0x1e')](this,_0x512a62));this[_0xc2a3('0xe')][_0x428678['id']]['on'](_0xc2a3('0x6'),this[_0xc2a3('0x1f')]['bind'](this,_0x512a62));this[_0xc2a3('0xe')][_0x428678['id']]['on'](_0xc2a3('0x20'),this['handleImapEnd'][_0xc2a3('0x1e')](this,_0x512a62));this[_0xc2a3('0xe')][_0x428678['id']]['on'](_0xc2a3('0x21'),this[_0xc2a3('0x22')][_0xc2a3('0x1e')](this,_0x512a62));}}else{if(_[_0xc2a3('0x23')](this[_0xc2a3('0xd')][_0x512a62]['Imap'])){this[_0xc2a3('0xd')][_0x512a62][_0xc2a3('0x13')]={};}this[_0xc2a3('0xd')][_0x512a62][_0xc2a3('0x13')][_0xc2a3('0x14')]=_0xc2a3('0x24');this[_0xc2a3('0xd')][_0x512a62][_0xc2a3('0x13')][_0xc2a3('0x15')]='';this[_0xc2a3('0x18')](_0x512a62);}}}};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x1d')]=function(_0x54785d,_0x4d9a3b){if(this[_0xc2a3('0xd')][_0x54785d]){this[_0xc2a3('0xd')][_0x54785d]['Imap'][_0xc2a3('0x14')]=_0xc2a3('0x25');this[_0xc2a3('0xd')][_0x54785d][_0xc2a3('0x13')][_0xc2a3('0x15')]=_0x4d9a3b[_0xc2a3('0x10')];if(_0x4d9a3b[_0xc2a3('0x26')]){this[_0xc2a3('0xd')][_0x54785d][_0xc2a3('0x13')][_0xc2a3('0x16')]=_0x4d9a3b[_0xc2a3('0x26')][_0xc2a3('0x16')];}return this[_0xc2a3('0x18')](_0x54785d);}};EmailChannel['prototype'][_0xc2a3('0x1f')]=function(_0x4411a0,_0x249808){logger[_0xc2a3('0x27')](_0xc2a3('0x28'),_0x249808['firstName'],_0x249808['lastName'],_0x249808[_0xc2a3('0x29')],_0x4411a0);if(this[_0xc2a3('0xd')][_0x4411a0]){return mailAccount[_0xc2a3('0x2a')](_0x4411a0,_0x249808)[_0xc2a3('0x2b')](function(_0x3a79de){if(_0x3a79de){logger[_0xc2a3('0x27')](_0xc2a3('0x2c'));}})[_0xc2a3('0x2d')](function(_0x587f1b){logger[_0xc2a3('0x21')](_0xc2a3('0x2e'),JSON[_0xc2a3('0x17')](_0x587f1b));});}};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x2f')]=function(_0x5cdf69){if(this[_0xc2a3('0xd')][_0x5cdf69]&&this['mailAccounts'][_0x5cdf69][_0xc2a3('0x13')]){if(this[_0xc2a3('0xe')][this[_0xc2a3('0xd')][_0x5cdf69][_0xc2a3('0x13')]['id']]){delete this[_0xc2a3('0xe')][this[_0xc2a3('0xd')][_0x5cdf69]['Imap']['id']];}this[_0xc2a3('0xd')][_0x5cdf69]['Imap']['lastSync']=moment();this['emit'](_0x5cdf69);}};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x22')]=function(_0x1c294b,_0x4adad3){if(this[_0xc2a3('0xd')][_0x1c294b]){this[_0xc2a3('0xd')][_0x1c294b][_0xc2a3('0x13')][_0xc2a3('0x14')]=_0xc2a3('0x21');this[_0xc2a3('0xd')][_0x1c294b][_0xc2a3('0x13')][_0xc2a3('0x15')]=_0x4adad3;return this[_0xc2a3('0x18')](_0x1c294b);}};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x30')]=function(_0x34a1ce,_0x2cb3e2){return this[_0xc2a3('0xf')][_0xc2a3('0x31')](_0x34a1ce,_0x2cb3e2);};EmailChannel[_0xc2a3('0x19')][_0xc2a3('0x32')]=function(_0x34b55d){var _0x4394c8=this;if(this[_0xc2a3('0xd')][_0x34b55d['id']]){if(_[_0xc2a3('0x23')](this['mailAccounts'][_0x34b55d['id']][_0xc2a3('0x33')])){this[_0xc2a3('0xd')][_0x34b55d['id']]['Smtp']={};}this['mailAccounts'][_0x34b55d['id']][_0xc2a3('0x33')][_0xc2a3('0x34')]=moment();return new BPromise(function(_0x2c6df6,_0x392998){return _0x4394c8[_0xc2a3('0xf')][_0xc2a3('0x35')](_0x34b55d)[_0xc2a3('0x2b')](function(_0x3443b5){_0x4394c8[_0xc2a3('0xd')][_0x34b55d['id']]['Smtp'][_0xc2a3('0x14')]=_0xc2a3('0x36');_0x4394c8[_0xc2a3('0xd')][_0x34b55d['id']][_0xc2a3('0x33')][_0xc2a3('0x15')]='';_0x4394c8[_0xc2a3('0x18')](_0x34b55d['id']);_0x2c6df6(_0x3443b5);})['catch'](function(_0x5b306c){_0x4394c8[_0xc2a3('0xd')][_0x34b55d['id']][_0xc2a3('0x33')][_0xc2a3('0x14')]='error';_0x4394c8[_0xc2a3('0xd')][_0x34b55d['id']][_0xc2a3('0x33')][_0xc2a3('0x15')]=_0x5b306c;_0x4394c8[_0xc2a3('0x18')](_0x34b55d['id']);_0x392998(_0x5b306c);});});}return this[_0xc2a3('0xf')][_0xc2a3('0x35')](_0x34b55d);};module[_0xc2a3('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b819e1a..d0f9597 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 _0xfa2d=['error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','tls','getHost','port','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','fetch','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','textCode','upperFirst','path','util','imap','lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd'];(function(_0xe1fca5,_0x5a0369){var _0x43bbdf=function(_0xf997fc){while(--_0xf997fc){_0xe1fca5['push'](_0xe1fca5['shift']());}};_0x43bbdf(++_0x5a0369);}(_0xfa2d,0x188));var _0xdfa2=function(_0x38c7d8,_0x253557){_0x38c7d8=_0x38c7d8-0x0;var _0x266426=_0xfa2d[_0x38c7d8];return _0x266426;};'use strict';var fs=require('fs');var path=require(_0xdfa2('0x0'));var util=require(_0xdfa2('0x1'));var Imap=require(_0xdfa2('0x2'));var _=require(_0xdfa2('0x3'));var rs=require('randomstring');var simpleParser=require(_0xdfa2('0x4'))['simpleParser'];var Iconv=require(_0xdfa2('0x5'))[_0xdfa2('0x6')];var EventEmitter=require(_0xdfa2('0x7'))[_0xdfa2('0x8')];var utils=require(_0xdfa2('0x9'));var logger=require(_0xdfa2('0xa'))(_0xdfa2('0xb'));function EmailImap(_0x41e934,_0x4f4e27){this[_0xdfa2('0xc')]='INBOX';this[_0xdfa2('0xd')]=this[_0xdfa2('0xe')](_0x41e934,_0x4f4e27);this['imap']=new Imap(this[_0xdfa2('0xd')]);this[_0xdfa2('0x2')][_0xdfa2('0xf')](_0xdfa2('0x10'),this[_0xdfa2('0x11')][_0xdfa2('0x12')](this));this[_0xdfa2('0x2')][_0xdfa2('0xf')](_0xdfa2('0x13'),this[_0xdfa2('0x14')][_0xdfa2('0x12')](this));this[_0xdfa2('0x2')]['on'](_0xdfa2('0x15'),this[_0xdfa2('0x16')]['bind'](this));this[_0xdfa2('0x2')]['connect']();}util[_0xdfa2('0x17')](EmailImap,EventEmitter);EmailImap[_0xdfa2('0x18')][_0xdfa2('0xe')]=function(_0x381167,_0x1afae2){var _0x298a97={'connTimeout':_0x381167[_0xdfa2('0x19')]?_0x381167[_0xdfa2('0x19')]*0x3e8:0x2710,'authTimeout':_0x381167[_0xdfa2('0x1a')]?_0x381167[_0xdfa2('0x1a')]*0x3e8:0x1388};if(_[_0xdfa2('0x1b')](_0x381167[_0xdfa2('0x1c')])){if(_0x381167[_0xdfa2('0x1d')]){_0x298a97[_0xdfa2('0x1e')]=_0x381167[_0xdfa2('0x1e')];_0x298a97[_0xdfa2('0x1f')]=_0x381167['password'];}_0x298a97[_0xdfa2('0x20')]=_0x381167[_0xdfa2('0x20')];_0x298a97['port']=_0x381167['port']||0x3e1;if(_0x381167[_0xdfa2('0x21')]){_0x298a97[_0xdfa2('0x21')]=!![];}else{_0x298a97[_0xdfa2('0x21')]=![];_0x298a97['autotls']='required';}}else{_0x298a97['user']=_0x381167[_0xdfa2('0x1e')];_0x298a97[_0xdfa2('0x1f')]=_0x381167[_0xdfa2('0x1f')];_0x298a97[_0xdfa2('0x20')]=utils[_0xdfa2('0x22')](_0x381167['service']);_0x298a97[_0xdfa2('0x23')]=0x3e1;_0x298a97[_0xdfa2('0x21')]=!![];}_0x298a97[_0xdfa2('0xb')]=_0x1afae2||_0x381167[_0xdfa2('0x1e')]||'anonymous@xcally.com';return _0x298a97;};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x11')]=function(){this[_0xdfa2('0x2')][_0xdfa2('0x24')](this[_0xdfa2('0xc')],![],this[_0xdfa2('0x25')][_0xdfa2('0x12')](this));};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x25')]=function(_0x10375d,_0xb0390){if(_0x10375d){this[_0xdfa2('0x16')](_0x10375d,!![]);}else{this[_0xdfa2('0x26')](_0xdfa2('0x27'),_0xb0390);this['readUnseen']();}};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x28')]=function(_0x493459){if(_0x493459){this[_0xdfa2('0x16')](_0x493459,!![]);}else{this[_0xdfa2('0x2')][_0xdfa2('0x13')]();}};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x29')]=function(){this[_0xdfa2('0x2')][_0xdfa2('0x2a')]([_0xdfa2('0x2b')],this[_0xdfa2('0x2c')][_0xdfa2('0x12')](this));};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x2c')]=function(_0x56e66f,_0x4994a7){if(_0x56e66f){this[_0xdfa2('0x16')](_0x56e66f,!![]);}else{if(_0x4994a7['length']){try{var _0x45818e=this['imap'][_0xdfa2('0x2d')](_0x4994a7,{'bodies':'','markSeen':!![]});_0x45818e['on']('message',this['handleFetchMessage'][_0xdfa2('0x12')](this));_0x45818e[_0xdfa2('0xf')](_0xdfa2('0x15'),this[_0xdfa2('0x2e')][_0xdfa2('0x12')](this));_0x45818e['once']('end',this[_0xdfa2('0x2f')][_0xdfa2('0x12')](this));}catch(_0x5b8b33){logger[_0xdfa2('0x15')](_0x5b8b33);}}else{this['imap'][_0xdfa2('0x30')](!![],this[_0xdfa2('0x28')][_0xdfa2('0x12')](this));}}};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x31')]=function(_0x2d4f41,_0xb41bfc){_0x2d4f41['on'](_0xdfa2('0x32'),this[_0xdfa2('0x33')]['bind'](this));_0x2d4f41['once'](_0xdfa2('0x34'),this[_0xdfa2('0x35')]['bind'](this));_0x2d4f41['once']('end',this[_0xdfa2('0x36')][_0xdfa2('0x12')](this));};EmailImap[_0xdfa2('0x18')]['handleMessageBody']=function(_0x526fc6,_0xaaf5e9){simpleParser(_0x526fc6,{'Iconv':Iconv},this[_0xdfa2('0x37')][_0xdfa2('0x12')](this));};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x35')]=function(_0x1cd984){};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x36')]=function(){};EmailImap['prototype'][_0xdfa2('0x37')]=function(_0x5b471b,_0xf0dfb3){if(_0x5b471b){logger[_0xdfa2('0x15')](_0x5b471b);}else{var _0x6e204=this;utils[_0xdfa2('0x38')](this[_0xdfa2('0xd')],_0xf0dfb3,function(_0x2abb92){_0x6e204[_0xdfa2('0x26')](_0xdfa2('0xb'),_0x2abb92);});}};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x2f')]=function(){this['imap'][_0xdfa2('0x30')](!![],this[_0xdfa2('0x28')]['bind'](this));};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x2e')]=function(_0x1c58e8){this[_0xdfa2('0x16')](_0x1c58e8);this[_0xdfa2('0x2')]['closeBox'](!![],this['handleCloseBox'][_0xdfa2('0x12')](this));};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x14')]=function(){this[_0xdfa2('0x26')]('end');};EmailImap[_0xdfa2('0x18')][_0xdfa2('0x16')]=function(_0x40e8b0,_0x2da461){logger[_0xdfa2('0x15')](_0xdfa2('0x16'),this[_0xdfa2('0xd')][_0xdfa2('0xb')],JSON['stringify'](_0x40e8b0));var _0x402004='';if(_0x40e8b0){if(_0x40e8b0[_0xdfa2('0x39')]){_0x402004=_0x40e8b0['textCode'];}else{for(var _0x5f51ee in _0x40e8b0){if(_0x40e8b0['hasOwnProperty'](_0x5f51ee)){_0x402004+=_[_0xdfa2('0x3a')](_0x5f51ee)+':\x20'+_0x40e8b0[_0x5f51ee]+'\x0a';}}}}if(_0x2da461){this[_0xdfa2('0x2')][_0xdfa2('0x13')]();}else{this[_0xdfa2('0x26')](_0xdfa2('0x15'),_0x402004);this[_0xdfa2('0x26')](_0xdfa2('0x13'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xe5ec=['openBox','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','randomstring','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','once','ready','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','getHost','service','email','handleReady'];(function(_0x266b0c,_0x4fb269){var _0xd1bfa7=function(_0x36c2d2){while(--_0x36c2d2){_0x266b0c['push'](_0x266b0c['shift']());}};_0xd1bfa7(++_0x4fb269);}(_0xe5ec,0x1b4));var _0xce5e=function(_0x1b75cb,_0x1e6e09){_0x1b75cb=_0x1b75cb-0x0;var _0x484e47=_0xe5ec[_0x1b75cb];return _0x484e47;};'use strict';var fs=require('fs');var path=require(_0xce5e('0x0'));var util=require('util');var Imap=require(_0xce5e('0x1'));var _=require(_0xce5e('0x2'));var rs=require(_0xce5e('0x3'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require('iconv')[_0xce5e('0x4')];var EventEmitter=require(_0xce5e('0x5'))[_0xce5e('0x6')];var utils=require(_0xce5e('0x7'));var logger=require(_0xce5e('0x8'))('email');function EmailImap(_0x5f3abe,_0x2e3d2e){this[_0xce5e('0x9')]=_0xce5e('0xa');this[_0xce5e('0xb')]=this[_0xce5e('0xc')](_0x5f3abe,_0x2e3d2e);this[_0xce5e('0x1')]=new Imap(this[_0xce5e('0xb')]);this['imap'][_0xce5e('0xd')](_0xce5e('0xe'),this['handleReady'][_0xce5e('0xf')](this));this[_0xce5e('0x1')][_0xce5e('0xd')](_0xce5e('0x10'),this[_0xce5e('0x11')][_0xce5e('0xf')](this));this[_0xce5e('0x1')]['on'](_0xce5e('0x12'),this[_0xce5e('0x13')][_0xce5e('0xf')](this));this[_0xce5e('0x1')][_0xce5e('0x14')]();}util[_0xce5e('0x15')](EmailImap,EventEmitter);EmailImap[_0xce5e('0x16')][_0xce5e('0xc')]=function(_0x36b580,_0x22fdf6){var _0x432211={'connTimeout':_0x36b580[_0xce5e('0x17')]?_0x36b580[_0xce5e('0x17')]*0x3e8:0x2710,'authTimeout':_0x36b580[_0xce5e('0x18')]?_0x36b580[_0xce5e('0x18')]*0x3e8:0x1388};if(_[_0xce5e('0x19')](_0x36b580['service'])){if(_0x36b580[_0xce5e('0x1a')]){_0x432211[_0xce5e('0x1b')]=_0x36b580['user'];_0x432211[_0xce5e('0x1c')]=_0x36b580[_0xce5e('0x1c')];}_0x432211[_0xce5e('0x1d')]=_0x36b580[_0xce5e('0x1d')];_0x432211[_0xce5e('0x1e')]=_0x36b580[_0xce5e('0x1e')]||0x3e1;if(_0x36b580[_0xce5e('0x1f')]){_0x432211['tls']=!![];}else{_0x432211[_0xce5e('0x1f')]=![];_0x432211['autotls']='required';}}else{_0x432211['user']=_0x36b580['user'];_0x432211['password']=_0x36b580[_0xce5e('0x1c')];_0x432211[_0xce5e('0x1d')]=utils[_0xce5e('0x20')](_0x36b580[_0xce5e('0x21')]);_0x432211[_0xce5e('0x1e')]=0x3e1;_0x432211[_0xce5e('0x1f')]=!![];}_0x432211[_0xce5e('0x22')]=_0x22fdf6||_0x36b580[_0xce5e('0x1b')]||'anonymous@xcally.com';return _0x432211;};EmailImap[_0xce5e('0x16')][_0xce5e('0x23')]=function(){this['imap'][_0xce5e('0x24')](this[_0xce5e('0x9')],![],this['handleOpenBox'][_0xce5e('0xf')](this));};EmailImap[_0xce5e('0x16')]['handleOpenBox']=function(_0x36a2ff,_0x1d7370){if(_0x36a2ff){this[_0xce5e('0x13')](_0x36a2ff,!![]);}else{this[_0xce5e('0x25')](_0xce5e('0x26'),_0x1d7370);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x1ae254){if(_0x1ae254){this['handleError'](_0x1ae254,!![]);}else{this[_0xce5e('0x1')][_0xce5e('0x10')]();}};EmailImap[_0xce5e('0x16')][_0xce5e('0x27')]=function(){this[_0xce5e('0x1')]['search']([_0xce5e('0x28')],this[_0xce5e('0x29')][_0xce5e('0xf')](this));};EmailImap[_0xce5e('0x16')][_0xce5e('0x29')]=function(_0x4f9b6e,_0x2c620c){if(_0x4f9b6e){this['handleError'](_0x4f9b6e,!![]);}else{if(_0x2c620c[_0xce5e('0x2a')]){try{var _0x344159=this[_0xce5e('0x1')][_0xce5e('0x2b')](_0x2c620c,{'bodies':'','markSeen':!![]});_0x344159['on']('message',this[_0xce5e('0x2c')]['bind'](this));_0x344159['once']('error',this[_0xce5e('0x2d')][_0xce5e('0xf')](this));_0x344159[_0xce5e('0xd')]('end',this[_0xce5e('0x2e')][_0xce5e('0xf')](this));}catch(_0x1490e9){logger[_0xce5e('0x12')](_0x1490e9);}}else{this['imap']['closeBox'](!![],this[_0xce5e('0x2f')][_0xce5e('0xf')](this));}}};EmailImap[_0xce5e('0x16')]['handleFetchMessage']=function(_0x311c9d,_0x4e470d){_0x311c9d['on'](_0xce5e('0x30'),this[_0xce5e('0x31')][_0xce5e('0xf')](this));_0x311c9d['once']('attributes',this[_0xce5e('0x32')][_0xce5e('0xf')](this));_0x311c9d[_0xce5e('0xd')](_0xce5e('0x10'),this[_0xce5e('0x33')][_0xce5e('0xf')](this));};EmailImap[_0xce5e('0x16')][_0xce5e('0x31')]=function(_0x514292,_0x2bf82c){simpleParser(_0x514292,{'Iconv':Iconv},this[_0xce5e('0x34')][_0xce5e('0xf')](this));};EmailImap[_0xce5e('0x16')]['handleMessageAttributes']=function(_0x59d150){};EmailImap[_0xce5e('0x16')][_0xce5e('0x33')]=function(){};EmailImap[_0xce5e('0x16')][_0xce5e('0x34')]=function(_0xcc98c,_0x5581b7){if(_0xcc98c){logger[_0xce5e('0x12')](_0xcc98c);}else{var _0x2e6045=this;utils['parser'](this[_0xce5e('0xb')],_0x5581b7,function(_0x53553a){_0x2e6045[_0xce5e('0x25')]('email',_0x53553a);});}};EmailImap[_0xce5e('0x16')][_0xce5e('0x2e')]=function(){this[_0xce5e('0x1')][_0xce5e('0x35')](!![],this[_0xce5e('0x2f')]['bind'](this));};EmailImap[_0xce5e('0x16')][_0xce5e('0x2d')]=function(_0x2bda4b){this['handleError'](_0x2bda4b);this[_0xce5e('0x1')][_0xce5e('0x35')](!![],this[_0xce5e('0x2f')][_0xce5e('0xf')](this));};EmailImap['prototype'][_0xce5e('0x11')]=function(){this['emit'](_0xce5e('0x10'));};EmailImap[_0xce5e('0x16')][_0xce5e('0x13')]=function(_0x28e8b0,_0x1765b7){logger[_0xce5e('0x12')](_0xce5e('0x13'),this[_0xce5e('0xb')][_0xce5e('0x22')],JSON[_0xce5e('0x36')](_0x28e8b0));var _0x376947='';if(_0x28e8b0){if(_0x28e8b0[_0xce5e('0x37')]){_0x376947=_0x28e8b0['textCode'];}else{for(var _0x7e0be in _0x28e8b0){if(_0x28e8b0[_0xce5e('0x38')](_0x7e0be)){_0x376947+=_[_0xce5e('0x39')](_0x7e0be)+':\x20'+_0x28e8b0[_0x7e0be]+'\x0a';}}}}if(_0x1765b7){this[_0xce5e('0x1')][_0xce5e('0x10')]();}else{this[_0xce5e('0x25')]('error',_0x376947);this[_0xce5e('0x25')]('end');}};module[_0xce5e('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b95c17b..826f79a 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 _0x0c48=['nodemailer-plugin-inline-base64','prototype','send','use','sendMail','verify','createTransport','exports','nodemailer','bluebird'];(function(_0x309e52,_0x26c91b){var _0x2797c6=function(_0x1f333f){while(--_0x1f333f){_0x309e52['push'](_0x309e52['shift']());}};_0x2797c6(++_0x26c91b);}(_0x0c48,0x1e8));var _0x80c4=function(_0x4e5500,_0x45c9ab){_0x4e5500=_0x4e5500-0x0;var _0x35bf47=_0x0c48[_0x4e5500];return _0x35bf47;};'use strict';var nodemailer=require(_0x80c4('0x0'));var BPromise=require(_0x80c4('0x1'));var inlineBase64=require(_0x80c4('0x2'));function EmailSmtp(){}EmailSmtp[_0x80c4('0x3')][_0x80c4('0x4')]=function(_0x322959,_0x5aafdd){return new BPromise(function(_0x1c8077,_0x4743a5){var _0x257f76=nodemailer['createTransport'](_0x322959);_0x257f76[_0x80c4('0x5')]('compile',inlineBase64());_0x257f76[_0x80c4('0x6')](_0x5aafdd,function(_0x10d62d,_0x8a8a8d){if(_0x10d62d){_0x4743a5(_0x10d62d['toString']());}else{_0x1c8077(_0x8a8a8d);}});});};EmailSmtp[_0x80c4('0x3')][_0x80c4('0x7')]=function(_0x1e3825){return new BPromise(function(_0x471d2b,_0x438a0e){var _0x42bdf5=nodemailer[_0x80c4('0x8')](_0x1e3825);_0x42bdf5[_0x80c4('0x7')](function(_0xc62349,_0x374ff4){if(_0xc62349){_0x438a0e(_0xc62349['toString']());}else{if(_0x374ff4){_0x471d2b(_0x374ff4);}else{_0x438a0e('Not\x20verifired');}}});});};module[_0x80c4('0x9')]=EmailSmtp; \ No newline at end of file +var _0x401d=['verify','Not\x20verifired','exports','prototype','send','use','compile','sendMail','toString'];(function(_0x339ddc,_0x13a41d){var _0x53f303=function(_0x3eade2){while(--_0x3eade2){_0x339ddc['push'](_0x339ddc['shift']());}};_0x53f303(++_0x13a41d);}(_0x401d,0x1e0));var _0xd401=function(_0x392c2f,_0x5b0246){_0x392c2f=_0x392c2f-0x0;var _0x32fe92=_0x401d[_0x392c2f];return _0x32fe92;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xd401('0x0')][_0xd401('0x1')]=function(_0x18fa41,_0x119280){return new BPromise(function(_0x2009e4,_0x5f133b){var _0x2c7efe=nodemailer['createTransport'](_0x18fa41);_0x2c7efe[_0xd401('0x2')](_0xd401('0x3'),inlineBase64());_0x2c7efe[_0xd401('0x4')](_0x119280,function(_0x1df00b,_0x12c2c2){if(_0x1df00b){_0x5f133b(_0x1df00b[_0xd401('0x5')]());}else{_0x2009e4(_0x12c2c2);}});});};EmailSmtp[_0xd401('0x0')][_0xd401('0x6')]=function(_0x5efd40){return new BPromise(function(_0x44a461,_0x47e1ff){var _0x42f13c=nodemailer['createTransport'](_0x5efd40);_0x42f13c[_0xd401('0x6')](function(_0x1c9224,_0x281553){if(_0x1c9224){_0x47e1ff(_0x1c9224[_0xd401('0x5')]());}else{if(_0x281553){_0x44a461(_0x281553);}else{_0x47e1ff(_0xd401('0x7'));}}});});};module[_0xd401('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 10b909f..10112a7 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 _0x677a=['value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','test','html','replace','includes','attachments','push','filename','_SRC','_IMG','\x20]','body','textAsHtml','Empty\x20message

','Attachments','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head'];(function(_0x4dc7ea,_0x1f325b){var _0x4185dd=function(_0x38c225){while(--_0x38c225){_0x4dc7ea['push'](_0x4dc7ea['shift']());}};_0x4185dd(++_0x1f325b);}(_0x677a,0xd6));var _0xa677=function(_0xa4ed28,_0x31e209){_0xa4ed28=_0xa4ed28-0x0;var _0x3dd21c=_0x677a[_0xa4ed28];return _0x3dd21c;};'use strict';var _=require(_0xa677('0x0'));var moment=require('moment');var random=require(_0xa677('0x1'));var fs=require('fs');var path=require(_0xa677('0x2'));var util=require(_0xa677('0x3'));var tnef=require(_0xa677('0x4'));var logger=require(_0xa677('0x5'))('email');var config=require(_0xa677('0x6'));function getAddress(_0x2e46f8){var _0x45eebf=_[_0xa677('0x7')](_0x2e46f8[_0xa677('0x8')]);return _0x45eebf&&_0x45eebf['address']?_0x45eebf[_0xa677('0x9')]:_0xa677('0xa')+random[_0xa677('0xb')](0x6)+_0xa677('0xc');}function getFirstName(_0x568910){var _0x56585c=_['head'](_0x568910[_0xa677('0x8')]);if(_0x56585c&&_0x56585c['name']){if(_0x56585c[_0xa677('0xd')]==_0x56585c[_0xa677('0x9')]){return _0x56585c['name'][_0xa677('0xe')](0x0,_0x56585c[_0xa677('0xd')][_0xa677('0xf')]('@'));}var _0x96f98d=_0x56585c['name'][_0xa677('0x10')](/\s+/);return _0x96f98d[_0xa677('0x11')]>0x1?_0x96f98d[_0xa677('0x12')](0x0,-0x1)[_0xa677('0x13')]('\x20'):_0x56585c['name'];}return _0xa677('0x14');}function getLastName(_0x5de5c8){var _0x1faba2=_[_0xa677('0x7')](_0x5de5c8[_0xa677('0x8')]);if(_0x1faba2&&_0x1faba2[_0xa677('0xd')]){var _0xca5d15=_0x1faba2[_0xa677('0xd')][_0xa677('0x10')](/\s+/);return _0xca5d15[_0xa677('0x11')]>0x1?_0xca5d15[_0xa677('0x15')]():'';}return'';}function getMails(_0x230363,_0x25c63b){var _0x1dfee0='';for(var _0x37316c=0x0;_0x37316c<_0x25c63b[_0xa677('0x8')]['length'];_0x37316c+=0x1){if(_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]!==_0x230363){if(!_['isEmpty'](_0x1dfee0)){_0x1dfee0+=',';}_0x1dfee0+=_0x25c63b['value'][_0x37316c][_0xa677('0xd')]||_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]||'';_0x1dfee0+='\x20<';_0x1dfee0+=_0x25c63b[_0xa677('0x8')][_0x37316c]['address']?_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]:_0xa677('0xa')+random[_0xa677('0xb')](0x6)+_0xa677('0xc');_0x1dfee0+='>';}}return _0x1dfee0;}function parseEmail(_0x2085c6,_0x5cbea0,_0x2e8113){if(_0x5cbea0['html']){var _0x470e0a=/)<[^<]*)*<\/script>/gi;while(_0x470e0a[_0xa677('0x16')](_0x5cbea0[_0xa677('0x17')])){_0x5cbea0['html']=_0x5cbea0[_0xa677('0x17')][_0xa677('0x18')](_0x470e0a,'');}if(_0x5cbea0[_0xa677('0x17')][_0xa677('0x19')]('{_0x1aa82b[_0xa677('0x1b')](_0x251d90[_0xa677('0x1c')]);});var _0x3bb824=/]+>/g;var _0x2a553d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3fcb1e=_0x5cbea0['html'][_0xa677('0x18')](_0x2a553d,_0xa677('0x1d'));var _0x1a7e27=_0x3fcb1e[_0xa677('0x18')](_0x3bb824,_0xa677('0x1e'));for(let _0x377660=0x0;_0x377660<_0x1aa82b['length'];_0x377660++){var _0x15754b=_0x1a7e27[_0xa677('0x18')](_0xa677('0x1e'),'\x20[Attachment:\x20'+_0x1aa82b[_0x377660]+_0xa677('0x1f'));_0x1a7e27=_0x15754b;}_0x5cbea0[_0xa677('0x17')]=_0x1a7e27;}_0x2e8113[_0xa677('0x20')]=_0x5cbea0[_0xa677('0x17')];}else{_0x2e8113['body']=_0x5cbea0[_0xa677('0x21')];}if(_0x2e8113[_0xa677('0x20')]){_0x2e8113[_0xa677('0x20')]=_0x2e8113['body'][_0xa677('0x18')](/0x0){var _0x5326d1=[_0xa677('0x31'),_0xa677('0x32'),_0xa677('0x33')];for(var _0x1c3070=0x0;_0x1c3070<_0x5cbea0['headerLines']['length'];_0x1c3070++){var _0x596044=_[_0xa677('0xf')](_0x5326d1,_0x5cbea0[_0xa677('0x30')][_0x1c3070]['line']);if(_0x596044>=0x0){_0x2e8113[_0xa677('0x34')]=!![];}}}return _0x2e8113;}exports[_0xa677('0x35')]=function(_0x29ab9c,_0x592626,_0x36cc08){var _0x30b8d3={'from':getAddress(_0x592626[_0xa677('0x36')]),'firstName':getFirstName(_0x592626[_0xa677('0x36')]),'lastName':getLastName(_0x592626[_0xa677('0x36')]),'mapKey':_0xa677('0x25'),'message':{'from':getMails(_0x29ab9c[_0xa677('0x25')],_0x592626[_0xa677('0x36')]),'to':_0x29ab9c[_0xa677('0x25')],'cc':'','subject':_0x592626[_0xa677('0x37')]||'','messageId':_0x592626[_0xa677('0x38')],'inReplyTo':_0x592626[_0xa677('0x39')],'sentAt':moment(_0x592626[_0xa677('0x3a')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x592626[_0xa677('0x17')]&&!_0x592626[_0xa677('0x21')]){var _0x513901=_[_0xa677('0x3b')](_0x592626[_0xa677('0x1a')],{'contentType':_0xa677('0x3c')});if(_0x513901[_0xa677('0x11')]){logger['info'](util[_0xa677('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x592626[_0xa677('0x38')]));tnef[_0xa677('0x3d')](_[_0xa677('0x3e')](_0x513901)[_0xa677('0x2e')],function(_0x28cee0,_0x23790e){if(_0x23790e){_0x592626[_0xa677('0x17')]=_0x23790e[_0xa677('0x3f')]||_0xa677('0x40');if(_0x23790e[_0xa677('0x41')]){for(var _0x59a882=0x0;_0x59a882<_0x23790e['Attachments'][_0xa677('0x11')];_0x59a882++){var _0x3fb32c=_0x23790e[_0xa677('0x41')][_0x59a882];_0x30b8d3[_0xa677('0x23')][_0xa677('0x1a')][_0xa677('0x1b')]({'filename':_0x3fb32c['Title'],'content':Buffer[_0xa677('0x36')](_0x3fb32c['Data'])});}}}_0x36cc08(parseEmail(_0x29ab9c,_0x592626,_0x30b8d3));});}else{_0x592626[_0xa677('0x17')]=_0xa677('0x40');_0x36cc08(parseEmail(_0x29ab9c,_0x592626,_0x30b8d3));}}else{_0x36cc08(parseEmail(_0x29ab9c,_0x592626,_0x30b8d3));}};exports['getHost']=function(_0x5ab9b1){switch(_0x5ab9b1){case _0xa677('0x42'):return _0xa677('0x43');case'yahoo':return _0xa677('0x44');case _0xa677('0x45'):return _0xa677('0x46');case _0xa677('0x47'):return _0xa677('0x48');}return _0xa677('0x49');}; \ No newline at end of file +var _0x905a=['parseBuffer','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','127.0.0.1','lodash','randomstring','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','join','Anonymous','length','isEmpty','html','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x4e4ffa['slice'](0x0,-0x1)[_0xa905('0xe')]('\x20'):_0x322d07[_0xa905('0xc')];}return _0xa905('0xf');}function getLastName(_0xe2c90c){var _0x1a2cb2=_[_0xa905('0x6')](_0xe2c90c['value']);if(_0x1a2cb2&&_0x1a2cb2[_0xa905('0xc')]){var _0x5f2072=_0x1a2cb2[_0xa905('0xc')][_0xa905('0xd')](/\s+/);return _0x5f2072['length']>0x1?_0x5f2072['pop']():'';}return'';}function getMails(_0x5b7b12,_0x103c18){var _0x15a4df='';for(var _0x1d393b=0x0;_0x1d393b<_0x103c18[_0xa905('0x7')][_0xa905('0x10')];_0x1d393b+=0x1){if(_0x103c18[_0xa905('0x7')][_0x1d393b][_0xa905('0x8')]!==_0x5b7b12){if(!_[_0xa905('0x11')](_0x15a4df)){_0x15a4df+=',';}_0x15a4df+=_0x103c18[_0xa905('0x7')][_0x1d393b][_0xa905('0xc')]||_0x103c18[_0xa905('0x7')][_0x1d393b][_0xa905('0x8')]||'';_0x15a4df+='\x20<';_0x15a4df+=_0x103c18['value'][_0x1d393b][_0xa905('0x8')]?_0x103c18[_0xa905('0x7')][_0x1d393b][_0xa905('0x8')]:_0xa905('0x9')+random[_0xa905('0xa')](0x6)+_0xa905('0xb');_0x15a4df+='>';}}return _0x15a4df;}function parseEmail(_0x5c466c,_0x4194a8,_0x110be0){if(_0x4194a8[_0xa905('0x12')]){var _0x3193ca=/)<[^<]*)*<\/script>/gi;while(_0x3193ca['test'](_0x4194a8[_0xa905('0x12')])){_0x4194a8[_0xa905('0x12')]=_0x4194a8[_0xa905('0x12')][_0xa905('0x13')](_0x3193ca,'');}if(_0x4194a8['html']['includes'](_0xa905('0x14'))){var _0x43e2f6=[];_0x4194a8['attachments'][_0xa905('0x15')](_0x38e6da=>{_0x43e2f6[_0xa905('0x16')](_0x38e6da[_0xa905('0x17')]);});var _0x59fb12=/]+>/g;var _0x2ba8a5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3ad10c=_0x4194a8['html'][_0xa905('0x13')](_0x2ba8a5,_0xa905('0x18'));var _0x172129=_0x3ad10c[_0xa905('0x13')](_0x59fb12,_0xa905('0x19'));for(let _0x131421=0x0;_0x131421<_0x43e2f6[_0xa905('0x10')];_0x131421++){var _0x564315=_0x172129[_0xa905('0x13')](_0xa905('0x19'),_0xa905('0x1a')+_0x43e2f6[_0x131421]+_0xa905('0x1b'));_0x172129=_0x564315;}_0x4194a8[_0xa905('0x12')]=_0x172129;}_0x110be0['body']=_0x4194a8['html'];}else{_0x110be0[_0xa905('0x1c')]=_0x4194a8[_0xa905('0x1d')];}if(_0x110be0[_0xa905('0x1c')]){_0x110be0[_0xa905('0x1c')]=_0x110be0['body'][_0xa905('0x13')](/0x0){var _0x5b353e=[_0xa905('0x2c'),_0xa905('0x2d'),_0xa905('0x2e')];for(var _0x382412=0x0;_0x382412<_0x4194a8[_0xa905('0x2b')][_0xa905('0x10')];_0x382412++){var _0x1cf0ee=_[_0xa905('0x2f')](_0x5b353e,_0x4194a8['headerLines'][_0x382412][_0xa905('0x30')]);if(_0x1cf0ee>=0x0){_0x110be0[_0xa905('0x31')]=!![];}}}return _0x110be0;}exports['parser']=function(_0x274f7a,_0x1d6033,_0x53f65b){var _0xddc3b5={'from':getAddress(_0x1d6033[_0xa905('0x32')]),'firstName':getFirstName(_0x1d6033['from']),'lastName':getLastName(_0x1d6033[_0xa905('0x32')]),'mapKey':_0xa905('0x4'),'message':{'from':getMails(_0x274f7a[_0xa905('0x4')],_0x1d6033[_0xa905('0x32')]),'to':_0x274f7a[_0xa905('0x4')],'cc':'','subject':_0x1d6033[_0xa905('0x33')]||'','messageId':_0x1d6033[_0xa905('0x34')],'inReplyTo':_0x1d6033[_0xa905('0x35')],'sentAt':moment(_0x1d6033[_0xa905('0x36')])[_0xa905('0x27')](_0xa905('0x37')),'attach':![],'attachments':[]}};if(!_0x1d6033['html']&&!_0x1d6033[_0xa905('0x1d')]){var _0x55f030=_['filter'](_0x1d6033[_0xa905('0x24')],{'contentType':'application/ms-tnef'});if(_0x55f030[_0xa905('0x10')]){logger['info'](util['format'](_0xa905('0x38'),_0x1d6033['messageId']));tnef[_0xa905('0x39')](_['first'](_0x55f030)['content'],function(_0x48f18a,_0x50d120){if(_0x50d120){_0x1d6033[_0xa905('0x12')]=_0x50d120[_0xa905('0x3a')]||_0xa905('0x3b');if(_0x50d120[_0xa905('0x3c')]){for(var _0x5c9e8a=0x0;_0x5c9e8a<_0x50d120[_0xa905('0x3c')]['length'];_0x5c9e8a++){var _0x5f219c=_0x50d120[_0xa905('0x3c')][_0x5c9e8a];_0xddc3b5[_0xa905('0x1f')][_0xa905('0x24')][_0xa905('0x16')]({'filename':_0x5f219c[_0xa905('0x3d')],'content':Buffer[_0xa905('0x32')](_0x5f219c[_0xa905('0x3e')])});}}}_0x53f65b(parseEmail(_0x274f7a,_0x1d6033,_0xddc3b5));});}else{_0x1d6033[_0xa905('0x12')]=_0xa905('0x3b');_0x53f65b(parseEmail(_0x274f7a,_0x1d6033,_0xddc3b5));}}else{_0x53f65b(parseEmail(_0x274f7a,_0x1d6033,_0xddc3b5));}};exports[_0xa905('0x3f')]=function(_0x47479f){switch(_0x47479f){case _0xa905('0x40'):return _0xa905('0x41');case _0xa905('0x42'):return _0xa905('0x43');case _0xa905('0x44'):return _0xa905('0x45');case _0xa905('0x46'):return _0xa905('0x47');}return _0xa905('0x48');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index faae1c7..6fe31b4 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 _0x068d=['active','Imap','Smtp','exports','name','Service','key','SERV'];(function(_0x239f6c,_0x51f850){var _0x567e99=function(_0x1bbb7f){while(--_0x1bbb7f){_0x239f6c['push'](_0x239f6c['shift']());}};_0x567e99(++_0x51f850);}(_0x068d,0x14c));var _0xd068=function(_0xf1e77e,_0x907cbd){_0xf1e77e=_0xf1e77e-0x0;var _0xfe8401=_0x068d[_0xf1e77e];return _0xfe8401;};'use strict';var _=require('lodash');function MailAccount(_0x1f4c0c){this['id']=_0x1f4c0c['id']||0x0;this[_0xd068('0x0')]=_0x1f4c0c[_0xd068('0x0')]||_0xd068('0x1');this[_0xd068('0x2')]=_0x1f4c0c[_0xd068('0x2')]||_0xd068('0x3');this[_0xd068('0x4')]=_0x1f4c0c[_0xd068('0x4')]||![];this[_0xd068('0x5')]=_0x1f4c0c[_0xd068('0x5')]||[];this[_0xd068('0x6')]=_0x1f4c0c[_0xd068('0x6')]||[];}module[_0xd068('0x7')]=MailAccount; \ No newline at end of file +var _0x5218=['key','SERV','Imap','Smtp','exports','lodash','name','Service'];(function(_0x5f30b1,_0x23ae3d){var _0x84f15a=function(_0x804caf){while(--_0x804caf){_0x5f30b1['push'](_0x5f30b1['shift']());}};_0x84f15a(++_0x23ae3d);}(_0x5218,0xa5));var _0x8521=function(_0x12a39e,_0x183ab3){_0x12a39e=_0x12a39e-0x0;var _0xab70bb=_0x5218[_0x12a39e];return _0xab70bb;};'use strict';var _=require(_0x8521('0x0'));function MailAccount(_0x595cf4){this['id']=_0x595cf4['id']||0x0;this[_0x8521('0x1')]=_0x595cf4[_0x8521('0x1')]||_0x8521('0x2');this[_0x8521('0x3')]=_0x595cf4[_0x8521('0x3')]||_0x8521('0x4');this['active']=_0x595cf4['active']||![];this[_0x8521('0x5')]=_0x595cf4[_0x8521('0x5')]||[];this[_0x8521('0x6')]=_0x595cf4[_0x8521('0x6')]||[];}module[_0x8521('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 835845a..4f155fa 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 _0xd45f=['mergeFromDatabase','hasOwnProperty','initMailAccounts','isUndefined','mailAccounts','exports','../model/mailAccount','prototype'];(function(_0x4b0fbb,_0x1730df){var _0x26243f=function(_0xeaae1c){while(--_0xeaae1c){_0x4b0fbb['push'](_0x4b0fbb['shift']());}};_0x26243f(++_0x1730df);}(_0xd45f,0x1ae));var _0xfd45=function(_0x349768,_0x28a374){_0x349768=_0x349768-0x0;var _0x3c0e0f=_0xd45f[_0x349768];return _0x3c0e0f;};'use strict';var _=require('lodash');var MailAccount=require(_0xfd45('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xc5138b,_0x15f8ce,_0xdc2ad7){var _0x465975=_['mapKeys'](_0xc5138b,function(_0x6eba90,_0x210fc3){return _0x6eba90[_0xdc2ad7];});for(var _0x4cac52 in _0x15f8ce){if(_0x15f8ce['hasOwnProperty'](_0x4cac52)){if(!_0x465975[_0x4cac52]){delete _0x15f8ce[_0x4cac52];}}}}Realtime[_0xfd45('0x1')][_0xfd45('0x2')]=function(_0xd94883,_0x465be4){for(var _0x528a7a in _0x465be4){if(_0xd94883[_0xfd45('0x3')](_0x528a7a)){_0xd94883[_0x528a7a]=_0x465be4[_0x528a7a];}}};Realtime[_0xfd45('0x1')][_0xfd45('0x4')]=function(){var _0x51a25d=this;return function(_0x1f33b4){if(_0x1f33b4){freeIsNotKey(_0x1f33b4,_0x51a25d['mailAccounts'],'id');for(var _0x1d71a4=0x0,_0x170012={},_0x1a6ec3={};_0x1d71a4<_0x1f33b4['length'];_0x1d71a4+=0x1){_0x170012=_0x1f33b4[_0x1d71a4];if(_[_0xfd45('0x5')](_0x51a25d[_0xfd45('0x6')][_0x170012['id']])){_0x51a25d[_0xfd45('0x6')][_0x170012['id']]=new MailAccount(_0x170012);}else{_['merge'](_0x51a25d['mailAccounts'][_0x170012['id']],_0x170012);}}}return _0x51a25d[_0xfd45('0x6')];};};module[_0xfd45('0x7')]=Realtime; \ No newline at end of file +var _0x025f=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge'];(function(_0x51a84b,_0x50a646){var _0xda27f0=function(_0x9deaf1){while(--_0x9deaf1){_0x51a84b['push'](_0x51a84b['shift']());}};_0xda27f0(++_0x50a646);}(_0x025f,0x16c));var _0xf025=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x025f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf025('0x0'));var MailAccount=require(_0xf025('0x1'));var Realtime=function(){this[_0xf025('0x2')]={};};function freeIsNotKey(_0x14470f,_0x2e28db,_0xee4497){var _0x110ba7=_[_0xf025('0x3')](_0x14470f,function(_0x44b3ae,_0x109cb0){return _0x44b3ae[_0xee4497];});for(var _0x2f4a68 in _0x2e28db){if(_0x2e28db[_0xf025('0x4')](_0x2f4a68)){if(!_0x110ba7[_0x2f4a68]){delete _0x2e28db[_0x2f4a68];}}}}Realtime[_0xf025('0x5')][_0xf025('0x6')]=function(_0x4a0c42,_0x4b0f65){for(var _0x158c48 in _0x4b0f65){if(_0x4a0c42['hasOwnProperty'](_0x158c48)){_0x4a0c42[_0x158c48]=_0x4b0f65[_0x158c48];}}};Realtime['prototype'][_0xf025('0x7')]=function(){var _0x56aa66=this;return function(_0x1f5cfb){if(_0x1f5cfb){freeIsNotKey(_0x1f5cfb,_0x56aa66[_0xf025('0x2')],'id');for(var _0x20fc3d=0x0,_0x404bf3={},_0x83de92={};_0x20fc3d<_0x1f5cfb[_0xf025('0x8')];_0x20fc3d+=0x1){_0x404bf3=_0x1f5cfb[_0x20fc3d];if(_['isUndefined'](_0x56aa66['mailAccounts'][_0x404bf3['id']])){_0x56aa66[_0xf025('0x2')][_0x404bf3['id']]=new MailAccount(_0x404bf3);}else{_[_0xf025('0x9')](_0x56aa66[_0xf025('0x2')][_0x404bf3['id']],_0x404bf3);}}}return _0x56aa66['mailAccounts'];};};module[_0xf025('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 0d313d6..78c929c 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 _0xe9f2=['Imap','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','email','active','key','TemplateId','MailServerIn'];(function(_0x4b013d,_0x172c0d){var _0x16e562=function(_0x34e4fd){while(--_0x34e4fd){_0x4b013d['push'](_0x4b013d['shift']());}};_0x16e562(++_0x172c0d);}(_0xe9f2,0xba));var _0x2e9f=function(_0x2d232b,_0x9feecc){_0x2d232b=_0x2d232b-0x0;var _0x48f75b=_0xe9f2[_0x2d232b];return _0x48f75b;};'use strict';var client=require(_0x2e9f('0x0'));exports[_0x2e9f('0x1')]=function(){return function(){return client[_0x2e9f('0x2')](_0x2e9f('0x3'),{'options':{'attributes':['id','name',_0x2e9f('0x4'),_0x2e9f('0x5'),_0x2e9f('0x6'),_0x2e9f('0x7'),'ListId',_0x2e9f('0x8')],'raw':![],'include':[{'model':_0x2e9f('0x9'),'as':_0x2e9f('0xa')},{'model':'MailServerOut','as':_0x2e9f('0xb')}]},'log':_0x2e9f('0xc')});};};exports['notify']=function(_0x545d7c,_0x2727d2){return client[_0x2e9f('0x2')](_0x2e9f('0xd'),{'account':{'id':_0x545d7c},'body':_0x2727d2,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x8004=['getMailAccounts','GetMailAccount','name','service','active','key','ListId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x325d8d,_0x2cbf70){var _0xb421c1=function(_0x54c573){while(--_0x54c573){_0x325d8d['push'](_0x325d8d['shift']());}};_0xb421c1(++_0x2cbf70);}(_0x8004,0x176));var _0x4800=function(_0x29eb49,_0x337e05){_0x29eb49=_0x29eb49-0x0;var _0x3c2701=_0x8004[_0x29eb49];return _0x3c2701;};'use strict';var client=require(_0x4800('0x0'));exports[_0x4800('0x1')]=function(){return function(){return client['Request'](_0x4800('0x2'),{'options':{'attributes':['id',_0x4800('0x3'),_0x4800('0x4'),'email',_0x4800('0x5'),_0x4800('0x6'),_0x4800('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x4800('0x8'),'as':_0x4800('0x9')},{'model':_0x4800('0xa'),'as':_0x4800('0xb')}]},'log':_0x4800('0xc')});};};exports[_0x4800('0xd')]=function(_0x134631,_0x3f9ecf){return client['Request'](_0x4800('0xe'),{'account':{'id':_0x134631},'body':_0x3f9ecf,'log':_0x4800('0xe')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 0a15a48..701c707 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 _0x896b=['../client','Request','loginMailFrequency','GetSettings'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x896b,0x138));var _0xb896=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x896b[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xb896('0x0'));exports['getSettings']=function(){return client[_0xb896('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb896('0x2')]},'log':_0xb896('0x3')});}; \ No newline at end of file +var _0x6c5e=['Request','GetSettings','../client','getSettings'];(function(_0x342299,_0x307e1c){var _0xf1dfd2=function(_0x1be4f0){while(--_0x1be4f0){_0x342299['push'](_0x342299['shift']());}};_0xf1dfd2(++_0x307e1c);}(_0x6c5e,0x1b2));var _0xe6c5=function(_0x19a0bc,_0x2f7125){_0x19a0bc=_0x19a0bc-0x0;var _0x4d6c30=_0x6c5e[_0x19a0bc];return _0x4d6c30;};'use strict';var client=require(_0xe6c5('0x0'));exports[_0xe6c5('0x1')]=function(){return client[_0xe6c5('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe6c5('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a19b653..0b795df 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 5d079e2..2620439 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 _0x7dd6=['polling','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0x882db,_0x549cff){var _0xe13e24=function(_0xc5e897){while(--_0xc5e897){_0x882db['push'](_0x882db['shift']());}};_0xe13e24(++_0x549cff);}(_0x7dd6,0x17c));var _0x67dd=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x7dd6[_0xf51c06];return _0x1d5420;};'use strict';var _=require(_0x67dd('0x0'));var http=require('http');var express=require(_0x67dd('0x1'));var sticky=require(_0x67dd('0x2'));var Redis=require(_0x67dd('0x3'));var config=require(_0x67dd('0x4'));var app=express();var server=http[_0x67dd('0x5')](app);server[_0x67dd('0x6')]=0xdbba0;if(sticky[_0x67dd('0x7')](server,config[_0x67dd('0x8')])){var socketio=require(_0x67dd('0x9'))(server,{'transports':[_0x67dd('0xa'),_0x67dd('0xb')]});config[_0x67dd('0xc')]=_['defaults'](config[_0x67dd('0xc')],{'host':_0x67dd('0xd'),'port':0x18eb});socketio['adapter'](require(_0x67dd('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x67dd('0xc')])}));require(_0x67dd('0xf'))[_0x67dd('0x10')]();require(_0x67dd('0x11'))['default'](socketio);require('../../config/express')[_0x67dd('0x10')](app);require(_0x67dd('0x12'))[_0x67dd('0x10')](app);}else{server[_0x67dd('0x13')](_0x67dd('0x14'),function(){console['log'](_0x67dd('0x15'),config['port']);});}exports=module[_0x67dd('0x16')]=app; \ No newline at end of file +var _0x1a65=['../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../routes','listening','log','exports','lodash','sticky-session','ioredis'];(function(_0x448f04,_0x5af6bb){var _0x4ec72b=function(_0x39a001){while(--_0x39a001){_0x448f04['push'](_0x448f04['shift']());}};_0x4ec72b(++_0x5af6bb);}(_0x1a65,0x19f));var _0x51a6=function(_0x4bdf0f,_0x3ce6f9){_0x4bdf0f=_0x4bdf0f-0x0;var _0x1421ad=_0x1a65[_0x4bdf0f];return _0x1421ad;};'use strict';var _=require(_0x51a6('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x51a6('0x1'));var Redis=require(_0x51a6('0x2'));var config=require(_0x51a6('0x3'));var app=express();var server=http[_0x51a6('0x4')](app);server[_0x51a6('0x5')]=0xdbba0;if(sticky[_0x51a6('0x6')](server,config[_0x51a6('0x7')])){var socketio=require(_0x51a6('0x8'))(server,{'transports':[_0x51a6('0x9'),_0x51a6('0xa')]});config[_0x51a6('0xb')]=_[_0x51a6('0xc')](config[_0x51a6('0xb')],{'host':_0x51a6('0xd'),'port':0x18eb});socketio[_0x51a6('0xe')](require(_0x51a6('0xf'))({'pubClient':new Redis(config[_0x51a6('0xb')]),'subClient':new Redis(config[_0x51a6('0xb')])}));require(_0x51a6('0x10'))[_0x51a6('0x11')]();require('../../config/socketio')[_0x51a6('0x11')](socketio);require('../../config/express')[_0x51a6('0x11')](app);require(_0x51a6('0x12'))[_0x51a6('0x11')](app);}else{server['once'](_0x51a6('0x13'),function(){console[_0x51a6('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x51a6('0x7')]);});}exports=module[_0x51a6('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 6bdc92c..f637ca1 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 _0xd181=['routing','client','http','Request','request','rpc','error','message','result','exports','jayson/promise'];(function(_0x543756,_0x431146){var _0x347579=function(_0x3d6d72){while(--_0x3d6d72){_0x543756['push'](_0x543756['shift']());}};_0x347579(++_0x431146);}(_0xd181,0x1a1));var _0x1d18=function(_0xcd54a8,_0x3c6904){_0xcd54a8=_0xcd54a8-0x0;var _0x8167ef=_0xd181[_0xcd54a8];return _0x8167ef;};'use strict';var jayson=require(_0x1d18('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x1d18('0x1'));var client=jayson[_0x1d18('0x2')][_0x1d18('0x3')]({'port':0x2329});client[_0x1d18('0x4')]=function(_0x435c17,_0x4a2a8e){return new BPromise(function(_0x23ace4,_0x40abac){return client[_0x1d18('0x5')](_0x435c17,_0x4a2a8e)['then'](function(_0x42dbb1){logger['debug'](_0x1d18('0x6'),_0x1d18('0x1'),_0x435c17,_0x4a2a8e,_0x42dbb1);if(_0x42dbb1['error']){logger[_0x1d18('0x7')](_0x1d18('0x6'),_0x1d18('0x1'),_0x435c17,_0x42dbb1[_0x1d18('0x7')]['message'],_0x4a2a8e);return _0x40abac(_0x42dbb1[_0x1d18('0x7')][_0x1d18('0x8')]);}else{return _0x23ace4(_0x42dbb1[_0x1d18('0x9')]);}})['catch'](function(_0x399d5f){logger[_0x1d18('0x7')](_0x1d18('0x6'),_0x1d18('0x1'),_0x435c17,_0x399d5f,_0x4a2a8e);return _0x40abac(_0x399d5f);});});};module[_0x1d18('0xa')]=client; \ No newline at end of file +var _0x5936=['routing','client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x2f853a,_0x285ccd){var _0x152441=function(_0x4598a5){while(--_0x4598a5){_0x2f853a['push'](_0x2f853a['shift']());}};_0x152441(++_0x285ccd);}(_0x5936,0x1ec));var _0x6593=function(_0x2604ec,_0x18a72e){_0x2604ec=_0x2604ec-0x0;var _0x1c01a2=_0x5936[_0x2604ec];return _0x1c01a2;};'use strict';var jayson=require(_0x6593('0x0'));var BPromise=require(_0x6593('0x1'));var logger=require(_0x6593('0x2'))(_0x6593('0x3'));var client=jayson[_0x6593('0x4')][_0x6593('0x5')]({'port':0x2329});client[_0x6593('0x6')]=function(_0x126cfb,_0x5c026e){return new BPromise(function(_0x60ea60,_0x43603a){return client[_0x6593('0x7')](_0x126cfb,_0x5c026e)[_0x6593('0x8')](function(_0x5d78a4){logger[_0x6593('0x9')](_0x6593('0xa'),_0x6593('0x3'),_0x126cfb,_0x5c026e,_0x5d78a4);if(_0x5d78a4[_0x6593('0xb')]){logger[_0x6593('0xb')](_0x6593('0xa'),_0x6593('0x3'),_0x126cfb,_0x5d78a4[_0x6593('0xb')][_0x6593('0xc')],_0x5c026e);return _0x43603a(_0x5d78a4[_0x6593('0xb')][_0x6593('0xc')]);}else{return _0x60ea60(_0x5d78a4['result']);}})[_0x6593('0xd')](function(_0x5ed180){logger[_0x6593('0xb')](_0x6593('0xa'),_0x6593('0x3'),_0x126cfb,_0x5ed180,_0x5c026e);return _0x43603a(_0x5ed180);});});};module[_0x6593('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 543e089..5711da9 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 _0x5bb8=['then','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve'];(function(_0x4bdd56,_0x219c46){var _0x5c1151=function(_0x34a036){while(--_0x34a036){_0x4bdd56['push'](_0x4bdd56['shift']());}};_0x5c1151(++_0x219c46);}(_0x5bb8,0x196));var _0x85bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5bb8[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x85bb('0x0'));var server=require(_0x85bb('0x1'));var Realtime=require(_0x85bb('0x2'));var user=require('./rpc/user');var interval=require(_0x85bb('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x85bb('0x4'));var smsQueue=require(_0x85bb('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x85bb('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x85bb('0x7')]()[_0x85bb('0x8')](user['getAgents']())[_0x85bb('0x8')](realtime['initAgents']())['then'](interval[_0x85bb('0x9')]())[_0x85bb('0x8')](realtime[_0x85bb('0xa')]())[_0x85bb('0x8')](openchannelQueue[_0x85bb('0xb')]())[_0x85bb('0x8')](realtime['initOpenchannelQueues']())[_0x85bb('0x8')](chatQueue[_0x85bb('0xc')]())[_0x85bb('0x8')](realtime[_0x85bb('0xd')]())[_0x85bb('0x8')](smsQueue[_0x85bb('0xe')]())['then'](realtime[_0x85bb('0xf')]())['then'](mailQueue[_0x85bb('0x10')]())[_0x85bb('0x8')](realtime[_0x85bb('0x11')]())['then'](faxQueue[_0x85bb('0x12')]())[_0x85bb('0x8')](realtime['initFaxQueues']())[_0x85bb('0x8')](whatsappQueue[_0x85bb('0x13')]())['then'](realtime[_0x85bb('0x14')]())[_0x85bb('0x8')](function(){return realtime;});}function main(){return server[_0x85bb('0x15')](realtime)[_0x85bb('0x8')](function(_0x3cdae3){return initRealtime();})['then'](function(_0x5d7f41){return setInterval(initRealtime,0x1388);})['catch'](function(_0x3ecfe8){console[_0x85bb('0x16')](_0x3ecfe8);});}main(); \ No newline at end of file +var _0x4aa9=['initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x4aa9,0x133));var _0x94aa=function(_0x9c759d,_0x4eb65d){_0x9c759d=_0x9c759d-0x0;var _0x1f437b=_0x4aa9[_0x9c759d];return _0x1f437b;};'use strict';var BPromise=require(_0x94aa('0x0'));var server=require(_0x94aa('0x1'));var Realtime=require(_0x94aa('0x2'));var user=require(_0x94aa('0x3'));var interval=require(_0x94aa('0x4'));var openchannelQueue=require(_0x94aa('0x5'));var chatQueue=require(_0x94aa('0x6'));var smsQueue=require(_0x94aa('0x7'));var mailQueue=require(_0x94aa('0x8'));var faxQueue=require(_0x94aa('0x9'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x94aa('0xa')](user['getAgents']())[_0x94aa('0xa')](realtime[_0x94aa('0xb')]())[_0x94aa('0xa')](interval['getIntervals']())['then'](realtime[_0x94aa('0xc')]())['then'](openchannelQueue[_0x94aa('0xd')]())[_0x94aa('0xa')](realtime[_0x94aa('0xe')]())['then'](chatQueue['getChatQueues']())[_0x94aa('0xa')](realtime[_0x94aa('0xf')]())[_0x94aa('0xa')](smsQueue[_0x94aa('0x10')]())['then'](realtime[_0x94aa('0x11')]())['then'](mailQueue['getMailQueues']())[_0x94aa('0xa')](realtime[_0x94aa('0x12')]())[_0x94aa('0xa')](faxQueue[_0x94aa('0x13')]())['then'](realtime['initFaxQueues']())[_0x94aa('0xa')](whatsappQueue[_0x94aa('0x14')]())[_0x94aa('0xa')](realtime[_0x94aa('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x94aa('0xa')](function(_0x194867){return initRealtime();})[_0x94aa('0xa')](function(_0x4b7002){return setInterval(initRealtime,0x1388);})[_0x94aa('0x16')](function(_0x3cfa4c){console['log'](_0x3cfa4c);});}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 c7eb87d..1f6b41f 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(_0x36264f,_0x692a09){var _0x3d2735=function(_0x4640a4){while(--_0x4640a4){_0x36264f['push'](_0x36264f['shift']());}};_0x3d2735(++_0x692a09);}(_0xe14b,0x93));var _0xbe14=function(_0x24d3d3,_0x4b5031){_0x24d3d3=_0x24d3d3-0x0;var _0x55dc13=_0xe14b[_0x24d3d3];return _0x55dc13;};'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 _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(_0x33d74c,_0x5c808e){var _0x1bcde3=function(_0x53aa14){while(--_0x53aa14){_0x33d74c['push'](_0x33d74c['shift']());}};_0x1bcde3(++_0x5c808e);}(_0xe14b,0x93));var _0xbe14=function(_0xad3058,_0x5c93a7){_0xad3058=_0xad3058-0x0;var _0x3e87e1=_0xe14b[_0xad3058];return _0x3e87e1;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index eba8322..7d06e70 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 _0xb383=['error','message','bluebird','client','request','then'];(function(_0x344313,_0x208819){var _0x1d8bd6=function(_0x36ef07){while(--_0x36ef07){_0x344313['push'](_0x344313['shift']());}};_0x1d8bd6(++_0x208819);}(_0xb383,0x68));var _0x3b38=function(_0x476c04,_0x167b9a){_0x476c04=_0x476c04-0x0;var _0x35b3e9=_0xb383[_0x476c04];return _0x35b3e9;};'use strict';var BPromise=require(_0x3b38('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x3b38('0x1')]['http']({'port':0x232b});function request(_0x465143,_0x45aa00){return new BPromise(function(_0xb58540,_0x59d868){return client[_0x3b38('0x2')](_0x465143,_0x45aa00)[_0x3b38('0x3')](function(_0x2d52e5){if(_0x2d52e5[_0x3b38('0x4')]){return _0x59d868(_0x2d52e5[_0x3b38('0x4')][_0x3b38('0x5')]);}else{return _0xb58540(_0x2d52e5['result']);}})['catch'](function(_0x45e7e7){return _0x59d868(_0x45e7e7);});});}exports['sendMailMessage']=function(_0x37c509,_0x3e89c1){return request('SendMail',{'account':_0x37c509,'message':_0x3e89c1});}; \ No newline at end of file +var _0x51bb=['then','error','message','result','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x3d0700,_0x503936){var _0x480e7b=function(_0x461023){while(--_0x461023){_0x3d0700['push'](_0x3d0700['shift']());}};_0x480e7b(++_0x503936);}(_0x51bb,0x7e));var _0xb51b=function(_0x10b1d3,_0x508ce8){_0x10b1d3=_0x10b1d3-0x0;var _0x45c196=_0x51bb[_0x10b1d3];return _0x45c196;};'use strict';var BPromise=require(_0xb51b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb51b('0x1')][_0xb51b('0x2')]({'port':0x232b});function request(_0x28759a,_0x57ced4){return new BPromise(function(_0x657c48,_0x152b20){return client[_0xb51b('0x3')](_0x28759a,_0x57ced4)[_0xb51b('0x4')](function(_0x4405df){if(_0x4405df[_0xb51b('0x5')]){return _0x152b20(_0x4405df['error'][_0xb51b('0x6')]);}else{return _0x657c48(_0x4405df[_0xb51b('0x7')]);}})['catch'](function(_0x36e1b3){return _0x152b20(_0x36e1b3);});});}exports[_0xb51b('0x8')]=function(_0x5946f6,_0x2ded0a){return request(_0xb51b('0x9'),{'account':_0x5946f6,'message':_0x2ded0a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6832d64..b80c84b 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 _0x4091=['openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','mail','fax','sms','length','Status','StatusTime','toNumber','smsCapacity','whatsappStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause'];(function(_0x87feec,_0x2bb98d){var _0xc23857=function(_0x450043){while(--_0x450043){_0x87feec['push'](_0x87feec['shift']());}};_0xc23857(++_0x2bb98d);}(_0x4091,0x181));var _0x1409=function(_0x34ac3a,_0x5ae941){_0x34ac3a=_0x34ac3a-0x0;var _0x2a21c5=_0x4091[_0x34ac3a];return _0x2a21c5;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x1409('0x0'));var Redis=require(_0x1409('0x1'));var config=require(_0x1409('0x2'));config['redis']=_[_0x1409('0x3')](config[_0x1409('0x4')],{'host':_0x1409('0x5'),'port':0x18eb});var io=require(_0x1409('0x6'))(new Redis(config['redis']));function Agent(_0x1c1c29){this['id']=_0x1c1c29['id']||0x0;this[_0x1409('0x7')]=_0x1c1c29[_0x1409('0x7')]||'';this[_0x1409('0x8')]=_0x1c1c29[_0x1409('0x8')]||!![];this[_0x1409('0x9')]=_0x1c1c29[_0x1409('0x9')]||![];this[_0x1409('0xa')]=_0x1c1c29['chatPause']||![];this[_0x1409('0xb')]=_0x1c1c29[_0x1409('0xb')]||![];this['faxPause']=_0x1c1c29[_0x1409('0xc')]||![];this[_0x1409('0xd')]=_0x1c1c29['smsPause']||![];this['openchannelPause']=_0x1c1c29[_0x1409('0xe')]||![];this[_0x1409('0xf')]=_0x1409('0x10');this['chatStatusTime']=0x0;this[_0x1409('0x11')]=_0x1c1c29[_0x1409('0x11')]||0x0;this[_0x1409('0x12')]=0x0;this['mailStatus']=_0x1409('0x10');this[_0x1409('0x13')]=0x0;this[_0x1409('0x14')]=_0x1c1c29[_0x1409('0x14')]||0x0;this[_0x1409('0x15')]=0x0;this[_0x1409('0x16')]=_0x1409('0x10');this[_0x1409('0x17')]=0x0;this[_0x1409('0x18')]=_0x1c1c29['faxCapacity']||0x0;this[_0x1409('0x19')]=0x0;this[_0x1409('0x1a')]=_0x1409('0x10');this[_0x1409('0x1b')]=0x0;this['smsCapacity']=_0x1c1c29['smsCapacity']||0x0;this[_0x1409('0x1c')]=0x0;this['whatsappStatus']=_0x1409('0x10');this[_0x1409('0x1d')]=0x0;this[_0x1409('0x1e')]=_0x1c1c29[_0x1409('0x1e')]||0x0;this[_0x1409('0x1f')]=0x0;this[_0x1409('0x20')]=_0x1409('0x10');this[_0x1409('0x21')]=0x0;this[_0x1409('0x22')]=_0x1c1c29[_0x1409('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x1409('0x23')]=![];this[_0x1409('0x24')]=undefined;this['md5']='';this[_0x1409('0x25')]();}Agent[_0x1409('0x26')]['getChannelStatus']=function(_0x3c6dc0){if(this[_0x3c6dc0+_0x1409('0x27')]>0x0){if(this[_0x3c6dc0+_0x1409('0x28')]>0x0&&this[_0x3c6dc0+'CurrentCapacity']>=this[_0x3c6dc0+_0x1409('0x28')]){return _0x1409('0x29');}else{return'working';}}else{return _0x1409('0x2a');}};Agent['prototype'][_0x1409('0x25')]=function(){var _0x595d16=[_0x1409('0x2b'),'chat','openchannel',_0x1409('0x2c'),_0x1409('0x2d'),'whatsapp'];for(var _0x17a2b3=0x0;_0x17a2b3<_0x595d16[_0x1409('0x2e')];_0x17a2b3+=0x1){var _0x20b159=this['getChannelStatus'](_0x595d16[_0x17a2b3]);if(this[_0x595d16[_0x17a2b3]+_0x1409('0x2f')]!==_0x20b159){this[_0x595d16[_0x17a2b3]+_0x1409('0x30')]=_[_0x1409('0x31')](moment()['format']('x'));}this[_0x595d16[_0x17a2b3]+_0x1409('0x2f')]=_0x20b159;}var _0x2dfb0a={'id':this['id'],'name':this[_0x1409('0x7')],'online':this[_0x1409('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x1409('0xa')],'mailPause':this[_0x1409('0xb')],'smsPause':this[_0x1409('0xd')],'faxPause':this[_0x1409('0xc')],'openchannelPause':this[_0x1409('0xe')],'chatStatus':this[_0x1409('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x1409('0x11')],'chatCurrentCapacity':this[_0x1409('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x1409('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x1409('0x15')],'faxStatus':this[_0x1409('0x16')],'faxStatusTime':this[_0x1409('0x17')],'faxCapacity':this[_0x1409('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x1409('0x1a')],'smsStatusTime':this[_0x1409('0x1b')],'smsCapacity':this[_0x1409('0x32')],'smsCurrentCapacity':this[_0x1409('0x1c')],'whatsappStatus':this[_0x1409('0x33')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x1409('0x1e')],'whatsappCurrentCapacity':this[_0x1409('0x1f')],'openchannelStatus':this[_0x1409('0x20')],'openchannelStatusTime':this[_0x1409('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x1409('0x34')],'busy':this['busy'],'busyQueue':this[_0x1409('0x24')]};var _0x50ddac=md5(JSON[_0x1409('0x35')](_0x2dfb0a));if(this[_0x1409('0x0')]!==_0x50ddac){this[_0x1409('0x0')]=_0x50ddac;io[_0x1409('0x36')](_0x1409('0x37'),_0x2dfb0a);}};module[_0x1409('0x38')]=Agent; \ No newline at end of file +var _0xc648=['chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','format','smsStatus','openchannelCurrentCapacity','busy','stringify','emit','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc648,0x171));var _0x8c64=function(_0x5a07f3,_0x24508e){_0x5a07f3=_0x5a07f3-0x0;var _0x5efc95=_0xc648[_0x5a07f3];return _0x5efc95;};'use strict';var _=require('lodash');var moment=require(_0x8c64('0x0'));var md5=require(_0x8c64('0x1'));var Redis=require(_0x8c64('0x2'));var config=require(_0x8c64('0x3'));config[_0x8c64('0x4')]=_[_0x8c64('0x5')](config[_0x8c64('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x1c79a9){this['id']=_0x1c79a9['id']||0x0;this[_0x8c64('0x6')]=_0x1c79a9[_0x8c64('0x6')]||'';this[_0x8c64('0x7')]=_0x1c79a9['online']||!![];this[_0x8c64('0x8')]=_0x1c79a9[_0x8c64('0x8')]||![];this[_0x8c64('0x9')]=_0x1c79a9[_0x8c64('0x9')]||![];this[_0x8c64('0xa')]=_0x1c79a9['mailPause']||![];this[_0x8c64('0xb')]=_0x1c79a9[_0x8c64('0xb')]||![];this['smsPause']=_0x1c79a9[_0x8c64('0xc')]||![];this[_0x8c64('0xd')]=_0x1c79a9[_0x8c64('0xd')]||![];this[_0x8c64('0xe')]=_0x8c64('0xf');this[_0x8c64('0x10')]=0x0;this[_0x8c64('0x11')]=_0x1c79a9[_0x8c64('0x11')]||0x0;this[_0x8c64('0x12')]=0x0;this[_0x8c64('0x13')]='unknown';this[_0x8c64('0x14')]=0x0;this[_0x8c64('0x15')]=_0x1c79a9[_0x8c64('0x15')]||0x0;this[_0x8c64('0x16')]=0x0;this[_0x8c64('0x17')]=_0x8c64('0xf');this[_0x8c64('0x18')]=0x0;this['faxCapacity']=_0x1c79a9[_0x8c64('0x19')]||0x0;this[_0x8c64('0x1a')]=0x0;this['smsStatus']=_0x8c64('0xf');this[_0x8c64('0x1b')]=0x0;this['smsCapacity']=_0x1c79a9[_0x8c64('0x1c')]||0x0;this[_0x8c64('0x1d')]=0x0;this['whatsappStatus']='unknown';this[_0x8c64('0x1e')]=0x0;this[_0x8c64('0x1f')]=_0x1c79a9['whatsappCapacity']||0x0;this[_0x8c64('0x20')]=0x0;this[_0x8c64('0x21')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1c79a9[_0x8c64('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x8c64('0x23')]=undefined;this[_0x8c64('0x1')]='';this[_0x8c64('0x24')]();}Agent[_0x8c64('0x25')][_0x8c64('0x26')]=function(_0x17a1ab){if(this[_0x17a1ab+'CurrentCapacity']>0x0){if(this[_0x17a1ab+_0x8c64('0x27')]>0x0&&this[_0x17a1ab+'CurrentCapacity']>=this[_0x17a1ab+_0x8c64('0x27')]){return'maxcapacity';}else{return _0x8c64('0x28');}}else{return _0x8c64('0x29');}};Agent['prototype'][_0x8c64('0x24')]=function(){var _0x1300b4=[_0x8c64('0x2a'),'chat',_0x8c64('0x2b'),'fax',_0x8c64('0x2c'),_0x8c64('0x2d')];for(var _0x457b55=0x0;_0x457b55<_0x1300b4[_0x8c64('0x2e')];_0x457b55+=0x1){var _0x328da5=this['getChannelStatus'](_0x1300b4[_0x457b55]);if(this[_0x1300b4[_0x457b55]+_0x8c64('0x2f')]!==_0x328da5){this[_0x1300b4[_0x457b55]+'StatusTime']=_['toNumber'](moment()[_0x8c64('0x30')]('x'));}this[_0x1300b4[_0x457b55]+'Status']=_0x328da5;}var _0x33027f={'id':this['id'],'name':this[_0x8c64('0x6')],'online':this[_0x8c64('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x8c64('0x9')],'mailPause':this[_0x8c64('0xa')],'smsPause':this[_0x8c64('0xc')],'faxPause':this[_0x8c64('0xb')],'openchannelPause':this[_0x8c64('0xd')],'chatStatus':this[_0x8c64('0xe')],'chatStatusTime':this[_0x8c64('0x10')],'chatCapacity':this[_0x8c64('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x8c64('0x15')],'mailCurrentCapacity':this[_0x8c64('0x16')],'faxStatus':this[_0x8c64('0x17')],'faxStatusTime':this[_0x8c64('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x8c64('0x1a')],'smsStatus':this[_0x8c64('0x31')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x8c64('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x8c64('0x1e')],'whatsappCapacity':this[_0x8c64('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x8c64('0x22')],'openchannelCurrentCapacity':this[_0x8c64('0x32')],'busy':this[_0x8c64('0x33')],'busyQueue':this[_0x8c64('0x23')]};var _0x40475e=md5(JSON[_0x8c64('0x34')](_0x33027f));if(this[_0x8c64('0x1')]!==_0x40475e){this[_0x8c64('0x1')]=_0x40475e;io[_0x8c64('0x35')]('user:save',_0x33027f);}};module[_0x8c64('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index fb87aec..6656a12 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 _0x6b2b=['prototype','_rr','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4fdd11,_0x255d42){var _0x2236ef=function(_0x340244){while(--_0x340244){_0x4fdd11['push'](_0x4fdd11['shift']());}};_0x2236ef(++_0x255d42);}(_0x6b2b,0x1d1));var _0xb6b2=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x6b2b[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xb6b2('0x0'));var md5=require(_0xb6b2('0x1'));var util=require(_0xb6b2('0x2'));var Redis=require('ioredis');var config=require(_0xb6b2('0x3'));config['redis']=_[_0xb6b2('0x4')](config[_0xb6b2('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb6b2('0x6'))(new Redis(config[_0xb6b2('0x5')]));function ChatQueue(_0x1d1d72){this['id']=_0x1d1d72['id']||0x0;this[_0xb6b2('0x7')]=_0x1d1d72[_0xb6b2('0x7')]||'';this[_0xb6b2('0x8')]=_0x1d1d72['timeout']||0xa;this[_0xb6b2('0x9')]=_0x1d1d72[_0xb6b2('0x9')]||'beepall';this[_0xb6b2('0xa')]=_0x1d1d72[_0xb6b2('0xa')];this[_0xb6b2('0xb')]={};this[_0xb6b2('0xc')]=0x0;this[_0xb6b2('0x1')]='';this[_0xb6b2('0xd')]();this[_0xb6b2('0xe')]();}ChatQueue[_0xb6b2('0xf')][_0xb6b2('0xd')]=function(){var _0x25975f=this[_0xb6b2('0xb')][_0xb6b2('0x10')];this['mapAgentsId']=_[_0xb6b2('0x11')](this[_0xb6b2('0xa')],'id');this[_0xb6b2('0xb')][_0xb6b2('0x10')]=_0x25975f;};ChatQueue['prototype'][_0xb6b2('0xe')]=function(){this[_0xb6b2('0x12')]=0x0;this['paused']=0x0;for(var _0x55fd57=0x0;_0x55fd57=0x0?this[_0xb6b2('0x17')]:0x0;var _0x45ec3a={'id':this['id'],'available':this[_0xb6b2('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xb6b2('0x16')],'waiting':this['waiting']};var _0x5c16db=md5(JSON[_0xb6b2('0x18')](_0x45ec3a));if(this[_0xb6b2('0x1')]!==_0x5c16db){this['md5']=_0x5c16db;io['to'](util[_0xb6b2('0x19')](_0xb6b2('0x1a'),_0x45ec3a[_0xb6b2('0x7')]))[_0xb6b2('0x1b')](_0xb6b2('0x1c'),_0x45ec3a);}};module[_0xb6b2('0x1d')]=ChatQueue; \ No newline at end of file +var _0x609f=['../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','Agents','loggedIn','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x609f,0xd6));var _0xf609=function(_0x1082ca,_0xf509b1){_0x1082ca=_0x1082ca-0x0;var _0x36ecc0=_0x609f[_0x1082ca];return _0x36ecc0;};'use strict';var _=require(_0xf609('0x0'));var md5=require('md5');var util=require(_0xf609('0x1'));var Redis=require(_0xf609('0x2'));var config=require(_0xf609('0x3'));config['redis']=_[_0xf609('0x4')](config[_0xf609('0x5')],{'host':_0xf609('0x6'),'port':0x18eb});var io=require(_0xf609('0x7'))(new Redis(config[_0xf609('0x5')]));function ChatQueue(_0x3055f8){this['id']=_0x3055f8['id']||0x0;this[_0xf609('0x8')]=_0x3055f8[_0xf609('0x8')]||'';this['timeout']=_0x3055f8[_0xf609('0x9')]||0xa;this[_0xf609('0xa')]=_0x3055f8[_0xf609('0xa')]||_0xf609('0xb');this['Agents']=_0x3055f8['Agents'];this[_0xf609('0xc')]={};this[_0xf609('0xd')]=0x0;this[_0xf609('0xe')]='';this[_0xf609('0xf')]();this['updateRealtime']();}ChatQueue[_0xf609('0x10')][_0xf609('0xf')]=function(){var _0x481205=this[_0xf609('0xc')][_0xf609('0x11')];this[_0xf609('0xc')]=_[_0xf609('0x12')](this[_0xf609('0x13')],'id');this[_0xf609('0xc')]['_rr']=_0x481205;};ChatQueue[_0xf609('0x10')]['updateRealtime']=function(){this[_0xf609('0x14')]=0x0;this['paused']=0x0;for(var _0x1addc2=0x0;_0x1addc2=0x0?this[_0xf609('0x18')]:0x0;var _0x30c8a7={'id':this['id'],'available':this[_0xf609('0x18')],'loggedIn':this[_0xf609('0x14')],'name':this[_0xf609('0x8')],'paused':this['paused'],'waiting':this[_0xf609('0xd')]};var _0x35a41b=md5(JSON[_0xf609('0x19')](_0x30c8a7));if(this[_0xf609('0xe')]!==_0x35a41b){this[_0xf609('0xe')]=_0x35a41b;io['to'](util[_0xf609('0x1a')](_0xf609('0x1b'),_0x30c8a7['name']))[_0xf609('0x1c')](_0xf609('0x1d'),_0x30c8a7);}};module[_0xf609('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 65b74d8..ebc419e 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 _0xa289=['strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','loggedIn','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x71779,_0x2c1203){var _0x143e42=function(_0x46a310){while(--_0x46a310){_0x71779['push'](_0x71779['shift']());}};_0x143e42(++_0x2c1203);}(_0xa289,0xde));var _0x9a28=function(_0x4667e0,_0xc1237a){_0x4667e0=_0x4667e0-0x0;var _0x249eb8=_0xa289[_0x4667e0];return _0x249eb8;};'use strict';var _=require('lodash');var md5=require(_0x9a28('0x0'));var util=require(_0x9a28('0x1'));var Redis=require(_0x9a28('0x2'));var config=require(_0x9a28('0x3'));config[_0x9a28('0x4')]=_[_0x9a28('0x5')](config[_0x9a28('0x4')],{'host':_0x9a28('0x6'),'port':0x18eb});var io=require(_0x9a28('0x7'))(new Redis(config[_0x9a28('0x4')]));function FaxQueue(_0x5864dc){this['id']=_0x5864dc['id']||0x0;this[_0x9a28('0x8')]=_0x5864dc[_0x9a28('0x8')]||'';this['timeout']=_0x5864dc[_0x9a28('0x9')]||0xa;this['strategy']=_0x5864dc[_0x9a28('0xa')]||_0x9a28('0xb');this[_0x9a28('0xc')]=_0x5864dc['Agents'];this[_0x9a28('0xd')]={};this[_0x9a28('0xe')]=0x0;this[_0x9a28('0x0')]='';this['updateRouting']();this[_0x9a28('0xf')]();}FaxQueue[_0x9a28('0x10')][_0x9a28('0x11')]=function(){var _0x4137ff=this[_0x9a28('0xd')][_0x9a28('0x12')];this[_0x9a28('0xd')]=_[_0x9a28('0x13')](this[_0x9a28('0xc')],'id');this[_0x9a28('0xd')][_0x9a28('0x12')]=_0x4137ff;};FaxQueue[_0x9a28('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9a28('0x14')]=0x0;for(var _0x312cc4=0x0;_0x312cc4=0x0?this['available']:0x0;var _0x1b8f87={'id':this['id'],'available':this[_0x9a28('0x18')],'loggedIn':this[_0x9a28('0x16')],'name':this[_0x9a28('0x8')],'paused':this[_0x9a28('0x14')],'waiting':this[_0x9a28('0xe')]};var _0x26fa82=md5(JSON['stringify'](_0x1b8f87));if(this[_0x9a28('0x0')]!==_0x26fa82){this[_0x9a28('0x0')]=_0x26fa82;io['to'](util[_0x9a28('0x19')](_0x9a28('0x1a'),_0x1b8f87[_0x9a28('0x8')]))[_0x9a28('0x1b')](_0x9a28('0x1c'),_0x1b8f87);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x7b06=['format','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','waiting','stringify','md5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b06,0xea));var _0x67b0=function(_0xec05a,_0xae2200){_0xec05a=_0xec05a-0x0;var _0x5911e2=_0x7b06[_0xec05a];return _0x5911e2;};'use strict';var _=require(_0x67b0('0x0'));var md5=require('md5');var util=require(_0x67b0('0x1'));var Redis=require(_0x67b0('0x2'));var config=require(_0x67b0('0x3'));config['redis']=_[_0x67b0('0x4')](config[_0x67b0('0x5')],{'host':_0x67b0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x67b0('0x5')]));function FaxQueue(_0x31eacf){this['id']=_0x31eacf['id']||0x0;this[_0x67b0('0x7')]=_0x31eacf[_0x67b0('0x7')]||'';this['timeout']=_0x31eacf[_0x67b0('0x8')]||0xa;this[_0x67b0('0x9')]=_0x31eacf[_0x67b0('0x9')]||_0x67b0('0xa');this[_0x67b0('0xb')]=_0x31eacf[_0x67b0('0xb')];this[_0x67b0('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x67b0('0xd')]();this[_0x67b0('0xe')]();}FaxQueue[_0x67b0('0xf')]['updateRouting']=function(){var _0x5a16ee=this['mapAgentsId'][_0x67b0('0x10')];this[_0x67b0('0xc')]=_[_0x67b0('0x11')](this[_0x67b0('0xb')],'id');this[_0x67b0('0xc')][_0x67b0('0x10')]=_0x5a16ee;};FaxQueue[_0x67b0('0xf')]['updateRealtime']=function(){this[_0x67b0('0x12')]=0x0;this[_0x67b0('0x13')]=0x0;for(var _0x5cb202=0x0;_0x5cb202=0x0?this[_0x67b0('0x17')]:0x0;var _0x30f4c5={'id':this['id'],'available':this[_0x67b0('0x17')],'loggedIn':this[_0x67b0('0x12')],'name':this['name'],'paused':this[_0x67b0('0x13')],'waiting':this[_0x67b0('0x18')]};var _0x5d9d02=md5(JSON[_0x67b0('0x19')](_0x30f4c5));if(this[_0x67b0('0x1a')]!==_0x5d9d02){this[_0x67b0('0x1a')]=_0x5d9d02;io['to'](util[_0x67b0('0x1b')]('fax:queue:%s',_0x30f4c5[_0x67b0('0x7')]))['emit']('fax_queue:save',_0x30f4c5);}};module[_0x67b0('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 2ecd932..196c2a2 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 _0x3061=['exports','Intervals'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0x3061,0xab));var _0x1306=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x3061[_0x500c0];return _0xdd146f;};'use strict';function Interval(_0x1c03f4){this['id']=_0x1c03f4['id']||0x0;this['name']=_0x1c03f4['name']||'';this[_0x1306('0x0')]=_0x1c03f4[_0x1306('0x0')]||{};}module[_0x1306('0x1')]=Interval; \ No newline at end of file +var _0x9691=['Intervals','name'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9691,0xdd));var _0x1969=function(_0xa46edf,_0x5c0aed){_0xa46edf=_0xa46edf-0x0;var _0x18dc70=_0x9691[_0xa46edf];return _0x18dc70;};'use strict';function Interval(_0x1a6818){this['id']=_0x1a6818['id']||0x0;this[_0x1969('0x0')]=_0x1a6818[_0x1969('0x0')]||'';this[_0x1969('0x1')]=_0x1a6818[_0x1969('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index a65d505..693d1c8 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 _0x9e04=['redis','defaults','localhost','name','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','available','waiting','stringify','format','exports','md5','util'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x9e04,0xae));var _0x49e0=function(_0x453e10,_0xf80171){_0x453e10=_0x453e10-0x0;var _0x492aa2=_0x9e04[_0x453e10];return _0x492aa2;};'use strict';var _=require('lodash');var md5=require(_0x49e0('0x0'));var util=require(_0x49e0('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x49e0('0x2')]=_[_0x49e0('0x3')](config[_0x49e0('0x2')],{'host':_0x49e0('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x49e0('0x2')]));function MailQueue(_0x41503f){this['id']=_0x41503f['id']||0x0;this[_0x49e0('0x5')]=_0x41503f[_0x49e0('0x5')]||'';this['timeout']=_0x41503f['timeout']||0xa;this[_0x49e0('0x6')]=_0x41503f[_0x49e0('0x6')]||_0x49e0('0x7');this[_0x49e0('0x8')]=_0x41503f['Agents'];this[_0x49e0('0x9')]={};this['waiting']=0x0;this[_0x49e0('0x0')]='';this['updateRouting']();this[_0x49e0('0xa')]();}MailQueue[_0x49e0('0xb')][_0x49e0('0xc')]=function(){var _0x33b844=this[_0x49e0('0x9')][_0x49e0('0xd')];this['mapAgentsId']=_['map'](this[_0x49e0('0x8')],'id');this[_0x49e0('0x9')]['_rr']=_0x33b844;};MailQueue['prototype'][_0x49e0('0xa')]=function(){this[_0x49e0('0xe')]=0x0;this[_0x49e0('0xf')]=0x0;for(var _0x888f2c=0x0;_0x888f2c=0x0?this[_0x49e0('0x11')]:0x0;var _0x1ff935={'id':this['id'],'available':this[_0x49e0('0x11')],'loggedIn':this[_0x49e0('0xe')],'name':this[_0x49e0('0x5')],'paused':this[_0x49e0('0xf')],'waiting':this[_0x49e0('0x12')]};var _0x312496=md5(JSON[_0x49e0('0x13')](_0x1ff935));if(this[_0x49e0('0x0')]!==_0x312496){this[_0x49e0('0x0')]=_0x312496;io['to'](util[_0x49e0('0x14')]('mail:queue:%s',_0x1ff935[_0x49e0('0x5')]))['emit']('mail_queue:save',_0x1ff935);}};module[_0x49e0('0x15')]=MailQueue; \ No newline at end of file +var _0xa10e=['../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','online','mailPause','available','name','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x4db11a,_0x109ba5){var _0x26e5c0=function(_0x36169d){while(--_0x36169d){_0x4db11a['push'](_0x4db11a['shift']());}};_0x26e5c0(++_0x109ba5);}(_0xa10e,0x74));var _0xea10=function(_0x44573f,_0x98db32){_0x44573f=_0x44573f-0x0;var _0x55b09d=_0xa10e[_0x44573f];return _0x55b09d;};'use strict';var _=require(_0xea10('0x0'));var md5=require(_0xea10('0x1'));var util=require(_0xea10('0x2'));var Redis=require(_0xea10('0x3'));var config=require(_0xea10('0x4'));config[_0xea10('0x5')]=_['defaults'](config[_0xea10('0x5')],{'host':_0xea10('0x6'),'port':0x18eb});var io=require(_0xea10('0x7'))(new Redis(config[_0xea10('0x5')]));function MailQueue(_0x175d8f){this['id']=_0x175d8f['id']||0x0;this['name']=_0x175d8f['name']||'';this['timeout']=_0x175d8f[_0xea10('0x8')]||0xa;this['strategy']=_0x175d8f[_0xea10('0x9')]||_0xea10('0xa');this[_0xea10('0xb')]=_0x175d8f['Agents'];this[_0xea10('0xc')]={};this[_0xea10('0xd')]=0x0;this[_0xea10('0x1')]='';this[_0xea10('0xe')]();this['updateRealtime']();}MailQueue[_0xea10('0xf')][_0xea10('0xe')]=function(){var _0x4d8514=this[_0xea10('0xc')][_0xea10('0x10')];this[_0xea10('0xc')]=_['map'](this[_0xea10('0xb')],'id');this[_0xea10('0xc')][_0xea10('0x10')]=_0x4d8514;};MailQueue[_0xea10('0xf')]['updateRealtime']=function(){this[_0xea10('0x11')]=0x0;this[_0xea10('0x12')]=0x0;for(var _0x52d71e=0x0;_0x52d71e=0x0?this['available']:0x0;var _0x265b4a={'id':this['id'],'available':this[_0xea10('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xea10('0x17')],'paused':this['paused'],'waiting':this['waiting']};var _0x32bfeb=md5(JSON[_0xea10('0x18')](_0x265b4a));if(this[_0xea10('0x1')]!==_0x32bfeb){this[_0xea10('0x1')]=_0x32bfeb;io['to'](util[_0xea10('0x19')](_0xea10('0x1a'),_0x265b4a[_0xea10('0x17')]))[_0xea10('0x1b')](_0xea10('0x1c'),_0x265b4a);}};module[_0xea10('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a9908aa..e7f87af 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x326f,0xd1));var _0xf326=function(_0x504790,_0x23526d){_0x504790=_0x504790-0x0;var _0x1645b0=_0x326f[_0x504790];return _0x1645b0;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x326f,0xd1));var _0xf326=function(_0x3b8981,_0x350dd8){_0x3b8981=_0x3b8981-0x0;var _0x419f59=_0x326f[_0x3b8981];return _0x419f59;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 54f46f7..224d913 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 _0x6737=['Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','beepall'];(function(_0x3da819,_0x3d1f7e){var _0x28cc2f=function(_0x270915){while(--_0x270915){_0x3da819['push'](_0x3da819['shift']());}};_0x28cc2f(++_0x3d1f7e);}(_0x6737,0xe2));var _0x7673=function(_0x5c0e29,_0x487d6f){_0x5c0e29=_0x5c0e29-0x0;var _0x2cc11b=_0x6737[_0x5c0e29];return _0x2cc11b;};'use strict';var _=require('lodash');var md5=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var Redis=require('ioredis');var config=require(_0x7673('0x2'));config[_0x7673('0x3')]=_[_0x7673('0x4')](config[_0x7673('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7673('0x5'))(new Redis(config[_0x7673('0x3')]));function SmsQueue(_0x543b61){this['id']=_0x543b61['id']||0x0;this[_0x7673('0x6')]=_0x543b61[_0x7673('0x6')]||'';this['timeout']=_0x543b61['timeout']||0xa;this['strategy']=_0x543b61['strategy']||_0x7673('0x7');this['Agents']=_0x543b61[_0x7673('0x8')];this[_0x7673('0x9')]={};this['waiting']=0x0;this[_0x7673('0x0')]='';this[_0x7673('0xa')]();this[_0x7673('0xb')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x3ca258=this['mapAgentsId'][_0x7673('0xc')];this[_0x7673('0x9')]=_[_0x7673('0xd')](this[_0x7673('0x8')],'id');this[_0x7673('0x9')][_0x7673('0xc')]=_0x3ca258;};SmsQueue[_0x7673('0xe')][_0x7673('0xb')]=function(){this[_0x7673('0xf')]=0x0;this[_0x7673('0x10')]=0x0;for(var _0x5c8626=0x0;_0x5c8626=0x0?this[_0x7673('0x14')]:0x0;var _0x58a821={'id':this['id'],'available':this[_0x7673('0x14')],'loggedIn':this[_0x7673('0xf')],'name':this[_0x7673('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x249fe3=md5(JSON[_0x7673('0x15')](_0x58a821));if(this['md5']!==_0x249fe3){this[_0x7673('0x0')]=_0x249fe3;io['to'](util[_0x7673('0x16')](_0x7673('0x17'),_0x58a821[_0x7673('0x6')]))[_0x7673('0x18')](_0x7673('0x19'),_0x58a821);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xaa19=['Agents','mapAgentsId','waiting','prototype','map','_rr','updateRealtime','length','online','loggedIn','smsPause','paused','available','format','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy'];(function(_0x4fef61,_0x53572f){var _0x92322d=function(_0x595b6e){while(--_0x595b6e){_0x4fef61['push'](_0x4fef61['shift']());}};_0x92322d(++_0x53572f);}(_0xaa19,0x79));var _0x9aa1=function(_0x25c31a,_0x541c36){_0x25c31a=_0x25c31a-0x0;var _0x2e1102=_0xaa19[_0x25c31a];return _0x2e1102;};'use strict';var _=require(_0x9aa1('0x0'));var md5=require(_0x9aa1('0x1'));var util=require(_0x9aa1('0x2'));var Redis=require(_0x9aa1('0x3'));var config=require('../../../config/environment');config[_0x9aa1('0x4')]=_['defaults'](config[_0x9aa1('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9aa1('0x5'))(new Redis(config[_0x9aa1('0x4')]));function SmsQueue(_0x465404){this['id']=_0x465404['id']||0x0;this['name']=_0x465404[_0x9aa1('0x6')]||'';this[_0x9aa1('0x7')]=_0x465404[_0x9aa1('0x7')]||0xa;this['strategy']=_0x465404[_0x9aa1('0x8')]||'beepall';this['Agents']=_0x465404[_0x9aa1('0x9')];this[_0x9aa1('0xa')]={};this[_0x9aa1('0xb')]=0x0;this[_0x9aa1('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x9aa1('0xc')]['updateRouting']=function(){var _0x19ff10=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x9aa1('0xd')](this[_0x9aa1('0x9')],'id');this['mapAgentsId'][_0x9aa1('0xe')]=_0x19ff10;};SmsQueue[_0x9aa1('0xc')][_0x9aa1('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x35d6f2=0x0;_0x35d6f2=0x0?this[_0x9aa1('0x15')]:0x0;var _0x26acc0={'id':this['id'],'available':this[_0x9aa1('0x15')],'loggedIn':this[_0x9aa1('0x12')],'name':this[_0x9aa1('0x6')],'paused':this[_0x9aa1('0x14')],'waiting':this[_0x9aa1('0xb')]};var _0x49731d=md5(JSON['stringify'](_0x26acc0));if(this['md5']!==_0x49731d){this[_0x9aa1('0x1')]=_0x49731d;io['to'](util[_0x9aa1('0x16')]('sms:queue:%s',_0x26acc0[_0x9aa1('0x6')]))[_0x9aa1('0x17')](_0x9aa1('0x18'),_0x26acc0);}};module[_0x9aa1('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index a774122..e1d6535 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 _0x9450=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','paused','online','whatsappPause','loggedIn','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0xc58860,_0x36c7b8){var _0x4ef7be=function(_0x4a9520){while(--_0x4a9520){_0xc58860['push'](_0xc58860['shift']());}};_0x4ef7be(++_0x36c7b8);}(_0x9450,0x1d8));var _0x0945=function(_0x43ed31,_0x454b68){_0x43ed31=_0x43ed31-0x0;var _0x17b6d5=_0x9450[_0x43ed31];return _0x17b6d5;};'use strict';var _=require(_0x0945('0x0'));var md5=require(_0x0945('0x1'));var util=require('util');var Redis=require(_0x0945('0x2'));var config=require(_0x0945('0x3'));config[_0x0945('0x4')]=_[_0x0945('0x5')](config['redis'],{'host':_0x0945('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0945('0x4')]));function WhatsappQueue(_0x20de45){this['id']=_0x20de45['id']||0x0;this[_0x0945('0x7')]=_0x20de45[_0x0945('0x7')]||'';this['timeout']=_0x20de45[_0x0945('0x8')]||0xa;this[_0x0945('0x9')]=_0x20de45[_0x0945('0x9')]||_0x0945('0xa');this[_0x0945('0xb')]=_0x20de45[_0x0945('0xb')];this[_0x0945('0xc')]={};this[_0x0945('0xd')]=0x0;this[_0x0945('0x1')]='';this[_0x0945('0xe')]();this[_0x0945('0xf')]();}WhatsappQueue['prototype'][_0x0945('0xe')]=function(){var _0x3fb363=this['mapAgentsId'][_0x0945('0x10')];this[_0x0945('0xc')]=_[_0x0945('0x11')](this[_0x0945('0xb')],'id');this[_0x0945('0xc')]['_rr']=_0x3fb363;};WhatsappQueue['prototype'][_0x0945('0xf')]=function(){this['loggedIn']=0x0;this[_0x0945('0x12')]=0x0;for(var _0x46f888=0x0;_0x46f888=0x0?this[_0x0945('0x16')]:0x0;var _0x245b65={'id':this['id'],'available':this[_0x0945('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x0945('0x7')],'paused':this['paused'],'waiting':this[_0x0945('0xd')]};var _0x21f629=md5(JSON['stringify'](_0x245b65));if(this['md5']!==_0x21f629){this[_0x0945('0x1')]=_0x21f629;io['to'](util[_0x0945('0x17')](_0x0945('0x18'),_0x245b65[_0x0945('0x7')]))[_0x0945('0x19')](_0x0945('0x1a'),_0x245b65);}};module[_0x0945('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x724d=['util','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5'];(function(_0x394490,_0x2aa33e){var _0x3706fb=function(_0x73c524){while(--_0x73c524){_0x394490['push'](_0x394490['shift']());}};_0x3706fb(++_0x2aa33e);}(_0x724d,0x1ca));var _0xd724=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x724d[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var md5=require(_0xd724('0x0'));var util=require(_0xd724('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xd724('0x2')]=_[_0xd724('0x3')](config[_0xd724('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xd724('0x4'))(new Redis(config[_0xd724('0x2')]));function WhatsappQueue(_0x444731){this['id']=_0x444731['id']||0x0;this[_0xd724('0x5')]=_0x444731[_0xd724('0x5')]||'';this[_0xd724('0x6')]=_0x444731[_0xd724('0x6')]||0xa;this['strategy']=_0x444731[_0xd724('0x7')]||_0xd724('0x8');this[_0xd724('0x9')]=_0x444731[_0xd724('0x9')];this['mapAgentsId']={};this[_0xd724('0xa')]=0x0;this[_0xd724('0x0')]='';this[_0xd724('0xb')]();this[_0xd724('0xc')]();}WhatsappQueue[_0xd724('0xd')][_0xd724('0xb')]=function(){var _0x34b34d=this[_0xd724('0xe')][_0xd724('0xf')];this[_0xd724('0xe')]=_[_0xd724('0x10')](this[_0xd724('0x9')],'id');this['mapAgentsId'][_0xd724('0xf')]=_0x34b34d;};WhatsappQueue['prototype'][_0xd724('0xc')]=function(){this[_0xd724('0x11')]=0x0;this['paused']=0x0;for(var _0x2d4d30=0x0;_0x2d4d30=0x0?this[_0xd724('0x15')]:0x0;var _0x431862={'id':this['id'],'available':this[_0xd724('0x15')],'loggedIn':this[_0xd724('0x11')],'name':this[_0xd724('0x5')],'paused':this[_0xd724('0x14')],'waiting':this['waiting']};var _0x523e0f=md5(JSON[_0xd724('0x16')](_0x431862));if(this['md5']!==_0x523e0f){this[_0xd724('0x0')]=_0x523e0f;io['to'](util[_0xd724('0x17')](_0xd724('0x18'),_0x431862[_0xd724('0x5')]))[_0xd724('0x19')](_0xd724('0x1a'),_0x431862);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 128f64d..28304ff 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(_0xbe0e01,_0x40f43d){var _0x41ed2f=function(_0x5e2897){while(--_0x5e2897){_0xbe0e01['push'](_0xbe0e01['shift']());}};_0x41ed2f(++_0x40f43d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b5f7a,_0x281348){_0x1b5f7a=_0x1b5f7a-0x0;var _0x205dd7=_0xb10b[_0x1b5f7a];return _0x205dd7;};'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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index df4c80a..d71f35a 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 _0xebec=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xaced6c,_0x2289a7){var _0x469513=function(_0x447d75){while(--_0x447d75){_0xaced6c['push'](_0xaced6c['shift']());}};_0x469513(++_0x2289a7);}(_0xebec,0x135));var _0xcebe=function(_0x23340b,_0x54ce94){_0x23340b=_0x23340b-0x0;var _0x10237a=_0xebec[_0x23340b];return _0x10237a;};'use strict';var client=require(_0xcebe('0x0'));exports[_0xcebe('0x1')]=function(_0x358cbb,_0x5b6024){return client[_0xcebe('0x2')](_0xcebe('0x3'),{'body':_0x5b6024,'options':{'where':{'id':_0x358cbb}},'log':_0xcebe('0x4')});};exports[_0xcebe('0x5')]=function(_0x570695,_0x34bf7d){return client[_0xcebe('0x2')](_0xcebe('0x6'),{'body':_0x34bf7d,'options':{'where':{'id':_0x570695}},'log':_0xcebe('0x7')});}; \ No newline at end of file +var _0x3f6e=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x3f6e,0x19e));var _0xe3f6=function(_0x48a73e,_0x39f1ac){_0x48a73e=_0x48a73e-0x0;var _0x390c0b=_0x3f6e[_0x48a73e];return _0x390c0b;};'use strict';var client=require(_0xe3f6('0x0'));exports[_0xe3f6('0x1')]=function(_0x2236a2,_0x4eb56b){return client[_0xe3f6('0x2')](_0xe3f6('0x3'),{'body':_0x4eb56b,'options':{'where':{'id':_0x2236a2}},'log':_0xe3f6('0x4')});};exports[_0xe3f6('0x5')]=function(_0x4ac99e,_0x580383){return client[_0xe3f6('0x2')](_0xe3f6('0x6'),{'body':_0x580383,'options':{'where':{'id':_0x4ac99e}},'log':_0xe3f6('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c7b7b86..7e86270 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 _0x2e80=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x2e80,0x9d));var _0x02e8=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x2e80[_0x58db4e];return _0x40139a;};'use strict';var client=require(_0x02e8('0x0'));exports[_0x02e8('0x1')]=function(_0x2f1f41){return client[_0x02e8('0x2')](_0x02e8('0x3'),{'body':_0x2f1f41,'log':_0x02e8('0x4')});}; \ No newline at end of file +var _0xb5e7=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb5e7,0xd1));var _0x7b5e=function(_0x326b9f,_0x544b9a){_0x326b9f=_0x326b9f-0x0;var _0x19bbf7=_0xb5e7[_0x326b9f];return _0x19bbf7;};'use strict';var client=require(_0x7b5e('0x0'));exports[_0x7b5e('0x1')]=function(_0x1a78cd){return client[_0x7b5e('0x2')](_0x7b5e('0x3'),{'body':_0x1a78cd,'log':_0x7b5e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3136f61..331447e 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 _0x535f=['chatPause','getChatQueues','Request','name','timeout','strategy','User','online'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x535f,0x111));var _0xf535=function(_0x282b44,_0x25c866){_0x282b44=_0x282b44-0x0;var _0x22b96e=_0x535f[_0x282b44];return _0x22b96e;};'use strict';var client=require('../client');exports[_0xf535('0x0')]=function(){return function(){return client[_0xf535('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xf535('0x2'),_0xf535('0x3'),_0xf535('0x4')],'include':[{'model':_0xf535('0x5'),'as':'Agents','attributes':['id',_0xf535('0x2'),_0xf535('0x6'),_0xf535('0x7')]}]},'log':_0xf535('0x0')});};}; \ No newline at end of file +var _0x72b1=['online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x9b2cc4,_0x4399ca){var _0x25a6c0=function(_0x19b3c1){while(--_0x19b3c1){_0x9b2cc4['push'](_0x9b2cc4['shift']());}};_0x25a6c0(++_0x4399ca);}(_0x72b1,0x16e));var _0x172b=function(_0x24725c,_0x2d708c){_0x24725c=_0x24725c-0x0;var _0x1c2a2b=_0x72b1[_0x24725c];return _0x1c2a2b;};'use strict';var client=require(_0x172b('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x172b('0x1')](_0x172b('0x2'),{'options':{'raw':![],'attributes':['id',_0x172b('0x3'),_0x172b('0x4'),_0x172b('0x5')],'include':[{'model':_0x172b('0x6'),'as':_0x172b('0x7'),'attributes':['id','name',_0x172b('0x8'),_0x172b('0x9')]}]},'log':_0x172b('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d42ab88..8b0117d 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 _0xd58c=['../client','create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xd58c,0xb6));var _0xcd58=function(_0x182379,_0x20ca9c){_0x182379=_0x182379-0x0;var _0x597765=_0xd58c[_0x182379];return _0x597765;};'use strict';var client=require(_0xcd58('0x0'));exports[_0xcd58('0x1')]=function(_0x240323){return client['Request'](_0xcd58('0x2'),{'body':_0x240323,'log':'CreateChatQueueReport'});};exports[_0xcd58('0x3')]=function(_0x4be7d0,_0xe6c68){return client[_0xcd58('0x4')](_0xcd58('0x5'),{'body':_0xe6c68,'options':{'where':{'uniqueid':_0x4be7d0},'order':[['id',_0xcd58('0x6')]],'limit':0x1},'log':_0xcd58('0x5')});}; \ No newline at end of file +var _0xc818=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x135215,_0x17c9c2){var _0x31d500=function(_0x1a1d5f){while(--_0x1a1d5f){_0x135215['push'](_0x135215['shift']());}};_0x31d500(++_0x17c9c2);}(_0xc818,0x1e3));var _0x8c81=function(_0x5953e3,_0x476e52){_0x5953e3=_0x5953e3-0x0;var _0x10e910=_0xc818[_0x5953e3];return _0x10e910;};'use strict';var client=require(_0x8c81('0x0'));exports[_0x8c81('0x1')]=function(_0x2ebf7a){return client[_0x8c81('0x2')]('CreateChatQueueReport',{'body':_0x2ebf7a,'log':_0x8c81('0x3')});};exports[_0x8c81('0x4')]=function(_0x40b19e,_0x7e329f){return client[_0x8c81('0x2')](_0x8c81('0x5'),{'body':_0x7e329f,'options':{'where':{'uniqueid':_0x40b19e},'order':[['id',_0x8c81('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 857deaa..814cce9 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(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x7a54,0x106));var _0x47a5=function(_0x9f8403,_0x1c86fa){_0x9f8403=_0x9f8403-0x0;var _0x49fdae=_0x7a54[_0x9f8403];return _0x49fdae;};'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(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfacc,_0x5b20f0){_0x1dfacc=_0x1dfacc-0x0;var _0x44eccf=_0x7a54[_0x1dfacc];return _0x44eccf;};'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 f771ff3..53192c0 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 _0x21aa=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x37c8c3,_0x378b10){var _0x233bb9=function(_0x2281c2){while(--_0x2281c2){_0x37c8c3['push'](_0x37c8c3['shift']());}};_0x233bb9(++_0x378b10);}(_0x21aa,0x1cc));var _0xa21a=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x21aa[_0x28fbe3];return _0x45db6a;};'use strict';var client=require(_0xa21a('0x0'));exports[_0xa21a('0x1')]=function(_0x5e30e6){return client[_0xa21a('0x2')](_0xa21a('0x3'),{'body':_0x5e30e6,'log':_0xa21a('0x4')});}; \ No newline at end of file +var _0x3598=['CreateFaxMessage','createFaxMessage','create'];(function(_0x3124f6,_0x4c4ff7){var _0x476e22=function(_0x12e9c1){while(--_0x12e9c1){_0x3124f6['push'](_0x3124f6['shift']());}};_0x476e22(++_0x4c4ff7);}(_0x3598,0x122));var _0x8359=function(_0x563078,_0x485a03){_0x563078=_0x563078-0x0;var _0x56c9ee=_0x3598[_0x563078];return _0x56c9ee;};'use strict';var client=require('../client');exports[_0x8359('0x0')]=function(_0x586826){return client['Request'](_0x8359('0x1'),{'body':_0x586826,'log':_0x8359('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d88a13f..1fe8b34 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 _0x34b5=['GetFaxQueue','timeout','User','Agents','name','online','../client','getFaxQueues','Request'];(function(_0x331184,_0xa8bc89){var _0xe872f3=function(_0x429e9b){while(--_0x429e9b){_0x331184['push'](_0x331184['shift']());}};_0xe872f3(++_0xa8bc89);}(_0x34b5,0x9f));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x534b('0x0'));exports[_0x534b('0x1')]=function(){return function(){return client[_0x534b('0x2')](_0x534b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x534b('0x4'),'strategy'],'include':[{'model':_0x534b('0x5'),'as':_0x534b('0x6'),'attributes':['id',_0x534b('0x7'),_0x534b('0x8'),'faxPause']}]},'log':_0x534b('0x1')});};}; \ No newline at end of file +var _0x4cd9=['../client','getFaxQueues','name','timeout','strategy','Agents','online','faxPause'];(function(_0x4b148a,_0x2c7d04){var _0x6d69fd=function(_0x4cf81c){while(--_0x4cf81c){_0x4b148a['push'](_0x4b148a['shift']());}};_0x6d69fd(++_0x2c7d04);}(_0x4cd9,0x128));var _0x94cd=function(_0x3e0ddb,_0x2b875c){_0x3e0ddb=_0x3e0ddb-0x0;var _0x132898=_0x4cd9[_0x3e0ddb];return _0x132898;};'use strict';var client=require(_0x94cd('0x0'));exports[_0x94cd('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x94cd('0x2'),_0x94cd('0x3'),_0x94cd('0x4')],'include':[{'model':'User','as':_0x94cd('0x5'),'attributes':['id',_0x94cd('0x2'),_0x94cd('0x6'),_0x94cd('0x7')]}]},'log':_0x94cd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 19f318f..2e1eee2 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 _0x4d29=['../client','Request','update','UpdateFaxQueueReport'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4d29,0x13c));var _0x94d2=function(_0x2986c8,_0x231bb1){_0x2986c8=_0x2986c8-0x0;var _0x8d6e80=_0x4d29[_0x2986c8];return _0x8d6e80;};'use strict';var client=require(_0x94d2('0x0'));exports['create']=function(_0x4a703b){return client[_0x94d2('0x1')]('CreateFaxQueueReport',{'body':_0x4a703b,'log':'CreateFaxQueueReport'});};exports[_0x94d2('0x2')]=function(_0x302ff4,_0x260866){return client[_0x94d2('0x1')](_0x94d2('0x3'),{'body':_0x260866,'options':{'where':{'uniqueid':_0x302ff4},'order':[['id','DESC']],'limit':0x1},'log':_0x94d2('0x3')});}; \ No newline at end of file +var _0xaa19=['create','Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x133937,_0x2ebfad){var _0x5e8947=function(_0x442ac5){while(--_0x442ac5){_0x133937['push'](_0x133937['shift']());}};_0x5e8947(++_0x2ebfad);}(_0xaa19,0x8a));var _0x9aa1=function(_0x2120a9,_0x207dab){_0x2120a9=_0x2120a9-0x0;var _0x27caca=_0xaa19[_0x2120a9];return _0x27caca;};'use strict';var client=require('../client');exports[_0x9aa1('0x0')]=function(_0x2bf683){return client[_0x9aa1('0x1')](_0x9aa1('0x2'),{'body':_0x2bf683,'log':_0x9aa1('0x2')});};exports[_0x9aa1('0x3')]=function(_0x403ac7,_0x2e6f33){return client['Request']('UpdateFaxQueueReport',{'body':_0x2e6f33,'options':{'where':{'uniqueid':_0x403ac7},'order':[['id',_0x9aa1('0x4')]],'limit':0x1},'log':_0x9aa1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3603fc1..39aa533 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 _0x213c=['GetInterval','name','Interval','Intervals','interval','getIntervals','Request'];(function(_0x1ace8a,_0x494977){var _0x23181b=function(_0x17ac79){while(--_0x17ac79){_0x1ace8a['push'](_0x1ace8a['shift']());}};_0x23181b(++_0x494977);}(_0x213c,0x9f));var _0xc213=function(_0x332642,_0x6c9025){_0x332642=_0x332642-0x0;var _0x296429=_0x213c[_0x332642];return _0x296429;};'use strict';var client=require('../client');exports[_0xc213('0x0')]=function(){return function(){return client[_0xc213('0x1')](_0xc213('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc213('0x3')],'include':[{'model':_0xc213('0x4'),'as':_0xc213('0x5'),'attributes':['id',_0xc213('0x3'),_0xc213('0x6')]}]},'log':_0xc213('0x0')});};}; \ No newline at end of file +var _0x981b=['interval','getIntervals','../client','Request','name','Interval'];(function(_0x323915,_0x2669be){var _0x586898=function(_0x1b062a){while(--_0x1b062a){_0x323915['push'](_0x323915['shift']());}};_0x586898(++_0x2669be);}(_0x981b,0x1ee));var _0xb981=function(_0x2368fe,_0xe9b30a){_0x2368fe=_0x2368fe-0x0;var _0x2b6bbe=_0x981b[_0x2368fe];return _0x2b6bbe;};'use strict';var client=require(_0xb981('0x0'));exports['getIntervals']=function(){return function(){return client[_0xb981('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb981('0x2')],'include':[{'model':_0xb981('0x3'),'as':'Intervals','attributes':['id','name',_0xb981('0x4')]}]},'log':_0xb981('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b6b65ff..138c16c 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 _0xb145=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x26fa4a,_0x50eeea){var _0x663a53=function(_0x3fc550){while(--_0x3fc550){_0x26fa4a['push'](_0x26fa4a['shift']());}};_0x663a53(++_0x50eeea);}(_0xb145,0xa3));var _0x5b14=function(_0x432963,_0x53cb28){_0x432963=_0x432963-0x0;var _0x3226cb=_0xb145[_0x432963];return _0x3226cb;};'use strict';var client=require('../client');exports[_0x5b14('0x0')]=function(_0xc54593,_0x935de1){return client[_0x5b14('0x1')](_0x5b14('0x2'),{'body':_0x935de1,'options':{'where':{'id':_0xc54593}},'log':_0x5b14('0x3')});};exports[_0x5b14('0x4')]=function(_0x34b4cd,_0x5111cd){return client[_0x5b14('0x1')](_0x5b14('0x5'),{'body':_0x5111cd,'options':{'where':{'id':_0x34b4cd}},'log':_0x5b14('0x6')});}; \ No newline at end of file +var _0x5204=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0x5204,0xdf));var _0x4520=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x5204[_0x49aa7d];return _0xdd0d26;};'use strict';var client=require(_0x4520('0x0'));exports[_0x4520('0x1')]=function(_0x53b1ab,_0x12a3a1){return client[_0x4520('0x2')](_0x4520('0x3'),{'body':_0x12a3a1,'options':{'where':{'id':_0x53b1ab}},'log':_0x4520('0x4')});};exports[_0x4520('0x5')]=function(_0x592fe0,_0x41d89c){return client['Request'](_0x4520('0x6'),{'body':_0x41d89c,'options':{'where':{'id':_0x592fe0}},'log':_0x4520('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6d7f50e..ca6f216 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 _0x952b=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x526149,_0x3f7656){var _0x1eea94=function(_0xfd237){while(--_0xfd237){_0x526149['push'](_0x526149['shift']());}};_0x1eea94(++_0x3f7656);}(_0x952b,0xf8));var _0xb952=function(_0x97d399,_0x218d12){_0x97d399=_0x97d399-0x0;var _0x46d733=_0x952b[_0x97d399];return _0x46d733;};'use strict';var client=require(_0xb952('0x0'));exports[_0xb952('0x1')]=function(_0xa5ca53){return client[_0xb952('0x2')](_0xb952('0x3'),{'body':_0xa5ca53,'log':_0xb952('0x4')});}; \ No newline at end of file +var _0x77b3=['../client','create','Request','CreateMailMessage'];(function(_0x2b3fa1,_0x193f2f){var _0x45fb25=function(_0x3bbdb9){while(--_0x3bbdb9){_0x2b3fa1['push'](_0x2b3fa1['shift']());}};_0x45fb25(++_0x193f2f);}(_0x77b3,0x188));var _0x377b=function(_0x2a4a22,_0x15bfbf){_0x2a4a22=_0x2a4a22-0x0;var _0x5eefa6=_0x77b3[_0x2a4a22];return _0x5eefa6;};'use strict';var client=require(_0x377b('0x0'));exports[_0x377b('0x1')]=function(_0xc73f31){return client[_0x377b('0x2')](_0x377b('0x3'),{'body':_0xc73f31,'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 a70df66..6babca2 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 _0xc6c9=['GetMailQueue','name','timeout','strategy','User','Agents','mailPause','getMailQueues','../client'];(function(_0x12d573,_0x20ae28){var _0x5c7071=function(_0x16ea02){while(--_0x16ea02){_0x12d573['push'](_0x12d573['shift']());}};_0x5c7071(++_0x20ae28);}(_0xc6c9,0x1e5));var _0x9c6c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc6c9[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x9c6c('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x9c6c('0x1'),{'options':{'raw':![],'attributes':['id',_0x9c6c('0x2'),_0x9c6c('0x3'),_0x9c6c('0x4')],'include':[{'model':_0x9c6c('0x5'),'as':_0x9c6c('0x6'),'attributes':['id',_0x9c6c('0x2'),'online',_0x9c6c('0x7')]}]},'log':_0x9c6c('0x8')});};}; \ No newline at end of file +var _0x8270=['strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0x8270,0x94));var _0x0827=function(_0x1f7af9,_0x37d01c){_0x1f7af9=_0x1f7af9-0x0;var _0x306ba3=_0x8270[_0x1f7af9];return _0x306ba3;};'use strict';var client=require(_0x0827('0x0'));exports[_0x0827('0x1')]=function(){return function(){return client[_0x0827('0x2')](_0x0827('0x3'),{'options':{'raw':![],'attributes':['id',_0x0827('0x4'),_0x0827('0x5'),_0x0827('0x6')],'include':[{'model':_0x0827('0x7'),'as':_0x0827('0x8'),'attributes':['id',_0x0827('0x4'),_0x0827('0x9'),_0x0827('0xa')]}]},'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 fd6b49a..186f011 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 _0x22d2=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x169d7c,_0x343edc){var _0x20db78=function(_0xa5eee8){while(--_0xa5eee8){_0x169d7c['push'](_0x169d7c['shift']());}};_0x20db78(++_0x343edc);}(_0x22d2,0x132));var _0x222d=function(_0x1142d2,_0x3b88bb){_0x1142d2=_0x1142d2-0x0;var _0x3fb434=_0x22d2[_0x1142d2];return _0x3fb434;};'use strict';var client=require(_0x222d('0x0'));exports[_0x222d('0x1')]=function(_0x5a9097){return client[_0x222d('0x2')](_0x222d('0x3'),{'body':_0x5a9097,'log':_0x222d('0x3')});};exports[_0x222d('0x4')]=function(_0x3a5172,_0x220405){return client[_0x222d('0x2')](_0x222d('0x5'),{'body':_0x220405,'options':{'where':{'uniqueid':_0x3a5172},'order':[['id',_0x222d('0x6')]],'limit':0x1},'log':_0x222d('0x5')});}; \ No newline at end of file +var _0x2418=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0xae1364,_0x44863f){var _0x55104f=function(_0x83d4f1){while(--_0x83d4f1){_0xae1364['push'](_0xae1364['shift']());}};_0x55104f(++_0x44863f);}(_0x2418,0x80));var _0x8241=function(_0x5ee88a,_0x26dd39){_0x5ee88a=_0x5ee88a-0x0;var _0x1568ae=_0x2418[_0x5ee88a];return _0x1568ae;};'use strict';var client=require(_0x8241('0x0'));exports[_0x8241('0x1')]=function(_0x58dd20){return client[_0x8241('0x2')](_0x8241('0x3'),{'body':_0x58dd20,'log':_0x8241('0x3')});};exports['update']=function(_0x241d95,_0x11e442){return client[_0x8241('0x2')](_0x8241('0x4'),{'body':_0x11e442,'options':{'where':{'uniqueid':_0x241d95},'order':[['id',_0x8241('0x5')]],'limit':0x1},'log':_0x8241('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 7e4136a..f7c905f 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 _0x7a5d=['addTags','AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x4ab6b6,_0x5066ec){var _0x502a8e=function(_0x398ae3){while(--_0x398ae3){_0x4ab6b6['push'](_0x4ab6b6['shift']());}};_0x502a8e(++_0x5066ec);}(_0x7a5d,0x17c));var _0xd7a5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7a5d[_0x397e5f];return _0x5302b8;};'use strict';var client=require('../client');exports[_0xd7a5('0x0')]=function(_0x465976,_0x4690bd){return client[_0xd7a5('0x1')](_0xd7a5('0x2'),{'body':_0x4690bd,'options':{'where':{'id':_0x465976}},'log':_0xd7a5('0x3')});};exports[_0xd7a5('0x4')]=function(_0x3867a1,_0x304112){return client[_0xd7a5('0x1')](_0xd7a5('0x5'),{'body':_0x304112,'options':{'where':{'id':_0x3867a1}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9a26=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x9a26,0x1b1));var _0x69a2=function(_0x484212,_0x3a5876){_0x484212=_0x484212-0x0;var _0x52cfb4=_0x9a26[_0x484212];return _0x52cfb4;};'use strict';var client=require(_0x69a2('0x0'));exports[_0x69a2('0x1')]=function(_0x449ca1,_0x4cb0b1){return client[_0x69a2('0x2')](_0x69a2('0x3'),{'body':_0x4cb0b1,'options':{'where':{'id':_0x449ca1}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x17ed51,_0x1e2bfe){return client[_0x69a2('0x2')](_0x69a2('0x4'),{'body':_0x1e2bfe,'options':{'where':{'id':_0x17ed51}},'log':_0x69a2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 361b112..824e0b9 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 _0x404b=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x404b,0x166));var _0xb404=function(_0x1ed8e8,_0xcf1924){_0x1ed8e8=_0x1ed8e8-0x0;var _0x475af5=_0x404b[_0x1ed8e8];return _0x475af5;};'use strict';var client=require(_0xb404('0x0'));exports[_0xb404('0x1')]=function(_0x1c45e3){return client[_0xb404('0x2')](_0xb404('0x3'),{'body':_0x1c45e3,'log':_0xb404('0x4')});}; \ No newline at end of file +var _0x1c4f=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1c4f,0x1a5));var _0xf1c4=function(_0x16c465,_0x40ef71){_0x16c465=_0x16c465-0x0;var _0x354fcc=_0x1c4f[_0x16c465];return _0x354fcc;};'use strict';var client=require(_0xf1c4('0x0'));exports[_0xf1c4('0x1')]=function(_0x23ec1f){return client[_0xf1c4('0x2')](_0xf1c4('0x3'),{'body':_0x23ec1f,'log':_0xf1c4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 46e90ac..607cb77 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 _0xa48e=['strategy','Agents','../client','getOpenchannelQueues','Request','name'];(function(_0x56b3a3,_0x31fffd){var _0x110557=function(_0x34cbd6){while(--_0x34cbd6){_0x56b3a3['push'](_0x56b3a3['shift']());}};_0x110557(++_0x31fffd);}(_0xa48e,0x128));var _0xea48=function(_0x213418,_0x2884da){_0x213418=_0x213418-0x0;var _0x4f7386=_0xa48e[_0x213418];return _0x4f7386;};'use strict';var client=require(_0xea48('0x0'));exports[_0xea48('0x1')]=function(){return function(){return client[_0xea48('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xea48('0x3'),'timeout',_0xea48('0x4')],'include':[{'model':'User','as':_0xea48('0x5'),'attributes':['id',_0xea48('0x3'),'online','openchannelPause']}]},'log':_0xea48('0x1')});};}; \ No newline at end of file +var _0xe4fb=['strategy','User','Agents','online','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xe4fb,0x9d));var _0xbe4f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe4fb[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0xbe4f('0x0'),{'options':{'raw':![],'attributes':['id',_0xbe4f('0x1'),_0xbe4f('0x2'),_0xbe4f('0x3')],'include':[{'model':_0xbe4f('0x4'),'as':_0xbe4f('0x5'),'attributes':['id','name',_0xbe4f('0x6'),'openchannelPause']}]},'log':_0xbe4f('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5c84f62..4d137a1 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 _0x7a21=['UpdateOpenchannelQueueReport','../client','create','Request','update'];(function(_0x210a73,_0x53ba7d){var _0x12bbc7=function(_0x165eed){while(--_0x165eed){_0x210a73['push'](_0x210a73['shift']());}};_0x12bbc7(++_0x53ba7d);}(_0x7a21,0x1c8));var _0x17a2=function(_0x2dc5b6,_0x3244be){_0x2dc5b6=_0x2dc5b6-0x0;var _0x4e5b6=_0x7a21[_0x2dc5b6];return _0x4e5b6;};'use strict';var client=require(_0x17a2('0x0'));exports[_0x17a2('0x1')]=function(_0x9df436){return client[_0x17a2('0x2')]('CreateOpenchannelQueueReport',{'body':_0x9df436,'log':'CreateOpenchannelQueueReport'});};exports[_0x17a2('0x3')]=function(_0x35a9d6,_0x5b5e9f){return client[_0x17a2('0x2')](_0x17a2('0x4'),{'body':_0x5b5e9f,'options':{'where':{'uniqueid':_0x35a9d6},'order':[['id','DESC']],'limit':0x1},'log':_0x17a2('0x4')});}; \ No newline at end of file +var _0x8166=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x8166,0x100));var _0x6816=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0x8166[_0x1d2bc8];return _0x1857e1;};'use strict';var client=require(_0x6816('0x0'));exports['create']=function(_0x1a09c8){return client[_0x6816('0x1')]('CreateOpenchannelQueueReport',{'body':_0x1a09c8,'log':_0x6816('0x2')});};exports[_0x6816('0x3')]=function(_0x3d107f,_0x254db1){return client['Request'](_0x6816('0x4'),{'body':_0x254db1,'options':{'where':{'uniqueid':_0x3d107f},'order':[['id',_0x6816('0x5')]],'limit':0x1},'log':_0x6816('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 13e9090..15c747c 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 _0x4ce6=['../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction'];(function(_0x345333,_0x4c851c){var _0x4594a3=function(_0x946a49){while(--_0x946a49){_0x345333['push'](_0x345333['shift']());}};_0x4594a3(++_0x4c851c);}(_0x4ce6,0x108));var _0x64ce=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x4ce6[_0x2ee790];return _0x5a54a5;};'use strict';var client=require(_0x64ce('0x0'));exports['update']=function(_0x464922,_0x8ab411){return client[_0x64ce('0x1')](_0x64ce('0x2'),{'body':_0x8ab411,'options':{'where':{'id':_0x464922}},'log':_0x64ce('0x3')});};exports[_0x64ce('0x4')]=function(_0x4a8899,_0x469aa){return client['Request']('AddTagsToSmsInteraction',{'body':_0x469aa,'options':{'where':{'id':_0x4a8899}},'log':_0x64ce('0x5')});}; \ No newline at end of file +var _0x5f10=['addTags','Request','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5f10,0xd5));var _0x05f1=function(_0x21bef5,_0x27b94a){_0x21bef5=_0x21bef5-0x0;var _0x524300=_0x5f10[_0x21bef5];return _0x524300;};'use strict';var client=require(_0x05f1('0x0'));exports[_0x05f1('0x1')]=function(_0x4ce609,_0x4fabca){return client['Request'](_0x05f1('0x2'),{'body':_0x4fabca,'options':{'where':{'id':_0x4ce609}},'log':_0x05f1('0x3')});};exports[_0x05f1('0x4')]=function(_0xcb88e1,_0xa8d3b9){return client[_0x05f1('0x5')]('AddTagsToSmsInteraction',{'body':_0xa8d3b9,'options':{'where':{'id':_0xcb88e1}},'log':_0x05f1('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3730214..bcf5f01 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 _0x1196=['../client','create','Request','CreateSmsMessage'];(function(_0x25fde0,_0x3b27b5){var _0x21956f=function(_0x218989){while(--_0x218989){_0x25fde0['push'](_0x25fde0['shift']());}};_0x21956f(++_0x3b27b5);}(_0x1196,0xa0));var _0x6119=function(_0x1c787f,_0x1510de){_0x1c787f=_0x1c787f-0x0;var _0x1c5d2e=_0x1196[_0x1c787f];return _0x1c5d2e;};'use strict';var client=require(_0x6119('0x0'));exports[_0x6119('0x1')]=function(_0x1c17e8){return client[_0x6119('0x2')](_0x6119('0x3'),{'body':_0x1c17e8,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x757b=['../client','create','Request','CreateSmsMessage'];(function(_0x58b223,_0x4ca2ae){var _0x4a2b80=function(_0x335597){while(--_0x335597){_0x58b223['push'](_0x58b223['shift']());}};_0x4a2b80(++_0x4ca2ae);}(_0x757b,0xcc));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb757('0x0'));exports[_0xb757('0x1')]=function(_0x46121e){return client[_0xb757('0x2')](_0xb757('0x3'),{'body':_0x46121e,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d61f753..9973c67 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(_0x46be7a,_0x4aea89){var _0x4f3180=function(_0x43fa6e){while(--_0x43fa6e){_0x46be7a['push'](_0x46be7a['shift']());}};_0x4f3180(++_0x4aea89);}(_0xb7e7,0x121));var _0x7b7e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb7e7[_0x243b2f];return _0xcb3c2d;};'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(_0x218ad1,_0x56bb54){var _0x21b494=function(_0x27b727){while(--_0x27b727){_0x218ad1['push'](_0x218ad1['shift']());}};_0x21b494(++_0x56bb54);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 713a878..710f32e 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x371ed1,_0x34c7f1){var _0x4608f0=function(_0xd313fc){while(--_0xd313fc){_0x371ed1['push'](_0x371ed1['shift']());}};_0x4608f0(++_0x34c7f1);}(_0x34e8,0x12c));var _0x834e=function(_0x3a4314,_0x1effd7){_0x3a4314=_0x3a4314-0x0;var _0x3cf3fe=_0x34e8[_0x3a4314];return _0x3cf3fe;};'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 +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x49635d,_0x2c4e0d){var _0x3fa4fe=function(_0x2b5965){while(--_0x2b5965){_0x49635d['push'](_0x49635d['shift']());}};_0x3fa4fe(++_0x2c4e0d);}(_0x3e74,0x175));var _0x43e7=function(_0x4325e2,_0xa9ae79){_0x4325e2=_0x4325e2-0x0;var _0x47fbb8=_0x3e74[_0x4325e2];return _0x47fbb8;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index ea98d5a..32dc729 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(_0x366d65,_0x3bcbf1){var _0x374760=function(_0x287e85){while(--_0x287e85){_0x366d65['push'](_0x366d65['shift']());}};_0x374760(++_0x3bcbf1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x178e38,_0x25513a){var _0x5f432d=function(_0x59d562){while(--_0x59d562){_0x178e38['push'](_0x178e38['shift']());}};_0x5f432d(++_0x25513a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 b18492b..b3c2f07 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 _0xdb2a=['Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x57aaf7,_0x4a2fff){var _0x15a12e=function(_0x409a05){while(--_0x409a05){_0x57aaf7['push'](_0x57aaf7['shift']());}};_0x15a12e(++_0x4a2fff);}(_0xdb2a,0x16f));var _0xadb2=function(_0x1dc0aa,_0x28f4a2){_0x1dc0aa=_0x1dc0aa-0x0;var _0x47ee5a=_0xdb2a[_0x1dc0aa];return _0x47ee5a;};'use strict';var client=require(_0xadb2('0x0'));exports[_0xadb2('0x1')]=function(_0x2f8658,_0x524798){return client['Request'](_0xadb2('0x2'),{'body':_0x524798,'options':{'where':{'id':_0x2f8658}},'log':_0xadb2('0x3')});};exports['addTags']=function(_0x364980,_0x51f39a){return client[_0xadb2('0x4')](_0xadb2('0x5'),{'body':_0x51f39a,'options':{'where':{'id':_0x364980}},'log':_0xadb2('0x6')});}; \ No newline at end of file +var _0xac6a=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x1e9e08,_0xf4229e){var _0x4063db=function(_0x292e8c){while(--_0x292e8c){_0x1e9e08['push'](_0x1e9e08['shift']());}};_0x4063db(++_0xf4229e);}(_0xac6a,0xc2));var _0xaac6=function(_0x30741d,_0x4b89a0){_0x30741d=_0x30741d-0x0;var _0x11beed=_0xac6a[_0x30741d];return _0x11beed;};'use strict';var client=require(_0xaac6('0x0'));exports[_0xaac6('0x1')]=function(_0x2e9ec8,_0x10ccdc){return client[_0xaac6('0x2')]('UpdateWhatsappInteraction',{'body':_0x10ccdc,'options':{'where':{'id':_0x2e9ec8}},'log':_0xaac6('0x3')});};exports['addTags']=function(_0x9dc043,_0x1a0d76){return client[_0xaac6('0x2')](_0xaac6('0x4'),{'body':_0x1a0d76,'options':{'where':{'id':_0x9dc043}},'log':_0xaac6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index c07cf6b..c4ea8b0 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 _0x1037=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x2f5556,_0x2b6c90){var _0x5523c1=function(_0x5c5886){while(--_0x5c5886){_0x2f5556['push'](_0x2f5556['shift']());}};_0x5523c1(++_0x2b6c90);}(_0x1037,0xa3));var _0x7103=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x1037[_0x258b93];return _0x35484b;};'use strict';var client=require(_0x7103('0x0'));exports[_0x7103('0x1')]=function(_0x58f9c0){return client[_0x7103('0x2')](_0x7103('0x3'),{'body':_0x58f9c0,'log':_0x7103('0x4')});}; \ No newline at end of file +var _0xa64a=['CreateWhatsappMessage','../client'];(function(_0x483f72,_0x529f2e){var _0x998eb=function(_0x5a83c6){while(--_0x5a83c6){_0x483f72['push'](_0x483f72['shift']());}};_0x998eb(++_0x529f2e);}(_0xa64a,0x1e1));var _0xaa64=function(_0x48afd4,_0x478f6b){_0x48afd4=_0x48afd4-0x0;var _0x3bde1e=_0xa64a[_0x48afd4];return _0x3bde1e;};'use strict';var client=require(_0xaa64('0x0'));exports['create']=function(_0x100f1b){return client['Request'](_0xaa64('0x1'),{'body':_0x100f1b,'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 73f73f1..026bd43 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 _0x0af4=['name','timeout','User','Agents','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x208dd7,_0x4113ed){var _0x5c2728=function(_0x50bdd5){while(--_0x50bdd5){_0x208dd7['push'](_0x208dd7['shift']());}};_0x5c2728(++_0x4113ed);}(_0x0af4,0x1cd));var _0x40af=function(_0x190a79,_0x498433){_0x190a79=_0x190a79-0x0;var _0x391bdc=_0x0af4[_0x190a79];return _0x391bdc;};'use strict';var client=require(_0x40af('0x0'));exports[_0x40af('0x1')]=function(){return function(){return client['Request'](_0x40af('0x2'),{'options':{'raw':![],'attributes':['id',_0x40af('0x3'),_0x40af('0x4'),'strategy'],'include':[{'model':_0x40af('0x5'),'as':_0x40af('0x6'),'attributes':['id',_0x40af('0x3'),'online',_0x40af('0x7')]}]},'log':_0x40af('0x1')});};}; \ No newline at end of file +var _0x1787=['whatsappPause','getWhatsappQueues','Request','timeout','strategy','name'];(function(_0x13465b,_0x4f3abf){var _0x58cbe2=function(_0x25620f){while(--_0x25620f){_0x13465b['push'](_0x13465b['shift']());}};_0x58cbe2(++_0x4f3abf);}(_0x1787,0x18d));var _0x7178=function(_0xf906e5,_0x114ddd){_0xf906e5=_0xf906e5-0x0;var _0x59e6d1=_0x1787[_0xf906e5];return _0x59e6d1;};'use strict';var client=require('../client');exports[_0x7178('0x0')]=function(){return function(){return client[_0x7178('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x7178('0x2'),_0x7178('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7178('0x4'),'online',_0x7178('0x5')]}]},'log':_0x7178('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 21cbf5d..7fdcfee 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 _0x412c=['DESC','../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x22074d,_0x33df85){var _0x3a24ce=function(_0x1dfb83){while(--_0x1dfb83){_0x22074d['push'](_0x22074d['shift']());}};_0x3a24ce(++_0x33df85);}(_0x412c,0x19e));var _0xc412=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x412c[_0xc4001c];return _0x49f7bc;};'use strict';var client=require(_0xc412('0x0'));exports[_0xc412('0x1')]=function(_0x11f05b){return client['Request']('CreateWhatsappQueueReport',{'body':_0x11f05b,'log':_0xc412('0x2')});};exports[_0xc412('0x3')]=function(_0x2dbd03,_0x51b628){return client[_0xc412('0x4')](_0xc412('0x5'),{'body':_0x51b628,'options':{'where':{'uniqueid':_0x2dbd03},'order':[['id',_0xc412('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x8555=['UpdateWhatsappQueueReport','DESC','create','CreateWhatsappQueueReport','Request'];(function(_0x20d11c,_0x511b87){var _0x3cf1ee=function(_0x5718dd){while(--_0x5718dd){_0x20d11c['push'](_0x20d11c['shift']());}};_0x3cf1ee(++_0x511b87);}(_0x8555,0x1b5));var _0x5855=function(_0x4b2faa,_0x379bcb){_0x4b2faa=_0x4b2faa-0x0;var _0x2b07e8=_0x8555[_0x4b2faa];return _0x2b07e8;};'use strict';var client=require('../client');exports[_0x5855('0x0')]=function(_0x147ad5){return client['Request'](_0x5855('0x1'),{'body':_0x147ad5,'log':_0x5855('0x1')});};exports['update']=function(_0x166816,_0x149270){return client[_0x5855('0x2')](_0x5855('0x3'),{'body':_0x149270,'options':{'where':{'uniqueid':_0x166816},'order':[['id',_0x5855('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 5774b19..e47add8 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 _0x0165=['[%s][AGENT]\x20ROUTING\x20STOPPED','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','length','error','[%s][AGENT]\x20%s','map','message','stop','agents','timeout','createQueue','channel','START:%s','rules'];(function(_0x168bcf,_0x5ca5f8){var _0x52aaae=function(_0x15c60f){while(--_0x15c60f){_0x168bcf['push'](_0x168bcf['shift']());}};_0x52aaae(++_0x5ca5f8);}(_0x0165,0x192));var _0x5016=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0165[_0x432682];return _0x463d05;};'use strict';var schema=require(_0x5016('0x0'));var _=require(_0x5016('0x1'));var util=require(_0x5016('0x2'));var seqqueue=require(_0x5016('0x3'));var logger=require(_0x5016('0x4'))(_0x5016('0x5'));var strategy=require(_0x5016('0x6'));var queue=schema({'name':{'type':_0x5016('0x7'),'required':!![],'message':_0x5016('0x8')},'timeout':{'type':_0x5016('0x9'),'message':_0x5016('0xa')}});function writeLog(_0x4879c4,_0xfc4c74,_0x125296){return logger[_0x5016('0xb')](util[_0x5016('0xc')](_0x5016('0xd'),_0x4879c4,_0xfc4c74[_0x5016('0xe')],_0x125296));}function handleFindAgent(_0x401be6){return function(_0x17af9c){return _0x17af9c[_0x5016('0xe')]['toLowerCase']()===_0x401be6['toLowerCase']();};}exports['consequence']=function(_0x282053,_0x4b080b,_0x2b35d0,_0x1330bf){return function(_0x219c1e){try{var _0x313d42={'name':_0x4b080b[0x0],'timeout':_0x4b080b[0x1]};var _0x4d07af=queue[_0x5016('0x0')](_0x313d42,{'typecast':!![]});if(_0x4d07af[_0x5016('0xf')]){logger[_0x5016('0x10')](_0x5016('0x11'),_0x282053,_[_0x5016('0x12')](_0x4d07af,_0x5016('0x13'))['join'](',\x20'));_0x219c1e[_0x5016('0x14')]();}else{var _0x10f17f=_['find'](_0x2b35d0[_0x5016('0x15')],handleFindAgent(_0x313d42['name']));if(_0x10f17f){var _0x154152=(_0x313d42[_0x5016('0x16')]||0xa)*0x3e8;var _0x3a9ff1,_0x49e168;var _0x18b684=seqqueue[_0x5016('0x17')](_0x154152);_0x18b684['id']=_0x282053;_0x18b684['atimeout']=_0x154152;_0x18b684['channel']=_0x1330bf[_0x5016('0x18')];writeLog(_0x282053,_0x10f17f,util[_0x5016('0xc')](_0x5016('0x19'),_0x154152));_0x2b35d0[_0x5016('0x1a')][_0x282053]['on']('end',function(){logger[_0x5016('0xb')](_0x5016('0x1b'),_0x282053);clearTimeout(_0x49e168);_0x49e168=undefined;_0x18b684['close']();if(_0x2b35d0[_0x5016('0x1a')][_0x282053]){delete _0x2b35d0[_0x5016('0x1a')][_0x282053];}_0x219c1e[_0x5016('0x14')]();});_0x2b35d0[_0x5016('0x1a')][_0x282053]['on'](_0x5016('0x1c'),function(){if(_0x2b35d0[_0x5016('0x1a')][_0x282053]){delete _0x2b35d0[_0x5016('0x1a')][_0x282053];}});_0x49e168=setTimeout(function(){logger[_0x5016('0xb')]('[%s][AGENT]\x20ROUTING\x20END',_0x282053);clearTimeout(_0x49e168);_0x18b684['close']();_0x219c1e[_0x5016('0x1d')]();},_0x154152);strategy[_0x5016('0x1e')](_0x18b684,_0x10f17f,_0x2b35d0,_0x1330bf);}else{logger[_0x5016('0x10')](_0x5016('0x1f'),_0x282053,_0x313d42[_0x5016('0xe')]);_0x219c1e[_0x5016('0x14')]();}}}catch(_0x59a9bb){console['log'](_0x59a9bb);logger[_0x5016('0x10')]('[%s][QUEUE]\x20%s',_0x282053,_0x59a9bb[_0x5016('0x20')]);_0x219c1e[_0x5016('0x14')]();}};}; \ No newline at end of file +var _0xbea2=['stop','find','agents','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','map','message','join'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xbea2,0x122));var _0x2bea=function(_0xb09034,_0x2f580c){_0xb09034=_0xb09034-0x0;var _0x5785ed=_0xbea2[_0xb09034];return _0x5785ed;};'use strict';var schema=require(_0x2bea('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x2bea('0x1'));var logger=require(_0x2bea('0x2'))(_0x2bea('0x3'));var strategy=require(_0x2bea('0x4'));var queue=schema({'name':{'type':_0x2bea('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x2bea('0x6')}});function writeLog(_0x57870d,_0x2fcf4f,_0x275949){return logger[_0x2bea('0x7')](util[_0x2bea('0x8')](_0x2bea('0x9'),_0x57870d,_0x2fcf4f['name'],_0x275949));}function handleFindAgent(_0x307976){return function(_0x58ca3d){return _0x58ca3d[_0x2bea('0xa')]['toLowerCase']()===_0x307976[_0x2bea('0xb')]();};}exports[_0x2bea('0xc')]=function(_0x49f448,_0x2c8c9b,_0x1bf0cf,_0x93d6a9){return function(_0x1cdd0d){try{var _0x2eece0={'name':_0x2c8c9b[0x0],'timeout':_0x2c8c9b[0x1]};var _0x1c2d2a=queue[_0x2bea('0x0')](_0x2eece0,{'typecast':!![]});if(_0x1c2d2a['length']){logger['error']('[%s][AGENT]\x20%s',_0x49f448,_[_0x2bea('0xd')](_0x1c2d2a,_0x2bea('0xe'))[_0x2bea('0xf')](',\x20'));_0x1cdd0d[_0x2bea('0x10')]();}else{var _0x25d73a=_[_0x2bea('0x11')](_0x1bf0cf[_0x2bea('0x12')],handleFindAgent(_0x2eece0[_0x2bea('0xa')]));if(_0x25d73a){var _0x2fc698=(_0x2eece0['timeout']||0xa)*0x3e8;var _0x1a0deb,_0x47a005;var _0x342455=seqqueue[_0x2bea('0x13')](_0x2fc698);_0x342455['id']=_0x49f448;_0x342455[_0x2bea('0x14')]=_0x2fc698;_0x342455[_0x2bea('0x15')]=_0x93d6a9['channel'];writeLog(_0x49f448,_0x25d73a,util[_0x2bea('0x8')](_0x2bea('0x16'),_0x2fc698));_0x1bf0cf['rules'][_0x49f448]['on'](_0x2bea('0x17'),function(){logger[_0x2bea('0x7')](_0x2bea('0x18'),_0x49f448);clearTimeout(_0x47a005);_0x47a005=undefined;_0x342455['close']();if(_0x1bf0cf[_0x2bea('0x19')][_0x49f448]){delete _0x1bf0cf['rules'][_0x49f448];}_0x1cdd0d[_0x2bea('0x10')]();});_0x1bf0cf['rules'][_0x49f448]['on']('complete',function(){if(_0x1bf0cf[_0x2bea('0x19')][_0x49f448]){delete _0x1bf0cf[_0x2bea('0x19')][_0x49f448];}});_0x47a005=setTimeout(function(){logger[_0x2bea('0x7')](_0x2bea('0x1a'),_0x49f448);clearTimeout(_0x47a005);_0x342455[_0x2bea('0x1b')]();_0x1cdd0d[_0x2bea('0x1c')]();},_0x2fc698);strategy[_0x2bea('0x1d')](_0x342455,_0x25d73a,_0x1bf0cf,_0x93d6a9);}else{logger[_0x2bea('0x1e')](_0x2bea('0x1f'),_0x49f448,_0x2eece0[_0x2bea('0xa')]);_0x1cdd0d[_0x2bea('0x10')]();}}}catch(_0x174726){console[_0x2bea('0x20')](_0x174726);logger[_0x2bea('0x1e')](_0x2bea('0x21'),_0x49f448,_0x174726['stack']);_0x1cdd0d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index a33832b..8bcf89e 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 _0xee02=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','providerName','amazonlex','providerResponse','create','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','Message','then','catch','error'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xee02,0x99));var _0x2ee0=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xee02[_0x57db49];return _0xd0636f;};'use strict';var _=require(_0x2ee0('0x0'));var moment=require(_0x2ee0('0x1'));var AWS=require(_0x2ee0('0x2'));var utils=require('./utils');var logger=require(_0x2ee0('0x3'))(_0x2ee0('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2ee0('0x5')),'smsMessage':require(_0x2ee0('0x6')),'faxMessage':require(_0x2ee0('0x7')),'whatsappMessage':require(_0x2ee0('0x8'))};exports[_0x2ee0('0x9')]=function(_0x271bea,_0x229129){return function(_0x4716f1){try{if(!_[_0x2ee0('0xa')](this[_0x2ee0('0xb')][_0x2ee0('0xc')])){logger[_0x2ee0('0xd')](_0x2ee0('0xe'),_0x271bea,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4716f1[_0x2ee0('0xf')]();}var _0x5dd1ee={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2ee0('0x10')](_0x2ee0('0x11')),'direction':_0x2ee0('0x12')};if(this[_0x2ee0('0x13')]===_0x2ee0('0x14')||this[_0x2ee0('0x13')]===_0x2ee0('0x15')){_0x5dd1ee[_0x2ee0('0x16')]=this['interaction'][_0x2ee0('0x16')];}var _0x126939=this[_0x2ee0('0x13')];if(_0x126939==='chat'){_0x5dd1ee[_0x2ee0('0x17')]=this['account']['id'];}else{_0x5dd1ee[_[_0x2ee0('0x18')](_0x126939)+_0x2ee0('0x19')]=this[_0x2ee0('0x1a')]['id'];}_0x5dd1ee[_[_0x2ee0('0x18')](_0x126939)+_0x2ee0('0x1b')]=this[_0x2ee0('0xb')]['id'];if(this[_0x2ee0('0xb')]['created']){var _0x1225db=_0x229129[0x4];if(!_[_0x2ee0('0x1c')](_0x1225db)){_0x5dd1ee[_0x2ee0('0x1d')]=utils[_0x2ee0('0x1e')](_0x1225db,this);return rpc[_0x126939+_0x2ee0('0x1f')]['create'](_0x5dd1ee)[_0x2ee0('0x20')](function(_0x25d2df){logger[_0x2ee0('0xd')](_0x2ee0('0xe'),_0x271bea,_0x5dd1ee[_0x2ee0('0x1d')]);})[_0x2ee0('0x21')](function(_0x3eeb6a){logger[_0x2ee0('0x22')](_0x2ee0('0xe'),_0x271bea,JSON[_0x2ee0('0x23')](_0x3eeb6a));})[_0x2ee0('0x24')](function(){logger['info'](_0x2ee0('0x25'),_0x271bea);_0x4716f1[_0x2ee0('0x26')]();});}else{logger[_0x2ee0('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x271bea);_0x4716f1[_0x2ee0('0x26')]();}}else{var _0x17c97f=this;var _0x38e97f=new AWS[(_0x2ee0('0x27'))]({'accessKeyId':_0x229129[0x0],'secretAccessKey':_0x229129[0x1],'region':_0x229129[0x2]});var _0xe79f82={'botAlias':'$LATEST','botName':_0x229129[0x3],'inputText':this[_0x2ee0('0x28')][_0x2ee0('0x1d')],'userId':this['channel']+':'+this[_0x2ee0('0xb')]['id'][_0x2ee0('0x29')]()};_0x38e97f['postText'](_0xe79f82,function(_0x219fdb,_0x5e8772){if(_0x219fdb){logger[_0x2ee0('0x22')](_0x2ee0('0xe'),_0x271bea,_0x219fdb['message']);_0x4716f1['next']();}else if(_0x5e8772&&_0x5e8772[_0x2ee0('0x28')]){_0x17c97f['body']['amazonlex']=_0x5e8772;_0x5dd1ee['body']=_0x5e8772['message'];_0x5dd1ee[_0x2ee0('0x2a')]=_0x2ee0('0x2b');_0x5dd1ee[_0x2ee0('0x2c')]=JSON[_0x2ee0('0x23')](_0x5e8772);return rpc[_0x126939+_0x2ee0('0x1f')][_0x2ee0('0x2d')](_0x5dd1ee)[_0x2ee0('0x20')](function(_0x58554f){logger[_0x2ee0('0xd')](_0x2ee0('0xe'),_0x271bea,_0x5dd1ee[_0x2ee0('0x1d')]);if(_0x5e8772['dialogState']==_0x2ee0('0x2e')){_0x4716f1[_0x2ee0('0xf')]();}else{_0x4716f1['stop']();}})[_0x2ee0('0x21')](function(_0x5e614f){logger[_0x2ee0('0x22')](_0x2ee0('0xe'),_0x271bea,JSON['stringify'](_0x5e614f));_0x4716f1[_0x2ee0('0xf')]();});}else{_0x4716f1[_0x2ee0('0xf')]();}});}}catch(_0x2355ca){logger[_0x2ee0('0x22')](_0x2ee0('0xe'),_0x271bea,JSON[_0x2ee0('0x23')](_0x2355ca));_0x4716f1[_0x2ee0('0x26')]();}};}; \ No newline at end of file +var _0x6413=['aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','getMustacheRender','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','$LATEST','toString','postText','message','amazonlex','providerName','providerResponse','Message','dialogState','Failed','lodash','moment'];(function(_0x53f147,_0x2328c6){var _0x3b4eb7=function(_0x551acf){while(--_0x551acf){_0x53f147['push'](_0x53f147['shift']());}};_0x3b4eb7(++_0x2328c6);}(_0x6413,0x1de));var _0x3641=function(_0x532b14,_0x12923d){_0x532b14=_0x532b14-0x0;var _0x1b2917=_0x6413[_0x532b14];return _0x1b2917;};'use strict';var _=require(_0x3641('0x0'));var moment=require(_0x3641('0x1'));var AWS=require(_0x3641('0x2'));var utils=require('./utils');var logger=require(_0x3641('0x3'))(_0x3641('0x4'));var rpc={'chatMessage':require(_0x3641('0x5')),'openchannelMessage':require(_0x3641('0x6')),'mailMessage':require(_0x3641('0x7')),'smsMessage':require(_0x3641('0x8')),'faxMessage':require(_0x3641('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3641('0xa')]=function(_0x26cae9,_0x4f7d3a){return function(_0x1a0dfd){try{if(!_[_0x3641('0xb')](this[_0x3641('0xc')][_0x3641('0xd')])){logger[_0x3641('0xe')](_0x3641('0xf'),_0x26cae9,_0x3641('0x10'));return _0x1a0dfd[_0x3641('0x11')]();}var _0x3b6e1f={'ContactId':this[_0x3641('0x12')]['id'],'sentAt':moment()['format'](_0x3641('0x13')),'direction':_0x3641('0x14')};if(this[_0x3641('0x15')]===_0x3641('0x16')||this[_0x3641('0x15')]===_0x3641('0x17')){_0x3b6e1f[_0x3641('0x18')]=this[_0x3641('0xc')]['phone'];}var _0x219063=this[_0x3641('0x15')];if(_0x219063===_0x3641('0x19')){_0x3b6e1f[_0x3641('0x1a')]=this[_0x3641('0x1b')]['id'];}else{_0x3b6e1f[_[_0x3641('0x1c')](_0x219063)+_0x3641('0x1d')]=this[_0x3641('0x1b')]['id'];}_0x3b6e1f[_[_0x3641('0x1c')](_0x219063)+'InteractionId']=this[_0x3641('0xc')]['id'];if(this[_0x3641('0xc')]['created']){var _0xd9ebc3=_0x4f7d3a[0x4];if(!_['isEmpty'](_0xd9ebc3)){_0x3b6e1f['body']=utils[_0x3641('0x1e')](_0xd9ebc3,this);return rpc[_0x219063+'Message']['create'](_0x3b6e1f)['then'](function(_0x2f7802){logger['info']('[%s][AMAZONLEX]\x20%s',_0x26cae9,_0x3b6e1f[_0x3641('0x1f')]);})[_0x3641('0x20')](function(_0x5612a5){logger[_0x3641('0x21')](_0x3641('0xf'),_0x26cae9,JSON[_0x3641('0x22')](_0x5612a5));})[_0x3641('0x23')](function(){logger[_0x3641('0xe')](_0x3641('0x24'),_0x26cae9);_0x1a0dfd['stop']();});}else{logger[_0x3641('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x26cae9);_0x1a0dfd[_0x3641('0x25')]();}}else{var _0x13b5ac=this;var _0x3cdd3b=new AWS['LexRuntime']({'accessKeyId':_0x4f7d3a[0x0],'secretAccessKey':_0x4f7d3a[0x1],'region':_0x4f7d3a[0x2]});var _0x153572={'botAlias':_0x3641('0x26'),'botName':_0x4f7d3a[0x3],'inputText':this['message'][_0x3641('0x1f')],'userId':this[_0x3641('0x15')]+':'+this['interaction']['id'][_0x3641('0x27')]()};_0x3cdd3b[_0x3641('0x28')](_0x153572,function(_0x5c0848,_0x21f87e){if(_0x5c0848){logger[_0x3641('0x21')](_0x3641('0xf'),_0x26cae9,_0x5c0848[_0x3641('0x29')]);_0x1a0dfd['next']();}else if(_0x21f87e&&_0x21f87e[_0x3641('0x29')]){_0x13b5ac[_0x3641('0x1f')][_0x3641('0x2a')]=_0x21f87e;_0x3b6e1f['body']=_0x21f87e[_0x3641('0x29')];_0x3b6e1f[_0x3641('0x2b')]=_0x3641('0x2a');_0x3b6e1f[_0x3641('0x2c')]=JSON[_0x3641('0x22')](_0x21f87e);return rpc[_0x219063+_0x3641('0x2d')]['create'](_0x3b6e1f)['then'](function(_0x2d1690){logger['info'](_0x3641('0xf'),_0x26cae9,_0x3b6e1f['body']);if(_0x21f87e[_0x3641('0x2e')]==_0x3641('0x2f')){_0x1a0dfd[_0x3641('0x11')]();}else{_0x1a0dfd[_0x3641('0x25')]();}})['catch'](function(_0x2d595a){logger[_0x3641('0x21')]('[%s][AMAZONLEX]\x20%s',_0x26cae9,JSON['stringify'](_0x2d595a));_0x1a0dfd[_0x3641('0x11')]();});}else{_0x1a0dfd[_0x3641('0x11')]();}});}}catch(_0x2024c5){logger['error'](_0x3641('0xf'),_0x26cae9,JSON[_0x3641('0x22')](_0x2024c5));_0x1a0dfd[_0x3641('0x25')]();}};}; \ 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 3fb04ba..b86e099 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 _0x9bf9=['authentication','auth','user','pass','html','replace','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','[%s][AUTOREPLY]\x20%s','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','catch','error','Message','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','body','getMustacheRender','message','from','mail','phone','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','service','Smtp','port','secure'];(function(_0xcc3eb8,_0x544d1b){var _0x1f7cb0=function(_0x535e1b){while(--_0x535e1b){_0xcc3eb8['push'](_0xcc3eb8['shift']());}};_0x1f7cb0(++_0x544d1b);}(_0x9bf9,0x67));var _0x99bf=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x9bf9[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var moment=require(_0x99bf('0x0'));var utils=require(_0x99bf('0x1'));var logger=require(_0x99bf('0x2'))(_0x99bf('0x3'));var rpc={'chatMessage':require(_0x99bf('0x4')),'openchannelMessage':require(_0x99bf('0x5')),'mailMessage':require(_0x99bf('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x99bf('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x99bf('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x99bf('0x9')),'faxInteraction':require(_0x99bf('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x99bf('0xb'));exports[_0x99bf('0xc')]=function(_0x24ee56,_0x225175,_0x4140e8,_0x192d04){return function(_0x53acc6){try{var _0x1ec91f=this['channel'];if(_0x1ec91f==='mail'&&_0x192d04['body'][_0x99bf('0xd')]){logger[_0x99bf('0xe')]('[%s][AUTOREPLY]\x20%s',_0x24ee56,_0x99bf('0xf'));return _0x53acc6[_0x99bf('0x10')]();}if(_0x225175[0x0]==='1'&&(_[_0x99bf('0x11')](this[_0x99bf('0x12')][_0x99bf('0x13')])||!this[_0x99bf('0x12')][_0x99bf('0x13')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x24ee56,_0x99bf('0x14'));return _0x53acc6[_0x99bf('0x10')]();}if(_0x225175[0x0]==='2'&&this[_0x99bf('0x12')]['autoreplyExecuted']){logger['info'](_0x99bf('0x15'),_0x24ee56,_0x99bf('0x16'));return _0x53acc6[_0x99bf('0x10')]();}var _0x37c0b7={'ContactId':this[_0x99bf('0x17')]['id'],'sentAt':moment()[_0x99bf('0x18')](_0x99bf('0x19')),'direction':_0x99bf('0x1a')};if(this[_0x99bf('0x1b')]==='mail'){_0x37c0b7[_0x99bf('0x1c')]=utils[_0x99bf('0x1d')](_0x225175[0x2],this);}else{_0x37c0b7[_0x99bf('0x1c')]=utils[_0x99bf('0x1d')](_0x225175[0x1],this);}if(this[_0x99bf('0x1e')]){_0x37c0b7['to']=this['message'][_0x99bf('0x1f')]||'';if(this[_0x99bf('0x1b')]===_0x99bf('0x20')&&_0x225175[0x1]==='1'){_0x37c0b7['cc']=this['message']['cc']||'';}_0x37c0b7['from']=this[_0x99bf('0x1e')]['to']||'';_0x37c0b7['phone']=this['message'][_0x99bf('0x21')]||'';_0x37c0b7['read']=!![];if(this[_0x99bf('0x1e')][_0x99bf('0x22')]){_0x37c0b7['subject']='';_0x37c0b7[_0x99bf('0x22')]+=_[_0x99bf('0x23')](this[_0x99bf('0x1e')][_0x99bf('0x22')],_0x99bf('0x24'))?'':_0x99bf('0x25');_0x37c0b7[_0x99bf('0x22')]+=this['message'][_0x99bf('0x22')];}}if(this[_0x99bf('0x1b')]==='chat'){_0x37c0b7[_0x99bf('0x26')]=this[_0x99bf('0x27')]['id'];}else{_0x37c0b7[_[_0x99bf('0x28')](this[_0x99bf('0x1b')])+_0x99bf('0x29')]=this[_0x99bf('0x27')]['id'];}_0x37c0b7[_[_0x99bf('0x28')](this[_0x99bf('0x1b')])+_0x99bf('0x2a')]=this['interaction']['id'];var _0x4a78c2=this[_0x99bf('0x12')];if(rpc[this['channel']+'Message']){if(this[_0x99bf('0x1b')]===_0x99bf('0x20')){var _0x36fb0b={'tls':{'rejectUnauthorized':![]}};if(this[_0x99bf('0x27')]['Smtp'][_0x99bf('0x2b')]){_0x36fb0b[_0x99bf('0x2b')]=this[_0x99bf('0x27')]['Smtp'][_0x99bf('0x2b')];}else{_0x36fb0b['host']=this[_0x99bf('0x27')][_0x99bf('0x2c')]['host'];_0x36fb0b[_0x99bf('0x2d')]=this[_0x99bf('0x27')][_0x99bf('0x2c')][_0x99bf('0x2d')];_0x36fb0b[_0x99bf('0x2e')]=this[_0x99bf('0x27')][_0x99bf('0x2c')]['secure'];}if(this[_0x99bf('0x27')][_0x99bf('0x2c')][_0x99bf('0x2f')]){_0x36fb0b[_0x99bf('0x30')]={'user':this[_0x99bf('0x27')][_0x99bf('0x2c')][_0x99bf('0x31')],'pass':this['account']['Smtp'][_0x99bf('0x32')]};}_0x37c0b7['inReplyTo']=this['message']['messageId'];_0x37c0b7[_0x99bf('0x33')]=''+_[_0x99bf('0x34')](_0x37c0b7[_0x99bf('0x1c')],'','replace','headers','auto-replied','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x4041f6,_0x29203f){var _0x223ef3=function(_0x2e5fca){while(--_0x2e5fca){_0x4041f6['push'](_0x4041f6['shift']());}};_0x223ef3(++_0x29203f);}(_0x9244,0x1b2));var _0x4924=function(_0x316269,_0x44c58f){_0x316269=_0x316269-0x0;var _0x484541=_0x9244[_0x316269];return _0x484541;};'use strict';var _=require(_0x4924('0x0'));var moment=require(_0x4924('0x1'));var utils=require(_0x4924('0x2'));var logger=require(_0x4924('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4924('0x4')),'mailMessage':require(_0x4924('0x5')),'smsMessage':require(_0x4924('0x6')),'faxMessage':require(_0x4924('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x4924('0x8')),'openchannelInteraction':require(_0x4924('0x9')),'mailInteraction':require(_0x4924('0xa')),'smsInteraction':require(_0x4924('0xb')),'faxInteraction':require(_0x4924('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x4924('0xd'));exports[_0x4924('0xe')]=function(_0x4130f5,_0x31712c,_0x5ee3ec,_0x5002f0){return function(_0xc2ce91){try{var _0x5e4f63=this[_0x4924('0xf')];if(_0x5e4f63===_0x4924('0x10')&&_0x5002f0[_0x4924('0x11')][_0x4924('0x12')]){logger['info'](_0x4924('0x13'),_0x4130f5,_0x4924('0x14'));return _0xc2ce91[_0x4924('0x15')]();}if(_0x31712c[0x0]==='1'&&(_['isNil'](this[_0x4924('0x16')][_0x4924('0x17')])||!this[_0x4924('0x16')][_0x4924('0x17')])){logger[_0x4924('0x18')](_0x4924('0x13'),_0x4130f5,'Autoreply\x20already\x20sent');return _0xc2ce91['next']();}if(_0x31712c[0x0]==='2'&&this[_0x4924('0x16')][_0x4924('0x19')]){logger[_0x4924('0x18')](_0x4924('0x1a'),_0x4130f5,_0x4924('0x1b'));return _0xc2ce91[_0x4924('0x15')]();}var _0x2bfe74={'ContactId':this[_0x4924('0x1c')]['id'],'sentAt':moment()[_0x4924('0x1d')](_0x4924('0x1e')),'direction':_0x4924('0x1f')};if(this[_0x4924('0xf')]===_0x4924('0x10')){_0x2bfe74[_0x4924('0x11')]=utils[_0x4924('0x20')](_0x31712c[0x2],this);}else{_0x2bfe74[_0x4924('0x11')]=utils[_0x4924('0x20')](_0x31712c[0x1],this);}if(this['message']){_0x2bfe74['to']=this[_0x4924('0x21')][_0x4924('0x22')]||'';if(this[_0x4924('0xf')]===_0x4924('0x10')&&_0x31712c[0x1]==='1'){_0x2bfe74['cc']=this[_0x4924('0x21')]['cc']||'';}_0x2bfe74[_0x4924('0x22')]=this['message']['to']||'';_0x2bfe74[_0x4924('0x23')]=this[_0x4924('0x21')]['phone']||'';_0x2bfe74[_0x4924('0x24')]=!![];if(this[_0x4924('0x21')][_0x4924('0x25')]){_0x2bfe74[_0x4924('0x25')]='';_0x2bfe74[_0x4924('0x25')]+=_[_0x4924('0x26')](this[_0x4924('0x21')][_0x4924('0x25')],'Re:')?'':_0x4924('0x27');_0x2bfe74[_0x4924('0x25')]+=this[_0x4924('0x21')]['subject'];}}if(this[_0x4924('0xf')]===_0x4924('0x28')){_0x2bfe74[_0x4924('0x29')]=this[_0x4924('0x2a')]['id'];}else{_0x2bfe74[_[_0x4924('0x2b')](this['channel'])+_0x4924('0x2c')]=this['account']['id'];}_0x2bfe74[_['upperFirst'](this[_0x4924('0xf')])+_0x4924('0x2d')]=this[_0x4924('0x16')]['id'];var _0x4d4c5c=this['interaction'];if(rpc[this[_0x4924('0xf')]+_0x4924('0x2e')]){if(this[_0x4924('0xf')]==='mail'){var _0x27d370={'tls':{'rejectUnauthorized':![]}};if(this[_0x4924('0x2a')]['Smtp']['service']){_0x27d370['service']=this['account'][_0x4924('0x2f')][_0x4924('0x30')];}else{_0x27d370[_0x4924('0x31')]=this[_0x4924('0x2a')][_0x4924('0x2f')][_0x4924('0x31')];_0x27d370[_0x4924('0x32')]=this['account'][_0x4924('0x2f')][_0x4924('0x32')];_0x27d370['secure']=this[_0x4924('0x2a')][_0x4924('0x2f')][_0x4924('0x33')];}if(this['account'][_0x4924('0x2f')]['authentication']){_0x27d370[_0x4924('0x34')]={'user':this[_0x4924('0x2a')][_0x4924('0x2f')]['user'],'pass':this[_0x4924('0x2a')][_0x4924('0x2f')]['pass']};}_0x2bfe74[_0x4924('0x35')]=this[_0x4924('0x21')]['messageId'];_0x2bfe74[_0x4924('0x36')]=_0x4924('0x37')+_[_0x4924('0x38')](_0x2bfe74[_0x4924('0x11')],'';_0x2bfe74[_0x4924('0x39')]={'Auto-Submitted':_0x4924('0x3a'),'X-Auto-Response-Suppress':'All','Precedence':_0x4924('0x3b')};return mailRpc[_0x4924('0x3c')](_0x27d370,_0x2bfe74)[_0x4924('0x3d')](function(_0x5bfed2){logger[_0x4924('0x18')](_0x4924('0x3e'),_0x4130f5);_0x2bfe74[_0x4924('0x3f')]=_0x5bfed2['message'][_0x4924('0x3f')];return rpc[_0x5e4f63+_0x4924('0x2e')][_0x4924('0x40')](_0x2bfe74);})[_0x4924('0x3d')](function(_0x523955){logger['info'](_0x4924('0x13'),_0x4130f5,JSON[_0x4924('0x41')](_0x523955));})[_0x4924('0x42')](function(_0x2e6d83){logger[_0x4924('0x43')](_0x4924('0x44'),_0x4130f5,JSON[_0x4924('0x41')](_0x2e6d83));})[_0x4924('0x45')](function(){Promise[_0x4924('0x46')]()[_0x4924('0x3d')](function(){if(_0x31712c[0x0]!=='2'||_0x4d4c5c[_0x4924('0x19')])return;return rpc[_0x5e4f63+_0x4924('0x47')][_0x4924('0x48')](_0x4d4c5c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x26044e){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4130f5,JSON[_0x4924('0x41')](_0x26044e));})[_0x4924('0x42')](function(_0x293f4d){logger[_0x4924('0x43')](_0x4924('0x49'),_0x4130f5,JSON['stringify'](_0x293f4d));});})['then'](function(){_0xc2ce91[_0x4924('0x15')]();});});}else{return rpc[this[_0x4924('0xf')]+'Message'][_0x4924('0x40')](_0x2bfe74)[_0x4924('0x3d')](function(_0x1e2b3d){logger['info'](_0x4924('0x13'),_0x4130f5,_0x2bfe74[_0x4924('0x11')]);})[_0x4924('0x42')](function(_0x3eabe4){logger[_0x4924('0x43')](_0x4924('0x13'),_0x4130f5,JSON[_0x4924('0x41')](_0x3eabe4));})[_0x4924('0x45')](function(){Promise[_0x4924('0x46')]()[_0x4924('0x3d')](function(){if(_0x31712c[0x0]!=='2'||_0x4d4c5c[_0x4924('0x19')])return;return rpc[_0x5e4f63+'Interaction'][_0x4924('0x48')](_0x4d4c5c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x58ce71){logger[_0x4924('0x18')](_0x4924('0x1a'),_0x4130f5,JSON[_0x4924('0x41')](_0x58ce71));})['catch'](function(_0x406ede){logger['error'](_0x4924('0x49'),_0x4130f5,JSON[_0x4924('0x41')](_0x406ede));});})[_0x4924('0x3d')](function(){_0xc2ce91['next']();});});}}}catch(_0x4ee65d){logger[_0x4924('0x43')]('[%s][AUTOREPLY]\x20%s',_0x4130f5,JSON['stringify'](_0x4ee65d));_0xc2ce91['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 622fb80..334da97 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7117=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','system','channel','update','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','routing','../../rpc/chatInteraction'];(function(_0x4ed94f,_0x411d81){var _0x23526b=function(_0x57abab){while(--_0x57abab){_0x4ed94f['push'](_0x4ed94f['shift']());}};_0x23526b(++_0x411d81);}(_0x7117,0x1b6));var _0x7711=function(_0x4dae91,_0x95fd3f){_0x4dae91=_0x4dae91-0x0;var _0x103ab9=_0x7117[_0x4dae91];return _0x103ab9;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x7711('0x0'));var rpc={'chatInteraction':require(_0x7711('0x1')),'openchannelInteraction':require(_0x7711('0x2')),'smsInteraction':require(_0x7711('0x3')),'mailInteraction':require(_0x7711('0x4')),'faxInteraction':require(_0x7711('0x5')),'whatsappInteraction':require(_0x7711('0x6'))};exports[_0x7711('0x7')]=function(_0x491fe4,_0xfbbd13,_0x525f4a,_0x3c9604){return function(_0x2c150f){try{logger['info'](_0x7711('0x8'),_0x491fe4,_0xfbbd13[0x0]);var _0x48f605={'closed':0x1,'closedAt':moment()[_0x7711('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7711('0xa'),'disposition':_0xfbbd13[0x0]};if(rpc[_0x3c9604[_0x7711('0xb')]+'Interaction']){rpc[_0x3c9604[_0x7711('0xb')]+'Interaction'][_0x7711('0xc')](_0x3c9604['interaction']['id'],_0x48f605)['then'](function(_0x3b477c){logger[_0x7711('0xd')](_0x7711('0xe'),_0x491fe4,_0x3c9604[_0x7711('0xf')]['id']);})[_0x7711('0x10')](function(_0x44e223){logger[_0x7711('0x11')](_0x7711('0x12'),_0x491fe4,JSON[_0x7711('0x13')](_0x44e223));})[_0x7711('0x14')](function(){_0x2c150f[_0x7711('0x15')]();});}}catch(_0x43dc3e){logger[_0x7711('0x11')](_0x7711('0x12'),_0x491fe4,JSON[_0x7711('0x13')](_0x43dc3e));_0x2c150f[_0x7711('0x15')]();}};}; \ No newline at end of file +var _0x483b=['format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0xc0921a,_0x1f107f){var _0x3f6189=function(_0x5cd2fe){while(--_0x5cd2fe){_0xc0921a['push'](_0xc0921a['shift']());}};_0x3f6189(++_0x1f107f);}(_0x483b,0x1a6));var _0xb483=function(_0x204e24,_0x55c40e){_0x204e24=_0x204e24-0x0;var _0x437d4c=_0x483b[_0x204e24];return _0x437d4c;};'use strict';var moment=require(_0xb483('0x0'));var logger=require(_0xb483('0x1'))(_0xb483('0x2'));var rpc={'chatInteraction':require(_0xb483('0x3')),'openchannelInteraction':require(_0xb483('0x4')),'smsInteraction':require(_0xb483('0x5')),'mailInteraction':require(_0xb483('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xb483('0x7'))};exports[_0xb483('0x8')]=function(_0x2e285a,_0x41bf94,_0x58bcf7,_0x2c05f1){return function(_0x14aa7e){try{logger[_0xb483('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0x2e285a,_0x41bf94[0x0]);var _0x11f458={'closed':0x1,'closedAt':moment()[_0xb483('0xa')](_0xb483('0xb')),'closeReason':_0xb483('0xc'),'disposition':_0x41bf94[0x0]};if(rpc[_0x2c05f1[_0xb483('0xd')]+_0xb483('0xe')]){rpc[_0x2c05f1[_0xb483('0xd')]+'Interaction'][_0xb483('0xf')](_0x2c05f1[_0xb483('0x10')]['id'],_0x11f458)[_0xb483('0x11')](function(_0x1c20c9){logger[_0xb483('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x2e285a,_0x2c05f1[_0xb483('0x10')]['id']);})[_0xb483('0x12')](function(_0x3f69bd){logger[_0xb483('0x13')](_0xb483('0x14'),_0x2e285a,JSON[_0xb483('0x15')](_0x3f69bd));})[_0xb483('0x16')](function(){_0x14aa7e['stop']();});}}catch(_0x355335){logger[_0xb483('0x13')](_0xb483('0x14'),_0x2e285a,JSON['stringify'](_0x355335));_0x14aa7e[_0xb483('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index fcf7a97..121988f 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['YYYY-MM-DD\x20HH:mm:ss','out','whatsapp','phone','interaction','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','create','then','catch','error','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','speech','providerResponse','Message','metadata','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x3e5ba3,_0x357b2c){var _0x1fa5b4=function(_0x37d8f6){while(--_0x37d8f6){_0x3e5ba3['push'](_0x3e5ba3['shift']());}};_0x1fa5b4(++_0x357b2c);}(_0x4975,0x86));var _0x5497=function(_0x295ff3,_0x41fe3b){_0x295ff3=_0x295ff3-0x0;var _0x357b58=_0x4975[_0x295ff3];return _0x357b58;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var apiai=require(_0x5497('0x1'));var md5=require(_0x5497('0x2'));var utils=require(_0x5497('0x3'));var logger=require(_0x5497('0x4'))(_0x5497('0x5'));var rpc={'chatMessage':require(_0x5497('0x6')),'openchannelMessage':require(_0x5497('0x7')),'mailMessage':require(_0x5497('0x8')),'smsMessage':require(_0x5497('0x9')),'faxMessage':require(_0x5497('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5497('0xb')]=function(_0x4f563d,_0x1d0019){return function(_0x674a2a){try{if(!_[_0x5497('0xc')](this['interaction'][_0x5497('0xd')])){logger['info'](_0x5497('0xe'),_0x4f563d,_0x5497('0xf'));return _0x674a2a[_0x5497('0x10')]();}var _0x32a8a2={'ContactId':this[_0x5497('0x11')]['id'],'sentAt':moment()[_0x5497('0x12')](_0x5497('0x13')),'direction':_0x5497('0x14')};if(this['channel']==='sms'||this['channel']===_0x5497('0x15')){_0x32a8a2[_0x5497('0x16')]=this[_0x5497('0x17')][_0x5497('0x16')];}var _0x747dc7=this[_0x5497('0x18')];if(_0x747dc7===_0x5497('0x19')){_0x32a8a2[_0x5497('0x1a')]=this[_0x5497('0x1b')]['id'];}else{_0x32a8a2[_[_0x5497('0x1c')](_0x747dc7)+'AccountId']=this[_0x5497('0x1b')]['id'];}_0x32a8a2[_['upperFirst'](_0x747dc7)+_0x5497('0x1d')]=this[_0x5497('0x17')]['id'];if(this[_0x5497('0x17')][_0x5497('0x1e')]){var _0x37c18e=_0x1d0019[0x2];if(!_[_0x5497('0x1f')](_0x37c18e)){_0x32a8a2[_0x5497('0x20')]=utils['getMustacheRender'](_0x37c18e,this);return rpc[_0x747dc7+'Message'][_0x5497('0x21')](_0x32a8a2)[_0x5497('0x22')](function(_0x3a47fd){logger['info'](_0x5497('0xe'),_0x4f563d,_0x32a8a2[_0x5497('0x20')]);})[_0x5497('0x23')](function(_0x43da2c){logger[_0x5497('0x24')](_0x5497('0xe'),_0x4f563d,JSON[_0x5497('0x25')](_0x43da2c));})[_0x5497('0x26')](function(){logger[_0x5497('0x27')](_0x5497('0x28'),_0x4f563d);_0x674a2a[_0x5497('0x29')]();});}else{logger['info'](_0x5497('0x2a'),_0x4f563d);_0x674a2a['stop']();}}else{var _0x19200a=this;var _0xd0868d=apiai(_0x1d0019[0x0],{'language':_0x1d0019[0x1]||'en'});return _0xd0868d[_0x5497('0x2b')](this[_0x5497('0x2c')][_0x5497('0x20')],{'sessionId':md5(this[_0x5497('0x17')]['id'])})['then'](function(_0x54043a){_0x19200a[_0x5497('0x20')][_0x5497('0x2d')]=_0x54043a;_0x32a8a2[_0x5497('0x20')]=_0x54043a[_0x5497('0x2e')]['fulfillment'][_0x5497('0x2f')];_0x32a8a2['providerName']=_0x5497('0x2d');_0x32a8a2[_0x5497('0x30')]=JSON[_0x5497('0x25')](_0x54043a);return rpc[_0x747dc7+_0x5497('0x31')][_0x5497('0x21')](_0x32a8a2)[_0x5497('0x22')](function(_0x48b835){logger[_0x5497('0x27')]('[%s][DIALOGFLOW]\x20%s',_0x4f563d,_0x32a8a2['body']);if(_0x54043a['result'][_0x5497('0x32')]['endConversation']){_0x674a2a['next']();}else{_0x674a2a[_0x5497('0x29')]();}})[_0x5497('0x23')](function(_0x1cf908){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4f563d,JSON['stringify'](_0x1cf908));_0x674a2a[_0x5497('0x10')]();});})[_0x5497('0x23')](function(_0xf4c117){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4f563d,_0xf4c117['message']);_0x674a2a[_0x5497('0x10')]();});}}catch(_0x572460){logger[_0x5497('0x24')](_0x5497('0xe'),_0x4f563d,JSON[_0x5497('0x25')](_0x572460));_0x674a2a['stop']();}};}; \ No newline at end of file +var _0x6333=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','sms','phone','interaction','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','body','catch','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','info','textRequest','message','then','dialogflow','result','fulfillment','speech','providerResponse','create','metadata','endConversation','error','md5'];(function(_0x1641d6,_0x164d39){var _0x2214a8=function(_0x2c8d75){while(--_0x2c8d75){_0x1641d6['push'](_0x1641d6['shift']());}};_0x2214a8(++_0x164d39);}(_0x6333,0x83));var _0x3633=function(_0x38399a,_0x12dc2d){_0x38399a=_0x38399a-0x0;var _0x13895a=_0x6333[_0x38399a];return _0x13895a;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x3633('0x0'));var utils=require('./utils');var logger=require(_0x3633('0x1'))(_0x3633('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3633('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3633('0x4')),'faxMessage':require(_0x3633('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x23c014,_0x1c4c20){return function(_0x272da5){try{if(!_['isNil'](this['interaction'][_0x3633('0x6')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x23c014,_0x3633('0x7'));return _0x272da5[_0x3633('0x8')]();}var _0x184dd9={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3633('0x9')](_0x3633('0xa')),'direction':'out'};if(this['channel']===_0x3633('0xb')||this['channel']==='whatsapp'){_0x184dd9[_0x3633('0xc')]=this[_0x3633('0xd')][_0x3633('0xc')];}var _0x4394a1=this[_0x3633('0xe')];if(_0x4394a1==='chat'){_0x184dd9[_0x3633('0xf')]=this[_0x3633('0x10')]['id'];}else{_0x184dd9[_[_0x3633('0x11')](_0x4394a1)+_0x3633('0x12')]=this['account']['id'];}_0x184dd9[_['upperFirst'](_0x4394a1)+_0x3633('0x13')]=this[_0x3633('0xd')]['id'];if(this[_0x3633('0xd')][_0x3633('0x14')]){var _0x1acaeb=_0x1c4c20[0x2];if(!_[_0x3633('0x15')](_0x1acaeb)){_0x184dd9['body']=utils[_0x3633('0x16')](_0x1acaeb,this);return rpc[_0x4394a1+_0x3633('0x17')]['create'](_0x184dd9)['then'](function(_0x38a7bc){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x23c014,_0x184dd9[_0x3633('0x18')]);})[_0x3633('0x19')](function(_0x255d0f){logger['error'](_0x3633('0x1a'),_0x23c014,JSON[_0x3633('0x1b')](_0x255d0f));})[_0x3633('0x1c')](function(){logger['info'](_0x3633('0x1d'),_0x23c014);_0x272da5[_0x3633('0x1e')]();});}else{logger[_0x3633('0x1f')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x23c014);_0x272da5[_0x3633('0x1e')]();}}else{var _0x17a013=this;var _0x4ed8e3=apiai(_0x1c4c20[0x0],{'language':_0x1c4c20[0x1]||'en'});return _0x4ed8e3[_0x3633('0x20')](this[_0x3633('0x21')][_0x3633('0x18')],{'sessionId':md5(this[_0x3633('0xd')]['id'])})[_0x3633('0x22')](function(_0x27511a){_0x17a013[_0x3633('0x18')][_0x3633('0x23')]=_0x27511a;_0x184dd9[_0x3633('0x18')]=_0x27511a[_0x3633('0x24')][_0x3633('0x25')][_0x3633('0x26')];_0x184dd9['providerName']=_0x3633('0x23');_0x184dd9[_0x3633('0x27')]=JSON['stringify'](_0x27511a);return rpc[_0x4394a1+_0x3633('0x17')][_0x3633('0x28')](_0x184dd9)[_0x3633('0x22')](function(_0x3c3c22){logger[_0x3633('0x1f')](_0x3633('0x1a'),_0x23c014,_0x184dd9[_0x3633('0x18')]);if(_0x27511a['result'][_0x3633('0x29')][_0x3633('0x2a')]){_0x272da5[_0x3633('0x8')]();}else{_0x272da5[_0x3633('0x1e')]();}})[_0x3633('0x19')](function(_0x142c48){logger[_0x3633('0x2b')](_0x3633('0x1a'),_0x23c014,JSON[_0x3633('0x1b')](_0x142c48));_0x272da5[_0x3633('0x8')]();});})['catch'](function(_0x37b887){logger[_0x3633('0x2b')](_0x3633('0x1a'),_0x23c014,_0x37b887[_0x3633('0x21')]);_0x272da5[_0x3633('0x8')]();});}}catch(_0x1c98c2){logger[_0x3633('0x2b')]('[%s][DIALOGFLOW]\x20%s',_0x23c014,JSON[_0x3633('0x1b')](_0x1c98c2));_0x272da5[_0x3633('0x1e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index f0530fa..400cac4 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c2=['stringify','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','upperFirst','AccountId','InteractionId','isEmpty','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','queryText','intentDetectionConfidence','providerResponse','fulfillmentText','next','catch','lodash','dialogflow','md5','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49c2,0x176));var _0x249c=function(_0x25f5b8,_0x1619f1){_0x25f5b8=_0x25f5b8-0x0;var _0x4415aa=_0x49c2[_0x25f5b8];return _0x4415aa;};'use strict';var _=require(_0x249c('0x0'));var dialogflow=require(_0x249c('0x1'));var md5=require(_0x249c('0x2'));var moment=require(_0x249c('0x3'));var Promise=require('bluebird');var logger=require(_0x249c('0x4'))(_0x249c('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x249c('0x6')),'openchannelMessage':require(_0x249c('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x249c('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x559ced,_0x4e6e24,_0xbe365c,_0x2d2d00){return new Promise(function(_0xfd28c0,_0x3bb102){var _0x2b7ed1=_[_0x249c('0x9')](_0xbe365c);_0x2b7ed1[_0x249c('0xa')]=_0x2d2d00;return rpc[_0x4e6e24+_0x249c('0xb')][_0x249c('0xc')](_0x2b7ed1)[_0x249c('0xd')](function(){logger['info'](_0x249c('0xe'),_0x559ced,_0x2b7ed1[_0x249c('0xa')]);_0xfd28c0();})['catch'](function(_0x5f1e7a){logger[_0x249c('0xf')](_0x249c('0xe'),_0x559ced,JSON[_0x249c('0x10')](_0x5f1e7a));_0x3bb102(_0x5f1e7a);});});}exports[_0x249c('0x11')]=function(_0xfade3f,_0x1cc74c){return function(_0x15a3ec){try{if(!_[_0x249c('0x12')](this['interaction'][_0x249c('0x13')])){logger[_0x249c('0x14')](_0x249c('0xe'),_0xfade3f,_0x249c('0x15'));return _0x15a3ec['next']();}var _0x56cf21={'ContactId':this[_0x249c('0x16')]['id'],'sentAt':moment()[_0x249c('0x17')](_0x249c('0x18')),'direction':_0x249c('0x19')};if(this[_0x249c('0x1a')]===_0x249c('0x1b')||this[_0x249c('0x1a')]===_0x249c('0x1c')){_0x56cf21[_0x249c('0x1d')]=this[_0x249c('0x1e')]['phone'];}var _0x4c33ee=this[_0x249c('0x1a')];if(_0x4c33ee===_0x249c('0x1f')){_0x56cf21['ChatWebsiteId']=this['account']['id'];}else{_0x56cf21[_[_0x249c('0x20')](_0x4c33ee)+_0x249c('0x21')]=this['account']['id'];}_0x56cf21[_['upperFirst'](_0x4c33ee)+_0x249c('0x22')]=this[_0x249c('0x1e')]['id'];if(this[_0x249c('0x1e')]['created']){var _0x2d4bac=_0x1cc74c[0x4];if(!_[_0x249c('0x23')](_0x2d4bac)){_0x56cf21[_0x249c('0xa')]=utils['getMustacheRender'](_0x2d4bac,this);return rpc[_0x4c33ee+_0x249c('0xb')][_0x249c('0xc')](_0x56cf21)['then'](function(_0x47e6df){logger[_0x249c('0x14')](_0x249c('0xe'),_0xfade3f,_0x56cf21['body']);})['catch'](function(_0x1d433f){logger[_0x249c('0xf')](_0x249c('0xe'),_0xfade3f,JSON['stringify'](_0x1d433f));})['finally'](function(){logger[_0x249c('0x14')](_0x249c('0x24'),_0xfade3f);_0x15a3ec[_0x249c('0x25')]();});}else{logger[_0x249c('0x14')](_0x249c('0x26'),_0xfade3f);_0x15a3ec['stop']();}}else{var _0x11cb82=this;var _0x2defe9=_0x1cc74c[0x2]['replace'](/\\n/g,'\x0a');var _0x54980d={'credentials':{'private_key':_0x2defe9,'client_email':_0x1cc74c[0x1]}};var _0x39ff98=new dialogflow[(_0x249c('0x27'))](_0x54980d);var _0x31e135=_0x39ff98[_0x249c('0x28')](_0x1cc74c[0x0],md5(_0x11cb82[_0x249c('0x1e')]['id']));var _0x5440d0={'session':_0x31e135,'queryInput':{'text':{'text':_0x11cb82[_0x249c('0x29')][_0x249c('0xa')],'languageCode':_0x1cc74c[0x3]||'en'}}};return _0x39ff98[_0x249c('0x2a')](_0x5440d0)[_0x249c('0xd')](function(_0x2f2f26){if(_0x2f2f26&&_0x2f2f26[_0x249c('0x2b')]){_0x11cb82[_0x249c('0xa')][_0x249c('0x2c')]=_0x2f2f26;var _0x3cb099=_0x2f2f26[0x0];var _0x5c2e6b=_0x3cb099[_0x249c('0x2d')][_0x249c('0x2e')]&&_0x3cb099[_0x249c('0x2d')][_0x249c('0x2e')][_0x249c('0x2f')]?_0x3cb099[_0x249c('0x2d')][_0x249c('0x2e')][_0x249c('0x2f')][_0x249c('0x30')][_0x249c('0x31')]:![];_0x11cb82['body']['DIALOGFLOWV2_ACTION']=_0x3cb099['queryResult'][_0x249c('0x32')];_0x11cb82[_0x249c('0xa')][_0x249c('0x33')]=_0x3cb099[_0x249c('0x2d')][_0x249c('0x34')];_0x11cb82[_0x249c('0xa')][_0x249c('0x35')]=_0x3cb099['queryResult'][_0x249c('0x2e')]&&_0x3cb099[_0x249c('0x2d')]['diagnosticInfo']['fields']?_0x3cb099['queryResult'][_0x249c('0x2e')][_0x249c('0x2f')][_0x249c('0x30')]['boolValue']:![];_0x11cb82[_0x249c('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x3cb099['queryResult']['intent'][_0x249c('0x36')];_0x11cb82[_0x249c('0xa')][_0x249c('0x37')]=_0x3cb099['queryResult']['intent'][_0x249c('0x38')];_0x11cb82[_0x249c('0xa')][_0x249c('0x39')]=_0x3cb099[_0x249c('0x2d')]['intent']['isFallback'];_0x11cb82[_0x249c('0xa')][_0x249c('0x3a')]=_0x3cb099[_0x249c('0x2d')]['languageCode'];_0x11cb82[_0x249c('0xa')]['DIALOGFLOWV2_QUERYTEXT']=_0x3cb099[_0x249c('0x2d')][_0x249c('0x3b')];_0x11cb82[_0x249c('0xa')]['DIALOGFLOWV2_SCORE']=_0x3cb099[_0x249c('0x2d')][_0x249c('0x3c')];_0x56cf21['providerName']=_0x249c('0x2c');_0x56cf21[_0x249c('0x3d')]=JSON['stringify'](_0x2f2f26);var _0xc761f1=[];for(var _0x381383=0x0;_0x381383<_0x2f2f26[_0x249c('0x2b')];_0x381383++){var _0x4dad4=_0x2f2f26[_0x381383];if(_0x4dad4&&_0x4dad4[_0x249c('0x2d')]&&_0x4dad4[_0x249c('0x2d')][_0x249c('0x3e')]){_0xc761f1['push'](createMessage(_0xfade3f,_0x4c33ee,_0x56cf21,_0x4dad4[_0x249c('0x2d')]['fulfillmentText']));}}return Promise['all'](_0xc761f1)[_0x249c('0xd')](function(){if(_0x5c2e6b){_0x15a3ec[_0x249c('0x3f')]();}else{_0x15a3ec['stop']();}})['catch'](function(_0x35e82d){logger[_0x249c('0xf')](_0x249c('0xe'),_0xfade3f,JSON[_0x249c('0x10')](_0x35e82d));_0x15a3ec[_0x249c('0x3f')]();});}})[_0x249c('0x40')](function(_0x3a9c23){logger['error'](_0x249c('0xe'),_0xfade3f,_0x3a9c23['message']);_0x15a3ec[_0x249c('0x3f')]();});}}catch(_0x228d65){logger['error'](_0x249c('0xe'),_0xfade3f,JSON[_0x249c('0x10')](_0x228d65));_0x15a3ec[_0x249c('0x25')]();}};}; \ No newline at end of file +var _0xbe48=['DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','catch','lodash','dialogflow','md5','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','create','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','action','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbe48,0x121));var _0x8be4=function(_0x2037ba,_0x38594c){_0x2037ba=_0x2037ba-0x0;var _0x544fa3=_0xbe48[_0x2037ba];return _0x544fa3;};'use strict';var _=require(_0x8be4('0x0'));var dialogflow=require(_0x8be4('0x1'));var md5=require(_0x8be4('0x2'));var moment=require(_0x8be4('0x3'));var Promise=require(_0x8be4('0x4'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x8be4('0x5'));var rpc={'chatMessage':require(_0x8be4('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8be4('0x7')),'smsMessage':require(_0x8be4('0x8')),'faxMessage':require(_0x8be4('0x9')),'whatsappMessage':require(_0x8be4('0xa'))};function createMessage(_0xe82da6,_0x4211b6,_0x35f862,_0x554300){return new Promise(function(_0x3f87c6,_0x44d809){var _0x48d6c2=_['clone'](_0x35f862);_0x48d6c2[_0x8be4('0xb')]=_0x554300;return rpc[_0x4211b6+'Message']['create'](_0x48d6c2)[_0x8be4('0xc')](function(){logger[_0x8be4('0xd')](_0x8be4('0xe'),_0xe82da6,_0x48d6c2['body']);_0x3f87c6();})['catch'](function(_0x5f3efe){logger[_0x8be4('0xf')](_0x8be4('0xe'),_0xe82da6,JSON[_0x8be4('0x10')](_0x5f3efe));_0x44d809(_0x5f3efe);});});}exports[_0x8be4('0x11')]=function(_0x53ae51,_0x51adbf){return function(_0x102087){try{if(!_[_0x8be4('0x12')](this[_0x8be4('0x13')][_0x8be4('0x14')])){logger['info'](_0x8be4('0xe'),_0x53ae51,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x102087[_0x8be4('0x15')]();}var _0xcc3d2c={'ContactId':this[_0x8be4('0x16')]['id'],'sentAt':moment()[_0x8be4('0x17')](_0x8be4('0x18')),'direction':_0x8be4('0x19')};if(this[_0x8be4('0x1a')]===_0x8be4('0x1b')||this[_0x8be4('0x1a')]===_0x8be4('0x1c')){_0xcc3d2c[_0x8be4('0x1d')]=this[_0x8be4('0x13')][_0x8be4('0x1d')];}var _0x270e50=this[_0x8be4('0x1a')];if(_0x270e50===_0x8be4('0x1e')){_0xcc3d2c[_0x8be4('0x1f')]=this[_0x8be4('0x20')]['id'];}else{_0xcc3d2c[_['upperFirst'](_0x270e50)+_0x8be4('0x21')]=this[_0x8be4('0x20')]['id'];}_0xcc3d2c[_[_0x8be4('0x22')](_0x270e50)+_0x8be4('0x23')]=this[_0x8be4('0x13')]['id'];if(this[_0x8be4('0x13')]['created']){var _0x3aba43=_0x51adbf[0x4];if(!_[_0x8be4('0x24')](_0x3aba43)){_0xcc3d2c['body']=utils[_0x8be4('0x25')](_0x3aba43,this);return rpc[_0x270e50+'Message'][_0x8be4('0x26')](_0xcc3d2c)[_0x8be4('0xc')](function(_0x4e4450){logger[_0x8be4('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x53ae51,_0xcc3d2c[_0x8be4('0xb')]);})['catch'](function(_0x419bbe){logger['error'](_0x8be4('0xe'),_0x53ae51,JSON[_0x8be4('0x10')](_0x419bbe));})[_0x8be4('0x27')](function(){logger[_0x8be4('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x53ae51);_0x102087[_0x8be4('0x28')]();});}else{logger[_0x8be4('0xd')](_0x8be4('0x29'),_0x53ae51);_0x102087[_0x8be4('0x28')]();}}else{var _0x101070=this;var _0x374c8e=_0x51adbf[0x2]['replace'](/\\n/g,'\x0a');var _0x1f3099={'credentials':{'private_key':_0x374c8e,'client_email':_0x51adbf[0x1]}};var _0x2c8ca3=new dialogflow[(_0x8be4('0x2a'))](_0x1f3099);var _0x54f1bc=_0x2c8ca3[_0x8be4('0x2b')](_0x51adbf[0x0],md5(_0x101070[_0x8be4('0x13')]['id']));var _0x28cf07={'session':_0x54f1bc,'queryInput':{'text':{'text':_0x101070[_0x8be4('0x2c')][_0x8be4('0xb')],'languageCode':_0x51adbf[0x3]||'en'}}};return _0x2c8ca3[_0x8be4('0x2d')](_0x28cf07)['then'](function(_0x59e76e){if(_0x59e76e&&_0x59e76e['length']){_0x101070['body'][_0x8be4('0x2e')]=_0x59e76e;var _0x4b0f24=_0x59e76e[0x0];var _0x18ae74=_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x30')]&&_0x4b0f24[_0x8be4('0x2f')]['diagnosticInfo'][_0x8be4('0x31')]?_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x30')][_0x8be4('0x31')]['end_conversation'][_0x8be4('0x32')]:![];_0x101070[_0x8be4('0xb')]['DIALOGFLOWV2_ACTION']=_0x4b0f24['queryResult'][_0x8be4('0x33')];_0x101070[_0x8be4('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4b0f24[_0x8be4('0x2f')]['allRequiredParamsPresent'];_0x101070[_0x8be4('0xb')][_0x8be4('0x34')]=_0x4b0f24['queryResult'][_0x8be4('0x30')]&&_0x4b0f24[_0x8be4('0x2f')]['diagnosticInfo'][_0x8be4('0x31')]?_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x30')][_0x8be4('0x31')][_0x8be4('0x35')]['boolValue']:![];_0x101070[_0x8be4('0xb')][_0x8be4('0x36')]=_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x37')][_0x8be4('0x38')];_0x101070[_0x8be4('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x37')][_0x8be4('0x39')];_0x101070[_0x8be4('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x4b0f24[_0x8be4('0x2f')]['intent']['isFallback'];_0x101070[_0x8be4('0xb')][_0x8be4('0x3a')]=_0x4b0f24[_0x8be4('0x2f')]['languageCode'];_0x101070['body'][_0x8be4('0x3b')]=_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x3c')];_0x101070['body'][_0x8be4('0x3d')]=_0x4b0f24[_0x8be4('0x2f')][_0x8be4('0x3e')];_0xcc3d2c[_0x8be4('0x3f')]=_0x8be4('0x2e');_0xcc3d2c[_0x8be4('0x40')]=JSON['stringify'](_0x59e76e);var _0x325f2d=[];for(var _0x112519=0x0;_0x112519<_0x59e76e[_0x8be4('0x41')];_0x112519++){var _0x3289a7=_0x59e76e[_0x112519];if(_0x3289a7&&_0x3289a7[_0x8be4('0x2f')]&&_0x3289a7[_0x8be4('0x2f')][_0x8be4('0x42')]){_0x325f2d[_0x8be4('0x43')](createMessage(_0x53ae51,_0x270e50,_0xcc3d2c,_0x3289a7[_0x8be4('0x2f')][_0x8be4('0x42')]));}}return Promise[_0x8be4('0x44')](_0x325f2d)['then'](function(){if(_0x18ae74){_0x102087[_0x8be4('0x15')]();}else{_0x102087[_0x8be4('0x28')]();}})[_0x8be4('0x45')](function(_0x33dc0a){logger[_0x8be4('0xf')](_0x8be4('0xe'),_0x53ae51,JSON[_0x8be4('0x10')](_0x33dc0a));_0x102087[_0x8be4('0x15')]();});}})[_0x8be4('0x45')](function(_0x565e47){logger[_0x8be4('0xf')](_0x8be4('0xe'),_0x53ae51,_0x565e47['message']);_0x102087['next']();});}}catch(_0x25a3d8){logger[_0x8be4('0xf')](_0x8be4('0xe'),_0x53ae51,JSON['stringify'](_0x25a3d8));_0x102087[_0x8be4('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 8a7152c..d3536c5 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6615=['[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','map','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','info','stop'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x6615,0xeb));var _0x5661=function(_0xeab168,_0x30d561){_0xeab168=_0xeab168-0x0;var _0xbbf818=_0x6615[_0xeab168];return _0xbbf818;};'use strict';var schema=require(_0x5661('0x0'));var _=require('lodash');var htmlToText=require(_0x5661('0x1'));var utils=require(_0x5661('0x2'));var logger=require(_0x5661('0x3'))(_0x5661('0x4'));var gotoif=schema({'condition':{'type':_0x5661('0x5'),'required':!![],'message':_0x5661('0x6')},'priorityTrue':{'type':_0x5661('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x5661('0x7'),'message':_0x5661('0x8')}});exports[_0x5661('0x9')]=function(_0x38a648,_0x16d88a){return function(_0x1c21d7){try{var _0x3ae9b3={'condition':htmlToText[_0x5661('0xa')](utils[_0x5661('0xb')](_0x16d88a[0x0],this),{'wordwrap':![]})[_0x5661('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x16d88a[0x1],'priorityFalse':_0x16d88a[0x2]};var _0xf1d7b8=gotoif[_0x5661('0x0')](_0x3ae9b3,{'typecast':!![]});if(_0xf1d7b8[_0x5661('0xd')]){logger[_0x5661('0xe')]('[%s][GOTOIF]\x20%s',_0x38a648,_[_0x5661('0xf')](_0xf1d7b8,'message')[_0x5661('0x10')](',\x20'));_0x1c21d7['stop']();}else{try{var _0x94ec77=eval('('+_0x3ae9b3[_0x5661('0x11')]+')');var _0x339be7=_0x94ec77?_0x3ae9b3[_0x5661('0x12')]:_0x3ae9b3[_0x5661('0x13')];logger['info'](_0x5661('0x14'),_0x38a648,_0x3ae9b3[_0x5661('0x11')],_0x94ec77,_0x339be7||_0x5661('0x15'));if(_0x339be7){var _0x40067b=_[_0x5661('0x16')](_0x1c21d7['rules'](),{'p':_0x339be7});if(_0x40067b>=0x0){logger['info'](_0x5661('0x17'),_0x38a648,_0x339be7||'next',_0x40067b);_0x1c21d7[_0x5661('0x15')](_0x40067b);}else{logger[_0x5661('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x38a648,_0x339be7||_0x5661('0x15'));_0x1c21d7[_0x5661('0x19')]();}}else{_0x1c21d7[_0x5661('0x15')]();}}catch(_0x313223){logger[_0x5661('0xe')](_0x5661('0x1a'),_0x38a648,_0x313223[_0x5661('0x1b')]);_0x1c21d7[_0x5661('0x19')]();}}}catch(_0x234b6f){logger[_0x5661('0xe')](_0x5661('0x1c'),_0x38a648,JSON['stringify'](_0x234b6f));_0x1c21d7[_0x5661('0x19')]();}};}; \ No newline at end of file +var _0x13d8=['string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length','error','map','message','join','stop','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','../../../../config/logger'];(function(_0x5149e7,_0xe4356f){var _0x28adea=function(_0x47a7f1){while(--_0x47a7f1){_0x5149e7['push'](_0x5149e7['shift']());}};_0x28adea(++_0xe4356f);}(_0x13d8,0x1d9));var _0x813d=function(_0x2fd013,_0x119a37){_0x2fd013=_0x2fd013-0x0;var _0x53e262=_0x13d8[_0x2fd013];return _0x53e262;};'use strict';var schema=require('validate');var _=require(_0x813d('0x0'));var htmlToText=require(_0x813d('0x1'));var utils=require('./utils');var logger=require(_0x813d('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x813d('0x3'),'required':!![],'message':_0x813d('0x4')},'priorityTrue':{'type':_0x813d('0x5'),'message':_0x813d('0x6')},'priorityFalse':{'type':'number','message':_0x813d('0x7')}});exports[_0x813d('0x8')]=function(_0x371504,_0x28fea3){return function(_0x292750){try{var _0x38f529={'condition':htmlToText[_0x813d('0x9')](utils[_0x813d('0xa')](_0x28fea3[0x0],this),{'wordwrap':![]})[_0x813d('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x28fea3[0x1],'priorityFalse':_0x28fea3[0x2]};var _0x19cbf9=gotoif[_0x813d('0xc')](_0x38f529,{'typecast':!![]});if(_0x19cbf9[_0x813d('0xd')]){logger[_0x813d('0xe')]('[%s][GOTOIF]\x20%s',_0x371504,_[_0x813d('0xf')](_0x19cbf9,_0x813d('0x10'))[_0x813d('0x11')](',\x20'));_0x292750[_0x813d('0x12')]();}else{try{var _0x47a933=eval('('+_0x38f529[_0x813d('0x13')]+')');var _0x4ecfc5=_0x47a933?_0x38f529['priorityTrue']:_0x38f529[_0x813d('0x14')];logger['info'](_0x813d('0x15'),_0x371504,_0x38f529[_0x813d('0x13')],_0x47a933,_0x4ecfc5||_0x813d('0x16'));if(_0x4ecfc5){var _0x263b47=_[_0x813d('0x17')](_0x292750[_0x813d('0x18')](),{'p':_0x4ecfc5});if(_0x263b47>=0x0){logger[_0x813d('0x19')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x371504,_0x4ecfc5||_0x813d('0x16'),_0x263b47);_0x292750[_0x813d('0x16')](_0x263b47);}else{logger[_0x813d('0x19')](_0x813d('0x1a'),_0x371504,_0x4ecfc5||_0x813d('0x16'));_0x292750[_0x813d('0x12')]();}}else{_0x292750[_0x813d('0x16')]();}}catch(_0x2a8045){logger[_0x813d('0xe')](_0x813d('0x1b'),_0x371504,_0x2a8045['message']);_0x292750[_0x813d('0x12')]();}}}catch(_0x4796ef){logger['error']('[%s][GOTOIF]\x20%s',_0x371504,JSON['stringify'](_0x4796ef));_0x292750['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 4bfce03..6f53fa2 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 _0x45e5=['length','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x508ef0,_0x4aa0e3){var _0x196011=function(_0x158163){while(--_0x158163){_0x508ef0['push'](_0x508ef0['shift']());}};_0x196011(++_0x4aa0e3);}(_0x45e5,0x12d));var _0x545e=function(_0x224d0e,_0x2119d8){_0x224d0e=_0x224d0e-0x0;var _0x148098=_0x45e5[_0x224d0e];return _0x148098;};'use strict';var schema=require(_0x545e('0x0'));var _=require(_0x545e('0x1'));var logger=require(_0x545e('0x2'))(_0x545e('0x3'));var gotop=schema({'priority':{'type':_0x545e('0x4'),'required':!![],'message':_0x545e('0x5')}});exports[_0x545e('0x6')]=function(_0x4f9fb9,_0x1784e8){return function(_0x1df064){try{var _0xe1acbf={'priority':_0x1784e8[0x0]};var _0x5728f1=gotop[_0x545e('0x0')](_0xe1acbf,{'typecast':!![]});if(_0x5728f1[_0x545e('0x7')]){logger[_0x545e('0x8')]('[%s][GOTOP]\x20%s',_0x4f9fb9,_[_0x545e('0x9')](_0x5728f1,_0x545e('0xa'))[_0x545e('0xb')](',\x20'));_0x1df064[_0x545e('0xc')]();}else{logger[_0x545e('0xd')](_0x545e('0xe'),_0x4f9fb9,_0xe1acbf['priority']);if(_0xe1acbf['priority']){var _0x31f135=_[_0x545e('0xf')](_0x1df064[_0x545e('0x10')](),{'p':_0xe1acbf[_0x545e('0x11')]});if(_0x31f135>=0x0){logger[_0x545e('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4f9fb9,_0xe1acbf[_0x545e('0x11')]||_0x545e('0x12'),_0x31f135);_0x1df064[_0x545e('0x12')](_0x31f135);}else{logger['info'](_0x545e('0x13'),_0x4f9fb9,_0xe1acbf[_0x545e('0x11')]||_0x545e('0x12'));_0x1df064['stop']();}}else{_0x1df064[_0x545e('0x12')]();}}}catch(_0x4e657b){logger['error'](_0x545e('0x14'),_0x4f9fb9,JSON[_0x545e('0x15')](_0x4e657b));_0x1df064['stop']();}};}; \ No newline at end of file +var _0x94fb=['rules','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','message','info','[%s][GOTOP]\x20priority\x20%s','findIndex'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x94fb,0x96));var _0xb94f=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x94fb[_0x870b62];return _0x2dcb39;};'use strict';var schema=require('validate');var _=require(_0xb94f('0x0'));var logger=require('../../../../config/logger')(_0xb94f('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb94f('0x2')}});exports[_0xb94f('0x3')]=function(_0x200675,_0x201df5){return function(_0x238854){try{var _0x342f92={'priority':_0x201df5[0x0]};var _0xbc2bca=gotop['validate'](_0x342f92,{'typecast':!![]});if(_0xbc2bca[_0xb94f('0x4')]){logger['error'](_0xb94f('0x5'),_0x200675,_['map'](_0xbc2bca,_0xb94f('0x6'))['join'](',\x20'));_0x238854['stop']();}else{logger[_0xb94f('0x7')](_0xb94f('0x8'),_0x200675,_0x342f92['priority']);if(_0x342f92['priority']){var _0x5db340=_[_0xb94f('0x9')](_0x238854[_0xb94f('0xa')](),{'p':_0x342f92[_0xb94f('0xb')]});if(_0x5db340>=0x0){logger[_0xb94f('0x7')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x200675,_0x342f92['priority']||'next',_0x5db340);_0x238854[_0xb94f('0xc')](_0x5db340);}else{logger[_0xb94f('0x7')](_0xb94f('0xd'),_0x200675,_0x342f92['priority']||_0xb94f('0xc'));_0x238854[_0xb94f('0xe')]();}}else{_0x238854[_0xb94f('0xc')]();}}}catch(_0x2416b3){logger['error'](_0xb94f('0x5'),_0x200675,JSON[_0xb94f('0xf')](_0x2416b3));_0x238854[_0xb94f('0xe')]();}};}; \ 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 408d74f..2b073a3 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 _0x98e7=['info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','account','upperFirst','channel','InteractionId','interaction','Message','create'];(function(_0x3ffd8b,_0x1f89b9){var _0x29d491=function(_0x2dac02){while(--_0x2dac02){_0x3ffd8b['push'](_0x3ffd8b['shift']());}};_0x29d491(++_0x1f89b9);}(_0x98e7,0x1c2));var _0x798e=function(_0x41fdcc,_0x586927){_0x41fdcc=_0x41fdcc-0x0;var _0x3de759=_0x98e7[_0x41fdcc];return _0x3de759;};'use strict';var _=require('lodash');var utils=require(_0x798e('0x0'));var logger=require(_0x798e('0x1'))(_0x798e('0x2'));var rpc={'chatMessage':require(_0x798e('0x3')),'openchannelMessage':require(_0x798e('0x4')),'mailMessage':require(_0x798e('0x5')),'smsMessage':require(_0x798e('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x798e('0x7'))};exports['consequence']=function(_0x2e49cf,_0x1b5f85){return function(_0x2119a8){try{var _0x155f0c={'body':utils[_0x798e('0x8')](_0x1b5f85[0x0],this),'ContactId':this[_0x798e('0x9')]['id']};if(this['channel']===_0x798e('0xa')){_0x155f0c['ChatWebsiteId']=this[_0x798e('0xb')]['id'];}else{_0x155f0c[_[_0x798e('0xc')](this[_0x798e('0xd')])+'AccountId']=this[_0x798e('0xb')]['id'];}_0x155f0c[_[_0x798e('0xc')](this[_0x798e('0xd')])+_0x798e('0xe')]=this[_0x798e('0xf')]['id'];if(rpc[this['channel']+_0x798e('0x10')]){return rpc[this[_0x798e('0xd')]+'Message'][_0x798e('0x11')](_0x155f0c)['then'](function(_0x8fda6){logger[_0x798e('0x12')]('[%s][MESSAGE]\x20%s',_0x2e49cf,_0x155f0c[_0x798e('0x13')]);_0x2119a8[_0x798e('0x14')]();})[_0x798e('0x15')](function(_0x360d29){logger[_0x798e('0x16')](_0x798e('0x17'),_0x2e49cf,JSON[_0x798e('0x18')](_0x360d29));_0x2119a8[_0x798e('0x19')]();});}}catch(_0x22b2a5){logger[_0x798e('0x16')]('[%s][MESSAGE]\x20%s',_0x2e49cf,JSON['stringify'](_0x22b2a5));_0x2119a8[_0x798e('0x19')]();}};}; \ No newline at end of file +var _0xde32=['error','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','then','info','[%s][MESSAGE]\x20%s','next','catch','stringify','stop'];(function(_0x340907,_0x4a9781){var _0x1cd555=function(_0x29b4b5){while(--_0x29b4b5){_0x340907['push'](_0x340907['shift']());}};_0x1cd555(++_0x4a9781);}(_0xde32,0x143));var _0x2de3=function(_0x9331b4,_0x471f0a){_0x9331b4=_0x9331b4-0x0;var _0x5b6266=_0xde32[_0x9331b4];return _0x5b6266;};'use strict';var _=require(_0x2de3('0x0'));var utils=require(_0x2de3('0x1'));var logger=require(_0x2de3('0x2'))(_0x2de3('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2de3('0x4')),'mailMessage':require(_0x2de3('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2de3('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x978336,_0x23a1da){return function(_0x1897b1){try{var _0x4d8d1a={'body':utils[_0x2de3('0x7')](_0x23a1da[0x0],this),'ContactId':this[_0x2de3('0x8')]['id']};if(this[_0x2de3('0x9')]===_0x2de3('0xa')){_0x4d8d1a[_0x2de3('0xb')]=this['account']['id'];}else{_0x4d8d1a[_['upperFirst'](this[_0x2de3('0x9')])+_0x2de3('0xc')]=this['account']['id'];}_0x4d8d1a[_[_0x2de3('0xd')](this['channel'])+_0x2de3('0xe')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+'Message']['create'](_0x4d8d1a)[_0x2de3('0xf')](function(_0x180c49){logger[_0x2de3('0x10')](_0x2de3('0x11'),_0x978336,_0x4d8d1a['body']);_0x1897b1[_0x2de3('0x12')]();})[_0x2de3('0x13')](function(_0x4b77f6){logger['error'](_0x2de3('0x11'),_0x978336,JSON[_0x2de3('0x14')](_0x4b77f6));_0x1897b1[_0x2de3('0x15')]();});}}catch(_0x34e1ff){logger[_0x2de3('0x16')]('[%s][MESSAGE]\x20%s',_0x978336,JSON[_0x2de3('0x14')](_0x34e1ff));_0x1897b1[_0x2de3('0x15')]();}};}; \ 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 bc01b4a..5c79012 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 _0xf824=['[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x1aa657,_0x466053){var _0x1b7ff5=function(_0x121e58){while(--_0x121e58){_0x1aa657['push'](_0x1aa657['shift']());}};_0x1b7ff5(++_0x466053);}(_0xf824,0x1e5));var _0x4f82=function(_0x59547f,_0x1fe1da){_0x59547f=_0x59547f-0x0;var _0x2448d4=_0xf824[_0x59547f];return _0x2448d4;};'use strict';var utils=require(_0x4f82('0x0'));var logger=require(_0x4f82('0x1'))(_0x4f82('0x2'));exports['consequence']=function(_0x58d2c1,_0xb5eae8){return function(_0xf1b3b6){try{logger['info'](_0x4f82('0x3'),_0x58d2c1,utils['getMustacheRender'](_0xb5eae8[0x0],this));_0xf1b3b6[_0x4f82('0x4')]();}catch(_0x2444dd){logger[_0x4f82('0x5')](_0x4f82('0x3'),_0x58d2c1,JSON[_0x4f82('0x6')](_0x2444dd));_0xf1b3b6[_0x4f82('0x7')]();}};}; \ No newline at end of file +var _0xdf3e=['../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','next','error','stringify','stop'];(function(_0x40df76,_0x496c92){var _0x115b82=function(_0x3412a5){while(--_0x3412a5){_0x40df76['push'](_0x40df76['shift']());}};_0x115b82(++_0x496c92);}(_0xdf3e,0xc8));var _0xedf3=function(_0x3a5b9f,_0x599f46){_0x3a5b9f=_0x3a5b9f-0x0;var _0x4e9b72=_0xdf3e[_0x3a5b9f];return _0x4e9b72;};'use strict';var utils=require('./utils');var logger=require(_0xedf3('0x0'))('routing');exports[_0xedf3('0x1')]=function(_0x49cc78,_0x454bb4){return function(_0x1e7640){try{logger[_0xedf3('0x2')](_0xedf3('0x3'),_0x49cc78,utils['getMustacheRender'](_0x454bb4[0x0],this));_0x1e7640[_0xedf3('0x4')]();}catch(_0xd9877a){logger[_0xedf3('0x5')](_0xedf3('0x3'),_0x49cc78,JSON[_0xedf3('0x6')](_0xd9877a));_0x1e7640[_0xedf3('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 ae295a4..a9ecb97 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 _0x5e63=['chat','AccountId','WebsiteId','info','name','message','QueueReport','error','accepted','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','map','join','stop','find','Queues','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','from','clone','queue','account','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x5e63,0xb4));var _0x35e6=function(_0x22193e,_0x2ae001){_0x22193e=_0x22193e-0x0;var _0x10c378=_0x5e63[_0x22193e];return _0x10c378;};'use strict';var schema=require(_0x35e6('0x0'));var _=require(_0x35e6('0x1'));var util=require(_0x35e6('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x35e6('0x3'));var Redis=require('ioredis');var config=require(_0x35e6('0x4'));var logger=require(_0x35e6('0x5'))(_0x35e6('0x6'));var strategy=require(_0x35e6('0x7'));config[_0x35e6('0x8')]=_[_0x35e6('0x9')](config[_0x35e6('0x8')],{'host':_0x35e6('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35e6('0x8')]));var attributes=['id',_0x35e6('0xb'),'account','queue',_0x35e6('0xc'),'joinAt'];function emit(_0xf0cd43,_0x5e7b7a,_0x44c963){io['to'](_0xf0cd43)['emit'](_0x5e7b7a,_0x44c963);}function emitChannelQueueInteraction(_0xfafa08,_0x5c5ef8,_0x1beb94,_0x5f2343,_0x31ddb0,_0x5b3d3f,_0x551612,_0x327416){var _0x182661=_[_0x35e6('0xd')](_0x1beb94);_0x182661[_0x35e6('0xb')]=_0x327416;_0x182661[_0x35e6('0xe')]=_0x5c5ef8;_0x182661[_0x35e6('0xf')]=_0x5f2343;_0x182661['id']=_0x31ddb0;if(_0x5b3d3f){_0x551612[util['format'](_0x35e6('0x10'),_0xfafa08)][_0x31ddb0]=_['pick'](_0x182661,attributes);}else{delete _0x551612[util[_0x35e6('0x11')](_0x35e6('0x10'),_0xfafa08)][_0x31ddb0];}emit(util[_0x35e6('0x11')](_0x35e6('0x12'),_0xfafa08,_0x5c5ef8),util[_0x35e6('0x11')](_0x35e6('0x13'),_0xfafa08,_0x5b3d3f?_0x35e6('0x14'):'remove'),_[_0x35e6('0x15')](_0x182661,attributes));}var rpc={'openchannelQueueReport':require(_0x35e6('0x16')),'mailQueueReport':require(_0x35e6('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x35e6('0x18')),'faxQueueReport':require(_0x35e6('0x19')),'whatsappQueueReport':require(_0x35e6('0x1a'))};var queue=schema({'name':{'type':_0x35e6('0x1b'),'required':!![],'message':_0x35e6('0x1c')},'timeout':{'type':_0x35e6('0x1d'),'message':_0x35e6('0x1e')}});function startRouting(_0x357811,_0x4291b3,_0xaee666,_0x17b278){if(_0x357811&&_0x4291b3&&_0xaee666){_0x4291b3[_0x35e6('0x1f')]+=0x1;var _0x44efc4={'uniqueid':_0x357811,'from':_0xaee666['body']?_0xaee666[_0x35e6('0x20')][_0x35e6('0xc')]:'','joinAt':moment()[_0x35e6('0x11')](_0x35e6('0x21')),'ContactId':_0xaee666[_0x35e6('0x22')]?_0xaee666['contact']['id']:null,'ListId':_0xaee666['list']?_0xaee666[_0x35e6('0x23')]['id']:null};_0x44efc4[_[_0x35e6('0x24')](_0xaee666[_0x35e6('0x25')])+_0x35e6('0x26')]=_0x4291b3['id']||null;_0x44efc4[_['upperFirst'](_0xaee666[_0x35e6('0x25')])+_0x35e6('0x27')]=_0xaee666[_0x35e6('0x28')]?_0xaee666[_0x35e6('0x28')]['id']:null;_0x44efc4[_['upperFirst'](_0xaee666['channel'])+_0x35e6('0x29')]=_0xaee666['message']?_0xaee666['message']['id']:null;_0x44efc4[_[_0x35e6('0x24')](_0xaee666['channel'])+(_0xaee666['channel']!==_0x35e6('0x2a')?_0x35e6('0x2b'):_0x35e6('0x2c'))]=_0xaee666[_0x35e6('0xf')]?_0xaee666[_0x35e6('0xf')]['id']:null;logger[_0x35e6('0x2d')](util[_0x35e6('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x357811,_0x4291b3[_0x35e6('0x2e')]));emitChannelQueueInteraction(_0xaee666['channel'],_0x4291b3['name'],_0x44efc4,_0xaee666[_0x35e6('0xf')][_0x35e6('0x2e')],_0xaee666[_0x35e6('0x2f')]['id'],!![],_0x17b278,_0x4291b3['id']);if(rpc[_0xaee666['channel']+'QueueReport']){return rpc[_0xaee666[_0x35e6('0x25')]+_0x35e6('0x30')]['create'](_0x44efc4)['catch'](function(_0x397478){logger[_0x35e6('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x262c7f,_0x253f20,_0x3159ed,_0x33ee2b){if(_0x262c7f&&_0x253f20){_0x253f20[_0x35e6('0x1f')]-=0x1;var _0x30f81e={'leaveAt':moment()[_0x35e6('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0x35e6('0x21')),'reason':_0x35e6('0x32')};logger[_0x35e6('0x2d')](util[_0x35e6('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x262c7f,_0x253f20[_0x35e6('0x2e')]));emitChannelQueueInteraction(_0x3159ed[_0x35e6('0x25')],_0x253f20[_0x35e6('0x2e')],_0x3159ed['body'],_0x3159ed['account'][_0x35e6('0x2e')],_0x3159ed[_0x35e6('0x2f')]['id'],![],_0x33ee2b,_0x253f20['id']);if(rpc[_0x3159ed[_0x35e6('0x25')]+_0x35e6('0x30')]){return rpc[_0x3159ed[_0x35e6('0x25')]+_0x35e6('0x30')][_0x35e6('0x33')](_0x262c7f,_0x30f81e)[_0x35e6('0x34')](function(_0x3da19e){logger['error'](_0x35e6('0x35'));});}}}function endRouting(_0x282cc2,_0x108502,_0x38dd7c,_0x391968){if(_0x282cc2&&_0x108502){_0x108502[_0x35e6('0x1f')]-=0x1;var _0x2085e8={'leaveAt':moment()[_0x35e6('0x11')](_0x35e6('0x21')),'exitAt':moment()[_0x35e6('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x35e6('0x36')};logger[_0x35e6('0x2d')](util[_0x35e6('0x11')](_0x35e6('0x37'),_0x282cc2,_0x108502[_0x35e6('0x2e')]));emitChannelQueueInteraction(_0x38dd7c[_0x35e6('0x25')],_0x108502[_0x35e6('0x2e')],_0x38dd7c[_0x35e6('0x20')],_0x38dd7c['account'][_0x35e6('0x2e')],_0x38dd7c[_0x35e6('0x2f')]['id'],![],_0x391968);if(rpc[_0x38dd7c[_0x35e6('0x25')]+_0x35e6('0x30')]){return rpc[_0x38dd7c[_0x35e6('0x25')]+_0x35e6('0x30')][_0x35e6('0x33')](_0x282cc2,_0x2085e8)[_0x35e6('0x34')](function(_0x4e9e03){logger[_0x35e6('0x31')](_0x35e6('0x35'));});}}}function handleFindQueue(_0x2e1c4f){return function(_0x9c6d10){return _0x9c6d10['name']['toLowerCase']()===_0x2e1c4f[_0x35e6('0x38')]();};}exports['consequence']=function(_0x337fb7,_0x217f73,_0x411ad8,_0x396f9e){return function(_0x6ac59f){try{var _0x168074={'name':_0x217f73[0x0],'timeout':_0x217f73[0x1]};var _0x569709=queue[_0x35e6('0x0')](_0x168074,{'typecast':!![]});if(_0x569709[_0x35e6('0x39')]){logger['error']('[%s][QUEUE]\x20%s',_0x337fb7,_[_0x35e6('0x3a')](_0x569709,_0x35e6('0x2f'))[_0x35e6('0x3b')](',\x20'));_0x6ac59f[_0x35e6('0x3c')]();}else{var _0x1aa073=_[_0x35e6('0x3d')](_0x411ad8[_0x396f9e[_0x35e6('0x25')]+_0x35e6('0x3e')],handleFindQueue(_0x168074[_0x35e6('0x2e')]));if(_0x1aa073){startRouting(_0x337fb7,_0x1aa073,_0x396f9e,_0x411ad8);var _0x550d7b=(_0x1aa073[_0x35e6('0x36')]||0xa)*0x3e8;var _0x2df952=(_0x168074['timeout']||0x14)*0x3e8;var _0xa51227,_0x64363a;if(_0x550d7b>_0x2df952){_0x2df952=_0x550d7b;}var _0x2c825f=seqqueue[_0x35e6('0x3f')](_0x550d7b);_0x2c825f['id']=_0x337fb7;_0x2c825f[_0x35e6('0x40')]=_0x550d7b;_0x2c825f['qtimeout']=_0x2df952;_0x2c825f[_0x35e6('0x25')]=_0x396f9e[_0x35e6('0x25')];_0x411ad8[_0x35e6('0x41')][_0x337fb7]['on']('end',function(){logger[_0x35e6('0x2d')](_0x35e6('0x42'),_0x337fb7);stopRouting(_0x337fb7,_0x1aa073,_0x396f9e,_0x411ad8);clearTimeout(_0xa51227);_0xa51227=undefined;_0x2c825f[_0x35e6('0x43')](!![]);if(_0x411ad8[_0x35e6('0x41')][_0x337fb7]){delete _0x411ad8[_0x35e6('0x41')][_0x337fb7];}_0x6ac59f[_0x35e6('0x3c')]();});_0x411ad8[_0x35e6('0x41')][_0x337fb7]['on']('complete',function(){if(_0x411ad8[_0x35e6('0x41')][_0x337fb7]){delete _0x411ad8['rules'][_0x337fb7];}});_0xa51227=setTimeout(function(){logger[_0x35e6('0x2d')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x337fb7);endRouting(_0x337fb7,_0x1aa073,_0x396f9e,_0x411ad8);clearTimeout(_0xa51227);_0x2c825f['close'](!![]);_0x6ac59f['next']();},_0x2df952);switch(_0x1aa073[_0x35e6('0x44')]){case _0x35e6('0x45'):strategy[_0x35e6('0x45')](_0x2c825f,_0x1aa073,_0x411ad8,_0x396f9e);break;default:strategy[_0x35e6('0x46')](_0x2c825f,_0x1aa073,_0x411ad8,_0x396f9e);}}else{logger[_0x35e6('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x337fb7,_0x168074[_0x35e6('0x2e')]);_0x6ac59f[_0x35e6('0x3c')]();}}}catch(_0x1fba54){console[_0x35e6('0x47')](_0x1fba54);logger['error'](_0x35e6('0x48'),_0x337fb7,_0x1fba54[_0x35e6('0x49')]);_0x6ac59f[_0x35e6('0x3c')]();}};}; \ No newline at end of file +var _0xb72a=['%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','update','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue','from','joinAt','emit','clone','queue_id','account','format'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb72a,0x8e));var _0xab72=function(_0xe3eae6,_0x59ac61){_0xe3eae6=_0xe3eae6-0x0;var _0x279b3e=_0xb72a[_0xe3eae6];return _0x279b3e;};'use strict';var schema=require(_0xab72('0x0'));var _=require(_0xab72('0x1'));var util=require(_0xab72('0x2'));var seqqueue=require(_0xab72('0x3'));var moment=require(_0xab72('0x4'));var Redis=require(_0xab72('0x5'));var config=require(_0xab72('0x6'));var logger=require(_0xab72('0x7'))(_0xab72('0x8'));var strategy=require('./strategy');config[_0xab72('0x9')]=_[_0xab72('0xa')](config[_0xab72('0x9')],{'host':_0xab72('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab72('0x9')]));var attributes=['id','queue_id','account',_0xab72('0xc'),_0xab72('0xd'),_0xab72('0xe')];function emit(_0x10ce05,_0x377e22,_0x5b49ea){io['to'](_0x10ce05)[_0xab72('0xf')](_0x377e22,_0x5b49ea);}function emitChannelQueueInteraction(_0x362d1c,_0x2354bc,_0x33698f,_0x1fcdfe,_0x4daaca,_0x43015e,_0x1680f2,_0x49c95f){var _0x1c067d=_[_0xab72('0x10')](_0x33698f);_0x1c067d[_0xab72('0x11')]=_0x49c95f;_0x1c067d['queue']=_0x2354bc;_0x1c067d[_0xab72('0x12')]=_0x1fcdfe;_0x1c067d['id']=_0x4daaca;if(_0x43015e){_0x1680f2[util[_0xab72('0x13')](_0xab72('0x14'),_0x362d1c)][_0x4daaca]=_[_0xab72('0x15')](_0x1c067d,attributes);}else{delete _0x1680f2[util[_0xab72('0x13')](_0xab72('0x14'),_0x362d1c)][_0x4daaca];}emit(util[_0xab72('0x13')](_0xab72('0x16'),_0x362d1c,_0x2354bc),util[_0xab72('0x13')]('%s_queue_waiting_interaction:%s',_0x362d1c,_0x43015e?_0xab72('0x17'):_0xab72('0x18')),_['pick'](_0x1c067d,attributes));}var rpc={'openchannelQueueReport':require(_0xab72('0x19')),'mailQueueReport':require(_0xab72('0x1a')),'chatQueueReport':require(_0xab72('0x1b')),'smsQueueReport':require(_0xab72('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xab72('0x1d'))};var queue=schema({'name':{'type':_0xab72('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xab72('0x1f'),'message':_0xab72('0x20')}});function startRouting(_0x2afc40,_0x5c8694,_0x162f7e,_0x4424e2){if(_0x2afc40&&_0x5c8694&&_0x162f7e){_0x5c8694[_0xab72('0x21')]+=0x1;var _0x107433={'uniqueid':_0x2afc40,'from':_0x162f7e[_0xab72('0x22')]?_0x162f7e[_0xab72('0x22')][_0xab72('0xd')]:'','joinAt':moment()[_0xab72('0x13')](_0xab72('0x23')),'ContactId':_0x162f7e[_0xab72('0x24')]?_0x162f7e[_0xab72('0x24')]['id']:null,'ListId':_0x162f7e[_0xab72('0x25')]?_0x162f7e[_0xab72('0x25')]['id']:null};_0x107433[_[_0xab72('0x26')](_0x162f7e[_0xab72('0x27')])+'QueueId']=_0x5c8694['id']||null;_0x107433[_[_0xab72('0x26')](_0x162f7e[_0xab72('0x27')])+_0xab72('0x28')]=_0x162f7e['interaction']?_0x162f7e[_0xab72('0x29')]['id']:null;_0x107433[_['upperFirst'](_0x162f7e['channel'])+_0xab72('0x2a')]=_0x162f7e[_0xab72('0x2b')]?_0x162f7e[_0xab72('0x2b')]['id']:null;_0x107433[_[_0xab72('0x26')](_0x162f7e[_0xab72('0x27')])+(_0x162f7e[_0xab72('0x27')]!==_0xab72('0x2c')?_0xab72('0x2d'):_0xab72('0x2e'))]=_0x162f7e['account']?_0x162f7e[_0xab72('0x12')]['id']:null;logger[_0xab72('0x2f')](util[_0xab72('0x13')](_0xab72('0x30'),_0x2afc40,_0x5c8694[_0xab72('0x31')]));emitChannelQueueInteraction(_0x162f7e[_0xab72('0x27')],_0x5c8694[_0xab72('0x31')],_0x107433,_0x162f7e[_0xab72('0x12')][_0xab72('0x31')],_0x162f7e[_0xab72('0x2b')]['id'],!![],_0x4424e2,_0x5c8694['id']);if(rpc[_0x162f7e[_0xab72('0x27')]+_0xab72('0x32')]){return rpc[_0x162f7e[_0xab72('0x27')]+_0xab72('0x32')]['create'](_0x107433)['catch'](function(_0x521db4){logger[_0xab72('0x33')](_0xab72('0x34'));});}}}function stopRouting(_0xe5ab3,_0x24ed0e,_0x5ef69d,_0x19503b){if(_0xe5ab3&&_0x24ed0e){_0x24ed0e[_0xab72('0x21')]-=0x1;var _0x4c67b8={'leaveAt':moment()[_0xab72('0x13')](_0xab72('0x23')),'acceptAt':moment()['format'](_0xab72('0x23')),'reason':_0xab72('0x35')};logger[_0xab72('0x2f')](util['format'](_0xab72('0x36'),_0xe5ab3,_0x24ed0e['name']));emitChannelQueueInteraction(_0x5ef69d[_0xab72('0x27')],_0x24ed0e[_0xab72('0x31')],_0x5ef69d['body'],_0x5ef69d[_0xab72('0x12')][_0xab72('0x31')],_0x5ef69d[_0xab72('0x2b')]['id'],![],_0x19503b,_0x24ed0e['id']);if(rpc[_0x5ef69d[_0xab72('0x27')]+'QueueReport']){return rpc[_0x5ef69d[_0xab72('0x27')]+_0xab72('0x32')]['update'](_0xe5ab3,_0x4c67b8)[_0xab72('0x37')](function(_0x5d3cc9){logger[_0xab72('0x33')](_0xab72('0x38'));});}}}function endRouting(_0x42233c,_0x4b0aa5,_0x114653,_0x487d66){if(_0x42233c&&_0x4b0aa5){_0x4b0aa5[_0xab72('0x21')]-=0x1;var _0x5f45a3={'leaveAt':moment()['format'](_0xab72('0x23')),'exitAt':moment()[_0xab72('0x13')](_0xab72('0x23')),'reason':'timeout'};logger[_0xab72('0x2f')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x42233c,_0x4b0aa5[_0xab72('0x31')]));emitChannelQueueInteraction(_0x114653[_0xab72('0x27')],_0x4b0aa5[_0xab72('0x31')],_0x114653[_0xab72('0x22')],_0x114653['account']['name'],_0x114653['message']['id'],![],_0x487d66);if(rpc[_0x114653['channel']+'QueueReport']){return rpc[_0x114653[_0xab72('0x27')]+_0xab72('0x32')][_0xab72('0x39')](_0x42233c,_0x5f45a3)[_0xab72('0x37')](function(_0x49f6b7){logger[_0xab72('0x33')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x32ae55){return function(_0x1c26b4){return _0x1c26b4['name']['toLowerCase']()===_0x32ae55['toLowerCase']();};}exports[_0xab72('0x3a')]=function(_0x4dd982,_0x156820,_0x93821b,_0x105d64){return function(_0x27f157){try{var _0x5e4a6b={'name':_0x156820[0x0],'timeout':_0x156820[0x1]};var _0x5cb1b7=queue[_0xab72('0x0')](_0x5e4a6b,{'typecast':!![]});if(_0x5cb1b7[_0xab72('0x3b')]){logger[_0xab72('0x33')](_0xab72('0x3c'),_0x4dd982,_[_0xab72('0x3d')](_0x5cb1b7,_0xab72('0x2b'))[_0xab72('0x3e')](',\x20'));_0x27f157[_0xab72('0x3f')]();}else{var _0x415275=_[_0xab72('0x40')](_0x93821b[_0x105d64[_0xab72('0x27')]+_0xab72('0x41')],handleFindQueue(_0x5e4a6b['name']));if(_0x415275){startRouting(_0x4dd982,_0x415275,_0x105d64,_0x93821b);var _0x562a8c=(_0x415275[_0xab72('0x42')]||0xa)*0x3e8;var _0x31d114=(_0x5e4a6b[_0xab72('0x42')]||0x14)*0x3e8;var _0xc3ecd7,_0x40260b;if(_0x562a8c>_0x31d114){_0x31d114=_0x562a8c;}var _0xc0858f=seqqueue['createQueue'](_0x562a8c);_0xc0858f['id']=_0x4dd982;_0xc0858f[_0xab72('0x43')]=_0x562a8c;_0xc0858f[_0xab72('0x44')]=_0x31d114;_0xc0858f[_0xab72('0x27')]=_0x105d64['channel'];_0x93821b[_0xab72('0x45')][_0x4dd982]['on'](_0xab72('0x46'),function(){logger[_0xab72('0x2f')](_0xab72('0x47'),_0x4dd982);stopRouting(_0x4dd982,_0x415275,_0x105d64,_0x93821b);clearTimeout(_0xc3ecd7);_0xc3ecd7=undefined;_0xc0858f[_0xab72('0x48')](!![]);if(_0x93821b['rules'][_0x4dd982]){delete _0x93821b[_0xab72('0x45')][_0x4dd982];}_0x27f157[_0xab72('0x3f')]();});_0x93821b[_0xab72('0x45')][_0x4dd982]['on'](_0xab72('0x49'),function(){if(_0x93821b[_0xab72('0x45')][_0x4dd982]){delete _0x93821b[_0xab72('0x45')][_0x4dd982];}});_0xc3ecd7=setTimeout(function(){logger[_0xab72('0x2f')](_0xab72('0x4a'),_0x4dd982);endRouting(_0x4dd982,_0x415275,_0x105d64,_0x93821b);clearTimeout(_0xc3ecd7);_0xc0858f[_0xab72('0x48')](!![]);_0x27f157[_0xab72('0x4b')]();},_0x31d114);switch(_0x415275['strategy']){case _0xab72('0x4c'):strategy['rrmemory'](_0xc0858f,_0x415275,_0x93821b,_0x105d64);break;default:strategy[_0xab72('0x4d')](_0xc0858f,_0x415275,_0x93821b,_0x105d64);}}else{logger[_0xab72('0x33')](_0xab72('0x4e'),_0x4dd982,_0x5e4a6b[_0xab72('0x31')]);_0x27f157[_0xab72('0x3f')]();}}}catch(_0x34d3c4){console[_0xab72('0x4f')](_0x34d3c4);logger['error']('[%s][QUEUE]\x20%s',_0x4dd982,_0x34d3c4[_0xab72('0x50')]);_0x27f157[_0xab72('0x3f')]();}};}; \ 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 018a28c..9a406a7 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 _0xe40a=['isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','uuid','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','prototype','handleDrained','info'];(function(_0x3d0f72,_0x312855){var _0x4ee03a=function(_0x40f237){while(--_0x40f237){_0x3d0f72['push'](_0x3d0f72['shift']());}};_0x4ee03a(++_0x312855);}(_0xe40a,0x187));var _0xae40=function(_0x178116,_0xc3389f){_0x178116=_0x178116-0x0;var _0xe79429=_0xe40a[_0x178116];return _0xe79429;};'use strict';var _=require(_0xae40('0x0'));var uuid=require(_0xae40('0x1'));var util=require('./util');var logger=require(_0xae40('0x2'))('routing');var Agent=function(_0xc31799,_0x1809f4,_0x4198f5,_0x1fa5f1){this[_0xae40('0x3')]=uuid['v4']();this[_0xae40('0x4')]=_0xc31799;this[_0xae40('0x5')]=_0x1809f4;this[_0xae40('0x6')]=_0x4198f5;this[_0xae40('0x7')]=_0x1fa5f1;this['squeue'][_0xae40('0x8')](this[_0xae40('0x9')][_0xae40('0xa')](this),this[_0xae40('0xb')][_0xae40('0xa')](this));this[_0xae40('0x4')]['on']('timeout',this[_0xae40('0xb')]['bind'](this));this['squeue']['on']('drained',this['handleDrained'][_0xae40('0xa')](this));};Agent[_0xae40('0xc')][_0xae40('0x8')]=function(){this[_0xae40('0x4')]['push'](this[_0xae40('0x9')][_0xae40('0xa')](this),this['handleTimeout']['bind'](this));};Agent[_0xae40('0xc')][_0xae40('0xd')]=function(){this[_0xae40('0xb')](!![]);};Agent[_0xae40('0xc')][_0xae40('0x9')]=function(_0x119413){logger[_0xae40('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xae40('0x4')]['id'],this[_0xae40('0x5')]['id']);if(_[_0xae40('0xf')](this[_0xae40('0x6')][_0xae40('0x10')][this['agent']['id']])){logger[_0xae40('0xe')](_0xae40('0x11'),this['squeue']['id'],this[_0xae40('0x5')]['id']);setTimeout(this[_0xae40('0x8')]['bind'](this),0x3e8);}else{if(this[_0xae40('0x7')]['forcedOwnership']||util['isAgentAvailable'](this[_0xae40('0x4')]['id'],this[_0xae40('0x6')]['agents'][this['agent']['id']],this[_0xae40('0x4')][_0xae40('0x12')],![])){this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']][_0xae40('0x13')]=!![];this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']][_0xae40('0x14')]=undefined;util['showNotification'](this['notificationId'],this[_0xae40('0x4')]['id'],this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']],null,this[_0xae40('0x7')]);util[_0xae40('0x15')](this[_0xae40('0x4')]['id'],this[_0xae40('0x6')]['agents'][this[_0xae40('0x5')]['id']],_0xae40('0x16')+(this[_0xae40('0x7')][_0xae40('0x17')]?':FORCED':''));}else{logger[_0xae40('0xe')](_0xae40('0x18'),this['squeue']['id'],this[_0xae40('0x5')]['id']);setTimeout(this['push'][_0xae40('0xa')](this),0x3e8);}}};Agent['prototype'][_0xae40('0xb')]=function(_0x55ea5e){if(_[_0xae40('0xf')](this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']])){return logger[_0xae40('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xae40('0x4')]['id'],this[_0xae40('0x5')]['id']);}else{logger[_0xae40('0xe')](_0xae40('0x19'),this[_0xae40('0x4')]['id'],this['agent']['id']);util[_0xae40('0x1a')](this[_0xae40('0x3')],this[_0xae40('0x4')]['id'],this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']],null,this['routing']);this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']][_0xae40('0x13')]=![];this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']][_0xae40('0x14')]=undefined;util['writeLog'](this[_0xae40('0x4')]['id'],this[_0xae40('0x6')][_0xae40('0x10')][this[_0xae40('0x5')]['id']],_0x55ea5e?_0xae40('0x1b'):'TIMEOUT');}if(!_0x55ea5e){setTimeout(this[_0xae40('0x8')]['bind'](this),0x3e8);}};function agent(_0x397ebd,_0x2ccdc8,_0x2f4e47,_0x21c1e7){return new Agent(_0x397ebd,_0x2ccdc8,_0x2f4e47,_0x21c1e7);}module[_0xae40('0x1c')]=agent; \ No newline at end of file +var _0xa8a4=['realtime','routing','squeue','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','TIMEOUT','exports','lodash','uuid','./util','notificationId','agent'];(function(_0x1eda5b,_0x1481e5){var _0x86b25f=function(_0x4faa4a){while(--_0x4faa4a){_0x1eda5b['push'](_0x1eda5b['shift']());}};_0x86b25f(++_0x1481e5);}(_0xa8a4,0x7b));var _0x4a8a=function(_0x30194a,_0x30900f){_0x30194a=_0x30194a-0x0;var _0x23941c=_0xa8a4[_0x30194a];return _0x23941c;};'use strict';var _=require(_0x4a8a('0x0'));var uuid=require(_0x4a8a('0x1'));var util=require(_0x4a8a('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x21ad82,_0x37d245,_0x51ac52,_0x20a19e){this[_0x4a8a('0x3')]=uuid['v4']();this['squeue']=_0x21ad82;this[_0x4a8a('0x4')]=_0x37d245;this[_0x4a8a('0x5')]=_0x51ac52;this[_0x4a8a('0x6')]=_0x20a19e;this[_0x4a8a('0x7')][_0x4a8a('0x8')](this[_0x4a8a('0x9')][_0x4a8a('0xa')](this),this[_0x4a8a('0xb')][_0x4a8a('0xa')](this));this[_0x4a8a('0x7')]['on'](_0x4a8a('0xc'),this['handleTimeout'][_0x4a8a('0xa')](this));this['squeue']['on']('drained',this[_0x4a8a('0xd')][_0x4a8a('0xa')](this));};Agent[_0x4a8a('0xe')][_0x4a8a('0x8')]=function(){this[_0x4a8a('0x7')][_0x4a8a('0x8')](this[_0x4a8a('0x9')][_0x4a8a('0xa')](this),this['handleTimeout'][_0x4a8a('0xa')](this));};Agent[_0x4a8a('0xe')][_0x4a8a('0xd')]=function(){this[_0x4a8a('0xb')](!![]);};Agent['prototype']['handleRun']=function(_0x31b5cd){logger[_0x4a8a('0xf')](_0x4a8a('0x10'),this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x4')]['id']);if(_['isNil'](this['realtime'][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']])){logger['info'](_0x4a8a('0x12'),this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x4')]['id']);setTimeout(this[_0x4a8a('0x8')][_0x4a8a('0xa')](this),0x3e8);}else{if(this[_0x4a8a('0x6')][_0x4a8a('0x13')]||util[_0x4a8a('0x14')](this[_0x4a8a('0x7')]['id'],this['realtime'][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']],this[_0x4a8a('0x7')]['channel'],![])){this['realtime'][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']][_0x4a8a('0x15')]=!![];this['realtime']['agents'][this[_0x4a8a('0x4')]['id']][_0x4a8a('0x16')]=undefined;util[_0x4a8a('0x17')](this[_0x4a8a('0x3')],this[_0x4a8a('0x7')]['id'],this['realtime'][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']],null,this[_0x4a8a('0x6')]);util[_0x4a8a('0x18')](this['squeue']['id'],this[_0x4a8a('0x5')]['agents'][this[_0x4a8a('0x4')]['id']],_0x4a8a('0x19')+(this[_0x4a8a('0x6')]['forcedOwnership']?_0x4a8a('0x1a'):''));}else{logger[_0x4a8a('0xf')](_0x4a8a('0x1b'),this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x4')]['id']);setTimeout(this[_0x4a8a('0x8')]['bind'](this),0x3e8);}}};Agent[_0x4a8a('0xe')][_0x4a8a('0xb')]=function(_0x5d2f0e){if(_[_0x4a8a('0x1c')](this[_0x4a8a('0x5')][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']])){return logger[_0x4a8a('0xf')](_0x4a8a('0x12'),this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x4')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x4')]['id']);util[_0x4a8a('0x1d')](this['notificationId'],this[_0x4a8a('0x7')]['id'],this[_0x4a8a('0x5')][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']],null,this[_0x4a8a('0x6')]);this[_0x4a8a('0x5')][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']]['busy']=![];this['realtime']['agents'][this[_0x4a8a('0x4')]['id']][_0x4a8a('0x16')]=undefined;util[_0x4a8a('0x18')](this[_0x4a8a('0x7')]['id'],this['realtime'][_0x4a8a('0x11')][this[_0x4a8a('0x4')]['id']],_0x5d2f0e?'STOP':_0x4a8a('0x1e'));}if(!_0x5d2f0e){setTimeout(this['push'][_0x4a8a('0xa')](this),0x3e8);}};function agent(_0x72d3a5,_0x14d000,_0x29790b,_0x2570b1){return new Agent(_0x72d3a5,_0x14d000,_0x29790b,_0x2570b1);}module[_0x4a8a('0x1f')]=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 cbf02d8..d449c91 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 _0xf1c6=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','queue','realtime','push','bind','handleTimeout','timeout','squeue','handleDrained','handleRun','prototype','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','showNotification','info','[%s][QUEUE]\x20EMPTY'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf1c6,0x145));var _0x6f1c=function(_0x1333b2,_0x244c7c){_0x1333b2=_0x1333b2-0x0;var _0x2cf9bc=_0xf1c6[_0x1333b2];return _0x2cf9bc;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x6f1c('0x0'));var logger=require(_0x6f1c('0x1'))(_0x6f1c('0x2'));var Beepall=function(_0x405b3c,_0xc393e2,_0x5daa45,_0x5f0d77){this[_0x6f1c('0x3')]=uuid['v4']();this['squeue']=_0x405b3c;this[_0x6f1c('0x4')]=_0xc393e2;this[_0x6f1c('0x5')]=_0x5daa45;this[_0x6f1c('0x2')]=_0x5f0d77;this['squeue'][_0x6f1c('0x6')](this['handleRun'][_0x6f1c('0x7')](this),this[_0x6f1c('0x8')][_0x6f1c('0x7')](this));this['squeue']['on'](_0x6f1c('0x9'),this['handleTimeout'][_0x6f1c('0x7')](this));this[_0x6f1c('0xa')]['on']('drained',this[_0x6f1c('0xb')][_0x6f1c('0x7')](this));};Beepall['prototype']['push']=function(){this['squeue']['push'](this[_0x6f1c('0xc')]['bind'](this),this['handleTimeout']['bind'](this));};Beepall['prototype']['handleDrained']=function(_0x38d780){this[_0x6f1c('0x8')](!![]);};Beepall[_0x6f1c('0xd')]['handleRun']=function(_0x82203a){var _0x238c62=!![];if(!_[_0x6f1c('0xe')](this['queue'])&&!_[_0x6f1c('0xe')](this[_0x6f1c('0x4')]['Agents'])&&this[_0x6f1c('0x4')][_0x6f1c('0xf')][_0x6f1c('0x10')]>0x0){for(var _0x6e2d39=0x0,_0x3c3e21;_0x6e2d390x0){for(var _0x2a2532=0x0,_0x3fb0e1;_0x2a25320x0&&_0x4f4304[_0x384218+'CurrentCapacity']>=_0x4f4304[_0x384218+_0xc53e('0x24')]){writeLog(_0x531ede,_0x4f4304,_0x384218['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x3c5056,_0x57a1f5,_0x28240a,_0x4f203d,_0x24a77e){return sendNotification(!![],_0x3c5056,_0x57a1f5,_0x28240a,_0x4f203d,_0x24a77e);};exports['hideNotification']=function(_0x5ce216,_0x8f0ee6,_0x6a62b0,_0x42dec1,_0x2fa20b){return sendNotification(![],_0x5ce216,_0x8f0ee6,_0x6a62b0,_0x42dec1,_0x2fa20b);};exports[_0xc53e('0x26')]=writeLog; \ No newline at end of file +var _0xbd51=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','../utils','mustache','ioredis','../../../../../config/environment','redis','localhost','socket.io-emitter','emit','format','user:%s','name','split','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','save','remove'];(function(_0x698169,_0x1b8063){var _0x2fa18c=function(_0x9e1bfb){while(--_0x9e1bfb){_0x698169['push'](_0x698169['shift']());}};_0x2fa18c(++_0x1b8063);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x421872,_0x569930){_0x421872=_0x421872-0x0;var _0x124d9c=_0xbd51[_0x421872];return _0x124d9c;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var utils=require(_0x1bd5('0x1'));var Mustache=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var config=require(_0x1bd5('0x4'));var logger=require('../../../../../config/logger')('routing');config['redis']=_['defaults'](config[_0x1bd5('0x5')],{'host':_0x1bd5('0x6'),'port':0x18eb});var io=require(_0x1bd5('0x7'))(new Redis(config['redis']));function emit(_0x29abea,_0x30a385,_0x19077c){io['to'](_0x29abea)[_0x1bd5('0x8')](_0x30a385,_0x19077c);}function sendNotification(_0xd8418f,_0x4a7f90,_0x36ef1a,_0x5c8e0d,_0x2bd975,_0x28df8e){io['to'](util[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x5c8e0d[_0x1bd5('0xb')]))[_0x1bd5('0x8')]('user:save',_0x5c8e0d);var _0x456ef8=_0x28df8e||{};var _0x4e666c=_0x36ef1a[_0x1bd5('0xc')]('.');var _0x24e38c={'uniqueid':_0x4a7f90,'channel':_0x4e666c[0x0],'id':_0x4e666c[0x1],'title':_0x4e666c[0x0]+_0x1bd5('0xd'),'interactionId':_0x4e666c[0x2],'queue':_0x2bd975?_0x2bd975[_0x1bd5('0xb')]:null,'sound':_0x456ef8[_0x1bd5('0xe')][_0x1bd5('0xf')],'shake':_0x456ef8[_0x1bd5('0xe')]['notificationShake']};try{if(!_0x456ef8['body']){_0x456ef8[_0x1bd5('0x10')]={};}if(_0x2bd975){_0x456ef8[_0x1bd5('0x10')][_0x1bd5('0x11')]=_0x2bd975;}else if(_0x456ef8[_0x1bd5('0x10')]['queue']){delete _0x456ef8['body'][_0x1bd5('0x11')];}_0x24e38c[_0x1bd5('0x12')]=utils[_0x1bd5('0x13')](_0x456ef8[_0x1bd5('0xe')][_0x1bd5('0x14')],_0x456ef8);}catch(_0x2d2e80){_0x24e38c[_0x1bd5('0x12')]=_0x1bd5('0x15');logger[_0x1bd5('0x16')](util['format']('[%s][QUEUE]\x20%s',_0x4a7f90,_0x2d2e80[_0x1bd5('0x17')]));}io['to'](util[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x5c8e0d[_0x1bd5('0xb')]))[_0x1bd5('0x8')](util[_0x1bd5('0x9')](_0x1bd5('0x18'),_0xd8418f?_0x1bd5('0x19'):_0x1bd5('0x1a')),_0x24e38c);}function writeLog(_0xb1ac1e,_0x34bd6a,_0x2447c4){return logger[_0x1bd5('0x1b')](util[_0x1bd5('0x9')](_0x1bd5('0x1c'),_0xb1ac1e,_0x34bd6a[_0x1bd5('0xb')],_0x2447c4));}exports[_0x1bd5('0x1d')]=function(_0x29c340,_0x5567c9,_0x42c43d,_0x50c663){if(_0x5567c9[_0x1bd5('0x1e')]){writeLog(_0x29c340,_0x5567c9,_0x1bd5('0x1f'));return![];}if(!_0x5567c9[_0x1bd5('0x20')]){writeLog(_0x29c340,_0x5567c9,'OFFLINE');return![];}if(_0x5567c9[_0x42c43d+_0x1bd5('0x21')]){writeLog(_0x29c340,_0x5567c9,'PAUSE');return![];}if(_0x50c663&&_0x5567c9[_0x1bd5('0x22')](_0x42c43d+_0x1bd5('0x23'))&&_0x5567c9[_0x1bd5('0x22')](_0x42c43d+_0x1bd5('0x24'))){if(_0x5567c9[_0x42c43d+'Capacity']>0x0&&_0x5567c9[_0x42c43d+_0x1bd5('0x24')]>=_0x5567c9[_0x42c43d+_0x1bd5('0x23')]){writeLog(_0x29c340,_0x5567c9,_0x42c43d[_0x1bd5('0x25')]()+_0x1bd5('0x26'));return![];}}return!![];};exports['showNotification']=function(_0xdba332,_0x24d4d9,_0x3595e9,_0x369b88,_0xe54b9f){return sendNotification(!![],_0xdba332,_0x24d4d9,_0x3595e9,_0x369b88,_0xe54b9f);};exports[_0x1bd5('0x27')]=function(_0x4e72b2,_0x289097,_0x472b22,_0x8d53ba,_0x4bcc77){return sendNotification(![],_0x4e72b2,_0x289097,_0x472b22,_0x8d53ba,_0x4bcc77);};exports[_0x1bd5('0x28')]=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 fef88ba..ff4da79 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 _0xdab3=['exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdab3,0x1d6));var _0x3dab=function(_0x47a9d7,_0x30548b){_0x47a9d7=_0x47a9d7-0x0;var _0x400207=_0xdab3[_0x47a9d7];return _0x400207;};'use strict';var schema=require(_0x3dab('0x0'));var sh=require(_0x3dab('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x3dab('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0x3dab('0x3')}});exports[_0x3dab('0x4')]=function(_0x49d8f6,_0x5355c7){return function(_0x11c3a2){try{var _0x335670={'command':_0x5355c7[0x0]};var _0x143dae=system[_0x3dab('0x0')](_0x335670,{'typecast':!![]});if(_0x143dae[_0x3dab('0x5')]){logger[_0x3dab('0x6')](_0x3dab('0x7'),_0x49d8f6,_['map'](_0x143dae,'message')[_0x3dab('0x8')](',\x20'));logger[_0x3dab('0x9')](_0x3dab('0xa'),_0x49d8f6);_0x11c3a2[_0x3dab('0xb')]();}else{var _0x43d8fa=this;var _0x127980=utils[_0x3dab('0xc')](_0x5355c7[0x0],this);logger[_0x3dab('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x49d8f6,_0x127980);sh[_0x3dab('0xd')](_['trim'](_0x127980),function(_0xd1cb26,_0x59ed3a){logger[_0x3dab('0x9')](_0x3dab('0xe'),_0x49d8f6,_0xd1cb26);if(_0xd1cb26==0x0){var _0x22358b=_0x59ed3a[_0x3dab('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x3dab('0x10')](_0x5355c7[0x1])||_[_0x3dab('0x11')](_0x5355c7[0x1])){logger['info'](_0x3dab('0x12'),_0x49d8f6);_0x43d8fa[_0x3dab('0x13')][_0x5355c7[0x1]]=_0x22358b;}else{logger[_0x3dab('0x9')](_0x3dab('0x14'),_0x49d8f6,_0x5355c7[0x1],_0x22358b);_0x43d8fa['body'][_0x5355c7[0x1]]=_0x22358b;}}_0x11c3a2[_0x3dab('0xb')]();});}}catch(_0x14a5e1){logger[_0x3dab('0x6')]('[%s][SYSTEM]\x20%s',_0x49d8f6,_[_0x3dab('0x15')](_0x14a5e1)?JSON[_0x3dab('0x16')](_0x14a5e1):_0x14a5e1);logger['info'](_0x3dab('0xa'),_0x49d8f6);_0x11c3a2[_0x3dab('0xb')]();}};}; \ No newline at end of file +var _0xd33b=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','stringify','validate','shelljs','./utils','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd33b,0x1af));var _0xbd33=function(_0x3948e0,_0x3cba5d){_0x3948e0=_0x3948e0-0x0;var _0x40c413=_0xd33b[_0x3948e0];return _0x40c413;};'use strict';var schema=require(_0xbd33('0x0'));var sh=require(_0xbd33('0x1'));var _=require('lodash');var utils=require(_0xbd33('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xbd33('0x3')}});exports[_0xbd33('0x4')]=function(_0x545c88,_0x1005b0){return function(_0x343d29){try{var _0x2c8b0c={'command':_0x1005b0[0x0]};var _0x2b9c0d=system['validate'](_0x2c8b0c,{'typecast':!![]});if(_0x2b9c0d[_0xbd33('0x5')]){logger['error'](_0xbd33('0x6'),_0x545c88,_[_0xbd33('0x7')](_0x2b9c0d,_0xbd33('0x8'))[_0xbd33('0x9')](',\x20'));logger[_0xbd33('0xa')](_0xbd33('0xb'),_0x545c88);_0x343d29[_0xbd33('0xc')]();}else{var _0x525774=this;var _0x1f6496=utils[_0xbd33('0xd')](_0x1005b0[0x0],this);logger['info'](_0xbd33('0xe'),_0x545c88,_0x1f6496);sh[_0xbd33('0xf')](_[_0xbd33('0x10')](_0x1f6496),function(_0x523ecc,_0x1ee23b){logger[_0xbd33('0xa')](_0xbd33('0x11'),_0x545c88,_0x523ecc);if(_0x523ecc==0x0){var _0x335fb0=_0x1ee23b[_0xbd33('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xbd33('0x13')](_0x1005b0[0x1])||_[_0xbd33('0x14')](_0x1005b0[0x1])){logger['info'](_0xbd33('0x15'),_0x545c88);_0x525774[_0xbd33('0x16')][_0x1005b0[0x1]]=_0x335fb0;}else{logger[_0xbd33('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x545c88,_0x1005b0[0x1],_0x335fb0);_0x525774['body'][_0x1005b0[0x1]]=_0x335fb0;}}_0x343d29['next']();});}}catch(_0x519694){logger[_0xbd33('0x17')](_0xbd33('0x6'),_0x545c88,_['isObject'](_0x519694)?JSON[_0xbd33('0x18')](_0x519694):_0x519694);logger[_0xbd33('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x545c88);_0x343d29[_0xbd33('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 2b1b0de..8e9047a 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 _0x950c=['error','map','message','join','info','next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0xb90b57,_0x140cc9){var _0x23d0c7=function(_0x18fdf2){while(--_0x18fdf2){_0xb90b57['push'](_0xb90b57['shift']());}};_0x23d0c7(++_0x140cc9);}(_0x950c,0x1ed));var _0xc950=function(_0x5d9607,_0x561062){_0x5d9607=_0x5d9607-0x0;var _0x9a3e16=_0x950c[_0x5d9607];return _0x9a3e16;};'use strict';var schema=require(_0xc950('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xc950('0x1')),'openchannelInteraction':require(_0xc950('0x2')),'smsInteraction':require(_0xc950('0x3')),'mailInteraction':require(_0xc950('0x4')),'faxInteraction':require(_0xc950('0x5')),'whatsappInteraction':require(_0xc950('0x6'))};var logger=require('../../../../config/logger')(_0xc950('0x7'));var tag=schema({'tag':{'type':_0xc950('0x8'),'required':!![],'message':_0xc950('0x9')}});exports[_0xc950('0xa')]=function(_0x2341fa,_0x250ee0,_0x1276d5,_0x3eb5a5){return function(_0x3e4fae){try{var _0x22a20f={'tag':_0x250ee0[0x0]};var _0x21f704=tag['validate'](_0x22a20f,{'typecast':!![]});if(_0x21f704['length']){logger[_0xc950('0xb')]('[%s][TAG]\x20%s',_0x2341fa,_[_0xc950('0xc')](_0x21f704,_0xc950('0xd'))[_0xc950('0xe')](',\x20'));logger[_0xc950('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2341fa);_0x3e4fae[_0xc950('0x10')]();}else{var _0x4e0de0={'ids':[_0x250ee0[0x0]]};if(rpc[_0x3eb5a5['channel']+_0xc950('0x11')]){rpc[_0x3eb5a5[_0xc950('0x12')]+'Interaction'][_0xc950('0x13')](_0x3eb5a5[_0xc950('0x14')]['id'],_0x4e0de0)[_0xc950('0x15')](function(_0x5b33e7){logger['info'](_0xc950('0x16'),_0x2341fa,_0x250ee0[0x1],_0x3eb5a5[_0xc950('0x12')],_0x3eb5a5['interaction']['id']);})[_0xc950('0x17')](function(_0xa58cb1){logger[_0xc950('0xb')](_0xc950('0x18'),_0x2341fa,JSON[_0xc950('0x19')](_0xa58cb1));logger[_0xc950('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2341fa);})[_0xc950('0x1a')](function(){_0x3e4fae['next']();});}}}catch(_0x722962){logger['error'](_0xc950('0x18'),_0x2341fa,_['isObject'](_0x722962)?JSON[_0xc950('0x19')](_0x722962):_0x722962);logger[_0xc950('0xf')](_0xc950('0x1b'),_0x2341fa);_0x3e4fae[_0xc950('0x10')]();}};}; \ No newline at end of file +var _0x1cbb=['validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','next','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject'];(function(_0x4741c3,_0x2a10be){var _0x4ccfdb=function(_0x20d8be){while(--_0x20d8be){_0x4741c3['push'](_0x4741c3['shift']());}};_0x4ccfdb(++_0x2a10be);}(_0x1cbb,0x73));var _0xb1cb=function(_0x23ab4b,_0x4e8beb){_0x23ab4b=_0x23ab4b-0x0;var _0x4b1908=_0x1cbb[_0x23ab4b];return _0x4b1908;};'use strict';var schema=require(_0xb1cb('0x0'));var _=require(_0xb1cb('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb1cb('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb1cb('0x3')),'faxInteraction':require(_0xb1cb('0x4')),'whatsappInteraction':require(_0xb1cb('0x5'))};var logger=require(_0xb1cb('0x6'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0xb1cb('0x7')}});exports[_0xb1cb('0x8')]=function(_0x1d0b08,_0x29bd66,_0x3fbb0a,_0x142788){return function(_0x49cce7){try{var _0x448f03={'tag':_0x29bd66[0x0]};var _0x3713e5=tag[_0xb1cb('0x0')](_0x448f03,{'typecast':!![]});if(_0x3713e5[_0xb1cb('0x9')]){logger[_0xb1cb('0xa')](_0xb1cb('0xb'),_0x1d0b08,_['map'](_0x3713e5,_0xb1cb('0xc'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1d0b08);_0x49cce7[_0xb1cb('0xd')]();}else{var _0x38abd5={'ids':[_0x29bd66[0x0]]};if(rpc[_0x142788[_0xb1cb('0xe')]+_0xb1cb('0xf')]){rpc[_0x142788['channel']+'Interaction'][_0xb1cb('0x10')](_0x142788[_0xb1cb('0x11')]['id'],_0x38abd5)['then'](function(_0x7e03b0){logger[_0xb1cb('0x12')](_0xb1cb('0x13'),_0x1d0b08,_0x29bd66[0x1],_0x142788['channel'],_0x142788[_0xb1cb('0x11')]['id']);})['catch'](function(_0xc27cf0){logger['error'](_0xb1cb('0xb'),_0x1d0b08,JSON[_0xb1cb('0x14')](_0xc27cf0));logger['info'](_0xb1cb('0x15'),_0x1d0b08);})['finally'](function(){_0x49cce7['next']();});}}}catch(_0x11d6a6){logger['error']('[%s][TAG]\x20%s',_0x1d0b08,_[_0xb1cb('0x16')](_0x11d6a6)?JSON['stringify'](_0x11d6a6):_0x11d6a6);logger['info'](_0xb1cb('0x15'),_0x1d0b08);_0x49cce7['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 8b4d321..b72715f 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 _0xe2a8=['next','request-promise','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','stringify','utf8','POST','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','info','catch','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0x4e3579,_0x2540c4){var _0x3b8a61=function(_0x3d5e77){while(--_0x3d5e77){_0x4e3579['push'](_0x4e3579['shift']());}};_0x3b8a61(++_0x2540c4);}(_0xe2a8,0x1e1));var _0x8e2a=function(_0x52a44e,_0x240060){_0x52a44e=_0x52a44e-0x0;var _0xdbc889=_0xe2a8[_0x52a44e];return _0xdbc889;};'use strict';var rp=require(_0x8e2a('0x0'));var logger=require(_0x8e2a('0x1'))(_0x8e2a('0x2'));var _=require(_0x8e2a('0x3'));var arr=[];exports['consequence']=function(_0xcb79cc,_0x58621b){return function(_0x57eb58){var _0x5821cb=_0x58621b[0xa];var _0x4e31ad=_0x58621b[0xb];var _0x5a51e6=_0x58621b[0xc];var _0x17accc=_0x58621b[0xd];var _0x3ccb9=_0x58621b[0xe];var _0xefc0b2=_0x58621b[0xf][_0x8e2a('0x4')](/\n/g,_0x8e2a('0x5'));var _0x2ebf52=_0x58621b[0x10][_0x8e2a('0x4')](/\n/g,'\x20');if(!arr[_0x8e2a('0x6')](_0x4e31ad)){arr[_0x8e2a('0x7')](_0x4e31ad);var _0x4c2fe1=_0x58621b[0x3];var _0x210a65=_0x58621b[0x4];var _0x33c6db=_0x58621b[0x1];var _0x23957e=_0x58621b[0x0];var _0x38a8f7={};_0x38a8f7[_0x8e2a('0x8')]=_0x58621b[0x8]+_0x8e2a('0x9')+_0x5a51e6+'|'+_0x5821cb+'|'+_0x17accc+'|'+_0x4e31ad+'|'+_0x3ccb9;_0x38a8f7[_0x8e2a('0xa')]=_0x58621b[0x7]+'?params='+_0x5a51e6+'|'+_0x5821cb+'|'+_0x17accc+'|'+_0x4e31ad+'|'+_0x3ccb9+'|'+_0xefc0b2+'|'+_0x2ebf52;_0x38a8f7[_0x8e2a('0xb')]=_0x58621b[0x9];var _0x5bd43c={};_0x5bd43c[_0x8e2a('0xc')]='2.0';_0x5bd43c[_0x8e2a('0xd')]=_0x8e2a('0xe');var _0x233ba6=[];_0x233ba6[_0x8e2a('0x7')](_0x58621b[0x2]);_0x233ba6[_0x8e2a('0x7')](_0x58621b[0x5]);_0x233ba6['push'](_0x58621b[0x6]);_0x5bd43c['params']=_0x233ba6;_0x5bd43c['id']=0x1;var _0x47652f=JSON[_0x8e2a('0xf')](_0x5bd43c);var _0x577b47={'encoding':_0x8e2a('0x10'),'method':_0x8e2a('0x11'),'timeout':0x2710,'url':_0x4c2fe1,'headers':{'Content-Type':'application/json-rpc'},'body':_0x47652f};return rp(_0x577b47)[_0x8e2a('0x12')](function(_0x15a6ad){const _0x2259b5=JSON['parse'](_0x15a6ad);if(!_0x2259b5[_0x8e2a('0x13')]['logged']){throw new Error(_0x8e2a('0x14'));}var _0x4e422a=_0x4e31ad;var _0x140e7c='channelId='+_0x33c6db+_0x8e2a('0x15')+_0x23957e+'&sessionId='+_0x4e422a+_0x8e2a('0x16')+JSON[_0x8e2a('0xf')](_0x38a8f7);var _0x37d66d=_0x210a65+'?'+_0x140e7c;return rp(_0x37d66d);})['then'](function(_0x130fee){logger[_0x8e2a('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0xcb79cc,_0x130fee);_0x57eb58['stop']();})[_0x8e2a('0x18')](function(_0x4ba25f){logger['error'](_0x8e2a('0x19'),_0xcb79cc,_[_0x8e2a('0x1a')](_0x4ba25f)?JSON[_0x8e2a('0xf')](_0x4ba25f):_0x4ba25f);_0x57eb58[_0x8e2a('0x1b')]();});}else{logger[_0x8e2a('0x17')](_0x8e2a('0x1c'),_0xcb79cc);_0x57eb58[_0x8e2a('0x1d')]();}};}; \ No newline at end of file +var _0xed91=['application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','replace','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','push','params','stringify'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xed91,0x1f0));var _0x1ed9=function(_0x226008,_0x3b2a21){_0x226008=_0x226008-0x0;var _0xeeb3a1=_0xed91[_0x226008];return _0xeeb3a1;};'use strict';var rp=require(_0x1ed9('0x0'));var logger=require(_0x1ed9('0x1'))(_0x1ed9('0x2'));var _=require('lodash');var arr=[];exports[_0x1ed9('0x3')]=function(_0x43641b,_0x4fd2b7){return function(_0x12e875){var _0x3ff455=_0x4fd2b7[0xa];var _0x440797=_0x4fd2b7[0xb];var _0x14d567=_0x4fd2b7[0xc];var _0x3e3075=_0x4fd2b7[0xd];var _0x3d6181=_0x4fd2b7[0xe];var _0x34e8c7=_0x4fd2b7[0xf]['replace'](/\n/g,_0x1ed9('0x4'));var _0x28154f=_0x4fd2b7[0x10][_0x1ed9('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x440797)){arr['push'](_0x440797);var _0x2a3188=_0x4fd2b7[0x3];var _0x2fc5bb=_0x4fd2b7[0x4];var _0x3a465d=_0x4fd2b7[0x1];var _0x2761bb=_0x4fd2b7[0x0];var _0x2e2086={};_0x2e2086[_0x1ed9('0x6')]=_0x4fd2b7[0x8]+_0x1ed9('0x7')+_0x14d567+'|'+_0x3ff455+'|'+_0x3e3075+'|'+_0x440797+'|'+_0x3d6181;_0x2e2086[_0x1ed9('0x8')]=_0x4fd2b7[0x7]+_0x1ed9('0x7')+_0x14d567+'|'+_0x3ff455+'|'+_0x3e3075+'|'+_0x440797+'|'+_0x3d6181+'|'+_0x34e8c7+'|'+_0x28154f;_0x2e2086[_0x1ed9('0x9')]=_0x4fd2b7[0x9];var _0x3c30e8={};_0x3c30e8[_0x1ed9('0xa')]='2.0';_0x3c30e8['method']='login';var _0x17a0a5=[];_0x17a0a5[_0x1ed9('0xb')](_0x4fd2b7[0x2]);_0x17a0a5['push'](_0x4fd2b7[0x5]);_0x17a0a5[_0x1ed9('0xb')](_0x4fd2b7[0x6]);_0x3c30e8[_0x1ed9('0xc')]=_0x17a0a5;_0x3c30e8['id']=0x1;var _0x4aa987=JSON[_0x1ed9('0xd')](_0x3c30e8);var _0xcbc7fc={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x2a3188,'headers':{'Content-Type':_0x1ed9('0xe')},'body':_0x4aa987};return rp(_0xcbc7fc)[_0x1ed9('0xf')](function(_0x2c02a0){const _0x589035=JSON['parse'](_0x2c02a0);if(!_0x589035[_0x1ed9('0x10')][_0x1ed9('0x11')]){throw new Error(_0x1ed9('0x12'));}var _0x59de15=_0x440797;var _0x389089=_0x1ed9('0x13')+_0x3a465d+_0x1ed9('0x14')+_0x2761bb+_0x1ed9('0x15')+_0x59de15+_0x1ed9('0x16')+JSON[_0x1ed9('0xd')](_0x2e2086);var _0x157b5d=_0x2fc5bb+'?'+_0x389089;return rp(_0x157b5d);})['then'](function(_0x307145){logger['info'](_0x1ed9('0x17'),_0x43641b,_0x307145);_0x12e875[_0x1ed9('0x18')]();})['catch'](function(_0x362d85){logger['error'](_0x1ed9('0x19'),_0x43641b,_[_0x1ed9('0x1a')](_0x362d85)?JSON[_0x1ed9('0xd')](_0x362d85):_0x362d85);_0x12e875[_0x1ed9('0x18')]();});}else{logger[_0x1ed9('0x1b')](_0x1ed9('0x1c'),_0x43641b);_0x12e875[_0x1ed9('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 8b10ce3..fd277c3 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1ec135,_0x2411b7){var _0x2cc959=function(_0x1582e3){while(--_0x1582e3){_0x1ec135['push'](_0x1ec135['shift']());}};_0x2cc959(++_0x2411b7);}(_0xe706,0xa3));var _0x6e70=function(_0x9aad68,_0x45377){_0x9aad68=_0x9aad68-0x0;var _0x281340=_0xe706[_0x9aad68];return _0x281340;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x40fdec,_0x5ad6b5){var _0x3a4b60=function(_0x5f2ad6){while(--_0x5f2ad6){_0x40fdec['push'](_0x40fdec['shift']());}};_0x3a4b60(++_0x5ad6b5);}(_0xe706,0xa3));var _0x6e70=function(_0x5eca6f,_0x76ec15){_0x5eca6f=_0x5eca6f-0x0;var _0x4c34b7=_0xe706[_0x5eca6f];return _0x4c34b7;};'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 11b013e..513e605 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 _0x0bb5=['capacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty'];(function(_0x74c6bd,_0x565ae4){var _0x59ad33=function(_0x47e784){while(--_0x47e784){_0x74c6bd['push'](_0x74c6bd['shift']());}};_0x59ad33(++_0x565ae4);}(_0x0bb5,0x148));var _0x50bb=function(_0x3500ea,_0x230490){_0x3500ea=_0x3500ea-0x0;var _0x359122=_0x0bb5[_0x3500ea];return _0x359122;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x50bb('0x2'));var uuid=require(_0x50bb('0x3'));var utils=require(_0x50bb('0x4'));var config=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var rpc={'openchannelQueueReport':require(_0x50bb('0x8')),'mailQueueReport':require(_0x50bb('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x50bb('0xa')),'whatsappQueueReport':require(_0x50bb('0xb'))};var RuleEngine=require(_0x50bb('0xc'));function getId(_0x33ff54,_0x4f9172,_0x4ab8d7){return util[_0x50bb('0xd')](_0x50bb('0xe'),_0x33ff54,_0x4f9172||0x0,_0x4ab8d7||0x0);}function getIntervals(_0x3ae598,_0x239a89){var _0x5512e1=[];if(!_[_0x50bb('0xf')](_0x239a89[_0x50bb('0x10')])&&!_[_0x50bb('0xf')](_0x3ae598[_0x239a89[_0x50bb('0x10')]])&&!_[_0x50bb('0xf')](_0x3ae598[_0x239a89[_0x50bb('0x10')]][_0x50bb('0x11')])){_0x5512e1=_['map'](_0x3ae598[_0x239a89[_0x50bb('0x10')]]['Intervals'],_0x50bb('0x12'));}else if(!_[_0x50bb('0xf')](_0x239a89[_0x50bb('0x12')])){_0x5512e1=[_0x239a89['interval']];}return _0x5512e1;}exports[_0x50bb('0x13')]=function(_0x309986){_0x309986[_0x50bb('0x14')]={};return new BPromise(function(_0x5244b0,_0xbbc6a0){var _0x5e8478={'Start':function(_0x21befa){var _0x3e1a51=this;return new Promise(function(_0x253073,_0x42ffab){if(_0x21befa){try{var _0x908950=[];var _0x4f2897=getId(_0x21befa[_0x50bb('0x15')],_0x21befa[_0x50bb('0x16')]?_0x21befa['message']['id']:0x0,_0x21befa[_0x50bb('0x17')]?_0x21befa['interaction']['id']:0x0);if(_0x21befa[_0x50bb('0x18')]&&_[_0x50bb('0x19')](_0x21befa['applications'])&&_0x21befa['applications'][_0x50bb('0x1a')]){for(var _0x1499dc=0x0;_0x1499dc<_0x21befa[_0x50bb('0x18')][_0x50bb('0x1a')];_0x1499dc+=0x1){var _0x56b25a=_0x21befa[_0x50bb('0x18')][_0x1499dc];if(fs[_0x50bb('0x1b')](path[_0x50bb('0x1c')](__dirname,'applications',_0x56b25a[_0x50bb('0x1d')]+_0x50bb('0x1e')))){var _0x1344ec=[];switch(_0x56b25a['app'][_0x50bb('0x1f')]()){case'autoreply':var _0x1c81a1=_0x56b25a[_0x50bb('0x20')][_0x50bb('0x21')](',');if(_0x21befa[_0x50bb('0x15')]===_0x50bb('0x22')){_0x1344ec[_0x50bb('0x23')](_0x1c81a1[0x0]);_0x1344ec['push'](_0x1c81a1[0x1]);_0x1344ec[_0x50bb('0x23')](_0x1c81a1[_0x50bb('0x24')](0x2,_0x1c81a1[_0x50bb('0x1a')])[_0x50bb('0x1c')](','));}else{_0x1344ec['push'](_0x1c81a1[0x0]);_0x1344ec[_0x50bb('0x23')](_0x1c81a1['slice'](0x1,_0x1c81a1['length'])[_0x50bb('0x1c')](','));}break;case'dialogflow':var _0x5cfe4b=_0x56b25a[_0x50bb('0x20')][_0x50bb('0x21')](',');_0x1344ec[_0x50bb('0x23')](_0x5cfe4b[0x0]);_0x1344ec[_0x50bb('0x23')](_0x5cfe4b[0x1]);_0x1344ec[_0x50bb('0x23')](_0x5cfe4b[_0x50bb('0x24')](0x2,_0x5cfe4b[_0x50bb('0x1a')])[_0x50bb('0x1c')](','));break;case'dialogflowv2':var _0x44ce86=_0x56b25a[_0x50bb('0x20')][_0x50bb('0x21')](',');_0x1344ec[_0x50bb('0x23')](_0x44ce86[0x0]);_0x1344ec['push'](_0x44ce86[0x1]);_0x1344ec[_0x50bb('0x23')](_0x44ce86[0x2]);_0x1344ec[_0x50bb('0x23')](_0x44ce86[0x3]);_0x1344ec[_0x50bb('0x23')](_0x44ce86[_0x50bb('0x24')](0x4,_0x44ce86[_0x50bb('0x1a')])[_0x50bb('0x1c')](','));break;case _0x50bb('0x25'):var _0x3b33b9=_0x56b25a[_0x50bb('0x20')][_0x50bb('0x21')](',');_0x1344ec[_0x50bb('0x23')](_0x3b33b9[0x0]);_0x1344ec[_0x50bb('0x23')](_0x3b33b9[0x1]);_0x1344ec['push'](_0x3b33b9[0x2]);_0x1344ec[_0x50bb('0x23')](_0x3b33b9[0x3]);_0x1344ec[_0x50bb('0x23')](_0x3b33b9[_0x50bb('0x24')](0x4,_0x3b33b9[_0x50bb('0x1a')])[_0x50bb('0x1c')](','));break;case _0x50bb('0x16'):_0x1344ec[_0x50bb('0x23')](_0x56b25a[_0x50bb('0x20')]);break;case _0x50bb('0x26'):_0x1344ec[_0x50bb('0x23')](_0x56b25a[_0x50bb('0x27')]);_0x1344ec['push'](_0x56b25a[_0x50bb('0x20')]);break;case _0x50bb('0x28'):var _0x20a097=utils[_0x50bb('0x29')](_0x21befa[_0x50bb('0x2a')][_0x50bb('0x2b')],_0x21befa);var _0x53600a=_0x56b25a['appdata'][_0x50bb('0x21')](',');_0x1344ec['push'](_0x53600a[0x0]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x1]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x2]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x3]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x4]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x5]);_0x1344ec['push'](_0x53600a[0x6]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x7]);_0x1344ec['push'](_0x53600a[0x8]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0x9]);_0x1344ec[_0x50bb('0x23')](_0x53600a[0xa]);_0x1344ec[_0x50bb('0x23')](_0x21befa['interaction']['id']);_0x1344ec['push'](_0x21befa[_0x50bb('0x16')]['id']);_0x1344ec[_0x50bb('0x23')](_0x56b25a[_0x50bb('0x2c')]);_0x1344ec[_0x50bb('0x23')](_0x21befa['interaction'][_0x50bb('0x2d')]);_0x1344ec['push'](_0x21befa['body'][_0x50bb('0x2e')]);_0x1344ec['push'](_0x20a097);break;default:_0x1344ec=_[_0x50bb('0xf')](_0x56b25a[_0x50bb('0x20')])?[]:_0x56b25a[_0x50bb('0x20')][_0x50bb('0x21')](',');}var _0x3a9fe4={'id':util[_0x50bb('0xd')](_0x50bb('0x2f'),_0x4f2897,_0x56b25a['id'],_0x56b25a[_0x50bb('0x1d')]),'condition':require(_0x50bb('0x30'))[_0x50bb('0x31')](_0x4f2897,getIntervals(_0x309986['intervals'],_0x56b25a),_0x309986),'consequence':require('./applications/'+_0x56b25a[_0x50bb('0x1d')])[_0x50bb('0x32')](_0x4f2897,_0x1344ec,_0x309986,_0x21befa),'p':_0x56b25a[_0x50bb('0x33')]||0x0};logger[_0x50bb('0x34')]('Push\x20new\x20rule',_0x3a9fe4['id'],_0x50bb('0x35'),getIntervals(_0x309986['intervals'],_0x56b25a)[_0x50bb('0x1c')](_0x50bb('0x36')));_0x908950[_0x50bb('0x23')](_0x3a9fe4);}else{logger[_0x50bb('0x37')](_0x50bb('0x38'),path[_0x50bb('0x1c')](__dirname,_0x50bb('0x18'),_0x56b25a[_0x50bb('0x1d')]+_0x50bb('0x1e')));}}_0x309986[_0x50bb('0x14')][_0x4f2897]=new RuleEngine(_0x908950);_0x309986[_0x50bb('0x14')][_0x4f2897][_0x50bb('0x39')](_0x21befa,function(_0x85b0ff){logger[_0x50bb('0x34')](_0x50bb('0x3a'),JSON[_0x50bb('0x3b')](_0x85b0ff['matchPath']));if(_0x309986[_0x50bb('0x14')][_0x4f2897]){_0x309986['rules'][_0x4f2897][_0x50bb('0x3c')](_0x50bb('0x3d'));}});return _0x253073({'code':0xc8,'message':_0x21befa});}else{logger[_0x50bb('0x34')](_0x50bb('0x3e'));return _0x253073({'code':0xc8,'message':_0x21befa});}}catch(_0x1ad25f){logger[_0x50bb('0x37')](_0x1ad25f[_0x50bb('0x3f')]);return _0x42ffab(_0x3e1a51[_0x50bb('0x37')](0x1f4,_0x1ad25f));}}return _0x42ffab(_0x50bb('0x40'));});},'AcceptMessage':function(_0x3fe267){var _0x1cdfc0=this;return new Promise(function(_0x24368d,_0x2b7484){if(_0x3fe267[_0x50bb('0x41')]&&_0x3fe267['agent']['id']){if(_0x309986[_0x50bb('0x42')][_0x3fe267['agent']['id']]){_0x309986[_0x50bb('0x42')][_0x3fe267[_0x50bb('0x41')]['id']][_0x50bb('0x43')]=![];_0x309986[_0x50bb('0x42')][_0x3fe267[_0x50bb('0x41')]['id']][_0x50bb('0x44')]=undefined;}}if(_0x3fe267[_0x50bb('0x16')]&&_0x3fe267[_0x50bb('0x16')]['id']){try{var _0x480245=getId(_0x3fe267[_0x50bb('0x15')],_0x3fe267[_0x50bb('0x16')]?_0x3fe267[_0x50bb('0x16')]['id']:0x0,_0x3fe267[_0x50bb('0x17')]?_0x3fe267[_0x50bb('0x17')]['id']:0x0);if(_0x309986['rules'][_0x480245]){_0x309986[_0x50bb('0x14')][_0x480245][_0x50bb('0x3c')](_0x50bb('0x45'));if(rpc[_0x3fe267[_0x50bb('0x15')]+_0x50bb('0x46')]){rpc[_0x3fe267['channel']+'QueueReport'][_0x50bb('0x47')](_0x480245,{'UserId':_0x3fe267['message'][_0x50bb('0x48')]})['catch'](function(_0x4316e4){logger[_0x50bb('0x37')](_0x50bb('0x49'));});}}return _0x24368d({'code':0xc8,'message':_0x3fe267});}catch(_0x4e67c1){logger[_0x50bb('0x37')](_0x4e67c1[_0x50bb('0x3f')]);return _0x2b7484(_0x1cdfc0['error'](0x1f4,_0x4e67c1));}}logger[_0x50bb('0x37')](_0x50bb('0x4a'));return _0x2b7484(_0x1cdfc0[_0x50bb('0x37')](0x1f4,_0x50bb('0x4a')));});},'RejectMessage':function(_0x55a4a6){var _0x33e71f=this;return new Promise(function(_0x46b51e,_0x2e0032){if(_0x55a4a6[_0x50bb('0x41')]&&_0x55a4a6[_0x50bb('0x41')]['id']){try{if(_0x309986['agents'][_0x55a4a6[_0x50bb('0x41')]['id']]){_0x309986['agents'][_0x55a4a6[_0x50bb('0x41')]['id']]['busy']=![];_0x309986['agents'][_0x55a4a6[_0x50bb('0x41')]['id']]['busyQueue']=undefined;}return _0x46b51e({'code':0xc8,'message':_0x55a4a6});}catch(_0x59c89b){logger[_0x50bb('0x37')](_0x59c89b[_0x50bb('0x3f')]);return _0x2e0032(_0x33e71f[_0x50bb('0x37')](0x1f4,_0x59c89b));}}logger[_0x50bb('0x37')](_0x50bb('0x4a'));return _0x2e0032(_0x33e71f[_0x50bb('0x37')](0x1f4,_0x50bb('0x4a')));});},'AbandonInteraction':function(_0x1408fa){var _0x57d749=this;return new Promise(function(_0x5abfc8,_0x372a06){if(_0x1408fa[_0x50bb('0x15')]&&_0x1408fa[_0x50bb('0x17')]&&_0x1408fa[_0x50bb('0x17')]['id']){try{var _0x45d4bf=getId(_0x1408fa[_0x50bb('0x15')],_0x1408fa[_0x50bb('0x16')]?_0x1408fa['message']['id']:0x0,_0x1408fa[_0x50bb('0x17')]?_0x1408fa[_0x50bb('0x17')]['id']:0x0);if(_0x309986[_0x50bb('0x14')][_0x45d4bf]){_0x309986[_0x50bb('0x14')][_0x45d4bf][_0x50bb('0x3c')]('end');}return _0x5abfc8({'code':0xc8,'message':_0x1408fa});}catch(_0x33ebe6){logger[_0x50bb('0x37')](_0x33ebe6[_0x50bb('0x3f')]);return _0x372a06(_0x57d749[_0x50bb('0x37')](0x1f4,_0x33ebe6));}}logger[_0x50bb('0x37')]('message\x20is\x20empty');return _0x372a06(_0x57d749[_0x50bb('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x596550){var _0x170761=this;return new Promise(function(_0x3057f2,_0x25eeca){if(_0x309986[_0x50bb('0x42')][_0x50bb('0x4b')](_0x596550['id'])){for(var _0x20e35a in _0x596550[_0x50bb('0x4c')]){if(_0x596550[_0x50bb('0x4c')][_0x50bb('0x4b')](_0x20e35a)){if(_0x309986[_0x50bb('0x42')][_0x596550['id']][_0x50bb('0x4b')](_0x20e35a+'CurrentCapacity')){_0x309986[_0x50bb('0x42')][_0x596550['id']][_0x20e35a+'CurrentCapacity']=parseInt(_0x596550[_0x50bb('0x4c')][_0x20e35a],0xa);}}}_0x309986[_0x50bb('0x42')][_0x596550['id']]['updateRealtime']();return _0x3057f2({'code':0xc8,'message':_0x309986[_0x50bb('0x42')][_0x596550['id']]});}else{return _0x25eeca(_0x170761[_0x50bb('0x37')](0x1f4,_0x50bb('0x4d')));}});},'Agents':function(_0x3f8c1f){return new Promise(function(_0x46ea8f,_0x26d188){var _0x2b7df6=_[_0x50bb('0x4e')](_0x309986['agents']);_0x46ea8f({'count':_0x2b7df6[_0x50bb('0x1a')],'rows':_0x2b7df6});});},'ChatQueues':function(_0x2dc832){return new Promise(function(_0x3b17c8,_0x4a226d){var _0x1d1d00=[];for(var _0x2779b3 in _0x309986[_0x50bb('0x4f')]){if(_0x309986[_0x50bb('0x4f')][_0x50bb('0x4b')](_0x2779b3)){var _0x3ca1af=_0x309986['chatQueues'][_0x2779b3];var _0xf47641={'id':_0x3ca1af['id'],'available':_0x3ca1af[_0x50bb('0x50')],'loggedIn':_0x3ca1af[_0x50bb('0x51')],'name':_0x3ca1af[_0x50bb('0x52')],'paused':_0x3ca1af[_0x50bb('0x53')],'waiting':_0x3ca1af[_0x50bb('0x54')]};_0x1d1d00['push'](_0xf47641);}}_0x3b17c8({'count':_0x1d1d00[_0x50bb('0x1a')],'rows':_0x1d1d00});});},'MailQueues':function(_0xa85833){return new Promise(function(_0x127e0a,_0x1700c4){var _0x144362=[];for(var _0x44a860 in _0x309986[_0x50bb('0x55')]){if(_0x309986[_0x50bb('0x55')][_0x50bb('0x4b')](_0x44a860)){var _0x583915=_0x309986[_0x50bb('0x55')][_0x44a860];var _0x2f5a19={'id':_0x583915['id'],'available':_0x583915[_0x50bb('0x50')],'loggedIn':_0x583915[_0x50bb('0x51')],'name':_0x583915[_0x50bb('0x52')],'paused':_0x583915[_0x50bb('0x53')],'waiting':_0x583915[_0x50bb('0x54')]};_0x144362[_0x50bb('0x23')](_0x2f5a19);}}_0x127e0a({'count':_0x144362[_0x50bb('0x1a')],'rows':_0x144362});});},'OpenchannelQueues':function(_0x578ff3){return new Promise(function(_0x58ad41,_0x5babbc){var _0x4159ad=[];for(var _0x5ba597 in _0x309986['openchannelQueues']){if(_0x309986[_0x50bb('0x56')][_0x50bb('0x4b')](_0x5ba597)){var _0x18fa23=_0x309986[_0x50bb('0x56')][_0x5ba597];var _0x5e7ccc={'id':_0x18fa23['id'],'available':_0x18fa23[_0x50bb('0x50')],'loggedIn':_0x18fa23[_0x50bb('0x51')],'name':_0x18fa23['name'],'paused':_0x18fa23[_0x50bb('0x53')],'waiting':_0x18fa23['waiting']};_0x4159ad[_0x50bb('0x23')](_0x5e7ccc);}}_0x58ad41({'count':_0x4159ad[_0x50bb('0x1a')],'rows':_0x4159ad});});},'SmsQueues':function(_0x48e350){return new Promise(function(_0x23bff2,_0x52c882){var _0x8f5df6=[];for(var _0x29c740 in _0x309986['smsQueues']){if(_0x309986[_0x50bb('0x57')][_0x50bb('0x4b')](_0x29c740)){var _0x19f2eb=_0x309986['smsQueues'][_0x29c740];var _0x1b4898={'id':_0x19f2eb['id'],'available':_0x19f2eb[_0x50bb('0x50')],'loggedIn':_0x19f2eb[_0x50bb('0x51')],'name':_0x19f2eb[_0x50bb('0x52')],'paused':_0x19f2eb['paused'],'waiting':_0x19f2eb[_0x50bb('0x54')]};_0x8f5df6[_0x50bb('0x23')](_0x1b4898);}}_0x23bff2({'count':_0x8f5df6['length'],'rows':_0x8f5df6});});},'FaxQueues':function(_0x54f4d0){return new Promise(function(_0x1aecc4,_0x222e13){var _0x58ad0b=[];for(var _0x4184b8 in _0x309986[_0x50bb('0x58')]){if(_0x309986[_0x50bb('0x58')][_0x50bb('0x4b')](_0x4184b8)){var _0x197798=_0x309986['faxQueues'][_0x4184b8];var _0x480163={'id':_0x197798['id'],'available':_0x197798[_0x50bb('0x50')],'loggedIn':_0x197798[_0x50bb('0x51')],'name':_0x197798[_0x50bb('0x52')],'paused':_0x197798[_0x50bb('0x53')],'waiting':_0x197798['waiting']};_0x58ad0b[_0x50bb('0x23')](_0x480163);}}_0x1aecc4({'count':_0x58ad0b['length'],'rows':_0x58ad0b});});},'WhatsappQueues':function(_0x256125){return new Promise(function(_0x3494f4,_0x98d984){var _0xbcfdba=[];for(var _0x245024 in _0x309986[_0x50bb('0x59')]){if(_0x309986[_0x50bb('0x59')]['hasOwnProperty'](_0x245024)){var _0x4d3d71=_0x309986[_0x50bb('0x59')][_0x245024];var _0x2ad8bb={'id':_0x4d3d71['id'],'available':_0x4d3d71[_0x50bb('0x50')],'loggedIn':_0x4d3d71[_0x50bb('0x51')],'name':_0x4d3d71[_0x50bb('0x52')],'paused':_0x4d3d71[_0x50bb('0x53')],'waiting':_0x4d3d71['waiting']};_0xbcfdba[_0x50bb('0x23')](_0x2ad8bb);}}_0x3494f4({'count':_0xbcfdba[_0x50bb('0x1a')],'rows':_0xbcfdba});});},'ChatQueuesWaitingInteractions':function(_0x2752bf){return new Promise(function(_0x3bd57a,_0x469435){var _0x56aa4a=_['values'](_0x309986[_0x50bb('0x5a')]);_0x3bd57a({'count':_0x56aa4a['length'],'rows':_0x56aa4a});});},'MailQueuesWaitingInteractions':function(_0x3c9180){return new Promise(function(_0x2a98b2,_0x58f938){var _0x498b88=_[_0x50bb('0x4e')](_0x309986[_0x50bb('0x5b')]);_0x2a98b2({'count':_0x498b88[_0x50bb('0x1a')],'rows':_0x498b88});});},'OpenchannelQueuesWaitingInteractions':function(_0x486f34){return new Promise(function(_0x75dc05,_0x77c26d){var _0x1b88f5=_[_0x50bb('0x4e')](_0x309986[_0x50bb('0x5c')]);_0x75dc05({'count':_0x1b88f5[_0x50bb('0x1a')],'rows':_0x1b88f5});});},'SmsQueuesWaitingInteractions':function(_0xaf41dd){return new Promise(function(_0x4b455a,_0x49db66){var _0x28c99d=_[_0x50bb('0x4e')](_0x309986[_0x50bb('0x5d')]);_0x4b455a({'count':_0x28c99d[_0x50bb('0x1a')],'rows':_0x28c99d});});},'FaxQueuesWaitingInteractions':function(_0x2b9d24){return new Promise(function(_0x2ed84a,_0x14cfdc){var _0x21ffe8=_[_0x50bb('0x4e')](_0x309986[_0x50bb('0x5e')]);_0x2ed84a({'count':_0x21ffe8['length'],'rows':_0x21ffe8});});},'WhatsappQueuesWaitingInteractions':function(_0x266126){return new Promise(function(_0x847c4f,_0x330bb4){var _0x16f965=_[_0x50bb('0x4e')](_0x309986[_0x50bb('0x5f')]);_0x847c4f({'count':_0x16f965[_0x50bb('0x1a')],'rows':_0x16f965});});}};var _0x265356=jayson[_0x50bb('0x60')](_0x5e8478)[_0x50bb('0x61')]();_0x265356['on'](_0x50bb('0x37'),function(_0x20d662){logger[_0x50bb('0x37')](JSON[_0x50bb('0x3b')](_0x20d662));return _0xbbc6a0(_0x20d662);});_0x265356[_0x50bb('0x13')](0x232c,'127.0.0.1',function(){console[_0x50bb('0x62')](_0x50bb('0x63'),0x232c);return _0x5244b0(_0x50bb('0x64')+0x232c);});});}; \ No newline at end of file +var _0x78f0=['error','execute','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x78f0,0x15d));var _0x078f=function(_0x41ccbf,_0x289873){_0x41ccbf=_0x41ccbf-0x0;var _0x516ac8=_0x78f0[_0x41ccbf];return _0x516ac8;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var path=require(_0x078f('0x2'));var fs=require('fs');var jayson=require(_0x078f('0x3'));var BPromise=require(_0x078f('0x4'));var uuid=require(_0x078f('0x5'));var utils=require(_0x078f('0x6'));var config=require(_0x078f('0x7'));var logger=require('../../../config/logger')(_0x078f('0x8'));var rpc={'openchannelQueueReport':require(_0x078f('0x9')),'mailQueueReport':require(_0x078f('0xa')),'chatQueueReport':require(_0x078f('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x078f('0xc')),'whatsappQueueReport':require(_0x078f('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2ef013,_0x1901e3,_0x39d622){return util[_0x078f('0xe')](_0x078f('0xf'),_0x2ef013,_0x1901e3||0x0,_0x39d622||0x0);}function getIntervals(_0x1e71bd,_0x4207d0){var _0x1897d3=[];if(!_['isNil'](_0x4207d0[_0x078f('0x10')])&&!_[_0x078f('0x11')](_0x1e71bd[_0x4207d0['IntervalId']])&&!_[_0x078f('0x11')](_0x1e71bd[_0x4207d0[_0x078f('0x10')]][_0x078f('0x12')])){_0x1897d3=_[_0x078f('0x13')](_0x1e71bd[_0x4207d0['IntervalId']]['Intervals'],_0x078f('0x14'));}else if(!_[_0x078f('0x11')](_0x4207d0[_0x078f('0x14')])){_0x1897d3=[_0x4207d0[_0x078f('0x14')]];}return _0x1897d3;}exports['listen']=function(_0x36670d){_0x36670d[_0x078f('0x15')]={};return new BPromise(function(_0x5465b8,_0x1d8dba){var _0x1a44f1={'Start':function(_0x21fc72){var _0x363dfd=this;return new Promise(function(_0x247de9,_0x63a278){if(_0x21fc72){try{var _0x4c69e0=[];var _0x56bad2=getId(_0x21fc72[_0x078f('0x16')],_0x21fc72[_0x078f('0x17')]?_0x21fc72[_0x078f('0x17')]['id']:0x0,_0x21fc72[_0x078f('0x18')]?_0x21fc72[_0x078f('0x18')]['id']:0x0);if(_0x21fc72[_0x078f('0x19')]&&_[_0x078f('0x1a')](_0x21fc72[_0x078f('0x19')])&&_0x21fc72[_0x078f('0x19')][_0x078f('0x1b')]){for(var _0x264252=0x0;_0x264252<_0x21fc72[_0x078f('0x19')]['length'];_0x264252+=0x1){var _0x43f05f=_0x21fc72['applications'][_0x264252];if(fs['existsSync'](path[_0x078f('0x1c')](__dirname,_0x078f('0x19'),_0x43f05f[_0x078f('0x1d')]+_0x078f('0x1e')))){var _0x712d52=[];switch(_0x43f05f[_0x078f('0x1d')][_0x078f('0x1f')]()){case _0x078f('0x20'):var _0x32f4f3=_0x43f05f['appdata'][_0x078f('0x21')](',');if(_0x21fc72[_0x078f('0x16')]===_0x078f('0x22')){_0x712d52['push'](_0x32f4f3[0x0]);_0x712d52['push'](_0x32f4f3[0x1]);_0x712d52[_0x078f('0x23')](_0x32f4f3[_0x078f('0x24')](0x2,_0x32f4f3[_0x078f('0x1b')])[_0x078f('0x1c')](','));}else{_0x712d52[_0x078f('0x23')](_0x32f4f3[0x0]);_0x712d52[_0x078f('0x23')](_0x32f4f3[_0x078f('0x24')](0x1,_0x32f4f3['length'])[_0x078f('0x1c')](','));}break;case _0x078f('0x25'):var _0x4b6244=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x4b6244[0x0]);_0x712d52[_0x078f('0x23')](_0x4b6244[0x1]);_0x712d52[_0x078f('0x23')](_0x4b6244[_0x078f('0x24')](0x2,_0x4b6244[_0x078f('0x1b')])[_0x078f('0x1c')](','));break;case _0x078f('0x27'):var _0x29d306=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x29d306[0x0]);_0x712d52[_0x078f('0x23')](_0x29d306[0x1]);_0x712d52[_0x078f('0x23')](_0x29d306[0x2]);_0x712d52[_0x078f('0x23')](_0x29d306[0x3]);_0x712d52[_0x078f('0x23')](_0x29d306[_0x078f('0x24')](0x4,_0x29d306['length'])[_0x078f('0x1c')](','));break;case'amazonlex':var _0x519c22=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x519c22[0x0]);_0x712d52[_0x078f('0x23')](_0x519c22[0x1]);_0x712d52['push'](_0x519c22[0x2]);_0x712d52[_0x078f('0x23')](_0x519c22[0x3]);_0x712d52[_0x078f('0x23')](_0x519c22[_0x078f('0x24')](0x4,_0x519c22[_0x078f('0x1b')])[_0x078f('0x1c')](','));break;case'message':_0x712d52[_0x078f('0x23')](_0x43f05f[_0x078f('0x26')]);break;case'tag':_0x712d52['push'](_0x43f05f[_0x078f('0x28')]);_0x712d52[_0x078f('0x23')](_0x43f05f['appdata']);break;case _0x078f('0x29'):var _0x13b165=utils[_0x078f('0x2a')](_0x21fc72['account'][_0x078f('0x2b')],_0x21fc72);var _0x411311=_0x43f05f[_0x078f('0x26')][_0x078f('0x21')](',');_0x712d52[_0x078f('0x23')](_0x411311[0x0]);_0x712d52[_0x078f('0x23')](_0x411311[0x1]);_0x712d52['push'](_0x411311[0x2]);_0x712d52[_0x078f('0x23')](_0x411311[0x3]);_0x712d52[_0x078f('0x23')](_0x411311[0x4]);_0x712d52[_0x078f('0x23')](_0x411311[0x5]);_0x712d52[_0x078f('0x23')](_0x411311[0x6]);_0x712d52['push'](_0x411311[0x7]);_0x712d52[_0x078f('0x23')](_0x411311[0x8]);_0x712d52[_0x078f('0x23')](_0x411311[0x9]);_0x712d52[_0x078f('0x23')](_0x411311[0xa]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x18')]['id']);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x17')]['id']);_0x712d52[_0x078f('0x23')](_0x43f05f[_0x078f('0x2c')]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x18')][_0x078f('0x2d')]);_0x712d52[_0x078f('0x23')](_0x21fc72[_0x078f('0x2e')][_0x078f('0x2e')]);_0x712d52[_0x078f('0x23')](_0x13b165);break;default:_0x712d52=_['isNil'](_0x43f05f['appdata'])?[]:_0x43f05f['appdata'][_0x078f('0x21')](',');}var _0x4d7cbb={'id':util[_0x078f('0xe')](_0x078f('0x2f'),_0x56bad2,_0x43f05f['id'],_0x43f05f[_0x078f('0x1d')]),'condition':require(_0x078f('0x30'))['condition'](_0x56bad2,getIntervals(_0x36670d[_0x078f('0x31')],_0x43f05f),_0x36670d),'consequence':require('./applications/'+_0x43f05f['app'])['consequence'](_0x56bad2,_0x712d52,_0x36670d,_0x21fc72),'p':_0x43f05f[_0x078f('0x32')]||0x0};logger[_0x078f('0x33')](_0x078f('0x34'),_0x4d7cbb['id'],_0x078f('0x35'),getIntervals(_0x36670d[_0x078f('0x31')],_0x43f05f)[_0x078f('0x1c')](_0x078f('0x36')));_0x4c69e0[_0x078f('0x23')](_0x4d7cbb);}else{logger[_0x078f('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x078f('0x1c')](__dirname,'applications',_0x43f05f['app']+_0x078f('0x1e')));}}_0x36670d['rules'][_0x56bad2]=new RuleEngine(_0x4c69e0);_0x36670d[_0x078f('0x15')][_0x56bad2][_0x078f('0x38')](_0x21fc72,function(_0x3a9798){logger[_0x078f('0x33')](_0x078f('0x39'),JSON[_0x078f('0x3a')](_0x3a9798[_0x078f('0x3b')]));if(_0x36670d[_0x078f('0x15')][_0x56bad2]){_0x36670d['rules'][_0x56bad2][_0x078f('0x3c')]('complete');}});return _0x247de9({'code':0xc8,'message':_0x21fc72});}else{logger[_0x078f('0x33')]('No\x20applications\x20to\x20execute');return _0x247de9({'code':0xc8,'message':_0x21fc72});}}catch(_0x16a09b){logger[_0x078f('0x37')](_0x16a09b[_0x078f('0x3d')]);return _0x63a278(_0x363dfd[_0x078f('0x37')](0x1f4,_0x16a09b));}}return _0x63a278(_0x078f('0x3e'));});},'AcceptMessage':function(_0x39481d){var _0x2124c3=this;return new Promise(function(_0x3cfe9f,_0x160cbd){if(_0x39481d['agent']&&_0x39481d[_0x078f('0x3f')]['id']){if(_0x36670d[_0x078f('0x40')][_0x39481d['agent']['id']]){_0x36670d[_0x078f('0x40')][_0x39481d[_0x078f('0x3f')]['id']][_0x078f('0x41')]=![];_0x36670d[_0x078f('0x40')][_0x39481d['agent']['id']][_0x078f('0x42')]=undefined;}}if(_0x39481d[_0x078f('0x17')]&&_0x39481d[_0x078f('0x17')]['id']){try{var _0x5dba79=getId(_0x39481d[_0x078f('0x16')],_0x39481d[_0x078f('0x17')]?_0x39481d[_0x078f('0x17')]['id']:0x0,_0x39481d[_0x078f('0x18')]?_0x39481d[_0x078f('0x18')]['id']:0x0);if(_0x36670d['rules'][_0x5dba79]){_0x36670d[_0x078f('0x15')][_0x5dba79][_0x078f('0x3c')]('end');if(rpc[_0x39481d[_0x078f('0x16')]+_0x078f('0x43')]){rpc[_0x39481d['channel']+_0x078f('0x43')][_0x078f('0x44')](_0x5dba79,{'UserId':_0x39481d[_0x078f('0x17')][_0x078f('0x45')]})[_0x078f('0x46')](function(_0x1ad4a8){logger[_0x078f('0x37')](_0x078f('0x47'));});}}return _0x3cfe9f({'code':0xc8,'message':_0x39481d});}catch(_0x4206ac){logger['error'](_0x4206ac[_0x078f('0x3d')]);return _0x160cbd(_0x2124c3[_0x078f('0x37')](0x1f4,_0x4206ac));}}logger[_0x078f('0x37')]('message\x20is\x20empty');return _0x160cbd(_0x2124c3[_0x078f('0x37')](0x1f4,_0x078f('0x48')));});},'RejectMessage':function(_0x20d961){var _0x3ce881=this;return new Promise(function(_0x4bb6a2,_0x3badef){if(_0x20d961[_0x078f('0x3f')]&&_0x20d961['agent']['id']){try{if(_0x36670d[_0x078f('0x40')][_0x20d961['agent']['id']]){_0x36670d[_0x078f('0x40')][_0x20d961[_0x078f('0x3f')]['id']][_0x078f('0x41')]=![];_0x36670d['agents'][_0x20d961['agent']['id']]['busyQueue']=undefined;}return _0x4bb6a2({'code':0xc8,'message':_0x20d961});}catch(_0x3855ae){logger['error'](_0x3855ae[_0x078f('0x3d')]);return _0x3badef(_0x3ce881['error'](0x1f4,_0x3855ae));}}logger[_0x078f('0x37')](_0x078f('0x48'));return _0x3badef(_0x3ce881[_0x078f('0x37')](0x1f4,_0x078f('0x48')));});},'AbandonInteraction':function(_0x4d42ca){var _0x3dfa39=this;return new Promise(function(_0x51fa52,_0x16c42a){if(_0x4d42ca[_0x078f('0x16')]&&_0x4d42ca['interaction']&&_0x4d42ca[_0x078f('0x18')]['id']){try{var _0x3f7ac8=getId(_0x4d42ca[_0x078f('0x16')],_0x4d42ca[_0x078f('0x17')]?_0x4d42ca[_0x078f('0x17')]['id']:0x0,_0x4d42ca[_0x078f('0x18')]?_0x4d42ca[_0x078f('0x18')]['id']:0x0);if(_0x36670d[_0x078f('0x15')][_0x3f7ac8]){_0x36670d[_0x078f('0x15')][_0x3f7ac8][_0x078f('0x3c')](_0x078f('0x49'));}return _0x51fa52({'code':0xc8,'message':_0x4d42ca});}catch(_0x233b04){logger['error'](_0x233b04[_0x078f('0x3d')]);return _0x16c42a(_0x3dfa39[_0x078f('0x37')](0x1f4,_0x233b04));}}logger['error']('message\x20is\x20empty');return _0x16c42a(_0x3dfa39[_0x078f('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4bfc24){var _0x2d6ec1=this;return new Promise(function(_0x6ca456,_0x12c805){if(_0x36670d['agents'][_0x078f('0x4a')](_0x4bfc24['id'])){for(var _0x587682 in _0x4bfc24[_0x078f('0x4b')]){if(_0x4bfc24[_0x078f('0x4b')][_0x078f('0x4a')](_0x587682)){if(_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]['hasOwnProperty'](_0x587682+_0x078f('0x4c'))){_0x36670d['agents'][_0x4bfc24['id']][_0x587682+_0x078f('0x4c')]=parseInt(_0x4bfc24['capacity'][_0x587682],0xa);}}}_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]['updateRealtime']();return _0x6ca456({'code':0xc8,'message':_0x36670d[_0x078f('0x40')][_0x4bfc24['id']]});}else{return _0x12c805(_0x2d6ec1[_0x078f('0x37')](0x1f4,_0x078f('0x4d')));}});},'Agents':function(_0x496fef){return new Promise(function(_0x65e2e5,_0x586334){var _0x4fc183=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x40')]);_0x65e2e5({'count':_0x4fc183[_0x078f('0x1b')],'rows':_0x4fc183});});},'ChatQueues':function(_0x1dc8f6){return new Promise(function(_0x291d20,_0x34e2db){var _0x5e01b2=[];for(var _0x518266 in _0x36670d[_0x078f('0x4f')]){if(_0x36670d[_0x078f('0x4f')][_0x078f('0x4a')](_0x518266)){var _0x346997=_0x36670d[_0x078f('0x4f')][_0x518266];var _0x57ffdb={'id':_0x346997['id'],'available':_0x346997[_0x078f('0x50')],'loggedIn':_0x346997[_0x078f('0x51')],'name':_0x346997[_0x078f('0x52')],'paused':_0x346997[_0x078f('0x53')],'waiting':_0x346997[_0x078f('0x54')]};_0x5e01b2[_0x078f('0x23')](_0x57ffdb);}}_0x291d20({'count':_0x5e01b2['length'],'rows':_0x5e01b2});});},'MailQueues':function(_0x215d60){return new Promise(function(_0x1c259a,_0xd4e52a){var _0x6c8a18=[];for(var _0x505881 in _0x36670d[_0x078f('0x55')]){if(_0x36670d[_0x078f('0x55')][_0x078f('0x4a')](_0x505881)){var _0x29ce23=_0x36670d[_0x078f('0x55')][_0x505881];var _0x5378d8={'id':_0x29ce23['id'],'available':_0x29ce23['available'],'loggedIn':_0x29ce23[_0x078f('0x51')],'name':_0x29ce23[_0x078f('0x52')],'paused':_0x29ce23[_0x078f('0x53')],'waiting':_0x29ce23[_0x078f('0x54')]};_0x6c8a18[_0x078f('0x23')](_0x5378d8);}}_0x1c259a({'count':_0x6c8a18[_0x078f('0x1b')],'rows':_0x6c8a18});});},'OpenchannelQueues':function(_0x3f5d88){return new Promise(function(_0x3601db,_0x26cba1){var _0x15be67=[];for(var _0x45e1f7 in _0x36670d['openchannelQueues']){if(_0x36670d['openchannelQueues']['hasOwnProperty'](_0x45e1f7)){var _0x3974d4=_0x36670d[_0x078f('0x56')][_0x45e1f7];var _0x3ed7f0={'id':_0x3974d4['id'],'available':_0x3974d4[_0x078f('0x50')],'loggedIn':_0x3974d4[_0x078f('0x51')],'name':_0x3974d4[_0x078f('0x52')],'paused':_0x3974d4[_0x078f('0x53')],'waiting':_0x3974d4[_0x078f('0x54')]};_0x15be67[_0x078f('0x23')](_0x3ed7f0);}}_0x3601db({'count':_0x15be67['length'],'rows':_0x15be67});});},'SmsQueues':function(_0x2ad40b){return new Promise(function(_0x569b88,_0x5b85a3){var _0x508721=[];for(var _0x4e80f5 in _0x36670d[_0x078f('0x57')]){if(_0x36670d[_0x078f('0x57')][_0x078f('0x4a')](_0x4e80f5)){var _0x451c52=_0x36670d[_0x078f('0x57')][_0x4e80f5];var _0x135874={'id':_0x451c52['id'],'available':_0x451c52[_0x078f('0x50')],'loggedIn':_0x451c52[_0x078f('0x51')],'name':_0x451c52[_0x078f('0x52')],'paused':_0x451c52['paused'],'waiting':_0x451c52['waiting']};_0x508721[_0x078f('0x23')](_0x135874);}}_0x569b88({'count':_0x508721[_0x078f('0x1b')],'rows':_0x508721});});},'FaxQueues':function(_0x29a0d1){return new Promise(function(_0x3d7f65,_0x466a55){var _0x4a08d7=[];for(var _0x38f65b in _0x36670d[_0x078f('0x58')]){if(_0x36670d['faxQueues'][_0x078f('0x4a')](_0x38f65b)){var _0x3c3828=_0x36670d[_0x078f('0x58')][_0x38f65b];var _0x3351b1={'id':_0x3c3828['id'],'available':_0x3c3828[_0x078f('0x50')],'loggedIn':_0x3c3828[_0x078f('0x51')],'name':_0x3c3828[_0x078f('0x52')],'paused':_0x3c3828[_0x078f('0x53')],'waiting':_0x3c3828[_0x078f('0x54')]};_0x4a08d7[_0x078f('0x23')](_0x3351b1);}}_0x3d7f65({'count':_0x4a08d7[_0x078f('0x1b')],'rows':_0x4a08d7});});},'WhatsappQueues':function(_0xe03b7f){return new Promise(function(_0x50da7c,_0x3a6de6){var _0x2e7451=[];for(var _0x28e18e in _0x36670d[_0x078f('0x59')]){if(_0x36670d[_0x078f('0x59')][_0x078f('0x4a')](_0x28e18e)){var _0xccfd4=_0x36670d['whatsappQueues'][_0x28e18e];var _0x2daa4e={'id':_0xccfd4['id'],'available':_0xccfd4[_0x078f('0x50')],'loggedIn':_0xccfd4[_0x078f('0x51')],'name':_0xccfd4[_0x078f('0x52')],'paused':_0xccfd4[_0x078f('0x53')],'waiting':_0xccfd4[_0x078f('0x54')]};_0x2e7451[_0x078f('0x23')](_0x2daa4e);}}_0x50da7c({'count':_0x2e7451[_0x078f('0x1b')],'rows':_0x2e7451});});},'ChatQueuesWaitingInteractions':function(_0x3563a3){return new Promise(function(_0x3fa237,_0x4872e3){var _0x10959c=_[_0x078f('0x4e')](_0x36670d['chatQueuesWaitingInteractions']);_0x3fa237({'count':_0x10959c['length'],'rows':_0x10959c});});},'MailQueuesWaitingInteractions':function(_0x3b3519){return new Promise(function(_0x2aa28f,_0x2e0abe){var _0x32a228=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5a')]);_0x2aa28f({'count':_0x32a228['length'],'rows':_0x32a228});});},'OpenchannelQueuesWaitingInteractions':function(_0x555dd6){return new Promise(function(_0x118ca3,_0x4b235a){var _0x2e49a6=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5b')]);_0x118ca3({'count':_0x2e49a6['length'],'rows':_0x2e49a6});});},'SmsQueuesWaitingInteractions':function(_0x1e4ec0){return new Promise(function(_0x563a88,_0x1fb814){var _0x11fa8d=_[_0x078f('0x4e')](_0x36670d[_0x078f('0x5c')]);_0x563a88({'count':_0x11fa8d[_0x078f('0x1b')],'rows':_0x11fa8d});});},'FaxQueuesWaitingInteractions':function(_0x28fdce){return new Promise(function(_0x17bf75,_0x118006){var _0xa7d82a=_['values'](_0x36670d[_0x078f('0x5d')]);_0x17bf75({'count':_0xa7d82a[_0x078f('0x1b')],'rows':_0xa7d82a});});},'WhatsappQueuesWaitingInteractions':function(_0x23f978){return new Promise(function(_0x34f38a,_0x2ee7fd){var _0x4d7b6b=_[_0x078f('0x4e')](_0x36670d['whatsappQueuesWaitingInteractions']);_0x34f38a({'count':_0x4d7b6b[_0x078f('0x1b')],'rows':_0x4d7b6b});});}};var _0x710913=jayson[_0x078f('0x5e')](_0x1a44f1)[_0x078f('0x5f')]();_0x710913['on']('error',function(_0x261f00){logger[_0x078f('0x37')](JSON[_0x078f('0x3a')](_0x261f00));return _0x1d8dba(_0x261f00);});_0x710913[_0x078f('0x60')](0x232c,_0x078f('0x61'),function(){console[_0x078f('0x62')](_0x078f('0x63'),0x232c);return _0x5465b8(_0x078f('0x64')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 826a41d..10c0a08 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 _0xbb96=['stop','util','bluebird','jayson/promise','routing','request','then','error','message','result','catch','condition','rules','info','push','Command','format','indexOf','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack'];(function(_0x5e0785,_0x18c8eb){var _0x51da4e=function(_0x5e201d){while(--_0x5e201d){_0x5e0785['push'](_0x5e0785['shift']());}};_0x51da4e(++_0x18c8eb);}(_0xbb96,0x181));var _0x6bb9=function(_0x11cbb5,_0x390441){_0x11cbb5=_0x11cbb5-0x0;var _0x54b8d3=_0xbb96[_0x11cbb5];return _0x54b8d3;};'use strict';var util=require(_0x6bb9('0x0'));var BPromise=require(_0x6bb9('0x1'));var jayson=require(_0x6bb9('0x2'));var _=require('lodash');var logger=require('../../../config/logger')(_0x6bb9('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x5d07af,_0x59b759){return new BPromise(function(_0x50555a,_0x4e2e8f){return client[_0x6bb9('0x4')](_0x5d07af,_0x59b759)[_0x6bb9('0x5')](function(_0x10c11a){if(_0x10c11a[_0x6bb9('0x6')]){return _0x4e2e8f(_0x10c11a[_0x6bb9('0x6')][_0x6bb9('0x7')]);}else{return _0x50555a(_0x10c11a[_0x6bb9('0x8')]);}})[_0x6bb9('0x9')](function(_0x485d2f){return _0x4e2e8f(_0x485d2f);});});}exports[_0x6bb9('0xa')]=function(_0x30a1de,_0x5e1ebe,_0x4f87c0){return function(_0x2c9638){if(_0x4f87c0['rules']&&!_0x4f87c0[_0x6bb9('0xb')][_0x30a1de]){logger[_0x6bb9('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x30a1de);return _0x2c9638['stop']();}var _0x51f48c=[];for(var _0xb93971=0x0;_0xb93971<_0x5e1ebe['length'];_0xb93971+=0x1){_0x51f48c[_0x6bb9('0xd')](request(_0x6bb9('0xe'),{'command':util[_0x6bb9('0xf')]('iftime\x20%s',_0x5e1ebe[_0xb93971])})[_0x6bb9('0x5')](function(_0x16cd1c){return _0x16cd1c&&_0x16cd1c['message']&&_0x16cd1c['message'][_0x6bb9('0x10')]('true')>=0x0?!![]:![];})['catch'](function(_0x4633fe){logger[_0x6bb9('0x6')]('[%s][INTERVAL]\x20%s',_0x30a1de,_0x5e1ebe[_0xb93971]);}));}BPromise[_0x6bb9('0x11')](_0x51f48c)[_0x6bb9('0x5')](function(_0x2ba031){var _0x57ed35=_['some'](_0x2ba031);logger[_0x6bb9('0xc')](_0x6bb9('0x12'),_0x30a1de,_0x5e1ebe[_0x6bb9('0x13')](_0x6bb9('0x14')),_0x57ed35);_0x2c9638[_0x6bb9('0x15')](_0x57ed35);})['catch'](function(_0x46cad6){console['log'](_0x46cad6);logger[_0x6bb9('0x6')](_0x6bb9('0x12'),_0x30a1de,_0x5e1ebe['join'](_0x6bb9('0x14')),_0x46cad6[_0x6bb9('0x16')]);_0x2c9638[_0x6bb9('0x17')]();});};}; \ No newline at end of file +var _0x63da=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','../../../config/logger','routing','request','then','error','message','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x63da,0x115));var _0xa63d=function(_0x598b37,_0x39e238){_0x598b37=_0x598b37-0x0;var _0x344326=_0x63da[_0x598b37];return _0x344326;};'use strict';var util=require(_0xa63d('0x0'));var BPromise=require(_0xa63d('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0xa63d('0x2'))(_0xa63d('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x4f36ae,_0x35e5d1){return new BPromise(function(_0xb13ff4,_0x1b55ea){return client[_0xa63d('0x4')](_0x4f36ae,_0x35e5d1)[_0xa63d('0x5')](function(_0x23058c){if(_0x23058c[_0xa63d('0x6')]){return _0x1b55ea(_0x23058c[_0xa63d('0x6')][_0xa63d('0x7')]);}else{return _0xb13ff4(_0x23058c[_0xa63d('0x8')]);}})[_0xa63d('0x9')](function(_0x102fee){return _0x1b55ea(_0x102fee);});});}exports[_0xa63d('0xa')]=function(_0x3b28cf,_0x59430,_0x1465c6){return function(_0x5a2da8){if(_0x1465c6[_0xa63d('0xb')]&&!_0x1465c6['rules'][_0x3b28cf]){logger[_0xa63d('0xc')](_0xa63d('0xd'),_0x3b28cf);return _0x5a2da8['stop']();}var _0xafaaa3=[];for(var _0x57bfa5=0x0;_0x57bfa5<_0x59430[_0xa63d('0xe')];_0x57bfa5+=0x1){_0xafaaa3['push'](request(_0xa63d('0xf'),{'command':util[_0xa63d('0x10')]('iftime\x20%s',_0x59430[_0x57bfa5])})[_0xa63d('0x5')](function(_0x4635bc){return _0x4635bc&&_0x4635bc[_0xa63d('0x7')]&&_0x4635bc[_0xa63d('0x7')]['indexOf'](_0xa63d('0x11'))>=0x0?!![]:![];})[_0xa63d('0x9')](function(_0x14819f){logger['error'](_0xa63d('0x12'),_0x3b28cf,_0x59430[_0x57bfa5]);}));}BPromise['all'](_0xafaaa3)[_0xa63d('0x5')](function(_0x308778){var _0x198a49=_[_0xa63d('0x13')](_0x308778);logger['info'](_0xa63d('0x14'),_0x3b28cf,_0x59430[_0xa63d('0x15')](_0xa63d('0x16')),_0x198a49);_0x5a2da8[_0xa63d('0x17')](_0x198a49);})['catch'](function(_0x5a1853){console[_0xa63d('0x18')](_0x5a1853);logger[_0xa63d('0x6')](_0xa63d('0x14'),_0x3b28cf,_0x59430[_0xa63d('0x15')](_0xa63d('0x16')),_0x5a1853[_0xa63d('0x19')]);_0x5a2da8['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index aaae532..20a8023 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 _0xf109=['transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','now','called','info','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer'];(function(_0x5309a4,_0x17d1d3){var _0x461896=function(_0x411556){while(--_0x411556){_0x5309a4['push'](_0x5309a4['shift']());}};_0x461896(++_0x17d1d3);}(_0xf109,0xce));var _0x9f10=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf109[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var utils=require(_0x9f10('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5d2950,_0x5b381d){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4'),_0x5d2950[_0x9f10('0x5')],_0x5d2950[_0x9f10('0x6')],_0x5d2950[_0x9f10('0x7')],_0x5d2950[_0x9f10('0x8')],_0x5d2950[_0x9f10('0x9')],_0x5d2950[_0x9f10('0xa')],_0x5d2950[_0x9f10('0xb')],_0x5d2950[_0x9f10('0xc')]));if(_0x5d2950[_0x9f10('0x7')]){utils['getVoiceQueueByName'](_0x5d2950[_0x9f10('0x7')])[_0x9f10('0xd')](function(_0x1a0668){if(_0x1a0668){_0x5d2950[_0x9f10('0xe')]=_0x1a0668[_0x9f10('0xe')];_0x5d2950['agentacw']=_0x5d2950[_0x9f10('0xf')]?_0x1a0668[_0x9f10('0x10')]:![];_0x5d2950[_0x9f10('0x11')]=_0x5d2950['agentacw']?_0x1a0668['acwTimeout']:0x0;}utils[_0x9f10('0x12')](_0x9f10('0x13'),_0x5d2950);});}else{utils[_0x9f10('0x12')]('CreateVoiceAgentReport',_0x5d2950);}if(_0x5b381d){delete transfers[_0x5d2950[_0x9f10('0x5')]];}else{delete agents[_0x5d2950[_0x9f10('0x14')]];}}exports[_0x9f10('0x15')]=function(_0x58067f){try{utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]',_0x58067f[_0x9f10('0x5')]),_0x58067f);agents[_0x58067f[_0x9f10('0x14')]]=_0x58067f;agents[_0x58067f['destuniqueid']]['agentcalledAt']=utils[_0x9f10('0x17')]();agents[_0x58067f[_0x9f10('0x14')]]['lastevent']=_0x9f10('0x18');agents[_0x58067f['destuniqueid']][_0x9f10('0xb')]=null;agents[_0x58067f[_0x9f10('0x14')]]['connectedlinename']=null;utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x58067f[_0x9f10('0x5')],agents[_0x58067f['destuniqueid']][_0x9f10('0x8')],_0x58067f['destuniqueid']));}catch(_0x2c5064){utils['error'](util['format'](_0x9f10('0x1a'),_0x58067f[_0x9f10('0x5')]),_0x2c5064);}};exports[_0x9f10('0x1b')]=function(_0x3a78be){try{if(!_[_0x9f10('0x1c')](agents[_0x3a78be[_0x9f10('0x14')]])){utils[_0x9f10('0x16')](util['format'](_0x9f10('0x1d'),_0x3a78be['uniqueid']),_0x3a78be);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x1e'),_0x3a78be['uniqueid'],agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x8')],_0x3a78be[_0x9f10('0x14')]));agents[_0x3a78be['destuniqueid']][_0x9f10('0x1b')]=!![];agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x1f')]=utils['now']();agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x20');agents[_0x3a78be[_0x9f10('0x14')]]['reason']='timeout';agents[_0x3a78be['destuniqueid']][_0x9f10('0x21')]=_0x3a78be['ringtime']?parseInt(_0x3a78be[_0x9f10('0x22')])/0x3e8:0x0;agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x23')]=0x0;unanswered[_0x9f10('0x24')](_0x3a78be[_0x9f10('0x14')]);}}catch(_0x4f6b0c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x1d'),_0x3a78be[_0x9f10('0x5')]),_0x4f6b0c);}};exports[_0x9f10('0x26')]=function(_0x2c4373){try{_['forIn'](agents,function(_0x358d3f,_0x501ee){if(_0x358d3f[_0x9f10('0x5')]==_0x2c4373[_0x9f10('0x5')]&&!_['includes'](unanswered,_0x358d3f[_0x9f10('0x14')])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x2c4373);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x27'),_0x2c4373[_0x9f10('0x5')],_0x358d3f['membername'],_0x358d3f[_0x9f10('0x14')]));_0x358d3f[_0x9f10('0x1b')]=!![];_0x358d3f[_0x9f10('0x1f')]=utils[_0x9f10('0x17')]();_0x358d3f[_0x9f10('0xc')]='abandoned';_0x358d3f[_0x9f10('0x28')]='abandoned';_0x358d3f[_0x9f10('0x21')]=_0x2c4373[_0x9f10('0x21')];_0x358d3f[_0x9f10('0x23')]=0x0;writeDB(_0x358d3f);}});}catch(_0x11ee9c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x11ee9c);}};exports[_0x9f10('0x29')]=function(_0x1b8018){try{if(agents[_0x1b8018['destuniqueid']]){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentconnect]',_0x1b8018[_0x9f10('0x5')]),_0x1b8018);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x2a'),_0x1b8018[_0x9f10('0x5')],agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x8')],_0x1b8018[_0x9f10('0x14')]));agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x2b')]=utils['now']();agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0xb')]=_0x1b8018[_0x9f10('0xb')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x2c')]=_0x1b8018[_0x9f10('0x2c')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];agents[_0x1b8018[_0x9f10('0x14')]]['lastevent']='connect';_[_0x9f10('0x2d')](agents,function(_0x2ff98d,_0x1deed4){if(_0x2ff98d[_0x9f10('0x14')]!=_0x1b8018[_0x9f10('0x14')]&&_0x2ff98d[_0x9f10('0x5')]==_0x1b8018[_0x9f10('0x5')]){_0x2ff98d[_0x9f10('0x23')]=0x0;_0x2ff98d[_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];_0x2ff98d[_0x9f10('0x1b')]=!![];_0x2ff98d[_0x9f10('0x1f')]=utils['now']();_0x2ff98d['lastevent']='answered_elsewhere';_0x2ff98d[_0x9f10('0x28')]='answered_elsewhere';_0x2ff98d[_0x9f10('0x2e')]=_0x1b8018[_0x9f10('0x14')];_0x2ff98d[_0x9f10('0x2f')]=_0x1b8018['membername'];writeDB(_0x2ff98d);}});}}catch(_0x3cfce6){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x5')]),_0x3cfce6);}};exports['agentcomplete']=function(_0x578368){try{if(!_['isNil'](agents[_0x578368[_0x9f10('0x14')]])){utils['debug'](util[_0x9f10('0x3')]('[%s][agents][agentcomplete]',_0x578368[_0x9f10('0x5')]),_0x578368);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x31'),_0x578368['uniqueid'],agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x8')],_0x578368['destuniqueid']));agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xf')]=!![];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x23')]=utils[_0x9f10('0x33')](agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')],agents[_0x578368['destuniqueid']][_0x9f10('0x2b')]);agents[_0x578368[_0x9f10('0x14')]]['reason']=_0x578368[_0x9f10('0x28')];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x34');writeDB(agents[_0x578368['destuniqueid']]);}}catch(_0x283f04){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x35'),_0x578368[_0x9f10('0x5')]),_0x283f04);}};exports[_0x9f10('0x36')]=function(_0x479b46){try{if(!_[_0x9f10('0x1c')](agents[_0x479b46[_0x9f10('0x37')]])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46[_0x9f10('0x5')]),_0x479b46);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x39'),_0x479b46[_0x9f10('0x5')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x8')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x5')]));agents[_0x479b46[_0x9f10('0x37')]]['transfer']=!![];agents[_0x479b46[_0x9f10('0x37')]]['transfertype']=_0x9f10('0x3a');agents[_0x479b46['transfereruniqueid']][_0x9f10('0x3b')]=_0x479b46[_0x9f10('0x3c')];agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x3d')]=agents[_0x479b46[_0x9f10('0x37')]]['uniqueid'];}}catch(_0x12cf34){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46['uniqueid']),_0x12cf34);}};exports['attendedtransfer']=function(_0x265f69){try{utils[_0x9f10('0x16')](util['format']('[%s][agents][attendedtransfer]',_0x265f69[_0x9f10('0x3e')]),_0x265f69);if(_0x265f69[_0x9f10('0x3e')]==_0x265f69[_0x9f10('0x3f')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x40')]])){utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x8')]));agents[_0x265f69['secondtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x40')]]['transfertype']=_0x9f10('0x42');agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x43')];agents[_0x265f69[_0x9f10('0x40')]]['transferuniqueid']=_0x265f69[_0x9f10('0x3e')];}if(_0x265f69['transfereeuniqueid']&&agents[_0x265f69['transfereeuniqueid']]){agents[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x44')]]=_[_0x9f10('0x46')](agents[_0x265f69[_0x9f10('0x44')]]);transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0xa')]=agents[_0x265f69['secondtransfereruniqueid']]['calleridnum'];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x47')]=agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x48')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x21')]=0x0;transfers[_0x265f69[_0x9f10('0x44')]]['agententerreason']=0x2;}}else if(_0x265f69[_0x9f10('0x40')]==_0x265f69[_0x9f10('0x49')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x3e')]])){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4a'),_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x8')]));agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x4b')]='ATTENDED';agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x4c')];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x3d')]=_0x265f69[_0x9f10('0x40')];}if(_0x265f69[_0x9f10('0x4d')]&&agents[_0x265f69[_0x9f10('0x4d')]]){agents[_0x265f69['transfertargetuniqueid']][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x4d')]]=_['clone'](agents[_0x265f69[_0x9f10('0x4d')]]);transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0xa')]=agents[_0x265f69[_0x9f10('0x3e')]]['calleridnum'];transfers[_0x265f69[_0x9f10('0x4d')]]['calleridname']=agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x4d')]]['agentcalledAt']=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69[_0x9f10('0x4d')]]['holdtime']=0x0;transfers[_0x265f69[_0x9f10('0x4d')]]['agententerreason']=0x2;}}}catch(_0x5708c1){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x4e'),_0x265f69['origtransfereruniqueid']),_0x5708c1);}};exports[_0x9f10('0x4f')]=function(_0x5a64ae){try{utils['debug'](util[_0x9f10('0x3')]('[%s][agents][hangup]',_0x5a64ae['uniqueid']),_0x5a64ae);if(agents[_0x5a64ae[_0x9f10('0x5')]]&&agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]===_0x9f10('0x20')){if(_0x5a64ae[_0x9f10('0x50')]==='21'){agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]=_0x9f10('0x51');agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]='rejected';}utils['info'](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);var _0x27f337=unanswered[_0x9f10('0x53')](_0x5a64ae[_0x9f10('0x5')]);if(_0x27f337>-0x1){unanswered[_0x9f10('0x54')](_0x27f337,0x1);}}if(transfers[_0x5a64ae[_0x9f10('0x5')]]){transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xf')]=!![];transfers[_0x5a64ae['uniqueid']][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x23')]=utils['diffTime'](transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]);transfers[_0x5a64ae['uniqueid']]['reason']=_0x9f10('0x55');transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]=_0x9f10('0x34');utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(transfers[_0x5a64ae[_0x9f10('0x5')]],!![]);}if(agents[_0x5a64ae['uniqueid']]&&agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]){agents[_0x5a64ae['uniqueid']][_0x9f10('0xf')]=!![];agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x5a64ae['uniqueid']][_0x9f10('0x23')]=utils['diffTime'](agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],agents[_0x5a64ae[_0x9f10('0x5')]]['agentconnectAt']);agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')]=agents[_0x5a64ae[_0x9f10('0x5')]]['transfer']?_0x9f10('0x41'):_0x9f10('0x55');agents[_0x5a64ae[_0x9f10('0x5')]]['lastevent']='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a64ae['uniqueid'],agents[_0x5a64ae['uniqueid']][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]]['reason'],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);}}catch(_0x3b3dd8){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x56'),_0x5a64ae[_0x9f10('0x5')]),_0x3b3dd8);}}; \ No newline at end of file +var _0xb62e=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','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','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect'];(function(_0x8f77ae,_0x155785){var _0x1e345f=function(_0x57d1d0){while(--_0x57d1d0){_0x8f77ae['push'](_0x8f77ae['shift']());}};_0x1e345f(++_0x155785);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var utils=require(_0xeb62('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x386f22,_0x57a5ba){utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x5'),_0x386f22[_0xeb62('0x6')],_0x386f22[_0xeb62('0x7')],_0x386f22[_0xeb62('0x8')],_0x386f22['membername'],_0x386f22[_0xeb62('0x9')],_0x386f22[_0xeb62('0xa')],_0x386f22[_0xeb62('0xb')],_0x386f22['lastevent']));if(_0x386f22[_0xeb62('0x8')]){utils[_0xeb62('0xc')](_0x386f22[_0xeb62('0x8')])[_0xeb62('0xd')](function(_0x4967c0){if(_0x4967c0){_0x386f22['type']=_0x4967c0[_0xeb62('0xe')];_0x386f22[_0xeb62('0xf')]=_0x386f22[_0xeb62('0x10')]?_0x4967c0[_0xeb62('0x11')]:![];_0x386f22[_0xeb62('0x12')]=_0x386f22[_0xeb62('0xf')]?_0x4967c0[_0xeb62('0x13')]:0x0;}utils[_0xeb62('0x14')](_0xeb62('0x15'),_0x386f22);});}else{utils[_0xeb62('0x14')]('CreateVoiceAgentReport',_0x386f22);}if(_0x57a5ba){delete transfers[_0x386f22[_0xeb62('0x6')]];}else{delete agents[_0x386f22[_0xeb62('0x16')]];}}exports[_0xeb62('0x17')]=function(_0x6822bc){try{utils['debug'](util[_0xeb62('0x4')](_0xeb62('0x18'),_0x6822bc[_0xeb62('0x6')]),_0x6822bc);agents[_0x6822bc['destuniqueid']]=_0x6822bc;agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x19')]=utils[_0xeb62('0x1a')]();agents[_0x6822bc['destuniqueid']][_0xeb62('0x1b')]=_0xeb62('0x1c');agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0xb')]=null;agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x1d')]=null;utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x1e'),_0x6822bc[_0xeb62('0x6')],agents[_0x6822bc[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x6822bc[_0xeb62('0x16')]));}catch(_0x5a07bb){utils[_0xeb62('0x20')](util[_0xeb62('0x4')](_0xeb62('0x18'),_0x6822bc[_0xeb62('0x6')]),_0x5a07bb);}};exports[_0xeb62('0x21')]=function(_0x24cbf3){try{if(!_[_0xeb62('0x22')](agents[_0x24cbf3['destuniqueid']])){utils['debug'](util[_0xeb62('0x4')](_0xeb62('0x23'),_0x24cbf3[_0xeb62('0x6')]),_0x24cbf3);utils[_0xeb62('0x3')](util[_0xeb62('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x24cbf3['uniqueid'],agents[_0x24cbf3[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x24cbf3[_0xeb62('0x16')]));agents[_0x24cbf3[_0xeb62('0x16')]]['agentringnoanswer']=!![];agents[_0x24cbf3['destuniqueid']][_0xeb62('0x24')]=utils['now']();agents[_0x24cbf3[_0xeb62('0x16')]]['lastevent']=_0xeb62('0x25');agents[_0x24cbf3['destuniqueid']][_0xeb62('0x26')]=_0xeb62('0x25');agents[_0x24cbf3[_0xeb62('0x16')]]['holdtime']=_0x24cbf3[_0xeb62('0x27')]?parseInt(_0x24cbf3[_0xeb62('0x27')])/0x3e8:0x0;agents[_0x24cbf3[_0xeb62('0x16')]][_0xeb62('0x28')]=0x0;unanswered[_0xeb62('0x29')](_0x24cbf3[_0xeb62('0x16')]);}}catch(_0x511202){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][agentringnoanswer]',_0x24cbf3[_0xeb62('0x6')]),_0x511202);}};exports[_0xeb62('0x2a')]=function(_0x2c967c){try{_[_0xeb62('0x2b')](agents,function(_0x235448,_0x5195bf){if(_0x235448['uniqueid']==_0x2c967c[_0xeb62('0x6')]&&!_[_0xeb62('0x2c')](unanswered,_0x235448[_0xeb62('0x16')])){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x2e'),_0x2c967c[_0xeb62('0x6')]),_0x2c967c);utils['info'](util[_0xeb62('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2c967c['uniqueid'],_0x235448[_0xeb62('0x1f')],_0x235448[_0xeb62('0x16')]));_0x235448['agentringnoanswer']=!![];_0x235448[_0xeb62('0x24')]=utils['now']();_0x235448[_0xeb62('0x1b')]=_0xeb62('0x2f');_0x235448['reason']=_0xeb62('0x2f');_0x235448[_0xeb62('0x30')]=_0x2c967c['holdtime'];_0x235448[_0xeb62('0x28')]=0x0;writeDB(_0x235448);}});}catch(_0x2a8087){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][queuecallerabandon]',_0x2c967c[_0xeb62('0x6')]),_0x2a8087);}};exports[_0xeb62('0x31')]=function(_0x4cf6b0){try{if(agents[_0x4cf6b0['destuniqueid']]){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')]('[%s][agents][agentconnect]',_0x4cf6b0[_0xeb62('0x6')]),_0x4cf6b0);utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x32'),_0x4cf6b0[_0xeb62('0x6')],agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x1f')],_0x4cf6b0['destuniqueid']));agents[_0x4cf6b0['destuniqueid']][_0xeb62('0x33')]=utils[_0xeb62('0x1a')]();agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0xb')]=_0x4cf6b0['connectedlinenum'];agents[_0x4cf6b0[_0xeb62('0x16')]]['connectedlinename']=_0x4cf6b0[_0xeb62('0x1d')];agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x30')]=_0x4cf6b0[_0xeb62('0x27')];agents[_0x4cf6b0[_0xeb62('0x16')]][_0xeb62('0x1b')]=_0xeb62('0x34');_[_0xeb62('0x2b')](agents,function(_0x5e8ef8,_0x38f91b){if(_0x5e8ef8[_0xeb62('0x16')]!=_0x4cf6b0[_0xeb62('0x16')]&&_0x5e8ef8[_0xeb62('0x6')]==_0x4cf6b0['uniqueid']){_0x5e8ef8['talktime']=0x0;_0x5e8ef8[_0xeb62('0x30')]=_0x4cf6b0[_0xeb62('0x27')];_0x5e8ef8['agentringnoanswer']=!![];_0x5e8ef8[_0xeb62('0x24')]=utils[_0xeb62('0x1a')]();_0x5e8ef8['lastevent']=_0xeb62('0x35');_0x5e8ef8['reason']=_0xeb62('0x35');_0x5e8ef8['answeredelsewheredestinationuniqueid']=_0x4cf6b0[_0xeb62('0x16')];_0x5e8ef8['answeredelsewheremembername']=_0x4cf6b0[_0xeb62('0x1f')];writeDB(_0x5e8ef8);}});}}catch(_0x609b2d){utils[_0xeb62('0x20')](util['format']('[%s][agents][agentconnect]',_0x4cf6b0[_0xeb62('0x6')]),_0x609b2d);}};exports[_0xeb62('0x10')]=function(_0xb1c958){try{if(!_[_0xeb62('0x22')](agents[_0xb1c958[_0xeb62('0x16')]])){utils['debug'](util[_0xeb62('0x4')]('[%s][agents][agentcomplete]',_0xb1c958[_0xeb62('0x6')]),_0xb1c958);utils['info'](util[_0xeb62('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xb1c958[_0xeb62('0x6')],agents[_0xb1c958['destuniqueid']][_0xeb62('0x1f')],_0xb1c958[_0xeb62('0x16')]));agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x10')]=!![];agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x36')]=utils['now']();agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x28')]=utils['diffTime'](agents[_0xb1c958['destuniqueid']]['agentcompleteAt'],agents[_0xb1c958['destuniqueid']][_0xeb62('0x33')]);agents[_0xb1c958[_0xeb62('0x16')]]['reason']=_0xb1c958[_0xeb62('0x26')];agents[_0xb1c958[_0xeb62('0x16')]][_0xeb62('0x1b')]=_0xeb62('0x37');writeDB(agents[_0xb1c958[_0xeb62('0x16')]]);}}catch(_0x555812){utils[_0xeb62('0x20')](util['format'](_0xeb62('0x38'),_0xb1c958[_0xeb62('0x6')]),_0x555812);}};exports[_0xeb62('0x39')]=function(_0x18c40d){try{if(!_[_0xeb62('0x22')](agents[_0x18c40d[_0xeb62('0x3a')]])){utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x3b'),_0x18c40d[_0xeb62('0x6')]),_0x18c40d);utils[_0xeb62('0x3')](util[_0xeb62('0x4')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x18c40d[_0xeb62('0x6')],agents[_0x18c40d['transfereruniqueid']]['membername'],agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x6')]));agents[_0x18c40d['transfereruniqueid']][_0xeb62('0x3c')]=!![];agents[_0x18c40d[_0xeb62('0x3a')]]['transfertype']=_0xeb62('0x3d');agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x3e')]=_0x18c40d[_0xeb62('0x3f')];agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x40')]=agents[_0x18c40d[_0xeb62('0x3a')]][_0xeb62('0x6')];}}catch(_0x497714){utils[_0xeb62('0x20')](util['format'](_0xeb62('0x3b'),_0x18c40d[_0xeb62('0x6')]),_0x497714);}};exports[_0xeb62('0x41')]=function(_0x289af0){try{utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x42'),_0x289af0[_0xeb62('0x43')]),_0x289af0);if(_0x289af0['origtransfereruniqueid']==_0x289af0['origtransfererlinkedid']){if(!_['isNil'](agents[_0x289af0['secondtransfereruniqueid']])){utils[_0xeb62('0x3')](util['format'](_0xeb62('0x44'),_0x289af0['origtransfereruniqueid'],agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x1f')]));agents[_0x289af0[_0xeb62('0x45')]]['transfer']=!![];agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x46')]='ATTENDED';agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x3e')]=_0x289af0[_0xeb62('0x47')];agents[_0x289af0[_0xeb62('0x45')]]['transferuniqueid']=_0x289af0[_0xeb62('0x43')];}if(_0x289af0[_0xeb62('0x48')]&&agents[_0x289af0['transfereeuniqueid']]){agents[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x49')]=0x1;transfers[_0x289af0[_0xeb62('0x48')]]=_[_0xeb62('0x4a')](agents[_0x289af0[_0xeb62('0x48')]]);transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0xa')]=agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0xa')];transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x4b')]=agents[_0x289af0[_0xeb62('0x45')]][_0xeb62('0x4b')];transfers[_0x289af0[_0xeb62('0x48')]][_0xeb62('0x19')]=utils[_0xeb62('0x1a')]();transfers[_0x289af0['transfereeuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x289af0['transfereeuniqueid']][_0xeb62('0x30')]=0x0;transfers[_0x289af0['transfereeuniqueid']][_0xeb62('0x49')]=0x2;}}else if(_0x289af0[_0xeb62('0x45')]==_0x289af0[_0xeb62('0x4c')]){if(!_[_0xeb62('0x22')](agents[_0x289af0[_0xeb62('0x43')]])){utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x44'),_0x289af0[_0xeb62('0x43')],agents[_0x289af0[_0xeb62('0x43')]]['membername']));agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x3c')]=!![];agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x46')]='ATTENDED';agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x3e')]=_0x289af0[_0xeb62('0x4d')];agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x40')]=_0x289af0[_0xeb62('0x45')];}if(_0x289af0[_0xeb62('0x4e')]&&agents[_0x289af0[_0xeb62('0x4e')]]){agents[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x49')]=0x1;transfers[_0x289af0[_0xeb62('0x4e')]]=_['clone'](agents[_0x289af0[_0xeb62('0x4e')]]);transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0xa')]=agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0xa')];transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x4b')]=agents[_0x289af0[_0xeb62('0x43')]][_0xeb62('0x4b')];transfers[_0x289af0[_0xeb62('0x4e')]]['agentcalledAt']=utils[_0xeb62('0x1a')]();transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x33')]=utils[_0xeb62('0x1a')]();transfers[_0x289af0['transfertargetuniqueid']][_0xeb62('0x30')]=0x0;transfers[_0x289af0[_0xeb62('0x4e')]][_0xeb62('0x49')]=0x2;}}}catch(_0xdde337){utils[_0xeb62('0x20')](util[_0xeb62('0x4')]('[%s][agents][attendedtransfer]',_0x289af0[_0xeb62('0x43')]),_0xdde337);}};exports[_0xeb62('0x4f')]=function(_0x347c55){try{utils[_0xeb62('0x2d')](util[_0xeb62('0x4')](_0xeb62('0x50'),_0x347c55[_0xeb62('0x6')]),_0x347c55);if(agents[_0x347c55[_0xeb62('0x6')]]&&agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]===_0xeb62('0x25')){if(_0x347c55[_0xeb62('0x51')]==='21'){agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]=_0xeb62('0x52');agents[_0x347c55[_0xeb62('0x6')]]['lastevent']=_0xeb62('0x52');}utils['info'](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55['uniqueid'],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(agents[_0x347c55[_0xeb62('0x6')]]);var _0x449582=unanswered[_0xeb62('0x54')](_0x347c55[_0xeb62('0x6')]);if(_0x449582>-0x1){unanswered[_0xeb62('0x55')](_0x449582,0x1);}}if(transfers[_0x347c55[_0xeb62('0x6')]]){transfers[_0x347c55[_0xeb62('0x6')]]['agentcomplete']=!![];transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')]=utils['now']();transfers[_0x347c55[_0xeb62('0x6')]]['talktime']=utils[_0xeb62('0x56')](transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]);transfers[_0x347c55[_0xeb62('0x6')]]['reason']=_0xeb62('0x57');transfers[_0x347c55['uniqueid']][_0xeb62('0x1b')]=_0xeb62('0x37');utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55['uniqueid'],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],transfers[_0x347c55[_0xeb62('0x6')]]['reason'],transfers[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(transfers[_0x347c55[_0xeb62('0x6')]],!![]);}if(agents[_0x347c55[_0xeb62('0x6')]]&&agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]){agents[_0x347c55['uniqueid']]['agentcomplete']=!![];agents[_0x347c55['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x28')]=utils[_0xeb62('0x56')](agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x36')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x33')]);agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')]=agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x3c')]?_0xeb62('0x3c'):'agent';agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]=_0xeb62('0x37');utils[_0xeb62('0x3')](util[_0xeb62('0x4')](_0xeb62('0x53'),_0x347c55[_0xeb62('0x6')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1f')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x26')],agents[_0x347c55[_0xeb62('0x6')]][_0xeb62('0x1b')]));writeDB(agents[_0x347c55[_0xeb62('0x6')]]);}}catch(_0xfff29b){utils[_0xeb62('0x20')](util[_0xeb62('0x4')](_0xeb62('0x50'),_0x347c55['uniqueid']),_0xfff29b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 13ac7e0..6519cfc 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 _0xaee6=['[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','gotoif','toLowerCase','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','linkedid','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','starttime','billableseconds','endtime','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','origtransfererchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt'];(function(_0xe6d026,_0x58c934){var _0x45003b=function(_0x28059f){while(--_0x28059f){_0xe6d026['push'](_0xe6d026['shift']());}};_0x45003b(++_0x58c934);}(_0xaee6,0x187));var _0x6aee=function(_0x285374,_0x4b7e9d){_0x285374=_0x285374-0x0;var _0x1f4428=_0xaee6[_0x285374];return _0x1f4428;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var utils=require(_0x6aee('0x2'));var transfers=require(_0x6aee('0x3'));var dispositions=[_0x6aee('0x4'),_0x6aee('0x5'),'FAILED',_0x6aee('0x4'),_0x6aee('0x4'),_0x6aee('0x4'),'ANSWERED',_0x6aee('0x6'),_0x6aee('0x5'),_0x6aee('0x5'),_0x6aee('0x5')];var channels={};function writeDB(_0x437b2f){var _0x19f528;if(transfers[_0x6aee('0x7')][_0x437b2f['uniqueid']]){_0x19f528=_0x437b2f['uniqueid'];_0x437b2f[_0x6aee('0x8')]=transfers['blinds'][_0x437b2f[_0x6aee('0x8')]][_0x6aee('0x9')];}utils[_0x6aee('0xa')](util['format'](_0x6aee('0xb'),_0x437b2f[_0x6aee('0x8')],_0x437b2f[_0x6aee('0xc')],_0x437b2f[_0x6aee('0xd')],_0x437b2f['membername'],_0x437b2f[_0x6aee('0xe')],_0x437b2f['calleridnum'],_0x437b2f[_0x6aee('0xf')],_0x437b2f[_0x6aee('0x10')]));if(_0x437b2f[_0x6aee('0x11')]){utils[_0x6aee('0x12')](_0x437b2f[_0x6aee('0x11')])['then'](function(_0x2d13f5){if(_0x2d13f5){_0x437b2f[_0x6aee('0x13')]=_0x2d13f5['id'];}utils['request']('CreateVoiceCallReport',_0x437b2f);});}else{utils[_0x6aee('0x14')](_0x6aee('0x15'),_0x437b2f);}if(channels[_0x437b2f[_0x6aee('0x8')]]){delete channels[_0x437b2f[_0x6aee('0x8')]];}else if(_0x19f528&&channels[_0x19f528]){if(!transfers[_0x6aee('0x7')][_0x19f528][_0x6aee('0x16')])delete transfers[_0x6aee('0x7')][_0x19f528];delete channels[_0x19f528];}}exports[_0x6aee('0x17')]=function(_0x5cc0b0){try{utils[_0x6aee('0x18')](util[_0x6aee('0x19')]('[%s][calls][newchannel]',_0x5cc0b0[_0x6aee('0x8')]),_0x5cc0b0);if(_0x5cc0b0[_0x6aee('0x8')]==_0x5cc0b0['linkedid']&&_0x5cc0b0[_0x6aee('0xc')]!=_0x6aee('0x1a')){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x1b'),_0x5cc0b0[_0x6aee('0x8')],_0x5cc0b0[_0x6aee('0x1c')],_0x5cc0b0['exten']));channels[_0x5cc0b0[_0x6aee('0x8')]]={'uniqueid':_0x5cc0b0['uniqueid'],'accountcode':_0x5cc0b0['accountcode'],'source':_0x5cc0b0[_0x6aee('0x1d')],'destination':_0x5cc0b0[_0x6aee('0x1e')],'destinationcontext':_0x5cc0b0[_0x6aee('0x1c')],'channel':_0x5cc0b0[_0x6aee('0xc')],'starttime':utils[_0x6aee('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6aee('0x4'),'amaflags':_0x6aee('0x20')};}}catch(_0x1ffa47){utils['error'](util[_0x6aee('0x19')]('[%s][calls][newchannel]',_0x5cc0b0['uniqueid']),_0x1ffa47);}};exports[_0x6aee('0x21')]=function(_0x30f4cd){try{utils['debug'](util[_0x6aee('0x19')](_0x6aee('0x22'),_0x30f4cd['uniqueid']),_0x30f4cd);if(!_[_0x6aee('0x23')](channels[_0x30f4cd[_0x6aee('0x8')]])&&_0x30f4cd[_0x6aee('0x24')]==0x6){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x25'),_0x30f4cd[_0x6aee('0x8')],_0x30f4cd[_0x6aee('0x1c')],_0x30f4cd[_0x6aee('0xc')]));if(_[_0x6aee('0x23')](channels[_0x30f4cd[_0x6aee('0x8')]][_0x6aee('0x26')])){channels[_0x30f4cd[_0x6aee('0x8')]][_0x6aee('0x26')]=utils[_0x6aee('0x1f')]();}}else if(!_[_0x6aee('0x23')](channels[_0x30f4cd['linkedid']])&&_0x30f4cd['channelstate']==0x6&&_0x30f4cd[_0x6aee('0x1c')]!=_0x6aee('0x27')){utils[_0x6aee('0xa')](util[_0x6aee('0x19')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x30f4cd[_0x6aee('0x8')],_0x30f4cd['linkedid'],_0x30f4cd[_0x6aee('0x1c')],_0x30f4cd[_0x6aee('0xc')]));channels[_0x30f4cd[_0x6aee('0x28')]][_0x6aee('0x11')]=_0x30f4cd[_0x6aee('0x11')];channels[_0x30f4cd[_0x6aee('0x28')]][_0x6aee('0x29')]=_0x30f4cd[_0x6aee('0xc')];if(_[_0x6aee('0x23')](channels[_0x30f4cd[_0x6aee('0x28')]][_0x6aee('0x2a')])){channels[_0x30f4cd[_0x6aee('0x28')]][_0x6aee('0x2a')]=utils['now']();}channels[_0x30f4cd[_0x6aee('0x28')]][_0x6aee('0x2b')]=dispositions[_[_0x6aee('0x2c')](_0x30f4cd[_0x6aee('0x24')])]||_0x6aee('0x2d');}}catch(_0x43d09e){utils[_0x6aee('0x2e')](util[_0x6aee('0x19')]('[%s][calls][newstate]',_0x30f4cd[_0x6aee('0x8')]),_0x43d09e);}};exports[_0x6aee('0x2f')]=function(_0x741f9f){try{if(!_[_0x6aee('0x23')](channels[_0x741f9f[_0x6aee('0x8')]])){utils[_0x6aee('0x18')](util[_0x6aee('0x19')](_0x6aee('0x30'),_0x741f9f[_0x6aee('0x8')]),_0x741f9f);if(_[_0x6aee('0x23')](channels[_0x741f9f[_0x6aee('0x8')]]['callerid'])){channels[_0x741f9f['uniqueid']][_0x6aee('0x31')]=_0x741f9f['calleridname']+'\x20<'+_0x741f9f['calleridnum']+'>';}utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x32'),_0x741f9f['uniqueid'],channels[_0x741f9f[_0x6aee('0x8')]][_0x6aee('0x31')],_0x741f9f[_0x6aee('0x33')]));channels[_0x741f9f[_0x6aee('0x8')]]['endtime']=utils[_0x6aee('0x1f')]();channels[_0x741f9f[_0x6aee('0x8')]][_0x6aee('0x34')]=utils[_0x6aee('0x35')](channels[_0x741f9f[_0x6aee('0x8')]]['endtime'],channels[_0x741f9f[_0x6aee('0x8')]][_0x6aee('0x36')]);channels[_0x741f9f[_0x6aee('0x8')]][_0x6aee('0x37')]=channels[_0x741f9f[_0x6aee('0x8')]]['answertime']?utils[_0x6aee('0x35')](channels[_0x741f9f['uniqueid']][_0x6aee('0x38')],channels[_0x741f9f[_0x6aee('0x8')]][_0x6aee('0x2a')]):0x0;writeDB(channels[_0x741f9f[_0x6aee('0x8')]]);}}catch(_0x36c6a4){utils[_0x6aee('0x2e')](util['format']('[%s][calls][hangup]',_0x741f9f[_0x6aee('0x8')]),_0x36c6a4);}};exports['attendedtransfer']=function(_0x35afaf){try{if(!_[_0x6aee('0x23')](channels[_0x35afaf[_0x6aee('0x39')]])){utils[_0x6aee('0x18')](util['format'](_0x6aee('0x3a'),_0x35afaf['origtransfereruniqueid']),_0x35afaf);if(channels[_0x35afaf[_0x6aee('0x39')]]['channel']==_0x35afaf[_0x6aee('0x3b')]){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x3c'),_0x35afaf[_0x6aee('0x3d')],_0x35afaf[_0x6aee('0x39')],_0x35afaf[_0x6aee('0x3e')]));channels[_0x35afaf[_0x6aee('0x39')]]['destinationchannel']=_0x35afaf[_0x6aee('0x3e')];channels[_0x35afaf[_0x6aee('0x39')]]['userfield']='_attended';}else if(channels[_0x35afaf[_0x6aee('0x39')]][_0x6aee('0xc')]=_0x35afaf['transfertargetchannel']){utils[_0x6aee('0xa')](util['format'](_0x6aee('0x3c'),_0x35afaf[_0x6aee('0x3d')],_0x35afaf[_0x6aee('0x39')],_0x35afaf[_0x6aee('0x3f')]));channels[_0x35afaf['localtwolinkedid']]['destinationchannel']=_0x35afaf[_0x6aee('0x3f')];channels[_0x35afaf[_0x6aee('0x39')]][_0x6aee('0x40')]=_0x6aee('0x41');}}}catch(_0x48b373){utils[_0x6aee('0x2e')](util['format'](_0x6aee('0x3a'),_0x35afaf[_0x6aee('0x3d')]),_0x48b373);}};exports[_0x6aee('0x42')]=function(_0x12fa88){try{if(!_['isNil'](channels[_0x12fa88[_0x6aee('0x8')]])){utils[_0x6aee('0x18')](util[_0x6aee('0x19')](_0x6aee('0x43'),_0x12fa88[_0x6aee('0x8')]),_0x12fa88);channels[_0x12fa88[_0x6aee('0x8')]][_0x6aee('0x44')]=utils[_0x6aee('0x1f')]();utils['info'](util[_0x6aee('0x19')](_0x6aee('0x45'),_0x12fa88['uniqueid'],channels[_0x12fa88[_0x6aee('0x8')]][_0x6aee('0x44')]));}}catch(_0x1259cc){utils[_0x6aee('0x2e')](util['format']('[%s][calls][musiconholdstart]',_0x12fa88[_0x6aee('0x8')]),_0x1259cc);}};exports[_0x6aee('0x46')]=function(_0x471b28){try{if(!_[_0x6aee('0x23')](channels[_0x471b28['uniqueid']])){utils[_0x6aee('0x18')](util['format'](_0x6aee('0x47'),_0x471b28['uniqueid']),_0x471b28);if(!_[_0x6aee('0x23')](channels[_0x471b28[_0x6aee('0x8')]][_0x6aee('0x44')])){channels[_0x471b28[_0x6aee('0x8')]][_0x6aee('0x48')]+=utils[_0x6aee('0x35')](utils[_0x6aee('0x1f')](),channels[_0x471b28[_0x6aee('0x8')]][_0x6aee('0x44')]);utils[_0x6aee('0xa')](util['format'](_0x6aee('0x49'),_0x471b28[_0x6aee('0x8')],channels[_0x471b28[_0x6aee('0x8')]][_0x6aee('0x48')]));delete channels[_0x471b28['uniqueid']]['musiconholdstartAt'];}}}catch(_0x3df9c6){utils['error'](util[_0x6aee('0x19')]('[%s][calls][musiconholdstop]',_0x471b28[_0x6aee('0x8')]),_0x3df9c6);}};exports[_0x6aee('0x4a')]=function(_0x106e95){try{if(!_['isNil'](channels[_0x106e95['uniqueid']])){utils[_0x6aee('0x18')](util['format']('[%s][calls][varset]',_0x106e95[_0x6aee('0x8')]),_0x106e95);if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x4c')])){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x4d'),_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95['uniqueid']][_0x6aee('0x4f')]=_0x106e95[_0x6aee('0x4e')];}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x50')])){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x51'),_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95[_0x6aee('0x8')]]['destination']=_0x106e95[_0x6aee('0x4e')];channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0x31')]='\x22'+_0x106e95[_0x6aee('0x4e')]+_0x6aee('0x52')+_0x106e95[_0x6aee('0x4e')]+'>';}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x53')])||!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x54')])){utils['info'](util['format'](_0x6aee('0x55'),_0x106e95[_0x6aee('0x8')],!_['isNil'](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x53')])?_0x6aee('0x53'):_0x6aee('0x54'),_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95[_0x6aee('0x8')]]['callerid']=_0x106e95['value'];}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x56')])||!_[_0x6aee('0x23')](_0x106e95['variable'][_0x6aee('0x57')])){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x55'),_0x106e95[_0x6aee('0x8')],!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')]['xmd-queue'])?_0x6aee('0x56'):_0x6aee('0x57'),_0x106e95['value']));channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0x58')]=_0x6aee('0x59');channels[_0x106e95['uniqueid']][_0x6aee('0x5a')]=_0x106e95[_0x6aee('0x4e')];channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0xd')]=!![];}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x5b')])){utils[_0x6aee('0xa')](util[_0x6aee('0x19')](_0x6aee('0x5c'),_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0x5d')]=_0x106e95[_0x6aee('0x4e')];}if(!_['isNil'](_0x106e95[_0x6aee('0x4b')]['xmd-cdrtype'])){utils[_0x6aee('0xa')](util[_0x6aee('0x19')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0x5e')]=_0x106e95[_0x6aee('0x4e')];}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x5f')])){utils['info'](util[_0x6aee('0x19')](_0x6aee('0x60'),_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95['uniqueid']][_0x6aee('0x61')]=_0x106e95['value'];}if(!_[_0x6aee('0x23')](_0x106e95[_0x6aee('0x4b')][_0x6aee('0x62')])){utils['info'](util[_0x6aee('0x19')](_0x6aee('0x63'),_0x106e95[_0x6aee('0x8')],_0x106e95[_0x6aee('0x4e')]));channels[_0x106e95[_0x6aee('0x8')]][_0x6aee('0x62')]=_0x106e95[_0x6aee('0x4e')];}}}catch(_0x5b0b7a){utils[_0x6aee('0x2e')](util[_0x6aee('0x19')](_0x6aee('0x64'),_0x106e95[_0x6aee('0x8')]),_0x5b0b7a);}};exports[_0x6aee('0x65')]=function(_0x504bfd){try{if(!_['isNil'](channels[_0x504bfd[_0x6aee('0x8')]])){utils[_0x6aee('0x18')](util[_0x6aee('0x19')](_0x6aee('0x66'),_0x504bfd['uniqueid']),_0x504bfd);utils[_0x6aee('0xa')](util[_0x6aee('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x504bfd[_0x6aee('0x8')],_0x504bfd[_0x6aee('0x67')],_0x504bfd[_0x6aee('0x68')]));if(_0x504bfd['application']['toLowerCase']()==_0x6aee('0x69')&&_[_0x6aee('0x6a')](_0x504bfd[_0x6aee('0x68')]['toLowerCase'](),_0x6aee('0x6b'))){var _0xbf2bc6=_0x504bfd[_0x6aee('0x68')][_0x6aee('0x6c')]('=');var _0x4e0544=_0xbf2bc6[0x0][_0x6aee('0x6d')](_0xbf2bc6[0x0][_0x6aee('0x6e')]('(')+0x1,_0xbf2bc6[0x0][_0x6aee('0x6e')](')'));var _0x4ac78b=_0xbf2bc6[0x1];channels[_0x504bfd[_0x6aee('0x8')]][_0x4e0544]=_0x4ac78b;}if(!_[_0x6aee('0x6f')](['hangup','noop',_0x6aee('0x70'),'set',_0x6aee('0x71')],_0x504bfd['application'][_0x6aee('0x72')]())){channels[_0x504bfd['uniqueid']][_0x6aee('0x58')]=_0x504bfd[_0x6aee('0x67')];channels[_0x504bfd[_0x6aee('0x8')]][_0x6aee('0x5a')]=_0x504bfd[_0x6aee('0x68')];}}}catch(_0x156fee){utils[_0x6aee('0x2e')](util[_0x6aee('0x19')]('[%s][calls][newexten]',_0x504bfd[_0x6aee('0x8')]),_0x156fee);}}; \ No newline at end of file +var _0x4186=['calleridname','cause-txt','diffTime','endtime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','set','startsWith','cdr','substring','lastIndexOf','includes','execif','gotoif','toLowerCase','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','newstate','debug','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid'];(function(_0x5995d8,_0xf0fba4){var _0x143c31=function(_0x41ef98){while(--_0x41ef98){_0x5995d8['push'](_0x5995d8['shift']());}};_0x143c31(++_0xf0fba4);}(_0x4186,0x11f));var _0x6418=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x4186[_0x2b1551];return _0x2fc2a1;};'use strict';var _=require(_0x6418('0x0'));var util=require(_0x6418('0x1'));var utils=require(_0x6418('0x2'));var transfers=require(_0x6418('0x3'));var dispositions=[_0x6418('0x4'),'FAILED','FAILED',_0x6418('0x4'),_0x6418('0x4'),_0x6418('0x4'),_0x6418('0x5'),_0x6418('0x6'),'FAILED',_0x6418('0x7'),_0x6418('0x7')];var channels={};function writeDB(_0x4240fd){var _0x4e7248;if(transfers[_0x6418('0x8')][_0x4240fd['uniqueid']]){_0x4e7248=_0x4240fd[_0x6418('0x9')];_0x4240fd[_0x6418('0x9')]=transfers[_0x6418('0x8')][_0x4240fd[_0x6418('0x9')]]['transfereeuniqueid'];}utils['info'](util[_0x6418('0xa')](_0x6418('0xb'),_0x4240fd[_0x6418('0x9')],_0x4240fd[_0x6418('0xc')],_0x4240fd['queue'],_0x4240fd[_0x6418('0xd')],_0x4240fd[_0x6418('0xe')],_0x4240fd[_0x6418('0xf')],_0x4240fd[_0x6418('0x10')],_0x4240fd[_0x6418('0x11')]));if(_0x4240fd['accountcode']){utils[_0x6418('0x12')](_0x4240fd[_0x6418('0x13')])[_0x6418('0x14')](function(_0x210828){if(_0x210828){_0x4240fd[_0x6418('0x15')]=_0x210828['id'];}utils[_0x6418('0x16')](_0x6418('0x17'),_0x4240fd);});}else{utils[_0x6418('0x16')]('CreateVoiceCallReport',_0x4240fd);}if(channels[_0x4240fd[_0x6418('0x9')]]){delete channels[_0x4240fd[_0x6418('0x9')]];}else if(_0x4e7248&&channels[_0x4e7248]){if(!transfers[_0x6418('0x8')][_0x4e7248][_0x6418('0x18')])delete transfers[_0x6418('0x8')][_0x4e7248];delete channels[_0x4e7248];}}exports[_0x6418('0x19')]=function(_0x128131){try{utils['debug'](util[_0x6418('0xa')](_0x6418('0x1a'),_0x128131[_0x6418('0x9')]),_0x128131);if(_0x128131[_0x6418('0x9')]==_0x128131[_0x6418('0x1b')]&&_0x128131[_0x6418('0xc')]!=_0x6418('0x1c')){utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x1e'),_0x128131[_0x6418('0x9')],_0x128131[_0x6418('0x1f')],_0x128131[_0x6418('0x20')]));channels[_0x128131['uniqueid']]={'uniqueid':_0x128131['uniqueid'],'accountcode':_0x128131[_0x6418('0x13')],'source':_0x128131[_0x6418('0xf')],'destination':_0x128131[_0x6418('0x20')],'destinationcontext':_0x128131[_0x6418('0x1f')],'channel':_0x128131[_0x6418('0xc')],'starttime':utils[_0x6418('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6418('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x333f01){utils['error'](util[_0x6418('0xa')](_0x6418('0x1a'),_0x128131['uniqueid']),_0x333f01);}};exports[_0x6418('0x22')]=function(_0x2690e9){try{utils[_0x6418('0x23')](util['format'](_0x6418('0x24'),_0x2690e9[_0x6418('0x9')]),_0x2690e9);if(!_[_0x6418('0x25')](channels[_0x2690e9[_0x6418('0x9')]])&&_0x2690e9['channelstate']==0x6){utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x26'),_0x2690e9[_0x6418('0x9')],_0x2690e9[_0x6418('0x1f')],_0x2690e9[_0x6418('0xc')]));if(_[_0x6418('0x25')](channels[_0x2690e9[_0x6418('0x9')]][_0x6418('0x27')])){channels[_0x2690e9[_0x6418('0x9')]][_0x6418('0x27')]=utils[_0x6418('0x21')]();}}else if(!_[_0x6418('0x25')](channels[_0x2690e9['linkedid']])&&_0x2690e9[_0x6418('0x28')]==0x6&&_0x2690e9[_0x6418('0x1f')]!=_0x6418('0x29')){utils[_0x6418('0x1d')](util[_0x6418('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2690e9[_0x6418('0x9')],_0x2690e9[_0x6418('0x1b')],_0x2690e9['context'],_0x2690e9[_0x6418('0xc')]));channels[_0x2690e9[_0x6418('0x1b')]][_0x6418('0x13')]=_0x2690e9['accountcode'];channels[_0x2690e9[_0x6418('0x1b')]][_0x6418('0x2a')]=_0x2690e9[_0x6418('0xc')];if(_['isNil'](channels[_0x2690e9[_0x6418('0x1b')]][_0x6418('0x2b')])){channels[_0x2690e9[_0x6418('0x1b')]][_0x6418('0x2b')]=utils[_0x6418('0x21')]();}channels[_0x2690e9['linkedid']][_0x6418('0x2c')]=dispositions[_[_0x6418('0x2d')](_0x2690e9['channelstate'])]||_0x6418('0x5');}}catch(_0x2f0f72){utils[_0x6418('0x2e')](util[_0x6418('0xa')](_0x6418('0x24'),_0x2690e9[_0x6418('0x9')]),_0x2f0f72);}};exports['hangup']=function(_0x25205d){try{if(!_['isNil'](channels[_0x25205d['uniqueid']])){utils[_0x6418('0x23')](util[_0x6418('0xa')](_0x6418('0x2f'),_0x25205d[_0x6418('0x9')]),_0x25205d);if(_[_0x6418('0x25')](channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x30')])){channels[_0x25205d['uniqueid']][_0x6418('0x30')]=_0x25205d[_0x6418('0x31')]+'\x20<'+_0x25205d[_0x6418('0xf')]+'>';}utils['info'](util[_0x6418('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x25205d[_0x6418('0x9')],channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x30')],_0x25205d[_0x6418('0x32')]));channels[_0x25205d[_0x6418('0x9')]]['endtime']=utils[_0x6418('0x21')]();channels[_0x25205d[_0x6418('0x9')]]['duration']=utils[_0x6418('0x33')](channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x34')],channels[_0x25205d['uniqueid']]['starttime']);channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x35')]=channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x2b')]?utils[_0x6418('0x33')](channels[_0x25205d['uniqueid']][_0x6418('0x34')],channels[_0x25205d[_0x6418('0x9')]][_0x6418('0x2b')]):0x0;writeDB(channels[_0x25205d[_0x6418('0x9')]]);}}catch(_0x33087e){utils[_0x6418('0x2e')](util[_0x6418('0xa')](_0x6418('0x2f'),_0x25205d[_0x6418('0x9')]),_0x33087e);}};exports[_0x6418('0x36')]=function(_0x2cda99){try{if(!_[_0x6418('0x25')](channels[_0x2cda99['localtwolinkedid']])){utils[_0x6418('0x23')](util['format'](_0x6418('0x37'),_0x2cda99[_0x6418('0x38')]),_0x2cda99);if(channels[_0x2cda99['localtwolinkedid']]['channel']==_0x2cda99[_0x6418('0x39')]){utils['info'](util['format'](_0x6418('0x3a'),_0x2cda99[_0x6418('0x38')],_0x2cda99[_0x6418('0x3b')],_0x2cda99[_0x6418('0x3c')]));channels[_0x2cda99[_0x6418('0x3b')]][_0x6418('0x2a')]=_0x2cda99['secondtransfererchannel'];channels[_0x2cda99[_0x6418('0x3b')]][_0x6418('0x3d')]=_0x6418('0x3e');}else if(channels[_0x2cda99[_0x6418('0x3b')]]['channel']=_0x2cda99[_0x6418('0x3f')]){utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x3a'),_0x2cda99[_0x6418('0x38')],_0x2cda99[_0x6418('0x3b')],_0x2cda99[_0x6418('0x40')]));channels[_0x2cda99[_0x6418('0x3b')]][_0x6418('0x2a')]=_0x2cda99[_0x6418('0x40')];channels[_0x2cda99['localtwolinkedid']][_0x6418('0x3d')]=_0x6418('0x3e');}}}catch(_0x4d34f6){utils[_0x6418('0x2e')](util[_0x6418('0xa')](_0x6418('0x37'),_0x2cda99['origtransfereruniqueid']),_0x4d34f6);}};exports['musiconholdstart']=function(_0x554f4c){try{if(!_[_0x6418('0x25')](channels[_0x554f4c[_0x6418('0x9')]])){utils[_0x6418('0x23')](util[_0x6418('0xa')](_0x6418('0x41'),_0x554f4c[_0x6418('0x9')]),_0x554f4c);channels[_0x554f4c[_0x6418('0x9')]][_0x6418('0x42')]=utils['now']();utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x43'),_0x554f4c['uniqueid'],channels[_0x554f4c[_0x6418('0x9')]][_0x6418('0x42')]));}}catch(_0x2cf67e){utils['error'](util[_0x6418('0xa')](_0x6418('0x41'),_0x554f4c[_0x6418('0x9')]),_0x2cf67e);}};exports[_0x6418('0x44')]=function(_0x343624){try{if(!_[_0x6418('0x25')](channels[_0x343624[_0x6418('0x9')]])){utils[_0x6418('0x23')](util[_0x6418('0xa')](_0x6418('0x45'),_0x343624[_0x6418('0x9')]),_0x343624);if(!_[_0x6418('0x25')](channels[_0x343624[_0x6418('0x9')]]['musiconholdstartAt'])){channels[_0x343624[_0x6418('0x9')]][_0x6418('0x46')]+=utils[_0x6418('0x33')](utils[_0x6418('0x21')](),channels[_0x343624['uniqueid']][_0x6418('0x42')]);utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x47'),_0x343624['uniqueid'],channels[_0x343624[_0x6418('0x9')]]['mohtime']));delete channels[_0x343624[_0x6418('0x9')]][_0x6418('0x42')];}}}catch(_0x4c7a94){utils['error'](util[_0x6418('0xa')]('[%s][calls][musiconholdstop]',_0x343624[_0x6418('0x9')]),_0x4c7a94);}};exports[_0x6418('0x48')]=function(_0xf48801){try{if(!_['isNil'](channels[_0xf48801[_0x6418('0x9')]])){utils[_0x6418('0x23')](util['format']('[%s][calls][varset]',_0xf48801['uniqueid']),_0xf48801);if(!_['isNil'](_0xf48801[_0x6418('0x49')][_0x6418('0x4a')])){utils['info'](util[_0x6418('0xa')](_0x6418('0x4b'),_0xf48801[_0x6418('0x9')],_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]][_0x6418('0x4d')]=_0xf48801['value'];}if(!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')][_0x6418('0x4e')])){utils[_0x6418('0x1d')](util['format'](_0x6418('0x4f'),_0xf48801[_0x6418('0x9')],_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]][_0x6418('0x50')]=_0xf48801[_0x6418('0x4c')];channels[_0xf48801['uniqueid']][_0x6418('0x30')]='\x22'+_0xf48801[_0x6418('0x4c')]+_0x6418('0x51')+_0xf48801['value']+'>';}if(!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')]['xmd-callerid-preview'])||!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')][_0x6418('0x52')])){utils['info'](util[_0x6418('0xa')](_0x6418('0x53'),_0xf48801['uniqueid'],!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')][_0x6418('0x54')])?'xmd-callerid-preview':'xmd-callerid',_0xf48801['value']));channels[_0xf48801['uniqueid']][_0x6418('0x30')]=_0xf48801[_0x6418('0x4c')];}if(!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')]['xmd-queue'])||!_['isNil'](_0xf48801[_0x6418('0x49')][_0x6418('0x55')])){utils[_0x6418('0x1d')](util[_0x6418('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xf48801['uniqueid'],!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')][_0x6418('0x56')])?_0x6418('0x56'):_0x6418('0x55'),_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]][_0x6418('0x57')]=_0x6418('0x58');channels[_0xf48801[_0x6418('0x9')]]['lastdata']=_0xf48801['value'];channels[_0xf48801['uniqueid']][_0x6418('0x59')]=!![];}if(!_['isNil'](_0xf48801['variable'][_0x6418('0x5a')])){utils['info'](util[_0x6418('0xa')](_0x6418('0x5b'),_0xf48801[_0x6418('0x9')],_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]][_0x6418('0x5c')]=_0xf48801[_0x6418('0x4c')];}if(!_['isNil'](_0xf48801['variable']['xmd-cdrtype'])){utils[_0x6418('0x1d')](util[_0x6418('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xf48801[_0x6418('0x9')],_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]][_0x6418('0x5d')]=_0xf48801[_0x6418('0x4c')];}if(!_[_0x6418('0x25')](_0xf48801['variable']['outboundrouteid'])){utils[_0x6418('0x1d')](util[_0x6418('0xa')](_0x6418('0x5e'),_0xf48801['uniqueid'],_0xf48801[_0x6418('0x4c')]));channels[_0xf48801[_0x6418('0x9')]]['routeid']=_0xf48801['value'];}if(!_[_0x6418('0x25')](_0xf48801[_0x6418('0x49')][_0x6418('0x5f')])){utils['info'](util[_0x6418('0xa')](_0x6418('0x60'),_0xf48801[_0x6418('0x9')],_0xf48801['value']));channels[_0xf48801['uniqueid']][_0x6418('0x5f')]=_0xf48801[_0x6418('0x4c')];}}}catch(_0x206ac1){utils[_0x6418('0x2e')](util[_0x6418('0xa')](_0x6418('0x61'),_0xf48801[_0x6418('0x9')]),_0x206ac1);}};exports[_0x6418('0x62')]=function(_0x45d908){try{if(!_[_0x6418('0x25')](channels[_0x45d908[_0x6418('0x9')]])){utils[_0x6418('0x23')](util[_0x6418('0xa')](_0x6418('0x63'),_0x45d908[_0x6418('0x9')]),_0x45d908);utils[_0x6418('0x1d')](util[_0x6418('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x45d908[_0x6418('0x9')],_0x45d908[_0x6418('0x64')],_0x45d908[_0x6418('0x65')]));if(_0x45d908[_0x6418('0x64')]['toLowerCase']()==_0x6418('0x66')&&_[_0x6418('0x67')](_0x45d908[_0x6418('0x65')]['toLowerCase'](),_0x6418('0x68'))){var _0x1adfbc=_0x45d908[_0x6418('0x65')]['split']('=');var _0x1f77f2=_0x1adfbc[0x0][_0x6418('0x69')](_0x1adfbc[0x0][_0x6418('0x6a')]('(')+0x1,_0x1adfbc[0x0][_0x6418('0x6a')](')'));var _0x870e3e=_0x1adfbc[0x1];channels[_0x45d908['uniqueid']][_0x1f77f2]=_0x870e3e;}if(!_[_0x6418('0x6b')](['hangup','noop',_0x6418('0x6c'),_0x6418('0x66'),_0x6418('0x6d')],_0x45d908['application'][_0x6418('0x6e')]())){channels[_0x45d908['uniqueid']][_0x6418('0x57')]=_0x45d908[_0x6418('0x64')];channels[_0x45d908[_0x6418('0x9')]][_0x6418('0x6f')]=_0x45d908[_0x6418('0x65')];}}}catch(_0x2a2100){utils[_0x6418('0x2e')](util['format'](_0x6418('0x63'),_0x45d908[_0x6418('0x9')]),_0x2a2100);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index dda83b4..cd719db 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 _0xdbb3=['[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x15b550,_0x4fa220){var _0x56ea20=function(_0xd11deb){while(--_0xd11deb){_0x15b550['push'](_0x15b550['shift']());}};_0x56ea20(++_0x4fa220);}(_0xdbb3,0x103));var _0x3dbb=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xdbb3[_0x40bffc];return _0x3007e9;};'use strict';var utils=require(_0x3dbb('0x0'));exports[_0x3dbb('0x1')]=function(){utils[_0x3dbb('0x2')](_0x3dbb('0x3'));};exports[_0x3dbb('0x4')]=function(){utils[_0x3dbb('0x2')](_0x3dbb('0x5'));};exports[_0x3dbb('0x6')]=function(){utils[_0x3dbb('0x2')]('[core]\x20fullybooted');};exports[_0x3dbb('0x7')]=function(_0x46d675){utils[_0x3dbb('0x7')](_0x3dbb('0x8'),_0x46d675);};exports[_0x3dbb('0x9')]=function(){utils[_0x3dbb('0x2')](_0x3dbb('0xa'));};exports[_0x3dbb('0xb')]=function(_0x1e3241){}; \ No newline at end of file +var _0xbdf3=['fullybooted','error','[core]\x20error','close','[core]\x20close','connect','info','shutdown','[core]\x20shutdown'];(function(_0x1c60ef,_0x51da79){var _0x5b6b80=function(_0x1df436){while(--_0x1df436){_0x1c60ef['push'](_0x1c60ef['shift']());}};_0x5b6b80(++_0x51da79);}(_0xbdf3,0x10a));var _0x3bdf=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xbdf3[_0x3eb713];return _0x1d7128;};'use strict';var utils=require('./utils');exports[_0x3bdf('0x0')]=function(){utils[_0x3bdf('0x1')]('[core]\x20connected');};exports[_0x3bdf('0x2')]=function(){utils['info'](_0x3bdf('0x3'));};exports[_0x3bdf('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0x3bdf('0x5')]=function(_0x341b77){utils[_0x3bdf('0x5')](_0x3bdf('0x6'),_0x341b77);};exports[_0x3bdf('0x7')]=function(){utils['info'](_0x3bdf('0x8'));};exports['managerevent']=function(_0x2bd6d6){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ae09fd7..364a4c0 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 _0x839e=['holdtime','billableseconds','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','[%s][dials][newexten]','format','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','debug','[%s][dials][varset]','isNil','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime'];(function(_0x2488e2,_0x401e50){var _0x618395=function(_0x556fb5){while(--_0x556fb5){_0x2488e2['push'](_0x2488e2['shift']());}};_0x618395(++_0x401e50);}(_0x839e,0x18a));var _0xe839=function(_0x3c5433,_0x515ff7){_0x3c5433=_0x3c5433-0x0;var _0x425f26=_0x839e[_0x3c5433];return _0x425f26;};'use strict';var _=require(_0xe839('0x0'));var util=require(_0xe839('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x22bbba){utils[_0xe839('0x2')](util['format'](_0xe839('0x3'),_0x22bbba[_0xe839('0x4')],_0x22bbba[_0xe839('0x5')],_0x22bbba['dialstring'],_0x22bbba[_0xe839('0x6')],_0x22bbba[_0xe839('0x7')],_0x22bbba[_0xe839('0x8')]));utils['request'](_0xe839('0x9'),_0x22bbba);delete dials[_0x22bbba['uniqueid']];}exports[_0xe839('0xa')]=function(_0x4469f5){try{utils['debug'](util['format'](_0xe839('0xb'),_0x4469f5[_0xe839('0x4')]),_0x4469f5);utils[_0xe839('0x2')](util[_0xe839('0xc')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4469f5[_0xe839('0x4')],_0x4469f5['application'],_0x4469f5[_0xe839('0xd')]));if(_0x4469f5[_0xe839('0xe')][_0xe839('0xf')]()==_0xe839('0x10')&&_[_0xe839('0x11')](_0x4469f5[_0xe839('0xd')]['toLowerCase'](),_0xe839('0x12'))){var _0x483760=_0x4469f5[_0xe839('0xd')]['split']('=');dials[_0x4469f5[_0xe839('0x4')]]={'routeId':_0x483760[0x1]};}}catch(_0x47aaa3){utils['error'](util['format'](_0xe839('0xb'),_0x4469f5[_0xe839('0x4')]),_0x47aaa3);}};exports['varset']=function(_0xb2f662){try{utils[_0xe839('0x13')](util['format'](_0xe839('0x14'),_0xb2f662['uniqueid']),_0xb2f662);if(!_[_0xe839('0x15')](_0xb2f662['variable']['outboundrouteid'])){utils[_0xe839('0x2')](util['format'](_0xe839('0x16'),_0xb2f662[_0xe839('0x4')],_0xb2f662[_0xe839('0x17')]));dials[_0xb2f662['uniqueid']]={'routeId':_0xb2f662['value']};}}catch(_0x44fc37){utils[_0xe839('0x18')](util[_0xe839('0xc')](_0xe839('0x14'),_0xb2f662['uniqueid']),_0x44fc37);}};exports[_0xe839('0x19')]=function(_0x46a748){try{if(!_[_0xe839('0x15')](dials[_0x46a748[_0xe839('0x4')]])){utils[_0xe839('0x13')](util[_0xe839('0xc')](_0xe839('0x1a'),_0x46a748['uniqueid']),_0x46a748);dials[_0x46a748['uniqueid']]=_[_0xe839('0x1b')](dials[_0x46a748[_0xe839('0x4')]],_0x46a748);dials[_0x46a748[_0xe839('0x4')]][_0xe839('0x1c')]=utils[_0xe839('0x1d')]();dials[_0x46a748[_0xe839('0x4')]][_0xe839('0x1e')]=_0xe839('0x1f');utils[_0xe839('0x2')](util['format'](_0xe839('0x20'),_0x46a748['uniqueid'],dials[_0x46a748['uniqueid']][_0xe839('0x1c')]));}}catch(_0x3251b3){utils[_0xe839('0x18')](util['format'](_0xe839('0x1a'),_0x46a748[_0xe839('0x4')]),_0x3251b3);}};exports[_0xe839('0x21')]=function(_0x264665){try{if(!_[_0xe839('0x15')](dials[_0x264665[_0xe839('0x4')]])){utils['debug'](util['format'](_0xe839('0x22'),_0x264665[_0xe839('0x4')]),_0x264665);dials[_0x264665[_0xe839('0x4')]][_0xe839('0x8')]=_0x264665[_0xe839('0x8')];if(_0x264665[_0xe839('0x8')]==_0xe839('0x23')){dials[_0x264665[_0xe839('0x4')]]=_['assign'](dials[_0x264665[_0xe839('0x4')]],_0x264665);dials[_0x264665[_0xe839('0x4')]][_0xe839('0x24')]=utils[_0xe839('0x1d')]();dials[_0x264665['uniqueid']]['lastevent']='connect';utils[_0xe839('0x2')](util['format'](_0xe839('0x25'),_0x264665[_0xe839('0x4')],_0x264665['dialstatus'],dials[_0x264665[_0xe839('0x4')]]['answertime']));}else{utils[_0xe839('0x2')](util[_0xe839('0xc')](_0xe839('0x26'),_0x264665['uniqueid'],_0x264665[_0xe839('0x8')]));}}}catch(_0x4af159){utils[_0xe839('0x18')](util[_0xe839('0xc')](_0xe839('0x22'),_0x264665[_0xe839('0x4')]),_0x4af159);}};exports[_0xe839('0x27')]=function(_0x250a6c){try{if(!_[_0xe839('0x15')](dials[_0x250a6c[_0xe839('0x4')]])){utils[_0xe839('0x13')](util['format'](_0xe839('0x28'),_0x250a6c['uniqueid']),_0x250a6c);utils[_0xe839('0x2')](util[_0xe839('0xc')](_0xe839('0x29'),_0x250a6c[_0xe839('0x4')],_0x250a6c[_0xe839('0x6')],_0x250a6c[_0xe839('0x2a')],_0x250a6c[_0xe839('0x2b')]));dials[_0x250a6c[_0xe839('0x4')]]=_[_0xe839('0x1b')](dials[_0x250a6c[_0xe839('0x4')]],{'endtime':utils[_0xe839('0x1d')](),'lastevent':_0xe839('0x2c')});dials[_0x250a6c[_0xe839('0x4')]]['duration']=utils[_0xe839('0x2d')](dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x2e')],dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x1c')]);dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x2f')]=utils['diffTime'](dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x24')]||dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x2e')],dials[_0x250a6c['uniqueid']][_0xe839('0x1c')]);dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x30')]=dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x24')]?utils[_0xe839('0x2d')](dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x2e')],dials[_0x250a6c[_0xe839('0x4')]][_0xe839('0x24')]):0x0;writeDB(dials[_0x250a6c[_0xe839('0x4')]]);}}catch(_0x15a6b6){utils['error'](util[_0xe839('0xc')]('[%s][dials][hangup]',_0x250a6c[_0xe839('0x4')]),_0x15a6b6);}}; \ No newline at end of file +var _0xfbca=['isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','assign','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','holdtime','diffTime','billableseconds','lodash','./utils','info','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error'];(function(_0x568d69,_0x4354b9){var _0x457f93=function(_0x3b773d){while(--_0x3b773d){_0x568d69['push'](_0x568d69['shift']());}};_0x457f93(++_0x4354b9);}(_0xfbca,0x1ab));var _0xafbc=function(_0x510c92,_0x593cdf){_0x510c92=_0x510c92-0x0;var _0x586a3c=_0xfbca[_0x510c92];return _0x586a3c;};'use strict';var _=require(_0xafbc('0x0'));var util=require('util');var utils=require(_0xafbc('0x1'));var dials={};function writeDB(_0x1fd7e5){utils[_0xafbc('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1fd7e5[_0xafbc('0x3')],_0x1fd7e5[_0xafbc('0x4')],_0x1fd7e5['dialstring'],_0x1fd7e5[_0xafbc('0x5')],_0x1fd7e5[_0xafbc('0x6')],_0x1fd7e5[_0xafbc('0x7')]));utils[_0xafbc('0x8')](_0xafbc('0x9'),_0x1fd7e5);delete dials[_0x1fd7e5[_0xafbc('0x3')]];}exports[_0xafbc('0xa')]=function(_0x592761){try{utils[_0xafbc('0xb')](util[_0xafbc('0xc')](_0xafbc('0xd'),_0x592761[_0xafbc('0x3')]),_0x592761);utils[_0xafbc('0x2')](util[_0xafbc('0xc')](_0xafbc('0xe'),_0x592761['uniqueid'],_0x592761[_0xafbc('0xf')],_0x592761['appdata']));if(_0x592761[_0xafbc('0xf')][_0xafbc('0x10')]()==_0xafbc('0x11')&&_[_0xafbc('0x12')](_0x592761[_0xafbc('0x13')][_0xafbc('0x10')](),_0xafbc('0x14'))){var _0x21f8dd=_0x592761[_0xafbc('0x13')][_0xafbc('0x15')]('=');dials[_0x592761[_0xafbc('0x3')]]={'routeId':_0x21f8dd[0x1]};}}catch(_0x3541da){utils[_0xafbc('0x16')](util[_0xafbc('0xc')](_0xafbc('0xd'),_0x592761[_0xafbc('0x3')]),_0x3541da);}};exports['varset']=function(_0x3868f8){try{utils[_0xafbc('0xb')](util[_0xafbc('0xc')]('[%s][dials][varset]',_0x3868f8[_0xafbc('0x3')]),_0x3868f8);if(!_[_0xafbc('0x17')](_0x3868f8[_0xafbc('0x18')][_0xafbc('0x19')])){utils[_0xafbc('0x2')](util[_0xafbc('0xc')](_0xafbc('0x1a'),_0x3868f8['uniqueid'],_0x3868f8[_0xafbc('0x1b')]));dials[_0x3868f8[_0xafbc('0x3')]]={'routeId':_0x3868f8[_0xafbc('0x1b')]};}}catch(_0xb9b66){utils[_0xafbc('0x16')](util[_0xafbc('0xc')](_0xafbc('0x1c'),_0x3868f8[_0xafbc('0x3')]),_0xb9b66);}};exports[_0xafbc('0x1d')]=function(_0x23cc7f){try{if(!_[_0xafbc('0x17')](dials[_0x23cc7f['uniqueid']])){utils[_0xafbc('0xb')](util[_0xafbc('0xc')](_0xafbc('0x1e'),_0x23cc7f[_0xafbc('0x3')]),_0x23cc7f);dials[_0x23cc7f[_0xafbc('0x3')]]=_['assign'](dials[_0x23cc7f[_0xafbc('0x3')]],_0x23cc7f);dials[_0x23cc7f[_0xafbc('0x3')]][_0xafbc('0x1f')]=utils[_0xafbc('0x20')]();dials[_0x23cc7f['uniqueid']][_0xafbc('0x21')]='called';utils[_0xafbc('0x2')](util[_0xafbc('0xc')](_0xafbc('0x22'),_0x23cc7f[_0xafbc('0x3')],dials[_0x23cc7f['uniqueid']][_0xafbc('0x1f')]));}}catch(_0x4f2fad){utils['error'](util[_0xafbc('0xc')](_0xafbc('0x1e'),_0x23cc7f[_0xafbc('0x3')]),_0x4f2fad);}};exports['dialend']=function(_0x16ec58){try{if(!_[_0xafbc('0x17')](dials[_0x16ec58[_0xafbc('0x3')]])){utils[_0xafbc('0xb')](util['format'](_0xafbc('0x23'),_0x16ec58['uniqueid']),_0x16ec58);dials[_0x16ec58['uniqueid']][_0xafbc('0x7')]=_0x16ec58[_0xafbc('0x7')];if(_0x16ec58[_0xafbc('0x7')]==_0xafbc('0x24')){dials[_0x16ec58[_0xafbc('0x3')]]=_[_0xafbc('0x25')](dials[_0x16ec58['uniqueid']],_0x16ec58);dials[_0x16ec58[_0xafbc('0x3')]]['answertime']=utils[_0xafbc('0x20')]();dials[_0x16ec58[_0xafbc('0x3')]][_0xafbc('0x21')]='connect';utils[_0xafbc('0x2')](util[_0xafbc('0xc')](_0xafbc('0x26'),_0x16ec58['uniqueid'],_0x16ec58[_0xafbc('0x7')],dials[_0x16ec58[_0xafbc('0x3')]][_0xafbc('0x27')]));}else{utils[_0xafbc('0x2')](util[_0xafbc('0xc')]('[%s][dials][dialend]\x20dialstatus:%s',_0x16ec58['uniqueid'],_0x16ec58['dialstatus']));}}}catch(_0xd90488){utils[_0xafbc('0x16')](util[_0xafbc('0xc')](_0xafbc('0x23'),_0x16ec58[_0xafbc('0x3')]),_0xd90488);}};exports[_0xafbc('0x28')]=function(_0x5efa71){try{if(!_[_0xafbc('0x17')](dials[_0x5efa71[_0xafbc('0x3')]])){utils[_0xafbc('0xb')](util[_0xafbc('0xc')](_0xafbc('0x29'),_0x5efa71[_0xafbc('0x3')]),_0x5efa71);utils[_0xafbc('0x2')](util[_0xafbc('0xc')](_0xafbc('0x2a'),_0x5efa71[_0xafbc('0x3')],_0x5efa71[_0xafbc('0x5')],_0x5efa71[_0xafbc('0x2b')],_0x5efa71[_0xafbc('0x2c')]));dials[_0x5efa71['uniqueid']]=_['assign'](dials[_0x5efa71['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xafbc('0x2d')});dials[_0x5efa71[_0xafbc('0x3')]]['duration']=utils['diffTime'](dials[_0x5efa71['uniqueid']][_0xafbc('0x2e')],dials[_0x5efa71[_0xafbc('0x3')]][_0xafbc('0x1f')]);dials[_0x5efa71[_0xafbc('0x3')]][_0xafbc('0x2f')]=utils[_0xafbc('0x30')](dials[_0x5efa71['uniqueid']]['answertime']||dials[_0x5efa71['uniqueid']]['endtime'],dials[_0x5efa71[_0xafbc('0x3')]]['starttime']);dials[_0x5efa71[_0xafbc('0x3')]][_0xafbc('0x31')]=dials[_0x5efa71['uniqueid']][_0xafbc('0x27')]?utils['diffTime'](dials[_0x5efa71[_0xafbc('0x3')]][_0xafbc('0x2e')],dials[_0x5efa71[_0xafbc('0x3')]][_0xafbc('0x27')]):0x0;writeDB(dials[_0x5efa71['uniqueid']]);}}catch(_0x247256){utils['error'](util[_0xafbc('0xc')](_0xafbc('0x29'),_0x5efa71[_0xafbc('0x3')]),_0x247256);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 277c039..cb31e8c 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 _0xed9c=['./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','username','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller'];(function(_0x54e15a,_0x2b9095){var _0x91df56=function(_0x2c25ae){while(--_0x2c25ae){_0x54e15a['push'](_0x54e15a['shift']());}};_0x91df56(++_0x2b9095);}(_0xed9c,0x1dc));var _0xced9=function(_0xd01389,_0x46e5b2){_0xd01389=_0xd01389-0x0;var _0x1ef5c0=_0xed9c[_0xd01389];return _0x1ef5c0;};var AsteriskManager=require(_0xced9('0x0'));var config=require(_0xced9('0x1'));var utils=require('./utils');var util=require(_0xced9('0x2'));var ami=new AsteriskManager(config[_0xced9('0x3')][_0xced9('0x4')],config['asterisk']['ip'],config[_0xced9('0x3')][_0xced9('0x5')],config[_0xced9('0x3')]['password'],!![]);ami[_0xced9('0x6')]();if(config[_0xced9('0x7')]&&config[_0xced9('0x7')][_0xced9('0x8')]){utils['info'](_0xced9('0x9'));}else{var agents=require(_0xced9('0xa'));var calls=require(_0xced9('0xb'));var queues=require(_0xced9('0xc'));var recordings=require(_0xced9('0xd'));var members=require(_0xced9('0xe'));var dials=require(_0xced9('0xf'));var transfers=require(_0xced9('0x10'));var core=require(_0xced9('0x11'));ami['on'](_0xced9('0x12'),core[_0xced9('0x12')]);ami['on'](_0xced9('0x13'),core[_0xced9('0x13')]);ami['on']('fullybooted',core[_0xced9('0x14')]);ami['on'](_0xced9('0x15'),core[_0xced9('0x15')]);ami['on']('close',core[_0xced9('0x16')]);ami['on']('managerevent',core[_0xced9('0x17')]);ami['on']('devicestatechange',function(_0x59e758){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x1a'),_0x59e758[_0xced9('0x1b')]),_0x59e758);members[_0xced9('0x1c')](_0x59e758);}catch(_0x5efa19){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x1a'),_0x59e758[_0xced9('0x1b')]),_0x5efa19);}});ami['on']('agentcalled',function(_0x56c121){try{utils['debug'](util[_0xced9('0x19')]('[%s][index][agentcalled]',_0x56c121[_0xced9('0x1d')]),_0x56c121);agents[_0xced9('0x1e')](_0x56c121);}catch(_0x4aa388){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x1f'),_0x56c121[_0xced9('0x1d')]),_0x4aa388);}});ami['on']('agentringnoanswer',function(_0x1978ef){try{utils['debug'](util[_0xced9('0x19')]('[%s][index][agentringnoanswer]',_0x1978ef[_0xced9('0x1d')]),_0x1978ef);agents[_0xced9('0x20')](_0x1978ef);}catch(_0x3860d6){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x21'),_0x1978ef[_0xced9('0x1d')]),_0x3860d6);}});ami['on'](_0xced9('0x22'),function(_0x2575dc){try{utils['debug'](util[_0xced9('0x19')](_0xced9('0x23'),_0x2575dc[_0xced9('0x1d')]),_0x2575dc);agents[_0xced9('0x22')](_0x2575dc);queues[_0xced9('0x22')](_0x2575dc);}catch(_0x5ba009){utils['error'](util[_0xced9('0x19')]('[%s][index][agentconnect]',_0x2575dc[_0xced9('0x1d')]),_0x5ba009);}});ami['on'](_0xced9('0x24'),function(_0x577556){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x25'),_0x577556['uniqueid']),_0x577556);agents['agentcomplete'](_0x577556);queues[_0xced9('0x24')](_0x577556);members[_0xced9('0x24')](_0x577556);}catch(_0x3d2374){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x25'),_0x577556[_0xced9('0x1d')]),_0x3d2374);}});ami['on'](_0xced9('0x26'),function(_0x52663f){try{utils['debug'](util['format'](_0xced9('0x27'),_0x52663f[_0xced9('0x1d')]),_0x52663f);agents['queuecallerabandon'](_0x52663f);queues['queuecallerabandon'](_0x52663f);}catch(_0x3c7b4f){utils['error'](util[_0xced9('0x19')](_0xced9('0x27'),_0x52663f[_0xced9('0x1d')]),_0x3c7b4f);}});ami['on'](_0xced9('0x28'),function(_0x265ddd){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x29'),_0x265ddd[_0xced9('0x1d')]),_0x265ddd);queues[_0xced9('0x28')](_0x265ddd);recordings[_0xced9('0x28')](_0x265ddd);}catch(_0x1330f6){utils[_0xced9('0x15')](util[_0xced9('0x19')]('[%s][index][queuecallerjoin]',_0x265ddd[_0xced9('0x1d')]),_0x1330f6);}});ami['on'](_0xced9('0x2a'),function(_0x3393bb){try{utils[_0xced9('0x18')](util['format'](_0xced9('0x2b'),_0x3393bb[_0xced9('0x1d')]),_0x3393bb);queues['queuecallerleave'](_0x3393bb);}catch(_0x3b5ac3){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x3393bb[_0xced9('0x1d')]),_0x3b5ac3);}});ami['on'](_0xced9('0x2c'),function(_0x1f0605){try{utils[_0xced9('0x18')](util['format'](_0xced9('0x2d'),_0x1f0605['uniqueid']),_0x1f0605);queues[_0xced9('0x2c')](_0x1f0605);calls[_0xced9('0x2c')](_0x1f0605);}catch(_0x409636){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x2d'),_0x1f0605[_0xced9('0x1d')]),_0x409636);}});ami['on'](_0xced9('0x2e'),function(_0x522356){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x2f'),_0x522356[_0xced9('0x1d')]),_0x522356);queues[_0xced9('0x2e')](_0x522356);calls[_0xced9('0x2e')](_0x522356);}catch(_0x40fbe4){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x2f'),_0x522356['uniqueid']),_0x40fbe4);}});ami['on']('newstate',function(_0xacbbb5){try{utils['debug'](util[_0xced9('0x19')]('[%s][index][newstate]',_0xacbbb5[_0xced9('0x1d')]),_0xacbbb5);calls[_0xced9('0x30')](_0xacbbb5);recordings[_0xced9('0x30')](_0xacbbb5);}catch(_0x55a74f){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x31'),_0xacbbb5['uniqueid']),_0x55a74f);}});ami['on'](_0xced9('0x32'),function(_0x5829f1){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x33'),_0x5829f1[_0xced9('0x1d')]),_0x5829f1);calls[_0xced9('0x32')](_0x5829f1);recordings['hangup'](_0x5829f1);dials[_0xced9('0x32')](_0x5829f1);agents['hangup'](_0x5829f1);queues['hangup'](_0x5829f1);}catch(_0x2d8632){utils[_0xced9('0x15')](util['format'](_0xced9('0x33'),_0x5829f1[_0xced9('0x1d')]),_0x2d8632);}});ami['on'](_0xced9('0x34'),function(_0x3cf1be){try{utils[_0xced9('0x18')](util['format'](_0xced9('0x35'),_0x3cf1be[_0xced9('0x1d')]),_0x3cf1be);members[_0xced9('0x34')](_0x3cf1be);}catch(_0x26a04f){utils[_0xced9('0x15')](util['format'](_0xced9('0x35'),_0x3cf1be[_0xced9('0x1d')]),_0x26a04f);}});ami['on']('blindtransfer',function(_0x5a281f){try{utils[_0xced9('0x18')](util['format'](_0xced9('0x36'),_0x5a281f[_0xced9('0x1d')]),_0x5a281f);queues[_0xced9('0x37')](_0x5a281f);agents[_0xced9('0x37')](_0x5a281f);transfers[_0xced9('0x37')](_0x5a281f);recordings['blindtransfer'](_0x5a281f);}catch(_0x3f663d){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x36'),_0x5a281f[_0xced9('0x1d')]),_0x3f663d);}});ami['on'](_0xced9('0x38'),function(_0x1fbf86){try{utils['debug'](util['format'](_0xced9('0x39'),_0x1fbf86[_0xced9('0x3a')]),_0x1fbf86);queues[_0xced9('0x38')](_0x1fbf86);transfers[_0xced9('0x38')](_0x1fbf86);agents[_0xced9('0x38')](_0x1fbf86);calls['attendedtransfer'](_0x1fbf86);}catch(_0x2a109b){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x1fbf86[_0xced9('0x3a')]),_0x2a109b);}});ami['on'](_0xced9('0x3b'),function(_0x3a3736){try{utils[_0xced9('0x18')](util[_0xced9('0x19')]('[%s][index][varset]',_0x3a3736[_0xced9('0x1d')]),_0x3a3736);queues[_0xced9('0x3b')](_0x3a3736);recordings[_0xced9('0x3b')](_0x3a3736);calls[_0xced9('0x3b')](_0x3a3736);dials[_0xced9('0x3b')](_0x3a3736);}catch(_0x10e246){utils['error'](util['format'](_0xced9('0x3c'),_0x3a3736[_0xced9('0x1d')]),_0x10e246);}});ami['on'](_0xced9('0x3d'),function(_0x58f1f4){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x3e'),_0x58f1f4[_0xced9('0x1d')]),_0x58f1f4);calls[_0xced9('0x3d')](_0x58f1f4);recordings['newexten'](_0x58f1f4);dials['newexten'](_0x58f1f4);}catch(_0x5d7233){utils[_0xced9('0x15')](util[_0xced9('0x19')](_0xced9('0x3e'),_0x58f1f4[_0xced9('0x1d')]),_0x5d7233);}});ami['on'](_0xced9('0x3f'),function(_0x359189){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x40'),_0x359189[_0xced9('0x1d')]),_0x359189);calls[_0xced9('0x3f')](_0x359189);recordings[_0xced9('0x3f')](_0x359189);}catch(_0x4805e6){utils[_0xced9('0x15')](util[_0xced9('0x19')]('[%s][index][newchannel]',_0x359189[_0xced9('0x1d')]),_0x4805e6);}});ami['on'](_0xced9('0x41'),function(_0x387d95){try{utils['debug'](util[_0xced9('0x19')](_0xced9('0x42'),_0x387d95[_0xced9('0x1d')]),_0x387d95);dials[_0xced9('0x41')](_0x387d95);}catch(_0x501e3e){utils['error'](util[_0xced9('0x19')](_0xced9('0x43'),_0x387d95[_0xced9('0x1d')]),_0x501e3e);}});ami['on'](_0xced9('0x44'),function(_0x157f44){try{utils[_0xced9('0x18')](util[_0xced9('0x19')](_0xced9('0x45'),_0x157f44[_0xced9('0x1d')]),_0x157f44);dials[_0xced9('0x44')](_0x157f44);}catch(_0x23a2ff){utils[_0xced9('0x15')](util['format']('[%s][index][dialend]',_0x157f44[_0xced9('0x1d')]),_0x23a2ff);}});} \ No newline at end of file +var _0xf1ee=['[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format'];(function(_0x7a2a38,_0x40155f){var _0x380a5f=function(_0xb2a4b4){while(--_0xb2a4b4){_0x7a2a38['push'](_0x7a2a38['shift']());}};_0x380a5f(++_0x40155f);}(_0xf1ee,0xab));var _0xef1e=function(_0x5322e3,_0x2b24dd){_0x5322e3=_0x5322e3-0x0;var _0x5212fe=_0xf1ee[_0x5322e3];return _0x5212fe;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0xef1e('0x0'));var util=require('util');var ami=new AsteriskManager(config[_0xef1e('0x1')]['port'],config[_0xef1e('0x1')]['ip'],config[_0xef1e('0x1')][_0xef1e('0x2')],config[_0xef1e('0x1')][_0xef1e('0x3')],!![]);ami[_0xef1e('0x4')]();if(config[_0xef1e('0x5')]&&config[_0xef1e('0x5')][_0xef1e('0x6')]){utils[_0xef1e('0x7')](_0xef1e('0x8'));}else{var agents=require(_0xef1e('0x9'));var calls=require(_0xef1e('0xa'));var queues=require('./queues.controller');var recordings=require(_0xef1e('0xb'));var members=require(_0xef1e('0xc'));var dials=require(_0xef1e('0xd'));var transfers=require(_0xef1e('0xe'));var core=require(_0xef1e('0xf'));ami['on']('connect',core[_0xef1e('0x10')]);ami['on'](_0xef1e('0x11'),core[_0xef1e('0x11')]);ami['on']('fullybooted',core[_0xef1e('0x12')]);ami['on'](_0xef1e('0x13'),core[_0xef1e('0x13')]);ami['on'](_0xef1e('0x14'),core[_0xef1e('0x14')]);ami['on'](_0xef1e('0x15'),core['managerevent']);ami['on']('devicestatechange',function(_0x4a82e9){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x18'),_0x4a82e9[_0xef1e('0x19')]),_0x4a82e9);members['devicestatechange'](_0x4a82e9);}catch(_0x4928d1){utils['error'](util[_0xef1e('0x17')](_0xef1e('0x18'),_0x4a82e9[_0xef1e('0x19')]),_0x4928d1);}});ami['on'](_0xef1e('0x1a'),function(_0x38d24a){try{utils[_0xef1e('0x16')](util['format'](_0xef1e('0x1b'),_0x38d24a[_0xef1e('0x1c')]),_0x38d24a);agents[_0xef1e('0x1a')](_0x38d24a);}catch(_0x4ae8bd){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x1b'),_0x38d24a['uniqueid']),_0x4ae8bd);}});ami['on'](_0xef1e('0x1d'),function(_0x3b8a83){try{utils['debug'](util[_0xef1e('0x17')](_0xef1e('0x1e'),_0x3b8a83[_0xef1e('0x1c')]),_0x3b8a83);agents[_0xef1e('0x1d')](_0x3b8a83);}catch(_0x4d3191){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x1e'),_0x3b8a83[_0xef1e('0x1c')]),_0x4d3191);}});ami['on']('agentconnect',function(_0x2ae129){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x1f'),_0x2ae129[_0xef1e('0x1c')]),_0x2ae129);agents['agentconnect'](_0x2ae129);queues[_0xef1e('0x20')](_0x2ae129);}catch(_0xe42944){utils[_0xef1e('0x13')](util['format'](_0xef1e('0x1f'),_0x2ae129[_0xef1e('0x1c')]),_0xe42944);}});ami['on'](_0xef1e('0x21'),function(_0x257a35){try{utils[_0xef1e('0x16')](util['format'](_0xef1e('0x22'),_0x257a35[_0xef1e('0x1c')]),_0x257a35);agents[_0xef1e('0x21')](_0x257a35);queues[_0xef1e('0x21')](_0x257a35);members['agentcomplete'](_0x257a35);}catch(_0x424ed4){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x22'),_0x257a35[_0xef1e('0x1c')]),_0x424ed4);}});ami['on']('queuecallerabandon',function(_0x39d68a){try{utils['debug'](util['format'](_0xef1e('0x23'),_0x39d68a['uniqueid']),_0x39d68a);agents[_0xef1e('0x24')](_0x39d68a);queues[_0xef1e('0x24')](_0x39d68a);}catch(_0xeba24b){utils[_0xef1e('0x13')](util['format'](_0xef1e('0x23'),_0x39d68a[_0xef1e('0x1c')]),_0xeba24b);}});ami['on'](_0xef1e('0x25'),function(_0x5567d1){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x26'),_0x5567d1[_0xef1e('0x1c')]),_0x5567d1);queues['queuecallerjoin'](_0x5567d1);recordings['queuecallerjoin'](_0x5567d1);}catch(_0x1d8bbd){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x26'),_0x5567d1[_0xef1e('0x1c')]),_0x1d8bbd);}});ami['on'](_0xef1e('0x27'),function(_0x494619){try{utils[_0xef1e('0x16')](util['format'](_0xef1e('0x28'),_0x494619[_0xef1e('0x1c')]),_0x494619);queues[_0xef1e('0x27')](_0x494619);}catch(_0x2421ae){utils['error'](util[_0xef1e('0x17')]('[%s][index][queuecallerleave]',_0x494619['uniqueid']),_0x2421ae);}});ami['on'](_0xef1e('0x29'),function(_0x170786){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x2a'),_0x170786['uniqueid']),_0x170786);queues[_0xef1e('0x29')](_0x170786);calls[_0xef1e('0x29')](_0x170786);}catch(_0x383074){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x2a'),_0x170786[_0xef1e('0x1c')]),_0x383074);}});ami['on']('musiconholdstop',function(_0x2c1749){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x2b'),_0x2c1749[_0xef1e('0x1c')]),_0x2c1749);queues[_0xef1e('0x2c')](_0x2c1749);calls[_0xef1e('0x2c')](_0x2c1749);}catch(_0x2ece8a){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x2b'),_0x2c1749[_0xef1e('0x1c')]),_0x2ece8a);}});ami['on']('newstate',function(_0x185669){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x2d'),_0x185669[_0xef1e('0x1c')]),_0x185669);calls['newstate'](_0x185669);recordings['newstate'](_0x185669);}catch(_0x15b08e){utils[_0xef1e('0x13')](util['format']('[%s][index][newstate]',_0x185669[_0xef1e('0x1c')]),_0x15b08e);}});ami['on'](_0xef1e('0x2e'),function(_0x50c133){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x2f'),_0x50c133['uniqueid']),_0x50c133);calls[_0xef1e('0x2e')](_0x50c133);recordings['hangup'](_0x50c133);dials[_0xef1e('0x2e')](_0x50c133);agents[_0xef1e('0x2e')](_0x50c133);queues['hangup'](_0x50c133);}catch(_0x40231f){utils[_0xef1e('0x13')](util[_0xef1e('0x17')]('[%s][index][hangup]',_0x50c133[_0xef1e('0x1c')]),_0x40231f);}});ami['on'](_0xef1e('0x30'),function(_0x20068f){try{utils['debug'](util['format']('[%s][index][cdr]',_0x20068f[_0xef1e('0x1c')]),_0x20068f);members[_0xef1e('0x30')](_0x20068f);}catch(_0x64170f){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x31'),_0x20068f['uniqueid']),_0x64170f);}});ami['on'](_0xef1e('0x32'),function(_0x1246cd){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x33'),_0x1246cd[_0xef1e('0x1c')]),_0x1246cd);queues[_0xef1e('0x32')](_0x1246cd);agents['blindtransfer'](_0x1246cd);transfers['blindtransfer'](_0x1246cd);recordings[_0xef1e('0x32')](_0x1246cd);}catch(_0x212b68){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x33'),_0x1246cd[_0xef1e('0x1c')]),_0x212b68);}});ami['on'](_0xef1e('0x34'),function(_0x2d9a21){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')](_0xef1e('0x35'),_0x2d9a21[_0xef1e('0x36')]),_0x2d9a21);queues[_0xef1e('0x34')](_0x2d9a21);transfers[_0xef1e('0x34')](_0x2d9a21);agents[_0xef1e('0x34')](_0x2d9a21);calls['attendedtransfer'](_0x2d9a21);}catch(_0x123603){utils[_0xef1e('0x13')](util[_0xef1e('0x17')]('[%s][index][attendedtransfer]',_0x2d9a21[_0xef1e('0x36')]),_0x123603);}});ami['on'](_0xef1e('0x37'),function(_0x17a804){try{utils[_0xef1e('0x16')](util['format'](_0xef1e('0x38'),_0x17a804[_0xef1e('0x1c')]),_0x17a804);queues[_0xef1e('0x37')](_0x17a804);recordings[_0xef1e('0x37')](_0x17a804);calls['varset'](_0x17a804);dials[_0xef1e('0x37')](_0x17a804);}catch(_0x47feda){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x38'),_0x17a804[_0xef1e('0x1c')]),_0x47feda);}});ami['on'](_0xef1e('0x39'),function(_0x5f16d0){try{utils['debug'](util[_0xef1e('0x17')]('[%s][index][newexten]',_0x5f16d0[_0xef1e('0x1c')]),_0x5f16d0);calls['newexten'](_0x5f16d0);recordings['newexten'](_0x5f16d0);dials[_0xef1e('0x39')](_0x5f16d0);}catch(_0x3f8bb9){utils[_0xef1e('0x13')](util[_0xef1e('0x17')](_0xef1e('0x3a'),_0x5f16d0[_0xef1e('0x1c')]),_0x3f8bb9);}});ami['on'](_0xef1e('0x3b'),function(_0x37e698){try{utils['debug'](util[_0xef1e('0x17')]('[%s][index][newchannel]',_0x37e698[_0xef1e('0x1c')]),_0x37e698);calls[_0xef1e('0x3b')](_0x37e698);recordings[_0xef1e('0x3b')](_0x37e698);}catch(_0x22d7cc){utils['error'](util[_0xef1e('0x17')](_0xef1e('0x3c'),_0x37e698['uniqueid']),_0x22d7cc);}});ami['on']('dialbegin',function(_0x4bf74e){try{utils['debug'](util[_0xef1e('0x17')](_0xef1e('0x3d'),_0x4bf74e[_0xef1e('0x1c')]),_0x4bf74e);dials[_0xef1e('0x3e')](_0x4bf74e);}catch(_0x29f9e9){utils[_0xef1e('0x13')](util['format'](_0xef1e('0x3f'),_0x4bf74e[_0xef1e('0x1c')]),_0x29f9e9);}});ami['on'](_0xef1e('0x40'),function(_0xfb4105){try{utils[_0xef1e('0x16')](util[_0xef1e('0x17')]('[%s][index][dialend]',_0xfb4105[_0xef1e('0x1c')]),_0xfb4105);dials[_0xef1e('0x40')](_0xfb4105);}catch(_0x59f2bc){utils[_0xef1e('0x13')](util[_0xef1e('0x17')]('[%s][index][dialend]',_0xfb4105[_0xef1e('0x1c')]),_0x59f2bc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6b8cc15..48579b0 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 _0x5ee7=['[%s][members][cdr]','channel','data1','source','destination','data3','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','getUserByInterface','interface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','uniqueid','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','duration','diffTime','exitAt','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr'];(function(_0x3ce796,_0x621939){var _0x354e12=function(_0x553aec){while(--_0x553aec){_0x3ce796['push'](_0x3ce796['shift']());}};_0x354e12(++_0x621939);}(_0x5ee7,0xdc));var _0x75ee=function(_0x192f08,_0x59474f){_0x192f08=_0x192f08-0x0;var _0x18c212=_0x5ee7[_0x192f08];return _0x18c212;};'use strict';var _=require(_0x75ee('0x0'));var util=require(_0x75ee('0x1'));var utils=require(_0x75ee('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x75ee('0x3')];function writeDB(_0x5142f9){utils[_0x75ee('0x4')](util[_0x75ee('0x5')](_0x75ee('0x6'),_0x5142f9['uniqueid'],_0x5142f9['interface'],_0x5142f9['channel'],_0x5142f9[_0x75ee('0x7')],_0x5142f9[_0x75ee('0x8')],_0x5142f9[_0x75ee('0x9')]));if(_0x5142f9['interface']){utils[_0x75ee('0xa')](_0x5142f9[_0x75ee('0xb')])[_0x75ee('0xc')](function(_0x120319){if(_0x120319){_0x5142f9[_0x75ee('0x8')]=_0x120319[_0x75ee('0xd')];_0x5142f9[_0x75ee('0xe')]=_0x120319[_0x75ee('0xe')];utils[_0x75ee('0xf')](_0x75ee('0x10'),_0x5142f9);}else{utils[_0x75ee('0x11')](_0x5142f9[_0x75ee('0xb')][_0x75ee('0x12')]('/')[0x1])[_0x75ee('0xc')](function(_0x528146){if(_0x528146){_0x5142f9['membername']=_0x528146[_0x75ee('0xd')];_0x5142f9[_0x75ee('0xe')]=_0x528146[_0x75ee('0xe')];utils['request'](_0x75ee('0x10'),_0x5142f9);}});}})['catch'](function(_0x3bdf58){utils[_0x75ee('0x13')](util[_0x75ee('0x5')]('[%s][members][writeDB]',_0x5142f9[_0x75ee('0x14')]),_0x3bdf58);});}delete members[_0x5142f9[_0x75ee('0xb')]];}function startsWith(_0x3656be,_0x394f73){return _['some'](_0x3656be,function(_0x4597da){return _[_0x75ee('0x15')](_0x394f73,_0x4597da);});}exports[_0x75ee('0x16')]=function(_0x47c4c3){try{utils[_0x75ee('0x17')](util['format'](_0x75ee('0x18'),members[_0x47c4c3[_0x75ee('0x19')]]?members[_0x47c4c3['device']][_0x75ee('0x14')]:_0x47c4c3[_0x75ee('0x19')]),_0x47c4c3);utils[_0x75ee('0x4')](util[_0x75ee('0x5')](_0x75ee('0x1a'),members[_0x47c4c3[_0x75ee('0x19')]]?members[_0x47c4c3[_0x75ee('0x19')]][_0x75ee('0x14')]:_0x47c4c3[_0x75ee('0x19')],_0x47c4c3[_0x75ee('0x1b')],_0x47c4c3[_0x75ee('0x19')]));switch(_0x47c4c3['state']){case _0x75ee('0x1c'):case _0x75ee('0x1d'):if(!startsWith(exclude,_0x47c4c3[_0x75ee('0x19')])){members[_0x47c4c3[_0x75ee('0x19')]]={'channel':_0x75ee('0x1e'),'interface':_0x47c4c3[_0x75ee('0x19')],'type':_0x75ee('0x1f'),'enterAt':utils[_0x75ee('0x20')](),'role':'agent'};}break;case _0x75ee('0x21'):if(!_['isNil'](members[_0x47c4c3[_0x75ee('0x19')]])){members[_0x47c4c3['device']]['exitAt']=utils[_0x75ee('0x20')]();members[_0x47c4c3['device']][_0x75ee('0x22')]=utils[_0x75ee('0x23')](members[_0x47c4c3['device']][_0x75ee('0x24')],members[_0x47c4c3[_0x75ee('0x19')]][_0x75ee('0x25')]);if(members[_0x47c4c3[_0x75ee('0x19')]][_0x75ee('0x14')]){writeDB(members[_0x47c4c3[_0x75ee('0x19')]]);}}break;default:break;}}catch(_0x4a01cd){utils[_0x75ee('0x13')](util[_0x75ee('0x5')](_0x75ee('0x18'),members[_0x47c4c3[_0x75ee('0x19')]]?members[_0x47c4c3[_0x75ee('0x19')]][_0x75ee('0x14')]:_0x47c4c3[_0x75ee('0x19')]),_0x4a01cd);}};exports[_0x75ee('0x26')]=function(_0x54ead1){try{if(!_[_0x75ee('0x27')](members[_0x54ead1[_0x75ee('0xb')]])){utils[_0x75ee('0x17')](util['format'](_0x75ee('0x28'),_0x54ead1[_0x75ee('0x14')]),_0x54ead1);utils[_0x75ee('0x4')](util[_0x75ee('0x5')](_0x75ee('0x29'),_0x54ead1[_0x75ee('0x14')],_0x54ead1[_0x75ee('0xb')],_0x54ead1[_0x75ee('0x2a')]));members[_0x54ead1[_0x75ee('0xb')]]=_[_0x75ee('0x2b')](members[_0x54ead1[_0x75ee('0xb')]],{'data4':_0x54ead1['queue'],'uniqueid':_0x54ead1[_0x75ee('0x14')]});}}catch(_0x3769e1){utils[_0x75ee('0x13')](util['format'](_0x75ee('0x28'),_0x54ead1[_0x75ee('0x14')]),_0x3769e1);}};exports[_0x75ee('0x2c')]=function(_0x50c242){try{utils[_0x75ee('0x17')](util[_0x75ee('0x5')](_0x75ee('0x2d'),_0x50c242[_0x75ee('0x14')]),_0x50c242);if(_0x50c242['channel']){var _0xb65d7=_0x50c242[_0x75ee('0x2e')]['split']('-')[0x0];if(!_[_0x75ee('0x27')](members[_0xb65d7])){members[_0xb65d7]=_[_0x75ee('0x2b')](members[_0xb65d7],{'data1':members[_0xb65d7][_0x75ee('0x2f')]||_0x50c242[_0x75ee('0x9')],'data2':members[_0xb65d7][_0x75ee('0x7')]||_0x50c242[_0x75ee('0x30')],'data3':members[_0xb65d7]['data3']||_0x50c242[_0x75ee('0x31')],'uniqueid':members[_0xb65d7]['uniqueid']||_0x50c242['uniqueid']});utils['info'](util[_0x75ee('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x50c242[_0x75ee('0x14')],members[_0xb65d7][_0x75ee('0x2f')],members[_0xb65d7]['data2'],members[_0xb65d7][_0x75ee('0x32')]));if(members[_0xb65d7][_0x75ee('0x24')]){writeDB(members[_0xb65d7]);}}}if(_0x50c242[_0x75ee('0x33')]){var _0x27acef=_0x50c242['destinationchannel'][_0x75ee('0x12')]('-')[0x0];if(!_[_0x75ee('0x27')](members[_0x27acef])){members[_0x27acef]=_[_0x75ee('0x2b')](members[_0x27acef],{'data1':members[_0x27acef][_0x75ee('0x2f')]||_0x50c242[_0x75ee('0x9')],'data2':members[_0x27acef]['data2']||_0x50c242[_0x75ee('0x30')],'data3':members[_0x27acef][_0x75ee('0x32')]||_0x50c242[_0x75ee('0x31')],'uniqueid':members[_0x27acef][_0x75ee('0x14')]||_0x50c242[_0x75ee('0x14')]});utils[_0x75ee('0x4')](util[_0x75ee('0x5')](_0x75ee('0x34'),_0x50c242['uniqueid'],members[_0x27acef]['data1'],members[_0x27acef][_0x75ee('0x7')],members[_0x27acef][_0x75ee('0x32')]));if(members[_0x27acef][_0x75ee('0x24')]){writeDB(members[_0x27acef]);}}}}catch(_0x2c5571){utils[_0x75ee('0x13')](util[_0x75ee('0x5')]('[%s][members][cdr]',_0x50c242['uniqueid']),_0x2c5571);}}; \ No newline at end of file +var _0x777f=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','type','getUserByInterface','then','membername','name','CreateMemberReport','getUserByName','split','internal','request','catch','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','BUSY','TALKING','now','isNil','diffTime','exitAt','enterAt','error','agentcomplete','[%s][members][agentcomplete]'];(function(_0x4fa471,_0x3fd7bc){var _0x76f6d2=function(_0x393e8b){while(--_0x393e8b){_0x4fa471['push'](_0x4fa471['shift']());}};_0x76f6d2(++_0x3fd7bc);}(_0x777f,0x9f));var _0xf777=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x777f[_0x46a38b];return _0x346e75;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var utils=require(_0xf777('0x2'));var members={};var exclude=[_0xf777('0x3'),_0xf777('0x4')];function writeDB(_0x43f439){utils[_0xf777('0x5')](util[_0xf777('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x43f439[_0xf777('0x7')],_0x43f439[_0xf777('0x8')],_0x43f439['channel'],_0x43f439['data2'],_0x43f439['membername'],_0x43f439[_0xf777('0x9')]));if(_0x43f439[_0xf777('0x8')]){utils[_0xf777('0xa')](_0x43f439[_0xf777('0x8')])[_0xf777('0xb')](function(_0x467dc2){if(_0x467dc2){_0x43f439[_0xf777('0xc')]=_0x467dc2[_0xf777('0xd')];_0x43f439['internal']=_0x467dc2['internal'];utils['request'](_0xf777('0xe'),_0x43f439);}else{utils[_0xf777('0xf')](_0x43f439['interface'][_0xf777('0x10')]('/')[0x1])[_0xf777('0xb')](function(_0x1f3626){if(_0x1f3626){_0x43f439['membername']=_0x1f3626[_0xf777('0xd')];_0x43f439[_0xf777('0x11')]=_0x1f3626[_0xf777('0x11')];utils[_0xf777('0x12')](_0xf777('0xe'),_0x43f439);}});}})[_0xf777('0x13')](function(_0x235a0f){utils['error'](util['format'](_0xf777('0x14'),_0x43f439['uniqueid']),_0x235a0f);});}delete members[_0x43f439[_0xf777('0x8')]];}function startsWith(_0x18aa74,_0x182c00){return _['some'](_0x18aa74,function(_0x3ecaa5){return _[_0xf777('0x15')](_0x182c00,_0x3ecaa5);});}exports[_0xf777('0x16')]=function(_0x426a3a){try{utils[_0xf777('0x17')](util[_0xf777('0x6')](_0xf777('0x18'),members[_0x426a3a[_0xf777('0x19')]]?members[_0x426a3a[_0xf777('0x19')]][_0xf777('0x7')]:_0x426a3a[_0xf777('0x19')]),_0x426a3a);utils['info'](util[_0xf777('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x426a3a[_0xf777('0x19')]]?members[_0x426a3a['device']][_0xf777('0x7')]:_0x426a3a['device'],_0x426a3a['state'],_0x426a3a[_0xf777('0x19')]));switch(_0x426a3a[_0xf777('0x1a')]){case'INUSE':case _0xf777('0x1b'):if(!startsWith(exclude,_0x426a3a[_0xf777('0x19')])){members[_0x426a3a['device']]={'channel':'voice','interface':_0x426a3a['device'],'type':_0xf777('0x1c'),'enterAt':utils[_0xf777('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xf777('0x1e')](members[_0x426a3a['device']])){members[_0x426a3a[_0xf777('0x19')]]['exitAt']=utils[_0xf777('0x1d')]();members[_0x426a3a['device']]['duration']=utils[_0xf777('0x1f')](members[_0x426a3a['device']][_0xf777('0x20')],members[_0x426a3a['device']][_0xf777('0x21')]);if(members[_0x426a3a[_0xf777('0x19')]][_0xf777('0x7')]){writeDB(members[_0x426a3a[_0xf777('0x19')]]);}}break;default:break;}}catch(_0x2f3d82){utils[_0xf777('0x22')](util['format'](_0xf777('0x18'),members[_0x426a3a[_0xf777('0x19')]]?members[_0x426a3a[_0xf777('0x19')]]['uniqueid']:_0x426a3a['device']),_0x2f3d82);}};exports[_0xf777('0x23')]=function(_0x56376d){try{if(!_[_0xf777('0x1e')](members[_0x56376d['interface']])){utils[_0xf777('0x17')](util['format'](_0xf777('0x24'),_0x56376d[_0xf777('0x7')]),_0x56376d);utils[_0xf777('0x5')](util[_0xf777('0x6')](_0xf777('0x25'),_0x56376d[_0xf777('0x7')],_0x56376d['interface'],_0x56376d[_0xf777('0x26')]));members[_0x56376d[_0xf777('0x8')]]=_[_0xf777('0x27')](members[_0x56376d[_0xf777('0x8')]],{'data4':_0x56376d[_0xf777('0x26')],'uniqueid':_0x56376d[_0xf777('0x7')]});}}catch(_0x8a728c){utils['error'](util[_0xf777('0x6')](_0xf777('0x24'),_0x56376d[_0xf777('0x7')]),_0x8a728c);}};exports[_0xf777('0x28')]=function(_0xee58ef){try{utils[_0xf777('0x17')](util['format'](_0xf777('0x29'),_0xee58ef[_0xf777('0x7')]),_0xee58ef);if(_0xee58ef[_0xf777('0x2a')]){var _0x8f7814=_0xee58ef[_0xf777('0x2a')][_0xf777('0x10')]('-')[0x0];if(!_[_0xf777('0x1e')](members[_0x8f7814])){members[_0x8f7814]=_[_0xf777('0x27')](members[_0x8f7814],{'data1':members[_0x8f7814]['data1']||_0xee58ef[_0xf777('0x9')],'data2':members[_0x8f7814][_0xf777('0x2b')]||_0xee58ef[_0xf777('0x2c')],'data3':members[_0x8f7814][_0xf777('0x2d')]||_0xee58ef['destination'],'uniqueid':members[_0x8f7814][_0xf777('0x7')]||_0xee58ef['uniqueid']});utils[_0xf777('0x5')](util[_0xf777('0x6')](_0xf777('0x2e'),_0xee58ef[_0xf777('0x7')],members[_0x8f7814]['data1'],members[_0x8f7814]['data2'],members[_0x8f7814][_0xf777('0x2d')]));if(members[_0x8f7814][_0xf777('0x20')]){writeDB(members[_0x8f7814]);}}}if(_0xee58ef[_0xf777('0x2f')]){var _0x322630=_0xee58ef['destinationchannel'][_0xf777('0x10')]('-')[0x0];if(!_['isNil'](members[_0x322630])){members[_0x322630]=_['assign'](members[_0x322630],{'data1':members[_0x322630][_0xf777('0x30')]||_0xee58ef[_0xf777('0x9')],'data2':members[_0x322630]['data2']||_0xee58ef[_0xf777('0x2c')],'data3':members[_0x322630][_0xf777('0x2d')]||_0xee58ef['destination'],'uniqueid':members[_0x322630][_0xf777('0x7')]||_0xee58ef['uniqueid']});utils[_0xf777('0x5')](util[_0xf777('0x6')](_0xf777('0x2e'),_0xee58ef[_0xf777('0x7')],members[_0x322630][_0xf777('0x30')],members[_0x322630][_0xf777('0x2b')],members[_0x322630][_0xf777('0x2d')]));if(members[_0x322630][_0xf777('0x20')]){writeDB(members[_0x322630]);}}}}catch(_0x2bd5b4){utils[_0xf777('0x22')](util['format'](_0xf777('0x29'),_0xee58ef[_0xf777('0x7')]),_0x2bd5b4);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index f0426fb..f454631 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 _0x2548=['[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstop','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','position','assign','now','debug','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','isNil','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','queuecallerjoinAt'];(function(_0x4a3168,_0x494f38){var _0x35c154=function(_0x1ab446){while(--_0x1ab446){_0x4a3168['push'](_0x4a3168['shift']());}};_0x35c154(++_0x494f38);}(_0x2548,0xda));var _0x8254=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2548[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8254('0x0'));var util=require(_0x8254('0x1'));var utils=require(_0x8254('0x2'));var queues={};function writeDB(_0x2d0af4){utils[_0x8254('0x3')](util['format'](_0x8254('0x4'),_0x2d0af4[_0x8254('0x5')],_0x2d0af4[_0x8254('0x6')],_0x2d0af4[_0x8254('0x7')],_0x2d0af4[_0x8254('0x8')],_0x2d0af4['calleridnum'],_0x2d0af4['accountcode'],_0x2d0af4[_0x8254('0x9')]));if(_0x2d0af4[_0x8254('0x7')]){utils[_0x8254('0xa')](_0x2d0af4[_0x8254('0x7')])[_0x8254('0xb')](function(_0x1ebcc3){if(_0x1ebcc3){_0x2d0af4[_0x8254('0xc')]=_0x1ebcc3[_0x8254('0xc')];}utils['request'](_0x8254('0xd'),_0x2d0af4);});}else{utils[_0x8254('0xe')](_0x8254('0xd'),_0x2d0af4);}if(_0x2d0af4[_0x8254('0xf')]){delete queues[_0x2d0af4[_0x8254('0xf')]];}else{delete queues[_0x2d0af4[_0x8254('0x5')]];}}exports[_0x8254('0x10')]=function(_0x416007){try{utils['debug'](util[_0x8254('0x11')](_0x8254('0x12'),_0x416007[_0x8254('0x5')]),_0x416007);utils[_0x8254('0x3')](util[_0x8254('0x11')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x416007[_0x8254('0x5')],_0x416007[_0x8254('0x7')],_0x416007[_0x8254('0x13')]));queues[_0x416007[_0x8254('0x5')]]=_[_0x8254('0x14')](_0x416007,{'originalposition':_0x416007['position'],'queuecallerjoinAt':utils[_0x8254('0x15')](),'mohtime':0x0});}catch(_0x5bed2f){utils['error'](util[_0x8254('0x11')](_0x8254('0x12'),_0x416007[_0x8254('0x5')]),_0x5bed2f);}};exports['hangup']=function(_0x8d4c0c){try{if(!_['isNil'](queues[_0x8d4c0c['uniqueid']])){utils[_0x8254('0x16')](util['format']('[%s][queues][hangup]',_0x8d4c0c[_0x8254('0x5')]),_0x8d4c0c);if(queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x17')]){if(!queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x18')]&&!queues[_0x8d4c0c[_0x8254('0x5')]]['queuecallerexit']){queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x19')]=!![];queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x1a')]=utils[_0x8254('0x15')]();queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x9')]='COMPLETEDBYAGENT';}utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x1b'),_0x8d4c0c[_0x8254('0x5')],queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x1c')],queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x9')]));writeDB(queues[_0x8d4c0c[_0x8254('0x5')]]);}else if(queues[_0x8d4c0c['uniqueid']][_0x8254('0xf')]){utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x1d'),_0x8d4c0c['uniqueid'],queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0x1c')],queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0xf')]));queues[queues[_0x8d4c0c[_0x8254('0x5')]][_0x8254('0xf')]]=queues[_0x8d4c0c[_0x8254('0x5')]];queues[queues[_0x8d4c0c[_0x8254('0x5')]]['transfereduniqueid']][_0x8254('0x1e')]=0x2;delete queues[_0x8d4c0c[_0x8254('0x5')]];}}}catch(_0x58f56c){utils['error'](util[_0x8254('0x11')](_0x8254('0x1f'),_0x8d4c0c[_0x8254('0x5')]),_0x58f56c);}};exports[_0x8254('0x20')]=function(_0x518010){try{utils[_0x8254('0x16')](util['format'](_0x8254('0x21'),_0x518010[_0x8254('0x5')]),_0x518010);if(!_['isNil'](_0x518010[_0x8254('0x22')][_0x8254('0x23')])&&_0x518010[_0x8254('0x24')][_0x8254('0x25')]()!=='CONTINUE'){if(!_[_0x8254('0x26')](queues[_0x518010[_0x8254('0x5')]])){queues[_0x518010['uniqueid']][_0x8254('0x18')]=![];queues[_0x518010[_0x8254('0x5')]][_0x8254('0x27')]=null;queues[_0x518010[_0x8254('0x5')]][_0x8254('0x28')]=!![];queues[_0x518010[_0x8254('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x518010[_0x8254('0x5')]]['queuecallerexitreason']=_0x518010['value']['toUpperCase']();utils[_0x8254('0x3')](util['format'](_0x8254('0x29'),_0x518010[_0x8254('0x5')],queues[_0x518010[_0x8254('0x5')]][_0x8254('0x1c')],_0x518010[_0x8254('0x24')],queues[_0x518010[_0x8254('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x518010[_0x8254('0x5')]]);}}else if(!_['isNil'](_0x518010['variable']['queueposition'])){if(!_[_0x8254('0x26')](queues[_0x518010[_0x8254('0x5')]])&&!queues[_0x518010[_0x8254('0x5')]][_0x8254('0x18')]){queues[_0x518010[_0x8254('0x5')]][_0x8254('0x18')]=![];queues[_0x518010[_0x8254('0x5')]]['queuecallerabandonAt']=null;queues[_0x518010[_0x8254('0x5')]][_0x8254('0x28')]=!![];queues[_0x518010[_0x8254('0x5')]]['queuecallerexitAt']=utils[_0x8254('0x15')]();queues[_0x518010['uniqueid']]['queuecallerexitreason']=_0x8254('0x2a');utils[_0x8254('0x3')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x518010[_0x8254('0x5')],queues[_0x518010[_0x8254('0x5')]]['name'],_0x518010['value'],queues[_0x518010[_0x8254('0x5')]][_0x8254('0x9')]));}}}catch(_0x23810c){utils['error'](util[_0x8254('0x11')](_0x8254('0x21'),_0x518010['uniqueid']),_0x23810c);}};exports[_0x8254('0x18')]=function(_0x5960cc){try{if(!_[_0x8254('0x26')](queues[_0x5960cc[_0x8254('0x5')]])){utils[_0x8254('0x16')](util['format'](_0x8254('0x2b'),_0x5960cc[_0x8254('0x5')]),_0x5960cc);queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x28')]=![];queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x2c')]=null;queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x18')]=!![];queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x27')]=utils[_0x8254('0x15')]();queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x9')]=_0x8254('0x2d');utils['info'](util[_0x8254('0x11')](_0x8254('0x2e'),_0x5960cc[_0x8254('0x5')],queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x1c')],queues[_0x5960cc[_0x8254('0x5')]][_0x8254('0x9')]));}}catch(_0x31617f){utils[_0x8254('0x2f')](util[_0x8254('0x11')](_0x8254('0x2b'),_0x5960cc[_0x8254('0x5')]),_0x31617f);}};exports[_0x8254('0x30')]=function(_0x29da8e){try{if(!_['isNil'](queues[_0x29da8e[_0x8254('0x5')]])){utils[_0x8254('0x16')](util['format'](_0x8254('0x31'),_0x29da8e[_0x8254('0x5')]),_0x29da8e);utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x32'),_0x29da8e[_0x8254('0x5')],queues[_0x29da8e[_0x8254('0x5')]]['name'],_0x29da8e['connectedlinenum'],_0x29da8e[_0x8254('0x33')]));queues[_0x29da8e[_0x8254('0x5')]][_0x8254('0x30')]=!![];queues[_0x29da8e[_0x8254('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x29da8e[_0x8254('0x5')]][_0x8254('0x34')]=utils[_0x8254('0x35')](queues[_0x29da8e[_0x8254('0x5')]][_0x8254('0x17')],queues[_0x29da8e['uniqueid']]['queuecallerjoinAt']);queues[_0x29da8e[_0x8254('0x5')]][_0x8254('0x13')]=_0x29da8e['position'];queues[_0x29da8e[_0x8254('0x5')]]['count']=_0x29da8e[_0x8254('0x36')];queues[_0x29da8e[_0x8254('0x5')]][_0x8254('0x37')]=_0x29da8e[_0x8254('0x37')];queues[_0x29da8e[_0x8254('0x5')]]['connectedlinename']=_0x29da8e[_0x8254('0x33')];}}catch(_0x463cbb){utils['error'](util[_0x8254('0x11')](_0x8254('0x31'),_0x29da8e[_0x8254('0x5')]),_0x463cbb);}};exports[_0x8254('0x38')]=function(_0x4ddf60){try{if(!_[_0x8254('0x26')](queues[_0x4ddf60[_0x8254('0x5')]])){utils[_0x8254('0x16')](util[_0x8254('0x11')](_0x8254('0x39'),_0x4ddf60['uniqueid']),_0x4ddf60);utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x3a'),_0x4ddf60['uniqueid'],queues[_0x4ddf60[_0x8254('0x5')]][_0x8254('0x1c')],_0x4ddf60[_0x8254('0x3b')],_0x4ddf60['destaccountcode']));queues[_0x4ddf60[_0x8254('0x5')]]['queuecallerabandon']=![];queues[_0x4ddf60['uniqueid']][_0x8254('0x18')]=![];queues[_0x4ddf60['uniqueid']][_0x8254('0x27')]=null;queues[_0x4ddf60[_0x8254('0x5')]][_0x8254('0x28')]=![];queues[_0x4ddf60['uniqueid']][_0x8254('0x9')]=null;queues[_0x4ddf60[_0x8254('0x5')]][_0x8254('0x2c')]=null;queues[_0x4ddf60['uniqueid']][_0x8254('0x3c')]=!![];queues[_0x4ddf60['uniqueid']][_0x8254('0x3d')]=_0x4ddf60[_0x8254('0x3e')];queues[_0x4ddf60[_0x8254('0x5')]][_0x8254('0x8')]=_0x4ddf60[_0x8254('0x3b')];}}catch(_0x427d94){utils[_0x8254('0x2f')](util[_0x8254('0x11')](_0x8254('0x39'),_0x4ddf60[_0x8254('0x5')]),_0x427d94);}};exports[_0x8254('0x3f')]=function(_0x17d898){try{if(!_[_0x8254('0x26')](queues[_0x17d898[_0x8254('0x5')]])){if(queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x17')]){utils[_0x8254('0x16')](util['format'](_0x8254('0x40'),_0x17d898[_0x8254('0x5')]),_0x17d898);queues[_0x17d898[_0x8254('0x5')]]['queuecallerabandon']=![];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x18')]=![];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x27')]=null;queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x28')]=![];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x2c')]=null;queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x3c')]=!![];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x8')]=_0x17d898[_0x8254('0x3b')];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x19')]=!![];queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x1a')]=utils[_0x8254('0x15')]();if(_0x17d898[_0x8254('0x41')]==_0x8254('0x42')){if(!queues[_0x17d898['uniqueid']][_0x8254('0x42')]){queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x9')]=_0x8254('0x43');}}else{queues[_0x17d898['uniqueid']]['queuecallerexitreason']=_0x8254('0x44')+_0x17d898[_0x8254('0x41')][_0x8254('0x25')]();}utils['info'](util[_0x8254('0x11')](_0x8254('0x45'),_0x17d898[_0x8254('0x5')],queues[_0x17d898['uniqueid']]['name'],_0x17d898[_0x8254('0x3b')],queues[_0x17d898[_0x8254('0x5')]][_0x8254('0x9')]));writeDB(queues[_0x17d898[_0x8254('0x5')]]);}}}catch(_0x3a867d){utils[_0x8254('0x2f')](util[_0x8254('0x11')](_0x8254('0x40'),_0x17d898[_0x8254('0x5')]),_0x3a867d);}};exports[_0x8254('0x46')]=function(_0xd470cf){try{if(!_['isNil'](queues[_0xd470cf['transfereeuniqueid']])){utils['debug'](util[_0x8254('0x11')](_0x8254('0x47'),_0xd470cf[_0x8254('0x5')]),_0xd470cf);queues[_0xd470cf[_0x8254('0x48')]][_0x8254('0x42')]=!![];queues[_0xd470cf[_0x8254('0x48')]][_0x8254('0x49')]=_0x8254('0x4a');queues[_0xd470cf[_0x8254('0x48')]][_0x8254('0x4b')]=_0xd470cf[_0x8254('0x4c')];queues[_0xd470cf[_0x8254('0x48')]][_0x8254('0x4d')]=_0xd470cf[_0x8254('0x48')];queues[_0xd470cf[_0x8254('0x48')]][_0x8254('0x9')]=_0x8254('0x4e');utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x4f'),_0xd470cf['uniqueid'],queues[_0xd470cf[_0x8254('0x48')]]['name'],_0xd470cf[_0x8254('0x48')],_0xd470cf['extension']));}}catch(_0x4e6726){utils[_0x8254('0x2f')](util[_0x8254('0x11')]('[%s][queues][blindtransfer]',_0xd470cf['uniqueid']),_0x4e6726);}};exports['attendedtransfer']=function(_0x246576){try{utils[_0x8254('0x16')](util[_0x8254('0x11')](_0x8254('0x50'),_0x246576[_0x8254('0x51')]),_0x246576);if(_0x246576[_0x8254('0x51')]==_0x246576[_0x8254('0x52')]){if(!_[_0x8254('0x26')](queues[_0x246576[_0x8254('0x53')]])){utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x54'),_0x246576[_0x8254('0x51')],queues[_0x246576['secondtransfererlinkedid']][_0x8254('0x1c')],_0x246576[_0x8254('0x55')]));queues[_0x246576[_0x8254('0x53')]]['transfer']=!![];queues[_0x246576['secondtransfererlinkedid']][_0x8254('0x49')]=_0x8254('0x56');queues[_0x246576[_0x8254('0x53')]][_0x8254('0x4b')]=_0x246576['origtransfererexten'];queues[_0x246576['secondtransfererlinkedid']][_0x8254('0x4d')]=_0x246576[_0x8254('0x51')];queues[_0x246576[_0x8254('0x53')]][_0x8254('0x9')]=_0x8254('0x57');}if(!_[_0x8254('0x26')](queues[_0x246576[_0x8254('0x52')]])){if(_0x246576['transfereelinkedid']&&queues[_0x246576[_0x8254('0x58')]]){queues[_0x246576[_0x8254('0x58')]][_0x8254('0x1e')]=0x1;queues[_0x246576['transfereeuniqueid']]=_['clone'](queues[_0x246576['transfereelinkedid']]);queues[_0x246576['transfereeuniqueid']]['transfereduniqueid']=_0x246576[_0x8254('0x59')];queues[_0x246576[_0x8254('0x48')]]['queuecallerenterreason']=0x2;queues[_0x246576[_0x8254('0x48')]][_0x8254('0x5a')]=queues[_0x246576['secondtransfererlinkedid']][_0x8254('0x5a')];queues[_0x246576['transfereeuniqueid']]['calleridname']=queues[_0x246576['secondtransfererlinkedid']][_0x8254('0x5b')];queues[_0x246576['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x8254('0x15')]();queues[_0x246576[_0x8254('0x48')]][_0x8254('0x17')]=utils[_0x8254('0x15')]();queues[_0x246576[_0x8254('0x48')]][_0x8254('0x34')]=0x0;queues[_0x246576[_0x8254('0x48')]][_0x8254('0x5c')]=0x0;utils['info'](util[_0x8254('0x11')](_0x8254('0x5d'),_0x246576[_0x8254('0x51')],queues[_0x246576[_0x8254('0x48')]]['name'],queues[_0x246576[_0x8254('0x48')]][_0x8254('0x5a')],queues[_0x246576[_0x8254('0x48')]][_0x8254('0x5b')]));}else{utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x5e'),_0x246576[_0x8254('0x51')],queues[_0x246576[_0x8254('0x52')]][_0x8254('0x1c')],_0x246576['secondtransfererlinkedid']));queues[_0x246576['origtransfererlinkedid']][_0x8254('0xf')]=_0x246576[_0x8254('0x53')];}}}else if(_0x246576[_0x8254('0x5f')]==_0x246576[_0x8254('0x53')]){if(!_[_0x8254('0x26')](queues[_0x246576[_0x8254('0x52')]])){utils[_0x8254('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x246576[_0x8254('0x51')],queues[_0x246576[_0x8254('0x52')]][_0x8254('0x1c')],_0x246576[_0x8254('0x5f')],_0x246576[_0x8254('0x60')]));queues[_0x246576[_0x8254('0x52')]][_0x8254('0x42')]=!![];queues[_0x246576[_0x8254('0x52')]][_0x8254('0x49')]=_0x8254('0x56');queues[_0x246576[_0x8254('0x52')]]['transferexten']=_0x246576[_0x8254('0x60')];queues[_0x246576['origtransfererlinkedid']]['transferuniqueid']=_0x246576[_0x8254('0x5f')];queues[_0x246576['origtransfererlinkedid']]['queuecallerexitreason']=_0x8254('0x57');}if(!_['isNil'](queues[_0x246576[_0x8254('0x53')]])){if(_0x246576[_0x8254('0x61')]&&queues[_0x246576[_0x8254('0x61')]]){queues[_0x246576[_0x8254('0x61')]][_0x8254('0x1e')]=0x1;queues[_0x246576['transfertargetuniqueid']]=_[_0x8254('0x62')](queues[_0x246576[_0x8254('0x61')]]);queues[_0x246576[_0x8254('0x59')]][_0x8254('0xf')]=_0x246576['transfertargetuniqueid'];queues[_0x246576[_0x8254('0x59')]][_0x8254('0x1e')]=0x2;queues[_0x246576[_0x8254('0x59')]]['calleridnum']=queues[_0x246576['origtransfererlinkedid']]['calleridnum'];queues[_0x246576['transfertargetuniqueid']][_0x8254('0x5b')]=queues[_0x246576[_0x8254('0x52')]][_0x8254('0x5b')];queues[_0x246576[_0x8254('0x59')]][_0x8254('0x63')]=utils[_0x8254('0x15')]();queues[_0x246576['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x8254('0x15')]();queues[_0x246576[_0x8254('0x59')]][_0x8254('0x34')]=0x0;queues[_0x246576[_0x8254('0x59')]][_0x8254('0x5c')]=0x0;utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x64'),_0x246576[_0x8254('0x51')],queues[_0x246576[_0x8254('0x59')]][_0x8254('0x1c')],queues[_0x246576[_0x8254('0x59')]][_0x8254('0xf')],queues[_0x246576['transfertargetuniqueid']][_0x8254('0x5a')],queues[_0x246576[_0x8254('0x59')]][_0x8254('0x5b')]));}else{utils['info'](util[_0x8254('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x246576[_0x8254('0x51')],queues[_0x246576[_0x8254('0x53')]][_0x8254('0x1c')],_0x246576[_0x8254('0x52')]));queues[_0x246576[_0x8254('0x53')]][_0x8254('0xf')]=_0x246576[_0x8254('0x52')];}}}}catch(_0x31ce25){utils[_0x8254('0x2f')](util['format'](_0x8254('0x50'),_0x246576[_0x8254('0x51')]),_0x31ce25);}};exports['musiconholdstart']=function(_0x1d91d0){try{if(!_[_0x8254('0x26')](queues[_0x1d91d0[_0x8254('0x5')]])){utils[_0x8254('0x16')](util['format'](_0x8254('0x65'),_0x1d91d0[_0x8254('0x5')]),_0x1d91d0);queues[_0x1d91d0[_0x8254('0x5')]]['musiconholdstartAt']=utils[_0x8254('0x15')]();utils[_0x8254('0x3')](util[_0x8254('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1d91d0[_0x8254('0x5')],queues[_0x1d91d0['uniqueid']][_0x8254('0x1c')],queues[_0x1d91d0[_0x8254('0x5')]]['musiconholdstartAt']));}}catch(_0x4ad907){utils['error'](util[_0x8254('0x11')](_0x8254('0x65'),_0x1d91d0[_0x8254('0x5')]),_0x4ad907);}};exports[_0x8254('0x66')]=function(_0x5dee60){try{if(!_[_0x8254('0x26')](queues[_0x5dee60['uniqueid']])){if(!_[_0x8254('0x26')](queues[_0x5dee60[_0x8254('0x5')]][_0x8254('0x67')])){utils[_0x8254('0x16')](util['format']('[%s][queues][musiconholdstop]',_0x5dee60[_0x8254('0x5')]),_0x5dee60);queues[_0x5dee60[_0x8254('0x5')]][_0x8254('0x5c')]+=utils[_0x8254('0x35')](utils['now'](),queues[_0x5dee60['uniqueid']]['musiconholdstartAt']);utils[_0x8254('0x3')](util[_0x8254('0x11')](_0x8254('0x68'),_0x5dee60[_0x8254('0x5')],queues[_0x5dee60[_0x8254('0x5')]][_0x8254('0x1c')],queues[_0x5dee60['uniqueid']][_0x8254('0x5c')]));delete queues[_0x5dee60[_0x8254('0x5')]][_0x8254('0x67')];}}}catch(_0x49d3f2){utils[_0x8254('0x2f')](util[_0x8254('0x11')](_0x8254('0x69'),_0x5dee60[_0x8254('0x5')]),_0x49d3f2);}}; \ No newline at end of file +var _0xad0e=['transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','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]','queuecallerexit','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]','membername','destaccountcode','accountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason'];(function(_0xc0b89e,_0x137eb6){var _0x21bf4d=function(_0x826231){while(--_0x826231){_0xc0b89e['push'](_0xc0b89e['shift']());}};_0x21bf4d(++_0x137eb6);}(_0xad0e,0x8d));var _0xead0=function(_0x2d47bb,_0x3ea49c){_0x2d47bb=_0x2d47bb-0x0;var _0x52bb67=_0xad0e[_0x2d47bb];return _0x52bb67;};'use strict';var _=require(_0xead0('0x0'));var util=require('util');var utils=require(_0xead0('0x1'));var queues={};function writeDB(_0x37b682){utils['info'](util[_0xead0('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x37b682[_0xead0('0x3')],_0x37b682[_0xead0('0x4')],_0x37b682[_0xead0('0x5')],_0x37b682[_0xead0('0x6')],_0x37b682[_0xead0('0x7')],_0x37b682['accountcode'],_0x37b682[_0xead0('0x8')]));if(_0x37b682[_0xead0('0x5')]){utils[_0xead0('0x9')](_0x37b682['queue'])['then'](function(_0x10c8f3){if(_0x10c8f3){_0x37b682[_0xead0('0xa')]=_0x10c8f3[_0xead0('0xa')];}utils['request'](_0xead0('0xb'),_0x37b682);});}else{utils[_0xead0('0xc')](_0xead0('0xb'),_0x37b682);}if(_0x37b682['transfereduniqueid']){delete queues[_0x37b682[_0xead0('0xd')]];}else{delete queues[_0x37b682[_0xead0('0x3')]];}}exports[_0xead0('0xe')]=function(_0x1d77d3){try{utils[_0xead0('0xf')](util['format'](_0xead0('0x10'),_0x1d77d3[_0xead0('0x3')]),_0x1d77d3);utils['info'](util[_0xead0('0x2')](_0xead0('0x11'),_0x1d77d3[_0xead0('0x3')],_0x1d77d3['queue'],_0x1d77d3[_0xead0('0x12')]));queues[_0x1d77d3[_0xead0('0x3')]]=_['assign'](_0x1d77d3,{'originalposition':_0x1d77d3[_0xead0('0x12')],'queuecallerjoinAt':utils[_0xead0('0x13')](),'mohtime':0x0});}catch(_0x385243){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x10'),_0x1d77d3[_0xead0('0x3')]),_0x385243);}};exports['hangup']=function(_0x51dbe0){try{if(!_[_0xead0('0x15')](queues[_0x51dbe0[_0xead0('0x3')]])){utils['debug'](util['format'](_0xead0('0x16'),_0x51dbe0[_0xead0('0x3')]),_0x51dbe0);if(queues[_0x51dbe0['uniqueid']][_0xead0('0x17')]){if(!queues[_0x51dbe0['uniqueid']][_0xead0('0x18')]&&!queues[_0x51dbe0[_0xead0('0x3')]]['queuecallerexit']){queues[_0x51dbe0[_0xead0('0x3')]]['queuecallercomplete']=!![];queues[_0x51dbe0[_0xead0('0x3')]]['queuecallercompleteAt']=utils[_0xead0('0x13')]();queues[_0x51dbe0[_0xead0('0x3')]]['queuecallerexitreason']=_0xead0('0x19');}utils[_0xead0('0x1a')](util['format'](_0xead0('0x1b'),_0x51dbe0[_0xead0('0x3')],queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0x1c')],queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0x8')]));writeDB(queues[_0x51dbe0[_0xead0('0x3')]]);}else if(queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0xd')]){utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x1d'),_0x51dbe0['uniqueid'],queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0x1c')],queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0xd')]));queues[queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0xd')]]=queues[_0x51dbe0[_0xead0('0x3')]];queues[queues[_0x51dbe0[_0xead0('0x3')]][_0xead0('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x51dbe0[_0xead0('0x3')]];}}}catch(_0x186e72){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x16'),_0x51dbe0[_0xead0('0x3')]),_0x186e72);}};exports[_0xead0('0x1e')]=function(_0x222063){try{utils[_0xead0('0xf')](util[_0xead0('0x2')](_0xead0('0x1f'),_0x222063[_0xead0('0x3')]),_0x222063);if(!_[_0xead0('0x15')](_0x222063[_0xead0('0x20')][_0xead0('0x21')])&&_0x222063[_0xead0('0x22')][_0xead0('0x23')]()!=='CONTINUE'){if(!_[_0xead0('0x15')](queues[_0x222063[_0xead0('0x3')]])){queues[_0x222063['uniqueid']][_0xead0('0x18')]=![];queues[_0x222063[_0xead0('0x3')]][_0xead0('0x24')]=null;queues[_0x222063['uniqueid']]['queuecallerexit']=!![];queues[_0x222063[_0xead0('0x3')]][_0xead0('0x25')]=utils[_0xead0('0x13')]();queues[_0x222063[_0xead0('0x3')]][_0xead0('0x8')]=_0x222063[_0xead0('0x22')][_0xead0('0x23')]();utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x26'),_0x222063[_0xead0('0x3')],queues[_0x222063['uniqueid']]['name'],_0x222063[_0xead0('0x22')],queues[_0x222063['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x222063['uniqueid']]);}}else if(!_['isNil'](_0x222063[_0xead0('0x20')][_0xead0('0x27')])){if(!_[_0xead0('0x15')](queues[_0x222063[_0xead0('0x3')]])&&!queues[_0x222063[_0xead0('0x3')]][_0xead0('0x18')]){queues[_0x222063[_0xead0('0x3')]]['queuecallerabandon']=![];queues[_0x222063[_0xead0('0x3')]]['queuecallerabandonAt']=null;queues[_0x222063['uniqueid']]['queuecallerexit']=!![];queues[_0x222063['uniqueid']][_0xead0('0x25')]=utils['now']();queues[_0x222063[_0xead0('0x3')]][_0xead0('0x8')]='EXITWITHKEY';utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x28'),_0x222063[_0xead0('0x3')],queues[_0x222063[_0xead0('0x3')]][_0xead0('0x1c')],_0x222063[_0xead0('0x22')],queues[_0x222063[_0xead0('0x3')]][_0xead0('0x8')]));}}}catch(_0x3cde8b){utils[_0xead0('0x14')](util['format']('[%s][queues][varset]',_0x222063[_0xead0('0x3')]),_0x3cde8b);}};exports[_0xead0('0x18')]=function(_0x3328f9){try{if(!_[_0xead0('0x15')](queues[_0x3328f9[_0xead0('0x3')]])){utils[_0xead0('0xf')](util['format'](_0xead0('0x29'),_0x3328f9[_0xead0('0x3')]),_0x3328f9);queues[_0x3328f9[_0xead0('0x3')]][_0xead0('0x2a')]=![];queues[_0x3328f9[_0xead0('0x3')]]['queuecallerexitAt']=null;queues[_0x3328f9[_0xead0('0x3')]][_0xead0('0x18')]=!![];queues[_0x3328f9[_0xead0('0x3')]]['queuecallerabandonAt']=utils[_0xead0('0x13')]();queues[_0x3328f9['uniqueid']][_0xead0('0x8')]=_0xead0('0x2b');utils['info'](util[_0xead0('0x2')](_0xead0('0x2c'),_0x3328f9['uniqueid'],queues[_0x3328f9['uniqueid']][_0xead0('0x1c')],queues[_0x3328f9[_0xead0('0x3')]][_0xead0('0x8')]));}}catch(_0x139f99){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x29'),_0x3328f9[_0xead0('0x3')]),_0x139f99);}};exports[_0xead0('0x2d')]=function(_0x1dd569){try{if(!_[_0xead0('0x15')](queues[_0x1dd569[_0xead0('0x3')]])){utils[_0xead0('0xf')](util[_0xead0('0x2')](_0xead0('0x2e'),_0x1dd569['uniqueid']),_0x1dd569);utils[_0xead0('0x1a')](util['format'](_0xead0('0x2f'),_0x1dd569['uniqueid'],queues[_0x1dd569['uniqueid']][_0xead0('0x1c')],_0x1dd569[_0xead0('0x30')],_0x1dd569[_0xead0('0x31')]));queues[_0x1dd569[_0xead0('0x3')]][_0xead0('0x2d')]=!![];queues[_0x1dd569['uniqueid']][_0xead0('0x17')]=utils[_0xead0('0x13')]();queues[_0x1dd569['uniqueid']][_0xead0('0x32')]=utils[_0xead0('0x33')](queues[_0x1dd569[_0xead0('0x3')]][_0xead0('0x17')],queues[_0x1dd569[_0xead0('0x3')]][_0xead0('0x34')]);queues[_0x1dd569['uniqueid']][_0xead0('0x12')]=_0x1dd569['position'];queues[_0x1dd569[_0xead0('0x3')]][_0xead0('0x35')]=_0x1dd569[_0xead0('0x35')];queues[_0x1dd569['uniqueid']]['connectedlinenum']=_0x1dd569[_0xead0('0x30')];queues[_0x1dd569[_0xead0('0x3')]][_0xead0('0x31')]=_0x1dd569[_0xead0('0x31')];}}catch(_0x554b6a){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x2e'),_0x1dd569['uniqueid']),_0x554b6a);}};exports[_0xead0('0x36')]=function(_0x34540d){try{if(!_[_0xead0('0x15')](queues[_0x34540d[_0xead0('0x3')]])){utils[_0xead0('0xf')](util['format'](_0xead0('0x37'),_0x34540d[_0xead0('0x3')]),_0x34540d);utils[_0xead0('0x1a')](util[_0xead0('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x34540d['uniqueid'],queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x1c')],_0x34540d[_0xead0('0x38')],_0x34540d[_0xead0('0x39')]));queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x18')]=![];queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x18')]=![];queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x24')]=null;queues[_0x34540d[_0xead0('0x3')]]['queuecallerexit']=![];queues[_0x34540d['uniqueid']][_0xead0('0x8')]=null;queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x25')]=null;queues[_0x34540d[_0xead0('0x3')]]['assigned']=!![];queues[_0x34540d[_0xead0('0x3')]][_0xead0('0x3a')]=_0x34540d['destaccountcode'];queues[_0x34540d[_0xead0('0x3')]]['lastAssignedTo']=_0x34540d[_0xead0('0x38')];}}catch(_0x2c1cf5){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x37'),_0x34540d['uniqueid']),_0x2c1cf5);}};exports[_0xead0('0x3b')]=function(_0x3741e3){try{if(!_['isNil'](queues[_0x3741e3[_0xead0('0x3')]])){if(queues[_0x3741e3['uniqueid']][_0xead0('0x17')]){utils[_0xead0('0xf')](util['format'](_0xead0('0x3c'),_0x3741e3[_0xead0('0x3')]),_0x3741e3);queues[_0x3741e3[_0xead0('0x3')]]['queuecallerabandon']=![];queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x18')]=![];queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x24')]=null;queues[_0x3741e3['uniqueid']][_0xead0('0x2a')]=![];queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x25')]=null;queues[_0x3741e3[_0xead0('0x3')]]['assigned']=!![];queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x6')]=_0x3741e3[_0xead0('0x38')];queues[_0x3741e3[_0xead0('0x3')]]['queuecallercomplete']=!![];queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x3d')]=utils[_0xead0('0x13')]();if(_0x3741e3[_0xead0('0x3e')]==_0xead0('0x3f')){if(!queues[_0x3741e3['uniqueid']][_0xead0('0x3f')]){queues[_0x3741e3[_0xead0('0x3')]]['queuecallerexitreason']=_0xead0('0x40');}}else{queues[_0x3741e3['uniqueid']][_0xead0('0x8')]='COMPLETEDBY'+_0x3741e3['reason'][_0xead0('0x23')]();}utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x41'),_0x3741e3[_0xead0('0x3')],queues[_0x3741e3['uniqueid']]['name'],_0x3741e3[_0xead0('0x38')],queues[_0x3741e3[_0xead0('0x3')]][_0xead0('0x8')]));writeDB(queues[_0x3741e3[_0xead0('0x3')]]);}}}catch(_0x239b81){utils[_0xead0('0x14')](util[_0xead0('0x2')](_0xead0('0x3c'),_0x3741e3['uniqueid']),_0x239b81);}};exports[_0xead0('0x42')]=function(_0x356db0){try{if(!_[_0xead0('0x15')](queues[_0x356db0[_0xead0('0x43')]])){utils[_0xead0('0xf')](util[_0xead0('0x2')](_0xead0('0x44'),_0x356db0[_0xead0('0x3')]),_0x356db0);queues[_0x356db0['transfereeuniqueid']][_0xead0('0x3f')]=!![];queues[_0x356db0[_0xead0('0x43')]]['transfertype']=_0xead0('0x45');queues[_0x356db0[_0xead0('0x43')]][_0xead0('0x46')]=_0x356db0[_0xead0('0x47')];queues[_0x356db0[_0xead0('0x43')]][_0xead0('0x48')]=_0x356db0['transfereeuniqueid'];queues[_0x356db0[_0xead0('0x43')]]['queuecallerexitreason']=_0xead0('0x49');utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x4a'),_0x356db0[_0xead0('0x3')],queues[_0x356db0['transfereeuniqueid']][_0xead0('0x1c')],_0x356db0[_0xead0('0x43')],_0x356db0['extension']));}}catch(_0x57fe66){utils[_0xead0('0x14')](util['format'](_0xead0('0x44'),_0x356db0[_0xead0('0x3')]),_0x57fe66);}};exports['attendedtransfer']=function(_0x35c084){try{utils[_0xead0('0xf')](util[_0xead0('0x2')](_0xead0('0x4b'),_0x35c084['origtransfereruniqueid']),_0x35c084);if(_0x35c084[_0xead0('0x4c')]==_0x35c084[_0xead0('0x4d')]){if(!_['isNil'](queues[_0x35c084['secondtransfererlinkedid']])){utils['info'](util['format'](_0xead0('0x4e'),_0x35c084['origtransfereruniqueid'],queues[_0x35c084[_0xead0('0x4f')]][_0xead0('0x1c')],_0x35c084[_0xead0('0x50')]));queues[_0x35c084['secondtransfererlinkedid']]['transfer']=!![];queues[_0x35c084[_0xead0('0x4f')]]['transfertype']=_0xead0('0x51');queues[_0x35c084['secondtransfererlinkedid']][_0xead0('0x46')]=_0x35c084['origtransfererexten'];queues[_0x35c084[_0xead0('0x4f')]]['transferuniqueid']=_0x35c084[_0xead0('0x4c')];queues[_0x35c084[_0xead0('0x4f')]][_0xead0('0x8')]=_0xead0('0x52');}if(!_[_0xead0('0x15')](queues[_0x35c084[_0xead0('0x4d')]])){if(_0x35c084['transfereelinkedid']&&queues[_0x35c084[_0xead0('0x53')]]){queues[_0x35c084[_0xead0('0x53')]][_0xead0('0x54')]=0x1;queues[_0x35c084[_0xead0('0x43')]]=_[_0xead0('0x55')](queues[_0x35c084[_0xead0('0x53')]]);queues[_0x35c084[_0xead0('0x43')]][_0xead0('0xd')]=_0x35c084[_0xead0('0x56')];queues[_0x35c084[_0xead0('0x43')]][_0xead0('0x54')]=0x2;queues[_0x35c084['transfereeuniqueid']][_0xead0('0x7')]=queues[_0x35c084['secondtransfererlinkedid']][_0xead0('0x7')];queues[_0x35c084[_0xead0('0x43')]][_0xead0('0x57')]=queues[_0x35c084[_0xead0('0x4f')]][_0xead0('0x57')];queues[_0x35c084[_0xead0('0x43')]]['queuecallerjoinAt']=utils[_0xead0('0x13')]();queues[_0x35c084[_0xead0('0x43')]]['queuecallerleaveAt']=utils['now']();queues[_0x35c084[_0xead0('0x43')]]['holdtime']=0x0;queues[_0x35c084['transfereeuniqueid']][_0xead0('0x58')]=0x0;utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x59'),_0x35c084[_0xead0('0x4c')],queues[_0x35c084[_0xead0('0x43')]]['name'],queues[_0x35c084[_0xead0('0x43')]][_0xead0('0x7')],queues[_0x35c084[_0xead0('0x43')]][_0xead0('0x57')]));}else{utils[_0xead0('0x1a')](util['format'](_0xead0('0x5a'),_0x35c084[_0xead0('0x4c')],queues[_0x35c084[_0xead0('0x4d')]][_0xead0('0x1c')],_0x35c084['secondtransfererlinkedid']));queues[_0x35c084[_0xead0('0x4d')]][_0xead0('0xd')]=_0x35c084[_0xead0('0x4f')];}}}else if(_0x35c084[_0xead0('0x5b')]==_0x35c084[_0xead0('0x4f')]){if(!_['isNil'](queues[_0x35c084[_0xead0('0x4d')]])){utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x5c'),_0x35c084['origtransfereruniqueid'],queues[_0x35c084[_0xead0('0x4d')]]['name'],_0x35c084[_0xead0('0x5b')],_0x35c084[_0xead0('0x5d')]));queues[_0x35c084[_0xead0('0x4d')]][_0xead0('0x3f')]=!![];queues[_0x35c084[_0xead0('0x4d')]][_0xead0('0x5e')]=_0xead0('0x51');queues[_0x35c084[_0xead0('0x4d')]]['transferexten']=_0x35c084[_0xead0('0x5d')];queues[_0x35c084['origtransfererlinkedid']][_0xead0('0x48')]=_0x35c084['secondtransfereruniqueid'];queues[_0x35c084[_0xead0('0x4d')]][_0xead0('0x8')]='ATTENDEDTRANSFER';}if(!_[_0xead0('0x15')](queues[_0x35c084['secondtransfererlinkedid']])){if(_0x35c084['transfertargetlinkedid']&&queues[_0x35c084[_0xead0('0x5f')]]){queues[_0x35c084[_0xead0('0x5f')]][_0xead0('0x54')]=0x1;queues[_0x35c084[_0xead0('0x56')]]=_[_0xead0('0x55')](queues[_0x35c084['transfertargetlinkedid']]);queues[_0x35c084[_0xead0('0x56')]][_0xead0('0xd')]=_0x35c084['transfertargetuniqueid'];queues[_0x35c084['transfertargetuniqueid']][_0xead0('0x54')]=0x2;queues[_0x35c084[_0xead0('0x56')]]['calleridnum']=queues[_0x35c084[_0xead0('0x4d')]]['calleridnum'];queues[_0x35c084[_0xead0('0x56')]][_0xead0('0x57')]=queues[_0x35c084[_0xead0('0x4d')]]['calleridname'];queues[_0x35c084['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xead0('0x13')]();queues[_0x35c084['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xead0('0x13')]();queues[_0x35c084[_0xead0('0x56')]]['holdtime']=0x0;queues[_0x35c084[_0xead0('0x56')]][_0xead0('0x58')]=0x0;utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x60'),_0x35c084['origtransfereruniqueid'],queues[_0x35c084[_0xead0('0x56')]][_0xead0('0x1c')],queues[_0x35c084[_0xead0('0x56')]][_0xead0('0xd')],queues[_0x35c084[_0xead0('0x56')]]['calleridnum'],queues[_0x35c084[_0xead0('0x56')]][_0xead0('0x57')]));}else{utils['info'](util[_0xead0('0x2')](_0xead0('0x5a'),_0x35c084[_0xead0('0x4c')],queues[_0x35c084[_0xead0('0x4f')]][_0xead0('0x1c')],_0x35c084[_0xead0('0x4d')]));queues[_0x35c084['secondtransfererlinkedid']][_0xead0('0xd')]=_0x35c084[_0xead0('0x4d')];}}}}catch(_0x3961fe){utils[_0xead0('0x14')](util[_0xead0('0x2')]('[%s][queues][attendedtransfer]',_0x35c084[_0xead0('0x4c')]),_0x3961fe);}};exports[_0xead0('0x61')]=function(_0x23a6da){try{if(!_[_0xead0('0x15')](queues[_0x23a6da[_0xead0('0x3')]])){utils['debug'](util[_0xead0('0x2')]('[%s][queues][musiconholdstart]',_0x23a6da[_0xead0('0x3')]),_0x23a6da);queues[_0x23a6da['uniqueid']]['musiconholdstartAt']=utils[_0xead0('0x13')]();utils['info'](util[_0xead0('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x23a6da[_0xead0('0x3')],queues[_0x23a6da[_0xead0('0x3')]][_0xead0('0x1c')],queues[_0x23a6da[_0xead0('0x3')]][_0xead0('0x62')]));}}catch(_0x2afaec){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x23a6da[_0xead0('0x3')]),_0x2afaec);}};exports[_0xead0('0x63')]=function(_0x3b473e){try{if(!_[_0xead0('0x15')](queues[_0x3b473e[_0xead0('0x3')]])){if(!_[_0xead0('0x15')](queues[_0x3b473e[_0xead0('0x3')]][_0xead0('0x62')])){utils[_0xead0('0xf')](util[_0xead0('0x2')](_0xead0('0x64'),_0x3b473e[_0xead0('0x3')]),_0x3b473e);queues[_0x3b473e[_0xead0('0x3')]][_0xead0('0x58')]+=utils['diffTime'](utils[_0xead0('0x13')](),queues[_0x3b473e[_0xead0('0x3')]][_0xead0('0x62')]);utils[_0xead0('0x1a')](util[_0xead0('0x2')](_0xead0('0x65'),_0x3b473e['uniqueid'],queues[_0x3b473e['uniqueid']][_0xead0('0x1c')],queues[_0x3b473e[_0xead0('0x3')]]['mohtime']));delete queues[_0x3b473e[_0xead0('0x3')]]['musiconholdstartAt'];}}}catch(_0xe79bbd){utils['error'](util[_0xead0('0x2')]('[%s][queues][musiconholdstop]',_0x3b473e[_0xead0('0x3')]),_0xe79bbd);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 23a449b..8cb83d2 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 _0xaa23=['set','toLowerCase','split','substring','lastIndexOf','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]','mixmonitor_filename','variable','endsWith','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xaa23,0x90));var _0x3aa2=function(_0x56d78c,_0x2b65d6){_0x56d78c=_0x56d78c-0x0;var _0x9a8155=_0xaa23[_0x56d78c];return _0x9a8155;};'use strict';var _=require('lodash');var util=require(_0x3aa2('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x743a7d){var _0x12d85c;utils['info'](util['format'](_0x3aa2('0x1'),_0x743a7d[_0x3aa2('0x2')]));if(transfers[_0x3aa2('0x3')][_0x743a7d[_0x3aa2('0x2')]]){_0x12d85c=_0x743a7d[_0x3aa2('0x2')];_0x743a7d['uniqueid']=transfers[_0x3aa2('0x3')][_0x743a7d[_0x3aa2('0x2')]][_0x3aa2('0x4')];}if(_0x743a7d[_0x3aa2('0x5')]){utils['getUserByInternal'](_0x743a7d[_0x3aa2('0x5')])['then'](function(_0x53a442){if(_0x53a442){_0x743a7d['membername']=_0x53a442['name'];_0x743a7d[_0x3aa2('0x6')]=_0x53a442['id'];}utils[_0x3aa2('0x7')](_0x3aa2('0x8'),_0x743a7d);});}else{utils['request'](_0x3aa2('0x8'),_0x743a7d);}if(_0x12d85c)delete transfers[_0x3aa2('0x3')][_0x12d85c];}exports[_0x3aa2('0x9')]=function(_0x45d393){try{utils[_0x3aa2('0xa')](util['format'](_0x3aa2('0xb'),_0x45d393[_0x3aa2('0x2')]),_0x45d393);if(_0x45d393['uniqueid']==_0x45d393[_0x3aa2('0xc')]){utils[_0x3aa2('0xd')](util[_0x3aa2('0xe')](_0x3aa2('0xf'),_0x45d393[_0x3aa2('0x2')],_0x45d393[_0x3aa2('0x10')],_0x45d393[_0x3aa2('0x11')]));recordings[_0x45d393[_0x3aa2('0x2')]]={'uniqueid':_0x45d393[_0x3aa2('0x2')],'accountcode':_0x45d393['accountcode'],'exten':_0x45d393['exten'],'context':_0x45d393['context'],'channel':_0x45d393[_0x3aa2('0x12')],'monitors':[]};}}catch(_0x3b0578){utils[_0x3aa2('0x13')](util[_0x3aa2('0xe')](_0x3aa2('0xb'),_0x45d393[_0x3aa2('0x2')]),_0x3b0578);}};exports[_0x3aa2('0x14')]=function(_0x31b8cf){try{utils[_0x3aa2('0xa')](util['format']('[%s][recordings][newstate]',_0x31b8cf[_0x3aa2('0x2')]),_0x31b8cf);if(!_[_0x3aa2('0x15')](recordings[_0x31b8cf[_0x3aa2('0x2')]])&&_0x31b8cf[_0x3aa2('0x16')]==0x6){utils[_0x3aa2('0xd')](util[_0x3aa2('0xe')](_0x3aa2('0x17'),_0x31b8cf[_0x3aa2('0x2')],_0x31b8cf[_0x3aa2('0x10')],_0x31b8cf[_0x3aa2('0x12')]));}else if(!_[_0x3aa2('0x15')](recordings[_0x31b8cf[_0x3aa2('0xc')]])&&_0x31b8cf['channelstate']==0x6&&_0x31b8cf['context']!=_0x3aa2('0x18')){utils[_0x3aa2('0xd')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x31b8cf[_0x3aa2('0x2')],_0x31b8cf[_0x3aa2('0xc')],_0x31b8cf[_0x3aa2('0x10')],_0x31b8cf[_0x3aa2('0x12')]));recordings[_0x31b8cf['linkedid']]['accountcode']=_0x31b8cf[_0x3aa2('0x5')];}}catch(_0x342bec){utils[_0x3aa2('0x13')](util[_0x3aa2('0xe')](_0x3aa2('0x19'),_0x31b8cf[_0x3aa2('0x2')]),_0x342bec);}};exports['varset']=function(_0x1161f7){try{if(!_['isNil'](_0x1161f7['variable'])&&!_[_0x3aa2('0x15')](_0x1161f7['variable'][_0x3aa2('0x1a')])){utils[_0x3aa2('0xa')](util[_0x3aa2('0xe')]('[%s][recordings][varset]',_0x1161f7[_0x3aa2('0x2')]),_0x1161f7);utils[_0x3aa2('0xd')](util[_0x3aa2('0xe')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1161f7[_0x3aa2('0x2')],_0x1161f7[_0x3aa2('0x1b')],_0x1161f7['value']));if(_[_0x3aa2('0x1c')](_0x1161f7[_0x3aa2('0x1d')],_0x3aa2('0x1e'))){_0x1161f7[_0x3aa2('0x1d')]=_0x1161f7[_0x3aa2('0x1d')][_0x3aa2('0x1f')](_0x3aa2('0x1e'),'.WAV');}if(recordings[_0x1161f7[_0x3aa2('0xc')]]){var _0x357717=_[_0x3aa2('0x20')](recordings[_0x1161f7['linkedid']][_0x3aa2('0x21')],{'value':_0x1161f7[_0x3aa2('0x1d')]});if(_[_0x3aa2('0x15')](_0x357717)){recordings[_0x1161f7['linkedid']][_0x3aa2('0x21')][_0x3aa2('0x22')]({'value':_0x1161f7[_0x3aa2('0x1d')]});}}}}catch(_0x10bb2c){utils['error'](util[_0x3aa2('0xe')]('[%s][recordings][varset]',_0x1161f7[_0x3aa2('0x2')]),_0x10bb2c);}};exports[_0x3aa2('0x23')]=function(_0x70e77b){try{if(!_[_0x3aa2('0x15')](recordings[_0x70e77b['uniqueid']])){utils[_0x3aa2('0xa')](util['format'](_0x3aa2('0x24'),_0x70e77b[_0x3aa2('0x2')]),_0x70e77b);utils[_0x3aa2('0xd')](util['format'](_0x3aa2('0x25'),_0x70e77b['uniqueid'],_0x70e77b[_0x3aa2('0x26')],_0x70e77b[_0x3aa2('0x27')],_0x70e77b[_0x3aa2('0x28')]));recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x26')]=_0x70e77b[_0x3aa2('0x26')];recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x27')]=_0x70e77b[_0x3aa2('0x27')];recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x29')]=_0x70e77b[_0x3aa2('0x29')];recordings[_0x70e77b[_0x3aa2('0x2')]]['connectedlinename']=_0x70e77b[_0x3aa2('0x2a')];if(recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x2b')]=='outbound'&&recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x5')]){recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x29')]=recordings[_0x70e77b[_0x3aa2('0x2')]][_0x3aa2('0x5')];recordings[_0x70e77b[_0x3aa2('0x2')]]['connectedlinename']='';}recordings[_0x70e77b[_0x3aa2('0x2')]]['monitors'][_0x3aa2('0x2c')](function(_0x349579){var _0x35658c=_[_0x3aa2('0x2d')](recordings[_0x70e77b[_0x3aa2('0x2')]]);_0x35658c[_0x3aa2('0x1d')]=_0x349579[_0x3aa2('0x1d')];writeDB(_0x35658c);});delete recordings[_0x70e77b[_0x3aa2('0x2')]];}}catch(_0xce627f){utils[_0x3aa2('0x13')](util[_0x3aa2('0xe')](_0x3aa2('0x24'),_0x70e77b['uniqueid']),_0xce627f);}};exports[_0x3aa2('0x2e')]=function(_0x2d4116){try{if(!_['isNil'](recordings[_0x2d4116['uniqueid']])){utils[_0x3aa2('0xa')](util[_0x3aa2('0xe')](_0x3aa2('0x2f'),_0x2d4116[_0x3aa2('0x2')]),_0x2d4116);utils[_0x3aa2('0xd')](util[_0x3aa2('0xe')](_0x3aa2('0x30'),_0x2d4116[_0x3aa2('0x2')],_0x2d4116[_0x3aa2('0x31')],_0x2d4116[_0x3aa2('0x32')]));if(_0x2d4116[_0x3aa2('0x31')]['toLowerCase']()==_0x3aa2('0x33')&&_['startsWith'](_0x2d4116[_0x3aa2('0x32')][_0x3aa2('0x34')](),'cdr')){var _0x34e38a=_0x2d4116[_0x3aa2('0x32')][_0x3aa2('0x35')]('=');var _0xd66866=_0x34e38a[0x0][_0x3aa2('0x36')](_0x34e38a[0x0][_0x3aa2('0x37')]('(')+0x1,_0x34e38a[0x0][_0x3aa2('0x37')](')'));var _0x450fd1=_0x34e38a[0x1];recordings[_0x2d4116[_0x3aa2('0x2')]][_0xd66866]=_0x450fd1;}}}catch(_0x32d545){utils[_0x3aa2('0x13')](util['format'](_0x3aa2('0x2f'),_0x2d4116[_0x3aa2('0x2')]),_0x32d545);}};exports['queuecallerjoin']=function(_0x81f76b){try{if(!_[_0x3aa2('0x15')](recordings[_0x81f76b[_0x3aa2('0x2')]])){utils[_0x3aa2('0xa')](util[_0x3aa2('0xe')]('[%s][recordings][queuecallerjoin]',_0x81f76b[_0x3aa2('0x2')]),_0x81f76b);utils['info'](util[_0x3aa2('0xe')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x81f76b[_0x3aa2('0x2')],_0x81f76b[_0x3aa2('0x38')]));recordings[_0x81f76b[_0x3aa2('0x2')]][_0x3aa2('0x38')]=_0x81f76b[_0x3aa2('0x38')];}}catch(_0x4a1856){utils[_0x3aa2('0x13')](util['format'](_0x3aa2('0x39'),_0x81f76b['uniqueid']),_0x4a1856);}};exports[_0x3aa2('0x3a')]=function(_0x392266){try{utils['debug'](util[_0x3aa2('0xe')](_0x3aa2('0x3b'),_0x392266[_0x3aa2('0x2')]),_0x392266);utils[_0x3aa2('0xd')](util[_0x3aa2('0xe')](_0x3aa2('0x3c'),_0x392266[_0x3aa2('0x2')],_0x392266['transferercalleridnum'],_0x392266['transferercalleridname'],_0x392266[_0x3aa2('0x3d')],_0x392266[_0x3aa2('0x3e')]));if(recordings[_0x392266['transfereruniqueid']]&&transfers[_0x3aa2('0x3')][_0x392266[_0x3aa2('0x3f')]]){transfers[_0x3aa2('0x3')][_0x392266[_0x3aa2('0x3f')]][_0x3aa2('0x40')]=!![];}}catch(_0xb6c1bd){utils[_0x3aa2('0x13')](util[_0x3aa2('0xe')](_0x3aa2('0x3b'),_0x392266[_0x3aa2('0x2')]),_0xb6c1bd);}}; \ No newline at end of file +var _0x9b95=['error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','.wav49','replace','.WAV','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','UserId','request','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9b95,0x199));var _0x59b9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9b95[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x59b9('0x0'));var util=require(_0x59b9('0x1'));var utils=require(_0x59b9('0x2'));var transfers=require(_0x59b9('0x3'));var recordings={};function writeDB(_0x4dffe6){var _0x11686b;utils[_0x59b9('0x4')](util[_0x59b9('0x5')](_0x59b9('0x6'),_0x4dffe6[_0x59b9('0x7')]));if(transfers[_0x59b9('0x8')][_0x4dffe6[_0x59b9('0x7')]]){_0x11686b=_0x4dffe6[_0x59b9('0x7')];_0x4dffe6['uniqueid']=transfers[_0x59b9('0x8')][_0x4dffe6[_0x59b9('0x7')]]['transfereeuniqueid'];}if(_0x4dffe6[_0x59b9('0x9')]){utils[_0x59b9('0xa')](_0x4dffe6[_0x59b9('0x9')])[_0x59b9('0xb')](function(_0x4982b8){if(_0x4982b8){_0x4dffe6[_0x59b9('0xc')]=_0x4982b8[_0x59b9('0xd')];_0x4dffe6[_0x59b9('0xe')]=_0x4982b8['id'];}utils[_0x59b9('0xf')]('CreateVoiceRecording',_0x4dffe6);});}else{utils['request']('CreateVoiceRecording',_0x4dffe6);}if(_0x11686b)delete transfers[_0x59b9('0x8')][_0x11686b];}exports[_0x59b9('0x10')]=function(_0x4197f9){try{utils[_0x59b9('0x11')](util[_0x59b9('0x5')]('[%s][recordings][newchannel]',_0x4197f9[_0x59b9('0x7')]),_0x4197f9);if(_0x4197f9[_0x59b9('0x7')]==_0x4197f9[_0x59b9('0x12')]){utils['info'](util['format'](_0x59b9('0x13'),_0x4197f9[_0x59b9('0x7')],_0x4197f9[_0x59b9('0x14')],_0x4197f9[_0x59b9('0x15')]));recordings[_0x4197f9[_0x59b9('0x7')]]={'uniqueid':_0x4197f9[_0x59b9('0x7')],'accountcode':_0x4197f9[_0x59b9('0x9')],'exten':_0x4197f9[_0x59b9('0x15')],'context':_0x4197f9[_0x59b9('0x14')],'channel':_0x4197f9[_0x59b9('0x16')],'monitors':[]};}}catch(_0x24008c){utils[_0x59b9('0x17')](util[_0x59b9('0x5')]('[%s][recordings][newchannel]',_0x4197f9['uniqueid']),_0x24008c);}};exports[_0x59b9('0x18')]=function(_0x377877){try{utils[_0x59b9('0x11')](util['format']('[%s][recordings][newstate]',_0x377877[_0x59b9('0x7')]),_0x377877);if(!_[_0x59b9('0x19')](recordings[_0x377877[_0x59b9('0x7')]])&&_0x377877[_0x59b9('0x1a')]==0x6){utils[_0x59b9('0x4')](util[_0x59b9('0x5')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x377877[_0x59b9('0x7')],_0x377877[_0x59b9('0x14')],_0x377877[_0x59b9('0x16')]));}else if(!_[_0x59b9('0x19')](recordings[_0x377877[_0x59b9('0x12')]])&&_0x377877[_0x59b9('0x1a')]==0x6&&_0x377877[_0x59b9('0x14')]!='transfer'){utils[_0x59b9('0x4')](util[_0x59b9('0x5')](_0x59b9('0x1b'),_0x377877[_0x59b9('0x7')],_0x377877[_0x59b9('0x12')],_0x377877[_0x59b9('0x14')],_0x377877['channel']));recordings[_0x377877[_0x59b9('0x12')]][_0x59b9('0x9')]=_0x377877['accountcode'];}}catch(_0x72676f){utils[_0x59b9('0x17')](util['format'](_0x59b9('0x1c'),_0x377877[_0x59b9('0x7')]),_0x72676f);}};exports[_0x59b9('0x1d')]=function(_0x27c860){try{if(!_['isNil'](_0x27c860[_0x59b9('0x1e')])&&!_['isNil'](_0x27c860[_0x59b9('0x1e')][_0x59b9('0x1f')])){utils[_0x59b9('0x11')](util['format'](_0x59b9('0x20'),_0x27c860[_0x59b9('0x7')]),_0x27c860);utils['info'](util[_0x59b9('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x27c860['uniqueid'],_0x27c860[_0x59b9('0x1e')],_0x27c860['value']));if(_[_0x59b9('0x21')](_0x27c860[_0x59b9('0x22')],_0x59b9('0x23'))){_0x27c860[_0x59b9('0x22')]=_0x27c860[_0x59b9('0x22')][_0x59b9('0x24')]('.wav49',_0x59b9('0x25'));}if(recordings[_0x27c860[_0x59b9('0x12')]]){var _0x8fcab2=_['find'](recordings[_0x27c860['linkedid']][_0x59b9('0x26')],{'value':_0x27c860[_0x59b9('0x22')]});if(_[_0x59b9('0x19')](_0x8fcab2)){recordings[_0x27c860[_0x59b9('0x12')]]['monitors']['push']({'value':_0x27c860[_0x59b9('0x22')]});}}}}catch(_0xd2f519){utils[_0x59b9('0x17')](util[_0x59b9('0x5')](_0x59b9('0x20'),_0x27c860[_0x59b9('0x7')]),_0xd2f519);}};exports[_0x59b9('0x27')]=function(_0x4533a6){try{if(!_['isNil'](recordings[_0x4533a6[_0x59b9('0x7')]])){utils['debug'](util[_0x59b9('0x5')](_0x59b9('0x28'),_0x4533a6[_0x59b9('0x7')]),_0x4533a6);utils['info'](util[_0x59b9('0x5')](_0x59b9('0x29'),_0x4533a6[_0x59b9('0x7')],_0x4533a6[_0x59b9('0x2a')],_0x4533a6[_0x59b9('0x2b')],_0x4533a6[_0x59b9('0x2c')]));recordings[_0x4533a6['uniqueid']]['calleridnum']=_0x4533a6[_0x59b9('0x2a')];recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x2b')]=_0x4533a6[_0x59b9('0x2b')];recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x2d')]=_0x4533a6[_0x59b9('0x2d')];recordings[_0x4533a6['uniqueid']][_0x59b9('0x2e')]=_0x4533a6[_0x59b9('0x2e')];if(recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x2f')]==_0x59b9('0x30')&&recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x9')]){recordings[_0x4533a6[_0x59b9('0x7')]]['connectedlinenum']=recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x9')];recordings[_0x4533a6['uniqueid']][_0x59b9('0x2e')]='';}recordings[_0x4533a6[_0x59b9('0x7')]][_0x59b9('0x26')][_0x59b9('0x31')](function(_0x1b67e4){var _0x49f873=_[_0x59b9('0x32')](recordings[_0x4533a6[_0x59b9('0x7')]]);_0x49f873[_0x59b9('0x22')]=_0x1b67e4[_0x59b9('0x22')];writeDB(_0x49f873);});delete recordings[_0x4533a6[_0x59b9('0x7')]];}}catch(_0x5111bd){utils[_0x59b9('0x17')](util[_0x59b9('0x5')](_0x59b9('0x28'),_0x4533a6[_0x59b9('0x7')]),_0x5111bd);}};exports[_0x59b9('0x33')]=function(_0x40c10f){try{if(!_[_0x59b9('0x19')](recordings[_0x40c10f[_0x59b9('0x7')]])){utils[_0x59b9('0x11')](util[_0x59b9('0x5')](_0x59b9('0x34'),_0x40c10f[_0x59b9('0x7')]),_0x40c10f);utils['info'](util[_0x59b9('0x5')](_0x59b9('0x35'),_0x40c10f[_0x59b9('0x7')],_0x40c10f['application'],_0x40c10f[_0x59b9('0x36')]));if(_0x40c10f[_0x59b9('0x37')][_0x59b9('0x38')]()==_0x59b9('0x39')&&_[_0x59b9('0x3a')](_0x40c10f[_0x59b9('0x36')][_0x59b9('0x38')](),_0x59b9('0x3b'))){var _0x1c028a=_0x40c10f[_0x59b9('0x36')][_0x59b9('0x3c')]('=');var _0x5e60bb=_0x1c028a[0x0][_0x59b9('0x3d')](_0x1c028a[0x0]['lastIndexOf']('(')+0x1,_0x1c028a[0x0][_0x59b9('0x3e')](')'));var _0x2d4d99=_0x1c028a[0x1];recordings[_0x40c10f['uniqueid']][_0x5e60bb]=_0x2d4d99;}}}catch(_0x325295){utils['error'](util[_0x59b9('0x5')]('[%s][recordings][newexten]',_0x40c10f[_0x59b9('0x7')]),_0x325295);}};exports[_0x59b9('0x3f')]=function(_0x48fee0){try{if(!_[_0x59b9('0x19')](recordings[_0x48fee0[_0x59b9('0x7')]])){utils[_0x59b9('0x11')](util['format']('[%s][recordings][queuecallerjoin]',_0x48fee0[_0x59b9('0x7')]),_0x48fee0);utils[_0x59b9('0x4')](util[_0x59b9('0x5')](_0x59b9('0x40'),_0x48fee0[_0x59b9('0x7')],_0x48fee0[_0x59b9('0x41')]));recordings[_0x48fee0[_0x59b9('0x7')]][_0x59b9('0x41')]=_0x48fee0[_0x59b9('0x41')];}}catch(_0x20f0d7){utils[_0x59b9('0x17')](util[_0x59b9('0x5')]('[%s][recordings][queuecallerjoin]',_0x48fee0[_0x59b9('0x7')]),_0x20f0d7);}};exports[_0x59b9('0x42')]=function(_0x21acb6){try{utils[_0x59b9('0x11')](util[_0x59b9('0x5')](_0x59b9('0x43'),_0x21acb6[_0x59b9('0x7')]),_0x21acb6);utils[_0x59b9('0x4')](util[_0x59b9('0x5')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x21acb6[_0x59b9('0x7')],_0x21acb6['transferercalleridnum'],_0x21acb6[_0x59b9('0x44')],_0x21acb6['transfereecalleridnum'],_0x21acb6[_0x59b9('0x45')]));if(recordings[_0x21acb6['transfereruniqueid']]&&transfers[_0x59b9('0x8')][_0x21acb6[_0x59b9('0x46')]]){transfers[_0x59b9('0x8')][_0x21acb6[_0x59b9('0x46')]][_0x59b9('0x47')]=!![];}}catch(_0x1bb50e){utils[_0x59b9('0x17')](util[_0x59b9('0x5')]('[%s][recordings][blindtransfer]',_0x21acb6[_0x59b9('0x7')]),_0x1bb50e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 718c3d2..53e23ee 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 _0x4903=['[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','info','format','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x4903,0x14d));var _0x3490=function(_0x486199,_0x2e00a5){_0x486199=_0x486199-0x0;var _0x1d3896=_0x4903[_0x486199];return _0x1d3896;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');function writeDB(_0x5059e9){utils[_0x3490('0x0')](util[_0x3490('0x1')]('[%s][transfers][writeDB]\x20type:%s',_0x5059e9[_0x3490('0x2')]===_0x3490('0x3')?_0x5059e9[_0x3490('0x4')]:_0x5059e9[_0x3490('0x5')],_0x5059e9[_0x3490('0x2')]));utils[_0x3490('0x6')]('CreateVoiceTransferReport',_0x5059e9);}exports[_0x3490('0x7')]={};exports[_0x3490('0x8')]=function(_0x114d35){try{utils['debug'](util[_0x3490('0x1')](_0x3490('0x9'),_0x114d35['uniqueid']),_0x114d35);utils[_0x3490('0x0')](util[_0x3490('0x1')](_0x3490('0xa'),_0x114d35[_0x3490('0x5')],_0x114d35['transferercalleridnum'],_0x114d35[_0x3490('0xb')],_0x114d35[_0x3490('0xc')],_0x114d35['transfereecalleridname']));_0x114d35['type']='blind';exports[_0x3490('0x7')][_0x114d35[_0x3490('0xd')]]=_0x114d35;writeDB(_0x114d35);}catch(_0x28eb25){utils['error'](util['format'](_0x3490('0x9'),_0x114d35[_0x3490('0x5')]),_0x28eb25);}};exports['attendedtransfer']=function(_0x4c76e5){try{utils[_0x3490('0xe')](util[_0x3490('0x1')]('[%s][transfers][attendedtransfer]',_0x4c76e5['origtransfereruniqueid']),_0x4c76e5);utils[_0x3490('0x0')](util[_0x3490('0x1')](_0x3490('0xf'),_0x4c76e5[_0x3490('0x4')],_0x4c76e5[_0x3490('0x10')],_0x4c76e5['origtransferercalleridname'],_0x4c76e5['transfertargetcalleridnum'],_0x4c76e5[_0x3490('0x11')]));_0x4c76e5=_['assign'](_0x4c76e5,{'transfererchannel':_0x4c76e5[_0x3490('0x12')],'transferercalleridnum':_0x4c76e5[_0x3490('0x10')],'transferercalleridname':_0x4c76e5['origtransferercalleridname'],'transfererconnectedlinenum':_0x4c76e5[_0x3490('0x13')],'transfererconnectedlinename':_0x4c76e5[_0x3490('0x14')],'transfereraccountcode':_0x4c76e5['origtransfereraccountcode'],'transferercontext':_0x4c76e5[_0x3490('0x15')],'transfererexten':_0x4c76e5[_0x3490('0x16')],'transfererlinkedid':_0x4c76e5[_0x3490('0x17')],'context':_0x4c76e5['origtransferercontext'],'extension':_0x4c76e5[_0x3490('0x18')],'type':_0x3490('0x3')});if(_[_0x3490('0x19')](_0x4c76e5[_0x3490('0x1a')])){_0x4c76e5=_[_0x3490('0x1b')](_0x4c76e5,{'transfereechannel':_0x4c76e5[_0x3490('0x1c')],'transfereecalleridnum':_0x4c76e5[_0x3490('0x1d')],'transfereecalleridname':_0x4c76e5[_0x3490('0x11')],'transfereeconnectedlinenum':_0x4c76e5[_0x3490('0x1e')],'transfereeconnectedlinename':_0x4c76e5[_0x3490('0x1f')],'transfereeaccountcode':_0x4c76e5[_0x3490('0x20')],'transfereecontext':_0x4c76e5[_0x3490('0x21')],'transfereeexten':_0x4c76e5[_0x3490('0x22')],'transfereelinkedid':_0x4c76e5[_0x3490('0x23')]});}writeDB(_0x4c76e5);}catch(_0x2dc38c){utils[_0x3490('0x24')](util[_0x3490('0x1')](_0x3490('0x25'),_0x4c76e5[_0x3490('0x4')]),_0x2dc38c);}}; \ No newline at end of file +var _0xbea3=['info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransferercontext','origtransferercontext','origtransfererexten','transfereechannel','assign','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','[%s][transfers][attendedtransfer]','lodash','util','./utils','format','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer'];(function(_0x5db636,_0x341000){var _0x6a5131=function(_0x330908){while(--_0x330908){_0x5db636['push'](_0x5db636['shift']());}};_0x6a5131(++_0x341000);}(_0xbea3,0x149));var _0x3bea=function(_0x110011,_0x240000){_0x110011=_0x110011-0x0;var _0x29c7ae=_0xbea3[_0x110011];return _0x29c7ae;};'use strict';var _=require(_0x3bea('0x0'));var util=require(_0x3bea('0x1'));var utils=require(_0x3bea('0x2'));function writeDB(_0x45e98d){utils['info'](util[_0x3bea('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x45e98d['type']===_0x3bea('0x4')?_0x45e98d[_0x3bea('0x5')]:_0x45e98d[_0x3bea('0x6')],_0x45e98d[_0x3bea('0x7')]));utils[_0x3bea('0x8')](_0x3bea('0x9'),_0x45e98d);}exports[_0x3bea('0xa')]={};exports[_0x3bea('0xb')]=function(_0x331cf1){try{utils[_0x3bea('0xc')](util[_0x3bea('0x3')](_0x3bea('0xd'),_0x331cf1[_0x3bea('0x6')]),_0x331cf1);utils['info'](util[_0x3bea('0x3')](_0x3bea('0xe'),_0x331cf1[_0x3bea('0x6')],_0x331cf1[_0x3bea('0xf')],_0x331cf1[_0x3bea('0x10')],_0x331cf1[_0x3bea('0x11')],_0x331cf1[_0x3bea('0x12')]));_0x331cf1['type']=_0x3bea('0x13');exports[_0x3bea('0xa')][_0x331cf1[_0x3bea('0x14')]]=_0x331cf1;writeDB(_0x331cf1);}catch(_0x5ed5bd){utils['error'](util[_0x3bea('0x3')]('[%s][transfers][blindtransfer]',_0x331cf1[_0x3bea('0x6')]),_0x5ed5bd);}};exports[_0x3bea('0x15')]=function(_0x53b63c){try{utils[_0x3bea('0xc')](util['format']('[%s][transfers][attendedtransfer]',_0x53b63c['origtransfereruniqueid']),_0x53b63c);utils[_0x3bea('0x16')](util[_0x3bea('0x3')](_0x3bea('0x17'),_0x53b63c[_0x3bea('0x5')],_0x53b63c[_0x3bea('0x18')],_0x53b63c[_0x3bea('0x19')],_0x53b63c['transfertargetcalleridnum'],_0x53b63c[_0x3bea('0x1a')]));_0x53b63c=_['assign'](_0x53b63c,{'transfererchannel':_0x53b63c['origtransfererchannel'],'transferercalleridnum':_0x53b63c[_0x3bea('0x18')],'transferercalleridname':_0x53b63c[_0x3bea('0x19')],'transfererconnectedlinenum':_0x53b63c[_0x3bea('0x1b')],'transfererconnectedlinename':_0x53b63c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x53b63c['origtransfereraccountcode'],'transferercontext':_0x53b63c[_0x3bea('0x1c')],'transfererexten':_0x53b63c['secondtransfererexten'],'transfererlinkedid':_0x53b63c['origtransfererlinkedid'],'context':_0x53b63c[_0x3bea('0x1d')],'extension':_0x53b63c[_0x3bea('0x1e')],'type':_0x3bea('0x4')});if(_['isNil'](_0x53b63c[_0x3bea('0x1f')])){_0x53b63c=_[_0x3bea('0x20')](_0x53b63c,{'transfereechannel':_0x53b63c['transfertargetchannel'],'transfereecalleridnum':_0x53b63c[_0x3bea('0x21')],'transfereecalleridname':_0x53b63c[_0x3bea('0x1a')],'transfereeconnectedlinenum':_0x53b63c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x53b63c[_0x3bea('0x22')],'transfereeaccountcode':_0x53b63c[_0x3bea('0x23')],'transfereecontext':_0x53b63c[_0x3bea('0x24')],'transfereeexten':_0x53b63c[_0x3bea('0x25')],'transfereelinkedid':_0x53b63c['transfertargetlinkedid']});}writeDB(_0x53b63c);}catch(_0x52a2fb){utils['error'](util[_0x3bea('0x3')](_0x3bea('0x26'),_0x53b63c[_0x3bea('0x5')]),_0x52a2fb);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index cdd0ce6..6181f4f 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 _0x468a=['[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','util','http','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','GetUser','name','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x468a,0x13b));var _0xa468=function(_0x539caf,_0x84f432){_0x539caf=_0x539caf-0x0;var _0x283ae9=_0x468a[_0x539caf];return _0x283ae9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa468('0x0'));var moment=require('moment');var util=require(_0xa468('0x1'));var client=jayson['client'][_0xa468('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0xa468('0x3'));exports[_0xa468('0x4')]=function(_0x532ba3,_0x4584c4){logger['info'](_0x532ba3,_0x4584c4?util['inspect'](_0x4584c4,{'showHidden':![],'depth':null}):'');};exports[_0xa468('0x5')]=function(_0x13fb5f,_0x1f845f){logger[_0xa468('0x5')](_0x13fb5f,_0x1f845f?util[_0xa468('0x6')](_0x1f845f,{'showHidden':![],'depth':null}):'');};exports[_0xa468('0x7')]=function(_0x2b6b58,_0x2cd2ea){logger[_0xa468('0x7')](_0x2b6b58,_0x2cd2ea?util[_0xa468('0x6')](_0x2cd2ea,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x547556,_0xc0a78e){return client[_0xa468('0x8')](_0x547556,{'body':_0xc0a78e})[_0xa468('0x9')](function(_0x1b4a2f){logger[_0xa468('0x5')]('[utils][request]\x20name:%s',_0x547556,_0x1b4a2f?util[_0xa468('0x6')](_0x1b4a2f,{'showHidden':![],'depth':null}):'');})[_0xa468('0xa')](function(_0x14dd05){logger[_0xa468('0x7')](_0xa468('0xb'),_0x547556,_0x14dd05?util[_0xa468('0x6')](_0x14dd05,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4fd4a8){return client[_0xa468('0x8')](_0xa468('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0xa468('0xd'),'interface'],'where':_0x4fd4a8,'limit':0x1}})[_0xa468('0x9')](function(_0x31d450){logger['debug'](_0xa468('0xe'),JSON[_0xa468('0xf')](_0x4fd4a8),_0x31d450?util[_0xa468('0x6')](_0x31d450,{'showHidden':![],'depth':null}):'');return _0x31d450[_0xa468('0x10')][_0xa468('0x11')]?_0x31d450[_0xa468('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x12aa88){return new BPromise(function(_0x1e7f57,_0x7b16fc){if(_0x12aa88){return getUser({'internal':_0x12aa88})[_0xa468('0x9')](function(_0x3896c6){logger['info'](_0xa468('0x12'),_0x12aa88,_0x3896c6?_0xa468('0x13'):_0xa468('0x14'));return _0x1e7f57(_0x3896c6);})['catch'](function(_0x5c8961){logger[_0xa468('0x7')](_0xa468('0x15'),_0x5c8961?util['inspect'](_0x5c8961,{'showHidden':![],'depth':null}):'');return _0x1e7f57(null);});}return _0x1e7f57(null);});};exports[_0xa468('0x16')]=function(_0xbb605a){return new BPromise(function(_0x32d53b,_0x2847ce){if(_0xbb605a){return getUser({'interface':_0xbb605a})[_0xa468('0x9')](function(_0x4713bb){logger[_0xa468('0x4')](_0xa468('0x17'),_0xbb605a,_0x4713bb?_0xa468('0x13'):'notfound');return _0x32d53b(_0x4713bb);})[_0xa468('0xa')](function(_0x5b1a5d){logger['error']('[utils][getUserByInterface]',_0x5b1a5d?util['inspect'](_0x5b1a5d,{'showHidden':![],'depth':null}):'');return _0x32d53b(null);});}return _0x32d53b(null);});};exports[_0xa468('0x18')]=function(_0x3bf376){return new BPromise(function(_0x45d38b,_0xe4df8a){if(_0x3bf376){return getUser({'name':_0x3bf376})[_0xa468('0x9')](function(_0x430c9f){logger[_0xa468('0x4')]('[utils][getUserByName]\x20name:%s\x20%s',_0x3bf376,_0x430c9f?_0xa468('0x13'):'notfound');return _0x45d38b(_0x430c9f);})[_0xa468('0xa')](function(_0x1e7cc4){logger['error'](_0xa468('0x19'),_0x1e7cc4?util['inspect'](_0x1e7cc4,{'showHidden':![],'depth':null}):'');return _0x45d38b(null);});}return _0x45d38b(null);});};exports[_0xa468('0x1a')]=function(_0x2bbb17){return new BPromise(function(_0x27b026,_0x40d710){if(_0x2bbb17){return client[_0xa468('0x8')](_0xa468('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xa468('0xd'),_0xa468('0x1c'),'acw','acwTimeout'],'where':{'name':_0x2bbb17},'limit':0x1}})[_0xa468('0x9')](function(_0x5e596a){logger[_0xa468('0x5')](_0xa468('0x1d'),_0x2bbb17,_0x5e596a?util['inspect'](_0x5e596a,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2bbb17,_0x5e596a?_0xa468('0x13'):'notfound');return _0x27b026(_0x5e596a[_0xa468('0x10')]['length']?_0x5e596a[_0xa468('0x10')][0x0]:null);})[_0xa468('0xa')](function(_0x27625d){logger[_0xa468('0x7')](_0xa468('0x1e'),_0x27625d?util[_0xa468('0x6')](_0x27625d,{'showHidden':![],'depth':null}):'');return _0x27b026(null);});}return _0x27b026(null);});};exports['addTime']=function(_0x55e3db,_0x3ce7b2){return moment(_0x55e3db)['add'](_0x3ce7b2,_0xa468('0x1f'))[_0xa468('0x20')](_0xa468('0x21'));};exports[_0xa468('0x22')]=function(_0x1da419,_0xd6778){return moment(_0x1da419)[_0xa468('0x23')](_0xd6778,_0xa468('0x1f'))[_0xa468('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa468('0x24')]=function(_0x297b1d,_0x4033af){return moment(_0x297b1d)[_0xa468('0x25')](moment(_0x4033af),_0xa468('0x1f'));};exports[_0xa468('0x26')]=function(_0x1c94a7,_0x342e04){return parseInt(_0x1c94a7,0xa)+parseInt(_0x342e04,0xa);};exports[_0xa468('0x27')]=function(){return moment()[_0xa468('0x20')](_0xa468('0x21'));};exports[_0xa468('0x28')]=function(_0x4b17c1,_0x5b9bfc){if(_0x5b9bfc){return moment(_0x4b17c1)[_0xa468('0x28')](_0x5b9bfc);}return!![];};exports[_0xa468('0x29')]=function(_0xd7cb3f,_0x58bacd){if(_0x58bacd){return moment(_0xd7cb3f)[_0xa468('0x29')](_0x58bacd);}else if(_0xd7cb3f){return!![];}return![];}; \ No newline at end of file +var _0x6a45=['GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','interface','result','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','catch','[utils][getUserByInterface]','getVoiceQueueByName'];(function(_0x2f4202,_0x8f6064){var _0x3b21b3=function(_0x46fbf5){while(--_0x46fbf5){_0x2f4202['push'](_0x2f4202['shift']());}};_0x3b21b3(++_0x8f6064);}(_0x6a45,0x147));var _0x56a4=function(_0x42ca30,_0xeeed97){_0x42ca30=_0x42ca30-0x0;var _0x786de1=_0x6a45[_0x42ca30];return _0x786de1;};'use strict';var BPromise=require(_0x56a4('0x0'));var jayson=require(_0x56a4('0x1'));var moment=require(_0x56a4('0x2'));var util=require(_0x56a4('0x3'));var client=jayson['client'][_0x56a4('0x4')]({'port':0x2329});var logger=require(_0x56a4('0x5'))(_0x56a4('0x6'));exports[_0x56a4('0x7')]=function(_0x456872,_0xbfc02b){logger['info'](_0x456872,_0xbfc02b?util[_0x56a4('0x8')](_0xbfc02b,{'showHidden':![],'depth':null}):'');};exports[_0x56a4('0x9')]=function(_0x293920,_0x2820f5){logger[_0x56a4('0x9')](_0x293920,_0x2820f5?util['inspect'](_0x2820f5,{'showHidden':![],'depth':null}):'');};exports[_0x56a4('0xa')]=function(_0x1854b4,_0x356ec4){logger[_0x56a4('0xa')](_0x1854b4,_0x356ec4?util['inspect'](_0x356ec4,{'showHidden':![],'depth':null}):'');};exports[_0x56a4('0xb')]=function(_0x59a0d9,_0x1b4e04){return client[_0x56a4('0xb')](_0x59a0d9,{'body':_0x1b4e04})[_0x56a4('0xc')](function(_0x1bd34a){logger[_0x56a4('0x9')](_0x56a4('0xd'),_0x59a0d9,_0x1bd34a?util[_0x56a4('0x8')](_0x1bd34a,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x357080){logger[_0x56a4('0xa')](_0x56a4('0xd'),_0x59a0d9,_0x357080?util['inspect'](_0x357080,{'showHidden':![],'depth':null}):'');});};function getUser(_0x112d9b){return client[_0x56a4('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x56a4('0xe'),_0x56a4('0xf'),_0x56a4('0x10')],'where':_0x112d9b,'limit':0x1}})[_0x56a4('0xc')](function(_0x276938){logger[_0x56a4('0x9')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x112d9b),_0x276938?util[_0x56a4('0x8')](_0x276938,{'showHidden':![],'depth':null}):'');return _0x276938[_0x56a4('0x11')]['length']?_0x276938[_0x56a4('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x28f066){return new BPromise(function(_0x3dc204,_0x10971b){if(_0x28f066){return getUser({'internal':_0x28f066})[_0x56a4('0xc')](function(_0x15786f){logger[_0x56a4('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x28f066,_0x15786f?'found':'notfound');return _0x3dc204(_0x15786f);})['catch'](function(_0x388f01){logger[_0x56a4('0xa')]('[utils][getUserByInternal]',_0x388f01?util[_0x56a4('0x8')](_0x388f01,{'showHidden':![],'depth':null}):'');return _0x3dc204(null);});}return _0x3dc204(null);});};exports[_0x56a4('0x12')]=function(_0x46ebbc){return new BPromise(function(_0x1049aa,_0x47d5da){if(_0x46ebbc){return getUser({'interface':_0x46ebbc})['then'](function(_0x272379){logger[_0x56a4('0x7')](_0x56a4('0x13'),_0x46ebbc,_0x272379?_0x56a4('0x14'):_0x56a4('0x15'));return _0x1049aa(_0x272379);})[_0x56a4('0x16')](function(_0x1b9c43){logger['error'](_0x56a4('0x17'),_0x1b9c43?util[_0x56a4('0x8')](_0x1b9c43,{'showHidden':![],'depth':null}):'');return _0x1049aa(null);});}return _0x1049aa(null);});};exports['getUserByName']=function(_0x1ceedd){return new BPromise(function(_0x296daa,_0x90416d){if(_0x1ceedd){return getUser({'name':_0x1ceedd})[_0x56a4('0xc')](function(_0x4d927e){logger[_0x56a4('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x1ceedd,_0x4d927e?'found':_0x56a4('0x15'));return _0x296daa(_0x4d927e);})['catch'](function(_0x43fc61){logger[_0x56a4('0xa')]('[utils][getUserByName]',_0x43fc61?util[_0x56a4('0x8')](_0x43fc61,{'showHidden':![],'depth':null}):'');return _0x296daa(null);});}return _0x296daa(null);});};exports[_0x56a4('0x18')]=function(_0x2cc4e2){return new BPromise(function(_0x1c0ac0,_0x6498b0){if(_0x2cc4e2){return client[_0x56a4('0xb')](_0x56a4('0x19'),{'options':{'raw':!![],'attributes':['id',_0x56a4('0xf'),_0x56a4('0x1a'),'acw',_0x56a4('0x1b')],'where':{'name':_0x2cc4e2},'limit':0x1}})['then'](function(_0xb59059){logger[_0x56a4('0x9')](_0x56a4('0x1c'),_0x2cc4e2,_0xb59059?util['inspect'](_0xb59059,{'showHidden':![],'depth':null}):'');logger[_0x56a4('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2cc4e2,_0xb59059?_0x56a4('0x14'):'notfound');return _0x1c0ac0(_0xb59059[_0x56a4('0x11')][_0x56a4('0x1d')]?_0xb59059[_0x56a4('0x11')][0x0]:null);})[_0x56a4('0x16')](function(_0x1b759a){logger[_0x56a4('0xa')](_0x56a4('0x1e'),_0x1b759a?util[_0x56a4('0x8')](_0x1b759a,{'showHidden':![],'depth':null}):'');return _0x1c0ac0(null);});}return _0x1c0ac0(null);});};exports[_0x56a4('0x1f')]=function(_0xf2cc81,_0x404556){return moment(_0xf2cc81)[_0x56a4('0x20')](_0x404556,'seconds')['format'](_0x56a4('0x21'));};exports[_0x56a4('0x22')]=function(_0x3789b9,_0x3ca1b1){return moment(_0x3789b9)[_0x56a4('0x23')](_0x3ca1b1,_0x56a4('0x24'))[_0x56a4('0x25')](_0x56a4('0x21'));};exports[_0x56a4('0x26')]=function(_0x497d18,_0x3ebaf3){return moment(_0x497d18)[_0x56a4('0x27')](moment(_0x3ebaf3),'seconds');};exports[_0x56a4('0x28')]=function(_0x364f19,_0x1e2c5d){return parseInt(_0x364f19,0xa)+parseInt(_0x1e2c5d,0xa);};exports[_0x56a4('0x29')]=function(){return moment()[_0x56a4('0x25')](_0x56a4('0x21'));};exports[_0x56a4('0x2a')]=function(_0x4ff202,_0x3db5f2){if(_0x3db5f2){return moment(_0x4ff202)[_0x56a4('0x2a')](_0x3db5f2);}return!![];};exports[_0x56a4('0x2b')]=function(_0x444939,_0x4a06cb){if(_0x4a06cb){return moment(_0x444939)[_0x56a4('0x2b')](_0x4a06cb);}else if(_0x444939){return!![];}return![];}; \ No newline at end of file